aboutsummaryrefslogtreecommitdiff
path: root/src/FbWinFrameTheme.cc
diff options
context:
space:
mode:
authorfluxgen <fluxgen>2003-01-05 22:14:10 (GMT)
committerfluxgen <fluxgen>2003-01-05 22:14:10 (GMT)
commit4484d326807c6e1cf4ec6b6beeb099eab979723e (patch)
tree1fd6409e60fab3c9b80b3720445af27f020d8107 /src/FbWinFrameTheme.cc
parente3071d20356ddafea8cf7047bd0556fc4b74ba47 (diff)
downloadfluxbox-4484d326807c6e1cf4ec6b6beeb099eab979723e.zip
fluxbox-4484d326807c6e1cf4ec6b6beeb099eab979723e.tar.bz2
frame handling
Diffstat (limited to 'src/FbWinFrameTheme.cc')
-rw-r--r--src/FbWinFrameTheme.cc85
1 files changed, 85 insertions, 0 deletions
diff --git a/src/FbWinFrameTheme.cc b/src/FbWinFrameTheme.cc
new file mode 100644
index 0000000..8fc562f
--- /dev/null
+++ b/src/FbWinFrameTheme.cc
@@ -0,0 +1,85 @@
1// FbWinFrameTheme.cc for Fluxbox Window Manager
2// Copyright (c) 2003 Henrik Kinnunen (fluxgen at users.sourceforge.net)
3//
4// Permission is hereby granted, free of charge, to any person obtaining a
5// copy of this software and associated documentation files (the "Software"),
6// to deal in the Software without restriction, including without limitation
7// the rights to use, copy, modify, merge, publish, distribute, sublicense,
8// and/or sell copies of the Software, and to permit persons to whom the
9// Software is furnished to do so, subject to the following conditions:
10//
11// The above copyright notice and this permission notice shall be included in
12// all copies or substantial portions of the Software.
13//
14// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
15// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
16// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
17// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
18// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
19// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
20// DEALINGS IN THE SOFTWARE.
21
22// $Id: FbWinFrameTheme.cc,v 1.1 2003/01/05 22:14:10 fluxgen Exp $
23
24#include "FbWinFrameTheme.hh"
25#include "App.hh"
26
27#include <iostream>
28
29FbWinFrameTheme::FbWinFrameTheme(int screen_num):
30 FbTk::Theme(screen_num),
31 m_label_focus(*this, "window.label.focus", "Window.Label.Focus"),
32 m_label_unfocus(*this, "window.label.unfocus", "Window.Label.Unfocus"),
33
34 m_title_focus(*this, "window.title.focus", "Window.Title.Focus"),
35 m_title_unfocus(*this, "window.title.unfocus", "Window.Title.Unfocus"),
36
37 m_handle_focus(*this, "window.handle.focus", "Window.Handle.Focus"),
38 m_handle_unfocus(*this, "window.handle.unfocus", "Window.Handle.Unfocus"),
39
40 m_button_focus(*this, "window.button.focus", "Window.Button.Focus"),
41 m_button_unfocus(*this, "window.button.unfocus", "Window.Button.Unfocus"),
42 m_button_pressed(*this, "window.button.pressed", "Window.Button.Pressed"),
43
44 m_grip_focus(*this, "window.grip.focus", "Window.Grip.Focus"),
45 m_grip_unfocus(*this, "window.grip.unfocus", "Window.Grip.Unfocus"),
46
47 m_label_focus_color(*this, "window.label.focus.textColor", "Window.Label.Focus.TextColor"),
48 m_label_unfocus_color(*this, "window.label.unfocus.textColor", "Window.Label.Unfocus.TextColor"),
49
50 m_frame_focus_color(*this, "window.frame.focusColor", "Window.Frame.FocusColor"),
51 m_frame_unfocus_color(*this, "window.frame.unfocusColor", "Window.Frame.UnfocusColor"),
52
53 m_button_focus_color(*this, "window.button.focus.picColor", "Window.Button.Focus.PicColor"),
54 m_button_unfocus_color(*this, "window.button.unfocus.picColor", "Window.Button.Unfocus.PicColor"),
55
56 m_font(*this, "window.font", "Window.Font"),
57 m_textjustify(*this, "window.justify", "Window.Justify") {
58 // create GCs
59 Display *disp = FbTk::App::instance()->display();
60 Window rootwin = RootWindow(disp, screen_num);
61 m_label_text_focus_gc = XCreateGC(disp, rootwin, 0, 0);
62 m_label_text_unfocus_gc = XCreateGC(disp, rootwin, 0, 0);
63
64}
65
66FbWinFrameTheme::~FbWinFrameTheme() {
67 // destroy GCs
68 Display *disp = FbTk::App::instance()->display();
69 XFreeGC(disp, m_label_text_focus_gc);
70 XFreeGC(disp, m_label_text_unfocus_gc);
71}
72
73void FbWinFrameTheme::reconfigTheme() {
74
75 XGCValues gcv;
76 unsigned long gc_value_mask = GCForeground;
77 Display *disp = FbTk::App::instance()->display();
78
79 gcv.foreground = m_label_focus_color->pixel();
80 XChangeGC(disp, m_label_text_focus_gc, gc_value_mask, &gcv);
81
82 gcv.foreground = m_label_unfocus_color->pixel();
83 XChangeGC(disp, m_label_text_unfocus_gc, gc_value_mask, &gcv);
84}
85