1 /////////////////////////////////////////////////////////////////////////////
2 // Name:        contrib/samples/ogl/studio/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 37440 2006-02-10 11:59:52Z ABX $
8 // Copyright:   (c) Julian Smart
9 // Licence:     wxWindows licence
10 /////////////////////////////////////////////////////////////////////////////
11 
12 #ifndef _STUDIO_SYMBOLS_H_
13 #define _STUDIO_SYMBOLS_H_
14 
15 #include "wx/docview.h"
16 #include "wx/string.h"
17 
18 #include "wx/ogl/ogl.h" // base header of OGL, includes and adjusts wx/deprecated/setup.h
19 
20 /*
21  * csSymbol
22  * Represents information about a symbol.
23  */
24 
25 class csSymbol: public wxObject
26 {
27 public:
28     csSymbol(const wxString& name, wxShape* shape);
29     ~csSymbol();
30 
SetName(const wxString & name)31     inline void SetName(const wxString& name) { m_name = name; }
GetName()32     inline wxString GetName() const { return m_name; }
33 
SetShape(wxShape * shape)34     inline void SetShape(wxShape* shape) { m_shape = shape; }
GetShape()35     inline wxShape* GetShape() const { return m_shape; }
36 
SetToolId(int id)37     inline void SetToolId(int id) { m_toolId = id; }
GetToolId()38     inline int GetToolId() const { return m_toolId; }
39 protected:
40     wxString    m_name;
41     wxShape*    m_shape;
42     int         m_toolId;
43 };
44 
45 /*
46  * A table of all possible shapes.
47  * We can use this to construct a palette, etc.
48  */
49 class csSymbolDatabase: public wxObject
50 {
51 public:
52     csSymbolDatabase();
53     ~csSymbolDatabase();
54 
55 // Accessors
GetSymbols()56     inline wxList& GetSymbols() const { return (wxList&) m_symbols; }
57 
58 // Operations
59     void AddSymbol(csSymbol* symbol);
60     void ClearSymbols();
61     csSymbol* FindSymbol(const wxString& name) const;
62     csSymbol* FindSymbol(int toolId) const;
63     wxBitmap* CreateToolBitmap(csSymbol* symbol, const wxSize& sz);
64 
65 protected:
66     wxList          m_symbols;
67     int             m_currentId;
68 };
69 
70 #endif
71   // _STUDIO_SYMBOLS_H_
72