Subversion Repositories Kolibri OS

Rev

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

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