28 #ifndef ASCENSION_CONTEXT_H |
28 #ifndef ASCENSION_CONTEXT_H |
29 #define ASCENSION_CONTEXT_H |
29 #define ASCENSION_CONTEXT_H |
30 |
30 |
31 #include "datatypes.h" |
31 #include "datatypes.h" |
32 #include "window.h" |
32 #include "window.h" |
|
33 #include "input.h" |
33 #include "ui/font.h" |
34 #include "ui/font.h" |
34 |
35 |
35 #include <cx/buffer.h> |
36 #include <cx/buffer.h> |
36 |
37 |
37 /** The flag for the overall initialized state. */ |
38 /** The flag for the overall initialized state. */ |
47 * The global ascension context. |
48 * The global ascension context. |
48 */ |
49 */ |
49 typedef struct AscContext { |
50 typedef struct AscContext { |
50 unsigned int flags; |
51 unsigned int flags; |
51 CxBuffer error_buffer; |
52 CxBuffer error_buffer; |
|
53 AscInput input; |
52 AscWindow windows[ASC_MAX_WINDOWS]; |
54 AscWindow windows[ASC_MAX_WINDOWS]; |
53 AscWindow *active_window; |
55 AscWindow *active_window; |
54 AscFont fonts[ASC_MAX_FONTS]; |
56 AscFont fonts[ASC_MAX_FONTS]; |
55 unsigned int fonts_loaded; |
57 unsigned int fonts_loaded; |
56 AscFont const *active_font; |
58 AscFont const *active_font; |
63 extern AscContext asc_context; |
65 extern AscContext asc_context; |
64 |
66 |
65 void asc_context_initialize(void); |
67 void asc_context_initialize(void); |
66 void asc_context_destroy(void); |
68 void asc_context_destroy(void); |
67 |
69 |
|
70 /** |
|
71 * Signals the context that we want to quit the application. |
|
72 */ |
|
73 void asc_context_quit(void); |
68 |
74 |
69 /** |
75 /** |
70 * Dispatches events and synchronizes all initialized windows. |
76 * Dispatches events and synchronizes all initialized windows. |
71 * |
77 * |
72 * @return false, if the application wants to quit, true otherwise |
78 * @return false, if the application wants to quit, true otherwise |