netsurf: branch master updated. release/3.6-143-geb63c1c
by NetSurf Browser Project
Gitweb links:
...log http://git.netsurf-browser.org/netsurf.git/shortlog/eb63c1cc50847b88e598c...
...commit http://git.netsurf-browser.org/netsurf.git/commit/eb63c1cc50847b88e598cdf...
...tree http://git.netsurf-browser.org/netsurf.git/tree/eb63c1cc50847b88e598cdf0f...
The branch, master has been updated
via eb63c1cc50847b88e598cdf0f775814a43a2799e (commit)
from a5222b579b8202f130e0afceb570b6e700385efe (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
commitdiff http://git.netsurf-browser.org/netsurf.git/commit/?id=eb63c1cc50847b88e59...
commit eb63c1cc50847b88e598cdf0f775814a43a2799e
Author: Vincent Sanders <vince(a)kyllikki.org>
Commit: Vincent Sanders <vince(a)kyllikki.org>
update default framebuffer font path
diff --git a/frontends/framebuffer/Makefile.defaults b/frontends/framebuffer/Makefile.defaults
index 92d837e..cc712e9 100644
--- a/frontends/framebuffer/Makefile.defaults
+++ b/frontends/framebuffer/Makefile.defaults
@@ -47,5 +47,5 @@ NETSURF_FRAMEBUFFER_RESOURCES := $(PREFIX)/share/netsurf/
NETSURF_FB_RESPATH := $${HOME}/.netsurf/:$${NETSURFRES}:$(NETSURF_FRAMEBUFFER_RESOURCES):./frontends/framebuffer/res
# freetype compiled in font serch path
-NETSURF_FB_FONTPATH := /usr/share/fonts/truetype/ttf-dejavu:/usr/share/fonts/truetype/msttcorefonts
+NETSURF_FB_FONTPATH := /usr/share/fonts/truetype/dejavu:/usr/share/fonts/truetype/msttcorefonts
-----------------------------------------------------------------------
Summary of changes:
frontends/framebuffer/Makefile.defaults | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/frontends/framebuffer/Makefile.defaults b/frontends/framebuffer/Makefile.defaults
index 92d837e..cc712e9 100644
--- a/frontends/framebuffer/Makefile.defaults
+++ b/frontends/framebuffer/Makefile.defaults
@@ -47,5 +47,5 @@ NETSURF_FRAMEBUFFER_RESOURCES := $(PREFIX)/share/netsurf/
NETSURF_FB_RESPATH := $${HOME}/.netsurf/:$${NETSURFRES}:$(NETSURF_FRAMEBUFFER_RESOURCES):./frontends/framebuffer/res
# freetype compiled in font serch path
-NETSURF_FB_FONTPATH := /usr/share/fonts/truetype/ttf-dejavu:/usr/share/fonts/truetype/msttcorefonts
+NETSURF_FB_FONTPATH := /usr/share/fonts/truetype/dejavu:/usr/share/fonts/truetype/msttcorefonts
--
NetSurf Browser
6 years, 8 months
netsurf: branch chris/amiga-corewindow updated. release/3.6-151-g0fafa95
by NetSurf Browser Project
Gitweb links:
...log http://git.netsurf-browser.org/netsurf.git/shortlog/0fafa9576e8963928c13c...
...commit http://git.netsurf-browser.org/netsurf.git/commit/0fafa9576e8963928c13c81...
...tree http://git.netsurf-browser.org/netsurf.git/tree/0fafa9576e8963928c13c8152...
The branch, chris/amiga-corewindow has been updated
via 0fafa9576e8963928c13c81524e64b624b794c98 (commit)
via 4892497a19083cf328711f28376d16133a684353 (commit)
via 4b7abde7b0449a3a3fe03b43533b8d0697f55e0d (commit)
from 98f94c4bf39db60b0b686bccc84175e15214b348 (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
commitdiff http://git.netsurf-browser.org/netsurf.git/commit/?id=0fafa9576e8963928c1...
commit 0fafa9576e8963928c13c81524e64b624b794c98
Author: Chris Young <chris(a)unsatisfactorysoftware.co.uk>
Commit: Chris Young <chris(a)unsatisfactorysoftware.co.uk>
make the window title text common
diff --git a/frontends/amiga/corewindow.c b/frontends/amiga/corewindow.c
index db42775..024e768 100644
--- a/frontends/amiga/corewindow.c
+++ b/frontends/amiga/corewindow.c
@@ -60,6 +60,7 @@
#include "amiga/misc.h"
#include "amiga/object.h"
#include "amiga/schedule.h"
+#include "amiga/utf8.h"
/**
* Convert co-ordinates relative to space.gadget
@@ -665,6 +666,9 @@ nserror ami_corewindow_fini(struct ami_corewindow *ami_cw)
ami_plot_release_pens(ami_cw->gg.shared_pens);
ami_free_layers(&ami_cw->gg);
+ /* free the window title */
+ ami_utf8_free(ami_cw->wintitle);
+
/* remove the core window from our window list */
ami_gui_win_list_remove(ami_cw);
diff --git a/frontends/amiga/corewindow.h b/frontends/amiga/corewindow.h
index 2c5dbb5..42c0f03 100644
--- a/frontends/amiga/corewindow.h
+++ b/frontends/amiga/corewindow.h
@@ -57,6 +57,9 @@ struct ami_corewindow {
APTR deferred_rects_pool;
struct MinList *deferred_rects;
+ /** window title, must be allocated wth ami_utf8 function */
+ char *wintitle;
+
/** stuff for our off-screen render bitmap */
struct gui_globals gg;
struct MinList *shared_pens;
diff --git a/frontends/amiga/sslcert.c b/frontends/amiga/sslcert.c
index c1b9ae2..b3d57ef 100644
--- a/frontends/amiga/sslcert.c
+++ b/frontends/amiga/sslcert.c
@@ -64,7 +64,6 @@ struct ami_crtvrfy_window {
/** Amiga GUI stuff */
Object *sslcert_objects[GID_SSLCERT_LAST]; // technically wasting a few bytes here
- char *wintitle;
char *sslerr;
char *sslaccept;
char *sslreject;
@@ -83,7 +82,6 @@ ami_crtvrfy_destroy(struct ami_crtvrfy_window *crtvrfy_win)
res = sslcert_viewer_fini(crtvrfy_win->ssl_data);
if (res == NSERROR_OK) {
- ami_utf8_free(crtvrfy_win->wintitle);
ami_utf8_free(crtvrfy_win->sslerr);
ami_utf8_free(crtvrfy_win->sslaccept);
ami_utf8_free(crtvrfy_win->sslreject);
@@ -217,7 +215,7 @@ ami_crtvrfy_create_window(struct ami_crtvrfy_window *crtvrfy_win)
ami_cw->objects[GID_CW_WIN] = WindowObj,
WA_ScreenTitle, ami_gui_get_screen_title(),
- WA_Title, crtvrfy_win->wintitle,
+ WA_Title, ami_cw->wintitle,
WA_Activate, TRUE,
WA_DepthGadget, TRUE,
WA_DragBar, TRUE,
@@ -287,7 +285,7 @@ nserror ami_cert_verify(struct nsurl *url,
return NSERROR_NOMEM;
}
- ncwin->wintitle = ami_utf8_easy((char *)messages_get("SSLCerts"));
+ ncwin->core.wintitle = ami_utf8_easy((char *)messages_get("SSLCerts"));
ncwin->sslerr = ami_utf8_easy((char *)messages_get("SSLError"));
ncwin->sslaccept = ami_utf8_easy((char *)messages_get("SSL_Certificate_Accept"));
ncwin->sslreject = ami_utf8_easy((char *)messages_get("SSL_Certificate_Reject"));
@@ -295,7 +293,7 @@ nserror ami_cert_verify(struct nsurl *url,
res = ami_crtvrfy_create_window(ncwin);
if (res != NSERROR_OK) {
LOG("SSL UI builder init failed");
- ami_utf8_free(ncwin->wintitle);
+ ami_utf8_free(ncwin->core.wintitle);
ami_utf8_free(ncwin->sslerr);
ami_utf8_free(ncwin->sslaccept);
ami_utf8_free(ncwin->sslreject);
@@ -312,7 +310,7 @@ nserror ami_cert_verify(struct nsurl *url,
res = ami_corewindow_init(&ncwin->core);
if (res != NSERROR_OK) {
- ami_utf8_free(ncwin->wintitle);
+ ami_utf8_free(ncwin->core.wintitle);
ami_utf8_free(ncwin->sslerr);
ami_utf8_free(ncwin->sslaccept);
ami_utf8_free(ncwin->sslreject);
@@ -325,7 +323,7 @@ nserror ami_cert_verify(struct nsurl *url,
res = sslcert_viewer_create_session_data(num, url, cb, cbpw, certs,
&ncwin->ssl_data);
if (res != NSERROR_OK) {
- ami_utf8_free(ncwin->wintitle);
+ ami_utf8_free(ncwin->core.wintitle);
ami_utf8_free(ncwin->sslerr);
ami_utf8_free(ncwin->sslaccept);
ami_utf8_free(ncwin->sslreject);
@@ -338,7 +336,7 @@ nserror ami_cert_verify(struct nsurl *url,
(struct core_window *)ncwin,
ncwin->ssl_data);
if (res != NSERROR_OK) {
- ami_utf8_free(ncwin->wintitle);
+ ami_utf8_free(ncwin->core.wintitle);
ami_utf8_free(ncwin->sslerr);
ami_utf8_free(ncwin->sslaccept);
ami_utf8_free(ncwin->sslreject);
commitdiff http://git.netsurf-browser.org/netsurf.git/commit/?id=4892497a19083cf3287...
commit 4892497a19083cf328711f28376d16133a684353
Author: Chris Young <chris(a)unsatisfactorysoftware.co.uk>
Commit: Chris Young <chris(a)unsatisfactorysoftware.co.uk>
correct full-window redraw co-ords
diff --git a/frontends/amiga/corewindow.c b/frontends/amiga/corewindow.c
index 509499f..db42775 100644
--- a/frontends/amiga/corewindow.c
+++ b/frontends/amiga/corewindow.c
@@ -295,8 +295,8 @@ ami_cw_redraw(struct ami_corewindow *ami_cw, const struct rect *restrict r)
return;
}
- new_rect.x0 = bbox->Left;
- new_rect.y0 = bbox->Top;
+ new_rect.x0 = 0;
+ new_rect.y0 = 0;
ami_cw_coord_amiga_to_ns(ami_cw, &new_rect.x0, &new_rect.y0);
new_rect.x1 = new_rect.x0 + bbox->Width;
new_rect.y1 = new_rect.y0 + bbox->Height;
commitdiff http://git.netsurf-browser.org/netsurf.git/commit/?id=4b7abde7b0449a3a3fe...
commit 4b7abde7b0449a3a3fe03b43533b8d0697f55e0d
Author: Chris Young <chris(a)unsatisfactorysoftware.co.uk>
Commit: Chris Young <chris(a)unsatisfactorysoftware.co.uk>
ssl cert window should not have a close gadget
diff --git a/frontends/amiga/sslcert.c b/frontends/amiga/sslcert.c
index 5d74464..c1b9ae2 100644
--- a/frontends/amiga/sslcert.c
+++ b/frontends/amiga/sslcert.c
@@ -221,7 +221,7 @@ ami_crtvrfy_create_window(struct ami_crtvrfy_window *crtvrfy_win)
WA_Activate, TRUE,
WA_DepthGadget, TRUE,
WA_DragBar, TRUE,
- WA_CloseGadget, TRUE,
+ WA_CloseGadget, FALSE,
WA_SizeGadget, TRUE,
WA_SizeBRight, TRUE,
WA_Height, scrn->Height / 2,
-----------------------------------------------------------------------
Summary of changes:
frontends/amiga/corewindow.c | 8 ++++++--
frontends/amiga/corewindow.h | 3 +++
frontends/amiga/sslcert.c | 16 +++++++---------
3 files changed, 16 insertions(+), 11 deletions(-)
diff --git a/frontends/amiga/corewindow.c b/frontends/amiga/corewindow.c
index 509499f..024e768 100644
--- a/frontends/amiga/corewindow.c
+++ b/frontends/amiga/corewindow.c
@@ -60,6 +60,7 @@
#include "amiga/misc.h"
#include "amiga/object.h"
#include "amiga/schedule.h"
+#include "amiga/utf8.h"
/**
* Convert co-ordinates relative to space.gadget
@@ -295,8 +296,8 @@ ami_cw_redraw(struct ami_corewindow *ami_cw, const struct rect *restrict r)
return;
}
- new_rect.x0 = bbox->Left;
- new_rect.y0 = bbox->Top;
+ new_rect.x0 = 0;
+ new_rect.y0 = 0;
ami_cw_coord_amiga_to_ns(ami_cw, &new_rect.x0, &new_rect.y0);
new_rect.x1 = new_rect.x0 + bbox->Width;
new_rect.y1 = new_rect.y0 + bbox->Height;
@@ -665,6 +666,9 @@ nserror ami_corewindow_fini(struct ami_corewindow *ami_cw)
ami_plot_release_pens(ami_cw->gg.shared_pens);
ami_free_layers(&ami_cw->gg);
+ /* free the window title */
+ ami_utf8_free(ami_cw->wintitle);
+
/* remove the core window from our window list */
ami_gui_win_list_remove(ami_cw);
diff --git a/frontends/amiga/corewindow.h b/frontends/amiga/corewindow.h
index 2c5dbb5..42c0f03 100644
--- a/frontends/amiga/corewindow.h
+++ b/frontends/amiga/corewindow.h
@@ -57,6 +57,9 @@ struct ami_corewindow {
APTR deferred_rects_pool;
struct MinList *deferred_rects;
+ /** window title, must be allocated wth ami_utf8 function */
+ char *wintitle;
+
/** stuff for our off-screen render bitmap */
struct gui_globals gg;
struct MinList *shared_pens;
diff --git a/frontends/amiga/sslcert.c b/frontends/amiga/sslcert.c
index 5d74464..b3d57ef 100644
--- a/frontends/amiga/sslcert.c
+++ b/frontends/amiga/sslcert.c
@@ -64,7 +64,6 @@ struct ami_crtvrfy_window {
/** Amiga GUI stuff */
Object *sslcert_objects[GID_SSLCERT_LAST]; // technically wasting a few bytes here
- char *wintitle;
char *sslerr;
char *sslaccept;
char *sslreject;
@@ -83,7 +82,6 @@ ami_crtvrfy_destroy(struct ami_crtvrfy_window *crtvrfy_win)
res = sslcert_viewer_fini(crtvrfy_win->ssl_data);
if (res == NSERROR_OK) {
- ami_utf8_free(crtvrfy_win->wintitle);
ami_utf8_free(crtvrfy_win->sslerr);
ami_utf8_free(crtvrfy_win->sslaccept);
ami_utf8_free(crtvrfy_win->sslreject);
@@ -217,11 +215,11 @@ ami_crtvrfy_create_window(struct ami_crtvrfy_window *crtvrfy_win)
ami_cw->objects[GID_CW_WIN] = WindowObj,
WA_ScreenTitle, ami_gui_get_screen_title(),
- WA_Title, crtvrfy_win->wintitle,
+ WA_Title, ami_cw->wintitle,
WA_Activate, TRUE,
WA_DepthGadget, TRUE,
WA_DragBar, TRUE,
- WA_CloseGadget, TRUE,
+ WA_CloseGadget, FALSE,
WA_SizeGadget, TRUE,
WA_SizeBRight, TRUE,
WA_Height, scrn->Height / 2,
@@ -287,7 +285,7 @@ nserror ami_cert_verify(struct nsurl *url,
return NSERROR_NOMEM;
}
- ncwin->wintitle = ami_utf8_easy((char *)messages_get("SSLCerts"));
+ ncwin->core.wintitle = ami_utf8_easy((char *)messages_get("SSLCerts"));
ncwin->sslerr = ami_utf8_easy((char *)messages_get("SSLError"));
ncwin->sslaccept = ami_utf8_easy((char *)messages_get("SSL_Certificate_Accept"));
ncwin->sslreject = ami_utf8_easy((char *)messages_get("SSL_Certificate_Reject"));
@@ -295,7 +293,7 @@ nserror ami_cert_verify(struct nsurl *url,
res = ami_crtvrfy_create_window(ncwin);
if (res != NSERROR_OK) {
LOG("SSL UI builder init failed");
- ami_utf8_free(ncwin->wintitle);
+ ami_utf8_free(ncwin->core.wintitle);
ami_utf8_free(ncwin->sslerr);
ami_utf8_free(ncwin->sslaccept);
ami_utf8_free(ncwin->sslreject);
@@ -312,7 +310,7 @@ nserror ami_cert_verify(struct nsurl *url,
res = ami_corewindow_init(&ncwin->core);
if (res != NSERROR_OK) {
- ami_utf8_free(ncwin->wintitle);
+ ami_utf8_free(ncwin->core.wintitle);
ami_utf8_free(ncwin->sslerr);
ami_utf8_free(ncwin->sslaccept);
ami_utf8_free(ncwin->sslreject);
@@ -325,7 +323,7 @@ nserror ami_cert_verify(struct nsurl *url,
res = sslcert_viewer_create_session_data(num, url, cb, cbpw, certs,
&ncwin->ssl_data);
if (res != NSERROR_OK) {
- ami_utf8_free(ncwin->wintitle);
+ ami_utf8_free(ncwin->core.wintitle);
ami_utf8_free(ncwin->sslerr);
ami_utf8_free(ncwin->sslaccept);
ami_utf8_free(ncwin->sslreject);
@@ -338,7 +336,7 @@ nserror ami_cert_verify(struct nsurl *url,
(struct core_window *)ncwin,
ncwin->ssl_data);
if (res != NSERROR_OK) {
- ami_utf8_free(ncwin->wintitle);
+ ami_utf8_free(ncwin->core.wintitle);
ami_utf8_free(ncwin->sslerr);
ami_utf8_free(ncwin->sslaccept);
ami_utf8_free(ncwin->sslreject);
--
NetSurf Browser
6 years, 8 months
netsurf: branch chris/amiga-corewindow updated. release/3.6-148-g98f94c4
by NetSurf Browser Project
Gitweb links:
...log http://git.netsurf-browser.org/netsurf.git/shortlog/98f94c4bf39db60b0b686...
...commit http://git.netsurf-browser.org/netsurf.git/commit/98f94c4bf39db60b0b686bc...
...tree http://git.netsurf-browser.org/netsurf.git/tree/98f94c4bf39db60b0b686bccc...
The branch, chris/amiga-corewindow has been updated
via 98f94c4bf39db60b0b686bccc84175e15214b348 (commit)
via e7c9b863b3d2dd8579cb2c9f80f4a20933d04315 (commit)
from a9cc0792a43d108e5ff61055354422a6c7218a74 (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
commitdiff http://git.netsurf-browser.org/netsurf.git/commit/?id=98f94c4bf39db60b0b6...
commit 98f94c4bf39db60b0b686bccc84175e15214b348
Author: Chris Young <chris(a)unsatisfactorysoftware.co.uk>
Commit: Chris Young <chris(a)unsatisfactorysoftware.co.uk>
move mousemove back to the event loop and ensure the window is created cleared
diff --git a/frontends/amiga/corewindow.c b/frontends/amiga/corewindow.c
index 49629d6..509499f 100644
--- a/frontends/amiga/corewindow.c
+++ b/frontends/amiga/corewindow.c
@@ -83,22 +83,40 @@ ami_cw_coord_amiga_to_ns(struct ami_corewindow *ami_cw, int *restrict x, int *re
/* get current mouse position in the draw area, adjusted for scroll.
- * only works during OM_NOTIFY! at other times use last stored posn
+ * @return true if the mouse was in the draw area and co-ordinates updated
*/
-static void
+static bool
ami_cw_mouse_pos(struct ami_corewindow *ami_cw, int *restrict x, int *restrict y)
{
- ULONG xm, ym;
+ int16 xm, ym;
+ ULONG xs, ys;
+ struct IBox *bbox;
- GetAttr(SPACE_MouseX, ami_cw->objects[GID_CW_DRAW], (ULONG *)&xm);
- GetAttr(SPACE_MouseY, ami_cw->objects[GID_CW_DRAW], (ULONG *)&ym);
+ xm = ami_cw->win->MouseX;
+ ym = ami_cw->win->MouseY;
- ami_cw_coord_amiga_to_ns(ami_cw, (int *)&xm, (int *)&ym);
+ if(ami_gui_get_space_box((Object *)ami_cw->objects[GID_CW_DRAW], &bbox) != NSERROR_OK) {
+ amiga_warn_user("NoMemory", "");
+ return false;
+ }
+
+ xm -= bbox->Left;
+ ym -= bbox->Top;
+
+ ami_gui_free_space_box(bbox);
- ami_cw->mouse_x = xm;
- ami_cw->mouse_y = ym;
- *x = ami_cw->mouse_x;
- *y = ami_cw->mouse_y;
+ if((xm < 0) || (ym < 0) || (xm > bbox->Width) || (ym > bbox->Height))
+ return false;
+
+ GetAttr(SCROLLER_Top, ami_cw->objects[GID_CW_HSCROLL], (ULONG *)&xs);
+ GetAttr(SCROLLER_Top, ami_cw->objects[GID_CW_VSCROLL], (ULONG *)&ys);
+
+ xm += xs;
+ ym += ys;
+ *x = xm;
+ *y = ym;
+
+ return true;
}
/* handle keypress */
@@ -136,7 +154,6 @@ static void
ami_cw_redraw_rect(struct ami_corewindow *ami_cw, struct rect *r)
{
struct IBox *bbox;
- struct RastPort *temprp;
ULONG pos_x, pos_y;
struct rect draw_rect;
int tile_size_x = ami_cw->gg.width;
@@ -315,20 +332,12 @@ HOOKF(void, ami_cw_idcmp_hook, Object *, object, struct IntuiMessage *)
struct ami_corewindow *ami_cw = hook->h_Data;
struct IntuiWheelData *wheel;
ULONG gid = GetTagData( GA_ID, 0, msg->IAddress );
- int x, y;
- int key_state = 0;
switch(msg->Class)
{
case IDCMP_IDCMPUPDATE:
switch(gid)
{
- case GID_CW_DRAW:
- ami_cw_mouse_pos(ami_cw, &x, &y);
- key_state = ami_gui_get_quals(ami_cw->objects[GID_CW_WIN]);
- ami_cw->mouse(ami_cw, ami_cw->mouse_state | key_state, x, y);
- break;
-
case GID_CW_HSCROLL:
case GID_CW_VSCROLL:
ami_cw_redraw(ami_cw, NULL);
@@ -366,14 +375,21 @@ ami_cw_event(void *w)
int nskey;
int key_state = 0;
struct timeval curtime;
+ int x, y;
while((result = RA_HandleInput(ami_cw->objects[GID_CW_WIN], &code)) != WMHI_LASTMSG) {
switch(result & WMHI_CLASSMASK) {
case WMHI_MOUSEMOVE:
- /* in theory the mouse moves we care about are processed in our hook function... */
+ if(ami_cw_mouse_pos(ami_cw, &x, &y)) {
+ key_state = ami_gui_get_quals(ami_cw->objects[GID_CW_WIN]);
+ ami_cw->mouse(ami_cw, ami_cw->mouse_state | key_state, x, y);
+ }
break;
case WMHI_MOUSEBUTTONS:
+ if(ami_cw_mouse_pos(ami_cw, &x, &y) == false)
+ break;
+
key_state = ami_gui_get_quals(ami_cw->objects[GID_CW_WIN]);
case SELECTDOWN:
@@ -406,7 +422,7 @@ ami_cw_event(void *w)
}
}
- ami_cw->mouse(ami_cw, ami_cw->mouse_state | key_state, ami_cw->mouse_x, ami_cw->mouse_y);
+ ami_cw->mouse(ami_cw, ami_cw->mouse_state | key_state, x, y);
ami_cw->mouse_state = BROWSER_MOUSE_HOVER;
break;
@@ -414,11 +430,11 @@ ami_cw_event(void *w)
if(ami_cw->mouse_state & BROWSER_MOUSE_PRESS_2)
ami_cw->mouse_state = BROWSER_MOUSE_CLICK_2;
- ami_cw->mouse(ami_cw, ami_cw->mouse_state | key_state, ami_cw->mouse_x, ami_cw->mouse_y);
+ ami_cw->mouse(ami_cw, ami_cw->mouse_state | key_state, x, y);
ami_cw->mouse_state = BROWSER_MOUSE_HOVER;
break;
- ami_cw->mouse(ami_cw, ami_cw->mouse_state | key_state, ami_cw->mouse_x, ami_cw->mouse_y);
+ ami_cw->mouse(ami_cw, ami_cw->mouse_state | key_state, x, y);
break;
case WMHI_RAWKEY:
@@ -641,9 +657,6 @@ nserror ami_corewindow_fini(struct ami_corewindow *ami_cw)
FreeObjList(ami_cw->deferred_rects);
ami_memory_itempool_delete(ami_cw->deferred_rects_pool);
- /* remove the core window from our window list */
- ami_gui_win_list_remove(ami_cw);
-
/* destroy the window */
ami_cw->win = NULL;
DisposeObject(ami_cw->objects[GID_CW_WIN]);
@@ -652,6 +665,9 @@ nserror ami_corewindow_fini(struct ami_corewindow *ami_cw)
ami_plot_release_pens(ami_cw->gg.shared_pens);
ami_free_layers(&ami_cw->gg);
+ /* remove the core window from our window list */
+ ami_gui_win_list_remove(ami_cw);
+
return NSERROR_OK;
}
diff --git a/frontends/amiga/corewindow.h b/frontends/amiga/corewindow.h
index f62987f..2c5dbb5 100644
--- a/frontends/amiga/corewindow.h
+++ b/frontends/amiga/corewindow.h
@@ -52,8 +52,6 @@ struct ami_corewindow {
struct Hook idcmp_hook;
struct timeval lastclick;
- int mouse_x;
- int mouse_y;
int mouse_state;
APTR deferred_rects_pool;
diff --git a/frontends/amiga/sslcert.c b/frontends/amiga/sslcert.c
index df0005e..5d74464 100644
--- a/frontends/amiga/sslcert.c
+++ b/frontends/amiga/sslcert.c
@@ -25,7 +25,6 @@
#include <stdlib.h>
#include <proto/intuition.h>
-#include <intuition/icclass.h>
#include <classes/window.h>
#include <gadgets/button.h>
@@ -84,12 +83,11 @@ ami_crtvrfy_destroy(struct ami_crtvrfy_window *crtvrfy_win)
res = sslcert_viewer_fini(crtvrfy_win->ssl_data);
if (res == NSERROR_OK) {
- res = ami_corewindow_fini(&crtvrfy_win->core); /* closes the window for us */
ami_utf8_free(crtvrfy_win->wintitle);
ami_utf8_free(crtvrfy_win->sslerr);
ami_utf8_free(crtvrfy_win->sslaccept);
ami_utf8_free(crtvrfy_win->sslreject);
- free(crtvrfy_win);
+ res = ami_corewindow_fini(&crtvrfy_win->core); /* closes the window for us */
}
return res;
}
@@ -250,7 +248,6 @@ ami_crtvrfy_create_window(struct ami_crtvrfy_window *crtvrfy_win)
SPACE_Transparent, TRUE,
SPACE_BevelStyle, BVS_DISPLAY,
GA_RelVerify, TRUE,
- ICA_TARGET, ICTARGET_IDCMP,
SpaceEnd,
LAYOUT_AddChild, LayoutHObj,
LAYOUT_AddChild, crtvrfy_win->sslcert_objects[GID_SSLCERT_ACCEPT] = ButtonObj,
@@ -285,7 +282,7 @@ nserror ami_cert_verify(struct nsurl *url,
struct ami_crtvrfy_window *ncwin;
nserror res;
- ncwin = malloc(sizeof(struct ami_crtvrfy_window));
+ ncwin = calloc(1, sizeof(struct ami_crtvrfy_window));
if (ncwin == NULL) {
return NSERROR_NOMEM;
}
commitdiff http://git.netsurf-browser.org/netsurf.git/commit/?id=e7c9b863b3d2dd8579c...
commit e7c9b863b3d2dd8579cb2c9f80f4a20933d04315
Author: Chris Young <chris(a)unsatisfactorysoftware.co.uk>
Commit: Chris Young <chris(a)unsatisfactorysoftware.co.uk>
Take the redraw routine from old tree_redraw with less meddling
diff --git a/frontends/amiga/corewindow.c b/frontends/amiga/corewindow.c
index 5aff074..49629d6 100644
--- a/frontends/amiga/corewindow.c
+++ b/frontends/amiga/corewindow.c
@@ -142,6 +142,10 @@ ami_cw_redraw_rect(struct ami_corewindow *ami_cw, struct rect *r)
int tile_size_x = ami_cw->gg.width;
int tile_size_y = ami_cw->gg.height;
int tile_x, tile_y, tile_w, tile_h;
+ int x = r->x0;
+ int y = r->y0;
+ int width = r->x1 - r->x0;
+ int height = r->y1 - r->y0;
struct redraw_context ctx = {
.interactive = true,
@@ -154,46 +158,41 @@ ami_cw_redraw_rect(struct ami_corewindow *ami_cw, struct rect *r)
return;
}
- int x0 = bbox->Left;
- int y0 = bbox->Top;
- ami_cw_coord_amiga_to_ns(ami_cw, &x0, &y0);
- int x1 = x0 + bbox->Width;
- int y1 = y0 + bbox->Height;
-
- if((r->y1 < y0) || (r->x1 < x0) || (r->x0 > x1) || (r->y0 > y1)) {
- /* rect not visible */
- ami_gui_free_space_box(bbox);
- return;
- }
-
- if(r->y0 < y0) r->y0 = y0;
- if(r->x0 < x0) r->x0 = x0;
- if(r->y1 > y1) r->y1 = y1;
- if(r->x1 > x1) r->x1 = x1;
-
GetAttr(SCROLLER_Top, ami_cw->objects[GID_CW_HSCROLL], (ULONG *)&pos_x);
GetAttr(SCROLLER_Top, ami_cw->objects[GID_CW_VSCROLL], (ULONG *)&pos_y);
glob = &ami_cw->gg;
- temprp = glob->rp; //??
- glob->rp = ami_cw->win->RPort;
- for(tile_y = r->y0; tile_y < r->y1; tile_y += tile_size_y) {
+ if(x - pos_x + width > bbox->Width) width = bbox->Width - (x - pos_x);
+ if(y - pos_y + height > bbox->Height) height = bbox->Height - (y - pos_y);
+
+ if(x < pos_x) {
+ width -= pos_x - x;
+ x = pos_x;
+ }
+
+ if(y < pos_y) {
+ height -= pos_y - y;
+ y = pos_y;
+ }
+
+ for(tile_y = y; tile_y < (y + height); tile_y += tile_size_y) {
tile_h = tile_size_y;
- if((r->y1 - tile_y) < tile_size_y)
- tile_h = r->y1 - tile_y;
+ if(((y + height) - tile_y) < tile_size_y)
+ tile_h = (y + height) - tile_y;
- for(tile_x = r->x0; tile_x < r->x1; tile_x += tile_size_x) {
+ for(tile_x = x; tile_x < (x + width); tile_x += tile_size_x) {
tile_w = tile_size_x;
- if((r->x1 - tile_x) < tile_size_x)
- tile_w = r->x1 - tile_x;
+ if(((x + width) - tile_x) < tile_size_x)
+ tile_w = (x + width) - tile_x;
- draw_rect.x0 = tile_x;
- draw_rect.y0 = tile_y;
+ draw_rect.x0 = - tile_x;
+ draw_rect.y0 = - tile_y;
draw_rect.x1 = tile_x + tile_w;
draw_rect.y1 = tile_y + tile_h;
ami_cw->draw(ami_cw, &draw_rect, &ctx);
+
#ifdef __amigaos4__
BltBitMapTags(BLITA_SrcType, BLITT_BITMAP,
BLITA_Source, ami_cw->gg.bm,
@@ -216,7 +215,6 @@ ami_cw_redraw_rect(struct ami_corewindow *ami_cw, struct rect *r)
ami_gui_free_space_box(bbox);
ami_clearclipreg(glob);
- glob->rp = temprp;
ami_gui_set_default_gg();
}
diff --git a/frontends/amiga/sslcert.h b/frontends/amiga/sslcert.h
index 4718e75..392989f 100644
--- a/frontends/amiga/sslcert.h
+++ b/frontends/amiga/sslcert.h
@@ -33,6 +33,6 @@ struct ssl_cert_info;
*/
nserror ami_cert_verify(struct nsurl *url,
const struct ssl_cert_info *certs, unsigned long num,
- nserror (*cb)(bool proceed, void *pw), void *cbpw);
+ nserror (*cb)(bool proceed, void *pw), void *cbpw);
#endif
-----------------------------------------------------------------------
Summary of changes:
frontends/amiga/corewindow.c | 122 +++++++++++++++++++++++-------------------
frontends/amiga/corewindow.h | 2 -
frontends/amiga/sslcert.c | 7 +--
frontends/amiga/sslcert.h | 2 +-
4 files changed, 71 insertions(+), 62 deletions(-)
diff --git a/frontends/amiga/corewindow.c b/frontends/amiga/corewindow.c
index 5aff074..509499f 100644
--- a/frontends/amiga/corewindow.c
+++ b/frontends/amiga/corewindow.c
@@ -83,22 +83,40 @@ ami_cw_coord_amiga_to_ns(struct ami_corewindow *ami_cw, int *restrict x, int *re
/* get current mouse position in the draw area, adjusted for scroll.
- * only works during OM_NOTIFY! at other times use last stored posn
+ * @return true if the mouse was in the draw area and co-ordinates updated
*/
-static void
+static bool
ami_cw_mouse_pos(struct ami_corewindow *ami_cw, int *restrict x, int *restrict y)
{
- ULONG xm, ym;
+ int16 xm, ym;
+ ULONG xs, ys;
+ struct IBox *bbox;
+
+ xm = ami_cw->win->MouseX;
+ ym = ami_cw->win->MouseY;
+
+ if(ami_gui_get_space_box((Object *)ami_cw->objects[GID_CW_DRAW], &bbox) != NSERROR_OK) {
+ amiga_warn_user("NoMemory", "");
+ return false;
+ }
+
+ xm -= bbox->Left;
+ ym -= bbox->Top;
- GetAttr(SPACE_MouseX, ami_cw->objects[GID_CW_DRAW], (ULONG *)&xm);
- GetAttr(SPACE_MouseY, ami_cw->objects[GID_CW_DRAW], (ULONG *)&ym);
+ ami_gui_free_space_box(bbox);
- ami_cw_coord_amiga_to_ns(ami_cw, (int *)&xm, (int *)&ym);
+ if((xm < 0) || (ym < 0) || (xm > bbox->Width) || (ym > bbox->Height))
+ return false;
- ami_cw->mouse_x = xm;
- ami_cw->mouse_y = ym;
- *x = ami_cw->mouse_x;
- *y = ami_cw->mouse_y;
+ GetAttr(SCROLLER_Top, ami_cw->objects[GID_CW_HSCROLL], (ULONG *)&xs);
+ GetAttr(SCROLLER_Top, ami_cw->objects[GID_CW_VSCROLL], (ULONG *)&ys);
+
+ xm += xs;
+ ym += ys;
+ *x = xm;
+ *y = ym;
+
+ return true;
}
/* handle keypress */
@@ -136,12 +154,15 @@ static void
ami_cw_redraw_rect(struct ami_corewindow *ami_cw, struct rect *r)
{
struct IBox *bbox;
- struct RastPort *temprp;
ULONG pos_x, pos_y;
struct rect draw_rect;
int tile_size_x = ami_cw->gg.width;
int tile_size_y = ami_cw->gg.height;
int tile_x, tile_y, tile_w, tile_h;
+ int x = r->x0;
+ int y = r->y0;
+ int width = r->x1 - r->x0;
+ int height = r->y1 - r->y0;
struct redraw_context ctx = {
.interactive = true,
@@ -154,46 +175,41 @@ ami_cw_redraw_rect(struct ami_corewindow *ami_cw, struct rect *r)
return;
}
- int x0 = bbox->Left;
- int y0 = bbox->Top;
- ami_cw_coord_amiga_to_ns(ami_cw, &x0, &y0);
- int x1 = x0 + bbox->Width;
- int y1 = y0 + bbox->Height;
-
- if((r->y1 < y0) || (r->x1 < x0) || (r->x0 > x1) || (r->y0 > y1)) {
- /* rect not visible */
- ami_gui_free_space_box(bbox);
- return;
- }
-
- if(r->y0 < y0) r->y0 = y0;
- if(r->x0 < x0) r->x0 = x0;
- if(r->y1 > y1) r->y1 = y1;
- if(r->x1 > x1) r->x1 = x1;
-
GetAttr(SCROLLER_Top, ami_cw->objects[GID_CW_HSCROLL], (ULONG *)&pos_x);
GetAttr(SCROLLER_Top, ami_cw->objects[GID_CW_VSCROLL], (ULONG *)&pos_y);
glob = &ami_cw->gg;
- temprp = glob->rp; //??
- glob->rp = ami_cw->win->RPort;
- for(tile_y = r->y0; tile_y < r->y1; tile_y += tile_size_y) {
+ if(x - pos_x + width > bbox->Width) width = bbox->Width - (x - pos_x);
+ if(y - pos_y + height > bbox->Height) height = bbox->Height - (y - pos_y);
+
+ if(x < pos_x) {
+ width -= pos_x - x;
+ x = pos_x;
+ }
+
+ if(y < pos_y) {
+ height -= pos_y - y;
+ y = pos_y;
+ }
+
+ for(tile_y = y; tile_y < (y + height); tile_y += tile_size_y) {
tile_h = tile_size_y;
- if((r->y1 - tile_y) < tile_size_y)
- tile_h = r->y1 - tile_y;
+ if(((y + height) - tile_y) < tile_size_y)
+ tile_h = (y + height) - tile_y;
- for(tile_x = r->x0; tile_x < r->x1; tile_x += tile_size_x) {
+ for(tile_x = x; tile_x < (x + width); tile_x += tile_size_x) {
tile_w = tile_size_x;
- if((r->x1 - tile_x) < tile_size_x)
- tile_w = r->x1 - tile_x;
+ if(((x + width) - tile_x) < tile_size_x)
+ tile_w = (x + width) - tile_x;
- draw_rect.x0 = tile_x;
- draw_rect.y0 = tile_y;
+ draw_rect.x0 = - tile_x;
+ draw_rect.y0 = - tile_y;
draw_rect.x1 = tile_x + tile_w;
draw_rect.y1 = tile_y + tile_h;
ami_cw->draw(ami_cw, &draw_rect, &ctx);
+
#ifdef __amigaos4__
BltBitMapTags(BLITA_SrcType, BLITT_BITMAP,
BLITA_Source, ami_cw->gg.bm,
@@ -216,7 +232,6 @@ ami_cw_redraw_rect(struct ami_corewindow *ami_cw, struct rect *r)
ami_gui_free_space_box(bbox);
ami_clearclipreg(glob);
- glob->rp = temprp;
ami_gui_set_default_gg();
}
@@ -317,20 +332,12 @@ HOOKF(void, ami_cw_idcmp_hook, Object *, object, struct IntuiMessage *)
struct ami_corewindow *ami_cw = hook->h_Data;
struct IntuiWheelData *wheel;
ULONG gid = GetTagData( GA_ID, 0, msg->IAddress );
- int x, y;
- int key_state = 0;
switch(msg->Class)
{
case IDCMP_IDCMPUPDATE:
switch(gid)
{
- case GID_CW_DRAW:
- ami_cw_mouse_pos(ami_cw, &x, &y);
- key_state = ami_gui_get_quals(ami_cw->objects[GID_CW_WIN]);
- ami_cw->mouse(ami_cw, ami_cw->mouse_state | key_state, x, y);
- break;
-
case GID_CW_HSCROLL:
case GID_CW_VSCROLL:
ami_cw_redraw(ami_cw, NULL);
@@ -368,14 +375,21 @@ ami_cw_event(void *w)
int nskey;
int key_state = 0;
struct timeval curtime;
+ int x, y;
while((result = RA_HandleInput(ami_cw->objects[GID_CW_WIN], &code)) != WMHI_LASTMSG) {
switch(result & WMHI_CLASSMASK) {
case WMHI_MOUSEMOVE:
- /* in theory the mouse moves we care about are processed in our hook function... */
+ if(ami_cw_mouse_pos(ami_cw, &x, &y)) {
+ key_state = ami_gui_get_quals(ami_cw->objects[GID_CW_WIN]);
+ ami_cw->mouse(ami_cw, ami_cw->mouse_state | key_state, x, y);
+ }
break;
case WMHI_MOUSEBUTTONS:
+ if(ami_cw_mouse_pos(ami_cw, &x, &y) == false)
+ break;
+
key_state = ami_gui_get_quals(ami_cw->objects[GID_CW_WIN]);
case SELECTDOWN:
@@ -408,7 +422,7 @@ ami_cw_event(void *w)
}
}
- ami_cw->mouse(ami_cw, ami_cw->mouse_state | key_state, ami_cw->mouse_x, ami_cw->mouse_y);
+ ami_cw->mouse(ami_cw, ami_cw->mouse_state | key_state, x, y);
ami_cw->mouse_state = BROWSER_MOUSE_HOVER;
break;
@@ -416,11 +430,11 @@ ami_cw_event(void *w)
if(ami_cw->mouse_state & BROWSER_MOUSE_PRESS_2)
ami_cw->mouse_state = BROWSER_MOUSE_CLICK_2;
- ami_cw->mouse(ami_cw, ami_cw->mouse_state | key_state, ami_cw->mouse_x, ami_cw->mouse_y);
+ ami_cw->mouse(ami_cw, ami_cw->mouse_state | key_state, x, y);
ami_cw->mouse_state = BROWSER_MOUSE_HOVER;
break;
- ami_cw->mouse(ami_cw, ami_cw->mouse_state | key_state, ami_cw->mouse_x, ami_cw->mouse_y);
+ ami_cw->mouse(ami_cw, ami_cw->mouse_state | key_state, x, y);
break;
case WMHI_RAWKEY:
@@ -643,9 +657,6 @@ nserror ami_corewindow_fini(struct ami_corewindow *ami_cw)
FreeObjList(ami_cw->deferred_rects);
ami_memory_itempool_delete(ami_cw->deferred_rects_pool);
- /* remove the core window from our window list */
- ami_gui_win_list_remove(ami_cw);
-
/* destroy the window */
ami_cw->win = NULL;
DisposeObject(ami_cw->objects[GID_CW_WIN]);
@@ -654,6 +665,9 @@ nserror ami_corewindow_fini(struct ami_corewindow *ami_cw)
ami_plot_release_pens(ami_cw->gg.shared_pens);
ami_free_layers(&ami_cw->gg);
+ /* remove the core window from our window list */
+ ami_gui_win_list_remove(ami_cw);
+
return NSERROR_OK;
}
diff --git a/frontends/amiga/corewindow.h b/frontends/amiga/corewindow.h
index f62987f..2c5dbb5 100644
--- a/frontends/amiga/corewindow.h
+++ b/frontends/amiga/corewindow.h
@@ -52,8 +52,6 @@ struct ami_corewindow {
struct Hook idcmp_hook;
struct timeval lastclick;
- int mouse_x;
- int mouse_y;
int mouse_state;
APTR deferred_rects_pool;
diff --git a/frontends/amiga/sslcert.c b/frontends/amiga/sslcert.c
index df0005e..5d74464 100644
--- a/frontends/amiga/sslcert.c
+++ b/frontends/amiga/sslcert.c
@@ -25,7 +25,6 @@
#include <stdlib.h>
#include <proto/intuition.h>
-#include <intuition/icclass.h>
#include <classes/window.h>
#include <gadgets/button.h>
@@ -84,12 +83,11 @@ ami_crtvrfy_destroy(struct ami_crtvrfy_window *crtvrfy_win)
res = sslcert_viewer_fini(crtvrfy_win->ssl_data);
if (res == NSERROR_OK) {
- res = ami_corewindow_fini(&crtvrfy_win->core); /* closes the window for us */
ami_utf8_free(crtvrfy_win->wintitle);
ami_utf8_free(crtvrfy_win->sslerr);
ami_utf8_free(crtvrfy_win->sslaccept);
ami_utf8_free(crtvrfy_win->sslreject);
- free(crtvrfy_win);
+ res = ami_corewindow_fini(&crtvrfy_win->core); /* closes the window for us */
}
return res;
}
@@ -250,7 +248,6 @@ ami_crtvrfy_create_window(struct ami_crtvrfy_window *crtvrfy_win)
SPACE_Transparent, TRUE,
SPACE_BevelStyle, BVS_DISPLAY,
GA_RelVerify, TRUE,
- ICA_TARGET, ICTARGET_IDCMP,
SpaceEnd,
LAYOUT_AddChild, LayoutHObj,
LAYOUT_AddChild, crtvrfy_win->sslcert_objects[GID_SSLCERT_ACCEPT] = ButtonObj,
@@ -285,7 +282,7 @@ nserror ami_cert_verify(struct nsurl *url,
struct ami_crtvrfy_window *ncwin;
nserror res;
- ncwin = malloc(sizeof(struct ami_crtvrfy_window));
+ ncwin = calloc(1, sizeof(struct ami_crtvrfy_window));
if (ncwin == NULL) {
return NSERROR_NOMEM;
}
diff --git a/frontends/amiga/sslcert.h b/frontends/amiga/sslcert.h
index 4718e75..392989f 100644
--- a/frontends/amiga/sslcert.h
+++ b/frontends/amiga/sslcert.h
@@ -33,6 +33,6 @@ struct ssl_cert_info;
*/
nserror ami_cert_verify(struct nsurl *url,
const struct ssl_cert_info *certs, unsigned long num,
- nserror (*cb)(bool proceed, void *pw), void *cbpw);
+ nserror (*cb)(bool proceed, void *pw), void *cbpw);
#endif
--
NetSurf Browser
6 years, 8 months
netsurf-website: branch master updated. 015763884e18d673b0deb0b19d7e8af12f2c4f92
by NetSurf Browser Project
Gitweb links:
...log http://git.netsurf-browser.org/netsurf-website.git/shortlog/015763884e18d...
...commit http://git.netsurf-browser.org/netsurf-website.git/commit/015763884e18d67...
...tree http://git.netsurf-browser.org/netsurf-website.git/tree/015763884e18d673b...
The branch, master has been updated
via 015763884e18d673b0deb0b19d7e8af12f2c4f92 (commit)
from 6fc4e1935d24f5eab5a6b60f573d1fe1f30efdb8 (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
commitdiff http://git.netsurf-browser.org/netsurf-website.git/commit/?id=015763884e1...
commit 015763884e18d673b0deb0b19d7e8af12f2c4f92
Author: Michael Drake <tlsa(a)netsurf-browser.org>
Commit: Michael Drake <tlsa(a)netsurf-browser.org>
Add windows download page.
diff --git a/downloads/index.html b/downloads/index.html
index 369e8cc..3f09eaf 100644
--- a/downloads/index.html
+++ b/downloads/index.html
@@ -60,7 +60,7 @@
<li class="gtk"><a href="gtk/">Linux and other Unix-likes</a></li>
<li class="beos"><a href="beos/">Haiku & BeOS</a></li>
<li class="amiga"><a href="amiga/">AmigaOS</a></li>
-<!--li class="windows"><a href="windows/">Windows</a></li-->
+<li class="windows"><a href="windows/">Windows</a></li>
<li class="atari"><a href="atari/">Atari</a></li>
<li class="macosx"><a href="macosx/">Mac OS X</a></li>
</ul>
diff --git a/downloads/windows/index.html b/downloads/windows/index.html
new file mode 100644
index 0000000..4ecdf78
--- /dev/null
+++ b/downloads/windows/index.html
@@ -0,0 +1,120 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
+ "http://www.w3.org/TR/html4/strict.dtd">
+<html>
+<head>
+<title>NetSurf | Windows Downloads</title>
+<link rel="stylesheet" type="text/css" href="/netsurf.css">
+<link rel="icon" type="image/png" href="/webimages/favicon.png">
+</head>
+
+<body>
+<p class="banner"><a href="/"><img src="/netsurf.png" alt="NetSurf"></a></p>
+
+<div class="navigation">
+<div class="navsection">
+<ul>
+<li><a href="/about/">About NetSurf</a></li>
+<li><a href="/downloads/">Downloads</a>
+<ul>
+<li><a href="/downloads/source/">Source</a></li>
+<li><a href="/downloads/extras">Extras</a></li>
+</ul>
+</li>
+<li><a href="/documentation/">Documentation</a></li>
+<li><a href="/developers/">Development area</a></li>
+<li><a href="/webmasters/">Webmaster area</a></li>
+<li><a href="/contact/">Contact</a></li>
+</ul>
+</div>
+
+<div class="navsection">
+<ul class="languages">
+<!--<li><a href="index.de">Deutsch</a></li>-->
+<li>English</li>
+<!--<li><a href="index.fr">Fran�ais</a></li>-->
+<!--<li><a href="index.nl">Nederlands</a></li>-->
+</ul>
+</div>
+
+<div class="navsection">
+<ul class="sitelinks">
+<li><a href="http://wiki.netsurf-browser.org/">Development wiki</a></li>
+<li><a href="http://source.netsurf-browser.org/">Git repository viewer</a></li>
+<li><a href="http://ci.netsurf-browser.org/">Continuous Integration</a></li>
+<li><a href="http://bugs.netsurf-browser.org/">Bug report system</a></li>
+</ul>
+</div>
+
+</div>
+
+<div class="content">
+
+<p class="breadcrumbs"><a href="/">Home</a> � <a href="/downloads/">Downloads</a> � Windows</p>
+
+<h1>Windows NetSurf Downloads</h1>
+
+<div class="bignote">
+<dl>
+<dt><a href="http://ci.netsurf-browser.org/builds/">Test builds</a></dt>
+<dd>Bleeding-edge test builds are available for those that want to try the latest experimental features.</dd>
+</dl>
+</div>
+
+<div class="downloadlatestouter">
+<div class="downloadlatest">
+<div class="downloadlatestbox">
+<p class="downloadmain downloadfirst"><a href="http://download.netsurf-browser.org/netsurf/releases/pre-built/windows/3...."><span>NetSurf 3.6 for Windows</span> <span>(14MB)</span> <span class="downloaddate">19 Nov 2016</span></a></p>
+<p class="downloadinstructions">Run the executable.</p>
+<!--p class="preul">Requires either:</p>
+<ul>
+<li>Windows Version?</li>
+</ul-->
+</div>
+
+<div class="downloadlatestbox downloadlast">
+<p class="downloadmain"><a href="http://download.netsurf-browser.org/netsurf/releases/source/netsurf-3.6-s..."><span>NetSurf 3.6 source code</span> <span>(3.9MB)</span> <span class="downloaddate">19 Nov 2016</span></a></p>
+<p class="downloadinstructions"><a href="/downloads/source/#BuildInstructions">Build instructions</a></p>
+<p class="preul">Build NetSurf for:</p>
+<ul>
+<li>Windows</li>
+<li>Linux</li>
+<li>Free/NetBSD</li>
+<li>Solaris</li>
+<li>And more</li>
+</ul>
+</div>
+</div>
+<div class="arrow"></div>
+</div>
+
+<p>Check out the <a href="http://download.netsurf-browser.org/netsurf/releases/ChangeLog.txt">change log</a> to see what's changed since the last release.</p>
+
+<!--h2>Previous releases</h2>
+<dl>
+<dt>NetSurf 3.5</dt>
+<dd>
+<ul>
+<li><a href="http://download.netsurf-browser.org/netsurf/releases/pre-built/riscos/net...">NetSurf 3.5 browser for RISC OS</a> (14 Apr 2016)</li>
+<li><a href="http://download.netsurf-browser.org/netsurf/releases/source/netsurf-3.5-s...">NetSurf 3.5 source code</a> (14 Apr 2016)</li>
+</ul>
+</dd>
+</dl!-->
+
+
+<div class="footer">
+<p>Copyright 2016 - 2017 The NetSurf Developers</p>
+</div>
+
+</div>
+
+
+<form method="get" action="http://www.google.co.uk/search">
+<div class="searchbox">
+<input type="hidden" name="q" value="site:netsurf-browser.org">
+<input type="text" name="q" maxlength="255"><br>
+<input type="submit" value="Search" name="btnG">
+</div>
+</form>
+
+</body>
+</html>
-----------------------------------------------------------------------
Summary of changes:
downloads/index.html | 2 +-
downloads/{beos => windows}/index.html | 36 +++++++++++++-------------------
2 files changed, 16 insertions(+), 22 deletions(-)
copy downloads/{beos => windows}/index.html (74%)
diff --git a/downloads/index.html b/downloads/index.html
index 369e8cc..3f09eaf 100644
--- a/downloads/index.html
+++ b/downloads/index.html
@@ -60,7 +60,7 @@
<li class="gtk"><a href="gtk/">Linux and other Unix-likes</a></li>
<li class="beos"><a href="beos/">Haiku & BeOS</a></li>
<li class="amiga"><a href="amiga/">AmigaOS</a></li>
-<!--li class="windows"><a href="windows/">Windows</a></li-->
+<li class="windows"><a href="windows/">Windows</a></li>
<li class="atari"><a href="atari/">Atari</a></li>
<li class="macosx"><a href="macosx/">Mac OS X</a></li>
</ul>
diff --git a/downloads/beos/index.html b/downloads/windows/index.html
similarity index 74%
copy from downloads/beos/index.html
copy to downloads/windows/index.html
index 8fda38a..4ecdf78 100644
--- a/downloads/beos/index.html
+++ b/downloads/windows/index.html
@@ -2,7 +2,7 @@
"http://www.w3.org/TR/html4/strict.dtd">
<html>
<head>
-<title>NetSurf | BeOS Downloads</title>
+<title>NetSurf | Windows Downloads</title>
<link rel="stylesheet" type="text/css" href="/netsurf.css">
<link rel="icon" type="image/png" href="/webimages/favicon.png">
</head>
@@ -49,9 +49,9 @@
<div class="content">
-<p class="breadcrumbs"><a href="/">Home</a> � <a href="/downloads/">Downloads</a> � Haiku</p>
+<p class="breadcrumbs"><a href="/">Home</a> � <a href="/downloads/">Downloads</a> � Windows</p>
-<h1>Haiku NetSurf Downloads</h1>
+<h1>Windows NetSurf Downloads</h1>
<div class="bignote">
<dl>
@@ -63,12 +63,12 @@
<div class="downloadlatestouter">
<div class="downloadlatest">
<div class="downloadlatestbox">
-<p class="downloadmain downloadfirst"><a href="http://download.netsurf-browser.org/netsurf/releases/pre-built/beos/3.6-n..."><span>NetSurf 3.6 for Haiku</span> <span>(9.4MB)</span> <span class="downloaddate">19 Nov 2016</span></a></p>
-<p class="downloadinstructions">Extract to boot and create symlink for Deskbar</p>
-<!--<p class="preul">Requires:</p>
+<p class="downloadmain downloadfirst"><a href="http://download.netsurf-browser.org/netsurf/releases/pre-built/windows/3...."><span>NetSurf 3.6 for Windows</span> <span>(14MB)</span> <span class="downloaddate">19 Nov 2016</span></a></p>
+<p class="downloadinstructions">Run the executable.</p>
+<!--p class="preul">Requires either:</p>
<ul>
-<li>Haiku</li>
-</ul>-->
+<li>Windows Version?</li>
+</ul-->
</div>
<div class="downloadlatestbox downloadlast">
@@ -76,10 +76,10 @@
<p class="downloadinstructions"><a href="/downloads/source/#BuildInstructions">Build instructions</a></p>
<p class="preul">Build NetSurf for:</p>
<ul>
-<li>Haiku</li>
-<li>BeOS</li>
+<li>Windows</li>
<li>Linux</li>
<li>Free/NetBSD</li>
+<li>Solaris</li>
<li>And more</li>
</ul>
</div>
@@ -89,26 +89,20 @@
<p>Check out the <a href="http://download.netsurf-browser.org/netsurf/releases/ChangeLog.txt">change log</a> to see what's changed since the last release.</p>
-<p>The latest <a href="http://revolf.free.fr/beos/netsurf-bone.zip">development build</a> is available, which should be unzipped to <em>"/boot"</em>.</p>
-
-<h2>Previous releases</h2>
+<!--h2>Previous releases</h2>
<dl>
<dt>NetSurf 3.5</dt>
<dd>
<ul>
-<li><a href="http://download.netsurf-browser.org/netsurf/releases/pre-built/beos/NetSu...">NetSurf 2.0 browser for Haiku and BeOS</a> (25 Apr 2009)</li>
-<li><a href="http://download.netsurf-browser.org/netsurf/releases/source/netsurf-2.0-s...">NetSurf 2.0 source code</a> (25 Apr 2009)</li>
+<li><a href="http://download.netsurf-browser.org/netsurf/releases/pre-built/riscos/net...">NetSurf 3.5 browser for RISC OS</a> (14 Apr 2016)</li>
+<li><a href="http://download.netsurf-browser.org/netsurf/releases/source/netsurf-3.5-s...">NetSurf 3.5 source code</a> (14 Apr 2016)</li>
</ul>
</dd>
-</dl>
-
-<h2>Source</h2>
-
-<p>Alternatively, you can obtain the <a href="/downloads/source/">latest source</a>, if you want to play with the BeOS/Haiku port.</p>
+</dl!-->
<div class="footer">
-<p>Copyright 2003 - 2009 The NetSurf Developers</p>
+<p>Copyright 2016 - 2017 The NetSurf Developers</p>
</div>
</div>
--
NetSurf website source for *.netsurf-browser.org
6 years, 8 months
netsurf: branch chris/amiga-corewindow updated. release/3.6-146-ga9cc079
by NetSurf Browser Project
Gitweb links:
...log http://git.netsurf-browser.org/netsurf.git/shortlog/a9cc0792a43d108e5ff61...
...commit http://git.netsurf-browser.org/netsurf.git/commit/a9cc0792a43d108e5ff6105...
...tree http://git.netsurf-browser.org/netsurf.git/tree/a9cc0792a43d108e5ff610553...
The branch, chris/amiga-corewindow has been updated
via a9cc0792a43d108e5ff61055354422a6c7218a74 (commit)
from dab118b6f7e9a22ed01413a2ce2fd60e4c4df97b (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
commitdiff http://git.netsurf-browser.org/netsurf.git/commit/?id=a9cc0792a43d108e5ff...
commit a9cc0792a43d108e5ff61055354422a6c7218a74
Author: Chris Young <chris(a)unsatisfactorysoftware.co.uk>
Commit: Chris Young <chris(a)unsatisfactorysoftware.co.uk>
migrate sslcert to use corewindow
predictably blank
diff --git a/frontends/amiga/corewindow.c b/frontends/amiga/corewindow.c
index f05d47b..5aff074 100644
--- a/frontends/amiga/corewindow.c
+++ b/frontends/amiga/corewindow.c
@@ -451,14 +451,18 @@ ami_cw_event(void *w)
default:
/* pass the event to the window owner */
if(ami_cw->event != NULL)
- ami_cw->event(ami_cw, result);
+ if(ami_cw->event(ami_cw, result) == TRUE) {
+ return TRUE;
+ }
break;
}
default:
/* pass the event to the window owner */
if(ami_cw->event != NULL)
- ami_cw->event(ami_cw, result);
+ if(ami_cw->event(ami_cw, result) == TRUE) {
+ return TRUE;
+ }
break;
}
};
@@ -603,10 +607,9 @@ nserror ami_corewindow_init(struct ami_corewindow *ami_cw)
/* 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
- SetAttrs(ami_cw->objects[GID_CW_WIN],
- WINDOW_IDCMPHook, &ami_cw->idcmp_hook,
- TAG_DONE); */
+
+ /* open the window */
+ ami_cw->win = (struct Window *)RA_OpenWindow(ami_cw->objects[GID_CW_WIN]);
/* attach the scrollbars for event processing _if they are in the window border_ */
if(ami_cw->objects[GID_CW_HSCROLL] == NULL) {
diff --git a/frontends/amiga/corewindow.h b/frontends/amiga/corewindow.h
index d8f80d3..f62987f 100644
--- a/frontends/amiga/corewindow.h
+++ b/frontends/amiga/corewindow.h
@@ -108,16 +108,16 @@ struct ami_corewindow {
*
* \param ami_cw The Amiga core window structure.
* \param result event as returned by RA_HandleInput()
- * \return NSERROR_OK on sucess otherwise apropriate error code.
+ * \return TRUE if window closed during event processing
*/
- nserror (*event)(struct ami_corewindow *ami_cw, ULONG id);
+ BOOL (*event)(struct ami_corewindow *ami_cw, ULONG result);
/**
* callback to close an Amiga core window
*
* \param ami_cw The Amiga core window structure.
*/
- nserror (*close)(struct ami_corewindow *ami_cw);
+ void (*close)(struct ami_corewindow *ami_cw);
};
diff --git a/frontends/amiga/gui.c b/frontends/amiga/gui.c
index 9499ff8..1508135 100644
--- a/frontends/amiga/gui.c
+++ b/frontends/amiga/gui.c
@@ -5610,7 +5610,7 @@ static struct gui_misc_table amiga_misc_table = {
.quit = gui_quit,
.launch_url = gui_launch_url,
- .cert_verify = gui_cert_verify,
+ .cert_verify = ami_cert_verify,
.login = gui_401login_open,
};
diff --git a/frontends/amiga/sslcert.c b/frontends/amiga/sslcert.c
index 83798f2..df0005e 100644
--- a/frontends/amiga/sslcert.c
+++ b/frontends/amiga/sslcert.c
@@ -1,5 +1,5 @@
/*
- * Copyright 2009 Chris Young <chris(a)unsatisfactorysoftware.co.uk>
+ * Copyright 2017 Chris Young <chris(a)unsatisfactorysoftware.co.uk>
*
* This file is part of NetSurf, http://www.netsurf-browser.org/
*
@@ -16,39 +16,340 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
-#include <proto/exec.h>
+/**
+ * \file
+ * Implementation of Amiga certificate viewing using core windows.
+ */
+
+#include <stdint.h>
+#include <stdlib.h>
+
+#include <proto/intuition.h>
+#include <intuition/icclass.h>
+
+#include <classes/window.h>
+#include <gadgets/button.h>
+#include <gadgets/layout.h>
+#include <gadgets/space.h>
+#include <images/label.h>
+
+#include <reaction/reaction_macros.h>
-#include "utils/nsurl.h"
-#include "content/llcache.h"
-#include "netsurf/mouse.h"
-#include "netsurf/window.h"
+#include "utils/log.h"
+#include "netsurf/keypress.h"
+#include "netsurf/plotters.h"
#include "desktop/sslcert_viewer.h"
+#include "utils/messages.h"
-#include "amiga/tree.h"
+#include "amiga/corewindow.h"
+#include "amiga/libs.h"
#include "amiga/sslcert.h"
+#include "amiga/utf8.h"
+
+
+/**
+ * Amiga certificate viewing window context
+ */
+enum {
+ GID_SSLCERT_ACCEPT = GID_CW_LAST,
+ GID_SSLCERT_REJECT,
+ GID_SSLCERT_LAST
+};
+
+#define GID_SSLCERT_SIZE GID_SSLCERT_LAST - GID_CW_LAST
+
+struct ami_crtvrfy_window {
+ /** Amiga core window context */
+ struct ami_corewindow core;
+
+ /** Amiga GUI stuff */
+ Object *sslcert_objects[GID_SSLCERT_LAST]; // technically wasting a few bytes here
+
+ char *wintitle;
+ char *sslerr;
+ char *sslaccept;
+ char *sslreject;
+
+ /** SSL certificate viewer context data */
+ struct sslcert_session_data *ssl_data;
+};
+
+/**
+ * destroy a previously created certificate view
+ */
+static nserror
+ami_crtvrfy_destroy(struct ami_crtvrfy_window *crtvrfy_win)
+{
+ nserror res;
+
+ res = sslcert_viewer_fini(crtvrfy_win->ssl_data);
+ if (res == NSERROR_OK) {
+ res = ami_corewindow_fini(&crtvrfy_win->core); /* closes the window for us */
+ ami_utf8_free(crtvrfy_win->wintitle);
+ ami_utf8_free(crtvrfy_win->sslerr);
+ ami_utf8_free(crtvrfy_win->sslaccept);
+ ami_utf8_free(crtvrfy_win->sslreject);
+ free(crtvrfy_win);
+ }
+ return res;
+}
-nserror gui_cert_verify(nsurl *url,
- const struct ssl_cert_info *certs, unsigned long num,
- nserror (*cb)(bool proceed, void *pw), void *cbpw)
+static void
+ami_crtvrfy_accept(struct ami_corewindow *ami_cw)
{
- struct sslcert_session_data *data;
- struct treeview_window *ssl_window;
+ struct ami_crtvrfy_window *crtvrfy_win;
+ /* technically degenerate container of */
+ crtvrfy_win = (struct ami_crtvrfy_window *)ami_cw;
- sslcert_viewer_create_session_data(num, url, cb, cbpw,
- certs, &data);
- ssl_current_session = data;
+ sslcert_viewer_accept(crtvrfy_win->ssl_data);
- ssl_window = ami_tree_create(TREE_SSLCERT, data);
- if (!ssl_window) {
- return NSERROR_INIT_FAILED;
+ ami_crtvrfy_destroy(crtvrfy_win);
+}
+
+static void
+ami_crtvrfy_reject(struct ami_corewindow *ami_cw)
+{
+ struct ami_crtvrfy_window *crtvrfy_win;
+ /* technically degenerate container of */
+ crtvrfy_win = (struct ami_crtvrfy_window *)ami_cw;
+
+ sslcert_viewer_reject(crtvrfy_win->ssl_data);
+
+ ami_crtvrfy_destroy(crtvrfy_win);
+}
+
+/**
+ * callback for unknown events on Amiga core window
+ * eg. buttons in the ssl cert window
+ * (result & WMHI_CLASSMASK) gives the class of event (eg. WMHI_GADGETUP)
+ * (result & WMHI_GADGETMASK) gives the gadget ID (eg. GID_SSLCERT_ACCEPT)
+ *
+ * \param ami_cw The Amiga core window structure.
+ * \param result event as returned by RA_HandleInput()
+ * \return TRUE if window closed during event processing
+ */
+static BOOL
+ami_crtvrfy_event(struct ami_corewindow *ami_cw, ULONG result)
+{
+ if((result & WMHI_CLASSMASK) == WMHI_GADGETUP) {
+ switch(result & WMHI_GADGETMASK) {
+ case GID_SSLCERT_ACCEPT:
+ ami_crtvrfy_accept(ami_cw);
+ return TRUE;
+ break;
+
+ case GID_SSLCERT_REJECT:
+ ami_crtvrfy_reject(ami_cw);
+ return TRUE;
+ break;
+ }
}
+ return FALSE;
+}
- ami_tree_open(ssl_window, AMI_TREE_SSLCERT);
+/**
+ * callback for mouse action for certificate verify on core window
+ *
+ * \param ami_cw The Amiga core window structure.
+ * \param mouse_state netsurf mouse state on event
+ * \param x location of event
+ * \param y location of event
+ * \return NSERROR_OK on success otherwise apropriate error code
+ */
+static nserror
+ami_crtvrfy_mouse(struct ami_corewindow *ami_cw,
+ browser_mouse_state mouse_state,
+ int x, int y)
+{
+ struct ami_crtvrfy_window *crtvrfy_win;
+ /* technically degenerate container of */
+ crtvrfy_win = (struct ami_crtvrfy_window *)ami_cw;
+
+ sslcert_viewer_mouse_action(crtvrfy_win->ssl_data, mouse_state, x, y);
return NSERROR_OK;
}
-void ami_ssl_free(struct treeview_window *twin)
+/**
+ * callback for keypress for certificate verify on core window
+ *
+ * \param example_cw The Amiga core window structure.
+ * \param nskey The netsurf key code
+ * \return NSERROR_OK on success otherwise apropriate error code
+ */
+static nserror
+ami_crtvrfy_key(struct ami_corewindow *ami_cw, uint32_t nskey)
{
- ami_tree_destroy(twin);
+ struct ami_crtvrfy_window *crtvrfy_win;
+
+ /* technically degenerate container of */
+ crtvrfy_win = (struct ami_crtvrfy_window *)ami_cw;
+
+ if (sslcert_viewer_keypress(crtvrfy_win->ssl_data, nskey)) {
+ return NSERROR_OK;
+ }
+ return NSERROR_NOT_IMPLEMENTED;
+}
+
+/**
+ * callback on draw event for certificate verify on core window
+ *
+ * \param ami_cw The Amiga core window structure.
+ * \param r The rectangle of the window that needs updating.
+ * \param ctx The drawing context
+ * \return NSERROR_OK on success otherwise apropriate error code
+ */
+static nserror
+ami_crtvrfy_draw(struct ami_corewindow *ami_cw, struct rect *r, struct redraw_context *ctx)
+{
+ struct ami_crtvrfy_window *crtvrfy_win;
+
+ /* technically degenerate container of */
+ crtvrfy_win = (struct ami_crtvrfy_window *)ami_cw;
+
+ sslcert_viewer_redraw(crtvrfy_win->ssl_data, 0, 0, r, ctx);
+
+ return NSERROR_OK;
+}
+
+static nserror
+ami_crtvrfy_create_window(struct ami_crtvrfy_window *crtvrfy_win)
+{
+ struct ami_corewindow *ami_cw = (struct ami_corewindow *)&crtvrfy_win->core;
+
+ ami_cw->objects[GID_CW_WIN] = WindowObj,
+ WA_ScreenTitle, ami_gui_get_screen_title(),
+ WA_Title, crtvrfy_win->wintitle,
+ WA_Activate, TRUE,
+ WA_DepthGadget, TRUE,
+ WA_DragBar, TRUE,
+ WA_CloseGadget, TRUE,
+ WA_SizeGadget, TRUE,
+ WA_SizeBRight, TRUE,
+ WA_Height, scrn->Height / 2,
+ WA_PubScreen, scrn,
+ WA_ReportMouse, TRUE,
+ WA_IDCMP, IDCMP_MOUSEMOVE | IDCMP_MOUSEBUTTONS | IDCMP_NEWSIZE |
+ IDCMP_RAWKEY | IDCMP_GADGETUP | IDCMP_IDCMPUPDATE |
+ IDCMP_EXTENDEDMOUSE | IDCMP_SIZEVERIFY,
+ WINDOW_HorizProp, 1,
+ WINDOW_VertProp, 1,
+ WINDOW_IDCMPHook, &ami_cw->idcmp_hook,
+ WINDOW_IDCMPHookBits, IDCMP_IDCMPUPDATE | IDCMP_EXTENDEDMOUSE,
+ WINDOW_SharedPort, sport,
+ WINDOW_UserData, crtvrfy_win,
+ /* WINDOW_NewMenu, twin->menu, -> No menu for SSL Cert */
+ WINDOW_IconifyGadget, FALSE,
+ WINDOW_Position, WPOS_CENTERSCREEN,
+ WINDOW_ParentGroup, ami_cw->objects[GID_CW_MAIN] = LayoutVObj,
+ LAYOUT_AddImage, LabelObj,
+ LABEL_Text, crtvrfy_win->sslerr,
+ LabelEnd,
+ LAYOUT_AddChild, ami_cw->objects[GID_CW_DRAW] = SpaceObj,
+ GA_ID, GID_CW_DRAW,
+ SPACE_Transparent, TRUE,
+ SPACE_BevelStyle, BVS_DISPLAY,
+ GA_RelVerify, TRUE,
+ ICA_TARGET, ICTARGET_IDCMP,
+ SpaceEnd,
+ LAYOUT_AddChild, LayoutHObj,
+ LAYOUT_AddChild, crtvrfy_win->sslcert_objects[GID_SSLCERT_ACCEPT] = ButtonObj,
+ GA_ID, GID_SSLCERT_ACCEPT,
+ GA_Text, crtvrfy_win->sslaccept,
+ GA_RelVerify, TRUE,
+ ButtonEnd,
+ LAYOUT_AddChild, crtvrfy_win->sslcert_objects[GID_SSLCERT_REJECT] = ButtonObj,
+ GA_ID, GID_SSLCERT_REJECT,
+ GA_Text, crtvrfy_win->sslreject,
+ GA_RelVerify, TRUE,
+ ButtonEnd,
+ EndGroup,
+ CHILD_WeightedHeight, 0,
+ EndGroup,
+ EndWindow;
+
+ if(ami_cw->objects[GID_CW_WIN] == NULL) {
+ return NSERROR_NOMEM;
+ }
+
+ return NSERROR_OK;
}
+
+/* exported interface documented in amiga/ssl_cert.h */
+nserror ami_cert_verify(struct nsurl *url,
+ const struct ssl_cert_info *certs,
+ unsigned long num,
+ nserror (*cb)(bool proceed, void *pw),
+ void *cbpw)
+{
+ struct ami_crtvrfy_window *ncwin;
+ nserror res;
+
+ ncwin = malloc(sizeof(struct ami_crtvrfy_window));
+ if (ncwin == NULL) {
+ return NSERROR_NOMEM;
+ }
+
+ ncwin->wintitle = ami_utf8_easy((char *)messages_get("SSLCerts"));
+ ncwin->sslerr = ami_utf8_easy((char *)messages_get("SSLError"));
+ ncwin->sslaccept = ami_utf8_easy((char *)messages_get("SSL_Certificate_Accept"));
+ ncwin->sslreject = ami_utf8_easy((char *)messages_get("SSL_Certificate_Reject"));
+
+ res = ami_crtvrfy_create_window(ncwin);
+ if (res != NSERROR_OK) {
+ LOG("SSL UI builder init failed");
+ ami_utf8_free(ncwin->wintitle);
+ ami_utf8_free(ncwin->sslerr);
+ ami_utf8_free(ncwin->sslaccept);
+ ami_utf8_free(ncwin->sslreject);
+ free(ncwin);
+ return res;
+ }
+
+ /* initialise example core window */
+ ncwin->core.draw = ami_crtvrfy_draw;
+ ncwin->core.key = ami_crtvrfy_key;
+ ncwin->core.mouse = ami_crtvrfy_mouse;
+ ncwin->core.close = ami_crtvrfy_reject;
+ ncwin->core.event = ami_crtvrfy_event;
+
+ res = ami_corewindow_init(&ncwin->core);
+ if (res != NSERROR_OK) {
+ ami_utf8_free(ncwin->wintitle);
+ ami_utf8_free(ncwin->sslerr);
+ ami_utf8_free(ncwin->sslaccept);
+ ami_utf8_free(ncwin->sslreject);
+ DisposeObject(ncwin->core.objects[GID_CW_WIN]);
+ free(ncwin);
+ return res;
+ }
+
+ /* initialise certificate viewing interface */
+ res = sslcert_viewer_create_session_data(num, url, cb, cbpw, certs,
+ &ncwin->ssl_data);
+ if (res != NSERROR_OK) {
+ ami_utf8_free(ncwin->wintitle);
+ ami_utf8_free(ncwin->sslerr);
+ ami_utf8_free(ncwin->sslaccept);
+ ami_utf8_free(ncwin->sslreject);
+ DisposeObject(ncwin->core.objects[GID_CW_WIN]);
+ free(ncwin);
+ return res;
+ }
+
+ res = sslcert_viewer_init(ncwin->core.cb_table,
+ (struct core_window *)ncwin,
+ ncwin->ssl_data);
+ if (res != NSERROR_OK) {
+ ami_utf8_free(ncwin->wintitle);
+ ami_utf8_free(ncwin->sslerr);
+ ami_utf8_free(ncwin->sslaccept);
+ ami_utf8_free(ncwin->sslreject);
+ DisposeObject(ncwin->core.objects[GID_CW_WIN]);
+ free(ncwin);
+ return res;
+ }
+
+ return NSERROR_OK;
+}
+
diff --git a/frontends/amiga/sslcert.h b/frontends/amiga/sslcert.h
index 86ce9c4..4718e75 100644
--- a/frontends/amiga/sslcert.h
+++ b/frontends/amiga/sslcert.h
@@ -1,5 +1,5 @@
/*
- * Copyright 2009 Chris Young <chris(a)unsatisfactorysoftware.co.uk>
+ * Copyright 2017 Chris Young <chris(a)unsatisfactorysoftware.co.uk>
*
* This file is part of NetSurf, http://www.netsurf-browser.org/
*
@@ -18,11 +18,21 @@
#ifndef AMIGA_SSLCERT_H
#define AMIGA_SSLCERT_H
+struct nsurl;
+struct ssl_cert_info;
-nserror gui_cert_verify(nsurl *url,
+/**
+ * Prompt the user to verify a certificate with issues.
+ *
+ * \param url The URL being verified.
+ * \param certs The certificate to be verified
+ * \param num The number of certificates to be verified.
+ * \param cb Callback upon user decision.
+ * \param cbpw Context pointer passed to cb
+ * \return NSERROR_OK or error code if prompt creation failed.
+ */
+nserror ami_cert_verify(struct nsurl *url,
const struct ssl_cert_info *certs, unsigned long num,
nserror (*cb)(bool proceed, void *pw), void *cbpw);
-
-void ami_ssl_free(struct treeview_window *twin);
-
#endif
+
diff --git a/frontends/amiga/tree.c b/frontends/amiga/tree.c
index f1c5327..b9747c0 100644
--- a/frontends/amiga/tree.c
+++ b/frontends/amiga/tree.c
@@ -916,7 +916,7 @@ void ami_tree_close(void *w)
ami_utf8_free(twin->sslerr);
ami_utf8_free(twin->sslaccept);
ami_utf8_free(twin->sslreject);
- ami_ssl_free(twin);
+ //ami_ssl_free(twin);
}
if(twin->type == AMI_TREE_HOTLIST)
-----------------------------------------------------------------------
Summary of changes:
frontends/amiga/corewindow.c | 15 +-
frontends/amiga/corewindow.h | 6 +-
frontends/amiga/gui.c | 2 +-
frontends/amiga/sslcert.c | 343 +++++++++++++++++++++++++++++++++++++++---
frontends/amiga/sslcert.h | 20 ++-
frontends/amiga/tree.c | 2 +-
6 files changed, 351 insertions(+), 37 deletions(-)
diff --git a/frontends/amiga/corewindow.c b/frontends/amiga/corewindow.c
index f05d47b..5aff074 100644
--- a/frontends/amiga/corewindow.c
+++ b/frontends/amiga/corewindow.c
@@ -451,14 +451,18 @@ ami_cw_event(void *w)
default:
/* pass the event to the window owner */
if(ami_cw->event != NULL)
- ami_cw->event(ami_cw, result);
+ if(ami_cw->event(ami_cw, result) == TRUE) {
+ return TRUE;
+ }
break;
}
default:
/* pass the event to the window owner */
if(ami_cw->event != NULL)
- ami_cw->event(ami_cw, result);
+ if(ami_cw->event(ami_cw, result) == TRUE) {
+ return TRUE;
+ }
break;
}
};
@@ -603,10 +607,9 @@ nserror ami_corewindow_init(struct ami_corewindow *ami_cw)
/* 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
- SetAttrs(ami_cw->objects[GID_CW_WIN],
- WINDOW_IDCMPHook, &ami_cw->idcmp_hook,
- TAG_DONE); */
+
+ /* open the window */
+ ami_cw->win = (struct Window *)RA_OpenWindow(ami_cw->objects[GID_CW_WIN]);
/* attach the scrollbars for event processing _if they are in the window border_ */
if(ami_cw->objects[GID_CW_HSCROLL] == NULL) {
diff --git a/frontends/amiga/corewindow.h b/frontends/amiga/corewindow.h
index d8f80d3..f62987f 100644
--- a/frontends/amiga/corewindow.h
+++ b/frontends/amiga/corewindow.h
@@ -108,16 +108,16 @@ struct ami_corewindow {
*
* \param ami_cw The Amiga core window structure.
* \param result event as returned by RA_HandleInput()
- * \return NSERROR_OK on sucess otherwise apropriate error code.
+ * \return TRUE if window closed during event processing
*/
- nserror (*event)(struct ami_corewindow *ami_cw, ULONG id);
+ BOOL (*event)(struct ami_corewindow *ami_cw, ULONG result);
/**
* callback to close an Amiga core window
*
* \param ami_cw The Amiga core window structure.
*/
- nserror (*close)(struct ami_corewindow *ami_cw);
+ void (*close)(struct ami_corewindow *ami_cw);
};
diff --git a/frontends/amiga/gui.c b/frontends/amiga/gui.c
index 9499ff8..1508135 100644
--- a/frontends/amiga/gui.c
+++ b/frontends/amiga/gui.c
@@ -5610,7 +5610,7 @@ static struct gui_misc_table amiga_misc_table = {
.quit = gui_quit,
.launch_url = gui_launch_url,
- .cert_verify = gui_cert_verify,
+ .cert_verify = ami_cert_verify,
.login = gui_401login_open,
};
diff --git a/frontends/amiga/sslcert.c b/frontends/amiga/sslcert.c
index 83798f2..df0005e 100644
--- a/frontends/amiga/sslcert.c
+++ b/frontends/amiga/sslcert.c
@@ -1,5 +1,5 @@
/*
- * Copyright 2009 Chris Young <chris(a)unsatisfactorysoftware.co.uk>
+ * Copyright 2017 Chris Young <chris(a)unsatisfactorysoftware.co.uk>
*
* This file is part of NetSurf, http://www.netsurf-browser.org/
*
@@ -16,39 +16,340 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
-#include <proto/exec.h>
+/**
+ * \file
+ * Implementation of Amiga certificate viewing using core windows.
+ */
+
+#include <stdint.h>
+#include <stdlib.h>
+
+#include <proto/intuition.h>
+#include <intuition/icclass.h>
+
+#include <classes/window.h>
+#include <gadgets/button.h>
+#include <gadgets/layout.h>
+#include <gadgets/space.h>
+#include <images/label.h>
+
+#include <reaction/reaction_macros.h>
-#include "utils/nsurl.h"
-#include "content/llcache.h"
-#include "netsurf/mouse.h"
-#include "netsurf/window.h"
+#include "utils/log.h"
+#include "netsurf/keypress.h"
+#include "netsurf/plotters.h"
#include "desktop/sslcert_viewer.h"
+#include "utils/messages.h"
-#include "amiga/tree.h"
+#include "amiga/corewindow.h"
+#include "amiga/libs.h"
#include "amiga/sslcert.h"
+#include "amiga/utf8.h"
+
+
+/**
+ * Amiga certificate viewing window context
+ */
+enum {
+ GID_SSLCERT_ACCEPT = GID_CW_LAST,
+ GID_SSLCERT_REJECT,
+ GID_SSLCERT_LAST
+};
+
+#define GID_SSLCERT_SIZE GID_SSLCERT_LAST - GID_CW_LAST
+
+struct ami_crtvrfy_window {
+ /** Amiga core window context */
+ struct ami_corewindow core;
+
+ /** Amiga GUI stuff */
+ Object *sslcert_objects[GID_SSLCERT_LAST]; // technically wasting a few bytes here
+
+ char *wintitle;
+ char *sslerr;
+ char *sslaccept;
+ char *sslreject;
+
+ /** SSL certificate viewer context data */
+ struct sslcert_session_data *ssl_data;
+};
+
+/**
+ * destroy a previously created certificate view
+ */
+static nserror
+ami_crtvrfy_destroy(struct ami_crtvrfy_window *crtvrfy_win)
+{
+ nserror res;
+
+ res = sslcert_viewer_fini(crtvrfy_win->ssl_data);
+ if (res == NSERROR_OK) {
+ res = ami_corewindow_fini(&crtvrfy_win->core); /* closes the window for us */
+ ami_utf8_free(crtvrfy_win->wintitle);
+ ami_utf8_free(crtvrfy_win->sslerr);
+ ami_utf8_free(crtvrfy_win->sslaccept);
+ ami_utf8_free(crtvrfy_win->sslreject);
+ free(crtvrfy_win);
+ }
+ return res;
+}
-nserror gui_cert_verify(nsurl *url,
- const struct ssl_cert_info *certs, unsigned long num,
- nserror (*cb)(bool proceed, void *pw), void *cbpw)
+static void
+ami_crtvrfy_accept(struct ami_corewindow *ami_cw)
{
- struct sslcert_session_data *data;
- struct treeview_window *ssl_window;
+ struct ami_crtvrfy_window *crtvrfy_win;
+ /* technically degenerate container of */
+ crtvrfy_win = (struct ami_crtvrfy_window *)ami_cw;
- sslcert_viewer_create_session_data(num, url, cb, cbpw,
- certs, &data);
- ssl_current_session = data;
+ sslcert_viewer_accept(crtvrfy_win->ssl_data);
- ssl_window = ami_tree_create(TREE_SSLCERT, data);
- if (!ssl_window) {
- return NSERROR_INIT_FAILED;
+ ami_crtvrfy_destroy(crtvrfy_win);
+}
+
+static void
+ami_crtvrfy_reject(struct ami_corewindow *ami_cw)
+{
+ struct ami_crtvrfy_window *crtvrfy_win;
+ /* technically degenerate container of */
+ crtvrfy_win = (struct ami_crtvrfy_window *)ami_cw;
+
+ sslcert_viewer_reject(crtvrfy_win->ssl_data);
+
+ ami_crtvrfy_destroy(crtvrfy_win);
+}
+
+/**
+ * callback for unknown events on Amiga core window
+ * eg. buttons in the ssl cert window
+ * (result & WMHI_CLASSMASK) gives the class of event (eg. WMHI_GADGETUP)
+ * (result & WMHI_GADGETMASK) gives the gadget ID (eg. GID_SSLCERT_ACCEPT)
+ *
+ * \param ami_cw The Amiga core window structure.
+ * \param result event as returned by RA_HandleInput()
+ * \return TRUE if window closed during event processing
+ */
+static BOOL
+ami_crtvrfy_event(struct ami_corewindow *ami_cw, ULONG result)
+{
+ if((result & WMHI_CLASSMASK) == WMHI_GADGETUP) {
+ switch(result & WMHI_GADGETMASK) {
+ case GID_SSLCERT_ACCEPT:
+ ami_crtvrfy_accept(ami_cw);
+ return TRUE;
+ break;
+
+ case GID_SSLCERT_REJECT:
+ ami_crtvrfy_reject(ami_cw);
+ return TRUE;
+ break;
+ }
}
+ return FALSE;
+}
- ami_tree_open(ssl_window, AMI_TREE_SSLCERT);
+/**
+ * callback for mouse action for certificate verify on core window
+ *
+ * \param ami_cw The Amiga core window structure.
+ * \param mouse_state netsurf mouse state on event
+ * \param x location of event
+ * \param y location of event
+ * \return NSERROR_OK on success otherwise apropriate error code
+ */
+static nserror
+ami_crtvrfy_mouse(struct ami_corewindow *ami_cw,
+ browser_mouse_state mouse_state,
+ int x, int y)
+{
+ struct ami_crtvrfy_window *crtvrfy_win;
+ /* technically degenerate container of */
+ crtvrfy_win = (struct ami_crtvrfy_window *)ami_cw;
+
+ sslcert_viewer_mouse_action(crtvrfy_win->ssl_data, mouse_state, x, y);
return NSERROR_OK;
}
-void ami_ssl_free(struct treeview_window *twin)
+/**
+ * callback for keypress for certificate verify on core window
+ *
+ * \param example_cw The Amiga core window structure.
+ * \param nskey The netsurf key code
+ * \return NSERROR_OK on success otherwise apropriate error code
+ */
+static nserror
+ami_crtvrfy_key(struct ami_corewindow *ami_cw, uint32_t nskey)
{
- ami_tree_destroy(twin);
+ struct ami_crtvrfy_window *crtvrfy_win;
+
+ /* technically degenerate container of */
+ crtvrfy_win = (struct ami_crtvrfy_window *)ami_cw;
+
+ if (sslcert_viewer_keypress(crtvrfy_win->ssl_data, nskey)) {
+ return NSERROR_OK;
+ }
+ return NSERROR_NOT_IMPLEMENTED;
+}
+
+/**
+ * callback on draw event for certificate verify on core window
+ *
+ * \param ami_cw The Amiga core window structure.
+ * \param r The rectangle of the window that needs updating.
+ * \param ctx The drawing context
+ * \return NSERROR_OK on success otherwise apropriate error code
+ */
+static nserror
+ami_crtvrfy_draw(struct ami_corewindow *ami_cw, struct rect *r, struct redraw_context *ctx)
+{
+ struct ami_crtvrfy_window *crtvrfy_win;
+
+ /* technically degenerate container of */
+ crtvrfy_win = (struct ami_crtvrfy_window *)ami_cw;
+
+ sslcert_viewer_redraw(crtvrfy_win->ssl_data, 0, 0, r, ctx);
+
+ return NSERROR_OK;
+}
+
+static nserror
+ami_crtvrfy_create_window(struct ami_crtvrfy_window *crtvrfy_win)
+{
+ struct ami_corewindow *ami_cw = (struct ami_corewindow *)&crtvrfy_win->core;
+
+ ami_cw->objects[GID_CW_WIN] = WindowObj,
+ WA_ScreenTitle, ami_gui_get_screen_title(),
+ WA_Title, crtvrfy_win->wintitle,
+ WA_Activate, TRUE,
+ WA_DepthGadget, TRUE,
+ WA_DragBar, TRUE,
+ WA_CloseGadget, TRUE,
+ WA_SizeGadget, TRUE,
+ WA_SizeBRight, TRUE,
+ WA_Height, scrn->Height / 2,
+ WA_PubScreen, scrn,
+ WA_ReportMouse, TRUE,
+ WA_IDCMP, IDCMP_MOUSEMOVE | IDCMP_MOUSEBUTTONS | IDCMP_NEWSIZE |
+ IDCMP_RAWKEY | IDCMP_GADGETUP | IDCMP_IDCMPUPDATE |
+ IDCMP_EXTENDEDMOUSE | IDCMP_SIZEVERIFY,
+ WINDOW_HorizProp, 1,
+ WINDOW_VertProp, 1,
+ WINDOW_IDCMPHook, &ami_cw->idcmp_hook,
+ WINDOW_IDCMPHookBits, IDCMP_IDCMPUPDATE | IDCMP_EXTENDEDMOUSE,
+ WINDOW_SharedPort, sport,
+ WINDOW_UserData, crtvrfy_win,
+ /* WINDOW_NewMenu, twin->menu, -> No menu for SSL Cert */
+ WINDOW_IconifyGadget, FALSE,
+ WINDOW_Position, WPOS_CENTERSCREEN,
+ WINDOW_ParentGroup, ami_cw->objects[GID_CW_MAIN] = LayoutVObj,
+ LAYOUT_AddImage, LabelObj,
+ LABEL_Text, crtvrfy_win->sslerr,
+ LabelEnd,
+ LAYOUT_AddChild, ami_cw->objects[GID_CW_DRAW] = SpaceObj,
+ GA_ID, GID_CW_DRAW,
+ SPACE_Transparent, TRUE,
+ SPACE_BevelStyle, BVS_DISPLAY,
+ GA_RelVerify, TRUE,
+ ICA_TARGET, ICTARGET_IDCMP,
+ SpaceEnd,
+ LAYOUT_AddChild, LayoutHObj,
+ LAYOUT_AddChild, crtvrfy_win->sslcert_objects[GID_SSLCERT_ACCEPT] = ButtonObj,
+ GA_ID, GID_SSLCERT_ACCEPT,
+ GA_Text, crtvrfy_win->sslaccept,
+ GA_RelVerify, TRUE,
+ ButtonEnd,
+ LAYOUT_AddChild, crtvrfy_win->sslcert_objects[GID_SSLCERT_REJECT] = ButtonObj,
+ GA_ID, GID_SSLCERT_REJECT,
+ GA_Text, crtvrfy_win->sslreject,
+ GA_RelVerify, TRUE,
+ ButtonEnd,
+ EndGroup,
+ CHILD_WeightedHeight, 0,
+ EndGroup,
+ EndWindow;
+
+ if(ami_cw->objects[GID_CW_WIN] == NULL) {
+ return NSERROR_NOMEM;
+ }
+
+ return NSERROR_OK;
}
+
+/* exported interface documented in amiga/ssl_cert.h */
+nserror ami_cert_verify(struct nsurl *url,
+ const struct ssl_cert_info *certs,
+ unsigned long num,
+ nserror (*cb)(bool proceed, void *pw),
+ void *cbpw)
+{
+ struct ami_crtvrfy_window *ncwin;
+ nserror res;
+
+ ncwin = malloc(sizeof(struct ami_crtvrfy_window));
+ if (ncwin == NULL) {
+ return NSERROR_NOMEM;
+ }
+
+ ncwin->wintitle = ami_utf8_easy((char *)messages_get("SSLCerts"));
+ ncwin->sslerr = ami_utf8_easy((char *)messages_get("SSLError"));
+ ncwin->sslaccept = ami_utf8_easy((char *)messages_get("SSL_Certificate_Accept"));
+ ncwin->sslreject = ami_utf8_easy((char *)messages_get("SSL_Certificate_Reject"));
+
+ res = ami_crtvrfy_create_window(ncwin);
+ if (res != NSERROR_OK) {
+ LOG("SSL UI builder init failed");
+ ami_utf8_free(ncwin->wintitle);
+ ami_utf8_free(ncwin->sslerr);
+ ami_utf8_free(ncwin->sslaccept);
+ ami_utf8_free(ncwin->sslreject);
+ free(ncwin);
+ return res;
+ }
+
+ /* initialise example core window */
+ ncwin->core.draw = ami_crtvrfy_draw;
+ ncwin->core.key = ami_crtvrfy_key;
+ ncwin->core.mouse = ami_crtvrfy_mouse;
+ ncwin->core.close = ami_crtvrfy_reject;
+ ncwin->core.event = ami_crtvrfy_event;
+
+ res = ami_corewindow_init(&ncwin->core);
+ if (res != NSERROR_OK) {
+ ami_utf8_free(ncwin->wintitle);
+ ami_utf8_free(ncwin->sslerr);
+ ami_utf8_free(ncwin->sslaccept);
+ ami_utf8_free(ncwin->sslreject);
+ DisposeObject(ncwin->core.objects[GID_CW_WIN]);
+ free(ncwin);
+ return res;
+ }
+
+ /* initialise certificate viewing interface */
+ res = sslcert_viewer_create_session_data(num, url, cb, cbpw, certs,
+ &ncwin->ssl_data);
+ if (res != NSERROR_OK) {
+ ami_utf8_free(ncwin->wintitle);
+ ami_utf8_free(ncwin->sslerr);
+ ami_utf8_free(ncwin->sslaccept);
+ ami_utf8_free(ncwin->sslreject);
+ DisposeObject(ncwin->core.objects[GID_CW_WIN]);
+ free(ncwin);
+ return res;
+ }
+
+ res = sslcert_viewer_init(ncwin->core.cb_table,
+ (struct core_window *)ncwin,
+ ncwin->ssl_data);
+ if (res != NSERROR_OK) {
+ ami_utf8_free(ncwin->wintitle);
+ ami_utf8_free(ncwin->sslerr);
+ ami_utf8_free(ncwin->sslaccept);
+ ami_utf8_free(ncwin->sslreject);
+ DisposeObject(ncwin->core.objects[GID_CW_WIN]);
+ free(ncwin);
+ return res;
+ }
+
+ return NSERROR_OK;
+}
+
diff --git a/frontends/amiga/sslcert.h b/frontends/amiga/sslcert.h
index 86ce9c4..4718e75 100644
--- a/frontends/amiga/sslcert.h
+++ b/frontends/amiga/sslcert.h
@@ -1,5 +1,5 @@
/*
- * Copyright 2009 Chris Young <chris(a)unsatisfactorysoftware.co.uk>
+ * Copyright 2017 Chris Young <chris(a)unsatisfactorysoftware.co.uk>
*
* This file is part of NetSurf, http://www.netsurf-browser.org/
*
@@ -18,11 +18,21 @@
#ifndef AMIGA_SSLCERT_H
#define AMIGA_SSLCERT_H
+struct nsurl;
+struct ssl_cert_info;
-nserror gui_cert_verify(nsurl *url,
+/**
+ * Prompt the user to verify a certificate with issues.
+ *
+ * \param url The URL being verified.
+ * \param certs The certificate to be verified
+ * \param num The number of certificates to be verified.
+ * \param cb Callback upon user decision.
+ * \param cbpw Context pointer passed to cb
+ * \return NSERROR_OK or error code if prompt creation failed.
+ */
+nserror ami_cert_verify(struct nsurl *url,
const struct ssl_cert_info *certs, unsigned long num,
nserror (*cb)(bool proceed, void *pw), void *cbpw);
-
-void ami_ssl_free(struct treeview_window *twin);
-
#endif
+
diff --git a/frontends/amiga/tree.c b/frontends/amiga/tree.c
index f1c5327..b9747c0 100644
--- a/frontends/amiga/tree.c
+++ b/frontends/amiga/tree.c
@@ -916,7 +916,7 @@ void ami_tree_close(void *w)
ami_utf8_free(twin->sslerr);
ami_utf8_free(twin->sslaccept);
ami_utf8_free(twin->sslreject);
- ami_ssl_free(twin);
+ //ami_ssl_free(twin);
}
if(twin->type == AMI_TREE_HOTLIST)
--
NetSurf Browser
6 years, 8 months
packaging/debian: branch master updated. release/3.6-3-2-g3d81cf0
by NetSurf Browser Project
Gitweb links:
...log http://git.netsurf-browser.org/packaging/debian.git/shortlog/3d81cf04656d...
...commit http://git.netsurf-browser.org/packaging/debian.git/commit/3d81cf04656d90...
...tree http://git.netsurf-browser.org/packaging/debian.git/tree/3d81cf04656d9047...
The branch, master has been updated
via 3d81cf04656d904755fc09ef12b3a9b5cd453baf (commit)
via 844642bc8c66fc95ed4d11aa7907c5c4cd576565 (commit)
from 7c77c3f661be0c8fe15358f44b1cb974bf172941 (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
commitdiff http://git.netsurf-browser.org/packaging/debian.git/commit/?id=3d81cf0465...
commit 3d81cf04656d904755fc09ef12b3a9b5cd453baf
Author: Vincent Sanders <vince(a)kyllikki.org>
Commit: Vincent Sanders <vince(a)kyllikki.org>
add framebuffer font recommendation
diff --git a/changelog b/changelog
index 199b979..39b5cea 100644
--- a/changelog
+++ b/changelog
@@ -1,6 +1,7 @@
netsurf (3.6-4) UNRELEASED; urgency=medium
* Make png generation reproducible.
+ * Add font recommend dependancy for framebuffer edition
-- Vincent Sanders <vince(a)debian.org> Mon, 02 Jan 2017 11:55:26 +0000
diff --git a/control b/control
index 7c55ac2..7852c1f 100644
--- a/control
+++ b/control
@@ -38,7 +38,7 @@ Package: netsurf-fb
Architecture: any
Depends: ${shlibs:Depends}, ${misc:Depends}, netsurf-common (=${source:Version})
Provides: www-browser
-Recommends: mime-support
+Recommends: mime-support fonts-dejavu
Description: small web browser with CSS support for framebuffers
NetSurf is a multi-platform lightweight web browser. It aims to provide
comprehensive rendering of HTML 5 with CSS 2 in a small resource footprint
commitdiff http://git.netsurf-browser.org/packaging/debian.git/commit/?id=844642bc8c...
commit 844642bc8c66fc95ed4d11aa7907c5c4cd576565
Author: Vincent Sanders <vince(a)kyllikki.org>
Commit: Vincent Sanders <vince(a)kyllikki.org>
allow package png generation to be reproducable
diff --git a/changelog b/changelog
index ae4ef89..199b979 100644
--- a/changelog
+++ b/changelog
@@ -1,3 +1,9 @@
+netsurf (3.6-4) UNRELEASED; urgency=medium
+
+ * Make png generation reproducible.
+
+ -- Vincent Sanders <vince(a)debian.org> Mon, 02 Jan 2017 11:55:26 +0000
+
netsurf (3.6-3) unstable; urgency=medium
* Apply upstream patch fixing nsgenbind on BE architectures
diff --git a/rules b/rules
index 366c6c8..49c27e9 100755
--- a/rules
+++ b/rules
@@ -20,7 +20,7 @@ override_dh_auto_install:
mkdir -p debian/netsurf-gtk/usr/share/pixmaps
mkdir -p debian/netsurf-gtk/usr/share/applications
convert netsurf/frontends/gtk/res/netsurf.xpm -resize \!32x\!32 debian/netsurf-gtk/usr/share/pixmaps/netsurf.xpm
- convert netsurf/frontends/gtk/res/netsurf.xpm debian/netsurf-gtk/usr/share/pixmaps/netsurf.png
+ convert netsurf/frontends/gtk/res/netsurf.xpm +set date:create +set date:modify -define png:exclude-chunk=time debian/netsurf-gtk/usr/share/pixmaps/netsurf.png
install -m 644 debian/netsurf-gtk.desktop debian/netsurf-gtk/usr/share/applications
dh_auto_install -- PREFIX=/usr TARGET=framebuffer
rm debian/tmp/usr/share/netsurf/ca-bundle.txt
-----------------------------------------------------------------------
Summary of changes:
changelog | 7 +++++++
control | 2 +-
rules | 2 +-
3 files changed, 9 insertions(+), 2 deletions(-)
diff --git a/changelog b/changelog
index ae4ef89..39b5cea 100644
--- a/changelog
+++ b/changelog
@@ -1,3 +1,10 @@
+netsurf (3.6-4) UNRELEASED; urgency=medium
+
+ * Make png generation reproducible.
+ * Add font recommend dependancy for framebuffer edition
+
+ -- Vincent Sanders <vince(a)debian.org> Mon, 02 Jan 2017 11:55:26 +0000
+
netsurf (3.6-3) unstable; urgency=medium
* Apply upstream patch fixing nsgenbind on BE architectures
diff --git a/control b/control
index 7c55ac2..7852c1f 100644
--- a/control
+++ b/control
@@ -38,7 +38,7 @@ Package: netsurf-fb
Architecture: any
Depends: ${shlibs:Depends}, ${misc:Depends}, netsurf-common (=${source:Version})
Provides: www-browser
-Recommends: mime-support
+Recommends: mime-support fonts-dejavu
Description: small web browser with CSS support for framebuffers
NetSurf is a multi-platform lightweight web browser. It aims to provide
comprehensive rendering of HTML 5 with CSS 2 in a small resource footprint
diff --git a/rules b/rules
index 366c6c8..49c27e9 100755
--- a/rules
+++ b/rules
@@ -20,7 +20,7 @@ override_dh_auto_install:
mkdir -p debian/netsurf-gtk/usr/share/pixmaps
mkdir -p debian/netsurf-gtk/usr/share/applications
convert netsurf/frontends/gtk/res/netsurf.xpm -resize \!32x\!32 debian/netsurf-gtk/usr/share/pixmaps/netsurf.xpm
- convert netsurf/frontends/gtk/res/netsurf.xpm debian/netsurf-gtk/usr/share/pixmaps/netsurf.png
+ convert netsurf/frontends/gtk/res/netsurf.xpm +set date:create +set date:modify -define png:exclude-chunk=time debian/netsurf-gtk/usr/share/pixmaps/netsurf.png
install -m 644 debian/netsurf-gtk.desktop debian/netsurf-gtk/usr/share/applications
dh_auto_install -- PREFIX=/usr TARGET=framebuffer
rm debian/tmp/usr/share/netsurf/ca-bundle.txt
--
Debian Packaging for NetSurf
6 years, 8 months
netsurf: branch master updated. release/3.6-142-ga5222b5
by NetSurf Browser Project
Gitweb links:
...log http://git.netsurf-browser.org/netsurf.git/shortlog/a5222b579b8202f130e0a...
...commit http://git.netsurf-browser.org/netsurf.git/commit/a5222b579b8202f130e0afc...
...tree http://git.netsurf-browser.org/netsurf.git/tree/a5222b579b8202f130e0afceb...
The branch, master has been updated
via a5222b579b8202f130e0afceb570b6e700385efe (commit)
via e3b2f792c0250d219dc56976f8305a05b6b04e36 (commit)
via 24b7fdf4382dcef274092b4735093fc390815455 (commit)
from bb2341898113f37936832c8828bd515c3e3860c9 (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
commitdiff http://git.netsurf-browser.org/netsurf.git/commit/?id=a5222b579b8202f130e...
commit a5222b579b8202f130e0afceb570b6e700385efe
Author: Michael Drake <tlsa(a)netsurf-browser.org>
Commit: Michael Drake <tlsa(a)netsurf-browser.org>
Windows: Fix font table to return nserror.
We were returning true on success, which when the return value was
tested for being NSERROR_OK (0), meant it was treated as failure.
Now we correctly return NSERROR_OK on success.
diff --git a/frontends/windows/font.c b/frontends/windows/font.c
index 551a0eb..1e99a78 100644
--- a/frontends/windows/font.c
+++ b/frontends/windows/font.c
@@ -138,7 +138,7 @@ HFONT get_font(const plot_font_style_t *style)
* \param[in] string UTF-8 string to measure
* \param[in] length length of string, in bytes
* \param[out] width updated to width of string[0..length)
- * \return true on success and width updated else false
+ * \return NSERROR_OK on success otherwise apropriate error code
*/
static nserror
win32_font_width(const plot_font_style_t *style,
@@ -150,7 +150,7 @@ win32_font_width(const plot_font_style_t *style,
HFONT font;
HFONT fontbak;
SIZE s;
- bool ret = true;
+ nserror ret = NSERROR_OK;
if (length == 0) {
*width = 0;
@@ -163,7 +163,7 @@ win32_font_width(const plot_font_style_t *style,
if (GetTextExtentPoint32A(hdc, string, length, &s) != 0) {
*width = s.cx;
} else {
- ret = false;
+ ret = NSERROR_UNKNOWN;
}
font = SelectObject(hdc, fontbak);
DeleteObject(font);
@@ -183,7 +183,7 @@ win32_font_width(const plot_font_style_t *style,
* \param x x coordinate to search for
* \param char_offset updated to offset in string of actual_x, [0..length]
* \param actual_x updated to x coordinate of character closest to x
- * \return true on success, false on error and error reported
+ * \return NSERROR_OK on success otherwise apropriate error code
*/
static nserror
win32_font_position(const plot_font_style_t *style,
@@ -198,7 +198,7 @@ win32_font_position(const plot_font_style_t *style,
HFONT fontbak;
SIZE s;
int offset;
- bool ret = true;
+ nserror ret = NSERROR_OK;
if ((length == 0) || (x < 1)) {
*char_offset = 0;
@@ -213,7 +213,7 @@ win32_font_position(const plot_font_style_t *style,
*char_offset = (size_t)offset;
*actual_x = s.cx;
} else {
- ret = false;
+ ret = NSERROR_UNKNOWN;
}
font = SelectObject(hdc, fontbak);
DeleteObject(font);
@@ -234,7 +234,7 @@ win32_font_position(const plot_font_style_t *style,
* \param x width available
* \param char_offset updated to offset in string of actual_x, [0..length]
* \param actual_x updated to x coordinate of character closest to x
- * \return true on success, false on error and error reported
+ * \return NSERROR_OK on success otherwise apropriate error code
*
* On exit, [char_offset == 0 ||
* string[char_offset] == ' ' ||
@@ -249,13 +249,14 @@ win32_font_split(const plot_font_style_t *style,
int *actual_x)
{
int c_off;
- bool ret = false;
+ nserror ret = NSERROR_UNKNOWN;
if (win32_font_position(style, string, length, x, char_offset, actual_x)) {
c_off = *char_offset;
if (*char_offset == length) {
- ret = true;
+ ret = NSERROR_OK;
} else {
+ bool success;
while ((string[*char_offset] != ' ') &&
(*char_offset > 0)) {
(*char_offset)--;
@@ -269,7 +270,10 @@ win32_font_split(const plot_font_style_t *style,
}
}
- ret = win32_font_width(style, string, *char_offset, actual_x);
+ success = win32_font_width(style, string, *char_offset, actual_x);
+ if (success) {
+ ret = NSERROR_OK;
+ }
}
}
commitdiff http://git.netsurf-browser.org/netsurf.git/commit/?id=e3b2f792c0250d219dc...
commit e3b2f792c0250d219dc56976f8305a05b6b04e36
Author: Michael Drake <tlsa(a)netsurf-browser.org>
Commit: Michael Drake <tlsa(a)netsurf-browser.org>
Framebuffer: Fix internal font table to return nserror.
We were returning true on success, which when the return value was
tested for being NSERROR_OK (0), meant it was treated as failure.
Now we correctly return NSERROR_OK on success.
diff --git a/frontends/framebuffer/font_internal.c b/frontends/framebuffer/font_internal.c
index 9164a29..3fd3ac6 100644
--- a/frontends/framebuffer/font_internal.c
+++ b/frontends/framebuffer/font_internal.c
@@ -364,7 +364,7 @@ fb_font_width(const plot_font_style_t *fstyle,
}
*width *= fb_get_font_size(fstyle);
- return true;
+ return NSERROR_OK;
}
@@ -397,7 +397,7 @@ fb_font_position(const plot_font_style_t *fstyle,
*actual_x = x_pos;
*char_offset = nxtchr;
- return true;
+ return NSERROR_OK;
}
@@ -455,7 +455,7 @@ fb_font_split(const plot_font_style_t *fstyle,
* found a space; return previous space */
*actual_x = last_space_x;
*char_offset = last_space_idx;
- return true;
+ return NSERROR_OK;
}
nxtchr = utf8_next(string, length, nxtchr);
@@ -463,7 +463,7 @@ fb_font_split(const plot_font_style_t *fstyle,
*char_offset = nxtchr;
- return true;
+ return NSERROR_OK;
}
commitdiff http://git.netsurf-browser.org/netsurf.git/commit/?id=24b7fdf4382dcef2740...
commit 24b7fdf4382dcef274092b4735093fc390815455
Author: Michael Drake <tlsa(a)netsurf-browser.org>
Commit: Michael Drake <tlsa(a)netsurf-browser.org>
Framebuffer: Fix freetype font table to return nserror.
We were returning true on success, which when the return value was
tested for being NSERROR_OK (0), meant it was treated as failure.
Now we correctly return NSERROR_OK on success.
diff --git a/frontends/framebuffer/font_freetype.c b/frontends/framebuffer/font_freetype.c
index 9235ad4..3239820 100644
--- a/frontends/framebuffer/font_freetype.c
+++ b/frontends/framebuffer/font_freetype.c
@@ -444,8 +444,7 @@ fb_font_width(const plot_font_style_t *fstyle,
*width += glyph->advance.x >> 16;
}
-
- return true;
+ return NSERROR_OK;
}
@@ -481,7 +480,7 @@ fb_font_position(const plot_font_style_t *fstyle,
*actual_x = prev_x;
*char_offset = nxtchr;
- return true;
+ return NSERROR_OK;
}
@@ -537,7 +536,7 @@ fb_font_split(const plot_font_style_t *fstyle,
* found a space; return previous space */
*actual_x = last_space_x;
*char_offset = last_space_idx;
- return true;
+ return NSERROR_OK;
}
nxtchr = utf8_next(string, length, nxtchr);
@@ -545,7 +544,7 @@ fb_font_split(const plot_font_style_t *fstyle,
*char_offset = nxtchr;
- return true;
+ return NSERROR_OK;
}
static struct gui_layout_table layout_table = {
-----------------------------------------------------------------------
Summary of changes:
frontends/framebuffer/font_freetype.c | 9 ++++-----
frontends/framebuffer/font_internal.c | 8 ++++----
frontends/windows/font.c | 24 ++++++++++++++----------
3 files changed, 22 insertions(+), 19 deletions(-)
diff --git a/frontends/framebuffer/font_freetype.c b/frontends/framebuffer/font_freetype.c
index 9235ad4..3239820 100644
--- a/frontends/framebuffer/font_freetype.c
+++ b/frontends/framebuffer/font_freetype.c
@@ -444,8 +444,7 @@ fb_font_width(const plot_font_style_t *fstyle,
*width += glyph->advance.x >> 16;
}
-
- return true;
+ return NSERROR_OK;
}
@@ -481,7 +480,7 @@ fb_font_position(const plot_font_style_t *fstyle,
*actual_x = prev_x;
*char_offset = nxtchr;
- return true;
+ return NSERROR_OK;
}
@@ -537,7 +536,7 @@ fb_font_split(const plot_font_style_t *fstyle,
* found a space; return previous space */
*actual_x = last_space_x;
*char_offset = last_space_idx;
- return true;
+ return NSERROR_OK;
}
nxtchr = utf8_next(string, length, nxtchr);
@@ -545,7 +544,7 @@ fb_font_split(const plot_font_style_t *fstyle,
*char_offset = nxtchr;
- return true;
+ return NSERROR_OK;
}
static struct gui_layout_table layout_table = {
diff --git a/frontends/framebuffer/font_internal.c b/frontends/framebuffer/font_internal.c
index 9164a29..3fd3ac6 100644
--- a/frontends/framebuffer/font_internal.c
+++ b/frontends/framebuffer/font_internal.c
@@ -364,7 +364,7 @@ fb_font_width(const plot_font_style_t *fstyle,
}
*width *= fb_get_font_size(fstyle);
- return true;
+ return NSERROR_OK;
}
@@ -397,7 +397,7 @@ fb_font_position(const plot_font_style_t *fstyle,
*actual_x = x_pos;
*char_offset = nxtchr;
- return true;
+ return NSERROR_OK;
}
@@ -455,7 +455,7 @@ fb_font_split(const plot_font_style_t *fstyle,
* found a space; return previous space */
*actual_x = last_space_x;
*char_offset = last_space_idx;
- return true;
+ return NSERROR_OK;
}
nxtchr = utf8_next(string, length, nxtchr);
@@ -463,7 +463,7 @@ fb_font_split(const plot_font_style_t *fstyle,
*char_offset = nxtchr;
- return true;
+ return NSERROR_OK;
}
diff --git a/frontends/windows/font.c b/frontends/windows/font.c
index 551a0eb..1e99a78 100644
--- a/frontends/windows/font.c
+++ b/frontends/windows/font.c
@@ -138,7 +138,7 @@ HFONT get_font(const plot_font_style_t *style)
* \param[in] string UTF-8 string to measure
* \param[in] length length of string, in bytes
* \param[out] width updated to width of string[0..length)
- * \return true on success and width updated else false
+ * \return NSERROR_OK on success otherwise apropriate error code
*/
static nserror
win32_font_width(const plot_font_style_t *style,
@@ -150,7 +150,7 @@ win32_font_width(const plot_font_style_t *style,
HFONT font;
HFONT fontbak;
SIZE s;
- bool ret = true;
+ nserror ret = NSERROR_OK;
if (length == 0) {
*width = 0;
@@ -163,7 +163,7 @@ win32_font_width(const plot_font_style_t *style,
if (GetTextExtentPoint32A(hdc, string, length, &s) != 0) {
*width = s.cx;
} else {
- ret = false;
+ ret = NSERROR_UNKNOWN;
}
font = SelectObject(hdc, fontbak);
DeleteObject(font);
@@ -183,7 +183,7 @@ win32_font_width(const plot_font_style_t *style,
* \param x x coordinate to search for
* \param char_offset updated to offset in string of actual_x, [0..length]
* \param actual_x updated to x coordinate of character closest to x
- * \return true on success, false on error and error reported
+ * \return NSERROR_OK on success otherwise apropriate error code
*/
static nserror
win32_font_position(const plot_font_style_t *style,
@@ -198,7 +198,7 @@ win32_font_position(const plot_font_style_t *style,
HFONT fontbak;
SIZE s;
int offset;
- bool ret = true;
+ nserror ret = NSERROR_OK;
if ((length == 0) || (x < 1)) {
*char_offset = 0;
@@ -213,7 +213,7 @@ win32_font_position(const plot_font_style_t *style,
*char_offset = (size_t)offset;
*actual_x = s.cx;
} else {
- ret = false;
+ ret = NSERROR_UNKNOWN;
}
font = SelectObject(hdc, fontbak);
DeleteObject(font);
@@ -234,7 +234,7 @@ win32_font_position(const plot_font_style_t *style,
* \param x width available
* \param char_offset updated to offset in string of actual_x, [0..length]
* \param actual_x updated to x coordinate of character closest to x
- * \return true on success, false on error and error reported
+ * \return NSERROR_OK on success otherwise apropriate error code
*
* On exit, [char_offset == 0 ||
* string[char_offset] == ' ' ||
@@ -249,13 +249,14 @@ win32_font_split(const plot_font_style_t *style,
int *actual_x)
{
int c_off;
- bool ret = false;
+ nserror ret = NSERROR_UNKNOWN;
if (win32_font_position(style, string, length, x, char_offset, actual_x)) {
c_off = *char_offset;
if (*char_offset == length) {
- ret = true;
+ ret = NSERROR_OK;
} else {
+ bool success;
while ((string[*char_offset] != ' ') &&
(*char_offset > 0)) {
(*char_offset)--;
@@ -269,7 +270,10 @@ win32_font_split(const plot_font_style_t *style,
}
}
- ret = win32_font_width(style, string, *char_offset, actual_x);
+ success = win32_font_width(style, string, *char_offset, actual_x);
+ if (success) {
+ ret = NSERROR_OK;
+ }
}
}
--
NetSurf Browser
6 years, 8 months
netsurf: branch chris/amiga-corewindow created. release/3.6-145-gdab118b
by NetSurf Browser Project
Gitweb links:
...log http://git.netsurf-browser.org/netsurf.git/shortlog/dab118b6f7e9a22ed0141...
...commit http://git.netsurf-browser.org/netsurf.git/commit/dab118b6f7e9a22ed01413a...
...tree http://git.netsurf-browser.org/netsurf.git/tree/dab118b6f7e9a22ed01413a2c...
The branch, chris/amiga-corewindow has been created
at dab118b6f7e9a22ed01413a2ce2fd60e4c4df97b (commit)
- Log -----------------------------------------------------------------
commitdiff http://git.netsurf-browser.org/netsurf.git/commit/?id=dab118b6f7e9a22ed01...
commit dab118b6f7e9a22ed01413a2ce2fd60e4c4df97b
Author: Chris Young <chris(a)unsatisfactorysoftware.co.uk>
Commit: Chris Young <chris(a)unsatisfactorysoftware.co.uk>
Amga core window redraw
This almost certainly will not work properly
diff --git a/frontends/amiga/corewindow.c b/frontends/amiga/corewindow.c
index 3e2757e..f05d47b 100644
--- a/frontends/amiga/corewindow.c
+++ b/frontends/amiga/corewindow.c
@@ -45,6 +45,7 @@
#include "netsurf/mouse.h"
#include "desktop/plot_style.h"
+#include <proto/exec.h>
#include <proto/intuition.h>
#include <proto/utility.h>
@@ -55,8 +56,31 @@
#include <reaction/reaction_macros.h>
#include "amiga/corewindow.h"
+#include "amiga/memory.h"
#include "amiga/misc.h"
#include "amiga/object.h"
+#include "amiga/schedule.h"
+
+/**
+ * Convert co-ordinates relative to space.gadget
+ * into document co-ordinates
+ *
+ * @param ami_cw core window
+ * @param x co-ordinate, will be updated to new x co-ordinate
+ * @param y co-ordinate, will be updated to new y co-ordinate
+ */
+static void
+ami_cw_coord_amiga_to_ns(struct ami_corewindow *ami_cw, int *restrict x, int *restrict y)
+{
+ ULONG xs, ys;
+
+ GetAttr(SCROLLER_Top, ami_cw->objects[GID_CW_HSCROLL], (ULONG *)&xs);
+ GetAttr(SCROLLER_Top, ami_cw->objects[GID_CW_VSCROLL], (ULONG *)&ys);
+
+ *x = *x + xs;
+ *y = *y + ys;
+}
+
/* get current mouse position in the draw area, adjusted for scroll.
* only works during OM_NOTIFY! at other times use last stored posn
@@ -64,16 +88,15 @@
static void
ami_cw_mouse_pos(struct ami_corewindow *ami_cw, int *restrict x, int *restrict y)
{
- ULONG xs, ys;
ULONG xm, ym;
- GetAttr(SCROLLER_Top, ami_cw->objects[GID_CW_HSCROLL], (ULONG *)&xs);
- GetAttr(SCROLLER_Top, ami_cw->objects[GID_CW_VSCROLL], (ULONG *)&ys);
GetAttr(SPACE_MouseX, ami_cw->objects[GID_CW_DRAW], (ULONG *)&xm);
GetAttr(SPACE_MouseY, ami_cw->objects[GID_CW_DRAW], (ULONG *)&ym);
- ami_cw->mouse_x = xm + xs;
- ami_cw->mouse_y = ym + ys;
+ ami_cw_coord_amiga_to_ns(ami_cw, (int *)&xm, (int *)&ym);
+
+ ami_cw->mouse_x = xm;
+ ami_cw->mouse_y = ym;
*x = ami_cw->mouse_x;
*y = ami_cw->mouse_y;
}
@@ -94,6 +117,193 @@ ami_cw_key(struct ami_corewindow *ami_cw, int nskey)
}
}
+
+/**
+ * Redraw functions
+ *
+ * This is slightly over-engineered as it was taken from the main browser/old tree redraws
+ * and supports deferred drawing of rectangles and tiling
+ */
+
+/**
+ * Redraw an area of a core window
+ *
+ * \param g a struct ami_corewindow
+ * \param r rect (in document co-ordinates)
+ */
+
+static void
+ami_cw_redraw_rect(struct ami_corewindow *ami_cw, struct rect *r)
+{
+ struct IBox *bbox;
+ struct RastPort *temprp;
+ ULONG pos_x, pos_y;
+ struct rect draw_rect;
+ int tile_size_x = ami_cw->gg.width;
+ int tile_size_y = ami_cw->gg.height;
+ int tile_x, tile_y, tile_w, tile_h;
+
+ struct redraw_context ctx = {
+ .interactive = true,
+ .background_images = true,
+ .plot = &amiplot
+ };
+
+ if(ami_gui_get_space_box((Object *)ami_cw->objects[GID_CW_DRAW], &bbox) != NSERROR_OK) {
+ amiga_warn_user("NoMemory", "");
+ return;
+ }
+
+ int x0 = bbox->Left;
+ int y0 = bbox->Top;
+ ami_cw_coord_amiga_to_ns(ami_cw, &x0, &y0);
+ int x1 = x0 + bbox->Width;
+ int y1 = y0 + bbox->Height;
+
+ if((r->y1 < y0) || (r->x1 < x0) || (r->x0 > x1) || (r->y0 > y1)) {
+ /* rect not visible */
+ ami_gui_free_space_box(bbox);
+ return;
+ }
+
+ if(r->y0 < y0) r->y0 = y0;
+ if(r->x0 < x0) r->x0 = x0;
+ if(r->y1 > y1) r->y1 = y1;
+ if(r->x1 > x1) r->x1 = x1;
+
+ GetAttr(SCROLLER_Top, ami_cw->objects[GID_CW_HSCROLL], (ULONG *)&pos_x);
+ GetAttr(SCROLLER_Top, ami_cw->objects[GID_CW_VSCROLL], (ULONG *)&pos_y);
+
+ glob = &ami_cw->gg;
+ temprp = glob->rp; //??
+ glob->rp = ami_cw->win->RPort;
+
+ for(tile_y = r->y0; tile_y < r->y1; tile_y += tile_size_y) {
+ tile_h = tile_size_y;
+ if((r->y1 - tile_y) < tile_size_y)
+ tile_h = r->y1 - tile_y;
+
+ for(tile_x = r->x0; tile_x < r->x1; tile_x += tile_size_x) {
+ tile_w = tile_size_x;
+ if((r->x1 - tile_x) < tile_size_x)
+ tile_w = r->x1 - tile_x;
+
+ draw_rect.x0 = tile_x;
+ draw_rect.y0 = tile_y;
+ draw_rect.x1 = tile_x + tile_w;
+ draw_rect.y1 = tile_y + tile_h;
+
+ ami_cw->draw(ami_cw, &draw_rect, &ctx);
+#ifdef __amigaos4__
+ BltBitMapTags(BLITA_SrcType, BLITT_BITMAP,
+ BLITA_Source, ami_cw->gg.bm,
+ BLITA_SrcX, 0,
+ BLITA_SrcY, 0,
+ BLITA_DestType, BLITT_RASTPORT,
+ BLITA_Dest, ami_cw->win->RPort,
+ BLITA_DestX, bbox->Left + tile_x - pos_x,
+ BLITA_DestY, bbox->Top + tile_y - pos_y,
+ BLITA_Width, tile_w,
+ BLITA_Height, tile_h,
+ TAG_DONE);
+#else
+ BltBitMapRastPort(ami_cw->gg.bm, 0, 0,
+ ami_cw->win->RPort, bbox->Left + tile_x - pos_x, bbox->Top + tile_y - pos_y,
+ tile_w, tile_h, 0xC0);
+#endif
+ }
+ }
+
+ ami_gui_free_space_box(bbox);
+ ami_clearclipreg(glob);
+ glob->rp = temprp;
+ ami_gui_set_default_gg();
+}
+
+
+/**
+ * Draw the deferred rectangles
+ *
+ * @param draw set to false to just delete the queue
+ */
+static void ami_cw_redraw_queue(struct ami_corewindow *ami_cw, bool draw)
+{
+ struct nsObject *node;
+ struct nsObject *nnode;
+ struct rect *rect;
+
+ if(IsMinListEmpty(ami_cw->deferred_rects)) return;
+
+ if(draw == false) {
+ LOG("Ignoring deferred box redraw queue");
+ } // else should probably show busy pointer
+
+ node = (struct nsObject *)GetHead((struct List *)ami_cw->deferred_rects);
+
+ do {
+ if(draw == true) {
+ rect = (struct rect *)node->objstruct;
+ ami_cw_redraw_rect(ami_cw, rect);
+ }
+ nnode = (struct nsObject *)GetSucc((struct Node *)node);
+ ami_memory_itempool_free(ami_cw->deferred_rects_pool, node->objstruct, sizeof(struct rect));
+ DelObjectNoFree(node);
+ } while((node = nnode));
+}
+
+static void
+ami_cw_redraw_cb(void *p)
+{
+ struct ami_corewindow *ami_cw = (struct ami_corewindow *)p;
+
+ ami_cw_redraw_queue(ami_cw, true);
+}
+
+/**
+ * Queue a redraw of a rectangle
+ *
+ * @param ami_cw the core window to redraw
+ * @param r the rectangle (in doc coords) to redraw, or NULL for full window
+ */
+
+static void
+ami_cw_redraw(struct ami_corewindow *ami_cw, const struct rect *restrict r)
+{
+ struct nsObject *nsobj;
+ struct rect *restrict deferred_rect;
+ struct rect new_rect;
+
+ if(r == NULL) {
+ struct IBox *bbox;
+ if(ami_gui_get_space_box((Object *)ami_cw->objects[GID_CW_DRAW], &bbox) != NSERROR_OK) {
+ amiga_warn_user("NoMemory", "");
+ return;
+ }
+
+ new_rect.x0 = bbox->Left;
+ new_rect.y0 = bbox->Top;
+ ami_cw_coord_amiga_to_ns(ami_cw, &new_rect.x0, &new_rect.y0);
+ new_rect.x1 = new_rect.x0 + bbox->Width;
+ new_rect.y1 = new_rect.y0 + bbox->Height;
+
+ ami_gui_free_space_box(bbox);
+
+ r = &new_rect;
+ }
+
+ if(ami_gui_window_update_box_deferred_check(ami_cw->deferred_rects, r,
+ ami_cw->deferred_rects_pool)) {
+ deferred_rect = ami_memory_itempool_alloc(ami_cw->deferred_rects_pool, sizeof(struct rect));
+ CopyMem(r, deferred_rect, sizeof(struct rect));
+ nsobj = AddObject(ami_cw->deferred_rects, AMINS_RECT);
+ nsobj->objstruct = deferred_rect;
+ } else {
+ LOG("Ignoring duplicate or subset of queued box redraw");
+ }
+ ami_schedule(1, ami_cw_redraw_cb, ami_cw);
+}
+
+
static void
ami_cw_close(void *w)
{
@@ -123,7 +333,7 @@ HOOKF(void, ami_cw_idcmp_hook, Object *, object, struct IntuiMessage *)
case GID_CW_HSCROLL:
case GID_CW_VSCROLL:
- /* redraw */
+ ami_cw_redraw(ami_cw, NULL);
break;
}
break;
@@ -156,7 +366,7 @@ ami_cw_event(void *w)
uint16 code;
struct InputEvent *ie;
int nskey;
- int key_state;
+ int key_state = 0;
struct timeval curtime;
while((result = RA_HandleInput(ami_cw->objects[GID_CW_WIN], &code)) != WMHI_LASTMSG) {
@@ -223,7 +433,7 @@ ami_cw_event(void *w)
break;
case WMHI_NEWSIZE:
- /* redraw */
+ ami_cw_redraw(ami_cw, NULL);
break;
case WMHI_CLOSEWINDOW:
@@ -235,7 +445,7 @@ ami_cw_event(void *w)
switch(result & WMHI_GADGETMASK) {
case GID_CW_HSCROLL:
case GID_CW_VSCROLL:
- /* redraw */
+ ami_cw_redraw(ami_cw, NULL);
break;
default:
@@ -269,11 +479,7 @@ ami_cw_redraw_request(struct core_window *cw, const struct rect *r)
{
struct ami_corewindow *ami_cw = (struct ami_corewindow *)cw;
-/*
- toolkit_widget_queue_draw_area(example_cw->widget,
- r->x0, r->y0,
- r->x1 - r->x0, r->y1 - r->y0);
-*/
+ ami_cw_redraw(ami_cw, r);
}
@@ -353,6 +559,7 @@ ami_cw_scroll_visible(struct core_window *cw, const struct rect *r)
TAG_DONE);
/* probably need to redraw here */
+ ami_cw_redraw(ami_cw, NULL);
}
@@ -387,6 +594,9 @@ nserror ami_corewindow_init(struct ami_corewindow *ami_cw)
ami_init_layers(&ami_cw->gg, 0, 0, false);
ami_cw->gg.shared_pens = ami_AllocMinList();
+ ami_cw->deferred_rects = NewObjList();
+ ami_cw->deferred_rects_pool = ami_memory_itempool_create(sizeof(struct rect));
+
/* add the core window to our window list so we process events */
ami_gui_win_list_add(ami_cw, AMINS_COREWINDOW, &ami_cw_table);
@@ -425,6 +635,11 @@ nserror ami_corewindow_init(struct ami_corewindow *ami_cw)
/* exported interface documented in example/corewindow.h */
nserror ami_corewindow_fini(struct ami_corewindow *ami_cw)
{
+ /* remove any pending redraws */
+ ami_schedule(-1, ami_cw_redraw_cb, ami_cw);
+ FreeObjList(ami_cw->deferred_rects);
+ ami_memory_itempool_delete(ami_cw->deferred_rects_pool);
+
/* remove the core window from our window list */
ami_gui_win_list_remove(ami_cw);
diff --git a/frontends/amiga/corewindow.h b/frontends/amiga/corewindow.h
index 3659a6a..d8f80d3 100644
--- a/frontends/amiga/corewindow.h
+++ b/frontends/amiga/corewindow.h
@@ -56,6 +56,9 @@ struct ami_corewindow {
int mouse_y;
int mouse_state;
+ APTR deferred_rects_pool;
+ struct MinList *deferred_rects;
+
/** stuff for our off-screen render bitmap */
struct gui_globals gg;
struct MinList *shared_pens;
@@ -73,7 +76,7 @@ struct ami_corewindow {
* \param r The rectangle of the window that needs updating.
* \return NSERROR_OK on success otherwise apropriate error code
*/
- nserror (*draw)(struct ami_corewindow *ami_cw, struct rect *r);
+ nserror (*draw)(struct ami_corewindow *ami_cw, struct rect *r, struct redraw_context *ctx);
/**
* callback for keypress on Amiga core window
diff --git a/frontends/amiga/gui.c b/frontends/amiga/gui.c
index 46961dd..9499ff8 100644
--- a/frontends/amiga/gui.c
+++ b/frontends/amiga/gui.c
@@ -4741,7 +4741,7 @@ static void ami_gui_window_update_box_deferred(struct gui_window *g, bool draw)
if(draw == true) ami_reset_pointer(g->shared);
}
-static bool ami_gui_window_update_box_deferred_check(struct MinList *deferred_rects,
+bool ami_gui_window_update_box_deferred_check(struct MinList *deferred_rects,
const struct rect *restrict new_rect, APTR mempool)
{
struct nsObject *node;
diff --git a/frontends/amiga/gui.h b/frontends/amiga/gui.h
index f9e62c5..4c3e586 100644
--- a/frontends/amiga/gui.h
+++ b/frontends/amiga/gui.h
@@ -287,5 +287,12 @@ void ami_gui_win_list_remove(void *win);
* Get which qualifier keys are being pressed
*/
int ami_gui_get_quals(Object *win_obj);
+
+/**
+ * Check rect is not already queued for redraw
+ */
+bool ami_gui_window_update_box_deferred_check(struct MinList *deferred_rects,
+ const struct rect *restrict new_rect, APTR mempool);
+
#endif
commitdiff http://git.netsurf-browser.org/netsurf.git/commit/?id=3227ed655609e731f3d...
commit 3227ed655609e731f3d216706c524028f566f114
Author: Chris Young <chris(a)unsatisfactorysoftware.co.uk>
Commit: Chris Young <chris(a)unsatisfactorysoftware.co.uk>
handle core window mouse buttons
todo: support drags
diff --git a/frontends/amiga/corewindow.c b/frontends/amiga/corewindow.c
index c7252b5..3e2757e 100644
--- a/frontends/amiga/corewindow.c
+++ b/frontends/amiga/corewindow.c
@@ -58,9 +58,11 @@
#include "amiga/misc.h"
#include "amiga/object.h"
-/* get current mouse position in the draw area, adjusted for scroll */
+/* get current mouse position in the draw area, adjusted for scroll.
+ * only works during OM_NOTIFY! at other times use last stored posn
+ */
static void
-ami_cw_mouse_pos(struct ami_corewindow *ami_cw, int *x, int *y)
+ami_cw_mouse_pos(struct ami_corewindow *ami_cw, int *restrict x, int *restrict y)
{
ULONG xs, ys;
ULONG xm, ym;
@@ -69,8 +71,11 @@ ami_cw_mouse_pos(struct ami_corewindow *ami_cw, int *x, int *y)
GetAttr(SCROLLER_Top, ami_cw->objects[GID_CW_VSCROLL], (ULONG *)&ys);
GetAttr(SPACE_MouseX, ami_cw->objects[GID_CW_DRAW], (ULONG *)&xm);
GetAttr(SPACE_MouseY, ami_cw->objects[GID_CW_DRAW], (ULONG *)&ym);
- *x = xm + xs;
- *y = ym + ys;
+
+ ami_cw->mouse_x = xm + xs;
+ ami_cw->mouse_y = ym + ys;
+ *x = ami_cw->mouse_x;
+ *y = ami_cw->mouse_y;
}
/* handle keypress */
@@ -151,6 +156,8 @@ ami_cw_event(void *w)
uint16 code;
struct InputEvent *ie;
int nskey;
+ int key_state;
+ struct timeval curtime;
while((result = RA_HandleInput(ami_cw->objects[GID_CW_WIN], &code)) != WMHI_LASTMSG) {
switch(result & WMHI_CLASSMASK) {
@@ -159,6 +166,51 @@ ami_cw_event(void *w)
break;
case WMHI_MOUSEBUTTONS:
+ key_state = ami_gui_get_quals(ami_cw->objects[GID_CW_WIN]);
+
+ case SELECTDOWN:
+ ami_cw->mouse_state = BROWSER_MOUSE_PRESS_1;
+ break;
+
+ case MIDDLEDOWN:
+ ami_cw->mouse_state = BROWSER_MOUSE_PRESS_2;
+ break;
+
+ case SELECTUP:
+ if(ami_cw->mouse_state & BROWSER_MOUSE_PRESS_1) {
+ CurrentTime((ULONG *)&curtime.tv_sec, (ULONG *)&curtime.tv_usec);
+
+ ami_cw->mouse_state = BROWSER_MOUSE_CLICK_1;
+
+ if(ami_cw->lastclick.tv_sec) {
+ if(DoubleClick(ami_cw->lastclick.tv_sec,
+ ami_cw->lastclick.tv_usec,
+ curtime.tv_sec, curtime.tv_usec))
+ ami_cw->mouse_state |= BROWSER_MOUSE_DOUBLE_CLICK;
+ }
+
+ if(ami_cw->mouse_state & BROWSER_MOUSE_DOUBLE_CLICK) {
+ ami_cw->lastclick.tv_sec = 0;
+ ami_cw->lastclick.tv_usec = 0;
+ } else {
+ ami_cw->lastclick.tv_sec = curtime.tv_sec;
+ ami_cw->lastclick.tv_usec = curtime.tv_usec;
+ }
+ }
+
+ ami_cw->mouse(ami_cw, ami_cw->mouse_state | key_state, ami_cw->mouse_x, ami_cw->mouse_y);
+ ami_cw->mouse_state = BROWSER_MOUSE_HOVER;
+ break;
+
+ case MIDDLEUP:
+ if(ami_cw->mouse_state & BROWSER_MOUSE_PRESS_2)
+ ami_cw->mouse_state = BROWSER_MOUSE_CLICK_2;
+
+ ami_cw->mouse(ami_cw, ami_cw->mouse_state | key_state, ami_cw->mouse_x, ami_cw->mouse_y);
+ ami_cw->mouse_state = BROWSER_MOUSE_HOVER;
+ break;
+
+ ami_cw->mouse(ami_cw, ami_cw->mouse_state | key_state, ami_cw->mouse_x, ami_cw->mouse_y);
break;
case WMHI_RAWKEY:
@@ -327,7 +379,9 @@ nserror ami_corewindow_init(struct ami_corewindow *ami_cw)
ami_cw->cb_table = &ami_cw_cb_table;
/* clear some vars */
- ami_cw->mouse_state = 0;
+ ami_cw->mouse_state = BROWSER_MOUSE_HOVER;
+ ami_cw->lastclick.tv_sec = 0;
+ ami_cw->lastclick.tv_usec = 0;
/* allocate drawing area etc */
ami_init_layers(&ami_cw->gg, 0, 0, false);
diff --git a/frontends/amiga/corewindow.h b/frontends/amiga/corewindow.h
index fae5658..3659a6a 100644
--- a/frontends/amiga/corewindow.h
+++ b/frontends/amiga/corewindow.h
@@ -51,6 +51,9 @@ struct ami_corewindow {
struct Hook idcmp_hook;
struct timeval lastclick;
+
+ int mouse_x;
+ int mouse_y;
int mouse_state;
/** stuff for our off-screen render bitmap */
commitdiff http://git.netsurf-browser.org/netsurf.git/commit/?id=eb1f39fe7d80893b1f7...
commit eb1f39fe7d80893b1f7c804eb48ec61e89f17d78
Author: Chris Young <chris(a)unsatisfactorysoftware.co.uk>
Commit: Chris Young <chris(a)unsatisfactorysoftware.co.uk>
Process mouse moves and qualifier keys
NB: we are doing mouse moves differently by using an IDCMP hook on space.gadget, as this gives us co-ordinates relative to the render area
GID_DRAW object when the window is defined will need tagging ICA_TARGET, ICTARGET_IDCMP
diff --git a/frontends/amiga/corewindow.c b/frontends/amiga/corewindow.c
index a42f08d..c7252b5 100644
--- a/frontends/amiga/corewindow.c
+++ b/frontends/amiga/corewindow.c
@@ -50,6 +50,7 @@
#include <classes/window.h>
#include <gadgets/scroller.h>
+#include <gadgets/space.h>
#include <intuition/icclass.h>
#include <reaction/reaction_macros.h>
@@ -57,6 +58,37 @@
#include "amiga/misc.h"
#include "amiga/object.h"
+/* get current mouse position in the draw area, adjusted for scroll */
+static void
+ami_cw_mouse_pos(struct ami_corewindow *ami_cw, int *x, int *y)
+{
+ ULONG xs, ys;
+ ULONG xm, ym;
+
+ GetAttr(SCROLLER_Top, ami_cw->objects[GID_CW_HSCROLL], (ULONG *)&xs);
+ GetAttr(SCROLLER_Top, ami_cw->objects[GID_CW_VSCROLL], (ULONG *)&ys);
+ GetAttr(SPACE_MouseX, ami_cw->objects[GID_CW_DRAW], (ULONG *)&xm);
+ GetAttr(SPACE_MouseY, ami_cw->objects[GID_CW_DRAW], (ULONG *)&ym);
+ *x = xm + xs;
+ *y = ym + ys;
+}
+
+/* handle keypress */
+static void
+ami_cw_key(struct ami_corewindow *ami_cw, int nskey)
+{
+ ami_cw->key(ami_cw, nskey);
+
+ switch(nskey) {
+ case NS_KEY_COPY_SELECTION:
+ /* if we've copied a selection we need to clear it - style guide rules */
+ ami_cw->key(ami_cw, NS_KEY_CLEAR_SELECTION);
+ break;
+
+ /* we may need to deal with scroll-related keys here */
+ }
+}
+
static void
ami_cw_close(void *w)
{
@@ -67,17 +99,23 @@ ami_cw_close(void *w)
HOOKF(void, ami_cw_idcmp_hook, Object *, object, struct IntuiMessage *)
{
- ULONG gid;
struct ami_corewindow *ami_cw = hook->h_Data;
struct IntuiWheelData *wheel;
+ ULONG gid = GetTagData( GA_ID, 0, msg->IAddress );
+ int x, y;
+ int key_state = 0;
switch(msg->Class)
{
case IDCMP_IDCMPUPDATE:
- gid = GetTagData( GA_ID, 0, msg->IAddress );
+ switch(gid)
+ {
+ case GID_CW_DRAW:
+ ami_cw_mouse_pos(ami_cw, &x, &y);
+ key_state = ami_gui_get_quals(ami_cw->objects[GID_CW_WIN]);
+ ami_cw->mouse(ami_cw, ami_cw->mouse_state | key_state, x, y);
+ break;
- switch( gid )
- {
case GID_CW_HSCROLL:
case GID_CW_VSCROLL:
/* redraw */
@@ -97,6 +135,7 @@ HOOKF(void, ami_cw_idcmp_hook, Object *, object, struct IntuiMessage *)
}
}
+
/**
* Main event loop for our core window
*
@@ -116,6 +155,7 @@ ami_cw_event(void *w)
while((result = RA_HandleInput(ami_cw->objects[GID_CW_WIN], &code)) != WMHI_LASTMSG) {
switch(result & WMHI_CLASSMASK) {
case WMHI_MOUSEMOVE:
+ /* in theory the mouse moves we care about are processed in our hook function... */
break;
case WMHI_MOUSEBUTTONS:
@@ -126,11 +166,8 @@ ami_cw_event(void *w)
GetAttr(WINDOW_InputEvent, ami_cw->objects[GID_CW_WIN], (ULONG *)&ie);
nskey = ami_key_to_nskey(storage, ie);
- ami_cw->key(ami_cw, nskey);
- if(nskey == NS_KEY_COPY_SELECTION) {
- /* if we've copied a selection we need to clear it - style guide rules */
- ami_cw->key(ami_cw, NS_KEY_CLEAR_SELECTION);
- }
+
+ ami_cw_key(ami_cw, nskey);
break;
case WMHI_NEWSIZE:
@@ -142,9 +179,24 @@ ami_cw_event(void *w)
return TRUE;
break;
+ case WMHI_GADGETUP:
+ switch(result & WMHI_GADGETMASK) {
+ case GID_CW_HSCROLL:
+ case GID_CW_VSCROLL:
+ /* redraw */
+ break;
+
+ default:
+ /* pass the event to the window owner */
+ if(ami_cw->event != NULL)
+ ami_cw->event(ami_cw, result);
+ break;
+ }
+
default:
/* pass the event to the window owner */
- ami_cw->event(ami_cw, result);
+ if(ami_cw->event != NULL)
+ ami_cw->event(ami_cw, result);
break;
}
};
@@ -274,6 +326,9 @@ nserror ami_corewindow_init(struct ami_corewindow *ami_cw)
/* setup the core window callback table */
ami_cw->cb_table = &ami_cw_cb_table;
+ /* clear some vars */
+ ami_cw->mouse_state = 0;
+
/* allocate drawing area etc */
ami_init_layers(&ami_cw->gg, 0, 0, false);
ami_cw->gg.shared_pens = ami_AllocMinList();
@@ -289,7 +344,7 @@ nserror ami_corewindow_init(struct ami_corewindow *ami_cw)
WINDOW_IDCMPHook, &ami_cw->idcmp_hook,
TAG_DONE); */
- /* attach the scrollbars for event processing if they are in the window border */
+ /* 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]);
diff --git a/frontends/amiga/corewindow.h b/frontends/amiga/corewindow.h
index 3c27e51..fae5658 100644
--- a/frontends/amiga/corewindow.h
+++ b/frontends/amiga/corewindow.h
@@ -50,6 +50,8 @@ struct ami_corewindow {
Object *objects[GID_CW_LAST];
struct Hook idcmp_hook;
+ struct timeval lastclick;
+ int mouse_state;
/** stuff for our off-screen render bitmap */
struct gui_globals gg;
diff --git a/frontends/amiga/gui.c b/frontends/amiga/gui.c
index ba0a786..46961dd 100644
--- a/frontends/amiga/gui.c
+++ b/frontends/amiga/gui.c
@@ -1376,27 +1376,34 @@ int ami_key_to_nskey(ULONG keycode, struct InputEvent *ie)
return nskey;
}
-static void ami_update_quals(struct gui_window_2 *gwin)
+int ami_gui_get_quals(Object *win_obj)
{
uint32 quals = 0;
+ int key_state = 0;
#ifdef __amigaos4__
- GetAttr(WINDOW_Qualifier,gwin->objects[OID_MAIN],(uint32 *)&quals);
+ GetAttr(WINDOW_Qualifier, win_obj, (uint32 *)&quals);
#else
#warning qualifier needs fixing for OS3
#endif
- gwin->key_state = 0;
if(quals & NSA_QUAL_SHIFT) {
- gwin->key_state |= BROWSER_MOUSE_MOD_1;
+ key_state |= BROWSER_MOUSE_MOD_1;
}
if(quals & IEQUALIFIER_CONTROL) {
- gwin->key_state |= BROWSER_MOUSE_MOD_2;
+ key_state |= BROWSER_MOUSE_MOD_2;
}
if(quals & NSA_QUAL_ALT) {
- gwin->key_state |= BROWSER_MOUSE_MOD_3;
+ key_state |= BROWSER_MOUSE_MOD_3;
}
+
+ return key_state;
+}
+
+static void ami_update_quals(struct gui_window_2 *gwin)
+{
+ gwin->key_state = ami_gui_get_quals(gwin->objects[OID_MAIN]);
}
/* exported interface documented in amiga/gui.h */
diff --git a/frontends/amiga/gui.h b/frontends/amiga/gui.h
index eb39e9e..f9e62c5 100644
--- a/frontends/amiga/gui.h
+++ b/frontends/amiga/gui.h
@@ -1,5 +1,5 @@
/*
- * Copyright 2008-2016 Chris Young <chris(a)unsatisfactorysoftware.co.uk>
+ * Copyright 2008-2017 Chris Young <chris(a)unsatisfactorysoftware.co.uk>
*
* This file is part of NetSurf, http://www.netsurf-browser.org/
*
@@ -282,5 +282,10 @@ nserror ami_gui_win_list_add(void *win, int type, const struct ami_win_event_tab
* Remove a window from the NetSurf window list
*/
void ami_gui_win_list_remove(void *win);
+
+/**
+ * Get which qualifier keys are being pressed
+ */
+int ami_gui_get_quals(Object *win_obj);
#endif
commitdiff http://git.netsurf-browser.org/netsurf.git/commit/?id=31c08f39be64f739cac...
commit 31c08f39be64f739cac727ab5a13fc513d1a61aa
Author: Chris Young <chris(a)unsatisfactorysoftware.co.uk>
Commit: Chris Young <chris(a)unsatisfactorysoftware.co.uk>
Basic event loop, only handles keypresses and window closure so far
diff --git a/frontends/amiga/corewindow.c b/frontends/amiga/corewindow.c
index 5424b7b..a42f08d 100644
--- a/frontends/amiga/corewindow.c
+++ b/frontends/amiga/corewindow.c
@@ -51,6 +51,7 @@
#include <classes/window.h>
#include <gadgets/scroller.h>
#include <intuition/icclass.h>
+#include <reaction/reaction_macros.h>
#include "amiga/corewindow.h"
#include "amiga/misc.h"
@@ -98,12 +99,56 @@ HOOKF(void, ami_cw_idcmp_hook, Object *, object, struct IntuiMessage *)
/**
* Main event loop for our core window
+ *
+ * \return TRUE if window destroyed
*/
static BOOL
ami_cw_event(void *w)
{
struct ami_corewindow *ami_cw = (struct ami_corewindow *)w;
-//event loop goes here
+
+ ULONG result;
+ ULONG storage;
+ uint16 code;
+ struct InputEvent *ie;
+ int nskey;
+
+ while((result = RA_HandleInput(ami_cw->objects[GID_CW_WIN], &code)) != WMHI_LASTMSG) {
+ switch(result & WMHI_CLASSMASK) {
+ case WMHI_MOUSEMOVE:
+ break;
+
+ case WMHI_MOUSEBUTTONS:
+ break;
+
+ case WMHI_RAWKEY:
+ storage = result & WMHI_GADGETMASK;
+
+ GetAttr(WINDOW_InputEvent, ami_cw->objects[GID_CW_WIN], (ULONG *)&ie);
+ nskey = ami_key_to_nskey(storage, ie);
+ ami_cw->key(ami_cw, nskey);
+ if(nskey == NS_KEY_COPY_SELECTION) {
+ /* if we've copied a selection we need to clear it - style guide rules */
+ ami_cw->key(ami_cw, NS_KEY_CLEAR_SELECTION);
+ }
+ break;
+
+ case WMHI_NEWSIZE:
+ /* redraw */
+ break;
+
+ case WMHI_CLOSEWINDOW:
+ ami_cw_close(ami_cw);
+ return TRUE;
+ break;
+
+ default:
+ /* pass the event to the window owner */
+ ami_cw->event(ami_cw, result);
+ break;
+ }
+ };
+
return FALSE;
}
@@ -178,7 +223,7 @@ ami_cw_scroll_visible(struct core_window *cw, const struct rect *r)
int scrollsetx;
int scrollsety;
- int win_w, win_h;
+ int win_w = 0, win_h = 0;
int win_x0, win_x1;
int win_y0, win_y1;
diff --git a/frontends/amiga/corewindow.h b/frontends/amiga/corewindow.h
index 0729f12..3c27e51 100644
--- a/frontends/amiga/corewindow.h
+++ b/frontends/amiga/corewindow.h
@@ -95,9 +95,11 @@ struct ami_corewindow {
/**
* callback for unknown events on Amiga core window
* eg. buttons in the ssl cert window
- * PROBABLY NEED MORE VARS!
+ * (result & WMHI_CLASSMASK) gives the class of event (eg. WMHI_GADGETUP)
+ * (result & WMHI_GADGETMASK) gives the gadget ID (eg. GID_SSLCERT_ACCEPT)
+ *
* \param ami_cw The Amiga core window structure.
- * \param id gadget id
+ * \param result event as returned by RA_HandleInput()
* \return NSERROR_OK on sucess otherwise apropriate error code.
*/
nserror (*event)(struct ami_corewindow *ami_cw, ULONG id);
commitdiff http://git.netsurf-browser.org/netsurf.git/commit/?id=c40e8197c270b1600fa...
commit c40e8197c270b1600fa7b32056a2019cd83e6f3f
Author: Chris Young <chris(a)unsatisfactorysoftware.co.uk>
Commit: Chris Young <chris(a)unsatisfactorysoftware.co.uk>
Allow for the prospect of in-window scrollbars
diff --git a/frontends/amiga/corewindow.c b/frontends/amiga/corewindow.c
index d8676fd..5424b7b 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 d6f842a..0729f12 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.
commitdiff http://git.netsurf-browser.org/netsurf.git/commit/?id=8196f5b60241a6389ca...
commit 8196f5b60241a6389ca3b76446de131a3dd2e891
Author: Chris Young <chris(a)unsatisfactorysoftware.co.uk>
Commit: Chris Young <chris(a)unsatisfactorysoftware.co.uk>
Basic template for an Amiga core window
Drawing and event processing not written yet
diff --git a/frontends/amiga/Makefile b/frontends/amiga/Makefile
index f3c178e..8115f2f 100644
--- a/frontends/amiga/Makefile
+++ b/frontends/amiga/Makefile
@@ -46,7 +46,7 @@ S_FRONTEND := gui.c tree.c history.c hotlist.c schedule.c file.c \
stringview/stringview.c stringview/urlhistory.c rtg.c \
agclass/amigaguide_class.c os3support.c font_diskfont.c \
selectmenu.c hash/xxhash.c font_cache.c font_bullet.c \
- nsoption.c desktop-tree.c
+ nsoption.c desktop-tree.c corewindow.c
# This is the final source build list
# Note this is deliberately *not* expanded here as common and image
diff --git a/frontends/amiga/corewindow.c b/frontends/amiga/corewindow.c
new file mode 100644
index 0000000..d8676fd
--- /dev/null
+++ b/frontends/amiga/corewindow.c
@@ -0,0 +1,281 @@
+/*
+ * Copyright 2017 Chris Young <chris(a)unsatisfactorysoftware.co.uk>
+ *
+ * This file is part of NetSurf, http://www.netsurf-browser.org/
+ *
+ * NetSurf is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; version 2 of the License.
+ *
+ * NetSurf is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
+/**
+ * \file
+ * Amiga core window interface.
+ *
+ * Provides interface for core renderers to the Amiga Intuition drawable area.
+ *
+ * This module is an object that must be encapsulated. Client users
+ * should embed a struct ami_corewindow at the beginning of their
+ * context for this display surface, fill in relevant data and then
+ * call ami_corewindow_init()
+ *
+ * The Amiga core window structure requires the callback for draw, key and
+ * mouse operations.
+ */
+
+#include "amiga/os3support.h"
+
+#include <assert.h>
+#include <string.h>
+#include <math.h>
+
+#include "utils/log.h"
+#include "utils/utils.h"
+#include "utils/messages.h"
+#include "utils/utf8.h"
+#include "netsurf/keypress.h"
+#include "netsurf/mouse.h"
+#include "desktop/plot_style.h"
+
+#include <proto/intuition.h>
+#include <proto/utility.h>
+
+#include <classes/window.h>
+#include <gadgets/scroller.h>
+#include <intuition/icclass.h>
+
+#include "amiga/corewindow.h"
+#include "amiga/misc.h"
+#include "amiga/object.h"
+
+static void
+ami_cw_close(void *w)
+{
+ struct ami_corewindow *ami_cw = (struct ami_corewindow *)w;
+
+ ami_cw->close(ami_cw);
+}
+
+HOOKF(void, ami_cw_idcmp_hook, Object *, object, struct IntuiMessage *)
+{
+ ULONG gid;
+ struct ami_corewindow *ami_cw = hook->h_Data;
+ struct IntuiWheelData *wheel;
+
+ switch(msg->Class)
+ {
+ case IDCMP_IDCMPUPDATE:
+ gid = GetTagData( GA_ID, 0, msg->IAddress );
+
+ switch( gid )
+ {
+ case GID_CW_HSCROLL:
+ case GID_CW_VSCROLL:
+ /* redraw */
+ break;
+ }
+ break;
+#ifdef __amigaos4__
+ case IDCMP_EXTENDEDMOUSE:
+ if(msg->Code == IMSGCODE_INTUIWHEELDATA)
+ {
+ wheel = (struct IntuiWheelData *)msg->IAddress;
+
+ //ami_tree_scroll(twin, (wheel->WheelX * 20), (wheel->WheelY * 20));
+ }
+ break;
+#endif
+ }
+}
+
+/**
+ * Main event loop for our core window
+ */
+static BOOL
+ami_cw_event(void *w)
+{
+ struct ami_corewindow *ami_cw = (struct ami_corewindow *)w;
+//event loop goes here
+ return FALSE;
+}
+
+static const struct ami_win_event_table ami_cw_table = {
+ ami_cw_event,
+ ami_cw_close,
+};
+
+/**
+ * callback from core to request a redraw
+ */
+static void
+ami_cw_redraw_request(struct core_window *cw, const struct rect *r)
+{
+ struct ami_corewindow *ami_cw = (struct ami_corewindow *)cw;
+
+/*
+ toolkit_widget_queue_draw_area(example_cw->widget,
+ r->x0, r->y0,
+ r->x1 - r->x0, r->y1 - r->y0);
+*/
+}
+
+
+static void
+ami_cw_get_window_dimensions(struct core_window *cw, int *width, int *height)
+{
+ struct ami_corewindow *ami_cw = (struct ami_corewindow *)cw;
+ struct IBox *bbox;
+
+ if(ami_gui_get_space_box((Object *)ami_cw->objects[GID_CW_DRAW], &bbox) != NSERROR_OK) {
+ amiga_warn_user("NoMemory", "");
+ return;
+ }
+
+ *width = bbox->Width;
+ *height = bbox->Height;
+
+ ami_gui_free_space_box(bbox);
+}
+
+
+static void
+ami_cw_update_size(struct core_window *cw, int width, int height)
+{
+ struct ami_corewindow *ami_cw = (struct ami_corewindow *)cw;
+
+ /* I'm assuming this is telling me the new page size, not wanting the window physically resized */
+ int win_w, win_h;
+ ami_cw_get_window_dimensions((struct core_window *)ami_cw, &win_w, &win_h);
+
+ if(ami_cw->objects[GID_CW_VSCROLL]) {
+ RefreshSetGadgetAttrs((struct Gadget *)ami_cw->objects[GID_CW_VSCROLL], ami_cw->win, NULL,
+ SCROLLER_Total, (ULONG)height,
+ SCROLLER_Visible, win_h,
+ TAG_DONE);
+ }
+
+ if(ami_cw->objects[GID_CW_HSCROLL]) {
+ RefreshSetGadgetAttrs((struct Gadget *)ami_cw->objects[GID_CW_HSCROLL], ami_cw->win, NULL,
+ SCROLLER_Total, (ULONG)width,
+ SCROLLER_Visible, win_w,
+ TAG_DONE);
+ }
+}
+
+
+static void
+ami_cw_scroll_visible(struct core_window *cw, const struct rect *r)
+{
+ struct ami_corewindow *ami_cw = (struct ami_corewindow *)cw;
+
+ int scrollsetx;
+ int scrollsety;
+ int win_w, win_h;
+ int win_x0, win_x1;
+ int win_y0, win_y1;
+
+ ami_cw_get_window_dimensions((struct core_window *)ami_cw, &win_w, &win_h);
+
+ GetAttr(SCROLLER_Top, ami_cw->objects[GID_CW_VSCROLL], (ULONG *)&win_y0);
+ GetAttr(SCROLLER_Top, ami_cw->objects[GID_CW_HSCROLL], (ULONG *)&win_x0);
+
+ win_x1 = win_x0 + win_w;
+ win_y1 = win_y0 + win_h;
+
+ if(r->y1 > win_y1) scrollsety = r->y1 - win_h;
+ if(r->y0 < win_y0) scrollsety = r->y0;
+ if(r->x1 > win_x1) scrollsetx = r->x1 - win_w;
+ if(r->x0 < win_x0) scrollsetx = r->x0;
+
+ RefreshSetGadgetAttrs((APTR)ami_cw->objects[GID_CW_VSCROLL], ami_cw->win, NULL,
+ SCROLLER_Top, scrollsety,
+ TAG_DONE);
+
+ RefreshSetGadgetAttrs((APTR)ami_cw->objects[GID_CW_HSCROLL], ami_cw->win, NULL,
+ SCROLLER_Top, scrollsetx,
+ TAG_DONE);
+
+ /* probably need to redraw here */
+}
+
+
+static void
+ami_cw_drag_status(struct core_window *cw, core_window_drag_status ds)
+{
+ struct ami_corewindow *ami_cw = (struct ami_corewindow *)cw;
+ ami_cw->drag_status = ds;
+}
+
+
+struct core_window_callback_table ami_cw_cb_table = {
+ .redraw_request = ami_cw_redraw_request,
+ .update_size = ami_cw_update_size,
+ .scroll_visible = ami_cw_scroll_visible,
+ .get_window_dimensions = ami_cw_get_window_dimensions,
+ .drag_status = ami_cw_drag_status
+};
+
+/* exported function documented example/corewindow.h */
+nserror ami_corewindow_init(struct ami_corewindow *ami_cw)
+{
+ /* setup the core window callback table */
+ ami_cw->cb_table = &ami_cw_cb_table;
+
+ /* allocate drawing area etc */
+ ami_init_layers(&ami_cw->gg, 0, 0, false);
+ ami_cw->gg.shared_pens = ami_AllocMinList();
+
+ /* 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 */
+ 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
+ SetAttrs(ami_cw->objects[GID_CW_WIN],
+ 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]);
+
+ 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);
+
+ return NSERROR_OK;
+}
+
+/* exported interface documented in example/corewindow.h */
+nserror ami_corewindow_fini(struct ami_corewindow *ami_cw)
+{
+ /* remove the core window from our window list */
+ ami_gui_win_list_remove(ami_cw);
+
+ /* destroy the window */
+ ami_cw->win = NULL;
+ DisposeObject(ami_cw->objects[GID_CW_WIN]);
+
+ /* release off-screen bitmap stuff */
+ ami_plot_release_pens(ami_cw->gg.shared_pens);
+ ami_free_layers(&ami_cw->gg);
+
+ return NSERROR_OK;
+}
+
diff --git a/frontends/amiga/corewindow.h b/frontends/amiga/corewindow.h
new file mode 100644
index 0000000..d6f842a
--- /dev/null
+++ b/frontends/amiga/corewindow.h
@@ -0,0 +1,123 @@
+/*
+ * Copyright 2017 Chris Young <chris(a)unsatisfactorysoftware.co.uk>
+ *
+ * This file is part of NetSurf, http://www.netsurf-browser.org/
+ *
+ * NetSurf is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; version 2 of the License.
+ *
+ * NetSurf is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
+#ifndef AMIGA_COREWINDOW_H
+#define AMIGA_COREWINDOW_H
+
+#include "netsurf/core_window.h"
+
+#include "amiga/gui.h" /* need to know the size of ami_generic_window :( */
+#include "amiga/plotters.h"
+
+/**
+ * BOOPSI objects
+ */
+
+enum {
+ GID_CW_WIN = 0, /* window object */
+ GID_CW_MAIN, /* root layout object */
+ GID_CW_DRAW, /* drawing area (space.gadget) */
+ GID_CW_HSCROLL, /* horizontal scroller */
+ GID_CW_VSCROLL, /* vertical scroller */
+ GID_CW_LAST
+};
+
+/**
+ * Amiga core window state
+ */
+struct ami_corewindow {
+ /*
+ * Any variables common to any frontend window would go here.
+ * e.g. drawing area handles, toolkit pointers or other state
+ */
+ struct ami_generic_window w;
+ struct Window *win;
+ Object *objects[GID_CW_LAST];
+
+ struct Hook idcmp_hook;
+
+ /** stuff for our off-screen render bitmap */
+ struct gui_globals gg;
+ struct MinList *shared_pens;
+
+ /** drag status set by core */
+ core_window_drag_status drag_status;
+
+ /** table of callbacks for core window operations */
+ struct core_window_callback_table *cb_table;
+
+ /**
+ * callback to draw on drawable area of Amiga core window
+ *
+ * \param ami_cw The Amiga core window structure.
+ * \param r The rectangle of the window that needs updating.
+ * \return NSERROR_OK on success otherwise apropriate error code
+ */
+ nserror (*draw)(struct ami_corewindow *ami_cw, struct rect *r);
+
+ /**
+ * callback for keypress on Amiga core window
+ *
+ * \param ami_cw The Amiga core window structure.
+ * \param nskey The netsurf key code.
+ * \return NSERROR_OK if key processed,
+ * NSERROR_NOT_IMPLEMENTED if key not processed
+ * otherwise apropriate error code
+ */
+ nserror (*key)(struct ami_corewindow *ami_cw, uint32_t nskey);
+
+ /**
+ * callback for mouse event on Amiga core window
+ *
+ * \param ami_cw The Amiga core window structure.
+ * \param mouse_state mouse state
+ * \param x location of event
+ * \param y location of event
+ * \return NSERROR_OK on sucess otherwise apropriate error code.
+ */
+ nserror (*mouse)(struct ami_corewindow *ami_cw, browser_mouse_state mouse_state, int x, int y);
+
+ /**
+ * callback to close an Amiga core window
+ *
+ * \param ami_cw The Amiga core window structure.
+ */
+ nserror (*close)(struct ami_corewindow *ami_cw);
+
+};
+
+/**
+ * initialise elements of Amiga core window.
+ *
+ * As a pre-requisite the draw, key and mouse callbacks must be defined
+ *
+ * \param example_cw An Amiga core window structure to initialise
+ * \return NSERROR_OK on successful initialisation otherwise error code.
+ */
+nserror ami_corewindow_init(struct ami_corewindow *ami_cw);
+
+/**
+ * finalise elements of Amiga core window.
+ *
+ * \param ami_cw An Amiga core window structure to finialise
+ * \return NSERROR_OK on successful finalisation otherwise error code.
+ */
+nserror ami_corewindow_fini(struct ami_corewindow *ami_cw);
+
+#endif
+
diff --git a/frontends/amiga/object.h b/frontends/amiga/object.h
index be96504..70bb550 100755
--- a/frontends/amiga/object.h
+++ b/frontends/amiga/object.h
@@ -33,6 +33,7 @@ enum
AMINS_HISTORYWINDOW,
AMINS_GUIOPTSWINDOW,
AMINS_PRINTWINDOW,
+ AMINS_COREWINDOW,
AMINS_FONT,
AMINS_MIME,
AMINS_RECT
-----------------------------------------------------------------------
--
NetSurf Browser
6 years, 8 months