forked from vygr/ChrysaLisp
-
Notifications
You must be signed in to change notification settings - Fork 0
/
gui.inc
64 lines (53 loc) · 1.17 KB
/
gui.inc
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
(import 'sys/class.inc)
(import 'sys/code.inc)
(import 'sys/heap/heap.inc)
(import 'sys/list/list.inc)
(import 'sys/mail/mail.inc)
(defcvar 'SCREEN_WIDTH 1280)
(defcvar 'SCREEN_HEIGHT 960)
;;;;;;;;;;;;;;;;;;
; gui static class
;;;;;;;;;;;;;;;;;;
(def-class 'gui_gui)
(def-method 'statics 'gui/gui_statics)
(def-method 'init 'gui/gui_init 'static '(r0))
(def-method 'update 'gui/gui_update 'static '(r0))
(def-method 'add 'gui/gui_add 'static '(r0))
(def-method 'gui 'gui/gui)
;;;;;;;;;;;;;;;;
; gui structures
;;;;;;;;;;;;;;;;
(def-struct 'gui_statics)
(ptr 'sdl_funcs)
(struct 'rect_heap 'hp_heap)
(ptr 'window)
(ptr 'screen)
(ulong 'renderer)
(ptr 'old_region)
(ulong 'next_id)
(ubyte 'dirty_flag)
(def-struct-end)
;;;;;;;;;;;;;;;;;;;;
; gui event msg data
;;;;;;;;;;;;;;;;;;;;
(def-enum 'ev_type)
(enum 'mouse 'key 'action)
(def-enum-end)
(def-struct 'ev_msg)
(ulong 'target_id)
(ulong 'type)
(def-struct-end)
(def-struct 'ev_msg_mouse 'ev_msg)
(uint 'buttons)
(int 'x)
(int 'y)
(int 'rx)
(int 'ry)
(def-struct-end)
(def-struct 'ev_msg_key 'ev_msg)
(uint 'keycode)
(uint 'key)
(def-struct-end)
(def-struct 'ev_msg_action 'ev_msg)
(ulong 'source_id)
(def-struct-end)