Rev 6457 | Rev 6479 | Go to most recent revision | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 6457 | Rev 6470 | ||
---|---|---|---|
Line 11... | Line 11... | ||
11 | 11 | ||
12 | /* All supported GUI elements included */ |
12 | /* All supported GUI elements included */ |
Line 13... | Line 13... | ||
13 | #include "kolibri_gui_elements.h" |
13 | #include "kolibri_gui_elements.h" |
- | 14 | ||
14 | 15 | enum KOLIBRI_GUI_EVENTS { |
|
15 | enum KOLIBRI_GUI_EVENTS { |
16 | KOLIBRI_EVENT_NONE = 0, /* Event queue is empty */ |
16 | KOLIBRI_EVENT_REDRAW = 1, /* Window and window elements should be redrawn */ |
17 | KOLIBRI_EVENT_REDRAW = 1, /* Window and window elements should be redrawn */ |
- | 18 | KOLIBRI_EVENT_KEY = 2, /* A key on the keyboard was pressed */ |
|
17 | KOLIBRI_EVENT_KEY = 2, /* A key on the keyboard was pressed */ |
19 | KOLIBRI_EVENT_BUTTON = 3, /* A button was clicked with the mouse */ |
- | 20 | KOLIBRI_EVENT_DESKTOP = 5, /* Desktop redraw finished */ |
|
- | 21 | KOLIBRI_EVENT_MOUSE = 6, /* Mouse activity (movement, button press) was detected */ |
|
- | 22 | KOLIBRI_EVENT_IPC = 7, /* Interprocess communication notify */ |
|
- | 23 | KOLIBRI_EVENT_NETWORK = 8, /* Network event */ |
|
18 | KOLIBRI_EVENT_BUTTON = 3, /* A button was clicked with the mouse */ |
24 | KOLIBRI_EVENT_DEBUG = 9, /* Debug subsystem event */ |
Line 19... | Line 25... | ||
19 | KOLIBRI_EVENT_MOUSE = 6 /* Mouse activity (movement, button press) was detected */ |
25 | KOLIBRI_EVENT_IRQBEGIN = 16 /* 16..31 IRQ0..IRQ15 interrupt =IRQBEGIN+IRQn */ |
- | 26 | }; |
|
Line 20... | Line 27... | ||
20 | }; |
27 | |
21 | 28 | #define BUTTON_CLOSE 0x1 |
|
22 | #define BUTTON_CLOSE 0x1 |
29 | #define BTN_QUIT 1 |
Line 38... | Line 45... | ||
38 | kolibri_window_element* current_element = some_window -> elements; |
45 | kolibri_window_element* current_element = some_window -> elements; |
Line 39... | Line 46... | ||
39 | 46 | ||
40 | do |
47 | do |
41 | { |
48 | { |
42 | /* The redraw_fn serves as draw_fn on initial draw */ |
49 | /* The redraw_fn serves as draw_fn on initial draw */ |
43 | if(kolibri_gui_op_table[current_element -> type].redraw_fn) |
50 | if((int)kolibri_gui_op_table[current_element -> type].redraw_fn > 0) // -1 if DLL link fail |
Line 44... | Line 51... | ||
44 | kolibri_gui_op_table[current_element -> type].redraw_fn(current_element -> element); |
51 | kolibri_gui_op_table[current_element -> type].redraw_fn(current_element -> element); |
45 | 52 | ||
46 | //sie after fixing calling conventions no more needed |
53 | //sie after fixing calling conventions no more needed |
Line 70... | Line 77... | ||
70 | kolibri_window_element *current_element = some_window -> elements; |
77 | kolibri_window_element *current_element = some_window -> elements; |
Line 71... | Line 78... | ||
71 | 78 | ||
72 | do |
79 | do |
73 | { |
80 | { |
74 | /* Only execute if the function pointer isn't NULL */ |
81 | /* Only execute if the function pointer isn't NULL */ |
75 | if(kolibri_gui_op_table[current_element -> type].key_fn) |
82 | if((int)kolibri_gui_op_table[current_element -> type].key_fn > 0) |
Line 76... | Line 83... | ||
76 | kolibri_gui_op_table[current_element -> type].key_fn(current_element -> element); |
83 | kolibri_gui_op_table[current_element -> type].key_fn(current_element -> element); |
77 | 84 | ||
78 | current_element = current_element -> next; |
85 | current_element = current_element -> next; |
Line 87... | Line 94... | ||
87 | { |
94 | { |
88 | kolibri_window_element *current_element = some_window -> elements; |
95 | kolibri_window_element *current_element = some_window -> elements; |
Line 89... | Line 96... | ||
89 | 96 | ||
90 | do |
97 | do |
91 | { |
98 | { |
92 | if(kolibri_gui_op_table[current_element -> type].mouse_fn) |
99 | if((int)kolibri_gui_op_table[current_element -> type].mouse_fn > 0) |
Line 93... | Line 100... | ||
93 | kolibri_gui_op_table[current_element -> type].mouse_fn(current_element -> element); |
100 | kolibri_gui_op_table[current_element -> type].mouse_fn(current_element -> element); |
Line 94... | Line 101... | ||
94 | 101 |