aboutsummaryrefslogtreecommitdiff
path: root/src/DrawUtil.hh
diff options
context:
space:
mode:
Diffstat (limited to 'src/DrawUtil.hh')
-rw-r--r--src/DrawUtil.hh91
1 files changed, 91 insertions, 0 deletions
diff --git a/src/DrawUtil.hh b/src/DrawUtil.hh
new file mode 100644
index 0000000..d866961
--- /dev/null
+++ b/src/DrawUtil.hh
@@ -0,0 +1,91 @@
1// DrawUtil.hh for fluxbox
2// Copyright (c) 2001-2002 Henrik Kinnunen (fluxgen@linuxmail.org)
3//
4// Permission is hereby granted, free of charge, to any person obtaining a
5// copy of this software and associated documentation files (the "Software"),
6// to deal in the Software without restriction, including without limitation
7// the rights to use, copy, modify, merge, publish, distribute, sublicense,
8// and/or sell copies of the Software, and to permit persons to whom the
9// Software is furnished to do so, subject to the following conditions:
10//
11// The above copyright notice and this permission notice shall be included in
12// all copies or substantial portions of the Software.
13//
14// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
15// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
16// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
17// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
18// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
19// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
20// DEALINGS IN THE SOFTWARE.
21
22// $Id: DrawUtil.hh,v 1.7 2002/11/12 22:44:17 fluxgen Exp $
23
24#ifndef DRAWUTIL_HH
25#define DRAWUTIL_HH
26
27#include <X11/Xlib.h>
28
29namespace DrawUtil
30{
31 // note: obsolete!
32 struct Font {
33 enum FontJustify {LEFT=0, RIGHT, CENTER};
34
35 XFontSet set;
36 XFontSetExtents *set_extents;
37 XFontStruct *fontstruct;
38 FontJustify justify;
39 };
40
41// ----------------------------------------------------------------------
42// xvertext, Copyright (c) 1992 Alan Richardson (mppa3@uk.ac.sussex.syma)
43// ----------------------------------------------------------------------
44
45 /* *** The font structures *** */
46
47 struct BitmapStruct {
48 int bit_w;
49 int bit_h;
50
51 Pixmap bm;
52 };
53
54 struct XRotCharStruct {
55 int ascent;
56 int descent;
57 int lbearing;
58 int rbearing;
59 int width;
60
61 BitmapStruct glyph;
62 };
63
64 struct XRotFontStruct {
65 int dir;
66 int height;
67 int max_ascent;
68 int max_descent;
69 int max_char;
70 int min_char;
71 char *name;
72
73 XFontStruct *xfontstruct;
74
75 DrawUtil::XRotCharStruct per_char[95];
76 };
77unsigned int XRotTextWidth(DrawUtil::XRotFontStruct *rotfont, const char *str, int len);
78void XRotDrawString(Display *dpy, DrawUtil::XRotFontStruct *rotfont, Drawable drawable,
79 GC gc, int x, int y, const char *str, int len);
80
81void DrawRotString(Display *display, Window w, GC gc, DrawUtil::XRotFontStruct *font,
82 unsigned int align, unsigned int text_w,
83 unsigned int size_w, unsigned int size_h,
84 unsigned int bevel_w, const char *text);
85
86DrawUtil::XRotFontStruct *XRotLoadFont(Display *dpy, char *fontname, float angle);
87void XRotUnloadFont(Display *dpy, DrawUtil::XRotFontStruct *rotfont);
88
89}; //end namespace DrawUtil
90
91#endif //DRAWUTIL_HH