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

Sebastian Wiesner basti.wiesner at gmx.net
Thu Mar 11 19:49:08 CET 2010


SVN commit 1102067 by swiesner:

FEATURE: Added scrolling speed settings
GUI: Added scrolling speed controls to scrolling page
Added verticalScrollingDistance and horizontalScrollingDistnance properties to Touchpad

 M  +12 -0     daemon/org.kde.Touchpad.xml  
 M  +1 -0      daemon/synaptiksdaemon.cpp  
 M  +30 -0     daemon/touchpad.cpp  
 M  +66 -0     daemon/touchpad.h  
 M  +16 -0     daemon/touchpadadaptor.cpp  
 M  +6 -0      daemon/touchpadadaptor.h  
 M  +44 -1     kcmodule/ui/scrollingpage.ui  
 M  +10 -0     synaptiks.kcfg  


--- trunk/playground/utils/synaptiks/daemon/org.kde.Touchpad.xml #1102066:1102067
@@ -106,6 +106,18 @@
     <method name="setCoastingSpeed">
       <arg name="speed" type="d" direction="in"/>
     </method>
+    <method name="horizontalScrollingDistance">
+      <arg type="i" direction="out"/>
+    </method>
+    <method name="setHorizontalScrollingDistance">
+      <arg name="distance" type="i" direction="in"/>
+    </method>
+    <method name="verticalScrollingDistance">
+      <arg type="i" direction="out"/>
+    </method>
+    <method name="setVerticalScrollingDistance">
+      <arg name="distance" type="i" direction="in"/>
+    </method>
     <method name="cornerButtons">
       <arg type="ay" direction="out"/>
     </method>
--- trunk/playground/utils/synaptiks/daemon/synaptiksdaemon.cpp #1102066:1102067
@@ -245,6 +245,7 @@
         << "CircularScrolling" << "CircularScrollingTrigger"
         << "HorizontalTwoFingerScrolling" << "VerticalTwoFingerScrolling"
         << "HorizontalEdgeScrolling" << "VerticalEdgeScrolling"
+        << "HorizontalScrollingDistance" << "VerticalScrollingDistance"
         // tapping configuration
         << "FastTaps" << "TapAndDragGesture" << "LockedDrags";
     foreach (const QString &name, names) {
--- trunk/playground/utils/synaptiks/daemon/touchpad.cpp #1102066:1102067
@@ -49,6 +49,7 @@
 static const char TWO_FINGER_SCROLLING[] = "Synaptics Two-Finger Scrolling";
 static const char EDGE_SCROLLING[] = "Synaptics Edge Scrolling";
 static const char COASTING_SPEED[] = "Synaptics Coasting Speed";
+static const char SCROLLING_DISTANCE[] = "Synaptics Scrolling Distance";
 static const char TAP_ACTION[] = "Synaptics Tap Action";
 static const char FAST_TAP[] = "Synaptics Tap FastTap";
 static const char CIRCULAR_PAD[] = "Synaptics Circular Pad";
@@ -78,7 +79,12 @@
     HorizontalScrollingItem = 1
 };
 
+enum ScrollingDistanceItem {
+    VerticalDistanceItem = 0,
+    HorizontalDistanceItem = 1,
+};
 
+
 using namespace synaptiks;
 
 
@@ -304,6 +310,30 @@
     return d->device->setProperty(COASTING_SPEED, speed);
 }
 
+int Touchpad::horizontalScrollingDistance() const {
+    Q_D(const Touchpad);
+    return d->device->property<int>(SCROLLING_DISTANCE,
+                                    HorizontalDistanceItem);
+}
+
+void Touchpad::setHorizontalScrollingDistance(int distance) {
+    Q_D(Touchpad);
+    d->device->setProperty<int>(SCROLLING_DISTANCE, distance,
+                                HorizontalDistanceItem);
+}
+
+int Touchpad::verticalScrollingDistance() const {
+    Q_D(const Touchpad);
+    return d->device->property<int>(SCROLLING_DISTANCE,
+                                    VerticalDistanceItem);
+}
+
+void Touchpad::setVerticalScrollingDistance(int distance) {
+    Q_D(Touchpad);
+    d->device->setProperty<int>(SCROLLING_DISTANCE, distance,
+                                VerticalDistanceItem);
+}
+
 QByteArray Touchpad::cornerButtons() const {
     Q_D(const Touchpad);
     QByteArray buttons;
--- trunk/playground/utils/synaptiks/daemon/touchpad.h #1102066:1102067
@@ -393,6 +393,36 @@
                    WRITE setCoastingSpeed DESIGNABLE false)
 
         /**
+         * @brief The speed of horizontal scrolling.
+         *
+         * This property holds the move distance of the finger to generate a
+         * single horizontal scroll event.
+         *
+         * @see setHorizontalScrollingDistance(int)
+         * @see horizontalScrollingDistance() const
+         * @see horizontalEdgeScrolling
+         * @see horizontalTwoFingerScrolling
+         */
+        Q_PROPERTY(int horizontalScrollingDistance
+                   READ horizontalScrollingDistance
+                   WRITE setHorizontalScrollingDistance DESIGNABLE false)
+
+        /**
+         * @brief The speed of vertical scrolling.
+         *
+         * This property holds the move distance of the finger to generate a
+         * single vertical scroll event.
+         *
+         * @see setVerticalScrollingDistance(int)
+         * @see verticalScrollingDistance() const
+         * @see verticalEdgeScrolling
+         * @see verticalTwoFingerScrolling
+         */
+        Q_PROPERTY(int verticalScrollingDistance
+                   READ verticalScrollingDistance
+                   WRITE setVerticalScrollingDistance DESIGNABLE false)
+
+        /**
          * @brief The mouse buttons triggered by tapping the touchpad
          * corner.
          *
@@ -989,6 +1019,42 @@
         Q_SCRIPTABLE void setCoastingSpeed(float speed);
 
         /**
+         * @brief Return the move distance of the finger to generate a
+         * horizontal scroll event.
+         *
+         * @return the move distance for a horizontal scroll event
+         * @see horizontalScrollingDistance
+         */
+        Q_SCRIPTABLE int horizontalScrollingDistance() const;
+
+        /**
+         * @brief Set the move distance of the finger to generate a
+         * horizontal scroll event.
+         *
+         * @param distance the move distance for a horizontal scroll event
+         * @see horizontalScrollingDistance
+         */
+        Q_SCRIPTABLE void setHorizontalScrollingDistance(int distance);
+
+        /**
+         * @brief Return the move distance of the finger to generate a
+         * vertical scroll event.
+         *
+         * @return the move distance for a vertical scroll event
+         * @see verticalScrollingDistance
+         */
+        Q_SCRIPTABLE int verticalScrollingDistance() const;
+
+        /**
+         * @brief Set the move distance of the finger to generate a vertical
+         * scroll event.
+         *
+         * @param distance the move distance for a vertical scroll event
+         * @see verticalScrollingDistance
+         */
+        Q_SCRIPTABLE void setVerticalScrollingDistance(int distance);
+
+        /**
          * @brief Query the mouse buttons triggered by tapping the touchpad
          * corners.
          *
--- trunk/playground/utils/synaptiks/daemon/touchpadadaptor.cpp #1102066:1102067
@@ -196,6 +196,22 @@
     this->setPropertyOrDBusError("coastingSpeed", speed);
 }
 
+int TouchpadAdaptor::horizontalScrollingDistance() const {
+    return this->propertyOrDBusError("horizontalScrollingDistance").toInt();
+}
+
+void TouchpadAdaptor::setHorizontalScrollingDistance(int distance) {
+    this->setPropertyOrDBusError("horizontalScrollingDistance", distance);
+}
+
+int TouchpadAdaptor::verticalScrollingDistance() const {
+    return this->propertyOrDBusError("verticalScrollingDistance").toInt();
+}
+
+void TouchpadAdaptor::setVerticalScrollingDistance(int distance) {
+    this->setPropertyOrDBusError("verticalScrollingDistance", distance);
+}
+
 QByteArray TouchpadAdaptor::cornerButtons() const {
     return this->propertyOrDBusError("cornerButtons").toByteArray();
 }
--- trunk/playground/utils/synaptiks/daemon/touchpadadaptor.h #1102066:1102067
@@ -104,6 +104,12 @@
         double coastingSpeed() const;
         void setCoastingSpeed(double speed);
 
+        int horizontalScrollingDistance() const;
+        void setHorizontalScrollingDistance(int distance);
+
+        int verticalScrollingDistance() const;
+        void setVerticalScrollingDistance(int distance);
+
         QByteArray cornerButtons() const;
         void setCornerButtons(const QByteArray &buttons);
 
--- trunk/playground/utils/synaptiks/kcmodule/ui/scrollingpage.ui #1102066:1102067
@@ -8,7 +8,7 @@
     <x>0</x>
     <y>0</y>
     <width>533</width>
-    <height>360</height>
+    <height>413</height>
    </rect>
   </property>
   <property name="windowTitle">
@@ -37,6 +37,25 @@
           </property>
          </widget>
         </item>
+        <item>
+         <widget class="KIntNumInput" name="kcfg_HorizontalScrollingDistance">
+          <property name="label">
+           <string comment="@label:slider">Scrolling speed</string>
+          </property>
+          <property name="minimum">
+           <number>1</number>
+          </property>
+          <property name="maximum">
+           <number>200</number>
+          </property>
+          <property name="singleStep">
+           <number>10</number>
+          </property>
+          <property name="sliderEnabled">
+           <bool>true</bool>
+          </property>
+         </widget>
+        </item>
        </layout>
       </widget>
      </item>
@@ -60,6 +79,25 @@
           </property>
          </widget>
         </item>
+        <item>
+         <widget class="KIntNumInput" name="kcfg_VerticalScrollingDistance">
+          <property name="label">
+           <string comment="@label:slider">Scrolling speed</string>
+          </property>
+          <property name="minimum">
+           <number>1</number>
+          </property>
+          <property name="maximum">
+           <number>200</number>
+          </property>
+          <property name="singleStep">
+           <number>10</number>
+          </property>
+          <property name="sliderEnabled">
+           <bool>true</bool>
+          </property>
+         </widget>
+        </item>
        </layout>
       </widget>
      </item>
@@ -220,6 +258,11 @@
    <extends>QComboBox</extends>
    <header>kcombobox.h</header>
   </customwidget>
+  <customwidget>
+   <class>KIntNumInput</class>
+   <extends>QWidget</extends>
+   <header>knuminput.h</header>
+  </customwidget>
  </customwidgets>
  <resources/>
  <connections/>
--- trunk/playground/utils/synaptiks/synaptiks.kcfg #1102066:1102067
@@ -137,6 +137,16 @@
       <default>3.0</default>
       <min>0.01</min>
     </entry>
+    <entry name="HorizontalScrollingDistance" type="Int">
+      <label>The move distance of the finger to generate a horizontal
+scrolling event.</label>
+      <default>20</default>
+    </entry>
+    <entry name="VerticalScrollingDistance" type="Int">
+      <label>The move distance of the finger to generate a vertical
+scrolling event.</label>
+      <default>20</default>
+    </entry>
   </group>
   <group name="Tapping">
     <entry name="$(Corner)CornerButton" type="Enum">



More information about the kde-doc-english mailing list