From befa5e6ed356e019fa82b7ebf9be90913aad3edb Mon Sep 17 00:00:00 2001 From: Witold Filipczyk Date: Fri, 27 Mar 2015 09:36:19 +0000 Subject: To avoid namespace conflicts with ncurses add NetSurf key prefix. Adds a NetSurf key code prefix of NS_ to all key codes. --- cocoa/BookmarksController.m | 2 +- cocoa/BrowserView.m | 40 ++++++++++++++++++++-------------------- cocoa/TreeView.m | 40 ++++++++++++++++++++-------------------- 3 files changed, 41 insertions(+), 41 deletions(-) (limited to 'cocoa') diff --git a/cocoa/BookmarksController.m b/cocoa/BookmarksController.m index 5d3de7488..aba50a8a3 100644 --- a/cocoa/BookmarksController.m +++ b/cocoa/BookmarksController.m @@ -202,7 +202,7 @@ static const char *cocoa_hotlist_path( void ) - (IBAction) deleteSelected: (id) sender; { - hotlist_keypress(KEY_DELETE_LEFT); + hotlist_keypress(NS_KEY_DELETE_LEFT); } - (IBAction) addFolder: (id) sender; diff --git a/cocoa/BrowserView.m b/cocoa/BrowserView.m index e9d6ddd28..c9f70cd67 100644 --- a/cocoa/BrowserView.m +++ b/cocoa/BrowserView.m @@ -311,80 +311,80 @@ static browser_mouse_state cocoa_mouse_flags_for_event( NSEvent *evt ) - (void) moveLeft: (id)sender; { - if (browser_window_key_press( browser, KEY_LEFT )) return; + if (browser_window_key_press( browser, NS_KEY_LEFT )) return; [self scrollHorizontal: -[[self enclosingScrollView] horizontalLineScroll]]; } - (void) moveRight: (id)sender; { - if (browser_window_key_press( browser, KEY_RIGHT )) return; + if (browser_window_key_press( browser, NS_KEY_RIGHT )) return; [self scrollHorizontal: [[self enclosingScrollView] horizontalLineScroll]]; } - (void) moveUp: (id)sender; { - if (browser_window_key_press( browser, KEY_UP )) return; + if (browser_window_key_press( browser, NS_KEY_UP )) return; [self scrollVertical: -[[self enclosingScrollView] lineScroll]]; } - (void) moveDown: (id)sender; { - if (browser_window_key_press( browser, KEY_DOWN )) return; + if (browser_window_key_press( browser, NS_KEY_DOWN )) return; [self scrollVertical: [[self enclosingScrollView] lineScroll]]; } - (void) deleteBackward: (id)sender; { - if (!browser_window_key_press( browser, KEY_DELETE_LEFT )) { + if (!browser_window_key_press( browser, NS_KEY_DELETE_LEFT )) { [NSApp sendAction: @selector( goBack: ) to: nil from: self]; } } - (void) deleteForward: (id)sender; { - browser_window_key_press( browser, KEY_DELETE_RIGHT ); + browser_window_key_press( browser, NS_KEY_DELETE_RIGHT ); } - (void) cancelOperation: (id)sender; { - browser_window_key_press( browser, KEY_ESCAPE ); + browser_window_key_press( browser, NS_KEY_ESCAPE ); } - (void) scrollPageUp: (id)sender; { - if (browser_window_key_press( browser, KEY_PAGE_UP )) return; + if (browser_window_key_press( browser, NS_KEY_PAGE_UP )) return; [self scrollVertical: -[self pageScroll]]; } - (void) scrollPageDown: (id)sender; { - if (browser_window_key_press( browser, KEY_PAGE_DOWN )) return; + if (browser_window_key_press( browser, NS_KEY_PAGE_DOWN )) return; [self scrollVertical: [self pageScroll]]; } - (void) insertTab: (id)sender; { - browser_window_key_press( browser, KEY_TAB ); + browser_window_key_press( browser, NS_KEY_TAB ); } - (void) insertBacktab: (id)sender; { - browser_window_key_press( browser, KEY_SHIFT_TAB ); + browser_window_key_press( browser, NS_KEY_SHIFT_TAB ); } - (void) moveToBeginningOfLine: (id)sender; { - browser_window_key_press( browser, KEY_LINE_START ); + browser_window_key_press( browser, NS_KEY_LINE_START ); } - (void) moveToEndOfLine: (id)sender; { - browser_window_key_press( browser, KEY_LINE_END ); + browser_window_key_press( browser, NS_KEY_LINE_END ); } - (void) moveToBeginningOfDocument: (id)sender; { - if (browser_window_key_press( browser, KEY_TEXT_START )) return; + if (browser_window_key_press( browser, NS_KEY_TEXT_START )) return; } - (void) scrollToBeginningOfDocument: (id) sender; @@ -396,7 +396,7 @@ static browser_mouse_state cocoa_mouse_flags_for_event( NSEvent *evt ) - (void) moveToEndOfDocument: (id)sender; { - browser_window_key_press( browser, KEY_TEXT_END ); + browser_window_key_press( browser, NS_KEY_TEXT_END ); } - (void) scrollToEndOfDocument: (id) sender; @@ -408,27 +408,27 @@ static browser_mouse_state cocoa_mouse_flags_for_event( NSEvent *evt ) - (void) insertNewline: (id)sender; { - browser_window_key_press( browser, KEY_NL ); + browser_window_key_press( browser, NS_KEY_NL ); } - (void) selectAll: (id)sender; { - browser_window_key_press( browser, KEY_SELECT_ALL ); + browser_window_key_press( browser, NS_KEY_SELECT_ALL ); } - (void) copy: (id) sender; { - browser_window_key_press( browser, KEY_COPY_SELECTION ); + browser_window_key_press( browser, NS_KEY_COPY_SELECTION ); } - (void) cut: (id) sender; { - browser_window_key_press( browser, KEY_CUT_SELECTION ); + browser_window_key_press( browser, NS_KEY_CUT_SELECTION ); } - (void) paste: (id) sender; { - browser_window_key_press( browser, KEY_PASTE ); + browser_window_key_press( browser, NS_KEY_PASTE ); } - (BOOL) acceptsFirstResponder; diff --git a/cocoa/TreeView.m b/cocoa/TreeView.m index ec6f1d526..0c7f3e0b3 100644 --- a/cocoa/TreeView.m +++ b/cocoa/TreeView.m @@ -121,102 +121,102 @@ - (void) moveLeft: (id)sender; { - [tree keyPress: KEY_LEFT]; + [tree keyPress: NS_KEY_LEFT]; } - (void) moveRight: (id)sender; { - [tree keyPress: KEY_RIGHT]; + [tree keyPress: NS_KEY_RIGHT]; } - (void) moveUp: (id)sender; { - [tree keyPress: KEY_UP]; + [tree keyPress: NS_KEY_UP]; } - (void) moveDown: (id)sender; { - [tree keyPress: KEY_DOWN]; + [tree keyPress: NS_KEY_DOWN]; } - (void) deleteBackward: (id)sender; { - [tree keyPress: KEY_DELETE_LEFT]; + [tree keyPress: NS_KEY_DELETE_LEFT]; } - (void) deleteForward: (id)sender; { - [tree keyPress: KEY_DELETE_RIGHT]; + [tree keyPress: NS_KEY_DELETE_RIGHT]; } - (void) cancelOperation: (id)sender; { - [tree keyPress: KEY_ESCAPE]; + [tree keyPress: NS_KEY_ESCAPE]; } - (void) scrollPageUp: (id)sender; { - [tree keyPress: KEY_PAGE_UP]; + [tree keyPress: NS_KEY_PAGE_UP]; } - (void) scrollPageDown: (id)sender; { - [tree keyPress: KEY_PAGE_DOWN]; + [tree keyPress: NS_KEY_PAGE_DOWN]; } - (void) insertTab: (id)sender; { - [tree keyPress: KEY_TAB]; + [tree keyPress: NS_KEY_TAB]; } - (void) insertBacktab: (id)sender; { - [tree keyPress: KEY_SHIFT_TAB]; + [tree keyPress: NS_KEY_SHIFT_TAB]; } - (void) moveToBeginningOfLine: (id)sender; { - [tree keyPress: KEY_LINE_START]; + [tree keyPress: NS_KEY_LINE_START]; } - (void) moveToEndOfLine: (id)sender; { - [tree keyPress: KEY_LINE_END]; + [tree keyPress: NS_KEY_LINE_END]; } - (void) moveToBeginningOfDocument: (id)sender; { - [tree keyPress: KEY_TEXT_START]; + [tree keyPress: NS_KEY_TEXT_START]; } - (void) moveToEndOfDocument: (id)sender; { - [tree keyPress: KEY_TEXT_END]; + [tree keyPress: NS_KEY_TEXT_END]; } - (void) insertNewline: (id)sender; { - [tree keyPress: KEY_NL]; + [tree keyPress: NS_KEY_NL]; } - (void) selectAll: (id)sender; { - [tree keyPress: KEY_SELECT_ALL]; + [tree keyPress: NS_KEY_SELECT_ALL]; } - (void) copy: (id) sender; { - [tree keyPress: KEY_COPY_SELECTION]; + [tree keyPress: NS_KEY_COPY_SELECTION]; } - (void) cut: (id) sender; { - [tree keyPress: KEY_CUT_SELECTION]; + [tree keyPress: NS_KEY_CUT_SELECTION]; } - (void) paste: (id) sender; { - [tree keyPress: KEY_PASTE]; + [tree keyPress: NS_KEY_PASTE]; } //MARK: - -- cgit v1.2.3