home *** CD-ROM | disk | FTP | other *** search
/ Amiga ISO Collection / AmigaUtilCD2.iso / Programming / C / OTL-MC7.DMS / in.adf / classes.lha / Classes / Intuition / Screen.h < prev    next >
Encoding:
C/C++ Source or Header  |  1995-01-31  |  2.4 KB  |  105 lines

  1. #ifndef CPP_INTUITION_SCREEN_H
  2. #define CPP_INTUITION_SCREEN_H
  3.  
  4. // Screen Klassen
  5. //
  6. // Autor: Jochen Becher
  7. //
  8. // Historie:
  9. // Version 1.0, am 9. Januar 94
  10.  
  11. #ifndef CPP_UTILITY_TAGITEM_H
  12. #include <classes/utility/tagitem.h>
  13. #endif
  14.  
  15. #ifndef INTUITION_SCREENS_H
  16. #include <intuition/screens.h>
  17. #endif
  18.  
  19. #ifndef CPP_DATASTRUCTURES_GENARRAYLIST_H
  20. #include <classes/DataStructures/GenArraylist.h>
  21. #endif
  22.  
  23. #ifndef INCLUDE_TOOLS_STR_H
  24. #include <tools/str.h>
  25. #endif
  26.  
  27. class ScreenC {
  28. friend class PublicScreenC;
  29. public:
  30.     ScreenC(Tag tag1Type, ...) throw (MemoryX);
  31.     ScreenC(struct TagItem *tags = NULL) throw (MemoryX);
  32.     ScreenC(const ScreenC &);
  33.     ~ScreenC();
  34.     ScreenC &operator= (const ScreenC &);
  35.     BOOL isOpen() const { return screen_ob != NULL; };
  36.     struct Screen *screen() const { return screen_ob; };
  37.     virtual VOID open(Tag tag1Type, ...) throw (ScreenX, MemoryX)
  38.         { open((struct TagItem *) &tag1Type); };
  39.     virtual VOID open(struct TagItem *taglist = NULL) throw (ScreenX, MemoryX);
  40.     virtual BOOL close();
  41.     VOID toFront();
  42.     VOID toBack();
  43.     VOID move(WORD dx, WORD dy);
  44.     VOID beep(BOOL all = FALSE);
  45.     VOID showTitle(BOOL infront = TRUE);
  46. private:
  47.     struct Screen *screen_ob;
  48.     TagItemC inittags;
  49. };
  50.  
  51. class PublicScreenC : public ScreenC {
  52. public:
  53.     PublicScreenC(STRPTR name = NULL) throw (MemoryX);
  54.     ~PublicScreenC();
  55.     VOID open(struct TagItem *tagList = NULL) throw (ScreenX, MemoryX);
  56.     BOOL close();
  57.     virtual BOOL lock(STRPTR name = NULL);
  58.     virtual VOID unlock();
  59.     STRPTR name() { return pubname; };
  60. private:
  61.     STRPTR pubname;
  62. };
  63.  
  64. class DrawInfoC {
  65. public:
  66.     DrawInfoC();
  67.     DrawInfoC(ScreenC &) throw (ScreenDrawInfoX);
  68.     ~DrawInfoC();
  69.     BOOL isValid() const { return di != NULL; };
  70.     struct DrawInfo *info() const { return di; };
  71.     struct DrawInfo *getInfo(ScreenC &) throw (ScreenDrawInfoX);
  72.     VOID freeInfo();
  73. private:
  74.     struct DrawInfo *di;
  75.     struct Screen *screen;
  76. };
  77.  
  78. class PublicScreenInfoC {
  79. friend class PublicScreenListC;
  80. public:
  81.     PublicScreenInfoC() { };
  82.     STRPTR name() const { return (STRPTR) screenname; };
  83. private:
  84.     String screenname;
  85. };
  86.  
  87. class PublicScreenListC {
  88. friend class PublicScreenCursorC;
  89. public:
  90.     PublicScreenListC() throw (MemoryX);
  91.     VOID update() throw (MemoryX);
  92. private:
  93.     gen_arraylist infos;
  94. };
  95.  
  96. class PublicScreenCursorC : public gen_arraycursor {
  97. public:
  98.     PublicScreenCursorC(PublicScreenListC &l)
  99.         : gen_arraycursor(l.infos) { };
  100.     PublicScreenInfoC &item() throw (MemoryX)
  101.         { return (PublicScreenInfoC &) gen_arraycursor::item(); };
  102. };
  103.  
  104. #endif
  105.