Redmond style merged back from kwin_iii to HEAD, done by Chris Lee.

svn path=/trunk/kdebase/kwin/; revision=251771
This commit is contained in:
Luboš Luňák 2003-09-17 08:27:26 +00:00
parent 6e273005c7
commit 7b0773facd
4 changed files with 490 additions and 425 deletions

View file

@ -1,21 +1,11 @@
INCLUDES = $(all_includes) INCLUDES = -I$(srcdir)/../../lib $(all_includes)
kde_module_LTLIBRARIES = kwin_redmond.la kde_module_LTLIBRARIES = kwin3_redmond.la
kwin_redmond_la_SOURCES = redmond.cpp kwin3_redmond_la_SOURCES = redmond.cpp
#kwin_redmond_la_LDFLAGS = $(all_libraries) $(KDE_PLUGIN) -module kwin3_redmond_la_LDFLAGS = $(all_libraries) $(KDE_PLUGIN) -module
kwin_redmond_la_LDFLAGS = $(all_libraries) -avoid-version -module $(KDE_RPATH) $(KDE_MT_LDFLAGS) kwin3_redmond_la_LIBADD = $(LIB_KDECORE) ../../lib/libkwin.la
METASOURCES = AUTO METASOURCES = AUTO
noinst_HEADERS = redmond.h noinst_HEADERS = redmond.h
lnkdir = $(kde_datadir)/kwin/
lnk_DATA = redmond.desktop
EXTRA_DIST = $(lnk_DATA)
###KMAKE-start (don't edit or delete this block)
###KMAKE-end

File diff suppressed because it is too large Load diff

View file

@ -6,4 +6,4 @@ Name[fa]=ردموند
Name[ko]= Name[ko]=
Name[lv]=Redmonda Name[lv]=Redmonda
Name[th]= Name[th]=
X-KDE-Library=kwin_redmond X-KDE-Library=kwin3_redmond

View file

@ -3,12 +3,15 @@
* *
* Redmond KWin client * Redmond KWin client
* *
* Copyright 2001 * Copyright 2001-2003
* Ported to kwin_iii by Chris Lee <clee@kde.org>
* Karol Szwed <gallium@kde.org> * Karol Szwed <gallium@kde.org>
* http://gallium.n3.net/ * http://gallium.n3.net/
* *
* Based on the default KWin client. * Based on the default KWin client.
* *
* Updated to support the new API 9/2003 (CL)
* Updated to emulate More Accurately 9/2003 (CL)
* Updated to support toolwindows 3/2001 (KS) * Updated to support toolwindows 3/2001 (KS)
* *
*/ */
@ -20,82 +23,103 @@
#include <qbutton.h> #include <qbutton.h>
#include <qbitmap.h> #include <qbitmap.h>
#include <kpixmap.h> #include <kpixmap.h>
#include "../../client.h" #include <kdecoration.h>
#include "../../kwinbutton.h" #include <kdecorationfactory.h>
class QLabel; class QLabel;
class QSpacerItem; class QSpacerItem;
class QBoxLayout; class QBoxLayout;
namespace Redmond { namespace Redmond {
using namespace KWinInternal; class RedmondDeco;
class GalliumButton : public KWinButton class RedmondButton : public QButton
{ {
public: Q_OBJECT
GalliumButton(Client *parent=0, const char *name=0, public:
const unsigned char *bitmap=NULL, RedmondButton(RedmondDeco *parent=0, const char *name=0,
bool menuButton=false, bool isMini=false, const unsigned char *bitmap=NULL,
const QString& tip=NULL); bool menuButton=false, bool isMini=false,
void setBitmap(const unsigned char *bitmap); const QString& tip=NULL);
void setPixmap(const QPixmap &p); void setBitmap(const unsigned char *bitmap);
void reset(); void setPixmap(const QPixmap &p);
void reset();
QSize sizeHint() const; QSize sizeHint() const;
int last_button; int last_button;
protected: protected:
void mousePressEvent(QMouseEvent* e); void mousePressEvent(QMouseEvent* e);
void mouseReleaseEvent(QMouseEvent* e); void mouseReleaseEvent(QMouseEvent* e);
virtual void drawButton(QPainter *p); virtual void drawButton(QPainter *p);
void drawButtonLabel(QPainter *){;} void drawButtonLabel(QPainter *){;}
QBitmap deco; QBitmap deco;
QPixmap pix; QPixmap pix;
bool menuBtn; bool menuBtn;
bool miniBtn; bool miniBtn;
Client* client; RedmondDeco *client;
}; };
class GalliumClient : public Client class RedmondDeco : public KDecoration
{ {
Q_OBJECT Q_OBJECT
public: public:
GalliumClient( Workspace *ws, WId w, QWidget *parent=0, RedmondDeco(KDecorationBridge *, KDecorationFactory *);
const char *name=0 ); ~RedmondDeco() {;}
~GalliumClient() {;} void init();
protected: protected:
void resizeEvent( QResizeEvent* ); void resizeEvent(QResizeEvent*);
void paintEvent( QPaintEvent* ); void paintEvent(QPaintEvent*);
void showEvent( QShowEvent* ); void showEvent(QShowEvent*);
void mouseDoubleClickEvent( QMouseEvent * ); void mouseDoubleClickEvent(QMouseEvent *);
void captionChange( const QString& name ); void captionChange(const QString& name);
void maximizeChange(bool m); void maximizeChange(bool m);
void activeChange(bool); void activeChange(bool);
void iconChange(); void iconChange();
void calcHiddenButtons(); void calcHiddenButtons();
protected slots: // New stuff.
void slotReset(); MousePosition mousePosition(const QPoint &) const;
void slotMaximize(); void borders(int &, int &, int &, int &) const;
void menuButtonPressed(); void resize(const QSize &);
void menuButtonReleased(); QSize minimumSize() const;
void activeChange();
void captionChange();
void maximizeChange();
void desktopChange();
void shadeChange();
bool eventFilter(QObject *, QEvent *);
private: protected slots:
enum Buttons{ BtnHelp=0, BtnMax, BtnIconify, BtnClose, void slotReset();
BtnMenu, BtnCount }; void slotMaximize();
void menuButtonPressed();
GalliumButton* button[ GalliumClient::BtnCount ]; private:
int lastButtonWidth; enum Buttons{ BtnHelp=0, BtnMax, BtnMin, BtnClose, BtnMenu, BtnCount };
int titleHeight;
QSpacerItem* titlebar; RedmondButton* button[RedmondDeco::BtnCount];
bool hiddenItems; int lastButtonWidth;
QBoxLayout* hb; int titleHeight;
bool smallButtons; QSpacerItem* titlebar;
bool closing; bool hiddenItems;
QBoxLayout* hb;
bool smallButtons;
};
class RedmondDecoFactory : public QObject, public KDecorationFactory
{
Q_OBJECT
public:
RedmondDecoFactory();
virtual ~RedmondDecoFactory();
virtual KDecoration *createDecoration(KDecorationBridge *);
virtual bool reset(unsigned long);
}; };
} }