summaryrefslogtreecommitdiff
path: root/amiga/gui.c
diff options
context:
space:
mode:
Diffstat (limited to 'amiga/gui.c')
-rwxr-xr-xamiga/gui.c52
1 files changed, 11 insertions, 41 deletions
diff --git a/amiga/gui.c b/amiga/gui.c
index 82a3a428d..248b59dd0 100755
--- a/amiga/gui.c
+++ b/amiga/gui.c
@@ -1293,7 +1293,6 @@ void ami_handle_msg(void)
case 'x':
browser_window_key_press(gwin->bw, KEY_CUT_SELECTION);
- browser_window_key_press(gwin->bw, KEY_CLEAR_SELECTION);
break;
case 'c':
@@ -1910,7 +1909,7 @@ void ami_switch_tab(struct gui_window_2 *gwin,bool redraw)
}
ami_update_buttons(gwin);
- ami_menu_update_disabled(gwin->win, gwin->bw->current_content);
+ ami_menu_update_disabled(gwin->bw->window, gwin->bw->current_content);
if(redraw)
{
@@ -3662,7 +3661,7 @@ void gui_window_new_content(struct gui_window *g)
if(g->shared->bw->browser_window_type != BROWSER_WINDOW_NORMAL ||
option_kiosk_mode == true) return;
- ami_menu_update_disabled(g->shared->win, c);
+ ami_menu_update_disabled(g, c);
}
bool gui_window_scroll_start(struct gui_window *g)
@@ -3782,34 +3781,13 @@ uint32 ami_popup_hook(struct Hook *hook,Object *item,APTR reserved)
return itemid;
}
-/* Below two are more suited to clipboard.c but use some functions internal to gui.c,
- so we put them here. */
-
-bool ami_drag_selection_paste(const char *text, size_t length, struct box *box,
- void *handle, const char *whitespace_text,size_t whitespace_length)
-{
- struct browser_window *bw = handle;
-
-printf("dspaste\n");
-
- if(whitespace_text)
- {
- browser_window_paste_text(bw, whitespace_text, whitespace_length, true);
- }
-
- if(text)
- {
- browser_window_paste_text(bw, text, length, true);
- }
-
- return true;
-}
+/* return the text box at posn x,y in window coordinates
+ x,y are updated to be document co-ordinates */
-void ami_drag_selection(struct selection *s)
+struct box *ami_text_box_at_point(struct gui_window *g, ULONG *x, ULONG *y)
{
- struct gui_window *g = s->bw->window;
struct IBox *bbox;
- ULONG x,y,xs,ys,width,height;
+ ULONG xs,ys,width,height;
struct box *box,*text_box=0;
hlcache_handle *content;
int box_x=0,box_y=0;
@@ -3818,17 +3796,17 @@ void ami_drag_selection(struct selection *s)
(ULONG *)&bbox);
ami_get_hscroll_pos(g->shared, (ULONG *)&xs);
- x = (s->bw->window->shared->win->MouseX) - (bbox->Left) +xs;
+ *x = *x - (bbox->Left) +xs;
ami_get_vscroll_pos(g->shared, (ULONG *)&ys);
- y = (s->bw->window->shared->win->MouseY) - bbox->Top + ys;
+ *y = *y - (bbox->Top) + ys;
width=bbox->Width;
height=bbox->Height;
- content = s->bw->current_content;
+ content = g->shared->bw->current_content;
box = html_get_box_tree(content);
- while ((box = box_at_point(box, x, y, &box_x, &box_y, &content)))
+ while ((box = box_at_point(box, *x, *y, &box_x, &box_y, &content)))
{
if (box->style && css_computed_visibility(box->style) == CSS_VISIBILITY_HIDDEN) continue;
@@ -3847,13 +3825,5 @@ void ami_drag_selection(struct selection *s)
}
}
}
-
- if(text_box)
- {
- if(gui_copy_to_clipboard(s))
- {
- browser_window_mouse_click(s->bw, BROWSER_MOUSE_PRESS_1, x, y);
- browser_window_key_press(s->bw, KEY_PASTE);
- }
- }
+ return text_box;
}