1 /*
2  * See Licensing and Copyright notice in naev.h
3  */
4 
5 
6 
7 #ifndef GUI_H
8 #  define GUI_H
9 
10 
11 #include "opengl.h"
12 #include "pilot.h"
13 #include "space.h"
14 
15 
16 /*
17  * enums
18  */
19 typedef enum RadarShape_ {
20    RADAR_RECT,  /**< Rectangular radar. */
21    RADAR_CIRCLE /**< Circular radar. */
22 } RadarShape; /**< Player's radar shape. */
23 
24 
25 /*
26  * Loading/cleaning up.
27  */
28 int gui_init (void);
29 void gui_free (void);
30 int gui_load (const char* name);
31 void gui_cleanup (void);
32 void gui_reload (void);
33 
34 
35 /*
36  * Triggers.
37  */
38 void gui_setCargo (void);
39 void gui_setNav (void);
40 void gui_setTarget (void);
41 void gui_setShip (void);
42 void gui_setSystem (void);
43 void gui_updateFaction (void);
44 void gui_setGeneric ( Pilot* pilot );
45 
46 /*
47  * render
48  */
49 void gui_renderReticles( double dt );
50 void gui_render( double dt );
51 void gui_renderTargetReticles( int x, int y, int w, int h, const glColour* c );
52 void gui_forceBlink (void);
53 
54 /*
55  * Messages.
56  */
57 void gui_messageInit( int width, int x, int y );
58 void gui_clearMessages (void);
59 void gui_messageScrollUp( int lines );
60 void gui_messageScrollDown( int lines );
61 
62 
63 /*
64  * Radar.
65  */
66 int gui_radarInit( int circle, int w, int h );
67 void gui_radarRender( double x, double y );
68 void gui_radarGetPos( int *x, int *y );
69 void gui_radarGetDim( int *w, int *h );
70 void gui_radarGetRes( int *res );
71 
72 
73 /*
74  * Render radar.
75  */
76 void gui_renderPlanet( int ind, RadarShape shape, double w, double h, double res, int overlay );
77 void gui_renderJumpPoint( int ind, RadarShape shape, double w, double h, double res, int overlay );
78 void gui_renderPilot( const Pilot* p, RadarShape shape, double w, double h, double res, int overlay );
79 void gui_renderAsteroid( const Asteroid* a, double w, double h, double res, int overlay );
80 void gui_renderPlayer( double res, int overlay );
81 
82 
83 /*
84  * Targeting.
85  */
86 void gui_targetPlanetGFX( glTexture *gfx );
87 void gui_targetPilotGFX( glTexture *gfx );
88 
89 
90 /*
91  * Mouse.
92  */
93 int gui_handleEvent( SDL_Event *evt );
94 void gui_mouseClickEnable( int enabel );
95 void gui_mouseMoveEnable( int enabel );
96 
97 
98 /*
99  * misc
100  */
101 void gui_setViewport( double x, double y, double w, double h );
102 void gui_clearViewport (void);
103 void gui_setDefaults (void);
104 void gui_setRadarRel( int mod );
105 void gui_getOffset( double *x, double *y );
106 glTexture* gui_hailIcon (void);
107 char* gui_pick (void);
108 int gui_onScreenPilot( double *rx, double *ry, Pilot *pilot );
109 int gui_onScreenAsset( double *rx, double *ry, JumpPoint *jp, Planet *pnt );
110 
111 
112 #endif /* GUI_H */
113