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.cc64
1 files changed, 10 insertions, 54 deletions
diff --git a/src/FbTk/GContext.cc b/src/FbTk/GContext.cc
index f3fcaf4..6b41726 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.3 2003/09/11 19:57:38 fluxgen Exp $ 22// $Id: GContext.cc,v 1.4 2003/10/09 16:48:09 rathnor Exp $
23 23
24#include "GContext.hh" 24#include "GContext.hh"
25 25
@@ -32,74 +32,30 @@
32namespace FbTk { 32namespace FbTk {
33 33
34GContext::GContext(const FbTk::FbDrawable &drawable): 34GContext::GContext(const FbTk::FbDrawable &drawable):
35 m_gc(XCreateGC(FbTk::App::instance()->display(), 35 m_display(FbTk::App::instance()->display()),
36 m_gc(XCreateGC(m_display,
36 drawable.drawable(), 37 drawable.drawable(),
37 0, 0)) { 38 0, 0)) {
38 setGraphicsExposure(false); 39 setGraphicsExposure(false);
39} 40}
40 41
41GContext::GContext(Drawable drawable): 42GContext::GContext(Drawable drawable):
42 m_gc(XCreateGC(FbTk::App::instance()->display(), 43 m_display(FbTk::App::instance()->display()),
44 m_gc(XCreateGC(m_display,
43 drawable, 45 drawable,
44 0, 0)) { 46 0, 0))
47{
45 setGraphicsExposure(false); 48 setGraphicsExposure(false);
46} 49}
47 50
48GContext::~GContext() { 51GContext::~GContext() {
49 if (m_gc) 52 if (m_gc)
50 XFreeGC(FbTk::App::instance()->display(), m_gc); 53 XFreeGC(m_display, m_gc);
51}
52
53void GContext::setForeground(const FbTk::Color &color) {
54 setForeground(color.pixel());
55}
56
57void GContext::setForeground(long pixel_value) {
58 XSetForeground(FbTk::App::instance()->display(), m_gc,
59 pixel_value);
60}
61
62void GContext::setBackground(const FbTk::Color &color) {
63 setBackground(color.pixel());
64}
65
66void GContext::setBackground(long pixel_value) {
67 XSetBackground(FbTk::App::instance()->display(), m_gc,
68 pixel_value);
69} 54}
70 55
71/// not implemented! 56/// not implemented!
72void GContext::setFont(const FbTk::Font &font) { 57//void GContext::setFont(const FbTk::Font &font) {
73 //!! TODO 58 //!! TODO
74} 59//}
75
76void GContext::setFont(int fid) {
77 XSetFont(FbTk::App::instance()->display(), m_gc, fid);
78}
79void GContext::setClipMask(const FbTk::FbPixmap &mask) {
80 XSetClipMask(FbTk::App::instance()->display(), m_gc,
81 mask.drawable());
82}
83
84void GContext::setClipOrigin(int x, int y) {
85 XSetClipOrigin(FbTk::App::instance()->display(), m_gc,
86 x, y);
87}
88
89void GContext::setGraphicsExposure(bool flag) {
90 XSetGraphicsExposures(FbTk::App::instance()->display(), m_gc,
91 flag);
92}
93
94void GContext::setFunction(int func) {
95 XSetFunction(FbTk::App::instance()->display(), m_gc,
96 func);
97}
98
99void GContext::setSubwindowMode(int mode) {
100 XSetSubwindowMode(FbTk::App::instance()->display(), m_gc,
101 mode);
102}
103
104 60
105} // end namespace FbTk 61} // end namespace FbTk