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.cc | |
parent | 834645f54563fc9a73a845e83ad687700ffecee1 (diff) | |
download | fluxbox-dc3f13d2fc3e731e8929ec782cad1c1e2191802e.zip fluxbox-dc3f13d2fc3e731e8929ec782cad1c1e2191802e.tar.bz2 |
fixed new image loading
Diffstat (limited to 'src/WinButtonTheme.cc')
-rw-r--r-- | src/WinButtonTheme.cc | 55 |
1 files changed, 4 insertions, 51 deletions
diff --git a/src/WinButtonTheme.cc b/src/WinButtonTheme.cc index b8628eb..74d37c8 100644 --- a/src/WinButtonTheme.cc +++ b/src/WinButtonTheme.cc | |||
@@ -19,62 +19,15 @@ | |||
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.cc,v 1.5 2003/08/22 15:19:39 fluxgen Exp $ | 22 | // $Id: WinButtonTheme.cc,v 1.6 2003/08/22 21:35:40 fluxgen Exp $ |
23 | 23 | ||
24 | #include "WinButtonTheme.hh" | 24 | #include "WinButtonTheme.hh" |
25 | 25 | ||
26 | #include "FbTk/App.hh" | 26 | #include "FbTk/App.hh" |
27 | #include "FbWinFrameTheme.hh" | 27 | #include "FbTk/Image.hh" |
28 | 28 | #include "FbTk/PixmapWithMask.hh" | |
29 | #ifdef HAVE_CONFIG_H | ||
30 | #include "config.h" | ||
31 | #endif // HAVE_CONFIG_H | ||
32 | |||
33 | #ifdef HAVE_XPM | ||
34 | #include <X11/xpm.h> | ||
35 | #endif // HAVE_XPM | ||
36 | |||
37 | // not used | ||
38 | template <> | ||
39 | void FbTk::ThemeItem<WinButtonTheme::PixmapWithMask>:: | ||
40 | load() { } | ||
41 | |||
42 | template <> | ||
43 | void FbTk::ThemeItem<WinButtonTheme::PixmapWithMask>:: | ||
44 | setDefaultValue() { | ||
45 | // create empty pixmap | ||
46 | (*this)->pixmap = FbTk::FbPixmap(); // pixmap | ||
47 | (*this)->mask = FbTk::FbPixmap(); // mask | ||
48 | } | ||
49 | 29 | ||
50 | template <> | 30 | #include "FbWinFrameTheme.hh" |
51 | void FbTk::ThemeItem<WinButtonTheme::PixmapWithMask>:: | ||
52 | setFromString(const char *str) { | ||
53 | if (str == 0) | ||
54 | setDefaultValue(); | ||
55 | else { | ||
56 | #ifdef HAVE_XPM | ||
57 | XpmAttributes xpm_attr; | ||
58 | xpm_attr.valuemask = 0; | ||
59 | Display *dpy = FbTk::App::instance()->display(); | ||
60 | Pixmap pm = 0, mask = 0; | ||
61 | int retvalue = XpmReadFileToPixmap(dpy, | ||
62 | RootWindow(dpy, m_tm.screenNum()), | ||
63 | const_cast<char *>(str), | ||
64 | &pm, | ||
65 | &mask, &xpm_attr); | ||
66 | if (retvalue == 0) { // success | ||
67 | (*this)->pixmap = pm; | ||
68 | (*this)->mask = mask; | ||
69 | } else { // failure | ||
70 | setDefaultValue(); | ||
71 | } | ||
72 | #else | ||
73 | setDefaultValue(); | ||
74 | #endif // HAVE_XPM | ||
75 | |||
76 | } | ||
77 | } | ||
78 | 31 | ||
79 | WinButtonTheme::WinButtonTheme(int screen_num, const FbWinFrameTheme &frame_theme): | 32 | WinButtonTheme::WinButtonTheme(int screen_num, const FbWinFrameTheme &frame_theme): |
80 | FbTk::Theme(screen_num), | 33 | FbTk::Theme(screen_num), |