See my earlier mail.
svn path=/trunk/kdebase/kwin/; revision=102970
This commit is contained in:
parent
4232fe0ae2
commit
11e5ed61c2
3 changed files with 1 additions and 220 deletions
|
@ -1 +1 @@
|
|||
SUBDIRS = default b2 kde1 riscos win2k quartz icewm web mwm
|
||||
SUBDIRS = default kde1 riscos win2k quartz icewm web mwm
|
||||
|
|
|
@ -1,121 +0,0 @@
|
|||
#ifndef __B2CLIENT_H
|
||||
#define __B2CLIENT_H
|
||||
|
||||
#include <qtoolbutton.h>
|
||||
#include <qbitmap.h>
|
||||
#include <kpixmap.h>
|
||||
#include "../../client.h"
|
||||
class QLabel;
|
||||
//class QSpacerItem;
|
||||
//class QHBoxLayout;
|
||||
class QGridLayout;
|
||||
|
||||
namespace KWinInternal {
|
||||
|
||||
class B2Button : public QButton
|
||||
{
|
||||
Q_OBJECT
|
||||
public:
|
||||
B2Button(Client *_client=0, QWidget *parent=0, const char *name=0)
|
||||
: QButton(parent, name){useMiniIcon = false; client = _client;}
|
||||
B2Button(KPixmap *pix, KPixmap *pixDown, KPixmap *iPix, KPixmap *iPixDown,
|
||||
Client *_client=0, QWidget *parent=0, const char *name=0);
|
||||
void setBg(const QColor &c){bg = c;}
|
||||
void setPixmaps(KPixmap *pix, KPixmap *pixDown, KPixmap *iPix,
|
||||
KPixmap *iPixDown);
|
||||
void setPixmaps(int button_id);
|
||||
void setToggle(){setToggleType(Toggle);}
|
||||
void setActive(bool on){setOn(on);}
|
||||
void setUseMiniIcon(){useMiniIcon = true;}
|
||||
QSize sizeHint() const;
|
||||
QSizePolicy sizePolicy() const;
|
||||
protected:
|
||||
virtual void drawButton(QPainter *p);
|
||||
void drawButtonLabel(QPainter *){;}
|
||||
|
||||
bool useMiniIcon;
|
||||
KPixmap *pNorm, *pDown, *iNorm, *iDown;
|
||||
QColor bg; //only use one color (the rest is pixmap) so forget QPalette ;)
|
||||
Client *client;
|
||||
|
||||
void mousePressEvent( QMouseEvent* e );
|
||||
void mouseReleaseEvent( QMouseEvent* e );
|
||||
|
||||
public:
|
||||
int last_button;
|
||||
};
|
||||
|
||||
class B2Client;
|
||||
|
||||
class B2Titlebar : public QWidget
|
||||
{
|
||||
Q_OBJECT
|
||||
public:
|
||||
B2Titlebar(B2Client *parent);
|
||||
~B2Titlebar(){;}
|
||||
bool isFullyObscured() const {return isfullyobscured;}
|
||||
void recalcBuffer();
|
||||
protected:
|
||||
void paintEvent( QPaintEvent* );
|
||||
bool x11Event(XEvent *e);
|
||||
void mouseDoubleClickEvent( QMouseEvent * );
|
||||
void mousePressEvent( QMouseEvent * );
|
||||
void mouseReleaseEvent( QMouseEvent * );
|
||||
void mouseMoveEvent(QMouseEvent *);
|
||||
void init();
|
||||
void resizeEvent(QResizeEvent *ev);
|
||||
|
||||
QString oldTitle;
|
||||
KPixmap titleBuffer;
|
||||
bool set_x11mask;
|
||||
bool isfullyobscured;
|
||||
bool shift_move;
|
||||
QPoint moveOffset;
|
||||
B2Client *client;
|
||||
};
|
||||
|
||||
class B2Client : public KWinInternal::Client
|
||||
{
|
||||
Q_OBJECT
|
||||
friend class B2Titlebar;
|
||||
public:
|
||||
B2Client( Workspace *ws, WId w, QWidget *parent=0, const char *name=0 );
|
||||
~B2Client(){;}
|
||||
void unobscureTitlebar();
|
||||
void titleMoveAbs(int new_ofs);
|
||||
void titleMoveRel(int xdiff);
|
||||
protected:
|
||||
void resizeEvent( QResizeEvent* );
|
||||
void paintEvent( QPaintEvent* );
|
||||
void showEvent( QShowEvent* );
|
||||
void windowWrapperShowEvent( QShowEvent* );
|
||||
void init();
|
||||
void captionChange( const QString& name );
|
||||
void stickyChange(bool on);
|
||||
void activeChange(bool on);
|
||||
void maximizeChange(bool m);
|
||||
void iconChange();
|
||||
void doShape();
|
||||
MousePosition mousePosition( const QPoint& p ) const;
|
||||
private slots:
|
||||
void menuButtonPressed();
|
||||
void slotReset();
|
||||
void maxButtonClicked();
|
||||
private:
|
||||
void positionButtons();
|
||||
enum ButtonType{BtnMenu=0, BtnSticky, BtnIconify, BtnMax, BtnClose,
|
||||
BtnHelp};
|
||||
//B2Button* button[5];
|
||||
B2Button* button[6];
|
||||
//QSpacerItem* titlebar;
|
||||
//QHBoxLayout *tLayout;
|
||||
QGridLayout *g;
|
||||
int bar_x_ofs;
|
||||
B2Titlebar *titlebar;
|
||||
int in_unobs;
|
||||
|
||||
};
|
||||
|
||||
};
|
||||
|
||||
#endif
|
|
@ -1,98 +0,0 @@
|
|||
#ifndef __STDCLIENT_BITMAPS_H
|
||||
#define __STDCLIENT_BITMAPS_H
|
||||
|
||||
/**
|
||||
* The standard client has the capability to color it's titlebar buttons
|
||||
* according to the new color scheme. In order to do this it needs a bitmap
|
||||
* for each shade which it draws into a pixmap with the appropriate color.
|
||||
* These are all the bitmaps.
|
||||
*/
|
||||
|
||||
static unsigned char close_white_bits[] = {
|
||||
0x00, 0x00, 0x00, 0x00, 0x04, 0x10, 0x04, 0x08, 0x08, 0x04, 0x10, 0x02,
|
||||
0x20, 0x01, 0x40, 0x00, 0x40, 0x00, 0x20, 0x01, 0x10, 0x02, 0x08, 0x04,
|
||||
0x04, 0x08, 0x04, 0x10, 0x00, 0x00, 0x00, 0x00};
|
||||
|
||||
static unsigned char close_dgray_bits[] = {
|
||||
0x00, 0x00, 0x00, 0x00, 0x08, 0x20, 0x18, 0x30, 0x30, 0x18, 0x60, 0x0c,
|
||||
0xc0, 0x06, 0x80, 0x03, 0x80, 0x03, 0xc0, 0x06, 0x60, 0x0c, 0x30, 0x18,
|
||||
0x18, 0x30, 0x08, 0x20, 0x00, 0x00, 0x00, 0x00};
|
||||
|
||||
static unsigned char menu_white_bits[] = {
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
0xfc, 0x3f, 0x04, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00};
|
||||
|
||||
static unsigned char menu_dgray_bits[] = {
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
0x00, 0x00, 0x00, 0x20, 0xf8, 0x3f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00};
|
||||
|
||||
static unsigned char menu_mask_bits[] = {
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
0xfc, 0x3f, 0x04, 0x20, 0xfc, 0x3f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00};
|
||||
|
||||
static unsigned char pindown_white_bits[] = {
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0f, 0x80, 0x1f, 0xa0, 0x03,
|
||||
0xb0, 0x01, 0x30, 0x01, 0xf0, 0x00, 0x70, 0x00, 0x20, 0x00, 0x00, 0x00,
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00};
|
||||
|
||||
static unsigned char pindown_gray_bits[] = {
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x1c,
|
||||
0x00, 0x0e, 0x00, 0x06, 0x00, 0x00, 0x80, 0x07, 0xc0, 0x03, 0xe0, 0x01,
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00};
|
||||
|
||||
static unsigned char pindown_dgray_bits[] = {
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x0f, 0xc0, 0x10, 0x70, 0x20, 0x50, 0x20,
|
||||
0x48, 0x30, 0xc8, 0x38, 0x08, 0x1f, 0x08, 0x18, 0x10, 0x1c, 0x10, 0x0e,
|
||||
0xe0, 0x07, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00};
|
||||
|
||||
static unsigned char pindown_mask_bits[] = {
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x0f, 0xc0, 0x1f, 0xf0, 0x3f, 0xf0, 0x3f,
|
||||
0xf8, 0x3f, 0xf8, 0x3f, 0xf8, 0x1f, 0xf8, 0x1f, 0xf0, 0x1f, 0xf0, 0x0f,
|
||||
0xe0, 0x07, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00};
|
||||
|
||||
static unsigned char pinup_white_bits[] = {
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x00, 0x80, 0x11,
|
||||
0x3f, 0x15, 0x00, 0x15, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00};
|
||||
|
||||
static unsigned char pinup_gray_bits[] = {
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
0x80, 0x0a, 0xbf, 0x0a, 0x80, 0x15, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00};
|
||||
|
||||
static unsigned char pinup_dgray_bits[] = {
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xc0, 0x20, 0x40, 0x31, 0x40, 0x2e,
|
||||
0x40, 0x20, 0x40, 0x20, 0x7f, 0x2a, 0x40, 0x3f, 0xc0, 0x31, 0xc0, 0x20,
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00};
|
||||
|
||||
static unsigned char pinup_mask_bits[] = {
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xc0, 0x20, 0xc0, 0x31, 0xc0, 0x3f,
|
||||
0xff, 0x3f, 0xff, 0x3f, 0xff, 0x3f, 0xc0, 0x3f, 0xc0, 0x31, 0xc0, 0x20,
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00};
|
||||
|
||||
static unsigned char help_mask_bits[] = {
|
||||
0x00,0x00,0x00,0x00,0xe0,0x03,0xf0,0x07,0x70,0x0e,0x60,0x0e,0x00,0x0f,0x80,
|
||||
0x07,0xc0,0x03,0xc0,0x01,0x80,0x01,0xc0,0x00,0xc0,0x01,0x80,0x01,0x00,0x00,
|
||||
0x00,0x00,0x00,0x00,0x00,0x4c,0x0b,0x08,0x58,0x65,0x09,0x08,0x90,0x00,0x00,
|
||||
0x00,0x09,0x04,0x00,0x00,0x72,0x6f,0x6f,0x74,0x00,0x24,0x31,0x24,0x47,0x6b,
|
||||
0x65,0x44,0x78,0x63 };
|
||||
|
||||
static unsigned char help_dark_bits[] = {
|
||||
0x00,0x00,0x00,0x00,0xe0,0x03,0x30,0x06,0x30,0x06,0x00,0x06,0x00,0x03,0x80,
|
||||
0x01,0xc0,0x00,0xc0,0x00,0x00,0x00,0xc0,0x00,0xc0,0x00,0x00,0x00,0x00,0x00,
|
||||
0x00,0x00,0x00,0x00,0x65,0x64,0x28,0x29,0x00,0x00,0x00,0x00,0x90,0x00,0x00,
|
||||
0x00,0x21,0x00,0x00,0x00,0x34,0xfe,0x12,0x2b,0x00,0x00,0xff,0xff,0x58,0xc0,
|
||||
0x01,0x2b,0x45,0xfe };
|
||||
|
||||
static unsigned char help_light_bits[] = {
|
||||
0x00,0x00,0x00,0x00,0x00,0x00,0xc0,0x01,0x40,0x08,0x60,0x08,0x00,0x0c,0x00,
|
||||
0x06,0x00,0x03,0x00,0x01,0x80,0x01,0x00,0x00,0x00,0x01,0x80,0x01,0x00,0x00,
|
||||
0x00,0x00,0x00,0x00,0x00,0x4c,0x0b,0x08,0x58,0x65,0x09,0x08,0x90,0x00,0x00,
|
||||
0x00,0x09,0x04,0x00,0x00,0x72,0x6f,0x6f,0x74,0x00,0x24,0x31,0x24,0x47,0x6b,
|
||||
0x65,0x44,0x78,0x63 };
|
||||
|
||||
#endif
|
||||
|
Loading…
Reference in a new issue