diff options
Diffstat (limited to 'src/FbWinFrameTheme.cc')
-rw-r--r-- | src/FbWinFrameTheme.cc | 42 |
1 files changed, 12 insertions, 30 deletions
diff --git a/src/FbWinFrameTheme.cc b/src/FbWinFrameTheme.cc index 37c7898..7f6720b 100644 --- a/src/FbWinFrameTheme.cc +++ b/src/FbWinFrameTheme.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: FbWinFrameTheme.cc,v 1.10 2003/08/25 16:37:50 fluxgen Exp $ | 22 | // $Id: FbWinFrameTheme.cc,v 1.11 2003/08/27 17:52:08 fluxgen Exp $ |
23 | 23 | ||
24 | #include "FbWinFrameTheme.hh" | 24 | #include "FbWinFrameTheme.hh" |
25 | #include "App.hh" | 25 | #include "App.hh" |
@@ -61,21 +61,19 @@ FbWinFrameTheme::FbWinFrameTheme(int screen_num): | |||
61 | 61 | ||
62 | m_alpha(*this, "window.alpha", "Window.Alpha"), | 62 | m_alpha(*this, "window.alpha", "Window.Alpha"), |
63 | m_title_height(*this, "window.title.height", "Window.Title.Height"), | 63 | m_title_height(*this, "window.title.height", "Window.Title.Height"), |
64 | m_border(*this, "window", "Window") { // for window.border* | 64 | m_border(*this, "window", "Window"), // for window.border* |
65 | m_label_text_focus_gc(RootWindow(FbTk::App::instance()->display(), screen_num)), | ||
66 | m_label_text_unfocus_gc(RootWindow(FbTk::App::instance()->display(), screen_num)), | ||
67 | m_button_pic_focus_gc(RootWindow(FbTk::App::instance()->display(), screen_num)), | ||
68 | m_button_pic_unfocus_gc(RootWindow(FbTk::App::instance()->display(), screen_num)) { | ||
65 | 69 | ||
66 | *m_title_height = 0; | 70 | *m_title_height = 0; |
67 | // set defaults | 71 | // set defaults |
68 | m_font->load("fixed"); | 72 | m_font->load("fixed"); |
69 | *m_alpha = 255; | 73 | *m_alpha = 255; |
70 | 74 | ||
71 | // create GCs | ||
72 | Display *disp = FbTk::App::instance()->display(); | ||
73 | Window rootwin = RootWindow(disp, screen_num); | ||
74 | m_label_text_focus_gc = XCreateGC(disp, rootwin, 0, 0); | ||
75 | m_label_text_unfocus_gc = XCreateGC(disp, rootwin, 0, 0); | ||
76 | m_button_pic_focus_gc = XCreateGC(disp, rootwin, 0, 0); | ||
77 | m_button_pic_unfocus_gc = XCreateGC(disp, rootwin, 0, 0); | ||
78 | // create cursors | 75 | // create cursors |
76 | Display *disp = FbTk::App::instance()->display(); | ||
79 | m_cursor_move = XCreateFontCursor(disp, XC_fleur); | 77 | m_cursor_move = XCreateFontCursor(disp, XC_fleur); |
80 | m_cursor_lower_left_angle = XCreateFontCursor(disp, XC_ll_angle); | 78 | m_cursor_lower_left_angle = XCreateFontCursor(disp, XC_ll_angle); |
81 | m_cursor_lower_right_angle = XCreateFontCursor(disp, XC_lr_angle); | 79 | m_cursor_lower_right_angle = XCreateFontCursor(disp, XC_lr_angle); |
@@ -83,12 +81,7 @@ FbWinFrameTheme::FbWinFrameTheme(int screen_num): | |||
83 | } | 81 | } |
84 | 82 | ||
85 | FbWinFrameTheme::~FbWinFrameTheme() { | 83 | FbWinFrameTheme::~FbWinFrameTheme() { |
86 | // destroy GCs | 84 | |
87 | Display *disp = FbTk::App::instance()->display(); | ||
88 | XFreeGC(disp, m_label_text_focus_gc); | ||
89 | XFreeGC(disp, m_label_text_unfocus_gc); | ||
90 | XFreeGC(disp, m_button_pic_focus_gc); | ||
91 | XFreeGC(disp, m_button_pic_unfocus_gc); | ||
92 | } | 85 | } |
93 | 86 | ||
94 | bool FbWinFrameTheme::fallback(FbTk::ThemeItem_base &item) { | 87 | bool FbWinFrameTheme::fallback(FbTk::ThemeItem_base &item) { |
@@ -106,21 +99,10 @@ void FbWinFrameTheme::reconfigTheme() { | |||
106 | else if (*m_alpha < 0) | 99 | else if (*m_alpha < 0) |
107 | *m_alpha = 0; | 100 | *m_alpha = 0; |
108 | 101 | ||
109 | XGCValues gcv; | 102 | m_label_text_focus_gc.setForeground(*m_label_focus_color); |
110 | unsigned long gc_value_mask = GCForeground; | 103 | m_label_text_unfocus_gc.setForeground(*m_label_unfocus_color); |
111 | Display *disp = FbTk::App::instance()->display(); | 104 | m_button_pic_focus_gc.setForeground(*m_button_focus_color); |
112 | 105 | m_button_pic_unfocus_gc.setForeground(*m_button_unfocus_color); | |
113 | gcv.foreground = m_label_focus_color->pixel(); | ||
114 | XChangeGC(disp, m_label_text_focus_gc, gc_value_mask, &gcv); | ||
115 | |||
116 | gcv.foreground = m_label_unfocus_color->pixel(); | ||
117 | XChangeGC(disp, m_label_text_unfocus_gc, gc_value_mask, &gcv); | ||
118 | |||
119 | gcv.foreground = m_button_focus_color->pixel(); | ||
120 | XChangeGC(disp, m_button_pic_focus_gc, gc_value_mask, &gcv); | ||
121 | |||
122 | gcv.foreground = m_button_unfocus_color->pixel(); | ||
123 | XChangeGC(disp, m_button_pic_unfocus_gc, gc_value_mask, &gcv); | ||
124 | 106 | ||
125 | // notify listeners | 107 | // notify listeners |
126 | m_theme_change.notify(); | 108 | m_theme_change.notify(); |