aboutsummaryrefslogtreecommitdiff
path: root/src/FbTk/GContext.cc
diff options
context:
space:
mode:
Diffstat (limited to 'src/FbTk/GContext.cc')
-rw-r--r--src/FbTk/GContext.cc21
1 files changed, 18 insertions, 3 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 @@
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: GContext.cc,v 1.1 2003/08/27 13:45:11 fluxgen Exp $ 22// $Id: GContext.cc,v 1.2 2003/09/10 21:27:02 fluxgen Exp $
23 23
24#include "GContext.hh" 24#include "GContext.hh"
25 25
@@ -35,12 +35,14 @@ GContext::GContext(const FbTk::FbDrawable &drawable):
35 m_gc(XCreateGC(FbTk::App::instance()->display(), 35 m_gc(XCreateGC(FbTk::App::instance()->display(),
36 drawable.drawable(), 36 drawable.drawable(),
37 0, 0)) { 37 0, 0)) {
38 setGraphicsExposure(false);
38} 39}
39 40
40GContext::GContext(Drawable drawable): 41GContext::GContext(Drawable drawable):
41 m_gc(XCreateGC(FbTk::App::instance()->display(), 42 m_gc(XCreateGC(FbTk::App::instance()->display(),
42 drawable, 43 drawable,
43 0, 0)) { 44 0, 0)) {
45 setGraphicsExposure(false);
44} 46}
45 47
46GContext::~GContext() { 48GContext::~GContext() {
@@ -49,13 +51,21 @@ GContext::~GContext() {
49} 51}
50 52
51void GContext::setForeground(const FbTk::Color &color) { 53void GContext::setForeground(const FbTk::Color &color) {
54 setForeground(color.pixel());
55}
56
57void GContext::setForeground(long pixel_value) {
52 XSetForeground(FbTk::App::instance()->display(), m_gc, 58 XSetForeground(FbTk::App::instance()->display(), m_gc,
53 color.pixel()); 59 pixel_value);
54} 60}
55 61
56void GContext::setBackground(const FbTk::Color &color) { 62void GContext::setBackground(const FbTk::Color &color) {
63 setBackground(color.pixel());
64}
65
66void GContext::setBackground(long pixel_value) {
57 XSetBackground(FbTk::App::instance()->display(), m_gc, 67 XSetBackground(FbTk::App::instance()->display(), m_gc,
58 color.pixel()); 68 pixel_value);
59} 69}
60 70
61/// not implemented! 71/// not implemented!
@@ -73,4 +83,9 @@ void GContext::setClipOrigin(int x, int y) {
73 x, y); 83 x, y);
74} 84}
75 85
86void GContext::setGraphicsExposure(bool flag) {
87 XSetGraphicsExposures(FbTk::App::instance()->display(), m_gc,
88 flag);
89}
90
76} // end namespace FbTk 91} // end namespace FbTk