File: uidefs.h

package info (click to toggle)
freespace2 3.7.0%2Brepack-2
  • links: PTS, VCS
  • area: non-free
  • in suites: jessie, jessie-kfreebsd
  • size: 22,848 kB
  • ctags: 41,897
  • sloc: cpp: 369,931; makefile: 1,060; xml: 129; sh: 112
file content (76 lines) | stat: -rw-r--r-- 2,359 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
/*
 * Copyright (C) Volition, Inc. 1999.  All rights reserved.
 *
 * All source code herein is the property of Volition, Inc. You may not sell 
 * or otherwise commercially exploit the source or things you created based on the 
 * source.
 *
*/



#ifndef _UIDEFS_H
#define _UIDEFS_H

#include "globalincs/pstypes.h"
#include "io/key.h"
#include "io/mouse.h"
#include "freespace2/freespace.h"

#define CBLACK Color_black
#define CGREEN Color_green
#define CBRIGHT_GREEN Color_bright_green
#define CGRAY Color_grey
#define CDARK_GRAY Color_bright_white  // since gray doesn't work with our current color system..
#define CWHITE Color_white
#define CBRIGHT Color_bright_white

#define BORDER_WIDTH 8

void ui_hline(int x1, int x2, int y );
void ui_vline(int y1, int y2, int x );
void ui_string_centered( int x, int y, char * s );
void ui_draw_shad( int x1, int y1, int x2, int y2, int r1, int g1, int b1, int r2, int g2, int b2 );
void ui_draw_frame( int x1, int y1, int x2, int y2 );
void ui_rect( int x1, int y1, int x2, int y2 );
void ui_draw_box_out( int x1, int y1, int x2, int y2 );
void ui_draw_box_in( int x1, int y1, int x2, int y2 );
void ui_draw_line_in( int x1, int y1, int x2, int y2 );
void ui_draw_sunken_border( int x1, int y1, int x2, int y2 );

#define BUTTON_PRESSED          1
#define BUTTON_RELEASED         2
#define BUTTON_JUST_PRESSED     4
#define BUTTON_JUST_RELEASED    8
#define BUTTON_DOUBLE_CLICKED   16

#define B1_PRESSED          (ui_mouse.b1_status & BUTTON_PRESSED)
#define B1_RELEASED         (ui_mouse.b1_status & BUTTON_RELEASED)
#define B1_JUST_PRESSED     (ui_mouse.b1_status & BUTTON_JUST_PRESSED)
#define B1_JUST_RELEASED    (ui_mouse.b1_status & BUTTON_JUST_RELEASED)
#define B1_DOUBLE_CLICKED   (ui_mouse.b1_status & BUTTON_DOUBLE_CLICKED)

#define B2_PRESSED          (ui_mouse.b2_status & BUTTON_PRESSED)
#define B2_RELEASED         (ui_mouse.b2_status & BUTTON_RELEASED)
#define B2_JUST_PRESSED     (ui_mouse.b2_status & BUTTON_JUST_PRESSED)
#define B2_JUST_RELEASED    (ui_mouse.b2_status & BUTTON_JUST_RELEASED)

typedef struct UI_MOUSE	{
	int	x, y;
	int	dx, dy;
	int	b1_status;
	int	b1_last_status;
	int	b1_time_lastpressed;
	int	b2_status;
	int	b2_last_status;
	int	b2_time_lastpressed;
	int	timestamp;
} UI_MOUSE;

extern UI_MOUSE ui_mouse;
extern void ui_mouse_process();


#define Middle(x) ((x)/2)

#endif