home *** CD-ROM | disk | FTP | other *** search
/ Skunkware 5 / Skunkware 5.iso / src / Tools / MotifApp / ch12 / Stage.h < prev    next >
Encoding:
C/C++ Source or Header  |  1995-05-03  |  2.0 KB  |  63 lines

  1. ///////////////////////////////////////////////////////////////////////////////
  2. //////////////////////////////////////////////////////////////////////////////
  3. //         This example code is from the book:
  4. //
  5. //           Object-Oriented Programming with C++ and OSF/Motif
  6. //         by
  7. //           Douglas Young
  8. //           Prentice Hall, 1992
  9. //           ISBN 0-13-630252-1    
  10. //
  11. //         Copyright 1991 by Prentice Hall
  12. //         All Rights Reserved
  13. //
  14. //  Permission to use, copy, modify, and distribute this software for 
  15. //  any purpose except publication and without fee is hereby granted, provided 
  16. //  that the above copyright notice appear in all copies of the software.
  17. ///////////////////////////////////////////////////////////////////////////////
  18. //////////////////////////////////////////////////////////////////////////////
  19.  
  20.  
  21. ///////////////////////////////////////////////////////////////
  22. // Stage.h
  23. ///////////////////////////////////////////////////////////////
  24. #ifndef STAGE_H
  25. #define STAGE_H
  26. #include "UIComponent.h"
  27.  
  28. class Actor;
  29.  
  30. class Stage : public UIComponent {
  31.     
  32.   private:
  33.     
  34.     static void resizeCallback ( Widget, XtPointer, XtPointer );
  35.     static void redisplayCallback ( Widget, XtPointer, XtPointer );
  36.     
  37.   protected:
  38.     
  39.     GC          _gc;               // Used to clear and copy pixmaps
  40.     Dimension   _width, _height;   // Current window/buffer size.
  41.     Pixmap      _front, _back;     // Buffers. Always draw to _back
  42.     
  43.     virtual void resize();
  44.     virtual void redisplay();
  45.     virtual void swapBuffers();
  46.     
  47.     int     _nActors;    // Number of Actors on the Stage
  48.     Actor **_cast;       // List of Actor objects on the Stage
  49.     
  50.   public:
  51.     
  52.     Stage ( Widget, char * );    
  53.     ~Stage ();    
  54.     
  55.     virtual void nextFrame();   // Move all actors to the next frame
  56.     
  57.     void addActor ( Actor * );       
  58.     void removeActor ( Actor * );
  59.     
  60.     virtual const char *const className() { return ( "Stage" ); }
  61. };
  62. #endif
  63.