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