2 * $Logfile: /Freespace2/code/UI/UiDefs.h $
7 * Include file for stuff used internally by the UI code.
10 * Revision 1.1 2002/05/03 03:28:12 root
14 * 2 10/07/98 10:54a Dave
17 * 1 10/07/98 10:51a Dave
19 * 8 4/01/98 5:07p Hoffoss
20 * Changed mouse button handling for UI in order to track fast events
21 * (like button going down and released all between frames).
23 * 7 2/03/98 4:21p Hoffoss
24 * Made UI controls draw white text when disabled.
26 * 6 6/12/97 12:39p John
27 * made ui use freespace colors
29 * 5 6/11/97 1:13p John
30 * Started fixing all the text colors in the game.
32 * 4 12/08/96 1:58a Lawrance
33 * added some additional colors
35 * 3 12/02/96 2:17p John
36 * Made right button drag UI gadgets around and
37 * Ctrl+Shift+Alt+F12 dumps out where they are.
39 * 2 11/15/96 11:43a John
41 * 1 11/14/96 6:55p John
53 #include "freespace.h"
55 #define CBLACK Color_black
56 #define CGREEN Color_green
57 #define CBRIGHT_GREEN Color_bright_green
58 #define CGRAY Color_grey
59 #define CDARK_GRAY Color_bright_white // since gray doesn't work with our current color system..
60 #define CWHITE Color_white
61 #define CBRIGHT Color_bright_white
63 #define BORDER_WIDTH 8
65 void ui_hline(int x1, int x2, int y );
66 void ui_vline(int y1, int y2, int x );
67 void ui_string_centered( int x, int y, char * s );
68 void ui_draw_shad( int x1, int y1, int x2, int y2, int r1, int g1, int b1, int r2, int g2, int b2 );
69 void ui_draw_frame( int x1, int y1, int x2, int y2 );
70 void ui_rect( int x1, int y1, int x2, int y2 );
71 void ui_draw_box_out( int x1, int y1, int x2, int y2 );
72 void ui_draw_box_in( int x1, int y1, int x2, int y2 );
73 void ui_draw_line_in( int x1, int y1, int x2, int y2 );
74 void ui_draw_sunken_border( int x1, int y1, int x2, int y2 );
76 #define BUTTON_PRESSED 1
77 #define BUTTON_RELEASED 2
78 #define BUTTON_JUST_PRESSED 4
79 #define BUTTON_JUST_RELEASED 8
80 #define BUTTON_DOUBLE_CLICKED 16
82 #define B1_PRESSED (ui_mouse.b1_status & BUTTON_PRESSED)
83 #define B1_RELEASED (ui_mouse.b1_status & BUTTON_RELEASED)
84 #define B1_JUST_PRESSED (ui_mouse.b1_status & BUTTON_JUST_PRESSED)
85 #define B1_JUST_RELEASED (ui_mouse.b1_status & BUTTON_JUST_RELEASED)
86 #define B1_DOUBLE_CLICKED (ui_mouse.b1_status & BUTTON_DOUBLE_CLICKED)
88 #define B2_PRESSED (ui_mouse.b2_status & BUTTON_PRESSED)
89 #define B2_RELEASED (ui_mouse.b2_status & BUTTON_RELEASED)
90 #define B2_JUST_PRESSED (ui_mouse.b2_status & BUTTON_JUST_PRESSED)
91 #define B2_JUST_RELEASED (ui_mouse.b2_status & BUTTON_JUST_RELEASED)
93 typedef struct UI_MOUSE {
98 int b1_time_lastpressed;
101 int b2_time_lastpressed;
105 extern UI_MOUSE ui_mouse;
106 extern void ui_mouse_process();
109 #define Middle(x) ((x)/2)