diff options
Diffstat (limited to 'frontends/amiga')
-rw-r--r-- | frontends/amiga/Makefile | 2 | ||||
-rw-r--r-- | frontends/amiga/Makefile.defaults | 1 | ||||
-rw-r--r-- | frontends/amiga/bitmap.c | 75 | ||||
-rwxr-xr-x | frontends/amiga/bitmap.h | 16 | ||||
-rw-r--r-- | frontends/amiga/dist/Rexx/YT_download_page.nsrx | 21 | ||||
-rw-r--r-- | frontends/amiga/dist/Rexx/YT_open.nsrx | 21 | ||||
-rw-r--r-- | frontends/amiga/dist/Rexx/YT_play.nsrx | 19 | ||||
-rw-r--r-- | frontends/amiga/dt_anim.c | 2 | ||||
-rw-r--r-- | frontends/amiga/dt_picture.c | 4 | ||||
-rw-r--r-- | frontends/amiga/font_bullet.c | 7 | ||||
-rw-r--r-- | frontends/amiga/font_diskfont.c | 16 | ||||
-rw-r--r-- | frontends/amiga/gui_menu.c | 31 | ||||
-rw-r--r-- | frontends/amiga/gui_menu.h | 5 | ||||
-rwxr-xr-x | frontends/amiga/gui_options.c | 59 | ||||
-rw-r--r-- | frontends/amiga/icon.c | 2 | ||||
-rw-r--r-- | frontends/amiga/libs.c | 4 | ||||
-rw-r--r-- | frontends/amiga/pkg/SearchEngines | 2 | ||||
-rwxr-xr-x | frontends/amiga/pkg/netsurf.readme | 4 | ||||
-rw-r--r-- | frontends/amiga/pkg/netsurf_os3.readme | 10 | ||||
-rw-r--r-- | frontends/amiga/plotters.c | 47 | ||||
-rw-r--r-- | frontends/amiga/rtg.c | 3 | ||||
-rw-r--r-- | frontends/amiga/version.c | 2 |
22 files changed, 230 insertions, 123 deletions
diff --git a/frontends/amiga/Makefile b/frontends/amiga/Makefile index 99745c90e..f537a1163 100644 --- a/frontends/amiga/Makefile +++ b/frontends/amiga/Makefile @@ -80,7 +80,7 @@ AMIGA_DISTRIBUTION_FILES := $(FRONTEND_SOURCE_DIR)/dist/* AMIGA_PKG_DIR := $(FRONTEND_SOURCE_DIR)/pkg AMIGA_INSTALL_TARGET_DIR := NetSurf_Amiga -netsurf.lha: $(EXETARGET) +netsurf.lha: $(EXETARGET) $(POSTEXES) $(VQ)echo Creating netsurf.lha $(Q)rm -rf $(AMIGA_INSTALL_TARGET_DIR) $(Q)$(MKDIR) -p $(AMIGA_INSTALL_TARGET_DIR)/NetSurf diff --git a/frontends/amiga/Makefile.defaults b/frontends/amiga/Makefile.defaults index 7fcbef0fe..25e1f42e4 100644 --- a/frontends/amiga/Makefile.defaults +++ b/frontends/amiga/Makefile.defaults @@ -40,6 +40,7 @@ CFLAGS += -fomit-frame-pointer ifeq ($(SUBTARGET),os3) NETSURF_USE_OPENSSL := NO NETSURF_USE_AMISSL := YES + NETSURF_FS_BACKING_STORE := YES else CFLAGS += -gstabs endif diff --git a/frontends/amiga/bitmap.c b/frontends/amiga/bitmap.c index e160f9351..e8534a395 100644 --- a/frontends/amiga/bitmap.c +++ b/frontends/amiga/bitmap.c @@ -108,7 +108,7 @@ static APTR pool_bitmap = NULL; static bool guigfx_warned = false; /* exported function documented in amiga/bitmap.h */ -void *amiga_bitmap_create(int width, int height, unsigned int state) +void *amiga_bitmap_create(int width, int height, enum gui_bitmap_flags flags) { struct bitmap *bitmap; @@ -139,8 +139,7 @@ void *amiga_bitmap_create(int width, int height, unsigned int state) bitmap->width = width; bitmap->height = height; - if(state & BITMAP_OPAQUE) bitmap->opaque = true; - else bitmap->opaque = false; + bitmap->opaque = (flags & BITMAP_OPAQUE) == BITMAP_OPAQUE; bitmap->nativebm = NULL; bitmap->nativebmwidth = 0; @@ -307,25 +306,6 @@ void amiga_bitmap_set_opaque(void *bitmap, bool opaque) /* exported function documented in amiga/bitmap.h */ -bool amiga_bitmap_test_opaque(void *bitmap) -{ - struct bitmap *bm = bitmap; - uint32 p = bm->width * bm->height; - uint32 a = 0; - uint32 *bmi = (uint32 *)amiga_bitmap_get_buffer(bm); - - assert(bitmap); - - for(a=0;a<p;a+=4) - { - if ((*bmi & 0x000000ffU) != 0x000000ffU) return false; - bmi++; - } - return true; -} - - -/* exported function documented in amiga/bitmap.h */ bool amiga_bitmap_get_opaque(void *bitmap) { struct bitmap *bm = bitmap; @@ -367,40 +347,6 @@ int bitmap_get_height(void *bitmap) } } - -/** - * Find the bytes per pixel of a bitmap - * - * \param vbitmap a bitmap, as returned by bitmap_create() - * \return bytes per pixel - */ -static size_t bitmap_get_bpp(void *vbitmap) -{ - struct bitmap *bitmap = (struct bitmap *)vbitmap; - assert(bitmap); - return 4; -} - -static void ami_bitmap_argb_to_rgba(struct bitmap *bm) -{ - if(bm == NULL) return; - - ULONG *data = (ULONG *)amiga_bitmap_get_buffer(bm); - for(int i = 0; i < (bm->width * bm->height); i++) { - data[i] = (data[i] << 8) | (data[i] >> 24); - } -} - -static void ami_bitmap_rgba_to_argb(struct bitmap *bm) -{ - if(bm == NULL) return; - - ULONG *data = (ULONG *)amiga_bitmap_get_buffer(bm); - for(int i = 0; i < (bm->width * bm->height); i++) { - data[i] = (data[ i] >> 8) | (data[i] << 24); - } -} - #ifdef BITMAP_DUMP void bitmap_dump(struct bitmap *bitmap) { @@ -436,7 +382,7 @@ Object *ami_datatype_object_from_bitmap(struct bitmap *bitmap) { bmhd->bmh_Width = (UWORD)bitmap_get_width(bitmap); bmhd->bmh_Height = (UWORD)bitmap_get_height(bitmap); - bmhd->bmh_Depth = (UBYTE)bitmap_get_bpp(bitmap) * 8; + bmhd->bmh_Depth = (UBYTE)32; if(!amiga_bitmap_get_opaque(bitmap)) bmhd->bmh_Masking = mskHasAlpha; } @@ -450,7 +396,7 @@ Object *ami_datatype_object_from_bitmap(struct bitmap *bitmap) TAG_DONE); IDoMethod(dto, PDTM_WRITEPIXELARRAY, amiga_bitmap_get_buffer(bitmap), - PBPAFMT_RGBA, amiga_bitmap_get_rowstride(bitmap), 0, 0, + PBPAFMT_ARGB, amiga_bitmap_get_rowstride(bitmap), 0, 0, bitmap_get_width(bitmap), bitmap_get_height(bitmap)); } @@ -475,10 +421,10 @@ struct bitmap *ami_bitmap_from_datatype(char *filename) bm = amiga_bitmap_create(bmh->bmh_Width, bmh->bmh_Height, 0); IDoMethod(dto, PDTM_READPIXELARRAY, amiga_bitmap_get_buffer(bm), - PBPAFMT_RGBA, amiga_bitmap_get_rowstride(bm), 0, 0, + PBPAFMT_ARGB, amiga_bitmap_get_rowstride(bm), 0, 0, bmh->bmh_Width, bmh->bmh_Height); - amiga_bitmap_set_opaque(bm, amiga_bitmap_test_opaque(bm)); + amiga_bitmap_set_opaque(bm, bitmap_test_opaque(bm)); } DisposeDTObject(dto); } @@ -531,7 +477,6 @@ static inline struct BitMap *ami_bitmap_get_generic(struct bitmap *bitmap, dithermode = DITHERMODE_FS; } - ami_bitmap_rgba_to_argb(bitmap); bitmap->drawhandle = ObtainDrawHandle( NULL, &rp, @@ -548,7 +493,6 @@ static inline struct BitMap *ami_bitmap_get_generic(struct bitmap *bitmap, ReleaseDrawHandle(bitmap->drawhandle); bitmap->drawhandle = NULL; } - ami_bitmap_argb_to_rgba(bitmap); } else { if(guigfx_warned == false) { amiga_warn_user("BMConvErr", NULL); @@ -698,7 +642,7 @@ PLANEPTR ami_bitmap_get_mask(struct bitmap *bitmap, int width, for(y=0; y<height; y++) { for(x=0; x<width; x++) { - if ((*bmi & 0x000000ffU) <= (ULONG)nsoption_int(mask_alpha)) maskbit = 0; + if ((*bmi & 0xff000000U) <= (ULONG)nsoption_int(mask_alpha)) maskbit = 0; else maskbit = 1; bmi++; bitmap->native_mask[(y*bpr) + (x/8)] |= @@ -775,8 +719,6 @@ static nserror bitmap_render(struct bitmap *bitmap, struct hlcache_handle *conte BLITA_DestY, 0, TAG_DONE); - ami_bitmap_argb_to_rgba(bitmap); - /**\todo In theory we should be able to move the bitmap to our native area to try to avoid re-conversion (at the expense of memory) */ @@ -824,13 +766,10 @@ static struct gui_bitmap_table bitmap_table = { .destroy = amiga_bitmap_destroy, .set_opaque = amiga_bitmap_set_opaque, .get_opaque = amiga_bitmap_get_opaque, - .test_opaque = amiga_bitmap_test_opaque, .get_buffer = amiga_bitmap_get_buffer, .get_rowstride = amiga_bitmap_get_rowstride, .get_width = bitmap_get_width, .get_height = bitmap_get_height, - .get_bpp = bitmap_get_bpp, - .save = amiga_bitmap_save, .modified = amiga_bitmap_modified, .render = bitmap_render, }; diff --git a/frontends/amiga/bitmap.h b/frontends/amiga/bitmap.h index aaec26ac2..a7dc9198f 100755 --- a/frontends/amiga/bitmap.h +++ b/frontends/amiga/bitmap.h @@ -25,7 +25,9 @@ #include <intuition/classusr.h> #include <libraries/Picasso96.h> -#define AMI_BITMAP_FORMAT RGBFB_R8G8B8A8 +#include "netsurf/bitmap.h" + +#define AMI_BITMAP_FORMAT RGBFB_A8R8G8B8 #define AMI_BITMAP_SCALE_ICON 0xFF extern struct gui_bitmap_table *amiga_bitmap_table; @@ -101,10 +103,10 @@ void ami_bitmap_fini(void); * * \param width width of image in pixels * \param height width of image in pixels - * \param state a flag word indicating the initial state + * \param flags flags for bitmap creation * \return an opaque struct bitmap, or NULL on memory exhaustion */ -void *amiga_bitmap_create(int width, int height, unsigned int state); +void *amiga_bitmap_create(int width, int height, enum gui_bitmap_flags flags); /** * Return a pointer to the pixel data in a bitmap. @@ -174,14 +176,6 @@ void amiga_bitmap_modified(void *bitmap); void amiga_bitmap_set_opaque(void *bitmap, bool opaque); /** - * Tests whether a bitmap has an opaque alpha channel - * - * \param bitmap a bitmap, as returned by bitmap_create() - * \return whether the bitmap is opaque - */ -bool amiga_bitmap_test_opaque(void *bitmap); - -/** * Gets whether a bitmap should be plotted opaque * * \param bitmap a bitmap, as returned by bitmap_create() diff --git a/frontends/amiga/dist/Rexx/YT_download_page.nsrx b/frontends/amiga/dist/Rexx/YT_download_page.nsrx new file mode 100644 index 000000000..fdc06923d --- /dev/null +++ b/frontends/amiga/dist/Rexx/YT_download_page.nsrx @@ -0,0 +1,21 @@ +/* YT play.nsrx by Chris Handley + This script shows download links for a YouTube video using YT (OS4Depot:video/misc/yt.lha) +*/ + +options results + +if ~open('yt','AppDir:YT','R') then do + GETSCREENNAME + address command 'requestchoice >NIL: "NetSurf" "YT must be installed for this script to function.*n*nIt can be downloaded from OS4Depot:video/misc/yt" "OK" PubScreen='||result + OPEN 'http://os4depot.net/?function=showfile&file=video/misc/yt.lha' NEWTAB ACTIVE /* This doesn't work due to a NetSurf(?) bug */ + exit +end +close('yt') + +GETURL +/*address command 'requestchoice >NIL: "TEST" "'||result||'" "OK"'*/ +address command 'AppDir:YT <>CON:0/30/640/256/YT/AUTO/CLOSE "'||result||'" html silent' + +/* Hack to activate the newest tab */ +OPEN 'file:///RAM:' NEWTAB ACTIVE +CLOSE diff --git a/frontends/amiga/dist/Rexx/YT_open.nsrx b/frontends/amiga/dist/Rexx/YT_open.nsrx new file mode 100644 index 000000000..4454f0c29 --- /dev/null +++ b/frontends/amiga/dist/Rexx/YT_open.nsrx @@ -0,0 +1,21 @@ +/* YT play.nsrx by Chris Handley + This script opens a YouTube video using YT (OS4Depot:video/misc/yt.lha) +*/ + +options results + +if ~open('yt','AppDir:YT','R') then do + GETSCREENNAME + address command 'requestchoice >NIL: "NetSurf" "YT must be installed for this script to function.*n*nIt can be downloaded from OS4Depot:video/misc/yt" "OK" PubScreen='||result + OPEN 'http://os4depot.net/?function=showfile&file=video/misc/yt.lha' NEWTAB ACTIVE /* This doesn't work due to a NetSurf(?) bug */ + exit +end +close('yt') + +address COMMAND 'Run >NIL: RequestChoice Title="NetSurf" BODY="When finished with YT, click OK to return to NetSurf" GADGETS="OK" INACTIVE >NIL:' /* Hack to get Workbench to front */ + +GETURL +/*address command 'requestchoice >NIL: "TEST" "'||result||'" "OK"'*/ +address command 'AppDir:YT <>CON:0/30/640/256/YT/AUTO/CLOSE "'||result||'"' + +/*TOBACK*/ /* ideally we'd bring Workbench to front */ diff --git a/frontends/amiga/dist/Rexx/YT_play.nsrx b/frontends/amiga/dist/Rexx/YT_play.nsrx new file mode 100644 index 000000000..a8e29162f --- /dev/null +++ b/frontends/amiga/dist/Rexx/YT_play.nsrx @@ -0,0 +1,19 @@ +/* YT play.nsrx by Chris Handley + This script auto-plays a YouTube video using YT (OS4Depot:video/misc/yt.lha) +*/ + +options results + +if ~open('yt','AppDir:YT','R') then do + GETSCREENNAME + address command 'requestchoice >NIL: "NetSurf" "YT must be installed for this script to function.*n*nIt can be downloaded from OS4Depot:video/misc/yt" "OK" PubScreen='||result + OPEN 'http://os4depot.net/?function=showfile&file=video/misc/yt.lha' NEWTAB ACTIVE /* This doesn't work due to a NetSurf(?) bug */ + exit +end +close('yt') + +GETURL +/*address command 'requestchoice >NIL: "TEST" "'||result||'" "OK"'*/ +address command 'AppDir:YT <>CON:0/30/640/256/YT/AUTO/CLOSE "'||result||'" AutoPlay' + +/*TOBACK*/ /* ideally we'd bring Workbench to front */ diff --git a/frontends/amiga/dt_anim.c b/frontends/amiga/dt_anim.c index a9fe809cf..1162d7214 100644 --- a/frontends/amiga/dt_anim.c +++ b/frontends/amiga/dt_anim.c @@ -173,7 +173,7 @@ bool amiga_dt_anim_convert(struct content *c) size_t size; UBYTE *bm_buffer; struct BitMapHeader *bmh; - unsigned int bm_flags = BITMAP_NEW | BITMAP_OPAQUE; + unsigned int bm_flags = BITMAP_OPAQUE; struct adtFrame adt_frame; APTR clut; diff --git a/frontends/amiga/dt_picture.c b/frontends/amiga/dt_picture.c index ed1272bc1..e13790d5c 100644 --- a/frontends/amiga/dt_picture.c +++ b/frontends/amiga/dt_picture.c @@ -187,7 +187,7 @@ static struct bitmap *amiga_dt_picture_cache_convert(struct content *c) if((dto = amiga_dt_picture_newdtobject(adt))) { - bitmap = amiga_bitmap_create(c->width, c->height, BITMAP_NEW); + bitmap = amiga_bitmap_create(c->width, c->height, BITMAP_NONE); if (!bitmap) { msg_data.errordata.errorcode = NSERROR_NOMEM; msg_data.errordata.errormsg = messages_get("NoMemory"); @@ -202,7 +202,7 @@ static struct bitmap *amiga_dt_picture_cache_convert(struct content *c) amiga_bitmap_get_rowstride(bitmap), 0, 0, c->width, c->height); - amiga_bitmap_set_opaque(bitmap, amiga_bitmap_test_opaque(bitmap)); + amiga_bitmap_set_opaque(bitmap, bitmap_test_opaque(bitmap)); DisposeDTObject(dto); adt->dto = NULL; diff --git a/frontends/amiga/font_bullet.c b/frontends/amiga/font_bullet.c index dec39a1f7..43f7b9488 100644 --- a/frontends/amiga/font_bullet.c +++ b/frontends/amiga/font_bullet.c @@ -554,6 +554,7 @@ static inline int32 ami_font_plot_glyph(struct OutlineFont *ofont, struct RastPo FIXED kern = 0; ULONG glyphmaptag; ULONG template_type; + bool skip_c2 = false; uint32 long_char_1 = 0, long_char_2 = 0; #ifndef __amigaos4__ struct BulletBase *BulletBase = ofont->BulletBase; @@ -571,6 +572,8 @@ static inline int32 ami_font_plot_glyph(struct OutlineFont *ofont, struct RastPo } #endif + if (*char2 < 0x0020) skip_c2 = true; + #ifdef __amigaos4__ if(__builtin_expect(aa == true, 1)) { glyphmaptag = OT_GlyphMap8Bit; @@ -633,7 +636,7 @@ static inline int32 ami_font_plot_glyph(struct OutlineFont *ofont, struct RastPo kern = 0; - if(*char2) EObtainInfo(AMI_OFONT_ENGINE, + if((*char2) && (!skip_c2)) EObtainInfo(AMI_OFONT_ENGINE, OT_TextKernPair, &kern, TAG_END); @@ -643,7 +646,7 @@ static inline int32 ami_font_plot_glyph(struct OutlineFont *ofont, struct RastPo glyphmaptag, glyph, TAG_END); - if(*char2) EReleaseInfo(AMI_OFONT_ENGINE, + if((*char2) && (!skip_c2)) EReleaseInfo(AMI_OFONT_ENGINE, OT_TextKernPair, kern, TAG_END); } diff --git a/frontends/amiga/font_diskfont.c b/frontends/amiga/font_diskfont.c index a587d6eaf..be1b89194 100644 --- a/frontends/amiga/font_diskfont.c +++ b/frontends/amiga/font_diskfont.c @@ -100,7 +100,10 @@ static struct TextFont *ami_font_bm_open(struct RastPort *rp, const plot_font_st tattr.ta_YSize = fstyle->size / PLOT_STYLE_SCALE; NSLOG(netsurf, INFO, "font: %s/%d", tattr.ta_Name, tattr.ta_YSize); - if(prev_font != NULL) CloseFont(prev_font); + if(prev_font != NULL) { + CloseFont(prev_font); + prev_font = NULL; + } if((bmfont = OpenDiskFont(&tattr))) { SetRPAttrs(rp, RPTAG_Font, bmfont, TAG_DONE); @@ -300,7 +303,14 @@ void ami_font_diskfont_init(void) void ami_font_diskfont_fini(void) { - if(prev_font != NULL) CloseFont(prev_font); - if(prev_fstyle != NULL) free(prev_fstyle); + if(prev_font != NULL) { + CloseFont(prev_font); + prev_font = NULL; + } + + if(prev_fstyle != NULL) { + free(prev_fstyle); + prev_fstyle = NULL; + } } diff --git a/frontends/amiga/gui_menu.c b/frontends/amiga/gui_menu.c index b9c0dd9f8..dc1450fce 100644 --- a/frontends/amiga/gui_menu.c +++ b/frontends/amiga/gui_menu.c @@ -1,5 +1,5 @@ /* - * Copyright 2017 Chris Young <chris@unsatisfactorysoftware.co.uk> + * Copyright 2017-2024 Chris Young <chris@unsatisfactorysoftware.co.uk> * * This file is part of NetSurf, http://www.netsurf-browser.org/ * @@ -375,6 +375,18 @@ HOOKF(void, ami_menu_item_browser_enablejs, APTR, window, struct IntuiMessage *) ami_gui_menu_set_check_toggled(); } +HOOKF(void, ami_menu_item_browser_enablecss, APTR, window, struct IntuiMessage *) +{ + struct Menu *menustrip; + bool checked = false; + + GetAttr(WINDOW_MenuStrip, (Object *)window, (ULONG *)&menustrip); + checked = ami_menu_get_selected(menustrip, msg); + + nsoption_set_bool(author_level_css, checked); + ami_gui_menu_set_check_toggled(); +} + HOOKF(void, ami_menu_item_browser_scale_decrease, APTR, window, struct IntuiMessage *) { struct gui_window_2 *gwin; @@ -582,6 +594,10 @@ ULONG ami_gui_menu_number(int item) case M_JS: menu_num = FULLMENUNUM(2,9,0); break; + + case M_CSS: + menu_num = FULLMENUNUM(2,10,0); + break; default: NSLOG(netsurf, INFO, @@ -690,6 +706,13 @@ void ami_gui_menu_update_checked(struct gui_window_2 *gwin) if(ItemAddress(menustrip, ami_gui_menu_number(M_JS))->Flags & CHECKED) ItemAddress(menustrip, ami_gui_menu_number(M_JS))->Flags ^= CHECKED; } + if(nsoption_bool(author_level_css) == true) { + if((ItemAddress(menustrip, ami_gui_menu_number(M_CSS))->Flags & CHECKED) == 0) + ItemAddress(menustrip, ami_gui_menu_number(M_CSS))->Flags ^= CHECKED; + } else { + if(ItemAddress(menustrip, ami_gui_menu_number(M_CSS))->Flags & CHECKED) + ItemAddress(menustrip, ami_gui_menu_number(M_CSS))->Flags ^= CHECKED; + } if(nsoption_bool(foreground_images) == true) { if((ItemAddress(menustrip, ami_gui_menu_number(M_IMGFORE))->Flags & CHECKED) == 0) ItemAddress(menustrip, ami_gui_menu_number(M_IMGFORE))->Flags ^= CHECKED; @@ -919,6 +942,10 @@ static void ami_init_menulabs(struct ami_menu_data **md) if(nsoption_bool(enable_javascript) == true) js_flags |= CHECKED; + UWORD css_flags = CHECKIT | MENUTOGGLE; + if(nsoption_bool(author_level_css) == true) + css_flags |= CHECKED; + UWORD imgfore_flags = CHECKIT | MENUTOGGLE; if(nsoption_bool(foreground_images) == true) imgfore_flags |= CHECKED; @@ -1007,6 +1034,8 @@ static void ami_init_menulabs(struct ami_menu_data **md) ami_menu_item_browser_backimg, NULL, imgback_flags); ami_menu_alloc_item(md, M_JS, NM_ITEM, "EnableJS", NULL, NULL, ami_menu_item_browser_enablejs, NULL, js_flags); + ami_menu_alloc_item(md, M_CSS, NM_ITEM, "EnableCSS", NULL, NULL, + ami_menu_item_browser_enablecss, NULL, css_flags); ami_menu_alloc_item(md, M_BAR_B4, NM_ITEM, NM_BARLABEL, NULL, NULL, NULL, NULL, 0); ami_menu_alloc_item(md, M_REDRAW, NM_ITEM, "Redraw", NULL, "TBImages:list_wand", ami_menu_item_browser_redraw, NULL, 0); diff --git a/frontends/amiga/gui_menu.h b/frontends/amiga/gui_menu.h index ed72c24a4..ae36397c5 100644 --- a/frontends/amiga/gui_menu.h +++ b/frontends/amiga/gui_menu.h @@ -1,5 +1,5 @@ /* - * Copyright 2008-2017 Chris Young <chris@unsatisfactorysoftware.co.uk> + * Copyright 2008-2024 Chris Young <chris@unsatisfactorysoftware.co.uk> * * This file is part of NetSurf, http://www.netsurf-browser.org/ * @@ -78,13 +78,14 @@ enum { M_IMGFORE, M_IMGBACK, M_JS, + M_CSS, M_BAR_B4, M_REDRAW, /* Hotlist menu */ M_HOTLIST, M_HLADD, M_HLSHOW, - M_BAR_H1, // 47 + M_BAR_H1, // 48 AMI_MENU_HOTLIST, /* Where the hotlist entries start */ AMI_MENU_HOTLIST_MAX = AMI_MENU_HOTLIST + AMI_HOTLIST_ITEMS, /* Settings menu */ diff --git a/frontends/amiga/gui_options.c b/frontends/amiga/gui_options.c index fa8cdee35..c8c51b012 100755 --- a/frontends/amiga/gui_options.c +++ b/frontends/amiga/gui_options.c @@ -94,6 +94,7 @@ enum GID_OPTS_FROMLOCALE, GID_OPTS_HISTORY, GID_OPTS_JAVASCRIPT, + GID_OPTS_ENABLECSS, GID_OPTS_REFERRAL, GID_OPTS_DONOTTRACK, GID_OPTS_FASTSCROLL, @@ -102,6 +103,9 @@ enum GID_OPTS_SCREENNAME, GID_OPTS_WIN_SIMPLE, GID_OPTS_THEME, + GID_OPTS_THEMEPAGE, + GID_OPTS_DARK, + GID_OPTS_LIGHT, GID_OPTS_PTRTRUE, GID_OPTS_PTROS, GID_OPTS_PROXY, @@ -210,6 +214,7 @@ enum #define OPTS_LAST LAB_OPTS_LAST #define OPTS_MAX_TABS 10 #define OPTS_MAX_SCREEN 4 +#define OPTS_MAX_THEMEPAGE 3 #define OPTS_MAX_PROXY 5 #define OPTS_MAX_NATIVEBM 4 #define OPTS_MAX_DITHER 4 @@ -227,6 +232,7 @@ struct ami_gui_opts_window { #ifndef __amigaos4__ struct List clicktablist; struct List screenoptslist; + struct List pagethemeoptslist; struct List proxyoptslist; struct List nativebmoptslist; struct List ditheroptslist; @@ -246,6 +252,7 @@ static struct ami_gui_opts_window *gow = NULL; static CONST_STRPTR tabs[OPTS_MAX_TABS]; static STRPTR screenopts[OPTS_MAX_SCREEN]; +static CONST_STRPTR pagethemeopts[OPTS_MAX_THEMEPAGE]; static CONST_STRPTR proxyopts[OPTS_MAX_PROXY]; static CONST_STRPTR nativebmopts[OPTS_MAX_NATIVEBM]; static CONST_STRPTR ditheropts[OPTS_MAX_DITHER]; @@ -333,6 +340,10 @@ static void ami_gui_opts_setup(struct ami_gui_opts_window *gow) screenopts[2] = (char *)ami_utf8_easy((char *)messages_get("ScreenPublic")); screenopts[3] = NULL; + pagethemeopts[0] = (char *)ami_utf8_easy((char *)messages_get("Light")); + pagethemeopts[1] = (char *)ami_utf8_easy((char *)messages_get("Dark")); + pagethemeopts[2] = NULL; + proxyopts[0] = (char *)ami_utf8_easy((char *)messages_get("ProxyNone")); proxyopts[1] = (char *)ami_utf8_easy((char *)messages_get("ProxyNoAuth")); proxyopts[2] = (char *)ami_utf8_easy((char *)messages_get("ProxyBasic")); @@ -359,10 +370,15 @@ static void ami_gui_opts_setup(struct ami_gui_opts_window *gow) gadlab[GID_OPTS_FROMLOCALE] = (char *)ami_utf8_easy((char *)messages_get("LocaleLang")); gadlab[GID_OPTS_HISTORY] = (char *)ami_utf8_easy((char *)messages_get("HistoryAge")); gadlab[GID_OPTS_JAVASCRIPT] = (char *)ami_utf8_easy((char *)messages_get("EnableJS")); + gadlab[GID_OPTS_ENABLECSS] = (char *)ami_utf8_easy((char *)messages_get("EnableCSS")); gadlab[GID_OPTS_REFERRAL] = (char *)ami_utf8_easy((char *)messages_get("SendReferer")); gadlab[GID_OPTS_DONOTTRACK] = (char *)ami_utf8_easy((char *)messages_get("DoNotTrack")); gadlab[GID_OPTS_FASTSCROLL] = (char *)ami_utf8_easy((char *)messages_get("FastScrolling")); gadlab[GID_OPTS_WIN_SIMPLE] = (char *)ami_utf8_easy((char *)messages_get("SimpleRefresh")); + gadlab[GID_OPTS_THEME] = (char *)ami_utf8_easy((char *)messages_get("ThemeGUI")); + gadlab[GID_OPTS_THEMEPAGE] = (char *)ami_utf8_easy((char *)messages_get("ThemePage")); + gadlab[GID_OPTS_DARK] = (char *)ami_utf8_easy((char *)messages_get("Dark")); + gadlab[GID_OPTS_LIGHT] = (char *)ami_utf8_easy((char *)messages_get("Light")); gadlab[GID_OPTS_PTRTRUE] = (char *)ami_utf8_easy((char *)messages_get("TrueColour")); gadlab[GID_OPTS_PTROS] = (char *)ami_utf8_easy((char *)messages_get("OSPointers")); gadlab[GID_OPTS_PROXY] = (char *)ami_utf8_easy((char *)messages_get("ProxyType")); @@ -466,6 +482,7 @@ static void ami_gui_opts_setup(struct ami_gui_opts_window *gow) #ifndef __amigaos4__ ami_gui_opts_array_to_list(&gow->clicktablist, tabs, NSA_LIST_CLICKTAB); ami_gui_opts_array_to_list(&gow->screenoptslist, screenopts, NSA_LIST_RADIO); + ami_gui_opts_array_to_list(&gow->pagethemeoptslist, pagethemeopts, NSA_LIST_CHOOSER); ami_gui_opts_array_to_list(&gow->proxyoptslist, proxyopts, NSA_LIST_CHOOSER); ami_gui_opts_array_to_list(&gow->nativebmoptslist, nativebmopts, NSA_LIST_CHOOSER); ami_gui_opts_array_to_list(&gow->ditheroptslist, ditheropts, NSA_LIST_CHOOSER); @@ -497,6 +514,7 @@ static void ami_gui_opts_free(struct ami_gui_opts_window *gow) #ifndef __amigaos4__ ami_gui_opts_free_list(&gow->clicktablist, NSA_LIST_CLICKTAB); ami_gui_opts_free_list(&gow->screenoptslist, NSA_LIST_RADIO); + ami_gui_opts_free_list(&gow->pagethemeoptslist, NSA_LIST_CHOOSER); ami_gui_opts_free_list(&gow->proxyoptslist, NSA_LIST_CHOOSER); ami_gui_opts_free_list(&gow->nativebmoptslist, NSA_LIST_CHOOSER); ami_gui_opts_free_list(&gow->ditheroptslist, NSA_LIST_CHOOSER); @@ -858,6 +876,23 @@ void ami_gui_opts_open(void) GETFILE_ReadOnly, TRUE, GETFILE_FullFileExpand, FALSE, GetFileEnd, + CHILD_Label, LabelObj, + LABEL_Text, gadlab[GID_OPTS_THEME], + LabelEnd, + LAYOUT_AddChild, gow->objects[GID_OPTS_THEMEPAGE] = ChooserObj, + GA_ID, GID_OPTS_THEMEPAGE, + GA_RelVerify, TRUE, + CHOOSER_PopUp, TRUE, +#ifdef __amigaos4__ + CHOOSER_LabelArray, pagethemeopts, +#else + CHOOSER_Labels, &gow->pagethemeoptslist, +#endif + CHOOSER_Selected, nsoption_bool(prefer_dark_mode), + ChooserEnd, + CHILD_Label, LabelObj, + LABEL_Text, gadlab[GID_OPTS_THEMEPAGE], + LabelEnd, LayoutEnd, // theme CHILD_WeightedHeight, 0, LAYOUT_AddChild, LayoutVObj, @@ -1466,6 +1501,12 @@ void ami_gui_opts_open(void) GA_Selected, !nsoption_bool(core_select_menu), GA_Disabled, !ami_selectmenu_is_safe(), CheckBoxEnd, + LAYOUT_AddChild, gow->objects[GID_OPTS_ENABLECSS] = CheckBoxObj, + GA_ID, GID_OPTS_ENABLECSS, + GA_RelVerify, TRUE, + GA_Text, gadlab[GID_OPTS_ENABLECSS], + GA_Selected, nsoption_bool(author_level_css), + CheckBoxEnd, LayoutEnd, // misc CHILD_WeightedHeight, 0, @@ -1709,7 +1750,16 @@ static void ami_gui_opts_use(bool save) } else { nsoption_set_bool(do_not_track, false); } - + + GetAttr(GA_Selected,gow->objects[GID_OPTS_ENABLECSS],(ULONG *)&data); + if (data) { + nsoption_set_bool(author_level_css, true); + } else { + nsoption_set_bool(author_level_css, false); + } + + ami_gui_menu_set_checked(NULL, M_CSS, nsoption_bool(author_level_css)); + GetAttr(GA_Selected,gow->objects[GID_OPTS_FASTSCROLL],(ULONG *)&data); if (data) { nsoption_set_bool(faster_scroll, true); @@ -1754,6 +1804,13 @@ static void ami_gui_opts_use(bool save) GetAttr(GETFILE_Drawer,gow->objects[GID_OPTS_THEME],(ULONG *)&data); nsoption_set_charp(theme, (char *)strdup((char *)data)); + GetAttr(CHOOSER_Selected,gow->objects[GID_OPTS_THEMEPAGE],(ULONG *)&data); + if(data) { + nsoption_set_bool(prefer_dark_mode, true); + } else { + nsoption_set_bool(prefer_dark_mode, false); + } + GetAttr(GA_Selected,gow->objects[GID_OPTS_PTRTRUE],(ULONG *)&data); if (data) { nsoption_set_bool(truecolour_mouse_pointers, true); diff --git a/frontends/amiga/icon.c b/frontends/amiga/icon.c index 001874c86..2b7f61281 100644 --- a/frontends/amiga/icon.c +++ b/frontends/amiga/icon.c @@ -201,7 +201,7 @@ bool amiga_icon_convert(struct content *c) return false; } - icon_c->bitmap = amiga_bitmap_create(width, height, BITMAP_NEW); + icon_c->bitmap = amiga_bitmap_create(width, height, BITMAP_NONE); if (!icon_c->bitmap) { msg_data.errordata.errorcode = NSERROR_NOMEM; msg_data.errordata.errormsg = messages_get("NoMemory"); diff --git a/frontends/amiga/libs.c b/frontends/amiga/libs.c index 3c09bcb27..eb1f21617 100644 --- a/frontends/amiga/libs.c +++ b/frontends/amiga/libs.c @@ -223,6 +223,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("dos.library", 37, DOS, "main", 1, true) #else /* Libraries we get automatically on OS4 but not OS3 */ AMINS_LIB_OPEN("utility.library", 37, Utility, "main", 1, true) @@ -231,7 +232,6 @@ bool ami_libs_open(void) AMINS_LIB_OPEN("asl.library", 37, Asl, "main", 1, true) AMINS_LIB_OPEN("datatypes.library", 39, DataTypes, "main", 1, true) AMINS_LIB_OPEN("diskfont.library", 40, Diskfont, "main", 1, true) - AMINS_LIB_OPEN("dos.library", 37, DOS, "main", 1, true) AMINS_LIB_OPEN("gadtools.library", 37, GadTools, "main", 1, true) AMINS_LIB_OPEN("graphics.library", 40, Graphics, "main", 1, true) AMINS_LIB_OPEN("icon.library", 44, Icon, "main", 1, true) @@ -332,7 +332,6 @@ void ami_libs_close(void) AMINS_LIB_CLOSE(Asl) AMINS_LIB_CLOSE(DataTypes) AMINS_LIB_CLOSE(Diskfont) - AMINS_LIB_CLOSE(DOS) AMINS_LIB_CLOSE(GadTools) AMINS_LIB_CLOSE(Graphics) AMINS_LIB_CLOSE(Icon) @@ -345,6 +344,7 @@ void ami_libs_close(void) AMINS_LIB_CLOSE(Workbench) #ifdef __amigaos4__ AMINS_LIB_CLOSE(Application) + AMINS_LIB_CLOSE(DOS) #else AMINS_LIB_CLOSE(Utility) #endif diff --git a/frontends/amiga/pkg/SearchEngines b/frontends/amiga/pkg/SearchEngines index 3f4bdd95b..3095d43cf 100644 --- a/frontends/amiga/pkg/SearchEngines +++ b/frontends/amiga/pkg/SearchEngines @@ -1,2 +1,2 @@ -Aminet|www.aminet.net|http://aminet.net/search?query=%s|http://aminet.net/favicon.ico| +Aminet|www.aminet.net|https://aminet.net/search?query=%s|https://aminet.net/favicon.ico| OS4Depot|www.os4depot.net|http://www.os4depot.net/index.php?function=search&tool=simple&f_fields=%s|http://www.os4depot.net/favicon.ico| diff --git a/frontends/amiga/pkg/netsurf.readme b/frontends/amiga/pkg/netsurf.readme index 7d3b8defa..d2d83ac56 100755 --- a/frontends/amiga/pkg/netsurf.readme +++ b/frontends/amiga/pkg/netsurf.readme @@ -2,11 +2,11 @@ Short: Fast CSS capable web browser Uploader: chris@unsatisfactorysoftware.co.uk (Chris Young) Author: NetSurf contributors (OS4 port by Chris Young) Type: comm/www -Version: 3.10 +Version: 3.11 Requires: dev/misc/guigfxlib.lha Architecture: ppc-amigaos >= 4.0.0 -This is NetSurf 3.10 for AmigaOS 4 (native frontend). +This is NetSurf 3.11 for AmigaOS 4 (native frontend). For the latest version, visit http://www.netsurf-browser.org ******************************************* diff --git a/frontends/amiga/pkg/netsurf_os3.readme b/frontends/amiga/pkg/netsurf_os3.readme index 418a9dec0..53514f8db 100644 --- a/frontends/amiga/pkg/netsurf_os3.readme +++ b/frontends/amiga/pkg/netsurf_os3.readme @@ -2,14 +2,14 @@ Short: Fast CSS capable web browser Uploader: chris@unsatisfactorysoftware.co.uk (Chris Young) Author: NetSurf contributors (OS4 port by Chris Young) Type: comm/www -Version: 3.10 BETA -Requires: dev/misc/guigfxlib.lha util/libs/AmiSSL-4.3.lha -Architecture: m68k-amigaos >= 3.5.0 +Version: 3.11 BETA +Requires: dev/misc/guigfxlib.lha util/libs/AmiSSL-5.13-OS3.lha +Architecture: m68k-amigaos >= 3.2.0 -This is NetSurf 3.10 BETA for AmigaOS 3. +This is NetSurf 3.11 BETA for AmigaOS 3. It is built off of the OS4 (Reaction) frontend. -Requirements are AmigaOS 3.5 or 3.9, 32MB RAM. +Requirements are AmigaOS 3.2, 3.5 or 3.9, 32MB RAM. THIS IS EARLY BETA QUALITY SOFTWARE FOR TESTING ONLY. ALL USE IS AT YOUR OWN RISK. IT *WILL* CRASH! diff --git a/frontends/amiga/plotters.c b/frontends/amiga/plotters.c index b6add47cb..8bc1712dd 100644 --- a/frontends/amiga/plotters.c +++ b/frontends/amiga/plotters.c @@ -126,11 +126,34 @@ struct gui_globals *ami_plot_ra_alloc(ULONG width, ULONG height, bool force32bit if(depth < 16) { gg->palette_mapped = true; if(force32bit == false) palette_mapped = true; + + bitmap_set_format(&(bitmap_fmt_t) { + .layout = BITMAP_LAYOUT_ARGB8888, + .pma = true, + }); + + NSLOG(netsurf, INFO, "Set bitmap format to 0xAARRGGBB (native endian) (PMA)"); + } else { gg->palette_mapped = false; - if(force32bit == false) palette_mapped = false; + + bitmap_set_format(&(bitmap_fmt_t) { + .layout = BITMAP_LAYOUT_ARGB8888, + .pma = false, + }); + + NSLOG(netsurf, INFO, "Set bitmap format to 0xAARRGGBB (native endian)"); + } #else + bitmap_set_format(&(bitmap_fmt_t) { + .layout = BITMAP_LAYOUT_ARGB8888, + .pma = true, + }); + + NSLOG(netsurf, INFO, "Set bitmap format to 0xAARRGGBB (native endian) (PMA)"); + + /* Friend BitMaps are weird. * For OS4, we shouldn't use a friend BitMap here (see below). * For OS3 AGA, we get no display blitted if we use a friend BitMap, @@ -144,16 +167,12 @@ struct gui_globals *ami_plot_ra_alloc(ULONG width, ULONG height, bool force32bit if((depth > 8) && (force32bit == false)) friend = scrn->RastPort.BitMap; } - /* OS3 is locked to using palette-mapped display even on RTG. - * To change this, comment out the below and build with the similar OS4 lines above. - * Various bits of RTG code are OS4-only and OS3 versions will need to be written, - * however a brief test reveals a negative performance benefit, so this lock to a - * palette-mapped display is most likely permanent. - */ -#warning OS3 locked to palette-mapped modes - gg->palette_mapped = true; - palette_mapped = true; - if(depth > 8) depth = 8; + if(depth < 16) { + gg->palette_mapped = true; + if(force32bit == false) palette_mapped = true; + } else { + gg->palette_mapped = false; + } #endif /* Probably need to fix this next line */ @@ -257,11 +276,7 @@ void ami_plot_ra_free(struct gui_globals *gg) ami_memory_chip_free(gg->tmprasbuf); free(gg->areabuf); DisposeLayerInfo(gg->layerinfo); - if(gg->palette_mapped == false) { - if(gg->bm) ami_rtg_freebitmap(gg->bm); - } else { - if(gg->bm) FreeBitMap(gg->bm); - } + if(gg->bm) ami_rtg_freebitmap(gg->bm); if(gg->managed_pen_list == true) { ami_plot_release_pens(gg->shared_pens); diff --git a/frontends/amiga/rtg.c b/frontends/amiga/rtg.c index 5e1cac290..8618c0a33 100644 --- a/frontends/amiga/rtg.c +++ b/frontends/amiga/rtg.c @@ -26,9 +26,6 @@ struct BitMap *ami_rtg_allocbitmap(ULONG width, ULONG height, ULONG depth, ULONG flags, struct BitMap *friend, RGBFTYPE format) { if(P96Base == NULL) { -#ifndef __amigaos4__ - if(depth > 8) depth = 8; -#endif return AllocBitMap(width, height, depth, flags, friend); } else { return p96AllocBitMap(width, height, depth, flags, friend, format); diff --git a/frontends/amiga/version.c b/frontends/amiga/version.c index 7e017f3c8..ae898cb83 100644 --- a/frontends/amiga/version.c +++ b/frontends/amiga/version.c @@ -25,7 +25,7 @@ * problems created by "0" not being a valid AmigaOS revision number. */ #define NETSURF_VERSION_MAJOR "3" -#define NETSURF_VERSION_MINOR_EXTERNAL "11" +#define NETSURF_VERSION_MINOR_EXTERNAL "12" #if defined(CI_BUILD) #define NETSURF_VERSION_MINOR CI_BUILD #else |