57 |
static Atom g_protocol_atom, g_kill_atom; |
static Atom g_protocol_atom, g_kill_atom; |
58 |
static BOOL g_focused; |
static BOOL g_focused; |
59 |
static BOOL g_mouse_in_wnd; |
static BOOL g_mouse_in_wnd; |
60 |
static BOOL g_arch_match = False; /* set to True if RGB XServer and little endian */ |
static BOOL g_arch_match = False; /* set to True if RGB XServer and little endian */ |
61 |
|
|
62 |
/* endianness */ |
/* endianness */ |
63 |
static BOOL g_host_be; |
static BOOL g_host_be; |
229 |
return make_colour(pc); |
return make_colour(pc); |
230 |
} |
} |
231 |
|
|
232 |
|
#define UNROLL8(stm) { stm stm stm stm stm stm stm stm } |
233 |
|
#define REPEAT(stm) \ |
234 |
|
{ \ |
235 |
|
while (out <= end - 8 * 4) \ |
236 |
|
UNROLL8(stm) \ |
237 |
|
while (out < end) \ |
238 |
|
{ stm } \ |
239 |
|
} |
240 |
|
|
241 |
static void |
static void |
242 |
translate8to8(uint8 * data, uint8 * out, uint8 * end) |
translate8to8(uint8 * data, uint8 * out, uint8 * end) |
243 |
{ |
{ |
250 |
{ |
{ |
251 |
uint16 value; |
uint16 value; |
252 |
|
|
253 |
if (g_xserver_be) |
if (g_arch_match) |
254 |
|
REPEAT(*(((uint16*)out)++) = g_colmap[*(data++)];) |
255 |
|
else if (g_xserver_be) |
256 |
{ |
{ |
257 |
while (out < end) |
while (out < end) |
258 |
{ |
{ |
305 |
{ |
{ |
306 |
uint32 value; |
uint32 value; |
307 |
|
|
308 |
if (g_xserver_be) |
if (g_arch_match) |
309 |
|
REPEAT(*(((uint32*)out)++) = g_colmap[*(data++)];) |
310 |
|
else if (g_xserver_be) |
311 |
{ |
{ |
312 |
while (out < end) |
while (out < end) |
313 |
{ |
{ |
969 |
XFree(sizehints); |
XFree(sizehints); |
970 |
} |
} |
971 |
|
|
972 |
if ( g_embed_wnd ) |
if (g_embed_wnd) |
973 |
{ |
{ |
974 |
XReparentWindow(g_display, g_wnd, (Window)g_embed_wnd, 0, 0); |
XReparentWindow(g_display, g_wnd, (Window) g_embed_wnd, 0, 0); |
975 |
} |
} |
976 |
|
|
977 |
input_mask = KeyPressMask | KeyReleaseMask | ButtonPressMask | ButtonReleaseMask | |
input_mask = KeyPressMask | KeyReleaseMask | ButtonPressMask | ButtonReleaseMask | |
978 |
VisibilityChangeMask | FocusChangeMask; |
VisibilityChangeMask | FocusChangeMask; |
1022 |
} |
} |
1023 |
|
|
1024 |
void |
void |
1025 |
|
ui_resize_window() |
1026 |
|
{ |
1027 |
|
XSizeHints *sizehints; |
1028 |
|
|
1029 |
|
sizehints = XAllocSizeHints(); |
1030 |
|
if (sizehints) |
1031 |
|
{ |
1032 |
|
sizehints->flags = PMinSize | PMaxSize; |
1033 |
|
sizehints->min_width = sizehints->max_width = g_width; |
1034 |
|
sizehints->min_height = sizehints->max_height = g_height; |
1035 |
|
XSetWMNormalHints(g_display, g_wnd, sizehints); |
1036 |
|
XFree(sizehints); |
1037 |
|
} |
1038 |
|
|
1039 |
|
if (!(g_fullscreen || g_embed_wnd)) |
1040 |
|
{ |
1041 |
|
XResizeWindow(g_display, g_wnd, g_width, g_height); |
1042 |
|
} |
1043 |
|
} |
1044 |
|
|
1045 |
|
void |
1046 |
ui_destroy_window(void) |
ui_destroy_window(void) |
1047 |
{ |
{ |
1048 |
if (g_IC != NULL) |
if (g_IC != NULL) |