using FbTk GContext

This commit is contained in:
fluxgen 2003-09-12 21:34:22 +00:00
parent b0b517b70c
commit 00514c3f08
2 changed files with 13 additions and 16 deletions

View file

@ -19,7 +19,7 @@
// 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 @@ RootTheme::RootTheme(int screen_num, std::string &screen_root_command):
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() {

View file

@ -19,15 +19,17 @@
// 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 @@ public:
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