aboutsummaryrefslogtreecommitdiff
path: root/src/WinButtonTheme.cc
diff options
context:
space:
mode:
Diffstat (limited to 'src/WinButtonTheme.cc')
-rw-r--r--src/WinButtonTheme.cc55
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
38template <>
39void FbTk::ThemeItem<WinButtonTheme::PixmapWithMask>::
40load() { }
41
42template <>
43void FbTk::ThemeItem<WinButtonTheme::PixmapWithMask>::
44setDefaultValue() {
45 // create empty pixmap
46 (*this)->pixmap = FbTk::FbPixmap(); // pixmap
47 (*this)->mask = FbTk::FbPixmap(); // mask
48}
49 29
50template <> 30#include "FbWinFrameTheme.hh"
51void FbTk::ThemeItem<WinButtonTheme::PixmapWithMask>::
52setFromString(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
79WinButtonTheme::WinButtonTheme(int screen_num, const FbWinFrameTheme &frame_theme): 32WinButtonTheme::WinButtonTheme(int screen_num, const FbWinFrameTheme &frame_theme):
80 FbTk::Theme(screen_num), 33 FbTk::Theme(screen_num),