removed DrawString
This commit is contained in:
parent
18f90c5afb
commit
d53d9eaa31
2 changed files with 3 additions and 70 deletions
|
@ -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,
|
||||
|
|
|
@ -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)
|
||||
// ----------------------------------------------------------------------
|
||||
|
|
Loading…
Reference in a new issue