NetSurf
Data Structures | Functions | Variables
pageinfo.c File Reference

Implementation of RISC OS page info core window. More...

#include <stdint.h>
#include <stdlib.h>
#include <oslib/wimp.h>
#include "utils/log.h"
#include "netsurf/mouse.h"
#include "netsurf/plotters.h"
#include "desktop/page-info.h"
#include "riscos/gui.h"
#include "riscos/dialog.h"
#include "riscos/toolbar.h"
#include "riscos/wimputils.h"
#include "riscos/corewindow.h"
#include "riscos/pageinfo.h"
Include dependency graph for pageinfo.c:

Go to the source code of this file.

Data Structures

struct  ro_pageinfo_window
 Page info window container for RISC OS. More...
 

Functions

static nserror ro_pageinfo_draw (struct ro_corewindow *ro_cw, int originx, int originy, struct rect *r)
 callback to draw on drawable area of ro page info window More...
 
static nserror ro_pageinfo_key (struct ro_corewindow *ro_cw, uint32_t nskey)
 callback for keypress on ro coookie window More...
 
static nserror ro_pageinfo_mouse (struct ro_corewindow *ro_cw, browser_mouse_state mouse_state, int x, int y)
 callback for mouse event on ro page info window More...
 
static nserror ro_pageinfo_init (struct browser_window *bw, struct ro_pageinfo_window **win_out)
 Creates the window for the page info tree. More...
 
static nserror ro_pageinfo_open (struct ro_pageinfo_window *lhw, wimp_w parent)
 open RISC OS page info window at the correct size More...
 
nserror ro_gui_pageinfo_initialise (void)
 initialise the pageinfo window template ready for subsequent use. More...
 
nserror ro_gui_pageinfo_present (struct gui_window *gw)
 make the pageinfo window visible. More...
 
nserror ro_gui_pageinfo_finalise (void)
 Free any resources allocated for the page info window. More...
 

Variables

static struct ro_pageinfo_windowpageinfo_window = NULL
 page info window is a singleton More...
 
static wimp_window * dialog_pageinfo_template
 riscos template for pageinfo window More...
 

Detailed Description

Implementation of RISC OS page info core window.

Definition in file pageinfo.c.

Function Documentation

◆ ro_gui_pageinfo_finalise()

nserror ro_gui_pageinfo_finalise ( void  )

Free any resources allocated for the page info window.

Returns
NSERROR_OK on success else appropriate error code on faliure.

Definition at line 307 of file pageinfo.c.

References ro_pageinfo_window::core, NSERROR_OK, page_info_destroy(), pageinfo_window, ro_pageinfo_window::pgi, and ro_corewindow_fini().

Referenced by gui_quit().

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

◆ ro_gui_pageinfo_initialise()

nserror ro_gui_pageinfo_initialise ( void  )

initialise the pageinfo window template ready for subsequent use.

Definition at line 283 of file pageinfo.c.

References dialog_pageinfo_template, NSERROR_OK, and ro_gui_dialog_load_template().

Referenced by ro_gui_dialog_init().

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

◆ ro_gui_pageinfo_present()

nserror ro_gui_pageinfo_present ( struct gui_window gw)

make the pageinfo window visible.

Returns
NSERROR_OK on success else appropriate error code on faliure.

Definition at line 291 of file pageinfo.c.

References gui_window::bw, NSERROR_OK, NSLOG, pageinfo_window, ro_pageinfo_init(), ro_pageinfo_open(), and gui_window::window.

Referenced by ro_gui_window_toolbar_click().

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

◆ ro_pageinfo_draw()

static nserror ro_pageinfo_draw ( struct ro_corewindow ro_cw,
int  originx,
int  originy,
struct rect r 
)
static

callback to draw on drawable area of ro page info window

Parameters
ro_cwThe riscos core window structure.
rThe rectangle of the window that needs updating.
originxThe risc os plotter x origin.
originyThe risc os plotter y origin.
Returns
NSERROR_OK on success otherwise apropriate error code

Definition at line 66 of file pageinfo.c.

References redraw_context::interactive, no_font_blending, NSERROR_OK, page_info_redraw(), ro_pageinfo_window::pgi, ro_plot_origin_x, ro_plot_origin_y, and ro_plotters.

Referenced by ro_pageinfo_init().

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

◆ ro_pageinfo_init()

static nserror ro_pageinfo_init ( struct browser_window bw,
struct ro_pageinfo_window **  win_out 
)
static

Creates the window for the page info tree.

Returns
NSERROR_OK on success else appropriate error code on faliure.

Definition at line 153 of file pageinfo.c.

References ro_pageinfo_window::core, dialog_pageinfo_template, ro_corewindow::draw, ro_corewindow::key, ro_corewindow::mouse, NSERROR_NOMEM, NSERROR_OK, NSLOG, page_info_create(), page_info_set(), ro_pageinfo_window::pgi, ro_corewindow_init(), ro_pageinfo_draw(), ro_pageinfo_key(), ro_pageinfo_mouse(), ro_warn_user(), and ro_corewindow::wh.

Referenced by ro_gui_pageinfo_present().

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

◆ ro_pageinfo_key()

static nserror ro_pageinfo_key ( struct ro_corewindow ro_cw,
uint32_t  nskey 
)
static

callback for keypress on ro coookie window

Parameters
ro_cwThe ro core window structure.
nskeyThe netsurf key code.
Returns
NSERROR_OK if key processed, NSERROR_NOT_IMPLEMENTED if key not processed otherwise apropriate error code

Definition at line 100 of file pageinfo.c.

References NSERROR_NOT_IMPLEMENTED, NSERROR_OK, page_info_keypress(), and ro_pageinfo_window::pgi.

Referenced by ro_pageinfo_init().

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

◆ ro_pageinfo_mouse()

static nserror ro_pageinfo_mouse ( struct ro_corewindow ro_cw,
browser_mouse_state  mouse_state,
int  x,
int  y 
)
static

callback for mouse event on ro page info window

Parameters
ro_cwThe ro core window structure.
mouse_statemouse state
xlocation of event
ylocation of event
Returns
NSERROR_OK on sucess otherwise apropriate error code.

Definition at line 123 of file pageinfo.c.

References BROWSER_MOUSE_LEAVE, NSERROR_OK, page_info_mouse_action(), ro_pageinfo_window::pgi, ro_gui_dialog_close(), and ro_corewindow::wh.

Referenced by ro_pageinfo_init().

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

◆ ro_pageinfo_open()

static nserror ro_pageinfo_open ( struct ro_pageinfo_window lhw,
wimp_w  parent 
)
static

open RISC OS page info window at the correct size

Definition at line 218 of file pageinfo.c.

References ro_pageinfo_window::core, height, NSERROR_NOMEM, NSERROR_OK, NSLOG, page_info_get_size(), parent, ro_pageinfo_window::pgi, PTR_WIMP_OPEN, ro_gui_dialog_open_persistent(), ro_warn_user(), ro_corewindow::wh, and width.

Referenced by ro_gui_pageinfo_present().

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

Variable Documentation

◆ dialog_pageinfo_template

wimp_window* dialog_pageinfo_template
static

riscos template for pageinfo window

Definition at line 54 of file pageinfo.c.

Referenced by ro_gui_pageinfo_initialise(), and ro_pageinfo_init().

◆ pageinfo_window

struct ro_pageinfo_window* pageinfo_window = NULL
static

page info window is a singleton

Definition at line 51 of file pageinfo.c.

Referenced by ro_gui_pageinfo_finalise(), and ro_gui_pageinfo_present().