00001
00012 #ifndef _IFM_DEFS_H_
00013 #define _IFM_DEFS_H_
00014
00015 #include <wx/hashmap.h>
00016 #include <wx/dynarray.h>
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031
00032 #define IFM_USE_WX_RTTI 1
00033
00034
00035
00036
00037 #if IFM_USE_WX_RTTI
00038 #define IFM_GET_EXTENSION_DATA(c, d) (wxDynamicCast((c)->GetExtensionData(d::DataKey()), d))
00039 #else
00040 #define IFM_GET_EXTENSION_DATA(c, d) (dynamic_cast<d*>((c)->GetExtensionData(d::DataKey())))
00041 #endif
00042
00043
00044
00045
00046 class wxIFMInterfacePluginBase;
00047 class wxIFMExtensionPluginBase;
00048 class wxIFMPluginEvent;
00049 class wxInterfaceManager;
00050 class wxIFMExtensionDataBase;
00051 class wxIFMFloatingData;
00052 class wxIFMComponent;
00053 class wxIFMChildDataBase;
00054 class wxIFMFloatingWindowBase;
00055
00056 #ifdef _MSC_VER // shut up msvc
00057 #pragma warning(disable:4284)
00058 #pragma warning(disable:4100)
00059 #pragma warning(disable:4018)
00060 #pragma warning(disable:4245)
00061 #endif
00062
00063
00064
00065 WX_DEFINE_ARRAY(wxIFMInterfacePluginBase*, wxIFMInterfacePluginArray);
00066 WX_DEFINE_ARRAY(wxIFMComponent*, wxIFMComponentArray);
00067 WX_DEFINE_ARRAY(wxIFMFloatingWindowBase*, wxIFMFloatingWindowArray);
00068
00069
00070
00071
00072 typedef int wxIFMComponentDataKeyType;
00073
00074 WX_DECLARE_HASH_MAP(wxIFMComponentDataKeyType, wxIFMExtensionDataBase*, wxIntegerHash, wxIntegerEqual, wxIFMComponentDataMap);
00075 #define DECLARE_IFM_DATA_KEY(name) extern const wxIFMComponentDataKeyType name;
00076 #define DEFINE_IFM_DATA_KEY(name) const wxIFMComponentDataKeyType name = GetNewDataKey();
00077
00078
00079
00080
00081 #define DECLARE_IFM_COMPONENT_TYPE(name) extern const int name;
00082 #define DEFINE_IFM_COMPONENT_TYPE(name) const int name = GetNewComponentType();
00083 #define IFM_COMPONENT_UNDEFINED 0 // uninitialized component (error!)
00084 #define IFM_COMPONENT_FLOATING_ROOT -1
00085
00086
00087
00088
00089 class wxWindow;
00090
00091 WX_DECLARE_HASH_MAP(unsigned int, wxIFMComponent*, wxIntegerHash, wxIntegerEqual, wxIFMChildWindowMap);
00092 #define DECLARE_IFM_CHILD_TYPE(name) extern const int name;
00093 #define DEFINE_IFM_CHILD_TYPE(name) const int name = GetNewChildType();
00094 #define IFM_CHILDTYPE_UNDEFINED 0 // don't know (error!)
00095 DECLARE_IFM_CHILD_TYPE(IFM_CHILD_GENERIC)
00096 DECLARE_IFM_CHILD_TYPE(IFM_CHILD_TOOLBAR)
00097
00098 #define IFM_COORDS_ABSOLUTE 1
00099 #define IFM_COORDS_BACKGROUND 2
00101 #define IFM_COORDS_CLIENT 3
00103 #define IFM_COORDS_FLOATINGWINDOW 4
00104
00105 #define IFM_ALIGN_NONE 0
00106 #define IFM_ALIGN_HORIZONTAL 1
00107 #define IFM_ALIGN_VERTICAL 2
00108
00109
00110
00111
00112 #define IFM_NO_RESIZE_UPDATE 0x00000001
00113 #define IFM_DEFAULT_FLAGS 0
00114
00115 #define IFM_DISABLE_STATUS_MESSAGES -1
00116 #define IFM_USE_CURRENT_VALUE -1
00117 #define IFM_NO_MAXIMUM -2
00118 #define IFM_NO_MINIMUM -3
00119 #define IFM_NO_MAXIMUM_SIZE wxSize(IFM_NO_MAXIMUM,IFM_NO_MAXIMUM)
00120 #define IFM_NO_MINIMUM_SIZE wxSize(IFM_NO_MINIMUM,IFM_NO_MINIMUM)
00121 #define IFM_USE_CHILD_MINSIZE wxSize(-2,-2)
00122 #define IFM_USE_CURRENT_SIZE wxSize(IFM_USE_CURRENT_VALUE,IFM_USE_CURRENT_VALUE)
00123 #define IFM_DEFAULT_INDEX -1
00124 #define IFM_DEFAULT_POS wxPoint(-1, -1)
00125 #define IFM_DEFAULT_SIZE wxSize(100, 100)
00126 #define IFM_DEFAULT_RECT wxRect(IFM_DEFAULT_POS, wxSize(-1,-1))
00127 #define IFM_INTERFACE_ACTIVE -1
00128 #define IFM_INTERFACE_ALL -2
00129 #define IFM_DEFAULT_COMPONENT_NAME wxT("")
00130
00131
00132 #if defined(__WXMSW__) || defined(__WXGTK__)
00133 # define IFM_CANFLOAT 1
00134 #else
00135 # define IFM_CANFLOAT 0
00136 #endif
00137
00138 class wxIFMDimensions;
00139
00143 class wxIFMDimensions
00144 {
00145 public:
00146 int top, bottom, left, right;
00147
00148 wxIFMDimensions()
00149 {
00150 top =
00151 bottom =
00152 left =
00153 right = 0;
00154 }
00155
00160 void Set(int i)
00161 {
00162 top =
00163 left =
00164 right =
00165 bottom = i;
00166 }
00167
00168 wxIFMDimensions &operator =(const wxIFMDimensions &rect)
00169 {
00170 top = rect.top;
00171 bottom = rect.bottom;
00172 left = rect.left;
00173 right = rect.right;
00174 return *this;
00175 }
00176 };
00177
00178 typedef wxIFMDimensions wxIFMBorders;
00179 typedef wxIFMDimensions wxIFMMargins;
00180
00181 #define IFM_BORDER_Y 4
00182
00183 #endif // _IFM_DEFS_H_