Dillo v3.2.0-38-gb47de46f
Loading...
Searching...
No Matches
nav.c
Go to the documentation of this file.
1/*
2 * File: nav.c
3 *
4 * Copyright (C) 2000-2007 Jorge Arellano Cid <jcid@dillo.org>
5 *
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by
8 * the Free Software Foundation; either version 3 of the License, or
9 * (at your option) any later version.
10 */
11
15#include <stdio.h>
16#include <sys/stat.h>
17#include "msg.h"
18#include "nav.h"
19#include "history.h"
20#include "web.hh"
21#include "uicmd.hh"
22#include "dialog.hh"
23#include "prefs.h"
24#include "capi.h"
25#include "timeout.hh"
26
27/*
28 * For back and forward navigation, each bw keeps an url index,
29 * and its scroll position.
30 */
31typedef struct {
32 int url_idx;
33 int posx, posy;
34} nav_stack_item;
35
36
37
38/*
39 * Free memory used by this module
40 * TODO: this may be removed or called by a_Bw_free().
41 * Currently is not called from anywhere.
42 */
44{
46 dFree(bw->nav_stack);
47}
48
49
50/* Navigation stack methods ------------------------------------------------ */
51
52/*
53 * Return current nav_stack pointer [0 based; -1 = empty]
54 */
56{
57 return bw->nav_stack_ptr;
58}
59
60/*
61 * Return the url index of i-th element in the stack. [-1 = Error]
62 */
64{
65 nav_stack_item *nsi = dList_nth_data (bw->nav_stack, i);
66 return (nsi) ? nsi->url_idx : -1;
67}
68
69/*
70 * Return the url index of the top element in the stack.
71 */
73{
74 nav_stack_item *nsi;
75
77 return (nsi) ? nsi->url_idx : -1;
78}
79
80/*
81 * Move the nav_stack pointer
82 */
83static void Nav_stack_move_ptr(BrowserWindow *bw, int offset)
84{
85 int nptr;
86
87 dReturn_if_fail (bw != NULL);
88 if (offset != 0) {
89 nptr = bw->nav_stack_ptr + offset;
90 dReturn_if_fail (nptr >= 0 && nptr < a_Nav_stack_size(bw));
91 bw->nav_stack_ptr = nptr;
92 }
93}
94
95/*
96 * Return size of nav_stack [1 based]
97 */
99{
100 return dList_length(bw->nav_stack);
101}
102
103/*
104 * Truncate the navigation stack including 'pos' and upwards.
105 */
106static void Nav_stack_truncate(BrowserWindow *bw, int pos)
107{
108 void *data;
109
110 dReturn_if_fail (bw != NULL && pos >= 0);
111
112 while (pos < dList_length(bw->nav_stack)) {
113 data = dList_nth_data(bw->nav_stack, pos);
114 dList_remove_fast (bw->nav_stack, data);
115 dFree(data);
116 }
117}
118
119/*
120 * Insert a nav_stack_item into the stack at a given position.
121 */
122static void Nav_stack_append(BrowserWindow *bw, int url_idx)
123{
124 nav_stack_item *nsi;
125
126 dReturn_if_fail (bw != NULL);
127
128 /* Insert the new element */
129 nsi = dNew(nav_stack_item, 1);
130 nsi->url_idx = url_idx;
131 nsi->posx = 0;
132 nsi->posy = 0;
133 dList_append (bw->nav_stack, nsi);
134}
135
136/*
137 * Get the scrolling position of the current page.
138 */
139static void Nav_get_scroll_pos(BrowserWindow *bw, int *posx, int *posy)
140{
141 nav_stack_item *nsi;
142
143 if ((nsi = dList_nth_data (bw->nav_stack, a_Nav_stack_ptr(bw)))) {
144 *posx = nsi->posx;
145 *posy = nsi->posy;
146 } else {
147 *posx = *posy = 0;
148 }
149}
150
151/*
152 * Save the scrolling position of the current page.
153 */
154static void Nav_save_scroll_pos(BrowserWindow *bw, int idx, int posx, int posy)
155{
156 nav_stack_item *nsi;
157
158 if ((nsi = dList_nth_data (bw->nav_stack, idx))) {
159 nsi->posx = posx;
160 nsi->posy = posy;
161 }
162}
163
164/*
165 * Remove equal adjacent URLs at the top of the stack.
166 * (It may happen with redirections)
167 */
169{
170 int i;
171
172 dReturn_if_fail (bw != NULL);
173
174 if ((i = a_Nav_stack_size(bw)) >= 2 &&
175 NAV_UIDX(bw,i - 2) == NAV_UIDX(bw,i - 1)) {
176 void *data = dList_nth_data (bw->nav_stack, i - 1);
177 dList_remove_fast (bw->nav_stack, data);
178 dFree(data);
179 if (bw->nav_stack_ptr >= a_Nav_stack_size(bw))
180 bw->nav_stack_ptr = a_Nav_stack_size(bw) - 1;
181 }
182}
183
184
185/* General methods --------------------------------------------------------- */
186
187/*
188 * Create a DilloWeb structure for 'url' and ask the cache to send it back.
189 * - Also set a few things related to the browser window.
190 * This function requests the page's root-URL; images and related stuff
191 * are fetched directly by the HTML module.
192 */
193static void Nav_open_url(BrowserWindow *bw, const DilloUrl *url,
194 const DilloUrl *requester, int offset)
195{
196 const DilloUrl *old_url;
197 bool_t MustLoad, ForceReload, IgnoreScroll;
198 int x, y, idx, ClientKey;
199 DilloWeb *Web;
200
201 MSG("Nav_open_url: new url='%s'\n", URL_STR_(url));
202
203 ForceReload = (URL_FLAGS(url) & (URL_E2EQuery + URL_ReloadFromCache)) != 0;
204 IgnoreScroll = (URL_FLAGS(url) & URL_IgnoreScroll) != 0;
205
206 /* Get the url of the current page */
207 idx = a_Nav_stack_ptr(bw);
208 old_url = a_History_get_url(NAV_UIDX(bw, idx));
209 _MSG("Nav_open_url: old_url='%s' idx=%d\n", URL_STR(old_url), idx);
210 /* Record current scrolling position */
211 if (old_url && !IgnoreScroll) {
212 a_UIcmd_get_scroll_xy(bw, &x, &y);
213 Nav_save_scroll_pos(bw, idx, x, y);
214 _MSG("Nav_open_url: saved scroll of '%s' at x=%d y=%d\n",
215 URL_STR(old_url), x, y);
216 }
217
218 /* Update navigation-stack-pointer (offset may be zero) */
219 Nav_stack_move_ptr(bw, offset);
220
221 /* Page must be reloaded, if old and new url (considering anchor) differ */
222 MustLoad = ForceReload || !old_url;
223 if (old_url){
224 MustLoad |= (a_Url_cmp(old_url, url) ||
225 strcmp(URL_FRAGMENT(old_url), URL_FRAGMENT(url)));
226 }
227
228 if (MustLoad) {
230 a_Bw_cleanup(bw);
231
232 // a_Menu_pagemarks_new(bw);
233
234 Web = a_Web_new(bw, url, requester);
235 Web->flags |= WEB_RootUrl;
236 if ((ClientKey = a_Capi_open_url(Web, NULL, NULL)) != 0) {
237 a_Bw_add_client(bw, ClientKey, 1);
238 a_Bw_add_url(bw, url);
239 }
240 }
241}
242
243/*
244 * Cancel the last expected url if present. The responsibility
245 * for actually aborting the data stream remains with the caller.
246 */
248{
249 if (a_Bw_expecting(bw)) {
252 }
253 if (bw->meta_refresh_status > 0)
255}
256
257/*
258 * Cancel the expect if 'url' matches.
259 */
261{
262 if (a_Url_cmp(url, a_Bw_expected_url(bw)) == 0)
264}
265
266/*
267 * We have an answer! Set things accordingly.
268 * This function is called for root URLs only.
269 * Beware: this function is much more complex than it looks
270 * because URLs with repush pass twice through it.
271 */
273{
274 int m, url_idx, posx, posy, reload, repush, e2equery, goto_old_scroll=TRUE;
275 DilloUrl *url;
276 char *fragment = NULL;
277
278 dReturn_if_fail(bw != NULL);
279
280 if (a_Bw_expecting(bw)) {
281 url = a_Url_dup(a_Bw_expected_url(bw));
282 reload = (URL_FLAGS(url) & URL_ReloadPage);
283 repush = (URL_FLAGS(url) & URL_ReloadFromCache);
284 e2equery = (URL_FLAGS(url) & URL_E2EQuery);
285 fragment = a_Url_decode_hex_str(URL_FRAGMENT_(url));
286
287 /* Unset E2EQuery, ReloadPage, ReloadFromCache and IgnoreScroll
288 * before adding this url to history */
290 a_Url_set_flags(url, URL_FLAGS(url) & ~m);
291 url_idx = a_History_add_url(url);
292 a_Url_free(url);
293
294 if (repush) {
295 MSG("a_Nav_expect_done: repush!\n");
296 } else if (reload) {
297 MSG("a_Nav_expect_done: reload!\n");
298 } else {
300 Nav_stack_append(bw, url_idx);
301 Nav_stack_move_ptr(bw, 1);
302 }
303
304 if (fragment) {
305 goto_old_scroll = FALSE;
306 if (repush) {
307 Nav_get_scroll_pos(bw, &posx, &posy);
308 if (posx || posy)
309 goto_old_scroll = TRUE;
310 } else if (e2equery) {
311 /* Reset scroll, so repush goes to fragment in the next pass */
313 }
314 }
316 }
317
318 if (goto_old_scroll) {
319 /* Scroll to where we were in this page */
320 Nav_get_scroll_pos(bw, &posx, &posy);
321 a_UIcmd_set_scroll_xy(bw, posx, posy);
322 _MSG("Nav: expect_done scrolling to x=%d y=%d\n", posx, posy);
323 } else if (fragment) {
324 /* Scroll to fragment */
325 a_UIcmd_set_scroll_by_fragment(bw, fragment);
326 } else {
327 /* Scroll to origin */
328 a_UIcmd_set_scroll_xy(bw, 0, 0);
329 }
330
331 dFree(fragment);
332 Nav_stack_clean(bw);
334 _MSG("Nav: a_Nav_expect_done\n");
335}
336
337/*
338 * Make 'url' the current browsed page (upon data arrival)
339 * - Set bw to expect the URL data
340 * - Ask the cache to feed back the requested URL (via Nav_open_url)
341 */
342void a_Nav_push(BrowserWindow *bw, const DilloUrl *url,
343 const DilloUrl *requester)
344{
345 const DilloUrl *e_url;
346 dReturn_if_fail (bw != NULL);
347
348 e_url = a_Bw_expected_url(bw);
349 if (e_url && !a_Url_cmp(e_url, url) &&
350 !strcmp(URL_FRAGMENT(e_url),URL_FRAGMENT(url))) {
351 /* we're already expecting that url (most probably a double-click) */
352 return;
353 }
355 a_Bw_expect(bw, url);
356 Nav_open_url(bw, url, requester, 0);
358}
359
360/*
361 * This one does a_Nav_repush's job.
362 */
363static void Nav_repush(BrowserWindow *bw)
364{
365 DilloUrl *url;
366
368 if (a_Nav_stack_size(bw)) {
370 /* Let's make reload be from Cache */
372 a_Bw_expect(bw, url);
373 Nav_open_url(bw, url, NULL, 0);
374 a_Url_free(url);
375 }
376}
377
378static void Nav_repush_callback(void *data)
379{
380 _MSG(">>>> Nav_repush_callback <<<<\n");
381 Nav_repush(data);
383}
384
385/*
386 * Repush current URL: not an end-to-end reload but from cache.
387 * - Currently used to switch to a charset decoder given by the META element.
388 * - Delayed to let dillo finish the call flow into a known state.
389 *
390 * There's no need to stop the parser before calling this function:
391 * When the timeout activates, a_Bw_stop_clients will stop the data feed.
392 */
394{
395 dReturn_if_fail (bw != NULL);
396 MSG(">>>> a_Nav_repush <<<<\n");
397 a_Timeout_add(0.0, Nav_repush_callback, (void*)bw);
398}
399
400/*
401 * This one does a_Nav_redirection0's job.
402 */
403static void Nav_redirection0_callback(void *data)
404{
405 BrowserWindow *bw = (BrowserWindow *)data;
406 const DilloUrl *referer_url = a_History_get_url(NAV_TOP_UIDX(bw));
407 _MSG(">>>> Nav_redirection0_callback <<<<\n");
408
409 if (bw->meta_refresh_status == 2) {
410 Nav_stack_move_ptr(bw, -1);
411 a_Nav_push(bw, bw->meta_refresh_url, referer_url);
412 }
414 bw->meta_refresh_url = NULL;
415 bw->meta_refresh_status = 0;
417}
418
419/*
420 * Handle a zero-delay URL redirection given by META
421 */
423{
424 dReturn_if_fail (bw != NULL);
425 _MSG(">>>> a_Nav_redirection0 <<<<\n");
426
428 bw->meta_refresh_url = a_Url_dup(new_url);
431 bw->meta_refresh_status = 2;
433}
434
435/*
436 * Send the browser back to previous page
437 */
439{
440 int idx = a_Nav_stack_ptr(bw);
441
443 if (--idx >= 0){
444 a_UIcmd_set_msg(bw, "");
445 Nav_open_url(bw, a_History_get_url(NAV_UIDX(bw,idx)), NULL, -1);
446 }
447}
448
449/*
450 * Send the browser back to previous page in new tab
451 */
453{
454 int idx = a_Nav_stack_ptr(bw);
455
456 if (--idx >= 0){
457 a_UIcmd_set_msg(bw, "");
459 }
460}
461
462/*
463 * Send the browser to next page in the history list
464 */
466{
467 int idx = a_Nav_stack_ptr(bw);
468
470 if (++idx < a_Nav_stack_size(bw)) {
471 a_UIcmd_set_msg(bw, "");
472 Nav_open_url(bw, a_History_get_url(NAV_UIDX(bw,idx)), NULL, +1);
473 }
474}
475
476/*
477 * Send the browser to next page in the history list in new tab
478 */
480{
481 int idx = a_Nav_stack_ptr(bw);
482
483 if (++idx < a_Nav_stack_size(bw)) {
484 a_UIcmd_set_msg(bw, "");
486 }
487}
488
489/*
490 * Redirect the browser to the HOME page!
491 */
493{
494 a_Nav_push(bw, prefs.home, NULL);
495}
496
497/*
498 * This one does a_Nav_reload's job!
499 */
500static void Nav_reload_callback(void *data)
501{
502 BrowserWindow *bw = data;
503 const DilloUrl *h_url;
504 DilloUrl *r_url;
505 int choice, confirmed = 1;
506
508 if (a_Nav_stack_size(bw)) {
509 h_url = a_History_get_url(NAV_TOP_UIDX(bw));
510 if (dStrAsciiCasecmp(URL_SCHEME(h_url), "dpi") == 0 &&
511 strncmp(URL_PATH(h_url), "/vsource/", 9) == 0) {
512 /* allow reload for view source dpi */
513 confirmed = 1;
514 } else if (URL_FLAGS(h_url) & URL_Post) {
515 /* Attempt to repost data, let's confirm... */
516 choice = a_Dialog_choice("Dillo: Repost form?",
517 "Repost form data?",
518 "No", "Yes", "Cancel", NULL);
519 confirmed = (choice == 2); /* "Yes" */
520 }
521
522 if (confirmed) {
523 r_url = a_Url_dup(h_url);
524 /* Mark URL as reload to differentiate from push */
526 /* Let's make reload be end-to-end */
527 a_Url_set_flags(r_url, URL_FLAGS(r_url) | URL_E2EQuery);
528 /* This is an explicit reload, so clear the SpamSafe flag */
529 a_Url_set_flags(r_url, URL_FLAGS(r_url) & ~URL_SpamSafe);
530 a_Bw_expect(bw, r_url);
531 Nav_open_url(bw, r_url, NULL, 0);
532 a_Url_free(r_url);
533 }
534 }
535}
536
537/*
538 * Implement the RELOAD button functionality.
539 * (Currently it only reloads the page, not its images)
540 * Note: the timeout lets CCC operations end before making the request.
541 */
543{
544 dReturn_if_fail (bw != NULL);
545 a_Timeout_add(0.0, Nav_reload_callback, (void*)bw);
546}
547
548/*
549 * Jump to a URL in the Navigation stack.
550 */
551void a_Nav_jump(BrowserWindow *bw, int offset, int new_bw)
552{
553 int idx = a_Nav_stack_ptr(bw) + offset;
554
555 if (new_bw) {
557 } else {
559 Nav_open_url(bw, a_History_get_url(NAV_UIDX(bw,idx)), NULL, offset);
561 }
562}
563
564
565/* Specific methods -------------------------------------------------------- */
566
567/*
568 * Receive data from the cache and save it to a local file
569 */
570static void Nav_save_cb(int Op, CacheClient_t *Client)
571{
572 DilloWeb *Web = Client->Web;
573 int Bytes;
574
575 if (Op){
576 struct stat st;
577
578 fflush(Web->stream);
579 fstat(fileno(Web->stream), &st);
580 fclose(Web->stream);
581 a_UIcmd_set_msg(Web->bw, "File saved (%d Bytes)", st.st_size);
582 } else {
583 if ((Bytes = Client->BufSize - Web->SavedBytes) > 0) {
584 Bytes = fwrite((char *) Client->Buf + Web->SavedBytes, 1, Bytes, Web->stream);
585 Web->SavedBytes += Bytes;
586 }
587 }
588}
589
590/*
591 * Save a URL (from cache or from the net).
592 */
594 const DilloUrl *url, const char *filename)
595{
596 DilloWeb *Web = a_Web_new(bw, url, NULL);
597 Web->filename = dStrdup(filename);
598 Web->flags |= WEB_Download;
599 /* TODO: keep track of this client */
600 a_Capi_open_url(Web, Nav_save_cb, Web);
601}
602
603/*
604 * Wrapper for a_Capi_get_buf.
605 */
606int a_Nav_get_buf(const DilloUrl *Url, char **PBuf, int *BufSize)
607{
608 return a_Capi_get_buf(Url, PBuf, BufSize);
609}
610
611/*
612 * Wrapper for a_Capi_unref_buf().
613 */
614void a_Nav_unref_buf(const DilloUrl *Url)
615{
616 a_Capi_unref_buf(Url);
617}
618
619/*
620 * Wrapper for a_Capi_get_content_type().
621 */
622const char *a_Nav_get_content_type(const DilloUrl *url)
623{
624 return a_Capi_get_content_type(url);
625}
626
627/*
628 * Wrapper for a_Capi_set_vsource_url().
629 */
631{
633}
#define _MSG(...)
Definition bookmarks.c:45
#define MSG(...)
Definition bookmarks.c:46
bool_t a_Bw_expecting(BrowserWindow *bw)
Definition bw.c:334
void a_Bw_expect(BrowserWindow *bw, const DilloUrl *url)
Definition bw.c:322
void a_Bw_add_url(BrowserWindow *bw, const DilloUrl *Url)
Add an URL to the browser window's list.
Definition bw.c:209
void a_Bw_stop_clients(BrowserWindow *bw, int flags)
Stop the active clients of this bw's top page.
Definition bw.c:182
void a_Bw_add_client(BrowserWindow *bw, int Key, int Root)
Add a reference to a cache-client.
Definition bw.c:128
void a_Bw_cleanup(BrowserWindow *bw)
Empty RootClients, ImageClients and PageUrls lists and reset progress bar data.
Definition bw.c:277
void a_Bw_cancel_expect(BrowserWindow *bw)
Definition bw.c:328
const DilloUrl * a_Bw_expected_url(BrowserWindow *bw)
Definition bw.c:339
#define BW_Img
Definition bw.h:22
#define BW_Root
Definition bw.h:21
int a_Capi_get_buf(const DilloUrl *Url, char **PBuf, int *BufSize)
Get the cache's buffer for the URL, and its size.
Definition capi.c:543
void a_Capi_set_vsource_url(const DilloUrl *url)
Store the last URL requested by "view source".
Definition capi.c:224
void a_Capi_unref_buf(const DilloUrl *Url)
Unref the cache's buffer when no longer using it.
Definition capi.c:551
int a_Capi_open_url(DilloWeb *web, CA_Callback_t Call, void *CbData)
Most used function for requesting a URL.
Definition capi.c:394
const char * a_Capi_get_content_type(const DilloUrl *url)
Get the Content-Type associated with the URL.
Definition capi.c:559
unsigned char bool_t
Definition d_size.h:21
char * a_Url_decode_hex_str(const char *str, size_t *p_sz)
Definition datauri.c:137
int a_Dialog_choice(const char *title, const char *msg,...)
Make a question-dialog with a question and alternatives.
Definition dialog.cc:342
void dFree(void *mem)
Definition dlib.c:68
int dStrAsciiCasecmp(const char *s1, const char *s2)
Definition dlib.c:203
char * dStrdup(const char *s)
Definition dlib.c:77
int dList_length(Dlist *lp)
For completing the ADT.
Definition dlib.c:613
void * dList_nth_data(Dlist *lp, int n0)
Return the nth data item, NULL when not found or 'n0' is out of range.
Definition dlib.c:662
void dList_remove_fast(Dlist *lp, const void *data)
Remove a data item without preserving order.
Definition dlib.c:623
void dList_append(Dlist *lp, void *data)
Append a data item to the list.
Definition dlib.c:597
#define dReturn_if_fail(expr)
Definition dlib.h:72
#define TRUE
Definition dlib.h:23
#define FALSE
Definition dlib.h:19
#define dNew(type, count)
Definition dlib.h:49
const DilloUrl * a_History_get_url(int idx)
Return the DilloUrl field (by index)
Definition history.c:80
int a_History_add_url(DilloUrl *url)
Add a new H_Item at the end of the history list (taking care of not making a duplicate entry)
Definition history.c:50
void a_Nav_cancel_expect_if_eq(BrowserWindow *bw, const DilloUrl *url)
Definition nav.c:260
int a_Nav_stack_ptr(BrowserWindow *bw)
Definition nav.c:55
static void Nav_get_scroll_pos(BrowserWindow *bw, int *posx, int *posy)
Definition nav.c:139
void a_Nav_redirection0(BrowserWindow *bw, const DilloUrl *new_url)
Definition nav.c:422
void a_Nav_forw(BrowserWindow *bw)
Definition nav.c:465
const char * a_Nav_get_content_type(const DilloUrl *url)
Definition nav.c:622
static void Nav_repush(BrowserWindow *bw)
Definition nav.c:363
int a_Nav_get_top_uidx(BrowserWindow *bw)
Definition nav.c:72
void a_Nav_home(BrowserWindow *bw)
Definition nav.c:492
void a_Nav_cancel_expect(BrowserWindow *bw)
Definition nav.c:247
static void Nav_stack_truncate(BrowserWindow *bw, int pos)
Definition nav.c:106
static void Nav_stack_clean(BrowserWindow *bw)
Definition nav.c:168
void a_Nav_expect_done(BrowserWindow *bw)
Definition nav.c:272
void a_Nav_free(BrowserWindow *bw)
Definition nav.c:43
void a_Nav_jump(BrowserWindow *bw, int offset, int new_bw)
Definition nav.c:551
static void Nav_open_url(BrowserWindow *bw, const DilloUrl *url, const DilloUrl *requester, int offset)
Definition nav.c:193
static void Nav_redirection0_callback(void *data)
Definition nav.c:403
void a_Nav_back(BrowserWindow *bw)
Definition nav.c:438
int a_Nav_get_uidx(BrowserWindow *bw, int i)
Definition nav.c:63
void a_Nav_reload(BrowserWindow *bw)
Definition nav.c:542
static void Nav_repush_callback(void *data)
Definition nav.c:378
void a_Nav_repush(BrowserWindow *bw)
Definition nav.c:393
void a_Nav_back_nt(BrowserWindow *bw)
Definition nav.c:452
void a_Nav_forw_nt(BrowserWindow *bw)
Definition nav.c:479
void a_Nav_unref_buf(const DilloUrl *Url)
Definition nav.c:614
int a_Nav_stack_size(BrowserWindow *bw)
Definition nav.c:98
static void Nav_stack_move_ptr(BrowserWindow *bw, int offset)
Definition nav.c:83
void a_Nav_set_vsource_url(const DilloUrl *Url)
Definition nav.c:630
void a_Nav_save_url(BrowserWindow *bw, const DilloUrl *url, const char *filename)
Definition nav.c:593
int a_Nav_get_buf(const DilloUrl *Url, char **PBuf, int *BufSize)
Definition nav.c:606
void a_Nav_push(BrowserWindow *bw, const DilloUrl *url, const DilloUrl *requester)
Definition nav.c:342
static void Nav_reload_callback(void *data)
Definition nav.c:500
static void Nav_save_cb(int Op, CacheClient_t *Client)
Definition nav.c:570
static void Nav_save_scroll_pos(BrowserWindow *bw, int idx, int posx, int posy)
Definition nav.c:154
static void Nav_stack_append(BrowserWindow *bw, int url_idx)
Definition nav.c:122
#define NAV_UIDX(bw, i)
Definition nav.h:9
#define NAV_TOP_UIDX(bw)
Definition nav.h:10
DilloPrefs prefs
Global Data.
Definition prefs.c:33
Contains the specific data for a single window.
Definition bw.h:27
int meta_refresh_status
Url for zero-delay redirections in the META element.
Definition bw.h:66
Dlist * nav_stack
The navigation stack (holds indexes to history list)
Definition bw.h:53
int nav_stack_ptr
'nav_stack_ptr' refers to what's being displayed
Definition bw.h:55
DilloUrl * meta_refresh_url
Definition bw.h:67
Data structure for cache clients.
Definition cache.h:60
uint_t BufSize
Valid size of cache-data.
Definition cache.h:65
void * Buf
Pointer to cache-data.
Definition cache.h:64
void * Web
Pointer to the Web structure of our client.
Definition cache.h:68
DilloUrl * home
Definition prefs.h:50
Definition url.h:88
char * filename
Variables for Local saving.
Definition web.hh:34
int flags
Additional info.
Definition web.hh:29
FILE * stream
Definition web.hh:35
BrowserWindow * bw
The requesting browser window [reference].
Definition web.hh:28
int SavedBytes
Definition web.hh:36
void a_Timeout_add(float t, TimeoutCb_t cb, void *cbdata)
Hook a one-time timeout function 'cb' after 't' seconds with 'cbdata" as its data.
Definition timeout.cc:25
void a_Timeout_remove()
Stop running a timeout function.
Definition timeout.cc:41
void a_UIcmd_set_scroll_xy(BrowserWindow *bw, int x, int y)
Definition uicmd.cc:1460
void a_UIcmd_set_msg(BrowserWindow *bw, const char *format,...)
Definition uicmd.cc:1591
void a_UIcmd_open_url_nw(BrowserWindow *bw, const DilloUrl *url)
Definition uicmd.cc:836
void a_UIcmd_set_buttons_sens(BrowserWindow *bw)
Definition uicmd.cc:1605
void a_UIcmd_get_scroll_xy(BrowserWindow *bw, int *x, int *y)
Definition uicmd.cc:1447
void a_UIcmd_set_scroll_by_fragment(BrowserWindow *bw, const char *f)
Definition uicmd.cc:1472
void a_UIcmd_set_location_text(void *vbw, const char *text)
Definition uicmd.cc:1528
void a_UIcmd_open_url_nt(void *vbw, const DilloUrl *url, int focus)
Definition uicmd.cc:852
void a_Url_set_flags(DilloUrl *u, int flags)
Set DilloUrl flags.
Definition url.c:527
int a_Url_cmp(const DilloUrl *A, const DilloUrl *B)
Compare two Url's to check if they're the same, or which one is bigger.
Definition url.c:506
void a_Url_free(DilloUrl *url)
Free a DilloUrl.
Definition url.c:208
DilloUrl * a_Url_dup(const DilloUrl *ori)
Duplicate a Url structure.
Definition url.c:477
#define URL_FRAGMENT(u)
Definition url.h:74
#define URL_PATH(u)
Definition url.h:72
#define URL_E2EQuery
Definition url.h:35
#define URL_FRAGMENT_(u)
Definition url.h:53
#define URL_SpamSafe
Definition url.h:40
#define URL_FLAGS(u)
Definition url.h:79
#define URL_STR(u)
Definition url.h:76
#define URL_ReloadPage
Definition url.h:36
#define URL_STR_(u)
Definition url.h:55
#define URL_SCHEME(u)
Definition url.h:70
#define URL_IgnoreScroll
Definition url.h:39
#define URL_Post
Definition url.h:33
#define URL_ReloadFromCache
Definition url.h:37
DilloWeb * a_Web_new(BrowserWindow *bw, const DilloUrl *url, const DilloUrl *requester)
Allocate and set safe values for a DilloWeb structure.
Definition web.cc:121
#define WEB_RootUrl
Definition web.hh:16
#define WEB_Download
Definition web.hh:19