Subversion Repositories Kolibri OS

Rev

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

Rev Author Line No. Line
880 serge 1
 
5093 clevermous 2
880 serge 3
 
4
{
5
  .frame            dd ?
6
  .grab             dd ?
7
  .grab_button      dd ?
8
  .grab_button_text dd ?
9
  .grab_text        dd ?
10
  .work             dd ?
11
  .work_button      dd ?
12
  .work_button_text dd ?
13
  .work_text        dd ?
14
  .work_graph       dd ?
15
}
16
17
 
18
19
 
20
dd 1
21
dd start
22
dd i_end
23
dd mem
24
dd mem
25
dd 0
26
dd 0
27
28
 
29
30
 
31
start:
32
           call load_pxlib
33
           test eax, eax
34
           jz .fail
35
36
 
37
38
 
39
           mov ebx, esp
40
           mov ecx, -1
41
           int 0x40
42
43
 
44
           mov eax, 18
45
           mov ebx, 21
46
           int 0x40
47
48
 
49
50
 
51
52
 
53
           mov  ebx,3
54
           mov  ecx,sc
55
           mov  edx,10*4
56
           int 0x40
57
58
 
59
           mov [br_cross], eax
60
61
 
62
           mov [br_dcross], eax
63
64
 
65
           mov [br_horz], eax
66
67
 
68
           mov [br_vert], eax
69
70
 
71
           mov [br_fd], eax
72
73
 
74
           mov [br_bd], eax
75
76
 
77
           call draw_window
78
79
 
80
81
 
82
           mov ebx, 7
83
           int 0x40
84
           cmp eax, [slot]
85
           jne .skip_draw
86
87
 
88
89
 
90
           mov ebx, esp
91
           mov ecx, -1
92
           int 0x40
93
94
 
95
           mov ecx, [esp+0x26]; ywin
96
           add edx, [esp+0x36]
97
           add ecx, [esp+0x3A]
98
99
 
100
           mov ebx, [esp+0x42]  ;height
101
102
 
103
104
 
105
           jle .skip_draw
106
107
 
108
           jle .skip_draw
109
110
 
111
           push eax
112
           push ecx
113
           push edx
114
           call _Draw
115
           add esp, 16
116
117
 
118
119
 
120
           mov eax, 23
121
           int 0x40
122
123
 
124
        ;   int 0x40
125
126
 
127
        ;  js .wait_event
128
129
 
130
           dec eax                     ;   else if event = 2
131
           jz  .key                    ;   jump to key handler
132
           dec eax
133
           jz  .button
134
135
 
136
137
 
138
           mov al, 17                  ;   get button identifier
139
           int 0x40
140
141
 
142
           jne .wait_event             ;   return if button id != 1
143
.exit:
144
                                       ; restore old screen and cleanup
145
.fail:
146
           or eax, -1                  ;   exit application
147
           int 0x40
148
.key:                                  ; key event handler
149
           mov al, 2                   ;   get key code
150
           int 0x40
151
152
 
153
154
 
155
           mov eax, 12                 ; start drawing
156
           mov ebx, 1
157
           int 0x40
158
159
 
160
           mov  ebx, 100*65536+320     ; (window_cx)*65536+(window_sx)
161
           mov  ecx, 100*65536+240     ; (window_cy)*65536+(window_sy)
162
           mov  edx, [sc.work]         ; work area color
163
           or   edx, 0x33000000        ; & window type 3
164
           mov  edi, title             ; window title
165
           int  0x40
166
167
 
168
           mov  ebx, 2
169
           int  0x40
170
171
 
172
173
 
174
PTR   equ
175
176
 
177
        push    ebp
178
	push	edi
179
	push	esi
180
	push	ebx
181
	mov	ebx, 1431655766
182
	sub	esp, 44
183
	mov	esi, DWORD PTR [esp+72]
184
	mov	ecx, DWORD PTR [esp+76]
185
	mov	DWORD PTR [esp+24], -16777216
186
	mov	DWORD PTR [esp], -1
187
	lea	edi, [esi-40]
188
	mov	eax, edi
189
	imul	ebx
190
	sar	edi, 31
191
	lea	eax, [ecx-30]
192
	sub	ecx, 10
193
	mov	ebp, edx
194
	sub	ebp, edi
195
	mov	edi, eax
196
	shr	edi, 31
197
	add	edi, eax
198
	lea	edx, [esi-20]
199
	lea	eax, [ebp+ebp*2]
200
	sub	edx, eax
201
	mov	esi, edx
202
	shr	esi, 31
203
	add	esi, edx
204
        sar     esi, 1
205
	add	esi, DWORD PTR [esp+64]
206
        sar     edi, 1
207
	lea	eax, [ebp+10+esi]
208
	mov	DWORD PTR [esp+32], eax
209
	lea	eax, [edi+edi]
210
	sub	ecx, eax
211
	mov	ebx, ecx
212
	shr	ebx, 31
213
	add	ebx, ecx
214
        sar     ebx, 1
215
	add	ebx, DWORD PTR [esp+68]
216
	lea	edx, [esi+20+ebp*2]
217
	mov	DWORD PTR [esp+36], edx
218
	lea	eax, [ebx+10+edi]
219
	mov	DWORD PTR [esp+40], eax
220
221
 
222
223
 
224
        FillRect -1, edx, ebx, ebp, edi, [br_cross], 0xFF000000
225
226
 
227
        FillRect -1, eax, ebx, ebp, edi, [br_horz],0xFF000000
228
229
 
230
        FillRect -1, esi, edx, ebp, edi, [br_bd], 0xFF000000
231
232
 
233
	mov	eax, DWORD PTR [esp+40]
234
        FillRect -1, edx, eax, ebp, edi, [br_dcross], 0xFF000000
235
236
 
237
	mov	eax, DWORD PTR [esp+40]
238
        FillRect -1, edx, eax, ebp, edi, [br_vert], 0xFF000000
239
240
 
241
242
 
243
 
244
	pop	ebx
245
	pop	esi
246
	pop	edi
247
	pop	ebp
248
        ret
249
250
 
251
252
 
253
 
254
255
 
256
257
 
258
259
 
260
261
 
262
263
 
264
br_bd        rd 1
265
br_cross     rd 1
266
br_dcross    rd 1
267
br_horz      rd 1
268
br_vert      rd 1
269
270
 
271
272
 
273
274
 
275
 
276
mem:
277