From d240bec03627f5a26cd70e83a58483c69834f7c2 Mon Sep 17 00:00:00 2001 From: Vincent Sanders Date: Mon, 30 May 2016 11:04:32 +0100 Subject: move clipboard header into public API --- desktop/gui_clipboard.h | 62 --------------------------------------- desktop/gui_factory.c | 2 +- desktop/selection.c | 2 +- desktop/textarea.c | 2 +- desktop/treeview.c | 2 +- frontends/amiga/clipboard.c | 2 +- frontends/atari/gui.c | 2 +- frontends/beos/about.cpp | 2 +- frontends/beos/gui.cpp | 2 +- frontends/beos/login.cpp | 2 +- frontends/beos/scaffolding.cpp | 2 +- frontends/beos/window.cpp | 2 +- frontends/cocoa/selection.m | 2 +- frontends/framebuffer/clipboard.c | 2 +- frontends/gtk/selection.c | 2 +- frontends/riscos/textselection.c | 2 +- frontends/windows/gui.c | 2 +- frontends/windows/pointers.c | 2 +- include/netsurf/clipboard.h | 62 +++++++++++++++++++++++++++++++++++++++ 19 files changed, 79 insertions(+), 79 deletions(-) delete mode 100644 desktop/gui_clipboard.h create mode 100644 include/netsurf/clipboard.h diff --git a/desktop/gui_clipboard.h b/desktop/gui_clipboard.h deleted file mode 100644 index 6feea2404..000000000 --- a/desktop/gui_clipboard.h +++ /dev/null @@ -1,62 +0,0 @@ -/* - * Copyright 2014 Vincent Sanders - * - * This file is part of NetSurf, http://www.netsurf-browser.org/ - * - * NetSurf is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; version 2 of the License. - * - * NetSurf is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ - -/** - * \file - * - * Interface to platform-specific clipboard operations. - */ - -#ifndef _NETSURF_DESKTOP_GUI_CLIPBOARD_H_ -#define _NETSURF_DESKTOP_GUI_CLIPBOARD_H_ - -#include - -#include "utils/errors.h" -#include "desktop/plot_style.h" - -typedef struct nsnsclipboard_styles { - size_t start; /**< Start of run */ - - plot_font_style_t style; /**< Style to give text run */ -} nsclipboard_styles; - -/** - * function table for clipboard operations. - */ -struct gui_clipboard_table { - /** - * 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 (*get)(char **buffer, size_t *length); - - /** - * 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 (*set)(const char *buffer, size_t length, nsclipboard_styles styles[], int n_styles); -}; - -#endif diff --git a/desktop/gui_factory.c b/desktop/gui_factory.c index 5ee6326ed..65a3c584a 100644 --- a/desktop/gui_factory.c +++ b/desktop/gui_factory.c @@ -35,7 +35,7 @@ #include "desktop/gui_misc.h" #include "netsurf/window.h" #include "netsurf/search.h" -#include "desktop/gui_clipboard.h" +#include "netsurf/clipboard.h" #include "desktop/gui_utf8.h" #include "desktop/gui_layout.h" #include "desktop/netsurf.h" diff --git a/desktop/selection.c b/desktop/selection.c index 8f064d4a6..d2e326af3 100644 --- a/desktop/selection.c +++ b/desktop/selection.c @@ -42,7 +42,7 @@ #include "desktop/plotters.h" #include "desktop/save_text.h" #include "desktop/selection.h" -#include "desktop/gui_clipboard.h" +#include "netsurf/clipboard.h" #include "netsurf/window.h" #include "desktop/gui_internal.h" diff --git a/desktop/textarea.c b/desktop/textarea.c index 96a1713ef..833815eba 100644 --- a/desktop/textarea.c +++ b/desktop/textarea.c @@ -37,7 +37,7 @@ #include "desktop/textinput.h" #include "desktop/plotters.h" #include "desktop/scrollbar.h" -#include "desktop/gui_clipboard.h" +#include "netsurf/clipboard.h" #include "desktop/gui_layout.h" #include "desktop/gui_internal.h" diff --git a/desktop/treeview.c b/desktop/treeview.c index ec2a513ca..d72bf2f8d 100644 --- a/desktop/treeview.c +++ b/desktop/treeview.c @@ -32,7 +32,7 @@ #include "desktop/plotters.h" #include "desktop/textarea.h" #include "desktop/treeview.h" -#include "desktop/gui_clipboard.h" +#include "netsurf/clipboard.h" #include "desktop/gui_layout.h" #include "desktop/gui_internal.h" diff --git a/frontends/amiga/clipboard.c b/frontends/amiga/clipboard.c index f906e5f76..2322f0e87 100644 --- a/frontends/amiga/clipboard.c +++ b/frontends/amiga/clipboard.c @@ -35,7 +35,7 @@ #include "desktop/plotters.h" #include "desktop/textinput.h" #include "netsurf/window.h" -#include "desktop/gui_clipboard.h" +#include "netsurf/clipboard.h" #include "amiga/bitmap.h" #include "amiga/clipboard.h" diff --git a/frontends/atari/gui.c b/frontends/atari/gui.c index 9e6fd5ea8..5107f83f4 100644 --- a/frontends/atari/gui.c +++ b/frontends/atari/gui.c @@ -37,7 +37,7 @@ #include "desktop/browser.h" #include "desktop/gui_layout.h" #include "netsurf/window.h" -#include "desktop/gui_clipboard.h" +#include "netsurf/clipboard.h" #include "desktop/gui_fetch.h" #include "desktop/gui_misc.h" #include "desktop/netsurf.h" diff --git a/frontends/beos/about.cpp b/frontends/beos/about.cpp index 89eb81829..70268cedc 100644 --- a/frontends/beos/about.cpp +++ b/frontends/beos/about.cpp @@ -26,7 +26,7 @@ extern "C" { #include "testament.h" #include "utils/useragent.h" #include "curl/curlver.h" -#include "desktop/gui_clipboard.h" +#include "netsurf/clipboard.h" } #include "beos/about.h" #include "beos/scaffolding.h" diff --git a/frontends/beos/gui.cpp b/frontends/beos/gui.cpp index 4c0fb512a..645d7d680 100644 --- a/frontends/beos/gui.cpp +++ b/frontends/beos/gui.cpp @@ -64,7 +64,7 @@ extern "C" { #include "content/urldb.h" #include "desktop/browser.h" #include "desktop/gui_misc.h" -#include "desktop/gui_clipboard.h" +#include "netsurf/clipboard.h" #include "netsurf/search.h" #include "desktop/gui_fetch.h" #include "desktop/netsurf.h" diff --git a/frontends/beos/login.cpp b/frontends/beos/login.cpp index 7689c9d35..de2370d33 100644 --- a/frontends/beos/login.cpp +++ b/frontends/beos/login.cpp @@ -34,7 +34,7 @@ extern "C" { #include "utils/messages.h" #include "utils/url.h" #include "utils/utils.h" -#include "desktop/gui_clipboard.h" +#include "netsurf/clipboard.h" } #include "beos/gui.h" #include "beos/scaffolding.h" diff --git a/frontends/beos/scaffolding.cpp b/frontends/beos/scaffolding.cpp index 630e059f2..9780884ba 100644 --- a/frontends/beos/scaffolding.cpp +++ b/frontends/beos/scaffolding.cpp @@ -67,7 +67,7 @@ extern "C" { #include "utils/utils.h" #include "utils/log.h" #include "utils/nsurl.h" -#include "desktop/gui_clipboard.h" +#include "netsurf/clipboard.h" } #include "beos/about.h" #include "beos/bitmap.h" diff --git a/frontends/beos/window.cpp b/frontends/beos/window.cpp index 2938b154a..27be98786 100644 --- a/frontends/beos/window.cpp +++ b/frontends/beos/window.cpp @@ -34,7 +34,7 @@ extern "C" { #include "desktop/textinput.h" #include "desktop/plotters.h" #include "netsurf/window.h" -#include "desktop/gui_clipboard.h" +#include "netsurf/clipboard.h" } #include "beos/about.h" diff --git a/frontends/cocoa/selection.m b/frontends/cocoa/selection.m index 808b70683..37562bc07 100644 --- a/frontends/cocoa/selection.m +++ b/frontends/cocoa/selection.m @@ -21,7 +21,7 @@ #import "cocoa/BrowserViewController.h" #import "cocoa/selection.h" -#import "desktop/gui_clipboard.h" +#import "netsurf/clipboard.h" static NSMutableString *cocoa_clipboard_string; diff --git a/frontends/framebuffer/clipboard.c b/frontends/framebuffer/clipboard.c index 05defe8f9..1d41622cf 100644 --- a/frontends/framebuffer/clipboard.c +++ b/frontends/framebuffer/clipboard.c @@ -27,7 +27,7 @@ #include "utils/log.h" #include "desktop/browser.h" -#include "desktop/gui_clipboard.h" +#include "netsurf/clipboard.h" #include "framebuffer/gui.h" #include "framebuffer/clipboard.h" diff --git a/frontends/gtk/selection.c b/frontends/gtk/selection.c index d1388ed27..ae44e7803 100644 --- a/frontends/gtk/selection.c +++ b/frontends/gtk/selection.c @@ -22,7 +22,7 @@ #include "utils/log.h" #include "desktop/browser.h" -#include "desktop/gui_clipboard.h" +#include "netsurf/clipboard.h" #include "gtk/window.h" diff --git a/frontends/riscos/textselection.c b/frontends/riscos/textselection.c index 0ddb26ddd..81ccc3a68 100644 --- a/frontends/riscos/textselection.c +++ b/frontends/riscos/textselection.c @@ -31,7 +31,7 @@ #include "utils/utf8.h" #include "utils/utils.h" #include "content/hlcache.h" -#include "desktop/gui_clipboard.h" +#include "netsurf/clipboard.h" #include "netsurf/window.h" #include "desktop/textinput.h" #include "desktop/browser.h" diff --git a/frontends/windows/gui.c b/frontends/windows/gui.c index 9923ecfaa..cb75cdfc4 100644 --- a/frontends/windows/gui.c +++ b/frontends/windows/gui.c @@ -32,7 +32,7 @@ #include "utils/file.h" #include "utils/messages.h" #include "desktop/browser.h" -#include "desktop/gui_clipboard.h" +#include "netsurf/clipboard.h" #include "windows/schedule.h" #include "windows/window.h" diff --git a/frontends/windows/pointers.c b/frontends/windows/pointers.c index b5b74545d..abb4fe760 100644 --- a/frontends/windows/pointers.c +++ b/frontends/windows/pointers.c @@ -30,7 +30,7 @@ #include "utils/url.h" #include "utils/file.h" #include "desktop/browser.h" -#include "desktop/gui_clipboard.h" +#include "netsurf/clipboard.h" #include "windows/schedule.h" #include "windows/window.h" diff --git a/include/netsurf/clipboard.h b/include/netsurf/clipboard.h new file mode 100644 index 000000000..6feea2404 --- /dev/null +++ b/include/netsurf/clipboard.h @@ -0,0 +1,62 @@ +/* + * Copyright 2014 Vincent Sanders + * + * This file is part of NetSurf, http://www.netsurf-browser.org/ + * + * NetSurf is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; version 2 of the License. + * + * NetSurf is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +/** + * \file + * + * Interface to platform-specific clipboard operations. + */ + +#ifndef _NETSURF_DESKTOP_GUI_CLIPBOARD_H_ +#define _NETSURF_DESKTOP_GUI_CLIPBOARD_H_ + +#include + +#include "utils/errors.h" +#include "desktop/plot_style.h" + +typedef struct nsnsclipboard_styles { + size_t start; /**< Start of run */ + + plot_font_style_t style; /**< Style to give text run */ +} nsclipboard_styles; + +/** + * function table for clipboard operations. + */ +struct gui_clipboard_table { + /** + * 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 (*get)(char **buffer, size_t *length); + + /** + * 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 (*set)(const char *buffer, size_t length, nsclipboard_styles styles[], int n_styles); +}; + +#endif -- cgit v1.2.3