00001 /* 00002 * 00003 * Redmond KWin client 00004 * 00005 * Copyright 2001-2003 00006 * Ported to kwin_iii by Chris Lee <clee@kde.org> 00007 * Karol Szwed <gallium@kde.org> 00008 * http://gallium.n3.net/ 00009 * 00010 * Based on the default KWin client. 00011 * 00012 * Updated to support the new API 9/2003 (CL) 00013 * Updated to emulate More Accurately 9/2003 (CL) 00014 * Updated to support toolwindows 3/2001 (KS) 00015 * 00016 */ 00017 00018 #ifndef __KDE_REDMOND_H 00019 #define __KDE_REDMOND_H 00020 00021 #include <tqbitmap.h> 00022 #include <kpixmap.h> 00023 #include <kcommondecoration.h> 00024 #include <kdecorationfactory.h> 00025 00026 namespace Redmond { 00027 00028 class RedmondDeco; 00029 00030 class RedmondButton : public KCommonDecorationButton 00031 { 00032 Q_OBJECT 00033 public: 00034 RedmondButton(ButtonType type, RedmondDeco *parent, const char *name); 00035 void setBitmap(const unsigned char *bitmap); 00036 void setPixmap(const TQPixmap &p); 00037 void reset(unsigned long changed); 00038 00039 protected: 00040 virtual void drawButton(TQPainter *p); 00041 void drawButtonLabel(TQPainter *){;} 00042 00043 TQBitmap deco; 00044 TQPixmap pix; 00045 bool miniBtn; 00046 }; 00047 00048 00049 class RedmondDeco : public KCommonDecoration 00050 { 00051 public: 00052 RedmondDeco(KDecorationBridge *, KDecorationFactory *); 00053 ~RedmondDeco() {;} 00054 00055 virtual TQString visibleName() const; 00056 virtual TQString defaultButtonsLeft() const; 00057 virtual TQString defaultButtonsRight() const; 00058 virtual bool decorationBehaviour(DecorationBehaviour behaviour) const; 00059 virtual int layoutMetric(LayoutMetric lm, bool respectWindowState = true, const KCommonDecorationButton * = 0) const; 00060 virtual KCommonDecorationButton *createButton(ButtonType type); 00061 00062 void init(); 00063 00064 protected: 00065 virtual void reset( unsigned long changed ); 00066 00067 void paintEvent(TQPaintEvent*); 00068 00069 private: 00070 int titleHeight; 00071 }; 00072 00073 class RedmondDecoFactory : public TQObject, public KDecorationFactory 00074 { 00075 Q_OBJECT 00076 public: 00077 RedmondDecoFactory(); 00078 virtual ~RedmondDecoFactory(); 00079 virtual KDecoration *createDecoration(KDecorationBridge *); 00080 virtual bool reset(unsigned long); 00081 virtual bool supports( Ability ability ); 00082 virtual TQValueList< BorderSize > borderSizes() const; 00083 private: 00084 void readConfig(); 00085 }; 00086 00087 } 00088 00089 #endif 00090 // vim: ts=4 00091 // kate: space-indent off; tab-width 4;
1.6.1