using FbTk GContext
fluxgen fluxgen
2 files changed,
13 insertions(+),
16 deletions(-)
M
src/RootTheme.cc
→
src/RootTheme.cc
@@ -19,7 +19,7 @@ // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER // DEALINGS IN THE SOFTWARE. -// $Id: RootTheme.cc,v 1.4 2003/08/25 16:02:24 fluxgen Exp $ +// $Id: RootTheme.cc,v 1.5 2003/09/12 21:34:22 fluxgen Exp $ #include "RootTheme.hh"@@ -31,24 +31,19 @@ FbTk::Theme(screen_num),
m_root_command(*this, "rootCommand", "RootCommand"), m_bevel_width(*this, "bevelWidth", "BevelWidth"), m_handle_width(*this, "handleWidth", "HandleWidth"), - m_screen_root_command(screen_root_command) { + m_screen_root_command(screen_root_command), + m_opgc(RootWindow(FbTk::App::instance()->display(), screen_num)) { *m_bevel_width = 0; *m_handle_width = 0; - - XGCValues gcv; Display *disp = FbTk::App::instance()->display(); - gcv.foreground = WhitePixel(disp, screen_num)^BlackPixel(disp, screen_num); - gcv.function = GXxor; - gcv.subwindow_mode = IncludeInferiors; - m_opgc = XCreateGC(disp, - RootWindow(disp, screen_num), - GCForeground | GCFunction | GCSubwindowMode, &gcv); + m_opgc.setForeground(WhitePixel(disp, screen_num)^BlackPixel(disp, screen_num)); + m_opgc.setFunction(GXxor); + m_opgc.setSubwindowMode(IncludeInferiors); } RootTheme::~RootTheme() { - if (m_opgc != 0) - XFreeGC(FbTk::App::instance()->display(), m_opgc); + } void RootTheme::reconfigTheme() {
M
src/RootTheme.hh
→
src/RootTheme.hh
@@ -19,15 +19,17 @@ // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER // DEALINGS IN THE SOFTWARE. -// $Id: RootTheme.hh,v 1.3 2003/08/25 16:02:24 fluxgen Exp $ +// $Id: RootTheme.hh,v 1.4 2003/09/12 21:34:22 fluxgen Exp $ #ifndef ROOTTHEME_HH #define ROOTTHEME_HH #include "FbTk/Theme.hh" -#include "Color.hh" +#include "FbTk/Color.hh" +#include "FbTk/GContext.hh" #include <X11/Xlib.h> + #include <string>@@ -44,13 +46,13 @@ void reconfigTheme();
int bevelWidth() const { return *m_bevel_width; } int handleWidth() const { return *m_handle_width; } - GC opGC() const { return m_opgc; } + GC opGC() const { return m_opgc.gc(); } private: FbTk::ThemeItem<std::string> m_root_command; FbTk::ThemeItem<int> m_bevel_width, m_handle_width; std::string &m_screen_root_command; ///< string to execute and override theme rootCommand - GC m_opgc; + FbTk::GContext m_opgc; }; #endif // ROOTTHEME_HH