-void org::xwt::plat::X11$X11DoubleBuffer::drawString(::java::lang::String* font, ::java::lang::String* text, jint x, jint y, jint argb) {
-
- XRectangle rect;
- rect.x = clipx, rect.y = clipy; rect.width = clipw; rect.height = cliph;
- XSetClipMask(display, (*((GC*)clipped_gc)), None);
- XSetClipRectangles(display, (*((GC*)clipped_gc)), 0, 0, &rect, 1, YSorted);
- XSetForeground(display, (*((GC*)clipped_gc)),
- ((((argb & 0x00FF0000) >> 16) * colormap_info->red_max) / 0xFF) * colormap_info->red_mult +
- ((((argb & 0x0000FF00) >> 8) * colormap_info->green_max) / 0xFF) * colormap_info->green_mult +
- ((((argb & 0x000000FF)) * colormap_info->blue_max) / 0xFF) * colormap_info->blue_mult +
- colormap_info->base_pixel
- );
-
- // Grab the string
- int len = min(1024, JvGetStringUTFLength(text));
- char buf[len + 1];
- JvGetStringUTFRegion(text, 0, len, buf);
- buf[len] = '\0';
-
- // Build the XTextItem structure
- XTextItem textitem;
- textitem.chars = buf;
- textitem.nchars = len;
- textitem.delta = 0;
- textitem.font = ((XFontStruct*)org::xwt::plat::X11::fontToXFont(font))->fid;
-
- // Draw the text
- XDrawText(display, (*((Pixmap*)pm)), (*((GC*)clipped_gc)), x, y, &textitem, 1);
-}
-