summaryrefslogtreecommitdiff
path: root/noncore/styles/liquid/plugin.cpp
Side-by-side diff
Diffstat (limited to 'noncore/styles/liquid/plugin.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/styles/liquid/plugin.cpp108
1 files changed, 95 insertions, 13 deletions
diff --git a/noncore/styles/liquid/plugin.cpp b/noncore/styles/liquid/plugin.cpp
index d9aa8ef..f149c29 100644
--- a/noncore/styles/liquid/plugin.cpp
+++ b/noncore/styles/liquid/plugin.cpp
@@ -1,29 +1,111 @@
#include "liquid.h"
+#include "liquidset.h"
+#include "plugin.h"
-extern "C" {
- QStyle* allocate ( );
- int minor_version ( );
- int major_version ( );
- const char *description ( );
+
+LiquidInterface::LiquidInterface ( ) : ref ( 0 )
+{
+}
+
+LiquidInterface::~LiquidInterface ( )
+{
+}
+
+QStyle *LiquidInterface::create ( )
+{
+ return new LiquidStyle ( );
+}
+
+QString LiquidInterface::name ( )
+{
+ return QObject::tr( "Liquid", "name" );
+}
+
+QString LiquidInterface::description ( )
+{
+ return QObject::tr( "High Performance Liquid style by Mosfet", "description" );
+}
+
+QCString LiquidInterface::key ( )
+{
+ return QCString ( "liquid" );
+}
+
+unsigned int LiquidInterface::version ( )
+{
+ return 100; // 1.0.0 (\d+.\d.\d)
+}
+
+QRESULT LiquidInterface::queryInterface ( const QUuid &uuid, QUnknownInterface **iface )
+{
+ static LiquidSettingsInterface *setiface = 0;
+
+ *iface = 0;
+
+ if ( uuid == IID_QUnknown )
+ *iface = this;
+ else if ( uuid == IID_Style )
+ *iface = this;
+ else if ( uuid == IID_StyleSettings ) {
+ if ( !setiface )
+ setiface = new LiquidSettingsInterface ( );
+ *iface = setiface;
+ }
+
+ if ( *iface )
+ (*iface)-> addRef ( );
+
+ return QS_OK;
+}
+
+Q_EXPORT_INTERFACE()
+{
+ Q_CREATE_INSTANCE( LiquidInterface )
}
-QStyle* allocate ( )
+
+LiquidSettingsInterface::LiquidSettingsInterface ( ) : ref ( 0 )
+{
+ m_widget = 0;
+}
+
+LiquidSettingsInterface::~LiquidSettingsInterface ( )
{
- return new LiquidStyle ( );
+}
+
+QWidget *LiquidSettingsInterface::create ( QWidget *parent, const char *name )
+{
+ m_widget = new LiquidSettings ( parent, name ? name : "LIQUID-SETTINGS" );
+
+ return m_widget;
}
-int minor_version ( )
+bool LiquidSettingsInterface::accept ( )
{
- return 0;
+ if ( !m_widget )
+ return false;
+
+ return m_widget-> writeConfig ( );
}
-int major_version ( )
+void LiquidSettingsInterface::reject ( )
{
- return 1;
}
-const char *description ( )
+QRESULT LiquidSettingsInterface::queryInterface ( const QUuid &uuid, QUnknownInterface **iface )
{
- return "High Performance Liquid";
+ *iface = 0;
+
+
+ if ( uuid == IID_QUnknown )
+ *iface = this;
+ else if ( uuid == IID_StyleSettings )
+ *iface = this;
+
+ if ( *iface )
+ (*iface)-> addRef ( );
+
+ return QS_OK;
}
+