ReactOS  0.4.12-dev-43-g63b00d8
uimain.h File Reference
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Macros

#define SPLIT_COLOUR15(c, r, g, b)
 
#define SPLIT_COLOUR16(c, r, g, b)
 
#define MAKE_COLOUR15(c, r, g, b)
 
#define MAKE_COLOUR32(c, r, g, b)
 
#define UI_MAX(a, b)   (((a) > (b)) ? (a) : (b))
 
#define UI_MIN(a, b)   (((a) < (b)) ? (a) : (b))
 

Functions

int ui_main (void)
 
void ui_invalidate (int x, int y, int cx, int cy)
 
int ui_read_wire (void)
 
void ui_mouse_move (int x, int y)
 
void ui_mouse_button (int button, int x, int y, int down)
 
void ui_key_down (int key, int ext)
 
void ui_key_up (int key, int ext)
 
void ui_set_modifier_state (int code)
 

Macro Definition Documentation

◆ MAKE_COLOUR15

#define MAKE_COLOUR15 (   c,
  r,
  g,
  b 
)
Value:
{ \
c = ( \
(((r & 0xff) >> 3) << 10) | \
(((g & 0xff) >> 3) << 5) | \
(((b & 0xff) >> 3) << 0) \
); \
}
GLdouble GLdouble GLdouble r
Definition: gl.h:2055
GLboolean GLboolean g
Definition: glext.h:6204
GLboolean GLboolean GLboolean b
Definition: glext.h:6204

Definition at line 57 of file uimain.h.

◆ MAKE_COLOUR32

#define MAKE_COLOUR32 (   c,
  r,
  g,
  b 
)
Value:
{ \
c = ( \
((r & 0xff) << 16) | \
((g & 0xff) << 8) | \
((b & 0xff) << 0) \
); \
}
GLdouble GLdouble GLdouble r
Definition: gl.h:2055
GLboolean GLboolean g
Definition: glext.h:6204
GLboolean GLboolean GLboolean b
Definition: glext.h:6204

Definition at line 66 of file uimain.h.

Referenced by mi_paint_rect().

◆ SPLIT_COLOUR15

#define SPLIT_COLOUR15 (   c,
  r,
  g,
  b 
)
Value:
{ \
r = ((c >> 7) & 0xf8) | ((c >> 12) & 0x7); \
g = ((c >> 2) & 0xf8) | ((c >> 8) & 0x7); \
b = ((c << 3) & 0xf8) | ((c >> 2) & 0x7); \
}
const GLubyte * c
Definition: glext.h:8905

Definition at line 43 of file uimain.h.

Referenced by mi_fill_rect(), mi_line(), and mi_paint_rect().

◆ SPLIT_COLOUR16

#define SPLIT_COLOUR16 (   c,
  r,
  g,
  b 
)
Value:
{ \
r = ((c >> 8) & 0xf8) | ((c >> 13) & 0x7); \
g = ((c >> 3) & 0xfc) | ((c >> 9) & 0x3); \
b = ((c << 3) & 0xf8) | ((c >> 2) & 0x7); \
}
const GLubyte * c
Definition: glext.h:8905

Definition at line 50 of file uimain.h.

Referenced by mi_fill_rect(), mi_line(), and mi_paint_rect().

◆ UI_MAX

#define UI_MAX (   a,
  b 
)    (((a) > (b)) ? (a) : (b))

Definition at line 76 of file uimain.h.

Referenced by handle_WM_HSCROLL(), handle_WM_PAINT(), and handle_WM_VSCROLL().

◆ UI_MIN

#define UI_MIN (   a,
  b 
)    (((a) < (b)) ? (a) : (b))

Definition at line 78 of file uimain.h.

Referenced by handle_WM_HSCROLL(), handle_WM_SIZE(), handle_WM_VSCROLL(), and mi_create_window().

Function Documentation

◆ ui_invalidate()

void ui_invalidate ( int  x,
int  y,
int  cx,
int  cy 
)

Definition at line 138 of file uimain.c.

Referenced by handle_WM_PAINT(), ui_destblt(), ui_draw_text(), ui_line(), ui_memblt(), ui_patblt(), and ui_screenblt().

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 }
void bs_copy_box(char *dst, int x, int y, int cx, int cy, int line_size)
Definition: bsops.c:793
void mi_paint_rect(char *data, int width, int height, int x, int y, int cx, int cy)
Definition: win32.c:874
INT INT y
Definition: msvc.h:62
void xfree(void *in)
Definition: uimain.c:758
int g_server_depth
Definition: uimain.c:41
_Out_opt_ int _Out_opt_ int * cy
Definition: commctrl.h:570
int bs_warp_coords(int *x, int *y, int *cx, int *cy, int *srcx, int *srcy)
Definition: bsops.c:331
GLint GLenum GLsizei GLsizei GLsizei GLint GLsizei const GLvoid * data
Definition: gl.h:1950
void * xmalloc(int size)
Definition: uimain.c:747
INT x
Definition: msvc.h:62
_Out_opt_ int * cx
Definition: commctrl.h:570

◆ ui_key_down()

void ui_key_down ( int  key,
int  ext 
)

Definition at line 924 of file uimain.c.

Referenced by handle_WM_KEY().

926 {
928  (uint16) key, 0);
929 }
#define RDP_KEYPRESS
Definition: constants.h:251
char ext[3]
Definition: mkdosfs.c:358
void rdp_send_input(uint32 time, uint16 message_type, uint16 device_flags, uint16 param1, uint16 param2)
Definition: rdp.c:551
unsigned short uint16
Definition: types.h:30
Definition: path.c:42

◆ ui_key_up()

void ui_key_up ( int  key,
int  ext 
)

Definition at line 933 of file uimain.c.

Referenced by handle_WM_KEY().

934 {
936  (uint16) key, 0);
937 }
char ext[3]
Definition: mkdosfs.c:358
void rdp_send_input(uint32 time, uint16 message_type, uint16 device_flags, uint16 param1, uint16 param2)
Definition: rdp.c:551
unsigned short uint16
Definition: types.h:30
#define RDP_KEYRELEASE
Definition: constants.h:252
Definition: path.c:42

◆ ui_main()

int ui_main ( void  )

Definition at line 951 of file uimain.c.

Referenced by wWinMain().

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 }
int mi_create_window(void)
Definition: win32.c:754
#define RDP_LOGON_NORMAL
Definition: precomp.h:24
char g_password[256]
Definition: uimain.c:28
int g_width
Definition: uimain.c:42
unsigned int uint32
Definition: types.h:32
char g_domain[256]
Definition: uimain.c:31
char g_shell[256]
Definition: uimain.c:29
char g_directory[256]
Definition: uimain.c:30
RD_BOOL rdp_connect(char *server, uint32 flags, char *domain, char *password, char *command, char *directory, RD_BOOL reconnect)
Definition: rdp.c:1742
int g_server_depth
Definition: uimain.c:41
int g_height
Definition: uimain.c:43
GLbitfield flags
Definition: glext.h:7161
char g_servername[256]
Definition: uimain.c:27
void bs_init(int width, int height, int bpp)
Definition: bsops.c:158
int mi_main_loop(void)
Definition: win32.c:834
#define RDP_INFO_AUTOLOGON
Definition: constants.h:335

◆ ui_mouse_button()

void ui_mouse_button ( int  button,
int  x,
int  y,
int  down 
)

Definition at line 891 of file uimain.c.

Referenced by handle_WM_LBUTTONDOWN(), handle_WM_LBUTTONUP(), handle_WM_MBUTTONDOWN(), handle_WM_MBUTTONUP(), handle_WM_MOUSEWHEEL(), handle_WM_RBUTTONDOWN(), and handle_WM_RBUTTONUP().

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 }
#define MOUSE_FLAG_BUTTON1
Definition: constants.h:255
#define MOUSE_FLAG_BUTTON4
Definition: constants.h:258
#define down(mutex)
Definition: glue.h:29
INT INT y
Definition: msvc.h:62
#define MOUSE_FLAG_DOWN
Definition: constants.h:260
#define MOUSE_FLAG_BUTTON3
Definition: constants.h:257
void rdp_send_input(uint32 time, uint16 message_type, uint16 device_flags, uint16 param1, uint16 param2)
Definition: rdp.c:551
GLbitfield flags
Definition: glext.h:7161
#define MOUSE_FLAG_BUTTON5
Definition: constants.h:259
INT x
Definition: msvc.h:62
unsigned short uint16
Definition: types.h:30
#define MOUSE_FLAG_BUTTON2
Definition: constants.h:256

◆ ui_mouse_move()

void ui_mouse_move ( int  x,
int  y 
)

Definition at line 883 of file uimain.c.

Referenced by handle_WM_MOUSEMOVE().

884 {
886 }
INT INT y
Definition: msvc.h:62
void rdp_send_input(uint32 time, uint16 message_type, uint16 device_flags, uint16 param1, uint16 param2)
Definition: rdp.c:551
#define MOUSE_FLAG_MOVE
Definition: constants.h:254
INT x
Definition: msvc.h:62
unsigned short uint16
Definition: types.h:30

◆ ui_read_wire()

int ui_read_wire ( void  )

Definition at line 942 of file uimain.c.

Referenced by check_sck().

943 {
945 }
static int g_deactivated
Definition: uimain.c:71
static uint32 g_ext_disc_reason
Definition: uimain.c:72
RD_BOOL rdp_loop(RD_BOOL *deactivated, uint32 *ext_disc_reason)
Definition: rdp.c:1695

◆ ui_set_modifier_state()

void ui_set_modifier_state ( int  code)

Definition at line 639 of file uimain.c.

Referenced by mi_check_modifier().

641 {
642 
643  //error("%8.8x", code);
644 
646 
647 }
void rdp_send_input(uint32 time, uint16 message_type, uint16 device_flags, uint16 param1, uint16 param2)
Definition: rdp.c:551
unsigned short uint16
Definition: types.h:30