[kde-doc-english] playground/utils/synaptiks

Sebastian Wiesner basti.wiesner at gmx.net
Fri Mar 5 20:21:43 CET 2010


SVN commit 1099576 by swiesner:

FEATURE: Added CircularTouchpad setting
GUI: Added configuration options for circular touchpad setting
Added circularTouchpad property to Touchpad

 M  +6 -0      daemon/org.kde.Touchpad.xml  
 M  +2 -0      daemon/synaptiksdaemon.cpp  
 M  +11 -0     daemon/touchpad.cpp  
 M  +37 -0     daemon/touchpad.h  
 M  +8 -0      daemon/touchpadadaptor.cpp  
 M  +3 -0      daemon/touchpadadaptor.h  
 M  +58 -25    kcmodule/ui/generalpage.ui  
 M  +5 -0      synaptiks.kcfg  


--- trunk/playground/utils/synaptiks/daemon/org.kde.Touchpad.xml #1099575:1099576
@@ -76,6 +76,12 @@
     <method name="setFastTaps">
       <arg name="enabled" type="b" direction="in"/>
     </method>
+    <method name="circularTouchpad">
+      <arg type="b" direction="out"/>
+    </method>
+    <method name="setCircularTouchpad">
+      <arg name="circular" type="b" direction="in"/>
+    </method>
     <method name="hasLeftButton">
       <arg type="b" direction="out"/>
     </method>
--- trunk/playground/utils/synaptiks/daemon/synaptiksdaemon.cpp #1099575:1099576
@@ -236,6 +236,8 @@
     // touchpad properties ...
     QList<QString> names;
     names
+        // general configuration
+        << "CircularTouchpad"
         // scrolling configuration
         << "CircularScrolling" << "CircularScrollingTrigger"
         << "HorizontalTwoFingerScrolling" << "VerticalTwoFingerScrolling"
--- trunk/playground/utils/synaptiks/daemon/touchpad.cpp #1099575:1099576
@@ -45,6 +45,7 @@
 static const char TAP_ACTION[] = "Synaptics Tap Action";
 static const char FAST_TAP[] = "Synaptics Tap FastTap";
 static const char TWO_FINGER_SCROLLING[] = "Synaptics Two-Finger Scrolling";
+static const char CIRCULAR_PAD[] = "Synaptics Circular Pad";
 
 
 enum EdgeSrollingItem {
@@ -255,6 +256,16 @@
     d->device->setProperty(FAST_TAP, enabled);
 }
 
+bool Touchpad::circularTouchpad() const {
+    Q_D(const Touchpad);
+    return d->device->property<bool>(CIRCULAR_PAD, 0);
+}
+
+void Touchpad::setCircularTouchpad(bool circular) {
+    Q_D(Touchpad);
+    d->device->setProperty(CIRCULAR_PAD, circular);
+}
+
 Touchpad::Capabilities Touchpad::capabilities() const {
     Q_D(const Touchpad);
     Capabilities current_capabilities;
--- trunk/playground/utils/synaptiks/daemon/touchpad.h #1099575:1099576
@@ -350,6 +350,25 @@
                    DESIGNABLE false)
 
         /**
+         * @brief Whether or not the touchpad is considered as circular
+         * touchpad.
+         *
+         * If this property is @c true, the touchpad drivers considered the
+         * touchpad as circular pad and adjusts edges and coordinates
+         * accordingly.
+         *
+         * The driver does @e not detect circular touchpads automatically,
+         * therefore this property must be set manually, if a circular
+         * touchpad is present.
+         *
+         * @sa setCircularTouchpad(bool)
+         * @sa circularTouchpad()
+         */
+        Q_PROPERTY(bool circularTouchpad
+                   READ circularTouchpad WRITE setCircularTouchpad
+                   DESIGNABLE false)
+
+        /**
          * @brief The capabilities of the touchpad.
          *
          * This property provides a combination of #Capability flags, which
@@ -753,6 +772,24 @@
         Q_SCRIPTABLE void setFastTaps(bool enabled);
 
         /**
+         * @brief Whether the touchpad is considered as circular touchpad.
+         *
+         * @return @c true, if the touchpad is circular, @c false otherwise
+         * @sa circularTouchpad
+         */
+        Q_SCRIPTABLE bool circularTouchpad() const;
+
+        /**
+         * @brief Configure, if the touchpad is circular or not.
+         *
+         * @param circular If @c true, the touchpad is considered as
+         *        circular touchpad by the driver, if @c false, the touchpad
+         *        is considered as rectangular touchpad.
+         * @sa circularTouchpad
+         */
+        Q_SCRIPTABLE void setCircularTouchpad(bool circular);
+
+        /**
          * @brief Query the touchpad capabilities.
          *
          * The returns a combination of flags, which indicate the touchpad
--- trunk/playground/utils/synaptiks/daemon/touchpadadaptor.cpp #1099575:1099576
@@ -170,6 +170,14 @@
     this->setPropertyOrDBusError("fastTaps", enabled);
 }
 
+bool TouchpadAdaptor::circularTouchpad() const {
+    return this->propertyOrDBusError("circularTouchpad").toBool();
+}
+
+void TouchpadAdaptor::setCircularTouchpad(bool circular) {
+    this->setPropertyOrDBusError("circularTouchpad", circular);
+}
+
 bool TouchpadAdaptor::hasLeftButton() const {
     return this->propertyOrDBusError("hasLeftButton").toBool();
 }
--- trunk/playground/utils/synaptiks/daemon/touchpadadaptor.h #1099575:1099576
@@ -89,6 +89,9 @@
         bool fastTaps() const;
         void setFastTaps(bool enabled);
 
+        bool circularTouchpad() const;
+        void setCircularTouchpad(bool circular);
+
         bool hasLeftButton() const;
         bool hasMiddleButton() const;
         bool hasRightButton() const;
--- trunk/playground/utils/synaptiks/kcmodule/ui/generalpage.ui #1099575:1099576
@@ -6,40 +6,73 @@
    <rect>
     <x>0</x>
     <y>0</y>
-    <width>336</width>
-    <height>41</height>
+    <width>338</width>
+    <height>149</height>
    </rect>
   </property>
   <property name="windowTitle">
    <string comment="@title:window general touchpad settings">General</string>
   </property>
-  <layout class="QFormLayout" name="formLayout">
-   <item row="0" column="0">
-    <widget class="QLabel" name="label">
-     <property name="text">
-      <string comment="@label:listbox">Touchpad state at startup</string>
-     </property>
-    </widget>
-   </item>
-   <item row="0" column="1">
-    <widget class="KComboBox" name="kcfg_TouchpadStateAtStartup">
-     <item>
-      <property name="text">
-       <string comment="@item:inlistbox">Leave unchanged</string>
-      </property>
+  <layout class="QVBoxLayout" name="verticalLayout">
+   <item>
+    <layout class="QFormLayout" name="formLayout">
+     <item row="0" column="0">
+      <widget class="QLabel" name="label">
+       <property name="text">
+        <string comment="@label:listbox">Touchpad state at startup</string>
+       </property>
+      </widget>
      </item>
-     <item>
-      <property name="text">
-       <string comment="@item:inlistbox">Switch on</string>
-      </property>
+     <item row="0" column="1">
+      <widget class="KComboBox" name="kcfg_TouchpadStateAtStartup">
+       <item>
+        <property name="text">
+         <string comment="@item:inlistbox">Leave unchanged</string>
+        </property>
+       </item>
+       <item>
+        <property name="text">
+         <string comment="@item:inlistbox">Switch on</string>
+        </property>
+       </item>
+       <item>
+        <property name="text">
+         <string comment="@item:inlistbox">Switch off</string>
+        </property>
+       </item>
+      </widget>
      </item>
-     <item>
-      <property name="text">
-       <string comment="@item:inlistbox">Switch off</string>
-      </property>
-     </item>
+    </layout>
+   </item>
+   <item>
+    <widget class="QGroupBox" name="groupBox">
+     <property name="title">
+      <string>Hardware properties</string>
+     </property>
+     <layout class="QVBoxLayout" name="verticalLayout_2">
+      <item>
+       <widget class="QCheckBox" name="kcfg_CircularTouchpad">
+        <property name="text">
+         <string>The touchpad is circular</string>
+        </property>
+       </widget>
+      </item>
+     </layout>
     </widget>
    </item>
+   <item>
+    <spacer name="verticalSpacer">
+     <property name="orientation">
+      <enum>Qt::Vertical</enum>
+     </property>
+     <property name="sizeHint" stdset="0">
+      <size>
+       <width>20</width>
+       <height>40</height>
+      </size>
+     </property>
+    </spacer>
+   </item>
   </layout>
  </widget>
  <customwidgets>
--- trunk/playground/utils/synaptiks/synaptiks.kcfg #1099575:1099576
@@ -47,6 +47,11 @@
         <choice name="OffState"/>
       </choices>
     </entry>
+    <entry name="CircularTouchpad" type="Bool">
+      <label>If true, the driver consideres the touchpad as circular
+touchpad.  Enable this, if the touchpad is circular.</label>
+      <default>false</default>
+    </entry>
   </group>
   <group name="Scrolling">
     <entry name="CircularScrolling" type="Bool">



More information about the kde-doc-english mailing list