netsurf: branch master updated. release/3.2-613-g249e89e
by NetSurf Browser Project
Gitweb links:
...log http://git.netsurf-browser.org/netsurf.git/shortlog/249e89e389d5ec4489433...
...commit http://git.netsurf-browser.org/netsurf.git/commit/249e89e389d5ec44894331f...
...tree http://git.netsurf-browser.org/netsurf.git/tree/249e89e389d5ec44894331fb0...
The branch, master has been updated
via 249e89e389d5ec44894331fb0f55332efd92540f (commit)
from deb7e55063ee888e5e521f2a2cfd6928b3ff46dd (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=249e89e389d5ec44894...
commit 249e89e389d5ec44894331fb0f55332efd92540f
Author: Chris Young <chris(a)unsatisfactorysoftware.co.uk>
Commit: Chris Young <chris(a)unsatisfactorysoftware.co.uk>
Fix a missed p96AllocBitMap
diff --git a/amiga/os3support.h b/amiga/os3support.h
index a329cc9..ecb6f4a 100644
--- a/amiga/os3support.h
+++ b/amiga/os3support.h
@@ -149,9 +149,6 @@
#define IDoSuperMethodA DoSuperMethodA
#define ShowWindow(...) (void)0
-/* P96 */
-#define p96WritePixelArray (void)0 /* TODO - see rtg.c */
-
/* Utility */
#define SetMem memset
#define SNPrintf snprintf
diff --git a/amiga/thumbnail.c b/amiga/thumbnail.c
index 5333b4c..09d8afe 100755
--- a/amiga/thumbnail.c
+++ b/amiga/thumbnail.c
@@ -19,9 +19,6 @@
#include "amiga/os3support.h"
#include <proto/graphics.h>
-#ifdef __amigaos4__
-#include <proto/Picasso96API.h>
-#endif
#include <intuition/intuition.h>
#ifdef __amigaos4__
#include <graphics/blitattr.h>
@@ -42,7 +39,7 @@
#include "amiga/gui.h"
#include "amiga/bitmap.h"
-
+#include "amiga/rtg.h"
bool thumbnail_create(hlcache_handle *content, struct bitmap *bitmap,
nsurl *url)
@@ -64,7 +61,7 @@ bool thumbnail_create(hlcache_handle *content, struct bitmap *bitmap,
plot_height = ((plot_width * bitmap->height) + (bitmap->width / 2)) /
bitmap->width;
- bitmap->nativebm = p96AllocBitMap(bitmap->width, bitmap->height, 32,
+ bitmap->nativebm = ami_rtg_allocbitmap(bitmap->width, bitmap->height, 32,
BMF_CLEAR | BMF_DISPLAYABLE | BMF_INTERLEAVED,
browserglob.bm, RGBFB_A8R8G8B8);
-----------------------------------------------------------------------
Summary of changes:
amiga/os3support.h | 3 ---
amiga/thumbnail.c | 7 ++-----
2 files changed, 2 insertions(+), 8 deletions(-)
diff --git a/amiga/os3support.h b/amiga/os3support.h
index a329cc9..ecb6f4a 100644
--- a/amiga/os3support.h
+++ b/amiga/os3support.h
@@ -149,9 +149,6 @@
#define IDoSuperMethodA DoSuperMethodA
#define ShowWindow(...) (void)0
-/* P96 */
-#define p96WritePixelArray (void)0 /* TODO - see rtg.c */
-
/* Utility */
#define SetMem memset
#define SNPrintf snprintf
diff --git a/amiga/thumbnail.c b/amiga/thumbnail.c
index 5333b4c..09d8afe 100755
--- a/amiga/thumbnail.c
+++ b/amiga/thumbnail.c
@@ -19,9 +19,6 @@
#include "amiga/os3support.h"
#include <proto/graphics.h>
-#ifdef __amigaos4__
-#include <proto/Picasso96API.h>
-#endif
#include <intuition/intuition.h>
#ifdef __amigaos4__
#include <graphics/blitattr.h>
@@ -42,7 +39,7 @@
#include "amiga/gui.h"
#include "amiga/bitmap.h"
-
+#include "amiga/rtg.h"
bool thumbnail_create(hlcache_handle *content, struct bitmap *bitmap,
nsurl *url)
@@ -64,7 +61,7 @@ bool thumbnail_create(hlcache_handle *content, struct bitmap *bitmap,
plot_height = ((plot_width * bitmap->height) + (bitmap->width / 2)) /
bitmap->width;
- bitmap->nativebm = p96AllocBitMap(bitmap->width, bitmap->height, 32,
+ bitmap->nativebm = ami_rtg_allocbitmap(bitmap->width, bitmap->height, 32,
BMF_CLEAR | BMF_DISPLAYABLE | BMF_INTERLEAVED,
browserglob.bm, RGBFB_A8R8G8B8);
--
NetSurf Browser
8 years
netsurf: branch master updated. release/3.2-612-gdeb7e55
by NetSurf Browser Project
Gitweb links:
...log http://git.netsurf-browser.org/netsurf.git/shortlog/deb7e55063ee888e5e521...
...commit http://git.netsurf-browser.org/netsurf.git/commit/deb7e55063ee888e5e521f2...
...tree http://git.netsurf-browser.org/netsurf.git/tree/deb7e55063ee888e5e521f2a2...
The branch, master has been updated
via deb7e55063ee888e5e521f2a2cfd6928b3ff46dd (commit)
via 4f98fd5925e43c0c04ffd64eaab2cc33d7d4df15 (commit)
via b3f49f936438f2183aeb33070b3083b2794da0c0 (commit)
via e3af7f334303b36414c3a7c39dec22ec179dbd09 (commit)
via d0f7247ea67491b4bfae28cb90538b68c6f83d70 (commit)
via 65ab38fc1c26bed356fc61dd4adfe1f0495fab65 (commit)
from 2b9df1b2cd30e394ebb4e9be721b7d219c4e418c (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=deb7e55063ee888e5e5...
commit deb7e55063ee888e5e521f2a2cfd6928b3ff46dd
Author: Chris Young <chris(a)unsatisfactorysoftware.co.uk>
Commit: Chris Young <chris(a)unsatisfactorysoftware.co.uk>
Add missing files
diff --git a/amiga/rtg.c b/amiga/rtg.c
new file mode 100644
index 0000000..0b51076
--- /dev/null
+++ b/amiga/rtg.c
@@ -0,0 +1,74 @@
+/*
+ * Copyright 2014 Chris Young <chris(a)unsatisfactorsysoftware.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
+ * Abstract RTG functions for newer/older/non-P96 systems
+ */
+
+#include "amiga/rtg.h"
+
+/**\todo p96WritePixelArray */
+
+struct BitMap *ami_rtg_allocbitmap(ULONG width, ULONG height, ULONG depth,
+ ULONG flags, struct BitMap *friend, RGBFTYPE format)
+{
+ if(P96Base == NULL) {
+ return AllocBitMap(width, height, depth, flags, friend);
+ } else {
+ return p96AllocBitMap(width, height, depth, flags, friend, format);
+ }
+}
+
+void ami_rtg_freebitmap(struct BitMap *bm)
+{
+ if(P96Base == NULL) {
+ return FreeBitMap(bm);
+ } else {
+ return p96FreeBitMap(bm);
+ }
+}
+
+void ami_rtg_rectfill(struct RastPort *rp, UWORD min_x, UWORD min_y,
+ UWORD max_x, UWORD max_y, ULONG colour)
+{
+ if(P96Base == NULL) {
+ return RectFill(rp, min_x, min_y, max_x, max_y);
+ } else {
+ return p96RectFill(rp, min_x, min_y, max_x, max_y, colour);
+ }
+}
+
+void ami_rtg_writepixelarray(UBYTE *pixdata, struct BitMap *bm,
+ ULONG width, ULONG height, ULONG bpr, ULONG format)
+{
+ struct RenderInfo ri;
+ struct RastPort trp;
+
+ /* This requires P96 currently */
+ if(P96Base == NULL) return;
+
+ ri.Memory = pixdata;
+ ri.BytesPerRow = bpr;
+ ri.RGBFormat = format;
+
+ InitRastPort(&trp);
+ trp.BitMap = bm;
+
+ p96WritePixelArray((struct RenderInfo *)&ri, 0, 0, &trp, 0, 0, width, height);
+}
+
diff --git a/amiga/rtg.h b/amiga/rtg.h
new file mode 100644
index 0000000..ea49e4c
--- /dev/null
+++ b/amiga/rtg.h
@@ -0,0 +1,39 @@
+/*
+ * Copyright 2014 Chris Young <chris(a)unsatisfactorsysoftware.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
+ * Abstract RTG functions for newer/older/non-P96 systems
+ */
+
+#ifndef AMIGA_RTG_H
+#define AMIGA_RTG_H 1
+#include <proto/graphics.h>
+#include <proto/Picasso96API.h>
+
+/* Wrappers for Alloc/FreeBitMap and RectFill */
+struct BitMap *ami_rtg_allocbitmap(ULONG width, ULONG height, ULONG depth,
+ ULONG flags, struct BitMap *friend, RGBFTYPE format);
+void ami_rtg_freebitmap(struct BitMap *bm);
+void ami_rtg_rectfill(struct RastPort *rp, UWORD min_x, UWORD min_y,
+ UWORD max_x, UWORD max_y, ULONG colour);
+
+/* WritePixelArray wrapper. This isn't entirely (at all) equivalent to p96WPA */
+void ami_rtg_writepixelarray(UBYTE *pixdata, struct BitMap *bm,
+ ULONG width, ULONG height, ULONG bpr, ULONG format);
+#endif
+
commitdiff http://git.netsurf-browser.org/netsurf.git/commit/?id=4f98fd5925e43c0c04f...
commit 4f98fd5925e43c0c04ffd64eaab2cc33d7d4df15
Author: Chris Young <chris(a)unsatisfactorysoftware.co.uk>
Commit: Chris Young <chris(a)unsatisfactorysoftware.co.uk>
Add missing headers
diff --git a/amiga/gui_options.c b/amiga/gui_options.c
index 2187c30..e64d3d9 100755
--- a/amiga/gui_options.c
+++ b/amiga/gui_options.c
@@ -68,6 +68,7 @@
#include "amiga/gui.h"
#include "amiga/gui_options.h"
#include "amiga/help.h"
+#include "amiga/misc.h"
#include "amiga/object.h"
#include "amiga/theme.h"
#include "amiga/utf8.h"
diff --git a/amiga/history_local.c b/amiga/history_local.c
index c8c7b72..2484ffb 100755
--- a/amiga/history_local.c
+++ b/amiga/history_local.c
@@ -22,6 +22,8 @@
* There is only one history window, not one per browser window.
*/
+#include "amiga/os3support.h"
+
#include <stdbool.h>
#include <stdlib.h>
#include <string.h>
@@ -48,7 +50,7 @@
#include "desktop/gui_window.h"
#include "graphics/rpattr.h"
-#include "amiga/os3support.h"
+#include "amiga/misc.h"
#include "amiga/object.h"
#include "amiga/gui.h"
#include "amiga/history_local.h"
diff --git a/amiga/login.c b/amiga/login.c
index fe476ac..611ba2a 100755
--- a/amiga/login.c
+++ b/amiga/login.c
@@ -16,10 +16,13 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
+#include "amiga/os3support.h"
+
+#include <assert.h>
+
#include <proto/exec.h>
#include <proto/intuition.h>
#include <proto/utility.h>
-#include <assert.h>
#include <proto/window.h>
#include <proto/layout.h>
@@ -39,8 +42,8 @@
#include "desktop/mouse.h"
#include "desktop/gui_window.h"
-#include "amiga/os3support.h"
#include "amiga/gui.h"
+#include "amiga/misc.h"
#include "amiga/object.h"
#include "amiga/login.h"
diff --git a/amiga/menu.c b/amiga/menu.c
index 1fef12b..111b165 100644
--- a/amiga/menu.c
+++ b/amiga/menu.c
@@ -62,6 +62,7 @@
#include "amiga/history_local.h"
#include "amiga/hotlist.h"
#include "amiga/menu.h"
+#include "amiga/misc.h"
#include "amiga/print.h"
#include "amiga/search.h"
#include "amiga/theme.h"
diff --git a/amiga/plotters.c b/amiga/plotters.c
index 58aee5a..2952f10 100755
--- a/amiga/plotters.c
+++ b/amiga/plotters.c
@@ -45,6 +45,7 @@
#include "amiga/bitmap.h"
#include "amiga/font.h"
#include "amiga/gui.h"
+#include "amiga/rtg.h"
#include "amiga/utf8.h"
#ifdef __amigaos4__
diff --git a/amiga/search.c b/amiga/search.c
index ab32abb..b974651 100755
--- a/amiga/search.c
+++ b/amiga/search.c
@@ -22,6 +22,8 @@
* Free text search (implementation)
*/
+#include "amiga/os3support.h"
+
#include "utils/config.h"
#include <ctype.h>
#include <string.h>
@@ -52,7 +54,7 @@
#include "desktop/gui_window.h"
#include "desktop/gui_search.h"
-#include "amiga/os3support.h"
+#include "amiga/misc.h"
#include "amiga/search.h"
#include "amiga/object.h"
#include "amiga/theme.h"
commitdiff http://git.netsurf-browser.org/netsurf.git/commit/?id=b3f49f936438f2183ae...
commit b3f49f936438f2183aeb33070b3083b2794da0c0
Author: Chris Young <chris(a)unsatisfactorysoftware.co.uk>
Commit: Chris Young <chris(a)unsatisfactorysoftware.co.uk>
Abstract p96WPA, although it still needs P96 currently
diff --git a/amiga/bitmap.c b/amiga/bitmap.c
index ec6ce79..7c676df 100644
--- a/amiga/bitmap.c
+++ b/amiga/bitmap.c
@@ -20,7 +20,6 @@
#include <proto/exec.h>
#ifdef __amigaos4__
-#include <proto/Picasso96API.h>
#include <graphics/blitattr.h>
#include <graphics/composite.h>
#endif
@@ -390,9 +389,7 @@ struct bitmap *ami_bitmap_from_datatype(char *filename)
static struct BitMap *ami_bitmap_get_truecolour(struct bitmap *bitmap,int width,int height,struct BitMap *friendbm)
{
#ifdef __amigaos4__
- struct RenderInfo ri;
struct BitMap *tbm = NULL;
- struct RastPort trp;
if(!bitmap) return NULL;
@@ -416,17 +413,10 @@ static struct BitMap *ami_bitmap_get_truecolour(struct bitmap *bitmap,int width,
if(!tbm)
{
- ri.Memory = bitmap->pixdata;
- ri.BytesPerRow = bitmap->width * 4;
- ri.RGBFormat = AMI_BITMAP_FORMAT;
-
if((tbm = ami_rtg_allocbitmap(bitmap->width, bitmap->height, 32, 0,
friendbm, AMI_BITMAP_FORMAT))) {
- InitRastPort(&trp);
- trp.BitMap = tbm;
- /*\todo abstract p96WritePixelArray */
- p96WritePixelArray((struct RenderInfo *)&ri, 0, 0, &trp, 0, 0,
- bitmap->width, bitmap->height);
+ ami_rtg_writepixelarray(bitmap->pixdata, tbm, bitmap->width, bitmap->height,
+ bitmap->width * 4, AMI_BITMAP_FORMAT);
}
if(nsoption_int(cache_bitmaps) == 2)
diff --git a/amiga/gui.c b/amiga/gui.c
index 5d0504c..ad70f2f 100644
--- a/amiga/gui.c
+++ b/amiga/gui.c
@@ -1565,9 +1565,10 @@ static bool ami_gui_vscroll_add(struct gui_window_2 *gwin)
ICA_TARGET, ICTARGET_IDCMP,
ScrollerEnd;
#ifdef __amigaos4__
-#warning FIXME for OS3
IDoMethod(gwin->objects[GID_VSCROLLLAYOUT], LM_ADDCHILD,
gwin->win, gwin->objects[GID_VSCROLL], attrs);
+#else
+#warning FIXME for OS3
#endif
return true;
}
commitdiff http://git.netsurf-browser.org/netsurf.git/commit/?id=e3af7f334303b36414c...
commit e3af7f334303b36414c3a7c39dec22ec179dbd09
Author: Chris Young <chris(a)unsatisfactorysoftware.co.uk>
Commit: Chris Young <chris(a)unsatisfactorysoftware.co.uk>
Abstract P96 functions away so we can decide what to use at run-time.
This allows us to avoid opening P96 on OS4.1FE in future, and not require it to be installed on OS3.
diff --git a/amiga/Makefile.target b/amiga/Makefile.target
index ec47826..a9de6ee 100644
--- a/amiga/Makefile.target
+++ b/amiga/Makefile.target
@@ -73,7 +73,7 @@ S_AMIGA := gui.c tree.c history.c hotlist.c schedule.c file.c \
launch.c search.c history_local.c download.c iff_dr2d.c \
sslcert.c gui_options.c print.c theme.c drag.c icon.c libs.c \
datatypes.c dt_picture.c dt_anim.c dt_sound.c plugin_hack.c \
- stringview/stringview.c stringview/urlhistory.c \
+ stringview/stringview.c stringview/urlhistory.c rtg.c \
agclass/amigaguide_class.c fs_backing_store.c os3support.c
S_AMIGA := $(addprefix amiga/,$(S_AMIGA))
diff --git a/amiga/bitmap.c b/amiga/bitmap.c
index b7eb129..ec6ce79 100644
--- a/amiga/bitmap.c
+++ b/amiga/bitmap.c
@@ -41,6 +41,7 @@
#include "amiga/bitmap.h"
#include "amiga/download.h"
#include "amiga/misc.h"
+#include "amiga/rtg.h"
/**
* Create a bitmap.
@@ -122,7 +123,7 @@ void bitmap_destroy(void *bitmap)
if(bm)
{
if((bm->nativebm) && (bm->dto == NULL)) {
- p96FreeBitMap(bm->nativebm);
+ ami_rtg_freebitmap(bm->nativebm);
}
if(bm->dto) {
@@ -180,7 +181,7 @@ void bitmap_modified(void *bitmap) {
struct bitmap *bm = bitmap;
if((bm->nativebm) && (bm->dto == NULL))
- p96FreeBitMap(bm->nativebm);
+ ami_rtg_freebitmap(bm->nativebm);
if(bm->dto) DisposeDTObject(bm->dto);
if(bm->native_mask) FreeRaster(bm->native_mask, bm->width, bm->height);
@@ -408,7 +409,7 @@ static struct BitMap *ami_bitmap_get_truecolour(struct bitmap *bitmap,int width,
}
else
{
- if(bitmap->nativebm) p96FreeBitMap(bitmap->nativebm);
+ if(bitmap->nativebm) ami_rtg_freebitmap(bitmap->nativebm);
bitmap->nativebm = NULL;
}
}
@@ -419,10 +420,11 @@ static struct BitMap *ami_bitmap_get_truecolour(struct bitmap *bitmap,int width,
ri.BytesPerRow = bitmap->width * 4;
ri.RGBFormat = AMI_BITMAP_FORMAT;
- if((tbm = p96AllocBitMap(bitmap->width, bitmap->height, 32, 0,
+ if((tbm = ami_rtg_allocbitmap(bitmap->width, bitmap->height, 32, 0,
friendbm, AMI_BITMAP_FORMAT))) {
InitRastPort(&trp);
trp.BitMap = tbm;
+ /*\todo abstract p96WritePixelArray */
p96WritePixelArray((struct RenderInfo *)&ri, 0, 0, &trp, 0, 0,
bitmap->width, bitmap->height);
}
@@ -440,7 +442,7 @@ static struct BitMap *ami_bitmap_get_truecolour(struct bitmap *bitmap,int width,
struct BitMap *scaledbm;
struct BitScaleArgs bsa;
- scaledbm = p96AllocBitMap(width, height, 32, BMF_DISPLAYABLE,
+ scaledbm = ami_rtg_allocbitmap(width, height, 32, BMF_DISPLAYABLE,
friendbm, AMI_BITMAP_FORMAT);
if(GfxBase->LibNode.lib_Version >= 53) // AutoDoc says v52, but this function isn't in OS4.0, so checking for v53 (OS4.1)
@@ -482,8 +484,8 @@ static struct BitMap *ami_bitmap_get_truecolour(struct bitmap *bitmap,int width,
BitMapScale(&bsa);
}
- if(bitmap->nativebm != tbm) p96FreeBitMap(bitmap->nativebm);
- p96FreeBitMap(tbm);
+ if(bitmap->nativebm != tbm) ami_rtg_freebitmap(bitmap->nativebm);
+ ami_rtg_freebitmap(tbm);
tbm = scaledbm;
bitmap->nativebm = NULL;
diff --git a/amiga/gui.c b/amiga/gui.c
index eeb3942..5d0504c 100644
--- a/amiga/gui.c
+++ b/amiga/gui.c
@@ -35,7 +35,6 @@
#include <proto/keymap.h>
#include <proto/locale.h>
#ifdef __amigaos4__
-#include <proto/Picasso96API.h>
#include <proto/popupmenu.h>
#endif
#include <proto/utility.h>
@@ -142,6 +141,7 @@
#include "amiga/plotters.h"
#include "amiga/plugin_hack.h"
#include "amiga/print.h"
+#include "amiga/rtg.h"
#include "amiga/schedule.h"
#include "amiga/search.h"
#include "amiga/theme.h"
@@ -2844,7 +2844,7 @@ void ami_switch_tab(struct gui_window_2 *gwin, bool redraw)
RefreshSetGadgetAttrs((struct Gadget *)gwin->objects[GID_URL],
gwin->win, NULL, STRINGA_TextVal, "", TAG_DONE);
- p96RectFill(gwin->win->RPort, bbox->Left, bbox->Top,
+ ami_rtg_rectfill(gwin->win->RPort, bbox->Left, bbox->Top,
bbox->Width+bbox->Left, bbox->Height+bbox->Top, 0xffffffff);
ami_gui_free_space_box(bbox);
@@ -2859,7 +2859,7 @@ void ami_switch_tab(struct gui_window_2 *gwin, bool redraw)
{
gui_window_set_icon(gwin->gw, gwin->gw->favicon);
- p96RectFill(gwin->win->RPort, bbox->Left, bbox->Top,
+ ami_rtg_rectfill(gwin->win->RPort, bbox->Left, bbox->Top,
bbox->Width+bbox->Left, bbox->Height+bbox->Top, 0xffffffff);
browser_window_update(gwin->gw->bw, false);
diff --git a/amiga/libs.c b/amiga/libs.c
index 9ac9589..b964d8f 100644
--- a/amiga/libs.c
+++ b/amiga/libs.c
@@ -37,7 +37,7 @@
} else { \
LOG(("Failed to open %s v%d", LIB, LIBVER)); \
if(FAIL == true) { \
- STRPTR error = ASPrintf("Unable to open %s v%d", LIB, LIBVER); \
+ STRPTR error = ASPrintf("Unable to open %s v%d (fatal error)", LIB, LIBVER); \
ami_misc_fatal_error(error); \
FreeVec(error); \
return false; \
@@ -58,7 +58,7 @@
} else { \
LOG(("Failed to open %s v%d", LIB, LIBVER)); \
if(FAIL == true) { \
- STRPTR error = ASPrintf("Unable to open %s v%d", LIB, LIBVER); \
+ STRPTR error = ASPrintf("Unable to open %s v%d (fatal error)", LIB, LIBVER); \
ami_misc_fatal_error(error); \
FreeVec(error); \
return false; \
@@ -76,7 +76,6 @@
#ifdef __amigaos4__
AMINS_LIB_STRUCT(Application);
-AMINS_LIB_STRUCT(P96);
#else
struct UtilityBase *UtilityBase; /* AMINS_LIB_STRUCT(Utility) */
#endif
@@ -91,6 +90,7 @@ AMINS_LIB_STRUCT(Intuition);
AMINS_LIB_STRUCT(Keymap);
AMINS_LIB_STRUCT(Layers);
AMINS_LIB_STRUCT(Locale);
+AMINS_LIB_STRUCT(P96);
AMINS_LIB_STRUCT(Workbench);
AMINS_LIB_STRUCT(ARexx);
@@ -120,7 +120,6 @@ bool ami_libs_open(void)
#ifdef __amigaos4__
/* Libraries only needed on OS4 */
AMINS_LIB_OPEN("application.library", 53, Application, "application", 2, false)
- AMINS_LIB_OPEN("Picasso96API.library", 0, P96, "main", 1, true)
#else
/* Libraries we get automatically on OS4 but not OS3 */
AMINS_LIB_OPEN("utility.library", 37, Utility, "main", 1, true)
@@ -139,6 +138,11 @@ bool ami_libs_open(void)
AMINS_LIB_OPEN("locale.library", 37, Locale, "main", 1, true)
AMINS_LIB_OPEN("workbench.library", 37, Workbench, "main", 1, true)
+ /*\todo This is down here as we need to check the graphics.library version
+ * before opening. If it is sufficiently new enough we can avoid using P96
+ */
+ AMINS_LIB_OPEN("Picasso96API.library", 0, P96, "main", 1, false)
+
/* NB: timer.device is opened in schedule.c (ultimately by the scheduler process).
* The library base and interface are obtained there, rather than here, due to
* the additional complexities of opening devices, which aren't important here
@@ -213,10 +217,10 @@ void ami_libs_close(void)
AMINS_LIB_CLOSE(Keymap)
AMINS_LIB_CLOSE(Layers)
AMINS_LIB_CLOSE(Locale)
+ AMINS_LIB_CLOSE(P96)
AMINS_LIB_CLOSE(Workbench)
#ifdef __amigaos4__
AMINS_LIB_CLOSE(Application)
- AMINS_LIB_CLOSE(P96)
#else
AMINS_LIB_CLOSE(Utility)
#endif
diff --git a/amiga/os3support.h b/amiga/os3support.h
index a8c5aba..a329cc9 100644
--- a/amiga/os3support.h
+++ b/amiga/os3support.h
@@ -150,9 +150,7 @@
#define ShowWindow(...) (void)0
/* P96 */
-#define p96FreeBitMap(B) FreeBitMap(B)
-#define p96AllocBitMap(W,H,D,FL,FR,FM) AllocBitMap(W,H,D,FL,FR)
-#define p96RectFill(RP,X,Y,XW,YH,C) RectFill(RP,X,Y,XW,YH) /* Needs pen */
+#define p96WritePixelArray (void)0 /* TODO - see rtg.c */
/* Utility */
#define SetMem memset
diff --git a/amiga/plotters.c b/amiga/plotters.c
index eaf7751..58aee5a 100755
--- a/amiga/plotters.c
+++ b/amiga/plotters.c
@@ -18,9 +18,6 @@
#include "amiga/os3support.h"
-#ifdef __amigaos4__
-#include <proto/Picasso96API.h>
-#endif
#include <proto/exec.h>
#include <proto/intuition.h>
@@ -134,10 +131,10 @@ void ami_init_layers(struct gui_globals *gg, ULONG width, ULONG height)
gg->bm = AllocBitMap(width, height, depth,
BMF_INTERLEAVED | BMF_DISPLAYABLE, friend);
} else {
- gg->bm = p96AllocBitMap(width, height, 32,
+ gg->bm = ami_rtg_allocbitmap(width, height, 32,
BMF_INTERLEAVED | BMF_DISPLAYABLE, friend, RGBFB_A8R8G8B8);
}
-
+
if(!gg->bm) warn_user("NoMemory","");
gg->rp = AllocVecTagList(sizeof(struct RastPort), NULL);
@@ -167,8 +164,7 @@ void ami_init_layers(struct gui_globals *gg, ULONG width, ULONG height)
void ami_free_layers(struct gui_globals *gg)
{
- if(gg->rp)
- {
+ if(gg->rp) {
DeleteLayer(0,gg->rp->Layer);
FreeVec(gg->rp->TmpRas);
FreeVec(gg->rp->AreaInfo);
@@ -179,7 +175,7 @@ void ami_free_layers(struct gui_globals *gg)
FreeVec(gg->areabuf);
DisposeLayerInfo(gg->layerinfo);
if(palette_mapped == false) {
- p96FreeBitMap(gg->bm);
+ ami_rtg_freebitmap(gg->bm);
} else {
FreeBitMap(gg->bm);
}
@@ -550,9 +546,8 @@ static bool ami_bitmap(int x, int y, int width, int height, struct bitmap *bitma
#endif
}
- if((bitmap->dto == NULL) && (tbm != bitmap->nativebm))
- {
- p96FreeBitMap(tbm);
+ if((bitmap->dto == NULL) && (tbm != bitmap->nativebm)) {
+ ami_rtg_freebitmap(tbm);
}
return true;
@@ -654,7 +649,7 @@ bool ami_bitmap_tile(int x, int y, int width, int height,
if((bitmap->dto == NULL) && (tbm != bitmap->nativebm))
{
- p96FreeBitMap(tbm);
+ ami_rtg_freebitmap(tbm);
}
#else
#warning FIXME: bitmap tiling uses backfill hooks
commitdiff http://git.netsurf-browser.org/netsurf.git/commit/?id=d0f7247ea67491b4bfa...
commit d0f7247ea67491b4bfae28cb90538b68c6f83d70
Merge: 65ab38f 2b9df1b
Author: Chris Young <chris(a)unsatisfactorysoftware.co.uk>
Commit: Chris Young <chris(a)unsatisfactorysoftware.co.uk>
Merge branch 'master' of git://git.netsurf-browser.org/netsurf
commitdiff http://git.netsurf-browser.org/netsurf.git/commit/?id=65ab38fc1c26bed356f...
commit 65ab38fc1c26bed356fc61dd4adfe1f0495fab65
Author: Chris Young <chris(a)unsatisfactorysoftware.co.uk>
Commit: Chris Young <chris(a)unsatisfactorysoftware.co.uk>
Clear a selection after it has been copied, as per the AmigaOS Style Guide
diff --git a/amiga/gui.c b/amiga/gui.c
index b24ae1c..6f2f402 100644
--- a/amiga/gui.c
+++ b/amiga/gui.c
@@ -1207,7 +1207,6 @@ int ami_key_to_nskey(ULONG keycode, struct InputEvent *ie)
break;
case 'c':
nskey = KEY_COPY_SELECTION;
- /**\todo this should also send KEY_CLEAR_SELECTION */
break;
case 'v':
nskey = KEY_PASTE;
@@ -2393,6 +2392,9 @@ static void ami_handle_msg(void)
ami_help_open(AMI_HELP_GUI, scrn);
break;
}
+ } else if(nskey == KEY_COPY_SELECTION) {
+ /* if we've copied a selection we need to clear it - style guide rules */
+ browser_window_key_press(gwin->gw->bw, KEY_CLEAR_SELECTION);
}
}
break;
diff --git a/amiga/tree.c b/amiga/tree.c
index 75ba123..e44c821 100644
--- a/amiga/tree.c
+++ b/amiga/tree.c
@@ -1183,6 +1183,10 @@ BOOL ami_tree_event(struct treeview_window *twin)
GetAttr(WINDOW_InputEvent,twin->objects[OID_MAIN],(ULONG *)&ie);
nskey = ami_key_to_nskey(storage, ie);
tree_keypress(twin->tree, nskey);
+ if(nskey == KEY_COPY_SELECTION) {
+ /* if we've copied a selection we need to clear it - style guide rules */
+ tree_keypress(twin->tree, KEY_CLEAR_SELECTION);
+ }
break;
case WMHI_MENUPICK:
-----------------------------------------------------------------------
Summary of changes:
amiga/Makefile.target | 2 +-
amiga/bitmap.c | 28 +++++++------------
amiga/gui.c | 13 +++++----
amiga/gui_options.c | 1 +
amiga/history_local.c | 4 ++-
amiga/libs.c | 14 ++++++----
amiga/login.c | 7 +++--
amiga/menu.c | 1 +
amiga/os3support.h | 4 +--
amiga/plotters.c | 20 ++++++-------
amiga/rtg.c | 74 +++++++++++++++++++++++++++++++++++++++++++++++++
amiga/rtg.h | 39 ++++++++++++++++++++++++++
amiga/search.c | 4 ++-
amiga/tree.c | 4 +++
14 files changed, 167 insertions(+), 48 deletions(-)
create mode 100644 amiga/rtg.c
create mode 100644 amiga/rtg.h
diff --git a/amiga/Makefile.target b/amiga/Makefile.target
index ec47826..a9de6ee 100644
--- a/amiga/Makefile.target
+++ b/amiga/Makefile.target
@@ -73,7 +73,7 @@ S_AMIGA := gui.c tree.c history.c hotlist.c schedule.c file.c \
launch.c search.c history_local.c download.c iff_dr2d.c \
sslcert.c gui_options.c print.c theme.c drag.c icon.c libs.c \
datatypes.c dt_picture.c dt_anim.c dt_sound.c plugin_hack.c \
- stringview/stringview.c stringview/urlhistory.c \
+ stringview/stringview.c stringview/urlhistory.c rtg.c \
agclass/amigaguide_class.c fs_backing_store.c os3support.c
S_AMIGA := $(addprefix amiga/,$(S_AMIGA))
diff --git a/amiga/bitmap.c b/amiga/bitmap.c
index b7eb129..7c676df 100644
--- a/amiga/bitmap.c
+++ b/amiga/bitmap.c
@@ -20,7 +20,6 @@
#include <proto/exec.h>
#ifdef __amigaos4__
-#include <proto/Picasso96API.h>
#include <graphics/blitattr.h>
#include <graphics/composite.h>
#endif
@@ -41,6 +40,7 @@
#include "amiga/bitmap.h"
#include "amiga/download.h"
#include "amiga/misc.h"
+#include "amiga/rtg.h"
/**
* Create a bitmap.
@@ -122,7 +122,7 @@ void bitmap_destroy(void *bitmap)
if(bm)
{
if((bm->nativebm) && (bm->dto == NULL)) {
- p96FreeBitMap(bm->nativebm);
+ ami_rtg_freebitmap(bm->nativebm);
}
if(bm->dto) {
@@ -180,7 +180,7 @@ void bitmap_modified(void *bitmap) {
struct bitmap *bm = bitmap;
if((bm->nativebm) && (bm->dto == NULL))
- p96FreeBitMap(bm->nativebm);
+ ami_rtg_freebitmap(bm->nativebm);
if(bm->dto) DisposeDTObject(bm->dto);
if(bm->native_mask) FreeRaster(bm->native_mask, bm->width, bm->height);
@@ -389,9 +389,7 @@ struct bitmap *ami_bitmap_from_datatype(char *filename)
static struct BitMap *ami_bitmap_get_truecolour(struct bitmap *bitmap,int width,int height,struct BitMap *friendbm)
{
#ifdef __amigaos4__
- struct RenderInfo ri;
struct BitMap *tbm = NULL;
- struct RastPort trp;
if(!bitmap) return NULL;
@@ -408,23 +406,17 @@ static struct BitMap *ami_bitmap_get_truecolour(struct bitmap *bitmap,int width,
}
else
{
- if(bitmap->nativebm) p96FreeBitMap(bitmap->nativebm);
+ if(bitmap->nativebm) ami_rtg_freebitmap(bitmap->nativebm);
bitmap->nativebm = NULL;
}
}
if(!tbm)
{
- ri.Memory = bitmap->pixdata;
- ri.BytesPerRow = bitmap->width * 4;
- ri.RGBFormat = AMI_BITMAP_FORMAT;
-
- if((tbm = p96AllocBitMap(bitmap->width, bitmap->height, 32, 0,
+ if((tbm = ami_rtg_allocbitmap(bitmap->width, bitmap->height, 32, 0,
friendbm, AMI_BITMAP_FORMAT))) {
- InitRastPort(&trp);
- trp.BitMap = tbm;
- p96WritePixelArray((struct RenderInfo *)&ri, 0, 0, &trp, 0, 0,
- bitmap->width, bitmap->height);
+ ami_rtg_writepixelarray(bitmap->pixdata, tbm, bitmap->width, bitmap->height,
+ bitmap->width * 4, AMI_BITMAP_FORMAT);
}
if(nsoption_int(cache_bitmaps) == 2)
@@ -440,7 +432,7 @@ static struct BitMap *ami_bitmap_get_truecolour(struct bitmap *bitmap,int width,
struct BitMap *scaledbm;
struct BitScaleArgs bsa;
- scaledbm = p96AllocBitMap(width, height, 32, BMF_DISPLAYABLE,
+ scaledbm = ami_rtg_allocbitmap(width, height, 32, BMF_DISPLAYABLE,
friendbm, AMI_BITMAP_FORMAT);
if(GfxBase->LibNode.lib_Version >= 53) // AutoDoc says v52, but this function isn't in OS4.0, so checking for v53 (OS4.1)
@@ -482,8 +474,8 @@ static struct BitMap *ami_bitmap_get_truecolour(struct bitmap *bitmap,int width,
BitMapScale(&bsa);
}
- if(bitmap->nativebm != tbm) p96FreeBitMap(bitmap->nativebm);
- p96FreeBitMap(tbm);
+ if(bitmap->nativebm != tbm) ami_rtg_freebitmap(bitmap->nativebm);
+ ami_rtg_freebitmap(tbm);
tbm = scaledbm;
bitmap->nativebm = NULL;
diff --git a/amiga/gui.c b/amiga/gui.c
index bede048..ad70f2f 100644
--- a/amiga/gui.c
+++ b/amiga/gui.c
@@ -35,7 +35,6 @@
#include <proto/keymap.h>
#include <proto/locale.h>
#ifdef __amigaos4__
-#include <proto/Picasso96API.h>
#include <proto/popupmenu.h>
#endif
#include <proto/utility.h>
@@ -142,6 +141,7 @@
#include "amiga/plotters.h"
#include "amiga/plugin_hack.h"
#include "amiga/print.h"
+#include "amiga/rtg.h"
#include "amiga/schedule.h"
#include "amiga/search.h"
#include "amiga/theme.h"
@@ -1214,7 +1214,6 @@ int ami_key_to_nskey(ULONG keycode, struct InputEvent *ie)
break;
case 'c':
nskey = KEY_COPY_SELECTION;
- /**\todo this should also send KEY_CLEAR_SELECTION */
break;
case 'v':
nskey = KEY_PASTE;
@@ -1566,9 +1565,10 @@ static bool ami_gui_vscroll_add(struct gui_window_2 *gwin)
ICA_TARGET, ICTARGET_IDCMP,
ScrollerEnd;
#ifdef __amigaos4__
-#warning FIXME for OS3
IDoMethod(gwin->objects[GID_VSCROLLLAYOUT], LM_ADDCHILD,
gwin->win, gwin->objects[GID_VSCROLL], attrs);
+#else
+#warning FIXME for OS3
#endif
return true;
}
@@ -2416,6 +2416,9 @@ static void ami_handle_msg(void)
ami_help_open(AMI_HELP_GUI, scrn);
break;
}
+ } else if(nskey == KEY_COPY_SELECTION) {
+ /* if we've copied a selection we need to clear it - style guide rules */
+ browser_window_key_press(gwin->gw->bw, KEY_CLEAR_SELECTION);
}
}
break;
@@ -2842,7 +2845,7 @@ void ami_switch_tab(struct gui_window_2 *gwin, bool redraw)
RefreshSetGadgetAttrs((struct Gadget *)gwin->objects[GID_URL],
gwin->win, NULL, STRINGA_TextVal, "", TAG_DONE);
- p96RectFill(gwin->win->RPort, bbox->Left, bbox->Top,
+ ami_rtg_rectfill(gwin->win->RPort, bbox->Left, bbox->Top,
bbox->Width+bbox->Left, bbox->Height+bbox->Top, 0xffffffff);
ami_gui_free_space_box(bbox);
@@ -2857,7 +2860,7 @@ void ami_switch_tab(struct gui_window_2 *gwin, bool redraw)
{
gui_window_set_icon(gwin->gw, gwin->gw->favicon);
- p96RectFill(gwin->win->RPort, bbox->Left, bbox->Top,
+ ami_rtg_rectfill(gwin->win->RPort, bbox->Left, bbox->Top,
bbox->Width+bbox->Left, bbox->Height+bbox->Top, 0xffffffff);
browser_window_update(gwin->gw->bw, false);
diff --git a/amiga/gui_options.c b/amiga/gui_options.c
index 2187c30..e64d3d9 100755
--- a/amiga/gui_options.c
+++ b/amiga/gui_options.c
@@ -68,6 +68,7 @@
#include "amiga/gui.h"
#include "amiga/gui_options.h"
#include "amiga/help.h"
+#include "amiga/misc.h"
#include "amiga/object.h"
#include "amiga/theme.h"
#include "amiga/utf8.h"
diff --git a/amiga/history_local.c b/amiga/history_local.c
index c8c7b72..2484ffb 100755
--- a/amiga/history_local.c
+++ b/amiga/history_local.c
@@ -22,6 +22,8 @@
* There is only one history window, not one per browser window.
*/
+#include "amiga/os3support.h"
+
#include <stdbool.h>
#include <stdlib.h>
#include <string.h>
@@ -48,7 +50,7 @@
#include "desktop/gui_window.h"
#include "graphics/rpattr.h"
-#include "amiga/os3support.h"
+#include "amiga/misc.h"
#include "amiga/object.h"
#include "amiga/gui.h"
#include "amiga/history_local.h"
diff --git a/amiga/libs.c b/amiga/libs.c
index 9ac9589..b964d8f 100644
--- a/amiga/libs.c
+++ b/amiga/libs.c
@@ -37,7 +37,7 @@
} else { \
LOG(("Failed to open %s v%d", LIB, LIBVER)); \
if(FAIL == true) { \
- STRPTR error = ASPrintf("Unable to open %s v%d", LIB, LIBVER); \
+ STRPTR error = ASPrintf("Unable to open %s v%d (fatal error)", LIB, LIBVER); \
ami_misc_fatal_error(error); \
FreeVec(error); \
return false; \
@@ -58,7 +58,7 @@
} else { \
LOG(("Failed to open %s v%d", LIB, LIBVER)); \
if(FAIL == true) { \
- STRPTR error = ASPrintf("Unable to open %s v%d", LIB, LIBVER); \
+ STRPTR error = ASPrintf("Unable to open %s v%d (fatal error)", LIB, LIBVER); \
ami_misc_fatal_error(error); \
FreeVec(error); \
return false; \
@@ -76,7 +76,6 @@
#ifdef __amigaos4__
AMINS_LIB_STRUCT(Application);
-AMINS_LIB_STRUCT(P96);
#else
struct UtilityBase *UtilityBase; /* AMINS_LIB_STRUCT(Utility) */
#endif
@@ -91,6 +90,7 @@ AMINS_LIB_STRUCT(Intuition);
AMINS_LIB_STRUCT(Keymap);
AMINS_LIB_STRUCT(Layers);
AMINS_LIB_STRUCT(Locale);
+AMINS_LIB_STRUCT(P96);
AMINS_LIB_STRUCT(Workbench);
AMINS_LIB_STRUCT(ARexx);
@@ -120,7 +120,6 @@ bool ami_libs_open(void)
#ifdef __amigaos4__
/* Libraries only needed on OS4 */
AMINS_LIB_OPEN("application.library", 53, Application, "application", 2, false)
- AMINS_LIB_OPEN("Picasso96API.library", 0, P96, "main", 1, true)
#else
/* Libraries we get automatically on OS4 but not OS3 */
AMINS_LIB_OPEN("utility.library", 37, Utility, "main", 1, true)
@@ -139,6 +138,11 @@ bool ami_libs_open(void)
AMINS_LIB_OPEN("locale.library", 37, Locale, "main", 1, true)
AMINS_LIB_OPEN("workbench.library", 37, Workbench, "main", 1, true)
+ /*\todo This is down here as we need to check the graphics.library version
+ * before opening. If it is sufficiently new enough we can avoid using P96
+ */
+ AMINS_LIB_OPEN("Picasso96API.library", 0, P96, "main", 1, false)
+
/* NB: timer.device is opened in schedule.c (ultimately by the scheduler process).
* The library base and interface are obtained there, rather than here, due to
* the additional complexities of opening devices, which aren't important here
@@ -213,10 +217,10 @@ void ami_libs_close(void)
AMINS_LIB_CLOSE(Keymap)
AMINS_LIB_CLOSE(Layers)
AMINS_LIB_CLOSE(Locale)
+ AMINS_LIB_CLOSE(P96)
AMINS_LIB_CLOSE(Workbench)
#ifdef __amigaos4__
AMINS_LIB_CLOSE(Application)
- AMINS_LIB_CLOSE(P96)
#else
AMINS_LIB_CLOSE(Utility)
#endif
diff --git a/amiga/login.c b/amiga/login.c
index fe476ac..611ba2a 100755
--- a/amiga/login.c
+++ b/amiga/login.c
@@ -16,10 +16,13 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
+#include "amiga/os3support.h"
+
+#include <assert.h>
+
#include <proto/exec.h>
#include <proto/intuition.h>
#include <proto/utility.h>
-#include <assert.h>
#include <proto/window.h>
#include <proto/layout.h>
@@ -39,8 +42,8 @@
#include "desktop/mouse.h"
#include "desktop/gui_window.h"
-#include "amiga/os3support.h"
#include "amiga/gui.h"
+#include "amiga/misc.h"
#include "amiga/object.h"
#include "amiga/login.h"
diff --git a/amiga/menu.c b/amiga/menu.c
index 1fef12b..111b165 100644
--- a/amiga/menu.c
+++ b/amiga/menu.c
@@ -62,6 +62,7 @@
#include "amiga/history_local.h"
#include "amiga/hotlist.h"
#include "amiga/menu.h"
+#include "amiga/misc.h"
#include "amiga/print.h"
#include "amiga/search.h"
#include "amiga/theme.h"
diff --git a/amiga/os3support.h b/amiga/os3support.h
index a8c5aba..a329cc9 100644
--- a/amiga/os3support.h
+++ b/amiga/os3support.h
@@ -150,9 +150,7 @@
#define ShowWindow(...) (void)0
/* P96 */
-#define p96FreeBitMap(B) FreeBitMap(B)
-#define p96AllocBitMap(W,H,D,FL,FR,FM) AllocBitMap(W,H,D,FL,FR)
-#define p96RectFill(RP,X,Y,XW,YH,C) RectFill(RP,X,Y,XW,YH) /* Needs pen */
+#define p96WritePixelArray (void)0 /* TODO - see rtg.c */
/* Utility */
#define SetMem memset
diff --git a/amiga/plotters.c b/amiga/plotters.c
index eaf7751..2952f10 100755
--- a/amiga/plotters.c
+++ b/amiga/plotters.c
@@ -18,9 +18,6 @@
#include "amiga/os3support.h"
-#ifdef __amigaos4__
-#include <proto/Picasso96API.h>
-#endif
#include <proto/exec.h>
#include <proto/intuition.h>
@@ -48,6 +45,7 @@
#include "amiga/bitmap.h"
#include "amiga/font.h"
#include "amiga/gui.h"
+#include "amiga/rtg.h"
#include "amiga/utf8.h"
#ifdef __amigaos4__
@@ -134,10 +132,10 @@ void ami_init_layers(struct gui_globals *gg, ULONG width, ULONG height)
gg->bm = AllocBitMap(width, height, depth,
BMF_INTERLEAVED | BMF_DISPLAYABLE, friend);
} else {
- gg->bm = p96AllocBitMap(width, height, 32,
+ gg->bm = ami_rtg_allocbitmap(width, height, 32,
BMF_INTERLEAVED | BMF_DISPLAYABLE, friend, RGBFB_A8R8G8B8);
}
-
+
if(!gg->bm) warn_user("NoMemory","");
gg->rp = AllocVecTagList(sizeof(struct RastPort), NULL);
@@ -167,8 +165,7 @@ void ami_init_layers(struct gui_globals *gg, ULONG width, ULONG height)
void ami_free_layers(struct gui_globals *gg)
{
- if(gg->rp)
- {
+ if(gg->rp) {
DeleteLayer(0,gg->rp->Layer);
FreeVec(gg->rp->TmpRas);
FreeVec(gg->rp->AreaInfo);
@@ -179,7 +176,7 @@ void ami_free_layers(struct gui_globals *gg)
FreeVec(gg->areabuf);
DisposeLayerInfo(gg->layerinfo);
if(palette_mapped == false) {
- p96FreeBitMap(gg->bm);
+ ami_rtg_freebitmap(gg->bm);
} else {
FreeBitMap(gg->bm);
}
@@ -550,9 +547,8 @@ static bool ami_bitmap(int x, int y, int width, int height, struct bitmap *bitma
#endif
}
- if((bitmap->dto == NULL) && (tbm != bitmap->nativebm))
- {
- p96FreeBitMap(tbm);
+ if((bitmap->dto == NULL) && (tbm != bitmap->nativebm)) {
+ ami_rtg_freebitmap(tbm);
}
return true;
@@ -654,7 +650,7 @@ bool ami_bitmap_tile(int x, int y, int width, int height,
if((bitmap->dto == NULL) && (tbm != bitmap->nativebm))
{
- p96FreeBitMap(tbm);
+ ami_rtg_freebitmap(tbm);
}
#else
#warning FIXME: bitmap tiling uses backfill hooks
diff --git a/amiga/rtg.c b/amiga/rtg.c
new file mode 100644
index 0000000..0b51076
--- /dev/null
+++ b/amiga/rtg.c
@@ -0,0 +1,74 @@
+/*
+ * Copyright 2014 Chris Young <chris(a)unsatisfactorsysoftware.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
+ * Abstract RTG functions for newer/older/non-P96 systems
+ */
+
+#include "amiga/rtg.h"
+
+/**\todo p96WritePixelArray */
+
+struct BitMap *ami_rtg_allocbitmap(ULONG width, ULONG height, ULONG depth,
+ ULONG flags, struct BitMap *friend, RGBFTYPE format)
+{
+ if(P96Base == NULL) {
+ return AllocBitMap(width, height, depth, flags, friend);
+ } else {
+ return p96AllocBitMap(width, height, depth, flags, friend, format);
+ }
+}
+
+void ami_rtg_freebitmap(struct BitMap *bm)
+{
+ if(P96Base == NULL) {
+ return FreeBitMap(bm);
+ } else {
+ return p96FreeBitMap(bm);
+ }
+}
+
+void ami_rtg_rectfill(struct RastPort *rp, UWORD min_x, UWORD min_y,
+ UWORD max_x, UWORD max_y, ULONG colour)
+{
+ if(P96Base == NULL) {
+ return RectFill(rp, min_x, min_y, max_x, max_y);
+ } else {
+ return p96RectFill(rp, min_x, min_y, max_x, max_y, colour);
+ }
+}
+
+void ami_rtg_writepixelarray(UBYTE *pixdata, struct BitMap *bm,
+ ULONG width, ULONG height, ULONG bpr, ULONG format)
+{
+ struct RenderInfo ri;
+ struct RastPort trp;
+
+ /* This requires P96 currently */
+ if(P96Base == NULL) return;
+
+ ri.Memory = pixdata;
+ ri.BytesPerRow = bpr;
+ ri.RGBFormat = format;
+
+ InitRastPort(&trp);
+ trp.BitMap = bm;
+
+ p96WritePixelArray((struct RenderInfo *)&ri, 0, 0, &trp, 0, 0, width, height);
+}
+
diff --git a/amiga/rtg.h b/amiga/rtg.h
new file mode 100644
index 0000000..ea49e4c
--- /dev/null
+++ b/amiga/rtg.h
@@ -0,0 +1,39 @@
+/*
+ * Copyright 2014 Chris Young <chris(a)unsatisfactorsysoftware.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
+ * Abstract RTG functions for newer/older/non-P96 systems
+ */
+
+#ifndef AMIGA_RTG_H
+#define AMIGA_RTG_H 1
+#include <proto/graphics.h>
+#include <proto/Picasso96API.h>
+
+/* Wrappers for Alloc/FreeBitMap and RectFill */
+struct BitMap *ami_rtg_allocbitmap(ULONG width, ULONG height, ULONG depth,
+ ULONG flags, struct BitMap *friend, RGBFTYPE format);
+void ami_rtg_freebitmap(struct BitMap *bm);
+void ami_rtg_rectfill(struct RastPort *rp, UWORD min_x, UWORD min_y,
+ UWORD max_x, UWORD max_y, ULONG colour);
+
+/* WritePixelArray wrapper. This isn't entirely (at all) equivalent to p96WPA */
+void ami_rtg_writepixelarray(UBYTE *pixdata, struct BitMap *bm,
+ ULONG width, ULONG height, ULONG bpr, ULONG format);
+#endif
+
diff --git a/amiga/search.c b/amiga/search.c
index ab32abb..b974651 100755
--- a/amiga/search.c
+++ b/amiga/search.c
@@ -22,6 +22,8 @@
* Free text search (implementation)
*/
+#include "amiga/os3support.h"
+
#include "utils/config.h"
#include <ctype.h>
#include <string.h>
@@ -52,7 +54,7 @@
#include "desktop/gui_window.h"
#include "desktop/gui_search.h"
-#include "amiga/os3support.h"
+#include "amiga/misc.h"
#include "amiga/search.h"
#include "amiga/object.h"
#include "amiga/theme.h"
diff --git a/amiga/tree.c b/amiga/tree.c
index 5d453b6..1785a9d 100644
--- a/amiga/tree.c
+++ b/amiga/tree.c
@@ -1196,6 +1196,10 @@ BOOL ami_tree_event(struct treeview_window *twin)
GetAttr(WINDOW_InputEvent,twin->objects[OID_MAIN],(ULONG *)&ie);
nskey = ami_key_to_nskey(storage, ie);
tree_keypress(twin->tree, nskey);
+ if(nskey == KEY_COPY_SELECTION) {
+ /* if we've copied a selection we need to clear it - style guide rules */
+ tree_keypress(twin->tree, KEY_CLEAR_SELECTION);
+ }
break;
case WMHI_MENUPICK:
--
NetSurf Browser
8 years
netsurf: branch master updated. release/3.2-606-g2b9df1b
by NetSurf Browser Project
Gitweb links:
...log http://git.netsurf-browser.org/netsurf.git/shortlog/2b9df1b2cd30e394ebb4e...
...commit http://git.netsurf-browser.org/netsurf.git/commit/2b9df1b2cd30e394ebb4e9b...
...tree http://git.netsurf-browser.org/netsurf.git/tree/2b9df1b2cd30e394ebb4e9be7...
The branch, master has been updated
via 2b9df1b2cd30e394ebb4e9be721b7d219c4e418c (commit)
via 4cf9d888ff901dbfbaee0d3460068300e014e724 (commit)
via f3cf042184a6a4ff8bda7d3693e1a33bb2111023 (commit)
from 0c526662b33697f2ebb132b5018494ec699da27f (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=2b9df1b2cd30e394ebb...
commit 2b9df1b2cd30e394ebb4e9be721b7d219c4e418c
Author: Chris Young <chris(a)unsatisfactorysoftware.co.uk>
Commit: Chris Young <chris(a)unsatisfactorysoftware.co.uk>
Remove some p96 usage
diff --git a/amiga/bitmap.c b/amiga/bitmap.c
index e7bd72c..b7eb129 100644
--- a/amiga/bitmap.c
+++ b/amiga/bitmap.c
@@ -19,8 +19,8 @@
#include "amiga/os3support.h"
#include <proto/exec.h>
-#include <proto/Picasso96API.h>
#ifdef __amigaos4__
+#include <proto/Picasso96API.h>
#include <graphics/blitattr.h>
#include <graphics/composite.h>
#endif
@@ -388,6 +388,7 @@ struct bitmap *ami_bitmap_from_datatype(char *filename)
static struct BitMap *ami_bitmap_get_truecolour(struct bitmap *bitmap,int width,int height,struct BitMap *friendbm)
{
+#ifdef __amigaos4__
struct RenderInfo ri;
struct BitMap *tbm = NULL;
struct RastPort trp;
@@ -495,6 +496,7 @@ static struct BitMap *ami_bitmap_get_truecolour(struct bitmap *bitmap,int width,
}
return tbm;
+#endif
}
PLANEPTR ami_bitmap_get_mask(struct bitmap *bitmap, int width,
@@ -581,3 +583,4 @@ struct BitMap *ami_bitmap_get_native(struct bitmap *bitmap,
return ami_bitmap_get_truecolour(bitmap, width, height, friendbm);
}
}
+
diff --git a/amiga/gui.c b/amiga/gui.c
index 534637b..bede048 100644
--- a/amiga/gui.c
+++ b/amiga/gui.c
@@ -34,8 +34,8 @@
#include <proto/intuition.h>
#include <proto/keymap.h>
#include <proto/locale.h>
-#include <proto/Picasso96API.h>
#ifdef __amigaos4__
+#include <proto/Picasso96API.h>
#include <proto/popupmenu.h>
#endif
#include <proto/utility.h>
@@ -5174,6 +5174,11 @@ Object *ami_gui_splash_open(void)
LAYOUT_AddImage, bm_obj = BitMapObject,
BITMAP_SourceFile, "PROGDIR:Resources/splash.png",
BITMAP_Screen, wbscreen,
+ BITMAP_Precision, PRECISION_IMAGE,
+#ifndef __amigaos4__
+ BITMAP_Width, 400,
+ BITMAP_Height, 250,
+#endif
BitMapEnd,
LayoutEnd,
EndWindow;
diff --git a/amiga/libs.c b/amiga/libs.c
index 4deb88a..9ac9589 100644
--- a/amiga/libs.c
+++ b/amiga/libs.c
@@ -76,6 +76,7 @@
#ifdef __amigaos4__
AMINS_LIB_STRUCT(Application);
+AMINS_LIB_STRUCT(P96);
#else
struct UtilityBase *UtilityBase; /* AMINS_LIB_STRUCT(Utility) */
#endif
@@ -90,7 +91,6 @@ AMINS_LIB_STRUCT(Intuition);
AMINS_LIB_STRUCT(Keymap);
AMINS_LIB_STRUCT(Layers);
AMINS_LIB_STRUCT(Locale);
-AMINS_LIB_STRUCT(P96);
AMINS_LIB_STRUCT(Workbench);
AMINS_LIB_STRUCT(ARexx);
@@ -213,10 +213,10 @@ void ami_libs_close(void)
AMINS_LIB_CLOSE(Keymap)
AMINS_LIB_CLOSE(Layers)
AMINS_LIB_CLOSE(Locale)
- AMINS_LIB_CLOSE(P96)
AMINS_LIB_CLOSE(Workbench)
#ifdef __amigaos4__
AMINS_LIB_CLOSE(Application)
+ AMINS_LIB_CLOSE(P96)
#else
AMINS_LIB_CLOSE(Utility)
#endif
diff --git a/amiga/os3support.h b/amiga/os3support.h
index ecb6f4a..a8c5aba 100644
--- a/amiga/os3support.h
+++ b/amiga/os3support.h
@@ -149,6 +149,11 @@
#define IDoSuperMethodA DoSuperMethodA
#define ShowWindow(...) (void)0
+/* P96 */
+#define p96FreeBitMap(B) FreeBitMap(B)
+#define p96AllocBitMap(W,H,D,FL,FR,FM) AllocBitMap(W,H,D,FL,FR)
+#define p96RectFill(RP,X,Y,XW,YH,C) RectFill(RP,X,Y,XW,YH) /* Needs pen */
+
/* Utility */
#define SetMem memset
#define SNPrintf snprintf
diff --git a/amiga/plotters.c b/amiga/plotters.c
index f672e7a..eaf7751 100755
--- a/amiga/plotters.c
+++ b/amiga/plotters.c
@@ -18,7 +18,9 @@
#include "amiga/os3support.h"
+#ifdef __amigaos4__
#include <proto/Picasso96API.h>
+#endif
#include <proto/exec.h>
#include <proto/intuition.h>
diff --git a/amiga/thumbnail.c b/amiga/thumbnail.c
index 7b3c156..5333b4c 100755
--- a/amiga/thumbnail.c
+++ b/amiga/thumbnail.c
@@ -19,7 +19,9 @@
#include "amiga/os3support.h"
#include <proto/graphics.h>
+#ifdef __amigaos4__
#include <proto/Picasso96API.h>
+#endif
#include <intuition/intuition.h>
#ifdef __amigaos4__
#include <graphics/blitattr.h>
commitdiff http://git.netsurf-browser.org/netsurf.git/commit/?id=4cf9d888ff901dbfbae...
commit 4cf9d888ff901dbfbaee0d3460068300e014e724
Author: Chris Young <chris(a)unsatisfactorysoftware.co.uk>
Commit: Chris Young <chris(a)unsatisfactorysoftware.co.uk>
Fix classes paths
diff --git a/amiga/libs.c b/amiga/libs.c
index 4278d1a..4deb88a 100644
--- a/amiga/libs.c
+++ b/amiga/libs.c
@@ -155,7 +155,7 @@ bool ami_libs_open(void)
* we may as well just open them normally for now.
*/
- AMINS_LIB_OPEN("classes/arexx.class", 44, ARexx, "main", 1, true)
+ AMINS_LIB_OPEN("arexx.class", 44, ARexx, "main", 1, true)
AMINS_LIB_OPEN("images/bevel.image", 44, Bevel, "main", 1, true)
AMINS_LIB_OPEN("images/bitmap.image", 44, BitMap, "main", 1, true)
AMINS_LIB_OPEN("gadgets/checkbox.gadget", 44, CheckBox, "main", 1, true)
@@ -174,7 +174,7 @@ bool ami_libs_open(void)
AMINS_LIB_OPEN("gadgets/space.gadget", 44, Space, "main", 1, true)
AMINS_LIB_OPEN("gadgets/speedbar.gadget", 44, SpeedBar, "main", 1, true)
AMINS_LIB_OPEN("gadgets/string.gadget", 44, String, "main", 1, true)
- AMINS_LIB_OPEN("classes/window.class", 44, Window, "main", 1, true)
+ AMINS_LIB_OPEN("window.class", 44, Window, "main", 1, true)
return true;
}
commitdiff http://git.netsurf-browser.org/netsurf.git/commit/?id=f3cf042184a6a4ff8bd...
commit f3cf042184a6a4ff8bda7d3693e1a33bb2111023
Author: Chris Young <chris(a)unsatisfactorysoftware.co.uk>
Commit: Chris Young <chris(a)unsatisfactorysoftware.co.uk>
RefreshSetGadgetAttrs replacement for OS3
diff --git a/amiga/os3support.c b/amiga/os3support.c
index f69df15..3b42685 100644
--- a/amiga/os3support.c
+++ b/amiga/os3support.c
@@ -26,9 +26,13 @@
#include <inttypes.h>
#include <stdarg.h>
#include <stdio.h>
+
#include <proto/exec.h>
#include <proto/intuition.h>
#include <proto/dos.h>
+#include <proto/utility.h>
+
+#include <intuition/gadgetclass.h>
#define SUCCESS (TRUE)
#define FAILURE (FALSE)
@@ -93,6 +97,32 @@ uint32 GetAttrs(Object *obj, Tag tag1, ...)
return i;
}
+ULONG RefreshSetGadgetAttrsA(struct Gadget *g, struct Window *w, struct Requester *r, struct TagItem *tags)
+{
+ ULONG retval;
+ BOOL changedisabled = FALSE;
+ BOOL disabled;
+
+ if (w) {
+ if (FindTagItem(GA_Disabled,tags)) {
+ changedisabled = TRUE;
+ disabled = g->Flags & GFLG_DISABLED;
+ }
+ }
+ retval = SetGadgetAttrsA(g,w,r,tags);
+ if (w && (retval || (changedisabled && disabled != (g->Flags & GFLG_DISABLED)))) {
+ RefreshGList(g,w,r,1);
+ retval = 1;
+ }
+ return retval;
+}
+
+ULONG RefreshSetGadgetAttrs(struct Gadget *g, struct Window *w, struct Requester *r, Tag tag1, ...)
+{
+ return RefreshSetGadgetAttrsA(g,w,r,(struct TagItem *) &tag1);
+}
+
+
/* Utility */
struct FormatContext
{
diff --git a/amiga/os3support.h b/amiga/os3support.h
index df88cd5..ecb6f4a 100644
--- a/amiga/os3support.h
+++ b/amiga/os3support.h
@@ -147,7 +147,6 @@
#define IDoMethod DoMethod
#define IDoMethodA DoMethodA
#define IDoSuperMethodA DoSuperMethodA
-#define RefreshSetGadgetAttrs SetGadgetAttrs /*\todo This isn't quite right */
#define ShowWindow(...) (void)0
/* Utility */
@@ -225,6 +224,8 @@ struct Node *GetHead(struct List *list);
/* Intuition */
uint32 GetAttrs(Object *obj, Tag tag1, ...);
+ULONG RefreshSetGadgetAttrs(struct Gadget *g, struct Window *w, struct Requester *r, Tag tag1, ...);
+ULONG RefreshSetGadgetAttrsA(struct Gadget *g, struct Window *w, struct Requester *r, struct TagItem *tags);
/* Utility */
char *ASPrintf(const char *fmt, ...);
-----------------------------------------------------------------------
Summary of changes:
amiga/bitmap.c | 5 ++++-
amiga/gui.c | 7 ++++++-
amiga/libs.c | 8 ++++----
amiga/os3support.c | 30 ++++++++++++++++++++++++++++++
amiga/os3support.h | 8 +++++++-
amiga/plotters.c | 2 ++
amiga/thumbnail.c | 2 ++
7 files changed, 55 insertions(+), 7 deletions(-)
diff --git a/amiga/bitmap.c b/amiga/bitmap.c
index e7bd72c..b7eb129 100644
--- a/amiga/bitmap.c
+++ b/amiga/bitmap.c
@@ -19,8 +19,8 @@
#include "amiga/os3support.h"
#include <proto/exec.h>
-#include <proto/Picasso96API.h>
#ifdef __amigaos4__
+#include <proto/Picasso96API.h>
#include <graphics/blitattr.h>
#include <graphics/composite.h>
#endif
@@ -388,6 +388,7 @@ struct bitmap *ami_bitmap_from_datatype(char *filename)
static struct BitMap *ami_bitmap_get_truecolour(struct bitmap *bitmap,int width,int height,struct BitMap *friendbm)
{
+#ifdef __amigaos4__
struct RenderInfo ri;
struct BitMap *tbm = NULL;
struct RastPort trp;
@@ -495,6 +496,7 @@ static struct BitMap *ami_bitmap_get_truecolour(struct bitmap *bitmap,int width,
}
return tbm;
+#endif
}
PLANEPTR ami_bitmap_get_mask(struct bitmap *bitmap, int width,
@@ -581,3 +583,4 @@ struct BitMap *ami_bitmap_get_native(struct bitmap *bitmap,
return ami_bitmap_get_truecolour(bitmap, width, height, friendbm);
}
}
+
diff --git a/amiga/gui.c b/amiga/gui.c
index 534637b..bede048 100644
--- a/amiga/gui.c
+++ b/amiga/gui.c
@@ -34,8 +34,8 @@
#include <proto/intuition.h>
#include <proto/keymap.h>
#include <proto/locale.h>
-#include <proto/Picasso96API.h>
#ifdef __amigaos4__
+#include <proto/Picasso96API.h>
#include <proto/popupmenu.h>
#endif
#include <proto/utility.h>
@@ -5174,6 +5174,11 @@ Object *ami_gui_splash_open(void)
LAYOUT_AddImage, bm_obj = BitMapObject,
BITMAP_SourceFile, "PROGDIR:Resources/splash.png",
BITMAP_Screen, wbscreen,
+ BITMAP_Precision, PRECISION_IMAGE,
+#ifndef __amigaos4__
+ BITMAP_Width, 400,
+ BITMAP_Height, 250,
+#endif
BitMapEnd,
LayoutEnd,
EndWindow;
diff --git a/amiga/libs.c b/amiga/libs.c
index 4278d1a..9ac9589 100644
--- a/amiga/libs.c
+++ b/amiga/libs.c
@@ -76,6 +76,7 @@
#ifdef __amigaos4__
AMINS_LIB_STRUCT(Application);
+AMINS_LIB_STRUCT(P96);
#else
struct UtilityBase *UtilityBase; /* AMINS_LIB_STRUCT(Utility) */
#endif
@@ -90,7 +91,6 @@ AMINS_LIB_STRUCT(Intuition);
AMINS_LIB_STRUCT(Keymap);
AMINS_LIB_STRUCT(Layers);
AMINS_LIB_STRUCT(Locale);
-AMINS_LIB_STRUCT(P96);
AMINS_LIB_STRUCT(Workbench);
AMINS_LIB_STRUCT(ARexx);
@@ -155,7 +155,7 @@ bool ami_libs_open(void)
* we may as well just open them normally for now.
*/
- AMINS_LIB_OPEN("classes/arexx.class", 44, ARexx, "main", 1, true)
+ AMINS_LIB_OPEN("arexx.class", 44, ARexx, "main", 1, true)
AMINS_LIB_OPEN("images/bevel.image", 44, Bevel, "main", 1, true)
AMINS_LIB_OPEN("images/bitmap.image", 44, BitMap, "main", 1, true)
AMINS_LIB_OPEN("gadgets/checkbox.gadget", 44, CheckBox, "main", 1, true)
@@ -174,7 +174,7 @@ bool ami_libs_open(void)
AMINS_LIB_OPEN("gadgets/space.gadget", 44, Space, "main", 1, true)
AMINS_LIB_OPEN("gadgets/speedbar.gadget", 44, SpeedBar, "main", 1, true)
AMINS_LIB_OPEN("gadgets/string.gadget", 44, String, "main", 1, true)
- AMINS_LIB_OPEN("classes/window.class", 44, Window, "main", 1, true)
+ AMINS_LIB_OPEN("window.class", 44, Window, "main", 1, true)
return true;
}
@@ -213,10 +213,10 @@ void ami_libs_close(void)
AMINS_LIB_CLOSE(Keymap)
AMINS_LIB_CLOSE(Layers)
AMINS_LIB_CLOSE(Locale)
- AMINS_LIB_CLOSE(P96)
AMINS_LIB_CLOSE(Workbench)
#ifdef __amigaos4__
AMINS_LIB_CLOSE(Application)
+ AMINS_LIB_CLOSE(P96)
#else
AMINS_LIB_CLOSE(Utility)
#endif
diff --git a/amiga/os3support.c b/amiga/os3support.c
index f69df15..3b42685 100644
--- a/amiga/os3support.c
+++ b/amiga/os3support.c
@@ -26,9 +26,13 @@
#include <inttypes.h>
#include <stdarg.h>
#include <stdio.h>
+
#include <proto/exec.h>
#include <proto/intuition.h>
#include <proto/dos.h>
+#include <proto/utility.h>
+
+#include <intuition/gadgetclass.h>
#define SUCCESS (TRUE)
#define FAILURE (FALSE)
@@ -93,6 +97,32 @@ uint32 GetAttrs(Object *obj, Tag tag1, ...)
return i;
}
+ULONG RefreshSetGadgetAttrsA(struct Gadget *g, struct Window *w, struct Requester *r, struct TagItem *tags)
+{
+ ULONG retval;
+ BOOL changedisabled = FALSE;
+ BOOL disabled;
+
+ if (w) {
+ if (FindTagItem(GA_Disabled,tags)) {
+ changedisabled = TRUE;
+ disabled = g->Flags & GFLG_DISABLED;
+ }
+ }
+ retval = SetGadgetAttrsA(g,w,r,tags);
+ if (w && (retval || (changedisabled && disabled != (g->Flags & GFLG_DISABLED)))) {
+ RefreshGList(g,w,r,1);
+ retval = 1;
+ }
+ return retval;
+}
+
+ULONG RefreshSetGadgetAttrs(struct Gadget *g, struct Window *w, struct Requester *r, Tag tag1, ...)
+{
+ return RefreshSetGadgetAttrsA(g,w,r,(struct TagItem *) &tag1);
+}
+
+
/* Utility */
struct FormatContext
{
diff --git a/amiga/os3support.h b/amiga/os3support.h
index df88cd5..a8c5aba 100644
--- a/amiga/os3support.h
+++ b/amiga/os3support.h
@@ -147,9 +147,13 @@
#define IDoMethod DoMethod
#define IDoMethodA DoMethodA
#define IDoSuperMethodA DoSuperMethodA
-#define RefreshSetGadgetAttrs SetGadgetAttrs /*\todo This isn't quite right */
#define ShowWindow(...) (void)0
+/* P96 */
+#define p96FreeBitMap(B) FreeBitMap(B)
+#define p96AllocBitMap(W,H,D,FL,FR,FM) AllocBitMap(W,H,D,FL,FR)
+#define p96RectFill(RP,X,Y,XW,YH,C) RectFill(RP,X,Y,XW,YH) /* Needs pen */
+
/* Utility */
#define SetMem memset
#define SNPrintf snprintf
@@ -225,6 +229,8 @@ struct Node *GetHead(struct List *list);
/* Intuition */
uint32 GetAttrs(Object *obj, Tag tag1, ...);
+ULONG RefreshSetGadgetAttrs(struct Gadget *g, struct Window *w, struct Requester *r, Tag tag1, ...);
+ULONG RefreshSetGadgetAttrsA(struct Gadget *g, struct Window *w, struct Requester *r, struct TagItem *tags);
/* Utility */
char *ASPrintf(const char *fmt, ...);
diff --git a/amiga/plotters.c b/amiga/plotters.c
index f672e7a..eaf7751 100755
--- a/amiga/plotters.c
+++ b/amiga/plotters.c
@@ -18,7 +18,9 @@
#include "amiga/os3support.h"
+#ifdef __amigaos4__
#include <proto/Picasso96API.h>
+#endif
#include <proto/exec.h>
#include <proto/intuition.h>
diff --git a/amiga/thumbnail.c b/amiga/thumbnail.c
index 7b3c156..5333b4c 100755
--- a/amiga/thumbnail.c
+++ b/amiga/thumbnail.c
@@ -19,7 +19,9 @@
#include "amiga/os3support.h"
#include <proto/graphics.h>
+#ifdef __amigaos4__
#include <proto/Picasso96API.h>
+#endif
#include <intuition/intuition.h>
#ifdef __amigaos4__
#include <graphics/blitattr.h>
--
NetSurf Browser
8 years
netsurf: branch master updated. release/3.2-603-g0c52666
by NetSurf Browser Project
Gitweb links:
...log http://git.netsurf-browser.org/netsurf.git/shortlog/0c526662b33697f2ebb13...
...commit http://git.netsurf-browser.org/netsurf.git/commit/0c526662b33697f2ebb132b...
...tree http://git.netsurf-browser.org/netsurf.git/tree/0c526662b33697f2ebb132b50...
The branch, master has been updated
via 0c526662b33697f2ebb132b5018494ec699da27f (commit)
via e07bbbaaff19dfecbba3121616ac4a5b798cbc58 (commit)
from 989a5da334aeb97177a1b1aeb300cf8b601f9b7c (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=0c526662b33697f2ebb...
commit 0c526662b33697f2ebb132b5018494ec699da27f
Author: Chris Young <chris(a)unsatisfactorysoftware.co.uk>
Commit: Chris Young <chris(a)unsatisfactorysoftware.co.uk>
Minor OS3 fixes
diff --git a/amiga/gui.c b/amiga/gui.c
index c533c7f..534637b 100644
--- a/amiga/gui.c
+++ b/amiga/gui.c
@@ -3704,6 +3704,10 @@ gui_window_create(struct browser_window *bw,
LOG(("Creating window object"));
g->shared->objects[OID_MAIN] = WindowObject,
+#ifndef __amigaos4__
+ WA_Width, 100,
+ WA_Height, 100,
+#endif
WA_ScreenTitle, ami_gui_get_screen_title(),
WA_Activate, TRUE,
WA_DepthGadget, TRUE,
@@ -5155,8 +5159,13 @@ Object *ami_gui_splash_open(void)
struct TextFont *tfont;
win_obj = WindowObject,
- WA_Borderless, TRUE,
+#ifdef __amigaos4__
WA_ToolBox, TRUE,
+#else
+ WA_Width, 100,
+ WA_Height, 100,
+#endif
+ WA_Borderless, TRUE,
WA_BusyPointer, TRUE,
WINDOW_Position, WPOS_CENTERSCREEN,
WINDOW_LockWidth, TRUE,
@@ -5381,6 +5390,7 @@ int main(int argc, char** argv)
user = GetVar("user", temp, 1024, GVF_GLOBAL_ONLY);
current_user = ASPrintf("%s", (user == -1) ? "Default" : temp);
+ LOG(("User: %s", current_user));
current_user_dir = ASPrintf("PROGDIR:Users/%s", current_user);
if((lock = CreateDirTree(current_user_dir)))
diff --git a/amiga/plotters.c b/amiga/plotters.c
index 490d519..f672e7a 100755
--- a/amiga/plotters.c
+++ b/amiga/plotters.c
@@ -118,7 +118,9 @@ void ami_init_layers(struct gui_globals *gg, ULONG width, ULONG height)
} else {
palette_mapped = false;
}
-
+#ifndef __amigaos4__
+ palette_mapped = true; /* only supporting palette mapped screens on OS3 for now */
+#endif
if(!width) width = nsoption_int(redraw_tile_size_x);
if(!height) height = nsoption_int(redraw_tile_size_y);
commitdiff http://git.netsurf-browser.org/netsurf.git/commit/?id=e07bbbaaff19dfecbba...
commit e07bbbaaff19dfecbba3121616ac4a5b798cbc58
Author: Chris Young <chris(a)unsatisfactorysoftware.co.uk>
Commit: Chris Young <chris(a)unsatisfactorysoftware.co.uk>
Take out some more code which won't work on OS3
diff --git a/amiga/gui.c b/amiga/gui.c
index 2892119..c533c7f 100644
--- a/amiga/gui.c
+++ b/amiga/gui.c
@@ -3701,6 +3701,8 @@ gui_window_create(struct browser_window *bw,
BitMapEnd;
}
+ LOG(("Creating window object"));
+
g->shared->objects[OID_MAIN] = WindowObject,
WA_ScreenTitle, ami_gui_get_screen_title(),
WA_Activate, TRUE,
@@ -3955,8 +3957,12 @@ gui_window_create(struct browser_window *bw,
EndWindow;
}
+ LOG(("Opening window"));
+
g->shared->win = (struct Window *)RA_OpenWindow(g->shared->objects[OID_MAIN]);
+ LOG(("Window opened, adding border gadgets"));
+
if(!g->shared->win)
{
warn_user("NoMemory","");
@@ -5390,7 +5396,10 @@ int main(int argc, char** argv)
ami_mime_init("PROGDIR:Resources/mimetypes");
sprintf(temp, "%s/mimetypes.user", current_user_dir);
ami_mime_init(temp);
+
+#ifdef __amigaos4__
amiga_plugin_hack_init();
+#endif
ret = amiga_datatypes_init();
/* user options setup */
diff --git a/amiga/libs.c b/amiga/libs.c
index 0f5131d..4278d1a 100644
--- a/amiga/libs.c
+++ b/amiga/libs.c
@@ -120,6 +120,7 @@ bool ami_libs_open(void)
#ifdef __amigaos4__
/* Libraries only needed on OS4 */
AMINS_LIB_OPEN("application.library", 53, Application, "application", 2, false)
+ AMINS_LIB_OPEN("Picasso96API.library", 0, P96, "main", 1, true)
#else
/* Libraries we get automatically on OS4 but not OS3 */
AMINS_LIB_OPEN("utility.library", 37, Utility, "main", 1, true)
@@ -136,7 +137,6 @@ bool ami_libs_open(void)
AMINS_LIB_OPEN("keymap.library", 37, Keymap, "main", 1, true)
AMINS_LIB_OPEN("layers.library", 37, Layers, "main", 1, true)
AMINS_LIB_OPEN("locale.library", 37, Locale, "main", 1, true)
- AMINS_LIB_OPEN("Picasso96API.library", 0, P96, "main", 1, true)
AMINS_LIB_OPEN("workbench.library", 37, Workbench, "main", 1, true)
/* NB: timer.device is opened in schedule.c (ultimately by the scheduler process).
diff --git a/amiga/menu.c b/amiga/menu.c
index e5d35a9..1fef12b 100644
--- a/amiga/menu.c
+++ b/amiga/menu.c
@@ -42,6 +42,7 @@
#include "utils/nsoption.h"
#include "utils/messages.h"
+
#include "desktop/hotlist.h"
#include "desktop/browser.h"
#include "desktop/mouse.h"
-----------------------------------------------------------------------
Summary of changes:
amiga/gui.c | 21 ++++++++++++++++++++-
amiga/libs.c | 2 +-
amiga/menu.c | 1 +
amiga/plotters.c | 4 +++-
4 files changed, 25 insertions(+), 3 deletions(-)
diff --git a/amiga/gui.c b/amiga/gui.c
index 2892119..534637b 100644
--- a/amiga/gui.c
+++ b/amiga/gui.c
@@ -3701,7 +3701,13 @@ gui_window_create(struct browser_window *bw,
BitMapEnd;
}
+ LOG(("Creating window object"));
+
g->shared->objects[OID_MAIN] = WindowObject,
+#ifndef __amigaos4__
+ WA_Width, 100,
+ WA_Height, 100,
+#endif
WA_ScreenTitle, ami_gui_get_screen_title(),
WA_Activate, TRUE,
WA_DepthGadget, TRUE,
@@ -3955,8 +3961,12 @@ gui_window_create(struct browser_window *bw,
EndWindow;
}
+ LOG(("Opening window"));
+
g->shared->win = (struct Window *)RA_OpenWindow(g->shared->objects[OID_MAIN]);
+ LOG(("Window opened, adding border gadgets"));
+
if(!g->shared->win)
{
warn_user("NoMemory","");
@@ -5149,8 +5159,13 @@ Object *ami_gui_splash_open(void)
struct TextFont *tfont;
win_obj = WindowObject,
- WA_Borderless, TRUE,
+#ifdef __amigaos4__
WA_ToolBox, TRUE,
+#else
+ WA_Width, 100,
+ WA_Height, 100,
+#endif
+ WA_Borderless, TRUE,
WA_BusyPointer, TRUE,
WINDOW_Position, WPOS_CENTERSCREEN,
WINDOW_LockWidth, TRUE,
@@ -5375,6 +5390,7 @@ int main(int argc, char** argv)
user = GetVar("user", temp, 1024, GVF_GLOBAL_ONLY);
current_user = ASPrintf("%s", (user == -1) ? "Default" : temp);
+ LOG(("User: %s", current_user));
current_user_dir = ASPrintf("PROGDIR:Users/%s", current_user);
if((lock = CreateDirTree(current_user_dir)))
@@ -5390,7 +5406,10 @@ int main(int argc, char** argv)
ami_mime_init("PROGDIR:Resources/mimetypes");
sprintf(temp, "%s/mimetypes.user", current_user_dir);
ami_mime_init(temp);
+
+#ifdef __amigaos4__
amiga_plugin_hack_init();
+#endif
ret = amiga_datatypes_init();
/* user options setup */
diff --git a/amiga/libs.c b/amiga/libs.c
index 0f5131d..4278d1a 100644
--- a/amiga/libs.c
+++ b/amiga/libs.c
@@ -120,6 +120,7 @@ bool ami_libs_open(void)
#ifdef __amigaos4__
/* Libraries only needed on OS4 */
AMINS_LIB_OPEN("application.library", 53, Application, "application", 2, false)
+ AMINS_LIB_OPEN("Picasso96API.library", 0, P96, "main", 1, true)
#else
/* Libraries we get automatically on OS4 but not OS3 */
AMINS_LIB_OPEN("utility.library", 37, Utility, "main", 1, true)
@@ -136,7 +137,6 @@ bool ami_libs_open(void)
AMINS_LIB_OPEN("keymap.library", 37, Keymap, "main", 1, true)
AMINS_LIB_OPEN("layers.library", 37, Layers, "main", 1, true)
AMINS_LIB_OPEN("locale.library", 37, Locale, "main", 1, true)
- AMINS_LIB_OPEN("Picasso96API.library", 0, P96, "main", 1, true)
AMINS_LIB_OPEN("workbench.library", 37, Workbench, "main", 1, true)
/* NB: timer.device is opened in schedule.c (ultimately by the scheduler process).
diff --git a/amiga/menu.c b/amiga/menu.c
index e5d35a9..1fef12b 100644
--- a/amiga/menu.c
+++ b/amiga/menu.c
@@ -42,6 +42,7 @@
#include "utils/nsoption.h"
#include "utils/messages.h"
+
#include "desktop/hotlist.h"
#include "desktop/browser.h"
#include "desktop/mouse.h"
diff --git a/amiga/plotters.c b/amiga/plotters.c
index 490d519..f672e7a 100755
--- a/amiga/plotters.c
+++ b/amiga/plotters.c
@@ -118,7 +118,9 @@ void ami_init_layers(struct gui_globals *gg, ULONG width, ULONG height)
} else {
palette_mapped = false;
}
-
+#ifndef __amigaos4__
+ palette_mapped = true; /* only supporting palette mapped screens on OS3 for now */
+#endif
if(!width) width = nsoption_int(redraw_tile_size_x);
if(!height) height = nsoption_int(redraw_tile_size_y);
--
NetSurf Browser
8 years
netsurf: branch master updated. release/3.2-601-g989a5da
by NetSurf Browser Project
Gitweb links:
...log http://git.netsurf-browser.org/netsurf.git/shortlog/989a5da334aeb97177a1b...
...commit http://git.netsurf-browser.org/netsurf.git/commit/989a5da334aeb97177a1b1a...
...tree http://git.netsurf-browser.org/netsurf.git/tree/989a5da334aeb97177a1b1aeb...
The branch, master has been updated
via 989a5da334aeb97177a1b1aeb300cf8b601f9b7c (commit)
from 15537aa2af2dd52afdccafcbda1ce3bfd1f1657e (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=989a5da334aeb97177a...
commit 989a5da334aeb97177a1b1aeb300cf8b601f9b7c
Author: Chris Young <chris(a)unsatisfactorysoftware.co.uk>
Commit: Chris Young <chris(a)unsatisfactorysoftware.co.uk>
Cast timeval.usec calculations to int as AmigaOS3 has some conflicting headers which means it can be treated as an unsigned value.
This ensures the log time is always correct.
diff --git a/utils/log.c b/utils/log.c
index 8ec42c1..0be8ea2 100644
--- a/utils/log.c
+++ b/utils/log.c
@@ -70,12 +70,12 @@ timeval_subtract(struct timeval *result, struct timeval *x, struct timeval *y)
{
/* Perform the carry for the later subtraction by updating y. */
if (x->tv_usec < y->tv_usec) {
- int nsec = (y->tv_usec - x->tv_usec) / 1000000 + 1;
+ int nsec = (int)(y->tv_usec - x->tv_usec) / 1000000 + 1;
y->tv_usec -= 1000000 * nsec;
y->tv_sec += nsec;
}
- if (x->tv_usec - y->tv_usec > 1000000) {
- int nsec = (x->tv_usec - y->tv_usec) / 1000000;
+ if ((int)(x->tv_usec - y->tv_usec) > 1000000) {
+ int nsec = (int)(x->tv_usec - y->tv_usec) / 1000000;
y->tv_usec += 1000000 * nsec;
y->tv_sec -= nsec;
}
-----------------------------------------------------------------------
Summary of changes:
utils/log.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/utils/log.c b/utils/log.c
index 8ec42c1..0be8ea2 100644
--- a/utils/log.c
+++ b/utils/log.c
@@ -70,12 +70,12 @@ timeval_subtract(struct timeval *result, struct timeval *x, struct timeval *y)
{
/* Perform the carry for the later subtraction by updating y. */
if (x->tv_usec < y->tv_usec) {
- int nsec = (y->tv_usec - x->tv_usec) / 1000000 + 1;
+ int nsec = (int)(y->tv_usec - x->tv_usec) / 1000000 + 1;
y->tv_usec -= 1000000 * nsec;
y->tv_sec += nsec;
}
- if (x->tv_usec - y->tv_usec > 1000000) {
- int nsec = (x->tv_usec - y->tv_usec) / 1000000;
+ if ((int)(x->tv_usec - y->tv_usec) > 1000000) {
+ int nsec = (int)(x->tv_usec - y->tv_usec) / 1000000;
y->tv_usec += 1000000 * nsec;
y->tv_sec -= nsec;
}
--
NetSurf Browser
8 years
toolchains: branch master updated. 9a53a918e1dbdfc5d2ceb2630d7b049f1903f58a
by NetSurf Browser Project
Gitweb links:
...log http://git.netsurf-browser.org/toolchains.git/shortlog/9a53a918e1dbdfc5d2...
...commit http://git.netsurf-browser.org/toolchains.git/commit/9a53a918e1dbdfc5d2ce...
...tree http://git.netsurf-browser.org/toolchains.git/tree/9a53a918e1dbdfc5d2ceb2...
The branch, master has been updated
via 9a53a918e1dbdfc5d2ceb2630d7b049f1903f58a (commit)
from 3681d6856c4a818c19ef30f6bd8dd06cfffb50e0 (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/toolchains.git/commit/?id=9a53a918e1dbdfc5...
commit 9a53a918e1dbdfc5d2ceb2630d7b049f1903f58a
Author: Chris Young <chris(a)unsatisfactorysoftware.co.uk>
Commit: Chris Young <chris(a)unsatisfactorysoftware.co.uk>
Fix connection timeout when built for AmigaOS3/clib2
diff --git a/sdk/recipes/patches/libcurl/m68k-unknown-amigaos/lib.timeval.c.p b/sdk/recipes/patches/libcurl/m68k-unknown-amigaos/lib.timeval.c.p
new file mode 100644
index 0000000..85d2695
--- /dev/null
+++ b/sdk/recipes/patches/libcurl/m68k-unknown-amigaos/lib.timeval.c.p
@@ -0,0 +1,11 @@
+--- lib/timeval.c.orig 2015-01-19 18:31:02.436021392 +0000
++++ lib/timeval.c 2015-01-19 18:30:53.552021418 +0000
+@@ -110,7 +110,7 @@ struct timeval curlx_tvnow(void)
+ long curlx_tvdiff(struct timeval newer, struct timeval older)
+ {
+ return (newer.tv_sec-older.tv_sec)*1000+
+- (newer.tv_usec-older.tv_usec)/1000;
++ (long)(newer.tv_usec-older.tv_usec)/1000;
+ }
+
+ /*
-----------------------------------------------------------------------
Summary of changes:
.../patches/libcurl/m68k-unknown-amigaos/lib.timeval.c.p | 11 +++++++++++
1 file changed, 11 insertions(+)
create mode 100644 sdk/recipes/patches/libcurl/m68k-unknown-amigaos/lib.timeval.c.p
diff --git a/sdk/recipes/patches/libcurl/m68k-unknown-amigaos/lib.timeval.c.p b/sdk/recipes/patches/libcurl/m68k-unknown-amigaos/lib.timeval.c.p
new file mode 100644
index 0000000..85d2695
--- /dev/null
+++ b/sdk/recipes/patches/libcurl/m68k-unknown-amigaos/lib.timeval.c.p
@@ -0,0 +1,11 @@
+--- lib/timeval.c.orig 2015-01-19 18:31:02.436021392 +0000
++++ lib/timeval.c 2015-01-19 18:30:53.552021418 +0000
+@@ -110,7 +110,7 @@ struct timeval curlx_tvnow(void)
+ long curlx_tvdiff(struct timeval newer, struct timeval older)
+ {
+ return (newer.tv_sec-older.tv_sec)*1000+
+- (newer.tv_usec-older.tv_usec)/1000;
++ (long)(newer.tv_usec-older.tv_usec)/1000;
+ }
+
+ /*
--
Cross-compilation toolchains and environments
8 years
netsurf: branch master updated. release/3.2-600-g15537aa
by NetSurf Browser Project
Gitweb links:
...log http://git.netsurf-browser.org/netsurf.git/shortlog/15537aa2af2dd52afdcca...
...commit http://git.netsurf-browser.org/netsurf.git/commit/15537aa2af2dd52afdccafc...
...tree http://git.netsurf-browser.org/netsurf.git/tree/15537aa2af2dd52afdccafcbd...
The branch, master has been updated
via 15537aa2af2dd52afdccafcbda1ce3bfd1f1657e (commit)
via 73b158d27d95615439334b400c05bc1a9b8453db (commit)
via 392fa2ea4cfc5df5a86b6cde0e05c909da26f1e5 (commit)
via 201bc569a4f40b1b2e53660cceb183570534b557 (commit)
from 2eb41ed77b2deb3a1c54c7b6b94a7c31fb603714 (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=15537aa2af2dd52afdc...
commit 15537aa2af2dd52afdccafcbda1ce3bfd1f1657e
Author: Chris Young <chris(a)unsatisfactorysoftware.co.uk>
Commit: Chris Young <chris(a)unsatisfactorysoftware.co.uk>
The OS3 build doesn't appear to like non-specific layout groups
diff --git a/amiga/gui.c b/amiga/gui.c
index 6190407..2892119 100644
--- a/amiga/gui.c
+++ b/amiga/gui.c
@@ -5155,7 +5155,7 @@ Object *ami_gui_splash_open(void)
WINDOW_Position, WPOS_CENTERSCREEN,
WINDOW_LockWidth, TRUE,
WINDOW_LockHeight, TRUE,
- WINDOW_ParentGroup, LayoutObject,
+ WINDOW_ParentGroup, VGroupObject,
LAYOUT_AddImage, bm_obj = BitMapObject,
BITMAP_SourceFile, "PROGDIR:Resources/splash.png",
BITMAP_Screen, wbscreen,
diff --git a/amiga/os3support.c b/amiga/os3support.c
index 724ac20..f69df15 100644
--- a/amiga/os3support.c
+++ b/amiga/os3support.c
@@ -79,15 +79,18 @@ uint32 GetAttrs(Object *obj, Tag tag1, ...)
va_list ap;
Tag tag = tag1;
ULONG data = 0;
+ int i = 0;
va_start(ap, tag1);
while(tag != TAG_DONE) {
data = va_arg(ap, ULONG);
- GetAttr(tag, obj, (void *)data);
+ i += GetAttr(tag, obj, (void *)data);
tag = va_arg(ap, Tag);
}
va_end(ap);
+
+ return i;
}
/* Utility */
commitdiff http://git.netsurf-browser.org/netsurf.git/commit/?id=73b158d27d956154393...
commit 73b158d27d95615439334b400c05bc1a9b8453db
Author: Chris Young <chris(a)unsatisfactorysoftware.co.uk>
Commit: Chris Young <chris(a)unsatisfactorysoftware.co.uk>
Fix remaining linker errors
diff --git a/amiga/launch.c b/amiga/launch.c
index c3f993b..5f22bdc 100755
--- a/amiga/launch.c
+++ b/amiga/launch.c
@@ -124,8 +124,11 @@ static BOOL ami_openurl_check_list(struct MinList *list, nsurl *url)
void ami_openurl_open(void)
{
if(nsoption_bool(use_openurl_lib)) {
- if((OpenURLBase = OpenLibrary("openurl.library",0)))
+ if((OpenURLBase = OpenLibrary("openurl.library",0))) {
+#ifdef __amigaos4__
IOpenURL = (struct OpenURLIFace *)GetInterface(OpenURLBase,"main",1,NULL);
+#endif
+ }
}
NewMinList(&ami_unsupportedprotocols);
@@ -133,7 +136,9 @@ void ami_openurl_open(void)
void ami_openurl_close(void)
{
+#ifdef __amigaos4__
if(IOpenURL) DropInterface((struct Interface *)IOpenURL);
+#endif
if(OpenURLBase) CloseLibrary(OpenURLBase);
ami_openurl_free_list(&ami_unsupportedprotocols);
@@ -141,7 +146,9 @@ void ami_openurl_close(void)
nserror gui_launch_url(struct nsurl *url)
{
+#ifdef __amigaos4__
APTR procwin = SetProcWindow((APTR)-1L);
+#endif
char *launchurl = NULL;
if(ami_openurl_check_list(&ami_unsupportedprotocols, url) == FALSE)
@@ -162,8 +169,8 @@ nserror gui_launch_url(struct nsurl *url)
}
}
}
-
+#ifdef __amigaos4__
SetProcWindow(procwin);
-
+#endif
return NSERROR_OK;
}
diff --git a/amiga/os3support.c b/amiga/os3support.c
index 7eafc7d..724ac20 100644
--- a/amiga/os3support.c
+++ b/amiga/os3support.c
@@ -212,5 +212,19 @@ char *strlwr(char *str)
return str;
}
+
+int scandir(const char *dir, struct dirent ***namelist,
+ int (*filter)(const struct dirent *),
+ int (*compar)(const struct dirent **, const struct dirent **))
+{
+ /*\todo stub function, needs writing, preferably into clib2 */
+ return 0;
+}
+
+long long int strtoll(const char *nptr, char **endptr, int base)
+{
+ return (long long int)strtol(nptr, endptr, base);
+}
+
#endif
diff --git a/amiga/os3support.h b/amiga/os3support.h
index 4b5deb2..df88cd5 100644
--- a/amiga/os3support.h
+++ b/amiga/os3support.h
@@ -27,6 +27,7 @@
#ifndef __amigaos4__
#include <stdint.h>
+
#include <proto/exec.h>
#include <proto/dos.h>
@@ -37,6 +38,7 @@
#include <exec/memory.h>
#endif
+/* C macros */
#ifndef ASM
#define ASM
#endif
@@ -45,6 +47,8 @@
#define REG(reg,arg) arg __asm(#reg)
#endif
+#define MIN(a,b) (((a)<(b))?(a):(b))
+
/* Macros */
#define IsMinListEmpty(L) (L)->mlh_Head->mln_Succ == 0
#define LIB_IS_AT_LEAST(B,V,R) ((B)->lib_Version>(V)) || \
@@ -116,6 +120,9 @@
/* application */
#define Notify(...) (void)0
+/* DataTypes */
+#define SaveDTObjectA(O,W,R,F,M,I,A) DoDTMethod(O,W,R,DTM_WRITE,F,M,NULL)
+
/* diskfont */
/* Only used in one place we haven't ifdeffed, where it returns the charset name */
#define ObtainCharsetInfo(A,B,C) (const char *)"ISO-8859-1"
diff --git a/amiga/thumbnail.c b/amiga/thumbnail.c
index ea681d2..7b3c156 100755
--- a/amiga/thumbnail.c
+++ b/amiga/thumbnail.c
@@ -16,6 +16,8 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
+#include "amiga/os3support.h"
+
#include <proto/graphics.h>
#include <proto/Picasso96API.h>
#include <intuition/intuition.h>
commitdiff http://git.netsurf-browser.org/netsurf.git/commit/?id=392fa2ea4cfc5df5a86...
commit 392fa2ea4cfc5df5a86b6cde0e05c909da26f1e5
Author: Chris Young <chris(a)unsatisfactorysoftware.co.uk>
Commit: Chris Young <chris(a)unsatisfactorysoftware.co.uk>
Fix some easy OS3 linker errors
diff --git a/amiga/Makefile.defaults b/amiga/Makefile.defaults
index 2134e83..243e44b 100644
--- a/amiga/Makefile.defaults
+++ b/amiga/Makefile.defaults
@@ -4,7 +4,11 @@
# Force using glibc internal iconv implementation instead of external libiconv
# Valid options: YES, NO
-NETSURF_USE_LIBICONV_PLUG := YES
+ifneq ($(SUBTARGET),os3)
+ NETSURF_USE_LIBICONV_PLUG := YES
+else
+ NETSURF_USE_LIBICONV_PLUG := NO
+endif
# Enable NetSurf's use of librosprite for displaying RISC OS Sprites
# Valid options: YES, NO, AUTO
diff --git a/amiga/Makefile.target b/amiga/Makefile.target
index d29e7aa..ec47826 100644
--- a/amiga/Makefile.target
+++ b/amiga/Makefile.target
@@ -53,7 +53,7 @@ else
LDFLAGS += -L$(GCCSDK_INSTALL_ENV)/lib
ifeq ($(SUBTARGET),os3)
- LDFLAGS += -lpbl -liconv
+ LDFLAGS += -lpbl -liconv -lamiga
else
LDFLAGS += -lpbl -liconv
endif
diff --git a/amiga/help.c b/amiga/help.c
index 76dd1bd..64b3384 100755
--- a/amiga/help.c
+++ b/amiga/help.c
@@ -16,6 +16,8 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
+#include "amiga/os3support.h"
+
#include "amiga/help.h"
/* AmigaGuide class */
diff --git a/amiga/libs.c b/amiga/libs.c
index 7810fad..0f5131d 100644
--- a/amiga/libs.c
+++ b/amiga/libs.c
@@ -74,7 +74,11 @@
#define GraphicsBase GfxBase /* graphics.library is a bit weird */
+#ifdef __amigaos4__
AMINS_LIB_STRUCT(Application);
+#else
+struct UtilityBase *UtilityBase; /* AMINS_LIB_STRUCT(Utility) */
+#endif
AMINS_LIB_STRUCT(Asl);
AMINS_LIB_STRUCT(DataTypes);
AMINS_LIB_STRUCT(Diskfont);
@@ -113,7 +117,14 @@ AMINS_LIB_STRUCT(Window);
bool ami_libs_open(void)
{
+#ifdef __amigaos4__
+ /* Libraries only needed on OS4 */
AMINS_LIB_OPEN("application.library", 53, Application, "application", 2, false)
+#else
+ /* Libraries we get automatically on OS4 but not OS3 */
+ AMINS_LIB_OPEN("utility.library", 37, Utility, "main", 1, true)
+#endif
+ /* Standard libraries for both versions */
AMINS_LIB_OPEN("asl.library", 37, Asl, "main", 1, true)
AMINS_LIB_OPEN("datatypes.library", 37, DataTypes, "main", 1, true)
AMINS_LIB_OPEN("diskfont.library", 40, Diskfont, "main", 1, true)
@@ -191,7 +202,6 @@ void ami_libs_close(void)
AMINS_LIB_CLOSE(String)
AMINS_LIB_CLOSE(Window)
- AMINS_LIB_CLOSE(Application)
AMINS_LIB_CLOSE(Asl)
AMINS_LIB_CLOSE(DataTypes)
AMINS_LIB_CLOSE(Diskfont)
@@ -205,5 +215,10 @@ void ami_libs_close(void)
AMINS_LIB_CLOSE(Locale)
AMINS_LIB_CLOSE(P96)
AMINS_LIB_CLOSE(Workbench)
+#ifdef __amigaos4__
+ AMINS_LIB_CLOSE(Application)
+#else
+ AMINS_LIB_CLOSE(Utility)
+#endif
}
diff --git a/amiga/os3support.h b/amiga/os3support.h
index e28985e..4b5deb2 100644
--- a/amiga/os3support.h
+++ b/amiga/os3support.h
@@ -47,9 +47,9 @@
/* Macros */
#define IsMinListEmpty(L) (L)->mlh_Head->mln_Succ == 0
-
#define LIB_IS_AT_LEAST(B,V,R) ((B)->lib_Version>(V)) || \
((B)->lib_Version==(V) && (B)->lib_Revision>=(R))
+#define EAD_IS_FILE(E) ((E)->ed_Type<0)
/* Define extra memory type flags */
#define MEMF_PRIVATE MEMF_ANY
@@ -136,6 +136,7 @@
#define SetRPAttrs(...) (void)0 /*\todo Probably need to emulate this */
/* Intuition */
+#define ICoerceMethod CoerceMethod
#define IDoMethod DoMethod
#define IDoMethodA DoMethodA
#define IDoSuperMethodA DoSuperMethodA
commitdiff http://git.netsurf-browser.org/netsurf.git/commit/?id=201bc569a4f40b1b2e5...
commit 201bc569a4f40b1b2e53660cceb183570534b557
Author: Chris Young <chris(a)unsatisfactorysoftware.co.uk>
Commit: Chris Young <chris(a)unsatisfactorysoftware.co.uk>
More OS3 compilation fixes
diff --git a/amiga/os3support.c b/amiga/os3support.c
index dda3df3..7eafc7d 100644
--- a/amiga/os3support.c
+++ b/amiga/os3support.c
@@ -54,6 +54,9 @@ void FreeSysObject(ULONG type, APTR obj)
case ASOT_PORT:
DeleteMsgPort(obj);
break;
+ case ASOT_IOREQUEST:
+ DeleteIORequest(obj);
+ break;
}
}
diff --git a/amiga/os3support.h b/amiga/os3support.h
index 93bb0ba..e28985e 100644
--- a/amiga/os3support.h
+++ b/amiga/os3support.h
@@ -98,6 +98,7 @@
#define RAWKEY_END 0x71
/* Other constants */
+#define BVS_DISPLAY BVS_NONE
#define IDCMP_EXTENDEDMOUSE 0
#define WINDOW_BACKMOST 0
#define DN_FULLPATH 0
@@ -143,6 +144,7 @@
/* Utility */
#define SetMem memset
+#define SNPrintf snprintf
/* Integral type definitions */
typedef int8_t int8;
@@ -160,6 +162,12 @@ struct TimeVal {
uint32 Microseconds;
};
+/* TimeRequest */
+struct TimeRequest {
+ struct IORequest Request;
+ struct TimeVal Time;
+};
+
/* Compositing */
#define COMPFLAG_IgnoreDestAlpha 0
#define COMPFLAG_SrcAlphaOverride 0
@@ -189,7 +197,8 @@ struct TimeVal {
/* Object types */
enum {
- ASOT_PORT = 1
+ ASOT_PORT = 1,
+ ASOT_IOREQUEST
};
/* Requester types */
diff --git a/amiga/plugin_hack.c b/amiga/plugin_hack.c
index 7982a67..23f4d34 100644
--- a/amiga/plugin_hack.c
+++ b/amiga/plugin_hack.c
@@ -17,9 +17,11 @@
*/
/** \file
- * DataTypes picture handler (implementation)
+ * Plugin=>external program handler (implementation)
*/
+#include "amiga/os3support.h"
+
#include "amiga/filetype.h"
#include "amiga/plugin_hack.h"
#include "content/content_protected.h"
@@ -250,6 +252,7 @@ void amiga_plugin_hack_execute(struct hlcache_handle *c)
if(full_cmd)
{
+#ifdef __amigaos4__
LOG(("Attempting to execute %s", full_cmd));
in = Open("NIL:", MODE_OLDFILE);
@@ -264,5 +267,6 @@ void amiga_plugin_hack_execute(struct hlcache_handle *c)
TAG_DONE);
FreeVec(full_cmd);
+#endif
}
}
diff --git a/amiga/print.c b/amiga/print.c
index 862e598..5c89705 100644
--- a/amiga/print.c
+++ b/amiga/print.c
@@ -16,6 +16,8 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
+#include "amiga/os3support.h"
+
#include <proto/utility.h>
#include <proto/iffparse.h>
#include <proto/dos.h>
@@ -53,6 +55,7 @@
#include "amiga/plotters.h"
#include "amiga/gui.h"
+#include "amiga/misc.h"
#include "amiga/print.h"
#include "amiga/utf8.h"
@@ -217,11 +220,11 @@ void ami_print_ui(struct hlcache_handle *c)
char filename[30];
int i;
- struct ami_print_window *pw = AllocVecTags(sizeof(struct ami_print_window), AVT_ClearWithValue, 0, TAG_DONE);
+ struct ami_print_window *pw = ami_misc_allocvec_clear(sizeof(struct ami_print_window), 0);
pw->c = c;
- printers[0] = AllocVecTags(50, AVT_ClearWithValue, 0, TAG_DONE);
+ printers[0] = ami_misc_allocvec_clear(50, 0);
ami_print_readunit("ENV:Sys/printer.prefs", printers[0], 50, 0);
strcpy(filename,"ENV:Sys/printerN.prefs");
@@ -385,13 +388,18 @@ void ami_print(struct hlcache_handle *c, int copies)
if(ami_print_info.msgport == NULL)
ami_print_init();
-
+#ifdef __amigaos4__
if(!(ami_print_info.PReq =
(struct IODRPTagsReq *)AllocSysObjectTags(ASOT_IOREQUEST,
ASOIOR_Size, sizeof(struct IODRPTagsReq),
ASOIOR_ReplyPort, ami_print_info.msgport,
ASO_NoTrack, FALSE,
TAG_DONE))) return;
+#else
+ if(!(ami_print_info.PReq =
+ (struct IODRPTagsReq *)CreateIORequest(ami_print_info.msgport,
+ sizeof(struct IODRPTagsReq)))) return;
+#endif
if(OpenDevice("printer.device", nsoption_int(printer_unit),
(struct IORequest *)ami_print_info.PReq, 0))
@@ -467,7 +475,7 @@ struct MsgPort *ami_print_get_msgport(void)
bool ami_print_begin(struct print_settings *ps)
{
- ami_print_info.gg = AllocVecTags(sizeof(struct gui_globals), AVT_ClearWithValue, 0, TAG_DONE);
+ ami_print_info.gg = ami_misc_allocvec_clear(sizeof(struct gui_globals), 0);
if(!ami_print_info.gg) return false;
ami_init_layers(ami_print_info.gg,
diff --git a/amiga/schedule.c b/amiga/schedule.c
index 93389a8..494b8b0 100755
--- a/amiga/schedule.c
+++ b/amiga/schedule.c
@@ -297,18 +297,22 @@ static struct MsgPort *ami_schedule_open_timer(struct MsgPort *msgport)
ASO_NoTrack, FALSE,
TAG_DONE);
}
-
+#ifdef __amigaos4__
tioreq = (struct TimeRequest *)AllocSysObjectTags(ASOT_IOREQUEST,
ASOIOR_Size,sizeof(struct TimeRequest),
ASOIOR_ReplyPort,msgport,
ASO_NoTrack,FALSE,
TAG_DONE);
+#else
+ tioreq = (struct TimeRequest *)CreateIORequest(msgport, sizeof(struct TimeRequest));
+#endif
OpenDevice("timer.device", UNIT_WAITUNTIL, (struct IORequest *)tioreq, 0);
TimerBase = (struct Device *)tioreq->Request.io_Device;
+#ifdef __amigaos4__
ITimer = (struct TimerIFace *)GetInterface((struct Library *)TimerBase, "main", 1, NULL);
-
+#endif
return msgport;
}
diff --git a/amiga/search.c b/amiga/search.c
index ac061cb..ab32abb 100755
--- a/amiga/search.c
+++ b/amiga/search.c
@@ -103,7 +103,7 @@ void ami_search_open(struct gui_window *gwin)
return;
}
- fwin = AllocVecTags(sizeof(struct find_window), AVT_ClearWithValue, 0, TAG_DONE);
+ fwin = ami_misc_allocvec_clear(sizeof(struct find_window), 0);
fwin->objects[OID_MAIN] = WindowObject,
WA_ScreenTitle, ami_gui_get_screen_title(),
diff --git a/amiga/stringview/stringview.c b/amiga/stringview/stringview.c
index daabe58..a009f22 100755
--- a/amiga/stringview/stringview.c
+++ b/amiga/stringview/stringview.c
@@ -667,7 +667,7 @@ static uint32 myStringClass_GM_HandleInput( Class *cl, Object *obj, struct gpInp
myStringHandleListview( cl, obj );
break;
}
-
+#ifdef __amigaos4__
case IECLASS_MOUSEWHEEL:
{
struct InputEvent *ie = msg->gpi_IEvent;
@@ -686,7 +686,7 @@ static uint32 myStringClass_GM_HandleInput( Class *cl, Object *obj, struct gpInp
retval = GMR_MEACTIVE;
break;
}
-
+#endif
default:
{
retval = IDoSuperMethodA( cl, obj, (APTR)msg );
diff --git a/amiga/stringview/urlhistory.c b/amiga/stringview/urlhistory.c
index 6d134a4..d55a4b4 100644
--- a/amiga/stringview/urlhistory.c
+++ b/amiga/stringview/urlhistory.c
@@ -33,6 +33,12 @@
static struct List PageList;
+#ifdef __amigaos4__
+#define ALLOCVEC_SHARED(N) AllocVecTags((N), AVT_Type, MEMF_SHARED, TAG_DONE);
+#else
+#define ALLOCVEC_SHARED(N) AllocVec((N), MEMF_SHARED);
+#endif
+
void URLHistory_Init( void )
{
// Initialise page list
@@ -79,17 +85,11 @@ static bool URLHistoryFound(nsurl *url, const struct url_data *data)
/* skip this URL if it is already in the list */
if(URLHistory_FindPage(nsurl_access(url))) return true;
- node = AllocVecTags(sizeof(struct Node),
- AVT_Type, MEMF_SHARED,
- //AVT_ClearWithValue, 0,
- TAG_DONE);
+ node = ALLOCVEC_SHARED(sizeof(struct Node));
if ( node )
{
- STRPTR urladd = (STRPTR) AllocVecTags( strlen ( nsurl_access(url) ) + 1,
- AVT_Type, MEMF_SHARED,
- //AVT_ClearWithValue, 0,
- TAG_DONE);
+ STRPTR urladd = (STRPTR) ALLOCVEC_SHARED( strlen ( nsurl_access(url) ) + 1);
if ( urladd )
{
diff --git a/amiga/theme.c b/amiga/theme.c
index b7099e8..b75f6ed 100644
--- a/amiga/theme.c
+++ b/amiga/theme.c
@@ -16,6 +16,8 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
+#include "amiga/os3support.h"
+
#include <string.h>
#include <proto/clicktab.h>
@@ -99,6 +101,7 @@ const char *ptrs32[AMI_LASTPOINTER+1] = {
"ptr32_blank",
"ptr32_drag"};
+#ifdef __amigaos4__
/* Mapping from NetSurf to AmigaOS mouse pointers */
int osmouseptr[AMI_LASTPOINTER+1] = {
POINTERTYPE_NORMAL,
@@ -122,7 +125,7 @@ int osmouseptr[AMI_LASTPOINTER+1] = {
POINTERTYPE_PROGRESS,
POINTERTYPE_NONE,
POINTERTYPE_DRAGANDDROP};
-
+#endif
void ami_theme_init(void)
{
@@ -218,13 +221,15 @@ void ami_update_pointer(struct Window *win, gui_pointer_shape shape)
if(drag_save_data) return;
if(LIB_IS_AT_LEAST((struct Library *)IntuitionBase, 53, 42)) {
+#ifdef __amigaos4__
BOOL ptr_delay = FALSE;
if(shape == GUI_POINTER_WAIT) ptr_delay = TRUE;
SetWindowPointer(win,
WA_PointerType, osmouseptr[shape],
WA_PointerDelay, ptr_delay,
- TAG_DONE);
+ TAG_DONE);
+#endif
} else {
if(nsoption_bool(os_mouse_pointers))
{
@@ -408,12 +413,14 @@ void gui_window_start_throbber(struct gui_window *g)
if(!g) return;
if(nsoption_bool(kiosk_mode)) return;
+#ifdef __amigaos4__
if(g->tab_node && (g->shared->tabs > 1))
{
SetClickTabNodeAttrs(g->tab_node, TNA_Flagged, TRUE, TAG_DONE);
RefreshGadgets((APTR)g->shared->objects[GID_TABS],
g->shared->win, NULL);
}
+#endif
g->throbbing = true;
if(g->shared->throbber_frame == 0) g->shared->throbber_frame = 1;
@@ -427,12 +434,14 @@ void gui_window_stop_throbber(struct gui_window *g)
if(!g) return;
if(nsoption_bool(kiosk_mode)) return;
+#ifdef __amigaos4__
if(g->tab_node && (g->shared->tabs > 1))
{
SetClickTabNodeAttrs(g->tab_node, TNA_Flagged, FALSE, TAG_DONE);
RefreshGadgets((APTR)g->shared->objects[GID_TABS],
g->shared->win, NULL);
}
+#endif
if(g == g->shared->gw) {
if(ami_gui_get_space_box(g->shared->objects[GID_THROBBER], &bbox) != NSERROR_OK) {
@@ -471,7 +480,7 @@ static void ami_throbber_update(void *p)
warn_user("NoMemory", "");
return;
}
-
+#ifdef __amigaos4__
BltBitMapTags(BLITA_SrcX, throbber_width * frame,
BLITA_SrcY, 0,
BLITA_DestX, bbox->Left,
@@ -484,7 +493,10 @@ static void ami_throbber_update(void *p)
BLITA_DestType, BLITT_RASTPORT,
// BLITA_UseSrcAlpha, TRUE,
TAG_DONE);
-
+#else
+ BltBitMapRastPort(throbber, throbber_width * frame, 0, g->shared->win->RPort,
+ bbox->Left, bbox->Top, throbber_width, throbber_height, 0xC0);
+#endif
ami_gui_free_space_box(bbox);
}
diff --git a/amiga/tree.c b/amiga/tree.c
index 75ba123..5d453b6 100644
--- a/amiga/tree.c
+++ b/amiga/tree.c
@@ -42,7 +42,9 @@
#include <gadgets/scroller.h>
#include <reaction/reaction_macros.h>
#include <intuition/icclass.h>
+#ifdef __amigaos4__
#include <graphics/blitattr.h>
+#endif
#include <assert.h>
#include <string.h>
@@ -62,6 +64,7 @@
#include "amiga/gui.h"
#include "amiga/tree.h"
#include "amiga/file.h"
+#include "amiga/misc.h"
#include "amiga/utf8.h"
#include "amiga/sslcert.h"
#include "amiga/drag.h" /* drag icon stuff */
@@ -315,7 +318,7 @@ static void ami_tree_redraw_req(void *p)
tree_draw(twin->tree, - tile_x, - tile_y,
tile_x, tile_y, tile_w, tile_h, &ctx);
-
+#ifdef __amigaos4__
BltBitMapTags(BLITA_SrcType, BLITT_BITMAP,
BLITA_Source, twin->globals.bm,
BLITA_SrcX, 0,
@@ -327,6 +330,11 @@ static void ami_tree_redraw_req(void *p)
BLITA_Width, tile_w,
BLITA_Height, tile_h,
TAG_DONE);
+#else
+ BltBitMapRastPort(twin->globals.bm, 0, 0,
+ twin->win->RPort, bbox->Left + tile_x - pos_x, bbox->Top + tile_y - pos_y,
+ tile_w, tile_h, 0xC0);
+#endif
}
}
@@ -534,7 +542,7 @@ static void ami_tree_scroller_hook(struct Hook *hook,Object *object,struct Intui
break;
}
break;
-
+#ifdef __amigaos4__
case IDCMP_EXTENDEDMOUSE:
if(msg->Code == IMSGCODE_INTUIWHEELDATA)
{
@@ -543,6 +551,7 @@ static void ami_tree_scroller_hook(struct Hook *hook,Object *object,struct Intui
ami_tree_scroll(twin, (wheel->WheelX * 20), (wheel->WheelY * 20));
}
break;
+#endif
}
}
@@ -550,9 +559,7 @@ static void ami_tree_menu(struct treeview_window *twin)
{
if(twin->menu) return;
- if((twin->menu = AllocVecTags(sizeof(struct NewMenu) * AMI_TREE_MENU_ITEMS,
- AVT_ClearWithValue, 0, TAG_DONE)))
- {
+ if((twin->menu = ami_misc_allocvec_clear(sizeof(struct NewMenu) * AMI_TREE_MENU_ITEMS, 0))) {
twin->menu[0].nm_Type = NM_TITLE;
twin->menu_name[0] = ami_utf8_easy((char *)messages_get("Tree"));
twin->menu[0].nm_Label = twin->menu_name[0];
@@ -902,9 +909,11 @@ void ami_tree_close(struct treeview_window *twin)
static void ami_tree_update_quals(struct treeview_window *twin)
{
uint32 quals = 0;
-
+#ifdef __amigaos4__
GetAttr(WINDOW_Qualifier, twin->objects[OID_MAIN], (uint32 *)&quals);
-
+#else
+#warning FIXME not reading qualifiers on OS3
+#endif
twin->key_state = 0;
if((quals & IEQUALIFIER_LSHIFT) || (quals & IEQUALIFIER_RSHIFT))
@@ -976,7 +985,9 @@ BOOL ami_tree_event(struct treeview_window *twin)
if((twin->type != AMI_TREE_SSLCERT) &&
(twin->rmbtrapped == FALSE))
{
+#ifdef __amigaos4__
SetWindowAttr(twin->win, WA_RMBTrap, (APTR)(BOOL)TRUE, sizeof(BOOL));
+#endif
twin->rmbtrapped = TRUE;
}
}
@@ -984,7 +995,9 @@ BOOL ami_tree_event(struct treeview_window *twin)
{
if(twin->rmbtrapped == TRUE)
{
+#ifdef __amigaos4__
SetWindowAttr(twin->win, WA_RMBTrap, (APTR)(BOOL)FALSE, sizeof(BOOL));
+#endif
twin->rmbtrapped = FALSE;
}
}
@@ -1455,7 +1468,7 @@ struct treeview_window *ami_tree_create(int flags,
{
struct treeview_window *twin;
- twin = AllocVecTags(sizeof(struct treeview_window), AVT_ClearWithValue, 0, TAG_DONE);
+ twin = ami_misc_allocvec_clear(sizeof(struct treeview_window), 0);
if(!twin)
{
-----------------------------------------------------------------------
Summary of changes:
amiga/Makefile.defaults | 6 +++++-
amiga/Makefile.target | 2 +-
amiga/gui.c | 2 +-
amiga/help.c | 2 ++
amiga/launch.c | 13 ++++++++++---
amiga/libs.c | 17 ++++++++++++++++-
amiga/os3support.c | 22 +++++++++++++++++++++-
amiga/os3support.h | 21 +++++++++++++++++++--
amiga/plugin_hack.c | 6 +++++-
amiga/print.c | 16 ++++++++++++----
amiga/schedule.c | 8 ++++++--
amiga/search.c | 2 +-
amiga/stringview/stringview.c | 4 ++--
amiga/stringview/urlhistory.c | 16 ++++++++--------
amiga/theme.c | 20 ++++++++++++++++----
amiga/thumbnail.c | 2 ++
amiga/tree.c | 29 +++++++++++++++++++++--------
17 files changed, 148 insertions(+), 40 deletions(-)
diff --git a/amiga/Makefile.defaults b/amiga/Makefile.defaults
index 2134e83..243e44b 100644
--- a/amiga/Makefile.defaults
+++ b/amiga/Makefile.defaults
@@ -4,7 +4,11 @@
# Force using glibc internal iconv implementation instead of external libiconv
# Valid options: YES, NO
-NETSURF_USE_LIBICONV_PLUG := YES
+ifneq ($(SUBTARGET),os3)
+ NETSURF_USE_LIBICONV_PLUG := YES
+else
+ NETSURF_USE_LIBICONV_PLUG := NO
+endif
# Enable NetSurf's use of librosprite for displaying RISC OS Sprites
# Valid options: YES, NO, AUTO
diff --git a/amiga/Makefile.target b/amiga/Makefile.target
index d29e7aa..ec47826 100644
--- a/amiga/Makefile.target
+++ b/amiga/Makefile.target
@@ -53,7 +53,7 @@ else
LDFLAGS += -L$(GCCSDK_INSTALL_ENV)/lib
ifeq ($(SUBTARGET),os3)
- LDFLAGS += -lpbl -liconv
+ LDFLAGS += -lpbl -liconv -lamiga
else
LDFLAGS += -lpbl -liconv
endif
diff --git a/amiga/gui.c b/amiga/gui.c
index 6190407..2892119 100644
--- a/amiga/gui.c
+++ b/amiga/gui.c
@@ -5155,7 +5155,7 @@ Object *ami_gui_splash_open(void)
WINDOW_Position, WPOS_CENTERSCREEN,
WINDOW_LockWidth, TRUE,
WINDOW_LockHeight, TRUE,
- WINDOW_ParentGroup, LayoutObject,
+ WINDOW_ParentGroup, VGroupObject,
LAYOUT_AddImage, bm_obj = BitMapObject,
BITMAP_SourceFile, "PROGDIR:Resources/splash.png",
BITMAP_Screen, wbscreen,
diff --git a/amiga/help.c b/amiga/help.c
index 76dd1bd..64b3384 100755
--- a/amiga/help.c
+++ b/amiga/help.c
@@ -16,6 +16,8 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
+#include "amiga/os3support.h"
+
#include "amiga/help.h"
/* AmigaGuide class */
diff --git a/amiga/launch.c b/amiga/launch.c
index c3f993b..5f22bdc 100755
--- a/amiga/launch.c
+++ b/amiga/launch.c
@@ -124,8 +124,11 @@ static BOOL ami_openurl_check_list(struct MinList *list, nsurl *url)
void ami_openurl_open(void)
{
if(nsoption_bool(use_openurl_lib)) {
- if((OpenURLBase = OpenLibrary("openurl.library",0)))
+ if((OpenURLBase = OpenLibrary("openurl.library",0))) {
+#ifdef __amigaos4__
IOpenURL = (struct OpenURLIFace *)GetInterface(OpenURLBase,"main",1,NULL);
+#endif
+ }
}
NewMinList(&ami_unsupportedprotocols);
@@ -133,7 +136,9 @@ void ami_openurl_open(void)
void ami_openurl_close(void)
{
+#ifdef __amigaos4__
if(IOpenURL) DropInterface((struct Interface *)IOpenURL);
+#endif
if(OpenURLBase) CloseLibrary(OpenURLBase);
ami_openurl_free_list(&ami_unsupportedprotocols);
@@ -141,7 +146,9 @@ void ami_openurl_close(void)
nserror gui_launch_url(struct nsurl *url)
{
+#ifdef __amigaos4__
APTR procwin = SetProcWindow((APTR)-1L);
+#endif
char *launchurl = NULL;
if(ami_openurl_check_list(&ami_unsupportedprotocols, url) == FALSE)
@@ -162,8 +169,8 @@ nserror gui_launch_url(struct nsurl *url)
}
}
}
-
+#ifdef __amigaos4__
SetProcWindow(procwin);
-
+#endif
return NSERROR_OK;
}
diff --git a/amiga/libs.c b/amiga/libs.c
index 7810fad..0f5131d 100644
--- a/amiga/libs.c
+++ b/amiga/libs.c
@@ -74,7 +74,11 @@
#define GraphicsBase GfxBase /* graphics.library is a bit weird */
+#ifdef __amigaos4__
AMINS_LIB_STRUCT(Application);
+#else
+struct UtilityBase *UtilityBase; /* AMINS_LIB_STRUCT(Utility) */
+#endif
AMINS_LIB_STRUCT(Asl);
AMINS_LIB_STRUCT(DataTypes);
AMINS_LIB_STRUCT(Diskfont);
@@ -113,7 +117,14 @@ AMINS_LIB_STRUCT(Window);
bool ami_libs_open(void)
{
+#ifdef __amigaos4__
+ /* Libraries only needed on OS4 */
AMINS_LIB_OPEN("application.library", 53, Application, "application", 2, false)
+#else
+ /* Libraries we get automatically on OS4 but not OS3 */
+ AMINS_LIB_OPEN("utility.library", 37, Utility, "main", 1, true)
+#endif
+ /* Standard libraries for both versions */
AMINS_LIB_OPEN("asl.library", 37, Asl, "main", 1, true)
AMINS_LIB_OPEN("datatypes.library", 37, DataTypes, "main", 1, true)
AMINS_LIB_OPEN("diskfont.library", 40, Diskfont, "main", 1, true)
@@ -191,7 +202,6 @@ void ami_libs_close(void)
AMINS_LIB_CLOSE(String)
AMINS_LIB_CLOSE(Window)
- AMINS_LIB_CLOSE(Application)
AMINS_LIB_CLOSE(Asl)
AMINS_LIB_CLOSE(DataTypes)
AMINS_LIB_CLOSE(Diskfont)
@@ -205,5 +215,10 @@ void ami_libs_close(void)
AMINS_LIB_CLOSE(Locale)
AMINS_LIB_CLOSE(P96)
AMINS_LIB_CLOSE(Workbench)
+#ifdef __amigaos4__
+ AMINS_LIB_CLOSE(Application)
+#else
+ AMINS_LIB_CLOSE(Utility)
+#endif
}
diff --git a/amiga/os3support.c b/amiga/os3support.c
index dda3df3..f69df15 100644
--- a/amiga/os3support.c
+++ b/amiga/os3support.c
@@ -54,6 +54,9 @@ void FreeSysObject(ULONG type, APTR obj)
case ASOT_PORT:
DeleteMsgPort(obj);
break;
+ case ASOT_IOREQUEST:
+ DeleteIORequest(obj);
+ break;
}
}
@@ -76,15 +79,18 @@ uint32 GetAttrs(Object *obj, Tag tag1, ...)
va_list ap;
Tag tag = tag1;
ULONG data = 0;
+ int i = 0;
va_start(ap, tag1);
while(tag != TAG_DONE) {
data = va_arg(ap, ULONG);
- GetAttr(tag, obj, (void *)data);
+ i += GetAttr(tag, obj, (void *)data);
tag = va_arg(ap, Tag);
}
va_end(ap);
+
+ return i;
}
/* Utility */
@@ -209,5 +215,19 @@ char *strlwr(char *str)
return str;
}
+
+int scandir(const char *dir, struct dirent ***namelist,
+ int (*filter)(const struct dirent *),
+ int (*compar)(const struct dirent **, const struct dirent **))
+{
+ /*\todo stub function, needs writing, preferably into clib2 */
+ return 0;
+}
+
+long long int strtoll(const char *nptr, char **endptr, int base)
+{
+ return (long long int)strtol(nptr, endptr, base);
+}
+
#endif
diff --git a/amiga/os3support.h b/amiga/os3support.h
index 93bb0ba..df88cd5 100644
--- a/amiga/os3support.h
+++ b/amiga/os3support.h
@@ -27,6 +27,7 @@
#ifndef __amigaos4__
#include <stdint.h>
+
#include <proto/exec.h>
#include <proto/dos.h>
@@ -37,6 +38,7 @@
#include <exec/memory.h>
#endif
+/* C macros */
#ifndef ASM
#define ASM
#endif
@@ -45,11 +47,13 @@
#define REG(reg,arg) arg __asm(#reg)
#endif
+#define MIN(a,b) (((a)<(b))?(a):(b))
+
/* Macros */
#define IsMinListEmpty(L) (L)->mlh_Head->mln_Succ == 0
-
#define LIB_IS_AT_LEAST(B,V,R) ((B)->lib_Version>(V)) || \
((B)->lib_Version==(V) && (B)->lib_Revision>=(R))
+#define EAD_IS_FILE(E) ((E)->ed_Type<0)
/* Define extra memory type flags */
#define MEMF_PRIVATE MEMF_ANY
@@ -98,6 +102,7 @@
#define RAWKEY_END 0x71
/* Other constants */
+#define BVS_DISPLAY BVS_NONE
#define IDCMP_EXTENDEDMOUSE 0
#define WINDOW_BACKMOST 0
#define DN_FULLPATH 0
@@ -115,6 +120,9 @@
/* application */
#define Notify(...) (void)0
+/* DataTypes */
+#define SaveDTObjectA(O,W,R,F,M,I,A) DoDTMethod(O,W,R,DTM_WRITE,F,M,NULL)
+
/* diskfont */
/* Only used in one place we haven't ifdeffed, where it returns the charset name */
#define ObtainCharsetInfo(A,B,C) (const char *)"ISO-8859-1"
@@ -135,6 +143,7 @@
#define SetRPAttrs(...) (void)0 /*\todo Probably need to emulate this */
/* Intuition */
+#define ICoerceMethod CoerceMethod
#define IDoMethod DoMethod
#define IDoMethodA DoMethodA
#define IDoSuperMethodA DoSuperMethodA
@@ -143,6 +152,7 @@
/* Utility */
#define SetMem memset
+#define SNPrintf snprintf
/* Integral type definitions */
typedef int8_t int8;
@@ -160,6 +170,12 @@ struct TimeVal {
uint32 Microseconds;
};
+/* TimeRequest */
+struct TimeRequest {
+ struct IORequest Request;
+ struct TimeVal Time;
+};
+
/* Compositing */
#define COMPFLAG_IgnoreDestAlpha 0
#define COMPFLAG_SrcAlphaOverride 0
@@ -189,7 +205,8 @@ struct TimeVal {
/* Object types */
enum {
- ASOT_PORT = 1
+ ASOT_PORT = 1,
+ ASOT_IOREQUEST
};
/* Requester types */
diff --git a/amiga/plugin_hack.c b/amiga/plugin_hack.c
index 7982a67..23f4d34 100644
--- a/amiga/plugin_hack.c
+++ b/amiga/plugin_hack.c
@@ -17,9 +17,11 @@
*/
/** \file
- * DataTypes picture handler (implementation)
+ * Plugin=>external program handler (implementation)
*/
+#include "amiga/os3support.h"
+
#include "amiga/filetype.h"
#include "amiga/plugin_hack.h"
#include "content/content_protected.h"
@@ -250,6 +252,7 @@ void amiga_plugin_hack_execute(struct hlcache_handle *c)
if(full_cmd)
{
+#ifdef __amigaos4__
LOG(("Attempting to execute %s", full_cmd));
in = Open("NIL:", MODE_OLDFILE);
@@ -264,5 +267,6 @@ void amiga_plugin_hack_execute(struct hlcache_handle *c)
TAG_DONE);
FreeVec(full_cmd);
+#endif
}
}
diff --git a/amiga/print.c b/amiga/print.c
index 862e598..5c89705 100644
--- a/amiga/print.c
+++ b/amiga/print.c
@@ -16,6 +16,8 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
+#include "amiga/os3support.h"
+
#include <proto/utility.h>
#include <proto/iffparse.h>
#include <proto/dos.h>
@@ -53,6 +55,7 @@
#include "amiga/plotters.h"
#include "amiga/gui.h"
+#include "amiga/misc.h"
#include "amiga/print.h"
#include "amiga/utf8.h"
@@ -217,11 +220,11 @@ void ami_print_ui(struct hlcache_handle *c)
char filename[30];
int i;
- struct ami_print_window *pw = AllocVecTags(sizeof(struct ami_print_window), AVT_ClearWithValue, 0, TAG_DONE);
+ struct ami_print_window *pw = ami_misc_allocvec_clear(sizeof(struct ami_print_window), 0);
pw->c = c;
- printers[0] = AllocVecTags(50, AVT_ClearWithValue, 0, TAG_DONE);
+ printers[0] = ami_misc_allocvec_clear(50, 0);
ami_print_readunit("ENV:Sys/printer.prefs", printers[0], 50, 0);
strcpy(filename,"ENV:Sys/printerN.prefs");
@@ -385,13 +388,18 @@ void ami_print(struct hlcache_handle *c, int copies)
if(ami_print_info.msgport == NULL)
ami_print_init();
-
+#ifdef __amigaos4__
if(!(ami_print_info.PReq =
(struct IODRPTagsReq *)AllocSysObjectTags(ASOT_IOREQUEST,
ASOIOR_Size, sizeof(struct IODRPTagsReq),
ASOIOR_ReplyPort, ami_print_info.msgport,
ASO_NoTrack, FALSE,
TAG_DONE))) return;
+#else
+ if(!(ami_print_info.PReq =
+ (struct IODRPTagsReq *)CreateIORequest(ami_print_info.msgport,
+ sizeof(struct IODRPTagsReq)))) return;
+#endif
if(OpenDevice("printer.device", nsoption_int(printer_unit),
(struct IORequest *)ami_print_info.PReq, 0))
@@ -467,7 +475,7 @@ struct MsgPort *ami_print_get_msgport(void)
bool ami_print_begin(struct print_settings *ps)
{
- ami_print_info.gg = AllocVecTags(sizeof(struct gui_globals), AVT_ClearWithValue, 0, TAG_DONE);
+ ami_print_info.gg = ami_misc_allocvec_clear(sizeof(struct gui_globals), 0);
if(!ami_print_info.gg) return false;
ami_init_layers(ami_print_info.gg,
diff --git a/amiga/schedule.c b/amiga/schedule.c
index 93389a8..494b8b0 100755
--- a/amiga/schedule.c
+++ b/amiga/schedule.c
@@ -297,18 +297,22 @@ static struct MsgPort *ami_schedule_open_timer(struct MsgPort *msgport)
ASO_NoTrack, FALSE,
TAG_DONE);
}
-
+#ifdef __amigaos4__
tioreq = (struct TimeRequest *)AllocSysObjectTags(ASOT_IOREQUEST,
ASOIOR_Size,sizeof(struct TimeRequest),
ASOIOR_ReplyPort,msgport,
ASO_NoTrack,FALSE,
TAG_DONE);
+#else
+ tioreq = (struct TimeRequest *)CreateIORequest(msgport, sizeof(struct TimeRequest));
+#endif
OpenDevice("timer.device", UNIT_WAITUNTIL, (struct IORequest *)tioreq, 0);
TimerBase = (struct Device *)tioreq->Request.io_Device;
+#ifdef __amigaos4__
ITimer = (struct TimerIFace *)GetInterface((struct Library *)TimerBase, "main", 1, NULL);
-
+#endif
return msgport;
}
diff --git a/amiga/search.c b/amiga/search.c
index ac061cb..ab32abb 100755
--- a/amiga/search.c
+++ b/amiga/search.c
@@ -103,7 +103,7 @@ void ami_search_open(struct gui_window *gwin)
return;
}
- fwin = AllocVecTags(sizeof(struct find_window), AVT_ClearWithValue, 0, TAG_DONE);
+ fwin = ami_misc_allocvec_clear(sizeof(struct find_window), 0);
fwin->objects[OID_MAIN] = WindowObject,
WA_ScreenTitle, ami_gui_get_screen_title(),
diff --git a/amiga/stringview/stringview.c b/amiga/stringview/stringview.c
index daabe58..a009f22 100755
--- a/amiga/stringview/stringview.c
+++ b/amiga/stringview/stringview.c
@@ -667,7 +667,7 @@ static uint32 myStringClass_GM_HandleInput( Class *cl, Object *obj, struct gpInp
myStringHandleListview( cl, obj );
break;
}
-
+#ifdef __amigaos4__
case IECLASS_MOUSEWHEEL:
{
struct InputEvent *ie = msg->gpi_IEvent;
@@ -686,7 +686,7 @@ static uint32 myStringClass_GM_HandleInput( Class *cl, Object *obj, struct gpInp
retval = GMR_MEACTIVE;
break;
}
-
+#endif
default:
{
retval = IDoSuperMethodA( cl, obj, (APTR)msg );
diff --git a/amiga/stringview/urlhistory.c b/amiga/stringview/urlhistory.c
index 6d134a4..d55a4b4 100644
--- a/amiga/stringview/urlhistory.c
+++ b/amiga/stringview/urlhistory.c
@@ -33,6 +33,12 @@
static struct List PageList;
+#ifdef __amigaos4__
+#define ALLOCVEC_SHARED(N) AllocVecTags((N), AVT_Type, MEMF_SHARED, TAG_DONE);
+#else
+#define ALLOCVEC_SHARED(N) AllocVec((N), MEMF_SHARED);
+#endif
+
void URLHistory_Init( void )
{
// Initialise page list
@@ -79,17 +85,11 @@ static bool URLHistoryFound(nsurl *url, const struct url_data *data)
/* skip this URL if it is already in the list */
if(URLHistory_FindPage(nsurl_access(url))) return true;
- node = AllocVecTags(sizeof(struct Node),
- AVT_Type, MEMF_SHARED,
- //AVT_ClearWithValue, 0,
- TAG_DONE);
+ node = ALLOCVEC_SHARED(sizeof(struct Node));
if ( node )
{
- STRPTR urladd = (STRPTR) AllocVecTags( strlen ( nsurl_access(url) ) + 1,
- AVT_Type, MEMF_SHARED,
- //AVT_ClearWithValue, 0,
- TAG_DONE);
+ STRPTR urladd = (STRPTR) ALLOCVEC_SHARED( strlen ( nsurl_access(url) ) + 1);
if ( urladd )
{
diff --git a/amiga/theme.c b/amiga/theme.c
index b7099e8..b75f6ed 100644
--- a/amiga/theme.c
+++ b/amiga/theme.c
@@ -16,6 +16,8 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
+#include "amiga/os3support.h"
+
#include <string.h>
#include <proto/clicktab.h>
@@ -99,6 +101,7 @@ const char *ptrs32[AMI_LASTPOINTER+1] = {
"ptr32_blank",
"ptr32_drag"};
+#ifdef __amigaos4__
/* Mapping from NetSurf to AmigaOS mouse pointers */
int osmouseptr[AMI_LASTPOINTER+1] = {
POINTERTYPE_NORMAL,
@@ -122,7 +125,7 @@ int osmouseptr[AMI_LASTPOINTER+1] = {
POINTERTYPE_PROGRESS,
POINTERTYPE_NONE,
POINTERTYPE_DRAGANDDROP};
-
+#endif
void ami_theme_init(void)
{
@@ -218,13 +221,15 @@ void ami_update_pointer(struct Window *win, gui_pointer_shape shape)
if(drag_save_data) return;
if(LIB_IS_AT_LEAST((struct Library *)IntuitionBase, 53, 42)) {
+#ifdef __amigaos4__
BOOL ptr_delay = FALSE;
if(shape == GUI_POINTER_WAIT) ptr_delay = TRUE;
SetWindowPointer(win,
WA_PointerType, osmouseptr[shape],
WA_PointerDelay, ptr_delay,
- TAG_DONE);
+ TAG_DONE);
+#endif
} else {
if(nsoption_bool(os_mouse_pointers))
{
@@ -408,12 +413,14 @@ void gui_window_start_throbber(struct gui_window *g)
if(!g) return;
if(nsoption_bool(kiosk_mode)) return;
+#ifdef __amigaos4__
if(g->tab_node && (g->shared->tabs > 1))
{
SetClickTabNodeAttrs(g->tab_node, TNA_Flagged, TRUE, TAG_DONE);
RefreshGadgets((APTR)g->shared->objects[GID_TABS],
g->shared->win, NULL);
}
+#endif
g->throbbing = true;
if(g->shared->throbber_frame == 0) g->shared->throbber_frame = 1;
@@ -427,12 +434,14 @@ void gui_window_stop_throbber(struct gui_window *g)
if(!g) return;
if(nsoption_bool(kiosk_mode)) return;
+#ifdef __amigaos4__
if(g->tab_node && (g->shared->tabs > 1))
{
SetClickTabNodeAttrs(g->tab_node, TNA_Flagged, FALSE, TAG_DONE);
RefreshGadgets((APTR)g->shared->objects[GID_TABS],
g->shared->win, NULL);
}
+#endif
if(g == g->shared->gw) {
if(ami_gui_get_space_box(g->shared->objects[GID_THROBBER], &bbox) != NSERROR_OK) {
@@ -471,7 +480,7 @@ static void ami_throbber_update(void *p)
warn_user("NoMemory", "");
return;
}
-
+#ifdef __amigaos4__
BltBitMapTags(BLITA_SrcX, throbber_width * frame,
BLITA_SrcY, 0,
BLITA_DestX, bbox->Left,
@@ -484,7 +493,10 @@ static void ami_throbber_update(void *p)
BLITA_DestType, BLITT_RASTPORT,
// BLITA_UseSrcAlpha, TRUE,
TAG_DONE);
-
+#else
+ BltBitMapRastPort(throbber, throbber_width * frame, 0, g->shared->win->RPort,
+ bbox->Left, bbox->Top, throbber_width, throbber_height, 0xC0);
+#endif
ami_gui_free_space_box(bbox);
}
diff --git a/amiga/thumbnail.c b/amiga/thumbnail.c
index ea681d2..7b3c156 100755
--- a/amiga/thumbnail.c
+++ b/amiga/thumbnail.c
@@ -16,6 +16,8 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
+#include "amiga/os3support.h"
+
#include <proto/graphics.h>
#include <proto/Picasso96API.h>
#include <intuition/intuition.h>
diff --git a/amiga/tree.c b/amiga/tree.c
index 75ba123..5d453b6 100644
--- a/amiga/tree.c
+++ b/amiga/tree.c
@@ -42,7 +42,9 @@
#include <gadgets/scroller.h>
#include <reaction/reaction_macros.h>
#include <intuition/icclass.h>
+#ifdef __amigaos4__
#include <graphics/blitattr.h>
+#endif
#include <assert.h>
#include <string.h>
@@ -62,6 +64,7 @@
#include "amiga/gui.h"
#include "amiga/tree.h"
#include "amiga/file.h"
+#include "amiga/misc.h"
#include "amiga/utf8.h"
#include "amiga/sslcert.h"
#include "amiga/drag.h" /* drag icon stuff */
@@ -315,7 +318,7 @@ static void ami_tree_redraw_req(void *p)
tree_draw(twin->tree, - tile_x, - tile_y,
tile_x, tile_y, tile_w, tile_h, &ctx);
-
+#ifdef __amigaos4__
BltBitMapTags(BLITA_SrcType, BLITT_BITMAP,
BLITA_Source, twin->globals.bm,
BLITA_SrcX, 0,
@@ -327,6 +330,11 @@ static void ami_tree_redraw_req(void *p)
BLITA_Width, tile_w,
BLITA_Height, tile_h,
TAG_DONE);
+#else
+ BltBitMapRastPort(twin->globals.bm, 0, 0,
+ twin->win->RPort, bbox->Left + tile_x - pos_x, bbox->Top + tile_y - pos_y,
+ tile_w, tile_h, 0xC0);
+#endif
}
}
@@ -534,7 +542,7 @@ static void ami_tree_scroller_hook(struct Hook *hook,Object *object,struct Intui
break;
}
break;
-
+#ifdef __amigaos4__
case IDCMP_EXTENDEDMOUSE:
if(msg->Code == IMSGCODE_INTUIWHEELDATA)
{
@@ -543,6 +551,7 @@ static void ami_tree_scroller_hook(struct Hook *hook,Object *object,struct Intui
ami_tree_scroll(twin, (wheel->WheelX * 20), (wheel->WheelY * 20));
}
break;
+#endif
}
}
@@ -550,9 +559,7 @@ static void ami_tree_menu(struct treeview_window *twin)
{
if(twin->menu) return;
- if((twin->menu = AllocVecTags(sizeof(struct NewMenu) * AMI_TREE_MENU_ITEMS,
- AVT_ClearWithValue, 0, TAG_DONE)))
- {
+ if((twin->menu = ami_misc_allocvec_clear(sizeof(struct NewMenu) * AMI_TREE_MENU_ITEMS, 0))) {
twin->menu[0].nm_Type = NM_TITLE;
twin->menu_name[0] = ami_utf8_easy((char *)messages_get("Tree"));
twin->menu[0].nm_Label = twin->menu_name[0];
@@ -902,9 +909,11 @@ void ami_tree_close(struct treeview_window *twin)
static void ami_tree_update_quals(struct treeview_window *twin)
{
uint32 quals = 0;
-
+#ifdef __amigaos4__
GetAttr(WINDOW_Qualifier, twin->objects[OID_MAIN], (uint32 *)&quals);
-
+#else
+#warning FIXME not reading qualifiers on OS3
+#endif
twin->key_state = 0;
if((quals & IEQUALIFIER_LSHIFT) || (quals & IEQUALIFIER_RSHIFT))
@@ -976,7 +985,9 @@ BOOL ami_tree_event(struct treeview_window *twin)
if((twin->type != AMI_TREE_SSLCERT) &&
(twin->rmbtrapped == FALSE))
{
+#ifdef __amigaos4__
SetWindowAttr(twin->win, WA_RMBTrap, (APTR)(BOOL)TRUE, sizeof(BOOL));
+#endif
twin->rmbtrapped = TRUE;
}
}
@@ -984,7 +995,9 @@ BOOL ami_tree_event(struct treeview_window *twin)
{
if(twin->rmbtrapped == TRUE)
{
+#ifdef __amigaos4__
SetWindowAttr(twin->win, WA_RMBTrap, (APTR)(BOOL)FALSE, sizeof(BOOL));
+#endif
twin->rmbtrapped = FALSE;
}
}
@@ -1455,7 +1468,7 @@ struct treeview_window *ami_tree_create(int flags,
{
struct treeview_window *twin;
- twin = AllocVecTags(sizeof(struct treeview_window), AVT_ClearWithValue, 0, TAG_DONE);
+ twin = ami_misc_allocvec_clear(sizeof(struct treeview_window), 0);
if(!twin)
{
--
NetSurf Browser
8 years
netsurf: branch master updated. release/3.2-596-g2eb41ed
by NetSurf Browser Project
Gitweb links:
...log http://git.netsurf-browser.org/netsurf.git/shortlog/2eb41ed77b2deb3a1c54c...
...commit http://git.netsurf-browser.org/netsurf.git/commit/2eb41ed77b2deb3a1c54c7b...
...tree http://git.netsurf-browser.org/netsurf.git/tree/2eb41ed77b2deb3a1c54c7b6b...
The branch, master has been updated
via 2eb41ed77b2deb3a1c54c7b6b94a7c31fb603714 (commit)
via d6052d3955ffa1aca81c3363b7c53aec51cb6208 (commit)
via cc634dd70697116eec4f10f258cb638bf58ae726 (commit)
from 0673ac5096f79bff53f4f976be86275cef51d711 (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=2eb41ed77b2deb3a1c5...
commit 2eb41ed77b2deb3a1c54c7b6b94a7c31fb603714
Author: Chris Young <chris(a)unsatisfactorysoftware.co.uk>
Commit: Chris Young <chris(a)unsatisfactorysoftware.co.uk>
More OS3 fixes
diff --git a/amiga/libs.c b/amiga/libs.c
index ec41ee2..7810fad 100644
--- a/amiga/libs.c
+++ b/amiga/libs.c
@@ -16,6 +16,8 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
+#include "amiga/os3support.h"
+
#include "amiga/libs.h"
#include "amiga/misc.h"
#include "utils/utils.h"
@@ -24,6 +26,7 @@
#include <proto/exec.h>
#include <proto/utility.h>
+#ifdef __amigaos4__
#define AMINS_LIB_OPEN(LIB, LIBVER, PREFIX, INTERFACE, INTVER, FAIL) \
LOG(("Opening %s v%d", LIB, LIBVER)); \
if((PREFIX##Base = OpenLibrary(LIB, LIBVER))) { \
@@ -48,6 +51,26 @@
#define AMINS_LIB_STRUCT(PREFIX) \
struct Library *PREFIX##Base; \
struct PREFIX##IFace *I##PREFIX;
+#else
+#define AMINS_LIB_OPEN(LIB, LIBVER, PREFIX, INTERFACE, INTVER, FAIL) \
+ LOG(("Opening %s v%d", LIB, LIBVER)); \
+ if((PREFIX##Base = OpenLibrary(LIB, LIBVER))) { \
+ } else { \
+ LOG(("Failed to open %s v%d", LIB, LIBVER)); \
+ if(FAIL == true) { \
+ STRPTR error = ASPrintf("Unable to open %s v%d", LIB, LIBVER); \
+ ami_misc_fatal_error(error); \
+ FreeVec(error); \
+ return false; \
+ } \
+ }
+
+#define AMINS_LIB_CLOSE(PREFIX) \
+ if(PREFIX##Base) CloseLibrary(PREFIX##Base);
+
+#define AMINS_LIB_STRUCT(PREFIX) \
+ struct Library *PREFIX##Base;
+#endif
#define GraphicsBase GfxBase /* graphics.library is a bit weird */
diff --git a/amiga/login.c b/amiga/login.c
index e9e221b..fe476ac 100755
--- a/amiga/login.c
+++ b/amiga/login.c
@@ -61,8 +61,7 @@ void gui_401login_open(nsurl *url, const char *realm,
nserror (*cb)(bool proceed, void *pw), void *cbpw)
{
const char *auth;
- struct gui_login_window *lw = AllocVecTags(sizeof(struct gui_login_window),
- AVT_ClearWithValue, 0, TAG_DONE);
+ struct gui_login_window *lw = ami_misc_allocvec_clear(sizeof(struct gui_login_window), 0);
lwc_string *host = nsurl_get_component(url, NSURL_HOST);
assert(host != NULL);
diff --git a/amiga/menu.c b/amiga/menu.c
index 3eb8a98..e5d35a9 100644
--- a/amiga/menu.c
+++ b/amiga/menu.c
@@ -16,6 +16,8 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
+#include "amiga/os3support.h"
+
#include <string.h>
#include <proto/dos.h>
@@ -196,7 +198,7 @@ static void ami_init_menulabs(struct gui_window_2 *gwin)
{
int i;
- gwin->menutype = AllocVecTags(AMI_MENU_AREXX_MAX + 1, AVT_ClearWithValue, 0, TAG_DONE);
+ gwin->menutype = ami_misc_allocvec_clear(AMI_MENU_AREXX_MAX + 1, 0);
for(i=0;i <= AMI_MENU_AREXX_MAX;i++)
{
@@ -333,6 +335,7 @@ void ami_menu_refresh(struct gui_window_2 *gwin)
static void ami_menu_load_glyphs(struct DrawInfo *dri)
{
+#ifdef __amigaos4__
for(int i = 0; i < NSA_GLYPH_MAX; i++)
menu_glyph[i] = NULL;
@@ -350,10 +353,12 @@ static void ami_menu_load_glyphs(struct DrawInfo *dri)
(ULONG *)&menu_glyph_width[NSA_GLYPH_AMIGAKEY]);
menu_glyphs_loaded = true;
+#endif
}
void ami_menu_free_glyphs(void)
{
+#ifdef __amigaos4__
int i;
if(menu_glyphs_loaded == false) return;
@@ -363,6 +368,7 @@ void ami_menu_free_glyphs(void)
};
menu_glyphs_loaded = false;
+#endif
}
static int ami_menu_calc_item_width(struct gui_window_2 *gwin, int j, struct RastPort *rp)
@@ -413,7 +419,7 @@ static struct gui_window_2 *ami_menu_layout(struct gui_window_2 *gwin)
j++;
} while((gwin->menutype[j] != NM_TITLE) && (gwin->menutype[j] != 0));
}
-
+#ifdef __amigaos4__
if(LIB_IS_AT_LEAST((struct Library *)GadToolsBase, 53, 6)) {
/* GadTools 53.6+ only. For now we will only create the menu
using label.image if there's a bitmap associated with the item. */
@@ -495,7 +501,7 @@ static struct gui_window_2 *ami_menu_layout(struct gui_window_2 *gwin)
if(gwin->menuobj[i]) gwin->menutype[i] |= MENU_IMAGE;
}
}
-
+#endif
gwin->menu[i].nm_Type = gwin->menutype[i];
if(gwin->menuobj[i])
@@ -520,8 +526,7 @@ static struct gui_window_2 *ami_menu_layout(struct gui_window_2 *gwin)
struct NewMenu *ami_create_menu(struct gui_window_2 *gwin)
{
- gwin->menu = AllocVecTags(sizeof(struct NewMenu) * (AMI_MENU_AREXX_MAX + 1),
- AVT_ClearWithValue, 0, TAG_DONE);
+ gwin->menu = ami_misc_allocvec_clear(sizeof(struct NewMenu) * (AMI_MENU_AREXX_MAX + 1), 0);
ami_init_menulabs(gwin);
ami_menu_scan(ami_tree_get_tree(hotlist_window), gwin);
ami_menu_arexx_scan(gwin);
@@ -835,7 +840,7 @@ static void ami_menu_item_project_about(struct Hook *hook, APTR window, struct I
temp2 = ami_utf8_easy(temp);
FreeVec(temp);
-
+#ifdef __amigaos4__
sel = TimedDosRequesterTags(TDR_ImageType,TDRIMAGE_INFO,
TDR_TitleString, messages_get("NetSurf"),
TDR_Window, gwin->win,
@@ -844,7 +849,12 @@ static void ami_menu_item_project_about(struct Hook *hook, APTR window, struct I
TDR_Arg1,netsurf_version,
TDR_Arg2,verdate,
TAG_DONE);
-
+#else
+ /*\todo proper requester for OS3
+ * at the moment menus are disabled so won't get here anyway */
+ printf("NetSurf %s\nBuild date %s\n", netsurf_version, verdate);
+ sel = 0;
+#endif
free(temp2);
if(sel == 2) {
diff --git a/amiga/misc.c b/amiga/misc.c
index 0cd3bae..73a87e7 100755
--- a/amiga/misc.c
+++ b/amiga/misc.c
@@ -52,7 +52,7 @@ static LONG ami_misc_req(const char *message, uint32 type)
LONG ret = 0;
LOG(("%s", message));
-
+#ifdef __amigaos4__
ret = TimedDosRequesterTags(
TDR_TitleString, messages_get("NetSurf"),
TDR_FormatString, message,
@@ -60,7 +60,9 @@ static LONG ami_misc_req(const char *message, uint32 type)
TDR_ImageType, type,
TDR_Window, cur_gw ? cur_gw->shared->win : NULL,
TAG_DONE);
-
+#else
+ printf("%s\n", message);
+#endif
return ret;
}
@@ -84,6 +86,7 @@ void warn_user(const char *warning, const char *detail)
int32 ami_warn_user_multi(const char *body, const char *opt1, const char *opt2, struct Window *win)
{
int res = 0;
+#ifdef __amigaos4__
char *utf8text = ami_utf8_easy(body);
char *utf8gadget1 = ami_utf8_easy(messages_get(opt1));
char *utf8gadget2 = ami_utf8_easy(messages_get(opt2));
@@ -100,7 +103,9 @@ int32 ami_warn_user_multi(const char *body, const char *opt1, const char *opt2,
if(utf8text) free(utf8text);
if(utf8gadgets) FreeVec(utf8gadgets);
-
+#else
+#warning write this for os3
+#endif
return res;
}
diff --git a/amiga/object.c b/amiga/object.c
index 0c848aa..99f359a 100755
--- a/amiga/object.c
+++ b/amiga/object.c
@@ -16,6 +16,8 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
+#include "amiga/os3support.h"
+
#include <stdlib.h>
#include <proto/exec.h>
@@ -24,6 +26,7 @@
#include "amiga/filetype.h"
#include "amiga/font.h"
+#include "amiga/misc.h"
#include "amiga/object.h"
struct MinList *NewObjList(void)
@@ -43,7 +46,7 @@ struct nsObject *AddObject(struct MinList *objlist, ULONG otype)
{
struct nsObject *dtzo;
- dtzo = (struct nsObject *)AllocVecTags(sizeof(struct nsObject), AVT_ClearWithValue, 0, TAG_DONE);
+ dtzo = (struct nsObject *)ami_misc_allocvec_clear(sizeof(struct nsObject), 0);
AddTail((struct List *)objlist,(struct Node *)dtzo);
diff --git a/amiga/os3support.c b/amiga/os3support.c
index cc567f6..dda3df3 100644
--- a/amiga/os3support.c
+++ b/amiga/os3support.c
@@ -23,6 +23,17 @@
#ifndef __amigaos4__
#include "os3support.h"
+#include <inttypes.h>
+#include <stdarg.h>
+#include <stdio.h>
+#include <proto/exec.h>
+#include <proto/intuition.h>
+#include <proto/dos.h>
+
+#define SUCCESS (TRUE)
+#define FAILURE (FALSE)
+#define NO !
+
/* DOS */
int64 GetFileSize(BPTR fh)
{
diff --git a/amiga/os3support.h b/amiga/os3support.h
index 5fb1134..93bb0ba 100644
--- a/amiga/os3support.h
+++ b/amiga/os3support.h
@@ -37,6 +37,14 @@
#include <exec/memory.h>
#endif
+#ifndef ASM
+#define ASM
+#endif
+
+#ifndef REG
+#define REG(reg,arg) arg __asm(#reg)
+#endif
+
/* Macros */
#define IsMinListEmpty(L) (L)->mlh_Head->mln_Succ == 0
@@ -93,6 +101,7 @@
#define IDCMP_EXTENDEDMOUSE 0
#define WINDOW_BACKMOST 0
#define DN_FULLPATH 0
+#define BGBACKFILL JAM1
/* Renamed structures */
#define AnchorPathOld AnchorPath
@@ -183,6 +192,12 @@ enum {
ASOT_PORT = 1
};
+/* Requester types */
+enum {
+ TDRIMAGE_ERROR = 1,
+ TDRIMAGE_WARNING
+};
+
/* Functions */
/* DOS */
int64 GetFileSize(BPTR fh);
diff --git a/amiga/plotters.c b/amiga/plotters.c
index 855d104..490d519 100755
--- a/amiga/plotters.c
+++ b/amiga/plotters.c
@@ -16,6 +16,8 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
+#include "amiga/os3support.h"
+
#include <proto/Picasso96API.h>
#include <proto/exec.h>
#include <proto/intuition.h>
@@ -46,7 +48,9 @@
#include "amiga/gui.h"
#include "amiga/utf8.h"
+#ifdef __amigaos4__
static void ami_bitmap_tile_hook(struct Hook *hook,struct RastPort *rp,struct BackFillMessage *bfmsg);
+#endif
struct bfbitmap {
struct BitMap *bm;
@@ -138,7 +142,6 @@ void ami_init_layers(struct gui_globals *gg, ULONG width, ULONG height)
InitRastPort(gg->rp);
gg->rp->BitMap = gg->bm;
- /* Is all this safe to do to an existing window RastPort? */
SetDrMd(gg->rp,BGBACKFILL);
gg->rp->Layer = CreateUpfrontLayer(gg->layerinfo,gg->rp->BitMap,0,0,
@@ -232,9 +235,11 @@ void ami_plot_release_pens(struct MinList *shared_pens)
static void ami_plot_setapen(ULONG colr)
{
if(palette_mapped == false) {
+#ifdef __amigaos4__
SetRPAttrs(glob->rp, RPTAG_APenColor,
ns_color_to_nscss(colr),
TAG_DONE);
+#endif
} else {
LONG pen = ami_plot_obtain_pen(glob->shared_pens, colr);
if(pen != -1) SetAPen(glob->rp, pen);
@@ -244,9 +249,11 @@ static void ami_plot_setapen(ULONG colr)
static void ami_plot_setopen(ULONG colr)
{
if(palette_mapped == false) {
+#ifdef __amigaos4__
SetRPAttrs(glob->rp, RPTAG_OPenColor,
ns_color_to_nscss(colr),
TAG_DONE);
+#endif
} else {
LONG pen = ami_plot_obtain_pen(glob->shared_pens, colr);
if(pen != -1) SetOPen(glob->rp, pen);
@@ -521,7 +528,7 @@ static bool ami_bitmap(int x, int y, int width, int height, struct bitmap *bitma
if((tag_data = (ULONG)ami_bitmap_get_mask(bitmap, width, height, tbm)))
minterm = (ABC|ABNC|ANBC);
}
-
+#ifdef __amigaos4__
BltBitMapTags(BLITA_Width,width,
BLITA_Height,height,
BLITA_Source,tbm,
@@ -533,6 +540,10 @@ static bool ami_bitmap(int x, int y, int width, int height, struct bitmap *bitma
BLITA_Minterm, minterm,
tag, tag_data,
TAG_DONE);
+#else
+ /* Assume mask is always required */
+ BltMaskBitMapRastPort(tbm, 0, 0, glob->rp, x, y, width, height, tag_data, minterm);
+#endif
}
if((bitmap->dto == NULL) && (tbm != bitmap->nativebm))
@@ -562,7 +573,7 @@ bool ami_bitmap_tile(int x, int y, int width, int height,
if(!(repeat_x || repeat_y))
return ami_bitmap(x, y, width, height, bitmap);
-
+#ifdef __amigaos4__
/* If it is a one pixel transparent image, we are wasting our time */
if((bitmap->opaque == false) && (bitmap->width == 1) && (bitmap->height == 1))
return true;
@@ -641,10 +652,13 @@ bool ami_bitmap_tile(int x, int y, int width, int height,
{
p96FreeBitMap(tbm);
}
-
+#else
+#warning FIXME: bitmap tiling uses backfill hooks
+#endif
return true;
}
+#ifdef __amigaos4__
static void ami_bitmap_tile_hook(struct Hook *hook,struct RastPort *rp,struct BackFillMessage *bfmsg)
{
int xf,yf;
@@ -700,6 +714,7 @@ static void ami_bitmap_tile_hook(struct Hook *hook,struct RastPort *rp,struct Ba
}
}
}
+#endif
bool ami_group_start(const char *name)
{
commitdiff http://git.netsurf-browser.org/netsurf.git/commit/?id=d6052d3955ffa1aca81...
commit d6052d3955ffa1aca81c3363b7c53aec51cb6208
Author: Chris Young <chris(a)unsatisfactorysoftware.co.uk>
Commit: Chris Young <chris(a)unsatisfactorysoftware.co.uk>
Fixup icon.c for OS3
diff --git a/amiga/icon.c b/amiga/icon.c
index 2745fcf..dfbf84c 100644
--- a/amiga/icon.c
+++ b/amiga/icon.c
@@ -376,43 +376,41 @@ void amiga_icon_superimpose_favicon_internal(struct hlcache_handle *icon, struct
TAG_DONE);
if(format != IDFMT_DIRECTMAPPED) return;
- {
- if ((icon != NULL) && (content_get_bitmap(icon) != NULL))
- {
- bm = ami_bitmap_get_native(content_get_bitmap(icon), 16, 16, NULL);
- }
+#ifdef __amigaos4__
+ if ((icon != NULL) && (content_get_bitmap(icon) != NULL)) {
+ bm = ami_bitmap_get_native(content_get_bitmap(icon), 16, 16, NULL);
+ }
- if(bm)
- {
- BltBitMapTags(BLITA_SrcX, 0,
- BLITA_SrcY, 0,
- BLITA_DestX, width - 16,
- BLITA_DestY, height - 16,
- BLITA_Width, 16,
- BLITA_Height, 16,
- BLITA_Source, bm,
- BLITA_Dest, icondata1,
- BLITA_SrcType, BLITT_BITMAP,
- BLITA_DestType, BLITT_ARGB32,
- BLITA_DestBytesPerRow, width * 4,
- BLITA_UseSrcAlpha, TRUE,
- TAG_DONE);
+ if(bm) {
+ BltBitMapTags(BLITA_SrcX, 0,
+ BLITA_SrcY, 0,
+ BLITA_DestX, width - 16,
+ BLITA_DestY, height - 16,
+ BLITA_Width, 16,
+ BLITA_Height, 16,
+ BLITA_Source, bm,
+ BLITA_Dest, icondata1,
+ BLITA_SrcType, BLITT_BITMAP,
+ BLITA_DestType, BLITT_ARGB32,
+ BLITA_DestBytesPerRow, width * 4,
+ BLITA_UseSrcAlpha, TRUE,
+ TAG_DONE);
- BltBitMapTags(BLITA_SrcX, 0,
- BLITA_SrcY, 0,
- BLITA_DestX, width - 16,
- BLITA_DestY, height - 16,
- BLITA_Width, 16,
- BLITA_Height, 16,
- BLITA_Source, bm,
- BLITA_Dest, icondata2,
- BLITA_SrcType, BLITT_BITMAP,
- BLITA_DestType, BLITT_ARGB32,
- BLITA_DestBytesPerRow, width * 4,
- BLITA_UseSrcAlpha, TRUE,
- TAG_DONE);
- }
+ BltBitMapTags(BLITA_SrcX, 0,
+ BLITA_SrcY, 0,
+ BLITA_DestX, width - 16,
+ BLITA_DestY, height - 16,
+ BLITA_Width, 16,
+ BLITA_Height, 16,
+ BLITA_Source, bm,
+ BLITA_Dest, icondata2,
+ BLITA_SrcType, BLITT_BITMAP,
+ BLITA_DestType, BLITT_ARGB32,
+ BLITA_DestBytesPerRow, width * 4,
+ BLITA_UseSrcAlpha, TRUE,
+ TAG_DONE);
}
+#endif
}
void amiga_icon_superimpose_favicon(char *path, struct hlcache_handle *icon, char *type)
@@ -496,7 +494,7 @@ struct DiskObject *amiga_icon_from_bitmap(struct bitmap *bm)
{
struct DiskObject *dobj;
struct BitMap *bitmap;
-
+#ifdef __amigaos4__
if(bm)
{
bitmap = ami_bitmap_get_native(bm, THUMBNAIL_WIDTH,
@@ -512,11 +510,11 @@ struct DiskObject *amiga_icon_from_bitmap(struct bitmap *bm)
BLITA_Dest, bm->icondata,
TAG_DONE);
}
-
+#endif
dobj = GetIconTags(NULL, ICONGETA_GetDefaultType, WBPROJECT,
ICONGETA_GetDefaultName, "iconify",
TAG_DONE);
-
+#ifdef __amigaos4__
if(bm)
{
IconControl(dobj,
@@ -527,7 +525,7 @@ struct DiskObject *amiga_icon_from_bitmap(struct bitmap *bm)
ICONCTRLA_SetImageData2, NULL,
TAG_DONE);
}
-
+#endif
dobj->do_Gadget.UserData = bm;
LayoutIconA(dobj, (struct Screen *)~0UL, NULL);
commitdiff http://git.netsurf-browser.org/netsurf.git/commit/?id=cc634dd70697116eec4...
commit cc634dd70697116eec4f10f258cb638bf58ae726
Author: Chris Young <chris(a)unsatisfactorysoftware.co.uk>
Commit: Chris Young <chris(a)unsatisfactorysoftware.co.uk>
Lower requested library versions
diff --git a/amiga/libs.c b/amiga/libs.c
index cab02d2..ec41ee2 100644
--- a/amiga/libs.c
+++ b/amiga/libs.c
@@ -93,12 +93,12 @@ bool ami_libs_open(void)
AMINS_LIB_OPEN("application.library", 53, Application, "application", 2, false)
AMINS_LIB_OPEN("asl.library", 37, Asl, "main", 1, true)
AMINS_LIB_OPEN("datatypes.library", 37, DataTypes, "main", 1, true)
- AMINS_LIB_OPEN("diskfont.library", 50, Diskfont, "main", 1, true)
+ AMINS_LIB_OPEN("diskfont.library", 40, Diskfont, "main", 1, true)
AMINS_LIB_OPEN("gadtools.library", 37, GadTools, "main", 1, true)
- AMINS_LIB_OPEN("graphics.library", 50, Graphics, "main", 1, true)
- AMINS_LIB_OPEN("icon.library", 50, Icon, "main", 1, true)
+ AMINS_LIB_OPEN("graphics.library", 40, Graphics, "main", 1, true)
+ AMINS_LIB_OPEN("icon.library", 44, Icon, "main", 1, true)
AMINS_LIB_OPEN("iffparse.library", 37, IFFParse, "main", 1, true)
- AMINS_LIB_OPEN("intuition.library", 37, Intuition, "main", 1, true)
+ AMINS_LIB_OPEN("intuition.library", 40, Intuition, "main", 1, true)
AMINS_LIB_OPEN("keymap.library", 37, Keymap, "main", 1, true)
AMINS_LIB_OPEN("layers.library", 37, Layers, "main", 1, true)
AMINS_LIB_OPEN("locale.library", 37, Locale, "main", 1, true)
@@ -121,26 +121,26 @@ bool ami_libs_open(void)
* we may as well just open them normally for now.
*/
- AMINS_LIB_OPEN("classes/arexx.class", 50, ARexx, "main", 1, true)
- AMINS_LIB_OPEN("images/bevel.image", 50, Bevel, "main", 1, true)
- AMINS_LIB_OPEN("images/bitmap.image", 50, BitMap, "main", 1, true)
- AMINS_LIB_OPEN("gadgets/checkbox.gadget", 50, CheckBox, "main", 1, true)
- AMINS_LIB_OPEN("gadgets/chooser.gadget", 50, Chooser, "main", 1, true)
- AMINS_LIB_OPEN("gadgets/clicktab.gadget", 50, ClickTab, "main", 1, true)
- AMINS_LIB_OPEN("gadgets/fuelgauge.gadget", 50, FuelGauge, "main", 1, true)
- AMINS_LIB_OPEN("gadgets/getfile.gadget", 50, GetFile, "main", 1, true)
- AMINS_LIB_OPEN("gadgets/getfont.gadget", 50, GetFont, "main", 1, true)
- AMINS_LIB_OPEN("gadgets/getscreenmode.gadget", 50, GetScreenMode, "main", 1, true)
- AMINS_LIB_OPEN("gadgets/integer.gadget", 50, Integer, "main", 1, true)
- AMINS_LIB_OPEN("images/label.image", 50, Label, "main", 1, true)
- AMINS_LIB_OPEN("gadgets/layout.gadget", 50, Layout, "main", 1, true)
- AMINS_LIB_OPEN("gadgets/listbrowser.gadget", 50, ListBrowser, "main", 1, true)
- AMINS_LIB_OPEN("gadgets/radiobutton.gadget", 50, RadioButton, "main", 1, true)
- AMINS_LIB_OPEN("gadgets/scroller.gadget", 50, Scroller, "main", 1, true)
- AMINS_LIB_OPEN("gadgets/space.gadget", 50, Space, "main", 1, true)
- AMINS_LIB_OPEN("gadgets/speedbar.gadget", 50, SpeedBar, "main", 1, true)
- AMINS_LIB_OPEN("gadgets/string.gadget", 50, String, "main", 1, true)
- AMINS_LIB_OPEN("classes/window.class", 50, Window, "main", 1, true)
+ AMINS_LIB_OPEN("classes/arexx.class", 44, ARexx, "main", 1, true)
+ AMINS_LIB_OPEN("images/bevel.image", 44, Bevel, "main", 1, true)
+ AMINS_LIB_OPEN("images/bitmap.image", 44, BitMap, "main", 1, true)
+ AMINS_LIB_OPEN("gadgets/checkbox.gadget", 44, CheckBox, "main", 1, true)
+ AMINS_LIB_OPEN("gadgets/chooser.gadget", 44, Chooser, "main", 1, true)
+ AMINS_LIB_OPEN("gadgets/clicktab.gadget", 44, ClickTab, "main", 1, true)
+ AMINS_LIB_OPEN("gadgets/fuelgauge.gadget", 44, FuelGauge, "main", 1, true)
+ AMINS_LIB_OPEN("gadgets/getfile.gadget", 44, GetFile, "main", 1, true)
+ AMINS_LIB_OPEN("gadgets/getfont.gadget", 44, GetFont, "main", 1, true)
+ AMINS_LIB_OPEN("gadgets/getscreenmode.gadget", 44, GetScreenMode, "main", 1, true)
+ AMINS_LIB_OPEN("gadgets/integer.gadget", 44, Integer, "main", 1, true)
+ AMINS_LIB_OPEN("images/label.image", 44, Label, "main", 1, true)
+ AMINS_LIB_OPEN("gadgets/layout.gadget", 44, Layout, "main", 1, true)
+ AMINS_LIB_OPEN("gadgets/listbrowser.gadget", 44, ListBrowser, "main", 1, true)
+ AMINS_LIB_OPEN("gadgets/radiobutton.gadget", 44, RadioButton, "main", 1, true)
+ AMINS_LIB_OPEN("gadgets/scroller.gadget", 44, Scroller, "main", 1, true)
+ AMINS_LIB_OPEN("gadgets/space.gadget", 44, Space, "main", 1, true)
+ AMINS_LIB_OPEN("gadgets/speedbar.gadget", 44, SpeedBar, "main", 1, true)
+ AMINS_LIB_OPEN("gadgets/string.gadget", 44, String, "main", 1, true)
+ AMINS_LIB_OPEN("classes/window.class", 44, Window, "main", 1, true)
return true;
}
-----------------------------------------------------------------------
Summary of changes:
amiga/icon.c | 74 +++++++++++++++++++++++++---------------------------
amiga/libs.c | 71 ++++++++++++++++++++++++++++++++-----------------
amiga/login.c | 3 +--
amiga/menu.c | 24 ++++++++++++-----
amiga/misc.c | 11 +++++---
amiga/object.c | 5 +++-
amiga/os3support.c | 11 ++++++++
amiga/os3support.h | 15 +++++++++++
amiga/plotters.c | 23 +++++++++++++---
9 files changed, 158 insertions(+), 79 deletions(-)
diff --git a/amiga/icon.c b/amiga/icon.c
index 2745fcf..dfbf84c 100644
--- a/amiga/icon.c
+++ b/amiga/icon.c
@@ -376,43 +376,41 @@ void amiga_icon_superimpose_favicon_internal(struct hlcache_handle *icon, struct
TAG_DONE);
if(format != IDFMT_DIRECTMAPPED) return;
- {
- if ((icon != NULL) && (content_get_bitmap(icon) != NULL))
- {
- bm = ami_bitmap_get_native(content_get_bitmap(icon), 16, 16, NULL);
- }
+#ifdef __amigaos4__
+ if ((icon != NULL) && (content_get_bitmap(icon) != NULL)) {
+ bm = ami_bitmap_get_native(content_get_bitmap(icon), 16, 16, NULL);
+ }
- if(bm)
- {
- BltBitMapTags(BLITA_SrcX, 0,
- BLITA_SrcY, 0,
- BLITA_DestX, width - 16,
- BLITA_DestY, height - 16,
- BLITA_Width, 16,
- BLITA_Height, 16,
- BLITA_Source, bm,
- BLITA_Dest, icondata1,
- BLITA_SrcType, BLITT_BITMAP,
- BLITA_DestType, BLITT_ARGB32,
- BLITA_DestBytesPerRow, width * 4,
- BLITA_UseSrcAlpha, TRUE,
- TAG_DONE);
+ if(bm) {
+ BltBitMapTags(BLITA_SrcX, 0,
+ BLITA_SrcY, 0,
+ BLITA_DestX, width - 16,
+ BLITA_DestY, height - 16,
+ BLITA_Width, 16,
+ BLITA_Height, 16,
+ BLITA_Source, bm,
+ BLITA_Dest, icondata1,
+ BLITA_SrcType, BLITT_BITMAP,
+ BLITA_DestType, BLITT_ARGB32,
+ BLITA_DestBytesPerRow, width * 4,
+ BLITA_UseSrcAlpha, TRUE,
+ TAG_DONE);
- BltBitMapTags(BLITA_SrcX, 0,
- BLITA_SrcY, 0,
- BLITA_DestX, width - 16,
- BLITA_DestY, height - 16,
- BLITA_Width, 16,
- BLITA_Height, 16,
- BLITA_Source, bm,
- BLITA_Dest, icondata2,
- BLITA_SrcType, BLITT_BITMAP,
- BLITA_DestType, BLITT_ARGB32,
- BLITA_DestBytesPerRow, width * 4,
- BLITA_UseSrcAlpha, TRUE,
- TAG_DONE);
- }
+ BltBitMapTags(BLITA_SrcX, 0,
+ BLITA_SrcY, 0,
+ BLITA_DestX, width - 16,
+ BLITA_DestY, height - 16,
+ BLITA_Width, 16,
+ BLITA_Height, 16,
+ BLITA_Source, bm,
+ BLITA_Dest, icondata2,
+ BLITA_SrcType, BLITT_BITMAP,
+ BLITA_DestType, BLITT_ARGB32,
+ BLITA_DestBytesPerRow, width * 4,
+ BLITA_UseSrcAlpha, TRUE,
+ TAG_DONE);
}
+#endif
}
void amiga_icon_superimpose_favicon(char *path, struct hlcache_handle *icon, char *type)
@@ -496,7 +494,7 @@ struct DiskObject *amiga_icon_from_bitmap(struct bitmap *bm)
{
struct DiskObject *dobj;
struct BitMap *bitmap;
-
+#ifdef __amigaos4__
if(bm)
{
bitmap = ami_bitmap_get_native(bm, THUMBNAIL_WIDTH,
@@ -512,11 +510,11 @@ struct DiskObject *amiga_icon_from_bitmap(struct bitmap *bm)
BLITA_Dest, bm->icondata,
TAG_DONE);
}
-
+#endif
dobj = GetIconTags(NULL, ICONGETA_GetDefaultType, WBPROJECT,
ICONGETA_GetDefaultName, "iconify",
TAG_DONE);
-
+#ifdef __amigaos4__
if(bm)
{
IconControl(dobj,
@@ -527,7 +525,7 @@ struct DiskObject *amiga_icon_from_bitmap(struct bitmap *bm)
ICONCTRLA_SetImageData2, NULL,
TAG_DONE);
}
-
+#endif
dobj->do_Gadget.UserData = bm;
LayoutIconA(dobj, (struct Screen *)~0UL, NULL);
diff --git a/amiga/libs.c b/amiga/libs.c
index cab02d2..7810fad 100644
--- a/amiga/libs.c
+++ b/amiga/libs.c
@@ -16,6 +16,8 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
+#include "amiga/os3support.h"
+
#include "amiga/libs.h"
#include "amiga/misc.h"
#include "utils/utils.h"
@@ -24,6 +26,7 @@
#include <proto/exec.h>
#include <proto/utility.h>
+#ifdef __amigaos4__
#define AMINS_LIB_OPEN(LIB, LIBVER, PREFIX, INTERFACE, INTVER, FAIL) \
LOG(("Opening %s v%d", LIB, LIBVER)); \
if((PREFIX##Base = OpenLibrary(LIB, LIBVER))) { \
@@ -48,6 +51,26 @@
#define AMINS_LIB_STRUCT(PREFIX) \
struct Library *PREFIX##Base; \
struct PREFIX##IFace *I##PREFIX;
+#else
+#define AMINS_LIB_OPEN(LIB, LIBVER, PREFIX, INTERFACE, INTVER, FAIL) \
+ LOG(("Opening %s v%d", LIB, LIBVER)); \
+ if((PREFIX##Base = OpenLibrary(LIB, LIBVER))) { \
+ } else { \
+ LOG(("Failed to open %s v%d", LIB, LIBVER)); \
+ if(FAIL == true) { \
+ STRPTR error = ASPrintf("Unable to open %s v%d", LIB, LIBVER); \
+ ami_misc_fatal_error(error); \
+ FreeVec(error); \
+ return false; \
+ } \
+ }
+
+#define AMINS_LIB_CLOSE(PREFIX) \
+ if(PREFIX##Base) CloseLibrary(PREFIX##Base);
+
+#define AMINS_LIB_STRUCT(PREFIX) \
+ struct Library *PREFIX##Base;
+#endif
#define GraphicsBase GfxBase /* graphics.library is a bit weird */
@@ -93,12 +116,12 @@ bool ami_libs_open(void)
AMINS_LIB_OPEN("application.library", 53, Application, "application", 2, false)
AMINS_LIB_OPEN("asl.library", 37, Asl, "main", 1, true)
AMINS_LIB_OPEN("datatypes.library", 37, DataTypes, "main", 1, true)
- AMINS_LIB_OPEN("diskfont.library", 50, Diskfont, "main", 1, true)
+ AMINS_LIB_OPEN("diskfont.library", 40, Diskfont, "main", 1, true)
AMINS_LIB_OPEN("gadtools.library", 37, GadTools, "main", 1, true)
- AMINS_LIB_OPEN("graphics.library", 50, Graphics, "main", 1, true)
- AMINS_LIB_OPEN("icon.library", 50, Icon, "main", 1, true)
+ AMINS_LIB_OPEN("graphics.library", 40, Graphics, "main", 1, true)
+ AMINS_LIB_OPEN("icon.library", 44, Icon, "main", 1, true)
AMINS_LIB_OPEN("iffparse.library", 37, IFFParse, "main", 1, true)
- AMINS_LIB_OPEN("intuition.library", 37, Intuition, "main", 1, true)
+ AMINS_LIB_OPEN("intuition.library", 40, Intuition, "main", 1, true)
AMINS_LIB_OPEN("keymap.library", 37, Keymap, "main", 1, true)
AMINS_LIB_OPEN("layers.library", 37, Layers, "main", 1, true)
AMINS_LIB_OPEN("locale.library", 37, Locale, "main", 1, true)
@@ -121,26 +144,26 @@ bool ami_libs_open(void)
* we may as well just open them normally for now.
*/
- AMINS_LIB_OPEN("classes/arexx.class", 50, ARexx, "main", 1, true)
- AMINS_LIB_OPEN("images/bevel.image", 50, Bevel, "main", 1, true)
- AMINS_LIB_OPEN("images/bitmap.image", 50, BitMap, "main", 1, true)
- AMINS_LIB_OPEN("gadgets/checkbox.gadget", 50, CheckBox, "main", 1, true)
- AMINS_LIB_OPEN("gadgets/chooser.gadget", 50, Chooser, "main", 1, true)
- AMINS_LIB_OPEN("gadgets/clicktab.gadget", 50, ClickTab, "main", 1, true)
- AMINS_LIB_OPEN("gadgets/fuelgauge.gadget", 50, FuelGauge, "main", 1, true)
- AMINS_LIB_OPEN("gadgets/getfile.gadget", 50, GetFile, "main", 1, true)
- AMINS_LIB_OPEN("gadgets/getfont.gadget", 50, GetFont, "main", 1, true)
- AMINS_LIB_OPEN("gadgets/getscreenmode.gadget", 50, GetScreenMode, "main", 1, true)
- AMINS_LIB_OPEN("gadgets/integer.gadget", 50, Integer, "main", 1, true)
- AMINS_LIB_OPEN("images/label.image", 50, Label, "main", 1, true)
- AMINS_LIB_OPEN("gadgets/layout.gadget", 50, Layout, "main", 1, true)
- AMINS_LIB_OPEN("gadgets/listbrowser.gadget", 50, ListBrowser, "main", 1, true)
- AMINS_LIB_OPEN("gadgets/radiobutton.gadget", 50, RadioButton, "main", 1, true)
- AMINS_LIB_OPEN("gadgets/scroller.gadget", 50, Scroller, "main", 1, true)
- AMINS_LIB_OPEN("gadgets/space.gadget", 50, Space, "main", 1, true)
- AMINS_LIB_OPEN("gadgets/speedbar.gadget", 50, SpeedBar, "main", 1, true)
- AMINS_LIB_OPEN("gadgets/string.gadget", 50, String, "main", 1, true)
- AMINS_LIB_OPEN("classes/window.class", 50, Window, "main", 1, true)
+ AMINS_LIB_OPEN("classes/arexx.class", 44, ARexx, "main", 1, true)
+ AMINS_LIB_OPEN("images/bevel.image", 44, Bevel, "main", 1, true)
+ AMINS_LIB_OPEN("images/bitmap.image", 44, BitMap, "main", 1, true)
+ AMINS_LIB_OPEN("gadgets/checkbox.gadget", 44, CheckBox, "main", 1, true)
+ AMINS_LIB_OPEN("gadgets/chooser.gadget", 44, Chooser, "main", 1, true)
+ AMINS_LIB_OPEN("gadgets/clicktab.gadget", 44, ClickTab, "main", 1, true)
+ AMINS_LIB_OPEN("gadgets/fuelgauge.gadget", 44, FuelGauge, "main", 1, true)
+ AMINS_LIB_OPEN("gadgets/getfile.gadget", 44, GetFile, "main", 1, true)
+ AMINS_LIB_OPEN("gadgets/getfont.gadget", 44, GetFont, "main", 1, true)
+ AMINS_LIB_OPEN("gadgets/getscreenmode.gadget", 44, GetScreenMode, "main", 1, true)
+ AMINS_LIB_OPEN("gadgets/integer.gadget", 44, Integer, "main", 1, true)
+ AMINS_LIB_OPEN("images/label.image", 44, Label, "main", 1, true)
+ AMINS_LIB_OPEN("gadgets/layout.gadget", 44, Layout, "main", 1, true)
+ AMINS_LIB_OPEN("gadgets/listbrowser.gadget", 44, ListBrowser, "main", 1, true)
+ AMINS_LIB_OPEN("gadgets/radiobutton.gadget", 44, RadioButton, "main", 1, true)
+ AMINS_LIB_OPEN("gadgets/scroller.gadget", 44, Scroller, "main", 1, true)
+ AMINS_LIB_OPEN("gadgets/space.gadget", 44, Space, "main", 1, true)
+ AMINS_LIB_OPEN("gadgets/speedbar.gadget", 44, SpeedBar, "main", 1, true)
+ AMINS_LIB_OPEN("gadgets/string.gadget", 44, String, "main", 1, true)
+ AMINS_LIB_OPEN("classes/window.class", 44, Window, "main", 1, true)
return true;
}
diff --git a/amiga/login.c b/amiga/login.c
index e9e221b..fe476ac 100755
--- a/amiga/login.c
+++ b/amiga/login.c
@@ -61,8 +61,7 @@ void gui_401login_open(nsurl *url, const char *realm,
nserror (*cb)(bool proceed, void *pw), void *cbpw)
{
const char *auth;
- struct gui_login_window *lw = AllocVecTags(sizeof(struct gui_login_window),
- AVT_ClearWithValue, 0, TAG_DONE);
+ struct gui_login_window *lw = ami_misc_allocvec_clear(sizeof(struct gui_login_window), 0);
lwc_string *host = nsurl_get_component(url, NSURL_HOST);
assert(host != NULL);
diff --git a/amiga/menu.c b/amiga/menu.c
index 3eb8a98..e5d35a9 100644
--- a/amiga/menu.c
+++ b/amiga/menu.c
@@ -16,6 +16,8 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
+#include "amiga/os3support.h"
+
#include <string.h>
#include <proto/dos.h>
@@ -196,7 +198,7 @@ static void ami_init_menulabs(struct gui_window_2 *gwin)
{
int i;
- gwin->menutype = AllocVecTags(AMI_MENU_AREXX_MAX + 1, AVT_ClearWithValue, 0, TAG_DONE);
+ gwin->menutype = ami_misc_allocvec_clear(AMI_MENU_AREXX_MAX + 1, 0);
for(i=0;i <= AMI_MENU_AREXX_MAX;i++)
{
@@ -333,6 +335,7 @@ void ami_menu_refresh(struct gui_window_2 *gwin)
static void ami_menu_load_glyphs(struct DrawInfo *dri)
{
+#ifdef __amigaos4__
for(int i = 0; i < NSA_GLYPH_MAX; i++)
menu_glyph[i] = NULL;
@@ -350,10 +353,12 @@ static void ami_menu_load_glyphs(struct DrawInfo *dri)
(ULONG *)&menu_glyph_width[NSA_GLYPH_AMIGAKEY]);
menu_glyphs_loaded = true;
+#endif
}
void ami_menu_free_glyphs(void)
{
+#ifdef __amigaos4__
int i;
if(menu_glyphs_loaded == false) return;
@@ -363,6 +368,7 @@ void ami_menu_free_glyphs(void)
};
menu_glyphs_loaded = false;
+#endif
}
static int ami_menu_calc_item_width(struct gui_window_2 *gwin, int j, struct RastPort *rp)
@@ -413,7 +419,7 @@ static struct gui_window_2 *ami_menu_layout(struct gui_window_2 *gwin)
j++;
} while((gwin->menutype[j] != NM_TITLE) && (gwin->menutype[j] != 0));
}
-
+#ifdef __amigaos4__
if(LIB_IS_AT_LEAST((struct Library *)GadToolsBase, 53, 6)) {
/* GadTools 53.6+ only. For now we will only create the menu
using label.image if there's a bitmap associated with the item. */
@@ -495,7 +501,7 @@ static struct gui_window_2 *ami_menu_layout(struct gui_window_2 *gwin)
if(gwin->menuobj[i]) gwin->menutype[i] |= MENU_IMAGE;
}
}
-
+#endif
gwin->menu[i].nm_Type = gwin->menutype[i];
if(gwin->menuobj[i])
@@ -520,8 +526,7 @@ static struct gui_window_2 *ami_menu_layout(struct gui_window_2 *gwin)
struct NewMenu *ami_create_menu(struct gui_window_2 *gwin)
{
- gwin->menu = AllocVecTags(sizeof(struct NewMenu) * (AMI_MENU_AREXX_MAX + 1),
- AVT_ClearWithValue, 0, TAG_DONE);
+ gwin->menu = ami_misc_allocvec_clear(sizeof(struct NewMenu) * (AMI_MENU_AREXX_MAX + 1), 0);
ami_init_menulabs(gwin);
ami_menu_scan(ami_tree_get_tree(hotlist_window), gwin);
ami_menu_arexx_scan(gwin);
@@ -835,7 +840,7 @@ static void ami_menu_item_project_about(struct Hook *hook, APTR window, struct I
temp2 = ami_utf8_easy(temp);
FreeVec(temp);
-
+#ifdef __amigaos4__
sel = TimedDosRequesterTags(TDR_ImageType,TDRIMAGE_INFO,
TDR_TitleString, messages_get("NetSurf"),
TDR_Window, gwin->win,
@@ -844,7 +849,12 @@ static void ami_menu_item_project_about(struct Hook *hook, APTR window, struct I
TDR_Arg1,netsurf_version,
TDR_Arg2,verdate,
TAG_DONE);
-
+#else
+ /*\todo proper requester for OS3
+ * at the moment menus are disabled so won't get here anyway */
+ printf("NetSurf %s\nBuild date %s\n", netsurf_version, verdate);
+ sel = 0;
+#endif
free(temp2);
if(sel == 2) {
diff --git a/amiga/misc.c b/amiga/misc.c
index 0cd3bae..73a87e7 100755
--- a/amiga/misc.c
+++ b/amiga/misc.c
@@ -52,7 +52,7 @@ static LONG ami_misc_req(const char *message, uint32 type)
LONG ret = 0;
LOG(("%s", message));
-
+#ifdef __amigaos4__
ret = TimedDosRequesterTags(
TDR_TitleString, messages_get("NetSurf"),
TDR_FormatString, message,
@@ -60,7 +60,9 @@ static LONG ami_misc_req(const char *message, uint32 type)
TDR_ImageType, type,
TDR_Window, cur_gw ? cur_gw->shared->win : NULL,
TAG_DONE);
-
+#else
+ printf("%s\n", message);
+#endif
return ret;
}
@@ -84,6 +86,7 @@ void warn_user(const char *warning, const char *detail)
int32 ami_warn_user_multi(const char *body, const char *opt1, const char *opt2, struct Window *win)
{
int res = 0;
+#ifdef __amigaos4__
char *utf8text = ami_utf8_easy(body);
char *utf8gadget1 = ami_utf8_easy(messages_get(opt1));
char *utf8gadget2 = ami_utf8_easy(messages_get(opt2));
@@ -100,7 +103,9 @@ int32 ami_warn_user_multi(const char *body, const char *opt1, const char *opt2,
if(utf8text) free(utf8text);
if(utf8gadgets) FreeVec(utf8gadgets);
-
+#else
+#warning write this for os3
+#endif
return res;
}
diff --git a/amiga/object.c b/amiga/object.c
index 0c848aa..99f359a 100755
--- a/amiga/object.c
+++ b/amiga/object.c
@@ -16,6 +16,8 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
+#include "amiga/os3support.h"
+
#include <stdlib.h>
#include <proto/exec.h>
@@ -24,6 +26,7 @@
#include "amiga/filetype.h"
#include "amiga/font.h"
+#include "amiga/misc.h"
#include "amiga/object.h"
struct MinList *NewObjList(void)
@@ -43,7 +46,7 @@ struct nsObject *AddObject(struct MinList *objlist, ULONG otype)
{
struct nsObject *dtzo;
- dtzo = (struct nsObject *)AllocVecTags(sizeof(struct nsObject), AVT_ClearWithValue, 0, TAG_DONE);
+ dtzo = (struct nsObject *)ami_misc_allocvec_clear(sizeof(struct nsObject), 0);
AddTail((struct List *)objlist,(struct Node *)dtzo);
diff --git a/amiga/os3support.c b/amiga/os3support.c
index cc567f6..dda3df3 100644
--- a/amiga/os3support.c
+++ b/amiga/os3support.c
@@ -23,6 +23,17 @@
#ifndef __amigaos4__
#include "os3support.h"
+#include <inttypes.h>
+#include <stdarg.h>
+#include <stdio.h>
+#include <proto/exec.h>
+#include <proto/intuition.h>
+#include <proto/dos.h>
+
+#define SUCCESS (TRUE)
+#define FAILURE (FALSE)
+#define NO !
+
/* DOS */
int64 GetFileSize(BPTR fh)
{
diff --git a/amiga/os3support.h b/amiga/os3support.h
index 5fb1134..93bb0ba 100644
--- a/amiga/os3support.h
+++ b/amiga/os3support.h
@@ -37,6 +37,14 @@
#include <exec/memory.h>
#endif
+#ifndef ASM
+#define ASM
+#endif
+
+#ifndef REG
+#define REG(reg,arg) arg __asm(#reg)
+#endif
+
/* Macros */
#define IsMinListEmpty(L) (L)->mlh_Head->mln_Succ == 0
@@ -93,6 +101,7 @@
#define IDCMP_EXTENDEDMOUSE 0
#define WINDOW_BACKMOST 0
#define DN_FULLPATH 0
+#define BGBACKFILL JAM1
/* Renamed structures */
#define AnchorPathOld AnchorPath
@@ -183,6 +192,12 @@ enum {
ASOT_PORT = 1
};
+/* Requester types */
+enum {
+ TDRIMAGE_ERROR = 1,
+ TDRIMAGE_WARNING
+};
+
/* Functions */
/* DOS */
int64 GetFileSize(BPTR fh);
diff --git a/amiga/plotters.c b/amiga/plotters.c
index 855d104..490d519 100755
--- a/amiga/plotters.c
+++ b/amiga/plotters.c
@@ -16,6 +16,8 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
+#include "amiga/os3support.h"
+
#include <proto/Picasso96API.h>
#include <proto/exec.h>
#include <proto/intuition.h>
@@ -46,7 +48,9 @@
#include "amiga/gui.h"
#include "amiga/utf8.h"
+#ifdef __amigaos4__
static void ami_bitmap_tile_hook(struct Hook *hook,struct RastPort *rp,struct BackFillMessage *bfmsg);
+#endif
struct bfbitmap {
struct BitMap *bm;
@@ -138,7 +142,6 @@ void ami_init_layers(struct gui_globals *gg, ULONG width, ULONG height)
InitRastPort(gg->rp);
gg->rp->BitMap = gg->bm;
- /* Is all this safe to do to an existing window RastPort? */
SetDrMd(gg->rp,BGBACKFILL);
gg->rp->Layer = CreateUpfrontLayer(gg->layerinfo,gg->rp->BitMap,0,0,
@@ -232,9 +235,11 @@ void ami_plot_release_pens(struct MinList *shared_pens)
static void ami_plot_setapen(ULONG colr)
{
if(palette_mapped == false) {
+#ifdef __amigaos4__
SetRPAttrs(glob->rp, RPTAG_APenColor,
ns_color_to_nscss(colr),
TAG_DONE);
+#endif
} else {
LONG pen = ami_plot_obtain_pen(glob->shared_pens, colr);
if(pen != -1) SetAPen(glob->rp, pen);
@@ -244,9 +249,11 @@ static void ami_plot_setapen(ULONG colr)
static void ami_plot_setopen(ULONG colr)
{
if(palette_mapped == false) {
+#ifdef __amigaos4__
SetRPAttrs(glob->rp, RPTAG_OPenColor,
ns_color_to_nscss(colr),
TAG_DONE);
+#endif
} else {
LONG pen = ami_plot_obtain_pen(glob->shared_pens, colr);
if(pen != -1) SetOPen(glob->rp, pen);
@@ -521,7 +528,7 @@ static bool ami_bitmap(int x, int y, int width, int height, struct bitmap *bitma
if((tag_data = (ULONG)ami_bitmap_get_mask(bitmap, width, height, tbm)))
minterm = (ABC|ABNC|ANBC);
}
-
+#ifdef __amigaos4__
BltBitMapTags(BLITA_Width,width,
BLITA_Height,height,
BLITA_Source,tbm,
@@ -533,6 +540,10 @@ static bool ami_bitmap(int x, int y, int width, int height, struct bitmap *bitma
BLITA_Minterm, minterm,
tag, tag_data,
TAG_DONE);
+#else
+ /* Assume mask is always required */
+ BltMaskBitMapRastPort(tbm, 0, 0, glob->rp, x, y, width, height, tag_data, minterm);
+#endif
}
if((bitmap->dto == NULL) && (tbm != bitmap->nativebm))
@@ -562,7 +573,7 @@ bool ami_bitmap_tile(int x, int y, int width, int height,
if(!(repeat_x || repeat_y))
return ami_bitmap(x, y, width, height, bitmap);
-
+#ifdef __amigaos4__
/* If it is a one pixel transparent image, we are wasting our time */
if((bitmap->opaque == false) && (bitmap->width == 1) && (bitmap->height == 1))
return true;
@@ -641,10 +652,13 @@ bool ami_bitmap_tile(int x, int y, int width, int height,
{
p96FreeBitMap(tbm);
}
-
+#else
+#warning FIXME: bitmap tiling uses backfill hooks
+#endif
return true;
}
+#ifdef __amigaos4__
static void ami_bitmap_tile_hook(struct Hook *hook,struct RastPort *rp,struct BackFillMessage *bfmsg)
{
int xf,yf;
@@ -700,6 +714,7 @@ static void ami_bitmap_tile_hook(struct Hook *hook,struct RastPort *rp,struct Ba
}
}
}
+#endif
bool ami_group_start(const char *name)
{
--
NetSurf Browser
8 years
netsurf: branch master updated. release/3.2-593-g0673ac5
by NetSurf Browser Project
Gitweb links:
...log http://git.netsurf-browser.org/netsurf.git/shortlog/0673ac5096f79bff53f4f...
...commit http://git.netsurf-browser.org/netsurf.git/commit/0673ac5096f79bff53f4f97...
...tree http://git.netsurf-browser.org/netsurf.git/tree/0673ac5096f79bff53f4f976b...
The branch, master has been updated
via 0673ac5096f79bff53f4f976be86275cef51d711 (commit)
via 69075f1c5744e77ac819d08821dffc90eb73b5d3 (commit)
via 6f9d96aedf44ac528d3b52ea89f6cd4e19286b8f (commit)
from 0c4f942c2da23c0456272dfe051d6ea564780499 (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=0673ac5096f79bff53f...
commit 0673ac5096f79bff53f4f976be86275cef51d711
Author: Chris Young <chris(a)unsatisfactorysoftware.co.uk>
Commit: Chris Young <chris(a)unsatisfactorysoftware.co.uk>
Fixup history_local.c for OS3
diff --git a/amiga/history_local.c b/amiga/history_local.c
index 2fb1ba6..c8c7b72 100755
--- a/amiga/history_local.c
+++ b/amiga/history_local.c
@@ -112,7 +112,7 @@ void ami_history_open(struct gui_window *gw)
if(!gw->hw)
{
- gw->hw = AllocVecTags(sizeof(struct history_window), AVT_ClearWithValue, 0, TAG_DONE);
+ gw->hw = ami_misc_allocvec_clear(sizeof(struct history_window), 0);
ami_init_layers(&gw->hw->gg, scrn->Width, scrn->Height);
commitdiff http://git.netsurf-browser.org/netsurf.git/commit/?id=69075f1c5744e77ac81...
commit 69075f1c5744e77ac819d08821dffc90eb73b5d3
Author: Chris Young <chris(a)unsatisfactorysoftware.co.uk>
Commit: Chris Young <chris(a)unsatisfactorysoftware.co.uk>
Fixup gui_options.c for OS3
diff --git a/amiga/gui_options.c b/amiga/gui_options.c
index d4a755e..2187c30 100755
--- a/amiga/gui_options.c
+++ b/amiga/gui_options.c
@@ -491,8 +491,9 @@ void ami_gui_opts_open(void)
scaledisabled = TRUE;
scaleselected = FALSE;
}
-
+#ifdef __amigaos4__
if(ApplicationBase->lib_Version < 53)
+#endif
{
download_notify_disabled = TRUE;
nsoption_set_bool(download_notify, FALSE);
@@ -526,7 +527,7 @@ void ami_gui_opts_open(void)
{
ami_gui_opts_setup();
- gow = AllocVecTags(sizeof(struct ami_gui_opts_window), AVT_ClearWithValue, 0, TAG_DONE);
+ gow = ami_misc_allocvec_clear(sizeof(struct ami_gui_opts_window), 0);
gow->objects[OID_MAIN] = WindowObject,
WA_ScreenTitle, ami_gui_get_screen_title(),
diff --git a/amiga/os3support.h b/amiga/os3support.h
index d0979e0..5fb1134 100644
--- a/amiga/os3support.h
+++ b/amiga/os3support.h
@@ -56,6 +56,8 @@
#define CLICKTAB_FlagImage TAG_IGNORE
#define CLICKTAB_LabelTruncate TAG_IGNORE
#define CLICKTAB_NodeClosed TAG_IGNORE
+#define GETFONT_OTagOnly TAG_IGNORE
+#define GETFONT_ScalableOnly TAG_IGNORE
#define PDTA_PromoteMask TAG_IGNORE
#define RPTAG_APenColor TAG_IGNORE
#define GA_HintInfo TAG_IGNORE
@@ -95,6 +97,11 @@
/* Renamed structures */
#define AnchorPathOld AnchorPath
+/* ReAction (ClassAct) macros */
+#define GetFileEnd End
+#define GetFontEnd End
+#define GetScreenModeEnd End
+
/* Easy compat macros */
/* application */
#define Notify(...) (void)0
commitdiff http://git.netsurf-browser.org/netsurf.git/commit/?id=6f9d96aedf44ac528d3...
commit 6f9d96aedf44ac528d3b52ea89f6cd4e19286b8f
Author: Chris Young <chris(a)unsatisfactorysoftware.co.uk>
Commit: Chris Young <chris(a)unsatisfactorysoftware.co.uk>
Fixup gui.c enough to make it compile for OS3
diff --git a/amiga/gui.c b/amiga/gui.c
index 9bea295..6190407 100644
--- a/amiga/gui.c
+++ b/amiga/gui.c
@@ -1676,7 +1676,7 @@ static void gui_window_set_icon(struct gui_window *g, hlcache_handle *icon)
warn_user("NoMemory", "");
return;
}
-
+#ifdef __amigaos4__
BltBitMapTags(BLITA_SrcX, 0,
BLITA_SrcY, 0,
BLITA_DestX, bbox->Left,
@@ -1690,7 +1690,11 @@ static void gui_window_set_icon(struct gui_window *g, hlcache_handle *icon)
BLITA_Minterm, minterm,
tag, tag_data,
TAG_DONE);
-
+#else
+ /*\todo we are assuming we are always masking here, which might not be true */
+ BltMaskBitMapRastPort(bm, 0, 0, g->shared->win->RPort,
+ bbox->Left, bbox->Top, 16, 16, tag_data, minterm);
+#endif
ami_gui_free_space_box(bbox);
}
}
@@ -4319,7 +4323,7 @@ static void ami_do_redraw_tiled(struct gui_window_2 *gwin, bool busy,
&clip, ctx))
{
ami_clearclipreg(&browserglob);
-
+#ifdef __amigaos4__
BltBitMapTags(BLITA_SrcType, BLITT_BITMAP,
BLITA_Source, browserglob.bm,
BLITA_SrcX, 0,
@@ -4331,6 +4335,12 @@ static void ami_do_redraw_tiled(struct gui_window_2 *gwin, bool busy,
BLITA_Width, (int)(clip.x1),
BLITA_Height, (int)(clip.y1),
TAG_DONE);
+#else
+ BltBitMapRastPort(browserglob.bm, 0, 0, gwin->win->RPort,
+ bbox->Left + (int)((x - sx) * gwin->gw->scale),
+ bbox->Top + (int)((y - sy) * gwin->gw->scale),
+ (int)(clip.x1), (int)(clip.y1), 0xC0);
+#endif
}
}
}
diff --git a/amiga/os3support.h b/amiga/os3support.h
index 805e1a1..d0979e0 100644
--- a/amiga/os3support.h
+++ b/amiga/os3support.h
@@ -48,7 +48,10 @@
#define MEMF_SHARED MEMF_ANY
/* Ignore unsupported tags */
+#define ASO_NoTrack TAG_IGNORE
#define BITMAP_DisabledSourceFile TAG_IGNORE
+#define BLITA_UseSrcAlpha TAG_IGNORE
+#define BLITA_MaskPlane TAG_IGNORE
#define CLICKTAB_CloseImage TAG_IGNORE
#define CLICKTAB_FlagImage TAG_IGNORE
#define CLICKTAB_LabelTruncate TAG_IGNORE
@@ -101,6 +104,7 @@
#define ObtainCharsetInfo(A,B,C) (const char *)"ISO-8859-1"
/* DOS */
+#define AllocSysObjectTags(A,B,C,D) CreateMsgPort() /* Assume ASOT_PORT for now */
#define FOpen(A,B,C) Open(A,B)
#define FClose(A) Close(A)
#define CreateDirTree(D) CreateDir(D) /*\todo This isn't quite right */
-----------------------------------------------------------------------
Summary of changes:
amiga/gui.c | 16 +++++++++++++---
amiga/gui_options.c | 5 +++--
amiga/history_local.c | 2 +-
amiga/os3support.h | 11 +++++++++++
4 files changed, 28 insertions(+), 6 deletions(-)
diff --git a/amiga/gui.c b/amiga/gui.c
index 9bea295..6190407 100644
--- a/amiga/gui.c
+++ b/amiga/gui.c
@@ -1676,7 +1676,7 @@ static void gui_window_set_icon(struct gui_window *g, hlcache_handle *icon)
warn_user("NoMemory", "");
return;
}
-
+#ifdef __amigaos4__
BltBitMapTags(BLITA_SrcX, 0,
BLITA_SrcY, 0,
BLITA_DestX, bbox->Left,
@@ -1690,7 +1690,11 @@ static void gui_window_set_icon(struct gui_window *g, hlcache_handle *icon)
BLITA_Minterm, minterm,
tag, tag_data,
TAG_DONE);
-
+#else
+ /*\todo we are assuming we are always masking here, which might not be true */
+ BltMaskBitMapRastPort(bm, 0, 0, g->shared->win->RPort,
+ bbox->Left, bbox->Top, 16, 16, tag_data, minterm);
+#endif
ami_gui_free_space_box(bbox);
}
}
@@ -4319,7 +4323,7 @@ static void ami_do_redraw_tiled(struct gui_window_2 *gwin, bool busy,
&clip, ctx))
{
ami_clearclipreg(&browserglob);
-
+#ifdef __amigaos4__
BltBitMapTags(BLITA_SrcType, BLITT_BITMAP,
BLITA_Source, browserglob.bm,
BLITA_SrcX, 0,
@@ -4331,6 +4335,12 @@ static void ami_do_redraw_tiled(struct gui_window_2 *gwin, bool busy,
BLITA_Width, (int)(clip.x1),
BLITA_Height, (int)(clip.y1),
TAG_DONE);
+#else
+ BltBitMapRastPort(browserglob.bm, 0, 0, gwin->win->RPort,
+ bbox->Left + (int)((x - sx) * gwin->gw->scale),
+ bbox->Top + (int)((y - sy) * gwin->gw->scale),
+ (int)(clip.x1), (int)(clip.y1), 0xC0);
+#endif
}
}
}
diff --git a/amiga/gui_options.c b/amiga/gui_options.c
index d4a755e..2187c30 100755
--- a/amiga/gui_options.c
+++ b/amiga/gui_options.c
@@ -491,8 +491,9 @@ void ami_gui_opts_open(void)
scaledisabled = TRUE;
scaleselected = FALSE;
}
-
+#ifdef __amigaos4__
if(ApplicationBase->lib_Version < 53)
+#endif
{
download_notify_disabled = TRUE;
nsoption_set_bool(download_notify, FALSE);
@@ -526,7 +527,7 @@ void ami_gui_opts_open(void)
{
ami_gui_opts_setup();
- gow = AllocVecTags(sizeof(struct ami_gui_opts_window), AVT_ClearWithValue, 0, TAG_DONE);
+ gow = ami_misc_allocvec_clear(sizeof(struct ami_gui_opts_window), 0);
gow->objects[OID_MAIN] = WindowObject,
WA_ScreenTitle, ami_gui_get_screen_title(),
diff --git a/amiga/history_local.c b/amiga/history_local.c
index 2fb1ba6..c8c7b72 100755
--- a/amiga/history_local.c
+++ b/amiga/history_local.c
@@ -112,7 +112,7 @@ void ami_history_open(struct gui_window *gw)
if(!gw->hw)
{
- gw->hw = AllocVecTags(sizeof(struct history_window), AVT_ClearWithValue, 0, TAG_DONE);
+ gw->hw = ami_misc_allocvec_clear(sizeof(struct history_window), 0);
ami_init_layers(&gw->hw->gg, scrn->Width, scrn->Height);
diff --git a/amiga/os3support.h b/amiga/os3support.h
index 805e1a1..5fb1134 100644
--- a/amiga/os3support.h
+++ b/amiga/os3support.h
@@ -48,11 +48,16 @@
#define MEMF_SHARED MEMF_ANY
/* Ignore unsupported tags */
+#define ASO_NoTrack TAG_IGNORE
#define BITMAP_DisabledSourceFile TAG_IGNORE
+#define BLITA_UseSrcAlpha TAG_IGNORE
+#define BLITA_MaskPlane TAG_IGNORE
#define CLICKTAB_CloseImage TAG_IGNORE
#define CLICKTAB_FlagImage TAG_IGNORE
#define CLICKTAB_LabelTruncate TAG_IGNORE
#define CLICKTAB_NodeClosed TAG_IGNORE
+#define GETFONT_OTagOnly TAG_IGNORE
+#define GETFONT_ScalableOnly TAG_IGNORE
#define PDTA_PromoteMask TAG_IGNORE
#define RPTAG_APenColor TAG_IGNORE
#define GA_HintInfo TAG_IGNORE
@@ -92,6 +97,11 @@
/* Renamed structures */
#define AnchorPathOld AnchorPath
+/* ReAction (ClassAct) macros */
+#define GetFileEnd End
+#define GetFontEnd End
+#define GetScreenModeEnd End
+
/* Easy compat macros */
/* application */
#define Notify(...) (void)0
@@ -101,6 +111,7 @@
#define ObtainCharsetInfo(A,B,C) (const char *)"ISO-8859-1"
/* DOS */
+#define AllocSysObjectTags(A,B,C,D) CreateMsgPort() /* Assume ASOT_PORT for now */
#define FOpen(A,B,C) Open(A,B)
#define FClose(A) Close(A)
#define CreateDirTree(D) CreateDir(D) /*\todo This isn't quite right */
--
NetSurf Browser
8 years
netsurf: branch master updated. release/3.2-590-g0c4f942
by NetSurf Browser Project
Gitweb links:
...log http://git.netsurf-browser.org/netsurf.git/shortlog/0c4f942c2da23c0456272...
...commit http://git.netsurf-browser.org/netsurf.git/commit/0c4f942c2da23c0456272df...
...tree http://git.netsurf-browser.org/netsurf.git/tree/0c4f942c2da23c0456272dfe0...
The branch, master has been updated
via 0c4f942c2da23c0456272dfe051d6ea564780499 (commit)
from bf14b2ddb1c535a97f1eded6b874e96f00f51d4f (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=0c4f942c2da23c04562...
commit 0c4f942c2da23c0456272dfe051d6ea564780499
Author: Chris Young <chris(a)unsatisfactorysoftware.co.uk>
Commit: Chris Young <chris(a)unsatisfactorysoftware.co.uk>
Attempt to fix some OS3 build errors in gui.c
diff --git a/amiga/gui.c b/amiga/gui.c
index b24ae1c..9bea295 100644
--- a/amiga/gui.c
+++ b/amiga/gui.c
@@ -35,24 +35,26 @@
#include <proto/keymap.h>
#include <proto/locale.h>
#include <proto/Picasso96API.h>
+#ifdef __amigaos4__
#include <proto/popupmenu.h>
+#endif
#include <proto/utility.h>
#include <proto/wb.h>
/* Other OS includes */
#include <datatypes/textclass.h>
#include <devices/inputevent.h>
+#include <graphics/rpattr.h>
#ifdef __amigaos4__
#include <graphics/blitattr.h>
+#include <intuition/gui.h>
#include <libraries/application.h>
#include <libraries/keymap.h>
#endif
-#include <libraries/gadtools.h>
#include <intuition/icclass.h>
-#include <graphics/rpattr.h>
-#include <workbench/workbench.h>
-#include <intuition/gui.h>
#include <intuition/screens.h>
+#include <libraries/gadtools.h>
+#include <workbench/workbench.h>
/* ReAction libraries */
#include <proto/bevel.h>
@@ -427,11 +429,15 @@ static bool ami_open_resources(void)
static UWORD ami_system_colour_scrollbar_fgpen(struct DrawInfo *drinfo)
{
LONG scrollerfillpen = FALSE;
-
+#ifdef __amigaos4__
GetGUIAttrs(NULL, drinfo, GUIA_PropKnobColor, &scrollerfillpen, TAG_DONE);
if(scrollerfillpen) return FILLPEN;
else return FOREGROUNDPEN;
+#else
+ return FILLPEN;
+#endif
+
}
/**
@@ -498,7 +504,7 @@ static void ami_set_screen_defaults(struct Screen *screen)
nsoption_default_set_int(redraw_tile_size_x, screen->Width);
nsoption_default_set_int(redraw_tile_size_y, screen->Height);
-
+#ifdef __amigaos4__
/* set system colours for amiga ui */
colour_option_from_pen(FILLPEN, NSOPTION_sys_colour_ActiveBorder, screen, 0x00000000);
colour_option_from_pen(FILLPEN, NSOPTION_sys_colour_ActiveCaption, screen, 0x00dddddd);
@@ -528,6 +534,7 @@ static void ami_set_screen_defaults(struct Screen *screen)
colour_option_from_pen(BACKGROUNDPEN, NSOPTION_sys_colour_Window, screen, 0x00aaaaaa);
colour_option_from_pen(INACTIVEFILLPEN, NSOPTION_sys_colour_WindowFrame, screen, 0x00000000);
colour_option_from_pen(TEXTPEN, NSOPTION_sys_colour_WindowText, screen, 0x00000000);
+#endif
}
@@ -971,7 +978,7 @@ static void gui_init2(int argc, char** argv)
ami_quit=true;
return;
}
-
+#ifdef __amigaos4__
if(IApplication)
{
if(argc == 0)
@@ -1008,7 +1015,7 @@ static void gui_init2(int argc, char** argv)
GetApplicationAttrs(ami_appid, APPATTR_Port, (ULONG)&applibport, TAG_DONE);
if(applibport) applibsig = (1L << applibport->mp_SigBit);
}
-
+#endif
if(!bw && (nsoption_bool(startup_no_window) == false)) {
error = nsurl_create(nsoption_charp(homepage_url), &url);
if (error == NSERROR_OK) {
@@ -1233,9 +1240,11 @@ int ami_key_to_nskey(ULONG keycode, struct InputEvent *ie)
static void ami_update_quals(struct gui_window_2 *gwin)
{
uint32 quals = 0;
-
+#ifdef __amigaos4__
GetAttr(WINDOW_Qualifier,gwin->objects[OID_MAIN],(uint32 *)&quals);
-
+#else
+#warning qualifier needs fixing for OS3
+#endif
gwin->key_state = 0;
if((quals & IEQUALIFIER_LSHIFT) || (quals & IEQUALIFIER_RSHIFT))
@@ -1258,9 +1267,11 @@ static void ami_update_quals(struct gui_window_2 *gwin)
nserror ami_gui_get_space_box(Object *obj, struct IBox **bbox)
{
if(LIB_IS_AT_LEAST((struct Library *)SpaceBase, 53, 6)) {
+#ifdef __amigaos4__
*bbox = AllocVecTagList(sizeof(struct IBox), NULL);
if(*bbox == NULL) return NSERROR_NOMEM;
GetAttr(SPACE_RenderBox, obj, (ULONG *)*bbox);
+#endif
} else {
GetAttr(SPACE_AreaBox, obj, (ULONG *)bbox);
}
@@ -1431,6 +1442,7 @@ static struct IBox *ami_ns_rect_to_ibox(struct gui_window_2 *gwin, const struct
static void ami_gui_trap_mouse(struct gui_window_2 *gwin)
{
+#ifdef __amigaos4__
switch(gwin->drag_op)
{
case GDRAGGING_NONE:
@@ -1446,6 +1458,7 @@ static void ami_gui_trap_mouse(struct gui_window_2 *gwin)
}
break;
}
+#endif
}
static void ami_gui_menu_update_all(void)
@@ -1511,23 +1524,26 @@ static bool ami_gui_hscroll_add(struct gui_window_2 *gwin)
SCROLLER_Orientation, SORIENT_HORIZ,
ICA_TARGET, ICTARGET_IDCMP,
ScrollerEnd;
-
+#ifdef __amigaos4__
IDoMethod(gwin->objects[GID_HSCROLLLAYOUT], LM_ADDCHILD,
gwin->win, gwin->objects[GID_HSCROLL], attrs);
-
+#else
+#warning FIXME for OS3 - logically we should just permanently enable
+#endif
return true;
}
/* Remove the horizontal scroller, if present */
static bool ami_gui_hscroll_remove(struct gui_window_2 *gwin)
{
+#ifdef __amigaos4__
if(gwin->objects[GID_HSCROLL] == NULL) return false;
IDoMethod(gwin->objects[GID_HSCROLLLAYOUT], LM_REMOVECHILD,
gwin->win, gwin->objects[GID_HSCROLL]);
gwin->objects[GID_HSCROLL] = NULL;
-
+#endif
return true;
}
@@ -1549,23 +1565,25 @@ static bool ami_gui_vscroll_add(struct gui_window_2 *gwin)
GA_RelVerify, TRUE,
ICA_TARGET, ICTARGET_IDCMP,
ScrollerEnd;
-
+#ifdef __amigaos4__
+#warning FIXME for OS3
IDoMethod(gwin->objects[GID_VSCROLLLAYOUT], LM_ADDCHILD,
gwin->win, gwin->objects[GID_VSCROLL], attrs);
-
+#endif
return true;
}
/* Remove the vertical scroller, if present */
static bool ami_gui_vscroll_remove(struct gui_window_2 *gwin)
{
+#ifdef __amigaos4__
if(gwin->objects[GID_VSCROLL] == NULL) return false;
IDoMethod(gwin->objects[GID_VSCROLLLAYOUT], LM_REMOVECHILD,
gwin->win, gwin->objects[GID_VSCROLL]);
gwin->objects[GID_VSCROLL] = NULL;
-
+#endif
return true;
}
@@ -1692,7 +1710,7 @@ static void ami_gui_refresh_favicon(void *p)
static ULONG ami_get_border_gadget_size(struct gui_window_2 *gwin, ULONG *width, ULONG *height)
{
ULONG available_width;
-
+#ifdef __amigaos4__
if((sz_gad_width == 0) || (sz_gad_height == 0)) {
struct DrawInfo *dri = GetScreenDrawInfo(scrn);
GetGUIAttrs(NULL, dri,
@@ -1701,7 +1719,7 @@ static ULONG ami_get_border_gadget_size(struct gui_window_2 *gwin, ULONG *width,
TAG_DONE);
FreeScreenDrawInfo(scrn, dri);
}
-
+#endif
available_width = gwin->win->Width - scrn->WBorLeft - sz_gad_width;
*width = available_width;
@@ -2025,7 +2043,7 @@ static void ami_handle_msg(void)
gwin->prev_mouse_state = gwin->mouse_state;
gwin->mouse_state=0;
break;
-
+#ifdef __amigaos4__
case SIDEUP:
ami_gui_history(gwin, true);
break;
@@ -2033,6 +2051,7 @@ static void ami_handle_msg(void)
case EXTRAUP:
ami_gui_history(gwin, false);
break;
+#endif
}
if(drag_save_data && !gwin->mouse_state)
@@ -2413,7 +2432,7 @@ static void ami_handle_msg(void)
case WMHI_CLOSEWINDOW:
ami_close_all_tabs(gwin);
break;
-
+#ifdef __amigaos4__
case WMHI_ICONIFY:
{
struct bitmap *bm;
@@ -2431,7 +2450,7 @@ static void ami_handle_msg(void)
cur_gw = NULL;
}
break;
-
+#endif
case WMHI_INACTIVE:
gwin->gw->c_h_temp = gwin->gw->c_h;
gui_window_remove_caret(gwin->gw);
@@ -2618,6 +2637,7 @@ static void ami_handle_appmsg(void)
static void ami_handle_applib(void)
{
+#ifdef __amigaos4__
struct ApplicationMsg *applibmsg;
struct browser_window *bw;
nsurl *url;
@@ -2697,6 +2717,7 @@ static void ami_handle_applib(void)
}
ReplyMsg((struct Message *)applibmsg);
}
+#endif
}
void ami_get_msg(void)
@@ -2974,10 +2995,10 @@ static void gui_quit(void)
ami_hotlist_free(nsoption_charp(hotlist_file));
ami_cookies_free();
ami_global_history_free();
-
+#ifdef __amigaos4__
if(IApplication && ami_appid)
UnregisterApplication(ami_appid, NULL);
-
+#endif
ami_arexx_cleanup();
ami_free_layers(&browserglob);
@@ -3108,6 +3129,7 @@ static int ami_gui_hotlist_scan(struct tree *tree, struct List *speed_button_lis
static void ami_gui_hotlist_toolbar_add(struct gui_window_2 *gwin)
{
+#ifdef __amigaos4__
struct TagItem attrs[2];
attrs[0].ti_Tag = CHILD_MinWidth;
@@ -3145,6 +3167,9 @@ static void ami_gui_hotlist_toolbar_add(struct gui_window_2 *gwin)
ami_schedule_redraw(gwin, true);
}
+#else
+#warning FIXME for OS3
+#endif
}
static void ami_gui_hotlist_toolbar_free(struct gui_window_2 *gwin, struct List *speed_button_list)
@@ -3174,6 +3199,7 @@ static void ami_gui_hotlist_toolbar_free(struct gui_window_2 *gwin, struct List
static void ami_gui_hotlist_toolbar_remove(struct gui_window_2 *gwin)
{
+#ifdef __amigaos4__
IDoMethod(gwin->objects[GID_HOTLISTLAYOUT], LM_REMOVECHILD,
gwin->win, gwin->objects[GID_HOTLIST]);
@@ -3186,6 +3212,7 @@ static void ami_gui_hotlist_toolbar_remove(struct gui_window_2 *gwin)
gwin->win, NULL, TRUE);
ami_schedule_redraw(gwin, true);
+#endif
}
static void ami_gui_hotlist_toolbar_update(struct gui_window_2 *gwin)
@@ -3242,6 +3269,7 @@ static void ami_toggletabbar(struct gui_window_2 *gwin, bool show)
{
if(ClickTabBase->lib_Version < 53) return;
+#ifdef __amigaos4__
if(show)
{
struct TagItem attrs[3];
@@ -3295,6 +3323,7 @@ static void ami_toggletabbar(struct gui_window_2 *gwin, bool show)
gwin->win, NULL, TRUE);
if(gwin->gw && gwin->gw->bw) browser_window_update(gwin->gw->bw, false);
+#endif
}
void ami_gui_tabs_toggle_all(void)
@@ -3438,7 +3467,7 @@ gui_window_create(struct browser_window *bw,
if(curh > (scrn->Height - cury)) curh = scrn->Height - cury;
- g = AllocVecTags(sizeof(struct gui_window), AVT_ClearWithValue, 0, TAG_DONE);
+ g = ami_misc_allocvec_clear(sizeof(struct gui_window), 0);
if(!g)
{
@@ -3510,7 +3539,7 @@ gui_window_create(struct browser_window *bw,
return g;
}
- g->shared = AllocVecTags(sizeof(struct gui_window_2), AVT_ClearWithValue, 0, TAG_DONE);
+ g->shared = ami_misc_allocvec_clear(sizeof(struct gui_window_2), 0);
if(!g->shared)
{
@@ -3563,7 +3592,7 @@ gui_window_create(struct browser_window *bw,
g->shared->tabs=1;
g->shared->next_tab=1;
- g->shared->svbuffer = AllocVecTags(2000, AVT_ClearWithValue, 0, TAG_DONE);
+ g->shared->svbuffer = ami_misc_allocvec_clear(2000, 0);
g->shared->helphints[GID_BACK] =
translate_escape_chars(messages_get("HelpToolbarBack"));
@@ -4963,6 +4992,7 @@ static void gui_window_new_content(struct gui_window *g)
static bool gui_window_drag_start(struct gui_window *g, gui_drag_type type,
const struct rect *rect)
{
+#ifdef __amigaos4__
g->shared->drag_op = type;
if(rect) g->shared->ptr_lock = ami_ns_rect_to_ibox(g->shared, rect);
@@ -4977,7 +5007,7 @@ static bool gui_window_drag_start(struct gui_window *g, gui_drag_type type,
g->shared->ptr_lock = NULL;
}
}
-
+#endif
return true;
}
@@ -5028,7 +5058,7 @@ void ami_scroller_hook(struct Hook *hook,Object *object,struct IntuiMessage *msg
break;
}
break;
-
+#ifdef __amigaos4__
case IDCMP_EXTENDEDMOUSE:
if(msg->Code == IMSGCODE_INTUIWHEELDATA)
{
@@ -5037,7 +5067,7 @@ void ami_scroller_hook(struct Hook *hook,Object *object,struct IntuiMessage *msg
ami_gui_scroll_internal(gwin, wheel->WheelX * 50, wheel->WheelY * 50);
}
break;
-
+#endif
case IDCMP_SIZEVERIFY:
break;
@@ -5287,8 +5317,9 @@ int main(int argc, char** argv)
.llcache = amiga_filesystem_llcache_table,
};
+#ifdef __amigaos4__
signal(SIGINT, SIG_IGN);
-
+#endif
ret = netsurf_register(&amiga_table);
if (ret != NSERROR_OK) {
ami_misc_fatal_error("NetSurf operation table failed registration");
@@ -5313,6 +5344,7 @@ int main(int argc, char** argv)
* forcibly disable context menus if these are in use.
*/
popupmenu_lib_ok = FALSE;
+#ifdef __amigaos4__
if((PopupMenuBase = OpenLibrary("popupmenu.library", 53))) {
LOG(("popupmenu.library v%d.%d",
PopupMenuBase->lib_Version, PopupMenuBase->lib_Revision));
@@ -5320,7 +5352,7 @@ int main(int argc, char** argv)
popupmenu_lib_ok = TRUE;
CloseLibrary(PopupMenuBase);
}
-
+#endif
if (ami_open_resources() == false) { /* alloc message ports */
ami_misc_fatal_error("Unable to allocate resources");
return RETURN_FAIL;
diff --git a/amiga/os3support.c b/amiga/os3support.c
index 613701c..cc567f6 100644
--- a/amiga/os3support.c
+++ b/amiga/os3support.c
@@ -37,6 +37,16 @@ int64 GetFileSize(BPTR fh)
return (int64)size;
}
+void FreeSysObject(ULONG type, APTR obj)
+{
+ switch(type) {
+ case ASOT_PORT:
+ DeleteMsgPort(obj);
+ break;
+ }
+}
+
+
/* Exec */
struct Node *GetHead(struct List *list)
{
@@ -49,6 +59,23 @@ struct Node *GetHead(struct List *list)
return res;
}
+/* Intuition */
+uint32 GetAttrs(Object *obj, Tag tag1, ...)
+{
+ va_list ap;
+ Tag tag = tag1;
+ ULONG data = 0;
+
+ va_start(ap, tag1);
+
+ while(tag != TAG_DONE) {
+ data = va_arg(ap, ULONG);
+ GetAttr(tag, obj, (void *)data);
+ tag = va_arg(ap, Tag);
+ }
+ va_end(ap);
+}
+
/* Utility */
struct FormatContext
{
diff --git a/amiga/os3support.h b/amiga/os3support.h
index 4de39d8..805e1a1 100644
--- a/amiga/os3support.h
+++ b/amiga/os3support.h
@@ -1,5 +1,6 @@
/*
* Copyright 2010 John-Mark Bell <jmb(a)netsurf-browser.org>
+ * Copyright 2014 Chris Young <chris(a)unsatisfactorsysoftware.co.uk>
*
* This file is part of NetSurf, http://www.netsurf-browser.org/
*
@@ -39,12 +40,54 @@
/* Macros */
#define IsMinListEmpty(L) (L)->mlh_Head->mln_Succ == 0
+#define LIB_IS_AT_LEAST(B,V,R) ((B)->lib_Version>(V)) || \
+ ((B)->lib_Version==(V) && (B)->lib_Revision>=(R))
+
/* Define extra memory type flags */
#define MEMF_PRIVATE MEMF_ANY
#define MEMF_SHARED MEMF_ANY
-/* Ignore tags that aren't supported */
+/* Ignore unsupported tags */
+#define BITMAP_DisabledSourceFile TAG_IGNORE
+#define CLICKTAB_CloseImage TAG_IGNORE
+#define CLICKTAB_FlagImage TAG_IGNORE
+#define CLICKTAB_LabelTruncate TAG_IGNORE
+#define CLICKTAB_NodeClosed TAG_IGNORE
#define PDTA_PromoteMask TAG_IGNORE
+#define RPTAG_APenColor TAG_IGNORE
+#define GA_HintInfo TAG_IGNORE
+#define GAUGEIA_Level TAG_IGNORE
+#define IA_InBorder TAG_IGNORE
+#define IA_Label TAG_IGNORE
+#define SA_Compositing TAG_IGNORE
+#define SBNA_Text TAG_IGNORE
+#define TNA_CloseGadget TAG_IGNORE
+#define TNA_HintInfo TAG_IGNORE
+#define WA_ToolBox TAG_IGNORE
+#define WINDOW_BuiltInScroll TAG_IGNORE
+#define WINDOW_NewMenu TAG_IGNORE
+#define WINDOW_NewPrefsHook TAG_IGNORE
+
+/* raw keycodes */
+#define RAWKEY_BACKSPACE 0x41
+#define RAWKEY_TAB 0x42
+#define RAWKEY_ESC 0x45
+#define RAWKEY_DEL 0x46
+#define RAWKEY_PAGEUP 0x48
+#define RAWKEY_PAGEDOWN 0x49
+#define RAWKEY_CRSRUP 0x4C
+#define RAWKEY_CRSRDOWN 0x4D
+#define RAWKEY_CRSRRIGHT 0x4E
+#define RAWKEY_CRSRLEFT 0x4F
+#define RAWKEY_F5 0x54
+#define RAWKEY_HELP 0x5F
+#define RAWKEY_HOME 0x70
+#define RAWKEY_END 0x71
+
+/* Other constants */
+#define IDCMP_EXTENDEDMOUSE 0
+#define WINDOW_BACKMOST 0
+#define DN_FULLPATH 0
/* Renamed structures */
#define AnchorPathOld AnchorPath
@@ -53,11 +96,6 @@
/* application */
#define Notify(...) (void)0
-/* Exec */
-/* AllocVecTagList with no tags */
-#define AllocVecTagList(SZ,TAG) AllocVec(SZ,MEMF_ANY)
-#define GetSucc(N) (N)->ln_Succ
-
/* diskfont */
/* Only used in one place we haven't ifdeffed, where it returns the charset name */
#define ObtainCharsetInfo(A,B,C) (const char *)"ISO-8859-1"
@@ -65,12 +103,24 @@
/* DOS */
#define FOpen(A,B,C) Open(A,B)
#define FClose(A) Close(A)
+#define CreateDirTree(D) CreateDir(D) /*\todo This isn't quite right */
+#define DevNameFromLock(A,B,C,D) NameFromLock(A,B,C)
+
+/* Exec */
+#define AllocVecTagList(SZ,TAG) AllocVec(SZ,MEMF_ANY) /* AllocVecTagList with no tags */
+#define GetPred(N) (N)->ln_Pred
+#define GetSucc(N) (N)->ln_Succ
+
+/* Gfx */
+#define SetRPAttrs(...) (void)0 /*\todo Probably need to emulate this */
/* Intuition */
#define IDoMethod DoMethod
#define IDoMethodA DoMethodA
#define IDoSuperMethodA DoSuperMethodA
#define RefreshSetGadgetAttrs SetGadgetAttrs /*\todo This isn't quite right */
+#define ShowWindow(...) (void)0
+
/* Utility */
#define SetMem memset
@@ -117,13 +167,22 @@ struct TimeVal {
#define IDFMT_PALETTEMAPPED (1) /* Palette mapped icon (chunky, V44+) */
#define IDFMT_DIRECTMAPPED (2) /* Direct mapped icon (truecolor 0xAARRGGBB, V51+) */
+/* Object types */
+enum {
+ ASOT_PORT = 1
+};
+
/* Functions */
/* DOS */
int64 GetFileSize(BPTR fh);
+void FreeSysObject(ULONG type, APTR obj);
/* Exec */
struct Node *GetHead(struct List *list);
+/* Intuition */
+uint32 GetAttrs(Object *obj, Tag tag1, ...);
+
/* Utility */
char *ASPrintf(const char *fmt, ...);
-----------------------------------------------------------------------
Summary of changes:
amiga/gui.c | 94 +++++++++++++++++++++++++++++++++++-----------------
amiga/os3support.c | 27 +++++++++++++++
amiga/os3support.h | 71 +++++++++++++++++++++++++++++++++++----
3 files changed, 155 insertions(+), 37 deletions(-)
diff --git a/amiga/gui.c b/amiga/gui.c
index b24ae1c..9bea295 100644
--- a/amiga/gui.c
+++ b/amiga/gui.c
@@ -35,24 +35,26 @@
#include <proto/keymap.h>
#include <proto/locale.h>
#include <proto/Picasso96API.h>
+#ifdef __amigaos4__
#include <proto/popupmenu.h>
+#endif
#include <proto/utility.h>
#include <proto/wb.h>
/* Other OS includes */
#include <datatypes/textclass.h>
#include <devices/inputevent.h>
+#include <graphics/rpattr.h>
#ifdef __amigaos4__
#include <graphics/blitattr.h>
+#include <intuition/gui.h>
#include <libraries/application.h>
#include <libraries/keymap.h>
#endif
-#include <libraries/gadtools.h>
#include <intuition/icclass.h>
-#include <graphics/rpattr.h>
-#include <workbench/workbench.h>
-#include <intuition/gui.h>
#include <intuition/screens.h>
+#include <libraries/gadtools.h>
+#include <workbench/workbench.h>
/* ReAction libraries */
#include <proto/bevel.h>
@@ -427,11 +429,15 @@ static bool ami_open_resources(void)
static UWORD ami_system_colour_scrollbar_fgpen(struct DrawInfo *drinfo)
{
LONG scrollerfillpen = FALSE;
-
+#ifdef __amigaos4__
GetGUIAttrs(NULL, drinfo, GUIA_PropKnobColor, &scrollerfillpen, TAG_DONE);
if(scrollerfillpen) return FILLPEN;
else return FOREGROUNDPEN;
+#else
+ return FILLPEN;
+#endif
+
}
/**
@@ -498,7 +504,7 @@ static void ami_set_screen_defaults(struct Screen *screen)
nsoption_default_set_int(redraw_tile_size_x, screen->Width);
nsoption_default_set_int(redraw_tile_size_y, screen->Height);
-
+#ifdef __amigaos4__
/* set system colours for amiga ui */
colour_option_from_pen(FILLPEN, NSOPTION_sys_colour_ActiveBorder, screen, 0x00000000);
colour_option_from_pen(FILLPEN, NSOPTION_sys_colour_ActiveCaption, screen, 0x00dddddd);
@@ -528,6 +534,7 @@ static void ami_set_screen_defaults(struct Screen *screen)
colour_option_from_pen(BACKGROUNDPEN, NSOPTION_sys_colour_Window, screen, 0x00aaaaaa);
colour_option_from_pen(INACTIVEFILLPEN, NSOPTION_sys_colour_WindowFrame, screen, 0x00000000);
colour_option_from_pen(TEXTPEN, NSOPTION_sys_colour_WindowText, screen, 0x00000000);
+#endif
}
@@ -971,7 +978,7 @@ static void gui_init2(int argc, char** argv)
ami_quit=true;
return;
}
-
+#ifdef __amigaos4__
if(IApplication)
{
if(argc == 0)
@@ -1008,7 +1015,7 @@ static void gui_init2(int argc, char** argv)
GetApplicationAttrs(ami_appid, APPATTR_Port, (ULONG)&applibport, TAG_DONE);
if(applibport) applibsig = (1L << applibport->mp_SigBit);
}
-
+#endif
if(!bw && (nsoption_bool(startup_no_window) == false)) {
error = nsurl_create(nsoption_charp(homepage_url), &url);
if (error == NSERROR_OK) {
@@ -1233,9 +1240,11 @@ int ami_key_to_nskey(ULONG keycode, struct InputEvent *ie)
static void ami_update_quals(struct gui_window_2 *gwin)
{
uint32 quals = 0;
-
+#ifdef __amigaos4__
GetAttr(WINDOW_Qualifier,gwin->objects[OID_MAIN],(uint32 *)&quals);
-
+#else
+#warning qualifier needs fixing for OS3
+#endif
gwin->key_state = 0;
if((quals & IEQUALIFIER_LSHIFT) || (quals & IEQUALIFIER_RSHIFT))
@@ -1258,9 +1267,11 @@ static void ami_update_quals(struct gui_window_2 *gwin)
nserror ami_gui_get_space_box(Object *obj, struct IBox **bbox)
{
if(LIB_IS_AT_LEAST((struct Library *)SpaceBase, 53, 6)) {
+#ifdef __amigaos4__
*bbox = AllocVecTagList(sizeof(struct IBox), NULL);
if(*bbox == NULL) return NSERROR_NOMEM;
GetAttr(SPACE_RenderBox, obj, (ULONG *)*bbox);
+#endif
} else {
GetAttr(SPACE_AreaBox, obj, (ULONG *)bbox);
}
@@ -1431,6 +1442,7 @@ static struct IBox *ami_ns_rect_to_ibox(struct gui_window_2 *gwin, const struct
static void ami_gui_trap_mouse(struct gui_window_2 *gwin)
{
+#ifdef __amigaos4__
switch(gwin->drag_op)
{
case GDRAGGING_NONE:
@@ -1446,6 +1458,7 @@ static void ami_gui_trap_mouse(struct gui_window_2 *gwin)
}
break;
}
+#endif
}
static void ami_gui_menu_update_all(void)
@@ -1511,23 +1524,26 @@ static bool ami_gui_hscroll_add(struct gui_window_2 *gwin)
SCROLLER_Orientation, SORIENT_HORIZ,
ICA_TARGET, ICTARGET_IDCMP,
ScrollerEnd;
-
+#ifdef __amigaos4__
IDoMethod(gwin->objects[GID_HSCROLLLAYOUT], LM_ADDCHILD,
gwin->win, gwin->objects[GID_HSCROLL], attrs);
-
+#else
+#warning FIXME for OS3 - logically we should just permanently enable
+#endif
return true;
}
/* Remove the horizontal scroller, if present */
static bool ami_gui_hscroll_remove(struct gui_window_2 *gwin)
{
+#ifdef __amigaos4__
if(gwin->objects[GID_HSCROLL] == NULL) return false;
IDoMethod(gwin->objects[GID_HSCROLLLAYOUT], LM_REMOVECHILD,
gwin->win, gwin->objects[GID_HSCROLL]);
gwin->objects[GID_HSCROLL] = NULL;
-
+#endif
return true;
}
@@ -1549,23 +1565,25 @@ static bool ami_gui_vscroll_add(struct gui_window_2 *gwin)
GA_RelVerify, TRUE,
ICA_TARGET, ICTARGET_IDCMP,
ScrollerEnd;
-
+#ifdef __amigaos4__
+#warning FIXME for OS3
IDoMethod(gwin->objects[GID_VSCROLLLAYOUT], LM_ADDCHILD,
gwin->win, gwin->objects[GID_VSCROLL], attrs);
-
+#endif
return true;
}
/* Remove the vertical scroller, if present */
static bool ami_gui_vscroll_remove(struct gui_window_2 *gwin)
{
+#ifdef __amigaos4__
if(gwin->objects[GID_VSCROLL] == NULL) return false;
IDoMethod(gwin->objects[GID_VSCROLLLAYOUT], LM_REMOVECHILD,
gwin->win, gwin->objects[GID_VSCROLL]);
gwin->objects[GID_VSCROLL] = NULL;
-
+#endif
return true;
}
@@ -1692,7 +1710,7 @@ static void ami_gui_refresh_favicon(void *p)
static ULONG ami_get_border_gadget_size(struct gui_window_2 *gwin, ULONG *width, ULONG *height)
{
ULONG available_width;
-
+#ifdef __amigaos4__
if((sz_gad_width == 0) || (sz_gad_height == 0)) {
struct DrawInfo *dri = GetScreenDrawInfo(scrn);
GetGUIAttrs(NULL, dri,
@@ -1701,7 +1719,7 @@ static ULONG ami_get_border_gadget_size(struct gui_window_2 *gwin, ULONG *width,
TAG_DONE);
FreeScreenDrawInfo(scrn, dri);
}
-
+#endif
available_width = gwin->win->Width - scrn->WBorLeft - sz_gad_width;
*width = available_width;
@@ -2025,7 +2043,7 @@ static void ami_handle_msg(void)
gwin->prev_mouse_state = gwin->mouse_state;
gwin->mouse_state=0;
break;
-
+#ifdef __amigaos4__
case SIDEUP:
ami_gui_history(gwin, true);
break;
@@ -2033,6 +2051,7 @@ static void ami_handle_msg(void)
case EXTRAUP:
ami_gui_history(gwin, false);
break;
+#endif
}
if(drag_save_data && !gwin->mouse_state)
@@ -2413,7 +2432,7 @@ static void ami_handle_msg(void)
case WMHI_CLOSEWINDOW:
ami_close_all_tabs(gwin);
break;
-
+#ifdef __amigaos4__
case WMHI_ICONIFY:
{
struct bitmap *bm;
@@ -2431,7 +2450,7 @@ static void ami_handle_msg(void)
cur_gw = NULL;
}
break;
-
+#endif
case WMHI_INACTIVE:
gwin->gw->c_h_temp = gwin->gw->c_h;
gui_window_remove_caret(gwin->gw);
@@ -2618,6 +2637,7 @@ static void ami_handle_appmsg(void)
static void ami_handle_applib(void)
{
+#ifdef __amigaos4__
struct ApplicationMsg *applibmsg;
struct browser_window *bw;
nsurl *url;
@@ -2697,6 +2717,7 @@ static void ami_handle_applib(void)
}
ReplyMsg((struct Message *)applibmsg);
}
+#endif
}
void ami_get_msg(void)
@@ -2974,10 +2995,10 @@ static void gui_quit(void)
ami_hotlist_free(nsoption_charp(hotlist_file));
ami_cookies_free();
ami_global_history_free();
-
+#ifdef __amigaos4__
if(IApplication && ami_appid)
UnregisterApplication(ami_appid, NULL);
-
+#endif
ami_arexx_cleanup();
ami_free_layers(&browserglob);
@@ -3108,6 +3129,7 @@ static int ami_gui_hotlist_scan(struct tree *tree, struct List *speed_button_lis
static void ami_gui_hotlist_toolbar_add(struct gui_window_2 *gwin)
{
+#ifdef __amigaos4__
struct TagItem attrs[2];
attrs[0].ti_Tag = CHILD_MinWidth;
@@ -3145,6 +3167,9 @@ static void ami_gui_hotlist_toolbar_add(struct gui_window_2 *gwin)
ami_schedule_redraw(gwin, true);
}
+#else
+#warning FIXME for OS3
+#endif
}
static void ami_gui_hotlist_toolbar_free(struct gui_window_2 *gwin, struct List *speed_button_list)
@@ -3174,6 +3199,7 @@ static void ami_gui_hotlist_toolbar_free(struct gui_window_2 *gwin, struct List
static void ami_gui_hotlist_toolbar_remove(struct gui_window_2 *gwin)
{
+#ifdef __amigaos4__
IDoMethod(gwin->objects[GID_HOTLISTLAYOUT], LM_REMOVECHILD,
gwin->win, gwin->objects[GID_HOTLIST]);
@@ -3186,6 +3212,7 @@ static void ami_gui_hotlist_toolbar_remove(struct gui_window_2 *gwin)
gwin->win, NULL, TRUE);
ami_schedule_redraw(gwin, true);
+#endif
}
static void ami_gui_hotlist_toolbar_update(struct gui_window_2 *gwin)
@@ -3242,6 +3269,7 @@ static void ami_toggletabbar(struct gui_window_2 *gwin, bool show)
{
if(ClickTabBase->lib_Version < 53) return;
+#ifdef __amigaos4__
if(show)
{
struct TagItem attrs[3];
@@ -3295,6 +3323,7 @@ static void ami_toggletabbar(struct gui_window_2 *gwin, bool show)
gwin->win, NULL, TRUE);
if(gwin->gw && gwin->gw->bw) browser_window_update(gwin->gw->bw, false);
+#endif
}
void ami_gui_tabs_toggle_all(void)
@@ -3438,7 +3467,7 @@ gui_window_create(struct browser_window *bw,
if(curh > (scrn->Height - cury)) curh = scrn->Height - cury;
- g = AllocVecTags(sizeof(struct gui_window), AVT_ClearWithValue, 0, TAG_DONE);
+ g = ami_misc_allocvec_clear(sizeof(struct gui_window), 0);
if(!g)
{
@@ -3510,7 +3539,7 @@ gui_window_create(struct browser_window *bw,
return g;
}
- g->shared = AllocVecTags(sizeof(struct gui_window_2), AVT_ClearWithValue, 0, TAG_DONE);
+ g->shared = ami_misc_allocvec_clear(sizeof(struct gui_window_2), 0);
if(!g->shared)
{
@@ -3563,7 +3592,7 @@ gui_window_create(struct browser_window *bw,
g->shared->tabs=1;
g->shared->next_tab=1;
- g->shared->svbuffer = AllocVecTags(2000, AVT_ClearWithValue, 0, TAG_DONE);
+ g->shared->svbuffer = ami_misc_allocvec_clear(2000, 0);
g->shared->helphints[GID_BACK] =
translate_escape_chars(messages_get("HelpToolbarBack"));
@@ -4963,6 +4992,7 @@ static void gui_window_new_content(struct gui_window *g)
static bool gui_window_drag_start(struct gui_window *g, gui_drag_type type,
const struct rect *rect)
{
+#ifdef __amigaos4__
g->shared->drag_op = type;
if(rect) g->shared->ptr_lock = ami_ns_rect_to_ibox(g->shared, rect);
@@ -4977,7 +5007,7 @@ static bool gui_window_drag_start(struct gui_window *g, gui_drag_type type,
g->shared->ptr_lock = NULL;
}
}
-
+#endif
return true;
}
@@ -5028,7 +5058,7 @@ void ami_scroller_hook(struct Hook *hook,Object *object,struct IntuiMessage *msg
break;
}
break;
-
+#ifdef __amigaos4__
case IDCMP_EXTENDEDMOUSE:
if(msg->Code == IMSGCODE_INTUIWHEELDATA)
{
@@ -5037,7 +5067,7 @@ void ami_scroller_hook(struct Hook *hook,Object *object,struct IntuiMessage *msg
ami_gui_scroll_internal(gwin, wheel->WheelX * 50, wheel->WheelY * 50);
}
break;
-
+#endif
case IDCMP_SIZEVERIFY:
break;
@@ -5287,8 +5317,9 @@ int main(int argc, char** argv)
.llcache = amiga_filesystem_llcache_table,
};
+#ifdef __amigaos4__
signal(SIGINT, SIG_IGN);
-
+#endif
ret = netsurf_register(&amiga_table);
if (ret != NSERROR_OK) {
ami_misc_fatal_error("NetSurf operation table failed registration");
@@ -5313,6 +5344,7 @@ int main(int argc, char** argv)
* forcibly disable context menus if these are in use.
*/
popupmenu_lib_ok = FALSE;
+#ifdef __amigaos4__
if((PopupMenuBase = OpenLibrary("popupmenu.library", 53))) {
LOG(("popupmenu.library v%d.%d",
PopupMenuBase->lib_Version, PopupMenuBase->lib_Revision));
@@ -5320,7 +5352,7 @@ int main(int argc, char** argv)
popupmenu_lib_ok = TRUE;
CloseLibrary(PopupMenuBase);
}
-
+#endif
if (ami_open_resources() == false) { /* alloc message ports */
ami_misc_fatal_error("Unable to allocate resources");
return RETURN_FAIL;
diff --git a/amiga/os3support.c b/amiga/os3support.c
index 613701c..cc567f6 100644
--- a/amiga/os3support.c
+++ b/amiga/os3support.c
@@ -37,6 +37,16 @@ int64 GetFileSize(BPTR fh)
return (int64)size;
}
+void FreeSysObject(ULONG type, APTR obj)
+{
+ switch(type) {
+ case ASOT_PORT:
+ DeleteMsgPort(obj);
+ break;
+ }
+}
+
+
/* Exec */
struct Node *GetHead(struct List *list)
{
@@ -49,6 +59,23 @@ struct Node *GetHead(struct List *list)
return res;
}
+/* Intuition */
+uint32 GetAttrs(Object *obj, Tag tag1, ...)
+{
+ va_list ap;
+ Tag tag = tag1;
+ ULONG data = 0;
+
+ va_start(ap, tag1);
+
+ while(tag != TAG_DONE) {
+ data = va_arg(ap, ULONG);
+ GetAttr(tag, obj, (void *)data);
+ tag = va_arg(ap, Tag);
+ }
+ va_end(ap);
+}
+
/* Utility */
struct FormatContext
{
diff --git a/amiga/os3support.h b/amiga/os3support.h
index 4de39d8..805e1a1 100644
--- a/amiga/os3support.h
+++ b/amiga/os3support.h
@@ -1,5 +1,6 @@
/*
* Copyright 2010 John-Mark Bell <jmb(a)netsurf-browser.org>
+ * Copyright 2014 Chris Young <chris(a)unsatisfactorsysoftware.co.uk>
*
* This file is part of NetSurf, http://www.netsurf-browser.org/
*
@@ -39,12 +40,54 @@
/* Macros */
#define IsMinListEmpty(L) (L)->mlh_Head->mln_Succ == 0
+#define LIB_IS_AT_LEAST(B,V,R) ((B)->lib_Version>(V)) || \
+ ((B)->lib_Version==(V) && (B)->lib_Revision>=(R))
+
/* Define extra memory type flags */
#define MEMF_PRIVATE MEMF_ANY
#define MEMF_SHARED MEMF_ANY
-/* Ignore tags that aren't supported */
+/* Ignore unsupported tags */
+#define BITMAP_DisabledSourceFile TAG_IGNORE
+#define CLICKTAB_CloseImage TAG_IGNORE
+#define CLICKTAB_FlagImage TAG_IGNORE
+#define CLICKTAB_LabelTruncate TAG_IGNORE
+#define CLICKTAB_NodeClosed TAG_IGNORE
#define PDTA_PromoteMask TAG_IGNORE
+#define RPTAG_APenColor TAG_IGNORE
+#define GA_HintInfo TAG_IGNORE
+#define GAUGEIA_Level TAG_IGNORE
+#define IA_InBorder TAG_IGNORE
+#define IA_Label TAG_IGNORE
+#define SA_Compositing TAG_IGNORE
+#define SBNA_Text TAG_IGNORE
+#define TNA_CloseGadget TAG_IGNORE
+#define TNA_HintInfo TAG_IGNORE
+#define WA_ToolBox TAG_IGNORE
+#define WINDOW_BuiltInScroll TAG_IGNORE
+#define WINDOW_NewMenu TAG_IGNORE
+#define WINDOW_NewPrefsHook TAG_IGNORE
+
+/* raw keycodes */
+#define RAWKEY_BACKSPACE 0x41
+#define RAWKEY_TAB 0x42
+#define RAWKEY_ESC 0x45
+#define RAWKEY_DEL 0x46
+#define RAWKEY_PAGEUP 0x48
+#define RAWKEY_PAGEDOWN 0x49
+#define RAWKEY_CRSRUP 0x4C
+#define RAWKEY_CRSRDOWN 0x4D
+#define RAWKEY_CRSRRIGHT 0x4E
+#define RAWKEY_CRSRLEFT 0x4F
+#define RAWKEY_F5 0x54
+#define RAWKEY_HELP 0x5F
+#define RAWKEY_HOME 0x70
+#define RAWKEY_END 0x71
+
+/* Other constants */
+#define IDCMP_EXTENDEDMOUSE 0
+#define WINDOW_BACKMOST 0
+#define DN_FULLPATH 0
/* Renamed structures */
#define AnchorPathOld AnchorPath
@@ -53,11 +96,6 @@
/* application */
#define Notify(...) (void)0
-/* Exec */
-/* AllocVecTagList with no tags */
-#define AllocVecTagList(SZ,TAG) AllocVec(SZ,MEMF_ANY)
-#define GetSucc(N) (N)->ln_Succ
-
/* diskfont */
/* Only used in one place we haven't ifdeffed, where it returns the charset name */
#define ObtainCharsetInfo(A,B,C) (const char *)"ISO-8859-1"
@@ -65,12 +103,24 @@
/* DOS */
#define FOpen(A,B,C) Open(A,B)
#define FClose(A) Close(A)
+#define CreateDirTree(D) CreateDir(D) /*\todo This isn't quite right */
+#define DevNameFromLock(A,B,C,D) NameFromLock(A,B,C)
+
+/* Exec */
+#define AllocVecTagList(SZ,TAG) AllocVec(SZ,MEMF_ANY) /* AllocVecTagList with no tags */
+#define GetPred(N) (N)->ln_Pred
+#define GetSucc(N) (N)->ln_Succ
+
+/* Gfx */
+#define SetRPAttrs(...) (void)0 /*\todo Probably need to emulate this */
/* Intuition */
#define IDoMethod DoMethod
#define IDoMethodA DoMethodA
#define IDoSuperMethodA DoSuperMethodA
#define RefreshSetGadgetAttrs SetGadgetAttrs /*\todo This isn't quite right */
+#define ShowWindow(...) (void)0
+
/* Utility */
#define SetMem memset
@@ -117,13 +167,22 @@ struct TimeVal {
#define IDFMT_PALETTEMAPPED (1) /* Palette mapped icon (chunky, V44+) */
#define IDFMT_DIRECTMAPPED (2) /* Direct mapped icon (truecolor 0xAARRGGBB, V51+) */
+/* Object types */
+enum {
+ ASOT_PORT = 1
+};
+
/* Functions */
/* DOS */
int64 GetFileSize(BPTR fh);
+void FreeSysObject(ULONG type, APTR obj);
/* Exec */
struct Node *GetHead(struct List *list);
+/* Intuition */
+uint32 GetAttrs(Object *obj, Tag tag1, ...);
+
/* Utility */
char *ASPrintf(const char *fmt, ...);
--
NetSurf Browser
8 years