66 return (nsi) ? nsi->url_idx : -1;
77 return (nsi) ? nsi->url_idx : -1;
129 nsi =
dNew(nav_stack_item, 1);
130 nsi->url_idx = url_idx;
194 const DilloUrl *requester,
int offset)
197 bool_t MustLoad, ForceReload, IgnoreScroll;
198 int x, y, idx, ClientKey;
201 MSG(
"Nav_open_url: new url='%s'\n",
URL_STR_(url));
209 _MSG(
"Nav_open_url: old_url='%s' idx=%d\n",
URL_STR(old_url), idx);
211 if (old_url && !IgnoreScroll) {
214 _MSG(
"Nav_open_url: saved scroll of '%s' at x=%d y=%d\n",
222 MustLoad = ForceReload || !old_url;
274 int m, url_idx, posx, posy, reload, repush, e2equery, goto_old_scroll=
TRUE;
276 char *fragment = NULL;
295 MSG(
"a_Nav_expect_done: repush!\n");
297 MSG(
"a_Nav_expect_done: reload!\n");
305 goto_old_scroll =
FALSE;
309 goto_old_scroll =
TRUE;
310 }
else if (e2equery) {
318 if (goto_old_scroll) {
322 _MSG(
"Nav: expect_done scrolling to x=%d y=%d\n", posx, posy);
323 }
else if (fragment) {
334 _MSG(
"Nav: a_Nav_expect_done\n");
380 _MSG(
">>>> Nav_repush_callback <<<<\n");
396 MSG(
">>>> a_Nav_repush <<<<\n");
407 _MSG(
">>>> Nav_redirection0_callback <<<<\n");
425 _MSG(
">>>> a_Nav_redirection0 <<<<\n");
479 int choice, confirmed = 1;
485 strncmp(
URL_PATH(h_url),
"/vsource/", 9) == 0) {
492 "No",
"Yes",
"Cancel", NULL);
493 confirmed = (choice == 2);
553 fstat(fileno(Web->
stream), &st);
568 const DilloUrl *url,
const char *filename)
bool_t a_Bw_expecting(BrowserWindow *bw)
void a_Bw_expect(BrowserWindow *bw, const DilloUrl *url)
void a_Bw_add_url(BrowserWindow *bw, const DilloUrl *Url)
Add an URL to the browser window's list.
void a_Bw_stop_clients(BrowserWindow *bw, int flags)
Stop the active clients of this bw's top page.
void a_Bw_add_client(BrowserWindow *bw, int Key, int Root)
Add a reference to a cache-client.
void a_Bw_cleanup(BrowserWindow *bw)
Empty RootClients, ImageClients and PageUrls lists and reset progress bar data.
void a_Bw_cancel_expect(BrowserWindow *bw)
const DilloUrl * a_Bw_expected_url(BrowserWindow *bw)
int a_Capi_get_buf(const DilloUrl *Url, char **PBuf, int *BufSize)
Get the cache's buffer for the URL, and its size.
void a_Capi_set_vsource_url(const DilloUrl *url)
Store the last URL requested by "view source".
void a_Capi_unref_buf(const DilloUrl *Url)
Unref the cache's buffer when no longer using it.
int a_Capi_open_url(DilloWeb *web, CA_Callback_t Call, void *CbData)
Most used function for requesting a URL.
const char * a_Capi_get_content_type(const DilloUrl *url)
Get the Content-Type associated with the URL.
char * a_Url_decode_hex_str(const char *str, size_t *p_sz)
int a_Dialog_choice(const char *title, const char *msg,...)
Make a question-dialog with a question and alternatives.
int dStrAsciiCasecmp(const char *s1, const char *s2)
char * dStrdup(const char *s)
int dList_length(Dlist *lp)
For completing the ADT.
void * dList_nth_data(Dlist *lp, int n0)
Return the nth data item, NULL when not found or 'n0' is out of range.
void dList_remove_fast(Dlist *lp, const void *data)
Remove a data item without preserving order.
void dList_append(Dlist *lp, void *data)
Append a data item to the list.
#define dReturn_if_fail(expr)
#define dNew(type, count)
const DilloUrl * a_History_get_url(int idx)
Return the DilloUrl field (by index)
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)
void a_Nav_cancel_expect_if_eq(BrowserWindow *bw, const DilloUrl *url)
int a_Nav_stack_ptr(BrowserWindow *bw)
static void Nav_get_scroll_pos(BrowserWindow *bw, int *posx, int *posy)
void a_Nav_redirection0(BrowserWindow *bw, const DilloUrl *new_url)
void a_Nav_forw(BrowserWindow *bw)
const char * a_Nav_get_content_type(const DilloUrl *url)
static void Nav_repush(BrowserWindow *bw)
int a_Nav_get_top_uidx(BrowserWindow *bw)
void a_Nav_home(BrowserWindow *bw)
void a_Nav_cancel_expect(BrowserWindow *bw)
static void Nav_stack_truncate(BrowserWindow *bw, int pos)
static void Nav_stack_clean(BrowserWindow *bw)
void a_Nav_expect_done(BrowserWindow *bw)
void a_Nav_free(BrowserWindow *bw)
void a_Nav_jump(BrowserWindow *bw, int offset, int new_bw)
static void Nav_open_url(BrowserWindow *bw, const DilloUrl *url, const DilloUrl *requester, int offset)
static void Nav_redirection0_callback(void *data)
void a_Nav_back(BrowserWindow *bw)
int a_Nav_get_uidx(BrowserWindow *bw, int i)
void a_Nav_reload(BrowserWindow *bw)
static void Nav_repush_callback(void *data)
void a_Nav_repush(BrowserWindow *bw)
void a_Nav_unref_buf(const DilloUrl *Url)
int a_Nav_stack_size(BrowserWindow *bw)
static void Nav_stack_move_ptr(BrowserWindow *bw, int offset)
void a_Nav_set_vsource_url(const DilloUrl *Url)
void a_Nav_save_url(BrowserWindow *bw, const DilloUrl *url, const char *filename)
int a_Nav_get_buf(const DilloUrl *Url, char **PBuf, int *BufSize)
void a_Nav_push(BrowserWindow *bw, const DilloUrl *url, const DilloUrl *requester)
static void Nav_reload_callback(void *data)
static void Nav_save_cb(int Op, CacheClient_t *Client)
static void Nav_save_scroll_pos(BrowserWindow *bw, int idx, int posx, int posy)
static void Nav_stack_append(BrowserWindow *bw, int url_idx)
DilloPrefs prefs
Global Data.
Contains the specific data for a single window.
int meta_refresh_status
Url for zero-delay redirections in the META element.
Dlist * nav_stack
The navigation stack (holds indexes to history list)
int nav_stack_ptr
'nav_stack_ptr' refers to what's being displayed
DilloUrl * meta_refresh_url
Data structure for cache clients.
uint_t BufSize
Valid size of cache-data.
void * Buf
Pointer to cache-data.
void * Web
Pointer to the Web structure of our client.
char * filename
Variables for Local saving.
int flags
Additional info.
BrowserWindow * bw
The requesting browser window [reference].
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.
void a_Timeout_remove()
Stop running a timeout function.
void a_UIcmd_set_scroll_xy(BrowserWindow *bw, int x, int y)
void a_UIcmd_set_msg(BrowserWindow *bw, const char *format,...)
void a_UIcmd_open_url_nw(BrowserWindow *bw, const DilloUrl *url)
void a_UIcmd_set_buttons_sens(BrowserWindow *bw)
void a_UIcmd_get_scroll_xy(BrowserWindow *bw, int *x, int *y)
void a_UIcmd_set_scroll_by_fragment(BrowserWindow *bw, const char *f)
void a_UIcmd_set_location_text(void *vbw, const char *text)
void a_Url_set_flags(DilloUrl *u, int flags)
Set DilloUrl flags.
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.
void a_Url_free(DilloUrl *url)
Free a DilloUrl.
DilloUrl * a_Url_dup(const DilloUrl *ori)
Duplicate a Url structure.
#define URL_ReloadFromCache
DilloWeb * a_Web_new(BrowserWindow *bw, const DilloUrl *url, const DilloUrl *requester)
Allocate and set safe values for a DilloWeb structure.