home *** CD-ROM | disk | FTP | other *** search
/ Amiga ISO Collection / AmigaUtilCD2.iso / Programming / C / OTL-MC7.DMS / in.adf / classes.lha / Classes / Graphics / text.h
Encoding:
C/C++ Source or Header  |  1995-01-31  |  3.2 KB  |  112 lines

  1. #ifndef CPP_GRAPHICS_TEXT_H
  2. #define CPP_GRAPHICS_TEXT_H
  3.  
  4. // Klassen für Textattribute und Zeichensätze
  5. //
  6. // Autor: Jochen Becher
  7. //
  8. // Historie:
  9. // Version 1.0 am 10. Januar 94
  10.  
  11. #ifndef GRAPHICS_TEXT_H
  12. #include <graphics/text.h>
  13. #endif
  14.  
  15. #ifndef CPP_UTILITY_TAGITEM_H
  16. #include <classes/utility/tagitem.h>
  17. #endif
  18.  
  19. #ifndef CPP_EXEC_SHARE_H
  20. #include <classes/exec/share.h>
  21. #endif
  22.  
  23. #ifndef INCLUDE_TOOLS_STR_H
  24. #include <tools/str.h>
  25. #endif
  26.  
  27. class TextFontC {
  28. public:
  29.     TextFontC() throw (MemoryX);
  30.     TextFontC(const TextFontC &);
  31.     ~TextFontC();
  32.     TextFontC &operator= (const TextFontC &) throw (MemoryX);
  33.     BOOL isOpen() const { return textfont != NULL; };
  34.     struct TextFont *font() const { return textfont; };
  35.     BOOL open(const class TextAttrC &);
  36.     VOID close();
  37. private:
  38.     struct TextFont *textfont;
  39.     ShareManualC opened;
  40. };
  41.  
  42. // *************************************************************
  43.  
  44. class TextAttrC : protected TTextAttr {
  45. public:
  46.     TextAttrC(STRPTR Name, UWORD YSize, UBYTE Style = 0, UBYTE Flags = 0,
  47.         struct TagItem * = NULL) throw (MemoryX);
  48.     TextAttrC(STRPTR Name, UWORD YSize, UBYTE Style, UBYTE Flags,
  49.         Tag tag1type, ...) throw (MemoryX);
  50.     TextAttrC(const struct TextAttr &) throw (MemoryX);
  51.     TextAttrC(const TextAttrC &) throw (MemoryX);
  52.     TextAttrC &operator= (const TextAttrC &) throw (MemoryX);
  53. //    TextAttrC &operator= (const struct TextAttr &) throw (MemoryX);
  54.     struct TextAttr *attr() { return (struct TextAttr *) this; };
  55.     STRPTR name() const { return tta_Name; };
  56.     UWORD ySize() const { return tta_YSize; };
  57.     UBYTE style() const { return tta_Style; };
  58.     UBYTE flags() const { return tta_Flags; };
  59.     virtual TextAttrC &assign(const TextAttrC &) throw (MemoryX);
  60. private:
  61.     TagItemC tags;
  62. protected:
  63.     String fontname;
  64. };
  65.  
  66. class LTextAttrC : public TextAttrC {
  67. public:
  68.     LTextAttrC(STRPTR Name, UWORD YSize, UBYTE Style = 0, UBYTE Flags = 0,
  69.         struct TagItem * = NULL) throw (FontX, MemoryX);
  70.     LTextAttrC(STRPTR Name, UWORD YSize, UBYTE Style, UBYTE Flags,
  71.         Tag tag1type, ...) throw (FontX, MemoryX);
  72.     LTextAttrC(const struct TextAttr &) throw (FontX, MemoryX);
  73.     LTextAttrC(const LTextAttrC &) throw (MemoryX);
  74.     LTextAttrC &operator= (const LTextAttrC &) throw (MemoryX);
  75. //    LTextAttrC &operator= (const struct TextAttr &) throw (FontX, MemoryX);
  76. private:
  77.     TextFontC fontlock;
  78. };
  79.  
  80. class FTextAttrC : public TextAttrC {
  81. public:
  82.     FTextAttrC(STRPTR Name = NULL, UWORD YSize = 0,
  83.         UBYTE Style = 0, UBYTE StyleMask = ~0,
  84.         UBYTE Flags = 0, UBYTE FlagsMask = ~0,
  85.         struct TagItem * = NULL) throw (MemoryX);
  86.     FTextAttrC(STRPTR Name, UWORD YSize,
  87.         UBYTE Style, UBYTE StyleMask, UBYTE Flags, UBYTE FlagsMask,
  88.         Tag tag1type, ...) throw (MemoryX);
  89.     TextAttrC &assign(const TextAttrC &) throw (MemoryX);
  90. private:
  91.     BOOL named;
  92.     BOOL sized;
  93.     UBYTE styleMask;
  94.     UBYTE flagsMask;
  95. };
  96.  
  97. class FLTextAttrC : public FTextAttrC {
  98. public:
  99.     FLTextAttrC(STRPTR Name = NULL, UWORD YSize = 0,
  100.         UBYTE Style = 0, UBYTE StyleMask = ~0,
  101.         UBYTE Flags = 0, UBYTE FlagsMask = ~0,
  102.         struct TagItem * = NULL) throw (FontX, MemoryX);
  103.     FLTextAttrC(STRPTR Name, UWORD YSize,
  104.         UBYTE Style, UBYTE StyleMask, UBYTE Flags, UBYTE FlagsMask,
  105.         Tag tag1type, ...) throw (FontX, MemoryX);
  106.     TextAttrC &assign(const TextAttrC &) throw (FontX, MemoryX);
  107. private:
  108.     TextFontC fontlock;
  109. };
  110.  
  111. #endif
  112.