NetSurf
Functions | Variables
selection.c File Reference
#include <string.h>
#include <gtk/gtk.h>
#include <stdlib.h>
#include "utils/log.h"
#include "netsurf/browser_window.h"
#include "netsurf/clipboard.h"
#include "gtk/toolbar_items.h"
#include "gtk/window.h"
Include dependency graph for selection.c:

Go to the source code of this file.

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 GString * current_selection = NULL
 
static GtkClipboard * clipboard
 
static struct gui_clipboard_table clipboard_table
 
struct gui_clipboard_tablensgtk_clipboard_table = &clipboard_table
 

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 40 of file selection.c.

References buffer, and clipboard.

◆ 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 76 of file selection.c.

References buffer, clipboard, and current_selection.

Variable Documentation

◆ clipboard

GtkClipboard* clipboard
static

◆ 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: selection.c:76
static void gui_get_clipboard(char **buffer, size_t *length)
Core asks front end for clipboard contents.
Definition: selection.c:40

Definition at line 92 of file selection.c.

◆ current_selection

GString* current_selection = NULL
static

Definition at line 30 of file selection.c.

Referenced by gui_set_clipboard().

◆ nsgtk_clipboard_table

struct gui_clipboard_table* nsgtk_clipboard_table = &clipboard_table

Definition at line 97 of file selection.c.

Referenced by main().