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;
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;
937nscolour_from_pen(
struct Screen *screen, UWORD pen,
colour sel_colour)
940 struct DrawInfo *drinfo;
942 drinfo = GetScreenDrawInfo(screen);
944 if (drinfo != NULL) {
950 GetRGB32(screen->ViewPort.ColorMap,
951 drinfo->dri_Pens[pen],
956 sel_colour = ((colr[0] & 0xff000000) >> 24) |
957 ((colr[1] & 0xff000000) >> 16) |
958 ((colr[2] & 0xff000000) >> 8);
960 FreeScreenDrawInfo(screen, drinfo);
969static nserror system_colours_from_pen(
struct Screen *screen)
971 #define MAP_SIZE (19)
979 struct pcm pen_colour_map[MAP_SIZE] = {
980 {NSOPTION_sys_colour_AccentColor, FILLPEN, 0x00000000},
981 {NSOPTION_sys_colour_AccentColorText, TEXTPEN, 0x00000000},
982 {NSOPTION_sys_colour_ActiveText, TEXTPEN, 0x00000000},
983 {NSOPTION_sys_colour_ButtonBorder, FILLPEN, 0x00000000},
984 {NSOPTION_sys_colour_ButtonFace, FOREGROUNDPEN, 0x00aaaaaa},
985 {NSOPTION_sys_colour_ButtonText, TEXTPEN, 0x00000000},
986 {NSOPTION_sys_colour_Canvas, BACKGROUNDPEN, 0x00aaaaaa},
987 {NSOPTION_sys_colour_CanvasText, TEXTPEN, 0x00000000},
988 {NSOPTION_sys_colour_Field, BACKGROUNDPEN, 0x00aaaaaa},
989 {NSOPTION_sys_colour_FieldText, TEXTPEN, 0x00000000},
991 {NSOPTION_sys_colour_Highlight, SELECTPEN, 0x00ee0000},
992 {NSOPTION_sys_colour_HighlightText, SELECTTEXTPEN, 0x00000000},
993 {NSOPTION_sys_colour_LinkText, TEXTPEN, 0x00000000},
994 {NSOPTION_sys_colour_Mark, FILLPEN, 0x00000000},
995 {NSOPTION_sys_colour_MarkText, TEXTPEN, 0x00000000},
996 {NSOPTION_sys_colour_SelectedItem, FILLPEN, 0x00000000},
997 {NSOPTION_sys_colour_SelectedItemText, TEXTPEN, 0x00000000},
998 {NSOPTION_sys_colour_VisitedText, TEXTPEN, 0x00000000},
1002 for (mapidx=0; mapidx < MAP_SIZE; mapidx++) {
1003 entry = &pen_colour_map[mapidx];
1004 sel_colour = nscolour_from_pen(screen, entry->pen, entry->def_colour);
1036 system_colours_from_pen(screen);
1049 STRPTR tempacceptlangs;
1059 if(ClickTabBase->lib_Version < 53)
1069 (
char *)strdup(tempacceptlangs));
1070 FreeVec(tempacceptlangs);
1081 if(codeset == 0) codeset = 4;
1096 (
char *)strdup(temp));
1100 (
char *)strdup(temp));
1104 (
char *)strdup(temp));
1108 (
char *)strdup(temp));
1111 (
char *)strdup(
"PROGDIR:Resources/ca-bundle"));
1144 if((lock = Lock(
"FONTS:Code2000.otag", ACCESS_READ)))
1148 (
char *)strdup(
"Code2000"));
1150 else if((lock = Lock(
"FONTS:Bitstream Cyberbit.otag", ACCESS_READ)))
1154 (
char *)strdup(
"Bitstream Cyberbit"));
1164 if((lock = Lock(
"FONTS:Symbola.otag", ACCESS_READ))) {
1167 (
char *)strdup(
"Symbola"));
1180 if(((lock = Lock(
"ENVARC:AppPaths",SHARED_LOCK)) == 0))
1182 lock = CreateDir(
"ENVARC:AppPaths");
1187 if((lock = Lock(
"PROGDIR:", ACCESS_READ)))
1189 char filename[1024];
1194 if((amiupdatefh =
FOpen(
"ENVARC:AppPaths/NetSurf", MODE_NEWFILE, 0))) {
1195 FPuts(amiupdatefh, (CONST_STRPTR)&filename);
1216HOOKF(
void, ami_gui_newprefs_hook, APTR, window, APTR)
1239 struct ScreenModeRequester *screenmodereq = NULL;
1241 if((screenmodereq = AllocAslRequest(ASL_ScreenModeRequest,NULL))) {
1242 if(AslRequestTags(screenmodereq,
1247 char *modeid = malloc(20);
1248 id = screenmodereq->sm_DisplayID;
1249 sprintf(modeid,
"0x%lx",
id);
1253 FreeAslRequest(screenmodereq);
1259 scrn = OpenScreenTags(NULL,
1263 SA_Type, PUBLICSCREEN,
1264 SA_PubName,
"NetSurf",
1266 SA_PubTask, FindTask(0),
1267 SA_LikeWorkbench, TRUE,
1273 PubScreenStatus(
scrn,0);
1280 if((
scrn = LockPubScreen(
"NetSurf")))
1287 strdup(
"Workbench"));
1298 scrn = LockPubScreen(
"Workbench");
1316 int *restrict nargc,
char ** nargv)
1318 struct RDArgs *args;
1319 CONST_STRPTR
template =
"-v/S,NSOPTS/M,URL/K,USERSDIR/K,FORCE/S";
1320 long rarray[] = {0,0,0,0,0};
1330 if(*argc == 0)
return NULL;
1332 if((args = ReadArgs(
template, rarray, NULL))) {
1334 NSLOG(netsurf, INFO,
1335 "URL %s specified on command line",
1336 (
char *)rarray[A_URL]);
1340 if(rarray[A_USERSDIR]) {
1341 NSLOG(netsurf, INFO,
1342 "USERSDIR %s specified on command line",
1343 (
char *)rarray[A_USERSDIR]);
1347 if(rarray[A_FORCE]) {
1348 NSLOG(netsurf, INFO,
1349 "FORCE specified on command line");
1353 if(rarray[A_NSOPTS]) {
1369 NSLOG(netsurf, INFO,
"ReadArgs failed to parse command line");
1378 struct DiskObject *dobj;
1381 char *current_user = NULL;
1383 if((*wbarg->wa_Name) && (dobj = GetDiskObject(wbarg->wa_Name))) {
1384 toolarray = (STRPTR *)dobj->do_ToolTypes;
1386 if((s = (
char *)FindToolType(toolarray,
"USERSDIR")))
users_dir =
ASPrintf(
"%s", s);
1387 if((s = (
char *)FindToolType(toolarray,
"USER"))) current_user =
ASPrintf(
"%s", s);
1389 FreeDiskObject(dobj);
1391 return current_user;
1396 struct WBStartup *WBenchMsg;
1397 struct WBArg *wbarg;
1399 char *current_user = NULL;
1400 char *cur_user = NULL;
1403 WBenchMsg = (
struct WBStartup *)argv;
1404 for(i = 0, wbarg = WBenchMsg->sm_ArgList; i < WBenchMsg->sm_NumArgs; i++,wbarg++) {
1406 if((wbarg->wa_Lock) && (*wbarg->wa_Name))
1410 if(cur_user != NULL) {
1411 if(current_user != NULL) FreeVec(current_user);
1412 current_user = cur_user;
1419 return current_user;
1424 struct Screen *screen;
1425 BOOL notalreadyrunning;
1434 if((screen = LockPubScreen(
"Workbench"))) {
1436 UnlockPubScreen(NULL, screen);
1447 if (notalreadyrunning &&
1452 notalreadyrunning = TRUE;
1473 struct WBStartup *WBenchMsg = (
struct WBStartup *)argv;
1474 struct WBArg *wbarg;
1476 char fullpath[1024];
1478 for(i=0,wbarg=WBenchMsg->sm_ArgList;i<WBenchMsg->sm_NumArgs;i++,wbarg++)
1481 if((wbarg->wa_Lock)&&(*wbarg->wa_Name))
1484 AddPart(fullpath,wbarg->wa_Name,1024);
1494 if(notalreadyrunning)
1534 if(!notalreadyrunning)
1536 STRPTR sendcmd = NULL;
1537 char newtab[11] =
"\0";
1540 strcpy(newtab,
"TAB ACTIVE");
1564 ULONG noicon = TAG_IGNORE;
1567 noicon = REGAPP_NoIcon;
1570 REGAPP_URLIdentifier,
"netsurf-browser.org",
1571 REGAPP_WBStartup, (
struct WBStartup *)argv,
1573 REGAPP_HasPrefsWindow, TRUE,
1574 REGAPP_CanCreateNewDocs, TRUE,
1575 REGAPP_UniqueApplication, TRUE,
1583 REGAPP_URLIdentifier,
"netsurf-browser.org",
1584 REGAPP_FileName, argv[0],
1585 REGAPP_NoIcon, TRUE,
1586 REGAPP_HasPrefsWindow, TRUE,
1587 REGAPP_CanCreateNewDocs, TRUE,
1588 REGAPP_UniqueApplication, TRUE,
1615 long back=FALSE, forward=FALSE, tabclose=FALSE, stop=FALSE,
reload=FALSE;
1616 long s_back, s_forward, s_tabclose, s_stop, s_reload;
1631 if(gwin->
tabs <= 1) {
1646 gwin->
win, NULL, GA_Disabled, back, TAG_DONE);
1650 gwin->
win, NULL, GA_Disabled, forward, TAG_DONE);
1654 gwin->
win, NULL, GA_Disabled,
reload, TAG_DONE);
1658 gwin->
win, NULL, GA_Disabled, stop, TAG_DONE);
1660 if(ClickTabBase->lib_Version < 53) {
1661 if(gwin->
tabs <= 1) tabclose = TRUE;
1667 gwin->
win, NULL, GA_Disabled, tabclose, TAG_DONE);
1693 int nskey = 0, chars;
1697 if(keycode >= IECODE_UP_PREFIX)
return 0;
1779 if((chars = MapRawKey(ie,
buffer,20,NULL)) > 0) {
1784 if(ie->ie_Qualifier & IEQUALIFIER_RCOMMAND) {
1818 GetAttr(WINDOW_Qualifier, win_obj, (
uint32 *)&quals);
1820#warning qualifier needs fixing for OS3
1827 if(quals & IEQUALIFIER_CONTROL) {
1846 struct IBox *ib = AllocVec(
sizeof(
struct IBox),
MEMF_PRIVATE);
1850 GetAttr(SPACE_RenderBox, obj, (ULONG *)ib);
1855 GetAttr(SPACE_AreaBox, obj, (ULONG *)&t_ib);
1861 CopyMem(t_ib, ib,
sizeof(
struct IBox));
1872 if(bbox != NULL) FreeVec(bbox);
1876 int *restrict x,
int *restrict y,
int space_x,
int space_y)
1900 ns_x = (ULONG)(
mouse_x - bbox->Left);
1901 ns_y = (ULONG)(
mouse_y - bbox->Top);
1903 if((ns_x < 0) || (ns_x > bbox->Width) || (ns_y < 0) || (ns_y > bbox->Height)) {
1996 struct IBox *bbox, *ibox;
1998 ibox = malloc(
sizeof(
struct IBox));
1999 if(ibox == NULL)
return NULL;
2007 ibox->Left = gwin->
win->MouseX + (
rect->
x0);
2008 ibox->Top = gwin->
win->MouseY + (
rect->
y0);
2013 if(ibox->Left < bbox->Left) ibox->Left = bbox->Left;
2014 if(ibox->Top < bbox->Top) ibox->Top = bbox->Top;
2016 if((ibox->Left > (bbox->Left + bbox->Width)) ||
2017 (ibox->Top > (bbox->Top + bbox->Height)) ||
2018 (ibox->Width < 0) || (ibox->Height < 0))
2042 SetWindowAttrs(gwin->
win, WA_GrabFocus, 10,
2043 WA_MouseLimits, gwin->
ptr_lock, TAG_DONE);
2068 }
while((node = nnode));
2082 int *restrict
width,
2095 *
width = bbox->Width;
2107 struct TagItem attrs[2];
2111 attrs[0].ti_Tag = CHILD_MinWidth;
2112 attrs[0].ti_Data = 0;
2113 attrs[1].ti_Tag = TAG_DONE;
2114 attrs[1].ti_Data = 0;
2119 SCROLLER_Orientation, SORIENT_HORIZ,
2120 ICA_TARGET, ICTARGET_IDCMP,
2156 struct TagItem attrs[2];
2160 attrs[0].ti_Tag = CHILD_MinWidth;
2161 attrs[0].ti_Data = 0;
2162 attrs[1].ti_Tag = TAG_DONE;
2163 attrs[1].ti_Data = 0;
2168 ICA_TARGET, ICTARGET_IDCMP,
2209 int h = 1, w = 1, wh = 0, ww = 0;
2210 bool rethinkv =
false;
2211 bool rethinkh =
false;
2240 if(rethinkv || rethinkh) {
2243 gwin->
win, NULL, TRUE);
2271 struct TagItem attrs[2];
2275 attrs[0].ti_Tag = CHILD_MinHeight;
2276 attrs[0].ti_Data = 50;
2277 attrs[1].ti_Tag = TAG_DONE;
2278 attrs[1].ti_Data = 0;
2283 LISTBROWSER_ColumnTitles, TRUE,
2284 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;
2504 EraseRect(g->
shared->
win->RPort, bbox->Left, bbox->Top,
2505 bbox->Left + 16, bbox->Top + 16);
2508 BltBitMapTags(BLITA_SrcX, 0,
2510 BLITA_DestX, bbox->Left,
2511 BLITA_DestY, bbox->Top,
2516 BLITA_SrcType, BLITT_BITMAP,
2517 BLITA_DestType, BLITT_RASTPORT,
2518 BLITA_Minterm, minterm,
2523 BltMaskBitMapRastPort(bm, 0, 0, g->
shared->
win->RPort,
2524 bbox->Left, bbox->Top, 16, 16, minterm, tag_data);
2526 BltBitMapRastPort(bm, 0, 0, g->
shared->
win->RPort,
2527 bbox->Left, bbox->Top, 16, 16, 0xc0);
2547static ULONG ami_get_border_gadget_size(
struct gui_window_2 *gwin,
2550 static ULONG sz_gad_width = 0;
2551 static ULONG sz_gad_height = 0;
2552 ULONG available_width;
2554 if((sz_gad_width == 0) || (sz_gad_height == 0)) {
2555 struct DrawInfo *dri = GetScreenDrawInfo(
scrn);
2556 GetGUIAttrs(NULL, dri,
2557 GUIA_SizeGadgetWidth, &sz_gad_width,
2558 GUIA_SizeGadgetHeight, &sz_gad_height,
2560 FreeScreenDrawInfo(
scrn, dri);
2562 available_width = gwin->
win->Width -
scrn->WBorLeft - sz_gad_width;
2564 *
width = available_width;
2567 return sz_gad_width;
2577 ami_get_border_gadget_size(gwin, &size1, &size2);
2584 RefreshWindowFrame(gwin->
win);
2593 BOOL win_closed = FALSE;
2607 if(w == NULL)
continue;
2610 if((win_closed = w->
tbl->
event(w))) {
2621 }
while((node = nnode));
2640 struct InputEvent *ie;
2641 struct Node *tabnode;
2643 struct timeval curtime;
2644 static int drag_x_move = 0, drag_y_move = 0;
2647 BOOL win_closed = FALSE;
2650 switch(
result & WMHI_CLASSMASK)
2652 case WMHI_MOUSEMOVE:
2663 x = (ULONG)((gwin->
win->MouseX - bbox->Left));
2664 y = (ULONG)((gwin->
win->MouseY - bbox->Top));
2678 if((gwin->
win->MouseX < bbox->Left) &&
2680 drag_x_move = gwin->
win->MouseX - bbox->Left;
2681 if((gwin->
win->MouseX > (bbox->Left + bbox->Width)) &&
2683 drag_x_move = gwin->
win->MouseX - (bbox->Left + bbox->Width);
2684 if((gwin->
win->MouseY < bbox->Top) &&
2686 drag_y_move = gwin->
win->MouseY - bbox->Top;
2687 if((gwin->
win->MouseY > (bbox->Top + bbox->Height)) &&
2689 drag_y_move = gwin->
win->MouseY - (bbox->Top + bbox->Height);
2695 if((x>=xs) && (y>=ys) && (x<
width+xs) && (y<
height+ys))
2718 case WMHI_MOUSEBUTTONS:
2724 x = (ULONG)(gwin->
win->MouseX - bbox->Left);
2725 y = (ULONG)(gwin->
win->MouseY - bbox->Top);
2740 if((x>=xs) && (y>=ys) && (x<
width+xs) && (y<
height+ys))
2766 CurrentTime((ULONG *)&curtime.tv_sec, (ULONG *)&curtime.tv_usec);
2774 curtime.tv_sec, curtime.tv_usec)) {
2793 gwin->
lastclick.tv_sec = curtime.tv_sec;
2794 gwin->
lastclick.tv_usec = curtime.tv_usec;
2808 CurrentTime((ULONG *)&curtime.tv_sec, (ULONG *)&curtime.tv_usec);
2816 curtime.tv_sec, curtime.tv_usec)) {
2835 gwin->
lastclick.tv_sec = curtime.tv_sec;
2836 gwin->
lastclick.tv_usec = curtime.tv_usec;
2862 switch(
result & WMHI_GADGETMASK)
2866 if(ClickTabBase->lib_Version >= 53) {
2876 GetClickTabNodeAttrs(tabnode,
2877 TNA_UserData, &closedgw,
2898 GetAttr(STRINGA_TextVal,
2930 if(storage != NULL) {
2931 GetChooserNodeAttrs((
struct Node *)storage, CNA_Text, (ULONG *)&prov, TAG_DONE);
2946 GetAttr(STRINGA_TextVal,
3019 ULONG w_top, w_left;
3020 ULONG g_top, g_left, g_height;
3031 NSLOG(netsurf, INFO,
"Unable to open page info window");
3037 GetAttr(STRINGA_TextVal,
3061 storage =
result & WMHI_GADGETMASK;
3062 if(storage >= IECODE_UP_PREFIX)
break;
3068 if((ie->ie_Qualifier & IEQUALIFIER_RCOMMAND) &&
3069 ((31 < nskey) && (nskey < 127))) {
3187 case WMHI_CLOSEWINDOW:
3194 struct bitmap *bm = NULL;
3200 HideWindow(gwin->
win);
3212 0, gwin->dobj, NULL);
3229 case WMHI_INTUITICK:
3246 if(drag_x_move || drag_y_move)
3262 if(gwin->
closed ==
true) {
3288 if((gwin == NULL) || (gwin->
gw != gw))
return NSERROR_OK;
3323 BUTTON_RenderImage, gwin->
objects[bm_idx],
3332 struct AppMessage *appmsg;
3335 struct WBArg *appwinargs;
3339 while((appmsg = (
struct AppMessage *)GetMsg(
appport)))
3343 if(appmsg->am_Type == AMTYPE_APPICON)
3347 ActivateWindow(gwin->
win);
3349 else if(appmsg->am_Type == AMTYPE_APPWINDOW)
3351 for(i = 0; i < appmsg->am_NumArgs; ++i)
3353 if((appwinargs = &appmsg->am_ArgList[i]))
3355 if((filename = malloc(1024)))
3357 if(appwinargs->wa_Lock)
3359 NameFromLock(appwinargs->wa_Lock, filename, 1024);
3362 AddPart(filename, appwinargs->wa_Name, 1024);
3365 appmsg->am_MouseX, appmsg->am_MouseY) ==
false)
3384 ActivateWindow(gwin->
win);
3420 ActivateWindow(gwin->
win);
3441 ReplyMsg((
struct Message *)appmsg);
3448 struct ApplicationMsg *applibmsg;
3455 while((applibmsg=(
struct ApplicationMsg *)GetMsg(
applibport)))
3457 switch (applibmsg->type)
3459 case APPLIBMT_NewBlankDoc:
3477 case APPLIBMT_OpenDoc:
3479 struct ApplicationOpenPrintDocMsg *applibopdmsg =
3480 (
struct ApplicationOpenPrintDocMsg *)applibmsg;
3497 case APPLIBMT_ToFront:
3500 ScreenToFront(
scrn);
3506 case APPLIBMT_OpenPrefs:
3507 ScreenToFront(
scrn);
3512 case APPLIBMT_ForceQuit:
3516 case APPLIBMT_CustomMsg:
3518 struct ApplicationCustomMsg *applibcustmsg =
3519 (
struct ApplicationCustomMsg *)applibmsg;
3520 NSLOG(netsurf, INFO,
3521 "Ringhio BackMsg received: %s",
3522 applibcustmsg->customMsg);
3528 ReplyMsg((
struct Message *)applibmsg);
3535 ULONG winsignal = 1L <<
sport->mp_SigBit;
3536 ULONG appsig = 1L <<
appport->mp_SigBit;
3538 ULONG ctrlcsig = SIGBREAKF_CTRL_C;
3540 fd_set read_fd_set, write_fd_set, except_fd_set;
3545 if(printmsgport) printsig = 1L << printmsgport->mp_SigBit;
3546 uint32 signalmask = winsignal | appsig | schedulesig |
rxsig |
3554 if (waitselect(max_fd + 1, &read_fd_set, &write_fd_set, &except_fd_set,
3555 NULL, (
unsigned int *)&signalmask) != -1) {
3556 signal = signalmask;
3558 NSLOG(netsurf, INFO,
"waitselect() returned error");
3569 signalmask |= ctrlcsig;
3570 signal = Wait(signalmask);
3573 if(signal & winsignal)
3585 if(signal & printsig) {
3586 while(GetMsg(printmsgport));
3590 if(signal & schedulesig) {
3594 if(signal & helpsignal)
3597 if(signal & ctrlcsig)
3604 struct Node *ptab = NULL;
3606 if(gwin->
tabs <= 1)
return;
3617 CLICKTAB_CurrentNode, ptab,
3627 char *restrict utf8title;
3641 CLICKTAB_Labels, ~0,
3647 SetClickTabNodeAttrs(node, TNA_Text, g->
tabtitle,
3656 if(ClickTabBase->lib_Version < 53)
3678 if(!g || !g->
bw)
return;
3691 SCROLLER_Total, (ULONG)(
height),
3692 SCROLLER_Visible, bbox->Height,
3701 SCROLLER_Total, (ULONG)(
width),
3702 SCROLLER_Visible, bbox->Width,
3725 struct rect *restrict deferred_rect;
3737 sizeof(
struct rect));
3738 CopyMem(
rect, deferred_rect,
sizeof(
struct rect));
3742 NSLOG(netsurf, INFO,
3743 "Ignoring duplicate or subset of queued box redraw");
3754 struct Node *tabnode;
3760 if(gwin->
tabs == 0)
return;
3767 GetClickTabNodeAttrs(tabnode,
3768 TNA_UserData, &gwin->
gw,
3781 gwin->
win, NULL, STRINGA_TextVal,
"", TAG_DONE);
3843 }
while((node = nnode));
3863 res = TimedDosRequesterTags(TDR_ImageType, TDRIMAGE_INFO,
3865 TDR_FormatString, utf8text,
3866 TDR_GadgetString, utf8gadgets,
3881 if(
scrn == NULL)
return;
3884 UnlockPubScreen(NULL,
scrn);
3891 if(CloseScreen(
scrn) == TRUE) {
3899 if(donotwait == TRUE)
return;
3902 NSLOG(netsurf, INFO,
3903 "Waiting for visitor windows to close... (signal)");
3906 while (CloseScreen(
scrn) == FALSE) {
3907 NSLOG(netsurf, INFO,
3908 "Waiting for visitor windows to close... (polling)");
3950 NSLOG(netsurf, INFO,
"Freeing menu items");
3954 NSLOG(netsurf, INFO,
"Freeing mouse pointers");
3968 NSLOG(netsurf, INFO,
"Closing screen");
3975 STRPTR filename = NULL;
3978 NSLOG(netsurf, INFO,
"favicon cache location: %s", filename);
3980 if (only_if_avail ==
true) {
3982 if((lock = Lock(filename, ACCESS_READ))) {
3995 STRPTR filename = NULL;
4008 GetAttr(STRINGA_TextVal,
4033 const char *title,
nsurl *url,
bool is_folder)
4036 struct Node *speed_button_node;
4037 char menu_icon[1024];
4038 char *utf8title = NULL;
4040 if(level != 1)
return false;
4042 if(is_folder ==
true)
return false;
4050 if (iconname == NULL) iconname =
ASPrintf(
"icons/content.png");
4055 BITMAP_Screen,
scrn,
4056 BITMAP_SourceFile, menu_icon,
4057 BITMAP_Masking, TRUE,
4068 LABEL_DisposeImage, TRUE,
4071 LABEL_Text, utf8title,
4076 speed_button_node = AllocSpeedButtonNode(item,
4077 SBNA_Image, lab_item,
4079 SBNA_UserData, (
void *)url,
4082 AddTail(tb_userdata->
sblist, speed_button_node);
4084 tb_userdata->
items++;
4092 userdata.
sblist = speed_button_list;
4096 return userdata.
items;
4101 struct TagItem attrs[2];
4103 attrs[0].ti_Tag = CHILD_MinWidth;
4104 attrs[0].ti_Data = 0;
4105 attrs[1].ti_Tag = TAG_DONE;
4106 attrs[1].ti_Data = 0;
4115 ICA_TARGET, ICTARGET_IDCMP,
4116 SPEEDBAR_BevelStyle, BVS_NONE,
4122 BEVEL_Style, BVS_SBAR_VERT,
4143 gwin->
win, NULL, TRUE);
4157 if(IsListEmpty(speed_button_list))
return;
4158 node =
GetHead(speed_button_list);
4163 FreeSpeedButtonNode(node);
4164 }
while((node = nnode));
4193 gwin->
win, NULL, TRUE);
4208 SPEEDBAR_Buttons, ~0,
4245 }
while((node = nnode));
4250 if(ClickTabBase->lib_Version < 53)
return;
4253 struct TagItem attrs[3];
4255 attrs[0].ti_Tag = CHILD_WeightedWidth;
4256 attrs[0].ti_Data = 0;
4257 attrs[1].ti_Tag = CHILD_WeightedHeight;
4258 attrs[1].ti_Data = 0;
4259 attrs[2].ti_Tag = TAG_DONE;
4260 attrs[2].ti_Data = 0;
4317 gwin->
win, NULL, TRUE);
4319 if (gwin->
gw && gwin->
gw->
bw) {
4343 if(gwin->
tabs == 1) {
4351 }
while((node = nnode));
4378 if(window == windows) *
tabs = gwin->
tabs;
4380 }
while((node = nnode));
4455 width += (left - sx);
4459 if(((top - sy) +
height) > bbox->Height)
4460 height = bbox->Height - (top - sy);
4462 if(((left - sx) +
width) > bbox->Width)
4463 width = bbox->Width - (left - sx);
4465 if(
width <= 0)
return;
4470 for(y = top; y < (top +
height); y += tile_size_y) {
4472 clip.y1 = tile_size_y;
4474 if(((y - sy) +
clip.y1) > bbox->Height)
4475 clip.y1 = bbox->Height - (y - sy);
4477 for(x = left; x < (left +
width); x += tile_size_x) {
4479 clip.x1 = tile_size_x;
4481 if(((x - sx) +
clip.x1) > bbox->Width)
4482 clip.x1 = bbox->Width - (x - sx);
4491 BltBitMapTags(BLITA_SrcType, BLITT_BITMAP,
4495 BLITA_DestType, BLITT_RASTPORT,
4496 BLITA_Dest, gwin->
win->RPort,
4497 BLITA_DestX, bbox->Left + (
int)(x - sx),
4498 BLITA_DestY, bbox->Top + (
int)(y - sy),
4499 BLITA_Width, (
int)(
clip.x1),
4500 BLITA_Height, (
int)(
clip.y1),
4504 bbox->Left + (
int)(x - sx),
4505 bbox->Top + (
int)(y - sy),
4506 (
int)(
clip.x1), (
int)(
clip.y1), 0xC0);
4529 int x0,
int y0,
int x1,
int y1)
4536 .background_images =
true,
4555 x1 - x0, y1 - y0, sx, sy, bbox, &ctx);
4569 struct RegionRectangle *regrect;
4582 BeginRefresh(gwin->
win);
4584 r.
x0 = (gwin->
win->RPort->Layer->DamageList->bounds.MinX - bbox->Left) + sx - 1;
4585 r.
x1 = (gwin->
win->RPort->Layer->DamageList->bounds.MaxX - bbox->Left) + sx + 2;
4586 r.
y0 = (gwin->
win->RPort->Layer->DamageList->bounds.MinY - bbox->Top) + sy - 1;
4587 r.
y1 = (gwin->
win->RPort->Layer->DamageList->bounds.MaxY - bbox->Top) + sy + 2;
4589 regrect = gwin->
win->RPort->Layer->DamageList->RegionRectangle;
4595 r.
x0 = (regrect->bounds.MinX - bbox->Left) + sx - 1;
4596 r.
x1 = (regrect->bounds.MaxX - bbox->Left) + sx + 2;
4597 r.
y0 = (regrect->bounds.MinY - bbox->Top) + sy - 1;
4598 r.
y1 = (regrect->bounds.MaxY - bbox->Top) + sy + 2;
4600 regrect = regrect->Next;
4605 EndRefresh(gwin->
win, TRUE);
4611HOOKF(
void, ami_scroller_hook, Object *,
object,
struct IntuiMessage *)
4615 struct IntuiWheelData *wheel;
4616 struct Node *node = NULL;
4621 case IDCMP_IDCMPUPDATE:
4622 gid = GetTagData( GA_ID, 0, msg->IAddress );
4635 if((node = (
struct Node *)GetTagData(SPEEDBAR_SelectedNode, 0, msg->IAddress))) {
4636 GetSpeedButtonNodeAttrs(node, SBNA_UserData, (ULONG *)&url, TAG_DONE);
4660 if(msg->Code == IMSGCODE_INTUIWHEELDATA)
4662 wheel = (
struct IntuiWheelData *)msg->IAddress;
4668 case IDCMP_SIZEVERIFY:
4671 case IDCMP_REFRESHWINDOW:
4676 NSLOG(netsurf, INFO,
4677 "IDCMP hook unhandled event: %ld", msg->Class);
4721 struct Window *ref = NULL;
4722 char nav_west[100],nav_west_s[100],nav_west_g[100];
4723 char nav_east[100],nav_east_s[100],nav_east_g[100];
4724 char stop[100],stop_s[100],stop_g[100];
4726 char home[100],home_s[100],home_g[100];
4727 char closetab[100],closetab_s[100],closetab_g[100];
4728 char addtab[100],addtab_s[100],addtab_g[100];
4729 char fave[100], unfave[100];
4730 char pi_insecure[100], pi_internal[100], pi_local[100], pi_secure[100], pi_warning[100];
4731 char tabthrobber[100];
4732 ULONG refresh_mode = WA_SmartRefresh;
4733 ULONG defer_layout = TRUE;
4734 ULONG idcmp_sizeverify = IDCMP_SIZEVERIFY;
4736 NSLOG(netsurf, INFO,
"Creating window");
4741 if (
nsoption_bool(resize_with_contents)) idcmp_sizeverify = 0;
4765 LBCIA_Title,
"time",
4767 LBCIA_DraggableSeparator, TRUE,
4768 LBCIA_Separator, TRUE,
4771 LBCIA_Title,
"source",
4773 LBCIA_DraggableSeparator, TRUE,
4774 LBCIA_Separator, TRUE,
4777 LBCIA_Title,
"level",
4779 LBCIA_DraggableSeparator, TRUE,
4780 LBCIA_Separator, TRUE,
4783 LBCIA_Title,
"message",
4785 LBCIA_DraggableSeparator, TRUE,
4786 LBCIA_Separator, TRUE,
4804 CLICKTAB_Labels, ~0,
4816 struct Node *insert_after = existing->
tab_node;
4833 CLICKTAB_Current, g->
tab,
4837 if(ClickTabBase->lib_Version < 53) {
4883 refresh_mode = WA_SimpleRefresh;
4884 defer_layout = FALSE;
4887 refresh_mode = WA_SmartRefresh;
4888 defer_layout = TRUE;
4893 ULONG addtabclosegadget = TAG_IGNORE;
4894 ULONG iconifygadget = FALSE;
4901 iconifygadget = TRUE;
4904 NSLOG(netsurf, INFO,
"Creating menu");
4980 BITMAP_SourceFile, fave,
4981 BITMAP_Screen,
scrn,
4982 BITMAP_Masking, TRUE,
4986 BITMAP_SourceFile, unfave,
4987 BITMAP_Screen,
scrn,
4988 BITMAP_Masking, TRUE,
4992 BITMAP_SourceFile, addtab,
4993 BITMAP_SelectSourceFile, addtab_s,
4995 BITMAP_Screen,
scrn,
4996 BITMAP_Masking, TRUE,
5000 BITMAP_SourceFile, closetab,
5001 BITMAP_SelectSourceFile, closetab_s,
5003 BITMAP_Screen,
scrn,
5004 BITMAP_Masking, TRUE,
5008 BITMAP_SourceFile, pi_insecure,
5009 BITMAP_Screen,
scrn,
5010 BITMAP_Masking, TRUE,
5014 BITMAP_SourceFile, pi_internal,
5015 BITMAP_Screen,
scrn,
5016 BITMAP_Masking, TRUE,
5020 BITMAP_SourceFile, pi_local,
5021 BITMAP_Screen,
scrn,
5022 BITMAP_Masking, TRUE,
5026 BITMAP_SourceFile, pi_secure,
5027 BITMAP_Screen,
scrn,
5028 BITMAP_Masking, TRUE,
5032 BITMAP_SourceFile, pi_warning,
5033 BITMAP_Screen,
scrn,
5034 BITMAP_Masking, TRUE,
5038 if(ClickTabBase->lib_Version < 53)
5040 addtabclosegadget = LAYOUT_AddChild;
5065 BITMAP_SourceFile, tabthrobber,
5067 BITMAP_Masking,TRUE,
5071 NSLOG(netsurf, INFO,
"Creating window object");
5076 WA_DepthGadget, TRUE,
5078 WA_CloseGadget, TRUE,
5079 WA_SizeGadget, TRUE,
5081 WA_ReportMouse,TRUE,
5083 WA_SizeBBottom, TRUE,
5085 WA_IDCMP, IDCMP_MENUPICK | IDCMP_MOUSEMOVE |
5086 IDCMP_MOUSEBUTTONS | IDCMP_NEWSIZE |
5087 IDCMP_RAWKEY | idcmp_sizeverify |
5088 IDCMP_GADGETUP | IDCMP_IDCMPUPDATE |
5089 IDCMP_REFRESHWINDOW |
5091 WINDOW_Position, WPOS_FULLSCREEN,
5092 WINDOW_RefWindow, ref,
5093 WINDOW_IconifyGadget, iconifygadget,
5094 WINDOW_MenuStrip, menu,
5095 WINDOW_MenuUserData, WGUD_HOOK,
5098 WINDOW_IDCMPHookBits, IDCMP_IDCMPUPDATE | IDCMP_REFRESHWINDOW |
5100 WINDOW_SharedPort,
sport,
5102 WINDOW_GadgetHelp, TRUE,
5104 WINDOW_UniqueID,
"NS_MAIN_WIN",
5105 WINDOW_PopupGadget, TRUE,
5107 WINDOW_UserData, g->
shared,
5109 LAYOUT_DeferLayout, defer_layout,
5110 LAYOUT_SpaceOuter, TRUE,
5112 LAYOUT_VertAlignment, LALIGN_CENTER,
5120 BITMAP_SourceFile,nav_west,
5121 BITMAP_SelectSourceFile,nav_west_s,
5124 BITMAP_Masking,TRUE,
5127 CHILD_WeightedWidth,0,
5128 CHILD_WeightedHeight,0,
5136 BITMAP_SourceFile,nav_east,
5137 BITMAP_SelectSourceFile,nav_east_s,
5140 BITMAP_Masking,TRUE,
5143 CHILD_WeightedWidth,0,
5144 CHILD_WeightedHeight,0,
5150 BITMAP_SourceFile,stop,
5151 BITMAP_SelectSourceFile,stop_s,
5154 BITMAP_Masking,TRUE,
5157 CHILD_WeightedWidth,0,
5158 CHILD_WeightedHeight,0,
5164 BITMAP_SourceFile,
reload,
5165 BITMAP_SelectSourceFile,reload_s,
5168 BITMAP_Masking,TRUE,
5171 CHILD_WeightedWidth,0,
5172 CHILD_WeightedHeight,0,
5178 BITMAP_SourceFile,home,
5179 BITMAP_SelectSourceFile,home_s,
5182 BITMAP_Masking,TRUE,
5185 CHILD_WeightedWidth,0,
5186 CHILD_WeightedHeight,0,
5188 LAYOUT_VertAlignment, LALIGN_CENTER,
5192 SPACE_MinHeight, 16,
5193 SPACE_Transparent, TRUE,
5196 CHILD_WeightedWidth, 0,
5197 CHILD_WeightedHeight, 0,
5204 CHILD_WeightedWidth, 0,
5205 CHILD_WeightedHeight, 0,
5212 STRINGA_MaxChars, 2000,
5228 CHILD_WeightedWidth, 0,
5229 CHILD_WeightedHeight, 0,
5234 LAYOUT_WeightBar, TRUE,
5236 LAYOUT_VertAlignment, LALIGN_CENTER,
5240 CHOOSER_DropDown, TRUE,
5242 CHOOSER_MaxLabels, 40,
5244 CHILD_WeightedWidth,0,
5245 CHILD_WeightedHeight,0,
5248 STRINGA_TextVal, NULL,
5258 SPACE_Transparent,TRUE,
5261 CHILD_WeightedWidth,0,
5262 CHILD_WeightedHeight,0,
5264 CHILD_WeightedHeight,0,
5266 BEVEL_Style, BVS_SBAR_VERT,
5268 CHILD_WeightedHeight, 0,
5270 LAYOUT_SpaceInner, FALSE,
5272 CHILD_WeightedHeight,0,
5274 LAYOUT_SpaceInner,FALSE,
5276 CHILD_WeightedWidth,0,
5277 CHILD_WeightedHeight,0,
5280 CHILD_CacheDomain,FALSE,
5283 CHILD_WeightedWidth,0,
5284 CHILD_WeightedHeight,0,
5286 CHILD_WeightedHeight,0,
5293 SPACE_Transparent,TRUE,
5295 SPACE_MinHeight, 16,
5304 CHILD_WeightedHeight, 0,
5309 STRINGA_TextVal, NULL,
5327 WA_DepthGadget, FALSE,
5329 WA_CloseGadget, FALSE,
5334 WA_Width,
scrn->Width,
5335 WA_Height,
scrn->Height,
5336 WA_SizeGadget, FALSE,
5338 WA_ReportMouse, TRUE,
5340 WA_IDCMP, IDCMP_MENUPICK | IDCMP_MOUSEMOVE |
5341 IDCMP_MOUSEBUTTONS | IDCMP_NEWSIZE |
5342 IDCMP_RAWKEY | IDCMP_REFRESHWINDOW |
5343 IDCMP_GADGETUP | IDCMP_IDCMPUPDATE |
5346 WINDOW_IDCMPHookBits, IDCMP_IDCMPUPDATE |
5348 WINDOW_SharedPort,
sport,
5349 WINDOW_UserData,g->
shared,
5352 LAYOUT_DeferLayout, defer_layout,
5353 LAYOUT_SpaceOuter, TRUE,
5358 SPACE_Transparent,TRUE,
5366 NSLOG(netsurf, INFO,
"Opening window");
5370 NSLOG(netsurf, INFO,
"Window opened, adding border gadgets");
5387 struct DrawInfo *dri = GetScreenDrawInfo(
scrn);
5389 ami_get_border_gadget_size(g->
shared,
5396 GA_Left,
scrn->WBorLeft + 2,
5398 GA_BottomBorder, TRUE,
5408 IA_Top, (
int)(- ceil((
scrn->WBorBottom +
height) / 2)),
5418 (UWORD)~0, -1, NULL);
5430 FreeScreenDrawInfo(
scrn, dri);
5445 UnlockPubScreen(NULL,
scrn);
5449 ScreenToFront(
scrn);
5463 if(res == 0)
return;
5471 GetClickTabNodeAttrs(
tab,
5475 if((other_tabs ==
false) || (gwin->
gw != gw)) {
5478 }
while((
tab=ntab));
5497 struct Node *ptab = NULL;
5537 CLICKTAB_CurrentNode, ptab,
5540 if(ClickTabBase->lib_Version < 53)
5551 FreeListBrowserList(&g->
loglist);
5594 FreeListBrowserList(&g->
loglist);
5603 for(gid = 0; gid <
GID_LAST; gid++)
5673 NSLOG(netsurf, INFO,
"Ignoring deferred box redraw queue");
5687 }
while((node = nnode));
5693 const struct rect *restrict new_rect, APTR mempool)
5707 if((
rect->
x0 <= new_rect->x0) &&
5708 (
rect->
y0 <= new_rect->y0) &&
5709 (
rect->
x1 >= new_rect->x1) &&
5710 (
rect->
y1 >= new_rect->y1)) {
5714 if ((new_rect->x0 <=
rect->
x0) &&
5715 (new_rect->y0 <=
rect->
y0) &&
5716 (new_rect->x1 >=
rect->
x1) &&
5717 (new_rect->y1 >=
rect->
y1)) {
5718 NSLOG(netsurf, INFO,
5719 "Removing queued redraw that is a subset of new box redraw");
5724 }
while((node = nnode));
5732 ULONG hcurrent,vcurrent,xoffset,yoffset,
width=800,
height=600;
5734 ULONG oldh = gwin->
oldh, oldv=gwin->
oldv;
5756 if((abs(vcurrent-oldv) >
height) || (abs(hcurrent-oldh) >
width))
5769 ScrollWindowRaster(gwin->
win, hcurrent - oldh, vcurrent - oldv,
5770 xoffset, yoffset, xoffset +
width - 1, yoffset +
height - 1);
5780 else if(vcurrent<oldv)
5793 else if(hcurrent<oldh)
5804 .background_images =
true,
5817 gwin->
oldh = hcurrent;
5818 gwin->
oldv = vcurrent;
5896 if(sx >=
width - bbox->Width)
5897 sx =
width - bbox->Width;
5898 if(sy >=
height - bbox->Height)
5899 sy =
height - bbox->Height;
5901 if(width <= bbox->Width) sx = 0;
5902 if(height <= bbox->Height) sy = 0;
5910 SCROLLER_Top, (ULONG)(sy),
5918 SCROLLER_Top, (ULONG)(sx),
5938 struct TextExtent textex;
5946 if(utf8text == NULL)
return;
5949 chars = TextFit(&
scrn->RastPort, utf8text, (UWORD)strlen(utf8text),
5950 &textex, NULL, 1, size - 4,
scrn->RastPort.TxHeight);
5952 utf8text[chars] = 0;
5970 char *idn_url_s = NULL;
5971 char *url_lc = NULL;
5989 if(idn_url_s) free(idn_url_s);
5998HOOKF(
uint32, ami_set_favicon_render_hook, APTR, space,
struct gpRender *)
6012 struct bitmap *ico_bitmap)
6014 struct BitMap *bm = NULL;
6022 if (ico_bitmap != NULL) {
6039 ULONG bm_masking_tag = TAG_IGNORE;
6043 bm_masking_tag = BITMAP_Masking;
6047 BITMAP_Screen,
scrn,
6052 bm_masking_tag, TRUE,
6061 }
while((node = nnode));
6066HOOKF(
uint32, ami_set_throbber_render_hook, APTR, space,
struct gpRender *)
6073HOOKF(
uint32, ami_gui_browser_render_hook, APTR, space,
struct gpRender *)
6077 NSLOG(netsurf, DEBUG,
"Render hook called with %ld (REDRAW=1)", msg->gpr_Redraw);
6079 if(msg->gpr_Redraw != GREDRAW_REDRAW)
return 0;
6106 if((y-ys+
height) > (bbox->Height))
height = bbox->Height-y+ys;
6108 if(((x-xs) <= 0) || ((x-xs+2) >= (bbox->Width)) || ((y-ys) <= 0) || ((y-ys) >= (bbox->Height))) {
6115 SetDrMd(g->
shared->
win->RPort,COMPLEMENT);
6116 RectFill(g->
shared->
win->RPort, x + bbox->Left - xs, y + bbox->Top - ys,
6117 x + bbox->Left + g->
c_w - xs, y+bbox->Top +
height - ys);
6133 if(g->
c_h == 0)
return;
6174 SetWindowAttrs(g->
shared->
win, WA_GrabFocus, 0,
6175 WA_MouseLimits, NULL, TAG_DONE);
6202 *x = *x - (bbox->Left) +xs;
6205 *y = *y - (bbox->Top) + ys;
6228 if((x >= left) && (x <= (left +
width)) && (y >= top) && (y <= (top +
height)))
6235 Object *restrict win_obj, *restrict bm_obj;
6237 struct Screen *wbscreen = LockPubScreen(
"Workbench");
6238 uint32 top = 0, left = 0;
6239 struct TextAttr tattr;
6240 struct TextFont *tfont;
6246 WA_Borderless, TRUE,
6247 WA_BusyPointer, TRUE,
6248 WINDOW_Position, WPOS_CENTERSCREEN,
6249 WINDOW_LockWidth, TRUE,
6250 WINDOW_LockHeight, TRUE,
6253 BITMAP_SourceFile,
"PROGDIR:Resources/splash.png",
6254 BITMAP_Screen, wbscreen,
6255 BITMAP_Precision, PRECISION_IMAGE,
6260 if(win_obj == NULL) {
6261 NSLOG(netsurf, INFO,
"Splash window object not created");
6265 NSLOG(netsurf, INFO,
"Attempting to open splash window...");
6266 win = RA_OpenWindow(win_obj);
6269 NSLOG(netsurf, INFO,
"Splash window did not open");
6273 if(bm_obj == NULL) {
6274 NSLOG(netsurf, INFO,
"BitMap object not created");
6282 SetDrMd(win->RPort, JAM1);
6285 tattr.ta_Name =
"DejaVu Serif Italic.font";
6287 SetAPen(win->RPort, 3);
6288 tattr.ta_Name =
"ruby.font";
6290 tattr.ta_YSize = 24;
6296 SetFont(win->RPort, tfont);
6300 tattr.ta_Name =
"DejaVu Serif Oblique.font";
6302 SetFont(win->RPort, tfont);
6305 Move(win->RPort, left + 5, top + 25);
6306 Text(win->RPort,
"Initialising...", strlen(
"Initialising..."));
6311 tattr.ta_Name =
"DejaVu Sans.font";
6313 tattr.ta_Name =
"helvetica.font";
6315 tattr.ta_YSize = 16;
6320 SetFont(win->RPort, tfont);
6322 Move(win->RPort, left + 185, top + 220);
6327 UnlockPubScreen(NULL, wbscreen);
6334 if(win_obj == NULL)
return;
6336 NSLOG(netsurf, INFO,
"Closing splash window");
6337 DisposeObject(win_obj);
6343 NSLOG(netsurf, INFO,
"File open dialog request for %p/%p", g, gadget);
6347 ASLFR_SleepWindow, TRUE,
6350 ASLFR_DoSaveMode, FALSE,
6353 strlcpy(fname,
filereq->fr_Drawer, 1024);
6354 AddPart(fname,
filereq->fr_File, 1024);
6374 if(current_user == NULL) {
6375 user = GetVar(
"user", temp, 1024, GVF_GLOBAL_ONLY);
6376 current_user =
ASPrintf(
"%s", (user == -1) ?
"Default" : temp);
6378 NSLOG(netsurf, INFO,
"User: %s", current_user);
6384 FreeVec(current_user);
6391 struct InfoData *infodata = AllocDosObject(DOS_INFODATA, 0);
6392 if(infodata == NULL) {
6394 FreeVec(current_user);
6397 GetDiskInfoTags(GDI_StringNameInput,
users_dir,
6398 GDI_InfoData, infodata,
6400 if(infodata->id_DiskState == ID_DISKSTATE_WRITE_PROTECTED) {
6401 FreeDosObject(DOS_INFODATA, infodata);
6403 FreeVec(current_user);
6406 FreeDosObject(DOS_INFODATA, infodata);
6408#warning FIXME for OS3 and older OS4
6414 int len = strlen(current_user);
6421 FreeVec(current_user);
6428 FreeVec(current_user);
6541 setbuf(stderr, NULL);
6545 STRPTR current_user_cache = NULL;
6546 STRPTR current_user = NULL;
6569 signal(SIGINT, SIG_IGN);
6621#ifdef WITH_AMIGA_DATATYPES
6623 if(DataTypesBase->lib_Version >= 45)
6655 if((lock =
CreateDirTree(current_user_cache))) UnLock(lock);
6659 if(current_user_cache != NULL) FreeVec(current_user_cache);
6701 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_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 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_FOREGROUND
Request foreground opening.
@ 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.
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.
const char *const netsurf_version
User friendly version string.
Version information interface.
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)
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 BitMap * ami_bitmap_get_native(struct bitmap *bitmap, int width, int height, bool palette_mapped, struct BitMap *friendbm, colour bg)
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.
@ GW_CREATE_FOREGROUND
Request this window/tab is foregrounded.
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 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
#define nsoption_colour(OPTION)
Get the value of a netsurf colour option.
#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.
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.