diff options
author | fluxgen <fluxgen> | 2002-11-12 22:44:17 (GMT) |
---|---|---|
committer | fluxgen <fluxgen> | 2002-11-12 22:44:17 (GMT) |
commit | d53d9eaa318eb0b498feb3a3fe39cbfa64fe0797 (patch) | |
tree | 4d7d2631cc15151fc83ccafb072441171b8b5750 /src/DrawUtil.cc | |
parent | 18f90c5afbfc1cfa5c38d2775888719575c4dd55 (diff) | |
download | fluxbox-d53d9eaa318eb0b498feb3a3fe39cbfa64fe0797.zip fluxbox-d53d9eaa318eb0b498feb3a3fe39cbfa64fe0797.tar.bz2 |
removed DrawString
Diffstat (limited to 'src/DrawUtil.cc')
-rw-r--r-- | src/DrawUtil.cc | 67 |
1 files changed, 2 insertions, 65 deletions
diff --git a/src/DrawUtil.cc b/src/DrawUtil.cc index 220a993..8c41bc2 100644 --- a/src/DrawUtil.cc +++ b/src/DrawUtil.cc | |||
@@ -19,10 +19,10 @@ | |||
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.7 2002/05/07 08:15:18 fluxgen Exp $ | 22 | // $Id: DrawUtil.cc,v 1.8 2002/11/12 22:44:17 fluxgen Exp $ |
23 | 23 | ||
24 | #ifdef HAVE_CONFIG_H | 24 | #ifdef HAVE_CONFIG_H |
25 | # include "config.h" | 25 | #include "config.h" |
26 | #endif //HAVE_CONFIG_H | 26 | #endif //HAVE_CONFIG_H |
27 | 27 | ||
28 | #include "DrawUtil.hh" | 28 | #include "DrawUtil.hh" |
@@ -364,69 +364,6 @@ void XRotDrawString(Display *dpy, XRotFontStruct *rotfont, Drawable drawable, | |||
364 | } | 364 | } |
365 | } | 365 | } |
366 | 366 | ||
367 | |||
368 | //Draw title string | ||
369 | void DrawString(Display *display, Window w, GC gc, DrawUtil::Font *font, | ||
370 | unsigned int text_w, unsigned int size_w, | ||
371 | unsigned int bevel_w, const char *text) { | ||
372 | |||
373 | assert(display); | ||
374 | assert(font); | ||
375 | |||
376 | if (!text || text_w<1 || size_w < 1) | ||
377 | return; | ||
378 | |||
379 | unsigned int l = text_w; | ||
380 | int dlen=strlen(text); | ||
381 | int dx=bevel_w*2; | ||
382 | |||
383 | |||
384 | if (text_w > size_w) { | ||
385 | for (; dlen >= 0; dlen--) { | ||
386 | if (I18n::instance()->multibyte()) { | ||
387 | XRectangle ink, logical; | ||
388 | XmbTextExtents(font->set, text, dlen, | ||
389 | &ink, &logical); | ||
390 | l = logical.width; | ||
391 | } else | ||
392 | l = XTextWidth(font->fontstruct, text, dlen); | ||
393 | |||
394 | l += (dx * 4); | ||
395 | |||
396 | if (l < size_w) | ||
397 | break; | ||
398 | } | ||
399 | } | ||
400 | |||
401 | switch (font->justify) { | ||
402 | case DrawUtil::Font::RIGHT: | ||
403 | dx += size_w - l; | ||
404 | break; | ||
405 | |||
406 | case DrawUtil::Font::CENTER: | ||
407 | dx += (size_w - l) / 2; | ||
408 | break; | ||
409 | default: | ||
410 | break; | ||
411 | } | ||
412 | |||
413 | //Draw title to m_tabwin | ||
414 | |||
415 | XClearWindow(display, w); | ||
416 | |||
417 | if (I18n::instance()->multibyte()) { | ||
418 | XmbDrawString(display, w, | ||
419 | font->set, gc, dx, 1 - font->set_extents->max_ink_extent.y, | ||
420 | text, dlen); | ||
421 | } else { | ||
422 | XDrawString(display, w, | ||
423 | gc, dx, font->fontstruct->ascent + 1, | ||
424 | text, dlen); | ||
425 | } | ||
426 | |||
427 | } | ||
428 | |||
429 | |||
430 | void DrawRotString(Display *display, Window w, GC gc, XRotFontStruct *font, | 367 | void DrawRotString(Display *display, Window w, GC gc, XRotFontStruct *font, |
431 | unsigned int align, unsigned int text_w, | 368 | unsigned int align, unsigned int text_w, |
432 | unsigned int size_w, unsigned int size_h, | 369 | unsigned int size_w, unsigned int size_h, |