author | sandman <sandman> | 2002-10-24 01:21:24 (UTC) |
---|---|---|
committer | sandman <sandman> | 2002-10-24 01:21:24 (UTC) |
commit | f09549e37fee6decd56168043209e8051b8757fb (patch) (side-by-side diff) | |
tree | cfcfc40bfca40df380489829ab5b88cff91d1fee | |
parent | 36e13db0a1d44abd5a160a34e4679b90d62826c7 (diff) | |
download | opie-f09549e37fee6decd56168043209e8051b8757fb.zip opie-f09549e37fee6decd56168043209e8051b8757fb.tar.gz opie-f09549e37fee6decd56168043209e8051b8757fb.tar.bz2 |
- "what's this" widget drop shadows are drawn correctly now
- updated the QPL diff
-rw-r--r-- | noncore/styles/liquid/liquid.cpp | 8 | ||||
-rw-r--r-- | noncore/styles/liquid/opie-liquid.diff | 389 |
2 files changed, 237 insertions, 160 deletions
diff --git a/noncore/styles/liquid/liquid.cpp b/noncore/styles/liquid/liquid.cpp index eb1ec6e..6812d16 100644 --- a/noncore/styles/liquid/liquid.cpp +++ b/noncore/styles/liquid/liquid.cpp @@ -844,5 +844,7 @@ void LiquidStyle::polish(QWidget *w) if(w->inherits("QPopupMenu")) w->setBackgroundMode(QWidget::NoBackground); - else if(w-> testWFlags(Qt::WType_Popup) && !w->inherits("QListBox")) { + else if(w-> testWFlags(Qt::WType_Popup) && + !w->inherits("QListBox") && + ( qstrcmp ( w-> name(), "automatic what's this? widget" ) != 0 )) { w->installEventFilter(menuHandler); } @@ -945,5 +947,7 @@ void LiquidStyle::unPolish(QWidget *w) if(w->inherits("QPopupMenu")) w->setBackgroundMode(QWidget::PaletteButton); - else if(w-> testWFlags(Qt::WType_Popup) && !w->inherits("QListBox")) { + else if(w-> testWFlags(Qt::WType_Popup) && + !w->inherits("QListBox") && + ( qstrcmp ( w-> name(), "automatic what's this? widget" ) != 0 )) { w->removeEventFilter(menuHandler); } diff --git a/noncore/styles/liquid/opie-liquid.diff b/noncore/styles/liquid/opie-liquid.diff index 90ece90..f3531e5 100644 --- a/noncore/styles/liquid/opie-liquid.diff +++ b/noncore/styles/liquid/opie-liquid.diff @@ -4,6 +4,6 @@ Features: - works with Qt/E on QPE/OPIE ---- - Sat Sep 21 05:31:47 2002 -+++ liquid.h Mon Jul 15 02:52:50 2002 +--- - 2002-10-24 03:19:30.000000000 +0200 ++++ liquid.h 2002-07-15 02:52:50.000000000 +0200 @@ -2,7 +2,7 @@ #define LIQUID_STYLE_H @@ -111,6 +111,6 @@ Features: QColorGroup radioOnGrp; QWidget *highlightWidget; ---- - Sat Sep 21 05:31:48 2002 -+++ liquid.cpp Sat Sep 21 05:18:54 2002 +--- - 2002-10-24 03:19:31.000000000 +0200 ++++ liquid.cpp 2002-10-24 03:18:15.000000000 +0200 @@ -10,12 +10,10 @@ @@ -123,5 +123,5 @@ Features: -#include <kglobalsettings.h> -#include <kpixmapeffect.h> -+#include "liquiddeco.h" ++//#include "liquiddeco.h" +#include <qapplication.h> +#include <qpe/config.h> @@ -147,8 +147,8 @@ Features: -#include <kipc.h> +#include <qmenubar.h> ++#include <qprogressbar.h> -#include <X11/X.h> -#include <X11/Xlib.h> -+ +#include <stdio.h> @@ -230,5 +230,5 @@ Features: } else{ // tear off menu -@@ -121,82 +122,55 @@ +@@ -121,82 +122,53 @@ stripePixmap(*pix, p->colorGroup().button()); } @@ -240,16 +240,15 @@ Features: pixDict.insert(p->winId(), pix); + -+ if (!p->inherits("QPopupMenu")) { ++ if ( !p->inherits("QPopupMenu")) + p->setBackgroundPixmap(*pix); + -+ QObjectList *ol = p-> queryList("QWidget"); -+ for ( QObjectListIt it( *ol ); it. current ( ); ++it ) { -+ QWidget *wid = (QWidget *) it.current ( ); ++ QObjectList *ol = p-> queryList("QWidget"); ++ for ( QObjectListIt it( *ol ); it. current ( ); ++it ) { ++ QWidget *wid = (QWidget *) it.current ( ); + -+ wid-> setBackgroundPixmap(*pix); -+ wid-> setBackgroundOrigin(QWidget::ParentOrigin); -+ } -+ delete ol; -+ } ++ wid-> setBackgroundPixmap(*pix); ++ wid-> setBackgroundOrigin(QWidget::ParentOrigin); ++ } ++ delete ol; } } @@ -286,11 +285,11 @@ Features: - } + pixDict.remove(p->winId()); -+ if (!p->inherits("QPopupMenu")) { ++ if ( !p->inherits("QPopupMenu")) + p->setBackgroundMode(QWidget::PaletteBackground); - reloadSettings(); -+ QObjectList *ol = p-> queryList("QWidget"); -+ for ( QObjectListIt it( *ol ); it. current ( ); ++it ) { -+ QWidget *wid = (QWidget *) it.current ( ); ++ QObjectList *ol = p-> queryList("QWidget"); ++ for ( QObjectListIt it( *ol ); it. current ( ); ++it ) { ++ QWidget *wid = (QWidget *) it.current ( ); - // Now repaint menubar if needed @@ -301,7 +300,8 @@ Features: - if(w->inherits("QMenuBar")){ - w->repaint(); -- } -- } -+ wid-> setBackgroundMode( QWidget::PaletteBackground ); ++ wid-> setBackgroundMode( QWidget::PaletteBackground ); + } ++ delete ol; + } } - } @@ -324,9 +324,8 @@ Features: - if(w->inherits("QPushButton")){ - ((LiquidStyle*)parent())->applyCustomAttributes((QPushButton *)w); -+ delete ol; - } - } +- } +- } - - } +- } + return(false); } @@ -344,5 +343,5 @@ Features: btnMaskBmp.setMask(btnMaskBmp); htmlBtnMaskBmp = QBitmap(37, 26, htmlbuttonmask_bits, true); -@@ -711,7 +685,6 @@ +@@ -711,7 +683,6 @@ void LiquidStyle::polish(QPalette &appPal) @@ -352,5 +351,5 @@ Features: for(i=0; i < BITMAP_ITEMS; ++i){ if(pixmaps[i]){ -@@ -730,20 +703,29 @@ +@@ -730,20 +701,29 @@ } @@ -389,5 +388,5 @@ Features: QBrush btnBrush(QColor(200, 202, 228)); appPal.setBrush(QColorGroup::Button, btnBrush); -@@ -794,15 +776,7 @@ +@@ -794,15 +774,7 @@ pagerBrush.setPixmap(*pix); @@ -406,5 +405,5 @@ Features: c.light(120).hsv(&bHoverH, &bHoverS, &bHoverV); -@@ -817,21 +791,18 @@ +@@ -817,21 +789,18 @@ wallPaper.fill(c.rgb()); painter.begin(&wallPaper); @@ -431,5 +430,5 @@ Features: basePix.resize(32, 32); basePix.fill(c.rgb()); -@@ -856,52 +827,39 @@ +@@ -856,52 +825,37 @@ applyCustomAttributes((QPushButton *)w); } @@ -457,5 +456,7 @@ Features: if(w->inherits("QPopupMenu")) w->setBackgroundMode(QWidget::NoBackground); -+ else if(w-> testWFlags(Qt::WType_Popup) && !w->inherits("QListBox")) { ++ else if(w-> testWFlags(Qt::WType_Popup) && ++ !w->inherits("QListBox") && ++ ( qstrcmp ( w-> name(), "automatic what's this? widget" ) != 0 )) { + w->installEventFilter(menuHandler); + } @@ -487,10 +488,7 @@ Features: - w->setPalette(kapp->palette()); - } -+ -+ -+ if ( !w-> inherits("QFrame") || (((QFrame*) w)-> frameShape () == QFrame::NoFrame )) -+ w-> setBackgroundOrigin ( QWidget::ParentOrigin ); - if(w->inherits("QComboBox") || +- if(w->inherits("QComboBox") || ++ if(w->inherits("QComboBox") || w->inherits("QProgressBar") || w->inherits("QLineEdit") || w->inherits("QRadioButton") || - w->inherits("QCheckBox") || w->inherits("QScrollBar") || @@ -501,5 +499,5 @@ Features: } if(w->inherits("QLineEdit")){ -@@ -913,6 +871,9 @@ +@@ -913,6 +867,10 @@ applyCustomAttributes((QPushButton *)w); w->installEventFilter(this); @@ -507,9 +505,10 @@ Features: + if(w->inherits("QButton") || w-> inherits("QComboBox")){ + w-> setBackgroundMode ( QWidget::PaletteBackground ); ++ w->setBackgroundOrigin ( QWidget::ParentOrigin); + } bool isViewport = qstrcmp(w->name(), "qt_viewport") == 0 || qstrcmp(w->name(), "qt_clipped_viewport") == 0; -@@ -942,11 +903,14 @@ +@@ -942,11 +900,17 @@ w->setMouseTracking(true); w->installEventFilter(this); @@ -520,4 +519,7 @@ Features: + w->setBackgroundOrigin(QWidget::ParentOrigin); + } ++ if(w-> inherits("QToolBarSeparator")&&w->parent()->inherits("QToolBar")) { ++ ((QFrame *) w)-> setFrameShape ( QFrame::NoFrame ); ++ } if(w->ownPalette() && !w->inherits("QButton") && !w->inherits("QComboBox")){ return; @@ -528,5 +530,5 @@ Features: if(w->parent() && w->parent()->isWidgetType() && !((QWidget*)w->parent())-> palette().active().brush(QColorGroup::Background).pixmap()){ -@@ -954,17 +918,13 @@ +@@ -954,16 +918,21 @@ return; } @@ -536,5 +538,8 @@ Features: if(w->backgroundMode() == QWidget::PaletteBackground || w->backgroundMode() == QWidget::PaletteButton){ - w->setBackgroundMode(QWidget::X11ParentRelative); +- w->setBackgroundMode(QWidget::X11ParentRelative); ++ w->setBackgroundMode(w->parentWidget()->backgroundMode( )/*QWidget::X11ParentRelative*/); ++ w->setBackgroundOrigin(QWidget::ParentOrigin); ++// w->setBackgroundMode(QWidget::NoBackground); } } @@ -543,14 +548,21 @@ Features: - //w->setBackgroundMode(QWidget::NoBackground); - return; -- } ++ if ( !w-> inherits("QFrame") || (((QFrame*) w)-> frameShape () == QFrame::NoFrame )) ++ w-> setBackgroundOrigin ( QWidget::ParentOrigin ); ++ else if ( w-> inherits("QFrame") ) ++ w->setBackgroundOrigin ( QWidget::WidgetOrigin ); + ++ if ( w->parentWidget()->inherits ( "QWidgetStack" )) { ++ w->setBackgroundOrigin ( QWidget::WidgetOrigin ); + } } - void LiquidStyle::unPolish(QWidget *w) -@@ -977,6 +937,9 @@ +@@ -977,6 +946,11 @@ if(w->inherits("QPopupMenu")) w->setBackgroundMode(QWidget::PaletteButton); -+ else if(w-> testWFlags(Qt::WType_Popup) && !w->inherits("QListBox")) { ++ else if(w-> testWFlags(Qt::WType_Popup) && ++ !w->inherits("QListBox") && ++ ( qstrcmp ( w-> name(), "automatic what's this? widget" ) != 0 )) { + w->removeEventFilter(menuHandler); + } @@ -558,5 +570,5 @@ Features: if(w->isTopLevel()) return; -@@ -986,7 +949,7 @@ +@@ -986,7 +960,7 @@ ((qstrcmp(w->parent()->name(), "qt_viewport") == 0) || (qstrcmp(w->parent()->name(), "qt_clipped_viewport") == 0)); @@ -567,5 +579,5 @@ Features: if(w->inherits("QPushButton")) w->setBackgroundMode(QWidget::PaletteButton); -@@ -1001,12 +964,14 @@ +@@ -1001,12 +975,14 @@ unapplyCustomAttributes((QPushButton *)w); w->removeEventFilter(this); @@ -586,5 +598,5 @@ Features: } if(w->inherits("QButton") || w->inherits("QComboBox")){ -@@ -1014,9 +979,9 @@ +@@ -1014,9 +990,9 @@ w->setAutoMask(false); } @@ -598,5 +610,5 @@ Features: } if(w->inherits("QHeader")){ -@@ -1028,20 +993,34 @@ +@@ -1028,22 +1004,98 @@ void LiquidStyle::polish(QApplication *app) { @@ -634,6 +646,70 @@ Features: } ++ ++/* !! HACK !! Beware ++ * ++ * TT forgot to make the QProgressBar widget styleable in Qt 2.x ++ * So the only way to customize the drawing, is to intercept the ++ * paint event - since we have to use protected functions, we need ++ * to derive a "hack" class from QProgressBar and do the painting ++ * in there. ++ * ++ * - sandman ++ */ ++ ++class HackProgressBar : public QProgressBar { ++public: ++ HackProgressBar ( ); ++ ++ void paint ( QPaintEvent *event, const QColorGroup &g, QPixmap *pix ) ++ { ++ QPainter p( this ); ++ ++ if ( !contentsRect().contains( event->rect() ) ) { ++ p.save(); ++ p.setClipRegion( event->region().intersect(frameRect()) ); ++ drawFrame( &p); ++ p.restore(); ++ } ++ if ( event->rect().intersects( contentsRect() )) { ++ p.setClipRegion( event->region().intersect( contentsRect() ) ); ++ ++ int x, y, w, h; ++ contentsRect ( ). rect ( &x, &y, &w, &h ); ++ ++ int prog = progress ( ); ++ int total = totalSteps ( ); ++ if ( prog < 0 ) ++ prog = 0; ++ if ( total <= 0 ) ++ total = 1; ++ int bw = w * prog / total; ++ if ( bw > w ) ++ bw = w; ++ ++ p.setPen(g.button().dark(130)); ++ p.drawRect(x, y, bw, h); ++ p.setPen(g.button().light(120)); ++ p.drawRect(x+1, y+1, bw-2, h-2); ++ ++ if(bw >= 4 && h >= 4 && pix) ++ p.drawTiledPixmap(x+2, y+2, bw-4, h-4, *pix); ++ ++ if ( progress ( )>= 0 && totalSteps ( ) > 0 ) { ++ QString pstr; ++ pstr. sprintf ( "%d%%", 100 * progress()/totalSteps ()); ++ p. setPen ( g.text());//g.highlightedText ( )); ++ p. drawText (x,y,w-1,h-1,AlignCenter,pstr); ++ } ++ } ++ } ++}; ++ ++ ++ /* -@@ -1063,7 +1042,7 @@ + * This is a fun method ;-) Here's an overview. KToolBar grabs resize to + * force everything to erase and repaint on resize. This is going away, I'm +@@ -1063,7 +1115,7 @@ */ bool LiquidStyle::eventFilter(QObject *obj, QEvent *ev) @@ -644,5 +720,5 @@ Features: const QObjectList *tbChildList = obj->children(); QObjectListIt it(*tbChildList); -@@ -1076,35 +1055,7 @@ +@@ -1076,35 +1128,7 @@ } @@ -681,5 +757,5 @@ Features: if(ev->type() == QEvent::Enter){ if(btn->isEnabled()){ -@@ -1119,20 +1070,7 @@ +@@ -1119,20 +1143,7 @@ } } @@ -703,5 +779,31 @@ Features: if(!btn->autoRaise()){ if(btn->isEnabled()){ -@@ -1340,11 +1278,6 @@ +@@ -1290,7 +1301,24 @@ + } + } + } +- return(false); ++ else if (obj-> inherits( "QProgressBar" )) { ++ if ( ev->type() == QEvent::Paint ) { ++ HackProgressBar *p = (HackProgressBar *) obj; ++ const QColorGroup &g = p-> colorGroup ( ); ++ ++ QPixmap *pix = bevelFillDict.find(g.button().dark(120).rgb()); ++ if(!pix){ ++ int h, s, v; ++ g.button().dark(120).hsv(&h, &s, &v); ++ pix = new QPixmap(*bevelFillPix); ++ adjustHSV(*pix, h, s, v); ++ bevelFillDict.insert(g.button().dark(120).rgb(), pix); ++ } ++ p-> paint ((QPaintEvent *) ev, g, pix ); ++ return true; ++ } ++ } ++ return false ; + } + + void LiquidStyle::drawButton(QPainter *p, int x, int y, int w, int h, +@@ -1340,11 +1368,6 @@ QColorGroup g = btn->colorGroup(); @@ -715,5 +817,5 @@ Features: if(btn->hasFocus() || btn->isDefault()){ QColor c = btn->hasFocus() ? g.button().light(110) : g.background(); -@@ -1596,7 +1529,7 @@ +@@ -1596,7 +1619,7 @@ if(sbBuffer.size() != sb->size()) sbBuffer.resize(sb->size()); @@ -724,5 +826,5 @@ Features: if(horiz) subHC.setRect(addX-buttonDim,addY,buttonDim,buttonDim ); -@@ -1624,7 +1557,7 @@ +@@ -1624,7 +1647,7 @@ QPainter painter; if(!horiz){ @@ -733,5 +835,5 @@ Features: painter.drawPixmap(bgR.x()+1, bgR.y(), *vsbSliderFillPix, 0, 0, 13, 8); -@@ -1690,7 +1623,7 @@ +@@ -1690,7 +1713,7 @@ } else{ @@ -742,5 +844,5 @@ Features: painter.drawPixmap(bgR.x(), bgR.y()+1, *vsbSliderFillPix, 0, 0, 8, 13); -@@ -1761,10 +1694,10 @@ +@@ -1761,10 +1784,10 @@ addB.width()-8, addB.height()-8, g, !maxed); } @@ -757,5 +859,5 @@ Features: drawArrow( p, horiz ? LeftArrow : UpArrow, false, subHC.x()+4, subHC.y()+4, -@@ -1865,8 +1798,8 @@ +@@ -1865,8 +1888,8 @@ else buttonDim = ( length - b*2 )/2 - 1; @@ -768,5 +870,5 @@ Features: if ( sb->maxValue() == sb->minValue() ) { sliderLength = maxLength; -@@ -1914,8 +1847,8 @@ +@@ -1914,8 +1937,8 @@ return(QSize(16, 16)); } @@ -779,5 +881,5 @@ Features: { bool isHover = highlightWidget == p->device(); -@@ -1957,8 +1890,8 @@ +@@ -1957,8 +1980,8 @@ return(QSize(20, 22)); } @@ -790,5 +892,5 @@ Features: bool isHover = highlightWidget == p->device(); bool isMasked = p->device() && p->device()->devType() == QInternal::Widget -@@ -1996,8 +1929,8 @@ +@@ -1996,8 +2019,8 @@ } } @@ -801,5 +903,5 @@ Features: // needed for some reason by KHtml, even tho it's all filled ;P p->drawPixmap(x, y, *getPixmap(HTMLCB)->mask()); -@@ -2005,18 +1938,17 @@ +@@ -2005,18 +2028,17 @@ } @@ -823,5 +925,5 @@ Features: { p->drawPixmap(x, y, orient == Qt::Horizontal ? *getPixmap(HSlider)->mask() : -@@ -2065,203 +1997,26 @@ +@@ -2065,203 +2087,26 @@ p->drawLineSegments(a); } @@ -845,5 +947,5 @@ Features: - p->drawPoint(x2, y2); - -- + - - // p->drawRect(x, y, w, h); @@ -862,5 +964,7 @@ Features: -void LiquidStyle::drawKMenuBar(QPainter *p, int x, int y, int w, int h, - const QColorGroup &g, bool mac, QBrush *) --{ ++void LiquidStyle::drawMenuBarItem(QPainter *p, int x, int y, int w, int h, ++ QMenuItem *mi, QColorGroup &g, bool /*enabled*/, bool active ) + { - if(p->device() && p->device()->devType() == QInternal::Widget && - ((KMenuBar *)p->device())->isTopLevelMenu()){ @@ -886,10 +990,8 @@ Features: - -} - +- -void LiquidStyle::drawKToolBar(QPainter *p, int x, int y, int w, int h, - const QColorGroup &g, KToolBarPos, QBrush *) -+void LiquidStyle::drawMenuBarItem(QPainter *p, int x, int y, int w, int h, -+ QMenuItem *mi, QColorGroup &g, bool /*enabled*/, bool active ) - { +-{ - //p->fillRect(x, y, w, h, g.brush(QColorGroup::Background)); -} @@ -1039,5 +1141,5 @@ Features: } else -@@ -2300,8 +2055,8 @@ +@@ -2300,8 +2145,8 @@ } @@ -1050,5 +1152,5 @@ Features: QColor c; switch(menuHandler->transType()){ -@@ -2336,8 +2091,6 @@ +@@ -2336,8 +2181,6 @@ maxpmw = QMAX( maxpmw, 20 ); @@ -1059,5 +1161,5 @@ Features: bool dis = !enabled; QColorGroup itemg = dis ? pal.disabled() : pal.active(); -@@ -2363,7 +2116,7 @@ +@@ -2363,7 +2206,7 @@ p->fillRect(x, y, w, h, menuBrush); } @@ -1068,5 +1170,5 @@ Features: p->drawPixmap(x, y, *pix, x, y, w, h); } -@@ -2508,25 +2261,6 @@ +@@ -2508,25 +2351,6 @@ return h; } @@ -1094,5 +1196,5 @@ Features: void LiquidStyle::drawFocusRect(QPainter *p, const QRect &r, const QColorGroup &g, const QColor *c, -@@ -2540,25 +2274,25 @@ +@@ -2540,25 +2364,25 @@ return; } @@ -1124,5 +1226,5 @@ Features: } QPixmap tilePix; -@@ -2671,7 +2405,7 @@ +@@ -2671,7 +2495,7 @@ vFrame = 8; // was 10 } @@ -1133,5 +1235,5 @@ Features: -@@ -2699,7 +2433,7 @@ +@@ -2699,7 +2523,7 @@ p->drawLine(x+1, y+1, x+1, y2-1); } @@ -1142,5 +1244,5 @@ Features: QPen oldPen = p->pen(); int x2 = x+w-1; -@@ -2726,105 +2460,6 @@ +@@ -2726,105 +2550,6 @@ } } @@ -1248,5 +1350,5 @@ Features: void LiquidStyle::adjustHSV(QPixmap &pix, int h, int s, int v) { -@@ -2998,22 +2633,22 @@ +@@ -2998,22 +2723,22 @@ customBtnIconList.clear(); customBtnLabelList.clear(); @@ -1278,5 +1380,5 @@ Features: QColor *c = new QColor; c->setNamedColor(QString(colorStr)); -@@ -3022,7 +2657,7 @@ +@@ -3022,7 +2747,7 @@ QString tmpStr(iconStr); if(!tmpStr.isEmpty()){ @@ -1287,5 +1389,5 @@ Features: delete pixmap; customBtnIconList.append(NULL); -@@ -3037,7 +2672,6 @@ +@@ -3037,7 +2762,6 @@ colorStr = colorList.next(); iconStr = iconList.next(); @@ -1295,5 +1397,5 @@ Features: void LiquidStyle::applyCustomAttributes(QPushButton *btn) -@@ -3087,7 +2721,7 @@ +@@ -3087,7 +2811,7 @@ } } @@ -1304,21 +1406,19 @@ Features: ---- - Sat Sep 21 05:31:48 2002 -+++ plugin.cpp Mon Jul 8 02:42:56 2002 -@@ -1,29 +1,113 @@ +--- - 2002-10-24 03:19:31.000000000 +0200 ++++ plugin.cpp 2002-10-04 03:37:38.000000000 +0200 +@@ -1,29 +1,84 @@ ++#include <qapplication.h> ++ #include "liquid.h" -#include <klocale.h> +#include "liquidset.h" +#include "plugin.h" - --extern "C" { -- KStyle* allocate(); -- int minor_version(); -- int major_version(); -- const char *description(); ++ + + +LiquidInterface::LiquidInterface ( ) : ref ( 0 ) +{ ++ m_widget = 0; +} + @@ -1327,40 +1427,57 @@ Features: +} + -+QStyle *LiquidInterface::create ( ) ++QStyle *LiquidInterface::style ( ) +{ + return new LiquidStyle ( ); +} + -+QString LiquidInterface::name ( ) ++QString LiquidInterface::name ( ) const ++{ ++ return qApp-> translate ( "Styles", "Liquid" ); ++} ++ ++QString LiquidInterface::description ( ) const ++{ ++ return qApp-> translate ( "Styles", "High Performance Liquid style by Mosfet" ); ++} ++ ++bool LiquidInterface::hasSettings ( ) const ++{ ++ return true; ++} ++ ++QWidget *LiquidInterface::create ( QWidget *parent, const char *name ) +{ -+ return QObject::tr( "Liquid", "name" ); ++ m_widget = new LiquidSettings ( parent, name ? name : "LIQUID-SETTINGS" ); + +-extern "C" { +- KStyle* allocate(); +- int minor_version(); +- int major_version(); +- const char *description(); ++ return m_widget; } -KStyle* allocate() -+QString LiquidInterface::description ( ) ++bool LiquidInterface::accept ( ) { - return(new LiquidStyle); -+ return QObject::tr( "High Performance Liquid style by Mosfet", "description" ); ++ if ( !m_widget ) ++ return false; ++ ++ return m_widget-> writeConfig ( ); } -int minor_version() -+QCString LiquidInterface::key ( ) ++void LiquidInterface::reject ( ) { - return(0); -+ return QCString ( "liquid" ); } -int major_version() -+unsigned int LiquidInterface::version ( ) ++ ++QRESULT LiquidInterface::queryInterface ( const QUuid &uuid, QUnknownInterface **iface ) { - return(1); -+ return 100; // 1.0.0 (\d+.\d.\d) - } - --const char *description() -+QRESULT LiquidInterface::queryInterface ( const QUuid &uuid, QUnknownInterface **iface ) -+{ -+ static LiquidSettingsInterface *setiface = 0; -+ + *iface = 0; + @@ -1369,9 +1486,6 @@ Features: + else if ( uuid == IID_Style ) + *iface = this; -+ else if ( uuid == IID_StyleSettings ) { -+ if ( !setiface ) -+ setiface = new LiquidSettingsInterface ( ); -+ *iface = setiface; -+ } ++ else if ( uuid == IID_StyleExtended ) ++ *iface = this; + + if ( *iface ) @@ -1379,56 +1493,15 @@ Features: + + return QS_OK; -+} -+ + } + +-const char *description() +Q_EXPORT_INTERFACE() -+{ -+ Q_CREATE_INSTANCE( LiquidInterface ) -+} -+ -+ -+LiquidSettingsInterface::LiquidSettingsInterface ( ) : ref ( 0 ) { - return(i18n("High performance liquid plugin").utf8()); -+ m_widget = 0; ++ Q_CREATE_INSTANCE( LiquidInterface ) } -+ -+LiquidSettingsInterface::~LiquidSettingsInterface ( ) -+{ -+} -+ -+QWidget *LiquidSettingsInterface::create ( QWidget *parent, const char *name ) -+{ -+ m_widget = new LiquidSettings ( parent, name ? name : "LIQUID-SETTINGS" ); -+ -+ return m_widget; -+} -+ -+bool LiquidSettingsInterface::accept ( ) -+{ -+ if ( !m_widget ) -+ return false; + -+ return m_widget-> writeConfig ( ); -+} + -+void LiquidSettingsInterface::reject ( ) -+{ -+} -+ -+QRESULT LiquidSettingsInterface::queryInterface ( const QUuid &uuid, QUnknownInterface **iface ) -+{ -+ *iface = 0; -+ -+ -+ if ( uuid == IID_QUnknown ) -+ *iface = this; -+ else if ( uuid == IID_StyleSettings ) -+ *iface = this; -+ -+ if ( *iface ) -+ (*iface)-> addRef ( ); -+ -+ return QS_OK; -+} ++ + +// Hack for Retail Z experiments |