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

Implementation of framebuffer local history manager. More...

#include <stdint.h>
#include <stdbool.h>
#include <stdlib.h>
#include <limits.h>
#include <libnsfb.h>
#include <libnsfb_plot.h>
#include <libnsfb_event.h>
#include "utils/log.h"
#include "netsurf/keypress.h"
#include "netsurf/plotters.h"
#include "desktop/local_history.h"
#include "framebuffer/gui.h"
#include "framebuffer/fbtk.h"
#include "framebuffer/framebuffer.h"
#include "framebuffer/corewindow.h"
#include "framebuffer/local_history.h"
Include dependency graph for local_history.c:

Go to the source code of this file.

Data Structures

struct  fb_local_history_window
 

Functions

static nserror fb_local_history_mouse (struct fb_corewindow *fb_cw, browser_mouse_state mouse_state, int x, int y)
 callback for mouse action on local history window More...
 
static nserror fb_local_history_key (struct fb_corewindow *fb_cw, uint32_t nskey)
 callback for keypress on local history window More...
 
static nserror fb_local_history_draw (struct fb_corewindow *fb_cw, struct rect *r)
 callback on draw event for local history window More...
 
static nserror fb_local_history_init (fbtk_widget_t *parent, struct browser_window *bw, struct fb_local_history_window **win_out)
 Creates the window for the local history view. More...
 
nserror fb_local_history_present (fbtk_widget_t *parent, struct browser_window *bw)
 make the local history window visible. More...
 
nserror fb_local_history_hide (void)
 hide the local history window from being visible. More...
 
nserror fb_local_history_destroy (void)
 Destroys the local history window and performs any other necessary cleanup actions. More...
 

Variables

static struct fb_local_history_windowlocal_history_window = NULL
 

Detailed Description

Implementation of framebuffer local history manager.

Definition in file local_history.c.

Function Documentation

◆ fb_local_history_destroy()

nserror fb_local_history_destroy ( void  )

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

Definition at line 231 of file local_history.c.

References fb_local_history_window::core, fb_corewindow_fini(), local_history_fini(), local_history_window, NSERROR_OK, and fb_local_history_window::session.

Here is the call graph for this function:

◆ fb_local_history_draw()

static nserror fb_local_history_draw ( struct fb_corewindow fb_cw,
struct rect r 
)
static

callback on draw event for local history window

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

Definition at line 110 of file local_history.c.

References fb_plotters, redraw_context::interactive, local_history_redraw(), NSERROR_OK, and fb_local_history_window::session.

Referenced by fb_local_history_init().

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

◆ fb_local_history_hide()

nserror fb_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 216 of file local_history.c.

References fb_local_history_window::core, fbtk_set_mapping(), local_history_set(), local_history_window, NSERROR_OK, fb_local_history_window::session, and fb_corewindow::wnd.

Here is the call graph for this function:

◆ fb_local_history_init()

static nserror fb_local_history_init ( fbtk_widget_t parent,
struct browser_window bw,
struct fb_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 133 of file local_history.c.

References fb_corewindow::cb_table, fb_local_history_window::core, fb_corewindow::draw, fb_corewindow_init(), fb_local_history_draw(), fb_local_history_key(), fb_local_history_mouse(), fb_corewindow::key, local_history_init(), local_history_set(), fb_corewindow::mouse, NSERROR_NOMEM, NSERROR_OK, parent, and fb_local_history_window::session.

Referenced by fb_local_history_present().

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

◆ fb_local_history_key()

static nserror fb_local_history_key ( struct fb_corewindow fb_cw,
uint32_t  nskey 
)
static

callback for keypress on local history window

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

Definition at line 89 of file local_history.c.

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

Referenced by fb_local_history_init().

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

◆ fb_local_history_mouse()

static nserror fb_local_history_mouse ( struct fb_corewindow fb_cw,
browser_mouse_state  mouse_state,
int  x,
int  y 
)
static

callback for mouse action on local history window

Parameters
fb_cwThe fb 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 63 of file local_history.c.

References BROWSER_MOUSE_HOVER, fb_local_history_window::core, fbtk_set_mapping(), local_history_mouse_action(), NSERROR_OK, fb_local_history_window::session, and fb_corewindow::wnd.

Referenced by fb_local_history_init().

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

◆ fb_local_history_present()

nserror fb_local_history_present ( fbtk_widget_t 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 179 of file local_history.c.

References fb_local_history_window::core, fb_local_history_init(), fbtk_get_height(), fbtk_get_width(), fbtk_set_mapping(), fbtk_set_zorder(), height, local_history_get_size(), local_history_scroll_to_cursor(), local_history_window, NSERROR_OK, parent, fb_local_history_window::session, width, and fb_corewindow::wnd.

Referenced by fb_localhistory_btn_clik().

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

Variable Documentation

◆ local_history_window

struct fb_local_history_window* local_history_window = NULL
static