summaryrefslogtreecommitdiff
path: root/desktop
diff options
context:
space:
mode:
authorVincent Sanders <vince@kyllikki.org>2016-07-01 14:27:04 +0100
committerVincent Sanders <vince@kyllikki.org>2016-07-01 14:27:04 +0100
commit8066d1c8b4ef4e8e19d22aa2d92950339271b351 (patch)
treea00969fcd198afdd65b647afa889d97ad535f084 /desktop
parent0758af6631674d2ca88ca127c4b42842821ab7d0 (diff)
downloadnetsurf-8066d1c8b4ef4e8e19d22aa2d92950339271b351.tar.gz
netsurf-8066d1c8b4ef4e8e19d22aa2d92950339271b351.tar.bz2
move key press enums and operations to their own header
Diffstat (limited to 'desktop')
-rw-r--r--desktop/textarea.c12
-rw-r--r--desktop/textinput.c7
-rw-r--r--desktop/textinput.h56
-rw-r--r--desktop/treeview.c2
4 files changed, 14 insertions, 63 deletions
diff --git a/desktop/textarea.c b/desktop/textarea.c
index 80a2acf25..203c28e93 100644
--- a/desktop/textarea.c
+++ b/desktop/textarea.c
@@ -29,16 +29,16 @@
#include "utils/log.h"
#include "utils/utf8.h"
#include "utils/utils.h"
-#include "css/utils.h"
-
#include "netsurf/browser_window.h"
-#include "netsurf/mouse.h"
-#include "desktop/textarea.h"
-#include "desktop/textinput.h"
#include "netsurf/plotters.h"
-#include "desktop/scrollbar.h"
+#include "netsurf/mouse.h"
+#include "netsurf/keypress.h"
#include "netsurf/clipboard.h"
#include "netsurf/layout.h"
+#include "css/utils.h"
+
+#include "desktop/textarea.h"
+#include "desktop/scrollbar.h"
#include "desktop/gui_internal.h"
#define CARET_COLOR 0x0000FF
diff --git a/desktop/textinput.c b/desktop/textinput.c
index d4a8bf8b4..c0e0ba8f7 100644
--- a/desktop/textinput.c
+++ b/desktop/textinput.c
@@ -33,15 +33,16 @@
#include "utils/talloc.h"
#include "utils/utf8.h"
#include "utils/utils.h"
+#include "netsurf/mouse.h"
#include "netsurf/form.h"
+#include "netsurf/window.h"
+#include "netsurf/keypress.h"
#include "render/box.h"
#include "render/html_internal.h"
#include "render/layout.h"
-#include "netsurf/mouse.h"
#include "desktop/browser_private.h"
#include "desktop/textinput.h"
-#include "netsurf/window.h"
#include "desktop/gui_internal.h"
/* Define to enable textinput debug */
@@ -101,7 +102,7 @@ void browser_window_remove_caret(struct browser_window *bw, bool only_hide)
}
}
-/* exported interface documented in desktop/textinput.h */
+/* exported interface documented in netsurf/keypress.h */
bool browser_window_key_press(struct browser_window *bw, uint32_t key)
{
struct browser_window *focus = bw->focus;
diff --git a/desktop/textinput.h b/desktop/textinput.h
index 0b3593104..5859ea8d6 100644
--- a/desktop/textinput.h
+++ b/desktop/textinput.h
@@ -19,8 +19,9 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
-/** \file
- * Textual input handling (interface)
+/**
+ * \file
+ * Textual input handling interface
*/
#ifndef _NETSURF_DESKTOP_TEXTINPUT_H_
@@ -28,49 +29,6 @@
struct browser_window;
-enum input_key {
-
- NS_KEY_SELECT_ALL = 1,
- NS_KEY_COPY_SELECTION = 3,
-
- NS_KEY_DELETE_LEFT = 8,
- NS_KEY_TAB = 9,
-
- NS_KEY_NL = 10,
- NS_KEY_SHIFT_TAB = 11,
- NS_KEY_CR = 13,
-
- NS_KEY_DELETE_LINE = 21,
- NS_KEY_PASTE = 22,
- NS_KEY_CUT_SELECTION = 24,
- NS_KEY_CLEAR_SELECTION = 26,
-
- NS_KEY_ESCAPE = 27,
-
- /* cursor movement keys */
- NS_KEY_LEFT = 28,
- NS_KEY_RIGHT,
- NS_KEY_UP,
- NS_KEY_DOWN,
-
- NS_KEY_DELETE_RIGHT = 127,
-
- NS_KEY_LINE_START = 128,
- NS_KEY_LINE_END,
- NS_KEY_TEXT_START,
- NS_KEY_TEXT_END,
- NS_KEY_WORD_LEFT,
- NS_KEY_WORD_RIGHT,
- NS_KEY_PAGE_UP,
- NS_KEY_PAGE_DOWN,
- NS_KEY_DELETE_LINE_END,
- NS_KEY_DELETE_LINE_START,
-
- NS_KEY_UNDO,
- NS_KEY_REDO
-};
-
-
/**
* Position the caret and assign a callback for key presses.
*
@@ -91,13 +49,5 @@ void browser_window_place_caret(struct browser_window *bw, int x, int y,
*/
void browser_window_remove_caret(struct browser_window *bw, bool only_hide);
-/**
- * Handle key presses in a browser window.
- *
- * \param bw The root browser window
- * \param key The UCS4 character codepoint
- * \return true if key handled, false otherwise
- */
-bool browser_window_key_press(struct browser_window *bw, uint32_t key);
#endif
diff --git a/desktop/treeview.c b/desktop/treeview.c
index 8f0afcbb2..f2af5e8a1 100644
--- a/desktop/treeview.c
+++ b/desktop/treeview.c
@@ -29,6 +29,7 @@
#include "netsurf/plotters.h"
#include "netsurf/clipboard.h"
#include "netsurf/layout.h"
+#include "netsurf/keypress.h"
#include "content/hlcache.h"
#include "css/utils.h"
@@ -37,7 +38,6 @@
#include "desktop/textarea.h"
#include "desktop/treeview.h"
#include "desktop/gui_internal.h"
-#include "desktop/textinput.h"
#include "desktop/core_window.h"
/** @todo get rid of REDRAW_MAX -- need to be able to know window size */