summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Drake <tlsa@netsurf-browser.org>2013-01-08 16:44:45 +0000
committerMichael Drake <tlsa@netsurf-browser.org>2013-01-08 16:44:45 +0000
commite93fae7f2d9fdcc4ddf2a4db936cbd0dd33de20c (patch)
tree6b81d21d40a380c5e27c3fae78b32d518a8add61
parent8314101ada7d800369e7343304ce313d0269f46f (diff)
downloadnetsurf-e93fae7f2d9fdcc4ddf2a4db936cbd0dd33de20c.tar.gz
netsurf-e93fae7f2d9fdcc4ddf2a4db936cbd0dd33de20c.tar.bz2
Change clipboard api, so it does not assume either browser_window/gui_window, or html/text-plain content selection objects. This allows desktop/textarea to use clipboard.
-rw-r--r--desktop/gui.h33
1 files changed, 27 insertions, 6 deletions
diff --git a/desktop/gui.h b/desktop/gui.h
index 48684c3c5..d04d7b405 100644
--- a/desktop/gui.h
+++ b/desktop/gui.h
@@ -119,12 +119,33 @@ void gui_drag_save_selection(struct selection *s, struct gui_window *g);
void gui_start_selection(struct gui_window *g);
void gui_clear_selection(struct gui_window *g);
-void gui_paste_from_clipboard(struct gui_window *g, int x, int y);
-bool gui_empty_clipboard(void);
-bool gui_add_to_clipboard(const char *text, size_t length, bool space,
- const plot_font_style_t *fstyle);
-bool gui_commit_clipboard(void);
-bool gui_copy_to_clipboard(struct selection *s);
+
+
+/**
+ * Core asks front end for clipboard contents.
+ *
+ * \param buffer UTF-8 text, allocated by front end, ownership yeilded to core
+ * \param length Byte length of UTF-8 text in buffer
+ */
+void gui_get_clipboard(char **buffer, size_t *length);
+
+typedef struct nsnsclipboard_styles {
+ size_t start; /**< Start of run */
+
+ plot_font_style_t style; /**< Style to give text run */
+} nsclipboard_styles;
+/**
+ * Core tells front end to put given text in clipboard
+ *
+ * \param buffer UTF-8 text, owned by core
+ * \param length Byte length of UTF-8 text in buffer
+ * \param styles Array of styles given to text runs, owned by core, or NULL
+ * \param n_styles Number of text run styles in array
+ */
+void gui_set_clipboard(const char *buffer, size_t length,
+ nsclipboard_styles styles[], int n_styles);
+
+
void gui_create_form_select_menu(struct browser_window *bw,
struct form_control *control);