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)
328static struct Screen *
scrn = NULL;
337static Class *urlStringClass;
355#define USERS_DIR "PROGDIR:Users"
362const char *
const versvn;
373 const char *restrict file,
const char *restrict map);
383HOOKF(
uint32, ami_set_favicon_render_hook, APTR, space,
struct gpRender *);
384HOOKF(
uint32, ami_set_throbber_render_hook, APTR, space,
struct gpRender *);
385HOOKF(
uint32, ami_gui_browser_render_hook, APTR, space,
struct gpRender *);
388#define nsoption_default_set_int(OPTION, VALUE) \
389 if (nsoptions_default[NSOPTION_##OPTION].value.i == nsoptions[NSOPTION_##OPTION].value.i) \
390 nsoptions[NSOPTION_##OPTION].value.i = VALUE; \
391 nsoptions_default[NSOPTION_##OPTION].value.i = VALUE
396 assert(
sport != NULL);
429 assert(gwin != NULL);
447 assert(gwin != NULL);
454 assert(gw->
shared != NULL);
472 assert(gwin != NULL);
478 assert(gwin != NULL);
540 assert(gwin != NULL);
542 switch(object_type) {
574 assert(gwin != NULL);
587 assert(gw->
shared != NULL);
602 assert(gwin != NULL);
608 assert(gwin != NULL);
614 assert(gwin != NULL);
620 assert(gwin != NULL);
626 assert(gwin != NULL);
632 assert(gwin != NULL);
638 assert(gwin != NULL);
645static void *ami_find_gwin_by_id(
struct Window *win,
uint32 type)
663 }
while((node = nnode));
673 LockLayerInfo(&
scrn->LayerInfo);
675 layer = WhichLayer(&
scrn->LayerInfo,
scrn->MouseX,
scrn->MouseY);
677 UnlockLayerInfo(&
scrn->LayerInfo);
679 if(layer)
return ami_find_gwin_by_id(layer->Window,
type);
706 struct Locale *locale;
707 STRPTR acceptlangs = NULL;
708 char *remapped = NULL;
710 if((locale = OpenLocale(NULL)))
712 if(codeset != NULL) *codeset = locale->loc_CodeSet;
714 for(
int i = 0; i < 10; i++)
716 if(locale->loc_PrefLanguages[i])
719 locale->loc_PrefLanguages[i],
"LangNames"))
723 STRPTR acceptlangs2 = acceptlangs;
724 acceptlangs =
ASPrintf(
"%s, %s",acceptlangs2, remapped);
725 FreeVec(acceptlangs2);
730 acceptlangs =
ASPrintf(
"%s", remapped);
733 if(remapped != NULL) free(remapped);
746 const char *restrict file,
const char *restrict map)
749 char *mapfile = NULL;
750 size_t mapfile_size = 0;
752 char *restrict realfname;
757 if(mapfile == NULL)
return false;
759 fh =
FOpen(mapfile, MODE_OLDFILE, 0);
762 while(FGets(fh,
buffer, 1024) != 0)
766 (
buffer[0] ==
'\0'))
continue;
768 realfname = strchr(
buffer,
':');
771 if(strncmp(
buffer, file, strlen(file)) == 0)
773 if(realfname[strlen(realfname)-1] ==
'\n')
774 realfname[strlen(realfname)-1] =
'\0';
775 *remapped = strdup(realfname + 1);
784 if(found ==
false) *remapped = strdup(file);
785 else NSLOG(netsurf, INFO,
786 "Remapped %s to %s in path %s using %s", file,
787 *remapped,
path, map);
799 size_t fullpath_len = 1024;
804 lock = Lock(fullpath, ACCESS_READ);
810 if(found)
NSLOG(netsurf, INFO,
"Found %s", fullpath);
818 struct Locale *locale;
821 char *remapped = NULL;
822 size_t fullpath_len = 1024;
829 if(found)
return true;
836 if(found)
return true;
841 locale = OpenLocale(NULL);
844 strcpy(fullpath,
"PROGDIR:Resources/");
846 if(locale->loc_PrefLanguages[i]) {
848 locale->loc_PrefLanguages[i],
"LangNames") ==
true) {
864 strcpy(fullpath,
"PROGDIR:Resources/en/");
873 strcpy(fullpath,
"PROGDIR:Resources/");
898 TAG_DONE)))
return false;
902 TAG_DONE)))
return false;
906 TAG_DONE)))
return false;
920 LONG scrollerfillpen = FALSE;
922 GetGUIAttrs(NULL, drinfo, GUIA_PropKnobColor, &scrollerfillpen, TAG_DONE);
924 if(scrollerfillpen)
return FILLPEN;
925 else return FOREGROUNDPEN;
938 struct Screen *screen,
942 struct DrawInfo *drinfo;
951 drinfo = GetScreenDrawInfo(screen);
957 GetRGB32(screen->ViewPort.ColorMap, drinfo->dri_Pens[pen], 1, (ULONG *)&colr);
960 def_colour = ((colr[0] & 0xff000000) >> 24) |
961 ((colr[1] & 0xff000000) >> 16) |
962 ((colr[2] & 0xff000000) >> 8);
964 FreeScreenDrawInfo(screen, drinfo);
990 int width = screen->Width / 2;
991 int height = screen->Height / 2;
992 int top = (screen->Height / 2) - (
height / 2);
993 int left = (screen->Width / 2) - (
width / 2);
1035 colour_option_from_pen(INACTIVEFILLTEXTPEN, NSOPTION_sys_colour_InactiveCaptionText, screen, 0x00cccccc);
1064 STRPTR tempacceptlangs;
1074 if(ClickTabBase->lib_Version < 53)
1084 (
char *)strdup(tempacceptlangs));
1085 FreeVec(tempacceptlangs);
1096 if(codeset == 0) codeset = 4;
1111 (
char *)strdup(temp));
1115 (
char *)strdup(temp));
1119 (
char *)strdup(temp));
1123 (
char *)strdup(temp));
1126 (
char *)strdup(
"PROGDIR:Resources/ca-bundle"));
1159 if((lock = Lock(
"FONTS:Code2000.otag", ACCESS_READ)))
1163 (
char *)strdup(
"Code2000"));
1165 else if((lock = Lock(
"FONTS:Bitstream Cyberbit.otag", ACCESS_READ)))
1169 (
char *)strdup(
"Bitstream Cyberbit"));
1179 if((lock = Lock(
"FONTS:Symbola.otag", ACCESS_READ))) {
1182 (
char *)strdup(
"Symbola"));
1195 if(((lock = Lock(
"ENVARC:AppPaths",SHARED_LOCK)) == 0))
1197 lock = CreateDir(
"ENVARC:AppPaths");
1202 if((lock = Lock(
"PROGDIR:", ACCESS_READ)))
1204 char filename[1024];
1209 if((amiupdatefh =
FOpen(
"ENVARC:AppPaths/NetSurf", MODE_NEWFILE, 0))) {
1210 FPuts(amiupdatefh, (CONST_STRPTR)&filename);
1231HOOKF(
void, ami_gui_newprefs_hook, APTR, window, APTR)
1254 struct ScreenModeRequester *screenmodereq = NULL;
1256 if((screenmodereq = AllocAslRequest(ASL_ScreenModeRequest,NULL))) {
1257 if(AslRequestTags(screenmodereq,
1262 char *modeid = malloc(20);
1263 id = screenmodereq->sm_DisplayID;
1264 sprintf(modeid,
"0x%lx",
id);
1268 FreeAslRequest(screenmodereq);
1274 scrn = OpenScreenTags(NULL,
1278 SA_Type, PUBLICSCREEN,
1279 SA_PubName,
"NetSurf",
1281 SA_PubTask, FindTask(0),
1282 SA_LikeWorkbench, TRUE,
1288 PubScreenStatus(
scrn,0);
1295 if((
scrn = LockPubScreen(
"NetSurf")))
1302 strdup(
"Workbench"));
1313 scrn = LockPubScreen(
"Workbench");
1331 int *restrict nargc,
char ** nargv)
1333 struct RDArgs *args;
1334 CONST_STRPTR
template =
"-v/S,NSOPTS/M,URL/K,USERSDIR/K,FORCE/S";
1335 long rarray[] = {0,0,0,0,0};
1345 if(*argc == 0)
return NULL;
1347 if((args = ReadArgs(
template, rarray, NULL))) {
1349 NSLOG(netsurf, INFO,
1350 "URL %s specified on command line",
1351 (
char *)rarray[A_URL]);
1355 if(rarray[A_USERSDIR]) {
1356 NSLOG(netsurf, INFO,
1357 "USERSDIR %s specified on command line",
1358 (
char *)rarray[A_USERSDIR]);
1362 if(rarray[A_FORCE]) {
1363 NSLOG(netsurf, INFO,
1364 "FORCE specified on command line");
1368 if(rarray[A_NSOPTS]) {
1384 NSLOG(netsurf, INFO,
"ReadArgs failed to parse command line");
1393 struct DiskObject *dobj;
1396 char *current_user = NULL;
1398 if((*wbarg->wa_Name) && (dobj = GetDiskObject(wbarg->wa_Name))) {
1399 toolarray = (STRPTR *)dobj->do_ToolTypes;
1401 if((s = (
char *)FindToolType(toolarray,
"USERSDIR")))
users_dir =
ASPrintf(
"%s", s);
1402 if((s = (
char *)FindToolType(toolarray,
"USER"))) current_user =
ASPrintf(
"%s", s);
1404 FreeDiskObject(dobj);
1406 return current_user;
1411 struct WBStartup *WBenchMsg;
1412 struct WBArg *wbarg;
1414 char *current_user = NULL;
1415 char *cur_user = NULL;
1418 WBenchMsg = (
struct WBStartup *)argv;
1419 for(i = 0, wbarg = WBenchMsg->sm_ArgList; i < WBenchMsg->sm_NumArgs; i++,wbarg++) {
1421 if((wbarg->wa_Lock) && (*wbarg->wa_Name))
1425 if(cur_user != NULL) {
1426 if(current_user != NULL) FreeVec(current_user);
1427 current_user = cur_user;
1434 return current_user;
1439 struct Screen *screen;
1440 BOOL notalreadyrunning;
1449 if((screen = LockPubScreen(
"Workbench"))) {
1451 UnlockPubScreen(NULL, screen);
1462 if (notalreadyrunning &&
1467 notalreadyrunning = TRUE;
1488 struct WBStartup *WBenchMsg = (
struct WBStartup *)argv;
1489 struct WBArg *wbarg;
1491 char fullpath[1024];
1493 for(i=0,wbarg=WBenchMsg->sm_ArgList;i<WBenchMsg->sm_NumArgs;i++,wbarg++)
1496 if((wbarg->wa_Lock)&&(*wbarg->wa_Name))
1499 AddPart(fullpath,wbarg->wa_Name,1024);
1509 if(notalreadyrunning)
1549 if(!notalreadyrunning)
1551 STRPTR sendcmd = NULL;
1552 char newtab[11] =
"\0";
1555 strcpy(newtab,
"TAB ACTIVE");
1579 ULONG noicon = TAG_IGNORE;
1582 noicon = REGAPP_NoIcon;
1585 REGAPP_URLIdentifier,
"netsurf-browser.org",
1586 REGAPP_WBStartup, (
struct WBStartup *)argv,
1588 REGAPP_HasPrefsWindow, TRUE,
1589 REGAPP_CanCreateNewDocs, TRUE,
1590 REGAPP_UniqueApplication, TRUE,
1598 REGAPP_URLIdentifier,
"netsurf-browser.org",
1599 REGAPP_FileName, argv[0],
1600 REGAPP_NoIcon, TRUE,
1601 REGAPP_HasPrefsWindow, TRUE,
1602 REGAPP_CanCreateNewDocs, TRUE,
1603 REGAPP_UniqueApplication, TRUE,
1630 long back=FALSE, forward=FALSE, tabclose=FALSE, stop=FALSE,
reload=FALSE;
1631 long s_back, s_forward, s_tabclose, s_stop, s_reload;
1646 if(gwin->
tabs <= 1) {
1661 gwin->
win, NULL, GA_Disabled, back, TAG_DONE);
1665 gwin->
win, NULL, GA_Disabled, forward, TAG_DONE);
1669 gwin->
win, NULL, GA_Disabled,
reload, TAG_DONE);
1673 gwin->
win, NULL, GA_Disabled, stop, TAG_DONE);
1675 if(ClickTabBase->lib_Version < 53) {
1676 if(gwin->
tabs <= 1) tabclose = TRUE;
1682 gwin->
win, NULL, GA_Disabled, tabclose, TAG_DONE);
1708 int nskey = 0, chars;
1712 if(keycode >= IECODE_UP_PREFIX)
return 0;
1794 if((chars = MapRawKey(ie,
buffer,20,NULL)) > 0) {
1799 if(ie->ie_Qualifier & IEQUALIFIER_RCOMMAND) {
1833 GetAttr(WINDOW_Qualifier, win_obj, (
uint32 *)&quals);
1835#warning qualifier needs fixing for OS3
1842 if(quals & IEQUALIFIER_CONTROL) {
1863 *bbox = malloc(
sizeof(
struct IBox));
1865 GetAttr(SPACE_RenderBox, obj, (ULONG *)*bbox);
1869 GetAttr(SPACE_AreaBox, obj, (ULONG *)bbox);
1886 int *restrict x,
int *restrict y,
int space_x,
int space_y)
1910 ns_x = (ULONG)(
mouse_x - bbox->Left);
1911 ns_y = (ULONG)(
mouse_y - bbox->Top);
1913 if((ns_x < 0) || (ns_x > bbox->Width) || (ns_y < 0) || (ns_y > bbox->Height))
2004 struct IBox *bbox, *ibox;
2006 ibox = malloc(
sizeof(
struct IBox));
2007 if(ibox == NULL)
return NULL;
2015 ibox->Left = gwin->
win->MouseX + (
rect->
x0);
2016 ibox->Top = gwin->
win->MouseY + (
rect->
y0);
2021 if(ibox->Left < bbox->Left) ibox->Left = bbox->Left;
2022 if(ibox->Top < bbox->Top) ibox->Top = bbox->Top;
2024 if((ibox->Left > (bbox->Left + bbox->Width)) ||
2025 (ibox->Top > (bbox->Top + bbox->Height)) ||
2026 (ibox->Width < 0) || (ibox->Height < 0))
2050 SetWindowAttrs(gwin->
win, WA_GrabFocus, 10,
2051 WA_MouseLimits, gwin->
ptr_lock, TAG_DONE);
2076 }
while((node = nnode));
2090 int *restrict
width,
2103 *
width = bbox->Width;
2115 struct TagItem attrs[2];
2119 attrs[0].ti_Tag = CHILD_MinWidth;
2120 attrs[0].ti_Data = 0;
2121 attrs[1].ti_Tag = TAG_DONE;
2122 attrs[1].ti_Data = 0;
2127 SCROLLER_Orientation, SORIENT_HORIZ,
2128 ICA_TARGET, ICTARGET_IDCMP,
2161 struct TagItem attrs[2];
2165 attrs[0].ti_Tag = CHILD_MinWidth;
2166 attrs[0].ti_Data = 0;
2167 attrs[1].ti_Tag = TAG_DONE;
2168 attrs[1].ti_Data = 0;
2173 ICA_TARGET, ICTARGET_IDCMP,
2211 int h = 1, w = 1, wh = 0, ww = 0;
2212 bool rethinkv =
false;
2213 bool rethinkh =
false;
2242 if(rethinkv || rethinkh) {
2245 gwin->
win, NULL, TRUE);
2273 struct TagItem attrs[2];
2277 attrs[0].ti_Tag = CHILD_MinHeight;
2278 attrs[0].ti_Data = 50;
2279 attrs[1].ti_Tag = TAG_DONE;
2280 attrs[1].ti_Data = 0;
2285 LISTBROWSER_ColumnTitles, TRUE,
2286 LISTBROWSER_Labels, &g->
loglist,
2345 LISTBROWSER_Labels, &g->
loglist,
2357 const char *src_text;
2358 const char *level_text;
2361 ULONG fgpen = TEXTPEN;
2362 ULONG lbflags = LBFLG_READONLY;
2363 char timestamp[256];
2364 time_t now = time(NULL);
2365 struct tm *timedata = localtime(&now);
2367 strftime(timestamp, 256,
"%c", timedata);
2369 if(foldable) lbflags |= LBFLG_HASCHILDREN;
2373 src_text =
"client-input";
2376 src_text =
"scripting-error";
2379 src_text =
"scripting-console";
2382 assert(0 &&
"Unknown scripting source");
2383 src_text =
"unknown";
2389 level_text =
"DEBUG";
2391 lbflags |= LBFLG_CUSTOMPENS;
2396 lbflags |= LBFLG_CUSTOMPENS;
2399 level_text =
"INFO";
2402 level_text =
"WARN";
2405 level_text =
"ERROR";
2409 assert(0 &&
"Unknown console logging level");
2410 level_text =
"unknown";
2416 LISTBROWSER_Labels, NULL,
2421 if((node = AllocListBrowserNode(4,
2422 LBNA_Flags, lbflags,
2426 LBNCA_CopyText, TRUE,
2427 LBNCA_Text, timestamp,
2431 LBNCA_CopyText, TRUE,
2432 LBNCA_Text, src_text,
2436 LBNCA_CopyText, TRUE,
2437 LBNCA_Text, level_text,
2441 LBNCA_CopyText, TRUE,
2449 LISTBROWSER_Labels, &g->
loglist,
2454 DebugPrintF(
"NETSURF: CONSOLE_LOG SOURCE %s %sFOLDABLE %s %.*s\n",
2455 src_text, foldable ?
"" :
"NOT-", level_text,
2466 struct BitMap *bm = NULL;
2468 struct bitmap *icon_bitmap = NULL;
2485 ULONG tag, tag_data, minterm;
2502 EraseRect(g->
shared->
win->RPort, bbox->Left, bbox->Top,
2503 bbox->Left + 16, bbox->Top + 16);
2506 BltBitMapTags(BLITA_SrcX, 0,
2508 BLITA_DestX, bbox->Left,
2509 BLITA_DestY, bbox->Top,
2514 BLITA_SrcType, BLITT_BITMAP,
2515 BLITA_DestType, BLITT_RASTPORT,
2516 BLITA_Minterm, minterm,
2521 BltMaskBitMapRastPort(bm, 0, 0, g->
shared->
win->RPort,
2522 bbox->Left, bbox->Top, 16, 16, minterm, tag_data);
2524 BltBitMapRastPort(bm, 0, 0, g->
shared->
win->RPort,
2525 bbox->Left, bbox->Top, 16, 16, 0xc0);
2545static ULONG ami_get_border_gadget_size(
struct gui_window_2 *gwin,
2548 static ULONG sz_gad_width = 0;
2549 static ULONG sz_gad_height = 0;
2550 ULONG available_width;
2552 if((sz_gad_width == 0) || (sz_gad_height == 0)) {
2553 struct DrawInfo *dri = GetScreenDrawInfo(
scrn);
2554 GetGUIAttrs(NULL, dri,
2555 GUIA_SizeGadgetWidth, &sz_gad_width,
2556 GUIA_SizeGadgetHeight, &sz_gad_height,
2558 FreeScreenDrawInfo(
scrn, dri);
2560 available_width = gwin->
win->Width -
scrn->WBorLeft - sz_gad_width;
2562 *
width = available_width;
2565 return sz_gad_width;
2575 ami_get_border_gadget_size(gwin, &size1, &size2);
2582 RefreshWindowFrame(gwin->
win);
2591 BOOL win_closed = FALSE;
2605 if(w == NULL)
continue;
2608 if((win_closed = w->
tbl->
event(w))) {
2619 }
while((node = nnode));
2638 struct InputEvent *ie;
2639 struct Node *tabnode;
2641 struct timeval curtime;
2642 static int drag_x_move = 0, drag_y_move = 0;
2645 BOOL win_closed = FALSE;
2648 switch(
result & WMHI_CLASSMASK)
2650 case WMHI_MOUSEMOVE:
2661 x = (ULONG)((gwin->
win->MouseX - bbox->Left));
2662 y = (ULONG)((gwin->
win->MouseY - bbox->Top));
2676 if((gwin->
win->MouseX < bbox->Left) &&
2678 drag_x_move = gwin->
win->MouseX - bbox->Left;
2679 if((gwin->
win->MouseX > (bbox->Left + bbox->Width)) &&
2681 drag_x_move = gwin->
win->MouseX - (bbox->Left + bbox->Width);
2682 if((gwin->
win->MouseY < bbox->Top) &&
2684 drag_y_move = gwin->
win->MouseY - bbox->Top;
2685 if((gwin->
win->MouseY > (bbox->Top + bbox->Height)) &&
2687 drag_y_move = gwin->
win->MouseY - (bbox->Top + bbox->Height);
2693 if((x>=xs) && (y>=ys) && (x<
width+xs) && (y<
height+ys))
2716 case WMHI_MOUSEBUTTONS:
2722 x = (ULONG)(gwin->
win->MouseX - bbox->Left);
2723 y = (ULONG)(gwin->
win->MouseY - bbox->Top);
2738 if((x>=xs) && (y>=ys) && (x<
width+xs) && (y<
height+ys))
2764 CurrentTime((ULONG *)&curtime.tv_sec, (ULONG *)&curtime.tv_usec);
2772 curtime.tv_sec, curtime.tv_usec)) {
2791 gwin->
lastclick.tv_sec = curtime.tv_sec;
2792 gwin->
lastclick.tv_usec = curtime.tv_usec;
2806 CurrentTime((ULONG *)&curtime.tv_sec, (ULONG *)&curtime.tv_usec);
2814 curtime.tv_sec, curtime.tv_usec)) {
2833 gwin->
lastclick.tv_sec = curtime.tv_sec;
2834 gwin->
lastclick.tv_usec = curtime.tv_usec;
2860 switch(
result & WMHI_GADGETMASK)
2864 if(ClickTabBase->lib_Version >= 53) {
2874 GetClickTabNodeAttrs(tabnode,
2875 TNA_UserData, &closedgw,
2896 GetAttr(STRINGA_TextVal,
2928 if(storage != NULL) {
2929 GetChooserNodeAttrs((
struct Node *)storage, CNA_Text, (ULONG *)&prov, TAG_DONE);
2944 GetAttr(STRINGA_TextVal,
3017 ULONG w_top, w_left;
3018 ULONG g_top, g_left, g_height;
3029 NSLOG(netsurf, INFO,
"Unable to open page info window");
3035 GetAttr(STRINGA_TextVal,
3059 storage =
result & WMHI_GADGETMASK;
3060 if(storage >= IECODE_UP_PREFIX)
break;
3066 if((ie->ie_Qualifier & IEQUALIFIER_RCOMMAND) &&
3067 ((31 < nskey) && (nskey < 127))) {
3185 case WMHI_CLOSEWINDOW:
3192 struct bitmap *bm = NULL;
3198 HideWindow(gwin->
win);
3210 0, gwin->dobj, NULL);
3227 case WMHI_INTUITICK:
3244 if(drag_x_move || drag_y_move)
3260 if(gwin->
closed ==
true) {
3286 if((gwin == NULL) || (gwin->
gw != gw))
return NSERROR_OK;
3321 BUTTON_RenderImage, gwin->
objects[bm_idx],
3330 struct AppMessage *appmsg;
3333 struct WBArg *appwinargs;
3337 while((appmsg = (
struct AppMessage *)GetMsg(
appport)))
3341 if(appmsg->am_Type == AMTYPE_APPICON)
3345 ActivateWindow(gwin->
win);
3347 else if(appmsg->am_Type == AMTYPE_APPWINDOW)
3349 for(i = 0; i < appmsg->am_NumArgs; ++i)
3351 if((appwinargs = &appmsg->am_ArgList[i]))
3353 if((filename = malloc(1024)))
3355 if(appwinargs->wa_Lock)
3357 NameFromLock(appwinargs->wa_Lock, filename, 1024);
3360 AddPart(filename, appwinargs->wa_Name, 1024);
3363 appmsg->am_MouseX, appmsg->am_MouseY) ==
false)
3382 ActivateWindow(gwin->
win);
3418 ActivateWindow(gwin->
win);
3439 ReplyMsg((
struct Message *)appmsg);
3446 struct ApplicationMsg *applibmsg;
3453 while((applibmsg=(
struct ApplicationMsg *)GetMsg(
applibport)))
3455 switch (applibmsg->type)
3457 case APPLIBMT_NewBlankDoc:
3475 case APPLIBMT_OpenDoc:
3477 struct ApplicationOpenPrintDocMsg *applibopdmsg =
3478 (
struct ApplicationOpenPrintDocMsg *)applibmsg;
3495 case APPLIBMT_ToFront:
3498 ScreenToFront(
scrn);
3504 case APPLIBMT_OpenPrefs:
3505 ScreenToFront(
scrn);
3510 case APPLIBMT_ForceQuit:
3514 case APPLIBMT_CustomMsg:
3516 struct ApplicationCustomMsg *applibcustmsg =
3517 (
struct ApplicationCustomMsg *)applibmsg;
3518 NSLOG(netsurf, INFO,
3519 "Ringhio BackMsg received: %s",
3520 applibcustmsg->customMsg);
3526 ReplyMsg((
struct Message *)applibmsg);
3533 ULONG winsignal = 1L <<
sport->mp_SigBit;
3534 ULONG appsig = 1L <<
appport->mp_SigBit;
3536 ULONG ctrlcsig = SIGBREAKF_CTRL_C;
3538 fd_set read_fd_set, write_fd_set, except_fd_set;
3543 if(printmsgport) printsig = 1L << printmsgport->mp_SigBit;
3544 uint32 signalmask = winsignal | appsig | schedulesig |
rxsig |
3552 if (waitselect(max_fd + 1, &read_fd_set, &write_fd_set, &except_fd_set,
3553 NULL, (
unsigned int *)&signalmask) != -1) {
3554 signal = signalmask;
3556 NSLOG(netsurf, INFO,
"waitselect() returned error");
3567 signalmask |= ctrlcsig;
3568 signal = Wait(signalmask);
3571 if(signal & winsignal)
3583 if(signal & printsig) {
3584 while(GetMsg(printmsgport));
3588 if(signal & schedulesig) {
3592 if(signal & helpsignal)
3595 if(signal & ctrlcsig)
3602 struct Node *ptab = NULL;
3604 if(gwin->
tabs <= 1)
return;
3615 CLICKTAB_CurrentNode, ptab,
3625 char *restrict utf8title;
3639 CLICKTAB_Labels, ~0,
3645 SetClickTabNodeAttrs(node, TNA_Text, g->
tabtitle,
3654 if(ClickTabBase->lib_Version < 53)
3676 if(!g || !g->
bw)
return;
3689 SCROLLER_Total, (ULONG)(
height),
3690 SCROLLER_Visible, bbox->Height,
3699 SCROLLER_Total, (ULONG)(
width),
3700 SCROLLER_Visible, bbox->Width,
3723 struct rect *restrict deferred_rect;
3735 sizeof(
struct rect));
3736 CopyMem(
rect, deferred_rect,
sizeof(
struct rect));
3740 NSLOG(netsurf, INFO,
3741 "Ignoring duplicate or subset of queued box redraw");
3752 struct Node *tabnode;
3758 if(gwin->
tabs == 0)
return;
3765 GetClickTabNodeAttrs(tabnode,
3766 TNA_UserData, &gwin->
gw,
3779 gwin->
win, NULL, STRINGA_TextVal,
"", TAG_DONE);
3841 }
while((node = nnode));
3861 res = TimedDosRequesterTags(TDR_ImageType, TDRIMAGE_INFO,
3863 TDR_FormatString, utf8text,
3864 TDR_GadgetString, utf8gadgets,
3879 if(
scrn == NULL)
return;
3882 UnlockPubScreen(NULL,
scrn);
3889 if(CloseScreen(
scrn) == TRUE) {
3897 if(donotwait == TRUE)
return;
3900 NSLOG(netsurf, INFO,
3901 "Waiting for visitor windows to close... (signal)");
3904 while (CloseScreen(
scrn) == FALSE) {
3905 NSLOG(netsurf, INFO,
3906 "Waiting for visitor windows to close... (polling)");
3948 NSLOG(netsurf, INFO,
"Freeing menu items");
3952 NSLOG(netsurf, INFO,
"Freeing mouse pointers");
3966 NSLOG(netsurf, INFO,
"Closing screen");
3973 STRPTR filename = NULL;
3976 NSLOG(netsurf, INFO,
"favicon cache location: %s", filename);
3978 if (only_if_avail ==
true) {
3980 if((lock = Lock(filename, ACCESS_READ))) {
3993 STRPTR filename = NULL;
4006 GetAttr(STRINGA_TextVal,
4027 const char *title,
nsurl *url,
bool is_folder)
4030 struct Node *speed_button_node;
4031 char menu_icon[1024];
4032 char *utf8title = NULL;
4034 if(level != 1)
return false;
4036 if(is_folder ==
true)
return false;
4044 if (iconname == NULL) iconname =
ASPrintf(
"icons/content.png");
4049 BITMAP_Screen,
scrn,
4050 BITMAP_SourceFile, menu_icon,
4051 BITMAP_Masking, TRUE,
4062 LABEL_DisposeImage, TRUE,
4065 LABEL_Text, utf8title,
4070 speed_button_node = AllocSpeedButtonNode(item,
4071 SBNA_Image, lab_item,
4073 SBNA_UserData, (
void *)url,
4076 AddTail(tb_userdata->
sblist, speed_button_node);
4078 tb_userdata->
items++;
4086 userdata.
sblist = speed_button_list;
4090 return userdata.
items;
4095 struct TagItem attrs[2];
4097 attrs[0].ti_Tag = CHILD_MinWidth;
4098 attrs[0].ti_Data = 0;
4099 attrs[1].ti_Tag = TAG_DONE;
4100 attrs[1].ti_Data = 0;
4109 ICA_TARGET, ICTARGET_IDCMP,
4110 SPEEDBAR_BevelStyle, BVS_NONE,
4116 BEVEL_Style, BVS_SBAR_VERT,
4135 gwin->
win, NULL, TRUE);
4149 if(IsListEmpty(speed_button_list))
return;
4150 node =
GetHead(speed_button_list);
4155 FreeSpeedButtonNode(node);
4156 }
while((node = nnode));
4183 gwin->
win, NULL, TRUE);
4198 SPEEDBAR_Buttons, ~0,
4235 }
while((node = nnode));
4240 if(ClickTabBase->lib_Version < 53)
return;
4243 struct TagItem attrs[3];
4245 attrs[0].ti_Tag = CHILD_WeightedWidth;
4246 attrs[0].ti_Data = 0;
4247 attrs[1].ti_Tag = CHILD_WeightedHeight;
4248 attrs[1].ti_Data = 0;
4249 attrs[2].ti_Tag = TAG_DONE;
4250 attrs[2].ti_Data = 0;
4303 gwin->
win, NULL, TRUE);
4305 if (gwin->
gw && gwin->
gw->
bw) {
4329 if(gwin->
tabs == 1) {
4337 }
while((node = nnode));
4364 if(window == windows) *
tabs = gwin->
tabs;
4366 }
while((node = nnode));
4456 width += (left - sx);
4460 if(((top - sy) +
height) > bbox->Height)
4461 height = bbox->Height - (top - sy);
4463 if(((left - sx) +
width) > bbox->Width)
4464 width = bbox->Width - (left - sx);
4466 if(
width <= 0)
return;
4471 for(y = top; y < (top +
height); y += tile_size_y) {
4473 clip.y1 = tile_size_y;
4475 if(((y - sy) +
clip.y1) > bbox->Height)
4476 clip.y1 = bbox->Height - (y - sy);
4478 for(x = left; x < (left +
width); x += tile_size_x) {
4480 clip.x1 = tile_size_x;
4482 if(((x - sx) +
clip.x1) > bbox->Width)
4483 clip.x1 = bbox->Width - (x - sx);
4492 BltBitMapTags(BLITA_SrcType, BLITT_BITMAP,
4496 BLITA_DestType, BLITT_RASTPORT,
4497 BLITA_Dest, gwin->
win->RPort,
4498 BLITA_DestX, bbox->Left + (
int)(x - sx),
4499 BLITA_DestY, bbox->Top + (
int)(y - sy),
4500 BLITA_Width, (
int)(
clip.x1),
4501 BLITA_Height, (
int)(
clip.y1),
4505 bbox->Left + (
int)(x - sx),
4506 bbox->Top + (
int)(y - sy),
4507 (
int)(
clip.x1), (
int)(
clip.y1), 0xC0);
4530 int x0,
int y0,
int x1,
int y1)
4537 .background_images =
true,
4556 x1 - x0, y1 - y0, sx, sy, bbox, &ctx);
4570 struct RegionRectangle *regrect;
4583 BeginRefresh(gwin->
win);
4585 r.
x0 = (gwin->
win->RPort->Layer->DamageList->bounds.MinX - bbox->Left) + sx - 1;
4586 r.
x1 = (gwin->
win->RPort->Layer->DamageList->bounds.MaxX - bbox->Left) + sx + 2;
4587 r.
y0 = (gwin->
win->RPort->Layer->DamageList->bounds.MinY - bbox->Top) + sy - 1;
4588 r.
y1 = (gwin->
win->RPort->Layer->DamageList->bounds.MaxY - bbox->Top) + sy + 2;
4590 regrect = gwin->
win->RPort->Layer->DamageList->RegionRectangle;
4596 r.
x0 = (regrect->bounds.MinX - bbox->Left) + sx - 1;
4597 r.
x1 = (regrect->bounds.MaxX - bbox->Left) + sx + 2;
4598 r.
y0 = (regrect->bounds.MinY - bbox->Top) + sy - 1;
4599 r.
y1 = (regrect->bounds.MaxY - bbox->Top) + sy + 2;
4601 regrect = regrect->Next;
4606 EndRefresh(gwin->
win, TRUE);
4612HOOKF(
void, ami_scroller_hook, Object *,
object,
struct IntuiMessage *)
4616 struct IntuiWheelData *wheel;
4617 struct Node *node = NULL;
4622 case IDCMP_IDCMPUPDATE:
4623 gid = GetTagData( GA_ID, 0, msg->IAddress );
4636 if((node = (
struct Node *)GetTagData(SPEEDBAR_SelectedNode, 0, msg->IAddress))) {
4637 GetSpeedButtonNodeAttrs(node, SBNA_UserData, (ULONG *)&url, TAG_DONE);
4661 if(msg->Code == IMSGCODE_INTUIWHEELDATA)
4663 wheel = (
struct IntuiWheelData *)msg->IAddress;
4669 case IDCMP_SIZEVERIFY:
4672 case IDCMP_REFRESHWINDOW:
4677 NSLOG(netsurf, INFO,
4678 "IDCMP hook unhandled event: %ld", msg->Class);
4724 char nav_west[100],nav_west_s[100],nav_west_g[100];
4725 char nav_east[100],nav_east_s[100],nav_east_g[100];
4726 char stop[100],stop_s[100],stop_g[100];
4728 char home[100],home_s[100],home_g[100];
4729 char closetab[100],closetab_s[100],closetab_g[100];
4730 char addtab[100],addtab_s[100],addtab_g[100];
4731 char fave[100], unfave[100];
4732 char pi_insecure[100], pi_internal[100], pi_local[100], pi_secure[100], pi_warning[100];
4733 char tabthrobber[100];
4734 ULONG refresh_mode = WA_SmartRefresh;
4735 ULONG defer_layout = TRUE;
4736 ULONG idcmp_sizeverify = IDCMP_SIZEVERIFY;
4738 NSLOG(netsurf, INFO,
"Creating window");
4743 if (
nsoption_bool(resize_with_contents)) idcmp_sizeverify = 0;
4747 offset =
scrn->WBorTop +
scrn->Font->ta_YSize + 1;
4751 cury = existing->
shared->
win->TopEdge + offset;
4760 if(curh > (
scrn->Height - cury)) curh =
scrn->Height - cury;
4780 LBCIA_Title,
"time",
4782 LBCIA_DraggableSeparator, TRUE,
4783 LBCIA_Separator, TRUE,
4786 LBCIA_Title,
"source",
4788 LBCIA_DraggableSeparator, TRUE,
4789 LBCIA_Separator, TRUE,
4792 LBCIA_Title,
"level",
4794 LBCIA_DraggableSeparator, TRUE,
4795 LBCIA_Separator, TRUE,
4798 LBCIA_Title,
"message",
4800 LBCIA_DraggableSeparator, TRUE,
4801 LBCIA_Separator, TRUE,
4819 CLICKTAB_Labels, ~0,
4831 struct Node *insert_after = existing->
tab_node;
4848 CLICKTAB_Current, g->
tab,
4852 if(ClickTabBase->lib_Version < 53) {
4898 refresh_mode = WA_SimpleRefresh;
4899 defer_layout = FALSE;
4902 refresh_mode = WA_SmartRefresh;
4903 defer_layout = TRUE;
4908 ULONG addtabclosegadget = TAG_IGNORE;
4909 ULONG iconifygadget = FALSE;
4915 iconifygadget = TRUE;
4918 NSLOG(netsurf, INFO,
"Creating menu");
4991 BITMAP_SourceFile, fave,
4992 BITMAP_Screen,
scrn,
4993 BITMAP_Masking, TRUE,
4997 BITMAP_SourceFile, unfave,
4998 BITMAP_Screen,
scrn,
4999 BITMAP_Masking, TRUE,
5003 BITMAP_SourceFile, addtab,
5004 BITMAP_SelectSourceFile, addtab_s,
5006 BITMAP_Screen,
scrn,
5007 BITMAP_Masking, TRUE,
5011 BITMAP_SourceFile, closetab,
5012 BITMAP_SelectSourceFile, closetab_s,
5014 BITMAP_Screen,
scrn,
5015 BITMAP_Masking, TRUE,
5019 BITMAP_SourceFile, pi_insecure,
5020 BITMAP_Screen,
scrn,
5021 BITMAP_Masking, TRUE,
5025 BITMAP_SourceFile, pi_internal,
5026 BITMAP_Screen,
scrn,
5027 BITMAP_Masking, TRUE,
5031 BITMAP_SourceFile, pi_local,
5032 BITMAP_Screen,
scrn,
5033 BITMAP_Masking, TRUE,
5037 BITMAP_SourceFile, pi_secure,
5038 BITMAP_Screen,
scrn,
5039 BITMAP_Masking, TRUE,
5043 BITMAP_SourceFile, pi_warning,
5044 BITMAP_Screen,
scrn,
5045 BITMAP_Masking, TRUE,
5049 if(ClickTabBase->lib_Version < 53)
5051 addtabclosegadget = LAYOUT_AddChild;
5076 BITMAP_SourceFile, tabthrobber,
5078 BITMAP_Masking,TRUE,
5082 NSLOG(netsurf, INFO,
"Creating window object");
5087 WA_DepthGadget, TRUE,
5089 WA_CloseGadget, TRUE,
5090 WA_SizeGadget, TRUE,
5096 WA_ReportMouse,TRUE,
5098 WA_SizeBBottom, TRUE,
5100 WA_IDCMP, IDCMP_MENUPICK | IDCMP_MOUSEMOVE |
5101 IDCMP_MOUSEBUTTONS | IDCMP_NEWSIZE |
5102 IDCMP_RAWKEY | idcmp_sizeverify |
5103 IDCMP_GADGETUP | IDCMP_IDCMPUPDATE |
5104 IDCMP_REFRESHWINDOW |
5106 WINDOW_IconifyGadget, iconifygadget,
5107 WINDOW_MenuStrip, menu,
5108 WINDOW_MenuUserData, WGUD_HOOK,
5111 WINDOW_IDCMPHookBits, IDCMP_IDCMPUPDATE | IDCMP_REFRESHWINDOW |
5113 WINDOW_SharedPort,
sport,
5115 WINDOW_GadgetHelp, TRUE,
5116 WINDOW_UserData, g->
shared,
5118 LAYOUT_DeferLayout, defer_layout,
5119 LAYOUT_SpaceOuter, TRUE,
5121 LAYOUT_VertAlignment, LALIGN_CENTER,
5129 BITMAP_SourceFile,nav_west,
5130 BITMAP_SelectSourceFile,nav_west_s,
5133 BITMAP_Masking,TRUE,
5136 CHILD_WeightedWidth,0,
5137 CHILD_WeightedHeight,0,
5145 BITMAP_SourceFile,nav_east,
5146 BITMAP_SelectSourceFile,nav_east_s,
5149 BITMAP_Masking,TRUE,
5152 CHILD_WeightedWidth,0,
5153 CHILD_WeightedHeight,0,
5159 BITMAP_SourceFile,stop,
5160 BITMAP_SelectSourceFile,stop_s,
5163 BITMAP_Masking,TRUE,
5166 CHILD_WeightedWidth,0,
5167 CHILD_WeightedHeight,0,
5173 BITMAP_SourceFile,
reload,
5174 BITMAP_SelectSourceFile,reload_s,
5177 BITMAP_Masking,TRUE,
5180 CHILD_WeightedWidth,0,
5181 CHILD_WeightedHeight,0,
5187 BITMAP_SourceFile,home,
5188 BITMAP_SelectSourceFile,home_s,
5191 BITMAP_Masking,TRUE,
5194 CHILD_WeightedWidth,0,
5195 CHILD_WeightedHeight,0,
5197 LAYOUT_VertAlignment, LALIGN_CENTER,
5201 SPACE_MinHeight, 16,
5202 SPACE_Transparent, TRUE,
5205 CHILD_WeightedWidth, 0,
5206 CHILD_WeightedHeight, 0,
5213 CHILD_WeightedWidth, 0,
5214 CHILD_WeightedHeight, 0,
5221 STRINGA_MaxChars, 2000,
5237 CHILD_WeightedWidth, 0,
5238 CHILD_WeightedHeight, 0,
5243 LAYOUT_WeightBar, TRUE,
5245 LAYOUT_VertAlignment, LALIGN_CENTER,
5249 CHOOSER_DropDown, TRUE,
5251 CHOOSER_MaxLabels, 40,
5253 CHILD_WeightedWidth,0,
5254 CHILD_WeightedHeight,0,
5257 STRINGA_TextVal, NULL,
5267 SPACE_Transparent,TRUE,
5270 CHILD_WeightedWidth,0,
5271 CHILD_WeightedHeight,0,
5273 CHILD_WeightedHeight,0,
5275 BEVEL_Style, BVS_SBAR_VERT,
5277 CHILD_WeightedHeight, 0,
5279 LAYOUT_SpaceInner, FALSE,
5281 CHILD_WeightedHeight,0,
5283 LAYOUT_SpaceInner,FALSE,
5285 CHILD_WeightedWidth,0,
5286 CHILD_WeightedHeight,0,
5289 CHILD_CacheDomain,FALSE,
5292 CHILD_WeightedWidth,0,
5293 CHILD_WeightedHeight,0,
5295 CHILD_WeightedHeight,0,
5302 SPACE_Transparent,TRUE,
5311 CHILD_WeightedHeight, 0,
5316 STRINGA_TextVal, NULL,
5334 WA_DepthGadget, FALSE,
5336 WA_CloseGadget, FALSE,
5341 WA_Width,
scrn->Width,
5342 WA_Height,
scrn->Height,
5343 WA_SizeGadget, FALSE,
5345 WA_ReportMouse, TRUE,
5347 WA_IDCMP, IDCMP_MENUPICK | IDCMP_MOUSEMOVE |
5348 IDCMP_MOUSEBUTTONS | IDCMP_NEWSIZE |
5349 IDCMP_RAWKEY | IDCMP_REFRESHWINDOW |
5350 IDCMP_GADGETUP | IDCMP_IDCMPUPDATE |
5353 WINDOW_IDCMPHookBits, IDCMP_IDCMPUPDATE |
5355 WINDOW_SharedPort,
sport,
5356 WINDOW_UserData,g->
shared,
5359 LAYOUT_DeferLayout, defer_layout,
5360 LAYOUT_SpaceOuter, TRUE,
5365 SPACE_Transparent,TRUE,
5373 NSLOG(netsurf, INFO,
"Opening window");
5377 NSLOG(netsurf, INFO,
"Window opened, adding border gadgets");
5391 struct DrawInfo *dri = GetScreenDrawInfo(
scrn);
5393 ami_get_border_gadget_size(g->
shared,
5400 GA_Left,
scrn->WBorLeft + 2,
5402 GA_BottomBorder, TRUE,
5412 IA_Top, (
int)(- ceil((
scrn->WBorBottom +
height) / 2)),
5422 (UWORD)~0, -1, NULL);
5434 FreeScreenDrawInfo(
scrn, dri);
5449 UnlockPubScreen(NULL,
scrn);
5453 ScreenToFront(
scrn);
5467 if(res == 0)
return;
5475 GetClickTabNodeAttrs(
tab,
5479 if((other_tabs ==
false) || (gwin->
gw != gw)) {
5482 }
while((
tab=ntab));
5501 struct Node *ptab = NULL;
5541 CLICKTAB_CurrentNode, ptab,
5544 if(ClickTabBase->lib_Version < 53)
5555 FreeListBrowserList(&g->
loglist);
5598 FreeListBrowserList(&g->
loglist);
5607 for(gid = 0; gid <
GID_LAST; gid++)
5677 NSLOG(netsurf, INFO,
"Ignoring deferred box redraw queue");
5691 }
while((node = nnode));
5697 const struct rect *restrict new_rect, APTR mempool)
5711 if((
rect->
x0 <= new_rect->x0) &&
5712 (
rect->
y0 <= new_rect->y0) &&
5713 (
rect->
x1 >= new_rect->x1) &&
5714 (
rect->
y1 >= new_rect->y1)) {
5718 if ((new_rect->x0 <=
rect->
x0) &&
5719 (new_rect->y0 <=
rect->
y0) &&
5720 (new_rect->x1 >=
rect->
x1) &&
5721 (new_rect->y1 >=
rect->
y1)) {
5722 NSLOG(netsurf, INFO,
5723 "Removing queued redraw that is a subset of new box redraw");
5728 }
while((node = nnode));
5736 ULONG hcurrent,vcurrent,xoffset,yoffset,
width=800,
height=600;
5738 ULONG oldh = gwin->
oldh, oldv=gwin->
oldv;
5760 if((abs(vcurrent-oldv) >
height) || (abs(hcurrent-oldh) >
width))
5773 ScrollWindowRaster(gwin->
win, hcurrent - oldh, vcurrent - oldv,
5774 xoffset, yoffset, xoffset +
width - 1, yoffset +
height - 1);
5784 else if(vcurrent<oldv)
5797 else if(hcurrent<oldh)
5808 .background_images =
true,
5821 gwin->
oldh = hcurrent;
5822 gwin->
oldv = vcurrent;
5900 if(sx >=
width - bbox->Width)
5901 sx =
width - bbox->Width;
5902 if(sy >=
height - bbox->Height)
5903 sy =
height - bbox->Height;
5905 if(width <= bbox->Width) sx = 0;
5906 if(height <= bbox->Height) sy = 0;
5914 SCROLLER_Top, (ULONG)(sy),
5922 SCROLLER_Top, (ULONG)(sx),
5942 struct TextExtent textex;
5950 if(utf8text == NULL)
return;
5953 chars = TextFit(&
scrn->RastPort, utf8text, (UWORD)strlen(utf8text),
5954 &textex, NULL, 1, size - 4,
scrn->RastPort.TxHeight);
5956 utf8text[chars] = 0;
5974 char *idn_url_s = NULL;
5975 char *url_lc = NULL;
5993 if(idn_url_s) free(idn_url_s);
6002HOOKF(
uint32, ami_set_favicon_render_hook, APTR, space,
struct gpRender *)
6016 struct bitmap *ico_bitmap)
6018 struct BitMap *bm = NULL;
6026 if (ico_bitmap != NULL) {
6043 ULONG bm_masking_tag = TAG_IGNORE;
6047 bm_masking_tag = BITMAP_Masking;
6051 BITMAP_Screen,
scrn,
6056 bm_masking_tag, TRUE,
6065 }
while((node = nnode));
6070HOOKF(
uint32, ami_set_throbber_render_hook, APTR, space,
struct gpRender *)
6077HOOKF(
uint32, ami_gui_browser_render_hook, APTR, space,
struct gpRender *)
6081 NSLOG(netsurf, DEBUG,
"Render hook called with %ld (REDRAW=1)", msg->gpr_Redraw);
6083 if(msg->gpr_Redraw != GREDRAW_REDRAW)
return 0;
6110 if((y-ys+
height) > (bbox->Height))
height = bbox->Height-y+ys;
6112 if(((x-xs) <= 0) || ((x-xs+2) >= (bbox->Width)) || ((y-ys) <= 0) || ((y-ys) >= (bbox->Height))) {
6119 SetDrMd(g->
shared->
win->RPort,COMPLEMENT);
6120 RectFill(g->
shared->
win->RPort, x + bbox->Left - xs, y + bbox->Top - ys,
6121 x + bbox->Left + g->
c_w - xs, y+bbox->Top +
height - ys);
6137 if(g->
c_h == 0)
return;
6178 SetWindowAttrs(g->
shared->
win, WA_GrabFocus, 0,
6179 WA_MouseLimits, NULL, TAG_DONE);
6206 *x = *x - (bbox->Left) +xs;
6209 *y = *y - (bbox->Top) + ys;
6232 if((x >= left) && (x <= (left +
width)) && (y >= top) && (y <= (top +
height)))
6239 Object *restrict win_obj, *restrict bm_obj;
6241 struct Screen *wbscreen = LockPubScreen(
"Workbench");
6242 uint32 top = 0, left = 0;
6243 struct TextAttr tattr;
6244 struct TextFont *tfont;
6250 WA_Borderless, TRUE,
6251 WA_BusyPointer, TRUE,
6252 WINDOW_Position, WPOS_CENTERSCREEN,
6253 WINDOW_LockWidth, TRUE,
6254 WINDOW_LockHeight, TRUE,
6257 BITMAP_SourceFile,
"PROGDIR:Resources/splash.png",
6258 BITMAP_Screen, wbscreen,
6259 BITMAP_Precision, PRECISION_IMAGE,
6264 if(win_obj == NULL) {
6265 NSLOG(netsurf, INFO,
"Splash window object not created");
6269 NSLOG(netsurf, INFO,
"Attempting to open splash window...");
6270 win = RA_OpenWindow(win_obj);
6273 NSLOG(netsurf, INFO,
"Splash window did not open");
6277 if(bm_obj == NULL) {
6278 NSLOG(netsurf, INFO,
"BitMap object not created");
6286 SetDrMd(win->RPort, JAM1);
6289 tattr.ta_Name =
"DejaVu Serif Italic.font";
6291 SetAPen(win->RPort, 3);
6292 tattr.ta_Name =
"ruby.font";
6294 tattr.ta_YSize = 24;
6300 SetFont(win->RPort, tfont);
6304 tattr.ta_Name =
"DejaVu Serif Oblique.font";
6306 SetFont(win->RPort, tfont);
6309 Move(win->RPort, left + 5, top + 25);
6310 Text(win->RPort,
"Initialising...", strlen(
"Initialising..."));
6315 tattr.ta_Name =
"DejaVu Sans.font";
6317 tattr.ta_Name =
"helvetica.font";
6319 tattr.ta_YSize = 16;
6324 SetFont(win->RPort, tfont);
6326 Move(win->RPort, left + 185, top + 220);
6331 UnlockPubScreen(NULL, wbscreen);
6338 if(win_obj == NULL)
return;
6340 NSLOG(netsurf, INFO,
"Closing splash window");
6341 DisposeObject(win_obj);
6347 NSLOG(netsurf, INFO,
"File open dialog request for %p/%p", g, gadget);
6351 ASLFR_SleepWindow, TRUE,
6354 ASLFR_DoSaveMode, FALSE,
6357 strlcpy(fname,
filereq->fr_Drawer, 1024);
6358 AddPart(fname,
filereq->fr_File, 1024);
6378 if(current_user == NULL) {
6379 user = GetVar(
"user", temp, 1024, GVF_GLOBAL_ONLY);
6380 current_user =
ASPrintf(
"%s", (user == -1) ?
"Default" : temp);
6382 NSLOG(netsurf, INFO,
"User: %s", current_user);
6388 FreeVec(current_user);
6395 struct InfoData *infodata = AllocDosObject(DOS_INFODATA, 0);
6396 if(infodata == NULL) {
6398 FreeVec(current_user);
6401 GetDiskInfoTags(GDI_StringNameInput,
users_dir,
6402 GDI_InfoData, infodata,
6404 if(infodata->id_DiskState == ID_DISKSTATE_WRITE_PROTECTED) {
6405 FreeDosObject(DOS_INFODATA, infodata);
6407 FreeVec(current_user);
6410 FreeDosObject(DOS_INFODATA, infodata);
6412#warning FIXME for OS3 and older OS4
6418 int len = strlen(current_user);
6425 FreeVec(current_user);
6432 FreeVec(current_user);
6545 setbuf(stderr, NULL);
6549 STRPTR current_user_cache = NULL;
6550 STRPTR current_user = NULL;
6573 signal(SIGINT, SIG_IGN);
6658 if((lock =
CreateDirTree(current_user_cache))) UnLock(lock);
6662 if(current_user_cache != NULL) FreeVec(current_user_cache);
6704 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)
nserror utf8_to_local_encoding(const char *string, size_t len, char **result)
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: 1 is primary mouse button.
@ BROWSER_MOUSE_PRESS_1
primary button pressed
@ BROWSER_MOUSE_CLICK_2
button 2 clicked.
@ BROWSER_MOUSE_PRESS_2
auxillary button 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.