[ntoskrnl/cc]
[reactos.git] / base / applications / mstsc / uimain.h
1 /* -*- c-basic-offset: 8 -*-
2 rdesktop: A Remote Desktop Protocol client.
3 main ui header
4 Copyright (C) Jay Sorg 2005-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 #ifndef __UIMAIN_MSTSC_H
22 #define __UIMAIN_MSTSC_H
23
24 /* in uimain.c */
25 int
26 ui_main(void);
27 void
28 ui_invalidate(int x, int y, int cx, int cy);
29 int
30 ui_read_wire(void);
31 void
32 ui_mouse_move(int x, int y);
33 void
34 ui_mouse_button(int button, int x, int y, int down);
35 void
36 ui_key_down(int key, int ext);
37 void
38 ui_key_up(int key, int ext);
39
40 void
41
42 ui_set_modifier_state(int code);
43
44 #define SPLIT_COLOUR15(c, r, g, b) \
45 { \
46 r = ((c >> 7) & 0xf8) | ((c >> 12) & 0x7); \
47 g = ((c >> 2) & 0xf8) | ((c >> 8) & 0x7); \
48 b = ((c << 3) & 0xf8) | ((c >> 2) & 0x7); \
49 }
50
51 #define SPLIT_COLOUR16(c, r, g, b) \
52 { \
53 r = ((c >> 8) & 0xf8) | ((c >> 13) & 0x7); \
54 g = ((c >> 3) & 0xfc) | ((c >> 9) & 0x3); \
55 b = ((c << 3) & 0xf8) | ((c >> 2) & 0x7); \
56 }
57
58 #define MAKE_COLOUR15(c, r, g, b) \
59 { \
60 c = ( \
61 (((r & 0xff) >> 3) << 10) | \
62 (((g & 0xff) >> 3) << 5) | \
63 (((b & 0xff) >> 3) << 0) \
64 ); \
65 }
66
67 #define MAKE_COLOUR32(c, r, g, b) \
68 { \
69 c = ( \
70 ((r & 0xff) << 16) | \
71 ((g & 0xff) << 8) | \
72 ((b & 0xff) << 0) \
73 ); \
74 }
75
76 #undef UI_MAX
77 #define UI_MAX(a, b) (((a) > (b)) ? (a) : (b))
78 #undef UI_MIN
79 #define UI_MIN(a, b) (((a) < (b)) ? (a) : (b))
80
81 #endif /* __UIMAIN_MSTSC_H */