diff options
author | rathnor <rathnor> | 2003-10-09 16:48:09 (GMT) |
---|---|---|
committer | rathnor <rathnor> | 2003-10-09 16:48:09 (GMT) |
commit | 018665d7a3ae8cb642880176d415f57fc178c299 (patch) | |
tree | 05a21b11a9f28bd8b456e080be52148de30f5018 /src/FbTk/GContext.cc | |
parent | 075dc35b5eeb875e971842e8230338395367e08f (diff) | |
download | fluxbox-018665d7a3ae8cb642880176d415f57fc178c299.zip fluxbox-018665d7a3ae8cb642880176d415f57fc178c299.tar.bz2 |
drawing optimisations and fixes
Diffstat (limited to 'src/FbTk/GContext.cc')
-rw-r--r-- | src/FbTk/GContext.cc | 64 |
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 @@ | |||
32 | namespace FbTk { | 32 | namespace FbTk { |
33 | 33 | ||
34 | GContext::GContext(const FbTk::FbDrawable &drawable): | 34 | GContext::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 | ||
41 | GContext::GContext(Drawable drawable): | 42 | GContext::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 | ||
48 | GContext::~GContext() { | 51 | GContext::~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 | |||
53 | void GContext::setForeground(const FbTk::Color &color) { | ||
54 | setForeground(color.pixel()); | ||
55 | } | ||
56 | |||
57 | void GContext::setForeground(long pixel_value) { | ||
58 | XSetForeground(FbTk::App::instance()->display(), m_gc, | ||
59 | pixel_value); | ||
60 | } | ||
61 | |||
62 | void GContext::setBackground(const FbTk::Color &color) { | ||
63 | setBackground(color.pixel()); | ||
64 | } | ||
65 | |||
66 | void 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! |
72 | void GContext::setFont(const FbTk::Font &font) { | 57 | //void GContext::setFont(const FbTk::Font &font) { |
73 | //!! TODO | 58 | //!! TODO |
74 | } | 59 | //} |
75 | |||
76 | void GContext::setFont(int fid) { | ||
77 | XSetFont(FbTk::App::instance()->display(), m_gc, fid); | ||
78 | } | ||
79 | void GContext::setClipMask(const FbTk::FbPixmap &mask) { | ||
80 | XSetClipMask(FbTk::App::instance()->display(), m_gc, | ||
81 | mask.drawable()); | ||
82 | } | ||
83 | |||
84 | void GContext::setClipOrigin(int x, int y) { | ||
85 | XSetClipOrigin(FbTk::App::instance()->display(), m_gc, | ||
86 | x, y); | ||
87 | } | ||
88 | |||
89 | void GContext::setGraphicsExposure(bool flag) { | ||
90 | XSetGraphicsExposures(FbTk::App::instance()->display(), m_gc, | ||
91 | flag); | ||
92 | } | ||
93 | |||
94 | void GContext::setFunction(int func) { | ||
95 | XSetFunction(FbTk::App::instance()->display(), m_gc, | ||
96 | func); | ||
97 | } | ||
98 | |||
99 | void 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 |