NetSurf
Functions
page-info.h File Reference

Pave info viewer window interface. More...

#include <stdint.h>
#include <stdbool.h>
#include "utils/errors.h"
#include "netsurf/mouse.h"
Include dependency graph for page-info.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Functions

nserror page_info_init (void)
 Initialise the page_info module. More...
 
nserror page_info_fini (void)
 Finalise the page_info module. More...
 
nserror page_info_create (const struct core_window_callback_table *cw_t, struct core_window *cw_h, struct browser_window *bw, struct page_info **pi_out)
 Create a page info corewindow. More...
 
nserror page_info_destroy (struct page_info *pi)
 Destroy a page info corewindow. More...
 
nserror page_info_set (struct page_info *pgi, struct browser_window *bw)
 change the browser window the page information refers to More...
 
nserror page_info_redraw (const struct page_info *pi, int x, int y, const struct rect *clip, const struct redraw_context *ctx)
 Redraw the page info window. More...
 
nserror page_info_mouse_action (struct page_info *pi, enum browser_mouse_state mouse, int x, int y, bool *did_something)
 Mouse action handling. More...
 
bool page_info_keypress (struct page_info *pi, int32_t key)
 Key press handling. More...
 
nserror page_info_get_size (struct page_info *pi, int *width, int *height)
 Get size of page info content area. More...
 

Detailed Description

Pave info viewer window interface.

Definition in file page-info.h.

Function Documentation

◆ page_info_create()

nserror page_info_create ( const struct core_window_callback_table cw_t,
struct core_window *  cw_h,
struct browser_window bw,
struct page_info **  pi_out 
)

Create a page info corewindow.

The page info window is opened for a particular browser window. It can be destroyed before the browser window is destroyed by calling page_info_destroy.

Parameters
[in]cw_tCallback table for the containing core_window.
[in]cw_hHandle for the containing core_window.
[in]bwBrowser window to show page info for.
[out]pi_outThe created page info window handle.
Returns
NSERROR_OK on success, appropriate error code otherwise.

Definition at line 538 of file page-info.c.

References page_info::bw, page_info::cw_h, page_info::cw_t, cw_t, page_info::entries, NSERROR_NOMEM, NSERROR_OK, page_info__create_from_bw(), page_info__layout(), page_info_destroy(), and pi__entries.

Referenced by ami_pageinfo_open(), nsgtk_page_info(), and ro_pageinfo_init().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ page_info_destroy()

nserror page_info_destroy ( struct page_info pi)

Destroy a page info corewindow.

Parameters
[in]piThe page info window handle.

Definition at line 574 of file page-info.c.

References page_info::domain, and NSERROR_OK.

Referenced by ami_pageinfo_destroy(), nsgtk_pi_delete_event(), page_info_create(), and ro_gui_pageinfo_finalise().

Here is the caller graph for this function:

◆ page_info_fini()

nserror page_info_fini ( void  )

Finalise the page_info module.

Returns
NSERROR_OK on success, appropriate error code otherwise.

Definition at line 292 of file page-info.c.

References NSERROR_OK.

Referenced by netsurf_exit().

Here is the caller graph for this function:

◆ page_info_get_size()

nserror page_info_get_size ( struct page_info pi,
int *  width,
int *  height 
)

Get size of page info content area.

Parameters
[in]piThe page info window handle.
[out]widthOn success, return the page info content width.
[out]heightOn success, return the page info content height.
Returns
NSERROR_OK on success, appropriate error code otherwise.

Definition at line 827 of file page-info.c.

References page_info::height, height, NSERROR_OK, page_info::width, and width.

Referenced by ami_pageinfo_open(), and ro_pageinfo_open().

Here is the caller graph for this function:

◆ page_info_init()

nserror page_info_init ( void  )

Initialise the page_info module.

Returns
NSERROR_OK on success, appropriate error code otherwise.

Definition at line 259 of file page-info.c.

References plot_font_style::background, plot_style_s::fill_colour, plot_font_style::foreground, NSCOLOUR_WIN_EVEN_BG, NSCOLOUR_WIN_EVEN_BG_HOVER, NSCOLOUR_WIN_EVEN_FG, NSCOLOUR_WIN_EVEN_FG_BAD, NSCOLOUR_WIN_EVEN_FG_FADED, NSCOLOUR_WIN_EVEN_FG_GOOD, nscolours, NSERROR_OK, PAGE_STATE_INSECURE, PAGE_STATE_INTERNAL, PAGE_STATE_LOCAL, PAGE_STATE_SECURE, PAGE_STATE_SECURE_ISSUES, PAGE_STATE_SECURE_OVERRIDE, PAGE_STATE_UNKNOWN, pi__bg, pi__domain, pi__heading, pi__hover, pi__item, and pi__item_detail.

Referenced by netsurf_init().

Here is the caller graph for this function:

◆ page_info_keypress()

bool page_info_keypress ( struct page_info pi,
int32_t  key 
)

Key press handling.

Parameters
[in]piThe page info window handle.
[in]keyThe ucs4 character codepoint.
Returns
true if the keypress is dealt with, false otherwise.

Definition at line 819 of file page-info.c.

References NSERROR_OK.

Referenced by ami_pageinfo_key(), nsgtk_pi_key(), and ro_pageinfo_key().

Here is the caller graph for this function:

◆ page_info_mouse_action()

nserror page_info_mouse_action ( struct page_info pi,
enum browser_mouse_state  mouse,
int  x,
int  y,
bool *  did_something 
)

Mouse action handling.

Parameters
[in]piThe page info window handle.
[in]mouseThe current mouse state
[in]xThe current mouse X coordinate
[in]yThe current mouse Y coordinate
[out]did_somethingSet to true if this resulted in some action
Returns
NSERROR_OK on success, appropriate error code otherwise.

Definition at line 757 of file page-info.c.

References page_info::cw_h, page_info::cw_t, page_info::entries, core_window_callback_table::get_window_dimensions, page_info_text::height, height, page_info_item::hover, core_window_callback_table::invalidate, page_info_item::item, page_info_entry::item, NSERROR_OK, page_info_text::padding_bottom, page_info_item::padding_bottom, page_info_item::padding_top, page_info__handle_item_click(), page_info__hide_entry(), page_info_entry::PAGE_INFO_ENTRY_TYPE_ITEM, page_info_entry::PAGE_INFO_ENTRY_TYPE_TEXT, PI_ENTRY__COUNT, page_info::scheme, page_info_entry::text, page_info_entry::type, page_info_entry::u, page_info::width, page_info::window_padding, rect::x0, and rect::x1.

Referenced by ami_pageinfo_mouse(), nsgtk_pi_mouse(), and ro_pageinfo_mouse().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ page_info_redraw()

nserror page_info_redraw ( const struct page_info pi,
int  x,
int  y,
const struct rect clip,
const struct redraw_context ctx 
)

Redraw the page info window.

Causes the page info window to issue plot operations to redraw the specified area of the viewport.

Parameters
[in]piThe page info window handle.
[in]xX coordinate to render page_info at.
[in]yY coordinate to render page_info at.
[in]clipCurrent clip rectangle.
[in]ctxCurrent redraw context.
Returns
NSERROR_OK on success, appropriate error code otherwise.

Definition at line 624 of file page-info.c.

References clip(), plotter_table::clip, page_info_item::detail, page_info::entries, page_info_text::height, page_info_item::hover, page_info_item::item, page_info_entry::item, knockout_plot_end(), knockout_plot_start(), NSERROR_OK, NSERROR_UNKNOWN, plotter_table::option_knockout, page_info_text::padding_bottom, page_info_item::padding_bottom, page_info_item::padding_top, page_info__hide_entry(), page_info__redraw_text_entry(), page_info_entry::PAGE_INFO_ENTRY_TYPE_ITEM, page_info_entry::PAGE_INFO_ENTRY_TYPE_TEXT, pi__bg, pi__hover, PI_ENTRY__COUNT, redraw_context::plot, plotter_table::rectangle, page_info::scheme, page_info_entry::text, page_info_entry::type, page_info_entry::u, page_info_text::width, page_info::window_padding, rect::x0, rect::y0, and rect::y1.

Referenced by ami_pageinfo_draw(), nsgtk_pi_draw(), and ro_pageinfo_draw().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ page_info_set()

nserror page_info_set ( struct page_info pgi,
struct browser_window bw 
)

change the browser window the page information refers to

Parameters
[in]pgiThe page info window context
[in]bwThe new browser window
Returns
NSERROR_OK on sucess else error code.

Definition at line 584 of file page-info.c.

References page_info::bw, page_info::domain, NSERROR_OK, page_info__create_from_bw(), and page_info__layout().

Referenced by ro_pageinfo_init().

Here is the call graph for this function:
Here is the caller graph for this function: