Rev 8499 | Rev 8574 | Go to most recent revision | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 8499 | Rev 8500 | ||
---|---|---|---|
Line 147... | Line 147... | ||
147 | WB1.DrawPage(); |
147 | WB1.DrawPage(); |
148 | break; |
148 | break; |
149 | } |
149 | } |
150 | } |
150 | } |
Line 151... | Line 151... | ||
151 | 151 | ||
152 | if (links.hover(WB1.list.y, WB1.list.first)) |
152 | if (WB1.list.MouseOver(mouse.x, mouse.y)) && (links.hover(WB1.list.y, WB1.list.first)) |
153 | { |
153 | { |
- | 154 | if (mouse.key&MOUSE_MIDDLE) && (mouse.up) { |
|
154 | if (mouse.key&MOUSE_MIDDLE) && (mouse.up) { |
155 | GetKeyModifier(); |
155 | if (key_modifier&KEY_LSHIFT) || (key_modifier&KEY_RSHIFT) { |
156 | if (key_modifier&KEY_LSHIFT) || (key_modifier&KEY_RSHIFT) { |
156 | EventClickLink(TARGET_NEW_WINDOW); |
157 | EventClickLink(TARGET_NEW_WINDOW); |
157 | } else { |
158 | } else { |
158 | EventClickLink(TARGET_NEW_TAB); |
159 | EventClickLink(TARGET_NEW_TAB); |
Line 296... | Line 297... | ||
296 | case DOWNLOAD_LINK_CT: EventOpenDownloader( GetAbsoluteActiveURL() ); return; |
297 | case DOWNLOAD_LINK_CT: EventOpenDownloader( GetAbsoluteActiveURL() ); return; |
297 | case OPEN_FILE: EventOpenDialog(); return; |
298 | case OPEN_FILE: EventOpenDialog(); return; |
298 | } |
299 | } |
299 | } |
300 | } |
Line 300... | Line 301... | ||
300 | 301 | ||
301 | bool ProcessKeyEvent() |
302 | void ProcessKeyEvent() |
302 | { |
303 | { |
303 | if (key_modifier&KEY_LSHIFT) || (key_modifier&KEY_RSHIFT) |
304 | if (key_modifier&KEY_LSHIFT) || (key_modifier&KEY_RSHIFT) |
304 | { |
305 | { |
- | 306 | if (key_scancode == SCAN_CODE_TAB) {EventActivatePreviousTab();return;} |
|
305 | if (key_scancode == SCAN_CODE_TAB) {EventActivatePreviousTab();return;} |
307 | if (key_scancode == SCAN_CODE_KEY_T) {EventOpenNewTab(URL_SERVICE_TEST);return;} |
Line 306... | Line 308... | ||
306 | } |
308 | } |
307 | 309 | ||
308 | if (key_modifier&KEY_LCTRL) || (key_modifier&KEY_RCTRL) switch(key_scancode) |
310 | if (key_modifier&KEY_LCTRL) || (key_modifier&KEY_RCTRL) switch(key_scancode) |
309 | { |
311 | { |
310 | case SCAN_CODE_KEY_O: EventOpenDialog(); return true; |
312 | case SCAN_CODE_KEY_O: EventOpenDialog(); return; |
311 | case SCAN_CODE_KEY_H: ProcessButtonClick(VIEW_HISTORY); return true; |
313 | case SCAN_CODE_KEY_H: ProcessButtonClick(VIEW_HISTORY); return; |
312 | case SCAN_CODE_KEY_U: EventViewSource(); return true; |
314 | case SCAN_CODE_KEY_U: EventViewSource(); return; |
313 | case SCAN_CODE_KEY_T: EventOpenNewTab(URL_SERVICE_HOMEPAGE); return true; |
315 | case SCAN_CODE_KEY_T: EventOpenNewTab(URL_SERVICE_HOMEPAGE); return; |
314 | case SCAN_CODE_KEY_N: RunProgram(#program_path, NULL); return true; |
316 | case SCAN_CODE_KEY_N: RunProgram(#program_path, NULL); return; |
315 | case SCAN_CODE_KEY_J: ProcessButtonClick(DOWNLOAD_MANAGER); return true; |
317 | case SCAN_CODE_KEY_J: ProcessButtonClick(DOWNLOAD_MANAGER); return; |
316 | case SCAN_CODE_KEY_R: ProcessButtonClick(REFRESH_BUTTON); return true; |
318 | case SCAN_CODE_KEY_R: ProcessButtonClick(REFRESH_BUTTON); return; |
317 | case SCAN_CODE_ENTER: EventSeachWeb(); return true; |
319 | case SCAN_CODE_ENTER: EventSeachWeb(); return; |
318 | case SCAN_CODE_LEFT: ProcessButtonClick(BACK_BUTTON); return true; |
320 | case SCAN_CODE_LEFT: ProcessButtonClick(BACK_BUTTON); return; |
319 | case SCAN_CODE_RIGHT: ProcessButtonClick(FORWARD_BUTTON); return true; |
321 | case SCAN_CODE_RIGHT: ProcessButtonClick(FORWARD_BUTTON); return; |
320 | case SCAN_CODE_KEY_W: EventCloseActiveTab(); return true; |
322 | case SCAN_CODE_KEY_W: EventCloseActiveTab(); return; |
321 | case SCAN_CODE_TAB: EventActivateNextTab(); return true; |
323 | case SCAN_CODE_TAB: EventActivateNextTab(); return; |
322 | case SCAN_CODE_F5: EventClearCache(); return; |
324 | case SCAN_CODE_F5: EventClearCache(); return; |
Line 323... | Line 325... | ||
323 | default: return false; |
325 | default: return; |
324 | } |
326 | } |
325 | 327 | ||
Line 369... | Line 371... | ||
369 | 371 | ||
370 | DrawRectangle(WB1.list.x + WB1.list.w, WB1.list.y, scroll_wv.size_x, |
372 | DrawRectangle(WB1.list.x + WB1.list.w, WB1.list.y, scroll_wv.size_x, |
Line 371... | Line 373... | ||
371 | WB1.list.h-1, scroll_wv.bckg_col); |
373 | WB1.list.h-1, scroll_wv.bckg_col); |
372 | 374 | ||
373 | if (!canvas.bufw) { |
375 | if (!canvas.bufw) { |
374 | OpenPage(history.current()); |
376 | EventOpenFirstPage(); |
375 | } else { |
377 | } else { |
376 | WB1.DrawPage(); |
378 | WB1.DrawPage(); |
377 | DrawOmnibox(); |
379 | DrawOmnibox(); |
378 | } |
380 | } |
379 | DrawProgress(); |
381 | DrawProgress(); |
380 | DrawStatusBar(NULL); |
382 | DrawStatusBar(NULL); |
Line -... | Line 383... | ||
- | 383 | DrawTabsBar(); |
|
- | 384 | } |
|
- | 385 | ||
- | 386 | void EventOpenFirstPage() |
|
- | 387 | { |
|
381 | DrawTabsBar(); |
388 | OpenPage(history.current()); |
382 | } |
389 | } |
383 | 390 | ||
384 | void EventManuallyChangeEncoding(int _new_encoding) |
391 | void EventManuallyChangeEncoding(int _new_encoding) |
385 | { |
392 | { |
Line 919... | Line 926... | ||
919 | EventOpenDownloader(#image_download_url); |
926 | EventOpenDownloader(#image_download_url); |
920 | } |
927 | } |
Line 921... | Line 928... | ||
921 | 928 | ||
922 | void HandleRedirect() |
929 | void HandleRedirect() |
923 | { |
930 | { |
924 | char redirect_url[URL_SIZE]; |
931 | dword redirect_url = malloc(URL_SIZE); |
925 | http.header_field("location", #redirect_url, URL_SIZE); |
932 | http.header_field("location", redirect_url, URL_SIZE); |
926 | get_absolute_url(#redirect_url, http.cur_url); |
933 | get_absolute_url(redirect_url, http.cur_url); |
927 | http.hfree(); |
934 | http.hfree(); |
928 | if (http_get_type==PAGE) OpenPage(#redirect_url); |
935 | if (http_get_type==PAGE) OpenPage(redirect_url); |
- | 936 | else if (http_get_type==IMG) GetUrl(redirect_url); |
|
929 | else if (http_get_type==IMG) GetUrl(#redirect_url); |
937 | free(redirect_url); |
Line 930... | Line 938... | ||
930 | } |
938 | } |
931 | 939 | ||
932 | dword GetImg(bool _new) |
940 | dword GetImg(bool _new) |
Line 946... | Line 954... | ||
946 | } |
954 | } |
947 | } |
955 | } |
948 | if (_new) return; |
956 | if (_new) return; |
949 | DrawOmnibox(); |
957 | DrawOmnibox(); |
950 | DrawStatusBar(T_RENDERING); |
958 | DrawStatusBar(T_RENDERING); |
951 | WB1.ParseHtml(WB1.bufpointer, WB1.bufsize); |
959 | WB1.Reparse(); |
952 | WB1.DrawPage(); |
960 | WB1.DrawPage(); |
953 | debugln(sprintf(#param, T_DONE_IN_SEC, GetStartTime()-render_start_time/100)); |
961 | debugln(sprintf(#param, T_DONE_IN_SEC, GetStartTime()-render_start_time/100)); |
954 | DrawStatusBar(NULL); |
962 | DrawStatusBar(NULL); |
955 | } |
963 | } |