Subversion Repositories Kolibri OS

Rev

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

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