From 0e75f9909e7b3ede53ae45407a2884d71efae5b9 Mon Sep 17 00:00:00 2001 From: Chris Young Date: Wed, 4 Feb 2015 00:48:47 +0000 Subject: Fix status bar tags --- amiga/gui.c | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/amiga/gui.c b/amiga/gui.c index f13b5672c..134d8a114 100644 --- a/amiga/gui.c +++ b/amiga/gui.c @@ -4041,22 +4041,27 @@ gui_window_create(struct browser_window *bw, GA_Left, scrn->WBorLeft + 2, GA_RelBottom, -((2 + height + scrn->WBorBottom - scrn->RastPort.TxHeight)/2), GA_Width, width, + GA_Height, height - scrn->WBorBottom, GA_DrawInfo, dri, GA_BottomBorder, TRUE, GA_ReadOnly, TRUE, -#ifdef __amigaos4__ + GA_Disabled, TRUE, GA_Image, (struct Image *)NewObject( NULL, +#ifdef __amigaos4__ "gaugeiclass", + GAUGEIA_Level, 0, +#else + "frameiclass", + IA_Recessed, TRUE, +#endif IA_Top, 2 - (scrn->RastPort.TxHeight), IA_Left, -4, - IA_Height, 4 + scrn->RastPort.TxHeight, - IA_InBorder, TRUE, + IA_Height, height - scrn->WBorBottom, IA_Label, NULL, + IA_InBorder, TRUE, IA_Screen, scrn, - GAUGEIA_Level, 0, TAG_DONE), -#endif TAG_DONE); AddGList(g->shared->win, (struct Gadget *)g->shared->objects[GID_STATUS], -- cgit v1.2.1 From 79a4466479fe050c2cee19179d85fd051f5011f5 Mon Sep 17 00:00:00 2001 From: Chris Young Date: Thu, 5 Feb 2015 18:51:41 +0000 Subject: Attempt to fix graphical corruption on OS3 --- amiga/gui.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/amiga/gui.c b/amiga/gui.c index 134d8a114..fe4d3c578 100644 --- a/amiga/gui.c +++ b/amiga/gui.c @@ -4660,6 +4660,10 @@ static void ami_do_redraw(struct gui_window_2 *gwin) if(nsoption_bool(direct_render) == false) { +#ifndef __amigaos4__ + /* Try to avoid some overprinting - might need glob->rp clearing instead */ + ami_plot_clear_box(gwin->win->RPort, bbox); +#endif ami_do_redraw_tiled(gwin, true, hcurrent, vcurrent, width, height, hcurrent, vcurrent, bbox, &ctx); } else -- cgit v1.2.1 From ed9902fcbcfa769e74a672a694956aed0b7744d3 Mon Sep 17 00:00:00 2001 From: Chris Young Date: Thu, 5 Feb 2015 18:54:39 +0000 Subject: Use bitmap fonts on the splash screen for OS3 --- amiga/gui.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/amiga/gui.c b/amiga/gui.c index fe4d3c578..68c159af8 100644 --- a/amiga/gui.c +++ b/amiga/gui.c @@ -5267,7 +5267,7 @@ Object *ami_gui_splash_open(void) tattr.ta_Name = "DejaVu Serif Italic.font"; #else SetAPen(win->RPort, 3); /* Pen 3 is usually blue */ - tattr.ta_Name = "CGTriumvirate.font"; + tattr.ta_Name = "ruby.font"; #endif tattr.ta_YSize = 24; tattr.ta_Style = 0; @@ -5292,7 +5292,7 @@ Object *ami_gui_splash_open(void) #ifdef __amigaos4__ tattr.ta_Name = "DejaVu Sans.font"; #else - tattr.ta_Name = "CGTriumvirate.font"; + tattr.ta_Name = "helvetica.font"; #endif tattr.ta_YSize = 16; tattr.ta_Style = 0; -- cgit v1.2.1 From c2a79e7b503616209389abc16bc54058264a20a7 Mon Sep 17 00:00:00 2001 From: Chris Young Date: Thu, 5 Feb 2015 18:57:24 +0000 Subject: Make the status bar a pixel taller --- amiga/gui.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/amiga/gui.c b/amiga/gui.c index 68c159af8..f72a039ad 100644 --- a/amiga/gui.c +++ b/amiga/gui.c @@ -4041,7 +4041,7 @@ gui_window_create(struct browser_window *bw, GA_Left, scrn->WBorLeft + 2, GA_RelBottom, -((2 + height + scrn->WBorBottom - scrn->RastPort.TxHeight)/2), GA_Width, width, - GA_Height, height - scrn->WBorBottom, + GA_Height, 1 + height - scrn->WBorBottom, GA_DrawInfo, dri, GA_BottomBorder, TRUE, GA_ReadOnly, TRUE, @@ -4057,7 +4057,7 @@ gui_window_create(struct browser_window *bw, #endif IA_Top, 2 - (scrn->RastPort.TxHeight), IA_Left, -4, - IA_Height, height - scrn->WBorBottom, + IA_Height, 1 + height - scrn->WBorBottom, IA_Label, NULL, IA_InBorder, TRUE, IA_Screen, scrn, -- cgit v1.2.1 From d8b91982114e550e7f9167f5cd984b41a0eac2eb Mon Sep 17 00:00:00 2001 From: Chris Young Date: Thu, 5 Feb 2015 19:00:13 +0000 Subject: typo --- amiga/gui.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/amiga/gui.c b/amiga/gui.c index f72a039ad..ed7327951 100644 --- a/amiga/gui.c +++ b/amiga/gui.c @@ -4662,7 +4662,7 @@ static void ami_do_redraw(struct gui_window_2 *gwin) { #ifndef __amigaos4__ /* Try to avoid some overprinting - might need glob->rp clearing instead */ - ami_plot_clear_box(gwin->win->RPort, bbox); + ami_plot_clear_bbox(gwin->win->RPort, bbox); #endif ami_do_redraw_tiled(gwin, true, hcurrent, vcurrent, width, height, hcurrent, vcurrent, bbox, &ctx); } -- cgit v1.2.1 From 26a9c4fa07e1b511355d54e4d232ec99704f099f Mon Sep 17 00:00:00 2001 From: Chris Young Date: Wed, 11 Feb 2015 18:24:51 +0000 Subject: Avoid RectFilling a 0 size area --- amiga/gui.c | 4 ++-- amiga/plotters.c | 2 ++ 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/amiga/gui.c b/amiga/gui.c index ed7327951..de78977be 100644 --- a/amiga/gui.c +++ b/amiga/gui.c @@ -4036,7 +4036,7 @@ gui_window_create(struct browser_window *bw, g->shared->objects[GID_STATUS] = NewObject( NULL, - "frbuttonclass", + "frbuttonclass", /**\todo find appropriate class which works on OS3 */ GA_ID, GID_STATUS, GA_Left, scrn->WBorLeft + 2, GA_RelBottom, -((2 + height + scrn->WBorBottom - scrn->RastPort.TxHeight)/2), @@ -4662,7 +4662,7 @@ static void ami_do_redraw(struct gui_window_2 *gwin) { #ifndef __amigaos4__ /* Try to avoid some overprinting - might need glob->rp clearing instead */ - ami_plot_clear_bbox(gwin->win->RPort, bbox); + ami_plot_clear_bbox(&browserglob.rp, bbox); #endif ami_do_redraw_tiled(gwin, true, hcurrent, vcurrent, width, height, hcurrent, vcurrent, bbox, &ctx); } diff --git a/amiga/plotters.c b/amiga/plotters.c index 9455d1cde..f12bff3c5 100644 --- a/amiga/plotters.c +++ b/amiga/plotters.c @@ -264,6 +264,8 @@ static void ami_plot_setopen(struct RastPort *rp, ULONG colr) void ami_plot_clear_bbox(struct RastPort *rp, struct IBox *bbox) { + if((bbox->Width == 0) || (bbox->Height == 0)) return; + ami_plot_setapen(rp, 0xffffffff); RectFill(rp, bbox->Left, bbox->Top, bbox->Width+bbox->Left, bbox->Height+bbox->Top); -- cgit v1.2.1 From 3dc8de9be270fbf51e77944d7c3ee03496af296f Mon Sep 17 00:00:00 2001 From: Chris Young Date: Thu, 12 Feb 2015 23:18:41 +0000 Subject: Check for NULL --- amiga/plotters.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/amiga/plotters.c b/amiga/plotters.c index f12bff3c5..a692b0813 100644 --- a/amiga/plotters.c +++ b/amiga/plotters.c @@ -264,11 +264,12 @@ static void ami_plot_setopen(struct RastPort *rp, ULONG colr) void ami_plot_clear_bbox(struct RastPort *rp, struct IBox *bbox) { + if((bbox == NULL) || (rp == NULL)) return; if((bbox->Width == 0) || (bbox->Height == 0)) return; ami_plot_setapen(rp, 0xffffffff); RectFill(rp, bbox->Left, bbox->Top, - bbox->Width+bbox->Left, bbox->Height+bbox->Top); + bbox->Width + bbox->Left, bbox->Height + bbox->Top); } -- cgit v1.2.1 From 6c7a3c3a73c4dbc6946f8998aa5887921644636c Mon Sep 17 00:00:00 2001 From: Chris Young Date: Fri, 13 Feb 2015 18:34:08 +0000 Subject: Clear the window using the BackFill hook --- amiga/plotters.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/amiga/plotters.c b/amiga/plotters.c index a692b0813..443077b58 100644 --- a/amiga/plotters.c +++ b/amiga/plotters.c @@ -265,10 +265,8 @@ static void ami_plot_setopen(struct RastPort *rp, ULONG colr) void ami_plot_clear_bbox(struct RastPort *rp, struct IBox *bbox) { if((bbox == NULL) || (rp == NULL)) return; - if((bbox->Width == 0) || (bbox->Height == 0)) return; - ami_plot_setapen(rp, 0xffffffff); - RectFill(rp, bbox->Left, bbox->Top, + EraseRect(rp, bbox->Left, bbox->Top, bbox->Width + bbox->Left, bbox->Height + bbox->Top); } -- cgit v1.2.1 From bc1d98046af3be6e66488cc38a82b8be69fca6d5 Mon Sep 17 00:00:00 2001 From: Chris Young Date: Sun, 15 Feb 2015 11:27:27 +0000 Subject: Remove some unnecessary OS3-only code --- amiga/gui.c | 4 ---- 1 file changed, 4 deletions(-) diff --git a/amiga/gui.c b/amiga/gui.c index de78977be..2f2524fe1 100644 --- a/amiga/gui.c +++ b/amiga/gui.c @@ -4660,10 +4660,6 @@ static void ami_do_redraw(struct gui_window_2 *gwin) if(nsoption_bool(direct_render) == false) { -#ifndef __amigaos4__ - /* Try to avoid some overprinting - might need glob->rp clearing instead */ - ami_plot_clear_bbox(&browserglob.rp, bbox); -#endif ami_do_redraw_tiled(gwin, true, hcurrent, vcurrent, width, height, hcurrent, vcurrent, bbox, &ctx); } else -- cgit v1.2.1 From b89fb480db3e3cf41ef68e858e24f9cb378e952a Mon Sep 17 00:00:00 2001 From: Chris Young Date: Sun, 15 Feb 2015 11:29:03 +0000 Subject: Debug logging --- amiga/arexx.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/amiga/arexx.c b/amiga/arexx.c index 65f1ebab5..183b8fc98 100644 --- a/amiga/arexx.c +++ b/amiga/arexx.c @@ -29,11 +29,13 @@ #include #include -#include "utils/nsoption.h" #include "desktop/browser.h" #include "desktop/gui_window.h" #include "desktop/version.h" +#include "utils/log.h" +#include "utils/nsoption.h" + #include "amiga/arexx.h" #include "amiga/download.h" #include "amiga/gui.h" @@ -140,6 +142,7 @@ void ami_arexx_handle(void) void ami_arexx_execute(char *script) { + LOG(("Executing script: %s", script)); IDoMethod(arexx_obj, AM_EXECUTE, script, NULL, NULL, NULL, NULL, NULL); } -- cgit v1.2.1 From 555276b04afa0070f3c0787cde79a09c83d32148 Mon Sep 17 00:00:00 2001 From: Michael Drake Date: Sun, 15 Feb 2015 13:48:27 +0000 Subject: Ensure line lengths cache is created initialised to zero. --- desktop/textarea.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/desktop/textarea.c b/desktop/textarea.c index ece529e48..573da1d1d 100644 --- a/desktop/textarea.c +++ b/desktop/textarea.c @@ -934,10 +934,9 @@ static bool textarea_reflow_multiline(struct textarea *ta, assert(ta->flags & TEXTAREA_MULTILINE); if (ta->lines == NULL) { - ta->lines = - malloc(LINE_CHUNK_SIZE * sizeof(struct line_info)); + ta->lines = calloc(sizeof(struct line_info), LINE_CHUNK_SIZE); if (ta->lines == NULL) { - LOG(("malloc failed")); + LOG(("Failed to allocate memory for textarea lines")); return false; } ta->lines_alloc_size = LINE_CHUNK_SIZE; -- cgit v1.2.1 From 90d88f32d126fae1de2f8984f5d55d7a72f98578 Mon Sep 17 00:00:00 2001 From: Chris Young Date: Sat, 21 Feb 2015 12:21:14 +0000 Subject: Expand ARexx script locations on NetSurf's process. This resolves a problem with scripts sometimes not running when they are relative to PROGDIR: and stops PROGDIR: being requested under OS3. Fixes #2271 --- amiga/arexx.c | 11 +++++++++-- amiga/gui.c | 6 +++--- 2 files changed, 12 insertions(+), 5 deletions(-) diff --git a/amiga/arexx.c b/amiga/arexx.c index 183b8fc98..3b386d3ad 100644 --- a/amiga/arexx.c +++ b/amiga/arexx.c @@ -142,8 +142,15 @@ void ami_arexx_handle(void) void ami_arexx_execute(char *script) { - LOG(("Executing script: %s", script)); - IDoMethod(arexx_obj, AM_EXECUTE, script, NULL, NULL, NULL, NULL, NULL); + char full_script_path[1025]; + BPTR lock; + + if(lock = Lock(script, ACCESS_READ)) { + DevNameFromLock(lock, full_script_path, 1024, DN_FULLPATH); + LOG(("Executing script: %s", full_script_path)); + IDoMethod(arexx_obj, AM_EXECUTE, full_script_path, NULL, NULL, NULL, NULL, NULL); + UnLock(lock); + } } void ami_arexx_cleanup(void) diff --git a/amiga/gui.c b/amiga/gui.c index 2f2524fe1..c1169b947 100644 --- a/amiga/gui.c +++ b/amiga/gui.c @@ -580,13 +580,13 @@ static nserror ami_set_options(struct nsoption_s *defaults) nsoption_setnull_charp(url_file, (char *)strdup(temp)); - nsoption_setnull_charp(ca_bundle, - (char *)strdup("PROGDIR:Resources/ca-bundle")); - sprintf(temp, "%s/FontGlyphCache", current_user_dir); nsoption_setnull_charp(font_unicode_file, (char *)strdup(temp)); + nsoption_setnull_charp(ca_bundle, + (char *)strdup("PROGDIR:Resources/ca-bundle")); + /* font defaults */ #ifdef __amigaos4__ nsoption_setnull_charp(font_sans, (char *)strdup("DejaVu Sans")); -- cgit v1.2.1 From 8b82e926fde72b4f1becb04f12335cacc280c592 Mon Sep 17 00:00:00 2001 From: Chris Young Date: Sat, 21 Feb 2015 12:29:03 +0000 Subject: debug --- amiga/filetype.c | 2 ++ amiga/gui.c | 5 ----- 2 files changed, 2 insertions(+), 5 deletions(-) diff --git a/amiga/filetype.c b/amiga/filetype.c index b37ebe58d..aa3e29620 100644 --- a/amiga/filetype.c +++ b/amiga/filetype.c @@ -176,6 +176,8 @@ nserror ami_mime_init(const char *mimefile) struct nsObject *node; struct ami_mime_entry *mimeentry; + LOG(("mimetypes file: %s", mimefile)); + if(ami_mime_list == NULL) ami_mime_list = NewObjList(); diff --git a/amiga/gui.c b/amiga/gui.c index c1169b947..f49dc0666 100644 --- a/amiga/gui.c +++ b/amiga/gui.c @@ -1800,7 +1800,6 @@ static void ami_handle_msg(void) nnode=(struct nsObject *)GetSucc((struct Node *)node); gwin = node->objstruct; - LOG(("Type %d", node->Type)); if(node->Type == AMINS_TVWINDOW) { if(ami_tree_event((struct treeview_window *)gwin)) { @@ -1863,11 +1862,7 @@ static void ami_handle_msg(void) if((gwin == NULL) || (gwin->objects[OID_MAIN] == NULL)) continue; - LOG(("RA_HandleInput(%p,%p) (gwin=%p)", gwin->objects[OID_MAIN], &code, gwin)); - while((result = RA_HandleInput(gwin->objects[OID_MAIN], &code)) != WMHI_LASTMSG) { - LOG(("%d: %d (switch)",code, result & WMHI_CLASSMASK)); - switch(result & WMHI_CLASSMASK) // class { case WMHI_MOUSEMOVE: -- cgit v1.2.1