summaryrefslogtreecommitdiff
path: root/cocoa
diff options
context:
space:
mode:
authorVincent Sanders <vince@netsurf-browser.org>2014-01-15 12:28:55 +0000
committerVincent Sanders <vince@netsurf-browser.org>2014-01-15 12:28:55 +0000
commit68eaec5cb4208ee80e7c0610361405fd01fc1b69 (patch)
treeaea90291a5f6fe6e8848644d9fe712201d01eaf0 /cocoa
parent0075eab1949e4de071b3649c68ba402b8ffce6fb (diff)
downloadnetsurf-68eaec5cb4208ee80e7c0610361405fd01fc1b69.tar.gz
netsurf-68eaec5cb4208ee80e7c0610361405fd01fc1b69.tar.bz2
complete move of remaining core gui functions
Diffstat (limited to 'cocoa')
-rw-r--r--cocoa/gui.m18
-rw-r--r--cocoa/selection.h2
-rw-r--r--cocoa/selection.m1
3 files changed, 16 insertions, 5 deletions
diff --git a/cocoa/gui.m b/cocoa/gui.m
index 40dc8e191..2c3680994 100644
--- a/cocoa/gui.m
+++ b/cocoa/gui.m
@@ -24,6 +24,7 @@
#import "cocoa/BrowserViewController.h"
#import "cocoa/BrowserWindowController.h"
#import "cocoa/FormSelectMenu.h"
+#import "cocoa/selection.h"
#import "desktop/gui.h"
#import "desktop/netsurf.h"
@@ -46,7 +47,7 @@ NSString * const kAlwaysCloseMultipleTabs = @"AlwaysCloseMultipleTabs";
#define UNIMPL() NSLog( @"Function '%s' unimplemented", __func__ )
-nsurl *gui_get_resource_url(const char *path)
+static nsurl *gui_get_resource_url(const char *path)
{
nsurl *url = NULL;
NSString *nspath = [[NSBundle mainBundle] pathForResource: [NSString stringWithUTF8String: path] ofType: @""];
@@ -251,7 +252,7 @@ static void gui_window_new_content(struct gui_window *g)
}
-void gui_create_form_select_menu(struct browser_window *bw,
+static void gui_create_form_select_menu(struct browser_window *bw,
struct form_control *control)
{
FormSelectMenu *menu = [[FormSelectMenu alloc] initWithControl: control forWindow: bw];
@@ -259,14 +260,14 @@ void gui_create_form_select_menu(struct browser_window *bw,
[menu release];
}
-void gui_launch_url(const char *url)
+static void gui_launch_url(const char *url)
{
[[NSWorkspace sharedWorkspace] openURL: [NSURL URLWithString: [NSString stringWithUTF8String: url]]];
}
struct ssl_cert_info;
-void gui_cert_verify(nsurl *url, const struct ssl_cert_info *certs,
+static void gui_cert_verify(nsurl *url, const struct ssl_cert_info *certs,
unsigned long num, nserror (*cb)(bool proceed, void *pw),
void *cbpw)
{
@@ -304,7 +305,14 @@ static struct gui_window_table cocoa_window_table = {
};
static struct gui_table gui_table = {
- .poll = &gui_poll,
+ .poll = gui_poll,
+ .get_resource_url = gui_get_resource_url,
+ .launch_url = gui_launch_url,
+ .create_form_select_menu = gui_create_form_select_menu,
+ .cert_verify = gui_cert_verify,
+
+ .get_clipboard = gui_get_clipboard,
+ .set_clipboard = gui_set_clipboard,
.window = &cocoa_window_table,
};
diff --git a/cocoa/selection.h b/cocoa/selection.h
new file mode 100644
index 000000000..14b6e763f
--- /dev/null
+++ b/cocoa/selection.h
@@ -0,0 +1,2 @@
+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);
diff --git a/cocoa/selection.m b/cocoa/selection.m
index daa64bf08..e95a78441 100644
--- a/cocoa/selection.m
+++ b/cocoa/selection.m
@@ -19,6 +19,7 @@
#import <Cocoa/Cocoa.h>
#import "cocoa/BrowserViewController.h"
+#import "cocoa/selection.h"
#import "desktop/browser_private.h"