Subversion Repositories Kolibri OS

Rev

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

Rev Author Line No. Line
881 serge 1
 
5093 clevermous 2
881 serge 3
 
4
{
5
  .frame            dd ?
6
  .grab             dd ?
7
  .work_3d_dark      dd ?
6196 leency 8
  .work_3d_light dd ?
9
  .grab_text        dd ?
881 serge 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
   mov eax, dword path
20
   mov ebx, dword data
21
   mov ecx, dword offset
22
   mov edx, dword count
23
24
 
25
   push 0
26
   mov [esp+1], eax
27
   push ebx
28
   push edx
29
   push 0
30
   push ecx
31
   push 0
32
   mov ebx, esp
33
   mov eax, 70
34
   int 0x40
35
   add esp, 28
36
}
37
38
 
39
40
 
41
dd 1
42
dd start
43
dd i_end
44
dd mem
45
dd mem
46
dd 0
47
dd app_path
48
49
 
50
51
 
52
start:
53
           fix_cwd app_path
54
55
 
56
           test eax, eax
57
           jz .fail
58
59
 
60
           mov  ebx,3
61
           mov  ecx,sc
62
           mov  edx,10*4
63
           int 0x40
64
65
 
66
           mov [pix_0], eax
67
           test eax, eax
68
           jz .fail
69
70
 
71
           mov [pix_1], eax
72
           test eax, eax
73
           jz .fail
74
75
 
76
           mov [pix_2], eax
77
78
 
79
80
 
81
              mov ebx, eax
82
              _read_file szfile, 128, ebx, 640*384*4
83
           UnlockPixmap [pix_0]
84
85
 
86
 
87
           call draw_window
88
89
 
90
91
 
92
           mov eax, 23
93
           int 0x40
94
95
 
96
 
97
           jz  .redraw              ;   jump to redraw handler
98
           dec eax                  ;   else if event = 2
99
           jz  .key                 ;   jump to key handler
100
           dec eax
101
           jz  .button
102
103
 
104
105
 
106
           inc eax
107
           cmp eax, 60
108
           jb @F
109
           xor eax, eax
110
@@:
111
           mov [count], eax
112
113
 
114
           mov ebx, 10
115
           div ebx
116
117
 
118
           shl edx, 6
119
120
 
121
           Blit SCR_PIXMAP, 0,0, [pix_2], 0, 0, 64,64
122
123
 
124
125
 
126
           mov al, 17                  ;   get button identifier
127
           int 0x40
128
129
 
130
           jne .wait_event             ;   return if button id != 1
131
.exit:
132
                                       ; restore old screen and cleanup
133
134
 
135
136
 
137
           DestroyPixmap [pix_1]
138
           DestroyPixmap [pix_0]
139
.fail:
140
           or eax, -1                  ;   exit application
141
           int 0x40
142
.key:                                  ; key event handler
143
           mov al, 2                   ;   get key code
144
           int 0x40
145
146
 
147
148
 
149
           mov eax, 12                 ; start drawing
150
           mov ebx, 1
151
           int 0x40
152
153
 
154
           mov  ebx, 200*65536+200     ; (window_cx)*65536+(window_sx)
155
           mov  ecx, 200*65536+100     ; (window_cy)*65536+(window_sy)
156
           mov  edx, [sc.work]         ; work area color
157
           or   edx, 0x33000000        ; & window type 3
158
           mov  edi, title             ; window title
159
           int  0x40
160
161
 
162
           mov  ebx, 2
163
           int  0x40
164
165
 
166
167
 
168
169
 
170
171
 
172
173
 
174
175
 
176
177
 
178
179
 
180
pix_1       rd 1
181
pix_2       rd 1
182
183
 
184
185
 
186
 
187
188
 
189
190
 
191
mem:
192