aboutsummaryrefslogtreecommitdiff
path: root/src/Theme.hh
diff options
context:
space:
mode:
authorfluxgen <fluxgen>2003-04-25 13:58:31 (GMT)
committerfluxgen <fluxgen>2003-04-25 13:58:31 (GMT)
commitf801b384e5300aaa46ef2b3fb267243a3c4b78fc (patch)
treedf603c2b0a4898c4ed0fa93cb162a41ebc3781f0 /src/Theme.hh
parent3d73a90a7b50a50d1c95b72da871e071f4f07cfb (diff)
downloadfluxbox-f801b384e5300aaa46ef2b3fb267243a3c4b78fc.zip
fluxbox-f801b384e5300aaa46ef2b3fb267243a3c4b78fc.tar.bz2
obsolete
Diffstat (limited to 'src/Theme.hh')
-rw-r--r--src/Theme.hh129
1 files changed, 0 insertions, 129 deletions
diff --git a/src/Theme.hh b/src/Theme.hh
deleted file mode 100644
index 810365b..0000000
--- a/src/Theme.hh
+++ /dev/null
@@ -1,129 +0,0 @@
1// Theme.hh for fluxbox
2// Copyright (c) 2001-2002 Henrik Kinnunen (fluxgen@linuxmail.org)
3//
4// A lot of the base code is taken from Screen.hh in Blackbox 0.61.1
5// Screen.cc - Copyright (c) 1997 - 2000 Brad Hughes (bhughes@tcac.net)
6//
7// Permission is hereby granted, free of charge, to any person obtaining a
8// copy of this software and associated documentation files (the "Software"),
9// to deal in the Software without restriction, including without limitation
10// the rights to use, copy, modify, merge, publish, distribute, sublicense,
11// and/or sell copies of the Software, and to permit persons to whom the
12// Software is furnished to do so, subject to the following conditions:
13//
14// The above copyright notice and this permission notice shall be included in
15// all copies or substantial portions of the Software.
16//
17// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
18// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
19// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
20// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
21// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
22// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
23// DEALINGS IN THE SOFTWARE.
24
25// $Id: Theme.hh,v 1.23 2003/01/12 18:47:56 fluxgen Exp $
26
27#ifndef THEME_HH
28#define THEME_HH
29
30#include "DrawUtil.hh"
31#include "Font.hh"
32#include "Color.hh"
33#include "Texture.hh"
34
35#include <X11/Xlib.h>
36#include <X11/Xresource.h>
37
38#include <string>
39
40/// OBSOLETE
41/**
42 Main theme class, holds themes for
43 Window, slit, and the rootCommand, for a specific screen.
44*/
45class Theme {
46public:
47
48 Theme(Display *display, Window rootwindow, Colormap colormap,
49 int screennum, const char *filename, const char *rootcommand);
50 ~Theme();
51
52 typedef struct LabelStyle {
53 LabelStyle(const char *fontname="fixed"):font(fontname) { }
54
55 FbTk::Texture l_focus, l_unfocus,
56 t_focus, t_unfocus;
57 GC l_text_focus_gc, l_text_unfocus_gc;
58 FbTk::Font font;
59 DrawUtil::Font::FontJustify justify;
60 FbTk::Color l_text_focus, l_text_unfocus;
61 } LabelStyle;
62
63
64 typedef struct WindowStyle:public LabelStyle {
65 FbTk::Color f_focus, f_unfocus, b_pic_focus,
66 b_pic_unfocus;
67 FbTk::Texture h_focus, h_unfocus,
68 b_focus, b_unfocus, b_pressed, g_focus, g_unfocus;
69 GC b_pic_focus_gc, b_pic_unfocus_gc;
70
71 struct t_tab:public LabelStyle {
72 FbTk::Color border_color;
73 unsigned int border_width;
74 unsigned int border_width_2x;
75 } tab;
76
77 } WindowStyle;
78
79 inline WindowStyle &getWindowStyle() { return m_windowstyle; }
80 inline const FbTk::Texture &getSlitTexture() const { return m_slit_texture; }
81 inline unsigned int getBevelWidth() const { return m_bevel_width; }
82 inline unsigned int getBorderWidth() const { return m_border_width; }
83 inline unsigned int getHandleWidth() const { return m_handle_width; }
84 inline unsigned int getFrameWidth() const { return m_frame_width; }
85 inline GC getOpGC() const { return m_opgc; }
86 inline const FbTk::Color &getBorderColor() const { return m_border_color; }
87 void load(const char *filename);
88 void reconfigure(bool antialias = false);
89
90 inline void setRootCommand(const std::string &command) { m_rootcommand = command; }
91
92
93
94private:
95
96 void loadWindowStyle();
97 void loadTabStyle();
98 void loadRootCommand();
99 void loadMisc();
100 void freeWindowStyle();
101 void freeTabStyle();
102
103 void loadFontFromDatabase(FbTk::Font &dest, const char *name, const char *altname);
104 bool readDatabaseTexture(char *, char *, FbTk::Texture *, unsigned long);
105 bool readDatabaseColor(char *, char *, FbTk::Color *, unsigned long);
106
107 void readDatabaseFontSet(char *, char *, XFontSet *);
108 XFontSet createFontSet(char *);
109 void readDatabaseFont(char *, char *, XFontStruct **);
110
111 static const char *getFontElement(const char *pattern, char *buf, int bufsiz, ...);
112 static const char *getFontSize(const char *pattern, int *size);
113
114
115 WindowStyle m_windowstyle;
116
117 unsigned int m_bevel_width, m_border_width, m_handle_width, m_frame_width;
118 FbTk::Color m_border_color;
119 GC m_opgc;
120 Display *m_display;
121 XrmDatabase m_database;
122 Colormap m_colormap;
123 int m_screennum;
124 std::string m_rootcommand;
125 FbTk::Texture m_slit_texture;
126};
127
128
129#endif //_THEME_HH_