Subversion Repositories Kolibri OS

Rev

Rev 305 | 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
 
308 Lrz 11
lang fix ru;en
12
 
205 heavyiron 13
;--- заголовок ---
14
macro meos_header par_buf,cur_dir_buf
15
{
308 Lrz 16
	use32
17
	org	0x0
31 halyavin 18
 
308 Lrz 19
	db	'MENUET01'
20
	dd	0x01
21
	dd	__app_start
22
	dd	__app_end
23
	dd	__app_end
24
	dd	__app_end
205 heavyiron 25
if  eq <>
308 Lrz 26
	dd	0x0
205 heavyiron 27
else
308 Lrz 28
	dd	par_buf
205 heavyiron 29
end if
30
if  eq <>
308 Lrz 31
	dd	0x0
205 heavyiron 32
else
308 Lrz 33
	dd	cur_dir_buf
205 heavyiron 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  eq <>
308 Lrz 47
	rb	1024
205 heavyiron 48
else
308 Lrz 49
	rb	stack_size
205 heavyiron 50
end if
51
__app_end:
52
}
31 halyavin 53
 
205 heavyiron 54
;--- завершить текущий поток ---
55
macro app_close
56
{
308 Lrz 57
	xor	eax,eax
58
	dec	eax
59
	int	0x40
205 heavyiron 60
}
31 halyavin 61
 
205 heavyiron 62
;--- получить код нажатой клавиши ---
63
macro get_key
64
{
308 Lrz 65
	mov	eax,2
66
	int	0x40
205 heavyiron 67
}
31 halyavin 68
 
205 heavyiron 69
;--- получить код нажатой кнопки ---
70
macro get_pressed_button
71
{
308 Lrz 72
	mov	eax,17
73
	int	0x40
205 heavyiron 74
}
31 halyavin 75
 
205 heavyiron 76
;--- сообщить системе о начале перерисовки окна ---
77
macro start_draw_window
78
{
308 Lrz 79
	mov	eax,12
80
	xor	ebx,ebx
81
	inc	ebx
82
	int	0x40
205 heavyiron 83
}
31 halyavin 84
 
205 heavyiron 85
;--- сообщить системе о завершении перерисовки окна ---
86
macro stop_draw_window
87
{
308 Lrz 88
	mov	eax,12
89
	mov	ebx,2
90
	int	0x40
205 heavyiron 91
}
31 halyavin 92
 
205 heavyiron 93
;--- установить маску ожидаемых событий ---
94
macro set_events_mask mask
95
{
308 Lrz 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
{
308 Lrz 104
	mov	eax,9
105
	mov	ebx,proc_inf_buf
205 heavyiron 106
if  eq <>
308 Lrz 107
	xor	ecx,ecx
108
	dec	ecx
205 heavyiron 109
else
308 Lrz 110
	mov	ecx,slot_num
205 heavyiron 111
end if
308 Lrz 112
	int	0x40
31 halyavin 113
}
114
 
205 heavyiron 115
macro get_sys_colors col_buf
116
{
308 Lrz 117
	mov	eax,48
118
	mov	ebx,3
119
	mov	ecx,col_buf
120
	mov	edx,40
121
	int	0x40
205 heavyiron 122
}
31 halyavin 123
 
205 heavyiron 124
macro get_grab_area
125
{
308 Lrz 126
	mov	eax,48
127
	mov	ebx,7
128
	int	0x40
205 heavyiron 129
}
31 halyavin 130
 
308 Lrz 131
macro get_skin_height
31 halyavin 132
{
308 Lrz 133
	mov	eax,48
134
	mov	ebx,4
135
	int	0x40
31 halyavin 136
}
137
 
205 heavyiron 138
macro min_window
139
{
308 Lrz 140
	mov	eax,18
141
	mov	ebx,10
142
	int	0x40
31 halyavin 143
}
144
 
205 heavyiron 145
macro activ_window slot_n
146
{
308 Lrz 147
	mov	eax,18
148
	mov	ebx,3
205 heavyiron 149
if  eq <>
150
else
308 Lrz 151
	mov	ecx,slot_n
205 heavyiron 152
end if
308 Lrz 153
	int	0x40
31 halyavin 154
}
155
 
205 heavyiron 156
macro get_active_window
157
{
308 Lrz 158
	mov	eax,18
159
	mov	ebx,7
160
	int	0x40
205 heavyiron 161
}
31 halyavin 162
 
205 heavyiron 163
macro delay time
164
{
308 Lrz 165
	mov	eax,5
205 heavyiron 166
if 
167
else
308 Lrz 168
	mov	ebx,time
205 heavyiron 169
end if
308 Lrz 170
	int	0x40
205 heavyiron 171
}
31 halyavin 172
 
205 heavyiron 173
;--- ожидать события ---
174
macro wait_event redraw,key,button,mouse,ipc,other
175
{
308 Lrz 176
	mov	eax,10
177
	int	0x40
178
	dec	ax
205 heavyiron 179
if  eq <>
180
else
308 Lrz 181
	jz	redraw
205 heavyiron 182
end if
308 Lrz 183
	dec	ax
205 heavyiron 184
if  eq <>
185
else
308 Lrz 186
	jz	key
205 heavyiron 187
end if
308 Lrz 188
	dec	ax
205 heavyiron 189
if 
190
else
308 Lrz 191
	jz	button
205 heavyiron 192
end if
308 Lrz 193
	dec	ax
194
	dec	ax
195
	dec	ax
205 heavyiron 196
if  eq <>
197
else
308 Lrz 198
	jz	mouse
205 heavyiron 199
end if
200
if  eq <>
201
else
308 Lrz 202
	dec	ax
203
	jz	ipc
205 heavyiron 204
end if
205
if  eq <>
308 Lrz 206
	jmp	still
205 heavyiron 207
else
308 Lrz 208
	jmp	other
205 heavyiron 209
end if
210
}
31 halyavin 211
 
205 heavyiron 212
;--- получить размеры экрана ---
213
macro get_screen_size
214
{
308 Lrz 215
	mov	eax,14
216
	int	0x40
205 heavyiron 217
}
31 halyavin 218
 
205 heavyiron 219
macro get_screen_prop  struc_ptr
220
{
308 Lrz 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
205 heavyiron 235
}
31 halyavin 236
 
205 heavyiron 237
macro resize_mem mem_size
238
{
308 Lrz 239
	mov	eax,64
240
	xor	ebx,ebx
241
	inc	ebx
205 heavyiron 242
if  eq <>
243
else
308 Lrz 244
	mov	ecx,mem_size
205 heavyiron 245
end if
308 Lrz 246
	int	0x40
205 heavyiron 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
308 Lrz 281
.work: dd ?	  ;+20
205 heavyiron 282
.work_button: dd ?;+24
283
.work_button_text: dd ? ;+28
308 Lrz 284
.work_text: dd ?	;+32
285
.work_graph: dd ?	;+36
205 heavyiron 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