20 |
|
|
21 |
|
#include "x11twind.h" |
22 |
|
|
23 |
+ |
#ifndef BSD |
24 |
+ |
#define bzero(d,n) (void)memset(d,0,n) |
25 |
+ |
extern char *memset(); |
26 |
+ |
#endif |
27 |
+ |
|
28 |
|
#define checkcurs(t) if ((t)->cursor) togglecurs(t) |
29 |
|
|
30 |
|
#define restorecurs checkcurs |
38 |
|
|
39 |
|
|
40 |
|
TEXTWIND * |
41 |
< |
xt_open(dpy, gc, parent, x, y, width, height, bw, fontname) |
42 |
< |
Display *dpy; |
43 |
< |
GC gc; |
44 |
< |
Window parent; |
45 |
< |
int x, y; |
46 |
< |
int width, height; |
47 |
< |
int bw; |
48 |
< |
char *fontname; |
41 |
> |
xt_open(dpy, parent, x, y, width, height, bw, fore, back, fontname) |
42 |
> |
Display *dpy; |
43 |
> |
Window parent; |
44 |
> |
int x, y; |
45 |
> |
int width, height; |
46 |
> |
int bw; |
47 |
> |
unsigned long fore, back; |
48 |
> |
char *fontname; |
49 |
|
{ |
50 |
|
register int i; |
51 |
|
register TEXTWIND *t; |
54 |
|
return(NULL); |
55 |
|
|
56 |
|
t->dpy = dpy; |
57 |
< |
t->w = XCreateSimpleWindow(dpy, parent, x, y, width, height, bw, |
58 |
< |
BlackPixel(dpy,DefaultScreen(dpy)), |
54 |
< |
WhitePixel(dpy,DefaultScreen(dpy))); |
55 |
< |
/* |
56 |
< |
t->w = XCreateWindow(dpy, parent, x, y, width, height, bw, 0, |
57 |
< |
CopyFromParent, CopyFromParent, 0, 0); |
58 |
< |
*/ |
59 |
< |
|
57 |
> |
t->w = XCreateSimpleWindow(dpy, parent, x, y, width, height, |
58 |
> |
bw, fore, back); |
59 |
|
if (t->w == 0) |
60 |
|
return(NULL); |
61 |
|
XMapWindow(dpy, t->w); |
65 |
|
|
66 |
|
/* if (!t->f.fixedwidth) check for fixedwidth later |
67 |
|
return(NULL); */ |
69 |
– |
t->gc = XCreateGC(dpy,t->w,0,NULL); |
68 |
|
|
69 |
< |
XCopyGC(dpy, gc, ~0L, t->gc); |
70 |
< |
|
69 |
> |
t->gc = XCreateGC(dpy,t->w,0,NULL); |
70 |
> |
XSetState(dpy, t->gc, fore, back, GXcopy, AllPlanes); |
71 |
|
XSetFont(dpy, t->gc, t->f->fid); |
74 |
– |
XSetFunction(dpy, t->gc, GXcopy); |
72 |
|
|
73 |
|
t->nc = (width - LEFTMAR) / |
74 |
|
Width(t->f); /* number of columns */ |