home *** CD-ROM | disk | FTP | other *** search
/ Dream 52 / Amiga_Dream_52.iso / Linux / Divers / freedraft.tar.gz / freedraft.tar / FREEdraft-050298 / CORE / canvasregister.h < prev    next >
C/C++ Source or Header  |  1998-04-29  |  2KB  |  68 lines

  1. // canvasregister.h
  2.  
  3. // Copyright (C) 1997  Cliff Johnson                                       //
  4. //                                                                         //
  5. // This program is free software; you can redistribute it and/or           //
  6. // modify it under the terms of the GNU  General Public                    //
  7. // License as published by the Free Software Foundation; either            //
  8. // version 2 of the License, or (at your option) any later version.        //
  9. //                                                                         //
  10. // This software is distributed in the hope that it will be useful,        //
  11. // but WITHOUT ANY WARRANTY; without even the implied warranty of          //
  12. // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU       //
  13. // General Public License for more details.                                //
  14. //                                                                         //
  15. // You should have received a copy of the GNU General Public License       //
  16. // along with this software (see COPYING); if not, write to the        //
  17. // Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. //
  18.  
  19. #ifndef CANVASREGISTER_H
  20. #define CANVASREGISTER_H
  21.  
  22. //++++++++++++++++++++++++ CanvasRegister +++++++++++++++++++++
  23.  
  24. #include <list.h>        //HASA
  25. #include <registeredentity.h>    //ITO
  26.  
  27. class Attributes;
  28. class Handle;
  29. class DrawableGeom;
  30. class CoreException;
  31.  
  32. class CanvasRegister
  33.  
  34. {
  35. private:
  36.     list<RegisteredEntity> entityRegister;
  37.     
  38.     list<RegisteredEntity>::iterator ix;
  39.  
  40. public:
  41. // data services
  42.     // Add to viewer, For example: 
  43.     // window.Register(handle,Attributes(RED,SOLID),TRUE,drawable);
  44.     void Register(const Handle& h,
  45.             const Attributes& a,
  46.             const DrawableGeom* d,
  47.             bool v = true,
  48.             bool hl = false);
  49.  
  50.     // remove from viewer
  51.     void UnRegister(const Handle& h);
  52.  
  53.     // set new attributes
  54.     void SetAttributes(const Handle& h, const Attributes& a);
  55.     void SetVisible(const Handle& h, bool v);
  56.     void SetAllVisible(bool v);
  57.     void SwapVisible();
  58.     void SetHighlight(const Handle& h, bool hl);
  59.     void SetAllHighlights(bool);
  60.  
  61.     void Init();    // start reading the list -> return first item
  62.     bool NextItem(RegisteredEntity &); // get the next item in the list-return false when done.
  63.     Handle GetHandleFromName(unsigned int) const throw(CoreException);
  64.     Attributes  GetAttributes(const Handle&) const throw(CoreException);
  65. };
  66.  
  67. #endif
  68.