event-controller: in the long-press controller rename "timeout" property to "trigger-delay"

Signed-off-by: Carlos Garnacho <carlos@lanedo.com>
Acked-by: Simon Schampijer <simon@laptop.org>
This commit is contained in:
Carlos Garnacho 2012-09-13 14:26:19 +02:00 committed by Simon Schampijer
parent ec42f63630
commit 73c0688689

View File

@ -22,7 +22,7 @@
#include "sugar-long-press-controller.h" #include "sugar-long-press-controller.h"
#define DEFAULT_THRESHOLD 32 #define DEFAULT_THRESHOLD 32
#define DEFAULT_TIMEOUT 800 #define DEFAULT_TRIGGER_DELAY 800
#define ANIM_WINDOW_WIDTH 100 #define ANIM_WINDOW_WIDTH 100
#define ARC_LINE_WIDTH 10 #define ARC_LINE_WIDTH 10
@ -31,7 +31,7 @@ typedef struct _SugarLongPressControllerPriv SugarLongPressControllerPriv;
enum { enum {
PROP_0, PROP_0,
PROP_THRESHOLD, PROP_THRESHOLD,
PROP_TIMEOUT PROP_TRIGGER_DELAY
}; };
struct _SugarLongPressControllerPriv struct _SugarLongPressControllerPriv
@ -47,7 +47,7 @@ struct _SugarLongPressControllerPriv
guint anim_id; guint anim_id;
guint timeout_id; guint timeout_id;
guint threshold; guint threshold;
guint timeout; guint delay;
guint cancelled : 1; guint cancelled : 1;
guint triggered : 1; guint triggered : 1;
}; };
@ -65,7 +65,7 @@ sugar_long_press_controller_init (SugarLongPressController *controller)
SUGAR_TYPE_LONG_PRESS_CONTROLLER, SUGAR_TYPE_LONG_PRESS_CONTROLLER,
SugarLongPressControllerPriv); SugarLongPressControllerPriv);
priv->threshold = DEFAULT_THRESHOLD; priv->threshold = DEFAULT_THRESHOLD;
priv->timeout = DEFAULT_TIMEOUT; priv->delay = DEFAULT_TRIGGER_DELAY;
priv->x = priv->y = -1; priv->x = priv->y = -1;
priv->root_x = priv->root_y = -1; priv->root_x = priv->root_y = -1;
} }
@ -128,8 +128,8 @@ sugar_long_press_controller_get_property (GObject *object,
case PROP_THRESHOLD: case PROP_THRESHOLD:
g_value_set_uint (value, priv->threshold); g_value_set_uint (value, priv->threshold);
break; break;
case PROP_TIMEOUT: case PROP_TRIGGER_DELAY:
g_value_set_uint (value, priv->timeout); g_value_set_uint (value, priv->delay);
break; break;
default: default:
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec); G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
@ -150,8 +150,8 @@ sugar_long_press_controller_set_property (GObject *object,
case PROP_THRESHOLD: case PROP_THRESHOLD:
priv->threshold = g_value_get_uint (value); priv->threshold = g_value_get_uint (value);
break; break;
case PROP_TIMEOUT: case PROP_TRIGGER_DELAY:
priv->timeout = g_value_get_uint (value); priv->delay = g_value_get_uint (value);
break; break;
default: default:
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec); G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
@ -396,7 +396,7 @@ sugar_long_press_controller_handle_event (SugarEventController *controller,
_sugar_long_press_anim_timeout, _sugar_long_press_anim_timeout,
controller); controller);
priv->timeout_id = priv->timeout_id =
gdk_threads_add_timeout (priv->timeout, gdk_threads_add_timeout (priv->delay,
_sugar_long_press_controller_timeout, _sugar_long_press_controller_timeout,
controller); controller);
g_object_notify (G_OBJECT (controller), "state"); g_object_notify (G_OBJECT (controller), "state");
@ -445,11 +445,11 @@ sugar_long_press_controller_class_init (SugarLongPressControllerClass *klass)
G_PARAM_STATIC_NICK | G_PARAM_STATIC_NICK |
G_PARAM_STATIC_BLURB)); G_PARAM_STATIC_BLURB));
g_object_class_install_property (object_class, g_object_class_install_property (object_class,
PROP_TIMEOUT, PROP_TRIGGER_DELAY,
g_param_spec_uint ("timeout", g_param_spec_uint ("trigger-delay",
"Timeout", "Trigger delay",
"Value in milliseconds to timeout the triggering", "delay in milliseconds before the gesture is triggered",
0, G_MAXUINT, DEFAULT_TIMEOUT, 0, G_MAXUINT, DEFAULT_TRIGGER_DELAY,
G_PARAM_READWRITE | G_PARAM_READWRITE |
G_PARAM_STATIC_NAME | G_PARAM_STATIC_NAME |
G_PARAM_STATIC_NICK | G_PARAM_STATIC_NICK |