|
NetSurf
|
Pave info viewer window implementation. More...
#include <stdlib.h>#include <string.h>#include "css/utils.h"#include "utils/nsurl.h"#include "utils/nscolour.h"#include "netsurf/mouse.h"#include "netsurf/layout.h"#include "netsurf/keypress.h"#include "netsurf/plotters.h"#include "netsurf/core_window.h"#include "netsurf/browser_window.h"#include "desktop/knockout.h"#include "desktop/page-info.h"#include "desktop/gui_internal.h"#include "desktop/system_colour.h"Go to the source code of this file.
Data Structures | |
| struct | page_info_text |
| An "text" type page info entry. More... | |
| struct | page_info_item |
| An "item" type page info entry. More... | |
| struct | page_info_entry |
| An entry on a page info window. More... | |
| struct | page_info |
| The page info window structure. More... | |
Enumerations | |
| enum | pi_entry { PI_ENTRY_HEADER , PI_ENTRY_DOMAIN , PI_ENTRY_CERT , PI_ENTRY_COOKIES , PI_ENTRY__COUNT } |
| List of page info window entries. More... | |
Functions | |
| nserror | page_info_init (void) |
| Initialise the page_info module. More... | |
| nserror | page_info_fini (void) |
| Finalise the page_info module. More... | |
| static nserror | page_info__measure_text_entry (struct page_info_text *pit) |
| Measure the text in the page_info window. More... | |
| static nserror | page_info__measure_text (struct page_info *pi) |
| Measure the text in the page_info window. More... | |
| static nserror | page_info__set_text (struct page_info *pi) |
| Set the text for the page_info window. More... | |
| static nserror | page_info__create_from_bw (struct page_info *pi, struct browser_window *bw) |
| Create page info from a browser window. More... | |
| static bool | page_info__hide_entry (enum pi_entry entry, enum nsurl_scheme_type scheme) |
| Check whether an entry is relevant. More... | |
| static nserror | page_info__layout (struct page_info *pi) |
| Lay out the page info window. More... | |
| nserror | page_info_create (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... | |
| static nserror | page_info__redraw_text_entry (const struct page_info_text *pit, int x, int y, const struct redraw_context *ctx) |
| Render a text entry. 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... | |
| static nserror | page_info__handle_item_click (struct page_info *pi, enum browser_mouse_state mouse, enum pi_entry clicked, bool *did_something) |
| Handle any clicks on an item. 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... | |
Variables | |
| static plot_font_style_t | pi__heading [PAGE_STATE__COUNT] |
| Plot style for heading font. More... | |
| static plot_font_style_t | pi__domain |
| Plot style for domain font. More... | |
| static plot_font_style_t | pi__item |
| Plot style for item font. More... | |
| static plot_font_style_t | pi__item_detail |
| Plot style for item detail font. More... | |
| static plot_style_t | pi__bg |
| Plot style for window background. More... | |
| static plot_style_t | pi__hover |
| Plot style for hover background. More... | |
| struct page_info_entry | pi__entries [PI_ENTRY__COUNT] |
| The default page info window data. More... | |
Pave info viewer window implementation.
Definition in file page-info.c.
| enum pi_entry |
List of page info window entries.
| Enumerator | |
|---|---|
| PI_ENTRY_HEADER | |
| PI_ENTRY_DOMAIN | |
| PI_ENTRY_CERT | |
| PI_ENTRY_COOKIES | |
| PI_ENTRY__COUNT | |
Definition at line 162 of file page-info.c.
|
static |
Create page info from a browser window.
| [in] | pi | The page info window handle. |
| [in] | bw | Browser window to show page info for. |
Definition at line 440 of file page-info.c.
References browser_window_access_url(), browser_window_get_cookie_count(), browser_window_get_page_info_state(), page_info::bw, page_info::cookies, page_info::domain, nsurl_get_component(), nsurl_get_scheme_type(), NSURL_HOST, page_info__set_text(), page_info::scheme, and page_info::state.
Referenced by page_info_create(), and page_info_set().
|
static |
Handle any clicks on an item.
| [in] | pi | The page info window handle. |
| [in] | mouse | The current mouse state. |
| [in] | clicked | The page info window entry to consider clicks on. |
| [out] | did_something | Set to true if this click did something |
Definition at line 719 of file page-info.c.
References BROWSER_MOUSE_CLICK_1, browser_window_show_certificates(), browser_window_show_cookies(), page_info::bw, NSERROR_OK, PI_ENTRY_CERT, and PI_ENTRY_COOKIES.
Referenced by page_info_mouse_action().
|
inlinestatic |
Check whether an entry is relevant.
| [in] | entry | The page info entry to consider. |
| [in] | scheme | URL scheme that the page info is for. |
Definition at line 462 of file page-info.c.
References NSURL_SCHEME_HTTP, NSURL_SCHEME_HTTPS, PI_ENTRY_CERT, and PI_ENTRY_COOKIES.
Referenced by page_info__layout(), page_info_mouse_action(), and page_info_redraw().
Lay out the page info window.
| [in] | pi | The page info window handle. |
Definition at line 491 of file page-info.c.
References netsurf_table::corewindow, page_info::cw_h, page_info_item::detail, page_info::entries, guit, page_info_text::height, page_info::height, page_info_item::item, page_info_entry::item, page_info_text::padding_bottom, page_info_item::padding_bottom, page_info_item::padding_top, 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, core_window_table::set_extent, page_info_entry::text, page_info_entry::type, page_info_entry::u, page_info_text::width, page_info::width, and page_info::window_padding.
Referenced by page_info_create(), and page_info_set().
Measure the text in the page_info window.
| [in] | pi | The page info window handle. |
Definition at line 330 of file page-info.c.
References page_info_item::detail, page_info::entries, page_info_text::height, 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__measure_text_entry(), page_info_entry::PAGE_INFO_ENTRY_TYPE_ITEM, page_info_entry::PAGE_INFO_ENTRY_TYPE_TEXT, PI_ENTRY__COUNT, PI_ENTRY_DOMAIN, page_info_entry::text, page_info_entry::type, page_info_entry::u, and page_info::window_padding.
Referenced by page_info__set_text().
|
static |
Measure the text in the page_info window.
| [in] | pi | The page info window handle. |
Definition at line 302 of file page-info.c.
References guit, page_info_text::height, netsurf_table::layout, nscss_screen_dpi, NSERROR_OK, PLOT_STYLE_SCALE, plot_font_style::size, page_info_text::style, page_info_text::text, page_info_text::width, and gui_layout_table::width.
Referenced by page_info__measure_text().
|
static |
Render a text entry.
| [in] | pit | The page info window handle. |
| [in] | x | X-coordinate to plot at. |
| [in] | y | Y-coordinate to plot at. |
| [in] | ctx | Current redraw context. |
Definition at line 601 of file page-info.c.
References page_info_text::height, NSERROR_OK, redraw_context::plot, page_info_text::style, page_info_text::text, and plotter_table::text.
Referenced by page_info_redraw().
Set the text for the page_info window.
| [in] | pi | The page info window handle. |
Definition at line 385 of file page-info.c.
References page_info::cookie_text, page_info::cookies, page_info_item::detail, page_info::domain, page_info::entries, page_info_item::item, page_info_entry::item, NSERROR_NOSPACE, NSERROR_UNKNOWN, page_info__measure_text(), PAGE_STATE__COUNT, PAGE_STATE_INSECURE, PAGE_STATE_INTERNAL, PAGE_STATE_LOCAL, PAGE_STATE_SECURE, PAGE_STATE_SECURE_ISSUES, PAGE_STATE_SECURE_OVERRIDE, PAGE_STATE_UNKNOWN, pi__heading, PI_ENTRY_CERT, PI_ENTRY_COOKIES, PI_ENTRY_DOMAIN, PI_ENTRY_HEADER, page_info::state, page_info_text::style, page_info_text::text, page_info_entry::text, and page_info_entry::u.
Referenced by page_info__create_from_bw().
| nserror page_info_create | ( | 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.
| [in] | cw_h | Handle for the containing core_window. |
| [in] | bw | Browser window to show page info for. |
| [out] | pi_out | The created page info window handle. |
Definition at line 537 of file page-info.c.
References page_info::bw, page_info::cw_h, 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().
Destroy a page info corewindow.
| [in] | pi | The page info window handle. |
Definition at line 570 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().
| nserror page_info_fini | ( | void | ) |
Finalise the page_info module.
Definition at line 291 of file page-info.c.
References NSERROR_OK.
Referenced by netsurf_exit().
Get size of page info content area.
| [in] | pi | The page info window handle. |
| [out] | width | On success, return the page info content width. |
| [out] | height | On success, return the page info content height. |
Definition at line 818 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().
| nserror page_info_init | ( | void | ) |
Initialise the page_info module.
Definition at line 258 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().
| bool page_info_keypress | ( | struct page_info * | pi, |
| int32_t | key | ||
| ) |
Key press handling.
| [in] | pi | The page info window handle. |
| [in] | key | The ucs4 character codepoint. |
Definition at line 810 of file page-info.c.
References NSERROR_OK.
Referenced by ami_pageinfo_key(), nsgtk_pi_key(), and ro_pageinfo_key().
| nserror page_info_mouse_action | ( | struct page_info * | pi, |
| enum browser_mouse_state | mouse, | ||
| int | x, | ||
| int | y, | ||
| bool * | did_something | ||
| ) |
Mouse action handling.
| [in] | pi | The page info window handle. |
| [in] | mouse | The current mouse state |
| [in] | x | The current mouse X coordinate |
| [in] | y | The current mouse Y coordinate |
| [out] | did_something | Set to true if this resulted in some action |
Definition at line 749 of file page-info.c.
References netsurf_table::corewindow, page_info::cw_h, page_info::entries, core_window_table::get_dimensions, guit, page_info_text::height, height, page_info_item::hover, core_window_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().
| 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.
| [in] | pi | The page info window handle. |
| [in] | x | X coordinate to render page_info at. |
| [in] | y | Y coordinate to render page_info at. |
| [in] | clip | Current clip rectangle. |
| [in] | ctx | Current redraw context. |
Definition at line 616 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().
| nserror page_info_set | ( | struct page_info * | pgi, |
| struct browser_window * | bw | ||
| ) |
change the browser window the page information refers to
| [in] | pgi | The page info window context |
| [in] | bw | The new browser window |
Definition at line 578 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().
|
static |
Plot style for window background.
Definition at line 125 of file page-info.c.
Referenced by page_info_init(), and page_info_redraw().
|
static |
Plot style for domain font.
Definition at line 95 of file page-info.c.
Referenced by page_info_init().
| struct page_info_entry pi__entries[PI_ENTRY__COUNT] |
The default page info window data.
Definition at line 193 of file page-info.c.
Referenced by page_info_create().
|
static |
Plot style for heading font.
Definition at line 47 of file page-info.c.
Referenced by page_info__set_text(), and page_info_init().
|
static |
Plot style for hover background.
Definition at line 132 of file page-info.c.
Referenced by page_info_init(), and page_info_redraw().
|
static |
Plot style for item font.
Definition at line 105 of file page-info.c.
Referenced by page_info_init().
|
static |
Plot style for item detail font.
Definition at line 115 of file page-info.c.
Referenced by page_info_init().