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 . */ +#ifdef __amigaos4__ /// Include #include @@ -32,7 +33,6 @@ #include #include -#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 . */ -#include "amiga/os3support.h" +#ifndef AMIGA_STRINGVIEW_H +#define AMIGA_STRINGVIEW_H 1 #include #include @@ -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 . */ +#ifdef __amigaos4__ #include #include #include @@ -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 . */ +#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 +