repo_name
stringclasses
10 values
file_path
stringlengths
29
222
content
stringlengths
24
926k
extention
stringclasses
5 values
rticonnextdds-usecases
data/projects/rticonnextdds-usecases/VehicleTracking/ExampleCode/thirdparty/wxWidgets-3.1.2/Linux/include/wx/helpbase.h
///////////////////////////////////////////////////////////////////////////// // Name: wx/helpbase.h // Purpose: Help system base classes // Author: Julian Smart // Modified by: // Created: 04/01/98 // Copyright: (c) Julian Smart // Licence: wxWindows licence ///////////////////////////////////////////////////////////////////////////// #ifndef _WX_HELPBASEH__ #define _WX_HELPBASEH__ #include "wx/defs.h" #if wxUSE_HELP #include "wx/object.h" #include "wx/string.h" #include "wx/gdicmn.h" #include "wx/frame.h" // Flags for SetViewer #define wxHELP_NETSCAPE 1 // Search modes: enum wxHelpSearchMode { wxHELP_SEARCH_INDEX, wxHELP_SEARCH_ALL }; // Defines the API for help controllers class WXDLLIMPEXP_CORE wxHelpControllerBase: public wxObject { public: inline wxHelpControllerBase(wxWindow* parentWindow = NULL) { m_parentWindow = parentWindow; } inline ~wxHelpControllerBase() {} // Must call this to set the filename and server name. // server is only required when implementing TCP/IP-based // help controllers. virtual bool Initialize(const wxString& WXUNUSED(file), int WXUNUSED(server) ) { return false; } virtual bool Initialize(const wxString& WXUNUSED(file)) { return false; } // Set viewer: only relevant to some kinds of controller virtual void SetViewer(const wxString& WXUNUSED(viewer), long WXUNUSED(flags) = 0) {} // If file is "", reloads file given in Initialize virtual bool LoadFile(const wxString& file = wxEmptyString) = 0; // Displays the contents virtual bool DisplayContents(void) = 0; // Display the given section virtual bool DisplaySection(int sectionNo) = 0; // Display the section using a context id virtual bool DisplayContextPopup(int WXUNUSED(contextId)) { return false; } // Display the text in a popup, if possible virtual bool DisplayTextPopup(const wxString& WXUNUSED(text), const wxPoint& WXUNUSED(pos)) { return false; } // By default, uses KeywordSection to display a topic. Implementations // may override this for more specific behaviour. virtual bool DisplaySection(const wxString& section) { return KeywordSearch(section); } virtual bool DisplayBlock(long blockNo) = 0; virtual bool KeywordSearch(const wxString& k, wxHelpSearchMode mode = wxHELP_SEARCH_ALL) = 0; /// Allows one to override the default settings for the help frame. virtual void SetFrameParameters(const wxString& WXUNUSED(title), const wxSize& WXUNUSED(size), const wxPoint& WXUNUSED(pos) = wxDefaultPosition, bool WXUNUSED(newFrameEachTime) = false) { // does nothing by default } /// Obtains the latest settings used by the help frame and the help /// frame. virtual wxFrame *GetFrameParameters(wxSize *WXUNUSED(size) = NULL, wxPoint *WXUNUSED(pos) = NULL, bool *WXUNUSED(newFrameEachTime) = NULL) { return NULL; // does nothing by default } virtual bool Quit() = 0; virtual void OnQuit() {} /// Set the window that can optionally be used for the help window's parent. virtual void SetParentWindow(wxWindow* win) { m_parentWindow = win; } /// Get the window that can optionally be used for the help window's parent. virtual wxWindow* GetParentWindow() const { return m_parentWindow; } protected: wxWindow* m_parentWindow; private: wxDECLARE_CLASS(wxHelpControllerBase); }; #endif // wxUSE_HELP #endif // _WX_HELPBASEH__
h
rticonnextdds-usecases
data/projects/rticonnextdds-usecases/VehicleTracking/ExampleCode/thirdparty/wxWidgets-3.1.2/Linux/include/wx/statline.h
///////////////////////////////////////////////////////////////////////////// // Name: wx/statline.h // Purpose: wxStaticLine class interface // Author: Vadim Zeitlin // Created: 28.06.99 // Copyright: (c) 1999 Vadim Zeitlin // Licence: wxWindows licence ///////////////////////////////////////////////////////////////////////////// #ifndef _WX_STATLINE_H_BASE_ #define _WX_STATLINE_H_BASE_ // ---------------------------------------------------------------------------- // headers // ---------------------------------------------------------------------------- // this defines wxUSE_STATLINE #include "wx/defs.h" #if wxUSE_STATLINE // the base class declaration #include "wx/control.h" // ---------------------------------------------------------------------------- // global variables // ---------------------------------------------------------------------------- // the default name for objects of class wxStaticLine extern WXDLLIMPEXP_DATA_CORE(const char) wxStaticLineNameStr[]; // ---------------------------------------------------------------------------- // wxStaticLine - a line in a dialog // ---------------------------------------------------------------------------- class WXDLLIMPEXP_CORE wxStaticLineBase : public wxControl { public: // constructor wxStaticLineBase() { } // is the line vertical? bool IsVertical() const { return (GetWindowStyle() & wxLI_VERTICAL) != 0; } // get the default size for the "lesser" dimension of the static line static int GetDefaultSize() { return 2; } // overridden base class virtuals virtual bool AcceptsFocus() const wxOVERRIDE { return false; } protected: // choose the default border for this window virtual wxBorder GetDefaultBorder() const wxOVERRIDE { return wxBORDER_NONE; } // set the right size for the right dimension wxSize AdjustSize(const wxSize& size) const { wxSize sizeReal(size); if ( IsVertical() ) { if ( size.x == wxDefaultCoord ) sizeReal.x = GetDefaultSize(); } else { if ( size.y == wxDefaultCoord ) sizeReal.y = GetDefaultSize(); } return sizeReal; } virtual wxSize DoGetBestSize() const wxOVERRIDE { return AdjustSize(wxDefaultSize); } wxDECLARE_NO_COPY_CLASS(wxStaticLineBase); }; // ---------------------------------------------------------------------------- // now include the actual class declaration // ---------------------------------------------------------------------------- #if defined(__WXUNIVERSAL__) #include "wx/univ/statline.h" #elif defined(__WXMSW__) #include "wx/msw/statline.h" #elif defined(__WXGTK20__) #include "wx/gtk/statline.h" #elif defined(__WXGTK__) #include "wx/gtk1/statline.h" #elif defined(__WXMAC__) #include "wx/osx/statline.h" #elif defined(__WXQT__) #include "wx/qt/statline.h" #else // use generic implementation for all other platforms #include "wx/generic/statline.h" #endif #endif // wxUSE_STATLINE #endif // _WX_STATLINE_H_BASE_
h
rticonnextdds-usecases
data/projects/rticonnextdds-usecases/VehicleTracking/ExampleCode/thirdparty/wxWidgets-3.1.2/Linux/include/wx/persist.h
/////////////////////////////////////////////////////////////////////////////// // Name: wx/persist.h // Purpose: common classes for persistence support // Author: Vadim Zeitlin // Created: 2009-01-18 // Copyright: (c) 2009 Vadim Zeitlin <[email protected]> // Licence: wxWindows licence /////////////////////////////////////////////////////////////////////////////// #ifndef _WX_PERSIST_H_ #define _WX_PERSIST_H_ #include "wx/string.h" #include "wx/hashmap.h" #include "wx/confbase.h" class wxPersistentObject; WX_DECLARE_VOIDPTR_HASH_MAP(wxPersistentObject *, wxPersistentObjectsMap); // ---------------------------------------------------------------------------- // global functions // ---------------------------------------------------------------------------- /* We do _not_ declare this function as doing this would force us to specialize it for the user classes deriving from the standard persistent classes. However we do define overloads of wxCreatePersistentObject() for all the wx classes which means that template wxPersistentObject::Restore() picks up the right overload to use provided that the header defining the correct overload is included before calling it. And a compilation error happens if this is not done. template <class T> wxPersistentObject *wxCreatePersistentObject(T *obj); */ // ---------------------------------------------------------------------------- // wxPersistenceManager: global aspects of persistent windows // ---------------------------------------------------------------------------- class WXDLLIMPEXP_CORE wxPersistenceManager { public: // Call this method to specify a non-default persistence manager to use. // This function should usually be called very early to affect creation of // all persistent controls and the object passed to it must have a lifetime // long enough to be still alive when the persistent controls are destroyed // and need it to save their state so typically this would be a global or a // wxApp member. static void Set(wxPersistenceManager& manager); // accessor to the unique persistence manager object static wxPersistenceManager& Get(); // trivial but virtual dtor virtual ~wxPersistenceManager(); // globally disable restoring or saving the persistent properties (both are // enabled by default) void DisableSaving() { m_doSave = false; } void DisableRestoring() { m_doRestore = false; } // register an object with the manager: when using the first overload, // wxCreatePersistentObject() must be specialized for this object class; // with the second one the persistent adapter is created by the caller // // the object shouldn't be already registered with us template <class T> wxPersistentObject *Register(T *obj) { return Register(obj, wxCreatePersistentObject(obj)); } wxPersistentObject *Register(void *obj, wxPersistentObject *po); // check if the object is registered and return the associated // wxPersistentObject if it is or NULL otherwise wxPersistentObject *Find(void *obj) const; // unregister the object, this is called by wxPersistentObject itself so // there is usually no need to do it explicitly // // deletes the associated wxPersistentObject void Unregister(void *obj); // save/restore the state of an object // // these methods do nothing if DisableSaving/Restoring() was called // // Restore() returns true if the object state was really restored void Save(void *obj); bool Restore(void *obj); // combines both Save() and Unregister() calls void SaveAndUnregister(void *obj) { Save(obj); Unregister(obj); } // combines both Register() and Restore() calls template <class T> bool RegisterAndRestore(T *obj) { return Register(obj) && Restore(obj); } bool RegisterAndRestore(void *obj, wxPersistentObject *po) { return Register(obj, po) && Restore(obj); } // methods used by the persistent objects to save and restore the data // // currently these methods simply use wxConfig::Get() but they may be // overridden in the derived class (once we allow creating custom // persistent managers) #define wxPERSIST_DECLARE_SAVE_RESTORE_FOR(Type) \ virtual bool SaveValue(const wxPersistentObject& who, \ const wxString& name, \ Type value); \ \ virtual bool \ RestoreValue(const wxPersistentObject& who, \ const wxString& name, \ Type *value) wxPERSIST_DECLARE_SAVE_RESTORE_FOR(bool); wxPERSIST_DECLARE_SAVE_RESTORE_FOR(int); wxPERSIST_DECLARE_SAVE_RESTORE_FOR(long); wxPERSIST_DECLARE_SAVE_RESTORE_FOR(wxString); #undef wxPERSIST_DECLARE_SAVE_RESTORE_FOR protected: // ctor is private, use Get() wxPersistenceManager() { m_doSave = m_doRestore = true; } // Return the config object to use, by default just the global one but a // different one could be used by the derived class if needed. virtual wxConfigBase *GetConfig() const { return wxConfigBase::Get(); } // Return the path to use for saving the setting with the given name for // the specified object (notice that the name is the name of the setting, // not the name of the object itself which can be retrieved with GetName()). virtual wxString GetKey(const wxPersistentObject& who, const wxString& name) const; private: // map with the registered objects as keys and associated // wxPersistentObjects as values wxPersistentObjectsMap m_persistentObjects; // true if we should restore/save the settings (it doesn't make much sense // to use this class when both of them are false but setting one of them to // false may make sense in some situations) bool m_doSave, m_doRestore; wxDECLARE_NO_COPY_CLASS(wxPersistenceManager); }; // ---------------------------------------------------------------------------- // wxPersistentObject: ABC for anything persistent // ---------------------------------------------------------------------------- class wxPersistentObject { public: // ctor associates us with the object whose options we save/restore wxPersistentObject(void *obj) : m_obj(obj) { } // trivial but virtual dtor virtual ~wxPersistentObject() { } // methods used by wxPersistenceManager // ------------------------------------ // save/restore the corresponding objects settings // // these methods shouldn't be used directly as they don't respect the // global wxPersistenceManager::DisableSaving/Restoring() settings, use // wxPersistenceManager methods with the same name instead virtual void Save() const = 0; virtual bool Restore() = 0; // get the kind of the objects we correspond to, e.g. "Frame" virtual wxString GetKind() const = 0; // get the name of the object we correspond to, e.g. "Main" virtual wxString GetName() const = 0; // return the associated object void *GetObject() const { return m_obj; } protected: // wrappers for wxPersistenceManager methods which don't require passing // "this" as the first parameter all the time template <typename T> bool SaveValue(const wxString& name, T value) const { return wxPersistenceManager::Get().SaveValue(*this, name, value); } template <typename T> bool RestoreValue(const wxString& name, T *value) { return wxPersistenceManager::Get().RestoreValue(*this, name, value); } private: void * const m_obj; wxDECLARE_NO_COPY_CLASS(wxPersistentObject); }; // Helper function calling RegisterAndRestore() on the global persistence // manager object. template <typename T> inline bool wxPersistentRegisterAndRestore(T *obj) { wxPersistentObject * const pers = wxCreatePersistentObject(obj); return wxPersistenceManager::Get().RegisterAndRestore(obj, pers); } // A helper function which also sets the name for the (wxWindow-derived) object // before registering and restoring it. template <typename T> inline bool wxPersistentRegisterAndRestore(T *obj, const wxString& name) { obj->SetName(name); return wxPersistentRegisterAndRestore(obj); } #endif // _WX_PERSIST_H_
h
rticonnextdds-usecases
data/projects/rticonnextdds-usecases/VehicleTracking/ExampleCode/thirdparty/wxWidgets-3.1.2/Linux/include/wx/fmappriv.h
/////////////////////////////////////////////////////////////////////////////// // Name: wx/fmappriv.h // Purpose: private wxFontMapper stuff, not to be used by the library users // Author: Vadim Zeitlin // Modified by: // Created: 21.06.2003 (extracted from common/fontmap.cpp) // Copyright: (c) 1999-2003 Vadim Zeitlin <[email protected]> // Licence: wxWindows licence /////////////////////////////////////////////////////////////////////////////// #ifndef _WX_FMAPPRIV_H_ #define _WX_FMAPPRIV_H_ // ---------------------------------------------------------------------------- // constants // ---------------------------------------------------------------------------- // a special pseudo encoding which means "don't ask me about this charset // any more" -- we need it to avoid driving the user crazy with asking him // time after time about the same charset which he [presumably] doesn't // have the fonts for enum { wxFONTENCODING_UNKNOWN = -2 }; // the config paths we use #if wxUSE_CONFIG #define FONTMAPPER_ROOT_PATH wxT("/wxWindows/FontMapper") #define FONTMAPPER_CHARSET_PATH wxT("Charsets") #define FONTMAPPER_CHARSET_ALIAS_PATH wxT("Aliases") #endif // wxUSE_CONFIG // ---------------------------------------------------------------------------- // wxFontMapperPathChanger: change the config path during our lifetime // ---------------------------------------------------------------------------- #if wxUSE_CONFIG && wxUSE_FILECONFIG class wxFontMapperPathChanger { public: wxFontMapperPathChanger(wxFontMapperBase *fontMapper, const wxString& path) { m_fontMapper = fontMapper; m_ok = m_fontMapper->ChangePath(path, &m_pathOld); } bool IsOk() const { return m_ok; } ~wxFontMapperPathChanger() { if ( IsOk() ) m_fontMapper->RestorePath(m_pathOld); } private: // the fontmapper object we're working with wxFontMapperBase *m_fontMapper; // the old path to be restored if m_ok wxString m_pathOld; // have we changed the path successfully? bool m_ok; wxDECLARE_NO_COPY_CLASS(wxFontMapperPathChanger); }; #endif // wxUSE_CONFIG #endif // _WX_FMAPPRIV_H_
h
rticonnextdds-usecases
data/projects/rticonnextdds-usecases/VehicleTracking/ExampleCode/thirdparty/wxWidgets-3.1.2/Linux/include/wx/typeinfo.h
/////////////////////////////////////////////////////////////////////////////// // Name: wx/typeinfo.h // Purpose: wxTypeId implementation // Author: Jaakko Salli // Created: 2009-11-19 // Copyright: (c) wxWidgets Team // Licence: wxWindows licence /////////////////////////////////////////////////////////////////////////////// #ifndef _WX_TYPEINFO_H_ #define _WX_TYPEINFO_H_ // // This file defines wxTypeId macro that should be used internally in // wxWidgets instead of typeid(), for compatibility with builds that do // not implement C++ RTTI. Also, type defining macros in this file are // intended for internal use only at this time and may change in future // versions. // // The reason why we need this simple RTTI system in addition to the older // wxObject-based one is that the latter does not work in template // classes. // #include "wx/defs.h" #ifndef wxNO_RTTI // // Let's trust that Visual C++ versions 9.0 and later implement C++ // RTTI well enough, so we can use it and work around harmless memory // leaks reported by the static run-time libraries. // #if wxCHECK_VISUALC_VERSION(9) #define wxTRUST_CPP_RTTI 1 #else #define wxTRUST_CPP_RTTI 0 #endif #include <typeinfo> #include <string.h> #define _WX_DECLARE_TYPEINFO_CUSTOM(CLS, IDENTFUNC) #define WX_DECLARE_TYPEINFO_INLINE(CLS) #define WX_DECLARE_TYPEINFO(CLS) #define WX_DEFINE_TYPEINFO(CLS) #define WX_DECLARE_ABSTRACT_TYPEINFO(CLS) #if wxTRUST_CPP_RTTI #define wxTypeId typeid #else /* !wxTRUST_CPP_RTTI */ // // For improved type-safety, let's make the check using class name // comparison. Most modern compilers already do this, but we cannot // rely on all supported compilers to work this well. However, in // cases where we'd know that typeid() would be flawless (as such), // wxTypeId could of course simply be defined as typeid. // class wxTypeIdentifier { public: wxTypeIdentifier(const char* className) { m_className = className; } bool operator==(const wxTypeIdentifier& other) const { return strcmp(m_className, other.m_className) == 0; } bool operator!=(const wxTypeIdentifier& other) const { return !(*this == other); } private: const char* m_className; }; #define wxTypeId(OBJ) wxTypeIdentifier(typeid(OBJ).name()) #endif /* wxTRUST_CPP_RTTI/!wxTRUST_CPP_RTTI */ #else // if !wxNO_RTTI #define wxTRUST_CPP_RTTI 0 // // When C++ RTTI is not available, we will have to make the type comparison // using pointer to a dummy static member function. This will fail if // declared type is used across DLL boundaries, although using // WX_DECLARE_TYPEINFO() and WX_DEFINE_TYPEINFO() pair instead of // WX_DECLARE_TYPEINFO_INLINE() should fix this. However, that approach is // usually not possible when type info needs to be declared for a template // class. // typedef void (*wxTypeIdentifier)(); // Use this macro to declare type info with specified static function // IDENTFUNC used as type identifier. Usually you should only use // WX_DECLARE_TYPEINFO() or WX_DECLARE_TYPEINFO_INLINE() however. #define _WX_DECLARE_TYPEINFO_CUSTOM(CLS, IDENTFUNC) \ public: \ virtual wxTypeIdentifier GetWxTypeId() const \ { \ return reinterpret_cast<wxTypeIdentifier> \ (&IDENTFUNC); \ } // Use this macro to declare type info with externally specified // type identifier, defined with WX_DEFINE_TYPEINFO(). #define WX_DECLARE_TYPEINFO(CLS) \ private: \ static CLS sm_wxClassInfo(); \ _WX_DECLARE_TYPEINFO_CUSTOM(CLS, sm_wxClassInfo) // Use this macro to implement type identifier function required by // WX_DECLARE_TYPEINFO(). // NOTE: CLS is required to have default ctor. If it doesn't // already, you should provide a private dummy one. #define WX_DEFINE_TYPEINFO(CLS) \ CLS CLS::sm_wxClassInfo() { return CLS(); } // Use this macro to declare type info fully inline in class. // NOTE: CLS is required to have default ctor. If it doesn't // already, you should provide a private dummy one. #define WX_DECLARE_TYPEINFO_INLINE(CLS) \ private: \ static CLS sm_wxClassInfo() { return CLS(); } \ _WX_DECLARE_TYPEINFO_CUSTOM(CLS, sm_wxClassInfo) #define wxTypeId(OBJ) (OBJ).GetWxTypeId() // Because abstract classes cannot be instantiated, we use // this macro to define pure virtual type interface for them. #define WX_DECLARE_ABSTRACT_TYPEINFO(CLS) \ public: \ virtual wxTypeIdentifier GetWxTypeId() const = 0; #endif // wxNO_RTTI/!wxNO_RTTI #endif // _WX_TYPEINFO_H_
h
rticonnextdds-usecases
data/projects/rticonnextdds-usecases/VehicleTracking/ExampleCode/thirdparty/wxWidgets-3.1.2/Linux/include/wx/dvrenderers.h
/////////////////////////////////////////////////////////////////////////////// // Name: wx/dvrenderers.h // Purpose: Declare all wxDataViewCtrl classes // Author: Robert Roebling, Vadim Zeitlin // Created: 2009-11-08 (extracted from wx/dataview.h) // Copyright: (c) 2006 Robert Roebling // (c) 2009 Vadim Zeitlin <[email protected]> // Licence: wxWindows licence /////////////////////////////////////////////////////////////////////////////// #ifndef _WX_DVRENDERERS_H_ #define _WX_DVRENDERERS_H_ /* Note about the structure of various headers: they're organized in a more complicated way than usual because of the various dependencies which are different for different ports. In any case the only public header, i.e. the one which can be included directly is wx/dataview.h. It, in turn, includes this one to define all the renderer classes. We define the base wxDataViewRendererBase class first and then include a port-dependent wx/xxx/dvrenderer.h which defines wxDataViewRenderer itself. After this we can define wxDataViewRendererCustomBase (and maybe in the future base classes for other renderers if the need arises, i.e. if there is any non-trivial code or API which it makes sense to keep in common code) and include wx/xxx/dvrenderers.h (notice the plural) which defines all the rest of the renderer classes. */ class WXDLLIMPEXP_FWD_CORE wxDataViewCustomRenderer; // ---------------------------------------------------------------------------- // wxDataViewIconText: helper class used by wxDataViewIconTextRenderer // ---------------------------------------------------------------------------- class WXDLLIMPEXP_CORE wxDataViewIconText : public wxObject { public: wxDataViewIconText( const wxString &text = wxEmptyString, const wxIcon& icon = wxNullIcon ) : m_text(text), m_icon(icon) { } wxDataViewIconText( const wxDataViewIconText &other ) : wxObject(), m_text(other.m_text), m_icon(other.m_icon) { } void SetText( const wxString &text ) { m_text = text; } wxString GetText() const { return m_text; } void SetIcon( const wxIcon &icon ) { m_icon = icon; } const wxIcon &GetIcon() const { return m_icon; } bool IsSameAs(const wxDataViewIconText& other) const { return m_text == other.m_text && m_icon.IsSameAs(other.m_icon); } bool operator==(const wxDataViewIconText& other) const { return IsSameAs(other); } bool operator!=(const wxDataViewIconText& other) const { return !IsSameAs(other); } private: wxString m_text; wxIcon m_icon; wxDECLARE_DYNAMIC_CLASS(wxDataViewIconText); }; DECLARE_VARIANT_OBJECT_EXPORTED(wxDataViewIconText, WXDLLIMPEXP_CORE) // ---------------------------------------------------------------------------- // wxDataViewCheckIconText: value class used by wxDataViewCheckIconTextRenderer // ---------------------------------------------------------------------------- class WXDLLIMPEXP_CORE wxDataViewCheckIconText : public wxDataViewIconText { public: wxDataViewCheckIconText(const wxString& text = wxString(), const wxIcon& icon = wxNullIcon, wxCheckBoxState checkedState = wxCHK_UNDETERMINED) : wxDataViewIconText(text, icon), m_checkedState(checkedState) { } wxCheckBoxState GetCheckedState() const { return m_checkedState; } void SetCheckedState(wxCheckBoxState state) { m_checkedState = state; } private: wxCheckBoxState m_checkedState; wxDECLARE_DYNAMIC_CLASS(wxDataViewCheckIconText); }; DECLARE_VARIANT_OBJECT_EXPORTED(wxDataViewCheckIconText, WXDLLIMPEXP_CORE) // ---------------------------------------------------------------------------- // wxDataViewRendererBase // ---------------------------------------------------------------------------- enum wxDataViewCellMode { wxDATAVIEW_CELL_INERT, wxDATAVIEW_CELL_ACTIVATABLE, wxDATAVIEW_CELL_EDITABLE }; enum wxDataViewCellRenderState { wxDATAVIEW_CELL_SELECTED = 1, wxDATAVIEW_CELL_PRELIT = 2, wxDATAVIEW_CELL_INSENSITIVE = 4, wxDATAVIEW_CELL_FOCUSED = 8 }; // helper for fine-tuning rendering of values depending on row's state class WXDLLIMPEXP_CORE wxDataViewValueAdjuster { public: virtual ~wxDataViewValueAdjuster() {} // changes the value to have appearance suitable for highlighted rows virtual wxVariant MakeHighlighted(const wxVariant& value) const { return value; } }; class WXDLLIMPEXP_CORE wxDataViewRendererBase: public wxObject { public: wxDataViewRendererBase( const wxString &varianttype, wxDataViewCellMode mode = wxDATAVIEW_CELL_INERT, int alignment = wxDVR_DEFAULT_ALIGNMENT ); virtual ~wxDataViewRendererBase(); virtual bool Validate( wxVariant& WXUNUSED(value) ) { return true; } void SetOwner( wxDataViewColumn *owner ) { m_owner = owner; } wxDataViewColumn* GetOwner() const { return m_owner; } // renderer value and attributes: SetValue() and SetAttr() are called // before a cell is rendered using this renderer virtual bool SetValue(const wxVariant& value) = 0; virtual bool GetValue(wxVariant& value) const = 0; #if wxUSE_ACCESSIBILITY virtual wxString GetAccessibleDescription() const = 0; #endif // wxUSE_ACCESSIBILITY wxString GetVariantType() const { return m_variantType; } // Prepare for rendering the value of the corresponding item in the given // column taken from the provided non-null model. // // Notice that the column must be the same as GetOwner()->GetModelColumn(), // it is only passed to this method because the existing code already has // it and should probably be removed in the future. // // Return true if this cell is non-empty or false otherwise (and also if // the model returned a value of the wrong, i.e. different from our // GetVariantType(), type, in which case a debug error is also logged). bool PrepareForItem(const wxDataViewModel *model, const wxDataViewItem& item, unsigned column); // renderer properties: virtual void SetMode( wxDataViewCellMode mode ) = 0; virtual wxDataViewCellMode GetMode() const = 0; // NOTE: Set/GetAlignment do not take/return a wxAlignment enum but // rather an "int"; that's because for rendering cells it's allowed // to combine alignment flags (e.g. wxALIGN_LEFT|wxALIGN_BOTTOM) virtual void SetAlignment( int align ) = 0; virtual int GetAlignment() const = 0; // enable or disable (if called with wxELLIPSIZE_NONE) replacing parts of // the item text (hence this only makes sense for renderers showing // text...) with ellipsis in order to make it fit the column width virtual void EnableEllipsize(wxEllipsizeMode mode = wxELLIPSIZE_MIDDLE) = 0; void DisableEllipsize() { EnableEllipsize(wxELLIPSIZE_NONE); } virtual wxEllipsizeMode GetEllipsizeMode() const = 0; // in-place editing virtual bool HasEditorCtrl() const { return false; } virtual wxWindow* CreateEditorCtrl(wxWindow * WXUNUSED(parent), wxRect WXUNUSED(labelRect), const wxVariant& WXUNUSED(value)) { return NULL; } virtual bool GetValueFromEditorCtrl(wxWindow * WXUNUSED(editor), wxVariant& WXUNUSED(value)) { return false; } virtual bool StartEditing( const wxDataViewItem &item, wxRect labelRect ); virtual void CancelEditing(); virtual bool FinishEditing(); wxWindow *GetEditorCtrl() const { return m_editorCtrl; } virtual bool IsCustomRenderer() const { return false; } // Implementation only from now on. // Return the alignment of this renderer if it's specified (i.e. has value // different from the default wxDVR_DEFAULT_ALIGNMENT) or the alignment of // the column it is used for otherwise. // // Unlike GetAlignment(), this always returns a valid combination of // wxALIGN_XXX flags (although possibly wxALIGN_NOT) and never returns // wxDVR_DEFAULT_ALIGNMENT. int GetEffectiveAlignment() const; // Like GetEffectiveAlignment(), but returns wxDVR_DEFAULT_ALIGNMENT if // the owner isn't set and GetAlignment() is default. int GetEffectiveAlignmentIfKnown() const; // Send wxEVT_DATAVIEW_ITEM_EDITING_STARTED event. void NotifyEditingStarted(const wxDataViewItem& item); // Sets the transformer for fine-tuning rendering of values depending on row's state void SetValueAdjuster(wxDataViewValueAdjuster *transformer) { delete m_valueAdjuster; m_valueAdjuster = transformer; } protected: // These methods are called from PrepareForItem() and should do whatever is // needed for the current platform to ensure that the item is rendered // using the given attributes and enabled/disabled state. virtual void SetAttr(const wxDataViewItemAttr& attr) = 0; virtual void SetEnabled(bool enabled) = 0; // Return whether the currently rendered item is on a highlighted row // (typically selection with dark background). For internal use only. virtual bool IsHighlighted() const = 0; // Helper of PrepareForItem() also used in StartEditing(): returns the // value checking that its type matches our GetVariantType(). wxVariant CheckedGetValue(const wxDataViewModel* model, const wxDataViewItem& item, unsigned column) const; // Validates the given value (if it is non-null) and sends (in any case) // ITEM_EDITING_DONE event and, finally, updates the model with the value // (f it is valid, of course) if the event wasn't vetoed. bool DoHandleEditingDone(wxVariant* value); wxString m_variantType; wxDataViewColumn *m_owner; wxWeakRef<wxWindow> m_editorCtrl; wxDataViewItem m_item; // Item being currently edited, if valid. wxDataViewValueAdjuster *m_valueAdjuster; // internal utility, may be used anywhere the window associated with the // renderer is required wxDataViewCtrl* GetView() const; private: // Called from {Called,Finish}Editing() and dtor to cleanup m_editorCtrl void DestroyEditControl(); wxDECLARE_DYNAMIC_CLASS_NO_COPY(wxDataViewRendererBase); }; // include the real wxDataViewRenderer declaration for the native ports #ifdef wxHAS_GENERIC_DATAVIEWCTRL // in the generic implementation there is no real wxDataViewRenderer, all // renderers are custom so it's the same as wxDataViewCustomRenderer and // wxDataViewCustomRendererBase derives from wxDataViewRendererBase directly // // this is a rather ugly hack but unfortunately it just doesn't seem to be // possible to have the same class hierarchy in all ports and avoid // duplicating the entire wxDataViewCustomRendererBase in the generic // wxDataViewRenderer class (well, we could use a mix-in but this would // make classes hierarchy non linear and arguably even more complex) #define wxDataViewCustomRendererRealBase wxDataViewRendererBase #else #if defined(__WXGTK20__) #include "wx/gtk/dvrenderer.h" #elif defined(__WXMAC__) #include "wx/osx/dvrenderer.h" #elif defined(__WXQT__) #include "wx/qt/dvrenderer.h" #else #error "unknown native wxDataViewCtrl implementation" #endif #define wxDataViewCustomRendererRealBase wxDataViewRenderer #endif // ---------------------------------------------------------------------------- // wxDataViewCustomRendererBase // ---------------------------------------------------------------------------- class WXDLLIMPEXP_CORE wxDataViewCustomRendererBase : public wxDataViewCustomRendererRealBase { public: // Constructor must specify the usual renderer parameters which we simply // pass to the base class wxDataViewCustomRendererBase(const wxString& varianttype = "string", wxDataViewCellMode mode = wxDATAVIEW_CELL_INERT, int align = wxDVR_DEFAULT_ALIGNMENT) : wxDataViewCustomRendererRealBase(varianttype, mode, align) { } // Render the item using the current value (returned by GetValue()). virtual bool Render(wxRect cell, wxDC *dc, int state) = 0; // Return the size of the item appropriate to its current value. virtual wxSize GetSize() const = 0; // Define virtual function which are called when a key is pressed on the // item, clicked or the user starts to drag it: by default they all simply // return false indicating that the events are not handled virtual bool ActivateCell(const wxRect& cell, wxDataViewModel *model, const wxDataViewItem & item, unsigned int col, const wxMouseEvent* mouseEvent); // Deprecated, use (and override) ActivateCell() instead wxDEPRECATED_BUT_USED_INTERNALLY_INLINE( virtual bool Activate(wxRect WXUNUSED(cell), wxDataViewModel *WXUNUSED(model), const wxDataViewItem & WXUNUSED(item), unsigned int WXUNUSED(col)), return false; ) // Deprecated, use (and override) ActivateCell() instead wxDEPRECATED_BUT_USED_INTERNALLY_INLINE( virtual bool LeftClick(wxPoint WXUNUSED(cursor), wxRect WXUNUSED(cell), wxDataViewModel *WXUNUSED(model), const wxDataViewItem & WXUNUSED(item), unsigned int WXUNUSED(col)), return false; ) virtual bool StartDrag(const wxPoint& WXUNUSED(cursor), const wxRect& WXUNUSED(cell), wxDataViewModel *WXUNUSED(model), const wxDataViewItem & WXUNUSED(item), unsigned int WXUNUSED(col) ) { return false; } // Helper which can be used by Render() implementation in the derived // classes: it will draw the text in the same manner as the standard // renderers do. virtual void RenderText(const wxString& text, int xoffset, wxRect cell, wxDC *dc, int state); // Override the base class virtual method to simply store the attribute so // that it can be accessed using GetAttr() from Render() if needed. virtual void SetAttr(const wxDataViewItemAttr& attr) wxOVERRIDE { m_attr = attr; } const wxDataViewItemAttr& GetAttr() const { return m_attr; } // Store the enabled state of the item so that it can be accessed from // Render() via GetEnabled() if needed. virtual void SetEnabled(bool enabled) wxOVERRIDE; bool GetEnabled() const { return m_enabled; } // Implementation only from now on // Retrieve the DC to use for drawing. This is implemented in derived // platform-specific classes. virtual wxDC *GetDC() = 0; // To draw background use the background colour in wxDataViewItemAttr virtual void RenderBackground(wxDC* dc, const wxRect& rect); // Prepare DC to use attributes and call Render(). void WXCallRender(wxRect rect, wxDC *dc, int state); virtual bool IsCustomRenderer() const wxOVERRIDE { return true; } protected: // helper for GetSize() implementations, respects attributes wxSize GetTextExtent(const wxString& str) const; private: wxDataViewItemAttr m_attr; bool m_enabled; wxDECLARE_NO_COPY_CLASS(wxDataViewCustomRendererBase); }; // include the declaration of all the other renderers to get the real // wxDataViewCustomRenderer from which we need to inherit below #ifdef wxHAS_GENERIC_DATAVIEWCTRL // because of the different renderer classes hierarchy in the generic // version, as explained above, we can include the header defining // wxDataViewRenderer only here and not before wxDataViewCustomRendererBase // declaration as for the native ports #include "wx/generic/dvrenderer.h" #include "wx/generic/dvrenderers.h" #elif defined(__WXGTK20__) #include "wx/gtk/dvrenderers.h" #elif defined(__WXMAC__) #include "wx/osx/dvrenderers.h" #elif defined(__WXQT__) #include "wx/qt/dvrenderers.h" #else #error "unknown native wxDataViewCtrl implementation" #endif #if wxUSE_SPINCTRL // ---------------------------------------------------------------------------- // wxDataViewSpinRenderer // ---------------------------------------------------------------------------- class WXDLLIMPEXP_CORE wxDataViewSpinRenderer: public wxDataViewCustomRenderer { public: wxDataViewSpinRenderer( int min, int max, wxDataViewCellMode mode = wxDATAVIEW_CELL_EDITABLE, int alignment = wxDVR_DEFAULT_ALIGNMENT ); virtual bool HasEditorCtrl() const wxOVERRIDE { return true; } virtual wxWindow* CreateEditorCtrl( wxWindow *parent, wxRect labelRect, const wxVariant &value ) wxOVERRIDE; virtual bool GetValueFromEditorCtrl( wxWindow* editor, wxVariant &value ) wxOVERRIDE; virtual bool Render( wxRect rect, wxDC *dc, int state ) wxOVERRIDE; virtual wxSize GetSize() const wxOVERRIDE; virtual bool SetValue( const wxVariant &value ) wxOVERRIDE; virtual bool GetValue( wxVariant &value ) const wxOVERRIDE; #if wxUSE_ACCESSIBILITY virtual wxString GetAccessibleDescription() const wxOVERRIDE; #endif // wxUSE_ACCESSIBILITY private: long m_data; long m_min,m_max; }; #endif // wxUSE_SPINCTRL #if defined(wxHAS_GENERIC_DATAVIEWCTRL) // ---------------------------------------------------------------------------- // wxDataViewChoiceRenderer // ---------------------------------------------------------------------------- class WXDLLIMPEXP_CORE wxDataViewChoiceRenderer: public wxDataViewCustomRenderer { public: wxDataViewChoiceRenderer( const wxArrayString &choices, wxDataViewCellMode mode = wxDATAVIEW_CELL_EDITABLE, int alignment = wxDVR_DEFAULT_ALIGNMENT ); virtual bool HasEditorCtrl() const wxOVERRIDE { return true; } virtual wxWindow* CreateEditorCtrl( wxWindow *parent, wxRect labelRect, const wxVariant &value ) wxOVERRIDE; virtual bool GetValueFromEditorCtrl( wxWindow* editor, wxVariant &value ) wxOVERRIDE; virtual bool Render( wxRect rect, wxDC *dc, int state ) wxOVERRIDE; virtual wxSize GetSize() const wxOVERRIDE; virtual bool SetValue( const wxVariant &value ) wxOVERRIDE; virtual bool GetValue( wxVariant &value ) const wxOVERRIDE; #if wxUSE_ACCESSIBILITY virtual wxString GetAccessibleDescription() const wxOVERRIDE; #endif // wxUSE_ACCESSIBILITY wxString GetChoice(size_t index) const { return m_choices[index]; } const wxArrayString& GetChoices() const { return m_choices; } private: wxArrayString m_choices; wxString m_data; }; // ---------------------------------------------------------------------------- // wxDataViewChoiceByIndexRenderer // ---------------------------------------------------------------------------- class WXDLLIMPEXP_CORE wxDataViewChoiceByIndexRenderer: public wxDataViewChoiceRenderer { public: wxDataViewChoiceByIndexRenderer( const wxArrayString &choices, wxDataViewCellMode mode = wxDATAVIEW_CELL_EDITABLE, int alignment = wxDVR_DEFAULT_ALIGNMENT ); virtual wxWindow* CreateEditorCtrl( wxWindow *parent, wxRect labelRect, const wxVariant &value ) wxOVERRIDE; virtual bool GetValueFromEditorCtrl( wxWindow* editor, wxVariant &value ) wxOVERRIDE; virtual bool SetValue( const wxVariant &value ) wxOVERRIDE; virtual bool GetValue( wxVariant &value ) const wxOVERRIDE; #if wxUSE_ACCESSIBILITY virtual wxString GetAccessibleDescription() const wxOVERRIDE; #endif // wxUSE_ACCESSIBILITY }; #endif // generic version #if defined(wxHAS_GENERIC_DATAVIEWCTRL) || defined(__WXGTK__) // ---------------------------------------------------------------------------- // wxDataViewDateRenderer // ---------------------------------------------------------------------------- #if wxUSE_DATEPICKCTRL class WXDLLIMPEXP_CORE wxDataViewDateRenderer: public wxDataViewCustomRenderer { public: static wxString GetDefaultType() { return wxS("datetime"); } wxDataViewDateRenderer(const wxString &varianttype = GetDefaultType(), wxDataViewCellMode mode = wxDATAVIEW_CELL_EDITABLE, int align = wxDVR_DEFAULT_ALIGNMENT); virtual bool HasEditorCtrl() const wxOVERRIDE { return true; } virtual wxWindow *CreateEditorCtrl(wxWindow *parent, wxRect labelRect, const wxVariant &value) wxOVERRIDE; virtual bool GetValueFromEditorCtrl(wxWindow* editor, wxVariant &value) wxOVERRIDE; virtual bool SetValue(const wxVariant &value) wxOVERRIDE; virtual bool GetValue(wxVariant& value) const wxOVERRIDE; #if wxUSE_ACCESSIBILITY virtual wxString GetAccessibleDescription() const wxOVERRIDE; #endif // wxUSE_ACCESSIBILITY virtual bool Render( wxRect cell, wxDC *dc, int state ) wxOVERRIDE; virtual wxSize GetSize() const wxOVERRIDE; private: wxDateTime m_date; }; #else // !wxUSE_DATEPICKCTRL typedef wxDataViewTextRenderer wxDataViewDateRenderer; #endif #endif // generic or GTK+ versions // ---------------------------------------------------------------------------- // wxDataViewCheckIconTextRenderer: 3-state checkbox + text + optional icon // ---------------------------------------------------------------------------- class WXDLLIMPEXP_CORE wxDataViewCheckIconTextRenderer : public wxDataViewCustomRenderer { public: static wxString GetDefaultType() { return wxS("wxDataViewCheckIconText"); } explicit wxDataViewCheckIconTextRenderer ( wxDataViewCellMode mode = wxDATAVIEW_CELL_ACTIVATABLE, int align = wxDVR_DEFAULT_ALIGNMENT ); // This renderer can always display the 3rd ("indeterminate") checkbox // state if the model contains cells with wxCHK_UNDETERMINED value, but it // doesn't allow the user to set it by default. Call this method to allow // this to happen. void Allow3rdStateForUser(bool allow = true); virtual bool SetValue(const wxVariant& value) wxOVERRIDE; virtual bool GetValue(wxVariant& value) const wxOVERRIDE; #if wxUSE_ACCESSIBILITY virtual wxString GetAccessibleDescription() const wxOVERRIDE; #endif // wxUSE_ACCESSIBILITY virtual wxSize GetSize() const wxOVERRIDE; virtual bool Render(wxRect cell, wxDC* dc, int state) wxOVERRIDE; virtual bool ActivateCell(const wxRect& cell, wxDataViewModel *model, const wxDataViewItem & item, unsigned int col, const wxMouseEvent *mouseEvent) wxOVERRIDE; private: wxSize GetCheckSize() const; // Just some arbitrary constants defining margins, in pixels. enum { MARGIN_CHECK_ICON = 3, MARGIN_ICON_TEXT = 4 }; wxDataViewCheckIconText m_value; bool m_allow3rdStateForUser; wxDECLARE_DYNAMIC_CLASS_NO_COPY(wxDataViewCheckIconTextRenderer); }; // this class is obsolete, its functionality was merged in // wxDataViewTextRenderer itself now, don't use it any more #define wxDataViewTextRendererAttr wxDataViewTextRenderer #endif // _WX_DVRENDERERS_H_
h
rticonnextdds-usecases
data/projects/rticonnextdds-usecases/VehicleTracking/ExampleCode/thirdparty/wxWidgets-3.1.2/Linux/include/wx/splash.h
///////////////////////////////////////////////////////////////////////////// // Name: wx/splash.h // Purpose: Base header for wxSplashScreen // Author: Julian Smart // Modified by: // Created: // Copyright: (c) Julian Smart // Licence: wxWindows Licence ///////////////////////////////////////////////////////////////////////////// #ifndef _WX_SPLASH_H_BASE_ #define _WX_SPLASH_H_BASE_ #include "wx/generic/splash.h" #endif // _WX_SPLASH_H_BASE_
h
rticonnextdds-usecases
data/projects/rticonnextdds-usecases/VehicleTracking/ExampleCode/thirdparty/wxWidgets-3.1.2/Linux/include/wx/cmdproc.h
/////////////////////////////////////////////////////////////////////////////// // Name: wx/cmdproc.h // Purpose: undo/redo capable command processing framework // Author: Julian Smart (extracted from docview.h by VZ) // Modified by: // Created: 05.11.00 // Copyright: (c) wxWidgets team // Licence: wxWindows licence /////////////////////////////////////////////////////////////////////////////// #ifndef _WX_CMDPROC_H_ #define _WX_CMDPROC_H_ #include "wx/defs.h" #include "wx/object.h" #include "wx/list.h" class WXDLLIMPEXP_FWD_CORE wxMenu; // ---------------------------------------------------------------------------- // wxCommand: a single command capable of performing itself // ---------------------------------------------------------------------------- class WXDLLIMPEXP_CORE wxCommand : public wxObject { public: wxCommand(bool canUndoIt = false, const wxString& name = wxEmptyString); virtual ~wxCommand(){} // Override this to perform a command virtual bool Do() = 0; // Override this to undo a command virtual bool Undo() = 0; virtual bool CanUndo() const { return m_canUndo; } virtual wxString GetName() const { return m_commandName; } protected: bool m_canUndo; wxString m_commandName; private: wxDECLARE_CLASS(wxCommand); }; // ---------------------------------------------------------------------------- // wxCommandProcessor: wxCommand manager // ---------------------------------------------------------------------------- class WXDLLIMPEXP_CORE wxCommandProcessor : public wxObject { public: // if max number of commands is -1, it is unlimited wxCommandProcessor(int maxCommands = -1); virtual ~wxCommandProcessor(); // Pass a command to the processor. The processor calls Do(); if // successful, is appended to the command history unless storeIt is false. virtual bool Submit(wxCommand *command, bool storeIt = true); // just store the command without executing it virtual void Store(wxCommand *command); virtual bool Undo(); virtual bool Redo(); virtual bool CanUndo() const; virtual bool CanRedo() const; // Initialises the current command and menu strings. virtual void Initialize(); // Sets the Undo/Redo menu strings for the current menu. virtual void SetMenuStrings(); // Gets the current Undo menu label. wxString GetUndoMenuLabel() const; // Gets the current Undo menu label. wxString GetRedoMenuLabel() const; #if wxUSE_MENUS // Call this to manage an edit menu. void SetEditMenu(wxMenu *menu) { m_commandEditMenu = menu; } wxMenu *GetEditMenu() const { return m_commandEditMenu; } #endif // wxUSE_MENUS // command list access wxList& GetCommands() { return m_commands; } const wxList& GetCommands() const { return m_commands; } wxCommand *GetCurrentCommand() const { return (wxCommand *)(m_currentCommand ? m_currentCommand->GetData() : NULL); } int GetMaxCommands() const { return m_maxNoCommands; } virtual void ClearCommands(); // Has the current project been changed? virtual bool IsDirty() const; // Mark the current command as the one where the last save took place void MarkAsSaved() { m_lastSavedCommand = m_currentCommand; } // By default, the accelerators are "\tCtrl+Z" and "\tCtrl+Y" const wxString& GetUndoAccelerator() const { return m_undoAccelerator; } const wxString& GetRedoAccelerator() const { return m_redoAccelerator; } void SetUndoAccelerator(const wxString& accel) { m_undoAccelerator = accel; } void SetRedoAccelerator(const wxString& accel) { m_redoAccelerator = accel; } protected: // for further flexibility, command processor doesn't call wxCommand::Do() // and Undo() directly but uses these functions which can be overridden in // the derived class virtual bool DoCommand(wxCommand& cmd); virtual bool UndoCommand(wxCommand& cmd); int m_maxNoCommands; wxList m_commands; wxList::compatibility_iterator m_currentCommand, m_lastSavedCommand; #if wxUSE_MENUS wxMenu* m_commandEditMenu; #endif // wxUSE_MENUS wxString m_undoAccelerator; wxString m_redoAccelerator; private: wxDECLARE_DYNAMIC_CLASS(wxCommandProcessor); wxDECLARE_NO_COPY_CLASS(wxCommandProcessor); }; #endif // _WX_CMDPROC_H_
h
rticonnextdds-usecases
data/projects/rticonnextdds-usecases/VehicleTracking/ExampleCode/thirdparty/wxWidgets-3.1.2/Linux/include/wx/string.h
/////////////////////////////////////////////////////////////////////////////// // Name: wx/string.h // Purpose: wxString class // Author: Vadim Zeitlin // Modified by: // Created: 29/01/98 // Copyright: (c) 1998 Vadim Zeitlin <[email protected]> // Licence: wxWindows licence /////////////////////////////////////////////////////////////////////////////// /* Efficient string class [more or less] compatible with MFC CString, wxWidgets version 1 wxString and std::string and some handy functions missing from string.h. */ #ifndef _WX_WXSTRING_H__ #define _WX_WXSTRING_H__ // ---------------------------------------------------------------------------- // headers // ---------------------------------------------------------------------------- #include "wx/defs.h" // everybody should include this #if defined(__WXMAC__) #include <ctype.h> #endif #include <string.h> #include <stdio.h> #include <stdarg.h> #include <limits.h> #include <stdlib.h> #include "wx/wxcrtbase.h" // for wxChar, wxStrlen() etc. #include "wx/strvararg.h" #include "wx/buffer.h" // for wxCharBuffer #include "wx/strconv.h" // for wxConvertXXX() macros and wxMBConv classes #include "wx/stringimpl.h" #include "wx/stringops.h" #include "wx/unichar.h" // by default we cache the mapping of the positions in UTF-8 string to the byte // offset as this results in noticeable performance improvements for loops over // strings using indices; comment out this line to disable this // // notice that this optimization is well worth using even in debug builds as it // changes asymptotic complexity of algorithms using indices to iterate over // wxString back to expected linear from quadratic // // also notice that wxTLS_TYPE() (__declspec(thread) in this case) is unsafe to // use in DLL build under pre-Vista Windows so we disable this code for now, if // anybody really needs to use UTF-8 build under Windows with this optimization // it would have to be re-tested and probably corrected // CS: under OSX release builds the string destructor/cache cleanup sometimes // crashes, disable until we find the true reason or a better workaround #if wxUSE_UNICODE_UTF8 && !defined(__WINDOWS__) && !defined(__WXOSX__) #define wxUSE_STRING_POS_CACHE 1 #else #define wxUSE_STRING_POS_CACHE 0 #endif #if wxUSE_STRING_POS_CACHE #include "wx/tls.h" // change this 0 to 1 to enable additional (very expensive) asserts // verifying that string caching logic works as expected #if 0 #define wxSTRING_CACHE_ASSERT(cond) wxASSERT(cond) #else #define wxSTRING_CACHE_ASSERT(cond) #endif #endif // wxUSE_STRING_POS_CACHE class WXDLLIMPEXP_FWD_BASE wxString; // unless this symbol is predefined to disable the compatibility functions, do // use them #ifndef WXWIN_COMPATIBILITY_STRING_PTR_AS_ITER #define WXWIN_COMPATIBILITY_STRING_PTR_AS_ITER 1 #endif namespace wxPrivate { template <typename T> struct wxStringAsBufHelper; } // --------------------------------------------------------------------------- // macros // --------------------------------------------------------------------------- // These macros are not used by wxWidgets itself any longer and are only // preserved for compatibility with the user code that might be still using // them. Do _not_ use them in the new code, just use const_cast<> instead. #define WXSTRINGCAST (wxChar *)(const wxChar *) #define wxCSTRINGCAST (wxChar *)(const wxChar *) #define wxMBSTRINGCAST (char *)(const char *) #define wxWCSTRINGCAST (wchar_t *)(const wchar_t *) // ---------------------------------------------------------------------------- // constants // ---------------------------------------------------------------------------- // --------------------------------------------------------------------------- // global functions complementing standard C string library replacements for // strlen() and portable strcasecmp() //--------------------------------------------------------------------------- #if WXWIN_COMPATIBILITY_2_8 // Use wxXXX() functions from wxcrt.h instead! These functions are for // backwards compatibility only. // checks whether the passed in pointer is NULL and if the string is empty wxDEPRECATED_MSG("use wxIsEmpty() instead") inline bool IsEmpty(const char *p) { return (!p || !*p); } // safe version of strlen() (returns 0 if passed NULL pointer) wxDEPRECATED_MSG("use wxStrlen() instead") inline size_t Strlen(const char *psz) { return psz ? strlen(psz) : 0; } // portable strcasecmp/_stricmp wxDEPRECATED_MSG("use wxStricmp() instead") inline int Stricmp(const char *psz1, const char *psz2) { return wxCRT_StricmpA(psz1, psz2); } #endif // WXWIN_COMPATIBILITY_2_8 // ---------------------------------------------------------------------------- // wxCStrData // ---------------------------------------------------------------------------- // Lightweight object returned by wxString::c_str() and implicitly convertible // to either const char* or const wchar_t*. class wxCStrData { private: // Ctors; for internal use by wxString and wxCStrData only wxCStrData(const wxString *str, size_t offset = 0, bool owned = false) : m_str(str), m_offset(offset), m_owned(owned) {} public: // Ctor constructs the object from char literal; they are needed to make // operator?: compile and they intentionally take char*, not const char* inline wxCStrData(char *buf); inline wxCStrData(wchar_t *buf); inline wxCStrData(const wxCStrData& data); inline ~wxCStrData(); // AsWChar() and AsChar() can't be defined here as they use wxString and so // must come after it and because of this won't be inlined when called from // wxString methods (without a lot of work to extract these wxString methods // from inside the class itself). But we still define them being inline // below to let compiler inline them from elsewhere. And because of this we // must declare them as inline here because otherwise some compilers give // warnings about them, e.g. mingw32 3.4.5 warns about "<symbol> defined // locally after being referenced with dllimport linkage" while IRIX // mipsPro 7.4 warns about "function declared inline after being called". inline const wchar_t* AsWChar() const; operator const wchar_t*() const { return AsWChar(); } inline const char* AsChar() const; const unsigned char* AsUnsignedChar() const { return (const unsigned char *) AsChar(); } operator const char*() const { return AsChar(); } operator const unsigned char*() const { return AsUnsignedChar(); } operator const void*() const { return AsChar(); } // returns buffers that are valid as long as the associated wxString exists const wxScopedCharBuffer AsCharBuf() const { return wxScopedCharBuffer::CreateNonOwned(AsChar()); } const wxScopedWCharBuffer AsWCharBuf() const { return wxScopedWCharBuffer::CreateNonOwned(AsWChar()); } inline wxString AsString() const; // returns the value as C string in internal representation (equivalent // to AsString().wx_str(), but more efficient) const wxStringCharType *AsInternal() const; // allow expressions like "c_str()[0]": inline wxUniChar operator[](size_t n) const; wxUniChar operator[](int n) const { return operator[](size_t(n)); } wxUniChar operator[](long n) const { return operator[](size_t(n)); } #ifndef wxSIZE_T_IS_UINT wxUniChar operator[](unsigned int n) const { return operator[](size_t(n)); } #endif // size_t != unsigned int // These operators are needed to emulate the pointer semantics of c_str(): // expressions like "wxChar *p = str.c_str() + 1;" should continue to work // (we need both versions to resolve ambiguities). Note that this means // the 'n' value is interpreted as addition to char*/wchar_t* pointer, it // is *not* number of Unicode characters in wxString. wxCStrData operator+(int n) const { return wxCStrData(m_str, m_offset + n, m_owned); } wxCStrData operator+(long n) const { return wxCStrData(m_str, m_offset + n, m_owned); } wxCStrData operator+(size_t n) const { return wxCStrData(m_str, m_offset + n, m_owned); } // and these for "str.c_str() + (p2 - p1)" (it also works for any integer // expression but it must be ptrdiff_t and not e.g. int to work in this // example): wxCStrData operator-(ptrdiff_t n) const { wxASSERT_MSG( n <= (ptrdiff_t)m_offset, wxT("attempt to construct address before the beginning of the string") ); return wxCStrData(m_str, m_offset - n, m_owned); } // this operator is needed to make expressions like "*c_str()" or // "*(c_str() + 2)" work inline wxUniChar operator*() const; private: // the wxString this object was returned for const wxString *m_str; // Offset into c_str() return value. Note that this is *not* offset in // m_str in Unicode characters. Instead, it is index into the // char*/wchar_t* buffer returned by c_str(). It's interpretation depends // on how is the wxCStrData instance used: if it is eventually cast to // const char*, m_offset will be in bytes form string's start; if it is // cast to const wchar_t*, it will be in wchar_t values. size_t m_offset; // should m_str be deleted, i.e. is it owned by us? bool m_owned; friend class WXDLLIMPEXP_FWD_BASE wxString; }; // ---------------------------------------------------------------------------- // wxString: string class trying to be compatible with std::string, MFC // CString and wxWindows 1.x wxString all at once // --------------------------------------------------------------------------- #if wxUSE_UNICODE_UTF8 // see the comment near wxString::iterator for why we need this class WXDLLIMPEXP_BASE wxStringIteratorNode { public: wxStringIteratorNode() : m_str(NULL), m_citer(NULL), m_iter(NULL), m_prev(NULL), m_next(NULL) {} wxStringIteratorNode(const wxString *str, wxStringImpl::const_iterator *citer) { DoSet(str, citer, NULL); } wxStringIteratorNode(const wxString *str, wxStringImpl::iterator *iter) { DoSet(str, NULL, iter); } ~wxStringIteratorNode() { clear(); } inline void set(const wxString *str, wxStringImpl::const_iterator *citer) { clear(); DoSet(str, citer, NULL); } inline void set(const wxString *str, wxStringImpl::iterator *iter) { clear(); DoSet(str, NULL, iter); } const wxString *m_str; wxStringImpl::const_iterator *m_citer; wxStringImpl::iterator *m_iter; wxStringIteratorNode *m_prev, *m_next; private: inline void clear(); inline void DoSet(const wxString *str, wxStringImpl::const_iterator *citer, wxStringImpl::iterator *iter); // the node belongs to a particular iterator instance, it's not copied // when a copy of the iterator is made wxDECLARE_NO_COPY_CLASS(wxStringIteratorNode); }; #endif // wxUSE_UNICODE_UTF8 class WXDLLIMPEXP_BASE wxString { // NB: special care was taken in arranging the member functions in such order // that all inline functions can be effectively inlined, verify that all // performance critical functions are still inlined if you change order! public: // an 'invalid' value for string index, moved to this place due to a CW bug static const size_t npos; private: // if we hadn't made these operators private, it would be possible to // compile "wxString s; s = 17;" without any warnings as 17 is implicitly // converted to char in C and we do have operator=(char) // // NB: we don't need other versions (short/long and unsigned) as attempt // to assign another numeric type to wxString will now result in // ambiguity between operator=(char) and operator=(int) wxString& operator=(int); // these methods are not implemented - there is _no_ conversion from int to // string, you're doing something wrong if the compiler wants to call it! // // try `s << i' or `s.Printf("%d", i)' instead wxString(int); // buffer for holding temporary substring when using any of the methods // that take (char*,size_t) or (wchar_t*,size_t) arguments: template<typename T> struct SubstrBufFromType { T data; size_t len; SubstrBufFromType(const T& data_, size_t len_) : data(data_), len(len_) { wxASSERT_MSG( len != npos, "must have real length" ); } }; #if wxUSE_UNICODE_UTF8 // even char* -> char* needs conversion, from locale charset to UTF-8 typedef SubstrBufFromType<wxScopedCharBuffer> SubstrBufFromWC; typedef SubstrBufFromType<wxScopedCharBuffer> SubstrBufFromMB; #elif wxUSE_UNICODE_WCHAR typedef SubstrBufFromType<const wchar_t*> SubstrBufFromWC; typedef SubstrBufFromType<wxScopedWCharBuffer> SubstrBufFromMB; #else typedef SubstrBufFromType<const char*> SubstrBufFromMB; typedef SubstrBufFromType<wxScopedCharBuffer> SubstrBufFromWC; #endif // Functions implementing primitive operations on string data; wxString // methods and iterators are implemented in terms of it. The differences // between UTF-8 and wchar_t* representations of the string are mostly // contained here. #if wxUSE_UNICODE_UTF8 static SubstrBufFromMB ConvertStr(const char *psz, size_t nLength, const wxMBConv& conv); static SubstrBufFromWC ConvertStr(const wchar_t *pwz, size_t nLength, const wxMBConv& conv); #elif wxUSE_UNICODE_WCHAR static SubstrBufFromMB ConvertStr(const char *psz, size_t nLength, const wxMBConv& conv); #else static SubstrBufFromWC ConvertStr(const wchar_t *pwz, size_t nLength, const wxMBConv& conv); #endif #if !wxUSE_UNICODE_UTF8 // wxUSE_UNICODE_WCHAR or !wxUSE_UNICODE // returns C string encoded as the implementation expects: #if wxUSE_UNICODE static const wchar_t* ImplStr(const wchar_t* str) { return str ? str : wxT(""); } static const SubstrBufFromWC ImplStr(const wchar_t* str, size_t n) { return SubstrBufFromWC(str, (str && n == npos) ? wxWcslen(str) : n); } static wxScopedWCharBuffer ImplStr(const char* str, const wxMBConv& conv = wxConvLibc) { return ConvertStr(str, npos, conv).data; } static SubstrBufFromMB ImplStr(const char* str, size_t n, const wxMBConv& conv = wxConvLibc) { return ConvertStr(str, n, conv); } #else static const char* ImplStr(const char* str, const wxMBConv& WXUNUSED(conv) = wxConvLibc) { return str ? str : ""; } static const SubstrBufFromMB ImplStr(const char* str, size_t n, const wxMBConv& WXUNUSED(conv) = wxConvLibc) { return SubstrBufFromMB(str, (str && n == npos) ? wxStrlen(str) : n); } static wxScopedCharBuffer ImplStr(const wchar_t* str) { return ConvertStr(str, npos, wxConvLibc).data; } static SubstrBufFromWC ImplStr(const wchar_t* str, size_t n) { return ConvertStr(str, n, wxConvLibc); } #endif // translates position index in wxString to/from index in underlying // wxStringImpl: static size_t PosToImpl(size_t pos) { return pos; } static void PosLenToImpl(size_t pos, size_t len, size_t *implPos, size_t *implLen) { *implPos = pos; *implLen = len; } static size_t LenToImpl(size_t len) { return len; } static size_t PosFromImpl(size_t pos) { return pos; } // we don't want to define these as empty inline functions as it could // result in noticeable (and quite unnecessary in non-UTF-8 build) slowdown // in debug build where the inline functions are not effectively inlined #define wxSTRING_INVALIDATE_CACHE() #define wxSTRING_INVALIDATE_CACHED_LENGTH() #define wxSTRING_UPDATE_CACHED_LENGTH(n) #define wxSTRING_SET_CACHED_LENGTH(n) #else // wxUSE_UNICODE_UTF8 static wxScopedCharBuffer ImplStr(const char* str, const wxMBConv& conv = wxConvLibc) { return ConvertStr(str, npos, conv).data; } static SubstrBufFromMB ImplStr(const char* str, size_t n, const wxMBConv& conv = wxConvLibc) { return ConvertStr(str, n, conv); } static wxScopedCharBuffer ImplStr(const wchar_t* str) { return ConvertStr(str, npos, wxMBConvUTF8()).data; } static SubstrBufFromWC ImplStr(const wchar_t* str, size_t n) { return ConvertStr(str, n, wxMBConvUTF8()); } #if wxUSE_STRING_POS_CACHE // this is an extremely simple cache used by PosToImpl(): each cache element // contains the string it applies to and the index corresponding to the last // used position in this wxString in its m_impl string // // NB: notice that this struct (and nested Element one) must be a POD or we // wouldn't be able to use a thread-local variable of this type, in // particular it should have no ctor -- we rely on statics being // initialized to 0 instead struct Cache { enum { SIZE = 8 }; struct Element { const wxString *str; // the string to which this element applies size_t pos, // the cached index in this string impl, // the corresponding position in its m_impl len; // cached length or npos if unknown // reset cached index to 0 void ResetPos() { pos = impl = 0; } // reset position and length void Reset() { ResetPos(); len = npos; } }; // cache the indices mapping for the last few string used Element cached[SIZE]; // the last used index unsigned lastUsed; }; #ifndef wxHAS_COMPILER_TLS // we must use an accessor function and not a static variable when the TLS // variables support is implemented in the library (and not by the compiler) // because the global s_cache variable could be not yet initialized when a // ctor of another global object is executed and if that ctor uses any // wxString methods, bad things happen // // however notice that this approach does not work when compiler TLS is used, // at least not with g++ 4.1.2 under amd64 as it apparently compiles code // using this accessor incorrectly when optimizations are enabled (-O2 is // enough) -- luckily we don't need it then neither as static __thread // variables are initialized by 0 anyhow then and so we can use the variable // directly WXEXPORT static Cache& GetCache() { static wxTLS_TYPE(Cache) s_cache; return wxTLS_VALUE(s_cache); } // this helper struct is used to ensure that GetCache() is called during // static initialization time, i.e. before any threads creation, as otherwise // the static s_cache construction inside GetCache() wouldn't be MT-safe friend struct wxStrCacheInitializer; #else // wxHAS_COMPILER_TLS static wxTLS_TYPE(Cache) ms_cache; static Cache& GetCache() { return wxTLS_VALUE(ms_cache); } #endif // !wxHAS_COMPILER_TLS/wxHAS_COMPILER_TLS static Cache::Element *GetCacheBegin() { return GetCache().cached; } static Cache::Element *GetCacheEnd() { return GetCacheBegin() + Cache::SIZE; } static unsigned& LastUsedCacheElement() { return GetCache().lastUsed; } // this is used in debug builds only to provide a convenient function, // callable from a debugger, to show the cache contents friend struct wxStrCacheDumper; // uncomment this to have access to some profiling statistics on program // termination //#define wxPROFILE_STRING_CACHE #ifdef wxPROFILE_STRING_CACHE static struct PosToImplCacheStats { unsigned postot, // total non-trivial calls to PosToImpl poshits, // cache hits from PosToImpl() mishits, // cached position beyond the needed one sumpos, // sum of all positions, used to compute the // average position after dividing by postot sumofs, // sum of all offsets after using the cache, used to // compute the average after dividing by hits lentot, // number of total calls to length() lenhits; // number of cache hits in length() } ms_cacheStats; friend struct wxStrCacheStatsDumper; #define wxCACHE_PROFILE_FIELD_INC(field) ms_cacheStats.field++ #define wxCACHE_PROFILE_FIELD_ADD(field, val) ms_cacheStats.field += (val) #else // !wxPROFILE_STRING_CACHE #define wxCACHE_PROFILE_FIELD_INC(field) #define wxCACHE_PROFILE_FIELD_ADD(field, val) #endif // wxPROFILE_STRING_CACHE/!wxPROFILE_STRING_CACHE // note: it could seem that the functions below shouldn't be inline because // they are big, contain loops and so the compiler shouldn't be able to // inline them anyhow, however moving them into string.cpp does decrease the // code performance by ~5%, at least when using g++ 4.1 so do keep them here // unless tests show that it's not advantageous any more // return the pointer to the cache element for this string or NULL if not // cached Cache::Element *FindCacheElement() const { // profiling seems to show a small but consistent gain if we use this // simple loop instead of starting from the last used element (there are // a lot of misses in this function...) Cache::Element * const cacheBegin = GetCacheBegin(); #ifndef wxHAS_COMPILER_TLS // during destruction tls calls may return NULL, in this case return NULL // immediately without accessing anything else if ( cacheBegin == NULL ) return NULL; #endif Cache::Element * const cacheEnd = GetCacheEnd(); for ( Cache::Element *c = cacheBegin; c != cacheEnd; c++ ) { if ( c->str == this ) return c; } return NULL; } // unlike FindCacheElement(), this one always returns a valid pointer to the // cache element for this string, it may have valid last cached position and // its corresponding index in the byte string or not Cache::Element *GetCacheElement() const { Cache::Element * const cacheBegin = GetCacheBegin(); Cache::Element * const cacheEnd = GetCacheEnd(); Cache::Element * const cacheStart = cacheBegin + LastUsedCacheElement(); // check the last used first, this does no (measurable) harm for a miss // but does help for simple loops addressing the same string all the time if ( cacheStart->str == this ) return cacheStart; // notice that we're going to check cacheStart again inside this call but // profiling shows that it's still faster to use a simple loop like // inside FindCacheElement() than manually looping with wrapping starting // from the cache entry after the start one Cache::Element *c = FindCacheElement(); if ( !c ) { // claim the next cache entry for this string c = cacheStart; if ( ++c == cacheEnd ) c = cacheBegin; c->str = this; c->Reset(); // and remember the last used element LastUsedCacheElement() = c - cacheBegin; } return c; } size_t DoPosToImpl(size_t pos) const { wxCACHE_PROFILE_FIELD_INC(postot); // NB: although the case of pos == 1 (and offset from cached position // equal to 1) are common, nothing is gained by writing special code // for handling them, the compiler (at least g++ 4.1 used) seems to // optimize the code well enough on its own wxCACHE_PROFILE_FIELD_ADD(sumpos, pos); Cache::Element * const cache = GetCacheElement(); // cached position can't be 0 so if it is, it means that this entry was // used for length caching only so far, i.e. it doesn't count as a hit // from our point of view if ( cache->pos ) { wxCACHE_PROFILE_FIELD_INC(poshits); } if ( pos == cache->pos ) return cache->impl; // this seems to happen only rarely so just reset the cache in this case // instead of complicating code even further by seeking backwards in this // case if ( cache->pos > pos ) { wxCACHE_PROFILE_FIELD_INC(mishits); cache->ResetPos(); } wxCACHE_PROFILE_FIELD_ADD(sumofs, pos - cache->pos); wxStringImpl::const_iterator i(m_impl.begin() + cache->impl); for ( size_t n = cache->pos; n < pos; n++ ) wxStringOperations::IncIter(i); cache->pos = pos; cache->impl = i - m_impl.begin(); wxSTRING_CACHE_ASSERT( (int)cache->impl == (begin() + pos).impl() - m_impl.begin() ); return cache->impl; } void InvalidateCache() { Cache::Element * const cache = FindCacheElement(); if ( cache ) cache->Reset(); } void InvalidateCachedLength() { Cache::Element * const cache = FindCacheElement(); if ( cache ) cache->len = npos; } void SetCachedLength(size_t len) { // we optimistically cache the length here even if the string wasn't // present in the cache before, this seems to do no harm and the // potential for avoiding length recomputation for long strings looks // interesting GetCacheElement()->len = len; } void UpdateCachedLength(ptrdiff_t delta) { Cache::Element * const cache = FindCacheElement(); if ( cache && cache->len != npos ) { wxSTRING_CACHE_ASSERT( (ptrdiff_t)cache->len + delta >= 0 ); cache->len += delta; } } #define wxSTRING_INVALIDATE_CACHE() InvalidateCache() #define wxSTRING_INVALIDATE_CACHED_LENGTH() InvalidateCachedLength() #define wxSTRING_UPDATE_CACHED_LENGTH(n) UpdateCachedLength(n) #define wxSTRING_SET_CACHED_LENGTH(n) SetCachedLength(n) #else // !wxUSE_STRING_POS_CACHE size_t DoPosToImpl(size_t pos) const { return (begin() + pos).impl() - m_impl.begin(); } #define wxSTRING_INVALIDATE_CACHE() #define wxSTRING_INVALIDATE_CACHED_LENGTH() #define wxSTRING_UPDATE_CACHED_LENGTH(n) #define wxSTRING_SET_CACHED_LENGTH(n) #endif // wxUSE_STRING_POS_CACHE/!wxUSE_STRING_POS_CACHE size_t PosToImpl(size_t pos) const { return pos == 0 || pos == npos ? pos : DoPosToImpl(pos); } void PosLenToImpl(size_t pos, size_t len, size_t *implPos, size_t *implLen) const; size_t LenToImpl(size_t len) const { size_t pos, len2; PosLenToImpl(0, len, &pos, &len2); return len2; } size_t PosFromImpl(size_t pos) const { if ( pos == 0 || pos == npos ) return pos; else return const_iterator(this, m_impl.begin() + pos) - begin(); } #endif // !wxUSE_UNICODE_UTF8/wxUSE_UNICODE_UTF8 public: // standard types typedef wxUniChar value_type; typedef wxUniChar char_type; typedef wxUniCharRef reference; typedef wxChar* pointer; typedef const wxChar* const_pointer; typedef size_t size_type; typedef const wxUniChar const_reference; #if wxUSE_STD_STRING #if wxUSE_UNICODE_UTF8 // random access is not O(1), as required by Random Access Iterator #define WX_STR_ITERATOR_TAG std::bidirectional_iterator_tag #else #define WX_STR_ITERATOR_TAG std::random_access_iterator_tag #endif #define WX_DEFINE_ITERATOR_CATEGORY(cat) typedef cat iterator_category; #else // not defining iterator_category at all in this case is better than defining // it as some dummy type -- at least it results in more intelligible error // messages #define WX_DEFINE_ITERATOR_CATEGORY(cat) #endif #define WX_STR_ITERATOR_IMPL(iterator_name, pointer_type, reference_type) \ private: \ typedef wxStringImpl::iterator_name underlying_iterator; \ public: \ WX_DEFINE_ITERATOR_CATEGORY(WX_STR_ITERATOR_TAG) \ typedef wxUniChar value_type; \ typedef ptrdiff_t difference_type; \ typedef reference_type reference; \ typedef pointer_type pointer; \ \ reference operator[](size_t n) const { return *(*this + n); } \ \ iterator_name& operator++() \ { wxStringOperations::IncIter(m_cur); return *this; } \ iterator_name& operator--() \ { wxStringOperations::DecIter(m_cur); return *this; } \ iterator_name operator++(int) \ { \ iterator_name tmp = *this; \ wxStringOperations::IncIter(m_cur); \ return tmp; \ } \ iterator_name operator--(int) \ { \ iterator_name tmp = *this; \ wxStringOperations::DecIter(m_cur); \ return tmp; \ } \ \ iterator_name& operator+=(ptrdiff_t n) \ { \ m_cur = wxStringOperations::AddToIter(m_cur, n); \ return *this; \ } \ iterator_name& operator-=(ptrdiff_t n) \ { \ m_cur = wxStringOperations::AddToIter(m_cur, -n); \ return *this; \ } \ \ difference_type operator-(const iterator_name& i) const \ { return wxStringOperations::DiffIters(m_cur, i.m_cur); } \ \ bool operator==(const iterator_name& i) const \ { return m_cur == i.m_cur; } \ bool operator!=(const iterator_name& i) const \ { return m_cur != i.m_cur; } \ \ bool operator<(const iterator_name& i) const \ { return m_cur < i.m_cur; } \ bool operator>(const iterator_name& i) const \ { return m_cur > i.m_cur; } \ bool operator<=(const iterator_name& i) const \ { return m_cur <= i.m_cur; } \ bool operator>=(const iterator_name& i) const \ { return m_cur >= i.m_cur; } \ \ private: \ /* for internal wxString use only: */ \ underlying_iterator impl() const { return m_cur; } \ \ friend class wxString; \ friend class wxCStrData; \ \ private: \ underlying_iterator m_cur class WXDLLIMPEXP_FWD_BASE const_iterator; #if wxUSE_UNICODE_UTF8 // NB: In UTF-8 build, (non-const) iterator needs to keep reference // to the underlying wxStringImpl, because UTF-8 is variable-length // encoding and changing the value pointer to by an iterator (using // its operator*) requires calling wxStringImpl::replace() if the old // and new values differ in their encoding's length. // // Furthermore, the replace() call may invalid all iterators for the // string, so we have to keep track of outstanding iterators and update // them if replace() happens. // // This is implemented by maintaining linked list of iterators for every // string and traversing it in wxUniCharRef::operator=(). Head of the // list is stored in wxString. (FIXME-UTF8) class WXDLLIMPEXP_BASE iterator { WX_STR_ITERATOR_IMPL(iterator, wxChar*, wxUniCharRef); public: iterator() {} iterator(const iterator& i) : m_cur(i.m_cur), m_node(i.str(), &m_cur) {} iterator& operator=(const iterator& i) { if (&i != this) { m_cur = i.m_cur; m_node.set(i.str(), &m_cur); } return *this; } reference operator*() { return wxUniCharRef::CreateForString(*str(), m_cur); } iterator operator+(ptrdiff_t n) const { return iterator(str(), wxStringOperations::AddToIter(m_cur, n)); } iterator operator-(ptrdiff_t n) const { return iterator(str(), wxStringOperations::AddToIter(m_cur, -n)); } // Normal iterators need to be comparable with the const_iterators so // declare the comparison operators and implement them below after the // full const_iterator declaration. bool operator==(const const_iterator& i) const; bool operator!=(const const_iterator& i) const; bool operator<(const const_iterator& i) const; bool operator>(const const_iterator& i) const; bool operator<=(const const_iterator& i) const; bool operator>=(const const_iterator& i) const; private: iterator(wxString *wxstr, underlying_iterator ptr) : m_cur(ptr), m_node(wxstr, &m_cur) {} wxString* str() const { return const_cast<wxString*>(m_node.m_str); } wxStringIteratorNode m_node; friend class const_iterator; }; class WXDLLIMPEXP_BASE const_iterator { // NB: reference_type is intentionally value, not reference, the character // may be encoded differently in wxString data: WX_STR_ITERATOR_IMPL(const_iterator, const wxChar*, wxUniChar); public: const_iterator() {} const_iterator(const const_iterator& i) : m_cur(i.m_cur), m_node(i.str(), &m_cur) {} const_iterator(const iterator& i) : m_cur(i.m_cur), m_node(i.str(), &m_cur) {} const_iterator& operator=(const const_iterator& i) { if (&i != this) { m_cur = i.m_cur; m_node.set(i.str(), &m_cur); } return *this; } const_iterator& operator=(const iterator& i) { m_cur = i.m_cur; m_node.set(i.str(), &m_cur); return *this; } reference operator*() const { return wxStringOperations::DecodeChar(m_cur); } const_iterator operator+(ptrdiff_t n) const { return const_iterator(str(), wxStringOperations::AddToIter(m_cur, n)); } const_iterator operator-(ptrdiff_t n) const { return const_iterator(str(), wxStringOperations::AddToIter(m_cur, -n)); } // Notice that comparison operators taking non-const iterator are not // needed here because of the implicit conversion from non-const iterator // to const ones ensure that the versions for const_iterator declared // inside WX_STR_ITERATOR_IMPL can be used. private: // for internal wxString use only: const_iterator(const wxString *wxstr, underlying_iterator ptr) : m_cur(ptr), m_node(wxstr, &m_cur) {} const wxString* str() const { return m_node.m_str; } wxStringIteratorNode m_node; }; iterator GetIterForNthChar(size_t n) { return iterator(this, m_impl.begin() + PosToImpl(n)); } const_iterator GetIterForNthChar(size_t n) const { return const_iterator(this, m_impl.begin() + PosToImpl(n)); } #else // !wxUSE_UNICODE_UTF8 class WXDLLIMPEXP_BASE iterator { WX_STR_ITERATOR_IMPL(iterator, wxChar*, wxUniCharRef); public: iterator() {} iterator(const iterator& i) : m_cur(i.m_cur) {} reference operator*() { return wxUniCharRef::CreateForString(m_cur); } iterator operator+(ptrdiff_t n) const { return iterator(wxStringOperations::AddToIter(m_cur, n)); } iterator operator-(ptrdiff_t n) const { return iterator(wxStringOperations::AddToIter(m_cur, -n)); } // As in UTF-8 case above, define comparison operators taking // const_iterator too. bool operator==(const const_iterator& i) const; bool operator!=(const const_iterator& i) const; bool operator<(const const_iterator& i) const; bool operator>(const const_iterator& i) const; bool operator<=(const const_iterator& i) const; bool operator>=(const const_iterator& i) const; private: // for internal wxString use only: iterator(underlying_iterator ptr) : m_cur(ptr) {} iterator(wxString *WXUNUSED(str), underlying_iterator ptr) : m_cur(ptr) {} friend class const_iterator; }; class WXDLLIMPEXP_BASE const_iterator { // NB: reference_type is intentionally value, not reference, the character // may be encoded differently in wxString data: WX_STR_ITERATOR_IMPL(const_iterator, const wxChar*, wxUniChar); public: const_iterator() {} const_iterator(const const_iterator& i) : m_cur(i.m_cur) {} const_iterator(const iterator& i) : m_cur(i.m_cur) {} const_reference operator*() const { return wxStringOperations::DecodeChar(m_cur); } const_iterator operator+(ptrdiff_t n) const { return const_iterator(wxStringOperations::AddToIter(m_cur, n)); } const_iterator operator-(ptrdiff_t n) const { return const_iterator(wxStringOperations::AddToIter(m_cur, -n)); } // As in UTF-8 case above, we don't need comparison operators taking // iterator because we have an implicit conversion from iterator to // const_iterator so the operators declared by WX_STR_ITERATOR_IMPL will // be used. private: // for internal wxString use only: const_iterator(underlying_iterator ptr) : m_cur(ptr) {} const_iterator(const wxString *WXUNUSED(str), underlying_iterator ptr) : m_cur(ptr) {} }; iterator GetIterForNthChar(size_t n) { return begin() + n; } const_iterator GetIterForNthChar(size_t n) const { return begin() + n; } #endif // wxUSE_UNICODE_UTF8/!wxUSE_UNICODE_UTF8 size_t IterToImplPos(wxString::iterator i) const { return wxStringImpl::const_iterator(i.impl()) - m_impl.begin(); } #undef WX_STR_ITERATOR_TAG #undef WX_STR_ITERATOR_IMPL // This method is mostly used by wxWidgets itself and return the offset of // the given iterator in bytes relative to the start of the buffer // representing the current string contents in the current locale encoding. // // It is inefficient as it involves converting part of the string to this // encoding (and also unsafe as it simply returns 0 if the conversion fails) // and so should be avoided if possible, wx itself only uses it to implement // backwards-compatible API. ptrdiff_t IterOffsetInMBStr(const const_iterator& i) const { const wxString str(begin(), i); // This is logically equivalent to strlen(str.mb_str()) but avoids // actually converting the string to multibyte and just computes the // length that it would have after conversion. const size_t ofs = wxConvLibc.FromWChar(NULL, 0, str.wc_str(), str.length()); return ofs == wxCONV_FAILED ? 0 : static_cast<ptrdiff_t>(ofs); } friend class iterator; friend class const_iterator; template <typename T> class reverse_iterator_impl { public: typedef T iterator_type; WX_DEFINE_ITERATOR_CATEGORY(typename T::iterator_category) typedef typename T::value_type value_type; typedef typename T::difference_type difference_type; typedef typename T::reference reference; typedef typename T::pointer *pointer; reverse_iterator_impl() {} reverse_iterator_impl(iterator_type i) : m_cur(i) {} reverse_iterator_impl(const reverse_iterator_impl& ri) : m_cur(ri.m_cur) {} iterator_type base() const { return m_cur; } reference operator*() const { return *(m_cur-1); } reference operator[](size_t n) const { return *(*this + n); } reverse_iterator_impl& operator++() { --m_cur; return *this; } reverse_iterator_impl operator++(int) { reverse_iterator_impl tmp = *this; --m_cur; return tmp; } reverse_iterator_impl& operator--() { ++m_cur; return *this; } reverse_iterator_impl operator--(int) { reverse_iterator_impl tmp = *this; ++m_cur; return tmp; } // NB: explicit <T> in the functions below is to keep BCC 5.5 happy reverse_iterator_impl operator+(ptrdiff_t n) const { return reverse_iterator_impl<T>(m_cur - n); } reverse_iterator_impl operator-(ptrdiff_t n) const { return reverse_iterator_impl<T>(m_cur + n); } reverse_iterator_impl operator+=(ptrdiff_t n) { m_cur -= n; return *this; } reverse_iterator_impl operator-=(ptrdiff_t n) { m_cur += n; return *this; } difference_type operator-(const reverse_iterator_impl& i) const { return i.m_cur - m_cur; } bool operator==(const reverse_iterator_impl& ri) const { return m_cur == ri.m_cur; } bool operator!=(const reverse_iterator_impl& ri) const { return !(*this == ri); } bool operator<(const reverse_iterator_impl& i) const { return m_cur > i.m_cur; } bool operator>(const reverse_iterator_impl& i) const { return m_cur < i.m_cur; } bool operator<=(const reverse_iterator_impl& i) const { return m_cur >= i.m_cur; } bool operator>=(const reverse_iterator_impl& i) const { return m_cur <= i.m_cur; } private: iterator_type m_cur; }; typedef reverse_iterator_impl<iterator> reverse_iterator; typedef reverse_iterator_impl<const_iterator> const_reverse_iterator; private: // used to transform an expression built using c_str() (and hence of type // wxCStrData) to an iterator into the string static const_iterator CreateConstIterator(const wxCStrData& data) { return const_iterator(data.m_str, (data.m_str->begin() + data.m_offset).impl()); } // in UTF-8 STL build, creation from std::string requires conversion under // non-UTF8 locales, so we can't have and use wxString(wxStringImpl) ctor; // instead we define dummy type that lets us have wxString ctor for creation // from wxStringImpl that couldn't be used by user code (in all other builds, // "standard" ctors can be used): #if wxUSE_UNICODE_UTF8 && wxUSE_STL_BASED_WXSTRING struct CtorFromStringImplTag {}; wxString(CtorFromStringImplTag* WXUNUSED(dummy), const wxStringImpl& src) : m_impl(src) {} static wxString FromImpl(const wxStringImpl& src) { return wxString((CtorFromStringImplTag*)NULL, src); } #else #if !wxUSE_STL_BASED_WXSTRING wxString(const wxStringImpl& src) : m_impl(src) { } // else: already defined as wxString(wxStdString) below #endif static wxString FromImpl(const wxStringImpl& src) { return wxString(src); } #endif public: // constructors and destructor // ctor for an empty string wxString() {} // copy ctor wxString(const wxString& stringSrc) : m_impl(stringSrc.m_impl) { } // string containing nRepeat copies of ch wxString(wxUniChar ch, size_t nRepeat = 1 ) { assign(nRepeat, ch); } wxString(size_t nRepeat, wxUniChar ch) { assign(nRepeat, ch); } wxString(wxUniCharRef ch, size_t nRepeat = 1) { assign(nRepeat, ch); } wxString(size_t nRepeat, wxUniCharRef ch) { assign(nRepeat, ch); } wxString(char ch, size_t nRepeat = 1) { assign(nRepeat, ch); } wxString(size_t nRepeat, char ch) { assign(nRepeat, ch); } wxString(wchar_t ch, size_t nRepeat = 1) { assign(nRepeat, ch); } wxString(size_t nRepeat, wchar_t ch) { assign(nRepeat, ch); } // ctors from char* strings: wxString(const char *psz) : m_impl(ImplStr(psz)) {} wxString(const char *psz, const wxMBConv& conv) : m_impl(ImplStr(psz, conv)) {} wxString(const char *psz, size_t nLength) { assign(psz, nLength); } wxString(const char *psz, const wxMBConv& conv, size_t nLength) { SubstrBufFromMB str(ImplStr(psz, nLength, conv)); m_impl.assign(str.data, str.len); } // and unsigned char*: wxString(const unsigned char *psz) : m_impl(ImplStr((const char*)psz)) {} wxString(const unsigned char *psz, const wxMBConv& conv) : m_impl(ImplStr((const char*)psz, conv)) {} wxString(const unsigned char *psz, size_t nLength) { assign((const char*)psz, nLength); } wxString(const unsigned char *psz, const wxMBConv& conv, size_t nLength) { SubstrBufFromMB str(ImplStr((const char*)psz, nLength, conv)); m_impl.assign(str.data, str.len); } // ctors from wchar_t* strings: wxString(const wchar_t *pwz) : m_impl(ImplStr(pwz)) {} wxString(const wchar_t *pwz, const wxMBConv& WXUNUSED(conv)) : m_impl(ImplStr(pwz)) {} wxString(const wchar_t *pwz, size_t nLength) { assign(pwz, nLength); } wxString(const wchar_t *pwz, const wxMBConv& WXUNUSED(conv), size_t nLength) { assign(pwz, nLength); } wxString(const wxScopedCharBuffer& buf) { assign(buf.data(), buf.length()); } wxString(const wxScopedWCharBuffer& buf) { assign(buf.data(), buf.length()); } wxString(const wxScopedCharBuffer& buf, const wxMBConv& conv) { assign(buf, conv); } // NB: this version uses m_impl.c_str() to force making a copy of the // string, so that "wxString(str.c_str())" idiom for passing strings // between threads works wxString(const wxCStrData& cstr) : m_impl(cstr.AsString().m_impl.c_str()) { } // as we provide both ctors with this signature for both char and unsigned // char string, we need to provide one for wxCStrData to resolve ambiguity wxString(const wxCStrData& cstr, size_t nLength) : m_impl(cstr.AsString().Mid(0, nLength).m_impl) {} // and because wxString is convertible to wxCStrData and const wxChar * // we also need to provide this one wxString(const wxString& str, size_t nLength) { assign(str, nLength); } #if wxUSE_STRING_POS_CACHE ~wxString() { // we need to invalidate our cache entry as another string could be // recreated at the same address (unlikely, but still possible, with the // heap-allocated strings but perfectly common with stack-allocated ones) InvalidateCache(); } #endif // wxUSE_STRING_POS_CACHE // even if we're not built with wxUSE_STD_STRING_CONV_IN_WXSTRING == 1 it is // very convenient to allow implicit conversions from std::string to wxString // and vice verse as this allows to use the same strings in non-GUI and GUI // code, however we don't want to unconditionally add this ctor as it would // make wx lib dependent on libstdc++ on some Linux versions which is bad, so // instead we ask the client code to define this wxUSE_STD_STRING symbol if // they need it #if wxUSE_STD_STRING #if wxUSE_UNICODE_WCHAR wxString(const wxStdWideString& str) : m_impl(str) {} #else // UTF-8 or ANSI wxString(const wxStdWideString& str) { assign(str.c_str(), str.length()); } #endif #if !wxUSE_UNICODE // ANSI build // FIXME-UTF8: do this in UTF8 build #if wxUSE_UTF8_LOCALE_ONLY, too wxString(const std::string& str) : m_impl(str) {} #else // Unicode wxString(const std::string& str) { assign(str.c_str(), str.length()); } #endif #endif // wxUSE_STD_STRING // Also always provide explicit conversions to std::[w]string in any case, // see below for the implicit ones. #if wxUSE_STD_STRING // We can avoid a copy if we already use this string type internally, // otherwise we create a copy on the fly: #if wxUSE_UNICODE_WCHAR && wxUSE_STL_BASED_WXSTRING #define wxStringToStdWstringRetType const wxStdWideString& const wxStdWideString& ToStdWstring() const { return m_impl; } #else // wxStringImpl is either not std::string or needs conversion #define wxStringToStdWstringRetType wxStdWideString wxStdWideString ToStdWstring() const { #if wxUSE_UNICODE_WCHAR wxScopedWCharBuffer buf = wxScopedWCharBuffer::CreateNonOwned(m_impl.c_str(), m_impl.length()); #else // !wxUSE_UNICODE_WCHAR wxScopedWCharBuffer buf(wc_str()); #endif return wxStdWideString(buf.data(), buf.length()); } #endif #if (!wxUSE_UNICODE || wxUSE_UTF8_LOCALE_ONLY) && wxUSE_STL_BASED_WXSTRING // wxStringImpl is std::string in the encoding we want #define wxStringToStdStringRetType const std::string& const std::string& ToStdString() const { return m_impl; } std::string ToStdString(const wxMBConv& WXUNUSED(conv)) const { // No conversions are done when not using Unicode as everything is // supposed to be in 7 bit ASCII anyhow, this method is provided just // for compatibility with the Unicode build. return ToStdString(); } #else // wxStringImpl is either not std::string or needs conversion #define wxStringToStdStringRetType std::string std::string ToStdString(const wxMBConv& conv = wxConvLibc) const { wxScopedCharBuffer buf(mb_str(conv)); return std::string(buf.data(), buf.length()); } #endif #if wxUSE_STD_STRING_CONV_IN_WXSTRING // Implicit conversions to std::[w]string are not provided by default as // they conflict with the implicit conversions to "const char/wchar_t *" // which we use for backwards compatibility but do provide them if // explicitly requested. #if wxUSE_UNSAFE_WXSTRING_CONV && !defined(wxNO_UNSAFE_WXSTRING_CONV) operator wxStringToStdStringRetType() const { return ToStdString(); } #endif // wxUSE_UNSAFE_WXSTRING_CONV operator wxStringToStdWstringRetType() const { return ToStdWstring(); } #endif // wxUSE_STD_STRING_CONV_IN_WXSTRING #undef wxStringToStdStringRetType #undef wxStringToStdWstringRetType #endif // wxUSE_STD_STRING wxString Clone() const { // make a deep copy of the string, i.e. the returned string will have // ref count = 1 with refcounted implementation return wxString::FromImpl(wxStringImpl(m_impl.c_str(), m_impl.length())); } // first valid index position const_iterator begin() const { return const_iterator(this, m_impl.begin()); } iterator begin() { return iterator(this, m_impl.begin()); } const_iterator cbegin() const { return const_iterator(this, m_impl.begin()); } // position one after the last valid one const_iterator end() const { return const_iterator(this, m_impl.end()); } iterator end() { return iterator(this, m_impl.end()); } const_iterator cend() const { return const_iterator(this, m_impl.end()); } // first element of the reversed string const_reverse_iterator rbegin() const { return const_reverse_iterator(end()); } reverse_iterator rbegin() { return reverse_iterator(end()); } const_reverse_iterator crbegin() const { return const_reverse_iterator(end()); } // one beyond the end of the reversed string const_reverse_iterator rend() const { return const_reverse_iterator(begin()); } reverse_iterator rend() { return reverse_iterator(begin()); } const_reverse_iterator crend() const { return const_reverse_iterator(begin()); } // std::string methods: #if wxUSE_UNICODE_UTF8 size_t length() const { #if wxUSE_STRING_POS_CACHE wxCACHE_PROFILE_FIELD_INC(lentot); Cache::Element * const cache = GetCacheElement(); if ( cache->len == npos ) { // it's probably not worth trying to be clever and using cache->pos // here as it's probably 0 anyhow -- you usually call length() before // starting to index the string cache->len = end() - begin(); } else { wxCACHE_PROFILE_FIELD_INC(lenhits); wxSTRING_CACHE_ASSERT( (int)cache->len == end() - begin() ); } return cache->len; #else // !wxUSE_STRING_POS_CACHE return end() - begin(); #endif // wxUSE_STRING_POS_CACHE/!wxUSE_STRING_POS_CACHE } #else size_t length() const { return m_impl.length(); } #endif size_type size() const { return length(); } size_type max_size() const { return npos; } bool empty() const { return m_impl.empty(); } // NB: these methods don't have a well-defined meaning in UTF-8 case size_type capacity() const { return m_impl.capacity(); } void reserve(size_t sz) { m_impl.reserve(sz); } void resize(size_t nSize, wxUniChar ch = wxT('\0')) { const size_t len = length(); if ( nSize == len) return; #if wxUSE_UNICODE_UTF8 if ( nSize < len ) { wxSTRING_INVALIDATE_CACHE(); // we can't use wxStringImpl::resize() for truncating the string as it // counts in bytes, not characters erase(nSize); return; } // we also can't use (presumably more efficient) resize() if we have to // append characters taking more than one byte if ( !ch.IsAscii() ) { append(nSize - len, ch); } else // can use (presumably faster) resize() version #endif // wxUSE_UNICODE_UTF8 { wxSTRING_INVALIDATE_CACHED_LENGTH(); m_impl.resize(nSize, (wxStringCharType)ch); } } wxString substr(size_t nStart = 0, size_t nLen = npos) const { size_t pos, len; PosLenToImpl(nStart, nLen, &pos, &len); return FromImpl(m_impl.substr(pos, len)); } // generic attributes & operations // as standard strlen() size_t Len() const { return length(); } // string contains any characters? bool IsEmpty() const { return empty(); } // empty string is "false", so !str will return true bool operator!() const { return empty(); } // truncate the string to given length wxString& Truncate(size_t uiLen); // empty string contents void Empty() { clear(); } // empty the string and free memory void Clear() { clear(); } // contents test // Is an ascii value bool IsAscii() const; // Is a number bool IsNumber() const; // Is a word bool IsWord() const; // data access (all indexes are 0 based) // read access wxUniChar at(size_t n) const { return wxStringOperations::DecodeChar(m_impl.begin() + PosToImpl(n)); } wxUniChar GetChar(size_t n) const { return at(n); } // read/write access wxUniCharRef at(size_t n) { return *GetIterForNthChar(n); } wxUniCharRef GetWritableChar(size_t n) { return at(n); } // write access void SetChar(size_t n, wxUniChar ch) { at(n) = ch; } // get last character wxUniChar Last() const { wxASSERT_MSG( !empty(), wxT("wxString: index out of bounds") ); return *rbegin(); } // get writable last character wxUniCharRef Last() { wxASSERT_MSG( !empty(), wxT("wxString: index out of bounds") ); return *rbegin(); } /* Note that we we must define all of the overloads below to avoid ambiguity when using str[0]. */ wxUniChar operator[](int n) const { return at(n); } wxUniChar operator[](long n) const { return at(n); } wxUniChar operator[](size_t n) const { return at(n); } #ifndef wxSIZE_T_IS_UINT wxUniChar operator[](unsigned int n) const { return at(n); } #endif // size_t != unsigned int // operator versions of GetWriteableChar() wxUniCharRef operator[](int n) { return at(n); } wxUniCharRef operator[](long n) { return at(n); } wxUniCharRef operator[](size_t n) { return at(n); } #ifndef wxSIZE_T_IS_UINT wxUniCharRef operator[](unsigned int n) { return at(n); } #endif // size_t != unsigned int /* Overview of wxString conversions, implicit and explicit: - wxString has a std::[w]string-like c_str() method, however it does not return a C-style string directly but instead returns wxCStrData helper object which is convertible to either "char *" narrow string or "wchar_t *" wide string. Usually the correct conversion will be applied by the compiler automatically but if this doesn't happen you need to explicitly choose one using wxCStrData::AsChar() or AsWChar() methods or another wxString conversion function. - One of the places where the conversion does *NOT* happen correctly is when c_str() is passed to a vararg function such as printf() so you must *NOT* use c_str() with them. Either use wxPrintf() (all wx functions do handle c_str() correctly, even if they appear to be vararg (but they're not, really)) or add an explicit AsChar() or, if compatibility with previous wxWidgets versions is important, add a cast to "const char *". - In non-STL mode only, wxString is also implicitly convertible to wxCStrData. The same warning as above applies. - c_str() is polymorphic as it can be converted to either narrow or wide string. If you explicitly need one or the other, choose to use mb_str() (for narrow) or wc_str() (for wide) instead. Notice that these functions can return either the pointer to string directly (if this is what the string uses internally) or a temporary buffer containing the string and convertible to it. Again, conversion will usually be done automatically by the compiler but beware of the vararg functions: you need an explicit cast when using them. - There are also non-const versions of mb_str() and wc_str() called char_str() and wchar_str(). They are only meant to be used with non-const-correct functions and they always return buffers. - Finally wx_str() returns whatever string representation is used by wxString internally. It may be either a narrow or wide string depending on wxWidgets build mode but it will always be a raw pointer (and not a buffer). */ // explicit conversion to wxCStrData wxCStrData c_str() const { return wxCStrData(this); } wxCStrData data() const { return c_str(); } // implicit conversion to wxCStrData operator wxCStrData() const { return c_str(); } // the first two operators conflict with operators for conversion to // std::string and they must be disabled if those conversions are enabled; // the next one only makes sense if conversions to char* are also defined // and not defining it in STL build also helps us to get more clear error // messages for the code which relies on implicit conversion to char* in // STL build #if !wxUSE_STD_STRING_CONV_IN_WXSTRING operator const wchar_t*() const { return c_str(); } #if wxUSE_UNSAFE_WXSTRING_CONV && !defined(wxNO_UNSAFE_WXSTRING_CONV) operator const char*() const { return c_str(); } // implicit conversion to untyped pointer for compatibility with previous // wxWidgets versions: this is the same as conversion to const char * so it // may fail! operator const void*() const { return c_str(); } #endif // wxUSE_UNSAFE_WXSTRING_CONV && !defined(wxNO_UNSAFE_WXSTRING_CONV) #endif // !wxUSE_STD_STRING_CONV_IN_WXSTRING // identical to c_str(), for MFC compatibility const wxCStrData GetData() const { return c_str(); } // explicit conversion to C string in internal representation (char*, // wchar_t*, UTF-8-encoded char*, depending on the build): const wxStringCharType *wx_str() const { return m_impl.c_str(); } // conversion to *non-const* multibyte or widestring buffer; modifying // returned buffer won't affect the string, these methods are only useful // for passing values to const-incorrect functions wxWritableCharBuffer char_str(const wxMBConv& conv = wxConvLibc) const { return mb_str(conv); } wxWritableWCharBuffer wchar_str() const { return wc_str(); } // conversion to the buffer of the given type T (= char or wchar_t) and // also optionally return the buffer length // // this is mostly/only useful for the template functions template <typename T> wxCharTypeBuffer<T> tchar_str(size_t *len = NULL) const { #if wxUSE_UNICODE // we need a helper dispatcher depending on type return wxPrivate::wxStringAsBufHelper<T>::Get(*this, len); #else // ANSI // T can only be char in ANSI build if ( len ) *len = length(); return wxCharTypeBuffer<T>::CreateNonOwned(wx_str(), length()); #endif // Unicode build kind } // conversion to/from plain (i.e. 7 bit) ASCII: this is useful for // converting numbers or strings which are certain not to contain special // chars (typically system functions, X atoms, environment variables etc.) // // the behaviour of these functions with the strings containing anything // else than 7 bit ASCII characters is undefined, use at your own risk. #if wxUSE_UNICODE static wxString FromAscii(const char *ascii, size_t len); static wxString FromAscii(const char *ascii); static wxString FromAscii(char ascii); const wxScopedCharBuffer ToAscii(char replaceWith = '_') const; #else // ANSI static wxString FromAscii(const char *ascii) { return wxString( ascii ); } static wxString FromAscii(const char *ascii, size_t len) { return wxString( ascii, len ); } static wxString FromAscii(char ascii) { return wxString( ascii ); } const char *ToAscii(char WXUNUSED(replaceWith) = '_') const { return c_str(); } #endif // Unicode/!Unicode // also provide unsigned char overloads as signed/unsigned doesn't matter // for 7 bit ASCII characters static wxString FromAscii(const unsigned char *ascii) { return FromAscii((const char *)ascii); } static wxString FromAscii(const unsigned char *ascii, size_t len) { return FromAscii((const char *)ascii, len); } // conversion to/from UTF-8: #if wxUSE_UNICODE_UTF8 static wxString FromUTF8Unchecked(const char *utf8) { if ( !utf8 ) return wxEmptyString; wxASSERT( wxStringOperations::IsValidUtf8String(utf8) ); return FromImpl(wxStringImpl(utf8)); } static wxString FromUTF8Unchecked(const char *utf8, size_t len) { if ( !utf8 ) return wxEmptyString; if ( len == npos ) return FromUTF8Unchecked(utf8); wxASSERT( wxStringOperations::IsValidUtf8String(utf8, len) ); return FromImpl(wxStringImpl(utf8, len)); } static wxString FromUTF8(const char *utf8) { if ( !utf8 || !wxStringOperations::IsValidUtf8String(utf8) ) return wxString(); return FromImpl(wxStringImpl(utf8)); } static wxString FromUTF8(const char *utf8, size_t len) { if ( len == npos ) return FromUTF8(utf8); if ( !utf8 || !wxStringOperations::IsValidUtf8String(utf8, len) ) return wxString(); return FromImpl(wxStringImpl(utf8, len)); } #if wxUSE_STD_STRING static wxString FromUTF8Unchecked(const std::string& utf8) { wxASSERT( wxStringOperations::IsValidUtf8String(utf8.c_str(), utf8.length()) ); /* Note that, under wxUSE_UNICODE_UTF8 and wxUSE_STD_STRING, wxStringImpl can be initialized with a std::string whether wxUSE_STL_BASED_WXSTRING is 1 or not. */ return FromImpl(utf8); } static wxString FromUTF8(const std::string& utf8) { if ( utf8.empty() || !wxStringOperations::IsValidUtf8String(utf8.c_str(), utf8.length()) ) return wxString(); return FromImpl(utf8); } #endif const wxScopedCharBuffer utf8_str() const { return wxCharBuffer::CreateNonOwned(m_impl.c_str(), m_impl.length()); } // this function exists in UTF-8 build only and returns the length of the // internal UTF-8 representation size_t utf8_length() const { return m_impl.length(); } #elif wxUSE_UNICODE_WCHAR static wxString FromUTF8(const char *utf8, size_t len = npos) { return wxString(utf8, wxMBConvUTF8(), len); } static wxString FromUTF8Unchecked(const char *utf8, size_t len = npos) { const wxString s(utf8, wxMBConvUTF8(), len); wxASSERT_MSG( !utf8 || !*utf8 || !s.empty(), "string must be valid UTF-8" ); return s; } #if wxUSE_STD_STRING static wxString FromUTF8(const std::string& utf8) { return FromUTF8(utf8.c_str(), utf8.length()); } static wxString FromUTF8Unchecked(const std::string& utf8) { return FromUTF8Unchecked(utf8.c_str(), utf8.length()); } #endif const wxScopedCharBuffer utf8_str() const { return mb_str(wxMBConvUTF8()); } #else // ANSI static wxString FromUTF8(const char *utf8) { return wxString(wxMBConvUTF8().cMB2WC(utf8)); } static wxString FromUTF8(const char *utf8, size_t len) { size_t wlen; wxScopedWCharBuffer buf(wxMBConvUTF8().cMB2WC(utf8, len == npos ? wxNO_LEN : len, &wlen)); return wxString(buf.data(), wlen); } static wxString FromUTF8Unchecked(const char *utf8, size_t len = npos) { size_t wlen; wxScopedWCharBuffer buf ( wxMBConvUTF8().cMB2WC ( utf8, len == npos ? wxNO_LEN : len, &wlen ) ); wxASSERT_MSG( !utf8 || !*utf8 || wlen, "string must be valid UTF-8" ); return wxString(buf.data(), wlen); } #if wxUSE_STD_STRING static wxString FromUTF8(const std::string& utf8) { return FromUTF8(utf8.c_str(), utf8.length()); } static wxString FromUTF8Unchecked(const std::string& utf8) { return FromUTF8Unchecked(utf8.c_str(), utf8.length()); } #endif const wxScopedCharBuffer utf8_str() const { return wxMBConvUTF8().cWC2MB(wc_str()); } #endif const wxScopedCharBuffer ToUTF8() const { return utf8_str(); } // functions for storing binary data in wxString: #if wxUSE_UNICODE static wxString From8BitData(const char *data, size_t len) { return wxString(data, wxConvISO8859_1, len); } // version for NUL-terminated data: static wxString From8BitData(const char *data) { return wxString(data, wxConvISO8859_1); } const wxScopedCharBuffer To8BitData() const { return mb_str(wxConvISO8859_1); } #else // ANSI static wxString From8BitData(const char *data, size_t len) { return wxString(data, len); } // version for NUL-terminated data: static wxString From8BitData(const char *data) { return wxString(data); } const wxScopedCharBuffer To8BitData() const { return wxScopedCharBuffer::CreateNonOwned(wx_str(), length()); } #endif // Unicode/ANSI // conversions with (possible) format conversions: have to return a // buffer with temporary data // // the functions defined (in either Unicode or ANSI) mode are mb_str() to // return an ANSI (multibyte) string, wc_str() to return a wide string and // fn_str() to return a string which should be used with the OS APIs // accepting the file names. The return value is always the same, but the // type differs because a function may either return pointer to the buffer // directly or have to use intermediate buffer for translation. #if wxUSE_UNICODE // this is an optimization: even though using mb_str(wxConvLibc) does the // same thing (i.e. returns pointer to internal representation as locale is // always an UTF-8 one) in wxUSE_UTF8_LOCALE_ONLY case, we can avoid the // extra checks and the temporary buffer construction by providing a // separate mb_str() overload #if wxUSE_UTF8_LOCALE_ONLY const char* mb_str() const { return wx_str(); } const wxScopedCharBuffer mb_str(const wxMBConv& conv) const { return AsCharBuf(conv); } #else // !wxUSE_UTF8_LOCALE_ONLY const wxScopedCharBuffer mb_str(const wxMBConv& conv = wxConvLibc) const { return AsCharBuf(conv); } #endif // wxUSE_UTF8_LOCALE_ONLY/!wxUSE_UTF8_LOCALE_ONLY const wxWX2MBbuf mbc_str() const { return mb_str(*wxConvCurrent); } #if wxUSE_UNICODE_WCHAR const wchar_t* wc_str() const { return wx_str(); } #elif wxUSE_UNICODE_UTF8 const wxScopedWCharBuffer wc_str() const { return AsWCharBuf(wxMBConvStrictUTF8()); } #endif // for compatibility with !wxUSE_UNICODE version const wxWX2WCbuf wc_str(const wxMBConv& WXUNUSED(conv)) const { return wc_str(); } #if wxMBFILES const wxScopedCharBuffer fn_str() const { return mb_str(wxConvFile); } #else // !wxMBFILES const wxWX2WCbuf fn_str() const { return wc_str(); } #endif // wxMBFILES/!wxMBFILES #else // ANSI const char* mb_str() const { return wx_str(); } // for compatibility with wxUSE_UNICODE version const char* mb_str(const wxMBConv& WXUNUSED(conv)) const { return wx_str(); } const wxWX2MBbuf mbc_str() const { return mb_str(); } const wxScopedWCharBuffer wc_str(const wxMBConv& conv = wxConvLibc) const { return AsWCharBuf(conv); } const wxScopedCharBuffer fn_str() const { return wxConvFile.cWC2WX( wc_str( wxConvLibc ) ); } #endif // Unicode/ANSI #if wxUSE_UNICODE_UTF8 const wxScopedWCharBuffer t_str() const { return wc_str(); } #elif wxUSE_UNICODE_WCHAR const wchar_t* t_str() const { return wx_str(); } #else const char* t_str() const { return wx_str(); } #endif // overloaded assignment // from another wxString wxString& operator=(const wxString& stringSrc) { if ( this != &stringSrc ) { wxSTRING_INVALIDATE_CACHE(); m_impl = stringSrc.m_impl; } return *this; } wxString& operator=(const wxCStrData& cstr) { return *this = cstr.AsString(); } // from a character wxString& operator=(wxUniChar ch) { wxSTRING_INVALIDATE_CACHE(); if ( wxStringOperations::IsSingleCodeUnitCharacter(ch) ) m_impl = (wxStringCharType)ch; else m_impl = wxStringOperations::EncodeChar(ch); return *this; } wxString& operator=(wxUniCharRef ch) { return operator=((wxUniChar)ch); } wxString& operator=(char ch) { return operator=(wxUniChar(ch)); } wxString& operator=(unsigned char ch) { return operator=(wxUniChar(ch)); } wxString& operator=(wchar_t ch) { return operator=(wxUniChar(ch)); } // from a C string - STL probably will crash on NULL, // so we need to compensate in that case #if wxUSE_STL_BASED_WXSTRING wxString& operator=(const char *psz) { wxSTRING_INVALIDATE_CACHE(); if ( psz ) m_impl = ImplStr(psz); else clear(); return *this; } wxString& operator=(const wchar_t *pwz) { wxSTRING_INVALIDATE_CACHE(); if ( pwz ) m_impl = ImplStr(pwz); else clear(); return *this; } #else // !wxUSE_STL_BASED_WXSTRING wxString& operator=(const char *psz) { wxSTRING_INVALIDATE_CACHE(); m_impl = ImplStr(psz); return *this; } wxString& operator=(const wchar_t *pwz) { wxSTRING_INVALIDATE_CACHE(); m_impl = ImplStr(pwz); return *this; } #endif // wxUSE_STL_BASED_WXSTRING/!wxUSE_STL_BASED_WXSTRING wxString& operator=(const unsigned char *psz) { return operator=((const char*)psz); } // from wxScopedWCharBuffer wxString& operator=(const wxScopedWCharBuffer& s) { return assign(s); } // from wxScopedCharBuffer wxString& operator=(const wxScopedCharBuffer& s) { return assign(s); } // string concatenation // in place concatenation /* Concatenate and return the result. Note that the left to right associativity of << allows to write things like "str << str1 << str2 << ..." (unlike with +=) */ // string += string wxString& operator<<(const wxString& s) { #if WXWIN_COMPATIBILITY_2_8 && !wxUSE_STL_BASED_WXSTRING && !wxUSE_UNICODE_UTF8 wxASSERT_MSG( s.IsValid(), wxT("did you forget to call UngetWriteBuf()?") ); #endif append(s); return *this; } // string += C string wxString& operator<<(const char *psz) { append(psz); return *this; } wxString& operator<<(const wchar_t *pwz) { append(pwz); return *this; } wxString& operator<<(const wxCStrData& psz) { append(psz.AsString()); return *this; } // string += char wxString& operator<<(wxUniChar ch) { append(1, ch); return *this; } wxString& operator<<(wxUniCharRef ch) { append(1, ch); return *this; } wxString& operator<<(char ch) { append(1, ch); return *this; } wxString& operator<<(unsigned char ch) { append(1, ch); return *this; } wxString& operator<<(wchar_t ch) { append(1, ch); return *this; } // string += buffer (i.e. from wxGetString) wxString& operator<<(const wxScopedWCharBuffer& s) { return append(s); } wxString& operator<<(const wxScopedCharBuffer& s) { return append(s); } // string += C string wxString& Append(const wxString& s) { // test for empty() to share the string if possible if ( empty() ) *this = s; else append(s); return *this; } wxString& Append(const char* psz) { append(psz); return *this; } wxString& Append(const wchar_t* pwz) { append(pwz); return *this; } wxString& Append(const wxCStrData& psz) { append(psz); return *this; } wxString& Append(const wxScopedCharBuffer& psz) { append(psz); return *this; } wxString& Append(const wxScopedWCharBuffer& psz) { append(psz); return *this; } wxString& Append(const char* psz, size_t nLen) { append(psz, nLen); return *this; } wxString& Append(const wchar_t* pwz, size_t nLen) { append(pwz, nLen); return *this; } wxString& Append(const wxCStrData& psz, size_t nLen) { append(psz, nLen); return *this; } wxString& Append(const wxScopedCharBuffer& psz, size_t nLen) { append(psz, nLen); return *this; } wxString& Append(const wxScopedWCharBuffer& psz, size_t nLen) { append(psz, nLen); return *this; } // append count copies of given character wxString& Append(wxUniChar ch, size_t count = 1u) { append(count, ch); return *this; } wxString& Append(wxUniCharRef ch, size_t count = 1u) { append(count, ch); return *this; } wxString& Append(char ch, size_t count = 1u) { append(count, ch); return *this; } wxString& Append(unsigned char ch, size_t count = 1u) { append(count, ch); return *this; } wxString& Append(wchar_t ch, size_t count = 1u) { append(count, ch); return *this; } // prepend a string, return the string itself wxString& Prepend(const wxString& str) { *this = str + *this; return *this; } // non-destructive concatenation // two strings friend wxString WXDLLIMPEXP_BASE operator+(const wxString& string1, const wxString& string2); // string with a single char friend wxString WXDLLIMPEXP_BASE operator+(const wxString& string, wxUniChar ch); // char with a string friend wxString WXDLLIMPEXP_BASE operator+(wxUniChar ch, const wxString& string); // string with C string friend wxString WXDLLIMPEXP_BASE operator+(const wxString& string, const char *psz); friend wxString WXDLLIMPEXP_BASE operator+(const wxString& string, const wchar_t *pwz); // C string with string friend wxString WXDLLIMPEXP_BASE operator+(const char *psz, const wxString& string); friend wxString WXDLLIMPEXP_BASE operator+(const wchar_t *pwz, const wxString& string); // stream-like functions // insert an int into string wxString& operator<<(int i) { return (*this) << Format(wxT("%d"), i); } // insert an unsigned int into string wxString& operator<<(unsigned int ui) { return (*this) << Format(wxT("%u"), ui); } // insert a long into string wxString& operator<<(long l) { return (*this) << Format(wxT("%ld"), l); } // insert an unsigned long into string wxString& operator<<(unsigned long ul) { return (*this) << Format(wxT("%lu"), ul); } #ifdef wxHAS_LONG_LONG_T_DIFFERENT_FROM_LONG // insert a long long if they exist and aren't longs wxString& operator<<(wxLongLong_t ll) { return (*this) << Format("%" wxLongLongFmtSpec "d", ll); } // insert an unsigned long long wxString& operator<<(wxULongLong_t ull) { return (*this) << Format("%" wxLongLongFmtSpec "u" , ull); } #endif // wxHAS_LONG_LONG_T_DIFFERENT_FROM_LONG // insert a float into string wxString& operator<<(float f) { return (*this) << Format(wxT("%f"), f); } // insert a double into string wxString& operator<<(double d) { return (*this) << Format(wxT("%g"), d); } // string comparison // case-sensitive comparison (returns a value < 0, = 0 or > 0) int Cmp(const char *psz) const { return compare(psz); } int Cmp(const wchar_t *pwz) const { return compare(pwz); } int Cmp(const wxString& s) const { return compare(s); } int Cmp(const wxCStrData& s) const { return compare(s); } int Cmp(const wxScopedCharBuffer& s) const { return compare(s); } int Cmp(const wxScopedWCharBuffer& s) const { return compare(s); } // same as Cmp() but not case-sensitive int CmpNoCase(const wxString& s) const; // test for the string equality, either considering case or not // (if compareWithCase then the case matters) bool IsSameAs(const wxString& str, bool compareWithCase = true) const { #if !wxUSE_UNICODE_UTF8 // in UTF-8 build, length() is O(n) and doing this would be _slower_ if ( length() != str.length() ) return false; #endif return (compareWithCase ? Cmp(str) : CmpNoCase(str)) == 0; } bool IsSameAs(const char *str, bool compareWithCase = true) const { return (compareWithCase ? Cmp(str) : CmpNoCase(str)) == 0; } bool IsSameAs(const wchar_t *str, bool compareWithCase = true) const { return (compareWithCase ? Cmp(str) : CmpNoCase(str)) == 0; } bool IsSameAs(const wxCStrData& str, bool compareWithCase = true) const { return IsSameAs(str.AsString(), compareWithCase); } bool IsSameAs(const wxScopedCharBuffer& str, bool compareWithCase = true) const { return IsSameAs(str.data(), compareWithCase); } bool IsSameAs(const wxScopedWCharBuffer& str, bool compareWithCase = true) const { return IsSameAs(str.data(), compareWithCase); } // comparison with a single character: returns true if equal bool IsSameAs(wxUniChar c, bool compareWithCase = true) const; // FIXME-UTF8: remove these overloads bool IsSameAs(wxUniCharRef c, bool compareWithCase = true) const { return IsSameAs(wxUniChar(c), compareWithCase); } bool IsSameAs(char c, bool compareWithCase = true) const { return IsSameAs(wxUniChar(c), compareWithCase); } bool IsSameAs(unsigned char c, bool compareWithCase = true) const { return IsSameAs(wxUniChar(c), compareWithCase); } bool IsSameAs(wchar_t c, bool compareWithCase = true) const { return IsSameAs(wxUniChar(c), compareWithCase); } bool IsSameAs(int c, bool compareWithCase = true) const { return IsSameAs(wxUniChar(c), compareWithCase); } // simple sub-string extraction // return substring starting at nFirst of length nCount (or till the end // if nCount = default value) wxString Mid(size_t nFirst, size_t nCount = npos) const; // operator version of Mid() wxString operator()(size_t start, size_t len) const { return Mid(start, len); } // check if the string starts with the given prefix and return the rest // of the string in the provided pointer if it is not NULL; otherwise // return false bool StartsWith(const wxString& prefix, wxString *rest = NULL) const; // check if the string ends with the given suffix and return the // beginning of the string before the suffix in the provided pointer if // it is not NULL; otherwise return false bool EndsWith(const wxString& suffix, wxString *rest = NULL) const; // get first nCount characters wxString Left(size_t nCount) const; // get last nCount characters wxString Right(size_t nCount) const; // get all characters before the first occurrence of ch // (returns the whole string if ch not found) and also put everything // following the first occurrence of ch into rest if it's non-NULL wxString BeforeFirst(wxUniChar ch, wxString *rest = NULL) const; // get all characters before the last occurrence of ch // (returns empty string if ch not found) and also put everything // following the last occurrence of ch into rest if it's non-NULL wxString BeforeLast(wxUniChar ch, wxString *rest = NULL) const; // get all characters after the first occurrence of ch // (returns empty string if ch not found) wxString AfterFirst(wxUniChar ch) const; // get all characters after the last occurrence of ch // (returns the whole string if ch not found) wxString AfterLast(wxUniChar ch) const; // for compatibility only, use more explicitly named functions above wxString Before(wxUniChar ch) const { return BeforeLast(ch); } wxString After(wxUniChar ch) const { return AfterFirst(ch); } // case conversion // convert to upper case in place, return the string itself wxString& MakeUpper(); // convert to upper case, return the copy of the string wxString Upper() const { return wxString(*this).MakeUpper(); } // convert to lower case in place, return the string itself wxString& MakeLower(); // convert to lower case, return the copy of the string wxString Lower() const { return wxString(*this).MakeLower(); } // convert the first character to the upper case and the rest to the // lower one, return the modified string itself wxString& MakeCapitalized(); // convert the first character to the upper case and the rest to the // lower one, return the copy of the string wxString Capitalize() const { return wxString(*this).MakeCapitalized(); } // trimming/padding whitespace (either side) and truncating // remove spaces from left or from right (default) side wxString& Trim(bool bFromRight = true); // add nCount copies chPad in the beginning or at the end (default) wxString& Pad(size_t nCount, wxUniChar chPad = wxT(' '), bool bFromRight = true); // searching and replacing // searching (return starting index, or -1 if not found) int Find(wxUniChar ch, bool bFromEnd = false) const; // like strchr/strrchr int Find(wxUniCharRef ch, bool bFromEnd = false) const { return Find(wxUniChar(ch), bFromEnd); } int Find(char ch, bool bFromEnd = false) const { return Find(wxUniChar(ch), bFromEnd); } int Find(unsigned char ch, bool bFromEnd = false) const { return Find(wxUniChar(ch), bFromEnd); } int Find(wchar_t ch, bool bFromEnd = false) const { return Find(wxUniChar(ch), bFromEnd); } // searching (return starting index, or -1 if not found) int Find(const wxString& sub) const // like strstr { const size_type idx = find(sub); return (idx == npos) ? wxNOT_FOUND : (int)idx; } int Find(const char *sub) const // like strstr { const size_type idx = find(sub); return (idx == npos) ? wxNOT_FOUND : (int)idx; } int Find(const wchar_t *sub) const // like strstr { const size_type idx = find(sub); return (idx == npos) ? wxNOT_FOUND : (int)idx; } int Find(const wxCStrData& sub) const { return Find(sub.AsString()); } int Find(const wxScopedCharBuffer& sub) const { return Find(sub.data()); } int Find(const wxScopedWCharBuffer& sub) const { return Find(sub.data()); } // replace first (or all of bReplaceAll) occurrences of substring with // another string, returns the number of replacements made size_t Replace(const wxString& strOld, const wxString& strNew, bool bReplaceAll = true); // check if the string contents matches a mask containing '*' and '?' bool Matches(const wxString& mask) const; // conversion to numbers: all functions return true only if the whole // string is a number and put the value of this number into the pointer // provided, the base is the numeric base in which the conversion should be // done and must be comprised between 2 and 36 or be 0 in which case the // standard C rules apply (leading '0' => octal, "0x" => hex) // convert to a signed integer bool ToLong(long *val, int base = 10) const; // convert to an unsigned integer bool ToULong(unsigned long *val, int base = 10) const; // convert to wxLongLong #if defined(wxLongLong_t) bool ToLongLong(wxLongLong_t *val, int base = 10) const; // convert to wxULongLong bool ToULongLong(wxULongLong_t *val, int base = 10) const; #endif // wxLongLong_t // convert to a double bool ToDouble(double *val) const; // conversions to numbers using C locale // convert to a signed integer bool ToCLong(long *val, int base = 10) const; // convert to an unsigned integer bool ToCULong(unsigned long *val, int base = 10) const; // convert to a double bool ToCDouble(double *val) const; // create a string representing the given floating point number with the // default (like %g) or fixed (if precision >=0) precision // in the current locale static wxString FromDouble(double val, int precision = -1); // in C locale static wxString FromCDouble(double val, int precision = -1); // formatted input/output // as sprintf(), returns the number of characters written or < 0 on error // (take 'this' into account in attribute parameter count) // int Printf(const wxString& format, ...); WX_DEFINE_VARARG_FUNC(int, Printf, 1, (const wxFormatString&), DoPrintfWchar, DoPrintfUtf8) // as vprintf(), returns the number of characters written or < 0 on error int PrintfV(const wxString& format, va_list argptr); // returns the string containing the result of Printf() to it // static wxString Format(const wxString& format, ...) WX_ATTRIBUTE_PRINTF_1; WX_DEFINE_VARARG_FUNC(static wxString, Format, 1, (const wxFormatString&), DoFormatWchar, DoFormatUtf8) // the same as above, but takes a va_list static wxString FormatV(const wxString& format, va_list argptr); // raw access to string memory // ensure that string has space for at least nLen characters // only works if the data of this string is not shared bool Alloc(size_t nLen) { reserve(nLen); return capacity() >= nLen; } // minimize the string's memory // only works if the data of this string is not shared bool Shrink(); #if WXWIN_COMPATIBILITY_2_8 && !wxUSE_STL_BASED_WXSTRING && !wxUSE_UNICODE_UTF8 // These are deprecated, use wxStringBuffer or wxStringBufferLength instead // // get writable buffer of at least nLen bytes. Unget() *must* be called // a.s.a.p. to put string back in a reasonable state! wxDEPRECATED( wxStringCharType *GetWriteBuf(size_t nLen) ); // call this immediately after GetWriteBuf() has been used wxDEPRECATED( void UngetWriteBuf() ); wxDEPRECATED( void UngetWriteBuf(size_t nLen) ); #endif // WXWIN_COMPATIBILITY_2_8 && !wxUSE_STL_BASED_WXSTRING && wxUSE_UNICODE_UTF8 // wxWidgets version 1 compatibility functions // use Mid() wxString SubString(size_t from, size_t to) const { return Mid(from, (to - from + 1)); } // values for second parameter of CompareTo function enum caseCompare {exact, ignoreCase}; // values for first parameter of Strip function enum stripType {leading = 0x1, trailing = 0x2, both = 0x3}; // use Printf() // (take 'this' into account in attribute parameter count) // int sprintf(const wxString& format, ...) WX_ATTRIBUTE_PRINTF_2; WX_DEFINE_VARARG_FUNC(int, sprintf, 1, (const wxFormatString&), DoPrintfWchar, DoPrintfUtf8) // use Cmp() int CompareTo(const wxChar* psz, caseCompare cmp = exact) const { return cmp == exact ? Cmp(psz) : CmpNoCase(psz); } // use length() size_t Length() const { return length(); } // Count the number of characters int Freq(wxUniChar ch) const; // use MakeLower void LowerCase() { MakeLower(); } // use MakeUpper void UpperCase() { MakeUpper(); } // use Trim except that it doesn't change this string wxString Strip(stripType w = trailing) const; // use Find (more general variants not yet supported) size_t Index(const wxChar* psz) const { return Find(psz); } size_t Index(wxUniChar ch) const { return Find(ch); } // use Truncate wxString& Remove(size_t pos) { return Truncate(pos); } wxString& RemoveLast(size_t n = 1) { return Truncate(length() - n); } wxString& Remove(size_t nStart, size_t nLen) { return (wxString&)erase( nStart, nLen ); } // use Find() int First( wxUniChar ch ) const { return Find(ch); } int First( wxUniCharRef ch ) const { return Find(ch); } int First( char ch ) const { return Find(ch); } int First( unsigned char ch ) const { return Find(ch); } int First( wchar_t ch ) const { return Find(ch); } int First( const wxString& str ) const { return Find(str); } int Last( wxUniChar ch ) const { return Find(ch, true); } bool Contains(const wxString& str) const { return Find(str) != wxNOT_FOUND; } // use empty() bool IsNull() const { return empty(); } // std::string compatibility functions // take nLen chars starting at nPos wxString(const wxString& str, size_t nPos, size_t nLen) { assign(str, nPos, nLen); } // take all characters from first to last wxString(const_iterator first, const_iterator last) : m_impl(first.impl(), last.impl()) { } #if WXWIN_COMPATIBILITY_STRING_PTR_AS_ITER // the 2 overloads below are for compatibility with the existing code using // pointers instead of iterators wxString(const char *first, const char *last) { SubstrBufFromMB str(ImplStr(first, last - first)); m_impl.assign(str.data, str.len); } wxString(const wchar_t *first, const wchar_t *last) { SubstrBufFromWC str(ImplStr(first, last - first)); m_impl.assign(str.data, str.len); } // and this one is needed to compile code adding offsets to c_str() result wxString(const wxCStrData& first, const wxCStrData& last) : m_impl(CreateConstIterator(first).impl(), CreateConstIterator(last).impl()) { wxASSERT_MSG( first.m_str == last.m_str, wxT("pointers must be into the same string") ); } #endif // WXWIN_COMPATIBILITY_STRING_PTR_AS_ITER // lib.string.modifiers // append elements str[pos], ..., str[pos+n] wxString& append(const wxString& str, size_t pos, size_t n) { wxSTRING_UPDATE_CACHED_LENGTH(n); size_t from, len; str.PosLenToImpl(pos, n, &from, &len); m_impl.append(str.m_impl, from, len); return *this; } // append a string wxString& append(const wxString& str) { wxSTRING_UPDATE_CACHED_LENGTH(str.length()); m_impl.append(str.m_impl); return *this; } // append first n (or all if n == npos) characters of sz wxString& append(const char *sz) { wxSTRING_INVALIDATE_CACHED_LENGTH(); m_impl.append(ImplStr(sz)); return *this; } wxString& append(const wchar_t *sz) { wxSTRING_INVALIDATE_CACHED_LENGTH(); m_impl.append(ImplStr(sz)); return *this; } wxString& append(const char *sz, size_t n) { wxSTRING_INVALIDATE_CACHED_LENGTH(); SubstrBufFromMB str(ImplStr(sz, n)); m_impl.append(str.data, str.len); return *this; } wxString& append(const wchar_t *sz, size_t n) { wxSTRING_UPDATE_CACHED_LENGTH(n); SubstrBufFromWC str(ImplStr(sz, n)); m_impl.append(str.data, str.len); return *this; } wxString& append(const wxCStrData& str) { return append(str.AsString()); } wxString& append(const wxScopedCharBuffer& str) { return append(str.data(), str.length()); } wxString& append(const wxScopedWCharBuffer& str) { return append(str.data(), str.length()); } wxString& append(const wxCStrData& str, size_t n) { return append(str.AsString(), 0, n); } wxString& append(const wxScopedCharBuffer& str, size_t n) { return append(str.data(), n); } wxString& append(const wxScopedWCharBuffer& str, size_t n) { return append(str.data(), n); } // append n copies of ch wxString& append(size_t n, wxUniChar ch) { if ( wxStringOperations::IsSingleCodeUnitCharacter(ch) ) { wxSTRING_UPDATE_CACHED_LENGTH(n); m_impl.append(n, (wxStringCharType)ch); } else { wxSTRING_INVALIDATE_CACHED_LENGTH(); m_impl.append(wxStringOperations::EncodeNChars(n, ch)); } return *this; } wxString& append(size_t n, wxUniCharRef ch) { return append(n, wxUniChar(ch)); } wxString& append(size_t n, char ch) { return append(n, wxUniChar(ch)); } wxString& append(size_t n, unsigned char ch) { return append(n, wxUniChar(ch)); } wxString& append(size_t n, wchar_t ch) { return append(n, wxUniChar(ch)); } // append from first to last wxString& append(const_iterator first, const_iterator last) { wxSTRING_INVALIDATE_CACHED_LENGTH(); m_impl.append(first.impl(), last.impl()); return *this; } #if WXWIN_COMPATIBILITY_STRING_PTR_AS_ITER wxString& append(const char *first, const char *last) { return append(first, last - first); } wxString& append(const wchar_t *first, const wchar_t *last) { return append(first, last - first); } wxString& append(const wxCStrData& first, const wxCStrData& last) { return append(CreateConstIterator(first), CreateConstIterator(last)); } #endif // WXWIN_COMPATIBILITY_STRING_PTR_AS_ITER // same as `this_string = str' wxString& assign(const wxString& str) { wxSTRING_SET_CACHED_LENGTH(str.length()); m_impl = str.m_impl; return *this; } // This is a non-standard-compliant overload taking the first "len" // characters of the source string. wxString& assign(const wxString& str, size_t len) { #if wxUSE_STRING_POS_CACHE // It is legal to pass len > str.length() to wxStringImpl::assign() but // by restricting it here we save some work for that function so it's not // really less efficient and, at the same time, ensure that we don't // cache invalid length. const size_t lenSrc = str.length(); if ( len > lenSrc ) len = lenSrc; wxSTRING_SET_CACHED_LENGTH(len); #endif // wxUSE_STRING_POS_CACHE m_impl.assign(str.m_impl, 0, str.LenToImpl(len)); return *this; } // same as ` = str[pos..pos + n] wxString& assign(const wxString& str, size_t pos, size_t n) { size_t from, len; str.PosLenToImpl(pos, n, &from, &len); m_impl.assign(str.m_impl, from, len); // it's important to call this after PosLenToImpl() above in case str is // the same string as this one wxSTRING_SET_CACHED_LENGTH(n); return *this; } // same as `= first n (or all if n == npos) characters of sz' wxString& assign(const char *sz) { wxSTRING_INVALIDATE_CACHE(); m_impl.assign(ImplStr(sz)); return *this; } wxString& assign(const wchar_t *sz) { wxSTRING_INVALIDATE_CACHE(); m_impl.assign(ImplStr(sz)); return *this; } wxString& assign(const char *sz, size_t n) { wxSTRING_INVALIDATE_CACHE(); SubstrBufFromMB str(ImplStr(sz, n)); m_impl.assign(str.data, str.len); return *this; } wxString& assign(const wchar_t *sz, size_t n) { wxSTRING_SET_CACHED_LENGTH(n); SubstrBufFromWC str(ImplStr(sz, n)); m_impl.assign(str.data, str.len); return *this; } wxString& assign(const wxCStrData& str) { return assign(str.AsString()); } wxString& assign(const wxScopedCharBuffer& str) { return assign(str.data(), str.length()); } wxString& assign(const wxScopedCharBuffer& buf, const wxMBConv& conv) { SubstrBufFromMB str(ImplStr(buf.data(), buf.length(), conv)); m_impl.assign(str.data, str.len); return *this; } wxString& assign(const wxScopedWCharBuffer& str) { return assign(str.data(), str.length()); } wxString& assign(const wxCStrData& str, size_t len) { return assign(str.AsString(), len); } wxString& assign(const wxScopedCharBuffer& str, size_t len) { return assign(str.data(), len); } wxString& assign(const wxScopedWCharBuffer& str, size_t len) { return assign(str.data(), len); } // same as `= n copies of ch' wxString& assign(size_t n, wxUniChar ch) { wxSTRING_SET_CACHED_LENGTH(n); if ( wxStringOperations::IsSingleCodeUnitCharacter(ch) ) m_impl.assign(n, (wxStringCharType)ch); else m_impl.assign(wxStringOperations::EncodeNChars(n, ch)); return *this; } wxString& assign(size_t n, wxUniCharRef ch) { return assign(n, wxUniChar(ch)); } wxString& assign(size_t n, char ch) { return assign(n, wxUniChar(ch)); } wxString& assign(size_t n, unsigned char ch) { return assign(n, wxUniChar(ch)); } wxString& assign(size_t n, wchar_t ch) { return assign(n, wxUniChar(ch)); } // assign from first to last wxString& assign(const_iterator first, const_iterator last) { wxSTRING_INVALIDATE_CACHE(); m_impl.assign(first.impl(), last.impl()); return *this; } #if WXWIN_COMPATIBILITY_STRING_PTR_AS_ITER wxString& assign(const char *first, const char *last) { return assign(first, last - first); } wxString& assign(const wchar_t *first, const wchar_t *last) { return assign(first, last - first); } wxString& assign(const wxCStrData& first, const wxCStrData& last) { return assign(CreateConstIterator(first), CreateConstIterator(last)); } #endif // WXWIN_COMPATIBILITY_STRING_PTR_AS_ITER // string comparison int compare(const wxString& str) const; int compare(const char* sz) const; int compare(const wchar_t* sz) const; int compare(const wxCStrData& str) const { return compare(str.AsString()); } int compare(const wxScopedCharBuffer& str) const { return compare(str.data()); } int compare(const wxScopedWCharBuffer& str) const { return compare(str.data()); } // comparison with a substring int compare(size_t nStart, size_t nLen, const wxString& str) const; // comparison of 2 substrings int compare(size_t nStart, size_t nLen, const wxString& str, size_t nStart2, size_t nLen2) const; // substring comparison with first nCount characters of sz int compare(size_t nStart, size_t nLen, const char* sz, size_t nCount = npos) const; int compare(size_t nStart, size_t nLen, const wchar_t* sz, size_t nCount = npos) const; // insert another string wxString& insert(size_t nPos, const wxString& str) { insert(GetIterForNthChar(nPos), str.begin(), str.end()); return *this; } // insert n chars of str starting at nStart (in str) wxString& insert(size_t nPos, const wxString& str, size_t nStart, size_t n) { wxSTRING_UPDATE_CACHED_LENGTH(n); size_t from, len; str.PosLenToImpl(nStart, n, &from, &len); m_impl.insert(PosToImpl(nPos), str.m_impl, from, len); return *this; } // insert first n (or all if n == npos) characters of sz wxString& insert(size_t nPos, const char *sz) { wxSTRING_INVALIDATE_CACHE(); m_impl.insert(PosToImpl(nPos), ImplStr(sz)); return *this; } wxString& insert(size_t nPos, const wchar_t *sz) { wxSTRING_INVALIDATE_CACHE(); m_impl.insert(PosToImpl(nPos), ImplStr(sz)); return *this; } wxString& insert(size_t nPos, const char *sz, size_t n) { wxSTRING_UPDATE_CACHED_LENGTH(n); SubstrBufFromMB str(ImplStr(sz, n)); m_impl.insert(PosToImpl(nPos), str.data, str.len); return *this; } wxString& insert(size_t nPos, const wchar_t *sz, size_t n) { wxSTRING_UPDATE_CACHED_LENGTH(n); SubstrBufFromWC str(ImplStr(sz, n)); m_impl.insert(PosToImpl(nPos), str.data, str.len); return *this; } // insert n copies of ch wxString& insert(size_t nPos, size_t n, wxUniChar ch) { wxSTRING_UPDATE_CACHED_LENGTH(n); if ( wxStringOperations::IsSingleCodeUnitCharacter(ch) ) m_impl.insert(PosToImpl(nPos), n, (wxStringCharType)ch); else m_impl.insert(PosToImpl(nPos), wxStringOperations::EncodeNChars(n, ch)); return *this; } iterator insert(iterator it, wxUniChar ch) { wxSTRING_UPDATE_CACHED_LENGTH(1); if ( wxStringOperations::IsSingleCodeUnitCharacter(ch) ) return iterator(this, m_impl.insert(it.impl(), (wxStringCharType)ch)); else { size_t pos = IterToImplPos(it); m_impl.insert(pos, wxStringOperations::EncodeChar(ch)); return iterator(this, m_impl.begin() + pos); } } void insert(iterator it, const_iterator first, const_iterator last) { wxSTRING_INVALIDATE_CACHE(); m_impl.insert(it.impl(), first.impl(), last.impl()); } #if WXWIN_COMPATIBILITY_STRING_PTR_AS_ITER void insert(iterator it, const char *first, const char *last) { insert(it - begin(), first, last - first); } void insert(iterator it, const wchar_t *first, const wchar_t *last) { insert(it - begin(), first, last - first); } void insert(iterator it, const wxCStrData& first, const wxCStrData& last) { insert(it, CreateConstIterator(first), CreateConstIterator(last)); } #endif // WXWIN_COMPATIBILITY_STRING_PTR_AS_ITER void insert(iterator it, size_type n, wxUniChar ch) { wxSTRING_UPDATE_CACHED_LENGTH(n); if ( wxStringOperations::IsSingleCodeUnitCharacter(ch) ) m_impl.insert(it.impl(), n, (wxStringCharType)ch); else m_impl.insert(IterToImplPos(it), wxStringOperations::EncodeNChars(n, ch)); } // delete characters from nStart to nStart + nLen wxString& erase(size_type pos = 0, size_type n = npos) { wxSTRING_INVALIDATE_CACHE(); size_t from, len; PosLenToImpl(pos, n, &from, &len); m_impl.erase(from, len); return *this; } // delete characters from first up to last iterator erase(iterator first, iterator last) { wxSTRING_INVALIDATE_CACHE(); return iterator(this, m_impl.erase(first.impl(), last.impl())); } iterator erase(iterator first) { wxSTRING_UPDATE_CACHED_LENGTH(-1); return iterator(this, m_impl.erase(first.impl())); } void clear() { wxSTRING_SET_CACHED_LENGTH(0); m_impl.clear(); } // replaces the substring of length nLen starting at nStart wxString& replace(size_t nStart, size_t nLen, const char* sz) { wxSTRING_INVALIDATE_CACHE(); size_t from, len; PosLenToImpl(nStart, nLen, &from, &len); m_impl.replace(from, len, ImplStr(sz)); return *this; } wxString& replace(size_t nStart, size_t nLen, const wchar_t* sz) { wxSTRING_INVALIDATE_CACHE(); size_t from, len; PosLenToImpl(nStart, nLen, &from, &len); m_impl.replace(from, len, ImplStr(sz)); return *this; } // replaces the substring of length nLen starting at nStart wxString& replace(size_t nStart, size_t nLen, const wxString& str) { wxSTRING_INVALIDATE_CACHE(); size_t from, len; PosLenToImpl(nStart, nLen, &from, &len); m_impl.replace(from, len, str.m_impl); return *this; } // replaces the substring with nCount copies of ch wxString& replace(size_t nStart, size_t nLen, size_t nCount, wxUniChar ch) { wxSTRING_INVALIDATE_CACHE(); size_t from, len; PosLenToImpl(nStart, nLen, &from, &len); if ( wxStringOperations::IsSingleCodeUnitCharacter(ch) ) m_impl.replace(from, len, nCount, (wxStringCharType)ch); else m_impl.replace(from, len, wxStringOperations::EncodeNChars(nCount, ch)); return *this; } // replaces a substring with another substring wxString& replace(size_t nStart, size_t nLen, const wxString& str, size_t nStart2, size_t nLen2) { wxSTRING_INVALIDATE_CACHE(); size_t from, len; PosLenToImpl(nStart, nLen, &from, &len); size_t from2, len2; str.PosLenToImpl(nStart2, nLen2, &from2, &len2); m_impl.replace(from, len, str.m_impl, from2, len2); return *this; } // replaces the substring with first nCount chars of sz wxString& replace(size_t nStart, size_t nLen, const char* sz, size_t nCount) { wxSTRING_INVALIDATE_CACHE(); size_t from, len; PosLenToImpl(nStart, nLen, &from, &len); SubstrBufFromMB str(ImplStr(sz, nCount)); m_impl.replace(from, len, str.data, str.len); return *this; } wxString& replace(size_t nStart, size_t nLen, const wchar_t* sz, size_t nCount) { wxSTRING_INVALIDATE_CACHE(); size_t from, len; PosLenToImpl(nStart, nLen, &from, &len); SubstrBufFromWC str(ImplStr(sz, nCount)); m_impl.replace(from, len, str.data, str.len); return *this; } wxString& replace(size_t nStart, size_t nLen, const wxString& s, size_t nCount) { wxSTRING_INVALIDATE_CACHE(); size_t from, len; PosLenToImpl(nStart, nLen, &from, &len); m_impl.replace(from, len, s.m_impl.c_str(), s.LenToImpl(nCount)); return *this; } wxString& replace(iterator first, iterator last, const char* s) { wxSTRING_INVALIDATE_CACHE(); m_impl.replace(first.impl(), last.impl(), ImplStr(s)); return *this; } wxString& replace(iterator first, iterator last, const wchar_t* s) { wxSTRING_INVALIDATE_CACHE(); m_impl.replace(first.impl(), last.impl(), ImplStr(s)); return *this; } wxString& replace(iterator first, iterator last, const char* s, size_type n) { wxSTRING_INVALIDATE_CACHE(); SubstrBufFromMB str(ImplStr(s, n)); m_impl.replace(first.impl(), last.impl(), str.data, str.len); return *this; } wxString& replace(iterator first, iterator last, const wchar_t* s, size_type n) { wxSTRING_INVALIDATE_CACHE(); SubstrBufFromWC str(ImplStr(s, n)); m_impl.replace(first.impl(), last.impl(), str.data, str.len); return *this; } wxString& replace(iterator first, iterator last, const wxString& s) { wxSTRING_INVALIDATE_CACHE(); m_impl.replace(first.impl(), last.impl(), s.m_impl); return *this; } wxString& replace(iterator first, iterator last, size_type n, wxUniChar ch) { wxSTRING_INVALIDATE_CACHE(); if ( wxStringOperations::IsSingleCodeUnitCharacter(ch) ) m_impl.replace(first.impl(), last.impl(), n, (wxStringCharType)ch); else m_impl.replace(first.impl(), last.impl(), wxStringOperations::EncodeNChars(n, ch)); return *this; } wxString& replace(iterator first, iterator last, const_iterator first1, const_iterator last1) { wxSTRING_INVALIDATE_CACHE(); m_impl.replace(first.impl(), last.impl(), first1.impl(), last1.impl()); return *this; } wxString& replace(iterator first, iterator last, const char *first1, const char *last1) { replace(first, last, first1, last1 - first1); return *this; } wxString& replace(iterator first, iterator last, const wchar_t *first1, const wchar_t *last1) { replace(first, last, first1, last1 - first1); return *this; } // swap two strings void swap(wxString& str) { #if wxUSE_STRING_POS_CACHE // we modify not only this string but also the other one directly so we // need to invalidate cache for both of them (we could also try to // exchange their cache entries but it seems unlikely to be worth it) InvalidateCache(); str.InvalidateCache(); #endif // wxUSE_STRING_POS_CACHE m_impl.swap(str.m_impl); } // find a substring size_t find(const wxString& str, size_t nStart = 0) const { return PosFromImpl(m_impl.find(str.m_impl, PosToImpl(nStart))); } // find first n characters of sz size_t find(const char* sz, size_t nStart = 0, size_t n = npos) const { SubstrBufFromMB str(ImplStr(sz, n)); return PosFromImpl(m_impl.find(str.data, PosToImpl(nStart), str.len)); } size_t find(const wchar_t* sz, size_t nStart = 0, size_t n = npos) const { SubstrBufFromWC str(ImplStr(sz, n)); return PosFromImpl(m_impl.find(str.data, PosToImpl(nStart), str.len)); } size_t find(const wxScopedCharBuffer& s, size_t nStart = 0, size_t n = npos) const { return find(s.data(), nStart, n); } size_t find(const wxScopedWCharBuffer& s, size_t nStart = 0, size_t n = npos) const { return find(s.data(), nStart, n); } size_t find(const wxCStrData& s, size_t nStart = 0, size_t n = npos) const { return find(s.AsWChar(), nStart, n); } // find the first occurrence of character ch after nStart size_t find(wxUniChar ch, size_t nStart = 0) const { if ( wxStringOperations::IsSingleCodeUnitCharacter(ch) ) return PosFromImpl(m_impl.find((wxStringCharType)ch, PosToImpl(nStart))); else return PosFromImpl(m_impl.find(wxStringOperations::EncodeChar(ch), PosToImpl(nStart))); } size_t find(wxUniCharRef ch, size_t nStart = 0) const { return find(wxUniChar(ch), nStart); } size_t find(char ch, size_t nStart = 0) const { return find(wxUniChar(ch), nStart); } size_t find(unsigned char ch, size_t nStart = 0) const { return find(wxUniChar(ch), nStart); } size_t find(wchar_t ch, size_t nStart = 0) const { return find(wxUniChar(ch), nStart); } // rfind() family is exactly like find() but works right to left // as find, but from the end size_t rfind(const wxString& str, size_t nStart = npos) const { return PosFromImpl(m_impl.rfind(str.m_impl, PosToImpl(nStart))); } // as find, but from the end size_t rfind(const char* sz, size_t nStart = npos, size_t n = npos) const { SubstrBufFromMB str(ImplStr(sz, n)); return PosFromImpl(m_impl.rfind(str.data, PosToImpl(nStart), str.len)); } size_t rfind(const wchar_t* sz, size_t nStart = npos, size_t n = npos) const { SubstrBufFromWC str(ImplStr(sz, n)); return PosFromImpl(m_impl.rfind(str.data, PosToImpl(nStart), str.len)); } size_t rfind(const wxScopedCharBuffer& s, size_t nStart = npos, size_t n = npos) const { return rfind(s.data(), nStart, n); } size_t rfind(const wxScopedWCharBuffer& s, size_t nStart = npos, size_t n = npos) const { return rfind(s.data(), nStart, n); } size_t rfind(const wxCStrData& s, size_t nStart = npos, size_t n = npos) const { return rfind(s.AsWChar(), nStart, n); } // as find, but from the end size_t rfind(wxUniChar ch, size_t nStart = npos) const { if ( wxStringOperations::IsSingleCodeUnitCharacter(ch) ) return PosFromImpl(m_impl.rfind((wxStringCharType)ch, PosToImpl(nStart))); else return PosFromImpl(m_impl.rfind(wxStringOperations::EncodeChar(ch), PosToImpl(nStart))); } size_t rfind(wxUniCharRef ch, size_t nStart = npos) const { return rfind(wxUniChar(ch), nStart); } size_t rfind(char ch, size_t nStart = npos) const { return rfind(wxUniChar(ch), nStart); } size_t rfind(unsigned char ch, size_t nStart = npos) const { return rfind(wxUniChar(ch), nStart); } size_t rfind(wchar_t ch, size_t nStart = npos) const { return rfind(wxUniChar(ch), nStart); } // find first/last occurrence of any character (not) in the set: #if wxUSE_STL_BASED_WXSTRING && !wxUSE_UNICODE_UTF8 // FIXME-UTF8: this is not entirely correct, because it doesn't work if // sizeof(wchar_t)==2 and surrogates are present in the string; // should we care? Probably not. size_t find_first_of(const wxString& str, size_t nStart = 0) const { return m_impl.find_first_of(str.m_impl, nStart); } size_t find_first_of(const char* sz, size_t nStart = 0) const { return m_impl.find_first_of(ImplStr(sz), nStart); } size_t find_first_of(const wchar_t* sz, size_t nStart = 0) const { return m_impl.find_first_of(ImplStr(sz), nStart); } size_t find_first_of(const char* sz, size_t nStart, size_t n) const { return m_impl.find_first_of(ImplStr(sz), nStart, n); } size_t find_first_of(const wchar_t* sz, size_t nStart, size_t n) const { return m_impl.find_first_of(ImplStr(sz), nStart, n); } size_t find_first_of(wxUniChar c, size_t nStart = 0) const { return m_impl.find_first_of((wxChar)c, nStart); } size_t find_last_of(const wxString& str, size_t nStart = npos) const { return m_impl.find_last_of(str.m_impl, nStart); } size_t find_last_of(const char* sz, size_t nStart = npos) const { return m_impl.find_last_of(ImplStr(sz), nStart); } size_t find_last_of(const wchar_t* sz, size_t nStart = npos) const { return m_impl.find_last_of(ImplStr(sz), nStart); } size_t find_last_of(const char* sz, size_t nStart, size_t n) const { return m_impl.find_last_of(ImplStr(sz), nStart, n); } size_t find_last_of(const wchar_t* sz, size_t nStart, size_t n) const { return m_impl.find_last_of(ImplStr(sz), nStart, n); } size_t find_last_of(wxUniChar c, size_t nStart = npos) const { return m_impl.find_last_of((wxChar)c, nStart); } size_t find_first_not_of(const wxString& str, size_t nStart = 0) const { return m_impl.find_first_not_of(str.m_impl, nStart); } size_t find_first_not_of(const char* sz, size_t nStart = 0) const { return m_impl.find_first_not_of(ImplStr(sz), nStart); } size_t find_first_not_of(const wchar_t* sz, size_t nStart = 0) const { return m_impl.find_first_not_of(ImplStr(sz), nStart); } size_t find_first_not_of(const char* sz, size_t nStart, size_t n) const { return m_impl.find_first_not_of(ImplStr(sz), nStart, n); } size_t find_first_not_of(const wchar_t* sz, size_t nStart, size_t n) const { return m_impl.find_first_not_of(ImplStr(sz), nStart, n); } size_t find_first_not_of(wxUniChar c, size_t nStart = 0) const { return m_impl.find_first_not_of((wxChar)c, nStart); } size_t find_last_not_of(const wxString& str, size_t nStart = npos) const { return m_impl.find_last_not_of(str.m_impl, nStart); } size_t find_last_not_of(const char* sz, size_t nStart = npos) const { return m_impl.find_last_not_of(ImplStr(sz), nStart); } size_t find_last_not_of(const wchar_t* sz, size_t nStart = npos) const { return m_impl.find_last_not_of(ImplStr(sz), nStart); } size_t find_last_not_of(const char* sz, size_t nStart, size_t n) const { return m_impl.find_last_not_of(ImplStr(sz), nStart, n); } size_t find_last_not_of(const wchar_t* sz, size_t nStart, size_t n) const { return m_impl.find_last_not_of(ImplStr(sz), nStart, n); } size_t find_last_not_of(wxUniChar c, size_t nStart = npos) const { return m_impl.find_last_not_of((wxChar)c, nStart); } #else // we can't use std::string implementation in UTF-8 build, because the // character sets would be interpreted wrongly: // as strpbrk() but starts at nStart, returns npos if not found size_t find_first_of(const wxString& str, size_t nStart = 0) const #if wxUSE_UNICODE // FIXME-UTF8: temporary { return find_first_of(str.wc_str(), nStart); } #else { return find_first_of(str.mb_str(), nStart); } #endif // same as above size_t find_first_of(const char* sz, size_t nStart = 0) const; size_t find_first_of(const wchar_t* sz, size_t nStart = 0) const; size_t find_first_of(const char* sz, size_t nStart, size_t n) const; size_t find_first_of(const wchar_t* sz, size_t nStart, size_t n) const; // same as find(char, size_t) size_t find_first_of(wxUniChar c, size_t nStart = 0) const { return find(c, nStart); } // find the last (starting from nStart) char from str in this string size_t find_last_of (const wxString& str, size_t nStart = npos) const #if wxUSE_UNICODE // FIXME-UTF8: temporary { return find_last_of(str.wc_str(), nStart); } #else { return find_last_of(str.mb_str(), nStart); } #endif // same as above size_t find_last_of (const char* sz, size_t nStart = npos) const; size_t find_last_of (const wchar_t* sz, size_t nStart = npos) const; size_t find_last_of(const char* sz, size_t nStart, size_t n) const; size_t find_last_of(const wchar_t* sz, size_t nStart, size_t n) const; // same as above size_t find_last_of(wxUniChar c, size_t nStart = npos) const { return rfind(c, nStart); } // find first/last occurrence of any character not in the set // as strspn() (starting from nStart), returns npos on failure size_t find_first_not_of(const wxString& str, size_t nStart = 0) const #if wxUSE_UNICODE // FIXME-UTF8: temporary { return find_first_not_of(str.wc_str(), nStart); } #else { return find_first_not_of(str.mb_str(), nStart); } #endif // same as above size_t find_first_not_of(const char* sz, size_t nStart = 0) const; size_t find_first_not_of(const wchar_t* sz, size_t nStart = 0) const; size_t find_first_not_of(const char* sz, size_t nStart, size_t n) const; size_t find_first_not_of(const wchar_t* sz, size_t nStart, size_t n) const; // same as above size_t find_first_not_of(wxUniChar ch, size_t nStart = 0) const; // as strcspn() size_t find_last_not_of(const wxString& str, size_t nStart = npos) const #if wxUSE_UNICODE // FIXME-UTF8: temporary { return find_last_not_of(str.wc_str(), nStart); } #else { return find_last_not_of(str.mb_str(), nStart); } #endif // same as above size_t find_last_not_of(const char* sz, size_t nStart = npos) const; size_t find_last_not_of(const wchar_t* sz, size_t nStart = npos) const; size_t find_last_not_of(const char* sz, size_t nStart, size_t n) const; size_t find_last_not_of(const wchar_t* sz, size_t nStart, size_t n) const; // same as above size_t find_last_not_of(wxUniChar ch, size_t nStart = npos) const; #endif // wxUSE_STL_BASED_WXSTRING && !wxUSE_UNICODE_UTF8 or not // provide char/wchar_t/wxUniCharRef overloads for char-finding functions // above to resolve ambiguities: size_t find_first_of(wxUniCharRef ch, size_t nStart = 0) const { return find_first_of(wxUniChar(ch), nStart); } size_t find_first_of(char ch, size_t nStart = 0) const { return find_first_of(wxUniChar(ch), nStart); } size_t find_first_of(unsigned char ch, size_t nStart = 0) const { return find_first_of(wxUniChar(ch), nStart); } size_t find_first_of(wchar_t ch, size_t nStart = 0) const { return find_first_of(wxUniChar(ch), nStart); } size_t find_last_of(wxUniCharRef ch, size_t nStart = npos) const { return find_last_of(wxUniChar(ch), nStart); } size_t find_last_of(char ch, size_t nStart = npos) const { return find_last_of(wxUniChar(ch), nStart); } size_t find_last_of(unsigned char ch, size_t nStart = npos) const { return find_last_of(wxUniChar(ch), nStart); } size_t find_last_of(wchar_t ch, size_t nStart = npos) const { return find_last_of(wxUniChar(ch), nStart); } size_t find_first_not_of(wxUniCharRef ch, size_t nStart = 0) const { return find_first_not_of(wxUniChar(ch), nStart); } size_t find_first_not_of(char ch, size_t nStart = 0) const { return find_first_not_of(wxUniChar(ch), nStart); } size_t find_first_not_of(unsigned char ch, size_t nStart = 0) const { return find_first_not_of(wxUniChar(ch), nStart); } size_t find_first_not_of(wchar_t ch, size_t nStart = 0) const { return find_first_not_of(wxUniChar(ch), nStart); } size_t find_last_not_of(wxUniCharRef ch, size_t nStart = npos) const { return find_last_not_of(wxUniChar(ch), nStart); } size_t find_last_not_of(char ch, size_t nStart = npos) const { return find_last_not_of(wxUniChar(ch), nStart); } size_t find_last_not_of(unsigned char ch, size_t nStart = npos) const { return find_last_not_of(wxUniChar(ch), nStart); } size_t find_last_not_of(wchar_t ch, size_t nStart = npos) const { return find_last_not_of(wxUniChar(ch), nStart); } // and additional overloads for the versions taking strings: size_t find_first_of(const wxCStrData& sz, size_t nStart = 0) const { return find_first_of(sz.AsString(), nStart); } size_t find_first_of(const wxScopedCharBuffer& sz, size_t nStart = 0) const { return find_first_of(sz.data(), nStart); } size_t find_first_of(const wxScopedWCharBuffer& sz, size_t nStart = 0) const { return find_first_of(sz.data(), nStart); } size_t find_first_of(const wxCStrData& sz, size_t nStart, size_t n) const { return find_first_of(sz.AsWChar(), nStart, n); } size_t find_first_of(const wxScopedCharBuffer& sz, size_t nStart, size_t n) const { return find_first_of(sz.data(), nStart, n); } size_t find_first_of(const wxScopedWCharBuffer& sz, size_t nStart, size_t n) const { return find_first_of(sz.data(), nStart, n); } size_t find_last_of(const wxCStrData& sz, size_t nStart = 0) const { return find_last_of(sz.AsString(), nStart); } size_t find_last_of(const wxScopedCharBuffer& sz, size_t nStart = 0) const { return find_last_of(sz.data(), nStart); } size_t find_last_of(const wxScopedWCharBuffer& sz, size_t nStart = 0) const { return find_last_of(sz.data(), nStart); } size_t find_last_of(const wxCStrData& sz, size_t nStart, size_t n) const { return find_last_of(sz.AsWChar(), nStart, n); } size_t find_last_of(const wxScopedCharBuffer& sz, size_t nStart, size_t n) const { return find_last_of(sz.data(), nStart, n); } size_t find_last_of(const wxScopedWCharBuffer& sz, size_t nStart, size_t n) const { return find_last_of(sz.data(), nStart, n); } size_t find_first_not_of(const wxCStrData& sz, size_t nStart = 0) const { return find_first_not_of(sz.AsString(), nStart); } size_t find_first_not_of(const wxScopedCharBuffer& sz, size_t nStart = 0) const { return find_first_not_of(sz.data(), nStart); } size_t find_first_not_of(const wxScopedWCharBuffer& sz, size_t nStart = 0) const { return find_first_not_of(sz.data(), nStart); } size_t find_first_not_of(const wxCStrData& sz, size_t nStart, size_t n) const { return find_first_not_of(sz.AsWChar(), nStart, n); } size_t find_first_not_of(const wxScopedCharBuffer& sz, size_t nStart, size_t n) const { return find_first_not_of(sz.data(), nStart, n); } size_t find_first_not_of(const wxScopedWCharBuffer& sz, size_t nStart, size_t n) const { return find_first_not_of(sz.data(), nStart, n); } size_t find_last_not_of(const wxCStrData& sz, size_t nStart = 0) const { return find_last_not_of(sz.AsString(), nStart); } size_t find_last_not_of(const wxScopedCharBuffer& sz, size_t nStart = 0) const { return find_last_not_of(sz.data(), nStart); } size_t find_last_not_of(const wxScopedWCharBuffer& sz, size_t nStart = 0) const { return find_last_not_of(sz.data(), nStart); } size_t find_last_not_of(const wxCStrData& sz, size_t nStart, size_t n) const { return find_last_not_of(sz.AsWChar(), nStart, n); } size_t find_last_not_of(const wxScopedCharBuffer& sz, size_t nStart, size_t n) const { return find_last_not_of(sz.data(), nStart, n); } size_t find_last_not_of(const wxScopedWCharBuffer& sz, size_t nStart, size_t n) const { return find_last_not_of(sz.data(), nStart, n); } // string += string wxString& operator+=(const wxString& s) { wxSTRING_INVALIDATE_CACHED_LENGTH(); m_impl += s.m_impl; return *this; } // string += C string wxString& operator+=(const char *psz) { wxSTRING_INVALIDATE_CACHED_LENGTH(); m_impl += ImplStr(psz); return *this; } wxString& operator+=(const wchar_t *pwz) { wxSTRING_INVALIDATE_CACHED_LENGTH(); m_impl += ImplStr(pwz); return *this; } wxString& operator+=(const wxCStrData& s) { wxSTRING_INVALIDATE_CACHED_LENGTH(); m_impl += s.AsString().m_impl; return *this; } wxString& operator+=(const wxScopedCharBuffer& s) { return append(s); } wxString& operator+=(const wxScopedWCharBuffer& s) { return append(s); } // string += char wxString& operator+=(wxUniChar ch) { wxSTRING_UPDATE_CACHED_LENGTH(1); if ( wxStringOperations::IsSingleCodeUnitCharacter(ch) ) m_impl += (wxStringCharType)ch; else m_impl += wxStringOperations::EncodeChar(ch); return *this; } wxString& operator+=(wxUniCharRef ch) { return *this += wxUniChar(ch); } wxString& operator+=(int ch) { return *this += wxUniChar(ch); } wxString& operator+=(char ch) { return *this += wxUniChar(ch); } wxString& operator+=(unsigned char ch) { return *this += wxUniChar(ch); } wxString& operator+=(wchar_t ch) { return *this += wxUniChar(ch); } private: #if !wxUSE_STL_BASED_WXSTRING // helpers for wxStringBuffer and wxStringBufferLength wxStringCharType *DoGetWriteBuf(size_t nLen) { return m_impl.DoGetWriteBuf(nLen); } void DoUngetWriteBuf() { wxSTRING_INVALIDATE_CACHE(); m_impl.DoUngetWriteBuf(); } void DoUngetWriteBuf(size_t nLen) { wxSTRING_INVALIDATE_CACHE(); m_impl.DoUngetWriteBuf(nLen); } #endif // !wxUSE_STL_BASED_WXSTRING #if !wxUSE_UTF8_LOCALE_ONLY int DoPrintfWchar(const wxChar *format, ...); static wxString DoFormatWchar(const wxChar *format, ...); #endif #if wxUSE_UNICODE_UTF8 int DoPrintfUtf8(const char *format, ...); static wxString DoFormatUtf8(const char *format, ...); #endif #if !wxUSE_STL_BASED_WXSTRING // check string's data validity bool IsValid() const { return m_impl.GetStringData()->IsValid(); } #endif private: wxStringImpl m_impl; // buffers for compatibility conversion from (char*)c_str() and // (wchar_t*)c_str(): the pointers returned by these functions should remain // valid until the string itself is modified for compatibility with the // existing code and consistency with std::string::c_str() so returning a // temporary buffer won't do and we need to cache the conversion results // TODO-UTF8: benchmark various approaches to keeping compatibility buffers template<typename T> struct ConvertedBuffer { // notice that there is no need to initialize m_len here as it's unused // as long as m_str is NULL ConvertedBuffer() : m_str(NULL) {} ~ConvertedBuffer() { free(m_str); } bool Extend(size_t len) { // add extra 1 for the trailing NUL void * const str = realloc(m_str, sizeof(T)*(len + 1)); if ( !str ) return false; m_str = static_cast<T *>(str); m_len = len; return true; } const wxScopedCharTypeBuffer<T> AsScopedBuffer() const { return wxScopedCharTypeBuffer<T>::CreateNonOwned(m_str, m_len); } T *m_str; // pointer to the string data size_t m_len; // length, not size, i.e. in chars and without last NUL }; #if wxUSE_UNICODE // common mb_str() and wxCStrData::AsChar() helper: performs the conversion // and returns either m_convertedToChar.m_str (in which case its m_len is // also updated) or NULL if it failed // // there is an important exception: in wxUSE_UNICODE_UTF8 build if conv is a // UTF-8 one, we return m_impl.c_str() directly, without doing any conversion // as optimization and so the caller needs to check for this before using // m_convertedToChar // // NB: AsChar() returns char* in any build, unlike mb_str() const char *AsChar(const wxMBConv& conv) const; // mb_str() implementation helper wxScopedCharBuffer AsCharBuf(const wxMBConv& conv) const { #if wxUSE_UNICODE_UTF8 // avoid conversion if we can if ( conv.IsUTF8() ) { return wxScopedCharBuffer::CreateNonOwned(m_impl.c_str(), m_impl.length()); } #endif // wxUSE_UNICODE_UTF8 // call this solely in order to fill in m_convertedToChar as AsChar() // updates it as a side effect: this is a bit ugly but it's a completely // internal function so the users of this class shouldn't care or know // about it and doing it like this, i.e. having a separate AsChar(), // allows us to avoid the creation and destruction of a temporary buffer // when using wxCStrData without duplicating any code if ( !AsChar(conv) ) { // although it would be probably more correct to return NULL buffer // from here if the conversion fails, a lot of existing code doesn't // expect mb_str() (or wc_str()) to ever return NULL so return an // empty string otherwise to avoid crashes in it // // also, some existing code does check for the conversion success and // so asserting here would be bad too -- even if it does mean that // silently losing data is possible for badly written code return wxScopedCharBuffer::CreateNonOwned("", 0); } return m_convertedToChar.AsScopedBuffer(); } ConvertedBuffer<char> m_convertedToChar; #endif // !wxUSE_UNICODE #if !wxUSE_UNICODE_WCHAR // common wc_str() and wxCStrData::AsWChar() helper for both UTF-8 and ANSI // builds: converts the string contents into m_convertedToWChar and returns // NULL if the conversion failed (this can only happen in ANSI build) // // NB: AsWChar() returns wchar_t* in any build, unlike wc_str() const wchar_t *AsWChar(const wxMBConv& conv) const; // wc_str() implementation helper wxScopedWCharBuffer AsWCharBuf(const wxMBConv& conv) const { if ( !AsWChar(conv) ) return wxScopedWCharBuffer::CreateNonOwned(L"", 0); return m_convertedToWChar.AsScopedBuffer(); } ConvertedBuffer<wchar_t> m_convertedToWChar; #endif // !wxUSE_UNICODE_WCHAR #if wxUSE_UNICODE_UTF8 // FIXME-UTF8: (try to) move this elsewhere (TLS) or solve differently // assigning to character pointer to by wxString::iterator may // change the underlying wxStringImpl iterator, so we have to // keep track of all iterators and update them as necessary: struct wxStringIteratorNodeHead { wxStringIteratorNodeHead() : ptr(NULL) {} wxStringIteratorNode *ptr; // copying is disallowed as it would result in more than one pointer into // the same linked list wxDECLARE_NO_COPY_CLASS(wxStringIteratorNodeHead); }; wxStringIteratorNodeHead m_iterators; friend class WXDLLIMPEXP_FWD_BASE wxStringIteratorNode; friend class WXDLLIMPEXP_FWD_BASE wxUniCharRef; #endif // wxUSE_UNICODE_UTF8 friend class WXDLLIMPEXP_FWD_BASE wxCStrData; friend class wxStringInternalBuffer; friend class wxStringInternalBufferLength; }; // string iterator operators that satisfy STL Random Access Iterator // requirements: inline wxString::iterator operator+(ptrdiff_t n, wxString::iterator i) { return i + n; } inline wxString::const_iterator operator+(ptrdiff_t n, wxString::const_iterator i) { return i + n; } inline wxString::reverse_iterator operator+(ptrdiff_t n, wxString::reverse_iterator i) { return i + n; } inline wxString::const_reverse_iterator operator+(ptrdiff_t n, wxString::const_reverse_iterator i) { return i + n; } // notice that even though for many compilers the friend declarations above are // enough, from the point of view of C++ standard we must have the declarations // here as friend ones are not injected in the enclosing namespace and without // them the code fails to compile with conforming compilers such as xlC or g++4 wxString WXDLLIMPEXP_BASE operator+(const wxString& string1, const wxString& string2); wxString WXDLLIMPEXP_BASE operator+(const wxString& string, const char *psz); wxString WXDLLIMPEXP_BASE operator+(const wxString& string, const wchar_t *pwz); wxString WXDLLIMPEXP_BASE operator+(const char *psz, const wxString& string); wxString WXDLLIMPEXP_BASE operator+(const wchar_t *pwz, const wxString& string); wxString WXDLLIMPEXP_BASE operator+(const wxString& string, wxUniChar ch); wxString WXDLLIMPEXP_BASE operator+(wxUniChar ch, const wxString& string); inline wxString operator+(const wxString& string, wxUniCharRef ch) { return string + (wxUniChar)ch; } inline wxString operator+(const wxString& string, char ch) { return string + wxUniChar(ch); } inline wxString operator+(const wxString& string, wchar_t ch) { return string + wxUniChar(ch); } inline wxString operator+(wxUniCharRef ch, const wxString& string) { return (wxUniChar)ch + string; } inline wxString operator+(char ch, const wxString& string) { return wxUniChar(ch) + string; } inline wxString operator+(wchar_t ch, const wxString& string) { return wxUniChar(ch) + string; } #define wxGetEmptyString() wxString() // ---------------------------------------------------------------------------- // helper functions which couldn't be defined inline // ---------------------------------------------------------------------------- namespace wxPrivate { #if wxUSE_UNICODE_WCHAR template <> struct wxStringAsBufHelper<char> { static wxScopedCharBuffer Get(const wxString& s, size_t *len) { wxScopedCharBuffer buf(s.mb_str()); if ( len ) *len = buf ? strlen(buf) : 0; return buf; } }; template <> struct wxStringAsBufHelper<wchar_t> { static wxScopedWCharBuffer Get(const wxString& s, size_t *len) { const size_t length = s.length(); if ( len ) *len = length; return wxScopedWCharBuffer::CreateNonOwned(s.wx_str(), length); } }; #elif wxUSE_UNICODE_UTF8 template <> struct wxStringAsBufHelper<char> { static wxScopedCharBuffer Get(const wxString& s, size_t *len) { const size_t length = s.utf8_length(); if ( len ) *len = length; return wxScopedCharBuffer::CreateNonOwned(s.wx_str(), length); } }; template <> struct wxStringAsBufHelper<wchar_t> { static wxScopedWCharBuffer Get(const wxString& s, size_t *len) { wxScopedWCharBuffer wbuf(s.wc_str()); if ( len ) *len = wxWcslen(wbuf); return wbuf; } }; #endif // Unicode build kind } // namespace wxPrivate // ---------------------------------------------------------------------------- // wxStringBuffer: a tiny class allowing to get a writable pointer into string // ---------------------------------------------------------------------------- #if !wxUSE_STL_BASED_WXSTRING // string buffer for direct access to string data in their native // representation: class wxStringInternalBuffer { public: typedef wxStringCharType CharType; wxStringInternalBuffer(wxString& str, size_t lenWanted = 1024) : m_str(str), m_buf(NULL) { m_buf = m_str.DoGetWriteBuf(lenWanted); } ~wxStringInternalBuffer() { m_str.DoUngetWriteBuf(); } operator wxStringCharType*() const { return m_buf; } private: wxString& m_str; wxStringCharType *m_buf; wxDECLARE_NO_COPY_CLASS(wxStringInternalBuffer); }; class wxStringInternalBufferLength { public: typedef wxStringCharType CharType; wxStringInternalBufferLength(wxString& str, size_t lenWanted = 1024) : m_str(str), m_buf(NULL), m_len(0), m_lenSet(false) { m_buf = m_str.DoGetWriteBuf(lenWanted); wxASSERT(m_buf != NULL); } ~wxStringInternalBufferLength() { wxASSERT(m_lenSet); m_str.DoUngetWriteBuf(m_len); } operator wxStringCharType*() const { return m_buf; } void SetLength(size_t length) { m_len = length; m_lenSet = true; } private: wxString& m_str; wxStringCharType *m_buf; size_t m_len; bool m_lenSet; wxDECLARE_NO_COPY_CLASS(wxStringInternalBufferLength); }; #endif // !wxUSE_STL_BASED_WXSTRING template<typename T> class wxStringTypeBufferBase { public: typedef T CharType; wxStringTypeBufferBase(wxString& str, size_t lenWanted = 1024) : m_str(str), m_buf(lenWanted) { // for compatibility with old wxStringBuffer which provided direct // access to wxString internal buffer, initialize ourselves with the // string initial contents size_t len; const wxCharTypeBuffer<CharType> buf(str.tchar_str<CharType>(&len)); if ( buf ) { if ( len > lenWanted ) { // in this case there is not enough space for terminating NUL, // ensure that we still put it there m_buf.data()[lenWanted] = 0; len = lenWanted - 1; } memcpy(m_buf.data(), buf, (len + 1)*sizeof(CharType)); } //else: conversion failed, this can happen when trying to get Unicode // string contents into a char string } operator CharType*() { return m_buf.data(); } protected: wxString& m_str; wxCharTypeBuffer<CharType> m_buf; }; template<typename T> class wxStringTypeBufferLengthBase : public wxStringTypeBufferBase<T> { public: wxStringTypeBufferLengthBase(wxString& str, size_t lenWanted = 1024) : wxStringTypeBufferBase<T>(str, lenWanted), m_len(0), m_lenSet(false) { } ~wxStringTypeBufferLengthBase() { wxASSERT_MSG( this->m_lenSet, "forgot to call SetLength()" ); } void SetLength(size_t length) { m_len = length; m_lenSet = true; } protected: size_t m_len; bool m_lenSet; }; template<typename T> class wxStringTypeBuffer : public wxStringTypeBufferBase<T> { public: wxStringTypeBuffer(wxString& str, size_t lenWanted = 1024) : wxStringTypeBufferBase<T>(str, lenWanted) { } ~wxStringTypeBuffer() { this->m_str.assign(this->m_buf.data()); } wxDECLARE_NO_COPY_CLASS(wxStringTypeBuffer); }; template<typename T> class wxStringTypeBufferLength : public wxStringTypeBufferLengthBase<T> { public: wxStringTypeBufferLength(wxString& str, size_t lenWanted = 1024) : wxStringTypeBufferLengthBase<T>(str, lenWanted) { } ~wxStringTypeBufferLength() { this->m_str.assign(this->m_buf.data(), this->m_len); } wxDECLARE_NO_COPY_CLASS(wxStringTypeBufferLength); }; #if wxUSE_STL_BASED_WXSTRING class wxStringInternalBuffer : public wxStringTypeBufferBase<wxStringCharType> { public: wxStringInternalBuffer(wxString& str, size_t lenWanted = 1024) : wxStringTypeBufferBase<wxStringCharType>(str, lenWanted) {} ~wxStringInternalBuffer() { m_str.m_impl.assign(m_buf.data()); } wxDECLARE_NO_COPY_CLASS(wxStringInternalBuffer); }; class wxStringInternalBufferLength : public wxStringTypeBufferLengthBase<wxStringCharType> { public: wxStringInternalBufferLength(wxString& str, size_t lenWanted = 1024) : wxStringTypeBufferLengthBase<wxStringCharType>(str, lenWanted) {} ~wxStringInternalBufferLength() { m_str.m_impl.assign(m_buf.data(), m_len); } wxDECLARE_NO_COPY_CLASS(wxStringInternalBufferLength); }; #endif // wxUSE_STL_BASED_WXSTRING #if wxUSE_STL_BASED_WXSTRING || wxUSE_UNICODE_UTF8 typedef wxStringTypeBuffer<wxChar> wxStringBuffer; typedef wxStringTypeBufferLength<wxChar> wxStringBufferLength; #else // if !wxUSE_STL_BASED_WXSTRING && !wxUSE_UNICODE_UTF8 typedef wxStringInternalBuffer wxStringBuffer; typedef wxStringInternalBufferLength wxStringBufferLength; #endif // !wxUSE_STL_BASED_WXSTRING && !wxUSE_UNICODE_UTF8 #if wxUSE_UNICODE_UTF8 typedef wxStringInternalBuffer wxUTF8StringBuffer; typedef wxStringInternalBufferLength wxUTF8StringBufferLength; #elif wxUSE_UNICODE_WCHAR // Note about inlined dtors in the classes below: this is done not for // performance reasons but just to avoid linking errors in the MSVC DLL build // under Windows: if a class has non-inline methods it must be declared as // being DLL-exported but, due to an extremely interesting feature of MSVC 7 // and later, any template class which is used as a base of a DLL-exported // class is implicitly made DLL-exported too, as explained at the bottom of // http://msdn.microsoft.com/en-us/library/twa2aw10.aspx (just to confirm: yes, // _inheriting_ from a class can change whether it is being exported from DLL) // // But this results in link errors because the base template class is not DLL- // exported, whether it is declared with WXDLLIMPEXP_BASE or not, because it // does have only inline functions. So the simplest fix is to just make all the // functions of these classes inline too. class wxUTF8StringBuffer : public wxStringTypeBufferBase<char> { public: wxUTF8StringBuffer(wxString& str, size_t lenWanted = 1024) : wxStringTypeBufferBase<char>(str, lenWanted) {} ~wxUTF8StringBuffer() { wxMBConvStrictUTF8 conv; size_t wlen = conv.ToWChar(NULL, 0, m_buf); wxCHECK_RET( wlen != wxCONV_FAILED, "invalid UTF-8 data in string buffer?" ); wxStringInternalBuffer wbuf(m_str, wlen); conv.ToWChar(wbuf, wlen, m_buf); } wxDECLARE_NO_COPY_CLASS(wxUTF8StringBuffer); }; class wxUTF8StringBufferLength : public wxStringTypeBufferLengthBase<char> { public: wxUTF8StringBufferLength(wxString& str, size_t lenWanted = 1024) : wxStringTypeBufferLengthBase<char>(str, lenWanted) {} ~wxUTF8StringBufferLength() { wxCHECK_RET(m_lenSet, "length not set"); wxMBConvStrictUTF8 conv; size_t wlen = conv.ToWChar(NULL, 0, m_buf, m_len); wxCHECK_RET( wlen != wxCONV_FAILED, "invalid UTF-8 data in string buffer?" ); wxStringInternalBufferLength wbuf(m_str, wlen); conv.ToWChar(wbuf, wlen, m_buf, m_len); wbuf.SetLength(wlen); } wxDECLARE_NO_COPY_CLASS(wxUTF8StringBufferLength); }; #endif // wxUSE_UNICODE_UTF8/wxUSE_UNICODE_WCHAR // --------------------------------------------------------------------------- // wxString comparison functions: operator versions are always case sensitive // --------------------------------------------------------------------------- // comparison with C-style narrow and wide strings. #define wxCMP_WXCHAR_STRING(p, s, op) 0 op s.Cmp(p) wxDEFINE_ALL_COMPARISONS(const wchar_t *, const wxString&, wxCMP_WXCHAR_STRING) wxDEFINE_ALL_COMPARISONS(const char *, const wxString&, wxCMP_WXCHAR_STRING) #undef wxCMP_WXCHAR_STRING inline bool operator==(const wxString& s1, const wxString& s2) { return s1.IsSameAs(s2); } inline bool operator!=(const wxString& s1, const wxString& s2) { return !s1.IsSameAs(s2); } inline bool operator< (const wxString& s1, const wxString& s2) { return s1.Cmp(s2) < 0; } inline bool operator> (const wxString& s1, const wxString& s2) { return s1.Cmp(s2) > 0; } inline bool operator<=(const wxString& s1, const wxString& s2) { return s1.Cmp(s2) <= 0; } inline bool operator>=(const wxString& s1, const wxString& s2) { return s1.Cmp(s2) >= 0; } inline bool operator==(const wxString& s1, const wxCStrData& s2) { return s1 == s2.AsString(); } inline bool operator==(const wxCStrData& s1, const wxString& s2) { return s1.AsString() == s2; } inline bool operator!=(const wxString& s1, const wxCStrData& s2) { return s1 != s2.AsString(); } inline bool operator!=(const wxCStrData& s1, const wxString& s2) { return s1.AsString() != s2; } inline bool operator==(const wxString& s1, const wxScopedWCharBuffer& s2) { return (s1.Cmp((const wchar_t *)s2) == 0); } inline bool operator==(const wxScopedWCharBuffer& s1, const wxString& s2) { return (s2.Cmp((const wchar_t *)s1) == 0); } inline bool operator!=(const wxString& s1, const wxScopedWCharBuffer& s2) { return (s1.Cmp((const wchar_t *)s2) != 0); } inline bool operator!=(const wxScopedWCharBuffer& s1, const wxString& s2) { return (s2.Cmp((const wchar_t *)s1) != 0); } inline bool operator==(const wxString& s1, const wxScopedCharBuffer& s2) { return (s1.Cmp((const char *)s2) == 0); } inline bool operator==(const wxScopedCharBuffer& s1, const wxString& s2) { return (s2.Cmp((const char *)s1) == 0); } inline bool operator!=(const wxString& s1, const wxScopedCharBuffer& s2) { return (s1.Cmp((const char *)s2) != 0); } inline bool operator!=(const wxScopedCharBuffer& s1, const wxString& s2) { return (s2.Cmp((const char *)s1) != 0); } inline wxString operator+(const wxString& string, const wxScopedWCharBuffer& buf) { return string + (const wchar_t *)buf; } inline wxString operator+(const wxScopedWCharBuffer& buf, const wxString& string) { return (const wchar_t *)buf + string; } inline wxString operator+(const wxString& string, const wxScopedCharBuffer& buf) { return string + (const char *)buf; } inline wxString operator+(const wxScopedCharBuffer& buf, const wxString& string) { return (const char *)buf + string; } // comparison with char inline bool operator==(const wxUniChar& c, const wxString& s) { return s.IsSameAs(c); } inline bool operator==(const wxUniCharRef& c, const wxString& s) { return s.IsSameAs(c); } inline bool operator==(char c, const wxString& s) { return s.IsSameAs(c); } inline bool operator==(wchar_t c, const wxString& s) { return s.IsSameAs(c); } inline bool operator==(int c, const wxString& s) { return s.IsSameAs(c); } inline bool operator==(const wxString& s, const wxUniChar& c) { return s.IsSameAs(c); } inline bool operator==(const wxString& s, const wxUniCharRef& c) { return s.IsSameAs(c); } inline bool operator==(const wxString& s, char c) { return s.IsSameAs(c); } inline bool operator==(const wxString& s, wchar_t c) { return s.IsSameAs(c); } inline bool operator!=(const wxUniChar& c, const wxString& s) { return !s.IsSameAs(c); } inline bool operator!=(const wxUniCharRef& c, const wxString& s) { return !s.IsSameAs(c); } inline bool operator!=(char c, const wxString& s) { return !s.IsSameAs(c); } inline bool operator!=(wchar_t c, const wxString& s) { return !s.IsSameAs(c); } inline bool operator!=(int c, const wxString& s) { return !s.IsSameAs(c); } inline bool operator!=(const wxString& s, const wxUniChar& c) { return !s.IsSameAs(c); } inline bool operator!=(const wxString& s, const wxUniCharRef& c) { return !s.IsSameAs(c); } inline bool operator!=(const wxString& s, char c) { return !s.IsSameAs(c); } inline bool operator!=(const wxString& s, wchar_t c) { return !s.IsSameAs(c); } // wxString iterators comparisons inline bool wxString::iterator::operator==(const const_iterator& i) const { return i == *this; } inline bool wxString::iterator::operator!=(const const_iterator& i) const { return i != *this; } inline bool wxString::iterator::operator<(const const_iterator& i) const { return i > *this; } inline bool wxString::iterator::operator>(const const_iterator& i) const { return i < *this; } inline bool wxString::iterator::operator<=(const const_iterator& i) const { return i >= *this; } inline bool wxString::iterator::operator>=(const const_iterator& i) const { return i <= *this; } // we also need to provide the operators for comparison with wxCStrData to // resolve ambiguity between operator(const wxChar *,const wxString &) and // operator(const wxChar *, const wxChar *) for "p == s.c_str()" // // notice that these are (shallow) pointer comparisons, not (deep) string ones #define wxCMP_CHAR_CSTRDATA(p, s, op) p op s.AsChar() #define wxCMP_WCHAR_CSTRDATA(p, s, op) p op s.AsWChar() wxDEFINE_ALL_COMPARISONS(const wchar_t *, const wxCStrData&, wxCMP_WCHAR_CSTRDATA) wxDEFINE_ALL_COMPARISONS(const char *, const wxCStrData&, wxCMP_CHAR_CSTRDATA) #undef wxCMP_CHAR_CSTRDATA #undef wxCMP_WCHAR_CSTRDATA // ---------------------------------------------------------------------------- // Implement hashing using C++11 std::hash<>. // ---------------------------------------------------------------------------- // Check for both compiler and standard library support for C++11: normally the // former implies the latter but under Mac OS X < 10.7 C++11 compiler can (and // even has to be) used with non-C++11 standard library, so explicitly exclude // this case. #if (__cplusplus >= 201103L || wxCHECK_VISUALC_VERSION(10)) \ && ( (!defined __GLIBCXX__) || (__GLIBCXX__ > 20070719) ) // Don't do this if ToStdWstring() is not available. We could work around it // but, presumably, if using std::wstring is undesirable, then so is using // std::hash<> anyhow. #if wxUSE_STD_STRING #include <functional> namespace std { template<> struct hash<wxString> { size_t operator()(const wxString& s) const { return std::hash<std::wstring>()(s.ToStdWstring()); } }; } // namespace std #endif // wxUSE_STD_STRING #endif // C++11 // Specialize std::iter_swap in C++11 to make std::reverse() work with wxString // iterators: unlike in C++98, where iter_swap() is required to deal with the // iterator::reference being different from "iterator::value_type&", in C++11 // iter_swap() just calls swap() by default and this doesn't work for us as // wxUniCharRef is not the same as "wxUniChar&". // // Unfortunately currently iter_swap() can't be specialized when using libc++, // see https://llvm.org/bugs/show_bug.cgi?id=28559 #if (__cplusplus >= 201103L) && !defined(_LIBCPP_VERSION) namespace std { template <> inline void iter_swap<wxString::iterator>(wxString::iterator i1, wxString::iterator i2) { // We don't check for i1 == i2, this won't happen in normal use, so // don't pessimize the common code to account for it. wxUniChar tmp = *i1; *i1 = *i2; *i2 = tmp; } } // namespace std #endif // C++11 // --------------------------------------------------------------------------- // Implementation only from here until the end of file // --------------------------------------------------------------------------- #if wxUSE_STD_IOSTREAM #include "wx/iosfwrap.h" WXDLLIMPEXP_BASE wxSTD ostream& operator<<(wxSTD ostream&, const wxString&); WXDLLIMPEXP_BASE wxSTD ostream& operator<<(wxSTD ostream&, const wxCStrData&); WXDLLIMPEXP_BASE wxSTD ostream& operator<<(wxSTD ostream&, const wxScopedCharBuffer&); #ifndef __BORLANDC__ WXDLLIMPEXP_BASE wxSTD ostream& operator<<(wxSTD ostream&, const wxScopedWCharBuffer&); #endif #if wxUSE_UNICODE && defined(HAVE_WOSTREAM) WXDLLIMPEXP_BASE wxSTD wostream& operator<<(wxSTD wostream&, const wxString&); WXDLLIMPEXP_BASE wxSTD wostream& operator<<(wxSTD wostream&, const wxCStrData&); WXDLLIMPEXP_BASE wxSTD wostream& operator<<(wxSTD wostream&, const wxScopedWCharBuffer&); #endif // wxUSE_UNICODE && defined(HAVE_WOSTREAM) #endif // wxUSE_STD_IOSTREAM // --------------------------------------------------------------------------- // wxCStrData implementation // --------------------------------------------------------------------------- inline wxCStrData::wxCStrData(char *buf) : m_str(new wxString(buf)), m_offset(0), m_owned(true) {} inline wxCStrData::wxCStrData(wchar_t *buf) : m_str(new wxString(buf)), m_offset(0), m_owned(true) {} inline wxCStrData::wxCStrData(const wxCStrData& data) : m_str(data.m_owned ? new wxString(*data.m_str) : data.m_str), m_offset(data.m_offset), m_owned(data.m_owned) { } inline wxCStrData::~wxCStrData() { if ( m_owned ) delete const_cast<wxString*>(m_str); // cast to silence warnings } // AsChar() and AsWChar() implementations simply forward to wxString methods inline const wchar_t* wxCStrData::AsWChar() const { const wchar_t * const p = #if wxUSE_UNICODE_WCHAR m_str->wc_str(); #elif wxUSE_UNICODE_UTF8 m_str->AsWChar(wxMBConvStrictUTF8()); #else m_str->AsWChar(wxConvLibc); #endif // in Unicode build the string always has a valid Unicode representation // and even if a conversion is needed (as in UTF8 case) it can't fail // // but in ANSI build the string contents might be not convertible to // Unicode using the current locale encoding so we do need to check for // errors #if !wxUSE_UNICODE if ( !p ) { // if conversion fails, return empty string and not NULL to avoid // crashes in code written with either wxWidgets 2 wxString or // std::string behaviour in mind: neither of them ever returns NULL // from its c_str() and so we shouldn't neither // // notice that the same is done in AsChar() below and // wxString::wc_str() and mb_str() for the same reasons return L""; } #endif // !wxUSE_UNICODE return p + m_offset; } inline const char* wxCStrData::AsChar() const { #if wxUSE_UNICODE && !wxUSE_UTF8_LOCALE_ONLY const char * const p = m_str->AsChar(wxConvLibc); if ( !p ) return ""; #else // !wxUSE_UNICODE || wxUSE_UTF8_LOCALE_ONLY const char * const p = m_str->mb_str(); #endif // wxUSE_UNICODE && !wxUSE_UTF8_LOCALE_ONLY return p + m_offset; } inline wxString wxCStrData::AsString() const { if ( m_offset == 0 ) return *m_str; else return m_str->Mid(m_offset); } inline const wxStringCharType *wxCStrData::AsInternal() const { #if wxUSE_UNICODE_UTF8 return wxStringOperations::AddToIter(m_str->wx_str(), m_offset); #else return m_str->wx_str() + m_offset; #endif } inline wxUniChar wxCStrData::operator*() const { if ( m_str->empty() ) return wxUniChar(wxT('\0')); else return (*m_str)[m_offset]; } inline wxUniChar wxCStrData::operator[](size_t n) const { // NB: we intentionally use operator[] and not at() here because the former // works for the terminating NUL while the latter does not return (*m_str)[m_offset + n]; } // ---------------------------------------------------------------------------- // more wxCStrData operators // ---------------------------------------------------------------------------- // we need to define those to allow "size_t pos = p - s.c_str()" where p is // some pointer into the string inline size_t operator-(const char *p, const wxCStrData& cs) { return p - cs.AsChar(); } inline size_t operator-(const wchar_t *p, const wxCStrData& cs) { return p - cs.AsWChar(); } // ---------------------------------------------------------------------------- // implementation of wx[W]CharBuffer inline methods using wxCStrData // ---------------------------------------------------------------------------- // FIXME-UTF8: move this to buffer.h inline wxCharBuffer::wxCharBuffer(const wxCStrData& cstr) : wxCharTypeBufferBase(cstr.AsCharBuf()) { } inline wxWCharBuffer::wxWCharBuffer(const wxCStrData& cstr) : wxCharTypeBufferBase(cstr.AsWCharBuf()) { } #if wxUSE_UNICODE_UTF8 // ---------------------------------------------------------------------------- // implementation of wxStringIteratorNode inline methods // ---------------------------------------------------------------------------- void wxStringIteratorNode::DoSet(const wxString *str, wxStringImpl::const_iterator *citer, wxStringImpl::iterator *iter) { m_prev = NULL; m_iter = iter; m_citer = citer; m_str = str; if ( str ) { m_next = str->m_iterators.ptr; const_cast<wxString*>(m_str)->m_iterators.ptr = this; if ( m_next ) m_next->m_prev = this; } else { m_next = NULL; } } void wxStringIteratorNode::clear() { if ( m_next ) m_next->m_prev = m_prev; if ( m_prev ) m_prev->m_next = m_next; else if ( m_str ) // first in the list const_cast<wxString*>(m_str)->m_iterators.ptr = m_next; m_next = m_prev = NULL; m_citer = NULL; m_iter = NULL; m_str = NULL; } #endif // wxUSE_UNICODE_UTF8 #if WXWIN_COMPATIBILITY_2_8 // lot of code out there doesn't explicitly include wx/crt.h, but uses // CRT wrappers that are now declared in wx/wxcrt.h and wx/wxcrtvararg.h, // so let's include this header now that wxString is defined and it's safe // to do it: #include "wx/crt.h" #endif // ---------------------------------------------------------------------------- // Checks on wxString characters // ---------------------------------------------------------------------------- template<bool (T)(const wxUniChar& c)> inline bool wxStringCheck(const wxString& val) { for ( wxString::const_iterator i = val.begin(); i != val.end(); ++i ) if (T(*i) == 0) return false; return true; } #endif // _WX_WXSTRING_H_
h
rticonnextdds-usecases
data/projects/rticonnextdds-usecases/VehicleTracking/ExampleCode/thirdparty/wxWidgets-3.1.2/Linux/include/wx/sashwin.h
///////////////////////////////////////////////////////////////////////////// // Name: wx/sashwin.h // Purpose: Base header for wxSashWindow // Author: Julian Smart // Modified by: // Created: // Copyright: (c) Julian Smart // Licence: wxWindows Licence ///////////////////////////////////////////////////////////////////////////// #ifndef _WX_SASHWIN_H_BASE_ #define _WX_SASHWIN_H_BASE_ #include "wx/generic/sashwin.h" #endif // _WX_SASHWIN_H_BASE_
h
rticonnextdds-usecases
data/projects/rticonnextdds-usecases/VehicleTracking/ExampleCode/thirdparty/wxWidgets-3.1.2/Linux/include/wx/help.h
///////////////////////////////////////////////////////////////////////////// // Name: wx/help.h // Purpose: wxHelpController base header // Author: wxWidgets Team // Modified by: // Created: // Copyright: (c) Julian Smart // Licence: wxWindows licence ///////////////////////////////////////////////////////////////////////////// #ifndef _WX_HELP_H_BASE_ #define _WX_HELP_H_BASE_ #include "wx/defs.h" #if wxUSE_HELP #include "wx/helpbase.h" #if defined(__WXMSW__) #include "wx/msw/helpchm.h" #define wxHelpController wxCHMHelpController #else // !MSW #if wxUSE_WXHTML_HELP #include "wx/html/helpctrl.h" #define wxHelpController wxHtmlHelpController #else #include "wx/generic/helpext.h" #define wxHelpController wxExtHelpController #endif #endif // MSW/!MSW #endif // wxUSE_HELP #endif // _WX_HELP_H_BASE_
h
rticonnextdds-usecases
data/projects/rticonnextdds-usecases/VehicleTracking/ExampleCode/thirdparty/wxWidgets-3.1.2/Linux/include/wx/archive.h
///////////////////////////////////////////////////////////////////////////// // Name: wx/archive.h // Purpose: Streams for archive formats // Author: Mike Wetherell // Copyright: (c) 2004 Mike Wetherell // Licence: wxWindows licence ///////////////////////////////////////////////////////////////////////////// #ifndef _WX_ARCHIVE_H__ #define _WX_ARCHIVE_H__ #include "wx/defs.h" #if wxUSE_STREAMS && wxUSE_ARCHIVE_STREAMS #include "wx/stream.h" #include "wx/filename.h" ///////////////////////////////////////////////////////////////////////////// // wxArchiveNotifier class WXDLLIMPEXP_BASE wxArchiveNotifier { public: virtual ~wxArchiveNotifier() { } virtual void OnEntryUpdated(class wxArchiveEntry& entry) = 0; }; ///////////////////////////////////////////////////////////////////////////// // wxArchiveEntry // // Holds an entry's meta data, such as filename and timestamp. class WXDLLIMPEXP_BASE wxArchiveEntry : public wxObject { public: virtual ~wxArchiveEntry() { } virtual wxDateTime GetDateTime() const = 0; virtual wxFileOffset GetSize() const = 0; virtual wxFileOffset GetOffset() const = 0; virtual bool IsDir() const = 0; virtual bool IsReadOnly() const = 0; virtual wxString GetInternalName() const = 0; virtual wxPathFormat GetInternalFormat() const = 0; virtual wxString GetName(wxPathFormat format = wxPATH_NATIVE) const = 0; virtual void SetDateTime(const wxDateTime& dt) = 0; virtual void SetSize(wxFileOffset size) = 0; virtual void SetIsDir(bool isDir = true) = 0; virtual void SetIsReadOnly(bool isReadOnly = true) = 0; virtual void SetName(const wxString& name, wxPathFormat format = wxPATH_NATIVE) = 0; wxArchiveEntry *Clone() const { return DoClone(); } void SetNotifier(wxArchiveNotifier& notifier); virtual void UnsetNotifier() { m_notifier = NULL; } protected: wxArchiveEntry() : m_notifier(NULL) { } wxArchiveEntry(const wxArchiveEntry& e) : wxObject(e), m_notifier(NULL) { } virtual void SetOffset(wxFileOffset offset) = 0; virtual wxArchiveEntry* DoClone() const = 0; wxArchiveNotifier *GetNotifier() const { return m_notifier; } wxArchiveEntry& operator=(const wxArchiveEntry& entry); private: wxArchiveNotifier *m_notifier; wxDECLARE_ABSTRACT_CLASS(wxArchiveEntry); }; ///////////////////////////////////////////////////////////////////////////// // wxArchiveInputStream // // GetNextEntry() returns an wxArchiveEntry object containing the meta-data // for the next entry in the archive (and gives away ownership). Reading from // the wxArchiveInputStream then returns the entry's data. Eof() becomes true // after an attempt has been made to read past the end of the entry's data. // // When there are no more entries, GetNextEntry() returns NULL and sets Eof(). class WXDLLIMPEXP_BASE wxArchiveInputStream : public wxFilterInputStream { public: typedef wxArchiveEntry entry_type; virtual ~wxArchiveInputStream() { } virtual bool OpenEntry(wxArchiveEntry& entry) = 0; virtual bool CloseEntry() = 0; wxArchiveEntry *GetNextEntry() { return DoGetNextEntry(); } virtual char Peek() wxOVERRIDE { return wxInputStream::Peek(); } protected: wxArchiveInputStream(wxInputStream& stream, wxMBConv& conv); wxArchiveInputStream(wxInputStream *stream, wxMBConv& conv); virtual wxArchiveEntry *DoGetNextEntry() = 0; wxMBConv& GetConv() const { return m_conv; } private: wxMBConv& m_conv; }; ///////////////////////////////////////////////////////////////////////////// // wxArchiveOutputStream // // PutNextEntry is used to create a new entry in the output archive, then // the entry's data is written to the wxArchiveOutputStream. // // Only one entry can be open for output at a time; another call to // PutNextEntry closes the current entry and begins the next. // // The overload 'bool PutNextEntry(wxArchiveEntry *entry)' takes ownership // of the entry object. class WXDLLIMPEXP_BASE wxArchiveOutputStream : public wxFilterOutputStream { public: virtual ~wxArchiveOutputStream() { } virtual bool PutNextEntry(wxArchiveEntry *entry) = 0; virtual bool PutNextEntry(const wxString& name, const wxDateTime& dt = wxDateTime::Now(), wxFileOffset size = wxInvalidOffset) = 0; virtual bool PutNextDirEntry(const wxString& name, const wxDateTime& dt = wxDateTime::Now()) = 0; virtual bool CopyEntry(wxArchiveEntry *entry, wxArchiveInputStream& stream) = 0; virtual bool CopyArchiveMetaData(wxArchiveInputStream& stream) = 0; virtual bool CloseEntry() = 0; protected: wxArchiveOutputStream(wxOutputStream& stream, wxMBConv& conv); wxArchiveOutputStream(wxOutputStream *stream, wxMBConv& conv); wxMBConv& GetConv() const { return m_conv; } private: wxMBConv& m_conv; }; ///////////////////////////////////////////////////////////////////////////// // wxArchiveIterator // // An input iterator that can be used to transfer an archive's catalog to // a container. #if wxUSE_STL || defined WX_TEST_ARCHIVE_ITERATOR #include <iterator> #include <utility> template <class X, class Y> inline void _wxSetArchiveIteratorValue( X& val, Y entry, void *WXUNUSED(d)) { val = X(entry); } template <class X, class Y, class Z> inline void _wxSetArchiveIteratorValue( std::pair<X, Y>& val, Z entry, Z WXUNUSED(d)) { val = std::make_pair(X(entry->GetInternalName()), Y(entry)); } template <class Arc, class T = typename Arc::entry_type*> class wxArchiveIterator { public: typedef std::input_iterator_tag iterator_category; typedef T value_type; typedef ptrdiff_t difference_type; typedef T* pointer; typedef T& reference; wxArchiveIterator() : m_rep(NULL) { } wxArchiveIterator(Arc& arc) { typename Arc::entry_type* entry = arc.GetNextEntry(); m_rep = entry ? new Rep(arc, entry) : NULL; } wxArchiveIterator(const wxArchiveIterator& it) : m_rep(it.m_rep) { if (m_rep) m_rep->AddRef(); } ~wxArchiveIterator() { if (m_rep) m_rep->UnRef(); } const T& operator *() const { return m_rep->GetValue(); } const T* operator ->() const { return &**this; } wxArchiveIterator& operator =(const wxArchiveIterator& it) { if (it.m_rep) it.m_rep.AddRef(); if (m_rep) this->m_rep.UnRef(); m_rep = it.m_rep; return *this; } wxArchiveIterator& operator ++() { m_rep = m_rep->Next(); return *this; } wxArchiveIterator operator ++(int) { wxArchiveIterator it(*this); ++(*this); return it; } bool operator ==(const wxArchiveIterator& j) const { return m_rep == j.m_rep; } bool operator !=(const wxArchiveIterator& j) const { return !(*this == j); } private: class Rep { Arc& m_arc; typename Arc::entry_type* m_entry; T m_value; int m_ref; public: Rep(Arc& arc, typename Arc::entry_type* entry) : m_arc(arc), m_entry(entry), m_value(), m_ref(1) { } ~Rep() { delete m_entry; } void AddRef() { m_ref++; } void UnRef() { if (--m_ref == 0) delete this; } Rep *Next() { typename Arc::entry_type* entry = m_arc.GetNextEntry(); if (!entry) { UnRef(); return NULL; } if (m_ref > 1) { m_ref--; return new Rep(m_arc, entry); } delete m_entry; m_entry = entry; m_value = T(); return this; } const T& GetValue() { if (m_entry) { _wxSetArchiveIteratorValue(m_value, m_entry, m_entry); m_entry = NULL; } return m_value; } } *m_rep; }; typedef wxArchiveIterator<wxArchiveInputStream> wxArchiveIter; typedef wxArchiveIterator<wxArchiveInputStream, std::pair<wxString, wxArchiveEntry*> > wxArchivePairIter; #endif // wxUSE_STL || defined WX_TEST_ARCHIVE_ITERATOR ///////////////////////////////////////////////////////////////////////////// // wxArchiveClassFactory // // A wxArchiveClassFactory instance for a particular archive type allows // the creation of the other classes that may be needed. void WXDLLIMPEXP_BASE wxUseArchiveClasses(); class WXDLLIMPEXP_BASE wxArchiveClassFactory : public wxFilterClassFactoryBase { public: typedef wxArchiveEntry entry_type; typedef wxArchiveInputStream instream_type; typedef wxArchiveOutputStream outstream_type; typedef wxArchiveNotifier notifier_type; #if wxUSE_STL || defined WX_TEST_ARCHIVE_ITERATOR typedef wxArchiveIter iter_type; typedef wxArchivePairIter pairiter_type; #endif virtual ~wxArchiveClassFactory() { } wxArchiveEntry *NewEntry() const { return DoNewEntry(); } wxArchiveInputStream *NewStream(wxInputStream& stream) const { return DoNewStream(stream); } wxArchiveOutputStream *NewStream(wxOutputStream& stream) const { return DoNewStream(stream); } wxArchiveInputStream *NewStream(wxInputStream *stream) const { return DoNewStream(stream); } wxArchiveOutputStream *NewStream(wxOutputStream *stream) const { return DoNewStream(stream); } virtual wxString GetInternalName( const wxString& name, wxPathFormat format = wxPATH_NATIVE) const = 0; // FIXME-UTF8: remove these from this file, they are used for ANSI // build only void SetConv(wxMBConv& conv) { m_pConv = &conv; } wxMBConv& GetConv() const { if (m_pConv) return *m_pConv; else return wxConvLocal; } static const wxArchiveClassFactory *Find(const wxString& protocol, wxStreamProtocolType type = wxSTREAM_PROTOCOL); static const wxArchiveClassFactory *GetFirst(); const wxArchiveClassFactory *GetNext() const { return m_next; } void PushFront() { Remove(); m_next = sm_first; sm_first = this; } void Remove(); protected: // old compilers don't support covarient returns, so 'Do' methods are // used to simulate them virtual wxArchiveEntry *DoNewEntry() const = 0; virtual wxArchiveInputStream *DoNewStream(wxInputStream& stream) const = 0; virtual wxArchiveOutputStream *DoNewStream(wxOutputStream& stream) const = 0; virtual wxArchiveInputStream *DoNewStream(wxInputStream *stream) const = 0; virtual wxArchiveOutputStream *DoNewStream(wxOutputStream *stream) const = 0; wxArchiveClassFactory() : m_pConv(NULL), m_next(this) { } wxArchiveClassFactory& operator=(const wxArchiveClassFactory& WXUNUSED(f)) { return *this; } private: wxMBConv *m_pConv; static wxArchiveClassFactory *sm_first; wxArchiveClassFactory *m_next; wxDECLARE_ABSTRACT_CLASS(wxArchiveClassFactory); }; #endif // wxUSE_STREAMS && wxUSE_ARCHIVE_STREAMS #endif // _WX_ARCHIVE_H__
h
rticonnextdds-usecases
data/projects/rticonnextdds-usecases/VehicleTracking/ExampleCode/thirdparty/wxWidgets-3.1.2/Linux/include/wx/print.h
///////////////////////////////////////////////////////////////////////////// // Name: wx/print.h // Purpose: Base header for printer classes // Author: Julian Smart // Modified by: // Created: // Copyright: (c) Julian Smart // Licence: wxWindows Licence ///////////////////////////////////////////////////////////////////////////// #ifndef _WX_PRINT_H_BASE_ #define _WX_PRINT_H_BASE_ #include "wx/defs.h" #if wxUSE_PRINTING_ARCHITECTURE #if defined(__WXMSW__) && !defined(__WXUNIVERSAL__) #include "wx/msw/printwin.h" #elif defined(__WXMAC__) #include "wx/osx/printmac.h" #elif defined(__WXQT__) #include "wx/qt/printqt.h" #else #include "wx/generic/printps.h" #endif #endif // wxUSE_PRINTING_ARCHITECTURE #endif // _WX_PRINT_H_BASE_
h
rticonnextdds-usecases
data/projects/rticonnextdds-usecases/VehicleTracking/ExampleCode/thirdparty/wxWidgets-3.1.2/Linux/include/wx/compiler.h
/* * Name: wx/compiler.h * Purpose: Compiler-specific macro definitions. * Author: Vadim Zeitlin * Created: 2013-07-13 (extracted from wx/platform.h) * Copyright: (c) 1997-2013 Vadim Zeitlin <[email protected]> * Licence: wxWindows licence */ /* THIS IS A C FILE, DON'T USE C++ FEATURES (IN PARTICULAR COMMENTS) IN IT */ #ifndef _WX_COMPILER_H_ #define _WX_COMPILER_H_ /* Compiler detection and related helpers. */ /* Notice that Intel compiler can be used as Microsoft Visual C++ add-on and so we should define both __INTELC__ and __VISUALC__ for it. */ #ifdef __INTEL_COMPILER # define __INTELC__ #endif #if defined(_MSC_VER) /* define another standard symbol for Microsoft Visual C++: the standard one (_MSC_VER) is also defined by some other compilers. */ # define __VISUALC__ _MSC_VER /* define special symbols for different VC version instead of writing tests for magic numbers such as 1200, 1300 &c repeatedly */ #if __VISUALC__ < 1300 # error "This Visual C++ version is not supported any longer (at least MSVC 2003 required)." #elif __VISUALC__ < 1400 # define __VISUALC7__ #elif __VISUALC__ < 1500 # define __VISUALC8__ #elif __VISUALC__ < 1600 # define __VISUALC9__ #elif __VISUALC__ < 1700 # define __VISUALC10__ #elif __VISUALC__ < 1800 # define __VISUALC11__ #elif __VISUALC__ < 1900 # define __VISUALC12__ #elif __VISUALC__ < 2000 /* There is no __VISUALC13__! */ # define __VISUALC14__ #else /* Don't forget to update include/msvc/wx/setup.h as well when adding support for a newer MSVC version here. */ # pragma message("Please update wx/compiler.h to recognize this VC++ version") #endif #elif defined(__BCPLUSPLUS__) && !defined(__BORLANDC__) # define __BORLANDC__ #elif defined(__SUNPRO_CC) # ifndef __SUNCC__ # define __SUNCC__ __SUNPRO_CC # endif /* Sun CC */ #endif /* compiler */ /* Macros for checking compiler version. */ /* This macro can be used to test the gcc version and can be used like this: # if wxCHECK_GCC_VERSION(3, 1) ... we have gcc 3.1 or later ... # else ... no gcc at all or gcc < 3.1 ... # endif */ #if defined(__GNUC__) && defined(__GNUC_MINOR__) #define wxCHECK_GCC_VERSION( major, minor ) \ ( ( __GNUC__ > (major) ) \ || ( __GNUC__ == (major) && __GNUC_MINOR__ >= (minor) ) ) #else #define wxCHECK_GCC_VERSION( major, minor ) 0 #endif /* This macro can be used to test the Visual C++ version. */ #ifndef __VISUALC__ # define wxVISUALC_VERSION(major) 0 # define wxCHECK_VISUALC_VERSION(major) 0 #else /* Things used to be simple with the _MSC_VER value and the version number increasing in lock step, but _MSC_VER value of 1900 is VC14 and not the non existing (presumably for the superstitious reasons) VC13, so we now need to account for this with an extra offset. */ # define wxVISUALC_VERSION(major) ( (6 - (major >= 14 ? 1 : 0) + major) * 100 ) # define wxCHECK_VISUALC_VERSION(major) ( __VISUALC__ >= wxVISUALC_VERSION(major) ) #endif /** This is similar to wxCHECK_GCC_VERSION but for Sun CC compiler. */ #ifdef __SUNCC__ /* __SUNCC__ is 0xVRP where V is major version, R release and P patch level */ #define wxCHECK_SUNCC_VERSION(maj, min) (__SUNCC__ >= (((maj)<<8) | ((min)<<4))) #else #define wxCHECK_SUNCC_VERSION(maj, min) (0) #endif /* wxCHECK_MINGW32_VERSION() is defined in wx/msw/gccpriv.h which is included later, see comments there. */ #endif // _WX_COMPILER_H_
h
rticonnextdds-usecases
data/projects/rticonnextdds-usecases/VehicleTracking/ExampleCode/thirdparty/wxWidgets-3.1.2/Linux/include/wx/wxchar.h
////////////////////////////////////////////////////////////////////////////// // Name: wx/wxchar.h // Purpose: Declarations common to wx char/wchar_t usage (wide chars) // Author: Joel Farley, Ove Kåven // Modified by: Vadim Zeitlin, Robert Roebling, Ron Lee // Created: 1998/06/12 // Copyright: (c) 1998-2006 wxWidgets dev team // Licence: wxWindows licence /////////////////////////////////////////////////////////////////////////////// #ifndef _WX_WXCHAR_H_ #define _WX_WXCHAR_H_ // This header used to define CRT functions wrappers in wxWidgets 2.8. This is // now done in (headers included by) wx/crt.h, so include it for compatibility: #include "wx/crt.h" #endif /* _WX_WXCHAR_H_ */
h
rticonnextdds-usecases
data/projects/rticonnextdds-usecases/VehicleTracking/ExampleCode/thirdparty/wxWidgets-3.1.2/Linux/include/wx/ptr_scpd.h
/////////////////////////////////////////////////////////////////////////////// // Name: wx/ptr_scpd.h // Purpose: compatibility wrapper for wxScoped{Ptr,Array} // Author: Vadim Zeitlin // Created: 2009-02-03 // Copyright: (c) 2009 Vadim Zeitlin <[email protected]> // Licence: wxWindows licence /////////////////////////////////////////////////////////////////////////////// // do not include this file in any new code, include either wx/scopedptr.h or // wx/scopedarray.h (or both) instead #include "wx/scopedarray.h" #include "wx/scopedptr.h"
h
rticonnextdds-usecases
data/projects/rticonnextdds-usecases/VehicleTracking/ExampleCode/thirdparty/wxWidgets-3.1.2/Linux/include/wx/containr.h
/////////////////////////////////////////////////////////////////////////////// // Name: wx/containr.h // Purpose: wxControlContainer and wxNavigationEnabled declarations // Author: Vadim Zeitlin // Modified by: // Created: 06.08.01 // Copyright: (c) 2001, 2011 Vadim Zeitlin <[email protected]> // Licence: wxWindows licence /////////////////////////////////////////////////////////////////////////////// #ifndef _WX_CONTAINR_H_ #define _WX_CONTAINR_H_ #include "wx/defs.h" #ifndef wxHAS_NATIVE_TAB_TRAVERSAL // We need wxEVT_XXX declarations in this case. #include "wx/event.h" #endif class WXDLLIMPEXP_FWD_CORE wxWindow; class WXDLLIMPEXP_FWD_CORE wxWindowBase; /* This header declares wxControlContainer class however it's not a real container of controls but rather just a helper used to implement TAB navigation among the window children. You should rarely need to use it directly, derive from the documented public wxNavigationEnabled<> class to implement TAB navigation in a custom composite window. */ // ---------------------------------------------------------------------------- // wxControlContainerBase: common part used in both native and generic cases // ---------------------------------------------------------------------------- class WXDLLIMPEXP_CORE wxControlContainerBase { public: // default ctor, SetContainerWindow() must be called later wxControlContainerBase() { m_winParent = NULL; // By default, we accept focus ourselves. m_acceptsFocusSelf = true; // But we don't have any children accepting it yet. m_acceptsFocusChildren = false; m_inSetFocus = false; m_winLastFocused = NULL; } virtual ~wxControlContainerBase() {} void SetContainerWindow(wxWindow *winParent) { wxASSERT_MSG( !m_winParent, wxT("shouldn't be called twice") ); m_winParent = winParent; } // This can be called by the window to indicate that it never wants to have // the focus for itself. void DisableSelfFocus() { m_acceptsFocusSelf = false; UpdateParentCanFocus(); } // This can be called to undo the effect of a previous DisableSelfFocus() // (otherwise calling it is not necessary as the window does accept focus // by default). void EnableSelfFocus() { m_acceptsFocusSelf = true; UpdateParentCanFocus(); } // should be called from SetFocus(), returns false if we did nothing with // the focus and the default processing should take place bool DoSetFocus(); // returns whether we should accept focus ourselves or not bool AcceptsFocus() const; // Returns whether we or one of our children accepts focus. bool AcceptsFocusRecursively() const { return AcceptsFocus() || (m_acceptsFocusChildren && HasAnyChildrenAcceptingFocus()); } // We accept focus from keyboard if we accept it at all. bool AcceptsFocusFromKeyboard() const { return AcceptsFocusRecursively(); } // Call this when the number of children of the window changes. // // Returns true if we have any focusable children, false otherwise. bool UpdateCanFocusChildren(); #ifdef __WXMSW__ // This is not strictly related to navigation, but all windows containing // more than one children controls need to return from this method if any // of their parents has an inheritable background, so do this automatically // for all of them (another alternative could be to do it in wxWindow // itself but this would be potentially more backwards incompatible and // could conceivably break some custom windows). bool HasTransparentBackground() const; #endif // __WXMSW__ protected: // set the focus to the child which had it the last time virtual bool SetFocusToChild(); // return true if we have any children accepting focus bool HasAnyFocusableChildren() const; // return true if we have any children that do accept focus right now bool HasAnyChildrenAcceptingFocus() const; // the parent window we manage the children for wxWindow *m_winParent; // the child which had the focus last time this panel was activated wxWindow *m_winLastFocused; private: // Update the window status to reflect whether it is getting focus or not. void UpdateParentCanFocus(); // Indicates whether the associated window can ever have focus itself. // // Usually this is the case, e.g. a wxPanel can be used either as a // container for its children or just as a normal window which can be // focused. But sometimes, e.g. for wxStaticBox, we can never have focus // ourselves and can only get it if we have any focusable children. bool m_acceptsFocusSelf; // Cached value remembering whether we have any children accepting focus. bool m_acceptsFocusChildren; // a guard against infinite recursion bool m_inSetFocus; }; #ifdef wxHAS_NATIVE_TAB_TRAVERSAL // ---------------------------------------------------------------------------- // wxControlContainer for native TAB navigation // ---------------------------------------------------------------------------- // this must be a real class as we forward-declare it elsewhere class WXDLLIMPEXP_CORE wxControlContainer : public wxControlContainerBase { protected: // set the focus to the child which had it the last time virtual bool SetFocusToChild() wxOVERRIDE; }; #else // !wxHAS_NATIVE_TAB_TRAVERSAL // ---------------------------------------------------------------------------- // wxControlContainer for TAB navigation implemented in wx itself // ---------------------------------------------------------------------------- class WXDLLIMPEXP_CORE wxControlContainer : public wxControlContainerBase { public: // default ctor, SetContainerWindow() must be called later wxControlContainer(); // the methods to be called from the window event handlers void HandleOnNavigationKey(wxNavigationKeyEvent& event); void HandleOnFocus(wxFocusEvent& event); void HandleOnWindowDestroy(wxWindowBase *child); // called from OnChildFocus() handler, i.e. when one of our (grand) // children gets the focus void SetLastFocus(wxWindow *win); protected: wxDECLARE_NO_COPY_CLASS(wxControlContainer); }; #endif // wxHAS_NATIVE_TAB_TRAVERSAL/!wxHAS_NATIVE_TAB_TRAVERSAL // this function is for wxWidgets internal use only extern WXDLLIMPEXP_CORE bool wxSetFocusToChild(wxWindow *win, wxWindow **child); // ---------------------------------------------------------------------------- // wxNavigationEnabled: Derive from this class to support keyboard navigation // among window children in a wxWindow-derived class. The details of this class // don't matter, you just need to derive from it to make navigation work. // ---------------------------------------------------------------------------- // The template parameter W must be a wxWindow-derived class. template <class W> class wxNavigationEnabled : public W { public: typedef W BaseWindowClass; wxNavigationEnabled() { m_container.SetContainerWindow(this); #ifndef wxHAS_NATIVE_TAB_TRAVERSAL BaseWindowClass::Bind(wxEVT_NAVIGATION_KEY, &wxNavigationEnabled::OnNavigationKey, this); BaseWindowClass::Bind(wxEVT_SET_FOCUS, &wxNavigationEnabled::OnFocus, this); BaseWindowClass::Bind(wxEVT_CHILD_FOCUS, &wxNavigationEnabled::OnChildFocus, this); #endif // !wxHAS_NATIVE_TAB_TRAVERSAL } WXDLLIMPEXP_INLINE_CORE virtual bool AcceptsFocus() const wxOVERRIDE { return m_container.AcceptsFocus(); } WXDLLIMPEXP_INLINE_CORE virtual bool AcceptsFocusRecursively() const wxOVERRIDE { return m_container.AcceptsFocusRecursively(); } WXDLLIMPEXP_INLINE_CORE virtual bool AcceptsFocusFromKeyboard() const wxOVERRIDE { return m_container.AcceptsFocusFromKeyboard(); } WXDLLIMPEXP_INLINE_CORE virtual void AddChild(wxWindowBase *child) wxOVERRIDE { BaseWindowClass::AddChild(child); if ( m_container.UpdateCanFocusChildren() ) { // Under MSW we must have wxTAB_TRAVERSAL style for TAB navigation // to work. if ( !BaseWindowClass::HasFlag(wxTAB_TRAVERSAL) ) BaseWindowClass::ToggleWindowStyle(wxTAB_TRAVERSAL); } } WXDLLIMPEXP_INLINE_CORE virtual void RemoveChild(wxWindowBase *child) wxOVERRIDE { #ifndef wxHAS_NATIVE_TAB_TRAVERSAL m_container.HandleOnWindowDestroy(child); #endif // !wxHAS_NATIVE_TAB_TRAVERSAL BaseWindowClass::RemoveChild(child); // We could reset wxTAB_TRAVERSAL here but it doesn't seem to do any // harm to keep it. m_container.UpdateCanFocusChildren(); } WXDLLIMPEXP_INLINE_CORE virtual void SetFocus() wxOVERRIDE { if ( !m_container.DoSetFocus() ) BaseWindowClass::SetFocus(); } void SetFocusIgnoringChildren() { BaseWindowClass::SetFocus(); } #ifdef __WXMSW__ WXDLLIMPEXP_INLINE_CORE virtual bool HasTransparentBackground() wxOVERRIDE { return m_container.HasTransparentBackground(); } #endif // __WXMSW__ protected: #ifndef wxHAS_NATIVE_TAB_TRAVERSAL void OnNavigationKey(wxNavigationKeyEvent& event) { m_container.HandleOnNavigationKey(event); } void OnFocus(wxFocusEvent& event) { m_container.HandleOnFocus(event); } void OnChildFocus(wxChildFocusEvent& event) { m_container.SetLastFocus(event.GetWindow()); event.Skip(); } #endif // !wxHAS_NATIVE_TAB_TRAVERSAL wxControlContainer m_container; wxDECLARE_NO_COPY_TEMPLATE_CLASS(wxNavigationEnabled, W); }; // ---------------------------------------------------------------------------- // Compatibility macros from now on, do NOT use them and preferably do not even // look at them. // ---------------------------------------------------------------------------- #if WXWIN_COMPATIBILITY_2_8 // common part of WX_DECLARE_CONTROL_CONTAINER in the native and generic cases, // it should be used in the wxWindow-derived class declaration #define WX_DECLARE_CONTROL_CONTAINER_BASE() \ public: \ virtual bool AcceptsFocus() const; \ virtual bool AcceptsFocusRecursively() const; \ virtual bool AcceptsFocusFromKeyboard() const; \ virtual void AddChild(wxWindowBase *child); \ virtual void RemoveChild(wxWindowBase *child); \ virtual void SetFocus(); \ void SetFocusIgnoringChildren(); \ \ protected: \ wxControlContainer m_container // this macro must be used in the derived class ctor #define WX_INIT_CONTROL_CONTAINER() \ m_container.SetContainerWindow(this) // common part of WX_DELEGATE_TO_CONTROL_CONTAINER in the native and generic // cases, must be used in the wxWindow-derived class implementation #define WX_DELEGATE_TO_CONTROL_CONTAINER_BASE(classname, basename) \ void classname::AddChild(wxWindowBase *child) \ { \ basename::AddChild(child); \ \ m_container.UpdateCanFocusChildren(); \ } \ \ bool classname::AcceptsFocusRecursively() const \ { \ return m_container.AcceptsFocusRecursively(); \ } \ \ void classname::SetFocus() \ { \ if ( !m_container.DoSetFocus() ) \ basename::SetFocus(); \ } \ \ bool classname::AcceptsFocus() const \ { \ return m_container.AcceptsFocus(); \ } \ \ bool classname::AcceptsFocusFromKeyboard() const \ { \ return m_container.AcceptsFocusFromKeyboard(); \ } #ifdef wxHAS_NATIVE_TAB_TRAVERSAL #define WX_EVENT_TABLE_CONTROL_CONTAINER(classname) #define WX_DECLARE_CONTROL_CONTAINER WX_DECLARE_CONTROL_CONTAINER_BASE #define WX_DELEGATE_TO_CONTROL_CONTAINER(classname, basename) \ WX_DELEGATE_TO_CONTROL_CONTAINER_BASE(classname, basename) \ \ void classname::RemoveChild(wxWindowBase *child) \ { \ basename::RemoveChild(child); \ \ m_container.UpdateCanFocusChildren(); \ } \ \ void classname::SetFocusIgnoringChildren() \ { \ basename::SetFocus(); \ } #else // !wxHAS_NATIVE_TAB_TRAVERSAL // declare the methods to be forwarded #define WX_DECLARE_CONTROL_CONTAINER() \ WX_DECLARE_CONTROL_CONTAINER_BASE(); \ \ public: \ void OnNavigationKey(wxNavigationKeyEvent& event); \ void OnFocus(wxFocusEvent& event); \ virtual void OnChildFocus(wxChildFocusEvent& event) // implement the event table entries for wxControlContainer #define WX_EVENT_TABLE_CONTROL_CONTAINER(classname) \ EVT_SET_FOCUS(classname::OnFocus) \ EVT_CHILD_FOCUS(classname::OnChildFocus) \ EVT_NAVIGATION_KEY(classname::OnNavigationKey) // implement the methods forwarding to the wxControlContainer #define WX_DELEGATE_TO_CONTROL_CONTAINER(classname, basename) \ WX_DELEGATE_TO_CONTROL_CONTAINER_BASE(classname, basename) \ \ void classname::RemoveChild(wxWindowBase *child) \ { \ m_container.HandleOnWindowDestroy(child); \ \ basename::RemoveChild(child); \ \ m_container.UpdateCanFocusChildren(); \ } \ \ void classname::OnNavigationKey( wxNavigationKeyEvent& event ) \ { \ m_container.HandleOnNavigationKey(event); \ } \ \ void classname::SetFocusIgnoringChildren() \ { \ basename::SetFocus(); \ } \ \ void classname::OnChildFocus(wxChildFocusEvent& event) \ { \ m_container.SetLastFocus(event.GetWindow()); \ event.Skip(); \ } \ \ void classname::OnFocus(wxFocusEvent& event) \ { \ m_container.HandleOnFocus(event); \ } #endif // wxHAS_NATIVE_TAB_TRAVERSAL/!wxHAS_NATIVE_TAB_TRAVERSAL #endif // WXWIN_COMPATIBILITY_2_8 #endif // _WX_CONTAINR_H_
h
rticonnextdds-usecases
data/projects/rticonnextdds-usecases/VehicleTracking/ExampleCode/thirdparty/wxWidgets-3.1.2/Linux/include/wx/datetime.h
///////////////////////////////////////////////////////////////////////////// // Name: wx/datetime.h // Purpose: declarations of time/date related classes (wxDateTime, // wxTimeSpan) // Author: Vadim Zeitlin // Modified by: // Created: 10.02.99 // Copyright: (c) 1998 Vadim Zeitlin <[email protected]> // Licence: wxWindows licence ///////////////////////////////////////////////////////////////////////////// #ifndef _WX_DATETIME_H #define _WX_DATETIME_H #include "wx/defs.h" #if wxUSE_DATETIME #include <time.h> #include <limits.h> // for INT_MIN #include "wx/longlong.h" #include "wx/anystr.h" class WXDLLIMPEXP_FWD_BASE wxDateTime; class WXDLLIMPEXP_FWD_BASE wxTimeSpan; class WXDLLIMPEXP_FWD_BASE wxDateSpan; #ifdef __WINDOWS__ struct _SYSTEMTIME; #endif #include "wx/dynarray.h" // not all c-runtimes are based on 1/1/1970 being (time_t) 0 // set this to the corresponding value in seconds 1/1/1970 has on your // systems c-runtime #define WX_TIME_BASE_OFFSET 0 /* * TODO * * + 1. Time zones with minutes (make TimeZone a class) * ? 2. getdate() function like under Solaris * + 3. text conversion for wxDateSpan * + 4. pluggable modules for the workdays calculations * 5. wxDateTimeHolidayAuthority for Easter and other christian feasts */ /* The three (main) classes declared in this header represent: 1. An absolute moment in the time (wxDateTime) 2. A difference between two moments in the time, positive or negative (wxTimeSpan) 3. A logical difference between two dates expressed in years/months/weeks/days (wxDateSpan) The following arithmetic operations are permitted (all others are not): addition -------- wxDateTime + wxTimeSpan = wxDateTime wxDateTime + wxDateSpan = wxDateTime wxTimeSpan + wxTimeSpan = wxTimeSpan wxDateSpan + wxDateSpan = wxDateSpan subtraction ------------ wxDateTime - wxDateTime = wxTimeSpan wxDateTime - wxTimeSpan = wxDateTime wxDateTime - wxDateSpan = wxDateTime wxTimeSpan - wxTimeSpan = wxTimeSpan wxDateSpan - wxDateSpan = wxDateSpan multiplication -------------- wxTimeSpan * number = wxTimeSpan number * wxTimeSpan = wxTimeSpan wxDateSpan * number = wxDateSpan number * wxDateSpan = wxDateSpan unitary minus ------------- -wxTimeSpan = wxTimeSpan -wxDateSpan = wxDateSpan For each binary operation OP (+, -, *) we have the following operatorOP=() as a method and the method with a symbolic name OPER (Add, Subtract, Multiply) as a synonym for it and another const method with the same name which returns the changed copy of the object and operatorOP() as a global function which is implemented in terms of the const version of OPEN. For the unary - we have operator-() as a method, Neg() as synonym for it and Negate() which returns the copy of the object with the changed sign. */ // an invalid/default date time object which may be used as the default // argument for arguments of type wxDateTime; it is also returned by all // functions returning wxDateTime on failure (this is why it is also called // wxInvalidDateTime) class WXDLLIMPEXP_FWD_BASE wxDateTime; extern WXDLLIMPEXP_DATA_BASE(const char) wxDefaultDateTimeFormat[]; extern WXDLLIMPEXP_DATA_BASE(const char) wxDefaultTimeSpanFormat[]; extern WXDLLIMPEXP_DATA_BASE(const wxDateTime) wxDefaultDateTime; #define wxInvalidDateTime wxDefaultDateTime // ---------------------------------------------------------------------------- // conditional compilation // ---------------------------------------------------------------------------- // if configure detected strftime(), we have it too #ifdef HAVE_STRFTIME #define wxHAS_STRFTIME // suppose everyone else has strftime #else #define wxHAS_STRFTIME #endif // ---------------------------------------------------------------------------- // wxDateTime represents an absolute moment in the time // ---------------------------------------------------------------------------- class WXDLLIMPEXP_BASE wxDateTime { public: // types // ------------------------------------------------------------------------ // a small unsigned integer type for storing things like minutes, // seconds &c. It should be at least short (i.e. not char) to contain // the number of milliseconds - it may also be 'int' because there is // no size penalty associated with it in our code, we don't store any // data in this format typedef unsigned short wxDateTime_t; // constants // ------------------------------------------------------------------------ // the timezones enum TZ { // the time in the current time zone Local, // zones from GMT (= Greenwich Mean Time): they're guaranteed to be // consequent numbers, so writing something like `GMT0 + offset' is // safe if abs(offset) <= 12 // underscore stands for minus GMT_12, GMT_11, GMT_10, GMT_9, GMT_8, GMT_7, GMT_6, GMT_5, GMT_4, GMT_3, GMT_2, GMT_1, GMT0, GMT1, GMT2, GMT3, GMT4, GMT5, GMT6, GMT7, GMT8, GMT9, GMT10, GMT11, GMT12, GMT13, // Note that GMT12 and GMT_12 are not the same: there is a difference // of exactly one day between them // some symbolic names for TZ // Europe WET = GMT0, // Western Europe Time WEST = GMT1, // Western Europe Summer Time CET = GMT1, // Central Europe Time CEST = GMT2, // Central Europe Summer Time EET = GMT2, // Eastern Europe Time EEST = GMT3, // Eastern Europe Summer Time MSK = GMT3, // Moscow Time MSD = GMT4, // Moscow Summer Time // US and Canada AST = GMT_4, // Atlantic Standard Time ADT = GMT_3, // Atlantic Daylight Time EST = GMT_5, // Eastern Standard Time EDT = GMT_4, // Eastern Daylight Saving Time CST = GMT_6, // Central Standard Time CDT = GMT_5, // Central Daylight Saving Time MST = GMT_7, // Mountain Standard Time MDT = GMT_6, // Mountain Daylight Saving Time PST = GMT_8, // Pacific Standard Time PDT = GMT_7, // Pacific Daylight Saving Time HST = GMT_10, // Hawaiian Standard Time AKST = GMT_9, // Alaska Standard Time AKDT = GMT_8, // Alaska Daylight Saving Time // Australia A_WST = GMT8, // Western Standard Time A_CST = GMT13 + 1, // Central Standard Time (+9.5) A_EST = GMT10, // Eastern Standard Time A_ESST = GMT11, // Eastern Summer Time // New Zealand NZST = GMT12, // Standard Time NZDT = GMT13, // Daylight Saving Time // TODO add more symbolic timezone names here // Universal Coordinated Time = the new and politically correct name // for GMT UTC = GMT0 }; // the calendar systems we know about: notice that it's valid (for // this classes purpose anyhow) to work with any of these calendars // even with the dates before the historical appearance of the // calendar enum Calendar { Gregorian, // current calendar Julian // calendar in use since -45 until the 1582 (or later) // TODO Hebrew, Chinese, Maya, ... (just kidding) (or then may be not?) }; // the country parameter is used so far for calculating the start and // the end of DST period and for deciding whether the date is a work // day or not // // TODO move this to intl.h enum Country { Country_Unknown, // no special information for this country Country_Default, // set the default country with SetCountry() method // or use the default country with any other // TODO add more countries (for this we must know about DST and/or // holidays for this country) // Western European countries: we assume that they all follow the same // DST rules (true or false?) Country_WesternEurope_Start, Country_EEC = Country_WesternEurope_Start, France, Germany, UK, Country_WesternEurope_End = UK, Russia, USA }; // symbolic names for the months enum Month { Jan, Feb, Mar, Apr, May, Jun, Jul, Aug, Sep, Oct, Nov, Dec, Inv_Month }; // symbolic names for the weekdays enum WeekDay { Sun, Mon, Tue, Wed, Thu, Fri, Sat, Inv_WeekDay }; // invalid value for the year enum Year { Inv_Year = SHRT_MIN // should hold in wxDateTime_t }; // flags for GetWeekDayName and GetMonthName enum NameFlags { Name_Full = 0x01, // return full name Name_Abbr = 0x02 // return abbreviated name }; // flags for GetWeekOfYear and GetWeekOfMonth enum WeekFlags { Default_First, // Sunday_First for US, Monday_First for the rest Monday_First, // week starts with a Monday Sunday_First // week starts with a Sunday }; // Currently we assume that DST is always shifted by 1 hour, this seems to // be always true in practice. If this ever needs to change, search for all // places using DST_OFFSET and update them. enum { DST_OFFSET = 3600 }; // helper classes // ------------------------------------------------------------------------ // a class representing a time zone: basically, this is just an offset // (in seconds) from GMT class WXDLLIMPEXP_BASE TimeZone { public: TimeZone(TZ tz); // create time zone object with the given offset TimeZone(long offset = 0) { m_offset = offset; } static TimeZone Make(long offset) { TimeZone tz; tz.m_offset = offset; return tz; } bool IsLocal() const { return m_offset == -1; } long GetOffset() const; private: // offset for this timezone from GMT in seconds long m_offset; }; // standard struct tm is limited to the years from 1900 (because // tm_year field is the offset from 1900), so we use our own struct // instead to represent broken down time // // NB: this struct should always be kept normalized (i.e. mon should // be < 12, 1 <= day <= 31 &c), so use AddMonths(), AddDays() // instead of modifying the member fields directly! struct WXDLLIMPEXP_BASE Tm { wxDateTime_t msec, sec, min, hour, mday, // Day of the month in 1..31 range. yday; // Day of the year in 0..365 range. Month mon; int year; // default ctor inits the object to an invalid value Tm(); // ctor from struct tm and the timezone Tm(const struct tm& tm, const TimeZone& tz); // check that the given date/time is valid (in Gregorian calendar) bool IsValid() const; // get the week day WeekDay GetWeekDay() // not const because wday may be changed { if ( wday == Inv_WeekDay ) ComputeWeekDay(); return (WeekDay)wday; } // add the given number of months to the date keeping it normalized void AddMonths(int monDiff); // add the given number of months to the date keeping it normalized void AddDays(int dayDiff); private: // compute the weekday from other fields void ComputeWeekDay(); // the timezone we correspond to TimeZone m_tz; // This value can only be accessed via GetWeekDay() and not directly // because it's not always computed when creating this object and may // need to be calculated on demand. wxDateTime_t wday; }; // static methods // ------------------------------------------------------------------------ // set the current country static void SetCountry(Country country); // get the current country static Country GetCountry(); // return true if the country is a West European one (in practice, // this means that the same DST rules as for EEC apply) static bool IsWestEuropeanCountry(Country country = Country_Default); // return the current year static int GetCurrentYear(Calendar cal = Gregorian); // convert the year as returned by wxDateTime::GetYear() to a year // suitable for BC/AD notation. The difference is that BC year 1 // corresponds to the year 0 (while BC year 0 didn't exist) and AD // year N is just year N. static int ConvertYearToBC(int year); // return the current month static Month GetCurrentMonth(Calendar cal = Gregorian); // returns true if the given year is a leap year in the given calendar static bool IsLeapYear(int year = Inv_Year, Calendar cal = Gregorian); // acquires the first day of week based on locale and/or OS settings static bool GetFirstWeekDay(WeekDay *firstDay); // get the century (19 for 1999, 20 for 2000 and -5 for 492 BC) static int GetCentury(int year); // returns the number of days in this year (356 or 355 for Gregorian // calendar usually :-) static wxDateTime_t GetNumberOfDays(int year, Calendar cal = Gregorian); // get the number of the days in the given month (default value for // the year means the current one) static wxDateTime_t GetNumberOfDays(Month month, int year = Inv_Year, Calendar cal = Gregorian); // get the full (default) or abbreviated month name in the current // locale, returns empty string on error static wxString GetMonthName(Month month, NameFlags flags = Name_Full); // get the standard English full (default) or abbreviated month name static wxString GetEnglishMonthName(Month month, NameFlags flags = Name_Full); // get the full (default) or abbreviated weekday name in the current // locale, returns empty string on error static wxString GetWeekDayName(WeekDay weekday, NameFlags flags = Name_Full); // get the standard English full (default) or abbreviated weekday name static wxString GetEnglishWeekDayName(WeekDay weekday, NameFlags flags = Name_Full); // get the AM and PM strings in the current locale (may be empty) static void GetAmPmStrings(wxString *am, wxString *pm); // return true if the given country uses DST for this year static bool IsDSTApplicable(int year = Inv_Year, Country country = Country_Default); // get the beginning of DST for this year, will return invalid object // if no DST applicable in this year. The default value of the // parameter means to take the current year. static wxDateTime GetBeginDST(int year = Inv_Year, Country country = Country_Default); // get the end of DST for this year, will return invalid object // if no DST applicable in this year. The default value of the // parameter means to take the current year. static wxDateTime GetEndDST(int year = Inv_Year, Country country = Country_Default); // return the wxDateTime object for the current time static inline wxDateTime Now(); // return the wxDateTime object for the current time with millisecond // precision (if available on this platform) static wxDateTime UNow(); // return the wxDateTime object for today midnight: i.e. as Now() but // with time set to 0 static inline wxDateTime Today(); // constructors: you should test whether the constructor succeeded with // IsValid() function. The values Inv_Month and Inv_Year for the // parameters mean take current month and/or year values. // ------------------------------------------------------------------------ // default ctor does not initialize the object, use Set()! wxDateTime() { m_time = wxINT64_MIN; } // from time_t: seconds since the Epoch 00:00:00 UTC, Jan 1, 1970) inline wxDateTime(time_t timet); // from broken down time/date (only for standard Unix range) inline wxDateTime(const struct tm& tm); // from broken down time/date (any range) inline wxDateTime(const Tm& tm); // from JDN (beware of rounding errors) inline wxDateTime(double jdn); // from separate values for each component, date set to today inline wxDateTime(wxDateTime_t hour, wxDateTime_t minute = 0, wxDateTime_t second = 0, wxDateTime_t millisec = 0); // from separate values for each component with explicit date inline wxDateTime(wxDateTime_t day, // day of the month Month month, int year = Inv_Year, // 1999, not 99 please! wxDateTime_t hour = 0, wxDateTime_t minute = 0, wxDateTime_t second = 0, wxDateTime_t millisec = 0); #ifdef __WINDOWS__ wxDateTime(const struct _SYSTEMTIME& st) { SetFromMSWSysTime(st); } #endif // default copy ctor ok // no dtor // assignment operators and Set() functions: all non const methods return // the reference to this object. IsValid() should be used to test whether // the function succeeded. // ------------------------------------------------------------------------ // set to the current time inline wxDateTime& SetToCurrent(); // set to given time_t value inline wxDateTime& Set(time_t timet); // set to given broken down time/date wxDateTime& Set(const struct tm& tm); // set to given broken down time/date inline wxDateTime& Set(const Tm& tm); // set to given JDN (beware of rounding errors) wxDateTime& Set(double jdn); // set to given time, date = today wxDateTime& Set(wxDateTime_t hour, wxDateTime_t minute = 0, wxDateTime_t second = 0, wxDateTime_t millisec = 0); // from separate values for each component with explicit date // (defaults for month and year are the current values) wxDateTime& Set(wxDateTime_t day, Month month, int year = Inv_Year, // 1999, not 99 please! wxDateTime_t hour = 0, wxDateTime_t minute = 0, wxDateTime_t second = 0, wxDateTime_t millisec = 0); // resets time to 00:00:00, doesn't change the date wxDateTime& ResetTime(); // get the date part of this object only, i.e. the object which has the // same date as this one but time of 00:00:00 wxDateTime GetDateOnly() const; // the following functions don't change the values of the other // fields, i.e. SetMinute() won't change either hour or seconds value // set the year wxDateTime& SetYear(int year); // set the month wxDateTime& SetMonth(Month month); // set the day of the month wxDateTime& SetDay(wxDateTime_t day); // set hour wxDateTime& SetHour(wxDateTime_t hour); // set minute wxDateTime& SetMinute(wxDateTime_t minute); // set second wxDateTime& SetSecond(wxDateTime_t second); // set millisecond wxDateTime& SetMillisecond(wxDateTime_t millisecond); // assignment operator from time_t wxDateTime& operator=(time_t timet) { return Set(timet); } // assignment operator from broken down time/date wxDateTime& operator=(const struct tm& tm) { return Set(tm); } // assignment operator from broken down time/date wxDateTime& operator=(const Tm& tm) { return Set(tm); } // default assignment operator is ok // calendar calculations (functions which set the date only leave the time // unchanged, e.g. don't explicitly zero it): SetXXX() functions modify the // object itself, GetXXX() ones return a new object. // ------------------------------------------------------------------------ // set to the given week day in the same week as this one wxDateTime& SetToWeekDayInSameWeek(WeekDay weekday, WeekFlags flags = Monday_First); inline wxDateTime GetWeekDayInSameWeek(WeekDay weekday, WeekFlags flags = Monday_First) const; // set to the next week day following this one wxDateTime& SetToNextWeekDay(WeekDay weekday); inline wxDateTime GetNextWeekDay(WeekDay weekday) const; // set to the previous week day before this one wxDateTime& SetToPrevWeekDay(WeekDay weekday); inline wxDateTime GetPrevWeekDay(WeekDay weekday) const; // set to Nth occurrence of given weekday in the given month of the // given year (time is set to 0), return true on success and false on // failure. n may be positive (1..5) or negative to count from the end // of the month (see helper function SetToLastWeekDay()) bool SetToWeekDay(WeekDay weekday, int n = 1, Month month = Inv_Month, int year = Inv_Year); inline wxDateTime GetWeekDay(WeekDay weekday, int n = 1, Month month = Inv_Month, int year = Inv_Year) const; // sets to the last weekday in the given month, year inline bool SetToLastWeekDay(WeekDay weekday, Month month = Inv_Month, int year = Inv_Year); inline wxDateTime GetLastWeekDay(WeekDay weekday, Month month = Inv_Month, int year = Inv_Year); // returns the date corresponding to the given week day of the given // week (in ISO notation) of the specified year static wxDateTime SetToWeekOfYear(int year, wxDateTime_t numWeek, WeekDay weekday = Mon); // sets the date to the last day of the given (or current) month or the // given (or current) year wxDateTime& SetToLastMonthDay(Month month = Inv_Month, int year = Inv_Year); inline wxDateTime GetLastMonthDay(Month month = Inv_Month, int year = Inv_Year) const; // sets to the given year day (1..365 or 366) wxDateTime& SetToYearDay(wxDateTime_t yday); inline wxDateTime GetYearDay(wxDateTime_t yday) const; // The definitions below were taken verbatim from // // http://www.capecod.net/~pbaum/date/date0.htm // // (Peter Baum's home page) // // definition: The Julian Day Number, Julian Day, or JD of a // particular instant of time is the number of days and fractions of a // day since 12 hours Universal Time (Greenwich mean noon) on January // 1 of the year -4712, where the year is given in the Julian // proleptic calendar. The idea of using this reference date was // originally proposed by Joseph Scalizer in 1582 to count years but // it was modified by 19th century astronomers to count days. One // could have equivalently defined the reference time to be noon of // November 24, -4713 if were understood that Gregorian calendar rules // were applied. Julian days are Julian Day Numbers and are not to be // confused with Julian dates. // // definition: The Rata Die number is a date specified as the number // of days relative to a base date of December 31 of the year 0. Thus // January 1 of the year 1 is Rata Die day 1. // get the Julian Day number (the fractional part specifies the time of // the day, related to noon - beware of rounding errors!) double GetJulianDayNumber() const; double GetJDN() const { return GetJulianDayNumber(); } // get the Modified Julian Day number: it is equal to JDN - 2400000.5 // and so integral MJDs correspond to the midnights (and not noons). // MJD 0 is Nov 17, 1858 double GetModifiedJulianDayNumber() const { return GetJDN() - 2400000.5; } double GetMJD() const { return GetModifiedJulianDayNumber(); } // get the Rata Die number double GetRataDie() const; // TODO algorithms for calculating some important dates, such as // religious holidays (Easter...) or moon/solar eclipses? Some // algorithms can be found in the calendar FAQ // Timezone stuff: a wxDateTime object constructed using given // day/month/year/hour/min/sec values is interpreted as this moment in // local time. Using the functions below, it may be converted to another // time zone (e.g., the Unix epoch is wxDateTime(1, Jan, 1970).ToGMT()). // // These functions try to handle DST internally, but there is no magical // way to know all rules for it in all countries in the world, so if the // program can handle it itself (or doesn't want to handle it at all for // whatever reason), the DST handling can be disabled with noDST. // ------------------------------------------------------------------------ // transform to any given timezone inline wxDateTime ToTimezone(const TimeZone& tz, bool noDST = false) const; wxDateTime& MakeTimezone(const TimeZone& tz, bool noDST = false); // interpret current value as being in another timezone and transform // it to local one inline wxDateTime FromTimezone(const TimeZone& tz, bool noDST = false) const; wxDateTime& MakeFromTimezone(const TimeZone& tz, bool noDST = false); // transform to/from GMT/UTC wxDateTime ToUTC(bool noDST = false) const { return ToTimezone(UTC, noDST); } wxDateTime& MakeUTC(bool noDST = false) { return MakeTimezone(UTC, noDST); } wxDateTime ToGMT(bool noDST = false) const { return ToUTC(noDST); } wxDateTime& MakeGMT(bool noDST = false) { return MakeUTC(noDST); } wxDateTime FromUTC(bool noDST = false) const { return FromTimezone(UTC, noDST); } wxDateTime& MakeFromUTC(bool noDST = false) { return MakeFromTimezone(UTC, noDST); } // is daylight savings time in effect at this moment according to the // rules of the specified country? // // Return value is > 0 if DST is in effect, 0 if it is not and -1 if // the information is not available (this is compatible with ANSI C) int IsDST(Country country = Country_Default) const; // accessors: many of them take the timezone parameter which indicates the // timezone for which to make the calculations and the default value means // to do it for the current timezone of this machine (even if the function // only operates with the date it's necessary because a date may wrap as // result of timezone shift) // ------------------------------------------------------------------------ // is the date valid? inline bool IsValid() const { return m_time != wxLongLong(wxINT64_MIN); } // get the broken down date/time representation in the given timezone // // If you wish to get several time components (day, month and year), // consider getting the whole Tm strcuture first and retrieving the // value from it - this is much more efficient Tm GetTm(const TimeZone& tz = Local) const; // get the number of seconds since the Unix epoch - returns (time_t)-1 // if the value is out of range inline time_t GetTicks() const; // get the century, same as GetCentury(GetYear()) int GetCentury(const TimeZone& tz = Local) const { return GetCentury(GetYear(tz)); } // get the year (returns Inv_Year if date is invalid) int GetYear(const TimeZone& tz = Local) const { return GetTm(tz).year; } // get the month (Inv_Month if date is invalid) Month GetMonth(const TimeZone& tz = Local) const { return (Month)GetTm(tz).mon; } // get the month day (in 1..31 range, 0 if date is invalid) wxDateTime_t GetDay(const TimeZone& tz = Local) const { return GetTm(tz).mday; } // get the day of the week (Inv_WeekDay if date is invalid) WeekDay GetWeekDay(const TimeZone& tz = Local) const { return GetTm(tz).GetWeekDay(); } // get the hour of the day wxDateTime_t GetHour(const TimeZone& tz = Local) const { return GetTm(tz).hour; } // get the minute wxDateTime_t GetMinute(const TimeZone& tz = Local) const { return GetTm(tz).min; } // get the second wxDateTime_t GetSecond(const TimeZone& tz = Local) const { return GetTm(tz).sec; } // get milliseconds wxDateTime_t GetMillisecond(const TimeZone& tz = Local) const { return GetTm(tz).msec; } // get the day since the year start (1..366, 0 if date is invalid) wxDateTime_t GetDayOfYear(const TimeZone& tz = Local) const; // get the week number since the year start (1..52 or 53, 0 if date is // invalid) wxDateTime_t GetWeekOfYear(WeekFlags flags = Monday_First, const TimeZone& tz = Local) const; // get the year to which the number returned from GetWeekOfYear() // belongs int GetWeekBasedYear(const TimeZone& tz = Local) const; // get the week number since the month start (1..5, 0 if date is // invalid) wxDateTime_t GetWeekOfMonth(WeekFlags flags = Monday_First, const TimeZone& tz = Local) const; // is this date a work day? This depends on a country, of course, // because the holidays are different in different countries bool IsWorkDay(Country country = Country_Default) const; // dos date and time format // ------------------------------------------------------------------------ // set from the DOS packed format wxDateTime& SetFromDOS(unsigned long ddt); // pack the date in DOS format unsigned long GetAsDOS() const; // SYSTEMTIME format // ------------------------------------------------------------------------ #ifdef __WINDOWS__ // convert SYSTEMTIME to wxDateTime wxDateTime& SetFromMSWSysTime(const struct _SYSTEMTIME& st); // convert wxDateTime to SYSTEMTIME void GetAsMSWSysTime(struct _SYSTEMTIME* st) const; // same as above but only take date part into account, time is always zero wxDateTime& SetFromMSWSysDate(const struct _SYSTEMTIME& st); void GetAsMSWSysDate(struct _SYSTEMTIME* st) const; #endif // __WINDOWS__ // comparison (see also functions below for operator versions) // ------------------------------------------------------------------------ // returns true if the two moments are strictly identical inline bool IsEqualTo(const wxDateTime& datetime) const; // returns true if the date is strictly earlier than the given one inline bool IsEarlierThan(const wxDateTime& datetime) const; // returns true if the date is strictly later than the given one inline bool IsLaterThan(const wxDateTime& datetime) const; // returns true if the date is strictly in the given range inline bool IsStrictlyBetween(const wxDateTime& t1, const wxDateTime& t2) const; // returns true if the date is in the given range inline bool IsBetween(const wxDateTime& t1, const wxDateTime& t2) const; // do these two objects refer to the same date? inline bool IsSameDate(const wxDateTime& dt) const; // do these two objects have the same time? inline bool IsSameTime(const wxDateTime& dt) const; // are these two objects equal up to given timespan? inline bool IsEqualUpTo(const wxDateTime& dt, const wxTimeSpan& ts) const; inline bool operator<(const wxDateTime& dt) const { return GetValue() < dt.GetValue(); } inline bool operator<=(const wxDateTime& dt) const { return GetValue() <= dt.GetValue(); } inline bool operator>(const wxDateTime& dt) const { return GetValue() > dt.GetValue(); } inline bool operator>=(const wxDateTime& dt) const { return GetValue() >= dt.GetValue(); } inline bool operator==(const wxDateTime& dt) const { // Intentionally do not call GetValue() here, in order that // invalid wxDateTimes may be compared for equality return m_time == dt.m_time; } inline bool operator!=(const wxDateTime& dt) const { // As above, don't use GetValue() here. return m_time != dt.m_time; } // arithmetics with dates (see also below for more operators) // ------------------------------------------------------------------------ // return the sum of the date with a time span (positive or negative) inline wxDateTime Add(const wxTimeSpan& diff) const; // add a time span (positive or negative) inline wxDateTime& Add(const wxTimeSpan& diff); // add a time span (positive or negative) inline wxDateTime& operator+=(const wxTimeSpan& diff); inline wxDateTime operator+(const wxTimeSpan& ts) const { wxDateTime dt(*this); dt.Add(ts); return dt; } // return the difference of the date with a time span inline wxDateTime Subtract(const wxTimeSpan& diff) const; // subtract a time span (positive or negative) inline wxDateTime& Subtract(const wxTimeSpan& diff); // subtract a time span (positive or negative) inline wxDateTime& operator-=(const wxTimeSpan& diff); inline wxDateTime operator-(const wxTimeSpan& ts) const { wxDateTime dt(*this); dt.Subtract(ts); return dt; } // return the sum of the date with a date span inline wxDateTime Add(const wxDateSpan& diff) const; // add a date span (positive or negative) wxDateTime& Add(const wxDateSpan& diff); // add a date span (positive or negative) inline wxDateTime& operator+=(const wxDateSpan& diff); inline wxDateTime operator+(const wxDateSpan& ds) const { wxDateTime dt(*this); dt.Add(ds); return dt; } // return the difference of the date with a date span inline wxDateTime Subtract(const wxDateSpan& diff) const; // subtract a date span (positive or negative) inline wxDateTime& Subtract(const wxDateSpan& diff); // subtract a date span (positive or negative) inline wxDateTime& operator-=(const wxDateSpan& diff); inline wxDateTime operator-(const wxDateSpan& ds) const { wxDateTime dt(*this); dt.Subtract(ds); return dt; } // return the difference between two dates inline wxTimeSpan Subtract(const wxDateTime& dt) const; inline wxTimeSpan operator-(const wxDateTime& dt2) const; wxDateSpan DiffAsDateSpan(const wxDateTime& dt) const; // conversion to/from text // ------------------------------------------------------------------------ // all conversions functions return true to indicate whether parsing // succeeded or failed and fill in the provided end iterator, which must // not be NULL, with the location of the character where the parsing // stopped (this will be end() of the passed string if everything was // parsed) // parse a string in RFC 822 format (found e.g. in mail headers and // having the form "Wed, 10 Feb 1999 19:07:07 +0100") bool ParseRfc822Date(const wxString& date, wxString::const_iterator *end); // parse a date/time in the given format (see strptime(3)), fill in // the missing (in the string) fields with the values of dateDef (by // default, they will not change if they had valid values or will // default to Today() otherwise) bool ParseFormat(const wxString& date, const wxString& format, const wxDateTime& dateDef, wxString::const_iterator *end); bool ParseFormat(const wxString& date, const wxString& format, wxString::const_iterator *end) { return ParseFormat(date, format, wxDefaultDateTime, end); } bool ParseFormat(const wxString& date, wxString::const_iterator *end) { return ParseFormat(date, wxDefaultDateTimeFormat, wxDefaultDateTime, end); } // parse a string containing date, time or both in ISO 8601 format // // notice that these functions are new in wx 3.0 and so we don't // provide compatibility overloads for them bool ParseISODate(const wxString& date) { wxString::const_iterator end; return ParseFormat(date, wxS("%Y-%m-%d"), &end) && end == date.end(); } bool ParseISOTime(const wxString& time) { wxString::const_iterator end; return ParseFormat(time, wxS("%H:%M:%S"), &end) && end == time.end(); } bool ParseISOCombined(const wxString& datetime, char sep = 'T') { wxString::const_iterator end; const wxString fmt = wxS("%Y-%m-%d") + wxString(sep) + wxS("%H:%M:%S"); return ParseFormat(datetime, fmt, &end) && end == datetime.end(); } // parse a string containing the date/time in "free" format, this // function will try to make an educated guess at the string contents bool ParseDateTime(const wxString& datetime, wxString::const_iterator *end); // parse a string containing the date only in "free" format (less // flexible than ParseDateTime) bool ParseDate(const wxString& date, wxString::const_iterator *end); // parse a string containing the time only in "free" format bool ParseTime(const wxString& time, wxString::const_iterator *end); // this function accepts strftime()-like format string (default // argument corresponds to the preferred date and time representation // for the current locale) and returns the string containing the // resulting text representation wxString Format(const wxString& format = wxDefaultDateTimeFormat, const TimeZone& tz = Local) const; // preferred date representation for the current locale wxString FormatDate() const { return Format(wxS("%x")); } // preferred time representation for the current locale wxString FormatTime() const { return Format(wxS("%X")); } // returns the string representing the date in ISO 8601 format // (YYYY-MM-DD) wxString FormatISODate() const { return Format(wxS("%Y-%m-%d")); } // returns the string representing the time in ISO 8601 format // (HH:MM:SS) wxString FormatISOTime() const { return Format(wxS("%H:%M:%S")); } // return the combined date time representation in ISO 8601 format; the // separator character should be 'T' according to the standard but it // can also be useful to set it to ' ' wxString FormatISOCombined(char sep = 'T') const { return FormatISODate() + sep + FormatISOTime(); } // backwards compatible versions of the parsing functions: they return an // object representing the next character following the date specification // (i.e. the one where the scan had to stop) or a special NULL-like object // on failure // // they're not deprecated because a lot of existing code uses them and // there is no particular harm in keeping them but you should still prefer // the versions above in the new code wxAnyStrPtr ParseRfc822Date(const wxString& date) { wxString::const_iterator end; return ParseRfc822Date(date, &end) ? wxAnyStrPtr(date, end) : wxAnyStrPtr(); } wxAnyStrPtr ParseFormat(const wxString& date, const wxString& format = wxDefaultDateTimeFormat, const wxDateTime& dateDef = wxDefaultDateTime) { wxString::const_iterator end; return ParseFormat(date, format, dateDef, &end) ? wxAnyStrPtr(date, end) : wxAnyStrPtr(); } wxAnyStrPtr ParseDateTime(const wxString& datetime) { wxString::const_iterator end; return ParseDateTime(datetime, &end) ? wxAnyStrPtr(datetime, end) : wxAnyStrPtr(); } wxAnyStrPtr ParseDate(const wxString& date) { wxString::const_iterator end; return ParseDate(date, &end) ? wxAnyStrPtr(date, end) : wxAnyStrPtr(); } wxAnyStrPtr ParseTime(const wxString& time) { wxString::const_iterator end; return ParseTime(time, &end) ? wxAnyStrPtr(time, end) : wxAnyStrPtr(); } // In addition to wxAnyStrPtr versions above we also must provide the // overloads for C strings as we must return a pointer into the original // string and not inside a temporary wxString which would have been created // if the overloads above were used. // // And then we also have to provide the overloads for wxCStrData, as usual. // Unfortunately those ones can't return anything as we don't have any // sufficiently long-lived wxAnyStrPtr to return from them: any temporary // strings it would point to would be destroyed when this function returns // making it impossible to dereference the return value. So we just don't // return anything from here which at least allows to keep compatibility // with the code not testing the return value. Other uses of this method // need to be converted to use one of the new bool-returning overloads // above. void ParseRfc822Date(const wxCStrData& date) { ParseRfc822Date(wxString(date)); } const char* ParseRfc822Date(const char* date); const wchar_t* ParseRfc822Date(const wchar_t* date); void ParseFormat(const wxCStrData& date, const wxString& format = wxDefaultDateTimeFormat, const wxDateTime& dateDef = wxDefaultDateTime) { ParseFormat(wxString(date), format, dateDef); } const char* ParseFormat(const char* date, const wxString& format = wxDefaultDateTimeFormat, const wxDateTime& dateDef = wxDefaultDateTime); const wchar_t* ParseFormat(const wchar_t* date, const wxString& format = wxDefaultDateTimeFormat, const wxDateTime& dateDef = wxDefaultDateTime); void ParseDateTime(const wxCStrData& datetime) { ParseDateTime(wxString(datetime)); } const char* ParseDateTime(const char* datetime); const wchar_t* ParseDateTime(const wchar_t* datetime); void ParseDate(const wxCStrData& date) { ParseDate(wxString(date)); } const char* ParseDate(const char* date); const wchar_t* ParseDate(const wchar_t* date); void ParseTime(const wxCStrData& time) { ParseTime(wxString(time)); } const char* ParseTime(const char* time); const wchar_t* ParseTime(const wchar_t* time); // implementation // ------------------------------------------------------------------------ // construct from internal representation wxDateTime(const wxLongLong& time) { m_time = time; } // get the internal representation inline wxLongLong GetValue() const; // a helper function to get the current time_t static time_t GetTimeNow() { return time(NULL); } // another one to get the current time broken down static struct tm *GetTmNow() { static struct tm l_CurrentTime; return GetTmNow(&l_CurrentTime); } // get current time using thread-safe function static struct tm *GetTmNow(struct tm *tmstruct); private: // the current country - as it's the same for all program objects (unless // it runs on a _really_ big cluster system :-), this is a static member: // see SetCountry() and GetCountry() static Country ms_country; // this constant is used to transform a time_t value to the internal // representation, as time_t is in seconds and we use milliseconds it's // fixed to 1000 static const long TIME_T_FACTOR; // returns true if we fall in range in which we can use standard ANSI C // functions inline bool IsInStdRange() const; // assign the preferred first day of a week to flags, if necessary void UseEffectiveWeekDayFlags(WeekFlags &flags) const; // the internal representation of the time is the amount of milliseconds // elapsed since the origin which is set by convention to the UNIX/C epoch // value: the midnight of January 1, 1970 (UTC) wxLongLong m_time; }; // ---------------------------------------------------------------------------- // This class contains a difference between 2 wxDateTime values, so it makes // sense to add it to wxDateTime and it is the result of subtraction of 2 // objects of that class. See also wxDateSpan. // ---------------------------------------------------------------------------- class WXDLLIMPEXP_BASE wxTimeSpan { public: // constructors // ------------------------------------------------------------------------ // return the timespan for the given number of milliseconds static wxTimeSpan Milliseconds(wxLongLong ms) { return wxTimeSpan(0, 0, 0, ms); } static wxTimeSpan Millisecond() { return Milliseconds(1); } // return the timespan for the given number of seconds static wxTimeSpan Seconds(wxLongLong sec) { return wxTimeSpan(0, 0, sec); } static wxTimeSpan Second() { return Seconds(1); } // return the timespan for the given number of minutes static wxTimeSpan Minutes(long min) { return wxTimeSpan(0, min, 0 ); } static wxTimeSpan Minute() { return Minutes(1); } // return the timespan for the given number of hours static wxTimeSpan Hours(long hours) { return wxTimeSpan(hours, 0, 0); } static wxTimeSpan Hour() { return Hours(1); } // return the timespan for the given number of days static wxTimeSpan Days(long days) { return Hours(24 * days); } static wxTimeSpan Day() { return Days(1); } // return the timespan for the given number of weeks static wxTimeSpan Weeks(long days) { return Days(7 * days); } static wxTimeSpan Week() { return Weeks(1); } // default ctor constructs the 0 time span wxTimeSpan() { } // from separate values for each component, date set to 0 (hours are // not restricted to 0..24 range, neither are minutes, seconds or // milliseconds) inline wxTimeSpan(long hours, long minutes = 0, wxLongLong seconds = 0, wxLongLong milliseconds = 0); // default copy ctor is ok // no dtor // arithmetics with time spans (see also below for more operators) // ------------------------------------------------------------------------ // return the sum of two timespans inline wxTimeSpan Add(const wxTimeSpan& diff) const; // add two timespans together inline wxTimeSpan& Add(const wxTimeSpan& diff); // add two timespans together wxTimeSpan& operator+=(const wxTimeSpan& diff) { return Add(diff); } inline wxTimeSpan operator+(const wxTimeSpan& ts) const { return wxTimeSpan(GetValue() + ts.GetValue()); } // return the difference of two timespans inline wxTimeSpan Subtract(const wxTimeSpan& diff) const; // subtract another timespan inline wxTimeSpan& Subtract(const wxTimeSpan& diff); // subtract another timespan wxTimeSpan& operator-=(const wxTimeSpan& diff) { return Subtract(diff); } inline wxTimeSpan operator-(const wxTimeSpan& ts) const { return wxTimeSpan(GetValue() - ts.GetValue()); } // multiply timespan by a scalar inline wxTimeSpan Multiply(int n) const; // multiply timespan by a scalar inline wxTimeSpan& Multiply(int n); // multiply timespan by a scalar wxTimeSpan& operator*=(int n) { return Multiply(n); } inline wxTimeSpan operator*(int n) const { return wxTimeSpan(*this).Multiply(n); } // return this timespan with opposite sign wxTimeSpan Negate() const { return wxTimeSpan(-GetValue()); } // negate the value of the timespan wxTimeSpan& Neg() { m_diff = -GetValue(); return *this; } // negate the value of the timespan wxTimeSpan& operator-() { return Neg(); } // return the absolute value of the timespan: does _not_ modify the // object inline wxTimeSpan Abs() const; // there is intentionally no division because we don't want to // introduce rounding errors in time calculations // comparison (see also operator versions below) // ------------------------------------------------------------------------ // is the timespan null? bool IsNull() const { return m_diff == 0l; } // returns true if the timespan is null bool operator!() const { return !IsNull(); } // is the timespan positive? bool IsPositive() const { return m_diff > 0l; } // is the timespan negative? bool IsNegative() const { return m_diff < 0l; } // are two timespans equal? inline bool IsEqualTo(const wxTimeSpan& ts) const; // compare two timestamps: works with the absolute values, i.e. -2 // hours is longer than 1 hour. Also, it will return false if the // timespans are equal in absolute value. inline bool IsLongerThan(const wxTimeSpan& ts) const; // compare two timestamps: works with the absolute values, i.e. 1 // hour is shorter than -2 hours. Also, it will return false if the // timespans are equal in absolute value. bool IsShorterThan(const wxTimeSpan& t) const; inline bool operator<(const wxTimeSpan &ts) const { return GetValue() < ts.GetValue(); } inline bool operator<=(const wxTimeSpan &ts) const { return GetValue() <= ts.GetValue(); } inline bool operator>(const wxTimeSpan &ts) const { return GetValue() > ts.GetValue(); } inline bool operator>=(const wxTimeSpan &ts) const { return GetValue() >= ts.GetValue(); } inline bool operator==(const wxTimeSpan &ts) const { return GetValue() == ts.GetValue(); } inline bool operator!=(const wxTimeSpan &ts) const { return GetValue() != ts.GetValue(); } // breaking into days, hours, minutes and seconds // ------------------------------------------------------------------------ // get the max number of weeks in this timespan inline int GetWeeks() const; // get the max number of days in this timespan inline int GetDays() const; // get the max number of hours in this timespan inline int GetHours() const; // get the max number of minutes in this timespan inline int GetMinutes() const; // get the max number of seconds in this timespan inline wxLongLong GetSeconds() const; // get the number of milliseconds in this timespan wxLongLong GetMilliseconds() const { return m_diff; } // conversion to text // ------------------------------------------------------------------------ // this function accepts strftime()-like format string (default // argument corresponds to the preferred date and time representation // for the current locale) and returns the string containing the // resulting text representation. Notice that only some of format // specifiers valid for wxDateTime are valid for wxTimeSpan: hours, // minutes and seconds make sense, but not "PM/AM" string for example. wxString Format(const wxString& format = wxDefaultTimeSpanFormat) const; // implementation // ------------------------------------------------------------------------ // construct from internal representation wxTimeSpan(const wxLongLong& diff) { m_diff = diff; } // get the internal representation wxLongLong GetValue() const { return m_diff; } private: // the (signed) time span in milliseconds wxLongLong m_diff; }; // ---------------------------------------------------------------------------- // This class is a "logical time span" and is useful for implementing program // logic for such things as "add one month to the date" which, in general, // doesn't mean to add 60*60*24*31 seconds to it, but to take the same date // the next month (to understand that this is indeed different consider adding // one month to Feb, 15 - we want to get Mar, 15, of course). // // When adding a month to the date, all lesser components (days, hours, ...) // won't be changed unless the resulting date would be invalid: for example, // Jan 31 + 1 month will be Feb 28, not (non existing) Feb 31. // // Because of this feature, adding and subtracting back again the same // wxDateSpan will *not*, in general give back the original date: Feb 28 - 1 // month will be Jan 28, not Jan 31! // // wxDateSpan can be either positive or negative. They may be // multiplied by scalars which multiply all deltas by the scalar: i.e. 2*(1 // month and 1 day) is 2 months and 2 days. They can be added together and // with wxDateTime or wxTimeSpan, but the type of result is different for each // case. // // Beware about weeks: if you specify both weeks and days, the total number of // days added will be 7*weeks + days! See also GetTotalDays() function. // // Equality operators are defined for wxDateSpans. Two datespans are equal if // they both give the same target date when added to *every* source date. // Thus wxDateSpan::Months(1) is not equal to wxDateSpan::Days(30), because // they not give the same date when added to 1 Feb. But wxDateSpan::Days(14) is // equal to wxDateSpan::Weeks(2) // // Finally, notice that for adding hours, minutes &c you don't need this // class: wxTimeSpan will do the job because there are no subtleties // associated with those. // ---------------------------------------------------------------------------- class WXDLLIMPEXP_BASE wxDateSpan { public: // constructors // ------------------------------------------------------------------------ // this many years/months/weeks/days wxDateSpan(int years = 0, int months = 0, int weeks = 0, int days = 0) { m_years = years; m_months = months; m_weeks = weeks; m_days = days; } // get an object for the given number of days static wxDateSpan Days(int days) { return wxDateSpan(0, 0, 0, days); } static wxDateSpan Day() { return Days(1); } // get an object for the given number of weeks static wxDateSpan Weeks(int weeks) { return wxDateSpan(0, 0, weeks, 0); } static wxDateSpan Week() { return Weeks(1); } // get an object for the given number of months static wxDateSpan Months(int mon) { return wxDateSpan(0, mon, 0, 0); } static wxDateSpan Month() { return Months(1); } // get an object for the given number of years static wxDateSpan Years(int years) { return wxDateSpan(years, 0, 0, 0); } static wxDateSpan Year() { return Years(1); } // default copy ctor is ok // no dtor // accessors (all SetXXX() return the (modified) wxDateSpan object) // ------------------------------------------------------------------------ // set number of years wxDateSpan& SetYears(int n) { m_years = n; return *this; } // set number of months wxDateSpan& SetMonths(int n) { m_months = n; return *this; } // set number of weeks wxDateSpan& SetWeeks(int n) { m_weeks = n; return *this; } // set number of days wxDateSpan& SetDays(int n) { m_days = n; return *this; } // get number of years int GetYears() const { return m_years; } // get number of months int GetMonths() const { return m_months; } // returns 12*GetYears() + GetMonths() int GetTotalMonths() const { return 12*m_years + m_months; } // get number of weeks int GetWeeks() const { return m_weeks; } // get number of days int GetDays() const { return m_days; } // returns 7*GetWeeks() + GetDays() int GetTotalDays() const { return 7*m_weeks + m_days; } // arithmetics with date spans (see also below for more operators) // ------------------------------------------------------------------------ // return sum of two date spans inline wxDateSpan Add(const wxDateSpan& other) const; // add another wxDateSpan to us inline wxDateSpan& Add(const wxDateSpan& other); // add another wxDateSpan to us inline wxDateSpan& operator+=(const wxDateSpan& other); inline wxDateSpan operator+(const wxDateSpan& ds) const { return wxDateSpan(GetYears() + ds.GetYears(), GetMonths() + ds.GetMonths(), GetWeeks() + ds.GetWeeks(), GetDays() + ds.GetDays()); } // return difference of two date spans inline wxDateSpan Subtract(const wxDateSpan& other) const; // subtract another wxDateSpan from us inline wxDateSpan& Subtract(const wxDateSpan& other); // subtract another wxDateSpan from us inline wxDateSpan& operator-=(const wxDateSpan& other); inline wxDateSpan operator-(const wxDateSpan& ds) const { return wxDateSpan(GetYears() - ds.GetYears(), GetMonths() - ds.GetMonths(), GetWeeks() - ds.GetWeeks(), GetDays() - ds.GetDays()); } // return a copy of this time span with changed sign inline wxDateSpan Negate() const; // inverse the sign of this timespan inline wxDateSpan& Neg(); // inverse the sign of this timespan wxDateSpan& operator-() { return Neg(); } // return the date span proportional to this one with given factor inline wxDateSpan Multiply(int factor) const; // multiply all components by a (signed) number inline wxDateSpan& Multiply(int factor); // multiply all components by a (signed) number inline wxDateSpan& operator*=(int factor) { return Multiply(factor); } inline wxDateSpan operator*(int n) const { return wxDateSpan(*this).Multiply(n); } // ds1 == d2 if and only if for every wxDateTime t t + ds1 == t + ds2 inline bool operator==(const wxDateSpan& ds) const { return GetYears() == ds.GetYears() && GetMonths() == ds.GetMonths() && GetTotalDays() == ds.GetTotalDays(); } inline bool operator!=(const wxDateSpan& ds) const { return !(*this == ds); } private: int m_years, m_months, m_weeks, m_days; }; // ---------------------------------------------------------------------------- // wxDateTimeArray: array of dates. // ---------------------------------------------------------------------------- WX_DECLARE_USER_EXPORTED_OBJARRAY(wxDateTime, wxDateTimeArray, WXDLLIMPEXP_BASE); // ---------------------------------------------------------------------------- // wxDateTimeHolidayAuthority: an object of this class will decide whether a // given date is a holiday and is used by all functions working with "work // days". // // NB: the base class is an ABC, derived classes must implement the pure // virtual methods to work with the holidays they correspond to. // ---------------------------------------------------------------------------- class WXDLLIMPEXP_FWD_BASE wxDateTimeHolidayAuthority; WX_DEFINE_USER_EXPORTED_ARRAY_PTR(wxDateTimeHolidayAuthority *, wxHolidayAuthoritiesArray, class WXDLLIMPEXP_BASE); class wxDateTimeHolidaysModule; class WXDLLIMPEXP_BASE wxDateTimeHolidayAuthority { friend class wxDateTimeHolidaysModule; public: // returns true if the given date is a holiday static bool IsHoliday(const wxDateTime& dt); // fills the provided array with all holidays in the given range, returns // the number of them static size_t GetHolidaysInRange(const wxDateTime& dtStart, const wxDateTime& dtEnd, wxDateTimeArray& holidays); // clear the list of holiday authorities static void ClearAllAuthorities(); // add a new holiday authority (the pointer will be deleted by // wxDateTimeHolidayAuthority) static void AddAuthority(wxDateTimeHolidayAuthority *auth); // the base class must have a virtual dtor virtual ~wxDateTimeHolidayAuthority(); protected: // this function is called to determine whether a given day is a holiday virtual bool DoIsHoliday(const wxDateTime& dt) const = 0; // this function should fill the array with all holidays between the two // given dates - it is implemented in the base class, but in a very // inefficient way (it just iterates over all days and uses IsHoliday() for // each of them), so it must be overridden in the derived class where the // base class version may be explicitly used if needed // // returns the number of holidays in the given range and fills holidays // array virtual size_t DoGetHolidaysInRange(const wxDateTime& dtStart, const wxDateTime& dtEnd, wxDateTimeArray& holidays) const = 0; private: // all holiday authorities static wxHolidayAuthoritiesArray ms_authorities; }; // the holidays for this class are all Saturdays and Sundays class WXDLLIMPEXP_BASE wxDateTimeWorkDays : public wxDateTimeHolidayAuthority { protected: virtual bool DoIsHoliday(const wxDateTime& dt) const wxOVERRIDE; virtual size_t DoGetHolidaysInRange(const wxDateTime& dtStart, const wxDateTime& dtEnd, wxDateTimeArray& holidays) const wxOVERRIDE; }; // ============================================================================ // inline functions implementation // ============================================================================ // ---------------------------------------------------------------------------- // private macros // ---------------------------------------------------------------------------- #define MILLISECONDS_PER_DAY 86400000l // some broken compilers (HP-UX CC) refuse to compile the "normal" version, but // using a temp variable always might prevent other compilers from optimising // it away - hence use of this ugly macro #ifndef __HPUX__ #define MODIFY_AND_RETURN(op) return wxDateTime(*this).op #else #define MODIFY_AND_RETURN(op) wxDateTime dt(*this); dt.op; return dt #endif // ---------------------------------------------------------------------------- // wxDateTime construction // ---------------------------------------------------------------------------- inline bool wxDateTime::IsInStdRange() const { // currently we don't know what is the real type of time_t so prefer to err // on the safe side and limit it to 32 bit values which is safe everywhere return m_time >= 0l && (m_time / TIME_T_FACTOR) < wxINT32_MAX; } /* static */ inline wxDateTime wxDateTime::Now() { struct tm tmstruct; return wxDateTime(*GetTmNow(&tmstruct)); } /* static */ inline wxDateTime wxDateTime::Today() { wxDateTime dt(Now()); dt.ResetTime(); return dt; } inline wxDateTime& wxDateTime::Set(time_t timet) { if ( timet == (time_t)-1 ) { m_time = wxInvalidDateTime.m_time; } else { // assign first to avoid long multiplication overflow! m_time = timet - WX_TIME_BASE_OFFSET; m_time *= TIME_T_FACTOR; } return *this; } inline wxDateTime& wxDateTime::SetToCurrent() { *this = Now(); return *this; } inline wxDateTime::wxDateTime(time_t timet) { Set(timet); } inline wxDateTime::wxDateTime(const struct tm& tm) { Set(tm); } inline wxDateTime::wxDateTime(const Tm& tm) { Set(tm); } inline wxDateTime::wxDateTime(double jdn) { Set(jdn); } inline wxDateTime& wxDateTime::Set(const Tm& tm) { wxASSERT_MSG( tm.IsValid(), wxT("invalid broken down date/time") ); return Set(tm.mday, (Month)tm.mon, tm.year, tm.hour, tm.min, tm.sec, tm.msec); } inline wxDateTime::wxDateTime(wxDateTime_t hour, wxDateTime_t minute, wxDateTime_t second, wxDateTime_t millisec) { Set(hour, minute, second, millisec); } inline wxDateTime::wxDateTime(wxDateTime_t day, Month month, int year, wxDateTime_t hour, wxDateTime_t minute, wxDateTime_t second, wxDateTime_t millisec) { Set(day, month, year, hour, minute, second, millisec); } // ---------------------------------------------------------------------------- // wxDateTime accessors // ---------------------------------------------------------------------------- inline wxLongLong wxDateTime::GetValue() const { wxASSERT_MSG( IsValid(), wxT("invalid wxDateTime")); return m_time; } inline time_t wxDateTime::GetTicks() const { wxASSERT_MSG( IsValid(), wxT("invalid wxDateTime")); if ( !IsInStdRange() ) { return (time_t)-1; } return (time_t)((m_time / (long)TIME_T_FACTOR).ToLong()) + WX_TIME_BASE_OFFSET; } inline bool wxDateTime::SetToLastWeekDay(WeekDay weekday, Month month, int year) { return SetToWeekDay(weekday, -1, month, year); } inline wxDateTime wxDateTime::GetWeekDayInSameWeek(WeekDay weekday, WeekFlags WXUNUSED(flags)) const { MODIFY_AND_RETURN( SetToWeekDayInSameWeek(weekday) ); } inline wxDateTime wxDateTime::GetNextWeekDay(WeekDay weekday) const { MODIFY_AND_RETURN( SetToNextWeekDay(weekday) ); } inline wxDateTime wxDateTime::GetPrevWeekDay(WeekDay weekday) const { MODIFY_AND_RETURN( SetToPrevWeekDay(weekday) ); } inline wxDateTime wxDateTime::GetWeekDay(WeekDay weekday, int n, Month month, int year) const { wxDateTime dt(*this); return dt.SetToWeekDay(weekday, n, month, year) ? dt : wxInvalidDateTime; } inline wxDateTime wxDateTime::GetLastWeekDay(WeekDay weekday, Month month, int year) { wxDateTime dt(*this); return dt.SetToLastWeekDay(weekday, month, year) ? dt : wxInvalidDateTime; } inline wxDateTime wxDateTime::GetLastMonthDay(Month month, int year) const { MODIFY_AND_RETURN( SetToLastMonthDay(month, year) ); } inline wxDateTime wxDateTime::GetYearDay(wxDateTime_t yday) const { MODIFY_AND_RETURN( SetToYearDay(yday) ); } // ---------------------------------------------------------------------------- // wxDateTime comparison // ---------------------------------------------------------------------------- inline bool wxDateTime::IsEqualTo(const wxDateTime& datetime) const { return *this == datetime; } inline bool wxDateTime::IsEarlierThan(const wxDateTime& datetime) const { return *this < datetime; } inline bool wxDateTime::IsLaterThan(const wxDateTime& datetime) const { return *this > datetime; } inline bool wxDateTime::IsStrictlyBetween(const wxDateTime& t1, const wxDateTime& t2) const { // no need for assert, will be checked by the functions we call return IsLaterThan(t1) && IsEarlierThan(t2); } inline bool wxDateTime::IsBetween(const wxDateTime& t1, const wxDateTime& t2) const { // no need for assert, will be checked by the functions we call return IsEqualTo(t1) || IsEqualTo(t2) || IsStrictlyBetween(t1, t2); } inline bool wxDateTime::IsSameDate(const wxDateTime& dt) const { Tm tm1 = GetTm(), tm2 = dt.GetTm(); return tm1.year == tm2.year && tm1.mon == tm2.mon && tm1.mday == tm2.mday; } inline bool wxDateTime::IsSameTime(const wxDateTime& dt) const { // notice that we can't do something like this: // // m_time % MILLISECONDS_PER_DAY == dt.m_time % MILLISECONDS_PER_DAY // // because we have also to deal with (possibly) different DST settings! Tm tm1 = GetTm(), tm2 = dt.GetTm(); return tm1.hour == tm2.hour && tm1.min == tm2.min && tm1.sec == tm2.sec && tm1.msec == tm2.msec; } inline bool wxDateTime::IsEqualUpTo(const wxDateTime& dt, const wxTimeSpan& ts) const { return IsBetween(dt.Subtract(ts), dt.Add(ts)); } // ---------------------------------------------------------------------------- // wxDateTime arithmetics // ---------------------------------------------------------------------------- inline wxDateTime wxDateTime::Add(const wxTimeSpan& diff) const { wxASSERT_MSG( IsValid(), wxT("invalid wxDateTime")); return wxDateTime(m_time + diff.GetValue()); } inline wxDateTime& wxDateTime::Add(const wxTimeSpan& diff) { wxASSERT_MSG( IsValid(), wxT("invalid wxDateTime")); m_time += diff.GetValue(); return *this; } inline wxDateTime& wxDateTime::operator+=(const wxTimeSpan& diff) { return Add(diff); } inline wxDateTime wxDateTime::Subtract(const wxTimeSpan& diff) const { wxASSERT_MSG( IsValid(), wxT("invalid wxDateTime")); return wxDateTime(m_time - diff.GetValue()); } inline wxDateTime& wxDateTime::Subtract(const wxTimeSpan& diff) { wxASSERT_MSG( IsValid(), wxT("invalid wxDateTime")); m_time -= diff.GetValue(); return *this; } inline wxDateTime& wxDateTime::operator-=(const wxTimeSpan& diff) { return Subtract(diff); } inline wxTimeSpan wxDateTime::Subtract(const wxDateTime& datetime) const { wxASSERT_MSG( IsValid() && datetime.IsValid(), wxT("invalid wxDateTime")); return wxTimeSpan(GetValue() - datetime.GetValue()); } inline wxTimeSpan wxDateTime::operator-(const wxDateTime& dt2) const { return this->Subtract(dt2); } inline wxDateTime wxDateTime::Add(const wxDateSpan& diff) const { return wxDateTime(*this).Add(diff); } inline wxDateTime& wxDateTime::Subtract(const wxDateSpan& diff) { return Add(diff.Negate()); } inline wxDateTime wxDateTime::Subtract(const wxDateSpan& diff) const { return wxDateTime(*this).Subtract(diff); } inline wxDateTime& wxDateTime::operator-=(const wxDateSpan& diff) { return Subtract(diff); } inline wxDateTime& wxDateTime::operator+=(const wxDateSpan& diff) { return Add(diff); } // ---------------------------------------------------------------------------- // wxDateTime and timezones // ---------------------------------------------------------------------------- inline wxDateTime wxDateTime::ToTimezone(const wxDateTime::TimeZone& tz, bool noDST) const { MODIFY_AND_RETURN( MakeTimezone(tz, noDST) ); } inline wxDateTime wxDateTime::FromTimezone(const wxDateTime::TimeZone& tz, bool noDST) const { MODIFY_AND_RETURN( MakeFromTimezone(tz, noDST) ); } // ---------------------------------------------------------------------------- // wxTimeSpan construction // ---------------------------------------------------------------------------- inline wxTimeSpan::wxTimeSpan(long hours, long minutes, wxLongLong seconds, wxLongLong milliseconds) { // assign first to avoid precision loss m_diff = hours; m_diff *= 60l; m_diff += minutes; m_diff *= 60l; m_diff += seconds; m_diff *= 1000l; m_diff += milliseconds; } // ---------------------------------------------------------------------------- // wxTimeSpan accessors // ---------------------------------------------------------------------------- inline wxLongLong wxTimeSpan::GetSeconds() const { return m_diff / 1000l; } inline int wxTimeSpan::GetMinutes() const { // For compatibility, this method (and the other accessors) return int, // even though GetLo() actually returns unsigned long with greater range. return static_cast<int>((GetSeconds() / 60l).GetLo()); } inline int wxTimeSpan::GetHours() const { return GetMinutes() / 60; } inline int wxTimeSpan::GetDays() const { return GetHours() / 24; } inline int wxTimeSpan::GetWeeks() const { return GetDays() / 7; } // ---------------------------------------------------------------------------- // wxTimeSpan arithmetics // ---------------------------------------------------------------------------- inline wxTimeSpan wxTimeSpan::Add(const wxTimeSpan& diff) const { return wxTimeSpan(m_diff + diff.GetValue()); } inline wxTimeSpan& wxTimeSpan::Add(const wxTimeSpan& diff) { m_diff += diff.GetValue(); return *this; } inline wxTimeSpan wxTimeSpan::Subtract(const wxTimeSpan& diff) const { return wxTimeSpan(m_diff - diff.GetValue()); } inline wxTimeSpan& wxTimeSpan::Subtract(const wxTimeSpan& diff) { m_diff -= diff.GetValue(); return *this; } inline wxTimeSpan& wxTimeSpan::Multiply(int n) { m_diff *= (long)n; return *this; } inline wxTimeSpan wxTimeSpan::Multiply(int n) const { return wxTimeSpan(m_diff * (long)n); } inline wxTimeSpan wxTimeSpan::Abs() const { return wxTimeSpan(GetValue().Abs()); } inline bool wxTimeSpan::IsEqualTo(const wxTimeSpan& ts) const { return GetValue() == ts.GetValue(); } inline bool wxTimeSpan::IsLongerThan(const wxTimeSpan& ts) const { return GetValue().Abs() > ts.GetValue().Abs(); } inline bool wxTimeSpan::IsShorterThan(const wxTimeSpan& ts) const { return GetValue().Abs() < ts.GetValue().Abs(); } // ---------------------------------------------------------------------------- // wxDateSpan // ---------------------------------------------------------------------------- inline wxDateSpan& wxDateSpan::operator+=(const wxDateSpan& other) { m_years += other.m_years; m_months += other.m_months; m_weeks += other.m_weeks; m_days += other.m_days; return *this; } inline wxDateSpan& wxDateSpan::Add(const wxDateSpan& other) { return *this += other; } inline wxDateSpan wxDateSpan::Add(const wxDateSpan& other) const { wxDateSpan ds(*this); ds.Add(other); return ds; } inline wxDateSpan& wxDateSpan::Multiply(int factor) { m_years *= factor; m_months *= factor; m_weeks *= factor; m_days *= factor; return *this; } inline wxDateSpan wxDateSpan::Multiply(int factor) const { wxDateSpan ds(*this); ds.Multiply(factor); return ds; } inline wxDateSpan wxDateSpan::Negate() const { return wxDateSpan(-m_years, -m_months, -m_weeks, -m_days); } inline wxDateSpan& wxDateSpan::Neg() { m_years = -m_years; m_months = -m_months; m_weeks = -m_weeks; m_days = -m_days; return *this; } inline wxDateSpan& wxDateSpan::operator-=(const wxDateSpan& other) { return *this += other.Negate(); } inline wxDateSpan& wxDateSpan::Subtract(const wxDateSpan& other) { return *this -= other; } inline wxDateSpan wxDateSpan::Subtract(const wxDateSpan& other) const { wxDateSpan ds(*this); ds.Subtract(other); return ds; } #undef MILLISECONDS_PER_DAY #undef MODIFY_AND_RETURN // ============================================================================ // binary operators // ============================================================================ // ---------------------------------------------------------------------------- // wxTimeSpan operators // ---------------------------------------------------------------------------- wxTimeSpan WXDLLIMPEXP_BASE operator*(int n, const wxTimeSpan& ts); // ---------------------------------------------------------------------------- // wxDateSpan // ---------------------------------------------------------------------------- wxDateSpan WXDLLIMPEXP_BASE operator*(int n, const wxDateSpan& ds); // ============================================================================ // other helper functions // ============================================================================ // ---------------------------------------------------------------------------- // iteration helpers: can be used to write a for loop over enum variable like // this: // for ( m = wxDateTime::Jan; m < wxDateTime::Inv_Month; wxNextMonth(m) ) // ---------------------------------------------------------------------------- WXDLLIMPEXP_BASE void wxNextMonth(wxDateTime::Month& m); WXDLLIMPEXP_BASE void wxPrevMonth(wxDateTime::Month& m); WXDLLIMPEXP_BASE void wxNextWDay(wxDateTime::WeekDay& wd); WXDLLIMPEXP_BASE void wxPrevWDay(wxDateTime::WeekDay& wd); #endif // wxUSE_DATETIME #endif // _WX_DATETIME_H
h
rticonnextdds-usecases
data/projects/rticonnextdds-usecases/VehicleTracking/ExampleCode/thirdparty/wxWidgets-3.1.2/Linux/include/wx/itemattr.h
/////////////////////////////////////////////////////////////////////////////// // Name: wx/itemattr.h // Purpose: wxItemAttr class declaration // Author: Vadim Zeitlin // Created: 2016-04-16 (extracted from wx/listctrl.h) // Copyright: (c) 2016 Vadim Zeitlin <[email protected]> // Licence: wxWindows licence /////////////////////////////////////////////////////////////////////////////// #ifndef _WX_ITEMATTR_H_ #define _WX_ITEMATTR_H_ // ---------------------------------------------------------------------------- // wxItemAttr: a structure containing the visual attributes of an item // ---------------------------------------------------------------------------- class wxItemAttr { public: // ctors wxItemAttr() { } wxItemAttr(const wxColour& colText, const wxColour& colBack, const wxFont& font) : m_colText(colText), m_colBack(colBack), m_font(font) { } // default copy ctor, assignment operator and dtor are ok bool operator==(const wxItemAttr& other) const { return m_colText == other.m_colText && m_colBack == other.m_colBack && m_font == other.m_font; } bool operator!=(const wxItemAttr& other) const { return !(*this == other); } // setters void SetTextColour(const wxColour& colText) { m_colText = colText; } void SetBackgroundColour(const wxColour& colBack) { m_colBack = colBack; } void SetFont(const wxFont& font) { m_font = font; } // accessors bool HasTextColour() const { return m_colText.IsOk(); } bool HasBackgroundColour() const { return m_colBack.IsOk(); } bool HasFont() const { return m_font.IsOk(); } bool HasColours() const { return HasTextColour() || HasBackgroundColour(); } bool IsDefault() const { return !HasColours() && !HasFont(); } const wxColour& GetTextColour() const { return m_colText; } const wxColour& GetBackgroundColour() const { return m_colBack; } const wxFont& GetFont() const { return m_font; } // this is almost like assignment operator except it doesn't overwrite the // fields unset in the source attribute void AssignFrom(const wxItemAttr& source) { if ( source.HasTextColour() ) SetTextColour(source.GetTextColour()); if ( source.HasBackgroundColour() ) SetBackgroundColour(source.GetBackgroundColour()); if ( source.HasFont() ) SetFont(source.GetFont()); } private: wxColour m_colText, m_colBack; wxFont m_font; }; #endif // _WX_ITEMATTR_H_
h
rticonnextdds-usecases
data/projects/rticonnextdds-usecases/VehicleTracking/ExampleCode/thirdparty/wxWidgets-3.1.2/Linux/include/wx/fontpicker.h
///////////////////////////////////////////////////////////////////////////// // Name: wx/fontpicker.h // Purpose: wxFontPickerCtrl base header // Author: Francesco Montorsi // Modified by: // Created: 14/4/2006 // Copyright: (c) Francesco Montorsi // Licence: wxWindows Licence ///////////////////////////////////////////////////////////////////////////// #ifndef _WX_FONTPICKER_H_BASE_ #define _WX_FONTPICKER_H_BASE_ #include "wx/defs.h" #if wxUSE_FONTPICKERCTRL #include "wx/pickerbase.h" class WXDLLIMPEXP_FWD_CORE wxFontPickerEvent; extern WXDLLIMPEXP_DATA_CORE(const char) wxFontPickerWidgetNameStr[]; extern WXDLLIMPEXP_DATA_CORE(const char) wxFontPickerCtrlNameStr[]; // ---------------------------------------------------------------------------- // wxFontPickerWidgetBase: a generic abstract interface which must be // implemented by controls used by wxFontPickerCtrl // ---------------------------------------------------------------------------- class WXDLLIMPEXP_CORE wxFontPickerWidgetBase { public: wxFontPickerWidgetBase() : m_selectedFont(*wxNORMAL_FONT) { } virtual ~wxFontPickerWidgetBase() {} wxFont GetSelectedFont() const { return m_selectedFont; } virtual void SetSelectedFont(const wxFont &f) { m_selectedFont = f; UpdateFont(); } virtual wxColour GetSelectedColour() const = 0; virtual void SetSelectedColour(const wxColour &colour) = 0; protected: virtual void UpdateFont() = 0; // the current font (may be invalid if none) // NOTE: don't call this m_font as wxWindow::m_font already exists wxFont m_selectedFont; }; // Styles which must be supported by all controls implementing wxFontPickerWidgetBase // NB: these styles must be defined to carefully-chosen values to // avoid conflicts with wxButton's styles // keeps the label of the button updated with the fontface name + font size // E.g. choosing "Times New Roman bold, italic with size 10" from the fontdialog, // updates the wxFontButtonGeneric's label (overwriting any previous label) // with the "Times New Roman, 10" text (only fontface + fontsize is displayed // to avoid extralong labels). #define wxFNTP_FONTDESC_AS_LABEL 0x0008 // uses the currently selected font to draw the label of the button #define wxFNTP_USEFONT_FOR_LABEL 0x0010 #define wxFONTBTN_DEFAULT_STYLE \ (wxFNTP_FONTDESC_AS_LABEL | wxFNTP_USEFONT_FOR_LABEL) // native version currently only exists in wxGTK2 #if defined(__WXGTK20__) && !defined(__WXUNIVERSAL__) #include "wx/gtk/fontpicker.h" #define wxFontPickerWidget wxFontButton #else #include "wx/generic/fontpickerg.h" #define wxFontPickerWidget wxGenericFontButton #endif // ---------------------------------------------------------------------------- // wxFontPickerCtrl specific flags // ---------------------------------------------------------------------------- #define wxFNTP_USE_TEXTCTRL (wxPB_USE_TEXTCTRL) #define wxFNTP_DEFAULT_STYLE (wxFNTP_FONTDESC_AS_LABEL|wxFNTP_USEFONT_FOR_LABEL) // not a style but rather the default value of the minimum/maximum pointsize allowed #define wxFNTP_MINPOINT_SIZE 0 #define wxFNTP_MAXPOINT_SIZE 100 // ---------------------------------------------------------------------------- // wxFontPickerCtrl: platform-independent class which embeds the // platform-dependent wxFontPickerWidget andm if wxFNTP_USE_TEXTCTRL style is // used, a textctrl next to it. // ---------------------------------------------------------------------------- class WXDLLIMPEXP_CORE wxFontPickerCtrl : public wxPickerBase { public: wxFontPickerCtrl() : m_nMinPointSize(wxFNTP_MINPOINT_SIZE), m_nMaxPointSize(wxFNTP_MAXPOINT_SIZE) { } virtual ~wxFontPickerCtrl() {} wxFontPickerCtrl(wxWindow *parent, wxWindowID id, const wxFont& initial = wxNullFont, const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxDefaultSize, long style = wxFNTP_DEFAULT_STYLE, const wxValidator& validator = wxDefaultValidator, const wxString& name = wxFontPickerCtrlNameStr) : m_nMinPointSize(wxFNTP_MINPOINT_SIZE), m_nMaxPointSize(wxFNTP_MAXPOINT_SIZE) { Create(parent, id, initial, pos, size, style, validator, name); } bool Create(wxWindow *parent, wxWindowID id, const wxFont& initial = wxNullFont, const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxDefaultSize, long style = wxFNTP_DEFAULT_STYLE, const wxValidator& validator = wxDefaultValidator, const wxString& name = wxFontPickerCtrlNameStr); public: // public API // get the font chosen wxFont GetSelectedFont() const { return GetPickerWidget()->GetSelectedFont(); } // sets currently displayed font void SetSelectedFont(const wxFont& f); // returns the selected color wxColour GetSelectedColour() const { return GetPickerWidget()->GetSelectedColour(); } // sets the currently selected color void SetSelectedColour(const wxColour& colour) { GetPickerWidget()->SetSelectedColour(colour); } // set/get the min point size void SetMinPointSize(unsigned int min); unsigned int GetMinPointSize() const { return m_nMinPointSize; } // set/get the max point size void SetMaxPointSize(unsigned int max); unsigned int GetMaxPointSize() const { return m_nMaxPointSize; } public: // internal functions void UpdatePickerFromTextCtrl() wxOVERRIDE; void UpdateTextCtrlFromPicker() wxOVERRIDE; // event handler for our picker void OnFontChange(wxFontPickerEvent &); // used to convert wxString <-> wxFont virtual wxString Font2String(const wxFont &font); virtual wxFont String2Font(const wxString &font); protected: // extracts the style for our picker from wxFontPickerCtrl's style long GetPickerStyle(long style) const wxOVERRIDE { return (style & (wxFNTP_FONTDESC_AS_LABEL|wxFNTP_USEFONT_FOR_LABEL)); } // the minimum pointsize allowed to the user unsigned int m_nMinPointSize; // the maximum pointsize allowed to the user unsigned int m_nMaxPointSize; private: wxFontPickerWidget* GetPickerWidget() const { return static_cast<wxFontPickerWidget*>(m_picker); } wxDECLARE_DYNAMIC_CLASS(wxFontPickerCtrl); }; // ---------------------------------------------------------------------------- // wxFontPickerEvent: used by wxFontPickerCtrl only // ---------------------------------------------------------------------------- wxDECLARE_EXPORTED_EVENT( WXDLLIMPEXP_CORE, wxEVT_FONTPICKER_CHANGED, wxFontPickerEvent ); class WXDLLIMPEXP_CORE wxFontPickerEvent : public wxCommandEvent { public: wxFontPickerEvent() {} wxFontPickerEvent(wxObject *generator, int id, const wxFont &f) : wxCommandEvent(wxEVT_FONTPICKER_CHANGED, id), m_font(f) { SetEventObject(generator); } wxFont GetFont() const { return m_font; } void SetFont(const wxFont &c) { m_font = c; } // default copy ctor, assignment operator and dtor are ok virtual wxEvent *Clone() const wxOVERRIDE { return new wxFontPickerEvent(*this); } private: wxFont m_font; wxDECLARE_DYNAMIC_CLASS_NO_ASSIGN(wxFontPickerEvent); }; // ---------------------------------------------------------------------------- // event types and macros // ---------------------------------------------------------------------------- typedef void (wxEvtHandler::*wxFontPickerEventFunction)(wxFontPickerEvent&); #define wxFontPickerEventHandler(func) \ wxEVENT_HANDLER_CAST(wxFontPickerEventFunction, func) #define EVT_FONTPICKER_CHANGED(id, fn) \ wx__DECLARE_EVT1(wxEVT_FONTPICKER_CHANGED, id, wxFontPickerEventHandler(fn)) // old wxEVT_COMMAND_* constants #define wxEVT_COMMAND_FONTPICKER_CHANGED wxEVT_FONTPICKER_CHANGED #endif // wxUSE_FONTPICKERCTRL #endif // _WX_FONTPICKER_H_BASE_
h
rticonnextdds-usecases
data/projects/rticonnextdds-usecases/VehicleTracking/ExampleCode/thirdparty/wxWidgets-3.1.2/Linux/include/wx/gbsizer.h
///////////////////////////////////////////////////////////////////////////// // Name: wx/gbsizer.h // Purpose: wxGridBagSizer: A sizer that can lay out items in a grid, // with items at specified cells, and with the option of row // and/or column spanning // // Author: Robin Dunn // Created: 03-Nov-2003 // Copyright: (c) Robin Dunn // Licence: wxWindows licence ///////////////////////////////////////////////////////////////////////////// #ifndef __WXGBSIZER_H__ #define __WXGBSIZER_H__ #include "wx/sizer.h" //--------------------------------------------------------------------------- // Classes to represent a position in the grid and a size of an item in the // grid, IOW, the number of rows and columns it occupies. I chose to use these // instead of wxPoint and wxSize because they are (x,y) and usually pixel // oriented while grids and tables are usually thought of as (row,col) so some // confusion would definitely result in using wxPoint... // // NOTE: This should probably be refactored to a common RowCol data type which // is used for this and also for wxGridCellCoords. //--------------------------------------------------------------------------- class WXDLLIMPEXP_CORE wxGBPosition { public: wxGBPosition() : m_row(0), m_col(0) {} wxGBPosition(int row, int col) : m_row(row), m_col(col) {} // default copy ctor and assignment operator are okay. int GetRow() const { return m_row; } int GetCol() const { return m_col; } void SetRow(int row) { m_row = row; } void SetCol(int col) { m_col = col; } bool operator==(const wxGBPosition& p) const { return m_row == p.m_row && m_col == p.m_col; } bool operator!=(const wxGBPosition& p) const { return !(*this == p); } private: int m_row; int m_col; }; class WXDLLIMPEXP_CORE wxGBSpan { public: wxGBSpan() { Init(); } wxGBSpan(int rowspan, int colspan) { // Initialize the members to valid values as not doing it may result in // infinite loop in wxGBSizer code if the user passed 0 for any of // them, see #12934. Init(); SetRowspan(rowspan); SetColspan(colspan); } // default copy ctor and assignment operator are okay. // Factor constructor creating an invalid wxGBSpan: this is mostly supposed // to be used as return value for functions returning wxGBSpan in case of // errors. static wxGBSpan Invalid() { return wxGBSpan(NULL); } int GetRowspan() const { return m_rowspan; } int GetColspan() const { return m_colspan; } void SetRowspan(int rowspan) { wxCHECK_RET( rowspan > 0, "Row span should be strictly positive" ); m_rowspan = rowspan; } void SetColspan(int colspan) { wxCHECK_RET( colspan > 0, "Column span should be strictly positive" ); m_colspan = colspan; } bool operator==(const wxGBSpan& o) const { return m_rowspan == o.m_rowspan && m_colspan == o.m_colspan; } bool operator!=(const wxGBSpan& o) const { return !(*this == o); } private: // This private ctor is used by Invalid() only. wxGBSpan(struct InvalidCtorTag*) { m_rowspan = m_colspan = -1; } void Init() { m_rowspan = m_colspan = 1; } int m_rowspan; int m_colspan; }; extern WXDLLIMPEXP_DATA_CORE(const wxGBSpan) wxDefaultSpan; //--------------------------------------------------------------------------- // wxGBSizerItem //--------------------------------------------------------------------------- class WXDLLIMPEXP_FWD_CORE wxGridBagSizer; class WXDLLIMPEXP_CORE wxGBSizerItem : public wxSizerItem { public: // spacer wxGBSizerItem( int width, int height, const wxGBPosition& pos, const wxGBSpan& span=wxDefaultSpan, int flag=0, int border=0, wxObject* userData=NULL); // window wxGBSizerItem( wxWindow *window, const wxGBPosition& pos, const wxGBSpan& span=wxDefaultSpan, int flag=0, int border=0, wxObject* userData=NULL ); // subsizer wxGBSizerItem( wxSizer *sizer, const wxGBPosition& pos, const wxGBSpan& span=wxDefaultSpan, int flag=0, int border=0, wxObject* userData=NULL ); // default ctor wxGBSizerItem(); // Get the grid position of the item wxGBPosition GetPos() const { return m_pos; } void GetPos(int& row, int& col) const; // Get the row and column spanning of the item wxGBSpan GetSpan() const { return m_span; } void GetSpan(int& rowspan, int& colspan) const; // If the item is already a member of a sizer then first ensure that there // is no other item that would intersect with this one at the new // position, then set the new position. Returns true if the change is // successful and after the next Layout the item will be moved. bool SetPos( const wxGBPosition& pos ); // If the item is already a member of a sizer then first ensure that there // is no other item that would intersect with this one with its new // spanning size, then set the new spanning. Returns true if the change // is successful and after the next Layout the item will be resized. bool SetSpan( const wxGBSpan& span ); // Returns true if this item and the other item intersect bool Intersects(const wxGBSizerItem& other); // Returns true if the given pos/span would intersect with this item. bool Intersects(const wxGBPosition& pos, const wxGBSpan& span); // Get the row and column of the endpoint of this item void GetEndPos(int& row, int& col); wxGridBagSizer* GetGBSizer() const { return m_gbsizer; } void SetGBSizer(wxGridBagSizer* sizer) { m_gbsizer = sizer; } protected: wxGBPosition m_pos; wxGBSpan m_span; wxGridBagSizer* m_gbsizer; // so SetPos/SetSpan can check for intersects private: wxDECLARE_DYNAMIC_CLASS(wxGBSizerItem); wxDECLARE_NO_COPY_CLASS(wxGBSizerItem); }; //--------------------------------------------------------------------------- // wxGridBagSizer //--------------------------------------------------------------------------- class WXDLLIMPEXP_CORE wxGridBagSizer : public wxFlexGridSizer { public: wxGridBagSizer(int vgap = 0, int hgap = 0 ); // The Add methods return true if the item was successfully placed at the // given position, false if something was already there. wxSizerItem* Add( wxWindow *window, const wxGBPosition& pos, const wxGBSpan& span = wxDefaultSpan, int flag = 0, int border = 0, wxObject* userData = NULL ); wxSizerItem* Add( wxSizer *sizer, const wxGBPosition& pos, const wxGBSpan& span = wxDefaultSpan, int flag = 0, int border = 0, wxObject* userData = NULL ); wxSizerItem* Add( int width, int height, const wxGBPosition& pos, const wxGBSpan& span = wxDefaultSpan, int flag = 0, int border = 0, wxObject* userData = NULL ); wxSizerItem* Add( wxGBSizerItem *item ); // Get/Set the size used for cells in the grid with no item. wxSize GetEmptyCellSize() const { return m_emptyCellSize; } void SetEmptyCellSize(const wxSize& sz) { m_emptyCellSize = sz; } // Get the size of the specified cell, including hgap and vgap. Only // valid after a Layout. wxSize GetCellSize(int row, int col) const; // Get the grid position of the specified item (non-recursive) wxGBPosition GetItemPosition(wxWindow *window); wxGBPosition GetItemPosition(wxSizer *sizer); wxGBPosition GetItemPosition(size_t index); // Set the grid position of the specified item. Returns true on success. // If the move is not allowed (because an item is already there) then // false is returned. (non-recursive) bool SetItemPosition(wxWindow *window, const wxGBPosition& pos); bool SetItemPosition(wxSizer *sizer, const wxGBPosition& pos); bool SetItemPosition(size_t index, const wxGBPosition& pos); // Get the row/col spanning of the specified item (non-recursive) wxGBSpan GetItemSpan(wxWindow *window); wxGBSpan GetItemSpan(wxSizer *sizer); wxGBSpan GetItemSpan(size_t index); // Set the row/col spanning of the specified item. Returns true on // success. If the move is not allowed (because an item is already there) // then false is returned. (non-recursive) bool SetItemSpan(wxWindow *window, const wxGBSpan& span); bool SetItemSpan(wxSizer *sizer, const wxGBSpan& span); bool SetItemSpan(size_t index, const wxGBSpan& span); // Find the sizer item for the given window or subsizer, returns NULL if // not found. (non-recursive) wxGBSizerItem* FindItem(wxWindow* window); wxGBSizerItem* FindItem(wxSizer* sizer); // Return the sizer item for the given grid cell, or NULL if there is no // item at that position. (non-recursive) wxGBSizerItem* FindItemAtPosition(const wxGBPosition& pos); // Return the sizer item located at the point given in pt, or NULL if // there is no item at that point. The (x,y) coordinates in pt correspond // to the client coordinates of the window using the sizer for // layout. (non-recursive) wxGBSizerItem* FindItemAtPoint(const wxPoint& pt); // Return the sizer item that has a matching user data (it only compares // pointer values) or NULL if not found. (non-recursive) wxGBSizerItem* FindItemWithData(const wxObject* userData); // These are what make the sizer do size calculations and layout virtual void RecalcSizes() wxOVERRIDE; virtual wxSize CalcMin() wxOVERRIDE; // Look at all items and see if any intersect (or would overlap) the given // item. Returns true if so, false if there would be no overlap. If an // excludeItem is given then it will not be checked for intersection, for // example it may be the item we are checking the position of. bool CheckForIntersection(wxGBSizerItem* item, wxGBSizerItem* excludeItem = NULL); bool CheckForIntersection(const wxGBPosition& pos, const wxGBSpan& span, wxGBSizerItem* excludeItem = NULL); // The Add base class virtuals should not be used with this class, but // we'll try to make them automatically select a location for the item // anyway. virtual wxSizerItem* Add( wxWindow *window, int proportion = 0, int flag = 0, int border = 0, wxObject* userData = NULL ); virtual wxSizerItem* Add( wxSizer *sizer, int proportion = 0, int flag = 0, int border = 0, wxObject* userData = NULL ); virtual wxSizerItem* Add( int width, int height, int proportion = 0, int flag = 0, int border = 0, wxObject* userData = NULL ); // The Insert and Prepend base class virtuals that are not appropriate for // this class and should not be used. Their implementation in this class // simply fails. virtual wxSizerItem* Add( wxSizerItem *item ); virtual wxSizerItem* Insert( size_t index, wxWindow *window, int proportion = 0, int flag = 0, int border = 0, wxObject* userData = NULL ); virtual wxSizerItem* Insert( size_t index, wxSizer *sizer, int proportion = 0, int flag = 0, int border = 0, wxObject* userData = NULL ); virtual wxSizerItem* Insert( size_t index, int width, int height, int proportion = 0, int flag = 0, int border = 0, wxObject* userData = NULL ); virtual wxSizerItem* Insert( size_t index, wxSizerItem *item ) wxOVERRIDE; virtual wxSizerItem* Prepend( wxWindow *window, int proportion = 0, int flag = 0, int border = 0, wxObject* userData = NULL ); virtual wxSizerItem* Prepend( wxSizer *sizer, int proportion = 0, int flag = 0, int border = 0, wxObject* userData = NULL ); virtual wxSizerItem* Prepend( int width, int height, int proportion = 0, int flag = 0, int border = 0, wxObject* userData = NULL ); virtual wxSizerItem* Prepend( wxSizerItem *item ); protected: wxGBPosition FindEmptyCell(); void AdjustForOverflow(); wxSize m_emptyCellSize; private: wxDECLARE_CLASS(wxGridBagSizer); wxDECLARE_NO_COPY_CLASS(wxGridBagSizer); }; //--------------------------------------------------------------------------- #endif
h
rticonnextdds-usecases
data/projects/rticonnextdds-usecases/VehicleTracking/ExampleCode/thirdparty/wxWidgets-3.1.2/Linux/include/wx/settings.h
///////////////////////////////////////////////////////////////////////////// // Name: wx/settings.h // Purpose: wxSystemSettings class // Author: Julian Smart // Modified by: // Created: 01/02/97 // Copyright: (c) Julian Smart // Licence: wxWindows licence ///////////////////////////////////////////////////////////////////////////// #ifndef _WX_SETTINGS_H_BASE_ #define _WX_SETTINGS_H_BASE_ #include "wx/colour.h" #include "wx/font.h" class WXDLLIMPEXP_FWD_CORE wxWindow; // possible values for wxSystemSettings::GetFont() parameter // // NB: wxMSW assumes that they have the same values as the parameters of // Windows GetStockObject() API, don't change the values! enum wxSystemFont { wxSYS_OEM_FIXED_FONT = 10, wxSYS_ANSI_FIXED_FONT, wxSYS_ANSI_VAR_FONT, wxSYS_SYSTEM_FONT, wxSYS_DEVICE_DEFAULT_FONT, // don't use: this is here just to make the values of enum elements // coincide with the corresponding MSW constants wxSYS_DEFAULT_PALETTE, // don't use: MSDN says that this is a stock object provided only // for compatibility with 16-bit Windows versions earlier than 3.0! wxSYS_SYSTEM_FIXED_FONT, wxSYS_DEFAULT_GUI_FONT, // this was just a temporary aberration, do not use it any more wxSYS_ICONTITLE_FONT = wxSYS_DEFAULT_GUI_FONT }; // possible values for wxSystemSettings::GetColour() parameter // // NB: wxMSW assumes that they have the same values as the parameters of // Windows GetSysColor() API, don't change the values! enum wxSystemColour { wxSYS_COLOUR_SCROLLBAR, wxSYS_COLOUR_DESKTOP, wxSYS_COLOUR_ACTIVECAPTION, wxSYS_COLOUR_INACTIVECAPTION, wxSYS_COLOUR_MENU, wxSYS_COLOUR_WINDOW, wxSYS_COLOUR_WINDOWFRAME, wxSYS_COLOUR_MENUTEXT, wxSYS_COLOUR_WINDOWTEXT, wxSYS_COLOUR_CAPTIONTEXT, wxSYS_COLOUR_ACTIVEBORDER, wxSYS_COLOUR_INACTIVEBORDER, wxSYS_COLOUR_APPWORKSPACE, wxSYS_COLOUR_HIGHLIGHT, wxSYS_COLOUR_HIGHLIGHTTEXT, wxSYS_COLOUR_BTNFACE, wxSYS_COLOUR_BTNSHADOW, wxSYS_COLOUR_GRAYTEXT, wxSYS_COLOUR_BTNTEXT, wxSYS_COLOUR_INACTIVECAPTIONTEXT, wxSYS_COLOUR_BTNHIGHLIGHT, wxSYS_COLOUR_3DDKSHADOW, wxSYS_COLOUR_3DLIGHT, wxSYS_COLOUR_INFOTEXT, wxSYS_COLOUR_INFOBK, wxSYS_COLOUR_LISTBOX, wxSYS_COLOUR_HOTLIGHT, wxSYS_COLOUR_GRADIENTACTIVECAPTION, wxSYS_COLOUR_GRADIENTINACTIVECAPTION, wxSYS_COLOUR_MENUHILIGHT, wxSYS_COLOUR_MENUBAR, wxSYS_COLOUR_LISTBOXTEXT, wxSYS_COLOUR_LISTBOXHIGHLIGHTTEXT, wxSYS_COLOUR_MAX, // synonyms wxSYS_COLOUR_BACKGROUND = wxSYS_COLOUR_DESKTOP, wxSYS_COLOUR_3DFACE = wxSYS_COLOUR_BTNFACE, wxSYS_COLOUR_3DSHADOW = wxSYS_COLOUR_BTNSHADOW, wxSYS_COLOUR_BTNHILIGHT = wxSYS_COLOUR_BTNHIGHLIGHT, wxSYS_COLOUR_3DHIGHLIGHT = wxSYS_COLOUR_BTNHIGHLIGHT, wxSYS_COLOUR_3DHILIGHT = wxSYS_COLOUR_BTNHIGHLIGHT, wxSYS_COLOUR_FRAMEBK = wxSYS_COLOUR_BTNFACE }; // possible values for wxSystemSettings::GetMetric() index parameter // // NB: update the conversion table in msw/settings.cpp if you change the values // of the elements of this enum enum wxSystemMetric { wxSYS_MOUSE_BUTTONS = 1, wxSYS_BORDER_X, wxSYS_BORDER_Y, wxSYS_CURSOR_X, wxSYS_CURSOR_Y, wxSYS_DCLICK_X, wxSYS_DCLICK_Y, wxSYS_DRAG_X, wxSYS_DRAG_Y, wxSYS_EDGE_X, wxSYS_EDGE_Y, wxSYS_HSCROLL_ARROW_X, wxSYS_HSCROLL_ARROW_Y, wxSYS_HTHUMB_X, wxSYS_ICON_X, wxSYS_ICON_Y, wxSYS_ICONSPACING_X, wxSYS_ICONSPACING_Y, wxSYS_WINDOWMIN_X, wxSYS_WINDOWMIN_Y, wxSYS_SCREEN_X, wxSYS_SCREEN_Y, wxSYS_FRAMESIZE_X, wxSYS_FRAMESIZE_Y, wxSYS_SMALLICON_X, wxSYS_SMALLICON_Y, wxSYS_HSCROLL_Y, wxSYS_VSCROLL_X, wxSYS_VSCROLL_ARROW_X, wxSYS_VSCROLL_ARROW_Y, wxSYS_VTHUMB_Y, wxSYS_CAPTION_Y, wxSYS_MENU_Y, wxSYS_NETWORK_PRESENT, wxSYS_PENWINDOWS_PRESENT, wxSYS_SHOW_SOUNDS, wxSYS_SWAP_BUTTONS, wxSYS_DCLICK_MSEC, wxSYS_CARET_ON_MSEC, wxSYS_CARET_OFF_MSEC, wxSYS_CARET_TIMEOUT_MSEC }; // possible values for wxSystemSettings::HasFeature() parameter enum wxSystemFeature { wxSYS_CAN_DRAW_FRAME_DECORATIONS = 1, wxSYS_CAN_ICONIZE_FRAME, wxSYS_TABLET_PRESENT }; // values for different screen designs enum wxSystemScreenType { wxSYS_SCREEN_NONE = 0, // not yet defined wxSYS_SCREEN_TINY, // < wxSYS_SCREEN_PDA, // >= 320x240 wxSYS_SCREEN_SMALL, // >= 640x480 wxSYS_SCREEN_DESKTOP // >= 800x600 }; // ---------------------------------------------------------------------------- // wxSystemSettingsNative: defines the API for wxSystemSettings class // ---------------------------------------------------------------------------- // this is a namespace rather than a class: it has only non virtual static // functions // // also note that the methods are implemented in the platform-specific source // files (i.e. this is not a real base class as we can't override its virtual // functions because it doesn't have any) class WXDLLIMPEXP_CORE wxSystemSettingsNative { public: // get a standard system colour static wxColour GetColour(wxSystemColour index); // get a standard system font static wxFont GetFont(wxSystemFont index); // get a system-dependent metric static int GetMetric(wxSystemMetric index, wxWindow * win = NULL); // return true if the port has certain feature static bool HasFeature(wxSystemFeature index); }; // ---------------------------------------------------------------------------- // include the declaration of the real platform-dependent class // ---------------------------------------------------------------------------- class WXDLLIMPEXP_CORE wxSystemSettings : public wxSystemSettingsNative { public: #ifdef __WXUNIVERSAL__ // in wxUniversal we want to use the theme standard colours instead of the // system ones, otherwise wxSystemSettings is just the same as // wxSystemSettingsNative static wxColour GetColour(wxSystemColour index); // some metrics are toolkit-dependent and provided by wxUniv, some are // lowlevel static int GetMetric(wxSystemMetric index, wxWindow *win = NULL); #endif // __WXUNIVERSAL__ // Get system screen design (desktop, pda, ..) used for // laying out various dialogs. static wxSystemScreenType GetScreenType(); // Override default. static void SetScreenType( wxSystemScreenType screen ); // Value static wxSystemScreenType ms_screen; }; #endif // _WX_SETTINGS_H_BASE_
h
rticonnextdds-usecases
data/projects/rticonnextdds-usecases/VehicleTracking/ExampleCode/thirdparty/wxWidgets-3.1.2/Linux/include/wx/frame.h
///////////////////////////////////////////////////////////////////////////// // Name: wx/frame.h // Purpose: wxFrame class interface // Author: Vadim Zeitlin // Modified by: // Created: 15.11.99 // Copyright: (c) wxWidgets team // Licence: wxWindows licence ///////////////////////////////////////////////////////////////////////////// #ifndef _WX_FRAME_H_BASE_ #define _WX_FRAME_H_BASE_ // ---------------------------------------------------------------------------- // headers // ---------------------------------------------------------------------------- #include "wx/toplevel.h" // the base class #include "wx/statusbr.h" // the default names for various classs extern WXDLLIMPEXP_DATA_CORE(const char) wxStatusLineNameStr[]; extern WXDLLIMPEXP_DATA_CORE(const char) wxToolBarNameStr[]; class WXDLLIMPEXP_FWD_CORE wxFrame; class WXDLLIMPEXP_FWD_CORE wxMenuBar; class WXDLLIMPEXP_FWD_CORE wxMenuItem; class WXDLLIMPEXP_FWD_CORE wxStatusBar; class WXDLLIMPEXP_FWD_CORE wxToolBar; // ---------------------------------------------------------------------------- // constants // ---------------------------------------------------------------------------- // wxFrame-specific (i.e. not for wxDialog) styles // // Also see the bit summary table in wx/toplevel.h. #define wxFRAME_NO_TASKBAR 0x0002 // No taskbar button (MSW only) #define wxFRAME_TOOL_WINDOW 0x0004 // No taskbar button, no system menu #define wxFRAME_FLOAT_ON_PARENT 0x0008 // Always above its parent // ---------------------------------------------------------------------------- // wxFrame is a top-level window with optional menubar, statusbar and toolbar // // For each of *bars, a frame may have several of them, but only one is // managed by the frame, i.e. resized/moved when the frame is and whose size // is accounted for in client size calculations - all others should be taken // care of manually. The CreateXXXBar() functions create this, main, XXXBar, // but the actual creation is done in OnCreateXXXBar() functions which may be // overridden to create custom objects instead of standard ones when // CreateXXXBar() is called. // ---------------------------------------------------------------------------- class WXDLLIMPEXP_CORE wxFrameBase : public wxTopLevelWindow { public: // construction wxFrameBase(); virtual ~wxFrameBase(); wxFrame *New(wxWindow *parent, wxWindowID winid, const wxString& title, const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxDefaultSize, long style = wxDEFAULT_FRAME_STYLE, const wxString& name = wxFrameNameStr); // frame state // ----------- // get the origin of the client area (which may be different from (0, 0) // if the frame has a toolbar) in client coordinates virtual wxPoint GetClientAreaOrigin() const wxOVERRIDE; // menu bar functions // ------------------ #if wxUSE_MENUS virtual void SetMenuBar(wxMenuBar *menubar); virtual wxMenuBar *GetMenuBar() const { return m_frameMenuBar; } // find the item by id in the frame menu bar: this is an internal function // and exists mainly in order to be overridden in the MDI parent frame // which also looks at its active child menu bar virtual wxMenuItem *FindItemInMenuBar(int menuId) const; // generate menu command corresponding to the given menu item // // returns true if processed bool ProcessCommand(wxMenuItem *item); // generate menu command corresponding to the given menu command id // // returns true if processed bool ProcessCommand(int winid); #else bool ProcessCommand(int WXUNUSED(winid)) { return false; } #endif // wxUSE_MENUS // status bar functions // -------------------- #if wxUSE_STATUSBAR // create the main status bar by calling OnCreateStatusBar() virtual wxStatusBar* CreateStatusBar(int number = 1, long style = wxSTB_DEFAULT_STYLE, wxWindowID winid = 0, const wxString& name = wxStatusLineNameStr); // return a new status bar virtual wxStatusBar *OnCreateStatusBar(int number, long style, wxWindowID winid, const wxString& name); // get the main status bar virtual wxStatusBar *GetStatusBar() const { return m_frameStatusBar; } // sets the main status bar virtual void SetStatusBar(wxStatusBar *statBar); // forward these to status bar virtual void SetStatusText(const wxString &text, int number = 0); virtual void SetStatusWidths(int n, const int widths_field[]); void PushStatusText(const wxString &text, int number = 0); void PopStatusText(int number = 0); // set the status bar pane the help will be shown in void SetStatusBarPane(int n) { m_statusBarPane = n; } int GetStatusBarPane() const { return m_statusBarPane; } #endif // wxUSE_STATUSBAR // toolbar functions // ----------------- #if wxUSE_TOOLBAR // create main toolbar bycalling OnCreateToolBar() virtual wxToolBar* CreateToolBar(long style = -1, wxWindowID winid = wxID_ANY, const wxString& name = wxToolBarNameStr); // return a new toolbar virtual wxToolBar *OnCreateToolBar(long style, wxWindowID winid, const wxString& name ); // get/set the main toolbar virtual wxToolBar *GetToolBar() const { return m_frameToolBar; } virtual void SetToolBar(wxToolBar *toolbar); #endif // wxUSE_TOOLBAR // implementation only from now on // ------------------------------- // event handlers #if wxUSE_MENUS void OnMenuOpen(wxMenuEvent& event); #if wxUSE_STATUSBAR void OnMenuClose(wxMenuEvent& event); void OnMenuHighlight(wxMenuEvent& event); #endif // wxUSE_STATUSBAR // send wxUpdateUIEvents for all menu items in the menubar, // or just for menu if non-NULL virtual void DoMenuUpdates(wxMenu* menu = NULL); #endif // wxUSE_MENUS // do the UI update processing for this window virtual void UpdateWindowUI(long flags = wxUPDATE_UI_NONE) wxOVERRIDE; // Implement internal behaviour (menu updating on some platforms) virtual void OnInternalIdle() wxOVERRIDE; #if wxUSE_MENUS || wxUSE_TOOLBAR // show help text for the currently selected menu or toolbar item // (typically in the status bar) or hide it and restore the status bar text // originally shown before the menu was opened if show == false virtual void DoGiveHelp(const wxString& text, bool show); #endif virtual bool IsClientAreaChild(const wxWindow *child) const wxOVERRIDE { return !IsOneOfBars(child) && wxTopLevelWindow::IsClientAreaChild(child); } protected: // the frame main menu/status/tool bars // ------------------------------------ // this (non virtual!) function should be called from dtor to delete the // main menubar, statusbar and toolbar (if any) void DeleteAllBars(); // test whether this window makes part of the frame virtual bool IsOneOfBars(const wxWindow *win) const wxOVERRIDE; #if wxUSE_MENUS // override to update menu bar position when the frame size changes virtual void PositionMenuBar() { } // override to do something special when the menu bar is being removed // from the frame virtual void DetachMenuBar(); // override to do something special when the menu bar is attached to the // frame virtual void AttachMenuBar(wxMenuBar *menubar); // Return true if we should update the menu item state from idle event // handler or false if we should delay it until the menu is opened. static bool ShouldUpdateMenuFromIdle(); wxMenuBar *m_frameMenuBar; #endif // wxUSE_MENUS #if wxUSE_STATUSBAR && (wxUSE_MENUS || wxUSE_TOOLBAR) // the saved status bar text overwritten by DoGiveHelp() wxString m_oldStatusText; // the last help string we have shown in the status bar wxString m_lastHelpShown; #endif #if wxUSE_STATUSBAR // override to update status bar position (or anything else) when // something changes virtual void PositionStatusBar() { } // show the help string for the given menu item using DoGiveHelp() if the // given item does have a help string (as determined by FindInMenuBar()), // return false if there is no help for such item bool ShowMenuHelp(int helpid); wxStatusBar *m_frameStatusBar; #endif // wxUSE_STATUSBAR int m_statusBarPane; #if wxUSE_TOOLBAR // override to update status bar position (or anything else) when // something changes virtual void PositionToolBar() { } wxToolBar *m_frameToolBar; #endif // wxUSE_TOOLBAR #if wxUSE_MENUS wxDECLARE_EVENT_TABLE(); #endif // wxUSE_MENUS wxDECLARE_NO_COPY_CLASS(wxFrameBase); }; // include the real class declaration #if defined(__WXUNIVERSAL__) #include "wx/univ/frame.h" #else // !__WXUNIVERSAL__ #if defined(__WXMSW__) #include "wx/msw/frame.h" #elif defined(__WXGTK20__) #include "wx/gtk/frame.h" #elif defined(__WXGTK__) #include "wx/gtk1/frame.h" #elif defined(__WXMOTIF__) #include "wx/motif/frame.h" #elif defined(__WXMAC__) #include "wx/osx/frame.h" #elif defined(__WXQT__) #include "wx/qt/frame.h" #endif #endif #endif // _WX_FRAME_H_BASE_
h
rticonnextdds-usecases
data/projects/rticonnextdds-usecases/VehicleTracking/ExampleCode/thirdparty/wxWidgets-3.1.2/Linux/include/wx/animdecod.h
///////////////////////////////////////////////////////////////////////////// // Name: wx/animdecod.h // Purpose: wxAnimationDecoder // Author: Francesco Montorsi // Copyright: (c) 2006 Francesco Montorsi // Licence: wxWindows licence ///////////////////////////////////////////////////////////////////////////// #ifndef _WX_ANIMDECOD_H #define _WX_ANIMDECOD_H #include "wx/defs.h" #if wxUSE_STREAMS #include "wx/colour.h" #include "wx/gdicmn.h" #include "wx/log.h" #include "wx/stream.h" class WXDLLIMPEXP_FWD_CORE wxImage; /* Differences between a wxAnimationDecoder and a wxImageHandler: 1) wxImageHandlers always load an input stream directly into a given wxImage object converting from the format-specific data representation to the wxImage native format (RGB24). wxAnimationDecoders always load an input stream using some optimized format to store it which is format-depedent. This allows to store a (possibly big) animation using a format which is a good compromise between required memory and time required to blit it on the screen. 2) wxAnimationDecoders contain the animation data in some internal variable. That's why they derive from wxObjectRefData: they are data which can be shared. 3) wxAnimationDecoders can be used by a wxImageHandler to retrieve a frame in wxImage format; the viceversa cannot be done. 4) wxAnimationDecoders are decoders only, thus they do not support save features. 5) wxAnimationDecoders are directly used by wxAnimation (generic implementation) as wxObjectRefData while they need to be 'wrapped' by a wxImageHandler for wxImage uses. */ // -------------------------------------------------------------------------- // Constants // -------------------------------------------------------------------------- // NB: the values of these enum items are not casual but coincide with the // GIF disposal codes. Do not change them !! enum wxAnimationDisposal { // No disposal specified. The decoder is not required to take any action. wxANIM_UNSPECIFIED = -1, // Do not dispose. The graphic is to be left in place. wxANIM_DONOTREMOVE = 0, // Restore to background color. The area used by the graphic must be // restored to the background color. wxANIM_TOBACKGROUND = 1, // Restore to previous. The decoder is required to restore the area // overwritten by the graphic with what was there prior to rendering the graphic. wxANIM_TOPREVIOUS = 2 }; enum wxAnimationType { wxANIMATION_TYPE_INVALID, wxANIMATION_TYPE_GIF, wxANIMATION_TYPE_ANI, wxANIMATION_TYPE_ANY }; // -------------------------------------------------------------------------- // wxAnimationDecoder class // -------------------------------------------------------------------------- class WXDLLIMPEXP_CORE wxAnimationDecoder : public wxObjectRefData { public: wxAnimationDecoder() { m_nFrames = 0; } virtual bool Load( wxInputStream& stream ) = 0; bool CanRead( wxInputStream& stream ) const { // NOTE: this code is the same of wxImageHandler::CallDoCanRead if ( !stream.IsSeekable() ) return false; // can't test unseekable stream wxFileOffset posOld = stream.TellI(); bool ok = DoCanRead(stream); // restore the old position to be able to test other formats and so on if ( stream.SeekI(posOld) == wxInvalidOffset ) { wxLogDebug(wxT("Failed to rewind the stream in wxAnimationDecoder!")); // reading would fail anyhow as we're not at the right position return false; } return ok; } virtual wxAnimationDecoder *Clone() const = 0; virtual wxAnimationType GetType() const = 0; // convert given frame to wxImage virtual bool ConvertToImage(unsigned int frame, wxImage *image) const = 0; // frame specific data getters // not all frames may be of the same size; e.g. GIF allows to // specify that between two frames only a smaller portion of the // entire animation has changed. virtual wxSize GetFrameSize(unsigned int frame) const = 0; // the position of this frame in case it's not as big as m_szAnimation // or wxPoint(0,0) otherwise. virtual wxPoint GetFramePosition(unsigned int frame) const = 0; // what should be done after displaying this frame. virtual wxAnimationDisposal GetDisposalMethod(unsigned int frame) const = 0; // the number of milliseconds this frame should be displayed. // if returns -1 then the frame must be displayed forever. virtual long GetDelay(unsigned int frame) const = 0; // the transparent colour for this frame if any or wxNullColour. virtual wxColour GetTransparentColour(unsigned int frame) const = 0; // get global data wxSize GetAnimationSize() const { return m_szAnimation; } wxColour GetBackgroundColour() const { return m_background; } unsigned int GetFrameCount() const { return m_nFrames; } protected: // checks the signature of the data in the given stream and returns true if it // appears to be a valid animation format recognized by the animation decoder; // this function should modify the stream current position without taking care // of restoring it since CanRead() will do it. virtual bool DoCanRead(wxInputStream& stream) const = 0; wxSize m_szAnimation; unsigned int m_nFrames; // this is the colour to use for the wxANIM_TOBACKGROUND disposal. // if not specified by the animation, it's set to wxNullColour wxColour m_background; }; #endif // wxUSE_STREAMS #endif // _WX_ANIMDECOD_H
h
rticonnextdds-usecases
data/projects/rticonnextdds-usecases/VehicleTracking/ExampleCode/thirdparty/wxWidgets-3.1.2/Linux/include/wx/encinfo.h
/////////////////////////////////////////////////////////////////////////////// // Name: wx/encinfo.h // Purpose: declares wxNativeEncodingInfo struct // Author: Vadim Zeitlin // Modified by: // Created: 19.09.2003 (extracted from wx/fontenc.h) // Copyright: (c) 2003 Vadim Zeitlin <[email protected]> // Licence: wxWindows licence /////////////////////////////////////////////////////////////////////////////// #ifndef _WX_ENCINFO_H_ #define _WX_ENCINFO_H_ #include "wx/string.h" // ---------------------------------------------------------------------------- // wxNativeEncodingInfo contains all encoding parameters for this platform // ---------------------------------------------------------------------------- // This private structure specifies all the parameters needed to create a font // with the given encoding on this platform. // // Under X, it contains the last 2 elements of the font specifications // (registry and encoding). // // Under Windows, it contains a number which is one of predefined XXX_CHARSET // values (https://msdn.microsoft.com/en-us/library/cc250412.aspx). // // Under all platforms it also contains a facename string which should be // used, if not empty, to create fonts in this encoding (this is the only way // to create a font of non-standard encoding (like KOI8) under Windows - the // facename specifies the encoding then) struct WXDLLIMPEXP_CORE wxNativeEncodingInfo { wxString facename; // may be empty meaning "any" wxFontEncoding encoding; // so that we know what this struct represents #if defined(__WXMSW__) || \ defined(__WXMAC__) || \ defined(__WXQT__) wxNativeEncodingInfo() : facename() , encoding(wxFONTENCODING_SYSTEM) , charset(0) /* ANSI_CHARSET */ { } int charset; #elif defined(_WX_X_FONTLIKE) wxString xregistry, xencoding; #elif defined(wxHAS_UTF8_FONTS) // ports using UTF-8 for text don't need encoding information for fonts #else #error "Unsupported toolkit" #endif // this struct is saved in config by wxFontMapper, so it should know to // serialise itself (implemented in platform-specific code) bool FromString(const wxString& s); wxString ToString() const; }; #endif // _WX_ENCINFO_H_
h
rticonnextdds-usecases
data/projects/rticonnextdds-usecases/VehicleTracking/ExampleCode/thirdparty/wxWidgets-3.1.2/Linux/include/wx/thrimpl.cpp
///////////////////////////////////////////////////////////////////////////// // Name: wx/thrimpl.cpp // Purpose: common part of wxThread Implementations // Author: Vadim Zeitlin // Modified by: // Created: 04.06.02 (extracted from src/*/thread.cpp files) // Copyright: (c) Vadim Zeitlin (2002) // Licence: wxWindows licence ///////////////////////////////////////////////////////////////////////////// // this file is supposed to be included only by the various thread.cpp // ---------------------------------------------------------------------------- // wxMutex // ---------------------------------------------------------------------------- wxMutex::wxMutex(wxMutexType mutexType) { m_internal = new wxMutexInternal(mutexType); if ( !m_internal->IsOk() ) { delete m_internal; m_internal = NULL; } } wxMutex::~wxMutex() { delete m_internal; } bool wxMutex::IsOk() const { return m_internal != NULL; } wxMutexError wxMutex::Lock() { wxCHECK_MSG( m_internal, wxMUTEX_INVALID, wxT("wxMutex::Lock(): not initialized") ); return m_internal->Lock(); } wxMutexError wxMutex::LockTimeout(unsigned long ms) { wxCHECK_MSG( m_internal, wxMUTEX_INVALID, wxT("wxMutex::Lock(): not initialized") ); return m_internal->Lock(ms); } wxMutexError wxMutex::TryLock() { wxCHECK_MSG( m_internal, wxMUTEX_INVALID, wxT("wxMutex::TryLock(): not initialized") ); return m_internal->TryLock(); } wxMutexError wxMutex::Unlock() { wxCHECK_MSG( m_internal, wxMUTEX_INVALID, wxT("wxMutex::Unlock(): not initialized") ); return m_internal->Unlock(); } // -------------------------------------------------------------------------- // wxConditionInternal // -------------------------------------------------------------------------- // Win32 doesn't have explicit support for the POSIX condition // variables and its events/event semaphores have quite different semantics, // so we reimplement the conditions from scratch using the mutexes and // semaphores #if defined(__WINDOWS__) class wxConditionInternal { public: wxConditionInternal(wxMutex& mutex); bool IsOk() const { return m_mutex.IsOk() && m_semaphore.IsOk(); } wxCondError Wait(); wxCondError WaitTimeout(unsigned long milliseconds); wxCondError Signal(); wxCondError Broadcast(); private: // the number of threads currently waiting for this condition LONG m_numWaiters; // the critical section protecting m_numWaiters wxCriticalSection m_csWaiters; wxMutex& m_mutex; wxSemaphore m_semaphore; wxDECLARE_NO_COPY_CLASS(wxConditionInternal); }; wxConditionInternal::wxConditionInternal(wxMutex& mutex) : m_mutex(mutex) { // another thread can't access it until we return from ctor, so no need to // protect access to m_numWaiters here m_numWaiters = 0; } wxCondError wxConditionInternal::Wait() { // increment the number of waiters { wxCriticalSectionLocker lock(m_csWaiters); m_numWaiters++; } m_mutex.Unlock(); // after unlocking the mutex other threads may Signal() us, but it is ok // now as we had already incremented m_numWaiters so Signal() will post the // semaphore and decrement m_numWaiters back even if it is called before we // start to Wait() const wxSemaError err = m_semaphore.Wait(); m_mutex.Lock(); if ( err == wxSEMA_NO_ERROR ) { // m_numWaiters was decremented by Signal() return wxCOND_NO_ERROR; } // but in case of an error we need to do it manually { wxCriticalSectionLocker lock(m_csWaiters); m_numWaiters--; } return err == wxSEMA_TIMEOUT ? wxCOND_TIMEOUT : wxCOND_MISC_ERROR; } wxCondError wxConditionInternal::WaitTimeout(unsigned long milliseconds) { { wxCriticalSectionLocker lock(m_csWaiters); m_numWaiters++; } m_mutex.Unlock(); wxSemaError err = m_semaphore.WaitTimeout(milliseconds); m_mutex.Lock(); if ( err == wxSEMA_NO_ERROR ) return wxCOND_NO_ERROR; if ( err == wxSEMA_TIMEOUT ) { // a potential race condition exists here: it happens when a waiting // thread times out but doesn't have time to decrement m_numWaiters yet // before Signal() is called in another thread // // to handle this particular case, check the semaphore again after // acquiring m_csWaiters lock -- this will catch the signals missed // during this window wxCriticalSectionLocker lock(m_csWaiters); err = m_semaphore.WaitTimeout(0); if ( err == wxSEMA_NO_ERROR ) return wxCOND_NO_ERROR; // we need to decrement m_numWaiters ourselves as it wasn't done by // Signal() m_numWaiters--; return err == wxSEMA_TIMEOUT ? wxCOND_TIMEOUT : wxCOND_MISC_ERROR; } // undo m_numWaiters++ above in case of an error { wxCriticalSectionLocker lock(m_csWaiters); m_numWaiters--; } return wxCOND_MISC_ERROR; } wxCondError wxConditionInternal::Signal() { wxCriticalSectionLocker lock(m_csWaiters); if ( m_numWaiters > 0 ) { // increment the semaphore by 1 if ( m_semaphore.Post() != wxSEMA_NO_ERROR ) return wxCOND_MISC_ERROR; m_numWaiters--; } return wxCOND_NO_ERROR; } wxCondError wxConditionInternal::Broadcast() { wxCriticalSectionLocker lock(m_csWaiters); while ( m_numWaiters > 0 ) { if ( m_semaphore.Post() != wxSEMA_NO_ERROR ) return wxCOND_MISC_ERROR; m_numWaiters--; } return wxCOND_NO_ERROR; } #endif // __WINDOWS__ // ---------------------------------------------------------------------------- // wxCondition // ---------------------------------------------------------------------------- wxCondition::wxCondition(wxMutex& mutex) { m_internal = new wxConditionInternal(mutex); if ( !m_internal->IsOk() ) { delete m_internal; m_internal = NULL; } } wxCondition::~wxCondition() { delete m_internal; } bool wxCondition::IsOk() const { return m_internal != NULL; } wxCondError wxCondition::Wait() { wxCHECK_MSG( m_internal, wxCOND_INVALID, wxT("wxCondition::Wait(): not initialized") ); return m_internal->Wait(); } wxCondError wxCondition::WaitTimeout(unsigned long milliseconds) { wxCHECK_MSG( m_internal, wxCOND_INVALID, wxT("wxCondition::Wait(): not initialized") ); return m_internal->WaitTimeout(milliseconds); } wxCondError wxCondition::Signal() { wxCHECK_MSG( m_internal, wxCOND_INVALID, wxT("wxCondition::Signal(): not initialized") ); return m_internal->Signal(); } wxCondError wxCondition::Broadcast() { wxCHECK_MSG( m_internal, wxCOND_INVALID, wxT("wxCondition::Broadcast(): not initialized") ); return m_internal->Broadcast(); } // -------------------------------------------------------------------------- // wxSemaphore // -------------------------------------------------------------------------- wxSemaphore::wxSemaphore(int initialcount, int maxcount) { m_internal = new wxSemaphoreInternal( initialcount, maxcount ); if ( !m_internal->IsOk() ) { delete m_internal; m_internal = NULL; } } wxSemaphore::~wxSemaphore() { delete m_internal; } bool wxSemaphore::IsOk() const { return m_internal != NULL; } wxSemaError wxSemaphore::Wait() { wxCHECK_MSG( m_internal, wxSEMA_INVALID, wxT("wxSemaphore::Wait(): not initialized") ); return m_internal->Wait(); } wxSemaError wxSemaphore::TryWait() { wxCHECK_MSG( m_internal, wxSEMA_INVALID, wxT("wxSemaphore::TryWait(): not initialized") ); return m_internal->TryWait(); } wxSemaError wxSemaphore::WaitTimeout(unsigned long milliseconds) { wxCHECK_MSG( m_internal, wxSEMA_INVALID, wxT("wxSemaphore::WaitTimeout(): not initialized") ); return m_internal->WaitTimeout(milliseconds); } wxSemaError wxSemaphore::Post() { wxCHECK_MSG( m_internal, wxSEMA_INVALID, wxT("wxSemaphore::Post(): not initialized") ); return m_internal->Post(); } // ---------------------------------------------------------------------------- // wxThread // ---------------------------------------------------------------------------- #include "wx/utils.h" #include "wx/private/threadinfo.h" #include "wx/scopeguard.h" void wxThread::Sleep(unsigned long milliseconds) { wxMilliSleep(milliseconds); } void *wxThread::CallEntry() { wxON_BLOCK_EXIT0(wxThreadSpecificInfo::ThreadCleanUp); return Entry(); }
cpp
rticonnextdds-usecases
data/projects/rticonnextdds-usecases/VehicleTracking/ExampleCode/thirdparty/wxWidgets-3.1.2/Linux/include/wx/strconv.h
/////////////////////////////////////////////////////////////////////////////// // Name: wx/strconv.h // Purpose: conversion routines for char sets any Unicode // Author: Ove Kaaven, Robert Roebling, Vadim Zeitlin // Modified by: // Created: 29/01/98 // Copyright: (c) 1998 Ove Kaaven, Robert Roebling // (c) 1998-2006 Vadim Zeitlin // Licence: wxWindows licence /////////////////////////////////////////////////////////////////////////////// #ifndef _WX_STRCONV_H_ #define _WX_STRCONV_H_ #include "wx/defs.h" #include "wx/chartype.h" #include "wx/buffer.h" #include <stdlib.h> class WXDLLIMPEXP_FWD_BASE wxString; // the error value returned by wxMBConv methods #define wxCONV_FAILED ((size_t)-1) // ---------------------------------------------------------------------------- // wxMBConv (abstract base class for conversions) // ---------------------------------------------------------------------------- // When deriving a new class from wxMBConv you must reimplement ToWChar() and // FromWChar() methods which are not pure virtual only for historical reasons, // don't let the fact that the existing classes implement MB2WC/WC2MB() instead // confuse you. // // You also have to implement Clone() to allow copying the conversions // polymorphically. // // And you might need to override GetMBNulLen() as well. class WXDLLIMPEXP_BASE wxMBConv { public: // The functions doing actual conversion from/to narrow to/from wide // character strings. // // On success, the return value is the length (i.e. the number of // characters, not bytes) of the converted string including any trailing // L'\0' or (possibly multiple) '\0'(s). If the conversion fails or if // there is not enough space for everything, including the trailing NUL // character(s), in the output buffer, wxCONV_FAILED is returned. // // In the special case when dst is NULL (the value of dstLen is ignored // then) the return value is the length of the needed buffer but nothing // happens otherwise. If srcLen is wxNO_LEN, the entire string, up to and // including the trailing NUL(s), is converted, otherwise exactly srcLen // bytes are. // // Typical usage: // // size_t dstLen = conv.ToWChar(NULL, 0, src); // if ( dstLen == wxCONV_FAILED ) // ... handle error ... // wchar_t *wbuf = new wchar_t[dstLen]; // conv.ToWChar(wbuf, dstLen, src); // ... work with wbuf ... // delete [] wbuf; // virtual size_t ToWChar(wchar_t *dst, size_t dstLen, const char *src, size_t srcLen = wxNO_LEN) const; virtual size_t FromWChar(char *dst, size_t dstLen, const wchar_t *src, size_t srcLen = wxNO_LEN) const; // Convenience functions for translating NUL-terminated strings: return // the buffer containing the converted string or empty buffer if the // conversion failed. wxWCharBuffer cMB2WC(const char *in) const { return DoConvertMB2WC(in, wxNO_LEN); } wxCharBuffer cWC2MB(const wchar_t *in) const { return DoConvertWC2MB(in, wxNO_LEN); } wxWCharBuffer cMB2WC(const wxScopedCharBuffer& in) const { return DoConvertMB2WC(in, in.length()); } wxCharBuffer cWC2MB(const wxScopedWCharBuffer& in) const { return DoConvertWC2MB(in, in.length()); } // Convenience functions for converting strings which may contain embedded // NULs and don't have to be NUL-terminated. // // inLen is the length of the buffer including trailing NUL if any or // wxNO_LEN if the input is NUL-terminated. // // outLen receives, if not NULL, the length of the converted string or 0 if // the conversion failed (returning 0 and not -1 in this case makes it // difficult to distinguish between failed conversion and empty input but // this is done for backwards compatibility). Notice that the rules for // whether outLen accounts or not for the last NUL are the same as for // To/FromWChar() above: if inLen is specified, outLen is exactly the // number of characters converted, whether the last one of them was NUL or // not. But if inLen == wxNO_LEN then outLen doesn't account for the last // NUL even though it is present. wxWCharBuffer cMB2WC(const char *in, size_t inLen, size_t *outLen) const; wxCharBuffer cWC2MB(const wchar_t *in, size_t inLen, size_t *outLen) const; // convenience functions for converting MB or WC to/from wxWin default #if wxUSE_UNICODE wxWCharBuffer cMB2WX(const char *psz) const { return cMB2WC(psz); } wxCharBuffer cWX2MB(const wchar_t *psz) const { return cWC2MB(psz); } const wchar_t* cWC2WX(const wchar_t *psz) const { return psz; } const wchar_t* cWX2WC(const wchar_t *psz) const { return psz; } #else // ANSI const char* cMB2WX(const char *psz) const { return psz; } const char* cWX2MB(const char *psz) const { return psz; } wxCharBuffer cWC2WX(const wchar_t *psz) const { return cWC2MB(psz); } wxWCharBuffer cWX2WC(const char *psz) const { return cMB2WC(psz); } #endif // Unicode/ANSI // this function is used in the implementation of cMB2WC() to distinguish // between the following cases: // // a) var width encoding with strings terminated by a single NUL // (usual multibyte encodings): return 1 in this case // b) fixed width encoding with 2 bytes/char and so terminated by // 2 NULs (UTF-16/UCS-2 and variants): return 2 in this case // c) fixed width encoding with 4 bytes/char and so terminated by // 4 NULs (UTF-32/UCS-4 and variants): return 4 in this case // // anything else is not supported currently and -1 should be returned virtual size_t GetMBNulLen() const { return 1; } // return the maximal value currently returned by GetMBNulLen() for any // encoding static size_t GetMaxMBNulLen() { return 4 /* for UTF-32 */; } // return true if the converter's charset is UTF-8, i.e. char* strings // decoded using this object can be directly copied to wxString's internal // storage without converting to WC and than back to UTF-8 MB string virtual bool IsUTF8() const { return false; } // The old conversion functions. The existing classes currently mostly // implement these ones but we're in transition to using To/FromWChar() // instead and any new classes should implement just the new functions. // For now, however, we provide default implementation of To/FromWChar() in // this base class in terms of MB2WC/WC2MB() to avoid having to rewrite all // the conversions at once. // // On success, the return value is the length (i.e. the number of // characters, not bytes) not counting the trailing NUL(s) of the converted // string. On failure, (size_t)-1 is returned. In the special case when // outputBuf is NULL the return value is the same one but nothing is // written to the buffer. // // Note that outLen is the length of the output buffer, not the length of // the input (which is always supposed to be terminated by one or more // NULs, as appropriate for the encoding)! virtual size_t MB2WC(wchar_t *out, const char *in, size_t outLen) const; virtual size_t WC2MB(char *out, const wchar_t *in, size_t outLen) const; // make a heap-allocated copy of this object virtual wxMBConv *Clone() const = 0; // virtual dtor for any base class virtual ~wxMBConv() { } private: // Common part of single argument cWC2MB() and cMB2WC() overloads above. wxCharBuffer DoConvertWC2MB(const wchar_t* pwz, size_t srcLen) const; wxWCharBuffer DoConvertMB2WC(const char* psz, size_t srcLen) const; }; // ---------------------------------------------------------------------------- // wxMBConvLibc uses standard mbstowcs() and wcstombs() functions for // conversion (hence it depends on the current locale) // ---------------------------------------------------------------------------- class WXDLLIMPEXP_BASE wxMBConvLibc : public wxMBConv { public: virtual size_t MB2WC(wchar_t *outputBuf, const char *psz, size_t outputSize) const wxOVERRIDE; virtual size_t WC2MB(char *outputBuf, const wchar_t *psz, size_t outputSize) const wxOVERRIDE; virtual wxMBConv *Clone() const wxOVERRIDE { return new wxMBConvLibc; } virtual bool IsUTF8() const wxOVERRIDE { return wxLocaleIsUtf8; } }; #ifdef __UNIX__ // ---------------------------------------------------------------------------- // wxConvBrokenFileNames is made for Unix in Unicode mode when // files are accidentally written in an encoding which is not // the system encoding. Typically, the system encoding will be // UTF8 but there might be files stored in ISO8859-1 on disk. // ---------------------------------------------------------------------------- class WXDLLIMPEXP_BASE wxConvBrokenFileNames : public wxMBConv { public: wxConvBrokenFileNames(const wxString& charset); wxConvBrokenFileNames(const wxConvBrokenFileNames& conv) : wxMBConv(), m_conv(conv.m_conv ? conv.m_conv->Clone() : NULL) { } virtual ~wxConvBrokenFileNames() { delete m_conv; } virtual size_t MB2WC(wchar_t *out, const char *in, size_t outLen) const wxOVERRIDE { return m_conv->MB2WC(out, in, outLen); } virtual size_t WC2MB(char *out, const wchar_t *in, size_t outLen) const wxOVERRIDE { return m_conv->WC2MB(out, in, outLen); } virtual size_t GetMBNulLen() const wxOVERRIDE { // cast needed to call a private function return m_conv->GetMBNulLen(); } virtual bool IsUTF8() const wxOVERRIDE { return m_conv->IsUTF8(); } virtual wxMBConv *Clone() const wxOVERRIDE { return new wxConvBrokenFileNames(*this); } private: // the conversion object we forward to wxMBConv *m_conv; wxDECLARE_NO_ASSIGN_CLASS(wxConvBrokenFileNames); }; #endif // __UNIX__ // ---------------------------------------------------------------------------- // wxMBConvUTF7 (for conversion using UTF7 encoding) // ---------------------------------------------------------------------------- class WXDLLIMPEXP_BASE wxMBConvUTF7 : public wxMBConv { public: wxMBConvUTF7() { } // compiler-generated copy ctor, assignment operator and dtor are ok // (assuming it's ok to copy the shift state -- not really sure about it) virtual size_t ToWChar(wchar_t *dst, size_t dstLen, const char *src, size_t srcLen = wxNO_LEN) const wxOVERRIDE; virtual size_t FromWChar(char *dst, size_t dstLen, const wchar_t *src, size_t srcLen = wxNO_LEN) const wxOVERRIDE; virtual wxMBConv *Clone() const wxOVERRIDE { return new wxMBConvUTF7; } private: // UTF-7 decoder/encoder may be in direct mode or in shifted mode after a // '+' (and until the '-' or any other non-base64 character) struct StateMode { enum Mode { Direct, // pass through state Shifted // after a '+' (and before '-') }; }; // the current decoder state: this is only used by ToWChar() if srcLen // parameter is not wxNO_LEN, when working on the entire NUL-terminated // strings we neither update nor use the state class DecoderState : private StateMode { private: // current state: this one is private as we want to enforce the use of // ToDirect/ToShifted() methods below Mode mode; public: // the initial state is direct DecoderState() { mode = Direct; } // switch to/from shifted mode void ToDirect() { mode = Direct; } void ToShifted() { mode = Shifted; accum = bit = 0; isLSB = false; } bool IsDirect() const { return mode == Direct; } bool IsShifted() const { return mode == Shifted; } // these variables are only used in shifted mode unsigned int accum; // accumulator of the bit we've already got unsigned int bit; // the number of bits consumed mod 8 unsigned char msb; // the high byte of UTF-16 word bool isLSB; // whether we're decoding LSB or MSB of UTF-16 word }; DecoderState m_stateDecoder; // encoder state is simpler as we always receive entire Unicode characters // on input class EncoderState : private StateMode { private: Mode mode; public: EncoderState() { mode = Direct; } void ToDirect() { mode = Direct; } void ToShifted() { mode = Shifted; accum = bit = 0; } bool IsDirect() const { return mode == Direct; } bool IsShifted() const { return mode == Shifted; } unsigned int accum; unsigned int bit; }; EncoderState m_stateEncoder; }; // ---------------------------------------------------------------------------- // wxMBConvUTF8 (for conversion using UTF8 encoding) // ---------------------------------------------------------------------------- // this is the real UTF-8 conversion class, it has to be called "strict UTF-8" // for compatibility reasons: the wxMBConvUTF8 class below also supports lossy // conversions if it is created with non default options class WXDLLIMPEXP_BASE wxMBConvStrictUTF8 : public wxMBConv { public: // compiler-generated default ctor and other methods are ok virtual size_t ToWChar(wchar_t *dst, size_t dstLen, const char *src, size_t srcLen = wxNO_LEN) const wxOVERRIDE; virtual size_t FromWChar(char *dst, size_t dstLen, const wchar_t *src, size_t srcLen = wxNO_LEN) const wxOVERRIDE; virtual wxMBConv *Clone() const wxOVERRIDE { return new wxMBConvStrictUTF8(); } // NB: other mapping modes are not, strictly speaking, UTF-8, so we can't // take the shortcut in that case virtual bool IsUTF8() const wxOVERRIDE { return true; } }; class WXDLLIMPEXP_BASE wxMBConvUTF8 : public wxMBConvStrictUTF8 { public: enum { MAP_INVALID_UTF8_NOT = 0, MAP_INVALID_UTF8_TO_PUA = 1, MAP_INVALID_UTF8_TO_OCTAL = 2 }; wxMBConvUTF8(int options = MAP_INVALID_UTF8_NOT) : m_options(options) { } virtual size_t ToWChar(wchar_t *dst, size_t dstLen, const char *src, size_t srcLen = wxNO_LEN) const wxOVERRIDE; virtual size_t FromWChar(char *dst, size_t dstLen, const wchar_t *src, size_t srcLen = wxNO_LEN) const wxOVERRIDE; virtual wxMBConv *Clone() const wxOVERRIDE { return new wxMBConvUTF8(m_options); } // NB: other mapping modes are not, strictly speaking, UTF-8, so we can't // take the shortcut in that case virtual bool IsUTF8() const wxOVERRIDE { return m_options == MAP_INVALID_UTF8_NOT; } private: int m_options; }; // ---------------------------------------------------------------------------- // wxMBConvUTF16Base: for both LE and BE variants // ---------------------------------------------------------------------------- class WXDLLIMPEXP_BASE wxMBConvUTF16Base : public wxMBConv { public: enum { BYTES_PER_CHAR = 2 }; virtual size_t GetMBNulLen() const wxOVERRIDE { return BYTES_PER_CHAR; } protected: // return the length of the buffer using srcLen if it's not wxNO_LEN and // computing the length ourselves if it is; also checks that the length is // even if specified as we need an entire number of UTF-16 characters and // returns wxNO_LEN which indicates error if it is odd static size_t GetLength(const char *src, size_t srcLen); }; // ---------------------------------------------------------------------------- // wxMBConvUTF16LE (for conversion using UTF16 Little Endian encoding) // ---------------------------------------------------------------------------- class WXDLLIMPEXP_BASE wxMBConvUTF16LE : public wxMBConvUTF16Base { public: virtual size_t ToWChar(wchar_t *dst, size_t dstLen, const char *src, size_t srcLen = wxNO_LEN) const wxOVERRIDE; virtual size_t FromWChar(char *dst, size_t dstLen, const wchar_t *src, size_t srcLen = wxNO_LEN) const wxOVERRIDE; virtual wxMBConv *Clone() const wxOVERRIDE { return new wxMBConvUTF16LE; } }; // ---------------------------------------------------------------------------- // wxMBConvUTF16BE (for conversion using UTF16 Big Endian encoding) // ---------------------------------------------------------------------------- class WXDLLIMPEXP_BASE wxMBConvUTF16BE : public wxMBConvUTF16Base { public: virtual size_t ToWChar(wchar_t *dst, size_t dstLen, const char *src, size_t srcLen = wxNO_LEN) const wxOVERRIDE; virtual size_t FromWChar(char *dst, size_t dstLen, const wchar_t *src, size_t srcLen = wxNO_LEN) const wxOVERRIDE; virtual wxMBConv *Clone() const wxOVERRIDE { return new wxMBConvUTF16BE; } }; // ---------------------------------------------------------------------------- // wxMBConvUTF32Base: base class for both LE and BE variants // ---------------------------------------------------------------------------- class WXDLLIMPEXP_BASE wxMBConvUTF32Base : public wxMBConv { public: enum { BYTES_PER_CHAR = 4 }; virtual size_t GetMBNulLen() const wxOVERRIDE { return BYTES_PER_CHAR; } protected: // this is similar to wxMBConvUTF16Base method with the same name except // that, of course, it verifies that length is divisible by 4 if given and // not by 2 static size_t GetLength(const char *src, size_t srcLen); }; // ---------------------------------------------------------------------------- // wxMBConvUTF32LE (for conversion using UTF32 Little Endian encoding) // ---------------------------------------------------------------------------- class WXDLLIMPEXP_BASE wxMBConvUTF32LE : public wxMBConvUTF32Base { public: virtual size_t ToWChar(wchar_t *dst, size_t dstLen, const char *src, size_t srcLen = wxNO_LEN) const wxOVERRIDE; virtual size_t FromWChar(char *dst, size_t dstLen, const wchar_t *src, size_t srcLen = wxNO_LEN) const wxOVERRIDE; virtual wxMBConv *Clone() const wxOVERRIDE { return new wxMBConvUTF32LE; } }; // ---------------------------------------------------------------------------- // wxMBConvUTF32BE (for conversion using UTF32 Big Endian encoding) // ---------------------------------------------------------------------------- class WXDLLIMPEXP_BASE wxMBConvUTF32BE : public wxMBConvUTF32Base { public: virtual size_t ToWChar(wchar_t *dst, size_t dstLen, const char *src, size_t srcLen = wxNO_LEN) const wxOVERRIDE; virtual size_t FromWChar(char *dst, size_t dstLen, const wchar_t *src, size_t srcLen = wxNO_LEN) const wxOVERRIDE; virtual wxMBConv *Clone() const wxOVERRIDE { return new wxMBConvUTF32BE; } }; // ---------------------------------------------------------------------------- // wxCSConv (for conversion based on loadable char sets) // ---------------------------------------------------------------------------- #include "wx/fontenc.h" class WXDLLIMPEXP_BASE wxCSConv : public wxMBConv { public: // we can be created either from charset name or from an encoding constant // but we can't have both at once wxCSConv(const wxString& charset); wxCSConv(wxFontEncoding encoding); wxCSConv(const wxCSConv& conv); virtual ~wxCSConv(); wxCSConv& operator=(const wxCSConv& conv); virtual size_t ToWChar(wchar_t *dst, size_t dstLen, const char *src, size_t srcLen = wxNO_LEN) const wxOVERRIDE; virtual size_t FromWChar(char *dst, size_t dstLen, const wchar_t *src, size_t srcLen = wxNO_LEN) const wxOVERRIDE; virtual size_t GetMBNulLen() const wxOVERRIDE; virtual bool IsUTF8() const wxOVERRIDE; virtual wxMBConv *Clone() const wxOVERRIDE { return new wxCSConv(*this); } void Clear(); // return true if the conversion could be initialized successfully bool IsOk() const; private: // common part of all ctors void Init(); // Creates the conversion to use, called from all ctors to initialize // m_convReal. wxMBConv *DoCreate() const; // Set the name (may be only called when m_name == NULL), makes copy of // the charset string. void SetName(const char *charset); // Set m_encoding field respecting the rules below, i.e. making sure it has // a valid value if m_name == NULL (thus this should be always called after // SetName()). // // Input encoding may be valid or not. void SetEncoding(wxFontEncoding encoding); // The encoding we use is specified by the two fields below: // // 1. If m_name != NULL, m_encoding corresponds to it if it's one of // encodings we know about (i.e. member of wxFontEncoding) or is // wxFONTENCODING_SYSTEM otherwise. // // 2. If m_name == NULL, m_encoding is always valid, i.e. not one of // wxFONTENCODING_{SYSTEM,DEFAULT,MAX}. char *m_name; wxFontEncoding m_encoding; // The conversion object for our encoding or NULL if we failed to create it // in which case we fall back to hard-coded ISO8859-1 conversion. wxMBConv *m_convReal; }; // ---------------------------------------------------------------------------- // wxWhateverWorksConv: use whatever encoding works for the input // ---------------------------------------------------------------------------- class WXDLLIMPEXP_BASE wxWhateverWorksConv : public wxMBConv { public: wxWhateverWorksConv() { } // Try to interpret the string as UTF-8, if it fails fall back to the // current locale encoding (wxConvLibc) and if this fails as well, // interpret it as wxConvISO8859_1 (which is used because it never fails // and this conversion is used when we really, really must produce // something on output). virtual size_t ToWChar(wchar_t *dst, size_t dstLen, const char *src, size_t srcLen = wxNO_LEN) const wxOVERRIDE; // Try to encode the string using the current locale encoding (wxConvLibc) // and fall back to UTF-8 (which never fails) if it doesn't work. Note that // we never use wxConvISO8859_1 here as we prefer to fall back on UTF-8 // even for the strings containing only code points representable in 8869-1. virtual size_t FromWChar(char *dst, size_t dstLen, const wchar_t *src, size_t srcLen = wxNO_LEN) const wxOVERRIDE; virtual wxMBConv *Clone() const wxOVERRIDE { return new wxWhateverWorksConv(); } }; // ---------------------------------------------------------------------------- // declare predefined conversion objects // ---------------------------------------------------------------------------- // Note: this macro is an implementation detail (see the comment in // strconv.cpp). The wxGet_XXX() and wxGet_XXXPtr() functions shouldn't be // used by user code and neither should XXXPtr, use the wxConvXXX macro // instead. #define WX_DECLARE_GLOBAL_CONV(klass, name) \ extern WXDLLIMPEXP_DATA_BASE(klass*) name##Ptr; \ extern WXDLLIMPEXP_BASE klass* wxGet_##name##Ptr(); \ inline klass& wxGet_##name() \ { \ if ( !name##Ptr ) \ name##Ptr = wxGet_##name##Ptr(); \ return *name##Ptr; \ } // conversion to be used with all standard functions affected by locale, e.g. // strtol(), strftime(), ... WX_DECLARE_GLOBAL_CONV(wxMBConv, wxConvLibc) #define wxConvLibc wxGet_wxConvLibc() // conversion ISO-8859-1/UTF-7/UTF-8 <-> wchar_t WX_DECLARE_GLOBAL_CONV(wxCSConv, wxConvISO8859_1) #define wxConvISO8859_1 wxGet_wxConvISO8859_1() WX_DECLARE_GLOBAL_CONV(wxMBConvStrictUTF8, wxConvUTF8) #define wxConvUTF8 wxGet_wxConvUTF8() WX_DECLARE_GLOBAL_CONV(wxMBConvUTF7, wxConvUTF7) #define wxConvUTF7 wxGet_wxConvUTF7() // conversion used when we may not afford to lose data when outputting Unicode // strings (should be avoid in the other direction as it can misinterpret the // input encoding) WX_DECLARE_GLOBAL_CONV(wxWhateverWorksConv, wxConvWhateverWorks) #define wxConvWhateverWorks wxGet_wxConvWhateverWorks() // conversion used for the file names on the systems where they're not Unicode // (basically anything except Windows) // // this is used by all file functions, can be changed by the application // // by default UTF-8 under Mac OS X and wxConvLibc elsewhere (but it's not used // under Windows normally) extern WXDLLIMPEXP_DATA_BASE(wxMBConv *) wxConvFileName; // backwards compatible define #define wxConvFile (*wxConvFileName) // the current conversion object, may be set to any conversion, is used by // default in a couple of places inside wx (initially same as wxConvLibc) extern WXDLLIMPEXP_DATA_BASE(wxMBConv *) wxConvCurrent; // the conversion corresponding to the current locale WX_DECLARE_GLOBAL_CONV(wxCSConv, wxConvLocal) #define wxConvLocal wxGet_wxConvLocal() // the conversion corresponding to the encoding of the standard UI elements // // by default this is the same as wxConvLocal but may be changed if the program // needs to use a fixed encoding extern WXDLLIMPEXP_DATA_BASE(wxMBConv *) wxConvUI; #undef WX_DECLARE_GLOBAL_CONV // ---------------------------------------------------------------------------- // endianness-dependent conversions // ---------------------------------------------------------------------------- #ifdef WORDS_BIGENDIAN typedef wxMBConvUTF16BE wxMBConvUTF16; typedef wxMBConvUTF32BE wxMBConvUTF32; #else typedef wxMBConvUTF16LE wxMBConvUTF16; typedef wxMBConvUTF32LE wxMBConvUTF32; #endif // ---------------------------------------------------------------------------- // filename conversion macros // ---------------------------------------------------------------------------- // filenames are multibyte on Unix and widechar on Windows #if wxMBFILES && wxUSE_UNICODE #define wxFNCONV(name) wxConvFileName->cWX2MB(name) #define wxFNSTRINGCAST wxMBSTRINGCAST #else #if defined(__WXOSX__) && wxMBFILES #define wxFNCONV(name) wxConvFileName->cWC2MB( wxConvLocal.cWX2WC(name) ) #else #define wxFNCONV(name) name #endif #define wxFNSTRINGCAST WXSTRINGCAST #endif // ---------------------------------------------------------------------------- // macros for the most common conversions // ---------------------------------------------------------------------------- #if wxUSE_UNICODE #define wxConvertWX2MB(s) wxConvCurrent->cWX2MB(s) #define wxConvertMB2WX(s) wxConvCurrent->cMB2WX(s) // these functions should be used when the conversions really, really have // to succeed (usually because we pass their results to a standard C // function which would crash if we passed NULL to it), so these functions // always return a valid pointer if their argument is non-NULL inline wxWCharBuffer wxSafeConvertMB2WX(const char *s) { return wxConvWhateverWorks.cMB2WC(s); } inline wxCharBuffer wxSafeConvertWX2MB(const wchar_t *ws) { return wxConvWhateverWorks.cWC2MB(ws); } #else // ANSI // no conversions to do #define wxConvertWX2MB(s) (s) #define wxConvertMB2WX(s) (s) #define wxSafeConvertMB2WX(s) (s) #define wxSafeConvertWX2MB(s) (s) #endif // Unicode/ANSI #endif // _WX_STRCONV_H_
h
rticonnextdds-usecases
data/projects/rticonnextdds-usecases/VehicleTracking/ExampleCode/thirdparty/wxWidgets-3.1.2/Linux/include/wx/buffer.h
/////////////////////////////////////////////////////////////////////////////// // Name: wx/buffer.h // Purpose: auto buffer classes: buffers which automatically free memory // Author: Vadim Zeitlin // Modified by: // Created: 12.04.99 // Copyright: (c) 1998 Vadim Zeitlin <[email protected]> // Licence: wxWindows licence /////////////////////////////////////////////////////////////////////////////// #ifndef _WX_BUFFER_H #define _WX_BUFFER_H #include "wx/defs.h" #include "wx/wxcrtbase.h" #include <stdlib.h> // malloc() and free() class WXDLLIMPEXP_FWD_BASE wxCStrData; // ---------------------------------------------------------------------------- // Special classes for (wide) character strings: they use malloc/free instead // of new/delete // ---------------------------------------------------------------------------- // helpers used by wxCharTypeBuffer namespace wxPrivate { struct UntypedBufferData { enum Kind { Owned, NonOwned }; UntypedBufferData(void *str, size_t len, Kind kind = Owned) : m_str(str), m_length(len), m_ref(1), m_owned(kind == Owned) {} ~UntypedBufferData() { if ( m_owned ) free(m_str); } void *m_str; size_t m_length; // "short" to have sizeof(Data)=12 on 32bit archs unsigned short m_ref; bool m_owned; }; // NB: this is defined in string.cpp and not the (non-existent) buffer.cpp WXDLLIMPEXP_BASE UntypedBufferData * GetUntypedNullData(); } // namespace wxPrivate // Reference-counted character buffer for storing string data. The buffer // is only valid for as long as the "parent" object that provided the data // is valid; see wxCharTypeBuffer<T> for persistent variant. template <typename T> class wxScopedCharTypeBuffer { public: typedef T CharType; wxScopedCharTypeBuffer() { m_data = GetNullData(); } // Creates "non-owned" buffer, i.e. 'str' is not owned by the buffer // and doesn't get freed by dtor. Used e.g. to point to wxString's internal // storage. static const wxScopedCharTypeBuffer CreateNonOwned(const CharType *str, size_t len = wxNO_LEN) { if ( len == wxNO_LEN ) len = wxStrlen(str); wxScopedCharTypeBuffer buf; if ( str ) buf.m_data = new Data(const_cast<CharType*>(str), len, Data::NonOwned); return buf; } // Creates "owned" buffer, i.e. takes over ownership of 'str' and frees it // in dtor (if ref.count reaches 0). static const wxScopedCharTypeBuffer CreateOwned(CharType *str, size_t len = wxNO_LEN ) { if ( len == wxNO_LEN ) len = wxStrlen(str); wxScopedCharTypeBuffer buf; if ( str ) buf.m_data = new Data(str, len); return buf; } wxScopedCharTypeBuffer(const wxScopedCharTypeBuffer& src) { m_data = src.m_data; IncRef(); } wxScopedCharTypeBuffer& operator=(const wxScopedCharTypeBuffer& src) { if ( &src == this ) return *this; DecRef(); m_data = src.m_data; IncRef(); return *this; } ~wxScopedCharTypeBuffer() { DecRef(); } // NB: this method is only const for backward compatibility. It used to // be needed for auto_ptr-like semantics of the copy ctor, but now // that ref-counting is used, it's not really needed. CharType *release() const { if ( m_data == GetNullData() ) return NULL; wxASSERT_MSG( m_data->m_owned, wxT("can't release non-owned buffer") ); wxASSERT_MSG( m_data->m_ref == 1, wxT("can't release shared buffer") ); CharType * const p = m_data->Get(); wxScopedCharTypeBuffer *self = const_cast<wxScopedCharTypeBuffer*>(this); self->m_data->Set(NULL, 0); self->DecRef(); return p; } void reset() { DecRef(); } CharType *data() { return m_data->Get(); } const CharType *data() const { return m_data->Get(); } operator const CharType *() const { return data(); } CharType operator[](size_t n) const { return data()[n]; } size_t length() const { return m_data->m_length; } protected: // reference-counted data struct Data : public wxPrivate::UntypedBufferData { Data(CharType *str, size_t len, Kind kind = Owned) : wxPrivate::UntypedBufferData(str, len, kind) { } CharType *Get() const { return static_cast<CharType *>(m_str); } void Set(CharType *str, size_t len) { m_str = str; m_length = len; } }; // placeholder for NULL string, to simplify this code static Data *GetNullData() { return static_cast<Data *>(wxPrivate::GetUntypedNullData()); } void IncRef() { if ( m_data == GetNullData() ) // exception, not ref-counted return; m_data->m_ref++; } void DecRef() { if ( m_data == GetNullData() ) // exception, not ref-counted return; if ( --m_data->m_ref == 0 ) delete m_data; m_data = GetNullData(); } // sets this object to a be copy of 'other'; if 'src' is non-owned, // a deep copy is made and 'this' will contain new instance of the data void MakeOwnedCopyOf(const wxScopedCharTypeBuffer& src) { this->DecRef(); if ( src.m_data == this->GetNullData() ) { this->m_data = this->GetNullData(); } else if ( src.m_data->m_owned ) { this->m_data = src.m_data; this->IncRef(); } else { // if the scoped buffer had non-owned data, we have to make // a copy here, because src.m_data->m_str is valid only for as long // as 'src' exists this->m_data = new Data ( StrCopy(src.data(), src.length()), src.length() ); } } static CharType *StrCopy(const CharType *src, size_t len) { CharType *dst = (CharType*)malloc(sizeof(CharType) * (len + 1)); if ( dst ) memcpy(dst, src, sizeof(CharType) * (len + 1)); return dst; } protected: Data *m_data; }; typedef wxScopedCharTypeBuffer<char> wxScopedCharBuffer; typedef wxScopedCharTypeBuffer<wchar_t> wxScopedWCharBuffer; // this buffer class always stores data in "owned" (persistent) manner template <typename T> class wxCharTypeBuffer : public wxScopedCharTypeBuffer<T> { protected: typedef typename wxScopedCharTypeBuffer<T>::Data Data; public: typedef T CharType; wxCharTypeBuffer(const CharType *str = NULL, size_t len = wxNO_LEN) { if ( str ) { if ( len == wxNO_LEN ) len = wxStrlen(str); this->m_data = new Data(this->StrCopy(str, len), len); } else { this->m_data = this->GetNullData(); } } wxCharTypeBuffer(size_t len) { CharType* const str = (CharType *)malloc((len + 1)*sizeof(CharType)); if ( str ) { str[len] = (CharType)0; // There is a potential memory leak here if new throws because it // fails to allocate Data, we ought to use new(nothrow) here, but // this might fail to compile under some platforms so until this // can be fully tested, just live with this (rather unlikely, as // Data is a small object) potential leak. this->m_data = new Data(str, len); } else { this->m_data = this->GetNullData(); } } wxCharTypeBuffer(const wxCharTypeBuffer& src) : wxScopedCharTypeBuffer<T>(src) {} wxCharTypeBuffer& operator=(const CharType *str) { this->DecRef(); if ( str ) this->m_data = new Data(wxStrdup(str), wxStrlen(str)); return *this; } wxCharTypeBuffer& operator=(const wxCharTypeBuffer& src) { wxScopedCharTypeBuffer<T>::operator=(src); return *this; } wxCharTypeBuffer(const wxScopedCharTypeBuffer<T>& src) { this->MakeOwnedCopyOf(src); } wxCharTypeBuffer& operator=(const wxScopedCharTypeBuffer<T>& src) { MakeOwnedCopyOf(src); return *this; } bool extend(size_t len) { wxASSERT_MSG( this->m_data->m_owned, "cannot extend non-owned buffer" ); wxASSERT_MSG( this->m_data->m_ref == 1, "can't extend shared buffer" ); CharType *str = (CharType *)realloc(this->data(), (len + 1) * sizeof(CharType)); if ( !str ) return false; // For consistency with the ctor taking just the length, NUL-terminate // the buffer. str[len] = (CharType)0; if ( this->m_data == this->GetNullData() ) { this->m_data = new Data(str, len); } else { this->m_data->Set(str, len); this->m_data->m_owned = true; } return true; } void shrink(size_t len) { wxASSERT_MSG( this->m_data->m_owned, "cannot shrink non-owned buffer" ); wxASSERT_MSG( this->m_data->m_ref == 1, "can't shrink shared buffer" ); wxASSERT( len <= this->length() ); this->m_data->m_length = len; this->data()[len] = 0; } }; class wxCharBuffer : public wxCharTypeBuffer<char> { public: typedef wxCharTypeBuffer<char> wxCharTypeBufferBase; typedef wxScopedCharTypeBuffer<char> wxScopedCharTypeBufferBase; wxCharBuffer(const wxCharTypeBufferBase& buf) : wxCharTypeBufferBase(buf) {} wxCharBuffer(const wxScopedCharTypeBufferBase& buf) : wxCharTypeBufferBase(buf) {} wxCharBuffer(const CharType *str = NULL) : wxCharTypeBufferBase(str) {} wxCharBuffer(size_t len) : wxCharTypeBufferBase(len) {} wxCharBuffer(const wxCStrData& cstr); }; class wxWCharBuffer : public wxCharTypeBuffer<wchar_t> { public: typedef wxCharTypeBuffer<wchar_t> wxCharTypeBufferBase; typedef wxScopedCharTypeBuffer<wchar_t> wxScopedCharTypeBufferBase; wxWCharBuffer(const wxCharTypeBufferBase& buf) : wxCharTypeBufferBase(buf) {} wxWCharBuffer(const wxScopedCharTypeBufferBase& buf) : wxCharTypeBufferBase(buf) {} wxWCharBuffer(const CharType *str = NULL) : wxCharTypeBufferBase(str) {} wxWCharBuffer(size_t len) : wxCharTypeBufferBase(len) {} wxWCharBuffer(const wxCStrData& cstr); }; // wxCharTypeBuffer<T> implicitly convertible to T* template <typename T> class wxWritableCharTypeBuffer : public wxCharTypeBuffer<T> { public: typedef typename wxScopedCharTypeBuffer<T>::CharType CharType; wxWritableCharTypeBuffer(const wxScopedCharTypeBuffer<T>& src) : wxCharTypeBuffer<T>(src) {} // FIXME-UTF8: this won't be needed after converting mb_str()/wc_str() to // always return a buffer // + we should derive this class from wxScopedCharTypeBuffer // then wxWritableCharTypeBuffer(const CharType *str = NULL) : wxCharTypeBuffer<T>(str) {} operator CharType*() { return this->data(); } }; typedef wxWritableCharTypeBuffer<char> wxWritableCharBuffer; typedef wxWritableCharTypeBuffer<wchar_t> wxWritableWCharBuffer; #if wxUSE_UNICODE #define wxWxCharBuffer wxWCharBuffer #define wxMB2WXbuf wxWCharBuffer #define wxWX2MBbuf wxCharBuffer #if wxUSE_UNICODE_WCHAR #define wxWC2WXbuf wxChar* #define wxWX2WCbuf wxChar* #elif wxUSE_UNICODE_UTF8 #define wxWC2WXbuf wxWCharBuffer #define wxWX2WCbuf wxWCharBuffer #endif #else // ANSI #define wxWxCharBuffer wxCharBuffer #define wxMB2WXbuf wxChar* #define wxWX2MBbuf wxChar* #define wxWC2WXbuf wxCharBuffer #define wxWX2WCbuf wxWCharBuffer #endif // Unicode/ANSI // ---------------------------------------------------------------------------- // A class for holding growable data buffers (not necessarily strings) // ---------------------------------------------------------------------------- // This class manages the actual data buffer pointer and is ref-counted. class wxMemoryBufferData { public: // the initial size and also the size added by ResizeIfNeeded() enum { DefBufSize = 1024 }; friend class wxMemoryBuffer; // everything is private as it can only be used by wxMemoryBuffer private: wxMemoryBufferData(size_t size = wxMemoryBufferData::DefBufSize) : m_data(size ? malloc(size) : NULL), m_size(size), m_len(0), m_ref(0) { } ~wxMemoryBufferData() { free(m_data); } void ResizeIfNeeded(size_t newSize) { if (newSize > m_size) { void* const data = realloc(m_data, newSize + wxMemoryBufferData::DefBufSize); if ( !data ) { // It's better to crash immediately dereferencing a null // pointer in the function calling us than overflowing the // buffer which couldn't be made big enough. free(release()); return; } m_data = data; m_size = newSize + wxMemoryBufferData::DefBufSize; } } void IncRef() { m_ref += 1; } void DecRef() { m_ref -= 1; if (m_ref == 0) // are there no more references? delete this; } void *release() { if ( m_data == NULL ) return NULL; wxASSERT_MSG( m_ref == 1, "can't release shared buffer" ); void *p = m_data; m_data = NULL; m_len = m_size = 0; return p; } // the buffer containing the data void *m_data; // the size of the buffer size_t m_size; // the amount of data currently in the buffer size_t m_len; // the reference count size_t m_ref; wxDECLARE_NO_COPY_CLASS(wxMemoryBufferData); }; class wxMemoryBuffer { public: // ctor and dtor wxMemoryBuffer(size_t size = wxMemoryBufferData::DefBufSize) { m_bufdata = new wxMemoryBufferData(size); m_bufdata->IncRef(); } ~wxMemoryBuffer() { m_bufdata->DecRef(); } // copy and assignment wxMemoryBuffer(const wxMemoryBuffer& src) : m_bufdata(src.m_bufdata) { m_bufdata->IncRef(); } wxMemoryBuffer& operator=(const wxMemoryBuffer& src) { if (&src != this) { m_bufdata->DecRef(); m_bufdata = src.m_bufdata; m_bufdata->IncRef(); } return *this; } // Accessors void *GetData() const { return m_bufdata->m_data; } size_t GetBufSize() const { return m_bufdata->m_size; } size_t GetDataLen() const { return m_bufdata->m_len; } bool IsEmpty() const { return GetDataLen() == 0; } void SetBufSize(size_t size) { m_bufdata->ResizeIfNeeded(size); } void SetDataLen(size_t len) { wxASSERT(len <= m_bufdata->m_size); m_bufdata->m_len = len; } void Clear() { SetDataLen(0); } // Ensure the buffer is big enough and return a pointer to it void *GetWriteBuf(size_t sizeNeeded) { m_bufdata->ResizeIfNeeded(sizeNeeded); return m_bufdata->m_data; } // Update the length after the write void UngetWriteBuf(size_t sizeUsed) { SetDataLen(sizeUsed); } // Like the above, but appends to the buffer void *GetAppendBuf(size_t sizeNeeded) { m_bufdata->ResizeIfNeeded(m_bufdata->m_len + sizeNeeded); return (char*)m_bufdata->m_data + m_bufdata->m_len; } // Update the length after the append void UngetAppendBuf(size_t sizeUsed) { SetDataLen(m_bufdata->m_len + sizeUsed); } // Other ways to append to the buffer void AppendByte(char data) { wxCHECK_RET( m_bufdata->m_data, wxT("invalid wxMemoryBuffer") ); m_bufdata->ResizeIfNeeded(m_bufdata->m_len + 1); *(((char*)m_bufdata->m_data) + m_bufdata->m_len) = data; m_bufdata->m_len += 1; } void AppendData(const void *data, size_t len) { memcpy(GetAppendBuf(len), data, len); UngetAppendBuf(len); } operator const char *() const { return (const char*)GetData(); } // gives up ownership of data, returns the pointer; after this call, // data isn't freed by the buffer and its content is resent to empty void *release() { return m_bufdata->release(); } private: wxMemoryBufferData* m_bufdata; }; // ---------------------------------------------------------------------------- // template class for any kind of data // ---------------------------------------------------------------------------- // TODO #endif // _WX_BUFFER_H
h
rticonnextdds-usecases
data/projects/rticonnextdds-usecases/VehicleTracking/ExampleCode/thirdparty/wxWidgets-3.1.2/Linux/include/wx/vms_x_fix.h
/*************************************************************************** * * * Author : Jouk Jansen ([email protected]) * * * * Last revision : 7 October 2005 * * * * Repair definitions of Runtime library functions when compiling with * * /name=(as_is) on OpenVMS * * * ***************************************************************************/ #ifndef VMS_X_FIX #define VMS_X_FIX #define decw$_select DECW$_SELECT #define DtSaverGetWindows DTSAVERGETWINDOWS #define MrmFetchWidget MRMFETCHWIDGET #define MrmInitialize MRMINITIALIZE #define MrmOpenHierarchy MRMOPENHIERARCHY #define MrmRegisterNames MRMREGISTERNAMES #define XAddExtension XADDEXTENSION #define XAddHosts XADDHOSTS #define XAllocClassHint XALLOCCLASSHINT #define XAllocColor XALLOCCOLOR #define XAllocColorCells XALLOCCOLORCELLS #define XAllocIconSize XALLOCICONSIZE #define XAllocNamedColor XALLOCNAMEDCOLOR #define XAllocSizeHints XALLOCSIZEHINTS #define XAllocStandardColormap XALLOCSTANDARDCOLORMAP #define XAllocWMHints XALLOCWMHINTS #define XAllowEvents XALLOWEVENTS #define XAutoRepeatOff XAUTOREPEATOFF #define XAutoRepeatOn XAUTOREPEATON #define XBaseFontNameListOfFontSet XBASEFONTNAMELISTOFFONTSET #define XBell XBELL #define XBitmapPad XBITMAPPAD #define XBlackPixel XBLACKPIXEL #define XBlackPixelOfScreen XBLACKPIXELOFSCREEN #define XCellsOfScreen XCELLSOFSCREEN #define XChangeActivePointerGrab XCHANGEACTIVEPOINTERGRAB #define XChangeGC XCHANGEGC #define XChangeKeyboardControl XCHANGEKEYBOARDCONTROL #define XChangePointerControl XCHANGEPOINTERCONTROL #define XChangeProperty XCHANGEPROPERTY #define XChangeWindowAttributes XCHANGEWINDOWATTRIBUTES #define XCheckIfEvent XCHECKIFEVENT #define XCheckMaskEvent XCHECKMASKEVENT #define XCheckTypedEvent XCHECKTYPEDEVENT #define XCheckTypedWindowEvent XCHECKTYPEDWINDOWEVENT #define XCheckWindowEvent XCHECKWINDOWEVENT #define XClearArea XCLEARAREA #define XClearWindow XCLEARWINDOW #define XClipBox XCLIPBOX #define XCloseDisplay XCLOSEDISPLAY #define XCloseIM XCLOSEIM #define XConfigureWindow XCONFIGUREWINDOW #define XConvertSelection XCONVERTSELECTION #define XCopyArea XCOPYAREA #define XCopyColormapAndFree XCOPYCOLORMAPANDFREE #define XCopyGC XCOPYGC #define XCopyPlane XCOPYPLANE #define XCreateBitmapFromData XCREATEBITMAPFROMDATA #define XCreateColormap XCREATECOLORMAP #define XCreateFontCursor XCREATEFONTCURSOR #define XCreateFontSet XCREATEFONTSET #define XCreateGC XCREATEGC #define XCreateGlyphCursor XCREATEGLYPHCURSOR #define XCreateIC XCREATEIC #define XCreateImage XCREATEIMAGE #define XCreatePixmap XCREATEPIXMAP #define XCreatePixmapCursor XCREATEPIXMAPCURSOR #define XCreatePixmapFromBitmapData XCREATEPIXMAPFROMBITMAPDATA #define XCreateRegion XCREATEREGION #define XCreateSimpleWindow XCREATESIMPLEWINDOW #define XCreateWindow XCREATEWINDOW #define XDefaultColormap XDEFAULTCOLORMAP #define XDefaultColormapOfScreen XDEFAULTCOLORMAPOFSCREEN #define XDefaultDepth XDEFAULTDEPTH #define XDefaultDepthOfScreen XDEFAULTDEPTHOFSCREEN #define XDefaultGC XDEFAULTGC #define XDefaultRootWindow XDEFAULTROOTWINDOW #define XDefaultScreen XDEFAULTSCREEN #define XDefaultScreenOfDisplay XDEFAULTSCREENOFDISPLAY #define XDefaultVisual XDEFAULTVISUAL #define XDefaultVisualOfScreen XDEFAULTVISUALOFSCREEN #define XDefineCursor XDEFINECURSOR #define XDeleteContext XDELETECONTEXT #define XDeleteProperty XDELETEPROPERTY #define XDestroyIC XDESTROYIC #define XDestroyRegion XDESTROYREGION #define XDestroySubwindows XDESTROYSUBWINDOWS #define XDestroyWindow XDESTROYWINDOW #define XDisableAccessControl XDISABLEACCESSCONTROL #define XDisplayCells XDISPLAYCELLS #define XDisplayHeight XDISPLAYHEIGHT #define XDisplayKeycodes XDISPLAYKEYCODES #define XDisplayName XDISPLAYNAME #define XDisplayOfIM XDISPLAYOFIM #define XDisplayOfScreen XDISPLAYOFSCREEN #define XDisplayString XDISPLAYSTRING #define XDisplayWidth XDISPLAYWIDTH #define XDoesBackingStore XDOESBACKINGSTORE #define XDrawArc XDRAWARC #define XDrawArcs XDRAWARCS #define XDrawImageString XDRAWIMAGESTRING #define XDrawImageString16 XDRAWIMAGESTRING16 #define XDrawLine XDRAWLINE #define XDrawLines XDRAWLINES #define XDrawPoint XDRAWPOINT #define XDrawPoints XDRAWPOINTS #define XDrawRectangle XDRAWRECTANGLE #define XDrawRectangles XDRAWRECTANGLES #define XDrawSegments XDRAWSEGMENTS #define XDrawString XDRAWSTRING #define XDrawString16 XDRAWSTRING16 #define XDrawText XDRAWTEXT #define XDrawText16 XDRAWTEXT16 #define XESetCloseDisplay XESETCLOSEDISPLAY #define XEmptyRegion XEMPTYREGION #define XEnableAccessControl XENABLEACCESSCONTROL #define XEqualRegion XEQUALREGION #define XEventsQueued XEVENTSQUEUED #define XExtendedMaxRequestSize XEXTENDEDMAXREQUESTSIZE #define XExtentsOfFontSet XEXTENTSOFFONTSET #define XFetchBuffer XFETCHBUFFER #define XFetchBytes XFETCHBYTES #define XFetchName XFETCHNAME #define XFillArc XFILLARC #define XFillArcs XFILLARCS #define XFillPolygon XFILLPOLYGON #define XFillRectangle XFILLRECTANGLE #define XFillRectangles XFILLRECTANGLES #define XFilterEvent XFILTEREVENT #define XFindContext XFINDCONTEXT #define XFlush XFLUSH #define XFontsOfFontSet XFONTSOFFONTSET #define XForceScreenSaver XFORCESCREENSAVER #define XFree XFREE #define XFreeColormap XFREECOLORMAP #define XFreeColors XFREECOLORS #define XFreeCursor XFREECURSOR #define XFreeDeviceList XFREEDEVICELIST #define XFreeDeviceState XFREEDEVICESTATE #define XFreeFont XFREEFONT #define XFreeFontInfo XFREEFONTINFO #define XFreeFontNames XFREEFONTNAMES #define XFreeFontSet XFREEFONTSET #define XFreeGC XFREEGC #define XFreeModifiermap XFREEMODIFIERMAP #define XFreePixmap XFREEPIXMAP #define XFreeStringList XFREESTRINGLIST #define XGContextFromGC XGCONTEXTFROMGC #define XGeometry XGEOMETRY #define XGetAtomName XGETATOMNAME #define XGetCommand XGETCOMMAND #define XGetDefault XGETDEFAULT #define XGetErrorDatabaseText XGETERRORDATABASETEXT #define XGetErrorText XGETERRORTEXT #define XGetExtensionVersion XGETEXTENSIONVERSION #define XGetFontProperty XGETFONTPROPERTY #define XGetGCValues XGETGCVALUES #define XGetGeometry XGETGEOMETRY #define XGetICValues XGETICVALUES #define XGetIMValues XGETIMVALUES #define XGetIconName XGETICONNAME #define XGetIconSizes XGETICONSIZES #define XGetImage XGETIMAGE #define XGetInputFocus XGETINPUTFOCUS #define XGetKeyboardControl XGETKEYBOARDCONTROL #define XGetKeyboardMapping XGETKEYBOARDMAPPING #define XGetModifierMapping XGETMODIFIERMAPPING #define XGetMotionEvents XGETMOTIONEVENTS #define XGetNormalHints XGETNORMALHINTS #define XGetPointerMapping XGETPOINTERMAPPING #define XGetRGBColormaps XGETRGBCOLORMAPS #define XGetScreenSaver XGETSCREENSAVER #define XGetSelectionOwner XGETSELECTIONOWNER #define XGetStandardColormap XGETSTANDARDCOLORMAP #define XGetSubImage XGETSUBIMAGE #define XGetTextProperty XGETTEXTPROPERTY #define XGetVisualInfo XGETVISUALINFO #define XGetWMColormapWindows XGETWMCOLORMAPWINDOWS #define XGetWMHints XGETWMHINTS #define XGetWMIconName XGETWMICONNAME #define XGetWMName XGETWMNAME #define XGetWMNormalHints XGETWMNORMALHINTS #define XGetWindowAttributes XGETWINDOWATTRIBUTES #define XGetWindowProperty XGETWINDOWPROPERTY #define XGrabButton XGRABBUTTON #define XGrabKeyboard XGRABKEYBOARD #define XGrabPointer XGRABPOINTER #define XGrabServer XGRABSERVER #define XHeightMMOfScreen XHEIGHTMMOFSCREEN #define XHeightOfScreen XHEIGHTOFSCREEN #define XIconifyWindow XICONIFYWINDOW #define XIfEvent XIFEVENT #define XInitExtension XINITEXTENSION #define XInitImage XINITIMAGE #define XInstallColormap XINSTALLCOLORMAP #define XInternAtom XINTERNATOM #define XInternAtoms XINTERNATOMS #define XIntersectRegion XINTERSECTREGION #define XKeycodeToKeysym XKEYCODETOKEYSYM #define XKeysymToKeycode XKEYSYMTOKEYCODE #define XKeysymToString XKEYSYMTOSTRING #define XKillClient XKILLCLIENT #define XListDepths XLISTDEPTHS #define XListFonts XLISTFONTS #define XListFontsWithInfo XLISTFONTSWITHINFO #define XListHosts XLISTHOSTS #define XListInputDevices XLISTINPUTDEVICES #define XListInstalledColormaps XLISTINSTALLEDCOLORMAPS #define XListPixmapFormats XLISTPIXMAPFORMATS #define XListProperties XLISTPROPERTIES #define XLoadFont XLOADFONT #define XLoadQueryFont XLOADQUERYFONT #define XLookupColor XLOOKUPCOLOR #define XLookupKeysym XLOOKUPKEYSYM #define XLookupString XLOOKUPSTRING #define XLowerWindow XLOWERWINDOW #define XMapRaised XMAPRAISED #define XMapSubwindows XMAPSUBWINDOWS #define XMapWindow XMAPWINDOW #define XMatchVisualInfo XMATCHVISUALINFO #define XMaxRequestSize XMAXREQUESTSIZE #define XMissingExtension XMISSINGEXTENSION #define XMoveResizeWindow XMOVERESIZEWINDOW #define XMoveWindow XMOVEWINDOW #define XNextEvent XNEXTEVENT #define XNextRequest XNEXTREQUEST #define XNoOp XNOOP #define XOffsetRegion XOFFSETREGION #define XOpenDevice XOPENDEVICE #define XOpenDisplay XOPENDISPLAY #define XOpenIM XOPENIM #define XParseColor XPARSECOLOR #define XParseGeometry XPARSEGEOMETRY #define XPeekEvent XPEEKEVENT #define XPeekIfEvent XPEEKIFEVENT #define XPending XPENDING #define XPointInRegion XPOINTINREGION #define XPolygonRegion XPOLYGONREGION #define XPutBackEvent XPUTBACKEVENT #define XPutImage XPUTIMAGE #define XQLength XQLENGTH #define XQueryBestCursor XQUERYBESTCURSOR #define XQueryBestStipple XQUERYBESTSTIPPLE #define XQueryColor XQUERYCOLOR #define XQueryColors XQUERYCOLORS #define XQueryDeviceState XQUERYDEVICESTATE #define XQueryExtension XQUERYEXTENSION #define XQueryFont XQUERYFONT #define XQueryKeymap XQUERYKEYMAP #define XQueryPointer XQUERYPOINTER #define XQueryTree XQUERYTREE #define XRaiseWindow XRAISEWINDOW #define XReadBitmapFile XREADBITMAPFILE #define XRecolorCursor XRECOLORCURSOR #define XReconfigureWMWindow XRECONFIGUREWMWINDOW #define XRectInRegion XRECTINREGION #define XRefreshKeyboardMapping XREFRESHKEYBOARDMAPPING #define XRemoveHosts XREMOVEHOSTS #define XReparentWindow XREPARENTWINDOW #define XResetScreenSaver XRESETSCREENSAVER #define XResizeWindow XRESIZEWINDOW #define XResourceManagerString XRESOURCEMANAGERSTRING #define XRestackWindows XRESTACKWINDOWS #define XRotateBuffers XROTATEBUFFERS #define XRootWindow XROOTWINDOW #define XRootWindowOfScreen XROOTWINDOWOFSCREEN #define XSaveContext XSAVECONTEXT #define XScreenNumberOfScreen XSCREENNUMBEROFSCREEN #define XScreenOfDisplay XSCREENOFDISPLAY #define XSelectAsyncEvent XSELECTASYNCEVENT #define XSelectAsyncInput XSELECTASYNCINPUT #define XSelectExtensionEvent XSELECTEXTENSIONEVENT #define XSelectInput XSELECTINPUT #define XSendEvent XSENDEVENT #define XServerVendor XSERVERVENDOR #define XSetArcMode XSETARCMODE #define XSetBackground XSETBACKGROUND #define XSetClassHint XSETCLASSHINT #define XSetClipMask XSETCLIPMASK #define XSetClipOrigin XSETCLIPORIGIN #define XSetClipRectangles XSETCLIPRECTANGLES #define XSetCloseDownMode XSETCLOSEDOWNMODE #define XSetCommand XSETCOMMAND #define XSetDashes XSETDASHES #define XSetErrorHandler XSETERRORHANDLER #define XSetFillRule XSETFILLRULE #define XSetFillStyle XSETFILLSTYLE #define XSetFont XSETFONT #define XSetForeground XSETFOREGROUND #define XSetFunction XSETFUNCTION #define XSetGraphicsExposures XSETGRAPHICSEXPOSURES #define XSetICFocus XSETICFOCUS #define XSetICValues XSETICVALUES #define XSetIOErrorHandler XSETIOERRORHANDLER #define XSetIconName XSETICONNAME #define XSetInputFocus XSETINPUTFOCUS #define XSetLineAttributes XSETLINEATTRIBUTES #define XSetLocaleModifiers XSETLOCALEMODIFIERS #define XSetNormalHints XSETNORMALHINTS #define XSetPlaneMask XSETPLANEMASK #define XSetRegion XSETREGION #define XSetRGBColormaps XSETRGBCOLORMAPS #define XSetScreenSaver XSETSCREENSAVER #define XSetSelectionOwner XSETSELECTIONOWNER #define XSetStandardProperties XSETSTANDARDPROPERTIES #define XSetState XSETSTATE #define XSetStipple XSETSTIPPLE #define XSetSubwindowMode XSETSUBWINDOWMODE #define XSetTSOrigin XSETTSORIGIN #define XSetTextProperty XSETTEXTPROPERTY #define XSetTile XSETTILE #define XSetTransientForHint XSETTRANSIENTFORHINT #define XSetWMClientMachine XSETWMCLIENTMACHINE #define XSetWMColormapWindows XSETWMCOLORMAPWINDOWS #define XSetWMHints XSETWMHINTS #define XSetWMIconName XSETWMICONNAME #define XSetWMName XSETWMNAME #define XSetWMNormalHints XSETWMNORMALHINTS #define XSetWMProperties XSETWMPROPERTIES #define XSetWMProtocols XSETWMPROTOCOLS #define XSetWMSizeHints XSETWMSIZEHINTS #define XSetWindowBackground XSETWINDOWBACKGROUND #define XSetWindowBackgroundPixmap XSETWINDOWBACKGROUNDPIXMAP #define XSetWindowBorder XSETWINDOWBORDER #define XSetWindowBorderPixmap XSETWINDOWBORDERPIXMAP #define XSetWindowBorderWidth XSETWINDOWBORDERWIDTH #define XSetWindowColormap XSETWINDOWCOLORMAP #define XShapeCombineMask XSHAPECOMBINEMASK #define XShapeCombineRectangles XSHAPECOMBINERECTANGLES #define XShapeGetRectangles XSHAPEGETRECTANGLES #define XShapeQueryExtension XSHAPEQUERYEXTENSION #define XShmAttach XSHMATTACH #define XShmCreateImage XSHMCREATEIMAGE #define XShmCreatePixmap XSHMCREATEPIXMAP #define XShmDetach XSHMDETACH #define XShmGetEventBase XSHMGETEVENTBASE #define XShmPutImage XSHMPUTIMAGE #define XShmQueryExtension XSHMQUERYEXTENSION #define XShmQueryVersion XSHMQUERYVERSION #define XShrinkRegion XSHRINKREGION #define XStoreBuffer XSTOREBUFFER #define XStoreBytes XSTOREBYTES #define XStoreColor XSTORECOLOR #define XStoreColors XSTORECOLORS #define XStoreName XSTORENAME #define XStringListToTextProperty XSTRINGLISTTOTEXTPROPERTY #define XStringToKeysym XSTRINGTOKEYSYM #define XSubtractRegion XSUBTRACTREGION #define XSupportsLocale XSUPPORTSLOCALE #define XSync XSYNC #define XSynchronize XSYNCHRONIZE #define XTextExtents XTEXTEXTENTS #define XTextExtents16 XTEXTEXTENTS16 #define XTextPropertyToStringList XTEXTPROPERTYTOSTRINGLIST #define XTextWidth XTEXTWIDTH #define XTextWidth16 XTEXTWIDTH16 #define XTranslateCoordinates XTRANSLATECOORDINATES #define XUndefineCursor XUNDEFINECURSOR #define XUngrabButton XUNGRABBUTTON #define XUngrabKeyboard XUNGRABKEYBOARD #define XUngrabPointer XUNGRABPOINTER #define XUngrabServer XUNGRABSERVER #define XUninstallColormap XUNINSTALLCOLORMAP #define XUnionRectWithRegion XUNIONRECTWITHREGION #define XUnionRegion XUNIONREGION #define XUniqueContext XUNIQUECONTEXT #define XUnmapWindow XUNMAPWINDOW #define XUnsetICFocus XUNSETICFOCUS #define XVaCreateNestedList XVACREATENESTEDLIST #define XVisualIDFromVisual XVISUALIDFROMVISUAL #define XWMGeometry XWMGEOMETRY #define XWarpPointer XWARPPOINTER #define XWhitePixel XWHITEPIXEL #define XWhitePixelOfScreen XWHITEPIXELOFSCREEN #define XWidthMMOfScreen XWIDTHMMOFSCREEN #define XWidthOfScreen XWIDTHOFSCREEN #define XWindowEvent XWINDOWEVENT #define XWithdrawWindow XWITHDRAWWINDOW #define XXorRegion XXORREGION #define XcmsQueryColor XCMSQUERYCOLOR #define XdbeAllocateBackBufferName XDBEALLOCATEBACKBUFFERNAME #define XdbeFreeVisualInfo XDBEFREEVISUALINFO #define XdbeGetVisualInfo XDBEGETVISUALINFO #define XdbeQueryExtension XDBEQUERYEXTENSION #define XdbeSwapBuffers XDBESWAPBUFFERS #define XextAddDisplay XEXTADDDISPLAY #define XextFindDisplay XEXTFINDDISPLAY #define XextRemoveDisplay XEXTREMOVEDISPLAY #define XkbSetDetectableAutoRepeat XKBSETDETECTABLEAUTOREPEAT #define XmActivateProtocol XMACTIVATEPROTOCOL #define XmAddProtocolCallback XMADDPROTOCOLCALLBACK #define XmAddProtocols XMADDPROTOCOLS #define XmChangeColor XMCHANGECOLOR #define XmClipboardCopy XMCLIPBOARDCOPY #define XmClipboardCopyByName XMCLIPBOARDCOPYBYNAME #define XmClipboardEndCopy XMCLIPBOARDENDCOPY #define XmClipboardEndRetrieve XMCLIPBOARDENDRETRIEVE #define XmClipboardInquireCount XMCLIPBOARDINQUIRECOUNT #define XmClipboardInquireFormat XMCLIPBOARDINQUIREFORMAT #define XmClipboardInquireLength XMCLIPBOARDINQUIRELENGTH #define XmClipboardLock XMCLIPBOARDLOCK #define XmClipboardRetrieve XMCLIPBOARDRETRIEVE #define XmClipboardStartCopy XMCLIPBOARDSTARTCOPY #define XmClipboardStartRetrieve XMCLIPBOARDSTARTRETRIEVE #define XmClipboardUnlock XMCLIPBOARDUNLOCK #define XmCommandError XMCOMMANDERROR #define XmCommandGetChild XMCOMMANDGETCHILD #define XmCommandSetValue XMCOMMANDSETVALUE #define XmCreateArrowButton XMCREATEARROWBUTTON #define XmCreateArrowButtonGadget XMCREATEARROWBUTTONGADGET #define XmCreateBulletinBoardDialog XMCREATEBULLETINBOARDDIALOG #define XmCreateCascadeButton XMCREATECASCADEBUTTON #define XmCreateCascadeButtonGadget XMCREATECASCADEBUTTONGADGET #define XmCreateDialogShell XMCREATEDIALOGSHELL #define XmCreateDragIcon XMCREATEDRAGICON #define XmCreateDrawingArea XMCREATEDRAWINGAREA #define XmCreateDrawnButton XMCREATEDRAWNBUTTON #define XmCreateErrorDialog XMCREATEERRORDIALOG #define XmCreateFileSelectionBox XMCREATEFILESELECTIONBOX #define XmCreateFileSelectionDialog XMCREATEFILESELECTIONDIALOG #define XmCreateForm XMCREATEFORM #define XmCreateFormDialog XMCREATEFORMDIALOG #define XmCreateFrame XMCREATEFRAME #define XmCreateInformationDialog XMCREATEINFORMATIONDIALOG #define XmCreateLabel XMCREATELABEL #define XmCreateLabelGadget XMCREATELABELGADGET #define XmCreateList XMCREATELIST #define XmCreateMainWindow XMCREATEMAINWINDOW #define XmCreateMenuBar XMCREATEMENUBAR #define XmCreateMessageBox XMCREATEMESSAGEBOX #define XmCreateMessageDialog XMCREATEMESSAGEDIALOG #define XmCreateOptionMenu XMCREATEOPTIONMENU #define XmCreatePanedWindow XMCREATEPANEDWINDOW #define XmCreatePopupMenu XMCREATEPOPUPMENU #define XmCreatePromptDialog XMCREATEPROMPTDIALOG #define XmCreatePulldownMenu XMCREATEPULLDOWNMENU #define XmCreatePushButton XMCREATEPUSHBUTTON #define XmCreatePushButtonGadget XMCREATEPUSHBUTTONGADGET #define XmCreateQuestionDialog XMCREATEQUESTIONDIALOG #define XmCreateRadioBox XMCREATERADIOBOX #define XmCreateRowColumn XMCREATEROWCOLUMN #define XmCreateScale XMCREATESCALE #define XmCreateScrollBar XMCREATESCROLLBAR #define XmCreateScrolledList XMCREATESCROLLEDLIST #define XmCreateScrolledText XMCREATESCROLLEDTEXT #define XmCreateScrolledWindow XMCREATESCROLLEDWINDOW #define XmCreateSelectionDialog XMCREATESELECTIONDIALOG #define XmCreateSeparator XMCREATESEPARATOR #define XmCreateSeparatorGadget XMCREATESEPARATORGADGET #define XmCreateTemplateDialog XMCREATETEMPLATEDIALOG #define XmCreateText XMCREATETEXT #define XmCreateTextField XMCREATETEXTFIELD #define XmCreateToggleButton XMCREATETOGGLEBUTTON #define XmCreateToggleButtonGadget XMCREATETOGGLEBUTTONGADGET #define XmCreateWarningDialog XMCREATEWARNINGDIALOG #define XmCvtCTToXmString XMCVTCTTOXMSTRING #define XmDestroyPixmap XMDESTROYPIXMAP #define XmDragStart XMDRAGSTART #define XmDropSiteRegister XMDROPSITEREGISTER #define XmDropSiteUnregister XMDROPSITEUNREGISTER #define XmDropSiteUpdate XMDROPSITEUPDATE #define XmDropTransferStart XMDROPTRANSFERSTART #define XmFileSelectionBoxGetChild XMFILESELECTIONBOXGETCHILD #define XmFileSelectionDoSearch XMFILESELECTIONDOSEARCH #define XmFontListAppendEntry XMFONTLISTAPPENDENTRY #define XmFontListCopy XMFONTLISTCOPY #define XmFontListCreate XMFONTLISTCREATE #define XmFontListEntryCreate XMFONTLISTENTRYCREATE #define XmFontListEntryFree XMFONTLISTENTRYFREE #define XmFontListEntryGetFont XMFONTLISTENTRYGETFONT #define XmFontListEntryGetTag XMFONTLISTENTRYGETTAG #define XmFontListEntryLoad XMFONTLISTENTRYLOAD #define XmFontListFree XMFONTLISTFREE #define XmFontListFreeFontContext XMFONTLISTFREEFONTCONTEXT #define XmFontListGetNextFont XMFONTLISTGETNEXTFONT #define XmFontListInitFontContext XMFONTLISTINITFONTCONTEXT #define XmFontListNextEntry XMFONTLISTNEXTENTRY #define XmGetColors XMGETCOLORS #define XmGetColorCalculation XMGETCOLORCALCULATION #define XmGetFocusWidget XMGETFOCUSWIDGET #define XmGetMenuCursor XMGETMENUCURSOR #define XmGetPixmap XMGETPIXMAP #define XmGetPixmapByDepth XMGETPIXMAPBYDEPTH #define XmGetTearOffControl XMGETTEAROFFCONTROL #define XmGetXmDisplay XMGETXMDISPLAY #define XmImMbLookupString XMIMMBLOOKUPSTRING #define XmImRegister XMIMREGISTER #define XmImSetFocusValues XMIMSETFOCUSVALUES #define XmImSetValues XMIMSETVALUES #define XmImUnregister XMIMUNREGISTER #define XmImUnsetFocus XMIMUNSETFOCUS #define XmInstallImage XMINSTALLIMAGE #define XmInternAtom XMINTERNATOM #define XmIsMotifWMRunning XMISMOTIFWMRUNNING #define XmListAddItem XMLISTADDITEM #define XmListAddItemUnselected XMLISTADDITEMUNSELECTED #define XmListAddItems XMLISTADDITEMS #define XmListAddItemsUnselected XMLISTADDITEMSUNSELECTED #define XmListDeleteAllItems XMLISTDELETEALLITEMS #define XmListDeleteItem XMLISTDELETEITEM #define XmListDeleteItemsPos XMLISTDELETEITEMSPOS #define XmListDeletePos XMLISTDELETEPOS #define XmListDeselectAllItems XMLISTDESELECTALLITEMS #define XmListDeselectPos XMLISTDESELECTPOS #define XmListGetKbdItemPos XMLISTGETKBDITEMPOS #define XmListGetMatchPos XMLISTGETMATCHPOS #define XmListGetSelectedPos XMLISTGETSELECTEDPOS #define XmListItemExists XMLISTITEMEXISTS #define XmListItemPos XMLISTITEMPOS #define XmListPosSelected XMLISTPOSSELECTED #define XmListReplaceItems XMLISTREPLACEITEMS #define XmListReplaceItemsPos XMLISTREPLACEITEMSPOS #define XmListSelectItem XMLISTSELECTITEM #define XmListSelectPos XMLISTSELECTPOS #define XmListSetBottomPos XMLISTSETBOTTOMPOS #define XmListSetItem XMLISTSETITEM #define XmListSetKbdItemPos XMLISTSETKBDITEMPOS #define XmListSetPos XMLISTSETPOS #define XmMainWindowSetAreas XMMAINWINDOWSETAREAS #define XmMenuPosition XMMENUPOSITION #define XmMessageBoxGetChild XMMESSAGEBOXGETCHILD #define XmOptionButtonGadget XMOPTIONBUTTONGADGET #define XmOptionLabelGadget XMOPTIONLABELGADGET #define XmProcessTraversal XMPROCESSTRAVERSAL #define XmQmotif XMQMOTIF #define XmRemoveProtocolCallback XMREMOVEPROTOCOLCALLBACK #define XmRemoveProtocols XMREMOVEPROTOCOLS #define XmRemoveTabGroup XMREMOVETABGROUP #define XmRepTypeGetId XMREPTYPEGETID #define XmRepTypeGetRecord XMREPTYPEGETRECORD #define XmRepTypeInstallTearOffModelCon XMREPTYPEINSTALLTEAROFFMODELCON #define XmRepTypeRegister XMREPTYPEREGISTER #define XmRepTypeValidValue XMREPTYPEVALIDVALUE #define XmScrollBarGetValues XMSCROLLBARGETVALUES #define XmScrollBarSetValues XMSCROLLBARSETVALUES #define XmScrolledWindowSetAreas XMSCROLLEDWINDOWSETAREAS #define XmSelectionBoxGetChild XMSELECTIONBOXGETCHILD #define XmSetColorCalculation XMSETCOLORCALCULATION #define XmStringByteCompare XMSTRINGBYTECOMPARE #define XmStringCompare XMSTRINGCOMPARE #define XmStringConcat XMSTRINGCONCAT #define XmStringCopy XMSTRINGCOPY #define XmStringCreate XMSTRINGCREATE #define XmStringCreateLocalized XMSTRINGCREATELOCALIZED #define XmStringCreateLtoR XMSTRINGCREATELTOR #define XmStringCreateSimple XMSTRINGCREATESIMPLE #define XmStringDraw XMSTRINGDRAW #define XmStringDrawUnderline XMSTRINGDRAWUNDERLINE #define XmStringExtent XMSTRINGEXTENT #define XmStringFree XMSTRINGFREE #define XmStringFreeContext XMSTRINGFREECONTEXT #define XmStringGetLtoR XMSTRINGGETLTOR #define XmStringGetNextComponent XMSTRINGGETNEXTCOMPONENT #define XmStringGetNextSegment XMSTRINGGETNEXTSEGMENT #define XmStringInitContext XMSTRINGINITCONTEXT #define XmStringLength XMSTRINGLENGTH #define XmStringLtoRCreate XMSTRINGLTORCREATE #define XmStringNConcat XMSTRINGNCONCAT #define XmStringSegmentCreate XMSTRINGSEGMENTCREATE #define XmStringSeparatorCreate XMSTRINGSEPARATORCREATE #define XmStringWidth XMSTRINGWIDTH #define XmTextClearSelection XMTEXTCLEARSELECTION #define XmTextCopy XMTEXTCOPY #define XmTextCut XMTEXTCUT #define XmTextFieldClearSelection XMTEXTFIELDCLEARSELECTION #define XmTextFieldCopy XMTEXTFIELDCOPY #define XmTextFieldCut XMTEXTFIELDCUT #define XmTextFieldGetEditable XMTEXTFIELDGETEDITABLE #define XmTextFieldGetInsertionPosition XMTEXTFIELDGETINSERTIONPOSITION #define XmTextFieldGetLastPosition XMTEXTFIELDGETLASTPOSITION #define XmTextFieldGetMaxLength XMTEXTFIELDGETMAXLENGTH #define XmTextFieldGetSelection XMTEXTFIELDGETSELECTION #define XmTextFieldGetSelectionPosition XMTEXTFIELDGETSELECTIONPOSITION #define XmTextFieldGetString XMTEXTFIELDGETSTRING #define XmTextFieldInsert XMTEXTFIELDINSERT #define XmTextFieldPaste XMTEXTFIELDPASTE #define XmTextFieldRemove XMTEXTFIELDREMOVE #define XmTextFieldReplace XMTEXTFIELDREPLACE #define XmTextFieldSetAddMode XMTEXTFIELDSETADDMODE #define XmTextFieldSetHighlight XMTEXTFIELDSETHIGHLIGHT #define XmTextFieldSetInsertionPosition XMTEXTFIELDSETINSERTIONPOSITION #define XmTextFieldSetMaxLength XMTEXTFIELDSETMAXLENGTH #define XmTextFieldSetSelection XMTEXTFIELDSETSELECTION #define XmTextFieldSetString XMTEXTFIELDSETSTRING #define XmTextFieldShowPosition XMTEXTFIELDSHOWPOSITION #define XmTextGetCursorPosition XMTEXTGETCURSORPOSITION #define XmTextGetEditable XMTEXTGETEDITABLE #define XmTextGetInsertionPosition XMTEXTGETINSERTIONPOSITION #define XmTextGetLastPosition XMTEXTGETLASTPOSITION #define XmTextGetMaxLength XMTEXTGETMAXLENGTH #define XmTextGetSelection XMTEXTGETSELECTION #define XmTextGetSelectionPosition XMTEXTGETSELECTIONPOSITION #define XmTextGetString XMTEXTGETSTRING #define XmTextInsert XMTEXTINSERT #define XmTextPaste XMTEXTPASTE #define XmTextPosToXY XMTEXTPOSTOXY #define XmTextRemove XMTEXTREMOVE #define XmTextReplace XMTEXTREPLACE #define XmTextSetCursorPosition XMTEXTSETCURSORPOSITION #define XmTextSetEditable XMTEXTSETEDITABLE #define XmTextSetHighlight XMTEXTSETHIGHLIGHT #define XmTextSetInsertionPosition XMTEXTSETINSERTIONPOSITION #define XmTextSetSelection XMTEXTSETSELECTION #define XmTextSetString XMTEXTSETSTRING #define XmTextSetTopCharacter XMTEXTSETTOPCHARACTER #define XmTextShowPosition XMTEXTSHOWPOSITION #define XmToggleButtonGadgetGetState XMTOGGLEBUTTONGADGETGETSTATE #define XmToggleButtonGadgetSetState XMTOGGLEBUTTONGADGETSETSTATE #define XmToggleButtonGetState XMTOGGLEBUTTONGETSTATE #define XmToggleButtonSetState XMTOGGLEBUTTONSETSTATE #define XmUninstallImage XMUNINSTALLIMAGE #define XmUpdateDisplay XMUPDATEDISPLAY #define XmVaCreateSimpleRadioBox XMVACREATESIMPLERADIOBOX #define XmbDrawString XMBDRAWSTRING #define XmbLookupString XMBLOOKUPSTRING #define XmbResetIC XMBRESETIC #define XmbSetWMProperties XMBSETWMPROPERTIES #define XmbTextEscapement XMBTEXTESCAPEMENT #define XmbTextExtents XMBTEXTEXTENTS #define XmbTextListToTextProperty XMBTEXTLISTTOTEXTPROPERTY #define XmbTextPropertyToTextList XMBTEXTPROPERTYTOTEXTLIST #define XmbufCreateBuffers XMBUFCREATEBUFFERS #define XmbufDestroyBuffers XMBUFDESTROYBUFFERS #define XmbufDisplayBuffers XMBUFDISPLAYBUFFERS #define XmbufQueryExtension XMBUFQUERYEXTENSION #define Xmemory_free XMEMORY_FREE #define Xmemory_malloc XMEMORY_MALLOC #define XmuClientWindow XMUCLIENTWINDOW #define XmuConvertStandardSelection XMUCONVERTSTANDARDSELECTION #define XmuCvtStringToBitmap XMUCVTSTRINGTOBITMAP #define XmuInternAtom XMUINTERNATOM #define XmuInternStrings XMUINTERNSTRINGS #define XmuLookupStandardColormap XMULOOKUPSTANDARDCOLORMAP #define XmuPrintDefaultErrorMessage XMUPRINTDEFAULTERRORMESSAGE #define XrmCombineDatabase XRMCOMBINEDATABASE #define XrmCombineFileDatabase XRMCOMBINEFILEDATABASE #define XrmDestroyDatabase XRMDESTROYDATABASE #define XrmGetDatabase XRMGETDATABASE #define XrmGetFileDatabase XRMGETFILEDATABASE #define XrmGetResource XRMGETRESOURCE #define XrmGetStringDatabase XRMGETSTRINGDATABASE #define XrmInitialize XRMINITIALIZE #define XrmMergeDatabases XRMMERGEDATABASES #define XrmParseCommand XRMPARSECOMMAND #define XrmPermStringToQuark XRMPERMSTRINGTOQUARK #define XrmPutFileDatabase XRMPUTFILEDATABASE #define XrmPutLineResource XRMPUTLINERESOURCE #define XrmPutStringResource XRMPUTSTRINGRESOURCE #define XrmQGetResource XRMQGETRESOURCE #define XrmQPutStringResource XRMQPUTSTRINGRESOURCE #define XrmQuarkToString XRMQUARKTOSTRING #define XrmSetDatabase XRMSETDATABASE #define XrmStringToBindingQuarkList XRMSTRINGTOBINDINGQUARKLIST #define XrmStringToQuark XRMSTRINGTOQUARK #define XtAddCallback XTADDCALLBACK #define XtAddCallbacks XTADDCALLBACKS #define XtAddConverter XTADDCONVERTER #define XtAddEventHandler XTADDEVENTHANDLER #define XtAddExposureToRegion XTADDEXPOSURETOREGION #define XtAddGrab XTADDGRAB #define XtAddRawEventHandler XTADDRAWEVENTHANDLER #define XtAllocateGC XTALLOCATEGC #define XtAppAddActions XTAPPADDACTIONS #define XtAppAddInput XTAPPADDINPUT #define XtAppAddTimeOut XTAPPADDTIMEOUT #define XtAppAddWorkProc XTAPPADDWORKPROC #define XtAppCreateShell XTAPPCREATESHELL #define XtAppError XTAPPERROR #define XtAppErrorMsg XTAPPERRORMSG #define XtAppInitialize XTAPPINITIALIZE #define XtAppMainLoop XTAPPMAINLOOP #define XtAppNextEvent XTAPPNEXTEVENT #define XtAppPeekEvent XTAPPPEEKEVENT #define XtAppPending XTAPPPENDING #define XtAppProcessEvent XTAPPPROCESSEVENT #define XtAppSetErrorHandler XTAPPSETERRORHANDLER #define XtAppSetFallbackResources XTAPPSETFALLBACKRESOURCES #define XtAppSetTypeConverter XTAPPSETTYPECONVERTER #define XtAppSetWarningHandler XTAPPSETWARNINGHANDLER #define XtAppWarningMsg XTAPPWARNINGMSG #define XtAppSetWarningMsgHandler XTAPPSETWARNINGMSGHANDLER #define XtAppWarning XTAPPWARNING #define XtAugmentTranslations XTAUGMENTTRANSLATIONS #define XtCallActionProc XTCALLACTIONPROC #define XtCallCallbackList XTCALLCALLBACKLIST #define XtCallCallbacks XTCALLCALLBACKS #define XtCallConverter XTCALLCONVERTER #define XtCalloc XTCALLOC #ifndef NOXTDISPLAY #define XtClass XTCLASS #endif #define XtCloseDisplay XTCLOSEDISPLAY #define XtConfigureWidget XTCONFIGUREWIDGET #define XtConvert XTCONVERT #define XtConvertAndStore XTCONVERTANDSTORE #define XtCreateApplicationContext XTCREATEAPPLICATIONCONTEXT #define XtCreateManagedWidget XTCREATEMANAGEDWIDGET #define XtCreatePopupShell XTCREATEPOPUPSHELL #define XtCreateWidget XTCREATEWIDGET #define XtCreateWindow XTCREATEWINDOW #define XtCvtStringToFont XTCVTSTRINGTOFONT #define XtDatabase XTDATABASE #define XtDestroyApplicationContext XTDESTROYAPPLICATIONCONTEXT #define XtDestroyWidget XTDESTROYWIDGET #define XtDisownSelection XTDISOWNSELECTION #define XtDispatchEvent XTDISPATCHEVENT #ifndef NOXTDISPLAY #define XtDisplay XTDISPLAY #endif #define XtDisplayOfObject XTDISPLAYOFOBJECT #define XtDisplayStringConvWarning XTDISPLAYSTRINGCONVWARNING #define XtDisplayToApplicationContext XTDISPLAYTOAPPLICATIONCONTEXT #define XtError XTERROR #define XtErrorMsg XTERRORMSG #define XtFree XTFREE #define XtGetActionKeysym XTGETACTIONKEYSYM #define XtGetActionList XTGETACTIONLIST #define XtGetApplicationNameAndClass XTGETAPPLICATIONNAMEANDCLASS #define XtGetApplicationResources XTGETAPPLICATIONRESOURCES #define XtGetClassExtension XTGETCLASSEXTENSION #define XtGetConstraintResourceList XTGETCONSTRAINTRESOURCELIST #define XtGetGC XTGETGC #define XtGetMultiClickTime XTGETMULTICLICKTIME #define XtGetResourceList XTGETRESOURCELIST #define XtGetSelectionValue XTGETSELECTIONVALUE #define XtGetSelectionValues XTGETSELECTIONVALUES #define XtGetSubresources XTGETSUBRESOURCES #define XtGetValues XTGETVALUES #define XtGrabButton XTGRABBUTTON #define XtGrabKeyboard XTGRABKEYBOARD #define XtGrabPointer XTGRABPOINTER #define XtHasCallbacks XTHASCALLBACKS #define XtInitialize XTINITIALIZE #define XtInitializeWidgetClass XTINITIALIZEWIDGETCLASS #define XtInsertEventHandler XTINSERTEVENTHANDLER #define XtInsertRawEventHandler XTINSERTRAWEVENTHANDLER #define XtInstallAccelerators XTINSTALLACCELERATORS #define XtIsManaged XTISMANAGED #define XtIsObject XTISOBJECT #ifndef NOXTDISPLAY #define XtIsRealized XTISREALIZED #endif #define XtIsSensitive XTISSENSITIVE #define XtIsSubclass XTISSUBCLASS #define XtLastTimestampProcessed XTLASTTIMESTAMPPROCESSED #define XtMainLoop XTMAINLOOP #define XtMakeGeometryRequest XTMAKEGEOMETRYREQUEST #define XtMakeResizeRequest XTMAKERESIZEREQUEST #define XtMalloc XTMALLOC #define XtManageChild XTMANAGECHILD #define XtManageChildren XTMANAGECHILDREN #define XtMergeArgLists XTMERGEARGLISTS #define XtMoveWidget XTMOVEWIDGET #define XtName XTNAME #define XtNameToWidget XTNAMETOWIDGET #define XtOpenApplication XTOPENAPPLICATION #define XtOpenDisplay XTOPENDISPLAY #define XtOverrideTranslations XTOVERRIDETRANSLATIONS #define XtOwnSelection XTOWNSELECTION #ifndef NOXTDISPLAY #define XtParent XTPARENT #endif #define XtParseAcceleratorTable XTPARSEACCELERATORTABLE #define XtParseTranslationTable XTPARSETRANSLATIONTABLE #define XtPopdown XTPOPDOWN #define XtPopup XTPOPUP #define XtPopupSpringLoaded XTPOPUPSPRINGLOADED #define XtQueryGeometry XTQUERYGEOMETRY #define XtRealizeWidget XTREALIZEWIDGET #define XtRealloc XTREALLOC #define XtRegisterDrawable _XTREGISTERWINDOW #define XtRegisterGrabAction XTREGISTERGRABACTION #define XtReleaseGC XTRELEASEGC #define XtRemoveAllCallbacks XTREMOVEALLCALLBACKS #define XtRemoveCallback XTREMOVECALLBACK #define XtRemoveEventHandler XTREMOVEEVENTHANDLER #define XtRemoveGrab XTREMOVEGRAB #define XtRemoveInput XTREMOVEINPUT #define XtRemoveTimeOut XTREMOVETIMEOUT #define XtRemoveWorkProc XTREMOVEWORKPROC #define XtResizeWidget XTRESIZEWIDGET #define XtResolvePathname XTRESOLVEPATHNAME #ifndef NOXTDISPLAY #define XtScreen XTSCREEN #endif #define XtScreenDatabase XTSCREENDATABASE #define XtScreenOfObject XTSCREENOFOBJECT #define XtSessionReturnToken XTSESSIONRETURNTOKEN #define XtSetErrorHandler XTSETERRORHANDLER #define XtSetKeyboardFocus XTSETKEYBOARDFOCUS #define XtSetLanguageProc XTSETLANGUAGEPROC #define XtSetMappedWhenManaged XTSETMAPPEDWHENMANAGED #define XtSetSensitive XTSETSENSITIVE #define XtSetTypeConverter XTSETTYPECONVERTER #define XtSetValues XTSETVALUES #define XtShellStrings XTSHELLSTRINGS #define XtStringConversionWarning XTSTRINGCONVERSIONWARNING #define XtStrings XTSTRINGS #define XtToolkitInitialize XTTOOLKITINITIALIZE #define XtTranslateCoords XTTRANSLATECOORDS #define XtTranslateKeycode XTTRANSLATEKEYCODE #define XtUngrabButton XTUNGRABBUTTON #define XtUngrabKeyboard XTUNGRABKEYBOARD #define XtUngrabPointer XTUNGRABPOINTER #define XtUnmanageChild XTUNMANAGECHILD #define XtUnmanageChildren XTUNMANAGECHILDREN #define XtUnrealizeWidget XTUNREALIZEWIDGET #define XtUnregisterDrawable _XTUNREGISTERWINDOW #define XtVaCreateManagedWidget XTVACREATEMANAGEDWIDGET #define XtVaCreatePopupShell XTVACREATEPOPUPSHELL #define XtVaCreateWidget XTVACREATEWIDGET #define XtVaGetApplicationResources XTVAGETAPPLICATIONRESOURCES #define XtVaGetValues XTVAGETVALUES #define XtVaSetValues XTVASETVALUES #define XtWarning XTWARNING #define XtWarningMsg XTWARNINGMSG #define XtWidgetToApplicationContext XTWIDGETTOAPPLICATIONCONTEXT #ifndef NOXTDISPLAY #define XtWindow XTWINDOW #endif #define XtWindowOfObject XTWINDOWOFOBJECT #define XtWindowToWidget XTWINDOWTOWIDGET #define XwcDrawImageString XWCDRAWIMAGESTRING #define XwcDrawString XWCDRAWSTRING #define XwcFreeStringList XWCFREESTRINGLIST #define XwcTextEscapement XWCTEXTESCAPEMENT #define XwcTextExtents XWCTEXTEXTENTS #define XwcTextListToTextProperty XWCTEXTLISTTOTEXTPROPERTY #define XwcLookupString XWCLOOKUPSTRING #define XwcTextPropertyToTextList XWCTEXTPROPERTYTOTEXTLIST #define _XAllocTemp _XALLOCTEMP #define _XDeqAsyncHandler _XDEQASYNCHANDLER #define _XEatData _XEATDATA #define _XFlush _XFLUSH #define _XFreeTemp _XFREETEMP #define _XGetAsyncReply _XGETASYNCREPLY #define _XInitImageFuncPtrs _XINITIMAGEFUNCPTRS #define _XRead _XREAD #define _XReadPad _XREADPAD #define _XRegisterFilterByType _XREGISTERFILTERBYTYPE #define _XReply _XREPLY #define _XSend _XSEND #define _XUnregisterFilter _XUNREGISTERFILTER #define _XVIDtoVisual _XVIDTOVISUAL #define _XmBottomShadowColorDefault _XMBOTTOMSHADOWCOLORDEFAULT #define _XmClearBorder _XMCLEARBORDER #define _XmConfigureObject _XMCONFIGUREOBJECT #define _XmDestroyParentCallback _XMDESTROYPARENTCALLBACK #define _XmDrawArrow _XMDRAWARROW #define _XmDrawShadows _XMDRAWSHADOWS #define _XmFontListGetDefaultFont _XMFONTLISTGETDEFAULTFONT #define _XmFromHorizontalPixels _XMFROMHORIZONTALPIXELS #define _XmFromVerticalPixels _XMFROMVERTICALPIXELS #define _XmGetClassExtensionPtr _XMGETCLASSEXTENSIONPTR #define _XmGetDefaultFontList _XMGETDEFAULTFONTLIST #define _XmGetTextualDragIcon _XMGETTEXTUALDRAGICON #define _XmGetWidgetExtData _XMGETWIDGETEXTDATA #define _XmGrabKeyboard _XMGRABKEYBOARD #define _XmGrabPointer _XMGRABPOINTER #define _XmInheritClass _XMINHERITCLASS #define _XmInputForGadget _XMINPUTFORGADGET #define _XmInputInGadget _XMINPUTINGADGET #define _XmMakeGeometryRequest _XMMAKEGEOMETRYREQUEST #define _XmMenuPopDown _XMMENUPOPDOWN #define _XmMoveObject _XMMOVEOBJECT #define _XmNavigChangeManaged _XMNAVIGCHANGEMANAGED #define _XmOSBuildFileList _XMOSBUILDFILELIST #define _XmOSFileCompare _XMOSFILECOMPARE #define _XmOSFindPatternPart _XMOSFINDPATTERNPART #define _XmOSQualifyFileSpec _XMOSQUALIFYFILESPEC #define _XmPostPopupMenu _XMPOSTPOPUPMENU #define _XmPrimitiveEnter _XMPRIMITIVEENTER #define _XmPrimitiveLeave _XMPRIMITIVELEAVE #define _XmRedisplayGadgets _XMREDISPLAYGADGETS #define _XmShellIsExclusive _XMSHELLISEXCLUSIVE #define _XmStringDraw _XMSTRINGDRAW #define _XmStringGetTextConcat _XMSTRINGGETTEXTCONCAT #define _XmStrings _XMSTRINGS #define _XmToHorizontalPixels _XMTOHORIZONTALPIXELS #define _XmToVerticalPixels _XMTOVERTICALPIXELS #define _XmTopShadowColorDefault _XMTOPSHADOWCOLORDEFAULT #define _Xm_fastPtr _XM_FASTPTR #define _XtCheckSubclassFlag _XTCHECKSUBCLASSFLAG #define _XtCopyFromArg _XTCOPYFROMARG #define _XtCountVaList _XTCOUNTVALIST #define _XtInherit _XTINHERIT #define _XtInheritTranslations _XTINHERITTRANSLATIONS #define _XtIsSubclassOf _XTISSUBCLASSOF #define _XtVaToArgList _XTVATOARGLIST #define applicationShellWidgetClass APPLICATIONSHELLWIDGETCLASS #define cli$dcl_parse CLI$DCL_PARSE #define cli$get_value CLI$GET_VALUE #define cli$present CLI$PRESENT #define compositeClassRec COMPOSITECLASSREC #define compositeWidgetClass COMPOSITEWIDGETCLASS #define constraintClassRec CONSTRAINTCLASSREC #define constraintWidgetClass CONSTRAINTWIDGETCLASS #define coreWidgetClass COREWIDGETCLASS #define exe$getspi EXE$GETSPI #define lbr$close LBR$CLOSE #define lbr$get_header LBR$GET_HEADER #define lbr$get_index LBR$GET_INDEX #define lbr$get_record LBR$GET_RECORD #define lbr$ini_control LBR$INI_CONTROL #define lbr$lookup_key LBR$LOOKUP_KEY #define lbr$open LBR$OPEN #define lbr$output_help LBR$OUTPUT_HELP #define lib$add_times LIB$ADD_TIMES #define lib$addx LIB$ADDX #define lib$create_dir LIB$CREATE_DIR #define lib$create_vm_zone LIB$CREATE_VM_ZONE #define lib$cvt_from_internal_time LIB$CVT_FROM_INTERNAL_TIME #define lib$cvt_htb LIB$CVT_HTB #define lib$cvt_vectim LIB$CVT_VECTIM #define lib$day LIB$DAY #define lib$day_of_week LIB$DAY_OF_WEEK #define lib$delete_symbol LIB$DELETE_SYMBOL #define lib$delete_vm_zone LIB$DELETE_VM_ZONE #define lib$disable_ctrl LIB$DISABLE_CTRL #define lib$ediv LIB$EDIV #define lib$emul LIB$EMUL #define lib$enable_ctrl LIB$ENABLE_CTRL #define lib$find_vm_zone LIB$FIND_VM_ZONE #define lib$format_date_time LIB$FORMAT_DATE_TIME #define lib$free_timer LIB$FREE_TIMER #define lib$free_vm LIB$FREE_VM #define lib$get_ef LIB$GET_EF #define lib$get_foreign LIB$GET_FOREIGN #define lib$get_input LIB$GET_INPUT #define lib$get_users_language LIB$GET_USERS_LANGUAGE #define lib$get_vm LIB$GET_VM #define lib$get_symbol LIB$GET_SYMBOL #define lib$getdvi LIB$GETDVI #define lib$init_date_time_context LIB$INIT_DATE_TIME_CONTEXT #define lib$init_timer LIB$INIT_TIMER #define lib$find_file LIB$FIND_FILE #define lib$find_file_end LIB$FIND_FILE_END #define lib$find_image_symbol LIB$FIND_IMAGE_SYMBOL #define lib$mult_delta_time LIB$MULT_DELTA_TIME #define lib$put_output LIB$PUT_OUTPUT #define lib$rename_file LIB$RENAME_FILE #define lib$reset_vm_zone LIB$RESET_VM_ZONE #define lib$set_symbol LIB$SET_SYMBOL #define lib$sfree1_dd LIB$SFREE1_DD #define lib$show_vm LIB$SHOW_VM #define lib$show_vm_zone LIB$SHOW_VM_ZONE #define lib$spawn LIB$SPAWN #define lib$stat_timer LIB$STAT_TIMER #define lib$subx LIB$SUBX #define lib$sub_times LIB$SUB_TIMES #define lib$wait LIB$WAIT #define mail$send_add_address MAIL$SEND_ADD_ADDRESS #define mail$send_add_attribute MAIL$SEND_ADD_ATTRIBUTE #define mail$send_add_bodypart MAIL$SEND_ADD_BODYPART #define mail$send_begin MAIL$SEND_BEGIN #define mail$send_end MAIL$SEND_END #define mail$send_message MAIL$SEND_MESSAGE #define ncs$convert NCS$CONVERT #define ncs$get_cf NCS$GET_CF #define objectClass OBJECTCLASS #define objectClassRec OBJECTCLASSREC #define overrideShellClassRec OVERRIDESHELLCLASSREC #define overrideShellWidgetClass OVERRIDESHELLWIDGETCLASS #define pthread_attr_create PTHREAD_ATTR_CREATE #define pthread_attr_delete PTHREAD_ATTR_DELETE #define pthread_attr_destroy PTHREAD_ATTR_DESTROY #define pthread_attr_getdetach_np PTHREAD_ATTR_GETDETACH_NP #define pthread_attr_getguardsize_np PTHREAD_ATTR_GETGUARDSIZE_NP #define pthread_attr_getinheritsched PTHREAD_ATTR_GETINHERITSCHED #define pthread_attr_getprio PTHREAD_ATTR_GETPRIO #define pthread_attr_getsched PTHREAD_ATTR_GETSCHED #define pthread_attr_getschedparam PTHREAD_ATTR_GETSCHEDPARAM #define pthread_attr_getschedpolicy PTHREAD_ATTR_GETSCHEDPOLICY #define pthread_attr_getstacksize PTHREAD_ATTR_GETSTACKSIZE #define pthread_attr_init PTHREAD_ATTR_INIT #define pthread_attr_setdetach_np PTHREAD_ATTR_SETDETACH_NP #define pthread_attr_setdetachstate PTHREAD_ATTR_SETDETACHSTATE #define pthread_attr_setguardsize_np PTHREAD_ATTR_SETGUARDSIZE_NP #define pthread_attr_setinheritsched PTHREAD_ATTR_SETINHERITSCHED #define pthread_attr_setprio PTHREAD_ATTR_SETPRIO #define pthread_attr_setsched PTHREAD_ATTR_SETSCHED #define pthread_attr_setschedparam PTHREAD_ATTR_SETSCHEDPARAM #define pthread_attr_setschedpolicy PTHREAD_ATTR_SETSCHEDPOLICY #ifndef pthread_attr_setscope # define pthread_attr_setscope PTHREAD_ATTR_SETSCOPE #endif #define pthread_attr_setstacksize PTHREAD_ATTR_SETSTACKSIZE #define pthread_cancel PTHREAD_CANCEL #define pthread_cancel_e PTHREAD_CANCEL_E #define pthread_cond_broadcast PTHREAD_COND_BROADCAST #define pthread_cond_destroy PTHREAD_COND_DESTROY #define pthread_cond_init PTHREAD_COND_INIT #define pthread_cond_sig_preempt_int_np PTHREAD_COND_SIG_PREEMPT_INT_NP #define pthread_cond_signal PTHREAD_COND_SIGNAL #define pthread_cond_signal_int_np PTHREAD_COND_SIGNAL_INT_NP #define pthread_cond_timedwait PTHREAD_COND_TIMEDWAIT #define pthread_cond_wait PTHREAD_COND_WAIT #define pthread_condattr_create PTHREAD_CONDATTR_CREATE #define pthread_condattr_delete PTHREAD_CONDATTR_DELETE #define pthread_condattr_init PTHREAD_CONDATTR_INIT #define pthread_create PTHREAD_CREATE #define pthread_delay_np PTHREAD_DELAY_NP #define pthread_detach PTHREAD_DETACH #define pthread_equal PTHREAD_EQUAL #define pthread_exc_fetch_fp_np PTHREAD_EXC_FETCH_FP_NP #define pthread_exc_handler_np PTHREAD_EXC_HANDLER_NP #define pthread_exc_matches_np PTHREAD_EXC_MATCHES_NP #define pthread_exc_pop_ctx_np PTHREAD_EXC_POP_CTX_NP #define pthread_exc_push_ctx_np PTHREAD_EXC_PUSH_CTX_NP #define pthread_exc_raise_np PTHREAD_EXC_RAISE_NP #define pthread_exc_savecontext_np PTHREAD_EXC_SAVECONTEXT_NP #define pthread_exit PTHREAD_EXIT #define pthread_get_expiration_np PTHREAD_GET_EXPIRATION_NP #define pthread_getprio PTHREAD_GETPRIO #define pthread_getschedparam PTHREAD_GETSCHEDPARAM #define pthread_getscheduler PTHREAD_GETSCHEDULER #define pthread_getspecific PTHREAD_GETSPECIFIC #define pthread_getunique_np PTHREAD_GETUNIQUE_NP #define pthread_join PTHREAD_JOIN #define pthread_join32 PTHREAD_JOIN32 #define pthread_key_create PTHREAD_KEY_CREATE #define pthread_key_delete PTHREAD_KEY_DELETE #define pthread_keycreate PTHREAD_KEYCREATE #define pthread_kill PTHREAD_KILL #define pthread_lock_global_np PTHREAD_LOCK_GLOBAL_NP #define pthread_mutex_destroy PTHREAD_MUTEX_DESTROY #define pthread_mutex_init PTHREAD_MUTEX_INIT #define pthread_mutex_lock PTHREAD_MUTEX_LOCK #define pthread_mutex_trylock PTHREAD_MUTEX_TRYLOCK #define pthread_mutex_unlock PTHREAD_MUTEX_UNLOCK #define pthread_mutexattr_create PTHREAD_MUTEXATTR_CREATE #define pthread_mutexattr_delete PTHREAD_MUTEXATTR_DELETE #define pthread_mutexattr_destroy PTHREAD_MUTEXATTR_DESTROY #define pthread_mutexattr_getkind_np PTHREAD_MUTEXATTR_GETKIND_NP #define pthread_mutexattr_init PTHREAD_MUTEXATTR_INIT #define pthread_mutexattr_setkind_np PTHREAD_MUTEXATTR_SETKIND_NP #define pthread_mutexattr_settype_np PTHREAD_MUTEXATTR_SETTYPE_NP #define pthread_once PTHREAD_ONCE #define pthread_resume_np PTHREAD_RESUME_NP #define pthread_self PTHREAD_SELF #define pthread_setasynccancel PTHREAD_SETASYNCCANCEL #define pthread_setcancel PTHREAD_SETCANCEL #define pthread_setcancelstate PTHREAD_SETCANCELSTATE #define pthread_setcanceltype PTHREAD_SETCANCELTYPE #define pthread_setprio PTHREAD_SETPRIO #define pthread_setschedparam PTHREAD_SETSCHEDPARAM #define pthread_setscheduler PTHREAD_SETSCHEDULER #define pthread_setspecific PTHREAD_SETSPECIFIC #define pthread_suspend_np PTHREAD_SUSPEND_NP #define pthread_testcancel PTHREAD_TESTCANCEL #define pthread_unlock_global_np PTHREAD_UNLOCK_GLOBAL_NP #define pthread_yield PTHREAD_YIELD #define pthread_yield_np PTHREAD_YIELD_NP #define rectObjClass RECTOBJCLASS #define rectObjClassRec RECTOBJCLASSREC #define sessionShellWidgetClass SESSIONSHELLWIDGETCLASS #define shellWidgetClass SHELLWIDGETCLASS #define shmat SHMAT #define shmctl SHMCTL #define shmdt SHMDT #define shmget SHMGET #define smg$create_key_table SMG$CREATE_KEY_TABLE #define smg$create_virtual_keyboard SMG$CREATE_VIRTUAL_KEYBOARD #define smg$read_composed_line SMG$READ_COMPOSED_LINE #define sys$add_ident SYS$ADD_IDENT #define sys$asctoid SYS$ASCTOID #define sys$assign SYS$ASSIGN #define sys$bintim SYS$BINTIM #define sys$cancel SYS$CANCEL #define sys$cantim SYS$CANTIM #define sys$check_access SYS$CHECK_ACCESS #define sys$close SYS$CLOSE #define sys$connect SYS$CONNECT #define sys$create SYS$CREATE #define sys$create_user_profile SYS$CREATE_USER_PROFILE #define sys$crembx SYS$CREMBX #define sys$creprc SYS$CREPRC #define sys$crmpsc SYS$CRMPSC #define sys$dassgn SYS$DASSGN #define sys$dclast SYS$DCLAST #define sys$dclexh SYS$DCLEXH #define sys$delprc SYS$DELPRC #define sys$deq SYS$DEQ #define sys$dgblsc SYS$DGBLSC #define sys$display SYS$DISPLAY #define sys$enq SYS$ENQ #define sys$enqw SYS$ENQW #define sys$erase SYS$ERASE #define sys$fao SYS$FAO #define sys$faol SYS$FAOL #define sys$find_held SYS$FIND_HELD #define sys$finish_rdb SYS$FINISH_RDB #define sys$flush SYS$FLUSH #define sys$forcex SYS$FORCEX #define sys$get SYS$GET #define sys$get_security SYS$GET_SECURITY #define sys$getdviw SYS$GETDVIW #define sys$getjpi SYS$GETJPI #define sys$getjpiw SYS$GETJPIW #define sys$getlkiw SYS$GETLKIW #define sys$getmsg SYS$GETMSG #define sys$getsyi SYS$GETSYI #define sys$getsyiw SYS$GETSYIW #define sys$gettim SYS$GETTIM #define sys$getuai SYS$GETUAI #define sys$grantid SYS$GRANTID #define sys$hash_password SYS$HASH_PASSWORD #define sys$hiber SYS$HIBER #define sys$mgblsc SYS$MGBLSC #define sys$numtim SYS$NUMTIM #define sys$open SYS$OPEN #define sys$parse SYS$PARSE #define sys$parse_acl SYS$PARSE_ACL #define sys$parse_acl SYS$PARSE_ACL #define sys$persona_assume SYS$PERSONA_ASSUME #define sys$persona_create SYS$PERSONA_CREATE #define sys$persona_delete SYS$PERSONA_DELETE #define sys$process_scan SYS$PROCESS_SCAN #define sys$put SYS$PUT #define sys$qio SYS$QIO #define sys$qiow SYS$QIOW #define sys$read SYS$READ #define sys$resched SYS$RESCHED #define sys$rewind SYS$REWIND #define sys$search SYS$SEARCH #define sys$set_security SYS$SET_SECURITY #define sys$setast SYS$SETAST #define sys$setef SYS$SETEF #define sys$setimr SYS$SETIMR #define sys$setpri SYS$SETPRI #define sys$setprn SYS$SETPRN #define sys$setprv SYS$SETPRV #define sys$setswm SYS$SETSWM #define sys$setuai SYS$SETUAI #define sys$sndopr SYS$SNDOPR #define sys$synch SYS$SYNCH #define sys$trnlnm SYS$TRNLNM #define sys$update SYS$UPDATE #define sys$wake SYS$WAKE #define sys$write SYS$WRITE #define topLevelShellClassRec TOPLEVELSHELLCLASSREC #define topLevelShellWidgetClass TOPLEVELSHELLWIDGETCLASS #define transientShellWidgetClass TRANSIENTSHELLWIDGETCLASS #define vendorShellClassRec VENDORSHELLCLASSREC #define vendorShellWidgetClass VENDORSHELLWIDGETCLASS #define widgetClass WIDGETCLASS #define widgetClassRec WIDGETCLASSREC #define wmShellClassRec WMSHELLCLASSREC #define wmShellWidgetClass WMSHELLWIDGETCLASS #define x$soft_ast_lib_lock X$SOFT_AST_LIB_LOCK #define x$soft_ast_lock_depth X$SOFT_AST_LOCK_DEPTH #define x$soft_reenable_asts X$SOFT_REENABLE_ASTS #define xmArrowButtonWidgetClass XMARROWBUTTONWIDGETCLASS #define xmBulletinBoardWidgetClass XMBULLETINBOARDWIDGETCLASS #define xmCascadeButtonClassRec XMCASCADEBUTTONCLASSREC #define xmCascadeButtonGadgetClass XMCASCADEBUTTONGADGETCLASS #define xmCascadeButtonWidgetClass XMCASCADEBUTTONWIDGETCLASS #define xmCommandWidgetClass XMCOMMANDWIDGETCLASS #define xmDialogShellWidgetClass XMDIALOGSHELLWIDGETCLASS #define xmDrawingAreaWidgetClass XMDRAWINGAREAWIDGETCLASS #define xmDrawnButtonWidgetClass XMDRAWNBUTTONWIDGETCLASS #define xmFileSelectionBoxWidgetClass XMFILESELECTIONBOXWIDGETCLASS #define xmFormWidgetClass XMFORMWIDGETCLASS #define xmFrameWidgetClass XMFRAMEWIDGETCLASS #define xmGadgetClass XMGADGETCLASS #define xmLabelGadgetClass XMLABELGADGETCLASS #define xmLabelWidgetClass XMLABELWIDGETCLASS #define xmListWidgetClass XMLISTWIDGETCLASS #define xmMainWindowWidgetClass XMMAINWINDOWWIDGETCLASS #define xmManagerClassRec XMMANAGERCLASSREC #define xmManagerWidgetClass XMMANAGERWIDGETCLASS #define xmMenuShellWidgetClass XMMENUSHELLWIDGETCLASS #define xmMessageBoxWidgetClass XMMESSAGEBOXWIDGETCLASS #define xmPrimitiveClassRec XMPRIMITIVECLASSREC #define xmPrimitiveWidgetClass XMPRIMITIVEWIDGETCLASS #define xmPushButtonClassRec XMPUSHBUTTONCLASSREC #define xmPushButtonGadgetClass XMPUSHBUTTONGADGETCLASS #define xmPushButtonWidgetClass XMPUSHBUTTONWIDGETCLASS #define xmRowColumnWidgetClass XMROWCOLUMNWIDGETCLASS #define xmSashWidgetClass XMSASHWIDGETCLASS #define xmScaleWidgetClass XMSCALEWIDGETCLASS #define xmScrollBarWidgetClass XMSCROLLBARWIDGETCLASS #define xmScrolledWindowClassRec XMSCROLLEDWINDOWCLASSREC #define xmScrolledWindowWidgetClass XMSCROLLEDWINDOWWIDGETCLASS #define xmSeparatorGadgetClass XMSEPARATORGADGETCLASS #define xmSeparatorWidgetClass XMSEPARATORWIDGETCLASS #define xmTextFieldWidgetClass XMTEXTFIELDWIDGETCLASS #define xmTextWidgetClass XMTEXTWIDGETCLASS #define xmToggleButtonGadgetClass XMTOGGLEBUTTONGADGETCLASS #define xmToggleButtonWidgetClass XMTOGGLEBUTTONWIDGETCLASS #if (__VMS_VER < 80200000) # define SetReqLen(req,n,badlen) \ if ((req->length + n) > (unsigned)65535) { \ n = badlen; \ req->length += n; \ } else \ req->length += n #endif #ifdef __cplusplus extern "C" { #endif extern void XtFree(char*); #ifdef __cplusplus } #endif #endif
h
rticonnextdds-usecases
data/projects/rticonnextdds-usecases/VehicleTracking/ExampleCode/thirdparty/wxWidgets-3.1.2/Linux/include/wx/hashmap.h
///////////////////////////////////////////////////////////////////////////// // Name: wx/hashmap.h // Purpose: wxHashMap class // Author: Mattia Barbon // Modified by: // Created: 29/01/2002 // Copyright: (c) Mattia Barbon // Licence: wxWindows licence ///////////////////////////////////////////////////////////////////////////// #ifndef _WX_HASHMAP_H_ #define _WX_HASHMAP_H_ #include "wx/string.h" #include "wx/wxcrt.h" // In wxUSE_STD_CONTAINERS build we prefer to use the standard hash map class // but it can be either in non-standard hash_map header (old g++ and some other // STL implementations) or in C++0x standard unordered_map which can in turn be // available either in std::tr1 or std namespace itself // // To summarize: if std::unordered_map is available use it, otherwise use tr1 // and finally fall back to non-standard hash_map #if (defined(HAVE_EXT_HASH_MAP) || defined(HAVE_HASH_MAP)) \ && (defined(HAVE_GNU_CXX_HASH_MAP) || defined(HAVE_STD_HASH_MAP)) #define HAVE_STL_HASH_MAP #endif #if wxUSE_STD_CONTAINERS && \ (defined(HAVE_STD_UNORDERED_MAP) || defined(HAVE_TR1_UNORDERED_MAP)) #if defined(HAVE_STD_UNORDERED_MAP) #include <unordered_map> #define WX_HASH_MAP_NAMESPACE std #elif defined(HAVE_TR1_UNORDERED_MAP) #include <tr1/unordered_map> #define WX_HASH_MAP_NAMESPACE std::tr1 #endif #define _WX_DECLARE_HASH_MAP( KEY_T, VALUE_T, HASH_T, KEY_EQ_T, CLASSNAME, CLASSEXP ) \ typedef WX_HASH_MAP_NAMESPACE::unordered_map< KEY_T, VALUE_T, HASH_T, KEY_EQ_T > CLASSNAME #elif wxUSE_STD_CONTAINERS && defined(HAVE_STL_HASH_MAP) #if defined(HAVE_EXT_HASH_MAP) #include <ext/hash_map> #elif defined(HAVE_HASH_MAP) #include <hash_map> #endif #if defined(HAVE_GNU_CXX_HASH_MAP) #define WX_HASH_MAP_NAMESPACE __gnu_cxx #elif defined(HAVE_STD_HASH_MAP) #define WX_HASH_MAP_NAMESPACE std #endif #define _WX_DECLARE_HASH_MAP( KEY_T, VALUE_T, HASH_T, KEY_EQ_T, CLASSNAME, CLASSEXP ) \ typedef WX_HASH_MAP_NAMESPACE::hash_map< KEY_T, VALUE_T, HASH_T, KEY_EQ_T > CLASSNAME #else // !wxUSE_STD_CONTAINERS || no std::{hash,unordered}_map class available #define wxNEEDS_WX_HASH_MAP #include <stddef.h> // for ptrdiff_t // private struct WXDLLIMPEXP_BASE _wxHashTable_NodeBase { _wxHashTable_NodeBase() : m_next(NULL) {} _wxHashTable_NodeBase* m_next; // Cannot do this: // wxDECLARE_NO_COPY_CLASS(_wxHashTable_NodeBase); // without rewriting the macros, which require a public copy constructor. }; // private class WXDLLIMPEXP_BASE _wxHashTableBase2 { public: typedef void (*NodeDtor)(_wxHashTable_NodeBase*); typedef size_t (*BucketFromNode)(_wxHashTableBase2*,_wxHashTable_NodeBase*); typedef _wxHashTable_NodeBase* (*ProcessNode)(_wxHashTable_NodeBase*); protected: static _wxHashTable_NodeBase* DummyProcessNode(_wxHashTable_NodeBase* node); static void DeleteNodes( size_t buckets, _wxHashTable_NodeBase** table, NodeDtor dtor ); static _wxHashTable_NodeBase* GetFirstNode( size_t buckets, _wxHashTable_NodeBase** table ) { for( size_t i = 0; i < buckets; ++i ) if( table[i] ) return table[i]; return NULL; } // as static const unsigned prime_count = 31 but works with all compilers enum { prime_count = 31 }; static const unsigned long ms_primes[prime_count]; // returns the first prime in ms_primes greater than n static unsigned long GetNextPrime( unsigned long n ); // returns the first prime in ms_primes smaller than n // ( or ms_primes[0] if n is very small ) static unsigned long GetPreviousPrime( unsigned long n ); static void CopyHashTable( _wxHashTable_NodeBase** srcTable, size_t srcBuckets, _wxHashTableBase2* dst, _wxHashTable_NodeBase** dstTable, BucketFromNode func, ProcessNode proc ); static void** AllocTable( size_t sz ) { return (void **)calloc(sz, sizeof(void*)); } static void FreeTable(void *table) { free(table); } }; #define _WX_DECLARE_HASHTABLE( VALUE_T, KEY_T, HASH_T, KEY_EX_T, KEY_EQ_T,\ PTROPERATOR, CLASSNAME, CLASSEXP, \ SHOULD_GROW, SHOULD_SHRINK ) \ CLASSEXP CLASSNAME : protected _wxHashTableBase2 \ { \ public: \ typedef KEY_T key_type; \ typedef VALUE_T value_type; \ typedef HASH_T hasher; \ typedef KEY_EQ_T key_equal; \ \ typedef size_t size_type; \ typedef ptrdiff_t difference_type; \ typedef value_type* pointer; \ typedef const value_type* const_pointer; \ typedef value_type& reference; \ typedef const value_type& const_reference; \ /* should these be protected? */ \ typedef const KEY_T const_key_type; \ typedef const VALUE_T const_mapped_type; \ public: \ typedef KEY_EX_T key_extractor; \ typedef CLASSNAME Self; \ protected: \ _wxHashTable_NodeBase** m_table; \ size_t m_tableBuckets; \ size_t m_items; \ hasher m_hasher; \ key_equal m_equals; \ key_extractor m_getKey; \ public: \ struct Node:public _wxHashTable_NodeBase \ { \ public: \ Node( const value_type& value ) \ : m_value( value ) {} \ Node* next() { return static_cast<Node*>(m_next); } \ \ value_type m_value; \ }; \ \ protected: \ static void DeleteNode( _wxHashTable_NodeBase* node ) \ { \ delete static_cast<Node*>(node); \ } \ public: \ /* */ \ /* forward iterator */ \ /* */ \ CLASSEXP Iterator \ { \ public: \ Node* m_node; \ Self* m_ht; \ \ Iterator() : m_node(NULL), m_ht(NULL) {} \ Iterator( Node* node, const Self* ht ) \ : m_node(node), m_ht(const_cast<Self*>(ht)) {} \ bool operator ==( const Iterator& it ) const \ { return m_node == it.m_node; } \ bool operator !=( const Iterator& it ) const \ { return m_node != it.m_node; } \ protected: \ Node* GetNextNode() \ { \ size_type bucket = GetBucketForNode(m_ht,m_node); \ for( size_type i = bucket + 1; i < m_ht->m_tableBuckets; ++i ) \ { \ if( m_ht->m_table[i] ) \ return static_cast<Node*>(m_ht->m_table[i]); \ } \ return NULL; \ } \ \ void PlusPlus() \ { \ Node* next = m_node->next(); \ m_node = next ? next : GetNextNode(); \ } \ }; \ friend class Iterator; \ \ public: \ CLASSEXP iterator : public Iterator \ { \ public: \ iterator() : Iterator() {} \ iterator( Node* node, Self* ht ) : Iterator( node, ht ) {} \ iterator& operator++() { PlusPlus(); return *this; } \ iterator operator++(int) { iterator it=*this;PlusPlus();return it; } \ reference operator *() const { return m_node->m_value; } \ PTROPERATOR(pointer) \ }; \ \ CLASSEXP const_iterator : public Iterator \ { \ public: \ const_iterator() : Iterator() {} \ const_iterator(iterator i) : Iterator(i) {} \ const_iterator( Node* node, const Self* ht ) \ : Iterator(node, const_cast<Self*>(ht)) {} \ const_iterator& operator++() { PlusPlus();return *this; } \ const_iterator operator++(int) { const_iterator it=*this;PlusPlus();return it; } \ const_reference operator *() const { return m_node->m_value; } \ PTROPERATOR(const_pointer) \ }; \ \ CLASSNAME( size_type sz = 10, const hasher& hfun = hasher(), \ const key_equal& k_eq = key_equal(), \ const key_extractor& k_ex = key_extractor() ) \ : m_tableBuckets( GetNextPrime( (unsigned long) sz ) ), \ m_items( 0 ), \ m_hasher( hfun ), \ m_equals( k_eq ), \ m_getKey( k_ex ) \ { \ m_table = (_wxHashTable_NodeBase**)AllocTable(m_tableBuckets); \ } \ \ CLASSNAME( const Self& ht ) \ : m_table(NULL), \ m_tableBuckets( 0 ), \ m_items( ht.m_items ), \ m_hasher( ht.m_hasher ), \ m_equals( ht.m_equals ), \ m_getKey( ht.m_getKey ) \ { \ HashCopy( ht ); \ } \ \ const Self& operator=( const Self& ht ) \ { \ if (&ht != this) \ { \ clear(); \ m_hasher = ht.m_hasher; \ m_equals = ht.m_equals; \ m_getKey = ht.m_getKey; \ m_items = ht.m_items; \ HashCopy( ht ); \ } \ return *this; \ } \ \ ~CLASSNAME() \ { \ clear(); \ \ FreeTable(m_table); \ } \ \ hasher hash_funct() { return m_hasher; } \ key_equal key_eq() { return m_equals; } \ \ /* removes all elements from the hash table, but does not */ \ /* shrink it ( perhaps it should ) */ \ void clear() \ { \ DeleteNodes(m_tableBuckets, m_table, DeleteNode); \ m_items = 0; \ } \ \ size_type size() const { return m_items; } \ size_type max_size() const { return size_type(-1); } \ bool empty() const { return size() == 0; } \ \ const_iterator end() const { return const_iterator(NULL, this); } \ iterator end() { return iterator(NULL, this); } \ const_iterator begin() const \ { return const_iterator(static_cast<Node*>(GetFirstNode(m_tableBuckets, m_table)), this); } \ iterator begin() \ { return iterator(static_cast<Node*>(GetFirstNode(m_tableBuckets, m_table)), this); } \ \ size_type erase( const const_key_type& key ) \ { \ _wxHashTable_NodeBase** node = GetNodePtr(key); \ \ if( !node ) \ return 0; \ \ --m_items; \ _wxHashTable_NodeBase* temp = (*node)->m_next; \ delete static_cast<Node*>(*node); \ (*node) = temp; \ if( SHOULD_SHRINK( m_tableBuckets, m_items ) ) \ ResizeTable( GetPreviousPrime( (unsigned long) m_tableBuckets ) - 1 ); \ return 1; \ } \ \ protected: \ static size_type GetBucketForNode( Self* ht, Node* node ) \ { \ return ht->m_hasher( ht->m_getKey( node->m_value ) ) \ % ht->m_tableBuckets; \ } \ static Node* CopyNode( Node* node ) { return new Node( *node ); } \ \ Node* GetOrCreateNode( const value_type& value, bool& created ) \ { \ const const_key_type& key = m_getKey( value ); \ size_t bucket = m_hasher( key ) % m_tableBuckets; \ Node* node = static_cast<Node*>(m_table[bucket]); \ \ while( node ) \ { \ if( m_equals( m_getKey( node->m_value ), key ) ) \ { \ created = false; \ return node; \ } \ node = node->next(); \ } \ created = true; \ return CreateNode( value, bucket); \ }\ Node * CreateNode( const value_type& value, size_t bucket ) \ {\ Node* node = new Node( value ); \ node->m_next = m_table[bucket]; \ m_table[bucket] = node; \ \ /* must be after the node is inserted */ \ ++m_items; \ if( SHOULD_GROW( m_tableBuckets, m_items ) ) \ ResizeTable( m_tableBuckets ); \ \ return node; \ } \ void CreateNode( const value_type& value ) \ {\ CreateNode(value, m_hasher( m_getKey(value) ) % m_tableBuckets ); \ }\ \ /* returns NULL if not found */ \ _wxHashTable_NodeBase** GetNodePtr(const const_key_type& key) const \ { \ size_t bucket = m_hasher( key ) % m_tableBuckets; \ _wxHashTable_NodeBase** node = &m_table[bucket]; \ \ while( *node ) \ { \ if (m_equals(m_getKey(static_cast<Node*>(*node)->m_value), key)) \ return node; \ node = &(*node)->m_next; \ } \ \ return NULL; \ } \ \ /* returns NULL if not found */ \ /* expressing it in terms of GetNodePtr is 5-8% slower :-( */ \ Node* GetNode( const const_key_type& key ) const \ { \ size_t bucket = m_hasher( key ) % m_tableBuckets; \ Node* node = static_cast<Node*>(m_table[bucket]); \ \ while( node ) \ { \ if( m_equals( m_getKey( node->m_value ), key ) ) \ return node; \ node = node->next(); \ } \ \ return NULL; \ } \ \ void ResizeTable( size_t newSize ) \ { \ newSize = GetNextPrime( (unsigned long)newSize ); \ _wxHashTable_NodeBase** srcTable = m_table; \ size_t srcBuckets = m_tableBuckets; \ m_table = (_wxHashTable_NodeBase**)AllocTable( newSize ); \ m_tableBuckets = newSize; \ \ CopyHashTable( srcTable, srcBuckets, \ this, m_table, \ (BucketFromNode)GetBucketForNode,\ (ProcessNode)&DummyProcessNode ); \ FreeTable(srcTable); \ } \ \ /* this must be called _after_ m_table has been cleaned */ \ void HashCopy( const Self& ht ) \ { \ ResizeTable( ht.size() ); \ CopyHashTable( ht.m_table, ht.m_tableBuckets, \ (_wxHashTableBase2*)this, \ m_table, \ (BucketFromNode)GetBucketForNode, \ (ProcessNode)CopyNode ); \ } \ }; // defines an STL-like pair class CLASSNAME storing two fields: first of type // KEY_T and second of type VALUE_T #define _WX_DECLARE_PAIR( KEY_T, VALUE_T, CLASSNAME, CLASSEXP ) \ CLASSEXP CLASSNAME \ { \ public: \ typedef KEY_T first_type; \ typedef VALUE_T second_type; \ typedef KEY_T t1; \ typedef VALUE_T t2; \ typedef const KEY_T const_t1; \ typedef const VALUE_T const_t2; \ \ CLASSNAME(const const_t1& f, const const_t2& s) \ : first(const_cast<t1&>(f)), second(const_cast<t2&>(s)) {} \ \ t1 first; \ t2 second; \ }; // defines the class CLASSNAME returning the key part (of type KEY_T) from a // pair of type PAIR_T #define _WX_DECLARE_HASH_MAP_KEY_EX( KEY_T, PAIR_T, CLASSNAME, CLASSEXP ) \ CLASSEXP CLASSNAME \ { \ typedef KEY_T key_type; \ typedef PAIR_T pair_type; \ typedef const key_type const_key_type; \ typedef const pair_type const_pair_type; \ typedef const_key_type& const_key_reference; \ typedef const_pair_type& const_pair_reference; \ public: \ CLASSNAME() { } \ const_key_reference operator()( const_pair_reference pair ) const { return pair.first; }\ \ /* the dummy assignment operator is needed to suppress compiler */ \ /* warnings from hash table class' operator=(): gcc complains about */ \ /* "statement with no effect" without it */ \ CLASSNAME& operator=(const CLASSNAME&) { return *this; } \ }; // grow/shrink predicates inline bool never_grow( size_t, size_t ) { return false; } inline bool never_shrink( size_t, size_t ) { return false; } inline bool grow_lf70( size_t buckets, size_t items ) { return float(items)/float(buckets) >= 0.85f; } #endif // various hash map implementations // ---------------------------------------------------------------------------- // hashing and comparison functors // ---------------------------------------------------------------------------- // NB: implementation detail: all of these classes must have dummy assignment // operators to suppress warnings about "statement with no effect" from gcc // in the hash table class assignment operator (where they're assigned) #ifndef wxNEEDS_WX_HASH_MAP // integer types struct WXDLLIMPEXP_BASE wxIntegerHash { private: WX_HASH_MAP_NAMESPACE::hash<long> longHash; WX_HASH_MAP_NAMESPACE::hash<unsigned long> ulongHash; WX_HASH_MAP_NAMESPACE::hash<int> intHash; WX_HASH_MAP_NAMESPACE::hash<unsigned int> uintHash; WX_HASH_MAP_NAMESPACE::hash<short> shortHash; WX_HASH_MAP_NAMESPACE::hash<unsigned short> ushortHash; #ifdef wxHAS_LONG_LONG_T_DIFFERENT_FROM_LONG // hash<wxLongLong_t> ought to work but doesn't on some compilers #if (!defined SIZEOF_LONG_LONG && SIZEOF_LONG == 4) \ || (defined SIZEOF_LONG_LONG && SIZEOF_LONG_LONG == SIZEOF_LONG * 2) size_t longlongHash( wxLongLong_t x ) const { return longHash( wx_truncate_cast(long, x) ) ^ longHash( wx_truncate_cast(long, x >> (sizeof(long) * 8)) ); } #elif defined SIZEOF_LONG_LONG && SIZEOF_LONG_LONG == SIZEOF_LONG WX_HASH_MAP_NAMESPACE::hash<long> longlongHash; #else WX_HASH_MAP_NAMESPACE::hash<wxLongLong_t> longlongHash; #endif #endif // wxHAS_LONG_LONG_T_DIFFERENT_FROM_LONG public: wxIntegerHash() { } size_t operator()( long x ) const { return longHash( x ); } size_t operator()( unsigned long x ) const { return ulongHash( x ); } size_t operator()( int x ) const { return intHash( x ); } size_t operator()( unsigned int x ) const { return uintHash( x ); } size_t operator()( short x ) const { return shortHash( x ); } size_t operator()( unsigned short x ) const { return ushortHash( x ); } #ifdef wxHAS_LONG_LONG_T_DIFFERENT_FROM_LONG size_t operator()( wxLongLong_t x ) const { return longlongHash(x); } size_t operator()( wxULongLong_t x ) const { return longlongHash(x); } #endif // wxHAS_LONG_LONG_T_DIFFERENT_FROM_LONG wxIntegerHash& operator=(const wxIntegerHash&) { return *this; } }; #else // wxNEEDS_WX_HASH_MAP // integer types struct WXDLLIMPEXP_BASE wxIntegerHash { wxIntegerHash() { } unsigned long operator()( long x ) const { return (unsigned long)x; } unsigned long operator()( unsigned long x ) const { return x; } unsigned long operator()( int x ) const { return (unsigned long)x; } unsigned long operator()( unsigned int x ) const { return x; } unsigned long operator()( short x ) const { return (unsigned long)x; } unsigned long operator()( unsigned short x ) const { return x; } #ifdef wxHAS_LONG_LONG_T_DIFFERENT_FROM_LONG wxULongLong_t operator()( wxLongLong_t x ) const { return static_cast<wxULongLong_t>(x); } wxULongLong_t operator()( wxULongLong_t x ) const { return x; } #endif // wxHAS_LONG_LONG_T_DIFFERENT_FROM_LONG wxIntegerHash& operator=(const wxIntegerHash&) { return *this; } }; #endif // !wxNEEDS_WX_HASH_MAP/wxNEEDS_WX_HASH_MAP struct WXDLLIMPEXP_BASE wxIntegerEqual { wxIntegerEqual() { } bool operator()( long a, long b ) const { return a == b; } bool operator()( unsigned long a, unsigned long b ) const { return a == b; } bool operator()( int a, int b ) const { return a == b; } bool operator()( unsigned int a, unsigned int b ) const { return a == b; } bool operator()( short a, short b ) const { return a == b; } bool operator()( unsigned short a, unsigned short b ) const { return a == b; } #ifdef wxHAS_LONG_LONG_T_DIFFERENT_FROM_LONG bool operator()( wxLongLong_t a, wxLongLong_t b ) const { return a == b; } bool operator()( wxULongLong_t a, wxULongLong_t b ) const { return a == b; } #endif // wxHAS_LONG_LONG_T_DIFFERENT_FROM_LONG wxIntegerEqual& operator=(const wxIntegerEqual&) { return *this; } }; // pointers struct WXDLLIMPEXP_BASE wxPointerHash { wxPointerHash() { } #ifdef wxNEEDS_WX_HASH_MAP wxUIntPtr operator()( const void* k ) const { return wxPtrToUInt(k); } #else size_t operator()( const void* k ) const { return (size_t)k; } #endif wxPointerHash& operator=(const wxPointerHash&) { return *this; } }; struct WXDLLIMPEXP_BASE wxPointerEqual { wxPointerEqual() { } bool operator()( const void* a, const void* b ) const { return a == b; } wxPointerEqual& operator=(const wxPointerEqual&) { return *this; } }; // wxString, char*, wchar_t* struct WXDLLIMPEXP_BASE wxStringHash { wxStringHash() {} unsigned long operator()( const wxString& x ) const { return stringHash( x.wx_str() ); } unsigned long operator()( const wchar_t* x ) const { return stringHash( x ); } unsigned long operator()( const char* x ) const { return stringHash( x ); } #if WXWIN_COMPATIBILITY_2_8 static unsigned long wxCharStringHash( const wxChar* x ) { return stringHash(x); } #if wxUSE_UNICODE static unsigned long charStringHash( const char* x ) { return stringHash(x); } #endif #endif // WXWIN_COMPATIBILITY_2_8 static unsigned long stringHash( const wchar_t* ); static unsigned long stringHash( const char* ); wxStringHash& operator=(const wxStringHash&) { return *this; } }; struct WXDLLIMPEXP_BASE wxStringEqual { wxStringEqual() {} bool operator()( const wxString& a, const wxString& b ) const { return a == b; } bool operator()( const wxChar* a, const wxChar* b ) const { return wxStrcmp( a, b ) == 0; } #if wxUSE_UNICODE bool operator()( const char* a, const char* b ) const { return strcmp( a, b ) == 0; } #endif // wxUSE_UNICODE wxStringEqual& operator=(const wxStringEqual&) { return *this; } }; #ifdef wxNEEDS_WX_HASH_MAP #define wxPTROP_NORMAL(pointer) \ pointer operator ->() const { return &(m_node->m_value); } #define wxPTROP_NOP(pointer) #define _WX_DECLARE_HASH_MAP( KEY_T, VALUE_T, HASH_T, KEY_EQ_T, CLASSNAME, CLASSEXP ) \ _WX_DECLARE_PAIR( KEY_T, VALUE_T, CLASSNAME##_wxImplementation_Pair, CLASSEXP ) \ _WX_DECLARE_HASH_MAP_KEY_EX( KEY_T, CLASSNAME##_wxImplementation_Pair, CLASSNAME##_wxImplementation_KeyEx, CLASSEXP ) \ _WX_DECLARE_HASHTABLE( CLASSNAME##_wxImplementation_Pair, KEY_T, HASH_T, \ CLASSNAME##_wxImplementation_KeyEx, KEY_EQ_T, wxPTROP_NORMAL, \ CLASSNAME##_wxImplementation_HashTable, CLASSEXP, grow_lf70, never_shrink ) \ CLASSEXP CLASSNAME:public CLASSNAME##_wxImplementation_HashTable \ { \ public: \ typedef VALUE_T mapped_type; \ _WX_DECLARE_PAIR( iterator, bool, Insert_Result, CLASSEXP ) \ \ explicit CLASSNAME( size_type hint = 100, hasher hf = hasher(), \ key_equal eq = key_equal() ) \ : CLASSNAME##_wxImplementation_HashTable( hint, hf, eq, \ CLASSNAME##_wxImplementation_KeyEx() ) {} \ \ mapped_type& operator[]( const const_key_type& key ) \ { \ bool created; \ return GetOrCreateNode( \ CLASSNAME##_wxImplementation_Pair( key, mapped_type() ), \ created)->m_value.second; \ } \ \ const_iterator find( const const_key_type& key ) const \ { \ return const_iterator( GetNode( key ), this ); \ } \ \ iterator find( const const_key_type& key ) \ { \ return iterator( GetNode( key ), this ); \ } \ \ Insert_Result insert( const value_type& v ) \ { \ bool created; \ Node *node = GetOrCreateNode( \ CLASSNAME##_wxImplementation_Pair( v.first, v.second ), \ created); \ return Insert_Result(iterator(node, this), created); \ } \ \ size_type erase( const key_type& k ) \ { return CLASSNAME##_wxImplementation_HashTable::erase( k ); } \ void erase( const iterator& it ) { erase( (*it).first ); } \ \ /* count() == 0 | 1 */ \ size_type count( const const_key_type& key ) \ { \ return GetNode( key ) ? 1u : 0u; \ } \ } #endif // wxNEEDS_WX_HASH_MAP // these macros are to be used in the user code #define WX_DECLARE_HASH_MAP( KEY_T, VALUE_T, HASH_T, KEY_EQ_T, CLASSNAME) \ _WX_DECLARE_HASH_MAP( KEY_T, VALUE_T, HASH_T, KEY_EQ_T, CLASSNAME, class ) #define WX_DECLARE_STRING_HASH_MAP( VALUE_T, CLASSNAME ) \ _WX_DECLARE_HASH_MAP( wxString, VALUE_T, wxStringHash, wxStringEqual, \ CLASSNAME, class ) #define WX_DECLARE_VOIDPTR_HASH_MAP( VALUE_T, CLASSNAME ) \ _WX_DECLARE_HASH_MAP( void*, VALUE_T, wxPointerHash, wxPointerEqual, \ CLASSNAME, class ) // and these do exactly the same thing but should be used inside the // library #define WX_DECLARE_HASH_MAP_WITH_DECL( KEY_T, VALUE_T, HASH_T, KEY_EQ_T, CLASSNAME, DECL) \ _WX_DECLARE_HASH_MAP( KEY_T, VALUE_T, HASH_T, KEY_EQ_T, CLASSNAME, DECL ) #define WX_DECLARE_EXPORTED_HASH_MAP( KEY_T, VALUE_T, HASH_T, KEY_EQ_T, CLASSNAME) \ WX_DECLARE_HASH_MAP_WITH_DECL( KEY_T, VALUE_T, HASH_T, KEY_EQ_T, \ CLASSNAME, class WXDLLIMPEXP_CORE ) #define WX_DECLARE_STRING_HASH_MAP_WITH_DECL( VALUE_T, CLASSNAME, DECL ) \ _WX_DECLARE_HASH_MAP( wxString, VALUE_T, wxStringHash, wxStringEqual, \ CLASSNAME, DECL ) #define WX_DECLARE_EXPORTED_STRING_HASH_MAP( VALUE_T, CLASSNAME ) \ WX_DECLARE_STRING_HASH_MAP_WITH_DECL( VALUE_T, CLASSNAME, \ class WXDLLIMPEXP_CORE ) #define WX_DECLARE_VOIDPTR_HASH_MAP_WITH_DECL( VALUE_T, CLASSNAME, DECL ) \ _WX_DECLARE_HASH_MAP( void*, VALUE_T, wxPointerHash, wxPointerEqual, \ CLASSNAME, DECL ) #define WX_DECLARE_EXPORTED_VOIDPTR_HASH_MAP( VALUE_T, CLASSNAME ) \ WX_DECLARE_VOIDPTR_HASH_MAP_WITH_DECL( VALUE_T, CLASSNAME, \ class WXDLLIMPEXP_CORE ) // delete all hash elements // // NB: the class declaration of the hash elements must be visible from the // place where you use this macro, otherwise the proper destructor may not // be called (a decent compiler should give a warning about it, but don't // count on it)! #define WX_CLEAR_HASH_MAP(type, hashmap) \ { \ type::iterator it, en; \ for( it = (hashmap).begin(), en = (hashmap).end(); it != en; ++it ) \ delete it->second; \ (hashmap).clear(); \ } //--------------------------------------------------------------------------- // Declarations of common hashmap classes WX_DECLARE_HASH_MAP_WITH_DECL( long, long, wxIntegerHash, wxIntegerEqual, wxLongToLongHashMap, class WXDLLIMPEXP_BASE ); WX_DECLARE_STRING_HASH_MAP_WITH_DECL( wxString, wxStringToStringHashMap, class WXDLLIMPEXP_BASE ); WX_DECLARE_STRING_HASH_MAP_WITH_DECL( wxUIntPtr, wxStringToNumHashMap, class WXDLLIMPEXP_BASE ); #endif // _WX_HASHMAP_H_
h
rticonnextdds-usecases
data/projects/rticonnextdds-usecases/VehicleTracking/ExampleCode/thirdparty/wxWidgets-3.1.2/Linux/include/wx/fontdata.h
///////////////////////////////////////////////////////////////////////////// // Name: wx/fontdata.h // Author: Julian Smart // Copyright: (c) Julian Smart // Licence: wxWindows licence ///////////////////////////////////////////////////////////////////////////// #ifndef _WX_FONTDATA_H_ #define _WX_FONTDATA_H_ #include "wx/font.h" #include "wx/colour.h" #include "wx/encinfo.h" class WXDLLIMPEXP_CORE wxFontData : public wxObject { public: wxFontData(); virtual ~wxFontData(); wxFontData(const wxFontData& data); wxFontData& operator=(const wxFontData& data); void SetAllowSymbols(bool flag) { m_allowSymbols = flag; } bool GetAllowSymbols() const { return m_allowSymbols; } void SetColour(const wxColour& colour) { m_fontColour = colour; } const wxColour& GetColour() const { return m_fontColour; } void SetShowHelp(bool flag) { m_showHelp = flag; } bool GetShowHelp() const { return m_showHelp; } void EnableEffects(bool flag) { m_enableEffects = flag; } bool GetEnableEffects() const { return m_enableEffects; } void SetInitialFont(const wxFont& font) { m_initialFont = font; } wxFont GetInitialFont() const { return m_initialFont; } void SetChosenFont(const wxFont& font) { m_chosenFont = font; } wxFont GetChosenFont() const { return m_chosenFont; } void SetRange(int minRange, int maxRange) { m_minSize = minRange; m_maxSize = maxRange; } // encoding info is split into 2 parts: the logical wxWin encoding // (wxFontEncoding) and a structure containing the native parameters for // it (wxNativeEncodingInfo) wxFontEncoding GetEncoding() const { return m_encoding; } void SetEncoding(wxFontEncoding encoding) { m_encoding = encoding; } wxNativeEncodingInfo& EncodingInfo() { return m_encodingInfo; } // public for backwards compatibility only: don't use directly wxColour m_fontColour; bool m_showHelp; bool m_allowSymbols; bool m_enableEffects; wxFont m_initialFont; wxFont m_chosenFont; int m_minSize; int m_maxSize; private: wxFontEncoding m_encoding; wxNativeEncodingInfo m_encodingInfo; wxDECLARE_DYNAMIC_CLASS(wxFontData); }; #endif // _WX_FONTDATA_H_
h
rticonnextdds-usecases
data/projects/rticonnextdds-usecases/VehicleTracking/ExampleCode/thirdparty/wxWidgets-3.1.2/Linux/include/wx/peninfobase.h
/////////////////////////////////////////////////////////////////////////////// // Name: wx/peninfobase.h // Purpose: Declaration of wxPenInfoBase class and related constants // Author: Adrien Tétar, Vadim Zeitlin // Created: 2017-09-10 // Copyright: (c) 2017 Vadim Zeitlin <[email protected]> // Licence: wxWindows licence /////////////////////////////////////////////////////////////////////////////// #ifndef _WX_PENINFOBASE_H_ #define _WX_PENINFOBASE_H_ #include "wx/bitmap.h" #include "wx/colour.h" #include "wx/gdicmn.h" // for wxDash enum wxPenStyle { wxPENSTYLE_INVALID = -1, wxPENSTYLE_SOLID = wxSOLID, wxPENSTYLE_DOT = wxDOT, wxPENSTYLE_LONG_DASH = wxLONG_DASH, wxPENSTYLE_SHORT_DASH = wxSHORT_DASH, wxPENSTYLE_DOT_DASH = wxDOT_DASH, wxPENSTYLE_USER_DASH = wxUSER_DASH, wxPENSTYLE_TRANSPARENT = wxTRANSPARENT, wxPENSTYLE_STIPPLE_MASK_OPAQUE = wxSTIPPLE_MASK_OPAQUE, wxPENSTYLE_STIPPLE_MASK = wxSTIPPLE_MASK, wxPENSTYLE_STIPPLE = wxSTIPPLE, wxPENSTYLE_BDIAGONAL_HATCH = wxHATCHSTYLE_BDIAGONAL, wxPENSTYLE_CROSSDIAG_HATCH = wxHATCHSTYLE_CROSSDIAG, wxPENSTYLE_FDIAGONAL_HATCH = wxHATCHSTYLE_FDIAGONAL, wxPENSTYLE_CROSS_HATCH = wxHATCHSTYLE_CROSS, wxPENSTYLE_HORIZONTAL_HATCH = wxHATCHSTYLE_HORIZONTAL, wxPENSTYLE_VERTICAL_HATCH = wxHATCHSTYLE_VERTICAL, wxPENSTYLE_FIRST_HATCH = wxHATCHSTYLE_FIRST, wxPENSTYLE_LAST_HATCH = wxHATCHSTYLE_LAST }; enum wxPenJoin { wxJOIN_INVALID = -1, wxJOIN_BEVEL = 120, wxJOIN_MITER, wxJOIN_ROUND }; enum wxPenCap { wxCAP_INVALID = -1, wxCAP_ROUND = 130, wxCAP_PROJECTING, wxCAP_BUTT }; // ---------------------------------------------------------------------------- // wxPenInfoBase is a common base for wxPenInfo and wxGraphicsPenInfo // ---------------------------------------------------------------------------- // This class uses CRTP, the template parameter is the derived class itself. template <class T> class wxPenInfoBase { public: // Setters for the various attributes. All of them return the object itself // so that the calls to them could be chained. T& Colour(const wxColour& colour) { m_colour = colour; return This(); } T& Style(wxPenStyle style) { m_style = style; return This(); } T& Stipple(const wxBitmap& stipple) { m_stipple = stipple; m_style = wxPENSTYLE_STIPPLE; return This(); } T& Dashes(int nb_dashes, const wxDash *dash) { m_nb_dashes = nb_dashes; m_dash = const_cast<wxDash*>(dash); return This(); } T& Join(wxPenJoin join) { m_join = join; return This(); } T& Cap(wxPenCap cap) { m_cap = cap; return This(); } // Accessors are mostly meant to be used by wxWidgets itself. wxColour GetColour() const { return m_colour; } wxBitmap GetStipple() const { return m_stipple; } wxPenStyle GetStyle() const { return m_style; } wxPenJoin GetJoin() const { return m_join; } wxPenCap GetCap() const { return m_cap; } int GetDashes(wxDash **ptr) const { *ptr = m_dash; return m_nb_dashes; } int GetDashCount() const { return m_nb_dashes; } wxDash* GetDash() const { return m_dash; } // Convenience bool IsTransparent() const { return m_style == wxPENSTYLE_TRANSPARENT; } protected: wxPenInfoBase(const wxColour& colour, wxPenStyle style) : m_colour(colour) { m_nb_dashes = 0; m_dash = NULL; m_join = wxJOIN_ROUND; m_cap = wxCAP_ROUND; m_style = style; } private: // Helper to return this object itself cast to its real type T. T& This() { return static_cast<T&>(*this); } wxColour m_colour; wxBitmap m_stipple; wxPenStyle m_style; wxPenJoin m_join; wxPenCap m_cap; int m_nb_dashes; wxDash* m_dash; }; #endif // _WX_PENINFOBASE_H_
h
rticonnextdds-usecases
data/projects/rticonnextdds-usecases/VehicleTracking/ExampleCode/thirdparty/wxWidgets-3.1.2/Linux/include/wx/versioninfo.h
/////////////////////////////////////////////////////////////////////////////// // Name: wx/versioninfo.h // Purpose: declaration of wxVersionInfo class // Author: Troels K // Created: 2010-11-22 // Copyright: (c) 2010 wxWidgets team // Licence: wxWindows licence /////////////////////////////////////////////////////////////////////////////// #ifndef _WX_VERSIONINFO_H_ #define _WX_VERSIONINFO_H_ #include "wx/string.h" // ---------------------------------------------------------------------------- // wxVersionInfo: represents version information // ---------------------------------------------------------------------------- class wxVersionInfo { public: wxVersionInfo(const wxString& name = wxString(), int major = 0, int minor = 0, int micro = 0, const wxString& description = wxString(), const wxString& copyright = wxString()) { m_name = name; m_major = major; m_minor = minor; m_micro = micro; m_description = description; m_copyright = copyright; } // Default copy ctor, assignment operator and dtor are ok. const wxString& GetName() const { return m_name; } int GetMajor() const { return m_major; } int GetMinor() const { return m_minor; } int GetMicro() const { return m_micro; } wxString ToString() const { return HasDescription() ? GetDescription() : GetVersionString(); } wxString GetVersionString() const { wxString str; str << m_name << ' ' << GetMajor() << '.' << GetMinor(); if ( GetMicro() ) str << '.' << GetMicro(); return str; } bool HasDescription() const { return !m_description.empty(); } const wxString& GetDescription() const { return m_description; } bool HasCopyright() const { return !m_copyright.empty(); } const wxString& GetCopyright() const { return m_copyright; } private: wxString m_name, m_description, m_copyright; int m_major, m_minor, m_micro; }; #endif // _WX_VERSIONINFO_H_
h
rticonnextdds-usecases
data/projects/rticonnextdds-usecases/VehicleTracking/ExampleCode/thirdparty/wxWidgets-3.1.2/Linux/include/wx/ptr_shrd.h
/////////////////////////////////////////////////////////////////////////////// // Name: wx/ptr_shrd.h // Purpose: compatibility wrapper for wx/sharedptr.h // Author: Vadim Zeitlin // Created: 2009-02-03 // Copyright: (c) 2009 Vadim Zeitlin <[email protected]> // Licence: wxWindows licence /////////////////////////////////////////////////////////////////////////////// // do not include this file in any new code, include wx/sharedptr.h instead #include "wx/sharedptr.h"
h
rticonnextdds-usecases
data/projects/rticonnextdds-usecases/VehicleTracking/ExampleCode/thirdparty/wxWidgets-3.1.2/Linux/include/wx/log.h
///////////////////////////////////////////////////////////////////////////// // Name: wx/log.h // Purpose: Assorted wxLogXXX functions, and wxLog (sink for logs) // Author: Vadim Zeitlin // Modified by: // Created: 29/01/98 // Copyright: (c) 1998 Vadim Zeitlin <[email protected]> // Licence: wxWindows licence ///////////////////////////////////////////////////////////////////////////// #ifndef _WX_LOG_H_ #define _WX_LOG_H_ #include "wx/defs.h" #include "wx/cpp.h" // ---------------------------------------------------------------------------- // types // ---------------------------------------------------------------------------- // NB: this is needed even if wxUSE_LOG == 0 typedef unsigned long wxLogLevel; // the trace masks have been superseded by symbolic trace constants, they're // for compatibility only and will be removed soon - do NOT use them #if WXWIN_COMPATIBILITY_2_8 #define wxTraceMemAlloc 0x0001 // trace memory allocation (new/delete) #define wxTraceMessages 0x0002 // trace window messages/X callbacks #define wxTraceResAlloc 0x0004 // trace GDI resource allocation #define wxTraceRefCount 0x0008 // trace various ref counting operations #ifdef __WINDOWS__ #define wxTraceOleCalls 0x0100 // OLE interface calls #endif typedef unsigned long wxTraceMask; #endif // WXWIN_COMPATIBILITY_2_8 // ---------------------------------------------------------------------------- // headers // ---------------------------------------------------------------------------- #include "wx/string.h" #include "wx/strvararg.h" // ---------------------------------------------------------------------------- // forward declarations // ---------------------------------------------------------------------------- class WXDLLIMPEXP_FWD_BASE wxObject; #if wxUSE_GUI class WXDLLIMPEXP_FWD_CORE wxFrame; #endif // wxUSE_GUI #if wxUSE_LOG #include "wx/arrstr.h" #include <time.h> // for time_t #include "wx/dynarray.h" #include "wx/hashmap.h" #include "wx/msgout.h" #if wxUSE_THREADS #include "wx/thread.h" #endif // wxUSE_THREADS // wxUSE_LOG_DEBUG enables the debug log messages #ifndef wxUSE_LOG_DEBUG #if wxDEBUG_LEVEL #define wxUSE_LOG_DEBUG 1 #else // !wxDEBUG_LEVEL #define wxUSE_LOG_DEBUG 0 #endif #endif // wxUSE_LOG_TRACE enables the trace messages, they are disabled by default #ifndef wxUSE_LOG_TRACE #if wxDEBUG_LEVEL #define wxUSE_LOG_TRACE 1 #else // !wxDEBUG_LEVEL #define wxUSE_LOG_TRACE 0 #endif #endif // wxUSE_LOG_TRACE // wxLOG_COMPONENT identifies the component which generated the log record and // can be #define'd to a user-defined value when compiling the user code to use // component-based filtering (see wxLog::SetComponentLevel()) #ifndef wxLOG_COMPONENT // this is a variable and not a macro in order to allow the user code to // just #define wxLOG_COMPONENT without #undef'ining it first extern WXDLLIMPEXP_DATA_BASE(const char *) wxLOG_COMPONENT; #ifdef WXBUILDING #define wxLOG_COMPONENT "wx" #endif #endif // ---------------------------------------------------------------------------- // constants // ---------------------------------------------------------------------------- // different standard log levels (you may also define your own) enum wxLogLevelValues { wxLOG_FatalError, // program can't continue, abort immediately wxLOG_Error, // a serious error, user must be informed about it wxLOG_Warning, // user is normally informed about it but may be ignored wxLOG_Message, // normal message (i.e. normal output of a non GUI app) wxLOG_Status, // informational: might go to the status line of GUI app wxLOG_Info, // informational message (a.k.a. 'Verbose') wxLOG_Debug, // never shown to the user, disabled in release mode wxLOG_Trace, // trace messages are also only enabled in debug mode wxLOG_Progress, // used for progress indicator (not yet) wxLOG_User = 100, // user defined levels start here wxLOG_Max = 10000 }; // symbolic trace masks - wxLogTrace("foo", "some trace message...") will be // discarded unless the string "foo" has been added to the list of allowed // ones with AddTraceMask() #define wxTRACE_MemAlloc wxT("memalloc") // trace memory allocation (new/delete) #define wxTRACE_Messages wxT("messages") // trace window messages/X callbacks #define wxTRACE_ResAlloc wxT("resalloc") // trace GDI resource allocation #define wxTRACE_RefCount wxT("refcount") // trace various ref counting operations #ifdef __WINDOWS__ #define wxTRACE_OleCalls wxT("ole") // OLE interface calls #endif #include "wx/iosfwrap.h" // ---------------------------------------------------------------------------- // information about a log record, i.e. unit of log output // ---------------------------------------------------------------------------- class wxLogRecordInfo { public: // default ctor creates an uninitialized object wxLogRecordInfo() { memset(this, 0, sizeof(*this)); } // normal ctor, used by wxLogger specifies the location of the log // statement; its time stamp and thread id are set up here wxLogRecordInfo(const char *filename_, int line_, const char *func_, const char *component_) { filename = filename_; func = func_; line = line_; component = component_; // don't initialize the timestamp yet, we might not need it at all if // the message doesn't end up being logged and otherwise we'll fill it // just before logging it, which won't change it by much and definitely // less than a second resolution of the timestamp timestamp = 0; #if wxUSE_THREADS threadId = wxThread::GetCurrentId(); #endif // wxUSE_THREADS m_data = NULL; } // we need to define copy ctor and assignment operator because of m_data wxLogRecordInfo(const wxLogRecordInfo& other) { Copy(other); } wxLogRecordInfo& operator=(const wxLogRecordInfo& other) { if ( &other != this ) { delete m_data; Copy(other); } return *this; } // dtor is non-virtual, this class is not meant to be derived from ~wxLogRecordInfo() { delete m_data; } // the file name and line number of the file where the log record was // generated, if available or NULL and 0 otherwise const char *filename; int line; // the name of the function where the log record was generated (may be NULL // if the compiler doesn't support __FUNCTION__) const char *func; // the name of the component which generated this message, may be NULL if // not set (i.e. wxLOG_COMPONENT not defined) const char *component; // time of record generation time_t timestamp; #if wxUSE_THREADS // id of the thread which logged this record wxThreadIdType threadId; #endif // wxUSE_THREADS // store an arbitrary value in this record context // // wxWidgets always uses keys starting with "wx.", e.g. "wx.sys_error" void StoreValue(const wxString& key, wxUIntPtr val) { if ( !m_data ) m_data = new ExtraData; m_data->numValues[key] = val; } void StoreValue(const wxString& key, const wxString& val) { if ( !m_data ) m_data = new ExtraData; m_data->strValues[key] = val; } // these functions retrieve the value of either numeric or string key, // return false if not found bool GetNumValue(const wxString& key, wxUIntPtr *val) const { if ( !m_data ) return false; const wxStringToNumHashMap::const_iterator it = m_data->numValues.find(key); if ( it == m_data->numValues.end() ) return false; *val = it->second; return true; } bool GetStrValue(const wxString& key, wxString *val) const { if ( !m_data ) return false; const wxStringToStringHashMap::const_iterator it = m_data->strValues.find(key); if ( it == m_data->strValues.end() ) return false; *val = it->second; return true; } private: void Copy(const wxLogRecordInfo& other) { memcpy(this, &other, sizeof(*this)); if ( other.m_data ) m_data = new ExtraData(*other.m_data); } // extra data associated with the log record: this is completely optional // and can be used to pass information from the log function to the log // sink (e.g. wxLogSysError() uses this to pass the error code) struct ExtraData { wxStringToNumHashMap numValues; wxStringToStringHashMap strValues; }; // NULL if not used ExtraData *m_data; }; #define wxLOG_KEY_TRACE_MASK "wx.trace_mask" // ---------------------------------------------------------------------------- // log record: a unit of log output // ---------------------------------------------------------------------------- struct wxLogRecord { wxLogRecord(wxLogLevel level_, const wxString& msg_, const wxLogRecordInfo& info_) : level(level_), msg(msg_), info(info_) { } wxLogLevel level; wxString msg; wxLogRecordInfo info; }; // ---------------------------------------------------------------------------- // Derive from this class to customize format of log messages. // ---------------------------------------------------------------------------- class WXDLLIMPEXP_BASE wxLogFormatter { public: // Default constructor. wxLogFormatter() { } // Trivial but virtual destructor for the base class. virtual ~wxLogFormatter() { } // Override this method to implement custom formatting of the given log // record. The default implementation simply prepends a level-dependent // prefix to the message and optionally adds a time stamp. virtual wxString Format(wxLogLevel level, const wxString& msg, const wxLogRecordInfo& info) const; protected: // Override this method to change just the time stamp formatting. It is // called by default Format() implementation. virtual wxString FormatTime(time_t t) const; }; // ---------------------------------------------------------------------------- // derive from this class to redirect (or suppress, or ...) log messages // normally, only a single instance of this class exists but it's not enforced // ---------------------------------------------------------------------------- class WXDLLIMPEXP_BASE wxLog { public: // ctor wxLog() : m_formatter(new wxLogFormatter) { } // make dtor virtual for all derived classes virtual ~wxLog(); // log messages selection // ---------------------- // these functions allow to completely disable all log messages or disable // log messages at level less important than specified for the current // thread // is logging enabled at all now? static bool IsEnabled() { #if wxUSE_THREADS if ( !wxThread::IsMain() ) return IsThreadLoggingEnabled(); #endif // wxUSE_THREADS return ms_doLog; } // change the flag state, return the previous one static bool EnableLogging(bool enable = true) { #if wxUSE_THREADS if ( !wxThread::IsMain() ) return EnableThreadLogging(enable); #endif // wxUSE_THREADS const bool doLogOld = ms_doLog; ms_doLog = enable; return doLogOld; } // return the current global log level static wxLogLevel GetLogLevel() { return ms_logLevel; } // set global log level: messages with level > logLevel will not be logged static void SetLogLevel(wxLogLevel logLevel) { ms_logLevel = logLevel; } // set the log level for the given component static void SetComponentLevel(const wxString& component, wxLogLevel level); // return the effective log level for this component, falling back to // parent component and to the default global log level if necessary // // NB: component argument is passed by value and not const reference in an // attempt to encourage compiler to avoid an extra copy: as we modify // the component internally, we'd create one anyhow and like this it // can be avoided if the string is a temporary anyhow static wxLogLevel GetComponentLevel(wxString component); // is logging of messages from this component enabled at this level? // // usually always called with wxLOG_COMPONENT as second argument static bool IsLevelEnabled(wxLogLevel level, wxString component) { return IsEnabled() && level <= GetComponentLevel(component); } // enable/disable messages at wxLOG_Verbose level (only relevant if the // current log level is greater or equal to it) // // notice that verbose mode can be activated by the standard command-line // '--verbose' option static void SetVerbose(bool bVerbose = true) { ms_bVerbose = bVerbose; } // check if verbose messages are enabled static bool GetVerbose() { return ms_bVerbose; } // message buffering // ----------------- // flush shows all messages if they're not logged immediately (FILE // and iostream logs don't need it, but wxLogGui does to avoid showing // 17 modal dialogs one after another) virtual void Flush(); // flush the active target if any and also output any pending messages from // background threads static void FlushActive(); // only one sink is active at each moment get current log target, will call // wxAppTraits::CreateLogTarget() to create one if none exists static wxLog *GetActiveTarget(); // change log target, logger may be NULL static wxLog *SetActiveTarget(wxLog *logger); #if wxUSE_THREADS // change log target for the current thread only, shouldn't be called from // the main thread as it doesn't use thread-specific log target static wxLog *SetThreadActiveTarget(wxLog *logger); #endif // wxUSE_THREADS // suspend the message flushing of the main target until the next call // to Resume() - this is mainly for internal use (to prevent wxYield() // from flashing the messages) static void Suspend() { ms_suspendCount++; } // must be called for each Suspend()! static void Resume() { ms_suspendCount--; } // should GetActiveTarget() try to create a new log object if the // current is NULL? static void DontCreateOnDemand(); // Make GetActiveTarget() create a new log object again. static void DoCreateOnDemand(); // log the count of repeating messages instead of logging the messages // multiple times static void SetRepetitionCounting(bool bRepetCounting = true) { ms_bRepetCounting = bRepetCounting; } // gets duplicate counting status static bool GetRepetitionCounting() { return ms_bRepetCounting; } // add string trace mask static void AddTraceMask(const wxString& str); // add string trace mask static void RemoveTraceMask(const wxString& str); // remove all string trace masks static void ClearTraceMasks(); // get string trace masks: note that this is MT-unsafe if other threads can // call AddTraceMask() concurrently static const wxArrayString& GetTraceMasks(); // is this trace mask in the list? static bool IsAllowedTraceMask(const wxString& mask); // log formatting // ----------------- // Change wxLogFormatter object used by wxLog to format the log messages. // // wxLog takes ownership of the pointer passed in but the caller is // responsible for deleting the returned pointer. wxLogFormatter* SetFormatter(wxLogFormatter* formatter); // All the time stamp related functions below only work when the default // wxLogFormatter is being used. Defining a custom formatter overrides them // as it could use its own time stamp format or format messages without // using time stamp at all. // sets the time stamp string format: this is used as strftime() format // string for the log targets which add time stamps to the messages; set // it to empty string to disable time stamping completely. static void SetTimestamp(const wxString& ts) { ms_timestamp = ts; } // disable time stamping of log messages static void DisableTimestamp() { SetTimestamp(wxEmptyString); } // get the current timestamp format string (maybe empty) static const wxString& GetTimestamp() { return ms_timestamp; } // helpers: all functions in this section are mostly for internal use only, // don't call them from your code even if they are not formally deprecated // put the time stamp into the string if ms_timestamp is not empty (don't // change it otherwise); the first overload uses the current time. static void TimeStamp(wxString *str); static void TimeStamp(wxString *str, time_t t); // these methods should only be called from derived classes DoLogRecord(), // DoLogTextAtLevel() and DoLogText() implementations respectively and // shouldn't be called directly, use logging functions instead void LogRecord(wxLogLevel level, const wxString& msg, const wxLogRecordInfo& info) { DoLogRecord(level, msg, info); } void LogTextAtLevel(wxLogLevel level, const wxString& msg) { DoLogTextAtLevel(level, msg); } void LogText(const wxString& msg) { DoLogText(msg); } // this is a helper used by wxLogXXX() functions, don't call it directly // and see DoLog() for function to overload in the derived classes static void OnLog(wxLogLevel level, const wxString& msg, const wxLogRecordInfo& info); // version called when no information about the location of the log record // generation is available (but the time stamp is), it mainly exists for // backwards compatibility, don't use it in new code static void OnLog(wxLogLevel level, const wxString& msg, time_t t); // a helper calling the above overload with current time static void OnLog(wxLogLevel level, const wxString& msg) { OnLog(level, msg, time(NULL)); } // this method exists for backwards compatibility only, don't use bool HasPendingMessages() const { return true; } // don't use integer masks any more, use string trace masks instead #if WXWIN_COMPATIBILITY_2_8 static wxDEPRECATED_INLINE( void SetTraceMask(wxTraceMask ulMask), ms_ulTraceMask = ulMask; ) // this one can't be marked deprecated as it's used in our own wxLogger // below but it still is deprecated and shouldn't be used static wxTraceMask GetTraceMask() { return ms_ulTraceMask; } #endif // WXWIN_COMPATIBILITY_2_8 protected: // the logging functions that can be overridden: DoLogRecord() is called // for every "record", i.e. a unit of log output, to be logged and by // default formats the message and passes it to DoLogTextAtLevel() which in // turn passes it to DoLogText() by default // override this method if you want to change message formatting or do // dynamic filtering virtual void DoLogRecord(wxLogLevel level, const wxString& msg, const wxLogRecordInfo& info); // override this method to redirect output to different channels depending // on its level only; if even the level doesn't matter, override // DoLogText() instead virtual void DoLogTextAtLevel(wxLogLevel level, const wxString& msg); // this function is not pure virtual as it might not be needed if you do // the logging in overridden DoLogRecord() or DoLogTextAtLevel() directly // but if you do not override them in your derived class you must override // this one as the default implementation of it simply asserts virtual void DoLogText(const wxString& msg); // the rest of the functions are for backwards compatibility only, don't // use them in new code; if you're updating your existing code you need to // switch to overriding DoLogRecord/Text() above (although as long as these // functions exist, log classes using them will continue to work) #if WXWIN_COMPATIBILITY_2_8 wxDEPRECATED_BUT_USED_INTERNALLY( virtual void DoLog(wxLogLevel level, const char *szString, time_t t) ); wxDEPRECATED_BUT_USED_INTERNALLY( virtual void DoLog(wxLogLevel level, const wchar_t *wzString, time_t t) ); // these shouldn't be used by new code wxDEPRECATED_BUT_USED_INTERNALLY_INLINE( virtual void DoLogString(const char *WXUNUSED(szString), time_t WXUNUSED(t)), wxEMPTY_PARAMETER_VALUE ) wxDEPRECATED_BUT_USED_INTERNALLY_INLINE( virtual void DoLogString(const wchar_t *WXUNUSED(wzString), time_t WXUNUSED(t)), wxEMPTY_PARAMETER_VALUE ) #endif // WXWIN_COMPATIBILITY_2_8 // log a message indicating the number of times the previous message was // repeated if previous repetition counter is strictly positive, does // nothing otherwise; return the old value of repetition counter unsigned LogLastRepeatIfNeeded(); private: #if wxUSE_THREADS // called from FlushActive() to really log any buffered messages logged // from the other threads void FlushThreadMessages(); // these functions are called for non-main thread only by IsEnabled() and // EnableLogging() respectively static bool IsThreadLoggingEnabled(); static bool EnableThreadLogging(bool enable = true); #endif // wxUSE_THREADS // get the active log target for the main thread, auto-creating it if // necessary // // this is called from GetActiveTarget() and OnLog() when they're called // from the main thread static wxLog *GetMainThreadActiveTarget(); // called from OnLog() if it's called from the main thread or if we have a // (presumably MT-safe) thread-specific logger and by FlushThreadMessages() // when it plays back the buffered messages logged from the other threads void CallDoLogNow(wxLogLevel level, const wxString& msg, const wxLogRecordInfo& info); // variables // ---------------- wxLogFormatter *m_formatter; // We own this pointer. // static variables // ---------------- // if true, don't log the same message multiple times, only log it once // with the number of times it was repeated static bool ms_bRepetCounting; static wxLog *ms_pLogger; // currently active log sink static bool ms_doLog; // false => all logging disabled static bool ms_bAutoCreate; // create new log targets on demand? static bool ms_bVerbose; // false => ignore LogInfo messages static wxLogLevel ms_logLevel; // limit logging to levels <= ms_logLevel static size_t ms_suspendCount; // if positive, logs are not flushed // format string for strftime(), if empty, time stamping log messages is // disabled static wxString ms_timestamp; #if WXWIN_COMPATIBILITY_2_8 static wxTraceMask ms_ulTraceMask; // controls wxLogTrace behaviour #endif // WXWIN_COMPATIBILITY_2_8 }; // ---------------------------------------------------------------------------- // "trivial" derivations of wxLog // ---------------------------------------------------------------------------- // log everything except for the debug/trace messages (which are passed to // wxMessageOutputDebug) to a buffer class WXDLLIMPEXP_BASE wxLogBuffer : public wxLog { public: wxLogBuffer() { } // get the string contents with all messages logged const wxString& GetBuffer() const { return m_str; } // show the buffer contents to the user in the best possible way (this uses // wxMessageOutputMessageBox) and clear it virtual void Flush() wxOVERRIDE; protected: virtual void DoLogTextAtLevel(wxLogLevel level, const wxString& msg) wxOVERRIDE; private: wxString m_str; wxDECLARE_NO_COPY_CLASS(wxLogBuffer); }; // log everything to a "FILE *", stderr by default class WXDLLIMPEXP_BASE wxLogStderr : public wxLog, protected wxMessageOutputStderr { public: // redirect log output to a FILE wxLogStderr(FILE *fp = NULL, const wxMBConv &conv = wxConvWhateverWorks); protected: // implement sink function virtual void DoLogText(const wxString& msg) wxOVERRIDE; wxDECLARE_NO_COPY_CLASS(wxLogStderr); }; #if wxUSE_STD_IOSTREAM // log everything to an "ostream", cerr by default class WXDLLIMPEXP_BASE wxLogStream : public wxLog, private wxMessageOutputWithConv { public: // redirect log output to an ostream wxLogStream(wxSTD ostream *ostr = (wxSTD ostream *) NULL, const wxMBConv& conv = wxConvWhateverWorks); protected: // implement sink function virtual void DoLogText(const wxString& msg) wxOVERRIDE; // using ptr here to avoid including <iostream.h> from this file wxSTD ostream *m_ostr; wxDECLARE_NO_COPY_CLASS(wxLogStream); }; #endif // wxUSE_STD_IOSTREAM // ---------------------------------------------------------------------------- // /dev/null log target: suppress logging until this object goes out of scope // ---------------------------------------------------------------------------- // example of usage: /* void Foo() { wxFile file; // wxFile.Open() normally complains if file can't be opened, we don't // want it wxLogNull logNo; if ( !file.Open("bar") ) ... process error ourselves ... // ~wxLogNull called, old log sink restored } */ class WXDLLIMPEXP_BASE wxLogNull { public: wxLogNull() : m_flagOld(wxLog::EnableLogging(false)) { } ~wxLogNull() { (void)wxLog::EnableLogging(m_flagOld); } private: bool m_flagOld; // the previous value of the wxLog::ms_doLog }; // ---------------------------------------------------------------------------- // chaining log target: installs itself as a log target and passes all // messages to the real log target given to it in the ctor but also forwards // them to the previously active one // // note that you don't have to call SetActiveTarget() with this class, it // does it itself in its ctor // ---------------------------------------------------------------------------- class WXDLLIMPEXP_BASE wxLogChain : public wxLog { public: wxLogChain(wxLog *logger); virtual ~wxLogChain(); // change the new log target void SetLog(wxLog *logger); // this can be used to temporarily disable (and then reenable) passing // messages to the old logger (by default we do pass them) void PassMessages(bool bDoPass) { m_bPassMessages = bDoPass; } // are we passing the messages to the previous log target? bool IsPassingMessages() const { return m_bPassMessages; } // return the previous log target (may be NULL) wxLog *GetOldLog() const { return m_logOld; } // override base class version to flush the old logger as well virtual void Flush() wxOVERRIDE; // call to avoid destroying the old log target void DetachOldLog() { m_logOld = NULL; } protected: // pass the record to the old logger if needed virtual void DoLogRecord(wxLogLevel level, const wxString& msg, const wxLogRecordInfo& info) wxOVERRIDE; private: // the current log target wxLog *m_logNew; // the previous log target wxLog *m_logOld; // do we pass the messages to the old logger? bool m_bPassMessages; wxDECLARE_NO_COPY_CLASS(wxLogChain); }; // a chain log target which uses itself as the new logger #define wxLogPassThrough wxLogInterposer class WXDLLIMPEXP_BASE wxLogInterposer : public wxLogChain { public: wxLogInterposer(); private: wxDECLARE_NO_COPY_CLASS(wxLogInterposer); }; // a temporary interposer which doesn't destroy the old log target // (calls DetachOldLog) class WXDLLIMPEXP_BASE wxLogInterposerTemp : public wxLogChain { public: wxLogInterposerTemp(); private: wxDECLARE_NO_COPY_CLASS(wxLogInterposerTemp); }; #if wxUSE_GUI // include GUI log targets: #include "wx/generic/logg.h" #endif // wxUSE_GUI // ---------------------------------------------------------------------------- // wxLogger // ---------------------------------------------------------------------------- // wxLogger is a helper class used by wxLogXXX() functions implementation, // don't use it directly as it's experimental and subject to change (OTOH it // might become public in the future if it's deemed to be useful enough) // contains information about the context from which a log message originates // and provides Log() vararg method which forwards to wxLog::OnLog() and passes // this context to it class wxLogger { public: // ctor takes the basic information about the log record wxLogger(wxLogLevel level, const char *filename, int line, const char *func, const char *component) : m_level(level), m_info(filename, line, func, component) { } // store extra data in our log record and return this object itself (so // that further calls to its functions could be chained) template <typename T> wxLogger& Store(const wxString& key, T val) { m_info.StoreValue(key, val); return *this; } // hack for "overloaded" wxLogXXX() functions: calling this method // indicates that we may have an extra first argument preceding the format // string and that if we do have it, we should store it in m_info using the // given key (while by default 0 value will be used) wxLogger& MaybeStore(const wxString& key, wxUIntPtr value = 0) { wxASSERT_MSG( m_optKey.empty(), "can only have one optional value" ); m_optKey = key; m_info.StoreValue(key, value); return *this; } // non-vararg function used by wxVLogXXX(): // log the message at the level specified in the ctor if this log message // is enabled void LogV(const wxString& format, va_list argptr) { // remember that fatal errors can't be disabled if ( m_level == wxLOG_FatalError || wxLog::IsLevelEnabled(m_level, m_info.component) ) DoCallOnLog(format, argptr); } // overloads used by functions with optional leading arguments (whose // values are stored in the key passed to MaybeStore()) void LogV(long num, const wxString& format, va_list argptr) { Store(m_optKey, num); LogV(format, argptr); } void LogV(void *ptr, const wxString& format, va_list argptr) { Store(m_optKey, wxPtrToUInt(ptr)); LogV(format, argptr); } void LogVTrace(const wxString& mask, const wxString& format, va_list argptr) { if ( !wxLog::IsAllowedTraceMask(mask) ) return; Store(wxLOG_KEY_TRACE_MASK, mask); LogV(format, argptr); } // vararg functions used by wxLogXXX(): // will log the message at the level specified in the ctor // // notice that this function supposes that the caller already checked that // the level was enabled and does no checks itself WX_DEFINE_VARARG_FUNC_VOID ( Log, 1, (const wxFormatString&), DoLog, DoLogUtf8 ) // same as Log() but with an extra numeric or pointer parameters: this is // used to pass an optional value by storing it in m_info under the name // passed to MaybeStore() and is required to support "overloaded" versions // of wxLogStatus() and wxLogSysError() WX_DEFINE_VARARG_FUNC_VOID ( Log, 2, (long, const wxFormatString&), DoLogWithNum, DoLogWithNumUtf8 ) // unfortunately we can't use "void *" here as we get overload ambiguities // with Log(wxFormatString, ...) when the first argument is a "char *" or // "wchar_t *" then -- so we only allow passing wxObject here, which is // ugly but fine in practice as this overload is only used by wxLogStatus() // whose first argument is a wxFrame WX_DEFINE_VARARG_FUNC_VOID ( Log, 2, (wxObject *, const wxFormatString&), DoLogWithPtr, DoLogWithPtrUtf8 ) // log the message at the level specified as its first argument // // as the macros don't have access to the level argument in this case, this // function does check that the level is enabled itself WX_DEFINE_VARARG_FUNC_VOID ( LogAtLevel, 2, (wxLogLevel, const wxFormatString&), DoLogAtLevel, DoLogAtLevelUtf8 ) // special versions for wxLogTrace() which is passed either string or // integer mask as first argument determining whether the message should be // logged or not WX_DEFINE_VARARG_FUNC_VOID ( LogTrace, 2, (const wxString&, const wxFormatString&), DoLogTrace, DoLogTraceUtf8 ) #if WXWIN_COMPATIBILITY_2_8 WX_DEFINE_VARARG_FUNC_VOID ( LogTrace, 2, (wxTraceMask, const wxFormatString&), DoLogTraceMask, DoLogTraceMaskUtf8 ) #endif // WXWIN_COMPATIBILITY_2_8 private: #if !wxUSE_UTF8_LOCALE_ONLY void DoLog(const wxChar *format, ...) { va_list argptr; va_start(argptr, format); DoCallOnLog(format, argptr); va_end(argptr); } void DoLogWithNum(long num, const wxChar *format, ...) { Store(m_optKey, num); va_list argptr; va_start(argptr, format); DoCallOnLog(format, argptr); va_end(argptr); } void DoLogWithPtr(void *ptr, const wxChar *format, ...) { Store(m_optKey, wxPtrToUInt(ptr)); va_list argptr; va_start(argptr, format); DoCallOnLog(format, argptr); va_end(argptr); } void DoLogAtLevel(wxLogLevel level, const wxChar *format, ...) { if ( !wxLog::IsLevelEnabled(level, m_info.component) ) return; va_list argptr; va_start(argptr, format); DoCallOnLog(level, format, argptr); va_end(argptr); } void DoLogTrace(const wxString& mask, const wxChar *format, ...) { if ( !wxLog::IsAllowedTraceMask(mask) ) return; Store(wxLOG_KEY_TRACE_MASK, mask); va_list argptr; va_start(argptr, format); DoCallOnLog(format, argptr); va_end(argptr); } #if WXWIN_COMPATIBILITY_2_8 void DoLogTraceMask(wxTraceMask mask, const wxChar *format, ...) { if ( (wxLog::GetTraceMask() & mask) != mask ) return; Store(wxLOG_KEY_TRACE_MASK, mask); va_list argptr; va_start(argptr, format); DoCallOnLog(format, argptr); va_end(argptr); } #endif // WXWIN_COMPATIBILITY_2_8 #endif // !wxUSE_UTF8_LOCALE_ONLY #if wxUSE_UNICODE_UTF8 void DoLogUtf8(const char *format, ...) { va_list argptr; va_start(argptr, format); DoCallOnLog(format, argptr); va_end(argptr); } void DoLogWithNumUtf8(long num, const char *format, ...) { Store(m_optKey, num); va_list argptr; va_start(argptr, format); DoCallOnLog(format, argptr); va_end(argptr); } void DoLogWithPtrUtf8(void *ptr, const char *format, ...) { Store(m_optKey, wxPtrToUInt(ptr)); va_list argptr; va_start(argptr, format); DoCallOnLog(format, argptr); va_end(argptr); } void DoLogAtLevelUtf8(wxLogLevel level, const char *format, ...) { if ( !wxLog::IsLevelEnabled(level, m_info.component) ) return; va_list argptr; va_start(argptr, format); DoCallOnLog(level, format, argptr); va_end(argptr); } void DoLogTraceUtf8(const wxString& mask, const char *format, ...) { if ( !wxLog::IsAllowedTraceMask(mask) ) return; Store(wxLOG_KEY_TRACE_MASK, mask); va_list argptr; va_start(argptr, format); DoCallOnLog(format, argptr); va_end(argptr); } #if WXWIN_COMPATIBILITY_2_8 void DoLogTraceMaskUtf8(wxTraceMask mask, const char *format, ...) { if ( (wxLog::GetTraceMask() & mask) != mask ) return; Store(wxLOG_KEY_TRACE_MASK, mask); va_list argptr; va_start(argptr, format); DoCallOnLog(format, argptr); va_end(argptr); } #endif // WXWIN_COMPATIBILITY_2_8 #endif // wxUSE_UNICODE_UTF8 void DoCallOnLog(wxLogLevel level, const wxString& format, va_list argptr) { // As explained in wxLogRecordInfo ctor, we don't initialize its // timestamp to avoid calling time() unnecessary, but now that we are // about to log the message, we do need to do it. m_info.timestamp = time(NULL); wxLog::OnLog(level, wxString::FormatV(format, argptr), m_info); } void DoCallOnLog(const wxString& format, va_list argptr) { DoCallOnLog(m_level, format, argptr); } const wxLogLevel m_level; wxLogRecordInfo m_info; wxString m_optKey; wxDECLARE_NO_COPY_CLASS(wxLogger); }; // ============================================================================ // global functions // ============================================================================ // ---------------------------------------------------------------------------- // get error code/error message from system in a portable way // ---------------------------------------------------------------------------- // return the last system error code WXDLLIMPEXP_BASE unsigned long wxSysErrorCode(); // return the error message for given (or last if 0) error code WXDLLIMPEXP_BASE const wxChar* wxSysErrorMsg(unsigned long nErrCode = 0); // return the error message for given (or last if 0) error code WXDLLIMPEXP_BASE wxString wxSysErrorMsgStr(unsigned long nErrCode = 0); // ---------------------------------------------------------------------------- // define wxLog<level>() functions which can be used by application instead of // stdio, iostream &c for log messages for easy redirection // ---------------------------------------------------------------------------- /* The code below is unreadable because it (unfortunately unavoidably) contains a lot of macro magic but all it does is to define wxLogXXX() such that you can call them as vararg functions to log a message at the corresponding level. More precisely, it defines: - wxLog{FatalError,Error,Warning,Message,Verbose,Debug}() functions taking the format string and additional vararg arguments if needed. - wxLogGeneric(wxLogLevel level, const wxString& format, ...) which takes the log level explicitly. - wxLogSysError(const wxString& format, ...) and wxLogSysError(long err, const wxString& format, ...) which log a wxLOG_Error severity message with the error message corresponding to the system error code err or the last error. - wxLogStatus(const wxString& format, ...) which logs the message into the status bar of the main application window and its overload wxLogStatus(wxFrame *frame, const wxString& format, ...) which logs it into the status bar of the specified frame. - wxLogTrace(Mask mask, const wxString& format, ...) which only logs the message is the specified mask is enabled. This comes in two kinds: Mask can be a wxString or a long. Both are deprecated. In addition, wxVLogXXX() versions of all the functions above are also defined. They take a va_list argument instead of "...". */ // creates wxLogger object for the current location #define wxMAKE_LOGGER(level) \ wxLogger(wxLOG_##level, __FILE__, __LINE__, __WXFUNCTION__, wxLOG_COMPONENT) // this macro generates the expression which logs whatever follows it in // parentheses at the level specified as argument #define wxDO_LOG(level) wxMAKE_LOGGER(level).Log // this is the non-vararg equivalent #define wxDO_LOGV(level, format, argptr) \ wxMAKE_LOGGER(level).LogV(format, argptr) // this macro declares wxLog<level>() macro which logs whatever follows it if // logging at specified level is enabled (notice that if it is false, the // following arguments are not even evaluated which is good as it avoids // unnecessary overhead) // // Note: the strange (because executing at most once) for() loop because we // must arrange for wxDO_LOG() to be at the end of the macro and using a // more natural "if (IsLevelEnabled()) wxDO_LOG()" would result in wrong // behaviour for the following code ("else" would bind to the wrong "if"): // // if ( cond ) // wxLogError("!!!"); // else // ... // // See also #11829 for the problems with other simpler approaches, // notably the need for two macros due to buggy __LINE__ in MSVC. #define wxDO_LOG_IF_ENABLED_HELPER(level, loopvar) \ for ( bool loopvar = false; \ !loopvar && wxLog::IsLevelEnabled(wxLOG_##level, wxLOG_COMPONENT); \ loopvar = true ) \ wxDO_LOG(level) #define wxDO_LOG_IF_ENABLED(level) \ wxDO_LOG_IF_ENABLED_HELPER(level, wxMAKE_UNIQUE_NAME(wxlogcheck)) // wxLogFatalError() is special as it can't be disabled #define wxLogFatalError wxDO_LOG(FatalError) #define wxVLogFatalError(format, argptr) wxDO_LOGV(FatalError, format, argptr) #define wxLogError wxDO_LOG_IF_ENABLED(Error) #define wxVLogError(format, argptr) wxDO_LOGV(Error, format, argptr) #define wxLogWarning wxDO_LOG_IF_ENABLED(Warning) #define wxVLogWarning(format, argptr) wxDO_LOGV(Warning, format, argptr) #define wxLogMessage wxDO_LOG_IF_ENABLED(Message) #define wxVLogMessage(format, argptr) wxDO_LOGV(Message, format, argptr) #define wxLogInfo wxDO_LOG_IF_ENABLED(Info) #define wxVLogInfo(format, argptr) wxDO_LOGV(Info, format, argptr) // this one is special as it only logs if we're in verbose mode #define wxLogVerbose \ if ( !(wxLog::IsLevelEnabled(wxLOG_Info, wxLOG_COMPONENT) && \ wxLog::GetVerbose()) ) \ {} \ else \ wxDO_LOG(Info) #define wxVLogVerbose(format, argptr) \ if ( !(wxLog::IsLevelEnabled(wxLOG_Info, wxLOG_COMPONENT) && \ wxLog::GetVerbose()) ) \ {} \ else \ wxDO_LOGV(Info, format, argptr) // another special case: the level is passed as first argument of the function // and so is not available to the macro // // notice that because of this, arguments of wxLogGeneric() are currently // always evaluated, unlike for the other log functions #define wxLogGeneric wxMAKE_LOGGER(Max).LogAtLevel #define wxVLogGeneric(level, format, argptr) \ if ( !wxLog::IsLevelEnabled(wxLOG_##level, wxLOG_COMPONENT) ) \ {} \ else \ wxDO_LOGV(level, format, argptr) // wxLogSysError() needs to stash the error code value in the log record info // so it needs special handling too; additional complications arise because the // error code may or not be present as the first argument // // notice that we unfortunately can't avoid the call to wxSysErrorCode() even // though it may be unneeded if an explicit error code is passed to us because // the message might not be logged immediately (e.g. it could be queued for // logging from the main thread later) and so we can't to wait until it is // logged to determine whether we have last error or not as it will be too late // and it will have changed already by then (in fact it even changes when // wxString::Format() is called because of vsnprintf() inside it so it can // change even much sooner) #define wxLOG_KEY_SYS_ERROR_CODE "wx.sys_error" #define wxLogSysError \ if ( !wxLog::IsLevelEnabled(wxLOG_Error, wxLOG_COMPONENT) ) \ {} \ else \ wxMAKE_LOGGER(Error).MaybeStore(wxLOG_KEY_SYS_ERROR_CODE, \ wxSysErrorCode()).Log // unfortunately we can't have overloaded macros so we can't define versions // both with and without error code argument and have to rely on LogV() // overloads in wxLogger to select between them #define wxVLogSysError \ wxMAKE_LOGGER(Error).MaybeStore(wxLOG_KEY_SYS_ERROR_CODE, \ wxSysErrorCode()).LogV #if wxUSE_GUI // wxLogStatus() is similar to wxLogSysError() as it allows to optionally // specify the frame to which the message should go #define wxLOG_KEY_FRAME "wx.frame" #define wxLogStatus \ if ( !wxLog::IsLevelEnabled(wxLOG_Status, wxLOG_COMPONENT) ) \ {} \ else \ wxMAKE_LOGGER(Status).MaybeStore(wxLOG_KEY_FRAME).Log #define wxVLogStatus \ wxMAKE_LOGGER(Status).MaybeStore(wxLOG_KEY_FRAME).LogV #endif // wxUSE_GUI #else // !wxUSE_LOG #undef wxUSE_LOG_DEBUG #define wxUSE_LOG_DEBUG 0 #undef wxUSE_LOG_TRACE #define wxUSE_LOG_TRACE 0 // define macros for defining log functions which do nothing at all #define wxDEFINE_EMPTY_LOG_FUNCTION(level) \ WX_DEFINE_VARARG_FUNC_NOP(wxLog##level, 1, (const wxFormatString&)) \ inline void wxVLog##level(const wxFormatString& WXUNUSED(format), \ va_list WXUNUSED(argptr)) { } \ #define wxDEFINE_EMPTY_LOG_FUNCTION2(level, argclass) \ WX_DEFINE_VARARG_FUNC_NOP(wxLog##level, 2, (argclass, const wxFormatString&)) \ inline void wxVLog##level(argclass WXUNUSED(arg), \ const wxFormatString& WXUNUSED(format), \ va_list WXUNUSED(argptr)) {} wxDEFINE_EMPTY_LOG_FUNCTION(FatalError); wxDEFINE_EMPTY_LOG_FUNCTION(Error); wxDEFINE_EMPTY_LOG_FUNCTION(SysError); wxDEFINE_EMPTY_LOG_FUNCTION2(SysError, long); wxDEFINE_EMPTY_LOG_FUNCTION(Warning); wxDEFINE_EMPTY_LOG_FUNCTION(Message); wxDEFINE_EMPTY_LOG_FUNCTION(Info); wxDEFINE_EMPTY_LOG_FUNCTION(Verbose); wxDEFINE_EMPTY_LOG_FUNCTION2(Generic, wxLogLevel); #if wxUSE_GUI wxDEFINE_EMPTY_LOG_FUNCTION(Status); wxDEFINE_EMPTY_LOG_FUNCTION2(Status, wxFrame *); #endif // wxUSE_GUI // Empty Class to fake wxLogNull class WXDLLIMPEXP_BASE wxLogNull { public: wxLogNull() { } }; // Dummy macros to replace some functions. #define wxSysErrorCode() (unsigned long)0 #define wxSysErrorMsg( X ) (const wxChar*)NULL #define wxSysErrorMsgStr( X ) wxEmptyString // Fake symbolic trace masks... for those that are used frequently #define wxTRACE_OleCalls wxEmptyString // OLE interface calls #endif // wxUSE_LOG/!wxUSE_LOG // debug functions can be completely disabled in optimized builds // if these log functions are disabled, we prefer to define them as (empty) // variadic macros as this completely removes them and their argument // evaluation from the object code but if this is not supported by compiler we // use empty inline functions instead (defining them as nothing would result in // compiler warnings) // // note that making wxVLogDebug/Trace() themselves (empty inline) functions is // a bad idea as some compilers are stupid enough to not inline even empty // functions if their parameters are complicated enough, but by defining them // as an empty inline function we ensure that even dumbest compilers optimise // them away #ifdef __BORLANDC__ // but Borland gives "W8019: Code has no effect" for wxLogNop() so we need // to define it differently for it to avoid these warnings (same problem as // with wxUnusedVar()) #define wxLogNop() { } #else inline void wxLogNop() { } #endif #if wxUSE_LOG_DEBUG #define wxLogDebug wxDO_LOG_IF_ENABLED(Debug) #define wxVLogDebug(format, argptr) wxDO_LOGV(Debug, format, argptr) #else // !wxUSE_LOG_DEBUG #define wxVLogDebug(fmt, valist) wxLogNop() #ifdef HAVE_VARIADIC_MACROS #define wxLogDebug(fmt, ...) wxLogNop() #else // !HAVE_VARIADIC_MACROS WX_DEFINE_VARARG_FUNC_NOP(wxLogDebug, 1, (const wxFormatString&)) #endif #endif // wxUSE_LOG_DEBUG/!wxUSE_LOG_DEBUG #if wxUSE_LOG_TRACE #define wxLogTrace \ if ( !wxLog::IsLevelEnabled(wxLOG_Trace, wxLOG_COMPONENT) ) \ {} \ else \ wxMAKE_LOGGER(Trace).LogTrace #define wxVLogTrace \ if ( !wxLog::IsLevelEnabled(wxLOG_Trace, wxLOG_COMPONENT) ) \ {} \ else \ wxMAKE_LOGGER(Trace).LogVTrace #else // !wxUSE_LOG_TRACE #define wxVLogTrace(mask, fmt, valist) wxLogNop() #ifdef HAVE_VARIADIC_MACROS #define wxLogTrace(mask, fmt, ...) wxLogNop() #else // !HAVE_VARIADIC_MACROS #if WXWIN_COMPATIBILITY_2_8 WX_DEFINE_VARARG_FUNC_NOP(wxLogTrace, 2, (wxTraceMask, const wxFormatString&)) #endif WX_DEFINE_VARARG_FUNC_NOP(wxLogTrace, 2, (const wxString&, const wxFormatString&)) #endif // HAVE_VARIADIC_MACROS/!HAVE_VARIADIC_MACROS #endif // wxUSE_LOG_TRACE/!wxUSE_LOG_TRACE // wxLogFatalError helper: show the (fatal) error to the user in a safe way, // i.e. without using wxMessageBox() for example because it could crash void WXDLLIMPEXP_BASE wxSafeShowMessage(const wxString& title, const wxString& text); // ---------------------------------------------------------------------------- // debug only logging functions: use them with API name and error code // ---------------------------------------------------------------------------- #if wxUSE_LOG_DEBUG // make life easier for people using VC++ IDE: clicking on the message // will take us immediately to the place of the failed API #ifdef __VISUALC__ #define wxLogApiError(api, rc) \ wxLogDebug(wxT("%s(%d): '%s' failed with error 0x%08lx (%s)."), \ __FILE__, __LINE__, api, \ (long)rc, wxSysErrorMsgStr(rc)) #else // !VC++ #define wxLogApiError(api, rc) \ wxLogDebug(wxT("In file %s at line %d: '%s' failed with ") \ wxT("error 0x%08lx (%s)."), \ __FILE__, __LINE__, api, \ (long)rc, wxSysErrorMsgStr(rc)) #endif // VC++/!VC++ #define wxLogLastError(api) wxLogApiError(api, wxSysErrorCode()) #else // !wxUSE_LOG_DEBUG #define wxLogApiError(api, err) wxLogNop() #define wxLogLastError(api) wxLogNop() #endif // wxUSE_LOG_DEBUG/!wxUSE_LOG_DEBUG // macro which disables debug logging in release builds: this is done by // default by wxIMPLEMENT_APP() so usually it doesn't need to be used explicitly #if defined(NDEBUG) && wxUSE_LOG_DEBUG #define wxDISABLE_DEBUG_LOGGING_IN_RELEASE_BUILD() \ wxLog::SetLogLevel(wxLOG_Info) #else // !NDEBUG #define wxDISABLE_DEBUG_LOGGING_IN_RELEASE_BUILD() #endif // NDEBUG/!NDEBUG #endif // _WX_LOG_H_
h
rticonnextdds-usecases
data/projects/rticonnextdds-usecases/VehicleTracking/ExampleCode/thirdparty/wxWidgets-3.1.2/Linux/include/wx/ioswrap.h
/////////////////////////////////////////////////////////////////////////////// // Name: wx/ioswrap.h // Purpose: includes the correct iostream headers for current compiler // Author: Vadim Zeitlin // Modified by: // Created: 03.02.99 // Copyright: (c) 1998 Vadim Zeitlin <[email protected]> // Licence: wxWindows licence /////////////////////////////////////////////////////////////////////////////// #if wxUSE_STD_IOSTREAM #include "wx/beforestd.h" #if wxUSE_IOSTREAMH # include <iostream.h> #else # include <iostream> #endif #include "wx/afterstd.h" #ifdef __WINDOWS__ # include "wx/msw/winundef.h" #endif #endif // wxUSE_STD_IOSTREAM
h
rticonnextdds-usecases
data/projects/rticonnextdds-usecases/VehicleTracking/ExampleCode/thirdparty/wxWidgets-3.1.2/Linux/include/wx/bmpcbox.h
///////////////////////////////////////////////////////////////////////////// // Name: wx/bmpcbox.h // Purpose: wxBitmapComboBox base header // Author: Jaakko Salli // Modified by: // Created: Aug-31-2006 // Copyright: (c) Jaakko Salli // Licence: wxWindows licence ///////////////////////////////////////////////////////////////////////////// #ifndef _WX_BMPCBOX_H_BASE_ #define _WX_BMPCBOX_H_BASE_ #include "wx/defs.h" #if wxUSE_BITMAPCOMBOBOX #include "wx/bitmap.h" #include "wx/dynarray.h" class WXDLLIMPEXP_FWD_CORE wxWindow; class WXDLLIMPEXP_FWD_CORE wxItemContainer; // Define wxBITMAPCOMBOBOX_OWNERDRAWN_BASED for platforms which // wxBitmapComboBox implementation utilizes ownerdrawn combobox // (either native or generic). #if !defined(__WXGTK20__) || defined(__WXUNIVERSAL__) #define wxBITMAPCOMBOBOX_OWNERDRAWN_BASED class WXDLLIMPEXP_FWD_CORE wxDC; #endif extern WXDLLIMPEXP_DATA_CORE(const char) wxBitmapComboBoxNameStr[]; class WXDLLIMPEXP_CORE wxBitmapComboBoxBase { public: // ctors and such wxBitmapComboBoxBase() { Init(); } virtual ~wxBitmapComboBoxBase() { } // Sets the image for the given item. virtual void SetItemBitmap(unsigned int n, const wxBitmap& bitmap) = 0; #if !defined(wxBITMAPCOMBOBOX_OWNERDRAWN_BASED) // Returns the image of the item with the given index. virtual wxBitmap GetItemBitmap(unsigned int n) const = 0; // Returns size of the image used in list virtual wxSize GetBitmapSize() const = 0; private: void Init() {} #else // wxBITMAPCOMBOBOX_OWNERDRAWN_BASED // Returns the image of the item with the given index. virtual wxBitmap GetItemBitmap(unsigned int n) const; // Returns size of the image used in list virtual wxSize GetBitmapSize() const { return m_usedImgSize; } protected: // Returns pointer to the combobox item container virtual wxItemContainer* GetItemContainer() = 0; // Return pointer to the owner-drawn combobox control virtual wxWindow* GetControl() = 0; // wxItemContainer functions void BCBDoClear(); void BCBDoDeleteOneItem(unsigned int n); void DoSetItemBitmap(unsigned int n, const wxBitmap& bitmap); void DrawBackground(wxDC& dc, const wxRect& rect, int item, int flags) const; void DrawItem(wxDC& dc, const wxRect& rect, int item, const wxString& text, int flags) const; wxCoord MeasureItem(size_t item) const; // Returns true if image size was affected virtual bool OnAddBitmap(const wxBitmap& bitmap); // Recalculates amount of empty space needed in front of text // in control itself. Returns number that can be passed to // wxOwnerDrawnComboBox::SetCustomPaintWidth() and similar // functions. virtual int DetermineIndent(); void UpdateInternals(); wxArrayPtrVoid m_bitmaps; // Images associated with items wxSize m_usedImgSize; // Size of bitmaps int m_imgAreaWidth; // Width and height of area next to text field int m_fontHeight; int m_indent; private: void Init(); #endif // !wxBITMAPCOMBOBOX_OWNERDRAWN_BASED/wxBITMAPCOMBOBOX_OWNERDRAWN_BASED }; #if defined(__WXUNIVERSAL__) #include "wx/generic/bmpcbox.h" #elif defined(__WXMSW__) #include "wx/msw/bmpcbox.h" #elif defined(__WXGTK20__) #include "wx/gtk/bmpcbox.h" #else #include "wx/generic/bmpcbox.h" #endif #endif // wxUSE_BITMAPCOMBOBOX #endif // _WX_BMPCBOX_H_BASE_
h
rticonnextdds-usecases
data/projects/rticonnextdds-usecases/VehicleTracking/ExampleCode/thirdparty/wxWidgets-3.1.2/Linux/include/wx/dataobj.h
/////////////////////////////////////////////////////////////////////////////// // Name: wx/dataobj.h // Purpose: common data object classes // Author: Vadim Zeitlin, Robert Roebling // Modified by: // Created: 26.05.99 // Copyright: (c) wxWidgets Team // Licence: wxWindows licence /////////////////////////////////////////////////////////////////////////////// #ifndef _WX_DATAOBJ_H_BASE_ #define _WX_DATAOBJ_H_BASE_ // ---------------------------------------------------------------------------- // headers // ---------------------------------------------------------------------------- #include "wx/defs.h" #if wxUSE_DATAOBJ #include "wx/string.h" #include "wx/bitmap.h" #include "wx/list.h" #include "wx/arrstr.h" // ============================================================================ /* Generic data transfer related classes. The class hierarchy is as follows: - wxDataObject- / \ / \ wxDataObjectSimple wxDataObjectComposite / | \ / | \ wxTextDataObject | wxBitmapDataObject | wxCustomDataObject */ // ============================================================================ // ---------------------------------------------------------------------------- // wxDataFormat class is declared in platform-specific headers: it represents // a format for data which may be either one of the standard ones (text, // bitmap, ...) or a custom one which is then identified by a unique string. // ---------------------------------------------------------------------------- /* the class interface looks like this (pseudo code): class wxDataFormat { public: typedef <integral type> NativeFormat; wxDataFormat(NativeFormat format = wxDF_INVALID); wxDataFormat(const wxString& format); wxDataFormat& operator=(NativeFormat format); wxDataFormat& operator=(const wxDataFormat& format); bool operator==(NativeFormat format) const; bool operator!=(NativeFormat format) const; void SetType(NativeFormat format); NativeFormat GetType() const; wxString GetId() const; void SetId(const wxString& format); }; */ #if defined(__WXMSW__) #include "wx/msw/ole/dataform.h" #elif defined(__WXMOTIF__) #include "wx/motif/dataform.h" #elif defined(__WXGTK20__) #include "wx/gtk/dataform.h" #elif defined(__WXGTK__) #include "wx/gtk1/dataform.h" #elif defined(__WXX11__) #include "wx/x11/dataform.h" #elif defined(__WXMAC__) #include "wx/osx/dataform.h" #elif defined(__WXQT__) #include "wx/qt/dataform.h" #endif // the value for default argument to some functions (corresponds to // wxDF_INVALID) extern WXDLLIMPEXP_CORE const wxDataFormat& wxFormatInvalid; // ---------------------------------------------------------------------------- // wxDataObject represents a piece of data which knows which formats it // supports and knows how to render itself in each of them - GetDataHere(), // and how to restore data from the buffer (SetData()). // // Although this class may be used directly (i.e. custom classes may be // derived from it), in many cases it might be simpler to use either // wxDataObjectSimple or wxDataObjectComposite classes. // // A data object may be "read only", i.e. support only GetData() functions or // "read-write", i.e. support both GetData() and SetData() (in principle, it // might be "write only" too, but this is rare). Moreover, it doesn't have to // support the same formats in Get() and Set() directions: for example, a data // object containing JPEG image might accept BMPs in GetData() because JPEG // image may be easily transformed into BMP but not in SetData(). Accordingly, // all methods dealing with formats take an additional "direction" argument // which is either SET or GET and which tells the function if the format needs // to be supported by SetData() or GetDataHere(). // ---------------------------------------------------------------------------- class WXDLLIMPEXP_CORE wxDataObjectBase { public: enum Direction { Get = 0x01, // format is supported by GetDataHere() Set = 0x02, // format is supported by SetData() Both = 0x03 // format is supported by both (unused currently) }; // this class is polymorphic, hence it needs a virtual dtor virtual ~wxDataObjectBase(); // get the best suited format for rendering our data virtual wxDataFormat GetPreferredFormat(Direction dir = Get) const = 0; // get the number of formats we support virtual size_t GetFormatCount(Direction dir = Get) const = 0; // return all formats in the provided array (of size GetFormatCount()) virtual void GetAllFormats(wxDataFormat *formats, Direction dir = Get) const = 0; // get the (total) size of data for the given format virtual size_t GetDataSize(const wxDataFormat& format) const = 0; // copy raw data (in the specified format) to the provided buffer, return // true if data copied successfully, false otherwise virtual bool GetDataHere(const wxDataFormat& format, void *buf) const = 0; // get data from the buffer of specified length (in the given format), // return true if the data was read successfully, false otherwise virtual bool SetData(const wxDataFormat& WXUNUSED(format), size_t WXUNUSED(len), const void * WXUNUSED(buf)) { return false; } // returns true if this format is supported bool IsSupported(const wxDataFormat& format, Direction dir = Get) const; }; // ---------------------------------------------------------------------------- // include the platform-specific declarations of wxDataObject // ---------------------------------------------------------------------------- #if defined(__WXMSW__) #include "wx/msw/ole/dataobj.h" #elif defined(__WXMOTIF__) #include "wx/motif/dataobj.h" #elif defined(__WXX11__) #include "wx/x11/dataobj.h" #elif defined(__WXGTK20__) #include "wx/gtk/dataobj.h" #elif defined(__WXGTK__) #include "wx/gtk1/dataobj.h" #elif defined(__WXMAC__) #include "wx/osx/dataobj.h" #elif defined(__WXQT__) #include "wx/qt/dataobj.h" #endif // ---------------------------------------------------------------------------- // wxDataObjectSimple is a wxDataObject which only supports one format (in // both Get and Set directions, but you may return false from GetDataHere() or // SetData() if one of them is not supported). This is the simplest possible // wxDataObject implementation. // // This is still an "abstract base class" (although it doesn't have any pure // virtual functions), to use it you should derive from it and implement // GetDataSize(), GetDataHere() and SetData() functions because the base class // versions don't do anything - they just return "not implemented". // // This class should be used when you provide data in only one format (no // conversion to/from other formats), either a standard or a custom one. // Otherwise, you should use wxDataObjectComposite or wxDataObject directly. // ---------------------------------------------------------------------------- class WXDLLIMPEXP_CORE wxDataObjectSimple : public wxDataObject { public: // ctor takes the format we support, but it can also be set later with // SetFormat() wxDataObjectSimple(const wxDataFormat& format = wxFormatInvalid) : m_format(format) { } // get/set the format we support const wxDataFormat& GetFormat() const { return m_format; } void SetFormat(const wxDataFormat& format) { m_format = format; } // virtual functions to override in derived class (the base class versions // just return "not implemented") // ----------------------------------------------------------------------- // get the size of our data virtual size_t GetDataSize() const { return 0; } // copy our data to the buffer virtual bool GetDataHere(void *WXUNUSED(buf)) const { return false; } // copy data from buffer to our data virtual bool SetData(size_t WXUNUSED(len), const void *WXUNUSED(buf)) { return false; } // implement base class pure virtuals // ---------------------------------- virtual wxDataFormat GetPreferredFormat(wxDataObjectBase::Direction WXUNUSED(dir) = Get) const wxOVERRIDE { return m_format; } virtual size_t GetFormatCount(wxDataObjectBase::Direction WXUNUSED(dir) = Get) const wxOVERRIDE { return 1; } virtual void GetAllFormats(wxDataFormat *formats, wxDataObjectBase::Direction WXUNUSED(dir) = Get) const wxOVERRIDE { *formats = m_format; } virtual size_t GetDataSize(const wxDataFormat& WXUNUSED(format)) const wxOVERRIDE { return GetDataSize(); } virtual bool GetDataHere(const wxDataFormat& WXUNUSED(format), void *buf) const wxOVERRIDE { return GetDataHere(buf); } virtual bool SetData(const wxDataFormat& WXUNUSED(format), size_t len, const void *buf) wxOVERRIDE { return SetData(len, buf); } private: // the one and only format we support wxDataFormat m_format; wxDECLARE_NO_COPY_CLASS(wxDataObjectSimple); }; // ---------------------------------------------------------------------------- // wxDataObjectComposite is the simplest way to implement wxDataObject // supporting multiple formats. It contains several wxDataObjectSimple and // supports all formats supported by any of them. // // This class shouldn't be (normally) derived from, but may be used directly. // If you need more flexibility than what it provides, you should probably use // wxDataObject directly. // ---------------------------------------------------------------------------- WX_DECLARE_EXPORTED_LIST(wxDataObjectSimple, wxSimpleDataObjectList); class WXDLLIMPEXP_CORE wxDataObjectComposite : public wxDataObject { public: // ctor wxDataObjectComposite(); virtual ~wxDataObjectComposite(); // add data object (it will be deleted by wxDataObjectComposite, hence it // must be allocated on the heap) whose format will become the preferred // one if preferred == true void Add(wxDataObjectSimple *dataObject, bool preferred = false); // Report the format passed to the SetData method. This should be the // format of the data object within the composite that received data from // the clipboard or the DnD operation. You can use this method to find // out what kind of data object was received. wxDataFormat GetReceivedFormat() const; // Returns the pointer to the object which supports this format or NULL. // The returned pointer is owned by wxDataObjectComposite and must // therefore not be destroyed by the caller. wxDataObjectSimple *GetObject(const wxDataFormat& format, wxDataObjectBase::Direction dir = Get) const; // implement base class pure virtuals // ---------------------------------- virtual wxDataFormat GetPreferredFormat(wxDataObjectBase::Direction dir = Get) const wxOVERRIDE; virtual size_t GetFormatCount(wxDataObjectBase::Direction dir = Get) const wxOVERRIDE; virtual void GetAllFormats(wxDataFormat *formats, wxDataObjectBase::Direction dir = Get) const wxOVERRIDE; virtual size_t GetDataSize(const wxDataFormat& format) const wxOVERRIDE; virtual bool GetDataHere(const wxDataFormat& format, void *buf) const wxOVERRIDE; virtual bool SetData(const wxDataFormat& format, size_t len, const void *buf) wxOVERRIDE; #if defined(__WXMSW__) virtual const void* GetSizeFromBuffer( const void* buffer, size_t* size, const wxDataFormat& format ) wxOVERRIDE; virtual void* SetSizeInBuffer( void* buffer, size_t size, const wxDataFormat& format ) wxOVERRIDE; virtual size_t GetBufferOffset( const wxDataFormat& format ) wxOVERRIDE; #endif private: // the list of all (simple) data objects whose formats we support wxSimpleDataObjectList m_dataObjects; // the index of the preferred one (0 initially, so by default the first // one is the preferred) size_t m_preferred; wxDataFormat m_receivedFormat; wxDECLARE_NO_COPY_CLASS(wxDataObjectComposite); }; // ============================================================================ // Standard implementations of wxDataObjectSimple which can be used directly // (i.e. without having to derive from them) for standard data type transfers. // // Note that although all of them can work with provided data, you can also // override their virtual GetXXX() functions to only provide data on demand. // ============================================================================ // ---------------------------------------------------------------------------- // wxTextDataObject contains text data // ---------------------------------------------------------------------------- #if wxUSE_UNICODE #if defined(__WXGTK20__) || defined(__WXX11__) #define wxNEEDS_UTF8_FOR_TEXT_DATAOBJ #elif defined(__WXMAC__) #define wxNEEDS_UTF16_FOR_TEXT_DATAOBJ #endif #endif // wxUSE_UNICODE class WXDLLIMPEXP_CORE wxHTMLDataObject : public wxDataObjectSimple { public: // ctor: you can specify the text here or in SetText(), or override // GetText() wxHTMLDataObject(const wxString& html = wxEmptyString) : wxDataObjectSimple(wxDF_HTML), m_html(html) { } // virtual functions which you may override if you want to provide text on // demand only - otherwise, the trivial default versions will be used virtual size_t GetLength() const { return m_html.Len() + 1; } virtual wxString GetHTML() const { return m_html; } virtual void SetHTML(const wxString& html) { m_html = html; } virtual size_t GetDataSize() const wxOVERRIDE; virtual bool GetDataHere(void *buf) const wxOVERRIDE; virtual bool SetData(size_t len, const void *buf) wxOVERRIDE; // Must provide overloads to avoid hiding them (and warnings about it) virtual size_t GetDataSize(const wxDataFormat&) const wxOVERRIDE { return GetDataSize(); } virtual bool GetDataHere(const wxDataFormat&, void *buf) const wxOVERRIDE { return GetDataHere(buf); } virtual bool SetData(const wxDataFormat&, size_t len, const void *buf) wxOVERRIDE { return SetData(len, buf); } private: wxString m_html; }; class WXDLLIMPEXP_CORE wxTextDataObject : public wxDataObjectSimple { public: // ctor: you can specify the text here or in SetText(), or override // GetText() wxTextDataObject(const wxString& text = wxEmptyString) : wxDataObjectSimple( #if wxUSE_UNICODE wxDF_UNICODETEXT #else wxDF_TEXT #endif ), m_text(text) { } // virtual functions which you may override if you want to provide text on // demand only - otherwise, the trivial default versions will be used virtual size_t GetTextLength() const { return m_text.Len() + 1; } virtual wxString GetText() const { return m_text; } virtual void SetText(const wxString& text) { m_text = text; } // implement base class pure virtuals // ---------------------------------- // some platforms have 2 and not 1 format for text data #if defined(wxNEEDS_UTF8_FOR_TEXT_DATAOBJ) || defined(wxNEEDS_UTF16_FOR_TEXT_DATAOBJ) virtual size_t GetFormatCount(Direction WXUNUSED(dir) = Get) const wxOVERRIDE { return 2; } virtual void GetAllFormats(wxDataFormat *formats, wxDataObjectBase::Direction WXUNUSED(dir) = Get) const wxOVERRIDE; virtual size_t GetDataSize() const wxOVERRIDE { return GetDataSize(GetPreferredFormat()); } virtual bool GetDataHere(void *buf) const wxOVERRIDE { return GetDataHere(GetPreferredFormat(), buf); } virtual bool SetData(size_t len, const void *buf) wxOVERRIDE { return SetData(GetPreferredFormat(), len, buf); } size_t GetDataSize(const wxDataFormat& format) const wxOVERRIDE; bool GetDataHere(const wxDataFormat& format, void *pBuf) const wxOVERRIDE; bool SetData(const wxDataFormat& format, size_t nLen, const void* pBuf) wxOVERRIDE; #else // !wxNEEDS_UTF{8,16}_FOR_TEXT_DATAOBJ virtual size_t GetDataSize() const wxOVERRIDE; virtual bool GetDataHere(void *buf) const wxOVERRIDE; virtual bool SetData(size_t len, const void *buf) wxOVERRIDE; // Must provide overloads to avoid hiding them (and warnings about it) virtual size_t GetDataSize(const wxDataFormat&) const wxOVERRIDE { return GetDataSize(); } virtual bool GetDataHere(const wxDataFormat&, void *buf) const wxOVERRIDE { return GetDataHere(buf); } virtual bool SetData(const wxDataFormat&, size_t len, const void *buf) wxOVERRIDE { return SetData(len, buf); } #endif // different wxTextDataObject implementations private: wxString m_text; wxDECLARE_NO_COPY_CLASS(wxTextDataObject); }; // ---------------------------------------------------------------------------- // wxBitmapDataObject contains a bitmap // ---------------------------------------------------------------------------- class WXDLLIMPEXP_CORE wxBitmapDataObjectBase : public wxDataObjectSimple { public: // ctor: you can specify the bitmap here or in SetBitmap(), or override // GetBitmap() wxBitmapDataObjectBase(const wxBitmap& bitmap = wxNullBitmap) : wxDataObjectSimple(wxDF_BITMAP), m_bitmap(bitmap) { } // virtual functions which you may override if you want to provide data on // demand only - otherwise, the trivial default versions will be used virtual wxBitmap GetBitmap() const { return m_bitmap; } virtual void SetBitmap(const wxBitmap& bitmap) { m_bitmap = bitmap; } protected: wxBitmap m_bitmap; wxDECLARE_NO_COPY_CLASS(wxBitmapDataObjectBase); }; // ---------------------------------------------------------------------------- // wxFileDataObject contains a list of filenames // // NB: notice that this is a "write only" object, it can only be filled with // data from drag and drop operation. // ---------------------------------------------------------------------------- class WXDLLIMPEXP_CORE wxFileDataObjectBase : public wxDataObjectSimple { public: // ctor: use AddFile() later to fill the array wxFileDataObjectBase() : wxDataObjectSimple(wxDF_FILENAME) { } // get a reference to our array const wxArrayString& GetFilenames() const { return m_filenames; } protected: wxArrayString m_filenames; wxDECLARE_NO_COPY_CLASS(wxFileDataObjectBase); }; // ---------------------------------------------------------------------------- // wxCustomDataObject contains arbitrary untyped user data. // // It is understood that this data can be copied bitwise. // ---------------------------------------------------------------------------- class WXDLLIMPEXP_CORE wxCustomDataObject : public wxDataObjectSimple { public: // if you don't specify the format in the ctor, you can still use // SetFormat() later wxCustomDataObject(const wxDataFormat& format = wxFormatInvalid); // the dtor calls Free() virtual ~wxCustomDataObject(); // you can call SetData() to set m_data: it will make a copy of the data // you pass - or you can use TakeData() which won't copy anything, but // will take ownership of data (i.e. will call Free() on it later) void TakeData(size_t size, void *data); // this function is called to allocate "size" bytes of memory from // SetData(). The default version uses operator new[]. virtual void *Alloc(size_t size); // this function is called when the data is freed, you may override it to // anything you want (or may be nothing at all). The default version calls // operator delete[] on m_data virtual void Free(); // get data: you may override these functions if you wish to provide data // only when it's requested virtual size_t GetSize() const { return m_size; } virtual void *GetData() const { return m_data; } // implement base class pure virtuals // ---------------------------------- virtual size_t GetDataSize() const wxOVERRIDE; virtual bool GetDataHere(void *buf) const wxOVERRIDE; virtual bool SetData(size_t size, const void *buf) wxOVERRIDE; // Must provide overloads to avoid hiding them (and warnings about it) virtual size_t GetDataSize(const wxDataFormat&) const wxOVERRIDE { return GetDataSize(); } virtual bool GetDataHere(const wxDataFormat&, void *buf) const wxOVERRIDE { return GetDataHere(buf); } virtual bool SetData(const wxDataFormat&, size_t len, const void *buf) wxOVERRIDE { return SetData(len, buf); } private: size_t m_size; void *m_data; wxDECLARE_NO_COPY_CLASS(wxCustomDataObject); }; // ---------------------------------------------------------------------------- // include platform-specific declarations of wxXXXBase classes // ---------------------------------------------------------------------------- #if defined(__WXMSW__) #include "wx/msw/ole/dataobj2.h" // wxURLDataObject defined in msw/ole/dataobj2.h #elif defined(__WXGTK20__) #include "wx/gtk/dataobj2.h" // wxURLDataObject defined in gtk/dataobj2.h #else #if defined(__WXGTK__) #include "wx/gtk1/dataobj2.h" #elif defined(__WXX11__) #include "wx/x11/dataobj2.h" #elif defined(__WXMOTIF__) #include "wx/motif/dataobj2.h" #elif defined(__WXMAC__) #include "wx/osx/dataobj2.h" #elif defined(__WXQT__) #include "wx/qt/dataobj2.h" #endif // wxURLDataObject is simply wxTextDataObject with a different name class WXDLLIMPEXP_CORE wxURLDataObject : public wxTextDataObject { public: wxURLDataObject(const wxString& url = wxEmptyString) : wxTextDataObject(url) { } wxString GetURL() const { return GetText(); } void SetURL(const wxString& url) { SetText(url); } }; #endif #endif // wxUSE_DATAOBJ #endif // _WX_DATAOBJ_H_BASE_
h
rticonnextdds-usecases
data/projects/rticonnextdds-usecases/VehicleTracking/ExampleCode/thirdparty/wxWidgets-3.1.2/Linux/include/wx/power.h
/////////////////////////////////////////////////////////////////////////////// // Name: wx/power.h // Purpose: functions and classes for system power management // Author: Vadim Zeitlin // Modified by: // Created: 2006-05-27 // Copyright: (c) 2006 Vadim Zeitlin <[email protected]> // Licence: wxWindows licence /////////////////////////////////////////////////////////////////////////////// #ifndef _WX_POWER_H_ #define _WX_POWER_H_ #include "wx/event.h" // ---------------------------------------------------------------------------- // power management constants // ---------------------------------------------------------------------------- enum wxPowerType { wxPOWER_SOCKET, wxPOWER_BATTERY, wxPOWER_UNKNOWN }; enum wxBatteryState { wxBATTERY_NORMAL_STATE, // system is fully usable wxBATTERY_LOW_STATE, // start to worry wxBATTERY_CRITICAL_STATE, // save quickly wxBATTERY_SHUTDOWN_STATE, // too late wxBATTERY_UNKNOWN_STATE }; // ---------------------------------------------------------------------------- // wxPowerEvent is generated when the system online status changes // ---------------------------------------------------------------------------- // currently the power events are only available under Windows, to avoid // compiling in the code for handling them which is never going to be invoked // under the other platforms, we define wxHAS_POWER_EVENTS symbol if this event // is available, it should be used to guard all code using wxPowerEvent #ifdef __WINDOWS__ #define wxHAS_POWER_EVENTS class WXDLLIMPEXP_BASE wxPowerEvent : public wxEvent { public: wxPowerEvent() // just for use by wxRTTI : m_veto(false) { } wxPowerEvent(wxEventType evtType) : wxEvent(wxID_NONE, evtType) { m_veto = false; } // Veto the operation (only makes sense with EVT_POWER_SUSPENDING) void Veto() { m_veto = true; } bool IsVetoed() const { return m_veto; } // default copy ctor, assignment operator and dtor are ok virtual wxEvent *Clone() const wxOVERRIDE { return new wxPowerEvent(*this); } private: bool m_veto; wxDECLARE_DYNAMIC_CLASS_NO_ASSIGN(wxPowerEvent); }; wxDECLARE_EXPORTED_EVENT( WXDLLIMPEXP_BASE, wxEVT_POWER_SUSPENDING, wxPowerEvent ); wxDECLARE_EXPORTED_EVENT( WXDLLIMPEXP_BASE, wxEVT_POWER_SUSPENDED, wxPowerEvent ); wxDECLARE_EXPORTED_EVENT( WXDLLIMPEXP_BASE, wxEVT_POWER_SUSPEND_CANCEL, wxPowerEvent ); wxDECLARE_EXPORTED_EVENT( WXDLLIMPEXP_BASE, wxEVT_POWER_RESUME, wxPowerEvent ); typedef void (wxEvtHandler::*wxPowerEventFunction)(wxPowerEvent&); #define wxPowerEventHandler(func) \ wxEVENT_HANDLER_CAST(wxPowerEventFunction, func) #define EVT_POWER_SUSPENDING(func) \ wx__DECLARE_EVT0(wxEVT_POWER_SUSPENDING, wxPowerEventHandler(func)) #define EVT_POWER_SUSPENDED(func) \ wx__DECLARE_EVT0(wxEVT_POWER_SUSPENDED, wxPowerEventHandler(func)) #define EVT_POWER_SUSPEND_CANCEL(func) \ wx__DECLARE_EVT0(wxEVT_POWER_SUSPEND_CANCEL, wxPowerEventHandler(func)) #define EVT_POWER_RESUME(func) \ wx__DECLARE_EVT0(wxEVT_POWER_RESUME, wxPowerEventHandler(func)) #else // no support for power events #undef wxHAS_POWER_EVENTS #endif // support for power events/no support // ---------------------------------------------------------------------------- // wxPowerResourceBlocker // ---------------------------------------------------------------------------- enum wxPowerResourceKind { wxPOWER_RESOURCE_SCREEN, wxPOWER_RESOURCE_SYSTEM }; class WXDLLIMPEXP_BASE wxPowerResource { public: static bool Acquire(wxPowerResourceKind kind, const wxString& reason = wxString()); static void Release(wxPowerResourceKind kind); }; class wxPowerResourceBlocker { public: explicit wxPowerResourceBlocker(wxPowerResourceKind kind, const wxString& reason = wxString()) : m_kind(kind), m_acquired(wxPowerResource::Acquire(kind, reason)) { } bool IsInEffect() const { return m_acquired; } ~wxPowerResourceBlocker() { if ( m_acquired ) wxPowerResource::Release(m_kind); } private: const wxPowerResourceKind m_kind; const bool m_acquired; wxDECLARE_NO_COPY_CLASS(wxPowerResourceBlocker); }; // ---------------------------------------------------------------------------- // power management functions // ---------------------------------------------------------------------------- // return the current system power state: online or offline WXDLLIMPEXP_BASE wxPowerType wxGetPowerType(); // return approximate battery state WXDLLIMPEXP_BASE wxBatteryState wxGetBatteryState(); #endif // _WX_POWER_H_
h
rticonnextdds-usecases
data/projects/rticonnextdds-usecases/VehicleTracking/ExampleCode/thirdparty/wxWidgets-3.1.2/Linux/include/wx/statbox.h
///////////////////////////////////////////////////////////////////////////// // Name: wx/statbox.h // Purpose: wxStaticBox base header // Author: Julian Smart // Modified by: // Created: // Copyright: (c) Julian Smart // Licence: wxWindows licence ///////////////////////////////////////////////////////////////////////////// #ifndef _WX_STATBOX_H_BASE_ #define _WX_STATBOX_H_BASE_ #include "wx/defs.h" #if wxUSE_STATBOX #include "wx/control.h" #include "wx/containr.h" extern WXDLLIMPEXP_DATA_CORE(const char) wxStaticBoxNameStr[]; // ---------------------------------------------------------------------------- // wxStaticBox: a grouping box with a label // ---------------------------------------------------------------------------- class WXDLLIMPEXP_CORE wxStaticBoxBase : public wxNavigationEnabled<wxControl> { public: wxStaticBoxBase(); // overridden base class virtuals virtual bool HasTransparentBackground() wxOVERRIDE { return true; } virtual bool Enable(bool enable = true) wxOVERRIDE; // implementation only: this is used by wxStaticBoxSizer to account for the // need for extra space taken by the static box // // the top border is the margin at the top (where the title is), // borderOther is the margin on all other sides virtual void GetBordersForSizer(int *borderTop, int *borderOther) const; // This is an internal function currently used by wxStaticBoxSizer only. // // Reparent all children of the static box under its parent and destroy the // box itself. void WXDestroyWithoutChildren(); protected: // choose the default border for this window virtual wxBorder GetDefaultBorder() const wxOVERRIDE { return wxBORDER_NONE; } // If non-null, the window used as our label. This window is owned by the // static box and will be deleted when it is. wxWindow* m_labelWin; // For boxes with window label this member variable is used instead of // m_isEnabled to remember the last value passed to Enable(). It is // required because the box itself doesn't get disabled by Enable(false) in // this case (see comments in Enable() implementation), and m_isEnabled // must correspond to its real state. bool m_areChildrenEnabled; wxDECLARE_NO_COPY_CLASS(wxStaticBoxBase); }; #if defined(__WXUNIVERSAL__) #include "wx/univ/statbox.h" #elif defined(__WXMSW__) #include "wx/msw/statbox.h" #elif defined(__WXMOTIF__) #include "wx/motif/statbox.h" #elif defined(__WXGTK20__) #include "wx/gtk/statbox.h" #elif defined(__WXGTK__) #include "wx/gtk1/statbox.h" #elif defined(__WXMAC__) #include "wx/osx/statbox.h" #elif defined(__WXQT__) #include "wx/qt/statbox.h" #endif #endif // wxUSE_STATBOX #endif // _WX_STATBOX_H_BASE_
h
rticonnextdds-usecases
data/projects/rticonnextdds-usecases/VehicleTracking/ExampleCode/thirdparty/wxWidgets-3.1.2/Linux/include/wx/arrimpl.cpp
/////////////////////////////////////////////////////////////////////////////// // Name: wx/arrimpl.cpp // Purpose: helper file for implementation of dynamic lists // Author: Vadim Zeitlin // Modified by: // Created: 16.10.97 // Copyright: (c) 1997 Vadim Zeitlin <[email protected]> // Licence: wxWindows licence /////////////////////////////////////////////////////////////////////////////// /***************************************************************************** * Purpose: implements helper functions used by the template class used by * * DECLARE_OBJARRAY macro and which couldn't be implemented inline * * (because they need the full definition of type T in scope) * * * * Usage: 1) #include dynarray.h * * 2) WX_DECLARE_OBJARRAY * * 3) #include arrimpl.cpp * * 4) WX_DEFINE_OBJARRAY * *****************************************************************************/ #undef WX_DEFINE_OBJARRAY #define WX_DEFINE_OBJARRAY(name) \ name::value_type* \ wxObjectArrayTraitsFor##name::Clone(const name::value_type& item) \ { \ return new name::value_type(item); \ } \ \ void wxObjectArrayTraitsFor##name::Free(name::value_type* p) \ { \ delete p; \ }
cpp
rticonnextdds-usecases
data/projects/rticonnextdds-usecases/VehicleTracking/ExampleCode/thirdparty/wxWidgets-3.1.2/Linux/include/wx/utils.h
///////////////////////////////////////////////////////////////////////////// // Name: wx/utils.h // Purpose: Miscellaneous utilities // Author: Julian Smart // Modified by: // Created: 29/01/98 // Copyright: (c) 1998 Julian Smart // Licence: wxWindows licence ///////////////////////////////////////////////////////////////////////////// #ifndef _WX_UTILS_H_ #define _WX_UTILS_H_ // ---------------------------------------------------------------------------- // headers // ---------------------------------------------------------------------------- #include "wx/object.h" #include "wx/list.h" #include "wx/filefn.h" #include "wx/hashmap.h" #include "wx/versioninfo.h" #include "wx/meta/implicitconversion.h" #if wxUSE_GUI #include "wx/gdicmn.h" #include "wx/mousestate.h" #endif class WXDLLIMPEXP_FWD_BASE wxArrayString; class WXDLLIMPEXP_FWD_BASE wxArrayInt; // need this for wxGetDiskSpace() as we can't, unfortunately, forward declare // wxLongLong #include "wx/longlong.h" // needed for wxOperatingSystemId, wxLinuxDistributionInfo #include "wx/platinfo.h" #if defined(__X__) #include <dirent.h> #include <unistd.h> #endif #include <stdio.h> // ---------------------------------------------------------------------------- // Forward declaration // ---------------------------------------------------------------------------- class WXDLLIMPEXP_FWD_BASE wxProcess; class WXDLLIMPEXP_FWD_CORE wxFrame; class WXDLLIMPEXP_FWD_CORE wxWindow; class wxWindowList; class WXDLLIMPEXP_FWD_CORE wxEventLoop; // ---------------------------------------------------------------------------- // Arithmetic functions // ---------------------------------------------------------------------------- template<typename T1, typename T2> inline typename wxImplicitConversionType<T1,T2>::value wxMax(T1 a, T2 b) { typedef typename wxImplicitConversionType<T1,T2>::value ResultType; // Cast both operands to the same type before comparing them to avoid // warnings about signed/unsigned comparisons from some compilers: return static_cast<ResultType>(a) > static_cast<ResultType>(b) ? a : b; } template<typename T1, typename T2> inline typename wxImplicitConversionType<T1,T2>::value wxMin(T1 a, T2 b) { typedef typename wxImplicitConversionType<T1,T2>::value ResultType; return static_cast<ResultType>(a) < static_cast<ResultType>(b) ? a : b; } template<typename T1, typename T2, typename T3> inline typename wxImplicitConversionType3<T1,T2,T3>::value wxClip(T1 a, T2 b, T3 c) { typedef typename wxImplicitConversionType3<T1,T2,T3>::value ResultType; if ( static_cast<ResultType>(a) < static_cast<ResultType>(b) ) return b; if ( static_cast<ResultType>(a) > static_cast<ResultType>(c) ) return c; return a; } // ---------------------------------------------------------------------------- // wxMemorySize // ---------------------------------------------------------------------------- // wxGetFreeMemory can return huge amount of memory on 32-bit platforms as well // so to always use long long for its result type on all platforms which // support it #if wxUSE_LONGLONG typedef wxLongLong wxMemorySize; #else typedef long wxMemorySize; #endif // ---------------------------------------------------------------------------- // String functions (deprecated, use wxString) // ---------------------------------------------------------------------------- #if WXWIN_COMPATIBILITY_2_8 // A shorter way of using strcmp wxDEPRECATED_INLINE(inline bool wxStringEq(const char *s1, const char *s2), return wxCRT_StrcmpA(s1, s2) == 0; ) #if wxUSE_UNICODE wxDEPRECATED_INLINE(inline bool wxStringEq(const wchar_t *s1, const wchar_t *s2), return wxCRT_StrcmpW(s1, s2) == 0; ) #endif // wxUSE_UNICODE #endif // WXWIN_COMPATIBILITY_2_8 // ---------------------------------------------------------------------------- // Miscellaneous functions // ---------------------------------------------------------------------------- // Sound the bell WXDLLIMPEXP_CORE void wxBell(); #if wxUSE_MSGDLG // Show wxWidgets information WXDLLIMPEXP_CORE void wxInfoMessageBox(wxWindow* parent); #endif // wxUSE_MSGDLG WXDLLIMPEXP_CORE wxVersionInfo wxGetLibraryVersionInfo(); // Get OS description as a user-readable string WXDLLIMPEXP_BASE wxString wxGetOsDescription(); // Get OS version WXDLLIMPEXP_BASE wxOperatingSystemId wxGetOsVersion(int *verMaj = NULL, int *verMin = NULL, int *verMicro = NULL); // Check is OS version is at least the specified major and minor version WXDLLIMPEXP_BASE bool wxCheckOsVersion(int majorVsn, int minorVsn = 0, int microVsn = 0); // Get platform endianness WXDLLIMPEXP_BASE bool wxIsPlatformLittleEndian(); // Get platform architecture WXDLLIMPEXP_BASE bool wxIsPlatform64Bit(); #ifdef __LINUX__ // Get linux-distro informations WXDLLIMPEXP_BASE wxLinuxDistributionInfo wxGetLinuxDistributionInfo(); #endif // Return a string with the current date/time WXDLLIMPEXP_BASE wxString wxNow(); // Return path where wxWidgets is installed (mostly useful in Unices) WXDLLIMPEXP_BASE const wxChar *wxGetInstallPrefix(); // Return path to wxWin data (/usr/share/wx/%{version}) (Unices) WXDLLIMPEXP_BASE wxString wxGetDataDir(); #if wxUSE_GUI // Get the state of a key (true if pressed, false if not) // This is generally most useful getting the state of // the modifier or toggle keys. WXDLLIMPEXP_CORE bool wxGetKeyState(wxKeyCode key); // Don't synthesize KeyUp events holding down a key and producing // KeyDown events with autorepeat. On by default and always on // in wxMSW. WXDLLIMPEXP_CORE bool wxSetDetectableAutoRepeat( bool flag ); // Returns the current state of the mouse position, buttons and modifers WXDLLIMPEXP_CORE wxMouseState wxGetMouseState(); #endif // wxUSE_GUI // ---------------------------------------------------------------------------- // wxPlatform // ---------------------------------------------------------------------------- /* * Class to make it easier to specify platform-dependent values * * Examples: * long val = wxPlatform::If(wxMac, 1).ElseIf(wxGTK, 2).ElseIf(stPDA, 5).Else(3); * wxString strVal = wxPlatform::If(wxMac, wxT("Mac")).ElseIf(wxMSW, wxT("MSW")).Else(wxT("Other")); * * A custom platform symbol: * * #define stPDA 100 * #ifdef __WXMSW__ * wxPlatform::AddPlatform(stPDA); * #endif * * long windowStyle = wxCAPTION | (long) wxPlatform::IfNot(stPDA, wxRESIZE_BORDER); * */ class WXDLLIMPEXP_BASE wxPlatform { public: wxPlatform() { Init(); } wxPlatform(const wxPlatform& platform) { Copy(platform); } void operator = (const wxPlatform& platform) { if (&platform != this) Copy(platform); } void Copy(const wxPlatform& platform); // Specify an optional default value wxPlatform(int defValue) { Init(); m_longValue = (long)defValue; } wxPlatform(long defValue) { Init(); m_longValue = defValue; } wxPlatform(const wxString& defValue) { Init(); m_stringValue = defValue; } wxPlatform(double defValue) { Init(); m_doubleValue = defValue; } static wxPlatform If(int platform, long value); static wxPlatform IfNot(int platform, long value); wxPlatform& ElseIf(int platform, long value); wxPlatform& ElseIfNot(int platform, long value); wxPlatform& Else(long value); static wxPlatform If(int platform, int value) { return If(platform, (long)value); } static wxPlatform IfNot(int platform, int value) { return IfNot(platform, (long)value); } wxPlatform& ElseIf(int platform, int value) { return ElseIf(platform, (long) value); } wxPlatform& ElseIfNot(int platform, int value) { return ElseIfNot(platform, (long) value); } wxPlatform& Else(int value) { return Else((long) value); } static wxPlatform If(int platform, double value); static wxPlatform IfNot(int platform, double value); wxPlatform& ElseIf(int platform, double value); wxPlatform& ElseIfNot(int platform, double value); wxPlatform& Else(double value); static wxPlatform If(int platform, const wxString& value); static wxPlatform IfNot(int platform, const wxString& value); wxPlatform& ElseIf(int platform, const wxString& value); wxPlatform& ElseIfNot(int platform, const wxString& value); wxPlatform& Else(const wxString& value); long GetInteger() const { return m_longValue; } const wxString& GetString() const { return m_stringValue; } double GetDouble() const { return m_doubleValue; } operator int() const { return (int) GetInteger(); } operator long() const { return GetInteger(); } operator double() const { return GetDouble(); } operator const wxString&() const { return GetString(); } static void AddPlatform(int platform); static bool Is(int platform); static void ClearPlatforms(); private: void Init() { m_longValue = 0; m_doubleValue = 0.0; } long m_longValue; double m_doubleValue; wxString m_stringValue; static wxArrayInt* sm_customPlatforms; }; /// Function for testing current platform inline bool wxPlatformIs(int platform) { return wxPlatform::Is(platform); } // ---------------------------------------------------------------------------- // Window ID management // ---------------------------------------------------------------------------- // Ensure subsequent IDs don't clash with this one WXDLLIMPEXP_BASE void wxRegisterId(int id); // Return the current ID WXDLLIMPEXP_BASE int wxGetCurrentId(); // Generate a unique ID WXDLLIMPEXP_BASE int wxNewId(); // ---------------------------------------------------------------------------- // Various conversions // ---------------------------------------------------------------------------- // Convert 2-digit hex number to decimal WXDLLIMPEXP_BASE int wxHexToDec(const wxString& buf); // Convert 2-digit hex number to decimal inline int wxHexToDec(const char* buf) { int firstDigit, secondDigit; if (buf[0] >= 'A') firstDigit = buf[0] - 'A' + 10; else if (buf[0] >= '0') firstDigit = buf[0] - '0'; else firstDigit = -1; wxCHECK_MSG( firstDigit >= 0 && firstDigit <= 15, -1, wxS("Invalid argument") ); if (buf[1] >= 'A') secondDigit = buf[1] - 'A' + 10; else if (buf[1] >= '0') secondDigit = buf[1] - '0'; else secondDigit = -1; wxCHECK_MSG( secondDigit >= 0 && secondDigit <= 15, -1, wxS("Invalid argument") ); return firstDigit * 16 + secondDigit; } // Convert decimal integer to 2-character hex string WXDLLIMPEXP_BASE void wxDecToHex(unsigned char dec, wxChar *buf); WXDLLIMPEXP_BASE void wxDecToHex(unsigned char dec, char* ch1, char* ch2); WXDLLIMPEXP_BASE wxString wxDecToHex(unsigned char dec); // ---------------------------------------------------------------------------- // Process management // ---------------------------------------------------------------------------- // NB: for backwards compatibility reasons the values of wxEXEC_[A]SYNC *must* // be 0 and 1, don't change! enum { // execute the process asynchronously wxEXEC_ASYNC = 0, // execute it synchronously, i.e. wait until it finishes wxEXEC_SYNC = 1, // under Windows, don't hide the child even if it's IO is redirected (this // is done by default) wxEXEC_SHOW_CONSOLE = 2, // deprecated synonym for wxEXEC_SHOW_CONSOLE, use the new name as it's // more clear wxEXEC_NOHIDE = wxEXEC_SHOW_CONSOLE, // under Unix, if the process is the group leader then passing wxKILL_CHILDREN to wxKill // kills all children as well as pid // under Windows (NT family only), sets the CREATE_NEW_PROCESS_GROUP flag, // which allows to target Ctrl-Break signal to the spawned process. // applies to console processes only. wxEXEC_MAKE_GROUP_LEADER = 4, // by default synchronous execution disables all program windows to avoid // that the user interacts with the program while the child process is // running, you can use this flag to prevent this from happening wxEXEC_NODISABLE = 8, // by default, the event loop is run while waiting for synchronous execution // to complete and this flag can be used to simply block the main process // until the child process finishes wxEXEC_NOEVENTS = 16, // under Windows, hide the console of the child process if it has one, even // if its IO is not redirected wxEXEC_HIDE_CONSOLE = 32, // convenient synonym for flags given system()-like behaviour wxEXEC_BLOCK = wxEXEC_SYNC | wxEXEC_NOEVENTS }; // Map storing environment variables. typedef wxStringToStringHashMap wxEnvVariableHashMap; // Used to pass additional parameters for child process to wxExecute(). Could // be extended with other fields later. struct wxExecuteEnv { wxString cwd; // If empty, CWD is not changed. wxEnvVariableHashMap env; // If empty, environment is unchanged. }; // Execute another program. // // If flags contain wxEXEC_SYNC, return -1 on failure and the exit code of the // process if everything was ok. Otherwise (i.e. if wxEXEC_ASYNC), return 0 on // failure and the PID of the launched process if ok. WXDLLIMPEXP_BASE long wxExecute(const wxString& command, int flags = wxEXEC_ASYNC, wxProcess *process = NULL, const wxExecuteEnv *env = NULL); WXDLLIMPEXP_BASE long wxExecute(const char* const* argv, int flags = wxEXEC_ASYNC, wxProcess *process = NULL, const wxExecuteEnv *env = NULL); #if wxUSE_UNICODE WXDLLIMPEXP_BASE long wxExecute(const wchar_t* const* argv, int flags = wxEXEC_ASYNC, wxProcess *process = NULL, const wxExecuteEnv *env = NULL); #endif // wxUSE_UNICODE // execute the command capturing its output into an array line by line, this is // always synchronous WXDLLIMPEXP_BASE long wxExecute(const wxString& command, wxArrayString& output, int flags = 0, const wxExecuteEnv *env = NULL); // also capture stderr (also synchronous) WXDLLIMPEXP_BASE long wxExecute(const wxString& command, wxArrayString& output, wxArrayString& error, int flags = 0, const wxExecuteEnv *env = NULL); #if defined(__WINDOWS__) && wxUSE_IPC // ask a DDE server to execute the DDE request with given parameters WXDLLIMPEXP_BASE bool wxExecuteDDE(const wxString& ddeServer, const wxString& ddeTopic, const wxString& ddeCommand); #endif // __WINDOWS__ && wxUSE_IPC enum wxSignal { wxSIGNONE = 0, // verify if the process exists under Unix wxSIGHUP, wxSIGINT, wxSIGQUIT, wxSIGILL, wxSIGTRAP, wxSIGABRT, wxSIGIOT = wxSIGABRT, // another name wxSIGEMT, wxSIGFPE, wxSIGKILL, wxSIGBUS, wxSIGSEGV, wxSIGSYS, wxSIGPIPE, wxSIGALRM, wxSIGTERM // further signals are different in meaning between different Unix systems }; enum wxKillError { wxKILL_OK, // no error wxKILL_BAD_SIGNAL, // no such signal wxKILL_ACCESS_DENIED, // permission denied wxKILL_NO_PROCESS, // no such process wxKILL_ERROR // another, unspecified error }; enum wxKillFlags { wxKILL_NOCHILDREN = 0, // don't kill children wxKILL_CHILDREN = 1 // kill children }; enum wxShutdownFlags { wxSHUTDOWN_FORCE = 1,// can be combined with other flags (MSW-only) wxSHUTDOWN_POWEROFF = 2,// power off the computer wxSHUTDOWN_REBOOT = 4,// shutdown and reboot wxSHUTDOWN_LOGOFF = 8 // close session (currently MSW-only) }; // Shutdown or reboot the PC WXDLLIMPEXP_BASE bool wxShutdown(int flags = wxSHUTDOWN_POWEROFF); // send the given signal to the process (only NONE and KILL are supported under // Windows, all others mean TERM), return 0 if ok and -1 on error // // return detailed error in rc if not NULL WXDLLIMPEXP_BASE int wxKill(long pid, wxSignal sig = wxSIGTERM, wxKillError *rc = NULL, int flags = wxKILL_NOCHILDREN); // Execute a command in an interactive shell window (always synchronously) // If no command then just the shell WXDLLIMPEXP_BASE bool wxShell(const wxString& command = wxEmptyString); // As wxShell(), but must give a (non interactive) command and its output will // be returned in output array WXDLLIMPEXP_BASE bool wxShell(const wxString& command, wxArrayString& output); // Sleep for nSecs seconds WXDLLIMPEXP_BASE void wxSleep(int nSecs); // Sleep for a given amount of milliseconds WXDLLIMPEXP_BASE void wxMilliSleep(unsigned long milliseconds); // Sleep for a given amount of microseconds WXDLLIMPEXP_BASE void wxMicroSleep(unsigned long microseconds); #if WXWIN_COMPATIBILITY_2_8 // Sleep for a given amount of milliseconds (old, bad name), use wxMilliSleep wxDEPRECATED( WXDLLIMPEXP_BASE void wxUsleep(unsigned long milliseconds) ); #endif // Get the process id of the current process WXDLLIMPEXP_BASE unsigned long wxGetProcessId(); // Get free memory in bytes, or -1 if cannot determine amount (e.g. on UNIX) WXDLLIMPEXP_BASE wxMemorySize wxGetFreeMemory(); #if wxUSE_ON_FATAL_EXCEPTION // should wxApp::OnFatalException() be called? WXDLLIMPEXP_BASE bool wxHandleFatalExceptions(bool doit = true); #endif // wxUSE_ON_FATAL_EXCEPTION // ---------------------------------------------------------------------------- // Environment variables // ---------------------------------------------------------------------------- // returns true if variable exists (value may be NULL if you just want to check // for this) WXDLLIMPEXP_BASE bool wxGetEnv(const wxString& var, wxString *value); // set the env var name to the given value, return true on success WXDLLIMPEXP_BASE bool wxSetEnv(const wxString& var, const wxString& value); // remove the env var from environment WXDLLIMPEXP_BASE bool wxUnsetEnv(const wxString& var); #if WXWIN_COMPATIBILITY_2_8 inline bool wxSetEnv(const wxString& var, const char *value) { return wxSetEnv(var, wxString(value)); } inline bool wxSetEnv(const wxString& var, const wchar_t *value) { return wxSetEnv(var, wxString(value)); } template<typename T> inline bool wxSetEnv(const wxString& var, const wxScopedCharTypeBuffer<T>& value) { return wxSetEnv(var, wxString(value)); } inline bool wxSetEnv(const wxString& var, const wxCStrData& value) { return wxSetEnv(var, wxString(value)); } // this one is for passing NULL directly - don't use it, use wxUnsetEnv instead wxDEPRECATED( inline bool wxSetEnv(const wxString& var, int value) ); inline bool wxSetEnv(const wxString& var, int value) { wxASSERT_MSG( value == 0, "using non-NULL integer as string?" ); wxUnusedVar(value); // fix unused parameter warning in release build return wxUnsetEnv(var); } #endif // WXWIN_COMPATIBILITY_2_8 // Retrieve the complete environment by filling specified map. // Returns true on success or false if an error occurred. WXDLLIMPEXP_BASE bool wxGetEnvMap(wxEnvVariableHashMap *map); // ---------------------------------------------------------------------------- // Network and username functions. // ---------------------------------------------------------------------------- // NB: "char *" functions are deprecated, use wxString ones! // Get eMail address WXDLLIMPEXP_BASE bool wxGetEmailAddress(wxChar *buf, int maxSize); WXDLLIMPEXP_BASE wxString wxGetEmailAddress(); // Get hostname. WXDLLIMPEXP_BASE bool wxGetHostName(wxChar *buf, int maxSize); WXDLLIMPEXP_BASE wxString wxGetHostName(); // Get FQDN WXDLLIMPEXP_BASE wxString wxGetFullHostName(); WXDLLIMPEXP_BASE bool wxGetFullHostName(wxChar *buf, int maxSize); // Get user ID e.g. jacs (this is known as login name under Unix) WXDLLIMPEXP_BASE bool wxGetUserId(wxChar *buf, int maxSize); WXDLLIMPEXP_BASE wxString wxGetUserId(); // Get user name e.g. Julian Smart WXDLLIMPEXP_BASE bool wxGetUserName(wxChar *buf, int maxSize); WXDLLIMPEXP_BASE wxString wxGetUserName(); // Get current Home dir and copy to dest (returns pstr->c_str()) WXDLLIMPEXP_BASE wxString wxGetHomeDir(); WXDLLIMPEXP_BASE const wxChar* wxGetHomeDir(wxString *pstr); // Get the user's (by default use the current user name) home dir, // return empty string on error WXDLLIMPEXP_BASE wxString wxGetUserHome(const wxString& user = wxEmptyString); #if wxUSE_LONGLONG typedef wxLongLong wxDiskspaceSize_t; #else typedef long wxDiskspaceSize_t; #endif // get number of total/free bytes on the disk where path belongs WXDLLIMPEXP_BASE bool wxGetDiskSpace(const wxString& path, wxDiskspaceSize_t *pTotal = NULL, wxDiskspaceSize_t *pFree = NULL); typedef int (*wxSortCallback)(const void* pItem1, const void* pItem2, const void* user_data); WXDLLIMPEXP_BASE void wxQsort(void* pbase, size_t total_elems, size_t size, wxSortCallback cmp, const void* user_data); #if wxUSE_GUI // GUI only things from now on // ---------------------------------------------------------------------------- // Launch default browser // ---------------------------------------------------------------------------- // flags for wxLaunchDefaultBrowser enum { wxBROWSER_NEW_WINDOW = 0x01, wxBROWSER_NOBUSYCURSOR = 0x02 }; // Launch url in the user's default internet browser WXDLLIMPEXP_CORE bool wxLaunchDefaultBrowser(const wxString& url, int flags = 0); // Launch document in the user's default application WXDLLIMPEXP_CORE bool wxLaunchDefaultApplication(const wxString& path, int flags = 0); // ---------------------------------------------------------------------------- // Menu accelerators related things // ---------------------------------------------------------------------------- // flags for wxStripMenuCodes enum { // strip '&' characters wxStrip_Mnemonics = 1, // strip everything after '\t' wxStrip_Accel = 2, // strip everything (this is the default) wxStrip_All = wxStrip_Mnemonics | wxStrip_Accel }; // strip mnemonics and/or accelerators from the label WXDLLIMPEXP_CORE wxString wxStripMenuCodes(const wxString& str, int flags = wxStrip_All); // ---------------------------------------------------------------------------- // Window search // ---------------------------------------------------------------------------- // Returns menu item id or wxNOT_FOUND if none. WXDLLIMPEXP_CORE int wxFindMenuItemId(wxFrame *frame, const wxString& menuString, const wxString& itemString); // Find the wxWindow at the given point. wxGenericFindWindowAtPoint // is always present but may be less reliable than a native version. WXDLLIMPEXP_CORE wxWindow* wxGenericFindWindowAtPoint(const wxPoint& pt); WXDLLIMPEXP_CORE wxWindow* wxFindWindowAtPoint(const wxPoint& pt); // NB: this function is obsolete, use wxWindow::FindWindowByLabel() instead // // Find the window/widget with the given title or label. // Pass a parent to begin the search from, or NULL to look through // all windows. WXDLLIMPEXP_CORE wxWindow* wxFindWindowByLabel(const wxString& title, wxWindow *parent = NULL); // NB: this function is obsolete, use wxWindow::FindWindowByName() instead // // Find window by name, and if that fails, by label. WXDLLIMPEXP_CORE wxWindow* wxFindWindowByName(const wxString& name, wxWindow *parent = NULL); // ---------------------------------------------------------------------------- // Message/event queue helpers // ---------------------------------------------------------------------------- // Yield to other apps/messages and disable user input WXDLLIMPEXP_CORE bool wxSafeYield(wxWindow *win = NULL, bool onlyIfNeeded = false); // Enable or disable input to all top level windows WXDLLIMPEXP_CORE void wxEnableTopLevelWindows(bool enable = true); // Check whether this window wants to process messages, e.g. Stop button // in long calculations. WXDLLIMPEXP_CORE bool wxCheckForInterrupt(wxWindow *wnd); // Consume all events until no more left WXDLLIMPEXP_CORE void wxFlushEvents(); // a class which disables all windows (except, may be, the given one) in its // ctor and enables them back in its dtor class WXDLLIMPEXP_CORE wxWindowDisabler { public: // this ctor conditionally disables all windows: if the argument is false, // it doesn't do anything wxWindowDisabler(bool disable = true); // ctor disables all windows except winToSkip wxWindowDisabler(wxWindow *winToSkip); // dtor enables back all windows disabled by the ctor ~wxWindowDisabler(); private: // disable all windows except the given one (used by both ctors) void DoDisable(wxWindow *winToSkip = NULL); #if defined(__WXOSX__) && wxOSX_USE_COCOA wxEventLoop* m_modalEventLoop; #endif wxWindowList *m_winDisabled; bool m_disabled; wxDECLARE_NO_COPY_CLASS(wxWindowDisabler); }; // ---------------------------------------------------------------------------- // Cursors // ---------------------------------------------------------------------------- // Set the cursor to the busy cursor for all windows WXDLLIMPEXP_CORE void wxBeginBusyCursor(const wxCursor *cursor = wxHOURGLASS_CURSOR); // Restore cursor to normal WXDLLIMPEXP_CORE void wxEndBusyCursor(); // true if we're between the above two calls WXDLLIMPEXP_CORE bool wxIsBusy(); // Convenience class so we can just create a wxBusyCursor object on the stack class WXDLLIMPEXP_CORE wxBusyCursor { public: wxBusyCursor(const wxCursor* cursor = wxHOURGLASS_CURSOR) { wxBeginBusyCursor(cursor); } ~wxBusyCursor() { wxEndBusyCursor(); } // FIXME: These two methods are currently only implemented (and needed?) // in wxGTK. BusyCursor handling should probably be moved to // common code since the wxGTK and wxMSW implementations are very // similar except for wxMSW using HCURSOR directly instead of // wxCursor.. -- RL. static const wxCursor &GetStoredCursor(); static const wxCursor GetBusyCursor(); }; void WXDLLIMPEXP_CORE wxGetMousePosition( int* x, int* y ); // ---------------------------------------------------------------------------- // X11 Display access // ---------------------------------------------------------------------------- #if defined(__X__) || defined(__WXGTK__) #ifdef __WXGTK__ WXDLLIMPEXP_CORE void *wxGetDisplay(); #endif #ifdef __X__ WXDLLIMPEXP_CORE WXDisplay *wxGetDisplay(); WXDLLIMPEXP_CORE bool wxSetDisplay(const wxString& display_name); WXDLLIMPEXP_CORE wxString wxGetDisplayName(); #endif // X or GTK+ // use this function instead of the functions above in implementation code inline struct _XDisplay *wxGetX11Display() { return (_XDisplay *)wxGetDisplay(); } #endif // X11 || wxGTK #endif // wxUSE_GUI // ---------------------------------------------------------------------------- // wxYield(): these functions are obsolete, please use wxApp methods instead! // ---------------------------------------------------------------------------- // avoid redeclaring this function here if it had been already declated by // wx/app.h, this results in warnings from g++ with -Wredundant-decls #ifndef wx_YIELD_DECLARED #define wx_YIELD_DECLARED // Yield to other apps/messages WXDLLIMPEXP_CORE bool wxYield(); #endif // wx_YIELD_DECLARED // Like wxYield, but fails silently if the yield is recursive. WXDLLIMPEXP_CORE bool wxYieldIfNeeded(); // ---------------------------------------------------------------------------- // Windows resources access // ---------------------------------------------------------------------------- // Windows only: get user-defined resource from the .res file. #ifdef __WINDOWS__ // default resource type for wxLoadUserResource() extern WXDLLIMPEXP_DATA_BASE(const wxChar*) wxUserResourceStr; // Return the pointer to the resource data. This pointer is read-only, use // the overload below if you need to modify the data. // // Notice that the resource type can be either a real string or an integer // produced by MAKEINTRESOURCE(). In particular, any standard resource type, // i.e any RT_XXX constant, could be passed here. // // Returns true on success, false on failure. Doesn't log an error message // if the resource is not found (because this could be expected) but does // log one if any other error occurs. WXDLLIMPEXP_BASE bool wxLoadUserResource(const void **outData, size_t *outLen, const wxString& resourceName, const wxChar* resourceType = wxUserResourceStr, WXHINSTANCE module = 0); // This function allocates a new buffer and makes a copy of the resource // data, remember to delete[] the buffer. And avoid using it entirely if // the overload above can be used. // // Returns NULL on failure. WXDLLIMPEXP_BASE char* wxLoadUserResource(const wxString& resourceName, const wxChar* resourceType = wxUserResourceStr, int* pLen = NULL, WXHINSTANCE module = 0); #endif // __WINDOWS__ #endif // _WX_UTILSH__
h
rticonnextdds-usecases
data/projects/rticonnextdds-usecases/VehicleTracking/ExampleCode/thirdparty/wxWidgets-3.1.2/Linux/include/wx/testing.h
///////////////////////////////////////////////////////////////////////////// // Name: wx/testing.h // Purpose: helpers for GUI testing // Author: Vaclav Slavik // Created: 2012-08-28 // Copyright: (c) 2012 Vaclav Slavik // Licence: wxWindows Licence ///////////////////////////////////////////////////////////////////////////// #ifndef _WX_TESTING_H_ #define _WX_TESTING_H_ #include "wx/debug.h" #include "wx/string.h" #include "wx/modalhook.h" class WXDLLIMPEXP_FWD_CORE wxMessageDialogBase; class WXDLLIMPEXP_FWD_CORE wxFileDialogBase; // ---------------------------------------------------------------------------- // testing API // ---------------------------------------------------------------------------- // Don't include this code when building the library itself #ifndef WXBUILDING #include "wx/beforestd.h" #include <algorithm> #include <iterator> #include <queue> #include "wx/afterstd.h" #include "wx/cpp.h" #include "wx/dialog.h" #include "wx/msgdlg.h" #include "wx/filedlg.h" #include <typeinfo> class wxTestingModalHook; // This helper is used to construct the best possible name for the dialog of // the given type using wxRTTI for this type, if any, and the C++ RTTI for // either the type T statically or the dynamic type of "dlg" if it's non-null. template <class T> wxString wxGetDialogClassDescription(const wxClassInfo *ci, T* dlg = NULL) { // We prefer to use the name from wxRTTI as it's guaranteed to be readable, // unlike the name returned by type_info::name() which may need to be // demangled, but if wxRTTI macros were not used for this object, it's // better to return a not-very-readable-but-informative mangled name rather // than a readable but useless "wxDialog". if ( ci == wxCLASSINFO(wxDialog) ) { return wxString::Format("dialog of type \"%s\"", (dlg ? typeid(*dlg) : typeid(T)).name()); } // We consider that an unmangled name is clear enough to be used on its own. return ci->GetClassName(); } // Non-template base class for wxExpectModal<T> (via wxExpectModalBase). // Only used internally. class wxModalExpectation { public: wxModalExpectation() : m_isOptional(false) {} virtual ~wxModalExpectation() {} wxString GetDescription() const { return m_description.empty() ? GetDefaultDescription() : m_description; } bool IsOptional() const { return m_isOptional; } virtual int Invoke(wxDialog *dlg) const = 0; protected: // Override to return the default description of the expected dialog used // if no specific description for this particular expectation is given. virtual wxString GetDefaultDescription() const = 0; // User-provided description of the dialog, may be empty. wxString m_description; // Is this dialog optional, i.e. not required to be shown? bool m_isOptional; }; // This template is specialized for some of the standard dialog classes and can // also be specialized outside of the library for the custom dialogs. // // All specializations must derive from wxExpectModalBase<T>. template<class T> class wxExpectModal; /** Base class for the expectation of a dialog of the given type T. Test code can derive ad hoc classes from this class directly and implement its OnInvoked() to perform the necessary actions or derive wxExpectModal<T> and implement it once if the implementation of OnInvoked() is always the same, i.e. depends just on the type T. T must be a class derived from wxDialog and E is the derived class type, i.e. this is an example of using CRTP. The default value of E is fine in case you're using this class as a base for your wxExpectModal<> specialization anyhow but also if you don't use neither Optional() nor Describe() methods, as the derived class type is only needed for them. */ template<class T, class E = wxExpectModal<T> > class wxExpectModalBase : public wxModalExpectation { public: typedef T DialogType; typedef E ExpectationType; // A note about these "modifier" methods: they return copies of this object // and not a reference to the object itself (after modifying it) because // this object is likely to be temporary and will be destroyed soon, while // the new temporary created by these objects is bound to a const reference // inside WX_TEST_IMPL_ADD_EXPECTATION() macro ensuring that its lifetime // is prolonged until we can check if the expectations were met. // // This is also the reason these methods must be in this class and use // CRTP: a copy of this object can't be created in the base class, which is // abstract, and the copy must have the same type as the derived object to // avoid slicing. // // Make sure you understand this comment in its entirety before considering // modifying this code. /** Returns a copy of the expectation where the expected dialog is marked as optional. Optional dialogs aren't required to appear, it's not an error if they don't. */ ExpectationType Optional() const { ExpectationType e(*static_cast<const ExpectationType*>(this)); e.m_isOptional = true; return e; } /** Sets a description shown in the error message if the expectation fails. Using this method with unique descriptions for the different dialogs is recommended to make it easier to find out which one of the expected dialogs exactly was not shown. */ ExpectationType Describe(const wxString& description) const { ExpectationType e(*static_cast<const ExpectationType*>(this)); e.m_description = description; return e; } protected: virtual int Invoke(wxDialog *dlg) const wxOVERRIDE { DialogType *t = dynamic_cast<DialogType*>(dlg); if ( t ) return OnInvoked(t); else return wxID_NONE; // not handled } /// Returns description of the expected dialog (by default, its class). virtual wxString GetDefaultDescription() const wxOVERRIDE { return wxGetDialogClassDescription<T>(wxCLASSINFO(T)); } /** This method is called when ShowModal() was invoked on a dialog of type T. @return Return value is used as ShowModal()'s return value. */ virtual int OnInvoked(DialogType *dlg) const = 0; }; // wxExpectModal<T> specializations for common dialogs: template<class T> class wxExpectDismissableModal : public wxExpectModalBase<T, wxExpectDismissableModal<T> > { public: explicit wxExpectDismissableModal(int id) { switch ( id ) { case wxYES: m_id = wxID_YES; break; case wxNO: m_id = wxID_NO; break; case wxCANCEL: m_id = wxID_CANCEL; break; case wxOK: m_id = wxID_OK; break; case wxHELP: m_id = wxID_HELP; break; default: m_id = id; break; } } protected: virtual int OnInvoked(T *WXUNUSED(dlg)) const wxOVERRIDE { return m_id; } int m_id; }; template<> class wxExpectModal<wxMessageDialog> : public wxExpectDismissableModal<wxMessageDialog> { public: explicit wxExpectModal(int id) : wxExpectDismissableModal<wxMessageDialog>(id) { } protected: virtual wxString GetDefaultDescription() const wxOVERRIDE { // It can be useful to show which buttons the expected message box was // supposed to have, in case there could have been several of them. wxString details; switch ( m_id ) { case wxID_YES: case wxID_NO: details = "wxYES_NO style"; break; case wxID_CANCEL: details = "wxCANCEL style"; break; case wxID_OK: details = "wxOK style"; break; default: details.Printf("a button with ID=%d", m_id); break; } return "wxMessageDialog with " + details; } }; class wxExpectAny : public wxExpectDismissableModal<wxDialog> { public: explicit wxExpectAny(int id) : wxExpectDismissableModal<wxDialog>(id) { } }; #if wxUSE_FILEDLG template<> class wxExpectModal<wxFileDialog> : public wxExpectModalBase<wxFileDialog> { public: wxExpectModal(const wxString& path, int id = wxID_OK) : m_path(path), m_id(id) { } protected: virtual int OnInvoked(wxFileDialog *dlg) const wxOVERRIDE { dlg->SetPath(m_path); return m_id; } wxString m_path; int m_id; }; #endif // Implementation of wxModalDialogHook for use in testing, with // wxExpectModal<T> and the wxTEST_DIALOG() macro. It is not intended for // direct use, use the macro instead. class wxTestingModalHook : public wxModalDialogHook { public: // This object is created with the location of the macro containing it by // wxTEST_DIALOG macro, otherwise it falls back to the location of this // line itself, which is not very useful, so normally you should provide // your own values. wxTestingModalHook(const char* file = NULL, int line = 0, const char* func = NULL) : m_file(file), m_line(line), m_func(func) { Register(); } // Called to verify that all expectations were met. This cannot be done in // the destructor, because ReportFailure() may throw (either because it's // overriden or because wx's assertions handling is, globally). And // throwing from the destructor would introduce all sort of problems, // including messing up the order of errors in some cases. void CheckUnmetExpectations() { while ( !m_expectations.empty() ) { const wxModalExpectation *expect = m_expectations.front(); m_expectations.pop(); if ( expect->IsOptional() ) continue; ReportFailure ( wxString::Format ( "Expected %s was not shown.", expect->GetDescription() ) ); break; } } void AddExpectation(const wxModalExpectation& e) { m_expectations.push(&e); } protected: virtual int Enter(wxDialog *dlg) wxOVERRIDE { while ( !m_expectations.empty() ) { const wxModalExpectation *expect = m_expectations.front(); m_expectations.pop(); int ret = expect->Invoke(dlg); if ( ret != wxID_NONE ) return ret; // dialog shown as expected // not showing an optional dialog is OK, but showing an unexpected // one definitely isn't: if ( !expect->IsOptional() ) { ReportFailure ( wxString::Format ( "%s was shown unexpectedly, expected %s.", DescribeUnexpectedDialog(dlg), expect->GetDescription() ) ); return wxID_NONE; } // else: try the next expectation in the chain } ReportFailure ( wxString::Format ( "%s was shown unexpectedly.", DescribeUnexpectedDialog(dlg) ) ); return wxID_NONE; } protected: // This method may be overridden to provide a better description of // (unexpected) dialogs, e.g. add knowledge of custom dialogs used by the // program here. virtual wxString DescribeUnexpectedDialog(wxDialog* dlg) const { // Message boxes are handled specially here just because they are so // ubiquitous. if ( wxMessageDialog *msgdlg = dynamic_cast<wxMessageDialog*>(dlg) ) { return wxString::Format ( "A message box \"%s\"", msgdlg->GetMessage() ); } return wxString::Format ( "A %s with title \"%s\"", wxGetDialogClassDescription(dlg->GetClassInfo(), dlg), dlg->GetTitle() ); } // This method may be overridden to change the way test failures are // handled. By default they result in an assertion failure which, of // course, can itself be customized. virtual void ReportFailure(const wxString& msg) { wxFAIL_MSG_AT( msg, m_file ? m_file : __FILE__, m_line ? m_line : __LINE__, m_func ? m_func : __WXFUNCTION__ ); } private: const char* const m_file; const int m_line; const char* const m_func; std::queue<const wxModalExpectation*> m_expectations; wxDECLARE_NO_COPY_CLASS(wxTestingModalHook); }; // Redefining this value makes it possible to customize the hook class, // including e.g. its error reporting. #ifndef wxTEST_DIALOG_HOOK_CLASS #define wxTEST_DIALOG_HOOK_CLASS wxTestingModalHook #endif #define WX_TEST_IMPL_ADD_EXPECTATION(pos, expect) \ const wxModalExpectation& wx_exp##pos = expect; \ wx_hook.AddExpectation(wx_exp##pos); /** Runs given code with all modal dialogs redirected to wxExpectModal<T> hooks, instead of being shown to the user. The first argument is any valid expression, typically a function call. The remaining arguments are wxExpectModal<T> instances defining the dialogs that are expected to be shown, in order of appearance. Some typical examples: @code wxTEST_DIALOG ( rc = dlg.ShowModal(), wxExpectModal<wxFileDialog>(wxGetCwd() + "/test.txt") ); @endcode Sometimes, the code may show more than one dialog: @code wxTEST_DIALOG ( RunSomeFunction(), wxExpectModal<wxMessageDialog>(wxNO), wxExpectModal<MyConfirmationDialog>(wxYES), wxExpectModal<wxFileDialog>(wxGetCwd() + "/test.txt") ); @endcode Notice that wxExpectModal<T> has some convenience methods for further tweaking the expectations. For example, it's possible to mark an expected dialog as @em optional for situations when a dialog may be shown, but isn't required to, by calling the Optional() method: @code wxTEST_DIALOG ( RunSomeFunction(), wxExpectModal<wxMessageDialog>(wxNO), wxExpectModal<wxFileDialog>(wxGetCwd() + "/test.txt").Optional() ); @endcode @note By default, errors are reported with wxFAIL_MSG(). You may customize this by implementing a class derived from wxTestingModalHook, overriding its ReportFailure() method and redefining the wxTEST_DIALOG_HOOK_CLASS macro to be the name of this class. @note Custom dialogs are supported too. All you have to do is to specialize wxExpectModal<> for your dialog type and implement its OnInvoked() method. */ #ifdef HAVE_VARIADIC_MACROS // See wx/cpp.h for the explanations of this hack. #if defined(__GNUC__) && __GNUC__ == 3 #pragma GCC system_header #endif /* gcc-3.x */ #define wxTEST_DIALOG(codeToRun, ...) \ { \ wxTEST_DIALOG_HOOK_CLASS wx_hook(__FILE__, __LINE__, __WXFUNCTION__); \ wxCALL_FOR_EACH(WX_TEST_IMPL_ADD_EXPECTATION, __VA_ARGS__) \ codeToRun; \ wx_hook.CheckUnmetExpectations(); \ } #endif /* HAVE_VARIADIC_MACROS */ #endif // !WXBUILDING #endif // _WX_TESTING_H_
h
rticonnextdds-usecases
data/projects/rticonnextdds-usecases/VehicleTracking/ExampleCode/thirdparty/wxWidgets-3.1.2/Linux/include/wx/richmsgdlg.h
///////////////////////////////////////////////////////////////////////////// // Name: wx/richmsgdlg.h // Purpose: wxRichMessageDialogBase // Author: Rickard Westerlund // Created: 2010-07-03 // Copyright: (c) 2010 wxWidgets team // Licence: wxWindows licence ///////////////////////////////////////////////////////////////////////////// #ifndef _WX_RICHMSGDLG_H_BASE_ #define _WX_RICHMSGDLG_H_BASE_ #include "wx/defs.h" #if wxUSE_RICHMSGDLG #include "wx/msgdlg.h" // Extends a message dialog with an optional checkbox and user-expandable // detailed text. class WXDLLIMPEXP_CORE wxRichMessageDialogBase : public wxGenericMessageDialog { public: wxRichMessageDialogBase( wxWindow *parent, const wxString& message, const wxString& caption, long style ) : wxGenericMessageDialog( parent, message, caption, style ), m_detailsExpanderCollapsedLabel( wxGetTranslation("&See details") ), m_detailsExpanderExpandedLabel( wxGetTranslation("&Hide details") ), m_checkBoxValue( false ), m_footerIcon( 0 ) { } void ShowCheckBox(const wxString& checkBoxText, bool checked = false) { m_checkBoxText = checkBoxText; m_checkBoxValue = checked; } wxString GetCheckBoxText() const { return m_checkBoxText; } void ShowDetailedText(const wxString& detailedText) { m_detailedText = detailedText; } wxString GetDetailedText() const { return m_detailedText; } virtual bool IsCheckBoxChecked() const { return m_checkBoxValue; } void SetFooterText(const wxString& footerText) { m_footerText = footerText; } wxString GetFooterText() const { return m_footerText; } void SetFooterIcon(int icon) { m_footerIcon = icon; } int GetFooterIcon() const { return m_footerIcon; } protected: const wxString m_detailsExpanderCollapsedLabel; const wxString m_detailsExpanderExpandedLabel; wxString m_checkBoxText; bool m_checkBoxValue; wxString m_detailedText; wxString m_footerText; int m_footerIcon; private: void ShowDetails(bool shown); wxDECLARE_NO_COPY_CLASS(wxRichMessageDialogBase); }; // Always include the generic version as it's currently used as the base class // by the MSW native implementation too. #include "wx/generic/richmsgdlgg.h" #if defined(__WXMSW__) && !defined(__WXUNIVERSAL__) #include "wx/msw/richmsgdlg.h" #else class WXDLLIMPEXP_CORE wxRichMessageDialog : public wxGenericRichMessageDialog { public: wxRichMessageDialog( wxWindow *parent, const wxString& message, const wxString& caption = wxMessageBoxCaptionStr, long style = wxOK | wxCENTRE ) : wxGenericRichMessageDialog( parent, message, caption, style ) { } private: wxDECLARE_DYNAMIC_CLASS_NO_COPY(wxRichMessageDialog); }; #endif #endif // wxUSE_RICHMSGDLG #endif // _WX_RICHMSGDLG_H_BASE_
h
rticonnextdds-usecases
data/projects/rticonnextdds-usecases/VehicleTracking/ExampleCode/thirdparty/wxWidgets-3.1.2/Linux/include/wx/tbarbase.h
///////////////////////////////////////////////////////////////////////////// // Name: wx/tbarbase.h // Purpose: Base class for toolbar classes // Author: Julian Smart // Modified by: // Created: 01/02/97 // Copyright: (c) Julian Smart // Licence: wxWindows licence ///////////////////////////////////////////////////////////////////////////// #ifndef _WX_TBARBASE_H_ #define _WX_TBARBASE_H_ // ---------------------------------------------------------------------------- // headers // ---------------------------------------------------------------------------- #include "wx/defs.h" #if wxUSE_TOOLBAR #include "wx/bitmap.h" #include "wx/list.h" #include "wx/control.h" class WXDLLIMPEXP_FWD_CORE wxToolBarBase; class WXDLLIMPEXP_FWD_CORE wxToolBarToolBase; class WXDLLIMPEXP_FWD_CORE wxImage; // ---------------------------------------------------------------------------- // constants // ---------------------------------------------------------------------------- extern WXDLLIMPEXP_DATA_CORE(const char) wxToolBarNameStr[]; extern WXDLLIMPEXP_DATA_CORE(const wxSize) wxDefaultSize; extern WXDLLIMPEXP_DATA_CORE(const wxPoint) wxDefaultPosition; enum wxToolBarToolStyle { wxTOOL_STYLE_BUTTON = 1, wxTOOL_STYLE_SEPARATOR = 2, wxTOOL_STYLE_CONTROL }; // ---------------------------------------------------------------------------- // wxToolBarTool is a toolbar element. // // It has a unique id (except for the separators which always have id wxID_ANY), the // style (telling whether it is a normal button, separator or a control), the // state (toggled or not, enabled or not) and short and long help strings. The // default implementations use the short help string for the tooltip text which // is popped up when the mouse pointer enters the tool and the long help string // for the applications status bar. // ---------------------------------------------------------------------------- class WXDLLIMPEXP_CORE wxToolBarToolBase : public wxObject { public: // ctors & dtor // ------------ // generic ctor for any kind of tool wxToolBarToolBase(wxToolBarBase *tbar = NULL, int toolid = wxID_SEPARATOR, const wxString& label = wxEmptyString, const wxBitmap& bmpNormal = wxNullBitmap, const wxBitmap& bmpDisabled = wxNullBitmap, wxItemKind kind = wxITEM_NORMAL, wxObject *clientData = NULL, const wxString& shortHelpString = wxEmptyString, const wxString& longHelpString = wxEmptyString) : m_label(label), m_shortHelpString(shortHelpString), m_longHelpString(longHelpString) { Init ( tbar, toolid == wxID_SEPARATOR ? wxTOOL_STYLE_SEPARATOR : wxTOOL_STYLE_BUTTON, toolid == wxID_ANY ? wxWindow::NewControlId() : toolid, kind ); m_clientData = clientData; m_bmpNormal = bmpNormal; m_bmpDisabled = bmpDisabled; } // ctor for controls only wxToolBarToolBase(wxToolBarBase *tbar, wxControl *control, const wxString& label) : m_label(label) { Init(tbar, wxTOOL_STYLE_CONTROL, control->GetId(), wxITEM_MAX); m_control = control; } virtual ~wxToolBarToolBase(); // accessors // --------- // general int GetId() const { return m_id; } wxControl *GetControl() const { wxASSERT_MSG( IsControl(), wxT("this toolbar tool is not a control") ); return m_control; } wxToolBarBase *GetToolBar() const { return m_tbar; } // style/kind bool IsStretchable() const { return m_stretchable; } bool IsButton() const { return m_toolStyle == wxTOOL_STYLE_BUTTON; } bool IsControl() const { return m_toolStyle == wxTOOL_STYLE_CONTROL; } bool IsSeparator() const { return m_toolStyle == wxTOOL_STYLE_SEPARATOR; } bool IsStretchableSpace() const { return IsSeparator() && IsStretchable(); } int GetStyle() const { return m_toolStyle; } wxItemKind GetKind() const { wxASSERT_MSG( IsButton(), wxT("only makes sense for buttons") ); return m_kind; } void MakeStretchable() { wxASSERT_MSG( IsSeparator(), "only separators can be stretchable" ); m_stretchable = true; } // state bool IsEnabled() const { return m_enabled; } bool IsToggled() const { return m_toggled; } bool CanBeToggled() const { return m_kind == wxITEM_CHECK || m_kind == wxITEM_RADIO; } // attributes const wxBitmap& GetNormalBitmap() const { return m_bmpNormal; } const wxBitmap& GetDisabledBitmap() const { return m_bmpDisabled; } const wxBitmap& GetBitmap() const { return IsEnabled() ? GetNormalBitmap() : GetDisabledBitmap(); } const wxString& GetLabel() const { return m_label; } const wxString& GetShortHelp() const { return m_shortHelpString; } const wxString& GetLongHelp() const { return m_longHelpString; } wxObject *GetClientData() const { if ( m_toolStyle == wxTOOL_STYLE_CONTROL ) { return (wxObject*)m_control->GetClientData(); } else { return m_clientData; } } // modifiers: return true if the state really changed virtual bool Enable(bool enable); virtual bool Toggle(bool toggle); virtual bool SetToggle(bool toggle); virtual bool SetShortHelp(const wxString& help); virtual bool SetLongHelp(const wxString& help); void Toggle() { Toggle(!IsToggled()); } void SetNormalBitmap(const wxBitmap& bmp) { m_bmpNormal = bmp; } void SetDisabledBitmap(const wxBitmap& bmp) { m_bmpDisabled = bmp; } virtual void SetLabel(const wxString& label) { m_label = label; } void SetClientData(wxObject *clientData) { if ( m_toolStyle == wxTOOL_STYLE_CONTROL ) { m_control->SetClientData(clientData); } else { m_clientData = clientData; } } // add tool to/remove it from a toolbar virtual void Detach() { m_tbar = NULL; } virtual void Attach(wxToolBarBase *tbar) { m_tbar = tbar; } #if wxUSE_MENUS // these methods are only for tools of wxITEM_DROPDOWN kind (but even such // tools can have a NULL associated menu) virtual void SetDropdownMenu(wxMenu *menu); wxMenu *GetDropdownMenu() const { return m_dropdownMenu; } #endif protected: // common part of all ctors void Init(wxToolBarBase *tbar, wxToolBarToolStyle style, int toolid, wxItemKind kind) { m_tbar = tbar; m_toolStyle = style; m_id = toolid; m_kind = kind; m_clientData = NULL; m_stretchable = false; m_toggled = false; m_enabled = true; #if wxUSE_MENUS m_dropdownMenu = NULL; #endif } wxToolBarBase *m_tbar; // the toolbar to which we belong (may be NULL) // tool parameters wxToolBarToolStyle m_toolStyle; wxWindowIDRef m_id; // the tool id, wxID_SEPARATOR for separator wxItemKind m_kind; // for normal buttons may be wxITEM_NORMAL/CHECK/RADIO // as controls have their own client data, no need to waste memory union { wxObject *m_clientData; wxControl *m_control; }; // true if this tool is stretchable: currently is only value for separators bool m_stretchable; // tool state bool m_toggled; bool m_enabled; // normal and disabled bitmaps for the tool, both can be invalid wxBitmap m_bmpNormal; wxBitmap m_bmpDisabled; // the button label wxString m_label; // short and long help strings wxString m_shortHelpString; wxString m_longHelpString; #if wxUSE_MENUS wxMenu *m_dropdownMenu; #endif wxDECLARE_DYNAMIC_CLASS_NO_COPY(wxToolBarToolBase); }; // a list of toolbar tools WX_DECLARE_EXPORTED_LIST(wxToolBarToolBase, wxToolBarToolsList); // ---------------------------------------------------------------------------- // the base class for all toolbars // ---------------------------------------------------------------------------- class WXDLLIMPEXP_CORE wxToolBarBase : public wxControl { public: wxToolBarBase(); virtual ~wxToolBarBase(); // toolbar construction // -------------------- // the full AddTool() function // // If bmpDisabled is wxNullBitmap, a shadowed version of the normal bitmap // is created and used as the disabled image. wxToolBarToolBase *AddTool(int toolid, const wxString& label, const wxBitmap& bitmap, const wxBitmap& bmpDisabled, wxItemKind kind = wxITEM_NORMAL, const wxString& shortHelp = wxEmptyString, const wxString& longHelp = wxEmptyString, wxObject *data = NULL) { return DoAddTool(toolid, label, bitmap, bmpDisabled, kind, shortHelp, longHelp, data); } // the most common AddTool() version wxToolBarToolBase *AddTool(int toolid, const wxString& label, const wxBitmap& bitmap, const wxString& shortHelp = wxEmptyString, wxItemKind kind = wxITEM_NORMAL) { return AddTool(toolid, label, bitmap, wxNullBitmap, kind, shortHelp); } // add a check tool, i.e. a tool which can be toggled wxToolBarToolBase *AddCheckTool(int toolid, const wxString& label, const wxBitmap& bitmap, const wxBitmap& bmpDisabled = wxNullBitmap, const wxString& shortHelp = wxEmptyString, const wxString& longHelp = wxEmptyString, wxObject *data = NULL) { return AddTool(toolid, label, bitmap, bmpDisabled, wxITEM_CHECK, shortHelp, longHelp, data); } // add a radio tool, i.e. a tool which can be toggled and releases any // other toggled radio tools in the same group when it happens wxToolBarToolBase *AddRadioTool(int toolid, const wxString& label, const wxBitmap& bitmap, const wxBitmap& bmpDisabled = wxNullBitmap, const wxString& shortHelp = wxEmptyString, const wxString& longHelp = wxEmptyString, wxObject *data = NULL) { return AddTool(toolid, label, bitmap, bmpDisabled, wxITEM_RADIO, shortHelp, longHelp, data); } // insert the new tool at the given position, if pos == GetToolsCount(), it // is equivalent to AddTool() virtual wxToolBarToolBase *InsertTool ( size_t pos, int toolid, const wxString& label, const wxBitmap& bitmap, const wxBitmap& bmpDisabled = wxNullBitmap, wxItemKind kind = wxITEM_NORMAL, const wxString& shortHelp = wxEmptyString, const wxString& longHelp = wxEmptyString, wxObject *clientData = NULL ); virtual wxToolBarToolBase *AddTool (wxToolBarToolBase *tool); virtual wxToolBarToolBase *InsertTool (size_t pos, wxToolBarToolBase *tool); // add an arbitrary control to the toolbar (notice that the control will be // deleted by the toolbar and that it will also adjust its position/size) // // the label is optional and, if specified, will be shown near the control // NB: the control should have toolbar as its parent virtual wxToolBarToolBase * AddControl(wxControl *control, const wxString& label = wxEmptyString); virtual wxToolBarToolBase * InsertControl(size_t pos, wxControl *control, const wxString& label = wxEmptyString); // get the control with the given id or return NULL virtual wxControl *FindControl( int toolid ); // add a separator to the toolbar virtual wxToolBarToolBase *AddSeparator(); virtual wxToolBarToolBase *InsertSeparator(size_t pos); // add a stretchable space to the toolbar: this is similar to a separator // except that it's always blank and that all the extra space the toolbar // has is [equally] distributed among the stretchable spaces in it virtual wxToolBarToolBase *AddStretchableSpace(); virtual wxToolBarToolBase *InsertStretchableSpace(size_t pos); // remove the tool from the toolbar: the caller is responsible for actually // deleting the pointer virtual wxToolBarToolBase *RemoveTool(int toolid); // delete tool either by index or by position virtual bool DeleteToolByPos(size_t pos); virtual bool DeleteTool(int toolid); // delete all tools virtual void ClearTools(); // must be called after all buttons have been created to finish toolbar // initialisation // // derived class versions should call the base one first, before doing // platform-specific stuff virtual bool Realize(); // tools state // ----------- virtual void EnableTool(int toolid, bool enable); virtual void ToggleTool(int toolid, bool toggle); // Set this to be togglable (or not) virtual void SetToggle(int toolid, bool toggle); // set/get tools client data (not for controls) virtual wxObject *GetToolClientData(int toolid) const; virtual void SetToolClientData(int toolid, wxObject *clientData); // returns tool pos, or wxNOT_FOUND if tool isn't found virtual int GetToolPos(int id) const; // return true if the tool is toggled virtual bool GetToolState(int toolid) const; virtual bool GetToolEnabled(int toolid) const; virtual void SetToolShortHelp(int toolid, const wxString& helpString); virtual wxString GetToolShortHelp(int toolid) const; virtual void SetToolLongHelp(int toolid, const wxString& helpString); virtual wxString GetToolLongHelp(int toolid) const; virtual void SetToolNormalBitmap(int WXUNUSED(id), const wxBitmap& WXUNUSED(bitmap)) {} virtual void SetToolDisabledBitmap(int WXUNUSED(id), const wxBitmap& WXUNUSED(bitmap)) {} // margins/packing/separation // -------------------------- virtual void SetMargins(int x, int y); void SetMargins(const wxSize& size) { SetMargins((int) size.x, (int) size.y); } virtual void SetToolPacking(int packing) { m_toolPacking = packing; } virtual void SetToolSeparation(int separation) { m_toolSeparation = separation; } virtual wxSize GetToolMargins() const { return wxSize(m_xMargin, m_yMargin); } virtual int GetToolPacking() const { return m_toolPacking; } virtual int GetToolSeparation() const { return m_toolSeparation; } // toolbar geometry // ---------------- // set the number of toolbar rows virtual void SetRows(int nRows); // the toolbar can wrap - limit the number of columns or rows it may take void SetMaxRowsCols(int rows, int cols) { m_maxRows = rows; m_maxCols = cols; } int GetMaxRows() const { return m_maxRows; } int GetMaxCols() const { return m_maxCols; } // get/set the size of the bitmaps used by the toolbar: should be called // before adding any tools to the toolbar virtual void SetToolBitmapSize(const wxSize& size) { m_defaultWidth = size.x; m_defaultHeight = size.y; } virtual wxSize GetToolBitmapSize() const { return wxSize(m_defaultWidth, m_defaultHeight); } // the button size in some implementations is bigger than the bitmap size: // get the total button size (by default the same as bitmap size) virtual wxSize GetToolSize() const { return GetToolBitmapSize(); } // returns a (non separator) tool containing the point (x, y) or NULL if // there is no tool at this point (coordinates are client) virtual wxToolBarToolBase *FindToolForPosition(wxCoord x, wxCoord y) const = 0; // find the tool by id wxToolBarToolBase *FindById(int toolid) const; // return true if this is a vertical toolbar, otherwise false bool IsVertical() const; // these methods allow to access tools by their index in the toolbar size_t GetToolsCount() const { return m_tools.GetCount(); } wxToolBarToolBase *GetToolByPos(int pos) { return m_tools[pos]; } const wxToolBarToolBase *GetToolByPos(int pos) const { return m_tools[pos]; } #if WXWIN_COMPATIBILITY_2_8 // the old versions of the various methods kept for compatibility // don't use in the new code! // -------------------------------------------------------------- wxDEPRECATED_INLINE( wxToolBarToolBase *AddTool(int toolid, const wxBitmap& bitmap, const wxBitmap& bmpDisabled, bool toggle = false, wxObject *clientData = NULL, const wxString& shortHelpString = wxEmptyString, const wxString& longHelpString = wxEmptyString) , return AddTool(toolid, wxEmptyString, bitmap, bmpDisabled, toggle ? wxITEM_CHECK : wxITEM_NORMAL, shortHelpString, longHelpString, clientData); ) wxDEPRECATED_INLINE( wxToolBarToolBase *AddTool(int toolid, const wxBitmap& bitmap, const wxString& shortHelpString = wxEmptyString, const wxString& longHelpString = wxEmptyString) , return AddTool(toolid, wxEmptyString, bitmap, wxNullBitmap, wxITEM_NORMAL, shortHelpString, longHelpString, NULL); ) wxDEPRECATED_INLINE( wxToolBarToolBase *AddTool(int toolid, const wxBitmap& bitmap, const wxBitmap& bmpDisabled, bool toggle, wxCoord xPos, wxCoord yPos = wxDefaultCoord, wxObject *clientData = NULL, const wxString& shortHelp = wxEmptyString, const wxString& longHelp = wxEmptyString) , return DoAddTool(toolid, wxEmptyString, bitmap, bmpDisabled, toggle ? wxITEM_CHECK : wxITEM_NORMAL, shortHelp, longHelp, clientData, xPos, yPos); ) wxDEPRECATED_INLINE( wxToolBarToolBase *InsertTool(size_t pos, int toolid, const wxBitmap& bitmap, const wxBitmap& bmpDisabled = wxNullBitmap, bool toggle = false, wxObject *clientData = NULL, const wxString& shortHelp = wxEmptyString, const wxString& longHelp = wxEmptyString) , return InsertTool(pos, toolid, wxEmptyString, bitmap, bmpDisabled, toggle ? wxITEM_CHECK : wxITEM_NORMAL, shortHelp, longHelp, clientData); ) #endif // WXWIN_COMPATIBILITY_2_8 // event handlers // -------------- // NB: these functions are deprecated, use EVT_TOOL_XXX() instead! // Only allow toggle if returns true. Call when left button up. virtual bool OnLeftClick(int toolid, bool toggleDown); // Call when right button down. virtual void OnRightClick(int toolid, long x, long y); // Called when the mouse cursor enters a tool bitmap. // Argument is wxID_ANY if mouse is exiting the toolbar. virtual void OnMouseEnter(int toolid); // more deprecated functions // ------------------------- // use GetToolMargins() instead wxSize GetMargins() const { return GetToolMargins(); } // Tool factories, // helper functions to create toolbar tools // ------------------------- virtual wxToolBarToolBase *CreateTool(int toolid, const wxString& label, const wxBitmap& bmpNormal, const wxBitmap& bmpDisabled = wxNullBitmap, wxItemKind kind = wxITEM_NORMAL, wxObject *clientData = NULL, const wxString& shortHelp = wxEmptyString, const wxString& longHelp = wxEmptyString) = 0; virtual wxToolBarToolBase *CreateTool(wxControl *control, const wxString& label) = 0; // this one is not virtual but just a simple helper/wrapper around // CreateTool() for separators wxToolBarToolBase *CreateSeparator() { return CreateTool(wxID_SEPARATOR, wxEmptyString, wxNullBitmap, wxNullBitmap, wxITEM_SEPARATOR, NULL, wxEmptyString, wxEmptyString); } // implementation only from now on // ------------------------------- // Do the toolbar button updates (check for EVT_UPDATE_UI handlers) virtual void UpdateWindowUI(long flags = wxUPDATE_UI_NONE) wxOVERRIDE ; // don't want toolbars to accept the focus virtual bool AcceptsFocus() const wxOVERRIDE { return false; } #if wxUSE_MENUS // Set dropdown menu bool SetDropdownMenu(int toolid, wxMenu *menu); #endif protected: // choose the default border for this window virtual wxBorder GetDefaultBorder() const wxOVERRIDE { return wxBORDER_NONE; } // to implement in derived classes // ------------------------------- // create a new toolbar tool and add it to the toolbar, this is typically // implemented by just calling InsertTool() virtual wxToolBarToolBase *DoAddTool ( int toolid, const wxString& label, const wxBitmap& bitmap, const wxBitmap& bmpDisabled, wxItemKind kind, const wxString& shortHelp = wxEmptyString, const wxString& longHelp = wxEmptyString, wxObject *clientData = NULL, wxCoord xPos = wxDefaultCoord, wxCoord yPos = wxDefaultCoord ); // the tool is not yet inserted into m_tools list when this function is // called and will only be added to it if this function succeeds virtual bool DoInsertTool(size_t pos, wxToolBarToolBase *tool) = 0; // the tool is still in m_tools list when this function is called, it will // only be deleted from it if it succeeds virtual bool DoDeleteTool(size_t pos, wxToolBarToolBase *tool) = 0; // called when the tools enabled flag changes virtual void DoEnableTool(wxToolBarToolBase *tool, bool enable) = 0; // called when the tool is toggled virtual void DoToggleTool(wxToolBarToolBase *tool, bool toggle) = 0; // called when the tools "can be toggled" flag changes virtual void DoSetToggle(wxToolBarToolBase *tool, bool toggle) = 0; // helper functions // ---------------- // call this from derived class ctor/Create() to ensure that we have either // wxTB_HORIZONTAL or wxTB_VERTICAL style, there is a lot of existing code // which randomly checks either one or the other of them and gets confused // if neither is set (and making one of them 0 is not an option neither as // then the existing tests would break down) void FixupStyle(); // un-toggle all buttons in the same radio group void UnToggleRadioGroup(wxToolBarToolBase *tool); // make the size of the buttons big enough to fit the largest bitmap size void AdjustToolBitmapSize(); // calls InsertTool() and deletes the tool if inserting it failed wxToolBarToolBase *DoInsertNewTool(size_t pos, wxToolBarToolBase *tool) { if ( !InsertTool(pos, tool) ) { delete tool; return NULL; } return tool; } // the list of all our tools wxToolBarToolsList m_tools; // the offset of the first tool int m_xMargin; int m_yMargin; // the maximum number of toolbar rows/columns int m_maxRows; int m_maxCols; // the tool packing and separation int m_toolPacking, m_toolSeparation; // the size of the toolbar bitmaps wxCoord m_defaultWidth, m_defaultHeight; private: wxDECLARE_EVENT_TABLE(); wxDECLARE_NO_COPY_CLASS(wxToolBarBase); }; // deprecated function for creating the image for disabled buttons, use // wxImage::ConvertToGreyscale() instead #if WXWIN_COMPATIBILITY_2_8 wxDEPRECATED( bool wxCreateGreyedImage(const wxImage& in, wxImage& out) ); #endif // WXWIN_COMPATIBILITY_2_8 #endif // wxUSE_TOOLBAR #endif // _WX_TBARBASE_H_
h
rticonnextdds-usecases
data/projects/rticonnextdds-usecases/VehicleTracking/ExampleCode/thirdparty/wxWidgets-3.1.2/Linux/include/wx/control.h
///////////////////////////////////////////////////////////////////////////// // Name: wx/control.h // Purpose: wxControl common interface // Author: Vadim Zeitlin // Modified by: // Created: 26.07.99 // Copyright: (c) wxWidgets team // Licence: wxWindows licence ///////////////////////////////////////////////////////////////////////////// #ifndef _WX_CONTROL_H_BASE_ #define _WX_CONTROL_H_BASE_ // ---------------------------------------------------------------------------- // headers // ---------------------------------------------------------------------------- #include "wx/defs.h" #if wxUSE_CONTROLS #include "wx/window.h" // base class #include "wx/gdicmn.h" // wxEllipsize... extern WXDLLIMPEXP_DATA_CORE(const char) wxControlNameStr[]; // ---------------------------------------------------------------------------- // wxControl is the base class for all controls // ---------------------------------------------------------------------------- class WXDLLIMPEXP_CORE wxControlBase : public wxWindow { public: wxControlBase() { } virtual ~wxControlBase(); // Create() function adds the validator parameter bool Create(wxWindow *parent, wxWindowID id, const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxDefaultSize, long style = 0, const wxValidator& validator = wxDefaultValidator, const wxString& name = wxControlNameStr); // get the control alignment (left/right/centre, top/bottom/centre) int GetAlignment() const { return m_windowStyle & wxALIGN_MASK; } // set label with mnemonics virtual void SetLabel(const wxString& label) wxOVERRIDE { m_labelOrig = label; InvalidateBestSize(); wxWindow::SetLabel(label); } // return the original string, as it was passed to SetLabel() // (i.e. with wx-style mnemonics) virtual wxString GetLabel() const wxOVERRIDE { return m_labelOrig; } // set label text (mnemonics will be escaped) virtual void SetLabelText(const wxString& text) { SetLabel(EscapeMnemonics(text)); } // get just the text of the label, without mnemonic characters ('&') virtual wxString GetLabelText() const { return GetLabelText(GetLabel()); } #if wxUSE_MARKUP // Set the label with markup (and mnemonics). Markup is a simple subset of // HTML with tags such as <b>, <i> and <span>. By default it is not // supported i.e. all the markup is simply stripped and SetLabel() is // called but some controls in some ports do support this already and in // the future most of them should. // // Notice that, being HTML-like, markup also supports XML entities so '<' // should be encoded as "&lt;" and so on, a bare '<' in the input will // likely result in an error. As an exception, a bare '&' is allowed and // indicates that the next character is a mnemonic. To insert a literal '&' // in the control you need to use "&amp;" in the input string. // // Returns true if the label was set, even if the markup in it was ignored. // False is only returned if we failed to parse the label. bool SetLabelMarkup(const wxString& markup) { return DoSetLabelMarkup(markup); } #endif // wxUSE_MARKUP // controls by default inherit the colours of their parents, if a // particular control class doesn't want to do it, it can override // ShouldInheritColours() to return false virtual bool ShouldInheritColours() const wxOVERRIDE { return true; } // WARNING: this doesn't work for all controls nor all platforms! // // simulates the event of given type (i.e. wxButton::Command() is just as // if the button was clicked) virtual void Command(wxCommandEvent &event); virtual bool SetFont(const wxFont& font) wxOVERRIDE; // wxControl-specific processing after processing the update event virtual void DoUpdateWindowUI(wxUpdateUIEvent& event) wxOVERRIDE; wxSize GetSizeFromTextSize(int xlen, int ylen = -1) const { return DoGetSizeFromTextSize(xlen, ylen); } wxSize GetSizeFromTextSize(const wxSize& tsize) const { return DoGetSizeFromTextSize(tsize.x, tsize.y); } // static utilities for mnemonics char (&) handling // ------------------------------------------------ // returns the given string without mnemonic characters ('&') static wxString GetLabelText(const wxString& label); // returns the given string without mnemonic characters ('&') // this function is identic to GetLabelText() and is provided for clarity // and for symmetry with the wxStaticText::RemoveMarkup() function. static wxString RemoveMnemonics(const wxString& str); // escapes (by doubling them) the mnemonics static wxString EscapeMnemonics(const wxString& str); // miscellaneous static utilities // ------------------------------ // replaces parts of the given (multiline) string with an ellipsis if needed static wxString Ellipsize(const wxString& label, const wxDC& dc, wxEllipsizeMode mode, int maxWidth, int flags = wxELLIPSIZE_FLAGS_DEFAULT); // return the accel index in the string or -1 if none and puts the modified // string into second parameter if non NULL static int FindAccelIndex(const wxString& label, wxString *labelOnly = NULL); // this is a helper for the derived class GetClassDefaultAttributes() // implementation: it returns the right colours for the classes which // contain something else (e.g. wxListBox, wxTextCtrl, ...) instead of // being simple controls (such as wxButton, wxCheckBox, ...) static wxVisualAttributes GetCompositeControlsDefaultAttributes(wxWindowVariant variant); protected: // choose the default border for this window virtual wxBorder GetDefaultBorder() const wxOVERRIDE; // creates the control (calls wxWindowBase::CreateBase inside) and adds it // to the list of parents children bool CreateControl(wxWindowBase *parent, wxWindowID id, const wxPoint& pos, const wxSize& size, long style, const wxValidator& validator, const wxString& name); #if wxUSE_MARKUP // This function may be overridden in the derived classes to implement // support for labels with markup. The base class version simply strips the // markup and calls SetLabel() with the remaining text. virtual bool DoSetLabelMarkup(const wxString& markup); #endif // wxUSE_MARKUP // override this to return the total control's size from a string size virtual wxSize DoGetSizeFromTextSize(int xlen, int ylen = -1) const; // initialize the common fields of wxCommandEvent void InitCommandEvent(wxCommandEvent& event) const; // Ellipsize() helper: static wxString DoEllipsizeSingleLine(const wxString& label, const wxDC& dc, wxEllipsizeMode mode, int maxWidth, int replacementWidth); #if wxUSE_MARKUP // Remove markup from the given string, returns empty string on error i.e. // if markup was syntactically invalid. static wxString RemoveMarkup(const wxString& markup); #endif // wxUSE_MARKUP // this field contains the label in wx format, i.e. with '&' mnemonics, // as it was passed to the last SetLabel() call wxString m_labelOrig; wxDECLARE_NO_COPY_CLASS(wxControlBase); }; // ---------------------------------------------------------------------------- // include platform-dependent wxControl declarations // ---------------------------------------------------------------------------- #if defined(__WXUNIVERSAL__) #include "wx/univ/control.h" #elif defined(__WXMSW__) #include "wx/msw/control.h" #elif defined(__WXMOTIF__) #include "wx/motif/control.h" #elif defined(__WXGTK20__) #include "wx/gtk/control.h" #elif defined(__WXGTK__) #include "wx/gtk1/control.h" #elif defined(__WXMAC__) #include "wx/osx/control.h" #elif defined(__WXQT__) #include "wx/qt/control.h" #endif #endif // wxUSE_CONTROLS #endif // _WX_CONTROL_H_BASE_
h
rticonnextdds-usecases
data/projects/rticonnextdds-usecases/VehicleTracking/ExampleCode/thirdparty/wxWidgets-3.1.2/Linux/include/wx/time.h
/////////////////////////////////////////////////////////////////////////////// // Name: wx/time.h // Purpose: Miscellaneous time-related functions. // Author: Vadim Zeitlin // Created: 2011-11-26 // Copyright: (c) 2011 Vadim Zeitlin <[email protected]> // Licence: wxWindows licence /////////////////////////////////////////////////////////////////////////////// #ifndef _WX_TIME_H_ #define _WX_TIME_H_ #include "wx/longlong.h" // Returns the difference between UTC and local time in seconds. WXDLLIMPEXP_BASE int wxGetTimeZone(); // Get number of seconds since local time 00:00:00 Jan 1st 1970. extern long WXDLLIMPEXP_BASE wxGetLocalTime(); // Get number of seconds since GMT 00:00:00, Jan 1st 1970. extern long WXDLLIMPEXP_BASE wxGetUTCTime(); #if wxUSE_LONGLONG typedef wxLongLong wxMilliClock_t; inline long wxMilliClockToLong(wxLongLong ll) { return ll.ToLong(); } #else typedef double wxMilliClock_t; inline long wxMilliClockToLong(double d) { return wx_truncate_cast(long, d); } #endif // wxUSE_LONGLONG // Get number of milliseconds since local time 00:00:00 Jan 1st 1970 extern wxMilliClock_t WXDLLIMPEXP_BASE wxGetLocalTimeMillis(); #if wxUSE_LONGLONG // Get the number of milliseconds or microseconds since the Epoch. wxLongLong WXDLLIMPEXP_BASE wxGetUTCTimeMillis(); wxLongLong WXDLLIMPEXP_BASE wxGetUTCTimeUSec(); #endif // wxUSE_LONGLONG #define wxGetCurrentTime() wxGetLocalTime() // on some really old systems gettimeofday() doesn't have the second argument, // define wxGetTimeOfDay() to hide this difference #ifdef HAVE_GETTIMEOFDAY #ifdef WX_GETTIMEOFDAY_NO_TZ #define wxGetTimeOfDay(tv) gettimeofday(tv) #else #define wxGetTimeOfDay(tv) gettimeofday((tv), NULL) #endif #endif // HAVE_GETTIMEOFDAY /* Two wrapper functions for thread safety */ #ifdef HAVE_LOCALTIME_R #define wxLocaltime_r localtime_r #else WXDLLIMPEXP_BASE struct tm *wxLocaltime_r(const time_t*, struct tm*); #if wxUSE_THREADS && !defined(__WINDOWS__) // On Windows, localtime _is_ threadsafe! #warning using pseudo thread-safe wrapper for localtime to emulate localtime_r #endif #endif #ifdef HAVE_GMTIME_R #define wxGmtime_r gmtime_r #else WXDLLIMPEXP_BASE struct tm *wxGmtime_r(const time_t*, struct tm*); #if wxUSE_THREADS && !defined(__WINDOWS__) // On Windows, gmtime _is_ threadsafe! #warning using pseudo thread-safe wrapper for gmtime to emulate gmtime_r #endif #endif #endif // _WX_TIME_H_
h
rticonnextdds-usecases
data/projects/rticonnextdds-usecases/VehicleTracking/ExampleCode/thirdparty/wxWidgets-3.1.2/Linux/include/wx/fdrepdlg.h
///////////////////////////////////////////////////////////////////////////// // Name: wx/fdrepdlg.h // Purpose: wxFindReplaceDialog class // Author: Markus Greither and Vadim Zeitlin // Modified by: // Created: 23/03/2001 // Copyright: (c) Markus Greither // Licence: wxWindows licence ///////////////////////////////////////////////////////////////////////////// #ifndef _WX_FINDREPLACEDLG_H_ #define _WX_FINDREPLACEDLG_H_ #include "wx/defs.h" #if wxUSE_FINDREPLDLG #include "wx/dialog.h" class WXDLLIMPEXP_FWD_CORE wxFindDialogEvent; class WXDLLIMPEXP_FWD_CORE wxFindReplaceDialog; class WXDLLIMPEXP_FWD_CORE wxFindReplaceData; class WXDLLIMPEXP_FWD_CORE wxFindReplaceDialogImpl; // ---------------------------------------------------------------------------- // Flags for wxFindReplaceData.Flags // ---------------------------------------------------------------------------- // flages used by wxFindDialogEvent::GetFlags() enum wxFindReplaceFlags { // downward search/replace selected (otherwise - upwards) wxFR_DOWN = 1, // whole word search/replace selected wxFR_WHOLEWORD = 2, // case sensitive search/replace selected (otherwise - case insensitive) wxFR_MATCHCASE = 4 }; // these flags can be specified in wxFindReplaceDialog ctor or Create() enum wxFindReplaceDialogStyles { // replace dialog (otherwise find dialog) wxFR_REPLACEDIALOG = 1, // don't allow changing the search direction wxFR_NOUPDOWN = 2, // don't allow case sensitive searching wxFR_NOMATCHCASE = 4, // don't allow whole word searching wxFR_NOWHOLEWORD = 8 }; // ---------------------------------------------------------------------------- // wxFindReplaceData: holds Setup Data/Feedback Data for wxFindReplaceDialog // ---------------------------------------------------------------------------- class WXDLLIMPEXP_CORE wxFindReplaceData : public wxObject { public: wxFindReplaceData() { Init(); } wxFindReplaceData(wxUint32 flags) { Init(); SetFlags(flags); } // accessors const wxString& GetFindString() const { return m_FindWhat; } const wxString& GetReplaceString() const { return m_ReplaceWith; } int GetFlags() const { return m_Flags; } // setters: may only be called before showing the dialog, no effect later void SetFlags(wxUint32 flags) { m_Flags = flags; } void SetFindString(const wxString& str) { m_FindWhat = str; } void SetReplaceString(const wxString& str) { m_ReplaceWith = str; } protected: void Init(); private: wxUint32 m_Flags; wxString m_FindWhat, m_ReplaceWith; friend class wxFindReplaceDialogBase; }; // ---------------------------------------------------------------------------- // wxFindReplaceDialogBase // ---------------------------------------------------------------------------- class WXDLLIMPEXP_CORE wxFindReplaceDialogBase : public wxDialog { public: // ctors and such wxFindReplaceDialogBase() { m_FindReplaceData = NULL; } wxFindReplaceDialogBase(wxWindow * WXUNUSED(parent), wxFindReplaceData *data, const wxString& WXUNUSED(title), int WXUNUSED(style) = 0) { m_FindReplaceData = data; } virtual ~wxFindReplaceDialogBase(); // find dialog data access const wxFindReplaceData *GetData() const { return m_FindReplaceData; } void SetData(wxFindReplaceData *data) { m_FindReplaceData = data; } // implementation only, don't use void Send(wxFindDialogEvent& event); protected: wxFindReplaceData *m_FindReplaceData; // the last string we searched for wxString m_lastSearch; wxDECLARE_NO_COPY_CLASS(wxFindReplaceDialogBase); }; // include wxFindReplaceDialog declaration #if defined(__WXMSW__) && !defined(__WXUNIVERSAL__) #include "wx/msw/fdrepdlg.h" #else #define wxGenericFindReplaceDialog wxFindReplaceDialog #include "wx/generic/fdrepdlg.h" #endif // ---------------------------------------------------------------------------- // wxFindReplaceDialog events // ---------------------------------------------------------------------------- class WXDLLIMPEXP_CORE wxFindDialogEvent : public wxCommandEvent { public: wxFindDialogEvent(wxEventType commandType = wxEVT_NULL, int id = 0) : wxCommandEvent(commandType, id) { } wxFindDialogEvent(const wxFindDialogEvent& event) : wxCommandEvent(event), m_strReplace(event.m_strReplace) { } int GetFlags() const { return GetInt(); } wxString GetFindString() const { return GetString(); } const wxString& GetReplaceString() const { return m_strReplace; } wxFindReplaceDialog *GetDialog() const { return wxStaticCast(GetEventObject(), wxFindReplaceDialog); } // implementation only void SetFlags(int flags) { SetInt(flags); } void SetFindString(const wxString& str) { SetString(str); } void SetReplaceString(const wxString& str) { m_strReplace = str; } virtual wxEvent *Clone() const wxOVERRIDE { return new wxFindDialogEvent(*this); } private: wxString m_strReplace; wxDECLARE_DYNAMIC_CLASS_NO_ASSIGN(wxFindDialogEvent); }; wxDECLARE_EXPORTED_EVENT( WXDLLIMPEXP_CORE, wxEVT_FIND, wxFindDialogEvent ); wxDECLARE_EXPORTED_EVENT( WXDLLIMPEXP_CORE, wxEVT_FIND_NEXT, wxFindDialogEvent ); wxDECLARE_EXPORTED_EVENT( WXDLLIMPEXP_CORE, wxEVT_FIND_REPLACE, wxFindDialogEvent ); wxDECLARE_EXPORTED_EVENT( WXDLLIMPEXP_CORE, wxEVT_FIND_REPLACE_ALL, wxFindDialogEvent ); wxDECLARE_EXPORTED_EVENT( WXDLLIMPEXP_CORE, wxEVT_FIND_CLOSE, wxFindDialogEvent ); typedef void (wxEvtHandler::*wxFindDialogEventFunction)(wxFindDialogEvent&); #define wxFindDialogEventHandler(func) \ wxEVENT_HANDLER_CAST(wxFindDialogEventFunction, func) #define EVT_FIND(id, fn) \ wx__DECLARE_EVT1(wxEVT_FIND, id, wxFindDialogEventHandler(fn)) #define EVT_FIND_NEXT(id, fn) \ wx__DECLARE_EVT1(wxEVT_FIND_NEXT, id, wxFindDialogEventHandler(fn)) #define EVT_FIND_REPLACE(id, fn) \ wx__DECLARE_EVT1(wxEVT_FIND_REPLACE, id, wxFindDialogEventHandler(fn)) #define EVT_FIND_REPLACE_ALL(id, fn) \ wx__DECLARE_EVT1(wxEVT_FIND_REPLACE_ALL, id, wxFindDialogEventHandler(fn)) #define EVT_FIND_CLOSE(id, fn) \ wx__DECLARE_EVT1(wxEVT_FIND_CLOSE, id, wxFindDialogEventHandler(fn)) // old wxEVT_COMMAND_* constants #define wxEVT_COMMAND_FIND wxEVT_FIND #define wxEVT_COMMAND_FIND_NEXT wxEVT_FIND_NEXT #define wxEVT_COMMAND_FIND_REPLACE wxEVT_FIND_REPLACE #define wxEVT_COMMAND_FIND_REPLACE_ALL wxEVT_FIND_REPLACE_ALL #define wxEVT_COMMAND_FIND_CLOSE wxEVT_FIND_CLOSE #endif // wxUSE_FINDREPLDLG #endif // _WX_FDREPDLG_H
h
rticonnextdds-usecases
data/projects/rticonnextdds-usecases/VehicleTracking/ExampleCode/thirdparty/wxWidgets-3.1.2/Linux/include/wx/chkconf.h
/* * Name: wx/chkconf.h * Purpose: check the config settings for consistency * Author: Vadim Zeitlin * Modified by: * Created: 09.08.00 * Copyright: (c) 2000 Vadim Zeitlin <[email protected]> * Licence: wxWindows licence */ /* THIS IS A C FILE, DON'T USE C++ FEATURES (IN PARTICULAR COMMENTS) IN IT */ #ifndef _WX_CHKCONF_H_ #define _WX_CHKCONF_H_ /* ************************************************** PLEASE READ THIS IF YOU GET AN ERROR IN THIS FILE! ************************************************** If you get an error saying "wxUSE_FOO must be defined", it means that you are not using the correct up-to-date version of setup.h. This happens most often when using git or snapshots and a new symbol was added to setup0.h and you haven't updated your local setup.h to reflect it. If this is the case, you need to propagate the changes from setup0.h to your setup.h and, if using makefiles under MSW, also remove setup.h under the build directory (lib/$(COMPILER)_{lib,dll}/msw[u][d][dll]/wx) so that the new setup.h is copied there. If you get an error of the form "wxFoo requires wxBar", then the settings in your setup.h are inconsistent. You have the choice between correcting them manually or commenting out #define wxABORT_ON_CONFIG_ERROR below to try to correct the problems automatically (not really recommended but might work). */ /* This file has the following sections: 1. checks that all wxUSE_XXX symbols we use are defined a) first the non-GUI ones b) then the GUI-only ones 2. platform-specific checks done in the platform headers 3. generic consistency checks a) first the non-GUI ones b) then the GUI-only ones */ /* this global setting determines what should we do if the setting FOO requires BAR and BAR is not set: we can either silently unset FOO as well (do this if you're trying to build the smallest possible library) or give an error and abort (default as leads to least surprising behaviour) */ #define wxABORT_ON_CONFIG_ERROR /* global features */ /* If we're compiling without support for threads/exceptions we have to disable the corresponding features. */ #ifdef wxNO_THREADS # undef wxUSE_THREADS # define wxUSE_THREADS 0 #endif /* wxNO_THREADS */ #ifdef wxNO_EXCEPTIONS # undef wxUSE_EXCEPTIONS # define wxUSE_EXCEPTIONS 0 #endif /* wxNO_EXCEPTIONS */ /* we also must disable exceptions if compiler doesn't support them */ #if defined(_MSC_VER) && !defined(_CPPUNWIND) # undef wxUSE_EXCEPTIONS # define wxUSE_EXCEPTIONS 0 #endif /* VC++ without exceptions support */ /* Section 1a: tests for non GUI features. please keep the options in alphabetical order! */ #ifndef wxUSE_ANY # ifdef wxABORT_ON_CONFIG_ERROR # error "wxUSE_ANY must be defined, please read comment near the top of this file." # else # define wxUSE_ANY 0 # endif #endif /* wxUSE_ANY */ #ifndef wxUSE_COMPILER_TLS # ifdef wxABORT_ON_CONFIG_ERROR # error "wxUSE_COMPILER_TLS must be defined, please read comment near the top of this file." # else # define wxUSE_COMPILER_TLS 0 # endif #endif /* !defined(wxUSE_COMPILER_TLS) */ #ifndef wxUSE_CONSOLE_EVENTLOOP # ifdef wxABORT_ON_CONFIG_ERROR # error "wxUSE_CONSOLE_EVENTLOOP must be defined, please read comment near the top of this file." # else # define wxUSE_CONSOLE_EVENTLOOP 0 # endif #endif /* !defined(wxUSE_CONSOLE_EVENTLOOP) */ #ifndef wxUSE_DYNLIB_CLASS # ifdef wxABORT_ON_CONFIG_ERROR # error "wxUSE_DYNLIB_CLASS must be defined, please read comment near the top of this file." # else # define wxUSE_DYNLIB_CLASS 0 # endif #endif /* !defined(wxUSE_DYNLIB_CLASS) */ #ifndef wxUSE_EXCEPTIONS # ifdef wxABORT_ON_CONFIG_ERROR # error "wxUSE_EXCEPTIONS must be defined, please read comment near the top of this file." # else # define wxUSE_EXCEPTIONS 0 # endif #endif /* !defined(wxUSE_EXCEPTIONS) */ #ifndef wxUSE_FILE_HISTORY # ifdef wxABORT_ON_CONFIG_ERROR # error "wxUSE_FILE_HISTORY must be defined, please read comment near the top of this file." # else # define wxUSE_FILE_HISTORY 0 # endif #endif /* !defined(wxUSE_FILE_HISTORY) */ #ifndef wxUSE_FILESYSTEM # ifdef wxABORT_ON_CONFIG_ERROR # error "wxUSE_FILESYSTEM must be defined, please read comment near the top of this file." # else # define wxUSE_FILESYSTEM 0 # endif #endif /* !defined(wxUSE_FILESYSTEM) */ #ifndef wxUSE_FS_ARCHIVE # ifdef wxABORT_ON_CONFIG_ERROR # error "wxUSE_FS_ARCHIVE must be defined, please read comment near the top of this file." # else # define wxUSE_FS_ARCHIVE 0 # endif #endif /* !defined(wxUSE_FS_ARCHIVE) */ #ifndef wxUSE_FSVOLUME # ifdef wxABORT_ON_CONFIG_ERROR # error "wxUSE_FSVOLUME must be defined, please read comment near the top of this file." # else # define wxUSE_FSVOLUME 0 # endif #endif /* !defined(wxUSE_FSVOLUME) */ #ifndef wxUSE_FSWATCHER # ifdef wxABORT_ON_CONFIG_ERROR # error "wxUSE_FSWATCHER must be defined, please read comment near the top of this file." # else # define wxUSE_FSWATCHER 0 # endif #endif /* !defined(wxUSE_FSWATCHER) */ #ifndef wxUSE_DYNAMIC_LOADER # ifdef wxABORT_ON_CONFIG_ERROR # error "wxUSE_DYNAMIC_LOADER must be defined, please read comment near the top of this file." # else # define wxUSE_DYNAMIC_LOADER 0 # endif #endif /* !defined(wxUSE_DYNAMIC_LOADER) */ #ifndef wxUSE_INTL # ifdef wxABORT_ON_CONFIG_ERROR # error "wxUSE_INTL must be defined, please read comment near the top of this file." # else # define wxUSE_INTL 0 # endif #endif /* !defined(wxUSE_INTL) */ #ifndef wxUSE_IPV6 # ifdef wxABORT_ON_CONFIG_ERROR # error "wxUSE_IPV6 must be defined, please read comment near the top of this file." # else # define wxUSE_IPV6 0 # endif #endif /* !defined(wxUSE_IPV6) */ #ifndef wxUSE_LOG # ifdef wxABORT_ON_CONFIG_ERROR # error "wxUSE_LOG must be defined, please read comment near the top of this file." # else # define wxUSE_LOG 0 # endif #endif /* !defined(wxUSE_LOG) */ #ifndef wxUSE_LONGLONG # ifdef wxABORT_ON_CONFIG_ERROR # error "wxUSE_LONGLONG must be defined, please read comment near the top of this file." # else # define wxUSE_LONGLONG 0 # endif #endif /* !defined(wxUSE_LONGLONG) */ #ifndef wxUSE_MIMETYPE # ifdef wxABORT_ON_CONFIG_ERROR # error "wxUSE_MIMETYPE must be defined, please read comment near the top of this file." # else # define wxUSE_MIMETYPE 0 # endif #endif /* !defined(wxUSE_MIMETYPE) */ #ifndef wxUSE_ON_FATAL_EXCEPTION # ifdef wxABORT_ON_CONFIG_ERROR # error "wxUSE_ON_FATAL_EXCEPTION must be defined, please read comment near the top of this file." # else # define wxUSE_ON_FATAL_EXCEPTION 0 # endif #endif /* !defined(wxUSE_ON_FATAL_EXCEPTION) */ #ifndef wxUSE_PRINTF_POS_PARAMS # ifdef wxABORT_ON_CONFIG_ERROR # error "wxUSE_PRINTF_POS_PARAMS must be defined, please read comment near the top of this file." # else # define wxUSE_PRINTF_POS_PARAMS 0 # endif #endif /* !defined(wxUSE_PRINTF_POS_PARAMS) */ #ifndef wxUSE_PROTOCOL # ifdef wxABORT_ON_CONFIG_ERROR # error "wxUSE_PROTOCOL must be defined, please read comment near the top of this file." # else # define wxUSE_PROTOCOL 0 # endif #endif /* !defined(wxUSE_PROTOCOL) */ /* we may not define wxUSE_PROTOCOL_XXX if wxUSE_PROTOCOL is set to 0 */ #if !wxUSE_PROTOCOL # undef wxUSE_PROTOCOL_HTTP # undef wxUSE_PROTOCOL_FTP # undef wxUSE_PROTOCOL_FILE # define wxUSE_PROTOCOL_HTTP 0 # define wxUSE_PROTOCOL_FTP 0 # define wxUSE_PROTOCOL_FILE 0 #endif /* wxUSE_PROTOCOL */ #ifndef wxUSE_PROTOCOL_HTTP # ifdef wxABORT_ON_CONFIG_ERROR # error "wxUSE_PROTOCOL_HTTP must be defined, please read comment near the top of this file." # else # define wxUSE_PROTOCOL_HTTP 0 # endif #endif /* !defined(wxUSE_PROTOCOL_HTTP) */ #ifndef wxUSE_PROTOCOL_FTP # ifdef wxABORT_ON_CONFIG_ERROR # error "wxUSE_PROTOCOL_FTP must be defined, please read comment near the top of this file." # else # define wxUSE_PROTOCOL_FTP 0 # endif #endif /* !defined(wxUSE_PROTOCOL_FTP) */ #ifndef wxUSE_PROTOCOL_FILE # ifdef wxABORT_ON_CONFIG_ERROR # error "wxUSE_PROTOCOL_FILE must be defined, please read comment near the top of this file." # else # define wxUSE_PROTOCOL_FILE 0 # endif #endif /* !defined(wxUSE_PROTOCOL_FILE) */ #ifndef wxUSE_REGEX # ifdef wxABORT_ON_CONFIG_ERROR # error "wxUSE_REGEX must be defined, please read comment near the top of this file." # else # define wxUSE_REGEX 0 # endif #endif /* !defined(wxUSE_REGEX) */ #ifndef wxUSE_SECRETSTORE # ifdef wxABORT_ON_CONFIG_ERROR # error "wxUSE_SECRETSTORE must be defined, please read comment near the top of this file." # else # define wxUSE_SECRETSTORE 1 # endif #endif /* !defined(wxUSE_SECRETSTORE) */ #ifndef wxUSE_STDPATHS # ifdef wxABORT_ON_CONFIG_ERROR # error "wxUSE_STDPATHS must be defined, please read comment near the top of this file." # else # define wxUSE_STDPATHS 1 # endif #endif /* !defined(wxUSE_STDPATHS) */ #ifndef wxUSE_XML # ifdef wxABORT_ON_CONFIG_ERROR # error "wxUSE_XML must be defined, please read comment near the top of this file." # else # define wxUSE_XML 0 # endif #endif /* !defined(wxUSE_XML) */ #ifndef wxUSE_SOCKETS # ifdef wxABORT_ON_CONFIG_ERROR # error "wxUSE_SOCKETS must be defined, please read comment near the top of this file." # else # define wxUSE_SOCKETS 0 # endif #endif /* !defined(wxUSE_SOCKETS) */ #ifndef wxUSE_STD_CONTAINERS # ifdef wxABORT_ON_CONFIG_ERROR # error "wxUSE_STD_CONTAINERS must be defined, please read comment near the top of this file." # else # define wxUSE_STD_CONTAINERS 0 # endif #endif /* !defined(wxUSE_STD_CONTAINERS) */ #ifndef wxUSE_STD_CONTAINERS_COMPATIBLY # ifdef wxABORT_ON_CONFIG_ERROR # error "wxUSE_STD_CONTAINERS_COMPATIBLY must be defined, please read comment near the top of this file." # else # define wxUSE_STD_CONTAINERS_COMPATIBLY 0 # endif #endif /* !defined(wxUSE_STD_CONTAINERS_COMPATIBLY) */ #ifndef wxUSE_STD_STRING_CONV_IN_WXSTRING # ifdef wxABORT_ON_CONFIG_ERROR # error "wxUSE_STD_STRING_CONV_IN_WXSTRING must be defined, please read comment near the top of this file." # else # define wxUSE_STD_STRING_CONV_IN_WXSTRING 0 # endif #endif /* !defined(wxUSE_STD_STRING_CONV_IN_WXSTRING) */ #ifndef wxUSE_STREAMS # ifdef wxABORT_ON_CONFIG_ERROR # error "wxUSE_STREAMS must be defined, please read comment near the top of this file." # else # define wxUSE_STREAMS 0 # endif #endif /* !defined(wxUSE_STREAMS) */ #ifndef wxUSE_STOPWATCH # ifdef wxABORT_ON_CONFIG_ERROR # error "wxUSE_STOPWATCH must be defined, please read comment near the top of this file." # else # define wxUSE_STOPWATCH 0 # endif #endif /* !defined(wxUSE_STOPWATCH) */ #ifndef wxUSE_TEXTBUFFER # ifdef wxABORT_ON_CONFIG_ERROR # error "wxUSE_TEXTBUFFER must be defined, please read comment near the top of this file." # else # define wxUSE_TEXTBUFFER 0 # endif #endif /* !defined(wxUSE_TEXTBUFFER) */ #ifndef wxUSE_TEXTFILE # ifdef wxABORT_ON_CONFIG_ERROR # error "wxUSE_TEXTFILE must be defined, please read comment near the top of this file." # else # define wxUSE_TEXTFILE 0 # endif #endif /* !defined(wxUSE_TEXTFILE) */ #ifndef wxUSE_UNICODE # ifdef wxABORT_ON_CONFIG_ERROR # error "wxUSE_UNICODE must be defined, please read comment near the top of this file." # else # define wxUSE_UNICODE 0 # endif #endif /* !defined(wxUSE_UNICODE) */ #ifndef wxUSE_UNSAFE_WXSTRING_CONV # ifdef wxABORT_ON_CONFIG_ERROR # error "wxUSE_UNSAFE_WXSTRING_CONV must be defined, please read comment near the top of this file." # else # define wxUSE_UNSAFE_WXSTRING_CONV 0 # endif #endif /* !defined(wxUSE_UNSAFE_WXSTRING_CONV) */ #ifndef wxUSE_URL # ifdef wxABORT_ON_CONFIG_ERROR # error "wxUSE_URL must be defined, please read comment near the top of this file." # else # define wxUSE_URL 0 # endif #endif /* !defined(wxUSE_URL) */ #ifndef wxUSE_VARIANT # ifdef wxABORT_ON_CONFIG_ERROR # error "wxUSE_VARIANT must be defined, please read comment near the top of this file." # else # define wxUSE_VARIANT 0 # endif #endif /* wxUSE_VARIANT */ #ifndef wxUSE_XLOCALE # ifdef wxABORT_ON_CONFIG_ERROR # error "wxUSE_XLOCALE must be defined, please read comment near the top of this file." # else # define wxUSE_XLOCALE 0 # endif #endif /* !defined(wxUSE_XLOCALE) */ /* Section 1b: all these tests are for GUI only. please keep the options in alphabetical order! */ #if wxUSE_GUI /* all of the settings tested below must be defined or we'd get an error from preprocessor about invalid integer expression */ #ifndef wxUSE_ABOUTDLG # ifdef wxABORT_ON_CONFIG_ERROR # error "wxUSE_ABOUTDLG must be defined, please read comment near the top of this file." # else # define wxUSE_ABOUTDLG 0 # endif #endif /* !defined(wxUSE_ABOUTDLG) */ #ifndef wxUSE_ACCEL # ifdef wxABORT_ON_CONFIG_ERROR # error "wxUSE_ACCEL must be defined, please read comment near the top of this file." # else # define wxUSE_ACCEL 0 # endif #endif /* !defined(wxUSE_ACCEL) */ #ifndef wxUSE_ACCESSIBILITY # ifdef wxABORT_ON_CONFIG_ERROR # error "wxUSE_ACCESSIBILITY must be defined, please read comment near the top of this file." # else # define wxUSE_ACCESSIBILITY 0 # endif #endif /* !defined(wxUSE_ACCESSIBILITY) */ #ifndef wxUSE_ADDREMOVECTRL # ifdef wxABORT_ON_CONFIG_ERROR # error "wxUSE_ADDREMOVECTRL must be defined, please read comment near the top of this file." # else # define wxUSE_ADDREMOVECTRL 0 # endif #endif /* !defined(wxUSE_ADDREMOVECTRL) */ #ifndef wxUSE_ACTIVITYINDICATOR # ifdef wxABORT_ON_CONFIG_ERROR # error "wxUSE_ACTIVITYINDICATOR must be defined, please read comment near the top of this file." # else # define wxUSE_ACTIVITYINDICATOR 0 # endif #endif /* !defined(wxUSE_ACTIVITYINDICATOR) */ #ifndef wxUSE_ANIMATIONCTRL # ifdef wxABORT_ON_CONFIG_ERROR # error "wxUSE_ANIMATIONCTRL must be defined, please read comment near the top of this file." # else # define wxUSE_ANIMATIONCTRL 0 # endif #endif /* !defined(wxUSE_ANIMATIONCTRL) */ #ifndef wxUSE_ARTPROVIDER_STD # ifdef wxABORT_ON_CONFIG_ERROR # error "wxUSE_ARTPROVIDER_STD must be defined, please read comment near the top of this file." # else # define wxUSE_ARTPROVIDER_STD 0 # endif #endif /* !defined(wxUSE_ARTPROVIDER_STD) */ #ifndef wxUSE_ARTPROVIDER_TANGO # ifdef wxABORT_ON_CONFIG_ERROR # error "wxUSE_ARTPROVIDER_TANGO must be defined, please read comment near the top of this file." # else # define wxUSE_ARTPROVIDER_TANGO 0 # endif #endif /* !defined(wxUSE_ARTPROVIDER_TANGO) */ #ifndef wxUSE_AUTOID_MANAGEMENT # ifdef wxABORT_ON_CONFIG_ERROR # error "wxUSE_AUTOID_MANAGEMENT must be defined, please read comment near the top of this file." # else # define wxUSE_AUTOID_MANAGEMENT 0 # endif #endif /* !defined(wxUSE_AUTOID_MANAGEMENT) */ #ifndef wxUSE_BITMAPCOMBOBOX # ifdef wxABORT_ON_CONFIG_ERROR # error "wxUSE_BITMAPCOMBOBOX must be defined, please read comment near the top of this file." # else # define wxUSE_BITMAPCOMBOBOX 0 # endif #endif /* !defined(wxUSE_BITMAPCOMBOBOX) */ #ifndef wxUSE_BMPBUTTON # ifdef wxABORT_ON_CONFIG_ERROR # error "wxUSE_BMPBUTTON must be defined, please read comment near the top of this file." # else # define wxUSE_BMPBUTTON 0 # endif #endif /* !defined(wxUSE_BMPBUTTON) */ #ifndef wxUSE_BUTTON # ifdef wxABORT_ON_CONFIG_ERROR # error "wxUSE_BUTTON must be defined, please read comment near the top of this file." # else # define wxUSE_BUTTON 0 # endif #endif /* !defined(wxUSE_BUTTON) */ #ifndef wxUSE_CAIRO # ifdef wxABORT_ON_CONFIG_ERROR # error "wxUSE_CAIRO must be defined, please read comment near the top of this file." # else # define wxUSE_CAIRO 0 # endif #endif /* !defined(wxUSE_CAIRO) */ #ifndef wxUSE_CALENDARCTRL # ifdef wxABORT_ON_CONFIG_ERROR # error "wxUSE_CALENDARCTRL must be defined, please read comment near the top of this file." # else # define wxUSE_CALENDARCTRL 0 # endif #endif /* !defined(wxUSE_CALENDARCTRL) */ #ifndef wxUSE_CARET # ifdef wxABORT_ON_CONFIG_ERROR # error "wxUSE_CARET must be defined, please read comment near the top of this file." # else # define wxUSE_CARET 0 # endif #endif /* !defined(wxUSE_CARET) */ #ifndef wxUSE_CHECKBOX # ifdef wxABORT_ON_CONFIG_ERROR # error "wxUSE_CHECKBOX must be defined, please read comment near the top of this file." # else # define wxUSE_CHECKBOX 0 # endif #endif /* !defined(wxUSE_CHECKBOX) */ #ifndef wxUSE_CHECKLISTBOX # ifdef wxABORT_ON_CONFIG_ERROR # error "wxUSE_CHECKLISTBOX must be defined, please read comment near the top of this file." # else # define wxUSE_CHECKLISTBOX 0 # endif #endif /* !defined(wxUSE_CHECKLISTBOX) */ #ifndef wxUSE_CHOICE # ifdef wxABORT_ON_CONFIG_ERROR # error "wxUSE_CHOICE must be defined, please read comment near the top of this file." # else # define wxUSE_CHOICE 0 # endif #endif /* !defined(wxUSE_CHOICE) */ #ifndef wxUSE_CHOICEBOOK # ifdef wxABORT_ON_CONFIG_ERROR # error "wxUSE_CHOICEBOOK must be defined, please read comment near the top of this file." # else # define wxUSE_CHOICEBOOK 0 # endif #endif /* !defined(wxUSE_CHOICEBOOK) */ #ifndef wxUSE_CHOICEDLG # ifdef wxABORT_ON_CONFIG_ERROR # error "wxUSE_CHOICEDLG must be defined, please read comment near the top of this file." # else # define wxUSE_CHOICEDLG 0 # endif #endif /* !defined(wxUSE_CHOICEDLG) */ #ifndef wxUSE_CLIPBOARD # ifdef wxABORT_ON_CONFIG_ERROR # error "wxUSE_CLIPBOARD must be defined, please read comment near the top of this file." # else # define wxUSE_CLIPBOARD 0 # endif #endif /* !defined(wxUSE_CLIPBOARD) */ #ifndef wxUSE_COLLPANE # ifdef wxABORT_ON_CONFIG_ERROR # error "wxUSE_COLLPANE must be defined, please read comment near the top of this file." # else # define wxUSE_COLLPANE 0 # endif #endif /* !defined(wxUSE_COLLPANE) */ #ifndef wxUSE_COLOURDLG # ifdef wxABORT_ON_CONFIG_ERROR # error "wxUSE_COLOURDLG must be defined, please read comment near the top of this file." # else # define wxUSE_COLOURDLG 0 # endif #endif /* !defined(wxUSE_COLOURDLG) */ #ifndef wxUSE_COLOURPICKERCTRL # ifdef wxABORT_ON_CONFIG_ERROR # error "wxUSE_COLOURPICKERCTRL must be defined, please read comment near the top of this file." # else # define wxUSE_COLOURPICKERCTRL 0 # endif #endif /* !defined(wxUSE_COLOURPICKERCTRL) */ #ifndef wxUSE_COMBOBOX # ifdef wxABORT_ON_CONFIG_ERROR # error "wxUSE_COMBOBOX must be defined, please read comment near the top of this file." # else # define wxUSE_COMBOBOX 0 # endif #endif /* !defined(wxUSE_COMBOBOX) */ #ifndef wxUSE_COMMANDLINKBUTTON # ifdef wxABORT_ON_CONFIG_ERROR # error "wxUSE_COMMANDLINKBUTTON must be defined, please read comment near the top of this file." # else # define wxUSE_COMMANDLINKBUTTON 0 # endif #endif /* !defined(wxUSE_COMMANDLINKBUTTON) */ #ifndef wxUSE_COMBOCTRL # ifdef wxABORT_ON_CONFIG_ERROR # error "wxUSE_COMBOCTRL must be defined, please read comment near the top of this file." # else # define wxUSE_COMBOCTRL 0 # endif #endif /* !defined(wxUSE_COMBOCTRL) */ #ifndef wxUSE_DATAOBJ # ifdef wxABORT_ON_CONFIG_ERROR # error "wxUSE_DATAOBJ must be defined, please read comment near the top of this file." # else # define wxUSE_DATAOBJ 0 # endif #endif /* !defined(wxUSE_DATAOBJ) */ #ifndef wxUSE_DATAVIEWCTRL # ifdef wxABORT_ON_CONFIG_ERROR # error "wxUSE_DATAVIEWCTRL must be defined, please read comment near the top of this file." # else # define wxUSE_DATAVIEWCTRL 0 # endif #endif /* !defined(wxUSE_DATAVIEWCTRL) */ #ifndef wxUSE_DATEPICKCTRL # ifdef wxABORT_ON_CONFIG_ERROR # error "wxUSE_DATEPICKCTRL must be defined, please read comment near the top of this file." # else # define wxUSE_DATEPICKCTRL 0 # endif #endif /* !defined(wxUSE_DATEPICKCTRL) */ #ifndef wxUSE_DC_TRANSFORM_MATRIX # ifdef wxABORT_ON_CONFIG_ERROR # error "wxUSE_DC_TRANSFORM_MATRIX must be defined, please read comment near the top of this file." # else # define wxUSE_DC_TRANSFORM_MATRIX 1 # endif #endif /* wxUSE_DC_TRANSFORM_MATRIX */ #ifndef wxUSE_DIRPICKERCTRL # ifdef wxABORT_ON_CONFIG_ERROR # error "wxUSE_DIRPICKERCTRL must be defined, please read comment near the top of this file." # else # define wxUSE_DIRPICKERCTRL 0 # endif #endif /* !defined(wxUSE_DIRPICKERCTRL) */ #ifndef wxUSE_DISPLAY # ifdef wxABORT_ON_CONFIG_ERROR # error "wxUSE_DISPLAY must be defined, please read comment near the top of this file." # else # define wxUSE_DISPLAY 0 # endif #endif /* !defined(wxUSE_DISPLAY) */ #ifndef wxUSE_DOC_VIEW_ARCHITECTURE # ifdef wxABORT_ON_CONFIG_ERROR # error "wxUSE_DOC_VIEW_ARCHITECTURE must be defined, please read comment near the top of this file." # else # define wxUSE_DOC_VIEW_ARCHITECTURE 0 # endif #endif /* !defined(wxUSE_DOC_VIEW_ARCHITECTURE) */ #ifndef wxUSE_FILECTRL # ifdef wxABORT_ON_CONFIG_ERROR # error "wxUSE_FILECTRL must be defined, please read comment near the top of this file." # else # define wxUSE_FILECTRL 0 # endif #endif /* !defined(wxUSE_FILECTRL) */ #ifndef wxUSE_FILEDLG # ifdef wxABORT_ON_CONFIG_ERROR # error "wxUSE_FILEDLG must be defined, please read comment near the top of this file." # else # define wxUSE_FILEDLG 0 # endif #endif /* !defined(wxUSE_FILEDLG) */ #ifndef wxUSE_FILEPICKERCTRL # ifdef wxABORT_ON_CONFIG_ERROR # error "wxUSE_FILEPICKERCTRL must be defined, please read comment near the top of this file." # else # define wxUSE_FILEPICKERCTRL 0 # endif #endif /* !defined(wxUSE_FILEPICKERCTRL) */ #ifndef wxUSE_FONTDLG # ifdef wxABORT_ON_CONFIG_ERROR # error "wxUSE_FONTDLG must be defined, please read comment near the top of this file." # else # define wxUSE_FONTDLG 0 # endif #endif /* !defined(wxUSE_FONTDLG) */ #ifndef wxUSE_FONTMAP # ifdef wxABORT_ON_CONFIG_ERROR # error "wxUSE_FONTMAP must be defined, please read comment near the top of this file." # else # define wxUSE_FONTMAP 0 # endif #endif /* !defined(wxUSE_FONTMAP) */ #ifndef wxUSE_FONTPICKERCTRL # ifdef wxABORT_ON_CONFIG_ERROR # error "wxUSE_FONTPICKERCTRL must be defined, please read comment near the top of this file." # else # define wxUSE_FONTPICKERCTRL 0 # endif #endif /* !defined(wxUSE_FONTPICKERCTRL) */ #ifndef wxUSE_GAUGE # ifdef wxABORT_ON_CONFIG_ERROR # error "wxUSE_GAUGE must be defined, please read comment near the top of this file." # else # define wxUSE_GAUGE 0 # endif #endif /* !defined(wxUSE_GAUGE) */ #ifndef wxUSE_GRAPHICS_CONTEXT # ifdef wxABORT_ON_CONFIG_ERROR # error "wxUSE_GRAPHICS_CONTEXT must be defined, please read comment near the top of this file." # else # define wxUSE_GRAPHICS_CONTEXT 0 # endif #endif /* !defined(wxUSE_GRAPHICS_CONTEXT) */ #ifndef wxUSE_GRID # ifdef wxABORT_ON_CONFIG_ERROR # error "wxUSE_GRID must be defined, please read comment near the top of this file." # else # define wxUSE_GRID 0 # endif #endif /* !defined(wxUSE_GRID) */ #ifndef wxUSE_HEADERCTRL # ifdef wxABORT_ON_CONFIG_ERROR # error "wxUSE_HEADERCTRL must be defined, please read comment near the top of this file." # else # define wxUSE_HEADERCTRL 0 # endif #endif /* !defined(wxUSE_HEADERCTRL) */ #ifndef wxUSE_HELP # ifdef wxABORT_ON_CONFIG_ERROR # error "wxUSE_HELP must be defined, please read comment near the top of this file." # else # define wxUSE_HELP 0 # endif #endif /* !defined(wxUSE_HELP) */ #ifndef wxUSE_HYPERLINKCTRL # ifdef wxABORT_ON_CONFIG_ERROR # error "wxUSE_HYPERLINKCTRL must be defined, please read comment near the top of this file." # else # define wxUSE_HYPERLINKCTRL 0 # endif #endif /* !defined(wxUSE_HYPERLINKCTRL) */ #ifndef wxUSE_HTML # ifdef wxABORT_ON_CONFIG_ERROR # error "wxUSE_HTML must be defined, please read comment near the top of this file." # else # define wxUSE_HTML 0 # endif #endif /* !defined(wxUSE_HTML) */ #ifndef wxUSE_LIBMSPACK # if !defined(__UNIX__) /* set to 0 on platforms that don't have libmspack */ # define wxUSE_LIBMSPACK 0 # else # ifdef wxABORT_ON_CONFIG_ERROR # error "wxUSE_LIBMSPACK must be defined, please read comment near the top of this file." # else # define wxUSE_LIBMSPACK 0 # endif # endif #endif /* !defined(wxUSE_LIBMSPACK) */ #ifndef wxUSE_ICO_CUR # ifdef wxABORT_ON_CONFIG_ERROR # error "wxUSE_ICO_CUR must be defined, please read comment near the top of this file." # else # define wxUSE_ICO_CUR 0 # endif #endif /* !defined(wxUSE_ICO_CUR) */ #ifndef wxUSE_IFF # ifdef wxABORT_ON_CONFIG_ERROR # error "wxUSE_IFF must be defined, please read comment near the top of this file." # else # define wxUSE_IFF 0 # endif #endif /* !defined(wxUSE_IFF) */ #ifndef wxUSE_IMAGLIST # ifdef wxABORT_ON_CONFIG_ERROR # error "wxUSE_IMAGLIST must be defined, please read comment near the top of this file." # else # define wxUSE_IMAGLIST 0 # endif #endif /* !defined(wxUSE_IMAGLIST) */ #ifndef wxUSE_INFOBAR # ifdef wxABORT_ON_CONFIG_ERROR # error "wxUSE_INFOBAR must be defined, please read comment near the top of this file." # else # define wxUSE_INFOBAR 0 # endif #endif /* !defined(wxUSE_INFOBAR) */ #ifndef wxUSE_JOYSTICK # ifdef wxABORT_ON_CONFIG_ERROR # error "wxUSE_JOYSTICK must be defined, please read comment near the top of this file." # else # define wxUSE_JOYSTICK 0 # endif #endif /* !defined(wxUSE_JOYSTICK) */ #ifndef wxUSE_LISTBOOK # ifdef wxABORT_ON_CONFIG_ERROR # error "wxUSE_LISTBOOK must be defined, please read comment near the top of this file." # else # define wxUSE_LISTBOOK 0 # endif #endif /* !defined(wxUSE_LISTBOOK) */ #ifndef wxUSE_LISTBOX # ifdef wxABORT_ON_CONFIG_ERROR # error "wxUSE_LISTBOX must be defined, please read comment near the top of this file." # else # define wxUSE_LISTBOX 0 # endif #endif /* !defined(wxUSE_LISTBOX) */ #ifndef wxUSE_LISTCTRL # ifdef wxABORT_ON_CONFIG_ERROR # error "wxUSE_LISTCTRL must be defined, please read comment near the top of this file." # else # define wxUSE_LISTCTRL 0 # endif #endif /* !defined(wxUSE_LISTCTRL) */ #ifndef wxUSE_LOGGUI # ifdef wxABORT_ON_CONFIG_ERROR # error "wxUSE_LOGGUI must be defined, please read comment near the top of this file." # else # define wxUSE_LOGGUI 0 # endif #endif /* !defined(wxUSE_LOGGUI) */ #ifndef wxUSE_LOGWINDOW # ifdef wxABORT_ON_CONFIG_ERROR # error "wxUSE_LOGWINDOW must be defined, please read comment near the top of this file." # else # define wxUSE_LOGWINDOW 0 # endif #endif /* !defined(wxUSE_LOGWINDOW) */ #ifndef wxUSE_LOG_DIALOG # ifdef wxABORT_ON_CONFIG_ERROR # error "wxUSE_LOG_DIALOG must be defined, please read comment near the top of this file." # else # define wxUSE_LOG_DIALOG 0 # endif #endif /* !defined(wxUSE_LOG_DIALOG) */ #ifndef wxUSE_MARKUP # ifdef wxABORT_ON_CONFIG_ERROR # error "wxUSE_MARKUP must be defined, please read comment near the top of this file." # else # define wxUSE_MARKUP 0 # endif #endif /* !defined(wxUSE_MARKUP) */ #ifndef wxUSE_MDI # ifdef wxABORT_ON_CONFIG_ERROR # error "wxUSE_MDI must be defined, please read comment near the top of this file." # else # define wxUSE_MDI 0 # endif #endif /* !defined(wxUSE_MDI) */ #ifndef wxUSE_MDI_ARCHITECTURE # ifdef wxABORT_ON_CONFIG_ERROR # error "wxUSE_MDI_ARCHITECTURE must be defined, please read comment near the top of this file." # else # define wxUSE_MDI_ARCHITECTURE 0 # endif #endif /* !defined(wxUSE_MDI_ARCHITECTURE) */ #ifndef wxUSE_MENUS # ifdef wxABORT_ON_CONFIG_ERROR # error "wxUSE_MENUS must be defined, please read comment near the top of this file." # else # define wxUSE_MENUS 0 # endif #endif /* !defined(wxUSE_MENUS) */ #ifndef wxUSE_MSGDLG # ifdef wxABORT_ON_CONFIG_ERROR # error "wxUSE_MSGDLG must be defined, please read comment near the top of this file." # else # define wxUSE_MSGDLG 0 # endif #endif /* !defined(wxUSE_MSGDLG) */ #ifndef wxUSE_NOTEBOOK # ifdef wxABORT_ON_CONFIG_ERROR # error "wxUSE_NOTEBOOK must be defined, please read comment near the top of this file." # else # define wxUSE_NOTEBOOK 0 # endif #endif /* !defined(wxUSE_NOTEBOOK) */ #ifndef wxUSE_NOTIFICATION_MESSAGE # ifdef wxABORT_ON_CONFIG_ERROR # error "wxUSE_NOTIFICATION_MESSAGE must be defined, please read comment near the top of this file." # else # define wxUSE_NOTIFICATION_MESSAGE 0 # endif #endif /* !defined(wxUSE_NOTIFICATION_MESSAGE) */ #ifndef wxUSE_ODCOMBOBOX # ifdef wxABORT_ON_CONFIG_ERROR # error "wxUSE_ODCOMBOBOX must be defined, please read comment near the top of this file." # else # define wxUSE_ODCOMBOBOX 0 # endif #endif /* !defined(wxUSE_ODCOMBOBOX) */ #ifndef wxUSE_PALETTE # ifdef wxABORT_ON_CONFIG_ERROR # error "wxUSE_PALETTE must be defined, please read comment near the top of this file." # else # define wxUSE_PALETTE 0 # endif #endif /* !defined(wxUSE_PALETTE) */ #ifndef wxUSE_POPUPWIN # ifdef wxABORT_ON_CONFIG_ERROR # error "wxUSE_POPUPWIN must be defined, please read comment near the top of this file." # else # define wxUSE_POPUPWIN 0 # endif #endif /* !defined(wxUSE_POPUPWIN) */ #ifndef wxUSE_PREFERENCES_EDITOR # ifdef wxABORT_ON_CONFIG_ERROR # error "wxUSE_PREFERENCES_EDITOR must be defined, please read comment near the top of this file." # else # define wxUSE_PREFERENCES_EDITOR 0 # endif #endif /* !defined(wxUSE_PREFERENCES_EDITOR) */ #ifndef wxUSE_PRIVATE_FONTS # ifdef wxABORT_ON_CONFIG_ERROR # error "wxUSE_PRIVATE_FONTS must be defined, please read comment near the top of this file." # else # define wxUSE_PRIVATE_FONTS 0 # endif #endif /* !defined(wxUSE_PRIVATE_FONTS) */ #ifndef wxUSE_PRINTING_ARCHITECTURE # ifdef wxABORT_ON_CONFIG_ERROR # error "wxUSE_PRINTING_ARCHITECTURE must be defined, please read comment near the top of this file." # else # define wxUSE_PRINTING_ARCHITECTURE 0 # endif #endif /* !defined(wxUSE_PRINTING_ARCHITECTURE) */ #ifndef wxUSE_RADIOBOX # ifdef wxABORT_ON_CONFIG_ERROR # error "wxUSE_RADIOBOX must be defined, please read comment near the top of this file." # else # define wxUSE_RADIOBOX 0 # endif #endif /* !defined(wxUSE_RADIOBOX) */ #ifndef wxUSE_RADIOBTN # ifdef wxABORT_ON_CONFIG_ERROR # error "wxUSE_RADIOBTN must be defined, please read comment near the top of this file." # else # define wxUSE_RADIOBTN 0 # endif #endif /* !defined(wxUSE_RADIOBTN) */ #ifndef wxUSE_REARRANGECTRL # ifdef wxABORT_ON_CONFIG_ERROR # error "wxUSE_REARRANGECTRL must be defined, please read comment near the top of this file." # else # define wxUSE_REARRANGECTRL 0 # endif #endif /* !defined(wxUSE_REARRANGECTRL) */ #ifndef wxUSE_RIBBON # ifdef wxABORT_ON_CONFIG_ERROR # error "wxUSE_RIBBON must be defined, please read comment near the top of this file." # else # define wxUSE_RIBBON 0 # endif #endif /* !defined(wxUSE_RIBBON) */ #ifndef wxUSE_RICHMSGDLG # ifdef wxABORT_ON_CONFIG_ERROR # error "wxUSE_RICHMSGDLG must be defined, please read comment near the top of this file." # else # define wxUSE_RICHMSGDLG 0 # endif #endif /* !defined(wxUSE_RICHMSGDLG) */ #ifndef wxUSE_RICHTOOLTIP # ifdef wxABORT_ON_CONFIG_ERROR # error "wxUSE_RICHTOOLTIP must be defined, please read comment near the top of this file." # else # define wxUSE_RICHTOOLTIP 0 # endif #endif /* !defined(wxUSE_RICHTOOLTIP) */ #ifndef wxUSE_SASH # ifdef wxABORT_ON_CONFIG_ERROR # error "wxUSE_SASH must be defined, please read comment near the top of this file." # else # define wxUSE_SASH 0 # endif #endif /* !defined(wxUSE_SASH) */ #ifndef wxUSE_SCROLLBAR # ifdef wxABORT_ON_CONFIG_ERROR # error "wxUSE_SCROLLBAR must be defined, please read comment near the top of this file." # else # define wxUSE_SCROLLBAR 0 # endif #endif /* !defined(wxUSE_SCROLLBAR) */ #ifndef wxUSE_SLIDER # ifdef wxABORT_ON_CONFIG_ERROR # error "wxUSE_SLIDER must be defined, please read comment near the top of this file." # else # define wxUSE_SLIDER 0 # endif #endif /* !defined(wxUSE_SLIDER) */ #ifndef wxUSE_SOUND # ifdef wxABORT_ON_CONFIG_ERROR # error "wxUSE_SOUND must be defined, please read comment near the top of this file." # else # define wxUSE_SOUND 0 # endif #endif /* !defined(wxUSE_SOUND) */ #ifndef wxUSE_SPINBTN # ifdef wxABORT_ON_CONFIG_ERROR # error "wxUSE_SPINBTN must be defined, please read comment near the top of this file." # else # define wxUSE_SPINBTN 0 # endif #endif /* !defined(wxUSE_SPINBTN) */ #ifndef wxUSE_SPINCTRL # ifdef wxABORT_ON_CONFIG_ERROR # error "wxUSE_SPINCTRL must be defined, please read comment near the top of this file." # else # define wxUSE_SPINCTRL 0 # endif #endif /* !defined(wxUSE_SPINCTRL) */ #ifndef wxUSE_SPLASH # ifdef wxABORT_ON_CONFIG_ERROR # error "wxUSE_SPLASH must be defined, please read comment near the top of this file." # else # define wxUSE_SPLASH 0 # endif #endif /* !defined(wxUSE_SPLASH) */ #ifndef wxUSE_SPLITTER # ifdef wxABORT_ON_CONFIG_ERROR # error "wxUSE_SPLITTER must be defined, please read comment near the top of this file." # else # define wxUSE_SPLITTER 0 # endif #endif /* !defined(wxUSE_SPLITTER) */ #ifndef wxUSE_STATBMP # ifdef wxABORT_ON_CONFIG_ERROR # error "wxUSE_STATBMP must be defined, please read comment near the top of this file." # else # define wxUSE_STATBMP 0 # endif #endif /* !defined(wxUSE_STATBMP) */ #ifndef wxUSE_STATBOX # ifdef wxABORT_ON_CONFIG_ERROR # error "wxUSE_STATBOX must be defined, please read comment near the top of this file." # else # define wxUSE_STATBOX 0 # endif #endif /* !defined(wxUSE_STATBOX) */ #ifndef wxUSE_STATLINE # ifdef wxABORT_ON_CONFIG_ERROR # error "wxUSE_STATLINE must be defined, please read comment near the top of this file." # else # define wxUSE_STATLINE 0 # endif #endif /* !defined(wxUSE_STATLINE) */ #ifndef wxUSE_STATTEXT # ifdef wxABORT_ON_CONFIG_ERROR # error "wxUSE_STATTEXT must be defined, please read comment near the top of this file." # else # define wxUSE_STATTEXT 0 # endif #endif /* !defined(wxUSE_STATTEXT) */ #ifndef wxUSE_STATUSBAR # ifdef wxABORT_ON_CONFIG_ERROR # error "wxUSE_STATUSBAR must be defined, please read comment near the top of this file." # else # define wxUSE_STATUSBAR 0 # endif #endif /* !defined(wxUSE_STATUSBAR) */ #ifndef wxUSE_TASKBARICON # ifdef wxABORT_ON_CONFIG_ERROR # error "wxUSE_TASKBARICON must be defined, please read comment near the top of this file." # else # define wxUSE_TASKBARICON 0 # endif #endif /* !defined(wxUSE_TASKBARICON) */ #ifndef wxUSE_TEXTCTRL # ifdef wxABORT_ON_CONFIG_ERROR # error "wxUSE_TEXTCTRL must be defined, please read comment near the top of this file." # else # define wxUSE_TEXTCTRL 0 # endif #endif /* !defined(wxUSE_TEXTCTRL) */ #ifndef wxUSE_TIMEPICKCTRL # ifdef wxABORT_ON_CONFIG_ERROR # error "wxUSE_TIMEPICKCTRL must be defined, please read comment near the top of this file." # else # define wxUSE_TIMEPICKCTRL 0 # endif #endif /* !defined(wxUSE_TIMEPICKCTRL) */ #ifndef wxUSE_TIPWINDOW # ifdef wxABORT_ON_CONFIG_ERROR # error "wxUSE_TIPWINDOW must be defined, please read comment near the top of this file." # else # define wxUSE_TIPWINDOW 0 # endif #endif /* !defined(wxUSE_TIPWINDOW) */ #ifndef wxUSE_TOOLBAR # ifdef wxABORT_ON_CONFIG_ERROR # error "wxUSE_TOOLBAR must be defined, please read comment near the top of this file." # else # define wxUSE_TOOLBAR 0 # endif #endif /* !defined(wxUSE_TOOLBAR) */ #ifndef wxUSE_TOOLTIPS # ifdef wxABORT_ON_CONFIG_ERROR # error "wxUSE_TOOLTIPS must be defined, please read comment near the top of this file." # else # define wxUSE_TOOLTIPS 0 # endif #endif /* !defined(wxUSE_TOOLTIPS) */ #ifndef wxUSE_TREECTRL # ifdef wxABORT_ON_CONFIG_ERROR # error "wxUSE_TREECTRL must be defined, please read comment near the top of this file." # else # define wxUSE_TREECTRL 0 # endif #endif /* !defined(wxUSE_TREECTRL) */ #ifndef wxUSE_TREELISTCTRL # ifdef wxABORT_ON_CONFIG_ERROR # error "wxUSE_TREELISTCTRL must be defined, please read comment near the top of this file." # else # define wxUSE_TREELISTCTRL 0 # endif #endif /* !defined(wxUSE_TREELISTCTRL) */ #ifndef wxUSE_UIACTIONSIMULATOR # ifdef wxABORT_ON_CONFIG_ERROR # error "wxUSE_UIACTIONSIMULATOR must be defined, please read comment near the top of this file." # else # define wxUSE_UIACTIONSIMULATOR 0 # endif #endif /* !defined(wxUSE_UIACTIONSIMULATOR) */ #ifndef wxUSE_VALIDATORS # ifdef wxABORT_ON_CONFIG_ERROR # error "wxUSE_VALIDATORS must be defined, please read comment near the top of this file." # else # define wxUSE_VALIDATORS 0 # endif #endif /* !defined(wxUSE_VALIDATORS) */ #ifndef wxUSE_WEBVIEW # ifdef wxABORT_ON_CONFIG_ERROR # error "wxUSE_WEBVIEW must be defined, please read comment near the top of this file." # else # define wxUSE_WEBVIEW 0 # endif #endif /* !defined(wxUSE_WEBVIEW) */ #ifndef wxUSE_WXHTML_HELP # ifdef wxABORT_ON_CONFIG_ERROR # error "wxUSE_WXHTML_HELP must be defined, please read comment near the top of this file." # else # define wxUSE_WXHTML_HELP 0 # endif #endif /* !defined(wxUSE_WXHTML_HELP) */ #ifndef wxUSE_XRC # ifdef wxABORT_ON_CONFIG_ERROR # error "wxUSE_XRC must be defined, please read comment near the top of this file." # else # define wxUSE_XRC 0 # endif #endif /* !defined(wxUSE_XRC) */ #endif /* wxUSE_GUI */ /* Section 2: platform-specific checks. This must be done after checking that everything is defined as the platform checks use wxUSE_XXX symbols in #if tests. */ #if defined(__WINDOWS__) # include "wx/msw/chkconf.h" # if defined(__WXGTK__) # include "wx/gtk/chkconf.h" # endif #elif defined(__WXGTK__) # include "wx/gtk/chkconf.h" #elif defined(__WXMAC__) # include "wx/osx/chkconf.h" #elif defined(__WXDFB__) # include "wx/dfb/chkconf.h" #elif defined(__WXMOTIF__) # include "wx/motif/chkconf.h" #elif defined(__WXX11__) # include "wx/x11/chkconf.h" #elif defined(__WXANDROID__) # include "wx/android/chkconf.h" #endif /* __UNIX__ is also defined under Cygwin but we shouldn't perform these checks there if we're building Windows ports. */ #if defined(__UNIX__) && !defined(__WINDOWS__) # include "wx/unix/chkconf.h" #endif #ifdef __WXUNIVERSAL__ # include "wx/univ/chkconf.h" #endif /* Section 3a: check consistency of the non-GUI settings. */ #if WXWIN_COMPATIBILITY_2_8 # if !WXWIN_COMPATIBILITY_3_0 # ifdef wxABORT_ON_CONFIG_ERROR # error "2.8.X compatibility requires 3.0.X compatibility" # else # undef WXWIN_COMPATIBILITY_3_0 # define WXWIN_COMPATIBILITY_3_0 1 # endif # endif #endif /* WXWIN_COMPATIBILITY_2_8 */ #if wxUSE_ARCHIVE_STREAMS # if !wxUSE_DATETIME # ifdef wxABORT_ON_CONFIG_ERROR # error "wxArchive requires wxUSE_DATETIME" # else # undef wxUSE_ARCHIVE_STREAMS # define wxUSE_ARCHIVE_STREAMS 0 # endif # endif #endif /* wxUSE_ARCHIVE_STREAMS */ #if wxUSE_PROTOCOL_FILE || wxUSE_PROTOCOL_FTP || wxUSE_PROTOCOL_HTTP # if !wxUSE_PROTOCOL # ifdef wxABORT_ON_CONFIG_ERROR # error "wxUSE_PROTOCOL_XXX requires wxUSE_PROTOCOL" # else # undef wxUSE_PROTOCOL # define wxUSE_PROTOCOL 1 # endif # endif #endif /* wxUSE_PROTOCOL_XXX */ #if wxUSE_URL # if !wxUSE_PROTOCOL # ifdef wxABORT_ON_CONFIG_ERROR # error "wxUSE_URL requires wxUSE_PROTOCOL" # else # undef wxUSE_PROTOCOL # define wxUSE_PROTOCOL 1 # endif # endif #endif /* wxUSE_URL */ #if wxUSE_PROTOCOL # if !wxUSE_SOCKETS # if wxUSE_PROTOCOL_HTTP || wxUSE_PROTOCOL_FTP # ifdef wxABORT_ON_CONFIG_ERROR # error "wxUSE_PROTOCOL_FTP/HTTP requires wxUSE_SOCKETS" # else # undef wxUSE_SOCKETS # define wxUSE_SOCKETS 1 # endif # endif # endif # if !wxUSE_STREAMS # ifdef wxABORT_ON_CONFIG_ERROR # error "wxUSE_PROTOCOL requires wxUSE_STREAMS" # else # undef wxUSE_STREAMS # define wxUSE_STREAMS 1 # endif # endif #endif /* wxUSE_PROTOCOL */ /* have to test for wxUSE_HTML before wxUSE_FILESYSTEM */ #if wxUSE_HTML # if !wxUSE_FILESYSTEM # ifdef wxABORT_ON_CONFIG_ERROR # error "wxHTML requires wxFileSystem" # else # undef wxUSE_FILESYSTEM # define wxUSE_FILESYSTEM 1 # endif # endif #endif /* wxUSE_HTML */ #if wxUSE_FS_ARCHIVE # if !wxUSE_FILESYSTEM # ifdef wxABORT_ON_CONFIG_ERROR # error "wxArchiveFSHandler requires wxFileSystem" # else # undef wxUSE_FILESYSTEM # define wxUSE_FILESYSTEM 1 # endif # endif # if !wxUSE_ARCHIVE_STREAMS # ifdef wxABORT_ON_CONFIG_ERROR # error "wxArchiveFSHandler requires wxArchive" # else # undef wxUSE_ARCHIVE_STREAMS # define wxUSE_ARCHIVE_STREAMS 1 # endif # endif #endif /* wxUSE_FS_ARCHIVE */ #if wxUSE_FILESYSTEM # if !wxUSE_STREAMS # ifdef wxABORT_ON_CONFIG_ERROR # error "wxUSE_FILESYSTEM requires wxUSE_STREAMS" # else # undef wxUSE_STREAMS # define wxUSE_STREAMS 1 # endif # endif # if !wxUSE_FILE && !wxUSE_FFILE # ifdef wxABORT_ON_CONFIG_ERROR # error "wxUSE_FILESYSTEM requires either wxUSE_FILE or wxUSE_FFILE" # else # undef wxUSE_FILE # define wxUSE_FILE 1 # undef wxUSE_FFILE # define wxUSE_FFILE 1 # endif # endif #endif /* wxUSE_FILESYSTEM */ #if wxUSE_FS_INET # if !wxUSE_PROTOCOL # ifdef wxABORT_ON_CONFIG_ERROR # error "wxUSE_FS_INET requires wxUSE_PROTOCOL" # else # undef wxUSE_PROTOCOL # define wxUSE_PROTOCOL 1 # endif # endif #endif /* wxUSE_FS_INET */ #if wxUSE_STOPWATCH || wxUSE_DATETIME # if !wxUSE_LONGLONG # ifdef wxABORT_ON_CONFIG_ERROR # error "wxUSE_STOPWATCH and wxUSE_DATETIME require wxUSE_LONGLONG" # else # undef wxUSE_LONGLONG # define wxUSE_LONGLONG 1 # endif # endif #endif /* wxUSE_STOPWATCH */ #if wxUSE_MIMETYPE && !wxUSE_TEXTFILE # ifdef wxABORT_ON_CONFIG_ERROR # error "wxUSE_MIMETYPE requires wxUSE_TEXTFILE" # else # undef wxUSE_TEXTFILE # define wxUSE_TEXTFILE 1 # endif #endif /* wxUSE_MIMETYPE */ #if wxUSE_TEXTFILE && !wxUSE_TEXTBUFFER # ifdef wxABORT_ON_CONFIG_ERROR # error "wxUSE_TEXTFILE requires wxUSE_TEXTBUFFER" # else # undef wxUSE_TEXTBUFFER # define wxUSE_TEXTBUFFER 1 # endif #endif /* wxUSE_TEXTFILE */ #if wxUSE_TEXTFILE && !wxUSE_FILE # ifdef wxABORT_ON_CONFIG_ERROR # error "wxUSE_TEXTFILE requires wxUSE_FILE" # else # undef wxUSE_FILE # define wxUSE_FILE 1 # endif #endif /* wxUSE_TEXTFILE */ #if !wxUSE_DYNLIB_CLASS # if wxUSE_DYNAMIC_LOADER # ifdef wxABORT_ON_CONFIG_ERROR # error "wxUSE_DYNAMIC_LOADER requires wxUSE_DYNLIB_CLASS." # else # define wxUSE_DYNLIB_CLASS 1 # endif # endif #endif /* wxUSE_DYNLIB_CLASS */ #if wxUSE_ZIPSTREAM # if !wxUSE_ZLIB # ifdef wxABORT_ON_CONFIG_ERROR # error "wxZip requires wxZlib" # else # undef wxUSE_ZLIB # define wxUSE_ZLIB 1 # endif # endif # if !wxUSE_ARCHIVE_STREAMS # ifdef wxABORT_ON_CONFIG_ERROR # error "wxZip requires wxArchive" # else # undef wxUSE_ARCHIVE_STREAMS # define wxUSE_ARCHIVE_STREAMS 1 # endif # endif #endif /* wxUSE_ZIPSTREAM */ #if wxUSE_TARSTREAM # if !wxUSE_ARCHIVE_STREAMS # ifdef wxABORT_ON_CONFIG_ERROR # error "wxTar requires wxArchive" # else # undef wxUSE_ARCHIVE_STREAMS # define wxUSE_ARCHIVE_STREAMS 1 # endif # endif #endif /* wxUSE_TARSTREAM */ /* Section 3b: the tests for the GUI settings only. */ #if wxUSE_GUI #if wxUSE_ACCESSIBILITY && !defined(__WXMSW__) # ifdef wxABORT_ON_CONFIG_ERROR # error "wxUSE_ACCESSIBILITY is currently only supported under wxMSW" # else # undef wxUSE_ACCESSIBILITY # define wxUSE_ACCESSIBILITY 0 # endif #endif /* wxUSE_ACCESSIBILITY */ #if wxUSE_BUTTON || \ wxUSE_CALENDARCTRL || \ wxUSE_CARET || \ wxUSE_COMBOBOX || \ wxUSE_BMPBUTTON || \ wxUSE_CHECKBOX || \ wxUSE_CHECKLISTBOX || \ wxUSE_CHOICE || \ wxUSE_GAUGE || \ wxUSE_GRID || \ wxUSE_HEADERCTRL || \ wxUSE_LISTBOX || \ wxUSE_LISTCTRL || \ wxUSE_NOTEBOOK || \ wxUSE_RADIOBOX || \ wxUSE_RADIOBTN || \ wxUSE_REARRANGECTRL || \ wxUSE_SCROLLBAR || \ wxUSE_SLIDER || \ wxUSE_SPINBTN || \ wxUSE_SPINCTRL || \ wxUSE_STATBMP || \ wxUSE_STATBOX || \ wxUSE_STATLINE || \ wxUSE_STATTEXT || \ wxUSE_STATUSBAR || \ wxUSE_TEXTCTRL || \ wxUSE_TOOLBAR || \ wxUSE_TREECTRL || \ wxUSE_TREELISTCTRL # if !wxUSE_CONTROLS # ifdef wxABORT_ON_CONFIG_ERROR # error "wxUSE_CONTROLS unset but some controls used" # else # undef wxUSE_CONTROLS # define wxUSE_CONTROLS 1 # endif # endif #endif /* controls */ #if wxUSE_ADDREMOVECTRL # if !wxUSE_BMPBUTTON # ifdef wxABORT_ON_CONFIG_ERROR # error "wxUSE_ADDREMOVECTRL requires wxUSE_BMPBUTTON" # else # undef wxUSE_ADDREMOVECTRL # define wxUSE_ADDREMOVECTRL 0 # endif # endif #endif /* wxUSE_ADDREMOVECTRL */ #if wxUSE_ANIMATIONCTRL # if !wxUSE_STREAMS # ifdef wxABORT_ON_CONFIG_ERROR # error "wxUSE_ANIMATIONCTRL requires wxUSE_STREAMS" # else # undef wxUSE_ANIMATIONCTRL # define wxUSE_ANIMATIONCTRL 0 # endif # endif #endif /* wxUSE_ANIMATIONCTRL */ #if wxUSE_BMPBUTTON # if !wxUSE_BUTTON # ifdef wxABORT_ON_CONFIG_ERROR # error "wxUSE_BMPBUTTON requires wxUSE_BUTTON" # else # undef wxUSE_BUTTON # define wxUSE_BUTTON 1 # endif # endif #endif /* wxUSE_BMPBUTTON */ #if wxUSE_COMMANDLINKBUTTON # if !wxUSE_BUTTON # ifdef wxABORT_ON_CONFIG_ERROR # error "wxUSE_COMMANDLINKBUTTON requires wxUSE_BUTTON" # else # undef wxUSE_BUTTON # define wxUSE_BUTTON 1 # endif # endif #endif /* wxUSE_COMMANDLINKBUTTON */ /* wxUSE_BOOKCTRL should be only used if any of the controls deriving from it are used */ #ifdef wxUSE_BOOKCTRL # ifdef wxABORT_ON_CONFIG_ERROR # error "wxUSE_BOOKCTRL is defined automatically, don't define it" # else # undef wxUSE_BOOKCTRL # endif #endif #define wxUSE_BOOKCTRL (wxUSE_AUI || \ wxUSE_NOTEBOOK || \ wxUSE_LISTBOOK || \ wxUSE_CHOICEBOOK || \ wxUSE_TOOLBOOK || \ wxUSE_TREEBOOK) #if wxUSE_COLLPANE # if !wxUSE_BUTTON || !wxUSE_STATLINE # ifdef wxABORT_ON_CONFIG_ERROR # error "wxUSE_COLLPANE requires wxUSE_BUTTON and wxUSE_STATLINE" # else # undef wxUSE_COLLPANE # define wxUSE_COLLPANE 0 # endif # endif #endif /* wxUSE_COLLPANE */ #if wxUSE_LISTBOOK # if !wxUSE_LISTCTRL # ifdef wxABORT_ON_CONFIG_ERROR # error "wxListbook requires wxListCtrl" # else # undef wxUSE_LISTCTRL # define wxUSE_LISTCTRL 1 # endif # endif #endif /* wxUSE_LISTBOOK */ #if wxUSE_CHOICEBOOK # if !wxUSE_CHOICE # ifdef wxABORT_ON_CONFIG_ERROR # error "wxChoicebook requires wxChoice" # else # undef wxUSE_CHOICE # define wxUSE_CHOICE 1 # endif # endif #endif /* wxUSE_CHOICEBOOK */ #if wxUSE_TOOLBOOK # if !wxUSE_TOOLBAR # ifdef wxABORT_ON_CONFIG_ERROR # error "wxToolbook requires wxToolBar" # else # undef wxUSE_TOOLBAR # define wxUSE_TOOLBAR 1 # endif # endif #endif /* wxUSE_TOOLBOOK */ #if !wxUSE_ODCOMBOBOX # if wxUSE_BITMAPCOMBOBOX # ifdef wxABORT_ON_CONFIG_ERROR # error "wxBitmapComboBox requires wxOwnerDrawnComboBox" # else # undef wxUSE_BITMAPCOMBOBOX # define wxUSE_BITMAPCOMBOBOX 0 # endif # endif #endif /* !wxUSE_ODCOMBOBOX */ #if !wxUSE_HEADERCTRL # if wxUSE_DATAVIEWCTRL || wxUSE_GRID # ifdef wxABORT_ON_CONFIG_ERROR # error "wxDataViewCtrl and wxGrid require wxHeaderCtrl" # else # undef wxUSE_HEADERCTRL # define wxUSE_HEADERCTRL 1 # endif # endif #endif /* !wxUSE_HEADERCTRL */ #if wxUSE_REARRANGECTRL # if !wxUSE_CHECKLISTBOX # ifdef wxABORT_ON_CONFIG_ERROR # error "wxRearrangeCtrl requires wxCheckListBox" # else # undef wxUSE_REARRANGECTRL # define wxUSE_REARRANGECTRL 0 # endif # endif #endif /* wxUSE_REARRANGECTRL */ #if wxUSE_RICHMSGDLG # if !wxUSE_MSGDLG # ifdef wxABORT_ON_CONFIG_ERROR # error "wxUSE_RICHMSGDLG requires wxUSE_MSGDLG" # else # undef wxUSE_MSGDLG # define wxUSE_MSGDLG 1 # endif # endif #endif /* wxUSE_RICHMSGDLG */ /* don't attempt to use native status bar on the platforms not having it */ #ifndef wxUSE_NATIVE_STATUSBAR # define wxUSE_NATIVE_STATUSBAR 0 #elif wxUSE_NATIVE_STATUSBAR # if defined(__WXUNIVERSAL__) || !(defined(__WXMSW__) || defined(__WXMAC__)) # undef wxUSE_NATIVE_STATUSBAR # define wxUSE_NATIVE_STATUSBAR 0 # endif #endif #if wxUSE_ACTIVITYINDICATOR && !wxUSE_GRAPHICS_CONTEXT # undef wxUSE_ACTIVITYINDICATOR # define wxUSE_ACTIVITYINDICATOR 0 #endif /* wxUSE_ACTIVITYINDICATOR */ #if wxUSE_GRAPHICS_CONTEXT && !wxUSE_GEOMETRY # ifdef wxABORT_ON_CONFIG_ERROR # error "wxUSE_GRAPHICS_CONTEXT requires wxUSE_GEOMETRY" # else # undef wxUSE_GRAPHICS_CONTEXT # define wxUSE_GRAPHICS_CONTEXT 0 # endif #endif /* wxUSE_GRAPHICS_CONTEXT */ #if wxUSE_DC_TRANSFORM_MATRIX && !wxUSE_GEOMETRY # ifdef wxABORT_ON_CONFIG_ERROR # error "wxUSE_DC_TRANSFORM_MATRIX requires wxUSE_GEOMETRY" # else # undef wxUSE_DC_TRANSFORM_MATRIX # define wxUSE_DC_TRANSFORM_MATRIX 0 # endif #endif /* wxUSE_DC_TRANSFORM_MATRIX */ /* generic controls dependencies */ #if !defined(__WXMSW__) || defined(__WXUNIVERSAL__) # if wxUSE_FONTDLG || wxUSE_FILEDLG || wxUSE_CHOICEDLG /* all common controls are needed by these dialogs */ # if !defined(wxUSE_CHOICE) || \ !defined(wxUSE_TEXTCTRL) || \ !defined(wxUSE_BUTTON) || \ !defined(wxUSE_CHECKBOX) || \ !defined(wxUSE_STATTEXT) # ifdef wxABORT_ON_CONFIG_ERROR # error "These common controls are needed by common dialogs" # else # undef wxUSE_CHOICE # define wxUSE_CHOICE 1 # undef wxUSE_TEXTCTRL # define wxUSE_TEXTCTRL 1 # undef wxUSE_BUTTON # define wxUSE_BUTTON 1 # undef wxUSE_CHECKBOX # define wxUSE_CHECKBOX 1 # undef wxUSE_STATTEXT # define wxUSE_STATTEXT 1 # endif # endif # endif #endif /* !wxMSW || wxUniv */ /* generic file dialog depends on (generic) file control */ #if wxUSE_FILEDLG && !wxUSE_FILECTRL && \ (defined(__WXUNIVERSAL__) || defined(__WXGTK__)) # ifdef wxABORT_ON_CONFIG_ERROR # error "Generic wxFileDialog requires wxFileCtrl" # else # undef wxUSE_FILECTRL # define wxUSE_FILECTRL 1 # endif #endif /* wxUSE_FILEDLG */ /* common dependencies */ #if wxUSE_ARTPROVIDER_TANGO # if !(wxUSE_STREAMS && wxUSE_IMAGE && wxUSE_LIBPNG) # ifdef wxABORT_ON_CONFIG_ERROR # error "Tango art provider requires wxImage with streams and PNG support" # else # undef wxUSE_ARTPROVIDER_TANGO # define wxUSE_ARTPROVIDER_TANGO 0 # endif # endif #endif /* wxUSE_ARTPROVIDER_TANGO */ #if wxUSE_CALENDARCTRL # if !(wxUSE_SPINBTN && wxUSE_COMBOBOX) # ifdef wxABORT_ON_CONFIG_ERROR # error "wxCalendarCtrl requires wxSpinButton and wxComboBox" # else # undef wxUSE_SPINBTN # undef wxUSE_COMBOBOX # define wxUSE_SPINBTN 1 # define wxUSE_COMBOBOX 1 # endif # endif # if !wxUSE_DATETIME # ifdef wxABORT_ON_CONFIG_ERROR # error "wxCalendarCtrl requires wxUSE_DATETIME" # else # undef wxUSE_DATETIME # define wxUSE_DATETIME 1 # endif # endif #endif /* wxUSE_CALENDARCTRL */ #if wxUSE_DATEPICKCTRL /* Only the generic implementation, not used under MSW and OSX, needs * wxComboCtrl. */ # if !wxUSE_COMBOCTRL && (defined(__WXUNIVERSAL__) || \ !(defined(__WXMSW__) || defined(__WXOSX_COCOA__))) # ifdef wxABORT_ON_CONFIG_ERROR # error "wxDatePickerCtrl requires wxUSE_COMBOCTRL" # else # undef wxUSE_COMBOCTRL # define wxUSE_COMBOCTRL 1 # endif # endif #endif /* wxUSE_DATEPICKCTRL */ #if wxUSE_DATEPICKCTRL || wxUSE_TIMEPICKCTRL # if !wxUSE_DATETIME # ifdef wxABORT_ON_CONFIG_ERROR # error "wxDatePickerCtrl and wxTimePickerCtrl requires wxUSE_DATETIME" # else # undef wxUSE_DATETIME # define wxUSE_DATETIME 1 # endif # endif #endif /* wxUSE_DATEPICKCTRL || wxUSE_TIMEPICKCTRL */ #if wxUSE_CHECKLISTBOX # if !wxUSE_LISTBOX # ifdef wxABORT_ON_CONFIG_ERROR # error "wxCheckListBox requires wxListBox" # else # undef wxUSE_LISTBOX # define wxUSE_LISTBOX 1 # endif # endif #endif /* wxUSE_CHECKLISTBOX */ #if wxUSE_CHOICEDLG # if !wxUSE_LISTBOX # ifdef wxABORT_ON_CONFIG_ERROR # error "Choice dialogs requires wxListBox" # else # undef wxUSE_LISTBOX # define wxUSE_LISTBOX 1 # endif # endif #endif /* wxUSE_CHOICEDLG */ #if wxUSE_FILECTRL # if !wxUSE_DATETIME # ifdef wxABORT_ON_CONFIG_ERROR # error "wxFileCtrl requires wxDateTime" # else # undef wxUSE_DATETIME # define wxUSE_DATETIME 1 # endif # endif #endif /* wxUSE_FILECTRL */ #if wxUSE_HELP # if !wxUSE_BMPBUTTON # ifdef wxABORT_ON_CONFIG_ERROR # error "wxUSE_HELP requires wxUSE_BMPBUTTON" # else # undef wxUSE_BMPBUTTON # define wxUSE_BMPBUTTON 1 # endif # endif # if !wxUSE_CHOICEDLG # ifdef wxABORT_ON_CONFIG_ERROR # error "wxUSE_HELP requires wxUSE_CHOICEDLG" # else # undef wxUSE_CHOICEDLG # define wxUSE_CHOICEDLG 1 # endif # endif #endif /* wxUSE_HELP */ #if wxUSE_MS_HTML_HELP /* this doesn't make sense for platforms other than MSW but we still define it in wx/setup_inc.h so don't complain if it happens to be defined under another platform but just silently fix it. */ # ifndef __WXMSW__ # undef wxUSE_MS_HTML_HELP # define wxUSE_MS_HTML_HELP 0 # endif #endif /* wxUSE_MS_HTML_HELP */ #if wxUSE_WXHTML_HELP # if !wxUSE_HELP || !wxUSE_HTML || !wxUSE_COMBOBOX || !wxUSE_NOTEBOOK || !wxUSE_SPINCTRL # ifdef wxABORT_ON_CONFIG_ERROR # error "Built in help controller can't be compiled" # else # undef wxUSE_HELP # define wxUSE_HELP 1 # undef wxUSE_HTML # define wxUSE_HTML 1 # undef wxUSE_COMBOBOX # define wxUSE_COMBOBOX 1 # undef wxUSE_NOTEBOOK # define wxUSE_NOTEBOOK 1 # undef wxUSE_SPINCTRL # define wxUSE_SPINCTRL 1 # endif # endif #endif /* wxUSE_WXHTML_HELP */ #if !wxUSE_IMAGE /* The default wxUSE_IMAGE setting is 1, so if it's set to 0 we assume the user explicitly wants this and disable all other features that require wxUSE_IMAGE. */ # if wxUSE_DRAGIMAGE # ifdef wxABORT_ON_CONFIG_ERROR # error "wxUSE_DRAGIMAGE requires wxUSE_IMAGE" # else # undef wxUSE_DRAGIMAGE # define wxUSE_DRAGIMAGE 0 # endif # endif # if wxUSE_LIBPNG # ifdef wxABORT_ON_CONFIG_ERROR # error "wxUSE_LIBPNG requires wxUSE_IMAGE" # else # undef wxUSE_LIBPNG # define wxUSE_LIBPNG 0 # endif # endif # if wxUSE_LIBJPEG # ifdef wxABORT_ON_CONFIG_ERROR # error "wxUSE_LIBJPEG requires wxUSE_IMAGE" # else # undef wxUSE_LIBJPEG # define wxUSE_LIBJPEG 0 # endif # endif # if wxUSE_LIBTIFF # ifdef wxABORT_ON_CONFIG_ERROR # error "wxUSE_LIBTIFF requires wxUSE_IMAGE" # else # undef wxUSE_LIBTIFF # define wxUSE_LIBTIFF 0 # endif # endif # if wxUSE_GIF # ifdef wxABORT_ON_CONFIG_ERROR # error "wxUSE_GIF requires wxUSE_IMAGE" # else # undef wxUSE_GIF # define wxUSE_GIF 0 # endif # endif # if wxUSE_PNM # ifdef wxABORT_ON_CONFIG_ERROR # error "wxUSE_PNM requires wxUSE_IMAGE" # else # undef wxUSE_PNM # define wxUSE_PNM 0 # endif # endif # if wxUSE_PCX # ifdef wxABORT_ON_CONFIG_ERROR # error "wxUSE_PCX requires wxUSE_IMAGE" # else # undef wxUSE_PCX # define wxUSE_PCX 0 # endif # endif # if wxUSE_IFF # ifdef wxABORT_ON_CONFIG_ERROR # error "wxUSE_IFF requires wxUSE_IMAGE" # else # undef wxUSE_IFF # define wxUSE_IFF 0 # endif # endif # if wxUSE_TOOLBAR # ifdef wxABORT_ON_CONFIG_ERROR # error "wxUSE_TOOLBAR requires wxUSE_IMAGE" # else # undef wxUSE_TOOLBAR # define wxUSE_TOOLBAR 0 # endif # endif # if wxUSE_XPM # ifdef wxABORT_ON_CONFIG_ERROR # error "wxUSE_XPM requires wxUSE_IMAGE" # else # undef wxUSE_XPM # define wxUSE_XPM 0 # endif # endif #endif /* !wxUSE_IMAGE */ #if wxUSE_DOC_VIEW_ARCHITECTURE # if !wxUSE_MENUS # ifdef wxABORT_ON_CONFIG_ERROR # error "DocView requires wxUSE_MENUS" # else # undef wxUSE_MENUS # define wxUSE_MENUS 1 # endif # endif # if !wxUSE_CHOICEDLG # ifdef wxABORT_ON_CONFIG_ERROR # error "DocView requires wxUSE_CHOICEDLG" # else # undef wxUSE_CHOICEDLG # define wxUSE_CHOICEDLG 1 # endif # endif # if !wxUSE_STREAMS && !wxUSE_STD_IOSTREAM # ifdef wxABORT_ON_CONFIG_ERROR # error "DocView requires wxUSE_STREAMS or wxUSE_STD_IOSTREAM" # else # undef wxUSE_STREAMS # define wxUSE_STREAMS 1 # endif # endif # if !wxUSE_FILE_HISTORY # ifdef wxABORT_ON_CONFIG_ERROR # error "DocView requires wxUSE_FILE_HISTORY" # else # undef wxUSE_FILE_HISTORY # define wxUSE_FILE_HISTORY 1 # endif # endif #endif /* wxUSE_DOC_VIEW_ARCHITECTURE */ #if wxUSE_PRINTING_ARCHITECTURE # if !wxUSE_COMBOBOX # ifdef wxABORT_ON_CONFIG_ERROR # error "Print dialog requires wxUSE_COMBOBOX" # else # undef wxUSE_COMBOBOX # define wxUSE_COMBOBOX 1 # endif # endif #endif /* wxUSE_PRINTING_ARCHITECTURE */ #if wxUSE_MDI_ARCHITECTURE # if !wxUSE_MDI # ifdef wxABORT_ON_CONFIG_ERROR # error "MDI requires wxUSE_MDI" # else # undef wxUSE_MDI # define wxUSE_MDI 1 # endif # endif # if !wxUSE_DOC_VIEW_ARCHITECTURE # ifdef wxABORT_ON_CONFIG_ERROR # error "wxUSE_MDI_ARCHITECTURE requires wxUSE_DOC_VIEW_ARCHITECTURE" # else # undef wxUSE_DOC_VIEW_ARCHITECTURE # define wxUSE_DOC_VIEW_ARCHITECTURE 1 # endif # endif #endif /* wxUSE_MDI_ARCHITECTURE */ #if !wxUSE_FILEDLG # if wxUSE_DOC_VIEW_ARCHITECTURE || wxUSE_WXHTML_HELP # ifdef wxABORT_ON_CONFIG_ERROR # error "wxUSE_FILEDLG is required by wxUSE_DOC_VIEW_ARCHITECTURE and wxUSE_WXHTML_HELP!" # else # undef wxUSE_FILEDLG # define wxUSE_FILEDLG 1 # endif # endif #endif /* wxUSE_FILEDLG */ #if !wxUSE_GAUGE || !wxUSE_BUTTON # if wxUSE_PROGRESSDLG # ifdef wxABORT_ON_CONFIG_ERROR # error "Generic progress dialog requires wxUSE_GAUGE and wxUSE_BUTTON" # else # undef wxUSE_GAUGE # undef wxUSE_BUTTON # define wxUSE_GAUGE 1 # define wxUSE_BUTTON 1 # endif # endif #endif /* !wxUSE_GAUGE */ #if !wxUSE_BUTTON # if wxUSE_FONTDLG || \ wxUSE_FILEDLG || \ wxUSE_CHOICEDLG || \ wxUSE_NUMBERDLG || \ wxUSE_TEXTDLG || \ wxUSE_DIRDLG || \ wxUSE_STARTUP_TIPS || \ wxUSE_WIZARDDLG # ifdef wxABORT_ON_CONFIG_ERROR # error "Common and generic dialogs require wxUSE_BUTTON" # else # undef wxUSE_BUTTON # define wxUSE_BUTTON 1 # endif # endif #endif /* !wxUSE_BUTTON */ #if !wxUSE_TOOLBAR # if wxUSE_TOOLBAR_NATIVE # ifdef wxABORT_ON_CONFIG_ERROR # error "wxUSE_TOOLBAR is set to 0 but wxUSE_TOOLBAR_NATIVE is set to 1" # else # undef wxUSE_TOOLBAR_NATIVE # define wxUSE_TOOLBAR_NATIVE 0 # endif # endif #endif #if !wxUSE_IMAGLIST # if wxUSE_TREECTRL || wxUSE_NOTEBOOK || wxUSE_LISTCTRL || wxUSE_TREELISTCTRL # ifdef wxABORT_ON_CONFIG_ERROR # error "wxImageList must be compiled as well" # else # undef wxUSE_IMAGLIST # define wxUSE_IMAGLIST 1 # endif # endif #endif /* !wxUSE_IMAGLIST */ #if wxUSE_RADIOBOX # if !wxUSE_RADIOBTN # ifdef wxABORT_ON_CONFIG_ERROR # error "wxUSE_RADIOBOX requires wxUSE_RADIOBTN" # else # undef wxUSE_RADIOBTN # define wxUSE_RADIOBTN 1 # endif # endif # if !wxUSE_STATBOX # ifdef wxABORT_ON_CONFIG_ERROR # error "wxUSE_RADIOBOX requires wxUSE_STATBOX" # else # undef wxUSE_STATBOX # define wxUSE_STATBOX 1 # endif # endif #endif /* wxUSE_RADIOBOX */ #if wxUSE_LOGWINDOW # if !wxUSE_TEXTCTRL # ifdef wxABORT_ON_CONFIG_ERROR # error "wxUSE_LOGWINDOW requires wxUSE_TEXTCTRL" # else # undef wxUSE_TEXTCTRL # define wxUSE_TEXTCTRL 1 # endif # endif #endif /* wxUSE_LOGWINDOW */ #if wxUSE_LOG_DIALOG # if !wxUSE_LISTCTRL || !wxUSE_BUTTON # ifdef wxABORT_ON_CONFIG_ERROR # error "wxUSE_LOG_DIALOG requires wxUSE_LISTCTRL and wxUSE_BUTTON" # else # undef wxUSE_LISTCTRL # define wxUSE_LISTCTRL 1 # undef wxUSE_BUTTON # define wxUSE_BUTTON 1 # endif # endif #endif /* wxUSE_LOG_DIALOG */ #if wxUSE_CLIPBOARD && !wxUSE_DATAOBJ # ifdef wxABORT_ON_CONFIG_ERROR # error "wxClipboard requires wxDataObject" # else # undef wxUSE_DATAOBJ # define wxUSE_DATAOBJ 1 # endif #endif /* wxUSE_CLIPBOARD */ #if wxUSE_XRC && !wxUSE_XML # ifdef wxABORT_ON_CONFIG_ERROR # error "wxUSE_XRC requires wxUSE_XML" # else # undef wxUSE_XRC # define wxUSE_XRC 0 # endif #endif /* wxUSE_XRC */ #if wxUSE_SOCKETS && !wxUSE_STOPWATCH # ifdef wxABORT_ON_CONFIG_ERROR # error "wxUSE_SOCKETS requires wxUSE_STOPWATCH" # else # undef wxUSE_SOCKETS # define wxUSE_SOCKETS 0 # endif #endif /* wxUSE_SOCKETS */ #if wxUSE_SVG && !wxUSE_STREAMS # ifdef wxABORT_ON_CONFIG_ERROR # error "wxUSE_SVG requires wxUSE_STREAMS" # else # undef wxUSE_SVG # define wxUSE_SVG 0 # endif #endif /* wxUSE_SVG */ #if wxUSE_SVG && !wxUSE_IMAGE # ifdef wxABORT_ON_CONFIG_ERROR # error "wxUSE_SVG requires wxUSE_IMAGE" # else # undef wxUSE_SVG # define wxUSE_SVG 0 # endif #endif /* wxUSE_SVG */ #if wxUSE_SVG && !wxUSE_LIBPNG # ifdef wxABORT_ON_CONFIG_ERROR # error "wxUSE_SVG requires wxUSE_LIBPNG" # else # undef wxUSE_SVG # define wxUSE_SVG 0 # endif #endif /* wxUSE_SVG */ #if wxUSE_TASKBARICON && !wxUSE_MENUS # ifdef wxABORT_ON_CONFIG_ERROR # error "wxUSE_TASKBARICON requires wxUSE_MENUS" # else # undef wxUSE_TASKBARICON # define wxUSE_TASKBARICON 0 # endif #endif /* wxUSE_TASKBARICON */ #if !wxUSE_VARIANT # if wxUSE_DATAVIEWCTRL # ifdef wxABORT_ON_CONFIG_ERROR # error "wxDataViewCtrl requires wxVariant" # else # undef wxUSE_DATAVIEWCTRL # define wxUSE_DATAVIEWCTRL 0 # endif # endif #endif /* wxUSE_VARIANT */ #if wxUSE_TREELISTCTRL && !wxUSE_DATAVIEWCTRL # ifdef wxABORT_ON_CONFIG_ERROR # error "wxUSE_TREELISTCTRL requires wxDataViewCtrl" # else # undef wxUSE_TREELISTCTRL # define wxUSE_TREELISTCTRL 0 # endif #endif /* wxUSE_TREELISTCTRL */ #if wxUSE_WEBVIEW && !(wxUSE_WEBVIEW_WEBKIT || wxUSE_WEBVIEW_WEBKIT2 || wxUSE_WEBVIEW_IE) # ifdef wxABORT_ON_CONFIG_ERROR # error "wxUSE_WEBVIEW requires at least one backend" # else # undef wxUSE_WEBVIEW # define wxUSE_WEBVIEW 0 # endif #endif /* wxUSE_WEBVIEW && !any web view backend */ #if wxUSE_PREFERENCES_EDITOR /* We can use either a generic implementation, using wxNotebook, or a native one under wxOSX/Cocoa but then we must be using the native toolbar. */ # if !wxUSE_NOTEBOOK # ifdef __WXOSX_COCOA__ # if !wxUSE_TOOLBAR || !wxOSX_USE_NATIVE_TOOLBAR # ifdef wxABORT_ON_CONFIG_ERROR # error "wxUSE_PREFERENCES_EDITOR requires native toolbar in wxOSX" # else # undef wxUSE_PREFERENCES_EDITOR # define wxUSE_PREFERENCES_EDITOR 0 # endif # endif # else # ifdef wxABORT_ON_CONFIG_ERROR # error "wxUSE_PREFERENCES_EDITOR requires wxNotebook" # else # undef wxUSE_PREFERENCES_EDITOR # define wxUSE_PREFERENCES_EDITOR 0 # endif # endif # endif #endif /* wxUSE_PREFERENCES_EDITOR */ #if wxUSE_PRIVATE_FONTS # if !defined(__WXMSW__) && !defined(__WXGTK__) && !defined(__WXOSX__) # undef wxUSE_PRIVATE_FONTS # define wxUSE_PRIVATE_FONTS 0 # endif #endif /* wxUSE_PRIVATE_FONTS */ #if wxUSE_MEDIACTRL # if !wxUSE_LONGLONG # ifdef wxABORT_ON_CONFIG_ERROR # error "wxMediaCtrl requires wxUSE_LONLONG" # else # undef wxUSE_LONLONG # define wxUSE_LONLONG 1 # endif # endif #endif /* wxUSE_MEDIACTRL */ #if wxUSE_STC # if !wxUSE_STOPWATCH # ifdef wxABORT_ON_CONFIG_ERROR # error "wxStyledTextCtrl requires wxUSE_STOPWATCH" # else # undef wxUSE_STC # define wxUSE_STC 0 # endif # endif # if !wxUSE_SCROLLBAR # ifdef wxABORT_ON_CONFIG_ERROR # error "wxStyledTextCtrl requires wxUSE_SCROLLBAR" # else # undef wxUSE_STC # define wxUSE_STC 0 # endif # endif #endif /* wxUSE_STC */ #if wxUSE_RICHTEXT # if !wxUSE_HTML # ifdef wxABORT_ON_CONFIG_ERROR # error "wxRichTextCtrl requires wxUSE_HTML" # else # undef wxUSE_RICHTEXT # define wxUSE_RICHTEXT 0 # endif # endif # if !wxUSE_LONGLONG # ifdef wxABORT_ON_CONFIG_ERROR # error "wxRichTextCtrl requires wxUSE_LONLONG" # else # undef wxUSE_LONLONG # define wxUSE_LONLONG 1 # endif # endif #endif /* wxUSE_RICHTEXT */ #endif /* wxUSE_GUI */ #endif /* _WX_CHKCONF_H_ */
h
rticonnextdds-usecases
data/projects/rticonnextdds-usecases/VehicleTracking/ExampleCode/thirdparty/wxWidgets-3.1.2/Linux/include/wx/xtistrm.h
///////////////////////////////////////////////////////////////////////////// // Name: wx/xtistrm.h // Purpose: streaming runtime metadata information (extended class info) // Author: Stefan Csomor // Modified by: // Created: 27/07/03 // Copyright: (c) 2003 Stefan Csomor // Licence: wxWindows licence ///////////////////////////////////////////////////////////////////////////// #ifndef _WX_XTISTRMH__ #define _WX_XTISTRMH__ #include "wx/defs.h" #if wxUSE_EXTENDED_RTTI #include "wx/object.h" const int wxInvalidObjectID = -2; const int wxNullObjectID = -3; // Filer contains the interfaces for streaming objects in and out of XML, // rendering them either to objects in memory, or to code. Note: We // consider the process of generating code to be one of *depersisting* the // object from xml, *not* of persisting the object to code from an object // in memory. This distinction can be confusing, and should be kept // in mind when looking at the property streamers and callback interfaces // listed below. // ---------------------------------------------------------------------------- // wxObjectWriterCallback // // This class will be asked during the streaming-out process about every single // property or object instance. It can veto streaming out by returning false // or modify the value before it is streamed-out. // ---------------------------------------------------------------------------- /* class WXDLLIMPEXP_BASE wxClassInfo; class WXDLLIMPEXP_BASE wxAnyList; class WXDLLIMPEXP_BASE wxPropertyInfo; class WXDLLIMPEXP_BASE wxAny; class WXDLLIMPEXP_BASE wxHandlerInfo; */ class WXDLLIMPEXP_BASE wxObjectWriter; class WXDLLIMPEXP_BASE wxObjectReader; class WXDLLIMPEXP_BASE wxObjectWriterCallback { public: virtual ~wxObjectWriterCallback() {} // will be called before an object is written, may veto by returning false virtual bool BeforeWriteObject( wxObjectWriter *WXUNUSED(writer), const wxObject *WXUNUSED(object), const wxClassInfo *WXUNUSED(classInfo), const wxStringToAnyHashMap &WXUNUSED(metadata)) { return true; } // will be called after this object has been written, may be // needed for adjusting stacks virtual void AfterWriteObject( wxObjectWriter *WXUNUSED(writer), const wxObject *WXUNUSED(object), const wxClassInfo *WXUNUSED(classInfo) ) {} // will be called before a property gets written, may change the value, // eg replace a concrete wxSize by wxSize( wxDefaultCoord, wxDefaultCoord ) // or veto writing that property at all by returning false virtual bool BeforeWriteProperty( wxObjectWriter *WXUNUSED(writer), const wxObject *WXUNUSED(object), const wxPropertyInfo *WXUNUSED(propInfo), const wxAny &WXUNUSED(value) ) { return true; } // will be called before a property gets written, may change the value, // eg replace a concrete wxSize by wxSize( wxDefaultCoord, wxDefaultCoord ) // or veto writing that property at all by returning false virtual bool BeforeWriteProperty( wxObjectWriter *WXUNUSED(writer), const wxObject *WXUNUSED(object), const wxPropertyInfo *WXUNUSED(propInfo), const wxAnyList &WXUNUSED(value) ) { return true; } // will be called after a property has been written out, may be needed // for adjusting stacks virtual void AfterWriteProperty( wxObjectWriter *WXUNUSED(writer), const wxPropertyInfo *WXUNUSED(propInfo) ) {} // will be called before this delegate gets written virtual bool BeforeWriteDelegate( wxObjectWriter *WXUNUSED(writer), const wxObject *WXUNUSED(object), const wxClassInfo* WXUNUSED(classInfo), const wxPropertyInfo *WXUNUSED(propInfo), const wxObject *&WXUNUSED(eventSink), const wxHandlerInfo* &WXUNUSED(handlerInfo) ) { return true; } virtual void AfterWriteDelegate( wxObjectWriter *WXUNUSED(writer), const wxObject *WXUNUSED(object), const wxClassInfo* WXUNUSED(classInfo), const wxPropertyInfo *WXUNUSED(propInfo), const wxObject *&WXUNUSED(eventSink), const wxHandlerInfo* &WXUNUSED(handlerInfo) ) { } }; class WXDLLIMPEXP_BASE wxObjectWriterFunctor: public wxObjectFunctor { }; class WXDLLIMPEXP_BASE wxObjectWriter: public wxObject { friend class wxObjectWriterFunctor; public: wxObjectWriter(); virtual ~wxObjectWriter(); // with this call you start writing out a new top-level object void WriteObject(const wxObject *object, const wxClassInfo *classInfo, wxObjectWriterCallback *writercallback, const wxString &name, const wxStringToAnyHashMap &metadata); // Managing the object identity table a.k.a context // // these methods make sure that no object gets written twice, // because sometimes multiple calls to the WriteObject will be // made without wanting to have duplicate objects written, the // object identity table will be reset manually virtual void ClearObjectContext(); // gets the object Id for a passed in object in the context int GetObjectID(const wxObject *obj); // returns true if this object has already been written in this context bool IsObjectKnown( const wxObject *obj ); // // streaming callbacks // // these callbacks really write out the values in the stream format // begins writing out a new toplevel entry which has the indicated unique name virtual void DoBeginWriteTopLevelEntry( const wxString &name ) = 0; // ends writing out a new toplevel entry which has the indicated unique name virtual void DoEndWriteTopLevelEntry( const wxString &name ) = 0; // start of writing an object having the passed in ID virtual void DoBeginWriteObject(const wxObject *object, const wxClassInfo *classInfo, int objectID, const wxStringToAnyHashMap &metadata ) = 0; // end of writing an toplevel object name param is used for unique // identification within the container virtual void DoEndWriteObject(const wxObject *object, const wxClassInfo *classInfo, int objectID ) = 0; // writes a simple property in the stream format virtual void DoWriteSimpleType( const wxAny &value ) = 0; // start of writing a complex property into the stream ( virtual void DoBeginWriteProperty( const wxPropertyInfo *propInfo ) = 0; // end of writing a complex property into the stream virtual void DoEndWriteProperty( const wxPropertyInfo *propInfo ) = 0; virtual void DoBeginWriteElement() = 0; virtual void DoEndWriteElement() = 0; // insert an object reference to an already written object virtual void DoWriteRepeatedObject( int objectID ) = 0; // insert a null reference virtual void DoWriteNullObject() = 0; // writes a delegate in the stream format virtual void DoWriteDelegate( const wxObject *object, const wxClassInfo* classInfo, const wxPropertyInfo *propInfo, const wxObject *eventSink, int sinkObjectID, const wxClassInfo* eventSinkClassInfo, const wxHandlerInfo* handlerIndo ) = 0; void WriteObject(const wxObject *object, const wxClassInfo *classInfo, wxObjectWriterCallback *writercallback, bool isEmbedded, const wxStringToAnyHashMap &metadata ); protected: struct wxObjectWriterInternal; wxObjectWriterInternal* m_data; struct wxObjectWriterInternalPropertiesData; void WriteAllProperties( const wxObject * obj, const wxClassInfo* ci, wxObjectWriterCallback *writercallback, wxObjectWriterInternalPropertiesData * data ); void WriteOneProperty( const wxObject *obj, const wxClassInfo* ci, const wxPropertyInfo* pi, wxObjectWriterCallback *writercallback, wxObjectWriterInternalPropertiesData *data ); void FindConnectEntry(const wxEvtHandler * evSource, const wxEventSourceTypeInfo* dti, const wxObject* &sink, const wxHandlerInfo *&handler); }; /* Streaming callbacks for depersisting XML to code, or running objects */ class WXDLLIMPEXP_BASE wxObjectReaderCallback; /* wxObjectReader handles streaming in a class from a arbitrary format. While walking through it issues calls out to interfaces to readercallback the guts from the underlying storage format. */ class WXDLLIMPEXP_BASE wxObjectReader: public wxObject { public: wxObjectReader(); virtual ~wxObjectReader(); // the only thing wxObjectReader knows about is the class info by object ID wxClassInfo *GetObjectClassInfo(int objectID); bool HasObjectClassInfo( int objectID ); void SetObjectClassInfo(int objectID, wxClassInfo* classInfo); // Reads the component the reader is pointed at from the underlying format. // The return value is the root object ID, which can // then be used to ask the depersister about that object // if there was a problem you will get back wxInvalidObjectID and the current // error log will carry the problems encoutered virtual int ReadObject( const wxString &name, wxObjectReaderCallback *readercallback ) = 0; private: struct wxObjectReaderInternal; wxObjectReaderInternal *m_data; }; // This abstract class matches the allocate-init/create model of creation of objects. // At runtime, these will create actual instances, and manipulate them. // When generating code, these will just create statements of C++ // code to create the objects. class WXDLLIMPEXP_BASE wxObjectReaderCallback { public: virtual ~wxObjectReaderCallback() {} // allocate the new object on the heap, that object will have the passed in ID virtual void AllocateObject(int objectID, wxClassInfo *classInfo, wxStringToAnyHashMap &metadata) = 0; // initialize the already allocated object having the ID objectID with the Create method // creation parameters which are objects are having their Ids passed in objectIDValues // having objectId <> wxInvalidObjectID virtual void CreateObject(int objectID, const wxClassInfo *classInfo, int paramCount, wxAny *VariantValues, int *objectIDValues, const wxClassInfo **objectClassInfos, wxStringToAnyHashMap &metadata) = 0; // construct the new object on the heap, that object will have the passed in ID // (for objects that don't support allocate-create type of creation) // creation parameters which are objects are having their Ids passed in // objectIDValues having objectId <> wxInvalidObjectID virtual void ConstructObject(int objectID, const wxClassInfo *classInfo, int paramCount, wxAny *VariantValues, int *objectIDValues, const wxClassInfo **objectClassInfos, wxStringToAnyHashMap &metadata) = 0; // destroy the heap-allocated object having the ID objectID, this may be used // if an object is embedded in another object and set via value semantics, // so the intermediate object can be destroyed after safely virtual void DestroyObject(int objectID, wxClassInfo *classInfo) = 0; // set the corresponding property virtual void SetProperty(int objectID, const wxClassInfo *classInfo, const wxPropertyInfo* propertyInfo, const wxAny &VariantValue) = 0; // sets the corresponding property (value is an object) virtual void SetPropertyAsObject(int objectID, const wxClassInfo *classInfo, const wxPropertyInfo* propertyInfo, int valueObjectId) = 0; // adds an element to a property collection virtual void AddToPropertyCollection( int objectID, const wxClassInfo *classInfo, const wxPropertyInfo* propertyInfo, const wxAny &VariantValue) = 0; // sets the corresponding property (value is an object) virtual void AddToPropertyCollectionAsObject(int objectID, const wxClassInfo *classInfo, const wxPropertyInfo* propertyInfo, int valueObjectId) = 0; // sets the corresponding event handler virtual void SetConnect(int EventSourceObjectID, const wxClassInfo *EventSourceClassInfo, const wxPropertyInfo *delegateInfo, const wxClassInfo *EventSinkClassInfo, const wxHandlerInfo* handlerInfo, int EventSinkObjectID ) = 0; }; /* wxObjectRuntimeReaderCallback implements the callbacks that will bring back an object into a life memory instance */ class WXDLLIMPEXP_BASE wxObjectRuntimeReaderCallback: public wxObjectReaderCallback { struct wxObjectRuntimeReaderCallbackInternal; wxObjectRuntimeReaderCallbackInternal * m_data; public: wxObjectRuntimeReaderCallback(); virtual ~wxObjectRuntimeReaderCallback(); // returns the object having the corresponding ID fully constructed wxObject *GetObject(int objectID); // allocate the new object on the heap, that object will have the passed in ID virtual void AllocateObject(int objectID, wxClassInfo *classInfo, wxStringToAnyHashMap &metadata); // initialize the already allocated object having the ID objectID with // the Create method creation parameters which are objects are having // their Ids passed in objectIDValues having objectId <> wxInvalidObjectID virtual void CreateObject(int objectID, const wxClassInfo *classInfo, int paramCount, wxAny *VariantValues, int *objectIDValues, const wxClassInfo **objectClassInfos, wxStringToAnyHashMap &metadata ); // construct the new object on the heap, that object will have the // passed in ID (for objects that don't support allocate-create type of // creation) creation parameters which are objects are having their Ids // passed in objectIDValues having objectId <> wxInvalidObjectID virtual void ConstructObject(int objectID, const wxClassInfo *classInfo, int paramCount, wxAny *VariantValues, int *objectIDValues, const wxClassInfo **objectClassInfos, wxStringToAnyHashMap &metadata); // destroy the heap-allocated object having the ID objectID, this may be // used if an object is embedded in another object and set via value semantics, // so the intermediate object can be destroyed after safely virtual void DestroyObject(int objectID, wxClassInfo *classInfo); // set the corresponding property virtual void SetProperty(int objectID, const wxClassInfo *classInfo, const wxPropertyInfo* propertyInfo, const wxAny &variantValue); // sets the corresponding property (value is an object) virtual void SetPropertyAsObject(int objectId, const wxClassInfo *classInfo, const wxPropertyInfo* propertyInfo, int valueObjectId); // adds an element to a property collection virtual void AddToPropertyCollection( int objectID, const wxClassInfo *classInfo, const wxPropertyInfo* propertyInfo, const wxAny &VariantValue); // sets the corresponding property (value is an object) virtual void AddToPropertyCollectionAsObject(int objectID, const wxClassInfo *classInfo, const wxPropertyInfo* propertyInfo, int valueObjectId); // sets the corresponding event handler virtual void SetConnect(int eventSourceObjectID, const wxClassInfo *eventSourceClassInfo, const wxPropertyInfo *delegateInfo, const wxClassInfo *eventSinkClassInfo, const wxHandlerInfo* handlerInfo, int eventSinkObjectID ); }; #endif // wxUSE_EXTENDED_RTTI #endif
h
rticonnextdds-usecases
data/projects/rticonnextdds-usecases/VehicleTracking/ExampleCode/thirdparty/wxWidgets-3.1.2/Linux/include/wx/dcprint.h
///////////////////////////////////////////////////////////////////////////// // Name: wx/dcprint.h // Purpose: wxPrinterDC base header // Author: Julian Smart // Modified by: // Created: // Copyright: (c) Julian Smart // Licence: wxWindows Licence ///////////////////////////////////////////////////////////////////////////// #ifndef _WX_DCPRINT_H_BASE_ #define _WX_DCPRINT_H_BASE_ #include "wx/defs.h" #if wxUSE_PRINTING_ARCHITECTURE #include "wx/dc.h" //----------------------------------------------------------------------------- // wxPrinterDC //----------------------------------------------------------------------------- class WXDLLIMPEXP_CORE wxPrinterDC : public wxDC { public: wxPrinterDC(); wxPrinterDC(const wxPrintData& data); wxRect GetPaperRect() const; int GetResolution() const wxOVERRIDE; protected: wxPrinterDC(wxDCImpl *impl) : wxDC(impl) { } private: wxDECLARE_DYNAMIC_CLASS(wxPrinterDC); }; #endif // wxUSE_PRINTING_ARCHITECTURE #endif // _WX_DCPRINT_H_BASE_
h
rticonnextdds-usecases
data/projects/rticonnextdds-usecases/VehicleTracking/ExampleCode/thirdparty/wxWidgets-3.1.2/Linux/include/wx/printdlg.h
///////////////////////////////////////////////////////////////////////////// // Name: wx/printdlg.h // Purpose: Base header and class for print dialogs // Author: Julian Smart // Modified by: // Created: // Copyright: (c) Julian Smart // Licence: wxWindows Licence ///////////////////////////////////////////////////////////////////////////// #ifndef _WX_PRINTDLG_H_BASE_ #define _WX_PRINTDLG_H_BASE_ #include "wx/defs.h" #if wxUSE_PRINTING_ARCHITECTURE #include "wx/event.h" #include "wx/dialog.h" #include "wx/intl.h" #include "wx/cmndata.h" // --------------------------------------------------------------------------- // wxPrintDialogBase: interface for the dialog for printing // --------------------------------------------------------------------------- class WXDLLIMPEXP_CORE wxPrintDialogBase : public wxDialog { public: wxPrintDialogBase() { } wxPrintDialogBase(wxWindow *parent, wxWindowID id = wxID_ANY, const wxString &title = wxEmptyString, const wxPoint &pos = wxDefaultPosition, const wxSize &size = wxDefaultSize, long style = wxDEFAULT_DIALOG_STYLE); virtual wxPrintDialogData& GetPrintDialogData() = 0; virtual wxPrintData& GetPrintData() = 0; virtual wxDC *GetPrintDC() = 0; private: wxDECLARE_ABSTRACT_CLASS(wxPrintDialogBase); wxDECLARE_NO_COPY_CLASS(wxPrintDialogBase); }; // --------------------------------------------------------------------------- // wxPrintDialog: the dialog for printing. // --------------------------------------------------------------------------- class WXDLLIMPEXP_CORE wxPrintDialog : public wxObject { public: wxPrintDialog(wxWindow *parent, wxPrintDialogData* data = NULL); wxPrintDialog(wxWindow *parent, wxPrintData* data); virtual ~wxPrintDialog(); virtual int ShowModal(); virtual wxPrintDialogData& GetPrintDialogData(); virtual wxPrintData& GetPrintData(); virtual wxDC *GetPrintDC(); private: wxPrintDialogBase *m_pimpl; private: wxDECLARE_DYNAMIC_CLASS(wxPrintDialog); wxDECLARE_NO_COPY_CLASS(wxPrintDialog); }; // --------------------------------------------------------------------------- // wxPageSetupDialogBase: interface for the page setup dialog // --------------------------------------------------------------------------- class WXDLLIMPEXP_CORE wxPageSetupDialogBase: public wxDialog { public: wxPageSetupDialogBase() { } wxPageSetupDialogBase(wxWindow *parent, wxWindowID id = wxID_ANY, const wxString &title = wxEmptyString, const wxPoint &pos = wxDefaultPosition, const wxSize &size = wxDefaultSize, long style = wxDEFAULT_DIALOG_STYLE); virtual wxPageSetupDialogData& GetPageSetupDialogData() = 0; private: wxDECLARE_ABSTRACT_CLASS(wxPageSetupDialogBase); wxDECLARE_NO_COPY_CLASS(wxPageSetupDialogBase); }; // --------------------------------------------------------------------------- // wxPageSetupDialog: the page setup dialog // --------------------------------------------------------------------------- class WXDLLIMPEXP_CORE wxPageSetupDialog: public wxObject { public: wxPageSetupDialog(wxWindow *parent, wxPageSetupDialogData *data = NULL); virtual ~wxPageSetupDialog(); int ShowModal(); wxPageSetupDialogData& GetPageSetupDialogData(); // old name wxPageSetupDialogData& GetPageSetupData(); private: wxPageSetupDialogBase *m_pimpl; private: wxDECLARE_DYNAMIC_CLASS(wxPageSetupDialog); wxDECLARE_NO_COPY_CLASS(wxPageSetupDialog); }; #endif #endif // _WX_PRINTDLG_H_BASE_
h
rticonnextdds-usecases
data/projects/rticonnextdds-usecases/VehicleTracking/ExampleCode/thirdparty/wxWidgets-3.1.2/Linux/include/wx/fs_inet.h
///////////////////////////////////////////////////////////////////////////// // Name: wx/fs_inet.h // Purpose: HTTP and FTP file system // Author: Vaclav Slavik // Copyright: (c) 1999 Vaclav Slavik // Licence: wxWindows licence ///////////////////////////////////////////////////////////////////////////// #ifndef _WX_FS_INET_H_ #define _WX_FS_INET_H_ #include "wx/defs.h" #if wxUSE_FILESYSTEM && wxUSE_FS_INET && wxUSE_STREAMS && wxUSE_SOCKETS #include "wx/filesys.h" // ---------------------------------------------------------------------------- // wxInternetFSHandler // ---------------------------------------------------------------------------- class WXDLLIMPEXP_NET wxInternetFSHandler : public wxFileSystemHandler { public: virtual bool CanOpen(const wxString& location) wxOVERRIDE; virtual wxFSFile* OpenFile(wxFileSystem& fs, const wxString& location) wxOVERRIDE; }; #endif // wxUSE_FILESYSTEM && wxUSE_FS_INET && wxUSE_STREAMS && wxUSE_SOCKETS #endif // _WX_FS_INET_H_
h
rticonnextdds-usecases
data/projects/rticonnextdds-usecases/VehicleTracking/ExampleCode/thirdparty/wxWidgets-3.1.2/Linux/include/wx/config.h
///////////////////////////////////////////////////////////////////////////// // Name: wx/config.h // Purpose: wxConfig base header // Author: Julian Smart // Modified by: // Created: // Copyright: (c) Julian Smart // Licence: wxWindows licence ///////////////////////////////////////////////////////////////////////////// #ifndef _WX_CONFIG_H_BASE_ #define _WX_CONFIG_H_BASE_ #include "wx/confbase.h" #if wxUSE_CONFIG // ---------------------------------------------------------------------------- // define the native wxConfigBase implementation // ---------------------------------------------------------------------------- // under Windows we prefer to use the native implementation but can be forced // to use the file-based one #if defined(__WINDOWS__) && wxUSE_CONFIG_NATIVE #include "wx/msw/regconf.h" #define wxConfig wxRegConfig #else // either we're under Unix or wish to always use config files #include "wx/fileconf.h" #define wxConfig wxFileConfig #endif #endif // wxUSE_CONFIG #endif // _WX_CONFIG_H_BASE_
h
rticonnextdds-usecases
data/projects/rticonnextdds-usecases/VehicleTracking/ExampleCode/thirdparty/wxWidgets-3.1.2/Linux/include/wx/confbase.h
/////////////////////////////////////////////////////////////////////////////// // Name: wx/confbase.h // Purpose: declaration of the base class of all config implementations // (see also: fileconf.h and msw/regconf.h and iniconf.h) // Author: Karsten Ballueder & Vadim Zeitlin // Modified by: // Created: 07.04.98 (adapted from appconf.h) // Copyright: (c) 1997 Karsten Ballueder [email protected] // Vadim Zeitlin <[email protected]> // Licence: wxWindows licence /////////////////////////////////////////////////////////////////////////////// #ifndef _WX_CONFBASE_H_ #define _WX_CONFBASE_H_ #include "wx/defs.h" #include "wx/string.h" #include "wx/object.h" #include "wx/base64.h" class WXDLLIMPEXP_FWD_BASE wxArrayString; // ---------------------------------------------------------------------------- // constants // ---------------------------------------------------------------------------- /// shall we be case sensitive in parsing variable names? #ifndef wxCONFIG_CASE_SENSITIVE #define wxCONFIG_CASE_SENSITIVE 0 #endif /// separates group and entry names (probably shouldn't be changed) #ifndef wxCONFIG_PATH_SEPARATOR #define wxCONFIG_PATH_SEPARATOR wxT('/') #endif /// introduces immutable entries // (i.e. the ones which can't be changed from the local config file) #ifndef wxCONFIG_IMMUTABLE_PREFIX #define wxCONFIG_IMMUTABLE_PREFIX wxT('!') #endif #if wxUSE_CONFIG /// should we use registry instead of configuration files under Windows? // (i.e. whether wxConfigBase::Create() will create a wxFileConfig (if it's // false) or wxRegConfig (if it's true and we're under Win32)) #ifndef wxUSE_CONFIG_NATIVE #define wxUSE_CONFIG_NATIVE 1 #endif // not all compilers can deal with template Read/Write() methods, define this // symbol if the template functions are available #if !defined( __VMS ) && \ !(defined(__HP_aCC) && defined(__hppa)) #define wxHAS_CONFIG_TEMPLATE_RW #endif // Style flags for constructor style parameter enum { wxCONFIG_USE_LOCAL_FILE = 1, wxCONFIG_USE_GLOBAL_FILE = 2, wxCONFIG_USE_RELATIVE_PATH = 4, wxCONFIG_USE_NO_ESCAPE_CHARACTERS = 8, wxCONFIG_USE_SUBDIR = 16 }; // ---------------------------------------------------------------------------- // abstract base class wxConfigBase which defines the interface for derived // classes // // wxConfig organizes the items in a tree-like structure (modelled after the // Unix/Dos filesystem). There are groups (directories) and keys (files). // There is always one current group given by the current path. // // Keys are pairs "key_name = value" where value may be of string or integer // (long) type (TODO doubles and other types such as wxDate coming soon). // ---------------------------------------------------------------------------- class WXDLLIMPEXP_BASE wxConfigBase : public wxObject { public: // constants // the type of an entry enum EntryType { Type_Unknown, Type_String, Type_Boolean, Type_Integer, // use Read(long *) Type_Float // use Read(double *) }; // static functions // sets the config object, returns the previous pointer static wxConfigBase *Set(wxConfigBase *pConfig); // get the config object, creates it on demand unless DontCreateOnDemand // was called static wxConfigBase *Get(bool createOnDemand = true) { if ( createOnDemand && (!ms_pConfig) ) Create(); return ms_pConfig; } // create a new config object: this function will create the "best" // implementation of wxConfig available for the current platform, see // comments near definition wxUSE_CONFIG_NATIVE for details. It returns // the created object and also sets it as ms_pConfig. static wxConfigBase *Create(); // should Get() try to create a new log object if the current one is NULL? static void DontCreateOnDemand() { ms_bAutoCreate = false; } // ctor & virtual dtor // ctor (can be used as default ctor too) // // Not all args will always be used by derived classes, but including // them all in each class ensures compatibility. If appName is empty, // uses wxApp name wxConfigBase(const wxString& appName = wxEmptyString, const wxString& vendorName = wxEmptyString, const wxString& localFilename = wxEmptyString, const wxString& globalFilename = wxEmptyString, long style = 0); // empty but ensures that dtor of all derived classes is virtual virtual ~wxConfigBase(); // path management // set current path: if the first character is '/', it's the absolute path, // otherwise it's a relative path. '..' is supported. If the strPath // doesn't exist it is created. virtual void SetPath(const wxString& strPath) = 0; // retrieve the current path (always as absolute path) virtual const wxString& GetPath() const = 0; // enumeration: all functions here return false when there are no more items. // you must pass the same lIndex to GetNext and GetFirst (don't modify it) // enumerate subgroups virtual bool GetFirstGroup(wxString& str, long& lIndex) const = 0; virtual bool GetNextGroup (wxString& str, long& lIndex) const = 0; // enumerate entries virtual bool GetFirstEntry(wxString& str, long& lIndex) const = 0; virtual bool GetNextEntry (wxString& str, long& lIndex) const = 0; // get number of entries/subgroups in the current group, with or without // it's subgroups virtual size_t GetNumberOfEntries(bool bRecursive = false) const = 0; virtual size_t GetNumberOfGroups(bool bRecursive = false) const = 0; // tests of existence // returns true if the group by this name exists virtual bool HasGroup(const wxString& strName) const = 0; // same as above, but for an entry virtual bool HasEntry(const wxString& strName) const = 0; // returns true if either a group or an entry with a given name exist bool Exists(const wxString& strName) const { return HasGroup(strName) || HasEntry(strName); } // get the entry type virtual EntryType GetEntryType(const wxString& name) const { // by default all entries are strings return HasEntry(name) ? Type_String : Type_Unknown; } // key access: returns true if value was really read, false if default used // (and if the key is not found the default value is returned.) // read a string from the key bool Read(const wxString& key, wxString *pStr) const; bool Read(const wxString& key, wxString *pStr, const wxString& defVal) const; // read a number (long) bool Read(const wxString& key, long *pl) const; bool Read(const wxString& key, long *pl, long defVal) const; // read an int (wrapper around `long' version) bool Read(const wxString& key, int *pi) const; bool Read(const wxString& key, int *pi, int defVal) const; // read a double bool Read(const wxString& key, double* val) const; bool Read(const wxString& key, double* val, double defVal) const; // read a float bool Read(const wxString& key, float* val) const; bool Read(const wxString& key, float* val, float defVal) const; // read a bool bool Read(const wxString& key, bool* val) const; bool Read(const wxString& key, bool* val, bool defVal) const; #if wxUSE_BASE64 // read a binary data block bool Read(const wxString& key, wxMemoryBuffer* data) const { return DoReadBinary(key, data); } // no default version since it does not make sense for binary data #endif // wxUSE_BASE64 #ifdef wxHAS_CONFIG_TEMPLATE_RW // read other types, for which wxFromString is defined template <typename T> bool Read(const wxString& key, T* value) const { wxString s; if ( !Read(key, &s) ) return false; return wxFromString(s, value); } template <typename T> bool Read(const wxString& key, T* value, const T& defVal) const { const bool found = Read(key, value); if ( !found ) { if (IsRecordingDefaults()) ((wxConfigBase *)this)->Write(key, defVal); *value = defVal; } return found; } #endif // wxHAS_CONFIG_TEMPLATE_RW // convenience functions returning directly the value wxString Read(const wxString& key, const wxString& defVal = wxEmptyString) const { wxString s; (void)Read(key, &s, defVal); return s; } // we have to provide a separate version for C strings as otherwise the // template Read() would be used wxString Read(const wxString& key, const char* defVal) const { return Read(key, wxString(defVal)); } wxString Read(const wxString& key, const wchar_t* defVal) const { return Read(key, wxString(defVal)); } long ReadLong(const wxString& key, long defVal) const { long l; (void)Read(key, &l, defVal); return l; } double ReadDouble(const wxString& key, double defVal) const { double d; (void)Read(key, &d, defVal); return d; } bool ReadBool(const wxString& key, bool defVal) const { bool b; (void)Read(key, &b, defVal); return b; } template <typename T> T ReadObject(const wxString& key, T const& defVal) const { T t; (void)Read(key, &t, defVal); return t; } // for compatibility with wx 2.8 long Read(const wxString& key, long defVal) const { return ReadLong(key, defVal); } // write the value (return true on success) bool Write(const wxString& key, const wxString& value) { return DoWriteString(key, value); } bool Write(const wxString& key, long value) { return DoWriteLong(key, value); } bool Write(const wxString& key, double value) { return DoWriteDouble(key, value); } bool Write(const wxString& key, bool value) { return DoWriteBool(key, value); } #if wxUSE_BASE64 bool Write(const wxString& key, const wxMemoryBuffer& buf) { return DoWriteBinary(key, buf); } #endif // wxUSE_BASE64 // we have to provide a separate version for C strings as otherwise they // would be converted to bool and not to wxString as expected! bool Write(const wxString& key, const char *value) { return Write(key, wxString(value)); } bool Write(const wxString& key, const unsigned char *value) { return Write(key, wxString(value)); } bool Write(const wxString& key, const wchar_t *value) { return Write(key, wxString(value)); } // we also have to provide specializations for other types which we want to // handle using the specialized DoWriteXXX() instead of the generic template // version below bool Write(const wxString& key, char value) { return DoWriteLong(key, value); } bool Write(const wxString& key, unsigned char value) { return DoWriteLong(key, value); } bool Write(const wxString& key, short value) { return DoWriteLong(key, value); } bool Write(const wxString& key, unsigned short value) { return DoWriteLong(key, value); } bool Write(const wxString& key, unsigned int value) { return DoWriteLong(key, value); } bool Write(const wxString& key, int value) { return DoWriteLong(key, value); } bool Write(const wxString& key, unsigned long value) { return DoWriteLong(key, value); } bool Write(const wxString& key, float value) { return DoWriteDouble(key, value); } // Causes ambiguities in under OpenVMS #if !defined( __VMS ) // for other types, use wxToString() template <typename T> bool Write(const wxString& key, T const& value) { return Write(key, wxToString(value)); } #endif // permanently writes all changes virtual bool Flush(bool bCurrentOnly = false) = 0; // renaming, all functions return false on failure (probably because the new // name is already taken by an existing entry) // rename an entry virtual bool RenameEntry(const wxString& oldName, const wxString& newName) = 0; // rename a group virtual bool RenameGroup(const wxString& oldName, const wxString& newName) = 0; // delete entries/groups // deletes the specified entry and the group it belongs to if // it was the last key in it and the second parameter is true virtual bool DeleteEntry(const wxString& key, bool bDeleteGroupIfEmpty = true) = 0; // delete the group (with all subgroups) virtual bool DeleteGroup(const wxString& key) = 0; // delete the whole underlying object (disk file, registry key, ...) // primarily for use by uninstallation routine. virtual bool DeleteAll() = 0; // options // we can automatically expand environment variables in the config entries // (this option is on by default, you can turn it on/off at any time) bool IsExpandingEnvVars() const { return m_bExpandEnvVars; } void SetExpandEnvVars(bool bDoIt = true) { m_bExpandEnvVars = bDoIt; } // recording of default values void SetRecordDefaults(bool bDoIt = true) { m_bRecordDefaults = bDoIt; } bool IsRecordingDefaults() const { return m_bRecordDefaults; } // does expansion only if needed wxString ExpandEnvVars(const wxString& str) const; // misc accessors wxString GetAppName() const { return m_appName; } wxString GetVendorName() const { return m_vendorName; } // Used wxIniConfig to set members in constructor void SetAppName(const wxString& appName) { m_appName = appName; } void SetVendorName(const wxString& vendorName) { m_vendorName = vendorName; } void SetStyle(long style) { m_style = style; } long GetStyle() const { return m_style; } protected: static bool IsImmutable(const wxString& key) { return !key.IsEmpty() && key[0] == wxCONFIG_IMMUTABLE_PREFIX; } // return the path without trailing separator, if any: this should be called // to sanitize paths referring to the group names before passing them to // wxConfigPathChanger as "/foo/bar/" should be the same as "/foo/bar" and it // isn't interpreted in the same way by it (and this can't be changed there // as it's not the same for the entries names) static wxString RemoveTrailingSeparator(const wxString& key); // do read/write the values of different types virtual bool DoReadString(const wxString& key, wxString *pStr) const = 0; virtual bool DoReadLong(const wxString& key, long *pl) const = 0; virtual bool DoReadDouble(const wxString& key, double* val) const; virtual bool DoReadBool(const wxString& key, bool* val) const; #if wxUSE_BASE64 virtual bool DoReadBinary(const wxString& key, wxMemoryBuffer* buf) const = 0; #endif // wxUSE_BASE64 virtual bool DoWriteString(const wxString& key, const wxString& value) = 0; virtual bool DoWriteLong(const wxString& key, long value) = 0; virtual bool DoWriteDouble(const wxString& key, double value); virtual bool DoWriteBool(const wxString& key, bool value); #if wxUSE_BASE64 virtual bool DoWriteBinary(const wxString& key, const wxMemoryBuffer& buf) = 0; #endif // wxUSE_BASE64 private: // are we doing automatic environment variable expansion? bool m_bExpandEnvVars; // do we record default values? bool m_bRecordDefaults; // static variables static wxConfigBase *ms_pConfig; static bool ms_bAutoCreate; // Application name and organisation name wxString m_appName; wxString m_vendorName; // Style flag long m_style; wxDECLARE_ABSTRACT_CLASS(wxConfigBase); }; // a handy little class which changes current path to the path of given entry // and restores it in dtor: so if you declare a local variable of this type, // you work in the entry directory and the path is automatically restored // when the function returns // Taken out of wxConfig since not all compilers can cope with nested classes. class WXDLLIMPEXP_BASE wxConfigPathChanger { public: // ctor/dtor do path changing/restoring of the path wxConfigPathChanger(const wxConfigBase *pContainer, const wxString& strEntry); ~wxConfigPathChanger(); // get the key name const wxString& Name() const { return m_strName; } // this method must be called if the original path (i.e. the current path at // the moment of creation of this object) could have been deleted to prevent // us from restoring the not existing (any more) path // // if the original path doesn't exist any more, the path will be restored to // the deepest still existing component of the old path void UpdateIfDeleted(); private: wxConfigBase *m_pContainer; // object we live in wxString m_strName, // name of entry (i.e. name only) m_strOldPath; // saved path bool m_bChanged; // was the path changed? wxDECLARE_NO_COPY_CLASS(wxConfigPathChanger); }; #endif // wxUSE_CONFIG /* Replace environment variables ($SOMETHING) with their values. The format is $VARNAME or ${VARNAME} where VARNAME contains alphanumeric characters and '_' only. '$' must be escaped ('\$') in order to be taken literally. */ WXDLLIMPEXP_BASE wxString wxExpandEnvVars(const wxString &sz); /* Split path into parts removing '..' in progress */ WXDLLIMPEXP_BASE void wxSplitPath(wxArrayString& aParts, const wxString& path); #endif // _WX_CONFBASE_H_
h
rticonnextdds-usecases
data/projects/rticonnextdds-usecases/VehicleTracking/ExampleCode/thirdparty/wxWidgets-3.1.2/Linux/include/wx/pickerbase.h
///////////////////////////////////////////////////////////////////////////// // Name: wx/pickerbase.h // Purpose: wxPickerBase definition // Author: Francesco Montorsi (based on Vadim Zeitlin's code) // Modified by: // Created: 14/4/2006 // Copyright: (c) Vadim Zeitlin, Francesco Montorsi // Licence: wxWindows Licence ///////////////////////////////////////////////////////////////////////////// #ifndef _WX_PICKERBASE_H_BASE_ #define _WX_PICKERBASE_H_BASE_ #include "wx/control.h" #include "wx/sizer.h" #include "wx/containr.h" class WXDLLIMPEXP_FWD_CORE wxTextCtrl; class WXDLLIMPEXP_FWD_CORE wxToolTip; extern WXDLLIMPEXP_DATA_CORE(const char) wxButtonNameStr[]; // ---------------------------------------------------------------------------- // wxPickerBase is the base class for the picker controls which support // a wxPB_USE_TEXTCTRL style; i.e. for those pickers which can use an auxiliary // text control next to the 'real' picker. // // The wxTextPickerHelper class manages enabled/disabled state of the text control, // its sizing and positioning. // ---------------------------------------------------------------------------- #define wxPB_USE_TEXTCTRL 0x0002 #define wxPB_SMALL 0x8000 class WXDLLIMPEXP_CORE wxPickerBase : public wxNavigationEnabled<wxControl> { public: // ctor: text is the associated text control wxPickerBase() : m_text(NULL), m_picker(NULL), m_sizer(NULL) { } virtual ~wxPickerBase() {} // if present, intercepts wxPB_USE_TEXTCTRL style and creates the text control // The 3rd argument is the initial wxString to display in the text control bool CreateBase(wxWindow *parent, wxWindowID id, const wxString& text = wxEmptyString, const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxDefaultSize, long style = 0, const wxValidator& validator = wxDefaultValidator, const wxString& name = wxButtonNameStr); public: // public API // margin between the text control and the picker void SetInternalMargin(int newmargin) { GetTextCtrlItem()->SetBorder(newmargin); m_sizer->Layout(); } int GetInternalMargin() const { return GetTextCtrlItem()->GetBorder(); } // proportion of the text control void SetTextCtrlProportion(int prop) { GetTextCtrlItem()->SetProportion(prop); m_sizer->Layout(); } int GetTextCtrlProportion() const { return GetTextCtrlItem()->GetProportion(); } // proportion of the picker control void SetPickerCtrlProportion(int prop) { GetPickerCtrlItem()->SetProportion(prop); m_sizer->Layout(); } int GetPickerCtrlProportion() const { return GetPickerCtrlItem()->GetProportion(); } bool IsTextCtrlGrowable() const { return (GetTextCtrlItem()->GetFlag() & wxGROW) != 0; } void SetTextCtrlGrowable(bool grow = true) { DoSetGrowableFlagFor(GetTextCtrlItem(), grow); } bool IsPickerCtrlGrowable() const { return (GetPickerCtrlItem()->GetFlag() & wxGROW) != 0; } void SetPickerCtrlGrowable(bool grow = true) { DoSetGrowableFlagFor(GetPickerCtrlItem(), grow); } bool HasTextCtrl() const { return m_text != NULL; } wxTextCtrl *GetTextCtrl() { return m_text; } wxControl *GetPickerCtrl() { return m_picker; } void SetTextCtrl(wxTextCtrl* text) { m_text = text; } void SetPickerCtrl(wxControl* picker) { m_picker = picker; } // methods that derived class must/may override virtual void UpdatePickerFromTextCtrl() = 0; virtual void UpdateTextCtrlFromPicker() = 0; protected: // overridden base class methods #if wxUSE_TOOLTIPS virtual void DoSetToolTip(wxToolTip *tip) wxOVERRIDE; #endif // wxUSE_TOOLTIPS // event handlers void OnTextCtrlDelete(wxWindowDestroyEvent &); void OnTextCtrlUpdate(wxCommandEvent &); void OnTextCtrlKillFocus(wxFocusEvent &); // returns the set of styles for the attached wxTextCtrl // from given wxPickerBase's styles virtual long GetTextCtrlStyle(long style) const { return (style & wxWINDOW_STYLE_MASK); } // returns the set of styles for the m_picker virtual long GetPickerStyle(long style) const { return (style & wxWINDOW_STYLE_MASK); } wxSizerItem *GetPickerCtrlItem() const { if (this->HasTextCtrl()) return m_sizer->GetItem((size_t)1); return m_sizer->GetItem((size_t)0); } wxSizerItem *GetTextCtrlItem() const { wxASSERT(this->HasTextCtrl()); return m_sizer->GetItem((size_t)0); } #if WXWIN_COMPATIBILITY_3_0 wxDEPRECATED_MSG("useless and will be removed in the future") int GetDefaultPickerCtrlFlag() const { return wxALIGN_CENTER_VERTICAL; } wxDEPRECATED_MSG("useless and will be removed in the future") int GetDefaultTextCtrlFlag() const { return wxALIGN_CENTER_VERTICAL | wxRIGHT; } #endif // WXWIN_COMPATIBILITY_3_0 void PostCreation(); protected: wxTextCtrl *m_text; // can be NULL wxControl *m_picker; wxBoxSizer *m_sizer; private: // Common implementation of Set{Text,Picker}CtrlGrowable(). void DoSetGrowableFlagFor(wxSizerItem* item, bool grow); wxDECLARE_ABSTRACT_CLASS(wxPickerBase); }; #endif // _WX_PICKERBASE_H_BASE_
h
rticonnextdds-usecases
data/projects/rticonnextdds-usecases/VehicleTracking/ExampleCode/thirdparty/wxWidgets-3.1.2/Linux/include/wx/mimetype.h
///////////////////////////////////////////////////////////////////////////// // Name: wx/mimetype.h // Purpose: classes and functions to manage MIME types // Author: Vadim Zeitlin // Modified by: // Chris Elliott ([email protected]) 5 Dec 00: write support for Win32 // Created: 23.09.98 // Copyright: (c) 1998 Vadim Zeitlin <[email protected]> // Licence: wxWindows licence (part of wxExtra library) ///////////////////////////////////////////////////////////////////////////// #ifndef _WX_MIMETYPE_H_ #define _WX_MIMETYPE_H_ // ---------------------------------------------------------------------------- // headers and such // ---------------------------------------------------------------------------- #include "wx/defs.h" #if wxUSE_MIMETYPE // the things we really need #include "wx/string.h" #include "wx/dynarray.h" #include "wx/arrstr.h" #include <stdarg.h> // fwd decls class WXDLLIMPEXP_FWD_BASE wxIconLocation; class WXDLLIMPEXP_FWD_BASE wxFileTypeImpl; class WXDLLIMPEXP_FWD_BASE wxMimeTypesManagerImpl; // these constants define the MIME informations source under UNIX and are used // by wxMimeTypesManager::Initialize() enum wxMailcapStyle { wxMAILCAP_STANDARD = 1, wxMAILCAP_NETSCAPE = 2, wxMAILCAP_KDE = 4, wxMAILCAP_GNOME = 8, wxMAILCAP_ALL = 15 }; /* TODO: would it be more convenient to have this class? class WXDLLIMPEXP_BASE wxMimeType : public wxString { public: // all string ctors here wxString GetType() const { return BeforeFirst(wxT('/')); } wxString GetSubType() const { return AfterFirst(wxT('/')); } void SetSubType(const wxString& subtype) { *this = GetType() + wxT('/') + subtype; } bool Matches(const wxMimeType& wildcard) { // implement using wxMimeTypesManager::IsOfType() } }; */ // wxMimeTypeCommands stores the verbs defined for the given MIME type with // their values class WXDLLIMPEXP_BASE wxMimeTypeCommands { public: wxMimeTypeCommands() {} wxMimeTypeCommands(const wxArrayString& verbs, const wxArrayString& commands) : m_verbs(verbs), m_commands(commands) { } // add a new verb with the command or replace the old value void AddOrReplaceVerb(const wxString& verb, const wxString& cmd); void Add(const wxString& s) { m_verbs.Add(s.BeforeFirst(wxT('='))); m_commands.Add(s.AfterFirst(wxT('='))); } // access the commands size_t GetCount() const { return m_verbs.GetCount(); } const wxString& GetVerb(size_t n) const { return m_verbs[n]; } const wxString& GetCmd(size_t n) const { return m_commands[n]; } bool HasVerb(const wxString& verb) const { return m_verbs.Index(verb) != wxNOT_FOUND; } // returns empty string and wxNOT_FOUND in idx if no such verb wxString GetCommandForVerb(const wxString& verb, size_t *idx = NULL) const; // get a "verb=command" string wxString GetVerbCmd(size_t n) const; private: wxArrayString m_verbs; wxArrayString m_commands; }; // ---------------------------------------------------------------------------- // wxFileTypeInfo: static container of information accessed via wxFileType. // // This class is used with wxMimeTypesManager::AddFallbacks() and Associate() // ---------------------------------------------------------------------------- class WXDLLIMPEXP_BASE wxFileTypeInfo { private: void DoVarArgInit(const wxString& mimeType, const wxString& openCmd, const wxString& printCmd, const wxString& desc, va_list argptr); void VarArgInit(const wxString *mimeType, const wxString *openCmd, const wxString *printCmd, const wxString *desc, // the other parameters form a NULL terminated list of // extensions ...); public: // NB: This is a helper to get implicit conversion of variadic ctor's // fixed arguments into something that can be passed to VarArgInit(). // Do not use, it's used by the ctor only. struct CtorString { CtorString(const char *str) : m_str(str) {} CtorString(const wchar_t *str) : m_str(str) {} CtorString(const wxString& str) : m_str(str) {} CtorString(const wxCStrData& str) : m_str(str) {} CtorString(const wxScopedCharBuffer& str) : m_str(str) {} CtorString(const wxScopedWCharBuffer& str) : m_str(str) {} operator const wxString*() const { return &m_str; } wxString m_str; }; // ctors // Ctor specifying just the MIME type (which is mandatory), the other // fields can be set later if needed. wxFileTypeInfo(const wxString& mimeType) : m_mimeType(mimeType) { } // Ctor allowing to specify the values of all fields at once: // // wxFileTypeInfo(const wxString& mimeType, // const wxString& openCmd, // const wxString& printCmd, // const wxString& desc, // // the other parameters form a list of extensions for this // // file type and should be terminated with wxNullPtr (not // // just NULL!) // ...); WX_DEFINE_VARARG_FUNC_CTOR(wxFileTypeInfo, 4, (const CtorString&, const CtorString&, const CtorString&, const CtorString&), VarArgInit, VarArgInit) // the array elements correspond to the parameters of the ctor above in // the same order wxFileTypeInfo(const wxArrayString& sArray); // invalid item - use this to terminate the array passed to // wxMimeTypesManager::AddFallbacks wxFileTypeInfo() { } // test if this object can be used bool IsValid() const { return !m_mimeType.empty(); } // setters // set the open/print commands void SetOpenCommand(const wxString& command) { m_openCmd = command; } void SetPrintCommand(const wxString& command) { m_printCmd = command; } // set the description void SetDescription(const wxString& desc) { m_desc = desc; } // add another extension corresponding to this file type void AddExtension(const wxString& ext) { m_exts.push_back(ext); } // set the icon info void SetIcon(const wxString& iconFile, int iconIndex = 0) { m_iconFile = iconFile; m_iconIndex = iconIndex; } // set the short desc void SetShortDesc(const wxString& shortDesc) { m_shortDesc = shortDesc; } // accessors // get the MIME type const wxString& GetMimeType() const { return m_mimeType; } // get the open command const wxString& GetOpenCommand() const { return m_openCmd; } // get the print command const wxString& GetPrintCommand() const { return m_printCmd; } // get the short description (only used under Win32 so far) const wxString& GetShortDesc() const { return m_shortDesc; } // get the long, user visible description const wxString& GetDescription() const { return m_desc; } // get the array of all extensions const wxArrayString& GetExtensions() const { return m_exts; } size_t GetExtensionsCount() const {return m_exts.GetCount(); } // get the icon info const wxString& GetIconFile() const { return m_iconFile; } int GetIconIndex() const { return m_iconIndex; } private: wxString m_mimeType, // the MIME type in "type/subtype" form m_openCmd, // command to use for opening the file (%s allowed) m_printCmd, // command to use for printing the file (%s allowed) m_shortDesc, // a short string used in the registry m_desc; // a free form description of this file type // icon stuff wxString m_iconFile; // the file containing the icon int m_iconIndex; // icon index in this file wxArrayString m_exts; // the extensions which are mapped on this filetype #if 0 // TODO // the additional (except "open" and "print") command names and values wxArrayString m_commandNames, m_commandValues; #endif // 0 }; WX_DECLARE_USER_EXPORTED_OBJARRAY(wxFileTypeInfo, wxArrayFileTypeInfo, WXDLLIMPEXP_BASE); // ---------------------------------------------------------------------------- // wxFileType: gives access to all information about the files of given type. // // This class holds information about a given "file type". File type is the // same as MIME type under Unix, but under Windows it corresponds more to an // extension than to MIME type (in fact, several extensions may correspond to a // file type). This object may be created in many different ways and depending // on how it was created some fields may be unknown so the return value of all // the accessors *must* be checked! // ---------------------------------------------------------------------------- class WXDLLIMPEXP_BASE wxFileType { friend class WXDLLIMPEXP_FWD_BASE wxMimeTypesManagerImpl; // it has access to m_impl public: // An object of this class must be passed to Get{Open|Print}Command. The // default implementation is trivial and doesn't know anything at all about // parameters, only filename and MIME type are used (so it's probably ok for // Windows where %{param} is not used anyhow) class MessageParameters { public: // ctors MessageParameters() { } MessageParameters(const wxString& filename, const wxString& mimetype = wxEmptyString) : m_filename(filename), m_mimetype(mimetype) { } // accessors (called by GetOpenCommand) // filename const wxString& GetFileName() const { return m_filename; } // mime type const wxString& GetMimeType() const { return m_mimetype; } // override this function in derived class virtual wxString GetParamValue(const wxString& WXUNUSED(name)) const { return wxEmptyString; } // virtual dtor as in any base class virtual ~MessageParameters() { } protected: wxString m_filename, m_mimetype; }; // ctor from static data wxFileType(const wxFileTypeInfo& ftInfo); // accessors: all of them return true if the corresponding information // could be retrieved/found, false otherwise (and in this case all [out] // parameters are unchanged) // return the MIME type for this file type bool GetMimeType(wxString *mimeType) const; bool GetMimeTypes(wxArrayString& mimeTypes) const; // fill passed in array with all extensions associated with this file // type bool GetExtensions(wxArrayString& extensions); // get the icon corresponding to this file type and of the given size bool GetIcon(wxIconLocation *iconloc) const; bool GetIcon(wxIconLocation *iconloc, const MessageParameters& params) const; // get a brief file type description ("*.txt" => "text document") bool GetDescription(wxString *desc) const; // get the command to be used to open/print the given file. // get the command to execute the file of given type bool GetOpenCommand(wxString *openCmd, const MessageParameters& params) const; // a simpler to use version of GetOpenCommand() -- it only takes the // filename and returns an empty string on failure wxString GetOpenCommand(const wxString& filename) const; // get the command to print the file of given type bool GetPrintCommand(wxString *printCmd, const MessageParameters& params) const; // return the number of commands defined for this file type, 0 if none size_t GetAllCommands(wxArrayString *verbs, wxArrayString *commands, const wxFileType::MessageParameters& params) const; // set an arbitrary command, ask confirmation if it already exists and // overwriteprompt is true bool SetCommand(const wxString& cmd, const wxString& verb, bool overwriteprompt = true); bool SetDefaultIcon(const wxString& cmd = wxEmptyString, int index = 0); // remove the association for this filetype from the system MIME database: // notice that it will only work if the association is defined in the user // file/registry part, we will never modify the system-wide settings bool Unassociate(); // operations // expand a string in the format of GetOpenCommand (which may contain // '%s' and '%t' format specifiers for the file name and mime type // and %{param} constructions). static wxString ExpandCommand(const wxString& command, const MessageParameters& params); // dtor (not virtual, shouldn't be derived from) ~wxFileType(); wxString GetExpandedCommand(const wxString& verb, const wxFileType::MessageParameters& params) const; private: // default ctor is private because the user code never creates us wxFileType(); // no copy ctor/assignment operator wxFileType(const wxFileType&); wxFileType& operator=(const wxFileType&); // the static container of wxFileType data: if it's not NULL, it means that // this object is used as fallback only const wxFileTypeInfo *m_info; // the object which implements the real stuff like reading and writing // to/from system MIME database wxFileTypeImpl *m_impl; }; //---------------------------------------------------------------------------- // wxMimeTypesManagerFactory //---------------------------------------------------------------------------- class WXDLLIMPEXP_BASE wxMimeTypesManagerFactory { public: wxMimeTypesManagerFactory() {} virtual ~wxMimeTypesManagerFactory() {} virtual wxMimeTypesManagerImpl *CreateMimeTypesManagerImpl(); static void Set( wxMimeTypesManagerFactory *factory ); static wxMimeTypesManagerFactory *Get(); private: static wxMimeTypesManagerFactory *m_factory; }; // ---------------------------------------------------------------------------- // wxMimeTypesManager: interface to system MIME database. // // This class accesses the information about all known MIME types and allows // the application to retrieve information (including how to handle data of // given type) about them. // ---------------------------------------------------------------------------- class WXDLLIMPEXP_BASE wxMimeTypesManager { public: // static helper functions // ----------------------- // check if the given MIME type is the same as the other one: the // second argument may contain wildcards ('*'), but not the first. If // the types are equal or if the mimeType matches wildcard the function // returns true, otherwise it returns false static bool IsOfType(const wxString& mimeType, const wxString& wildcard); // ctor wxMimeTypesManager(); // NB: the following 2 functions are for Unix only and don't do anything // elsewhere // loads data from standard files according to the mailcap styles // specified: this is a bitwise OR of wxMailcapStyle values // // use the extraDir parameter if you want to look for files in another // directory void Initialize(int mailcapStyle = wxMAILCAP_ALL, const wxString& extraDir = wxEmptyString); // and this function clears all the data from the manager void ClearData(); // Database lookup: all functions return a pointer to wxFileType object // whose methods may be used to query it for the information you're // interested in. If the return value is !NULL, caller is responsible for // deleting it. // get file type from file extension wxFileType *GetFileTypeFromExtension(const wxString& ext); // get file type from MIME type (in format <category>/<format>) wxFileType *GetFileTypeFromMimeType(const wxString& mimeType); // enumerate all known MIME types // // returns the number of retrieved file types size_t EnumAllFileTypes(wxArrayString& mimetypes); // these functions can be used to provide default values for some of the // MIME types inside the program itself // // The filetypes array should be terminated by either NULL entry or an // invalid wxFileTypeInfo (i.e. the one created with default ctor) void AddFallbacks(const wxFileTypeInfo *filetypes); void AddFallback(const wxFileTypeInfo& ft) { m_fallbacks.Add(ft); } // create or remove associations // create a new association using the fields of wxFileTypeInfo (at least // the MIME type and the extension should be set) // if the other fields are empty, the existing values should be left alone wxFileType *Associate(const wxFileTypeInfo& ftInfo); // undo Associate() bool Unassociate(wxFileType *ft) ; // dtor (not virtual, shouldn't be derived from) ~wxMimeTypesManager(); private: // no copy ctor/assignment operator wxMimeTypesManager(const wxMimeTypesManager&); wxMimeTypesManager& operator=(const wxMimeTypesManager&); // the fallback info which is used if the information is not found in the // real system database wxArrayFileTypeInfo m_fallbacks; // the object working with the system MIME database wxMimeTypesManagerImpl *m_impl; // if m_impl is NULL, create one void EnsureImpl(); friend class wxMimeTypeCmnModule; }; // ---------------------------------------------------------------------------- // global variables // ---------------------------------------------------------------------------- // the default mime manager for wxWidgets programs extern WXDLLIMPEXP_DATA_BASE(wxMimeTypesManager *) wxTheMimeTypesManager; #endif // wxUSE_MIMETYPE #endif //_WX_MIMETYPE_H_
h
rticonnextdds-usecases
data/projects/rticonnextdds-usecases/VehicleTracking/ExampleCode/thirdparty/wxWidgets-3.1.2/Linux/include/wx/colordlg.h
///////////////////////////////////////////////////////////////////////////// // Name: wx/colordlg.h // Purpose: wxColourDialog // Author: Vadim Zeitlin // Modified by: // Created: 01/02/97 // Copyright: (c) wxWidgets team // Licence: wxWindows licence ///////////////////////////////////////////////////////////////////////////// #ifndef _WX_COLORDLG_H_BASE_ #define _WX_COLORDLG_H_BASE_ #include "wx/defs.h" #if wxUSE_COLOURDLG #include "wx/colourdata.h" #if defined(__WXMSW__) && !defined(__WXUNIVERSAL__) #include "wx/msw/colordlg.h" #elif defined(__WXMAC__) && !defined(__WXUNIVERSAL__) #include "wx/osx/colordlg.h" #elif defined(__WXGTK20__) && !defined(__WXUNIVERSAL__) #include "wx/gtk/colordlg.h" #elif defined(__WXQT__) #include "wx/qt/colordlg.h" #else #include "wx/generic/colrdlgg.h" #define wxColourDialog wxGenericColourDialog #endif // get the colour from user and return it WXDLLIMPEXP_CORE wxColour wxGetColourFromUser(wxWindow *parent = NULL, const wxColour& colInit = wxNullColour, const wxString& caption = wxEmptyString, wxColourData *data = NULL); #endif // wxUSE_COLOURDLG #endif // _WX_COLORDLG_H_BASE_
h
rticonnextdds-usecases
data/projects/rticonnextdds-usecases/VehicleTracking/ExampleCode/thirdparty/wxWidgets-3.1.2/Linux/include/wx/button.h
///////////////////////////////////////////////////////////////////////////// // Name: wx/button.h // Purpose: wxButtonBase class // Author: Vadim Zeitlin // Modified by: // Created: 15.08.00 // Copyright: (c) Vadim Zeitlin // Licence: wxWindows licence ///////////////////////////////////////////////////////////////////////////// #ifndef _WX_BUTTON_H_BASE_ #define _WX_BUTTON_H_BASE_ #include "wx/defs.h" #if wxUSE_BUTTON #include "wx/anybutton.h" extern WXDLLIMPEXP_DATA_CORE(const char) wxButtonNameStr[]; // ---------------------------------------------------------------------------- // wxButton: a push button // ---------------------------------------------------------------------------- class WXDLLIMPEXP_CORE wxButtonBase : public wxAnyButton { public: wxButtonBase() { } // show the authentication needed symbol on the button: this is currently // only implemented on Windows Vista and newer (on which it shows the UAC // shield symbol) void SetAuthNeeded(bool show = true) { DoSetAuthNeeded(show); } bool GetAuthNeeded() const { return DoGetAuthNeeded(); } // make this button the default button in its top level window // // returns the old default item (possibly NULL) virtual wxWindow *SetDefault(); // returns the default button size for this platform static wxSize GetDefaultSize(); protected: wxDECLARE_NO_COPY_CLASS(wxButtonBase); }; #if defined(__WXUNIVERSAL__) #include "wx/univ/button.h" #elif defined(__WXMSW__) #include "wx/msw/button.h" #elif defined(__WXMOTIF__) #include "wx/motif/button.h" #elif defined(__WXGTK20__) #include "wx/gtk/button.h" #elif defined(__WXGTK__) #include "wx/gtk1/button.h" #elif defined(__WXMAC__) #include "wx/osx/button.h" #elif defined(__WXQT__) #include "wx/qt/button.h" #endif #endif // wxUSE_BUTTON #endif // _WX_BUTTON_H_BASE_
h
rticonnextdds-usecases
data/projects/rticonnextdds-usecases/VehicleTracking/ExampleCode/thirdparty/wxWidgets-3.1.2/Linux/include/wx/scopedptr.h
///////////////////////////////////////////////////////////////////////////// // Name: wx/scopedptr.h // Purpose: scoped smart pointer class // Author: Jesse Lovelace <[email protected]> // Created: 06/01/02 // Copyright: (c) Jesse Lovelace and original Boost authors (see below) // (c) 2009 Vadim Zeitlin // Licence: wxWindows licence ///////////////////////////////////////////////////////////////////////////// // This class closely follows the implementation of the boost // library scoped_ptr and is an adaptation for c++ macro's in // the wxWidgets project. The original authors of the boost // scoped_ptr are given below with their respective copyrights. // (C) Copyright Greg Colvin and Beman Dawes 1998, 1999. // Copyright (c) 2001, 2002 Peter Dimov // // Permission to copy, use, modify, sell and distribute this software // is granted provided this copyright notice appears in all copies. // This software is provided "as is" without express or implied // warranty, and with no claim as to its suitability for any purpose. // // See http://www.boost.org/libs/smart_ptr/scoped_ptr.htm for documentation. // #ifndef _WX_SCOPED_PTR_H_ #define _WX_SCOPED_PTR_H_ #include "wx/defs.h" #include "wx/checkeddelete.h" // ---------------------------------------------------------------------------- // wxScopedPtr: A scoped pointer // ---------------------------------------------------------------------------- template <class T> class wxScopedPtr { public: typedef T element_type; explicit wxScopedPtr(T * ptr = NULL) : m_ptr(ptr) { } ~wxScopedPtr() { wxCHECKED_DELETE(m_ptr); } // test for pointer validity: defining conversion to unspecified_bool_type // and not more obvious bool to avoid implicit conversions to integer types #ifdef __BORLANDC__ // this compiler is too dumb to use unspecified_bool_type operator in tests // of the form "if ( !ptr )" typedef bool unspecified_bool_type; #else typedef T *(wxScopedPtr<T>::*unspecified_bool_type)() const; #endif // __BORLANDC__ operator unspecified_bool_type() const { return m_ptr ? &wxScopedPtr<T>::get : NULL; } void reset(T * ptr = NULL) { if ( ptr != m_ptr ) { wxCHECKED_DELETE(m_ptr); m_ptr = ptr; } } T *release() { T *ptr = m_ptr; m_ptr = NULL; return ptr; } T & operator*() const { wxASSERT(m_ptr != NULL); return *m_ptr; } T * operator->() const { wxASSERT(m_ptr != NULL); return m_ptr; } T * get() const { return m_ptr; } void swap(wxScopedPtr& other) { T * const tmp = other.m_ptr; other.m_ptr = m_ptr; m_ptr = tmp; } private: T * m_ptr; wxDECLARE_NO_COPY_TEMPLATE_CLASS(wxScopedPtr, T); }; // ---------------------------------------------------------------------------- // old macro based implementation // ---------------------------------------------------------------------------- /* The type being used *must* be complete at the time that wxDEFINE_SCOPED_* is called or a compiler error will result. This is because the class checks for the completeness of the type being used. */ #define wxDECLARE_SCOPED_PTR(T, name) \ class name \ { \ private: \ T * m_ptr; \ \ name(name const &); \ name & operator=(name const &); \ \ public: \ explicit name(T * ptr = NULL) \ : m_ptr(ptr) { } \ \ ~name(); \ \ void reset(T * ptr = NULL); \ \ T *release() \ { \ T *ptr = m_ptr; \ m_ptr = NULL; \ return ptr; \ } \ \ T & operator*() const \ { \ wxASSERT(m_ptr != NULL); \ return *m_ptr; \ } \ \ T * operator->() const \ { \ wxASSERT(m_ptr != NULL); \ return m_ptr; \ } \ \ T * get() const \ { \ return m_ptr; \ } \ \ void swap(name & ot) \ { \ T * tmp = ot.m_ptr; \ ot.m_ptr = m_ptr; \ m_ptr = tmp; \ } \ }; #define wxDEFINE_SCOPED_PTR(T, name)\ void name::reset(T * ptr) \ { \ if (m_ptr != ptr) \ { \ wxCHECKED_DELETE(m_ptr); \ m_ptr = ptr; \ } \ } \ name::~name() \ { \ wxCHECKED_DELETE(m_ptr); \ } // this macro can be used for the most common case when you want to declare and // define the scoped pointer at the same time and want to use the standard // naming convention: auto pointer to Foo is called FooPtr #define wxDEFINE_SCOPED_PTR_TYPE(T) \ wxDECLARE_SCOPED_PTR(T, T ## Ptr) \ wxDEFINE_SCOPED_PTR(T, T ## Ptr) // ---------------------------------------------------------------------------- // "Tied" scoped pointer: same as normal one but also sets the value of // some other variable to the pointer value // ---------------------------------------------------------------------------- #define wxDEFINE_TIED_SCOPED_PTR_TYPE(T) \ wxDEFINE_SCOPED_PTR_TYPE(T) \ class T ## TiedPtr : public T ## Ptr \ { \ public: \ T ## TiedPtr(T **pp, T *p) \ : T ## Ptr(p), m_pp(pp) \ { \ m_pOld = *pp; \ *pp = p; \ } \ \ ~ T ## TiedPtr() \ { \ *m_pp = m_pOld; \ } \ \ private: \ T **m_pp; \ T *m_pOld; \ }; #endif // _WX_SCOPED_PTR_H_
h
rticonnextdds-usecases
data/projects/rticonnextdds-usecases/VehicleTracking/ExampleCode/thirdparty/wxWidgets-3.1.2/Linux/include/wx/treectrl.h
///////////////////////////////////////////////////////////////////////////// // Name: wx/treectrl.h // Purpose: wxTreeCtrl base header // Author: Karsten Ballueder // Modified by: // Created: // Copyright: (c) Karsten Ballueder // Licence: wxWindows licence ///////////////////////////////////////////////////////////////////////////// #ifndef _WX_TREECTRL_H_BASE_ #define _WX_TREECTRL_H_BASE_ // ---------------------------------------------------------------------------- // headers // ---------------------------------------------------------------------------- #include "wx/defs.h" #if wxUSE_TREECTRL #include "wx/control.h" #include "wx/treebase.h" #include "wx/textctrl.h" // wxTextCtrl::ms_classinfo used through wxCLASSINFO macro #include "wx/systhemectrl.h" class WXDLLIMPEXP_FWD_CORE wxImageList; #if !defined(__WXMSW__) || defined(__WXUNIVERSAL__) #define wxHAS_GENERIC_TREECTRL #endif // ---------------------------------------------------------------------------- // wxTreeCtrlBase // ---------------------------------------------------------------------------- class WXDLLIMPEXP_CORE wxTreeCtrlBase : public wxSystemThemedControl<wxControl> { public: wxTreeCtrlBase(); virtual ~wxTreeCtrlBase(); // accessors // --------- // get the total number of items in the control virtual unsigned int GetCount() const = 0; // indent is the number of pixels the children are indented relative to // the parents position. SetIndent() also redraws the control // immediately. virtual unsigned int GetIndent() const = 0; virtual void SetIndent(unsigned int indent) = 0; // spacing is the number of pixels between the start and the Text // (has no effect under wxMSW) unsigned int GetSpacing() const { return m_spacing; } void SetSpacing(unsigned int spacing) { m_spacing = spacing; } // image list: these functions allow to associate an image list with // the control and retrieve it. Note that the control does _not_ delete // the associated image list when it's deleted in order to allow image // lists to be shared between different controls. // // The normal image list is for the icons which correspond to the // normal tree item state (whether it is selected or not). // Additionally, the application might choose to show a state icon // which corresponds to an app-defined item state (for example, // checked/unchecked) which are taken from the state image list. wxImageList *GetImageList() const { return m_imageListNormal; } wxImageList *GetStateImageList() const { return m_imageListState; } virtual void SetImageList(wxImageList *imageList) = 0; virtual void SetStateImageList(wxImageList *imageList) = 0; void AssignImageList(wxImageList *imageList) { SetImageList(imageList); m_ownsImageListNormal = true; } void AssignStateImageList(wxImageList *imageList) { SetStateImageList(imageList); m_ownsImageListState = true; } // Functions to work with tree ctrl items. Unfortunately, they can _not_ be // member functions of wxTreeItem because they must know the tree the item // belongs to for Windows implementation and storing the pointer to // wxTreeCtrl in each wxTreeItem is just too much waste. // accessors // --------- // retrieve items label virtual wxString GetItemText(const wxTreeItemId& item) const = 0; // get one of the images associated with the item (normal by default) virtual int GetItemImage(const wxTreeItemId& item, wxTreeItemIcon which = wxTreeItemIcon_Normal) const = 0; // get the data associated with the item virtual wxTreeItemData *GetItemData(const wxTreeItemId& item) const = 0; // get the item's text colour virtual wxColour GetItemTextColour(const wxTreeItemId& item) const = 0; // get the item's background colour virtual wxColour GetItemBackgroundColour(const wxTreeItemId& item) const = 0; // get the item's font virtual wxFont GetItemFont(const wxTreeItemId& item) const = 0; // get the items state int GetItemState(const wxTreeItemId& item) const { return DoGetItemState(item); } // modifiers // --------- // set items label virtual void SetItemText(const wxTreeItemId& item, const wxString& text) = 0; // set one of the images associated with the item (normal by default) virtual void SetItemImage(const wxTreeItemId& item, int image, wxTreeItemIcon which = wxTreeItemIcon_Normal) = 0; // associate some data with the item virtual void SetItemData(const wxTreeItemId& item, wxTreeItemData *data) = 0; // force appearance of [+] button near the item. This is useful to // allow the user to expand the items which don't have any children now // - but instead add them only when needed, thus minimizing memory // usage and loading time. virtual void SetItemHasChildren(const wxTreeItemId& item, bool has = true) = 0; // the item will be shown in bold virtual void SetItemBold(const wxTreeItemId& item, bool bold = true) = 0; // the item will be shown with a drop highlight virtual void SetItemDropHighlight(const wxTreeItemId& item, bool highlight = true) = 0; // set the items text colour virtual void SetItemTextColour(const wxTreeItemId& item, const wxColour& col) = 0; // set the items background colour virtual void SetItemBackgroundColour(const wxTreeItemId& item, const wxColour& col) = 0; // set the items font (should be of the same height for all items) virtual void SetItemFont(const wxTreeItemId& item, const wxFont& font) = 0; // set the items state (special state values: wxTREE_ITEMSTATE_NONE/NEXT/PREV) void SetItemState(const wxTreeItemId& item, int state); // item status inquiries // --------------------- // is the item visible (it might be outside the view or not expanded)? virtual bool IsVisible(const wxTreeItemId& item) const = 0; // does the item has any children? virtual bool ItemHasChildren(const wxTreeItemId& item) const = 0; // same as above bool HasChildren(const wxTreeItemId& item) const { return ItemHasChildren(item); } // is the item expanded (only makes sense if HasChildren())? virtual bool IsExpanded(const wxTreeItemId& item) const = 0; // is this item currently selected (the same as has focus)? virtual bool IsSelected(const wxTreeItemId& item) const = 0; // is item text in bold font? virtual bool IsBold(const wxTreeItemId& item) const = 0; // is the control empty? bool IsEmpty() const; // number of children // ------------------ // if 'recursively' is false, only immediate children count, otherwise // the returned number is the number of all items in this branch virtual size_t GetChildrenCount(const wxTreeItemId& item, bool recursively = true) const = 0; // navigation // ---------- // wxTreeItemId.IsOk() will return false if there is no such item // get the root tree item virtual wxTreeItemId GetRootItem() const = 0; // get the item currently selected (may return NULL if no selection) virtual wxTreeItemId GetSelection() const = 0; // get the items currently selected, return the number of such item // // NB: this operation is expensive and can take a long time for a // control with a lot of items (~ O(number of items)). virtual size_t GetSelections(wxArrayTreeItemIds& selections) const = 0; // get the last item to be clicked when the control has wxTR_MULTIPLE // equivalent to GetSelection() if not wxTR_MULTIPLE virtual wxTreeItemId GetFocusedItem() const = 0; // Clears the currently focused item virtual void ClearFocusedItem() = 0; // Sets the currently focused item. Item should be valid virtual void SetFocusedItem(const wxTreeItemId& item) = 0; // get the parent of this item (may return NULL if root) virtual wxTreeItemId GetItemParent(const wxTreeItemId& item) const = 0; // for this enumeration function you must pass in a "cookie" parameter // which is opaque for the application but is necessary for the library // to make these functions reentrant (i.e. allow more than one // enumeration on one and the same object simultaneously). Of course, // the "cookie" passed to GetFirstChild() and GetNextChild() should be // the same! // get the first child of this item virtual wxTreeItemId GetFirstChild(const wxTreeItemId& item, wxTreeItemIdValue& cookie) const = 0; // get the next child virtual wxTreeItemId GetNextChild(const wxTreeItemId& item, wxTreeItemIdValue& cookie) const = 0; // get the last child of this item - this method doesn't use cookies virtual wxTreeItemId GetLastChild(const wxTreeItemId& item) const = 0; // get the next sibling of this item virtual wxTreeItemId GetNextSibling(const wxTreeItemId& item) const = 0; // get the previous sibling virtual wxTreeItemId GetPrevSibling(const wxTreeItemId& item) const = 0; // get first visible item virtual wxTreeItemId GetFirstVisibleItem() const = 0; // get the next visible item: item must be visible itself! // see IsVisible() and wxTreeCtrl::GetFirstVisibleItem() virtual wxTreeItemId GetNextVisible(const wxTreeItemId& item) const = 0; // get the previous visible item: item must be visible itself! virtual wxTreeItemId GetPrevVisible(const wxTreeItemId& item) const = 0; // operations // ---------- // add the root node to the tree virtual wxTreeItemId AddRoot(const wxString& text, int image = -1, int selImage = -1, wxTreeItemData *data = NULL) = 0; // insert a new item in as the first child of the parent wxTreeItemId PrependItem(const wxTreeItemId& parent, const wxString& text, int image = -1, int selImage = -1, wxTreeItemData *data = NULL) { return DoInsertItem(parent, 0u, text, image, selImage, data); } // insert a new item after a given one wxTreeItemId InsertItem(const wxTreeItemId& parent, const wxTreeItemId& idPrevious, const wxString& text, int image = -1, int selImage = -1, wxTreeItemData *data = NULL) { return DoInsertAfter(parent, idPrevious, text, image, selImage, data); } // insert a new item before the one with the given index wxTreeItemId InsertItem(const wxTreeItemId& parent, size_t pos, const wxString& text, int image = -1, int selImage = -1, wxTreeItemData *data = NULL) { return DoInsertItem(parent, pos, text, image, selImage, data); } // insert a new item in as the last child of the parent wxTreeItemId AppendItem(const wxTreeItemId& parent, const wxString& text, int image = -1, int selImage = -1, wxTreeItemData *data = NULL) { return DoInsertItem(parent, (size_t)-1, text, image, selImage, data); } // delete this item and associated data if any virtual void Delete(const wxTreeItemId& item) = 0; // delete all children (but don't delete the item itself) // NB: this won't send wxEVT_TREE_ITEM_DELETED events virtual void DeleteChildren(const wxTreeItemId& item) = 0; // delete all items from the tree // NB: this won't send wxEVT_TREE_ITEM_DELETED events virtual void DeleteAllItems() = 0; // expand this item virtual void Expand(const wxTreeItemId& item) = 0; // expand the item and all its children recursively void ExpandAllChildren(const wxTreeItemId& item); // expand all items void ExpandAll(); // collapse the item without removing its children virtual void Collapse(const wxTreeItemId& item) = 0; // collapse the item and all its children void CollapseAllChildren(const wxTreeItemId& item); // collapse all items void CollapseAll(); // collapse the item and remove all children virtual void CollapseAndReset(const wxTreeItemId& item) = 0; // toggles the current state virtual void Toggle(const wxTreeItemId& item) = 0; // remove the selection from currently selected item (if any) virtual void Unselect() = 0; // unselect all items (only makes sense for multiple selection control) virtual void UnselectAll() = 0; // select this item virtual void SelectItem(const wxTreeItemId& item, bool select = true) = 0; // selects all (direct) children for given parent (only for // multiselection controls) virtual void SelectChildren(const wxTreeItemId& parent) = 0; // unselect this item void UnselectItem(const wxTreeItemId& item) { SelectItem(item, false); } // toggle item selection void ToggleItemSelection(const wxTreeItemId& item) { SelectItem(item, !IsSelected(item)); } // make sure this item is visible (expanding the parent item and/or // scrolling to this item if necessary) virtual void EnsureVisible(const wxTreeItemId& item) = 0; // scroll to this item (but don't expand its parent) virtual void ScrollTo(const wxTreeItemId& item) = 0; // start editing the item label: this (temporarily) replaces the item // with a one line edit control. The item will be selected if it hadn't // been before. textCtrlClass parameter allows you to create an edit // control of arbitrary user-defined class deriving from wxTextCtrl. virtual wxTextCtrl *EditLabel(const wxTreeItemId& item, wxClassInfo* textCtrlClass = wxCLASSINFO(wxTextCtrl)) = 0; // returns the same pointer as StartEdit() if the item is being edited, // NULL otherwise (it's assumed that no more than one item may be // edited simultaneously) virtual wxTextCtrl *GetEditControl() const = 0; // end editing and accept or discard the changes to item label virtual void EndEditLabel(const wxTreeItemId& item, bool discardChanges = false) = 0; // Enable or disable beep when incremental match doesn't find any item. // Only implemented in the generic version currently. virtual void EnableBellOnNoMatch(bool WXUNUSED(on) = true) { } // sorting // ------- // this function is called to compare 2 items and should return -1, 0 // or +1 if the first item is less than, equal to or greater than the // second one. The base class version performs alphabetic comparison // of item labels (GetText) virtual int OnCompareItems(const wxTreeItemId& item1, const wxTreeItemId& item2) { return wxStrcmp(GetItemText(item1), GetItemText(item2)); } // sort the children of this item using OnCompareItems // // NB: this function is not reentrant and not MT-safe (FIXME)! virtual void SortChildren(const wxTreeItemId& item) = 0; // items geometry // -------------- // determine to which item (if any) belongs the given point (the // coordinates specified are relative to the client area of tree ctrl) // and, in the second variant, fill the flags parameter with a bitmask // of wxTREE_HITTEST_xxx constants. wxTreeItemId HitTest(const wxPoint& point) const { int dummy; return DoTreeHitTest(point, dummy); } wxTreeItemId HitTest(const wxPoint& point, int& flags) const { return DoTreeHitTest(point, flags); } // get the bounding rectangle of the item (or of its label only) virtual bool GetBoundingRect(const wxTreeItemId& item, wxRect& rect, bool textOnly = false) const = 0; // implementation // -------------- virtual bool ShouldInheritColours() const wxOVERRIDE { return false; } // hint whether to calculate best size quickly or accurately void SetQuickBestSize(bool q) { m_quickBestSize = q; } bool GetQuickBestSize() const { return m_quickBestSize; } protected: virtual wxSize DoGetBestSize() const wxOVERRIDE; // common part of Get/SetItemState() virtual int DoGetItemState(const wxTreeItemId& item) const = 0; virtual void DoSetItemState(const wxTreeItemId& item, int state) = 0; // common part of Append/Prepend/InsertItem() // // pos is the position at which to insert the item or (size_t)-1 to append // it to the end virtual wxTreeItemId DoInsertItem(const wxTreeItemId& parent, size_t pos, const wxString& text, int image, int selImage, wxTreeItemData *data) = 0; // and this function implements overloaded InsertItem() taking wxTreeItemId // (it can't be called InsertItem() as we'd have virtual function hiding // problem in derived classes then) virtual wxTreeItemId DoInsertAfter(const wxTreeItemId& parent, const wxTreeItemId& idPrevious, const wxString& text, int image = -1, int selImage = -1, wxTreeItemData *data = NULL) = 0; // real HitTest() implementation: again, can't be called just HitTest() // because it's overloaded and so the non-virtual overload would be hidden // (and can't be called DoHitTest() because this is already in wxWindow) virtual wxTreeItemId DoTreeHitTest(const wxPoint& point, int& flags) const = 0; wxImageList *m_imageListNormal, // images for tree elements *m_imageListState; // special images for app defined states bool m_ownsImageListNormal, m_ownsImageListState; // spacing between left border and the text unsigned int m_spacing; // whether full or quick calculation is done in DoGetBestSize bool m_quickBestSize; private: // Intercept Escape and Return keys to ensure that our in-place edit // control always gets them before they're used for dialog navigation or // anything else. void OnCharHook(wxKeyEvent& event); wxDECLARE_NO_COPY_CLASS(wxTreeCtrlBase); }; // ---------------------------------------------------------------------------- // include the platform-dependent wxTreeCtrl class // ---------------------------------------------------------------------------- #ifdef wxHAS_GENERIC_TREECTRL #include "wx/generic/treectlg.h" #elif defined(__WXMSW__) #include "wx/msw/treectrl.h" #else #error "unknown native wxTreeCtrl implementation" #endif #endif // wxUSE_TREECTRL #endif // _WX_TREECTRL_H_BASE_
h
rticonnextdds-usecases
data/projects/rticonnextdds-usecases/VehicleTracking/ExampleCode/thirdparty/wxWidgets-3.1.2/Linux/include/wx/textctrl.h
/////////////////////////////////////////////////////////////////////////////// // Name: wx/textctrl.h // Purpose: wxTextAttr and wxTextCtrlBase class - the interface of wxTextCtrl // Author: Vadim Zeitlin // Modified by: // Created: 13.07.99 // Copyright: (c) Vadim Zeitlin // Licence: wxWindows licence /////////////////////////////////////////////////////////////////////////////// #ifndef _WX_TEXTCTRL_H_BASE_ #define _WX_TEXTCTRL_H_BASE_ // ---------------------------------------------------------------------------- // headers // ---------------------------------------------------------------------------- #include "wx/defs.h" #if wxUSE_TEXTCTRL #include "wx/control.h" // the base class #include "wx/textentry.h" // single-line text entry interface #include "wx/dynarray.h" // wxArrayInt #include "wx/gdicmn.h" // wxPoint #if wxUSE_STD_IOSTREAM #include "wx/ioswrap.h" #define wxHAS_TEXT_WINDOW_STREAM 1 #else #define wxHAS_TEXT_WINDOW_STREAM 0 #endif class WXDLLIMPEXP_FWD_CORE wxTextCtrl; class WXDLLIMPEXP_FWD_CORE wxTextCtrlBase; // ---------------------------------------------------------------------------- // wxTextCtrl types // ---------------------------------------------------------------------------- // wxTextCoord is the line or row number (which should have been unsigned but // is long for backwards compatibility) typedef long wxTextCoord; // ---------------------------------------------------------------------------- // constants // ---------------------------------------------------------------------------- extern WXDLLIMPEXP_DATA_CORE(const char) wxTextCtrlNameStr[]; // this is intentionally not enum to avoid warning fixes with // typecasting from enum type to wxTextCoord const wxTextCoord wxOutOfRangeTextCoord = -1; const wxTextCoord wxInvalidTextCoord = -2; // ---------------------------------------------------------------------------- // wxTextCtrl style flags // ---------------------------------------------------------------------------- #define wxTE_NO_VSCROLL 0x0002 #define wxTE_READONLY 0x0010 #define wxTE_MULTILINE 0x0020 #define wxTE_PROCESS_TAB 0x0040 // alignment flags #define wxTE_LEFT 0x0000 // 0x0000 #define wxTE_CENTER wxALIGN_CENTER_HORIZONTAL // 0x0100 #define wxTE_RIGHT wxALIGN_RIGHT // 0x0200 #define wxTE_CENTRE wxTE_CENTER // this style means to use RICHEDIT control and does something only under wxMSW // and Win32 and is silently ignored under all other platforms #define wxTE_RICH 0x0080 #define wxTE_PROCESS_ENTER 0x0400 #define wxTE_PASSWORD 0x0800 // automatically detect the URLs and generate the events when mouse is // moved/clicked over an URL // // this is for Win32 richedit and wxGTK2 multiline controls only so far #define wxTE_AUTO_URL 0x1000 // by default, the Windows text control doesn't show the selection when it // doesn't have focus - use this style to force it to always show it #define wxTE_NOHIDESEL 0x2000 // use wxHSCROLL to not wrap text at all, wxTE_CHARWRAP to wrap it at any // position and wxTE_WORDWRAP to wrap at words boundary // // if no wrapping style is given at all, the control wraps at word boundary #define wxTE_DONTWRAP wxHSCROLL #define wxTE_CHARWRAP 0x4000 // wrap at any position #define wxTE_WORDWRAP 0x0001 // wrap only at words boundaries #define wxTE_BESTWRAP 0x0000 // this is the default #if WXWIN_COMPATIBILITY_2_8 // this style is (or at least should be) on by default now, don't use it #define wxTE_AUTO_SCROLL 0 #endif // WXWIN_COMPATIBILITY_2_8 // force using RichEdit version 2.0 or 3.0 instead of 1.0 (default) for // wxTE_RICH controls - can be used together with or instead of wxTE_RICH #define wxTE_RICH2 0x8000 #if defined(__WXOSX_IPHONE__) #define wxTE_CAPITALIZE wxTE_RICH2 #else #define wxTE_CAPITALIZE 0 #endif // ---------------------------------------------------------------------------- // wxTextCtrl file types // ---------------------------------------------------------------------------- #define wxTEXT_TYPE_ANY 0 // ---------------------------------------------------------------------------- // wxTextCtrl::HitTest return values // ---------------------------------------------------------------------------- // the point asked is ... enum wxTextCtrlHitTestResult { wxTE_HT_UNKNOWN = -2, // this means HitTest() is simply not implemented wxTE_HT_BEFORE, // either to the left or upper wxTE_HT_ON_TEXT, // directly on wxTE_HT_BELOW, // below [the last line] wxTE_HT_BEYOND // after [the end of line] }; // ... the character returned // ---------------------------------------------------------------------------- // Types for wxTextAttr // ---------------------------------------------------------------------------- // Alignment enum wxTextAttrAlignment { wxTEXT_ALIGNMENT_DEFAULT, wxTEXT_ALIGNMENT_LEFT, wxTEXT_ALIGNMENT_CENTRE, wxTEXT_ALIGNMENT_CENTER = wxTEXT_ALIGNMENT_CENTRE, wxTEXT_ALIGNMENT_RIGHT, wxTEXT_ALIGNMENT_JUSTIFIED }; // Flags to indicate which attributes are being applied enum wxTextAttrFlags { wxTEXT_ATTR_TEXT_COLOUR = 0x00000001, wxTEXT_ATTR_BACKGROUND_COLOUR = 0x00000002, wxTEXT_ATTR_FONT_FACE = 0x00000004, wxTEXT_ATTR_FONT_POINT_SIZE = 0x00000008, wxTEXT_ATTR_FONT_PIXEL_SIZE = 0x10000000, wxTEXT_ATTR_FONT_WEIGHT = 0x00000010, wxTEXT_ATTR_FONT_ITALIC = 0x00000020, wxTEXT_ATTR_FONT_UNDERLINE = 0x00000040, wxTEXT_ATTR_FONT_STRIKETHROUGH = 0x08000000, wxTEXT_ATTR_FONT_ENCODING = 0x02000000, wxTEXT_ATTR_FONT_FAMILY = 0x04000000, wxTEXT_ATTR_FONT_SIZE = \ ( wxTEXT_ATTR_FONT_POINT_SIZE | wxTEXT_ATTR_FONT_PIXEL_SIZE ), wxTEXT_ATTR_FONT = \ ( wxTEXT_ATTR_FONT_FACE | wxTEXT_ATTR_FONT_SIZE | wxTEXT_ATTR_FONT_WEIGHT | \ wxTEXT_ATTR_FONT_ITALIC | wxTEXT_ATTR_FONT_UNDERLINE | wxTEXT_ATTR_FONT_STRIKETHROUGH | wxTEXT_ATTR_FONT_ENCODING | wxTEXT_ATTR_FONT_FAMILY ), wxTEXT_ATTR_ALIGNMENT = 0x00000080, wxTEXT_ATTR_LEFT_INDENT = 0x00000100, wxTEXT_ATTR_RIGHT_INDENT = 0x00000200, wxTEXT_ATTR_TABS = 0x00000400, wxTEXT_ATTR_PARA_SPACING_AFTER = 0x00000800, wxTEXT_ATTR_PARA_SPACING_BEFORE = 0x00001000, wxTEXT_ATTR_LINE_SPACING = 0x00002000, wxTEXT_ATTR_CHARACTER_STYLE_NAME = 0x00004000, wxTEXT_ATTR_PARAGRAPH_STYLE_NAME = 0x00008000, wxTEXT_ATTR_LIST_STYLE_NAME = 0x00010000, wxTEXT_ATTR_BULLET_STYLE = 0x00020000, wxTEXT_ATTR_BULLET_NUMBER = 0x00040000, wxTEXT_ATTR_BULLET_TEXT = 0x00080000, wxTEXT_ATTR_BULLET_NAME = 0x00100000, wxTEXT_ATTR_BULLET = \ ( wxTEXT_ATTR_BULLET_STYLE | wxTEXT_ATTR_BULLET_NUMBER | wxTEXT_ATTR_BULLET_TEXT | \ wxTEXT_ATTR_BULLET_NAME ), wxTEXT_ATTR_URL = 0x00200000, wxTEXT_ATTR_PAGE_BREAK = 0x00400000, wxTEXT_ATTR_EFFECTS = 0x00800000, wxTEXT_ATTR_OUTLINE_LEVEL = 0x01000000, wxTEXT_ATTR_AVOID_PAGE_BREAK_BEFORE = 0x20000000, wxTEXT_ATTR_AVOID_PAGE_BREAK_AFTER = 0x40000000, /*! * Character and paragraph combined styles */ wxTEXT_ATTR_CHARACTER = \ (wxTEXT_ATTR_FONT|wxTEXT_ATTR_EFFECTS| \ wxTEXT_ATTR_BACKGROUND_COLOUR|wxTEXT_ATTR_TEXT_COLOUR|wxTEXT_ATTR_CHARACTER_STYLE_NAME|wxTEXT_ATTR_URL), wxTEXT_ATTR_PARAGRAPH = \ (wxTEXT_ATTR_ALIGNMENT|wxTEXT_ATTR_LEFT_INDENT|wxTEXT_ATTR_RIGHT_INDENT|wxTEXT_ATTR_TABS|\ wxTEXT_ATTR_PARA_SPACING_BEFORE|wxTEXT_ATTR_PARA_SPACING_AFTER|wxTEXT_ATTR_LINE_SPACING|\ wxTEXT_ATTR_BULLET|wxTEXT_ATTR_PARAGRAPH_STYLE_NAME|wxTEXT_ATTR_LIST_STYLE_NAME|wxTEXT_ATTR_OUTLINE_LEVEL|\ wxTEXT_ATTR_PAGE_BREAK|wxTEXT_ATTR_AVOID_PAGE_BREAK_BEFORE|wxTEXT_ATTR_AVOID_PAGE_BREAK_AFTER), wxTEXT_ATTR_ALL = (wxTEXT_ATTR_CHARACTER|wxTEXT_ATTR_PARAGRAPH) }; /*! * Styles for wxTextAttr::SetBulletStyle */ enum wxTextAttrBulletStyle { wxTEXT_ATTR_BULLET_STYLE_NONE = 0x00000000, wxTEXT_ATTR_BULLET_STYLE_ARABIC = 0x00000001, wxTEXT_ATTR_BULLET_STYLE_LETTERS_UPPER = 0x00000002, wxTEXT_ATTR_BULLET_STYLE_LETTERS_LOWER = 0x00000004, wxTEXT_ATTR_BULLET_STYLE_ROMAN_UPPER = 0x00000008, wxTEXT_ATTR_BULLET_STYLE_ROMAN_LOWER = 0x00000010, wxTEXT_ATTR_BULLET_STYLE_SYMBOL = 0x00000020, wxTEXT_ATTR_BULLET_STYLE_BITMAP = 0x00000040, wxTEXT_ATTR_BULLET_STYLE_PARENTHESES = 0x00000080, wxTEXT_ATTR_BULLET_STYLE_PERIOD = 0x00000100, wxTEXT_ATTR_BULLET_STYLE_STANDARD = 0x00000200, wxTEXT_ATTR_BULLET_STYLE_RIGHT_PARENTHESIS = 0x00000400, wxTEXT_ATTR_BULLET_STYLE_OUTLINE = 0x00000800, wxTEXT_ATTR_BULLET_STYLE_ALIGN_LEFT = 0x00000000, wxTEXT_ATTR_BULLET_STYLE_ALIGN_RIGHT = 0x00001000, wxTEXT_ATTR_BULLET_STYLE_ALIGN_CENTRE = 0x00002000, wxTEXT_ATTR_BULLET_STYLE_CONTINUATION = 0x00004000 }; /*! * Styles for wxTextAttr::SetTextEffects */ enum wxTextAttrEffects { wxTEXT_ATTR_EFFECT_NONE = 0x00000000, wxTEXT_ATTR_EFFECT_CAPITALS = 0x00000001, wxTEXT_ATTR_EFFECT_SMALL_CAPITALS = 0x00000002, wxTEXT_ATTR_EFFECT_STRIKETHROUGH = 0x00000004, wxTEXT_ATTR_EFFECT_DOUBLE_STRIKETHROUGH = 0x00000008, wxTEXT_ATTR_EFFECT_SHADOW = 0x00000010, wxTEXT_ATTR_EFFECT_EMBOSS = 0x00000020, wxTEXT_ATTR_EFFECT_OUTLINE = 0x00000040, wxTEXT_ATTR_EFFECT_ENGRAVE = 0x00000080, wxTEXT_ATTR_EFFECT_SUPERSCRIPT = 0x00000100, wxTEXT_ATTR_EFFECT_SUBSCRIPT = 0x00000200, wxTEXT_ATTR_EFFECT_RTL = 0x00000400, wxTEXT_ATTR_EFFECT_SUPPRESS_HYPHENATION = 0x00001000 }; /*! * Line spacing values */ enum wxTextAttrLineSpacing { wxTEXT_ATTR_LINE_SPACING_NORMAL = 10, wxTEXT_ATTR_LINE_SPACING_HALF = 15, wxTEXT_ATTR_LINE_SPACING_TWICE = 20 }; // ---------------------------------------------------------------------------- // wxTextAttr: a structure containing the visual attributes of a text // ---------------------------------------------------------------------------- class WXDLLIMPEXP_CORE wxTextAttr { public: // ctors wxTextAttr() { Init(); } wxTextAttr(const wxTextAttr& attr) { Init(); Copy(attr); } wxTextAttr(const wxColour& colText, const wxColour& colBack = wxNullColour, const wxFont& font = wxNullFont, wxTextAttrAlignment alignment = wxTEXT_ALIGNMENT_DEFAULT); // Initialise this object. void Init(); // Copy void Copy(const wxTextAttr& attr); // Assignment void operator= (const wxTextAttr& attr); // Equality test bool operator== (const wxTextAttr& attr) const; // Partial equality test. If @a weakTest is @true, attributes of this object do not // have to be present if those attributes of @a attr are present. If @a weakTest is // @false, the function will fail if an attribute is present in @a attr but not // in this object. bool EqPartial(const wxTextAttr& attr, bool weakTest = true) const; // Get attributes from font. bool GetFontAttributes(const wxFont& font, int flags = wxTEXT_ATTR_FONT); // setters void SetTextColour(const wxColour& colText) { m_colText = colText; m_flags |= wxTEXT_ATTR_TEXT_COLOUR; } void SetBackgroundColour(const wxColour& colBack) { m_colBack = colBack; m_flags |= wxTEXT_ATTR_BACKGROUND_COLOUR; } void SetAlignment(wxTextAttrAlignment alignment) { m_textAlignment = alignment; m_flags |= wxTEXT_ATTR_ALIGNMENT; } void SetTabs(const wxArrayInt& tabs) { m_tabs = tabs; m_flags |= wxTEXT_ATTR_TABS; } void SetLeftIndent(int indent, int subIndent = 0) { m_leftIndent = indent; m_leftSubIndent = subIndent; m_flags |= wxTEXT_ATTR_LEFT_INDENT; } void SetRightIndent(int indent) { m_rightIndent = indent; m_flags |= wxTEXT_ATTR_RIGHT_INDENT; } void SetFontSize(int pointSize) { m_fontSize = pointSize; m_flags &= ~wxTEXT_ATTR_FONT_SIZE; m_flags |= wxTEXT_ATTR_FONT_POINT_SIZE; } void SetFontPointSize(int pointSize) { m_fontSize = pointSize; m_flags &= ~wxTEXT_ATTR_FONT_SIZE; m_flags |= wxTEXT_ATTR_FONT_POINT_SIZE; } void SetFontPixelSize(int pixelSize) { m_fontSize = pixelSize; m_flags &= ~wxTEXT_ATTR_FONT_SIZE; m_flags |= wxTEXT_ATTR_FONT_PIXEL_SIZE; } void SetFontStyle(wxFontStyle fontStyle) { m_fontStyle = fontStyle; m_flags |= wxTEXT_ATTR_FONT_ITALIC; } void SetFontWeight(wxFontWeight fontWeight) { m_fontWeight = fontWeight; m_flags |= wxTEXT_ATTR_FONT_WEIGHT; } void SetFontFaceName(const wxString& faceName) { m_fontFaceName = faceName; m_flags |= wxTEXT_ATTR_FONT_FACE; } void SetFontUnderlined(bool underlined) { m_fontUnderlined = underlined; m_flags |= wxTEXT_ATTR_FONT_UNDERLINE; } void SetFontStrikethrough(bool strikethrough) { m_fontStrikethrough = strikethrough; m_flags |= wxTEXT_ATTR_FONT_STRIKETHROUGH; } void SetFontEncoding(wxFontEncoding encoding) { m_fontEncoding = encoding; m_flags |= wxTEXT_ATTR_FONT_ENCODING; } void SetFontFamily(wxFontFamily family) { m_fontFamily = family; m_flags |= wxTEXT_ATTR_FONT_FAMILY; } // Set font void SetFont(const wxFont& font, int flags = (wxTEXT_ATTR_FONT & ~wxTEXT_ATTR_FONT_PIXEL_SIZE)) { GetFontAttributes(font, flags); } void SetFlags(long flags) { m_flags = flags; } void SetCharacterStyleName(const wxString& name) { m_characterStyleName = name; m_flags |= wxTEXT_ATTR_CHARACTER_STYLE_NAME; } void SetParagraphStyleName(const wxString& name) { m_paragraphStyleName = name; m_flags |= wxTEXT_ATTR_PARAGRAPH_STYLE_NAME; } void SetListStyleName(const wxString& name) { m_listStyleName = name; SetFlags(GetFlags() | wxTEXT_ATTR_LIST_STYLE_NAME); } void SetParagraphSpacingAfter(int spacing) { m_paragraphSpacingAfter = spacing; m_flags |= wxTEXT_ATTR_PARA_SPACING_AFTER; } void SetParagraphSpacingBefore(int spacing) { m_paragraphSpacingBefore = spacing; m_flags |= wxTEXT_ATTR_PARA_SPACING_BEFORE; } void SetLineSpacing(int spacing) { m_lineSpacing = spacing; m_flags |= wxTEXT_ATTR_LINE_SPACING; } void SetBulletStyle(int style) { m_bulletStyle = style; m_flags |= wxTEXT_ATTR_BULLET_STYLE; } void SetBulletNumber(int n) { m_bulletNumber = n; m_flags |= wxTEXT_ATTR_BULLET_NUMBER; } void SetBulletText(const wxString& text) { m_bulletText = text; m_flags |= wxTEXT_ATTR_BULLET_TEXT; } void SetBulletFont(const wxString& bulletFont) { m_bulletFont = bulletFont; } void SetBulletName(const wxString& name) { m_bulletName = name; m_flags |= wxTEXT_ATTR_BULLET_NAME; } void SetURL(const wxString& url) { m_urlTarget = url; m_flags |= wxTEXT_ATTR_URL; } void SetPageBreak(bool pageBreak = true) { SetFlags(pageBreak ? (GetFlags() | wxTEXT_ATTR_PAGE_BREAK) : (GetFlags() & ~wxTEXT_ATTR_PAGE_BREAK)); } void SetTextEffects(int effects) { m_textEffects = effects; SetFlags(GetFlags() | wxTEXT_ATTR_EFFECTS); } void SetTextEffectFlags(int effects) { m_textEffectFlags = effects; } void SetOutlineLevel(int level) { m_outlineLevel = level; SetFlags(GetFlags() | wxTEXT_ATTR_OUTLINE_LEVEL); } const wxColour& GetTextColour() const { return m_colText; } const wxColour& GetBackgroundColour() const { return m_colBack; } wxTextAttrAlignment GetAlignment() const { return m_textAlignment; } const wxArrayInt& GetTabs() const { return m_tabs; } long GetLeftIndent() const { return m_leftIndent; } long GetLeftSubIndent() const { return m_leftSubIndent; } long GetRightIndent() const { return m_rightIndent; } long GetFlags() const { return m_flags; } int GetFontSize() const { return m_fontSize; } wxFontStyle GetFontStyle() const { return m_fontStyle; } wxFontWeight GetFontWeight() const { return m_fontWeight; } bool GetFontUnderlined() const { return m_fontUnderlined; } bool GetFontStrikethrough() const { return m_fontStrikethrough; } const wxString& GetFontFaceName() const { return m_fontFaceName; } wxFontEncoding GetFontEncoding() const { return m_fontEncoding; } wxFontFamily GetFontFamily() const { return m_fontFamily; } wxFont GetFont() const; const wxString& GetCharacterStyleName() const { return m_characterStyleName; } const wxString& GetParagraphStyleName() const { return m_paragraphStyleName; } const wxString& GetListStyleName() const { return m_listStyleName; } int GetParagraphSpacingAfter() const { return m_paragraphSpacingAfter; } int GetParagraphSpacingBefore() const { return m_paragraphSpacingBefore; } int GetLineSpacing() const { return m_lineSpacing; } int GetBulletStyle() const { return m_bulletStyle; } int GetBulletNumber() const { return m_bulletNumber; } const wxString& GetBulletText() const { return m_bulletText; } const wxString& GetBulletFont() const { return m_bulletFont; } const wxString& GetBulletName() const { return m_bulletName; } const wxString& GetURL() const { return m_urlTarget; } int GetTextEffects() const { return m_textEffects; } int GetTextEffectFlags() const { return m_textEffectFlags; } int GetOutlineLevel() const { return m_outlineLevel; } // accessors bool HasTextColour() const { return m_colText.IsOk() && HasFlag(wxTEXT_ATTR_TEXT_COLOUR) ; } bool HasBackgroundColour() const { return m_colBack.IsOk() && HasFlag(wxTEXT_ATTR_BACKGROUND_COLOUR) ; } bool HasAlignment() const { return (m_textAlignment != wxTEXT_ALIGNMENT_DEFAULT) && HasFlag(wxTEXT_ATTR_ALIGNMENT) ; } bool HasTabs() const { return HasFlag(wxTEXT_ATTR_TABS) ; } bool HasLeftIndent() const { return HasFlag(wxTEXT_ATTR_LEFT_INDENT); } bool HasRightIndent() const { return HasFlag(wxTEXT_ATTR_RIGHT_INDENT); } bool HasFontWeight() const { return HasFlag(wxTEXT_ATTR_FONT_WEIGHT); } bool HasFontSize() const { return HasFlag(wxTEXT_ATTR_FONT_SIZE); } bool HasFontPointSize() const { return HasFlag(wxTEXT_ATTR_FONT_POINT_SIZE); } bool HasFontPixelSize() const { return HasFlag(wxTEXT_ATTR_FONT_PIXEL_SIZE); } bool HasFontItalic() const { return HasFlag(wxTEXT_ATTR_FONT_ITALIC); } bool HasFontUnderlined() const { return HasFlag(wxTEXT_ATTR_FONT_UNDERLINE); } bool HasFontStrikethrough() const { return HasFlag(wxTEXT_ATTR_FONT_STRIKETHROUGH); } bool HasFontFaceName() const { return HasFlag(wxTEXT_ATTR_FONT_FACE); } bool HasFontEncoding() const { return HasFlag(wxTEXT_ATTR_FONT_ENCODING); } bool HasFontFamily() const { return HasFlag(wxTEXT_ATTR_FONT_FAMILY); } bool HasFont() const { return HasFlag(wxTEXT_ATTR_FONT); } bool HasParagraphSpacingAfter() const { return HasFlag(wxTEXT_ATTR_PARA_SPACING_AFTER); } bool HasParagraphSpacingBefore() const { return HasFlag(wxTEXT_ATTR_PARA_SPACING_BEFORE); } bool HasLineSpacing() const { return HasFlag(wxTEXT_ATTR_LINE_SPACING); } bool HasCharacterStyleName() const { return HasFlag(wxTEXT_ATTR_CHARACTER_STYLE_NAME) && !m_characterStyleName.IsEmpty(); } bool HasParagraphStyleName() const { return HasFlag(wxTEXT_ATTR_PARAGRAPH_STYLE_NAME) && !m_paragraphStyleName.IsEmpty(); } bool HasListStyleName() const { return HasFlag(wxTEXT_ATTR_LIST_STYLE_NAME) || !m_listStyleName.IsEmpty(); } bool HasBulletStyle() const { return HasFlag(wxTEXT_ATTR_BULLET_STYLE); } bool HasBulletNumber() const { return HasFlag(wxTEXT_ATTR_BULLET_NUMBER); } bool HasBulletText() const { return HasFlag(wxTEXT_ATTR_BULLET_TEXT); } bool HasBulletName() const { return HasFlag(wxTEXT_ATTR_BULLET_NAME); } bool HasURL() const { return HasFlag(wxTEXT_ATTR_URL); } bool HasPageBreak() const { return HasFlag(wxTEXT_ATTR_PAGE_BREAK); } bool HasTextEffects() const { return HasFlag(wxTEXT_ATTR_EFFECTS); } bool HasTextEffect(int effect) const { return HasFlag(wxTEXT_ATTR_EFFECTS) && ((GetTextEffectFlags() & effect) != 0); } bool HasOutlineLevel() const { return HasFlag(wxTEXT_ATTR_OUTLINE_LEVEL); } bool HasFlag(long flag) const { return (m_flags & flag) != 0; } void RemoveFlag(long flag) { m_flags &= ~flag; } void AddFlag(long flag) { m_flags |= flag; } // Is this a character style? bool IsCharacterStyle() const { return HasFlag(wxTEXT_ATTR_CHARACTER); } bool IsParagraphStyle() const { return HasFlag(wxTEXT_ATTR_PARAGRAPH); } // returns false if we have any attributes set, true otherwise bool IsDefault() const { return GetFlags() == 0; } // Merges the given attributes. If compareWith // is non-NULL, then it will be used to mask out those attributes that are the same in style // and compareWith, for situations where we don't want to explicitly set inherited attributes. bool Apply(const wxTextAttr& style, const wxTextAttr* compareWith = NULL); // merges the attributes of the base and the overlay objects and returns // the result; the parameter attributes take precedence // // WARNING: the order of arguments is the opposite of Combine() static wxTextAttr Merge(const wxTextAttr& base, const wxTextAttr& overlay) { return Combine(overlay, base, NULL); } // merges the attributes of this object and overlay void Merge(const wxTextAttr& overlay) { *this = Merge(*this, overlay); } // return the attribute having the valid font and colours: it uses the // attributes set in attr and falls back first to attrDefault and then to // the text control font/colours for those attributes which are not set static wxTextAttr Combine(const wxTextAttr& attr, const wxTextAttr& attrDef, const wxTextCtrlBase *text); // Compare tabs static bool TabsEq(const wxArrayInt& tabs1, const wxArrayInt& tabs2); // Remove attributes static bool RemoveStyle(wxTextAttr& destStyle, const wxTextAttr& style); // Combine two bitlists, specifying the bits of interest with separate flags. static bool CombineBitlists(int& valueA, int valueB, int& flagsA, int flagsB); // Compare two bitlists static bool BitlistsEqPartial(int valueA, int valueB, int flags); // Split into paragraph and character styles static bool SplitParaCharStyles(const wxTextAttr& style, wxTextAttr& parStyle, wxTextAttr& charStyle); private: long m_flags; // Paragraph styles wxArrayInt m_tabs; // array of int: tab stops in 1/10 mm int m_leftIndent; // left indent in 1/10 mm int m_leftSubIndent; // left indent for all but the first // line in a paragraph relative to the // first line, in 1/10 mm int m_rightIndent; // right indent in 1/10 mm wxTextAttrAlignment m_textAlignment; int m_paragraphSpacingAfter; int m_paragraphSpacingBefore; int m_lineSpacing; int m_bulletStyle; int m_bulletNumber; int m_textEffects; int m_textEffectFlags; int m_outlineLevel; wxString m_bulletText; wxString m_bulletFont; wxString m_bulletName; wxString m_urlTarget; wxFontEncoding m_fontEncoding; // Character styles wxColour m_colText, m_colBack; int m_fontSize; wxFontStyle m_fontStyle; wxFontWeight m_fontWeight; wxFontFamily m_fontFamily; bool m_fontUnderlined; bool m_fontStrikethrough; wxString m_fontFaceName; // Character style wxString m_characterStyleName; // Paragraph style wxString m_paragraphStyleName; // List style wxString m_listStyleName; }; // ---------------------------------------------------------------------------- // wxTextAreaBase: multiline text control specific methods // ---------------------------------------------------------------------------- class WXDLLIMPEXP_CORE wxTextAreaBase { public: wxTextAreaBase() { } virtual ~wxTextAreaBase() { } // lines access // ------------ virtual int GetLineLength(long lineNo) const = 0; virtual wxString GetLineText(long lineNo) const = 0; virtual int GetNumberOfLines() const = 0; // file IO // ------- bool LoadFile(const wxString& file, int fileType = wxTEXT_TYPE_ANY) { return DoLoadFile(file, fileType); } bool SaveFile(const wxString& file = wxEmptyString, int fileType = wxTEXT_TYPE_ANY); // dirty flag handling // ------------------- virtual bool IsModified() const = 0; virtual void MarkDirty() = 0; virtual void DiscardEdits() = 0; void SetModified(bool modified) { if ( modified ) MarkDirty(); else DiscardEdits(); } // styles handling // --------------- // text control under some platforms supports the text styles: these // methods allow to apply the given text style to the given selection or to // set/get the style which will be used for all appended text virtual bool SetStyle(long start, long end, const wxTextAttr& style) = 0; virtual bool GetStyle(long position, wxTextAttr& style) = 0; virtual bool SetDefaultStyle(const wxTextAttr& style) = 0; virtual const wxTextAttr& GetDefaultStyle() const { return m_defaultStyle; } // coordinates translation // ----------------------- // translate between the position (which is just an index in the text ctrl // considering all its contents as a single strings) and (x, y) coordinates // which represent column and line. virtual long XYToPosition(long x, long y) const = 0; virtual bool PositionToXY(long pos, long *x, long *y) const = 0; // translate the given position (which is just an index in the text control) // to client coordinates wxPoint PositionToCoords(long pos) const; virtual void ShowPosition(long pos) = 0; // find the character at position given in pixels // // NB: pt is in device coords (not adjusted for the client area origin nor // scrolling) virtual wxTextCtrlHitTestResult HitTest(const wxPoint& pt, long *pos) const; virtual wxTextCtrlHitTestResult HitTest(const wxPoint& pt, wxTextCoord *col, wxTextCoord *row) const; virtual wxString GetValue() const = 0; virtual void SetValue(const wxString& value) = 0; protected: // implementation of loading/saving virtual bool DoLoadFile(const wxString& file, int fileType); virtual bool DoSaveFile(const wxString& file, int fileType); // Return true if the given position is valid, i.e. positive and less than // the last position. virtual bool IsValidPosition(long pos) const = 0; // Default stub implementation of PositionToCoords() always returns // wxDefaultPosition. virtual wxPoint DoPositionToCoords(long pos) const; // the name of the last file loaded with LoadFile() which will be used by // SaveFile() by default wxString m_filename; // the text style which will be used for any new text added to the control wxTextAttr m_defaultStyle; wxDECLARE_NO_COPY_CLASS(wxTextAreaBase); }; // this class defines wxTextCtrl interface, wxTextCtrlBase actually implements // too much things because it derives from wxTextEntry and not wxTextEntryBase // and so any classes which "look like" wxTextCtrl (such as wxRichTextCtrl) // but don't need the (native) implementation bits from wxTextEntry should // actually derive from this one and not wxTextCtrlBase class WXDLLIMPEXP_CORE wxTextCtrlIface : public wxTextAreaBase, public wxTextEntryBase { public: wxTextCtrlIface() { } // wxTextAreaBase overrides virtual wxString GetValue() const wxOVERRIDE { return wxTextEntryBase::GetValue(); } virtual void SetValue(const wxString& value) wxOVERRIDE { wxTextEntryBase::SetValue(value); } protected: virtual bool IsValidPosition(long pos) const wxOVERRIDE { return pos >= 0 && pos <= GetLastPosition(); } private: wxDECLARE_NO_COPY_CLASS(wxTextCtrlIface); }; // ---------------------------------------------------------------------------- // wxTextCtrl: a single or multiple line text zone where user can edit text // ---------------------------------------------------------------------------- class WXDLLIMPEXP_CORE wxTextCtrlBase : public wxControl, #if wxHAS_TEXT_WINDOW_STREAM public wxSTD streambuf, #endif public wxTextAreaBase, public wxTextEntry { public: // creation // -------- wxTextCtrlBase() { } virtual ~wxTextCtrlBase() { } // more readable flag testing methods bool IsSingleLine() const { return !HasFlag(wxTE_MULTILINE); } bool IsMultiLine() const { return !IsSingleLine(); } // stream-like insertion operators: these are always available, whether we // were, or not, compiled with streambuf support wxTextCtrl& operator<<(const wxString& s); wxTextCtrl& operator<<(int i); wxTextCtrl& operator<<(long i); wxTextCtrl& operator<<(float f) { return *this << double(f); } wxTextCtrl& operator<<(double d); wxTextCtrl& operator<<(char c) { return *this << wxString(c); } wxTextCtrl& operator<<(wchar_t c) { return *this << wxString(c); } // insert the character which would have resulted from this key event, // return true if anything has been inserted virtual bool EmulateKeyPress(const wxKeyEvent& event); // do the window-specific processing after processing the update event virtual void DoUpdateWindowUI(wxUpdateUIEvent& event) wxOVERRIDE; virtual bool ShouldInheritColours() const wxOVERRIDE { return false; } // work around the problem with having HitTest() both in wxControl and // wxTextAreaBase base classes virtual wxTextCtrlHitTestResult HitTest(const wxPoint& pt, long *pos) const wxOVERRIDE { return wxTextAreaBase::HitTest(pt, pos); } virtual wxTextCtrlHitTestResult HitTest(const wxPoint& pt, wxTextCoord *col, wxTextCoord *row) const wxOVERRIDE { return wxTextAreaBase::HitTest(pt, col, row); } // we provide stubs for these functions as not all platforms have styles // support, but we really should leave them pure virtual here virtual bool SetStyle(long start, long end, const wxTextAttr& style) wxOVERRIDE; virtual bool GetStyle(long position, wxTextAttr& style) wxOVERRIDE; virtual bool SetDefaultStyle(const wxTextAttr& style) wxOVERRIDE; // wxTextAreaBase overrides virtual wxString GetValue() const wxOVERRIDE { return wxTextEntry::GetValue(); } virtual void SetValue(const wxString& value) wxOVERRIDE { wxTextEntry::SetValue(value); } // wxWindow overrides virtual wxVisualAttributes GetDefaultAttributes() const wxOVERRIDE { return GetClassDefaultAttributes(GetWindowVariant()); } static wxVisualAttributes GetClassDefaultAttributes(wxWindowVariant variant = wxWINDOW_VARIANT_NORMAL) { return GetCompositeControlsDefaultAttributes(variant); } protected: // Override wxEvtHandler method to check for a common problem of binding // wxEVT_TEXT_ENTER to a control without wxTE_PROCESS_ENTER style, which is // never going to work. virtual bool OnDynamicBind(wxDynamicEventTableEntry& entry) wxOVERRIDE; // override streambuf method #if wxHAS_TEXT_WINDOW_STREAM int overflow(int i) wxOVERRIDE; #endif // wxHAS_TEXT_WINDOW_STREAM // Another wxTextAreaBase override. virtual bool IsValidPosition(long pos) const wxOVERRIDE { return pos >= 0 && pos <= GetLastPosition(); } // implement the wxTextEntry pure virtual method virtual wxWindow *GetEditableWindow() wxOVERRIDE { return this; } wxDECLARE_NO_COPY_CLASS(wxTextCtrlBase); wxDECLARE_ABSTRACT_CLASS(wxTextCtrlBase); }; // ---------------------------------------------------------------------------- // include the platform-dependent class definition // ---------------------------------------------------------------------------- #if defined(__WXX11__) #include "wx/x11/textctrl.h" #elif defined(__WXUNIVERSAL__) #include "wx/univ/textctrl.h" #elif defined(__WXMSW__) #include "wx/msw/textctrl.h" #elif defined(__WXMOTIF__) #include "wx/motif/textctrl.h" #elif defined(__WXGTK20__) #include "wx/gtk/textctrl.h" #elif defined(__WXGTK__) #include "wx/gtk1/textctrl.h" #elif defined(__WXMAC__) #include "wx/osx/textctrl.h" #elif defined(__WXQT__) #include "wx/qt/textctrl.h" #endif // ---------------------------------------------------------------------------- // wxTextCtrl events // ---------------------------------------------------------------------------- class WXDLLIMPEXP_FWD_CORE wxTextUrlEvent; wxDECLARE_EXPORTED_EVENT(WXDLLIMPEXP_CORE, wxEVT_TEXT, wxCommandEvent); wxDECLARE_EXPORTED_EVENT(WXDLLIMPEXP_CORE, wxEVT_TEXT_ENTER, wxCommandEvent); wxDECLARE_EXPORTED_EVENT(WXDLLIMPEXP_CORE, wxEVT_TEXT_URL, wxTextUrlEvent); wxDECLARE_EXPORTED_EVENT(WXDLLIMPEXP_CORE, wxEVT_TEXT_MAXLEN, wxCommandEvent); class WXDLLIMPEXP_CORE wxTextUrlEvent : public wxCommandEvent { public: wxTextUrlEvent(int winid, const wxMouseEvent& evtMouse, long start, long end) : wxCommandEvent(wxEVT_TEXT_URL, winid), m_evtMouse(evtMouse), m_start(start), m_end(end) { } wxTextUrlEvent(const wxTextUrlEvent& event) : wxCommandEvent(event), m_evtMouse(event.m_evtMouse), m_start(event.m_start), m_end(event.m_end) { } // get the mouse event which happened over the URL const wxMouseEvent& GetMouseEvent() const { return m_evtMouse; } // get the start of the URL long GetURLStart() const { return m_start; } // get the end of the URL long GetURLEnd() const { return m_end; } virtual wxEvent *Clone() const wxOVERRIDE { return new wxTextUrlEvent(*this); } protected: // the corresponding mouse event wxMouseEvent m_evtMouse; // the start and end indices of the URL in the text control long m_start, m_end; private: wxDECLARE_DYNAMIC_CLASS_NO_ASSIGN(wxTextUrlEvent); public: // for wxWin RTTI only, don't use wxTextUrlEvent() : m_evtMouse(), m_start(0), m_end(0) { } }; typedef void (wxEvtHandler::*wxTextUrlEventFunction)(wxTextUrlEvent&); #define wxTextEventHandler(func) wxCommandEventHandler(func) #define wxTextUrlEventHandler(func) \ wxEVENT_HANDLER_CAST(wxTextUrlEventFunction, func) #define wx__DECLARE_TEXTEVT(evt, id, fn) \ wx__DECLARE_EVT1(wxEVT_TEXT_ ## evt, id, wxTextEventHandler(fn)) #define wx__DECLARE_TEXTURLEVT(evt, id, fn) \ wx__DECLARE_EVT1(wxEVT_TEXT_ ## evt, id, wxTextUrlEventHandler(fn)) #define EVT_TEXT(id, fn) wx__DECLARE_EVT1(wxEVT_TEXT, id, wxTextEventHandler(fn)) #define EVT_TEXT_ENTER(id, fn) wx__DECLARE_TEXTEVT(ENTER, id, fn) #define EVT_TEXT_URL(id, fn) wx__DECLARE_TEXTURLEVT(URL, id, fn) #define EVT_TEXT_MAXLEN(id, fn) wx__DECLARE_TEXTEVT(MAXLEN, id, fn) #if wxHAS_TEXT_WINDOW_STREAM // ---------------------------------------------------------------------------- // wxStreamToTextRedirector: this class redirects all data sent to the given // C++ stream to the wxTextCtrl given to its ctor during its lifetime. // ---------------------------------------------------------------------------- class WXDLLIMPEXP_CORE wxStreamToTextRedirector { private: void Init(wxTextCtrl *text) { m_sbufOld = m_ostr.rdbuf(); m_ostr.rdbuf(text); } public: wxStreamToTextRedirector(wxTextCtrl *text) : m_ostr(wxSTD cout) { Init(text); } wxStreamToTextRedirector(wxTextCtrl *text, wxSTD ostream *ostr) : m_ostr(*ostr) { Init(text); } ~wxStreamToTextRedirector() { m_ostr.rdbuf(m_sbufOld); } private: // the stream we're redirecting wxSTD ostream& m_ostr; // the old streambuf (before we changed it) wxSTD streambuf *m_sbufOld; }; #endif // wxHAS_TEXT_WINDOW_STREAM // old wxEVT_COMMAND_* constants #define wxEVT_COMMAND_TEXT_UPDATED wxEVT_TEXT #define wxEVT_COMMAND_TEXT_ENTER wxEVT_TEXT_ENTER #define wxEVT_COMMAND_TEXT_URL wxEVT_TEXT_URL #define wxEVT_COMMAND_TEXT_MAXLEN wxEVT_TEXT_MAXLEN #endif // wxUSE_TEXTCTRL #endif // _WX_TEXTCTRL_H_BASE_
h
rticonnextdds-usecases
data/projects/rticonnextdds-usecases/VehicleTracking/ExampleCode/thirdparty/wxWidgets-3.1.2/Linux/include/wx/rearrangectrl.h
/////////////////////////////////////////////////////////////////////////////// // Name: wx/rearrangectrl.h // Purpose: various controls for rearranging the items interactively // Author: Vadim Zeitlin // Created: 2008-12-15 // Copyright: (c) 2008 Vadim Zeitlin <[email protected]> // Licence: wxWindows licence /////////////////////////////////////////////////////////////////////////////// #ifndef _WX_REARRANGECTRL_H_ #define _WX_REARRANGECTRL_H_ #include "wx/checklst.h" #if wxUSE_REARRANGECTRL #include "wx/panel.h" #include "wx/dialog.h" #include "wx/arrstr.h" extern WXDLLIMPEXP_DATA_CORE(const char) wxRearrangeListNameStr[]; extern WXDLLIMPEXP_DATA_CORE(const char) wxRearrangeDialogNameStr[]; // ---------------------------------------------------------------------------- // wxRearrangeList: a (check) list box allowing to move items around // ---------------------------------------------------------------------------- // This class works allows to change the order of the items shown in it as well // as to check or uncheck them individually. The data structure used to allow // this is the order array which contains the items indices indexed by their // position with an added twist that the unchecked items are represented by the // bitwise complement of the corresponding index (for any architecture using // two's complement for negative numbers representation (i.e. just about any at // all) this means that a checked item N is represented by -N-1 in unchecked // state). // // So, for example, the array order [1 -3 0] used in conjunction with the items // array ["first", "second", "third"] means that the items are displayed in the // order "second", "third", "first" and the "third" item is unchecked while the // other two are checked. class WXDLLIMPEXP_CORE wxRearrangeList : public wxCheckListBox { public: // ctors and such // -------------- // default ctor, call Create() later wxRearrangeList() { } // ctor creating the control, the arguments are the same as for // wxCheckListBox except for the extra order array which defines the // (initial) display order of the items as well as their statuses, see the // description above wxRearrangeList(wxWindow *parent, wxWindowID id, const wxPoint& pos, const wxSize& size, const wxArrayInt& order, const wxArrayString& items, long style = 0, const wxValidator& validator = wxDefaultValidator, const wxString& name = wxRearrangeListNameStr) { Create(parent, id, pos, size, order, items, style, validator, name); } // Create() function takes the same parameters as the base class one and // the order array determining the initial display order bool Create(wxWindow *parent, wxWindowID id, const wxPoint& pos, const wxSize& size, const wxArrayInt& order, const wxArrayString& items, long style = 0, const wxValidator& validator = wxDefaultValidator, const wxString& name = wxRearrangeListNameStr); // items order // ----------- // get the current items order; the returned array uses the same convention // as the one passed to the ctor const wxArrayInt& GetCurrentOrder() const { return m_order; } // return true if the current item can be moved up or down (i.e. just that // it's not the first or the last one) bool CanMoveCurrentUp() const; bool CanMoveCurrentDown() const; // move the current item one position up or down, return true if it was moved // or false if the current item was the first/last one and so nothing was done bool MoveCurrentUp(); bool MoveCurrentDown(); // Override this to keep our m_order array in sync with the real item state. virtual void Check(unsigned int item, bool check = true) wxOVERRIDE; int DoInsertItems(const wxArrayStringsAdapter& items, unsigned int pos, void **clientData, wxClientDataType type) wxOVERRIDE; void DoDeleteOneItem(unsigned int n) wxOVERRIDE; void DoClear() wxOVERRIDE; private: // swap two items at the given positions in the listbox void Swap(int pos1, int pos2); // event handler for item checking/unchecking void OnCheck(wxCommandEvent& event); // the current order array wxArrayInt m_order; wxDECLARE_EVENT_TABLE(); wxDECLARE_NO_COPY_CLASS(wxRearrangeList); }; // ---------------------------------------------------------------------------- // wxRearrangeCtrl: composite control containing a wxRearrangeList and buttons // ---------------------------------------------------------------------------- class WXDLLIMPEXP_CORE wxRearrangeCtrl : public wxPanel { public: // ctors/Create function are the same as for wxRearrangeList wxRearrangeCtrl() { Init(); } wxRearrangeCtrl(wxWindow *parent, wxWindowID id, const wxPoint& pos, const wxSize& size, const wxArrayInt& order, const wxArrayString& items, long style = 0, const wxValidator& validator = wxDefaultValidator, const wxString& name = wxRearrangeListNameStr) { Init(); Create(parent, id, pos, size, order, items, style, validator, name); } bool Create(wxWindow *parent, wxWindowID id, const wxPoint& pos, const wxSize& size, const wxArrayInt& order, const wxArrayString& items, long style = 0, const wxValidator& validator = wxDefaultValidator, const wxString& name = wxRearrangeListNameStr); // get the underlying listbox wxRearrangeList *GetList() const { return m_list; } private: // common part of all ctors void Init(); // event handlers for the buttons void OnUpdateButtonUI(wxUpdateUIEvent& event); void OnButton(wxCommandEvent& event); wxRearrangeList *m_list; wxDECLARE_EVENT_TABLE(); wxDECLARE_NO_COPY_CLASS(wxRearrangeCtrl); }; // ---------------------------------------------------------------------------- // wxRearrangeDialog: dialog containing a wxRearrangeCtrl // ---------------------------------------------------------------------------- class WXDLLIMPEXP_CORE wxRearrangeDialog : public wxDialog { public: // default ctor, use Create() later wxRearrangeDialog() { Init(); } // ctor for the dialog: message is shown inside the dialog itself, order // and items are passed to wxRearrangeList used internally wxRearrangeDialog(wxWindow *parent, const wxString& message, const wxString& title, const wxArrayInt& order, const wxArrayString& items, const wxPoint& pos = wxDefaultPosition, const wxString& name = wxRearrangeDialogNameStr) { Init(); Create(parent, message, title, order, items, pos, name); } bool Create(wxWindow *parent, const wxString& message, const wxString& title, const wxArrayInt& order, const wxArrayString& items, const wxPoint& pos = wxDefaultPosition, const wxString& name = wxRearrangeDialogNameStr); // methods for the dialog customization // add extra contents to the dialog below the wxRearrangeCtrl part: the // given window (usually a wxPanel containing more control inside it) must // have the dialog as its parent and will be inserted into it at the right // place by this method void AddExtraControls(wxWindow *win); // return the wxRearrangeList control used by the dialog wxRearrangeList *GetList() const; // get the order of items after it was modified by the user wxArrayInt GetOrder() const; private: // common part of all ctors void Init() { m_ctrl = NULL; } wxRearrangeCtrl *m_ctrl; wxDECLARE_NO_COPY_CLASS(wxRearrangeDialog); }; #endif // wxUSE_REARRANGECTRL #endif // _WX_REARRANGECTRL_H_
h
rticonnextdds-usecases
data/projects/rticonnextdds-usecases/VehicleTracking/ExampleCode/thirdparty/wxWidgets-3.1.2/Linux/include/wx/bannerwindow.h
/////////////////////////////////////////////////////////////////////////////// // Name: wx/bannerwindow.h // Purpose: wxBannerWindow class declaration // Author: Vadim Zeitlin // Created: 2011-08-16 // Copyright: (c) 2011 Vadim Zeitlin <[email protected]> // Licence: wxWindows licence /////////////////////////////////////////////////////////////////////////////// #ifndef _WX_BANNERWINDOW_H_ #define _WX_BANNERWINDOW_H_ #include "wx/defs.h" #if wxUSE_BANNERWINDOW #include "wx/bitmap.h" #include "wx/event.h" #include "wx/window.h" class WXDLLIMPEXP_FWD_CORE wxBitmap; class WXDLLIMPEXP_FWD_CORE wxColour; class WXDLLIMPEXP_FWD_CORE wxDC; extern WXDLLIMPEXP_DATA_CORE(const char) wxBannerWindowNameStr[]; // ---------------------------------------------------------------------------- // A simple banner window showing either a bitmap or text. // ---------------------------------------------------------------------------- class WXDLLIMPEXP_CORE wxBannerWindow : public wxWindow { public: // Default constructor, use Create() later. wxBannerWindow() { Init(); } // Convenient constructor that should be used in the majority of cases. // // The banner orientation changes how the text in it is displayed and also // defines where is the bitmap truncated if it's too big to fit but doesn't // do anything for the banner position, this is supposed to be taken care // of in the usual way, e.g. using sizers. wxBannerWindow(wxWindow* parent, wxDirection dir = wxLEFT) { Init(); Create(parent, wxID_ANY, dir); } // Full constructor provided for consistency with the other classes only. wxBannerWindow(wxWindow* parent, wxWindowID winid, wxDirection dir = wxLEFT, const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxDefaultSize, long style = 0, const wxString& name = wxBannerWindowNameStr) { Init(); Create(parent, winid, dir, pos, size, style, name); } // Can be only called on objects created with the default constructor. bool Create(wxWindow* parent, wxWindowID winid, wxDirection dir = wxLEFT, const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxDefaultSize, long style = 0, const wxString& name = wxBannerWindowNameStr); // Provide an existing bitmap to show. For wxLEFT orientation the bitmap is // truncated from the top, for wxTOP and wxBOTTOM -- from the right and for // wxRIGHT -- from the bottom, so put the most important part of the bitmap // information in the opposite direction. void SetBitmap(const wxBitmap& bmp); // Set the text to display. This is mutually exclusive with SetBitmap(). // Title is rendered in bold and should be single line, message can have // multiple lines but is not wrapped automatically. void SetText(const wxString& title, const wxString& message); // Set the colours between which the gradient runs. This can be combined // with SetText() but not SetBitmap(). void SetGradient(const wxColour& start, const wxColour& end); protected: virtual wxSize DoGetBestClientSize() const wxOVERRIDE; private: // Common part of all constructors. void Init(); // Fully invalidates the window. void OnSize(wxSizeEvent& event); // Redraws the window using either m_bitmap or m_title/m_message. void OnPaint(wxPaintEvent& event); // Helper of OnPaint(): draw the bitmap at the correct position depending // on our orientation. void DrawBitmapBackground(wxDC& dc); // Helper of OnPaint(): draw the text in the appropriate direction. void DrawBannerTextLine(wxDC& dc, const wxString& str, const wxPoint& pos); // Return the font to use for the title. Currently this is hardcoded as a // larger bold version of the standard window font but could be made // configurable in the future. wxFont GetTitleFont() const; // Return the colour to use for extending the bitmap. Non-const as it // updates m_colBitmapBg if needed. wxColour GetBitmapBg(); // The window side along which the banner is laid out. wxDirection m_direction; // If valid, this bitmap is drawn as is. wxBitmap m_bitmap; // If bitmap is valid, this is the colour we use to extend it if the bitmap // is smaller than this window. It is computed on demand by GetBitmapBg(). wxColour m_colBitmapBg; // The title and main message to draw, used if m_bitmap is invalid. wxString m_title, m_message; // Start and stop gradient colours, only used when drawing text. wxColour m_colStart, m_colEnd; wxDECLARE_EVENT_TABLE(); wxDECLARE_NO_COPY_CLASS(wxBannerWindow); }; #endif // wxUSE_BANNERWINDOW #endif // _WX_BANNERWINDOW_H_
h
rticonnextdds-usecases
data/projects/rticonnextdds-usecases/VehicleTracking/ExampleCode/thirdparty/wxWidgets-3.1.2/Linux/include/wx/wxprec.h
///////////////////////////////////////////////////////////////////////////// // Name: wx/wxprec.h // Purpose: Includes the appropriate files for precompiled headers // Author: Julian Smart // Modified by: // Created: 01/02/97 // Copyright: (c) Julian Smart // Licence: wxWindows licence ///////////////////////////////////////////////////////////////////////////// // compiler detection; includes setup.h #include "wx/defs.h" // check if to use precompiled headers: do it for most Windows compilers unless // explicitly disabled by defining NOPCH #if defined(__VISUALC__) || defined(__BORLANDC__) // If user did not request NOCPH and we're not building using configure // then assume user wants precompiled headers. #if !defined(NOPCH) && !defined(__WX_SETUP_H__) #define WX_PRECOMP #endif #endif #ifdef WX_PRECOMP // include "wx/chartype.h" first to ensure that UNICODE macro is correctly set // _before_ including <windows.h> #include "wx/chartype.h" // include standard Windows headers #if defined(__WINDOWS__) #include "wx/msw/wrapwin.h" #include "wx/msw/private.h" #endif #if defined(__WXMSW__) #include "wx/msw/wrapcctl.h" #include "wx/msw/wrapcdlg.h" #include "wx/msw/missing.h" #endif // include the most common wx headers #include "wx/wx.h" #endif // WX_PRECOMP
h
rticonnextdds-usecases
data/projects/rticonnextdds-usecases/VehicleTracking/ExampleCode/thirdparty/wxWidgets-3.1.2/Linux/include/wx/wrapsizer.h
///////////////////////////////////////////////////////////////////////////// // Name: wx/wrapsizer.h // Purpose: provide wrapping sizer for layout (wxWrapSizer) // Author: Arne Steinarson // Created: 2008-05-08 // Copyright: (c) Arne Steinarson // Licence: wxWindows licence ///////////////////////////////////////////////////////////////////////////// #ifndef _WX_WRAPSIZER_H_ #define _WX_WRAPSIZER_H_ #include "wx/sizer.h" // flags for wxWrapSizer enum { wxEXTEND_LAST_ON_EACH_LINE = 1, // don't leave spacers in the beginning of a new row wxREMOVE_LEADING_SPACES = 2, wxWRAPSIZER_DEFAULT_FLAGS = wxEXTEND_LAST_ON_EACH_LINE | wxREMOVE_LEADING_SPACES }; // ---------------------------------------------------------------------------- // A box sizer that can wrap items on several lines when sum of widths exceed // available line width. // ---------------------------------------------------------------------------- class WXDLLEXPORT wxWrapSizer : public wxBoxSizer { public: wxWrapSizer(int orient = wxHORIZONTAL, int flags = wxWRAPSIZER_DEFAULT_FLAGS); virtual ~wxWrapSizer(); // override base class virtual methods virtual wxSize CalcMin() wxOVERRIDE; virtual void RecalcSizes() wxOVERRIDE; virtual bool InformFirstDirection(int direction, int size, int availableOtherDir) wxOVERRIDE; protected: // This method is called to decide if an item represents empty space or // not. We do this to avoid having space-only items first or last on a // wrapped line (left alignment). // // By default only spacers are considered to be empty items but a derived // class may override this item if some other kind of sizer elements should // be also considered empty for some reason. virtual bool IsSpaceItem(wxSizerItem *item) const { return item->IsSpacer(); } // helpers of CalcMin() void CalcMinFromMinor(int totMinor); void CalcMinFromMajor(int totMajor); void CalcMinUsingCurrentLayout(); void CalcMinFittingSize(const wxSize& szBoundary); void CalcMaxSingleItemSize(); // temporarily change the proportion of the last item of the N-th row to // extend to the end of line if the appropriate flag is set void AdjustLastRowItemProp(size_t n, wxSizerItem *itemLast); // remove all the items from m_rows void ClearRows(); // return the N-th row sizer from m_rows creating it if necessary wxSizer *GetRowSizer(size_t n); // should be called after completion of each row void FinishRow(size_t n, int rowMajor, int rowMinor, wxSizerItem *itemLast); const int m_flags; // Flags specified in the ctor int m_dirInform; // Direction for size information int m_availSize; // Size available in m_dirInform direction int m_availableOtherDir; // Size available in the other direction bool m_lastUsed; // Indicates whether value from InformFirst... has // been used yet // The sizes below are computed by RecalcSizes(), i.e. they don't have // valid values during the initial call to CalcMin() and they are only // valid for the current layout (i.e. the current number of rows) int m_minSizeMinor; // Min size in minor direction int m_maxSizeMajor; // Size of longest row int m_minItemMajor; // Size of smallest item in major direction wxBoxSizer m_rows; // Sizer containing multiple rows of our items wxDECLARE_DYNAMIC_CLASS_NO_COPY(wxWrapSizer); }; #endif // _WX_WRAPSIZER_H_
h
rticonnextdds-usecases
data/projects/rticonnextdds-usecases/VehicleTracking/ExampleCode/thirdparty/wxWidgets-3.1.2/Linux/include/wx/platform.h
/** * Name: wx/platform.h * Purpose: define the OS and compiler identification macros * Author: Vadim Zeitlin * Modified by: * Created: 29.10.01 (extracted from wx/defs.h) * Copyright: (c) 1997-2001 Vadim Zeitlin * Licence: wxWindows licence */ /* THIS IS A C FILE, DON'T USE C++ FEATURES (IN PARTICULAR COMMENTS) IN IT */ #ifndef _WX_PLATFORM_H_ #define _WX_PLATFORM_H_ #ifdef __WXMAC_XCODE__ # include <unistd.h> # include <TargetConditionals.h> # include <AvailabilityMacros.h> # ifndef MAC_OS_X_VERSION_10_4 # define MAC_OS_X_VERSION_10_4 1040 # endif # ifndef MAC_OS_X_VERSION_10_5 # define MAC_OS_X_VERSION_10_5 1050 # endif # ifndef MAC_OS_X_VERSION_10_6 # define MAC_OS_X_VERSION_10_6 1060 # endif # ifndef MAC_OS_X_VERSION_10_7 # define MAC_OS_X_VERSION_10_7 1070 # endif # ifndef MAC_OS_X_VERSION_10_8 # define MAC_OS_X_VERSION_10_8 1080 # endif # ifndef MAC_OS_X_VERSION_10_9 # define MAC_OS_X_VERSION_10_9 1090 # endif # ifndef MAC_OS_X_VERSION_10_10 # define MAC_OS_X_VERSION_10_10 101000 # endif # ifndef MAC_OS_X_VERSION_10_11 # define MAC_OS_X_VERSION_10_11 101100 # endif # ifndef MAC_OS_X_VERSION_10_12 # define MAC_OS_X_VERSION_10_12 101200 # endif # ifndef MAC_OS_X_VERSION_10_13 # define MAC_OS_X_VERSION_10_13 101300 # endif # if MAC_OS_X_VERSION_MAX_ALLOWED < MAC_OS_X_VERSION_10_13 # ifndef NSAppKitVersionNumber10_10 # define NSAppKitVersionNumber10_10 1343 # endif # ifndef NSAppKitVersionNumber10_11 # define NSAppKitVersionNumber10_11 1404 # endif # endif # ifndef __WXOSX__ # define __WXOSX__ 1 # endif # ifndef __WXMAC__ # define __WXMAC__ 1 # endif #endif /* We use __WINDOWS__ as our main identification symbol for Microsoft Windows but it's actually not predefined directly by any commonly used compilers (only Watcom defines it itself and it's not supported any longer), so we define it ourselves if any of the following macros is defined: - MSVC _WIN32 (notice that this is also defined under Win64) - Borland __WIN32__ - Our __WXMSW__ which selects Windows as platform automatically */ #if defined(_WIN32) || defined(__WIN32__) || defined(__WXMSW__) # ifndef __WINDOWS__ # define __WINDOWS__ # endif /* !__WINDOWS__ */ #endif /* Any standard symbol indicating Windows */ #if defined(__WINDOWS__) /* Select wxMSW under Windows if no other port is specified. */ # if !defined(__WXMSW__) && !defined(__WXMOTIF__) && !defined(__WXGTK__) && !defined(__WXX11__) && !defined(__WXQT__) # define __WXMSW__ # endif # ifndef _WIN32 # define _WIN32 # endif # ifndef WIN32 # define WIN32 # endif # ifndef __WIN32__ # define __WIN32__ # endif /* MSVC predefines _WIN64 for 64 bit builds, for gcc we use generic architecture definitions. */ # if defined(_WIN64) || defined(__x86_64__) # ifndef __WIN64__ # define __WIN64__ # endif /* !__WIN64__ */ # endif /* _WIN64 */ #endif /* __WINDOWS__ */ /* Don't use widget toolkit specific code in non-GUI code in the library itself to ensure that the same base library is used for both MSW and GTK ports. But keep __WXMSW__ defined for (console) applications using wxWidgets for compatibility. */ #if defined(WXBUILDING) && defined(wxUSE_GUI) && !wxUSE_GUI # ifdef __WXMSW__ # undef __WXMSW__ # endif # ifdef __WXGTK__ # undef __WXGTK__ # endif #endif #if (defined(__WXGTK__) || defined(__WXQT__)) && defined(__WINDOWS__) # ifdef __WXMSW__ # undef __WXMSW__ # endif #endif /* (__WXGTK__ || __WXQT__) && __WINDOWS__ */ #ifdef __ANDROID__ # define __WXANDROID__ # include "wx/android/config_android.h" #endif #include "wx/compiler.h" /* Include wx/setup.h for the Unix platform defines generated by configure and the library compilation options Note that it must be included before defining hardware symbols below as they could be already defined by configure but it must be included after defining the compiler macros above as msvc/wx/setup.h relies on them under Windows. */ #include "wx/setup.h" /* Convenience for any optional classes that use the wxAnyButton base class. */ #if wxUSE_TOGGLEBTN || wxUSE_BUTTON #define wxHAS_ANY_BUTTON #endif /* Hardware platform detection. VC++ defines _M_xxx symbols. */ #if defined(_M_IX86) || defined(i386) || defined(__i386) || defined(__i386__) #ifndef __INTEL__ #define __INTEL__ #endif #endif /* x86 */ #if defined(_M_IA64) #ifndef __IA64__ #define __IA64__ #endif #endif /* ia64 */ #if defined(_M_MPPC) || defined(__PPC__) || defined(__ppc__) #ifndef __POWERPC__ #define __POWERPC__ #endif #endif /* alpha */ #if defined(_M_ALPHA) || defined(__AXP__) #ifndef __ALPHA__ #define __ALPHA__ #endif #endif /* alpha */ /* adjust the Unicode setting: wxUSE_UNICODE should be defined as 0 or 1 and is used by wxWidgets, _UNICODE and/or UNICODE may be defined or used by the system headers so bring these settings in sync */ /* set wxUSE_UNICODE to 1 if UNICODE or _UNICODE is defined */ #if defined(_UNICODE) || defined(UNICODE) # undef wxUSE_UNICODE # define wxUSE_UNICODE 1 #else /* !UNICODE */ # ifndef wxUSE_UNICODE # define wxUSE_UNICODE 0 # endif #endif /* UNICODE/!UNICODE */ /* and vice versa: define UNICODE and _UNICODE if wxUSE_UNICODE is 1 */ #if wxUSE_UNICODE # ifndef _UNICODE # define _UNICODE # endif # ifndef UNICODE # define UNICODE # endif #endif /* wxUSE_UNICODE */ /* test for old versions of Borland C, normally need at least 5.82, Turbo explorer, available for free at http://www.turboexplorer.com/downloads */ /* Older versions of Borland C have some compiler bugs that need workarounds. Mostly pertains to the free command line compiler 5.5.1. */ #if defined(__BORLANDC__) && (__BORLANDC__ <= 0x551) /* The Borland free compiler is unable to handle overloaded enum comparisons under certain conditions e.g. when any class has a conversion ctor for an integral type and there's an overload to compare between an integral type and that class type. */ # define wxCOMPILER_NO_OVERLOAD_ON_ENUM /* This is needed to overcome bugs in 5.5.1 STL, linking errors will result if it is not defined. */ # define _RWSTD_COMPILE_INSTANTIATE /* Preprocessor in older Borland compilers have major problems concatenating with ##. Specifically, if the string operands being concatenated have special meaning (e.g. L"str", 123i64 etc) then ## will not concatenate the operands correctly. As a workaround, define wxPREPEND* and wxAPPEND* without using wxCONCAT_HELPER. */ # define wxCOMPILER_BROKEN_CONCAT_OPER #endif /* __BORLANDC__ */ /* OS: then test for generic Unix defines, then for particular flavours and finally for Unix-like systems Mac OS X matches this case (__MACH__), prior Mac OS do not. */ #if defined(__UNIX__) || defined(__unix) || defined(__unix__) || \ defined(____SVR4____) || defined(__LINUX__) || defined(__sgi) || \ defined(__hpux) || defined(__sun) || defined(__SUN__) || defined(_AIX) || \ defined(__VMS) || defined(__BEOS__) || defined(__MACH__) # define __UNIX_LIKE__ # ifdef __SGI__ # ifdef __GNUG__ # else /* !gcc */ /* Note I use the term __SGI_CC__ for both cc and CC, its not a good idea to mix gcc and cc/CC, the name mangling is different */ # define __SGI_CC__ # endif /* gcc/!gcc */ /* system headers use this symbol and not __cplusplus in some places */ # ifndef _LANGUAGE_C_PLUS_PLUS # define _LANGUAGE_C_PLUS_PLUS # endif # endif /* SGI */ # if defined(__INNOTEK_LIBC__) /* Ensure visibility of strnlen declaration */ # define _GNU_SOURCE # endif /* define __HPUX__ for HP-UX where standard macro is __hpux */ # if defined(__hpux) && !defined(__HPUX__) # define __HPUX__ # endif /* HP-UX */ /* All of these should already be defined by including configure- generated setup.h but we wish to support Xcode compilation without requiring the user to define these himself. */ # if defined(__APPLE__) && defined(__MACH__) # ifndef __UNIX__ # define __UNIX__ 1 # endif # ifndef __BSD__ # define __BSD__ 1 # endif /* __DARWIN__ is our own define to mean OS X or pure Darwin */ # ifndef __DARWIN__ # define __DARWIN__ 1 # endif /* OS X uses unsigned long size_t for both ILP32 and LP64 modes. */ # if !defined(wxSIZE_T_IS_UINT) && !defined(wxSIZE_T_IS_ULONG) # define wxSIZE_T_IS_ULONG # endif # endif /* OS: Windows */ #elif defined(__WINDOWS__) /* to be changed for Win64! */ # ifndef __WIN32__ # error "__WIN32__ should be defined for Win32 and Win64, Win16 is not supported" # endif /* size_t is the same as unsigned int for all Windows compilers we know, */ /* so define it if it hadn't been done by configure yet */ # if !defined(wxSIZE_T_IS_UINT) && !defined(wxSIZE_T_IS_ULONG) && !defined(__WIN64__) # define wxSIZE_T_IS_UINT # endif #else # error "Unknown platform." #endif /* OS */ /* if we're on a Unix system but didn't use configure (so that setup.h didn't define __UNIX__), do define __UNIX__ now */ #if !defined(__UNIX__) && defined(__UNIX_LIKE__) # define __UNIX__ #endif /* Unix */ #if defined(__WXMOTIF__) || defined(__WXX11__) # define __X__ #endif /* We get "Large Files (ILP32) not supported in strict ANSI mode." #error from HP-UX standard headers when compiling with g++ without this: */ #if defined(__HPUX__) && !defined(__STDC_EXT__) # define __STDC_EXT__ 1 #endif /* Force linking against required libraries under Windows: */ #if defined __WINDOWS__ # include "wx/msw/libraries.h" #endif #if defined(__BORLANDC__) || (defined(__GNUC__) && __GNUC__ < 3) #define wxNEEDS_CHARPP #endif /* Note that wx/msw/gccpriv.h must be included after defining UNICODE and _UNICODE macros as it includes _mingw.h which relies on them being set. */ #if ( defined( __GNUWIN32__ ) || defined( __MINGW32__ ) || \ ( defined( __CYGWIN__ ) && defined( __WINDOWS__ ) ) ) && \ !defined(__WXMOTIF__) && \ !defined(__WXX11__) # include "wx/msw/gccpriv.h" #else # undef wxCHECK_W32API_VERSION # define wxCHECK_W32API_VERSION(maj, min) (0) # undef wxCHECK_MINGW32_VERSION # define wxCHECK_MINGW32_VERSION( major, minor ) (0) # define wxDECL_FOR_MINGW32_ALWAYS(rettype, func, params) # define wxDECL_FOR_STRICT_MINGW32(rettype, func, params) #endif /* Handle Darwin gcc universal compilation. Don't do this in an Apple- specific case since no sane compiler should be defining either __BIG_ENDIAN__ or __LITTLE_ENDIAN__ unless it really is generating code that will be hosted on a machine with the appropriate endianness. If a compiler defines neither, assume the user or configure set WORDS_BIGENDIAN appropriately. */ #if defined(__BIG_ENDIAN__) # undef WORDS_BIGENDIAN # define WORDS_BIGENDIAN 1 #elif defined(__LITTLE_ENDIAN__) # undef WORDS_BIGENDIAN #elif defined(__WXMAC__) && !defined(WORDS_BIGENDIAN) /* According to Stefan even ancient Mac compilers defined __BIG_ENDIAN__ */ # warning "Compiling wxMac with probably wrong endianness" #endif /* also the 32/64 bit universal builds must be handled accordingly */ #ifdef __DARWIN__ # ifdef __LP64__ # undef SIZEOF_VOID_P # undef SIZEOF_LONG # undef SIZEOF_SIZE_T # define SIZEOF_VOID_P 8 # define SIZEOF_LONG 8 # define SIZEOF_SIZE_T 8 # else # undef SIZEOF_VOID_P # undef SIZEOF_LONG # undef SIZEOF_SIZE_T # define SIZEOF_VOID_P 4 # define SIZEOF_LONG 4 # define SIZEOF_SIZE_T 4 # endif #endif /* Define various OS X symbols before including wx/chkconf.h which uses them. __WXOSX_MAC__ means Mac OS X, non embedded __WXOSX_IPHONE__ means OS X iPhone */ /* Normally all of __WXOSX_XXX__, __WXOSX__ and __WXMAC__ are defined by configure but ensure that we also define them if configure was not used for whatever reason. The primary symbol remains __WXOSX_XXX__ one, __WXOSX__ exists to allow checking for any OS X port (Cocoa) and __WXMAC__ is an old name for it. */ #if defined(__WXOSX_COCOA__) || defined(__WXOSX_IPHONE__) # ifndef __WXOSX__ # define __WXOSX__ 1 # endif # ifndef __WXMAC__ # define __WXMAC__ 1 # endif #endif #ifdef __WXOSX__ /* setup precise defines according to sdk used */ # include <TargetConditionals.h> # if defined(__WXOSX_IPHONE__) # if !( defined(TARGET_OS_IPHONE) && TARGET_OS_IPHONE ) # error "incorrect SDK for an iPhone build" # endif # else # if wxUSE_GUI && !defined(__WXOSX_COCOA__) # error "one of __WXOSX_IPHONE__ or __WXOSX_COCOA__ must be defined for the GUI build" # endif # if !( defined(TARGET_OS_MAC) && TARGET_OS_MAC ) # error "incorrect SDK for a Mac OS X build" # endif # define __WXOSX_MAC__ 1 # endif #endif #ifdef __WXOSX_MAC__ # if defined(__MACH__) # include <AvailabilityMacros.h> # ifndef MAC_OS_X_VERSION_10_4 # define MAC_OS_X_VERSION_10_4 1040 # endif # ifndef MAC_OS_X_VERSION_10_5 # define MAC_OS_X_VERSION_10_5 1050 # endif # ifndef MAC_OS_X_VERSION_10_6 # define MAC_OS_X_VERSION_10_6 1060 # endif # ifndef MAC_OS_X_VERSION_10_7 # define MAC_OS_X_VERSION_10_7 1070 # endif # ifndef MAC_OS_X_VERSION_10_8 # define MAC_OS_X_VERSION_10_8 1080 # endif # ifndef MAC_OS_X_VERSION_10_9 # define MAC_OS_X_VERSION_10_9 1090 # endif # ifndef MAC_OS_X_VERSION_10_10 # define MAC_OS_X_VERSION_10_10 101000 # endif # ifndef MAC_OS_X_VERSION_10_11 # define MAC_OS_X_VERSION_10_11 101100 # endif # ifndef MAC_OS_X_VERSION_10_12 # define MAC_OS_X_VERSION_10_12 101200 # endif # ifndef MAC_OS_X_VERSION_10_13 # define MAC_OS_X_VERSION_10_13 101300 # endif # ifndef MAC_OS_X_VERSION_10_14 # define MAC_OS_X_VERSION_10_14 101400 # endif # if MAC_OS_X_VERSION_MAX_ALLOWED < MAC_OS_X_VERSION_10_13 # ifndef NSAppKitVersionNumber10_10 # define NSAppKitVersionNumber10_10 1343 # endif # ifndef NSAppKitVersionNumber10_11 # define NSAppKitVersionNumber10_11 1404 # endif # endif # else # error "only mach-o configurations are supported" # endif #endif /* This is obsolete and kept for backwards compatibility only. */ #if defined(__WXOSX__) # define __WXOSX_OR_COCOA__ 1 #endif /* check the consistency of the settings in setup.h: note that this must be done after setting wxUSE_UNICODE correctly as it is used in wx/chkconf.h and after defining the compiler macros which are used in it too */ #include "wx/chkconf.h" /* some compilers don't support iostream.h any longer, while some of theme are not updated with <iostream> yet, so override the users setting here in such case. */ #if defined(_MSC_VER) && (_MSC_VER >= 1310) # undef wxUSE_IOSTREAMH # define wxUSE_IOSTREAMH 0 #elif defined(__MINGW32__) # undef wxUSE_IOSTREAMH # define wxUSE_IOSTREAMH 0 #endif /* compilers with/without iostream.h */ /* old C++ headers (like <iostream.h>) declare classes in the global namespace while the new, standard ones (like <iostream>) do it in std:: namespace, unless it's an old gcc version. using this macro allows constuctions like "wxSTD iostream" to work in either case */ #if !wxUSE_IOSTREAMH && (!defined(__GNUC__) || ( __GNUC__ > 2 ) || (__GNUC__ == 2 && __GNUC_MINOR__ >= 95)) # define wxSTD std:: #else # define wxSTD #endif /* On OpenVMS with the most recent HP C++ compiler some function (i.e. wscanf) * are only available in the std-namespace. (BUG???) */ #if defined( __VMS ) && (__DECCXX_VER >= 70100000) && !defined(__STD_CFRONT) && !defined( __NONAMESPACE_STD ) # define wxVMS_USE_STD std:: #else # define wxVMS_USE_STD #endif #ifdef __VMS #define XtDisplay XTDISPLAY #ifdef __WXMOTIF__ #define XtParent XTPARENT #define XtScreen XTSCREEN #define XtWindow XTWINDOW #endif #endif /* Choose which method we will use for updating menus * - in OnIdle, or when we receive a wxEVT_MENU_OPEN event. * Presently, only Windows, OS X and GTK+ support wxEVT_MENU_OPEN. */ #ifndef wxUSE_IDLEMENUUPDATES # if (defined(__WXMSW__) || defined(__WXGTK__) || defined(__WXOSX__)) && !defined(__WXUNIVERSAL__) # define wxUSE_IDLEMENUUPDATES 0 # else # define wxUSE_IDLEMENUUPDATES 1 # endif #endif /* * Define symbols that are not yet in * configure or possibly some setup.h files. * They will need to be added. */ #ifndef wxUSE_FILECONFIG # if wxUSE_CONFIG && wxUSE_TEXTFILE # define wxUSE_FILECONFIG 1 # else # define wxUSE_FILECONFIG 0 # endif #endif #ifndef wxUSE_HOTKEY # define wxUSE_HOTKEY 0 #endif #if !defined(wxUSE_WXDIB) && defined(__WXMSW__) # define wxUSE_WXDIB 1 #endif /* Optionally supported C++ features. */ /* RTTI: if it is disabled in build/msw/makefile.* then this symbol will already be defined but it's also possible to do it from configure (with g++) or by editing project files with MSVC so test for it here too. */ #ifndef wxNO_RTTI /* Only 4.3 defines __GXX_RTTI by default so its absence is not an indication of disabled RTTI with the previous versions. */ # if wxCHECK_GCC_VERSION(4, 3) # ifndef __GXX_RTTI # define wxNO_RTTI # endif # elif defined(_MSC_VER) # ifndef _CPPRTTI # define wxNO_RTTI # endif # endif #endif /* wxNO_RTTI */ #endif /* _WX_PLATFORM_H_ */
h
rticonnextdds-usecases
data/projects/rticonnextdds-usecases/VehicleTracking/ExampleCode/thirdparty/wxWidgets-3.1.2/Linux/include/wx/aboutdlg.h
/////////////////////////////////////////////////////////////////////////////// // Name: wx/aboutdlg.h // Purpose: declaration of wxAboutDialog class // Author: Vadim Zeitlin // Created: 2006-10-07 // Copyright: (c) 2006 Vadim Zeitlin <[email protected]> // Licence: wxWindows licence /////////////////////////////////////////////////////////////////////////////// #ifndef _WX_ABOUTDLG_H_ #define _WX_ABOUTDLG_H_ #include "wx/defs.h" #if wxUSE_ABOUTDLG #include "wx/app.h" #include "wx/icon.h" // ---------------------------------------------------------------------------- // wxAboutDialogInfo: information shown by the standard "About" dialog // ---------------------------------------------------------------------------- class WXDLLIMPEXP_ADV wxAboutDialogInfo { public: // all fields are initially uninitialized wxAboutDialogInfo() { } // accessors for various simply fields // ----------------------------------- // name of the program, if not used defaults to wxApp::GetAppDisplayName() void SetName(const wxString& name) { m_name = name; } wxString GetName() const { return m_name.empty() ? wxTheApp->GetAppDisplayName() : m_name; } // version should contain program version without "version" word (e.g., // "1.2" or "RC2") while longVersion may contain the full version including // "version" word (e.g., "Version 1.2" or "Release Candidate 2") // // if longVersion is empty, it is automatically constructed from version // // generic and gtk native: use short version only, as a suffix to the // program name msw and osx native: use long version void SetVersion(const wxString& version, const wxString& longVersion = wxString()); bool HasVersion() const { return !m_version.empty(); } const wxString& GetVersion() const { return m_version; } const wxString& GetLongVersion() const { return m_longVersion; } // brief, but possibly multiline, description of the program void SetDescription(const wxString& desc) { m_description = desc; } bool HasDescription() const { return !m_description.empty(); } const wxString& GetDescription() const { return m_description; } // short string containing the program copyright information void SetCopyright(const wxString& copyright) { m_copyright = copyright; } bool HasCopyright() const { return !m_copyright.empty(); } const wxString& GetCopyright() const { return m_copyright; } // long, multiline string containing the text of the program licence void SetLicence(const wxString& licence) { m_licence = licence; } void SetLicense(const wxString& licence) { m_licence = licence; } bool HasLicence() const { return !m_licence.empty(); } const wxString& GetLicence() const { return m_licence; } // icon to be shown in the dialog, defaults to the main frame icon void SetIcon(const wxIcon& icon) { m_icon = icon; } bool HasIcon() const { return m_icon.IsOk(); } wxIcon GetIcon() const; // web site for the program and its description (defaults to URL itself if // empty) void SetWebSite(const wxString& url, const wxString& desc = wxEmptyString) { m_url = url; m_urlDesc = desc.empty() ? url : desc; } bool HasWebSite() const { return !m_url.empty(); } const wxString& GetWebSiteURL() const { return m_url; } const wxString& GetWebSiteDescription() const { return m_urlDesc; } // accessors for the arrays // ------------------------ // the list of developers of the program void SetDevelopers(const wxArrayString& developers) { m_developers = developers; } void AddDeveloper(const wxString& developer) { m_developers.push_back(developer); } bool HasDevelopers() const { return !m_developers.empty(); } const wxArrayString& GetDevelopers() const { return m_developers; } // the list of documentation writers void SetDocWriters(const wxArrayString& docwriters) { m_docwriters = docwriters; } void AddDocWriter(const wxString& docwriter) { m_docwriters.push_back(docwriter); } bool HasDocWriters() const { return !m_docwriters.empty(); } const wxArrayString& GetDocWriters() const { return m_docwriters; } // the list of artists for the program art void SetArtists(const wxArrayString& artists) { m_artists = artists; } void AddArtist(const wxString& artist) { m_artists.push_back(artist); } bool HasArtists() const { return !m_artists.empty(); } const wxArrayString& GetArtists() const { return m_artists; } // the list of translators void SetTranslators(const wxArrayString& translators) { m_translators = translators; } void AddTranslator(const wxString& translator) { m_translators.push_back(translator); } bool HasTranslators() const { return !m_translators.empty(); } const wxArrayString& GetTranslators() const { return m_translators; } // implementation only // ------------------- // "simple" about dialog shows only textual information (with possibly // default icon but without hyperlink nor any long texts such as the // licence text) bool IsSimple() const { return !HasWebSite() && !HasIcon() && !HasLicence(); } // get the description and credits (i.e. all of developers, doc writers, // artists and translators) as a one long multiline string wxString GetDescriptionAndCredits() const; // returns the copyright with the (C) string substituted by the Unicode // character U+00A9 wxString GetCopyrightToDisplay() const; private: wxString m_name, m_version, m_longVersion, m_description, m_copyright, m_licence; wxIcon m_icon; wxString m_url, m_urlDesc; wxArrayString m_developers, m_docwriters, m_artists, m_translators; }; // functions to show the about dialog box WXDLLIMPEXP_ADV void wxAboutBox(const wxAboutDialogInfo& info, wxWindow* parent = NULL); #endif // wxUSE_ABOUTDLG #endif // _WX_ABOUTDLG_H_
h
rticonnextdds-usecases
data/projects/rticonnextdds-usecases/VehicleTracking/ExampleCode/thirdparty/wxWidgets-3.1.2/Linux/include/wx/checkeddelete.h
/////////////////////////////////////////////////////////////////////////////// // Name: wx/checkeddelete.h // Purpose: wxCHECKED_DELETE() macro // Author: Vadim Zeitlin // Created: 2009-02-03 // Copyright: (c) 2002-2009 wxWidgets dev team // Licence: wxWindows licence /////////////////////////////////////////////////////////////////////////////// #ifndef _WX_CHECKEDDELETE_H_ #define _WX_CHECKEDDELETE_H_ #include "wx/cpp.h" // TODO: provide wxCheckedDelete[Array]() template functions too // ---------------------------------------------------------------------------- // wxCHECKED_DELETE and wxCHECKED_DELETE_ARRAY macros // ---------------------------------------------------------------------------- /* checked deleters are used to make sure that the type being deleted is really a complete type.: otherwise sizeof() would result in a compile-time error do { ... } while ( 0 ) construct is used to have an anonymous scope (otherwise we could have name clashes between different "complete"s) but still force a semicolon after the macro */ #define wxCHECKED_DELETE(ptr) \ wxSTATEMENT_MACRO_BEGIN \ typedef char complete[sizeof(*ptr)] WX_ATTRIBUTE_UNUSED; \ delete ptr; \ wxSTATEMENT_MACRO_END #define wxCHECKED_DELETE_ARRAY(ptr) \ wxSTATEMENT_MACRO_BEGIN \ typedef char complete[sizeof(*ptr)] WX_ATTRIBUTE_UNUSED; \ delete [] ptr; \ wxSTATEMENT_MACRO_END #endif // _WX_CHECKEDDELETE_H_
h
rticonnextdds-usecases
data/projects/rticonnextdds-usecases/VehicleTracking/ExampleCode/thirdparty/wxWidgets-3.1.2/Linux/include/wx/ownerdrw.h
/////////////////////////////////////////////////////////////////////////////// // Name: wx/ownerdrw.h // Purpose: interface for owner-drawn GUI elements // Author: Vadim Zeitlin // Modified by: Marcin Malich // Created: 11.11.97 // Copyright: (c) 1998 Vadim Zeitlin <[email protected]> // Licence: wxWindows licence /////////////////////////////////////////////////////////////////////////////// #ifndef _WX_OWNERDRW_H_BASE #define _WX_OWNERDRW_H_BASE #include "wx/defs.h" #if wxUSE_OWNER_DRAWN #include "wx/font.h" #include "wx/colour.h" class WXDLLIMPEXP_FWD_CORE wxDC; // ---------------------------------------------------------------------------- // wxOwnerDrawn - a mix-in base class, derive from it to implement owner-drawn // behaviour // // wxOwnerDrawn supports drawing of an item with non standard font, color and // also supports 3 bitmaps: either a checked/unchecked bitmap for a checkable // element or one unchangeable bitmap otherwise. // ---------------------------------------------------------------------------- class WXDLLIMPEXP_CORE wxOwnerDrawnBase { public: wxOwnerDrawnBase() { m_ownerDrawn = false; m_margin = ms_defaultMargin; } virtual ~wxOwnerDrawnBase() {} void SetFont(const wxFont& font) { m_font = font; m_ownerDrawn = true; } wxFont& GetFont() const { return (wxFont&) m_font; } void SetTextColour(const wxColour& colText) { m_colText = colText; m_ownerDrawn = true; } wxColour& GetTextColour() const { return (wxColour&) m_colText; } void SetBackgroundColour(const wxColour& colBack) { m_colBack = colBack; m_ownerDrawn = true; } wxColour& GetBackgroundColour() const { return (wxColour&) m_colBack ; } void SetMarginWidth(int width) { m_margin = width; } int GetMarginWidth() const { return m_margin; } static int GetDefaultMarginWidth() { return ms_defaultMargin; } // get item name (with mnemonics if exist) virtual wxString GetName() const = 0; // this function might seem strange, but if it returns false it means that // no non-standard attribute are set, so there is no need for this control // to be owner-drawn. Moreover, you can force owner-drawn to false if you // want to change, say, the color for the item but only if it is owner-drawn // (see wxMenuItem::wxMenuItem for example) bool IsOwnerDrawn() const { return m_ownerDrawn; } // switch on/off owner-drawing the item void SetOwnerDrawn(bool ownerDrawn = true) { m_ownerDrawn = ownerDrawn; } // constants used in OnDrawItem // (they have the same values as corresponding Win32 constants) enum wxODAction { wxODDrawAll = 0x0001, // redraw entire control wxODSelectChanged = 0x0002, // selection changed (see Status.Select) wxODFocusChanged = 0x0004 // keyboard focus changed (see Status.Focus) }; enum wxODStatus { wxODSelected = 0x0001, // control is currently selected wxODGrayed = 0x0002, // item is to be grayed wxODDisabled = 0x0004, // item is to be drawn as disabled wxODChecked = 0x0008, // item is to be checked wxODHasFocus = 0x0010, // item has the keyboard focus wxODDefault = 0x0020, // item is the default item wxODHidePrefix= 0x0100 // hide keyboard cues (w2k and xp only) }; // virtual functions to implement drawing (return true if processed) virtual bool OnMeasureItem(size_t *width, size_t *height); virtual bool OnDrawItem(wxDC& dc, const wxRect& rc, wxODAction act, wxODStatus stat) = 0; protected: // get the font and colour to use, whether it is set or not virtual void GetFontToUse(wxFont& font) const; virtual void GetColourToUse(wxODStatus stat, wxColour& colText, wxColour& colBack) const; private: bool m_ownerDrawn; // true if something is non standard wxFont m_font; // font to use for drawing wxColour m_colText, // color ----"---"---"---- m_colBack; // background color int m_margin; // space occupied by bitmap to the left of the item static int ms_defaultMargin; }; // ---------------------------------------------------------------------------- // include the platform-specific class declaration // ---------------------------------------------------------------------------- #if defined(__WXMSW__) #include "wx/msw/ownerdrw.h" #endif #endif // wxUSE_OWNER_DRAWN #endif // _WX_OWNERDRW_H_BASE
h
rticonnextdds-usecases
data/projects/rticonnextdds-usecases/VehicleTracking/ExampleCode/thirdparty/wxWidgets-3.1.2/Linux/include/wx/textbuf.h
/////////////////////////////////////////////////////////////////////////////// // Name: wx/textbuf.h // Purpose: class wxTextBuffer to work with text buffers of _small_ size // (buffer is fully loaded in memory) and which understands CR/LF // differences between platforms. // Created: 14.11.01 // Author: Morten Hanssen, Vadim Zeitlin // Copyright: (c) 1998-2001 Morten Hanssen, Vadim Zeitlin // Licence: wxWindows licence /////////////////////////////////////////////////////////////////////////////// #ifndef _WX_TEXTBUFFER_H #define _WX_TEXTBUFFER_H #include "wx/defs.h" #include "wx/arrstr.h" #include "wx/convauto.h" // ---------------------------------------------------------------------------- // constants // ---------------------------------------------------------------------------- // the line termination type (kept wxTextFileType name for compatibility) enum wxTextFileType { wxTextFileType_None, // incomplete (the last line of the file only) wxTextFileType_Unix, // line is terminated with 'LF' = 0xA = 10 = '\n' wxTextFileType_Dos, // 'CR' 'LF' wxTextFileType_Mac, // 'CR' = 0xD = 13 = '\r' wxTextFileType_Os2 // 'CR' 'LF' }; #include "wx/string.h" #if wxUSE_TEXTBUFFER #include "wx/dynarray.h" // ---------------------------------------------------------------------------- // wxTextBuffer // ---------------------------------------------------------------------------- WX_DEFINE_USER_EXPORTED_ARRAY_INT(wxTextFileType, wxArrayLinesType, class WXDLLIMPEXP_BASE); #endif // wxUSE_TEXTBUFFER class WXDLLIMPEXP_BASE wxTextBuffer { public: // constants and static functions // default type for current platform (determined at compile time) static const wxTextFileType typeDefault; // this function returns a string which is identical to "text" passed in // except that the line terminator characters are changed to correspond the // given type. Called with the default argument, the function translates // the string to the native format (Unix for Unix, DOS for Windows, ...). static wxString Translate(const wxString& text, wxTextFileType type = typeDefault); // get the buffer termination string static const wxChar *GetEOL(wxTextFileType type = typeDefault); // the static methods of this class are compiled in even when // !wxUSE_TEXTBUFFER because they are used by the library itself, but the // rest can be left out #if wxUSE_TEXTBUFFER // buffer operations // ----------------- // buffer exists? bool Exists() const; // create the buffer if it doesn't already exist bool Create(); // same as Create() but with (another) buffer name bool Create(const wxString& strBufferName); // Open() also loads buffer in memory on success bool Open(const wxMBConv& conv = wxConvAuto()); // same as Open() but with (another) buffer name bool Open(const wxString& strBufferName, const wxMBConv& conv = wxConvAuto()); // closes the buffer and frees memory, losing all changes bool Close(); // is buffer currently opened? bool IsOpened() const { return m_isOpened; } // accessors // --------- // get the number of lines in the buffer size_t GetLineCount() const { return m_aLines.size(); } // the returned line may be modified (but don't add CR/LF at the end!) wxString& GetLine(size_t n) { return m_aLines[n]; } const wxString& GetLine(size_t n) const { return m_aLines[n]; } wxString& operator[](size_t n) { return m_aLines[n]; } const wxString& operator[](size_t n) const { return m_aLines[n]; } // the current line has meaning only when you're using // GetFirstLine()/GetNextLine() functions, it doesn't get updated when // you're using "direct access" i.e. GetLine() size_t GetCurrentLine() const { return m_nCurLine; } void GoToLine(size_t n) { m_nCurLine = n; } bool Eof() const { return m_nCurLine == m_aLines.size(); } // these methods allow more "iterator-like" traversal of the list of // lines, i.e. you may write something like: // for ( str = GetFirstLine(); !Eof(); str = GetNextLine() ) { ... } // NB: const is commented out because not all compilers understand // 'mutable' keyword yet (m_nCurLine should be mutable) wxString& GetFirstLine() /* const */ { return m_aLines.empty() ? ms_eof : m_aLines[m_nCurLine = 0]; } wxString& GetNextLine() /* const */ { return ++m_nCurLine == m_aLines.size() ? ms_eof : m_aLines[m_nCurLine]; } wxString& GetPrevLine() /* const */ { wxASSERT(m_nCurLine > 0); return m_aLines[--m_nCurLine]; } wxString& GetLastLine() /* const */ { return m_aLines.empty() ? ms_eof : m_aLines[m_nCurLine = m_aLines.size() - 1]; } // get the type of the line (see also GetEOL) wxTextFileType GetLineType(size_t n) const { return m_aTypes[n]; } // guess the type of buffer wxTextFileType GuessType() const; // get the name of the buffer const wxString& GetName() const { return m_strBufferName; } // add/remove lines // ---------------- // add a line to the end void AddLine(const wxString& str, wxTextFileType type = typeDefault) { m_aLines.push_back(str); m_aTypes.push_back(type); } // insert a line before the line number n void InsertLine(const wxString& str, size_t n, wxTextFileType type = typeDefault) { m_aLines.insert(m_aLines.begin() + n, str); m_aTypes.insert(m_aTypes.begin()+n, type); } // delete one line void RemoveLine(size_t n) { m_aLines.erase(m_aLines.begin() + n); m_aTypes.erase(m_aTypes.begin() + n); } // remove all lines void Clear() { m_aLines.clear(); m_aTypes.clear(); m_nCurLine = 0; } // change the buffer (default argument means "don't change type") // possibly in another format bool Write(wxTextFileType typeNew = wxTextFileType_None, const wxMBConv& conv = wxConvAuto()); // dtor virtual ~wxTextBuffer(); protected: // ctors // ----- // default ctor, use Open(string) wxTextBuffer() { m_nCurLine = 0; m_isOpened = false; } // ctor from filename wxTextBuffer(const wxString& strBufferName); enum wxTextBufferOpenMode { ReadAccess, WriteAccess }; // Must implement these in derived classes. virtual bool OnExists() const = 0; virtual bool OnOpen(const wxString &strBufferName, wxTextBufferOpenMode openmode) = 0; virtual bool OnClose() = 0; virtual bool OnRead(const wxMBConv& conv) = 0; virtual bool OnWrite(wxTextFileType typeNew, const wxMBConv& conv) = 0; static wxString ms_eof; // dummy string returned at EOF wxString m_strBufferName; // name of the buffer private: wxArrayLinesType m_aTypes; // type of each line wxArrayString m_aLines; // lines of file size_t m_nCurLine; // number of current line in the buffer bool m_isOpened; // was the buffer successfully opened the last time? #endif // wxUSE_TEXTBUFFER // copy ctor/assignment operator not implemented wxTextBuffer(const wxTextBuffer&); wxTextBuffer& operator=(const wxTextBuffer&); }; #endif // _WX_TEXTBUFFER_H
h
rticonnextdds-usecases
data/projects/rticonnextdds-usecases/VehicleTracking/ExampleCode/thirdparty/wxWidgets-3.1.2/Linux/include/wx/fontenum.h
///////////////////////////////////////////////////////////////////////////// // Name: wx/fontenum.h // Purpose: wxFontEnumerator class for getting available fonts // Author: Julian Smart, Vadim Zeitlin // Modified by: extended to enumerate more than just font facenames and works // not only on Windows now (VZ) // Created: 04/01/98 // Copyright: (c) Julian Smart, Vadim Zeitlin // Licence: wxWindows licence ///////////////////////////////////////////////////////////////////////////// #ifndef _WX_FONTENUM_H_ #define _WX_FONTENUM_H_ #include "wx/defs.h" #if wxUSE_FONTENUM #include "wx/fontenc.h" #include "wx/arrstr.h" // ---------------------------------------------------------------------------- // wxFontEnumerator enumerates all available fonts on the system or only the // fonts with given attributes // ---------------------------------------------------------------------------- class WXDLLIMPEXP_CORE wxFontEnumerator { public: wxFontEnumerator() {} // virtual dtor for the base class virtual ~wxFontEnumerator() {} // start enumerating font facenames (either all of them or those which // support the given encoding) - will result in OnFacename() being // called for each available facename (until they are exhausted or // OnFacename returns false) virtual bool EnumerateFacenames ( wxFontEncoding encoding = wxFONTENCODING_SYSTEM, // all bool fixedWidthOnly = false ); // enumerate the different encodings either for given font facename or for // all facenames - will result in OnFontEncoding() being called for each // available (facename, encoding) couple virtual bool EnumerateEncodings(const wxString& facename = wxEmptyString); // callbacks which are called after one of EnumerateXXX() functions from // above is invoked - all of them may return false to stop enumeration or // true to continue with it // called by EnumerateFacenames virtual bool OnFacename(const wxString& WXUNUSED(facename)) { return true; } // called by EnumerateEncodings virtual bool OnFontEncoding(const wxString& WXUNUSED(facename), const wxString& WXUNUSED(encoding)) { return true; } // convenience function that returns array of facenames. static wxArrayString GetFacenames(wxFontEncoding encoding = wxFONTENCODING_SYSTEM, // all bool fixedWidthOnly = false); // convenience function that returns array of all available encodings. static wxArrayString GetEncodings(const wxString& facename = wxEmptyString); // convenience function that returns true if the given face name exist // in the user's system static bool IsValidFacename(const wxString &str); // Invalidate cache used by some of the methods of this class internally. // This should be called if the list of the fonts available on the system // changes, for whatever reason. static void InvalidateCache(); private: #ifdef wxHAS_UTF8_FONTS // helper for ports that only use UTF-8 encoding natively bool EnumerateEncodingsUTF8(const wxString& facename); #endif wxDECLARE_NO_COPY_CLASS(wxFontEnumerator); }; #endif // wxUSE_FONTENUM #endif // _WX_FONTENUM_H_
h
rticonnextdds-usecases
data/projects/rticonnextdds-usecases/VehicleTracking/ExampleCode/thirdparty/wxWidgets-3.1.2/Linux/include/wx/textwrapper.h
/////////////////////////////////////////////////////////////////////////////// // Name: wx/textwrapper.h // Purpose: declaration of wxTextWrapper class // Author: Vadim Zeitlin // Created: 2009-05-31 (extracted from dlgcmn.cpp via wx/private/stattext.h) // Copyright: (c) 1999, 2009 Vadim Zeitlin <[email protected]> // Licence: wxWindows licence /////////////////////////////////////////////////////////////////////////////// #ifndef _WX_TEXTWRAPPER_H_ #define _WX_TEXTWRAPPER_H_ #include "wx/window.h" // ---------------------------------------------------------------------------- // wxTextWrapper // ---------------------------------------------------------------------------- // this class is used to wrap the text on word boundary: wrapping is done by // calling OnStartLine() and OnOutputLine() functions class WXDLLIMPEXP_CORE wxTextWrapper { public: wxTextWrapper() { m_eol = false; } // win is used for getting the font, text is the text to wrap, width is the // max line width or -1 to disable wrapping void Wrap(wxWindow *win, const wxString& text, int widthMax); // we don't need it, but just to avoid compiler warnings virtual ~wxTextWrapper() { } protected: // line may be empty virtual void OnOutputLine(const wxString& line) = 0; // called at the start of every new line (except the very first one) virtual void OnNewLine() { } private: // call OnOutputLine() and set m_eol to true void DoOutputLine(const wxString& line) { OnOutputLine(line); m_eol = true; } // this function is a destructive inspector: when it returns true it also // resets the flag to false so calling it again wouldn't return true any // more bool IsStartOfNewLine() { if ( !m_eol ) return false; m_eol = false; return true; } bool m_eol; wxDECLARE_NO_COPY_CLASS(wxTextWrapper); }; #if wxUSE_STATTEXT #include "wx/sizer.h" #include "wx/stattext.h" // A class creating a sizer with one static text per line of text. Creation of // the controls used for each line can be customized by overriding // OnCreateLine() function. // // This class is currently private to wxWidgets and used only by wxDialog // itself. We may make it public later if there is sufficient interest. class wxTextSizerWrapper : public wxTextWrapper { public: wxTextSizerWrapper(wxWindow *win) { m_win = win; m_hLine = 0; } wxSizer *CreateSizer(const wxString& text, int widthMax) { m_sizer = new wxBoxSizer(wxVERTICAL); Wrap(m_win, text, widthMax); return m_sizer; } wxWindow *GetParent() const { return m_win; } protected: virtual wxWindow *OnCreateLine(const wxString& line) { return new wxStaticText(m_win, wxID_ANY, wxControl::EscapeMnemonics(line)); } virtual void OnOutputLine(const wxString& line) wxOVERRIDE { if ( !line.empty() ) { m_sizer->Add(OnCreateLine(line)); } else // empty line, no need to create a control for it { if ( !m_hLine ) m_hLine = m_win->GetCharHeight(); m_sizer->Add(5, m_hLine); } } private: wxWindow *m_win; wxSizer *m_sizer; int m_hLine; }; #endif // wxUSE_STATTEXT #endif // _WX_TEXTWRAPPER_H_
h
rticonnextdds-usecases
data/projects/rticonnextdds-usecases/VehicleTracking/ExampleCode/thirdparty/wxWidgets-3.1.2/Linux/include/wx/headercol.h
/////////////////////////////////////////////////////////////////////////////// // Name: wx/headercol.h // Purpose: declaration of wxHeaderColumn class // Author: Vadim Zeitlin // Created: 2008-12-02 // Copyright: (c) 2008 Vadim Zeitlin <[email protected]> // Licence: wxWindows licence /////////////////////////////////////////////////////////////////////////////// #ifndef _WX_HEADERCOL_H_ #define _WX_HEADERCOL_H_ #include "wx/bitmap.h" #if wxUSE_HEADERCTRL // ---------------------------------------------------------------------------- // constants // ---------------------------------------------------------------------------- enum { // special value for column width meaning unspecified/default wxCOL_WIDTH_DEFAULT = -1, // size the column automatically to fit all values wxCOL_WIDTH_AUTOSIZE = -2 }; // bit masks for the various column attributes enum { // column can be resized (included in default flags) wxCOL_RESIZABLE = 1, // column can be clicked to toggle the sort order by its contents wxCOL_SORTABLE = 2, // column can be dragged to change its order (included in default) wxCOL_REORDERABLE = 4, // column is not shown at all wxCOL_HIDDEN = 8, // default flags for wxHeaderColumn ctor wxCOL_DEFAULT_FLAGS = wxCOL_RESIZABLE | wxCOL_REORDERABLE }; // ---------------------------------------------------------------------------- // wxHeaderColumn: interface for a column in a header of controls such as // wxListCtrl, wxDataViewCtrl or wxGrid // ---------------------------------------------------------------------------- class WXDLLIMPEXP_CORE wxHeaderColumn { public: // ctors and dtor // -------------- /* Derived classes must provide ctors with the following signatures (notice that they shouldn't be explicit to allow passing strings/bitmaps directly to methods such wxHeaderCtrl::AppendColumn()): wxHeaderColumn(const wxString& title, int width = wxCOL_WIDTH_DEFAULT, wxAlignment align = wxALIGN_NOT, int flags = wxCOL_DEFAULT_FLAGS); wxHeaderColumn(const wxBitmap &bitmap, int width = wxDVC_DEFAULT_WIDTH, wxAlignment align = wxALIGN_CENTER, int flags = wxCOL_DEFAULT_FLAGS); */ // virtual dtor for the base class to avoid gcc warnings even though we // don't normally delete the objects of this class via a pointer to // wxHeaderColumn so it's not necessary, strictly speaking virtual ~wxHeaderColumn() { } // getters for various attributes // ------------------------------ // notice that wxHeaderColumn only provides getters as this is all the // wxHeaderCtrl needs, various derived class must also provide some way to // change these attributes but this can be done either at the column level // (in which case they should inherit from wxSettableHeaderColumn) or via // the methods of the main control in which case you don't need setters in // the column class at all // title is the string shown for this column virtual wxString GetTitle() const = 0; // bitmap shown (instead of text) in the column header virtual wxBitmap GetBitmap() const = 0; \ // width of the column in pixels, can be set to wxCOL_WIDTH_DEFAULT meaning // unspecified/default virtual int GetWidth() const = 0; // minimal width can be set for resizable columns to forbid resizing them // below the specified size (set to 0 to remove) virtual int GetMinWidth() const = 0; // alignment of the text: wxALIGN_CENTRE, wxALIGN_LEFT or wxALIGN_RIGHT virtual wxAlignment GetAlignment() const = 0; // flags manipulations: // -------------------- // notice that while we make GetFlags() pure virtual here and implement the // individual flags access in terms of it, for some derived classes it is // more natural to implement access to each flag individually, in which // case they can use our GetFromIndividualFlags() helper below to implement // GetFlags() // retrieve all column flags at once: combination of wxCOL_XXX values above virtual int GetFlags() const = 0; bool HasFlag(int flag) const { return (GetFlags() & flag) != 0; } // wxCOL_RESIZABLE virtual bool IsResizeable() const { return HasFlag(wxCOL_RESIZABLE); } // wxCOL_SORTABLE virtual bool IsSortable() const { return HasFlag(wxCOL_SORTABLE); } // wxCOL_REORDERABLE virtual bool IsReorderable() const { return HasFlag(wxCOL_REORDERABLE); } // wxCOL_HIDDEN virtual bool IsHidden() const { return HasFlag(wxCOL_HIDDEN); } bool IsShown() const { return !IsHidden(); } // sorting // ------- // return true if the column is the one currently used for sorting virtual bool IsSortKey() const = 0; // for sortable columns indicate whether we should sort in ascending or // descending order (this should only be taken into account if IsSortKey()) virtual bool IsSortOrderAscending() const = 0; protected: // helper for the class overriding IsXXX() int GetFromIndividualFlags() const; }; // ---------------------------------------------------------------------------- // wxSettableHeaderColumn: column which allows to change its fields too // ---------------------------------------------------------------------------- class WXDLLIMPEXP_CORE wxSettableHeaderColumn : public wxHeaderColumn { public: virtual void SetTitle(const wxString& title) = 0; virtual void SetBitmap(const wxBitmap& bitmap) = 0; virtual void SetWidth(int width) = 0; virtual void SetMinWidth(int minWidth) = 0; virtual void SetAlignment(wxAlignment align) = 0; // see comment for wxHeaderColumn::GetFlags() about the relationship // between SetFlags() and Set{Sortable,Reorderable,...} // change, set, clear, toggle or test for any individual flag virtual void SetFlags(int flags) = 0; void ChangeFlag(int flag, bool set); void SetFlag(int flag); void ClearFlag(int flag); void ToggleFlag(int flag); virtual void SetResizeable(bool resizable) { ChangeFlag(wxCOL_RESIZABLE, resizable); } virtual void SetSortable(bool sortable) { ChangeFlag(wxCOL_SORTABLE, sortable); } virtual void SetReorderable(bool reorderable) { ChangeFlag(wxCOL_REORDERABLE, reorderable); } virtual void SetHidden(bool hidden) { ChangeFlag(wxCOL_HIDDEN, hidden); } // This function can be called to indicate that this column is not used for // sorting any more. Under some platforms it's not necessary to do anything // in this case as just setting another column as a sort key takes care of // everything but under MSW we currently need to call this explicitly to // reset the sort indicator displayed on the column. virtual void UnsetAsSortKey() { } virtual void SetSortOrder(bool ascending) = 0; void ToggleSortOrder() { SetSortOrder(!IsSortOrderAscending()); } protected: // helper for the class overriding individual SetXXX() methods instead of // overriding SetFlags() void SetIndividualFlags(int flags); }; // ---------------------------------------------------------------------------- // wxHeaderColumnSimple: trivial generic implementation of wxHeaderColumn // ---------------------------------------------------------------------------- class wxHeaderColumnSimple : public wxSettableHeaderColumn { public: // ctors and dtor wxHeaderColumnSimple(const wxString& title, int width = wxCOL_WIDTH_DEFAULT, wxAlignment align = wxALIGN_NOT, int flags = wxCOL_DEFAULT_FLAGS) : m_title(title), m_width(width), m_align(align), m_flags(flags) { Init(); } wxHeaderColumnSimple(const wxBitmap& bitmap, int width = wxCOL_WIDTH_DEFAULT, wxAlignment align = wxALIGN_CENTER, int flags = wxCOL_DEFAULT_FLAGS) : m_bitmap(bitmap), m_width(width), m_align(align), m_flags(flags) { Init(); } // implement base class pure virtuals virtual void SetTitle(const wxString& title) wxOVERRIDE { m_title = title; } virtual wxString GetTitle() const wxOVERRIDE { return m_title; } virtual void SetBitmap(const wxBitmap& bitmap) wxOVERRIDE { m_bitmap = bitmap; } wxBitmap GetBitmap() const wxOVERRIDE { return m_bitmap; } virtual void SetWidth(int width) wxOVERRIDE { m_width = width; } virtual int GetWidth() const wxOVERRIDE { return m_width; } virtual void SetMinWidth(int minWidth) wxOVERRIDE { m_minWidth = minWidth; } virtual int GetMinWidth() const wxOVERRIDE { return m_minWidth; } virtual void SetAlignment(wxAlignment align) wxOVERRIDE { m_align = align; } virtual wxAlignment GetAlignment() const wxOVERRIDE { return m_align; } virtual void SetFlags(int flags) wxOVERRIDE { m_flags = flags; } virtual int GetFlags() const wxOVERRIDE { return m_flags; } virtual bool IsSortKey() const wxOVERRIDE { return m_sort; } virtual void UnsetAsSortKey() wxOVERRIDE { m_sort = false; } virtual void SetSortOrder(bool ascending) wxOVERRIDE { m_sort = true; m_sortAscending = ascending; } virtual bool IsSortOrderAscending() const wxOVERRIDE { return m_sortAscending; } private: // common part of all ctors void Init() { m_minWidth = 0; m_sort = false; m_sortAscending = true; } wxString m_title; wxBitmap m_bitmap; int m_width, m_minWidth; wxAlignment m_align; int m_flags; bool m_sort, m_sortAscending; }; #endif // wxUSE_HEADERCTRL #endif // _WX_HEADERCOL_H_
h
rticonnextdds-usecases
data/projects/rticonnextdds-usecases/VehicleTracking/ExampleCode/thirdparty/wxWidgets-3.1.2/Linux/include/wx/prntbase.h
///////////////////////////////////////////////////////////////////////////// // Name: wx/prntbase.h // Purpose: Base classes for printing framework // Author: Julian Smart // Modified by: // Created: 01/02/97 // Copyright: (c) Julian Smart // Licence: wxWindows licence ///////////////////////////////////////////////////////////////////////////// #ifndef _WX_PRNTBASEH__ #define _WX_PRNTBASEH__ #include "wx/defs.h" #if wxUSE_PRINTING_ARCHITECTURE #include "wx/event.h" #include "wx/cmndata.h" #include "wx/panel.h" #include "wx/scrolwin.h" #include "wx/dialog.h" #include "wx/frame.h" #include "wx/dc.h" class WXDLLIMPEXP_FWD_CORE wxDC; class WXDLLIMPEXP_FWD_CORE wxButton; class WXDLLIMPEXP_FWD_CORE wxChoice; class WXDLLIMPEXP_FWD_CORE wxPrintout; class WXDLLIMPEXP_FWD_CORE wxPrinterBase; class WXDLLIMPEXP_FWD_CORE wxPrintDialogBase; class WXDLLIMPEXP_FWD_CORE wxPrintDialog; class WXDLLIMPEXP_FWD_CORE wxPageSetupDialogBase; class WXDLLIMPEXP_FWD_CORE wxPageSetupDialog; class WXDLLIMPEXP_FWD_CORE wxPrintPreviewBase; class WXDLLIMPEXP_FWD_CORE wxPreviewCanvas; class WXDLLIMPEXP_FWD_CORE wxPreviewControlBar; class WXDLLIMPEXP_FWD_CORE wxPreviewFrame; class WXDLLIMPEXP_FWD_CORE wxPrintFactory; class WXDLLIMPEXP_FWD_CORE wxPrintNativeDataBase; class WXDLLIMPEXP_FWD_CORE wxPrintPreview; class WXDLLIMPEXP_FWD_CORE wxPrintAbortDialog; class WXDLLIMPEXP_FWD_CORE wxStaticText; class wxPrintPageMaxCtrl; class wxPrintPageTextCtrl; //---------------------------------------------------------------------------- // error consts //---------------------------------------------------------------------------- enum wxPrinterError { wxPRINTER_NO_ERROR = 0, wxPRINTER_CANCELLED, wxPRINTER_ERROR }; // Preview frame modality kind used with wxPreviewFrame::Initialize() enum wxPreviewFrameModalityKind { // Disable all the other top level windows while the preview is shown. wxPreviewFrame_AppModal, // Disable only the parent window while the preview is shown. wxPreviewFrame_WindowModal, // Don't disable any windows. wxPreviewFrame_NonModal }; //---------------------------------------------------------------------------- // wxPrintFactory //---------------------------------------------------------------------------- class WXDLLIMPEXP_CORE wxPrintFactory { public: wxPrintFactory() {} virtual ~wxPrintFactory() {} virtual wxPrinterBase *CreatePrinter( wxPrintDialogData* data ) = 0; virtual wxPrintPreviewBase *CreatePrintPreview( wxPrintout *preview, wxPrintout *printout = NULL, wxPrintDialogData *data = NULL ) = 0; virtual wxPrintPreviewBase *CreatePrintPreview( wxPrintout *preview, wxPrintout *printout, wxPrintData *data ) = 0; virtual wxPrintDialogBase *CreatePrintDialog( wxWindow *parent, wxPrintDialogData *data = NULL ) = 0; virtual wxPrintDialogBase *CreatePrintDialog( wxWindow *parent, wxPrintData *data ) = 0; virtual wxPageSetupDialogBase *CreatePageSetupDialog( wxWindow *parent, wxPageSetupDialogData * data = NULL ) = 0; virtual wxDCImpl* CreatePrinterDCImpl( wxPrinterDC *owner, const wxPrintData& data ) = 0; // What to do and what to show in the wxPrintDialog // a) Use the generic print setup dialog or a native one? virtual bool HasPrintSetupDialog() = 0; virtual wxDialog *CreatePrintSetupDialog( wxWindow *parent, wxPrintData *data ) = 0; // b) Provide the "print to file" option ourselves or via print setup? virtual bool HasOwnPrintToFile() = 0; // c) Show current printer virtual bool HasPrinterLine() = 0; virtual wxString CreatePrinterLine() = 0; // d) Show Status line for current printer? virtual bool HasStatusLine() = 0; virtual wxString CreateStatusLine() = 0; virtual wxPrintNativeDataBase *CreatePrintNativeData() = 0; static void SetPrintFactory( wxPrintFactory *factory ); static wxPrintFactory *GetFactory(); private: static wxPrintFactory *m_factory; }; class WXDLLIMPEXP_CORE wxNativePrintFactory: public wxPrintFactory { public: virtual wxPrinterBase *CreatePrinter( wxPrintDialogData *data ) wxOVERRIDE; virtual wxPrintPreviewBase *CreatePrintPreview( wxPrintout *preview, wxPrintout *printout = NULL, wxPrintDialogData *data = NULL ) wxOVERRIDE; virtual wxPrintPreviewBase *CreatePrintPreview( wxPrintout *preview, wxPrintout *printout, wxPrintData *data ) wxOVERRIDE; virtual wxPrintDialogBase *CreatePrintDialog( wxWindow *parent, wxPrintDialogData *data = NULL ) wxOVERRIDE; virtual wxPrintDialogBase *CreatePrintDialog( wxWindow *parent, wxPrintData *data ) wxOVERRIDE; virtual wxPageSetupDialogBase *CreatePageSetupDialog( wxWindow *parent, wxPageSetupDialogData * data = NULL ) wxOVERRIDE; virtual wxDCImpl* CreatePrinterDCImpl( wxPrinterDC *owner, const wxPrintData& data ) wxOVERRIDE; virtual bool HasPrintSetupDialog() wxOVERRIDE; virtual wxDialog *CreatePrintSetupDialog( wxWindow *parent, wxPrintData *data ) wxOVERRIDE; virtual bool HasOwnPrintToFile() wxOVERRIDE; virtual bool HasPrinterLine() wxOVERRIDE; virtual wxString CreatePrinterLine() wxOVERRIDE; virtual bool HasStatusLine() wxOVERRIDE; virtual wxString CreateStatusLine() wxOVERRIDE; virtual wxPrintNativeDataBase *CreatePrintNativeData() wxOVERRIDE; }; //---------------------------------------------------------------------------- // wxPrintNativeDataBase //---------------------------------------------------------------------------- class WXDLLIMPEXP_CORE wxPrintNativeDataBase: public wxObject { public: wxPrintNativeDataBase(); virtual ~wxPrintNativeDataBase() {} virtual bool TransferTo( wxPrintData &data ) = 0; virtual bool TransferFrom( const wxPrintData &data ) = 0; #ifdef __WXOSX__ // in order to expose functionality already to the result type of the ..PrintData->GetNativeData() virtual void TransferFrom( const wxPageSetupDialogData * ) = 0; virtual void TransferTo( wxPageSetupDialogData * ) = 0; #endif virtual bool Ok() const { return IsOk(); } virtual bool IsOk() const = 0; int m_ref; private: wxDECLARE_CLASS(wxPrintNativeDataBase); wxDECLARE_NO_COPY_CLASS(wxPrintNativeDataBase); }; //---------------------------------------------------------------------------- // wxPrinterBase //---------------------------------------------------------------------------- /* * Represents the printer: manages printing a wxPrintout object */ class WXDLLIMPEXP_CORE wxPrinterBase: public wxObject { public: wxPrinterBase(wxPrintDialogData *data = NULL); virtual ~wxPrinterBase(); virtual wxPrintAbortDialog *CreateAbortWindow(wxWindow *parent, wxPrintout *printout); virtual void ReportError(wxWindow *parent, wxPrintout *printout, const wxString& message); virtual wxPrintDialogData& GetPrintDialogData() const; bool GetAbort() const { return sm_abortIt; } static wxPrinterError GetLastError() { return sm_lastError; } /////////////////////////////////////////////////////////////////////////// // OVERRIDES virtual bool Setup(wxWindow *parent) = 0; virtual bool Print(wxWindow *parent, wxPrintout *printout, bool prompt = true) = 0; virtual wxDC* PrintDialog(wxWindow *parent) = 0; protected: wxPrintDialogData m_printDialogData; wxPrintout* m_currentPrintout; static wxPrinterError sm_lastError; public: static wxWindow* sm_abortWindow; static bool sm_abortIt; private: wxDECLARE_CLASS(wxPrinterBase); wxDECLARE_NO_COPY_CLASS(wxPrinterBase); }; //---------------------------------------------------------------------------- // wxPrinter //---------------------------------------------------------------------------- class WXDLLIMPEXP_CORE wxPrinter: public wxPrinterBase { public: wxPrinter(wxPrintDialogData *data = NULL); virtual ~wxPrinter(); virtual wxPrintAbortDialog *CreateAbortWindow(wxWindow *parent, wxPrintout *printout) wxOVERRIDE; virtual void ReportError(wxWindow *parent, wxPrintout *printout, const wxString& message) wxOVERRIDE; virtual bool Setup(wxWindow *parent) wxOVERRIDE; virtual bool Print(wxWindow *parent, wxPrintout *printout, bool prompt = true) wxOVERRIDE; virtual wxDC* PrintDialog(wxWindow *parent) wxOVERRIDE; virtual wxPrintDialogData& GetPrintDialogData() const wxOVERRIDE; protected: wxPrinterBase *m_pimpl; private: wxDECLARE_CLASS(wxPrinter); wxDECLARE_NO_COPY_CLASS(wxPrinter); }; //---------------------------------------------------------------------------- // wxPrintout //---------------------------------------------------------------------------- /* * Represents an object via which a document may be printed. * The programmer derives from this, overrides (at least) OnPrintPage, * and passes it to a wxPrinter object for printing, or a wxPrintPreview * object for previewing. */ class WXDLLIMPEXP_CORE wxPrintout: public wxObject { public: wxPrintout(const wxString& title = wxGetTranslation("Printout")); virtual ~wxPrintout(); virtual bool OnBeginDocument(int startPage, int endPage); virtual void OnEndDocument(); virtual void OnBeginPrinting(); virtual void OnEndPrinting(); // Guaranteed to be before any other functions are called virtual void OnPreparePrinting() { } virtual bool HasPage(int page); virtual bool OnPrintPage(int page) = 0; virtual void GetPageInfo(int *minPage, int *maxPage, int *pageFrom, int *pageTo); virtual wxString GetTitle() const { return m_printoutTitle; } // Port-specific code should call this function to initialize this object // with everything it needs, instead of using individual accessors below. bool SetUp(wxDC& dc); wxDC *GetDC() const { return m_printoutDC; } void SetDC(wxDC *dc) { m_printoutDC = dc; } void FitThisSizeToPaper(const wxSize& imageSize); void FitThisSizeToPage(const wxSize& imageSize); void FitThisSizeToPageMargins(const wxSize& imageSize, const wxPageSetupDialogData& pageSetupData); void MapScreenSizeToPaper(); void MapScreenSizeToPage(); void MapScreenSizeToPageMargins(const wxPageSetupDialogData& pageSetupData); void MapScreenSizeToDevice(); wxRect GetLogicalPaperRect() const; wxRect GetLogicalPageRect() const; wxRect GetLogicalPageMarginsRect(const wxPageSetupDialogData& pageSetupData) const; void SetLogicalOrigin(wxCoord x, wxCoord y); void OffsetLogicalOrigin(wxCoord xoff, wxCoord yoff); void SetPageSizePixels(int w, int h) { m_pageWidthPixels = w; m_pageHeightPixels = h; } void GetPageSizePixels(int *w, int *h) const { *w = m_pageWidthPixels; *h = m_pageHeightPixels; } void SetPageSizeMM(int w, int h) { m_pageWidthMM = w; m_pageHeightMM = h; } void GetPageSizeMM(int *w, int *h) const { *w = m_pageWidthMM; *h = m_pageHeightMM; } void SetPPIScreen(int x, int y) { m_PPIScreenX = x; m_PPIScreenY = y; } void SetPPIScreen(const wxSize& ppi) { SetPPIScreen(ppi.x, ppi.y); } void GetPPIScreen(int *x, int *y) const { *x = m_PPIScreenX; *y = m_PPIScreenY; } void SetPPIPrinter(int x, int y) { m_PPIPrinterX = x; m_PPIPrinterY = y; } void SetPPIPrinter(const wxSize& ppi) { SetPPIPrinter(ppi.x, ppi.y); } void GetPPIPrinter(int *x, int *y) const { *x = m_PPIPrinterX; *y = m_PPIPrinterY; } void SetPaperRectPixels(const wxRect& paperRectPixels) { m_paperRectPixels = paperRectPixels; } wxRect GetPaperRectPixels() const { return m_paperRectPixels; } // This must be called by wxPrintPreview to associate itself with the // printout it uses. virtual void SetPreview(wxPrintPreview *preview) { m_preview = preview; } wxPrintPreview *GetPreview() const { return m_preview; } virtual bool IsPreview() const { return GetPreview() != NULL; } private: wxString m_printoutTitle; wxDC* m_printoutDC; wxPrintPreview *m_preview; int m_pageWidthPixels; int m_pageHeightPixels; int m_pageWidthMM; int m_pageHeightMM; int m_PPIScreenX; int m_PPIScreenY; int m_PPIPrinterX; int m_PPIPrinterY; wxRect m_paperRectPixels; private: wxDECLARE_ABSTRACT_CLASS(wxPrintout); wxDECLARE_NO_COPY_CLASS(wxPrintout); }; //---------------------------------------------------------------------------- // wxPreviewCanvas //---------------------------------------------------------------------------- /* * Canvas upon which a preview is drawn. */ class WXDLLIMPEXP_CORE wxPreviewCanvas: public wxScrolledWindow { public: wxPreviewCanvas(wxPrintPreviewBase *preview, wxWindow *parent, const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxDefaultSize, long style = 0, const wxString& name = wxT("canvas")); virtual ~wxPreviewCanvas(); void SetPreview(wxPrintPreviewBase *preview) { m_printPreview = preview; } void OnPaint(wxPaintEvent& event); void OnChar(wxKeyEvent &event); // Responds to colour changes void OnSysColourChanged(wxSysColourChangedEvent& event); private: #if wxUSE_MOUSEWHEEL void OnMouseWheel(wxMouseEvent& event); #endif // wxUSE_MOUSEWHEEL void OnIdle(wxIdleEvent& event); wxPrintPreviewBase* m_printPreview; wxDECLARE_CLASS(wxPreviewCanvas); wxDECLARE_EVENT_TABLE(); wxDECLARE_NO_COPY_CLASS(wxPreviewCanvas); }; //---------------------------------------------------------------------------- // wxPreviewFrame //---------------------------------------------------------------------------- /* * Default frame for showing preview. */ class WXDLLIMPEXP_CORE wxPreviewFrame: public wxFrame { public: wxPreviewFrame(wxPrintPreviewBase *preview, wxWindow *parent, const wxString& title = wxGetTranslation("Print Preview"), const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxDefaultSize, long style = wxDEFAULT_FRAME_STYLE | wxFRAME_FLOAT_ON_PARENT, const wxString& name = wxFrameNameStr); virtual ~wxPreviewFrame(); // Either Initialize() or InitializeWithModality() must be called before // showing the preview frame, the former being just a particular case of // the latter initializing the frame for being showing app-modally. // Notice that we must keep Initialize() with its existing signature to // avoid breaking the old code that overrides it and we can't reuse the // same name for the other functions to avoid virtual function hiding // problem and the associated warnings given by some compilers (e.g. from // g++ with -Woverloaded-virtual). virtual void Initialize() { InitializeWithModality(wxPreviewFrame_AppModal); } // Also note that this method is not virtual as it doesn't need to be // overridden: it's never called by wxWidgets (of course, the same is true // for Initialize() but, again, it must remain virtual for compatibility). void InitializeWithModality(wxPreviewFrameModalityKind kind); void OnCloseWindow(wxCloseEvent& event); virtual void CreateCanvas(); virtual void CreateControlBar(); inline wxPreviewControlBar* GetControlBar() const { return m_controlBar; } protected: wxPreviewCanvas* m_previewCanvas; wxPreviewControlBar* m_controlBar; wxPrintPreviewBase* m_printPreview; wxWindowDisabler* m_windowDisabler; wxPreviewFrameModalityKind m_modalityKind; private: void OnChar(wxKeyEvent& event); wxDECLARE_EVENT_TABLE(); wxDECLARE_CLASS(wxPreviewFrame); wxDECLARE_NO_COPY_CLASS(wxPreviewFrame); }; //---------------------------------------------------------------------------- // wxPreviewControlBar //---------------------------------------------------------------------------- /* * A panel with buttons for controlling a print preview. * The programmer may wish to use other means for controlling * the print preview. */ #define wxPREVIEW_PRINT 1 #define wxPREVIEW_PREVIOUS 2 #define wxPREVIEW_NEXT 4 #define wxPREVIEW_ZOOM 8 #define wxPREVIEW_FIRST 16 #define wxPREVIEW_LAST 32 #define wxPREVIEW_GOTO 64 #define wxPREVIEW_DEFAULT (wxPREVIEW_PREVIOUS|wxPREVIEW_NEXT|wxPREVIEW_ZOOM\ |wxPREVIEW_FIRST|wxPREVIEW_GOTO|wxPREVIEW_LAST) // Ids for controls #define wxID_PREVIEW_CLOSE 1 #define wxID_PREVIEW_NEXT 2 #define wxID_PREVIEW_PREVIOUS 3 #define wxID_PREVIEW_PRINT 4 #define wxID_PREVIEW_ZOOM 5 #define wxID_PREVIEW_FIRST 6 #define wxID_PREVIEW_LAST 7 #define wxID_PREVIEW_GOTO 8 #define wxID_PREVIEW_ZOOM_IN 9 #define wxID_PREVIEW_ZOOM_OUT 10 class WXDLLIMPEXP_CORE wxPreviewControlBar: public wxPanel { wxDECLARE_CLASS(wxPreviewControlBar); public: wxPreviewControlBar(wxPrintPreviewBase *preview, long buttons, wxWindow *parent, const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxDefaultSize, long style = wxTAB_TRAVERSAL, const wxString& name = wxT("panel")); virtual ~wxPreviewControlBar(); virtual void CreateButtons(); virtual void SetPageInfo(int minPage, int maxPage); virtual void SetZoomControl(int zoom); virtual int GetZoomControl(); virtual wxPrintPreviewBase *GetPrintPreview() const { return m_printPreview; } // Implementation only from now on. void OnWindowClose(wxCommandEvent& event); void OnNext(); void OnPrevious(); void OnFirst(); void OnLast(); void OnGotoPage(); void OnPrint(); void OnPrintButton(wxCommandEvent& WXUNUSED(event)) { OnPrint(); } void OnNextButton(wxCommandEvent & WXUNUSED(event)) { OnNext(); } void OnPreviousButton(wxCommandEvent & WXUNUSED(event)) { OnPrevious(); } void OnFirstButton(wxCommandEvent & WXUNUSED(event)) { OnFirst(); } void OnLastButton(wxCommandEvent & WXUNUSED(event)) { OnLast(); } void OnPaint(wxPaintEvent& event); void OnUpdateNextButton(wxUpdateUIEvent& event) { event.Enable(IsNextEnabled()); } void OnUpdatePreviousButton(wxUpdateUIEvent& event) { event.Enable(IsPreviousEnabled()); } void OnUpdateFirstButton(wxUpdateUIEvent& event) { event.Enable(IsFirstEnabled()); } void OnUpdateLastButton(wxUpdateUIEvent& event) { event.Enable(IsLastEnabled()); } void OnUpdateZoomInButton(wxUpdateUIEvent& event) { event.Enable(IsZoomInEnabled()); } void OnUpdateZoomOutButton(wxUpdateUIEvent& event) { event.Enable(IsZoomOutEnabled()); } // These methods are not private because they are called by wxPreviewCanvas. void DoZoomIn(); void DoZoomOut(); protected: wxPrintPreviewBase* m_printPreview; wxButton* m_closeButton; wxChoice* m_zoomControl; wxPrintPageTextCtrl* m_currentPageText; wxPrintPageMaxCtrl* m_maxPageText; long m_buttonFlags; private: void DoGotoPage(int page); void DoZoom(); bool IsNextEnabled() const; bool IsPreviousEnabled() const; bool IsFirstEnabled() const; bool IsLastEnabled() const; bool IsZoomInEnabled() const; bool IsZoomOutEnabled() const; void OnZoomInButton(wxCommandEvent & WXUNUSED(event)) { DoZoomIn(); } void OnZoomOutButton(wxCommandEvent & WXUNUSED(event)) { DoZoomOut(); } void OnZoomChoice(wxCommandEvent& WXUNUSED(event)) { DoZoom(); } wxDECLARE_EVENT_TABLE(); wxDECLARE_NO_COPY_CLASS(wxPreviewControlBar); }; //---------------------------------------------------------------------------- // wxPrintPreviewBase //---------------------------------------------------------------------------- /* * Programmer creates an object of this class to preview a wxPrintout. */ class WXDLLIMPEXP_CORE wxPrintPreviewBase: public wxObject { public: wxPrintPreviewBase(wxPrintout *printout, wxPrintout *printoutForPrinting = NULL, wxPrintDialogData *data = NULL); wxPrintPreviewBase(wxPrintout *printout, wxPrintout *printoutForPrinting, wxPrintData *data); virtual ~wxPrintPreviewBase(); virtual bool SetCurrentPage(int pageNum); virtual int GetCurrentPage() const; virtual void SetPrintout(wxPrintout *printout); virtual wxPrintout *GetPrintout() const; virtual wxPrintout *GetPrintoutForPrinting() const; virtual void SetFrame(wxFrame *frame); virtual void SetCanvas(wxPreviewCanvas *canvas); virtual wxFrame *GetFrame() const; virtual wxPreviewCanvas *GetCanvas() const; // This is a helper routine, used by the next 4 routines. virtual void CalcRects(wxPreviewCanvas *canvas, wxRect& printableAreaRect, wxRect& paperRect); // The preview canvas should call this from OnPaint virtual bool PaintPage(wxPreviewCanvas *canvas, wxDC& dc); // Updates rendered page by calling RenderPage() if needed, returns true // if there was some change. Preview canvas should call it at idle time virtual bool UpdatePageRendering(); // This draws a blank page onto the preview canvas virtual bool DrawBlankPage(wxPreviewCanvas *canvas, wxDC& dc); // Adjusts the scrollbars for the current scale virtual void AdjustScrollbars(wxPreviewCanvas *canvas); // This is called by wxPrintPreview to render a page into a wxMemoryDC. virtual bool RenderPage(int pageNum); virtual void SetZoom(int percent); virtual int GetZoom() const; virtual wxPrintDialogData& GetPrintDialogData(); virtual int GetMaxPage() const; virtual int GetMinPage() const; virtual bool Ok() const { return IsOk(); } virtual bool IsOk() const; virtual void SetOk(bool ok); /////////////////////////////////////////////////////////////////////////// // OVERRIDES // If we own a wxPrintout that can be used for printing, this // will invoke the actual printing procedure. Called // by the wxPreviewControlBar. virtual bool Print(bool interactive) = 0; // Calculate scaling that needs to be done to get roughly // the right scaling for the screen pretending to be // the currently selected printer. virtual void DetermineScaling() = 0; protected: // helpers for RenderPage(): virtual bool RenderPageIntoDC(wxDC& dc, int pageNum); // renders preview into m_previewBitmap virtual bool RenderPageIntoBitmap(wxBitmap& bmp, int pageNum); void InvalidatePreviewBitmap(); protected: wxPrintDialogData m_printDialogData; wxPreviewCanvas* m_previewCanvas; wxFrame* m_previewFrame; wxBitmap* m_previewBitmap; bool m_previewFailed; wxPrintout* m_previewPrintout; wxPrintout* m_printPrintout; int m_currentPage; int m_currentZoom; float m_previewScaleX; float m_previewScaleY; int m_topMargin; int m_leftMargin; int m_pageWidth; int m_pageHeight; int m_minPage; int m_maxPage; bool m_isOk; bool m_printingPrepared; // Called OnPreparePrinting? private: void Init(wxPrintout *printout, wxPrintout *printoutForPrinting); wxDECLARE_NO_COPY_CLASS(wxPrintPreviewBase); wxDECLARE_CLASS(wxPrintPreviewBase); }; //---------------------------------------------------------------------------- // wxPrintPreview //---------------------------------------------------------------------------- class WXDLLIMPEXP_CORE wxPrintPreview: public wxPrintPreviewBase { public: wxPrintPreview(wxPrintout *printout, wxPrintout *printoutForPrinting = NULL, wxPrintDialogData *data = NULL); wxPrintPreview(wxPrintout *printout, wxPrintout *printoutForPrinting, wxPrintData *data); virtual ~wxPrintPreview(); virtual bool SetCurrentPage(int pageNum) wxOVERRIDE; virtual int GetCurrentPage() const wxOVERRIDE; virtual void SetPrintout(wxPrintout *printout) wxOVERRIDE; virtual wxPrintout *GetPrintout() const wxOVERRIDE; virtual wxPrintout *GetPrintoutForPrinting() const wxOVERRIDE; virtual void SetFrame(wxFrame *frame) wxOVERRIDE; virtual void SetCanvas(wxPreviewCanvas *canvas) wxOVERRIDE; virtual wxFrame *GetFrame() const wxOVERRIDE; virtual wxPreviewCanvas *GetCanvas() const wxOVERRIDE; virtual bool PaintPage(wxPreviewCanvas *canvas, wxDC& dc) wxOVERRIDE; virtual bool UpdatePageRendering() wxOVERRIDE; virtual bool DrawBlankPage(wxPreviewCanvas *canvas, wxDC& dc) wxOVERRIDE; virtual void AdjustScrollbars(wxPreviewCanvas *canvas) wxOVERRIDE; virtual bool RenderPage(int pageNum) wxOVERRIDE; virtual void SetZoom(int percent) wxOVERRIDE; virtual int GetZoom() const wxOVERRIDE; virtual bool Print(bool interactive) wxOVERRIDE; virtual void DetermineScaling() wxOVERRIDE; virtual wxPrintDialogData& GetPrintDialogData() wxOVERRIDE; virtual int GetMaxPage() const wxOVERRIDE; virtual int GetMinPage() const wxOVERRIDE; virtual bool Ok() const wxOVERRIDE { return IsOk(); } virtual bool IsOk() const wxOVERRIDE; virtual void SetOk(bool ok) wxOVERRIDE; private: wxPrintPreviewBase *m_pimpl; private: wxDECLARE_CLASS(wxPrintPreview); wxDECLARE_NO_COPY_CLASS(wxPrintPreview); }; //---------------------------------------------------------------------------- // wxPrintAbortDialog //---------------------------------------------------------------------------- class WXDLLIMPEXP_CORE wxPrintAbortDialog: public wxDialog { public: wxPrintAbortDialog(wxWindow *parent, const wxString& documentTitle, const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxDefaultSize, long style = wxDEFAULT_DIALOG_STYLE, const wxString& name = wxT("dialog")); void SetProgress(int currentPage, int totalPages, int currentCopy, int totalCopies); void OnCancel(wxCommandEvent& event); private: wxStaticText *m_progress; wxDECLARE_EVENT_TABLE(); wxDECLARE_NO_COPY_CLASS(wxPrintAbortDialog); }; #endif // wxUSE_PRINTING_ARCHITECTURE #endif // _WX_PRNTBASEH__
h
rticonnextdds-usecases
data/projects/rticonnextdds-usecases/VehicleTracking/ExampleCode/thirdparty/wxWidgets-3.1.2/Linux/include/wx/validate.h
///////////////////////////////////////////////////////////////////////////// // Name: wx/validate.h // Purpose: wxValidator class // Author: Julian Smart // Modified by: // Created: 29/01/98 // Copyright: (c) 1998 Julian Smart // Licence: wxWindows licence ///////////////////////////////////////////////////////////////////////////// #ifndef _WX_VALIDATE_H_ #define _WX_VALIDATE_H_ #include "wx/defs.h" #if wxUSE_VALIDATORS #include "wx/event.h" class WXDLLIMPEXP_FWD_CORE wxWindow; class WXDLLIMPEXP_FWD_CORE wxWindowBase; /* A validator has up to three purposes: 1) To validate the data in the window that's associated with the validator. 2) To transfer data to and from the window. 3) To filter input, using its role as a wxEvtHandler to intercept e.g. OnChar. Note that wxValidator and derived classes use reference counting. */ class WXDLLIMPEXP_CORE wxValidator : public wxEvtHandler { public: wxValidator(); wxValidator(const wxValidator& other) : wxEvtHandler() , m_validatorWindow(other.m_validatorWindow) { } virtual ~wxValidator(); // Make a clone of this validator (or return NULL) - currently necessary // if you're passing a reference to a validator. // Another possibility is to always pass a pointer to a new validator // (so the calling code can use a copy constructor of the relevant class). virtual wxObject *Clone() const { return NULL; } bool Copy(const wxValidator& val) { m_validatorWindow = val.m_validatorWindow; return true; } // Called when the value in the window must be validated. // This function can pop up an error message. virtual bool Validate(wxWindow *WXUNUSED(parent)) { return false; } // Called to transfer data to the window virtual bool TransferToWindow() { return false; } // Called to transfer data from the window virtual bool TransferFromWindow() { return false; } // Called when the validator is associated with a window, may be useful to // override if it needs to somehow initialize the window. virtual void SetWindow(wxWindow *win) { m_validatorWindow = win; } // accessors wxWindow *GetWindow() const { return m_validatorWindow; } // validators beep by default if invalid key is pressed, this function // allows to change this static void SuppressBellOnError(bool suppress = true) { ms_isSilent = suppress; } // test if beep is currently disabled static bool IsSilent() { return ms_isSilent; } // this function is deprecated because it handled its parameter // unnaturally: it disabled the bell when it was true, not false as could // be expected; use SuppressBellOnError() instead #if WXWIN_COMPATIBILITY_2_8 static wxDEPRECATED_INLINE( void SetBellOnError(bool doIt = true), ms_isSilent = doIt; ) #endif protected: wxWindow *m_validatorWindow; private: static bool ms_isSilent; wxDECLARE_DYNAMIC_CLASS(wxValidator); wxDECLARE_NO_ASSIGN_CLASS(wxValidator); }; extern WXDLLIMPEXP_DATA_CORE(const wxValidator) wxDefaultValidator; #define wxVALIDATOR_PARAM(val) val #else // !wxUSE_VALIDATORS // wxWidgets is compiled without support for wxValidator, but we still // want to be able to pass wxDefaultValidator to the functions which take // a wxValidator parameter to avoid using "#if wxUSE_VALIDATORS" // everywhere class WXDLLIMPEXP_FWD_CORE wxValidator; static const wxValidator* const wxDefaultValidatorPtr = NULL; #define wxDefaultValidator (*wxDefaultValidatorPtr) // this macro allows to avoid warnings about unused parameters when // wxUSE_VALIDATORS == 0 #define wxVALIDATOR_PARAM(val) #endif // wxUSE_VALIDATORS/!wxUSE_VALIDATORS #endif // _WX_VALIDATE_H_
h
rticonnextdds-usecases
data/projects/rticonnextdds-usecases/VehicleTracking/ExampleCode/thirdparty/wxWidgets-3.1.2/Linux/include/wx/wupdlock.h
/////////////////////////////////////////////////////////////////////////////// // Name: wx/wupdlock.h // Purpose: wxWindowUpdateLocker prevents window redrawing // Author: Vadim Zeitlin // Created: 2006-03-06 // Copyright: (c) 2006 Vadim Zeitlin <[email protected]> // Licence: wxWindows licence /////////////////////////////////////////////////////////////////////////////// #ifndef _WX_WUPDLOCK_H_ #define _WX_WUPDLOCK_H_ #include "wx/window.h" // ---------------------------------------------------------------------------- // wxWindowUpdateLocker prevents updates to the window during its lifetime // ---------------------------------------------------------------------------- class wxWindowUpdateLocker { public: // create an object preventing updates of the given window (which must have // a lifetime at least as great as ours) wxWindowUpdateLocker(wxWindow *win) : m_win(win) { win->Freeze(); } // dtor thaws the window to permit updates again ~wxWindowUpdateLocker() { m_win->Thaw(); } private: wxWindow *m_win; wxDECLARE_NO_COPY_CLASS(wxWindowUpdateLocker); }; #endif // _WX_WUPDLOCK_H_
h
rticonnextdds-usecases
data/projects/rticonnextdds-usecases/VehicleTracking/ExampleCode/thirdparty/wxWidgets-3.1.2/Linux/include/wx/fswatcher.h
///////////////////////////////////////////////////////////////////////////// // Name: wx/fswatcher.h // Purpose: wxFileSystemWatcherBase // Author: Bartosz Bekier // Created: 2009-05-23 // Copyright: (c) 2009 Bartosz Bekier <[email protected]> // Licence: wxWindows licence ///////////////////////////////////////////////////////////////////////////// #ifndef _WX_FSWATCHER_BASE_H_ #define _WX_FSWATCHER_BASE_H_ #include "wx/defs.h" #if wxUSE_FSWATCHER #include "wx/log.h" #include "wx/event.h" #include "wx/evtloop.h" #include "wx/filename.h" #include "wx/dir.h" #include "wx/hashmap.h" #define wxTRACE_FSWATCHER "fswatcher" // ---------------------------------------------------------------------------- // wxFileSystemWatcherEventType & wxFileSystemWatcherEvent // ---------------------------------------------------------------------------- /** * Possible types of file system events. * This is a subset that will work fine an all platforms (actually, we will * see how it works on Mac). * * We got 2 types of error events: * - warning: these are not fatal and further events can still be generated * - error: indicates fatal error and causes that no more events will happen */ enum { wxFSW_EVENT_CREATE = 0x01, wxFSW_EVENT_DELETE = 0x02, wxFSW_EVENT_RENAME = 0x04, wxFSW_EVENT_MODIFY = 0x08, wxFSW_EVENT_ACCESS = 0x10, wxFSW_EVENT_ATTRIB = 0x20, // Currently this is wxGTK-only // error events wxFSW_EVENT_WARNING = 0x40, wxFSW_EVENT_ERROR = 0x80, wxFSW_EVENT_ALL = wxFSW_EVENT_CREATE | wxFSW_EVENT_DELETE | wxFSW_EVENT_RENAME | wxFSW_EVENT_MODIFY | wxFSW_EVENT_ACCESS | wxFSW_EVENT_ATTRIB | wxFSW_EVENT_WARNING | wxFSW_EVENT_ERROR #if defined(wxHAS_INOTIFY) || defined(wxHAVE_FSEVENTS_FILE_NOTIFICATIONS) ,wxFSW_EVENT_UNMOUNT = 0x2000 #endif }; // Type of the path watched, used only internally for now. enum wxFSWPathType { wxFSWPath_None, // Invalid value for an initialized watch. wxFSWPath_File, // Plain file. wxFSWPath_Dir, // Watch a directory and the files in it. wxFSWPath_Tree // Watch a directory and all its children recursively. }; // Type of the warning for the events notifying about them. enum wxFSWWarningType { wxFSW_WARNING_NONE, wxFSW_WARNING_GENERAL, wxFSW_WARNING_OVERFLOW }; /** * Event containing information about file system change. */ class WXDLLIMPEXP_FWD_BASE wxFileSystemWatcherEvent; wxDECLARE_EXPORTED_EVENT(WXDLLIMPEXP_BASE, wxEVT_FSWATCHER, wxFileSystemWatcherEvent); class WXDLLIMPEXP_BASE wxFileSystemWatcherEvent: public wxEvent { public: // Constructor for any kind of events, also used as default ctor. wxFileSystemWatcherEvent(int changeType = 0, int watchid = wxID_ANY) : wxEvent(watchid, wxEVT_FSWATCHER), m_changeType(changeType), m_warningType(wxFSW_WARNING_NONE) { } // Constructor for the error or warning events. wxFileSystemWatcherEvent(int changeType, wxFSWWarningType warningType, const wxString& errorMsg = wxString(), int watchid = wxID_ANY) : wxEvent(watchid, wxEVT_FSWATCHER), m_changeType(changeType), m_warningType(warningType), m_errorMsg(errorMsg) { } // Constructor for the normal events carrying information about the changes. wxFileSystemWatcherEvent(int changeType, const wxFileName& path, const wxFileName& newPath, int watchid = wxID_ANY) : wxEvent(watchid, wxEVT_FSWATCHER), m_changeType(changeType), m_warningType(wxFSW_WARNING_NONE), m_path(path), m_newPath(newPath) { } /** * Returns the path at which the event occurred. */ const wxFileName& GetPath() const { return m_path; } /** * Sets the path at which the event occurred */ void SetPath(const wxFileName& path) { m_path = path; } /** * In case of rename(move?) events, returns the new path related to the * event. The "new" means newer in the sense of time. In case of other * events it returns the same path as GetPath(). */ const wxFileName& GetNewPath() const { return m_newPath; } /** * Sets the new path related to the event. See above. */ void SetNewPath(const wxFileName& path) { m_newPath = path; } /** * Returns the type of file system event that occurred. */ int GetChangeType() const { return m_changeType; } virtual wxEvent* Clone() const wxOVERRIDE { wxFileSystemWatcherEvent* evt = new wxFileSystemWatcherEvent(*this); evt->m_errorMsg = m_errorMsg.Clone(); evt->m_path = wxFileName(m_path.GetFullPath().Clone()); evt->m_newPath = wxFileName(m_newPath.GetFullPath().Clone()); evt->m_warningType = m_warningType; return evt; } virtual wxEventCategory GetEventCategory() const wxOVERRIDE { // TODO this has to be merged with "similar" categories and changed return wxEVT_CATEGORY_UNKNOWN; } /** * Returns if this error is an error event */ bool IsError() const { return (m_changeType & (wxFSW_EVENT_ERROR | wxFSW_EVENT_WARNING)) != 0; } wxString GetErrorDescription() const { return m_errorMsg; } wxFSWWarningType GetWarningType() const { return m_warningType; } /** * Returns a wxString describing an event useful for debugging or testing */ wxString ToString() const; protected: int m_changeType; wxFSWWarningType m_warningType; wxFileName m_path; wxFileName m_newPath; wxString m_errorMsg; private: wxDECLARE_DYNAMIC_CLASS_NO_ASSIGN(wxFileSystemWatcherEvent); }; typedef void (wxEvtHandler::*wxFileSystemWatcherEventFunction) (wxFileSystemWatcherEvent&); #define wxFileSystemWatcherEventHandler(func) \ wxEVENT_HANDLER_CAST(wxFileSystemWatcherEventFunction, func) #define EVT_FSWATCHER(winid, func) \ wx__DECLARE_EVT1(wxEVT_FSWATCHER, winid, wxFileSystemWatcherEventHandler(func)) // ---------------------------------------------------------------------------- // wxFileSystemWatcherBase: interface for wxFileSystemWatcher // ---------------------------------------------------------------------------- // Simple container to store information about one watched path. class wxFSWatchInfo { public: wxFSWatchInfo() : m_events(-1), m_type(wxFSWPath_None), m_refcount(-1) { } wxFSWatchInfo(const wxString& path, int events, wxFSWPathType type, const wxString& filespec = wxString()) : m_path(path), m_filespec(filespec), m_events(events), m_type(type), m_refcount(1) { } const wxString& GetPath() const { return m_path; } const wxString& GetFilespec() const { return m_filespec; } int GetFlags() const { return m_events; } wxFSWPathType GetType() const { return m_type; } // Reference counting of watch entries is used to avoid watching the same // file system path multiple times (this can happen even accidentally, e.g. // when you have a recursive watch and then decide to watch some file or // directory under it separately). int IncRef() { return ++m_refcount; } int DecRef() { wxASSERT_MSG( m_refcount > 0, wxS("Trying to decrement a zero count") ); return --m_refcount; } protected: wxString m_path; wxString m_filespec; // For tree watches, holds any filespec to apply int m_events; wxFSWPathType m_type; int m_refcount; }; WX_DECLARE_STRING_HASH_MAP(wxFSWatchInfo, wxFSWatchInfoMap); /** * Encapsulation of platform-specific file system event mechanism */ class wxFSWatcherImpl; /** * Main entry point for clients interested in file system events. * Defines interface that can be used to receive that kind of events. */ class WXDLLIMPEXP_BASE wxFileSystemWatcherBase: public wxEvtHandler { public: wxFileSystemWatcherBase(); virtual ~wxFileSystemWatcherBase(); /** * Adds path to currently watched files. Any events concerning this * particular path will be sent to handler. Optionally a filter can be * specified to receive only events of particular type. * * Please note that when adding a dir, immediate children will be watched * as well. */ virtual bool Add(const wxFileName& path, int events = wxFSW_EVENT_ALL); /** * Like above, but recursively adds every file/dir in the tree rooted in * path. Additionally a file mask can be specified to include only files * of particular type. */ virtual bool AddTree(const wxFileName& path, int events = wxFSW_EVENT_ALL, const wxString& filespec = wxEmptyString); /** * Removes path from the list of watched paths. */ virtual bool Remove(const wxFileName& path); /** * Same as above, but also removes every file belonging to the tree rooted * at path. */ virtual bool RemoveTree(const wxFileName& path); /** * Clears the list of currently watched paths. */ virtual bool RemoveAll(); /** * Returns the number of watched paths */ int GetWatchedPathsCount() const; /** * Retrieves all watched paths and places them in wxArrayString. Returns * the number of paths. * * TODO think about API here: we need to return more information (like is * the path watched recursively) */ int GetWatchedPaths(wxArrayString* paths) const; wxEvtHandler* GetOwner() const { return m_owner; } void SetOwner(wxEvtHandler* handler) { if (!handler) m_owner = this; else m_owner = handler; } // This is a semi-private function used by wxWidgets itself only. // // Delegates the real work of adding the path to wxFSWatcherImpl::Add() and // updates m_watches if the new path was successfully added. bool AddAny(const wxFileName& path, int events, wxFSWPathType type, const wxString& filespec = wxString()); protected: static wxString GetCanonicalPath(const wxFileName& path) { wxFileName path_copy = wxFileName(path); if ( !path_copy.Normalize() ) { wxFAIL_MSG(wxString::Format("Unable to normalize path '%s'", path.GetFullPath())); return wxEmptyString; } return path_copy.GetFullPath(); } wxFSWatchInfoMap m_watches; // path=>wxFSWatchInfo map wxFSWatcherImpl* m_service; // file system events service wxEvtHandler* m_owner; // handler for file system events friend class wxFSWatcherImpl; }; // include the platform specific file defining wxFileSystemWatcher // inheriting from wxFileSystemWatcherBase #ifdef wxHAS_INOTIFY #include "wx/unix/fswatcher_inotify.h" #define wxFileSystemWatcher wxInotifyFileSystemWatcher #elif defined(wxHAS_KQUEUE) && defined(wxHAVE_FSEVENTS_FILE_NOTIFICATIONS) #include "wx/unix/fswatcher_kqueue.h" #include "wx/osx/fswatcher_fsevents.h" #define wxFileSystemWatcher wxFsEventsFileSystemWatcher #elif defined(wxHAS_KQUEUE) #include "wx/unix/fswatcher_kqueue.h" #define wxFileSystemWatcher wxKqueueFileSystemWatcher #elif defined(__WINDOWS__) #include "wx/msw/fswatcher.h" #define wxFileSystemWatcher wxMSWFileSystemWatcher #else #include "wx/generic/fswatcher.h" #define wxFileSystemWatcher wxPollingFileSystemWatcher #endif #endif // wxUSE_FSWATCHER #endif /* _WX_FSWATCHER_BASE_H_ */
h
rticonnextdds-usecases
data/projects/rticonnextdds-usecases/VehicleTracking/ExampleCode/thirdparty/wxWidgets-3.1.2/Linux/include/wx/anystr.h
/////////////////////////////////////////////////////////////////////////////// // Name: wx/anystr.h // Purpose: wxAnyStrPtr class declaration // Author: Vadim Zeitlin // Created: 2009-03-23 // Copyright: (c) 2008 Vadim Zeitlin <[email protected]> // Licence: wxWindows licence /////////////////////////////////////////////////////////////////////////////// #ifndef _WX_ANYSTR_H_ #define _WX_ANYSTR_H_ #include "wx/string.h" // ---------------------------------------------------------------------------- // wxAnyStrPtr // // Notice that this is an internal and intentionally not documented class. It // is only used by wxWidgets itself to ensure compatibility with previous // versions and shouldn't be used by user code. When you see a function // returning it you should just know that you can treat it as a string pointer. // ---------------------------------------------------------------------------- // This is a helper class convertible to either narrow or wide string pointer. // It is similar to wxCStrData but, unlike it, can be NULL which is required to // represent the return value of wxDateTime::ParseXXX() methods for example. // // NB: this class is fully inline and so doesn't need to be DLL-exported class wxAnyStrPtr { public: // ctors: this class must be created from the associated string or using // its default ctor for an invalid NULL-like object; notice that it is // immutable after creation. // ctor for invalid pointer wxAnyStrPtr() : m_str(NULL) { } // ctor for valid pointer into the given string (whose lifetime must be // greater than ours and which should remain constant while we're used) wxAnyStrPtr(const wxString& str, const wxString::const_iterator& iter) : m_str(&str), m_iter(iter) { } // default copy ctor is ok and so is default dtor, in particular we do not // free the string // various operators meant to make this class look like a superposition of // char* and wchar_t* // this one is needed to allow boolean expressions involving these objects, // e.g. "if ( FuncReturningAnyStrPtr() && ... )" (unfortunately using // unspecified_bool_type here wouldn't help with ambiguity between all the // different conversions to pointers) operator bool() const { return m_str != NULL; } // at least VC7 also needs this one or it complains about ambiguity // for !anystr expressions bool operator!() const { return !((bool)*this); } // and these are the conversions operator which allow to assign the result // of FuncReturningAnyStrPtr() to either char* or wxChar* (i.e. wchar_t*) operator const char *() const { if ( !m_str ) return NULL; // check if the string is convertible to char at all // // notice that this pointer points into wxString internal buffer // containing its char* representation and so it can be kept for as // long as wxString is not modified -- which is long enough for our // needs const char *p = m_str->c_str().AsChar(); if ( *p ) { // find the offset of the character corresponding to this iterator // position in bytes: we don't have any direct way to do it so we // need to redo the conversion again for the part of the string // before the iterator to find its length in bytes in current // locale // // NB: conversion won't fail as it succeeded for the entire string p += strlen(wxString(m_str->begin(), m_iter).mb_str()); } //else: conversion failed, return "" as we can't do anything else return p; } operator const wchar_t *() const { if ( !m_str ) return NULL; // no complications with wide strings (as long as we discount // surrogates as we do for now) // // just remember that this works as long as wxString keeps an internal // buffer with its wide wide char representation, just as with AsChar() // above return m_str->c_str().AsWChar() + (m_iter - m_str->begin()); } // Because the objects of this class are only used as return type for // functions which can return NULL we can skip providing dereferencing // operators: the code using this class must test it for NULL first and if // it does anything else with it it has to assign it to either char* or // wchar_t* itself, before dereferencing. // // IOW this // // if ( *FuncReturningAnyStrPtr() ) // // is invalid because it could crash. And this // // const char *p = FuncReturningAnyStrPtr(); // if ( p && *p ) // // already works fine. private: // the original string and the position in it we correspond to, if the // string is NULL this object is NULL pointer-like const wxString * const m_str; const wxString::const_iterator m_iter; wxDECLARE_NO_ASSIGN_CLASS(wxAnyStrPtr); }; #endif // _WX_ANYSTR_H_
h
rticonnextdds-usecases
data/projects/rticonnextdds-usecases/VehicleTracking/ExampleCode/thirdparty/wxWidgets-3.1.2/Linux/include/wx/dir.h
///////////////////////////////////////////////////////////////////////////// // Name: wx/dir.h // Purpose: wxDir is a class for enumerating the files in a directory // Author: Vadim Zeitlin // Modified by: // Created: 08.12.99 // Copyright: (c) 1999 Vadim Zeitlin <[email protected]> // Licence: wxWindows licence ///////////////////////////////////////////////////////////////////////////// #ifndef _WX_DIR_H_ #define _WX_DIR_H_ #include "wx/longlong.h" #include "wx/string.h" #include "wx/filefn.h" // for wxS_DIR_DEFAULT class WXDLLIMPEXP_FWD_BASE wxArrayString; // ---------------------------------------------------------------------------- // constants // ---------------------------------------------------------------------------- // These flags affect the behaviour of GetFirst/GetNext() and Traverse(). // They define what types are included in the list of items they produce. // Note that wxDIR_NO_FOLLOW is relevant only on Unix and ignored under systems // not supporting symbolic links. enum wxDirFlags { wxDIR_FILES = 0x0001, // include files wxDIR_DIRS = 0x0002, // include directories wxDIR_HIDDEN = 0x0004, // include hidden files wxDIR_DOTDOT = 0x0008, // include '.' and '..' wxDIR_NO_FOLLOW = 0x0010, // don't dereference any symlink // by default, enumerate everything except '.' and '..' wxDIR_DEFAULT = wxDIR_FILES | wxDIR_DIRS | wxDIR_HIDDEN }; // these constants are possible return value of wxDirTraverser::OnDir() enum wxDirTraverseResult { wxDIR_IGNORE = -1, // ignore this directory but continue with others wxDIR_STOP, // stop traversing wxDIR_CONTINUE // continue into this directory }; #if wxUSE_LONGLONG // error code of wxDir::GetTotalSize() extern WXDLLIMPEXP_DATA_BASE(const wxULongLong) wxInvalidSize; #endif // wxUSE_LONGLONG // ---------------------------------------------------------------------------- // wxDirTraverser: helper class for wxDir::Traverse() // ---------------------------------------------------------------------------- class WXDLLIMPEXP_BASE wxDirTraverser { public: /// a virtual dtor has been provided since this class has virtual members virtual ~wxDirTraverser() { } // called for each file found by wxDir::Traverse() // // return wxDIR_STOP or wxDIR_CONTINUE from here (wxDIR_IGNORE doesn't // make sense) virtual wxDirTraverseResult OnFile(const wxString& filename) = 0; // called for each directory found by wxDir::Traverse() // // return one of the enum elements defined above virtual wxDirTraverseResult OnDir(const wxString& dirname) = 0; // called for each directory which we couldn't open during our traversal // of the directory tree // // this method can also return either wxDIR_STOP, wxDIR_IGNORE or // wxDIR_CONTINUE but the latter is treated specially: it means to retry // opening the directory and so may lead to infinite loop if it is // returned unconditionally, be careful with this! // // the base class version always returns wxDIR_IGNORE virtual wxDirTraverseResult OnOpenError(const wxString& dirname); }; // ---------------------------------------------------------------------------- // wxDir: portable equivalent of {open/read/close}dir functions // ---------------------------------------------------------------------------- class WXDLLIMPEXP_FWD_BASE wxDirData; class WXDLLIMPEXP_BASE wxDir { public: // ctors // ----- // default, use Open() wxDir() { m_data = NULL; } // opens the directory for enumeration, use IsOpened() to test success wxDir(const wxString& dir); // dtor calls Close() automatically ~wxDir() { Close(); } // open the directory for enumerating bool Open(const wxString& dir); // close the directory, Open() can be called again later void Close(); // returns true if the directory was successfully opened bool IsOpened() const; // get the full name of the directory (without '/' at the end) wxString GetName() const; // Same as GetName() but does include the trailing separator, unless the // string is empty (only for invalid directories). wxString GetNameWithSep() const; // file enumeration routines // ------------------------- // start enumerating all files matching filespec (or all files if it is // empty) and flags, return true on success bool GetFirst(wxString *filename, const wxString& filespec = wxEmptyString, int flags = wxDIR_DEFAULT) const; // get next file in the enumeration started with GetFirst() bool GetNext(wxString *filename) const; // return true if this directory has any files in it bool HasFiles(const wxString& spec = wxEmptyString) const; // return true if this directory has any subdirectories bool HasSubDirs(const wxString& spec = wxEmptyString) const; // enumerate all files in this directory and its subdirectories // // return the number of files found size_t Traverse(wxDirTraverser& sink, const wxString& filespec = wxEmptyString, int flags = wxDIR_DEFAULT) const; // simplest version of Traverse(): get the names of all files under this // directory into filenames array, return the number of files static size_t GetAllFiles(const wxString& dirname, wxArrayString *files, const wxString& filespec = wxEmptyString, int flags = wxDIR_DEFAULT); // check if there any files matching the given filespec under the given // directory (i.e. searches recursively), return the file path if found or // empty string otherwise static wxString FindFirst(const wxString& dirname, const wxString& filespec, int flags = wxDIR_DEFAULT); #if wxUSE_LONGLONG // returns the size of all directories recursively found in given path static wxULongLong GetTotalSize(const wxString &dir, wxArrayString *filesSkipped = NULL); #endif // wxUSE_LONGLONG // static utilities for directory management // (alias to wxFileName's functions for dirs) // ----------------------------------------- // test for existence of a directory with the given name static bool Exists(const wxString& dir); static bool Make(const wxString &dir, int perm = wxS_DIR_DEFAULT, int flags = 0); static bool Remove(const wxString &dir, int flags = 0); private: friend class wxDirData; wxDirData *m_data; wxDECLARE_NO_COPY_CLASS(wxDir); }; #endif // _WX_DIR_H_
h
rticonnextdds-usecases
data/projects/rticonnextdds-usecases/VehicleTracking/ExampleCode/thirdparty/wxWidgets-3.1.2/Linux/include/wx/paper.h
///////////////////////////////////////////////////////////////////////////// // Name: wx/paper.h // Purpose: Paper database types and classes // Author: Julian Smart // Modified by: // Created: 01/02/97 // Copyright: (c) Julian Smart // Licence: wxWindows licence ///////////////////////////////////////////////////////////////////////////// #ifndef _WX_PAPERH__ #define _WX_PAPERH__ #include "wx/defs.h" #include "wx/event.h" #include "wx/cmndata.h" #include "wx/intl.h" #include "wx/hashmap.h" /* * Paper type: see defs.h for wxPaperSize enum. * A wxPrintPaperType can have an id and a name, or just a name and wxPAPER_NONE, * so you can add further paper types without needing new ids. */ #ifdef __WXMSW__ #define WXADDPAPER(paperId, platformId, name, w, h) AddPaperType(paperId, platformId, name, w, h) #else #define WXADDPAPER(paperId, platformId, name, w, h) AddPaperType(paperId, 0, name, w, h) #endif class WXDLLIMPEXP_CORE wxPrintPaperType: public wxObject { public: wxPrintPaperType(); // platformId is a platform-specific id, such as in Windows, DMPAPER_... wxPrintPaperType(wxPaperSize paperId, int platformId, const wxString& name, int w, int h); inline wxString GetName() const { return wxGetTranslation(m_paperName); } inline wxPaperSize GetId() const { return m_paperId; } inline int GetPlatformId() const { return m_platformId; } // Get width and height in tenths of a millimetre inline int GetWidth() const { return m_width; } inline int GetHeight() const { return m_height; } // Get size in tenths of a millimetre inline wxSize GetSize() const { return wxSize(m_width, m_height); } // Get size in a millimetres inline wxSize GetSizeMM() const { return wxSize(m_width/10, m_height/10); } // Get width and height in device units (1/72th of an inch) wxSize GetSizeDeviceUnits() const ; public: wxPaperSize m_paperId; int m_platformId; int m_width; // In tenths of a millimetre int m_height; // In tenths of a millimetre wxString m_paperName; private: wxDECLARE_DYNAMIC_CLASS(wxPrintPaperType); }; WX_DECLARE_STRING_HASH_MAP(wxPrintPaperType*, wxStringToPrintPaperTypeHashMap); class WXDLLIMPEXP_FWD_CORE wxPrintPaperTypeList; class WXDLLIMPEXP_CORE wxPrintPaperDatabase { public: wxPrintPaperDatabase(); ~wxPrintPaperDatabase(); void CreateDatabase(); void ClearDatabase(); void AddPaperType(wxPaperSize paperId, const wxString& name, int w, int h); void AddPaperType(wxPaperSize paperId, int platformId, const wxString& name, int w, int h); // Find by name wxPrintPaperType *FindPaperType(const wxString& name); // Find by size id wxPrintPaperType *FindPaperType(wxPaperSize id); // Find by platform id wxPrintPaperType *FindPaperTypeByPlatformId(int id); // Find by size wxPrintPaperType *FindPaperType(const wxSize& size); // Convert name to size id wxPaperSize ConvertNameToId(const wxString& name); // Convert size id to name wxString ConvertIdToName(wxPaperSize paperId); // Get the paper size wxSize GetSize(wxPaperSize paperId); // Get the paper size wxPaperSize GetSize(const wxSize& size); // wxPrintPaperType* Item(size_t index) const; size_t GetCount() const; private: wxStringToPrintPaperTypeHashMap* m_map; wxPrintPaperTypeList* m_list; //wxDECLARE_DYNAMIC_CLASS(wxPrintPaperDatabase); }; extern WXDLLIMPEXP_DATA_CORE(wxPrintPaperDatabase*) wxThePrintPaperDatabase; #endif // _WX_PAPERH__
h
rticonnextdds-usecases
data/projects/rticonnextdds-usecases/VehicleTracking/ExampleCode/thirdparty/wxWidgets-3.1.2/Linux/include/wx/zipstrm.h
///////////////////////////////////////////////////////////////////////////// // Name: wx/zipstrm.h // Purpose: Streams for Zip files // Author: Mike Wetherell // Copyright: (c) Mike Wetherell // Licence: wxWindows licence ///////////////////////////////////////////////////////////////////////////// #ifndef _WX_WXZIPSTREAM_H__ #define _WX_WXZIPSTREAM_H__ #include "wx/defs.h" #if wxUSE_ZIPSTREAM #include "wx/archive.h" #include "wx/filename.h" // some methods from wxZipInputStream and wxZipOutputStream stream do not get // exported/imported when compiled with Mingw versions before 3.4.2. So they // are imported/exported individually as a workaround #if (defined(__GNUWIN32__) || defined(__MINGW32__)) \ && (!defined __GNUC__ \ || !defined __GNUC_MINOR__ \ || !defined __GNUC_PATCHLEVEL__ \ || __GNUC__ * 10000 + __GNUC_MINOR__ * 100 + __GNUC_PATCHLEVEL__ < 30402) #define WXZIPFIX WXDLLIMPEXP_BASE #else #define WXZIPFIX #endif ///////////////////////////////////////////////////////////////////////////// // constants // Compression Method, only 0 (store) and 8 (deflate) are supported here // enum wxZipMethod { wxZIP_METHOD_STORE, wxZIP_METHOD_SHRINK, wxZIP_METHOD_REDUCE1, wxZIP_METHOD_REDUCE2, wxZIP_METHOD_REDUCE3, wxZIP_METHOD_REDUCE4, wxZIP_METHOD_IMPLODE, wxZIP_METHOD_TOKENIZE, wxZIP_METHOD_DEFLATE, wxZIP_METHOD_DEFLATE64, wxZIP_METHOD_BZIP2 = 12, wxZIP_METHOD_DEFAULT = 0xffff }; // Originating File-System. // // These are Pkware's values. Note that Info-zip disagree on some of them, // most notably NTFS. // enum wxZipSystem { wxZIP_SYSTEM_MSDOS, wxZIP_SYSTEM_AMIGA, wxZIP_SYSTEM_OPENVMS, wxZIP_SYSTEM_UNIX, wxZIP_SYSTEM_VM_CMS, wxZIP_SYSTEM_ATARI_ST, wxZIP_SYSTEM_OS2_HPFS, wxZIP_SYSTEM_MACINTOSH, wxZIP_SYSTEM_Z_SYSTEM, wxZIP_SYSTEM_CPM, wxZIP_SYSTEM_WINDOWS_NTFS, wxZIP_SYSTEM_MVS, wxZIP_SYSTEM_VSE, wxZIP_SYSTEM_ACORN_RISC, wxZIP_SYSTEM_VFAT, wxZIP_SYSTEM_ALTERNATE_MVS, wxZIP_SYSTEM_BEOS, wxZIP_SYSTEM_TANDEM, wxZIP_SYSTEM_OS_400 }; // Dos/Win file attributes // enum wxZipAttributes { wxZIP_A_RDONLY = 0x01, wxZIP_A_HIDDEN = 0x02, wxZIP_A_SYSTEM = 0x04, wxZIP_A_SUBDIR = 0x10, wxZIP_A_ARCH = 0x20, wxZIP_A_MASK = 0x37 }; // Values for the flags field in the zip headers // enum wxZipFlags { wxZIP_ENCRYPTED = 0x0001, wxZIP_DEFLATE_NORMAL = 0x0000, // normal compression wxZIP_DEFLATE_EXTRA = 0x0002, // extra compression wxZIP_DEFLATE_FAST = 0x0004, // fast compression wxZIP_DEFLATE_SUPERFAST = 0x0006, // superfast compression wxZIP_DEFLATE_MASK = 0x0006, wxZIP_SUMS_FOLLOW = 0x0008, // crc and sizes come after the data wxZIP_ENHANCED = 0x0010, wxZIP_PATCH = 0x0020, wxZIP_STRONG_ENC = 0x0040, wxZIP_LANG_ENC_UTF8 = 0x0800, // filename and comment are UTF8 wxZIP_UNUSED = 0x0F80, wxZIP_RESERVED = 0xF000 }; enum wxZipArchiveFormat { /// Default zip format wxZIP_FORMAT_DEFAULT, /// ZIP64 format wxZIP_FORMAT_ZIP64 }; // Forward decls // class WXDLLIMPEXP_FWD_BASE wxZipEntry; class WXDLLIMPEXP_FWD_BASE wxZipInputStream; ///////////////////////////////////////////////////////////////////////////// // wxZipNotifier class WXDLLIMPEXP_BASE wxZipNotifier { public: virtual ~wxZipNotifier() { } virtual void OnEntryUpdated(wxZipEntry& entry) = 0; }; ///////////////////////////////////////////////////////////////////////////// // Zip Entry - holds the meta data for a file in the zip class wxDataOutputStream; class WXDLLIMPEXP_BASE wxZipEntry : public wxArchiveEntry { public: wxZipEntry(const wxString& name = wxEmptyString, const wxDateTime& dt = wxDateTime::Now(), wxFileOffset size = wxInvalidOffset); virtual ~wxZipEntry(); wxZipEntry(const wxZipEntry& entry); wxZipEntry& operator=(const wxZipEntry& entry); // Get accessors wxDateTime GetDateTime() const wxOVERRIDE { return m_DateTime; } wxFileOffset GetSize() const wxOVERRIDE { return m_Size; } wxFileOffset GetOffset() const wxOVERRIDE { return m_Offset; } wxString GetInternalName() const wxOVERRIDE { return m_Name; } int GetMethod() const { return m_Method; } int GetFlags() const { return m_Flags; } wxUint32 GetCrc() const { return m_Crc; } wxFileOffset GetCompressedSize() const { return m_CompressedSize; } int GetSystemMadeBy() const { return m_SystemMadeBy; } wxString GetComment() const { return m_Comment; } wxUint32 GetExternalAttributes() const { return m_ExternalAttributes; } wxPathFormat GetInternalFormat() const wxOVERRIDE { return wxPATH_UNIX; } int GetMode() const; const char *GetLocalExtra() const; size_t GetLocalExtraLen() const; const char *GetExtra() const; size_t GetExtraLen() const; wxString GetName(wxPathFormat format = wxPATH_NATIVE) const wxOVERRIDE; // is accessors inline bool IsDir() const wxOVERRIDE; inline bool IsText() const; inline bool IsReadOnly() const wxOVERRIDE; inline bool IsMadeByUnix() const; // set accessors void SetDateTime(const wxDateTime& dt) wxOVERRIDE { m_DateTime = dt; } void SetSize(wxFileOffset size) wxOVERRIDE { m_Size = size; } void SetMethod(int method) { m_Method = (wxUint16)method; } void SetComment(const wxString& comment) { m_Comment = comment; } void SetExternalAttributes(wxUint32 attr ) { m_ExternalAttributes = attr; } void SetSystemMadeBy(int system); void SetMode(int mode); void SetExtra(const char *extra, size_t len); void SetLocalExtra(const char *extra, size_t len); inline void SetName(const wxString& name, wxPathFormat format = wxPATH_NATIVE) wxOVERRIDE; static wxString GetInternalName(const wxString& name, wxPathFormat format = wxPATH_NATIVE, bool *pIsDir = NULL); // set is accessors void SetIsDir(bool isDir = true) wxOVERRIDE; inline void SetIsReadOnly(bool isReadOnly = true) wxOVERRIDE; inline void SetIsText(bool isText = true); wxZipEntry *Clone() const { return ZipClone(); } void SetNotifier(wxZipNotifier& notifier); void UnsetNotifier() wxOVERRIDE; protected: // Internal attributes enum { TEXT_ATTR = 1 }; // protected Get accessors int GetVersionNeeded() const { return m_VersionNeeded; } wxFileOffset GetKey() const { return m_Key; } int GetVersionMadeBy() const { return m_VersionMadeBy; } int GetDiskStart() const { return m_DiskStart; } int GetInternalAttributes() const { return m_InternalAttributes; } void SetVersionNeeded(int version) { m_VersionNeeded = (wxUint16)version; } void SetOffset(wxFileOffset offset) wxOVERRIDE { m_Offset = offset; } void SetFlags(int flags) { m_Flags = (wxUint16)flags; } void SetVersionMadeBy(int version) { m_VersionMadeBy = (wxUint8)version; } void SetCrc(wxUint32 crc) { m_Crc = crc; } void SetCompressedSize(wxFileOffset size) { m_CompressedSize = size; } void SetKey(wxFileOffset offset) { m_Key = offset; } void SetDiskStart(int start) { m_DiskStart = (wxUint16)start; } void SetInternalAttributes(int attr) { m_InternalAttributes = (wxUint16)attr; } virtual wxZipEntry *ZipClone() const { return new wxZipEntry(*this); } void Notify(); private: wxArchiveEntry* DoClone() const wxOVERRIDE { return ZipClone(); } size_t ReadLocal(wxInputStream& stream, wxMBConv& conv); size_t WriteLocal(wxOutputStream& stream, wxMBConv& conv, wxZipArchiveFormat zipFormat); size_t ReadCentral(wxInputStream& stream, wxMBConv& conv); size_t WriteCentral(wxOutputStream& stream, wxMBConv& conv) const; size_t ReadDescriptor(wxInputStream& stream); size_t WriteDescriptor(wxOutputStream& stream, wxUint32 crc, wxFileOffset compressedSize, wxFileOffset size); void WriteLocalFileSizes(wxDataOutputStream& ds) const; void WriteLocalZip64ExtraInfo(wxOutputStream& stream) const; bool LoadExtraInfo(const char* extraData, wxUint16 extraLen, bool localInfo); wxUint16 GetInternalFlags(bool checkForUTF8) const; wxUint8 m_SystemMadeBy; // one of enum wxZipSystem wxUint8 m_VersionMadeBy; // major * 10 + minor wxUint16 m_VersionNeeded; // ver needed to extract (20 i.e. v2.0) wxUint16 m_Flags; wxUint16 m_Method; // compression method (one of wxZipMethod) wxDateTime m_DateTime; wxUint32 m_Crc; wxFileOffset m_CompressedSize; wxFileOffset m_Size; wxString m_Name; // in internal format wxFileOffset m_Key; // the original offset for copied entries wxFileOffset m_Offset; // file offset of the entry wxString m_Comment; wxUint16 m_DiskStart; // for multidisk archives, not unsupported wxUint16 m_InternalAttributes; // bit 0 set for text files wxUint32 m_ExternalAttributes; // system specific depends on SystemMadeBy wxUint16 m_z64infoOffset; // Offset of ZIP64 local extra data for file sizes class wxZipMemory *m_Extra; class wxZipMemory *m_LocalExtra; wxZipNotifier *m_zipnotifier; class wxZipWeakLinks *m_backlink; friend class wxZipInputStream; friend class wxZipOutputStream; wxDECLARE_DYNAMIC_CLASS(wxZipEntry); }; ///////////////////////////////////////////////////////////////////////////// // wxZipOutputStream WX_DECLARE_LIST_WITH_DECL(wxZipEntry, wxZipEntryList_, class WXDLLIMPEXP_BASE); class WXDLLIMPEXP_BASE wxZipOutputStream : public wxArchiveOutputStream { public: wxZipOutputStream(wxOutputStream& stream, int level = -1, wxMBConv& conv = wxConvUTF8); wxZipOutputStream(wxOutputStream *stream, int level = -1, wxMBConv& conv = wxConvUTF8); virtual WXZIPFIX ~wxZipOutputStream(); bool PutNextEntry(wxZipEntry *entry) { return DoCreate(entry); } bool WXZIPFIX PutNextEntry(const wxString& name, const wxDateTime& dt = wxDateTime::Now(), wxFileOffset size = wxInvalidOffset) wxOVERRIDE; bool WXZIPFIX PutNextDirEntry(const wxString& name, const wxDateTime& dt = wxDateTime::Now()) wxOVERRIDE; bool WXZIPFIX CopyEntry(wxZipEntry *entry, wxZipInputStream& inputStream); bool WXZIPFIX CopyArchiveMetaData(wxZipInputStream& inputStream); void WXZIPFIX Sync() wxOVERRIDE; bool WXZIPFIX CloseEntry() wxOVERRIDE; bool WXZIPFIX Close() wxOVERRIDE; void SetComment(const wxString& comment) { m_Comment = comment; } int GetLevel() const { return m_level; } void WXZIPFIX SetLevel(int level); void SetFormat(wxZipArchiveFormat format) { m_format = format; } wxZipArchiveFormat GetFormat() const { return m_format; } protected: virtual size_t WXZIPFIX OnSysWrite(const void *buffer, size_t size) wxOVERRIDE; virtual wxFileOffset OnSysTell() const wxOVERRIDE { return m_entrySize; } // this protected interface isn't yet finalised struct Buffer { const char *m_data; size_t m_size; }; virtual wxOutputStream* WXZIPFIX OpenCompressor(wxOutputStream& stream, wxZipEntry& entry, const Buffer bufs[]); virtual bool WXZIPFIX CloseCompressor(wxOutputStream *comp); bool IsParentSeekable() const { return m_offsetAdjustment != wxInvalidOffset; } private: void Init(int level); bool WXZIPFIX PutNextEntry(wxArchiveEntry *entry) wxOVERRIDE; bool WXZIPFIX CopyEntry(wxArchiveEntry *entry, wxArchiveInputStream& stream) wxOVERRIDE; bool WXZIPFIX CopyArchiveMetaData(wxArchiveInputStream& stream) wxOVERRIDE; bool IsOpened() const { return m_comp || m_pending; } bool DoCreate(wxZipEntry *entry, bool raw = false); void CreatePendingEntry(const void *buffer, size_t size); void CreatePendingEntry(); class wxStoredOutputStream *m_store; class wxZlibOutputStream2 *m_deflate; class wxZipStreamLink *m_backlink; wxZipEntryList_ m_entries; char *m_initialData; size_t m_initialSize; wxZipEntry *m_pending; bool m_raw; wxFileOffset m_headerOffset; size_t m_headerSize; wxFileOffset m_entrySize; wxUint32 m_crcAccumulator; wxOutputStream *m_comp; int m_level; wxFileOffset m_offsetAdjustment; wxString m_Comment; bool m_endrecWritten; wxZipArchiveFormat m_format; wxDECLARE_NO_COPY_CLASS(wxZipOutputStream); }; ///////////////////////////////////////////////////////////////////////////// // wxZipInputStream class WXDLLIMPEXP_BASE wxZipInputStream : public wxArchiveInputStream { public: typedef wxZipEntry entry_type; wxZipInputStream(wxInputStream& stream, wxMBConv& conv = wxConvLocal); wxZipInputStream(wxInputStream *stream, wxMBConv& conv = wxConvLocal); virtual WXZIPFIX ~wxZipInputStream(); bool OpenEntry(wxZipEntry& entry) { return DoOpen(&entry); } bool WXZIPFIX CloseEntry() wxOVERRIDE; wxZipEntry *GetNextEntry(); wxString WXZIPFIX GetComment(); int WXZIPFIX GetTotalEntries(); virtual wxFileOffset GetLength() const wxOVERRIDE { return m_entry.GetSize(); } protected: size_t WXZIPFIX OnSysRead(void *buffer, size_t size) wxOVERRIDE; wxFileOffset OnSysTell() const wxOVERRIDE { return m_decomp ? m_decomp->TellI() : 0; } // this protected interface isn't yet finalised virtual wxInputStream* WXZIPFIX OpenDecompressor(wxInputStream& stream); virtual bool WXZIPFIX CloseDecompressor(wxInputStream *decomp); private: void Init(); void Init(const wxString& file); wxArchiveEntry *DoGetNextEntry() wxOVERRIDE { return GetNextEntry(); } bool WXZIPFIX OpenEntry(wxArchiveEntry& entry) wxOVERRIDE; wxStreamError ReadLocal(bool readEndRec = false); wxStreamError ReadCentral(); wxUint32 ReadSignature(); bool FindEndRecord(); bool LoadEndRecord(); bool AtHeader() const { return m_headerSize == 0; } bool AfterHeader() const { return m_headerSize > 0 && !m_decomp; } bool IsOpened() const { return m_decomp != NULL; } wxZipStreamLink *MakeLink(wxZipOutputStream *out); bool DoOpen(wxZipEntry *entry = NULL, bool raw = false); bool OpenDecompressor(bool raw = false); class wxStoredInputStream *m_store; class wxZlibInputStream2 *m_inflate; class wxRawInputStream *m_rawin; wxZipEntry m_entry; bool m_raw; size_t m_headerSize; wxUint32 m_crcAccumulator; wxInputStream *m_decomp; bool m_parentSeekable; class wxZipWeakLinks *m_weaklinks; class wxZipStreamLink *m_streamlink; wxFileOffset m_offsetAdjustment; wxFileOffset m_position; wxUint32 m_signature; size_t m_TotalEntries; wxString m_Comment; friend bool wxZipOutputStream::CopyEntry( wxZipEntry *entry, wxZipInputStream& inputStream); friend bool wxZipOutputStream::CopyArchiveMetaData( wxZipInputStream& inputStream); wxDECLARE_NO_COPY_CLASS(wxZipInputStream); }; ///////////////////////////////////////////////////////////////////////////// // Iterators #if wxUSE_STL || defined WX_TEST_ARCHIVE_ITERATOR typedef wxArchiveIterator<wxZipInputStream> wxZipIter; typedef wxArchiveIterator<wxZipInputStream, std::pair<wxString, wxZipEntry*> > wxZipPairIter; #endif ///////////////////////////////////////////////////////////////////////////// // wxZipClassFactory class WXDLLIMPEXP_BASE wxZipClassFactory : public wxArchiveClassFactory { public: typedef wxZipEntry entry_type; typedef wxZipInputStream instream_type; typedef wxZipOutputStream outstream_type; typedef wxZipNotifier notifier_type; #if wxUSE_STL || defined WX_TEST_ARCHIVE_ITERATOR typedef wxZipIter iter_type; typedef wxZipPairIter pairiter_type; #endif wxZipClassFactory(); wxZipEntry *NewEntry() const { return new wxZipEntry; } wxZipInputStream *NewStream(wxInputStream& stream) const { return new wxZipInputStream(stream, GetConv()); } wxZipOutputStream *NewStream(wxOutputStream& stream) const { return new wxZipOutputStream(stream, -1, GetConv()); } wxZipInputStream *NewStream(wxInputStream *stream) const { return new wxZipInputStream(stream, GetConv()); } wxZipOutputStream *NewStream(wxOutputStream *stream) const { return new wxZipOutputStream(stream, -1, GetConv()); } wxString GetInternalName(const wxString& name, wxPathFormat format = wxPATH_NATIVE) const wxOVERRIDE { return wxZipEntry::GetInternalName(name, format); } const wxChar * const *GetProtocols(wxStreamProtocolType type = wxSTREAM_PROTOCOL) const wxOVERRIDE; protected: wxArchiveEntry *DoNewEntry() const wxOVERRIDE { return NewEntry(); } wxArchiveInputStream *DoNewStream(wxInputStream& stream) const wxOVERRIDE { return NewStream(stream); } wxArchiveOutputStream *DoNewStream(wxOutputStream& stream) const wxOVERRIDE { return NewStream(stream); } wxArchiveInputStream *DoNewStream(wxInputStream *stream) const wxOVERRIDE { return NewStream(stream); } wxArchiveOutputStream *DoNewStream(wxOutputStream *stream) const wxOVERRIDE { return NewStream(stream); } private: wxDECLARE_DYNAMIC_CLASS(wxZipClassFactory); }; ///////////////////////////////////////////////////////////////////////////// // wxZipEntry inlines inline bool wxZipEntry::IsText() const { return (m_InternalAttributes & TEXT_ATTR) != 0; } inline bool wxZipEntry::IsDir() const { return (m_ExternalAttributes & wxZIP_A_SUBDIR) != 0; } inline bool wxZipEntry::IsReadOnly() const { return (m_ExternalAttributes & wxZIP_A_RDONLY) != 0; } inline bool wxZipEntry::IsMadeByUnix() const { switch ( m_SystemMadeBy ) { case wxZIP_SYSTEM_MSDOS: // note: some unix zippers put madeby = dos return (m_ExternalAttributes & ~0xFFFF) != 0; case wxZIP_SYSTEM_OPENVMS: case wxZIP_SYSTEM_UNIX: case wxZIP_SYSTEM_ATARI_ST: case wxZIP_SYSTEM_ACORN_RISC: case wxZIP_SYSTEM_BEOS: case wxZIP_SYSTEM_TANDEM: return true; case wxZIP_SYSTEM_AMIGA: case wxZIP_SYSTEM_VM_CMS: case wxZIP_SYSTEM_OS2_HPFS: case wxZIP_SYSTEM_MACINTOSH: case wxZIP_SYSTEM_Z_SYSTEM: case wxZIP_SYSTEM_CPM: case wxZIP_SYSTEM_WINDOWS_NTFS: case wxZIP_SYSTEM_MVS: case wxZIP_SYSTEM_VSE: case wxZIP_SYSTEM_VFAT: case wxZIP_SYSTEM_ALTERNATE_MVS: case wxZIP_SYSTEM_OS_400: return false; } // Unknown system, assume not Unix. return false; } inline void wxZipEntry::SetIsText(bool isText) { if (isText) m_InternalAttributes |= TEXT_ATTR; else m_InternalAttributes &= ~TEXT_ATTR; } inline void wxZipEntry::SetIsReadOnly(bool isReadOnly) { if (isReadOnly) SetMode(GetMode() & ~0222); else SetMode(GetMode() | 0200); } inline void wxZipEntry::SetName(const wxString& name, wxPathFormat format /*=wxPATH_NATIVE*/) { bool isDir; m_Name = GetInternalName(name, format, &isDir); SetIsDir(isDir); } #endif // wxUSE_ZIPSTREAM #endif // _WX_WXZIPSTREAM_H__
h
rticonnextdds-usecases
data/projects/rticonnextdds-usecases/VehicleTracking/ExampleCode/thirdparty/wxWidgets-3.1.2/Linux/include/wx/xrc/xh_grid.h
///////////////////////////////////////////////////////////////////////////// // Name: wx/xrc/xh_grid.h // Purpose: XML resource handler for wxGrid // Author: Agron Selimaj // Created: 2005/08/11 // Copyright: (c) 2005 Agron Selimaj, Freepour Controls Inc. // Licence: wxWindows licence ///////////////////////////////////////////////////////////////////////////// #ifndef _WX_XH_GRD_H_ #define _WX_XH_GRD_H_ #include "wx/xrc/xmlres.h" #if wxUSE_XRC && wxUSE_GRID class WXDLLIMPEXP_XRC wxGridXmlHandler : public wxXmlResourceHandler { wxDECLARE_DYNAMIC_CLASS(wxGridXmlHandler); public: wxGridXmlHandler(); virtual wxObject *DoCreateResource() wxOVERRIDE; virtual bool CanHandle(wxXmlNode *node) wxOVERRIDE; }; #endif // wxUSE_XRC && wxUSE_GRID #endif // _WX_XH_GRD_H_
h
rticonnextdds-usecases
data/projects/rticonnextdds-usecases/VehicleTracking/ExampleCode/thirdparty/wxWidgets-3.1.2/Linux/include/wx/xrc/xh_stlin.h
///////////////////////////////////////////////////////////////////////////// // Name: wx/xrc/xh_stlin.h // Purpose: XML resource handler for wxStaticLine // Author: Vaclav Slavik // Created: 2000/09/00 // Copyright: (c) 2000 Vaclav Slavik // Licence: wxWindows licence ///////////////////////////////////////////////////////////////////////////// #ifndef _WX_XH_STLIN_H_ #define _WX_XH_STLIN_H_ #include "wx/xrc/xmlres.h" #if wxUSE_XRC && wxUSE_STATLINE class WXDLLIMPEXP_XRC wxStaticLineXmlHandler : public wxXmlResourceHandler { wxDECLARE_DYNAMIC_CLASS(wxStaticLineXmlHandler); public: wxStaticLineXmlHandler(); virtual wxObject *DoCreateResource() wxOVERRIDE; virtual bool CanHandle(wxXmlNode *node) wxOVERRIDE; }; #endif // wxUSE_XRC && wxUSE_STATLINE #endif // _WX_XH_STLIN_H_
h
rticonnextdds-usecases
data/projects/rticonnextdds-usecases/VehicleTracking/ExampleCode/thirdparty/wxWidgets-3.1.2/Linux/include/wx/xrc/xh_stbmp.h
///////////////////////////////////////////////////////////////////////////// // Name: wx/xrc/xh_stbmp.h // Purpose: XML resource handler for wxStaticBitmap // Author: Vaclav Slavik // Created: 2000/04/22 // Copyright: (c) 2000 Vaclav Slavik // Licence: wxWindows licence ///////////////////////////////////////////////////////////////////////////// #ifndef _WX_XH_STBMP_H_ #define _WX_XH_STBMP_H_ #include "wx/xrc/xmlres.h" #if wxUSE_XRC && wxUSE_STATBMP class WXDLLIMPEXP_XRC wxStaticBitmapXmlHandler : public wxXmlResourceHandler { wxDECLARE_DYNAMIC_CLASS(wxStaticBitmapXmlHandler); public: wxStaticBitmapXmlHandler(); virtual wxObject *DoCreateResource() wxOVERRIDE; virtual bool CanHandle(wxXmlNode *node) wxOVERRIDE; }; #endif // wxUSE_XRC && wxUSE_STATBMP #endif // _WX_XH_STBMP_H_
h
rticonnextdds-usecases
data/projects/rticonnextdds-usecases/VehicleTracking/ExampleCode/thirdparty/wxWidgets-3.1.2/Linux/include/wx/xrc/xh_bmpbt.h
///////////////////////////////////////////////////////////////////////////// // Name: wx/xrc/xh_bmpbt.h // Purpose: XML resource handler for bitmap buttons // Author: Brian Gavin // Created: 2000/03/05 // Copyright: (c) 2000 Brian Gavin // Licence: wxWindows licence ///////////////////////////////////////////////////////////////////////////// #ifndef _WX_XH_BMPBT_H_ #define _WX_XH_BMPBT_H_ #include "wx/xrc/xmlres.h" #if wxUSE_XRC && wxUSE_BMPBUTTON class WXDLLIMPEXP_XRC wxBitmapButtonXmlHandler : public wxXmlResourceHandler { wxDECLARE_DYNAMIC_CLASS(wxBitmapButtonXmlHandler); public: wxBitmapButtonXmlHandler(); virtual wxObject *DoCreateResource() wxOVERRIDE; virtual bool CanHandle(wxXmlNode *node) wxOVERRIDE; }; #endif // wxUSE_XRC && wxUSE_BMPBUTTON #endif // _WX_XH_BMPBT_H_
h
rticonnextdds-usecases
data/projects/rticonnextdds-usecases/VehicleTracking/ExampleCode/thirdparty/wxWidgets-3.1.2/Linux/include/wx/xrc/xh_bannerwindow.h
/////////////////////////////////////////////////////////////////////////////// // Name: wx/xrc/xh_bannerwindow.h // Purpose: Declaration of wxBannerWindow XRC handler. // Author: Vadim Zeitlin // Created: 2011-08-16 // Copyright: (c) 2011 Vadim Zeitlin <[email protected]> // Licence: wxWindows licence /////////////////////////////////////////////////////////////////////////////// #ifndef _WX_XH_BANNERWINDOW_H_ #define _WX_XH_BANNERWINDOW_H_ #include "wx/xrc/xmlres.h" #if wxUSE_XRC && wxUSE_BANNERWINDOW class WXDLLIMPEXP_XRC wxBannerWindowXmlHandler : public wxXmlResourceHandler { public: wxBannerWindowXmlHandler(); virtual wxObject *DoCreateResource() wxOVERRIDE; virtual bool CanHandle(wxXmlNode *node) wxOVERRIDE; wxDECLARE_DYNAMIC_CLASS(wxBannerWindowXmlHandler); }; #endif // wxUSE_XRC && wxUSE_BANNERWINDOW #endif // _WX_XH_BANNERWINDOW_H_
h
rticonnextdds-usecases
data/projects/rticonnextdds-usecases/VehicleTracking/ExampleCode/thirdparty/wxWidgets-3.1.2/Linux/include/wx/xrc/xh_notbk.h
///////////////////////////////////////////////////////////////////////////// // Name: wx/xrc/xh_notbk.h // Purpose: XML resource handler for wxNotebook // Author: Vaclav Slavik // Copyright: (c) 2000 Vaclav Slavik // Licence: wxWindows licence ///////////////////////////////////////////////////////////////////////////// #ifndef _WX_XH_NOTBK_H_ #define _WX_XH_NOTBK_H_ #include "wx/xrc/xmlres.h" #if wxUSE_XRC && wxUSE_NOTEBOOK class WXDLLIMPEXP_FWD_CORE wxNotebook; class WXDLLIMPEXP_XRC wxNotebookXmlHandler : public wxXmlResourceHandler { wxDECLARE_DYNAMIC_CLASS(wxNotebookXmlHandler); public: wxNotebookXmlHandler(); virtual wxObject *DoCreateResource() wxOVERRIDE; virtual bool CanHandle(wxXmlNode *node) wxOVERRIDE; private: bool m_isInside; wxNotebook *m_notebook; }; #endif // wxUSE_XRC && wxUSE_NOTEBOOK #endif // _WX_XH_NOTBK_H_
h
rticonnextdds-usecases
data/projects/rticonnextdds-usecases/VehicleTracking/ExampleCode/thirdparty/wxWidgets-3.1.2/Linux/include/wx/xrc/xh_panel.h
///////////////////////////////////////////////////////////////////////////// // Name: wx/xrc/xh_panel.h // Purpose: XML resource handler for wxPanel // Author: Vaclav Slavik // Created: 2000/03/05 // Copyright: (c) 2000 Vaclav Slavik // Licence: wxWindows licence ///////////////////////////////////////////////////////////////////////////// #ifndef _WX_XH_PANEL_H_ #define _WX_XH_PANEL_H_ #include "wx/xrc/xmlres.h" #if wxUSE_XRC class WXDLLIMPEXP_XRC wxPanelXmlHandler : public wxXmlResourceHandler { wxDECLARE_DYNAMIC_CLASS(wxPanelXmlHandler); public: wxPanelXmlHandler(); virtual wxObject *DoCreateResource() wxOVERRIDE; virtual bool CanHandle(wxXmlNode *node) wxOVERRIDE; }; #endif // wxUSE_XRC #endif // _WX_XH_PANEL_H_
h
rticonnextdds-usecases
data/projects/rticonnextdds-usecases/VehicleTracking/ExampleCode/thirdparty/wxWidgets-3.1.2/Linux/include/wx/xrc/xh_cald.h
///////////////////////////////////////////////////////////////////////////// // Name: wx/xrc/xh_cald.h // Purpose: XML resource handler for wxCalendarCtrl // Author: Brian Gavin // Created: 2000/09/09 // Copyright: (c) 2000 Brian Gavin // Licence: wxWindows licence ///////////////////////////////////////////////////////////////////////////// #ifndef _WX_XH_CALD_H_ #define _WX_XH_CALD_H_ #include "wx/xrc/xmlres.h" #if wxUSE_XRC && wxUSE_CALENDARCTRL class WXDLLIMPEXP_XRC wxCalendarCtrlXmlHandler : public wxXmlResourceHandler { wxDECLARE_DYNAMIC_CLASS(wxCalendarCtrlXmlHandler); public: wxCalendarCtrlXmlHandler(); virtual wxObject *DoCreateResource() wxOVERRIDE; virtual bool CanHandle(wxXmlNode *node) wxOVERRIDE; }; #endif // wxUSE_XRC && wxUSE_CALENDARCTRL #endif // _WX_XH_CALD_H_
h
rticonnextdds-usecases
data/projects/rticonnextdds-usecases/VehicleTracking/ExampleCode/thirdparty/wxWidgets-3.1.2/Linux/include/wx/xrc/xh_text.h
///////////////////////////////////////////////////////////////////////////// // Name: wx/xrc/xh_text.h // Purpose: XML resource handler for wxTextCtrl // Author: Aleksandras Gluchovas // Created: 2000/03/21 // Copyright: (c) 2000 Aleksandras Gluchovas // Licence: wxWindows licence ///////////////////////////////////////////////////////////////////////////// #ifndef _WX_XH_TEXT_H_ #define _WX_XH_TEXT_H_ #include "wx/xrc/xmlres.h" #if wxUSE_XRC && wxUSE_TEXTCTRL class WXDLLIMPEXP_XRC wxTextCtrlXmlHandler : public wxXmlResourceHandler { wxDECLARE_DYNAMIC_CLASS(wxTextCtrlXmlHandler); public: wxTextCtrlXmlHandler(); virtual wxObject *DoCreateResource() wxOVERRIDE; virtual bool CanHandle(wxXmlNode *node) wxOVERRIDE; }; #endif // wxUSE_XRC && wxUSE_TEXTCTRL #endif // _WX_XH_TEXT_H_
h
rticonnextdds-usecases
data/projects/rticonnextdds-usecases/VehicleTracking/ExampleCode/thirdparty/wxWidgets-3.1.2/Linux/include/wx/xrc/xh_datectrl.h
///////////////////////////////////////////////////////////////////////////// // Name: wx/xrc/xh_datectrl.h // Purpose: XML resource handler for wxDatePickerCtrl // Author: Vaclav Slavik // Created: 2005-02-07 // Copyright: (c) 2005 Vaclav Slavik // Licence: wxWindows licence ///////////////////////////////////////////////////////////////////////////// #ifndef _WX_XH_DATECTRL_H_ #define _WX_XH_DATECTRL_H_ #include "wx/xrc/xmlres.h" #if wxUSE_XRC && wxUSE_DATEPICKCTRL class WXDLLIMPEXP_XRC wxDateCtrlXmlHandler : public wxXmlResourceHandler { wxDECLARE_DYNAMIC_CLASS(wxDateCtrlXmlHandler); public: wxDateCtrlXmlHandler(); virtual wxObject *DoCreateResource() wxOVERRIDE; virtual bool CanHandle(wxXmlNode *node) wxOVERRIDE; }; #endif // wxUSE_XRC && wxUSE_DATEPICKCTRL #endif // _WX_XH_DATECTRL_H_
h
rticonnextdds-usecases
data/projects/rticonnextdds-usecases/VehicleTracking/ExampleCode/thirdparty/wxWidgets-3.1.2/Linux/include/wx/xrc/xh_dirpicker.h
///////////////////////////////////////////////////////////////////////////// // Name: wx/xrc/xh_dirpicker.h // Purpose: XML resource handler for wxDirPickerCtrl // Author: Francesco Montorsi // Created: 2006-04-17 // Copyright: (c) 2006 Francesco Montorsi // Licence: wxWindows licence ///////////////////////////////////////////////////////////////////////////// #ifndef _WX_XH_DIRPICKERCTRL_H_ #define _WX_XH_DIRPICKERCTRL_H_ #include "wx/xrc/xmlres.h" #if wxUSE_XRC && wxUSE_DIRPICKERCTRL class WXDLLIMPEXP_XRC wxDirPickerCtrlXmlHandler : public wxXmlResourceHandler { wxDECLARE_DYNAMIC_CLASS(wxDirPickerCtrlXmlHandler); public: wxDirPickerCtrlXmlHandler(); virtual wxObject *DoCreateResource() wxOVERRIDE; virtual bool CanHandle(wxXmlNode *node) wxOVERRIDE; }; #endif // wxUSE_XRC && wxUSE_DIRPICKERCTRL #endif // _WX_XH_DIRPICKERCTRL_H_
h
rticonnextdds-usecases
data/projects/rticonnextdds-usecases/VehicleTracking/ExampleCode/thirdparty/wxWidgets-3.1.2/Linux/include/wx/xrc/xh_combo.h
///////////////////////////////////////////////////////////////////////////// // Name: wx/xrc/xh_combo.h // Purpose: XML resource handler for wxComboBox // Author: Bob Mitchell // Created: 2000/03/21 // Copyright: (c) 2000 Bob Mitchell and Verant Interactive // Licence: wxWindows licence ///////////////////////////////////////////////////////////////////////////// #ifndef _WX_XH_COMBO_H_ #define _WX_XH_COMBO_H_ #include "wx/xrc/xmlres.h" #if wxUSE_XRC && wxUSE_COMBOBOX class WXDLLIMPEXP_XRC wxComboBoxXmlHandler : public wxXmlResourceHandler { wxDECLARE_DYNAMIC_CLASS(wxComboBoxXmlHandler); public: wxComboBoxXmlHandler(); virtual wxObject *DoCreateResource() wxOVERRIDE; virtual bool CanHandle(wxXmlNode *node) wxOVERRIDE; private: bool m_insideBox; wxArrayString strList; }; #endif // wxUSE_XRC && wxUSE_COMBOBOX #endif // _WX_XH_COMBO_H_
h
rticonnextdds-usecases
data/projects/rticonnextdds-usecases/VehicleTracking/ExampleCode/thirdparty/wxWidgets-3.1.2/Linux/include/wx/xrc/xh_dlg.h
///////////////////////////////////////////////////////////////////////////// // Name: wx/xrc/xh_dlg.h // Purpose: XML resource handler for dialogs // Author: Vaclav Slavik // Created: 2000/03/05 // Copyright: (c) 2000 Vaclav Slavik // Licence: wxWindows licence ///////////////////////////////////////////////////////////////////////////// #ifndef _WX_XH_DLG_H_ #define _WX_XH_DLG_H_ #include "wx/xrc/xmlres.h" #if wxUSE_XRC class WXDLLIMPEXP_XRC wxDialogXmlHandler : public wxXmlResourceHandler { wxDECLARE_DYNAMIC_CLASS(wxDialogXmlHandler); public: wxDialogXmlHandler(); virtual wxObject *DoCreateResource() wxOVERRIDE; virtual bool CanHandle(wxXmlNode *node) wxOVERRIDE; }; #endif // wxUSE_XRC #endif // _WX_XH_DLG_H_
h
rticonnextdds-usecases
data/projects/rticonnextdds-usecases/VehicleTracking/ExampleCode/thirdparty/wxWidgets-3.1.2/Linux/include/wx/xrc/xh_scwin.h
///////////////////////////////////////////////////////////////////////////// // Name: wx/xrc/xh_scwin.h // Purpose: XML resource handler for wxScrolledWindow // Author: Vaclav Slavik // Created: 2002/10/18 // Copyright: (c) 2002 Vaclav Slavik // Licence: wxWindows licence ///////////////////////////////////////////////////////////////////////////// #ifndef _WX_XH_SCWIN_H_ #define _WX_XH_SCWIN_H_ #include "wx/xrc/xmlres.h" #if wxUSE_XRC class WXDLLIMPEXP_XRC wxScrolledWindowXmlHandler : public wxXmlResourceHandler { wxDECLARE_DYNAMIC_CLASS(wxScrolledWindowXmlHandler); public: wxScrolledWindowXmlHandler(); virtual wxObject *DoCreateResource() wxOVERRIDE; virtual bool CanHandle(wxXmlNode *node) wxOVERRIDE; }; #endif // wxUSE_XRC #endif // _WX_XH_SCWIN_H_
h
rticonnextdds-usecases
data/projects/rticonnextdds-usecases/VehicleTracking/ExampleCode/thirdparty/wxWidgets-3.1.2/Linux/include/wx/xrc/xh_slidr.h
///////////////////////////////////////////////////////////////////////////// // Name: wx/xrc/xh_slidr.h // Purpose: XML resource handler for wxSlider // Author: Bob Mitchell // Created: 2000/03/21 // Copyright: (c) 2000 Bob Mitchell and Verant Interactive // Licence: wxWindows licence ///////////////////////////////////////////////////////////////////////////// #ifndef _WX_XH_SLIDR_H_ #define _WX_XH_SLIDR_H_ #include "wx/xrc/xmlres.h" #if wxUSE_XRC && wxUSE_SLIDER class WXDLLIMPEXP_XRC wxSliderXmlHandler : public wxXmlResourceHandler { public: wxSliderXmlHandler(); virtual wxObject *DoCreateResource() wxOVERRIDE; virtual bool CanHandle(wxXmlNode *node) wxOVERRIDE; wxDECLARE_DYNAMIC_CLASS(wxSliderXmlHandler); }; #endif // wxUSE_XRC && wxUSE_SLIDER #endif // _WX_XH_SLIDR_H_
h
rticonnextdds-usecases
data/projects/rticonnextdds-usecases/VehicleTracking/ExampleCode/thirdparty/wxWidgets-3.1.2/Linux/include/wx/xrc/xh_tree.h
///////////////////////////////////////////////////////////////////////////// // Name: wx/xrc/xh_tree.h // Purpose: XML resource handler for wxTreeCtrl // Author: Brian Gavin // Created: 2000/09/09 // Copyright: (c) 2000 Brian Gavin // Licence: wxWindows licence ///////////////////////////////////////////////////////////////////////////// #ifndef _WX_XH_TREE_H_ #define _WX_XH_TREE_H_ #include "wx/xrc/xmlres.h" #if wxUSE_XRC && wxUSE_TREECTRL class WXDLLIMPEXP_XRC wxTreeCtrlXmlHandler : public wxXmlResourceHandler { wxDECLARE_DYNAMIC_CLASS(wxTreeCtrlXmlHandler); public: wxTreeCtrlXmlHandler(); virtual wxObject *DoCreateResource() wxOVERRIDE; virtual bool CanHandle(wxXmlNode *node) wxOVERRIDE; }; #endif // wxUSE_XRC && wxUSE_TREECTRL #endif // _WX_XH_TREE_H_
h
rticonnextdds-usecases
data/projects/rticonnextdds-usecases/VehicleTracking/ExampleCode/thirdparty/wxWidgets-3.1.2/Linux/include/wx/xrc/xmlres.h
///////////////////////////////////////////////////////////////////////////// // Name: wx/xrc/xmlres.h // Purpose: XML resources // Author: Vaclav Slavik // Created: 2000/03/05 // Copyright: (c) 2000 Vaclav Slavik // Licence: wxWindows licence ///////////////////////////////////////////////////////////////////////////// #ifndef _WX_XMLRES_H_ #define _WX_XMLRES_H_ #include "wx/defs.h" #if wxUSE_XRC #include "wx/string.h" #include "wx/dynarray.h" #include "wx/arrstr.h" #include "wx/datetime.h" #include "wx/list.h" #include "wx/gdicmn.h" #include "wx/filesys.h" #include "wx/bitmap.h" #include "wx/icon.h" #include "wx/artprov.h" #include "wx/colour.h" #include "wx/vector.h" #include "wx/xrc/xmlreshandler.h" class WXDLLIMPEXP_FWD_BASE wxFileName; class WXDLLIMPEXP_FWD_CORE wxIconBundle; class WXDLLIMPEXP_FWD_CORE wxImageList; class WXDLLIMPEXP_FWD_CORE wxMenu; class WXDLLIMPEXP_FWD_CORE wxMenuBar; class WXDLLIMPEXP_FWD_CORE wxDialog; class WXDLLIMPEXP_FWD_CORE wxPanel; class WXDLLIMPEXP_FWD_CORE wxWindow; class WXDLLIMPEXP_FWD_CORE wxFrame; class WXDLLIMPEXP_FWD_CORE wxToolBar; class WXDLLIMPEXP_FWD_XML wxXmlDocument; class WXDLLIMPEXP_FWD_XML wxXmlNode; class WXDLLIMPEXP_FWD_XRC wxXmlSubclassFactory; class wxXmlSubclassFactories; class wxXmlResourceModule; class wxXmlResourceDataRecords; // These macros indicate current version of XML resources (this information is // encoded in root node of XRC file as "version" property). // // Rules for increasing version number: // - change it only if you made incompatible change to the format. Addition // of new attribute to control handler is _not_ incompatible change, because // older versions of the library may ignore it. // - if you change version number, follow these steps: // - set major, minor and release numbers to respective version numbers of // the wxWidgets library (see wx/version.h) // - reset revision to 0 unless the first three are same as before, // in which case you should increase revision by one #define WX_XMLRES_CURRENT_VERSION_MAJOR 2 #define WX_XMLRES_CURRENT_VERSION_MINOR 5 #define WX_XMLRES_CURRENT_VERSION_RELEASE 3 #define WX_XMLRES_CURRENT_VERSION_REVISION 0 #define WX_XMLRES_CURRENT_VERSION_STRING wxT("2.5.3.0") #define WX_XMLRES_CURRENT_VERSION \ (WX_XMLRES_CURRENT_VERSION_MAJOR * 256*256*256 + \ WX_XMLRES_CURRENT_VERSION_MINOR * 256*256 + \ WX_XMLRES_CURRENT_VERSION_RELEASE * 256 + \ WX_XMLRES_CURRENT_VERSION_REVISION) enum wxXmlResourceFlags { wxXRC_USE_LOCALE = 1, wxXRC_NO_SUBCLASSING = 2, wxXRC_NO_RELOADING = 4 }; // This class holds XML resources from one or more .xml files // (or derived forms, either binary or zipped -- see manual for // details). class WXDLLIMPEXP_XRC wxXmlResource : public wxObject { public: // Constructor. // Flags: wxXRC_USE_LOCALE // translatable strings will be translated via _() // using the given domain if specified // wxXRC_NO_SUBCLASSING // subclass property of object nodes will be ignored // (useful for previews in XRC editors) // wxXRC_NO_RELOADING // don't check the modification time of the XRC files and // reload them if they have changed on disk wxXmlResource(int flags = wxXRC_USE_LOCALE, const wxString& domain = wxEmptyString); // Constructor. // Flags: wxXRC_USE_LOCALE // translatable strings will be translated via _() // using the given domain if specified // wxXRC_NO_SUBCLASSING // subclass property of object nodes will be ignored // (useful for previews in XRC editors) wxXmlResource(const wxString& filemask, int flags = wxXRC_USE_LOCALE, const wxString& domain = wxEmptyString); // Destructor. virtual ~wxXmlResource(); // Loads resources from XML files that match given filemask. // This method understands wxFileSystem URLs if wxUSE_FILESYS. bool Load(const wxString& filemask); // Loads resources from single XRC file. bool LoadFile(const wxFileName& file); // Loads all XRC files from a directory. bool LoadAllFiles(const wxString& dirname); // Unload resource from the given XML file (wildcards not allowed) bool Unload(const wxString& filename); // Initialize handlers for all supported controls/windows. This will // make the executable quite big because it forces linking against // most of the wxWidgets library. void InitAllHandlers(); // Initialize only a specific handler (or custom handler). Convention says // that handler name is equal to the control's name plus 'XmlHandler', for // example wxTextCtrlXmlHandler, wxHtmlWindowXmlHandler. The XML resource // compiler (xmlres) can create include file that contains initialization // code for all controls used within the resource. void AddHandler(wxXmlResourceHandler *handler); // Add a new handler at the beginning of the handler list void InsertHandler(wxXmlResourceHandler *handler); // Removes all handlers void ClearHandlers(); // Registers subclasses factory for use in XRC. This function is not meant // for public use, please see the comment above wxXmlSubclassFactory // definition. static void AddSubclassFactory(wxXmlSubclassFactory *factory); // Loads menu from resource. Returns NULL on failure. wxMenu *LoadMenu(const wxString& name); // Loads menubar from resource. Returns NULL on failure. wxMenuBar *LoadMenuBar(wxWindow *parent, const wxString& name); // Loads menubar from resource. Returns NULL on failure. wxMenuBar *LoadMenuBar(const wxString& name) { return LoadMenuBar(NULL, name); } #if wxUSE_TOOLBAR // Loads a toolbar. wxToolBar *LoadToolBar(wxWindow *parent, const wxString& name); #endif // Loads a dialog. dlg points to parent window (if any). wxDialog *LoadDialog(wxWindow *parent, const wxString& name); // Loads a dialog. dlg points to parent window (if any). This form // is used to finish creation of already existing instance (main reason // for this is that you may want to use derived class with new event table) // Example (typical usage): // MyDialog dlg; // wxTheXmlResource->LoadDialog(&dlg, mainFrame, "my_dialog"); // dlg->ShowModal(); bool LoadDialog(wxDialog *dlg, wxWindow *parent, const wxString& name); // Loads a panel. panel points to parent window (if any). wxPanel *LoadPanel(wxWindow *parent, const wxString& name); // Loads a panel. panel points to parent window (if any). This form // is used to finish creation of already existing instance. bool LoadPanel(wxPanel *panel, wxWindow *parent, const wxString& name); // Loads a frame. wxFrame *LoadFrame(wxWindow* parent, const wxString& name); bool LoadFrame(wxFrame* frame, wxWindow *parent, const wxString& name); // Load an object from the resource specifying both the resource name and // the classname. This lets you load nonstandard container windows. wxObject *LoadObject(wxWindow *parent, const wxString& name, const wxString& classname) { return DoLoadObject(parent, name, classname, false /* !recursive */); } // Load an object from the resource specifying both the resource name and // the classname. This form lets you finish the creation of an existing // instance. bool LoadObject(wxObject *instance, wxWindow *parent, const wxString& name, const wxString& classname) { return DoLoadObject(instance, parent, name, classname, false); } // These versions of LoadObject() look for the object with the given name // recursively (breadth first) and can be used to instantiate an individual // control defined anywhere in an XRC file. No check is done that the name // is unique, it's up to the caller to ensure this. wxObject *LoadObjectRecursively(wxWindow *parent, const wxString& name, const wxString& classname) { return DoLoadObject(parent, name, classname, true /* recursive */); } bool LoadObjectRecursively(wxObject *instance, wxWindow *parent, const wxString& name, const wxString& classname) { return DoLoadObject(instance, parent, name, classname, true); } // Loads a bitmap resource from a file. wxBitmap LoadBitmap(const wxString& name); // Loads an icon resource from a file. wxIcon LoadIcon(const wxString& name); // Attaches an unknown control to the given panel/window/dialog. // Unknown controls are used in conjunction with <object class="unknown">. bool AttachUnknownControl(const wxString& name, wxWindow *control, wxWindow *parent = NULL); // Returns a numeric ID that is equivalent to the string ID used in an XML // resource. If an unknown str_id is requested (i.e. other than wxID_XXX // or integer), a new record is created which associates the given string // with a number. If value_if_not_found == wxID_NONE, the number is obtained via // wxWindow::NewControlId(). Otherwise value_if_not_found is used. // Macro XRCID(name) is provided for convenient use in event tables. static int GetXRCID(const wxString& str_id, int value_if_not_found = wxID_NONE) { return DoGetXRCID(str_id.mb_str(), value_if_not_found); } // version for internal use only static int DoGetXRCID(const char *str_id, int value_if_not_found = wxID_NONE); // Find the string ID with the given numeric value, returns an empty string // if no such ID is found. // // Notice that unlike GetXRCID(), which is fast, this operation is slow as // it checks all the IDs used in XRC. static wxString FindXRCIDById(int numId); // Returns version information (a.b.c.d = d+ 256*c + 256^2*b + 256^3*a). long GetVersion() const { return m_version; } // Compares resources version to argument. Returns -1 if resources version // is less than the argument, +1 if greater and 0 if they equal. int CompareVersion(int major, int minor, int release, int revision) const { long diff = GetVersion() - (major*256*256*256 + minor*256*256 + release*256 + revision); if ( diff < 0 ) return -1; else if ( diff > 0 ) return +1; else return 0; } //// Singleton accessors. // Gets the global resources object or creates one if none exists. static wxXmlResource *Get(); // Sets the global resources object and returns a pointer to the previous one (may be NULL). static wxXmlResource *Set(wxXmlResource *res); // Returns flags, which may be a bitlist of wxXRC_USE_LOCALE and wxXRC_NO_SUBCLASSING. int GetFlags() const { return m_flags; } // Set flags after construction. void SetFlags(int flags) { m_flags = flags; } // Get/Set the domain to be passed to the translation functions, defaults // to empty string (no domain). const wxString& GetDomain() const { return m_domain; } void SetDomain(const wxString& domain); // This function returns the wxXmlNode containing the definition of the // object with the given name or NULL. // // It can be used to access additional information defined in the XRC file // and not used by wxXmlResource itself. const wxXmlNode *GetResourceNode(const wxString& name) const { return GetResourceNodeAndLocation(name, wxString(), true); } protected: // reports input error at position 'context' void ReportError(const wxXmlNode *context, const wxString& message); // override this in derived class to customize errors reporting virtual void DoReportError(const wxString& xrcFile, const wxXmlNode *position, const wxString& message); // Load the contents of a single file and returns its contents as a new // wxXmlDocument (which will be owned by caller) on success or NULL. wxXmlDocument *DoLoadFile(const wxString& file); // Scans the resources list for unloaded files and loads them. Also reloads // files that have been modified since last loading. bool UpdateResources(); // Common implementation of GetResourceNode() and FindResource(): searches // all top-level or all (if recursive == true) nodes if all loaded XRC // files and returns the node, if found, as well as the path of the file it // was found in if path is non-NULL wxXmlNode *GetResourceNodeAndLocation(const wxString& name, const wxString& classname, bool recursive = false, wxString *path = NULL) const; // Note that these functions are used outside of wxWidgets itself, e.g. // there are several known cases of inheriting from wxXmlResource just to // be able to call FindResource() so we keep them for compatibility even if // their names are not really consistent with GetResourceNode() public // function and FindResource() is also non-const because it changes the // current path of m_curFileSystem to ensure that relative paths work // correctly when CreateResFromNode() is called immediately afterwards // (something const public function intentionally does not do) // Returns the node containing the resource with the given name and class // name unless it's empty (then any class matches) or NULL if not found. wxXmlNode *FindResource(const wxString& name, const wxString& classname, bool recursive = false); // Helper function used by FindResource() to look under the given node. wxXmlNode *DoFindResource(wxXmlNode *parent, const wxString& name, const wxString& classname, bool recursive) const; // Creates a resource from information in the given node // (Uses only 'handlerToUse' if != NULL) wxObject *CreateResFromNode(wxXmlNode *node, wxObject *parent, wxObject *instance = NULL, wxXmlResourceHandler *handlerToUse = NULL) { return node ? DoCreateResFromNode(*node, parent, instance, handlerToUse) : NULL; } // Helper of Load() and Unload(): returns the URL corresponding to the // given file if it's indeed a file, otherwise returns the original string // unmodified static wxString ConvertFileNameToURL(const wxString& filename); // loading resources from archives is impossible without wxFileSystem #if wxUSE_FILESYSTEM // Another helper: detect if the filename is a ZIP or XRS file static bool IsArchive(const wxString& filename); #endif // wxUSE_FILESYSTEM private: wxXmlResourceDataRecords& Data() { return *m_data; } const wxXmlResourceDataRecords& Data() const { return *m_data; } // the real implementation of CreateResFromNode(): this should be only // called if node is non-NULL wxObject *DoCreateResFromNode(wxXmlNode& node, wxObject *parent, wxObject *instance, wxXmlResourceHandler *handlerToUse = NULL); // common part of LoadObject() and LoadObjectRecursively() wxObject *DoLoadObject(wxWindow *parent, const wxString& name, const wxString& classname, bool recursive); bool DoLoadObject(wxObject *instance, wxWindow *parent, const wxString& name, const wxString& classname, bool recursive); private: long m_version; int m_flags; wxVector<wxXmlResourceHandler*> m_handlers; wxXmlResourceDataRecords *m_data; #if wxUSE_FILESYSTEM wxFileSystem m_curFileSystem; wxFileSystem& GetCurFileSystem() { return m_curFileSystem; } #endif // domain to pass to translation functions, if any. wxString m_domain; friend class wxXmlResourceHandlerImpl; friend class wxXmlResourceModule; friend class wxIdRangeManager; friend class wxIdRange; static wxXmlSubclassFactories *ms_subclassFactories; // singleton instance: static wxXmlResource *ms_instance; }; // This macro translates string identifier (as used in XML resource, // e.g. <menuitem id="my_menu">...</menuitem>) to integer id that is needed by // wxWidgets event tables. // Example: // wxBEGIN_EVENT_TABLE(MyFrame, wxFrame) // EVT_MENU(XRCID("quit"), MyFrame::OnQuit) // EVT_MENU(XRCID("about"), MyFrame::OnAbout) // EVT_MENU(XRCID("new"), MyFrame::OnNew) // EVT_MENU(XRCID("open"), MyFrame::OnOpen) // wxEND_EVENT_TABLE() #define XRCID(str_id) \ wxXmlResource::DoGetXRCID(str_id) // This macro returns pointer to particular control in dialog // created using XML resources. You can use it to set/get values from // controls. // Example: // wxDialog dlg; // wxXmlResource::Get()->LoadDialog(&dlg, mainFrame, "my_dialog"); // XRCCTRL(dlg, "my_textctrl", wxTextCtrl)->SetValue(wxT("default value")); #define XRCCTRL(window, id, type) \ (wxStaticCast((window).FindWindow(XRCID(id)), type)) // This macro returns pointer to sizer item // Example: // // <object class="spacer" name="area"> // <size>400, 300</size> // </object> // // wxSizerItem* item = XRCSIZERITEM(*this, "area") #define XRCSIZERITEM(window, id) \ ((window).GetSizer() ? (window).GetSizer()->GetItemById(XRCID(id)) : NULL) // wxXmlResourceHandlerImpl is the back-end of the wxXmlResourceHander class to // really implementing all its functionality. It is defined in the "xrc" // library unlike wxXmlResourceHandler itself which is defined in "core" to // allow inheriting from it in the code from the other libraries too. class WXDLLIMPEXP_XRC wxXmlResourceHandlerImpl : public wxXmlResourceHandlerImplBase { public: // Constructor. wxXmlResourceHandlerImpl(wxXmlResourceHandler *handler); // Destructor. virtual ~wxXmlResourceHandlerImpl() {} // Creates an object (menu, dialog, control, ...) from an XML node. // Should check for validity. // parent is a higher-level object (usually window, dialog or panel) // that is often necessary to create the resource. // If instance is non-NULL it should not create a new instance via 'new' but // should rather use this one, and call its Create method. wxObject *CreateResource(wxXmlNode *node, wxObject *parent, wxObject *instance) wxOVERRIDE; // --- Handy methods: // Returns true if the node has a property class equal to classname, // e.g. <object class="wxDialog">. bool IsOfClass(wxXmlNode *node, const wxString& classname) const wxOVERRIDE; bool IsObjectNode(const wxXmlNode *node) const wxOVERRIDE; // Gets node content from wxXML_ENTITY_NODE // The problem is, <tag>content<tag> is represented as // wxXML_ENTITY_NODE name="tag", content="" // |-- wxXML_TEXT_NODE or // wxXML_CDATA_SECTION_NODE name="" content="content" wxString GetNodeContent(const wxXmlNode *node) wxOVERRIDE; wxXmlNode *GetNodeParent(const wxXmlNode *node) const wxOVERRIDE; wxXmlNode *GetNodeNext(const wxXmlNode *node) const wxOVERRIDE; wxXmlNode *GetNodeChildren(const wxXmlNode *node) const wxOVERRIDE; // Check to see if a parameter exists. bool HasParam(const wxString& param) wxOVERRIDE; // Finds the node or returns NULL. wxXmlNode *GetParamNode(const wxString& param) wxOVERRIDE; // Finds the parameter value or returns the empty string. wxString GetParamValue(const wxString& param) wxOVERRIDE; // Returns the parameter value from given node. wxString GetParamValue(const wxXmlNode* node) wxOVERRIDE; // Gets style flags from text in form "flag | flag2| flag3 |..." // Only understands flags added with AddStyle int GetStyle(const wxString& param = wxT("style"), int defaults = 0) wxOVERRIDE; // Gets text from param and does some conversions: // - replaces \n, \r, \t by respective chars (according to C syntax) // - replaces _ by & and __ by _ (needed for _File => &File because of XML) // - calls wxGetTranslations (unless disabled in wxXmlResource) // // The first two conversions can be disabled by using wxXRC_TEXT_NO_ESCAPE // in flags and the last one -- by using wxXRC_TEXT_NO_TRANSLATE. wxString GetNodeText(const wxXmlNode *node, int flags = 0) wxOVERRIDE; // Returns the XRCID. int GetID() wxOVERRIDE; // Returns the resource name. wxString GetName() wxOVERRIDE; // Gets a bool flag (1, t, yes, on, true are true, everything else is false). bool GetBool(const wxString& param, bool defaultv = false) wxOVERRIDE; // Gets an integer value from the parameter. long GetLong(const wxString& param, long defaultv = 0) wxOVERRIDE; // Gets a float value from the parameter. float GetFloat(const wxString& param, float defaultv = 0) wxOVERRIDE; // Gets colour in HTML syntax (#RRGGBB). wxColour GetColour(const wxString& param, const wxColour& defaultv = wxNullColour) wxOVERRIDE; // Gets the size (may be in dialog units). wxSize GetSize(const wxString& param = wxT("size"), wxWindow *windowToUse = NULL) wxOVERRIDE; // Gets the position (may be in dialog units). wxPoint GetPosition(const wxString& param = wxT("pos")) wxOVERRIDE; // Gets a dimension (may be in dialog units). wxCoord GetDimension(const wxString& param, wxCoord defaultv = 0, wxWindow *windowToUse = NULL) wxOVERRIDE; // Gets a size which is not expressed in pixels, so not in dialog units. wxSize GetPairInts(const wxString& param) wxOVERRIDE; // Gets a direction, complains if the value is invalid. wxDirection GetDirection(const wxString& param, wxDirection dirDefault = wxLEFT) wxOVERRIDE; // Gets a bitmap. wxBitmap GetBitmap(const wxString& param = wxT("bitmap"), const wxArtClient& defaultArtClient = wxART_OTHER, wxSize size = wxDefaultSize) wxOVERRIDE; // Gets a bitmap from an XmlNode. wxBitmap GetBitmap(const wxXmlNode* node, const wxArtClient& defaultArtClient = wxART_OTHER, wxSize size = wxDefaultSize) wxOVERRIDE; // Gets an icon. wxIcon GetIcon(const wxString& param = wxT("icon"), const wxArtClient& defaultArtClient = wxART_OTHER, wxSize size = wxDefaultSize) wxOVERRIDE; // Gets an icon from an XmlNode. wxIcon GetIcon(const wxXmlNode* node, const wxArtClient& defaultArtClient = wxART_OTHER, wxSize size = wxDefaultSize) wxOVERRIDE; // Gets an icon bundle. wxIconBundle GetIconBundle(const wxString& param, const wxArtClient& defaultArtClient = wxART_OTHER) wxOVERRIDE; // Gets an image list. wxImageList *GetImageList(const wxString& param = wxT("imagelist")) wxOVERRIDE; #if wxUSE_ANIMATIONCTRL // Gets an animation. wxAnimation* GetAnimation(const wxString& param = wxT("animation")) wxOVERRIDE; #endif // Gets a font. wxFont GetFont(const wxString& param = wxT("font"), wxWindow* parent = NULL) wxOVERRIDE; // Gets the value of a boolean attribute (only "0" and "1" are valid values) bool GetBoolAttr(const wxString& attr, bool defaultv) wxOVERRIDE; // Returns the window associated with the handler (may be NULL). wxWindow* GetParentAsWindow() const { return m_handler->GetParentAsWindow(); } // Sets common window options. void SetupWindow(wxWindow *wnd) wxOVERRIDE; // Creates children. void CreateChildren(wxObject *parent, bool this_hnd_only = false) wxOVERRIDE; // Helper function. void CreateChildrenPrivately(wxObject *parent, wxXmlNode *rootnode = NULL) wxOVERRIDE; // Creates a resource from a node. wxObject *CreateResFromNode(wxXmlNode *node, wxObject *parent, wxObject *instance = NULL) wxOVERRIDE; // helper #if wxUSE_FILESYSTEM wxFileSystem& GetCurFileSystem() wxOVERRIDE; #endif // reports input error at position 'context' void ReportError(wxXmlNode *context, const wxString& message) wxOVERRIDE; // reports input error at m_node void ReportError(const wxString& message) wxOVERRIDE; // reports input error when parsing parameter with given name void ReportParamError(const wxString& param, const wxString& message) wxOVERRIDE; }; // Programmer-friendly macros for writing XRC handlers: #define XRC_MAKE_INSTANCE(variable, classname) \ classname *variable = NULL; \ if (m_instance) \ variable = wxStaticCast(m_instance, classname); \ if (!variable) \ variable = new classname; \ if (GetBool(wxT("hidden"), 0) == 1) \ variable->Hide(); // FIXME -- remove this $%^#$%#$@# as soon as Ron checks his changes in!! WXDLLIMPEXP_XRC void wxXmlInitResourceModule(); // This class is used to create instances of XRC "object" nodes with "subclass" // property. It is _not_ supposed to be used by XRC users, you should instead // register your subclasses via wxWidgets' RTTI mechanism. This class is useful // only for language bindings developer who need a way to implement subclassing // in wxWidgets ports that don't support wxRTTI (e.g. wxPython). class WXDLLIMPEXP_XRC wxXmlSubclassFactory { public: // Try to create instance of given class and return it, return NULL on // failure: virtual wxObject *Create(const wxString& className) = 0; virtual ~wxXmlSubclassFactory() {} }; /* ------------------------------------------------------------------------- Backward compatibility macros. Do *NOT* use, they may disappear in future versions of the XRC library! ------------------------------------------------------------------------- */ #endif // wxUSE_XRC #endif // _WX_XMLRES_H_
h
rticonnextdds-usecases
data/projects/rticonnextdds-usecases/VehicleTracking/ExampleCode/thirdparty/wxWidgets-3.1.2/Linux/include/wx/xrc/xh_treebk.h
///////////////////////////////////////////////////////////////////////////// // Name: wx/xrc/xh_treebk.h // Purpose: XML resource handler for wxTreebook // Author: Evgeniy Tarassov // Created: 2005/09/28 // Copyright: (c) 2005 TT-Solutions <[email protected]> // Licence: wxWindows licence ///////////////////////////////////////////////////////////////////////////// #ifndef _WX_XH_TREEBK_H_ #define _WX_XH_TREEBK_H_ #include "wx/xrc/xmlres.h" #if wxUSE_XRC && wxUSE_TREEBOOK class WXDLLIMPEXP_FWD_CORE wxTreebook; #include "wx/dynarray.h" WX_DEFINE_USER_EXPORTED_ARRAY_SIZE_T(size_t, wxArrayTbkPageIndexes, class WXDLLIMPEXP_XRC); // --------------------------------------------------------------------- // wxTreebookXmlHandler class // --------------------------------------------------------------------- // Resource xml structure have to be almost the "same" as for wxNotebook // except the additional (size_t)depth parameter for treebookpage nodes // which indicates the depth of the page in the tree. // There is only one logical constraint on this parameter : // it cannot be greater than the previous page depth plus one class WXDLLIMPEXP_XRC wxTreebookXmlHandler : public wxXmlResourceHandler { wxDECLARE_DYNAMIC_CLASS(wxTreebookXmlHandler); public: wxTreebookXmlHandler(); virtual wxObject *DoCreateResource() wxOVERRIDE; virtual bool CanHandle(wxXmlNode *node) wxOVERRIDE; private: wxTreebook *m_tbk; wxArrayTbkPageIndexes m_treeContext; bool m_isInside; }; // Example: // ------- // Label // \--First // | \--Second // \--Third // //<resource> // ... // <object class="wxTreebook"> // <object class="treebookpage"> // <object class="wxWindow" /> // <label>My first page</label> // <depth>0</depth> // </object> // <object class="treebookpage"> // <object class="wxWindow" /> // <label>First</label> // <depth>1</depth> // </object> // <object class="treebookpage"> // <object class="wxWindow" /> // <label>Second</label> // <depth>2</depth> // </object> // <object class="treebookpage"> // <object class="wxWindow" /> // <label>Third</label> // <depth>1</depth> // </object> // </object> // ... //</resource> #endif // wxUSE_XRC && wxUSE_TREEBOOK #endif // _WX_XH_TREEBK_H_
h