Merge branch 'master' of git://github.com/BTAxis/naev into testmission
[naev.git] / src / toolkit.h
blobc99980bbdd00eead9cb27c1bc616c461c7d484b6
1 /*
2 * See Licensing and Copyright notice in naev.h
3 */
7 #ifndef TOOLKIT_H
8 # define TOOLKIT_H
11 #include "SDL.h"
13 #include "tk/widget.h"
15 #include "opengl.h"
16 #include "font.h"
19 int toolkit_isOpen (void);
23 * creation
25 unsigned int window_create( const char* name,
26 const int x, const int y, /* position */
27 const int w, const int h ); /* dimensions */
30 * modification
32 /* window */
33 void window_setAccept( const unsigned int wid, void (*fptr)(unsigned int,char*) );
34 void window_setCancel( const unsigned int wid, void (*cancel)(unsigned int,char*) );
35 void window_handleKeys( const unsigned int wid,
36 int (*keyhandler)(unsigned int,SDLKey,SDLMod) );
37 void window_handleEvents( const unsigned int wid,
38 int (*eventhandler)(unsigned int,SDL_Event*) );
42 * get
44 /* generic */
45 int window_exists( const char* wdwname );
46 int widget_exists( const unsigned int wid, const char* wgtname );
47 unsigned int window_get( const char* wdwname );
48 void window_dimWindow( const unsigned int wid, int *w, int *h );
49 void window_posWidget( const unsigned int wid,
50 char* name, int *x, int *y );
51 void window_moveWidget( const unsigned int wid,
52 char* name, int x, int y );
55 * destruction
57 void window_close( unsigned int wid, char *str );
58 void window_destroy( const unsigned int wid );
59 void window_destroyWidget( unsigned int wid, const char* wgtname );
60 void window_setParent( unsigned int wid, unsigned int parent );
61 unsigned int window_getParent( unsigned int wid );
62 void window_onClose( unsigned int wid, void (*fptr)(unsigned int,char*) );
66 * render
68 void toolkit_render (void);
72 * input
74 int toolkit_input( SDL_Event* event );
75 void toolkit_update (void);
76 void toolkit_clearKey (void);
80 * init/exit
82 int toolkit_init (void);
83 void toolkit_exit (void);
87 * hacks
89 void toolkit_delay (void);
92 #endif /* TOOLKIT_H */