6 #include <clutter/clutter.h>
8 #include "gtk-clutter-util.h"
11 * SECTION:gtk-clutter-util
12 * @short_description: Utility functions for integrating Clutter in GTK+
19 gtk_clutter_get_component (GtkWidget *widget,
24 GtkStyle *style = gtk_widget_get_style (widget);
25 GdkColor gtk_color = { 0, };
30 gtk_color = style->fg[state];
34 gtk_color = style->bg[state];
38 gtk_color = style->text[state];
42 gtk_color = style->base[state];
46 g_assert_not_reached ();
50 color->red = (guint8) ((gtk_color.red / 65535.0) * 255);
51 color->green = (guint8) ((gtk_color.green / 65535.0) * 255);
52 color->blue = (guint8) ((gtk_color.blue / 65535.0) * 255);
56 * gtk_clutter_get_fg_color:
66 gtk_clutter_get_fg_color (GtkWidget *widget,
70 g_return_if_fail (GTK_IS_WIDGET (widget));
71 g_return_if_fail (state >= GTK_STATE_NORMAL &&
72 state <= GTK_STATE_INSENSITIVE);
73 g_return_if_fail (color != NULL);
75 gtk_clutter_get_component (widget, GTK_RC_FG, state, color);
79 * gtk_clutter_get_bg_color:
89 gtk_clutter_get_bg_color (GtkWidget *widget,
93 g_return_if_fail (GTK_IS_WIDGET (widget));
94 g_return_if_fail (state >= GTK_STATE_NORMAL &&
95 state <= GTK_STATE_INSENSITIVE);
96 g_return_if_fail (color != NULL);
98 gtk_clutter_get_component (widget, GTK_RC_BG, state, color);
102 * gtk_clutter_get_text_color:
112 gtk_clutter_get_text_color (GtkWidget *widget,
116 g_return_if_fail (GTK_IS_WIDGET (widget));
117 g_return_if_fail (state >= GTK_STATE_NORMAL &&
118 state <= GTK_STATE_INSENSITIVE);
119 g_return_if_fail (color != NULL);
121 gtk_clutter_get_component (widget, GTK_RC_TEXT, state, color);
125 * gtk_clutter_get_base_color:
135 gtk_clutter_get_base_color (GtkWidget *widget,
139 g_return_if_fail (GTK_IS_WIDGET (widget));
140 g_return_if_fail (state >= GTK_STATE_NORMAL &&
141 state <= GTK_STATE_INSENSITIVE);
142 g_return_if_fail (color != NULL);
144 gtk_clutter_get_component (widget, GTK_RC_BASE, state, color);