diff options
author | fluxgen <fluxgen> | 2003-04-26 15:21:38 (GMT) |
---|---|---|
committer | fluxgen <fluxgen> | 2003-04-26 15:21:38 (GMT) |
commit | d3daeff47ade0fcd8f4768f5a15fae4012ec9ea8 (patch) | |
tree | fb127b24671805879cef2c06403c7c3395c129bf | |
parent | a26d408964032adec3d4153dc642c5fdf28fb89d (diff) | |
download | fluxbox-d3daeff47ade0fcd8f4768f5a15fae4012ec9ea8.zip fluxbox-d3daeff47ade0fcd8f4768f5a15fae4012ec9ea8.tar.bz2 |
obsolete
-rw-r--r-- | src/DrawUtil.cc | 61 | ||||
-rw-r--r-- | src/DrawUtil.hh | 45 |
2 files changed, 0 insertions, 106 deletions
diff --git a/src/DrawUtil.cc b/src/DrawUtil.cc deleted file mode 100644 index 46ce8d9..0000000 --- a/src/DrawUtil.cc +++ /dev/null | |||
@@ -1,61 +0,0 @@ | |||
1 | // DrawUtil.cc 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.cc,v 1.11 2002/12/01 13:41:55 rathnor Exp $ | ||
23 | |||
24 | #include "DrawUtil.hh" | ||
25 | |||
26 | namespace DrawUtil { | ||
27 | |||
28 | int doAlignment(int max_width, int bevel, Font::FontJustify justify, | ||
29 | const FbTk::Font &font, const char * const text, size_t textlen, size_t &newlen) { | ||
30 | |||
31 | if (text == 0 || textlen == 0) | ||
32 | return 0; | ||
33 | |||
34 | int l = font.textWidth(text, textlen) + bevel; | ||
35 | size_t dlen = textlen; | ||
36 | int dx = bevel; | ||
37 | if (l > max_width) { | ||
38 | for (; dlen > 0; dlen--) { | ||
39 | l = font.textWidth(text, dlen) + bevel; | ||
40 | if (l<=max_width) | ||
41 | break; | ||
42 | } | ||
43 | } | ||
44 | |||
45 | newlen = dlen; | ||
46 | |||
47 | switch (justify) { | ||
48 | case DrawUtil::Font::RIGHT: | ||
49 | dx = max_width - l - bevel; | ||
50 | break; | ||
51 | case DrawUtil::Font::CENTER: | ||
52 | dx = (max_width - l)/2; | ||
53 | break; | ||
54 | case DrawUtil::Font::LEFT: | ||
55 | break; | ||
56 | } | ||
57 | |||
58 | return dx; | ||
59 | } | ||
60 | |||
61 | }; //end namespace DrawUtil | ||
diff --git a/src/DrawUtil.hh b/src/DrawUtil.hh deleted file mode 100644 index c388627..0000000 --- a/src/DrawUtil.hh +++ /dev/null | |||
@@ -1,45 +0,0 @@ | |||
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.10 2002/12/01 13:41:55 rathnor Exp $ | ||
23 | |||
24 | #ifndef DRAWUTIL_HH | ||
25 | #define DRAWUTIL_HH | ||
26 | |||
27 | #include <X11/Xlib.h> | ||
28 | #include "Font.hh" | ||
29 | |||
30 | namespace DrawUtil { | ||
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 | int doAlignment(int max_width, int bevel, Font::FontJustify justify, | ||
42 | const FbTk::Font &font, const char * const text, size_t textlen, size_t &newlen); | ||
43 | }; //end namespace DrawUtil | ||
44 | |||
45 | #endif //DRAWUTIL_HH | ||