Subversion Repositories Kolibri OS

Rev

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

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