[mousetweaks] Sync with changes in gsettings-desktop-schemas



commit 2851a95acba714051ba655c1fd425fc89d04754f
Author: Gerd Kohlberger <gerdk src gnome org>
Date:   Fri Oct 22 20:43:35 2010 +0200

    Sync with changes in gsettings-desktop-schemas
    
    Mousetweaks keys that were temporarily in gnome-settings-daemon are
    now also in gsettings-desktop-schemas. Also some of the keys were
    renamed to be more verbose and some key types changed from ints
    to enums.

 configure.ac                              |    2 -
 data/mousetweaks.convert                  |    2 +-
 data/org.gnome.mousetweaks.gschema.xml.in |    2 +-
 src/dwell-click-applet.c                  |   36 +++++-------
 src/mt-common.c                           |   40 +++++++++++++
 src/mt-common.h                           |   40 +++++--------
 src/mt-ctw.c                              |    2 +-
 src/mt-main.c                             |   23 +++++---
 src/mt-settings.c                         |   88 ++++++++++++++--------------
 src/mt-settings.h                         |   35 ++++++------
 10 files changed, 149 insertions(+), 121 deletions(-)
---
diff --git a/configure.ac b/configure.ac
index 7cc24b5..df65f60 100644
--- a/configure.ac
+++ b/configure.ac
@@ -46,14 +46,12 @@ dnl *** dependencies ***
 GLIB_REQUIRED=2.25.3
 GIO_REQUIRED=2.25.9
 GTK_REQUIRED=2.91.0
-GSD_REQUIRED=2.91.0
 GDS_REQUIRED=0.0.2
 
 PKG_CHECK_MODULES(DEPENDENCIES,
     glib-2.0 >= $GLIB_REQUIRED
     gio-2.0 >= $GIO_REQUIRED
     gtk+-3.0 >= $GTK_REQUIRED
-    gnome-settings-daemon >= $GSD_REQUIRED
     gsettings-desktop-schemas >= $GDS_REQUIRED
     x11
     xcursor
diff --git a/data/mousetweaks.convert b/data/mousetweaks.convert
index e7f82a8..8108c00 100644
--- a/data/mousetweaks.convert
+++ b/data/mousetweaks.convert
@@ -1,3 +1,3 @@
 [org.gnome.mousetweaks]
-ctw-style = /desktop/gnome/accessibility/mouse/button_layout
+click-type-window-style = /desktop/gnome/accessibility/mouse/button_layout
 animate-cursor = /desktop/gnome/accessibility/mouse/animate_cursor
diff --git a/data/org.gnome.mousetweaks.gschema.xml.in b/data/org.gnome.mousetweaks.gschema.xml.in
index 371f3cf..21a0b4c 100644
--- a/data/org.gnome.mousetweaks.gschema.xml.in
+++ b/data/org.gnome.mousetweaks.gschema.xml.in
@@ -1,6 +1,6 @@
 <schemalist>
   <schema id="org.gnome.mousetweaks" path="/desktop/gnome/a11y/mouse/" gettext-domain="mousetweaks">
-    <key name="ctw-style" type="i">
+    <key name="click-type-window-style" type="i">
       <default>2</default>
       <_summary>Click type window style</_summary>
       <_description>Button style in the click type window. ("0" = Text, "1" = Icon, "2" = Both)</_description>
diff --git a/src/dwell-click-applet.c b/src/dwell-click-applet.c
index 254ae9e..8be6070 100644
--- a/src/dwell-click-applet.c
+++ b/src/dwell-click-applet.c
@@ -28,8 +28,7 @@
 typedef struct _DwellData DwellData;
 struct _DwellData
 {
-    GSettings   *mt_settings;
-    GSettings   *gsd_settings;
+    GSettings   *settings;
     GDBusProxy  *proxy;
     GtkBuilder  *ui;
     GtkWidget   *box;
@@ -90,8 +89,8 @@ update_sensitivity (DwellData *dd)
     gint mode;
 
     dwell = gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (dd->enable));
-    mode = g_settings_get_int (dd->mt_settings, KEY_DWELL_MODE);
-    sensitive = dd->active && dwell && mode == DWELL_MODE_CTW;
+    mode = g_settings_get_enum (dd->settings, KEY_DWELL_MODE);
+    sensitive = dd->active && dwell && mode == G_DESKTOP_MOUSE_DWELL_MODE_WINDOW;
     gtk_widget_set_sensitive (dd->ct_box, sensitive);
 }
 
@@ -218,8 +217,7 @@ do_not_eat (GtkWidget *widget, GdkEventButton *bev, gpointer user)
 static void
 enable_dwell_changed (GtkToggleButton *button, DwellData *dd)
 {
-    g_settings_set_boolean (dd->gsd_settings,
-                            KEY_DWELL_ENABLED,
+    g_settings_set_boolean (dd->settings, KEY_DWELL_ENABLED,
                             gtk_toggle_button_get_active (button));
 }
 
@@ -385,8 +383,6 @@ applet_orient_changed (PanelApplet *applet,
                        guint        orient,
                        DwellData   *dd)
 {
-    gboolean dwell;
-
     gtk_container_remove (GTK_CONTAINER (applet), g_object_ref (dd->box));
 
     switch (orient)
@@ -418,8 +414,9 @@ applet_orient_changed (PanelApplet *applet,
         g_object_unref (dd->box);
     }
 
-    dwell = g_settings_get_boolean (dd->gsd_settings, KEY_DWELL_ENABLED);
-    gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (dd->enable), dwell);
+    gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (dd->enable),
+                                  g_settings_get_boolean (dd->settings,
+                                                          KEY_DWELL_ENABLED));
     update_sensitivity (dd);
 }
 
@@ -433,8 +430,7 @@ applet_unrealized (GtkWidget *widget, DwellData *dd)
             g_object_unref (dd->click[i]);
 
     g_object_unref (dd->ui);
-    g_object_unref (dd->mt_settings);
-    g_object_unref (dd->gsd_settings);
+    g_object_unref (dd->settings);
     g_object_unref (dd->proxy);
     g_timer_destroy (dd->timer);
 
@@ -621,16 +617,14 @@ fill_applet (PanelApplet *applet)
                       G_CALLBACK (about_response), dd);
 
     /* gsettings */
-    dd->mt_settings = g_settings_new (MT_SCHEMA_ID);
-    g_signal_connect (dd->mt_settings, "value::" KEY_DWELL_MODE,
+    dd->settings = g_settings_new (MOUSETWEAKS_SCHEMA_ID);
+    g_signal_connect (dd->settings, "value::" KEY_DWELL_ENABLED,
+                      G_CALLBACK (dwell_enabled_changed), dd);
+    g_signal_connect (dd->settings, "value::" KEY_DWELL_MODE,
                       G_CALLBACK (dwell_mode_changed), dd);
-    g_signal_connect (dd->mt_settings, "value::" KEY_DWELL_TIME,
+    g_signal_connect (dd->settings, "value::" KEY_DWELL_TIME,
                       G_CALLBACK (dwell_time_changed), dd);
 
-    dd->gsd_settings = g_settings_new (GSD_MOUSE_SCHEMA_ID);
-    g_signal_connect (dd->gsd_settings, "value::" KEY_DWELL_ENABLED,
-                      G_CALLBACK (dwell_enabled_changed), dd);
-
     /* icons */
     dd->click[DWELL_CLICK_TYPE_SINGLE] =
         gdk_pixbuf_new_from_file (DATADIR "/single-click.png", NULL);
@@ -673,9 +667,9 @@ fill_applet (PanelApplet *applet)
         dd->button = WID ("single_click_v");
     }
 
-    dd->delay = g_settings_get_double (dd->mt_settings, KEY_DWELL_TIME);
+    dd->delay = g_settings_get_double (dd->settings, KEY_DWELL_TIME);
     gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (dd->enable), 
-                                  g_settings_get_boolean (dd->gsd_settings,
+                                  g_settings_get_boolean (dd->settings,
                                                           KEY_DWELL_ENABLED));
 
     setup_box (dd);
diff --git a/src/mt-common.c b/src/mt-common.c
index 3d498e8..0d785ff 100644
--- a/src/mt-common.c
+++ b/src/mt-common.c
@@ -19,6 +19,46 @@
 
 #include "mt-common.h"
 
+GType
+g_desktop_mouse_dwell_mode_get_type (void)
+{
+    static volatile gsize type_id__volatile = 0;
+
+    if (g_once_init_enter (&type_id__volatile))
+    {
+        static const GEnumValue values[] =
+        {
+            { G_DESKTOP_MOUSE_DWELL_MODE_WINDOW, "G_DESKTOP_MOUSE_DWELL_MODE_WINDOW", "window" },
+            { G_DESKTOP_MOUSE_DWELL_MODE_GESTURE, "G_DESKTOP_MOUSE_DWELL_MODE_GESTURE", "gesture" },
+            { 0, NULL, NULL }
+        };
+        GType type_id = g_enum_register_static (g_intern_static_string ("GDesktopMouseDwellMode"), values);
+        g_once_init_leave (&type_id__volatile, type_id);
+    }
+    return type_id__volatile;
+}
+
+GType
+g_desktop_mouse_dwell_direction_get_type (void)
+{
+    static volatile gsize type_id__volatile = 0;
+
+    if (g_once_init_enter (&type_id__volatile))
+    {
+        static const GEnumValue values[] =
+        {
+            { G_DESKTOP_MOUSE_DWELL_DIRECTION_LEFT, "G_DESKTOP_MOUSE_DWELL_DIRECTION_LEFT", "left" },
+            { G_DESKTOP_MOUSE_DWELL_DIRECTION_RIGHT, "G_DESKTOP_MOUSE_DWELL_DIRECTION_RIGHT", "right" },
+            { G_DESKTOP_MOUSE_DWELL_DIRECTION_UP, "G_DESKTOP_MOUSE_DWELL_DIRECTION_UP", "up" },
+            { G_DESKTOP_MOUSE_DWELL_DIRECTION_DOWN, "G_DESKTOP_MOUSE_DWELL_DIRECTION_DOWN", "down" },
+            { 0, NULL, NULL }
+        };
+        GType type_id = g_enum_register_static (g_intern_static_string ("GDesktopMouseDwellDirection"), values);
+        g_once_init_leave (&type_id__volatile, type_id);
+    }
+    return type_id__volatile;
+}
+
 Display *
 mt_common_get_xdisplay (void)
 {
diff --git a/src/mt-common.h b/src/mt-common.h
index baca247..1d475fa 100644
--- a/src/mt-common.h
+++ b/src/mt-common.h
@@ -27,21 +27,23 @@
 #include <glib/gi18n.h>
 #include <gtk/gtk.h>
 #include <gdk/gdkx.h>
+#include <gsettings-desktop-schemas/gdesktop-enums.h>
 
 G_BEGIN_DECLS
 
-#define MT_ICON_NAME  "input-mouse"
+#define MT_ICON_NAME                "input-mouse"
 
-#define MOUSETWEAKS_DBUS_NAME  "org.gnome.Mousetweaks"
-#define MOUSETWEAKS_DBUS_IFACE "org.gnome.Mousetweaks"
-#define MOUSETWEAKS_DBUS_PATH  "/org/gnome/Mousetweaks"
+#define MOUSETWEAKS_DBUS_NAME       "org.gnome.Mousetweaks"
+#define MOUSETWEAKS_DBUS_IFACE      "org.gnome.Mousetweaks"
+#define MOUSETWEAKS_DBUS_PATH       "/org/gnome/Mousetweaks"
 
 /* GSettings */
-#define MT_SCHEMA_ID                "org.gnome.mousetweaks"
-#define KEY_CTW_STYLE               "ctw-style"
+#define MOUSETWEAKS_SCHEMA_ID       "org.gnome.mousetweaks"
+#define KEY_CTW_STYLE               "click-type-window-style"
 #define KEY_ANIMATE_CURSOR          "animate-cursor"
 
 #define A11Y_MOUSE_SCHEMA_ID        "org.gnome.desktop.a11y.mouse"
+#define KEY_DWELL_ENABLED           "dwell-click-enabled"
 #define KEY_DWELL_TIME              "dwell-time"
 #define KEY_DWELL_THRESHOLD         "dwell-threshold"
 #define KEY_DWELL_MODE              "dwell-mode"
@@ -49,18 +51,15 @@ G_BEGIN_DECLS
 #define KEY_DWELL_GESTURE_DOUBLE    "dwell-gesture-double"
 #define KEY_DWELL_GESTURE_DRAG      "dwell-gesture-drag"
 #define KEY_DWELL_GESTURE_SECONDARY "dwell-gesture-secondary"
-#define KEY_SSC_TIME                "ssc-time"
-#define KEY_CTW_VISIBLE             "ctw-visible"
-
-#define GSD_MOUSE_SCHEMA_ID         "org.gnome.settings-daemon.peripherals.mouse"
-#define KEY_DWELL_ENABLED           "dwell-click-enabled"
 #define KEY_SSC_ENABLED             "secondary-click-enabled"
+#define KEY_SSC_TIME                "secondary-click-time"
+#define KEY_CTW_VISIBLE             "click-type-window-visible"
 
-enum
-{
-    DWELL_MODE_CTW = 0,
-    DWELL_MODE_GESTURE
-};
+#define G_DESKTOP_TYPE_MOUSE_DWELL_MODE      (g_desktop_mouse_dwell_mode_get_type())
+#define G_DESKTOP_TYPE_MOUSE_DWELL_DIRECTION (g_desktop_mouse_dwell_direction_get_type())
+
+GType   g_desktop_mouse_dwell_mode_get_type      (void) G_GNUC_CONST;
+GType   g_desktop_mouse_dwell_direction_get_type (void) G_GNUC_CONST;
 
 typedef enum
 {
@@ -71,15 +70,6 @@ typedef enum
     N_CLICK_TYPES
 } MtClickType;
 
-enum
-{
-    DIRECTION_LEFT = 0,
-    DIRECTION_RIGHT,
-    DIRECTION_UP,
-    DIRECTION_DOWN,
-    DIRECTION_DISABLE
-};
-
 typedef enum
 {
     MT_MESSAGE_ERROR = 0,
diff --git a/src/mt-ctw.c b/src/mt-ctw.c
index f5782e8..fe1fbb9 100644
--- a/src/mt-ctw.c
+++ b/src/mt-ctw.c
@@ -59,7 +59,7 @@ static void
 ctw_sensitivity_changed (MtSettings *ms, GParamSpec *pspec)
 {
     gtk_widget_set_sensitive (mt_ctw_get_window (),
-                              ms->dwell_mode == DWELL_MODE_CTW);
+                              ms->dwell_mode == G_DESKTOP_MOUSE_DWELL_MODE_WINDOW);
 }
 
 static void
diff --git a/src/mt-main.c b/src/mt-main.c
index 497fd18..39cdcf4 100644
--- a/src/mt-main.c
+++ b/src/mt-main.c
@@ -132,7 +132,8 @@ mt_main_do_dwell_click (MtData *mt)
     ms = mt_settings_get_default ();
     click_type = mt_service_get_click_type (mt->service);
 
-    if (ms->dwell_mode == DWELL_MODE_GESTURE && !mt->dwell_drag_started)
+    if (ms->dwell_mode == G_DESKTOP_MOUSE_DWELL_MODE_GESTURE &&
+        !mt->dwell_drag_started)
     {
         mt_main_generate_motion_event (mt_common_get_screen (),
                                        mt->pointer_x,
@@ -187,31 +188,35 @@ below_threshold (MtData *mt, gint x, gint y)
     return (dx * dx + dy * dy) < (ms->dwell_threshold * ms->dwell_threshold);
 }
 
-static gint
+static GDesktopMouseDwellDirection
 mt_main_get_direction (MtData *mt, gint x, gint y)
 {
     gint dx, dy;
 
     dx = ABS (mt->pointer_x - x);
     dy = ABS (mt->pointer_y - y);
+
     if (mt->pointer_x < x)
     {
         if (dx > dy)
-            return DIRECTION_LEFT;
+            return G_DESKTOP_MOUSE_DWELL_DIRECTION_LEFT;
     }
     else
     {
         if (dx > dy)
-            return DIRECTION_RIGHT;
+            return G_DESKTOP_MOUSE_DWELL_DIRECTION_RIGHT;
     }
-    return mt->pointer_y < y ? DIRECTION_UP : DIRECTION_DOWN;
+
+    return mt->pointer_y < y ? G_DESKTOP_MOUSE_DWELL_DIRECTION_UP :
+                               G_DESKTOP_MOUSE_DWELL_DIRECTION_DOWN;
 }
 
 static gboolean
 mt_main_analyze_gesture (MtData *mt)
 {
     MtSettings *ms;
-    gint direction, x, y;
+    GDesktopMouseDwellDirection direction;
+    gint x, y;
 
     if (mt_service_get_click_type (mt->service) == DWELL_CLICK_TYPE_DRAG)
         return TRUE;
@@ -293,7 +298,7 @@ dwell_timer_finished (MtTimer *timer, MtData *mt)
     ms = mt_settings_get_default ();
     mt_cursor_manager_restore_all (mt_cursor_manager_get_default ());
 
-    if (ms->dwell_mode == DWELL_MODE_CTW)
+    if (ms->dwell_mode == G_DESKTOP_MOUSE_DWELL_MODE_WINDOW)
     {
         mt_main_do_dwell_click (mt);
     }
@@ -706,9 +711,9 @@ mt_main (int argc, char **argv, MtCliArgs cli_args)
     if (cli_args.mode)
     {
         if (g_str_equal (cli_args.mode, "gesture"))
-            ms->dwell_mode = DWELL_MODE_GESTURE;
+            ms->dwell_mode = G_DESKTOP_MOUSE_DWELL_MODE_GESTURE;
         else if (g_str_equal (cli_args.mode, "window"))
-            ms->dwell_mode = DWELL_MODE_CTW;
+            ms->dwell_mode = G_DESKTOP_MOUSE_DWELL_MODE_WINDOW;
 
         g_free (cli_args.mode);
     }
diff --git a/src/mt-settings.c b/src/mt-settings.c
index f3be0ee..73c947b 100644
--- a/src/mt-settings.c
+++ b/src/mt-settings.c
@@ -18,7 +18,6 @@
  */
 
 #include "mt-settings.h"
-#include "mt-common.h"
 
 #define PFLAGS (G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS)
 
@@ -46,25 +45,22 @@ G_DEFINE_TYPE (MtSettings, mt_settings, G_TYPE_OBJECT)
 static void
 mt_settings_init (MtSettings *ms)
 {
-    ms->mt_settings = g_settings_new (MT_SCHEMA_ID);
+    ms->mt_settings = g_settings_new (MOUSETWEAKS_SCHEMA_ID);
 
     BIND_PROP (ms->mt_settings, "ctw-style", KEY_CTW_STYLE);
     BIND_PROP (ms->mt_settings, "animate-cursor", KEY_ANIMATE_CURSOR);
 
     ms->a11y_settings = g_settings_new (A11Y_MOUSE_SCHEMA_ID);
 
+    BIND_PROP (ms->a11y_settings, "dwell-enabled", KEY_DWELL_ENABLED);
     BIND_PROP (ms->a11y_settings, "dwell-threshold", KEY_DWELL_THRESHOLD);
     BIND_PROP (ms->a11y_settings, "dwell-mode", KEY_DWELL_MODE);
     BIND_PROP (ms->a11y_settings, "dwell-gesture-single", KEY_DWELL_GESTURE_SINGLE);
     BIND_PROP (ms->a11y_settings, "dwell-gesture-double", KEY_DWELL_GESTURE_DOUBLE);
     BIND_PROP (ms->a11y_settings, "dwell-gesture-drag", KEY_DWELL_GESTURE_DRAG);
     BIND_PROP (ms->a11y_settings, "dwell-gesture-secondary", KEY_DWELL_GESTURE_SECONDARY);
+    BIND_PROP (ms->a11y_settings, "ssc-enabled", KEY_SSC_ENABLED);
     BIND_PROP (ms->a11y_settings, "ctw-visible", KEY_CTW_VISIBLE);
-
-    ms->gsd_settings = g_settings_new (GSD_MOUSE_SCHEMA_ID);
-
-    BIND_PROP (ms->gsd_settings, "dwell-enabled", KEY_DWELL_ENABLED);
-    BIND_PROP (ms->gsd_settings, "ssc-enabled", KEY_SSC_ENABLED);
 }
 
 static void
@@ -78,12 +74,6 @@ mt_settings_dispose (GObject *object)
         ms->mt_settings = NULL;
     }
 
-    if (ms->gsd_settings)
-    {
-        g_object_unref (ms->gsd_settings);
-        ms->gsd_settings = NULL;
-    }
-
     if (ms->a11y_settings)
     {
         g_object_unref (ms->a11y_settings);
@@ -110,19 +100,19 @@ mt_settings_set_property (GObject      *object,
             ms->dwell_threshold = g_value_get_int (value);
             break;
         case PROP_DWELL_MODE:
-            ms->dwell_mode = g_value_get_int (value);
+            ms->dwell_mode = g_value_get_enum (value);
             break;
         case PROP_DWELL_GESTURE_SINGLE:
-            ms->dwell_gesture_single = g_value_get_int (value);
+            ms->dwell_gesture_single = g_value_get_enum (value);
             break;
         case PROP_DWELL_GESTURE_DOUBLE:
-            ms->dwell_gesture_double = g_value_get_int (value);
+            ms->dwell_gesture_double = g_value_get_enum (value);
             break;
         case PROP_DWELL_GESTURE_DRAG:
-            ms->dwell_gesture_drag = g_value_get_int (value);
+            ms->dwell_gesture_drag = g_value_get_enum (value);
             break;
         case PROP_DWELL_GESTURE_SECONDARY:
-            ms->dwell_gesture_secondary = g_value_get_int (value);
+            ms->dwell_gesture_secondary = g_value_get_enum (value);
             break;
         case PROP_SSC_ENABLED:
             ms->ssc_enabled = g_value_get_boolean (value);
@@ -158,19 +148,19 @@ mt_settings_get_property (GObject    *object,
             g_value_set_int (value, ms->dwell_threshold);
             break;
         case PROP_DWELL_MODE:
-            g_value_set_int (value, ms->dwell_mode);
+            g_value_set_enum (value, ms->dwell_mode);
             break;
         case PROP_DWELL_GESTURE_SINGLE:
-            g_value_set_int (value, ms->dwell_gesture_single);
+            g_value_set_enum (value, ms->dwell_gesture_single);
             break;
         case PROP_DWELL_GESTURE_DOUBLE:
-            g_value_set_int (value, ms->dwell_gesture_double);
+            g_value_set_enum (value, ms->dwell_gesture_double);
             break;
         case PROP_DWELL_GESTURE_DRAG:
-            g_value_set_int (value, ms->dwell_gesture_drag);
+            g_value_set_enum (value, ms->dwell_gesture_drag);
             break;
         case PROP_DWELL_GESTURE_SECONDARY:
-            g_value_set_int (value, ms->dwell_gesture_secondary);
+            g_value_set_enum (value, ms->dwell_gesture_secondary);
             break;
         case PROP_SSC_ENABLED:
             g_value_set_boolean (value, ms->ssc_enabled);
@@ -213,34 +203,44 @@ mt_settings_class_init (MtSettingsClass *klass)
                                                        0, 30, 0, PFLAGS));
     g_object_class_install_property (object_class,
                                      PROP_DWELL_MODE,
-                                     g_param_spec_int ("dwell-mode",
-                                                       "Dwell mode",
-                                                       "Dwell click mode",
-                                                       0, 1, 0, PFLAGS));
+                                     g_param_spec_enum ("dwell-mode",
+                                                        "Dwell mode",
+                                                        "Dwell click mode",
+                                                        G_DESKTOP_TYPE_MOUSE_DWELL_MODE,
+                                                        G_DESKTOP_MOUSE_DWELL_MODE_WINDOW,
+                                                        PFLAGS));
     g_object_class_install_property (object_class,
                                      PROP_DWELL_GESTURE_SINGLE,
-                                     g_param_spec_int ("dwell-gesture-single",
-                                                       "Dwell gesture single",
-                                                       "Gesture for single click",
-                                                       0, 3, 0, PFLAGS));
+                                     g_param_spec_enum ("dwell-gesture-single",
+                                                        "Dwell gesture single",
+                                                        "Gesture for single click",
+                                                        G_DESKTOP_TYPE_MOUSE_DWELL_DIRECTION,
+                                                        G_DESKTOP_MOUSE_DWELL_DIRECTION_LEFT,
+                                                        PFLAGS));
     g_object_class_install_property (object_class,
                                      PROP_DWELL_GESTURE_DOUBLE,
-                                     g_param_spec_int ("dwell-gesture-double",
-                                                       "Dwell gesture double",
-                                                       "Gesture for double click",
-                                                       0, 3, 0, PFLAGS));
+                                     g_param_spec_enum ("dwell-gesture-double",
+                                                        "Dwell gesture double",
+                                                        "Gesture for double click",
+                                                        G_DESKTOP_TYPE_MOUSE_DWELL_DIRECTION,
+                                                        G_DESKTOP_MOUSE_DWELL_DIRECTION_UP,
+                                                        PFLAGS));
     g_object_class_install_property (object_class,
                                      PROP_DWELL_GESTURE_DRAG,
-                                     g_param_spec_int ("dwell-gesture-drag",
-                                                       "Dwell gesture drag",
-                                                       "Gesture for drag action",
-                                                       0, 3, 0, PFLAGS));
+                                     g_param_spec_enum ("dwell-gesture-drag",
+                                                        "Dwell gesture drag",
+                                                        "Gesture for drag action",
+                                                        G_DESKTOP_TYPE_MOUSE_DWELL_DIRECTION,
+                                                        G_DESKTOP_MOUSE_DWELL_DIRECTION_DOWN,
+                                                        PFLAGS));
     g_object_class_install_property (object_class,
                                      PROP_DWELL_GESTURE_SECONDARY,
-                                     g_param_spec_int ("dwell-gesture-secondary",
-                                                       "Dwell gesture secondary",
-                                                       "Gesture for secondary click",
-                                                       0, 3, 0, PFLAGS));
+                                     g_param_spec_enum ("dwell-gesture-secondary",
+                                                        "Dwell gesture secondary",
+                                                        "Gesture for secondary click",
+                                                        G_DESKTOP_TYPE_MOUSE_DWELL_DIRECTION,
+                                                        G_DESKTOP_MOUSE_DWELL_DIRECTION_RIGHT,
+                                                        PFLAGS));
     g_object_class_install_property (object_class,
                                      PROP_SSC_ENABLED,
                                      g_param_spec_boolean ("ssc-enabled",
@@ -252,7 +252,7 @@ mt_settings_class_init (MtSettingsClass *klass)
                                      g_param_spec_boolean ("ctw-visible",
                                                            "CTW visible",
                                                            "Show click-type window",
-                                                           FALSE, PFLAGS));
+                                                           TRUE, PFLAGS));
     g_object_class_install_property (object_class,
                                      PROP_CTW_STYLE,
                                      g_param_spec_int ("ctw-style",
diff --git a/src/mt-settings.h b/src/mt-settings.h
index 27be476..efbc371 100644
--- a/src/mt-settings.h
+++ b/src/mt-settings.h
@@ -22,6 +22,8 @@
 
 #include <gio/gio.h>
 
+#include "mt-common.h"
+
 G_BEGIN_DECLS
 
 #define MT_TYPE_SETTINGS  (mt_settings_get_type ())
@@ -33,23 +35,22 @@ typedef struct _MtSettings MtSettings;
 
 struct _MtSettings
 {
-    GObject    parent;
-
-    GSettings *mt_settings;
-    GSettings *gsd_settings;
-    GSettings *a11y_settings;
-
-    gint       dwell_threshold;
-    gint       dwell_mode;
-    gint       dwell_gesture_single;
-    gint       dwell_gesture_double;
-    gint       dwell_gesture_drag;
-    gint       dwell_gesture_secondary;
-    gint       ctw_style;
-    guint      dwell_enabled  : 1;
-    guint      ssc_enabled    : 1;
-    guint      ctw_visible    : 1;
-    guint      animate_cursor : 1;
+    GObject                     parent;
+
+    GSettings                  *mt_settings;
+    GSettings                  *a11y_settings;
+
+    GDesktopMouseDwellMode      dwell_mode;
+    GDesktopMouseDwellDirection dwell_gesture_single;
+    GDesktopMouseDwellDirection dwell_gesture_double;
+    GDesktopMouseDwellDirection dwell_gesture_drag;
+    GDesktopMouseDwellDirection dwell_gesture_secondary;
+    gint                        dwell_threshold;
+    gint                        ctw_style;
+    guint                       dwell_enabled  : 1;
+    guint                       ssc_enabled    : 1;
+    guint                       ctw_visible    : 1;
+    guint                       animate_cursor : 1;
 };
 
 GType             mt_settings_get_type              (void) G_GNUC_CONST;



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]