diff options
Diffstat (limited to 'src/DrawUtil.cc')
-rw-r--r-- | src/DrawUtil.cc | 20 |
1 files changed, 12 insertions, 8 deletions
diff --git a/src/DrawUtil.cc b/src/DrawUtil.cc index a276e48..1c29567 100644 --- a/src/DrawUtil.cc +++ b/src/DrawUtil.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: DrawUtil.cc,v 1.4 2002/01/09 14:11:20 fluxgen Exp $ | 22 | // $Id: DrawUtil.cc,v 1.5 2002/03/22 11:51:46 fluxgen Exp $ |
23 | 23 | ||
24 | #ifdef HAVE_CONFIG_H | 24 | #ifdef HAVE_CONFIG_H |
25 | # include "config.h" | 25 | # include "config.h" |
@@ -37,14 +37,16 @@ | |||
37 | 37 | ||
38 | using namespace std; | 38 | using namespace std; |
39 | 39 | ||
40 | namespace DrawUtil | ||
41 | { | ||
42 | |||
40 | // ---------------------------------------------------------------------- | 43 | // ---------------------------------------------------------------------- |
41 | // xvertext, Copyright (c) 1992 Alan Richardson (mppa3@uk.ac.sussex.syma) | 44 | // xvertext, Copyright (c) 1992 Alan Richardson (mppa3@uk.ac.sussex.syma) |
42 | // ---------------------------------------------------------------------- | 45 | // ---------------------------------------------------------------------- |
43 | |||
44 | //------- XRotLoadFont ------------------- | 46 | //------- XRotLoadFont ------------------- |
45 | // Load the rotated version of a given font | 47 | // Load the rotated version of a given font |
46 | //---------------------------------------- | 48 | //---------------------------------------- |
47 | DrawUtil::XRotFontStruct *DrawUtil::XRotLoadFont(Display *dpy, char *fontname, float angle) { | 49 | XRotFontStruct *XRotLoadFont(Display *dpy, char *fontname, float angle) { |
48 | char val; | 50 | char val; |
49 | XImage *I1, *I2; | 51 | XImage *I1, *I2; |
50 | Pixmap canvas; | 52 | Pixmap canvas; |
@@ -252,7 +254,7 @@ DrawUtil::XRotFontStruct *DrawUtil::XRotLoadFont(Display *dpy, char *fontname, f | |||
252 | // Free the resources associated with a | 254 | // Free the resources associated with a |
253 | // rotated font | 255 | // rotated font |
254 | //---------------------------------------- | 256 | //---------------------------------------- |
255 | void DrawUtil::XRotUnloadFont(Display *dpy, XRotFontStruct *rotfont) | 257 | void XRotUnloadFont(Display *dpy, XRotFontStruct *rotfont) |
256 | { | 258 | { |
257 | int ichar; | 259 | int ichar; |
258 | 260 | ||
@@ -272,7 +274,7 @@ void DrawUtil::XRotUnloadFont(Display *dpy, XRotFontStruct *rotfont) | |||
272 | //------- XRotTextWidth ------------------ | 274 | //------- XRotTextWidth ------------------ |
273 | // Returns the width of a rotated string | 275 | // Returns the width of a rotated string |
274 | //---------------------------------------- | 276 | //---------------------------------------- |
275 | unsigned int DrawUtil::XRotTextWidth(XRotFontStruct *rotfont, char *str, int len) | 277 | unsigned int XRotTextWidth(XRotFontStruct *rotfont, char *str, int len) |
276 | { | 278 | { |
277 | int i, width = 0, ichar; | 279 | int i, width = 0, ichar; |
278 | 280 | ||
@@ -297,7 +299,7 @@ unsigned int DrawUtil::XRotTextWidth(XRotFontStruct *rotfont, char *str, int len | |||
297 | //------- XRotDrawString ----------------- | 299 | //------- XRotDrawString ----------------- |
298 | // A front end to XRotDrawString : mimics XDrawString | 300 | // A front end to XRotDrawString : mimics XDrawString |
299 | //---------------------------------------- | 301 | //---------------------------------------- |
300 | void DrawUtil::XRotDrawString(Display *dpy, XRotFontStruct *rotfont, Drawable drawable, | 302 | void XRotDrawString(Display *dpy, XRotFontStruct *rotfont, Drawable drawable, |
301 | GC gc, int x, int y, char *str, int len) | 303 | GC gc, int x, int y, char *str, int len) |
302 | { | 304 | { |
303 | static GC my_gc = 0; | 305 | static GC my_gc = 0; |
@@ -364,7 +366,7 @@ void DrawUtil::XRotDrawString(Display *dpy, XRotFontStruct *rotfont, Drawable dr | |||
364 | 366 | ||
365 | 367 | ||
366 | //Draw title string | 368 | //Draw title string |
367 | void DrawUtil::DrawString(Display *display, Window w, GC gc, DrawUtil::Font *font, | 369 | void DrawString(Display *display, Window w, GC gc, DrawUtil::Font *font, |
368 | unsigned int text_w, unsigned int size_w, | 370 | unsigned int text_w, unsigned int size_w, |
369 | unsigned int bevel_w, char *text) { | 371 | unsigned int bevel_w, char *text) { |
370 | 372 | ||
@@ -425,7 +427,7 @@ void DrawUtil::DrawString(Display *display, Window w, GC gc, DrawUtil::Font *fon | |||
425 | } | 427 | } |
426 | 428 | ||
427 | 429 | ||
428 | void DrawUtil::DrawRotString(Display *display, Window w, GC gc, XRotFontStruct *font, | 430 | void DrawRotString(Display *display, Window w, GC gc, XRotFontStruct *font, |
429 | unsigned int align, unsigned int text_w, | 431 | unsigned int align, unsigned int text_w, |
430 | unsigned int size_w, unsigned int size_h, | 432 | unsigned int size_w, unsigned int size_h, |
431 | unsigned int bevel_w, char *text) { | 433 | unsigned int bevel_w, char *text) { |
@@ -465,3 +467,5 @@ void DrawUtil::DrawRotString(Display *display, Window w, GC gc, XRotFontStruct * | |||
465 | XClearWindow(display, w); | 467 | XClearWindow(display, w); |
466 | XRotDrawString(display, font, w, gc, size_w, size_h, text, dlen); | 468 | XRotDrawString(display, font, w, gc, size_w, size_h, text, dlen); |
467 | } | 469 | } |
470 | |||
471 | }; //end namespace DrawUtil | ||