mirror of
https://github.com/netsurf-browser/netsurf
synced 2024-12-22 20:16:54 +03:00
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.
This commit is contained in:
parent
9a8577fead
commit
7e0ed132f7
@ -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);
|
||||
|
||||
|
@ -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)
|
||||
|
@ -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__
|
||||
|
||||
|
@ -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
|
||||
|
||||
|
@ -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__
|
||||
|
||||
|
@ -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
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user