summaryrefslogtreecommitdiff
path: root/amiga
diff options
context:
space:
mode:
Diffstat (limited to 'amiga')
-rw-r--r--amiga/Makefile.target7
-rwxr-xr-xamiga/agclass/amigaguide_class.c346
-rwxr-xr-xamiga/agclass/amigaguide_class.h40
-rw-r--r--amiga/bitmap.c5
-rw-r--r--amiga/clipboard.c44
-rwxr-xr-xamiga/dist/Install18
-rwxr-xr-xamiga/dist/NetSurf.guide106
-rw-r--r--amiga/font.c6
-rwxr-xr-xamiga/gui.c84
-rwxr-xr-xamiga/gui.h2
-rwxr-xr-xamiga/gui_options.c30
-rwxr-xr-xamiga/help.c66
-rwxr-xr-xamiga/help.h36
-rwxr-xr-xamiga/plotters.c22
-rwxr-xr-xamiga/search.c42
-rw-r--r--amiga/theme.c6
16 files changed, 750 insertions, 110 deletions
diff --git a/amiga/Makefile.target b/amiga/Makefile.target
index f2c429998..dc79479c5 100644
--- a/amiga/Makefile.target
+++ b/amiga/Makefile.target
@@ -59,7 +59,7 @@ else
LDFLAGS += -L$(GCCSDK_INSTALL_ENV)/lib
ifeq ($(SUBTARGET),os3)
- LDFLAGS += -liconv
+ LDFLAGS += -lpbl -liconv
else
LDFLAGS += -lauto -lpbl -liconv
endif
@@ -75,11 +75,12 @@ EXETARGET := NetSurf
S_AMIGA := gui.c tree.c history.c hotlist.c schedule.c file.c \
thumbnail.c misc.c bitmap.c font.c filetype.c utf8.c login.c \
plotters.c object.c menu.c save_pdf.c arexx.c version.c \
- cookies.c context_menu.c clipboard.c \
+ cookies.c context_menu.c clipboard.c help.c font_scan.c \
launch.c search.c history_local.c download.c iff_dr2d.c \
sslcert.c gui_options.c print.c theme.c drag.c icon.c system_colour.c \
datatypes.c dt_picture.c dt_anim.c dt_sound.c plugin_hack.c \
- stringview/stringview.c stringview/urlhistory.c font_scan.c
+ stringview/stringview.c stringview/urlhistory.c \
+ agclass/amigaguide_class.c
S_AMIGA := $(addprefix amiga/,$(S_AMIGA))
# This is the final source build list
diff --git a/amiga/agclass/amigaguide_class.c b/amiga/agclass/amigaguide_class.c
new file mode 100755
index 000000000..dfac7ad7a
--- /dev/null
+++ b/amiga/agclass/amigaguide_class.c
@@ -0,0 +1,346 @@
+/*
+ * AmigaGuide Class
+ * A BOOPSI class for displaying AmigaGuide files.
+ * by Daniel "Trixie" Jedlicka
+ */
+
+#undef __USE_INLINE__
+
+#include "amigaguide_class.h"
+
+struct localObjectData
+{
+ struct NewAmigaGuide nag;
+ struct AmigaGuideMsg *agm;
+ AMIGAGUIDECONTEXT agHandle;
+ uint32 agContextID;
+ uint32 agSignal;
+ BOOL agActive;
+};
+
+struct Library *AmigaGuideBase = NULL;
+struct AmigaGuideIFace *IAmigaGuide = NULL;
+
+
+/* ********************************** function prototypes ************************************ */
+
+static uint32 dispatchAGClass(Class *, Object *, Msg);
+BOOL freeAGClass(Class *);
+
+// class methods
+uint32 om_new(Class *, Object *, struct opSet *);
+uint32 om_dispose(Class *, Object *, Msg);
+uint32 om_set(Class *, Object *, struct opSet *);
+uint32 om_get(Class *, Object *, struct opGet *);
+uint32 agm_open(Class *, Object *, Msg);
+uint32 agm_close(Class *, Object *, Msg);
+
+
+/* *************************** class initialization and disposal ***************************** */
+
+
+Class *initAGClass(void)
+{
+ Class *cl = NULL;
+
+
+ // Open amigaguide.library and its interface.
+ if ( (AmigaGuideBase = IExec->OpenLibrary("amigaguide.library", 52)) )
+ {
+ if ( (IAmigaGuide = (struct AmigaGuideIFace *)IExec->GetInterface(AmigaGuideBase, "main", 1L, NULL)) )
+ {
+ if ( (cl = IIntuition->MakeClass(NULL, "rootclass", NULL, sizeof(struct localObjectData), 0)) )
+ {
+ cl->cl_Dispatcher.h_Entry = (HOOKFUNC)dispatchAGClass;
+ IIntuition->AddClass(cl);
+ }
+ else freeAGClass(NULL);
+ }
+ else freeAGClass(NULL);
+ }
+
+ return cl;
+
+}
+
+
+
+BOOL freeAGClass(Class *cl)
+{
+ BOOL retVal = FALSE;
+
+
+ // Close amigaguide.library and free the class.
+ if (IAmigaGuide) IExec->DropInterface((struct Interface *)IAmigaGuide);
+ if (AmigaGuideBase) IExec->CloseLibrary(AmigaGuideBase);
+ if (cl) retVal = IIntuition->FreeClass(cl);
+
+ return retVal;
+}
+
+
+
+/* ************************************** class dispatcher ************************************ */
+
+
+static uint32 dispatchAGClass(Class *cl, Object *o, Msg msg)
+{
+
+ switch (msg->MethodID)
+ {
+ case OM_NEW:
+ return om_new(cl, o, (struct opSet *)msg);
+
+ case OM_DISPOSE:
+ return om_dispose(cl, o, msg);
+
+ case OM_UPDATE:
+ case OM_SET:
+ return om_set(cl, o, (struct opSet *)msg);
+
+ case OM_GET:
+ return om_get(cl, o, (struct opGet *)msg);
+
+ case AGM_OPEN:
+ return agm_open(cl, o, msg);
+
+ case AGM_CLOSE:
+ return agm_close(cl, o, msg);
+
+ default:
+ return IIntuition->IDoSuperMethodA(cl, o, msg);
+ }
+
+}
+
+
+/* *************************************** class methods ************************************** */
+
+uint32 om_new(Class *cl, Object *o, struct opSet *msg)
+{
+ struct localObjectData *lod = NULL;
+ uint32 retVal = 0L;
+
+
+ if ( (retVal = IIntuition->IDoSuperMethodA(cl, o, (Msg)msg)) )
+ {
+ // Obtain pointer to our object's local instance data.
+ if ( (lod = (struct localObjectData *)INST_DATA(cl, retVal)) )
+ {
+ // Initialize values.
+ lod->agActive = FALSE;
+ lod->agHandle = NULL;
+ lod->agContextID = 0;
+ lod->nag.nag_Name = NULL;
+ lod->nag.nag_Screen = NULL;
+ lod->nag.nag_PubScreen = NULL;
+ lod->nag.nag_BaseName = NULL;
+ lod->nag.nag_Context = NULL;
+ lod->nag.nag_Client = NULL; // private, must be NULL!
+
+ // Set initial object attributes based on the tags from NewObject().
+ om_set(cl, (Object *)retVal, msg);
+ }
+ }
+
+ return retVal;
+
+}
+
+
+
+
+
+uint32 om_dispose(Class *cl, Object *o, Msg msg)
+{
+
+ // Close the document, should it still be opened.
+ agm_close(cl, o, msg);
+
+ // Let superclass dispose of the object.
+ return IIntuition->IDoSuperMethodA(cl, o, msg);
+
+}
+
+
+
+
+
+uint32 om_set(Class *cl, Object *o, struct opSet *msg)
+{
+ struct localObjectData *lod = (struct localObjectData *)INST_DATA(cl, o);
+ struct TagItem *tags, *ti;
+
+
+ tags = msg->ops_AttrList;
+
+ while ((ti = IUtility->NextTagItem (&tags)))
+ {
+ switch (ti->ti_Tag)
+ {
+ case AMIGAGUIDE_Name:
+ lod->nag.nag_Name = (STRPTR)ti->ti_Data;
+ lod->agActive = FALSE; // Database name has changed, we must setup the help system again.
+ break;
+
+ case AMIGAGUIDE_Screen:
+ lod->nag.nag_Screen = (struct Screen *)ti->ti_Data;
+ lod->agActive = FALSE; // Screen pointer has changed, we must setup the help system again.
+ break;
+
+ case AMIGAGUIDE_PubScreen:
+ lod->nag.nag_PubScreen = (STRPTR)ti->ti_Data;
+ lod->agActive = FALSE; // Pubscreen name has changed, we must setup the help system again.
+ break;
+
+ case AMIGAGUIDE_BaseName:
+ lod->nag.nag_BaseName = (STRPTR)ti->ti_Data;
+ lod->agActive = FALSE; // Application basename has changed, we must setup the help system again.
+ break;
+
+ case AMIGAGUIDE_ContextArray:
+ lod->nag.nag_Context = (STRPTR *)ti->ti_Data;
+ lod->agActive = FALSE; // Context array has changed, we must setup the help system again.
+ break;
+
+ case AMIGAGUIDE_ContextID:
+ lod->agContextID = (uint32)ti->ti_Data;
+ break;
+
+ default:
+ break;
+ }
+ }
+
+
+ // Setup the help system, if not ready yet or needs changing.
+ if ( lod->agActive == FALSE )
+ {
+ // Shut down help system should it already be running.
+ if ( lod->agHandle ) agm_close(cl, o, (Msg)msg);
+
+ // (Re)establish the AmigaGuide context and open the database asynchronously.
+ if ( (lod->agHandle = IAmigaGuide->OpenAmigaGuideAsync(&(lod->nag), NULL)) )
+ {
+ if ( (lod->agSignal = IAmigaGuide->AmigaGuideSignal(lod->agHandle)) )
+ {
+ // Wait until the help system is up and running.
+ IExec->Wait(lod->agSignal);
+ while ( !(lod->agActive) )
+ {
+ while ( (lod->agm = IAmigaGuide->GetAmigaGuideMsg(lod->agHandle)) )
+ {
+ // The AmigaGuide process started OK.
+ if ( lod->agm->agm_Type == ActiveToolID ) lod->agActive = TRUE;
+
+ // Opening the guide file failed for some reason, continue as usual.
+ if ( lod->agm->agm_Type == ToolStatusID && lod->agm->agm_Pri_Ret ) lod->agActive = TRUE;
+
+ IAmigaGuide->ReplyAmigaGuideMsg(lod->agm);
+ }
+ }
+ }
+ }
+ }
+
+ return (uint32)lod->agHandle;
+
+}
+
+
+
+
+
+uint32 om_get(Class *cl, Object *o, struct opGet *msg)
+{
+ struct localObjectData *lod = (struct localObjectData *)INST_DATA(cl, o);
+ uint32 retVal = 0L;
+
+
+ switch (msg->opg_AttrID)
+ {
+ case AMIGAGUIDE_Name:
+ *(msg->opg_Storage) = (uint32)lod->nag.nag_Name;
+ retVal = 1;
+ break;
+
+ case AMIGAGUIDE_Screen:
+ *(msg->opg_Storage) = (uint32)lod->nag.nag_Screen;
+ retVal = 1;
+ break;
+
+ case AMIGAGUIDE_PubScreen:
+ *(msg->opg_Storage) = (uint32)lod->nag.nag_PubScreen;
+ retVal = 1;
+ break;
+
+ case AMIGAGUIDE_BaseName:
+ *(msg->opg_Storage) = (uint32)lod->nag.nag_BaseName;
+ retVal = 1;
+ break;
+
+ case AMIGAGUIDE_ContextArray:
+ *(msg->opg_Storage) = (uint32)lod->nag.nag_Context;
+ retVal = 1;
+ break;
+
+ case AMIGAGUIDE_ContextID:
+ *(msg->opg_Storage) = (uint32)lod->agContextID;
+ retVal = 1;
+ break;
+
+ default:
+ retVal = IIntuition->IDoSuperMethodA(cl, o, (Msg)msg);
+ }
+
+ return retVal;
+
+}
+
+
+
+
+
+uint32 agm_open(Class *cl, Object *o, Msg msg)
+{
+ struct localObjectData *lod = (struct localObjectData *)INST_DATA(cl, o);
+ uint32 retVal = 0;
+
+
+ if ( (lod->agHandle) && (lod->agActive) )
+ {
+ if ( lod->nag.nag_Context )
+ {
+ // A context node array is provided = open the current context node.
+ IAmigaGuide->SetAmigaGuideContext(lod->agHandle, lod->agContextID, NULL);
+ retVal = IAmigaGuide->SendAmigaGuideContext(lod->agHandle, NULL);
+ }
+ else
+ {
+ // No context array is provided = open the main node.
+ retVal = IAmigaGuide->SendAmigaGuideCmd(lod->agHandle, "LINK MAIN", TAG_DONE);
+ }
+ }
+
+ return retVal;
+}
+
+
+
+
+
+uint32 agm_close(Class *cl, Object *o, Msg msg)
+{
+ struct localObjectData *lod = (struct localObjectData *)INST_DATA(cl, o);
+
+
+ if ( lod->agHandle )
+ {
+ IAmigaGuide->CloseAmigaGuide(lod->agHandle);
+ lod->agHandle = NULL;
+ lod->agActive = FALSE;
+ }
+
+ return (uint32)lod->agHandle;
+
+}
diff --git a/amiga/agclass/amigaguide_class.h b/amiga/agclass/amigaguide_class.h
new file mode 100755
index 000000000..f122f35f7
--- /dev/null
+++ b/amiga/agclass/amigaguide_class.h
@@ -0,0 +1,40 @@
+/*
+ * AmigaGuide Class
+ *
+ */
+
+#ifndef AMIGAGUIDE_CLASS_H
+#define AMIGAGUIDE_CLASS_H
+
+#include <exec/types.h>
+#include <intuition/classes.h>
+
+#include <classes/window.h>
+
+#include <proto/exec.h>
+#include <proto/intuition.h>
+#include <proto/amigaguide.h>
+#include <proto/utility.h>
+
+
+
+// tag definitions
+#define AMIGAGUIDE_Dummy (TAG_USER+0x05000000)
+
+#define AMIGAGUIDE_Name (AMIGAGUIDE_Dummy + 1) // Name of the AmigaGuide database.
+#define AMIGAGUIDE_Screen (AMIGAGUIDE_Dummy + 2) // Pointer of the screen to open on.
+#define AMIGAGUIDE_PubScreen (AMIGAGUIDE_Dummy + 3) // Name of the public screen to open on.
+#define AMIGAGUIDE_BaseName (AMIGAGUIDE_Dummy + 4) // Basename of the application that opens the help file.
+#define AMIGAGUIDE_ContextArray (AMIGAGUIDE_Dummy + 5) // Context node array (must be NULL-terminated).
+#define AMIGAGUIDE_ContextID (AMIGAGUIDE_Dummy + 6) // Index value of the node to display.
+
+// method definition
+#define AGM_OPEN WM_OPEN
+#define AGM_CLOSE WM_CLOSE
+
+// function prototypes
+Class *initAGClass(void);
+BOOL freeAGClass(Class *);
+
+#endif // AMIGAGUIDE_CLASS_H
+
diff --git a/amiga/bitmap.c b/amiga/bitmap.c
index 3a2bc7060..2fa8eb7c7 100644
--- a/amiga/bitmap.c
+++ b/amiga/bitmap.c
@@ -402,6 +402,7 @@ static struct BitMap *ami_bitmap_get_truecolour(struct bitmap *bitmap,int width,
if(GfxBase->LibNode.lib_Version >= 53) // AutoDoc says v52, but this function isn't in OS4.0, so checking for v53 (OS4.1)
{
+#ifdef __amigaos4__
uint32 comptype = COMPOSITE_Src;
uint32 flags = 0;
@@ -420,9 +421,9 @@ static struct BitMap *ami_bitmap_get_truecolour(struct bitmap *bitmap,int width,
COMPTAG_OffsetY,0,
COMPTAG_FriendBitMap,friendbm,
TAG_DONE);
+#endif
}
- else /* do it the old-fashioned way. This is pretty slow, but probably
- uses Composite() on OS4.1 anyway, so we're only saving a blit really. */
+ else /* Do it the old-fashioned way. This is pretty slow, even on OS4.1 */
{
bsa.bsa_SrcX = 0;
bsa.bsa_SrcY = 0;
diff --git a/amiga/clipboard.c b/amiga/clipboard.c
index 5e51efc70..3897851b8 100644
--- a/amiga/clipboard.c
+++ b/amiga/clipboard.c
@@ -122,7 +122,7 @@ char *ami_clipboard_cat_collection(struct CollectionItem *ci, LONG codeset, size
{
struct CollectionItem *ci_new = NULL, *ci_next, *ci_curr = ci;
size_t len = 0;
- char *text = NULL, *p, *clip;
+ char *text = NULL, *p;
/* Scan the collected chunks to find out the total size.
* If they are not in UTF-8, convert the chunks first and create a new CollectionItem list.
@@ -142,7 +142,7 @@ char *ami_clipboard_cat_collection(struct CollectionItem *ci, LONG codeset, size
ci_next = ci_new;
}
- utf8_from_local_encoding(ci_curr->ci_Data, ci_curr->ci_Size, &ci_next->ci_Data);
+ utf8_from_local_encoding(ci_curr->ci_Data, ci_curr->ci_Size, (char **)&ci_next->ci_Data);
ci_next->ci_Size = strlen(ci_next->ci_Data);
len += ci_next->ci_Size;
break;
@@ -159,7 +159,7 @@ char *ami_clipboard_cat_collection(struct CollectionItem *ci, LONG codeset, size
utf8_from_enc(ci_curr->ci_Data,
(const char *)ObtainCharsetInfo(DFCS_NUMBER,
codeset, DFCS_MIMENAME),
- ci_curr->ci_Size, &clip);
+ ci_curr->ci_Size, (char **)&ci_next->ci_Data);
ci_next->ci_Size = strlen(ci_next->ci_Data);
len += ci_next->ci_Size;
break;
@@ -175,9 +175,9 @@ char *ami_clipboard_cat_collection(struct CollectionItem *ci, LONG codeset, size
p = text + len;
if(ci_new) {
- ci_curr = ci;
- } else {
ci_curr = ci_new;
+ } else {
+ ci_curr = ci;
}
do {
@@ -199,43 +199,27 @@ void gui_get_clipboard(char **buffer, size_t *length)
{
struct ContextNode *cn;
struct CollectionItem *ci = NULL;
+ struct StoredProperty *sp = NULL;
ULONG rlen=0,error;
- struct CSet cset;
+ struct CSet *cset;
LONG codeset = 0;
- cset.CodeSet = 0;
-
if(OpenIFF(iffh,IFFF_READ)) return;
if(CollectionChunk(iffh,ID_FTXT,ID_CHRS)) return;
- if(StopChunk(iffh,ID_FTXT,ID_CSET)) return;
+ if(PropChunk(iffh,ID_FTXT,ID_CSET)) return;
if(CollectionChunk(iffh,ID_FTXT,ID_UTF8)) return;
+ if(StopOnExit(iffh, ID_FTXT, ID_FORM)) return;
- while(1)
- {
- error = ParseIFF(iffh,IFFPARSE_SCAN);
- if(error == IFFERR_EOC) continue;
- else if(error) break;
-
- cn = CurrentChunk(iffh);
-
- if((cn)&&(cn->cn_Type == ID_FTXT)&&(cn->cn_ID == ID_CSET))
- {
- /* Ideally when we stop here, we need to convert all CHRS chunks up to this
- * point based on the previous codeset. However, for simplicity, we just
- * assume only one CSET chunk is present and only take note of the last
- * CSET chunk if there is more than one.
- */
-
- rlen = ReadChunkBytes(iffh, &cset, 32);
- if(cset.CodeSet == 1) codeset = 106;
- else codeset = cset.CodeSet;
- }
- }
+ error = ParseIFF(iffh,IFFPARSE_SCAN);
if(ci = FindCollection(iffh, ID_FTXT, ID_UTF8)) {
*buffer = ami_clipboard_cat_collection(ci, 106, length);
} else if(ci = FindCollection(iffh, ID_FTXT, ID_CHRS)) {
+ if(sp = FindProp(iffh, ID_FTXT, ID_CSET)) {
+ cset = (struct CSet *)sp->sp_Data;
+ codeset = cset->CodeSet;
+ }
*buffer = ami_clipboard_cat_collection(ci, codeset, length);
}
diff --git a/amiga/dist/Install b/amiga/dist/Install
index e32096498..01914294b 100755
--- a/amiga/dist/Install
+++ b/amiga/dist/Install
@@ -382,6 +382,10 @@
(set #user-options (tackon #user-dir "Choices"))
(set #options-exist (exists #user-options))
(set #searchengines-exist (exists (tackon @default-dest "Resources/SearchEngines")))
+(set #user-hotlist (tackon #user-dir "Hotlist"))
+(set #hotlist-exist (exists #user-hotlist))
+(set #old-hotlist (tackon @default-dest "Resources/Hotlist"))
+(set #old-hotlist-exist (exists #old-hotlist))
(set #aiss-theme "")
(if (= #options-exist 0)
@@ -411,6 +415,20 @@
)
)
+(if (= #hotlist-exist 0)
+ (if (= #old-hotlist-exist 1)
+ (
+ (copyfiles
+ (prompt "Migrating NetSurf 2.x Hotlist")
+ (help @copyfiles-help)
+ (source #old-hotlist)
+ (dest #user-dir)
+ (optional "askuser" "force" "oknodelete")
+ )
+ )
+ )
+)
+
(complete 18)
(if (>= osver 53)
diff --git a/amiga/dist/NetSurf.guide b/amiga/dist/NetSurf.guide
index 8759b2b24..e38f9f79a 100755
--- a/amiga/dist/NetSurf.guide
+++ b/amiga/dist/NetSurf.guide
@@ -7,14 +7,18 @@
http://www.netsurf-browser.org
@{" Change Log " link ChangeLog/Main}
-
@{" Licence " link COPYING/Main}
+
+@{" GUI " link GUI}
+@{" Preferences GUI " link Prefs}
+
@{" Command line options " link CLI}
@{" Options file " link Options}
@{" Fonts " link Fonts}
@{" ARexx port " link ARexx}
@{" OpenURL/URL Prefs " link OpenURL}
@{" Hotlist menu " link Hotlist}
+@{" Hotlist toolbar " link HotlistToolbar}
@{" Local MIME types " link MIMETypes}
@{" Keyboard controls " link Keyboard}
@@ -23,6 +27,81 @@ http://www.netsurf-browser.org
@{" Credits " link Contact}
@endnode
+@node GUI "Main window"
+NetSurf's main GUI consists of a toolbar across the top, an (optional) tab bar, an (optional) hotlist toolbar and the main browser area. It also encompasses a pull-down @{"menu" link Menu}.
+
+The toolbar buttons are, from left to right:
+@{b}Back@{ub} Go back one page in history. Right-clicking gives a menu showing the last ten pages visited.
+@{b}Forward@{ub} Go forward one page in history. Right-clicking gives a menu showing up to ten pages available.
+@{b}Stop@{ub} Stop loading the page.
+@{b}Reload@{ub} Reload the current page. Shift-clicking will reload all elements on the page.
+@{b}Home@{ub} Load the home page.
+
+The gadget to the right of the buttons is the URL bar to type web addresses into. On the far right is the search bar. Typing into here will search for the text using your default search provider (see preferences @{"Advanced tab" link Prefs-Advanced}.
+
+Below these is the (optional) @{"hotlist toolbar" link HotlistToolbar}.
+Below this is the (optional) tab bar. This usually only displays when more than one tab is open, but can be set in @{"preferences" link Prefs-Tabs} to be always present. At the far right is a button to open a new tab. On OS4.0 the current tab can be closed using the button on the far left. On OS4.1 the close gadget for the tab is embedded in the tab itself.
+
+The rest of the window is taken up with the @{"browser rendering area" link Browser}. This is where the pages visited will be displayed.
+@endnode
+
+@node Browser
+@toc GUI
+This is the main browser rendering area.
+
+Drag and drop is supported throughout, so files can be dropped onto text fields, text on pages can be highlighted and dragged to Workbench or text fields. Other elements can be saved by dragging them to Workbench with Ctrl or Shift held down.
+
+Note that dragging to Workbench only works when NetSurf is running on the Workbench screen.
+@endnode
+
+@node Menu "Menu"
+@toc GUI
+Project Browser Edit @{"Hotlist" link Hotlist} @{"ARexx" link arexx}
+
+@endnode
+
+@node Prefs "Preferences GUI"
+@{"General" link Prefs-General} @{"Display" link Prefs-Display} @{"Connection" link Prefs-Connection} @{"Rendering" link Prefs-Rendering} @{"Fonts" link Prefs-Fonts} @{"Cache" link Prefs-Cache} @{"Tabs" link Prefs-Tabs} @{"Advanced" link Prefs-Advanced} @{"Export" link Prefs-Export}
+@endnode
+
+@node Prefs-General "Prefs - General"
+@toc Prefs
+@endnode
+
+@node Prefs-Display "Prefs - Display"
+@toc Prefs
+@endnode
+
+@node Prefs-Connection "Prefs - Connection"
+@toc Prefs
+@endnode
+
+@node Prefs-Rendering "Prefs - Rendering"
+@toc Prefs
+@endnode
+
+@node Prefs-Fonts "Prefs - Fonts"
+@toc Prefs
+See @{"Fonts" link Fonts}
+@endnode
+
+@node Prefs-Cache "Prefs - Cache"
+@toc Prefs
+@endnode
+
+@node Prefs-Tabs "Prefs - Tabs"
+@toc Prefs
+@endnode
+
+@node Prefs-Advanced "Prefs - Advanced"
+@toc Prefs
+@endnode
+
+@node Prefs-Export "Prefs - Export"
+@toc Prefs
+This section contains options for exporting to PDF. It is not enabled in current builds of NetSurf.
+@endnode
+
@node cli "Command line options"
NetSurf URL/K,FORCE/S
@@ -44,13 +123,10 @@ There are a couple of Amiga-specific options which can only be changed directly
@{b}drag_save_icons@{ub} Enables displaying Workbench-style transparent icons under the pointer when performing drag saves (ctrl-drag of objects available if NetSurf is running on the Workbench screen) and text selection drags. If set to 0 the pointer style will change instead. OS 4.0 users may want to set this to 0 as icons will appear opaque and obscure the drop position.
@{b}cairo_renderer@{ub} Set rendering engine. -1 = palette-mapped (set automatically when required), 0 = graphics.library (default), 1 = Cairo/graphics.library mixed, 2 = Full Cairo.
@{b}monitor_aspect_x@{ub}/@{b}monitor_aspect_y@{ub} Correct aspect ratio for displays (default of 0 means "assume square pixels").
-@{b}screen_compositing@{ub} Use compositing on NetSurf's own screen. 0=disable, 1=enable, 2=default
+@{b}screen_compositing@{ub} Use compositing on NetSurf's own screen. 0=disable, 1=enable, 2=default (NB: This is indirectly modified by changing the "simple refresh" option in the GUI)
@{b}redraw_tile_size_x@{ub}/@{b}redraw_tile_size_y@{ub} Specify the size of the off-screen bitmap. Higher will speed up redraws at the expense of memory. 0 disables tiling (will use a bitmap at least the size of the screen NetSurf is running on)
-@{b}font_antialiasing@{ub} Switch text anti-aliasing on or off. Defaults to on in true-colour modes, but text rendering performance can be improved by setting to 0.
-@{b}window_simple_refresh@{ub} If set to 1, NetSurf will use SimpleRefresh rather than SmartRefresh windows. These have slower redraw but use less memory. Note that this setting has no noticeable effect if compositing is enabled. Defaults to 0 (SmartRefresh)
@{b}web_search_width@{ub} Defaults to 0. Larger values will increase the size of the web search gadget next to the URL bar.
-@{b}dithering_quality@{ub} Specify the dithering quality from all values supported by picture.datatype. Currently these are 0=None, 1=Normal, 2=High quality. Other values are undefined. This is only used when NetSurf is running in palette-mapped mode.
@{b}mask_alpha@{ub} Threshold to use when determining which alpha values to convert to full transparency (0 - 255, where 255 will convert even opaque pixels to transparent). Defaults to 50 (0x32). This is only used in palette-mapped modes where alpha blending is not currently supported.
@{b}url_file@{ub} Path to URL database file
@@ -61,7 +137,7 @@ There are a couple of Amiga-specific options which can only be changed directly
@endnode
@node Fonts
-The font to use for each font type can be defined in NetSurf's options. OS4 NetSurf supports soft styles for bold and italic, however designed fonts look better and it is highly recommend to set them as follows:
+The font to use for each font type can be defined in NetSurf's options. OS4 NetSurf supports soft styles for bold and italic, however designed fonts look better and it is highly recommended to set them as follows:
Within @{"TypeManager" system "SYS:System/TypeManager"} select a font being used by NetSurf and click on Modify.
On the Files tab, Font family section, choose the @{b}bold@{ub}, @{i}italic@{ui} and @{b}@{i}bold-italic@{ui}@{ub} version of the font.
@@ -194,7 +270,7 @@ Folders with no items in them will show up disabled in the menu. If they are na
eg.
-- Menu
+- Hotlist Menu
|
+- Netsurf
| |
@@ -216,6 +292,20 @@ Will look something like the following within the menu:
@endnode
+@node HotlistToolbar "Hotlist toolbar"
+A toolbar for frequently-accessed sites can be added to the main window. To do show, follow these steps:
+
+* Select Show Hotlist from the Hotlist menu
+The Hotlist window will be displayed.
+
+* Locate the "Hotlist toolbar" folder in the tree (NetSurf creates this when it starts up)
+
+* Move or create entries in this folder. Any entries directly inside the Hotlist toolbar folder will appear on the toolbar when the hotlist window is closed. If it is empty the toolbar will disappear to save space.
+
+Note that sub-folders are not currently supported on the toolbar.
+
+@endnode
+
@node mimetypes "Local MIME Types"
NetSurf determines the MIME types of local files primarily by checking the icon of the file. If the icon is not found it will check the default icon for the file type.
@@ -294,5 +384,5 @@ The default theme icon was adapted from the NetSurf logo by Marko K. Seppänen.
All other code and files are the same for all platforms and credited in the files and/or on the NetSurf website.
http://www.netsurf-browser.org
-The source code can be obtained from http://www.netsurf-browser.org SVN or (in the event the service is unavailable) chris@unsatisfactorysoftware.co.uk or any other of the NetSurf developers.
+The source code can be obtained from http://source.netsurf-browser.org or (in the event the service is unavailable) chris@unsatisfactorysoftware.co.uk or any other of the NetSurf developers.
@endnode
diff --git a/amiga/font.c b/amiga/font.c
index ffecf85fe..33f71a926 100644
--- a/amiga/font.c
+++ b/amiga/font.c
@@ -156,7 +156,7 @@ bool nsfont_position_in_string(const plot_font_style_t *fstyle,
for(i=0;i<len;i++)
{
- if (*utf16 < 0xD800 || 0xDFFF < *utf16)
+ if ((*utf16 < 0xD800) || (0xDFFF < *utf16))
utf16charlen = 1;
else
utf16charlen = 2;
@@ -263,7 +263,7 @@ bool nsfont_split(const plot_font_style_t *fstyle,
{
utf8len = utf8_char_byte_length(string+utf8clen);
- if (*utf16 < 0xD800 || 0xDFFF < *utf16)
+ if ((*utf16 < 0xD800) || (0xDFFF < *utf16))
utf16charlen = 1;
else
utf16charlen = 2;
@@ -722,7 +722,7 @@ ULONG ami_unicode_text(struct RastPort *rp, const char *string, ULONG length,
while(*utf16 != 0)
{
- if (*utf16 < 0xD800 || 0xDFFF < *utf16)
+ if ((*utf16 < 0xD800) || (0xDFFF < *utf16))
utf16charlen = 1;
else
utf16charlen = 2;
diff --git a/amiga/gui.c b/amiga/gui.c
index 43412704a..eb5af2662 100755
--- a/amiga/gui.c
+++ b/amiga/gui.c
@@ -53,6 +53,7 @@
#include "amiga/font.h"
#include "amiga/gui.h"
#include "amiga/gui_options.h"
+#include "amiga/help.h"
#include "amiga/history.h"
#include "amiga/history_local.h"
#include "amiga/hotlist.h"
@@ -385,6 +386,7 @@ void ami_open_resources(void)
TAG_DONE))) die(messages_get("NoMemory"));
ami_file_req_init();
+ //ami_help_init(NULL);
}
void ami_set_options(void)
@@ -475,15 +477,19 @@ void ami_set_options(void)
tree_set_icon_dir(strdup("ENV:Sys"));
-
nsoption_setnull_charp(arexx_dir, (char *)strdup("Rexx"));
-
nsoption_setnull_charp(arexx_startup, (char *)strdup("Startup.nsrx"));
-
nsoption_setnull_charp(arexx_shutdown, (char *)strdup("Shutdown.nsrx"));
if(!nsoption_int(window_width)) nsoption_set_int(window_width, 800);
if(!nsoption_int(window_height)) nsoption_set_int(window_height, 600);
+
+#ifndef __amigaos4__
+ nsoption_set_bool(download_notify, false);
+ nsoption_set_bool(context_menu, false);
+ nsoption_set_bool(font_antialiasing, false);
+ nsoption_set_bool(truecolour_mouse_pointers, false);
+#endif
}
void ami_amiupdate(void)
@@ -666,6 +672,8 @@ void ami_openscreen(void)
gui_system_colour_finalize();
gui_system_colour_init();
+
+ //ami_help_new_screen(scrn);
}
void ami_openscreenfirst(void)
@@ -1002,6 +1010,7 @@ int ami_key_to_nskey(ULONG keycode, struct InputEvent *ie)
else nskey = KEY_TAB;
break;
case RAWKEY_F5:
+ case RAWKEY_HELP:
// don't translate
nskey = keycode;
break;
@@ -1823,6 +1832,10 @@ void ami_handle_msg(void)
if(browser_window_reload_available(gwin->bw))
browser_window_reload(gwin->bw,false);
break;
+
+ case RAWKEY_HELP: // help
+ //ami_help_open(AMI_HELP_GUI);
+ break;
}
}
}
@@ -2362,11 +2375,13 @@ void ami_quit_netsurf_delayed(void)
}
}
-void ami_gui_close_screen(struct Screen *scrn)
+void ami_gui_close_screen(struct Screen *scrn, BOOL locked_screen)
{
if(scrn == NULL) return;
if(CloseScreen(scrn)) return;
+ if(locked_screen == TRUE) return;
+ /* If this is our own screen, wait for visitor windows to close */
LOG(("Waiting for visitor windows to close..."));
do {
Delay(50);
@@ -2395,10 +2410,7 @@ void gui_quit(void)
FreeScreenDrawInfo(scrn, dri);
ami_close_fonts();
-
- /* If it is our public screen, close it or wait until the visitor windows leave */
- if(locked_screen == FALSE) ami_gui_close_screen(scrn);
-
+ ami_gui_close_screen(scrn, locked_screen);
FreeVec(nsscreentitle);
ami_context_menu_free();
@@ -2410,6 +2422,7 @@ void gui_quit(void)
FreeSysObject(ASOT_PORT,appport);
FreeSysObject(ASOT_PORT,sport);
+ //ami_help_free();
ami_file_req_free();
ami_openurl_close();
@@ -3591,7 +3604,7 @@ void gui_window_set_title(struct gui_window *g, const char *title)
}
}
-void ami_do_redraw_tiled(struct gui_window_2 *gwin,
+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)
{
@@ -3630,24 +3643,22 @@ void ami_do_redraw_tiled(struct gui_window_2 *gwin,
if(width <= 0) return;
if(height <= 0) return;
-// printf("%ld %ld %ld %ld\n",left, top, width, height);
-
- ami_set_pointer(gwin, GUI_POINTER_WAIT, false);
+ if(busy) ami_set_pointer(gwin, GUI_POINTER_WAIT, false);
for(y = top; y < (top + height); y += tile_y_scale) {
clip.y0 = 0;
clip.y1 = nsoption_int(redraw_tile_size_y);
+ if(clip.y1 > height) clip.y1 = height;
if((((y - sy) * gwin->bw->scale) + clip.y1) > bbox->Height)
clip.y1 = bbox->Height - ((y - sy) * gwin->bw->scale);
for(x = left; x < (left + width); x += tile_x_scale) {
clip.x0 = 0;
clip.x1 = nsoption_int(redraw_tile_size_x);
+ if(clip.x1 > width) clip.x1 = width;
if((((x - sx) * gwin->bw->scale) + clip.x1) > bbox->Width)
clip.x1 = bbox->Width - ((x - sx) * gwin->bw->scale);
-//printf("%ld %ld -> %ld %ld\n",clip.x0 - (int)(x), clip.y0 - (int)(y), clip.x1, clip.y1);
-
if(browser_window_redraw(gwin->bw,
clip.x0 - (int)x,
clip.y0 - (int)y,
@@ -3670,7 +3681,7 @@ void ami_do_redraw_tiled(struct gui_window_2 *gwin,
}
}
- ami_reset_pointer(gwin);
+ if(busy) ami_reset_pointer(gwin);
}
@@ -3685,7 +3696,7 @@ void ami_do_redraw_tiled(struct gui_window_2 *gwin,
* \param y1 bottom-right co-ordinate (in document co-ordinates)
*/
-void ami_do_redraw_limits(struct gui_window *g, struct browser_window *bw,
+void ami_do_redraw_limits(struct gui_window *g, struct browser_window *bw, bool busy,
int x0, int y0, int x1, int y1)
{
ULONG xoffset,yoffset,width=800,height=600;
@@ -3716,7 +3727,7 @@ void ami_do_redraw_limits(struct gui_window *g, struct browser_window *bw,
GetAttr(SPACE_AreaBox, g->shared->objects[GID_BROWSER], (ULONG *)&bbox);
- ami_do_redraw_tiled(g->shared, x0, y0, x1 - x0, y1 - y0, sx, sy, bbox, &ctx);
+ ami_do_redraw_tiled(g->shared, busy, x0, y0, x1 - x0, y1 - y0, sx, sy, bbox, &ctx);
return;
}
@@ -3737,7 +3748,7 @@ void gui_window_update_box(struct gui_window *g, const struct rect *rect)
{
if(!g) return;
- ami_do_redraw_limits(g, g->shared->bw,
+ ami_do_redraw_limits(g, g->shared->bw, true,
rect->x0, rect->y0,
rect->x1, rect->y1);
}
@@ -3796,14 +3807,14 @@ void ami_do_redraw(struct gui_window_2 *gwin)
if(vcurrent>oldv) /* Going down */
{
- ami_do_redraw_limits(gwin->bw->window, gwin->bw,
+ ami_do_redraw_limits(gwin->bw->window, gwin->bw, true,
hcurrent, (height / gwin->bw->scale) + oldv - 1,
hcurrent + (width / gwin->bw->scale),
vcurrent + (height / gwin->bw->scale) + 1);
}
else if(vcurrent<oldv) /* Going up */
{
- ami_do_redraw_limits(gwin->bw->window, gwin->bw,
+ ami_do_redraw_limits(gwin->bw->window, gwin->bw, true,
hcurrent, vcurrent,
hcurrent + (width / gwin->bw->scale),
oldv);
@@ -3811,14 +3822,14 @@ void ami_do_redraw(struct gui_window_2 *gwin)
if(hcurrent>oldh) /* Going right */
{
- ami_do_redraw_limits(gwin->bw->window, gwin->bw,
+ ami_do_redraw_limits(gwin->bw->window, gwin->bw, true,
(width / gwin->bw->scale) + oldh , vcurrent,
hcurrent + (width / gwin->bw->scale),
vcurrent + (height / gwin->bw->scale));
}
else if(hcurrent<oldh) /* Going left */
{
- ami_do_redraw_limits(gwin->bw->window, gwin->bw,
+ ami_do_redraw_limits(gwin->bw->window, gwin->bw, true,
hcurrent, vcurrent,
oldh, vcurrent + (height / gwin->bw->scale));
}
@@ -3836,7 +3847,7 @@ void ami_do_redraw(struct gui_window_2 *gwin)
if(nsoption_bool(direct_render) == false)
{
- ami_do_redraw_tiled(gwin, hcurrent, vcurrent, width, height, hcurrent, vcurrent, bbox, &ctx);
+ ami_do_redraw_tiled(gwin, true, hcurrent, vcurrent, width, height, hcurrent, vcurrent, bbox, &ctx);
}
else
{
@@ -3882,39 +3893,42 @@ void ami_refresh_window(struct gui_window_2 *gwin)
sy = gwin->bw->window->scrolly;
GetAttr(SPACE_AreaBox, (Object *)gwin->objects[GID_BROWSER], (ULONG *)&bbox);
-
+ ami_set_pointer(gwin, GUI_POINTER_WAIT, false);
+
BeginRefresh(gwin->win);
x0 = ((gwin->win->RPort->Layer->DamageList->bounds.MinX - bbox->Left) /
- browser_window_get_scale(gwin->bw)) + sx;
+ browser_window_get_scale(gwin->bw)) + sx - 1;
x1 = ((gwin->win->RPort->Layer->DamageList->bounds.MaxX - bbox->Left) /
- browser_window_get_scale(gwin->bw)) + sx;
+ browser_window_get_scale(gwin->bw)) + sx + 2;
y0 = ((gwin->win->RPort->Layer->DamageList->bounds.MinY - bbox->Top) /
- browser_window_get_scale(gwin->bw)) + sy;
+ browser_window_get_scale(gwin->bw)) + sy - 1;
y1 = ((gwin->win->RPort->Layer->DamageList->bounds.MaxY - bbox->Top) /
- browser_window_get_scale(gwin->bw)) + sy;
+ browser_window_get_scale(gwin->bw)) + sy + 2;
regrect = gwin->win->RPort->Layer->DamageList->RegionRectangle;
- ami_do_redraw_limits(gwin->bw->window, gwin->bw, x0, y0, x1, y1);
+ ami_do_redraw_limits(gwin->bw->window, gwin->bw, false, x0, y0, x1, y1);
while(regrect)
{
x0 = ((regrect->bounds.MinX - bbox->Left) /
- browser_window_get_scale(gwin->bw)) + sx;
+ browser_window_get_scale(gwin->bw)) + sx - 1;
x1 = ((regrect->bounds.MaxX - bbox->Left) /
- browser_window_get_scale(gwin->bw)) + sx;
+ browser_window_get_scale(gwin->bw)) + sx + 2;
y0 = ((regrect->bounds.MinY - bbox->Top) /
- browser_window_get_scale(gwin->bw)) + sy;
+ browser_window_get_scale(gwin->bw)) + sy - 1;
y1 = ((regrect->bounds.MaxY - bbox->Top) /
- browser_window_get_scale(gwin->bw)) + sy;
+ browser_window_get_scale(gwin->bw)) + sy + 2;
regrect = regrect->Next;
- ami_do_redraw_limits(gwin->bw->window, gwin->bw, x0, y0, x1, y1);
+ ami_do_redraw_limits(gwin->bw->window, gwin->bw, false, x0, y0, x1, y1);
}
EndRefresh(gwin->win, TRUE);
+
+ ami_reset_pointer(gwin);
}
void ami_get_hscroll_pos(struct gui_window_2 *gwin, ULONG *xs)
@@ -4332,7 +4346,7 @@ void gui_window_remove_caret(struct gui_window *g)
if((nsoption_bool(kiosk_mode) == false))
OffMenu(g->shared->win, AMI_MENU_PASTE);
- ami_do_redraw_limits(g, g->shared->bw, g->c_x, g->c_y,
+ ami_do_redraw_limits(g, g->shared->bw, false, g->c_x, g->c_y,
g->c_x + g->c_w + 1, g->c_y + g->c_h + 1);
g->c_h = 0;
diff --git a/amiga/gui.h b/amiga/gui.h
index ff467977a..60ea7d900 100755
--- a/amiga/gui.h
+++ b/amiga/gui.h
@@ -147,8 +147,6 @@ void ami_get_msg(void);
void ami_close_all_tabs(struct gui_window_2 *gwin);
void ami_quit_netsurf(void);
void ami_do_redraw(struct gui_window_2 *g);
-void ami_do_redraw_limits(struct gui_window *g, struct browser_window *bw,
- int x0, int y0, int x1, int y1);
STRPTR ami_locale_langs(void);
int ami_key_to_nskey(ULONG keycode, struct InputEvent *ie);
bool ami_text_box_at_point(struct gui_window_2 *gwin, ULONG *x, ULONG *y);
diff --git a/amiga/gui_options.c b/amiga/gui_options.c
index e54ad15a6..bfee47985 100755
--- a/amiga/gui_options.c
+++ b/amiga/gui_options.c
@@ -33,10 +33,12 @@
#include "amiga/font.h"
#include "amiga/gui.h"
#include "amiga/gui_options.h"
+#include "amiga/help.h"
+#include "amiga/theme.h"
+#include "amiga/utf8.h"
#include "utils/messages.h"
#include "desktop/browser_private.h"
#include "desktop/options.h"
-#include "amiga/utf8.h"
#include "desktop/searchweb.h"
#include <proto/window.h>
@@ -729,12 +731,14 @@ void ami_gui_opts_open(void)
LAYOUT_SpaceOuter, TRUE,
LAYOUT_BevelStyle, BVS_GROUP,
LAYOUT_Label, gadlab[GRP_OPTS_MOUSE],
+#ifdef __amigaos4__
LAYOUT_AddChild, gow->objects[GID_OPTS_PTRTRUE] = CheckBoxObject,
GA_ID, GID_OPTS_PTRTRUE,
GA_RelVerify, TRUE,
GA_Text, gadlab[GID_OPTS_PTRTRUE],
GA_Selected, nsoption_bool(truecolour_mouse_pointers),
CheckBoxEnd,
+#endif
LAYOUT_AddChild, gow->objects[GID_OPTS_PTROS] = CheckBoxObject,
GA_ID, GID_OPTS_PTROS,
GA_RelVerify, TRUE,
@@ -1070,6 +1074,7 @@ void ami_gui_opts_open(void)
LABEL_Text, gadlab[GID_OPTS_FONT_MINSIZE],
LabelEnd,
LayoutEnd,
+#ifdef __amigaos4__
LAYOUT_AddChild,VGroupObject,
LAYOUT_SpaceOuter, TRUE,
LAYOUT_BevelStyle, BVS_GROUP,
@@ -1081,6 +1086,7 @@ void ami_gui_opts_open(void)
GA_Selected, nsoption_bool(font_antialiasing),
CheckBoxEnd,
LayoutEnd,
+#endif
LayoutEnd,
CHILD_WeightedHeight, 0,
LayoutEnd, // page vgroup
@@ -1205,6 +1211,7 @@ void ami_gui_opts_open(void)
GA_Text, gadlab[GID_OPTS_OVERWRITE],
GA_Selected, nsoption_bool(ask_overwrite),
CheckBoxEnd,
+#ifdef __amigaos4__
LAYOUT_AddChild, gow->objects[GID_OPTS_NOTIFY] = CheckBoxObject,
GA_ID, GID_OPTS_NOTIFY,
GA_RelVerify, TRUE,
@@ -1212,6 +1219,7 @@ void ami_gui_opts_open(void)
GA_Text, gadlab[GID_OPTS_NOTIFY],
GA_Selected, nsoption_bool(download_notify),
CheckBoxEnd,
+#endif
LayoutEnd,
LAYOUT_AddChild, gow->objects[GID_OPTS_DLDIR] = GetFileObject,
GA_ID, GID_OPTS_DLDIR,
@@ -1244,12 +1252,14 @@ void ami_gui_opts_open(void)
GA_Text, gadlab[GID_OPTS_CLOSE_NO_QUIT],
GA_Selected, nsoption_bool(close_no_quit),
CheckBoxEnd,
+#ifdef __amigaos4__
LAYOUT_AddChild, gow->objects[GID_OPTS_DOCKY] = CheckBoxObject,
GA_ID, GID_OPTS_DOCKY,
GA_RelVerify, TRUE,
GA_Text, gadlab[GID_OPTS_DOCKY],
GA_Selected, !nsoption_bool(hide_docky_icon),
CheckBoxEnd,
+#endif
LayoutEnd, // behaviour
CHILD_WeightedHeight, 0,
@@ -1292,12 +1302,14 @@ void ami_gui_opts_open(void)
LAYOUT_BevelStyle, BVS_GROUP,
LAYOUT_Label, gadlab[GRP_OPTS_MISC],
LAYOUT_SpaceOuter, TRUE,
+#ifdef __amigaos4__
LAYOUT_AddChild, gow->objects[GID_OPTS_CONTEXTMENU] = CheckBoxObject,
GA_ID, GID_OPTS_CONTEXTMENU,
GA_RelVerify, TRUE,
GA_Text, gadlab[GID_OPTS_CONTEXTMENU],
GA_Selected, nsoption_bool(context_menu),
CheckBoxEnd,
+#endif
LAYOUT_AddChild, gow->objects[GID_OPTS_FASTSCROLL] = CheckBoxObject,
GA_ID, GID_OPTS_FASTSCROLL,
GA_RelVerify, TRUE,
@@ -1582,10 +1594,12 @@ void ami_gui_opts_use(bool save)
}
GetAttr(GA_Selected,gow->objects[GID_OPTS_WIN_SIMPLE],(ULONG *)&data);
- if (data) {
+ if ((data == TRUE) && (nsoption_bool(window_simple_refresh) == false)) {
nsoption_set_bool(window_simple_refresh, true);
- } else {
+ nsoption_set_int(screen_compositing, 0);
+ } else if ((data == FALSE) && (nsoption_bool(window_simple_refresh) == true)) {
nsoption_set_bool(window_simple_refresh, false);
+ nsoption_set_int(screen_compositing, -1);
}
GetAttr(GETFILE_Drawer,gow->objects[GID_OPTS_THEME],(ULONG *)&data);
@@ -1887,6 +1901,16 @@ BOOL ami_gui_opts_event(void)
return TRUE;
break;
+ case WMHI_GADGETHELP:
+ if((result & WMHI_GADGETMASK) == 0) {
+ /* Pointer not over our window */
+ ami_help_open(AMI_HELP_MAIN);
+ } else {
+ /* TODO: Make this sensitive to the tab the user is currently on */
+ ami_help_open(AMI_HELP_PREFS);
+ }
+ break;
+
case WMHI_GADGETUP:
switch(result & WMHI_GADGETMASK)
{
diff --git a/amiga/help.c b/amiga/help.c
new file mode 100755
index 000000000..214e59d96
--- /dev/null
+++ b/amiga/help.c
@@ -0,0 +1,66 @@
+/*
+ * Copyright 2013 Chris Young <chris@unsatisfactorysoftware.co.uk>
+ *
+ * This file is part of NetSurf, http://www.netsurf-browser.org/
+ *
+ * NetSurf is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; version 2 of the License.
+ *
+ * NetSurf is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
+#include "amiga/help.h"
+
+/* AmigaGuide class */
+#include "amiga/agclass/amigaguide_class.h"
+
+Class *AmigaGuideClass = NULL;
+Object *AmigaGuideObject = NULL;
+
+/* This array needs to match the enum in help.h */
+STRPTR context_nodes[] = {
+ "Main",
+ "GUI",
+ "Prefs",
+ NULL
+};
+
+void ami_help_init(struct Screen *screen)
+{
+ AmigaGuideClass = initAGClass();
+
+ AmigaGuideObject = NewObject(AmigaGuideClass, NULL,
+ AMIGAGUIDE_Name, "PROGDIR:NetSurf.guide",
+ AMIGAGUIDE_BaseName, "NetSurf",
+ AMIGAGUIDE_Screen, screen,
+ AMIGAGUIDE_ContextArray, context_nodes,
+ AMIGAGUIDE_ContextID, AMI_HELP_MAIN,
+ TAG_DONE);
+}
+
+void ami_help_open(ULONG node)
+{
+ SetAttrs(AmigaGuideObject, AMIGAGUIDE_ContextID, node, TAG_DONE);
+ IDoMethod(AmigaGuideObject, AGM_OPEN, NULL);
+}
+
+void ami_help_free(void)
+{
+ if (AmigaGuideObject) DisposeObject(AmigaGuideObject);
+ if (AmigaGuideClass) freeAGClass(AmigaGuideClass);
+
+ AmigaGuideObject = NULL;
+ AmigaGuideClass = NULL;
+}
+
+void ami_help_new_screen(struct Screen *screen)
+{
+ SetAttrs(AmigaGuideObject, AMIGAGUIDE_Screen, screen, TAG_DONE);
+}
diff --git a/amiga/help.h b/amiga/help.h
new file mode 100755
index 000000000..4baa2a0e2
--- /dev/null
+++ b/amiga/help.h
@@ -0,0 +1,36 @@
+/*
+ * Copyright 2013 Chris Young <chris@unsatisfactorysoftware.co.uk>
+ *
+ * This file is part of NetSurf, http://www.netsurf-browser.org/
+ *
+ * NetSurf is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; version 2 of the License.
+ *
+ * NetSurf is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
+#ifndef AMIGA_HELP_H
+#define AMIGA_HELP_H
+#include <exec/types.h>
+
+/* This enum needs to match context_array in help.c */
+enum {
+ AMI_HELP_MAIN,
+ AMI_HELP_GUI,
+ AMI_HELP_PREFS,
+};
+
+struct Screen;
+
+void ami_help_init(struct Screen *screen);
+void ami_help_open(ULONG node);
+void ami_help_free(void);
+void ami_help_new_screen(struct Screen *screen);
+#endif
diff --git a/amiga/plotters.c b/amiga/plotters.c
index 7347f064d..ace3c3b53 100755
--- a/amiga/plotters.c
+++ b/amiga/plotters.c
@@ -1,5 +1,5 @@
/*
- * Copyright 2008, 2009, 2012 Chris Young <chris@unsatisfactorysoftware.co.uk>
+ * Copyright 2008-09, 2012-13 Chris Young <chris@unsatisfactorysoftware.co.uk>
*
* This file is part of NetSurf, http://www.netsurf-browser.org/
*
@@ -101,6 +101,18 @@ const struct plotter_table amiplot = {
.option_knockout = true,
};
+colour ami_abgr_to_argb(colour c) {
+ colour argb = 0x00000000;
+
+ /* NB: We force the alpha byte to be 0xff, as it is not set by the core. */
+ argb = 0xff000000 |
+ ((c & 0x00ff0000) >> 16) |
+ (c & 0x0000ff00) |
+ ((c & 0x000000ff) << 16);
+
+ return argb;
+}
+
#ifdef NS_AMIGA_CAIRO
void ami_cairo_set_colour(cairo_t *cr,colour c)
{
@@ -285,7 +297,7 @@ static void ami_plot_setapen(ULONG colour)
{
if(palette_mapped == false) {
SetRPAttrs(glob->rp, RPTAG_APenColor,
- p96EncodeColor(RGBFB_A8B8G8R8, colour),
+ ami_abgr_to_argb(colour),
TAG_DONE);
} else {
ULONG pen = ami_plot_obtain_pen(glob->shared_pens, colour);
@@ -297,7 +309,7 @@ static void ami_plot_setopen(ULONG colour)
{
if(palette_mapped == false) {
SetRPAttrs(glob->rp, RPTAG_OPenColor,
- p96EncodeColor(RGBFB_A8B8G8R8, colour),
+ ami_abgr_to_argb(colour),
TAG_DONE);
} else {
ULONG pen = ami_plot_obtain_pen(glob->shared_pens, colour);
@@ -695,6 +707,7 @@ static bool ami_bitmap(int x, int y, int width, int height, struct bitmap *bitma
if((GfxBase->LibNode.lib_Version >= 53) && (palette_mapped == false))
{
+#ifdef __amigaos4__
uint32 comptype = COMPOSITE_Src;
if(!bitmap->opaque)
comptype = COMPOSITE_Src_Over_Dest;
@@ -710,6 +723,7 @@ static bool ami_bitmap(int x, int y, int width, int height, struct bitmap *bitma
COMPTAG_OffsetX,x,
COMPTAG_OffsetY,y,
TAG_DONE);
+#endif
}
else
{
@@ -859,6 +873,7 @@ static void ami_bitmap_tile_hook(struct Hook *hook,struct RastPort *rp,struct Ba
if((GfxBase->LibNode.lib_Version >= 53) && (palette_mapped == false))
{
+#ifdef __amigaos4__
CompositeTags(COMPOSITE_Src_Over_Dest,bfbm->bm, rp->BitMap,
COMPTAG_Flags,COMPFLAG_IgnoreDestAlpha,
COMPTAG_DestX,bfmsg->Bounds.MinX,
@@ -870,6 +885,7 @@ static void ami_bitmap_tile_hook(struct Hook *hook,struct RastPort *rp,struct Ba
COMPTAG_OffsetX,xf,
COMPTAG_OffsetY,yf,
TAG_DONE);
+#endif
}
else
{
diff --git a/amiga/search.c b/amiga/search.c
index 1148f6d77..f1fad600b 100755
--- a/amiga/search.c
+++ b/amiga/search.c
@@ -174,6 +174,9 @@ void ami_search_open(struct gui_window *gwin)
fwin->node = AddObject(window_list,AMINS_FINDWINDOW);
fwin->node->objstruct = fwin;
gwin->shared->searchwin = fwin;
+
+ ActivateLayoutGadget((struct Gadget *)fwin->objects[GID_MAIN], fwin->win,
+ NULL, fwin->objects[GID_SEARCHSTRING]);
}
void ami_search_close(void)
@@ -202,6 +205,26 @@ BOOL ami_search_event(void)
case WMHI_GADGETUP:
switch(result & WMHI_GADGETMASK)
{
+ case GID_SEARCHSTRING:
+ browser_window_search_destroy_context(
+ fwin->gwin->shared->bw);
+ ami_search_set_forward_state(
+ true, NULL);
+ ami_search_set_back_state(
+ true, NULL);
+
+ RefreshSetGadgetAttrs((struct Gadget *)fwin->objects[GID_PREV],
+ fwin->win, NULL,
+ GA_Disabled, FALSE,
+ TAG_DONE);
+
+ RefreshSetGadgetAttrs((struct Gadget *)fwin->objects[GID_NEXT],
+ fwin->win, NULL,
+ GA_Disabled, FALSE,
+ TAG_DONE);
+
+ /* fall through */
+
case GID_NEXT:
search_insert = true;
flags = SEARCH_FLAG_FORWARDS |
@@ -228,25 +251,6 @@ BOOL ami_search_event(void)
flags,
ami_search_string());
ActivateWindow(fwin->gwin->shared->win);
- break;
-
- case GID_SEARCHSTRING:
- browser_window_search_destroy_context(
- fwin->gwin->shared->bw);
- ami_search_set_forward_state(
- true, NULL);
- ami_search_set_back_state(
- true, NULL);
-
- RefreshSetGadgetAttrs((struct Gadget *)fwin->objects[GID_PREV],
- fwin->win, NULL,
- GA_Disabled, FALSE,
- TAG_DONE);
-
- RefreshSetGadgetAttrs((struct Gadget *)fwin->objects[GID_NEXT],
- fwin->win, NULL,
- GA_Disabled, FALSE,
- TAG_DONE);
break;
}
break;
diff --git a/amiga/theme.c b/amiga/theme.c
index 65d2f51e1..fa058e043 100644
--- a/amiga/theme.c
+++ b/amiga/theme.c
@@ -265,6 +265,7 @@ void ami_init_mouse_pointers(void)
mouseptrobj[i] = NULL;
char ptrfname[1024];
+#ifdef __amigaos4__
if(nsoption_bool(truecolour_mouse_pointers))
{
ami_get_theme_filename((char *)&ptrfname,ptrs32[i], false);
@@ -316,6 +317,7 @@ void ami_init_mouse_pointers(void)
}
}
}
+#endif
if(!mouseptrobj[i])
{
@@ -370,8 +372,8 @@ void ami_mouse_pointers_free(void)
{
if(mouseptrbm[i])
{
- FreeRaster(mouseptrbm[i]->Planes[0],16,16);
- FreeRaster(mouseptrbm[i]->Planes[1],16,16);
+ FreeRaster(mouseptrbm[i]->Planes[0],32,32);
+ FreeRaster(mouseptrbm[i]->Planes[1],32,32);
FreeVec(mouseptrbm[i]);
}
}