Subversion Repositories Kolibri OS

Rev

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

Rev Author Line No. Line
717 mikedld 1
 
2
  org	 0x0
3
4
 
5
  dd	 0x01
6
  dd	 START
7
  dd	 I_END
8
  dd	 0x1000
9
  dd	 0x1000
10
  dd	 0x0
11
  dd	 0x0
12
13
 
14
TRUE  = 1
15
16
 
17
include '../../../../../macros.inc'
18
include '../../libio/libio.inc'
19
include '../dll.inc'
20
21
 
22
23
 
24
	pushad
25
26
 
27
	mov	edi,buf
28
	cld
29
	mov	al,"'"
30
	stosb
31
    @@: lodsb
32
	stosb
33
	or	al,al
34
	jnz	@b
35
	mov	word[edi-1],"'"
36
37
 
38
	or	esi,esi
39
	je	.noval
40
	mov	eax," = '"
41
	stosd
42
    @@: lodsb
43
	stosb
44
	or	al,al
45
	jnz	@b
46
	mov	word[edi-1],"'"
47
  .noval:
48
49
 
50
	mcall	4,<[xx],[yy]>,[color],buf
51
	add	[yy],10
52
	popad
53
	ret
54
endp
55
56
 
57
	stdcall draw,224,0x0000FF,[key_name],[key_val]
58
	mov	eax,TRUE
59
	ret
60
endp
61
62
 
63
	stdcall draw,200,0xFF0000,[sec_name],0
64
	invoke	ini.enum_keys,[f_name],[sec_name],callb_k
65
	mov	eax,TRUE
66
	ret
67
endp
68
69
 
70
;---  ÍÀ×ÀËÎ ÏÐÎÃÐÀÌÌÛ  ----------------------------------------------
71
;---------------------------------------------------------------------
72
73
 
74
s_key2 db "RightViewMode",0
75
76
 
77
{
78
  common
79
    label label1
80
  forward
81
    local ..lbl
82
    dd ..lbl - $
83
    db str1,0
84
    ..lbl:
85
  common
86
    dd 0
87
    label label2
88
  forward
89
    local ..lbl
90
    dd ..lbl - $
91
    db str2,0
92
    ..lbl:
93
  common
94
    label label3
95
  forward
96
    if res = "t"
97
      dd 1
98
    else
99
      dd 0
100
    end if
101
}
102
103
 
104
  ""	       ,""	 ,"t",	  ""		,"a"	    ,"f", \
105
  "a"	       ,"a"	 ,"t",	  "a"		,"b"	    ,"f", \
106
  "?"	       ,"b"	 ,"t",	  "??"		,"bc"	    ,"t", \
107
  "?c"	       ,"bc"	 ,"t",	  "b?"		,"bc"	    ,"t", \
108
  "[a-z]"      ,"b"	 ,"t",	  "[A-Z]"	,"b"	    ,"f", \
109
  "*"	       ,"a"	 ,"t",	  "**"		,"a"	    ,"t", \
110
  "*"	       ,""	 ,"t",	  "*bc*hij"	,"abcdfghij","t", \
111
  "*b*a*"      ,"b"	 ,"f",	  "*bc*hik"	,"abcdfghij","f", \
112
  "abc*"       ,"abc"	 ,"t",	  "abc**"	,"abc"	    ,"t", \
113
  "[^]]"       ,"^"	 ,"t",	  "[^]]"	,"]"	    ,"f", \
114
  "[^abc]"     ,"d"	 ,"t",	  "[^abc]"	,"b"	    ,"f", \
115
  "*???"       ,"abc"	 ,"t",	  "*???"	,"ab"	    ,"f", \
116
  "*???"       ,"abcd"	 ,"t",	  "*?*" 	,"abcd"     ,"t", \
117
  "*bc"        ,"abc"	 ,"t",	  "*cc" 	,"abc"	    ,"f", \
118
  "[a-c]*"     ,"d"	 ,"f",	  "*[a-e]"	,"d"	    ,"t", \
119
  "*a*"        ,"de"	 ,"f",	  "*[a-c]"	,"d"	    ,"f", \
120
  "[a-c]"      ,"d"	 ,"f",	  "[b-d]"	,"a"	    ,"f", \
121
  "[]abc]"     ,"b"	 ,"t",	  "[]abc]"	,"d"	    ,"f", \
122
  "[z-a]"      ,"-"	 ,"t",	  "[z-a]"	,"b"	    ,"f", \
123
  "[A-]"       ,"-"	 ,"t",	  "[A-]"	,"]"	    ,"f", \
124
  "[-a]"       ,"-"	 ,"t",	  "[-[]"	,"-"	    ,"t", \
125
  "[-]"        ,"-"	 ,"t",	  "[^-b]"	,"a"	    ,"t", \
126
  "[^-b]"      ,"-"	 ,"f",	  "[-b]"	,"a"	    ,"f", \
127
  "[a-g]lorian","florian","t",	  "[a-g]*rorian","f"	    ,"f", \
128
  "*???*"      ,"123"	 ,"t"
129
130
 
131
	mcall	68,11
132
133
 
134
	or	eax,eax
135
	jnz	exit
136
137
 
919 mikedld 138
	mov	esi,_str1 + 4
717 mikedld 139
	mov	edi,_str2 + 4
140
	mov	ecx,_str3
141
	xor	ebx,ebx
142
	inc	ebx
143
    @@: invoke	file.aux.match_wildcard,edi,esi,0
144
	cmp	eax,[ecx]
145
	je	.ok
146
	mcall	-1
147
  .ok:	inc	ebx
148
	add	esi,[esi-4]
149
	add	edi,[edi-4]
150
	add	ecx,4
151
	cmp	dword[esi-4],0
152
	jnz	@b
153
^@
919 mikedld 154
717 mikedld 155
 
156
	invoke	ini.set_int,s_ini,s_sec,s_key2,101
157
158
 
159
	cmp	eax,100
160
	jne	exit
161
	invoke	ini.get_int,s_ini,s_sec,s_key2,-1
162
	cmp	eax,101
163
	jne	exit
164
165
 
166
	invoke	ini.set_str,s_ini,s_sec,s_key1,buf,3
167
	mov	dword[buf],'103'
168
	invoke	ini.set_str,s_ini,s_sec,s_key2,buf,3
169
170
 
1048 mikedld 171
	cmp	dword[buf],'102'
717 mikedld 172
	jne	exit
173
	invoke	ini.get_str,s_ini,s_sec,s_key2,buf,1024,0
1048 mikedld 174
	cmp	dword[buf],'103'
717 mikedld 175
	jne	exit
176
177
 
178
179
 
180
;       or      eax,eax
181
;       jnz     @f
182
;       int3
183
;   @@: mov     [fh],eax
184
;       invoke  file.seek,[fh],SEEK_SET,8192
185
;       invoke  file.write,[fh],s_ininame,16
186
;       invoke  file.seteof,[fh]
187
;       invoke  file.close,[fh]
188
189
 
190
191
 
192
193
 
194
;---  ÖÈÊË ÎÁÐÀÁÎÒÊÈ ÑÎÁÛÒÈÉ  ----------------------------------------
195
;---------------------------------------------------------------------
196
197
 
198
	mcall	10
199
200
 
201
	je	red
202
	cmp	eax,2
203
	je	key
204
	cmp	eax,3
205
	je	button
206
207
 
208
209
 
210
211
 
212
	mcall	2
213
	jmp	still
214
215
 
216
217
 
218
	mcall	17
219
220
 
221
	jne	still
222
223
 
224
	mcall	-1
225
226
 
227
;---  ÎÏÐÅÄÅËÅÍÈÅ È ÎÒÐÈÑÎÂÊÀ ÎÊÍÀ  ----------------------------------
228
;---------------------------------------------------------------------
229
230
 
231
232
 
233
	invoke	gfx.open,TRUE
234
	mov	[ctx],eax
235
	mcall	0,<200,700>,<200,200>,0x33FFFFFF,,s_header
236
	invoke	gfx.pen.color,[ctx],0x00FF0000
237
	invoke	gfx.line,[ctx],0,0,50,50
238
	invoke	gfx.framerect,[ctx],10,10,100,70
239
	invoke	gfx.brush.color,[ctx],0x000000FF
240
	invoke	gfx.fillrect,[ctx],15,15,95,65
241
	invoke	gfx.pen.color,[ctx],0x00008800
242
	invoke	gfx.brush.color,[ctx],0x00CCCCFF
243
	invoke	gfx.rectangle,[ctx],20,20,90,60
244
	invoke	gfx.move.to,[ctx],13,5
245
	invoke	gfx.line.to,[ctx],105,5
246
	invoke	gfx.line.to,[ctx],105,75
247
	invoke	gfx.line.to,[ctx],5,75
248
	invoke	gfx.line.to,[ctx],5,13
249
	invoke	gfx.line.to,[ctx],13,5
250
	invoke	gfx.pen.color,[ctx],0x00888888
251
	invoke	gfx.polyline,[ctx],poly_points,11
252
	invoke	gfx.close,[ctx]
253
254
 
255
	invoke	ini.enum_sections,s_ini,callb
256
257
 
258
	cmp	eax,0
259
	jle	.finished
260
	mov	ebp,eax
261
	mov	[yy],10
262
    @@: lea	edx,[ebp+FileInfo.FileName]
263
	mcall	4,<450,[yy]>,0x80000000
264
	add	[yy],10
265
	invoke	file.find_next,ebp
266
	cmp	eax,0
267
	jg	@b
268
	invoke	file.find_close,ebp
269
270
 
271
272
 
273
274
 
275
_f_mask db '*ini*',0
276
277
 
278
proc mem.Alloc size ;/////////////////////////////////////////////////////////
279
;-----------------------------------------------------------------------------
280
	push	ebx ecx
281
	mov	eax,[size]
282
	lea	ecx,[eax+4+4095]
283
	and	ecx,not 4095
284
	mcall	68,12
285
	add	ecx,-4
286
	mov	[eax],ecx
287
	add	eax,4
288
	pop	ecx ebx
289
	ret
290
endp
291
292
 
293
proc mem.ReAlloc mptr,size;///////////////////////////////////////////////////
294
;-----------------------------------------------------------------------------
295
	push	ebx ecx esi edi eax
296
	mov	eax,[mptr]
297
	mov	ebx,[size]
298
	or	eax,eax
299
	jz	@f
300
	lea	ecx,[ebx+4+4095]
301
	and	ecx,not 4095
302
	add	ecx,-4
303
	cmp	ecx,[eax-4]
304
	je	.exit
305
    @@: mov	eax,ebx
306
	call	mem.Alloc
307
	xchg	eax,[esp]
308
	or	eax,eax
309
	jz	.exit
310
	mov	esi,eax
311
	xchg	eax,[esp]
312
	mov	edi,eax
313
	mov	ecx,[esi-4]
314
	cmp	ecx,[edi-4]
315
	jbe	@f
316
	mov	ecx,[edi-4]
317
    @@: add	ecx,3
318
	shr	ecx,2
319
	cld
320
	rep	movsd
321
	xchg	eax,[esp]
322
	call	mem.Free
323
  .exit:
324
	pop	eax edi esi ecx ebx
325
	ret
326
endp
327
328
 
329
proc mem.Free mptr ;//////////////////////////////////////////////////////////
330
;-----------------------------------------------------------------------------
331
	mov	eax,[mptr]
332
	or	eax,eax
333
	jz	@f
334
	push	ebx ecx
335
	lea	ecx,[eax-4]
336
	mcall	68,13
337
	pop	ecx ebx
338
    @@: ret
339
endp
340
341
 
342
;---  ÄÀÍÍÛÅ ÏÐÎÃÐÀÌÌÛ  ----------------------------------------------
343
;---------------------------------------------------------------------
344
345
 
346
347
 
348
s_sec db 'Panels',0
349
s_key db 'param1',0
350
351
 
352
poly_points dd \
353
  140, 10, \
354
  150, 10, \
355
  150, 20, \
356
  160, 20, \
357
  160, 30, \
358
  170, 30, \
359
  170, 40, \
360
  180, 40, \
361
  180, 50, \
362
  140, 50, \
363
  140, 10
364
365
 
366
367
 
368
@IMPORT:
369
370
 
371
	libini,'libini.obj',\
372
	libio ,'libio.obj',\
373
	libgfx,'libgfx.obj'
374
375
 
376
	ini.get_str,'ini.get_str',\
377
	ini.set_str,'ini.set_str',\
378
	ini.get_int,'ini.get_int',\
379
	ini.set_int,'ini.set_int',\
380
	ini.enum_sections,'ini.enum_sections',\
381
	ini.enum_keys,'ini.enum_keys'
382
383
 
384
\;      file.aux.match_wildcard,'file.aux.match_wildcard',\
919 mikedld 385
	file.find_first,'file.find_first',\
717 mikedld 386
	file.find_next,'file.find_next',\
387
	file.find_close,'file.find_close',\
388
	file.open,'file.open',\
389
	file.seek,'file.seek',\
390
	file.write,'file.write',\
391
	file.truncate,'file.truncate',\
392
	file.close,'file.close'
393
394
 
395
	gfx.open	,'gfx.open',\
396
	gfx.close	,'gfx.close',\
397
	gfx.pen.color	,'gfx.pen.color',\
398
	gfx.brush.color ,'gfx.brush.color',\
399
	gfx.pixel	,'gfx.pixel',\
400
	gfx.move.to	,'gfx.move.to',\
401
	gfx.line.to	,'gfx.line.to',\
402
	gfx.line	,'gfx.line',\
403
	gfx.polyline	,'gfx.polyline',\
404
	gfx.polyline.to ,'gfx.polyline.to',\
405
	gfx.fillrect	,'gfx.fillrect',\
406
	gfx.fillrect.ex ,'gfx.fillrect.ex',\
407
	gfx.framerect	,'gfx.framerect',\
408
	gfx.framerect.ex,'gfx.framerect.ex',\
409
	gfx.rectangle	,'gfx.rectangle',\
410
	gfx.rectangle.ex,'gfx.rectangle.ex'
411
412
 
413
414
 
415
416
 
417