NetSurf
Data Fields
gui_window_table Struct Reference

Graphical user interface window function table. More...

#include <window.h>

Collaboration diagram for gui_window_table:
[legend]

Data Fields

struct gui_window *(* create )(struct browser_window *bw, struct gui_window *existing, gui_window_create_flags flags)
 Create and open a gui window for a browsing context. More...
 
void(* destroy )(struct gui_window *gw)
 Destroy previously created gui window. More...
 
nserror(* invalidate )(struct gui_window *gw, const struct rect *rect)
 Invalidate an area of a window. More...
 
bool(* get_scroll )(struct gui_window *gw, int *sx, int *sy)
 Get the scroll position of a browser window. More...
 
nserror(* set_scroll )(struct gui_window *gw, const struct rect *rect)
 Set the scroll position of a browser window. More...
 
nserror(* get_dimensions )(struct gui_window *gw, int *width, int *height)
 Find the current dimensions of a browser window's content area. More...
 
nserror(* event )(struct gui_window *gw, enum gui_window_event event)
 Miscellaneous event occurred for a window. More...
 
void(* set_title )(struct gui_window *gw, const char *title)
 Set the title of a window. More...
 
nserror(* set_url )(struct gui_window *gw, struct nsurl *url)
 Set the navigation url. More...
 
void(* set_icon )(struct gui_window *gw, struct hlcache_handle *icon)
 Set a favicon for a gui window. More...
 
void(* set_status )(struct gui_window *g, const char *text)
 Set the status bar message of a browser window. More...
 
void(* set_pointer )(struct gui_window *g, enum gui_pointer_shape shape)
 Change mouse pointer shape. More...
 
void(* place_caret )(struct gui_window *g, int x, int y, int height, const struct rect *clip)
 Place the caret in a browser window. More...
 
bool(* drag_start )(struct gui_window *g, gui_drag_type type, const struct rect *rect)
 start a drag operation within a window More...
 
nserror(* save_link )(struct gui_window *g, struct nsurl *url, const char *title)
 save link operation More...
 
void(* create_form_select_menu )(struct gui_window *gw, struct form_control *control)
 create a form select menu More...
 
void(* file_gadget_open )(struct gui_window *gw, struct hlcache_handle *hl, struct form_control *gadget)
 Called when file chooser gadget is activated. More...
 
void(* drag_save_object )(struct gui_window *gw, struct hlcache_handle *c, gui_save_type type)
 object dragged to window More...
 
void(* drag_save_selection )(struct gui_window *gw, const char *selection)
 drag selection save More...
 
void(* console_log )(struct gui_window *gw, browser_window_console_source src, const char *msg, size_t msglen, browser_window_console_flags flags)
 console logging happening. More...
 

Detailed Description

Graphical user interface window function table.

function table implementing window operations

Definition at line 137 of file window.h.

Field Documentation

◆ console_log

void(* gui_window_table::console_log) (struct gui_window *gw, browser_window_console_source src, const char *msg, size_t msglen, browser_window_console_flags flags)

console logging happening.

See browser_window_console_log

Parameters
gwThe gui window receiving the logging.
srcThe source of the logging message
msgThe text of the logging message
msglenThe length of the text of the logging message
flagsFlags associated with the logging.

Definition at line 374 of file window.h.

Referenced by browser_window_console_log(), and verify_window_register().

◆ create

struct gui_window *(* gui_window_table::create) (struct browser_window *bw, struct gui_window *existing, gui_window_create_flags flags)

Create and open a gui window for a browsing context.

The implementing front end must create a context suitable for it to display a window referred to as the "gui window".

The frontend will be expected to request the core redraw areas of the gui window which have become invalidated either from toolkit expose events or as a result of a invalidate() call.

Most core operations used by the frontend concerning browser windows require passing the browser window context therefor the gui window must include a reference to the browser window passed here.

If GW_CREATE_CLONE flag is set existing is non-NULL.

Parameters
bwThe core browsing context associated with the gui window
existingAn existing gui_window, may be NULL.
flagsflags to control the gui window creation.
Returns
gui window, or NULL on error.

Definition at line 1 of file window.h.

Referenced by browser_window_create(), and verify_window_register().

◆ create_form_select_menu

void(* gui_window_table::create_form_select_menu) (struct gui_window *gw, struct form_control *control)

create a form select menu

Parameters
gwThe gui window to open select menu form gadget in.
controlThe form control gadget handle.

Definition at line 335 of file window.h.

Referenced by browser_window_callback(), and verify_window_register().

◆ destroy

void(* gui_window_table::destroy) (struct gui_window *gw)

Destroy previously created gui window.

Parameters
gwThe gui window to destroy.

Definition at line 174 of file window.h.

Referenced by browser_window_destroy_internal(), and verify_window_register().

◆ drag_save_object

void(* gui_window_table::drag_save_object) (struct gui_window *gw, struct hlcache_handle *c, gui_save_type type)

object dragged to window

Parameters
gwThe gui window to save dragged object of.
cThe content of the object.
typethe type of save.

Definition at line 353 of file window.h.

Referenced by browser_window_callback(), browser_window_mouse_click_internal(), and verify_window_register().

◆ drag_save_selection

void(* gui_window_table::drag_save_selection) (struct gui_window *gw, const char *selection)

drag selection save

Parameters
gwThe gui window to save dragged selection of.
selectionThe selection to save.

Definition at line 361 of file window.h.

Referenced by selection_click(), and verify_window_register().

◆ drag_start

bool(* gui_window_table::drag_start) (struct gui_window *g, gui_drag_type type, const struct rect *rect)

start a drag operation within a window

Parameters
gwindow to start drag from.
typeType of drag to start
rectConfining rectangle of drag operation.
Returns
true if drag started else false.

Definition at line 317 of file window.h.

Referenced by browser_window_set_drag_type(), and verify_window_register().

◆ event

nserror(* gui_window_table::event) (struct gui_window *gw, enum gui_window_event event)

Miscellaneous event occurred for a window.

This is used to inform the frontend of window events which require no additional parameters.

Parameters
gwThe gui window the event occurred for
eventWhich event has occurred.
Returns
NSERROR_OK if the event was processed else error code.

Definition at line 254 of file window.h.

Referenced by browser_window_content_ready(), browser_window_page_drag_start(), browser_window_remove_caret(), browser_window_start_throbber(), browser_window_stop_throbber(), browser_window_update_extent(), selection_click(), and verify_window_register().

◆ file_gadget_open

void(* gui_window_table::file_gadget_open) (struct gui_window *gw, struct hlcache_handle *hl, struct form_control *gadget)

Called when file chooser gadget is activated.

Parameters
gwThe gui window to open file chooser in.
hlThe content of the object.
gadgetThe form control gadget handle.

Definition at line 344 of file window.h.

Referenced by browser_window_callback(), and verify_window_register().

◆ get_dimensions

nserror(* gui_window_table::get_dimensions) (struct gui_window *gw, int *width, int *height)

Find the current dimensions of a browser window's content area.

This is used to determine the actual available drawing size in pixels. This allows contents that can be dynamically reformatted, such as HTML, to better use the available space.

Parameters
gwThe gui window to measure content area of.
widthreceives width of window
heightreceives height of window
Returns
NSERROR_OK on success and width and height updated else error code.

Definition at line 241 of file window.h.

Referenced by browser_window_get_dimensions(), scheduled_reformat(), and verify_window_register().

◆ get_scroll

bool(* gui_window_table::get_scroll) (struct gui_window *gw, int *sx, int *sy)

Get the scroll position of a browser window.

Parameters
gwThe gui window to obtain the scroll position from.
sxreceives x ordinate of point at top-left of window
syreceives y ordinate of point at top-left of window
Returns
true iff successful

Definition at line 205 of file window.h.

Referenced by browser_window_history_update(), browser_window_page_drag_start(), and verify_window_register().

◆ invalidate

nserror(* gui_window_table::invalidate) (struct gui_window *gw, const struct rect *rect)

Invalidate an area of a window.

The specified area of the window should now be considered out of date. If the area is NULL the entire window must be invalidated. It is expected that the windowing system will then subsequently cause redraw/expose operations as necessary.

Note
the frontend should not attempt to actually start the redraw operations as a result of this callback because the core redraw functions may already be threaded.
Parameters
gwThe gui window to invalidate.
rectarea to redraw or NULL for the entire window area
Returns
NSERROR_OK on success or appropriate error code

Definition at line 194 of file window.h.

Referenced by browser_window_invalidate_rect(), browser_window_update(), and verify_window_register().

◆ place_caret

void(* gui_window_table::place_caret) (struct gui_window *g, int x, int y, int height, const struct rect *clip)

Place the caret in a browser window.

Parameters
gwindow with caret
xcoordinates of caret
ycoordinates of caret
heightheight of caret
clipclip rectangle, or NULL if none

Definition at line 307 of file window.h.

Referenced by browser_window_place_caret(), and verify_window_register().

◆ save_link

nserror(* gui_window_table::save_link) (struct gui_window *g, struct nsurl *url, const char *title)

save link operation

Parameters
gwindow to save link from.
urlThe link url.
titleThe title of the link.
Returns
NSERROR_OK on success else appropriate error code.

Definition at line 327 of file window.h.

Referenced by browser_window_callback(), and verify_window_register().

◆ set_icon

void(* gui_window_table::set_icon) (struct gui_window *gw, struct hlcache_handle *icon)

Set a favicon for a gui window.

Parameters
gwwindow to update.
iconhandle to object to use as icon.

Definition at line 280 of file window.h.

Referenced by browser_window_favicon_callback(), navigate_internal_real(), and verify_window_register().

◆ set_pointer

void(* gui_window_table::set_pointer) (struct gui_window *g, enum gui_pointer_shape shape)

Change mouse pointer shape.

Parameters
gThe gui window to change pointer shape in.
shapeThe new shape to change to.

Definition at line 296 of file window.h.

Referenced by browser_window_set_pointer(), and verify_window_register().

◆ set_scroll

nserror(* gui_window_table::set_scroll) (struct gui_window *gw, const struct rect *rect)

Set the scroll position of a browser window.

scrolls the viewport to ensure the specified rectangle of the content is shown. If the rectangle is of zero size i.e. x0 == x1 and y0 == y1 the contents will be scrolled so the specified point in the content is at the top of the viewport. If the size of the rectangle is non zero the frontend may add padding or centre the defined area or it may simply align as in the zero size rectangle

Parameters
gwThe gui window to scroll.
rectThe rectangle to ensure is shown.
Returns
NSERROR_OK on success or appropriate error code.

Definition at line 224 of file window.h.

Referenced by browser_window_set_scroll(), and verify_window_register().

◆ set_status

void(* gui_window_table::set_status) (struct gui_window *g, const char *text)

Set the status bar message of a browser window.

Parameters
ggui_window to update
textnew status text

Definition at line 288 of file window.h.

Referenced by browser_window_set_status(), and verify_window_register().

◆ set_title

void(* gui_window_table::set_title) (struct gui_window *gw, const char *title)

Set the title of a window.

Parameters
gwThe gui window to set title of.
titlenew window title

Definition at line 264 of file window.h.

Referenced by browser_window_update(), and verify_window_register().

◆ set_url

nserror(* gui_window_table::set_url) (struct gui_window *gw, struct nsurl *url)

Set the navigation url.

Parameters
gwwindow to update.
urlThe url to use as icon.

Definition at line 272 of file window.h.

Referenced by browser_window_refresh_url_bar_internal(), and verify_window_register().


The documentation for this struct was generated from the following file: