00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023 #ifndef PLASTIKBUTTON_H
00024 #define PLASTIKBUTTON_H
00025
00026 #include <tqbutton.h>
00027 #include <tqimage.h>
00028 #include "plastik.h"
00029
00030 #include <kcommondecoration.h>
00031
00032 class TQTimer;
00033
00034 namespace KWinPlastik {
00035
00036 class PlastikClient;
00037
00038 class PlastikButton : public KCommonDecorationButton
00039 {
00040 Q_OBJECT
00041 public:
00042 PlastikButton(ButtonType type, PlastikClient *parent, const char *name);
00043 ~PlastikButton();
00044
00045 void reset(unsigned long changed);
00046 PlastikClient * client() { return m_client; }
00047
00048 protected slots:
00049 void animate();
00050
00051 private:
00052 void enterEvent(TQEvent *e);
00053 void leaveEvent(TQEvent *e);
00054 void drawButton(TQPainter *painter);
00055
00056 private:
00057 PlastikClient *m_client;
00058 ButtonIcon m_iconType;
00059 bool hover;
00060
00061 TQTimer *animTmr;
00062 uint animProgress;
00063 };
00064
00072 class IconEngine
00073 {
00074 public:
00075 static TQBitmap icon(ButtonIcon icon, int size);
00076
00077 private:
00078 enum Object {
00079 HorizontalLine,
00080 VerticalLine,
00081 DiagonalLine,
00082 CrossDiagonalLine
00083 };
00084
00085 static void drawObject(TQPainter &p, Object object, int x, int y, int length, int lineWidth);
00086 };
00087
00088 }
00089
00090 #endif // PLASTIKBUTTON_H