From 6d9afb845384a72be3ff87c6c6b9a684100256dc Mon Sep 17 00:00:00 2001 From: fluxgen Date: Wed, 10 Sep 2003 21:27:02 +0000 Subject: no graphics exposure by default --- src/FbTk/GContext.cc | 21 ++++++++++++++++++--- src/FbTk/GContext.hh | 7 +++++-- 2 files changed, 23 insertions(+), 5 deletions(-) diff --git a/src/FbTk/GContext.cc b/src/FbTk/GContext.cc index 910e20f..3885a46 100644 --- a/src/FbTk/GContext.cc +++ b/src/FbTk/GContext.cc @@ -19,7 +19,7 @@ // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER // DEALINGS IN THE SOFTWARE. -// $Id: GContext.cc,v 1.1 2003/08/27 13:45:11 fluxgen Exp $ +// $Id: GContext.cc,v 1.2 2003/09/10 21:27:02 fluxgen Exp $ #include "GContext.hh" @@ -35,12 +35,14 @@ GContext::GContext(const FbTk::FbDrawable &drawable): m_gc(XCreateGC(FbTk::App::instance()->display(), drawable.drawable(), 0, 0)) { + setGraphicsExposure(false); } GContext::GContext(Drawable drawable): m_gc(XCreateGC(FbTk::App::instance()->display(), drawable, 0, 0)) { + setGraphicsExposure(false); } GContext::~GContext() { @@ -49,13 +51,21 @@ GContext::~GContext() { } void GContext::setForeground(const FbTk::Color &color) { + setForeground(color.pixel()); +} + +void GContext::setForeground(long pixel_value) { XSetForeground(FbTk::App::instance()->display(), m_gc, - color.pixel()); + pixel_value); } void GContext::setBackground(const FbTk::Color &color) { + setBackground(color.pixel()); +} + +void GContext::setBackground(long pixel_value) { XSetBackground(FbTk::App::instance()->display(), m_gc, - color.pixel()); + pixel_value); } /// not implemented! @@ -73,4 +83,9 @@ void GContext::setClipOrigin(int x, int y) { x, y); } +void GContext::setGraphicsExposure(bool flag) { + XSetGraphicsExposures(FbTk::App::instance()->display(), m_gc, + flag); +} + } // end namespace FbTk diff --git a/src/FbTk/GContext.hh b/src/FbTk/GContext.hh index 636c054..29e8f0d 100644 --- a/src/FbTk/GContext.hh +++ b/src/FbTk/GContext.hh @@ -19,7 +19,7 @@ // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER // DEALINGS IN THE SOFTWARE. -// $Id: GContext.hh,v 1.1 2003/08/27 13:45:11 fluxgen Exp $ +// $Id: GContext.hh,v 1.2 2003/09/10 21:27:02 fluxgen Exp $ #ifndef FBTK_GCONTEXT_HH #define FBTK_GCONTEXT_HH @@ -44,11 +44,14 @@ public: virtual ~GContext(); void setForeground(const FbTk::Color &color); + void setForeground(long pixel_value); void setBackground(const FbTk::Color &color); + void setBackground(long pixel_value); void setFont(const FbTk::Font &font); void setClipMask(const FbTk::FbPixmap &pm); void setClipOrigin(int x, int y); - + void setGraphicsExposure(bool value); + GC gc() const { return m_gc; } private: -- cgit v0.11.2