summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChris Young <chris@unsatisfactorysoftware.co.uk>2017-04-16 17:49:27 +0100
committerChris Young <chris@unsatisfactorysoftware.co.uk>2017-04-16 17:49:27 +0100
commit7e0ed132f7d3edb1681badc1fadaf5a0812d7768 (patch)
tree3eef8e12bdb5fc133a7a03fed59d444b4ee6b5c7
parent9a8577feadd13d0634f773953096a0ec3e7cb1eb (diff)
downloadnetsurf-7e0ed132f7d3edb1681badc1fadaf5a0812d7768.tar.gz
netsurf-7e0ed132f7d3edb1681badc1fadaf5a0812d7768.tar.bz2
Adjust the requested class versions to be the minimum required.
Some features of later versions are used but are either restricted to OS4 only, or runtime version checks select the appropriate routines. Where the lowest required version cannot be determined, the version provided in the ClassAct 3.3 archive is requested. Bugs may mean these older classes do not work as expected. In addition, restrict the opening of listbrowser.gadget and the custom Stringview class to OS4 only.
-rw-r--r--frontends/amiga/gui.c9
-rw-r--r--frontends/amiga/libs.c51
-rwxr-xr-xfrontends/amiga/stringview/stringview.c3
-rwxr-xr-xfrontends/amiga/stringview/stringview.h5
-rw-r--r--frontends/amiga/stringview/urlhistory.c3
-rw-r--r--frontends/amiga/stringview/urlhistory.h5
6 files changed, 50 insertions, 26 deletions
diff --git a/frontends/amiga/gui.c b/frontends/amiga/gui.c
index 4b6daa778..657227459 100644
--- a/frontends/amiga/gui.c
+++ b/frontends/amiga/gui.c
@@ -17,10 +17,11 @@
*/
-
+#ifdef __amigaos4__
/* Custom StringView class */
#include "amiga/stringview/stringview.h"
#include "amiga/stringview/urlhistory.h"
+#endif
/* AmigaOS libraries */
#ifdef __amigaos4__
@@ -196,7 +197,9 @@ static bool ami_quit = false;
static struct MsgPort *schedulermsgport = NULL;
static struct MsgPort *appport;
+#ifdef __amigaos4__
static Class *urlStringClass;
+#endif
static BOOL locked_screen = FALSE;
static int screen_signal = -1;
@@ -439,7 +442,9 @@ static void ami_gui_resources_free(void)
static bool ami_gui_resources_open(void)
{
+#ifdef __amigaos4__
urlStringClass = MakeStringClass();
+#endif
if(!(appport = AllocSysObjectTags(ASOT_PORT,
ASO_NoTrack, FALSE,
@@ -3058,7 +3063,9 @@ static void gui_quit(void)
ami_file_req_free();
ami_openurl_close();
+#ifdef __amigaos4__
FreeStringClass(urlStringClass);
+#endif
FreeObjList(window_list);
diff --git a/frontends/amiga/libs.c b/frontends/amiga/libs.c
index 4c242d214..30694542c 100644
--- a/frontends/amiga/libs.c
+++ b/frontends/amiga/libs.c
@@ -254,29 +254,32 @@ bool ami_libs_open(void)
* NB: the last argument should be "true" only if the class also has
* library functions we use.
*/
- AMINS_CLASS_OPEN("arexx.class", 44, ARexx, AREXX, false)
- AMINS_CLASS_OPEN("images/bevel.image", 44, Bevel, BEVEL, false)
- AMINS_CLASS_OPEN("images/bitmap.image", 44, BitMap, BITMAP, false)
- AMINS_CLASS_OPEN("gadgets/button.gadget", 44, Button, BUTTON, false)
- AMINS_CLASS_OPEN("gadgets/checkbox.gadget", 44, CheckBox, CHECKBOX, false)
- AMINS_CLASS_OPEN("gadgets/chooser.gadget", 44, Chooser, CHOOSER, true)
- AMINS_CLASS_OPEN("gadgets/clicktab.gadget", 44, ClickTab, CLICKTAB, true)
- AMINS_CLASS_OPEN("gadgets/fuelgauge.gadget", 44, FuelGauge, FUELGAUGE, false)
- AMINS_CLASS_OPEN("gadgets/getfile.gadget", 44, GetFile, GETFILE, false)
- AMINS_CLASS_OPEN("gadgets/getfont.gadget", 44, GetFont, GETFONT, false)
- AMINS_CLASS_OPEN("gadgets/getscreenmode.gadget", 44, GetScreenMode, GETSCREENMODE, false)
- AMINS_CLASS_OPEN("gadgets/integer.gadget", 44, Integer, INTEGER, false)
- AMINS_CLASS_OPEN("images/label.image", 44, Label, LABEL, false)
- AMINS_CLASS_OPEN("gadgets/layout.gadget", 44, Layout, LAYOUT, true)
- AMINS_CLASS_OPEN("gadgets/listbrowser.gadget", 44, ListBrowser, LISTBROWSER, true)
- AMINS_CLASS_OPEN("gadgets/radiobutton.gadget", 44, RadioButton, RADIOBUTTON, false)
- AMINS_CLASS_OPEN("gadgets/scroller.gadget", 44, Scroller, SCROLLER, false)
- AMINS_CLASS_OPEN("gadgets/space.gadget", 44, Space, SPACE, false)
- AMINS_CLASS_OPEN("gadgets/speedbar.gadget", 44, SpeedBar, SPEEDBAR, true)
- AMINS_CLASS_OPEN("gadgets/string.gadget", 44, String, STRING, false)
- AMINS_CLASS_OPEN("window.class", 44, Window, WINDOW, false)
+ AMINS_CLASS_OPEN("arexx.class", 41, ARexx, AREXX, false)
+ AMINS_CLASS_OPEN("images/bevel.image", 41, Bevel, BEVEL, false)
+ AMINS_CLASS_OPEN("images/bitmap.image", 41, BitMap, BITMAP, false)
+ AMINS_CLASS_OPEN("gadgets/button.gadget", 42, Button, BUTTON, false)
+ AMINS_CLASS_OPEN("gadgets/checkbox.gadget", 41, CheckBox, CHECKBOX, false)
+ AMINS_CLASS_OPEN("gadgets/chooser.gadget", 41, Chooser, CHOOSER, true)
+ AMINS_CLASS_OPEN("gadgets/clicktab.gadget", 42, ClickTab, CLICKTAB, true)
+ AMINS_CLASS_OPEN("gadgets/fuelgauge.gadget", 41, FuelGauge, FUELGAUGE, false)
+ AMINS_CLASS_OPEN("gadgets/getfile.gadget", 41, GetFile, GETFILE, false)
+ AMINS_CLASS_OPEN("gadgets/getfont.gadget", 41, GetFont, GETFONT, false)
+ AMINS_CLASS_OPEN("gadgets/getscreenmode.gadget", 41, GetScreenMode, GETSCREENMODE, false)
+ AMINS_CLASS_OPEN("gadgets/integer.gadget", 41, Integer, INTEGER, false)
+ AMINS_CLASS_OPEN("images/label.image", 41, Label, LABEL, false)
+ AMINS_CLASS_OPEN("gadgets/layout.gadget", 43, Layout, LAYOUT, true)
+ AMINS_CLASS_OPEN("gadgets/radiobutton.gadget", 41, RadioButton, RADIOBUTTON, false)
+ AMINS_CLASS_OPEN("gadgets/scroller.gadget", 42, Scroller, SCROLLER, false)
+ AMINS_CLASS_OPEN("gadgets/space.gadget", 41, Space, SPACE, false)
+ AMINS_CLASS_OPEN("gadgets/speedbar.gadget", 41, SpeedBar, SPEEDBAR, true)
+ AMINS_CLASS_OPEN("gadgets/string.gadget", 41, String, STRING, false)
+ AMINS_CLASS_OPEN("window.class", 42, Window, WINDOW, false)
-#ifndef __amigaos4__
+#ifdef __amigaos4__
+ /* BOOPSI classes only required on OS4 */
+ AMINS_CLASS_OPEN("gadgets/listbrowser.gadget", 45, ListBrowser, LISTBROWSER, true)
+#else
+ /* BOOPSI classes only required prior to OS4 */
PageClass = PAGE_GetClass();
#endif
@@ -302,13 +305,15 @@ void ami_libs_close(void)
AMINS_CLASS_CLOSE(Integer)
AMINS_CLASS_CLOSE(Label)
AMINS_CLASS_CLOSE(Layout)
- AMINS_CLASS_CLOSE(ListBrowser)
AMINS_CLASS_CLOSE(RadioButton)
AMINS_CLASS_CLOSE(Scroller)
AMINS_CLASS_CLOSE(Space)
AMINS_CLASS_CLOSE(SpeedBar)
AMINS_CLASS_CLOSE(String)
AMINS_CLASS_CLOSE(Window)
+#ifdef __amigaos4__
+ AMINS_CLASS_CLOSE(ListBrowser)
+#endif
/* Libraries */
AMINS_LIB_CLOSE(GuiGFX)
diff --git a/frontends/amiga/stringview/stringview.c b/frontends/amiga/stringview/stringview.c
index e875f3b5a..245782b43 100755
--- a/frontends/amiga/stringview/stringview.c
+++ b/frontends/amiga/stringview/stringview.c
@@ -17,6 +17,7 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
+#ifdef __amigaos4__
/// Include
#include <proto/dos.h>
@@ -32,7 +33,6 @@
#include <gadgets/layout.h>
#include <gadgets/listbrowser.h>
-#include "amiga/os3support.h"
#include "amiga/libs.h"
#include "stringview.h"
@@ -867,4 +867,5 @@ void FreeStringClass(Class *cl)
///
/* The End */
+#endif //__amigaos4__
diff --git a/frontends/amiga/stringview/stringview.h b/frontends/amiga/stringview/stringview.h
index f989b2a0f..776705f0f 100755
--- a/frontends/amiga/stringview/stringview.h
+++ b/frontends/amiga/stringview/stringview.h
@@ -17,7 +17,8 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
-#include "amiga/os3support.h"
+#ifndef AMIGA_STRINGVIEW_H
+#define AMIGA_STRINGVIEW_H 1
#include <exec/semaphores.h>
#include <intuition/classes.h>
@@ -58,3 +59,5 @@ void FreeStringClass(Class *);
#ifdef __cplusplus
}
#endif
+#endif
+
diff --git a/frontends/amiga/stringview/urlhistory.c b/frontends/amiga/stringview/urlhistory.c
index 7405fbb57..c1e37ea7e 100644
--- a/frontends/amiga/stringview/urlhistory.c
+++ b/frontends/amiga/stringview/urlhistory.c
@@ -18,6 +18,7 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
+#ifdef __amigaos4__
#include <stdio.h>
#include <ctype.h>
#include <string.h>
@@ -123,3 +124,5 @@ void URLHistory_AddPage( const char * urlString )
urldb_iterate_partial(urlString, URLHistoryFound);
}
}
+#endif //__amigaos4__
+
diff --git a/frontends/amiga/stringview/urlhistory.h b/frontends/amiga/stringview/urlhistory.h
index b72792db4..962713e9e 100644
--- a/frontends/amiga/stringview/urlhistory.h
+++ b/frontends/amiga/stringview/urlhistory.h
@@ -17,6 +17,9 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
+#ifndef AMIGA_URLHISTORY_H
+#define AMIGA_URLHISTORY_H 1
+
#ifdef __cplusplus
extern "C" {
#endif
@@ -31,3 +34,5 @@ void URLHistory_AddPage( const char * urlString );
#ifdef __cplusplus
}
#endif
+#endif
+