Subversion Repositories Kolibri OS

Rev

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