summaryrefslogtreecommitdiff
path: root/noncore/styles/liquid/plugin.cpp
Unidiff
Diffstat (limited to 'noncore/styles/liquid/plugin.cpp') (more/less context) (show whitespace changes)
-rw-r--r--noncore/styles/liquid/plugin.cpp106
1 files changed, 94 insertions, 12 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 @@
1#include "liquid.h" 1#include "liquid.h"
2#include "liquidset.h"
3#include "plugin.h"
2 4
3 5
4extern "C" { 6
5 QStyle* allocate ( ); 7LiquidInterface::LiquidInterface ( ) : ref ( 0 )
6 int minor_version ( ); 8{
7 int major_version ( ); 9}
8 const char *description ( ); 10
11LiquidInterface::~LiquidInterface ( )
12{
9} 13}
10 14
11QStyle* allocate ( ) 15QStyle *LiquidInterface::create ( )
12{ 16{
13 return new LiquidStyle ( ); 17 return new LiquidStyle ( );
14} 18}
15 19
16int minor_version ( ) 20QString LiquidInterface::name ( )
21{
22 return QObject::tr( "Liquid", "name" );
23}
24
25QString LiquidInterface::description ( )
26{
27 return QObject::tr( "High Performance Liquid style by Mosfet", "description" );
28}
29
30QCString LiquidInterface::key ( )
17{ 31{
18 return 0; 32 return QCString ( "liquid" );
19} 33}
20 34
21int major_version ( ) 35unsigned int LiquidInterface::version ( )
22{ 36{
23 return 1; 37 return 100; // 1.0.0 (\d+.\d.\d)
24} 38}
25 39
26const char *description ( ) 40QRESULT LiquidInterface::queryInterface ( const QUuid &uuid, QUnknownInterface **iface )
41{
42 static LiquidSettingsInterface *setiface = 0;
43
44 *iface = 0;
45
46 if ( uuid == IID_QUnknown )
47 *iface = this;
48 else if ( uuid == IID_Style )
49 *iface = this;
50 else if ( uuid == IID_StyleSettings ) {
51 if ( !setiface )
52 setiface = new LiquidSettingsInterface ( );
53 *iface = setiface;
54 }
55
56 if ( *iface )
57 (*iface)-> addRef ( );
58
59 return QS_OK;
60}
61
62Q_EXPORT_INTERFACE()
63{
64 Q_CREATE_INSTANCE( LiquidInterface )
65}
66
67
68LiquidSettingsInterface::LiquidSettingsInterface ( ) : ref ( 0 )
27{ 69{
28 return "High Performance Liquid"; 70 m_widget = 0;
29} 71}
72
73LiquidSettingsInterface::~LiquidSettingsInterface ( )
74{
75}
76
77QWidget *LiquidSettingsInterface::create ( QWidget *parent, const char *name )
78{
79 m_widget = new LiquidSettings ( parent, name ? name : "LIQUID-SETTINGS" );
80
81 return m_widget;
82}
83
84bool LiquidSettingsInterface::accept ( )
85{
86 if ( !m_widget )
87 return false;
88
89 return m_widget-> writeConfig ( );
90}
91
92void LiquidSettingsInterface::reject ( )
93{
94}
95
96QRESULT LiquidSettingsInterface::queryInterface ( const QUuid &uuid, QUnknownInterface **iface )
97{
98 *iface = 0;
99
100
101 if ( uuid == IID_QUnknown )
102 *iface = this;
103 else if ( uuid == IID_StyleSettings )
104 *iface = this;
105
106 if ( *iface )
107 (*iface)-> addRef ( );
108
109 return QS_OK;
110}
111