Subversion Repositories Kolibri OS

Rev

Rev 8236 | Only display areas with differences | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed

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