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

Implementation of win32 cookie manager. More...

#include <stdint.h>
#include <stdlib.h>
#include <windows.h>
#include "utils/log.h"
#include "utils/nsoption.h"
#include "netsurf/keypress.h"
#include "netsurf/plotters.h"
#include "desktop/cookie_manager.h"
#include "windows/plot.h"
#include "windows/corewindow.h"
#include "windows/cookies.h"
#include "windows/gui.h"
Include dependency graph for cookies.c:

Go to the source code of this file.

Data Structures

struct  nsw32_cookie_window
 

Functions

static nserror nsw32_cookie_key (struct nsw32_corewindow *nsw32_cw, uint32_t nskey)
 callback for keypress on cookie window More...
 
static nserror nsw32_cookie_mouse (struct nsw32_corewindow *nsw32_cw, browser_mouse_state mouse_state, int x, int y)
 callback for mouse action on cookie window More...
 
static nserror nsw32_cookie_draw (struct nsw32_corewindow *nsw32_cw, int scrollx, int scrolly, struct rect *r)
 callback on draw event for cookie window More...
 
static nserror nsw32_cookie_close (struct nsw32_corewindow *nsw32_cw)
 callback on close event for cookie window More...
 
static nserror nsw32_cookie_init (HINSTANCE hInstance)
 Creates the window for the cookie tree. More...
 
nserror nsw32_cookies_present (const char *search_term)
 make the cookie window visible. More...
 
nserror nsw32_cookies_finalise (void)
 Free any resources allocated for the cookie window. More...
 

Variables

static struct nsw32_cookie_windowcookie_window = NULL
 

Detailed Description

Implementation of win32 cookie manager.

Definition in file cookies.c.

Function Documentation

◆ nsw32_cookie_close()

static nserror nsw32_cookie_close ( struct nsw32_corewindow nsw32_cw)
static

callback on close event for cookie window

Parameters
nsw32_cwThe nsw32 core window structure.
Returns
NSERROR_OK on success otherwise apropriate error code

Definition at line 117 of file cookies.c.

References nsw32_corewindow::hWnd, NSERROR_OK, and ShowWindow.

Referenced by nsw32_cookie_init().

Here is the caller graph for this function:

◆ nsw32_cookie_draw()

static nserror nsw32_cookie_draw ( struct nsw32_corewindow nsw32_cw,
int  scrollx,
int  scrolly,
struct rect r 
)
static

callback on draw event for cookie window

Parameters
nsw32_cwThe nsw32 core window structure.
scrollxThe horizontal scroll offset.
scrollyThe vertical scroll offset.
rThe rectangle of the window that needs updating.
Returns
NSERROR_OK on success otherwise apropriate error code

Definition at line 93 of file cookies.c.

References cookie_manager_redraw(), redraw_context::interactive, NSERROR_OK, and win_plotters.

Referenced by nsw32_cookie_init().

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

◆ nsw32_cookie_init()

static nserror nsw32_cookie_init ( HINSTANCE  hInstance)
static

Creates the window for the cookie tree.

Parameters
hInstanceThe application instance
Returns
NSERROR_OK on success else appropriate error code on faliure.

Definition at line 131 of file cookies.c.

References nsw32_corewindow::close, cookie_manager_init(), cookie_window, nsw32_cookie_window::core, nsw32_corewindow::draw, nsw32_corewindow::key, nsw32_corewindow::mouse, NSERROR_NOMEM, NSERROR_OK, nsw32_cookie_close(), nsw32_cookie_draw(), nsw32_cookie_key(), nsw32_cookie_mouse(), nsw32_corewindow_init(), and nsw32_corewindow::title.

Referenced by nsw32_cookies_present().

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

◆ nsw32_cookie_key()

static nserror nsw32_cookie_key ( struct nsw32_corewindow nsw32_cw,
uint32_t  nskey 
)
static

callback for keypress on cookie window

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

Definition at line 54 of file cookies.c.

References cookie_manager_keypress(), NSERROR_NOT_IMPLEMENTED, and NSERROR_OK.

Referenced by nsw32_cookie_init().

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

◆ nsw32_cookie_mouse()

static nserror nsw32_cookie_mouse ( struct nsw32_corewindow nsw32_cw,
browser_mouse_state  mouse_state,
int  x,
int  y 
)
static

callback for mouse action on cookie window

Parameters
nsw32_cwThe nsw32 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 73 of file cookies.c.

References cookie_manager_mouse_action(), and NSERROR_OK.

Referenced by nsw32_cookie_init().

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

◆ nsw32_cookies_finalise()

nserror nsw32_cookies_finalise ( void  )

Free any resources allocated for the cookie window.

Returns
NSERROR_OK on success else appropriate error code on faliure.

Definition at line 189 of file cookies.c.

References cookie_manager_fini(), cookie_window, nsw32_cookie_window::core, nsw32_corewindow::hWnd, NSERROR_OK, and nsw32_corewindow_fini().

Here is the call graph for this function:

◆ nsw32_cookies_present()

nserror nsw32_cookies_present ( const char *  search_term)

make the cookie window visible.

Returns
NSERROR_OK on success else appropriate error code on faliure.

Definition at line 173 of file cookies.c.

References cookie_manager_set_search_string(), cookie_window, nsw32_cookie_window::core, hinst, nsw32_corewindow::hWnd, NSERROR_OK, nsw32_cookie_init(), and ShowWindow.

Referenced by nsws_window_command().

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

Variable Documentation

◆ cookie_window

struct nsw32_cookie_window* cookie_window = NULL
static

Definition at line 44 of file cookies.c.

Referenced by nsw32_cookie_init(), nsw32_cookies_finalise(), and nsw32_cookies_present().