From 3b9f04d4405abe242f4d198342d50f497d3475b3 Mon Sep 17 00:00:00 2001 From: fluxgen Date: Thu, 11 Sep 2003 19:57:38 +0000 Subject: added font, function and subwindow mode --- src/FbTk/GContext.cc | 20 +++++++++++++++++--- src/FbTk/GContext.hh | 9 +++++++-- 2 files changed, 24 insertions(+), 5 deletions(-) diff --git a/src/FbTk/GContext.cc b/src/FbTk/GContext.cc index 3885a46..f3fcaf4 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.2 2003/09/10 21:27:02 fluxgen Exp $ +// $Id: GContext.cc,v 1.3 2003/09/11 19:57:38 fluxgen Exp $ #include "GContext.hh" @@ -33,8 +33,8 @@ namespace FbTk { GContext::GContext(const FbTk::FbDrawable &drawable): m_gc(XCreateGC(FbTk::App::instance()->display(), - drawable.drawable(), - 0, 0)) { + drawable.drawable(), + 0, 0)) { setGraphicsExposure(false); } @@ -73,6 +73,9 @@ void GContext::setFont(const FbTk::Font &font) { //!! TODO } +void GContext::setFont(int fid) { + XSetFont(FbTk::App::instance()->display(), m_gc, fid); +} void GContext::setClipMask(const FbTk::FbPixmap &mask) { XSetClipMask(FbTk::App::instance()->display(), m_gc, mask.drawable()); @@ -88,4 +91,15 @@ void GContext::setGraphicsExposure(bool flag) { flag); } +void GContext::setFunction(int func) { + XSetFunction(FbTk::App::instance()->display(), m_gc, + func); +} + +void GContext::setSubwindowMode(int mode) { + XSetSubwindowMode(FbTk::App::instance()->display(), m_gc, + mode); +} + + } // end namespace FbTk diff --git a/src/FbTk/GContext.hh b/src/FbTk/GContext.hh index 29e8f0d..6175b2d 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.2 2003/09/10 21:27:02 fluxgen Exp $ +// $Id: GContext.hh,v 1.3 2003/09/11 19:57:38 fluxgen Exp $ #ifndef FBTK_GCONTEXT_HH #define FBTK_GCONTEXT_HH @@ -47,11 +47,16 @@ public: void setForeground(long pixel_value); void setBackground(const FbTk::Color &color); void setBackground(long pixel_value); + /// not implemented void setFont(const FbTk::Font &font); + /// set font id + void setFont(int fid); void setClipMask(const FbTk::FbPixmap &pm); void setClipOrigin(int x, int y); void setGraphicsExposure(bool value); - + void setFunction(int func); + void setSubwindowMode(int mode); + GC gc() const { return m_gc; } private: -- cgit v0.11.2