2 Copyright © 1995-2011, The AROS Development Team. All rights reserved.
6 #ifndef DISKFONT_INTERN_H
7 #define DISKFONT_INTERN_H
10 # include <proto/exec.h>
12 #ifndef EXEC_LIBRARIES_H
13 # include <exec/libraries.h>
15 #ifndef DISKFONT_DISKFONT_H
16 # include <diskfont/diskfont.h>
19 # include <exec/memory.h>
22 # include <exec/lists.h>
24 #include <exec/semaphores.h>
25 #ifndef AROS_ASMCALL_H
26 # include <aros/asmcall.h>
28 #ifndef UTILITY_HOOKS_H
29 # include <utility/hooks.h>
34 #include <aros/libcall.h>
38 #define ALWAYS_ZERO_LIBCOUNT 1
51 /* Number of font hooks used */
52 #define NUMFONTHOOKS 2
54 #define FONTTYPE_ROMFONT FPF_ROMFONT
55 #define FONTTYPE_DISKFONT FPF_DISKFONT
56 #define FONTTYPE_SCALEDFONT 0
57 #define FONTTYPE_OUTLINEFONT (FPF_ROMFONT | FPF_DISKFONT)
58 #define FONTTYPE_FLAGMASK (FPF_ROMFONT | FPF_DISKFONT)
60 #define IS_SCALED_FONT(ta) (((ta)->tta_Flags & FONTTYPE_FLAGMASK) == FONTTYPE_SCALEDFONT)
61 #define IS_OUTLINE_FONT(ta) (((ta)->tta_Flags & FONTTYPE_FLAGMASK) == FONTTYPE_OUTLINEFONT)
63 /* ID for cache-file */
65 #define CACHE_IDSTR "MORPHOS_FC"
67 #define CACHE_IDSTR "AROS_FC"
70 /* Path to the cachefile */
72 #define CACHE_FILE "FONTS:_fontcache"
74 #define CACHE_FILE "fontcache"
76 #define PROGDIRFONTSDIR "PROGDIR:Fonts/"
77 #define FONTSDIR "FONTS:"
86 struct FontDescrHeader
88 UWORD NumOutlineEntries
;
92 struct TTextAttr
*TAttrArray
;
93 struct OTagList
*OTagList
;
99 struct AADiskFontHeader
105 char dfh_Name
[MAXFONTNAME
];
106 struct ColorTextFont dfh_TF
;
115 struct DiskfontBase
; /* prerefrence */
117 /* memoryfontfunc.c */
119 APTR
MF_IteratorInit(struct DiskfontBase
*);
120 struct TTextAttr
*MF_IteratorGetNext(APTR
, struct DiskfontBase
*);
121 VOID
MF_IteratorFree(APTR
, struct DiskfontBase
*);
125 VOID
CleanUpFontsDirEntryList(struct DiskfontBase
*);
126 APTR
DF_IteratorInit(struct TTextAttr
*, struct DiskfontBase
*);
127 struct TTextAttr
*DF_IteratorGetNext(APTR
, struct DiskfontBase
*);
128 VOID
DF_IteratorRemember(APTR
, struct DiskfontBase
*);
129 struct TextFont
*DF_IteratorRememberOpen(APTR
, struct DiskfontBase
*);
130 VOID
DF_IteratorFree(APTR
, struct DiskfontBase
*);
131 struct TextFont
*DF_OpenFontPath(struct TextAttr
*, struct DiskfontBase
*);
135 struct DiskFontHeader
*ConvDiskFont(BPTR
, CONST_STRPTR
, BOOL
, struct DiskfontBase
*);
136 void DisposeConvDiskFont(struct DiskFontHeader
*, struct DiskfontBase
*);
137 struct TextFont
*ReadDiskFont(struct TTextAttr
*, CONST_STRPTR
, struct DiskfontBase
*);
139 /* af_fontdescr_io.c */
141 struct FontDescrHeader
*ReadFontDescr(CONST_STRPTR
, struct DiskfontBase
*);
142 VOID
FreeFontDescr(struct FontDescrHeader
*, struct DiskfontBase
*);
144 /* dosstreamhook.c */
146 AROS_UFP3(LONG
, dosstreamhook
,
147 AROS_UFPA(struct Hook
*, hook
, A0
),
148 AROS_UFPA(BPTR
, file
, A2
),
149 AROS_UFPA(ULONG
*, msg
, A1
)
154 STRPTR
OTAG_MakeFileName(CONST_STRPTR
, struct DiskfontBase
*);
155 VOID
OTAG_FreeFileName(STRPTR
, struct DiskfontBase
*);
156 struct OTagList
*OTAG_GetFile(CONST_STRPTR
, struct DiskfontBase
*);
157 VOID
OTAG_KillFile(struct OTagList
*, struct DiskfontBase
*);
158 UBYTE
OTAG_GetFontStyle(struct OTagList
*, struct DiskfontBase
*);
159 UBYTE
OTAG_GetSupportedStyles(struct OTagList
*, struct DiskfontBase
*);
160 UBYTE
OTAG_GetFontFlags(struct OTagList
*, struct DiskfontBase
*);
161 struct TextFont
*OTAG_ReadOutlineFont(struct TTextAttr
*, struct TTextAttr
*, struct OTagList
*, struct DiskfontBase
*);
165 #define MAKE_REAL_SEGMENT(x) (MKBADDR(((IPTR)(x)) - sizeof(BPTR)))
167 APTR
AllocSegment(BPTR
*, ULONG
, ULONG
, struct DiskfontBase
*);
168 struct TagItem
*ReadTags(BPTR
, ULONG
, struct DiskfontBase
*);
169 struct TagItem
*ReadTagsNum(BPTR
, ULONG
*, struct DiskfontBase
*);
170 /*BOOL WriteTags(BPTR, struct TagItem *, struct DiskfontBase *);*/
171 BOOL
WriteTagsNum(BPTR
, const struct TagItem
*, struct DiskfontBase
*);
172 ULONG
NumTags(const struct TagItem
*, struct DiskfontBase
*);
173 ULONG
CopyTagItems(struct TagItem
*, const struct TagItem
*, struct DiskfontBase
*);
176 /********************/
177 /* Some nice macros */
178 /********************/
181 #define AFH(p) ((struct AvailFontsHeader *)p)
184 #define AVF(p) ((struct AvailFonts *)p)
187 #define TAVF(p) ((struct TAvailFonts *)p)
190 #define TI(t) ((struct TagItem *)t)
193 #define UB(p) ((UBYTE *)p)
196 #define TFE(t) ((struct TextFontExtension*)t)
198 /* Some external stuff (diskfont_init.c) */
200 /* Internal prototypes */
206 /* dosstreamhandler hook neede for endian io funcs */
208 struct List diskfontlist
;
210 struct MinList fontsdirentrylist
;
211 struct SignalSemaphore fontssemaphore
;
213 /* MemHandler interrupt for flushing library */
214 struct Interrupt memint
;
217 #define DFB(dfb) ((struct DiskfontBase *)dfb)
219 #endif /* diskfont_intern.h */