diff options
Diffstat (limited to 'include/netsurf/browser_window.h')
-rw-r--r-- | include/netsurf/browser_window.h | 78 |
1 files changed, 46 insertions, 32 deletions
diff --git a/include/netsurf/browser_window.h b/include/netsurf/browser_window.h index 482dcb92c..439b0785d 100644 --- a/include/netsurf/browser_window.h +++ b/include/netsurf/browser_window.h @@ -43,6 +43,9 @@ struct rect; struct redraw_context; enum content_debug; +/** + * type of browser window drag in progess + */ typedef enum { DRAGGING_NONE, DRAGGING_SELECTION, @@ -113,7 +116,10 @@ enum browser_window_nav_flags { * A transaction is unverifiable if the user does not * have that option. */ - BW_NAVIGATE_UNVERIFIABLE = (1 << 2) + BW_NAVIGATE_UNVERIFIABLE = (1 << 2), + + /** suppress initial history updates (used by back/fwd/etc) */ + BW_NAVIGATE_NO_TERMINAL_HISTORY_UPDATE = (1 << 3) }; /** @@ -194,14 +200,27 @@ bool browser_window_up_available(struct browser_window *bw); nserror browser_window_navigate_up(struct browser_window *bw, bool new_window); /** - * Get a browser window's URL. + * Access a browser window's URL. This URL is always without any fragment. * * \param bw browser window * \return pointer to nsurl. Doesn't create a ref for caller. * * \note guaranteed to return a valid nsurl ptr, never returns NULL. */ -struct nsurl* browser_window_get_url(struct browser_window *bw); +struct nsurl* browser_window_access_url(struct browser_window *bw); + +/** + * Access a browser window's URL. + * + * \param[in] bw browser window + * \param[in] fragment Whether to include any URL fragment. + * \param[out] url_out Returns a ref to the URL on success. + * \return NSERROR_OK, or appropriate error otherwise. + */ +nserror browser_window_get_url( + struct browser_window *bw, + bool fragment, + struct nsurl** url_out); /** * Get the title of a browser_window. @@ -293,16 +312,23 @@ void browser_window_reload(struct browser_window *bw, bool all); */ void browser_window_destroy(struct browser_window *bw); + /** * Reformat a browser window contents to a new width or height. * + * This API is not safe to call from all contexts and care must be used. + * + * \warning This API is generally only useful within the browser core + * and is only exposed for historical reasons. A frontend almost + * certianly actually wants browser_window_schedule_reformat() and not + * this. + * * \param bw The browser window to reformat. * \param background Reformat in the background. * \param width new width * \param height new height */ -void browser_window_reformat(struct browser_window *bw, bool background, - int width, int height); +void browser_window_reformat(struct browser_window *bw, bool background, int width, int height); /** @@ -408,6 +434,7 @@ void browser_window_mouse_click(struct browser_window *bw, void browser_window_mouse_track(struct browser_window *bw, browser_mouse_state mouse, int x, int y); + /** * Locate a browser window in the specified stack according. * @@ -420,21 +447,28 @@ struct browser_window *browser_window_find_target( struct browser_window *bw, const char *target, browser_mouse_state mouse); + /** - * Cause the frontends reformat entry to be called in safe context. + * Reformat the browser window contents in a safe context. * - * The browser_window_reformat call cannot safely be called from some - * contexts, this call allows for the reformat to happen from a safe + * The browser_window_reformat() call cannot safely be called from some + * contexts, This interface allows for the reformat to happen from a safe * top level context. * - * The callback is frontend provided as the context information (size - * etc.) about the windowing toolkit is only available to the - * frontend. + * The reformat uses the window table get_dimensions() callback as the + * correct viewport dimensions are only available to the frontend. + * + * \param bw The browser window to reformat the content of. + * \return NSERROR_OK on success else appropriate error code. */ nserror browser_window_schedule_reformat(struct browser_window *bw); - +/** + * callback for select menu widget + * + * \todo This API needs investigating + */ void browser_select_menu_callback(void *client_data, int x, int y, int width, int height); @@ -554,26 +588,6 @@ void browser_window_get_position(struct browser_window *bw, bool root, */ void browser_window_set_position(struct browser_window *bw, int x, int y); -/** - * Scroll the browser window to display the passed area - * - * \param bw browser window to scroll - * \param rect area to display - */ -void browser_window_scroll_visible(struct browser_window *bw, - const struct rect *rect); - -/** - * Set scroll offsets for a browser window. - * - * \param bw The browser window - * \param x The x scroll offset to set - * \param y The y scroll offset to set - * - * \todo Do we really need this and browser_window_scroll_visible? - * Ditto for gui_window_* variants. - */ -void browser_window_set_scroll(struct browser_window *bw, int x, int y); /** * Set drag type for a browser window, and inform front end |