From d53d9eaa318eb0b498feb3a3fe39cbfa64fe0797 Mon Sep 17 00:00:00 2001 From: fluxgen Date: Tue, 12 Nov 2002 22:44:17 +0000 Subject: removed DrawString --- src/DrawUtil.cc | 67 ++------------------------------------------------------- src/DrawUtil.hh | 6 +----- 2 files changed, 3 insertions(+), 70 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 @@ // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER // DEALINGS IN THE SOFTWARE. -// $Id: DrawUtil.cc,v 1.7 2002/05/07 08:15:18 fluxgen Exp $ +// $Id: DrawUtil.cc,v 1.8 2002/11/12 22:44:17 fluxgen Exp $ #ifdef HAVE_CONFIG_H -# include "config.h" +#include "config.h" #endif //HAVE_CONFIG_H #include "DrawUtil.hh" @@ -364,69 +364,6 @@ void XRotDrawString(Display *dpy, XRotFontStruct *rotfont, Drawable drawable, } } - -//Draw title string -void DrawString(Display *display, Window w, GC gc, DrawUtil::Font *font, - unsigned int text_w, unsigned int size_w, - unsigned int bevel_w, const char *text) { - - assert(display); - assert(font); - - if (!text || text_w<1 || size_w < 1) - return; - - unsigned int l = text_w; - int dlen=strlen(text); - int dx=bevel_w*2; - - - if (text_w > size_w) { - for (; dlen >= 0; dlen--) { - if (I18n::instance()->multibyte()) { - XRectangle ink, logical; - XmbTextExtents(font->set, text, dlen, - &ink, &logical); - l = logical.width; - } else - l = XTextWidth(font->fontstruct, text, dlen); - - l += (dx * 4); - - if (l < size_w) - break; - } - } - - switch (font->justify) { - case DrawUtil::Font::RIGHT: - dx += size_w - l; - break; - - case DrawUtil::Font::CENTER: - dx += (size_w - l) / 2; - break; - default: - break; - } - - //Draw title to m_tabwin - - XClearWindow(display, w); - - if (I18n::instance()->multibyte()) { - XmbDrawString(display, w, - font->set, gc, dx, 1 - font->set_extents->max_ink_extent.y, - text, dlen); - } else { - XDrawString(display, w, - gc, dx, font->fontstruct->ascent + 1, - text, dlen); - } - -} - - void DrawRotString(Display *display, Window w, GC gc, XRotFontStruct *font, unsigned int align, unsigned int text_w, unsigned int size_w, unsigned int size_h, diff --git a/src/DrawUtil.hh b/src/DrawUtil.hh index 8435796..d866961 100644 --- a/src/DrawUtil.hh +++ b/src/DrawUtil.hh @@ -19,7 +19,7 @@ // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER // DEALINGS IN THE SOFTWARE. -// $Id: DrawUtil.hh,v 1.6 2002/07/10 14:38:43 fluxgen Exp $ +// $Id: DrawUtil.hh,v 1.7 2002/11/12 22:44:17 fluxgen Exp $ #ifndef DRAWUTIL_HH #define DRAWUTIL_HH @@ -38,10 +38,6 @@ namespace DrawUtil FontJustify justify; }; -void DrawString(Display *display, Window w, GC gc, DrawUtil::Font *font, - unsigned int text_w, unsigned int size_w, - unsigned int bevel_w, const char *text); - // ---------------------------------------------------------------------- // xvertext, Copyright (c) 1992 Alan Richardson (mppa3@uk.ac.sussex.syma) // ---------------------------------------------------------------------- -- cgit v0.11.2