Subversion Repositories Kolibri OS

Rev

Rev 353 | Go to most recent revision | Details | Compare with Previous | Last modification | View Log | RSS feed

Rev Author Line No. Line
205 heavyiron 1
;--- другие макросы ---
353 heavyiron 2
include '..\..\develop\examples\editbox\trunk\editbox.inc'
205 heavyiron 3
include 'txtbut.inc'
307 Lrz 4
;include 'gp.inc'
205 heavyiron 5
include 'label.inc'
353 heavyiron 6
;include '..\..\develop\examples\checkbox\trunk\checkbox.inc'
205 heavyiron 7
include 'check.inc'
8
include 'file_sys.inc'
9
include 'textwork.inc'
10
;include 'ini.inc'
11
 
485 heavyiron 12
__CPU_type	equ	p5
13
SYSENTER_VAR	equ	0
14
 
15
 
205 heavyiron 16
macro movr reg,val
17
{
18
if val < 65536
19
	push	val
20
	pop	reg
21
else
22
	mov	reg,val
23
end if
24
}
25
 
485 heavyiron 26
macro mcall a,b,c,d,e,f {   ; mike.dld, updated by Ghost for Fast System Calls
27
 local	..ret_point
28
 __mov eax,a
29
 __mov ebx,b
30
 __mov ecx,c
31
 __mov edx,d
32
 __mov esi,e
33
 __mov edi,f
34
 
35
 if __CPU_type eq p5
36
	int	0x40
37
 else
38
  if __CPU_type eq p6
39
	push	ebp
40
	mov	ebp, esp
41
	push	..ret_point	; it may be 2 or 5 byte
42
	sysenter
43
 ..ret_point:
44
	pop	edx
45
	pop	ecx
46
 
47
  else
48
   if __CPU_type eq k6
49
	push	ecx
50
	syscall
51
	pop	ecx
52
   else
53
	display 'ERROR : unknown CPU type'
54
	int	0x40
55
   end if
56
  end if
57
 end if
58
}
59
 
60
macro __mov reg,a,b {	    ; mike.dld
61
 if (~a eq)&(~b eq)
62
   mpack reg,a,b
63
 else if (~a eq)&(b eq)
64
   mov reg,a
65
 end if
66
}
67
 
68
 
205 heavyiron 69
;--- заголовок ---
70
macro meos_header par_buf,cur_dir_buf
71
{
72
	use32
73
	org	0x0
74
 
75
	db	'MENUET01'
76
	dd	0x01
77
	dd	__app_start
78
	dd	__app_end
79
	dd	__app_end
80
	dd	__app_end
81
if  eq <>
82
	dd	0x0
83
else
84
	dd	par_buf
85
end if
86
if  eq <>
87
	dd	0x0
88
else
89
	dd	cur_dir_buf
90
end if
91
}
92
 
93
;--- определить точку входа ---
94
macro app_start
95
{
96
__app_start:
97
}
98
 
99
;--- определить конец приложения и размер стека ---
100
macro app_end stack_size
101
{
102
if  eq <>
103
	rb	1024
104
else
105
	rb	stack_size
106
end if
107
__app_end:
108
}
109
 
110
;--- завершить текущий поток ---
111
macro app_close
112
{
113
	xor	eax,eax
114
	dec	eax
115
	int	0x40
116
}
117
 
118
;--- получить код нажатой клавиши ---
119
macro get_key
120
{
121
	;mov     eax,2
122
	push	2
123
	pop	eax
124
	int	0x40
125
}
126
 
127
;--- получить код нажатой кнопки ---
128
macro get_pressed_button
129
{
130
	;mov     eax,17
131
	push	17
132
	pop	eax
133
	int	0x40
134
}
135
 
136
;--- сообщить системе о начале перерисовки окна ---
137
macro start_draw_window
138
{
139
	;mov     eax,12
140
	push	12
141
	pop	eax
142
	xor	ebx,ebx
143
	inc	ebx
144
	int	0x40
145
}
146
 
147
;--- сообщить системе о завершении перерисовки окна ---
148
macro stop_draw_window
149
{
150
	;mov     eax,12
151
	push	12
152
	pop	eax
153
	;mov     ebx,2
154
	push	2
155
	pop	ebx
156
	int	0x40
157
}
158
 
159
;--- установить маску ожидаемых событий ---
160
macro set_events_mask mask
161
{
162
	;mov     eax,40
163
	push	40
164
	pop	eax
165
	;mov     ebx,mask
166
	push	mask
167
	pop	ebx
168
	int	0x40
169
}
170
 
171
;--- получить информацию о процессе ---
172
macro get_procinfo proc_inf_buf,slot_num
173
{
174
	;mov     eax,9
175
	push	9
176
	pop	eax
177
	;mov     ebx,proc_inf_buf
178
	push	proc_inf_buf
179
	pop	ebx
180
if  eq <>
181
	xor	ecx,ecx
182
	dec	ecx
183
else
184
	;mov     ecx,slot_num
185
	push	slot_num
186
	pop	ecx
187
end if
188
	int	0x40
189
}
190
 
191
macro get_sys_colors col_buf
192
{
193
	;mov     eax,48
194
	push	48
195
	pop	eax
196
	;mov     ebx,3
197
	push	3
198
	pop	ebx
199
	;mov     ecx,col_buf
200
	push	col_buf
201
	pop	ecx
202
	;mov     edx,40
203
	push	40
204
	pop	edx
205
	int	0x40
206
}
207
 
208
macro get_grab_area
209
{
210
	movr	 eax,48
211
	movr	 ebx,7
212
	int	0x40
213
}
214
 
307 Lrz 215
macro get_skin_height
205 heavyiron 216
{
217
	movr	 eax,48
218
	movr	 ebx,4
219
	int	0x40
220
}
221
 
222
macro min_window
223
{
224
	movr	 eax,18
225
	movr	 ebx,10
226
	int	0x40
227
}
228
 
229
macro activ_window slot_n
230
{
231
	movr	 eax,18
232
	movr	 ebx,3
233
if  eq <>
234
else
235
	movr	 ecx,slot_n
236
end if
237
	int	0x40
238
}
239
 
240
macro get_active_window
241
{
242
	movr	 eax,18
243
	movr	 ebx,7
244
	int	0x40
245
}
246
 
247
macro delay time
248
{
249
	movr	 eax,5
250
if 
251
else
252
	movr	 ebx,time
253
end if
254
	int	0x40
255
}
256
 
257
;--- ожидать события ---
258
macro wait_event redraw,key,button,mouse,ipc,other
259
{
260
	movr	 eax,10
261
	int	0x40
262
	dec	ax
263
if  eq <>
264
else
265
	jz	redraw
266
end if
267
	dec	ax
268
if  eq <>
269
else
270
	jz	key
271
end if
272
	dec	ax
273
if 
274
else
275
	jz	button
276
end if
277
	dec	ax
278
	dec	ax
279
	dec	ax
280
if  eq <>
281
else
282
	jz	mouse
283
end if
284
if  eq <>
285
else
286
	dec	ax
287
	jz	ipc
288
end if
289
if  eq <>
290
	jmp	still
291
else
292
	jmp	other
293
end if
294
}
295
 
296
;--- получить размеры экрана ---
297
macro get_screen_size
298
{
299
	movr	 eax,14
300
	int	0x40
301
}
302
 
303
macro get_screen_prop  struc_ptr
304
{
305
	movr	 eax,61
306
	push	eax eax
307
	xor	ebx,ebx
308
	inc	ebx
309
	int	0x40
310
	mov	[struc_ptr],eax
311
	pop	eax
312
	inc	ebx
313
	int	0x40
314
	mov	[struc_ptr+4],ax
315
	pop	eax
316
	inc	ebx
317
	int	0x40
318
	mov	[struc_ptr+6],eax
319
}
320
 
321
macro resize_mem mem_size
322
{
323
	movr	 eax,64
324
	xor	ebx,ebx
325
	inc	ebx
326
if  eq <>
327
else
328
	movr	 ecx,mem_size
329
end if
330
	int	0x40
331
}
332
 
333
evm_redraw equ 1
334
evm_key equ 10b
335
evm_button equ 100b
336
evm_mouse equ 100000b
337
evm_ipc equ 1000000b
338
 
339
struc procinfo
340
{
341
.takts_per_second: dd ?
342
.window_stack_pos: dw ?
343
.slot_number: dw ?
344
dw ?
345
.name: rb 11
346
.align: db ?
347
.addres: dd ?
348
.use_mem: dd ?
349
.pid: dd ?
350
.left: dd ?
351
.top: dd ?
352
.width: dd ?
353
.height: dd ?
354
.slot_state: dw ?
355
rb (1024-56)
356
}
357
 
358
struc sys_color_table
359
{
360
.frames: dd ?  ;+0
361
.grab: dd ?    ;+4
362
.grab_button: dd ? ;+8
363
.grab_button_text: dd ?  ;+12
364
.grab_text: dd ?  ;+16
365
.work: dd ?	  ;+20
366
.work_button: dd ?;+24
367
.work_button_text: dd ? ;+28
368
.work_text: dd ?	;+32
369
.work_graph: dd ?	;+36
370
}
371
 
372
struc screen_size
373
{
374
.height: dw ?
375
.width: dw ?
376
}
377
 
378
struc screen_prop
379
{
380
.height: dw ? ;+0
381
.width: dw ?  ;+2
382
.bitspp: dw ? ;+4
383
.bytesps: dd ?;+6
384
}
385
 
386
struc ipc_buffer size
387
{
388
.block: dd ?
389
.in_use: dd ?
390
.messages: rb size
391
}
392
 
393
;--- цвета ---
394
cl_white=0xffffff
307 Lrz 395
cl_black=0x000000
396
 
397
;==============================================================================
398
;============== Константы =====================================================
399
;==============================================================================