Subversion Repositories Kolibri OS

Rev

Rev 1568 | 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'
3014 dunkaist 20
717 mikedld 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
;---  ÄÀÍÍÛÅ ÏÐÎÃÐÀÌÌÛ  ----------------------------------------------
279
;---------------------------------------------------------------------
280
281
 
282
283
 
284
s_sec db 'Panels',0
285
s_key db 'param1',0
286
287
 
288
poly_points dd \
289
  140, 10, \
290
  150, 10, \
291
  150, 20, \
292
  160, 20, \
293
  160, 30, \
294
  170, 30, \
295
  170, 40, \
296
  180, 40, \
297
  180, 50, \
298
  140, 50, \
299
  140, 10
300
301
 
302
303
 
304
@IMPORT:
305
306
 
307
	libini,'libini.obj',\
308
	libio ,'libio.obj',\
309
	libgfx,'libgfx.obj'
310
311
 
312
	ini.get_str,'ini_get_str',\
1102 diamond 313
	ini.set_str,'ini_set_str',\
314
	ini.get_int,'ini_get_int',\
315
	ini.set_int,'ini_set_int',\
316
	ini.enum_sections,'ini_enum_sections',\
317
	ini.enum_keys,'ini_enum_keys'
318
717 mikedld 319
 
320
\;      file.aux.match_wildcard,'file_aux_match_wildcard',\
1102 diamond 321
	file.find_first,'file_find_first',\
322
	file.find_next,'file_find_next',\
323
	file.find_close,'file_find_close',\
324
	file.open,'file_open',\
325
	file.seek,'file_seek',\
326
	file.write,'file_write',\
327
	file.truncate,'file_truncate',\
328
	file.close,'file_close'
329
717 mikedld 330
 
331
	gfx.open	,'gfx_open',\
1102 diamond 332
	gfx.close	,'gfx_close',\
333
	gfx.pen.color	,'gfx_pen_color',\
334
	gfx.brush.color ,'gfx_brush_color',\
1568 diamond 335
	gfx.pixel	,'gfx_pixel',\
1102 diamond 336
	gfx.move.to	,'gfx_move_to',\
337
	gfx.line.to	,'gfx_line_to',\
338
	gfx.line	,'gfx_line',\
339
	gfx.polyline	,'gfx_polyline',\
340
	gfx.polyline.to ,'gfx_polyline_to',\
341
	gfx.fillrect	,'gfx_fillrect',\
342
	gfx.fillrect.ex ,'gfx_fillrect_ex',\
343
	gfx.framerect	,'gfx_framerect',\
344
	gfx.framerect.ex,'gfx_framerect_ex',\
345
	gfx.rectangle	,'gfx_rectangle',\
346
	gfx.rectangle.ex,'gfx_rectangle_ex'
347
717 mikedld 348
 
349
350
 
351
352
 
353