1 /*
2 	Minimal Xlib port
3 
4 	void XDrawString(int display, Drawable win, int gc, int x, int y, char *text, int textlen)
5 
6 	Stefano Bodrato, 5/3/2007
7 
8 	$Id: XDrawString.c,v 1.1 2014-04-16 06:16:33 stefano Exp $
9 */
10 
11 #define _BUILDING_X
12 #include <X11/Xlib.h>
13 
14 #ifdef _DEBUG_
15 #include <stdio.h>
16 #endif
17 
XDrawString(Display * display,Drawable win,GC * gc,int x,int y,char * text,int textlen)18 void XDrawString(Display *display, Drawable win, GC *gc, int x, int y, char *text, int textlen) {
19 
20 	struct _XWIN *mywin;
21 	mywin = (void *) win;
22 
23 // ======= I have absolutely no idea on why this is necessary ! =======
24 	//gc = *gc;
25 // ====================================================================
26 
27 #ifdef _DEBUG_
28 	printf (" Drawstring; pick in gc: %u   ...  ", gc);
29 	printf ("  Font ptr: %u  ", gc->values.font);
30 #endif
31 
32 
33 	_x_proportional = mywin->a_x + x;  _y_proportional = mywin->a_y + y;
34 	for (_X_int1=0; _X_int1<textlen; _xfputc(text[_X_int1++], gc->values.font, False));
35 }
36 
37