home *** CD-ROM | disk | FTP | other *** search
- #ifndef CPP_GRAPHICS_TEXT_H
- #define CPP_GRAPHICS_TEXT_H
-
- // Klassen für Textattribute und Zeichensätze
- //
- // Autor: Jochen Becher
- //
- // Historie:
- // Version 1.0 am 10. Januar 94
-
- #ifndef GRAPHICS_TEXT_H
- #include <graphics/text.h>
- #endif
-
- #ifndef CPP_UTILITY_TAGITEM_H
- #include <classes/utility/tagitem.h>
- #endif
-
- #ifndef CPP_EXEC_SHARE_H
- #include <classes/exec/share.h>
- #endif
-
- #ifndef INCLUDE_TOOLS_STR_H
- #include <tools/str.h>
- #endif
-
- class TextFontC {
- public:
- TextFontC() throw (MemoryX);
- TextFontC(const TextFontC &);
- ~TextFontC();
- TextFontC &operator= (const TextFontC &) throw (MemoryX);
- BOOL isOpen() const { return textfont != NULL; };
- struct TextFont *font() const { return textfont; };
- BOOL open(const class TextAttrC &);
- VOID close();
- private:
- struct TextFont *textfont;
- ShareManualC opened;
- };
-
- // *************************************************************
-
- class TextAttrC : protected TTextAttr {
- public:
- TextAttrC(STRPTR Name, UWORD YSize, UBYTE Style = 0, UBYTE Flags = 0,
- struct TagItem * = NULL) throw (MemoryX);
- TextAttrC(STRPTR Name, UWORD YSize, UBYTE Style, UBYTE Flags,
- Tag tag1type, ...) throw (MemoryX);
- TextAttrC(const struct TextAttr &) throw (MemoryX);
- TextAttrC(const TextAttrC &) throw (MemoryX);
- TextAttrC &operator= (const TextAttrC &) throw (MemoryX);
- // TextAttrC &operator= (const struct TextAttr &) throw (MemoryX);
- struct TextAttr *attr() { return (struct TextAttr *) this; };
- STRPTR name() const { return tta_Name; };
- UWORD ySize() const { return tta_YSize; };
- UBYTE style() const { return tta_Style; };
- UBYTE flags() const { return tta_Flags; };
- virtual TextAttrC &assign(const TextAttrC &) throw (MemoryX);
- private:
- TagItemC tags;
- protected:
- String fontname;
- };
-
- class LTextAttrC : public TextAttrC {
- public:
- LTextAttrC(STRPTR Name, UWORD YSize, UBYTE Style = 0, UBYTE Flags = 0,
- struct TagItem * = NULL) throw (FontX, MemoryX);
- LTextAttrC(STRPTR Name, UWORD YSize, UBYTE Style, UBYTE Flags,
- Tag tag1type, ...) throw (FontX, MemoryX);
- LTextAttrC(const struct TextAttr &) throw (FontX, MemoryX);
- LTextAttrC(const LTextAttrC &) throw (MemoryX);
- LTextAttrC &operator= (const LTextAttrC &) throw (MemoryX);
- // LTextAttrC &operator= (const struct TextAttr &) throw (FontX, MemoryX);
- private:
- TextFontC fontlock;
- };
-
- class FTextAttrC : public TextAttrC {
- public:
- FTextAttrC(STRPTR Name = NULL, UWORD YSize = 0,
- UBYTE Style = 0, UBYTE StyleMask = ~0,
- UBYTE Flags = 0, UBYTE FlagsMask = ~0,
- struct TagItem * = NULL) throw (MemoryX);
- FTextAttrC(STRPTR Name, UWORD YSize,
- UBYTE Style, UBYTE StyleMask, UBYTE Flags, UBYTE FlagsMask,
- Tag tag1type, ...) throw (MemoryX);
- TextAttrC &assign(const TextAttrC &) throw (MemoryX);
- private:
- BOOL named;
- BOOL sized;
- UBYTE styleMask;
- UBYTE flagsMask;
- };
-
- class FLTextAttrC : public FTextAttrC {
- public:
- FLTextAttrC(STRPTR Name = NULL, UWORD YSize = 0,
- UBYTE Style = 0, UBYTE StyleMask = ~0,
- UBYTE Flags = 0, UBYTE FlagsMask = ~0,
- struct TagItem * = NULL) throw (FontX, MemoryX);
- FLTextAttrC(STRPTR Name, UWORD YSize,
- UBYTE Style, UBYTE StyleMask, UBYTE Flags, UBYTE FlagsMask,
- Tag tag1type, ...) throw (FontX, MemoryX);
- TextAttrC &assign(const TextAttrC &) throw (FontX, MemoryX);
- private:
- TextFontC fontlock;
- };
-
- #endif
-