43 |
static int g_x_socket; |
static int g_x_socket; |
44 |
static Screen *g_screen; |
static Screen *g_screen; |
45 |
Window g_wnd; |
Window g_wnd; |
46 |
|
uint32 g_embed_wnd; |
47 |
BOOL g_enable_compose = False; |
BOOL g_enable_compose = False; |
48 |
static GC g_gc = NULL; |
static GC g_gc = NULL; |
49 |
static Visual *g_visual; |
static Visual *g_visual; |
170 |
split_colour15(uint32 colour) |
split_colour15(uint32 colour) |
171 |
{ |
{ |
172 |
PixelColour rv; |
PixelColour rv; |
173 |
rv.red = (colour & 0x7c00) >> 10; |
rv.red = (colour & 0x7c00) >> 7; |
174 |
rv.red = (rv.red * 0xff) / 0x1f; |
rv.green = (colour & 0x03e0) >> 2; |
175 |
rv.green = (colour & 0x03e0) >> 5; |
rv.blue = (colour & 0x001f) << 3; |
|
rv.green = (rv.green * 0xff) / 0x1f; |
|
|
rv.blue = (colour & 0x1f); |
|
|
rv.blue = (rv.blue * 0xff) / 0x1f; |
|
176 |
return rv; |
return rv; |
177 |
} |
} |
178 |
|
|
180 |
split_colour16(uint32 colour) |
split_colour16(uint32 colour) |
181 |
{ |
{ |
182 |
PixelColour rv; |
PixelColour rv; |
183 |
rv.red = (colour & 0xf800) >> 11; |
rv.red = (colour & 0xf800) >> 8; |
184 |
rv.red = (rv.red * 0xff) / 0x1f; |
rv.green = (colour & 0x07e0) >> 3; |
185 |
rv.green = (colour & 0x07e0) >> 5; |
rv.blue = (colour & 0x001f) << 3; |
|
rv.green = (rv.green * 0xff) / 0x3f; |
|
|
rv.blue = (colour & 0x001f); |
|
|
rv.blue = (rv.blue * 0xff) / 0x1f; |
|
186 |
return rv; |
return rv; |
187 |
} |
} |
188 |
|
|
191 |
{ |
{ |
192 |
PixelColour rv; |
PixelColour rv; |
193 |
rv.blue = (colour & 0xff0000) >> 16; |
rv.blue = (colour & 0xff0000) >> 16; |
194 |
rv.green = (colour & 0xff00) >> 8; |
rv.green = (colour & 0x00ff00) >> 8; |
195 |
rv.red = (colour & 0xff); |
rv.red = (colour & 0x0000ff); |
196 |
return rv; |
return rv; |
197 |
} |
} |
198 |
|
|
926 |
XFree(sizehints); |
XFree(sizehints); |
927 |
} |
} |
928 |
|
|
929 |
|
if ( g_embed_wnd ) |
930 |
|
{ |
931 |
|
XReparentWindow(g_display, g_wnd, (Window)g_embed_wnd, 0, 0); |
932 |
|
} |
933 |
|
|
934 |
input_mask = KeyPressMask | KeyReleaseMask | ButtonPressMask | ButtonReleaseMask | |
input_mask = KeyPressMask | KeyReleaseMask | ButtonPressMask | ButtonReleaseMask | |
935 |
VisibilityChangeMask | FocusChangeMask; |
VisibilityChangeMask | FocusChangeMask; |
936 |
|
|
1928 |
|
|
1929 |
SET_FOREGROUND(bgcolour); |
SET_FOREGROUND(bgcolour); |
1930 |
|
|
1931 |
|
/* Sometimes, the boxcx value is something really large, like |
1932 |
|
32691. This makes XCopyArea fail with Xvnc. The code below |
1933 |
|
is a quick fix. */ |
1934 |
|
if (boxx + boxcx > g_width) |
1935 |
|
boxcx = g_width - boxx; |
1936 |
|
|
1937 |
if (boxcx > 1) |
if (boxcx > 1) |
1938 |
{ |
{ |
1939 |
FILL_RECTANGLE_BACKSTORE(boxx, boxy, boxcx, boxcy); |
FILL_RECTANGLE_BACKSTORE(boxx, boxy, boxcx, boxcy); |