2 * Copyright (C) Volition, Inc. 1999. All rights reserved.
4 * All source code herein is the property of Volition, Inc. You may not sell
5 * or otherwise commercially exploit the source or things you created based on
10 * $Logfile: /Freespace2/code/UI/UiDefs.h $
15 * Include file for stuff used internally by the UI code.
18 * Revision 1.2 2002/06/09 04:41:15 relnev
19 * added copyright header
21 * Revision 1.1.1.1 2002/05/03 03:28:12 root
25 * 2 10/07/98 10:54a Dave
28 * 1 10/07/98 10:51a Dave
30 * 8 4/01/98 5:07p Hoffoss
31 * Changed mouse button handling for UI in order to track fast events
32 * (like button going down and released all between frames).
34 * 7 2/03/98 4:21p Hoffoss
35 * Made UI controls draw white text when disabled.
37 * 6 6/12/97 12:39p John
38 * made ui use freespace colors
40 * 5 6/11/97 1:13p John
41 * Started fixing all the text colors in the game.
43 * 4 12/08/96 1:58a Lawrance
44 * added some additional colors
46 * 3 12/02/96 2:17p John
47 * Made right button drag UI gadgets around and
48 * Ctrl+Shift+Alt+F12 dumps out where they are.
50 * 2 11/15/96 11:43a John
52 * 1 11/14/96 6:55p John
64 #include "freespace.h"
66 #define CBLACK Color_black
67 #define CGREEN Color_green
68 #define CBRIGHT_GREEN Color_bright_green
69 #define CGRAY Color_grey
70 #define CDARK_GRAY Color_bright_white // since gray doesn't work with our current color system..
71 #define CWHITE Color_white
72 #define CBRIGHT Color_bright_white
74 #define BORDER_WIDTH 8
76 void ui_hline(int x1, int x2, int y );
77 void ui_vline(int y1, int y2, int x );
78 void ui_string_centered( int x, int y, const char * s );
79 void ui_draw_shad( int x1, int y1, int x2, int y2, int r1, int g1, int b1, int r2, int g2, int b2 );
80 void ui_draw_frame( int x1, int y1, int x2, int y2 );
81 void ui_rect( int x1, int y1, int x2, int y2 );
82 void ui_draw_box_out( int x1, int y1, int x2, int y2 );
83 void ui_draw_box_in( int x1, int y1, int x2, int y2 );
84 void ui_draw_line_in( int x1, int y1, int x2, int y2 );
85 void ui_draw_sunken_border( int x1, int y1, int x2, int y2 );
87 #define BUTTON_PRESSED 1
88 #define BUTTON_RELEASED 2
89 #define BUTTON_JUST_PRESSED 4
90 #define BUTTON_JUST_RELEASED 8
91 #define BUTTON_DOUBLE_CLICKED 16
93 #define B1_PRESSED (ui_mouse.b1_status & BUTTON_PRESSED)
94 #define B1_RELEASED (ui_mouse.b1_status & BUTTON_RELEASED)
95 #define B1_JUST_PRESSED (ui_mouse.b1_status & BUTTON_JUST_PRESSED)
96 #define B1_JUST_RELEASED (ui_mouse.b1_status & BUTTON_JUST_RELEASED)
97 #define B1_DOUBLE_CLICKED (ui_mouse.b1_status & BUTTON_DOUBLE_CLICKED)
99 #define B2_PRESSED (ui_mouse.b2_status & BUTTON_PRESSED)
100 #define B2_RELEASED (ui_mouse.b2_status & BUTTON_RELEASED)
101 #define B2_JUST_PRESSED (ui_mouse.b2_status & BUTTON_JUST_PRESSED)
102 #define B2_JUST_RELEASED (ui_mouse.b2_status & BUTTON_JUST_RELEASED)
104 typedef struct UI_MOUSE {
109 int b1_time_lastpressed;
112 int b2_time_lastpressed;
116 extern UI_MOUSE ui_mouse;
117 extern void ui_mouse_process();
120 #define Middle(x) ((x)/2)