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 /gtk/gtksettings.c | |
parent | 811b03aef1456ce88499896fa0618e219fd533ae (diff) | |
download | gtk+-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 'gtk/gtksettings.c')
-rw-r--r-- | gtk/gtksettings.c | 34 |
1 files changed, 27 insertions, 7 deletions
diff --git a/gtk/gtksettings.c b/gtk/gtksettings.c index 214bdcc305..ee5c187dbe 100644 --- a/gtk/gtksettings.c +++ b/gtk/gtksettings.c @@ -21,7 +21,9 @@ enum { PROP_0, - PROP_DOUBLE_CLICK_TIMEOUT + PROP_DOUBLE_CLICK_TIME, + PROP_CURSOR_BLINK, + PROP_CURSOR_BLINK_TIME, }; @@ -126,13 +128,29 @@ gtk_settings_class_init (GtkSettingsClass *class) g_assert (quark_property_id != 0); /* special quarks from GObjectClass */ result = settings_install_property_parser (class, - g_param_spec_int ("gtk-double-click-timeout", - _("Double Click Timeout"), - _("Maximum time allowed between two clicks for them to be considered a double click"), + g_param_spec_int ("gtk-double-click-time", + _("Double Click Time"), + _("Maximum time allowed between two clicks for them to be considered a double click (in milliseconds)"), 0, G_MAXINT, 250, G_PARAM_READWRITE), NULL); - g_assert (result == PROP_DOUBLE_CLICK_TIMEOUT); + g_assert (result == PROP_DOUBLE_CLICK_TIME); + result = settings_install_property_parser (class, + g_param_spec_boolean ("gtk-cursor-blink", + _("Cursor Blink"), + _("Whether the cursor should blink"), + TRUE, + G_PARAM_READWRITE), + NULL); + g_assert (result == PROP_CURSOR_BLINK); + result = settings_install_property_parser (class, + g_param_spec_int ("gtk-cursor-blink-time", + _("Cursor Blink Time"), + _("Length of the cursor blink cycle, in milleseconds"), + 100, G_MAXINT, 1200, + G_PARAM_READWRITE), + NULL); + g_assert (result == PROP_CURSOR_BLINK_TIME); } static void @@ -201,7 +219,9 @@ gtk_settings_get_property (GObject *object, { GtkSettings *settings = GTK_SETTINGS (object); - if (!gdk_setting_get (pspec->name, value)) + if (gdk_setting_get (pspec->name, value)) + g_param_value_validate (pspec, value); + else g_value_copy (settings->property_values + property_id - 1, value); } @@ -221,7 +241,7 @@ gtk_settings_notify (GObject *object, switch (property_id) { - case PROP_DOUBLE_CLICK_TIMEOUT: + case PROP_DOUBLE_CLICK_TIME: g_object_get (object, pspec->name, &double_click_time, NULL); gdk_set_double_click_time (double_click_time); break; |