summaryrefslogtreecommitdiff
path: root/render/html_interaction.c
diff options
context:
space:
mode:
authorMichael Drake <tlsa@netsurf-browser.org>2011-06-14 20:00:18 +0000
committerMichael Drake <tlsa@netsurf-browser.org>2011-06-14 20:00:18 +0000
commit53f4da342088e0fe685034d0582cbf6fa13527ae (patch)
tree063970a74db5d904993cd2cc392f5e07f211b6a4 /render/html_interaction.c
parent6ed9b1de8bb2aa5220c60fbf0b42aea78f889da1 (diff)
downloadnetsurf-53f4da342088e0fe685034d0582cbf6fa13527ae.tar.gz
netsurf-53f4da342088e0fe685034d0582cbf6fa13527ae.tar.bz2
First pass at core iframes. Currently lacking scrollbars.
svn path=/trunk/netsurf/; revision=12474
Diffstat (limited to 'render/html_interaction.c')
-rw-r--r--render/html_interaction.c22
1 files changed, 19 insertions, 3 deletions
diff --git a/render/html_interaction.c b/render/html_interaction.c
index cd4caa488..91f8cb39c 100644
--- a/render/html_interaction.c
+++ b/render/html_interaction.c
@@ -135,6 +135,7 @@ void html_mouse_action(struct content *c, struct browser_window *bw,
hlcache_handle *gadget_content = h;
struct form_control *gadget = 0;
hlcache_handle *object = NULL;
+ struct browser_window *iframe = NULL;
struct box *next_box;
struct box *drag_candidate = NULL;
struct scrollbar *scrollbar = NULL;
@@ -214,6 +215,9 @@ void html_mouse_action(struct content *c, struct browser_window *bw,
if (box->object)
object = box->object;
+ if (box->iframe)
+ iframe = box->iframe;
+
if (box->href) {
url = box->href;
target = box->target;
@@ -464,6 +468,18 @@ void html_mouse_action(struct content *c, struct browser_window *bw,
/* \todo should have a drag-saving object msg */
status = content_get_status_message(h);
+ } else if (iframe) {
+ int pos_x, pos_y;
+ browser_window_get_position(iframe, false, &pos_x, &pos_y);
+
+ if (mouse & BROWSER_MOUSE_CLICK_1 ||
+ mouse & BROWSER_MOUSE_CLICK_2) {
+ browser_window_mouse_click(iframe, mouse,
+ x - pos_x, y - pos_y);
+ } else {
+ browser_window_mouse_track(iframe, mouse,
+ x - pos_x, y - pos_y);
+ }
} else if (url) {
if (title) {
snprintf(status_buffer, sizeof status_buffer, "%s: %s",
@@ -601,7 +617,8 @@ void html_mouse_action(struct content *c, struct browser_window *bw,
if (status != NULL)
browser_window_set_status(bw, status);
- browser_window_set_pointer(bw->window, pointer);
+ if (!iframe)
+ browser_window_set_pointer(bw, pointer);
/* deferred actions that can cause this browser_window to be destroyed
* and must therefore be done after set_status/pointer
@@ -778,8 +795,7 @@ void html_overflow_scroll_callback(void *client_data,
case SCROLLBAR_MSG_SCROLL_FINISHED:
bw->scrollbar = NULL;
- browser_window_set_pointer(bw->window,
- GUI_POINTER_DEFAULT);
+ browser_window_set_pointer(bw, GUI_POINTER_DEFAULT);
break;
}
}