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

Implementation of RISC OS local history. More...

#include <stdint.h>
#include <stdlib.h>
#include <oslib/wimp.h>
#include "utils/nsoption.h"
#include "utils/messages.h"
#include "utils/log.h"
#include "utils/nsurl.h"
#include "netsurf/window.h"
#include "netsurf/plotters.h"
#include "netsurf/keypress.h"
#include "desktop/local_history.h"
#include "riscos/dialog.h"
#include "riscos/gui.h"
#include "riscos/menus.h"
#include "riscos/save.h"
#include "riscos/toolbar.h"
#include "riscos/wimp.h"
#include "riscos/wimp_event.h"
#include "riscos/wimputils.h"
#include "riscos/corewindow.h"
#include "riscos/local_history.h"
Include dependency graph for local_history.c:

Go to the source code of this file.

Data Structures

struct  ro_local_history_window
 

Functions

static nserror ro_local_history_draw (struct ro_corewindow *ro_cw, int originx, int originy, struct rect *r)
 callback to draw on drawable area of ro local history window More...
 
static nserror ro_local_history_key (struct ro_corewindow *ro_cw, uint32_t nskey)
 callback for keypress on ro coookie window More...
 
static nserror ro_local_history_tooltip (struct ro_local_history_window *lhw, int x, int y)
 handle hover mouse movement for tooltips More...
 
static nserror ro_local_history_mouse (struct ro_corewindow *ro_cw, browser_mouse_state mouse_state, int x, int y)
 callback for mouse event on ro local_history window More...
 
static nserror ro_local_history_init (struct browser_window *bw, struct ro_local_history_window **win_out)
 Creates the window for the local_history tree. More...
 
static nserror ro_local_history_open (struct ro_local_history_window *lhw, wimp_w parent)
 open RISC OS local history window at the correct size More...
 
nserror ro_gui_local_history_present (wimp_w parent, struct browser_window *bw)
 make the local history window visible. More...
 
void ro_gui_local_history_initialise (void)
 initialise the local history window template ready for subsequent use. More...
 
nserror ro_gui_local_history_finalise (void)
 Free any resources allocated for the local history window. More...
 

Variables

static struct ro_local_history_windowlocal_history_window = NULL
 local_history window is a singleton More...
 
static wimp_window * dialog_local_history_template
 riscos template for local_history window More...
 

Detailed Description

Implementation of RISC OS local history.

Definition in file local_history.c.

Function Documentation

◆ ro_gui_local_history_finalise()

nserror ro_gui_local_history_finalise ( void  )

Free any resources allocated for the local history window.

Returns
NSERROR_OK on success else appropriate error code on faliure.

Definition at line 444 of file local_history.c.

References ro_local_history_window::core, local_history_fini(), local_history_window, NSERROR_OK, ro_corewindow_fini(), and ro_local_history_window::session.

Referenced by gui_quit().

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

◆ ro_gui_local_history_initialise()

void ro_gui_local_history_initialise ( void  )

initialise the local history window template ready for subsequent use.

Definition at line 437 of file local_history.c.

References dialog_local_history_template, 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_local_history_present()

nserror ro_gui_local_history_present ( wimp_w  parent,
struct browser_window bw 
)

make the local history window visible.

Returns
NSERROR_OK on success else appropriate error code on faliure.

Definition at line 420 of file local_history.c.

References local_history_window, NSERROR_OK, NSLOG, parent, ro_local_history_init(), and ro_local_history_open().

Referenced by ro_gui_window_action_local_history().

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

◆ ro_local_history_draw()

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

callback to draw on drawable area of ro local history 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 77 of file local_history.c.

References redraw_context::interactive, local_history_redraw(), no_font_blending, NSERROR_OK, ro_plot_origin_x, ro_plot_origin_y, ro_plotters, and ro_local_history_window::session.

Referenced by ro_local_history_init().

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

◆ ro_local_history_init()

static nserror ro_local_history_init ( struct browser_window bw,
struct ro_local_history_window **  win_out 
)
static

Creates the window for the local_history tree.

Returns
NSERROR_OK on success else appropriate error code on faliure.

Definition at line 289 of file local_history.c.

References ro_local_history_window::core, dialog_local_history_template, ro_corewindow::draw, ro_corewindow::key, local_history_init(), local_history_set(), ro_corewindow::mouse, NSERROR_NOMEM, NSERROR_OK, NSLOG, ro_corewindow_init(), ro_local_history_draw(), ro_local_history_key(), ro_local_history_mouse(), ro_warn_user(), ro_local_history_window::session, and ro_corewindow::wh.

Referenced by ro_gui_local_history_present().

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

◆ ro_local_history_key()

static nserror ro_local_history_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 111 of file local_history.c.

References local_history_keypress(), NSERROR_NOT_IMPLEMENTED, NSERROR_OK, and ro_local_history_window::session.

Referenced by ro_local_history_init().

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

◆ ro_local_history_mouse()

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

callback for mouse event on ro local_history 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 256 of file local_history.c.

References BROWSER_MOUSE_HOVER, BROWSER_MOUSE_LEAVE, dialog_tooltip, local_history_mouse_action(), NSERROR_OK, ro_gui_dialog_close(), ro_local_history_tooltip(), ro_local_history_window::session, ro_local_history_window::x, and ro_local_history_window::y.

Referenced by ro_local_history_init().

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

◆ ro_local_history_open()

static nserror ro_local_history_open ( struct ro_local_history_window lhw,
wimp_w  parent 
)
static

open RISC OS local history window at the correct size

Definition at line 354 of file local_history.c.

References ro_local_history_window::core, height, local_history_get_size(), local_history_scroll_to_cursor(), NSERROR_NOMEM, NSERROR_OK, NSLOG, parent, PTR_WIMP_OPEN, ro_gui_dialog_open_persistent(), ro_warn_user(), ro_local_history_window::session, ro_corewindow::wh, and width.

Referenced by ro_gui_local_history_present().

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

◆ ro_local_history_tooltip()

static nserror ro_local_history_tooltip ( struct ro_local_history_window lhw,
int  x,
int  y 
)
static

handle hover mouse movement for tooltips

Definition at line 128 of file local_history.c.

References dialog_tooltip, local_history_get_url(), NSERROR_NOMEM, NSERROR_OK, NSLOG, nsoption_bool, nsurl_access(), nsurl_length(), nsurl_unref(), PTR_WIMP_OPEN, ro_gui_set_icon_string(), ro_warn_user(), ro_local_history_window::session, width, ro_local_history_window::x, and ro_local_history_window::y.

Referenced by ro_local_history_mouse().

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

Variable Documentation

◆ dialog_local_history_template

wimp_window* dialog_local_history_template
static

riscos template for local_history window

Definition at line 64 of file local_history.c.

Referenced by ro_gui_local_history_initialise(), and ro_local_history_init().

◆ local_history_window

struct ro_local_history_window* local_history_window = NULL
static

local_history window is a singleton

Definition at line 61 of file local_history.c.

Referenced by ro_gui_local_history_finalise(), and ro_gui_local_history_present().