diff options
Diffstat (limited to 'src/FbTk/GContext.cc')
-rw-r--r-- | src/FbTk/GContext.cc | 21 |
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 | ||
40 | GContext::GContext(Drawable drawable): | 41 | GContext::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 | ||
46 | GContext::~GContext() { | 48 | GContext::~GContext() { |
@@ -49,13 +51,21 @@ GContext::~GContext() { | |||
49 | } | 51 | } |
50 | 52 | ||
51 | void GContext::setForeground(const FbTk::Color &color) { | 53 | void GContext::setForeground(const FbTk::Color &color) { |
54 | setForeground(color.pixel()); | ||
55 | } | ||
56 | |||
57 | void 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 | ||
56 | void GContext::setBackground(const FbTk::Color &color) { | 62 | void GContext::setBackground(const FbTk::Color &color) { |
63 | setBackground(color.pixel()); | ||
64 | } | ||
65 | |||
66 | void 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 | ||
86 | void GContext::setGraphicsExposure(bool flag) { | ||
87 | XSetGraphicsExposures(FbTk::App::instance()->display(), m_gc, | ||
88 | flag); | ||
89 | } | ||
90 | |||
76 | } // end namespace FbTk | 91 | } // end namespace FbTk |