gpointing-device-settings r251 - in trunk: data modules modules/common modules/gnome-settings-daemon-plugins



Author: hiikezoe
Date: Sun Mar 22 10:52:40 2009
New Revision: 251
URL: http://svn.gnome.org/viewvc/gpointing-device-settings?rev=251&view=rev

Log:
Implement palm detection.

Modified:
   trunk/data/touchpad.ui
   trunk/modules/common/gpds-touchpad-definitions.h
   trunk/modules/gnome-settings-daemon-plugins/gsd-touchpad-manager.c
   trunk/modules/gpds-touchpad-ui.c

Modified: trunk/data/touchpad.ui
==============================================================================
--- trunk/data/touchpad.ui	(original)
+++ trunk/data/touchpad.ui	Sun Mar 22 10:52:40 2009
@@ -92,37 +92,88 @@
                 <property name="label_yalign">0.5</property>
                 <property name="shadow_type">GTK_SHADOW_NONE</property>
                 <child>
-                  <object class="GtkListStore" id="general_use_list_store">
-                    <columns>
-                      <column type="gint"/>
-                      <column type="gchararray"/>
-                    </columns>
-                    <data>
-                       <row>
-                         <col id="0">1</col>
-                         <col id="1">Touchpad on</col>
-                       </row>
-                       <row>
-                         <col id="0">2</col>
-                         <col id="1">Touchpad off</col>
-                       </row>
-                       <row>
-                         <col id="0">3</col>
-                         <col id="1">Touchpad tapping and scrolling off</col>
-                       </row>
-                    </data>
-                  </object>
-                  <object class="GtkComboBox" id="touchpad_use_type">
+                  <object class="GtkAlignment" id="alignment1">
                     <property name="visible">True</property>
-                    <property name="model">general_use_list_store</property>
-                    <property name="can_focus">True</property>
-                    <property name="focus_on_click">True</property>
-                    <property name="active">0</property>
+                    <property name="xalign">0.5</property>
+                    <property name="yalign">0.5</property>
+                    <property name="xscale">1</property>
+                    <property name="yscale">1</property>
+                    <property name="top_padding">6</property>
+                    <property name="bottom_padding">0</property>
+                    <property name="left_padding">12</property>
+                    <property name="right_padding">0</property>
                     <child>
-                      <object class="GtkCellRendererText" id="touchpad_use_type_text"/>
-                      <attributes>
-                        <attribute name="text">1</attribute>
-                      </attributes>
+                      <object class="GtkVBox" id="general_box">
+                        <property name="visible">True</property>
+                        <property name="homogeneous">False</property>
+                        <property name="spacing">6</property>
+                        <child>
+                          <object class="GtkListStore" id="general_use_list_store">
+                            <columns>
+                              <column type="gint"/>
+                              <column type="gchararray"/>
+                            </columns>
+                            <data>
+                               <row>
+                                 <col id="0">1</col>
+                                 <col id="1">Touchpad on</col>
+                               </row>
+                               <row>
+                                 <col id="0">2</col>
+                                 <col id="1">Touchpad off</col>
+                               </row>
+                               <row>
+                                 <col id="0">3</col>
+                                 <col id="1">Touchpad tapping and scrolling off</col>
+                               </row>
+                            </data>
+                          </object>
+                          <object class="GtkComboBox" id="touchpad_use_type">
+                            <property name="visible">True</property>
+                            <property name="model">general_use_list_store</property>
+                            <property name="can_focus">True</property>
+                            <property name="focus_on_click">True</property>
+                            <property name="active">0</property>
+                            <child>
+                              <object class="GtkCellRendererText" id="touchpad_use_type_text"/>
+                              <attributes>
+                                <attribute name="text">1</attribute>
+                              </attributes>
+                            </child>
+                          </object>
+                        </child>
+			<child>
+			  <object class="GtkLabel" id="label4">
+			    <property name="visible">True</property>
+			    <property name="label" translatable="yes">&lt;b&gt;Palm Detection&lt;/b&gt;</property>
+			    <property name="use_underline">False</property>
+			    <property name="use_markup">True</property>
+			    <property name="justify">GTK_JUSTIFY_LEFT</property>
+			    <property name="wrap">False</property>
+			    <property name="selectable">False</property>
+			    <property name="xalign">0</property>
+			    <property name="yalign">0</property>
+			    <property name="xpad">0</property>
+			    <property name="ypad">0</property>
+			    <property name="ellipsize">PANGO_ELLIPSIZE_NONE</property>
+			    <property name="width_chars">-1</property>
+			    <property name="single_line_mode">False</property>
+			    <property name="angle">0</property>
+			  </object>
+			</child>
+                        <child>
+                          <object class="GtkCheckButton" id="palm_detection">
+                            <property name="visible">True</property>
+                            <property name="label" translatable="yes">Enable _palm detection</property>
+                            <property name="use_underline">True</property>
+                          </object>
+                          <packing>
+                            <property name="padding">0</property>
+                            <property name="expand">False</property>
+                            <property name="fill">False</property>
+                          </packing>
+                        </child>
+                      </object>
                     </child>
                   </object>
                 </child>

Modified: trunk/modules/common/gpds-touchpad-definitions.h
==============================================================================
--- trunk/modules/common/gpds-touchpad-definitions.h	(original)
+++ trunk/modules/common/gpds-touchpad-definitions.h	Sun Mar 22 10:52:40 2009
@@ -35,6 +35,7 @@
 #define GPDS_TOUCHPAD_CIRCULAR_SCROLLING_KEY              "circular_scrolling"
 #define GPDS_TOUCHPAD_CIRCULAR_SCROLLING_DISTANCE_KEY     "circular_scrolling_distance"
 #define GPDS_TOUCHPAD_CIRCULAR_SCROLLING_TRIGGER_KEY      "circular_scrolling_trigger"
+#define GPDS_TOUCHPAD_PALM_DETECTION_KEY                  "palm_detection"
 
 #endif /* __GPDS_TOUCHPAD_GCONF_H__ */
 /*

Modified: trunk/modules/gnome-settings-daemon-plugins/gsd-touchpad-manager.c
==============================================================================
--- trunk/modules/gnome-settings-daemon-plugins/gsd-touchpad-manager.c	(original)
+++ trunk/modules/gnome-settings-daemon-plugins/gsd-touchpad-manager.c	Sun Mar 22 10:52:40 2009
@@ -33,9 +33,9 @@
 
 G_DEFINE_TYPE (GsdTouchpadManager, gsd_touchpad_manager, GSD_TYPE_POINTING_DEVICE_MANAGER)
 
-static gboolean start                (GsdPointingDeviceManager *manager,
+static gboolean _start               (GsdPointingDeviceManager *manager,
                                       GError **error);
-static void     stop                 (GsdPointingDeviceManager *manager);
+static void     _stop                (GsdPointingDeviceManager *manager);
 static void     _gconf_client_notify (GsdPointingDeviceManager *manager,
                                       GConfClient *client,
                                       guint cnxn_id,
@@ -51,11 +51,12 @@
 {
     GsdPointingDeviceManagerClass *manager_class = GSD_POINTING_DEVICE_MANAGER_CLASS(klass);
 
-    manager_class->start               = start;
-    manager_class->stop                = stop;
+    manager_class->start               = _start;
+    manager_class->stop                = _stop;
     manager_class->gconf_client_notify = _gconf_client_notify;
 }
 
+DEFINE_SET_BOOLEAN_FUNCTION (palm_detection, GPDS_TOUCHPAD_PALM_DETECTION)
 DEFINE_SET_BOOLEAN_FUNCTION (tap_fast_tap, GPDS_TOUCHPAD_TAP_FAST_TAP)
 DEFINE_SET_BOOLEAN_FUNCTION (circular_scrolling, GPDS_TOUCHPAD_CIRCULAR_SCROLLING)
 DEFINE_SET_INT_FUNCTION (touchpad_off, GPDS_TOUCHPAD_OFF)
@@ -180,6 +181,7 @@
     }
 
     set_touchpad_off(manager, xinput, gconf);
+    set_palm_detection(manager, xinput, gconf);
     set_tap_fast_tap(manager, xinput, gconf);
     set_tap_time(manager, xinput, gconf);
     set_edge_scrolling(manager, xinput, gconf);
@@ -195,7 +197,7 @@
 }
 
 static gboolean
-start (GsdPointingDeviceManager *manager, GError **error)
+_start (GsdPointingDeviceManager *manager, GError **error)
 {
     g_idle_add((GSourceFunc)start_manager, manager);
 
@@ -203,7 +205,7 @@
 }
 
 static void
-stop (GsdPointingDeviceManager *manager)
+_stop (GsdPointingDeviceManager *manager)
 {
 }
 
@@ -228,7 +230,9 @@
 
     switch (value->type) {
     case GCONF_VALUE_BOOL:
-        if (!strcmp(key, GPDS_TOUCHPAD_TAP_FAST_TAP_KEY)) {
+        if (!strcmp(key, GPDS_TOUCHPAD_PALM_DETECTION_KEY)) {
+            set_palm_detection(manager, xinput, client);
+        } else if (!strcmp(key, GPDS_TOUCHPAD_TAP_FAST_TAP_KEY)) {
             set_tap_fast_tap(manager, xinput, client);
         } else if (!strcmp(key, GPDS_TOUCHPAD_CIRCULAR_SCROLLING_KEY)) {
             set_circular_scrolling(manager, xinput, client);

Modified: trunk/modules/gpds-touchpad-ui.c
==============================================================================
--- trunk/modules/gpds-touchpad-ui.c	(original)
+++ trunk/modules/gpds-touchpad-ui.c	Sun Mar 22 10:52:40 2009
@@ -193,6 +193,17 @@
 }
 
 static void
+cb_palm_detection_toggled (GtkToggleButton *button, gpointer user_data)
+{
+    GpdsTouchpadUI *ui = GPDS_TOUCHPAD_UI(user_data);
+    gboolean check;
+
+    set_toggle_property(ui->xinput, button, GPDS_TOUCHPAD_PALM_DETECTION);
+    check = gtk_toggle_button_get_active(button);
+    gpds_ui_set_gconf_bool(GPDS_UI(ui), GPDS_TOUCHPAD_PALM_DETECTION_KEY, check);
+}
+
+static void
 set_two_finger_scrolling_toggle_property (GpdsXInput *xinput, GtkBuilder *builder)
 {
     GError *error = NULL;
@@ -540,6 +551,7 @@
                      ui)
 
     CONNECT(touchpad_use_type, changed);
+    CONNECT(palm_detection, toggled);
     CONNECT(tapping_time_scale, value_changed);
     CONNECT(faster_tapping_check, toggled);
     CONNECT(circular_scrolling, toggled);
@@ -812,6 +824,11 @@
                                          GPDS_TOUCHPAD_TAP_FAST_TAP_KEY,
                                          builder,
                                          "faster_tapping_check");
+    set_boolean_property_from_preference(touchpad_ui,
+                                         GPDS_TOUCHPAD_PALM_DETECTION, 
+                                         GPDS_TOUCHPAD_PALM_DETECTION_KEY,
+                                         builder,
+                                         "palm_detection");
     set_circular_scrolling_property_from_preference(touchpad_ui, builder);
     set_edge_scrolling_property_from_preference(touchpad_ui, builder);
     set_scroll_distance_property_from_preference(touchpad_ui, builder);



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