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

Implementation of GTK local history manager. More...

#include <stdint.h>
#include <stdlib.h>
#include <gtk/gtk.h>
#include "utils/log.h"
#include "netsurf/keypress.h"
#include "netsurf/plotters.h"
#include "desktop/local_history.h"
#include "gtk/compat.h"
#include "gtk/plotters.h"
#include "gtk/resources.h"
#include "gtk/corewindow.h"
#include "gtk/local_history.h"
#include "gtk/scaffolding.h"
Include dependency graph for local_history.c:

Go to the source code of this file.

Data Structures

struct  nsgtk_local_history_window
 

Functions

static nserror nsgtk_local_history_mouse (struct nsgtk_corewindow *nsgtk_cw, browser_mouse_state mouse_state, int x, int y)
 callback for mouse action on local history window More...
 
static nserror nsgtk_local_history_key (struct nsgtk_corewindow *nsgtk_cw, uint32_t nskey)
 callback for keypress on local history window More...
 
static nserror nsgtk_local_history_draw (struct nsgtk_corewindow *nsgtk_cw, struct rect *r)
 callback on draw event for local history window More...
 
static nserror nsgtk_local_history_init (struct browser_window *bw, struct nsgtk_local_history_window **win_out)
 Creates the window for the local history view. More...
 
nserror nsgtk_local_history_present (GtkWindow *parent, struct browser_window *bw)
 make the local history window visible. More...
 
nserror nsgtk_local_history_hide (void)
 hide the local history window from being visible. More...
 
nserror nsgtk_local_history_destroy (void)
 Destroys the local history window and performs any other necessary cleanup actions. More...
 
void nsgtk_local_history_set_position (int x, int y)
 set the local history window position. More...
 

Variables

static struct nsgtk_local_history_windowlocal_history_window = NULL
 

Detailed Description

Implementation of GTK local history manager.

Definition in file local_history.c.

Function Documentation

◆ nsgtk_local_history_destroy()

nserror nsgtk_local_history_destroy ( void  )

Destroys the local history window and performs any other necessary cleanup actions.

Definition at line 277 of file local_history.c.

References nsgtk_local_history_window::builder, nsgtk_local_history_window::core, local_history_fini(), local_history_window, NSERROR_OK, nsgtk_corewindow_fini(), nsgtk_local_history_window::session, and nsgtk_local_history_window::wnd.

Referenced by nsgtk_finalise().

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

◆ nsgtk_local_history_draw()

static nserror nsgtk_local_history_draw ( struct nsgtk_corewindow nsgtk_cw,
struct rect r 
)
static

callback on draw event for local history window

Parameters
nsgtk_cwThe nsgtk core window structure.
rThe rectangle of the window that needs updating.
Returns
NSERROR_OK on success otherwise apropriate error code

Definition at line 107 of file local_history.c.

References plotter_table::clip, redraw_context::interactive, local_history_redraw(), NSERROR_OK, nsgtk_plotters, redraw_context::plot, and nsgtk_local_history_window::session.

Referenced by nsgtk_local_history_init().

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

◆ nsgtk_local_history_hide()

nserror nsgtk_local_history_hide ( void  )

hide the local history window from being visible.

Returns
NSERROR_OK on success else appropriate error code on faliure.

Definition at line 262 of file local_history.c.

References local_history_set(), local_history_window, NSERROR_OK, nsgtk_local_history_window::session, and nsgtk_local_history_window::wnd.

Referenced by back_button_clicked_cb(), forward_button_clicked_cb(), nsgtk_toolbar_throbber(), nsgtk_window_button_press_event(), scaffolding_update_context(), and scaffolding_window_destroy().

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

◆ nsgtk_local_history_init()

static nserror nsgtk_local_history_init ( struct browser_window bw,
struct nsgtk_local_history_window **  win_out 
)
static

Creates the window for the local history view.

Returns
NSERROR_OK on success else appropriate error code on faliure.

Definition at line 131 of file local_history.c.

References nsgtk_local_history_window::builder, nsgtk_corewindow::cb_table, nsgtk_local_history_window::core, nsgtk_corewindow::draw, nsgtk_corewindow::drawing_area, nsgtk_corewindow::key, local_history_init(), local_history_set(), nsgtk_corewindow::mouse, NSERROR_NOMEM, NSERROR_OK, nsgtk_builder_new_from_resname(), nsgtk_corewindow_init(), nsgtk_local_history_draw(), nsgtk_local_history_key(), nsgtk_local_history_mouse(), NSLOG, nsgtk_corewindow::scrolled, nsgtk_local_history_window::session, and nsgtk_local_history_window::wnd.

Referenced by nsgtk_local_history_present().

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

◆ nsgtk_local_history_key()

static nserror nsgtk_local_history_key ( struct nsgtk_corewindow nsgtk_cw,
uint32_t  nskey 
)
static

callback for keypress on local history window

Parameters
nsgtk_cwThe nsgtk core window structure.
nskeyThe netsurf key code
Returns
NSERROR_OK on success otherwise apropriate error code

Definition at line 86 of file local_history.c.

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

Referenced by nsgtk_local_history_init().

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

◆ nsgtk_local_history_mouse()

static nserror nsgtk_local_history_mouse ( struct nsgtk_corewindow nsgtk_cw,
browser_mouse_state  mouse_state,
int  x,
int  y 
)
static

callback for mouse action on local history window

Parameters
nsgtk_cwThe nsgtk core window structure.
mouse_statenetsurf mouse state on event
xlocation of event
ylocation of event
Returns
NSERROR_OK on success otherwise apropriate error code

Definition at line 64 of file local_history.c.

References local_history_mouse_action(), NSERROR_OK, and nsgtk_local_history_window::session.

Referenced by nsgtk_local_history_init().

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

◆ nsgtk_local_history_present()

nserror nsgtk_local_history_present ( GtkWindow *  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 218 of file local_history.c.

References height, local_history_get_size(), local_history_scroll_to_cursor(), local_history_window, NSERROR_OK, nsgtk_current_scaffolding(), nsgtk_local_history_init(), nsgtk_scaffolding_position_local_history(), parent, nsgtk_local_history_window::session, width, and nsgtk_local_history_window::wnd.

Referenced by localhistory_button_clicked_cb().

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

◆ nsgtk_local_history_set_position()

void nsgtk_local_history_set_position ( int  x,
int  y 
)

set the local history window position.

Definition at line 299 of file local_history.c.

References local_history_window, NSLOG, and nsgtk_local_history_window::wnd.

Referenced by nsgtk_toolbar_position_local_history().

Here is the caller graph for this function:

Variable Documentation

◆ local_history_window

struct nsgtk_local_history_window* local_history_window = NULL
static