From e93fae7f2d9fdcc4ddf2a4db936cbd0dd33de20c Mon Sep 17 00:00:00 2001 From: Michael Drake Date: Tue, 8 Jan 2013 16:44:45 +0000 Subject: 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. --- desktop/gui.h | 33 +++++++++++++++++++++++++++------ 1 file changed, 27 insertions(+), 6 deletions(-) (limited to 'desktop') 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); -- cgit v1.2.3