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