Rev 5709 | Go to most recent revision | Only display areas with differences | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 5709 | Rev 5778 | ||
---|---|---|---|
1 | #ifndef AUTOBUILD |
1 | #ifndef AUTOBUILD |
2 | #include "lang.h--" |
2 | #include "lang.h--" |
3 | #endif |
3 | #endif |
4 | 4 | ||
5 | #define MEMSIZE 0x100000 |
5 | #define MEMSIZE 0x100000 |
6 | #include "..\lib\kolibri.h" |
6 | #include "..\lib\kolibri.h" |
7 | #include "..\lib\strings.h" |
7 | #include "..\lib\strings.h" |
8 | #include "..\lib\mem.h" |
8 | #include "..\lib\mem.h" |
9 | #include "..\lib\file_system.h" |
9 | #include "..\lib\file_system.h" |
10 | #include "..\lib\dll.h" |
10 | #include "..\lib\dll.h" |
11 | #include "..\lib\gui.h" |
11 | #include "..\lib\gui.h" |
12 | #include "..\lib\list_box.h" |
12 | #include "..\lib\list_box.h" |
13 | 13 | ||
14 | #include "..\lib\obj\box_lib.h" |
14 | #include "..\lib\obj\box_lib.h" |
15 | #include "..\lib\obj\proc_lib.h" |
15 | #include "..\lib\obj\proc_lib.h" |
16 | #include "..\lib\obj\libio_lib.h" |
16 | #include "..\lib\obj\libio_lib.h" |
17 | 17 | ||
18 | #ifdef LANG_RUS |
18 | #ifdef LANG_RUS |
19 | ?define T_FILE " ©«" |
19 | ?define T_FILE " ©«" |
20 | ?define T_TYPE "¨¯" |
20 | ?define T_TYPE "¨¯" |
21 | ?define T_SIZE " §¬¥à" |
21 | ?define T_SIZE " §¬¥à" |
22 | ?define MENU1 " ©«" |
22 | ?define MENU1 " ©«" |
23 | ?define MENU1_SUBMENU1 "âªàëâì" |
23 | ?define MENU1_SUBMENU1 "âªàëâì" |
24 | ?define MENU1_SUBMENU2 " ªàëâì" |
24 | ?define MENU1_SUBMENU2 " ªàëâì" |
25 | ?define MENU1_SUBMENU3 "¢®©á⢠" |
25 | ?define MENU1_SUBMENU3 "¢®©á⢠" |
26 | ?define MENU1_SUBMENU4 "ë室" |
26 | ?define MENU1_SUBMENU4 "ë室" |
27 | #else |
27 | #else |
28 | ?define T_FILE "File" |
28 | ?define T_FILE "File" |
29 | ?define T_TYPE "Type" |
29 | ?define T_TYPE "Type" |
30 | ?define T_SIZE "Size" |
30 | ?define T_SIZE "Size" |
31 | ?define MENU1 "File" |
31 | ?define MENU1 "File" |
32 | ?define MENU1_SUBMENU1 "Open" |
32 | ?define MENU1_SUBMENU1 "Open" |
33 | ?define MENU1_SUBMENU2 "Close" |
33 | ?define MENU1_SUBMENU2 "Close" |
34 | ?define MENU1_SUBMENU3 "Properties" |
34 | ?define MENU1_SUBMENU3 "Properties" |
35 | ?define MENU1_SUBMENU4 "Exit" |
35 | ?define MENU1_SUBMENU4 "Exit" |
36 | #endif |
36 | #endif |
37 | 37 | ||
38 | #ifdef LANG_RUS |
38 | #ifdef LANG_RUS |
39 | struct menu_text_struct |
39 | struct menu_text_struct |
40 | { |
40 | { |
41 | char menu[5]; |
41 | char menu[5]; |
42 | char sub_menu1[8]; |
42 | char sub_menu1[8]; |
43 | char sub_menu2[8]; |
43 | char sub_menu2[8]; |
44 | //char sub_menu3[9]; |
44 | //char sub_menu3[9]; |
45 | char sub_menu4[6]; |
45 | char sub_menu4[6]; |
46 | byte end; |
46 | byte end; |
47 | }; |
47 | }; |
48 | #else |
48 | #else |
49 | struct menu_text_struct |
49 | struct menu_text_struct |
50 | { |
50 | { |
51 | char menu[5]; |
51 | char menu[5]; |
52 | char sub_menu1[5]; |
52 | char sub_menu1[5]; |
53 | char sub_menu2[6]; |
53 | char sub_menu2[6]; |
54 | //char sub_menu3[11]; |
54 | //char sub_menu3[11]; |
55 | char sub_menu4[5]; |
55 | char sub_menu4[5]; |
56 | byte end; |
56 | byte end; |
57 | }; |
57 | }; |
58 | #endif |
58 | #endif |
59 | 59 | ||
60 | #define TOPPANELH 19 |
60 | #define TOPPANELH 19 |
61 | #define BOTPANELH 10 |
61 | #define BOTPANELH 10 |
62 | #define WIN_W 600 |
62 | #define WIN_W 600 |
63 | #define WIN_H 400 |
63 | #define WIN_H 400 |
64 | 64 | ||
65 | #define TITLE "Calypte v0.13" |
65 | #define TITLE "Calypte v0.13" |
66 | char win_title[4096] = TITLE; |
66 | char win_title[4096] = TITLE; |
67 | proc_info Form; |
67 | proc_info Form; |
68 | 68 | ||
69 | dword old_width,old_height; |
69 | dword old_width,old_height; |
70 | llist tview; |
70 | llist tview; |
71 | 71 | ||
72 | byte active_properties = 0; |
72 | byte active_properties = 0; |
73 | dword properties_window; |
73 | dword properties_window; |
74 | 74 | ||
75 | #include "include\gui.h" |
75 | #include "include\gui.h" |
76 | #include "include\properties.h" |
76 | #include "include\properties.h" |
77 | // #include "include\top_menu.h" |
77 | // #include "include\top_menu.h" |
78 | // #include "include\open_dial.h" |
78 | // #include "include\open_dial.h" |
79 | 79 | ||
80 | struct filter |
80 | struct filter |
81 | { |
81 | { |
82 | dword size; |
82 | dword size; |
83 | char ext1[4]; |
83 | char ext1[4]; |
84 | //char ext2[4]; |
84 | //char ext2[4]; |
85 | //char ext3[4]; |
85 | //char ext3[4]; |
86 | //char ext4[4]; |
86 | //char ext4[4]; |
87 | byte end; |
87 | byte end; |
88 | }; |
88 | }; |
89 | 89 | ||
90 | filter filter2; |
90 | filter filter2; |
91 | menu_text_struct menu_text_area1; |
91 | menu_text_struct menu_text_area1; |
92 | 92 | ||
93 | int read=0; |
93 | int read=0; |
94 | 94 | ||
95 | 95 | ||
96 | proc_info pr_inf; |
96 | proc_info pr_inf; |
97 | char communication_area_name[] = "FFFFFFFF_open_dialog"; |
97 | char communication_area_name[] = "FFFFFFFF_open_dialog"; |
98 | byte plugin_path[4096]; |
98 | byte plugin_path[4096]; |
99 | char default_dir[] = "/rd/1"; |
99 | char default_dir[] = "/rd/1"; |
100 | char open_dialog_path[] = "/rd/1/File managers/opendial"; //opendial |
100 | char open_dialog_path[] = "/rd/1/File managers/opendial"; //opendial |
101 | byte openfile_path[2048]; |
101 | byte openfile_path[2048]; |
102 | byte filename_area[4096]; |
102 | byte filename_area[4096]; |
103 | 103 | ||
104 | opendialog o_dialog = {0, #pr_inf, #communication_area_name, 0, #plugin_path, #default_dir, #open_dialog_path, #draw_window, 0, #openfile_path, #filename_area, #filter2, 420, 200, 320, 120}; |
104 | opendialog o_dialog = {0, #pr_inf, #communication_area_name, 0, #plugin_path, #default_dir, #open_dialog_path, #draw_window, 0, #openfile_path, #filename_area, #filter2, 420, 200, 320, 120}; |
105 | 105 | ||
106 | dword bufpointer; |
106 | dword bufpointer; |
107 | dword bufsize; |
107 | dword bufsize; |
108 | dword draw_sruct; |
108 | dword draw_sruct; |
109 | 109 | ||
110 | menu_data menudata1 = {0, 40, 2, 15, 2, #menu_text_area1.menu, #menu_text_area1.sub_menu1, #menu_text_area1.end, 0, 0, 80, 2, 100, 18, 0xEEEEEE, 0xFF, 0xEEEEEE, 0, 0, 0, #Form, 0, 0, 0, 16, 0, 0, 0x00CC00, 0, 0xFFFFFF, 0, 8, 0, 0}; |
110 | menu_data menudata1 = {0, 40, 2, 15, 2, #menu_text_area1.menu, #menu_text_area1.sub_menu1, #menu_text_area1.end, 0, 0, 80, 2, 100, 18, 0xEEEEEE, 0xFF, 0xEEEEEE, 0, 0, 0, #Form, 0, 0, 0, 16, 0, 0, 0x00CC00, 0, 0xFFFFFF, 0, 8, 0, 0}; |
111 | 111 | ||
112 | void main() |
112 | void main() |
113 | { |
113 | { |
114 | int id; |
114 | int id; |
115 | 115 | ||
116 | strcpy(#filter2.ext1, "TXT"); |
116 | strcpy(#filter2.ext1, "TXT"); |
117 | //strcpy(#filter2.ext2, "ASM"); |
117 | //strcpy(#filter2.ext2, "ASM"); |
118 | //strcpy(#filter2.ext3, "INC\0"); |
118 | //strcpy(#filter2.ext3, "INC\0"); |
119 | //strcpy(#filter2.ext4, "\0"); |
119 | //strcpy(#filter2.ext4, "\0"); |
120 | filter2.size = 8; |
120 | filter2.size = 8; |
121 | filter2.end = 0; |
121 | filter2.end = 0; |
122 | 122 | ||
123 | strcpy(#menu_text_area1.menu, MENU1); |
123 | strcpy(#menu_text_area1.menu, MENU1); |
124 | strcpy(#menu_text_area1.sub_menu1, MENU1_SUBMENU1); |
124 | strcpy(#menu_text_area1.sub_menu1, MENU1_SUBMENU1); |
125 | strcpy(#menu_text_area1.sub_menu2, MENU1_SUBMENU2); |
125 | strcpy(#menu_text_area1.sub_menu2, MENU1_SUBMENU2); |
126 | //strcpy(#menu_text_area1.sub_menu3, MENU1_SUBMENU3); |
126 | //strcpy(#menu_text_area1.sub_menu3, MENU1_SUBMENU3); |
127 | strcpy(#menu_text_area1.sub_menu4, MENU1_SUBMENU4); |
127 | strcpy(#menu_text_area1.sub_menu4, MENU1_SUBMENU4); |
128 | menu_text_area1.end = 0; |
128 | menu_text_area1.end = 0; |
129 | 129 | ||
130 | load_dll(boxlib, #box_lib_init,0); |
130 | load_dll(boxlib, #box_lib_init,0); |
131 | load_dll(libio, #libio_init,1); |
131 | load_dll(libio, #libio_init,1); |
132 | load_dll(Proc_lib, #OpenDialog_init,0); |
132 | load_dll(Proc_lib, #OpenDialog_init,0); |
133 | OpenDialog_init stdcall (#o_dialog); |
133 | OpenDialog_init stdcall (#o_dialog); |
134 | SetEventMask(0x27); |
134 | SetEventMask(0x27); |
135 | loop() |
135 | loop() |
136 | { |
136 | { |
137 | switch(WaitEvent()) |
137 | switch(WaitEvent()) |
138 | { |
138 | { |
139 | case evMouse: |
139 | case evMouse: |
140 | mouse.get(); |
140 | mouse.get(); |
141 | if (tview.MouseScrollNoSelection(mouse.vert)) DrawText(); |
141 | if (tview.MouseScroll(mouse.vert)) DrawText(); |
142 | 142 | ||
143 | menu_bar_mouse stdcall (#menudata1); |
143 | menu_bar_mouse stdcall (#menudata1); |
144 | if (menudata1.click) |
144 | if (menudata1.click) |
145 | { |
145 | { |
146 | switch(menudata1.cursor_out) |
146 | switch(menudata1.cursor_out) |
147 | { |
147 | { |
148 | case 1: |
148 | case 1: |
149 | OpenDialog_start stdcall (#o_dialog); |
149 | OpenDialog_start stdcall (#o_dialog); |
150 | OpenFile(#openfile_path); |
150 | OpenFile(#openfile_path); |
151 | Prepare(); |
151 | Prepare(); |
152 | draw_window(); |
152 | draw_window(); |
153 | break; |
153 | break; |
154 | case 2: |
154 | case 2: |
155 | read = 0; |
155 | read = 0; |
156 | tview.current = 0; |
156 | tview.current = 0; |
157 | strcpy(#win_title, TITLE); |
157 | strcpy(#win_title, TITLE); |
158 | FreeBuf(); |
158 | FreeBuf(); |
159 | draw_window(); |
159 | draw_window(); |
160 | break; |
160 | break; |
161 | case 3: |
161 | case 3: |
162 | if (!active_properties) |
162 | if (!active_properties) |
163 | { |
163 | { |
164 | SwitchToAnotherThread(); |
164 | SwitchToAnotherThread(); |
165 | properties_window = CreateThread(#properties_dialog, #properties_stak+4092); |
165 | properties_window = CreateThread(#properties_dialog, #properties_stak+4092); |
166 | break; |
166 | break; |
167 | } |
167 | } |
168 | else |
168 | else |
169 | { |
169 | { |
170 | ActivateWindow(GetProcessSlot(properties_window)); |
170 | ActivateWindow(GetProcessSlot(properties_window)); |
171 | } |
171 | } |
172 | break; |
172 | break; |
173 | case 4: |
173 | case 4: |
174 | ExitProcess(); |
174 | ExitProcess(); |
175 | } |
175 | } |
176 | } |
176 | } |
177 | break; |
177 | break; |
178 | 178 | ||
179 | case evButton: |
179 | case evButton: |
180 | id=GetButtonID(); |
180 | id=GetButtonID(); |
181 | if (id==1) ExitProcess(); |
181 | if (id==1) ExitProcess(); |
182 | break; |
182 | break; |
183 | 183 | ||
184 | case evKey: |
184 | case evKey: |
185 | if (Form.status_window>2) break; |
185 | if (Form.status_window>2) break; |
186 | GetKeys(); |
186 | GetKeys(); |
187 | if (tview.ProcessKey(key_scancode)) DrawText(); |
187 | if (tview.ProcessKey(key_scancode)) DrawText(); |
188 | if (TestBit(key_modifier, 2)) |
188 | if (TestBit(key_modifier, 2)) |
189 | { |
189 | { |
190 | switch(key_scancode) |
190 | switch(key_scancode) |
191 | { |
191 | { |
192 | case 024: //Ctrl+O |
192 | case 024: //Ctrl+O |
193 | OpenDialog_start stdcall (#o_dialog); |
193 | OpenDialog_start stdcall (#o_dialog); |
194 | OpenFile(#openfile_path); |
194 | OpenFile(#openfile_path); |
195 | Prepare(); |
195 | Prepare(); |
196 | draw_window(); |
196 | draw_window(); |
197 | break; |
197 | break; |
198 | } |
198 | } |
199 | break; |
199 | break; |
200 | } |
200 | } |
201 | switch (key_scancode) |
201 | switch (key_scancode) |
202 | { |
202 | { |
203 | /*case SCAN_CODE_HOME: |
203 | /*case SCAN_CODE_HOME: |
204 | case SCAN_CODE_END: |
204 | case SCAN_CODE_END: |
205 | case SCAN_CODE_UP: |
205 | case SCAN_CODE_UP: |
206 | case SCAN_CODE_DOWN: |
206 | case SCAN_CODE_DOWN: |
207 | if (tview.ProcessKey(key_scancode)) DrawText(); |
207 | if (tview.ProcessKey(key_scancode)) DrawText(); |
208 | break;*/ |
208 | break;*/ |
209 | case SCAN_CODE_PGUP: |
209 | case SCAN_CODE_PGUP: |
210 | if (!tview.current) break; |
210 | if (!tview.current) break; |
211 | if (tview.current |
211 | if (tview.current |
212 | else tview.current = tview.current-tview.visible; |
212 | else tview.current = tview.current-tview.visible; |
213 | DrawText(); |
213 | DrawText(); |
214 | break; |
214 | break; |
215 | case SCAN_CODE_PGDN: |
215 | case SCAN_CODE_PGDN: |
216 | if (tview.current+tview.visible>tview.count) break; |
216 | if (tview.current+tview.visible>tview.count) break; |
217 | tview.current = tview.current+tview.visible; |
217 | tview.current = tview.current+tview.visible; |
218 | DrawText(); |
218 | DrawText(); |
219 | break; |
219 | break; |
220 | } |
220 | } |
221 | break; |
221 | break; |
222 | 222 | ||
223 | case evReDraw: |
223 | case evReDraw: |
224 | draw_window(); |
224 | draw_window(); |
225 | break; |
225 | break; |
226 | } |
226 | } |
227 | } |
227 | } |
228 | } |
228 | } |
229 | 229 | ||
230 | 230 | ||
231 | void draw_window() |
231 | void draw_window() |
232 | { |
232 | { |
233 | system.color.get(); |
233 | system.color.get(); |
234 | DefineAndDrawWindow(GetScreenWidth()-WIN_W/2,GetScreenHeight()-WIN_H/2,WIN_W,WIN_H,0x73,0xFFFFFF,#win_title); |
234 | DefineAndDrawWindow(GetScreenWidth()-WIN_W/2,GetScreenHeight()-WIN_H/2,WIN_W,WIN_H,0x73,0xFFFFFF,#win_title); |
235 | GetProcessInfo(#Form, SelfInfo); |
235 | GetProcessInfo(#Form, SelfInfo); |
236 | if (Form.status_window>2) return; |
236 | if (Form.status_window>2) return; |
237 | tview.SetSizes(0, TOPPANELH, Form.cwidth, Form.cheight-BOTPANELH-TOPPANELH, 12); |
237 | tview.SetSizes(0, TOPPANELH, Form.cwidth, Form.cheight-BOTPANELH-TOPPANELH, 12); |
238 | DrawBar(0, 0, Form.cwidth, TOPPANELH, system.color.work); |
238 | DrawBar(0, 0, Form.cwidth, TOPPANELH, system.color.work); |
239 | DrawBar(0, Form.cheight-BOTPANELH, Form.cwidth, BOTPANELH, system.color.work); |
239 | DrawBar(0, Form.cheight-BOTPANELH, Form.cwidth, BOTPANELH, system.color.work); |
240 | 240 | ||
241 | menudata1.bckg_col = system.color.work; |
241 | menudata1.bckg_col = system.color.work; |
242 | menu_bar_draw stdcall (#menudata1); |
242 | menu_bar_draw stdcall (#menudata1); |
243 | 243 | ||
244 | if (old_width!=Form.width) || (old_height!=Form.height) |
244 | if (old_width!=Form.width) || (old_height!=Form.height) |
245 | { |
245 | { |
246 | old_width = Form.width; |
246 | old_width = Form.width; |
247 | old_height = Form.height; |
247 | old_height = Form.height; |
248 | if (read==1) Prepare(); |
248 | if (read==1) Prepare(); |
249 | tview.debug_values(); |
249 | tview.debug_values(); |
250 | } |
250 | } |
251 | if (read==1) |
251 | if (read==1) |
252 | { |
252 | { |
253 | DrawText(); |
253 | DrawText(); |
254 | } |
254 | } |
255 | else DrawBar(tview.x, tview.y, tview.w, tview.h, 0xFFFFFF); |
255 | else DrawBar(tview.x, tview.y, tview.w, tview.h, 0xFFFFFF); |
256 | } |
256 | } |
257 | 257 | ||
258 | void OpenFile(dword path) |
258 | void OpenFile(dword path) |
259 | { |
259 | { |
260 | strcpy(#win_title, TITLE); |
260 | strcpy(#win_title, TITLE); |
261 | strcat(#win_title, " - "); |
261 | strcat(#win_title, " - "); |
262 | strcat(#win_title, path); |
262 | strcat(#win_title, path); |
263 | file_size stdcall (path); |
263 | file_size stdcall (path); |
264 | bufsize = EBX; |
264 | bufsize = EBX; |
265 | if (bufsize) |
265 | if (bufsize) |
266 | { |
266 | { |
267 | mem_Free(bufpointer); |
267 | mem_Free(bufpointer); |
268 | bufpointer = mem_Alloc(bufsize); |
268 | bufpointer = mem_Alloc(bufsize); |
269 | ReadFile(0, bufsize, bufpointer, path); |
269 | ReadFile(0, bufsize, bufpointer, path); |
270 | read=1; |
270 | read=1; |
271 | } |
271 | } |
272 | } |
272 | } |
273 | 273 | ||
274 | void FreeBuf() |
274 | void FreeBuf() |
275 | { |
275 | { |
276 | int i; |
276 | int i; |
277 | for (i=0; i |
277 | for (i=0; i |
278 | { |
278 | { |
279 | mem_Free(DSDWORD[i*4+draw_sruct]); |
279 | mem_Free(DSDWORD[i*4+draw_sruct]); |
280 | } |
280 | } |
281 | mem_Free(draw_sruct); |
281 | mem_Free(draw_sruct); |
282 | mem_Free(bufpointer); |
282 | mem_Free(bufpointer); |
283 | } |
283 | } |
284 | 284 | ||
285 | void Prepare() |
285 | void Prepare() |
286 | { |
286 | { |
287 | int i, sub_pos; |
287 | int i, sub_pos; |
288 | static int cur_pos; |
288 | static int cur_pos; |
289 | int len_str = 0; |
289 | int len_str = 0; |
290 | byte do_eof = 0; |
290 | byte do_eof = 0; |
291 | word bukva[2]; |
291 | word bukva[2]; |
292 | dword address; |
292 | dword address; |
293 | tview.count = 0; |
293 | tview.count = 0; |
294 | while(1) |
294 | while(1) |
295 | { |
295 | { |
296 | while(1) |
296 | while(1) |
297 | { |
297 | { |
298 | bukva = DSBYTE[bufpointer+cur_pos+len_str]; |
298 | bukva = DSBYTE[bufpointer+cur_pos+len_str]; |
299 | if (bukva=='\0') |
299 | if (bukva=='\0') |
300 | { |
300 | { |
301 | do_eof = 1; |
301 | do_eof = 1; |
302 | break; |
302 | break; |
303 | } |
303 | } |
304 | if (bukva==0x0a) break; |
304 | if (bukva==0x0a) break; |
305 | else len_str++; |
305 | else len_str++; |
306 | } |
306 | } |
307 | if (len_str<=tview.column_max) |
307 | if (len_str<=tview.column_max) |
308 | { |
308 | { |
309 | cur_pos=cur_pos+len_str+1; |
309 | cur_pos=cur_pos+len_str+1; |
310 | tview.count++; |
310 | tview.count++; |
311 | } |
311 | } |
312 | else |
312 | else |
313 | { |
313 | { |
314 | cur_pos=cur_pos+tview.column_max; |
314 | cur_pos=cur_pos+tview.column_max; |
315 | tview.count++; |
315 | tview.count++; |
316 | } |
316 | } |
317 | len_str = 0; |
317 | len_str = 0; |
318 | if (do_eof) break; |
318 | if (do_eof) break; |
319 | } |
319 | } |
320 | mem_Free(draw_sruct); |
320 | mem_Free(draw_sruct); |
321 | draw_sruct = mem_Alloc(tview.count*4); |
321 | draw_sruct = mem_Alloc(tview.count*4); |
322 | cur_pos=0; |
322 | cur_pos=0; |
323 | sub_pos=0; |
323 | sub_pos=0; |
324 | len_str = 0; |
324 | len_str = 0; |
325 | do_eof = 0; |
325 | do_eof = 0; |
326 | while(1) |
326 | while(1) |
327 | { |
327 | { |
328 | while(1) |
328 | while(1) |
329 | { |
329 | { |
330 | bukva = DSBYTE[bufpointer+cur_pos+len_str]; |
330 | bukva = DSBYTE[bufpointer+cur_pos+len_str]; |
331 | if (bukva=='\0') |
331 | if (bukva=='\0') |
332 | { |
332 | { |
333 | do_eof = 1; |
333 | do_eof = 1; |
334 | break; |
334 | break; |
335 | } |
335 | } |
336 | if (bukva==0x0a) break; |
336 | if (bukva==0x0a) break; |
337 | else len_str++; |
337 | else len_str++; |
338 | } |
338 | } |
339 | if (len_str<=tview.column_max) |
339 | if (len_str<=tview.column_max) |
340 | { |
340 | { |
341 | address = mem_Alloc(len_str+1); |
341 | address = mem_Alloc(len_str+1); |
342 | ESDWORD[sub_pos*4+draw_sruct] = address; |
342 | ESDWORD[sub_pos*4+draw_sruct] = address; |
343 | strlcpy(DSDWORD[sub_pos*4+draw_sruct], bufpointer+cur_pos, len_str); |
343 | strlcpy(DSDWORD[sub_pos*4+draw_sruct], bufpointer+cur_pos, len_str); |
344 | cur_pos=cur_pos+len_str+1; |
344 | cur_pos=cur_pos+len_str+1; |
345 | sub_pos++; |
345 | sub_pos++; |
346 | } |
346 | } |
347 | else |
347 | else |
348 | { |
348 | { |
349 | address = mem_Alloc(len_str+1); |
349 | address = mem_Alloc(len_str+1); |
350 | ESDWORD[sub_pos*4+draw_sruct] = address; |
350 | ESDWORD[sub_pos*4+draw_sruct] = address; |
351 | strlcpy(DSDWORD[sub_pos*4+draw_sruct], bufpointer+cur_pos, tview.column_max); |
351 | strlcpy(DSDWORD[sub_pos*4+draw_sruct], bufpointer+cur_pos, tview.column_max); |
352 | cur_pos=cur_pos+tview.column_max; |
352 | cur_pos=cur_pos+tview.column_max; |
353 | sub_pos++; |
353 | sub_pos++; |
354 | } |
354 | } |
355 | len_str = 0; |
355 | len_str = 0; |
356 | if (cur_pos>=bufsize-1) break; |
356 | if (cur_pos>=bufsize-1) break; |
357 | } |
357 | } |
358 | cur_pos=0; |
358 | cur_pos=0; |
359 | } |
359 | } |
360 | 360 | ||
361 | void DrawText() |
361 | void DrawText() |
362 | { |
362 | { |
363 | int i, top, num_line; |
363 | int i, top, num_line; |
364 | if (tview.count |
364 | if (tview.count |
365 | else |
365 | else |
366 | { |
366 | { |
367 | if (tview.count-tview.current<=tview.visible) top = tview.count-tview.current-1; |
367 | if (tview.count-tview.current<=tview.visible) top = tview.count-tview.current-1; |
368 | else top = tview.visible; |
368 | else top = tview.visible; |
369 | } |
369 | } |
370 | DrawBar(tview.x, tview.y, tview.w, 3, 0xFFFFFF); |
370 | DrawBar(tview.x, tview.y, tview.w, 3, 0xFFFFFF); |
371 | for (i=0, num_line = tview.current; i |
371 | for (i=0, num_line = tview.current; i |
372 | { |
372 | { |
373 | DrawBar(tview.x, i * tview.line_h + tview.y + 3, tview.w, tview.line_h, 0xFFFFFF); |
373 | DrawBar(tview.x, i * tview.line_h + tview.y + 3, tview.w, tview.line_h, 0xFFFFFF); |
374 | WriteText(tview.x + 2, i * tview.line_h + tview.y + 3, 0x80, 0x000000, DSDWORD[num_line*4+draw_sruct]); |
374 | WriteText(tview.x + 2, i * tview.line_h + tview.y + 3, 0x80, 0x000000, DSDWORD[num_line*4+draw_sruct]); |
375 | } |
375 | } |
376 | DrawBar(0, i * tview.line_h + tview.y + 3, tview.w, -i* tview.line_h + tview.h, 0xFFFFFF); |
376 | DrawBar(0, i * tview.line_h + tview.y + 3, tview.w, -i* tview.line_h + tview.h, 0xFFFFFF); |
377 | } |
377 | } |
378 | 378 | ||
379 | stop: |
379 | stop: |
380 | char properties_stak[4096];=tview.visible)>=tview.column_max) |
380 | char properties_stak[4096];=tview.visible)>=tview.column_max) |
381 | >=tview.column_max) |
381 | >=tview.column_max) |
382 | > |
382 | > |