|
|
@ -42,14 +42,27 @@
|
|
|
|
*/
|
|
|
|
*/
|
|
|
|
#define DBUS_HWCTRL_SERVICE_PATH "/org/trinitydesktop/hardwarecontrol"
|
|
|
|
#define DBUS_HWCTRL_SERVICE_PATH "/org/trinitydesktop/hardwarecontrol"
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
#define REGISTER_PORTAL(klass) \
|
|
|
|
|
|
|
|
m_interfaces.insert(klass::interface(), new klass(m_connection));
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
#define DESTROY_PORTAL(klass) \
|
|
|
|
|
|
|
|
delete m_interfaces[klass::interface()];
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
#define ADDCHILD(x) addChildNode(TQString(x));
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
#define REGISTER_OBJECT(x) registerObject(m_connection,TQString(x));
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
#define ADDNODE(x,y) \
|
|
|
|
|
|
|
|
ADDCHILD(x) \
|
|
|
|
|
|
|
|
REGISTER_OBJECT(y)
|
|
|
|
|
|
|
|
|
|
|
|
/*
|
|
|
|
/*
|
|
|
|
* Root Node
|
|
|
|
* Root Node
|
|
|
|
*/
|
|
|
|
*/
|
|
|
|
RootNodeService::RootNodeService(TQT_DBusConnection &connection )
|
|
|
|
RootNodeService::RootNodeService(TQT_DBusConnection &connection )
|
|
|
|
: DBusBaseNode(), m_connection(connection)
|
|
|
|
: DBusBaseNode(), m_connection(connection)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
addChildNode(TQString("org"));
|
|
|
|
ADDNODE("org","/")
|
|
|
|
registerObject(m_connection,TQString("/"));
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
RootNodeService::~RootNodeService(){
|
|
|
|
RootNodeService::~RootNodeService(){
|
|
|
@ -66,8 +79,7 @@ TQT_DBusObjectBase* RootNodeService::createInterface(const TQString& interfaceNa
|
|
|
|
OrgNodeService::OrgNodeService(TQT_DBusConnection &connection )
|
|
|
|
OrgNodeService::OrgNodeService(TQT_DBusConnection &connection )
|
|
|
|
: DBusBaseNode(), m_connection(connection)
|
|
|
|
: DBusBaseNode(), m_connection(connection)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
addChildNode(TQString("trinitydesktop"));
|
|
|
|
ADDNODE("trinitydesktop","/org")
|
|
|
|
registerObject(m_connection,TQString("/org"));
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
OrgNodeService::~OrgNodeService(){
|
|
|
|
OrgNodeService::~OrgNodeService(){
|
|
|
@ -84,11 +96,15 @@ TQT_DBusObjectBase* OrgNodeService::createInterface(const TQString& interfaceNam
|
|
|
|
TrinityDesktopNodeService::TrinityDesktopNodeService(TQT_DBusConnection &connection )
|
|
|
|
TrinityDesktopNodeService::TrinityDesktopNodeService(TQT_DBusConnection &connection )
|
|
|
|
: DBusBaseNode(), m_connection(connection)
|
|
|
|
: DBusBaseNode(), m_connection(connection)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
addChildNode(TQString("hardwarecontrol"));
|
|
|
|
ADDNODE("hardwarecontrol","/org/trinitydesktop")
|
|
|
|
registerObject(m_connection,TQString("/org/trinitydesktop"));
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
TrinityDesktopNodeService::~TrinityDesktopNodeService(){
|
|
|
|
TrinityDesktopNodeService::~TrinityDesktopNodeService(){
|
|
|
|
|
|
|
|
DESTROY_PORTAL(PropertiesService);
|
|
|
|
|
|
|
|
DESTROY_PORTAL(BrightnessService);
|
|
|
|
|
|
|
|
DESTROY_PORTAL(CPUGovernorService);
|
|
|
|
|
|
|
|
DESTROY_PORTAL(InputEventsService);
|
|
|
|
|
|
|
|
DESTROY_PORTAL(PowerService);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
TQT_DBusObjectBase* TrinityDesktopNodeService::createInterface(const TQString& interfaceName)
|
|
|
|
TQT_DBusObjectBase* TrinityDesktopNodeService::createInterface(const TQString& interfaceName)
|
|
|
@ -104,12 +120,12 @@ HardwareControlNodeService::HardwareControlNodeService(TQT_DBusConnection &conn)
|
|
|
|
m_connection(conn)
|
|
|
|
m_connection(conn)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
m_interfaces.insert("org.freedesktop.DBus.Introspectable", this);
|
|
|
|
m_interfaces.insert("org.freedesktop.DBus.Introspectable", this);
|
|
|
|
m_interfaces.insert("org.freedesktop.DBus.Properties", new PropertiesService(m_connection));
|
|
|
|
REGISTER_PORTAL(PropertiesService);
|
|
|
|
m_interfaces.insert("org.trinitydesktop.hardwarecontrol.Brightness", new BrightnessService(m_connection));
|
|
|
|
REGISTER_PORTAL(BrightnessService);
|
|
|
|
m_interfaces.insert("org.trinitydesktop.hardwarecontrol.CPUGovernor", new CPUGovernorService(m_connection));
|
|
|
|
REGISTER_PORTAL(CPUGovernorService);
|
|
|
|
m_interfaces.insert("org.trinitydesktop.hardwarecontrol.InputEvents", new InputEventsService(m_connection));
|
|
|
|
REGISTER_PORTAL(InputEventsService);
|
|
|
|
m_interfaces.insert("org.trinitydesktop.hardwarecontrol.Power", new PowerService(m_connection));
|
|
|
|
REGISTER_PORTAL(PowerService);
|
|
|
|
registerObject(m_connection,TQString(DBUS_HWCTRL_SERVICE_PATH));
|
|
|
|
REGISTER_OBJECT(DBUS_HWCTRL_SERVICE_PATH)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
HardwareControlNodeService::~HardwareControlNodeService(){
|
|
|
|
HardwareControlNodeService::~HardwareControlNodeService(){
|
|
|
|