NetSurf
browser_window.h
Go to the documentation of this file.
1/*
2 * Copyright 2003 Phil Mellor <monkeyson@users.sourceforge.net>
3 * Copyright 2006 James Bursa <bursa@users.sourceforge.net>
4 *
5 * This file is part of NetSurf, http://www.netsurf-browser.org/
6 *
7 * NetSurf is free software; you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License as published by
9 * the Free Software Foundation; version 2 of the License.
10 *
11 * NetSurf is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
15 *
16 * You should have received a copy of the GNU General Public License
17 * along with this program. If not, see <http://www.gnu.org/licenses/>.
18 */
19
20/**
21 * \file
22 * Browser window creation and manipulation interface.
23 */
24
25#ifndef NETSURF_BROWSER_WINDOW_H_
26#define NETSURF_BROWSER_WINDOW_H_
27
28#include <stdbool.h>
29#include <stdio.h>
30
31#include "utils/errors.h"
32#include "netsurf/mouse.h"
33#include "netsurf/console.h"
34
35struct browser_window;
36struct hlcache_handle;
37struct gui_window;
38struct history;
39struct selection;
41struct form_control;
42struct nsurl;
43struct rect;
44struct redraw_context;
45struct cert_chain;
46enum content_debug;
47
48/**
49 * type of browser window drag in progess
50 */
51typedef enum {
61
62/**
63 * Browser window page information states
64 */
65typedef enum {
66 PAGE_STATE_UNKNOWN, /**< Unable to determine */
67 PAGE_STATE_INTERNAL, /**< Page loaded from internal handler */
68 PAGE_STATE_LOCAL, /**< Page loaded from file:/// etc */
69 PAGE_STATE_INSECURE, /**< Insecure page load */
70 PAGE_STATE_SECURE_OVERRIDE, /**< Secure load, but had to override */
71 PAGE_STATE_SECURE_ISSUES, /**< Secure load, but has insecure elements */
72 PAGE_STATE_SECURE, /**< Secure load */
73 PAGE_STATE__COUNT, /**< Count of number of valid page states */
75
76typedef enum {
77 BW_EDITOR_NONE = 0, /**< No selection, no editing */
78 BW_EDITOR_CAN_COPY = (1 << 0), /**< Have selection */
79 BW_EDITOR_CAN_CUT = (1 << 1), /**< Selection not read-only */
80 BW_EDITOR_CAN_PASTE = (1 << 2) /**< Can paste, input */
82
83typedef enum {
88
89/** flags to browser_window_create */
91 /** No flags set */
93
94 /** this will form a new history node (don't set for back/reload/etc) */
96
97 /** New gui_window to be tab in same window as "existing" gui_window */
98 BW_CREATE_TAB = (1 << 1),
99
100 /** New gui_window to be clone of "existing" gui_window */
101 BW_CREATE_CLONE = (1 << 2),
102
103 /** Window not opened by user interaction (e.g. JS popup)
104 *
105 * rfc2965:
106 * A transaction is verifiable if the user, or a
107 * user-designated agent, has the option to review
108 * the request-URI prior to its use in the transaction.
109 * A transaction is unverifiable if the user does not
110 * have that option.
111 */
113
114 /** Request foreground opening. */
116
117 /** Request location bar focus. */
119};
120
121/** flags to browser_window_navigate */
123 /** No flags set */
125
126 /** this will form a new history node (don't set for back/reload/etc) */
128
129 /** download rather than render the uri */
131
132 /** Transation not caused by user interaction (e.g. JS-caused)
133 *
134 * rfc2965:
135 * A transaction is verifiable if the user, or a
136 * user-designated agent, has the option to review
137 * the request-URI prior to its use in the transaction.
138 * A transaction is unverifiable if the user does not
139 * have that option.
140 */
142
143 /** suppress initial history updates (used by back/fwd/etc) */
145
146 /** Internal navigation (set only by core features using such) */
147 BW_NAVIGATE_INTERNAL = (1 << 4)
149
150/**
151 * Page features at a specific spatial location.
152 */
154 /** URL of a link or NULL. */
155 struct nsurl *link;
156
157 /** link title text */
159
160 /** link title text length */
162
163 /** Object at position or NULL. */
165
166 /** handle of top level content. */
168
169 /** type of form feature. */
170 enum {
175};
176
177/**
178 * Create and open a new root browser window with the given page.
179 *
180 * \param flags Flags to control operation
181 * \param url URL to fetch in the new window or NULL for blank
182 * \param referrer The referring uri or NULL if none
183 * \param existing The an existing bw or NULL, required for some flags.
184 * \param bw Updated to created browser window or untouched on error.
185 * \return NSERROR_OK, or appropriate error otherwise.
186 */
188 struct nsurl *url, struct nsurl *referrer,
189 struct browser_window *existing,
190 struct browser_window **bw);
191
192/**
193 * Start fetching a page in a browser window.
194 *
195 * \param bw browser window
196 * \param url URL to start fetching
197 * \param flags Flags to control operation
198 * \param referrer The referring uri or NULL if none
199 * \param post_urlenc url encoded post data or NULL if none
200 * \param post_multipart multipart post data or NULL if none
201 * \param parent Parent content or NULL if none
202 *
203 * Any existing fetches in the window are aborted.
204 *
205 * If post_urlenc and post_multipart are NULL the url is fetched using
206 * GET rather than POST.
207 *
208 */
210 struct nsurl *url,
211 struct nsurl *referrer,
212 enum browser_window_nav_flags flags,
213 char *post_urlenc,
214 struct fetch_multipart_data *post_multipart,
215 struct hlcache_handle *parent);
216
217/**
218 * Return true if a browser window can navigate upwards.
219 *
220 * \param bw the browser window to test.
221 * \return true if navigation up is possible otherwise false.
222 */
224
225/**
226 * Navigate to a browser_window's parent URL.
227 *
228 * \param bw browser window
229 * \param new_window whether to open parent in a new window, or existing
230 */
231nserror browser_window_navigate_up(struct browser_window *bw, bool new_window);
232
233/**
234 * Access a browser window's URL. This URL is always without any fragment.
235 *
236 * \param bw browser window
237 * \return pointer to nsurl. Doesn't create a ref for caller.
238 *
239 * \note guaranteed to return a valid nsurl ptr, never returns NULL.
240 */
241struct nsurl* browser_window_access_url(const struct browser_window *bw);
242
243/**
244 * Access a browser window's URL.
245 *
246 * \param[in] bw browser window
247 * \param[in] fragment Whether to include any URL fragment.
248 * \param[out] url_out Returns a ref to the URL on success.
249 * \return NSERROR_OK, or appropriate error otherwise.
250 */
252 struct browser_window *bw,
253 bool fragment,
254 struct nsurl** url_out);
255
256/**
257 * Get the title of a browser_window.
258 *
259 * \param bw The browser window.
260 */
261const char* browser_window_get_title(struct browser_window *bw);
262
263/**
264 * Get a browser window's history object.
265 *
266 * \param bw browser window
267 * \return pointer browser window's history object
268 *
269 * Clients need history object to make use of the history_* functions.
270 */
272
273/**
274 * Get a browser window's content extents.
275 *
276 * \param bw browser window
277 * \param scaled whether to apply current browser window scale
278 * \param width updated to content width extent in px
279 * \param height updated to content height extent in px
280 * \return NSERROR_OK, or appropriate error otherwise.
281 */
283 int *width, int *height);
284
285/**
286 * Find out if a browser window is currently showing a content.
287 *
288 * \param bw browser window
289 * \return true iff browser window is showing a content, else false.
290 */
292
293/**
294 * Get a cache handle for the content within a browser window.
295 */
297
298
299/**
300 * Set the dimensions of the area a browser window occupies
301 *
302 * \param bw The browser window to set dimensions of
303 * \param width Width in pixels
304 * \param height Height in pixels
305 */
307 int width, int height);
308
309
310/**
311 * Stop all fetching activity in a browser window.
312 *
313 * \param bw The browser window to stop activity in.
314 */
315void browser_window_stop(struct browser_window *bw);
316
317
318/**
319 * Reload the page in a browser window.
320 *
321 * \param bw browser window
322 * \param all whether to reload all objects associated with the page
323 * \return NSERROR_OK on success else error code.
324 */
325nserror browser_window_reload(struct browser_window *bw, bool all);
326
327
328/**
329 * Close and destroy a browser window.
330 *
331 * \param bw browser window
332 */
334
335
336/**
337 * Reformat a browser window contents to a new width or height.
338 *
339 * This API is not safe to call from all contexts and care must be used.
340 *
341 * \warning This API is generally only useful within the browser core
342 * and is only exposed for historical reasons. A frontend almost
343 * certianly actually wants browser_window_schedule_reformat() and not
344 * this.
345 *
346 * \param bw The browser window to reformat.
347 * \param background Reformat in the background.
348 * \param width new width
349 * \param height new height
350 */
351void browser_window_reformat(struct browser_window *bw, bool background, int width, int height);
352
353
354/**
355 * Sets the scale of a browser window.
356 *
357 * \param bw The browser window to scale.
358 * \param scale The new scale.
359 * \param absolute If the scale value is absolute or relative to current value
360 * \return NSERROR_OK and scale applied else other error code caused by reflow etc.
361 */
362nserror browser_window_set_scale(struct browser_window *bw, float scale, bool absolute);
363
364
365/**
366 * Gets the scale of a browser window
367 *
368 * \param bw The browser window to get the scale of.
369 * \return The scale of the window.
370 */
372
373
374/**
375 * Get access to any page features at the given coordinates.
376 *
377 * Fetches page features like content, link URLs and objects (images)
378 * at the specified co-ordinates within the browsing context.
379 *
380 * Fields within the supplied features structure are updated with
381 * pointers to any relevent content, or set to NULL if none.
382 *
383 * \param[in] bw browser window to examine.
384 * \param[in] x x-coordinate of point of interest
385 * \param[in] y y-coordinate of point of interest
386 * \param[out] data Feature structure to update.
387 * \return NSERROR_OK or appropriate error code on faliure.
388 */
390 int x, int y, struct browser_window_features *data);
391
392
393/**
394 * Send a scroll request to a browser window at a particular point. The
395 * 'deepest' scrollable object which can be scrolled in the requested
396 * direction at the given point will consume the scroll.
397 *
398 * \param bw browser window to look inside
399 * \param x x-coordinate of point of interest
400 * \param y y-coordinate of point of interest
401 * \param scrx number of px try to scroll something in x direction
402 * \param scry number of px try to scroll something in y direction
403 * \return true iff scroll request has been consumed
404 */
406 int x, int y, int scrx, int scry);
407
408
409/**
410 * Drop a file onto a browser window at a particular point, or determine if a
411 * file may be dropped onto the content at given point.
412 *
413 * \param bw browser window to look inside
414 * \param x x-coordinate of point of interest
415 * \param y y-coordinate of point of interest
416 * \param file path to file to be dropped, or NULL to know if drop allowed
417 * \return true iff file drop has been handled, or if drop possible (NULL file)
418 */
420 int x, int y, char *file);
421
422
423/**
424 * set filename on form control.
425 *
426 * \param bw browser window to look inside.
427 * \param gadget form control.
428 * \param fn filename to set.
429 */
431 struct form_control *gadget, const char *fn);
432
433
434/**
435 * Update URL bar for a given browser window to bw's content's URL
436 *
437 * \param bw Browser window to update URL bar for.
438 */
440
441
442/**
443 * Handle mouse clicks in a browser window.
444 *
445 * \param bw browser window
446 * \param mouse state of mouse buttons and modifier keys
447 * \param x coordinate of mouse
448 * \param y coordinate of mouse
449 */
451 browser_mouse_state mouse, int x, int y);
452
453
454/**
455 * Handle non-click mouse action in a browser window. (drag ends, movements)
456 *
457 * \param bw browser window
458 * \param mouse state of mouse buttons and modifier keys
459 * \param x coordinate of mouse
460 * \param y coordinate of mouse
461 */
463 browser_mouse_state mouse, int x, int y);
464
465
466/**
467 * Locate a browser window in the specified stack according.
468 *
469 * \param bw the browser_window to search all relatives of
470 * \param target the target to locate
471 * \param mouse The current mouse state
472 * \return The browser window the mouse is in
473 */
475 struct browser_window *bw, const char *target,
476 browser_mouse_state mouse);
477
478
479/**
480 * Reformat the browser window contents in a safe context.
481 *
482 * The browser_window_reformat() call cannot safely be called from some
483 * contexts, This interface allows for the reformat to happen from a safe
484 * top level context.
485 *
486 * The reformat uses the window table get_dimensions() callback as the
487 * correct viewport dimensions are only available to the frontend.
488 *
489 * \param bw The browser window to reformat the content of.
490 * \return NSERROR_OK on success else appropriate error code.
491 */
493
494
495/**
496 * Change the shape of the mouse pointer
497 *
498 * \param bw Browser window to set shape in
499 * \param shape The pointer shape to use
500 */
503
504
505/**
506 * Start drag scrolling the contents of the browser window
507 *
508 * \param bw browser window
509 * \param x x ordinate of initial mouse position
510 * \param y y ordinate
511 */
512void browser_window_page_drag_start(struct browser_window *bw, int x, int y);
513
514
515/**
516 * Check availability of Back action for a given browser window
517 *
518 * \param bw browser window
519 * \return true if Back action is available
520 */
522
523
524/**
525 * Check availability of Forward action for a given browser window
526 *
527 * \param bw browser window
528 * \return true if Forward action is available
529 */
531
532
533/**
534 * Check availability of Reload action for a given browser window
535 *
536 * \param bw browser window
537 * \return true if Reload action is available
538 */
540
541
542/**
543 * Check availability of Stop action for a given browser window
544 *
545 * \param bw browser window
546 * \return true if Stop action is available
547 */
549
550
551/**
552 * Redraw an area of a window.
553 *
554 * Calls the redraw function for the content.
555 *
556 * \param bw The window to redraw
557 * \param x coordinate for top-left of redraw
558 * \param y coordinate for top-left of redraw
559 * \param clip clip rectangle coordinates
560 * \param ctx redraw context
561 * \return true if successful, false otherwise
562 *
563 * The clip rectangle is guaranteed to be filled to its extents, so there is
564 * no need to render a solid background first.
565 *
566 * x, y and clip are coordinates from the top left of the canvas area.
567 *
568 * The top left corner of the clip rectangle is (x0, y0) and
569 * the bottom right corner of the clip rectangle is (x1, y1).
570 * Units for x, y and clip are pixels.
571 */
572bool browser_window_redraw(struct browser_window *bw, int x, int y,
573 const struct rect *clip, const struct redraw_context *ctx);
574
575
576/**
577 * Check whether browser window is ready for redraw
578 *
579 * \param bw The window to redraw
580 * \return true if browser window is ready for redraw
581 */
583
584/**
585 * Get the position of the current browser window with respect to the root or
586 * parent browser window
587 *
588 * \param bw browser window to get the position of
589 * \param root true if we want position wrt root bw, false if wrt parent bw
590 * \param pos_x updated to x position of bw
591 * \param pos_y updated to y position of bw
592 */
594 int *pos_x, int *pos_y);
595
596/**
597 * Set the position of the current browser window with respect to the parent
598 * browser window
599 *
600 * \param bw browser window to set the position of
601 * \param x x position of bw
602 * \param y y position of bw
603 */
604void browser_window_set_position(struct browser_window *bw, int x, int y);
605
606
607/**
608 * Set drag type for a browser window, and inform front end
609 *
610 * \param bw browser window to set the type of the current drag for
611 * \param type drag type
612 * \param rect area pointer may be confined to, during drag, or NULL
613 */
615 browser_drag_type type, const struct rect *rect);
616
617/**
618 * Get type of any current drag for a browser window
619 *
620 * \param bw browser window to set the type of the current drag for
621 * \return drag type
622 */
624
625/**
626 * Check whether browser window can accept a cut/copy/paste, or has a selection
627 * that could be saved.
628 *
629 * \param bw The browser window
630 * \return flags indicating editor flags
631 */
633
634/**
635 * Find out if given browser window content is selectable
636 *
637 * \param bw browser window to look at
638 * \return true iff browser window is selectable
639 */
641
642/**
643 * Get the current selection from a root browser window, ownership passed to
644 * caller, who must free() it.
645 *
646 * \param bw The browser window
647 * \return the selected text string, or NULL
648 */
650
651/**
652 * Find out if given browser window can be searched
653 *
654 * \param bw browser window to look at
655 * \return true iff browser window is searchable
656 */
658
659/**
660 * Find out if a browser window contains a frameset
661 *
662 * \param bw browser window to look at
663 * \return true iff browser window contains a frameset
664 */
666
667/**
668 * Get the browser window's scrollbar details.
669 *
670 * Vertical and horizontal scrollbars may be {YES|NO|AUTO}, although
671 * it is entirely up to the front end whether this is implemented.
672 * e.g. if the gui toolkit style-guide says all windows must have
673 * scrollbars then this API can be ignored.
674 *
675 * \param bw browser window to look at
676 * \param h Updated to indicate horizontal scrollbar type
677 * \param v Updated to indicate vertical scrollbar type
678 * \return NSERROR_OK, or appropriate error otherwise
679 */
682
683
684/**
685 * Dump debug info concerning the browser window's contents to file
686 *
687 * \param bw The browser window.
688 * \param f The file to dump to.
689 * \param op The debug operation type to dump.
690 * \return NSERROR_OK on success or error code on faliure.
691 */
693
694/**
695 * Set debug options on a window
696 *
697 * \param bw The browser window.
698 * \param op The debug operation type.
699 * \return NSERROR_OK on success or error code on faliure.
700 */
702
703/**
704 * Obtain a browsing contexts name.
705 *
706 * The returned pointer is owned bu the browsing context and is only
707 * valid untill the next operation on that context.
708 * The returned name may be NULL if no name has been set.
709 * \todo This does not consider behaviour wrt frames
710 *
711 * \param bw The browser window.
712 * \param name recives result string.
713 * \return NSERROR_OK
714 */
716
717/**
718 * Set a browsing contexts name.
719 *
720 * Changes a browsing contexts name to a copy of that passed and the
721 * value is not subsequently referenced.
722 *
723 * \param bw The browser window.
724 * \param name The name string to set.
725 * \return NSERROR_OK and the name is updated or NSERROR_NOMEM and the
726 * original name is untouched.
727 */
729
730/**
731 * Execute some JavaScript code in a browsing context.
732 *
733 * Runs the passed in JavaScript code in the browsing context.
734 *
735 * \param bw The browser window
736 * \param src The JavaScript source code
737 * \param srclen The length of the source code
738 * \return Whether the JS function was successfully injected into the content
739 */
740bool browser_window_exec(struct browser_window *bw, const char *src, size_t srclen);
741
742/**
743 * Log a console message into the browser window console.
744 *
745 * If the targetted browser window is a frame, the message will be bubbled
746 * to the outermost window to be logged.
747 *
748 * \param bw The browser window
749 * \param src The source of the message
750 * \param msg The text of the message
751 * \param msglen The length of the text of the message
752 * \param flags Flags for the message
753 * \return Whether or not the logged message succeeded in being stored
754 */
757 const char *msg,
758 size_t msglen,
760
761/**
762 * Request the current browser window page info state.
763 *
764 * The page information state is an indicator enumeration to be used by
765 * frontends to indicate to the user if the page they are viewing is able
766 * to be trusted. This is often shown as a padlock of some kind.
767 *
768 * This is also used by the internal page information corewindow to render
769 * to the user what the situation is.
770 *
771 * \param bw The browser window
772 * \return The state of the browser window
773 */
775 const struct browser_window *bw);
776
777/**
778 * Request the current browser window SSL certificate chain.
779 *
780 * When the page has SSL information, this will retrieve the certificate chain.
781 *
782 * If there is no chain available, this will return NSERROR_NOT_FOUND
783 *
784 * \param bw The browser window
785 * \param chain Pointer to be filled out with certificate chain
786 * \return Whether or not the chain is available
787 */
789
790/**
791 * Get the number of cookies in use for the current page.
792 *
793 * \param bw A browser window.
794 * \return Number of cookies in use, or 0 on error.
795 */
797 const struct browser_window *bw);
798
799/**
800 * Open cookie viewer for the current page.
801 *
802 * \param bw A browser window.
803 * \return NSERROR_OK, or appropriate error otherwise.
804 */
806 const struct browser_window *bw);
807
808/**
809 * Show the certificate page for the current page.
810 *
811 * Does nothing for a page without certificates.
812 *
813 * \param bw A browser window.
814 * \return NSERROR_OK, or appropriate error otherwise.
815 */
817 struct browser_window *bw);
818
819#endif
nserror browser_window_schedule_reformat(struct browser_window *bw)
Reformat the browser window contents in a safe context.
bool browser_window_redraw_ready(struct browser_window *bw)
Check whether browser window is ready for redraw.
browser_drag_type
type of browser window drag in progess
@ DRAGGING_SELECTION
@ DRAGGING_SCR_Y
@ DRAGGING_CONTENT_SCROLLBAR
@ DRAGGING_SCR_X
@ DRAGGING_NONE
@ DRAGGING_OTHER
@ DRAGGING_PAGE_SCROLL
@ DRAGGING_FRAME
nserror browser_window_show_certificates(struct browser_window *bw)
Show the certificate page for the current page.
void browser_window_page_drag_start(struct browser_window *bw, int x, int y)
Start drag scrolling the contents of the browser window.
bool browser_window_can_select(struct browser_window *bw)
Find out if given browser window content is selectable.
nserror browser_window_refresh_url_bar(struct browser_window *bw)
Update URL bar for a given browser window to bw's content's URL.
nserror browser_window_get_features(struct browser_window *bw, int x, int y, struct browser_window_features *data)
Get access to any page features at the given coordinates.
nserror browser_window_navigate(struct browser_window *bw, struct nsurl *url, struct nsurl *referrer, enum browser_window_nav_flags flags, char *post_urlenc, struct fetch_multipart_data *post_multipart, struct hlcache_handle *parent)
Start fetching a page in a browser window.
bool browser_window_redraw(struct browser_window *bw, int x, int y, const struct rect *clip, const struct redraw_context *ctx)
Redraw an area of a window.
float browser_window_get_scale(struct browser_window *bw)
Gets the scale of a browser window.
void browser_window_set_drag_type(struct browser_window *bw, browser_drag_type type, const struct rect *rect)
Set drag type for a browser window, and inform front end.
bool browser_window_has_content(struct browser_window *bw)
Find out if a browser window is currently showing a content.
bool browser_window_back_available(struct browser_window *bw)
Check availability of Back action for a given browser window.
nserror browser_window_get_ssl_chain(struct browser_window *bw, struct cert_chain **chain)
Request the current browser window SSL certificate chain.
bool browser_window_exec(struct browser_window *bw, const char *src, size_t srclen)
Execute some JavaScript code in a browsing context.
nserror browser_window_get_scrollbar_type(struct browser_window *bw, browser_scrolling *h, browser_scrolling *v)
Get the browser window's scrollbar details.
nserror browser_window_debug(struct browser_window *bw, enum content_debug op)
Set debug options on a window.
nserror browser_window_get_url(struct browser_window *bw, bool fragment, struct nsurl **url_out)
Access a browser window's URL.
bool browser_window_can_search(struct browser_window *bw)
Find out if given browser window can be searched.
void browser_window_mouse_click(struct browser_window *bw, browser_mouse_state mouse, int x, int y)
Handle mouse clicks in a browser window.
bool browser_window_scroll_at_point(struct browser_window *bw, int x, int y, int scrx, int scry)
Send a scroll request to a browser window at a particular point.
nserror browser_window_console_log(struct browser_window *bw, browser_window_console_source src, const char *msg, size_t msglen, browser_window_console_flags flags)
Log a console message into the browser window console.
nserror browser_window_show_cookies(const struct browser_window *bw)
Open cookie viewer for the current page.
bool browser_window_up_available(struct browser_window *bw)
Return true if a browser window can navigate upwards.
void browser_window_destroy(struct browser_window *bw)
Close and destroy a browser window.
void browser_window_set_position(struct browser_window *bw, int x, int y)
Set the position of the current browser window with respect to the parent browser window.
nserror browser_window_navigate_up(struct browser_window *bw, bool new_window)
Navigate to a browser_window's parent URL.
nserror browser_window_reload(struct browser_window *bw, bool all)
Reload the page in a browser window.
browser_editor_flags
@ BW_EDITOR_CAN_PASTE
Can paste, input.
@ BW_EDITOR_NONE
No selection, no editing.
@ BW_EDITOR_CAN_CUT
Selection not read-only.
@ BW_EDITOR_CAN_COPY
Have selection.
browser_scrolling
@ BW_SCROLLING_AUTO
@ BW_SCROLLING_NO
@ BW_SCROLLING_YES
struct nsurl * browser_window_access_url(const struct browser_window *bw)
Access a browser window's URL.
bool browser_window_reload_available(struct browser_window *bw)
Check availability of Reload action for a given browser window.
bool browser_window_forward_available(struct browser_window *bw)
Check availability of Forward action for a given browser window.
browser_window_page_info_state
Browser window page information states.
@ PAGE_STATE_INSECURE
Insecure page load.
@ PAGE_STATE_UNKNOWN
Unable to determine.
@ PAGE_STATE_SECURE_ISSUES
Secure load, but has insecure elements.
@ PAGE_STATE__COUNT
Count of number of valid page states.
@ PAGE_STATE_SECURE
Secure load.
@ PAGE_STATE_SECURE_OVERRIDE
Secure load, but had to override.
@ PAGE_STATE_LOCAL
Page loaded from file:/// etc.
@ PAGE_STATE_INTERNAL
Page loaded from internal handler.
void browser_window_set_dimensions(struct browser_window *bw, int width, int height)
Set the dimensions of the area a browser window occupies.
char * browser_window_get_selection(struct browser_window *bw)
Get the current selection from a root browser window, ownership passed to caller, who must free() it.
const char * browser_window_get_title(struct browser_window *bw)
Get the title of a browser_window.
int browser_window_get_cookie_count(const struct browser_window *bw)
Get the number of cookies in use for the current page.
nserror browser_window_get_extents(struct browser_window *bw, bool scaled, int *width, int *height)
Get a browser window's content extents.
nserror browser_window_create(enum browser_window_create_flags flags, struct nsurl *url, struct nsurl *referrer, struct browser_window *existing, struct browser_window **bw)
Create and open a new root browser window with the given page.
void browser_window_stop(struct browser_window *bw)
Stop all fetching activity in a browser window.
bool browser_window_is_frameset(struct browser_window *bw)
Find out if a browser window contains a frameset.
nserror browser_window_set_scale(struct browser_window *bw, float scale, bool absolute)
Sets the scale of a browser window.
struct history * browser_window_get_history(struct browser_window *bw)
Get a browser window's history object.
void browser_window_reformat(struct browser_window *bw, bool background, int width, int height)
Reformat a browser window contents to a new width or height.
void browser_window_get_position(struct browser_window *bw, bool root, int *pos_x, int *pos_y)
Get the position of the current browser window with respect to the root or parent browser window.
nserror browser_window_set_name(struct browser_window *bw, const char *name)
Set a browsing contexts name.
browser_window_page_info_state browser_window_get_page_info_state(const struct browser_window *bw)
Request the current browser window page info state.
struct hlcache_handle * browser_window_get_content(struct browser_window *bw)
Get a cache handle for the content within a browser window.
nserror browser_window_debug_dump(struct browser_window *bw, FILE *f, enum content_debug op)
Dump debug info concerning the browser window's contents to file.
browser_editor_flags browser_window_get_editor_flags(struct browser_window *bw)
Check whether browser window can accept a cut/copy/paste, or has a selection that could be saved.
browser_window_create_flags
flags to browser_window_create
@ BW_CREATE_HISTORY
this will form a new history node (don't set for back/reload/etc)
@ BW_CREATE_TAB
New gui_window to be tab in same window as "existing" gui_window.
@ BW_CREATE_FOREGROUND
Request foreground opening.
@ BW_CREATE_CLONE
New gui_window to be clone of "existing" gui_window.
@ BW_CREATE_FOCUS_LOCATION
Request location bar focus.
@ BW_CREATE_UNVERIFIABLE
Window not opened by user interaction (e.g.
@ BW_CREATE_NONE
No flags set.
bool browser_window_stop_available(struct browser_window *bw)
Check availability of Stop action for a given browser window.
struct browser_window * browser_window_find_target(struct browser_window *bw, const char *target, browser_mouse_state mouse)
Locate a browser window in the specified stack according.
bool browser_window_drop_file_at_point(struct browser_window *bw, int x, int y, char *file)
Drop a file onto a browser window at a particular point, or determine if a file may be dropped onto t...
nserror browser_window_get_name(struct browser_window *bw, const char **name)
Obtain a browsing contexts name.
browser_window_nav_flags
flags to browser_window_navigate
@ BW_NAVIGATE_DOWNLOAD
download rather than render the uri
@ BW_NAVIGATE_HISTORY
this will form a new history node (don't set for back/reload/etc)
@ BW_NAVIGATE_NO_TERMINAL_HISTORY_UPDATE
suppress initial history updates (used by back/fwd/etc)
@ BW_NAVIGATE_NONE
No flags set.
@ BW_NAVIGATE_UNVERIFIABLE
Transation not caused by user interaction (e.g.
@ BW_NAVIGATE_INTERNAL
Internal navigation (set only by core features using such)
browser_drag_type browser_window_get_drag_type(struct browser_window *bw)
Get type of any current drag for a browser window.
void browser_window_mouse_track(struct browser_window *bw, browser_mouse_state mouse, int x, int y)
Handle non-click mouse action in a browser window.
void browser_window_set_pointer(struct browser_window *bw, browser_pointer_shape shape)
Change the shape of the mouse pointer.
void browser_window_set_gadget_filename(struct browser_window *bw, struct form_control *gadget, const char *fn)
set filename on form control.
Browser window console stuff.
browser_window_console_source
Sources of messages which end up in the browser window console.
Definition: console.h:30
browser_window_console_flags
Flags for browser window console logging.
Definition: console.h:41
content_debug
Debugging dump operations.
Definition: content_type.h:30
wimp_w parent
Definition: dialog.c:88
Error codes.
nserror
Enumeration of error codes.
Definition: errors.h:29
static struct directory * root
Definition: filename.c:55
const char * type
Definition: filetype.cpp:44
Core mouse and pointer states.
browser_pointer_shape
Mouse pointer type.
Definition: mouse.h:135
browser_mouse_state
Mouse state: 1 is primary mouse button.
Definition: mouse.h:52
struct nsurl nsurl
NetSurf URL object.
Definition: nsurl.h:31
int width
Definition: gui.c:161
int height
Definition: gui.c:162
Page features at a specific spatial location.
char * link_title
link title text
struct hlcache_handle * object
Object at position or NULL.
size_t link_title_length
link title text length
struct hlcache_handle * main
handle of top level content.
enum browser_window_features::@56 form_features
type of form feature.
struct nsurl * link
URL of a link or NULL.
Browser window data.
int x
Window dimensions.
struct browser_window * bw
char * name
frame name for targetting
X509 certificate chain.
Definition: ssl_certs.h:59
Fetch POST multipart data.
Definition: fetch.h:109
Form control.
Definition: form_internal.h:73
first entry in window list
Definition: gui.c:298
History tree for a window.
High-level cache handle.
Definition: hlcache.c:66
Rectangle coordinates.
Definition: types.h:40
Redraw context.
Definition: plotters.h:51
static nserror clip(const struct redraw_context *ctx, const struct rect *clip)
Sets a clip rectangle for subsequent plot operations.
Definition: plot.c:357