21 #include "../rdesktop.h" 24 #include <vgakeyboard.h> 33 #include <linux/keyboard.h> 151 if ((
fd=
open(
"/dev/console", O_NOCTTY)) != -1 )
153 if (
ioctl (
fd, KDGETLED, &leds) != -1)
174 case 0x1:
return ~(
src |
dst);
175 case 0x2:
return (~
src) &
dst;
176 case 0x3:
return ~
src;
177 case 0x4:
return src & (~
dst);
178 case 0x5:
return ~(
dst);
179 case 0x6:
return src ^
dst;
180 case 0x7:
return ~(
src &
dst);
181 case 0x8:
return src &
dst;
182 case 0x9:
return ~(
src) ^
dst;
183 case 0xa:
return dst;
184 case 0xb:
return (~
src) |
dst;
185 case 0xc:
return src;
186 case 0xd:
return src | (~
dst);
187 case 0xe:
return src |
dst;
209 return vga_getpixel(
x,
y);
412 for (
i = 0;
i <
cy;
i++)
421 vga_accel(ACCEL_PUTIMAGE,
x,
y,
cx,
cy,
data);
426 for (
i = 0;
i <
cy;
i++)
445 for (
i = 0;
i <
cx;
i++)
448 for (
i = 0;
i <
cx;
i++)
451 for (
i = 0;
i <
cy;
i++)
460 vga_accel(ACCEL_SETFGCOLOR,
color);
461 vga_accel(ACCEL_FILLBOX,
x,
y,
cx,
cy);
467 for (
i = 0;
i <
cx;
i++)
470 for (
i = 0;
i <
cx;
i++)
472 for (
i = 0;
i <
cy;
i++)
492 for (
i = 0;
i <
cy;
i++)
499 else if (srcy >
y || srcx >
x)
503 for (
i = 0;
i <
cy;
i++)
514 for (
i = 0;
i <
cy;
i++)
524 vga_accel(ACCEL_SCREENCOPY, srcx, srcy,
x,
y,
cx,
cy);
530 for (
i = 0;
i <
cy;
i++)
532 for (
i = 0;
i <
cy;
i++)
561 else if (opcode == 0xf)
563 else if (opcode == 0
x0)
567 for (
i = 0;
i <
cy;
i++)
568 for (
j = 0;
j <
cx;
j++)
591 for (
i = 0;
i <
cy;
i++)
599 for (
i = 0;
i <
cy;
i++)
611 if (
r1->x >=
r2->x &&
638 for (
i = 0;
i < 32;
i++)
643 vga_drawscansegment(
ptr, ox +
k, oy +
i,
len);
656 uint8 mouse_a[32 * 32 * 4];
663 for (
i = 0;
i < 32;
i++)
665 for (
j = 0;
j < 32;
j++)
673 pixel =
rop(0x8,
k, pixel);
678 pixel =
rop(0x6,
k, pixel);
692 if (i < g_height && i >= 0)
734 walk_rect = walk_rect->
next;
741 while (walk_rect->
next != 0);
743 rect->prev = walk_rect;
784 if ((scancode == SCANCODE_CAPSLOCK) && pressed)
789 if ((scancode == SCANCODE_SCROLLLOCK) && pressed)
795 if ((scancode == SCANCODE_NUMLOCK) && pressed)
804 case SCANCODE_CURSORBLOCKDOWN: rdpkey = 0xd0;
ext =
KBD_FLAG_EXT;
break;
805 case SCANCODE_CURSORBLOCKRIGHT: rdpkey = 0xcd;
ext =
KBD_FLAG_EXT;
break;
806 case SCANCODE_CURSORBLOCKLEFT: rdpkey = 0xcb;
ext =
KBD_FLAG_EXT;
break;
813 case SCANCODE_KEYPADDIVIDE: rdpkey = 0x35;
break;
814 case SCANCODE_KEYPADENTER: rdpkey = 0x1c;
break;
815 case SCANCODE_RIGHTCONTROL: rdpkey = 0x1d;
break;
816 case SCANCODE_RIGHTALT: rdpkey = 0x38;
break;
831 case SCANCODE_SCROLLLOCK: rdpkey = 0x46;
break;
835 mouse_getx(), mouse_gety());
841 mouse_getx(), mouse_gety());
875 vgamode = G800x600x256;
879 vgamode = G640x480x256;
881 vgamode = G640x480x64K;
886 vgamode = G800x600x256;
888 vgamode = G800x600x64K;
893 vgamode = G1024x768x256;
895 vgamode = G1024x768x64K;
899 error(
"Invalid width / height");
903 if (!vga_hasmode(vgamode))
905 error(
"Graphics unavailable");
908 vga_setmousesupport(1);
910 vga_setmode(vgamode);
913 error(
"Keyboard unavailable");
919 i = vga_ext_set(VGA_EXT_AVAILABLE, VGA_AVAIL_ACCEL);
920 if (
i & ACCELFLAG_PUTIMAGE)
922 if (
i & ACCELFLAG_SCREENCOPY)
924 if (
i & ACCELFLAG_FILLBOX)
953 mouseb = mouse_getbutton();
1058 the_glyph->
data = glyph_data;
1072 the_glyph = (
bitmap*)glyph;
1073 if (the_glyph !=
NULL)
1115 int* cmap = (
int*)
xmalloc(3 * 256 *
sizeof (
int));
1118 bzero(cmap, 256 * 3 *
sizeof (
int));
1119 for (
i = 0;
i < (3 *
n);
c++)
1121 cmap[
i++] = (
c->red) >> 2;
1122 cmap[
i++] = (
c->green) >> 2;
1123 cmap[
i++] = (
c->blue) >> 2;
1141 vga_setpalvec(0, 256, (
int*)
map);
1165 the_glyph = (
bitmap*)glyph;
1166 if (the_glyph ==
NULL)
1169 for (
j = 0;
j < the_glyph->
width;
j++)
1174 #define DO_GLYPH(ttext,idx) \ 1176 glyph = cache_get_font (font, ttext[idx]);\ 1177 if (!(flags & TEXT2_IMPLICIT_X))\ 1179 xyoffset = ttext[++idx];\ 1180 if ((xyoffset & 0x80))\ 1182 if (flags & TEXT2_VERTICAL) \ 1183 y += ttext[idx+1] | (ttext[idx+2] << 8);\ 1185 x += ttext[idx+1] | (ttext[idx+2] << 8);\ 1190 if (flags & TEXT2_VERTICAL) \ 1198 draw_glyph (x + glyph->offset, y + glyph->baseline, glyph->pixmap, fgcolour);\ 1199 if (flags & TEXT2_IMPLICIT_X)\ 1207 int clipx,
int clipy,
int clipcx,
int clipcy,
1208 int boxx,
int boxy,
int boxcx,
int boxcy,
BRUSH * brush,
1221 fill_rect(boxx, boxy, boxcx, boxcy, bgcolour, 0xc);
1228 fill_rect(clipx, clipy, clipcx, clipcy, bgcolour, 0xc);
1241 error(
"this shouldn't be happening\n");
1336 dpru = dpr - (
dx << 1);
1338 for (;
dx >= 0;
dx--)
1357 dpru = dpr - (
dy << 1);
1359 for (;
dy >= 0;
dy--)
1381 BRUSH* brush,
int bgcolour,
int fgcolour)
1405 for (
i = 0;
i <
cy;
i++)
1407 for (
j = 0;
j <
cx;
j++)
1466 if (
x == srcx &&
y == srcy)
1477 for (
i = 0;
i <
cy;
i++)
1478 for (
j = 0;
j <
cx;
j++)
1480 for (
i = 0;
i <
cy;
i++)
1481 for (
j = 0;
j <
cx;
j++)
1492 BRUSH * brush,
int bgcolour,
int fgcolour)
1502 switch (brush->style)
1508 for (
i = 0;
i < 8;
i++)
1509 ipattern[
i] = ~brush->pattern[7 -
i];
1511 for (
j = 0;
j <
cx;
j++)
1513 (
y +
i + brush->yorigin) % 8, 8, 1))
1580 for (
i = 0;
i < 32;
i++)
1582 for (
j = 0;
j < 32;
j++)
1650 BRUSH * brush,
int bgcolour,
int fgcolour)
1661 int x,
int y,
int cx,
int cy,
1662 BRUSH * brush,
int bgcolour,
int fgcolour)
1669 memcpy(
random,
"12345678901234567890123456789012", 32);
1790 char fullhostname[64];
1797 if (pw !=
NULL && pw->pw_name !=
NULL)
1801 if (
gethostname(fullhostname,
sizeof(fullhostname)) != -1)
1803 p =
strchr(fullhostname,
'.');
1813 fprintf(
stderr,
"rdesktop: A Remote Desktop Protocol client.\n");
1815 fprintf(
stderr,
"See http://www.rdesktop.org/ for more information.\n\n");
1846 for (
i = 0;
i < thisline;
i++)
1852 for (
i = 0;
i < thisline;
i++)
1874 for (
i = 1;
i < in_argc;
i++)
1877 if (
strcmp(in_argv[
i],
"-g") == 0)
1882 error(
"invalid geometry\n");
1889 error(
"invalid geometry\n");
1894 else if (
strcmp(in_argv[
i],
"-4") == 0)
1896 else if (
strcmp(in_argv[
i],
"-5") == 0)
1898 else if (
strcmp(in_argv[
i],
"-t") == 0)
1900 else if (
strcmp(in_argv[
i],
"-h") == 0)
1905 else if (
strcmp(in_argv[
i],
"-n") == 0)
1909 else if (
strcmp(in_argv[
i],
"-u") == 0)
1913 else if (
strcmp(in_argv[
i],
"-d") == 0)
1917 else if (
strcmp(in_argv[
i],
"-a") == 0)
1922 error(
"invalid server bpp\n");
1927 else if (
strcmp(in_argv[
i],
"-l") == 0)
1934 int main(
int in_argc,
char** in_argv)
char g_redirect_cookie[128]
void cache_rect(int x, int y, int cx, int cy, int do_warp)
HBITMAP ui_create_bitmap(int width, int height, uint8 *data)
void ui_begin_update(void)
BOOL rd_pstcache_mkdir(void)
GLint GLint GLsizei width
int rop(int rop, int src, int dst)
char g_redirect_domain[16]
int get_pixel2(int x, int y, uint8 *data, int width, int bpp)
int main(int in_argc, char **in_argv)
void ui_draw_text(uint8 font, uint8 flags, uint8 opcode, int mixmode, int x, int y, int clipx, int clipy, int clipcx, int clipcy, int boxx, int boxy, int boxcx, int boxcy, BRUSH *brush, int bgcolour, int fgcolour, uint8 *text, uint8 length)
int is_contained_by(myrect *r1, myrect *r2)
void ui_destroy_cursor(void *cursor)
void ui_set_null_cursor(void)
void rd_close_file(int fd)
uint8 mouse_under[32 *32 *4]
void ui_destroy_glyph(void *glyph)
int warp_coords(int *x, int *y, int *cx, int *cy, int *srcx, int *srcy)
uint8 * get_ptr(int x, int y, uint8 *data, int width, int bpp)
static int has_screen_copy
#define STRNCPY(dst, src, n)
void warning(char *format,...)
#define MOUSE_FLAG_BUTTON1
GLint GLint GLint GLint GLint x
void ui_memblt(uint8 opcode, int x, int y, int cx, int cy, HBITMAP src, int srcx, int srcy)
void process_keyboard(void)
int g_rdp5_performanceflags
int rd_lseek_file(int fd, int offset)
void draw_cache_rects(void)
void draw_glyph(int x, int y, HGLYPH glyph, int fgcolour)
GLint GLint GLsizei GLsizei GLsizei GLint GLenum format
void ui_rect(int x, int y, int cx, int cy, int colour)
#define DO_GLYPH(ttext, idx)
#define MOUSE_FLAG_BUTTON4
void copy_mem(uint8 *d, uint8 *s, int n)
RD_BOOL rdp_loop(RD_BOOL *deactivated, uint32 *ext_disc_reason)
void ui_set_cursor(void *cursor)
void ui_ellipse(uint8 opcode, uint8 fillmode, int x, int y, int cx, int cy, BRUSH *brush, int bgcolour, int fgcolour)
RD_BOOL rdp_connect(char *server, uint32 flags, char *domain, char *password, char *command, char *directory, RD_BOOL reconnect)
void set_pixel(int x, int y, int pixel, int op)
void ui_move_pointer(int x, int y)
void ui_resize_window(void)
void ui_patblt(uint8 opcode, int x, int y, int cx, int cy, BRUSH *brush, int bgcolour, int fgcolour)
_CRTIMP void __cdecl perror(_In_opt_z_ const char *_ErrMsg)
_Check_return_opt_ _CRTIMP int __cdecl fprintf(_Inout_ FILE *_File, _In_z_ _Printf_format_string_ const char *_Format,...)
int g_bitmap_cache_precache
INT WSAAPI gethostname(OUT char FAR *name, IN INT namelen)
int rd_open_file(char *filename)
_Check_return_ _CRTIMP char *__cdecl strdup(_In_opt_z_ const char *_Src)
GLenum GLuint GLenum GLsizei length
int parse_parameters(int in_argc, char **in_argv)
_Out_opt_ int _Out_opt_ int * cy
void cache_put_text(uint8 cache_id, void *data, int length)
char g_redirect_username[64]
void accel_draw_box(int x, int y, int cx, int cy, uint8 *data, int line_size)
void ui_desktop_restore(uint32 offset, int x, int y, int cx, int cy)
#define MOUSE_FLAG_BUTTON3
void ui_triblt(uint8 opcode, int x, int y, int cx, int cy, HBITMAP src, int srcx, int srcy, BRUSH *brush, int bgcolour, int fgcolour)
void ui_set_colourmap(void *map)
void ui_line(uint8 opcode, int startx, int starty, int endx, int endy, PEN *pen)
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint GLint GLint j
void ui_polyline(uint8 opcode, POINT *points, int npoints, PEN *pen)
void accel_fill_rect(int x, int y, int cx, int cy, int color)
void rdp_send_input(uint32 time, uint16 message_type, uint16 device_flags, uint16 param1, uint16 param2)
unsigned int read_keyboard_state(void)
GLboolean GLboolean GLboolean b
void * xrealloc(void *in_val, int size)
int g_polygon_ellipse_orders
void ui_set_clip(int x, int y, int cx, int cy)
uint16 ui_get_numlock_state(unsigned int state)
char g_redirect_server[64]
void * ui_create_cursor(unsigned int x, unsigned int y, int width, int height, uint8 *andmask, uint8 *xormask)
void unimpl(char *format,...)
int get_pixel(int x, int y)
void ui_destroy_window(void)
GLint GLenum GLsizei GLsizei GLsizei GLint GLsizei const GLvoid * data
GLsizei const GLfloat * points
void set_pixel_on(uint8 *data, int x, int y, int width, int bpp, int pixel)
int ui_create_window(void)
void ui_destblt(uint8 opcode, int x, int y, int cx, int cy)
void generate_random(uint8 *random)
void ui_polygon(uint8 opcode, uint8 fillmode, POINT *point, int npoints, BRUSH *brush, int bgcolour, int fgcolour)
#define memcpy(s1, s2, n)
void ui_destroy_bitmap(void *bmp)
int load_licence(uint8 **data)
GLint GLint GLsizei GLsizei height
void ui_paint_bitmap(int x, int y, int cx, int cy, int width, int height, uint8 *data)
void error(char *format,...)
void get_username_and_hostname(void)
void get_rect(int x, int y, int cx, int cy, uint8 *p)
void copy_memb(uint8 *d, uint8 *s, int n)
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint i
void ui_destroy_colourmap(HCOLOURMAP map)
#define MOUSE_FLAG_BUTTON5
void key_event(int scancode, int pressed)
static void setled(int mask, int state)
int g_keyboard_functionkeys
BOOL is_pixel_on(uint8 *data, int x, int y, int width, int bpp)
GLint GLint GLint GLint GLint GLint y
void hexdump(uint8 *p, uint32 len)
char * strchr(const char *String, int ch)
int rd_read_file(int fd, void *ptr, int len)
void ui_screenblt(uint8 opcode, int x, int y, int cx, int cy, int srcx, int srcy)
#define MOUSE_FLAG_BUTTON2
int rd_write_file(int fd, void *ptr, int len)
_Check_return_ long __cdecl strtol(_In_z_ const char *_Str, _Out_opt_ _Deref_post_z_ char **_EndPtr, _In_ int _Radix)
void int int ULONGLONG int va_list * ap
char g_redirect_password[64]
char * strcpy(char *DstString, const char *SrcString)
void save_licence(uint8 *data, int length)
int strcmp(const char *String1, const char *String2)
void accel_screen_copy(int x, int y, int cx, int cy, int srcx, int srcy)
void * ui_create_glyph(int width, int height, uint8 *data)
void fill_rect(int x, int y, int cx, int cy, int colour, int opcode)
DATABLOB * cache_get_text(uint8 cache_id)
BOOL rd_lock_file(int fd, int start, int len)
GLdouble GLdouble GLdouble GLdouble top
_Check_return_opt_ _CRTIMP int __cdecl vfprintf(_Inout_ FILE *_File, _In_z_ _Printf_format_string_ const char *_Format, va_list _ArgList)
int g_bitmap_cache_persist_enable
void set_pixel2(int x, int y, int pixel, uint8 *data, int width, int bpp)
void draw_cursor_under(int ox, int oy)
char * xstrdup(const char *s)
int contains_mouse(int x, int y, int cx, int cy)
void * ui_create_colourmap(COLOURMAP *colours)
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint GLint GLint GLenum GLenum GLenum GLint GLuint GLenum GLenum GLfloat GLenum GLfloat GLenum map
void ui_desktop_save(uint32 offset, int x, int y, int cx, int cy)