Subversion Repositories Kolibri OS

Rev

Rev 109 | Go to most recent revision | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 109 Rev 205
Line -... Line 1...
-
 
1
;--- ¤à㣨¥ ¬ ªà®áë ---
-
 
2
include 'editbox.inc'
-
 
3
include 'txtbut.inc'
-
 
4
;include 'gp.inc'
-
 
5
;include 'label.inc'
-
 
6
;include 'checkbox.inc'
-
 
7
;include 'file_sys.inc'
1
; new application structure
8
;include 'textwork.inc'
-
 
9
;include 'ini.inc'
-
 
10
 
-
 
11
include 'lang.inc'
-
 
12
 
-
 
13
;--- § £®«®¢®ª ---
2
macro meos_app_start
14
macro meos_header par_buf,cur_dir_buf
3
 {
15
{
4
  use32
16
        use32
5
  org 0x0
17
        org     0x0
Line 6... Line 18...
6
 
18
 
7
  db 'MENUET01'
19
        db      'MENUET01'
8
  dd 0x01
20
        dd      0x01
9
  dd __start
21
        dd      __app_start
10
  dd __end
22
        dd      __app_end
11
  dd __memory
-
 
12
  dd __stack
-
 
13
 
23
        dd      __app_end
14
  if used __params & ~defined __params
24
        dd      __app_end
15
    dd __params
-
 
16
  else
25
if  eq <>
-
 
26
        dd      0x0
-
 
27
else
17
    dd 0x0
28
        dd      par_buf
18
  end if
-
 
-
 
29
end if
19
 
30
if  eq <>
-
 
31
        dd      0x0
-
 
32
else
-
 
33
        dd      cur_dir_buf
20
  dd 0x0
34
end if
21
 }
-
 
22
MEOS_APP_START fix meos_app_start
-
 
23
 
-
 
24
macro code
-
 
25
 {
-
 
26
  __start:
-
 
27
 }
-
 
Line -... Line 35...
-
 
35
}
28
CODE fix code
36
 
29
 
37
;--- ®¯à¥¤¥«¨âì â®çªã ¢å®¤  ---
30
macro data
38
macro app_start
31
 {
39
{
32
  __data:
-
 
Line -... Line 40...
-
 
40
__app_start:
33
 }
41
}
34
DATA fix data
42
 
35
 
43
;--- ®¯à¥¤¥«¨âì ª®­¥æ ¯à¨«®¦¥­¨ï ¨ à §¬¥à á⥪  ---
36
macro udata
-
 
37
 {
-
 
38
  if used __params & ~defined __params
-
 
39
    __params:
44
macro app_end stack_size
40
      db 0
45
{
41
    __end:
46
if  eq <>
42
      rb 255
47
        rb      1024
43
  else
48
else
44
    __end:
49
        rb      stack_size
45
  end if
-
 
Line -... Line 50...
-
 
50
end if
46
  __udata:
51
__app_end:
47
 }
52
}
48
UDATA fix udata
-
 
49
 
53
 
50
macro meos_app_end
54
;--- § ¢¥àè¨âì ⥪ã騩 ¯®â®ª ---
51
 {
55
macro app_close
52
  align 32
56
{
53
  rb 2048
-
 
54
  __stack:
-
 
Line 55... Line 57...
55
  __memory:
57
        xor     eax,eax
56
 }
58
        dec     eax
57
MEOS_APP_END fix meos_app_end
59
        int     0x40
58
 
-
 
59
 
-
 
60
; macro for defining multiline text data
-
 
61
struc mstr [sstring]
60
}
62
 {
61
 
63
  forward
-
 
64
    local ssize
-
 
65
    virtual at 0
-
 
66
      db sstring
-
 
67
      ssize = $
-
 
68
    end virtual
62
;--- ¯®«ãç¨âì ª®¤ ­ ¦ â®© ª« ¢¨è¨ ---
Line 69... Line -...
69
    dd ssize
-
 
70
    db sstring
-
 
71
  common
63
macro get_key
72
    dd -1
-
 
73
 }
64
{
74
 
-
 
75
 
-
 
76
; strings
-
 
77
macro sz name,[data] {       ; from MFAR [mike.dld]
-
 
78
  common
-
 
79
   if used name
-
 
80
    label name
65
        mov     eax,2
81
   end if
66
        int     0x40
82
  forward
67
}
83
   if used name
-
 
84
    db data
68
 
Line 85... Line 69...
85
   end if
69
;--- ¯®«ãç¨âì ª®¤ ­ ¦ â®© ª­®¯ª¨ ---
86
  common
-
 
87
   if used name
70
macro get_pressed_button
88
    .size = $-name
-
 
89
   end if
-
 
90
}
71
{
91
 
72
        mov     eax,17
92
macro lsz name,[lng,data] {  ; from MFAR [mike.dld]
73
        int     0x40
93
  common
-
 
94
   if used name
-
 
95
    label name
74
}
96
   end if
75
 
97
  forward
-
 
98
   if (used name)&(lang eq lng)
76
;--- á®®¡é¨âì á¨á⥬¥ ® ­ ç «¥ ¯¥à¥à¨á®¢ª¨ ®ª­  ---
Line -... Line 77...
-
 
77
macro start_draw_window
-
 
78
{
-
 
79
        mov     eax,12
-
 
80
        xor     ebx,ebx
-
 
81
        inc     ebx
-
 
82
        int     0x40
-
 
83
}
Line -... Line 84...
-
 
84
 
-
 
85
;--- á®®¡é¨âì á¨á⥬¥ ® § ¢¥à襭¨¨ ¯¥à¥à¨á®¢ª¨ ®ª­  ---
-
 
86
macro stop_draw_window
-
 
87
{
-
 
88
        mov     eax,12
-
 
89
        mov     ebx,2
-
 
90
        int     0x40
Line 99... Line 91...
99
    db data
91
}
100
   end if
92
 
101
  common
93
;--- ãáâ ­®¢¨âì ¬ áªã ®¦¨¤ ¥¬ëå ᮡë⨩ ---
102
   if used name
94
macro set_events_mask mask
103
    .size = $-name
95
{
104
   end if
-
 
105
}
96
        mov     eax,40
106
 
97
        mov     ebx,mask
107
 
98
        int     0x40
108
 
99
}
109
; easy system call macro
100
 
110
macro mpack dest, hsrc, lsrc
-
 
111
{
-
 
112
  if (hsrc eqtype 0) & (lsrc eqtype 0)
-
 
113
    mov dest, (hsrc) shl 16 + lsrc
101
;--- ¯®«ãç¨âì ¨­ä®à¬ æ¨î ® ¯à®æ¥áᥠ---
-
 
102
macro get_procinfo proc_inf_buf,slot_num
114
  else
103
{
Line 115... Line 104...
115
    if (hsrc eqtype 0) & (~lsrc eqtype 0)
104
        mov     eax,9
-
 
105
        mov     ebx,proc_inf_buf
116
      mov dest, (hsrc) shl 16
106
if  eq <>
117
      add dest, lsrc
107
        xor     ecx,ecx
118
    else
108
        dec     ecx
119
      mov dest, hsrc
109
else
120
      shl dest, 16
110
        mov     ecx,slot_num
121
      add dest, lsrc
111
end if
Line 122... Line -...
122
    end if
-
 
123
  end if
112
        int     0x40
124
}
113
}
125
 
114
 
126
macro __mov reg,a,b {         ; mike.dld
115
macro get_sys_colors col_buf
127
 if (~a eq)&(~b eq)
-
 
128
   mpack reg,a,b
-
 
129
 else if (~a eq)&(b eq)
116
{
130
   mov reg,a
117
        mov     eax,48
Line -... Line 118...
-
 
118
        mov     ebx,3
-
 
119
        mov     ecx,col_buf
-
 
120
        mov     edx,40
-
 
121
        int     0x40
-
 
122
}
-
 
123
 
Line -... Line 124...
-
 
124
macro get_grab_area
-
 
125
{
-
 
126
        mov     eax,48
-
 
127
        mov     ebx,7
-
 
128
        int     0x40
-
 
129
}
Line 131... Line -...
131
 end if
-
 
132
}
-
 
133
 
-
 
134
macro mcall a,b,c,d,e,f {   ; mike.dld
-
 
135
 __mov eax,a
-
 
136
 __mov ebx,b
-
 
137
 __mov ecx,c
130
 
138
 __mov edx,d
131
macro get_scin_height
139
 __mov esi,e
132
{
140
 __mov edi,f
133
        mov     eax,48
141
 int   0x40
134
        mov     ebx,4
142
}
135
        int     0x40
143
 
136
}
144
 
137
 
-
 
138
macro min_window
-
 
139
{
-
 
140
        mov     eax,18
-
 
141
        mov     ebx,10
-
 
142
        int     0x40
-
 
143
}
-
 
144
 
-
 
145
macro activ_window slot_n
-
 
146
{
-
 
147
        mov     eax,18
-
 
148
        mov     ebx,3
-
 
149
if  eq <>
-
 
150
else
-
 
151
        mov     ecx,slot_n
145
 
152
end if
146
 
153
        int     0x40
147
 
154
}
-
 
155
 
148
 
156
macro get_active_window
Line -... Line 157...
-
 
157
{
149
; optimize the code for size
158
        mov     eax,18
150
__regs fix 
159
        mov     ebx,7
151
 
160
        int     0x40
152
macro add arg1,arg2
161
}
153
 {
162
 
-
 
163
macro delay time
154
   if (arg2 eqtype 0)
164
{
155
      if (arg2) = 1
165
        mov     eax,5
156
         inc arg1
166
if 
-
 
167
else
-
 
168
        mov     ebx,time
157
      else
169
end if
158
         add arg1,arg2
170
        int     0x40
159
      end if
171
}
160
   else
-
 
161
      add arg1,arg2
-
 
162
   end if
-
 
163
 }
-
 
164
 
-
 
165
macro sub arg1,arg2
172
 
166
 {
173
;--- ®¦¨¤ âì ᮡëâ¨ï ---
167
   if (arg2 eqtype 0)
174
macro wait_event redraw,key,button,mouse,ipc,other
168
      if (arg2) = 1
175
{
169
         dec arg1
176
        mov     eax,10
170
      else
177
        int     0x40
171
         sub arg1,arg2
178
        dec     ax
172
      end if
-
 
173
   else
179
if  eq <>
174
      sub arg1,arg2
180
else
175
   end if
181
        jz      redraw
176
 }
182
end if
177
 
183
        dec     ax
-
 
184
if  eq <>
178
macro mov arg1,arg2
185
else
-
 
186
        jz      key
179
 {
187
end if
-
 
188
        dec     ax
-
 
189
if 
-
 
190
else
-
 
191
        jz      button
-
 
192
end if
180
   if (arg1 in __regs) & (arg2 eqtype 0)
193
        dec     ax
181
      if (arg2) = 0
194
        dec     ax
Line -... Line 195...
-
 
195
        dec     ax
-
 
196
if  eq <>
-
 
197
else
-
 
198
        jz      mouse
-
 
199
end if
-
 
200
if  eq <>
Line 182... Line 201...
182
         xor arg1,arg1
201
else
183
      else if (arg2) = 1
202
        dec     ax
-
 
203
        jz      ipc
-
 
204
end if
-
 
205
if  eq <>
-
 
206
        jmp     still
184
         xor arg1,arg1
207
else
-
 
208
        jmp     other
-
 
209
end if
185
         inc arg1
210
}
186
      else if (arg2) = -1
211
 
-
 
212
;--- ¯®«ãç¨âì à §¬¥àë íªà ­  ---
-
 
213
macro get_screen_size
-
 
214
{
187
         or  arg1,-1
215
        mov     eax,14
-
 
216
        int     0x40
188
      else if (arg2) > -128 & (arg2) < 128
217
}
Line 189... Line -...
189
         push arg2
-
 
190
         pop  arg1
218
 
191
      else
219
macro get_screen_prop  struc_ptr
192
         mov  arg1,arg2
220
{
193
      end if
-
 
194
   else
-
 
195
      mov arg1,arg2
221
        mov     eax,61
196
   end if
222
        push    eax eax
197
 }
223
        xor     ebx,ebx
198
 
224
        inc     ebx
199
 
-
 
200
macro struct name
-
 
201
 {
-
 
202
  virtual at 0
225
        int     0x40
203
   name name
226
        mov     [struc_ptr],eax
204
   sizeof.#name = $ - name
227
        pop     eax
205
  end virtual
-
 
206
 }
228
        inc     ebx
207
 
-
 
Line -... Line 229...
-
 
229
        int     0x40
-
 
230
        mov     [struc_ptr+4],ax
-
 
231
        pop     eax
-
 
232
        inc     ebx
-
 
233
        int     0x40
-
 
234
        mov     [struc_ptr+6],eax
208
; structures used in MeOS
235
}
209
struc process_information
236
 
210
 {
237
macro resize_mem mem_size
211
  .cpu_usage               dd ?  ; +0
238
{
212
  .window_stack_position   dw ?  ; +4
239
        mov     eax,64
-
 
240
        xor     ebx,ebx
-
 
241
        inc     ebx
-
 
242
if  eq <>
213
  .window_stack_value      dw ?  ; +6
243
else
214
  .not_used1               dw ?  ; +8
244
        mov     ecx,mem_size
-
 
245
end if
215
  .process_name            rb 12 ; +10
246
        int     0x40
216
  .memory_start            dd ?  ; +22
247
}
217
  .used_memory             dd ?  ; +26
248
 
218
  .PID                     dd ?  ; +30
249
evm_redraw equ 1
219
  .x_start                 dd ?  ; +34
250
evm_key equ 10b
-
 
251
evm_button equ 100b
220
  .y_start                 dd ?  ; +38
252
evm_mouse equ 100000b
221
  .x_size                  dd ?  ; +42
-
 
Line -... Line 253...
-
 
253
evm_ipc equ 1000000b
-
 
254
 
-
 
255
struc procinfo
-
 
256
{
-
 
257
.takts_per_second: dd ?
-
 
258
.window_stack_pos: dw ?
-
 
259
.slot_number: dw ?
-
 
260
dw ?
-
 
261
.name: rb 11
-
 
262
.align: db ?
-
 
263
.addres: dd ?
-
 
264
.use_mem: dd ?
-
 
265
.pid: dd ?
-
 
266
.left: dd ?
-
 
267
.top: dd ?
-
 
268
.width: dd ?
-
 
269
.height: dd ?
-
 
270
.slot_state: dw ?
-
 
271
rb (1024-56)
Line 222... Line 272...
222
  .y_size                  dd ?  ; +46
272
}
-
 
273
 
-
 
274
struc sys_color_table
-
 
275
{
-
 
276
.frames: dd ?  ;+0
-
 
277
.grab: dd ?    ;+4
-
 
278
.grab_button: dd ? ;+8
Line 223... Line -...
223
  .slot_state              dw ?  ; +50
-
 
224
  rb (1024-52)
279
.grab_button_text: dd ?  ;+12
225
 }
280
.grab_text: dd ?  ;+16
226
struct process_information
281
.work: dd ?       ;+20
227
 
-
 
228
struc system_colors
-
 
229
 {
-
 
230
  .frame            dd ?
-
 
231
  .grab             dd ?
282
.work_button: dd ?;+24
232
  .grab_button      dd ?
283
.work_button_text: dd ? ;+28
233
  .grab_button_text dd ?
284
.work_text: dd ?        ;+32
Line 234... Line -...
234
  .grab_text        dd ?
-
 
235
  .work             dd ?
-
 
236
  .work_button      dd ?
-
 
237
  .work_button_text dd ?
-
 
238
  .work_text        dd ?
-
 
239
  .work_graph       dd ?
-
 
240
 }
-
 
241
struct system_colors
-
 
242
 
-
 
243
 
285
.work_graph: dd ?       ;+36
-
 
286
}
-
 
287
 
-
 
288
struc screen_size
244
; constants
289
{