summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorfluxgen <fluxgen>2003-09-12 21:34:22 (GMT)
committerfluxgen <fluxgen>2003-09-12 21:34:22 (GMT)
commit00514c3f0859a147158ddc7efbb952c0b50a3bb0 (patch)
treef201f7802fb5ed2cc51fc1c8387f57bc957fe3d1 /src
parentb0b517b70c183d5ab6ffc3a49763bb0267be5d6a (diff)
downloadfluxbox_lack-00514c3f0859a147158ddc7efbb952c0b50a3bb0.zip
fluxbox_lack-00514c3f0859a147158ddc7efbb952c0b50a3bb0.tar.bz2
using FbTk GContext
Diffstat (limited to 'src')
-rw-r--r--src/RootTheme.cc19
-rw-r--r--src/RootTheme.hh10
2 files changed, 13 insertions, 16 deletions
diff --git a/src/RootTheme.cc b/src/RootTheme.cc
index f3695dd..6e489e1 100644
--- a/src/RootTheme.cc
+++ b/src/RootTheme.cc
@@ -19,7 +19,7 @@
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: RootTheme.cc,v 1.4 2003/08/25 16:02:24 fluxgen Exp $ 22// $Id: RootTheme.cc,v 1.5 2003/09/12 21:34:22 fluxgen Exp $
23 23
24#include "RootTheme.hh" 24#include "RootTheme.hh"
25 25
@@ -31,24 +31,19 @@ RootTheme::RootTheme(int screen_num, std::string &screen_root_command):
31 m_root_command(*this, "rootCommand", "RootCommand"), 31 m_root_command(*this, "rootCommand", "RootCommand"),
32 m_bevel_width(*this, "bevelWidth", "BevelWidth"), 32 m_bevel_width(*this, "bevelWidth", "BevelWidth"),
33 m_handle_width(*this, "handleWidth", "HandleWidth"), 33 m_handle_width(*this, "handleWidth", "HandleWidth"),
34 m_screen_root_command(screen_root_command) { 34 m_screen_root_command(screen_root_command),
35 m_opgc(RootWindow(FbTk::App::instance()->display(), screen_num)) {
35 36
36 *m_bevel_width = 0; 37 *m_bevel_width = 0;
37 *m_handle_width = 0; 38 *m_handle_width = 0;
38
39 XGCValues gcv;
40 Display *disp = FbTk::App::instance()->display(); 39 Display *disp = FbTk::App::instance()->display();
41 gcv.foreground = WhitePixel(disp, screen_num)^BlackPixel(disp, screen_num); 40 m_opgc.setForeground(WhitePixel(disp, screen_num)^BlackPixel(disp, screen_num));
42 gcv.function = GXxor; 41 m_opgc.setFunction(GXxor);
43 gcv.subwindow_mode = IncludeInferiors; 42 m_opgc.setSubwindowMode(IncludeInferiors);
44 m_opgc = XCreateGC(disp,
45 RootWindow(disp, screen_num),
46 GCForeground | GCFunction | GCSubwindowMode, &gcv);
47} 43}
48 44
49RootTheme::~RootTheme() { 45RootTheme::~RootTheme() {
50 if (m_opgc != 0) 46
51 XFreeGC(FbTk::App::instance()->display(), m_opgc);
52} 47}
53 48
54void RootTheme::reconfigTheme() { 49void RootTheme::reconfigTheme() {
diff --git a/src/RootTheme.hh b/src/RootTheme.hh
index 9d6cc4f..a23e439 100644
--- a/src/RootTheme.hh
+++ b/src/RootTheme.hh
@@ -19,15 +19,17 @@
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: RootTheme.hh,v 1.3 2003/08/25 16:02:24 fluxgen Exp $ 22// $Id: RootTheme.hh,v 1.4 2003/09/12 21:34:22 fluxgen Exp $
23 23
24#ifndef ROOTTHEME_HH 24#ifndef ROOTTHEME_HH
25#define ROOTTHEME_HH 25#define ROOTTHEME_HH
26 26
27#include "FbTk/Theme.hh" 27#include "FbTk/Theme.hh"
28#include "Color.hh" 28#include "FbTk/Color.hh"
29#include "FbTk/GContext.hh"
29 30
30#include <X11/Xlib.h> 31#include <X11/Xlib.h>
32
31#include <string> 33#include <string>
32 34
33 35
@@ -44,13 +46,13 @@ public:
44 46
45 int bevelWidth() const { return *m_bevel_width; } 47 int bevelWidth() const { return *m_bevel_width; }
46 int handleWidth() const { return *m_handle_width; } 48 int handleWidth() const { return *m_handle_width; }
47 GC opGC() const { return m_opgc; } 49 GC opGC() const { return m_opgc.gc(); }
48 50
49private: 51private:
50 FbTk::ThemeItem<std::string> m_root_command; 52 FbTk::ThemeItem<std::string> m_root_command;
51 FbTk::ThemeItem<int> m_bevel_width, m_handle_width; 53 FbTk::ThemeItem<int> m_bevel_width, m_handle_width;
52 std::string &m_screen_root_command; ///< string to execute and override theme rootCommand 54 std::string &m_screen_root_command; ///< string to execute and override theme rootCommand
53 GC m_opgc; 55 FbTk::GContext m_opgc;
54}; 56};
55 57
56#endif // ROOTTHEME_HH 58#endif // ROOTTHEME_HH