summaryrefslogtreecommitdiff
path: root/gtk
diff options
context:
space:
mode:
authorVincent Sanders <vince@kyllikki.org>2014-02-01 12:41:23 +0000
committerVincent Sanders <vince@kyllikki.org>2014-02-01 12:41:23 +0000
commit8bb0e87b1a8fc9872762f5caa856f64c4e9f1cdd (patch)
treed7f69b4d1aaf196513103004c0afb4d110d7be9f /gtk
parent1f62b5a980020b0e5df0e68cb476083ba2dc1fe5 (diff)
downloadnetsurf-8bb0e87b1a8fc9872762f5caa856f64c4e9f1cdd.tar.gz
netsurf-8bb0e87b1a8fc9872762f5caa856f64c4e9f1cdd.tar.bz2
make clipboard table operations static and remove unecessary includes
Diffstat (limited to 'gtk')
-rw-r--r--gtk/gui.c7
-rw-r--r--gtk/scaffolding.h14
-rw-r--r--gtk/selection.c11
-rw-r--r--gtk/selection.h7
4 files changed, 15 insertions, 24 deletions
diff --git a/gtk/gui.c b/gtk/gui.c
index c885ad30f..fdf64ad25 100644
--- a/gtk/gui.c
+++ b/gtk/gui.c
@@ -1021,11 +1021,6 @@ uint32_t gtk_gui_gdkkey_to_nskey(GdkEventKey *key)
}
-static struct gui_clipboard_table nsgtk_clipboard_table = {
- .get = gui_get_clipboard,
- .set = gui_set_clipboard,
-};
-
static struct gui_browser_table nsgtk_browser_table = {
.poll = gui_poll,
@@ -1048,7 +1043,7 @@ int main(int argc, char** argv)
struct gui_table nsgtk_gui_table = {
.browser = &nsgtk_browser_table,
.window = nsgtk_window_table,
- .clipboard = &nsgtk_clipboard_table,
+ .clipboard = nsgtk_clipboard_table,
.download = nsgtk_download_table,
.fetch = nsgtk_fetch_table,
};
diff --git a/gtk/scaffolding.h b/gtk/scaffolding.h
index 757da82fd..285f9bb53 100644
--- a/gtk/scaffolding.h
+++ b/gtk/scaffolding.h
@@ -19,15 +19,11 @@
#ifndef NETSURF_GTK_SCAFFOLDING_H
#define NETSURF_GTK_SCAFFOLDING_H 1
-#include <gtk/gtk.h>
-#include <glib.h>
-
-#include "content/hlcache.h"
-#include "desktop/gui.h"
-#include "desktop/plotters.h"
-#include "gtk/menu.h"
-#include "gtk/sexy_icon_entry.h"
+#include <stdbool.h>
+#include "utils/errors.h"
+struct hlcache_handle;
+struct gui_window;
typedef struct gtk_scaffolding nsgtk_scaffolding;
typedef enum {
@@ -182,6 +178,6 @@ void gui_window_set_title(struct gui_window *g, const char *title);
void gui_window_set_url(struct gui_window *g, const char *url);
void gui_window_start_throbber(struct gui_window *g);
void gui_window_stop_throbber(struct gui_window *g);
-void gui_set_search_ico(hlcache_handle *ico);
+void gui_set_search_ico(struct hlcache_handle *ico);
#endif /* NETSURF_GTK_SCAFFOLDING_H */
diff --git a/gtk/selection.c b/gtk/selection.c
index 8bdc0f8c8..22b4bfe5a 100644
--- a/gtk/selection.c
+++ b/gtk/selection.c
@@ -23,7 +23,6 @@
#include "desktop/gui.h"
#include "desktop/browser.h"
-#include "gtk/selection.h"
#include "gtk/window.h"
static GString *current_selection = NULL;
@@ -36,7 +35,7 @@ static GtkClipboard *clipboard;
* \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)
+static void gui_get_clipboard(char **buffer, size_t *length)
{
gchar *gtext;
@@ -72,7 +71,7 @@ void gui_get_clipboard(char **buffer, size_t *length)
* \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,
+static void gui_set_clipboard(const char *buffer, size_t length,
nsclipboard_styles styles[], int n_styles)
{
clipboard = gtk_clipboard_get(GDK_SELECTION_CLIPBOARD);
@@ -88,3 +87,9 @@ void gui_set_clipboard(const char *buffer, size_t length,
gtk_clipboard_set_text(clipboard, current_selection->str, -1);
}
+static struct gui_clipboard_table clipboard_table = {
+ .get = gui_get_clipboard,
+ .set = gui_set_clipboard,
+};
+
+struct gui_clipboard_table *nsgtk_clipboard_table = &clipboard_table;
diff --git a/gtk/selection.h b/gtk/selection.h
index 0d3ec7371..6463692cf 100644
--- a/gtk/selection.h
+++ b/gtk/selection.h
@@ -19,11 +19,6 @@
#ifndef GTK_SELECTION_H
#define GTK_SELECTION_H
-#include <gtk/gtk.h>
-#include "desktop/gui.h"
-
-void gui_get_clipboard(char **buffer, size_t *length);
-void gui_set_clipboard(const char *buffer, size_t length, nsclipboard_styles styles[], int n_styles);
-
+struct gui_clipboard_table *nsgtk_clipboard_table;
#endif