Subversion Repositories Kolibri OS

Rev

Rev 2000 | Rev 2188 | Go to most recent revision | Details | Compare with Previous | Last modification | View Log | RSS feed

Rev Author Line No. Line
1951 mario79 1
;---------------------------------------------------------------------
2
k_background:
3
	test	dword [status],8
4
	jnz	still
5
	or	dword [status],8
6
 
2000 mario79 7
	call	get_memory_for_thread_stack
1951 mario79 8
	mov	[thread_stack_4],eax
9
	mcall	51,1,thread4	;, thread_stack_4
10
	jmp	still
11
;---------------------------------------------------------------------
12
thread4:	; start of bgrd thread
13
	mcall	9, procinfo_threads, -1
14
	mov	eax,[ebx+30]
15
	mov	[PID4],eax
16
	mcall	40, 0x27
17
.red:
18
	call	.draw_window
19
.still:
20
	mov	eax,10	; wait here for event
21
	mcall
22
 
23
	cmp	eax,1	; redraw request ?
24
	je	.red
2000 mario79 25
 
1951 mario79 26
	cmp	eax,2	; key in buffer ?
27
	je	.key
2000 mario79 28
 
1951 mario79 29
	cmp	eax,3	; button in buffer ?
30
	je	.button
2000 mario79 31
 
1951 mario79 32
	cmp	eax,6	; mouse in buffer ?
33
	je	.mouse
2000 mario79 34
 
1951 mario79 35
	jmp	.still
2000 mario79 36
;---------------------------------------------------------------------
1951 mario79 37
.mouse:
38
	push	dword option_boxes_bcgr
39
	call	[option_box_mouse]
40
 
41
	cmp	[option_group1],op1
42
	jne	@f
43
	mov	[bgrmode],dword 1
44
	jmp	.still
2000 mario79 45
;---------------------------------------------------------------------
1951 mario79 46
@@:
2163 mario79 47
	cmp	[option_group1],op2
48
	jne	@f
1951 mario79 49
	mov	[bgrmode],dword 2
50
	jmp	.still
2000 mario79 51
;---------------------------------------------------------------------
2163 mario79 52
@@:
53
	cmp	[option_group1],op3
54
	jne	@f
55
	mov	[bgrmode],dword 3
56
	jmp	.still
57
;---------------------------------------------------------------------
58
@@:
59
;	cmp	[option_group1],op4
60
;	jne	.still
61
	mov	[bgrmode],dword 4
62
	jmp	.still
63
;---------------------------------------------------------------------
1951 mario79 64
.key:
65
	mcall
66
	cmp	ah,27
67
	je	.close
2000 mario79 68
 
1951 mario79 69
	cmp	ah,13
70
	je	.kok
2000 mario79 71
 
1951 mario79 72
	cmp	ah,178 ;up
73
	jne	.nofup
2000 mario79 74
 
1951 mario79 75
	cmp	dword [bgrmode],1
76
	je	.fdn
77
.fup:
78
	dec	dword [bgrmode]
79
	jmp	.flagcont
2000 mario79 80
;---------------------------------------------------------------------
1951 mario79 81
.nofup:
82
	cmp	ah,177 ;down
83
	jne	.still
2000 mario79 84
 
85
	cmp	dword [bgrmode],4
1951 mario79 86
	je	.fup
87
.fdn:
88
	inc	dword [bgrmode]
89
.flagcont:
90
	cmp	[bgrmode],dword 1
91
	jne	@f
2000 mario79 92
 
1951 mario79 93
	mov	[option_group1],op1
94
	call	.draw_opt_boxes
95
	jmp	.still
2000 mario79 96
;---------------------------------------------------------------------
1951 mario79 97
@@:
2000 mario79 98
	cmp	[bgrmode],dword 2
99
	jne	@f
100
 
1951 mario79 101
	mov	[option_group1],op2
102
	call	.draw_opt_boxes
103
	jmp	.still
2000 mario79 104
;---------------------------------------------------------------------
105
@@:
106
	cmp	[bgrmode],dword 3
107
	jne	@f
108
 
109
	mov	[option_group1],op3
110
	call	.draw_opt_boxes
111
	jmp	.still
112
;---------------------------------------------------------------------
113
@@:
114
	mov	[option_group1],op4
115
	call	.draw_opt_boxes
116
	jmp	.still
117
;---------------------------------------------------------------------
1951 mario79 118
.button:		; button
119
	mov	eax,17	; get id
120
	mcall
121
 
122
	cmp	ah,1	; button id=1 ?
123
	jne	.noclose
124
.close:
125
	xor	dword [status],8
126
	xor	eax,eax
127
	mov	[PID4],eax
128
 
129
	mcall	68,13,[thread_stack_4]
130
	mov	eax,-1	; close this program
131
	mcall
132
.noclose:
133
.kok:
134
	call	background
135
	jmp	.close
2000 mario79 136
;---------------------------------------------------------------------
1951 mario79 137
;	*********************************************
138
;	*******	WINDOW DEFINITIONS AND DRAW ********
139
;	*********************************************
140
.draw_window:
141
	mcall	12,1
2000 mario79 142
	xor	eax,eax
143
	xor	esi,esi
144
	mcall	,<100,200>,<100,200>,0x13909090,,labelt4
145
	mcall	8,<70,40>,<110,20>,4,0xdddddd
146
	mcall	4,<46,28>,0xffffff,bgrdtext,bgrdtext.size
147
	add	ebx,40*65536+88
148
	xor	ecx,ecx
149
	mcall	,,,ok_btn,ok_btn.size
1951 mario79 150
	call	.draw_opt_boxes
2000 mario79 151
;	mcall	47,0x80000,[PID4],<200, 5>,0xffffff
1951 mario79 152
	mcall	12,2
153
	ret
154
;---------------------------------------------------------------------
155
.draw_opt_boxes:
156
	push	dword option_boxes_bcgr
157
	call	[option_box_draw]
158
	ret