Dillo v3.1.1-98-g318d1f14
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 to next page in the history list
451 */
453{
454 int idx = a_Nav_stack_ptr(bw);
455
457 if (++idx < a_Nav_stack_size(bw)) {
458 a_UIcmd_set_msg(bw, "");
459 Nav_open_url(bw, a_History_get_url(NAV_UIDX(bw,idx)), NULL, +1);
460 }
461}
462
463/*
464 * Redirect the browser to the HOME page!
465 */
467{
468 a_Nav_push(bw, prefs.home, NULL);
469}
470
471/*
472 * This one does a_Nav_reload's job!
473 */
474static void Nav_reload_callback(void *data)
475{
476 BrowserWindow *bw = data;
477 const DilloUrl *h_url;
478 DilloUrl *r_url;
479 int choice, confirmed = 1;
480
482 if (a_Nav_stack_size(bw)) {
483 h_url = a_History_get_url(NAV_TOP_UIDX(bw));
484 if (dStrAsciiCasecmp(URL_SCHEME(h_url), "dpi") == 0 &&
485 strncmp(URL_PATH(h_url), "/vsource/", 9) == 0) {
486 /* allow reload for view source dpi */
487 confirmed = 1;
488 } else if (URL_FLAGS(h_url) & URL_Post) {
489 /* Attempt to repost data, let's confirm... */
490 choice = a_Dialog_choice("Dillo: Repost form?",
491 "Repost form data?",
492 "No", "Yes", "Cancel", NULL);
493 confirmed = (choice == 2); /* "Yes" */
494 }
495
496 if (confirmed) {
497 r_url = a_Url_dup(h_url);
498 /* Mark URL as reload to differentiate from push */
500 /* Let's make reload be end-to-end */
501 a_Url_set_flags(r_url, URL_FLAGS(r_url) | URL_E2EQuery);
502 /* This is an explicit reload, so clear the SpamSafe flag */
503 a_Url_set_flags(r_url, URL_FLAGS(r_url) & ~URL_SpamSafe);
504 a_Bw_expect(bw, r_url);
505 Nav_open_url(bw, r_url, NULL, 0);
506 a_Url_free(r_url);
507 }
508 }
509}
510
511/*
512 * Implement the RELOAD button functionality.
513 * (Currently it only reloads the page, not its images)
514 * Note: the timeout lets CCC operations end before making the request.
515 */
517{
518 dReturn_if_fail (bw != NULL);
519 a_Timeout_add(0.0, Nav_reload_callback, (void*)bw);
520}
521
522/*
523 * Jump to a URL in the Navigation stack.
524 */
525void a_Nav_jump(BrowserWindow *bw, int offset, int new_bw)
526{
527 int idx = a_Nav_stack_ptr(bw) + offset;
528
529 if (new_bw) {
531 } else {
533 Nav_open_url(bw, a_History_get_url(NAV_UIDX(bw,idx)), NULL, offset);
535 }
536}
537
538
539/* Specific methods -------------------------------------------------------- */
540
541/*
542 * Receive data from the cache and save it to a local file
543 */
544static void Nav_save_cb(int Op, CacheClient_t *Client)
545{
546 DilloWeb *Web = Client->Web;
547 int Bytes;
548
549 if (Op){
550 struct stat st;
551
552 fflush(Web->stream);
553 fstat(fileno(Web->stream), &st);
554 fclose(Web->stream);
555 a_UIcmd_set_msg(Web->bw, "File saved (%d Bytes)", st.st_size);
556 } else {
557 if ((Bytes = Client->BufSize - Web->SavedBytes) > 0) {
558 Bytes = fwrite((char *) Client->Buf + Web->SavedBytes, 1, Bytes, Web->stream);
559 Web->SavedBytes += Bytes;
560 }
561 }
562}
563
564/*
565 * Save a URL (from cache or from the net).
566 */
568 const DilloUrl *url, const char *filename)
569{
570 DilloWeb *Web = a_Web_new(bw, url, NULL);
571 Web->filename = dStrdup(filename);
572 Web->flags |= WEB_Download;
573 /* TODO: keep track of this client */
574 a_Capi_open_url(Web, Nav_save_cb, Web);
575}
576
577/*
578 * Wrapper for a_Capi_get_buf.
579 */
580int a_Nav_get_buf(const DilloUrl *Url, char **PBuf, int *BufSize)
581{
582 return a_Capi_get_buf(Url, PBuf, BufSize);
583}
584
585/*
586 * Wrapper for a_Capi_unref_buf().
587 */
588void a_Nav_unref_buf(const DilloUrl *Url)
589{
590 a_Capi_unref_buf(Url);
591}
592
593/*
594 * Wrapper for a_Capi_get_content_type().
595 */
596const char *a_Nav_get_content_type(const DilloUrl *url)
597{
598 return a_Capi_get_content_type(url);
599}
600
601/*
602 * Wrapper for a_Capi_set_vsource_url().
603 */
605{
607}
#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:541
void a_Capi_set_vsource_url(const DilloUrl *url)
Store the last URL requested by "view source".
Definition capi.c:223
void a_Capi_unref_buf(const DilloUrl *Url)
Unref the cache's buffer when no longer using it.
Definition capi.c:549
int a_Capi_open_url(DilloWeb *web, CA_Callback_t Call, void *CbData)
Most used function for requesting a URL.
Definition capi.c:392
const char * a_Capi_get_content_type(const DilloUrl *url)
Get the Content-Type associated with the URL.
Definition capi.c:557
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:452
const char * a_Nav_get_content_type(const DilloUrl *url)
Definition nav.c:596
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:466
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:525
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:516
static void Nav_repush_callback(void *data)
Definition nav.c:378
void a_Nav_repush(BrowserWindow *bw)
Definition nav.c:393
void a_Nav_unref_buf(const DilloUrl *Url)
Definition nav.c:588
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:604
void a_Nav_save_url(BrowserWindow *bw, const DilloUrl *url, const char *filename)
Definition nav.c:567
int a_Nav_get_buf(const DilloUrl *Url, char **PBuf, int *BufSize)
Definition nav.c:580
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:474
static void Nav_save_cb(int Op, CacheClient_t *Client)
Definition nav.c:544
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:48
uint_t BufSize
Valid size of cache-data.
Definition cache.h:53
void * Buf
Pointer to cache-data.
Definition cache.h:52
void * Web
Pointer to the Web structure of our client.
Definition cache.h:56
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:1432
void a_UIcmd_set_msg(BrowserWindow *bw, const char *format,...)
Definition uicmd.cc:1563
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:1577
void a_UIcmd_get_scroll_xy(BrowserWindow *bw, int *x, int *y)
Definition uicmd.cc:1419
void a_UIcmd_set_scroll_by_fragment(BrowserWindow *bw, const char *f)
Definition uicmd.cc:1444
void a_UIcmd_set_location_text(void *vbw, const char *text)
Definition uicmd.cc:1500
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