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 /** Object at position or NULL. */
159
160 /** handle of top level content. */
162
163 /** type of form feature. */
164 enum {
169};
170
171/**
172 * Create and open a new root browser window with the given page.
173 *
174 * \param flags Flags to control operation
175 * \param url URL to fetch in the new window or NULL for blank
176 * \param referrer The referring uri or NULL if none
177 * \param existing The an existing bw or NULL, required for some flags.
178 * \param bw Updated to created browser window or untouched on error.
179 * \return NSERROR_OK, or appropriate error otherwise.
180 */
182 struct nsurl *url, struct nsurl *referrer,
183 struct browser_window *existing,
184 struct browser_window **bw);
185
186/**
187 * Start fetching a page in a browser window.
188 *
189 * \param bw browser window
190 * \param url URL to start fetching
191 * \param flags Flags to control operation
192 * \param referrer The referring uri or NULL if none
193 * \param post_urlenc url encoded post data or NULL if none
194 * \param post_multipart multipart post data or NULL if none
195 * \param parent Parent content or NULL if none
196 *
197 * Any existing fetches in the window are aborted.
198 *
199 * If post_urlenc and post_multipart are NULL the url is fetched using
200 * GET rather than POST.
201 *
202 */
204 struct nsurl *url,
205 struct nsurl *referrer,
206 enum browser_window_nav_flags flags,
207 char *post_urlenc,
208 struct fetch_multipart_data *post_multipart,
209 struct hlcache_handle *parent);
210
211/**
212 * Return true if a browser window can navigate upwards.
213 *
214 * \param bw the browser window to test.
215 * \return true if navigation up is possible otherwise false.
216 */
218
219/**
220 * Navigate to a browser_window's parent URL.
221 *
222 * \param bw browser window
223 * \param new_window whether to open parent in a new window, or existing
224 */
225nserror browser_window_navigate_up(struct browser_window *bw, bool new_window);
226
227/**
228 * Access a browser window's URL. This URL is always without any fragment.
229 *
230 * \param bw browser window
231 * \return pointer to nsurl. Doesn't create a ref for caller.
232 *
233 * \note guaranteed to return a valid nsurl ptr, never returns NULL.
234 */
235struct nsurl* browser_window_access_url(const struct browser_window *bw);
236
237/**
238 * Access a browser window's URL.
239 *
240 * \param[in] bw browser window
241 * \param[in] fragment Whether to include any URL fragment.
242 * \param[out] url_out Returns a ref to the URL on success.
243 * \return NSERROR_OK, or appropriate error otherwise.
244 */
246 struct browser_window *bw,
247 bool fragment,
248 struct nsurl** url_out);
249
250/**
251 * Get the title of a browser_window.
252 *
253 * \param bw The browser window.
254 */
255const char* browser_window_get_title(struct browser_window *bw);
256
257/**
258 * Get a browser window's history object.
259 *
260 * \param bw browser window
261 * \return pointer browser window's history object
262 *
263 * Clients need history object to make use of the history_* functions.
264 */
266
267/**
268 * Get a browser window's content extents.
269 *
270 * \param bw browser window
271 * \param scaled whether to apply current browser window scale
272 * \param width updated to content width extent in px
273 * \param height updated to content height extent in px
274 * \return NSERROR_OK, or appropriate error otherwise.
275 */
277 int *width, int *height);
278
279/**
280 * Find out if a browser window is currently showing a content.
281 *
282 * \param bw browser window
283 * \return true iff browser window is showing a content, else false.
284 */
286
287/**
288 * Get a cache handle for the content within a browser window.
289 */
291
292
293/**
294 * Set the dimensions of the area a browser window occupies
295 *
296 * \param bw The browser window to set dimensions of
297 * \param width Width in pixels
298 * \param height Height in pixels
299 */
301 int width, int height);
302
303
304/**
305 * Stop all fetching activity in a browser window.
306 *
307 * \param bw The browser window to stop activity in.
308 */
309void browser_window_stop(struct browser_window *bw);
310
311
312/**
313 * Reload the page in a browser window.
314 *
315 * \param bw browser window
316 * \param all whether to reload all objects associated with the page
317 * \return NSERROR_OK on success else error code.
318 */
319nserror browser_window_reload(struct browser_window *bw, bool all);
320
321
322/**
323 * Close and destroy a browser window.
324 *
325 * \param bw browser window
326 */
328
329
330/**
331 * Reformat a browser window contents to a new width or height.
332 *
333 * This API is not safe to call from all contexts and care must be used.
334 *
335 * \warning This API is generally only useful within the browser core
336 * and is only exposed for historical reasons. A frontend almost
337 * certianly actually wants browser_window_schedule_reformat() and not
338 * this.
339 *
340 * \param bw The browser window to reformat.
341 * \param background Reformat in the background.
342 * \param width new width
343 * \param height new height
344 */
345void browser_window_reformat(struct browser_window *bw, bool background, int width, int height);
346
347
348/**
349 * Sets the scale of a browser window.
350 *
351 * \param bw The browser window to scale.
352 * \param scale The new scale.
353 * \param absolute If the scale value is absolute or relative to current value
354 * \return NSERROR_OK and scale applied else other error code caused by reflow etc.
355 */
356nserror browser_window_set_scale(struct browser_window *bw, float scale, bool absolute);
357
358
359/**
360 * Gets the scale of a browser window
361 *
362 * \param bw The browser window to get the scale of.
363 * \return The scale of the window.
364 */
366
367
368/**
369 * Get access to any page features at the given coordinates.
370 *
371 * Fetches page features like content, link URLs and objects (images)
372 * at the specified co-ordinates within the browsing context.
373 *
374 * Fields within the supplied features structure are updated with
375 * pointers to any relevent content, or set to NULL if none.
376 *
377 * \param[in] bw browser window to examine.
378 * \param[in] x x-coordinate of point of interest
379 * \param[in] y y-coordinate of point of interest
380 * \param[out] data Feature structure to update.
381 * \return NSERROR_OK or appropriate error code on faliure.
382 */
384 int x, int y, struct browser_window_features *data);
385
386
387/**
388 * Send a scroll request to a browser window at a particular point. The
389 * 'deepest' scrollable object which can be scrolled in the requested
390 * direction at the given point will consume the scroll.
391 *
392 * \param bw browser window to look inside
393 * \param x x-coordinate of point of interest
394 * \param y y-coordinate of point of interest
395 * \param scrx number of px try to scroll something in x direction
396 * \param scry number of px try to scroll something in y direction
397 * \return true iff scroll request has been consumed
398 */
400 int x, int y, int scrx, int scry);
401
402
403/**
404 * Drop a file onto a browser window at a particular point, or determine if a
405 * file may be dropped onto the content at given point.
406 *
407 * \param bw browser window to look inside
408 * \param x x-coordinate of point of interest
409 * \param y y-coordinate of point of interest
410 * \param file path to file to be dropped, or NULL to know if drop allowed
411 * \return true iff file drop has been handled, or if drop possible (NULL file)
412 */
414 int x, int y, char *file);
415
416
417/**
418 * set filename on form control.
419 *
420 * \param bw browser window to look inside.
421 * \param gadget form control.
422 * \param fn filename to set.
423 */
425 struct form_control *gadget, const char *fn);
426
427
428/**
429 * Update URL bar for a given browser window to bw's content's URL
430 *
431 * \param bw Browser window to update URL bar for.
432 */
434
435
436/**
437 * Handle mouse clicks in a browser window.
438 *
439 * \param bw browser window
440 * \param mouse state of mouse buttons and modifier keys
441 * \param x coordinate of mouse
442 * \param y coordinate of mouse
443 */
445 browser_mouse_state mouse, int x, int y);
446
447
448/**
449 * Handle non-click mouse action in a browser window. (drag ends, movements)
450 *
451 * \param bw browser window
452 * \param mouse state of mouse buttons and modifier keys
453 * \param x coordinate of mouse
454 * \param y coordinate of mouse
455 */
457 browser_mouse_state mouse, int x, int y);
458
459
460/**
461 * Locate a browser window in the specified stack according.
462 *
463 * \param bw the browser_window to search all relatives of
464 * \param target the target to locate
465 * \param mouse The current mouse state
466 * \return The browser window the mouse is in
467 */
469 struct browser_window *bw, const char *target,
470 browser_mouse_state mouse);
471
472
473/**
474 * Reformat the browser window contents in a safe context.
475 *
476 * The browser_window_reformat() call cannot safely be called from some
477 * contexts, This interface allows for the reformat to happen from a safe
478 * top level context.
479 *
480 * The reformat uses the window table get_dimensions() callback as the
481 * correct viewport dimensions are only available to the frontend.
482 *
483 * \param bw The browser window to reformat the content of.
484 * \return NSERROR_OK on success else appropriate error code.
485 */
487
488
489/**
490 * Change the shape of the mouse pointer
491 *
492 * \param bw Browser window to set shape in
493 * \param shape The pointer shape to use
494 */
497
498
499/**
500 * Start drag scrolling the contents of the browser window
501 *
502 * \param bw browser window
503 * \param x x ordinate of initial mouse position
504 * \param y y ordinate
505 */
506void browser_window_page_drag_start(struct browser_window *bw, int x, int y);
507
508
509/**
510 * Check availability of Back action for a given browser window
511 *
512 * \param bw browser window
513 * \return true if Back action is available
514 */
516
517
518/**
519 * Check availability of Forward action for a given browser window
520 *
521 * \param bw browser window
522 * \return true if Forward action is available
523 */
525
526
527/**
528 * Check availability of Reload action for a given browser window
529 *
530 * \param bw browser window
531 * \return true if Reload action is available
532 */
534
535
536/**
537 * Check availability of Stop action for a given browser window
538 *
539 * \param bw browser window
540 * \return true if Stop action is available
541 */
543
544
545/**
546 * Redraw an area of a window.
547 *
548 * Calls the redraw function for the content.
549 *
550 * \param bw The window to redraw
551 * \param x coordinate for top-left of redraw
552 * \param y coordinate for top-left of redraw
553 * \param clip clip rectangle coordinates
554 * \param ctx redraw context
555 * \return true if successful, false otherwise
556 *
557 * The clip rectangle is guaranteed to be filled to its extents, so there is
558 * no need to render a solid background first.
559 *
560 * x, y and clip are coordinates from the top left of the canvas area.
561 *
562 * The top left corner of the clip rectangle is (x0, y0) and
563 * the bottom right corner of the clip rectangle is (x1, y1).
564 * Units for x, y and clip are pixels.
565 */
566bool browser_window_redraw(struct browser_window *bw, int x, int y,
567 const struct rect *clip, const struct redraw_context *ctx);
568
569
570/**
571 * Check whether browser window is ready for redraw
572 *
573 * \param bw The window to redraw
574 * \return true if browser window is ready for redraw
575 */
577
578/**
579 * Get the position of the current browser window with respect to the root or
580 * parent browser window
581 *
582 * \param bw browser window to get the position of
583 * \param root true if we want position wrt root bw, false if wrt parent bw
584 * \param pos_x updated to x position of bw
585 * \param pos_y updated to y position of bw
586 */
588 int *pos_x, int *pos_y);
589
590/**
591 * Set the position of the current browser window with respect to the parent
592 * browser window
593 *
594 * \param bw browser window to set the position of
595 * \param x x position of bw
596 * \param y y position of bw
597 */
598void browser_window_set_position(struct browser_window *bw, int x, int y);
599
600
601/**
602 * Set drag type for a browser window, and inform front end
603 *
604 * \param bw browser window to set the type of the current drag for
605 * \param type drag type
606 * \param rect area pointer may be confined to, during drag, or NULL
607 */
609 browser_drag_type type, const struct rect *rect);
610
611/**
612 * Get type of any current drag for a browser window
613 *
614 * \param bw browser window to set the type of the current drag for
615 * \return drag type
616 */
618
619/**
620 * Check whether browser window can accept a cut/copy/paste, or has a selection
621 * that could be saved.
622 *
623 * \param bw The browser window
624 * \return flags indicating editor flags
625 */
627
628/**
629 * Find out if given browser window content is selectable
630 *
631 * \param bw browser window to look at
632 * \return true iff browser window is selectable
633 */
635
636/**
637 * Get the current selection from a root browser window, ownership passed to
638 * caller, who must free() it.
639 *
640 * \param bw The browser window
641 * \return the selected text string, or NULL
642 */
644
645/**
646 * Find out if given browser window can be searched
647 *
648 * \param bw browser window to look at
649 * \return true iff browser window is searchable
650 */
652
653/**
654 * Find out if a browser window contains a frameset
655 *
656 * \param bw browser window to look at
657 * \return true iff browser window contains a frameset
658 */
660
661/**
662 * Get the browser window's scrollbar details.
663 *
664 * Vertical and horizontal scrollbars may be {YES|NO|AUTO}, although
665 * it is entirely up to the front end whether this is implemented.
666 * e.g. if the gui toolkit style-guide says all windows must have
667 * scrollbars then this API can be ignored.
668 *
669 * \param bw browser window to look at
670 * \param h Updated to indicate horizontal scrollbar type
671 * \param v Updated to indicate vertical scrollbar type
672 * \return NSERROR_OK, or appropriate error otherwise
673 */
676
677
678/**
679 * Dump debug info concerning the browser window's contents to file
680 *
681 * \param bw The browser window.
682 * \param f The file to dump to.
683 * \param op The debug operation type to dump.
684 * \return NSERROR_OK on success or error code on faliure.
685 */
687
688/**
689 * Set debug options on a window
690 *
691 * \param bw The browser window.
692 * \param op The debug operation type.
693 * \return NSERROR_OK on success or error code on faliure.
694 */
696
697/**
698 * Obtain a browsing contexts name.
699 *
700 * The returned pointer is owned bu the browsing context and is only
701 * valid untill the next operation on that context.
702 * The returned name may be NULL if no name has been set.
703 * \todo This does not consider behaviour wrt frames
704 *
705 * \param bw The browser window.
706 * \param name recives result string.
707 * \return NSERROR_OK
708 */
710
711/**
712 * Set a browsing contexts name.
713 *
714 * Changes a browsing contexts name to a copy of that passed and the
715 * value is not subsequently referenced.
716 *
717 * \param bw The browser window.
718 * \param name The name string to set.
719 * \return NSERROR_OK and the name is updated or NSERROR_NOMEM and the
720 * original name is untouched.
721 */
723
724/**
725 * Execute some JavaScript code in a browsing context.
726 *
727 * Runs the passed in JavaScript code in the browsing context.
728 *
729 * \param bw The browser window
730 * \param src The JavaScript source code
731 * \param srclen The length of the source code
732 * \return Whether the JS function was successfully injected into the content
733 */
734bool browser_window_exec(struct browser_window *bw, const char *src, size_t srclen);
735
736/**
737 * Log a console message into the browser window console.
738 *
739 * If the targetted browser window is a frame, the message will be bubbled
740 * to the outermost window to be logged.
741 *
742 * \param bw The browser window
743 * \param src The source of the message
744 * \param msg The text of the message
745 * \param msglen The length of the text of the message
746 * \param flags Flags for the message
747 * \return Whether or not the logged message succeeded in being stored
748 */
751 const char *msg,
752 size_t msglen,
754
755/**
756 * Request the current browser window page info state.
757 *
758 * The page information state is an indicator enumeration to be used by
759 * frontends to indicate to the user if the page they are viewing is able
760 * to be trusted. This is often shown as a padlock of some kind.
761 *
762 * This is also used by the internal page information corewindow to render
763 * to the user what the situation is.
764 *
765 * \param bw The browser window
766 * \return The state of the browser window
767 */
769 const struct browser_window *bw);
770
771/**
772 * Request the current browser window SSL certificate chain.
773 *
774 * When the page has SSL information, this will retrieve the certificate chain.
775 *
776 * If there is no chain available, this will return NSERROR_NOT_FOUND
777 *
778 * \param bw The browser window
779 * \param chain Pointer to be filled out with certificate chain
780 * \return Whether or not the chain is available
781 */
783
784/**
785 * Get the number of cookies in use for the current page.
786 *
787 * \param bw A browser window.
788 * \return Number of cookies in use, or 0 on error.
789 */
791 const struct browser_window *bw);
792
793/**
794 * Open cookie viewer for the current page.
795 *
796 * \param bw A browser window.
797 * \return NSERROR_OK, or appropriate error otherwise.
798 */
800 const struct browser_window *bw);
801
802/**
803 * Show the certificate page for the current page.
804 *
805 * Does nothing for a page without certificates.
806 *
807 * \param bw A browser window.
808 * \return NSERROR_OK, or appropriate error otherwise.
809 */
811 struct browser_window *bw);
812
813#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:112
browser_mouse_state
Mouse state.
Definition: mouse.h:43
struct nsurl nsurl
NetSurf URL object.
Definition: nsurl.h:31
int width
Definition: gui.c:160
int height
Definition: gui.c:161
Page features at a specific spatial location.
struct hlcache_handle * object
Object at position or NULL.
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:297
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