Subversion Repositories Kolibri OS

Rev

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