wxArt2D
id.cpp
Go to the documentation of this file.
1 /*! \file general/src/id.cpp
2  \author Michael Sögtrop
3  \date Created 12/12/2003
4 
5  Copyright: 2003-2004 (c) Michael Sögtrop
6 
7  Licence: wxWidgets Licence
8 
9  RCS-ID: $Id: id.cpp,v 1.47 2008/09/05 19:01:13 titato Exp $
10 */
11 
12 #include "wxartbaseprec.h"
13 
14 #ifdef __BORLANDC__
15 #pragma hdrstop
16 #endif
17 
18 #include <wx/filename.h>
19 #include "wx/general/smrtptr.h"
20 
21 #include "wx/general/id.h"
22 
23 #include "wx/general/gen.h"
24 #include "wx/general/smrtptr.inl"
25 //#include "wx/general/id.inl"
26 
27 // explicit tamplate instantiations
28 
29 #if (__GNUC__ < 3 || (__GNUC__ == 3 && __GNUC_MINOR__ < 4))
30 
31 // MSVC warning 4660 is quite stupid. It says that the template is already instantiated
32 // by using it, but it is not fully instantiated as required for a library
33 #pragma warning(disable: 4660)
34 
35 #if defined(WXDOCVIEW_USINGDLL)
36 template class A2DGENERALDLLEXP a2dSmrtPtr<a2dObject>;
37 template class A2DGENERALDLLEXP a2dAutoZeroPtr<a2dObject>;
38 template class A2DGENERALDLLEXP a2dPropertyIdTyped<wxInt16, a2dInt16Property> ;
39 template class A2DGENERALDLLEXP a2dPropertyIdTyped<wxInt32, a2dInt32Property> ;
40 template class A2DGENERALDLLEXP a2dPropertyIdTyped<wxUint16, a2dUint16Property> ;
41 template class A2DGENERALDLLEXP a2dPropertyIdTyped<wxUint32, a2dUint32Property> ;
42 template class A2DGENERALDLLEXP a2dPropertyIdTyped<bool, a2dBoolProperty> ;
43 template class A2DGENERALDLLEXP a2dPropertyIdTyped<double, a2dDoubleProperty> ;
44 template class A2DGENERALDLLEXP a2dPropertyIdTyped<void*, a2dVoidPtrProperty> ;
45 template class A2DGENERALDLLEXP a2dPropertyIdTyped<wxString, a2dStringProperty> ;
46 template class A2DGENERALDLLEXP a2dPropertyIdTyped<wxFileName, a2dFileNameProperty> ;
47 template class A2DGENERALDLLEXP a2dPropertyIdTyped<wxColour, a2dColourProperty> ;
48 template class A2DGENERALDLLEXP a2dPropertyIdTyped<wxArrayString, a2dArrayStringProperty>;
49 template class A2DGENERALDLLEXP a2dPropertyIdTyped<a2dSmrtPtr<a2dObject>, a2dProperty>;
51 
52 template class A2DGENERALDLLEXP a2dPropertyIdTyped<wxInt16, a2dInt16Property> ;
53 template class A2DGENERALDLLEXP a2dPropertyIdTyped<wxInt32, a2dInt32Property> ;
54 template class A2DGENERALDLLEXP a2dPropertyIdTyped<wxUint16, a2dUint16Property> ;
55 template class A2DGENERALDLLEXP a2dPropertyIdTyped<wxUint32, a2dUint32Property> ;
56 template class A2DGENERALDLLEXP a2dPropertyIdTyped<bool, a2dBoolProperty> ;
57 template class A2DGENERALDLLEXP a2dPropertyIdTyped<double, a2dDoubleProperty> ;
58 template class A2DGENERALDLLEXP a2dPropertyIdTyped<void*, a2dVoidPtrProperty> ;
59 template class A2DGENERALDLLEXP a2dPropertyIdTyped<wxString, a2dStringProperty> ;
60 template class A2DGENERALDLLEXP a2dPropertyIdTyped<wxFileName, a2dFileNameProperty> ;
61 template class A2DGENERALDLLEXP a2dPropertyIdTyped<wxColour, a2dColourProperty> ;
62 template class A2DGENERALDLLEXP a2dPropertyIdTyped<wxArrayString, a2dArrayStringProperty>;
63 #endif
64 
65 #pragma warning(default: 4660)
66 
67 #endif // (__GNUC__ < 3 || (__GNUC__ == 3 && __GNUC_MINOR__ < 4))
68 
69 #include "wx/general/gen.h"
70 
71 
72 a2dPropertyId::a2dPropertyId( const wxString& name, Flags flag )
73 {
74  // here a memory leak detection on static property id's is a good place
75  //_CrtSetBreakAlloc(348057);
76 
77  m_refcount = 0;
78  m_name = name;
79  m_flags = flag;
80 }
81 
83 {
84  m_refcount = 0;
85 }
86 
88 {
89  obj->RemoveProperty( this, true );
90 }
91 
93 {
94 }
95 
96 
97 
98 
(In) Visible property that can be added to Docview Objects.
Definition: gen.h:1785
fundamental classes used by all other modules.
property to hold a a2dObject pointer type variable to be associated with a a2dObject ...
Definition: gen.h:2250
Ref Counted base object.
Definition: gen.h:1045
Flags
Flags for property ids.
Definition: id.h:158
virtual void SetNamedPropertyToObject(a2dObject *obj, a2dNamedProperty *nprop, SetFlags setflags=set_none) const
Set the property in obj to value (not cloning value)
Definition: id.cpp:92
a2dPropertyId()
this constructor is only for property ids referencing other property ids
Definition: id.cpp:82
see wx/general/smrtptr.h
property to hold a a2dObjectPtr smart pointer type variable to be associated with a a2dObject ...
Definition: gen.h:2199
Id based property system with its base a2dPropertyId.
SetFlags
Flags used for manipulating the way a property is set to a2dObject.
Definition: id.h:219
void RemovePropertyFromObject(a2dObject *obj) const
Dynamic properties with this id will be removed from the object.
Definition: id.cpp:87
smart pointer class and list.
virtual bool RemoveProperty(const a2dPropertyId *id, bool all=true)
This function is called by a2dPropertyId to remove a property from the list.
Definition: gen.cpp:1573
This template class is for property ids with a known data type.
Definition: id.h:477
id.cpp Source File -- Sun Oct 12 2014 17:04:21 -- Sun Oct 12 2014 -- 1.8.5 -- wxArt2D -- . -- Main Page Reference Documentation