241 |
} |
} |
242 |
} |
} |
243 |
|
|
244 |
|
BOOL |
245 |
|
ui_init() |
246 |
|
{ |
247 |
|
Screen *screen; |
248 |
|
display = XOpenDisplay(NULL); |
249 |
|
if (display == NULL) |
250 |
|
{ |
251 |
|
error("Failed to open display\n"); |
252 |
|
return False; |
253 |
|
} |
254 |
|
if(fullscreen) |
255 |
|
{ |
256 |
|
screen = DefaultScreenOfDisplay(display); |
257 |
|
width = WidthOfScreen(screen); |
258 |
|
height = HeightOfScreen(screen); |
259 |
|
} |
260 |
|
return True; |
261 |
|
} |
262 |
|
|
263 |
BOOL |
BOOL |
264 |
ui_create_window(char *title) |
ui_create_window(char *title) |
272 |
uint16 test; |
uint16 test; |
273 |
int i; |
int i; |
274 |
|
|
|
display = XOpenDisplay(NULL); |
|
|
|
|
|
if (display == NULL) |
|
|
{ |
|
|
error("Failed to open display\n"); |
|
|
return False; |
|
|
} |
|
|
|
|
275 |
x_socket = ConnectionNumber(display); |
x_socket = ConnectionNumber(display); |
276 |
screen = DefaultScreenOfDisplay(display); |
screen = DefaultScreenOfDisplay(display); |
277 |
visual = DefaultVisualOfScreen(screen); |
visual = DefaultVisualOfScreen(screen); |
537 |
case EnterNotify: |
case EnterNotify: |
538 |
if (grab_keyboard) |
if (grab_keyboard) |
539 |
XGrabKeyboard(display, wnd, True, |
XGrabKeyboard(display, wnd, True, |
540 |
GrabModeAsync, GrabModeAsync, |
GrabModeAsync, |
541 |
|
GrabModeAsync, |
542 |
CurrentTime); |
CurrentTime); |
543 |
break; |
break; |
544 |
|
|
617 |
|
|
618 |
tdata = (owncolmap ? data : translate_image(width, height, data)); |
tdata = (owncolmap ? data : translate_image(width, height, data)); |
619 |
bitmap = XCreatePixmap(display, wnd, width, height, depth); |
bitmap = XCreatePixmap(display, wnd, width, height, depth); |
620 |
image = XCreateImage(display, visual, depth, ZPixmap, 0, (char *)tdata, |
image = XCreateImage(display, visual, depth, ZPixmap, 0, |
621 |
width, height, 8, 0); |
(char *) tdata, width, height, 8, 0); |
622 |
|
|
623 |
XPutImage(display, bitmap, gc, image, 0, 0, 0, 0, width, height); |
XPutImage(display, bitmap, gc, image, 0, 0, 0, 0, width, height); |
624 |
|
|
636 |
uint8 *tdata; |
uint8 *tdata; |
637 |
|
|
638 |
tdata = (owncolmap ? data : translate_image(width, height, data)); |
tdata = (owncolmap ? data : translate_image(width, height, data)); |
639 |
image = XCreateImage(display, visual, depth, ZPixmap, 0, (char *)tdata, |
image = XCreateImage(display, visual, depth, ZPixmap, 0, |
640 |
width, height, 8, 0); |
(char *) tdata, width, height, 8, 0); |
641 |
|
|
642 |
if (ownbackstore) |
if (ownbackstore) |
643 |
{ |
{ |
673 |
bitmap = XCreatePixmap(display, wnd, width, height, 1); |
bitmap = XCreatePixmap(display, wnd, width, height, 1); |
674 |
gc = XCreateGC(display, bitmap, 0, NULL); |
gc = XCreateGC(display, bitmap, 0, NULL); |
675 |
|
|
676 |
image = XCreateImage(display, visual, 1, ZPixmap, 0, (char *)data, |
image = XCreateImage(display, visual, 1, ZPixmap, 0, (char *) data, |
677 |
width, height, 8, scanline); |
width, height, 8, scanline); |
678 |
image->byte_order = MSBFirst; |
image->byte_order = MSBFirst; |
679 |
image->bitmap_bit_order = MSBFirst; |
image->bitmap_bit_order = MSBFirst; |
920 |
FILL_RECTANGLE(x, y, cx, cy); |
FILL_RECTANGLE(x, y, cx, cy); |
921 |
|
|
922 |
XSetFillStyle(display, gc, FillSolid); |
XSetFillStyle(display, gc, FillSolid); |
923 |
|
XSetTSOrigin(display, gc, 0, 0); |
924 |
ui_destroy_glyph((HGLYPH) fill); |
ui_destroy_glyph((HGLYPH) fill); |
925 |
break; |
break; |
926 |
|
|
1186 |
if (data == NULL) |
if (data == NULL) |
1187 |
return; |
return; |
1188 |
|
|
1189 |
image = XCreateImage(display, visual, depth, ZPixmap, 0, (char *)data, |
image = XCreateImage(display, visual, depth, ZPixmap, 0, |
1190 |
cx, cy, BitmapPad(display), cx * bpp / 8); |
(char *) data, cx, cy, BitmapPad(display), |
1191 |
|
cx * bpp / 8); |
1192 |
|
|
1193 |
if (ownbackstore) |
if (ownbackstore) |
1194 |
{ |
{ |