Subversion Repositories Kolibri OS

Rev

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

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