Subversion Repositories Kolibri OS

Rev

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

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