home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 10 Tools / 10-Tools.zip / wxos2240.zip / wxWindows-2.4.0 / contrib / samples / ogl / studio / symbols.h < prev    next >
C/C++ Source or Header  |  2002-09-07  |  2KB  |  77 lines

  1. /////////////////////////////////////////////////////////////////////////////
  2. // Name:        symbols.h
  3. // Purpose:     Symbol classes (symbol database)
  4. // Author:      Julian Smart
  5. // Modified by:
  6. // Created:     12/07/98
  7. // RCS-ID:      $Id: symbols.h,v 1.3 2002/09/07 12:12:22 GD Exp $
  8. // Copyright:   (c) Julian Smart
  9. // Licence:
  10. /////////////////////////////////////////////////////////////////////////////
  11.  
  12. #ifndef _STUDIO_SYMBOLS_H_
  13. #define _STUDIO_SYMBOLS_H_
  14.  
  15. #if defined(__GNUG__) && !defined(__APPLE__)
  16. // #pragma interface
  17. #endif
  18.  
  19. #include <wx/docview.h>
  20. #include <wx/string.h>
  21. #include <wx/wxexpr.h>
  22.  
  23. #include <wx/ogl/ogl.h>
  24.  
  25. /*
  26.  * csSymbol
  27.  * Represents information about a symbol.
  28.  */
  29.  
  30. class csSymbol: public wxObject
  31. {
  32. public:
  33.     csSymbol(const wxString& name, wxShape* shape);
  34.     ~csSymbol();
  35.  
  36.     inline void SetName(const wxString& name) { m_name = name; }
  37.     inline wxString GetName() const { return m_name; }
  38.  
  39.     inline void SetShape(wxShape* shape) { m_shape = shape; }
  40.     inline wxShape* GetShape() const { return m_shape; }
  41.  
  42.     inline void SetToolId(int id) { m_toolId = id; }
  43.     inline int GetToolId() const { return m_toolId; }
  44. protected:
  45.     wxString    m_name;
  46.     wxShape*    m_shape;
  47.     int         m_toolId;
  48. };
  49.  
  50. /*
  51.  * A table of all possible shapes.
  52.  * We can use this to construct a palette, etc.
  53.  */
  54. class csSymbolDatabase: public wxObject
  55. {
  56. public:
  57.     csSymbolDatabase();
  58.     ~csSymbolDatabase();
  59.  
  60. // Accessors
  61.     inline wxList& GetSymbols() const { return (wxList&) m_symbols; }
  62.  
  63. // Operations
  64.     void AddSymbol(csSymbol* symbol);
  65.     void ClearSymbols();
  66.     csSymbol* FindSymbol(const wxString& name) const;
  67.     csSymbol* FindSymbol(int toolId) const;
  68.     wxBitmap* CreateToolBitmap(csSymbol* symbol, const wxSize& sz);
  69.  
  70. protected:
  71.     wxList          m_symbols;
  72.     int             m_currentId;
  73. };
  74.  
  75. #endif
  76.   // _STUDIO_SYMBOLS_H_
  77.