[gtk+] Make gtk_widget_override_cursor() take GdkRGBAs
- From: Carlos Garnacho <carlosg src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtk+] Make gtk_widget_override_cursor() take GdkRGBAs
- Date: Sat, 4 Dec 2010 16:50:13 +0000 (UTC)
commit 3d28adf31779632d980097b92c472904b258a520
Author: Carlos Garnacho <carlosg gnome org>
Date: Sat Dec 4 17:44:53 2010 +0100
Make gtk_widget_override_cursor() take GdkRGBAs
Even though the style properties have the GdkColor type, the other
gtk_widget_override_* API takes RGBA colors, so it is consistent
now.
docs/reference/gtk/tmpl/gtkenums.sgml | 48 +++++++++++++++++++++++++++
docs/reference/gtk/tmpl/gtkiconfactory.sgml | 11 ++++++
docs/reference/gtk/tmpl/gtkicontheme.sgml | 12 +++++++
gtk/gtkmodifierstyle.c | 21 +++++++----
gtk/gtkmodifierstyle.h | 2 +-
gtk/gtkwidget.c | 9 +++--
gtk/gtkwidget.h | 4 +-
7 files changed, 93 insertions(+), 14 deletions(-)
---
diff --git a/docs/reference/gtk/tmpl/gtkenums.sgml b/docs/reference/gtk/tmpl/gtkenums.sgml
index 24b4d33..897821f 100644
--- a/docs/reference/gtk/tmpl/gtkenums.sgml
+++ b/docs/reference/gtk/tmpl/gtkenums.sgml
@@ -326,6 +326,18 @@ Used to change the appearance of an outline typically provided by a #GtkFrame.
@GTK_STATE_INCONSISTENT:
@GTK_STATE_FOCUSED:
+<!-- ##### ENUM GtkStateFlags ##### -->
+<para>
+
+</para>
+
+ GTK_STATE_FLAG_ACTIVE:
+ GTK_STATE_FLAG_PRELIGHT:
+ GTK_STATE_FLAG_SELECTED:
+ GTK_STATE_FLAG_INSENSITIVE:
+ GTK_STATE_FLAG_INCONSISTENT:
+ GTK_STATE_FLAG_FOCUSED:
+
<!-- ##### ENUM GtkToolbarStyle ##### -->
<para>
Used to customize the appearance of a #GtkToolbar. Note that
@@ -408,3 +420,39 @@ The value can by obtained by connecting to the
@GTK_DRAG_RESULT_ERROR: The drag operation failed due to some
unspecified error
+<!-- ##### ENUM GtkJunctionSides ##### -->
+<para>
+
+</para>
+
+ GTK_JUNCTION_NONE:
+ GTK_JUNCTION_CORNER_TOPLEFT:
+ GTK_JUNCTION_CORNER_TOPRIGHT:
+ GTK_JUNCTION_CORNER_BOTTOMLEFT:
+ GTK_JUNCTION_CORNER_BOTTOMRIGHT:
+ GTK_JUNCTION_TOP:
+ GTK_JUNCTION_BOTTOM:
+ GTK_JUNCTION_LEFT:
+ GTK_JUNCTION_RIGHT:
+
+<!-- ##### ENUM GtkBorderStyle ##### -->
+<para>
+
+</para>
+
+ GTK_BORDER_STYLE_NONE:
+ GTK_BORDER_STYLE_SOLID:
+ GTK_BORDER_STYLE_INSET:
+ GTK_BORDER_STYLE_OUTSET:
+
+<!-- ##### ENUM GtkRegionFlags ##### -->
+<para>
+
+</para>
+
+ GTK_REGION_EVEN:
+ GTK_REGION_ODD:
+ GTK_REGION_FIRST:
+ GTK_REGION_LAST:
+ GTK_REGION_SORTED:
+
diff --git a/docs/reference/gtk/tmpl/gtkiconfactory.sgml b/docs/reference/gtk/tmpl/gtkiconfactory.sgml
index 614b50e..b5e3a3e 100644
--- a/docs/reference/gtk/tmpl/gtkiconfactory.sgml
+++ b/docs/reference/gtk/tmpl/gtkiconfactory.sgml
@@ -279,6 +279,17 @@ This attribute is optional.</para>
@Returns:
+<!-- ##### FUNCTION gtk_icon_set_render_icon_pixbuf ##### -->
+<para>
+
+</para>
+
+ icon_set:
+ context:
+ size:
+ Returns:
+
+
<!-- ##### FUNCTION gtk_icon_set_unref ##### -->
<para>
diff --git a/docs/reference/gtk/tmpl/gtkicontheme.sgml b/docs/reference/gtk/tmpl/gtkicontheme.sgml
index e18a6ad..0bcae21 100644
--- a/docs/reference/gtk/tmpl/gtkicontheme.sgml
+++ b/docs/reference/gtk/tmpl/gtkicontheme.sgml
@@ -449,6 +449,18 @@ The #GQuark used for #GtkIconThemeError errors.
@Returns:
+<!-- ##### FUNCTION gtk_icon_info_load_symbolic_for_context ##### -->
+<para>
+
+</para>
+
+ icon_info:
+ context:
+ was_symbolic:
+ error:
+ Returns:
+
+
<!-- ##### FUNCTION gtk_icon_info_set_raw_coordinates ##### -->
<para>
diff --git a/gtk/gtkmodifierstyle.c b/gtk/gtkmodifierstyle.c
index a8f4d3d..48a4f21 100644
--- a/gtk/gtkmodifierstyle.c
+++ b/gtk/gtkmodifierstyle.c
@@ -98,7 +98,8 @@ gtk_modifier_style_get_style_property (GtkStyleProvider *provider,
GValue *value)
{
GtkModifierStylePrivate *priv;
- GdkColor *color;
+ GdkRGBA *rgba;
+ GdkColor color;
gchar *str;
/* Reject non-color types for now */
@@ -110,13 +111,17 @@ gtk_modifier_style_get_style_property (GtkStyleProvider *provider,
g_type_name (pspec->owner_type),
pspec->name);
- color = g_hash_table_lookup (priv->color_properties, str);
+ rgba = g_hash_table_lookup (priv->color_properties, str);
g_free (str);
- if (!color)
+ if (!rgba)
return FALSE;
- g_value_set_boxed (value, color);
+ color.red = (guint) (rgba->red * 65535.) + 0.5;
+ color.green = (guint) (rgba->green * 65535.) + 0.5;
+ color.blue = (guint) (rgba->blue * 65535.) + 0.5;
+
+ g_value_set_boxed (value, &color);
return TRUE;
}
@@ -254,10 +259,10 @@ void
gtk_modifier_style_set_color_property (GtkModifierStyle *style,
GType widget_type,
const gchar *prop_name,
- const GdkColor *color)
+ const GdkRGBA *color)
{
GtkModifierStylePrivate *priv;
- const GdkColor *old_color;
+ const GdkRGBA *old_color;
gchar *str;
g_return_if_fail (GTK_IS_MODIFIER_STYLE (style));
@@ -270,7 +275,7 @@ gtk_modifier_style_set_color_property (GtkModifierStyle *style,
old_color = g_hash_table_lookup (priv->color_properties, str);
if ((!color && !old_color) ||
- (color && old_color && gdk_color_equal (color, old_color)))
+ (color && old_color && gdk_rgba_equal (color, old_color)))
{
g_free (str);
return;
@@ -278,7 +283,7 @@ gtk_modifier_style_set_color_property (GtkModifierStyle *style,
if (color)
g_hash_table_insert (priv->color_properties, str,
- gdk_color_copy (color));
+ gdk_rgba_copy (color));
else
g_hash_table_remove (priv->color_properties, str);
diff --git a/gtk/gtkmodifierstyle.h b/gtk/gtkmodifierstyle.h
index 6275b7c..e211a80 100644
--- a/gtk/gtkmodifierstyle.h
+++ b/gtk/gtkmodifierstyle.h
@@ -67,7 +67,7 @@ void gtk_modifier_style_map_color (GtkModifierStyle *style,
void gtk_modifier_style_set_color_property (GtkModifierStyle *style,
GType widget_type,
const gchar *prop_name,
- const GdkColor *color);
+ const GdkRGBA *color);
G_END_DECLS
diff --git a/gtk/gtkwidget.c b/gtk/gtkwidget.c
index 93d5ee4..2fa0df2 100644
--- a/gtk/gtkwidget.c
+++ b/gtk/gtkwidget.c
@@ -8109,12 +8109,15 @@ gtk_widget_override_symbolic_color (GtkWidget *widget,
* style properties. All other style values are left untouched.
* See also gtk_widget_modify_style().
*
+ * Note that the underlying properties have the #GdkColor type,
+ * so the alpha value in @primary and @secondary will be ignored.
+ *
* Since: 3.0
**/
void
-gtk_widget_override_cursor (GtkWidget *widget,
- const GdkColor *cursor,
- const GdkColor *secondary_cursor)
+gtk_widget_override_cursor (GtkWidget *widget,
+ const GdkRGBA *cursor,
+ const GdkRGBA *secondary_cursor)
{
GtkModifierStyle *style;
diff --git a/gtk/gtkwidget.h b/gtk/gtkwidget.h
index 83cdb66..04f7772 100644
--- a/gtk/gtkwidget.h
+++ b/gtk/gtkwidget.h
@@ -774,8 +774,8 @@ void gtk_widget_override_symbolic_color (GtkWidget *widget,
const gchar *name,
const GdkRGBA *color);
void gtk_widget_override_cursor (GtkWidget *widget,
- const GdkColor *cursor,
- const GdkColor *secondary_cursor);
+ const GdkRGBA *cursor,
+ const GdkRGBA *secondary_cursor);
void gtk_widget_style_attach (GtkWidget *widget);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]