Rev 308 | Go to most recent revision | Details | Compare with Previous | Last modification | View Log | RSS feed
Rev | Author | Line No. | Line |
---|---|---|---|
205 | heavyiron | 1 | ;--- другие макросы --- |
2 | include 'editbox.inc' |
||
3 | include 'txtbut.inc' |
||
308 | Lrz | 4 | ;include 'gp.inc' |
5 | ;include 'label.inc' |
||
6 | ;include 'checkbox.inc' |
||
7 | ;include 'file_sys.inc' |
||
8 | ;include 'textwork.inc' |
||
9 | ;include 'ini.inc' |
||
31 | halyavin | 10 | |
205 | heavyiron | 11 | ;--- заголовок --- |
12 | macro meos_header par_buf,cur_dir_buf |
||
13 | { |
||
308 | Lrz | 14 | use32 |
15 | org 0x0 |
||
31 | halyavin | 16 | |
308 | Lrz | 17 | db 'MENUET01' |
18 | dd 0x01 |
||
19 | dd __app_start |
||
20 | dd __app_end |
||
21 | dd __app_end |
||
22 | dd __app_end |
||
205 | heavyiron | 23 | if |
308 | Lrz | 24 | dd 0x0 |
205 | heavyiron | 25 | else |
308 | Lrz | 26 | dd par_buf |
205 | heavyiron | 27 | end if |
28 | if |
||
308 | Lrz | 29 | dd 0x0 |
205 | heavyiron | 30 | else |
308 | Lrz | 31 | dd cur_dir_buf |
205 | heavyiron | 32 | end if |
33 | } |
||
31 | halyavin | 34 | |
205 | heavyiron | 35 | ;--- определить точку входа --- |
36 | macro app_start |
||
37 | { |
||
38 | __app_start: |
||
39 | } |
||
31 | halyavin | 40 | |
205 | heavyiron | 41 | ;--- определить конец приложения и размер стека --- |
42 | macro app_end stack_size |
||
43 | { |
||
44 | if |
||
308 | Lrz | 45 | rb 1024 |
205 | heavyiron | 46 | else |
308 | Lrz | 47 | rb stack_size |
205 | heavyiron | 48 | end if |
49 | __app_end: |
||
50 | } |
||
31 | halyavin | 51 | |
205 | heavyiron | 52 | ;--- завершить текущий поток --- |
53 | macro app_close |
||
54 | { |
||
308 | Lrz | 55 | xor eax,eax |
56 | dec eax |
||
57 | int 0x40 |
||
205 | heavyiron | 58 | } |
31 | halyavin | 59 | |
205 | heavyiron | 60 | ;--- получить код нажатой клавиши --- |
61 | macro get_key |
||
62 | { |
||
308 | Lrz | 63 | mov eax,2 |
64 | int 0x40 |
||
205 | heavyiron | 65 | } |
31 | halyavin | 66 | |
205 | heavyiron | 67 | ;--- получить код нажатой кнопки --- |
68 | macro get_pressed_button |
||
69 | { |
||
308 | Lrz | 70 | mov eax,17 |
71 | int 0x40 |
||
205 | heavyiron | 72 | } |
31 | halyavin | 73 | |
205 | heavyiron | 74 | ;--- сообщить системе о начале перерисовки окна --- |
75 | macro start_draw_window |
||
76 | { |
||
308 | Lrz | 77 | mov eax,12 |
78 | xor ebx,ebx |
||
79 | inc ebx |
||
80 | int 0x40 |
||
205 | heavyiron | 81 | } |
31 | halyavin | 82 | |
205 | heavyiron | 83 | ;--- сообщить системе о завершении перерисовки окна --- |
84 | macro stop_draw_window |
||
85 | { |
||
308 | Lrz | 86 | mov eax,12 |
87 | mov ebx,2 |
||
88 | int 0x40 |
||
205 | heavyiron | 89 | } |
31 | halyavin | 90 | |
205 | heavyiron | 91 | ;--- установить маску ожидаемых событий --- |
92 | macro set_events_mask mask |
||
93 | { |
||
308 | Lrz | 94 | mov eax,40 |
95 | mov ebx,mask |
||
96 | int 0x40 |
||
31 | halyavin | 97 | } |
98 | |||
205 | heavyiron | 99 | ;--- получить информацию о процессе --- |
100 | macro get_procinfo proc_inf_buf,slot_num |
||
101 | { |
||
308 | Lrz | 102 | mov eax,9 |
103 | mov ebx,proc_inf_buf |
||
205 | heavyiron | 104 | if |
308 | Lrz | 105 | xor ecx,ecx |
106 | dec ecx |
||
205 | heavyiron | 107 | else |
308 | Lrz | 108 | mov ecx,slot_num |
205 | heavyiron | 109 | end if |
308 | Lrz | 110 | int 0x40 |
31 | halyavin | 111 | } |
112 | |||
205 | heavyiron | 113 | macro get_sys_colors col_buf |
114 | { |
||
308 | Lrz | 115 | mov eax,48 |
116 | mov ebx,3 |
||
117 | mov ecx,col_buf |
||
118 | mov edx,40 |
||
119 | int 0x40 |
||
205 | heavyiron | 120 | } |
31 | halyavin | 121 | |
205 | heavyiron | 122 | macro get_grab_area |
123 | { |
||
308 | Lrz | 124 | mov eax,48 |
125 | mov ebx,7 |
||
126 | int 0x40 |
||
205 | heavyiron | 127 | } |
31 | halyavin | 128 | |
308 | Lrz | 129 | macro get_skin_height |
31 | halyavin | 130 | { |
308 | Lrz | 131 | mov eax,48 |
132 | mov ebx,4 |
||
133 | int 0x40 |
||
31 | halyavin | 134 | } |
135 | |||
205 | heavyiron | 136 | macro min_window |
137 | { |
||
308 | Lrz | 138 | mov eax,18 |
139 | mov ebx,10 |
||
140 | int 0x40 |
||
31 | halyavin | 141 | } |
142 | |||
205 | heavyiron | 143 | macro activ_window slot_n |
144 | { |
||
308 | Lrz | 145 | mov eax,18 |
146 | mov ebx,3 |
||
205 | heavyiron | 147 | if |
148 | else |
||
308 | Lrz | 149 | mov ecx,slot_n |
205 | heavyiron | 150 | end if |
308 | Lrz | 151 | int 0x40 |
31 | halyavin | 152 | } |
153 | |||
205 | heavyiron | 154 | macro get_active_window |
155 | { |
||
308 | Lrz | 156 | mov eax,18 |
157 | mov ebx,7 |
||
158 | int 0x40 |
||
205 | heavyiron | 159 | } |
31 | halyavin | 160 | |
205 | heavyiron | 161 | macro delay time |
162 | { |
||
308 | Lrz | 163 | mov eax,5 |
205 | heavyiron | 164 | if |
165 | else |
||
308 | Lrz | 166 | mov ebx,time |
205 | heavyiron | 167 | end if |
308 | Lrz | 168 | int 0x40 |
205 | heavyiron | 169 | } |
31 | halyavin | 170 | |
205 | heavyiron | 171 | ;--- ожидать события --- |
172 | macro wait_event redraw,key,button,mouse,ipc,other |
||
173 | { |
||
308 | Lrz | 174 | mov eax,10 |
175 | int 0x40 |
||
176 | dec ax |
||
205 | heavyiron | 177 | if |
178 | else |
||
308 | Lrz | 179 | jz redraw |
205 | heavyiron | 180 | end if |
308 | Lrz | 181 | dec ax |
205 | heavyiron | 182 | if |
183 | else |
||
308 | Lrz | 184 | jz key |
205 | heavyiron | 185 | end if |
308 | Lrz | 186 | dec ax |
205 | heavyiron | 187 | if |
188 | else |
||
308 | Lrz | 189 | jz button |
205 | heavyiron | 190 | end if |
308 | Lrz | 191 | dec ax |
192 | dec ax |
||
193 | dec ax |
||
205 | heavyiron | 194 | if |
195 | else |
||
308 | Lrz | 196 | jz mouse |
205 | heavyiron | 197 | end if |
198 | if |
||
199 | else |
||
308 | Lrz | 200 | dec ax |
201 | jz ipc |
||
205 | heavyiron | 202 | end if |
203 | if |
||
308 | Lrz | 204 | jmp still |
205 | heavyiron | 205 | else |
308 | Lrz | 206 | jmp other |
205 | heavyiron | 207 | end if |
208 | } |
||
31 | halyavin | 209 | |
205 | heavyiron | 210 | ;--- получить размеры экрана --- |
211 | macro get_screen_size |
||
212 | { |
||
308 | Lrz | 213 | mov eax,14 |
214 | int 0x40 |
||
205 | heavyiron | 215 | } |
31 | halyavin | 216 | |
205 | heavyiron | 217 | macro get_screen_prop struc_ptr |
218 | { |
||
308 | Lrz | 219 | mov eax,61 |
220 | push eax eax |
||
221 | xor ebx,ebx |
||
222 | inc ebx |
||
223 | int 0x40 |
||
224 | mov [struc_ptr],eax |
||
225 | pop eax |
||
226 | inc ebx |
||
227 | int 0x40 |
||
228 | mov [struc_ptr+4],ax |
||
229 | pop eax |
||
230 | inc ebx |
||
231 | int 0x40 |
||
232 | mov [struc_ptr+6],eax |
||
205 | heavyiron | 233 | } |
31 | halyavin | 234 | |
205 | heavyiron | 235 | macro resize_mem mem_size |
236 | { |
||
308 | Lrz | 237 | mov eax,64 |
238 | xor ebx,ebx |
||
239 | inc ebx |
||
205 | heavyiron | 240 | if |
241 | else |
||
308 | Lrz | 242 | mov ecx,mem_size |
205 | heavyiron | 243 | end if |
308 | Lrz | 244 | int 0x40 |
205 | heavyiron | 245 | } |
31 | halyavin | 246 | |
205 | heavyiron | 247 | evm_redraw equ 1 |
248 | evm_key equ 10b |
||
249 | evm_button equ 100b |
||
250 | evm_mouse equ 100000b |
||
251 | evm_ipc equ 1000000b |
||
31 | halyavin | 252 | |
205 | heavyiron | 253 | struc procinfo |
254 | { |
||
255 | .takts_per_second: dd ? |
||
256 | .window_stack_pos: dw ? |
||
257 | .slot_number: dw ? |
||
258 | dw ? |
||
259 | .name: rb 11 |
||
260 | .align: db ? |
||
261 | .addres: dd ? |
||
262 | .use_mem: dd ? |
||
263 | .pid: dd ? |
||
264 | .left: dd ? |
||
265 | .top: dd ? |
||
266 | .width: dd ? |
||
267 | .height: dd ? |
||
268 | .slot_state: dw ? |
||
269 | rb (1024-56) |
||
270 | } |
||
31 | halyavin | 271 | |
205 | heavyiron | 272 | struc sys_color_table |
273 | { |
||
274 | .frames: dd ? ;+0 |
||
275 | .grab: dd ? ;+4 |
||
276 | .grab_button: dd ? ;+8 |
||
277 | .grab_button_text: dd ? ;+12 |
||
278 | .grab_text: dd ? ;+16 |
||
308 | Lrz | 279 | .work: dd ? ;+20 |
205 | heavyiron | 280 | .work_button: dd ?;+24 |
281 | .work_button_text: dd ? ;+28 |
||
308 | Lrz | 282 | .work_text: dd ? ;+32 |
283 | .work_graph: dd ? ;+36 |
||
205 | heavyiron | 284 | } |
31 | halyavin | 285 | |
205 | heavyiron | 286 | struc screen_size |
287 | { |
||
288 | .height: dw ? |
||
289 | .width: dw ? |
||
290 | } |
||
31 | halyavin | 291 | |
205 | heavyiron | 292 | struc screen_prop |
293 | { |
||
294 | .height: dw ? ;+0 |
||
295 | .width: dw ? ;+2 |
||
296 | .bitspp: dw ? ;+4 |
||
297 | .bytesps: dd ?;+6 |
||
298 | } |
||
31 | halyavin | 299 | |
205 | heavyiron | 300 | struc ipc_buffer size |
301 | { |
||
302 | .block: dd ? |
||
303 | .in_use: dd ? |
||
304 | .messages: rb size |
||
305 | } |
||
31 | halyavin | 306 | |
205 | heavyiron | 307 | ;--- цвета --- |
308 | cl_white=0xffffff |
||
309 | cl_black=0x000000>>>>>>>>>>>>> |