summaryrefslogtreecommitdiff
path: root/desktop
diff options
context:
space:
mode:
authorMichael Drake <tlsa@netsurf-browser.org>2013-02-06 22:39:45 +0000
committerMichael Drake <tlsa@netsurf-browser.org>2013-02-06 22:39:45 +0000
commit762e1aad733c4d56edbb85c7b21b0951d8f759f2 (patch)
tree71305c5b65e055c907be507b6242285842bea72f /desktop
parent008cdb42d718ed1e1e61c9c16e6aa22bc345d202 (diff)
downloadnetsurf-762e1aad733c4d56edbb85c7b21b0951d8f759f2.tar.gz
netsurf-762e1aad733c4d56edbb85c7b21b0951d8f759f2.tar.bz2
First pass at getting html forms to use textarea widget.
(Input element types text & password, and textarea element.) Can edit and submit forms, but there are loads of issues.
Diffstat (limited to 'desktop')
-rw-r--r--desktop/browser.h2
-rw-r--r--desktop/textinput.c25
2 files changed, 13 insertions, 14 deletions
diff --git a/desktop/browser.h b/desktop/browser.h
index f3c68fa09..1c7772d0d 100644
--- a/desktop/browser.h
+++ b/desktop/browser.h
@@ -57,6 +57,8 @@ typedef enum {
DRAGGING_SCR_X,
DRAGGING_SCR_Y,
DRAGGING_CONTENT_SCROLLBAR,
+ DRAGGING_CONTENT_TEXTAREA_SCROLLBAR,
+ DRAGGING_CONTENT_TEXTAREA_SELECTION,
DRAGGING_OTHER
} browser_drag_type;
diff --git a/desktop/textinput.c b/desktop/textinput.c
index b4fda5eef..660708932 100644
--- a/desktop/textinput.c
+++ b/desktop/textinput.c
@@ -127,7 +127,13 @@ bool browser_window_key_press(struct browser_window *bw, uint32_t key)
assert(bw->window != NULL);
- /* safe keys that can be handled whether input claimed or not */
+ if (focus->caret_callback) {
+ /* Pass keypress onto anything that has claimed input focus */
+ return focus->caret_callback(focus, key,
+ focus->caret_p1, focus->caret_p2);
+ }
+
+ /* TODO: pass these to content to deal with */
switch (key) {
case KEY_COPY_SELECTION:
selection_copy_to_clipboard(bw->cur_sel);
@@ -137,6 +143,10 @@ bool browser_window_key_press(struct browser_window *bw, uint32_t key)
selection_clear(bw->cur_sel, true);
return true;
+ case KEY_SELECT_ALL:
+ selection_select_all(bw->cur_sel);
+ return true;
+
case KEY_ESCAPE:
if (bw->cur_sel && selection_defined(bw->cur_sel)) {
selection_clear(bw->cur_sel, true);
@@ -147,19 +157,6 @@ bool browser_window_key_press(struct browser_window *bw, uint32_t key)
return false;
}
- if (focus->caret_callback) {
- /* Pass keypress onto anything that has claimed input focus */
- return focus->caret_callback(focus, key,
- focus->caret_p1, focus->caret_p2);
- }
-
- /* keys we can't handle here if cursor is in form */
- switch (key) {
- case KEY_SELECT_ALL:
- selection_select_all(bw->cur_sel);
- return true;
- }
-
return false;
}