[clutter] settings: Add the :long-press-duration
- From: Emmanuele Bassi <ebassi src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [clutter] settings: Add the :long-press-duration
- Date: Thu, 9 Jun 2011 14:13:44 +0000 (UTC)
commit 93207d08f80c66628f9dbf673a6f7dadc9fc9845
Author: Emmanuele Bassi <ebassi linux intel com>
Date: Thu Jun 9 14:33:17 2011 +0100
settings: Add the :long-press-duration
A property to control the minimum time that has to elapse before a press
is recognized as a long press. This will be used by ClutterClickAction,
but it can be shared across touch-based gestures.
clutter/clutter-settings.c | 32 ++++++++++++++++++++++++++++++++
1 files changed, 32 insertions(+), 0 deletions(-)
---
diff --git a/clutter/clutter-settings.c b/clutter/clutter-settings.c
index 75742ba..f527b45 100644
--- a/clutter/clutter-settings.c
+++ b/clutter/clutter-settings.c
@@ -59,6 +59,8 @@ struct _ClutterSettings
gint xft_antialias;
gchar *xft_hint_style;
gchar *xft_rgba;
+
+ gint long_press_duration;
};
struct _ClutterSettingsClass
@@ -85,6 +87,8 @@ enum
PROP_FONT_HINT_STYLE,
PROP_FONT_RGBA,
+ PROP_LONG_PRESS_DURATION,
+
PROP_LAST
};
@@ -251,6 +255,10 @@ clutter_settings_set_property (GObject *gobject,
settings_update_font_options (self);
break;
+ case PROP_LONG_PRESS_DURATION:
+ self->long_press_duration = g_value_get_int (value);
+ break;
+
default:
G_OBJECT_WARN_INVALID_PROPERTY_ID (gobject, prop_id, pspec);
break;
@@ -303,6 +311,10 @@ clutter_settings_get_property (GObject *gobject,
g_value_set_string (value, self->xft_rgba);
break;
+ case PROP_LONG_PRESS_DURATION:
+ g_value_set_int (value, self->long_press_duration);
+ break;
+
default:
G_OBJECT_WARN_INVALID_PROPERTY_ID (gobject, prop_id, pspec);
break;
@@ -494,6 +506,24 @@ clutter_settings_class_init (ClutterSettingsClass *klass)
NULL,
CLUTTER_PARAM_READWRITE);
+ /**
+ * ClutterSettings:long-press-duration:
+ *
+ * Sets the minimum duration for a press to be recognized as a long press
+ * gesture. The duration is expressed in milliseconds.
+ *
+ * See also #ClutterClickAction:long-press-duration.
+ *
+ * Since: 1.8
+ */
+ obj_props[PROP_LONG_PRESS_DURATION] =
+ g_param_spec_int ("long-press-duration",
+ P_("Long Press Duration"),
+ P_("The minimum duration for a long press gesture to be recognized"),
+ 0, G_MAXINT,
+ 500,
+ CLUTTER_PARAM_READWRITE);
+
gobject_class->set_property = clutter_settings_set_property;
gobject_class->get_property = clutter_settings_get_property;
gobject_class->notify = clutter_settings_notify;
@@ -517,6 +547,8 @@ clutter_settings_init (ClutterSettings *self)
self->xft_hinting = -1;
self->xft_hint_style = NULL;
self->xft_rgba = NULL;
+
+ self->long_press_duration = 500;
}
/**
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]