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

List:       kde-commits
Subject:    branches/work/kdehw
From:       Davide Bettio <davbet () aliceposta ! it>
Date:       2006-05-15 16:42:44
Message-ID: 1147711364.182129.22422.nullmailer () svn ! kde ! org
[Download RAW message or body]

SVN commit 541143 by bettio:

Adding Button capability.


 M  +1 -0      backends/fake/CMakeLists.txt  
 A             backends/fake/fakebutton.cpp   [License: LGPL (v2)]
 A             backends/fake/fakebutton.h   [License: LGPL (v2)]
 M  +4 -0      backends/fake/fakecapability.h  
 M  +7 -3      backends/fake/fakedevice.cpp  
 M  +1 -0      backends/hal/CMakeLists.txt  
 A             backends/hal/button.cpp   [License: LGPL (v2)]
 A             backends/hal/button.h   [License: LGPL (v2)]
 M  +4 -0      backends/hal/capability.h  
 M  +4 -0      backends/hal/haldevice.cpp  
 M  +2 -1      kdehw/CMakeLists.txt  
 A             kdehw/button.cpp   [License: LGPL (v2)]
 A             kdehw/button.h   [License: LGPL (v2)]
 M  +5 -0      kdehw/device.cpp  
 M  +2 -1      kdehw/ifaces/CMakeLists.txt  
 A             kdehw/ifaces/button.cpp   [License: LGPL (v2)]
 A             kdehw/ifaces/button.h   [License: LGPL (v2)]
 M  +18 -1     kdehw/ifaces/enums.h  
 M  +4 -0      kdehw/predicate.cpp  


--- branches/work/kdehw/backends/fake/CMakeLists.txt #541142:541143
@@ -24,6 +24,7 @@
    fakeprocessor.cpp 
    fakeacadapter.cpp 
    fakebattery.cpp 
+   fakebutton.cpp 
    fakedisplay.cpp )
 
 kde4_automoc(${kdehw_fake_PART_SRCS})
--- branches/work/kdehw/backends/fake/fakecapability.h #541142:541143
@@ -67,6 +67,8 @@
 				return "acadapter";
 			case Capability::Battery:
 				return "battery";
+			case Capability::Button:
+				return "button";
 			case Capability::Display:
 				return "display";
 			default:
@@ -98,6 +100,8 @@
 			return Capability::AcAdapter;
 		else if ( capability == "battery" )
 			return Capability::Battery;
+		else if ( capability == "button" )
+			return Capability::Button;
 		else if ( capability == "display" )
 			return Capability::Display;
 		else
--- branches/work/kdehw/backends/fake/fakedevice.cpp #541142:541143
@@ -30,6 +30,7 @@
 #include "fakenetworkiface.h"
 #include "fakeacadapter.h"
 #include "fakebattery.h"
+#include "fakebutton.h"
 #include "fakedisplay.h"
 
 #include <QStringList>
@@ -141,15 +142,18 @@
 		case Capability::NetworkIface:
 			iface = new FakeNetworkIface(this);
 			break;
-		case Capability::Display:
-			iface = new FakeDisplay(this);
-			break;
 		case Capability::AcAdapter:
 			iface = new FakeAcAdapter(this);
 			break;
 		case Capability::Battery:
 			iface = new FakeBattery(this);
 			break;
+		case Capability::Button:
+			iface = new FakeButton(this);
+			break;
+		case Capability::Display:
+			iface = new FakeDisplay(this);
+			break;
 		case Capability::Unknown:
 			break;
 	}
--- branches/work/kdehw/backends/hal/CMakeLists.txt #541142:541143
@@ -25,6 +25,7 @@
    networkiface.cpp 
    acadapter.cpp 
    battery.cpp 
+   button.cpp 
    display.cpp )
 
 kde4_automoc(${kdehw_hal_PART_SRCS})
--- branches/work/kdehw/backends/hal/capability.h #541142:541143
@@ -64,6 +64,8 @@
             return "ac_adapter";
         case Capability::Battery:
             return "battery";
+        case Capability::Button:
+            return "button";
         case Capability::Display:
             return "display_device";
         default:
@@ -95,6 +97,8 @@
             return Capability::AcAdapter;
         else if ( capability == "battery" )
             return Capability::Battery;
+        else if ( capability == "button" )
+            return Capability::Button;
         else if ( capability == "display_device" )
             return Capability::Display;
         else
--- branches/work/kdehw/backends/hal/haldevice.cpp #541142:541143
@@ -33,6 +33,7 @@
 #include "networkiface.h"
 #include "acadapter.h"
 #include "battery.h"
+#include "button.h"
 #include "display.h"
 
 class HalDevicePrivate
@@ -289,6 +290,9 @@
     case Capability::Battery:
         iface = new Battery( this );
         break;
+    case Capability::Button:
+        iface = new Button( this );
+        break;
     case Capability::Display:
         iface = new Display( this );
         break;
--- branches/work/kdehw/kdehw/CMakeLists.txt #541142:541143
@@ -22,6 +22,7 @@
    networkiface.cpp 
    acadapter.cpp 
    battery.cpp 
+   button.cpp
    display.cpp 
    predicate.cpp 
    predicateparse.cpp 
@@ -41,7 +42,7 @@
 ########### install files ###############
 
 install_files( ${SERVICETYPES_INSTALL_DIR} FILES  kdehwdevicemanager.desktop )
-install_files( /include/kdehw FILES  device.h devicemanager.h capability.h \
processor.h block.h storage.h cdrom.h volume.h opticaldisc.h camera.h \
portablemediaplayer.h networkiface.h acadapter.h battery.h display.h predicate.h ) \
+install_files( /include/kdehw FILES  device.h devicemanager.h capability.h \
processor.h block.h storage.h cdrom.h volume.h opticaldisc.h camera.h \
portablemediaplayer.h networkiface.h acadapter.h battery.h button.h display.h \
predicate.h )  
 kde4_footer()
 
--- branches/work/kdehw/kdehw/device.cpp #541142:541143
@@ -44,6 +44,8 @@
 #include <kdehw/ifaces/acadapter.h>
 #include <kdehw/battery.h>
 #include <kdehw/ifaces/battery.h>
+#include <kdehw/button.h>
+#include <kdehw/ifaces/button.h>
 #include <kdehw/display.h>
 #include <kdehw/ifaces/display.h>
 
@@ -290,6 +292,9 @@
             case Capability::Battery:
                 iface = capability_cast<Ifaces::Battery, Battery>( cap_iface );
                 break;
+            case Capability::Button:
+                iface = capability_cast<Ifaces::Button, Button>( cap_iface );
+                break;
             case Capability::Display:
                 iface = capability_cast<Ifaces::Display, Display>( cap_iface );
                 break;
--- branches/work/kdehw/kdehw/ifaces/CMakeLists.txt #541142:541143
@@ -19,6 +19,7 @@
    networkiface.cpp 
    acadapter.cpp 
    battery.cpp 
+   button.cpp
    display.cpp 
    abstractcapability.cpp )
 
@@ -34,7 +35,7 @@
 
 ########### install files ###############
 
-install_files( /include/kdehw/ifaces FILES  devicemanager.h device.h enums.h \
capability.h processor.h block.h storage.h cdrom.h volume.h opticaldisc.h camera.h \
portablemediaplayer.h networkiface.h acadapter.h battery.h display.h \
abstractcapability.h ) +install_files( /include/kdehw/ifaces FILES  devicemanager.h \
device.h enums.h capability.h processor.h block.h storage.h cdrom.h volume.h \
opticaldisc.h camera.h portablemediaplayer.h networkiface.h acadapter.h battery.h \
button.h display.h abstractcapability.h )  
 kde4_footer()
 
--- branches/work/kdehw/kdehw/ifaces/enums.h #541142:541143
@@ -73,7 +73,7 @@
                     Volume = 16, OpticalDisc = 32,
                     Camera = 64, PortableMediaPlayer = 128,
                     NetworkIface = 256, AcAdapter = 512,
-                    Battery = 1024, Display = 2048 };
+                    Battery = 1024, Button = 2048, Display = 4096 };
 
         /**
          * This type stores an OR combination of Type values.
@@ -284,6 +284,23 @@
     };
 
     /**
+     * This struct holds the enumeration used by KDEHW::Button
+     * and KDEHW::Ifaces::Button. You shouldn't use it directly.
+     */
+    struct Button
+    {
+        /**
+         * This enum type defines the type of button.
+         *
+         * - 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. +         * - UnknowButtonType : The type of the \
button is unknow. +         */
+         enum ButtonType{ LidButton, PowerButton, SleepButton, UnknowButtonType };
+    };
+
+    /**
      * This struct holds the enumerations used by KDEHW::Display
      * and KDEHW::Ifaces::Display. You shouldn't use it directly.
      */
--- branches/work/kdehw/kdehw/predicate.cpp #541142:541143
@@ -82,6 +82,7 @@
     map["NetworkIface"] = Capability::NetworkIface;
     map["AcAdapter"] = Capability::AcAdapter;
     map["Battery"] = Capability::Battery;
+    map["Button"] = Capability::Button;
     map["Display"] = Capability::Display;
 
     if ( map.contains( capability ) )
@@ -231,6 +232,9 @@
         case Capability::Battery:
             capability = "Battery";
             break;
+        case Capability::Button:
+            capability = "Button";
+            break;
         case Capability::Display:
             capability = "Display";
             break;


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

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