home *** CD-ROM | disk | FTP | other *** search
/ The CDPD Public Domain Collection for CDTV 3 / CDPDIII.bin / pd / programming / c / intuitionpp / ipp / cscreen.h < prev    next >
Encoding:
C/C++ Source or Header  |  1993-04-06  |  2.2 KB  |  95 lines

  1. ///////////////////////////////////////////////////////////////////////////////
  2. ///////////////////////////////////////////////////////////////////////////////
  3. ///////////////////                                        ////////////////////
  4. ///////////////////           file : cscreen.h             ////////////////////
  5. ///////////////////                                        ////////////////////
  6. ///////////////////////////////////////////////////////////////////////////////
  7. ///////////////////////////////////////////////////////////////////////////////
  8. //
  9. //    Class CScreen :
  10. //
  11. //        - Simple screen handling, remember size, position, ... between
  12. //        open and close. You can pass it a NewScreen, ExtNewScreen or
  13. //        NewScreen and TagList structure to its constructor.
  14. //
  15. //        - You can link windows to it so when a window wants to open
  16. //        it asks his address to its screen and opens in it. If the screen
  17. //        is closed, its linked windows open on WorkBench.
  18. //
  19. //        - When a screen is closed and reopened, it remembers which
  20. //        windows was open and tell them to reopen.        
  21.  
  22.  
  23. #ifndef __CSCREEN__
  24. #define __CSCREEN__
  25.  
  26. #include <intuition/screens.h>
  27.  
  28. #include <ipp/cwindow.h>
  29.  
  30.  
  31. class CWNode
  32. {
  33. public:
  34.     CWindow *wn;
  35.     BOOL wasopen;
  36.     CWNode *nextwnode;
  37.  
  38.     CWNode();
  39.     ~CWNode();
  40. };
  41.  
  42.  
  43.  
  44. class CScreen
  45. {
  46. protected:
  47.     friend class CWindow;
  48.  
  49.     BOOL initlibs();
  50.     struct ExtNewScreen *newscr;
  51.     struct Screen *scr;
  52.     CWNode *cwlist;
  53.  
  54.     virtual void update();
  55.     void openwindows();
  56.     void reopenwindows();
  57.     void closewindows();
  58.  
  59. public:
  60.     CScreen();
  61.     CScreen(struct NewScreen *newscreen);
  62.     CScreen(struct ExtNewScreen *extnewscreen);
  63.     CScreen(struct NewScreen *newscreen, struct TagItem *tags);
  64.     ~CScreen();
  65.  
  66.     virtual BOOL open();
  67.     BOOL isopen();
  68.     virtual void close();
  69.     void resize(int sizex, int sizey);
  70.     void setpos(int x, int y);
  71.     void move(int x, int y);
  72.     void tofront();
  73.     void toback();
  74.  
  75.     void setviewmodes(UWORD modes);
  76.     void showtitle(BOOL yesorno);
  77.     void beep();
  78.  
  79.     int leftedge();
  80.     int topedge();
  81.     int width();
  82.     int height();
  83.     int mousex();
  84.     int mousey();
  85.  
  86.     virtual BOOL linkwindow(CWindow& window);
  87.     virtual CWindow *rmwindow(CWindow& window);
  88.     virtual void rmwindows();
  89.     void openallwindows();
  90.     void closeallwindows();
  91. };
  92.  
  93.  
  94. #endif //__CSCREEN__
  95.