[prev in list] [next in list] [prev in thread] [next in thread]
List: kde-commits
Subject: [pykde5] /: Added solid support.
From: Simon Edwards <simon () simonzone ! com>
Date: 2014-03-02 14:19:43
Message-ID: E1WK7F1-0000CH-Jp () scm ! kde ! org
[Download RAW message or body]
Git commit c2ad0d16bab805ff2e1d815784e3a801637a061c by Simon Edwards.
Committed on 02/03/2014 at 14:19.
Pushed by sedwards into branch 'master'.
Added solid support.
M +13 -2 CMakeLists.txt
C +19 -23 sip/solid/acadapter.sip [from: sip/typedefs.sip - 063% similarity]
A +62 -0 sip/solid/audiointerface.sip
A +83 -0 sip/solid/battery.sip
C +19 -23 sip/solid/block.sip [from: sip/typedefs.sip - 063% similarity]
C +31 -23 sip/solid/button.sip [from: sip/typedefs.sip - 052% similarity]
C +19 -23 sip/solid/camera.sip [from: sip/typedefs.sip - 060% similarity]
A +50 -0 sip/solid/device.sip
A +65 -0 sip/solid/deviceinterface.sip
C +17 -23 sip/solid/devicenotifier.sip [from: sip/typedefs.sip - 069% similarity]
C +35 -23 sip/solid/dvbinterface.sip [from: sip/typedefs.sip - 050% similarity]
A +47 -0 sip/solid/genericinterface.sip
A +57 -0 sip/solid/internetgateway.sip
C +18 -23 sip/solid/keyboard.sip [from: sip/typedefs.sip - 066% similarity]
A +58 -0 sip/solid/networking.sip
C +20 -23 sip/solid/networkinterface.sip [from: sip/typedefs.sip - 059% similarity]
C +25 -23 sip/solid/networkshare.sip [from: sip/typedefs.sip - 060% similarity]
A +73 -0 sip/solid/opticaldisc.sip
A +64 -0 sip/solid/opticaldrive.sip
C +27 -23 sip/solid/pointingdevice.sip [from: sip/typedefs.sip - 058% similarity]
C +19 -23 sip/solid/portablemediaplayer.sip [from: sip/typedefs.sip - 057% similarity]
A +52 -0 sip/solid/powermanagement.sip
A +66 -0 sip/solid/predicate.sip
A +52 -0 sip/solid/processor.sip
C +25 -23 sip/solid/serialinterface.sip [from: sip/typedefs.sip - 057% similarity]
C +25 -23 sip/solid/smartcardreader.sip [from: sip/typedefs.sip - 060% similarity]
A +58 -0 sip/solid/solidmod.sip
C +19 -23 sip/solid/solidnamespace.sip [from: sip/typedefs.sip - 074% similarity]
A +46 -0 sip/solid/storageaccess.sip
A +64 -0 sip/solid/storagedrive.sip
A +53 -0 sip/solid/storagevolume.sip
C +19 -23 sip/solid/video.sip [from: sip/typedefs.sip - 060% similarity]
M +115 -0 sip/typedefs.sip
http://commits.kde.org/pykde5/c2ad0d16bab805ff2e1d815784e3a801637a061c
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 07b24b0..4be8899 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -20,7 +20,7 @@ include(PythonMacros)
include(FeatureSummary)
include(ECMSetupVersion)
-find_package(KF5 CONFIG REQUIRED Auth ItemModels ItemViews Archive Plotting)
+find_package(KF5 CONFIG REQUIRED Auth ItemModels ItemViews Archive Plotting Solid)
#option(PYKDEUIC4_ALTINSTALL "Enable parallel-installation of the PyKDE4 tools" FALSE)
@@ -85,11 +85,15 @@ get_property(qt5core_include TARGET Qt5::Core PROPERTY INTERFACE_INCLUDE_DIRECTO
get_property(qt5gui_include TARGET Qt5::Gui PROPERTY INTERFACE_INCLUDE_DIRECTORIES)
get_property(qt5widgets_include TARGET Qt5::Widgets PROPERTY INTERFACE_INCLUDE_DIRECTORIES)
+get_property(solid_include TARGET KF5::Solid PROPERTY INTERFACE_INCLUDE_DIRECTORIES)
+# Soild is being difficult. Lets set it here explicitly.
+
include_directories(
${SIP_INCLUDE_DIR}
${qt5core_include}
${qt5gui_include}
${qt5widgets_include}
+ ${solid_include}/solid
)
add_definitions(-D_REENTRANT -DSIP_PROTECTED_IS_PUBLIC -Dprotected=public)
@@ -123,7 +127,14 @@ file(GLOB kplottin_files_sip sip/kplotting/*.sip)
set(SIP_EXTRA_FILES_DEPEND ${kplotting_files_sip})
add_sip_python_module(PyKDE5.kplotting sip/kplotting/kplottingmod.sip KF5::Plotting)
-set(PYKDE_MODULES "kitemmodels kitemviews karchive kplotting")
+# solid
+file(GLOB solid_files_sip sip/solid/*.sip)
+set(SIP_EXTRA_FILES_DEPEND ${solid_files_sip})
+
+
+add_sip_python_module(PyKDE5.solid sip/solid/solidmod.sip KF5::Solid)
+
+set(PYKDE_MODULES "kitemmodels kitemviews karchive kplotting solid")
###############################################################################
diff --git a/sip/typedefs.sip b/sip/solid/acadapter.sip
similarity index 63%
copy from sip/typedefs.sip
copy to sip/solid/acadapter.sip
index a1d2375..90e39d1 100644
--- a/sip/typedefs.sip
+++ b/sip/solid/acadapter.sip
@@ -1,5 +1,7 @@
// Copyright 2014 Simon Edwards <simon@simonzone.com>
+// Generated by twine2
+
// This program is free software; you can redistribute it and/or modify
// it under the terms of the GNU Library General Public License as
// published by the Free Software Foundation; either version 2, or
@@ -15,26 +17,20 @@
// Free Software Foundation, Inc.,
// 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
-%Module PyKDE5.typedefs
-
-typedef uint mode_t;
-
-typedef long time_t;
-
-typedef ulong size_t;
-
-typedef int ssize_t;
-
-typedef int pid_t;
-
-typedef ulong Window;
-
-typedef bool Bool;
-
-typedef uint WFlags;
-
-typedef long off_t;
-
-typedef uint uid_t;
-
-typedef uint gid_t;
+namespace Solid
+{
+class AcAdapter : Solid::DeviceInterface
+{
+%TypeHeaderCode
+#include <acadapter.h>
+%End
+
+ explicit AcAdapter (QObject* backendObject);
+public:
+ virtual ~AcAdapter ();
+ static Solid::DeviceInterface::Type deviceInterfaceType ();
+ bool isPlugged () const;
+signals:
+ void plugStateChanged (bool newState, const QString& udi);
+};
+};
diff --git a/sip/solid/audiointerface.sip b/sip/solid/audiointerface.sip
new file mode 100644
index 0000000..bb75c0a
--- /dev/null
+++ b/sip/solid/audiointerface.sip
@@ -0,0 +1,62 @@
+// Copyright 2014 Simon Edwards <simon@simonzone.com>
+
+// Generated by twine2
+
+// This program is free software; you can redistribute it and/or modify
+// it under the terms of the GNU Library General Public License as
+// published by the Free Software Foundation; either version 2, or
+// (at your option) any later version.
+
+// This program is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details
+
+// You should have received a copy of the GNU Library General Public
+// License along with this program; if not, write to the
+// Free Software Foundation, Inc.,
+// 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+
+namespace Solid
+{
+class AudioInterface : Solid::DeviceInterface
+{
+%TypeHeaderCode
+#include <audiointerface.h>
+%End
+
+public:
+ enum AudioDriver
+ {
+ Alsa,
+ OpenSoundSystem,
+ UnknownAudioDriver
+ };
+ enum AudioInterfaceType
+ {
+ UnknownAudioInterfaceType,
+ AudioControl,
+ AudioInput,
+ AudioOutput
+ };
+ typedef QFlags<Solid::AudioInterface::AudioInterfaceType> AudioInterfaceTypes;
+ enum SoundcardType
+ {
+ InternalSoundcard,
+ UsbSoundcard,
+ FirewireSoundcard,
+ Headset,
+ Modem
+ };
+private:
+ explicit AudioInterface (QObject* backendObject);
+public:
+ virtual ~AudioInterface ();
+ static Solid::DeviceInterface::Type deviceInterfaceType ();
+ Solid::AudioInterface::AudioDriver driver () const;
+ QVariant driverHandle () const;
+ QString name () const;
+ Solid::AudioInterface::AudioInterfaceTypes deviceType () const;
+ Solid::AudioInterface::SoundcardType soundcardType () const;
+};
+};
diff --git a/sip/solid/battery.sip b/sip/solid/battery.sip
new file mode 100644
index 0000000..766bd14
--- /dev/null
+++ b/sip/solid/battery.sip
@@ -0,0 +1,83 @@
+// Copyright 2014 Simon Edwards <simon@simonzone.com>
+
+// Generated by twine2
+
+// This program is free software; you can redistribute it and/or modify
+// it under the terms of the GNU Library General Public License as
+// published by the Free Software Foundation; either version 2, or
+// (at your option) any later version.
+
+// This program is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details
+
+// You should have received a copy of the GNU Library General Public
+// License along with this program; if not, write to the
+// Free Software Foundation, Inc.,
+// 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+
+namespace Solid
+{
+class Battery : Solid::DeviceInterface
+{
+%TypeHeaderCode
+#include <battery.h>
+%End
+
+public:
+ enum BatteryType
+ {
+ UnknownBattery,
+ PdaBattery,
+ UpsBattery,
+ PrimaryBattery,
+ MouseBattery,
+ KeyboardBattery,
+ KeyboardMouseBattery,
+ CameraBattery,
+ PhoneBattery,
+ MonitorBattery
+ };
+ enum ChargeState
+ {
+ NoCharge,
+ Charging,
+ Discharging
+ };
+ enum Technology
+ {
+ UnknownTechnology,
+ LithiumIon,
+ LithiumPolymer,
+ LithiumIronPhosphate,
+ LeadAcid,
+ NickelCadmium,
+ NickelMetalHydride
+ };
+private:
+ explicit Battery (QObject* backendObject);
+public:
+ virtual ~Battery ();
+ static Solid::DeviceInterface::Type deviceInterfaceType ();
+ bool isPlugged () const;
+ bool isPowerSupply () const;
+ Solid::Battery::BatteryType type () const;
+ int chargePercent () const;
+ int capacity () const;
+ bool isRechargeable () const;
+ Solid::Battery::ChargeState chargeState () const;
+ Solid::Battery::Technology technology () const;
+ double energy () const;
+ double energyRate () const;
+ double voltage () const;
+signals:
+ void chargePercentChanged (int value, const QString& udi);
+ void capacityChanged (int value, const QString& udi);
+ void chargeStateChanged (int newState, const QString& udi);
+ void plugStateChanged (bool newState, const QString& udi);
+ void energyChanged (double energy, const QString& udi);
+ void energyRateChanged (double energyRate, const QString& udi);
+ void powerSupplyStateChanged (bool newState, const QString& udi);
+};
+};
diff --git a/sip/typedefs.sip b/sip/solid/block.sip
similarity index 63%
copy from sip/typedefs.sip
copy to sip/solid/block.sip
index a1d2375..047f374 100644
--- a/sip/typedefs.sip
+++ b/sip/solid/block.sip
@@ -1,5 +1,7 @@
// Copyright 2014 Simon Edwards <simon@simonzone.com>
+// Generated by twine2
+
// This program is free software; you can redistribute it and/or modify
// it under the terms of the GNU Library General Public License as
// published by the Free Software Foundation; either version 2, or
@@ -15,26 +17,20 @@
// Free Software Foundation, Inc.,
// 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
-%Module PyKDE5.typedefs
-
-typedef uint mode_t;
-
-typedef long time_t;
-
-typedef ulong size_t;
-
-typedef int ssize_t;
-
-typedef int pid_t;
-
-typedef ulong Window;
-
-typedef bool Bool;
-
-typedef uint WFlags;
-
-typedef long off_t;
-
-typedef uint uid_t;
-
-typedef uint gid_t;
+namespace Solid
+{
+class Block : Solid::DeviceInterface
+{
+%TypeHeaderCode
+#include <block.h>
+%End
+
+ explicit Block (QObject* backendObject);
+public:
+ virtual ~Block ();
+ static Solid::DeviceInterface::Type deviceInterfaceType ();
+ int deviceMajor () const;
+ int deviceMinor () const;
+ QString device () const;
+};
+};
diff --git a/sip/typedefs.sip b/sip/solid/button.sip
similarity index 52%
copy from sip/typedefs.sip
copy to sip/solid/button.sip
index a1d2375..ecf9133 100644
--- a/sip/typedefs.sip
+++ b/sip/solid/button.sip
@@ -1,5 +1,7 @@
// Copyright 2014 Simon Edwards <simon@simonzone.com>
+// Generated by twine2
+
// This program is free software; you can redistribute it and/or modify
// it under the terms of the GNU Library General Public License as
// published by the Free Software Foundation; either version 2, or
@@ -15,26 +17,32 @@
// Free Software Foundation, Inc.,
// 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
-%Module PyKDE5.typedefs
-
-typedef uint mode_t;
-
-typedef long time_t;
-
-typedef ulong size_t;
-
-typedef int ssize_t;
-
-typedef int pid_t;
-
-typedef ulong Window;
-
-typedef bool Bool;
-
-typedef uint WFlags;
-
-typedef long off_t;
-
-typedef uint uid_t;
-
-typedef uint gid_t;
+namespace Solid
+{
+class Button : Solid::DeviceInterface
+{
+%TypeHeaderCode
+#include <button.h>
+%End
+
+public:
+ enum ButtonType
+ {
+ LidButton,
+ PowerButton,
+ SleepButton,
+ UnknownButtonType,
+ TabletButton
+ };
+private:
+ explicit Button (QObject* backendObject);
+public:
+ virtual ~Button ();
+ static Solid::DeviceInterface::Type deviceInterfaceType ();
+ Solid::Button::ButtonType type () const;
+ bool hasState () const;
+ bool stateValue () const;
+signals:
+ void pressed (Solid::Button::ButtonType type, const QString& udi);
+};
+};
diff --git a/sip/typedefs.sip b/sip/solid/camera.sip
similarity index 60%
copy from sip/typedefs.sip
copy to sip/solid/camera.sip
index a1d2375..9c48bb4 100644
--- a/sip/typedefs.sip
+++ b/sip/solid/camera.sip
@@ -1,5 +1,7 @@
// Copyright 2014 Simon Edwards <simon@simonzone.com>
+// Generated by twine2
+
// This program is free software; you can redistribute it and/or modify
// it under the terms of the GNU Library General Public License as
// published by the Free Software Foundation; either version 2, or
@@ -15,26 +17,20 @@
// Free Software Foundation, Inc.,
// 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
-%Module PyKDE5.typedefs
-
-typedef uint mode_t;
-
-typedef long time_t;
-
-typedef ulong size_t;
-
-typedef int ssize_t;
-
-typedef int pid_t;
-
-typedef ulong Window;
-
-typedef bool Bool;
-
-typedef uint WFlags;
-
-typedef long off_t;
-
-typedef uint uid_t;
-
-typedef uint gid_t;
+namespace Solid
+{
+class Camera : Solid::DeviceInterface
+{
+%TypeHeaderCode
+#include <camera.h>
+%End
+
+ explicit Camera (QObject* backendObject);
+public:
+ virtual ~Camera ();
+ static Solid::DeviceInterface::Type deviceInterfaceType ();
+ QStringList supportedProtocols () const;
+ QStringList supportedDrivers (QString protocol = QString()) const;
+ QVariant driverHandle (const QString& driver) const;
+};
+};
diff --git a/sip/solid/device.sip b/sip/solid/device.sip
new file mode 100644
index 0000000..e21fbe0
--- /dev/null
+++ b/sip/solid/device.sip
@@ -0,0 +1,50 @@
+// Copyright 2014 Simon Edwards <simon@simonzone.com>
+
+// Generated by twine2
+
+// This program is free software; you can redistribute it and/or modify
+// it under the terms of the GNU Library General Public License as
+// published by the Free Software Foundation; either version 2, or
+// (at your option) any later version.
+
+// This program is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details
+
+// You should have received a copy of the GNU Library General Public
+// License along with this program; if not, write to the
+// Free Software Foundation, Inc.,
+// 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+
+namespace Solid
+{
+class Device
+{
+%TypeHeaderCode
+#include <device.h>
+%End
+
+public:
+ static QList<Solid::Device> allDevices ();
+ static QList<Solid::Device> listFromType (const Solid::DeviceInterface::Type& type, const QString& \
parentUdi = QString()); + static QList<Solid::Device> listFromQuery (const Solid::Predicate& \
predicate, const QString& parentUdi = QString()); + static QList<Solid::Device> listFromQuery (const \
QString& predicate, const QString& parentUdi = QString()); + explicit Device (const \
QString& udi = QString()); + Device (const Solid::Device& device);
+ ~Device ();
+//ig Solid::Device& operator= (const Solid::Device& device);
+ bool isValid () const;
+ QString udi () const;
+ QString parentUdi () const;
+ Solid::Device parent () const;
+ QString vendor () const;
+ QString product () const;
+ QString icon () const;
+ QStringList emblems () const;
+ QString description () const;
+ bool isDeviceInterface (const Solid::DeviceInterface::Type& type) const;
+//ig Solid::DeviceInterface* asDeviceInterface (const Solid::DeviceInterface::Type& type);
+ const Solid::DeviceInterface* asDeviceInterface (const Solid::DeviceInterface::Type& type) const;
+};
+};
diff --git a/sip/solid/deviceinterface.sip b/sip/solid/deviceinterface.sip
new file mode 100644
index 0000000..ebf8117
--- /dev/null
+++ b/sip/solid/deviceinterface.sip
@@ -0,0 +1,65 @@
+// Copyright 2014 Simon Edwards <simon@simonzone.com>
+
+// Generated by twine2
+
+// This program is free software; you can redistribute it and/or modify
+// it under the terms of the GNU Library General Public License as
+// published by the Free Software Foundation; either version 2, or
+// (at your option) any later version.
+
+// This program is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details
+
+// You should have received a copy of the GNU Library General Public
+// License along with this program; if not, write to the
+// Free Software Foundation, Inc.,
+// 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+
+namespace Solid
+{
+class DeviceInterface : QObject /NoDefaultCtors/
+{
+%TypeHeaderCode
+#include <deviceinterface.h>
+%End
+
+public:
+ enum Type
+ {
+ Unknown,
+ GenericInterface,
+ Processor,
+ Block,
+ StorageAccess,
+ StorageDrive,
+ OpticalDrive,
+ StorageVolume,
+ OpticalDisc,
+ Camera,
+ PortableMediaPlayer,
+ NetworkInterface,
+ AcAdapter,
+ Battery,
+ Button,
+ AudioInterface,
+ DvbInterface,
+ Video,
+ SerialInterface,
+ SmartCardReader,
+ InternetGateway,
+ NetworkShare,
+ Keyboard,
+ PointingDevice,
+ Last
+ };
+ virtual ~DeviceInterface ();
+ bool isValid () const;
+ static QString typeToString (Solid::DeviceInterface::Type type);
+ static Solid::DeviceInterface::Type stringToType (const QString& type);
+ static QString typeDescription (Solid::DeviceInterface::Type type);
+protected:
+//ig DeviceInterface (DeviceInterfacePrivate& dd, QObject* backendObject);
+};
+};
diff --git a/sip/typedefs.sip b/sip/solid/devicenotifier.sip
similarity index 69%
copy from sip/typedefs.sip
copy to sip/solid/devicenotifier.sip
index a1d2375..3d780d5 100644
--- a/sip/typedefs.sip
+++ b/sip/solid/devicenotifier.sip
@@ -1,5 +1,7 @@
// Copyright 2014 Simon Edwards <simon@simonzone.com>
+// Generated by twine2
+
// This program is free software; you can redistribute it and/or modify
// it under the terms of the GNU Library General Public License as
// published by the Free Software Foundation; either version 2, or
@@ -15,26 +17,18 @@
// Free Software Foundation, Inc.,
// 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
-%Module PyKDE5.typedefs
-
-typedef uint mode_t;
-
-typedef long time_t;
-
-typedef ulong size_t;
-
-typedef int ssize_t;
-
-typedef int pid_t;
-
-typedef ulong Window;
-
-typedef bool Bool;
-
-typedef uint WFlags;
-
-typedef long off_t;
-
-typedef uint uid_t;
-
-typedef uint gid_t;
+namespace Solid
+{
+class DeviceNotifier : QObject
+{
+%TypeHeaderCode
+#include <devicenotifier.h>
+%End
+
+public:
+ static Solid::DeviceNotifier* instance ();
+signals:
+ void deviceAdded (const QString& udi);
+ void deviceRemoved (const QString& udi);
+};
+};
diff --git a/sip/typedefs.sip b/sip/solid/dvbinterface.sip
similarity index 50%
copy from sip/typedefs.sip
copy to sip/solid/dvbinterface.sip
index a1d2375..63eb6c8 100644
--- a/sip/typedefs.sip
+++ b/sip/solid/dvbinterface.sip
@@ -1,5 +1,7 @@
// Copyright 2014 Simon Edwards <simon@simonzone.com>
+// Generated by twine2
+
// This program is free software; you can redistribute it and/or modify
// it under the terms of the GNU Library General Public License as
// published by the Free Software Foundation; either version 2, or
@@ -15,26 +17,36 @@
// Free Software Foundation, Inc.,
// 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
-%Module PyKDE5.typedefs
-
-typedef uint mode_t;
-
-typedef long time_t;
-
-typedef ulong size_t;
-
-typedef int ssize_t;
-
-typedef int pid_t;
-
-typedef ulong Window;
-
-typedef bool Bool;
-
-typedef uint WFlags;
-
-typedef long off_t;
-
-typedef uint uid_t;
-
-typedef uint gid_t;
+namespace Solid
+{
+class DvbInterface : Solid::DeviceInterface
+{
+%TypeHeaderCode
+#include <dvbinterface.h>
+%End
+
+public:
+ enum DeviceType
+ {
+ DvbUnknown,
+ DvbAudio,
+ DvbCa,
+ DvbDemux,
+ DvbDvr,
+ DvbFrontend,
+ DvbNet,
+ DvbOsd,
+ DvbSec,
+ DvbVideo
+ };
+private:
+ explicit DvbInterface (QObject* backendObject);
+public:
+ virtual ~DvbInterface ();
+ static Solid::DeviceInterface::Type deviceInterfaceType ();
+ QString device () const;
+ int deviceAdapter () const;
+ Solid::DvbInterface::DeviceType deviceType () const;
+ int deviceIndex () const;
+};
+};
diff --git a/sip/solid/genericinterface.sip b/sip/solid/genericinterface.sip
new file mode 100644
index 0000000..8df6153
--- /dev/null
+++ b/sip/solid/genericinterface.sip
@@ -0,0 +1,47 @@
+// Copyright 2014 Simon Edwards <simon@simonzone.com>
+
+// Generated by twine2
+
+// This program is free software; you can redistribute it and/or modify
+// it under the terms of the GNU Library General Public License as
+// published by the Free Software Foundation; either version 2, or
+// (at your option) any later version.
+
+// This program is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details
+
+// You should have received a copy of the GNU Library General Public
+// License along with this program; if not, write to the
+// Free Software Foundation, Inc.,
+// 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+
+namespace Solid
+{
+class GenericInterface : Solid::DeviceInterface
+{
+%TypeHeaderCode
+#include <genericinterface.h>
+%End
+
+public:
+ enum PropertyChange
+ {
+ PropertyModified,
+ PropertyAdded,
+ PropertyRemoved
+ };
+private:
+ explicit GenericInterface (QObject* backendObject);
+public:
+ virtual ~GenericInterface ();
+ static Solid::DeviceInterface::Type deviceInterfaceType ();
+ QVariant property (const QString& key) const;
+ QMap<QString,QVariant> allProperties () const;
+ bool propertyExists (const QString& key) const;
+signals:
+ void propertyChanged (const QMap<QString,int>& changes);
+ void conditionRaised (const QString& condition, const QString& reason);
+};
+};
diff --git a/sip/solid/internetgateway.sip b/sip/solid/internetgateway.sip
new file mode 100644
index 0000000..768e03e
--- /dev/null
+++ b/sip/solid/internetgateway.sip
@@ -0,0 +1,57 @@
+// Copyright 2014 Simon Edwards <simon@simonzone.com>
+
+// Generated by twine2
+
+// This program is free software; you can redistribute it and/or modify
+// it under the terms of the GNU Library General Public License as
+// published by the Free Software Foundation; either version 2, or
+// (at your option) any later version.
+
+// This program is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details
+
+// You should have received a copy of the GNU Library General Public
+// License along with this program; if not, write to the
+// Free Software Foundation, Inc.,
+// 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+
+namespace Solid
+{
+class InternetGateway : Solid::DeviceInterface
+{
+%TypeHeaderCode
+#include <internetgateway.h>
+%End
+
+ explicit InternetGateway (QObject* backendObject);
+public:
+ enum InternetStatus
+ {
+ InternetEnabled,
+ InternetDisabled,
+ UnknownStatus
+ };
+ enum NetworkProtocol
+ {
+ TCP,
+ UDP
+ };
+ virtual ~InternetGateway ();
+ static Solid::DeviceInterface::Type deviceInterfaceType ();
+ void requestCurrentConnections () const;
+ QStringList currentConnections () const;
+ void addPortMapping (const QString& remoteHost, qint16 externalPort, const \
Solid::InternetGateway::NetworkProtocol& mappingProtocol, qint16 internalPort, const QString& \
internalClient); + void deletePortMapping (const QString& remoteHost, qint16 \
externalPort, const Solid::InternetGateway::NetworkProtocol& mappingProtocol); + \
Solid::InternetGateway::InternetStatus isEnabledForInternet () const; + void \
setEnabledForInternet (bool enabled); +signals:
+ void portMappingAdded (const QString& remoteHost, qint16 externalPort, const \
Solid::InternetGateway::NetworkProtocol& mappingProtocol, qint16 internalPort, const QString& \
internalClient); + void portMappingDeleted (const QString& remoteHost, qint16 \
externalPort, const Solid::InternetGateway::NetworkProtocol& mappingProtocol); + void \
enabledForInternet (bool enabled); + void currentConnectionsDataIsReady \
(QStringList currentConnections); +protected:
+//ig InternetGateway (InternetGatewayPrivate& dd, QObject* backendObject);
+};
+};
diff --git a/sip/typedefs.sip b/sip/solid/keyboard.sip
similarity index 66%
copy from sip/typedefs.sip
copy to sip/solid/keyboard.sip
index a1d2375..983ecbe 100644
--- a/sip/typedefs.sip
+++ b/sip/solid/keyboard.sip
@@ -1,5 +1,7 @@
// Copyright 2014 Simon Edwards <simon@simonzone.com>
+// Generated by twine2
+
// This program is free software; you can redistribute it and/or modify
// it under the terms of the GNU Library General Public License as
// published by the Free Software Foundation; either version 2, or
@@ -15,26 +17,19 @@
// Free Software Foundation, Inc.,
// 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
-%Module PyKDE5.typedefs
-
-typedef uint mode_t;
-
-typedef long time_t;
-
-typedef ulong size_t;
-
-typedef int ssize_t;
-
-typedef int pid_t;
-
-typedef ulong Window;
-
-typedef bool Bool;
-
-typedef uint WFlags;
-
-typedef long off_t;
-
-typedef uint uid_t;
-
-typedef uint gid_t;
+namespace Solid
+{
+class Keyboard : Solid::DeviceInterface
+{
+%TypeHeaderCode
+#include <keyboard.h>
+%End
+
+ explicit Keyboard (QObject* backendObject);
+public:
+ virtual ~Keyboard ();
+ static Solid::DeviceInterface::Type deviceInterfaceType ();
+ QString layout () const;
+ QString model () const;
+};
+};
diff --git a/sip/solid/networking.sip b/sip/solid/networking.sip
new file mode 100644
index 0000000..1bc2d50
--- /dev/null
+++ b/sip/solid/networking.sip
@@ -0,0 +1,58 @@
+// Copyright 2014 Simon Edwards <simon@simonzone.com>
+
+// Generated by twine2
+
+// This program is free software; you can redistribute it and/or modify
+// it under the terms of the GNU Library General Public License as
+// published by the Free Software Foundation; either version 2, or
+// (at your option) any later version.
+
+// This program is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details
+
+// You should have received a copy of the GNU Library General Public
+// License along with this program; if not, write to the
+// Free Software Foundation, Inc.,
+// 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+
+namespace Solid
+{
+namespace Networking
+{
+enum Status
+{
+ Unknown,
+ Unconnected,
+ Disconnecting,
+ Connecting,
+ Connected
+};
+enum ManagementPolicy
+{
+ Manual,
+ OnNextStatusChange,
+ Managed
+};
+Solid::Networking::Status status ();
+void setConnectPolicy (Solid::Networking::ManagementPolicy policy);
+Solid::Networking::ManagementPolicy connectPolicy ();
+void setDisconnectPolicy (Solid::Networking::ManagementPolicy policy);
+Solid::Networking::ManagementPolicy disconnectPolicy ();
+class Notifier : QObject
+{
+%TypeHeaderCode
+#include <networking.h>
+%End
+
+signals:
+ void statusChanged (Solid::Networking::Status status);
+ void shouldConnect ();
+ void shouldDisconnect ();
+protected:
+ Notifier ();
+};
+Solid::Networking::Notifier* notifier ();
+};
+};
diff --git a/sip/typedefs.sip b/sip/solid/networkinterface.sip
similarity index 59%
copy from sip/typedefs.sip
copy to sip/solid/networkinterface.sip
index a1d2375..10576b0 100644
--- a/sip/typedefs.sip
+++ b/sip/solid/networkinterface.sip
@@ -1,5 +1,7 @@
// Copyright 2014 Simon Edwards <simon@simonzone.com>
+// Generated by twine2
+
// This program is free software; you can redistribute it and/or modify
// it under the terms of the GNU Library General Public License as
// published by the Free Software Foundation; either version 2, or
@@ -15,26 +17,21 @@
// Free Software Foundation, Inc.,
// 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
-%Module PyKDE5.typedefs
-
-typedef uint mode_t;
-
-typedef long time_t;
-
-typedef ulong size_t;
-
-typedef int ssize_t;
-
-typedef int pid_t;
-
-typedef ulong Window;
-
-typedef bool Bool;
-
-typedef uint WFlags;
-
-typedef long off_t;
-
-typedef uint uid_t;
-
-typedef uint gid_t;
+namespace Solid
+{
+class NetworkInterface : Solid::DeviceInterface
+{
+%TypeHeaderCode
+#include <networkinterface.h>
+%End
+
+ explicit NetworkInterface (QObject* backendObject);
+public:
+ virtual ~NetworkInterface ();
+ static Solid::DeviceInterface::Type deviceInterfaceType ();
+ QString ifaceName () const;
+ bool isWireless () const;
+ QString hwAddress () const;
+ qulonglong macAddress () const;
+};
+};
diff --git a/sip/typedefs.sip b/sip/solid/networkshare.sip
similarity index 60%
copy from sip/typedefs.sip
copy to sip/solid/networkshare.sip
index a1d2375..aeb8343 100644
--- a/sip/typedefs.sip
+++ b/sip/solid/networkshare.sip
@@ -1,5 +1,7 @@
// Copyright 2014 Simon Edwards <simon@simonzone.com>
+// Generated by twine2
+
// This program is free software; you can redistribute it and/or modify
// it under the terms of the GNU Library General Public License as
// published by the Free Software Foundation; either version 2, or
@@ -15,26 +17,26 @@
// Free Software Foundation, Inc.,
// 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
-%Module PyKDE5.typedefs
-
-typedef uint mode_t;
-
-typedef long time_t;
-
-typedef ulong size_t;
-
-typedef int ssize_t;
-
-typedef int pid_t;
-
-typedef ulong Window;
-
-typedef bool Bool;
-
-typedef uint WFlags;
-
-typedef long off_t;
-
-typedef uint uid_t;
-
-typedef uint gid_t;
+namespace Solid
+{
+class NetworkShare : Solid::DeviceInterface
+{
+%TypeHeaderCode
+#include <networkshare.h>
+%End
+
+ explicit NetworkShare (QObject* backendObject);
+public:
+ virtual ~NetworkShare ();
+ enum ShareType
+ {
+ Unknown,
+ Nfs,
+ Cifs,
+ Upnp
+ };
+ static Solid::DeviceInterface::Type deviceInterfaceType ();
+ Solid::NetworkShare::ShareType type () const;
+ QUrl url () const;
+};
+};
diff --git a/sip/solid/opticaldisc.sip b/sip/solid/opticaldisc.sip
new file mode 100644
index 0000000..b3ac5f9
--- /dev/null
+++ b/sip/solid/opticaldisc.sip
@@ -0,0 +1,73 @@
+// Copyright 2014 Simon Edwards <simon@simonzone.com>
+
+// Generated by twine2
+
+// This program is free software; you can redistribute it and/or modify
+// it under the terms of the GNU Library General Public License as
+// published by the Free Software Foundation; either version 2, or
+// (at your option) any later version.
+
+// This program is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details
+
+// You should have received a copy of the GNU Library General Public
+// License along with this program; if not, write to the
+// Free Software Foundation, Inc.,
+// 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+
+namespace Solid
+{
+class OpticalDisc : Solid::StorageVolume
+{
+%TypeHeaderCode
+#include <opticaldisc.h>
+%End
+
+public:
+ enum ContentType
+ {
+ NoContent,
+ Audio,
+ Data,
+ VideoCd,
+ SuperVideoCd,
+ VideoDvd,
+ VideoBluRay
+ };
+ typedef QFlags<Solid::OpticalDisc::ContentType> ContentTypes;
+ enum DiscType
+ {
+ UnknownDiscType,
+ CdRom,
+ CdRecordable,
+ CdRewritable,
+ DvdRom,
+ DvdRam,
+ DvdRecordable,
+ DvdRewritable,
+ DvdPlusRecordable,
+ DvdPlusRewritable,
+ DvdPlusRecordableDuallayer,
+ DvdPlusRewritableDuallayer,
+ BluRayRom,
+ BluRayRecordable,
+ BluRayRewritable,
+ HdDvdRom,
+ HdDvdRecordable,
+ HdDvdRewritable
+ };
+private:
+ explicit OpticalDisc (QObject* backendObject);
+public:
+ virtual ~OpticalDisc ();
+ static Solid::DeviceInterface::Type deviceInterfaceType ();
+ Solid::OpticalDisc::ContentTypes availableContent () const;
+ Solid::OpticalDisc::DiscType discType () const;
+ bool isAppendable () const;
+ bool isBlank () const;
+ bool isRewritable () const;
+ qulonglong capacity () const;
+};
+};
diff --git a/sip/solid/opticaldrive.sip b/sip/solid/opticaldrive.sip
new file mode 100644
index 0000000..8aa7a00
--- /dev/null
+++ b/sip/solid/opticaldrive.sip
@@ -0,0 +1,64 @@
+// Copyright 2014 Simon Edwards <simon@simonzone.com>
+
+// Generated by twine2
+
+// This program is free software; you can redistribute it and/or modify
+// it under the terms of the GNU Library General Public License as
+// published by the Free Software Foundation; either version 2, or
+// (at your option) any later version.
+
+// This program is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details
+
+// You should have received a copy of the GNU Library General Public
+// License along with this program; if not, write to the
+// Free Software Foundation, Inc.,
+// 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+
+namespace Solid
+{
+class OpticalDrive : Solid::StorageDrive
+{
+%TypeHeaderCode
+#include <opticaldrive.h>
+%End
+
+public:
+ enum MediumType
+ {
+ Cdr,
+ Cdrw,
+ Dvd,
+ Dvdr,
+ Dvdrw,
+ Dvdram,
+ Dvdplusr,
+ Dvdplusrw,
+ Dvdplusdl,
+ Dvdplusdlrw,
+ Bd,
+ Bdr,
+ Bdre,
+ HdDvd,
+ HdDvdr,
+ HdDvdrw
+ };
+ typedef QFlags<Solid::OpticalDrive::MediumType> MediumTypes;
+private:
+ explicit OpticalDrive (QObject* backendObject);
+public:
+ virtual ~OpticalDrive ();
+ static Solid::DeviceInterface::Type deviceInterfaceType ();
+ Solid::OpticalDrive::MediumTypes supportedMedia () const;
+ int readSpeed () const;
+ int writeSpeed () const;
+ QList<int> writeSpeeds () const;
+ bool eject ();
+signals:
+ void ejectPressed (const QString& udi);
+ void ejectDone (Solid::ErrorType error, QVariant errorData, const QString& udi);
+ void ejectRequested (const QString& udi);
+};
+};
diff --git a/sip/typedefs.sip b/sip/solid/pointingdevice.sip
similarity index 58%
copy from sip/typedefs.sip
copy to sip/solid/pointingdevice.sip
index a1d2375..2b5c2cc 100644
--- a/sip/typedefs.sip
+++ b/sip/solid/pointingdevice.sip
@@ -1,5 +1,7 @@
// Copyright 2014 Simon Edwards <simon@simonzone.com>
+// Generated by twine2
+
// This program is free software; you can redistribute it and/or modify
// it under the terms of the GNU Library General Public License as
// published by the Free Software Foundation; either version 2, or
@@ -15,26 +17,28 @@
// Free Software Foundation, Inc.,
// 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
-%Module PyKDE5.typedefs
-
-typedef uint mode_t;
-
-typedef long time_t;
-
-typedef ulong size_t;
-
-typedef int ssize_t;
-
-typedef int pid_t;
-
-typedef ulong Window;
-
-typedef bool Bool;
-
-typedef uint WFlags;
-
-typedef long off_t;
-
-typedef uint uid_t;
-
-typedef uint gid_t;
+namespace Solid
+{
+class PointingDevice : Solid::DeviceInterface
+{
+%TypeHeaderCode
+#include <pointingdevice.h>
+%End
+
+public:
+ enum PointingDeviceType
+ {
+ Mouse,
+ Touchpad,
+ Touchscreen,
+ Tablet,
+ UnknownPointingDeviceType
+ };
+private:
+ explicit PointingDevice (QObject* backendObject);
+public:
+ virtual ~PointingDevice ();
+ static Solid::DeviceInterface::Type deviceInterfaceType ();
+ Solid::PointingDevice::PointingDeviceType type () const;
+};
+};
diff --git a/sip/typedefs.sip b/sip/solid/portablemediaplayer.sip
similarity index 57%
copy from sip/typedefs.sip
copy to sip/solid/portablemediaplayer.sip
index a1d2375..c8c6d20 100644
--- a/sip/typedefs.sip
+++ b/sip/solid/portablemediaplayer.sip
@@ -1,5 +1,7 @@
// Copyright 2014 Simon Edwards <simon@simonzone.com>
+// Generated by twine2
+
// This program is free software; you can redistribute it and/or modify
// it under the terms of the GNU Library General Public License as
// published by the Free Software Foundation; either version 2, or
@@ -15,26 +17,20 @@
// Free Software Foundation, Inc.,
// 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
-%Module PyKDE5.typedefs
-
-typedef uint mode_t;
-
-typedef long time_t;
-
-typedef ulong size_t;
-
-typedef int ssize_t;
-
-typedef int pid_t;
-
-typedef ulong Window;
-
-typedef bool Bool;
-
-typedef uint WFlags;
-
-typedef long off_t;
-
-typedef uint uid_t;
-
-typedef uint gid_t;
+namespace Solid
+{
+class PortableMediaPlayer : Solid::DeviceInterface
+{
+%TypeHeaderCode
+#include <portablemediaplayer.h>
+%End
+
+ explicit PortableMediaPlayer (QObject* backendObject);
+public:
+ virtual ~PortableMediaPlayer ();
+ static Solid::DeviceInterface::Type deviceInterfaceType ();
+ QStringList supportedProtocols () const;
+ QStringList supportedDrivers (QString protocol = QString()) const;
+ QVariant driverHandle (const QString& driver) const;
+};
+};
diff --git a/sip/solid/powermanagement.sip b/sip/solid/powermanagement.sip
new file mode 100644
index 0000000..6efe7bb
--- /dev/null
+++ b/sip/solid/powermanagement.sip
@@ -0,0 +1,52 @@
+// Copyright 2014 Simon Edwards <simon@simonzone.com>
+
+// Generated by twine2
+
+// This program is free software; you can redistribute it and/or modify
+// it under the terms of the GNU Library General Public License as
+// published by the Free Software Foundation; either version 2, or
+// (at your option) any later version.
+
+// This program is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details
+
+// You should have received a copy of the GNU Library General Public
+// License along with this program; if not, write to the
+// Free Software Foundation, Inc.,
+// 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+
+%ModuleHeaderCode
+#include <powermanagement.h>
+%End
+namespace Solid
+{
+namespace PowerManagement
+{
+enum SleepState
+{
+ StandbyState,
+ SuspendState,
+ HibernateState,
+ HybridSuspendState
+};
+bool appShouldConserveResources ();
+QSet<Solid::PowerManagement::SleepState> supportedSleepStates ();
+void requestSleep (Solid::PowerManagement::SleepState state, QObject* receiver, const \
char* member); +int beginSuppressingSleep (const QString& reason = QString());
+bool stopSuppressingSleep (int cookie);
+int beginSuppressingScreenPowerManagement (const QString& reason = QString());
+bool stopSuppressingScreenPowerManagement (int cookie);
+class Notifier : QObject
+{
+
+signals:
+ void appShouldConserveResourcesChanged (bool newState);
+ void resumingFromSuspend ();
+protected:
+ Notifier ();
+};
+Solid::PowerManagement::Notifier* notifier ();
+};
+};
diff --git a/sip/solid/predicate.sip b/sip/solid/predicate.sip
new file mode 100644
index 0000000..de9a573
--- /dev/null
+++ b/sip/solid/predicate.sip
@@ -0,0 +1,66 @@
+// Copyright 2014 Simon Edwards <simon@simonzone.com>
+
+// Generated by twine2
+
+// This program is free software; you can redistribute it and/or modify
+// it under the terms of the GNU Library General Public License as
+// published by the Free Software Foundation; either version 2, or
+// (at your option) any later version.
+
+// This program is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details
+
+// You should have received a copy of the GNU Library General Public
+// License along with this program; if not, write to the
+// Free Software Foundation, Inc.,
+// 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+
+namespace Solid
+{
+class Predicate
+{
+%TypeHeaderCode
+#include <predicate.h>
+%End
+
+public:
+ enum ComparisonOperator
+ {
+ Equals,
+ Mask
+ };
+ enum Type
+ {
+ PropertyCheck,
+ Conjunction,
+ Disjunction,
+ InterfaceCheck
+ };
+ Predicate ();
+ Predicate (const Solid::Predicate& other);
+ Predicate (const Solid::DeviceInterface::Type& ifaceType, const QString& \
property, const QVariant& value, Solid::Predicate::ComparisonOperator compOperator = \
Solid::Predicate::ComparisonOperator::Equals); + Predicate (const QString& \
ifaceName, const QString& property, const QVariant& value, Solid::Predicate::ComparisonOperator \
compOperator = Solid::Predicate::ComparisonOperator::Equals); + explicit Predicate \
(const Solid::DeviceInterface::Type& ifaceType); + explicit Predicate (const QString& \
ifaceName); + ~Predicate ();
+//ig Solid::Predicate& operator= (const Solid::Predicate& other);
+ Solid::Predicate operator& (const Solid::Predicate& other);
+ Solid::Predicate& operator&= (const Solid::Predicate& other);
+ Solid::Predicate operator| (const Solid::Predicate& other);
+ Solid::Predicate& operator|= (const Solid::Predicate& other);
+ bool isValid () const;
+ bool matches (const Solid::Device& device) const;
+ QSet<Solid::DeviceInterface::Type> usedTypes () const;
+ QString toString () const;
+ static Solid::Predicate fromString (const QString& predicate);
+ Solid::Predicate::Type type () const;
+ Solid::DeviceInterface::Type interfaceType () const;
+ QString propertyName () const;
+ QVariant matchingValue () const;
+ Solid::Predicate::ComparisonOperator comparisonOperator () const;
+ Solid::Predicate firstOperand () const;
+ Solid::Predicate secondOperand () const;
+};
+};
diff --git a/sip/solid/processor.sip b/sip/solid/processor.sip
new file mode 100644
index 0000000..ecc3034
--- /dev/null
+++ b/sip/solid/processor.sip
@@ -0,0 +1,52 @@
+// Copyright 2014 Simon Edwards <simon@simonzone.com>
+
+// Generated by twine2
+
+// This program is free software; you can redistribute it and/or modify
+// it under the terms of the GNU Library General Public License as
+// published by the Free Software Foundation; either version 2, or
+// (at your option) any later version.
+
+// This program is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details
+
+// You should have received a copy of the GNU Library General Public
+// License along with this program; if not, write to the
+// Free Software Foundation, Inc.,
+// 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+
+%ModuleHeaderCode
+#include <processor.h>
+%End
+namespace Solid
+{
+class Processor : Solid::DeviceInterface
+{
+
+ explicit Processor (QObject* backendObject);
+public:
+ enum InstructionSet
+ {
+ NoExtensions,
+ IntelMmx,
+ IntelSse,
+ IntelSse2,
+ IntelSse3,
+ IntelSsse3,
+ IntelSse4,
+ IntelSse41,
+ IntelSse42,
+ Amd3DNow,
+ AltiVec
+ };
+ typedef QFlags<Solid::Processor::InstructionSet> InstructionSets;
+ virtual ~Processor ();
+ static Solid::DeviceInterface::Type deviceInterfaceType ();
+ int number () const;
+ int maxSpeed () const;
+ bool canChangeFrequency () const;
+ Solid::Processor::InstructionSets instructionSets () const;
+};
+};
diff --git a/sip/typedefs.sip b/sip/solid/serialinterface.sip
similarity index 57%
copy from sip/typedefs.sip
copy to sip/solid/serialinterface.sip
index a1d2375..18bd642 100644
--- a/sip/typedefs.sip
+++ b/sip/solid/serialinterface.sip
@@ -1,5 +1,7 @@
// Copyright 2014 Simon Edwards <simon@simonzone.com>
+// Generated by twine2
+
// This program is free software; you can redistribute it and/or modify
// it under the terms of the GNU Library General Public License as
// published by the Free Software Foundation; either version 2, or
@@ -15,26 +17,26 @@
// Free Software Foundation, Inc.,
// 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
-%Module PyKDE5.typedefs
-
-typedef uint mode_t;
-
-typedef long time_t;
-
-typedef ulong size_t;
-
-typedef int ssize_t;
-
-typedef int pid_t;
-
-typedef ulong Window;
-
-typedef bool Bool;
-
-typedef uint WFlags;
-
-typedef long off_t;
-
-typedef uint uid_t;
-
-typedef uint gid_t;
+namespace Solid
+{
+class SerialInterface : Solid::DeviceInterface
+{
+%TypeHeaderCode
+#include <serialinterface.h>
+%End
+
+ explicit SerialInterface (QObject* backendObject);
+public:
+ virtual ~SerialInterface ();
+ static Solid::DeviceInterface::Type deviceInterfaceType ();
+ virtual QVariant driverHandle () const;
+ enum SerialType
+ {
+ Unknown,
+ Platform,
+ Usb
+ };
+ virtual Solid::SerialInterface::SerialType serialType () const;
+ virtual int port () const;
+};
+};
diff --git a/sip/typedefs.sip b/sip/solid/smartcardreader.sip
similarity index 60%
copy from sip/typedefs.sip
copy to sip/solid/smartcardreader.sip
index a1d2375..39b0932 100644
--- a/sip/typedefs.sip
+++ b/sip/solid/smartcardreader.sip
@@ -1,5 +1,7 @@
// Copyright 2014 Simon Edwards <simon@simonzone.com>
+// Generated by twine2
+
// This program is free software; you can redistribute it and/or modify
// it under the terms of the GNU Library General Public License as
// published by the Free Software Foundation; either version 2, or
@@ -15,26 +17,26 @@
// Free Software Foundation, Inc.,
// 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
-%Module PyKDE5.typedefs
-
-typedef uint mode_t;
-
-typedef long time_t;
-
-typedef ulong size_t;
-
-typedef int ssize_t;
-
-typedef int pid_t;
-
-typedef ulong Window;
-
-typedef bool Bool;
-
-typedef uint WFlags;
-
-typedef long off_t;
-
-typedef uint uid_t;
-
-typedef uint gid_t;
+namespace Solid
+{
+class SmartCardReader : Solid::DeviceInterface
+{
+%TypeHeaderCode
+#include <smartcardreader.h>
+%End
+
+public:
+ enum ReaderType
+ {
+ UnknownReaderType,
+ CardReader,
+ CryptoToken
+ };
+private:
+ explicit SmartCardReader (QObject* backendObject);
+public:
+ virtual ~SmartCardReader ();
+ static Solid::DeviceInterface::Type deviceInterfaceType ();
+ Solid::SmartCardReader::ReaderType readerType () const;
+};
+};
diff --git a/sip/solid/solidmod.sip b/sip/solid/solidmod.sip
new file mode 100644
index 0000000..1c1a66c
--- /dev/null
+++ b/sip/solid/solidmod.sip
@@ -0,0 +1,58 @@
+// Copyright 2014 Simon Edwards <simon@simonzone.com>
+
+// Generated by twine2
+
+// This program is free software; you can redistribute it and/or modify
+// it under the terms of the GNU Library General Public License as
+// published by the Free Software Foundation; either version 2, or
+// (at your option) any later version.
+
+// This program is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details
+
+// You should have received a copy of the GNU Library General Public
+// License along with this program; if not, write to the
+// Free Software Foundation, Inc.,
+// 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+
+%Module PyKDE5.solid
+
+%ModuleHeaderCode
+#pragma GCC visibility push(default)
+%End
+
+%Import typedefs.sip
+%Import QtCore/QtCoremod.sip
+
+%Include acadapter.sip
+%Include audiointerface.sip
+%Include battery.sip
+%Include block.sip
+%Include button.sip
+%Include camera.sip
+%Include device.sip
+%Include deviceinterface.sip
+%Include devicenotifier.sip
+%Include dvbinterface.sip
+%Include genericinterface.sip
+%Include internetgateway.sip
+%Include keyboard.sip
+%Include networking.sip
+%Include networkinterface.sip
+%Include networkshare.sip
+%Include opticaldisc.sip
+%Include opticaldrive.sip
+%Include pointingdevice.sip
+%Include portablemediaplayer.sip
+%Include powermanagement.sip
+%Include predicate.sip
+%Include processor.sip
+%Include serialinterface.sip
+%Include smartcardreader.sip
+%Include solidnamespace.sip
+%Include storageaccess.sip
+%Include storagedrive.sip
+%Include storagevolume.sip
+%Include video.sip
diff --git a/sip/typedefs.sip b/sip/solid/solidnamespace.sip
similarity index 74%
copy from sip/typedefs.sip
copy to sip/solid/solidnamespace.sip
index a1d2375..0a9d442 100644
--- a/sip/typedefs.sip
+++ b/sip/solid/solidnamespace.sip
@@ -1,5 +1,7 @@
// Copyright 2014 Simon Edwards <simon@simonzone.com>
+// Generated by twine2
+
// This program is free software; you can redistribute it and/or modify
// it under the terms of the GNU Library General Public License as
// published by the Free Software Foundation; either version 2, or
@@ -15,26 +17,20 @@
// Free Software Foundation, Inc.,
// 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
-%Module PyKDE5.typedefs
-
-typedef uint mode_t;
-
-typedef long time_t;
-
-typedef ulong size_t;
-
-typedef int ssize_t;
-
-typedef int pid_t;
-
-typedef ulong Window;
-
-typedef bool Bool;
-
-typedef uint WFlags;
-
-typedef long off_t;
-
-typedef uint uid_t;
-
-typedef uint gid_t;
+%ModuleHeaderCode
+#include <solidnamespace.h>
+%End
+
+namespace Solid
+{
+enum ErrorType
+{
+ NoError,
+ UnauthorizedOperation,
+ DeviceBusy,
+ OperationFailed,
+ UserCanceled,
+ InvalidOption,
+ MissingDriver
+};
+};
diff --git a/sip/solid/storageaccess.sip b/sip/solid/storageaccess.sip
new file mode 100644
index 0000000..9700209
--- /dev/null
+++ b/sip/solid/storageaccess.sip
@@ -0,0 +1,46 @@
+// Copyright 2014 Simon Edwards <simon@simonzone.com>
+
+// Generated by twine2
+
+// This program is free software; you can redistribute it and/or modify
+// it under the terms of the GNU Library General Public License as
+// published by the Free Software Foundation; either version 2, or
+// (at your option) any later version.
+
+// This program is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details
+
+// You should have received a copy of the GNU Library General Public
+// License along with this program; if not, write to the
+// Free Software Foundation, Inc.,
+// 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+
+namespace Solid
+{
+class StorageAccess : Solid::DeviceInterface
+{
+%TypeHeaderCode
+#include <storageaccess.h>
+%End
+
+ explicit StorageAccess (QObject* backendObject);
+public:
+ virtual ~StorageAccess ();
+ static Solid::DeviceInterface::Type deviceInterfaceType ();
+ bool isAccessible () const;
+ QString filePath () const;
+ bool isIgnored () const;
+ bool setup ();
+ bool teardown ();
+signals:
+ void accessibilityChanged (bool accessible, const QString& udi);
+ void setupDone (Solid::ErrorType error, QVariant errorData, const QString& udi);
+ void teardownDone (Solid::ErrorType error, QVariant errorData, const QString& \
udi); + void setupRequested (const QString& udi);
+ void teardownRequested (const QString& udi);
+protected:
+//ig StorageAccess (StorageAccessPrivate& dd, QObject* backendObject);
+};
+};
diff --git a/sip/solid/storagedrive.sip b/sip/solid/storagedrive.sip
new file mode 100644
index 0000000..8c6ac4c
--- /dev/null
+++ b/sip/solid/storagedrive.sip
@@ -0,0 +1,64 @@
+// Copyright 2014 Simon Edwards <simon@simonzone.com>
+
+// Generated by twine2
+
+// This program is free software; you can redistribute it and/or modify
+// it under the terms of the GNU Library General Public License as
+// published by the Free Software Foundation; either version 2, or
+// (at your option) any later version.
+
+// This program is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details
+
+// You should have received a copy of the GNU Library General Public
+// License along with this program; if not, write to the
+// Free Software Foundation, Inc.,
+// 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+
+namespace Solid
+{
+class StorageDrive : Solid::DeviceInterface
+{
+%TypeHeaderCode
+#include <storagedrive.h>
+%End
+
+public:
+ enum Bus
+ {
+ Ide,
+ Usb,
+ Ieee1394,
+ Scsi,
+ Sata,
+ Platform
+ };
+ enum DriveType
+ {
+ HardDisk,
+ CdromDrive,
+ Floppy,
+ Tape,
+ CompactFlash,
+ MemoryStick,
+ SmartMedia,
+ SdMmc,
+ Xd
+ };
+private:
+ explicit StorageDrive (QObject* backendObject);
+public:
+ virtual ~StorageDrive ();
+ static Solid::DeviceInterface::Type deviceInterfaceType ();
+ Solid::StorageDrive::Bus bus () const;
+ Solid::StorageDrive::DriveType driveType () const;
+ bool isRemovable () const;
+ bool isHotpluggable () const;
+ qulonglong size () const;
+ bool isInUse () const;
+protected:
+//ig StorageDrive (StorageDrivePrivate& dd, QObject* backendObject);
+};
+};
diff --git a/sip/solid/storagevolume.sip b/sip/solid/storagevolume.sip
new file mode 100644
index 0000000..385f0c5
--- /dev/null
+++ b/sip/solid/storagevolume.sip
@@ -0,0 +1,53 @@
+// Copyright 2014 Simon Edwards <simon@simonzone.com>
+
+// Generated by twine2
+
+// This program is free software; you can redistribute it and/or modify
+// it under the terms of the GNU Library General Public License as
+// published by the Free Software Foundation; either version 2, or
+// (at your option) any later version.
+
+// This program is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details
+
+// You should have received a copy of the GNU Library General Public
+// License along with this program; if not, write to the
+// Free Software Foundation, Inc.,
+// 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+
+namespace Solid
+{
+class StorageVolume : Solid::DeviceInterface
+{
+%TypeHeaderCode
+#include <storagevolume.h>
+%End
+
+public:
+ enum UsageType
+ {
+ Other,
+ Unused,
+ FileSystem,
+ PartitionTable,
+ Raid,
+ Encrypted
+ };
+private:
+ explicit StorageVolume (QObject* backendObject);
+public:
+ virtual ~StorageVolume ();
+ static Solid::DeviceInterface::Type deviceInterfaceType ();
+ bool isIgnored () const;
+ Solid::StorageVolume::UsageType usage () const;
+ QString fsType () const;
+ QString label () const;
+ QString uuid () const;
+ qulonglong size () const;
+ Solid::Device encryptedContainer () const;
+protected:
+//ig StorageVolume (StorageVolumePrivate& dd, QObject* backendObject);
+};
+};
diff --git a/sip/typedefs.sip b/sip/solid/video.sip
similarity index 60%
copy from sip/typedefs.sip
copy to sip/solid/video.sip
index a1d2375..7abd9b6 100644
--- a/sip/typedefs.sip
+++ b/sip/solid/video.sip
@@ -1,5 +1,7 @@
// Copyright 2014 Simon Edwards <simon@simonzone.com>
+// Generated by twine2
+
// This program is free software; you can redistribute it and/or modify
// it under the terms of the GNU Library General Public License as
// published by the Free Software Foundation; either version 2, or
@@ -15,26 +17,20 @@
// Free Software Foundation, Inc.,
// 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
-%Module PyKDE5.typedefs
-
-typedef uint mode_t;
-
-typedef long time_t;
-
-typedef ulong size_t;
-
-typedef int ssize_t;
-
-typedef int pid_t;
-
-typedef ulong Window;
-
-typedef bool Bool;
-
-typedef uint WFlags;
-
-typedef long off_t;
-
-typedef uint uid_t;
-
-typedef uint gid_t;
+namespace Solid
+{
+class Video : Solid::DeviceInterface
+{
+%TypeHeaderCode
+#include <video.h>
+%End
+
+ explicit Video (QObject* backendObject);
+public:
+ virtual ~Video ();
+ static Solid::DeviceInterface::Type deviceInterfaceType ();
+ QStringList supportedProtocols () const;
+ QStringList supportedDrivers (QString protocol = QString()) const;
+ QVariant driverHandle (const QString& driver) const;
+};
+};
diff --git a/sip/typedefs.sip b/sip/typedefs.sip
index a1d2375..e777e27 100644
--- a/sip/typedefs.sip
+++ b/sip/typedefs.sip
@@ -38,3 +38,118 @@ typedef long off_t;
typedef uint uid_t;
typedef uint gid_t;
+
+template <TYPE1,int>
+%MappedType QMap<TYPE1,int>
+{
+%TypeHeaderCode
+#include <qmap.h>
+%End
+
+%ConvertFromTypeCode
+ // Create the dictionary.
+ PyObject *d = PyDict_New();
+
+ if (!d)
+ return NULL;
+
+ // Set the dictionary elements.
+ QMap<TYPE1, int>::const_iterator i = sipCpp->constBegin();
+
+ while (i != sipCpp->constEnd())
+ {
+ TYPE1 *t1 = new TYPE1(i.key());
+ int t2 = i.value();
+
+ PyObject *t1obj = sipConvertFromNewType(t1, sipType_TYPE1, sipTransferObj);
+#if PY_MAJOR_VERSION >= 3
+ PyObject *t2obj = PyLong_FromLong(t2);
+#else
+ PyObject *t2obj = PyInt_FromLong(t2);
+#endif
+
+ if (t1obj == NULL || t2obj == NULL || PyDict_SetItem(d, t1obj, t2obj) < 0)
+ {
+ Py_DECREF(d);
+
+ if (t1obj) {
+ Py_DECREF(t1obj);
+ } else {
+ delete t1;
+ }
+
+ if (t2obj) {
+ Py_DECREF(t2obj);
+ }
+ return NULL;
+ }
+
+ Py_DECREF(t1obj);
+ Py_DECREF(t2obj);
+
+ ++i;
+ }
+
+ return d;
+%End
+
+%ConvertToTypeCode
+ PyObject *t1obj;
+ PyObject *t2obj;
+ SIP_SSIZE_T i = 0;
+
+ // Check the type if that is all that is required.
+ if (sipIsErr == NULL)
+ {
+ if (!PyDict_Check(sipPy))
+ return 0;
+
+ while (PyDict_Next(sipPy, &i, &t1obj, &t2obj))
+ {
+ if (!sipCanConvertToType(t1obj, sipType_TYPE1, SIP_NOT_NONE))
+ return 0;
+
+#if PY_MAJOR_VERSION >= 3
+ if (!PyNumber_Check(t2obj))
+#else
+ if (!PyInt_Check(t2obj))
+#endif
+ return 0;
+ }
+
+ return 1;
+ }
+
+ QMap<TYPE1, int> *qm = new QMap<TYPE1, int>;
+
+ i = 0;
+ while (PyDict_Next(sipPy, &i, &t1obj, &t2obj))
+ {
+ int state1;
+
+ TYPE1 *t1 = reinterpret_cast<TYPE1 *>(sipConvertToType(t1obj, sipType_TYPE1, sipTransferObj, \
SIP_NOT_NONE, &state1, sipIsErr)); +
+#if PY_MAJOR_VERSION >= 3
+ int t2 = PyLong_AsLong (t2obj);
+#else
+ int t2 = PyInt_AS_LONG (t2obj);
+#endif
+
+ if (*sipIsErr)
+ {
+ sipReleaseType(t1, sipType_TYPE1, state1);
+
+ delete qm;
+ return 0;
+ }
+
+ qm->insert(*t1, t2);
+
+ sipReleaseType(t1, sipType_TYPE1, state1);
+ }
+
+ *sipCppPtr = qm;
+
+ return sipGetState(sipTransferObj);
+%End
+};
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic