summaryrefslogtreecommitdiff
path: root/frontends
diff options
context:
space:
mode:
authorChris Young <chris@unsatisfactorysoftware.co.uk>2017-01-01 14:34:04 +0000
committerChris Young <chris@unsatisfactorysoftware.co.uk>2017-01-01 14:34:04 +0000
commitc40e8197c270b1600fa7b32056a2019cd83e6f3f (patch)
treecd1cc5959cd778b6ad1b048d3f796ee65f1c1b8a /frontends
parent8196f5b60241a6389ca3b76446de131a3dd2e891 (diff)
downloadnetsurf-c40e8197c270b1600fa7b32056a2019cd83e6f3f.tar.gz
netsurf-c40e8197c270b1600fa7b32056a2019cd83e6f3f.tar.bz2
Allow for the prospect of in-window scrollbars
Diffstat (limited to 'frontends')
-rw-r--r--frontends/amiga/corewindow.c32
-rw-r--r--frontends/amiga/corewindow.h10
2 files changed, 29 insertions, 13 deletions
diff --git a/frontends/amiga/corewindow.c b/frontends/amiga/corewindow.c
index d8676fd50..5424b7b24 100644
--- a/frontends/amiga/corewindow.c
+++ b/frontends/amiga/corewindow.c
@@ -236,7 +236,7 @@ nserror ami_corewindow_init(struct ami_corewindow *ami_cw)
/* add the core window to our window list so we process events */
ami_gui_win_list_add(ami_cw, AMINS_COREWINDOW, &ami_cw_table);
- /* attach the scrollbars for event processing */
+ /* set up the IDCMP hook for event processing (extended mouse, scrollbars) */
ami_cw->idcmp_hook.h_Entry = (void *)ami_cw_idcmp_hook;
ami_cw->idcmp_hook.h_Data = ami_cw;
/* probably set this when defining the window
@@ -244,20 +244,26 @@ nserror ami_corewindow_init(struct ami_corewindow *ami_cw)
WINDOW_IDCMPHook, &ami_cw->idcmp_hook,
TAG_DONE); */
- GetAttr(WINDOW_HorizObject, ami_cw->objects[GID_CW_WIN],
- (ULONG *)&ami_cw->objects[GID_CW_HSCROLL]);
- GetAttr(WINDOW_VertObject, ami_cw->objects[GID_CW_WIN],
- (ULONG *)&ami_cw->objects[GID_CW_VSCROLL]);
+ /* attach the scrollbars for event processing if they are in the window border */
+ if(ami_cw->objects[GID_CW_HSCROLL] == NULL) {
+ GetAttr(WINDOW_HorizObject, ami_cw->objects[GID_CW_WIN],
+ (ULONG *)&ami_cw->objects[GID_CW_HSCROLL]);
- RefreshSetGadgetAttrs((APTR)ami_cw->objects[GID_CW_VSCROLL], ami_cw->win, NULL,
- GA_ID, GID_CW_VSCROLL,
- ICA_TARGET, ICTARGET_IDCMP,
- TAG_DONE);
+ RefreshSetGadgetAttrs((APTR)ami_cw->objects[GID_CW_HSCROLL], ami_cw->win, NULL,
+ GA_ID, GID_CW_HSCROLL,
+ ICA_TARGET, ICTARGET_IDCMP,
+ TAG_DONE);
+ }
- RefreshSetGadgetAttrs((APTR)ami_cw->objects[GID_CW_HSCROLL], ami_cw->win, NULL,
- GA_ID, GID_CW_HSCROLL,
- ICA_TARGET, ICTARGET_IDCMP,
- TAG_DONE);
+ if(ami_cw->objects[GID_CW_VSCROLL] == NULL) {
+ GetAttr(WINDOW_VertObject, ami_cw->objects[GID_CW_WIN],
+ (ULONG *)&ami_cw->objects[GID_CW_VSCROLL]);
+
+ RefreshSetGadgetAttrs((APTR)ami_cw->objects[GID_CW_VSCROLL], ami_cw->win, NULL,
+ GA_ID, GID_CW_VSCROLL,
+ ICA_TARGET, ICTARGET_IDCMP,
+ TAG_DONE);
+ }
return NSERROR_OK;
}
diff --git a/frontends/amiga/corewindow.h b/frontends/amiga/corewindow.h
index d6f842aff..0729f12a1 100644
--- a/frontends/amiga/corewindow.h
+++ b/frontends/amiga/corewindow.h
@@ -93,6 +93,16 @@ struct ami_corewindow {
nserror (*mouse)(struct ami_corewindow *ami_cw, browser_mouse_state mouse_state, int x, int y);
/**
+ * callback for unknown events on Amiga core window
+ * eg. buttons in the ssl cert window
+ * PROBABLY NEED MORE VARS!
+ * \param ami_cw The Amiga core window structure.
+ * \param id gadget id
+ * \return NSERROR_OK on sucess otherwise apropriate error code.
+ */
+ nserror (*event)(struct ami_corewindow *ami_cw, ULONG id);
+
+ /**
* callback to close an Amiga core window
*
* \param ami_cw The Amiga core window structure.