diff options
author | fluxgen <fluxgen> | 2003-08-22 21:35:40 (GMT) |
---|---|---|
committer | fluxgen <fluxgen> | 2003-08-22 21:35:40 (GMT) |
commit | dc3f13d2fc3e731e8929ec782cad1c1e2191802e (patch) | |
tree | 569639abb07294799706568ba4585a7577d6fb94 /src/WinButtonTheme.hh | |
parent | 834645f54563fc9a73a845e83ad687700ffecee1 (diff) | |
download | fluxbox_pavel-dc3f13d2fc3e731e8929ec782cad1c1e2191802e.zip fluxbox_pavel-dc3f13d2fc3e731e8929ec782cad1c1e2191802e.tar.bz2 |
fixed new image loading
Diffstat (limited to 'src/WinButtonTheme.hh')
-rw-r--r-- | src/WinButtonTheme.hh | 91 |
1 files changed, 40 insertions, 51 deletions
diff --git a/src/WinButtonTheme.hh b/src/WinButtonTheme.hh index dea88cf..0e959ca 100644 --- a/src/WinButtonTheme.hh +++ b/src/WinButtonTheme.hh | |||
@@ -19,75 +19,64 @@ | |||
19 | // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER | 19 | // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER |
20 | // DEALINGS IN THE SOFTWARE. | 20 | // DEALINGS IN THE SOFTWARE. |
21 | 21 | ||
22 | // $Id: WinButtonTheme.hh,v 1.3 2003/08/22 14:48:10 fluxgen Exp $ | 22 | // $Id: WinButtonTheme.hh,v 1.4 2003/08/22 21:35:40 fluxgen Exp $ |
23 | 23 | ||
24 | #ifndef WINBUTTONTHEME_HH | 24 | #ifndef WINBUTTONTHEME_HH |
25 | #define WINBUTTONTHEME_HH | 25 | #define WINBUTTONTHEME_HH |
26 | 26 | ||
27 | #include "Theme.hh" | 27 | #include "Theme.hh" |
28 | #include "FbPixmap.hh" | 28 | #include "FbTk/PixmapWithMask.hh" |
29 | 29 | ||
30 | class FbWinFrameTheme; | 30 | class FbWinFrameTheme; |
31 | 31 | ||
32 | class WinButtonTheme: public FbTk::Theme { | 32 | class WinButtonTheme: public FbTk::Theme { |
33 | public: | 33 | public: |
34 | /// holds pixmap and a mask | ||
35 | struct PixmapWithMask { | ||
36 | /// scale both pixmap and mask to specified size | ||
37 | void scale(unsigned int width, unsigned int height) { | ||
38 | pixmap.scale(width, height); | ||
39 | mask.scale(width, height); | ||
40 | } | ||
41 | FbTk::FbPixmap pixmap; | ||
42 | FbTk::FbPixmap mask; | ||
43 | }; | ||
44 | |||
45 | WinButtonTheme(int screen_num, const FbWinFrameTheme &frame_theme); | 34 | WinButtonTheme(int screen_num, const FbWinFrameTheme &frame_theme); |
46 | ~WinButtonTheme(); | 35 | ~WinButtonTheme(); |
47 | 36 | ||
48 | void reconfigTheme(); | 37 | void reconfigTheme(); |
49 | 38 | ||
50 | inline const PixmapWithMask &closePixmap() const { return *m_close_pm; } | 39 | inline const FbTk::PixmapWithMask &closePixmap() const { return *m_close_pm; } |
51 | inline PixmapWithMask &closePixmap() { return *m_close_pm; } | 40 | inline FbTk::PixmapWithMask &closePixmap() { return *m_close_pm; } |
52 | inline PixmapWithMask &closeUnfocusPixmap() { return *m_close_unfocus_pm; } | 41 | inline FbTk::PixmapWithMask &closeUnfocusPixmap() { return *m_close_unfocus_pm; } |
53 | inline const PixmapWithMask &closePressedPixmap() const { return *m_close_pressed_pm; } | 42 | inline const FbTk::PixmapWithMask &closePressedPixmap() const { return *m_close_pressed_pm; } |
54 | inline PixmapWithMask &closePressedPixmap() { return *m_close_pressed_pm; } | 43 | inline FbTk::PixmapWithMask &closePressedPixmap() { return *m_close_pressed_pm; } |
55 | 44 | ||
56 | inline const PixmapWithMask &maximizePixmap() const { return *m_maximize_pm; } | 45 | inline const FbTk::PixmapWithMask &maximizePixmap() const { return *m_maximize_pm; } |
57 | inline PixmapWithMask &maximizePixmap() { return *m_maximize_pm; } | 46 | inline FbTk::PixmapWithMask &maximizePixmap() { return *m_maximize_pm; } |
58 | inline PixmapWithMask &maximizeUnfocusPixmap() { return *m_maximize_unfocus_pm; } | 47 | inline FbTk::PixmapWithMask &maximizeUnfocusPixmap() { return *m_maximize_unfocus_pm; } |
59 | inline const PixmapWithMask &maximizePressedPixmap() const { return *m_maximize_pressed_pm; } | 48 | inline const FbTk::PixmapWithMask &maximizePressedPixmap() const { return *m_maximize_pressed_pm; } |
60 | inline PixmapWithMask &maximizePressedPixmap() { return *m_maximize_pressed_pm; } | 49 | inline FbTk::PixmapWithMask &maximizePressedPixmap() { return *m_maximize_pressed_pm; } |
61 | 50 | ||
62 | inline const PixmapWithMask &iconifyPixmap() const { return *m_iconify_pm; } | 51 | inline const FbTk::PixmapWithMask &iconifyPixmap() const { return *m_iconify_pm; } |
63 | inline PixmapWithMask &iconifyPixmap() { return *m_iconify_pm; } | 52 | inline FbTk::PixmapWithMask &iconifyPixmap() { return *m_iconify_pm; } |
64 | inline PixmapWithMask &iconifyUnfocusPixmap() { return *m_iconify_unfocus_pm; } | 53 | inline FbTk::PixmapWithMask &iconifyUnfocusPixmap() { return *m_iconify_unfocus_pm; } |
65 | inline const PixmapWithMask &iconifyPressedPixmap() const { return *m_iconify_pressed_pm; } | 54 | inline const FbTk::PixmapWithMask &iconifyPressedPixmap() const { return *m_iconify_pressed_pm; } |
66 | inline PixmapWithMask &iconifyPressedPixmap() { return *m_iconify_pressed_pm; } | 55 | inline FbTk::PixmapWithMask &iconifyPressedPixmap() { return *m_iconify_pressed_pm; } |
67 | 56 | ||
68 | inline const PixmapWithMask &stickPixmap() const { return *m_stick_pm; } | 57 | inline const FbTk::PixmapWithMask &stickPixmap() const { return *m_stick_pm; } |
69 | inline PixmapWithMask &stickPixmap() { return *m_stick_pm; } | 58 | inline FbTk::PixmapWithMask &stickPixmap() { return *m_stick_pm; } |
70 | inline PixmapWithMask &stickUnfocusPixmap() { return *m_stick_unfocus_pm; } | 59 | inline FbTk::PixmapWithMask &stickUnfocusPixmap() { return *m_stick_unfocus_pm; } |
71 | inline const PixmapWithMask &stickPressedPixmap() const { return *m_stick_pressed_pm; } | 60 | inline const FbTk::PixmapWithMask &stickPressedPixmap() const { return *m_stick_pressed_pm; } |
72 | inline PixmapWithMask &stickPressedPixmap() { return *m_stick_pressed_pm; } | 61 | inline FbTk::PixmapWithMask &stickPressedPixmap() { return *m_stick_pressed_pm; } |
73 | 62 | ||
74 | inline PixmapWithMask &stuckPixmap() { return *m_stuck_pm; } | 63 | inline FbTk::PixmapWithMask &stuckPixmap() { return *m_stuck_pm; } |
75 | inline PixmapWithMask &stuckUnfocusPixmap() { return *m_stuck_unfocus_pm; } | 64 | inline FbTk::PixmapWithMask &stuckUnfocusPixmap() { return *m_stuck_unfocus_pm; } |
76 | 65 | ||
77 | inline const PixmapWithMask &shadePixmap() const { return *m_shade_pm; } | 66 | inline const FbTk::PixmapWithMask &shadePixmap() const { return *m_shade_pm; } |
78 | inline PixmapWithMask &shadePixmap() { return *m_shade_pm; } | 67 | inline FbTk::PixmapWithMask &shadePixmap() { return *m_shade_pm; } |
79 | inline PixmapWithMask &shadeUnfocusPixmap() { return *m_shade_unfocus_pm; } | 68 | inline FbTk::PixmapWithMask &shadeUnfocusPixmap() { return *m_shade_unfocus_pm; } |
80 | inline const PixmapWithMask &shadePressedPixmap() const { return *m_shade_pressed_pm; } | 69 | inline const FbTk::PixmapWithMask &shadePressedPixmap() const { return *m_shade_pressed_pm; } |
81 | inline PixmapWithMask &shadePressedPixmap() { return *m_shade_pressed_pm; } | 70 | inline FbTk::PixmapWithMask &shadePressedPixmap() { return *m_shade_pressed_pm; } |
82 | 71 | ||
83 | private: | 72 | private: |
84 | 73 | ||
85 | FbTk::ThemeItem<PixmapWithMask> m_close_pm, m_close_unfocus_pm, m_close_pressed_pm; | 74 | FbTk::ThemeItem<FbTk::PixmapWithMask> m_close_pm, m_close_unfocus_pm, m_close_pressed_pm; |
86 | FbTk::ThemeItem<PixmapWithMask> m_maximize_pm, m_maximize_unfocus_pm, m_maximize_pressed_pm; | 75 | FbTk::ThemeItem<FbTk::PixmapWithMask> m_maximize_pm, m_maximize_unfocus_pm, m_maximize_pressed_pm; |
87 | FbTk::ThemeItem<PixmapWithMask> m_iconify_pm, m_iconify_unfocus_pm, m_iconify_pressed_pm; | 76 | FbTk::ThemeItem<FbTk::PixmapWithMask> m_iconify_pm, m_iconify_unfocus_pm, m_iconify_pressed_pm; |
88 | FbTk::ThemeItem<PixmapWithMask> m_shade_pm, m_shade_unfocus_pm, m_shade_pressed_pm; | 77 | FbTk::ThemeItem<FbTk::PixmapWithMask> m_shade_pm, m_shade_unfocus_pm, m_shade_pressed_pm; |
89 | FbTk::ThemeItem<PixmapWithMask> m_stick_pm, m_stick_unfocus_pm, m_stick_pressed_pm; | 78 | FbTk::ThemeItem<FbTk::PixmapWithMask> m_stick_pm, m_stick_unfocus_pm, m_stick_pressed_pm; |
90 | FbTk::ThemeItem<PixmapWithMask> m_stuck_pm, m_stuck_unfocus_pm; | 79 | FbTk::ThemeItem<FbTk::PixmapWithMask> m_stuck_pm, m_stuck_unfocus_pm; |
91 | 80 | ||
92 | const FbWinFrameTheme &m_frame_theme; | 81 | const FbWinFrameTheme &m_frame_theme; |
93 | }; | 82 | }; |