Rev 6021 | Rev 6058 | Go to most recent revision | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 6021 | Rev 6045 | ||
---|---|---|---|
Line 13... | Line 13... | ||
13 | #include "..\lib\draw_buf.h" |
13 | #include "..\lib\draw_buf.h" |
14 | #include "..\lib\list_box.h" |
14 | #include "..\lib\list_box.h" |
15 | #include "..\lib\cursor.h" |
15 | #include "..\lib\cursor.h" |
16 | #include "..\lib\collection.h" |
16 | #include "..\lib\collection.h" |
17 | #include "..\lib\font.h" |
17 | #include "..\lib\font.h" |
- | 18 | #include "..\lib\menu.h" |
|
Line 18... | Line 19... | ||
18 | 19 | ||
19 | //*.obj libraries |
20 | //*.obj libraries |
20 | #include "..\lib\obj\box_lib.h" |
21 | #include "..\lib\obj\box_lib.h" |
21 | #include "..\lib\obj\libio_lib.h" |
22 | #include "..\lib\obj\libio_lib.h" |
Line 27... | Line 28... | ||
27 | #include "..\lib\patterns\history.h" |
28 | #include "..\lib\patterns\history.h" |
Line 28... | Line 29... | ||
28 | 29 | ||
Line 29... | Line 30... | ||
29 | char homepage[] = FROM "html\\homepage.htm"; |
30 | char homepage[] = FROM "html\\homepage.htm"; |
30 | 31 | ||
31 | #ifdef LANG_RUS |
32 | #ifdef LANG_RUS |
32 | char version[]=" ¥ªáâ®¢ë© ¡à 㧥à 1.42"; |
33 | char version[]=" ¥ªáâ®¢ë© ¡à 㧥à 1.48"; |
33 | ?define IMAGES_CACHE_CLEARED "íè ª à⨮ª ®ç¨é¥" |
34 | ?define IMAGES_CACHE_CLEARED "íè ª à⨮ª ®ç¨é¥" |
34 | ?define T_LAST_SLIDE "â® ¯®á«¥¤¨© á« ©¤" |
35 | ?define T_LAST_SLIDE "â® ¯®á«¥¤¨© á« ©¤" |
35 | char loading[] = " £à㧪 áâà ¨æë... |
36 | char loading[] = " £à㧪 áâà ¨æë... |
- | 37 | char page_not_found[] = FROM "html\page_not_found_ru.htm"; |
|
- | 38 | char accept_language[]= "Accept-Language: ru\n"; |
|
- | 39 | char rmb_menu[] = |
|
- | 40 | "®á¬®âà¥âì ¨á室¨ª |
|
- | 41 | ¥¤ ªâ¨à®¢ âì ¨á室¨ª |
|
- | 42 | áâ®à¨ï |
|
36 | char page_not_found[] = FROM "html\page_not_found_ru.htm"; |
43 | ç¨áâ¨âì ªíè ª à⨮ª |
37 | char accept_language[]= "Accept-Language: ru\n"; |
44 | ¥¥¤¦¥à § £à㧮ª"; |
38 | #else |
45 | #else |
39 | char version[]=" Text-based Browser 1.42"; |
46 | char version[]=" Text-based Browser 1.48"; |
40 | ?define IMAGES_CACHE_CLEARED "Images cache cleared" |
47 | ?define IMAGES_CACHE_CLEARED "Images cache cleared" |
41 | ?define T_LAST_SLIDE "This slide is the last" |
48 | ?define T_LAST_SLIDE "This slide is the last" |
42 | char loading[] = "Loading... |
49 | char loading[] = "Loading... |
- | 50 | char page_not_found[] = FROM "html\page_not_found_en.htm"; |
|
- | 51 | char accept_language[]= "Accept-Language: en\n"; |
|
- | 52 | char rmb_menu[] = |
|
- | 53 | "View source |
|
- | 54 | Edit source |
|
- | 55 | History |
|
43 | char page_not_found[] = FROM "html\page_not_found_en.htm"; |
56 | Free image cache |
Line 44... | Line 57... | ||
44 | char accept_language[]= "Accept-Language: en\n"; |
57 | Download Manager"; |
45 | #endif |
58 | #endif |
46 | 59 | ||
Line 84... | Line 97... | ||
84 | FREE_IMG_CACHE, |
97 | FREE_IMG_CACHE, |
85 | DOWNLOAD_MANAGER |
98 | DOWNLOAD_MANAGER |
86 | }; |
99 | }; |
Line 87... | Line 100... | ||
87 | 100 | ||
88 | #include "..\TWB\TWB.c" |
- | |
89 | #include "menu.h" |
101 | #include "..\TWB\TWB.c" |
90 | #include "history.h" |
102 | #include "history.h" |
91 | #include "show_src.h" |
103 | #include "show_src.h" |
92 | #include "http_downloader.h" |
104 | #include "http_downloader.h" |
Line 106... | Line 118... | ||
106 | load_dll(boxlib, #box_lib_init,0); |
118 | load_dll(boxlib, #box_lib_init,0); |
107 | load_dll(libio, #libio_init,1); |
119 | load_dll(libio, #libio_init,1); |
108 | load_dll(libimg, #libimg_init,1); |
120 | load_dll(libimg, #libimg_init,1); |
109 | load_dll(libHTTP, #http_lib_init,1); |
121 | load_dll(libHTTP, #http_lib_init,1); |
110 | load_dll(iconv_lib, #iconv_open,0); |
122 | load_dll(iconv_lib, #iconv_open,0); |
111 | //load_dll(kmenu, #akmenu_init,0); |
- | |
112 | Libimg_LoadImage(#skin, abspath("wv_skin.png")); |
123 | Libimg_LoadImage(#skin, abspath("wv_skin.png")); |
113 | SetSkinColors(); |
124 | SetSkinColors(); |
114 | CreateDir("/tmp0/1/downloads"); |
125 | CreateDir("/tmp0/1/downloads"); |
115 | if (param) strcpy(#URL, #param); else strcpy(#URL, URL_SERVICE_HOME); |
126 | if (param) strcpy(#URL, #param); else strcpy(#URL, URL_SERVICE_HOME); |
116 | WB1.DrawBuf.zoom = 1; |
127 | WB1.DrawBuf.zoom = 1; |
117 | WB1.list.SetFont(8, 14, 10111000b); |
128 | WB1.list.SetFont(8, 14, 10011000b); |
118 | WB1.list.no_selection = true; |
129 | WB1.list.no_selection = true; |
119 | label.init(DEFAULT_FONT); |
130 | label.init(DEFAULT_FONT); |
120 | SetEventMask(0xa7); |
131 | SetEventMask(0xa7); |
121 | BEGIN_LOOP_APPLICATION: |
132 | BEGIN_LOOP_APPLICATION: |
122 | WaitEventTimeout(2); |
133 | WaitEventTimeout(2); |
Line 127... | Line 138... | ||
127 | edit_box_mouse stdcall (#address_box); |
138 | edit_box_mouse stdcall (#address_box); |
128 | mouse.get(); |
139 | mouse.get(); |
129 | if (WB1.list.MouseOver(mouse.x, mouse.y)) |
140 | if (WB1.list.MouseOver(mouse.x, mouse.y)) |
130 | { |
141 | { |
131 | PageLinks.Hover(mouse.x, WB1.list.first*WB1.list.item_h + mouse.y, link_color_inactive, link_color_active, bg_color); |
142 | PageLinks.Hover(mouse.x, WB1.list.first*WB1.list.item_h + mouse.y, link_color_inactive, link_color_active, bg_color); |
132 | if (bufsize) && (mouse.pkm) && (mouse.up) { CreateThread(#menu_rmb,#stak+4092); break; } |
143 | if (bufsize) && (mouse.pkm) && (mouse.up) { |
- | 144 | menu.show(Form.left+mouse.x-6,Form.top+mouse.y+skin_height+3, 180, #rmb_menu, VIEW_SOURCE); |
|
- | 145 | break; |
|
- | 146 | } |
|
133 | if (WB1.list.MouseScroll(mouse.vert)) WB1.DrawPage(); |
147 | if (WB1.list.MouseScroll(mouse.vert)) WB1.DrawPage(); |
134 | } |
148 | } |
135 | scrollbar_v_mouse (#scroll_wv); |
149 | scrollbar_v_mouse (#scroll_wv); |
136 | if (WB1.list.first != scroll_wv.position) |
150 | if (WB1.list.first != scroll_wv.position) |
137 | { |
151 | { |
Line 159... | Line 173... | ||
159 | Scan(key_scancode); |
173 | Scan(key_scancode); |
160 | } |
174 | } |
161 | break; |
175 | break; |
Line 162... | Line 176... | ||
162 | 176 | ||
163 | case evReDraw: |
177 | case evReDraw: |
- | 178 | if (menu.list.cur_y) { |
|
- | 179 | Scan(menu.list.cur_y); |
|
- | 180 | menu.list.cur_y = 0; |
|
164 | if (action_buf) Scan(action_buf); |
181 | } |
165 | DefineAndDrawWindow(GetScreenWidth()-800/2,GetScreenHeight()-600/2,800,600,0x73,col_bg,0,0); |
182 | DefineAndDrawWindow(GetScreenWidth()-800/2,GetScreenHeight()-600/2,800,600,0x73,col_bg,0,0); |
166 | GetProcessInfo(#Form, SelfInfo); |
183 | GetProcessInfo(#Form, SelfInfo); |
167 | if (Form.status_window>2) { DrawTitle(#header); break; } |
184 | if (Form.status_window>2) { DrawTitle(#header); break; } |
168 | if (Form.height<120) { MoveSize(OLD,OLD,OLD,120); break; } |
185 | if (Form.height<120) { MoveSize(OLD,OLD,OLD,120); break; } |
Line 247... | Line 264... | ||
247 | WB1.list.SetSizes(0, TOOLBAR_H, Form.width - 10 - scroll_wv.size_x / WB1.DrawBuf.zoom, |
264 | WB1.list.SetSizes(0, TOOLBAR_H, Form.width - 10 - scroll_wv.size_x / WB1.DrawBuf.zoom, |
248 | Form.cheight - TOOLBAR_H - STATUSBAR_H, WB1.list.font_h + WB1.DrawBuf.zoom + WB1.DrawBuf.zoom * WB1.DrawBuf.zoom); |
265 | Form.cheight - TOOLBAR_H - STATUSBAR_H, WB1.list.font_h + WB1.DrawBuf.zoom + WB1.DrawBuf.zoom * WB1.DrawBuf.zoom); |
249 | WB1.list.wheel_size = 7; |
266 | WB1.list.wheel_size = 7; |
250 | WB1.list.column_max = WB1.list.w - scroll_wv.size_x / WB1.list.font_w; |
267 | WB1.list.column_max = WB1.list.w - scroll_wv.size_x / WB1.list.font_w; |
251 | WB1.list.visible = WB1.list.h - 5 / WB1.list.item_h; |
268 | WB1.list.visible = WB1.list.h - 5 / WB1.list.item_h; |
- | 269 | if (WB1.list.w!=WB1.DrawBuf.bufw) { |
|
252 | if (WB1.list.w!=WB1.DrawBuf.bufw) WB1.DrawBuf.Init(WB1.list.x, WB1.list.y, WB1.list.w, WB1.list.h * 30); |
270 | WB1.DrawBuf.Init(WB1.list.x, WB1.list.y, WB1.list.w, WB1.list.h * 30); |
- | 271 | Scan(REFRESH_BUTTON); |
|
- | 272 | } |
|
253 | } |
273 | } |
Line 254... | Line 274... | ||
254 | 274 | ||
Line 330... | Line 350... | ||
330 | else OpenPage(); |
350 | else OpenPage(); |
331 | return; |
351 | return; |
332 | case SANDWICH_BUTTON: |
352 | case SANDWICH_BUTTON: |
333 | mouse.y = TOOLBAR_H-6; |
353 | mouse.y = TOOLBAR_H-6; |
334 | mouse.x = Form.cwidth - 167; |
354 | mouse.x = Form.cwidth - 167; |
335 | CreateThread(#menu_rmb,#stak+4092); |
355 | menu.show(Form.left+mouse.x-6,Form.top+mouse.y+skin_height+3, 180, #rmb_menu, VIEW_SOURCE); |
336 | return; |
356 | return; |
337 | case VIEW_SOURCE: |
357 | case VIEW_SOURCE: |
338 | WB1.list.first = 0; |
358 | WB1.list.first = 0; |
339 | ShowSource(); |
359 | ShowSource(); |
340 | WB1.LoadInternalPage(bufpointer, bufsize); |
360 | WB1.LoadInternalPage(bufpointer, bufsize); |