Subversion Repositories Kolibri OS

Rev

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

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