2010-12-30 03:53:11 +03:00
|
|
|
/*
|
|
|
|
* Copyright 2010 John-Mark Bell <jmb@netsurf-browser.org>
|
2015-01-22 03:24:56 +03:00
|
|
|
* Copyright 2014 Chris Young <chris@unsatisfactorysoftware.co.uk>
|
2010-12-30 03:53:11 +03:00
|
|
|
*
|
|
|
|
* 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/>.
|
|
|
|
*/
|
|
|
|
|
|
|
|
/** \file
|
|
|
|
* Minimal compatibility header for AmigaOS 3
|
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef AMIGA_OS3SUPPORT_H_
|
|
|
|
#define AMIGA_OS3SUPPORT_H_
|
|
|
|
|
|
|
|
#ifndef __amigaos4__
|
|
|
|
|
|
|
|
#include <stdint.h>
|
2015-01-19 02:54:21 +03:00
|
|
|
|
2014-12-20 15:42:55 +03:00
|
|
|
#include <proto/exec.h>
|
|
|
|
#include <proto/dos.h>
|
2010-12-30 03:53:11 +03:00
|
|
|
|
|
|
|
/* Include prototypes for amigalib */
|
|
|
|
#include <clib/alib_protos.h>
|
|
|
|
|
|
|
|
#ifndef EXEC_MEMORY_H
|
|
|
|
#include <exec/memory.h>
|
|
|
|
#endif
|
|
|
|
|
2015-01-19 02:54:21 +03:00
|
|
|
/* C macros */
|
2015-01-19 00:11:00 +03:00
|
|
|
#ifndef ASM
|
|
|
|
#define ASM
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#ifndef REG
|
|
|
|
#define REG(reg,arg) arg __asm(#reg)
|
|
|
|
#endif
|
|
|
|
|
2015-01-19 02:54:21 +03:00
|
|
|
#define MIN(a,b) (((a)<(b))?(a):(b))
|
|
|
|
|
2015-01-11 02:10:05 +03:00
|
|
|
/* Macros */
|
|
|
|
#define IsMinListEmpty(L) (L)->mlh_Head->mln_Succ == 0
|
2015-01-17 20:06:48 +03:00
|
|
|
#define LIB_IS_AT_LEAST(B,V,R) ((B)->lib_Version>(V)) || \
|
|
|
|
((B)->lib_Version==(V) && (B)->lib_Revision>=(R))
|
2015-01-19 02:29:49 +03:00
|
|
|
#define EAD_IS_FILE(E) ((E)->ed_Type<0)
|
2015-01-17 20:06:48 +03:00
|
|
|
|
2010-12-30 03:53:11 +03:00
|
|
|
/* Define extra memory type flags */
|
|
|
|
#define MEMF_PRIVATE MEMF_ANY
|
|
|
|
#define MEMF_SHARED MEMF_ANY
|
|
|
|
|
2015-01-17 20:06:48 +03:00
|
|
|
/* Ignore unsupported tags */
|
2015-01-18 21:50:01 +03:00
|
|
|
#define ASO_NoTrack TAG_IGNORE
|
2015-01-17 20:06:48 +03:00
|
|
|
#define BITMAP_DisabledSourceFile TAG_IGNORE
|
2015-01-31 15:59:49 +03:00
|
|
|
#define BITMAP_HasAlpha TAG_IGNORE
|
2015-01-18 21:50:01 +03:00
|
|
|
#define BLITA_UseSrcAlpha TAG_IGNORE
|
|
|
|
#define BLITA_MaskPlane TAG_IGNORE
|
2015-01-17 20:06:48 +03:00
|
|
|
#define CLICKTAB_CloseImage TAG_IGNORE
|
|
|
|
#define CLICKTAB_FlagImage TAG_IGNORE
|
|
|
|
#define CLICKTAB_LabelTruncate TAG_IGNORE
|
|
|
|
#define CLICKTAB_NodeClosed TAG_IGNORE
|
2015-01-18 21:53:41 +03:00
|
|
|
#define GETFONT_OTagOnly TAG_IGNORE
|
|
|
|
#define GETFONT_ScalableOnly TAG_IGNORE
|
2015-01-09 03:10:02 +03:00
|
|
|
#define PDTA_PromoteMask TAG_IGNORE
|
2015-01-17 20:06:48 +03:00
|
|
|
#define RPTAG_APenColor TAG_IGNORE
|
2015-09-05 17:37:34 +03:00
|
|
|
#define GA_ContextMenu TAG_IGNORE
|
2015-01-17 20:06:48 +03:00
|
|
|
#define GA_HintInfo TAG_IGNORE
|
|
|
|
#define GAUGEIA_Level TAG_IGNORE
|
|
|
|
#define IA_InBorder TAG_IGNORE
|
|
|
|
#define IA_Label TAG_IGNORE
|
|
|
|
#define SA_Compositing TAG_IGNORE
|
|
|
|
#define SBNA_Text TAG_IGNORE
|
2016-02-14 17:48:41 +03:00
|
|
|
#define SBNA_HintInfo TAG_IGNORE
|
2015-01-17 20:06:48 +03:00
|
|
|
#define TNA_CloseGadget TAG_IGNORE
|
|
|
|
#define TNA_HintInfo TAG_IGNORE
|
2015-09-05 17:37:34 +03:00
|
|
|
#define WA_ContextMenuHook TAG_IGNORE
|
2015-01-17 20:06:48 +03:00
|
|
|
#define WA_ToolBox TAG_IGNORE
|
|
|
|
#define WINDOW_BuiltInScroll TAG_IGNORE
|
|
|
|
#define WINDOW_NewMenu TAG_IGNORE
|
|
|
|
#define WINDOW_NewPrefsHook TAG_IGNORE
|
|
|
|
|
|
|
|
/* raw keycodes */
|
|
|
|
#define RAWKEY_BACKSPACE 0x41
|
|
|
|
#define RAWKEY_TAB 0x42
|
|
|
|
#define RAWKEY_ESC 0x45
|
|
|
|
#define RAWKEY_DEL 0x46
|
|
|
|
#define RAWKEY_PAGEUP 0x48
|
|
|
|
#define RAWKEY_PAGEDOWN 0x49
|
|
|
|
#define RAWKEY_CRSRUP 0x4C
|
|
|
|
#define RAWKEY_CRSRDOWN 0x4D
|
|
|
|
#define RAWKEY_CRSRRIGHT 0x4E
|
|
|
|
#define RAWKEY_CRSRLEFT 0x4F
|
|
|
|
#define RAWKEY_F5 0x54
|
2015-12-20 19:43:35 +03:00
|
|
|
#define RAWKEY_F8 0x57
|
|
|
|
#define RAWKEY_F9 0x58
|
|
|
|
#define RAWKEY_F10 0x59
|
2015-01-17 20:06:48 +03:00
|
|
|
#define RAWKEY_HELP 0x5F
|
|
|
|
#define RAWKEY_HOME 0x70
|
|
|
|
#define RAWKEY_END 0x71
|
|
|
|
|
|
|
|
/* Other constants */
|
2015-01-19 02:13:32 +03:00
|
|
|
#define BVS_DISPLAY BVS_NONE
|
2015-01-17 20:06:48 +03:00
|
|
|
#define IDCMP_EXTENDEDMOUSE 0
|
|
|
|
#define WINDOW_BACKMOST 0
|
|
|
|
#define DN_FULLPATH 0
|
2015-01-19 00:11:00 +03:00
|
|
|
#define BGBACKFILL JAM1
|
2015-01-28 21:49:44 +03:00
|
|
|
#define OFF_OPEN 0
|
2015-01-30 21:57:04 +03:00
|
|
|
#define AFF_OTAG 0
|
2015-01-09 03:10:02 +03:00
|
|
|
|
2015-01-11 02:49:55 +03:00
|
|
|
/* Renamed structures */
|
|
|
|
#define AnchorPathOld AnchorPath
|
|
|
|
|
2015-01-18 21:53:41 +03:00
|
|
|
/* ReAction (ClassAct) macros */
|
|
|
|
#define GetFileEnd End
|
|
|
|
#define GetFontEnd End
|
|
|
|
#define GetScreenModeEnd End
|
|
|
|
|
2015-09-01 20:02:32 +03:00
|
|
|
/* MinTerm stuff */
|
|
|
|
#define MINTERM_SRCMASK (ABC|ABNC|ANBC)
|
|
|
|
|
2015-01-09 03:24:58 +03:00
|
|
|
/* Easy compat macros */
|
|
|
|
/* application */
|
2015-01-13 01:40:46 +03:00
|
|
|
#define Notify(...) (void)0
|
2015-01-09 03:24:58 +03:00
|
|
|
|
2015-01-19 02:54:21 +03:00
|
|
|
/* DataTypes */
|
|
|
|
#define SaveDTObjectA(O,W,R,F,M,I,A) DoDTMethod(O,W,R,DTM_WRITE,F,M,NULL)
|
|
|
|
|
2015-01-09 03:24:58 +03:00
|
|
|
/* diskfont */
|
2015-01-28 21:49:44 +03:00
|
|
|
#define EReleaseInfo ReleaseInfo
|
|
|
|
#define EObtainInfo ObtainInfo
|
|
|
|
#define ESetInfo SetInfo
|
|
|
|
|
2015-01-09 03:24:58 +03:00
|
|
|
/* Only used in one place we haven't ifdeffed, where it returns the charset name */
|
2016-01-26 22:37:18 +03:00
|
|
|
#define ObtainCharsetInfo(A,B,C) (const char *)nsoption_charp(local_charset)
|
2015-01-09 03:24:58 +03:00
|
|
|
|
|
|
|
/* DOS */
|
2015-01-18 21:50:01 +03:00
|
|
|
#define AllocSysObjectTags(A,B,C,D) CreateMsgPort() /* Assume ASOT_PORT for now */
|
2015-01-11 02:10:05 +03:00
|
|
|
#define FOpen(A,B,C) Open(A,B)
|
|
|
|
#define FClose(A) Close(A)
|
2015-01-17 20:06:48 +03:00
|
|
|
#define CreateDirTree(D) CreateDir(D) /*\todo This isn't quite right */
|
2015-11-22 03:06:10 +03:00
|
|
|
#define SetCurrentDir(L) CurrentDir(L)
|
2015-01-17 20:06:48 +03:00
|
|
|
#define DevNameFromLock(A,B,C,D) NameFromLock(A,B,C)
|
|
|
|
|
|
|
|
/* Exec */
|
|
|
|
#define AllocVecTagList(SZ,TAG) AllocVec(SZ,MEMF_ANY) /* AllocVecTagList with no tags */
|
2015-01-29 22:31:47 +03:00
|
|
|
#define FindIName FindName
|
2015-01-17 20:06:48 +03:00
|
|
|
|
2015-01-09 03:24:58 +03:00
|
|
|
/* Intuition */
|
2015-01-19 02:29:49 +03:00
|
|
|
#define ICoerceMethod CoerceMethod
|
2015-01-09 03:24:58 +03:00
|
|
|
#define IDoMethod DoMethod
|
2015-01-11 02:46:17 +03:00
|
|
|
#define IDoMethodA DoMethodA
|
2015-01-11 01:47:20 +03:00
|
|
|
#define IDoSuperMethodA DoSuperMethodA
|
2015-01-17 20:06:48 +03:00
|
|
|
#define ShowWindow(...) (void)0
|
|
|
|
|
2015-01-11 03:07:11 +03:00
|
|
|
/* Utility */
|
|
|
|
#define SetMem memset
|
2015-01-19 02:13:32 +03:00
|
|
|
#define SNPrintf snprintf
|
2015-01-09 03:24:58 +03:00
|
|
|
|
2010-12-30 03:53:11 +03:00
|
|
|
/* Integral type definitions */
|
|
|
|
typedef int8_t int8;
|
|
|
|
typedef uint8_t uint8;
|
|
|
|
typedef int16_t int16;
|
|
|
|
typedef uint16_t uint16;
|
|
|
|
typedef int32_t int32;
|
|
|
|
typedef uint32_t uint32;
|
2014-12-20 15:42:55 +03:00
|
|
|
typedef int64_t int64;
|
|
|
|
typedef uint64_t uint64;
|
2010-12-30 03:53:11 +03:00
|
|
|
|
|
|
|
/* TimeVal */
|
|
|
|
struct TimeVal {
|
|
|
|
uint32 Seconds;
|
|
|
|
uint32 Microseconds;
|
|
|
|
};
|
|
|
|
|
2015-01-19 02:13:32 +03:00
|
|
|
/* TimeRequest */
|
|
|
|
struct TimeRequest {
|
|
|
|
struct IORequest Request;
|
|
|
|
struct TimeVal Time;
|
|
|
|
};
|
|
|
|
|
2015-01-28 21:49:44 +03:00
|
|
|
/* OutlineFont */
|
|
|
|
struct OutlineFont {
|
|
|
|
struct BulletBase *BulletBase;
|
2015-01-30 21:32:44 +03:00
|
|
|
struct GlyphEngine *GEngine;
|
2015-01-28 21:49:44 +03:00
|
|
|
STRPTR OTagPath;
|
|
|
|
struct TagItem *olf_OTagList;
|
|
|
|
};
|
|
|
|
|
2016-01-14 03:11:48 +03:00
|
|
|
/* BackFillMessage */
|
|
|
|
struct BackFillMessage {
|
|
|
|
struct Layer *Layer;
|
|
|
|
struct Rectangle Bounds;
|
|
|
|
LONG OffsetX;
|
|
|
|
LONG OffsetY;
|
|
|
|
};
|
|
|
|
|
2011-01-08 02:45:17 +03:00
|
|
|
/* icon.library v51 (ie. AfA_OS version) */
|
|
|
|
#define ICONCTRLA_SetImageDataFormat (ICONA_Dummy + 0x67) /*103*/
|
|
|
|
#define ICONCTRLA_GetImageDataFormat (ICONA_Dummy + 0x68) /*104*/
|
|
|
|
|
|
|
|
#define IDFMT_BITMAPPED (0) /* Bitmapped icon (planar, legacy) */
|
|
|
|
#define IDFMT_PALETTEMAPPED (1) /* Palette mapped icon (chunky, V44+) */
|
|
|
|
#define IDFMT_DIRECTMAPPED (2) /* Direct mapped icon (truecolor 0xAARRGGBB, V51+) */
|
|
|
|
|
2015-01-17 20:06:48 +03:00
|
|
|
/* Object types */
|
|
|
|
enum {
|
2015-01-19 02:13:32 +03:00
|
|
|
ASOT_PORT = 1,
|
|
|
|
ASOT_IOREQUEST
|
2015-01-17 20:06:48 +03:00
|
|
|
};
|
|
|
|
|
2015-01-19 00:11:00 +03:00
|
|
|
/* Requester types */
|
|
|
|
enum {
|
|
|
|
TDRIMAGE_ERROR = 1,
|
|
|
|
TDRIMAGE_WARNING
|
|
|
|
};
|
|
|
|
|
2014-12-20 15:42:55 +03:00
|
|
|
/* Functions */
|
2015-01-28 21:49:44 +03:00
|
|
|
/* Diskfont */
|
|
|
|
void CloseOutlineFont(struct OutlineFont *of, struct List *list);
|
|
|
|
struct OutlineFont *OpenOutlineFont(STRPTR fileName, struct List *list, ULONG flags);
|
|
|
|
|
2015-01-09 03:10:02 +03:00
|
|
|
/* DOS */
|
2014-12-20 15:42:55 +03:00
|
|
|
int64 GetFileSize(BPTR fh);
|
2015-01-17 20:06:48 +03:00
|
|
|
void FreeSysObject(ULONG type, APTR obj);
|
2015-01-09 03:10:02 +03:00
|
|
|
|
|
|
|
/* Exec */
|
|
|
|
struct Node *GetHead(struct List *list);
|
2015-02-02 03:09:07 +03:00
|
|
|
struct Node *GetPred(struct Node *node);
|
2015-01-31 02:28:35 +03:00
|
|
|
struct Node *GetSucc(struct Node *node);
|
2015-01-09 03:10:02 +03:00
|
|
|
|
2015-01-17 20:06:48 +03:00
|
|
|
/* Intuition */
|
|
|
|
uint32 GetAttrs(Object *obj, Tag tag1, ...);
|
2015-01-20 03:06:08 +03:00
|
|
|
ULONG RefreshSetGadgetAttrs(struct Gadget *g, struct Window *w, struct Requester *r, Tag tag1, ...);
|
|
|
|
ULONG RefreshSetGadgetAttrsA(struct Gadget *g, struct Window *w, struct Requester *r, struct TagItem *tags);
|
2015-01-17 20:06:48 +03:00
|
|
|
|
2015-01-09 03:10:02 +03:00
|
|
|
/* Utility */
|
|
|
|
char *ASPrintf(const char *fmt, ...);
|
2010-12-30 03:53:11 +03:00
|
|
|
|
2015-01-11 03:07:11 +03:00
|
|
|
/* C */
|
|
|
|
char *strlwr(char *str);
|
2010-12-30 03:53:11 +03:00
|
|
|
#endif
|
2015-01-11 03:07:11 +03:00
|
|
|
#endif
|
|
|
|
|