Subversion Repositories Kolibri OS

Rev

Go to most recent revision | Details | Last modification | View Log | RSS feed

Rev Author Line No. Line
1951 mario79 1
;---------------------------------------------------------------------
2
  kabout:
3
	test dword [status],4
4
	jnz	 still
5
	or	 dword [status],4
6
 
7
	call	get_memory_for_tread_stack
8
	mov	[thread_stack_3],eax
9
	mcall	51,1,thread3	;,thread_stack_3
10
	jmp	still
11
;---------------------------------------------------------------------
12
thread3:			  ; start of bgrd thread
13
    mcall 9, procinfo_threads, -1
14
    mov   eax,[ebx+30]
15
    mov   [PID3],eax
16
	mcall 40, 0x7
17
.red:
18
     call .draw_window
19
 
20
.still:
21
 
22
    mov  eax,10 		; wait here for event
23
    mcall
24
 
25
    cmp  eax,1			; redraw request ?
26
    je	 .red
27
    cmp  eax,2			; key in buffer ?
28
    je	 .close   ;.key
29
    cmp  eax,3			; button in buffer ?
30
    je	 .button
31
 
32
    jmp  .still
33
 
34
;  .key:
35
;    mcall
36
;    cmp  ah,27
37
;    je	 .close
38
;    jmp  .still
39
 
40
 
41
.button:			 ; button
42
    mov  eax,17 		; get id
43
    mcall
44
 
45
    cmp  ah,1			; button id=1 ?
46
	je   .close
47
	cmp  ah,2
48
    jne  .still   ;noclose3
49
.close:
50
;    btr dword [status],3
51
;    bts dword [status],2
52
	xor  dword [status],4
53
	xor   eax,eax
54
	mov   [PID3],eax
55
	mcall	68,13,[thread_stack_3]
56
	mov  eax,-1 	; close this program
57
	mcall
58
;  .noclose:
59
;     jmp  still3
60
 
61
 
62
 
63
 
64
;   *********************************************
65
;   *******  WINDOW DEFINITIONS AND DRAW ********
66
;   *********************************************
67
 
68
 
69
.draw_window:
70
 
71
 
72
    mov  eax,12 		   ; function 12:tell os about windowdraw
73
    mov  ebx,1			   ; 1, start of draw
74
    mcall
75
 
76
				   ; DRAW WINDOW
77
    xor  eax,eax		   ; function 0 : define and draw window
78
    mov  ebx,100*65536+300	   ; [x start] *65536 + [x size]
79
    mov  ecx,100*65536+240	   ; [y start] *65536 + [y size]
80
    mov  edx,0x03eeeeee 	   ; color of work area RRGGBB,8->color gl
81
    mcall
82
 
83
    mov  ebx,120*65536+40
84
    mov  ecx,210*65536+20
85
    mov  edx,2
86
    mov  esi,0xdddddd
87
    mcall 8
88
 
89
	pusha
90
    mcall 4,<20,30>,0x80000000,Authors_text.1
91
	mcall  ,<30,45>, ,Authors_text.2
92
 
93
	mcall  ,<30,60>, ,Authors_text.3
94
	mcall  ,<60,70>, ,Authors_text.4
95
	mcall  ,<60,80>, ,Authors_text.5
96
	mcall  ,<60,90>, ,Authors_text.6
97
	mcall  ,<60,100>, ,Authors_text.7
98
 
99
	mcall  ,<30,115>, ,Authors_text.8
100
	mcall  ,<60,125>, ,Authors_text.9
101
	mcall  ,<60,135>, ,Authors_text.10
102
 
103
	mcall  ,<30,150>, ,Authors_text.11
104
	mcall  ,<60,160>, ,Authors_text.12
105
 
106
	mcall  ,<30,175>, ,Authors_text.13
107
	mcall  ,<60,185>, ,Authors_text.14
108
	popa
109
 
110
    add  ebx,15 shl 16
111
	shr  ecx,16
112
	mov  bx,cx
113
	add  ebx,6
114
 
115
	mov  ecx,0
116
    mov  edx, ok_btn
117
    mov  esi, ok_btn.size ;2
118
    mcall 4
119
 
120
				   ; WINDOW LABEL
121
    mcall 71,1, labelt3
122
;    mcall 47,0x80000,[PID3],<200, 5>,0xffffff
123
    mov  eax,12 		   ; function 12:tell os about windowdraw
124
    mov  ebx,2			   ; 2, end of draw
125
    mcall
126
 
127
    ret
128
;---------------------------------------------------------------------