ReactOS  0.4.12-dev-43-g63b00d8
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 
25 char g_username[256] = "";
26 char g_hostname[256] = "";
27 char g_servername[256] = "";
28 char g_password[256] = "";
29 char g_shell[256] = "";
30 char g_directory[256] = "";
31 char g_domain[256] = "";
32 RD_BOOL g_desktop_save = False; /* desktop save order */
33 RD_BOOL g_polygon_ellipse_orders = False; /* polygon / ellipse orders */
41 int g_server_depth = 16;
42 int g_width = 800;
43 int g_height = 600;
44 uint32 g_keylayout = 0x409; /* Defaults to US keyboard layout */
45 int g_keyboard_type = 0x4; /* Defaults to US keyboard layout */
46 int g_keyboard_subtype = 0x0; /* Defaults to US keyboard layout */
47 int g_keyboard_functionkeys = 0xc; /* Defaults to US keyboard layout */
49 
50 /* can't be static, hardware file or bsops need these */
51 int g_tcp_sck = 0;
52 int pal_entries[256];
53 
54 /* Session Directory redirection */
68 
69 extern int g_tcp_port_rdp;
70 
71 static int g_deactivated = 0;
73 
74 RDP_VERSION g_rdp_version = RDP_V5; /* Default to version 5 */
81 
87 
88 struct bitmap
89 {
93 };
94 
95 /* in ui specific file eg win32.c, qt.c, df.c, ... */
96 int
97 mi_create_window(void);
98 int
99 mi_main_loop(void);
100 void
101 mi_error(char * msg);
102 void
103 mi_warning(char * msg);
104 void
105 mi_paint_rect(char * data, int width, int height, int x, int y, int cx, int cy);
106 void
107 mi_begin_update(void);
108 void
109 mi_end_update(void);
110 void
111 mi_fill_rect(int x, int y, int cx, int cy, int colour);
112 void
113 mi_screen_copy(int x, int y, int cx, int cy, int srcx, int srcy);
114 void
115 mi_set_clip(int x, int y, int cx, int cy);
116 void
117 mi_reset_clip(void);
118 void
119 mi_line(int x1, int y1, int x2, int y2, int colour);
120 void*
121 mi_create_cursor(unsigned int x, unsigned int y,
122  int width, int height,
123  unsigned char * andmask, unsigned char * xormask);
124 
125 
126 void
127 mi_destroy_cursor(void * cursor);
128 void
129 mi_set_cursor(void * cursor);
130 void
131 mi_set_null_cursor(void);
132 int
134 
135 /*****************************************************************************/
136 /* put part of the screen from the backing store to the display */
137 void
138 ui_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 /*****************************************************************************/
157 void
158 ui_bell(void)
159 {
160 }
161 
162 /*****************************************************************************/
163 int
165 {
166  if (g_tcp_sck == 0)
167  {
168  g_tcp_sck = in;
169  }
170  return 1;
171 }
172 
173 /*****************************************************************************/
174 void *
175 ui_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 /*****************************************************************************/
212 void
214 {
215  mi_destroy_cursor(cursor);
216 }
217 
218 /*****************************************************************************/
219 void
221 {
222  mi_set_cursor(cursor);
223 }
224 
225 /*****************************************************************************/
226 void
228 {
230 }
231 
232 /*****************************************************************************/
233 void *
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 /*****************************************************************************/
262 void
263 ui_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 /*****************************************************************************/
276 void *
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 /*****************************************************************************/
292 void
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 /*****************************************************************************/
306 void
307 ui_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 /*****************************************************************************/
319 void
320 ui_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 /*****************************************************************************/
327 void
329 {
330  bs_reset_clip();
331  mi_reset_clip();
332 }
333 
334 /*****************************************************************************/
335 void *
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 /*****************************************************************************/
353 void
355 {
356 }
357 
358 /*****************************************************************************/
359 static void
360 draw_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 /*****************************************************************************/
411 void
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 /*****************************************************************************/
512 void
513 ui_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 /*****************************************************************************/
538 void
539 ui_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 /*****************************************************************************/
547 void
548 ui_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 /*****************************************************************************/
560 void
561 ui_desktop_restore(uint32 offset, int x, int y, int cx, int cy)
562 {
563 }
564 
565 /*****************************************************************************/
566 void
567 ui_desktop_save(uint32 offset, int x, int y, int cx, int cy)
568 {
569 }
570 
571 /*****************************************************************************/
572 void
573 ui_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 /*****************************************************************************/
580 void
581 ui_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 /*****************************************************************************/
596 void
597 ui_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 /*****************************************************************************/
606 void
607 ui_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 /*****************************************************************************/
615 void
616 ui_move_pointer(int x, int y)
617 {
618 }
619 
620 /*****************************************************************************/
621 uint16
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 */
631 uint32
633 {
634  return (uint32) mi_read_keyboard_state();
635 }
636 
637 /*****************************************************************************/
638 void
640 
641 {
642 
643  //error("%8.8x", code);
644 
645  rdp_send_input(0, RDP_INPUT_SYNCHRONIZE, 0, (uint16) code, 0);
646 
647 }
648 
649 /*****************************************************************************/
650 void
652 {
653 }
654 
655 /*****************************************************************************/
656 void
658 {
659  mi_begin_update();
660 }
661 
662 /*****************************************************************************/
663 void
665 {
666  mi_end_update();
667 }
668 
669 /*****************************************************************************/
670 void
671 ui_polygon(uint8 opcode, uint8 fillmode, RD_POINT * point, int npoints,
672  BRUSH * brush, int bgcolour, int fgcolour)
673 {
674  /* not used */
675 }
676 
677 /*****************************************************************************/
678 void
679 ui_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 /*****************************************************************************/
698 void
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 */
708 void
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 /*****************************************************************************/
722 void
724 {
725 }
726 
727 /*****************************************************************************/
728 int
730 {
731  return 0;
732 }
733 
734 /*****************************************************************************/
735 void *
736 xrealloc(void * in, size_t size)
737 {
738  if (size < 1)
739  {
740  size = 1;
741  }
742  return realloc(in, size);
743 }
744 
745 /*****************************************************************************/
746 void *
748 {
749  if (size < 1)
750  {
751  size = 1;
752  }
753  return malloc(size);
754 }
755 
756 /*****************************************************************************/
757 void
758 xfree(void * in)
759 {
760  if (in != 0)
761  {
762  free(in);
763  }
764 }
765 
766 /*****************************************************************************/
767 char *
768 xstrdup(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 /*****************************************************************************/
784 void
785 warning(char * format, ...)
786 {
787  va_list ap;
788  char text[512];
789  char text1[512];
790 
791  sprintf(text1, "WARNING: ");
792  va_start(ap, format);
793  vsprintf(text, format, ap);
794  va_end(ap);
795  strcat(text1, text);
796  mi_warning(text1);
797 }
798 
799 /*****************************************************************************/
800 void
801 unimpl(char * format, ...)
802 {
803  va_list ap;
804  char text[512];
805  char text1[512];
806 
807  sprintf(text1, "UNIMPL: ");
808  va_start(ap, format);
809  vsprintf(text, format, ap);
810  va_end(ap);
811  strcat(text1, text);
812  mi_warning(text1);
813 }
814 
815 /*****************************************************************************/
816 void
817 error(char * format, ...)
818 {
819  va_list ap;
820  char text[512];
821  char text1[512];
822 
823  sprintf(text1, "ERROR: ");
824  va_start(ap, format);
825  vsprintf(text, format, ap);
826  va_end(ap);
827  strcat(text1, text);
828  mi_error(text1);
829 }
830 
831 /*****************************************************************************/
832 BOOL
834 {
835  return 0;
836 }
837 
838 /*****************************************************************************/
839 int
841 {
842  return 0;
843 }
844 
845 /*****************************************************************************/
846 void
848 {
849  return;
850 }
851 
852 /*****************************************************************************/
853 int
854 rd_read_file(int fd, void * ptr, int len)
855 {
856  return 0;
857 }
858 
859 /*****************************************************************************/
860 int
861 rd_write_file(int fd, void * ptr, int len)
862 {
863  return 0;
864 }
865 
866 /*****************************************************************************/
867 int
869 {
870  return 0;
871 }
872 
873 /*****************************************************************************/
874 BOOL
875 rd_lock_file(int fd, int start, int len)
876 {
877  return False;
878 }
879 
880 
881 /*****************************************************************************/
882 void
883 ui_mouse_move(int x, int y)
884 {
886 }
887 
888 
889 /*****************************************************************************/
890 void
891 ui_mouse_button(int button, int x, int y, int down)
892 {
893  uint16 flags;
894 
895  flags = 0;
896  if (down)
897  {
898  flags |= MOUSE_FLAG_DOWN;
899  }
900  switch (button)
901  {
902  case 1:
903  flags |= MOUSE_FLAG_BUTTON1;
904  break;
905  case 2:
906  flags |= MOUSE_FLAG_BUTTON2;
907  break;
908  case 3:
909  flags |= MOUSE_FLAG_BUTTON3;
910  break;
911  case 4:
912  flags |= MOUSE_FLAG_BUTTON4;
913  break;
914  case 5:
915  flags |= MOUSE_FLAG_BUTTON5;
916  break;
917  }
918  rdp_send_input(0, RDP_INPUT_MOUSE, flags, (uint16) x, (uint16) y);
919 }
920 
921 
922 /*****************************************************************************/
923 void
924 ui_key_down(int key, int ext)
925 
926 {
928  (uint16) key, 0);
929 }
930 
931 /*****************************************************************************/
932 void
933 ui_key_up(int key, int ext)
934 {
936  (uint16) key, 0);
937 }
938 
939 /*****************************************************************************/
940 /* returns boolean, non zero is good */
941 int
943 {
945 }
946 
947 /*****************************************************************************/
948 /* called after the command line parameters are processed */
949 /* returns boolean, non zero is ok */
950 int
951 ui_main(void)
952 {
953  uint32 flags;
954 
955  /* try to connect */
956  flags = RDP_LOGON_NORMAL;
957  if (g_password[0] != 0)
958  {
959  flags |= RDP_INFO_AUTOLOGON;
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 */
979 void
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 
#define realloc
Definition: debug_ros.c:6
_In_ CLIPOBJ _In_ BRUSHOBJ _In_ LONG _In_ LONG y1
Definition: winddi.h:3706
char * xstrdup(const char *s)
Definition: uimain.c:768
int mi_create_window(void)
Definition: win32.c:754
uint32 g_reconnect_logonid
Definition: uimain.c:82
int g_tcp_port_rdp
Definition: tcp.c:75
#define RDP_LOGON_NORMAL
Definition: precomp.h:24
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 ui_destblt(uint8 opcode, int x, int y, int cx, int cy)
Definition: uimain.c:607
char g_password[256]
Definition: uimain.c:28
void * xrealloc(void *in, size_t size)
Definition: uimain.c:736
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
void ui_destroy_glyph(void *glyph)
Definition: uimain.c:263
void ui_set_colourmap(void *map)
Definition: uimain.c:354
uint32 g_redirect_lb_info_len
Definition: uimain.c:63
GLint GLint GLsizei width
Definition: gl.h:1546
void bs_copy_box(char *dst, int x, int y, int cx, int cy, int line_size)
Definition: bsops.c:793
void * ui_create_colourmap(COLOURMAP *colours)
Definition: uimain.c:336
#define RDP_KEYPRESS
Definition: constants.h:251
GLenum GLclampf GLint GLenum GLuint GLenum GLenum GLsizei GLenum const GLvoid GLfloat GLfloat GLfloat GLfloat GLclampd GLint 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 GLboolean GLboolean GLboolean GLint GLenum GLsizei const GLvoid GLenum GLint GLenum GLint GLint GLsizei GLint GLenum GLint GLint GLint GLint GLsizei GLenum GLsizei const GLuint GLboolean GLenum GLenum GLint GLsizei GLenum GLsizei GLenum const GLvoid GLboolean const GLboolean GLenum const GLdouble const GLfloat const GLdouble const GLfloat GLenum GLint GLint GLint GLint GLint GLint j
Definition: glfuncs.h:98
void mi_begin_update(void)
Definition: win32.c:1182
void mi_set_clip(int x, int y, int cx, int cy)
Definition: win32.c:1325
#define DO_GLYPH(ttext, idx)
Definition: uimain.c:369
RD_BOOL g_user_quit
Definition: uimain.c:76
uint16 ncolours
Definition: types.h:66
int g_width
Definition: uimain.c:42
void mi_destroy_cursor(void *cursor)
Definition: win32.c:1361
uint32 g_redirect_flags
Definition: uimain.c:66
static int g_deactivated
Definition: uimain.c:71
void ui_paint_bitmap(int x, int y, int cx, int cy, int width, int height, uint8 *data)
Definition: uimain.c:307
void ui_begin_update(void)
Definition: uimain.c:657
int mi_read_keyboard_state(void)
Definition: win32.c:232
uint32 width
Definition: uimain.c:91
void ui_set_null_cursor(void)
Definition: uimain.c:227
void ui_set_modifier_state(int code)
Definition: uimain.c:639
int size
Definition: types.h:124
char * strcat(char *DstString, const char *SrcString)
Definition: utclib.c:568
void ui_polygon(uint8 opcode, uint8 fillmode, RD_POINT *point, int npoints, BRUSH *brush, int bgcolour, int fgcolour)
Definition: uimain.c:671
#define TEXT2_IMPLICIT_X
Definition: constants.h:276
ACPI_SIZE strlen(const char *String)
Definition: utclib.c:269
Definition: mk_font.cpp:20
void rd_close_file(int fd)
Definition: uimain.c:847
const WCHAR * text
Definition: package.c:1827
char g_username[256]
Definition: uimain.c:25
unsigned int uint32
Definition: types.h:32
#define free
Definition: debug_ros.c:5
_In_ CLIPOBJ _In_ BRUSHOBJ _In_ LONG x1
Definition: winddi.h:3706
Definition: types.h:82
uint8_t entry
Definition: isohybrid.c:63
void mi_paint_rect(char *data, int width, int height, int x, int y, int cx, int cy)
Definition: win32.c:874
int ui_main(void)
Definition: uimain.c:951
GLenum GLclampf GLint GLenum GLuint GLenum GLenum GLsizei GLenum const GLvoid GLfloat GLfloat GLfloat GLfloat GLclampd GLint 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 GLboolean GLboolean GLboolean GLint GLenum GLsizei const GLvoid GLenum GLint GLenum GLint GLint GLsizei GLint GLenum GLint GLint GLint GLint GLsizei GLenum GLsizei const GLuint GLboolean GLenum GLenum GLint GLsizei GLenum GLsizei GLenum const GLvoid GLboolean const GLboolean GLenum const GLdouble const GLfloat const GLdouble const GLfloat GLenum GLint GLint GLint GLint GLint GLint GLenum GLfloat GLenum GLint GLenum GLsizei GLenum GLboolean GLenum GLdouble GLenum GLfloat GLenum GLenum GLfloat GLenum GLenum GLdouble GLenum GLenum GLint GLenum GLenum GLint GLenum GLuint GLenum GLvoid const GLubyte GLenum GLenum GLenum GLint GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLvoid GLenum GLint GLenum GLint GLenum GLenum GLint GLuint GLdouble GLfloat GLint GLshort GLubyte GLenum GLuint GLenum const GLfloat GLenum const GLint GLenum GLenum const GLfloat GLenum GLenum const GLint GLfloat const GLfloat GLenum opcode
Definition: glfuncs.h:172
void ui_rect(int x, int y, int cx, int cy, int colour)
Definition: uimain.c:573
GLintptr offset
Definition: glext.h:5920
void ui_destroy_cursor(void *cursor)
Definition: uimain.c:213
void ui_reset_clip(void)
Definition: uimain.c:328
int g_keyboard_functionkeys
Definition: uimain.c:47
void * ui_create_glyph(int width, int height, uint8 *data)
Definition: uimain.c:234
void mi_error(char *msg)
Definition: win32.c:131
#define MIX_OPAQUE
Definition: constants.h:273
#define MOUSE_FLAG_BUTTON1
Definition: constants.h:255
uint16 ui_get_numlock_state(uint32 state)
Definition: uimain.c:622
char g_domain[256]
Definition: uimain.c:31
static int fd
Definition: io.c:51
#define PERF_DISABLE_CURSOR_SHADOW
Definition: constants.h:349
void bs_draw_glyph(int x, int y, char *glyph_data, int glyph_width, int glyph_height, int fgcolour)
Definition: bsops.c:640
int rd_open_file(char *filename)
Definition: uimain.c:840
RD_BOOL g_desktop_save
Definition: uimain.c:32
void warning(char *format,...)
Definition: uimain.c:785
char g_shell[256]
Definition: uimain.c:29
int rd_lseek_file(int fd, int offset)
Definition: uimain.c:868
void mi_line(int x1, int y1, int x2, int y2, int colour)
Definition: win32.c:1239
const char * filename
Definition: ioapi.h:135
uint8 * data
Definition: uimain.c:90
void ui_key_up(int key, int ext)
Definition: uimain.c:933
time_t g_reconnect_random_ts
Definition: uimain.c:84
static uint32 g_ext_disc_reason
Definition: uimain.c:72
POINTL point
Definition: edittest.c:50
GLint GLint GLsizei GLsizei GLsizei GLint GLenum format
Definition: gl.h:1546
RD_BOOL g_bitmap_cache
Definition: uimain.c:39
#define MOUSE_FLAG_BUTTON4
Definition: constants.h:258
T MIN(T a, T b)
Definition: polytest.cpp:79
char g_redirect_username[256]
Definition: uimain.c:60
#define down(mutex)
Definition: glue.h:29
INT INT y
Definition: msvc.h:62
#define sprintf(buf, format,...)
Definition: sprintf.c:55
GLuint n
Definition: s_context.h:57
sint16 x
Definition: types.h:51
GLuint const GLubyte GLvoid * src
Definition: s_context.h:57
RD_BOOL rdp_loop(RD_BOOL *deactivated, uint32 *ext_disc_reason)
Definition: rdp.c:1695
char g_directory[256]
Definition: uimain.c:30
void mi_reset_clip(void)
Definition: win32.c:1335
GLenum GLclampf GLint i
Definition: glfuncs.h:14
#define MOUSE_FLAG_DOWN
Definition: constants.h:260
void bs_rect(int x, int y, int cx, int cy, int colour, int rop)
Definition: bsops.c:386
RD_BOOL rdp_connect(char *server, uint32 flags, char *domain, char *password, char *command, char *directory, RD_BOOL reconnect)
Definition: rdp.c:1742
#define va_end(ap)
Definition: acmsvcex.h:90
void ui_mouse_button(int button, int x, int y, int down)
Definition: uimain.c:891
uint8 g_redirect_lb_info[256]
Definition: uimain.c:62
int g_keyboard_subtype
Definition: uimain.c:46
_Check_return_ int __cdecl rand(void)
Definition: rand.c:10
void xfree(void *in)
Definition: uimain.c:758
void mi_end_update(void)
Definition: win32.c:1188
int g_server_depth
Definition: uimain.c:41
RD_BOOL g_console_session
Definition: uimain.c:48
uint8 g_client_random[SEC_RANDOM_SIZE]
Definition: uimain.c:78
static PVOID ptr
Definition: dispmode.c:27
uint8 width
Definition: types.h:85
int bs_is_pixel_on(char *data, int x, int y, int width, int bpp)
Definition: bsops.c:210
_Out_opt_ int _Out_opt_ int * cy
Definition: commctrl.h:570
void bs_reset_clip(void)
Definition: bsops.c:199
int g_height
Definition: uimain.c:43
void cache_put_text(uint8 cache_id, void *data, int length)
Definition: cache.c:335
RD_BOOL g_reconnect_loop
Definition: uimain.c:86
UINT msg
Definition: msvc.h:92
smooth NULL
Definition: ftsmooth.c:416
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
char ext[3]
Definition: mkdosfs.c:358
Definition: parser.c:48
char * va_list
Definition: acmsvcex.h:78
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
BOOL rd_pstcache_mkdir(void)
Definition: uimain.c:833
#define MOUSE_FLAG_BUTTON3
Definition: constants.h:257
int RD_BOOL
Definition: types.h:21
uint8 blue
Definition: types.h:59
char g_redirect_domain[256]
Definition: uimain.c:58
uint32 g_redirect_session_id
Definition: uimain.c:67
#define b
Definition: ke_i.h:79
RD_BOOL g_redirect
Definition: uimain.c:55
COLOURENTRY * colours
Definition: types.h:67
void save_licence(uint8 *data, int length)
Definition: uimain.c:723
int bs_warp_coords(int *x, int *y, int *cx, int *cy, int *srcx, int *srcy)
Definition: bsops.c:331
void ui_set_clip(int x, int y, int cx, int cy)
Definition: uimain.c:320
RD_BOOL g_encryption
Definition: uimain.c:40
uint32 g_redirect_cookie_len
Definition: uimain.c:65
RD_BOOL g_bitmap_compression
Definition: uimain.c:34
Definition: uimain.c:88
#define True
Definition: types.h:24
static void draw_glyph(int x, int y, void *glyph, int fgcolor)
Definition: uimain.c:360
void rdp_send_input(uint32 time, uint16 message_type, uint16 device_flags, uint16 param1, uint16 param2)
Definition: rdp.c:551
#define PERF_DISABLE_FULLWINDOWDRAG
Definition: constants.h:346
#define False
Definition: types.h:25
uint32 g_redirect_server_len
Definition: uimain.c:57
unsigned int BOOL
Definition: ntddk_ex.h:94
GLsizeiptr size
Definition: glext.h:5919
int g_tcp_sck
Definition: uimain.c:51
Definition: types.h:44
void ui_line(uint8 opcode, int startx, int starty, int endx, int endy, PEN *pen)
Definition: uimain.c:513
GLenum GLuint GLenum GLsizei length
Definition: glext.h:5579
int g_keyboard_type
Definition: uimain.c:45
#define MOUSE_FLAG_MOVE
Definition: constants.h:254
Definition: brush.hpp:15
int ui_select(int in)
Definition: uimain.c:164
#define SEC_RANDOM_SIZE
Definition: constants.h:91
RD_BOOL g_has_reconnect_random
Definition: uimain.c:85
void ui_desktop_save(uint32 offset, int x, int y, int cx, int cy)
Definition: uimain.c:567
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_screen_copy(int x, int y, int cx, int cy, int srcx, int srcy)
Definition: win32.c:1283
unsigned char uint8
Definition: types.h:28
RDP_VERSION g_rdp_version
Definition: uimain.c:74
Definition: _map.h:44
GLint GLenum GLsizei GLsizei GLsizei GLint GLsizei const GLvoid * data
Definition: gl.h:1950
BITMAP bmp
Definition: alphablend.c:62
GLbitfield flags
Definition: glext.h:7161
uint32 colour
Definition: types.h:86
GLsizei const GLfloat * points
Definition: glext.h:8112
void ui_bell(void)
Definition: uimain.c:158
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
static int state
Definition: maze.c:121
enum _RDP_VERSION RDP_VERSION
#define memcpy(s1, s2, n)
Definition: mkisofs.h:878
GLenum GLsizei len
Definition: glext.h:6722
void * data
Definition: types.h:123
GLdouble s
Definition: gl.h:2039
void ui_end_update(void)
Definition: uimain.c:664
char g_servername[256]
Definition: uimain.c:27
void ui_key_down(int key, int ext)
Definition: uimain.c:924
void ui_mouse_move(int x, int y)
Definition: uimain.c:883
void * ui_create_bitmap(int width, int height, uint8 *data)
Definition: uimain.c:277
#define PERF_DISABLE_MENUANIMATIONS
Definition: constants.h:347
_In_ CLIPOBJ _In_ BRUSHOBJ _In_ LONG _In_ LONG _In_ LONG _In_ LONG y2
Definition: winddi.h:3706
void * xmalloc(int size)
Definition: uimain.c:747
void ui_destroy_bitmap(void *bmp)
Definition: uimain.c:293
char g_reconnect_random[16]
Definition: uimain.c:83
void bs_set_pixel_on(char *data, int x, int y, int width, int bpp, int pixel)
Definition: bsops.c:246
GLint GLint GLsizei GLsizei height
Definition: gl.h:1546
GLfloat CONST GLvector4f * in
Definition: m_xform.h:122
T MAX(T a, T b)
Definition: polytest.cpp:85
uint8 green
Definition: types.h:58
int load_licence(uint8 **data)
Definition: uimain.c:729
void bs_init(int width, int height, int bpp)
Definition: bsops.c:158
uint32 height
Definition: uimain.c:92
void ui_memblt(uint8 opcode, int x, int y, int cx, int cy, void *src, int srcx, int srcy)
Definition: uimain.c:548
#define random
Definition: rosdhcp.h:81
int mi_main_loop(void)
Definition: win32.c:834
const char cursor[]
Definition: icontest.c:13
INT INT dy
Definition: msvc.h:65
#define MOUSE_FLAG_BUTTON5
Definition: constants.h:259
__kernel_time_t time_t
Definition: linux.h:252
INT x
Definition: msvc.h:62
RD_BOOL g_numlock_sync
Definition: uimain.c:80
GLuint start
Definition: gl.h:1545
uint32 g_keylayout
Definition: uimain.c:44
unsigned short uint16
Definition: types.h:30
char g_hostname[256]
Definition: uimain.c:26
uint8 style
Definition: types.h:84
void ui_invalidate(int x, int y, int cx, int cy)
Definition: uimain.c:138
int __cdecl vsprintf(char *_Dest, const char *_Format, va_list _Args)
Definition: sprintf.c:733
RD_BOOL g_network_error
Definition: uimain.c:77
void ui_desktop_restore(uint32 offset, int x, int y, int cx, int cy)
Definition: uimain.c:561
#define va_start(ap, A)
Definition: acmsvcex.h:91
#define RDP_INFO_AUTOLOGON
Definition: constants.h:335
uint32 g_redirect_username_len
Definition: uimain.c:61
uint8 g_redirect_cookie[256]
Definition: uimain.c:64
RD_BOOL g_pending_resize
Definition: uimain.c:79
_In_ CLIPOBJ _In_ BRUSHOBJ _In_ LONG _In_ LONG _In_ LONG x2
Definition: winddi.h:3706
int pal_entries[256]
Definition: uimain.c:52
#define MOUSE_FLAG_BUTTON2
Definition: constants.h:256
void bs_set_clip(int x, int y, int cx, int cy)
Definition: bsops.c:189
_Out_opt_ int * cx
Definition: commctrl.h:570
char g_redirect_server[256]
Definition: uimain.c:56
#define PERF_DISABLE_WALLPAPER
Definition: constants.h:345
void int int ULONGLONG int va_list * ap
Definition: winesup.h:32
void ui_move_pointer(int x, int y)
Definition: uimain.c:616
RD_BOOL g_bitmap_cache_precache
Definition: uimain.c:38
char * strcpy(char *DstString, const char *SrcString)
Definition: utclib.c:388
void ui_polyline(uint8 opcode, RD_POINT *points, int npoints, PEN *pen)
Definition: uimain.c:679
uint8 red
Definition: types.h:57
sint16 y
Definition: types.h:51
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
uint32 g_redirect_domain_len
Definition: uimain.c:59
#define malloc
Definition: debug_ros.c:4
void ui_screenblt(uint8 opcode, int x, int y, int cx, int cy, int srcx, int srcy)
Definition: uimain.c:581
void error(char *format,...)
Definition: uimain.c:817
DATABLOB * cache_get_text(uint8 cache_id)
Definition: cache.c:325
uint32 g_rdp5_performanceflags
Definition: uimain.c:35
void mi_warning(char *msg)
Definition: win32.c:848
RD_BOOL g_encryption_initial
Definition: uimain.c:75
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
#define RDP_KEYRELEASE
Definition: constants.h:252
void exit(int exitcode)
Definition: _exit.c:33
GLfloat GLfloat p
Definition: glext.h:8902
void * mi_create_cursor(unsigned int x, unsigned int y, int width, int height, unsigned char *andmask, unsigned char *xormask)
Definition: win32.c:1345
#define TEXT2_VERTICAL
Definition: constants.h:275
void generate_random(uint8 *random)
Definition: uimain.c:709
#define memset(x, y, z)
Definition: compat.h:39
void mi_fill_rect(int x, int y, int cx, int cy, int colour)
Definition: win32.c:1194
RD_BOOL g_bitmap_cache_persist_enable
Definition: uimain.c:37
int rd_read_file(int fd, void *ptr, int len)
Definition: uimain.c:854
BOOL rd_lock_file(int fd, int start, int len)
Definition: uimain.c:875
void mi_set_null_cursor(void)
Definition: win32.c:1380
void hexdump(uint8 *p, uint32 len)
Definition: uimain.c:980
void unimpl(char *format,...)
Definition: uimain.c:801
void ui_resize_window(void)
Definition: uimain.c:651
RD_BOOL g_polygon_ellipse_orders
Definition: uimain.c:33
void ui_set_cursor(void *cursor)
Definition: uimain.c:220
uint32 read_keyboard_state(void)
Definition: uimain.c:632
void bs_screenblt(int rop, int x, int y, int cx, int cy, int srcx, int srcy)
Definition: bsops.c:469
Definition: path.c:42
#define printf
Definition: config.h:203
void mi_set_cursor(void *cursor)
Definition: win32.c:1372
INT dx
Definition: msvc.h:65
int rd_write_file(int fd, void *ptr, int len)
Definition: uimain.c:861
int ui_read_wire(void)
Definition: uimain.c:942