FS2_Open
Open source remastering of the Freespace 2 engine
uidefs.h
Go to the documentation of this file.
1 /*
2  * Copyright (C) Volition, Inc. 1999. All rights reserved.
3  *
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 the
6  * source.
7  *
8 */
9 
10 
11 
12 #ifndef _UIDEFS_H
13 #define _UIDEFS_H
14 
15 #include "freespace2/freespace.h"
16 #include "globalincs/pstypes.h"
17 #include "io/key.h"
18 #include "io/mouse.h"
19 
20 #define CBLACK Color_black
21 #define CGREEN Color_green
22 #define CBRIGHT_GREEN Color_bright_green
23 #define CGRAY Color_grey
24 #define CDARK_GRAY Color_bright_white // since gray doesn't work with our current color system..
25 #define CWHITE Color_white
26 #define CBRIGHT Color_bright_white
27 
28 #define BORDER_WIDTH 8
29 
30 void ui_hline(int x1, int x2, int y );
31 void ui_vline(int y1, int y2, int x );
32 void ui_string_centered( int x, int y, char * s );
33 void ui_draw_shad( int x1, int y1, int x2, int y2, int r1, int g1, int b1, int r2, int g2, int b2 );
34 void ui_draw_frame( int x1, int y1, int x2, int y2 );
35 void ui_rect( int x1, int y1, int x2, int y2 );
36 void ui_draw_box_out( int x1, int y1, int x2, int y2 );
37 void ui_draw_box_in( int x1, int y1, int x2, int y2 );
38 void ui_draw_line_in( int x1, int y1, int x2, int y2 );
39 void ui_draw_sunken_border( int x1, int y1, int x2, int y2 );
40 
41 #define BUTTON_PRESSED 1
42 #define BUTTON_RELEASED 2
43 #define BUTTON_JUST_PRESSED 4
44 #define BUTTON_JUST_RELEASED 8
45 #define BUTTON_DOUBLE_CLICKED 16
46 
47 #define B1_PRESSED (ui_mouse.b1_status & BUTTON_PRESSED)
48 #define B1_RELEASED (ui_mouse.b1_status & BUTTON_RELEASED)
49 #define B1_JUST_PRESSED (ui_mouse.b1_status & BUTTON_JUST_PRESSED)
50 #define B1_JUST_RELEASED (ui_mouse.b1_status & BUTTON_JUST_RELEASED)
51 #define B1_DOUBLE_CLICKED (ui_mouse.b1_status & BUTTON_DOUBLE_CLICKED)
52 
53 #define B2_PRESSED (ui_mouse.b2_status & BUTTON_PRESSED)
54 #define B2_RELEASED (ui_mouse.b2_status & BUTTON_RELEASED)
55 #define B2_JUST_PRESSED (ui_mouse.b2_status & BUTTON_JUST_PRESSED)
56 #define B2_JUST_RELEASED (ui_mouse.b2_status & BUTTON_JUST_RELEASED)
57 
58 typedef struct UI_MOUSE {
59  int x, y;
60  int dx, dy;
61  int b1_status;
64  int b2_status;
67  int timestamp;
68 } UI_MOUSE;
69 
70 extern UI_MOUSE ui_mouse;
71 extern void ui_mouse_process();
72 
73 
74 #define Middle(x) ((x)/2)
75 
76 #endif
int b1_status
Definition: uidefs.h:61
int b1_last_status
Definition: uidefs.h:62
int dx
Definition: uidefs.h:60
int dy
Definition: uidefs.h:60
void ui_draw_box_in(int x1, int y1, int x2, int y2)
Definition: uidraw.cpp:80
struct UI_MOUSE UI_MOUSE
int b2_last_status
Definition: uidefs.h:65
void ui_draw_box_out(int x1, int y1, int x2, int y2)
Definition: uidraw.cpp:69
UI_MOUSE ui_mouse
Definition: uimouse.cpp:17
int y
Definition: uidefs.h:59
void ui_draw_shad(int x1, int y1, int x2, int y2, int r1, int g1, int b1, int r2, int g2, int b2)
int b2_status
Definition: uidefs.h:64
void ui_draw_sunken_border(int x1, int y1, int x2, int y2)
Definition: uidraw.cpp:106
int timestamp
Definition: uidefs.h:67
void ui_hline(int x1, int x2, int y)
Definition: uidraw.cpp:18
GLdouble s
Definition: Glext.h:5321
int b1_time_lastpressed
Definition: uidefs.h:63
GLint GLint GLint GLint GLint x
Definition: Glext.h:5182
void ui_mouse_process()
Definition: uimouse.cpp:21
int x
Definition: uidefs.h:59
int b2_time_lastpressed
Definition: uidefs.h:66
void ui_vline(int y1, int y2, int x)
Definition: uidraw.cpp:23
void ui_rect(int x1, int y1, int x2, int y2)
Definition: uidraw.cpp:64
void ui_draw_frame(int x1, int y1, int x2, int y2)
Definition: uidraw.cpp:50
void ui_draw_line_in(int x1, int y1, int x2, int y2)
Definition: uidraw.cpp:91
void ui_string_centered(int x, int y, char *s)
Definition: uidraw.cpp:28
GLint y
Definition: Gl.h:1505