47 |
BOOL g_enable_compose = False; |
BOOL g_enable_compose = False; |
48 |
BOOL g_Unobscured; /* used for screenblt */ |
BOOL g_Unobscured; /* used for screenblt */ |
49 |
static GC g_gc = NULL; |
static GC g_gc = NULL; |
50 |
|
static GC g_create_bitmap_gc = NULL; |
51 |
|
static GC g_create_glyph_gc = NULL; |
52 |
static Visual *g_visual; |
static Visual *g_visual; |
53 |
static int g_depth; |
static int g_depth; |
54 |
static int g_bpp; |
static int g_bpp; |
946 |
ui_create_window(void) |
ui_create_window(void) |
947 |
{ |
{ |
948 |
uint8 null_pointer_mask[1] = { 0x80 }; |
uint8 null_pointer_mask[1] = { 0x80 }; |
949 |
uint8 null_pointer_data[4] = { 0x00, 0x00, 0x00, 0x00 }; |
uint8 null_pointer_data[24] = { 0x00 }; |
950 |
|
|
951 |
XSetWindowAttributes attribs; |
XSetWindowAttributes attribs; |
952 |
XClassHint *classhints; |
XClassHint *classhints; |
953 |
XSizeHints *sizehints; |
XSizeHints *sizehints; |
972 |
if (g_gc == NULL) |
if (g_gc == NULL) |
973 |
g_gc = XCreateGC(g_display, g_wnd, 0, NULL); |
g_gc = XCreateGC(g_display, g_wnd, 0, NULL); |
974 |
|
|
975 |
|
if (g_create_bitmap_gc == NULL) |
976 |
|
g_create_bitmap_gc = XCreateGC(g_display, g_wnd, 0, NULL); |
977 |
|
|
978 |
if ((g_ownbackstore) && (g_backstore == 0)) |
if ((g_ownbackstore) && (g_backstore == 0)) |
979 |
{ |
{ |
980 |
g_backstore = XCreatePixmap(g_display, g_wnd, g_width, g_height, g_depth); |
g_backstore = XCreatePixmap(g_display, g_wnd, g_width, g_height, g_depth); |
1435 |
error("select: %s\n", strerror(errno)); |
error("select: %s\n", strerror(errno)); |
1436 |
|
|
1437 |
case 0: |
case 0: |
1438 |
/* TODO: if tv.tv_sec just times out |
/* Abort serial read calls */ |
1439 |
* we will segfault. |
if (s_timeout) |
1440 |
* FIXME: |
rdpdr_check_fds(&rfds, &wfds, (BOOL) True); |
|
*/ |
|
|
//s_timeout = True; |
|
|
//rdpdr_check_fds(&rfds, &wfds, (BOOL) True); |
|
1441 |
continue; |
continue; |
1442 |
} |
} |
1443 |
|
|
1484 |
image = XCreateImage(g_display, g_visual, g_depth, ZPixmap, 0, |
image = XCreateImage(g_display, g_visual, g_depth, ZPixmap, 0, |
1485 |
(char *) tdata, width, height, bitmap_pad, 0); |
(char *) tdata, width, height, bitmap_pad, 0); |
1486 |
|
|
1487 |
XPutImage(g_display, bitmap, g_gc, image, 0, 0, 0, 0, width, height); |
XPutImage(g_display, bitmap, g_create_bitmap_gc, image, 0, 0, 0, 0, width, height); |
1488 |
|
|
1489 |
XFree(image); |
XFree(image); |
1490 |
if (tdata != data) |
if (tdata != data) |
1542 |
XImage *image; |
XImage *image; |
1543 |
Pixmap bitmap; |
Pixmap bitmap; |
1544 |
int scanline; |
int scanline; |
|
GC gc; |
|
1545 |
|
|
1546 |
scanline = (width + 7) / 8; |
scanline = (width + 7) / 8; |
1547 |
|
|
1548 |
bitmap = XCreatePixmap(g_display, g_wnd, width, height, 1); |
bitmap = XCreatePixmap(g_display, g_wnd, width, height, 1); |
1549 |
gc = XCreateGC(g_display, bitmap, 0, NULL); |
if (g_create_glyph_gc == 0) |
1550 |
|
g_create_glyph_gc = XCreateGC(g_display, bitmap, 0, NULL); |
1551 |
|
|
1552 |
image = XCreateImage(g_display, g_visual, 1, ZPixmap, 0, (char *) data, |
image = XCreateImage(g_display, g_visual, 1, ZPixmap, 0, (char *) data, |
1553 |
width, height, 8, scanline); |
width, height, 8, scanline); |
1555 |
image->bitmap_bit_order = MSBFirst; |
image->bitmap_bit_order = MSBFirst; |
1556 |
XInitImage(image); |
XInitImage(image); |
1557 |
|
|
1558 |
XPutImage(g_display, bitmap, gc, image, 0, 0, 0, 0, width, height); |
XPutImage(g_display, bitmap, g_create_glyph_gc, image, 0, 0, 0, 0, width, height); |
1559 |
|
|
1560 |
XFree(image); |
XFree(image); |
|
XFreeGC(g_display, gc); |
|
1561 |
return (HGLYPH) bitmap; |
return (HGLYPH) bitmap; |
1562 |
} |
} |
1563 |
|
|