NetSurf
Data Fields
core_window_callback_table Struct Reference

Callbacks to achieve various core window functionality. More...

#include <core_window.h>

Data Fields

nserror(* invalidate )(struct core_window *cw, const struct rect *rect)
 Invalidate an area of a window. More...
 
nserror(* update_size )(struct core_window *cw, int width, int height)
 Update the limits of the window. More...
 
nserror(* set_scroll )(struct core_window *cw, int x, int y)
 Scroll the window to given scroll offsets. More...
 
nserror(* get_scroll )(const struct core_window *cw, int *x, int *y)
 Get the current scroll offsets. More...
 
nserror(* get_window_dimensions )(const struct core_window *cw, int *width, int *height)
 Get window viewport dimensions. More...
 
nserror(* drag_status )(struct core_window *cw, core_window_drag_status ds)
 Inform corewindow owner of drag status. More...
 

Detailed Description

Callbacks to achieve various core window functionality.

Definition at line 51 of file core_window.h.

Field Documentation

◆ drag_status

nserror(* core_window_callback_table::drag_status) (struct core_window *cw, core_window_drag_status ds)

Inform corewindow owner of drag status.

Parameters
[in]cwthe core window object
[in]dsthe current drag status
Returns
NSERROR_OK on success or appropriate error code

Definition at line 123 of file core_window.h.

Referenced by treeview__cw_drag_status().

◆ get_scroll

nserror(* core_window_callback_table::get_scroll) (const struct core_window *cw, int *x, int *y)

Get the current scroll offsets.

Parameters
[in]cwthe core window object
[out]returnshorizontal scroll in px
[out]returnsvertical scroll in px
Returns
NSERROR_OK on success or appropriate error code

Definition at line 103 of file core_window.h.

Referenced by cw_helper_scroll_visible().

◆ get_window_dimensions

nserror(* core_window_callback_table::get_window_dimensions) (const struct core_window *cw, int *width, int *height)

Get window viewport dimensions.

Parameters
[in]cwthe core window object
[out]widthto be set to viewport width in px
[out]heightto be set to viewport height in px
Returns
NSERROR_OK on success or appropriate error code

Definition at line 113 of file core_window.h.

Referenced by cw_helper_scroll_visible(), page_info_mouse_action(), and treeview__cw_get_window_dimensions().

◆ invalidate

nserror(* core_window_callback_table::invalidate) (struct core_window *cw, 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
[in]cwThe core window to invalidate.
[in]rectarea to redraw or NULL for the entire window area
Returns
NSERROR_OK on success or appropriate error code

Definition at line 69 of file core_window.h.

Referenced by local_history_keypress(), page_info_mouse_action(), treeview__cw_full_redraw(), and treeview__cw_invalidate_area().

◆ set_scroll

nserror(* core_window_callback_table::set_scroll) (struct core_window *cw, int x, int y)

Scroll the window to given scroll offsets.

Note: Core callers of this may want to look at calling the cw_helper_scroll_visible(), rather than calling this directly.

Parameters
[in]cwthe core window object
[in]xx-scroll value to set
[in]yy-scroll value to set
Returns
NSERROR_OK on success or appropriate error code

Definition at line 93 of file core_window.h.

Referenced by cw_helper_scroll_visible().

◆ update_size

nserror(* core_window_callback_table::update_size) (struct core_window *cw, int width, int height)

Update the limits of the window.

Parameters
[in]cwthe core window object
[in]widththe width in px, or negative if don't care
[in]heightthe height in px, or negative if don't care
Returns
NSERROR_OK on success or appropriate error code

Definition at line 79 of file core_window.h.

Referenced by local_history_set(), page_info__layout(), and treeview__cw_update_size().


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