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

nsfb internal clipboard handling More...

#include <assert.h>
#include <stdint.h>
#include <string.h>
#include <stdlib.h>
#include "utils/log.h"
#include "netsurf/browser_window.h"
#include "netsurf/clipboard.h"
#include "framebuffer/gui.h"
#include "framebuffer/clipboard.h"
Include dependency graph for clipboard.c:

Go to the source code of this file.

Data Structures

struct  gui_clipboard
 

Functions

static void gui_get_clipboard (char **buffer, size_t *length)
 Core asks front end for clipboard contents. More...
 
static void gui_set_clipboard (const char *buffer, size_t length, nsclipboard_styles styles[], int n_styles)
 Core tells front end to put given text in clipboard. More...
 

Variables

static struct gui_clipboard gui_clipboard
 
static struct gui_clipboard_table clipboard_table
 
struct gui_clipboard_tableframebuffer_clipboard_table = &clipboard_table
 

Detailed Description

nsfb internal clipboard handling

Definition in file clipboard.c.

Function Documentation

◆ gui_get_clipboard()

static void gui_get_clipboard ( char **  buffer,
size_t *  length 
)
static

Core asks front end for clipboard contents.

Parameters
bufferUTF-8 text, allocated by front end, ownership yeilded to core
lengthByte length of UTF-8 text in buffer

Definition at line 49 of file clipboard.c.

References gui_clipboard::buffer, buffer, gui_clipboard::length, and NSLOG.

◆ gui_set_clipboard()

static void gui_set_clipboard ( const char *  buffer,
size_t  length,
nsclipboard_styles  styles[],
int  n_styles 
)
static

Core tells front end to put given text in clipboard.

Parameters
bufferUTF-8 text, owned by core
lengthByte length of UTF-8 text in buffer
stylesArray of styles given to text runs, owned by core, or NULL
n_stylesNumber of text run styles in array

Definition at line 78 of file clipboard.c.

References gui_clipboard::buffer, buffer, gui_clipboard::buffer_len, and gui_clipboard::length.

Variable Documentation

◆ clipboard_table

struct gui_clipboard_table clipboard_table
static
Initial value:
= {
}
static void gui_set_clipboard(const char *buffer, size_t length, nsclipboard_styles styles[], int n_styles)
Core tells front end to put given text in clipboard.
Definition: clipboard.c:78
static void gui_get_clipboard(char **buffer, size_t *length)
Core asks front end for clipboard contents.
Definition: clipboard.c:49

Definition at line 100 of file clipboard.c.

◆ framebuffer_clipboard_table

struct gui_clipboard_table* framebuffer_clipboard_table = &clipboard_table

Definition at line 105 of file clipboard.c.

Referenced by main().

◆ gui_clipboard