ReactOS 0.4.15-dev-7711-g5627da4
uimain.c
Go to the documentation of this file.
1/* -*- c-basic-offset: 8 -*-
2 rdesktop: A Remote Desktop Protocol client.
3 Main ui file
4 Copyright (C) Jay Sorg 2006
5
6 This program is free software; you can redistribute it and/or modify
7 it under the terms of the GNU General Public License as published by
8 the Free Software Foundation; either version 2 of the License, or
9 (at your option) any later version.
10
11 This program is distributed in the hope that it will be useful,
12 but WITHOUT ANY WARRANTY; without even the implied warranty of
13 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 GNU General Public License for more details.
15
16 You should have received a copy of the GNU General Public License along
17 with this program; if not, write to the Free Software Foundation, Inc.,
18 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
19*/
20
21#include "precomp.h"
22
23#include "bsops.h"
24
25char g_username[256] = "";
26char g_hostname[256] = "";
27char g_servername[256] = "";
28char g_password[256] = "";
29char g_shell[256] = "";
30char g_directory[256] = "";
31char g_domain[256] = "";
32RD_BOOL g_desktop_save = False; /* desktop save order */
33RD_BOOL g_polygon_ellipse_orders = False; /* polygon / ellipse orders */
42int g_width = 800;
43int g_height = 600;
44uint32 g_keylayout = 0x409; /* Defaults to US keyboard layout */
45int g_keyboard_type = 0x4; /* Defaults to US keyboard layout */
46int g_keyboard_subtype = 0x0; /* Defaults to US keyboard layout */
47int g_keyboard_functionkeys = 0xc; /* Defaults to US keyboard layout */
49
50/* can't be static, hardware file or bsops need these */
51int g_tcp_sck = 0;
52int pal_entries[256];
53
54/* Session Directory redirection */
68
69extern int g_tcp_port_rdp;
70
71static int g_deactivated = 0;
73
74RDP_VERSION g_rdp_version = RDP_V5; /* Default to version 5 */
81
87
88struct bitmap
89{
93};
94
95/* in ui specific file eg win32.c, qt.c, df.c, ... */
96int
98int
99mi_main_loop(void);
100void
101mi_error(char * msg);
102void
103mi_warning(char * msg);
104void
105mi_paint_rect(char * data, int width, int height, int x, int y, int cx, int cy);
106void
107mi_begin_update(void);
108void
109mi_end_update(void);
110void
111mi_fill_rect(int x, int y, int cx, int cy, int colour);
112void
113mi_screen_copy(int x, int y, int cx, int cy, int srcx, int srcy);
114void
115mi_set_clip(int x, int y, int cx, int cy);
116void
117mi_reset_clip(void);
118void
119mi_line(int x1, int y1, int x2, int y2, int colour);
120void*
121mi_create_cursor(unsigned int x, unsigned int y,
122 int width, int height,
123 unsigned char * andmask, unsigned char * xormask);
124
125
126void
128void
130void
132int
134
135/*****************************************************************************/
136/* put part of the screen from the backing store to the display */
137void
138ui_invalidate(int x, int y, int cx, int cy)
139{
140 char * data;
141
142 if (cx < 1 || cy < 1)
143 {
144 return;
145 }
146 if (bs_warp_coords(&x, &y, &cx, &cy, 0, 0))
147 {
148 cx = (cx + 3) & ~3;
149 data = (char *) xmalloc(cx * cy * 4);
150 bs_copy_box(data, x, y, cx, cy, cx * ((g_server_depth + 7) / 8));
151 mi_paint_rect(data, cx, cy, x, y, cx, cy);
152 xfree(data);
153 }
154}
155
156/*****************************************************************************/
157void
159{
160}
161
162/*****************************************************************************/
163int
165{
166 if (g_tcp_sck == 0)
167 {
168 g_tcp_sck = in;
169 }
170 return 1;
171}
172
173/*****************************************************************************/
174void *
175ui_create_cursor(unsigned int x, unsigned int y,
176 int width, int height,
177 uint8 * andmask, uint8 * xormask, int xor_bpp)
178{
179 int i;
180 int j;
181 char am[32 * 4];
182 char xm[32 * 4];
183
184 if (width != 32 || height != 32)
185 {
186 return NULL;
187 }
188 if (xor_bpp==1)
189 {
190 return (void *) mi_create_cursor(x, y, width, height, (unsigned char *)andmask, (unsigned char *)xormask);
191 }
192 memset(am, 0, 32 * 4);
193 memset(xm, 0, 32 * 4);
194 for (i = 0; i < 32; i++)
195 {
196 for (j = 0; j < 32; j++)
197 {
198 if (bs_is_pixel_on((char *)andmask, j, i, 32, 1))
199 {
200 bs_set_pixel_on(am, j, 31 - i, 32, 1, 1);
201 }
202 if (bs_is_pixel_on((char *)xormask, j, i, 32, xor_bpp))
203 {
204 bs_set_pixel_on(xm, j, 31 - i, 32, 1, 1);
205 }
206 }
207 }
208 return (void *) mi_create_cursor(x, y, width, height, (unsigned char *)am, (unsigned char *)xm);
209}
210
211/*****************************************************************************/
212void
214{
216}
217
218/*****************************************************************************/
219void
221{
223}
224
225/*****************************************************************************/
226void
228{
230}
231
232/*****************************************************************************/
233void *
235{
236 int i;
237 int j;
238 char * glyph_data;
239 struct bitmap * the_glyph;
240
241 glyph_data = (char *) xmalloc(width * height);
242 memset(glyph_data, 0, width * height);
243 the_glyph = (struct bitmap *) xmalloc(sizeof(struct bitmap));
244 memset(the_glyph, 0, sizeof(struct bitmap));
245 the_glyph->width = width;
246 the_glyph->height = height;
247 the_glyph->data = (uint8 *)glyph_data;
248 for (i = 0; i < height; i++)
249 {
250 for (j = 0; j < width; j++)
251 {
252 if (bs_is_pixel_on((char *)data, j, i, width, 1))
253 {
254 bs_set_pixel_on(glyph_data, j, i, width, 8, 255);
255 }
256 }
257 }
258 return the_glyph;
259}
260
261/*****************************************************************************/
262void
263ui_destroy_glyph(void * glyph)
264{
265 struct bitmap * the_glyph;
266
267 the_glyph = glyph;
268 if (the_glyph != 0)
269 {
270 xfree(the_glyph->data);
271 }
272 xfree(the_glyph);
273}
274
275/*****************************************************************************/
276void *
278{
279 struct bitmap * b;
280 int size;
281
282 size = width * height * ((g_server_depth + 7) / 8);
283 b = (struct bitmap *) xmalloc(sizeof(struct bitmap));
284 b->data = (uint8 *) xmalloc(size);
285 memcpy(b->data, data, size);
286 b->width = width;
287 b->height = height;
288 return b;
289}
290
291/*****************************************************************************/
292void
294{
295 struct bitmap * b;
296
297 b = (struct bitmap *) bmp;
298 if (b != 0)
299 {
300 xfree(b->data);
301 }
302 xfree(b);
303}
304
305/*****************************************************************************/
306void
307ui_paint_bitmap(int x, int y, int cx, int cy,
308 int width, int height, uint8 * data)
309{
310 struct bitmap b;
311
312 b.width = width;
313 b.height = height;
314 b.data = data;
315 ui_memblt(12, x, y, cx, cy, &b, 0, 0);
316}
317
318/*****************************************************************************/
319void
320ui_set_clip(int x, int y, int cx, int cy)
321{
322 bs_set_clip(x, y, cx, cy);
323 mi_set_clip(x, y, cx, cy);
324}
325
326/*****************************************************************************/
327void
329{
332}
333
334/*****************************************************************************/
335void *
337{
338 int i;
339 int n;
340
341 n = MIN(256, colours->ncolours);
342 memset(pal_entries, 0, sizeof(pal_entries));
343 for (i = 0; i < n; i++)
344 {
345 pal_entries[i] = (colours->colours[i].red << 16) |
346 (colours->colours[i].green << 8) |
347 colours->colours[i].blue;
348 }
349 return 0;
350}
351
352/*****************************************************************************/
353void
355{
356}
357
358/*****************************************************************************/
359static void
360draw_glyph(int x, int y, void * glyph, int fgcolor)
361{
362 struct bitmap * b;
363
364 b = glyph;
365 bs_draw_glyph(x, y, (char *)b->data, b->width, b->height, fgcolor);
366}
367
368/*****************************************************************************/
369#define DO_GLYPH(ttext,idx) \
370{ \
371 glyph = cache_get_font(font, ttext[idx]); \
372 if (!(flags & TEXT2_IMPLICIT_X)) \
373 { \
374 xyoffset = ttext[++idx]; \
375 if (xyoffset & 0x80) \
376 { \
377 if (flags & TEXT2_VERTICAL) \
378 { \
379 y += ttext[idx + 1] | (ttext[idx + 2] << 8); \
380 } \
381 else \
382 { \
383 x += ttext[idx + 1] | (ttext[idx + 2] << 8); \
384 } \
385 idx += 2; \
386 } \
387 else \
388 { \
389 if (flags & TEXT2_VERTICAL) \
390 { \
391 y += xyoffset; \
392 } \
393 else \
394 { \
395 x += xyoffset; \
396 } \
397 } \
398 } \
399 if (glyph != NULL) \
400 { \
401 draw_glyph(x + glyph->offset, y + glyph->baseline, glyph->pixmap, \
402 fgcolour); \
403 if (flags & TEXT2_IMPLICIT_X) \
404 { \
405 x += glyph->width; \
406 } \
407 } \
408}
409
410/*****************************************************************************/
411void
412ui_draw_text(uint8 font, uint8 flags, uint8 opcode, int mixmode,
413 int x, int y,
414 int clipx, int clipy, int clipcx, int clipcy,
415 int boxx, int boxy, int boxcx, int boxcy, BRUSH * brush,
416 int bgcolour, int fgcolour, uint8 * text, uint8 length)
417{
418 int i;
419 int j;
420 int xyoffset;
421 DATABLOB * entry;
422 FONTGLYPH * glyph;
423
424 if (boxx + boxcx > g_width)
425 {
426 boxcx = g_width - boxx;
427 }
428 if (boxcx > 1)
429 {
430 bs_rect(boxx, boxy, boxcx, boxcy, bgcolour, 0xc);
431 }
432 else
433 {
434 if (mixmode == MIX_OPAQUE)
435 {
436 bs_rect(clipx, clipy, clipcx, clipcy, bgcolour, 0xc);
437 }
438 }
439 /* Paint text, character by character */
440 for (i = 0; i < length;)
441 {
442 switch (text[i])
443 {
444 case 0xff:
445 if (i + 2 < length)
446 {
447 cache_put_text(text[i + 1], text, text[i + 2]);
448 }
449 else
450 {
451 error("this shouldn't be happening\n");
452 exit(1);
453 }
454 /* this will move pointer from start to first character after */
455 /* FF command */
456 length -= i + 3;
457 text = &(text[i + 3]);
458 i = 0;
459 break;
460 case 0xfe:
461 entry = cache_get_text(text[i + 1]);
462 if (entry != NULL)
463 {
464 if ((((uint8 *) (entry->data))[1] == 0) &&
465 (!(flags & TEXT2_IMPLICIT_X)))
466 {
467 if (flags & TEXT2_VERTICAL)
468 {
469 y += text[i + 2];
470 }
471 else
472 {
473 x += text[i + 2];
474 }
475 }
476 for (j = 0; j < entry->size; j++)
477 {
478 DO_GLYPH(((uint8 *) (entry->data)), j);
479 }
480 }
481 if (i + 2 < length)
482 {
483 i += 3;
484 }
485 else
486 {
487 i += 2;
488 }
489 length -= i;
490 /* this will move pointer from start to first character after */
491 /* FE command */
492 text = &(text[i]);
493 i = 0;
494 break;
495 default:
496 DO_GLYPH(text, i);
497 i++;
498 break;
499 }
500 }
501 if (boxcx > 1)
502 {
503 ui_invalidate(boxx, boxy, boxcx, boxcy);
504 }
505 else
506 {
507 ui_invalidate(clipx, clipy, clipcx, clipcy);
508 }
509}
510
511/*****************************************************************************/
512void
513ui_line(uint8 opcode, int startx, int starty, int endx, int endy,
514 PEN * pen)
515{
516 int x;
517 int y;
518 int cx;
519 int cy;
520
521 bs_line(opcode, startx, starty, endx, endy, pen->width, pen->style,
522 pen->colour);
523 if (pen->style == 0 && pen->width < 2 && opcode == 12)
524 {
525 mi_line(startx, starty, endx, endy, pen->colour);
526 }
527 else
528 {
529 x = MIN(startx, endx);
530 y = MIN(starty, endy);
531 cx = (MAX(startx, endx) + 1) - x;
532 cy = (MAX(starty, endy) + 1) - y;
533 ui_invalidate(x, y, cx, cy);
534 }
535}
536
537/*****************************************************************************/
538void
539ui_triblt(uint8 opcode, int x, int y, int cx, int cy,
540 void * src, int srcx, int srcy,
541 BRUSH* brush, int bgcolour, int fgcolour)
542{
543 /* not used */
544}
545
546/*****************************************************************************/
547void
548ui_memblt(uint8 opcode, int x, int y, int cx, int cy,
549 void * src, int srcx, int srcy)
550{
551 struct bitmap* b;
552
553 b = (struct bitmap*)src;
554 bs_memblt(opcode, x, y, cx, cy, b->data, b->width, b->height,
555 srcx, srcy);
556 ui_invalidate(x, y, cx, cy);
557}
558
559/*****************************************************************************/
560void
561ui_desktop_restore(uint32 offset, int x, int y, int cx, int cy)
562{
563}
564
565/*****************************************************************************/
566void
567ui_desktop_save(uint32 offset, int x, int y, int cx, int cy)
568{
569}
570
571/*****************************************************************************/
572void
573ui_rect(int x, int y, int cx, int cy, int colour)
574{
575 bs_rect(x, y, cx, cy, colour, 12);
576 mi_fill_rect(x, y, cx, cy, colour);
577}
578
579/*****************************************************************************/
580void
581ui_screenblt(uint8 opcode, int x, int y, int cx, int cy,
582 int srcx, int srcy)
583{
584 bs_screenblt(opcode, x, y, cx, cy, srcx, srcy);
585 if (opcode == 12)
586 {
587 mi_screen_copy(x, y, cx, cy, srcx, srcy);
588 }
589 else
590 {
591 ui_invalidate(x, y, cx, cy);
592 }
593}
594
595/*****************************************************************************/
596void
597ui_patblt(uint8 opcode, int x, int y, int cx, int cy,
598 BRUSH * brush, int bgcolour, int fgcolour)
599{
600 bs_patblt(opcode, x, y, cx, cy, brush->style, (char *)brush->pattern,
601 brush->xorigin, brush->yorigin, bgcolour, fgcolour);
602 ui_invalidate(x, y, cx, cy);
603}
604
605/*****************************************************************************/
606void
607ui_destblt(uint8 opcode, int x, int y, int cx, int cy)
608{
609 bs_rect(x, y, cx, cy, 0, opcode);
610 ui_invalidate(x, y, cx, cy);
611 /* todo */
612}
613
614/*****************************************************************************/
615void
617{
618}
619
620/*****************************************************************************/
621uint16
623{
624 return (uint16) state;
625}
626
627/*****************************************************************************/
628/* get the num, caps, and scroll lock state */
629/* scroll lock is 1, num lock is 2 and caps lock is 4 */
630/* just returning 0, the hardware specific file is responsable for this */
631uint32
633{
635}
636
637/*****************************************************************************/
638void
640
641{
642
643 //error("%8.8x", code);
644
646
647}
648
649/*****************************************************************************/
650void
652{
653}
654
655/*****************************************************************************/
656void
658{
660}
661
662/*****************************************************************************/
663void
665{
667}
668
669/*****************************************************************************/
670void
671ui_polygon(uint8 opcode, uint8 fillmode, RD_POINT * point, int npoints,
672 BRUSH * brush, int bgcolour, int fgcolour)
673{
674 /* not used */
675}
676
677/*****************************************************************************/
678void
679ui_polyline(uint8 opcode, RD_POINT * points, int npoints, PEN * pen)
680{
681 int i, x, y, dx, dy;
682 if (npoints > 0)
683 {
684 x = points[0].x;
685 y = points[0].y;
686 for (i = 1; i < npoints; i++)
687 {
688 dx = points[i].x;
689 dy = points[i].y;
690 ui_line(opcode, x, y, x + dx, y + dy, pen);
691 x = x + dx;
692 y = y + dy;
693 }
694 }
695}
696
697/*****************************************************************************/
698void
699ui_ellipse(uint8 opcode, uint8 fillmode,
700 int x, int y, int cx, int cy,
701 BRUSH * brush, int bgcolour, int fgcolour)
702{
703 /* not used */
704}
705
706/*****************************************************************************/
707/* get a 32 byte random */
708void
710{
711 int i;
712
713 rand();
714 rand();
715 for (i = 0; i < 32; i++)
716 {
717 random[i] = rand(); /* higher bits are more random */
718 }
719}
720
721/*****************************************************************************/
722void
724{
725}
726
727/*****************************************************************************/
728int
730{
731 return 0;
732}
733
734/*****************************************************************************/
735void *
736xrealloc(void * in, size_t size)
737{
738 if (size < 1)
739 {
740 size = 1;
741 }
742 return realloc(in, size);
743}
744
745/*****************************************************************************/
746void *
748{
749 if (size < 1)
750 {
751 size = 1;
752 }
753 return malloc(size);
754}
755
756/*****************************************************************************/
757void
758xfree(void * in)
759{
760 if (in != 0)
761 {
762 free(in);
763 }
764}
765
766/*****************************************************************************/
767char *
768xstrdup(const char * s)
769{
770 int len;
771 char * p;
772
773 if (s == 0)
774 {
775 return 0;
776 }
777 len = strlen(s);
778 p = (char *) xmalloc(len + 1);
779 strcpy(p, s);
780 return p;
781}
782
783/*****************************************************************************/
784void
785warning(char * format, ...)
786{
787 va_list ap;
788 char text[512];
789 char text1[512];
790
791 sprintf(text1, "WARNING: ");
794 va_end(ap);
795 strcat(text1, text);
796 mi_warning(text1);
797}
798
799/*****************************************************************************/
800void
801unimpl(char * format, ...)
802{
803 va_list ap;
804 char text[512];
805 char text1[512];
806
807 sprintf(text1, "UNIMPL: ");
810 va_end(ap);
811 strcat(text1, text);
812 mi_warning(text1);
813}
814
815/*****************************************************************************/
816void
817error(char * format, ...)
818{
819 va_list ap;
820 char text[512];
821 char text1[512];
822
823 sprintf(text1, "ERROR: ");
826 va_end(ap);
827 strcat(text1, text);
828 mi_error(text1);
829}
830
831/*****************************************************************************/
832BOOL
834{
835 return 0;
836}
837
838/*****************************************************************************/
839int
841{
842 return 0;
843}
844
845/*****************************************************************************/
846void
848{
849 return;
850}
851
852/*****************************************************************************/
853int
854rd_read_file(int fd, void * ptr, int len)
855{
856 return 0;
857}
858
859/*****************************************************************************/
860int
861rd_write_file(int fd, void * ptr, int len)
862{
863 return 0;
864}
865
866/*****************************************************************************/
867int
869{
870 return 0;
871}
872
873/*****************************************************************************/
874BOOL
875rd_lock_file(int fd, int start, int len)
876{
877 return False;
878}
879
880
881/*****************************************************************************/
882void
884{
886}
887
888
889/*****************************************************************************/
890void
891ui_mouse_button(int button, int x, int y, int down)
892{
894
895 flags = 0;
896 if (down)
897 {
899 }
900 switch (button)
901 {
902 case 1:
904 break;
905 case 2:
907 break;
908 case 3:
910 break;
911 case 4:
913 break;
914 case 5:
916 break;
917 }
919}
920
921
922/*****************************************************************************/
923void
925
926{
928 (uint16) key, 0);
929}
930
931/*****************************************************************************/
932void
934{
936 (uint16) key, 0);
937}
938
939/*****************************************************************************/
940/* returns boolean, non zero is good */
941int
943{
945}
946
947/*****************************************************************************/
948/* called after the command line parameters are processed */
949/* returns boolean, non zero is ok */
950int
952{
954
955 /* try to connect */
957 if (g_password[0] != 0)
958 {
960 }
963 {
964 return 0;
965 }
966 /* init backingstore */
968 /* create the window */
969 if (!mi_create_window())
970 {
971 return 0;
972 }
973 /* if all ok, enter main loop */
974 return mi_main_loop();
975}
976
977/*****************************************************************************/
978/* produce a hex dump */
979void
981{
982 uint8 * line = p;
983 int i, thisline, offset = 0;
984
985 while (offset < (int)len)
986 {
987 printf("%04x ", offset);
988 thisline = len - offset;
989 if (thisline > 16)
990 thisline = 16;
991
992 for (i = 0; i < thisline; i++)
993 printf("%02x ", line[i]);
994
995 for (; i < 16; i++)
996 printf(" ");
997
998 for (i = 0; i < thisline; i++)
999 printf("%c", (line[i] >= 0x20 && line[i] < 0x7f) ? line[i] : '.');
1000
1001 printf("\n");
1002 offset += thisline;
1003 line += thisline;
1004 }
1005}
1006
char * strcat(char *DstString, const char *SrcString)
Definition: utclib.c:568
ACPI_SIZE strlen(const char *String)
Definition: utclib.c:269
char * strcpy(char *DstString, const char *SrcString)
Definition: utclib.c:388
char * va_list
Definition: acmsvcex.h:78
#define va_end(ap)
Definition: acmsvcex.h:90
#define va_start(ap, A)
Definition: acmsvcex.h:91
static int state
Definition: maze.c:121
#define msg(x)
Definition: auth_time.c:54
void cache_put_text(uint8 cache_id, void *data, int length)
Definition: cache.c:335
DATABLOB * cache_get_text(uint8 cache_id)
Definition: cache.c:325
#define RDP_KEYPRESS
Definition: constants.h:251
#define TEXT2_IMPLICIT_X
Definition: constants.h:276
#define MOUSE_FLAG_BUTTON5
Definition: constants.h:259
#define MOUSE_FLAG_DOWN
Definition: constants.h:260
#define RDP_KEYRELEASE
Definition: constants.h:252
#define MOUSE_FLAG_BUTTON1
Definition: constants.h:255
#define MOUSE_FLAG_BUTTON2
Definition: constants.h:256
#define MOUSE_FLAG_BUTTON4
Definition: constants.h:258
#define TEXT2_VERTICAL
Definition: constants.h:275
#define MOUSE_FLAG_BUTTON3
Definition: constants.h:257
#define PERF_DISABLE_CURSOR_SHADOW
Definition: constants.h:349
#define RDP_INFO_AUTOLOGON
Definition: constants.h:335
#define MIX_OPAQUE
Definition: constants.h:273
@ RDP_INPUT_SYNCHRONIZE
Definition: constants.h:231
@ RDP_INPUT_SCANCODE
Definition: constants.h:234
@ RDP_INPUT_MOUSE
Definition: constants.h:235
#define PERF_DISABLE_FULLWINDOWDRAG
Definition: constants.h:346
#define MOUSE_FLAG_MOVE
Definition: constants.h:254
#define PERF_DISABLE_WALLPAPER
Definition: constants.h:345
#define PERF_DISABLE_MENUANIMATIONS
Definition: constants.h:347
#define SEC_RANDOM_SIZE
Definition: constants.h:91
#define RDP_LOGON_NORMAL
Definition: precomp.h:24
void rdp_send_input(uint32 time, uint16 message_type, uint16 device_flags, uint16 param1, uint16 param2)
Definition: rdp.c:551
RD_BOOL rdp_connect(char *server, uint32 flags, char *domain, char *password, char *command, char *directory, RD_BOOL reconnect)
Definition: rdp.c:1742
RD_BOOL rdp_loop(RD_BOOL *deactivated, uint32 *ext_disc_reason)
Definition: rdp.c:1695
#define MIN(x, y)
Definition: rdesktop.h:171
#define MAX(x, y)
Definition: rdesktop.h:175
unsigned short uint16
Definition: types.h:30
unsigned int uint32
Definition: types.h:32
#define False
Definition: types.h:25
@ RDP_V5
Definition: types.h:44
enum _RDP_VERSION RDP_VERSION
int RD_BOOL
Definition: types.h:21
#define True
Definition: types.h:24
unsigned char uint8
Definition: types.h:28
void bs_screenblt(int rop, int x, int y, int cx, int cy, int srcx, int srcy)
Definition: bsops.c:469
void bs_copy_box(char *dst, int x, int y, int cx, int cy, int line_size)
Definition: bsops.c:793
void bs_patblt(int opcode, int x, int y, int cx, int cy, int brush_style, char *brush_pattern, int brush_x_org, int brush_y_org, int bgcolour, int fgcolour)
Definition: bsops.c:744
void bs_init(int width, int height, int bpp)
Definition: bsops.c:158
void bs_set_clip(int x, int y, int cx, int cy)
Definition: bsops.c:189
int bs_warp_coords(int *x, int *y, int *cx, int *cy, int *srcx, int *srcy)
Definition: bsops.c:331
int bs_is_pixel_on(char *data, int x, int y, int width, int bpp)
Definition: bsops.c:210
void bs_set_pixel_on(char *data, int x, int y, int width, int bpp, int pixel)
Definition: bsops.c:246
void bs_memblt(int opcode, int x, int y, int cx, int cy, void *srcdata, int srcwidth, int srcheight, int srcx, int srcy)
Definition: bsops.c:560
void bs_draw_glyph(int x, int y, char *glyph_data, int glyph_width, int glyph_height, int fgcolour)
Definition: bsops.c:640
void bs_rect(int x, int y, int cx, int cy, int colour, int rop)
Definition: bsops.c:386
void bs_line(int opcode, int startx, int starty, int endx, int endy, int pen_width, int pen_style, int pen_colour)
Definition: bsops.c:661
void bs_reset_clip(void)
Definition: bsops.c:199
Definition: brush.hpp:16
Definition: _map.h:48
#define realloc
Definition: debug_ros.c:6
#define free
Definition: debug_ros.c:5
#define malloc
Definition: debug_ros.c:4
#define NULL
Definition: types.h:112
#define FALSE
Definition: types.h:117
static const WCHAR *const ext[]
Definition: module.c:53
const WCHAR * text
Definition: package.c:1799
__kernel_time_t time_t
Definition: linux.h:252
POINTL point
Definition: edittest.c:50
unsigned int BOOL
Definition: ntddk_ex.h:94
#define printf
Definition: freeldr.h:94
GLuint start
Definition: gl.h:1545
GLint GLint GLint GLint GLint x
Definition: gl.h:1548
GLdouble s
Definition: gl.h:2039
GLint GLint GLint GLint GLint GLint y
Definition: gl.h:1548
GLint GLenum GLsizei GLsizei GLsizei GLint GLsizei const GLvoid * data
Definition: gl.h:1950
GLint GLint GLsizei GLsizei GLsizei GLint GLenum format
Definition: gl.h:1546
GLint GLint GLsizei GLsizei height
Definition: gl.h:1546
GLint GLint GLsizei width
Definition: gl.h:1546
GLsizeiptr size
Definition: glext.h:5919
GLdouble n
Definition: glext.h:7729
GLenum src
Definition: glext.h:6340
GLboolean GLboolean GLboolean b
Definition: glext.h:6204
GLuint in
Definition: glext.h:9616
GLbitfield flags
Definition: glext.h:7161
GLuint GLsizei GLsizei * length
Definition: glext.h:6040
GLfloat GLfloat p
Definition: glext.h:8902
GLenum GLsizei len
Definition: glext.h:6722
GLsizei const GLfloat * points
Definition: glext.h:8112
GLintptr offset
Definition: glext.h:5920
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
Definition: glfuncs.h:248
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
Definition: glfuncs.h:250
#define down(mutex)
Definition: glue.h:29
const char cursor[]
Definition: icontest.c:13
int __cdecl vsprintf(char *_Dest, const char *_Format, va_list _Args)
Definition: sprintf.c:733
_Check_return_ int __cdecl rand(void)
Definition: rand.c:10
const char * filename
Definition: ioapi.h:137
uint32_t entry
Definition: isohybrid.c:63
#define b
Definition: ke_i.h:79
GLint dy
Definition: linetemp.h:97
GLint dx
Definition: linetemp.h:97
#define error(str)
Definition: mkdosfs.c:1605
#define memcpy(s1, s2, n)
Definition: mkisofs.h:878
static PVOID ptr
Definition: dispmode.c:27
#define sprintf(buf, format,...)
Definition: sprintf.c:55
BITMAP bmp
Definition: alphablend.c:62
DWORD button
Definition: button.c:166
Definition: mk_font.cpp:20
_Out_opt_ int _Out_opt_ int * cy
Definition: commctrl.h:586
_Out_opt_ int * cx
Definition: commctrl.h:585
#define random
Definition: rosdhcp.h:81
#define warning(s)
Definition: debug.h:83
#define exit(n)
Definition: config.h:202
static int fd
Definition: io.c:51
#define memset(x, y, z)
Definition: compat.h:39
uint8 red
Definition: types.h:57
uint8 blue
Definition: types.h:59
uint8 green
Definition: types.h:58
uint16 ncolours
Definition: types.h:66
COLOURENTRY * colours
Definition: types.h:67
Definition: types.h:83
uint8 style
Definition: types.h:84
uint8 width
Definition: types.h:85
uint32 colour
Definition: types.h:86
Definition: uimain.c:89
uint8 * data
Definition: uimain.c:90
uint32 width
Definition: uimain.c:91
uint32 height
Definition: uimain.c:92
Definition: inflate.c:139
Definition: copy.c:22
Definition: parser.c:49
static void draw_glyph(int x, int y, void *glyph, int fgcolor)
Definition: uimain.c:360
void ui_mouse_move(int x, int y)
Definition: uimain.c:883
void ui_key_down(int key, int ext)
Definition: uimain.c:924
int g_server_depth
Definition: uimain.c:41
RD_BOOL g_bitmap_cache_precache
Definition: uimain.c:38
void ui_rect(int x, int y, int cx, int cy, int colour)
Definition: uimain.c:573
void * ui_create_colourmap(COLOURMAP *colours)
Definition: uimain.c:336
void ui_bell(void)
Definition: uimain.c:158
BOOL rd_pstcache_mkdir(void)
Definition: uimain.c:833
void ui_patblt(uint8 opcode, int x, int y, int cx, int cy, BRUSH *brush, int bgcolour, int fgcolour)
Definition: uimain.c:597
void mi_fill_rect(int x, int y, int cx, int cy, int colour)
Definition: win32.c:1194
int g_width
Definition: uimain.c:42
void ui_memblt(uint8 opcode, int x, int y, int cx, int cy, void *src, int srcx, int srcy)
Definition: uimain.c:548
#define DO_GLYPH(ttext, idx)
Definition: uimain.c:369
void ui_triblt(uint8 opcode, int x, int y, int cx, int cy, void *src, int srcx, int srcy, BRUSH *brush, int bgcolour, int fgcolour)
Definition: uimain.c:539
int mi_create_window(void)
Definition: win32.c:754
void ui_destroy_bitmap(void *bmp)
Definition: uimain.c:293
int g_height
Definition: uimain.c:43
void ui_invalidate(int x, int y, int cx, int cy)
Definition: uimain.c:138
int rd_write_file(int fd, void *ptr, int len)
Definition: uimain.c:861
BOOL rd_lock_file(int fd, int start, int len)
Definition: uimain.c:875
int g_tcp_port_rdp
Definition: tcp.c:75
void * ui_create_bitmap(int width, int height, uint8 *data)
Definition: uimain.c:277
void ui_polygon(uint8 opcode, uint8 fillmode, RD_POINT *point, int npoints, BRUSH *brush, int bgcolour, int fgcolour)
Definition: uimain.c:671
void ui_destroy_cursor(void *cursor)
Definition: uimain.c:213
char * xstrdup(const char *s)
Definition: uimain.c:768
void ui_screenblt(uint8 opcode, int x, int y, int cx, int cy, int srcx, int srcy)
Definition: uimain.c:581
int rd_read_file(int fd, void *ptr, int len)
Definition: uimain.c:854
void ui_set_null_cursor(void)
Definition: uimain.c:227
int g_keyboard_type
Definition: uimain.c:45
void ui_paint_bitmap(int x, int y, int cx, int cy, int width, int height, uint8 *data)
Definition: uimain.c:307
char g_shell[256]
Definition: uimain.c:29
int ui_main(void)
Definition: uimain.c:951
void ui_desktop_save(uint32 offset, int x, int y, int cx, int cy)
Definition: uimain.c:567
uint32 g_keylayout
Definition: uimain.c:44
void ui_ellipse(uint8 opcode, uint8 fillmode, int x, int y, int cx, int cy, BRUSH *brush, int bgcolour, int fgcolour)
Definition: uimain.c:699
int ui_select(int in)
Definition: uimain.c:164
void * xrealloc(void *in, size_t size)
Definition: uimain.c:736
char g_redirect_username[256]
Definition: uimain.c:60
RD_BOOL g_numlock_sync
Definition: uimain.c:80
int g_keyboard_functionkeys
Definition: uimain.c:47
char g_servername[256]
Definition: uimain.c:27
void mi_set_clip(int x, int y, int cx, int cy)
Definition: win32.c:1325
int load_licence(uint8 **data)
Definition: uimain.c:729
void rd_close_file(int fd)
Definition: uimain.c:847
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)
Definition: uimain.c:412
RD_BOOL g_redirect
Definition: uimain.c:55
RD_BOOL g_encryption_initial
Definition: uimain.c:75
void ui_set_colourmap(void *map)
Definition: uimain.c:354
RD_BOOL g_encryption
Definition: uimain.c:40
void mi_warning(char *msg)
Definition: win32.c:848
void ui_set_cursor(void *cursor)
Definition: uimain.c:220
char g_directory[256]
Definition: uimain.c:30
void xfree(void *in)
Definition: uimain.c:758
void * ui_create_cursor(unsigned int x, unsigned int y, int width, int height, uint8 *andmask, uint8 *xormask, int xor_bpp)
Definition: uimain.c:175
void mi_set_cursor(void *cursor)
Definition: win32.c:1372
RD_BOOL g_pending_resize
Definition: uimain.c:79
void unimpl(char *format,...)
Definition: uimain.c:801
RD_BOOL g_network_error
Definition: uimain.c:77
void mi_reset_clip(void)
Definition: win32.c:1335
uint32 g_redirect_domain_len
Definition: uimain.c:59
uint32 g_redirect_cookie_len
Definition: uimain.c:65
RDP_VERSION g_rdp_version
Definition: uimain.c:74
uint32 g_rdp5_performanceflags
Definition: uimain.c:35
uint16 ui_get_numlock_state(uint32 state)
Definition: uimain.c:622
void ui_line(uint8 opcode, int startx, int starty, int endx, int endy, PEN *pen)
Definition: uimain.c:513
time_t g_reconnect_random_ts
Definition: uimain.c:84
uint32 g_redirect_server_len
Definition: uimain.c:57
int g_tcp_sck
Definition: uimain.c:51
int mi_main_loop(void)
Definition: win32.c:834
static uint32 g_ext_disc_reason
Definition: uimain.c:72
uint8 g_redirect_cookie[256]
Definition: uimain.c:64
void mi_screen_copy(int x, int y, int cx, int cy, int srcx, int srcy)
Definition: win32.c:1283
int g_keyboard_subtype
Definition: uimain.c:46
RD_BOOL g_bitmap_cache_persist_enable
Definition: uimain.c:37
void ui_destblt(uint8 opcode, int x, int y, int cx, int cy)
Definition: uimain.c:607
uint32 g_redirect_lb_info_len
Definition: uimain.c:63
int ui_read_wire(void)
Definition: uimain.c:942
void ui_desktop_restore(uint32 offset, int x, int y, int cx, int cy)
Definition: uimain.c:561
char g_hostname[256]
Definition: uimain.c:26
char g_password[256]
Definition: uimain.c:28
void ui_set_clip(int x, int y, int cx, int cy)
Definition: uimain.c:320
void mi_end_update(void)
Definition: win32.c:1188
RD_BOOL g_user_quit
Definition: uimain.c:76
void * mi_create_cursor(unsigned int x, unsigned int y, int width, int height, unsigned char *andmask, unsigned char *xormask)
Definition: win32.c:1345
void mi_begin_update(void)
Definition: win32.c:1182
void ui_mouse_button(int button, int x, int y, int down)
Definition: uimain.c:891
void mi_paint_rect(char *data, int width, int height, int x, int y, int cx, int cy)
Definition: win32.c:874
void ui_resize_window(void)
Definition: uimain.c:651
uint32 g_reconnect_logonid
Definition: uimain.c:82
char g_username[256]
Definition: uimain.c:25
int pal_entries[256]
Definition: uimain.c:52
void * ui_create_glyph(int width, int height, uint8 *data)
Definition: uimain.c:234
uint32 g_redirect_username_len
Definition: uimain.c:61
uint8 g_client_random[SEC_RANDOM_SIZE]
Definition: uimain.c:78
uint32 g_redirect_session_id
Definition: uimain.c:67
void ui_key_up(int key, int ext)
Definition: uimain.c:933
void hexdump(uint8 *p, uint32 len)
Definition: uimain.c:980
RD_BOOL g_has_reconnect_random
Definition: uimain.c:85
RD_BOOL g_bitmap_cache
Definition: uimain.c:39
void ui_reset_clip(void)
Definition: uimain.c:328
void save_licence(uint8 *data, int length)
Definition: uimain.c:723
void ui_begin_update(void)
Definition: uimain.c:657
char g_redirect_domain[256]
Definition: uimain.c:58
void ui_polyline(uint8 opcode, RD_POINT *points, int npoints, PEN *pen)
Definition: uimain.c:679
void mi_line(int x1, int y1, int x2, int y2, int colour)
Definition: win32.c:1239
int rd_lseek_file(int fd, int offset)
Definition: uimain.c:868
uint32 read_keyboard_state(void)
Definition: uimain.c:632
int rd_open_file(char *filename)
Definition: uimain.c:840
void ui_move_pointer(int x, int y)
Definition: uimain.c:616
static int g_deactivated
Definition: uimain.c:71
void generate_random(uint8 *random)
Definition: uimain.c:709
void * xmalloc(int size)
Definition: uimain.c:747
RD_BOOL g_reconnect_loop
Definition: uimain.c:86
char g_domain[256]
Definition: uimain.c:31
uint32 g_redirect_flags
Definition: uimain.c:66
void mi_destroy_cursor(void *cursor)
Definition: win32.c:1361
RD_BOOL g_console_session
Definition: uimain.c:48
void mi_set_null_cursor(void)
Definition: win32.c:1380
void ui_end_update(void)
Definition: uimain.c:664
void ui_destroy_glyph(void *glyph)
Definition: uimain.c:263
void mi_error(char *msg)
Definition: win32.c:131
RD_BOOL g_desktop_save
Definition: uimain.c:32
void ui_set_modifier_state(int code)
Definition: uimain.c:639
char g_reconnect_random[16]
Definition: uimain.c:83
char g_redirect_server[256]
Definition: uimain.c:56
int mi_read_keyboard_state(void)
Definition: win32.c:232
RD_BOOL g_polygon_ellipse_orders
Definition: uimain.c:33
uint8 g_redirect_lb_info[256]
Definition: uimain.c:62
RD_BOOL g_bitmap_compression
Definition: uimain.c:34
_In_ CLIPOBJ _In_ BRUSHOBJ _In_ LONG _In_ LONG _In_ LONG x2
Definition: winddi.h:3710
_In_ CLIPOBJ _In_ BRUSHOBJ _In_ LONG _In_ LONG y1
Definition: winddi.h:3709
_In_ CLIPOBJ _In_ BRUSHOBJ _In_ LONG x1
Definition: winddi.h:3708
_In_ CLIPOBJ _In_ BRUSHOBJ _In_ LONG _In_ LONG _In_ LONG _In_ LONG y2
Definition: winddi.h:3711
void int int ULONGLONG int va_list * ap
Definition: winesup.h:36