28#include <proto/application.h>
31#include <proto/datatypes.h>
32#include <proto/diskfont.h>
34#include <proto/exec.h>
35#include <proto/graphics.h>
36#include <proto/icon.h>
37#include <proto/intuition.h>
38#include <proto/keymap.h>
39#include <proto/layers.h>
40#include <proto/locale.h>
41#include <proto/utility.h>
46#include <proto/bsdsocket.h>
47#define waitselect WaitSelect
51#include <datatypes/textclass.h>
52#include <devices/inputevent.h>
53#include <graphics/gfxbase.h>
54#include <graphics/rpattr.h>
56#include <diskfont/diskfonttag.h>
57#include <graphics/blitattr.h>
58#include <intuition/gui.h>
59#include <libraries/application.h>
60#include <libraries/keymap.h>
62#include <intuition/icclass.h>
63#include <intuition/screens.h>
64#include <libraries/gadtools.h>
65#include <workbench/workbench.h>
68#include <proto/bevel.h>
69#include <proto/bitmap.h>
70#include <proto/button.h>
71#include <proto/chooser.h>
72#include <proto/clicktab.h>
73#include <proto/label.h>
74#include <proto/layout.h>
75#include <proto/listbrowser.h>
76#include <proto/scroller.h>
77#include <proto/space.h>
78#include <proto/speedbar.h>
79#include <proto/string.h>
80#include <proto/window.h>
82#include <classes/window.h>
83#include <gadgets/button.h>
84#include <gadgets/chooser.h>
85#include <gadgets/clicktab.h>
86#include <gadgets/layout.h>
87#include <gadgets/listbrowser.h>
88#include <gadgets/scroller.h>
89#include <gadgets/space.h>
90#include <gadgets/speedbar.h>
91#include <gadgets/string.h>
92#include <images/bevel.h>
93#include <images/bitmap.h>
94#include <images/label.h>
96#include <reaction/reaction_macros.h>
166#define AMINS_SCROLLERPEN NUMDRIPENS
167#define NSA_KBD_SCROLL_PX 10
168#define NSA_MAX_HOTLIST_BUTTON_LEN 20
170#define SCROLL_TOP INT_MIN
171#define SCROLL_PAGE_UP (INT_MIN + 1)
172#define SCROLL_PAGE_DOWN (INT_MAX - 1)
173#define SCROLL_BOTTOM (INT_MAX)
176#define SIDEDOWN (IECODE_4TH_BUTTON)
177#define SIDEUP (IECODE_4TH_BUTTON | IECODE_UP_PREFIX)
178#define EXTRADOWN (IECODE_5TH_BUTTON)
179#define EXTRAUP (IECODE_5TH_BUTTON | IECODE_UP_PREFIX)
182#define NSA_QUAL_SHIFT (IEQUALIFIER_RSHIFT | IEQUALIFIER_LSHIFT)
183#define NSA_QUAL_ALT (IEQUALIFIER_RALT | IEQUALIFIER_LALT)
186#define NSA_STATUS_TEXT GA_Text
188#define NSA_STATUS_TEXT STRINGA_TextVal
192#define BOOL_MISMATCH(a,b) ((a == FALSE) && (b != FALSE)) || ((a != FALSE) && (b == FALSE))
194#define BOOL_MISMATCH(a,b) (1)
327static struct Screen *
scrn = NULL;
336static Class *urlStringClass;
354#define USERS_DIR "PROGDIR:Users"
361const char *
const versvn;
372 const char *restrict file,
const char *restrict map);
382HOOKF(
uint32, ami_set_favicon_render_hook, APTR, space,
struct gpRender *);
383HOOKF(
uint32, ami_set_throbber_render_hook, APTR, space,
struct gpRender *);
384HOOKF(
uint32, ami_gui_browser_render_hook, APTR, space,
struct gpRender *);
387#define nsoption_default_set_int(OPTION, VALUE) \
388 if (nsoptions_default[NSOPTION_##OPTION].value.i == nsoptions[NSOPTION_##OPTION].value.i) \
389 nsoptions[NSOPTION_##OPTION].value.i = VALUE; \
390 nsoptions_default[NSOPTION_##OPTION].value.i = VALUE
395 assert(
sport != NULL);
428 assert(gwin != NULL);
446 assert(gwin != NULL);
453 assert(gw->
shared != NULL);
471 assert(gwin != NULL);
477 assert(gwin != NULL);
539 assert(gwin != NULL);
541 switch(object_type) {
573 assert(gwin != NULL);
586 assert(gw->
shared != NULL);
601 assert(gwin != NULL);
607 assert(gwin != NULL);
613 assert(gwin != NULL);
619 assert(gwin != NULL);
625 assert(gwin != NULL);
631 assert(gwin != NULL);
637 assert(gwin != NULL);
644static void *ami_find_gwin_by_id(
struct Window *win,
uint32 type)
662 }
while((node = nnode));
672 LockLayerInfo(&
scrn->LayerInfo);
674 layer = WhichLayer(&
scrn->LayerInfo,
scrn->MouseX,
scrn->MouseY);
676 UnlockLayerInfo(&
scrn->LayerInfo);
678 if(layer)
return ami_find_gwin_by_id(layer->Window,
type);
705 struct Locale *locale;
706 STRPTR acceptlangs = NULL;
707 char *remapped = NULL;
709 if((locale = OpenLocale(NULL)))
711 if(codeset != NULL) *codeset = locale->loc_CodeSet;
713 for(
int i = 0; i < 10; i++)
715 if(locale->loc_PrefLanguages[i])
718 locale->loc_PrefLanguages[i],
"LangNames"))
722 STRPTR acceptlangs2 = acceptlangs;
723 acceptlangs =
ASPrintf(
"%s, %s",acceptlangs2, remapped);
724 FreeVec(acceptlangs2);
729 acceptlangs =
ASPrintf(
"%s", remapped);
732 if(remapped != NULL) free(remapped);
745 const char *restrict file,
const char *restrict map)
748 char *mapfile = NULL;
749 size_t mapfile_size = 0;
751 char *restrict realfname;
756 if(mapfile == NULL)
return false;
758 fh =
FOpen(mapfile, MODE_OLDFILE, 0);
761 while(FGets(fh,
buffer, 1024) != 0)
765 (
buffer[0] ==
'\0'))
continue;
767 realfname = strchr(
buffer,
':');
770 if(strncmp(
buffer, file, strlen(file)) == 0)
772 if(realfname[strlen(realfname)-1] ==
'\n')
773 realfname[strlen(realfname)-1] =
'\0';
774 *remapped = strdup(realfname + 1);
783 if(found ==
false) *remapped = strdup(file);
784 else NSLOG(netsurf, INFO,
785 "Remapped %s to %s in path %s using %s", file,
786 *remapped,
path, map);
798 size_t fullpath_len = 1024;
803 lock = Lock(fullpath, ACCESS_READ);
809 if(found)
NSLOG(netsurf, INFO,
"Found %s", fullpath);
817 struct Locale *locale;
820 char *remapped = NULL;
821 size_t fullpath_len = 1024;
828 if(found)
return true;
835 if(found)
return true;
840 locale = OpenLocale(NULL);
843 strcpy(fullpath,
"PROGDIR:Resources/");
845 if(locale->loc_PrefLanguages[i]) {
847 locale->loc_PrefLanguages[i],
"LangNames") ==
true) {
863 strcpy(fullpath,
"PROGDIR:Resources/en/");
872 strcpy(fullpath,
"PROGDIR:Resources/");
897 TAG_DONE)))
return false;
901 TAG_DONE)))
return false;
905 TAG_DONE)))
return false;
919 LONG scrollerfillpen = FALSE;
921 GetGUIAttrs(NULL, drinfo, GUIA_PropKnobColor, &scrollerfillpen, TAG_DONE);
923 if(scrollerfillpen)
return FILLPEN;
924 else return FOREGROUNDPEN;
937 struct Screen *screen,
941 struct DrawInfo *drinfo;
950 drinfo = GetScreenDrawInfo(screen);
956 GetRGB32(screen->ViewPort.ColorMap, drinfo->dri_Pens[pen], 1, (ULONG *)&colr);
959 def_colour = ((colr[0] & 0xff000000) >> 24) |
960 ((colr[1] & 0xff000000) >> 16) |
961 ((colr[2] & 0xff000000) >> 8);
963 FreeScreenDrawInfo(screen, drinfo);
989 int width = screen->Width / 2;
990 int height = screen->Height / 2;
991 int top = (screen->Height / 2) - (
height / 2);
992 int left = (screen->Width / 2) - (
width / 2);
1034 colour_option_from_pen(INACTIVEFILLTEXTPEN, NSOPTION_sys_colour_InactiveCaptionText, screen, 0x00cccccc);
1063 STRPTR tempacceptlangs;
1073 if(ClickTabBase->lib_Version < 53)
1083 (
char *)strdup(tempacceptlangs));
1084 FreeVec(tempacceptlangs);
1095 if(codeset == 0) codeset = 4;
1110 (
char *)strdup(temp));
1114 (
char *)strdup(temp));
1118 (
char *)strdup(temp));
1122 (
char *)strdup(temp));
1125 (
char *)strdup(
"PROGDIR:Resources/ca-bundle"));
1158 if((lock = Lock(
"FONTS:Code2000.otag", ACCESS_READ)))
1162 (
char *)strdup(
"Code2000"));
1164 else if((lock = Lock(
"FONTS:Bitstream Cyberbit.otag", ACCESS_READ)))
1168 (
char *)strdup(
"Bitstream Cyberbit"));
1178 if((lock = Lock(
"FONTS:Symbola.otag", ACCESS_READ))) {
1181 (
char *)strdup(
"Symbola"));
1194 if(((lock = Lock(
"ENVARC:AppPaths",SHARED_LOCK)) == 0))
1196 lock = CreateDir(
"ENVARC:AppPaths");
1201 if((lock = Lock(
"PROGDIR:", ACCESS_READ)))
1203 char filename[1024];
1208 if((amiupdatefh =
FOpen(
"ENVARC:AppPaths/NetSurf", MODE_NEWFILE, 0))) {
1209 FPuts(amiupdatefh, (CONST_STRPTR)&filename);
1230HOOKF(
void, ami_gui_newprefs_hook, APTR, window, APTR)
1253 struct ScreenModeRequester *screenmodereq = NULL;
1255 if((screenmodereq = AllocAslRequest(ASL_ScreenModeRequest,NULL))) {
1256 if(AslRequestTags(screenmodereq,
1261 char *modeid = malloc(20);
1262 id = screenmodereq->sm_DisplayID;
1263 sprintf(modeid,
"0x%lx",
id);
1267 FreeAslRequest(screenmodereq);
1273 scrn = OpenScreenTags(NULL,
1277 SA_Type, PUBLICSCREEN,
1278 SA_PubName,
"NetSurf",
1280 SA_PubTask, FindTask(0),
1281 SA_LikeWorkbench, TRUE,
1287 PubScreenStatus(
scrn,0);
1294 if((
scrn = LockPubScreen(
"NetSurf")))
1301 strdup(
"Workbench"));
1312 scrn = LockPubScreen(
"Workbench");
1330 int *restrict nargc,
char ** nargv)
1332 struct RDArgs *args;
1333 CONST_STRPTR
template =
"-v/S,NSOPTS/M,URL/K,USERSDIR/K,FORCE/S";
1334 long rarray[] = {0,0,0,0,0};
1344 if(*argc == 0)
return NULL;
1346 if((args = ReadArgs(
template, rarray, NULL))) {
1348 NSLOG(netsurf, INFO,
1349 "URL %s specified on command line",
1350 (
char *)rarray[A_URL]);
1354 if(rarray[A_USERSDIR]) {
1355 NSLOG(netsurf, INFO,
1356 "USERSDIR %s specified on command line",
1357 (
char *)rarray[A_USERSDIR]);
1361 if(rarray[A_FORCE]) {
1362 NSLOG(netsurf, INFO,
1363 "FORCE specified on command line");
1367 if(rarray[A_NSOPTS]) {
1383 NSLOG(netsurf, INFO,
"ReadArgs failed to parse command line");
1392 struct DiskObject *dobj;
1395 char *current_user = NULL;
1397 if((*wbarg->wa_Name) && (dobj = GetDiskObject(wbarg->wa_Name))) {
1398 toolarray = (STRPTR *)dobj->do_ToolTypes;
1400 if((s = (
char *)FindToolType(toolarray,
"USERSDIR")))
users_dir =
ASPrintf(
"%s", s);
1401 if((s = (
char *)FindToolType(toolarray,
"USER"))) current_user =
ASPrintf(
"%s", s);
1403 FreeDiskObject(dobj);
1405 return current_user;
1410 struct WBStartup *WBenchMsg;
1411 struct WBArg *wbarg;
1413 char *current_user = NULL;
1414 char *cur_user = NULL;
1417 WBenchMsg = (
struct WBStartup *)argv;
1418 for(i = 0, wbarg = WBenchMsg->sm_ArgList; i < WBenchMsg->sm_NumArgs; i++,wbarg++) {
1420 if((wbarg->wa_Lock) && (*wbarg->wa_Name))
1424 if(cur_user != NULL) {
1425 if(current_user != NULL) FreeVec(current_user);
1426 current_user = cur_user;
1433 return current_user;
1438 struct Screen *screen;
1439 BOOL notalreadyrunning;
1448 if((screen = LockPubScreen(
"Workbench"))) {
1450 UnlockPubScreen(NULL, screen);
1461 if (notalreadyrunning &&
1466 notalreadyrunning = TRUE;
1487 struct WBStartup *WBenchMsg = (
struct WBStartup *)argv;
1488 struct WBArg *wbarg;
1490 char fullpath[1024];
1492 for(i=0,wbarg=WBenchMsg->sm_ArgList;i<WBenchMsg->sm_NumArgs;i++,wbarg++)
1495 if((wbarg->wa_Lock)&&(*wbarg->wa_Name))
1498 AddPart(fullpath,wbarg->wa_Name,1024);
1508 if(notalreadyrunning)
1548 if(!notalreadyrunning)
1550 STRPTR sendcmd = NULL;
1551 char newtab[11] =
"\0";
1554 strcpy(newtab,
"TAB ACTIVE");
1578 ULONG noicon = TAG_IGNORE;
1581 noicon = REGAPP_NoIcon;
1584 REGAPP_URLIdentifier,
"netsurf-browser.org",
1585 REGAPP_WBStartup, (
struct WBStartup *)argv,
1587 REGAPP_HasPrefsWindow, TRUE,
1588 REGAPP_CanCreateNewDocs, TRUE,
1589 REGAPP_UniqueApplication, TRUE,
1597 REGAPP_URLIdentifier,
"netsurf-browser.org",
1598 REGAPP_FileName, argv[0],
1599 REGAPP_NoIcon, TRUE,
1600 REGAPP_HasPrefsWindow, TRUE,
1601 REGAPP_CanCreateNewDocs, TRUE,
1602 REGAPP_UniqueApplication, TRUE,
1629 long back=FALSE, forward=FALSE, tabclose=FALSE, stop=FALSE,
reload=FALSE;
1630 long s_back, s_forward, s_tabclose, s_stop, s_reload;
1645 if(gwin->
tabs <= 1) {
1660 gwin->
win, NULL, GA_Disabled, back, TAG_DONE);
1664 gwin->
win, NULL, GA_Disabled, forward, TAG_DONE);
1668 gwin->
win, NULL, GA_Disabled,
reload, TAG_DONE);
1672 gwin->
win, NULL, GA_Disabled, stop, TAG_DONE);
1674 if(ClickTabBase->lib_Version < 53) {
1675 if(gwin->
tabs <= 1) tabclose = TRUE;
1681 gwin->
win, NULL, GA_Disabled, tabclose, TAG_DONE);
1707 int nskey = 0, chars;
1711 if(keycode >= IECODE_UP_PREFIX)
return 0;
1793 if((chars = MapRawKey(ie,
buffer,20,NULL)) > 0) {
1798 if(ie->ie_Qualifier & IEQUALIFIER_RCOMMAND) {
1832 GetAttr(WINDOW_Qualifier, win_obj, (
uint32 *)&quals);
1834#warning qualifier needs fixing for OS3
1841 if(quals & IEQUALIFIER_CONTROL) {
1862 *bbox = malloc(
sizeof(
struct IBox));
1864 GetAttr(SPACE_RenderBox, obj, (ULONG *)*bbox);
1868 GetAttr(SPACE_AreaBox, obj, (ULONG *)bbox);
1885 int *restrict x,
int *restrict y,
int space_x,
int space_y)
1909 ns_x = (ULONG)(
mouse_x - bbox->Left);
1910 ns_y = (ULONG)(
mouse_y - bbox->Top);
1912 if((ns_x < 0) || (ns_x > bbox->Width) || (ns_y < 0) || (ns_y > bbox->Height))
2003 struct IBox *bbox, *ibox;
2005 ibox = malloc(
sizeof(
struct IBox));
2006 if(ibox == NULL)
return NULL;
2014 ibox->Left = gwin->
win->MouseX + (
rect->
x0);
2015 ibox->Top = gwin->
win->MouseY + (
rect->
y0);
2020 if(ibox->Left < bbox->Left) ibox->Left = bbox->Left;
2021 if(ibox->Top < bbox->Top) ibox->Top = bbox->Top;
2023 if((ibox->Left > (bbox->Left + bbox->Width)) ||
2024 (ibox->Top > (bbox->Top + bbox->Height)) ||
2025 (ibox->Width < 0) || (ibox->Height < 0))
2049 SetWindowAttrs(gwin->
win, WA_GrabFocus, 10,
2050 WA_MouseLimits, gwin->
ptr_lock, TAG_DONE);
2075 }
while((node = nnode));
2089 int *restrict
width,
2102 *
width = bbox->Width;
2114 struct TagItem attrs[2];
2118 attrs[0].ti_Tag = CHILD_MinWidth;
2119 attrs[0].ti_Data = 0;
2120 attrs[1].ti_Tag = TAG_DONE;
2121 attrs[1].ti_Data = 0;
2126 SCROLLER_Orientation, SORIENT_HORIZ,
2127 ICA_TARGET, ICTARGET_IDCMP,
2160 struct TagItem attrs[2];
2164 attrs[0].ti_Tag = CHILD_MinWidth;
2165 attrs[0].ti_Data = 0;
2166 attrs[1].ti_Tag = TAG_DONE;
2167 attrs[1].ti_Data = 0;
2172 ICA_TARGET, ICTARGET_IDCMP,
2210 int h = 1, w = 1, wh = 0, ww = 0;
2211 bool rethinkv =
false;
2212 bool rethinkh =
false;
2241 if(rethinkv || rethinkh) {
2244 gwin->
win, NULL, TRUE);
2272 struct TagItem attrs[2];
2276 attrs[0].ti_Tag = CHILD_MinHeight;
2277 attrs[0].ti_Data = 50;
2278 attrs[1].ti_Tag = TAG_DONE;
2279 attrs[1].ti_Data = 0;
2284 LISTBROWSER_ColumnTitles, TRUE,
2285 LISTBROWSER_Labels, &g->
loglist,
2344 LISTBROWSER_Labels, &g->
loglist,
2356 const char *src_text;
2357 const char *level_text;
2360 ULONG fgpen = TEXTPEN;
2361 ULONG lbflags = LBFLG_READONLY;
2362 char timestamp[256];
2363 time_t now = time(NULL);
2364 struct tm *timedata = localtime(&now);
2366 strftime(timestamp, 256,
"%c", timedata);
2368 if(foldable) lbflags |= LBFLG_HASCHILDREN;
2372 src_text =
"client-input";
2375 src_text =
"scripting-error";
2378 src_text =
"scripting-console";
2381 assert(0 &&
"Unknown scripting source");
2382 src_text =
"unknown";
2388 level_text =
"DEBUG";
2390 lbflags |= LBFLG_CUSTOMPENS;
2395 lbflags |= LBFLG_CUSTOMPENS;
2398 level_text =
"INFO";
2401 level_text =
"WARN";
2404 level_text =
"ERROR";
2408 assert(0 &&
"Unknown console logging level");
2409 level_text =
"unknown";
2415 LISTBROWSER_Labels, NULL,
2420 if((node = AllocListBrowserNode(4,
2421 LBNA_Flags, lbflags,
2425 LBNCA_CopyText, TRUE,
2426 LBNCA_Text, timestamp,
2430 LBNCA_CopyText, TRUE,
2431 LBNCA_Text, src_text,
2435 LBNCA_CopyText, TRUE,
2436 LBNCA_Text, level_text,
2440 LBNCA_CopyText, TRUE,
2448 LISTBROWSER_Labels, &g->
loglist,
2453 DebugPrintF(
"NETSURF: CONSOLE_LOG SOURCE %s %sFOLDABLE %s %.*s\n",
2454 src_text, foldable ?
"" :
"NOT-", level_text,
2465 struct BitMap *bm = NULL;
2467 struct bitmap *icon_bitmap = NULL;
2484 ULONG tag, tag_data, minterm;
2501 EraseRect(g->
shared->
win->RPort, bbox->Left, bbox->Top,
2502 bbox->Left + 16, bbox->Top + 16);
2505 BltBitMapTags(BLITA_SrcX, 0,
2507 BLITA_DestX, bbox->Left,
2508 BLITA_DestY, bbox->Top,
2513 BLITA_SrcType, BLITT_BITMAP,
2514 BLITA_DestType, BLITT_RASTPORT,
2515 BLITA_Minterm, minterm,
2520 BltMaskBitMapRastPort(bm, 0, 0, g->
shared->
win->RPort,
2521 bbox->Left, bbox->Top, 16, 16, minterm, tag_data);
2523 BltBitMapRastPort(bm, 0, 0, g->
shared->
win->RPort,
2524 bbox->Left, bbox->Top, 16, 16, 0xc0);
2544static ULONG ami_get_border_gadget_size(
struct gui_window_2 *gwin,
2547 static ULONG sz_gad_width = 0;
2548 static ULONG sz_gad_height = 0;
2549 ULONG available_width;
2551 if((sz_gad_width == 0) || (sz_gad_height == 0)) {
2552 struct DrawInfo *dri = GetScreenDrawInfo(
scrn);
2553 GetGUIAttrs(NULL, dri,
2554 GUIA_SizeGadgetWidth, &sz_gad_width,
2555 GUIA_SizeGadgetHeight, &sz_gad_height,
2557 FreeScreenDrawInfo(
scrn, dri);
2559 available_width = gwin->
win->Width -
scrn->WBorLeft - sz_gad_width;
2561 *
width = available_width;
2564 return sz_gad_width;
2574 ami_get_border_gadget_size(gwin, &size1, &size2);
2581 RefreshWindowFrame(gwin->
win);
2590 BOOL win_closed = FALSE;
2604 if(w == NULL)
continue;
2607 if((win_closed = w->
tbl->
event(w))) {
2618 }
while((node = nnode));
2637 struct InputEvent *ie;
2638 struct Node *tabnode;
2640 struct timeval curtime;
2641 static int drag_x_move = 0, drag_y_move = 0;
2644 BOOL win_closed = FALSE;
2647 switch(
result & WMHI_CLASSMASK)
2649 case WMHI_MOUSEMOVE:
2660 x = (ULONG)((gwin->
win->MouseX - bbox->Left));
2661 y = (ULONG)((gwin->
win->MouseY - bbox->Top));
2675 if((gwin->
win->MouseX < bbox->Left) &&
2677 drag_x_move = gwin->
win->MouseX - bbox->Left;
2678 if((gwin->
win->MouseX > (bbox->Left + bbox->Width)) &&
2680 drag_x_move = gwin->
win->MouseX - (bbox->Left + bbox->Width);
2681 if((gwin->
win->MouseY < bbox->Top) &&
2683 drag_y_move = gwin->
win->MouseY - bbox->Top;
2684 if((gwin->
win->MouseY > (bbox->Top + bbox->Height)) &&
2686 drag_y_move = gwin->
win->MouseY - (bbox->Top + bbox->Height);
2692 if((x>=xs) && (y>=ys) && (x<
width+xs) && (y<
height+ys))
2715 case WMHI_MOUSEBUTTONS:
2721 x = (ULONG)(gwin->
win->MouseX - bbox->Left);
2722 y = (ULONG)(gwin->
win->MouseY - bbox->Top);
2737 if((x>=xs) && (y>=ys) && (x<
width+xs) && (y<
height+ys))
2763 CurrentTime((ULONG *)&curtime.tv_sec, (ULONG *)&curtime.tv_usec);
2771 curtime.tv_sec, curtime.tv_usec)) {
2790 gwin->
lastclick.tv_sec = curtime.tv_sec;
2791 gwin->
lastclick.tv_usec = curtime.tv_usec;
2805 CurrentTime((ULONG *)&curtime.tv_sec, (ULONG *)&curtime.tv_usec);
2813 curtime.tv_sec, curtime.tv_usec)) {
2832 gwin->
lastclick.tv_sec = curtime.tv_sec;
2833 gwin->
lastclick.tv_usec = curtime.tv_usec;
2859 switch(
result & WMHI_GADGETMASK)
2863 if(ClickTabBase->lib_Version >= 53) {
2873 GetClickTabNodeAttrs(tabnode,
2874 TNA_UserData, &closedgw,
2895 GetAttr(STRINGA_TextVal,
2927 if(storage != NULL) {
2928 GetChooserNodeAttrs((
struct Node *)storage, CNA_Text, (ULONG *)&prov, TAG_DONE);
2943 GetAttr(STRINGA_TextVal,
3016 ULONG w_top, w_left;
3017 ULONG g_top, g_left, g_height;
3028 NSLOG(netsurf, INFO,
"Unable to open page info window");
3034 GetAttr(STRINGA_TextVal,
3058 storage =
result & WMHI_GADGETMASK;
3059 if(storage >= IECODE_UP_PREFIX)
break;
3065 if((ie->ie_Qualifier & IEQUALIFIER_RCOMMAND) &&
3066 ((31 < nskey) && (nskey < 127))) {
3184 case WMHI_CLOSEWINDOW:
3191 struct bitmap *bm = NULL;
3197 HideWindow(gwin->
win);
3200 0, gwin->dobj, NULL);
3217 case WMHI_INTUITICK:
3234 if(drag_x_move || drag_y_move)
3250 if(gwin->
closed ==
true) {
3276 if((gwin == NULL) || (gwin->
gw != gw))
return NSERROR_OK;
3311 BUTTON_RenderImage, gwin->
objects[bm_idx],
3320 struct AppMessage *appmsg;
3323 struct WBArg *appwinargs;
3327 while((appmsg = (
struct AppMessage *)GetMsg(
appport)))
3331 if(appmsg->am_Type == AMTYPE_APPICON)
3335 ActivateWindow(gwin->
win);
3337 else if(appmsg->am_Type == AMTYPE_APPWINDOW)
3339 for(i = 0; i < appmsg->am_NumArgs; ++i)
3341 if((appwinargs = &appmsg->am_ArgList[i]))
3343 if((filename = malloc(1024)))
3345 if(appwinargs->wa_Lock)
3347 NameFromLock(appwinargs->wa_Lock, filename, 1024);
3350 AddPart(filename, appwinargs->wa_Name, 1024);
3353 appmsg->am_MouseX, appmsg->am_MouseY) ==
false)
3372 ActivateWindow(gwin->
win);
3408 ActivateWindow(gwin->
win);
3429 ReplyMsg((
struct Message *)appmsg);
3436 struct ApplicationMsg *applibmsg;
3443 while((applibmsg=(
struct ApplicationMsg *)GetMsg(
applibport)))
3445 switch (applibmsg->type)
3447 case APPLIBMT_NewBlankDoc:
3465 case APPLIBMT_OpenDoc:
3467 struct ApplicationOpenPrintDocMsg *applibopdmsg =
3468 (
struct ApplicationOpenPrintDocMsg *)applibmsg;
3485 case APPLIBMT_ToFront:
3488 ScreenToFront(
scrn);
3494 case APPLIBMT_OpenPrefs:
3495 ScreenToFront(
scrn);
3500 case APPLIBMT_ForceQuit:
3504 case APPLIBMT_CustomMsg:
3506 struct ApplicationCustomMsg *applibcustmsg =
3507 (
struct ApplicationCustomMsg *)applibmsg;
3508 NSLOG(netsurf, INFO,
3509 "Ringhio BackMsg received: %s",
3510 applibcustmsg->customMsg);
3516 ReplyMsg((
struct Message *)applibmsg);
3523 ULONG winsignal = 1L <<
sport->mp_SigBit;
3524 ULONG appsig = 1L <<
appport->mp_SigBit;
3526 ULONG ctrlcsig = SIGBREAKF_CTRL_C;
3528 fd_set read_fd_set, write_fd_set, except_fd_set;
3533 if(printmsgport) printsig = 1L << printmsgport->mp_SigBit;
3534 uint32 signalmask = winsignal | appsig | schedulesig |
rxsig |
3542 if (waitselect(max_fd + 1, &read_fd_set, &write_fd_set, &except_fd_set,
3543 NULL, (
unsigned int *)&signalmask) != -1) {
3544 signal = signalmask;
3546 NSLOG(netsurf, INFO,
"waitselect() returned error");
3557 signalmask |= ctrlcsig;
3558 signal = Wait(signalmask);
3561 if(signal & winsignal)
3573 if(signal & printsig) {
3574 while(GetMsg(printmsgport));
3578 if(signal & schedulesig) {
3582 if(signal & helpsignal)
3585 if(signal & ctrlcsig)
3592 struct Node *ptab = NULL;
3594 if(gwin->
tabs <= 1)
return;
3605 CLICKTAB_CurrentNode, ptab,
3615 char *restrict utf8title;
3629 CLICKTAB_Labels, ~0,
3635 SetClickTabNodeAttrs(node, TNA_Text, g->
tabtitle,
3644 if(ClickTabBase->lib_Version < 53)
3666 if(!g || !g->
bw)
return;
3679 SCROLLER_Total, (ULONG)(
height),
3680 SCROLLER_Visible, bbox->Height,
3689 SCROLLER_Total, (ULONG)(
width),
3690 SCROLLER_Visible, bbox->Width,
3713 struct rect *restrict deferred_rect;
3725 sizeof(
struct rect));
3726 CopyMem(
rect, deferred_rect,
sizeof(
struct rect));
3730 NSLOG(netsurf, INFO,
3731 "Ignoring duplicate or subset of queued box redraw");
3742 struct Node *tabnode;
3748 if(gwin->
tabs == 0)
return;
3755 GetClickTabNodeAttrs(tabnode,
3756 TNA_UserData, &gwin->
gw,
3769 gwin->
win, NULL, STRINGA_TextVal,
"", TAG_DONE);
3831 }
while((node = nnode));
3851 res = TimedDosRequesterTags(TDR_ImageType, TDRIMAGE_INFO,
3853 TDR_FormatString, utf8text,
3854 TDR_GadgetString, utf8gadgets,
3869 if(
scrn == NULL)
return;
3872 UnlockPubScreen(NULL,
scrn);
3879 if(CloseScreen(
scrn) == TRUE) {
3887 if(donotwait == TRUE)
return;
3890 NSLOG(netsurf, INFO,
3891 "Waiting for visitor windows to close... (signal)");
3894 while (CloseScreen(
scrn) == FALSE) {
3895 NSLOG(netsurf, INFO,
3896 "Waiting for visitor windows to close... (polling)");
3938 NSLOG(netsurf, INFO,
"Freeing menu items");
3942 NSLOG(netsurf, INFO,
"Freeing mouse pointers");
3956 NSLOG(netsurf, INFO,
"Closing screen");
3963 STRPTR filename = NULL;
3966 NSLOG(netsurf, INFO,
"favicon cache location: %s", filename);
3968 if (only_if_avail ==
true) {
3970 if((lock = Lock(filename, ACCESS_READ))) {
3983 STRPTR filename = NULL;
3996 GetAttr(STRINGA_TextVal,
4017 const char *title,
nsurl *url,
bool is_folder)
4020 struct Node *speed_button_node;
4021 char menu_icon[1024];
4022 char *utf8title = NULL;
4024 if(level != 1)
return false;
4026 if(is_folder ==
true)
return false;
4034 if (iconname == NULL) iconname =
ASPrintf(
"icons/content.png");
4039 BITMAP_Screen,
scrn,
4040 BITMAP_SourceFile, menu_icon,
4041 BITMAP_Masking, TRUE,
4052 LABEL_DisposeImage, TRUE,
4055 LABEL_Text, utf8title,
4060 speed_button_node = AllocSpeedButtonNode(item,
4061 SBNA_Image, lab_item,
4063 SBNA_UserData, (
void *)url,
4066 AddTail(tb_userdata->
sblist, speed_button_node);
4068 tb_userdata->
items++;
4076 userdata.
sblist = speed_button_list;
4080 return userdata.
items;
4085 struct TagItem attrs[2];
4087 attrs[0].ti_Tag = CHILD_MinWidth;
4088 attrs[0].ti_Data = 0;
4089 attrs[1].ti_Tag = TAG_DONE;
4090 attrs[1].ti_Data = 0;
4099 ICA_TARGET, ICTARGET_IDCMP,
4100 SPEEDBAR_BevelStyle, BVS_NONE,
4106 BEVEL_Style, BVS_SBAR_VERT,
4125 gwin->
win, NULL, TRUE);
4139 if(IsListEmpty(speed_button_list))
return;
4140 node =
GetHead(speed_button_list);
4145 FreeSpeedButtonNode(node);
4146 }
while((node = nnode));
4173 gwin->
win, NULL, TRUE);
4188 SPEEDBAR_Buttons, ~0,
4225 }
while((node = nnode));
4230 if(ClickTabBase->lib_Version < 53)
return;
4233 struct TagItem attrs[3];
4235 attrs[0].ti_Tag = CHILD_WeightedWidth;
4236 attrs[0].ti_Data = 0;
4237 attrs[1].ti_Tag = CHILD_WeightedHeight;
4238 attrs[1].ti_Data = 0;
4239 attrs[2].ti_Tag = TAG_DONE;
4240 attrs[2].ti_Data = 0;
4293 gwin->
win, NULL, TRUE);
4295 if (gwin->
gw && gwin->
gw->
bw) {
4319 if(gwin->
tabs == 1) {
4327 }
while((node = nnode));
4354 if(window == windows) *
tabs = gwin->
tabs;
4356 }
while((node = nnode));
4446 width += (left - sx);
4450 if(((top - sy) +
height) > bbox->Height)
4451 height = bbox->Height - (top - sy);
4453 if(((left - sx) +
width) > bbox->Width)
4454 width = bbox->Width - (left - sx);
4456 if(
width <= 0)
return;
4461 for(y = top; y < (top +
height); y += tile_size_y) {
4463 clip.y1 = tile_size_y;
4465 if(((y - sy) +
clip.y1) > bbox->Height)
4466 clip.y1 = bbox->Height - (y - sy);
4468 for(x = left; x < (left +
width); x += tile_size_x) {
4470 clip.x1 = tile_size_x;
4472 if(((x - sx) +
clip.x1) > bbox->Width)
4473 clip.x1 = bbox->Width - (x - sx);
4482 BltBitMapTags(BLITA_SrcType, BLITT_BITMAP,
4486 BLITA_DestType, BLITT_RASTPORT,
4487 BLITA_Dest, gwin->
win->RPort,
4488 BLITA_DestX, bbox->Left + (
int)(x - sx),
4489 BLITA_DestY, bbox->Top + (
int)(y - sy),
4490 BLITA_Width, (
int)(
clip.x1),
4491 BLITA_Height, (
int)(
clip.y1),
4495 bbox->Left + (
int)(x - sx),
4496 bbox->Top + (
int)(y - sy),
4497 (
int)(
clip.x1), (
int)(
clip.y1), 0xC0);
4520 int x0,
int y0,
int x1,
int y1)
4527 .background_images =
true,
4546 x1 - x0, y1 - y0, sx, sy, bbox, &ctx);
4560 struct RegionRectangle *regrect;
4573 BeginRefresh(gwin->
win);
4575 r.
x0 = (gwin->
win->RPort->Layer->DamageList->bounds.MinX - bbox->Left) + sx - 1;
4576 r.
x1 = (gwin->
win->RPort->Layer->DamageList->bounds.MaxX - bbox->Left) + sx + 2;
4577 r.
y0 = (gwin->
win->RPort->Layer->DamageList->bounds.MinY - bbox->Top) + sy - 1;
4578 r.
y1 = (gwin->
win->RPort->Layer->DamageList->bounds.MaxY - bbox->Top) + sy + 2;
4580 regrect = gwin->
win->RPort->Layer->DamageList->RegionRectangle;
4586 r.
x0 = (regrect->bounds.MinX - bbox->Left) + sx - 1;
4587 r.
x1 = (regrect->bounds.MaxX - bbox->Left) + sx + 2;
4588 r.
y0 = (regrect->bounds.MinY - bbox->Top) + sy - 1;
4589 r.
y1 = (regrect->bounds.MaxY - bbox->Top) + sy + 2;
4591 regrect = regrect->Next;
4596 EndRefresh(gwin->
win, TRUE);
4602HOOKF(
void, ami_scroller_hook, Object *,
object,
struct IntuiMessage *)
4606 struct IntuiWheelData *wheel;
4607 struct Node *node = NULL;
4612 case IDCMP_IDCMPUPDATE:
4613 gid = GetTagData( GA_ID, 0, msg->IAddress );
4626 if((node = (
struct Node *)GetTagData(SPEEDBAR_SelectedNode, 0, msg->IAddress))) {
4627 GetSpeedButtonNodeAttrs(node, SBNA_UserData, (ULONG *)&url, TAG_DONE);
4651 if(msg->Code == IMSGCODE_INTUIWHEELDATA)
4653 wheel = (
struct IntuiWheelData *)msg->IAddress;
4659 case IDCMP_SIZEVERIFY:
4662 case IDCMP_REFRESHWINDOW:
4667 NSLOG(netsurf, INFO,
4668 "IDCMP hook unhandled event: %ld", msg->Class);
4714 char nav_west[100],nav_west_s[100],nav_west_g[100];
4715 char nav_east[100],nav_east_s[100],nav_east_g[100];
4716 char stop[100],stop_s[100],stop_g[100];
4718 char home[100],home_s[100],home_g[100];
4719 char closetab[100],closetab_s[100],closetab_g[100];
4720 char addtab[100],addtab_s[100],addtab_g[100];
4721 char fave[100], unfave[100];
4722 char pi_insecure[100], pi_internal[100], pi_local[100], pi_secure[100], pi_warning[100];
4723 char tabthrobber[100];
4724 ULONG refresh_mode = WA_SmartRefresh;
4725 ULONG defer_layout = TRUE;
4726 ULONG idcmp_sizeverify = IDCMP_SIZEVERIFY;
4728 NSLOG(netsurf, INFO,
"Creating window");
4733 if (
nsoption_bool(resize_with_contents)) idcmp_sizeverify = 0;
4737 offset =
scrn->WBorTop +
scrn->Font->ta_YSize + 1;
4741 cury = existing->
shared->
win->TopEdge + offset;
4750 if(curh > (
scrn->Height - cury)) curh =
scrn->Height - cury;
4770 LBCIA_Title,
"time",
4772 LBCIA_DraggableSeparator, TRUE,
4773 LBCIA_Separator, TRUE,
4776 LBCIA_Title,
"source",
4778 LBCIA_DraggableSeparator, TRUE,
4779 LBCIA_Separator, TRUE,
4782 LBCIA_Title,
"level",
4784 LBCIA_DraggableSeparator, TRUE,
4785 LBCIA_Separator, TRUE,
4788 LBCIA_Title,
"message",
4790 LBCIA_DraggableSeparator, TRUE,
4791 LBCIA_Separator, TRUE,
4809 CLICKTAB_Labels, ~0,
4821 struct Node *insert_after = existing->
tab_node;
4838 CLICKTAB_Current, g->
tab,
4842 if(ClickTabBase->lib_Version < 53) {
4888 refresh_mode = WA_SimpleRefresh;
4889 defer_layout = FALSE;
4892 refresh_mode = WA_SmartRefresh;
4893 defer_layout = TRUE;
4898 ULONG addtabclosegadget = TAG_IGNORE;
4899 ULONG iconifygadget = FALSE;
4905 iconifygadget = TRUE;
4908 NSLOG(netsurf, INFO,
"Creating menu");
4981 BITMAP_SourceFile, fave,
4982 BITMAP_Screen,
scrn,
4983 BITMAP_Masking, TRUE,
4987 BITMAP_SourceFile, unfave,
4988 BITMAP_Screen,
scrn,
4989 BITMAP_Masking, TRUE,
4993 BITMAP_SourceFile, addtab,
4994 BITMAP_SelectSourceFile, addtab_s,
4996 BITMAP_Screen,
scrn,
4997 BITMAP_Masking, TRUE,
5001 BITMAP_SourceFile, closetab,
5002 BITMAP_SelectSourceFile, closetab_s,
5004 BITMAP_Screen,
scrn,
5005 BITMAP_Masking, TRUE,
5009 BITMAP_SourceFile, pi_insecure,
5010 BITMAP_Screen,
scrn,
5011 BITMAP_Masking, TRUE,
5015 BITMAP_SourceFile, pi_internal,
5016 BITMAP_Screen,
scrn,
5017 BITMAP_Masking, TRUE,
5021 BITMAP_SourceFile, pi_local,
5022 BITMAP_Screen,
scrn,
5023 BITMAP_Masking, TRUE,
5027 BITMAP_SourceFile, pi_secure,
5028 BITMAP_Screen,
scrn,
5029 BITMAP_Masking, TRUE,
5033 BITMAP_SourceFile, pi_warning,
5034 BITMAP_Screen,
scrn,
5035 BITMAP_Masking, TRUE,
5039 if(ClickTabBase->lib_Version < 53)
5041 addtabclosegadget = LAYOUT_AddChild;
5066 BITMAP_SourceFile, tabthrobber,
5068 BITMAP_Masking,TRUE,
5072 NSLOG(netsurf, INFO,
"Creating window object");
5077 WA_DepthGadget, TRUE,
5079 WA_CloseGadget, TRUE,
5080 WA_SizeGadget, TRUE,
5086 WA_ReportMouse,TRUE,
5088 WA_SizeBBottom, TRUE,
5090 WA_IDCMP, IDCMP_MENUPICK | IDCMP_MOUSEMOVE |
5091 IDCMP_MOUSEBUTTONS | IDCMP_NEWSIZE |
5092 IDCMP_RAWKEY | idcmp_sizeverify |
5093 IDCMP_GADGETUP | IDCMP_IDCMPUPDATE |
5094 IDCMP_REFRESHWINDOW |
5096 WINDOW_IconifyGadget, iconifygadget,
5097 WINDOW_MenuStrip, menu,
5098 WINDOW_MenuUserData, WGUD_HOOK,
5101 WINDOW_IDCMPHookBits, IDCMP_IDCMPUPDATE | IDCMP_REFRESHWINDOW |
5103 WINDOW_SharedPort,
sport,
5105 WINDOW_GadgetHelp, TRUE,
5106 WINDOW_UserData, g->
shared,
5108 LAYOUT_DeferLayout, defer_layout,
5109 LAYOUT_SpaceOuter, TRUE,
5111 LAYOUT_VertAlignment, LALIGN_CENTER,
5119 BITMAP_SourceFile,nav_west,
5120 BITMAP_SelectSourceFile,nav_west_s,
5123 BITMAP_Masking,TRUE,
5126 CHILD_WeightedWidth,0,
5127 CHILD_WeightedHeight,0,
5135 BITMAP_SourceFile,nav_east,
5136 BITMAP_SelectSourceFile,nav_east_s,
5139 BITMAP_Masking,TRUE,
5142 CHILD_WeightedWidth,0,
5143 CHILD_WeightedHeight,0,
5149 BITMAP_SourceFile,stop,
5150 BITMAP_SelectSourceFile,stop_s,
5153 BITMAP_Masking,TRUE,
5156 CHILD_WeightedWidth,0,
5157 CHILD_WeightedHeight,0,
5163 BITMAP_SourceFile,
reload,
5164 BITMAP_SelectSourceFile,reload_s,
5167 BITMAP_Masking,TRUE,
5170 CHILD_WeightedWidth,0,
5171 CHILD_WeightedHeight,0,
5177 BITMAP_SourceFile,home,
5178 BITMAP_SelectSourceFile,home_s,
5181 BITMAP_Masking,TRUE,
5184 CHILD_WeightedWidth,0,
5185 CHILD_WeightedHeight,0,
5187 LAYOUT_VertAlignment, LALIGN_CENTER,
5191 SPACE_MinHeight, 16,
5192 SPACE_Transparent, TRUE,
5195 CHILD_WeightedWidth, 0,
5196 CHILD_WeightedHeight, 0,
5203 CHILD_WeightedWidth, 0,
5204 CHILD_WeightedHeight, 0,
5211 STRINGA_MaxChars, 2000,
5227 CHILD_WeightedWidth, 0,
5228 CHILD_WeightedHeight, 0,
5233 LAYOUT_WeightBar, TRUE,
5235 LAYOUT_VertAlignment, LALIGN_CENTER,
5239 CHOOSER_DropDown, TRUE,
5241 CHOOSER_MaxLabels, 40,
5243 CHILD_WeightedWidth,0,
5244 CHILD_WeightedHeight,0,
5247 STRINGA_TextVal, NULL,
5257 SPACE_Transparent,TRUE,
5260 CHILD_WeightedWidth,0,
5261 CHILD_WeightedHeight,0,
5263 CHILD_WeightedHeight,0,
5265 BEVEL_Style, BVS_SBAR_VERT,
5267 CHILD_WeightedHeight, 0,
5269 LAYOUT_SpaceInner, FALSE,
5271 CHILD_WeightedHeight,0,
5273 LAYOUT_SpaceInner,FALSE,
5275 CHILD_WeightedWidth,0,
5276 CHILD_WeightedHeight,0,
5279 CHILD_CacheDomain,FALSE,
5282 CHILD_WeightedWidth,0,
5283 CHILD_WeightedHeight,0,
5285 CHILD_WeightedHeight,0,
5292 SPACE_Transparent,TRUE,
5301 CHILD_WeightedHeight, 0,
5306 STRINGA_TextVal, NULL,
5324 WA_DepthGadget, FALSE,
5326 WA_CloseGadget, FALSE,
5331 WA_Width,
scrn->Width,
5332 WA_Height,
scrn->Height,
5333 WA_SizeGadget, FALSE,
5335 WA_ReportMouse, TRUE,
5337 WA_IDCMP, IDCMP_MENUPICK | IDCMP_MOUSEMOVE |
5338 IDCMP_MOUSEBUTTONS | IDCMP_NEWSIZE |
5339 IDCMP_RAWKEY | IDCMP_REFRESHWINDOW |
5340 IDCMP_GADGETUP | IDCMP_IDCMPUPDATE |
5343 WINDOW_IDCMPHookBits, IDCMP_IDCMPUPDATE |
5345 WINDOW_SharedPort,
sport,
5346 WINDOW_UserData,g->
shared,
5349 LAYOUT_DeferLayout, defer_layout,
5350 LAYOUT_SpaceOuter, TRUE,
5355 SPACE_Transparent,TRUE,
5363 NSLOG(netsurf, INFO,
"Opening window");
5367 NSLOG(netsurf, INFO,
"Window opened, adding border gadgets");
5381 struct DrawInfo *dri = GetScreenDrawInfo(
scrn);
5383 ami_get_border_gadget_size(g->
shared,
5390 GA_Left,
scrn->WBorLeft + 2,
5392 GA_BottomBorder, TRUE,
5402 IA_Top, (
int)(- ceil((
scrn->WBorBottom +
height) / 2)),
5412 (UWORD)~0, -1, NULL);
5424 FreeScreenDrawInfo(
scrn, dri);
5439 UnlockPubScreen(NULL,
scrn);
5443 ScreenToFront(
scrn);
5457 if(res == 0)
return;
5465 GetClickTabNodeAttrs(
tab,
5469 if((other_tabs ==
false) || (gwin->
gw != gw)) {
5472 }
while((
tab=ntab));
5491 struct Node *ptab = NULL;
5531 CLICKTAB_CurrentNode, ptab,
5534 if(ClickTabBase->lib_Version < 53)
5545 FreeListBrowserList(&g->
loglist);
5588 FreeListBrowserList(&g->
loglist);
5597 for(gid = 0; gid <
GID_LAST; gid++)
5667 NSLOG(netsurf, INFO,
"Ignoring deferred box redraw queue");
5681 }
while((node = nnode));
5687 const struct rect *restrict new_rect, APTR mempool)
5701 if((
rect->
x0 <= new_rect->x0) &&
5702 (
rect->
y0 <= new_rect->y0) &&
5703 (
rect->
x1 >= new_rect->x1) &&
5704 (
rect->
y1 >= new_rect->y1)) {
5708 if ((new_rect->x0 <=
rect->
x0) &&
5709 (new_rect->y0 <=
rect->
y0) &&
5710 (new_rect->x1 >=
rect->
x1) &&
5711 (new_rect->y1 >=
rect->
y1)) {
5712 NSLOG(netsurf, INFO,
5713 "Removing queued redraw that is a subset of new box redraw");
5718 }
while((node = nnode));
5726 ULONG hcurrent,vcurrent,xoffset,yoffset,
width=800,
height=600;
5728 ULONG oldh = gwin->
oldh, oldv=gwin->
oldv;
5750 if((abs(vcurrent-oldv) >
height) || (abs(hcurrent-oldh) >
width))
5763 ScrollWindowRaster(gwin->
win, hcurrent - oldh, vcurrent - oldv,
5764 xoffset, yoffset, xoffset +
width - 1, yoffset +
height - 1);
5774 else if(vcurrent<oldv)
5787 else if(hcurrent<oldh)
5798 .background_images =
true,
5811 gwin->
oldh = hcurrent;
5812 gwin->
oldv = vcurrent;
5890 if(sx >=
width - bbox->Width)
5891 sx =
width - bbox->Width;
5892 if(sy >=
height - bbox->Height)
5893 sy =
height - bbox->Height;
5895 if(width <= bbox->Width) sx = 0;
5896 if(height <= bbox->Height) sy = 0;
5904 SCROLLER_Top, (ULONG)(sy),
5912 SCROLLER_Top, (ULONG)(sx),
5932 struct TextExtent textex;
5940 if(utf8text == NULL)
return;
5943 chars = TextFit(&
scrn->RastPort, utf8text, (UWORD)strlen(utf8text),
5944 &textex, NULL, 1, size - 4,
scrn->RastPort.TxHeight);
5946 utf8text[chars] = 0;
5964 char *idn_url_s = NULL;
5965 char *url_lc = NULL;
5983 if(idn_url_s) free(idn_url_s);
5992HOOKF(
uint32, ami_set_favicon_render_hook, APTR, space,
struct gpRender *)
6006 struct bitmap *ico_bitmap)
6008 struct BitMap *bm = NULL;
6016 if (ico_bitmap != NULL) {
6033 ULONG bm_masking_tag = TAG_IGNORE;
6037 bm_masking_tag = BITMAP_Masking;
6041 BITMAP_Screen,
scrn,
6046 bm_masking_tag, TRUE,
6055 }
while((node = nnode));
6060HOOKF(
uint32, ami_set_throbber_render_hook, APTR, space,
struct gpRender *)
6067HOOKF(
uint32, ami_gui_browser_render_hook, APTR, space,
struct gpRender *)
6071 NSLOG(netsurf, DEBUG,
"Render hook called with %ld (REDRAW=1)", msg->gpr_Redraw);
6073 if(msg->gpr_Redraw != GREDRAW_REDRAW)
return 0;
6100 if((y-ys+
height) > (bbox->Height))
height = bbox->Height-y+ys;
6102 if(((x-xs) <= 0) || ((x-xs+2) >= (bbox->Width)) || ((y-ys) <= 0) || ((y-ys) >= (bbox->Height))) {
6109 SetDrMd(g->
shared->
win->RPort,COMPLEMENT);
6110 RectFill(g->
shared->
win->RPort, x + bbox->Left - xs, y + bbox->Top - ys,
6111 x + bbox->Left + g->
c_w - xs, y+bbox->Top +
height - ys);
6127 if(g->
c_h == 0)
return;
6168 SetWindowAttrs(g->
shared->
win, WA_GrabFocus, 0,
6169 WA_MouseLimits, NULL, TAG_DONE);
6196 *x = *x - (bbox->Left) +xs;
6199 *y = *y - (bbox->Top) + ys;
6222 if((x >= left) && (x <= (left +
width)) && (y >= top) && (y <= (top +
height)))
6229 Object *restrict win_obj, *restrict bm_obj;
6231 struct Screen *wbscreen = LockPubScreen(
"Workbench");
6232 uint32 top = 0, left = 0;
6233 struct TextAttr tattr;
6234 struct TextFont *tfont;
6240 WA_Borderless, TRUE,
6241 WA_BusyPointer, TRUE,
6242 WINDOW_Position, WPOS_CENTERSCREEN,
6243 WINDOW_LockWidth, TRUE,
6244 WINDOW_LockHeight, TRUE,
6247 BITMAP_SourceFile,
"PROGDIR:Resources/splash.png",
6248 BITMAP_Screen, wbscreen,
6249 BITMAP_Precision, PRECISION_IMAGE,
6254 if(win_obj == NULL) {
6255 NSLOG(netsurf, INFO,
"Splash window object not created");
6259 NSLOG(netsurf, INFO,
"Attempting to open splash window...");
6260 win = RA_OpenWindow(win_obj);
6263 NSLOG(netsurf, INFO,
"Splash window did not open");
6267 if(bm_obj == NULL) {
6268 NSLOG(netsurf, INFO,
"BitMap object not created");
6276 SetDrMd(win->RPort, JAM1);
6279 tattr.ta_Name =
"DejaVu Serif Italic.font";
6281 SetAPen(win->RPort, 3);
6282 tattr.ta_Name =
"ruby.font";
6284 tattr.ta_YSize = 24;
6290 SetFont(win->RPort, tfont);
6294 tattr.ta_Name =
"DejaVu Serif Oblique.font";
6296 SetFont(win->RPort, tfont);
6299 Move(win->RPort, left + 5, top + 25);
6300 Text(win->RPort,
"Initialising...", strlen(
"Initialising..."));
6305 tattr.ta_Name =
"DejaVu Sans.font";
6307 tattr.ta_Name =
"helvetica.font";
6309 tattr.ta_YSize = 16;
6314 SetFont(win->RPort, tfont);
6316 Move(win->RPort, left + 185, top + 220);
6321 UnlockPubScreen(NULL, wbscreen);
6328 if(win_obj == NULL)
return;
6330 NSLOG(netsurf, INFO,
"Closing splash window");
6331 DisposeObject(win_obj);
6337 NSLOG(netsurf, INFO,
"File open dialog request for %p/%p", g, gadget);
6341 ASLFR_SleepWindow, TRUE,
6344 ASLFR_DoSaveMode, FALSE,
6347 strlcpy(fname,
filereq->fr_Drawer, 1024);
6348 AddPart(fname,
filereq->fr_File, 1024);
6368 if(current_user == NULL) {
6369 user = GetVar(
"user", temp, 1024, GVF_GLOBAL_ONLY);
6370 current_user =
ASPrintf(
"%s", (user == -1) ?
"Default" : temp);
6372 NSLOG(netsurf, INFO,
"User: %s", current_user);
6378 FreeVec(current_user);
6385 struct InfoData *infodata = AllocDosObject(DOS_INFODATA, 0);
6386 if(infodata == NULL) {
6388 FreeVec(current_user);
6391 GetDiskInfoTags(GDI_StringNameInput,
users_dir,
6392 GDI_InfoData, infodata,
6394 if(infodata->id_DiskState == ID_DISKSTATE_WRITE_PROTECTED) {
6395 FreeDosObject(DOS_INFODATA, infodata);
6397 FreeVec(current_user);
6400 FreeDosObject(DOS_INFODATA, infodata);
6402#warning FIXME for OS3 and older OS4
6408 int len = strlen(current_user);
6415 FreeVec(current_user);
6422 FreeVec(current_user);
6535 setbuf(stderr, NULL);
6539 STRPTR current_user_cache = NULL;
6540 STRPTR current_user = NULL;
6563 signal(SIGINT, SIG_IGN);
6648 if((lock =
CreateDirTree(current_user_cache))) UnLock(lock);
6652 if(current_user_cache != NULL) FreeVec(current_user_cache);
6694 NSLOG(netsurf, INFO,
"Entering main loop");
void ami_clipboard_free(void)
void ami_clipboard_init(void)
struct gui_clipboard_table * amiga_clipboard_table
void gui_start_selection(struct gui_window *g)
nserror ami_cookies_present(const char *search_term)
Open the cookie viewer.
struct core_window_table * amiga_core_window_table
const char * fetch_filetype(const char *unix_path)
Determine the MIME type of a local file.
nserror ami_mime_init(const char *mimefile)
static void ami_gui_close_tabs(struct gui_window_2 *gwin, bool other_tabs)
static void ami_gui_splash_close(Object *win_obj)
static nserror gui_window_get_dimensions(struct gui_window *gw, int *restrict width, int *restrict height)
Find the current dimensions of a amiga browser window content area.
static void ami_refresh_window(struct gui_window_2 *gwin)
static void ami_gui_console_log_remove(struct gui_window *g)
bool ami_gui_window_update_box_deferred_check(struct MinList *deferred_rects, const struct rect *restrict new_rect, APTR mempool)
Check rect is not already queued for redraw.
struct ami_history_local_window * ami_gui_get_history_window(struct gui_window *gw)
Get local history window from gui_window.
static void ami_update_buttons(struct gui_window_2 *gwin)
static void ami_gui_hotlist_toolbar_add(struct gui_window_2 *gwin)
static STRPTR nsscreentitle
struct Window * ami_gui_get_window(struct gui_window *gw)
Get window from gui_window.
static void gui_window_set_status(struct gui_window *g, const char *text)
static nsurl * gui_get_resource_url(const char *path)
static nserror gui_window_event(struct gui_window *gw, enum gui_window_event event)
process miscellaneous window events
static void gui_window_destroy(struct gui_window *g)
static void ami_gui_refresh_favicon(void *p)
static void gui_window_remove_caret(struct gui_window *g)
static void ami_gui_cache_favicon(nsurl *url, struct bitmap *favicon)
int ami_key_to_nskey(ULONG keycode, struct InputEvent *ie)
static void ami_gui_scroller_update(struct gui_window_2 *gwin)
Check the scroll bar requirements for a browser window, and add/remove the vertical scroller as appro...
void ami_gui_set_find_window(struct gui_window *gw, struct find_window *fw)
Set search window in gui_window.
static const __attribute__((used))
static void gui_window_update_extent(struct gui_window *g)
static nserror ami_set_options(struct nsoption_s *defaults)
Set option defaults for amiga frontend.
static void ami_set_border_gadget_size(struct gui_window_2 *gwin)
int ami_gui2_get_ctxmenu_history_tmp(struct gui_window_2 *gwin)
Get ctxmenu history tmp from gui_window_2.
static void ami_gui_appicon_remove(struct gui_window_2 *gwin)
struct Screen * ami_gui_get_screen(void)
Get a pointer to the screen NetSurf is running on.
struct gui_utf8_table * amiga_utf8_table
struct Node * ami_gui_get_tab_node(struct gui_window *gw)
Get tab node from gui_window.
void ami_gui_hotlist_update_all(void)
Update hotlist toolbar and recreate the menu for all windows.
void ami_gui_close_inactive_tabs(struct gui_window_2 *gwin)
Close all tabs in a window except the active one.
static void ami_gui_console_log_switch(struct gui_window *g)
static void ami_gui_console_log_add(struct gui_window *g)
void ami_gui2_set_new_content(struct gui_window_2 *gwin, bool new_content)
Set new_content in gui_window_2 Indicates the window needs redrawing.
static void ami_amiupdate(void)
static struct Screen * scrn
static bool ami_gui_map_filename(char **remapped, const char *restrict path, const char *restrict file, const char *restrict map)
static struct gui_misc_table amiga_misc_table
@ GID_PAGEINFO_INSECURE_BM
@ GID_PAGEINFO_INTERNAL_BM
@ GID_PAGEINFO_WARNING_BM
void ami_gui2_set_ctxmenu_history_tmp(struct gui_window_2 *gwin, int temp)
Set ctxmenu history tmp in gui_window_2.
static void ami_gui_hotlist_toolbar_remove(struct gui_window_2 *gwin)
static struct gui_window * gui_window_create(struct browser_window *bw, struct gui_window *existing, gui_window_create_flags flags)
static void ami_gui_hotlist_toolbar_update(struct gui_window_2 *gwin)
int main(int argc, char **argv)
Normal entry point from OS.
nserror ami_gui_win_list_add(void *win, int type, const struct ami_win_event_table *table)
Add a window to the NetSurf window list (to enable event processing)
static nserror gui_search_web_provider_update(const char *provider_name, struct bitmap *ico_bitmap)
Gui callback when search provider details are updated.
static void ami_update_quals(struct gui_window_2 *gwin)
static void ami_handle_appmsg(void)
uint32 ami_gui_get_app_id(void)
Get the application.library ID NetSurf is registered as.
static void ami_toggletabbar(struct gui_window_2 *gwin, bool show)
static STRPTR temp_homepage_url
static struct IBox * ami_ns_rect_to_ibox(struct gui_window_2 *gwin, const struct rect *rect)
void ami_gui_switch_to_new_tab(struct gui_window_2 *gwin)
Switch to the most-recently-opened tab.
void ami_gui_history(struct gui_window_2 *gwin, bool back)
static void ami_set_screen_defaults(struct Screen *screen)
bool ami_text_box_at_point(struct gui_window_2 *gwin, ULONG *restrict x, ULONG *restrict y)
void * ami_window_at_pointer(int type)
undocumented, or internal, or documented elsewhere
void ami_gui_close_window(void *w)
Close a window and all tabs attached to it.
static nserror amiga_window_invalidate_area(struct gui_window *g, const struct rect *restrict rect)
Invalidates an area of an amiga browser window.
struct Menu * ami_gui_get_menu(struct gui_window *gw)
Get imenu from gui_window.
static void gui_file_gadget_open(struct gui_window *g, struct hlcache_handle *hl, struct form_control *gadget)
void ami_gui_set_throbbing(struct gui_window *gw, bool throbbing)
Set throbbing status in gui_window.
void ami_set_pointer(struct gui_window_2 *gwin, gui_pointer_shape shape, bool update)
static void ami_do_redraw(struct gui_window_2 *gwin)
static void ami_get_vscroll_pos(struct gui_window_2 *gwin, ULONG *ys)
static nserror gui_window_set_url(struct gui_window *g, nsurl *url)
static UWORD ami_system_colour_scrollbar_fgpen(struct DrawInfo *drinfo)
void ami_gui_adjust_scale(struct gui_window *gw, float adjustment)
Adjust scale by specified amount.
static struct MinList * window_list
bool ami_locate_resource(char *fullpath, const char *file)
static bool ami_gui_vscroll_add(struct gui_window_2 *gwin)
bool ami_gui_get_throbbing(struct gui_window *gw)
Get throbbing status from gui_window.
struct gui_window * ami_gui_get_active_gw(void)
Get a pointer to the gui_window which NetSurf considers to be the current/active one.
static void ami_do_redraw_tiled(struct gui_window_2 *gwin, bool busy, int left, int top, int width, int height, int sx, int sy, struct IBox *bbox, struct redraw_context *ctx)
struct browser_window * ami_gui2_get_browser_window(struct gui_window_2 *gwin)
Get browser window from gui_window_2.
static void gui_init2(int argc, char **argv)
static bool ami_gui_console_log_toggle(struct gui_window *g)
static BOOL locked_screen
static Object * ami_gui_splash_open(void)
void ami_reset_pointer(struct gui_window_2 *gwin)
static bool ami_gui_resources_open(void)
void ami_gui2_set_ctxmenu_history(struct gui_window_2 *gwin, ULONG direction, Object *ctx_hist)
Set ctxmenu history in gui_window_2.
static bool ami_gui_vscroll_remove(struct gui_window_2 *gwin)
static struct MsgPort * applibport
static void gui_quit(void)
static struct gui_fetch_table amiga_fetch_table
STRPTR ami_gui_get_screen_title(void)
Get the string for NetSurf's screen titlebar.
static bool ami_gui_hscroll_remove(struct gui_window_2 *gwin)
static void ami_redraw_callback(void *p)
static void ami_change_tab(struct gui_window_2 *gwin, int direction)
static void gui_window_set_title(struct gui_window *g, const char *restrict title)
struct ami_menu_data ** ami_gui2_get_menu_data(struct gui_window_2 *gwin)
Get menu_data from gui_window_2.
static struct gui_globals * browserglob
nserror ami_gui_new_blank_tab(struct gui_window_2 *gwin)
static void ami_schedule_redraw_remove(struct gui_window_2 *gwin)
static char * ami_gui_read_tooltypes(struct WBArg *wbarg)
void ami_gui2_set_menu(struct gui_window_2 *gwin, struct Menu *menu)
Set imenu to gui_window_2.
static struct MsgPort * sport
static void gui_window_place_caret(struct gui_window *g, int x, int y, int height, const struct rect *clip)
void ami_gui2_set_closed(struct gui_window_2 *gwin, bool closed)
Set closed in gui_window_2.
nserror ami_gui_get_space_box(Object *obj, struct IBox **bbox)
Compatibility function to get space.gadget render area.
Object * ami_gui2_get_object(struct gui_window_2 *gwin, int object_type)
Get object from gui_window.
const char * ami_gui_get_win_title(struct gui_window *gw)
Get window title from gui_window.
static void ami_gui_window_update_box_deferred(struct gui_window *g, bool draw)
static int ami_gui_hotlist_scan(struct List *speed_button_list, struct gui_window_2 *gwin)
static struct gui_window * cur_gw
#define NSA_KBD_SCROLL_PX
static nserror gui_window_set_scroll(struct gui_window *g, const struct rect *rect)
Set the scroll position of a amiga browser window.
int ami_gui_get_throbber_frame(struct gui_window *gw)
Get throbbing frame from gui_window.
const char * ami_gui_get_tab_title(struct gui_window *gw)
Get tab title from gui_window.
static void gui_window_set_icon(struct gui_window *g, struct hlcache_handle *icon)
function to add retrieved favicon to gui
static char * current_user_dir
static void ami_gui_resources_free(void)
void ami_gui_set_history_window(struct gui_window *gw, struct ami_history_local_window *hw)
Set local history window in gui_window.
struct gui_window * ami_gui2_get_gui_window(struct gui_window_2 *gwin)
Get gui_window from gui_window_2.
static void ami_handle_applib(void)
STRPTR ami_locale_langs(int *codeset)
struct List * ami_gui_get_download_list(struct gui_window *gw)
Get download list from gui_window.
Object * ami_gui2_get_ctxmenu_history(struct gui_window_2 *gwin, ULONG direction)
Get ctxmenu history from gui_window_2.
static void gui_window_new_content(struct gui_window *g)
static bool gui_window_get_scroll(struct gui_window *g, int *restrict sx, int *restrict sy)
#define AMINS_SCROLLERPEN
#define BOOL_MISMATCH(a, b)
static bool ami_spacebox_to_ns_coords(struct gui_window_2 *gwin, int *restrict x, int *restrict y, int space_x, int space_y)
static void ami_openscreen(void)
static struct Hook newprefs_hook
ULONG ami_gui2_get_tabs(struct gui_window_2 *gwin)
Get tabs from gui_window_2.
void ami_gui_beep(void)
Beep.
void ami_gui_free_space_box(struct IBox *bbox)
Free any data obtained via ami_gui_get_space_box().
bool ami_mouse_to_ns_coords(struct gui_window_2 *gwin, int *restrict x, int *restrict y, int mouse_x, int mouse_y)
static nserror colour_option_from_pen(UWORD pen, enum nsoption_e option, struct Screen *screen, colour def_colour)
set option from pen
static bool ami_gui_hotlist_add(void *userdata, int level, int item, const char *title, nsurl *url, bool is_folder)
static void ami_switch_tab(struct gui_window_2 *gwin, bool redraw)
static void ami_gui_trap_mouse(struct gui_window_2 *gwin)
static void ami_gui_hotlist_toolbar_free(struct gui_window_2 *gwin, struct List *speed_button_list)
struct hlcache_handle * ami_gui_get_favicon(struct gui_window *gw)
Get favicon from gui_window.
HOOKF(void, ami_gui_newprefs_hook, APTR, window, APTR)
static void ami_do_redraw_limits(struct gui_window *g, struct browser_window *bw, bool busy, int x0, int y0, int x1, int y1)
Redraw an area of the browser window - Amiga-specific function.
void ami_gui_set_scale(struct gui_window *gw, float scale)
Set the scale of a gui window.
struct List * ami_gui2_get_tab_list(struct gui_window_2 *gwin)
Get tab list from gui_window_2.
static const struct ami_win_event_table ami_gui_table
void ami_gui_win_list_remove(void *win)
Remove a window from the NetSurf window list.
int ami_gui_count_windows(int window, int *tabs)
Count windows, and optionally tabs.
static BOOL ami_gui_event(void *w)
static bool win_destroyed
static void ami_quit_netsurf_delayed(void)
int ami_gui_get_quals(Object *win_obj)
Get which qualifier keys are being pressed.
static BOOL ami_handle_msg(void)
void ami_gui_update_hotlist_button(struct gui_window_2 *gwin)
static nserror gui_page_info_change(struct gui_window *gw)
void ami_schedule_redraw(struct gui_window_2 *gwin, bool full_redraw)
Schedule a redraw of the browser window - Amiga-specific function.
static bool gui_window_drag_start(struct gui_window *g, gui_drag_type type, const struct rect *rect)
static void gui_window_console_log(struct gui_window *g, browser_window_console_source src, const char *msg, size_t msglen, browser_window_console_flags flags)
static void ami_openscreenfirst(void)
static bool ami_gui_check_resource(char *fullpath, const char *file)
static void ami_gui_menu_update_all(void)
static void ami_gui_close_screen(struct Screen *scrn, BOOL locked_screen, BOOL donotwait)
static bool ami_gui_hscroll_add(struct gui_window_2 *gwin)
struct Window * ami_gui2_get_window(struct gui_window_2 *gwin)
Get window from gui_window_2.
struct browser_window * ami_gui_get_browser_window(struct gui_window *gw)
Get browser window from gui_window.
static struct MsgPort * schedulermsgport
static struct MsgPort * appport
static struct RDArgs * ami_gui_commandline(int *restrict argc, char **argv, int *restrict nargc, char **nargv)
static char * current_user_faviconcache
static struct gui_window_table amiga_window_table
struct MinList * ami_gui_get_window_list(void)
Get the window list.
char * ami_gui_get_cache_favicon_name(nsurl *url, bool only_if_avail)
struct gui_window_2 * ami_gui_get_gui_window_2(struct gui_window *gw)
Get gui_window_2 from gui_window.
static struct gui_search_web_table amiga_search_web_table
void ami_gui_tabs_toggle_all(void)
static STRPTR ami_gui_read_all_tooltypes(int argc, char **argv)
static void ami_gui_scroll_internal(struct gui_window_2 *gwin, int xs, int ys)
static char * ami_gui_get_user_dir(STRPTR current_user)
BOOL ami_gadget_hit(Object *obj, int x, int y)
#define nsoption_default_set_int(OPTION, VALUE)
void ami_gui_set_throbber_frame(struct gui_window *gw, int frame)
Set throbbing frame in gui_window.
static void ami_get_hscroll_pos(struct gui_window_2 *gwin, ULONG *xs)
void ami_quit_netsurf(void)
#define NSA_MAX_HOTLIST_BUTTON_LEN
#define AMI_GUI_TOOLBAR_MAX
struct MsgPort * ami_gui_get_shared_msgport(void)
Get shared message port.
void ami_help_new_screen(struct Screen *screen)
ULONG ami_help_signal(void)
void ami_help_process(void)
void ami_help_open(ULONG node, struct Screen *screen)
void ami_misc_fatal_error(const char *message)
int32 amiga_warn_user_multi(const char *body, const char *opt1, const char *opt2, struct Window *win)
nserror amiga_warn_user(const char *warning, const char *detail)
Warn the user of an event.
char * translate_escape_chars(const char *s)
returns a string with escape chars translated and string converted to local charset (based on remove_...
struct gui_file_table * amiga_file_table
nserror ami_pageinfo_open(struct browser_window *bw, ULONG left, ULONG top)
Open the page info window.
const struct plotter_table amiplot
bool ami_plot_screen_is_palettemapped(void)
void ami_plot_ra_free(struct gui_globals *gg)
Free a plotter render area.
struct BitMap * ami_plot_ra_get_bitmap(struct gui_globals *gg)
Get a drawing BitMap associated with a render area.
void ami_plot_clear_bbox(struct RastPort *rp, struct IBox *bbox)
void ami_plot_ra_set_pen_list(struct gui_globals *gg, struct MinList *pen_list)
Set a list of shared pens for a render area to use Only relevant for palette-mapped screens.
void ami_plot_ra_get_size(struct gui_globals *gg, int *width, int *height)
Get size of BitMap associated with a render area.
void ami_clearclipreg(struct gui_globals *gg)
struct gui_globals * ami_plot_ra_alloc(ULONG width, ULONG height, bool force32bit, bool alloc_pen_list)
Alloc a plotter render area.
void ami_plot_release_pens(struct MinList *shared_pens)
void ami_schedule_free(void)
Finalise amiga scheduler.
nserror ami_schedule(int t, void(*callback)(void *p), void *p)
Schedule a callback.
void ami_schedule_handle(struct MsgPort *nsmsgport)
Handle a message received from the scheduler process.
nserror ami_schedule_create(struct MsgPort *msgport)
Initialise amiga scheduler.
void ami_mouse_pointers_free(void)
void ami_theme_throbber_free(void)
int ami_theme_throbber_get_width(void)
void ami_theme_init(void)
void ami_init_mouse_pointers(void)
void ami_theme_throbber_setup(void)
void ami_throbber_redraw_schedule(int t, struct gui_window *g)
int ami_theme_throbber_get_height(void)
void ami_update_pointer(struct Window *win, gui_pointer_shape shape)
void ami_get_theme_filename(char *filename, const char *themestring, bool protocol)
void ami_arexx_cleanup(void)
bool ami_arexx_init(ULONG *rxsig)
void ami_arexx_self(const char *cmd)
void ami_arexx_execute(char *script)
void ami_arexx_handle(void)
void gui_window_set_pointer(struct gui_window *gw, gui_pointer_shape shape)
set the pointer shape
Low-level source data cache backing store interface.
struct gui_llcache_table * filesystem_llcache_table
nserror browser_window_history_get_thumbnail(struct browser_window *bw, struct bitmap **bitmap_out)
Get the thumbnail bitmap for the current history entry.
nserror browser_window_history_forward(struct browser_window *bw, bool new_window)
Go forward in the history.
nserror browser_window_history_back(struct browser_window *bw, bool new_window)
Go back in the history.
Interface to browser history operations.
Browser window creation and manipulation interface.
nserror browser_window_schedule_reformat(struct browser_window *bw)
Reformat the browser window contents in a safe context.
bool browser_window_redraw_ready(struct browser_window *bw)
Check whether browser window is ready for redraw.
nserror browser_window_refresh_url_bar(struct browser_window *bw)
Update URL bar for a given browser window to bw's content's URL.
nserror browser_window_get_features(struct browser_window *bw, int x, int y, struct browser_window_features *data)
Get access to any page features at the given coordinates.
nserror browser_window_navigate(struct browser_window *bw, struct nsurl *url, struct nsurl *referrer, enum browser_window_nav_flags flags, char *post_urlenc, struct fetch_multipart_data *post_multipart, struct hlcache_handle *parent)
Start fetching a page in a browser window.
bool browser_window_redraw(struct browser_window *bw, int x, int y, const struct rect *clip, const struct redraw_context *ctx)
Redraw an area of a window.
bool browser_window_has_content(struct browser_window *bw)
Find out if a browser window is currently showing a content.
bool browser_window_back_available(struct browser_window *bw)
Check availability of Back action for a given browser window.
nserror browser_window_get_scrollbar_type(struct browser_window *bw, browser_scrolling *h, browser_scrolling *v)
Get the browser window's scrollbar details.
void browser_window_mouse_click(struct browser_window *bw, browser_mouse_state mouse, int x, int y)
Handle mouse clicks in a browser window.
bool browser_window_scroll_at_point(struct browser_window *bw, int x, int y, int scrx, int scry)
Send a scroll request to a browser window at a particular point.
void browser_window_destroy(struct browser_window *bw)
Close and destroy a browser window.
nserror browser_window_reload(struct browser_window *bw, bool all)
Reload the page in a browser window.
bool browser_window_reload_available(struct browser_window *bw)
Check availability of Reload action for a given browser window.
bool browser_window_forward_available(struct browser_window *bw)
Check availability of Forward action for a given browser window.
browser_window_page_info_state
Browser window page information states.
@ PAGE_STATE_INSECURE
Insecure page load.
@ PAGE_STATE_SECURE_ISSUES
Secure load, but has insecure elements.
@ PAGE_STATE_SECURE
Secure load.
@ PAGE_STATE_SECURE_OVERRIDE
Secure load, but had to override.
@ PAGE_STATE_LOCAL
Page loaded from file:/// etc.
@ PAGE_STATE_INTERNAL
Page loaded from internal handler.
const char * browser_window_get_title(struct browser_window *bw)
Get the title of a browser_window.
nserror browser_window_get_extents(struct browser_window *bw, bool scaled, int *width, int *height)
Get a browser window's content extents.
nserror browser_window_create(enum browser_window_create_flags flags, struct nsurl *url, struct nsurl *referrer, struct browser_window *existing, struct browser_window **bw)
Create and open a new root browser window with the given page.
void browser_window_stop(struct browser_window *bw)
Stop all fetching activity in a browser window.
bool browser_window_is_frameset(struct browser_window *bw)
Find out if a browser window contains a frameset.
nserror browser_window_set_scale(struct browser_window *bw, float scale, bool absolute)
Sets the scale of a browser window.
browser_window_page_info_state browser_window_get_page_info_state(const struct browser_window *bw)
Request the current browser window page info state.
struct hlcache_handle * browser_window_get_content(struct browser_window *bw)
Get a cache handle for the content within a browser window.
@ BW_CREATE_HISTORY
this will form a new history node (don't set for back/reload/etc)
@ BW_CREATE_TAB
New gui_window to be tab in same window as "existing" gui_window.
@ BW_CREATE_CLONE
New gui_window to be clone of "existing" gui_window.
bool browser_window_stop_available(struct browser_window *bw)
Check availability of Stop action for a given browser window.
bool browser_window_drop_file_at_point(struct browser_window *bw, int x, int y, char *file)
Drop a file onto a browser window at a particular point, or determine if a file may be dropped onto t...
@ BW_NAVIGATE_HISTORY
this will form a new history node (don't set for back/reload/etc)
void browser_window_mouse_track(struct browser_window *bw, browser_mouse_state mouse, int x, int y)
Handle non-click mouse action in a browser window.
void browser_window_set_gadget_filename(struct browser_window *bw, struct form_control *gadget, const char *fn)
set filename on form control.
static osspriteop_area * buffer
The buffer characteristics.
browser_window_console_source
Sources of messages which end up in the browser window console.
@ BW_CS_SCRIPT_CONSOLE
Logging from some running script.
@ BW_CS_INPUT
Input from the client.
@ BW_CS_SCRIPT_ERROR
Error from some running script.
browser_window_console_flags
Flags for browser window console logging.
@ BW_CS_FLAG_LEVEL_LOG
Logged at the 'log' level, please only use one of the LEVEL flags.
@ BW_CS_FLAG_LEVEL_DEBUG
Logged at the 'debug' level, please use only one of the LEVEL flags.
@ BW_CS_FLAG_LEVEL_INFO
Logged at the 'info' level, please use only one of the LEVEL flags.
@ BW_CS_FLAG_LEVEL_MASK
Mask for the error level to allow easy comparison using the above.
@ BW_CS_FLAG_LEVEL_WARN
Logged at the 'warn' level, please use only one of the LEVEL flags.
@ BW_CS_FLAG_LEVEL_ERROR
Logged at the 'error' level, please use only one of the LEVEL flags.
@ BW_CS_FLAG_FOLDABLE
The log entry is foldable.
nserror fetch_fdset(fd_set *read_fd_set, fd_set *write_fd_set, fd_set *except_fd_set, int *maxfd_out)
Get the set of file descriptors the fetchers are currently using.
Fetching of data from a URL (interface).
Unified cookie database public interface.
void urldb_save_cookies(const char *filename)
Save persistent cookies to file.
void urldb_load_cookies(const char *filename)
Load a cookie file into the database.
#define amiga_datatypes_init()
nserror hotlist_fini(void)
Finalise the hotlist.
nserror hotlist_add_url(nsurl *url)
Add an entry to the hotlist for given URL.
nserror hotlist_init(const char *load_path, const char *save_path)
Initialise the hotlist.
bool hotlist_has_url(nsurl *url)
Check whether given URL is present in hotlist.
void hotlist_remove_url(nsurl *url)
Remove any entries matching the given URL from the hotlist.
#define NSOPTION_SYS_COLOUR_END
#define NSOPTION_SYS_COLOUR_START
nserror search_web_omni(const char *term, enum search_web_omni_flags flags, struct nsurl **url_out)
Generate a nsurl from a search term.
nserror search_web_init(const char *provider_fname)
Initialise the web search operations.
nserror search_web_select_provider(const char *selection)
Change the currently selected web search provider.
bool ami_drag_has_data(void)
void gui_drag_save_selection(struct gui_window *g, const char *selection)
void ami_drag_save(struct Window *win)
bool ami_drag_icon_move(void)
void gui_drag_save_object(struct gui_window *g, struct hlcache_handle *c, gui_save_type type)
#define AMI_DRAG_THRESHOLD
nserror
Enumeration of error codes.
@ NSERROR_BAD_PARAMETER
Bad Parameter.
@ NSERROR_NOMEM
Memory exhaustion.
static void gui_window_start_throbber(struct gui_window *g)
static void gui_window_stop_throbber(struct gui_window *gw)
struct BitMap * ami_bitmap_get_native(struct bitmap *bitmap, int width, int height, bool palette_mapped, struct BitMap *friendbm)
void ami_bitmap_fini(void)
Cleanup bitmap allocations.
bool amiga_bitmap_save(void *bitmap, const char *path, unsigned flags)
Save a bitmap in the platform's native format.
PLANEPTR ami_bitmap_get_mask(struct bitmap *bitmap, int width, int height, struct BitMap *n_bm)
struct gui_bitmap_table * amiga_bitmap_table
bool amiga_bitmap_get_opaque(void *bitmap)
Gets whether a bitmap should be plotted opaque.
#define AMI_BITMAP_SCALE_ICON
void ami_free_download_list(struct List *dllist)
nserror gui_window_save_link(struct gui_window *g, nsurl *url, const char *title)
struct gui_download_table * amiga_download_table
void ami_download_parse_backmsg(const char *backmsg)
struct FileRequester * filereq
void ami_file_req_free(void)
void ami_file_req_init(void)
struct TextFont * ami_font_open_disk_font(struct TextAttr *tattr)
void ami_font_close_disk_font(struct TextFont *tfont)
struct gui_layout_table * ami_layout_table
void ami_font_setdevicedpi(int id)
nserror ami_hotlist_scan(void *userdata, int first_item, const char *folder, bool(*cb_add_item)(void *userdata, int level, int item, const char *title, nsurl *url, bool folder))
Scan the hotlist.
nserror ami_nsoption_read(void)
nserror ami_nsoption_set_location(const char *current_user_dir)
void ami_nsoption_free(void)
nserror ami_nsoption_write(void)
struct MinList * ami_AllocMinList(void)
List abstraction as OS3 appears to have problems with NewMinList()
struct MinList * NewObjList(void)
void FreeObjList(struct MinList *objlist)
void ami_object_fini(void)
bool ami_object_init(void)
Initialisation for itempool.
void DelObject(struct nsObject *dtzo)
struct nsObject * AddObject(struct MinList *objlist, ULONG otype)
void DelObjectNoFree(struct nsObject *dtzo)
bool ami_print_cont(void)
struct MsgPort * ami_print_get_msgport(void)
struct gui_window * ami_search_get_gwin(struct find_window *fw)
Obtain gui window associated with find window.
struct gui_search_table * amiga_search_table
void ami_search_close(void)
Close search.
void ami_utf8_free(char *ptr)
char * ami_to_utf8_easy(const char *string)
char * ami_utf8_easy(const char *string)
nserror utf8_from_local_encoding(const char *string, size_t len, char **result)
static CONST_STRPTR tabs[OPTS_MAX_TABS]
void ami_gui_opts_websearch_free(struct List *websearchlist)
struct List * ami_gui_opts_websearch(int *idx)
void ami_gui_opts_open(void)
nserror ami_history_local_destroy(struct ami_history_local_window *history_local_win)
destroy a previously created local history view
struct DiskObject * amiga_icon_from_bitmap(struct bitmap *bm)
void amiga_icon_free(struct DiskObject *dobj)
void amiga_icon_superimpose_favicon_internal(struct hlcache_handle *icon, struct DiskObject *dobj)
Content for image/x-amiga-icon (icon.library interface).
#define amiga_icon_init()
struct fbtk_bitmap reload_g
struct fbtk_bitmap reload
Public content interface.
struct bitmap * content_get_bitmap(struct hlcache_handle *h)
Retrieve the bitmap contained in an image content.
Interface to platform-specific fetcher operations.
Interface to platform-specific miscellaneous browser operation table.
Core mouse and pointer states.
browser_mouse_state
Mouse state.
@ BROWSER_MOUSE_PRESS_1
button 1 pressed
@ BROWSER_MOUSE_CLICK_2
button 2 clicked.
@ BROWSER_MOUSE_PRESS_2
button 2 pressed
@ BROWSER_MOUSE_TRIPLE_CLICK
button triple clicked
@ BROWSER_MOUSE_CLICK_1
button 1 clicked.
@ BROWSER_MOUSE_MOD_2
2nd modifier key pressed (eg.
@ BROWSER_MOUSE_DOUBLE_CLICK
button double clicked
@ BROWSER_MOUSE_MOD_3
3rd modifier key pressed (eg.
@ BROWSER_MOUSE_MOD_1
1st modifier key pressed (eg.
@ BROWSER_MOUSE_DRAG_1
start of button 1 drag
@ BROWSER_MOUSE_HOLDING_2
during button 2 drag
@ BROWSER_MOUSE_HOLDING_1
during button 1 drag
@ BROWSER_MOUSE_DRAG_ON
a drag operation was started and a mouse button is still pressed
@ BROWSER_MOUSE_DRAG_2
start of button 2 drag
Interface to platform-specific graphical user interface window operations.
gui_window_create_flags
Window creation control flags.
@ GW_CREATE_TAB
Create tab in same window as existing.
gui_window_event
Window events.
@ GW_EVENT_PAGE_INFO_CHANGE
Page status has changed and so the padlock should be updated.
@ GW_EVENT_REMOVE_CARET
Remove the caret, if present.
@ GW_EVENT_NEW_CONTENT
Called when the gui_window has new content.
@ GW_EVENT_STOP_THROBBER
stop the navigation throbber.
@ GW_EVENT_UPDATE_EXTENT
Update the extent of the inside of a browser window to that of the current content.
@ GW_EVENT_START_SELECTION
selection started
@ GW_EVENT_START_THROBBER
start the navigation throbber.
Interface to key press operations.
@ NS_KEY_DELETE_LINE_START
bool browser_window_key_press(struct browser_window *bw, uint32_t key)
Handle key presses in a browser window.
void ami_openurl_open(void)
Initialise the fetcher.
void ami_openurl_close(void)
Fetching of data from a URL (Registration).
void ami_libs_close(void)
nserror nslog_init(nslog_ensure_t *ensure, int *pargc, char **argv)
Initialise the logging system.
void nslog_finalise(void)
Shut down the logging system.
#define NSLOG(catname, level, logmsg, args...)
void ami_memory_fini(struct Interrupt *memhandler)
struct Interrupt * ami_memory_init(void)
#define ami_memory_itempool_create(s)
#define ami_memory_itempool_alloc(p, s)
#define ami_memory_itempool_free(p, i, s)
#define ami_memory_itempool_delete(p)
nserror messages_add_from_file(const char *path)
Read keys and values from messages file into the standard Messages hash.
const char * messages_get_errorcode(nserror code)
lookup of a message by errorcode from the standard Messages hash.
const char * messages_get(const char *key)
Fast lookup of a message by key from the standard Messages hash.
Localised message support (interface).
NetSurf core interface registration, construction and destruction.
void netsurf_exit(void)
Finalise NetSurf core.
nserror netsurf_init(const char *store_path)
Initialise netsurf core.
nserror netsurf_register(struct netsurf_table *table)
Register operation table.
NetSurf URL handling (interface).
nserror nsurl_get_utf8(const nsurl *url, char **url_s, size_t *url_l)
Get a UTF-8 string (for human readable IDNs) from a NetSurf URL object.
nserror nsurl_create(const char *const url_s, nsurl **url)
Create a NetSurf URL object from a URL string.
void nsurl_unref(nsurl *url)
Drop a reference to a NetSurf URL object.
uint32_t nsurl_hash(const nsurl *url)
Get a URL's hash value.
const char * nsurl_access(const nsurl *url)
Access a NetSurf URL object as a string.
struct nsurl nsurl
NetSurf URL object.
struct Node * GetPred(struct Node *node)
void FreeSysObject(ULONG type, APTR obj)
APTR NewObject(struct IClass *classPtr, CONST_STRPTR classID, ULONG tagList,...)
char * ASPrintf(const char *fmt,...)
uint32 GetAttrs(Object *obj, Tag tag1,...)
struct Node * GetHead(struct List *list)
ULONG RefreshSetGadgetAttrs(struct Gadget *g, struct Window *w, struct Requester *r, Tag tag1,...)
struct Node * GetSucc(struct Node *node)
#define AllocSysObjectTags(A, B, C, D)
#define LIB_IS_AT_LEAST(B, V, R)
#define CLICKTAB_LabelTruncate
#define WINDOW_NewPrefsHook
#define WA_ContextMenuHook
#define WINDOW_BuiltInScroll
#define CLICKTAB_FlagImage
#define CLICKTAB_CloseImage
#define IDCMP_EXTENDEDMOUSE
#define BLITA_UseSrcAlpha
#define CLICKTAB_NodeClosed
#define DevNameFromLock(A, B, C, D)
#define BITMAP_DisabledSourceFile
#define ObtainCharsetInfo(A, B, C)
#define IsMinListEmpty(L)
#define LISTBROWSER_Striping
nserror amiga_plugin_hack_init(void)
static nserror gui_launch_url(struct nsurl *url)
Broadcast an URL that we can't handle.
void save_complete_init(void)
Initialise save complete module.
Save HTML document with dependencies (interface).
core web search facilities interface.
@ SEARCH_WEB_OMNI_NONE
no changes to default operation
@ SEARCH_WEB_OMNI_SEARCHONLY
The search does not attempt to interpret the url as a url before using it as a search term.
Interface to utility string handling.
Class * MakeStringClass(void)
#define STRINGVIEW_Header
void FreeStringClass(Class *)
const struct ami_win_event_table * tbl
Amiga local history viewing window context.
struct gui_window * gw
Amiga GUI stuff.
RISC OS wimp toolkit bitmap.
Page features at a specific spatial location.
enum browser_window_features::@56 form_features
type of form feature.
struct browser_window * bw
function table for fetcher operations.
const char *(* filetype)(const char *unix_path)
Determine the MIME type of a local file.
Graphical user interface browser misc function table.
nserror(* schedule)(int t, void(*callback)(void *p), void *p)
Schedule a callback.
Graphical user interface browser web search function table.
nserror(* provider_update)(const char *provider_name, struct bitmap *ico_bitmap)
called when the search provider details are updated.
User interface utf8 characterset conversion routines.
browser_mouse_state mouse_state
char *restrict helphints[GID_LAST]
browser_mouse_state prev_mouse_state
Object *restrict objects[GID_LAST]
struct List hotlist_toolbar_list
Object *restrict hotlist_toolbar_lab[AMI_GUI_TOOLBAR_MAX]
struct ami_menu_data * menu_data[AMI_MENU_AREXX_MAX+1]
gui_pointer_shape mouse_pointer
browser_mouse_state key_state
struct find_window * searchwin
struct Hook * ctxmenu_hook
struct Hook throbber_hook
Object * clicktab_ctxmenu
struct ami_generic_window w
struct List * web_search_list
ULONG throbber_update_count
struct Node * last_new_tab
Object *restrict history_ctxmenu[2]
struct AppWindow * appwin
struct MinList * shared_pens
Graphical user interface window function table.
struct gui_window *(* create)(struct browser_window *bw, struct gui_window *existing, gui_window_create_flags flags)
Create and open a gui window for a browsing context.
first entry in window list
struct gui_window_2 * shared
bool throbbing
whether currently throbbing
struct ColumnInfo * logcolumns
struct MinList * deferred_rects
int scrollx
current scroll location
struct hlcache_handle * favicon
struct fbtk_widget_s * stop
struct ami_history_local_window * hw
int scrolly
current scroll location
struct browser_window * bw
The 'content' window that is rendered in the gui_window.
NetSurf operation function table.
struct gui_misc_table * misc
Browser table.
union nsoption_s::@149 value
bool interactive
Redraw to show interactive features.
void * priv
Private context.
uint32_t colour
Colour type: XBGR.
struct rect rect
Rectangle coordinates.
Unified URL information database public interface.
nserror urldb_save(const char *filename)
Export the current database to file.
nserror urldb_load(const char *filename)
Import an URL database from file, replacing any existing database.
struct List * URLHistory_GetList(void)
nserror netsurf_path_to_nsurl(const char *path, struct nsurl **url)
Create a nsurl from a path.
nserror netsurf_mkpath(char **str, size_t *size, size_t nelm,...)
Generate a path from one or more component elemnts.
Default operations table for files.
struct nsoption_s * nsoptions_default
global default option table.
static struct nsoption_s defaults[]
The table of compiled in default options.
struct nsoption_s * nsoptions
global active option table.
nserror nsoption_commandline(int *pargc, char **argv, struct nsoption_s *opts)
Process commandline and set options approriately.
nserror nsoption_init(nsoption_set_default_t *set_defaults, struct nsoption_s **popts, struct nsoption_s **pdefs)
Initialise option system.
nserror nsoption_finalise(struct nsoption_s *opts, struct nsoption_s *defs)
Finalise option system.
Option reading and saving interface.
#define nsoption_charp(OPTION)
Get the value of a string option.
#define nsoption_setnull_charp(OPTION, VALUE)
set string option in default table if currently unset
#define nsoption_int(OPTION)
Get the value of an integer option.
#define nsoption_set_int(OPTION, VALUE)
set an integer option in the default table
#define nsoption_set_bool(OPTION, VALUE)
set a boolean option in the default table
#define nsoption_set_charp(OPTION, VALUE)
set string option in default table
@ OPTION_COLOUR
Option is a netsurf colour.
#define nsoption_bool(OPTION)
Get the value of a boolean option.
uint32_t utf8_to_ucs4(const char *s_in, size_t l)
Convert a UTF-8 multibyte sequence into a single UCS4 character.
size_t utf8_char_byte_length(const char *s)
Calculate the length (in bytes) of a UTF-8 character.
UTF-8 manipulation functions (interface).
Interface to a number of general purpose functionality.
Version information interface.
static nserror path(const struct redraw_context *ctx, const plot_style_t *pstyle, const float *p, unsigned int n, const float transform[6])
Plots a path.
static nserror text(const struct redraw_context *ctx, const struct plot_font_style *fstyle, int x, int y, const char *text, size_t length)
Text plotting.
static nserror clip(const struct redraw_context *ctx, const struct rect *clip)
Sets a clip rectangle for subsequent plot operations.