Subversion Repositories Kolibri OS

Rev

Rev 1524 | Rev 1702 | Go to most recent revision | Only display areas with differences | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 1524 Rev 1525
1
;   RTF READER FOR KOLIBRI >= 0.7.7.0
1
;   RTF READER FOR KOLIBRI >= 0.7.7.0
2
;   Written in pure assembler by Ivushkin Andrey aka Willow
2
;   Written in pure assembler by Ivushkin Andrey aka Willow
3
;   Menu_bar and scroll_bar from box_lib provided by dunkaist
3
;   Menu_bar and scroll_bar from box_lib provided by dunkaist
4
;---------------------------------------------------------------------
4
;---------------------------------------------------------------------
5
M64 equ 64*1024
5
M64 equ 64*1024
6
N_A equ 0x412f4e
6
N_A equ 0x412f4e
7
RTFSIZE equ M64
7
RTFSIZE equ M64
8
RTFSTACKSIZE equ M64
8
RTFSTACKSIZE equ M64
9
BGIFONTSIZE equ 120*1024
9
BGIFONTSIZE equ 120*1024
10
ESPSIZE equ M64
10
ESPSIZE equ M64
11
LMARGIN equ 15
11
LMARGIN equ 15
12
CHARW equ 6
12
CHARW equ 6
13
CHARH equ 11
13
CHARH equ 11
14
WINW  equ 600
14
WINW  equ 600
15
WINH  equ 450
15
WINH  equ 450
16
WIN_COLOR equ 0x33f0f0f0;0x3f0f0f0
16
WIN_COLOR equ 0x33f0f0f0;0x3f0f0f0
17
DEFCOLOR equ 0x303030
17
DEFCOLOR equ 0x303030
18
;RENDER equ PIX
18
;RENDER equ PIX
19
;RENDER equ BGI
19
;RENDER equ BGI
20
RENDER equ FREE
20
RENDER equ FREE
21
 
21
 
22
BGIFONT_PATH equ '/sys/fonts/'
22
BGIFONT_PATH equ '/sys/fonts/'
23
FONT_NAME equ 'LITT'
23
FONT_NAME equ 'LITT'
24
TOP = 45
24
TOP = 45
25
MODE equ RTF
25
MODE equ RTF
26
INVALHEX equ 0
26
INVALHEX equ 0
27
RTF_COLORLESS equ 1
27
RTF_COLORLESS equ 1
28
RTF_ALIGNLESS equ 2
28
RTF_ALIGNLESS equ 2
29
RTF_NO1STLINE equ 4
29
RTF_NO1STLINE equ 4
30
RTF_OPENING   equ 8
30
RTF_OPENING   equ 8
31
RTF_HELP      equ 16
31
RTF_HELP      equ 16
32
RTF_VALID     equ 32
32
RTF_VALID     equ 32
33
RTF_BLIND     equ 64
33
RTF_BLIND     equ 64
34
RTF_TOEOF     equ 128
34
RTF_TOEOF     equ 128
35
RTF_BOTTOM    equ 256
35
RTF_BOTTOM    equ 256
36
STEPBYSTEP equ 10
36
STEPBYSTEP equ 10
37
DEBUG_BLOCK equ 10
37
DEBUG_BLOCK equ 10
38
SHOWALIGN equ 10
38
SHOWALIGN equ 10
39
GUTTER equ 10
39
GUTTER equ 10
40
BENCH  equ 0;1
40
BENCH  equ 0;1
41
syms equ 12
41
syms equ 12
42
 
42
 
43
;-------------------------------
43
;-------------------------------
44
 
44
 
45
scroll_width_size       equ     15
45
scroll_width_size       equ     15
46
AR_OFFSET               equ     10
46
AR_OFFSET               equ     10
47
 
47
 
48
;-------------------------------
48
;-------------------------------
49
 
49
 
50
  use32              ; ¢ª«îç¨âì 32-¡¨â­ë© ०¨¬  áᥬ¡«¥à 
50
  use32              ; ¢ª«îç¨âì 32-¡¨â­ë© ०¨¬  áᥬ¡«¥à 
51
  org    0x0         ;  ¤à¥á æ¨ï á ­ã«ï
51
  org    0x0         ;  ¤à¥á æ¨ï á ­ã«ï
52
 
52
 
53
  db     'MENUET01'  ; 8-¡ ©â­ë© ¨¤¥­â¨ä¨ª â®à MenuetOS
53
  db     'MENUET01'  ; 8-¡ ©â­ë© ¨¤¥­â¨ä¨ª â®à MenuetOS
54
  dd     0x01        ; ¢¥àá¨ï § £®«®¢ª  (¢á¥£¤  1)
54
  dd     0x01        ; ¢¥àá¨ï § £®«®¢ª  (¢á¥£¤  1)
55
  dd     START       ;  ¤à¥á ¯¥à¢®© ª®¬ ­¤ë
55
  dd     START       ;  ¤à¥á ¯¥à¢®© ª®¬ ­¤ë
56
  dd     I_END0      ; à §¬¥à ¯à®£à ¬¬ë
56
  dd     I_END0      ; à §¬¥à ¯à®£à ¬¬ë
57
  dd     esp_end     ; ª®«¨ç¥á⢮ ¯ ¬ïâ¨
57
  dd     esp_end     ; ª®«¨ç¥á⢮ ¯ ¬ïâ¨
58
  dd     sys_mem     ;  ¤à¥á ¢¥à設ë áâíª 
58
  dd     sys_mem     ;  ¤à¥á ¢¥à設ë áâíª 
59
  dd     fname_buf   ;  ¤à¥á ¡ãä¥à  ¤«ï ¯ à ¬¥â஢ (­¥ ¨á¯®«ì§ã¥âáï)
59
  dd     fname_buf   ;  ¤à¥á ¡ãä¥à  ¤«ï ¯ à ¬¥â஢ (­¥ ¨á¯®«ì§ã¥âáï)
60
  dd     cur_dir_path         ; § à¥§¥à¢¨à®¢ ­®
60
  dd     cur_dir_path         ; § à¥§¥à¢¨à®¢ ­®
61
 
61
 
62
include '../../../macros.inc' ; ¬ ªà®áë ®¡«¥£ç îâ ¦¨§­ì  áᥬ¡«¥à騪®¢!
62
include '../../../macros.inc' ; ¬ ªà®áë ®¡«¥£ç îâ ¦¨§­ì  áᥬ¡«¥à騪®¢!
63
include '../../../develop/libraries/box_lib/trunk/box_lib.mac'
63
include '../../../develop/libraries/box_lib/trunk/box_lib.mac'
64
include '../../../develop/libraries/box_lib/load_lib.mac'
64
include '../../../develop/libraries/box_lib/load_lib.mac'
65
 
65
 
66
;include 'MACROS.INC'
66
;include 'MACROS.INC'
67
;include 'load_lib.mac'
67
;include 'load_lib.mac'
68
 
68
 
69
@use_library
69
@use_library
70
 
70
 
71
include 'debug.inc'
71
include 'debug.inc'
72
 
72
 
73
if ~ RENDER eq PIX
73
if ~ RENDER eq PIX
74
  TOP=TOP+4
74
  TOP=TOP+4
75
  include 'bgifont.inc'
75
  include 'bgifont.inc'
76
end if
76
end if
77
include 'rtf_lite.inc'
77
include 'rtf_lite.inc'
78
;include 'ascl.inc'
78
;include 'ascl.inc'
79
;---------------------------------------------------------------------
79
;---------------------------------------------------------------------
80
;---  €—€‹Ž Žƒ€ŒŒ›  ----------------------------------------------
80
;---  €—€‹Ž Žƒ€ŒŒ›  ----------------------------------------------
81
;---------------------------------------------------------------------
81
;---------------------------------------------------------------------
82
help_file:
82
help_file:
83
    file  'reader.rtf'
83
    file  'reader.rtf'
84
help_end:
84
help_end:
85
 
85
 
86
START:
86
START:
87
        mcall 68, 11
87
        mcall 68, 11
88
        mcall 40, 0x27
88
        mcall 40, 0x27
89
 
89
 
90
load_libraries l_libs_start,end_l_libs
90
load_libraries l_libs_start,end_l_libs
91
 
91
 
92
;OpenDialog     initialisation
92
;OpenDialog     initialisation
93
        push    dword OpenDialog_data
93
        push    dword OpenDialog_data
94
        call    [OpenDialog_Init]
94
        call    [OpenDialog_Init]
95
 
95
 
96
    mov  [pitch],2
96
    mov  [pitch],2
97
  if ~ RENDER eq PIX
97
  if ~ RENDER eq PIX
98
    mov  edx,FONT_NAME
98
    mov  edx,FONT_NAME
99
    mov  edi,save_limit
99
    mov  edi,save_limit
100
    BGIfont_Prepare
100
    BGIfont_Prepare
101
  end if
101
  end if
102
 start2:
102
 start2:
103
    cmp  byte[fname_buf],0
103
    cmp  byte[fname_buf],0
104
    je   load_file;top_red
104
    je   load_file;top_red
105
    jmp  noactivate
105
    jmp  noactivate
106
 prep_load:
106
 prep_load:
107
    mov  [is_scroll_bar_needed],    0
107
    mov  [is_scroll_bar_needed],    0
108
;    mcall 18,3,dword[prcinfo+30]
108
;    mcall 18,3,dword[prcinfo+30]
109
 noactivate:
109
 noactivate:
110
;    and  ebp,not RTF_OPENING
110
;    and  ebp,not RTF_OPENING
111
;    and  ebp,not RTF_HELP
111
;    and  ebp,not RTF_HELP
112
 
112
 
113
;    and  [mode],not RTF_OPENING
113
;    and  [mode],not RTF_OPENING
114
    and  [mode],not (RTF_HELP+RTF_OPENING)
114
    and  [mode],not (RTF_HELP+RTF_OPENING)
115
    mov  ecx,16
115
    mov  ecx,16
116
    mov  edi,fileinfo.name
116
    mov  edi,fileinfo.name
117
    mov  esi,fname_buf
117
    mov  esi,fname_buf
118
    rep  movsd
118
    rep  movsd
119
 load_file:
119
 load_file:
120
        mov     eax, 70
120
        mov     eax, 70
121
        and     [fileattr+32], 0
121
        and     [fileattr+32], 0
122
        mov     ebx, attrinfo
122
        mov     ebx, attrinfo
123
        mcall
123
        mcall
124
        mov     ebx, [fileattr+32]
124
        mov     ebx, [fileattr+32]
125
        test    eax, eax
125
        test    eax, eax
126
        jz      .sizok
126
        jz      .sizok
127
        mov     dword [fileinfo.name], N_A
127
        mov     dword [fileinfo.name], N_A
128
.sizok:
128
.sizok:
129
    and  [wSave],0
129
    and  [wSave],0
130
;    mov  [HClick],-100
130
;    mov  [HClick],-100
131
    mov  eax,ebx
131
    mov  eax,ebx
132
    and  eax,RTFSIZE-1
132
    and  eax,RTFSIZE-1
133
    add  eax,I_END
133
    add  eax,I_END
134
    mov  [tail],eax
134
    mov  [tail],eax
135
    shr  ebx,16
135
    shr  ebx,16
136
;    dpd ebx
136
;    dpd ebx
137
    mov  [max_block],ebx
137
    mov  [max_block],ebx
138
    xor  eax,eax
138
    xor  eax,eax
139
    mov  ecx,256
139
    mov  ecx,256
140
    mov  edi,fileinfo.name
140
    mov  edi,fileinfo.name
141
    repne scasb
141
    repne scasb
142
    sub  edi,fileinfo.name+1
142
    sub  edi,fileinfo.name+1
143
    mov  [fname_size],edi
143
    mov  [fname_size],edi
144
top_red:
144
top_red:
145
    mov  [top],TOP
145
    mov  [top],TOP
146
    mov  [scroll_bar_data_vertical.position],0
146
    mov  [scroll_bar_data_vertical.position],0
147
red:                    ; ¯¥à¥à¨á®¢ âì ®ª­®
147
red:                    ; ¯¥à¥à¨á®¢ âì ®ª­®
148
    call draw_window    ; ¢ë§ë¢ ¥¬ ¯à®æ¥¤ãàã ®âà¨á®¢ª¨ ®ª­ 
148
    call draw_window    ; ¢ë§ë¢ ¥¬ ¯à®æ¥¤ãàã ®âà¨á®¢ª¨ ®ª­ 
149
 
149
 
150
;---------------------------------------------------------------------
150
;---------------------------------------------------------------------
151
;---  –ˆŠ‹ Ž€Ž’Šˆ ‘Ž›’ˆ‰  ----------------------------------------
151
;---  –ˆŠ‹ Ž€Ž’Šˆ ‘Ž›’ˆ‰  ----------------------------------------
152
;---------------------------------------------------------------------
152
;---------------------------------------------------------------------
153
 
153
 
154
still:
154
still:
155
    mcall 10            ; äã­ªæ¨ï 10 - ¦¤ âì ᮡëâ¨ï
155
    mcall 10            ; äã­ªæ¨ï 10 - ¦¤ âì ᮡëâ¨ï
156
 
156
 
157
    cmp  eax,1          ; ¯¥à¥à¨á®¢ âì ®ª­® ?
157
    cmp  eax,1          ; ¯¥à¥à¨á®¢ âì ®ª­® ?
158
    je   red            ; ¥á«¨ ¤  - ­  ¬¥âªã red
158
    je   red            ; ¥á«¨ ¤  - ­  ¬¥âªã red
159
    cmp  eax,3          ; ­ ¦ â  ª­®¯ª  ?
159
    cmp  eax,3          ; ­ ¦ â  ª­®¯ª  ?
160
    je   button         ; ¥á«¨ ¤  - ­  button
160
    je   button         ; ¥á«¨ ¤  - ­  button
161
    cmp  eax,6
161
    cmp  eax,6
162
    je   mouse
162
    je   mouse
163
 
163
 
164
;---------------------------------------------------------------------
164
;---------------------------------------------------------------------
165
 
165
 
166
 
166
 
167
  key:                  ; ­ ¦ â  ª« ¢¨è  ­  ª« ¢¨ âãà¥
167
  key:                  ; ­ ¦ â  ª« ¢¨è  ­  ª« ¢¨ âãà¥
168
    mcall 2             ; äã­ªæ¨ï 2 - áç¨â âì ª®¤ ᨬ¢®«  (¢ ah)
168
    mcall 2             ; äã­ªæ¨ï 2 - áç¨â âì ª®¤ ᨬ¢®«  (¢ ah)
169
    cmp  ah,104         ; HELP
169
    cmp  ah,104         ; HELP
170
    jne  .nohelp
170
    jne  .nohelp
171
  .help:
171
  .help:
172
    mov  [is_scroll_bar_needed],    0
172
    mov  [is_scroll_bar_needed],    0
173
    xor  [mode],RTF_HELP
173
    xor  [mode],RTF_HELP
174
    test [mode],RTF_HELP
174
    test [mode],RTF_HELP
175
    jz   load_file
175
    jz   load_file
176
    mov  dword[HDoc],200                        ; it makes the help page not scroll
176
    mov  dword[HDoc],200                        ; it makes the help page not scroll
177
    mov  ecx,help_end-help_file
177
    mov  ecx,help_end-help_file
178
    mov  [block_end],ecx
178
    mov  [block_end],ecx
179
    add  [block_end],I_END
179
    add  [block_end],I_END
180
    mov  [tail],ecx
180
    mov  [tail],ecx
181
    add  [tail],I_END
181
    add  [tail],I_END
182
    mov  esi,help_file
182
    mov  esi,help_file
183
    mov  edi,I_END
183
    mov  edi,I_END
184
    rep  movsb
184
    rep  movsb
185
;    or   [mode],RTF_HELP
185
;    or   [mode],RTF_HELP
186
    xor  eax,eax
186
    xor  eax,eax
187
    mov  [max_block],eax
187
    mov  [max_block],eax
188
    jmp  top_red
188
    jmp  top_red
189
  .nohelp:
189
  .nohelp:
190
;    test [mode],RTF_HELP
190
;    test [mode],RTF_HELP
191
;    jz   .nohelp2
191
;    jz   .nohelp2
192
;    and  [mode],not RTF_HELP
192
;    and  [mode],not RTF_HELP
193
;    cmp  dword[fileinfo.name],N_A
193
;    cmp  dword[fileinfo.name],N_A
194
;    je   still
194
;    je   still
195
;    jmp  prep_load
195
;    jmp  prep_load
196
  .nohelp2:
196
  .nohelp2:
197
    cmp  ah,114         ; R - redraw
197
    cmp  ah,114         ; R - redraw
198
    je   red
198
    je   red
199
    cmp  ah,99          ; C - color
199
    cmp  ah,99          ; C - color
200
    jne  .nocolor
200
    jne  .nocolor
201
  .color:
201
  .color:
202
    xor  [mode],RTF_COLORLESS
202
    xor  [mode],RTF_COLORLESS
203
    jmp  red
203
    jmp  red
204
  .nocolor:
204
  .nocolor:
205
    cmp  ah,97          ; A - alignment
205
    cmp  ah,97          ; A - alignment
206
    jne  .noalign
206
    jne  .noalign
207
  .alignment:
207
  .alignment:
208
    xor  [mode],RTF_ALIGNLESS
208
    xor  [mode],RTF_ALIGNLESS
209
    jmp  red
209
    jmp  red
210
  .noalign:
210
  .noalign:
211
    cmp  ah,44          ; < - pitch dec
211
    cmp  ah,44          ; < - pitch dec
212
    jne  .nopd
212
    jne  .nopd
213
  .decp:
213
  .decp:
214
    dec  [pitch]
214
    dec  [pitch]
215
    jmp  red
215
    jmp  red
216
  .nopd:
216
  .nopd:
217
    cmp  ah,46          ; < - pitch inc
217
    cmp  ah,46          ; < - pitch inc
218
    jne  .nopi
218
    jne  .nopi
219
  .incp:
219
  .incp:
220
    inc  [pitch]
220
    inc  [pitch]
221
    jmp  red
221
    jmp  red
222
  .nopi:
222
  .nopi:
223
    cmp  ah,180         ; Home
223
    cmp  ah,180         ; Home
224
    je   top_red
224
    je   top_red
225
    
225
    
226
    cmp  dword[is_scroll_bar_needed], 0
226
    cmp  dword[is_scroll_bar_needed], 0
227
     je  still
227
     je  still
228
    
228
    
229
    mov  ebx,dword[prcinfo+46]
229
    mov  ebx,dword[prcinfo+46]
230
    sub  ebx,TOP+15
230
    sub  ebx,TOP+15
231
    cmp  ah,183 ;PgDn
231
    cmp  ah,183 ;PgDn
232
    jne  .nopgdn
232
    jne  .nopgdn
233
;    sub  [top],bx
233
;    sub  [top],bx
234
 
234
 
235
    cmp  dword[is_scroll_bar_needed], 0
235
    cmp  dword[is_scroll_bar_needed], 0
236
     je  still
236
     je  still
237
    
237
    
238
    mov  eax, [scroll_bar_data_vertical.position]
238
    mov  eax, [scroll_bar_data_vertical.position]
239
    add  eax, AR_OFFSET*7
239
    add  eax, AR_OFFSET*7
240
    mov  ebx, [scroll_bar_data_vertical.max_area]
240
    mov  ebx, [scroll_bar_data_vertical.max_area]
241
    sub  ebx, [scroll_bar_data_vertical.cur_area]
241
    sub  ebx, [scroll_bar_data_vertical.cur_area]
242
    cmp  eax, ebx
242
    cmp  eax, ebx
243
    mov  dword[scroll_bar_data_vertical.position], eax
243
    mov  dword[scroll_bar_data_vertical.position], eax
244
    jl  @f
244
    jl  @f
245
    mov  dword[scroll_bar_data_vertical.position], ebx
245
    mov  dword[scroll_bar_data_vertical.position], ebx
246
  @@:
246
  @@:
247
    call Set_position
247
    call Set_position
248
    jmp  red
248
    jmp  red
249
  .nopgdn:
249
  .nopgdn:
250
    cmp  ah,177 ;arrDn
250
    cmp  ah,177 ;arrDn
251
    jne  .noardn
251
    jne  .noardn
252
;    sub  [top],CHARH
252
;    sub  [top],CHARH
253
 
253
 
254
    cmp  dword[is_scroll_bar_needed], 0
254
    cmp  dword[is_scroll_bar_needed], 0
255
     je  still
255
     je  still
256
    
256
    
257
    mov  eax, [scroll_bar_data_vertical.position]
257
    mov  eax, [scroll_bar_data_vertical.position]
258
    add  eax, AR_OFFSET
258
    add  eax, AR_OFFSET
259
    mov  ebx, [scroll_bar_data_vertical.max_area]
259
    mov  ebx, [scroll_bar_data_vertical.max_area]
260
    sub  ebx, [scroll_bar_data_vertical.cur_area]
260
    sub  ebx, [scroll_bar_data_vertical.cur_area]
261
    cmp  eax, ebx
261
    cmp  eax, ebx
262
    mov  dword[scroll_bar_data_vertical.position], eax
262
    mov  dword[scroll_bar_data_vertical.position], eax
263
    jl  @f
263
    jl  @f
264
    mov  dword[scroll_bar_data_vertical.position], ebx
264
    mov  dword[scroll_bar_data_vertical.position], ebx
265
  @@:
265
  @@:
266
    call Set_position
266
    call Set_position
267
 
267
 
268
    jmp  red
268
    jmp  red
269
  .noardn:
269
  .noardn:
270
    mov  cx,[top]
270
    mov  cx,[top]
271
    cmp  ah,184 ;PgUp
271
    cmp  ah,184 ;PgUp
272
    jne  .nopgup
272
    jne  .nopgup
273
;    add  [top],bx
273
;    add  [top],bx
274
;    cmp  [top],TOP
274
;    cmp  [top],TOP
275
;    jl   red
275
;    jl   red
276
;    mov  [top],TOP
276
;    mov  [top],TOP
277
;    cmp  cx,[top]
277
;    cmp  cx,[top]
278
;    je   still
278
;    je   still
279
 
279
 
280
    cmp  dword[is_scroll_bar_needed], 0
280
    cmp  dword[is_scroll_bar_needed], 0
281
     je  still
281
     je  still
282
    
282
    
283
    cmp  dword[scroll_bar_data_vertical.position], AR_OFFSET*7
283
    cmp  dword[scroll_bar_data_vertical.position], AR_OFFSET*7
284
    sub  dword[scroll_bar_data_vertical.position], AR_OFFSET*7
284
    sub  dword[scroll_bar_data_vertical.position], AR_OFFSET*7
285
    jg  @f
285
    jg  @f
286
    mov  dword[scroll_bar_data_vertical.position], 0
286
    mov  dword[scroll_bar_data_vertical.position], 0
287
  @@:
287
  @@:
288
    call Set_position
288
    call Set_position
289
    jmp  red
289
    jmp  red
290
  .nopgup:
290
  .nopgup:
291
    cmp  ah,178 ;arrUp
291
    cmp  ah,178 ;arrUp
292
    jne  .noarup
292
    jne  .noarup
293
;    add  [top],CHARH
293
;    add  [top],CHARH
294
 
294
 
295
    cmp  dword[is_scroll_bar_needed], 0
295
    cmp  dword[is_scroll_bar_needed], 0
296
     je  still
296
     je  still
297
    
297
    
298
    cmp  dword[scroll_bar_data_vertical.position], AR_OFFSET
298
    cmp  dword[scroll_bar_data_vertical.position], AR_OFFSET
299
    sub  dword[scroll_bar_data_vertical.position], AR_OFFSET
299
    sub  dword[scroll_bar_data_vertical.position], AR_OFFSET
300
    jg  @f
300
    jg  @f
301
    mov  dword[scroll_bar_data_vertical.position], 0
301
    mov  dword[scroll_bar_data_vertical.position], 0
302
  @@:
302
  @@:
303
    call Set_position
303
    call Set_position
304
 
304
 
305
;    cmp  [top],TOP
305
;    cmp  [top],TOP
306
;    jl   red
306
;    jl   red
307
;    mov  [top],TOP
307
;    mov  [top],TOP
308
;    cmp  cx,[top]
308
;    cmp  cx,[top]
309
;    je   still
309
;    je   still
310
    jmp  red
310
    jmp  red
311
  .noarup:
311
  .noarup:
312
  if  RENDER eq FREE
312
  if  RENDER eq FREE
313
    cmp  ah,56 ;zoom+
313
    cmp  ah,56 ;zoom+
314
    jne  .noplus
314
    jne  .noplus
315
  .zplus:
315
  .zplus:
316
    fld  [FreeFontscale]
316
    fld  [FreeFontscale]
317
    fmul [Zoomscale]
317
    fmul [Zoomscale]
318
  .zoom:
318
  .zoom:
319
    fstp [FreeFontscale]
319
    fstp [FreeFontscale]
320
    jmp  red
320
    jmp  red
321
  .noplus:
321
  .noplus:
322
    cmp  ah,54 ;zoom-
322
    cmp  ah,54 ;zoom-
323
    jne  .nominus
323
    jne  .nominus
324
  .zminus:
324
  .zminus:
325
    fld  [FreeFontscale]
325
    fld  [FreeFontscale]
326
    fdiv [Zoomscale]
326
    fdiv [Zoomscale]
327
    jmp  .zoom
327
    jmp  .zoom
328
  .nominus:
328
  .nominus:
329
  end if
329
  end if
330
    cmp  ah,0xB5        ; end
330
    cmp  ah,0xB5        ; end
331
    jne  .pre_file_open
331
    jne  .pre_file_open
332
  .end:
332
  .end:
333
 
333
 
334
    cmp  dword[is_scroll_bar_needed], 0
334
    cmp  dword[is_scroll_bar_needed], 0
335
     je  still
335
     je  still
336
    
336
    
337
    mov  eax, [scroll_bar_data_vertical.max_area]
337
    mov  eax, [scroll_bar_data_vertical.max_area]
338
    sub  eax, [scroll_bar_data_vertical.cur_area]
338
    sub  eax, [scroll_bar_data_vertical.cur_area]
339
    mov  dword[scroll_bar_data_vertical.position], eax
339
    mov  dword[scroll_bar_data_vertical.position], eax
340
    call Set_position
340
    call Set_position
341
    jmp  red
341
    jmp  red
342
  .pre_file_open:
342
  .pre_file_open:
343
    cmp  ah,108         ; L - load
343
    cmp  ah,108         ; L - load
344
    jne  still
344
    jne  still
345
  .file_open:
345
  .file_open:
346
;---------------------------------------------------------------------
346
;---------------------------------------------------------------------
347
;OpenDialog_start:
347
;OpenDialog_start:
348
;       copy_path       open_dialog_name,path,library_path,0
348
;       copy_path       open_dialog_name,path,library_path,0
349
        
349
        
350
        push    dword OpenDialog_data
350
        push    dword OpenDialog_data
351
        call    [OpenDialog_Start]
351
        call    [OpenDialog_Start]
352
 
352
 
353
;       cmp     [OpenDialog_data.status],2 ; OpenDialog does not start
353
;       cmp     [OpenDialog_data.status],2 ; OpenDialog does not start
354
;       je      .sysxtree  ;    some kind of alternative, instead OpenDialog
354
;       je      .sysxtree  ;    some kind of alternative, instead OpenDialog
355
        cmp     [OpenDialog_data.status],1
355
        cmp     [OpenDialog_data.status],1
356
        je      prep_load
356
        je      prep_load
357
        jmp     still
357
        jmp     still
358
;---------------------------------------------------------------------  
358
;---------------------------------------------------------------------  
359
;.sysxtree:
359
;.sysxtree:
360
;    or   [mode],RTF_OPENING
360
;    or   [mode],RTF_OPENING
361
;    opendialog draw_window, prep_load, st_1, fname_buf
361
;    opendialog draw_window, prep_load, st_1, fname_buf
362
;  st_1:
362
;  st_1:
363
;    and  [mode],not RTF_OPENING
363
;    and  [mode],not RTF_OPENING
364
;    jmp  still;red
364
;    jmp  still;red
365
;  stilld:
365
;  stilld:
366
;    jmp  still
366
;    jmp  still
367
;---------------------------------------------------------------------
367
;---------------------------------------------------------------------
368
 
368
 
369
  button:
369
  button:
370
    mcall 17            ; 17 - ¯®«ãç¨âì ¨¤¥­â¨ä¨ª â®à ­ ¦ â®© ª­®¯ª¨
370
    mcall 17            ; 17 - ¯®«ãç¨âì ¨¤¥­â¨ä¨ª â®à ­ ¦ â®© ª­®¯ª¨
371
 
371
 
372
    cmp   ah, 1         ; ¥á«¨ ­ ¦ â  ª­®¯ª  á ­®¬¥à®¬ 1,
372
    cmp   ah, 1         ; ¥á«¨ ­ ¦ â  ª­®¯ª  á ­®¬¥à®¬ 1,
373
    je    .exit
373
    je    .exit
374
    jmp still
374
    jmp still
375
    
375
    
376
  .exit:
376
  .exit:
377
    mcall -1            ; ¨­ ç¥ ª®­¥æ ¯à®£à ¬¬ë
377
    mcall -1            ; ¨­ ç¥ ª®­¥æ ¯à®£à ¬¬ë
378
    
378
    
379
 
379
 
380
;---------------------------------------------------------------------
380
;---------------------------------------------------------------------
381
;---  MOUSE EVENT PROCESSING  ----------------------------------------
381
;---  MOUSE EVENT PROCESSING  ----------------------------------------
382
;---------------------------------------------------------------------    
382
;---------------------------------------------------------------------    
383
mouse:
383
mouse:
384
        mcall   37,7
384
        mcall   37,7
385
        test    eax,    eax
385
        test    eax,    eax
386
        je      .menu_bar_1;.mouse
386
        je      .menu_bar_1;.mouse
387
        jmp     still
387
        jmp     still
388
 
388
 
389
 
389
 
390
.menu_bar_1:
390
.menu_bar_1:
391
        call    .set_mouse_flag
391
        call    .set_mouse_flag
392
@@:
392
@@:
393
        push    dword menu_data_1       ;mouse event for Menu 1
393
        push    dword menu_data_1       ;mouse event for Menu 1
394
        call    [menu_bar_mouse]
394
        call    [menu_bar_mouse]
395
        cmp     [menu_data_1.click],dword 1
395
        cmp     [menu_data_1.click],dword 1
396
        jne     .menu_bar_2
396
        jne     .menu_bar_2
397
        cmp     [menu_data_1.cursor_out],dword 0
397
        cmp     [menu_data_1.cursor_out],dword 0
398
        jne     .analyse_out_menu_1
398
        jne     .analyse_out_menu_1
399
        jmp     .menu_bar_1
399
        jmp     .menu_bar_1
400
.menu_bar_2:
400
.menu_bar_2:
401
        push    dword menu_data_2
401
        push    dword menu_data_2
402
        call    [menu_bar_mouse]
402
        call    [menu_bar_mouse]
403
        cmp     [menu_data_2.click],dword 1
403
        cmp     [menu_data_2.click],dword 1
404
        jne     .menu_bar_3
404
        jne     .menu_bar_3
405
        cmp     [menu_data_2.cursor_out],dword 0
405
        cmp     [menu_data_2.cursor_out],dword 0
406
        jne     .analyse_out_menu_2
406
        jne     .analyse_out_menu_2
407
        jmp     .menu_bar_1
407
        jmp     .menu_bar_1
408
.menu_bar_3:
408
.menu_bar_3:
409
        push    dword menu_data_3
409
        push    dword menu_data_3
410
        call    [menu_bar_mouse]
410
        call    [menu_bar_mouse]
411
        cmp     [menu_data_3.click],dword 1
411
        cmp     [menu_data_3.click],dword 1
412
        jne     .scroll_bar
412
        jne     .scroll_bar
413
        cmp     [menu_data_3.cursor_out],dword 0
413
        cmp     [menu_data_3.cursor_out],dword 0
414
        jne     .analyse_out_menu_3
414
        jne     .analyse_out_menu_3
415
        jmp     .menu_bar_1
415
        jmp     .menu_bar_1
416
 
416
 
417
.set_mouse_flag:
417
.set_mouse_flag:
418
        xor     eax,eax
418
        xor     eax,eax
419
        inc     eax
419
        inc     eax
420
        mov     [menu_data_1.get_mouse_flag],eax
420
        mov     [menu_data_1.get_mouse_flag],eax
421
        mov     [menu_data_2.get_mouse_flag],eax
421
        mov     [menu_data_2.get_mouse_flag],eax
422
        mov     [menu_data_3.get_mouse_flag],eax
422
        mov     [menu_data_3.get_mouse_flag],eax
423
        ret
423
        ret
424
 
424
 
425
.analyse_out_menu_1:
425
.analyse_out_menu_1:
426
        cmp     [menu_data_1.cursor_out],dword 1
426
        cmp     [menu_data_1.cursor_out],dword 1
427
        je      key.file_open
427
        je      key.file_open
428
        cmp     [menu_data_1.cursor_out],dword 2
428
        cmp     [menu_data_1.cursor_out],dword 2
429
        je      button.exit
429
        je      button.exit
430
        jmp     red
430
        jmp     red
431
 
431
 
432
.analyse_out_menu_2:
432
.analyse_out_menu_2:
433
        cmp     [menu_data_2.cursor_out],dword 1
433
        cmp     [menu_data_2.cursor_out],dword 1
434
        je      key.zplus
434
        je      key.zplus
435
        cmp     [menu_data_2.cursor_out],dword 2
435
        cmp     [menu_data_2.cursor_out],dword 2
436
        je      key.zminus
436
        je      key.zminus
437
        cmp     [menu_data_2.cursor_out],dword 3
437
        cmp     [menu_data_2.cursor_out],dword 3
438
        je      key.incp
438
        je      key.incp
439
        cmp     [menu_data_2.cursor_out],dword 4
439
        cmp     [menu_data_2.cursor_out],dword 4
440
        je      key.decp
440
        je      key.decp
441
        cmp     [menu_data_2.cursor_out],dword 5
441
        cmp     [menu_data_2.cursor_out],dword 5
442
        je      key.alignment
442
        je      key.alignment
443
        cmp     [menu_data_2.cursor_out],dword 6
443
        cmp     [menu_data_2.cursor_out],dword 6
444
        je      key.color
444
        je      key.color
445
        jmp     red
445
        jmp     red
446
 
446
 
447
.analyse_out_menu_3:
447
.analyse_out_menu_3:
448
        cmp     [menu_data_3.cursor_out],dword 1
448
        cmp     [menu_data_3.cursor_out],dword 1
449
        je      key.help
449
        je      key.help
450
        jmp     red
450
        jmp     red
451
 
451
 
452
.scroll_bar:
452
.scroll_bar:
453
        cmp     dword[is_scroll_bar_needed], 0
453
        cmp     dword[is_scroll_bar_needed], 0
454
        je      still
454
        je      still
455
.vertical:
455
.vertical:
456
        mov     eax,[scroll_bar_data_vertical.max_area]
456
        mov     eax,[scroll_bar_data_vertical.max_area]
457
        cmp     eax,[scroll_bar_data_vertical.cur_area]
457
        cmp     eax,[scroll_bar_data_vertical.cur_area]
458
        jbe     still
458
        jbe     still
459
; mouse event for Vertical ScrollBar
459
; mouse event for Vertical ScrollBar
460
 
460
 
461
        push    dword scroll_bar_data_vertical
461
        push    dword scroll_bar_data_vertical
462
        call    [scrollbar_ver_mouse]
462
        call    [scrollbar_ver_mouse]
463
  
463
  
464
        call    Set_position
464
        call    Set_position
465
        
465
        
466
        mov     eax,scroll_bar_data_vertical.redraw
466
        mov     eax,scroll_bar_data_vertical.redraw
467
        xor     ebx,ebx
467
        xor     ebx,ebx
468
        cmp     [eax],ebx
468
        cmp     [eax],ebx
469
        je      @f
469
        je      @f
470
        mov     [eax],ebx
470
        mov     [eax],ebx
471
        jmp     red
471
        jmp     red
472
@@:
472
@@:
473
        cmp     [scroll_bar_data_vertical.delta2],0
473
        cmp     [scroll_bar_data_vertical.delta2],0
474
        jne     still
474
        jne     still
475
.other:
475
.other:
476
        jmp     still
476
        jmp     still
477
;---------------------------------------------------------------------
477
;---------------------------------------------------------------------
478
;---  Ž…„…‹…ˆ… ˆ Ž’ˆ‘Ž‚Š€ ŽŠ€  ----------------------------------
478
;---  Ž…„…‹…ˆ… ˆ Ž’ˆ‘Ž‚Š€ ŽŠ€  ----------------------------------
479
;---------------------------------------------------------------------
479
;---------------------------------------------------------------------
480
 
480
 
481
draw_window:
481
draw_window:
482
 
482
 
483
    mcall 9, procinfo2, -1
483
    mcall 9, procinfo2, -1
484
    mov  edx, -1
484
    mov  edx, -1
485
    mov  esi, -1
485
    mov  esi, -1
486
    
486
    
487
    mov  eax, [procinfo2.box.width]
487
    mov  eax, [procinfo2.box.width]
488
    cmp  eax, 140
488
    cmp  eax, [window_width]
489
     je  @f
489
     je  @f
490
    mov  [is_scroll_bar_needed],    0
490
    mov  [is_scroll_bar_needed],    0
-
 
491
    cmp  eax, 140
491
     jg  @f
492
     jnl @f
492
    mov  edx, 140
493
    mov  eax, 140
493
  @@:
494
  @@:
-
 
495
    mov  edx, eax
-
 
496
    mov  [window_width],    eax
494
 
497
 
495
    mov  eax, [procinfo2.box.height]
498
    mov  eax, [procinfo2.box.height]
496
    cmp  eax, 80
499
    cmp  eax, [window_height]
497
     je  @f
500
     je  @f
-
 
501
    mov  [is_scroll_bar_needed],    0
498
    mov  [is_scroll_bar_needed],    0
502
    cmp  eax, 80
499
     jg  @f
503
     jnl @f
500
    mov  esi, 80
504
    mov  eax, 80
-
 
505
  @@:
-
 
506
    mov  esi, eax
501
  @@:
507
    mov  [window_height],   eax
502
 
508
 
503
    mcall 67, -1, -1
509
    mcall 67, -1, -1
504
 
510
 
505
    mcall 12, 1
511
    mcall 12, 1
506
;    mcall 0, <10,WINW>, <100,WINH>, WIN_COLOR,0x805080D0, 0x005080D0
512
;    mcall 0, <10,WINW>, <100,WINH>, WIN_COLOR,0x805080D0, 0x005080D0
507
;    mcall 4, <8,8>, 0x10DDEEFF, title, titlesize-title
513
;    mcall 4, <8,8>, 0x10DDEEFF, title, titlesize-title
508
    mcall 0, <10,WINW>, <100,WINH>, WIN_COLOR,0x80000000, window_title
514
    mcall 0, <10,WINW>, <100,WINH>, WIN_COLOR,0x80000000, window_title
509
;---------------------------------------------
515
;---------------------------------------------
510
    cmp  [is_scroll_bar_needed],    0
516
    cmp  [is_scroll_bar_needed],    0
511
     je  @f
517
     je  @f
512
    call Set_scroll_position
518
    call Set_scroll_position
513
        xor     eax,eax
519
        xor     eax,eax
514
        inc     eax
520
        inc     eax
515
        mov     [scroll_bar_data_vertical.all_redraw],eax
521
        mov     [scroll_bar_data_vertical.all_redraw],eax
516
; draw for Vertical ScrollBar
522
; draw for Vertical ScrollBar
517
        push    dword scroll_bar_data_vertical
523
        push    dword scroll_bar_data_vertical
518
        call    [scrollbar_ver_draw]
524
        call    [scrollbar_ver_draw]
519
; reset all_redraw flag 
525
; reset all_redraw flag 
520
        xor     eax,eax
526
        xor     eax,eax
521
        mov     [scroll_bar_data_vertical.all_redraw],eax
527
        mov     [scroll_bar_data_vertical.all_redraw],eax
522
  @@:
528
  @@:
523
;---------------------------------------------
529
;---------------------------------------------
524
    mov  esi,ecx
530
    mov  esi,ecx
525
    mcall 47,0x30000,isymImplemented,<114,8>
531
    mcall 47,0x30000,isymImplemented,<114,8>
526
    add  edx,36 shl 16
532
    add  edx,36 shl 16
527
    mcall ,,isymMax
533
    mcall ,,isymMax
528
    add  edx,40 shl 16
534
    add  edx,40 shl 16
529
    mov  esi,0x104e00e7;0x10f27840
535
    mov  esi,0x104e00e7;0x10f27840
530
    cmp  dword[fileinfo.name],N_A
536
    cmp  dword[fileinfo.name],N_A
531
    jne  .noNA
537
    jne  .noNA
532
    mov  esi,0x10ff0000
538
    mov  esi,0x10ff0000
533
  .noNA:
539
  .noNA:
534
;    mcall 4,edx,esi,fileinfo.name,[fname_size]
540
;    mcall 4,edx,esi,fileinfo.name,[fname_size]
535
    mov  edi,prcinfo
541
    mov  edi,prcinfo
536
    mcall 9,edi,-1
542
    mcall 9,edi,-1
537
    and  [mode],not RTF_TOEOF
543
    and  [mode],not RTF_TOEOF
538
    mov  ebx,[edi+42]
544
    mov  ebx,[edi+42]
539
    cmp  ebx,[wSave]
545
    cmp  ebx,[wSave]
540
    je   .nochg
546
    je   .nochg
541
  .chg:
547
  .chg:
542
    mov  [wSave],ebx
548
    mov  [wSave],ebx
543
    or   [mode],RTF_TOEOF
549
    or   [mode],RTF_TOEOF
544
    and  [HDoc],0
550
    and  [HDoc],0
545
    and  [line_count],0
551
    and  [line_count],0
546
;    mov  [HClick],-100
552
;    mov  [HClick],-100
547
  .nochg:
553
  .nochg:
548
 
554
 
549
;---------------------------------------------
555
;---------------------------------------------
550
    call  Set_scroll_position
556
    call  Set_scroll_position
551
 
557
 
552
    mov ebx, dword[prcinfo+0x3E]
558
    mov ebx, dword[prcinfo+0x3E]
553
    mcall     38, , 65536*18+18, 0x8b8b89
559
    mcall     38, , 65536*18+18, 0x8b8b89
554
    inc ebx
560
    inc ebx
555
    mcall     13, , 65536*0+18, 0xe9e9e2
561
    mcall     13, , 65536*0+18, 0xe9e9e2
556
;---------------------------------------------
562
;---------------------------------------------
557
; draw for Menu 1
563
; draw for Menu 1
558
        push    dword menu_data_1
564
        push    dword menu_data_1
559
        call    [menu_bar_draw] 
565
        call    [menu_bar_draw] 
560
; draw for Menu 2
566
; draw for Menu 2
561
        push    dword menu_data_2
567
        push    dword menu_data_2
562
        call    [menu_bar_draw] 
568
        call    [menu_bar_draw] 
563
; draw for Menu 3
569
; draw for Menu 3
564
        push    dword menu_data_3
570
        push    dword menu_data_3
565
        call    [menu_bar_draw]         
571
        call    [menu_bar_draw]         
566
;---------------------------------------------
572
;---------------------------------------------
567
 
573
 
568
    sub  dword[prcinfo+42],2*LMARGIN+scroll_width_size
574
    sub  dword[prcinfo+42],2*LMARGIN+scroll_width_size
569
    sub  dword[prcinfo+46],CHARH+25
575
    sub  dword[prcinfo+46],CHARH+25
570
    
576
    
571
 if GUTTER eq 1
577
 if GUTTER eq 1
572
    mov  ebx,LMARGIN shl 16+20
578
    mov  ebx,LMARGIN shl 16+20
573
    mov  ecx,20
579
    mov  ecx,20
574
    mov  eax,4
580
    mov  eax,4
575
    mov  edx,arrow
581
    mov  edx,arrow
576
    mov  esi,1
582
    mov  esi,1
577
  .loop1:
583
  .loop1:
578
    push ecx
584
    push ecx
579
    mcall ,,0xff0000
585
    mcall ,,0xff0000
580
    pop  ecx
586
    pop  ecx
581
    add  ebx,50 shl 16
587
    add  ebx,50 shl 16
582
    loop .loop1
588
    loop .loop1
583
 end if
589
 end if
584
 if MODE eq RTF
590
 if MODE eq RTF
585
    test [mode],RTF_OPENING
591
    test [mode],RTF_OPENING
586
    jne  .ex
592
    jne  .ex
587
    and  [mode],not (RTF_BOTTOM);+RTF_TOEOF)
593
    and  [mode],not (RTF_BOTTOM);+RTF_TOEOF)
588
    mov  [colorptr],colortbl
594
    mov  [colorptr],colortbl
589
    mov  eax,DEFCOLOR
595
    mov  eax,DEFCOLOR
590
    mov  edi,colortbl
596
    mov  edi,colortbl
591
    mov  ecx,16
597
    mov  ecx,16
592
    rep  stosd
598
    rep  stosd
593
    xor  eax,eax
599
    xor  eax,eax
594
    mov  [cGroup],eax
600
    mov  [cGroup],eax
595
    mov  edi,Chp
601
    mov  edi,Chp
596
    mov  ecx,SIZE_save
602
    mov  ecx,SIZE_save
597
    rep  stosb
603
    rep  stosb
598
    mov  ax,[top]
604
    mov  ax,[top]
599
    mov  word[Free+6],10
605
    mov  word[Free+6],10
600
    mov  word[Free+4],ax
606
    mov  word[Free+4],ax
601
    mov  esi,I_END
607
    mov  esi,I_END
602
    call RtfParse
608
    call RtfParse
603
;    dpd  eax
609
;    dpd  eax
604
;    dps  'Lines='
610
;    dps  'Lines='
605
    mov  eax,[line_count]
611
    mov  eax,[line_count]
606
;    dpd  eax
612
;    dpd  eax
607
;    newline
613
;    newline
608
;    movzx  eax,word[Free+4]
614
;    movzx  eax,word[Free+4]
609
;    dpd  eax
615
;    dpd  eax
610
    mov  eax,dword[prcinfo+42]
616
    mov  eax,dword[prcinfo+42]
611
    mov  edx,WIN_COLOR
617
    mov  edx,WIN_COLOR
612
    call draw_progress
618
    call draw_progress
613
if BENCH eq 1
619
if BENCH eq 1
614
    mcall 26,9
620
    mcall 26,9
615
    sub  eax,[bench]
621
    sub  eax,[bench]
616
;    dps  <13,10,'Bench='>
622
;    dps  <13,10,'Bench='>
617
;    dpd  eax
623
;    dpd  eax
618
end if
624
end if
619
 else
625
 else
620
    mov  [char],0
626
    mov  [char],0
621
    mov  ebx,10 shl 16+TOP
627
    mov  ebx,10 shl 16+TOP
622
    mov  ecx,16
628
    mov  ecx,16
623
  .l0:
629
  .l0:
624
    push ecx
630
    push ecx
625
    mov  ecx,16
631
    mov  ecx,16
626
  .l1:
632
  .l1:
627
    push ecx
633
    push ecx
628
  if RENDER eq BGI
634
  if RENDER eq BGI
629
    mov  edx,char
635
    mov  edx,char
630
    mov  ecx,0x48000000
636
    mov  ecx,0x48000000
631
    mov  esi,1
637
    mov  esi,1
632
    BGIfont_Outtext
638
    BGIfont_Outtext
633
  else
639
  else
634
    mcall 4,,0x10000000,char,1
640
    mcall 4,,0x10000000,char,1
635
  end if
641
  end if
636
    pop  ecx
642
    pop  ecx
637
    inc  [char]
643
    inc  [char]
638
    add  ebx,(CHARW+3) shl 16
644
    add  ebx,(CHARW+3) shl 16
639
    loop .l1
645
    loop .l1
640
    pop  ecx
646
    pop  ecx
641
    add  ebx,CHARH+2
647
    add  ebx,CHARH+2
642
    and  ebx,0x0000ffff
648
    and  ebx,0x0000ffff
643
    add  ebx,10 shl 16
649
    add  ebx,10 shl 16
644
    loop .l0
650
    loop .l0
645
 end if
651
 end if
646
 .ex:
652
 .ex:
647
call Set_position
653
call Set_position
648
;---------------------------------------------
654
;---------------------------------------------
649
    cmp  dword[is_scroll_bar_needed], 0
655
    cmp  dword[is_scroll_bar_needed], 0
650
     je  @f
656
     je  @f
651
        xor     eax,eax
657
        xor     eax,eax
652
        inc     eax
658
        inc     eax
653
        mov     [scroll_bar_data_vertical.all_redraw],eax
659
        mov     [scroll_bar_data_vertical.all_redraw],eax
654
; draw for Vertical ScrollBar
660
; draw for Vertical ScrollBar
655
        push    dword scroll_bar_data_vertical
661
        push    dword scroll_bar_data_vertical
656
        call    [scrollbar_ver_draw]
662
        call    [scrollbar_ver_draw]
657
; reset all_redraw flag 
663
; reset all_redraw flag 
658
        xor     eax,eax
664
        xor     eax,eax
659
        mov     [scroll_bar_data_vertical.all_redraw],eax
665
        mov     [scroll_bar_data_vertical.all_redraw],eax
660
  @@:
666
  @@:
661
;---------------------------------------------
667
;---------------------------------------------
662
    mcall 12, 2
668
    mcall 12, 2
663
    ret
669
    ret
664
 
670
 
665
;---------------------------------------------------------------------
671
;---------------------------------------------------------------------
666
Set_position:
672
Set_position:
667
    mov  eax, dword[prcinfo+46]
673
    mov  eax, dword[prcinfo+46]
668
    cmp  eax, [HDoc]
674
    cmp  eax, [HDoc]
669
    mov  dword[is_scroll_bar_needed], 0
675
    mov  dword[is_scroll_bar_needed], 0
670
     jnl .quit
676
     jnl .quit
671
    mov  dword[is_scroll_bar_needed], 1
677
    mov  dword[is_scroll_bar_needed], 1
672
 
678
 
673
    mov  eax, [scroll_bar_data_vertical.max_area]
679
    mov  eax, [scroll_bar_data_vertical.max_area]
674
    mul  dword[prcinfo+46]
680
    mul  dword[prcinfo+46]
675
    div  dword[HDoc]
681
    div  dword[HDoc]
676
    cmp  eax, [scroll_bar_data_vertical.max_area]
682
    cmp  eax, [scroll_bar_data_vertical.max_area]
677
    mov  dword[scroll_bar_data_vertical.cur_area],eax
683
    mov  dword[scroll_bar_data_vertical.cur_area],eax
678
     jng @f
684
     jng @f
679
    mov  eax, [scroll_bar_data_vertical.max_area]
685
    mov  eax, [scroll_bar_data_vertical.max_area]
680
    mov  dword[scroll_bar_data_vertical.cur_area], eax
686
    mov  dword[scroll_bar_data_vertical.cur_area], eax
681
  @@:
687
  @@:
682
    mov eax, [HDoc]
688
    mov eax, [HDoc]
683
    cmp eax, dword[prcinfo+46]
689
    cmp eax, dword[prcinfo+46]
684
    sub eax, dword[prcinfo+46]
690
    sub eax, dword[prcinfo+46]
685
    add eax, 20                    ; height of clear area under text when you are at the end of document
691
    add eax, 20                    ; height of clear area under text when you are at the end of document
686
     jg @f
692
     jg @f
687
    mov eax, 0
693
    mov eax, 0
688
  @@:
694
  @@:
689
    mul [scroll_bar_data_vertical.position]
695
    mul [scroll_bar_data_vertical.position]
690
    mov ebx, [scroll_bar_data_vertical.max_area]
696
    mov ebx, [scroll_bar_data_vertical.max_area]
691
    sub ebx, [scroll_bar_data_vertical.cur_area]
697
    sub ebx, [scroll_bar_data_vertical.cur_area]
692
    div ebx
698
    div ebx
693
    
699
    
694
    mov dword[top], TOP
700
    mov dword[top], TOP
695
    sub dword[top], eax
701
    sub dword[top], eax
696
    
702
    
697
  .quit:
703
  .quit:
698
    ret
704
    ret
699
;---------------------------------------------------------------------
705
;---------------------------------------------------------------------
700
Set_scroll_position:
706
Set_scroll_position:
701
    mcall 9, procinfo2, -1
707
    mcall 9, procinfo2, -1
702
    mov eax, dword[procinfo2+0x3E]
708
    mov eax, dword[procinfo2+0x3E]
703
    sub eax, scroll_width_size
709
    sub eax, scroll_width_size
704
    mov word[scroll_bar_data_vertical.start_x], ax
710
    mov word[scroll_bar_data_vertical.start_x], ax
705
 
711
 
706
    mov eax, dword[procinfo2+0x42]
712
    mov eax, dword[procinfo2+0x42]
707
    sub eax, 17
713
    sub eax, 17
708
    mov word[scroll_bar_data_vertical.size_y], ax
714
    mov word[scroll_bar_data_vertical.size_y], ax
709
    
715
    
710
    ret
716
    ret
711
;---------------------------------------------------------------------
717
;---------------------------------------------------------------------
712
 
718
 
713
if GUTTER eq 1
719
if GUTTER eq 1
714
   arrow db 0x19
720
   arrow db 0x19
715
end if
721
end if
716
;---------------------------------------------------------------------
722
;---------------------------------------------------------------------
717
;---  „€›… Žƒ€ŒŒ›  ----------------------------------------------
723
;---  „€›… Žƒ€ŒŒ›  ----------------------------------------------
718
;---------------------------------------------------------------------
724
;---------------------------------------------------------------------
719
 
725
 
720
; ¨­â¥àä¥©á ¯à®£à ¬¬ë ¬­®£®ï§ëç­ë©
726
; ¨­â¥àä¥©á ¯à®£à ¬¬ë ¬­®£®ï§ëç­ë©
721
;  ‚ë ¬®¦¥â¥ § ¤ âì ï§ëª ¢ MACROS.INC (lang fix ï§ëª)
727
;  ‚ë ¬®¦¥â¥ § ¤ âì ï§ëª ¢ MACROS.INC (lang fix ï§ëª)
722
 
728
 
723
window_title:           db      'RtfRead v1.034',0
729
window_title:           db      'RtfRead v1.034',0
724
buf_cmd_lin             dd      0x0
-
 
725
is_scroll_bar_needed    dd      0x0
730
is_scroll_bar_needed    dd      0x0
-
 
731
window_width            dd      0x0
-
 
732
window_height           dd      0x0
726
;---------------------------------------------------------------------
733
;---------------------------------------------------------------------
727
l_libs_start:
734
l_libs_start:
728
 
735
 
729
library01  l_libs system_dir_ProcLib+9, cur_dir_path, library_path, system_dir_ProcLib, \
736
library01  l_libs system_dir_ProcLib+9, cur_dir_path, library_path, system_dir_ProcLib, \
730
err_message_found_lib2, head_f_l, ProcLib_import, err_message_import2, head_f_i
737
err_message_found_lib2, head_f_l, ProcLib_import, err_message_import2, head_f_i
731
 
738
 
732
library02  l_libs system_dir_Boxlib+9, cur_dir_path, library_path, system_dir_Boxlib, \
739
library02  l_libs system_dir_Boxlib+9, cur_dir_path, library_path, system_dir_Boxlib, \
733
err_message_found_lib1, head_f_l, Box_lib_import, err_message_import1, head_f_i
740
err_message_found_lib1, head_f_l, Box_lib_import, err_message_import1, head_f_i
734
 
741
 
735
end_l_libs:
742
end_l_libs:
736
;---------------------------------------------------------------------
743
;---------------------------------------------------------------------
737
system_dir_ProcLib      db '/sys/lib/proc_lib.obj',0
744
system_dir_ProcLib      db '/sys/lib/proc_lib.obj',0
738
system_dir_Boxlib       db '/sys/lib/box_lib.obj',0
745
system_dir_Boxlib       db '/sys/lib/box_lib.obj',0
739
 
746
 
740
head_f_i:
747
head_f_i:
741
head_f_l                db 'error',0
748
head_f_l                db 'error',0
742
 
749
 
743
err_message_found_lib1  db 'box_lib.obj - Not found!',0
750
err_message_found_lib1  db 'box_lib.obj - Not found!',0
744
err_message_found_lib2  db 'proc_lib.obj - Not found!',0
751
err_message_found_lib2  db 'proc_lib.obj - Not found!',0
745
 
752
 
746
err_message_import1     db 'box_lib.obj - Wrong import!',0
753
err_message_import1     db 'box_lib.obj - Wrong import!',0
747
err_message_import2     db 'proc_lib.obj - Wrong import!',0
754
err_message_import2     db 'proc_lib.obj - Wrong import!',0
748
 
755
 
749
;---------------------------------------------------------------------
756
;---------------------------------------------------------------------
750
align 4
757
align 4
751
ProcLib_import:
758
ProcLib_import:
752
OpenDialog_Init         dd aOpenDialog_Init
759
OpenDialog_Init         dd aOpenDialog_Init
753
OpenDialog_Start        dd aOpenDialog_Start
760
OpenDialog_Start        dd aOpenDialog_Start
754
;OpenDialog__Version    dd aOpenDialog_Version
761
;OpenDialog__Version    dd aOpenDialog_Version
755
        dd      0
762
        dd      0
756
        dd      0
763
        dd      0
757
aOpenDialog_Init        db 'OpenDialog_init',0
764
aOpenDialog_Init        db 'OpenDialog_init',0
758
aOpenDialog_Start       db 'OpenDialog_start',0
765
aOpenDialog_Start       db 'OpenDialog_start',0
759
;aOpenDialog_Version    db 'Version_OpenDialog',0
766
;aOpenDialog_Version    db 'Version_OpenDialog',0
760
;---------------------------------------------------------------------
767
;---------------------------------------------------------------------
761
OpenDialog_data:
768
OpenDialog_data:
762
.type                   dd 0
769
.type                   dd 0
763
.procinfo               dd procinfo ;+4
770
.procinfo               dd procinfo ;+4
764
.com_area_name          dd communication_area_name ;+8
771
.com_area_name          dd communication_area_name ;+8
765
.com_area               dd 0 ;+12
772
.com_area               dd 0 ;+12
766
.opendir_pach           dd temp_dir_pach ;+16
773
.opendir_pach           dd temp_dir_pach ;+16
767
.dir_default_pach       dd communication_area_default_pach ;+20
774
.dir_default_pach       dd communication_area_default_pach ;+20
768
.start_path             dd open_dialog_path ;+24
775
.start_path             dd open_dialog_path ;+24
769
.draw_window            dd draw_window ;+28
776
.draw_window            dd draw_window ;+28
770
.status                 dd 0 ;+32
777
.status                 dd 0 ;+32
771
.openfile_pach          dd fname_buf ;+36
778
.openfile_pach          dd fname_buf ;+36
772
.filename_area          dd 0    ;+40
779
.filename_area          dd 0    ;+40
773
.filter_area            dd Filter
780
.filter_area            dd Filter
774
 
781
 
775
communication_area_name:
782
communication_area_name:
776
        db 'FFFFFFFF_open_dialog',0
783
        db 'FFFFFFFF_open_dialog',0
777
open_dialog_path:
784
open_dialog_path:
778
        db '/sys/File Managers/opendial',0
785
        db '/sys/File Managers/opendial',0
779
communication_area_default_pach:
786
communication_area_default_pach:
780
        db '/rd/1',0
787
        db '/rd/1',0
781
 
788
 
782
Filter:
789
Filter:
783
dd Filter.end - Filter
790
dd Filter.end - Filter
784
.1:
791
.1:
785
db 'RTF',0
792
db 'RTF',0
786
.end:
793
.end:
787
db 0
794
db 0
788
;---------------------------------------------------------------------
795
;---------------------------------------------------------------------
789
attrinfo:
796
attrinfo:
790
        dd      5
797
        dd      5
791
        dd      0
798
        dd      0
792
        dd      0
799
        dd      0
793
        dd      0
800
        dd      0
794
        dd      fileattr
801
        dd      fileattr
795
        db      0
802
        db      0
796
        dd      fileinfo.name
803
        dd      fileinfo.name
797
 
804
 
798
fileinfo:
805
fileinfo:
799
  dd 0
806
  dd 0
800
.block:
807
.block:
801
  dd 0
808
  dd 0
802
  dd 0
809
  dd 0
803
.size  dd 1
810
.size  dd 1
804
  dd I_END
811
  dd I_END
805
.name:
812
.name:
806
 
813
 
807
;  db '/HD/1/RTF/texts/index_ru.RTF',0
814
;  db '/HD/1/RTF/texts/index_ru.RTF',0
808
 
815
 
809
   rb  256-($-.name)
816
   rb  256-($-.name)
810
;---------------------------------------------------------------------
817
;---------------------------------------------------------------------
811
;blind db ?
818
;blind db ?
812
if RENDER eq PIX
819
if RENDER eq PIX
813
;  rd 2
820
;  rd 2
814
  Free rd 9
821
  Free rd 9
815
else
822
else
816
if RENDER eq BGI
823
if RENDER eq BGI
817
  FreeFontscale dd 0.07
824
  FreeFontscale dd 0.07
818
else
825
else
819
  Zoomscale dd 1.15
826
  Zoomscale dd 1.15
820
  FreeFontscale dd 0.04
827
  FreeFontscale dd 0.04
821
end if
828
end if
822
  Free BGIfree FONT_NAME,0,0,1.0,1.0,char,1,0x44000000,0
829
  Free BGIfree FONT_NAME,0,0,1.0,1.0,char,1,0x44000000,0
823
end if
830
end if
824
;I_END0:
831
;I_END0:
825
fname_buf:
832
fname_buf:
826
        rb      1024+16
833
        rb      1024+16
827
fileattr rd 40/4
834
fileattr rd 40/4
828
if BENCH eq 1
835
if BENCH eq 1
829
  bench dd ?
836
  bench dd ?
830
end if
837
end if
831
tail dd ?
838
tail dd ?
832
cGroup dd ?
839
cGroup dd ?
833
Chp:
840
Chp:
834
  CHP
841
  CHP
835
Pap:
842
Pap:
836
  PAP
843
  PAP
837
Sep:
844
Sep:
838
  SEP
845
  SEP
839
Dop:
846
Dop:
840
  DOP
847
  DOP
841
rds db ?
848
rds db ?
842
ris db ?
849
ris db ?
843
cbBin dd ?
850
cbBin dd ?
844
lParam dd ?
851
lParam dd ?
845
fSkipDestIfUnk db ?
852
fSkipDestIfUnk db ?
846
mode dd ?
853
mode dd ?
847
curheight dw ?
854
curheight dw ?
848
maxheight dw ?
855
maxheight dw ?
849
RetroBlock dd ?
856
RetroBlock dd ?
850
RetroSave:
857
RetroSave:
851
  SAVE
858
  SAVE
852
prcinfo rb 1024
859
prcinfo rb 1024
853
RetroPtr dd ?
860
RetroPtr dd ?
854
colorptr dd ?
861
colorptr dd ?
855
colortbl rd 16
862
colortbl rd 16
856
ct_end:
863
ct_end:
857
fname_size dd ?
864
fname_size dd ?
858
max_block dd ?
865
max_block dd ?
859
cur_block dd ?
866
cur_block dd ?
860
HDoc dd ?
867
HDoc dd ?
861
;HClick dd ?
868
;HClick dd ?
862
top dw ?
869
top dw ?
863
line_count dd ?
870
line_count dd ?
864
par_count  dd ?
871
par_count  dd ?
865
char db ?
872
char db ?
866
pitch db ?
873
pitch db ?
867
wSave dd ?
874
wSave dd ?
868
RetroXY dd ?
875
RetroXY dd ?
869
RetroGroup dd ?
876
RetroGroup dd ?
870
 
877
 
871
save_stack:
878
save_stack:
872
rb RTFSTACKSIZE
879
rb RTFSTACKSIZE
873
save_limit:
880
save_limit:
874
rb BGIFONTSIZE
881
rb BGIFONTSIZE
875
 
882
 
876
listptr dd ?
883
listptr dd ?
877
szKeyword rb 31
884
szKeyword rb 31
878
szParameter rb 21
885
szParameter rb 21
879
block_end dd ?
886
block_end dd ?
880
 
887
 
881
;---------------------------------------------------------------------
888
;---------------------------------------------------------------------
882
align   4
889
align   4
883
Box_lib_import:
890
Box_lib_import:
884
 
891
 
885
menu_bar_draw           dd aMenu_bar_draw
892
menu_bar_draw           dd aMenu_bar_draw
886
menu_bar_mouse          dd aMenu_bar_mouse
893
menu_bar_mouse          dd aMenu_bar_mouse
887
 
894
 
888
scrollbar_ver_draw      dd aScrollbar_ver_draw
895
scrollbar_ver_draw      dd aScrollbar_ver_draw
889
scrollbar_ver_mouse     dd aScrollbar_ver_mouse
896
scrollbar_ver_mouse     dd aScrollbar_ver_mouse
890
 
897
 
891
        dd 0
898
        dd 0
892
        dd 0
899
        dd 0
893
 
900
 
894
aMenu_bar_draw          db 'menu_bar_draw',0
901
aMenu_bar_draw          db 'menu_bar_draw',0
895
aMenu_bar_mouse         db 'menu_bar_mouse',0
902
aMenu_bar_mouse         db 'menu_bar_mouse',0
896
;aVersion_menu_bar       db 'version_menu_bar',0
903
;aVersion_menu_bar       db 'version_menu_bar',0
897
 
904
 
898
aScrollbar_ver_draw     db 'scrollbar_v_draw',0
905
aScrollbar_ver_draw     db 'scrollbar_v_draw',0
899
aScrollbar_ver_mouse    db 'scrollbar_v_mouse',0
906
aScrollbar_ver_mouse    db 'scrollbar_v_mouse',0
900
;---------------------------------------------------------------------
907
;---------------------------------------------------------------------
901
align   4
908
align   4
902
menu_data_1:
909
menu_data_1:
903
.type:          dd 0    ;+0
910
.type:          dd 0    ;+0
904
.x:
911
.x:
905
.size_x         dw 40   ;+4
912
.size_x         dw 40   ;+4
906
.start_x        dw 2    ;+6
913
.start_x        dw 2    ;+6
907
.y:
914
.y:
908
.size_y         dw 15   ;+8
915
.size_y         dw 15   ;+8
909
.start_y        dw 2    ;+10
916
.start_y        dw 2    ;+10
910
.text_pointer:  dd menu_text_area       ;0      ;+12
917
.text_pointer:  dd menu_text_area       ;0      ;+12
911
.pos_pointer:   dd menu_text_area.1     ;0      ;+16
918
.pos_pointer:   dd menu_text_area.1     ;0      ;+16
912
.text_end       dd menu_text_area.end   ;0      ;+20
919
.text_end       dd menu_text_area.end   ;0      ;+20
913
.mouse_pos      dd 0    ;+24
920
.mouse_pos      dd 0    ;+24
914
.mouse_keys     dd 0    ;+28
921
.mouse_keys     dd 0    ;+28
915
.x1:
922
.x1:
916
.size_x1        dw 40   ;+32
923
.size_x1        dw 40   ;+32
917
.start_x1       dw 2    ;+34
924
.start_x1       dw 2    ;+34
918
.y1:
925
.y1:
919
.size_y1        dw 100  ;+36
926
.size_y1        dw 100  ;+36
920
.start_y1       dw 18   ;+38
927
.start_y1       dw 18   ;+38
921
.bckg_col       dd 0xeeeeee     ;+40
928
.bckg_col       dd 0xeeeeee     ;+40
922
.frnt_col       dd 0xff ;+44
929
.frnt_col       dd 0xff ;+44
923
.menu_col       dd 0xffffff     ;+48
930
.menu_col       dd 0xffffff     ;+48
924
.select         dd 0    ;+52
931
.select         dd 0    ;+52
925
.out_select     dd 0    ;+56
932
.out_select     dd 0    ;+56
926
.buf_adress     dd 0    ;+60
933
.buf_adress     dd 0    ;+60
927
.procinfo       dd 0    ;+64
934
.procinfo       dd 0    ;+64
928
.click          dd 0    ;+68
935
.click          dd 0    ;+68
929
.cursor         dd 0    ;+72
936
.cursor         dd 0    ;+72
930
.cursor_old     dd 0    ;+76
937
.cursor_old     dd 0    ;+76
931
.interval       dd 16   ;+80
938
.interval       dd 16   ;+80
932
.cursor_max     dd 0    ;+84
939
.cursor_max     dd 0    ;+84
933
.extended_key   dd 0    ;+88
940
.extended_key   dd 0    ;+88
934
.menu_sel_col   dd 0x00cc00     ;+92
941
.menu_sel_col   dd 0x00cc00     ;+92
935
.bckg_text_col  dd 0    ;+96
942
.bckg_text_col  dd 0    ;+96
936
.frnt_text_col  dd 0xffffff     ;+100
943
.frnt_text_col  dd 0xffffff     ;+100
937
.mouse_keys_old dd 0    ;+104
944
.mouse_keys_old dd 0    ;+104
938
.font_height    dd 8    ;+108
945
.font_height    dd 8    ;+108
939
.cursor_out     dd 0    ;+112
946
.cursor_out     dd 0    ;+112
940
.get_mouse_flag dd 0    ;+116
947
.get_mouse_flag dd 0    ;+116
941
 
948
 
942
menu_text_area:
949
menu_text_area:
943
        db 'File',0
950
        db 'File',0
944
.1:
951
.1:
945
        db 'Open',0
952
        db 'Open',0
946
        db 'Exit',0
953
        db 'Exit',0
947
.end:
954
.end:
948
        db 0
955
        db 0
949
;---------------------------------------------------------------------
956
;---------------------------------------------------------------------
950
align   4
957
align   4
951
menu_data_2:
958
menu_data_2:
952
.type:          dd 0    ;+0
959
.type:          dd 0    ;+0
953
.x:
960
.x:
954
.size_x         dw 40   ;+4
961
.size_x         dw 40   ;+4
955
.start_x        dw 43   ;+6
962
.start_x        dw 43   ;+6
956
.y:
963
.y:
957
.size_y         dw 15   ;+8
964
.size_y         dw 15   ;+8
958
.start_y        dw 2    ;+10
965
.start_y        dw 2    ;+10
959
.text_pointer:  dd menu_text_area_2     ;0      ;+12
966
.text_pointer:  dd menu_text_area_2     ;0      ;+12
960
.pos_pointer:   dd menu_text_area_2.1   ;0      ;+16
967
.pos_pointer:   dd menu_text_area_2.1   ;0      ;+16
961
.text_end       dd menu_text_area_2.end ;0      ;+20
968
.text_end       dd menu_text_area_2.end ;0      ;+20
962
.mouse_pos      dd 0    ;+24
969
.mouse_pos      dd 0    ;+24
963
.mouse_keys     dd 0    ;+28
970
.mouse_keys     dd 0    ;+28
964
.x1:
971
.x1:
965
.size_x1        dw 50   ;+32
972
.size_x1        dw 50   ;+32
966
.start_x1       dw 43   ;+34
973
.start_x1       dw 43   ;+34
967
.y1:
974
.y1:
968
.size_y1        dw 100  ;+36
975
.size_y1        dw 100  ;+36
969
.start_y1       dw 18   ;+38
976
.start_y1       dw 18   ;+38
970
.bckg_col       dd 0xeeeeee     ;+40
977
.bckg_col       dd 0xeeeeee     ;+40
971
.frnt_col       dd 0xff ;+44
978
.frnt_col       dd 0xff ;+44
972
.menu_col       dd 0xffffff     ;+48
979
.menu_col       dd 0xffffff     ;+48
973
.select         dd 0    ;+52
980
.select         dd 0    ;+52
974
.out_select     dd 0    ;+56
981
.out_select     dd 0    ;+56
975
.buf_adress     dd 0    ;+60
982
.buf_adress     dd 0    ;+60
976
.procinfo       dd 0    ;+64
983
.procinfo       dd 0    ;+64
977
.click          dd 0    ;+68
984
.click          dd 0    ;+68
978
.cursor         dd 0    ;+72
985
.cursor         dd 0    ;+72
979
.cursor_old     dd 0    ;+76
986
.cursor_old     dd 0    ;+76
980
.interval       dd 16   ;+80
987
.interval       dd 16   ;+80
981
.cursor_max     dd 0    ;+84
988
.cursor_max     dd 0    ;+84
982
.extended_key   dd 0    ;+88
989
.extended_key   dd 0    ;+88
983
.menu_sel_col   dd 0x00cc00     ;+92
990
.menu_sel_col   dd 0x00cc00     ;+92
984
.bckg_text_col  dd 0    ;       +96
991
.bckg_text_col  dd 0    ;       +96
985
.frnt_text_col  dd 0xffffff     ;+100
992
.frnt_text_col  dd 0xffffff     ;+100
986
.mouse_keys_old dd 0    ;+104
993
.mouse_keys_old dd 0    ;+104
987
.font_height    dd 8    ;+108
994
.font_height    dd 8    ;+108
988
.cursor_out     dd 0    ;+112
995
.cursor_out     dd 0    ;+112
989
.get_mouse_flag dd 0    ;+116
996
.get_mouse_flag dd 0    ;+116
990
 
997
 
991
menu_text_area_2:
998
menu_text_area_2:
992
        db 'View',0
999
        db 'View',0
993
.1:
1000
.1:
994
        db 'Zoom +',0
1001
        db 'Zoom +',0
995
        db 'Zoom -',0
1002
        db 'Zoom -',0
996
        db ' > >',0
1003
        db ' > >',0
997
        db ' << ',0
1004
        db ' << ',0
998
        db 'Align',0
1005
        db 'Align',0
999
        db 'Color',0
1006
        db 'Color',0
1000
.end:
1007
.end:
1001
        db 0
1008
        db 0
1002
;---------------------------------------------------------------------
1009
;---------------------------------------------------------------------
1003
align   4
1010
align   4
1004
menu_data_3:
1011
menu_data_3:
1005
.type:          dd 0    ;+0
1012
.type:          dd 0    ;+0
1006
.x:
1013
.x:
1007
.size_x         dw 40   ;+4
1014
.size_x         dw 40   ;+4
1008
.start_x        dw 84   ;+6
1015
.start_x        dw 84   ;+6
1009
.y:
1016
.y:
1010
.size_y         dw 15   ;+8
1017
.size_y         dw 15   ;+8
1011
.start_y        dw 2    ;+10
1018
.start_y        dw 2    ;+10
1012
.text_pointer:  dd menu_text_area_3     ;0      ;+12
1019
.text_pointer:  dd menu_text_area_3     ;0      ;+12
1013
.pos_pointer:   dd menu_text_area_3.1   ;0      ;+16
1020
.pos_pointer:   dd menu_text_area_3.1   ;0      ;+16
1014
.text_end       dd menu_text_area_3.end ;0      ;+20
1021
.text_end       dd menu_text_area_3.end ;0      ;+20
1015
.mouse_pos      dd 0    ;+24
1022
.mouse_pos      dd 0    ;+24
1016
.mouse_keys     dd 0    ;+28
1023
.mouse_keys     dd 0    ;+28
1017
.x1:
1024
.x1:
1018
.size_x1        dw 40   ;+32
1025
.size_x1        dw 40   ;+32
1019
.start_x1       dw 84   ;+34
1026
.start_x1       dw 84   ;+34
1020
.y1:
1027
.y1:
1021
.size_y1        dw 100  ;+36
1028
.size_y1        dw 100  ;+36
1022
.start_y1       dw 18   ;+38
1029
.start_y1       dw 18   ;+38
1023
.bckg_col       dd 0xeeeeee     ;+40
1030
.bckg_col       dd 0xeeeeee     ;+40
1024
.frnt_col       dd 0xff ;+44
1031
.frnt_col       dd 0xff ;+44
1025
.menu_col       dd 0xffffff     ;+48
1032
.menu_col       dd 0xffffff     ;+48
1026
.select         dd 0    ;+52
1033
.select         dd 0    ;+52
1027
.out_select     dd 0    ;+56
1034
.out_select     dd 0    ;+56
1028
.buf_adress     dd 0    ;+60
1035
.buf_adress     dd 0    ;+60
1029
.procinfo       dd 0    ;+64
1036
.procinfo       dd 0    ;+64
1030
.click          dd 0    ;+68
1037
.click          dd 0    ;+68
1031
.cursor         dd 0    ;+72
1038
.cursor         dd 0    ;+72
1032
.cursor_old     dd 0    ;+76
1039
.cursor_old     dd 0    ;+76
1033
.interval       dd 16   ;+80
1040
.interval       dd 16   ;+80
1034
.cursor_max     dd 0    ;+84
1041
.cursor_max     dd 0    ;+84
1035
.extended_key   dd 0    ;+88
1042
.extended_key   dd 0    ;+88
1036
.menu_sel_col   dd 0x00cc00     ;+92
1043
.menu_sel_col   dd 0x00cc00     ;+92
1037
.bckg_text_col  dd 0    ;       +96
1044
.bckg_text_col  dd 0    ;       +96
1038
.frnt_text_col  dd 0xffffff     ;+100
1045
.frnt_text_col  dd 0xffffff     ;+100
1039
.mouse_keys_old dd 0    ;+104
1046
.mouse_keys_old dd 0    ;+104
1040
.font_height    dd 8    ;+108
1047
.font_height    dd 8    ;+108
1041
.cursor_out     dd 0    ;+112
1048
.cursor_out     dd 0    ;+112
1042
.get_mouse_flag dd 0    ;+116
1049
.get_mouse_flag dd 0    ;+116
1043
 
1050
 
1044
menu_text_area_3:
1051
menu_text_area_3:
1045
        db 'Help',0
1052
        db 'Help',0
1046
.1:
1053
.1:
1047
        db 'Home',0
1054
        db 'Home',0
1048
.end:
1055
.end:
1049
        db 0
1056
        db 0
1050
;---------------------------------------------------------------------
1057
;---------------------------------------------------------------------
1051
align   4
1058
align   4
1052
scroll_bar_data_vertical:
1059
scroll_bar_data_vertical:
1053
.x:
1060
.x:
1054
.size_x         dw scroll_width_size;+0
1061
.size_x         dw scroll_width_size;+0
1055
.start_x        dw WINW-25  ;+2
1062
.start_x        dw WINW-25  ;+2
1056
.y:
1063
.y:
1057
.size_y         dw WINH-45  ;+4
1064
.size_y         dw WINH-45  ;+4
1058
.start_y        dw 19   ;+6
1065
.start_y        dw 19   ;+6
1059
.btn_high       dd scroll_width_size    ;+8
1066
.btn_high       dd scroll_width_size    ;+8
1060
.type           dd 1    ;+12
1067
.type           dd 1    ;+12
1061
.max_area       dd 300       ;+16
1068
.max_area       dd 300       ;+16
1062
.cur_area       dd 50   ;+20
1069
.cur_area       dd 50   ;+20
1063
.position       dd 0    ;+24
1070
.position       dd 0    ;+24
1064
.bckg_col       dd 0xAAAAAA     ;+28
1071
.bckg_col       dd 0xAAAAAA     ;+28
1065
.frnt_col       dd 0xCCCCCC     ;+32
1072
.frnt_col       dd 0xCCCCCC     ;+32
1066
.line_col       dd 0    ;+36
1073
.line_col       dd 0    ;+36
1067
.redraw         dd 0    ;+40
1074
.redraw         dd 0    ;+40
1068
.delta          dw 0    ;+44
1075
.delta          dw 0    ;+44
1069
.delta2         dw 0    ;+46
1076
.delta2         dw 0    ;+46
1070
.run_x:
1077
.run_x:
1071
.r_size_x       dw 0    ;+48
1078
.r_size_x       dw 0    ;+48
1072
.r_start_x      dw 0    ;+50
1079
.r_start_x      dw 0    ;+50
1073
.run_y:
1080
.run_y:
1074
.r_size_y       dw 0    ;+52
1081
.r_size_y       dw 0    ;+52
1075
.r_start_y      dw 0    ;+54
1082
.r_start_y      dw 0    ;+54
1076
.m_pos          dd 0    ;+56
1083
.m_pos          dd 0    ;+56
1077
.m_pos_2        dd 0    ;+60
1084
.m_pos_2        dd 0    ;+60
1078
.m_keys         dd 0    ;+64
1085
.m_keys         dd 0    ;+64
1079
.run_size       dd 0    ;+68
1086
.run_size       dd 0    ;+68
1080
.position2      dd 0    ;+72
1087
.position2      dd 0    ;+72
1081
.work_size      dd 0    ;+76
1088
.work_size      dd 0    ;+76
1082
.all_redraw     dd 0    ;+80
1089
.all_redraw     dd 0    ;+80
1083
.ar_offset      dd AR_OFFSET   ;+84
1090
.ar_offset      dd AR_OFFSET   ;+84
1084
;---------------------------------------------------------------------
1091
;---------------------------------------------------------------------
1085
I_END0:
1092
I_END0:
1086
I_END:                             ; ¬¥âª  ª®­æ  ¯à®£à ¬¬ë
1093
I_END:                             ; ¬¥âª  ª®­æ  ¯à®£à ¬¬ë
1087
 
1094
 
1088
procinfo process_information
1095
procinfo process_information
1089
rb RTFSIZE
1096
rb RTFSIZE
1090
esp1:
1097
esp1:
1091
rb ESPSIZE
1098
rb ESPSIZE
1092
procinfo2 process_information
1099
procinfo2 process_information
1093
;---------------------------------------------------------------------
1100
;---------------------------------------------------------------------
1094
temp_dir_pach:
1101
temp_dir_pach:
1095
        rb 4096
1102
        rb 4096
1096
cur_dir_path:
1103
cur_dir_path:
1097
        rb 4096
1104
        rb 4096
1098
library_path:
1105
library_path:
1099
        rb 4096
1106
        rb 4096
1100
;---------------------------------------------------------------------
1107
;---------------------------------------------------------------------
1101
    rb ESPSIZE                      ;stack
1108
    rb ESPSIZE                      ;stack
1102
esp_end:
1109
esp_end:
1103
sys_mem:
1110
sys_mem: