diff options
Diffstat (limited to 'amiga')
-rw-r--r-- | amiga/Makefile.target | 15 | ||||
-rwxr-xr-x | amiga/dist/Install | 31 | ||||
-rwxr-xr-x | amiga/dist/NetSurf.guide | 2 | ||||
-rw-r--r-- | amiga/dt_picture.c | 125 | ||||
-rwxr-xr-x | amiga/gui.c | 12 | ||||
-rwxr-xr-x | amiga/menu.c | 4 | ||||
-rwxr-xr-x | amiga/menu.h | 5 | ||||
-rw-r--r-- | amiga/options.h | 2 |
8 files changed, 112 insertions, 84 deletions
diff --git a/amiga/Makefile.target b/amiga/Makefile.target index af297bf1f..c4db9a373 100644 --- a/amiga/Makefile.target +++ b/amiga/Makefile.target @@ -39,9 +39,6 @@ ifeq ($(HOST),amiga) ifeq ($(NETSURF_USE_AMIGA_CAIRO),YES) CFLAGS += -I /SDK/local/common/include/cairo LDFLAGS += -use-dynld -ldl -lcairo -lpixman-1 -lfreetype -lfontconfig -lpng -lexpat - EXETARGET := NetSurf - else - EXETARGET := NetSurf-Static endif else $(eval $(call pkg_config_find_and_add,ROSPRITE,librosprite,Sprite)) @@ -66,14 +63,10 @@ else else LDFLAGS += -lauto -lpbl -liconv endif - - ifeq ($(NETSURF_AMIGA_CAIRO_AVAILABLE),yes) - EXETARGET := NetSurf - else - EXETARGET := NetSurf-Static - endif endif +EXETARGET := NetSurf + # ---------------------------------------------------------------------------- # Source file setup # ---------------------------------------------------------------------------- @@ -106,7 +99,7 @@ install-amiga: package-amiga: netsurf.lha -AMIGA_LANGUAGES_MESSAGES := de en fr it nl +AMIGA_LANGUAGES_MESSAGES := de en it AMIGA_LANGUAGES := $(AMIGA_LANGUAGES_MESSAGES) ja AMIGA_PLATFORM_RESOURCES := Pointers Themes default.css default.css.info favicon.png LangNames mimetypes Resource.map SearchEngines splash.png AMIGA_GENERIC_RESOURCES := $(AMIGA_LANGUAGES) ca-bundle @@ -126,6 +119,7 @@ netsurf.lha: $(EXETARGET) $(Q)mkdir -p $(AMIGA_INSTALL_TARGET_DIR)/NetSurf $(Q)cp -p $(EXETARGET) $(AMIGA_INSTALL_TARGET_DIR)/NetSurf $(Q)mkdir $(AMIGA_INSTALL_TARGET_DIR)/NetSurf/Resources + $(call split_install_messages, ami, $(AMIGA_INSTALL_TARGET_DIR)/NetSurf/Resources/) $(Q)cp -r $(AMIGA_RESOURCES) $(AMIGA_INSTALL_TARGET_DIR)/NetSurf/Resources $(Q)cp -r $(AMIGA_DISTRIBUTION_FILES) $(AMIGA_INSTALL_TARGET_DIR)/NetSurf $(Q)cp \!NetSurf/Resources/AdBlock,f79 $(AMIGA_INSTALL_TARGET_DIR)/NetSurf/Resources/adblock.css @@ -136,7 +130,6 @@ netsurf.lha: $(EXETARGET) $(Q)cp amiga/pkg/fitr $(AMIGA_INSTALL_TARGET_DIR)/NetSurf $(Q)cp amiga/pkg/drawer.info $(AMIGA_INSTALL_TARGET_DIR)/NetSurf.info $(Q)cp amiga/pkg/AutoInstall $(AMIGA_INSTALL_TARGET_DIR) - $(Q)$(foreach AMIGA_LANGUAGE, $(AMIGA_LANGUAGES_MESSAGES), perl utils/split-messages.pl $(AMIGA_LANGUAGE) ami < resources/FatMessages >$(AMIGA_INSTALL_TARGET_DIR)/NetSurf/Resources/$(AMIGA_LANGUAGE)/Messages;) ifeq ($(HOST),amiga) $(Q)mkdir $(AMIGA_INSTALL_TARGET_DIR)/NetSurf/Libs $(Q)cp $(AMIGA_LIBS) $(AMIGA_INSTALL_TARGET_DIR)/NetSurf/Libs diff --git a/amiga/dist/Install b/amiga/dist/Install index 039ccbf40..7b8c5fe0b 100755 --- a/amiga/dist/Install +++ b/amiga/dist/Install @@ -311,20 +311,9 @@ (set osver (/ osver 65536)) (set #versions-available 0) -(set #static-filename "NetSurf-Static") +(set #static-filename "NetSurf") (set #cairo-filename "NetSurf") -(if (exists "NetSurf-Static") - ( - (set #static-name "Static/graphics.library") - (set #versions-available (+ #versions-available 1)) - ) - ; else - ( - (set #static-name "") - ) -) - (if (exists "NetSurf") ( (if (exists "SObjs") @@ -375,8 +364,7 @@ (set #cairo-version (askchoice (prompt "Which version of NetSurf would you like to install?") - (help "The Cairo/shared objects version has better rendering " - "of some graphical elements, and supports SVG.\n\n" + (help "The Cairo version has anti-aliasing of graphical elements.\n\n" @askchoice-help) (choices #static-name #cairo-name) (default #cairo-version) @@ -460,6 +448,8 @@ (set #netsurf-name (select #cairo-version #static-filename #cairo-filename)) +(working "Installing NetSurf") + (if (= #AutoInstall 0) ( (copyfiles @@ -474,18 +464,7 @@ ) ;else ( - (copyfiles - (prompt "Please check the version of NetSurf you are copying against " - "any which might already be installed.") - (help @copyfiles-help) - (source #netsurf-name) - (dest "T:") - (newname "NetSurf") - (optional "force" "oknodelete") - ) - - (run "CopyStore T:NetSurf" @default-dest) - (delete "T:NetSurf") + (run "CopyStore NetSurf" @default-dest) ) ) diff --git a/amiga/dist/NetSurf.guide b/amiga/dist/NetSurf.guide index a1ca248b3..39148be8f 100755 --- a/amiga/dist/NetSurf.guide +++ b/amiga/dist/NetSurf.guide @@ -42,7 +42,7 @@ There are a couple of Amiga-specific options which can only be changed directly @{b}kiosk_mode@{ub} No gadgets @{b}printer_unit@{ub} Specifies which printer.device unit to print to @{b}drag_save_icons@{ub} Enables displaying Workbench-style transparent icons under the pointer when performing drag saves (ctrl-drag of objects available if NetSurf is running on the Workbench screen) and text selection drags. If set to 0 the pointer style will change instead. OS 4.0 users may want to set this to 0 as icons will appear opaque and obscure the drop position. -@{b}cairo_renderer@{ub} Set rendering engine. -1 = palette-mapped (set automatically when required), 0 = graphics.library, 1 = Cairo/graphics.library mixed (recommended), 2 = Full Cairo. +@{b}cairo_renderer@{ub} Set rendering engine. -1 = palette-mapped (set automatically when required), 0 = graphics.library (default), 1 = Cairo/graphics.library mixed, 2 = Full Cairo. @{b}monitor_aspect_x@{ub}/@{b}monitor_aspect_y@{ub} Correct aspect ratio for displays (default of 0 means "assume square pixels"). @{b}screen_compositing@{ub} Use compositing on NetSurf's own screen. 0=disable, 1=enable, 2=default @{b}redraw_tile_size_x@{ub}/@{b}redraw_tile_size_y@{ub} Specify the size of the off-screen bitmap. Higher will speed up redraws at the expense of memory. 0 disables tiling (will use a bitmap at least the size of the screen NetSurf is running on) diff --git a/amiga/dt_picture.c b/amiga/dt_picture.c index 1a9dc4f72..280028c69 100644 --- a/amiga/dt_picture.c +++ b/amiga/dt_picture.c @@ -1,5 +1,5 @@ /* - * Copyright 2011 Chris Young <chris@unsatisfactorysoftware.co.uk> + * Copyright 2011 - 2012 Chris Young <chris@unsatisfactorysoftware.co.uk> * * This file is part of NetSurf, http://www.netsurf-browser.org/ * @@ -42,11 +42,12 @@ static nserror amiga_dt_picture_create(const content_handler *handler, bool quirks, struct content **c); static bool amiga_dt_picture_convert(struct content *c); static nserror amiga_dt_picture_clone(const struct content *old, struct content **newc); +static void amiga_dt_picture_destroy(struct content *c); static const content_handler amiga_dt_picture_content_handler = { .create = amiga_dt_picture_create, .data_complete = amiga_dt_picture_convert, - .destroy = image_cache_destroy, + .destroy = amiga_dt_picture_destroy, .redraw = image_cache_redraw, .clone = amiga_dt_picture_clone, .get_internal = image_cache_get_internal, @@ -54,6 +55,10 @@ static const content_handler amiga_dt_picture_content_handler = { .no_share = false, }; +struct amiga_dt_picture_content { + struct content c; + Object *dto; +}; nserror amiga_dt_picture_init(void) { @@ -100,49 +105,80 @@ nserror amiga_dt_picture_create(const content_handler *handler, llcache_handle *llcache, const char *fallback_charset, bool quirks, struct content **c) { - struct content *adt; + struct amiga_dt_picture_content *adt; nserror error; - adt = calloc(1, sizeof(struct content)); + adt = calloc(1, sizeof(struct amiga_dt_picture_content)); if (adt == NULL) return NSERROR_NOMEM; - error = content__init(adt, handler, imime_type, params, + error = content__init((struct content *)adt, handler, imime_type, params, llcache, fallback_charset, quirks); if (error != NSERROR_OK) { free(adt); return error; } - *c = adt; + *c = (struct content *)adt; return NSERROR_OK; } +Object *amiga_dt_picture_newdtobject(struct amiga_dt_picture_content *adt) +{ + const uint8 *data; + ULONG size; + + if(adt->dto == NULL) { + data = (uint8 *)content__get_source_data((struct content *)adt, &size); + + adt->dto = NewDTObject(NULL, + DTA_SourceType, DTST_MEMORY, + DTA_SourceAddress, data, + DTA_SourceSize, size, + DTA_GroupID, GID_PICTURE, + PDTA_DestMode, PMODE_V43, + TAG_DONE); + } + + return adt->dto; +} + +char *amiga_dt_picture_datatype(struct content *c) +{ + const uint8 *data; + ULONG size; + struct DataType *dt; + char *filetype = NULL; + + data = (uint8 *)content__get_source_data(c, &size); + + if(dt = ObtainDataType(DTST_MEMORY, NULL, + DTA_SourceAddress, data, + DTA_SourceSize, size, + DTA_GroupID, GID_PICTURE, + TAG_DONE)) { + filetype = strdup(dt->dtn_Header->dth_Name); + ReleaseDataType(dt); + } + + if(filetype == NULL) filetype = strdup("DataTypes"); + return filetype; +} + static struct bitmap *amiga_dt_picture_cache_convert(struct content *c) { LOG(("amiga_dt_picture_cache_convert")); union content_msg_data msg_data; - const uint8 *data; UBYTE *bm_buffer; - ULONG size; Object *dto; struct bitmap *bitmap; unsigned int bm_flags = BITMAP_NEW; int bm_format = PBPAFMT_RGBA; + struct amiga_dt_picture_content *adt = (struct amiga_dt_picture_content *)c; - /* This is only relevant for picture datatypes... */ - - data = (uint8 *)content__get_source_data(c, &size); - - if(dto = NewDTObject(NULL, - DTA_SourceType, DTST_MEMORY, - DTA_SourceAddress, data, - DTA_SourceSize, size, - DTA_GroupID, GID_PICTURE, - PDTA_DestMode, PMODE_V43, - TAG_DONE)) + if(dto = amiga_dt_picture_newdtobject(adt)) { bitmap = bitmap_create(c->width, c->height, bm_flags); if (!bitmap) { @@ -158,8 +194,9 @@ static struct bitmap *amiga_dt_picture_cache_convert(struct content *c) 0, 0, c->width, c->height); bitmap_set_opaque(bitmap, bitmap_test_opaque(bitmap)); - + DisposeDTObject(dto); + adt->dto = NULL; } else return NULL; @@ -172,26 +209,15 @@ bool amiga_dt_picture_convert(struct content *c) union content_msg_data msg_data; int width, height; - char title[100]; - const uint8 *data; + char *title; UBYTE *bm_buffer; - ULONG size; Object *dto; struct BitMapHeader *bmh; unsigned int bm_flags = BITMAP_NEW; int bm_format = PBPAFMT_RGBA; + char *filetype; - /* This is only relevant for picture datatypes... */ - - data = (uint8 *)content__get_source_data(c, &size); - - if(dto = NewDTObject(NULL, - DTA_SourceType, DTST_MEMORY, - DTA_SourceAddress, data, - DTA_SourceSize, size, - DTA_GroupID, GID_PICTURE, - PDTA_DestMode, PMODE_V43, - TAG_DONE)) + if(dto = amiga_dt_picture_newdtobject((struct amiga_dt_picture_content *)c)) { if(GetDTAttrs(dto, PDTA_BitMapHeader, &bmh, TAG_DONE)) { @@ -199,8 +225,6 @@ bool amiga_dt_picture_convert(struct content *c) height = (int)bmh->bmh_Height; } else return false; - - DisposeDTObject(dto); } else return false; @@ -208,17 +232,22 @@ bool amiga_dt_picture_convert(struct content *c) c->height = height; c->size = width * height * 4; + /* set title text */ + if(filetype = amiga_dt_picture_datatype(c)) { + title = messages_get_buff("DataTypesTitle", + nsurl_access_leaf(llcache_handle_get_url(c->llcache)), + filetype, c->width, c->height); + if (title != NULL) { + content__set_title(c, title); + free(title); + } + free(filetype); + } + image_cache_add(c, NULL, amiga_dt_picture_cache_convert); -/* - snprintf(title, sizeof(title), "image (%lux%lu, %lu bytes)", - width, height, size); - content__set_title(c, title); -*/ - content_set_ready(c); content_set_done(c); - content_set_status(c, ""); return true; } @@ -254,4 +283,14 @@ nserror amiga_dt_picture_clone(const struct content *old, struct content **newc) return NSERROR_OK; } +static void amiga_dt_picture_destroy(struct content *c) +{ + struct amiga_dt_picture_content *adt = (struct amiga_dt_picture_content *)c; + + DisposeDTObject(adt->dto); + adt->dto = NULL; + + image_cache_destroy(c); +} + #endif diff --git a/amiga/gui.c b/amiga/gui.c index 15ac1f553..37f054776 100755 --- a/amiga/gui.c +++ b/amiga/gui.c @@ -1927,6 +1927,16 @@ void ami_handle_msg(void) ami_update_throbber(gwin, true); refresh_throbber = FALSE; } + + if(ami_menu_window_close) + { + if(ami_menu_window_close == AMI_MENU_WINDOW_CLOSE_ALL) + ami_quit_netsurf(); + else + ami_close_all_tabs(ami_menu_window_close); + + ami_menu_window_close = NULL; + } } void ami_gui_appicon_remove(struct gui_window_2 *gwin) @@ -2276,6 +2286,8 @@ void ami_quit_netsurf(void) } } while(node = nnode); + + win_destroyed = true; } if(IsMinListEmpty(window_list)) diff --git a/amiga/menu.c b/amiga/menu.c index ab8381a44..b116e1b39 100755 --- a/amiga/menu.c +++ b/amiga/menu.c @@ -676,7 +676,7 @@ static void ami_menu_item_project_closewin(struct Hook *hook, APTR window, struc struct gui_window_2 *gwin; GetAttr(WINDOW_UserData, (Object *)window, (ULONG *)&gwin); - ami_close_all_tabs(gwin); + ami_menu_window_close = gwin; } static void ami_menu_item_project_print(struct Hook *hook, APTR window, struct IntuiMessage *msg) @@ -736,7 +736,7 @@ static void ami_menu_item_project_about(struct Hook *hook, APTR window, struct I static void ami_menu_item_project_quit(struct Hook *hook, APTR window, struct IntuiMessage *msg) { - ami_quit_netsurf(); + ami_menu_window_close = AMI_MENU_WINDOW_CLOSE_ALL; } static void ami_menu_item_edit_cut(struct Hook *hook, APTR window, struct IntuiMessage *msg) diff --git a/amiga/menu.h b/amiga/menu.h index 36c601792..d692320a3 100755 --- a/amiga/menu.h +++ b/amiga/menu.h @@ -63,9 +63,14 @@ #define AMI_MENU_CLEAR FULLMENUNUM(1,5,0) #define AMI_MENU_FIND FULLMENUNUM(2,0,0) +/* A special value for ami_menu_window_close */ +#define AMI_MENU_WINDOW_CLOSE_ALL 1 + struct gui_window; struct gui_window_2; +struct gui_window_2 *ami_menu_window_close; + void ami_free_menulabs(struct gui_window_2 *gwin); struct NewMenu *ami_create_menu(struct gui_window_2 *gwin); void ami_menu_refresh(struct gui_window_2 *gwin); diff --git a/amiga/options.h b/amiga/options.h index 977e5aef5..3936c173f 100644 --- a/amiga/options.h +++ b/amiga/options.h @@ -138,7 +138,7 @@ .cookies_window_ypos = 0, \ .cookies_window_xsize = 0, \ .cookies_window_ysize = 0, \ - .cairo_renderer = 1, \ + .cairo_renderer = 0, \ .direct_render = false, \ .window_simple_refresh = false, \ .redraw_tile_size_x = 0, \ |