[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-hardware-devel
Subject:    [Kde-hardware-devel] Tablet support in solid
From:       Daniel Nascimento <dnascimento.devel () gmail ! com>
Date:       2009-05-02 12:08:35
Message-ID: c49f82ee0905020508t4557dfa8q5739c73e0f4c591a () mail ! gmail ! com
[Download RAW message or body]

[Attachment #2 (multipart/alternative)]


Hi,

I'm working with the support of tablet switch in a small netbook and I want
it to be supported in solid. I made this patch to be reviewed by solid team,
but it only will be tested during the next weeks.

I'm not sure if this is related to Solid::Control::PowerManager, I just
follow the references to LidButton to implement this.

regards,
Daniel O Nascimento

[Attachment #5 (text/html)]

Hi,<br><br>I&#39;m working with the support of tablet switch in a small netbook and I \
want it to be supported in solid. I made this patch to be reviewed by solid team, but \
it only will be tested during the next weeks. <br> <br>I&#39;m not sure if this is \
related to Solid::Control::PowerManager, I just follow the references to LidButton to \
implement this.<br><br>regards,<br>Daniel O Nascimento<br>

--000e0cd32a60e9dda20468ecc998--


["solid-tablet.patch" (text/x-patch)]

--- a/kdebase/workspace/solid/hal/halpower.cpp	2009-05-01 22:32:56.000000000 -0300
+++ b/kdebase/workspace/solid/hal/halpower.cpp	2009-05-01 22:42:34.000000000 -0300
@@ -555,6 +555,16 @@
             emit buttonPressed(Solid::Control::PowerManager::LidOpen);
         }
         break;
+    case Solid::Button::TabletButton:
+        if (button->stateValue())
+        {
+            emit buttonPressed(Solid::Control::PowerManager::TabletNormal);
+        }
+        else
+        {
+            emit buttonPressed(Solid::Control::PowerManager::TabletRotate);
+        }
+        break;
     default:
         //kWarning() << "Unknown button type";
         break;
--- a/kdebase/workspace/libs/solid/control/powermanager.h	2009-05-01 \
                22:46:29.000000000 -0300
+++ b/kdebase/workspace/libs/solid/control/powermanager.h	2009-05-01 \
22:49:49.000000000 -0300 @@ -73,8 +73,10 @@
          * - SleepButton: A sleep button pressed event, generally used to make the \
                system asleep
          * - LidOpen: A laptop lid open event
          * - LidClose: A laptop lid close event
+         * - TabletNormal: A laptop state event
+         * - TabletRotate: A tablet state event
          */
-        enum ButtonType{ UnknownButtonType, PowerButton, SleepButton, LidOpen, \
LidClose }; +        enum ButtonType{ UnknownButtonType, PowerButton, SleepButton, \
LidOpen, LidClose, TabletNormal, TabletRotate };  
         /**
          * This enum type defines the different suspend methods.
--- a/kdelibs/solid/solid/backends/fakehw/fakebutton.cpp	2009-05-01 \
                22:32:56.000000000 -0300
+++ b/kdelibs/solid/solid/backends/fakehw/fakebutton.cpp	2009-05-01 \
22:38:08.000000000 -0300 @@ -48,6 +48,10 @@
     {
         return Solid::Button::SleepButton;
     }
+    else if (buttontype=="TabletButton")
+    {
+        return Solid::Button::TabletButton;
+    }
     else
     {
         return Solid::Button::UnknownButtonType;
--- a/kdelibs/solid/solid/backends/fakehw/fakecomputer.xml	2009-05-01 \
                22:32:56.000000000 -0300
+++ b/kdelibs/solid/solid/backends/fakehw/fakecomputer.xml	2009-05-01 \
22:36:26.000000000 -0300 @@ -67,6 +67,15 @@
             <property key="hasState">true</property>
             <property key="stateValue">false</property>
         </device>
+        <device udi="/org/kde/solid/fakehw/acpi_TAB0">
+            <property key="name">Tablet Switch</property>
+            <property key="interfaces">Button</property>
+            <property key="parent">/org/kde/solid/fakehw/computer</property>
+
+            <property key="type">TabletButton</property>
+            <property key="hasState">true</property>
+            <property key="stateValue">false</property>
+        </device>
 
 
 
--- a/kdelibs/solid/solid/backends/hal/halbutton.cpp	2009-05-01 22:32:56.000000000 \
                -0300
+++ b/kdelibs/solid/solid/backends/hal/halbutton.cpp	2009-05-01 22:34:22.000000000 \
-0300 @@ -49,6 +49,10 @@
     {
         return Solid::Button::SleepButton;
     }
+    else if (buttontype=="tablet_mode")
+    {
+        return Solid::Button::TabletButton;
+    }
     else
     {
         return Solid::Button::UnknownButtonType;
--- a/kdelibs/solid/solid/button.h	2009-05-01 22:32:56.000000000 -0300
+++ b/kdelibs/solid/solid/button.h	2009-05-01 22:50:30.000000000 -0300
@@ -55,9 +55,10 @@
          * - LidButton : The switch on a laptop that senses whether the lid is open \
                or closed.
          * - PowerButton : The main power button on the computer.
          * - SleepButton : The sleep button on a computer capable of putting the \
computer into a suspend state. +         * - TabletButton : The tablet switch on a \
                laptop that senses if the monitor is rotated or not.
          * - UnknownButtonType : The type of the button is unknow.
          */
-         enum ButtonType{ LidButton, PowerButton, SleepButton, UnknownButtonType };
+         enum ButtonType{ LidButton, PowerButton, SleepButton, TabletButton, \
UnknownButtonType };  
 
     private:



_______________________________________________
Kde-hardware-devel mailing list
Kde-hardware-devel@kde.org
https://mail.kde.org/mailman/listinfo/kde-hardware-devel


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic