From d6c07925417eaea27c85996bc243f93e27b1bcd0 Mon Sep 17 00:00:00 2001 From: Vincent Sanders Date: Tue, 23 May 2017 11:18:45 +0100 Subject: remove cocoa frontend The cocoa frontend has been broken for a few years and we have no maintainer. It was removed from the CI six months ago and has already bitrotted so it cannot be compiled. --- frontends/cocoa/selection.m | 104 -------------------------------------------- 1 file changed, 104 deletions(-) delete mode 100644 frontends/cocoa/selection.m (limited to 'frontends/cocoa/selection.m') diff --git a/frontends/cocoa/selection.m b/frontends/cocoa/selection.m deleted file mode 100644 index 37562bc07..000000000 --- a/frontends/cocoa/selection.m +++ /dev/null @@ -1,104 +0,0 @@ -/* - * Copyright 2011 Sven Weidauer - * - * 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 . - */ - -#import - -#import "cocoa/BrowserViewController.h" -#import "cocoa/selection.h" - -#import "netsurf/clipboard.h" - - -static NSMutableString *cocoa_clipboard_string; - -/** - * 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 - */ -static void gui_get_clipboard(char **buffer, size_t *length) -{ - NSPasteboard *pb = [NSPasteboard generalPasteboard]; - NSString *string = [pb stringForType: NSStringPboardType]; - - *buffer = NULL; - *length = 0; - - if (string) { - const char *text = [string UTF8String]; - *length = strlen(text); - - *buffer = malloc(*length); - - if (*buffer != NULL) { - memcpy(*buffer, text, *length); - } else { - *length = 0; - } - } -} - -/** - * 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 - */ -static void gui_set_clipboard(const char *buffer, size_t length, - nsclipboard_styles styles[], int n_styles) -{ - /* Empty clipboard string */ - if (nil == cocoa_clipboard_string) { - cocoa_clipboard_string = [[NSMutableString alloc] init]; - } else { - [cocoa_clipboard_string setString: @""]; - } - - /* Add text to clipboard string */ - if (nil == cocoa_clipboard_string) return; - - [cocoa_clipboard_string appendString: [[[NSString alloc] - initWithBytes: buffer - length: length - encoding: NSUTF8StringEncoding] - autorelease]]; - - /* Stick it on the pasteboard */ - NSPasteboard *pb = [NSPasteboard generalPasteboard]; - [pb declareTypes: [NSArray arrayWithObject: NSStringPboardType] owner: nil]; - bool result = [pb setString: cocoa_clipboard_string forType: NSStringPboardType]; - - if (result) { - /* Empty clipboard string */ - if (nil == cocoa_clipboard_string) { - cocoa_clipboard_string = [[NSMutableString alloc] init]; - } else { - [cocoa_clipboard_string setString: @""]; - } - } -} - -static struct gui_clipboard_table clipboard_table = { - .get = gui_get_clipboard, - .set = gui_set_clipboard, -}; - -struct gui_clipboard_table *cocoa_clipboard_table = &clipboard_table; -- cgit v1.2.3