diff options
author | Owen Taylor <otaylor@redhat.com> | 2001-05-30 20:40:28 +0000 |
---|---|---|
committer | Owen Taylor <otaylor@src.gnome.org> | 2001-05-30 20:40:28 +0000 |
commit | 27bf39f924eb1e9600d574e2f97f0fb0cc2e6495 (patch) | |
tree | 4ca99341dca29756863e53c3a1b0f4c2540c407b /gdk | |
parent | 811b03aef1456ce88499896fa0618e219fd533ae (diff) | |
download | gdk-pixbuf-27bf39f924eb1e9600d574e2f97f0fb0cc2e6495.tar.gz |
Validate value from GDK settings against parameter spec.
Wed May 30 15:56:30 2001 Owen Taylor <otaylor@redhat.com>
* gtk/gtksettings.c (gtk_settings_get_property): Validate
value from GDK settings against parameter spec.
* gdk/x11/gdkevents-x11.c (gdk_setting_get): Add assignments
to temporary values and use g_value_transform(), since
thinking that GValue was going to be easy or efficient
to use was, of course, a mistake.
* gtk/gtksettings.c: Add cursor blink setting.
* gdk/x11/gdkevents-x11.c: Add cursor blink X settings.
* gtk/gtkentry.c: Add cursor blinking.
* gtk/gtktextview.c (gtk_text_view_check_cursor_blink): Use
cursor blink global settings.
* gtk/gtkentry.c (gtk_entry_button_press): Add notification
for :text_position in places where it is missing.
Diffstat (limited to 'gdk')
-rw-r--r-- | gdk/x11/gdkevents-x11.c | 23 |
1 files changed, 19 insertions, 4 deletions
diff --git a/gdk/x11/gdkevents-x11.c b/gdk/x11/gdkevents-x11.c index 2655d4278..ab931ad82 100644 --- a/gdk/x11/gdkevents-x11.c +++ b/gdk/x11/gdkevents-x11.c @@ -1912,7 +1912,9 @@ static struct const char *gdk_name; } settings_map[] = { { "Net/DoubleClickTime", "gtk-double-click-timeout" }, - { "Net/DragThreshold", "gtk-drag-threshold" } + { "Net/DragThreshold", "gtk-drag-threshold" }, + { "Net/CursorBlink", "gtk-cursor-blink" }, + { "Net/CursorBlinkTime", "gtk-cursor-blink-time" } }; static void @@ -1981,6 +1983,7 @@ gdk_setting_get (const gchar *name, XSettingsSetting *setting; gboolean success = FALSE; gint i; + GValue tmp_val = { 0, }; for (i = 0; i < G_N_ELEMENTS (settings_map) ; i++) if (strcmp (settings_map[i].gdk_name, name) == 0) @@ -2001,14 +2004,20 @@ gdk_setting_get (const gchar *name, case XSETTINGS_TYPE_INT: if (check_transform (xsettings_name, G_TYPE_INT, G_VALUE_TYPE (value))) { - g_value_set_int (value, setting->data.v_int); + g_value_init (&tmp_val, G_TYPE_INT); + g_value_set_int (&tmp_val, setting->data.v_int); + g_value_transform (&tmp_val, value); + success = TRUE; } break; case XSETTINGS_TYPE_STRING: if (check_transform (xsettings_name, G_TYPE_STRING, G_VALUE_TYPE (value))) { - g_value_set_string (value, setting->data.v_string); + g_value_init (&tmp_val, G_TYPE_STRING); + g_value_set_string (&tmp_val, setting->data.v_string); + g_value_transform (&tmp_val, value); + success = TRUE; } break; @@ -2017,17 +2026,23 @@ gdk_setting_get (const gchar *name, { GdkColor color; + g_value_init (&tmp_val, GDK_TYPE_COLOR); + color.pixel = 0; color.red = setting->data.v_color.red; color.green = setting->data.v_color.green; color.blue = setting->data.v_color.blue; - g_value_set_boxed (value, &color); + g_value_set_boxed (&tmp_val, &color); + + g_value_transform (&tmp_val, value); success = TRUE; } break; } + + g_value_unset (&tmp_val); xsettings_setting_free (setting); |