NetSurf
clipboard.h
Go to the documentation of this file.
1/*
2 * Copyright 2014 Vincent Sanders <vince@netsurf-browser.org>
3 *
4 * This file is part of NetSurf, http://www.netsurf-browser.org/
5 *
6 * NetSurf is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by
8 * the Free Software Foundation; version 2 of the License.
9 *
10 * NetSurf is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
14 *
15 * You should have received a copy of the GNU General Public License
16 * along with this program. If not, see <http://www.gnu.org/licenses/>.
17 */
18
19/**
20 * \file
21 *
22 * Interface to platform-specific clipboard operations.
23 */
24
25#ifndef _NETSURF_CLIPBOARD_H_
26#define _NETSURF_CLIPBOARD_H_
27
28#include <stddef.h>
29
30#include "utils/errors.h"
31#include "netsurf/plot_style.h"
32
33typedef struct nsnsclipboard_styles {
34 size_t start; /**< Start of run */
35
36 plot_font_style_t style; /**< Style to give text run */
38
39/**
40 * function table for clipboard operations.
41 */
43 /**
44 * Core asks front end for clipboard contents.
45 *
46 * \param buffer UTF-8 text, allocated by front end, ownership yeilded to core
47 * \param length Byte length of UTF-8 text in buffer
48 */
49 void (*get)(char **buffer, size_t *length);
50
51 /**
52 * Core tells front end to put given text in clipboard
53 *
54 * \param buffer UTF-8 text, owned by core
55 * \param length Byte length of UTF-8 text in buffer
56 * \param styles Array of styles given to text runs, owned by core, or NULL
57 * \param n_styles Number of text run styles in array
58 */
59 void (*set)(const char *buffer, size_t length, nsclipboard_styles styles[], int n_styles);
60};
61
62#endif
static osspriteop_area * buffer
The buffer characteristics.
Definition: buffer.c:55
Error codes.
struct nsnsclipboard_styles nsclipboard_styles
plotter style interfaces, generic styles and style colour helpers.
function table for clipboard operations.
Definition: clipboard.h:42
void(* get)(char **buffer, size_t *length)
Core asks front end for clipboard contents.
Definition: clipboard.h:49
void(* set)(const char *buffer, size_t length, nsclipboard_styles styles[], int n_styles)
Core tells front end to put given text in clipboard.
Definition: clipboard.h:59
size_t start
Start of run.
Definition: clipboard.h:34
plot_font_style_t style
Style to give text run.
Definition: clipboard.h:36
Font style for plotting.
Definition: plot_style.h:111