Merge branch 'master' of git://git.netsurf-browser.org/netsurf into chris/bitmap-fonts

This commit is contained in:
Chris Young 2015-02-22 16:08:13 +00:00
commit 33d16e170e
5 changed files with 36 additions and 24 deletions

View File

@ -29,11 +29,13 @@
#include <gadgets/clicktab.h> #include <gadgets/clicktab.h>
#include <reaction/reaction_macros.h> #include <reaction/reaction_macros.h>
#include "utils/nsoption.h"
#include "desktop/browser.h" #include "desktop/browser.h"
#include "desktop/gui_window.h" #include "desktop/gui_window.h"
#include "desktop/version.h" #include "desktop/version.h"
#include "utils/log.h"
#include "utils/nsoption.h"
#include "amiga/arexx.h" #include "amiga/arexx.h"
#include "amiga/download.h" #include "amiga/download.h"
#include "amiga/gui.h" #include "amiga/gui.h"
@ -140,7 +142,15 @@ void ami_arexx_handle(void)
void ami_arexx_execute(char *script) void ami_arexx_execute(char *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) void ami_arexx_cleanup(void)

View File

@ -176,6 +176,8 @@ nserror ami_mime_init(const char *mimefile)
struct nsObject *node; struct nsObject *node;
struct ami_mime_entry *mimeentry; struct ami_mime_entry *mimeentry;
LOG(("mimetypes file: %s", mimefile));
if(ami_mime_list == NULL) if(ami_mime_list == NULL)
ami_mime_list = NewObjList(); ami_mime_list = NewObjList();

View File

@ -580,13 +580,13 @@ static nserror ami_set_options(struct nsoption_s *defaults)
nsoption_setnull_charp(url_file, nsoption_setnull_charp(url_file,
(char *)strdup(temp)); (char *)strdup(temp));
nsoption_setnull_charp(ca_bundle,
(char *)strdup("PROGDIR:Resources/ca-bundle"));
sprintf(temp, "%s/FontGlyphCache", current_user_dir); sprintf(temp, "%s/FontGlyphCache", current_user_dir);
nsoption_setnull_charp(font_unicode_file, nsoption_setnull_charp(font_unicode_file,
(char *)strdup(temp)); (char *)strdup(temp));
nsoption_setnull_charp(ca_bundle,
(char *)strdup("PROGDIR:Resources/ca-bundle"));
/* font defaults */ /* font defaults */
#ifdef __amigaos4__ #ifdef __amigaos4__
nsoption_setnull_charp(font_sans, (char *)strdup("DejaVu Sans")); nsoption_setnull_charp(font_sans, (char *)strdup("DejaVu Sans"));
@ -1800,7 +1800,6 @@ static void ami_handle_msg(void)
nnode=(struct nsObject *)GetSucc((struct Node *)node); nnode=(struct nsObject *)GetSucc((struct Node *)node);
gwin = node->objstruct; gwin = node->objstruct;
LOG(("Type %d", node->Type));
if(node->Type == AMINS_TVWINDOW) { if(node->Type == AMINS_TVWINDOW) {
if(ami_tree_event((struct treeview_window *)gwin)) { 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; 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) { while((result = RA_HandleInput(gwin->objects[OID_MAIN], &code)) != WMHI_LASTMSG) {
LOG(("%d: %d (switch)",code, result & WMHI_CLASSMASK));
switch(result & WMHI_CLASSMASK) // class switch(result & WMHI_CLASSMASK) // class
{ {
case WMHI_MOUSEMOVE: case WMHI_MOUSEMOVE:
@ -4036,27 +4031,32 @@ gui_window_create(struct browser_window *bw,
g->shared->objects[GID_STATUS] = NewObject( g->shared->objects[GID_STATUS] = NewObject(
NULL, NULL,
"frbuttonclass", "frbuttonclass", /**\todo find appropriate class which works on OS3 */
GA_ID, GID_STATUS, GA_ID, GID_STATUS,
GA_Left, scrn->WBorLeft + 2, GA_Left, scrn->WBorLeft + 2,
GA_RelBottom, -((2 + height + scrn->WBorBottom - scrn->RastPort.TxHeight)/2), GA_RelBottom, -((2 + height + scrn->WBorBottom - scrn->RastPort.TxHeight)/2),
GA_Width, width, GA_Width, width,
GA_Height, 1 + height - scrn->WBorBottom,
GA_DrawInfo, dri, GA_DrawInfo, dri,
GA_BottomBorder, TRUE, GA_BottomBorder, TRUE,
GA_ReadOnly, TRUE, GA_ReadOnly, TRUE,
#ifdef __amigaos4__ GA_Disabled, TRUE,
GA_Image, (struct Image *)NewObject( GA_Image, (struct Image *)NewObject(
NULL, NULL,
#ifdef __amigaos4__
"gaugeiclass", "gaugeiclass",
GAUGEIA_Level, 0,
#else
"frameiclass",
IA_Recessed, TRUE,
#endif
IA_Top, 2 - (scrn->RastPort.TxHeight), IA_Top, 2 - (scrn->RastPort.TxHeight),
IA_Left, -4, IA_Left, -4,
IA_Height, 4 + scrn->RastPort.TxHeight, IA_Height, 1 + height - scrn->WBorBottom,
IA_InBorder, TRUE,
IA_Label, NULL, IA_Label, NULL,
IA_InBorder, TRUE,
IA_Screen, scrn, IA_Screen, scrn,
GAUGEIA_Level, 0,
TAG_DONE), TAG_DONE),
#endif
TAG_DONE); TAG_DONE);
AddGList(g->shared->win, (struct Gadget *)g->shared->objects[GID_STATUS], AddGList(g->shared->win, (struct Gadget *)g->shared->objects[GID_STATUS],
@ -5258,7 +5258,7 @@ Object *ami_gui_splash_open(void)
tattr.ta_Name = "DejaVu Serif Italic.font"; tattr.ta_Name = "DejaVu Serif Italic.font";
#else #else
SetAPen(win->RPort, 3); /* Pen 3 is usually blue */ SetAPen(win->RPort, 3); /* Pen 3 is usually blue */
tattr.ta_Name = "CGTriumvirate.font"; tattr.ta_Name = "ruby.font";
#endif #endif
tattr.ta_YSize = 24; tattr.ta_YSize = 24;
tattr.ta_Style = 0; tattr.ta_Style = 0;
@ -5283,7 +5283,7 @@ Object *ami_gui_splash_open(void)
#ifdef __amigaos4__ #ifdef __amigaos4__
tattr.ta_Name = "DejaVu Sans.font"; tattr.ta_Name = "DejaVu Sans.font";
#else #else
tattr.ta_Name = "CGTriumvirate.font"; tattr.ta_Name = "helvetica.font";
#endif #endif
tattr.ta_YSize = 16; tattr.ta_YSize = 16;
tattr.ta_Style = 0; tattr.ta_Style = 0;

View File

@ -264,8 +264,9 @@ static void ami_plot_setopen(struct RastPort *rp, ULONG colr)
void ami_plot_clear_bbox(struct RastPort *rp, struct IBox *bbox) void ami_plot_clear_bbox(struct RastPort *rp, struct IBox *bbox)
{ {
ami_plot_setapen(rp, 0xffffffff); if((bbox == NULL) || (rp == NULL)) return;
RectFill(rp, bbox->Left, bbox->Top,
EraseRect(rp, bbox->Left, bbox->Top,
bbox->Width + bbox->Left, bbox->Height + bbox->Top); bbox->Width + bbox->Left, bbox->Height + bbox->Top);
} }

View File

@ -934,10 +934,9 @@ static bool textarea_reflow_multiline(struct textarea *ta,
assert(ta->flags & TEXTAREA_MULTILINE); assert(ta->flags & TEXTAREA_MULTILINE);
if (ta->lines == NULL) { if (ta->lines == NULL) {
ta->lines = ta->lines = calloc(sizeof(struct line_info), LINE_CHUNK_SIZE);
malloc(LINE_CHUNK_SIZE * sizeof(struct line_info));
if (ta->lines == NULL) { if (ta->lines == NULL) {
LOG(("malloc failed")); LOG(("Failed to allocate memory for textarea lines"));
return false; return false;
} }
ta->lines_alloc_size = LINE_CHUNK_SIZE; ta->lines_alloc_size = LINE_CHUNK_SIZE;