Subversion Repositories Kolibri OS

Rev

Rev 2065 | Details | Compare with Previous | Last modification | View Log | RSS feed

Rev Author Line No. Line
824 mikedld 1
diff16 'tp-draw.asm',0,$
2
 
178 heavyiron 3
;-----------------------------------------------------------------------------
617 mikedld 4
proc drawwindow ;///// DRAW WINDOW ///////////////////////////////////////////
178 heavyiron 5
;-----------------------------------------------------------------------------
6
 
7
	cmp	[just_from_popup],1
8
	jne	@f
9
	ret
10
    @@:
11
 
12
	mcall	48,3,sc,sizeof.system_colors
13
	call	calc_3d_colors
14
 
617 mikedld 15
	;mcall   12,1
16
	invoke	gfx.open,TRUE
17
	mov	[ctx],eax
178 heavyiron 18
 
617 mikedld 19
	;m2m     [sc.work],dword[color_tbl.back]
178 heavyiron 20
 
21
	mov	edx,[sc.work]
303 mikedld 22
	add	edx,0x73000000
178 heavyiron 23
	mov	ebx,[mainwnd_pos.x-2]
24
	mov	bx,word[mainwnd_pos.w]
25
	mov	ecx,[mainwnd_pos.y-2]
26
	mov	cx,word[mainwnd_pos.h]
27
	mcall	0,,,,,s_title
28
 
29
	mcall	9,p_info,-1
2065 mario79 30
 
31
	mov	eax,[p_info+70] ;status of window
32
	test	eax,100b
33
	jne	.exit.2
34
 
178 heavyiron 35
	mov	esi,p_info.box.left
36
	mov	edi,mainwnd_pos
37
	mov	ecx,4
38
	cld
39
	rep	movsd
40
 
5838 pathoswith 41
	mov	eax,[lineHeight]
42
	cmp	[p_info.client_box.height],eax
178 heavyiron 43
	jl	.exit.2
44
 
259 mikedld 45
	mov	[tab_bar.Bounds.Left],0
46
	mov	[tab_bar.Bounds.Top],ATOPH
47
	mov	eax,[p_info.client_box.width]
48
	mov	[tab_bar.Bounds.Right],eax
49
	mov	eax,[p_info.client_box.height]
50
	sub	eax,[bot_dlg_height]
51
	add	eax,-STATH-1
52
	mov	[tab_bar.Bounds.Bottom],eax
53
 
54
	call	align_editor_in_tab
55
 
178 heavyiron 56
	mov	[top_ofs],ATOPH;+1
57
 
259 mikedld 58
	mov	eax,[p_info.client_box.height]
59
	add	eax,-STATH+1;*3-2-2
178 heavyiron 60
	sub	eax,[bot_dlg_height]
61
	mov	[bot_ofs],eax
62
 
63
	call	draw_bottom_dialog
64
 
65
	inc	[top_ofs]
66
 
67
	call	draw_main_menu
68
 
69
	jmp	.exit
70
 
71
  .no_draw:
72
	mov	[top_ofs],2
73
	mov	eax,[p_info.client_box.height]
74
	inc	eax
75
	mov	[bot_ofs],eax
76
	sub	eax,2
77
	push	eax
78
	add	eax,-2-SCRLW
79
	cdq
5838 pathoswith 80
	mov	ebx,[lineHeight]
178 heavyiron 81
	idiv	ebx
82
	mov	[lines.scr],eax
83
	pop	eax
84
 
85
	mov	ebx,[p_info.client_box.height]
86
	sub	ebx,SCRLW*3+AMINS+2
87
	jns	@f
88
 
89
	inc	[do_not_draw]
90
 
91
	dec	eax
92
	cdq
5838 pathoswith 93
	mov	ebx,[lineHeight]
178 heavyiron 94
	idiv	ebx
95
	mov	[lines.scr],eax
96
 
97
	mov	eax,[p_info.client_box.width]
98
	cdq
5838 pathoswith 99
	mov	ebx,[charWidth]
178 heavyiron 100
	idiv	ebx
101
	mov	[columns.scr],eax
102
    @@:
103
 
104
  .exit:
259 mikedld 105
	call	draw_editor
106
	call	draw_tabctl
178 heavyiron 107
  .exit.2:
617 mikedld 108
	;mcall   12,2
109
	invoke	gfx.close,[ctx]
178 heavyiron 110
	ret
617 mikedld 111
endp
178 heavyiron 112
 
113
;-----------------------------------------------------------------------------
617 mikedld 114
proc draw_bottom_dialog ;/////////////////////////////////////////////////////
178 heavyiron 115
;-----------------------------------------------------------------------------
116
	cmp	[bot_dlg_height],0
117
	je	.exit
118
	pushad
617 mikedld 119
	invoke	gfx.pen.color,[ctx],[cl_3d_inset]
178 heavyiron 120
	mov	ecx,[bot_ofs]
121
	dec	ecx
617 mikedld 122
	invoke	gfx.line,[ctx],0,ecx,[p_info.client_box.width],ecx
123
	invoke	gfx.brush.color,[ctx],[cl_3d_normal]
124
	inc	ecx
125
	mov	eax,ecx
126
	add	eax,[bot_dlg_height]
127
	invoke	gfx.fillrect,[ctx],0,ecx,[p_info.client_box.width],eax
128
	;mov     ebx,[p_info.client_box.width]
129
	;mov     ecx,[bot_ofs]
130
	;dec     ecx
131
	;push    cx
132
	;shl     ecx,16
133
	;pop     cx
134
	;mcall   38,,,[cl_3d_inset]
135
	;mov     ecx,[bot_ofs-2]
136
	;mov     cx,word[bot_dlg_height]
137
	;dec     ecx
138
	;mov     ebx,[p_info.client_box.width]
139
	;inc     ebx
140
	;mcall   13,,,[cl_3d_normal]
178 heavyiron 141
	mov	al,1
142
	call	[bot_dlg_handler]
143
	popad
144
 
145
  .exit:
146
	ret
617 mikedld 147
endp
178 heavyiron 148
 
149
mi_sel	 dd ?
150
mi_cur	 dd -1
151
 
152
;-----------------------------------------------------------------------------
617 mikedld 153
proc draw_main_menu ;/////////////////////////////////////////////////////////
178 heavyiron 154
;-----------------------------------------------------------------------------
155
	mov	ebx,[p_info.client_box.width]
156
	inc	ebx
157
	mcall	13,,ATOPH-1,[cl_3d_normal]
158
 
280 mikedld 159
	mcall	38,[p_info.client_box.width],,[cl_3d_inset]
259 mikedld 160
 
178 heavyiron 161
	mov	edx,main_menu
280 mikedld 162
	mov	ebx,9*65536+ATOPH/2-3;4
178 heavyiron 163
	mov	[mi_sel],0
164
	mov	edi,[mi_cur]
165
    @@: inc	[mi_sel]
166
	cmp	[mi_sel],main_menu.cnt_item
167
	ja	.exit
280 mikedld 168
	mov	ecx,[sc.work_text]
178 heavyiron 169
	cmp	edi,[mi_sel]
170
	jne	.lp1
171
	pushad
172
	push	edx
280 mikedld 173
	mov	ecx,[edx+4]
174
	add	ecx,2*65536-2
297 mikedld 175
	mcall	13,[edx+0],,[sc.work]
178 heavyiron 176
	mov	edx,[esp]
280 mikedld 177
	mov	cx,[edx+6]
178
	add	ecx,-1*65536+1
179
	add	bx,[edx+2]
180
	mcall	38,,,[cl_3d_inset]
181
 
182
	mov	edx,[esp]
183
	add	cx,[edx+4]
184
	add	cx,-2
178 heavyiron 185
	mov	bx,[edx+2]
297 mikedld 186
	mcall	,,,[cl_3d_inset]
178 heavyiron 187
	pop	edx
188
	movzx	eax,word[edx]
189
	add	ebx,eax
190
	shl	eax,16
191
	add	ebx,eax
192
	mcall	38,,,[cl_3d_inset]
193
	popad
297 mikedld 194
	mov	ecx,[color_tbl.text]
178 heavyiron 195
  .lp1: add	edx,8+1
196
	movzx	esi,byte[edx-1]
197
	mcall	4
198
	add	edx,esi
199
	add	esi,2
200
	imul	esi,6*65536
201
	add	ebx,esi
202
	jmp	@b
203
 
204
  .exit:
629 mikedld 205
	mov	ebx,[mainwnd_pos.w]
206
	add	ebx,-10-(ATOPH-6)-3
207
	push	ebx 2 (ATOPH-6) (ATOPH-6)
208
	call	draw_3d_panel
209
	shl	ebx,16
210
	add	ebx,ATOPH-6
211
	mcall	8,,<2,ATOPH-6>,<0x4000,2>
212
	and	ebx,0xFFFF0000
213
	add	ebx,(ATOPH-8)/2*65536+(ATOPH-8)/2
214
	mcall	4,,[sc.work_text],.cross,1
595 Rus 215
 
178 heavyiron 216
	ret
595 Rus 217
 
629 mikedld 218
.cross db 'x'
617 mikedld 219
endp
178 heavyiron 220
 
221
;-----------------------------------------------------------------------------
617 mikedld 222
proc draw_statusbar ;///// DRAW POSITION, MODIFIED STATE, HINT ///////////////
178 heavyiron 223
;-----------------------------------------------------------------------------
224
	cmp	[do_not_draw],1  ; return if drawing is not permitted
225
	jae	.exit
226
	pusha
227
 
2065 mario79 228
       mcall   9,p_info,-1
229
 
230
	mov	eax,[p_info+70] ;status of window
231
	test	eax,100b
232
	jne	.exit_1
233
 
259 mikedld 234
	mov	ecx,[p_info.client_box.height-2]
235
	mov	cx,word[p_info.client_box.height]
236
	sub	ecx,STATH*65536+STATH
280 mikedld 237
	mcall	38,[p_info.client_box.width],,[cl_3d_inset]
259 mikedld 238
 
178 heavyiron 239
;       mcall   9,p_info,-1
240
 
241
	mov	ecx,[p_info.client_box.height-2]
242
	mov	cx,word[p_info.client_box.height]
243
	sub	ecx,STATH*65536
244
	mcall	38,<6*13,6*13>,,[cl_3d_inset]
245
 
246
	pushad
259 mikedld 247
	add	ecx,1*65536
248
	mov	cx,STATH
178 heavyiron 249
	mcall	13,<0,6*13>,,[cl_3d_normal]
250
	mcall	,<6*13+1,6*(s_modified.size+2)-1>
251
	mov	ebx,(6*(s_modified.size+15)+1)*65536
252
	mov	bx,word[p_info.client_box.width]
253
	sub	bx,6*(s_modified.size+15)
254
	mcall
255
	popad
256
 
257
	add	ebx,6*(s_modified.size+2)*65536+6*(s_modified.size+2)
258
	mcall
259
 
260
	and	ecx,0x0000FFFF
261
	push	ecx
262
 
297 mikedld 263
	mov	eax,[cur_editor.Caret.Y]
178 heavyiron 264
	inc	eax
265
	mov	ecx,10
297 mikedld 266
	mov	edi,p_info+0x100
178 heavyiron 267
	cld
268
	call	uint2str
269
	mov	al,','
270
	stosb
297 mikedld 271
	mov	eax,[cur_editor.Caret.X]
178 heavyiron 272
	inc	eax
273
	call	uint2str
274
 
275
	pop	ebx
276
 
277
	lea	esi,[edi-p_info-0x100]
278
	lea	edi,[esi*3]
279
	shl	edi,16
280
 
281
	add	ebx,(1+6*6+3)*65536-STATH/2-3
282
	sub	ebx,edi
283
	mcall	4,,[sc.work_text],p_info+0x100
284
 
297 mikedld 285
	cmp	[cur_editor.Modified],0
178 heavyiron 286
	je	@f
287
	and	ebx,0x0000FFFF
288
	add	ebx,(1+12*6+12+1)*65536
289
	mcall	,,,s_modified,s_modified.size
290
 
291
    @@: cmp	[s_status],0
292
	je	@f
293
	and	ebx,0x0000FFFF
294
	add	ebx,6*(s_modified.size+16)*65536
295
	or	ecx, 80000000h
296
	mcall	,,,[s_status]
2065 mario79 297
.exit_1:
178 heavyiron 298
    @@: popa
299
 
300
  .exit:
301
	ret
617 mikedld 302
endp
178 heavyiron 303
 
617 mikedld 304
proc draw_fillrect ; ebx,ecx,edx
297 mikedld 305
	; ebx = 
306
	; ecx = 
307
	push	ebx ecx edx
308
	call	draw_framerect
309
	add	ebx,1*65536-2
310
	add	ecx,1*65536-2
311
	mcall	13,,,esi
312
	pop	edx ecx ebx
313
	ret
617 mikedld 314
endp
297 mikedld 315
 
617 mikedld 316
proc draw_framerect ; ebx,ecx,edx
297 mikedld 317
	; ebx = 
318
	; ecx = 
178 heavyiron 319
	push	ebx ecx
320
 
297 mikedld 321
	add	bx,[esp+6]	 ; ebx = 
322
	mov	cx,[esp+2]	 ; ecx = 
178 heavyiron 323
	dec	ebx
259 mikedld 324
	mcall	38
297 mikedld 325
	add	cx,[esp]	 ; ecx = 
178 heavyiron 326
	rol	ecx,16
297 mikedld 327
	add	cx,[esp]	 ; ecx = 
178 heavyiron 328
	sub	ecx,0x00010001
329
	mcall
330
 
297 mikedld 331
	mov	ebx,[esp+4]	 ; ebx = 
332
	mov	ecx,[esp]	 ; ecx = 
333
	mov	bx,[esp+6]	 ; ebx = 
178 heavyiron 334
	add	cx,[esp+2]
335
	dec	ecx
336
	mcall
337
	add	bx,[esp+4]
338
	rol	ebx,16
339
	add	bx,[esp+4]
340
	sub	ebx,0x00010001
341
	mcall
342
 
259 mikedld 343
	pop	ecx ebx
178 heavyiron 344
	ret
617 mikedld 345
endp
267 mikedld 346
 
617 mikedld 347
proc draw_check
280 mikedld 348
	push	bx
349
	shl	ebx,16
350
	pop	bx
351
	add	ebx,0x00010000
352
	push	cx
353
	shl	ecx,16
354
	pop	cx
355
	add	ecx,0x00020001
356
	mcall	38
357
	add	ecx,0x00010001
358
	mcall
359
	add	ebx,4
360
	sub	ecx,2
361
	mcall
362
	sub	ecx,0x00010001
363
	mcall
364
	ret
617 mikedld 365
endp
280 mikedld 366
 
617 mikedld 367
proc calc_middle
267 mikedld 368
	shr	eax,1
369
	shr	ebx,1
370
	and	eax,0x007F7F7F
371
	and	ebx,0x007F7F7F
372
	add	eax,ebx
373
	ret
617 mikedld 374
endp
267 mikedld 375
 
617 mikedld 376
proc calc_3d_colors
267 mikedld 377
	pushad
378
	m2m	[cl_3d_normal],[sc.work]
379
	m2m	[cl_3d_inset],[sc.work_graph]
380
	push	[cl_3d_normal]
381
	add	byte[esp],48
382
	jnc	@f
383
	mov	byte[esp],255
384
    @@: add	byte[esp+1],48
385
	jnc	@f
386
	mov	byte[esp+1],255
387
    @@: add	byte[esp+2],48
388
	jnc	@f
389
	mov	byte[esp+2],255
390
    @@: pop	[cl_3d_outset]
391
	mov	eax,[cl_3d_inset]
392
	mov	ebx,[cl_3d_outset]
393
	call	calc_middle
280 mikedld 394
	mov	ebx,[cl_3d_normal]
395
	call	calc_middle
267 mikedld 396
	mov	[cl_3d_pushed],eax
397
	mov	eax,[cl_3d_normal]
398
	mov	ebx,[sc.work_text]
399
	call	calc_middle
400
	mov	[cl_3d_grayed],eax
401
	popad
402
	ret
617 mikedld 403
endp
267 mikedld 404
 
617 mikedld 405
proc draw_3d_panel ; x,y,w,h
267 mikedld 406
	push	eax ebx ecx edx
407
	cmp	dword[esp+16+8],4
408
	jl	.exit
409
	cmp	dword[esp+16+4],4
410
	jl	.exit
411
	mov	ebx,[esp+16+16-2]
412
	mov	bx,[esp+16+8]
413
	inc	ebx
414
	mov	ecx,[esp+16+12-2]
415
	mov	cx,[esp+16+4]
416
	inc	ecx
417
	mcall	13,,,[cl_3d_normal]
418
	dec	ebx
419
	add	bx,[esp+16+16]
420
	mov	cx,[esp+16+12]
421
	mcall	38,,,[cl_3d_inset]
422
	add	ecx,[esp+16+4-2]
423
	add	cx,[esp+16+4]
424
	mcall
425
	mov	bx,[esp+16+16]
426
	mov	ecx,[esp+16+12-2]
427
	mov	cx,[esp+16+4]
428
	add	cx,[esp+16+12]
429
	mcall
430
	add	ebx,[esp+16+8-2]
431
	add	bx,[esp+16+8]
432
	mcall
433
	mov	ebx,[esp+16+16-2]
434
	mov	bx,[esp+16+8]
435
	add	bx,[esp+16+16]
436
	add	ebx,1*65536-1
437
	mov	ecx,[esp+16+12-2]
438
	mov	cx,[esp+16+12]
439
	add	ecx,0x00010001
440
	mcall	,,,[cl_3d_outset]
441
	mov	bx,[esp+16+16]
442
	inc	ebx
443
	mov	ecx,[esp+16+12-2]
444
	mov	cx,[esp+16+4]
445
	add	cx,[esp+16+12]
446
	add	ecx,2*65536-1
447
	mcall
448
  .exit:
449
	pop	edx ecx ebx eax
450
	ret	4*4
617 mikedld 451
endp