zori.h 20 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629
  1. #ifndef zori_H_INCLUDED
  2. #define zori_H_INCLUDED
  3. /*
  4. * ZORI is a a GUI subsystem for use with Allegro 5 that handles
  5. * the user interface of Eruta.
  6. *
  7. * ZORI is a classic retained-mode GUI system that has an additional
  8. * pseudo-direct mode API. ZORI uses a handler system where events are handled
  9. * by call back functions which can be installed as specific handlers that are
  10. * activated on certain events. But, in the spirit of direct mode GUI's, all
  11. * widgets also keep state flags and value flags that can be used to see if they
  12. * have been activated and that can be inspected in a direct-mode GUI fashion.
  13. * With ZORI you can have your retained mode GUI pie and also eat it in direct
  14. * mode.
  15. *
  16. * In ZORI, there is only one top-level widget, the root, however, every widget
  17. * can contain any amount of child widgets. One level below the root widget are
  18. * the screen widgets which are intent to handle the GUI on one physical screen
  19. * or display. Every GUI screen can have different "pages", but only one page
  20. * should be active per screen. The idea is that a GUI page represents a single
  21. * GUI mode such as the main menu, the settings menu, the in game menu, etc,
  22. * where you definitely want only one to be active at any given time.
  23. *
  24. * The box model used in Zori will be as follows (XXX implement this):
  25. * ......................................
  26. * .margin .
  27. * . +-------------border-----------+ .
  28. * . | padding | .
  29. * . | .......................... | .
  30. * . | . . | .
  31. * . | . contents . | .
  32. * . | . . | .
  33. * . | .......................... | .
  34. * . | padding | .
  35. * . +------------------------------+ .
  36. * .margin .
  37. * ......................................
  38. *
  39. * The padding determines the minimal distance between the border or the
  40. * parent widget and it's contents and/or child widgets.
  41. *
  42. * The border's thickness is only relevant for visual effects.
  43. * It does not change the layout. The border is effectively "inside"
  44. * the padding and/or contents of the widget and is unrelated to the padding.
  45. *
  46. * The margin of a widget determines how closely that widget may be packed
  47. * to it's sibling widgets.
  48. *
  49. * The work in UI is divided between the top-level widgets,
  50. * namely the root and the page, and the other widgets.
  51. * The root and the page handle everything that depends on and/or may influence
  52. * several widgets at once, such as event dispatching but also setting the
  53. * focus, determining which widget is being hovered, or dragged, etc.
  54. * The latter functions change the state of several widgets, so they
  55. * are handled on the level of the container widgets.
  56. * The zori_widget and the other concrete widgets handle the individual
  57. * state and actions of the various widgets individually.
  58. *
  59. *
  60. *
  61. *
  62. */
  63. #include <stdbool.h>
  64. #include "eruta.h"
  65. #include "rebox.h"
  66. #include "miao.h"
  67. #include "str.h"
  68. /* Defines for C11/C99/C89 portability */
  69. #ifndef inline
  70. #define inline inline
  71. #endif
  72. /* Macros for possible later system library portability. */
  73. #define ZORI_EVENT_TYPE_IS_USER(T) ALLEGRO_EVENT_TYPE_IS_USER(T)
  74. #define ZORI_SYSTEM_EVENT_KEY_DOWN ALLEGRO_EVENT_KEY_DOWN
  75. #define ZORI_SYSTEM_EVENT_KEY_UP ALLEGRO_EVENT_KEY_UP
  76. #define ZORI_SYSTEM_EVENT_KEY_CHAR ALLEGRO_EVENT_KEY_CHAR
  77. #define ZORI_SYSTEM_EVENT_MOUSE_AXES ALLEGRO_EVENT_MOUSE_AXES
  78. #define ZORI_SYSTEM_EVENT_MOUSE_AXES ALLEGRO_EVENT_MOUSE_AXES
  79. #define ZORI_SYSTEM_EVENT_MOUSE_BUTTON_DOWN ALLEGRO_EVENT_MOUSE_BUTTON_DOWN
  80. #define ZORI_SYSTEM_EVENT_MOUSE_BUTTON_UP ALLEGRO_EVENT_MOUSE_BUTTON_UP
  81. /* Typedefs for possible later system library portability. */
  82. typedef ALLEGRO_COLOR zori_color;
  83. typedef ALLEGRO_BITMAP zori_bitmap;
  84. typedef ALLEGRO_FONT zori_font;
  85. typedef ALLEGRO_EVENT zori_system_event;
  86. typedef ALLEGRO_EVENT_TYPE zori_event_type;
  87. typedef ALLEGRO_DISPLAY zori_display;
  88. typedef Point zori_point;
  89. typedef Rebox zori_rebox;
  90. typedef Rebox zori_box;
  91. typedef int zori_id;
  92. typedef ALLEGRO_USTR zori_string;
  93. typedef ALLEGRO_USTR zori_text;
  94. /* Macros for possible portability. */
  95. #define zori_font_lineheight(FONT) al_get_font_line_height(FONT)
  96. #define zori_font_drawstr(FONT, COLOR, X, Y, ATTR, TEXT) al_draw_ustr(FONT, COLOR, X, Y, ATTR, TEXT)
  97. /* Default sizes of a widget. */
  98. #define ZORI_WIDGET_DEFAULT_W 640
  99. #define ZORI_WIDGET_DEFAULT_H 480
  100. /* Defaut padding and margin. */
  101. #define ZORI_PADDING_DEFAULT 4
  102. #define ZORI_MARGIN_DEFAULT 0
  103. /* Zori ID's. */
  104. #define ZORI_ID_OK_P(ID) ((ID) > -1)
  105. #define ZORI_ID_OK ((zori_id)(0))
  106. #define ZOTI_ID_GENERATE ((zori_id)(-1))
  107. #define ZORI_ID_ERROR ((zori_id)(-1))
  108. #define ZORI_ID_ENOMEM ((zori_id)(-2))
  109. #define ZORI_ID_EINVAL ((zori_id)(-3))
  110. /** Macro for the number of elements of an array .*/
  111. #define ZORI_ARRAY_AMOUNT(A) ((size_t)(sizeof(A))/(sizeof(*A)))
  112. /** Macro that expands to the the array itself, and the amount of elements
  113. * in that array, in that order. Only works on a statically sized array. */
  114. #define ZORI_ARRAY_AND_AMOUNT(A) (A), ZORI_ARRAY_AMOUNT(A)
  115. /* Macro: ZORI_CONTAINER_OF(PTR, TYPE, MEMBER)
  116. This macro returns, for the given pointer, a pointer to a containing struct
  117. of type TYPE, in which PTR is a member named MEMBER.
  118. This enables cool ways of type genericity and extension in plain C.
  119. It should not run afoul of strict aliasing since it passes over a char * pointer
  120. and a pointer of a containing struct or union.
  121. */
  122. #define ZORI_CONTAINER_OF(PTR, TYPE, MEMBER) \
  123. ((PTR) ? ((TYPE *)(((char *)(PTR)) - offsetof(TYPE, MEMBER))) : NULL)
  124. /** Custom event types, used in conjunction with Allegro event types. */
  125. enum zori_custom_event_type {
  126. ZORI_EVENT_CUSTOM = ALLEGRO_GET_EVENT_TYPE('z', 'o', 'r', 'i'),
  127. /** Update event, called at regular intervals to update the state of the UI.*/
  128. ZORI_EVENT_UPDATE,
  129. /** First draw pass. */
  130. ZORI_EVENT_DRAW,
  131. /** Second draw pass for cursors. */
  132. ZORI_EVENT_OVERDRAW,
  133. /** Cleanup event. */
  134. ZORI_EVENT_DONE,
  135. /** Destruction event. */
  136. ZORI_EVENT_FREE,
  137. /** User definable activation event, such as a button being clicked
  138. * or a menu being opened. */
  139. ZORI_EVENT_ACTION,
  140. /** User definable close event, such as a menu being closed.
  141. * Note that the element may be re-opened later. */
  142. ZORI_EVENT_CLOSE,
  143. /** Child added event to ease setup. */
  144. ZORI_EVENT_NEW_CHILD,
  145. /* Below these line are internal events that should not be set or
  146. * activated by the user of the Zori library. */
  147. /** Activation event, such as a button being clicked or a menu being opened.
  148. * This event is ment to be used internally by the ZORI library before
  149. * the ZORI_EVENT_ACTION is raised. */
  150. ZORI_INTERNAL_EVENT_ACTION,
  151. /** Raised just before closing a widget. Sent to the sub-widgets to indicate
  152. * that they should close as well. */
  153. ZORI_INTERNAL_EVENT_CLOSE,
  154. };
  155. struct zori_widget;
  156. /* Common fields for an event. */
  157. struct zori_any_event {
  158. /* Type of the event, possibly copied from sysev. */
  159. zori_event_type type;
  160. /* Widget the event is sent to. */
  161. struct zori_widget * widget;
  162. /* Data specified in the handler. */
  163. void * data;
  164. };
  165. /* System event, that is coming from the underlying library used, e.g. Allegro. */
  166. struct zori_sys_event {
  167. struct zori_any_event any;
  168. zori_system_event * ev;
  169. };
  170. /* Update event, when UI has to update (animations, etc). */
  171. struct zori_update_event {
  172. struct zori_any_event any;
  173. double dt;
  174. };
  175. /* Draw event when the UI has to draw itself. */
  176. struct zori_draw_event {
  177. struct zori_any_event any;
  178. };
  179. /* Cleanup event. */
  180. struct zori_done_event {
  181. struct zori_any_event any;
  182. };
  183. /* Cleanup event. */
  184. struct zori_free_event {
  185. struct zori_any_event any;
  186. };
  187. /* Action event. */
  188. struct zori_action_event {
  189. struct zori_any_event any;
  190. };
  191. /* Close event. */
  192. struct zori_close_event {
  193. struct zori_any_event any;
  194. /* The widget that was closed and that sent this message to it's parent. */
  195. struct zori_widget * from;
  196. };
  197. /* New child event. */
  198. struct zori_new_child_event {
  199. struct zori_any_event any;
  200. /* The widget that was added as a child and that sent this message to it's parent. */
  201. struct zori_widget * child;
  202. };
  203. /** An event that ZORI can handle. The union is cunningly overlaid so
  204. * that the type field and the any field can be used in all cases. */
  205. union zori_event {
  206. /* Type of the event, possibly copied from sysev. */
  207. zori_event_type type;
  208. struct zori_any_event any;
  209. struct zori_sys_event sys;
  210. struct zori_draw_event draw;
  211. struct zori_update_event update;
  212. struct zori_done_event done;
  213. struct zori_free_event free;
  214. struct zori_action_event action;
  215. struct zori_close_event close;
  216. struct zori_new_child_event new_child;
  217. };
  218. /* Helper functions to get widget from an event. */
  219. static inline struct zori_widget *
  220. zori_event_widget(union zori_event * event) {
  221. if (!event) return NULL;
  222. return event->any.widget;
  223. }
  224. /* Helper functions to get data from an event. */
  225. static inline void * zori_event_data(union zori_event * event) {
  226. if (!event) return NULL;
  227. return event->any.data;
  228. }
  229. /* Helper function that checks if an event is a sys_event. */
  230. static inline bool zori_event_is_sys_event(union zori_event * event) {
  231. if (!event) return false;
  232. return (!ALLEGRO_EVENT_TYPE_IS_USER(event->type));
  233. }
  234. /* Helper functions to get system event from an event. Type checks the type. */
  235. static inline zori_system_event * zori_event_system_event(union zori_event * event) {
  236. if (!event) return NULL;
  237. if (!zori_event_is_sys_event(event)) return NULL;
  238. return event->sys.ev;
  239. }
  240. /* Helper functions to set widget for an event. */
  241. static inline struct zori_widget *
  242. zori_event_set_widget(union zori_event * event, struct zori_widget * widget) {
  243. if (!event) return NULL;
  244. return event->any.widget = widget;
  245. }
  246. /* Helper functions to set data for an event. */
  247. static inline void * zori_event_set_data(union zori_event * event, void * data) {
  248. if (!event) return NULL;
  249. return event->any.data = data;
  250. }
  251. /* Style flags */
  252. enum zori_style_flag {
  253. ZORI_STYLE_FLAG_BORDER = 1,
  254. ZORI_STYLE_FLAG_FILL = 2,
  255. ZORI_STYLE_FLAG_DEFAULT= (ZORI_STYLE_FLAG_BORDER | ZORI_STYLE_FLAG_FILL),
  256. };
  257. /* A graphic is a color, image, and style flags applied to a part of the GUI. */
  258. struct zori_graphic_style {
  259. zori_color color;
  260. zori_bitmap * bitmap;
  261. int style_flags;
  262. };
  263. /* A text style has all elements needed to style a piece of text. I consists of the text color, font and font flags flags applied to a part of the GUI.
  264. */
  265. struct zori_text_style {
  266. zori_color color;
  267. zori_font * font;
  268. int font_flags;
  269. };
  270. /* A style is a set of style parts for different parts of the GUI. */
  271. struct zori_style {
  272. struct zori_graphic_style fore;
  273. struct zori_graphic_style back;
  274. struct zori_graphic_style border;
  275. struct zori_graphic_style hover;
  276. struct zori_graphic_style mark;
  277. struct zori_text_style text;
  278. };
  279. struct zori_widget;
  280. /* Event handler results. */
  281. enum zori_handle_result {
  282. ZORI_HANDLE_ERROR = -1, /* An error ocurred, stop propagating to children.*/
  283. ZORI_HANDLE_DONE = 0, /* The event was handled and consumed, no need to propagate to children automatically (widget may re-send event manually to children.)*/
  284. ZORI_HANDLE_IGNORE = 1, /* Event wasn't handled, propagate to children. */
  285. ZORI_HANDLE_PASS = 2, /* Event was handled, but needs to be propagated.*/
  286. };
  287. /* Returns whether or not a event needs to be propagated based on the
  288. * result of a handler. */
  289. static int zori_propagate_event_p(enum zori_handle_result result) {
  290. switch(result) {
  291. case ZORI_HANDLE_ERROR: return 0;
  292. case ZORI_HANDLE_DONE: return 0;
  293. case ZORI_HANDLE_IGNORE: return !0;
  294. case ZORI_HANDLE_PASS: return !0;
  295. default: return !0;
  296. }
  297. }
  298. typedef enum zori_handle_result (zori_handler_func)(union zori_event * event);
  299. /* A single event handler */
  300. struct zori_handler {
  301. zori_event_type type;
  302. zori_handler_func * handler;
  303. void * data;
  304. };
  305. /* A dynamic array of event handlers event handlers. */
  306. struct zori_handlers miao_of_type(struct zori_handler);
  307. /* An entry in a widget registry. */
  308. struct zori_registry_entry {
  309. zori_id id;
  310. struct zori_widget * widget;
  311. };
  312. /* A widget registry as a dynamic array of entries. */
  313. struct zori_registry miao_of_type(struct zori_registry_entry);
  314. /* Generic state flags for several zori structs. */
  315. enum zori_flag {
  316. /* The object is not visible, though it may still be interacted with.*/
  317. ZORI_FLAG_HIDDEN = 1 << 0,
  318. /* The object cannot be interacted with, though it is still visible. */
  319. ZORI_FLAG_DISABLED = 1 << 1,
  320. /* The object is both hidden and disabled. */
  321. ZORI_FLAG_DEACTIVATED = ZORI_FLAG_HIDDEN | ZORI_FLAG_DISABLED,
  322. /* The object is being hovered by the mouse cursor. */
  323. ZORI_FLAG_HOVERED = 1 << 2,
  324. /* The object is "marked" for activation by the keyjoy cursor */
  325. ZORI_FLAG_MARKED = 1 << 3,
  326. /* The object is ready to report a "result".
  327. * What that is depends on the object. */
  328. ZORI_FLAG_READY = 1 << 4,
  329. };
  330. /* Typedef for the type of a widget.
  331. * Not an enum since every widget may define this itself.
  332. */
  333. typedef uint32_t zori_widget_type;
  334. /* Generic widget types. */
  335. #define ZORI_WIDGET_TYPE_NONE ((zori_widget_type)(0))
  336. /* Macro to help generate widget types. */
  337. #define ZORI_WIDGET_TYPE(A, B, C, D) ((zori_widget_type)((A<<24) | (B<<16) | (C<<8) | D))
  338. /* Mouse or keyboard/joystick cursor. */
  339. struct zori_cursor {
  340. zori_point p;
  341. struct zori_widget * hover;
  342. struct zori_widget * focus;
  343. zori_bitmap * bitmap;
  344. enum zori_flag flags;
  345. struct zori_style style;
  346. };
  347. /* Support multiple cursors... */
  348. struct zori_cursors {
  349. struct zori_cursor mouse;
  350. struct zori_cursor keyjoy;
  351. };
  352. /* The type of the value of the result of a widget. */
  353. enum zori_result_type {
  354. ZORI_RESULT_TYPE_NONE = 0,
  355. ZORI_RESULT_TYPE_INTEGER= 1,
  356. ZORI_RESULT_TYPE_STRING = 2,
  357. ZORI_RESULT_TYPE_CLOSED = 3,
  358. };
  359. /* The value of a result of a widget, see below. */
  360. union zori_result_value {
  361. int integer;
  362. zori_string * string;
  363. int closed;
  364. };
  365. /* The "result" of a widget. If the flag ready is set, the
  366. * widget has a result to report . This normally happens when it was
  367. * clicked, or when a menu item was selected, */
  368. struct zori_result {
  369. int ready;
  370. union zori_result_value value;
  371. enum zori_result_type type;
  372. void * extra;
  373. };
  374. /*
  375. on_enter
  376. on_enter(data = {})
  377. on_event(*args)
  378. on_event(*data)
  379. on_key_down(*args)
  380. on_leave(name=nil)
  381. on_mouse_axes(t, x, y, z, w, dx, dy, dz, dw)
  382. on_mouse_button_down(t, x, y, z, w, b)
  383. on_mouse_button_up(t, x, y, z, w, b)
  384. on_mouse_in(x, y, from)
  385. on_mouse_out(x, y, to)
  386. on_resize
  387. */
  388. struct zori_widget;
  389. struct zori_widget_list miao_of_type(struct zori_widget *);
  390. struct zori_widget {
  391. /* ID of the widget, used in most external API's. */
  392. zori_id id;
  393. /* Root level widget under which this widget is active. */
  394. struct zori_widget * root;
  395. /* Position and size of the widget. */
  396. zori_rebox box;
  397. /* Outer rectangle of the widget, with the margin added. */
  398. zori_rebox outer;
  399. /* Inner rectangle of the widget, with the padding removed. */
  400. zori_rebox inner;
  401. /* Z ordering. */
  402. int z;
  403. /* Style. */
  404. struct zori_style style;
  405. /* Handlers. */
  406. struct zori_handlers handlers;
  407. /* Related widgets. */
  408. struct zori_widget * parent;
  409. struct zori_widget_list children;
  410. /* Flags. */
  411. enum zori_flag flags;
  412. /* Type of the widget. */
  413. zori_widget_type type;
  414. /* Generic "result", of last operation on widget. */
  415. struct zori_result result;
  416. /* Cannot easily use the handers for destroying the widget, so in stead
  417. * provide a destructor. */
  418. void (*destroy)(struct zori_widget * widget);
  419. };
  420. /* An array of widget pointers. */
  421. struct zori_widget_array miao_of_type(struct zori_widget *);
  422. /* Forward declarations. */
  423. struct zori_screen;
  424. struct zori_console;
  425. /*
  426. * Root level widget, my spread out over several displays.
  427. * In Zori, there can only be a single root level widget active.
  428. * It's ID is always 0;
  429. */
  430. struct zori_root {
  431. /* A root is a widget. */
  432. struct zori_widget widget;
  433. /* Current active screen widget if any. */
  434. struct zori_screen * active_screen;
  435. /* Current active console if any. */
  436. struct zori_console * console;
  437. };
  438. /* Forward declaration of a page. */
  439. struct zori_page;
  440. struct zori_root * zori_get_root(void);
  441. /* Initializes Zori and creates a top level widget. Returns 0 on success
  442. * or negative on error. The style will be copied and set as default
  443. * if it is not NULL. Otherwise a built-in style will be used.
  444. * Not that ZORI will NOT clean up any images or fonts it uses by itself.
  445. */
  446. zori_id zori_start(struct zori_style * default_style);
  447. /* Shut down Zori and destroys all widgets. Return 0 on succes or
  448. * negative on error.
  449. */
  450. zori_id zori_shutdown();
  451. /* Creates a new screen widget. Normally this should be the first widget
  452. * you create after zori_start. */
  453. /* Activates the page on it's display. All other pages are dectivated and
  454. * hidden. */
  455. zori_id zori_activate_page(zori_id page);
  456. /* Creates a new generic widget on the given screen with the given
  457. * dimensions. */
  458. zori_id zori_new(zori_id screen, zori_rebox * box);
  459. /* Sets the flags of a widget. */
  460. zori_id zori_set_flags(zori_id widget, enum zori_flag flags);
  461. /* Sets the whole style of a widget. */
  462. zori_id zori_set_style(zori_id id, struct zori_style * style);
  463. /* Sets the background color of the widget. */
  464. zori_id zori_set_background_color(zori_id id, zori_color color);
  465. /* Sets the foreground color of the widget. */
  466. zori_id zori_set_foreground_color(zori_id id, zori_color color);
  467. /* Creates a new frame widget. */
  468. zori_id zori_new_frame_widget(zori_id parent, zori_rebox box);
  469. /* Creates a new (vertical) menu widget. */
  470. zori_id zori_new_menu_widget(zori_id parent, zori_rebox box, char * text);
  471. /* Creates a new button widget. */
  472. zori_id zori_new_button_widget(zori_id parent, zori_rebox box, char * text);
  473. /* Creates a new conversation widget. */
  474. zori_id zori_new_conversation_widget(zori_id parent, zori_rebox box, char * text);
  475. /* Draws the whole UI and all visible parts. */
  476. void zori_draw_all(void);
  477. /* Updates the state of the UI. Pass in the time passed since last update. */
  478. void zori_update(double dt);
  479. /* Registers an event handler for a widget. */
  480. zori_id zori_register(zori_id id, zori_event_type type, zori_handler_func handler, void * extra);
  481. int zori_handler_compare(const void *v1, const void *v2);
  482. struct zori_handler *zori_handlers_add(struct zori_handlers *me, zori_event_type type, zori_handler_func *handler, void *data);
  483. void zori_handlers_done(struct zori_handlers *me);
  484. void zori_handlers_init(struct zori_handlers *me);
  485. struct zori_handler *zori_handlers_search(struct zori_handlers *me, zori_event_type type);
  486. int zori_handlers_handle(struct zori_handlers *me, union zori_event *event);
  487. struct zori_root *zori_get_root(void);
  488. struct zori_widget *zori_get_root_widget(void);
  489. struct zori_widget *zori_get_widget(zori_id id);
  490. zori_id zori_get_unused_id(void);
  491. zori_id zori_initialize_root(void);
  492. zori_id zori_start(struct zori_style *default_style);
  493. zori_id zori_set_margins(zori_id id, int left, int top, int right, int bottom);
  494. zori_id zori_set_margin(zori_id id, int size);
  495. zori_id zori_set_paddings(zori_id id, int left, int top, int right, int bottom);
  496. zori_id zori_set_padding(zori_id id, int size);
  497. zori_font *zori_text_font(zori_id id);
  498. void zori_destroy_root(void);
  499. zori_id zori_shutdown(void);
  500. void zori_draw_all(void);
  501. int zori_handle_system_event(zori_system_event *sysev);
  502. void zori_update(double dt);
  503. int zori_result(zori_id id);
  504. #endif