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/Win64/include/wx/treelist.h
/////////////////////////////////////////////////////////////////////////////// // Name: wx/treelist.h // Purpose: wxTreeListCtrl class declaration. // Author: Vadim Zeitlin // Created: 2011-08-17 // Copyright: (c) 2011 Vadim Zeitlin <[email protected]> // Licence: wxWindows licence /////////////////////////////////////////////////////////////////////////////// #ifndef _WX_TREELIST_H_ #define _WX_TREELIST_H_ #include "wx/defs.h" #if wxUSE_TREELISTCTRL #include "wx/compositewin.h" #include "wx/containr.h" #include "wx/headercol.h" #include "wx/itemid.h" #include "wx/vector.h" #include "wx/window.h" #include "wx/withimages.h" class WXDLLIMPEXP_FWD_CORE wxDataViewCtrl; class WXDLLIMPEXP_FWD_CORE wxDataViewEvent; extern WXDLLIMPEXP_DATA_CORE(const char) wxTreeListCtrlNameStr[]; class wxTreeListCtrl; class wxTreeListModel; class wxTreeListModelNode; // ---------------------------------------------------------------------------- // Constants. // ---------------------------------------------------------------------------- // wxTreeListCtrl styles. // // Notice that using wxTL_USER_3STATE implies wxTL_3STATE and wxTL_3STATE in // turn implies wxTL_CHECKBOX. enum { wxTL_SINGLE = 0x0000, // This is the default anyhow. wxTL_MULTIPLE = 0x0001, // Allow multiple selection. wxTL_CHECKBOX = 0x0002, // Show checkboxes in the first column. wxTL_3STATE = 0x0004, // Allow 3rd state in checkboxes. wxTL_USER_3STATE = 0x0008, // Allow user to set 3rd state. wxTL_NO_HEADER = 0x0010, // Column titles not visible. wxTL_DEFAULT_STYLE = wxTL_SINGLE, wxTL_STYLE_MASK = wxTL_SINGLE | wxTL_MULTIPLE | wxTL_CHECKBOX | wxTL_3STATE | wxTL_USER_3STATE }; // ---------------------------------------------------------------------------- // wxTreeListItem: unique identifier of an item in wxTreeListCtrl. // ---------------------------------------------------------------------------- // Make wxTreeListItem a forward-declarable class even though it's simple // enough to possibly be declared as a simple typedef. class wxTreeListItem : public wxItemId<wxTreeListModelNode*> { public: wxTreeListItem(wxTreeListModelNode* item = NULL) : wxItemId<wxTreeListModelNode*>(item) { } }; // Container of multiple items. typedef wxVector<wxTreeListItem> wxTreeListItems; // Some special "items" that can be used with InsertItem(): extern WXDLLIMPEXP_DATA_CORE(const wxTreeListItem) wxTLI_FIRST; extern WXDLLIMPEXP_DATA_CORE(const wxTreeListItem) wxTLI_LAST; // ---------------------------------------------------------------------------- // wxTreeListItemComparator: defines order of wxTreeListCtrl items. // ---------------------------------------------------------------------------- class wxTreeListItemComparator { public: wxTreeListItemComparator() { } // The comparison function should return negative, null or positive value // depending on whether the first item is less than, equal to or greater // than the second one. The items should be compared using their values for // the given column. virtual int Compare(wxTreeListCtrl* treelist, unsigned column, wxTreeListItem first, wxTreeListItem second) = 0; // Although this class is not used polymorphically by wxWidgets itself, // provide virtual dtor in case it's used like this in the user code. virtual ~wxTreeListItemComparator() { } private: wxDECLARE_NO_COPY_CLASS(wxTreeListItemComparator); }; // ---------------------------------------------------------------------------- // wxTreeListCtrl: a control combining wxTree- and wxListCtrl features. // ---------------------------------------------------------------------------- // This control also provides easy to use high level interface. Although the // implementation uses wxDataViewCtrl internally, this class is intentionally // simpler than wxDataViewCtrl and doesn't provide all of its functionality. // // If you need extra features you can always use GetDataView() accessor to work // with wxDataViewCtrl directly but doing this makes your unportable to possible // future non-wxDataViewCtrl-based implementations of this class. class WXDLLIMPEXP_CORE wxTreeListCtrl : public wxCompositeWindow< wxNavigationEnabled<wxWindow> >, public wxWithImages { public: // Constructors and such // --------------------- wxTreeListCtrl() { Init(); } wxTreeListCtrl(wxWindow* parent, wxWindowID id, const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxDefaultSize, long style = wxTL_DEFAULT_STYLE, const wxString& name = wxTreeListCtrlNameStr) { Init(); Create(parent, id, pos, size, style, name); } bool Create(wxWindow* parent, wxWindowID id, const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxDefaultSize, long style = wxTL_DEFAULT_STYLE, const wxString& name = wxTreeListCtrlNameStr); virtual ~wxTreeListCtrl(); // Columns methods // --------------- // Add a column with the given title and attributes, returns the index of // the new column or -1 on failure. int AppendColumn(const wxString& title, int width = wxCOL_WIDTH_AUTOSIZE, wxAlignment align = wxALIGN_LEFT, int flags = wxCOL_RESIZABLE) { return DoInsertColumn(title, -1, width, align, flags); } // Return the total number of columns. unsigned GetColumnCount() const; // Delete the column with the given index, returns false if index is // invalid or deleting the column failed for some other reason. bool DeleteColumn(unsigned col); // Delete all columns. void ClearColumns(); // Set column width to either the given value in pixels or to the value // large enough to fit all of the items if width == wxCOL_WIDTH_AUTOSIZE. void SetColumnWidth(unsigned col, int width); // Get the current width of the given column in pixels. int GetColumnWidth(unsigned col) const; // Get the width appropriate for showing the given text. This is typically // used as second argument for AppendColumn() or with SetColumnWidth(). int WidthFor(const wxString& text) const; // Item methods // ------------ // Adding items. The parent and text of the first column of the new item // must always be specified, the rest is optional. // // Each item can have two images: one used for closed state and another for // opened one. Only the first one is ever used for the items that don't // have children. And both are not set by default. // // It is also possible to associate arbitrary client data pointer with the // new item. It will be deleted by the control when the item is deleted // (either by an explicit DeleteItem() call or because the entire control // is destroyed). wxTreeListItem AppendItem(wxTreeListItem parent, const wxString& text, int imageClosed = NO_IMAGE, int imageOpened = NO_IMAGE, wxClientData* data = NULL) { return DoInsertItem(parent, wxTLI_LAST, text, imageClosed, imageOpened, data); } wxTreeListItem InsertItem(wxTreeListItem parent, wxTreeListItem previous, const wxString& text, int imageClosed = NO_IMAGE, int imageOpened = NO_IMAGE, wxClientData* data = NULL) { return DoInsertItem(parent, previous, text, imageClosed, imageOpened, data); } wxTreeListItem PrependItem(wxTreeListItem parent, const wxString& text, int imageClosed = NO_IMAGE, int imageOpened = NO_IMAGE, wxClientData* data = NULL) { return DoInsertItem(parent, wxTLI_FIRST, text, imageClosed, imageOpened, data); } // Deleting items. void DeleteItem(wxTreeListItem item); void DeleteAllItems(); // Tree navigation // --------------- // Return the (never shown) root item. wxTreeListItem GetRootItem() const; // The parent item may be invalid for the root-level items. wxTreeListItem GetItemParent(wxTreeListItem item) const; // Iterate over the given item children: start by calling GetFirstChild() // and then call GetNextSibling() for as long as it returns valid item. wxTreeListItem GetFirstChild(wxTreeListItem item) const; wxTreeListItem GetNextSibling(wxTreeListItem item) const; // Return the first child of the root item, which is also the first item of // the tree in depth-first traversal order. wxTreeListItem GetFirstItem() const { return GetFirstChild(GetRootItem()); } // Get item after the given one in the depth-first tree-traversal order. // Calling this function starting with the result of GetFirstItem() allows // iterating over all items in the tree. wxTreeListItem GetNextItem(wxTreeListItem item) const; // Items attributes // ---------------- const wxString& GetItemText(wxTreeListItem item, unsigned col = 0) const; // The convenience overload below sets the text for the first column. void SetItemText(wxTreeListItem item, unsigned col, const wxString& text); void SetItemText(wxTreeListItem item, const wxString& text) { SetItemText(item, 0, text); } // By default the opened image is the same as the normal, closed one (if // it's used at all). void SetItemImage(wxTreeListItem item, int closed, int opened = NO_IMAGE); // Retrieve or set the data associated with the item. wxClientData* GetItemData(wxTreeListItem item) const; void SetItemData(wxTreeListItem item, wxClientData* data); // Expanding and collapsing // ------------------------ void Expand(wxTreeListItem item); void Collapse(wxTreeListItem item); bool IsExpanded(wxTreeListItem item) const; // Selection handling // ------------------ // This function can be used with single selection controls, use // GetSelections() with the multi-selection ones. wxTreeListItem GetSelection() const; // This one can be used with either single or multi-selection controls. unsigned GetSelections(wxTreeListItems& selections) const; // In single selection mode Select() deselects any other selected items, in // multi-selection case it adds to the selection. void Select(wxTreeListItem item); // Can be used in multiple selection mode only, single selected item in the // single selection mode can't be unselected. void Unselect(wxTreeListItem item); // Return true if the item is selected, can be used in both single and // multiple selection modes. bool IsSelected(wxTreeListItem item) const; // Select or unselect all items, only valid in multiple selection mode. void SelectAll(); void UnselectAll(); void EnsureVisible(wxTreeListItem item); // Checkbox handling // ----------------- // Methods in this section can only be used with the controls created with // wxTL_CHECKBOX style. // Simple set, unset or query the checked state. void CheckItem(wxTreeListItem item, wxCheckBoxState state = wxCHK_CHECKED); void UncheckItem(wxTreeListItem item) { CheckItem(item, wxCHK_UNCHECKED); } // The same but do it recursively for this item itself and its children. void CheckItemRecursively(wxTreeListItem item, wxCheckBoxState state = wxCHK_CHECKED); // Update the parent of this item recursively: if this item and all its // siblings are checked, the parent will become checked as well. If this // item and all its siblings are unchecked, the parent will be unchecked. // And if the siblings of this item are not all in the same state, the // parent will be switched to indeterminate state. And then the same logic // will be applied to the parents parent and so on recursively. // // This is typically called when the state of the given item has changed // from EVT_TREELIST_ITEM_CHECKED() handler in the controls which have // wxTL_3STATE flag. Notice that without this flag this function can't work // as it would be unable to set the state of a parent with both checked and // unchecked items so it's only allowed to call it when this flag is set. void UpdateItemParentStateRecursively(wxTreeListItem item); // Return the current state. wxCheckBoxState GetCheckedState(wxTreeListItem item) const; // Return true if all item children (if any) are in the given state. bool AreAllChildrenInState(wxTreeListItem item, wxCheckBoxState state) const; // Sorting. // -------- // Sort by the given column, either in ascending (default) or descending // sort order. // // By default, simple alphabetical sorting is done by this column contents // but SetItemComparator() may be called to perform comparison in some // other way. void SetSortColumn(unsigned col, bool ascendingOrder = true); // If the control contents is sorted, return true and fill the output // parameters with the column which is currently used for sorting and // whether we sort using ascending or descending order. Otherwise, i.e. if // the control contents is unsorted, simply return false. bool GetSortColumn(unsigned* col, bool* ascendingOrder = NULL); // Set the object to use for comparing the items. It will be called when // the control is being sorted because the user clicked on a sortable // column. // // The provided pointer is stored by the control so the object it points to // must have a life-time equal or greater to that of the control itself. In // addition, the pointer can be NULL to stop using custom comparator and // revert to the default alphabetical comparison. void SetItemComparator(wxTreeListItemComparator* comparator); // View window functions. // ---------------------- // This control itself is entirely covered by the "view window" which is // currently a wxDataViewCtrl but if you want to avoid relying on this to // allow your code to work with later versions which might not be // wxDataViewCtrl-based, use the first function only and only use the // second one if you really need to call wxDataViewCtrl methods on it. wxWindow* GetView() const; wxDataViewCtrl* GetDataView() const { return m_view; } private: // Common part of all ctors. void Init(); // Pure virtual method inherited from wxCompositeWindow. virtual wxWindowList GetCompositeWindowParts() const wxOVERRIDE; // Implementation of AppendColumn(). int DoInsertColumn(const wxString& title, int pos, // May be -1 meaning "append". int width, wxAlignment align, int flags); // Common part of {Append,Insert,Prepend}Item(). wxTreeListItem DoInsertItem(wxTreeListItem parent, wxTreeListItem previous, const wxString& text, int imageClosed, int imageOpened, wxClientData* data); // Send wxTreeListEvent corresponding to the given wxDataViewEvent for an // item (as opposed for column-oriented events). // // Also updates the original event "skipped" and "vetoed" flags. void SendItemEvent(wxEventType evt, wxDataViewEvent& event); // Send wxTreeListEvent corresponding to the given column wxDataViewEvent. void SendColumnEvent(wxEventType evt, wxDataViewEvent& event); // Called by wxTreeListModel when an item is toggled by the user. void OnItemToggled(wxTreeListItem item, wxCheckBoxState stateOld); // Event handlers. void OnSelectionChanged(wxDataViewEvent& event); void OnItemExpanding(wxDataViewEvent& event); void OnItemExpanded(wxDataViewEvent& event); void OnItemActivated(wxDataViewEvent& event); void OnItemContextMenu(wxDataViewEvent& event); void OnColumnSorted(wxDataViewEvent& event); void OnSize(wxSizeEvent& event); wxDECLARE_EVENT_TABLE(); wxDataViewCtrl* m_view; wxTreeListModel* m_model; wxTreeListItemComparator* m_comparator; // It calls our inherited protected wxWithImages::GetImage() method. friend class wxTreeListModel; wxDECLARE_NO_COPY_CLASS(wxTreeListCtrl); }; // ---------------------------------------------------------------------------- // wxTreeListEvent: event generated by wxTreeListCtrl. // ---------------------------------------------------------------------------- class WXDLLIMPEXP_CORE wxTreeListEvent : public wxNotifyEvent { public: // Default ctor is provided for wxRTTI needs only but should never be used. wxTreeListEvent() { Init(); } // The item affected by the event. Valid for all events except // column-specific ones such as COLUMN_SORTED. wxTreeListItem GetItem() const { return m_item; } // The previous state of the item checkbox for ITEM_CHECKED events only. wxCheckBoxState GetOldCheckedState() const { return m_oldCheckedState; } // The index of the column affected by the event. Currently only used by // COLUMN_SORTED event. unsigned GetColumn() const { return m_column; } virtual wxEvent* Clone() const wxOVERRIDE { return new wxTreeListEvent(*this); } private: // Common part of all ctors. void Init() { m_column = static_cast<unsigned>(-1); m_oldCheckedState = wxCHK_UNDETERMINED; } // Ctor is private, only wxTreeListCtrl can create events of this type. wxTreeListEvent(wxEventType evtType, wxTreeListCtrl* treelist, wxTreeListItem item) : wxNotifyEvent(evtType, treelist->GetId()), m_item(item) { SetEventObject(treelist); Init(); } // Set the checkbox state before this event for ITEM_CHECKED events. void SetOldCheckedState(wxCheckBoxState state) { m_oldCheckedState = state; } // Set the column affected by this event for COLUMN_SORTED events. void SetColumn(unsigned column) { m_column = column; } const wxTreeListItem m_item; wxCheckBoxState m_oldCheckedState; unsigned m_column; friend class wxTreeListCtrl; wxDECLARE_DYNAMIC_CLASS_NO_ASSIGN(wxTreeListEvent); }; // Event types and event table macros. typedef void (wxEvtHandler::*wxTreeListEventFunction)(wxTreeListEvent&); #define wxTreeListEventHandler(func) \ wxEVENT_HANDLER_CAST(wxTreeListEventFunction, func) #define wxEVT_TREELIST_GENERIC(name, id, fn) \ wx__DECLARE_EVT1(wxEVT_TREELIST_##name, id, wxTreeListEventHandler(fn)) #define wxDECLARE_TREELIST_EVENT(name) \ wxDECLARE_EXPORTED_EVENT( WXDLLIMPEXP_CORE, \ wxEVT_TREELIST_##name, \ wxTreeListEvent) wxDECLARE_TREELIST_EVENT(SELECTION_CHANGED); #define EVT_TREELIST_SELECTION_CHANGED(id, fn) \ wxEVT_TREELIST_GENERIC(SELECTION_CHANGED, id, fn) wxDECLARE_TREELIST_EVENT(ITEM_EXPANDING); #define EVT_TREELIST_ITEM_EXPANDING(id, fn) \ wxEVT_TREELIST_GENERIC(ITEM_EXPANDING, id, fn) wxDECLARE_TREELIST_EVENT(ITEM_EXPANDED); #define EVT_TREELIST_ITEM_EXPANDED(id, fn) \ wxEVT_TREELIST_GENERIC(ITEM_EXPANDED, id, fn) wxDECLARE_TREELIST_EVENT(ITEM_CHECKED); #define EVT_TREELIST_ITEM_CHECKED(id, fn) \ wxEVT_TREELIST_GENERIC(ITEM_CHECKED, id, fn) wxDECLARE_TREELIST_EVENT(ITEM_ACTIVATED); #define EVT_TREELIST_ITEM_ACTIVATED(id, fn) \ wxEVT_TREELIST_GENERIC(ITEM_ACTIVATED, id, fn) wxDECLARE_TREELIST_EVENT(ITEM_CONTEXT_MENU); #define EVT_TREELIST_ITEM_CONTEXT_MENU(id, fn) \ wxEVT_TREELIST_GENERIC(ITEM_CONTEXT_MENU, id, fn) wxDECLARE_TREELIST_EVENT(COLUMN_SORTED); #define EVT_TREELIST_COLUMN_SORTED(id, fn) \ wxEVT_TREELIST_GENERIC(COLUMN_SORTED, id, fn) #undef wxDECLARE_TREELIST_EVENT // old wxEVT_COMMAND_* constants #define wxEVT_COMMAND_TREELIST_SELECTION_CHANGED wxEVT_TREELIST_SELECTION_CHANGED #define wxEVT_COMMAND_TREELIST_ITEM_EXPANDING wxEVT_TREELIST_ITEM_EXPANDING #define wxEVT_COMMAND_TREELIST_ITEM_EXPANDED wxEVT_TREELIST_ITEM_EXPANDED #define wxEVT_COMMAND_TREELIST_ITEM_CHECKED wxEVT_TREELIST_ITEM_CHECKED #define wxEVT_COMMAND_TREELIST_ITEM_ACTIVATED wxEVT_TREELIST_ITEM_ACTIVATED #define wxEVT_COMMAND_TREELIST_ITEM_CONTEXT_MENU wxEVT_TREELIST_ITEM_CONTEXT_MENU #define wxEVT_COMMAND_TREELIST_COLUMN_SORTED wxEVT_TREELIST_COLUMN_SORTED #endif // wxUSE_TREELISTCTRL #endif // _WX_TREELIST_H_
h
rticonnextdds-usecases
data/projects/rticonnextdds-usecases/VehicleTracking/ExampleCode/thirdparty/wxWidgets-3.1.2/Win64/include/wx/fontdlg.h
/////////////////////////////////////////////////////////////////////////////// // Name: wx/fontdlg.h // Purpose: common interface for different wxFontDialog classes // Author: Vadim Zeitlin // Modified by: // Created: 12.05.02 // Copyright: (c) 1997-2002 wxWidgets team // Licence: wxWindows licence /////////////////////////////////////////////////////////////////////////////// #ifndef _WX_FONTDLG_H_BASE_ #define _WX_FONTDLG_H_BASE_ #include "wx/defs.h" // for wxUSE_FONTDLG #if wxUSE_FONTDLG #include "wx/dialog.h" // the base class #include "wx/fontdata.h" // ---------------------------------------------------------------------------- // wxFontDialog interface // ---------------------------------------------------------------------------- class WXDLLIMPEXP_CORE wxFontDialogBase : public wxDialog { public: // create the font dialog wxFontDialogBase() { } wxFontDialogBase(wxWindow *parent) { m_parent = parent; } wxFontDialogBase(wxWindow *parent, const wxFontData& data) { m_parent = parent; InitFontData(&data); } bool Create(wxWindow *parent) { return DoCreate(parent); } bool Create(wxWindow *parent, const wxFontData& data) { InitFontData(&data); return Create(parent); } // retrieve the font data const wxFontData& GetFontData() const { return m_fontData; } wxFontData& GetFontData() { return m_fontData; } protected: virtual bool DoCreate(wxWindow *parent) { m_parent = parent; return true; } void InitFontData(const wxFontData *data = NULL) { if ( data ) m_fontData = *data; } wxFontData m_fontData; wxDECLARE_NO_COPY_CLASS(wxFontDialogBase); }; // ---------------------------------------------------------------------------- // platform-specific wxFontDialog implementation // ---------------------------------------------------------------------------- #if defined( __WXOSX_MAC__ ) //set to 1 to use native mac font and color dialogs #define USE_NATIVE_FONT_DIALOG_FOR_MACOSX 1 #else //not supported on these platforms, leave 0 #define USE_NATIVE_FONT_DIALOG_FOR_MACOSX 0 #endif #if defined(__WXUNIVERSAL__) || \ defined(__WXMOTIF__) || \ defined(__WXGPE__) #include "wx/generic/fontdlgg.h" #define wxFontDialog wxGenericFontDialog #elif defined(__WXMSW__) #include "wx/msw/fontdlg.h" #elif defined(__WXGTK20__) #include "wx/gtk/fontdlg.h" #elif defined(__WXGTK__) #include "wx/gtk1/fontdlg.h" #elif defined(__WXMAC__) #include "wx/osx/fontdlg.h" #elif defined(__WXQT__) #include "wx/qt/fontdlg.h" #endif // ---------------------------------------------------------------------------- // global public functions // ---------------------------------------------------------------------------- // get the font from user and return it, returns wxNullFont if the dialog was // cancelled WXDLLIMPEXP_CORE wxFont wxGetFontFromUser(wxWindow *parent = NULL, const wxFont& fontInit = wxNullFont, const wxString& caption = wxEmptyString); #endif // wxUSE_FONTDLG #endif // _WX_FONTDLG_H_BASE_
h
rticonnextdds-usecases
data/projects/rticonnextdds-usecases/VehicleTracking/ExampleCode/thirdparty/wxWidgets-3.1.2/Win64/include/wx/filedlg.h
///////////////////////////////////////////////////////////////////////////// // Name: wx/filedlg.h // Purpose: wxFileDialog base header // Author: Robert Roebling // Modified by: // Created: 8/17/99 // Copyright: (c) Robert Roebling // Licence: wxWindows licence ///////////////////////////////////////////////////////////////////////////// #ifndef _WX_FILEDLG_H_BASE_ #define _WX_FILEDLG_H_BASE_ #include "wx/defs.h" #if wxUSE_FILEDLG #include "wx/dialog.h" #include "wx/arrstr.h" // this symbol is defined for the platforms which support multiple // ('|'-separated) filters in the file dialog #if defined(__WXMSW__) || defined(__WXGTK__) || defined(__WXMAC__) #define wxHAS_MULTIPLE_FILEDLG_FILTERS #endif //---------------------------------------------------------------------------- // wxFileDialog data //---------------------------------------------------------------------------- /* The flags below must coexist with the following flags in m_windowStyle #define wxCAPTION 0x20000000 #define wxMAXIMIZE 0x00002000 #define wxCLOSE_BOX 0x00001000 #define wxSYSTEM_MENU 0x00000800 wxBORDER_NONE = 0x00200000 #define wxRESIZE_BORDER 0x00000040 #define wxDIALOG_NO_PARENT 0x00000020 */ enum { wxFD_OPEN = 0x0001, wxFD_SAVE = 0x0002, wxFD_OVERWRITE_PROMPT = 0x0004, wxFD_NO_FOLLOW = 0x0008, wxFD_FILE_MUST_EXIST = 0x0010, wxFD_CHANGE_DIR = 0x0080, wxFD_PREVIEW = 0x0100, wxFD_MULTIPLE = 0x0200 }; #define wxFD_DEFAULT_STYLE wxFD_OPEN extern WXDLLIMPEXP_DATA_CORE(const char) wxFileDialogNameStr[]; extern WXDLLIMPEXP_DATA_CORE(const char) wxFileSelectorPromptStr[]; extern WXDLLIMPEXP_DATA_CORE(const char) wxFileSelectorDefaultWildcardStr[]; //---------------------------------------------------------------------------- // wxFileDialogBase //---------------------------------------------------------------------------- class WXDLLIMPEXP_CORE wxFileDialogBase: public wxDialog { public: wxFileDialogBase () { Init(); } wxFileDialogBase(wxWindow *parent, const wxString& message = wxFileSelectorPromptStr, const wxString& defaultDir = wxEmptyString, const wxString& defaultFile = wxEmptyString, const wxString& wildCard = wxFileSelectorDefaultWildcardStr, long style = wxFD_DEFAULT_STYLE, const wxPoint& pos = wxDefaultPosition, const wxSize& sz = wxDefaultSize, const wxString& name = wxFileDialogNameStr) { Init(); Create(parent, message, defaultDir, defaultFile, wildCard, style, pos, sz, name); } virtual ~wxFileDialogBase() {} bool Create(wxWindow *parent, const wxString& message = wxFileSelectorPromptStr, const wxString& defaultDir = wxEmptyString, const wxString& defaultFile = wxEmptyString, const wxString& wildCard = wxFileSelectorDefaultWildcardStr, long style = wxFD_DEFAULT_STYLE, const wxPoint& pos = wxDefaultPosition, const wxSize& sz = wxDefaultSize, const wxString& name = wxFileDialogNameStr); bool HasFdFlag(int flag) const { return HasFlag(flag); } virtual void SetMessage(const wxString& message) { m_message = message; } virtual void SetPath(const wxString& path); virtual void SetDirectory(const wxString& dir); virtual void SetFilename(const wxString& name); virtual void SetWildcard(const wxString& wildCard) { m_wildCard = wildCard; } virtual void SetFilterIndex(int filterIndex) { m_filterIndex = filterIndex; } virtual wxString GetMessage() const { return m_message; } virtual wxString GetPath() const { return m_path; } virtual void GetPaths(wxArrayString& paths) const { paths.Empty(); paths.Add(m_path); } virtual wxString GetDirectory() const { return m_dir; } virtual wxString GetFilename() const { return m_fileName; } virtual void GetFilenames(wxArrayString& files) const { files.Empty(); files.Add(m_fileName); } virtual wxString GetWildcard() const { return m_wildCard; } virtual int GetFilterIndex() const { return m_filterIndex; } virtual wxString GetCurrentlySelectedFilename() const { return m_currentlySelectedFilename; } // this function is called with wxFileDialog as parameter and should // create the window containing the extra controls we want to show in it typedef wxWindow *(*ExtraControlCreatorFunction)(wxWindow*); virtual bool SupportsExtraControl() const { return false; } bool SetExtraControlCreator(ExtraControlCreatorFunction creator); wxWindow *GetExtraControl() const { return m_extraControl; } // Utility functions // Append first extension to filePath from a ';' separated extensionList // if filePath = "path/foo.bar" just return it as is // if filePath = "foo[.]" and extensionList = "*.jpg;*.png" return "foo.jpg" // if the extension is "*.j?g" (has wildcards) or "jpg" then return filePath static wxString AppendExtension(const wxString &filePath, const wxString &extensionList); // Set the filter index to match the given extension. // // This is always valid to call, even if the extension is empty or the // filter list doesn't contain it, the function will just do nothing in // these cases. void SetFilterIndexFromExt(const wxString& ext); protected: wxString m_message; wxString m_dir; wxString m_path; // Full path wxString m_fileName; wxString m_wildCard; int m_filterIndex; // Currently selected, but not yet necessarily accepted by the user, file. // This should be updated whenever the selection in the control changes by // the platform-specific code to provide a useful implementation of // GetCurrentlySelectedFilename(). wxString m_currentlySelectedFilename; wxWindow* m_extraControl; // returns true if control is created (if it already exists returns false) bool CreateExtraControl(); // return true if SetExtraControlCreator() was called bool HasExtraControlCreator() const { return m_extraControlCreator != NULL; } // get the size of the extra control by creating and deleting it wxSize GetExtraControlSize(); private: ExtraControlCreatorFunction m_extraControlCreator; void Init(); wxDECLARE_DYNAMIC_CLASS(wxFileDialogBase); wxDECLARE_NO_COPY_CLASS(wxFileDialogBase); }; //---------------------------------------------------------------------------- // wxFileDialog convenience functions //---------------------------------------------------------------------------- // File selector - backward compatibility WXDLLIMPEXP_CORE wxString wxFileSelector(const wxString& message = wxFileSelectorPromptStr, const wxString& default_path = wxEmptyString, const wxString& default_filename = wxEmptyString, const wxString& default_extension = wxEmptyString, const wxString& wildcard = wxFileSelectorDefaultWildcardStr, int flags = 0, wxWindow *parent = NULL, int x = wxDefaultCoord, int y = wxDefaultCoord); // An extended version of wxFileSelector WXDLLIMPEXP_CORE wxString wxFileSelectorEx(const wxString& message = wxFileSelectorPromptStr, const wxString& default_path = wxEmptyString, const wxString& default_filename = wxEmptyString, int *indexDefaultExtension = NULL, const wxString& wildcard = wxFileSelectorDefaultWildcardStr, int flags = 0, wxWindow *parent = NULL, int x = wxDefaultCoord, int y = wxDefaultCoord); // Ask for filename to load WXDLLIMPEXP_CORE wxString wxLoadFileSelector(const wxString& what, const wxString& extension, const wxString& default_name = wxEmptyString, wxWindow *parent = NULL); // Ask for filename to save WXDLLIMPEXP_CORE wxString wxSaveFileSelector(const wxString& what, const wxString& extension, const wxString& default_name = wxEmptyString, wxWindow *parent = NULL); #if defined (__WXUNIVERSAL__) #define wxHAS_GENERIC_FILEDIALOG #include "wx/generic/filedlgg.h" #elif defined(__WXMSW__) #include "wx/msw/filedlg.h" #elif defined(__WXMOTIF__) #include "wx/motif/filedlg.h" #elif defined(__WXGTK20__) #include "wx/gtk/filedlg.h" // GTK+ > 2.4 has native version #elif defined(__WXGTK__) #include "wx/gtk1/filedlg.h" #elif defined(__WXMAC__) #include "wx/osx/filedlg.h" #elif defined(__WXQT__) #include "wx/qt/filedlg.h" #endif #endif // wxUSE_FILEDLG #endif // _WX_FILEDLG_H_BASE_
h
rticonnextdds-usecases
data/projects/rticonnextdds-usecases/VehicleTracking/ExampleCode/thirdparty/wxWidgets-3.1.2/Win64/include/wx/stdstream.h
///////////////////////////////////////////////////////////////////////////// // Name: wx/stdstream.h // Purpose: Header of std::istream and std::ostream derived wrappers for // wxInputStream and wxOutputStream // Author: Jonathan Liu <[email protected]> // Created: 2009-05-02 // Copyright: (c) 2009 Jonathan Liu // Licence: wxWindows licence ///////////////////////////////////////////////////////////////////////////// #ifndef _WX_STDSTREAM_H_ #define _WX_STDSTREAM_H_ #include "wx/defs.h" // wxUSE_STD_IOSTREAM #if wxUSE_STREAMS && wxUSE_STD_IOSTREAM #include "wx/defs.h" #include "wx/stream.h" #include "wx/ioswrap.h" // ========================================================================== // wxStdInputStreamBuffer // ========================================================================== class WXDLLIMPEXP_BASE wxStdInputStreamBuffer : public std::streambuf { public: wxStdInputStreamBuffer(wxInputStream& stream); virtual ~wxStdInputStreamBuffer() { } protected: virtual std::streambuf *setbuf(char *s, std::streamsize n) wxOVERRIDE; virtual std::streampos seekoff(std::streamoff off, std::ios_base::seekdir way, std::ios_base::openmode which = std::ios_base::in | std::ios_base::out) wxOVERRIDE; virtual std::streampos seekpos(std::streampos sp, std::ios_base::openmode which = std::ios_base::in | std::ios_base::out) wxOVERRIDE; virtual std::streamsize showmanyc() wxOVERRIDE; virtual std::streamsize xsgetn(char *s, std::streamsize n) wxOVERRIDE; virtual int underflow() wxOVERRIDE; virtual int uflow() wxOVERRIDE; virtual int pbackfail(int c = EOF) wxOVERRIDE; // Special work around for VC8/9 (this bug was fixed in VC10 and later): // these versions have non-standard _Xsgetn_s() that it being called from // the stream code instead of xsgetn() and so our overridden implementation // never actually gets used. To work around this, forward to it explicitly. #if defined(__VISUALC8__) || defined(__VISUALC9__) virtual std::streamsize _Xsgetn_s(char *s, size_t WXUNUSED(size), std::streamsize n) { return xsgetn(s, n); } #endif // VC8 or VC9 wxInputStream& m_stream; int m_lastChar; }; // ========================================================================== // wxStdInputStream // ========================================================================== class WXDLLIMPEXP_BASE wxStdInputStream : public std::istream { public: wxStdInputStream(wxInputStream& stream); virtual ~wxStdInputStream() { } protected: wxStdInputStreamBuffer m_streamBuffer; }; // ========================================================================== // wxStdOutputStreamBuffer // ========================================================================== class WXDLLIMPEXP_BASE wxStdOutputStreamBuffer : public std::streambuf { public: wxStdOutputStreamBuffer(wxOutputStream& stream); virtual ~wxStdOutputStreamBuffer() { } protected: virtual std::streambuf *setbuf(char *s, std::streamsize n) wxOVERRIDE; virtual std::streampos seekoff(std::streamoff off, std::ios_base::seekdir way, std::ios_base::openmode which = std::ios_base::in | std::ios_base::out) wxOVERRIDE; virtual std::streampos seekpos(std::streampos sp, std::ios_base::openmode which = std::ios_base::in | std::ios_base::out) wxOVERRIDE; virtual std::streamsize xsputn(const char *s, std::streamsize n) wxOVERRIDE; virtual int overflow(int c) wxOVERRIDE; wxOutputStream& m_stream; }; // ========================================================================== // wxStdOutputStream // ========================================================================== class WXDLLIMPEXP_BASE wxStdOutputStream : public std::ostream { public: wxStdOutputStream(wxOutputStream& stream); virtual ~wxStdOutputStream() { } protected: wxStdOutputStreamBuffer m_streamBuffer; }; #endif // wxUSE_STREAMS && wxUSE_STD_IOSTREAM #endif // _WX_STDSTREAM_H_
h
rticonnextdds-usecases
data/projects/rticonnextdds-usecases/VehicleTracking/ExampleCode/thirdparty/wxWidgets-3.1.2/Win64/include/wx/apptrait.h
/////////////////////////////////////////////////////////////////////////////// // Name: wx/apptrait.h // Purpose: declaration of wxAppTraits and derived classes // Author: Vadim Zeitlin // Modified by: // Created: 19.06.2003 // Copyright: (c) 2003 Vadim Zeitlin <[email protected]> // Licence: wxWindows licence /////////////////////////////////////////////////////////////////////////////// #ifndef _WX_APPTRAIT_H_ #define _WX_APPTRAIT_H_ #include "wx/string.h" #include "wx/platinfo.h" class WXDLLIMPEXP_FWD_BASE wxArrayString; class WXDLLIMPEXP_FWD_BASE wxConfigBase; class WXDLLIMPEXP_FWD_BASE wxEventLoopBase; #if wxUSE_FONTMAP class WXDLLIMPEXP_FWD_CORE wxFontMapper; #endif // wxUSE_FONTMAP class WXDLLIMPEXP_FWD_BASE wxLog; class WXDLLIMPEXP_FWD_BASE wxMessageOutput; class WXDLLIMPEXP_FWD_BASE wxObject; class WXDLLIMPEXP_FWD_CORE wxRendererNative; class WXDLLIMPEXP_FWD_BASE wxStandardPaths; class WXDLLIMPEXP_FWD_BASE wxString; class WXDLLIMPEXP_FWD_BASE wxTimer; class WXDLLIMPEXP_FWD_BASE wxTimerImpl; class wxSocketManager; // ---------------------------------------------------------------------------- // wxAppTraits: this class defines various configurable aspects of wxApp // ---------------------------------------------------------------------------- class WXDLLIMPEXP_BASE wxAppTraitsBase { public: // needed since this class declares virtual members virtual ~wxAppTraitsBase() { } // hooks for working with the global objects, may be overridden by the user // ------------------------------------------------------------------------ #if wxUSE_CONFIG // create the default configuration object (base class version is // implemented in config.cpp and creates wxRegConfig for wxMSW and // wxFileConfig for all the other platforms) virtual wxConfigBase *CreateConfig(); #endif // wxUSE_CONFIG #if wxUSE_LOG // create the default log target virtual wxLog *CreateLogTarget() = 0; #endif // wxUSE_LOG // create the global object used for printing out messages virtual wxMessageOutput *CreateMessageOutput() = 0; #if wxUSE_FONTMAP // create the global font mapper object used for encodings/charset mapping virtual wxFontMapper *CreateFontMapper() = 0; #endif // wxUSE_FONTMAP // get the renderer to use for drawing the generic controls (return value // may be NULL in which case the default renderer for the current platform // is used); this is used in GUI only and always returns NULL in console // // NB: returned pointer will be deleted by the caller virtual wxRendererNative *CreateRenderer() = 0; // wxStandardPaths object is normally the same for wxBase and wxGUI virtual wxStandardPaths& GetStandardPaths(); // functions abstracting differences between GUI and console modes // ------------------------------------------------------------------------ // show the assert dialog with the specified message in GUI or just print // the string to stderr in console mode // // base class version has an implementation (in spite of being pure // virtual) in base/appbase.cpp which can be called as last resort. // // return true to suppress subsequent asserts, false to continue as before virtual bool ShowAssertDialog(const wxString& msg) = 0; // return true if fprintf(stderr) goes somewhere, false otherwise virtual bool HasStderr() = 0; #if wxUSE_SOCKETS // this function is used by wxNet library to set the default socket manager // to use: doing it like this allows us to keep all socket-related code in // wxNet instead of having to pull it in wxBase itself as we'd have to do // if we really implemented wxSocketManager here // // we don't take ownership of this pointer, it should have a lifetime // greater than that of any socket (e.g. be a pointer to a static object) static void SetDefaultSocketManager(wxSocketManager *manager) { ms_manager = manager; } // return socket manager: this is usually different for console and GUI // applications (although some ports use the same implementation for both) virtual wxSocketManager *GetSocketManager() { return ms_manager; } #endif // create a new, port specific, instance of the event loop used by wxApp virtual wxEventLoopBase *CreateEventLoop() = 0; #if wxUSE_TIMER // return platform and toolkit dependent wxTimer implementation virtual wxTimerImpl *CreateTimerImpl(wxTimer *timer) = 0; #endif #if wxUSE_THREADS virtual void MutexGuiEnter(); virtual void MutexGuiLeave(); #endif // functions returning port-specific information // ------------------------------------------------------------------------ // return information about the (native) toolkit currently used and its // runtime (not compile-time) version. // returns wxPORT_BASE for console applications and one of the remaining // wxPORT_* values for GUI applications. virtual wxPortId GetToolkitVersion(int *majVer = NULL, int *minVer = NULL, int *microVer = NULL) const = 0; // return true if the port is using wxUniversal for the GUI, false if not virtual bool IsUsingUniversalWidgets() const = 0; // return the name of the Desktop Environment such as // "KDE" or "GNOME". May return an empty string. virtual wxString GetDesktopEnvironment() const = 0; // returns a short string to identify the block of the standard command // line options parsed automatically by current port: if this string is // empty, there are no such options, otherwise the function also fills // passed arrays with the names and the descriptions of those options. virtual wxString GetStandardCmdLineOptions(wxArrayString& names, wxArrayString& desc) const { wxUnusedVar(names); wxUnusedVar(desc); return wxEmptyString; } protected: #if wxUSE_STACKWALKER // utility function: returns the stack frame as a plain wxString virtual wxString GetAssertStackTrace(); #endif private: static wxSocketManager *ms_manager; }; // ---------------------------------------------------------------------------- // include the platform-specific version of the class // ---------------------------------------------------------------------------- // NB: test for __UNIX__ before __WXMAC__ as under Darwin we want to use the // Unix code (and otherwise __UNIX__ wouldn't be defined) // ABX: check __WIN32__ instead of __WXMSW__ for the same MSWBase in any Win32 port #if defined(__WIN32__) #include "wx/msw/apptbase.h" #elif defined(__UNIX__) #include "wx/unix/apptbase.h" #else // no platform-specific methods to add to wxAppTraits // wxAppTraits must be a class because it was forward declared as class class WXDLLIMPEXP_BASE wxAppTraits : public wxAppTraitsBase { }; #endif // platform // ============================================================================ // standard traits for console and GUI applications // ============================================================================ // ---------------------------------------------------------------------------- // wxConsoleAppTraitsBase: wxAppTraits implementation for the console apps // ---------------------------------------------------------------------------- class WXDLLIMPEXP_BASE wxConsoleAppTraitsBase : public wxAppTraits { public: #if !wxUSE_CONSOLE_EVENTLOOP virtual wxEventLoopBase *CreateEventLoop() wxOVERRIDE { return NULL; } #endif // !wxUSE_CONSOLE_EVENTLOOP #if wxUSE_LOG virtual wxLog *CreateLogTarget() wxOVERRIDE; #endif // wxUSE_LOG virtual wxMessageOutput *CreateMessageOutput() wxOVERRIDE; #if wxUSE_FONTMAP virtual wxFontMapper *CreateFontMapper() wxOVERRIDE; #endif // wxUSE_FONTMAP virtual wxRendererNative *CreateRenderer() wxOVERRIDE; virtual bool ShowAssertDialog(const wxString& msg) wxOVERRIDE; virtual bool HasStderr() wxOVERRIDE; // the GetToolkitVersion for console application is always the same wxPortId GetToolkitVersion(int *verMaj = NULL, int *verMin = NULL, int *verMicro = NULL) const wxOVERRIDE { // no toolkits (wxBase is for console applications without GUI support) // NB: zero means "no toolkit", -1 means "not initialized yet" // so we must use zero here! if (verMaj) *verMaj = 0; if (verMin) *verMin = 0; if (verMicro) *verMicro = 0; return wxPORT_BASE; } virtual bool IsUsingUniversalWidgets() const wxOVERRIDE { return false; } virtual wxString GetDesktopEnvironment() const wxOVERRIDE { return wxEmptyString; } }; // ---------------------------------------------------------------------------- // wxGUIAppTraitsBase: wxAppTraits implementation for the GUI apps // ---------------------------------------------------------------------------- #if wxUSE_GUI class WXDLLIMPEXP_CORE wxGUIAppTraitsBase : public wxAppTraits { public: #if wxUSE_LOG virtual wxLog *CreateLogTarget() wxOVERRIDE; #endif // wxUSE_LOG virtual wxMessageOutput *CreateMessageOutput() wxOVERRIDE; #if wxUSE_FONTMAP virtual wxFontMapper *CreateFontMapper() wxOVERRIDE; #endif // wxUSE_FONTMAP virtual wxRendererNative *CreateRenderer() wxOVERRIDE; virtual bool ShowAssertDialog(const wxString& msg) wxOVERRIDE; virtual bool HasStderr() wxOVERRIDE; virtual bool IsUsingUniversalWidgets() const wxOVERRIDE { #ifdef __WXUNIVERSAL__ return true; #else return false; #endif } virtual wxString GetDesktopEnvironment() const wxOVERRIDE { return wxEmptyString; } }; #endif // wxUSE_GUI // ---------------------------------------------------------------------------- // include the platform-specific version of the classes above // ---------------------------------------------------------------------------- // ABX: check __WIN32__ instead of __WXMSW__ for the same MSWBase in any Win32 port #if defined(__WIN32__) #include "wx/msw/apptrait.h" #elif defined(__UNIX__) #include "wx/unix/apptrait.h" #else #if wxUSE_GUI class wxGUIAppTraits : public wxGUIAppTraitsBase { }; #endif // wxUSE_GUI class wxConsoleAppTraits: public wxConsoleAppTraitsBase { }; #endif // platform #endif // _WX_APPTRAIT_H_
h
rticonnextdds-usecases
data/projects/rticonnextdds-usecases/VehicleTracking/ExampleCode/thirdparty/wxWidgets-3.1.2/Win64/include/wx/link.h
///////////////////////////////////////////////////////////////////////////// // Name: wx/link.h // Purpose: macros to force linking modules which might otherwise be // discarded by the linker // Author: Vaclav Slavik // Copyright: (c) Vaclav Slavik // Licence: wxWindows licence ///////////////////////////////////////////////////////////////////////////// #ifndef _WX_LINK_H_ #define _WX_LINK_H_ // This must be part of the module you want to force: #define wxFORCE_LINK_THIS_MODULE(module_name) \ extern void _wx_link_dummy_func_##module_name (); \ void _wx_link_dummy_func_##module_name () { } // And this must be somewhere where it certainly will be linked: #define wxFORCE_LINK_MODULE(module_name) \ extern void _wx_link_dummy_func_##module_name (); \ static struct wxForceLink##module_name \ { \ wxForceLink##module_name() \ { \ _wx_link_dummy_func_##module_name (); \ } \ } _wx_link_dummy_var_##module_name; #endif // _WX_LINK_H_
h
rticonnextdds-usecases
data/projects/rticonnextdds-usecases/VehicleTracking/ExampleCode/thirdparty/wxWidgets-3.1.2/Win64/include/wx/access.h
///////////////////////////////////////////////////////////////////////////// // Name: wx/access.h // Purpose: Accessibility classes // Author: Julian Smart // Modified by: // Created: 2003-02-12 // Copyright: (c) Julian Smart // Licence: wxWindows licence ///////////////////////////////////////////////////////////////////////////// #ifndef _WX_ACCESSBASE_H_ #define _WX_ACCESSBASE_H_ // ---------------------------------------------------------------------------- // headers we have to include here // ---------------------------------------------------------------------------- #include "wx/defs.h" #if wxUSE_ACCESSIBILITY #include "wx/variant.h" enum wxAccStatus { wxACC_FAIL, wxACC_FALSE, wxACC_OK, wxACC_NOT_IMPLEMENTED, wxACC_NOT_SUPPORTED, wxACC_INVALID_ARG }; // Child ids are integer identifiers from 1 up. // So zero represents 'this' object. #define wxACC_SELF 0 // Navigation constants enum wxNavDir { wxNAVDIR_DOWN, wxNAVDIR_FIRSTCHILD, wxNAVDIR_LASTCHILD, wxNAVDIR_LEFT, wxNAVDIR_NEXT, wxNAVDIR_PREVIOUS, wxNAVDIR_RIGHT, wxNAVDIR_UP }; // Role constants enum wxAccRole { wxROLE_NONE, wxROLE_SYSTEM_ALERT, wxROLE_SYSTEM_ANIMATION, wxROLE_SYSTEM_APPLICATION, wxROLE_SYSTEM_BORDER, wxROLE_SYSTEM_BUTTONDROPDOWN, wxROLE_SYSTEM_BUTTONDROPDOWNGRID, wxROLE_SYSTEM_BUTTONMENU, wxROLE_SYSTEM_CARET, wxROLE_SYSTEM_CELL, wxROLE_SYSTEM_CHARACTER, wxROLE_SYSTEM_CHART, wxROLE_SYSTEM_CHECKBUTTON, wxROLE_SYSTEM_CLIENT, wxROLE_SYSTEM_CLOCK, wxROLE_SYSTEM_COLUMN, wxROLE_SYSTEM_COLUMNHEADER, wxROLE_SYSTEM_COMBOBOX, wxROLE_SYSTEM_CURSOR, wxROLE_SYSTEM_DIAGRAM, wxROLE_SYSTEM_DIAL, wxROLE_SYSTEM_DIALOG, wxROLE_SYSTEM_DOCUMENT, wxROLE_SYSTEM_DROPLIST, wxROLE_SYSTEM_EQUATION, wxROLE_SYSTEM_GRAPHIC, wxROLE_SYSTEM_GRIP, wxROLE_SYSTEM_GROUPING, wxROLE_SYSTEM_HELPBALLOON, wxROLE_SYSTEM_HOTKEYFIELD, wxROLE_SYSTEM_INDICATOR, wxROLE_SYSTEM_LINK, wxROLE_SYSTEM_LIST, wxROLE_SYSTEM_LISTITEM, wxROLE_SYSTEM_MENUBAR, wxROLE_SYSTEM_MENUITEM, wxROLE_SYSTEM_MENUPOPUP, wxROLE_SYSTEM_OUTLINE, wxROLE_SYSTEM_OUTLINEITEM, wxROLE_SYSTEM_PAGETAB, wxROLE_SYSTEM_PAGETABLIST, wxROLE_SYSTEM_PANE, wxROLE_SYSTEM_PROGRESSBAR, wxROLE_SYSTEM_PROPERTYPAGE, wxROLE_SYSTEM_PUSHBUTTON, wxROLE_SYSTEM_RADIOBUTTON, wxROLE_SYSTEM_ROW, wxROLE_SYSTEM_ROWHEADER, wxROLE_SYSTEM_SCROLLBAR, wxROLE_SYSTEM_SEPARATOR, wxROLE_SYSTEM_SLIDER, wxROLE_SYSTEM_SOUND, wxROLE_SYSTEM_SPINBUTTON, wxROLE_SYSTEM_STATICTEXT, wxROLE_SYSTEM_STATUSBAR, wxROLE_SYSTEM_TABLE, wxROLE_SYSTEM_TEXT, wxROLE_SYSTEM_TITLEBAR, wxROLE_SYSTEM_TOOLBAR, wxROLE_SYSTEM_TOOLTIP, wxROLE_SYSTEM_WHITESPACE, wxROLE_SYSTEM_WINDOW }; // Object types enum wxAccObject { wxOBJID_WINDOW = 0x00000000, wxOBJID_SYSMENU = 0xFFFFFFFF, wxOBJID_TITLEBAR = 0xFFFFFFFE, wxOBJID_MENU = 0xFFFFFFFD, wxOBJID_CLIENT = 0xFFFFFFFC, wxOBJID_VSCROLL = 0xFFFFFFFB, wxOBJID_HSCROLL = 0xFFFFFFFA, wxOBJID_SIZEGRIP = 0xFFFFFFF9, wxOBJID_CARET = 0xFFFFFFF8, wxOBJID_CURSOR = 0xFFFFFFF7, wxOBJID_ALERT = 0xFFFFFFF6, wxOBJID_SOUND = 0xFFFFFFF5 }; // Accessible states #define wxACC_STATE_SYSTEM_ALERT_HIGH 0x00000001 #define wxACC_STATE_SYSTEM_ALERT_MEDIUM 0x00000002 #define wxACC_STATE_SYSTEM_ALERT_LOW 0x00000004 #define wxACC_STATE_SYSTEM_ANIMATED 0x00000008 #define wxACC_STATE_SYSTEM_BUSY 0x00000010 #define wxACC_STATE_SYSTEM_CHECKED 0x00000020 #define wxACC_STATE_SYSTEM_COLLAPSED 0x00000040 #define wxACC_STATE_SYSTEM_DEFAULT 0x00000080 #define wxACC_STATE_SYSTEM_EXPANDED 0x00000100 #define wxACC_STATE_SYSTEM_EXTSELECTABLE 0x00000200 #define wxACC_STATE_SYSTEM_FLOATING 0x00000400 #define wxACC_STATE_SYSTEM_FOCUSABLE 0x00000800 #define wxACC_STATE_SYSTEM_FOCUSED 0x00001000 #define wxACC_STATE_SYSTEM_HOTTRACKED 0x00002000 #define wxACC_STATE_SYSTEM_INVISIBLE 0x00004000 #define wxACC_STATE_SYSTEM_MARQUEED 0x00008000 #define wxACC_STATE_SYSTEM_MIXED 0x00010000 #define wxACC_STATE_SYSTEM_MULTISELECTABLE 0x00020000 #define wxACC_STATE_SYSTEM_OFFSCREEN 0x00040000 #define wxACC_STATE_SYSTEM_PRESSED 0x00080000 #define wxACC_STATE_SYSTEM_PROTECTED 0x00100000 #define wxACC_STATE_SYSTEM_READONLY 0x00200000 #define wxACC_STATE_SYSTEM_SELECTABLE 0x00400000 #define wxACC_STATE_SYSTEM_SELECTED 0x00800000 #define wxACC_STATE_SYSTEM_SELFVOICING 0x01000000 #define wxACC_STATE_SYSTEM_UNAVAILABLE 0x02000000 // Selection flag enum wxAccSelectionFlags { wxACC_SEL_NONE = 0, wxACC_SEL_TAKEFOCUS = 1, wxACC_SEL_TAKESELECTION = 2, wxACC_SEL_EXTENDSELECTION = 4, wxACC_SEL_ADDSELECTION = 8, wxACC_SEL_REMOVESELECTION = 16 }; // Accessibility event identifiers #define wxACC_EVENT_SYSTEM_SOUND 0x0001 #define wxACC_EVENT_SYSTEM_ALERT 0x0002 #define wxACC_EVENT_SYSTEM_FOREGROUND 0x0003 #define wxACC_EVENT_SYSTEM_MENUSTART 0x0004 #define wxACC_EVENT_SYSTEM_MENUEND 0x0005 #define wxACC_EVENT_SYSTEM_MENUPOPUPSTART 0x0006 #define wxACC_EVENT_SYSTEM_MENUPOPUPEND 0x0007 #define wxACC_EVENT_SYSTEM_CAPTURESTART 0x0008 #define wxACC_EVENT_SYSTEM_CAPTUREEND 0x0009 #define wxACC_EVENT_SYSTEM_MOVESIZESTART 0x000A #define wxACC_EVENT_SYSTEM_MOVESIZEEND 0x000B #define wxACC_EVENT_SYSTEM_CONTEXTHELPSTART 0x000C #define wxACC_EVENT_SYSTEM_CONTEXTHELPEND 0x000D #define wxACC_EVENT_SYSTEM_DRAGDROPSTART 0x000E #define wxACC_EVENT_SYSTEM_DRAGDROPEND 0x000F #define wxACC_EVENT_SYSTEM_DIALOGSTART 0x0010 #define wxACC_EVENT_SYSTEM_DIALOGEND 0x0011 #define wxACC_EVENT_SYSTEM_SCROLLINGSTART 0x0012 #define wxACC_EVENT_SYSTEM_SCROLLINGEND 0x0013 #define wxACC_EVENT_SYSTEM_SWITCHSTART 0x0014 #define wxACC_EVENT_SYSTEM_SWITCHEND 0x0015 #define wxACC_EVENT_SYSTEM_MINIMIZESTART 0x0016 #define wxACC_EVENT_SYSTEM_MINIMIZEEND 0x0017 #define wxACC_EVENT_OBJECT_CREATE 0x8000 #define wxACC_EVENT_OBJECT_DESTROY 0x8001 #define wxACC_EVENT_OBJECT_SHOW 0x8002 #define wxACC_EVENT_OBJECT_HIDE 0x8003 #define wxACC_EVENT_OBJECT_REORDER 0x8004 #define wxACC_EVENT_OBJECT_FOCUS 0x8005 #define wxACC_EVENT_OBJECT_SELECTION 0x8006 #define wxACC_EVENT_OBJECT_SELECTIONADD 0x8007 #define wxACC_EVENT_OBJECT_SELECTIONREMOVE 0x8008 #define wxACC_EVENT_OBJECT_SELECTIONWITHIN 0x8009 #define wxACC_EVENT_OBJECT_STATECHANGE 0x800A #define wxACC_EVENT_OBJECT_LOCATIONCHANGE 0x800B #define wxACC_EVENT_OBJECT_NAMECHANGE 0x800C #define wxACC_EVENT_OBJECT_DESCRIPTIONCHANGE 0x800D #define wxACC_EVENT_OBJECT_VALUECHANGE 0x800E #define wxACC_EVENT_OBJECT_PARENTCHANGE 0x800F #define wxACC_EVENT_OBJECT_HELPCHANGE 0x8010 #define wxACC_EVENT_OBJECT_DEFACTIONCHANGE 0x8011 #define wxACC_EVENT_OBJECT_ACCELERATORCHANGE 0x8012 // ---------------------------------------------------------------------------- // wxAccessible // All functions return an indication of success, failure, or not implemented. // ---------------------------------------------------------------------------- class WXDLLIMPEXP_FWD_CORE wxAccessible; class WXDLLIMPEXP_FWD_CORE wxWindow; class WXDLLIMPEXP_FWD_CORE wxPoint; class WXDLLIMPEXP_FWD_CORE wxRect; class WXDLLIMPEXP_CORE wxAccessibleBase : public wxObject { wxDECLARE_NO_COPY_CLASS(wxAccessibleBase); public: wxAccessibleBase(wxWindow* win): m_window(win) {} virtual ~wxAccessibleBase() {} // Overridables // Can return either a child object, or an integer // representing the child element, starting from 1. // pt is in screen coordinates. virtual wxAccStatus HitTest(const wxPoint& WXUNUSED(pt), int* WXUNUSED(childId), wxAccessible** WXUNUSED(childObject)) { return wxACC_NOT_IMPLEMENTED; } // Returns the rectangle for this object (id = 0) or a child element (id > 0). // rect is in screen coordinates. virtual wxAccStatus GetLocation(wxRect& WXUNUSED(rect), int WXUNUSED(elementId)) { return wxACC_NOT_IMPLEMENTED; } // Navigates from fromId to toId/toObject. virtual wxAccStatus Navigate(wxNavDir WXUNUSED(navDir), int WXUNUSED(fromId), int* WXUNUSED(toId), wxAccessible** WXUNUSED(toObject)) { return wxACC_NOT_IMPLEMENTED; } // Gets the name of the specified object. virtual wxAccStatus GetName(int WXUNUSED(childId), wxString* WXUNUSED(name)) { return wxACC_NOT_IMPLEMENTED; } // Gets the number of children. virtual wxAccStatus GetChildCount(int* WXUNUSED(childCount)) { return wxACC_NOT_IMPLEMENTED; } // Gets the specified child (starting from 1). // If *child is NULL and return value is wxACC_OK, // this means that the child is a simple element and // not an accessible object. virtual wxAccStatus GetChild(int WXUNUSED(childId), wxAccessible** WXUNUSED(child)) { return wxACC_NOT_IMPLEMENTED; } // Gets the parent, or NULL. virtual wxAccStatus GetParent(wxAccessible** WXUNUSED(parent)) { return wxACC_NOT_IMPLEMENTED; } // Performs the default action. childId is 0 (the action for this object) // or > 0 (the action for a child). // Return wxACC_NOT_SUPPORTED if there is no default action for this // window (e.g. an edit control). virtual wxAccStatus DoDefaultAction(int WXUNUSED(childId)) { return wxACC_NOT_IMPLEMENTED; } // Gets the default action for this object (0) or > 0 (the action for a child). // Return wxACC_OK even if there is no action. actionName is the action, or the empty // string if there is no action. // The retrieved string describes the action that is performed on an object, // not what the object does as a result. For example, a toolbar button that prints // a document has a default action of "Press" rather than "Prints the current document." virtual wxAccStatus GetDefaultAction(int WXUNUSED(childId), wxString* WXUNUSED(actionName)) { return wxACC_NOT_IMPLEMENTED; } // Returns the description for this object or a child. virtual wxAccStatus GetDescription(int WXUNUSED(childId), wxString* WXUNUSED(description)) { return wxACC_NOT_IMPLEMENTED; } // Returns help text for this object or a child, similar to tooltip text. virtual wxAccStatus GetHelpText(int WXUNUSED(childId), wxString* WXUNUSED(helpText)) { return wxACC_NOT_IMPLEMENTED; } // Returns the keyboard shortcut for this object or child. // Return e.g. ALT+K virtual wxAccStatus GetKeyboardShortcut(int WXUNUSED(childId), wxString* WXUNUSED(shortcut)) { return wxACC_NOT_IMPLEMENTED; } // Returns a role constant. virtual wxAccStatus GetRole(int WXUNUSED(childId), wxAccRole* WXUNUSED(role)) { return wxACC_NOT_IMPLEMENTED; } // Returns a state constant. virtual wxAccStatus GetState(int WXUNUSED(childId), long* WXUNUSED(state)) { return wxACC_NOT_IMPLEMENTED; } // Returns a localized string representing the value for the object // or child. virtual wxAccStatus GetValue(int WXUNUSED(childId), wxString* WXUNUSED(strValue)) { return wxACC_NOT_IMPLEMENTED; } // Selects the object or child. virtual wxAccStatus Select(int WXUNUSED(childId), wxAccSelectionFlags WXUNUSED(selectFlags)) { return wxACC_NOT_IMPLEMENTED; } // Gets the window with the keyboard focus. // If childId is 0 and child is NULL, no object in // this subhierarchy has the focus. // If this object has the focus, child should be 'this'. virtual wxAccStatus GetFocus(int* WXUNUSED(childId), wxAccessible** WXUNUSED(child)) { return wxACC_NOT_IMPLEMENTED; } #if wxUSE_VARIANT // Gets a variant representing the selected children // of this object. // Acceptable values: // - a null variant (IsNull() returns TRUE) // - a list variant (GetType() == wxT("list")) // - an integer representing the selected child element, // or 0 if this object is selected (GetType() == wxT("long")) // - a "void*" pointer to a wxAccessible child object virtual wxAccStatus GetSelections(wxVariant* WXUNUSED(selections)) { return wxACC_NOT_IMPLEMENTED; } #endif // wxUSE_VARIANT // Accessors // Returns the window associated with this object. wxWindow* GetWindow() { return m_window; } // Sets the window associated with this object. void SetWindow(wxWindow* window) { m_window = window; } // Operations // Each platform's implementation must define this // static void NotifyEvent(int eventType, wxWindow* window, wxAccObject objectType, // int objectId); private: // Data members wxWindow* m_window; }; // ---------------------------------------------------------------------------- // now include the declaration of the real class // ---------------------------------------------------------------------------- #if defined(__WXMSW__) #include "wx/msw/ole/access.h" #endif #endif // wxUSE_ACCESSIBILITY #endif // _WX_ACCESSBASE_H_
h
rticonnextdds-usecases
data/projects/rticonnextdds-usecases/VehicleTracking/ExampleCode/thirdparty/wxWidgets-3.1.2/Win64/include/wx/volume.h
///////////////////////////////////////////////////////////////////////////// // Name: wx/volume.h // Purpose: wxFSVolume - encapsulates system volume information // Author: George Policello // Modified by: // Created: 28 Jan 02 // Copyright: (c) 2002 George Policello // Licence: wxWindows licence ///////////////////////////////////////////////////////////////////////////// // ---------------------------------------------------------------------------- // wxFSVolume represents a volume/drive in a file system // ---------------------------------------------------------------------------- #ifndef _WX_FSVOLUME_H_ #define _WX_FSVOLUME_H_ #include "wx/defs.h" #if wxUSE_FSVOLUME #include "wx/arrstr.h" // the volume flags enum wxFSVolumeFlags { // is the volume mounted? wxFS_VOL_MOUNTED = 0x0001, // is the volume removable (floppy, CD, ...)? wxFS_VOL_REMOVABLE = 0x0002, // read only? (otherwise read write) wxFS_VOL_READONLY = 0x0004, // network resources wxFS_VOL_REMOTE = 0x0008 }; // the volume types enum wxFSVolumeKind { wxFS_VOL_FLOPPY, wxFS_VOL_DISK, wxFS_VOL_CDROM, wxFS_VOL_DVDROM, wxFS_VOL_NETWORK, wxFS_VOL_OTHER, wxFS_VOL_MAX }; class WXDLLIMPEXP_BASE wxFSVolumeBase { public: // return the array containing the names of the volumes // // only the volumes with the flags such that // (flags & flagsSet) == flagsSet && !(flags & flagsUnset) // are returned (by default, all mounted ones) static wxArrayString GetVolumes(int flagsSet = wxFS_VOL_MOUNTED, int flagsUnset = 0); // stop execution of GetVolumes() called previously (should be called from // another thread, of course) static void CancelSearch(); // create the volume object with this name (should be one of those returned // by GetVolumes()). wxFSVolumeBase(); wxFSVolumeBase(const wxString& name); bool Create(const wxString& name); // accessors // --------- // is this a valid volume? bool IsOk() const; // kind of this volume? wxFSVolumeKind GetKind() const; // flags of this volume? int GetFlags() const; // can we write to this volume? bool IsWritable() const { return !(GetFlags() & wxFS_VOL_READONLY); } // get the name of the volume and the name which should be displayed to the // user wxString GetName() const { return m_volName; } wxString GetDisplayName() const { return m_dispName; } // TODO: operatios (Mount(), Unmount(), Eject(), ...)? protected: // the internal volume name wxString m_volName; // the volume name as it is displayed to the user wxString m_dispName; // have we been initialized correctly? bool m_isOk; }; #if wxUSE_GUI #include "wx/icon.h" #include "wx/iconbndl.h" // only for wxIconArray enum wxFSIconType { wxFS_VOL_ICO_SMALL = 0, wxFS_VOL_ICO_LARGE, wxFS_VOL_ICO_SEL_SMALL, wxFS_VOL_ICO_SEL_LARGE, wxFS_VOL_ICO_MAX }; // wxFSVolume adds GetIcon() to wxFSVolumeBase class WXDLLIMPEXP_CORE wxFSVolume : public wxFSVolumeBase { public: wxFSVolume() : wxFSVolumeBase() { InitIcons(); } wxFSVolume(const wxString& name) : wxFSVolumeBase(name) { InitIcons(); } wxIcon GetIcon(wxFSIconType type) const; private: void InitIcons(); // the different icons for this volume (created on demand) wxIconArray m_icons; }; #else // !wxUSE_GUI // wxFSVolume is the same thing as wxFSVolume in wxBase typedef wxFSVolumeBase wxFSVolume; #endif // wxUSE_GUI/!wxUSE_GUI #endif // wxUSE_FSVOLUME #endif // _WX_FSVOLUME_H_
h
rticonnextdds-usecases
data/projects/rticonnextdds-usecases/VehicleTracking/ExampleCode/thirdparty/wxWidgets-3.1.2/Win64/include/wx/fontutil.h
///////////////////////////////////////////////////////////////////////////// // Name: wx/fontutil.h // Purpose: font-related helper functions // Author: Vadim Zeitlin // Modified by: // Created: 05.11.99 // Copyright: (c) wxWidgets team // Licence: wxWindows licence ///////////////////////////////////////////////////////////////////////////// // General note: this header is private to wxWidgets and is not supposed to be // included by user code. The functions declared here are implemented in // msw/fontutil.cpp for Windows, unix/fontutil.cpp for GTK/Motif &c. #ifndef _WX_FONTUTIL_H_ #define _WX_FONTUTIL_H_ // ---------------------------------------------------------------------------- // headers // ---------------------------------------------------------------------------- #include "wx/font.h" // for wxFont and wxFontEncoding #if defined(__WXMSW__) #include "wx/msw/wrapwin.h" #endif #if defined(__WXQT__) #include <QtGui/QFont> #endif #if defined(__WXOSX__) #include "wx/osx/core/cfref.h" #endif class WXDLLIMPEXP_FWD_BASE wxArrayString; struct WXDLLIMPEXP_FWD_CORE wxNativeEncodingInfo; #if defined(_WX_X_FONTLIKE) // the symbolic names for the XLFD fields (with examples for their value) // // NB: we suppose that the font always starts with the empty token (font name // registry field) as we never use nor generate it anyhow enum wxXLFDField { wxXLFD_FOUNDRY, // adobe wxXLFD_FAMILY, // courier, times, ... wxXLFD_WEIGHT, // black, bold, demibold, medium, regular, light wxXLFD_SLANT, // r/i/o (roman/italique/oblique) wxXLFD_SETWIDTH, // condensed, expanded, ... wxXLFD_ADDSTYLE, // whatever - usually nothing wxXLFD_PIXELSIZE, // size in pixels wxXLFD_POINTSIZE, // size in points wxXLFD_RESX, // 72, 75, 100, ... wxXLFD_RESY, wxXLFD_SPACING, // m/p/c (monospaced/proportional/character cell) wxXLFD_AVGWIDTH, // average width in 1/10 pixels wxXLFD_REGISTRY, // iso8859, rawin, koi8, ... wxXLFD_ENCODING, // 1, r, r, ... wxXLFD_MAX }; #endif // _WX_X_FONTLIKE // ---------------------------------------------------------------------------- // types // ---------------------------------------------------------------------------- // wxNativeFontInfo is platform-specific font representation: this struct // should be considered as opaque font description only used by the native // functions, the user code can only get the objects of this type from // somewhere and pass it somewhere else (possibly save them somewhere using // ToString() and restore them using FromString()) class WXDLLIMPEXP_CORE wxNativeFontInfo { public: #if wxUSE_PANGO PangoFontDescription *description; // Pango font description doesn't have these attributes, so we store them // separately and handle them ourselves in {To,From}String() methods. bool m_underlined; bool m_strikethrough; #elif defined(_WX_X_FONTLIKE) // the members can't be accessed directly as we only parse the // xFontName on demand private: // the components of the XLFD wxString fontElements[wxXLFD_MAX]; // the full XLFD wxString xFontName; // true until SetXFontName() is called bool m_isDefault; // return true if we have already initialized fontElements inline bool HasElements() const; public: // init the elements from an XLFD, return true if ok bool FromXFontName(const wxString& xFontName); // return false if we were never initialized with a valid XLFD bool IsDefault() const { return m_isDefault; } // return the XLFD (using the fontElements if necessary) wxString GetXFontName() const; // get the given XFLD component wxString GetXFontComponent(wxXLFDField field) const; // change the font component void SetXFontComponent(wxXLFDField field, const wxString& value); // set the XFLD void SetXFontName(const wxString& xFontName); #elif defined(__WXMSW__) wxNativeFontInfo(const LOGFONT& lf_) : lf(lf_), pointSize(0.0f) { } LOGFONT lf; // MSW only has limited support for fractional point sizes and we need to // store the fractional point size separately if it was initially specified // as we can't losslessly recover it from LOGFONT later. float pointSize; #elif defined(__WXOSX__) public: wxNativeFontInfo(const wxNativeFontInfo& info) { Init(info); } ~wxNativeFontInfo() { Free(); } wxNativeFontInfo& operator=(const wxNativeFontInfo& info) { if (this != &info) { Free(); Init(info); } return *this; } void InitFromFont(CTFontRef font); void InitFromFontDescriptor(CTFontDescriptorRef font); void Init(const wxNativeFontInfo& info); void Free(); wxString GetFamilyName() const; wxString GetStyleName() const; static void UpdateNamesMap(const wxString& familyname, CTFontDescriptorRef descr); static void UpdateNamesMap(const wxString& familyname, CTFontRef font); static CGFloat GetCTWeight( CTFontRef font ); static CGFloat GetCTWeight( CTFontDescriptorRef font ); static CGFloat GetCTSlant( CTFontDescriptorRef font ); CTFontDescriptorRef GetCTFontDescriptor() const; private: // attributes for regenerating a CTFontDescriptor, stay close to native values // for better roundtrip fidelity CGFloat m_ctWeight; wxFontStyle m_style; CGFloat m_ctSize; wxFontFamily m_family; wxString m_styleName; wxString m_familyName; // native font description wxCFRef<CTFontDescriptorRef> m_descriptor; void CreateCTFontDescriptor(); // these attributes are not part of a CTFont bool m_underlined; bool m_strikethrough; wxFontEncoding m_encoding; public : #elif defined(__WXQT__) QFont m_qtFont; #else // other platforms // // This is a generic implementation that should work on all ports // without specific support by the port. // #define wxNO_NATIVE_FONTINFO float pointSize; wxFontFamily family; wxFontStyle style; int weight; bool underlined; bool strikethrough; wxString faceName; wxFontEncoding encoding; #endif // platforms // default ctor (default copy ctor is ok) wxNativeFontInfo() { Init(); } #if wxUSE_PANGO private: void Init(const wxNativeFontInfo& info); void Free(); public: wxNativeFontInfo(const wxNativeFontInfo& info) { Init(info); } ~wxNativeFontInfo() { Free(); } wxNativeFontInfo& operator=(const wxNativeFontInfo& info) { if (this != &info) { Free(); Init(info); } return *this; } #endif // wxUSE_PANGO // reset to the default state void Init(); // init with the parameters of the given font void InitFromFont(const wxFont& font) { #if wxUSE_PANGO || defined(__WXOSX__) Init(*font.GetNativeFontInfo()); #else // translate all font parameters SetStyle((wxFontStyle)font.GetStyle()); SetNumericWeight(font.GetNumericWeight()); SetUnderlined(font.GetUnderlined()); SetStrikethrough(font.GetStrikethrough()); #if defined(__WXMSW__) if ( font.IsUsingSizeInPixels() ) SetPixelSize(font.GetPixelSize()); else SetFractionalPointSize(font.GetFractionalPointSize()); #else SetFractionalPointSize(font.GetFractionalPointSize()); #endif // set the family/facename SetFamily((wxFontFamily)font.GetFamily()); const wxString& facename = font.GetFaceName(); if ( !facename.empty() ) { SetFaceName(facename); } // deal with encoding now (it may override the font family and facename // so do it after setting them) SetEncoding(font.GetEncoding()); #endif // !wxUSE_PANGO } // accessors and modifiers for the font elements int GetPointSize() const; float GetFractionalPointSize() const; wxSize GetPixelSize() const; wxFontStyle GetStyle() const; wxFontWeight GetWeight() const; int GetNumericWeight() const; bool GetUnderlined() const; bool GetStrikethrough() const; wxString GetFaceName() const; wxFontFamily GetFamily() const; wxFontEncoding GetEncoding() const; void SetPointSize(int pointsize); void SetFractionalPointSize(float pointsize); void SetPixelSize(const wxSize& pixelSize); void SetStyle(wxFontStyle style); void SetNumericWeight(int weight); void SetWeight(wxFontWeight weight); void SetUnderlined(bool underlined); void SetStrikethrough(bool strikethrough); bool SetFaceName(const wxString& facename); void SetFamily(wxFontFamily family); void SetEncoding(wxFontEncoding encoding); // Helper used in many ports: use the normal font size if the input is // negative, as we handle -1 as meaning this for compatibility. void SetSizeOrDefault(float size) { SetFractionalPointSize ( size < 0 ? wxNORMAL_FONT->GetFractionalPointSize() : size ); } // sets the first facename in the given array which is found // to be valid. If no valid facename is given, sets the // first valid facename returned by wxFontEnumerator::GetFacenames(). // Does not return a bool since it cannot fail. void SetFaceName(const wxArrayString &facenames); // it is important to be able to serialize wxNativeFontInfo objects to be // able to store them (in config file, for example) bool FromString(const wxString& s); wxString ToString() const; // we also want to present the native font descriptions to the user in some // human-readable form (it is not platform independent neither, but can // hopefully be understood by the user) bool FromUserString(const wxString& s); wxString ToUserString() const; }; // ---------------------------------------------------------------------------- // font-related functions (common) // ---------------------------------------------------------------------------- // translate a wxFontEncoding into native encoding parameter (defined above), // returning true if an (exact) macth could be found, false otherwise (without // attempting any substitutions) WXDLLIMPEXP_CORE bool wxGetNativeFontEncoding(wxFontEncoding encoding, wxNativeEncodingInfo *info); // test for the existence of the font described by this facename/encoding, // return true if such font(s) exist, false otherwise WXDLLIMPEXP_CORE bool wxTestFontEncoding(const wxNativeEncodingInfo& info); // ---------------------------------------------------------------------------- // font-related functions (X and GTK) // ---------------------------------------------------------------------------- #ifdef _WX_X_FONTLIKE #include "wx/unix/fontutil.h" #endif // X || GDK #endif // _WX_FONTUTIL_H_
h
rticonnextdds-usecases
data/projects/rticonnextdds-usecases/VehicleTracking/ExampleCode/thirdparty/wxWidgets-3.1.2/Win64/include/wx/addremovectrl.h
/////////////////////////////////////////////////////////////////////////////// // Name: wx/addremovectrl.h // Purpose: wxAddRemoveCtrl declaration. // Author: Vadim Zeitlin // Created: 2015-01-29 // Copyright: (c) 2015 Vadim Zeitlin <[email protected]> // Licence: wxWindows licence /////////////////////////////////////////////////////////////////////////////// #ifndef _WX_ADDREMOVECTRL_H_ #define _WX_ADDREMOVECTRL_H_ #include "wx/panel.h" #if wxUSE_ADDREMOVECTRL extern WXDLLIMPEXP_DATA_CORE(const char) wxAddRemoveCtrlNameStr[]; // ---------------------------------------------------------------------------- // wxAddRemoveAdaptor: used by wxAddRemoveCtrl to work with the list control // ---------------------------------------------------------------------------- class WXDLLIMPEXP_CORE wxAddRemoveAdaptor { public: // Default ctor and trivial but virtual dtor. wxAddRemoveAdaptor() { } virtual ~wxAddRemoveAdaptor() { } // Override to return the associated control. virtual wxWindow* GetItemsCtrl() const = 0; // Override to return whether a new item can be added to the control. virtual bool CanAdd() const = 0; // Override to return whether the currently selected item (if any) can be // removed from the control. virtual bool CanRemove() const = 0; // Called when an item should be added, can only be called if CanAdd() // currently returns true. virtual void OnAdd() = 0; // Called when the current item should be removed, can only be called if // CanRemove() currently returns true. virtual void OnRemove() = 0; private: wxDECLARE_NO_COPY_CLASS(wxAddRemoveAdaptor); }; // ---------------------------------------------------------------------------- // wxAddRemoveCtrl: a list-like control combined with add/remove buttons // ---------------------------------------------------------------------------- class WXDLLIMPEXP_CORE wxAddRemoveCtrl : public wxPanel { public: wxAddRemoveCtrl() { Init(); } wxAddRemoveCtrl(wxWindow* parent, wxWindowID winid = wxID_ANY, const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxDefaultSize, long style = 0, const wxString& name = wxAddRemoveCtrlNameStr) { Init(); Create(parent, winid, pos, size, style, name); } bool Create(wxWindow* parent, wxWindowID winid = wxID_ANY, const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxDefaultSize, long style = 0, const wxString& name = wxAddRemoveCtrlNameStr); virtual ~wxAddRemoveCtrl(); // Must be called for the control to be usable, takes ownership of the // pointer. void SetAdaptor(wxAddRemoveAdaptor* adaptor); // Set tooltips to use for the add and remove buttons. void SetButtonsToolTips(const wxString& addtip, const wxString& removetip); protected: virtual wxSize DoGetBestClientSize() const wxOVERRIDE; private: // Common part of all ctors. void Init() { m_impl = NULL; } class wxAddRemoveImpl* m_impl; wxDECLARE_NO_COPY_CLASS(wxAddRemoveCtrl); }; #endif // wxUSE_ADDREMOVECTRL #endif // _WX_ADDREMOVECTRL_H_
h
rticonnextdds-usecases
data/projects/rticonnextdds-usecases/VehicleTracking/ExampleCode/thirdparty/wxWidgets-3.1.2/Win64/include/wx/spinbutt.h
///////////////////////////////////////////////////////////////////////////// // Name: wx/spinbutt.h // Purpose: wxSpinButtonBase class // Author: Julian Smart, Vadim Zeitlin // Modified by: // Created: 23.07.99 // Copyright: (c) Julian Smart // Licence: wxWindows licence ///////////////////////////////////////////////////////////////////////////// #ifndef _WX_SPINBUTT_H_BASE_ #define _WX_SPINBUTT_H_BASE_ // ---------------------------------------------------------------------------- // headers // ---------------------------------------------------------------------------- #include "wx/defs.h" #if wxUSE_SPINBTN #include "wx/control.h" #include "wx/event.h" #include "wx/range.h" #define wxSPIN_BUTTON_NAME wxT("wxSpinButton") // ---------------------------------------------------------------------------- // The wxSpinButton is like a small scrollbar than is often placed next // to a text control. // // Styles: // wxSP_HORIZONTAL: horizontal spin button // wxSP_VERTICAL: vertical spin button (the default) // wxSP_ARROW_KEYS: arrow keys increment/decrement value // wxSP_WRAP: value wraps at either end // ---------------------------------------------------------------------------- class WXDLLIMPEXP_CORE wxSpinButtonBase : public wxControl { public: // ctor initializes the range with the default (0..100) values wxSpinButtonBase() { m_min = 0; m_max = 100; } // accessors virtual int GetValue() const = 0; virtual int GetMin() const { return m_min; } virtual int GetMax() const { return m_max; } wxRange GetRange() const { return wxRange( GetMin(), GetMax() );} // operations virtual void SetValue(int val) = 0; virtual void SetMin(int minVal) { SetRange ( minVal , m_max ) ; } virtual void SetMax(int maxVal) { SetRange ( m_min , maxVal ) ; } virtual void SetRange(int minVal, int maxVal) { m_min = minVal; m_max = maxVal; } void SetRange( const wxRange& range) { SetRange( range.GetMin(), range.GetMax()); } // is this spin button vertically oriented? bool IsVertical() const { return (m_windowStyle & wxSP_VERTICAL) != 0; } protected: // the range value int m_min; int m_max; wxDECLARE_NO_COPY_CLASS(wxSpinButtonBase); }; // ---------------------------------------------------------------------------- // include the declaration of the real class // ---------------------------------------------------------------------------- #if defined(__WXUNIVERSAL__) #include "wx/univ/spinbutt.h" #elif defined(__WXMSW__) #include "wx/msw/spinbutt.h" #elif defined(__WXMOTIF__) #include "wx/motif/spinbutt.h" #elif defined(__WXGTK20__) #include "wx/gtk/spinbutt.h" #elif defined(__WXGTK__) #include "wx/gtk1/spinbutt.h" #elif defined(__WXMAC__) #include "wx/osx/spinbutt.h" #elif defined(__WXQT__) #include "wx/qt/spinbutt.h" #endif // ---------------------------------------------------------------------------- // the wxSpinButton event // ---------------------------------------------------------------------------- class WXDLLIMPEXP_CORE wxSpinEvent : public wxNotifyEvent { public: wxSpinEvent(wxEventType commandType = wxEVT_NULL, int winid = 0) : wxNotifyEvent(commandType, winid) { } wxSpinEvent(const wxSpinEvent& event) : wxNotifyEvent(event) {} // get the current value of the control int GetValue() const { return m_commandInt; } void SetValue(int value) { m_commandInt = value; } int GetPosition() const { return m_commandInt; } void SetPosition(int pos) { m_commandInt = pos; } virtual wxEvent *Clone() const wxOVERRIDE { return new wxSpinEvent(*this); } private: wxDECLARE_DYNAMIC_CLASS_NO_ASSIGN(wxSpinEvent); }; typedef void (wxEvtHandler::*wxSpinEventFunction)(wxSpinEvent&); #define wxSpinEventHandler(func) \ wxEVENT_HANDLER_CAST(wxSpinEventFunction, func) // macros for handling spin events: notice that we must use the real values of // the event type constants and not their references (wxEVT_SPIN[_UP/DOWN]) // here as otherwise the event tables could end up with non-initialized // (because of undefined initialization order of the globals defined in // different translation units) references in them #define EVT_SPIN_UP(winid, func) \ wx__DECLARE_EVT1(wxEVT_SPIN_UP, winid, wxSpinEventHandler(func)) #define EVT_SPIN_DOWN(winid, func) \ wx__DECLARE_EVT1(wxEVT_SPIN_DOWN, winid, wxSpinEventHandler(func)) #define EVT_SPIN(winid, func) \ wx__DECLARE_EVT1(wxEVT_SPIN, winid, wxSpinEventHandler(func)) #endif // wxUSE_SPINBTN #endif // _WX_SPINBUTT_H_BASE_
h
rticonnextdds-usecases
data/projects/rticonnextdds-usecases/VehicleTracking/ExampleCode/thirdparty/wxWidgets-3.1.2/Win64/include/wx/stream.h
///////////////////////////////////////////////////////////////////////////// // Name: wx/stream.h // Purpose: stream classes // Author: Guilhem Lavaux, Guillermo Rodriguez Garcia, Vadim Zeitlin // Modified by: // Created: 11/07/98 // Copyright: (c) Guilhem Lavaux // Licence: wxWindows licence ///////////////////////////////////////////////////////////////////////////// #ifndef _WX_WXSTREAM_H__ #define _WX_WXSTREAM_H__ #include "wx/defs.h" #if wxUSE_STREAMS #include <stdio.h> #include "wx/object.h" #include "wx/string.h" #include "wx/filefn.h" // for wxFileOffset, wxInvalidOffset and wxSeekMode class WXDLLIMPEXP_FWD_BASE wxStreamBase; class WXDLLIMPEXP_FWD_BASE wxInputStream; class WXDLLIMPEXP_FWD_BASE wxOutputStream; typedef wxInputStream& (*__wxInputManip)(wxInputStream&); typedef wxOutputStream& (*__wxOutputManip)(wxOutputStream&); WXDLLIMPEXP_BASE wxOutputStream& wxEndL(wxOutputStream& o_stream); // ---------------------------------------------------------------------------- // constants // ---------------------------------------------------------------------------- enum wxStreamError { wxSTREAM_NO_ERROR = 0, // stream is in good state wxSTREAM_EOF, // EOF reached in Read() or similar wxSTREAM_WRITE_ERROR, // generic write error wxSTREAM_READ_ERROR // generic read error }; const int wxEOF = -1; // ============================================================================ // base stream classes: wxInputStream and wxOutputStream // ============================================================================ // --------------------------------------------------------------------------- // wxStreamBase: common (but non virtual!) base for all stream classes // --------------------------------------------------------------------------- class WXDLLIMPEXP_BASE wxStreamBase : public wxObject { public: wxStreamBase(); virtual ~wxStreamBase(); // error testing wxStreamError GetLastError() const { return m_lasterror; } virtual bool IsOk() const { return GetLastError() == wxSTREAM_NO_ERROR; } bool operator!() const { return !IsOk(); } // reset the stream state void Reset(wxStreamError error = wxSTREAM_NO_ERROR) { m_lasterror = error; } // this doesn't make sense for all streams, always test its return value virtual size_t GetSize() const; virtual wxFileOffset GetLength() const { return wxInvalidOffset; } // returns true if the streams supports seeking to arbitrary offsets virtual bool IsSeekable() const { return false; } protected: virtual wxFileOffset OnSysSeek(wxFileOffset seek, wxSeekMode mode); virtual wxFileOffset OnSysTell() const; size_t m_lastcount; wxStreamError m_lasterror; friend class wxStreamBuffer; wxDECLARE_ABSTRACT_CLASS(wxStreamBase); wxDECLARE_NO_COPY_CLASS(wxStreamBase); }; // ---------------------------------------------------------------------------- // wxInputStream: base class for the input streams // ---------------------------------------------------------------------------- class WXDLLIMPEXP_BASE wxInputStream : public wxStreamBase { public: // ctor and dtor, nothing exciting wxInputStream(); virtual ~wxInputStream(); // IO functions // ------------ // return a character from the stream without removing it, i.e. it will // still be returned by the next call to GetC() // // blocks until something appears in the stream if necessary, if nothing // ever does (i.e. EOF) LastRead() will return 0 (and the return value is // undefined), otherwise 1 virtual char Peek(); // return one byte from the stream, blocking until it appears if // necessary // // on success returns a value between 0 - 255, or wxEOF on EOF or error. int GetC(); // read at most the given number of bytes from the stream // // there are 2 possible situations here: either there is nothing at all in // the stream right now in which case Read() blocks until something appears // (use CanRead() to avoid this) or there is already some data available in // the stream and then Read() doesn't block but returns just the data it // can read without waiting for more // // in any case, if there are not enough bytes in the stream right now, // LastRead() value will be less than size but greater than 0. If it is 0, // it means that EOF has been reached. virtual wxInputStream& Read(void *buffer, size_t size); // Read exactly the given number of bytes, unlike Read(), which may read // less than the requested amount of data without returning an error, this // method either reads all the data or returns false. bool ReadAll(void *buffer, size_t size); // copy the entire contents of this stream into streamOut, stopping only // when EOF is reached or an error occurs wxInputStream& Read(wxOutputStream& streamOut); // status functions // ---------------- // returns the number of bytes read by the last call to Read(), GetC() or // Peek() // // this should be used to discover whether that call succeeded in reading // all the requested data or not virtual size_t LastRead() const { return wxStreamBase::m_lastcount; } // returns true if some data is available in the stream right now, so that // calling Read() wouldn't block virtual bool CanRead() const; // is the stream at EOF? // // note that this cannot be really implemented for all streams and // CanRead() is more reliable than Eof() virtual bool Eof() const; // write back buffer // ----------------- // put back the specified number of bytes into the stream, they will be // fetched by the next call to the read functions // // returns the number of bytes really stuffed back size_t Ungetch(const void *buffer, size_t size); // put back the specified character in the stream // // returns true if ok, false on error bool Ungetch(char c); // position functions // ------------------ // move the stream pointer to the given position (if the stream supports // it) // // returns wxInvalidOffset on error virtual wxFileOffset SeekI(wxFileOffset pos, wxSeekMode mode = wxFromStart); // return the current position of the stream pointer or wxInvalidOffset virtual wxFileOffset TellI() const; // stream-like operators // --------------------- wxInputStream& operator>>(wxOutputStream& out) { return Read(out); } wxInputStream& operator>>(__wxInputManip func) { return func(*this); } protected: // do read up to size bytes of data into the provided buffer // // this method should return 0 if EOF has been reached or an error occurred // (m_lasterror should be set accordingly as well) or the number of bytes // read virtual size_t OnSysRead(void *buffer, size_t size) = 0; // write-back buffer support // ------------------------- // return the pointer to a buffer big enough to hold sizeNeeded bytes char *AllocSpaceWBack(size_t sizeNeeded); // read up to size data from the write back buffer, return the number of // bytes read size_t GetWBack(void *buf, size_t size); // write back buffer or NULL if none char *m_wback; // the size of the buffer size_t m_wbacksize; // the current position in the buffer size_t m_wbackcur; friend class wxStreamBuffer; wxDECLARE_ABSTRACT_CLASS(wxInputStream); wxDECLARE_NO_COPY_CLASS(wxInputStream); }; // ---------------------------------------------------------------------------- // wxOutputStream: base for the output streams // ---------------------------------------------------------------------------- class WXDLLIMPEXP_BASE wxOutputStream : public wxStreamBase { public: wxOutputStream(); virtual ~wxOutputStream(); void PutC(char c); virtual wxOutputStream& Write(const void *buffer, size_t size); // This is ReadAll() equivalent for Write(): it either writes exactly the // given number of bytes or returns false, unlike Write() which can write // less data than requested but still return without error. bool WriteAll(const void *buffer, size_t size); wxOutputStream& Write(wxInputStream& stream_in); virtual wxFileOffset SeekO(wxFileOffset pos, wxSeekMode mode = wxFromStart); virtual wxFileOffset TellO() const; virtual size_t LastWrite() const { return wxStreamBase::m_lastcount; } virtual void Sync(); virtual bool Close() { return true; } wxOutputStream& operator<<(wxInputStream& out) { return Write(out); } wxOutputStream& operator<<( __wxOutputManip func) { return func(*this); } protected: // to be implemented in the derived classes (it should have been pure // virtual) virtual size_t OnSysWrite(const void *buffer, size_t bufsize); friend class wxStreamBuffer; wxDECLARE_ABSTRACT_CLASS(wxOutputStream); wxDECLARE_NO_COPY_CLASS(wxOutputStream); }; // ============================================================================ // helper stream classes // ============================================================================ // --------------------------------------------------------------------------- // A stream for measuring streamed output // --------------------------------------------------------------------------- class WXDLLIMPEXP_BASE wxCountingOutputStream : public wxOutputStream { public: wxCountingOutputStream(); virtual wxFileOffset GetLength() const wxOVERRIDE; bool Ok() const { return IsOk(); } virtual bool IsOk() const wxOVERRIDE { return true; } protected: virtual size_t OnSysWrite(const void *buffer, size_t size) wxOVERRIDE; virtual wxFileOffset OnSysSeek(wxFileOffset pos, wxSeekMode mode) wxOVERRIDE; virtual wxFileOffset OnSysTell() const wxOVERRIDE; size_t m_currentPos, m_lastPos; wxDECLARE_DYNAMIC_CLASS(wxCountingOutputStream); wxDECLARE_NO_COPY_CLASS(wxCountingOutputStream); }; // --------------------------------------------------------------------------- // "Filter" streams // --------------------------------------------------------------------------- class WXDLLIMPEXP_BASE wxFilterInputStream : public wxInputStream { public: wxFilterInputStream(); wxFilterInputStream(wxInputStream& stream); wxFilterInputStream(wxInputStream *stream); virtual ~wxFilterInputStream(); virtual char Peek() wxOVERRIDE { return m_parent_i_stream->Peek(); } virtual wxFileOffset GetLength() const wxOVERRIDE { return m_parent_i_stream->GetLength(); } wxInputStream *GetFilterInputStream() const { return m_parent_i_stream; } protected: wxInputStream *m_parent_i_stream; bool m_owns; wxDECLARE_ABSTRACT_CLASS(wxFilterInputStream); wxDECLARE_NO_COPY_CLASS(wxFilterInputStream); }; class WXDLLIMPEXP_BASE wxFilterOutputStream : public wxOutputStream { public: wxFilterOutputStream(); wxFilterOutputStream(wxOutputStream& stream); wxFilterOutputStream(wxOutputStream *stream); virtual ~wxFilterOutputStream(); virtual wxFileOffset GetLength() const wxOVERRIDE { return m_parent_o_stream->GetLength(); } wxOutputStream *GetFilterOutputStream() const { return m_parent_o_stream; } bool Close() wxOVERRIDE; protected: wxOutputStream *m_parent_o_stream; bool m_owns; wxDECLARE_ABSTRACT_CLASS(wxFilterOutputStream); wxDECLARE_NO_COPY_CLASS(wxFilterOutputStream); }; enum wxStreamProtocolType { wxSTREAM_PROTOCOL, // wxFileSystem protocol (should be only one) wxSTREAM_MIMETYPE, // MIME types the stream handles wxSTREAM_ENCODING, // The HTTP Content-Encodings the stream handles wxSTREAM_FILEEXT // File extensions the stream handles }; void WXDLLIMPEXP_BASE wxUseFilterClasses(); class WXDLLIMPEXP_BASE wxFilterClassFactoryBase : public wxObject { public: virtual ~wxFilterClassFactoryBase() { } wxString GetProtocol() const { return wxString(*GetProtocols()); } wxString PopExtension(const wxString& location) const; virtual const wxChar * const *GetProtocols(wxStreamProtocolType type = wxSTREAM_PROTOCOL) const = 0; bool CanHandle(const wxString& protocol, wxStreamProtocolType type = wxSTREAM_PROTOCOL) const; protected: wxString::size_type FindExtension(const wxString& location) const; wxDECLARE_ABSTRACT_CLASS(wxFilterClassFactoryBase); }; class WXDLLIMPEXP_BASE wxFilterClassFactory : public wxFilterClassFactoryBase { public: virtual ~wxFilterClassFactory() { } virtual wxFilterInputStream *NewStream(wxInputStream& stream) const = 0; virtual wxFilterOutputStream *NewStream(wxOutputStream& stream) const = 0; virtual wxFilterInputStream *NewStream(wxInputStream *stream) const = 0; virtual wxFilterOutputStream *NewStream(wxOutputStream *stream) const = 0; static const wxFilterClassFactory *Find(const wxString& protocol, wxStreamProtocolType type = wxSTREAM_PROTOCOL); static const wxFilterClassFactory *GetFirst(); const wxFilterClassFactory *GetNext() const { return m_next; } void PushFront() { Remove(); m_next = sm_first; sm_first = this; } void Remove(); protected: wxFilterClassFactory() : m_next(this) { } wxFilterClassFactory& operator=(const wxFilterClassFactory&) { return *this; } private: static wxFilterClassFactory *sm_first; wxFilterClassFactory *m_next; wxDECLARE_ABSTRACT_CLASS(wxFilterClassFactory); }; // ============================================================================ // buffered streams // ============================================================================ // --------------------------------------------------------------------------- // Stream buffer: this class can be derived from and passed to // wxBufferedStreams to implement custom buffering // --------------------------------------------------------------------------- class WXDLLIMPEXP_BASE wxStreamBuffer { public: enum BufMode { read, write, read_write }; wxStreamBuffer(wxStreamBase& stream, BufMode mode) { InitWithStream(stream, mode); } wxStreamBuffer(size_t bufsize, wxInputStream& stream) { InitWithStream(stream, read); SetBufferIO(bufsize); } wxStreamBuffer(size_t bufsize, wxOutputStream& stream) { InitWithStream(stream, write); SetBufferIO(bufsize); } wxStreamBuffer(const wxStreamBuffer& buf); virtual ~wxStreamBuffer(); // Filtered IO virtual size_t Read(void *buffer, size_t size); size_t Read(wxStreamBuffer *buf); virtual size_t Write(const void *buffer, size_t size); size_t Write(wxStreamBuffer *buf); virtual char Peek(); virtual char GetChar(); virtual void PutChar(char c); virtual wxFileOffset Tell() const; virtual wxFileOffset Seek(wxFileOffset pos, wxSeekMode mode); // Buffer control void ResetBuffer(); void Truncate(); // NB: the buffer must always be allocated with malloc() if takeOwn is // true as it will be deallocated by free() void SetBufferIO(void *start, void *end, bool takeOwnership = false); void SetBufferIO(void *start, size_t len, bool takeOwnership = false); void SetBufferIO(size_t bufsize); void *GetBufferStart() const { return m_buffer_start; } void *GetBufferEnd() const { return m_buffer_end; } void *GetBufferPos() const { return m_buffer_pos; } size_t GetBufferSize() const { return m_buffer_end - m_buffer_start; } size_t GetIntPosition() const { return m_buffer_pos - m_buffer_start; } void SetIntPosition(size_t pos) { m_buffer_pos = m_buffer_start + pos; } size_t GetLastAccess() const { return m_buffer_end - m_buffer_start; } size_t GetBytesLeft() const { return m_buffer_end - m_buffer_pos; } void Fixed(bool fixed) { m_fixed = fixed; } void Flushable(bool f) { m_flushable = f; } bool FlushBuffer(); bool FillBuffer(); size_t GetDataLeft(); // misc accessors wxStreamBase *GetStream() const { return m_stream; } bool HasBuffer() const { return m_buffer_start != m_buffer_end; } bool IsFixed() const { return m_fixed; } bool IsFlushable() const { return m_flushable; } // only for input/output buffers respectively, returns NULL otherwise wxInputStream *GetInputStream() const; wxOutputStream *GetOutputStream() const; // this constructs a dummy wxStreamBuffer, used by (and exists for) // wxMemoryStreams only, don't use! wxStreamBuffer(BufMode mode); protected: void GetFromBuffer(void *buffer, size_t size); void PutToBuffer(const void *buffer, size_t size); // set the last error to the specified value if we didn't have it before void SetError(wxStreamError err); // common part of several ctors void Init(); // common part of ctors taking wxStreamBase parameter void InitWithStream(wxStreamBase& stream, BufMode mode); // init buffer variables to be empty void InitBuffer(); // free the buffer (always safe to call) void FreeBuffer(); // the buffer itself: the pointers to its start and end and the current // position in the buffer char *m_buffer_start, *m_buffer_end, *m_buffer_pos; // the stream we're associated with wxStreamBase *m_stream; // its mode BufMode m_mode; // flags bool m_destroybuf, // deallocate buffer? m_fixed, m_flushable; wxDECLARE_NO_ASSIGN_CLASS(wxStreamBuffer); }; // --------------------------------------------------------------------------- // wxBufferedInputStream // --------------------------------------------------------------------------- class WXDLLIMPEXP_BASE wxBufferedInputStream : public wxFilterInputStream { public: // create a buffered stream on top of the specified low-level stream // // if a non NULL buffer is given to the stream, it will be deleted by it, // otherwise a default 1KB buffer will be used wxBufferedInputStream(wxInputStream& stream, wxStreamBuffer *buffer = NULL); // ctor allowing to specify the buffer size, it's just a more convenient // alternative to creating wxStreamBuffer, calling its SetBufferIO(bufsize) // and using the ctor above wxBufferedInputStream(wxInputStream& stream, size_t bufsize); virtual ~wxBufferedInputStream(); virtual char Peek() wxOVERRIDE; virtual wxInputStream& Read(void *buffer, size_t size) wxOVERRIDE; // Position functions virtual wxFileOffset SeekI(wxFileOffset pos, wxSeekMode mode = wxFromStart) wxOVERRIDE; virtual wxFileOffset TellI() const wxOVERRIDE; virtual bool IsSeekable() const wxOVERRIDE { return m_parent_i_stream->IsSeekable(); } // the buffer given to the stream will be deleted by it void SetInputStreamBuffer(wxStreamBuffer *buffer); wxStreamBuffer *GetInputStreamBuffer() const { return m_i_streambuf; } protected: virtual size_t OnSysRead(void *buffer, size_t bufsize) wxOVERRIDE; virtual wxFileOffset OnSysSeek(wxFileOffset seek, wxSeekMode mode) wxOVERRIDE; virtual wxFileOffset OnSysTell() const wxOVERRIDE; wxStreamBuffer *m_i_streambuf; wxDECLARE_NO_COPY_CLASS(wxBufferedInputStream); }; // ---------------------------------------------------------------------------- // wxBufferedOutputStream // ---------------------------------------------------------------------------- class WXDLLIMPEXP_BASE wxBufferedOutputStream : public wxFilterOutputStream { public: // create a buffered stream on top of the specified low-level stream // // if a non NULL buffer is given to the stream, it will be deleted by it, // otherwise a default 1KB buffer will be used wxBufferedOutputStream(wxOutputStream& stream, wxStreamBuffer *buffer = NULL); // ctor allowing to specify the buffer size, it's just a more convenient // alternative to creating wxStreamBuffer, calling its SetBufferIO(bufsize) // and using the ctor above wxBufferedOutputStream(wxOutputStream& stream, size_t bufsize); virtual ~wxBufferedOutputStream(); virtual wxOutputStream& Write(const void *buffer, size_t size) wxOVERRIDE; // Position functions virtual wxFileOffset SeekO(wxFileOffset pos, wxSeekMode mode = wxFromStart) wxOVERRIDE; virtual wxFileOffset TellO() const wxOVERRIDE; virtual bool IsSeekable() const wxOVERRIDE { return m_parent_o_stream->IsSeekable(); } void Sync() wxOVERRIDE; bool Close() wxOVERRIDE; virtual wxFileOffset GetLength() const wxOVERRIDE; // the buffer given to the stream will be deleted by it void SetOutputStreamBuffer(wxStreamBuffer *buffer); wxStreamBuffer *GetOutputStreamBuffer() const { return m_o_streambuf; } protected: virtual size_t OnSysWrite(const void *buffer, size_t bufsize) wxOVERRIDE; virtual wxFileOffset OnSysSeek(wxFileOffset seek, wxSeekMode mode) wxOVERRIDE; virtual wxFileOffset OnSysTell() const wxOVERRIDE; wxStreamBuffer *m_o_streambuf; wxDECLARE_NO_COPY_CLASS(wxBufferedOutputStream); }; // --------------------------------------------------------------------------- // wxWrapperInputStream: forwards all IO to another stream. // --------------------------------------------------------------------------- class WXDLLIMPEXP_BASE wxWrapperInputStream : public wxFilterInputStream { public: // Constructor fully initializing the stream. The overload taking pointer // takes ownership of the parent stream, the one taking reference does not. // // Notice that this class also has a default ctor but it's protected as the // derived class is supposed to take care of calling InitParentStream() if // it's used. wxWrapperInputStream(wxInputStream& stream); wxWrapperInputStream(wxInputStream* stream); // Override the base class methods to forward to the wrapped stream. virtual wxFileOffset GetLength() const wxOVERRIDE; virtual bool IsSeekable() const wxOVERRIDE; protected: virtual size_t OnSysRead(void *buffer, size_t size) wxOVERRIDE; virtual wxFileOffset OnSysSeek(wxFileOffset pos, wxSeekMode mode) wxOVERRIDE; virtual wxFileOffset OnSysTell() const wxOVERRIDE; // Ensure that our own last error is the same as that of the real stream. // // This method is const because the error must be updated even from const // methods (in other words, it really should have been mutable in the first // place). void SynchronizeLastError() const { const_cast<wxWrapperInputStream*>(this)-> Reset(m_parent_i_stream->GetLastError()); } // Default constructor, use InitParentStream() later. wxWrapperInputStream(); // Set up the wrapped stream for an object initialized using the default // constructor. The ownership logic is the same as above. void InitParentStream(wxInputStream& stream); void InitParentStream(wxInputStream* stream); wxDECLARE_NO_COPY_CLASS(wxWrapperInputStream); }; #endif // wxUSE_STREAMS #endif // _WX_WXSTREAM_H__
h
rticonnextdds-usecases
data/projects/rticonnextdds-usecases/VehicleTracking/ExampleCode/thirdparty/wxWidgets-3.1.2/Win64/include/wx/setup_redirect.h
/* * wx/setup.h * * This file should not normally be used, except where makefiles * have not yet been adjusted to take into account of the new scheme * whereby a setup.h is created under the lib directory. * * Copyright: (c) Vadim Zeitlin * Licence: wxWindows Licence */ #ifdef __WXMSW__ #include "wx/msw/setup.h" #else #error Please adjust your include path to pick up the wx/setup.h file under lib first. #endif
h
rticonnextdds-usecases
data/projects/rticonnextdds-usecases/VehicleTracking/ExampleCode/thirdparty/wxWidgets-3.1.2/Win64/include/wx/docview.h
///////////////////////////////////////////////////////////////////////////// // Name: wx/docview.h // Purpose: Doc/View classes // Author: Julian Smart // Modified by: // Created: 01/02/97 // Copyright: (c) Julian Smart // Licence: wxWindows licence ///////////////////////////////////////////////////////////////////////////// #ifndef _WX_DOCH__ #define _WX_DOCH__ #include "wx/defs.h" #if wxUSE_DOC_VIEW_ARCHITECTURE #include "wx/list.h" #include "wx/dlist.h" #include "wx/string.h" #include "wx/frame.h" #include "wx/filehistory.h" #include "wx/vector.h" #if wxUSE_PRINTING_ARCHITECTURE #include "wx/print.h" #endif class WXDLLIMPEXP_FWD_CORE wxWindow; class WXDLLIMPEXP_FWD_CORE wxDocument; class WXDLLIMPEXP_FWD_CORE wxView; class WXDLLIMPEXP_FWD_CORE wxDocTemplate; class WXDLLIMPEXP_FWD_CORE wxDocManager; class WXDLLIMPEXP_FWD_CORE wxPrintInfo; class WXDLLIMPEXP_FWD_CORE wxCommandProcessor; class WXDLLIMPEXP_FWD_BASE wxConfigBase; class wxDocChildFrameAnyBase; #if wxUSE_STD_IOSTREAM #include "wx/iosfwrap.h" #else #include "wx/stream.h" #endif // Flags for wxDocManager (can be combined). enum { wxDOC_NEW = 1, wxDOC_SILENT = 2 }; // Document template flags enum { wxTEMPLATE_VISIBLE = 1, wxTEMPLATE_INVISIBLE = 2, wxDEFAULT_TEMPLATE_FLAGS = wxTEMPLATE_VISIBLE }; #define wxMAX_FILE_HISTORY 9 typedef wxVector<wxDocument*> wxDocVector; typedef wxVector<wxView*> wxViewVector; typedef wxVector<wxDocTemplate*> wxDocTemplateVector; class WXDLLIMPEXP_CORE wxDocument : public wxEvtHandler { public: wxDocument(wxDocument *parent = NULL); virtual ~wxDocument(); // accessors void SetFilename(const wxString& filename, bool notifyViews = false); wxString GetFilename() const { return m_documentFile; } void SetTitle(const wxString& title) { m_documentTitle = title; } wxString GetTitle() const { return m_documentTitle; } void SetDocumentName(const wxString& name) { m_documentTypeName = name; } wxString GetDocumentName() const { return m_documentTypeName; } // access the flag indicating whether this document had been already saved, // SetDocumentSaved() is only used internally, don't call it bool GetDocumentSaved() const { return m_savedYet; } void SetDocumentSaved(bool saved = true) { m_savedYet = saved; } // activate the first view of the document if any void Activate(); // return true if the document hasn't been modified since the last time it // was saved (implying that it returns false if it was never saved, even if // the document is not modified) bool AlreadySaved() const { return !IsModified() && GetDocumentSaved(); } virtual bool Close(); virtual bool Save(); virtual bool SaveAs(); virtual bool Revert(); #if wxUSE_STD_IOSTREAM virtual wxSTD ostream& SaveObject(wxSTD ostream& stream); virtual wxSTD istream& LoadObject(wxSTD istream& stream); #else virtual wxOutputStream& SaveObject(wxOutputStream& stream); virtual wxInputStream& LoadObject(wxInputStream& stream); #endif // Called by wxWidgets virtual bool OnSaveDocument(const wxString& filename); virtual bool OnOpenDocument(const wxString& filename); virtual bool OnNewDocument(); virtual bool OnCloseDocument(); // Prompts for saving if about to close a modified document. Returns true // if ok to close the document (may have saved in the meantime, or set // modified to false) virtual bool OnSaveModified(); // if you override, remember to call the default // implementation (wxDocument::OnChangeFilename) virtual void OnChangeFilename(bool notifyViews); // Called by framework if created automatically by the default document // manager: gives document a chance to initialise and (usually) create a // view virtual bool OnCreate(const wxString& path, long flags); // By default, creates a base wxCommandProcessor. virtual wxCommandProcessor *OnCreateCommandProcessor(); virtual wxCommandProcessor *GetCommandProcessor() const { return m_commandProcessor; } virtual void SetCommandProcessor(wxCommandProcessor *proc) { m_commandProcessor = proc; } // Called after a view is added or removed. The default implementation // deletes the document if this is there are no more views. virtual void OnChangedViewList(); // Called from OnCloseDocument(), does nothing by default but may be // overridden. Return value is ignored. virtual bool DeleteContents(); virtual bool Draw(wxDC&); virtual bool IsModified() const { return m_documentModified; } virtual void Modify(bool mod); virtual bool AddView(wxView *view); virtual bool RemoveView(wxView *view); wxViewVector GetViewsVector() const; wxList& GetViews() { return m_documentViews; } const wxList& GetViews() const { return m_documentViews; } wxView *GetFirstView() const; virtual void UpdateAllViews(wxView *sender = NULL, wxObject *hint = NULL); virtual void NotifyClosing(); // Remove all views (because we're closing the document) virtual bool DeleteAllViews(); // Other stuff virtual wxDocManager *GetDocumentManager() const; virtual wxDocTemplate *GetDocumentTemplate() const { return m_documentTemplate; } virtual void SetDocumentTemplate(wxDocTemplate *temp) { m_documentTemplate = temp; } // Get the document name to be shown to the user: the title if there is // any, otherwise the filename if the document was saved and, finally, // "unnamed" otherwise virtual wxString GetUserReadableName() const; #if WXWIN_COMPATIBILITY_2_8 // use GetUserReadableName() instead wxDEPRECATED_BUT_USED_INTERNALLY( virtual bool GetPrintableName(wxString& buf) const ); #endif // WXWIN_COMPATIBILITY_2_8 // Returns a window that can be used as a parent for document-related // dialogs. Override if necessary. virtual wxWindow *GetDocumentWindow() const; // Returns true if this document is a child document corresponding to a // part of the parent document and not a disk file as usual. bool IsChildDocument() const { return m_documentParent != NULL; } protected: wxList m_documentViews; wxString m_documentFile; wxString m_documentTitle; wxString m_documentTypeName; wxDocTemplate* m_documentTemplate; bool m_documentModified; // if the document parent is non-NULL, it's a pseudo-document corresponding // to a part of the parent document which can't be saved or loaded // independently of its parent and is always closed when its parent is wxDocument* m_documentParent; wxCommandProcessor* m_commandProcessor; bool m_savedYet; // Called by OnSaveDocument and OnOpenDocument to implement standard // Save/Load behaviour. Re-implement in derived class for custom // behaviour. virtual bool DoSaveDocument(const wxString& file); virtual bool DoOpenDocument(const wxString& file); // the default implementation of GetUserReadableName() wxString DoGetUserReadableName() const; private: // list of all documents whose m_documentParent is this one typedef wxDList<wxDocument> DocsList; DocsList m_childDocuments; wxDECLARE_ABSTRACT_CLASS(wxDocument); wxDECLARE_NO_COPY_CLASS(wxDocument); }; class WXDLLIMPEXP_CORE wxView: public wxEvtHandler { public: wxView(); virtual ~wxView(); wxDocument *GetDocument() const { return m_viewDocument; } virtual void SetDocument(wxDocument *doc); wxString GetViewName() const { return m_viewTypeName; } void SetViewName(const wxString& name) { m_viewTypeName = name; } wxWindow *GetFrame() const { return m_viewFrame ; } void SetFrame(wxWindow *frame) { m_viewFrame = frame; } virtual void OnActivateView(bool activate, wxView *activeView, wxView *deactiveView); virtual void OnDraw(wxDC *dc) = 0; virtual void OnPrint(wxDC *dc, wxObject *info); virtual void OnUpdate(wxView *sender, wxObject *hint = NULL); virtual void OnClosingDocument() {} virtual void OnChangeFilename(); // Called by framework if created automatically by the default document // manager class: gives view a chance to initialise virtual bool OnCreate(wxDocument *WXUNUSED(doc), long WXUNUSED(flags)) { return true; } // Checks if the view is the last one for the document; if so, asks user // to confirm save data (if modified). If ok, deletes itself and returns // true. virtual bool Close(bool deleteWindow = true); // Override to do cleanup/veto close virtual bool OnClose(bool deleteWindow); // A view's window can call this to notify the view it is (in)active. // The function then notifies the document manager. virtual void Activate(bool activate); wxDocManager *GetDocumentManager() const { return m_viewDocument->GetDocumentManager(); } #if wxUSE_PRINTING_ARCHITECTURE virtual wxPrintout *OnCreatePrintout(); #endif // implementation only // ------------------- // set the associated frame, it is used to reset its view when we're // destroyed void SetDocChildFrame(wxDocChildFrameAnyBase *docChildFrame); // get the associated frame, may be NULL during destruction wxDocChildFrameAnyBase* GetDocChildFrame() const { return m_docChildFrame; } protected: // hook the document into event handlers chain here virtual bool TryBefore(wxEvent& event) wxOVERRIDE; wxDocument* m_viewDocument; wxString m_viewTypeName; wxWindow* m_viewFrame; wxDocChildFrameAnyBase *m_docChildFrame; private: wxDECLARE_ABSTRACT_CLASS(wxView); wxDECLARE_NO_COPY_CLASS(wxView); }; // Represents user interface (and other) properties of documents and views class WXDLLIMPEXP_CORE wxDocTemplate: public wxObject { friend class WXDLLIMPEXP_FWD_CORE wxDocManager; public: // Associate document and view types. They're for identifying what view is // associated with what template/document type wxDocTemplate(wxDocManager *manager, const wxString& descr, const wxString& filter, const wxString& dir, const wxString& ext, const wxString& docTypeName, const wxString& viewTypeName, wxClassInfo *docClassInfo = NULL, wxClassInfo *viewClassInfo = NULL, long flags = wxDEFAULT_TEMPLATE_FLAGS); virtual ~wxDocTemplate(); // By default, these two member functions dynamically creates document and // view using dynamic instance construction. Override these if you need a // different method of construction. virtual wxDocument *CreateDocument(const wxString& path, long flags = 0); virtual wxView *CreateView(wxDocument *doc, long flags = 0); // Helper method for CreateDocument; also allows you to do your own document // creation virtual bool InitDocument(wxDocument* doc, const wxString& path, long flags = 0); wxString GetDefaultExtension() const { return m_defaultExt; } wxString GetDescription() const { return m_description; } wxString GetDirectory() const { return m_directory; } wxDocManager *GetDocumentManager() const { return m_documentManager; } void SetDocumentManager(wxDocManager *manager) { m_documentManager = manager; } wxString GetFileFilter() const { return m_fileFilter; } long GetFlags() const { return m_flags; } virtual wxString GetViewName() const { return m_viewTypeName; } virtual wxString GetDocumentName() const { return m_docTypeName; } void SetFileFilter(const wxString& filter) { m_fileFilter = filter; } void SetDirectory(const wxString& dir) { m_directory = dir; } void SetDescription(const wxString& descr) { m_description = descr; } void SetDefaultExtension(const wxString& ext) { m_defaultExt = ext; } void SetFlags(long flags) { m_flags = flags; } bool IsVisible() const { return (m_flags & wxTEMPLATE_VISIBLE) != 0; } wxClassInfo* GetDocClassInfo() const { return m_docClassInfo; } wxClassInfo* GetViewClassInfo() const { return m_viewClassInfo; } virtual bool FileMatchesTemplate(const wxString& path); protected: long m_flags; wxString m_fileFilter; wxString m_directory; wxString m_description; wxString m_defaultExt; wxString m_docTypeName; wxString m_viewTypeName; wxDocManager* m_documentManager; // For dynamic creation of appropriate instances. wxClassInfo* m_docClassInfo; wxClassInfo* m_viewClassInfo; // Called by CreateDocument and CreateView to create the actual // document/view object. // // By default uses the ClassInfo provided to the constructor. Override // these functions to provide a different method of creation. virtual wxDocument *DoCreateDocument(); virtual wxView *DoCreateView(); private: wxDECLARE_CLASS(wxDocTemplate); wxDECLARE_NO_COPY_CLASS(wxDocTemplate); }; // One object of this class may be created in an application, to manage all // the templates and documents. class WXDLLIMPEXP_CORE wxDocManager: public wxEvtHandler { public: // NB: flags are unused, don't pass wxDOC_XXX to this ctor wxDocManager(long flags = 0, bool initialize = true); virtual ~wxDocManager(); virtual bool Initialize(); // Handlers for common user commands void OnFileClose(wxCommandEvent& event); void OnFileCloseAll(wxCommandEvent& event); void OnFileNew(wxCommandEvent& event); void OnFileOpen(wxCommandEvent& event); void OnFileRevert(wxCommandEvent& event); void OnFileSave(wxCommandEvent& event); void OnFileSaveAs(wxCommandEvent& event); void OnMRUFile(wxCommandEvent& event); #if wxUSE_PRINTING_ARCHITECTURE void OnPrint(wxCommandEvent& event); void OnPreview(wxCommandEvent& event); void OnPageSetup(wxCommandEvent& event); #endif // wxUSE_PRINTING_ARCHITECTURE void OnUndo(wxCommandEvent& event); void OnRedo(wxCommandEvent& event); // Handlers for UI update commands void OnUpdateFileOpen(wxUpdateUIEvent& event); void OnUpdateDisableIfNoDoc(wxUpdateUIEvent& event); void OnUpdateFileRevert(wxUpdateUIEvent& event); void OnUpdateFileNew(wxUpdateUIEvent& event); void OnUpdateFileSave(wxUpdateUIEvent& event); void OnUpdateFileSaveAs(wxUpdateUIEvent& event); void OnUpdateUndo(wxUpdateUIEvent& event); void OnUpdateRedo(wxUpdateUIEvent& event); // called when file format detection didn't work, can be overridden to do // something in this case virtual void OnOpenFileFailure() { } virtual wxDocument *CreateDocument(const wxString& path, long flags = 0); // wrapper around CreateDocument() with a more clear name wxDocument *CreateNewDocument() { return CreateDocument(wxString(), wxDOC_NEW); } virtual wxView *CreateView(wxDocument *doc, long flags = 0); virtual void DeleteTemplate(wxDocTemplate *temp, long flags = 0); virtual bool FlushDoc(wxDocument *doc); virtual wxDocTemplate *MatchTemplate(const wxString& path); virtual wxDocTemplate *SelectDocumentPath(wxDocTemplate **templates, int noTemplates, wxString& path, long flags, bool save = false); virtual wxDocTemplate *SelectDocumentType(wxDocTemplate **templates, int noTemplates, bool sort = false); virtual wxDocTemplate *SelectViewType(wxDocTemplate **templates, int noTemplates, bool sort = false); virtual wxDocTemplate *FindTemplateForPath(const wxString& path); void AssociateTemplate(wxDocTemplate *temp); void DisassociateTemplate(wxDocTemplate *temp); // Find template from document class info, may return NULL. wxDocTemplate* FindTemplate(const wxClassInfo* documentClassInfo); // Find document from file name, may return NULL. wxDocument* FindDocumentByPath(const wxString& path) const; wxDocument *GetCurrentDocument() const; void SetMaxDocsOpen(int n) { m_maxDocsOpen = n; } int GetMaxDocsOpen() const { return m_maxDocsOpen; } // Add and remove a document from the manager's list void AddDocument(wxDocument *doc); void RemoveDocument(wxDocument *doc); // closes all currently open documents bool CloseDocuments(bool force = true); // closes the specified document bool CloseDocument(wxDocument* doc, bool force = false); // Clear remaining documents and templates bool Clear(bool force = true); // Views or windows should inform the document manager // when a view is going in or out of focus virtual void ActivateView(wxView *view, bool activate = true); virtual wxView *GetCurrentView() const { return m_currentView; } // This method tries to find an active view harder than GetCurrentView(): // if the latter is NULL, it also checks if we don't have just a single // view and returns it then. wxView *GetAnyUsableView() const; wxDocVector GetDocumentsVector() const; wxDocTemplateVector GetTemplatesVector() const; wxList& GetDocuments() { return m_docs; } wxList& GetTemplates() { return m_templates; } // Return the default name for a new document (by default returns strings // in the form "unnamed <counter>" but can be overridden) virtual wxString MakeNewDocumentName(); // Make a frame title (override this to do something different) virtual wxString MakeFrameTitle(wxDocument* doc); virtual wxFileHistory *OnCreateFileHistory(); virtual wxFileHistory *GetFileHistory() const { return m_fileHistory; } // File history management virtual void AddFileToHistory(const wxString& file); virtual void RemoveFileFromHistory(size_t i); virtual size_t GetHistoryFilesCount() const; virtual wxString GetHistoryFile(size_t i) const; virtual void FileHistoryUseMenu(wxMenu *menu); virtual void FileHistoryRemoveMenu(wxMenu *menu); #if wxUSE_CONFIG virtual void FileHistoryLoad(const wxConfigBase& config); virtual void FileHistorySave(wxConfigBase& config); #endif // wxUSE_CONFIG virtual void FileHistoryAddFilesToMenu(); virtual void FileHistoryAddFilesToMenu(wxMenu* menu); wxString GetLastDirectory() const; void SetLastDirectory(const wxString& dir) { m_lastDirectory = dir; } // Get the current document manager static wxDocManager* GetDocumentManager() { return sm_docManager; } #if wxUSE_PRINTING_ARCHITECTURE wxPageSetupDialogData& GetPageSetupDialogData() { return m_pageSetupDialogData; } const wxPageSetupDialogData& GetPageSetupDialogData() const { return m_pageSetupDialogData; } #endif // wxUSE_PRINTING_ARCHITECTURE #if WXWIN_COMPATIBILITY_2_8 // deprecated, override GetDefaultName() instead wxDEPRECATED_BUT_USED_INTERNALLY( virtual bool MakeDefaultName(wxString& buf) ); #endif protected: // Called when a file selected from the MRU list doesn't exist any more. // The default behaviour is to remove the file from the MRU and notify the // user about it but this method can be overridden to customize it. virtual void OnMRUFileNotExist(unsigned n, const wxString& filename); // Open the MRU file with the given index in our associated file history. void DoOpenMRUFile(unsigned n); #if wxUSE_PRINTING_ARCHITECTURE virtual wxPreviewFrame* CreatePreviewFrame(wxPrintPreviewBase* preview, wxWindow *parent, const wxString& title); #endif // wxUSE_PRINTING_ARCHITECTURE // hook the currently active view into event handlers chain here virtual bool TryBefore(wxEvent& event) wxOVERRIDE; // return the command processor for the current document, if any wxCommandProcessor *GetCurrentCommandProcessor() const; int m_defaultDocumentNameCounter; int m_maxDocsOpen; wxList m_docs; wxList m_templates; wxView* m_currentView; wxFileHistory* m_fileHistory; wxString m_lastDirectory; static wxDocManager* sm_docManager; #if wxUSE_PRINTING_ARCHITECTURE wxPageSetupDialogData m_pageSetupDialogData; #endif // wxUSE_PRINTING_ARCHITECTURE wxDECLARE_EVENT_TABLE(); wxDECLARE_DYNAMIC_CLASS(wxDocManager); wxDECLARE_NO_COPY_CLASS(wxDocManager); }; // ---------------------------------------------------------------------------- // Base class for child frames -- this is what wxView renders itself into // // Notice that this is a mix-in class so it doesn't derive from wxWindow, only // wxDocChildFrameAny does // ---------------------------------------------------------------------------- class WXDLLIMPEXP_CORE wxDocChildFrameAnyBase { public: // default ctor, use Create() after it wxDocChildFrameAnyBase() { m_childDocument = NULL; m_childView = NULL; m_win = NULL; m_lastEvent = NULL; } // full ctor equivalent to using the default one and Create() wxDocChildFrameAnyBase(wxDocument *doc, wxView *view, wxWindow *win) { Create(doc, view, win); } // method which must be called for an object created using the default ctor // // note that it returns bool just for consistency with Create() methods in // other classes, we never return false from here bool Create(wxDocument *doc, wxView *view, wxWindow *win) { m_childDocument = doc; m_childView = view; m_win = win; if ( view ) view->SetDocChildFrame(this); return true; } // dtor doesn't need to be virtual, an object should never be destroyed via // a pointer to this class ~wxDocChildFrameAnyBase() { // prevent the view from deleting us if we're being deleted directly // (and not via Close() + Destroy()) if ( m_childView ) m_childView->SetDocChildFrame(NULL); } wxDocument *GetDocument() const { return m_childDocument; } wxView *GetView() const { return m_childView; } void SetDocument(wxDocument *doc) { m_childDocument = doc; } void SetView(wxView *view) { m_childView = view; } wxWindow *GetWindow() const { return m_win; } // implementation only // Check if this event had been just processed in this frame. bool HasAlreadyProcessed(wxEvent& event) const { return m_lastEvent == &event; } protected: // we're not a wxEvtHandler but we provide this wxEvtHandler-like function // which is called from TryBefore() of the derived classes to give our view // a chance to process the message before the frame event handlers are used bool TryProcessEvent(wxEvent& event); // called from EVT_CLOSE handler in the frame: check if we can close and do // cleanup if so; veto the event otherwise bool CloseView(wxCloseEvent& event); wxDocument* m_childDocument; wxView* m_childView; // the associated window: having it here is not terribly elegant but it // allows us to avoid having any virtual functions in this class wxWindow* m_win; private: // Pointer to the last processed event used to avoid sending the same event // twice to wxDocManager, from here and from wxDocParentFrameAnyBase. wxEvent* m_lastEvent; wxDECLARE_NO_COPY_CLASS(wxDocChildFrameAnyBase); }; // ---------------------------------------------------------------------------- // Template implementing child frame concept using the given wxFrame-like class // // This is used to define wxDocChildFrame and wxDocMDIChildFrame: ChildFrame is // a wxFrame or wxMDIChildFrame (although in theory it could be any wxWindow- // derived class as long as it provided a ctor with the same signature as // wxFrame and OnActivate() method) and ParentFrame is either wxFrame or // wxMDIParentFrame. // ---------------------------------------------------------------------------- // Note that we intentionally do not use WXDLLIMPEXP_CORE for this class as it // has only inline methods. template <class ChildFrame, class ParentFrame> class wxDocChildFrameAny : public ChildFrame, public wxDocChildFrameAnyBase { public: typedef ChildFrame BaseClass; // default ctor, use Create after it wxDocChildFrameAny() { } // ctor for a frame showing the given view of the specified document wxDocChildFrameAny(wxDocument *doc, wxView *view, ParentFrame *parent, wxWindowID id, const wxString& title, const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxDefaultSize, long style = wxDEFAULT_FRAME_STYLE, const wxString& name = wxFrameNameStr) { Create(doc, view, parent, id, title, pos, size, style, name); } bool Create(wxDocument *doc, wxView *view, ParentFrame *parent, wxWindowID id, const wxString& title, const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxDefaultSize, long style = wxDEFAULT_FRAME_STYLE, const wxString& name = wxFrameNameStr) { if ( !wxDocChildFrameAnyBase::Create(doc, view, this) ) return false; if ( !BaseClass::Create(parent, id, title, pos, size, style, name) ) return false; this->Bind(wxEVT_ACTIVATE, &wxDocChildFrameAny::OnActivate, this); this->Bind(wxEVT_CLOSE_WINDOW, &wxDocChildFrameAny::OnCloseWindow, this); return true; } protected: // hook the child view into event handlers chain here virtual bool TryBefore(wxEvent& event) wxOVERRIDE { return TryProcessEvent(event) || BaseClass::TryBefore(event); } private: void OnActivate(wxActivateEvent& event) { BaseClass::OnActivate(event); if ( m_childView ) m_childView->Activate(event.GetActive()); } void OnCloseWindow(wxCloseEvent& event) { if ( CloseView(event) ) BaseClass::Destroy(); //else: vetoed } wxDECLARE_NO_COPY_TEMPLATE_CLASS_2(wxDocChildFrameAny, ChildFrame, ParentFrame); }; // ---------------------------------------------------------------------------- // A default child frame: we need to define it as a class just for wxRTTI, // otherwise we could simply typedef it // ---------------------------------------------------------------------------- typedef wxDocChildFrameAny<wxFrame, wxFrame> wxDocChildFrameBase; class WXDLLIMPEXP_CORE wxDocChildFrame : public wxDocChildFrameBase { public: wxDocChildFrame() { } wxDocChildFrame(wxDocument *doc, wxView *view, wxFrame *parent, wxWindowID id, const wxString& title, const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxDefaultSize, long style = wxDEFAULT_FRAME_STYLE, const wxString& name = wxFrameNameStr) : wxDocChildFrameBase(doc, view, parent, id, title, pos, size, style, name) { } bool Create(wxDocument *doc, wxView *view, wxFrame *parent, wxWindowID id, const wxString& title, const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxDefaultSize, long style = wxDEFAULT_FRAME_STYLE, const wxString& name = wxFrameNameStr) { return wxDocChildFrameBase::Create ( doc, view, parent, id, title, pos, size, style, name ); } private: wxDECLARE_CLASS(wxDocChildFrame); wxDECLARE_NO_COPY_CLASS(wxDocChildFrame); }; // ---------------------------------------------------------------------------- // wxDocParentFrame and related classes. // // As with wxDocChildFrame we define a template base class used by both normal // and MDI versions // ---------------------------------------------------------------------------- // Base class containing type-independent code of wxDocParentFrameAny // // Similarly to wxDocChildFrameAnyBase, this class is a mix-in and doesn't // derive from wxWindow. class WXDLLIMPEXP_CORE wxDocParentFrameAnyBase { public: wxDocParentFrameAnyBase(wxWindow* frame) : m_frame(frame) { m_docManager = NULL; } wxDocManager *GetDocumentManager() const { return m_docManager; } protected: // This is similar to wxDocChildFrameAnyBase method with the same name: // while we're not an event handler ourselves and so can't override // TryBefore(), we provide a helper that the derived template class can use // from its TryBefore() implementation. bool TryProcessEvent(wxEvent& event); wxWindow* const m_frame; wxDocManager *m_docManager; wxDECLARE_NO_COPY_CLASS(wxDocParentFrameAnyBase); }; // This is similar to wxDocChildFrameAny and is used to provide common // implementation for both wxDocParentFrame and wxDocMDIParentFrame template <class BaseFrame> class wxDocParentFrameAny : public BaseFrame, public wxDocParentFrameAnyBase { public: wxDocParentFrameAny() : wxDocParentFrameAnyBase(this) { } wxDocParentFrameAny(wxDocManager *manager, wxFrame *frame, wxWindowID id, const wxString& title, const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxDefaultSize, long style = wxDEFAULT_FRAME_STYLE, const wxString& name = wxFrameNameStr) : wxDocParentFrameAnyBase(this) { Create(manager, frame, id, title, pos, size, style, name); } bool Create(wxDocManager *manager, wxFrame *frame, wxWindowID id, const wxString& title, const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxDefaultSize, long style = wxDEFAULT_FRAME_STYLE, const wxString& name = wxFrameNameStr) { m_docManager = manager; if ( !BaseFrame::Create(frame, id, title, pos, size, style, name) ) return false; this->Bind(wxEVT_MENU, &wxDocParentFrameAny::OnExit, this, wxID_EXIT); this->Bind(wxEVT_CLOSE_WINDOW, &wxDocParentFrameAny::OnCloseWindow, this); return true; } protected: // hook the document manager into event handling chain here virtual bool TryBefore(wxEvent& event) wxOVERRIDE { // It is important to send the event to the base class first as // wxMDIParentFrame overrides its TryBefore() to send the menu events // to the currently active child frame and the child must get them // before our own TryProcessEvent() is executed, not afterwards. return BaseFrame::TryBefore(event) || TryProcessEvent(event); } private: void OnExit(wxCommandEvent& WXUNUSED(event)) { this->Close(); } void OnCloseWindow(wxCloseEvent& event) { if ( m_docManager && !m_docManager->Clear(!event.CanVeto()) ) { // The user decided not to close finally, abort. event.Veto(); } else { // Just skip the event, base class handler will destroy the window. event.Skip(); } } wxDECLARE_NO_COPY_CLASS(wxDocParentFrameAny); }; typedef wxDocParentFrameAny<wxFrame> wxDocParentFrameBase; class WXDLLIMPEXP_CORE wxDocParentFrame : public wxDocParentFrameBase { public: wxDocParentFrame() : wxDocParentFrameBase() { } wxDocParentFrame(wxDocManager *manager, wxFrame *parent, wxWindowID id, const wxString& title, const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxDefaultSize, long style = wxDEFAULT_FRAME_STYLE, const wxString& name = wxFrameNameStr) : wxDocParentFrameBase(manager, parent, id, title, pos, size, style, name) { } bool Create(wxDocManager *manager, wxFrame *parent, wxWindowID id, const wxString& title, const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxDefaultSize, long style = wxDEFAULT_FRAME_STYLE, const wxString& name = wxFrameNameStr) { return wxDocParentFrameBase::Create(manager, parent, id, title, pos, size, style, name); } private: wxDECLARE_CLASS(wxDocParentFrame); wxDECLARE_NO_COPY_CLASS(wxDocParentFrame); }; // ---------------------------------------------------------------------------- // Provide simple default printing facilities // ---------------------------------------------------------------------------- #if wxUSE_PRINTING_ARCHITECTURE class WXDLLIMPEXP_CORE wxDocPrintout : public wxPrintout { public: wxDocPrintout(wxView *view = NULL, const wxString& title = wxString()); // implement wxPrintout methods virtual bool OnPrintPage(int page) wxOVERRIDE; virtual bool HasPage(int page) wxOVERRIDE; virtual bool OnBeginDocument(int startPage, int endPage) wxOVERRIDE; virtual void GetPageInfo(int *minPage, int *maxPage, int *selPageFrom, int *selPageTo) wxOVERRIDE; virtual wxView *GetView() { return m_printoutView; } protected: wxView* m_printoutView; private: wxDECLARE_DYNAMIC_CLASS(wxDocPrintout); wxDECLARE_NO_COPY_CLASS(wxDocPrintout); }; #endif // wxUSE_PRINTING_ARCHITECTURE // For compatibility with existing file formats: // converts from/to a stream to/from a temporary file. #if wxUSE_STD_IOSTREAM bool WXDLLIMPEXP_CORE wxTransferFileToStream(const wxString& filename, wxSTD ostream& stream); bool WXDLLIMPEXP_CORE wxTransferStreamToFile(wxSTD istream& stream, const wxString& filename); #else bool WXDLLIMPEXP_CORE wxTransferFileToStream(const wxString& filename, wxOutputStream& stream); bool WXDLLIMPEXP_CORE wxTransferStreamToFile(wxInputStream& stream, const wxString& filename); #endif // wxUSE_STD_IOSTREAM // these flags are not used anywhere by wxWidgets and kept only for an unlikely // case of existing user code using them for its own purposes #if WXWIN_COMPATIBILITY_2_8 enum { wxDOC_SDI = 1, wxDOC_MDI, wxDEFAULT_DOCMAN_FLAGS = wxDOC_SDI }; #endif // WXWIN_COMPATIBILITY_2_8 inline wxViewVector wxDocument::GetViewsVector() const { return m_documentViews.AsVector<wxView*>(); } inline wxDocVector wxDocManager::GetDocumentsVector() const { return m_docs.AsVector<wxDocument*>(); } inline wxDocTemplateVector wxDocManager::GetTemplatesVector() const { return m_templates.AsVector<wxDocTemplate*>(); } #endif // wxUSE_DOC_VIEW_ARCHITECTURE #endif // _WX_DOCH__
h
rticonnextdds-usecases
data/projects/rticonnextdds-usecases/VehicleTracking/ExampleCode/thirdparty/wxWidgets-3.1.2/Win64/include/wx/srchctrl.h
///////////////////////////////////////////////////////////////////////////// // Name: wx/srchctrl.h // Purpose: wxSearchCtrlBase class // Author: Vince Harron // Created: 2006-02-18 // Copyright: (c) Vince Harron // Licence: wxWindows licence ///////////////////////////////////////////////////////////////////////////// #ifndef _WX_SEARCHCTRL_H_BASE_ #define _WX_SEARCHCTRL_H_BASE_ #include "wx/defs.h" #if wxUSE_SEARCHCTRL #include "wx/textctrl.h" #if !defined(__WXUNIVERSAL__) && defined(__WXMAC__) // search control was introduced in Mac OS X 10.3 Panther #define wxUSE_NATIVE_SEARCH_CONTROL 1 #define wxSearchCtrlBaseBaseClass wxTextCtrl #else // no native version, use the generic one #define wxUSE_NATIVE_SEARCH_CONTROL 0 #include "wx/compositewin.h" #include "wx/containr.h" class WXDLLIMPEXP_CORE wxSearchCtrlBaseBaseClass : public wxCompositeWindow< wxNavigationEnabled<wxControl> >, public wxTextCtrlIface { }; #endif // ---------------------------------------------------------------------------- // constants // ---------------------------------------------------------------------------- extern WXDLLIMPEXP_DATA_CORE(const char) wxSearchCtrlNameStr[]; wxDECLARE_EXPORTED_EVENT(WXDLLIMPEXP_CORE, wxEVT_SEARCH_CANCEL, wxCommandEvent); wxDECLARE_EXPORTED_EVENT(WXDLLIMPEXP_CORE, wxEVT_SEARCH, wxCommandEvent); // ---------------------------------------------------------------------------- // a search ctrl is a text control with a search button and a cancel button // it is based on the MacOSX 10.3 control HISearchFieldCreate // ---------------------------------------------------------------------------- class WXDLLIMPEXP_CORE wxSearchCtrlBase : public wxSearchCtrlBaseBaseClass { public: wxSearchCtrlBase() { } virtual ~wxSearchCtrlBase() { } // search control #if wxUSE_MENUS virtual void SetMenu(wxMenu *menu) = 0; virtual wxMenu *GetMenu() = 0; #endif // wxUSE_MENUS // get/set options virtual void ShowSearchButton( bool show ) = 0; virtual bool IsSearchButtonVisible() const = 0; virtual void ShowCancelButton( bool show ) = 0; virtual bool IsCancelButtonVisible() const = 0; virtual void SetDescriptiveText(const wxString& text) = 0; virtual wxString GetDescriptiveText() const = 0; private: // implement wxTextEntry pure virtual method virtual wxWindow *GetEditableWindow() wxOVERRIDE { return this; } }; // include the platform-dependent class implementation #if wxUSE_NATIVE_SEARCH_CONTROL #if defined(__WXMAC__) #include "wx/osx/srchctrl.h" #endif #else #include "wx/generic/srchctlg.h" #endif // ---------------------------------------------------------------------------- // macros for handling search events // ---------------------------------------------------------------------------- #define EVT_SEARCH_CANCEL(id, fn) \ wx__DECLARE_EVT1(wxEVT_SEARCH_CANCEL, id, wxCommandEventHandler(fn)) #define EVT_SEARCH(id, fn) \ wx__DECLARE_EVT1(wxEVT_SEARCH, id, wxCommandEventHandler(fn)) // old synonyms #define wxEVT_SEARCHCTRL_CANCEL_BTN wxEVT_SEARCH_CANCEL #define wxEVT_SEARCHCTRL_SEARCH_BTN wxEVT_SEARCH #define EVT_SEARCHCTRL_CANCEL_BTN(id, fn) EVT_SEARCH_CANCEL(id, fn) #define EVT_SEARCHCTRL_SEARCH_BTN(id, fn) EVT_SEARCH(id, fn) // even older wxEVT_COMMAND_* constants #define wxEVT_COMMAND_SEARCHCTRL_CANCEL_BTN wxEVT_SEARCHCTRL_CANCEL_BTN #define wxEVT_COMMAND_SEARCHCTRL_SEARCH_BTN wxEVT_SEARCHCTRL_SEARCH_BTN #endif // wxUSE_SEARCHCTRL #endif // _WX_SEARCHCTRL_H_BASE_
h
rticonnextdds-usecases
data/projects/rticonnextdds-usecases/VehicleTracking/ExampleCode/thirdparty/wxWidgets-3.1.2/Win64/include/wx/weakref.h
///////////////////////////////////////////////////////////////////////////// // Name: wx/weakref.h // Purpose: wxWeakRef - Generic weak references for wxWidgets // Author: Arne Steinarson // Created: 27 Dec 07 // Copyright: (c) 2007 Arne Steinarson // Licence: wxWindows licence ///////////////////////////////////////////////////////////////////////////// #ifndef _WX_WEAKREF_H_ #define _WX_WEAKREF_H_ #include "wx/tracker.h" #include "wx/meta/convertible.h" #include "wx/meta/int2type.h" template <class T> struct wxIsStaticTrackable { enum { value = wxIsPubliclyDerived<T, wxTrackable>::value }; }; // A weak reference to an object of type T (which must inherit from wxTrackable) template <class T> class wxWeakRef : public wxTrackerNode { public: typedef T element_type; // Default ctor wxWeakRef() : m_pobj(NULL), m_ptbase(NULL) { } // Ctor from the object of this type: this is needed as the template ctor // below is not used by at least g++4 when a literal NULL is used wxWeakRef(T *pobj) : m_pobj(NULL), m_ptbase(NULL) { this->Assign(pobj); } // When we have the full type here, static_cast<> will always work // (or give a straight compiler error). template <class TDerived> wxWeakRef(TDerived* pobj) : m_pobj(NULL), m_ptbase(NULL) { this->Assign(pobj); } // We need this copy ctor, since otherwise a default compiler (binary) copy // happens (if embedded as an object member). wxWeakRef(const wxWeakRef<T>& wr) : m_pobj(NULL), m_ptbase(NULL) { this->Assign(wr.get()); } wxWeakRef<T>& operator=(const wxWeakRef<T>& wr) { this->AssignCopy(wr); return *this; } virtual ~wxWeakRef() { this->Release(); } // Smart pointer functions T& operator*() const { return *this->m_pobj; } T* operator->() const { return this->m_pobj; } T* get() const { return this->m_pobj; } operator T*() const { return this->m_pobj; } public: void Release() { // Release old object if any if ( m_pobj ) { // Remove ourselves from object tracker list m_ptbase->RemoveNode(this); m_pobj = NULL; m_ptbase = NULL; } } virtual void OnObjectDestroy() wxOVERRIDE { // Tracked object itself removes us from list of trackers wxASSERT(m_pobj != NULL); m_pobj = NULL; m_ptbase = NULL; } protected: // Assign receives most derived class here and can use that template <class TDerived> void Assign( TDerived* pobj ) { wxCOMPILE_TIME_ASSERT( wxIsStaticTrackable<TDerived>::value, Tracked_class_should_inherit_from_wxTrackable ); wxTrackable *ptbase = static_cast<wxTrackable*>(pobj); DoAssign(pobj, ptbase); } void AssignCopy(const wxWeakRef& wr) { DoAssign(wr.m_pobj, wr.m_ptbase); } void DoAssign(T* pobj, wxTrackable *ptbase) { if ( m_pobj == pobj ) return; Release(); // Now set new trackable object if ( pobj ) { // Add ourselves to object tracker list wxASSERT( ptbase ); ptbase->AddNode( this ); m_pobj = pobj; m_ptbase = ptbase; } } T *m_pobj; wxTrackable *m_ptbase; }; #ifndef wxNO_RTTI // Weak ref implementation assign objects are queried for wxTrackable // using dynamic_cast<> template <class T> class wxWeakRefDynamic : public wxTrackerNode { public: wxWeakRefDynamic() : m_pobj(NULL) { } wxWeakRefDynamic(T* pobj) : m_pobj(pobj) { Assign(pobj); } wxWeakRefDynamic(const wxWeakRef<T>& wr) { Assign(wr.get()); } virtual ~wxWeakRefDynamic() { Release(); } // Smart pointer functions T& operator*() const { wxASSERT(m_pobj); return *m_pobj; } T* operator->() const { wxASSERT(m_pobj); return m_pobj; } T* get() const { return m_pobj; } operator T* () const { return m_pobj; } T* operator = (T* pobj) { Assign(pobj); return m_pobj; } // Assign from another weak ref, point to same object T* operator = (const wxWeakRef<T> &wr) { Assign( wr.get() ); return m_pobj; } void Release() { // Release old object if any if( m_pobj ) { // Remove ourselves from object tracker list wxTrackable *pt = dynamic_cast<wxTrackable*>(m_pobj); wxASSERT(pt); pt->RemoveNode(this); m_pobj = NULL; } } virtual void OnObjectDestroy() wxOVERRIDE { wxASSERT_MSG(m_pobj, "tracked object should have removed us itself"); m_pobj = NULL; } protected: void Assign(T *pobj) { if ( m_pobj == pobj ) return; Release(); // Now set new trackable object if ( pobj ) { // Add ourselves to object tracker list wxTrackable *pt = dynamic_cast<wxTrackable*>(pobj); if ( pt ) { pt->AddNode(this); m_pobj = pobj; } else { // If the object we want to track does not support wxTackable, then // log a message and keep the NULL object pointer. wxFAIL_MSG( "Tracked class should inherit from wxTrackable" ); } } } T *m_pobj; }; #endif // RTTI enabled // Provide some basic types of weak references class WXDLLIMPEXP_FWD_BASE wxEvtHandler; class WXDLLIMPEXP_FWD_CORE wxWindow; typedef wxWeakRef<wxEvtHandler> wxEvtHandlerRef; typedef wxWeakRef<wxWindow> wxWindowRef; #endif // _WX_WEAKREF_H_
h
rticonnextdds-usecases
data/projects/rticonnextdds-usecases/VehicleTracking/ExampleCode/thirdparty/wxWidgets-3.1.2/Win64/include/wx/treebook.h
/////////////////////////////////////////////////////////////////////////////// // Name: wx/treebook.h // Purpose: wxTreebook: wxNotebook-like control presenting pages in a tree // Author: Evgeniy Tarassov, Vadim Zeitlin // Modified by: // Created: 2005-09-15 // Copyright: (c) 2005 Vadim Zeitlin <[email protected]> // Licence: wxWindows licence /////////////////////////////////////////////////////////////////////////////// #ifndef _WX_TREEBOOK_H_ #define _WX_TREEBOOK_H_ #include "wx/defs.h" #if wxUSE_TREEBOOK #include "wx/bookctrl.h" #include "wx/containr.h" #include "wx/treebase.h" // for wxTreeItemId #include "wx/vector.h" typedef wxWindow wxTreebookPage; class WXDLLIMPEXP_FWD_CORE wxTreeCtrl; class WXDLLIMPEXP_FWD_CORE wxTreeEvent; // ---------------------------------------------------------------------------- // wxTreebook // ---------------------------------------------------------------------------- class WXDLLIMPEXP_CORE wxTreebook : public wxNavigationEnabled<wxBookCtrlBase> { public: // Constructors and such // --------------------- // Default ctor doesn't create the control, use Create() afterwards wxTreebook() { } // This ctor creates the tree book control wxTreebook(wxWindow *parent, wxWindowID id, const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxDefaultSize, long style = wxBK_DEFAULT, const wxString& name = wxEmptyString) { (void)Create(parent, id, pos, size, style, name); } // Really creates the control bool Create(wxWindow *parent, wxWindowID id, const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxDefaultSize, long style = wxBK_DEFAULT, const wxString& name = wxEmptyString); // Page insertion operations // ------------------------- // Notice that page pointer may be NULL in which case the next non NULL // page (usually the first child page of a node) is shown when this page is // selected // Inserts a new page just before the page indicated by page. // The new page is placed on the same level as page. virtual bool InsertPage(size_t pos, wxWindow *page, const wxString& text, bool bSelect = false, int imageId = NO_IMAGE) wxOVERRIDE; // Inserts a new sub-page to the end of children of the page at given pos. virtual bool InsertSubPage(size_t pos, wxWindow *page, const wxString& text, bool bSelect = false, int imageId = NO_IMAGE); // Adds a new page at top level after all other pages. virtual bool AddPage(wxWindow *page, const wxString& text, bool bSelect = false, int imageId = NO_IMAGE) wxOVERRIDE; // Adds a new child-page to the last top-level page inserted. // Useful when constructing 1 level tree structure. virtual bool AddSubPage(wxWindow *page, const wxString& text, bool bSelect = false, int imageId = NO_IMAGE); // Deletes the page and ALL its children. Could trigger page selection // change in a case when selected page is removed. In that case its parent // is selected (or the next page if no parent). virtual bool DeletePage(size_t pos) wxOVERRIDE; // Tree operations // --------------- // Gets the page node state -- node is expanded or collapsed virtual bool IsNodeExpanded(size_t pos) const; // Expands or collapses the page node. Returns the previous state. // May generate page changing events (if selected page // is under the collapsed branch, then parent is autoselected). virtual bool ExpandNode(size_t pos, bool expand = true); // shortcut for ExpandNode(pos, false) bool CollapseNode(size_t pos) { return ExpandNode(pos, false); } // get the parent page or wxNOT_FOUND if this is a top level page int GetPageParent(size_t pos) const; // the tree control we use for showing the pages index tree wxTreeCtrl* GetTreeCtrl() const { return (wxTreeCtrl*)m_bookctrl; } // Standard operations inherited from wxBookCtrlBase // ------------------------------------------------- virtual bool SetPageText(size_t n, const wxString& strText) wxOVERRIDE; virtual wxString GetPageText(size_t n) const wxOVERRIDE; virtual int GetPageImage(size_t n) const wxOVERRIDE; virtual bool SetPageImage(size_t n, int imageId) wxOVERRIDE; virtual int SetSelection(size_t n) wxOVERRIDE { return DoSetSelection(n, SetSelection_SendEvent); } virtual int ChangeSelection(size_t n) wxOVERRIDE { return DoSetSelection(n); } virtual int HitTest(const wxPoint& pt, long *flags = NULL) const wxOVERRIDE; virtual void SetImageList(wxImageList *imageList) wxOVERRIDE; virtual void AssignImageList(wxImageList *imageList); virtual bool DeleteAllPages() wxOVERRIDE; protected: // Implementation of a page removal. See DeletPage for comments. wxTreebookPage *DoRemovePage(size_t pos) wxOVERRIDE; // This subclass of wxBookCtrlBase accepts NULL page pointers (empty pages) virtual bool AllowNullPage() const wxOVERRIDE { return true; } virtual wxWindow *TryGetNonNullPage(size_t page) wxOVERRIDE; // event handlers void OnTreeSelectionChange(wxTreeEvent& event); void OnTreeNodeExpandedCollapsed(wxTreeEvent& event); // array of tree item ids corresponding to the page indices wxVector<wxTreeItemId> m_treeIds; private: // The real implementations of page insertion functions // ------------------------------------------------------ // All DoInsert/Add(Sub)Page functions add the page into : // - the base class // - the tree control // - update the index/TreeItemId corespondance array bool DoInsertPage(size_t pos, wxWindow *page, const wxString& text, bool bSelect = false, int imageId = NO_IMAGE); bool DoInsertSubPage(size_t pos, wxWindow *page, const wxString& text, bool bSelect = false, int imageId = NO_IMAGE); bool DoAddSubPage(wxWindow *page, const wxString& text, bool bSelect = false, int imageId = NO_IMAGE); // Overridden methods used by the base class DoSetSelection() // implementation. void UpdateSelectedPage(size_t newsel) wxOVERRIDE; wxBookCtrlEvent* CreatePageChangingEvent() const wxOVERRIDE; void MakeChangedEvent(wxBookCtrlEvent &event) wxOVERRIDE; // Does the selection update. Called from page insertion functions // to update selection if the selected page was pushed by the newly inserted void DoUpdateSelection(bool bSelect, int page); // Operations on the internal private members of the class // ------------------------------------------------------- // Returns the page TreeItemId for the page. // Or, if the page index is incorrect, a fake one (fakePage.IsOk() == false) wxTreeItemId DoInternalGetPage(size_t pos) const; // Linear search for a page with the id specified. If no page // found wxNOT_FOUND is returned. The function is used when we catch an event // from m_tree (wxTreeCtrl) component. int DoInternalFindPageById(wxTreeItemId page) const; // Updates page and wxTreeItemId correspondance. void DoInternalAddPage(size_t newPos, wxWindow *page, wxTreeItemId pageId); // Removes the page from internal structure. void DoInternalRemovePage(size_t pos) { DoInternalRemovePageRange(pos, 0); } // Removes the page and all its children designated by subCount // from internal structures of the control. void DoInternalRemovePageRange(size_t pos, size_t subCount); // Returns internal number of pages which can be different from // GetPageCount() while performing a page insertion or removal. size_t DoInternalGetPageCount() const { return m_treeIds.size(); } wxDECLARE_EVENT_TABLE(); wxDECLARE_DYNAMIC_CLASS_NO_COPY(wxTreebook); }; // ---------------------------------------------------------------------------- // treebook event class and related stuff // ---------------------------------------------------------------------------- // wxTreebookEvent is obsolete and defined for compatibility only #define wxTreebookEvent wxBookCtrlEvent typedef wxBookCtrlEventFunction wxTreebookEventFunction; #define wxTreebookEventHandler(func) wxBookCtrlEventHandler(func) wxDECLARE_EXPORTED_EVENT( WXDLLIMPEXP_CORE, wxEVT_TREEBOOK_PAGE_CHANGED, wxBookCtrlEvent ); wxDECLARE_EXPORTED_EVENT( WXDLLIMPEXP_CORE, wxEVT_TREEBOOK_PAGE_CHANGING, wxBookCtrlEvent ); wxDECLARE_EXPORTED_EVENT( WXDLLIMPEXP_CORE, wxEVT_TREEBOOK_NODE_COLLAPSED, wxBookCtrlEvent ); wxDECLARE_EXPORTED_EVENT( WXDLLIMPEXP_CORE, wxEVT_TREEBOOK_NODE_EXPANDED, wxBookCtrlEvent ); #define EVT_TREEBOOK_PAGE_CHANGED(winid, fn) \ wx__DECLARE_EVT1(wxEVT_TREEBOOK_PAGE_CHANGED, winid, wxBookCtrlEventHandler(fn)) #define EVT_TREEBOOK_PAGE_CHANGING(winid, fn) \ wx__DECLARE_EVT1(wxEVT_TREEBOOK_PAGE_CHANGING, winid, wxBookCtrlEventHandler(fn)) #define EVT_TREEBOOK_NODE_COLLAPSED(winid, fn) \ wx__DECLARE_EVT1(wxEVT_TREEBOOK_NODE_COLLAPSED, winid, wxBookCtrlEventHandler(fn)) #define EVT_TREEBOOK_NODE_EXPANDED(winid, fn) \ wx__DECLARE_EVT1(wxEVT_TREEBOOK_NODE_EXPANDED, winid, wxBookCtrlEventHandler(fn)) // old wxEVT_COMMAND_* constants #define wxEVT_COMMAND_TREEBOOK_PAGE_CHANGED wxEVT_TREEBOOK_PAGE_CHANGED #define wxEVT_COMMAND_TREEBOOK_PAGE_CHANGING wxEVT_TREEBOOK_PAGE_CHANGING #define wxEVT_COMMAND_TREEBOOK_NODE_COLLAPSED wxEVT_TREEBOOK_NODE_COLLAPSED #define wxEVT_COMMAND_TREEBOOK_NODE_EXPANDED wxEVT_TREEBOOK_NODE_EXPANDED #endif // wxUSE_TREEBOOK #endif // _WX_TREEBOOK_H_
h
rticonnextdds-usecases
data/projects/rticonnextdds-usecases/VehicleTracking/ExampleCode/thirdparty/wxWidgets-3.1.2/Win64/include/wx/notifmsg.h
/////////////////////////////////////////////////////////////////////////////// // Name: wx/notifmsg.h // Purpose: class allowing to show notification messages to the user // Author: Vadim Zeitlin // Created: 2007-11-19 // Copyright: (c) 2007 Vadim Zeitlin <[email protected]> // Licence: wxWindows licence /////////////////////////////////////////////////////////////////////////////// #ifndef _WX_NOTIFMSG_H_ #define _WX_NOTIFMSG_H_ #include "wx/event.h" #if wxUSE_NOTIFICATION_MESSAGE // ---------------------------------------------------------------------------- // wxNotificationMessage: allows to show the user a message non intrusively // ---------------------------------------------------------------------------- // notice that this class is not a window and so doesn't derive from wxWindow class WXDLLIMPEXP_CORE wxNotificationMessageBase : public wxEvtHandler { public: // ctors and initializers // ---------------------- // default ctor, use setters below to initialize it later wxNotificationMessageBase() { Init(); } // create a notification object with the given title and message (the // latter may be empty in which case only the title will be shown) wxNotificationMessageBase(const wxString& title, const wxString& message = wxEmptyString, wxWindow *parent = NULL, int flags = wxICON_INFORMATION) { Init(); Create(title, message, parent, flags); } virtual ~wxNotificationMessageBase(); // note that the setters must be called before Show() // set the title: short string, markup not allowed void SetTitle(const wxString& title); // set the text of the message: this is a longer string than the title and // some platforms allow simple HTML-like markup in it void SetMessage(const wxString& message); // set the parent for this notification: we'll be associated with the top // level parent of this window or, if this method is not called, with the // main application window by default void SetParent(wxWindow *parent); // this method can currently be used to choose a standard icon to use: the // parameter may be one of wxICON_INFORMATION, wxICON_WARNING or // wxICON_ERROR only (but not wxICON_QUESTION) void SetFlags(int flags); // set a custom icon to use instead of the system provided specified via SetFlags virtual void SetIcon(const wxIcon& icon); // Add a button to the notification, returns false if the platform does not support // actions in notifications virtual bool AddAction(wxWindowID actionid, const wxString &label = wxString()); // showing and hiding // ------------------ // possible values for Show() timeout enum { Timeout_Auto = -1, // notification will be hidden automatically Timeout_Never = 0 // notification will never time out }; // show the notification to the user and hides it after timeout seconds // pass (special values Timeout_Auto and Timeout_Never can be used) // // returns false if an error occurred bool Show(int timeout = Timeout_Auto); // hide the notification, returns true if it was hidden or false if it // couldn't be done (e.g. on some systems automatically hidden // notifications can't be hidden manually) bool Close(); protected: // Common part of all ctors. void Create(const wxString& title = wxEmptyString, const wxString& message = wxEmptyString, wxWindow *parent = NULL, int flags = wxICON_INFORMATION) { SetTitle(title); SetMessage(message); SetParent(parent); SetFlags(flags); } class wxNotificationMessageImpl* m_impl; private: void Init() { m_impl = NULL; } wxDECLARE_NO_COPY_CLASS(wxNotificationMessageBase); }; wxDECLARE_EXPORTED_EVENT( WXDLLIMPEXP_CORE, wxEVT_NOTIFICATION_MESSAGE_CLICK, wxCommandEvent ); wxDECLARE_EXPORTED_EVENT( WXDLLIMPEXP_CORE, wxEVT_NOTIFICATION_MESSAGE_DISMISSED, wxCommandEvent ); wxDECLARE_EXPORTED_EVENT( WXDLLIMPEXP_CORE, wxEVT_NOTIFICATION_MESSAGE_ACTION, wxCommandEvent ); #if (defined(__WXGTK__) && wxUSE_LIBNOTIFY) || \ (defined(__WXMSW__) && wxUSE_TASKBARICON && wxUSE_TASKBARICON_BALLOONS) || \ (defined(__WXOSX_COCOA__) && (MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_8)) #define wxHAS_NATIVE_NOTIFICATION_MESSAGE #endif // ---------------------------------------------------------------------------- // wxNotificationMessage // ---------------------------------------------------------------------------- #ifdef wxHAS_NATIVE_NOTIFICATION_MESSAGE #if defined(__WXMSW__) class WXDLLIMPEXP_FWD_CORE wxTaskBarIcon; #endif // defined(__WXMSW__) #else #include "wx/generic/notifmsg.h" #endif // wxHAS_NATIVE_NOTIFICATION_MESSAGE class WXDLLIMPEXP_CORE wxNotificationMessage : public #ifdef wxHAS_NATIVE_NOTIFICATION_MESSAGE wxNotificationMessageBase #else wxGenericNotificationMessage #endif { public: wxNotificationMessage() { Init(); } wxNotificationMessage(const wxString& title, const wxString& message = wxString(), wxWindow *parent = NULL, int flags = wxICON_INFORMATION) { Init(); Create(title, message, parent, flags); } #if defined(__WXMSW__) && defined(wxHAS_NATIVE_NOTIFICATION_MESSAGE) static bool MSWUseToasts( const wxString& shortcutPath = wxString(), const wxString& appId = wxString()); // returns the task bar icon which was used previously (may be NULL) static wxTaskBarIcon *UseTaskBarIcon(wxTaskBarIcon *icon); #endif // defined(__WXMSW__) && defined(wxHAS_NATIVE_NOTIFICATION_MESSAGE) private: // common part of all ctors void Init(); wxDECLARE_NO_COPY_CLASS(wxNotificationMessage); }; #endif // wxUSE_NOTIFICATION_MESSAGE #endif // _WX_NOTIFMSG_H_
h
rticonnextdds-usecases
data/projects/rticonnextdds-usecases/VehicleTracking/ExampleCode/thirdparty/wxWidgets-3.1.2/Win64/include/wx/dlist.h
/////////////////////////////////////////////////////////////////////////////// // Name: wx/dlist.h // Purpose: wxDList<T> which is a template version of wxList // Author: Robert Roebling // Created: 18.09.2008 // Copyright: (c) 2008 wxWidgets team // Licence: wxWindows licence /////////////////////////////////////////////////////////////////////////////// #ifndef _WX_DLIST_H_ #define _WX_DLIST_H_ #include "wx/defs.h" #include "wx/utils.h" #if wxUSE_STD_CONTAINERS #include "wx/beforestd.h" #include <algorithm> #include <iterator> #include <list> #include "wx/afterstd.h" template<typename T> class wxDList: public std::list<T*> { private: bool m_destroy; typedef std::list<T*> BaseListType; typedef wxDList<T> ListType; public: typedef typename BaseListType::iterator iterator; class compatibility_iterator { private: friend class wxDList<T>; iterator m_iter; ListType *m_list; public: compatibility_iterator() : m_iter(), m_list( NULL ) {} compatibility_iterator( ListType* li, iterator i ) : m_iter( i ), m_list( li ) {} compatibility_iterator( const ListType* li, iterator i ) : m_iter( i ), m_list( const_cast<ListType*>(li) ) {} compatibility_iterator* operator->() { return this; } const compatibility_iterator* operator->() const { return this; } bool operator==(const compatibility_iterator& i) const { wxASSERT_MSG( m_list && i.m_list, "comparing invalid iterators is illegal" ); return (m_list == i.m_list) && (m_iter == i.m_iter); } bool operator!=(const compatibility_iterator& i) const { return !( operator==( i ) ); } operator bool() const { return m_list ? m_iter != m_list->end() : false; } bool operator !() const { return !( operator bool() ); } T* GetData() const { return *m_iter; } void SetData( T* e ) { *m_iter = e; } compatibility_iterator GetNext() const { iterator i = m_iter; return compatibility_iterator( m_list, ++i ); } compatibility_iterator GetPrevious() const { if ( m_iter == m_list->begin() ) return compatibility_iterator(); iterator i = m_iter; return compatibility_iterator( m_list, --i ); } int IndexOf() const { return *this ? std::distance( m_list->begin(), m_iter ) : wxNOT_FOUND; } }; public: wxDList() : m_destroy( false ) {} ~wxDList() { Clear(); } compatibility_iterator Find( const T* e ) const { return compatibility_iterator( this, std::find( const_cast<ListType*>(this)->begin(), const_cast<ListType*>(this)->end(), e ) ); } bool IsEmpty() const { return this->empty(); } size_t GetCount() const { return this->size(); } compatibility_iterator Item( size_t idx ) const { iterator i = const_cast<ListType*>(this)->begin(); std::advance( i, idx ); return compatibility_iterator( this, i ); } T* operator[](size_t idx) const { return Item(idx).GetData(); } compatibility_iterator GetFirst() const { return compatibility_iterator( this, const_cast<ListType*>(this)->begin() ); } compatibility_iterator GetLast() const { iterator i = const_cast<ListType*>(this)->end(); return compatibility_iterator( this, !(this->empty()) ? --i : i ); } compatibility_iterator Member( T* e ) const { return Find( e ); } compatibility_iterator Nth( int n ) const { return Item( n ); } int IndexOf( T* e ) const { return Find( e ).IndexOf(); } compatibility_iterator Append( T* e ) { this->push_back( e ); return GetLast(); } compatibility_iterator Insert( T* e ) { this->push_front( e ); return compatibility_iterator( this, this->begin() ); } compatibility_iterator Insert( compatibility_iterator & i, T* e ) { return compatibility_iterator( this, this->insert( i.m_iter, e ) ); } compatibility_iterator Insert( size_t idx, T* e ) { return compatibility_iterator( this, this->insert( Item( idx ).m_iter, e ) ); } void DeleteContents( bool destroy ) { m_destroy = destroy; } bool GetDeleteContents() const { return m_destroy; } void Erase( const compatibility_iterator& i ) { if ( m_destroy ) delete i->GetData(); this->erase( i.m_iter ); } bool DeleteNode( const compatibility_iterator& i ) { if( i ) { Erase( i ); return true; } return false; } bool DeleteObject( T* e ) { return DeleteNode( Find( e ) ); } void Clear() { if ( m_destroy ) { iterator it, en; for ( it = this->begin(), en = this->end(); it != en; ++it ) delete *it; } this->clear(); } }; #else // !wxUSE_STD_CONTAINERS template <typename T> class wxDList { public: class Node { public: Node(wxDList<T> *list = NULL, Node *previous = NULL, Node *next = NULL, T *data = NULL) { m_list = list; m_previous = previous; m_next = next; m_data = data; if (previous) previous->m_next = this; if (next) next->m_previous = this; } ~Node() { // handle the case when we're being deleted from the list by // the user (i.e. not by the list itself from DeleteNode) - // we must do it for compatibility with old code if (m_list != NULL) m_list->DetachNode(this); } void DeleteData() { delete m_data; } Node *GetNext() const { return m_next; } Node *GetPrevious() const { return m_previous; } T *GetData() const { return m_data; } T **GetDataPtr() const { return &(const_cast<nodetype*>(this)->m_data); } void SetData( T *data ) { m_data = data; } int IndexOf() const { wxCHECK_MSG( m_list, wxNOT_FOUND, "node doesn't belong to a list in IndexOf" ); int i; Node *prev = m_previous; for( i = 0; prev; i++ ) prev = prev->m_previous; return i; } private: T *m_data; // user data Node *m_next, // next and previous nodes in the list *m_previous; wxDList<T> *m_list; // list we belong to friend class wxDList<T>; }; typedef Node nodetype; class compatibility_iterator { public: compatibility_iterator(nodetype *ptr = NULL) : m_ptr(ptr) { } nodetype *operator->() const { return m_ptr; } operator nodetype *() const { return m_ptr; } private: nodetype *m_ptr; }; private: void Init() { m_nodeFirst = m_nodeLast = NULL; m_count = 0; m_destroy = false; } void DoDeleteNode( nodetype *node ) { if ( m_destroy ) node->DeleteData(); // so that the node knows that it's being deleted by the list node->m_list = NULL; delete node; } size_t m_count; // number of elements in the list bool m_destroy; // destroy user data when deleting list items? nodetype *m_nodeFirst, // pointers to the head and tail of the list *m_nodeLast; public: wxDList() { Init(); } wxDList( const wxDList<T>& list ) { Init(); Assign(list); } wxDList( size_t count, T *elements[] ) { Init(); size_t n; for (n = 0; n < count; n++) Append( elements[n] ); } wxDList& operator=( const wxDList<T>& list ) { if (&list != this) Assign(list); return *this; } ~wxDList() { nodetype *each = m_nodeFirst; while ( each != NULL ) { nodetype *next = each->GetNext(); DoDeleteNode(each); each = next; } } void Assign(const wxDList<T> &list) { wxASSERT_MSG( !list.m_destroy, "copying list which owns it's elements is a bad idea" ); Clear(); m_destroy = list.m_destroy; m_nodeFirst = NULL; m_nodeLast = NULL; nodetype* node; for (node = list.GetFirst(); node; node = node->GetNext() ) Append(node->GetData()); wxASSERT_MSG( m_count == list.m_count, "logic error in Assign()" ); } nodetype *Append( T *object ) { nodetype *node = new nodetype( this, m_nodeLast, NULL, object ); if ( !m_nodeFirst ) { m_nodeFirst = node; m_nodeLast = m_nodeFirst; } else { m_nodeLast->m_next = node; m_nodeLast = node; } m_count++; return node; } nodetype *Insert( T* object ) { return Insert( NULL, object ); } nodetype *Insert( size_t pos, T* object ) { if (pos == m_count) return Append( object ); else return Insert( Item(pos), object ); } nodetype *Insert( nodetype *position, T* object ) { wxCHECK_MSG( !position || position->m_list == this, NULL, "can't insert before a node from another list" ); // previous and next node for the node being inserted nodetype *prev, *next; if ( position ) { prev = position->GetPrevious(); next = position; } else { // inserting in the beginning of the list prev = NULL; next = m_nodeFirst; } nodetype *node = new nodetype( this, prev, next, object ); if ( !m_nodeFirst ) m_nodeLast = node; if ( prev == NULL ) m_nodeFirst = node; m_count++; return node; } nodetype *GetFirst() const { return m_nodeFirst; } nodetype *GetLast() const { return m_nodeLast; } size_t GetCount() const { return m_count; } bool IsEmpty() const { return m_count == 0; } void DeleteContents(bool destroy) { m_destroy = destroy; } bool GetDeleteContents() const { return m_destroy; } nodetype *Item(size_t index) const { for ( nodetype *current = GetFirst(); current; current = current->GetNext() ) { if ( index-- == 0 ) return current; } wxFAIL_MSG( "invalid index in Item()" ); return NULL; } T *operator[](size_t index) const { nodetype *node = Item(index); return node ? node->GetData() : NULL; } nodetype *DetachNode( nodetype *node ) { wxCHECK_MSG( node, NULL, "detaching NULL wxNodeBase" ); wxCHECK_MSG( node->m_list == this, NULL, "detaching node which is not from this list" ); // update the list nodetype **prevNext = node->GetPrevious() ? &node->GetPrevious()->m_next : &m_nodeFirst; nodetype **nextPrev = node->GetNext() ? &node->GetNext()->m_previous : &m_nodeLast; *prevNext = node->GetNext(); *nextPrev = node->GetPrevious(); m_count--; // mark the node as not belonging to this list any more node->m_list = NULL; return node; } void Erase( nodetype *node ) { DeleteNode(node); } bool DeleteNode( nodetype *node ) { if ( !DetachNode(node) ) return false; DoDeleteNode(node); return true; } bool DeleteObject( T *object ) { for ( nodetype *current = GetFirst(); current; current = current->GetNext() ) { if ( current->GetData() == object ) { DeleteNode(current); return true; } } // not found return false; } nodetype *Find(const T *object) const { for ( nodetype *current = GetFirst(); current; current = current->GetNext() ) { if ( current->GetData() == object ) return current; } // not found return NULL; } int IndexOf(const T *object) const { int n = 0; for ( nodetype *current = GetFirst(); current; current = current->GetNext() ) { if ( current->GetData() == object ) return n; n++; } return wxNOT_FOUND; } void Clear() { nodetype *current = m_nodeFirst; while ( current ) { nodetype *next = current->GetNext(); DoDeleteNode(current); current = next; } m_nodeFirst = m_nodeLast = NULL; m_count = 0; } void Reverse() { nodetype * node = m_nodeFirst; nodetype* tmp; while (node) { // swap prev and next pointers tmp = node->m_next; node->m_next = node->m_previous; node->m_previous = tmp; // this is the node that was next before swapping node = tmp; } // swap first and last node tmp = m_nodeFirst; m_nodeFirst = m_nodeLast; m_nodeLast = tmp; } void DeleteNodes(nodetype* first, nodetype* last) { nodetype * node = first; while (node != last) { nodetype* next = node->GetNext(); DeleteNode(node); node = next; } } void ForEach(wxListIterateFunction F) { for ( nodetype *current = GetFirst(); current; current = current->GetNext() ) (*F)(current->GetData()); } T *FirstThat(wxListIterateFunction F) { for ( nodetype *current = GetFirst(); current; current = current->GetNext() ) { if ( (*F)(current->GetData()) ) return current->GetData(); } return NULL; } T *LastThat(wxListIterateFunction F) { for ( nodetype *current = GetLast(); current; current = current->GetPrevious() ) { if ( (*F)(current->GetData()) ) return current->GetData(); } return NULL; } /* STL interface */ public: typedef size_t size_type; typedef int difference_type; typedef T* value_type; typedef value_type& reference; typedef const value_type& const_reference; class iterator { public: typedef nodetype Node; typedef iterator itor; typedef T* value_type; typedef value_type* ptr_type; typedef value_type& reference; Node* m_node; Node* m_init; public: typedef reference reference_type; typedef ptr_type pointer_type; iterator(Node* node, Node* init) : m_node(node), m_init(init) {} iterator() : m_node(NULL), m_init(NULL) { } reference_type operator*() const { return *m_node->GetDataPtr(); } // ptrop itor& operator++() { m_node = m_node->GetNext(); return *this; } const itor operator++(int) { itor tmp = *this; m_node = m_node->GetNext(); return tmp; } itor& operator--() { m_node = m_node ? m_node->GetPrevious() : m_init; return *this; } const itor operator--(int) { itor tmp = *this; m_node = m_node ? m_node->GetPrevious() : m_init; return tmp; } bool operator!=(const itor& it) const { return it.m_node != m_node; } bool operator==(const itor& it) const { return it.m_node == m_node; } }; class const_iterator { public: typedef nodetype Node; typedef T* value_type; typedef const value_type& const_reference; typedef const_iterator itor; typedef value_type* ptr_type; Node* m_node; Node* m_init; public: typedef const_reference reference_type; typedef const ptr_type pointer_type; const_iterator(Node* node, Node* init) : m_node(node), m_init(init) { } const_iterator() : m_node(NULL), m_init(NULL) { } const_iterator(const iterator& it) : m_node(it.m_node), m_init(it.m_init) { } reference_type operator*() const { return *m_node->GetDataPtr(); } // ptrop itor& operator++() { m_node = m_node->GetNext(); return *this; } const itor operator++(int) { itor tmp = *this; m_node = m_node->GetNext(); return tmp; } itor& operator--() { m_node = m_node ? m_node->GetPrevious() : m_init; return *this; } const itor operator--(int) { itor tmp = *this; m_node = m_node ? m_node->GetPrevious() : m_init; return tmp; } bool operator!=(const itor& it) const { return it.m_node != m_node; } bool operator==(const itor& it) const { return it.m_node == m_node; } }; class reverse_iterator { public: typedef nodetype Node; typedef T* value_type; typedef reverse_iterator itor; typedef value_type* ptr_type; typedef value_type& reference; Node* m_node; Node* m_init; public: typedef reference reference_type; typedef ptr_type pointer_type; reverse_iterator(Node* node, Node* init) : m_node(node), m_init(init) { } reverse_iterator() : m_node(NULL), m_init(NULL) { } reference_type operator*() const { return *m_node->GetDataPtr(); } // ptrop itor& operator++() { m_node = m_node->GetPrevious(); return *this; } const itor operator++(int) { itor tmp = *this; m_node = m_node->GetPrevious(); return tmp; } itor& operator--() { m_node = m_node ? m_node->GetNext() : m_init; return *this; } const itor operator--(int) { itor tmp = *this; m_node = m_node ? m_node->GetNext() : m_init; return tmp; } bool operator!=(const itor& it) const { return it.m_node != m_node; } bool operator==(const itor& it) const { return it.m_node == m_node; } }; class const_reverse_iterator { public: typedef nodetype Node; typedef T* value_type; typedef const_reverse_iterator itor; typedef value_type* ptr_type; typedef const value_type& const_reference; Node* m_node; Node* m_init; public: typedef const_reference reference_type; typedef const ptr_type pointer_type; const_reverse_iterator(Node* node, Node* init) : m_node(node), m_init(init) { } const_reverse_iterator() : m_node(NULL), m_init(NULL) { } const_reverse_iterator(const reverse_iterator& it) : m_node(it.m_node), m_init(it.m_init) { } reference_type operator*() const { return *m_node->GetDataPtr(); } // ptrop itor& operator++() { m_node = m_node->GetPrevious(); return *this; } const itor operator++(int) { itor tmp = *this; m_node = m_node->GetPrevious(); return tmp; } itor& operator--() { m_node = m_node ? m_node->GetNext() : m_init; return *this;} const itor operator--(int) { itor tmp = *this; m_node = m_node ? m_node->GetNext() : m_init; return tmp; } bool operator!=(const itor& it) const { return it.m_node != m_node; } bool operator==(const itor& it) const { return it.m_node == m_node; } }; explicit wxDList(size_type n, const_reference v = value_type()) { assign(n, v); } wxDList(const const_iterator& first, const const_iterator& last) { assign(first, last); } iterator begin() { return iterator(GetFirst(), GetLast()); } const_iterator begin() const { return const_iterator(GetFirst(), GetLast()); } iterator end() { return iterator(NULL, GetLast()); } const_iterator end() const { return const_iterator(NULL, GetLast()); } reverse_iterator rbegin() { return reverse_iterator(GetLast(), GetFirst()); } const_reverse_iterator rbegin() const { return const_reverse_iterator(GetLast(), GetFirst()); } reverse_iterator rend() { return reverse_iterator(NULL, GetFirst()); } const_reverse_iterator rend() const { return const_reverse_iterator(NULL, GetFirst()); } void resize(size_type n, value_type v = value_type()) { while (n < size()) pop_back(); while (n > size()) push_back(v); } size_type size() const { return GetCount(); } size_type max_size() const { return INT_MAX; } bool empty() const { return IsEmpty(); } reference front() { return *begin(); } const_reference front() const { return *begin(); } reference back() { iterator tmp = end(); return *--tmp; } const_reference back() const { const_iterator tmp = end(); return *--tmp; } void push_front(const_reference v = value_type()) { Insert(GetFirst(), v); } void pop_front() { DeleteNode(GetFirst()); } void push_back(const_reference v = value_type()) { Append( v ); } void pop_back() { DeleteNode(GetLast()); } void assign(const_iterator first, const const_iterator& last) { clear(); for(; first != last; ++first) Append(*first); } void assign(size_type n, const_reference v = value_type()) { clear(); for(size_type i = 0; i < n; ++i) Append(v); } iterator insert(const iterator& it, const_reference v) { if (it == end()) Append( v ); else Insert(it.m_node,v); iterator itprev(it); return itprev--; } void insert(const iterator& it, size_type n, const_reference v) { for(size_type i = 0; i < n; ++i) Insert(it.m_node, v); } void insert(const iterator& it, const_iterator first, const const_iterator& last) { for(; first != last; ++first) Insert(it.m_node, *first); } iterator erase(const iterator& it) { iterator next = iterator(it.m_node->GetNext(), GetLast()); DeleteNode(it.m_node); return next; } iterator erase(const iterator& first, const iterator& last) { iterator next = last; ++next; DeleteNodes(first.m_node, last.m_node); return next; } void clear() { Clear(); } void splice(const iterator& it, wxDList<T>& l, const iterator& first, const iterator& last) { insert(it, first, last); l.erase(first, last); } void splice(const iterator& it, wxDList<T>& l) { splice(it, l, l.begin(), l.end() ); } void splice(const iterator& it, wxDList<T>& l, const iterator& first) { iterator tmp = first; ++tmp; if(it == first || it == tmp) return; insert(it, *first); l.erase(first); } void remove(const_reference v) { DeleteObject(v); } void reverse() { Reverse(); } /* void swap(list<T>& l) { { size_t t = m_count; m_count = l.m_count; l.m_count = t; } { bool t = m_destroy; m_destroy = l.m_destroy; l.m_destroy = t; } { wxNodeBase* t = m_nodeFirst; m_nodeFirst = l.m_nodeFirst; l.m_nodeFirst = t; } { wxNodeBase* t = m_nodeLast; m_nodeLast = l.m_nodeLast; l.m_nodeLast = t; } { wxKeyType t = m_keyType; m_keyType = l.m_keyType; l.m_keyType = t; } } */ }; #endif // wxUSE_STD_CONTAINERS/!wxUSE_STD_CONTAINERS #endif // _WX_DLIST_H_
h
rticonnextdds-usecases
data/projects/rticonnextdds-usecases/VehicleTracking/ExampleCode/thirdparty/wxWidgets-3.1.2/Win64/include/wx/numdlg.h
///////////////////////////////////////////////////////////////////////////// // Name: wx/numdlg.h // Purpose: wxNumberEntryDialog class // Author: John Labenski // Modified by: // Created: 07.02.04 (extracted from wx/textdlg.h) // Copyright: (c) John Labenski // Licence: wxWindows licence ///////////////////////////////////////////////////////////////////////////// #ifndef _WX_NUMDLGDLG_H_BASE_ #define _WX_NUMDLGDLG_H_BASE_ #include "wx/defs.h" #if wxUSE_NUMBERDLG #include "wx/generic/numdlgg.h" #endif // wxUSE_NUMBERDLG #endif // _WX_NUMDLGDLG_H_BASE_
h
rticonnextdds-usecases
data/projects/rticonnextdds-usecases/VehicleTracking/ExampleCode/thirdparty/wxWidgets-3.1.2/Win64/include/wx/language.h
///////////////////////////////////////////////////////////////////////////// // Name: wx/language.h // Purpose: wxLanguage enum // Author: Vadim Zeitlin // Created: 2010-04-23 // Copyright: (c) 1998 Vadim Zeitlin <[email protected]> // Licence: wxWindows licence ///////////////////////////////////////////////////////////////////////////// // WARNING: Parts of this file are generated. See misc/languages/README for // details. #ifndef _WX_LANGUAGE_H_ #define _WX_LANGUAGE_H_ #include "wx/defs.h" #if wxUSE_INTL // ---------------------------------------------------------------------------- // wxLanguage: defines all supported languages // ---------------------------------------------------------------------------- // --- --- --- generated code begins here --- --- --- /** The languages supported by wxLocale. This enum is generated by misc/languages/genlang.py When making changes, please put them into misc/languages/langtabl.txt */ enum wxLanguage { /// User's default/preferred language as got from OS. wxLANGUAGE_DEFAULT, /// Unknown language, returned if wxLocale::GetSystemLanguage fails. wxLANGUAGE_UNKNOWN, wxLANGUAGE_ABKHAZIAN, wxLANGUAGE_AFAR, wxLANGUAGE_AFRIKAANS, wxLANGUAGE_ALBANIAN, wxLANGUAGE_AMHARIC, wxLANGUAGE_ARABIC, wxLANGUAGE_ARABIC_ALGERIA, wxLANGUAGE_ARABIC_BAHRAIN, wxLANGUAGE_ARABIC_EGYPT, wxLANGUAGE_ARABIC_IRAQ, wxLANGUAGE_ARABIC_JORDAN, wxLANGUAGE_ARABIC_KUWAIT, wxLANGUAGE_ARABIC_LEBANON, wxLANGUAGE_ARABIC_LIBYA, wxLANGUAGE_ARABIC_MOROCCO, wxLANGUAGE_ARABIC_OMAN, wxLANGUAGE_ARABIC_QATAR, wxLANGUAGE_ARABIC_SAUDI_ARABIA, wxLANGUAGE_ARABIC_SUDAN, wxLANGUAGE_ARABIC_SYRIA, wxLANGUAGE_ARABIC_TUNISIA, wxLANGUAGE_ARABIC_UAE, wxLANGUAGE_ARABIC_YEMEN, wxLANGUAGE_ARMENIAN, wxLANGUAGE_ASSAMESE, wxLANGUAGE_ASTURIAN, wxLANGUAGE_AYMARA, wxLANGUAGE_AZERI, wxLANGUAGE_AZERI_CYRILLIC, wxLANGUAGE_AZERI_LATIN, wxLANGUAGE_BASHKIR, wxLANGUAGE_BASQUE, wxLANGUAGE_BELARUSIAN, wxLANGUAGE_BENGALI, wxLANGUAGE_BHUTANI, wxLANGUAGE_BIHARI, wxLANGUAGE_BISLAMA, wxLANGUAGE_BOSNIAN, wxLANGUAGE_BRETON, wxLANGUAGE_BULGARIAN, wxLANGUAGE_BURMESE, wxLANGUAGE_CATALAN, wxLANGUAGE_CHINESE, wxLANGUAGE_CHINESE_SIMPLIFIED, wxLANGUAGE_CHINESE_TRADITIONAL, wxLANGUAGE_CHINESE_HONGKONG, wxLANGUAGE_CHINESE_MACAU, wxLANGUAGE_CHINESE_SINGAPORE, wxLANGUAGE_CHINESE_TAIWAN, wxLANGUAGE_CORSICAN, wxLANGUAGE_CROATIAN, wxLANGUAGE_CZECH, wxLANGUAGE_DANISH, wxLANGUAGE_DUTCH, wxLANGUAGE_DUTCH_BELGIAN, wxLANGUAGE_ENGLISH, wxLANGUAGE_ENGLISH_UK, wxLANGUAGE_ENGLISH_US, wxLANGUAGE_ENGLISH_AUSTRALIA, wxLANGUAGE_ENGLISH_BELIZE, wxLANGUAGE_ENGLISH_BOTSWANA, wxLANGUAGE_ENGLISH_CANADA, wxLANGUAGE_ENGLISH_CARIBBEAN, wxLANGUAGE_ENGLISH_DENMARK, wxLANGUAGE_ENGLISH_EIRE, wxLANGUAGE_ENGLISH_JAMAICA, wxLANGUAGE_ENGLISH_NEW_ZEALAND, wxLANGUAGE_ENGLISH_PHILIPPINES, wxLANGUAGE_ENGLISH_SOUTH_AFRICA, wxLANGUAGE_ENGLISH_TRINIDAD, wxLANGUAGE_ENGLISH_ZIMBABWE, wxLANGUAGE_ESPERANTO, wxLANGUAGE_ESTONIAN, wxLANGUAGE_FAEROESE, wxLANGUAGE_FARSI, wxLANGUAGE_FIJI, wxLANGUAGE_FINNISH, wxLANGUAGE_FRENCH, wxLANGUAGE_FRENCH_BELGIAN, wxLANGUAGE_FRENCH_CANADIAN, wxLANGUAGE_FRENCH_LUXEMBOURG, wxLANGUAGE_FRENCH_MONACO, wxLANGUAGE_FRENCH_SWISS, wxLANGUAGE_FRISIAN, wxLANGUAGE_GALICIAN, wxLANGUAGE_GEORGIAN, wxLANGUAGE_GERMAN, wxLANGUAGE_GERMAN_AUSTRIAN, wxLANGUAGE_GERMAN_BELGIUM, wxLANGUAGE_GERMAN_LIECHTENSTEIN, wxLANGUAGE_GERMAN_LUXEMBOURG, wxLANGUAGE_GERMAN_SWISS, wxLANGUAGE_GREEK, wxLANGUAGE_GREENLANDIC, wxLANGUAGE_GUARANI, wxLANGUAGE_GUJARATI, wxLANGUAGE_HAUSA, wxLANGUAGE_HEBREW, wxLANGUAGE_HINDI, wxLANGUAGE_HUNGARIAN, wxLANGUAGE_ICELANDIC, wxLANGUAGE_INDONESIAN, wxLANGUAGE_INTERLINGUA, wxLANGUAGE_INTERLINGUE, wxLANGUAGE_INUKTITUT, wxLANGUAGE_INUPIAK, wxLANGUAGE_IRISH, wxLANGUAGE_ITALIAN, wxLANGUAGE_ITALIAN_SWISS, wxLANGUAGE_JAPANESE, wxLANGUAGE_JAVANESE, wxLANGUAGE_KABYLE, wxLANGUAGE_KANNADA, wxLANGUAGE_KASHMIRI, wxLANGUAGE_KASHMIRI_INDIA, wxLANGUAGE_KAZAKH, wxLANGUAGE_KERNEWEK, wxLANGUAGE_KHMER, wxLANGUAGE_KINYARWANDA, wxLANGUAGE_KIRGHIZ, wxLANGUAGE_KIRUNDI, wxLANGUAGE_KONKANI, wxLANGUAGE_KOREAN, wxLANGUAGE_KURDISH, wxLANGUAGE_LAOTHIAN, wxLANGUAGE_LATIN, wxLANGUAGE_LATVIAN, wxLANGUAGE_LINGALA, wxLANGUAGE_LITHUANIAN, wxLANGUAGE_MACEDONIAN, wxLANGUAGE_MALAGASY, wxLANGUAGE_MALAY, wxLANGUAGE_MALAYALAM, wxLANGUAGE_MALAY_BRUNEI_DARUSSALAM, wxLANGUAGE_MALAY_MALAYSIA, wxLANGUAGE_MALTESE, wxLANGUAGE_MANIPURI, wxLANGUAGE_MAORI, wxLANGUAGE_MARATHI, wxLANGUAGE_MOLDAVIAN, wxLANGUAGE_MONGOLIAN, wxLANGUAGE_NAURU, wxLANGUAGE_NEPALI, wxLANGUAGE_NEPALI_INDIA, wxLANGUAGE_NORWEGIAN_BOKMAL, wxLANGUAGE_NORWEGIAN_NYNORSK, wxLANGUAGE_OCCITAN, wxLANGUAGE_ORIYA, wxLANGUAGE_OROMO, wxLANGUAGE_PASHTO, wxLANGUAGE_POLISH, wxLANGUAGE_PORTUGUESE, wxLANGUAGE_PORTUGUESE_BRAZILIAN, wxLANGUAGE_PUNJABI, wxLANGUAGE_QUECHUA, wxLANGUAGE_RHAETO_ROMANCE, wxLANGUAGE_ROMANIAN, wxLANGUAGE_RUSSIAN, wxLANGUAGE_RUSSIAN_UKRAINE, wxLANGUAGE_SAMI, wxLANGUAGE_SAMOAN, wxLANGUAGE_SANGHO, wxLANGUAGE_SANSKRIT, wxLANGUAGE_SCOTS_GAELIC, wxLANGUAGE_SERBIAN, wxLANGUAGE_SERBIAN_CYRILLIC, wxLANGUAGE_SERBIAN_LATIN, wxLANGUAGE_SERBO_CROATIAN, wxLANGUAGE_SESOTHO, wxLANGUAGE_SETSWANA, wxLANGUAGE_SHONA, wxLANGUAGE_SINDHI, wxLANGUAGE_SINHALESE, wxLANGUAGE_SISWATI, wxLANGUAGE_SLOVAK, wxLANGUAGE_SLOVENIAN, wxLANGUAGE_SOMALI, wxLANGUAGE_SPANISH, wxLANGUAGE_SPANISH_ARGENTINA, wxLANGUAGE_SPANISH_BOLIVIA, wxLANGUAGE_SPANISH_CHILE, wxLANGUAGE_SPANISH_COLOMBIA, wxLANGUAGE_SPANISH_COSTA_RICA, wxLANGUAGE_SPANISH_DOMINICAN_REPUBLIC, wxLANGUAGE_SPANISH_ECUADOR, wxLANGUAGE_SPANISH_EL_SALVADOR, wxLANGUAGE_SPANISH_GUATEMALA, wxLANGUAGE_SPANISH_HONDURAS, wxLANGUAGE_SPANISH_MEXICAN, wxLANGUAGE_SPANISH_MODERN, wxLANGUAGE_SPANISH_NICARAGUA, wxLANGUAGE_SPANISH_PANAMA, wxLANGUAGE_SPANISH_PARAGUAY, wxLANGUAGE_SPANISH_PERU, wxLANGUAGE_SPANISH_PUERTO_RICO, wxLANGUAGE_SPANISH_URUGUAY, wxLANGUAGE_SPANISH_US, wxLANGUAGE_SPANISH_VENEZUELA, wxLANGUAGE_SUNDANESE, wxLANGUAGE_SWAHILI, wxLANGUAGE_SWEDISH, wxLANGUAGE_SWEDISH_FINLAND, wxLANGUAGE_TAGALOG, wxLANGUAGE_TAJIK, wxLANGUAGE_TAMIL, wxLANGUAGE_TATAR, wxLANGUAGE_TELUGU, wxLANGUAGE_THAI, wxLANGUAGE_TIBETAN, wxLANGUAGE_TIGRINYA, wxLANGUAGE_TONGA, wxLANGUAGE_TSONGA, wxLANGUAGE_TURKISH, wxLANGUAGE_TURKMEN, wxLANGUAGE_TWI, wxLANGUAGE_UIGHUR, wxLANGUAGE_UKRAINIAN, wxLANGUAGE_URDU, wxLANGUAGE_URDU_INDIA, wxLANGUAGE_URDU_PAKISTAN, wxLANGUAGE_UZBEK, wxLANGUAGE_UZBEK_CYRILLIC, wxLANGUAGE_UZBEK_LATIN, wxLANGUAGE_VALENCIAN, wxLANGUAGE_VIETNAMESE, wxLANGUAGE_VOLAPUK, wxLANGUAGE_WELSH, wxLANGUAGE_WOLOF, wxLANGUAGE_XHOSA, wxLANGUAGE_YIDDISH, wxLANGUAGE_YORUBA, wxLANGUAGE_ZHUANG, wxLANGUAGE_ZULU, /// For custom, user-defined languages. wxLANGUAGE_USER_DEFINED, /// Obsolete synonym. wxLANGUAGE_CAMBODIAN = wxLANGUAGE_KHMER }; // --- --- --- generated code ends here --- --- --- #endif // wxUSE_INTL #endif // _WX_LANGUAGE_H_
h
rticonnextdds-usecases
data/projects/rticonnextdds-usecases/VehicleTracking/ExampleCode/thirdparty/wxWidgets-3.1.2/Win64/include/wx/renderer.h
/////////////////////////////////////////////////////////////////////////////// // Name: wx/renderer.h // Purpose: wxRendererNative class declaration // Author: Vadim Zeitlin // Modified by: // Created: 20.07.2003 // Copyright: (c) 2003 Vadim Zeitlin <[email protected]> // Licence: wxWindows licence /////////////////////////////////////////////////////////////////////////////// /* Renderers are used in wxWidgets for two similar but different things: (a) wxUniversal uses them to draw everything, i.e. all the control (b) all the native ports use them to draw generic controls only wxUniversal needs more functionality than what is included in the base class as it needs to draw stuff like scrollbars which are never going to be generic. So we put the bare minimum needed by the native ports here and the full wxRenderer class is declared in wx/univ/renderer.h and is only used by wxUniveral (although note that native ports can load wxRenderer objects from theme DLLs and use them as wxRendererNative ones, of course). */ #ifndef _WX_RENDERER_H_ #define _WX_RENDERER_H_ class WXDLLIMPEXP_FWD_CORE wxDC; class WXDLLIMPEXP_FWD_CORE wxWindow; #include "wx/gdicmn.h" // for wxPoint, wxSize #include "wx/colour.h" #include "wx/font.h" #include "wx/bitmap.h" #include "wx/string.h" // some platforms have their own renderers, others use the generic one #if defined(__WXMSW__) || ( defined(__WXMAC__) && wxOSX_USE_COCOA_OR_CARBON ) || defined(__WXGTK__) #define wxHAS_NATIVE_RENDERER #else #undef wxHAS_NATIVE_RENDERER #endif // only MSW and OS X currently provides DrawTitleBarBitmap() method #if defined(__WXMSW__) || (defined(__WXMAC__) && wxUSE_LIBPNG && wxUSE_IMAGE) #define wxHAS_DRAW_TITLE_BAR_BITMAP #endif // ---------------------------------------------------------------------------- // constants // ---------------------------------------------------------------------------- // control state flags used in wxRenderer and wxColourScheme enum { wxCONTROL_NONE = 0x00000000, // absence of any other flags wxCONTROL_DISABLED = 0x00000001, // control is disabled wxCONTROL_FOCUSED = 0x00000002, // currently has keyboard focus wxCONTROL_PRESSED = 0x00000004, // (button) is pressed wxCONTROL_SPECIAL = 0x00000008, // control-specific bit: wxCONTROL_ISDEFAULT = wxCONTROL_SPECIAL, // only for the buttons wxCONTROL_ISSUBMENU = wxCONTROL_SPECIAL, // only for the menu items wxCONTROL_EXPANDED = wxCONTROL_SPECIAL, // only for the tree items wxCONTROL_SIZEGRIP = wxCONTROL_SPECIAL, // only for the status bar panes wxCONTROL_FLAT = wxCONTROL_SPECIAL, // checkboxes only: flat border wxCONTROL_CELL = wxCONTROL_SPECIAL, // only for item selection rect wxCONTROL_CURRENT = 0x00000010, // mouse is currently over the control wxCONTROL_SELECTED = 0x00000020, // selected item in e.g. listbox wxCONTROL_CHECKED = 0x00000040, // (check/radio button) is checked wxCONTROL_CHECKABLE = 0x00000080, // (menu) item can be checked wxCONTROL_UNDETERMINED = wxCONTROL_CHECKABLE, // (check) undetermined state wxCONTROL_FLAGS_MASK = 0x000000ff, // this is a pseudo flag not used directly by wxRenderer but rather by some // controls internally wxCONTROL_DIRTY = 0x80000000 }; // title bar buttons supported by DrawTitleBarBitmap() // // NB: they have the same values as wxTOPLEVEL_BUTTON_XXX constants in // wx/univ/toplevel.h as they really represent the same things enum wxTitleBarButton { wxTITLEBAR_BUTTON_CLOSE = 0x01000000, wxTITLEBAR_BUTTON_MAXIMIZE = 0x02000000, wxTITLEBAR_BUTTON_ICONIZE = 0x04000000, wxTITLEBAR_BUTTON_RESTORE = 0x08000000, wxTITLEBAR_BUTTON_HELP = 0x10000000 }; // ---------------------------------------------------------------------------- // helper structs // ---------------------------------------------------------------------------- // wxSplitterWindow parameters struct WXDLLIMPEXP_CORE wxSplitterRenderParams { // the only way to initialize this struct is by using this ctor wxSplitterRenderParams(wxCoord widthSash_, wxCoord border_, bool isSens_) : widthSash(widthSash_), border(border_), isHotSensitive(isSens_) { } // the width of the splitter sash const wxCoord widthSash; // the width of the border of the splitter window const wxCoord border; // true if the splitter changes its appearance when the mouse is over it const bool isHotSensitive; }; // extra optional parameters for DrawHeaderButton struct WXDLLIMPEXP_CORE wxHeaderButtonParams { wxHeaderButtonParams() : m_labelAlignment(wxALIGN_LEFT) { } wxColour m_arrowColour; wxColour m_selectionColour; wxString m_labelText; wxFont m_labelFont; wxColour m_labelColour; wxBitmap m_labelBitmap; int m_labelAlignment; }; enum wxHeaderSortIconType { wxHDR_SORT_ICON_NONE, // Header button has no sort arrow wxHDR_SORT_ICON_UP, // Header button an up sort arrow icon wxHDR_SORT_ICON_DOWN // Header button a down sort arrow icon }; // wxRendererNative interface version struct WXDLLIMPEXP_CORE wxRendererVersion { wxRendererVersion(int version_, int age_) : version(version_), age(age_) { } // default copy ctor, assignment operator and dtor are ok // the current version and age of wxRendererNative interface: different // versions are incompatible (in both ways) while the ages inside the same // version are upwards compatible, i.e. the version of the renderer must // match the version of the main program exactly while the age may be // highergreater or equal to it // // NB: don't forget to increment age after adding any new virtual function! enum { Current_Version = 1, Current_Age = 5 }; // check if the given version is compatible with the current one static bool IsCompatible(const wxRendererVersion& ver) { return ver.version == Current_Version && ver.age >= Current_Age; } const int version; const int age; }; // ---------------------------------------------------------------------------- // wxRendererNative: abstracts drawing methods needed by the native controls // ---------------------------------------------------------------------------- class WXDLLIMPEXP_CORE wxRendererNative { public: // drawing functions // ----------------- // draw the header control button (used by wxListCtrl) Returns optimal // width for the label contents. virtual int DrawHeaderButton(wxWindow *win, wxDC& dc, const wxRect& rect, int flags = 0, wxHeaderSortIconType sortArrow = wxHDR_SORT_ICON_NONE, wxHeaderButtonParams* params=NULL) = 0; // Draw the contents of a header control button (label, sort arrows, etc.) // Normally only called by DrawHeaderButton. virtual int DrawHeaderButtonContents(wxWindow *win, wxDC& dc, const wxRect& rect, int flags = 0, wxHeaderSortIconType sortArrow = wxHDR_SORT_ICON_NONE, wxHeaderButtonParams* params=NULL) = 0; // Returns the default height of a header button, either a fixed platform // height if available, or a generic height based on the window's font. virtual int GetHeaderButtonHeight(wxWindow *win) = 0; // Returns the margin on left and right sides of header button's label virtual int GetHeaderButtonMargin(wxWindow *win) = 0; // draw the expanded/collapsed icon for a tree control item virtual void DrawTreeItemButton(wxWindow *win, wxDC& dc, const wxRect& rect, int flags = 0) = 0; // draw the border for sash window: this border must be such that the sash // drawn by DrawSash() blends into it well virtual void DrawSplitterBorder(wxWindow *win, wxDC& dc, const wxRect& rect, int flags = 0) = 0; // draw a (vertical) sash virtual void DrawSplitterSash(wxWindow *win, wxDC& dc, const wxSize& size, wxCoord position, wxOrientation orient, int flags = 0) = 0; // draw a combobox dropdown button // // flags may use wxCONTROL_PRESSED and wxCONTROL_CURRENT virtual void DrawComboBoxDropButton(wxWindow *win, wxDC& dc, const wxRect& rect, int flags = 0) = 0; // draw a dropdown arrow // // flags may use wxCONTROL_PRESSED and wxCONTROL_CURRENT virtual void DrawDropArrow(wxWindow *win, wxDC& dc, const wxRect& rect, int flags = 0) = 0; // draw check button // // flags may use wxCONTROL_CHECKED, wxCONTROL_UNDETERMINED and wxCONTROL_CURRENT virtual void DrawCheckBox(wxWindow *win, wxDC& dc, const wxRect& rect, int flags = 0) = 0; // Returns the default size of a check box. virtual wxSize GetCheckBoxSize(wxWindow *win) = 0; // draw blank button // // flags may use wxCONTROL_PRESSED, wxCONTROL_CURRENT and wxCONTROL_ISDEFAULT virtual void DrawPushButton(wxWindow *win, wxDC& dc, const wxRect& rect, int flags = 0) = 0; // draw collapse button // // flags may use wxCONTROL_CHECKED, wxCONTROL_UNDETERMINED and wxCONTROL_CURRENT virtual void DrawCollapseButton(wxWindow *win, wxDC& dc, const wxRect& rect, int flags = 0) = 0; // Returns the default size of a collapse button virtual wxSize GetCollapseButtonSize(wxWindow *win, wxDC& dc) = 0; // draw rectangle indicating that an item in e.g. a list control // has been selected or focused // // flags may use // wxCONTROL_SELECTED (item is selected, e.g. draw background) // wxCONTROL_CURRENT (item is the current item, e.g. dotted border) // wxCONTROL_FOCUSED (the whole control has focus, e.g. blue background vs. grey otherwise) virtual void DrawItemSelectionRect(wxWindow *win, wxDC& dc, const wxRect& rect, int flags = 0) = 0; // draw the focus rectangle around the label contained in the given rect // // only wxCONTROL_SELECTED makes sense in flags here virtual void DrawFocusRect(wxWindow* win, wxDC& dc, const wxRect& rect, int flags = 0) = 0; // Draw a native wxChoice virtual void DrawChoice(wxWindow* win, wxDC& dc, const wxRect& rect, int flags = 0) = 0; // Draw a native wxComboBox virtual void DrawComboBox(wxWindow* win, wxDC& dc, const wxRect& rect, int flags = 0) = 0; // Draw a native wxTextCtrl frame virtual void DrawTextCtrl(wxWindow* win, wxDC& dc, const wxRect& rect, int flags = 0) = 0; // Draw a native wxRadioButton bitmap virtual void DrawRadioBitmap(wxWindow* win, wxDC& dc, const wxRect& rect, int flags = 0) = 0; #ifdef wxHAS_DRAW_TITLE_BAR_BITMAP // Draw one of the standard title bar buttons // // This is currently implemented only for MSW and OS X (for the close // button only) because there is no way to render standard title bar // buttons under the other platforms, the best can be done is to use normal // (only) images which wxArtProvider provides for wxART_HELP and // wxART_CLOSE (but not any other title bar buttons) // // NB: make sure PNG handler is enabled if using this function under OS X virtual void DrawTitleBarBitmap(wxWindow *win, wxDC& dc, const wxRect& rect, wxTitleBarButton button, int flags = 0) = 0; #endif // wxHAS_DRAW_TITLE_BAR_BITMAP // Draw a gauge with native style like a wxGauge would display. // // wxCONTROL_SPECIAL flag must be used for drawing vertical gauges. virtual void DrawGauge(wxWindow* win, wxDC& dc, const wxRect& rect, int value, int max, int flags = 0) = 0; // Draw text using the appropriate color for normal and selected states. virtual void DrawItemText(wxWindow* win, wxDC& dc, const wxString& text, const wxRect& rect, int align = wxALIGN_LEFT | wxALIGN_TOP, int flags = 0, wxEllipsizeMode ellipsizeMode = wxELLIPSIZE_END) = 0; // geometry functions // ------------------ // get the splitter parameters: the x field of the returned point is the // sash width and the y field is the border width virtual wxSplitterRenderParams GetSplitterParams(const wxWindow *win) = 0; // pseudo constructors // ------------------- // return the currently used renderer static wxRendererNative& Get(); // return the generic implementation of the renderer static wxRendererNative& GetGeneric(); // return the default (native) implementation for this platform static wxRendererNative& GetDefault(); // changing the global renderer // ---------------------------- #if wxUSE_DYNLIB_CLASS // load the renderer from the specified DLL, the returned pointer must be // deleted by caller if not NULL when it is not used any more static wxRendererNative *Load(const wxString& name); #endif // wxUSE_DYNLIB_CLASS // set the renderer to use, passing NULL reverts to using the default // renderer // // return the previous renderer used with Set() or NULL if none static wxRendererNative *Set(wxRendererNative *renderer); // miscellaneous stuff // ------------------- // this function is used for version checking: Load() refuses to load any // DLLs implementing an older or incompatible version; it should be // implemented simply by returning wxRendererVersion::Current_XXX values virtual wxRendererVersion GetVersion() const = 0; // virtual dtor for any base class virtual ~wxRendererNative(); }; // ---------------------------------------------------------------------------- // wxDelegateRendererNative: allows reuse of renderers code // ---------------------------------------------------------------------------- class WXDLLIMPEXP_CORE wxDelegateRendererNative : public wxRendererNative { public: wxDelegateRendererNative() : m_rendererNative(GetGeneric()) { } wxDelegateRendererNative(wxRendererNative& rendererNative) : m_rendererNative(rendererNative) { } virtual int DrawHeaderButton(wxWindow *win, wxDC& dc, const wxRect& rect, int flags = 0, wxHeaderSortIconType sortArrow = wxHDR_SORT_ICON_NONE, wxHeaderButtonParams* params = NULL) wxOVERRIDE { return m_rendererNative.DrawHeaderButton(win, dc, rect, flags, sortArrow, params); } virtual int DrawHeaderButtonContents(wxWindow *win, wxDC& dc, const wxRect& rect, int flags = 0, wxHeaderSortIconType sortArrow = wxHDR_SORT_ICON_NONE, wxHeaderButtonParams* params = NULL) wxOVERRIDE { return m_rendererNative.DrawHeaderButtonContents(win, dc, rect, flags, sortArrow, params); } virtual int GetHeaderButtonHeight(wxWindow *win) wxOVERRIDE { return m_rendererNative.GetHeaderButtonHeight(win); } virtual int GetHeaderButtonMargin(wxWindow *win) wxOVERRIDE { return m_rendererNative.GetHeaderButtonMargin(win); } virtual void DrawTreeItemButton(wxWindow *win, wxDC& dc, const wxRect& rect, int flags = 0) wxOVERRIDE { m_rendererNative.DrawTreeItemButton(win, dc, rect, flags); } virtual void DrawSplitterBorder(wxWindow *win, wxDC& dc, const wxRect& rect, int flags = 0) wxOVERRIDE { m_rendererNative.DrawSplitterBorder(win, dc, rect, flags); } virtual void DrawSplitterSash(wxWindow *win, wxDC& dc, const wxSize& size, wxCoord position, wxOrientation orient, int flags = 0) wxOVERRIDE { m_rendererNative.DrawSplitterSash(win, dc, size, position, orient, flags); } virtual void DrawComboBoxDropButton(wxWindow *win, wxDC& dc, const wxRect& rect, int flags = 0) wxOVERRIDE { m_rendererNative.DrawComboBoxDropButton(win, dc, rect, flags); } virtual void DrawDropArrow(wxWindow *win, wxDC& dc, const wxRect& rect, int flags = 0) wxOVERRIDE { m_rendererNative.DrawDropArrow(win, dc, rect, flags); } virtual void DrawCheckBox(wxWindow *win, wxDC& dc, const wxRect& rect, int flags = 0) wxOVERRIDE { m_rendererNative.DrawCheckBox( win, dc, rect, flags ); } virtual wxSize GetCheckBoxSize(wxWindow *win) wxOVERRIDE { return m_rendererNative.GetCheckBoxSize(win); } virtual void DrawPushButton(wxWindow *win, wxDC& dc, const wxRect& rect, int flags = 0) wxOVERRIDE { m_rendererNative.DrawPushButton( win, dc, rect, flags ); } virtual void DrawCollapseButton(wxWindow *win, wxDC& dc, const wxRect& rect, int flags = 0) wxOVERRIDE { m_rendererNative.DrawCollapseButton(win, dc, rect, flags); } virtual wxSize GetCollapseButtonSize(wxWindow *win, wxDC& dc) wxOVERRIDE { return m_rendererNative.GetCollapseButtonSize(win, dc); } virtual void DrawItemSelectionRect(wxWindow *win, wxDC& dc, const wxRect& rect, int flags = 0) wxOVERRIDE { m_rendererNative.DrawItemSelectionRect( win, dc, rect, flags ); } virtual void DrawFocusRect(wxWindow* win, wxDC& dc, const wxRect& rect, int flags = 0) wxOVERRIDE { m_rendererNative.DrawFocusRect( win, dc, rect, flags ); } virtual void DrawChoice(wxWindow* win, wxDC& dc, const wxRect& rect, int flags = 0) wxOVERRIDE { m_rendererNative.DrawChoice( win, dc, rect, flags); } virtual void DrawComboBox(wxWindow* win, wxDC& dc, const wxRect& rect, int flags = 0) wxOVERRIDE { m_rendererNative.DrawComboBox( win, dc, rect, flags); } virtual void DrawTextCtrl(wxWindow* win, wxDC& dc, const wxRect& rect, int flags = 0) wxOVERRIDE { m_rendererNative.DrawTextCtrl( win, dc, rect, flags); } virtual void DrawRadioBitmap(wxWindow* win, wxDC& dc, const wxRect& rect, int flags = 0) wxOVERRIDE { m_rendererNative.DrawRadioBitmap(win, dc, rect, flags); } #ifdef wxHAS_DRAW_TITLE_BAR_BITMAP virtual void DrawTitleBarBitmap(wxWindow *win, wxDC& dc, const wxRect& rect, wxTitleBarButton button, int flags = 0) wxOVERRIDE { m_rendererNative.DrawTitleBarBitmap(win, dc, rect, button, flags); } #endif // wxHAS_DRAW_TITLE_BAR_BITMAP virtual void DrawGauge(wxWindow* win, wxDC& dc, const wxRect& rect, int value, int max, int flags = 0) wxOVERRIDE { m_rendererNative.DrawGauge(win, dc, rect, value, max, flags); } virtual void DrawItemText(wxWindow* win, wxDC& dc, const wxString& text, const wxRect& rect, int align = wxALIGN_LEFT | wxALIGN_TOP, int flags = 0, wxEllipsizeMode ellipsizeMode = wxELLIPSIZE_END) wxOVERRIDE { m_rendererNative.DrawItemText(win, dc, text, rect, align, flags, ellipsizeMode); } virtual wxSplitterRenderParams GetSplitterParams(const wxWindow *win) wxOVERRIDE { return m_rendererNative.GetSplitterParams(win); } virtual wxRendererVersion GetVersion() const wxOVERRIDE { return m_rendererNative.GetVersion(); } protected: wxRendererNative& m_rendererNative; wxDECLARE_NO_COPY_CLASS(wxDelegateRendererNative); }; // ---------------------------------------------------------------------------- // inline functions implementation // ---------------------------------------------------------------------------- #ifndef wxHAS_NATIVE_RENDERER // default native renderer is the generic one then /* static */ inline wxRendererNative& wxRendererNative::GetDefault() { return GetGeneric(); } #endif // !wxHAS_NATIVE_RENDERER #endif // _WX_RENDERER_H_
h
rticonnextdds-usecases
data/projects/rticonnextdds-usecases/VehicleTracking/ExampleCode/thirdparty/wxWidgets-3.1.2/Win64/include/wx/statbmp.h
///////////////////////////////////////////////////////////////////////////// // Name: wx/statbmp.h // Purpose: wxStaticBitmap class interface // Author: Vadim Zeitlin // Modified by: // Created: 25.08.00 // Copyright: (c) 2000 Vadim Zeitlin // Licence: wxWindows licence ///////////////////////////////////////////////////////////////////////////// #ifndef _WX_STATBMP_H_BASE_ #define _WX_STATBMP_H_BASE_ #include "wx/defs.h" #if wxUSE_STATBMP #include "wx/control.h" #include "wx/bitmap.h" #include "wx/icon.h" extern WXDLLIMPEXP_DATA_CORE(const char) wxStaticBitmapNameStr[]; // a control showing an icon or a bitmap class WXDLLIMPEXP_CORE wxStaticBitmapBase : public wxControl { public: enum ScaleMode { Scale_None, Scale_Fill, Scale_AspectFit, Scale_AspectFill }; wxStaticBitmapBase() { } virtual ~wxStaticBitmapBase(); // our interface virtual void SetIcon(const wxIcon& icon) = 0; virtual void SetBitmap(const wxBitmap& bitmap) = 0; virtual wxBitmap GetBitmap() const = 0; virtual wxIcon GetIcon() const /* = 0 -- should be pure virtual */ { // stub it out here for now as not all ports implement it (but they // should) return wxIcon(); } virtual void SetScaleMode(ScaleMode WXUNUSED(scaleMode)) { } virtual ScaleMode GetScaleMode() const { return Scale_None; } // overridden base class virtuals virtual bool AcceptsFocus() const wxOVERRIDE { return false; } virtual bool HasTransparentBackground() wxOVERRIDE { return true; } protected: // choose the default border for this window virtual wxBorder GetDefaultBorder() const wxOVERRIDE { return wxBORDER_NONE; } virtual wxSize DoGetBestSize() const wxOVERRIDE; wxDECLARE_NO_COPY_CLASS(wxStaticBitmapBase); }; #if defined(__WXUNIVERSAL__) #include "wx/univ/statbmp.h" #elif defined(__WXMSW__) #include "wx/msw/statbmp.h" #elif defined(__WXMOTIF__) #include "wx/motif/statbmp.h" #elif defined(__WXGTK20__) #include "wx/gtk/statbmp.h" #elif defined(__WXGTK__) #include "wx/gtk1/statbmp.h" #elif defined(__WXMAC__) #include "wx/osx/statbmp.h" #elif defined(__WXQT__) #include "wx/qt/statbmp.h" #endif #endif // wxUSE_STATBMP #endif // _WX_STATBMP_H_BASE_
h
rticonnextdds-usecases
data/projects/rticonnextdds-usecases/VehicleTracking/ExampleCode/thirdparty/wxWidgets-3.1.2/Win64/include/wx/slider.h
/////////////////////////////////////////////////////////////////////////////// // Name: wx/slider.h // Purpose: wxSlider interface // Author: Vadim Zeitlin // Modified by: // Created: 09.02.01 // Copyright: (c) 1996-2001 Vadim Zeitlin // Licence: wxWindows licence /////////////////////////////////////////////////////////////////////////////// #ifndef _WX_SLIDER_H_BASE_ #define _WX_SLIDER_H_BASE_ // ---------------------------------------------------------------------------- // headers // ---------------------------------------------------------------------------- #include "wx/defs.h" #if wxUSE_SLIDER #include "wx/control.h" // ---------------------------------------------------------------------------- // wxSlider flags // ---------------------------------------------------------------------------- #define wxSL_HORIZONTAL wxHORIZONTAL /* 0x0004 */ #define wxSL_VERTICAL wxVERTICAL /* 0x0008 */ #define wxSL_TICKS 0x0010 #define wxSL_AUTOTICKS wxSL_TICKS // we don't support manual ticks #define wxSL_LEFT 0x0040 #define wxSL_TOP 0x0080 #define wxSL_RIGHT 0x0100 #define wxSL_BOTTOM 0x0200 #define wxSL_BOTH 0x0400 #define wxSL_SELRANGE 0x0800 #define wxSL_INVERSE 0x1000 #define wxSL_MIN_MAX_LABELS 0x2000 #define wxSL_VALUE_LABEL 0x4000 #define wxSL_LABELS (wxSL_MIN_MAX_LABELS|wxSL_VALUE_LABEL) extern WXDLLIMPEXP_DATA_CORE(const char) wxSliderNameStr[]; // ---------------------------------------------------------------------------- // wxSliderBase: define wxSlider interface // ---------------------------------------------------------------------------- class WXDLLIMPEXP_CORE wxSliderBase : public wxControl { public: /* the ctor of the derived class should have the following form: wxSlider(wxWindow *parent, wxWindowID id, int value, int minValue, int maxValue, const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxDefaultSize, long style = wxSL_HORIZONTAL, const wxValidator& validator = wxDefaultValidator, const wxString& name = wxSliderNameStr); */ wxSliderBase() { } // get/set the current slider value (should be in range) virtual int GetValue() const = 0; virtual void SetValue(int value) = 0; // retrieve/change the range virtual void SetRange(int minValue, int maxValue) = 0; virtual int GetMin() const = 0; virtual int GetMax() const = 0; void SetMin( int minValue ) { SetRange( minValue , GetMax() ) ; } void SetMax( int maxValue ) { SetRange( GetMin() , maxValue ) ; } // the line/page size is the increment by which the slider moves when // cursor arrow key/page up or down are pressed (clicking the mouse is like // pressing PageUp/Down) and are by default set to 1 and 1/10 of the range virtual void SetLineSize(int lineSize) = 0; virtual void SetPageSize(int pageSize) = 0; virtual int GetLineSize() const = 0; virtual int GetPageSize() const = 0; // these methods get/set the length of the slider pointer in pixels virtual void SetThumbLength(int lenPixels) = 0; virtual int GetThumbLength() const = 0; // warning: most of subsequent methods are currently only implemented in // wxMSW and are silently ignored on other platforms void SetTickFreq(int freq) { DoSetTickFreq(freq); } virtual int GetTickFreq() const { return 0; } virtual void ClearTicks() { } virtual void SetTick(int WXUNUSED(tickPos)) { } virtual void ClearSel() { } virtual int GetSelEnd() const { return GetMin(); } virtual int GetSelStart() const { return GetMax(); } virtual void SetSelection(int WXUNUSED(min), int WXUNUSED(max)) { } #if WXWIN_COMPATIBILITY_2_8 wxDEPRECATED_INLINE( void SetTickFreq(int freq, int), DoSetTickFreq(freq); ) #endif protected: // Platform-specific implementation of SetTickFreq virtual void DoSetTickFreq(int WXUNUSED(freq)) { /* unsupported by default */ } // choose the default border for this window virtual wxBorder GetDefaultBorder() const wxOVERRIDE { return wxBORDER_NONE; } // adjust value according to wxSL_INVERSE style virtual int ValueInvertOrNot(int value) const { if (HasFlag(wxSL_INVERSE)) return (GetMax() + GetMin()) - value; else return value; } private: wxDECLARE_NO_COPY_CLASS(wxSliderBase); }; // ---------------------------------------------------------------------------- // include the real class declaration // ---------------------------------------------------------------------------- #if defined(__WXUNIVERSAL__) #include "wx/univ/slider.h" #elif defined(__WXMSW__) #include "wx/msw/slider.h" #elif defined(__WXMOTIF__) #include "wx/motif/slider.h" #elif defined(__WXGTK20__) #include "wx/gtk/slider.h" #elif defined(__WXGTK__) #include "wx/gtk1/slider.h" #elif defined(__WXMAC__) #include "wx/osx/slider.h" #elif defined(__WXQT__) #include "wx/qt/slider.h" #endif #endif // wxUSE_SLIDER #endif // _WX_SLIDER_H_BASE_
h
rticonnextdds-usecases
data/projects/rticonnextdds-usecases/VehicleTracking/ExampleCode/thirdparty/wxWidgets-3.1.2/Win64/include/wx/menuitem.h
/////////////////////////////////////////////////////////////////////////////// // Name: wx/menuitem.h // Purpose: wxMenuItem class // Author: Vadim Zeitlin // Modified by: // Created: 25.10.99 // Copyright: (c) 1999 Vadim Zeitlin <[email protected]> // Licence: wxWindows licence /////////////////////////////////////////////////////////////////////////////// #ifndef _WX_MENUITEM_H_BASE_ #define _WX_MENUITEM_H_BASE_ #include "wx/defs.h" #if wxUSE_MENUS // ---------------------------------------------------------------------------- // headers // ---------------------------------------------------------------------------- #include "wx/object.h" // base class // ---------------------------------------------------------------------------- // forward declarations // ---------------------------------------------------------------------------- #if wxUSE_ACCEL class WXDLLIMPEXP_FWD_CORE wxAcceleratorEntry; #endif // wxUSE_ACCEL class WXDLLIMPEXP_FWD_CORE wxMenuItem; class WXDLLIMPEXP_FWD_CORE wxMenu; // ---------------------------------------------------------------------------- // wxMenuItem is an item in the menu which may be either a normal item, a sub // menu or a separator // ---------------------------------------------------------------------------- class WXDLLIMPEXP_CORE wxMenuItemBase : public wxObject { public: // creation static wxMenuItem *New(wxMenu *parentMenu = NULL, int itemid = wxID_SEPARATOR, const wxString& text = wxEmptyString, const wxString& help = wxEmptyString, wxItemKind kind = wxITEM_NORMAL, wxMenu *subMenu = NULL); // destruction: wxMenuItem will delete its submenu virtual ~wxMenuItemBase(); // the menu we're in wxMenu *GetMenu() const { return m_parentMenu; } void SetMenu(wxMenu* menu) { m_parentMenu = menu; } // get/set id void SetId(int itemid) { m_id = itemid; } int GetId() const { return m_id; } // the item's text (or name) // // NB: the item's label includes the accelerators and mnemonics info (if // any), i.e. it may contain '&' or '_' or "\t..." and thus is // different from the item's text which only contains the text shown // in the menu. This used to be called SetText. virtual void SetItemLabel(const wxString& str); // return the item label including any mnemonics and accelerators. // This used to be called GetText. virtual wxString GetItemLabel() const { return m_text; } // return just the text of the item label, without any mnemonics // This used to be called GetLabel. virtual wxString GetItemLabelText() const { return GetLabelText(m_text); } // return just the text part of the given label (implemented in platform-specific code) // This used to be called GetLabelFromText. static wxString GetLabelText(const wxString& label); // what kind of menu item we are wxItemKind GetKind() const { return m_kind; } void SetKind(wxItemKind kind) { m_kind = kind; } bool IsSeparator() const { return m_kind == wxITEM_SEPARATOR; } bool IsCheck() const { return m_kind == wxITEM_CHECK; } bool IsRadio() const { return m_kind == wxITEM_RADIO; } virtual void SetCheckable(bool checkable) { m_kind = checkable ? wxITEM_CHECK : wxITEM_NORMAL; } // Notice that this doesn't quite match SetCheckable(). bool IsCheckable() const { return m_kind == wxITEM_CHECK || m_kind == wxITEM_RADIO; } bool IsSubMenu() const { return m_subMenu != NULL; } void SetSubMenu(wxMenu *menu) { m_subMenu = menu; } wxMenu *GetSubMenu() const { return m_subMenu; } // state virtual void Enable(bool enable = true) { m_isEnabled = enable; } virtual bool IsEnabled() const { return m_isEnabled; } virtual void Check(bool check = true) { m_isChecked = check; } virtual bool IsChecked() const { return m_isChecked; } void Toggle() { Check(!m_isChecked); } // help string (displayed in the status bar by default) void SetHelp(const wxString& str); const wxString& GetHelp() const { return m_help; } #if wxUSE_ACCEL // extract the accelerator from the given menu string, return NULL if none // found static wxAcceleratorEntry *GetAccelFromString(const wxString& label); // get our accelerator or NULL (caller must delete the pointer) virtual wxAcceleratorEntry *GetAccel() const; // set the accel for this item - this may also be done indirectly with // SetText() virtual void SetAccel(wxAcceleratorEntry *accel); #endif // wxUSE_ACCEL #if WXWIN_COMPATIBILITY_2_8 // compatibility only, use new functions in the new code wxDEPRECATED( void SetName(const wxString& str) ); wxDEPRECATED( wxString GetName() const ); // Now use GetItemLabelText wxDEPRECATED( wxString GetLabel() const ) ; // Now use GetItemLabel wxDEPRECATED( const wxString& GetText() const ); // Now use GetLabelText to strip the accelerators static wxDEPRECATED( wxString GetLabelFromText(const wxString& text) ); // Now use SetItemLabel wxDEPRECATED( virtual void SetText(const wxString& str) ); #endif // WXWIN_COMPATIBILITY_2_8 static wxMenuItem *New(wxMenu *parentMenu, int itemid, const wxString& text, const wxString& help, bool isCheckable, wxMenu *subMenu = NULL) { return New(parentMenu, itemid, text, help, isCheckable ? wxITEM_CHECK : wxITEM_NORMAL, subMenu); } protected: wxWindowIDRef m_id; // numeric id of the item >= 0 or wxID_ANY or wxID_SEPARATOR wxMenu *m_parentMenu, // the menu we belong to *m_subMenu; // our sub menu or NULL wxString m_text, // label of the item m_help; // the help string for the item wxItemKind m_kind; // separator/normal/check/radio item? bool m_isChecked; // is checked? bool m_isEnabled; // is enabled? // this ctor is for the derived classes only, we're never created directly wxMenuItemBase(wxMenu *parentMenu = NULL, int itemid = wxID_SEPARATOR, const wxString& text = wxEmptyString, const wxString& help = wxEmptyString, wxItemKind kind = wxITEM_NORMAL, wxMenu *subMenu = NULL); private: // and, if we have one ctor, compiler won't generate a default copy one, so // declare them ourselves - but don't implement as they shouldn't be used wxMenuItemBase(const wxMenuItemBase& item); wxMenuItemBase& operator=(const wxMenuItemBase& item); }; #if WXWIN_COMPATIBILITY_2_8 inline void wxMenuItemBase::SetName(const wxString &str) { SetItemLabel(str); } inline wxString wxMenuItemBase::GetName() const { return GetItemLabel(); } inline wxString wxMenuItemBase::GetLabel() const { return GetLabelText(m_text); } inline const wxString& wxMenuItemBase::GetText() const { return m_text; } inline void wxMenuItemBase::SetText(const wxString& text) { SetItemLabel(text); } #endif // WXWIN_COMPATIBILITY_2_8 // ---------------------------------------------------------------------------- // include the real class declaration // ---------------------------------------------------------------------------- #ifdef wxUSE_BASE_CLASSES_ONLY #define wxMenuItem wxMenuItemBase #else // !wxUSE_BASE_CLASSES_ONLY #if defined(__WXUNIVERSAL__) #include "wx/univ/menuitem.h" #elif defined(__WXMSW__) #include "wx/msw/menuitem.h" #elif defined(__WXMOTIF__) #include "wx/motif/menuitem.h" #elif defined(__WXGTK20__) #include "wx/gtk/menuitem.h" #elif defined(__WXGTK__) #include "wx/gtk1/menuitem.h" #elif defined(__WXMAC__) #include "wx/osx/menuitem.h" #elif defined(__WXQT__) #include "wx/qt/menuitem.h" #endif #endif // wxUSE_BASE_CLASSES_ONLY/!wxUSE_BASE_CLASSES_ONLY #endif // wxUSE_MENUS #endif // _WX_MENUITEM_H_BASE_
h
rticonnextdds-usecases
data/projects/rticonnextdds-usecases/VehicleTracking/ExampleCode/thirdparty/wxWidgets-3.1.2/Win64/include/wx/fs_filter.h
///////////////////////////////////////////////////////////////////////////// // Name: wx/fs_filter.h // Purpose: Filter file system handler // Author: Mike Wetherell // Copyright: (c) 2006 Mike Wetherell // Licence: wxWindows licence ///////////////////////////////////////////////////////////////////////////// #ifndef _WX_FS_FILTER_H_ #define _WX_FS_FILTER_H_ #include "wx/defs.h" #if wxUSE_FILESYSTEM #include "wx/filesys.h" //--------------------------------------------------------------------------- // wxFilterFSHandler //--------------------------------------------------------------------------- class WXDLLIMPEXP_BASE wxFilterFSHandler : public wxFileSystemHandler { public: wxFilterFSHandler() : wxFileSystemHandler() { } virtual ~wxFilterFSHandler() { } virtual bool CanOpen(const wxString& location) wxOVERRIDE; virtual wxFSFile* OpenFile(wxFileSystem& fs, const wxString& location) wxOVERRIDE; virtual wxString FindFirst(const wxString& spec, int flags = 0) wxOVERRIDE; virtual wxString FindNext() wxOVERRIDE; private: wxDECLARE_NO_COPY_CLASS(wxFilterFSHandler); }; #endif // wxUSE_FILESYSTEM #endif // _WX_FS_FILTER_H_
h
rticonnextdds-usecases
data/projects/rticonnextdds-usecases/VehicleTracking/ExampleCode/thirdparty/wxWidgets-3.1.2/Win64/include/wx/ustring.h
// Name: wx/ustring.h // Purpose: 32-bit string (UCS-4) // Author: Robert Roebling // Copyright: (c) Robert Roebling // Licence: wxWindows licence ///////////////////////////////////////////////////////////////////////////// #ifndef _WX_USTRING_H_ #define _WX_USTRING_H_ #include "wx/defs.h" #include "wx/string.h" #include <string> #if SIZEOF_WCHAR_T == 2 typedef wxWCharBuffer wxU16CharBuffer; typedef wxScopedWCharBuffer wxScopedU16CharBuffer; #else typedef wxCharTypeBuffer<wxChar16> wxU16CharBuffer; typedef wxScopedCharTypeBuffer<wxChar16> wxScopedU16CharBuffer; #endif #if SIZEOF_WCHAR_T == 4 typedef wxWCharBuffer wxU32CharBuffer; typedef wxScopedWCharBuffer wxScopedU32CharBuffer; #else typedef wxCharTypeBuffer<wxChar32> wxU32CharBuffer; typedef wxScopedCharTypeBuffer<wxChar32> wxScopedU32CharBuffer; #endif #ifdef __VISUALC__ // "non dll-interface class 'std::basic_string<wxChar32>' used as base // interface for dll-interface class 'wxString'" -- this is OK in our case // (and warning is unavoidable anyhow) #pragma warning(push) #pragma warning(disable:4275) #endif class WXDLLIMPEXP_BASE wxUString: public std::basic_string<wxChar32> { public: wxUString() { } wxUString( const wxChar32 *str ) { assign(str); } wxUString( const wxScopedU32CharBuffer &buf ) { assign(buf); } wxUString( const char *str ) { assign(str); } wxUString( const wxScopedCharBuffer &buf ) { assign(buf); } wxUString( const char *str, const wxMBConv &conv ) { assign(str,conv); } wxUString( const wxScopedCharBuffer &buf, const wxMBConv &conv ) { assign(buf,conv); } wxUString( const wxChar16 *str ) { assign(str); } wxUString( const wxScopedU16CharBuffer &buf ) { assign(buf); } wxUString( const wxCStrData *cstr ) { assign(cstr); } wxUString( const wxString &str ) { assign(str); } wxUString( char ch ) { assign(ch); } wxUString( wxChar16 ch ) { assign(ch); } wxUString( wxChar32 ch ) { assign(ch); } wxUString( wxUniChar ch ) { assign(ch); } wxUString( wxUniCharRef ch ) { assign(ch); } wxUString( size_type n, char ch ) { assign(n,ch); } wxUString( size_type n, wxChar16 ch ) { assign(n,ch); } wxUString( size_type n, wxChar32 ch ) { assign(n,ch); } wxUString( size_type n, wxUniChar ch ) { assign(n,ch); } wxUString( size_type n, wxUniCharRef ch ) { assign(n,ch); } // static construction static wxUString FromAscii( const char *str, size_type n ) { wxUString ret; ret.assignFromAscii( str, n ); return ret; } static wxUString FromAscii( const char *str ) { wxUString ret; ret.assignFromAscii( str ); return ret; } static wxUString FromUTF8( const char *str, size_type n ) { wxUString ret; ret.assignFromUTF8( str, n ); return ret; } static wxUString FromUTF8( const char *str ) { wxUString ret; ret.assignFromUTF8( str ); return ret; } static wxUString FromUTF16( const wxChar16 *str, size_type n ) { wxUString ret; ret.assignFromUTF16( str, n ); return ret; } static wxUString FromUTF16( const wxChar16 *str ) { wxUString ret; ret.assignFromUTF16( str ); return ret; } // assign from encoding wxUString &assignFromAscii( const char *str ); wxUString &assignFromAscii( const char *str, size_type n ); wxUString &assignFromUTF8( const char *str ); wxUString &assignFromUTF8( const char *str, size_type n ); wxUString &assignFromUTF16( const wxChar16* str ); wxUString &assignFromUTF16( const wxChar16* str, size_type n ); wxUString &assignFromCString( const char* str ); wxUString &assignFromCString( const char* str, const wxMBConv &conv ); // conversions wxScopedCharBuffer utf8_str() const; wxScopedU16CharBuffer utf16_str() const; #if SIZEOF_WCHAR_T == 2 wxScopedWCharBuffer wc_str() const { return utf16_str(); } #else const wchar_t *wc_str() const { return c_str(); } #endif operator wxString() const { #if wxUSE_UNICODE_UTF8 return wxString::FromUTF8( utf8_str() ); #else #if SIZEOF_WCHAR_T == 2 return wxString( utf16_str() ); #else return wxString( c_str() ); #endif #endif } #if wxUSE_UNICODE_UTF8 wxScopedCharBuffer wx_str() const { return utf8_str(); } #else #if SIZEOF_WCHAR_T == 2 wxScopedWCharBuffer wx_str() const { return utf16_str(); } #else const wchar_t* wx_str() const { return c_str(); } #endif #endif // assign wxUString &assign( const wxChar32* str ) { std::basic_string<wxChar32> *base = this; return (wxUString &) base->assign( str ); } wxUString &assign( const wxChar32* str, size_type n ) { std::basic_string<wxChar32> *base = this; return (wxUString &) base->assign( str, n ); } wxUString &assign( const wxUString &str ) { std::basic_string<wxChar32> *base = this; return (wxUString &) base->assign( str ); } wxUString &assign( const wxUString &str, size_type pos, size_type n ) { std::basic_string<wxChar32> *base = this; return (wxUString &) base->assign( str, pos, n ); } wxUString &assign( wxChar32 ch ) { std::basic_string<wxChar32> *base = this; return (wxUString &) base->assign( (size_type) 1, ch ); } wxUString &assign( size_type n, wxChar32 ch ) { std::basic_string<wxChar32> *base = this; return (wxUString &) base->assign( n, ch ); } wxUString &assign( const wxScopedU32CharBuffer &buf ) { return assign( buf.data() ); } wxUString &assign( const char *str ) { return assignFromCString( str ); } wxUString &assign( const wxScopedCharBuffer &buf ) { return assignFromCString( buf.data() ); } wxUString &assign( const char *str, const wxMBConv &conv ) { return assignFromCString( str, conv ); } wxUString &assign( const wxScopedCharBuffer &buf, const wxMBConv &conv ) { return assignFromCString( buf.data(), conv ); } wxUString &assign( const wxChar16 *str ) { return assignFromUTF16( str ); } wxUString &assign( const wxScopedU16CharBuffer &buf ) { return assignFromUTF16( buf.data() ); } wxUString &assign( const wxCStrData *cstr ) { #if SIZEOF_WCHAR_T == 2 return assignFromUTF16( cstr->AsWChar() ); #else return assign( cstr->AsWChar() ); #endif } wxUString &assign( const wxString &str ) { #if wxUSE_UNICODE_UTF8 return assignFromUTF8( str.wx_str() ); #else #if SIZEOF_WCHAR_T == 2 return assignFromUTF16( str.wc_str() ); #else return assign( str.wc_str() ); #endif #endif } wxUString &assign( char ch ) { char buf[2]; buf[0] = ch; buf[1] = 0; return assignFromCString( buf ); } wxUString &assign( size_type n, char ch ) { wxCharBuffer buffer(n); char *p = buffer.data(); size_type i; for (i = 0; i < n; i++) { *p = ch; p++; } return assignFromCString( buffer.data() ); } wxUString &assign( wxChar16 ch ) { wxChar16 buf[2]; buf[0] = ch; buf[1] = 0; return assignFromUTF16( buf ); } wxUString &assign( size_type n, wxChar16 ch ) { wxU16CharBuffer buffer(n); wxChar16 *p = buffer.data(); size_type i; for (i = 0; i < n; i++) { *p = ch; p++; } return assignFromUTF16( buffer.data() ); } wxUString &assign( wxUniChar ch ) { return assign( (wxChar32) ch.GetValue() ); } wxUString &assign( size_type n, wxUniChar ch ) { return assign( n, (wxChar32) ch.GetValue() ); } wxUString &assign( wxUniCharRef ch ) { return assign( (wxChar32) ch.GetValue() ); } wxUString &assign( size_type n, wxUniCharRef ch ) { return assign( n, (wxChar32) ch.GetValue() ); } // append [STL overload] wxUString &append( const wxUString &s ) { std::basic_string<wxChar32> *base = this; return (wxUString &) base->append( s ); } wxUString &append( const wxUString &s, size_type pos, size_type n ) { std::basic_string<wxChar32> *base = this; return (wxUString &) base->append( s, pos, n ); } wxUString &append( const wxChar32* s ) { std::basic_string<wxChar32> *base = this; return (wxUString &) base->append( s ); } wxUString &append( const wxChar32* s, size_type n ) { std::basic_string<wxChar32> *base = this; return (wxUString &) base->append( s, n ); } wxUString &append( size_type n, wxChar32 c ) { std::basic_string<wxChar32> *base = this; return (wxUString &) base->append( n, c ); } wxUString &append( wxChar32 c ) { std::basic_string<wxChar32> *base = this; return (wxUString &) base->append( 1, c ); } // append [wx overload] wxUString &append( const wxScopedU16CharBuffer &buf ) { return append( buf.data() ); } wxUString &append( const wxScopedU32CharBuffer &buf ) { return append( buf.data() ); } wxUString &append( const char *str ) { return append( wxUString( str ) ); } wxUString &append( const wxScopedCharBuffer &buf ) { return append( wxUString( buf ) ); } wxUString &append( const wxChar16 *str ) { return append( wxUString( str ) ); } wxUString &append( const wxString &str ) { return append( wxUString( str ) ); } wxUString &append( const wxCStrData *cstr ) { return append( wxUString( cstr ) ); } wxUString &append( char ch ) { char buf[2]; buf[0] = ch; buf[1] = 0; return append( buf ); } wxUString &append( wxChar16 ch ) { wxChar16 buf[2]; buf[0] = ch; buf[1] = 0; return append( buf ); } wxUString &append( wxUniChar ch ) { return append( (size_type) 1, (wxChar32) ch.GetValue() ); } wxUString &append( wxUniCharRef ch ) { return append( (size_type) 1, (wxChar32) ch.GetValue() ); } // insert [STL overloads] wxUString &insert( size_type pos, const wxUString &s ) { std::basic_string<wxChar32> *base = this; return (wxUString &) base->insert( pos, s ); } wxUString &insert( size_type pos, const wxUString &s, size_type pos1, size_type n ) { std::basic_string<wxChar32> *base = this; return (wxUString &) base->insert( pos, s, pos1, n ); } wxUString &insert( size_type pos, const wxChar32 *s ) { std::basic_string<wxChar32> *base = this; return (wxUString &) base->insert( pos, s ); } wxUString &insert( size_type pos, const wxChar32 *s, size_type n ) { std::basic_string<wxChar32> *base = this; return (wxUString &) base->insert( pos, s, n ); } wxUString &insert( size_type pos, size_type n, wxChar32 c ) { std::basic_string<wxChar32> *base = this; return (wxUString &) base->insert( pos, n, c ); } // insert [STL overloads] wxUString &insert( size_type n, const char *s ) { return insert( n, wxUString( s ) ); } wxUString &insert( size_type n, const wxChar16 *s ) { return insert( n, wxUString( s ) ); } wxUString &insert( size_type n, const wxScopedCharBuffer &buf ) { return insert( n, wxUString( buf ) ); } wxUString &insert( size_type n, const wxScopedU16CharBuffer &buf ) { return insert( n, wxUString( buf ) ); } wxUString &insert( size_type n, const wxScopedU32CharBuffer &buf ) { return insert( n, buf.data() ); } wxUString &insert( size_type n, const wxString &s ) { return insert( n, wxUString( s ) ); } wxUString &insert( size_type n, const wxCStrData *cstr ) { return insert( n, wxUString( cstr ) ); } wxUString &insert( size_type n, char ch ) { char buf[2]; buf[0] = ch; buf[1] = 0; return insert( n, buf ); } wxUString &insert( size_type n, wchar_t ch ) { wchar_t buf[2]; buf[0] = ch; buf[1] = 0; return insert( n, buf ); } // insert iterator iterator insert( iterator it, wxChar32 ch ) { std::basic_string<wxChar32> *base = this; return base->insert( it, ch ); } void insert(iterator it, const_iterator first, const_iterator last) { std::basic_string<wxChar32> *base = this; base->insert( it, first, last ); } // operator = wxUString& operator=(const wxString& s) { return assign( s ); } wxUString& operator=(const wxCStrData* s) { return assign( s ); } wxUString& operator=(const char *s) { return assign( s ); } wxUString& operator=(const wxChar16 *s) { return assign( s ); } wxUString& operator=(const wxChar32 *s) { return assign( s ); } wxUString& operator=(const wxScopedCharBuffer &s) { return assign( s ); } wxUString& operator=(const wxScopedU16CharBuffer &s) { return assign( s ); } wxUString& operator=(const wxScopedU32CharBuffer &s) { return assign( s ); } wxUString& operator=(char ch) { return assign( ch ); } wxUString& operator=(wxChar16 ch) { return assign( ch ); } wxUString& operator=(wxChar32 ch) { return assign( ch ); } wxUString& operator=(wxUniChar ch) { return assign( ch ); } wxUString& operator=(const wxUniCharRef ch) { return assign( ch ); } // operator += wxUString& operator+=(const wxUString& s) { return append( s ); } wxUString& operator+=(const wxString& s) { return append( s ); } wxUString& operator+=(const wxCStrData* s) { return append( s ); } wxUString& operator+=(const char *s) { return append( s ); } wxUString& operator+=(const wxChar16 *s) { return append( s ); } wxUString& operator+=(const wxChar32 *s) { return append( s ); } wxUString& operator+=(const wxScopedCharBuffer &s) { return append( s ); } wxUString& operator+=(const wxScopedU16CharBuffer &s) { return append( s ); } wxUString& operator+=(const wxScopedU32CharBuffer &s) { return append( s ); } wxUString& operator+=(char ch) { return append( ch ); } wxUString& operator+=(wxChar16 ch) { return append( ch ); } wxUString& operator+=(wxChar32 ch) { return append( ch ); } wxUString& operator+=(wxUniChar ch) { return append( ch ); } wxUString& operator+=(const wxUniCharRef ch) { return append( ch ); } }; #ifdef __VISUALC__ #pragma warning(pop) #endif inline wxUString operator+(const wxUString &s1, const wxUString &s2) { wxUString ret( s1 ); ret.append( s2 ); return ret; } inline wxUString operator+(const wxUString &s1, const char *s2) { return s1 + wxUString(s2); } inline wxUString operator+(const wxUString &s1, const wxString &s2) { return s1 + wxUString(s2); } inline wxUString operator+(const wxUString &s1, const wxCStrData *s2) { return s1 + wxUString(s2); } inline wxUString operator+(const wxUString &s1, const wxChar16* s2) { return s1 + wxUString(s2); } inline wxUString operator+(const wxUString &s1, const wxChar32 *s2) { return s1 + wxUString(s2); } inline wxUString operator+(const wxUString &s1, const wxScopedCharBuffer &s2) { return s1 + wxUString(s2); } inline wxUString operator+(const wxUString &s1, const wxScopedU16CharBuffer &s2) { return s1 + wxUString(s2); } inline wxUString operator+(const wxUString &s1, const wxScopedU32CharBuffer &s2) { return s1 + wxUString(s2); } inline wxUString operator+(const wxUString &s1, char s2) { return s1 + wxUString(s2); } inline wxUString operator+(const wxUString &s1, wxChar32 s2) { wxUString ret( s1 ); ret.append( s2 ); return ret; } inline wxUString operator+(const wxUString &s1, wxChar16 s2) { wxUString ret( s1 ); ret.append( (wxChar32) s2 ); return ret; } inline wxUString operator+(const wxUString &s1, wxUniChar s2) { wxUString ret( s1 ); ret.append( (wxChar32) s2.GetValue() ); return ret; } inline wxUString operator+(const wxUString &s1, wxUniCharRef s2) { wxUString ret( s1 ); ret.append( (wxChar32) s2.GetValue() ); return ret; } inline wxUString operator+(const char *s1, const wxUString &s2) { return wxUString(s1) + s2; } inline wxUString operator+(const wxString &s1, const wxUString &s2) { return wxUString(s1) + s2; } inline wxUString operator+(const wxCStrData *s1, const wxUString &s2) { return wxUString(s1) + s2; } inline wxUString operator+(const wxChar16* s1, const wxUString &s2) { return wxUString(s1) + s2; } inline wxUString operator+(const wxChar32 *s1, const wxUString &s2) { return wxUString(s1) + s2; } inline wxUString operator+(const wxScopedCharBuffer &s1, const wxUString &s2) { return wxUString(s1) + s2; } inline wxUString operator+(const wxScopedU16CharBuffer &s1, const wxUString &s2) { return wxUString(s1) + s2; } inline wxUString operator+(const wxScopedU32CharBuffer &s1, const wxUString &s2) { return wxUString(s1) + s2; } inline wxUString operator+(char s1, const wxUString &s2) { return wxUString(s1) + s2; } inline wxUString operator+(wxChar32 s1, const wxUString &s2 ) { return wxUString(s1) + s2; } inline wxUString operator+(wxChar16 s1, const wxUString &s2) { return wxUString(s1) + s2; } inline wxUString operator+(wxUniChar s1, const wxUString &s2) { return wxUString(s1) + s2; } inline wxUString operator+(wxUniCharRef s1, const wxUString &s2) { return wxUString(s1) + s2; } inline bool operator==(const wxUString& s1, const wxUString& s2) { return s1.compare( s2 ) == 0; } inline bool operator!=(const wxUString& s1, const wxUString& s2) { return s1.compare( s2 ) != 0; } inline bool operator< (const wxUString& s1, const wxUString& s2) { return s1.compare( s2 ) < 0; } inline bool operator> (const wxUString& s1, const wxUString& s2) { return s1.compare( s2 ) > 0; } inline bool operator<=(const wxUString& s1, const wxUString& s2) { return s1.compare( s2 ) <= 0; } inline bool operator>=(const wxUString& s1, const wxUString& s2) { return s1.compare( s2 ) >= 0; } #define wxUSTRING_COMP_OPERATORS( T ) \ inline bool operator==(const wxUString& s1, T s2) \ { return s1.compare( wxUString(s2) ) == 0; } \ inline bool operator!=(const wxUString& s1, T s2) \ { return s1.compare( wxUString(s2) ) != 0; } \ inline bool operator< (const wxUString& s1, T s2) \ { return s1.compare( wxUString(s2) ) < 0; } \ inline bool operator> (const wxUString& s1, T s2) \ { return s1.compare( wxUString(s2) ) > 0; } \ inline bool operator<=(const wxUString& s1, T s2) \ { return s1.compare( wxUString(s2) ) <= 0; } \ inline bool operator>=(const wxUString& s1, T s2) \ { return s1.compare( wxUString(s2) ) >= 0; } \ \ inline bool operator==(T s2, const wxUString& s1) \ { return s1.compare( wxUString(s2) ) == 0; } \ inline bool operator!=(T s2, const wxUString& s1) \ { return s1.compare( wxUString(s2) ) != 0; } \ inline bool operator< (T s2, const wxUString& s1) \ { return s1.compare( wxUString(s2) ) > 0; } \ inline bool operator> (T s2, const wxUString& s1) \ { return s1.compare( wxUString(s2) ) < 0; } \ inline bool operator<=(T s2, const wxUString& s1) \ { return s1.compare( wxUString(s2) ) >= 0; } \ inline bool operator>=(T s2, const wxUString& s1) \ { return s1.compare( wxUString(s2) ) <= 0; } wxUSTRING_COMP_OPERATORS( const wxString & ) wxUSTRING_COMP_OPERATORS( const char * ) wxUSTRING_COMP_OPERATORS( const wxChar16 * ) wxUSTRING_COMP_OPERATORS( const wxChar32 * ) wxUSTRING_COMP_OPERATORS( const wxScopedCharBuffer & ) wxUSTRING_COMP_OPERATORS( const wxScopedU16CharBuffer & ) wxUSTRING_COMP_OPERATORS( const wxScopedU32CharBuffer & ) wxUSTRING_COMP_OPERATORS( const wxCStrData * ) #endif // _WX_USTRING_H_
h
rticonnextdds-usecases
data/projects/rticonnextdds-usecases/VehicleTracking/ExampleCode/thirdparty/wxWidgets-3.1.2/Win64/include/wx/helphtml.h
///////////////////////////////////////////////////////////////////////////// // Name: wx/helphtml.h // Purpose: Includes wx/html/helpctrl.h, for wxHtmlHelpController. // Author: Julian Smart // Modified by: // Created: 2003-05-24 // Copyright: (c) Julian Smart // Licence: wxWindows licence ///////////////////////////////////////////////////////////////////////////// #ifndef __WX_HELPHTML_H_ #define __WX_HELPHTML_H_ #if wxUSE_WXHTML_HELP #include "wx/html/helpctrl.h" #endif #endif // __WX_HELPHTML_H_
h
rticonnextdds-usecases
data/projects/rticonnextdds-usecases/VehicleTracking/ExampleCode/thirdparty/wxWidgets-3.1.2/Win64/include/wx/event.h
///////////////////////////////////////////////////////////////////////////// // Name: wx/event.h // Purpose: Event classes // Author: Julian Smart // Modified by: // Created: 01/02/97 // Copyright: (c) wxWidgets team // Licence: wxWindows licence ///////////////////////////////////////////////////////////////////////////// #ifndef _WX_EVENT_H_ #define _WX_EVENT_H_ #include "wx/defs.h" #include "wx/cpp.h" #include "wx/object.h" #include "wx/clntdata.h" #include "wx/math.h" #if wxUSE_GUI #include "wx/gdicmn.h" #include "wx/cursor.h" #include "wx/mousestate.h" #endif #include "wx/dynarray.h" #include "wx/thread.h" #include "wx/tracker.h" #include "wx/typeinfo.h" #include "wx/any.h" #include "wx/vector.h" #include "wx/meta/convertible.h" // Currently VC7 is known to not be able to compile CallAfter() code, so // disable it for it (FIXME-VC7). #if !defined(__VISUALC__) || wxCHECK_VISUALC_VERSION(8) #include "wx/meta/removeref.h" #define wxHAS_CALL_AFTER #endif // ---------------------------------------------------------------------------- // forward declarations // ---------------------------------------------------------------------------- class WXDLLIMPEXP_FWD_BASE wxList; class WXDLLIMPEXP_FWD_BASE wxEvent; class WXDLLIMPEXP_FWD_BASE wxEventFilter; #if wxUSE_GUI class WXDLLIMPEXP_FWD_CORE wxDC; class WXDLLIMPEXP_FWD_CORE wxMenu; class WXDLLIMPEXP_FWD_CORE wxWindow; class WXDLLIMPEXP_FWD_CORE wxWindowBase; #endif // wxUSE_GUI // We operate with pointer to members of wxEvtHandler (such functions are used // as event handlers in the event tables or as arguments to Connect()) but by // default MSVC uses a restricted (but more efficient) representation of // pointers to members which can't deal with multiple base classes. To avoid // mysterious (as the compiler is not good enough to detect this and give a // sensible error message) errors in the user code as soon as it defines // classes inheriting from both wxEvtHandler (possibly indirectly, e.g. via // wxWindow) and something else (including our own wxTrackable but not limited // to it), we use the special MSVC keyword telling the compiler to use a more // general pointer to member representation for the classes inheriting from // wxEvtHandler. #ifdef __VISUALC__ #define wxMSVC_FWD_MULTIPLE_BASES __multiple_inheritance #else #define wxMSVC_FWD_MULTIPLE_BASES #endif class WXDLLIMPEXP_FWD_BASE wxMSVC_FWD_MULTIPLE_BASES wxEvtHandler; class wxEventConnectionRef; // ---------------------------------------------------------------------------- // Event types // ---------------------------------------------------------------------------- typedef int wxEventType; #define wxEVT_ANY ((wxEventType)-1) // This macro exists for compatibility only (even though it was never public, // it still appears in some code using wxWidgets), see public // wxEVENT_HANDLER_CAST instead. #define wxStaticCastEvent(type, val) static_cast<type>(val) #define wxDECLARE_EVENT_TABLE_ENTRY(type, winid, idLast, fn, obj) \ wxEventTableEntry(type, winid, idLast, wxNewEventTableFunctor(type, fn), obj) #define wxDECLARE_EVENT_TABLE_TERMINATOR() \ wxEventTableEntry(wxEVT_NULL, 0, 0, 0, 0) // generate a new unique event type extern WXDLLIMPEXP_BASE wxEventType wxNewEventType(); // events are represented by an instance of wxEventTypeTag and the // corresponding type must be specified for type-safety checks // define a new custom event type, can be used alone or after event // declaration in the header using one of the macros below #define wxDEFINE_EVENT( name, type ) \ const wxEventTypeTag< type > name( wxNewEventType() ) // the general version allowing exporting the event type from DLL, used by // wxWidgets itself #define wxDECLARE_EXPORTED_EVENT( expdecl, name, type ) \ extern const expdecl wxEventTypeTag< type > name // this is the version which will normally be used in the user code #define wxDECLARE_EVENT( name, type ) \ wxDECLARE_EXPORTED_EVENT( wxEMPTY_PARAMETER_VALUE, name, type ) // these macros are only used internally for backwards compatibility and // allow to define an alias for an existing event type (this is used by // wxEVT_SPIN_XXX) #define wxDEFINE_EVENT_ALIAS( name, type, value ) \ const wxEventTypeTag< type > name( value ) #define wxDECLARE_EXPORTED_EVENT_ALIAS( expdecl, name, type ) \ extern const expdecl wxEventTypeTag< type > name // The type-erased method signature used for event handling. typedef void (wxEvtHandler::*wxEventFunction)(wxEvent&); template <typename T> inline wxEventFunction wxEventFunctionCast(void (wxEvtHandler::*func)(T&)) { // There is no going around the cast here: we do rely calling the event // handler method, which takes a reference to an object of a class derived // from wxEvent, as if it took wxEvent itself. On all platforms supported // by wxWidgets, this cast is harmless, but it's not a valid cast in C++ // and gcc 8 started giving warnings about this (with -Wextra), so suppress // them locally to avoid generating hundreds of them when compiling any // code using event table macros. wxGCC_WARNING_SUPPRESS_CAST_FUNCTION_TYPE() return reinterpret_cast<wxEventFunction>(func); wxGCC_WARNING_RESTORE_CAST_FUNCTION_TYPE() } // Try to cast the given event handler to the correct handler type: #define wxEVENT_HANDLER_CAST( functype, func ) \ wxEventFunctionCast(static_cast<functype>(&func)) // The tag is a type associated to the event type (which is an integer itself, // in spite of its name) value. It exists in order to be used as a template // parameter and provide a mapping between the event type values and their // corresponding wxEvent-derived classes. template <typename T> class wxEventTypeTag { public: // The class of wxEvent-derived class carried by the events of this type. typedef T EventClass; wxEventTypeTag(wxEventType type) { m_type = type; } // Return a wxEventType reference for the initialization of the static // event tables. See wxEventTableEntry::m_eventType for a more thorough // explanation. operator const wxEventType&() const { return m_type; } private: wxEventType m_type; }; // We had some trouble with using wxEventFunction // in the past so we had introduced wxObjectEventFunction which // used to be a typedef for a member of wxObject and not wxEvtHandler to work // around this but as eVC is not really supported any longer we now only keep // this for backwards compatibility and, despite its name, this is a typedef // for wxEvtHandler member now -- but if we have the same problem with another // compiler we can restore its old definition for it. typedef wxEventFunction wxObjectEventFunction; // The event functor which is stored in the static and dynamic event tables: class WXDLLIMPEXP_BASE wxEventFunctor { public: virtual ~wxEventFunctor(); // Invoke the actual event handler: virtual void operator()(wxEvtHandler *, wxEvent&) = 0; // this function tests whether this functor is matched, for the purpose of // finding it in an event table in Unbind(), by the given functor: virtual bool IsMatching(const wxEventFunctor& functor) const = 0; // If the functor holds an wxEvtHandler, then get access to it and track // its lifetime with wxEventConnectionRef: virtual wxEvtHandler *GetEvtHandler() const { return NULL; } // This is only used to maintain backward compatibility in // wxAppConsoleBase::CallEventHandler and ensures that an overwritten // wxAppConsoleBase::HandleEvent is still called for functors which hold an // wxEventFunction: virtual wxEventFunction GetEvtMethod() const { return NULL; } private: WX_DECLARE_ABSTRACT_TYPEINFO(wxEventFunctor) }; // A plain method functor for the untyped legacy event types: class WXDLLIMPEXP_BASE wxObjectEventFunctor : public wxEventFunctor { public: wxObjectEventFunctor(wxObjectEventFunction method, wxEvtHandler *handler) : m_handler( handler ), m_method( method ) { } virtual void operator()(wxEvtHandler *handler, wxEvent& event) wxOVERRIDE; virtual bool IsMatching(const wxEventFunctor& functor) const wxOVERRIDE { if ( wxTypeId(functor) == wxTypeId(*this) ) { const wxObjectEventFunctor &other = static_cast< const wxObjectEventFunctor & >( functor ); return ( m_method == other.m_method || !other.m_method ) && ( m_handler == other.m_handler || !other.m_handler ); } else return false; } virtual wxEvtHandler *GetEvtHandler() const wxOVERRIDE { return m_handler; } virtual wxEventFunction GetEvtMethod() const wxOVERRIDE { return m_method; } private: wxEvtHandler *m_handler; wxEventFunction m_method; // Provide a dummy default ctor for type info purposes wxObjectEventFunctor() { } WX_DECLARE_TYPEINFO_INLINE(wxObjectEventFunctor) }; // Create a functor for the legacy events: used by Connect() inline wxObjectEventFunctor * wxNewEventFunctor(const wxEventType& WXUNUSED(evtType), wxObjectEventFunction method, wxEvtHandler *handler) { return new wxObjectEventFunctor(method, handler); } // This version is used by wxDECLARE_EVENT_TABLE_ENTRY() inline wxObjectEventFunctor * wxNewEventTableFunctor(const wxEventType& WXUNUSED(evtType), wxObjectEventFunction method) { return new wxObjectEventFunctor(method, NULL); } inline wxObjectEventFunctor wxMakeEventFunctor(const wxEventType& WXUNUSED(evtType), wxObjectEventFunction method, wxEvtHandler *handler) { return wxObjectEventFunctor(method, handler); } namespace wxPrivate { // helper template defining nested "type" typedef as the event class // corresponding to the given event type template <typename T> struct EventClassOf; // the typed events provide the information about the class of the events they // carry themselves: template <typename T> struct EventClassOf< wxEventTypeTag<T> > { typedef typename wxEventTypeTag<T>::EventClass type; }; // for the old untyped events we don't have information about the exact event // class carried by them template <> struct EventClassOf<wxEventType> { typedef wxEvent type; }; // helper class defining operations different for method functors using an // object of wxEvtHandler-derived class as handler and the others template <typename T, typename A, bool> struct HandlerImpl; // specialization for handlers deriving from wxEvtHandler template <typename T, typename A> struct HandlerImpl<T, A, true> { static bool IsEvtHandler() { return true; } static T *ConvertFromEvtHandler(wxEvtHandler *p) { return static_cast<T *>(p); } static wxEvtHandler *ConvertToEvtHandler(T *p) { return p; } static wxEventFunction ConvertToEvtMethod(void (T::*f)(A&)) { return wxEventFunctionCast( static_cast<void (wxEvtHandler::*)(A&)>(f)); } }; // specialization for handlers not deriving from wxEvtHandler template <typename T, typename A> struct HandlerImpl<T, A, false> { static bool IsEvtHandler() { return false; } static T *ConvertFromEvtHandler(wxEvtHandler *) { return NULL; } static wxEvtHandler *ConvertToEvtHandler(T *) { return NULL; } static wxEventFunction ConvertToEvtMethod(void (T::*)(A&)) { return NULL; } }; } // namespace wxPrivate // functor forwarding the event to a method of the given object // // notice that the object class may be different from the class in which the // method is defined but it must be convertible to this class // // also, the type of the handler parameter doesn't need to be exactly the same // as EventTag::EventClass but it must be its base class -- this is explicitly // allowed to handle different events in the same handler taking wxEvent&, for // example template <typename EventTag, typename Class, typename EventArg, typename EventHandler> class wxEventFunctorMethod : public wxEventFunctor, private wxPrivate::HandlerImpl < Class, EventArg, wxIsPubliclyDerived<Class, wxEvtHandler>::value != 0 > { private: static void CheckHandlerArgument(EventArg *) { } public: // the event class associated with the given event tag typedef typename wxPrivate::EventClassOf<EventTag>::type EventClass; wxEventFunctorMethod(void (Class::*method)(EventArg&), EventHandler *handler) : m_handler( handler ), m_method( method ) { wxASSERT_MSG( handler || this->IsEvtHandler(), "handlers defined in non-wxEvtHandler-derived classes " "must be connected with a valid sink object" ); // if you get an error here it means that the signature of the handler // you're trying to use is not compatible with (i.e. is not the same as // or a base class of) the real event class used for this event type CheckHandlerArgument(static_cast<EventClass *>(NULL)); } virtual void operator()(wxEvtHandler *handler, wxEvent& event) wxOVERRIDE { Class * realHandler = m_handler; if ( !realHandler ) { realHandler = this->ConvertFromEvtHandler(handler); // this is not supposed to happen but check for it nevertheless wxCHECK_RET( realHandler, "invalid event handler" ); } // the real (run-time) type of event is EventClass and we checked in // the ctor that EventClass can be converted to EventArg, so this cast // is always valid (realHandler->*m_method)(static_cast<EventArg&>(event)); } virtual bool IsMatching(const wxEventFunctor& functor) const wxOVERRIDE { if ( wxTypeId(functor) != wxTypeId(*this) ) return false; typedef wxEventFunctorMethod<EventTag, Class, EventArg, EventHandler> ThisFunctor; // the cast is valid because wxTypeId()s matched above const ThisFunctor& other = static_cast<const ThisFunctor &>(functor); return (m_method == other.m_method || other.m_method == NULL) && (m_handler == other.m_handler || other.m_handler == NULL); } virtual wxEvtHandler *GetEvtHandler() const wxOVERRIDE { return this->ConvertToEvtHandler(m_handler); } virtual wxEventFunction GetEvtMethod() const wxOVERRIDE { return this->ConvertToEvtMethod(m_method); } private: EventHandler *m_handler; void (Class::*m_method)(EventArg&); // Provide a dummy default ctor for type info purposes wxEventFunctorMethod() { } typedef wxEventFunctorMethod<EventTag, Class, EventArg, EventHandler> thisClass; WX_DECLARE_TYPEINFO_INLINE(thisClass) }; // functor forwarding the event to function (function, static method) template <typename EventTag, typename EventArg> class wxEventFunctorFunction : public wxEventFunctor { private: static void CheckHandlerArgument(EventArg *) { } public: // the event class associated with the given event tag typedef typename wxPrivate::EventClassOf<EventTag>::type EventClass; wxEventFunctorFunction( void ( *handler )( EventArg & )) : m_handler( handler ) { // if you get an error here it means that the signature of the handler // you're trying to use is not compatible with (i.e. is not the same as // or a base class of) the real event class used for this event type CheckHandlerArgument(static_cast<EventClass *>(NULL)); } virtual void operator()(wxEvtHandler *WXUNUSED(handler), wxEvent& event) wxOVERRIDE { // If you get an error here like "must use .* or ->* to call // pointer-to-member function" then you probably tried to call // Bind/Unbind with a method pointer but without a handler pointer or // NULL as a handler e.g.: // Unbind( wxEVT_XXX, &EventHandler::method ); // or // Unbind( wxEVT_XXX, &EventHandler::method, NULL ) m_handler(static_cast<EventArg&>(event)); } virtual bool IsMatching(const wxEventFunctor &functor) const wxOVERRIDE { if ( wxTypeId(functor) != wxTypeId(*this) ) return false; typedef wxEventFunctorFunction<EventTag, EventArg> ThisFunctor; const ThisFunctor& other = static_cast<const ThisFunctor&>( functor ); return m_handler == other.m_handler; } private: void (*m_handler)(EventArg&); // Provide a dummy default ctor for type info purposes wxEventFunctorFunction() { } typedef wxEventFunctorFunction<EventTag, EventArg> thisClass; WX_DECLARE_TYPEINFO_INLINE(thisClass) }; template <typename EventTag, typename Functor> class wxEventFunctorFunctor : public wxEventFunctor { public: typedef typename EventTag::EventClass EventArg; wxEventFunctorFunctor(const Functor& handler) : m_handler(handler), m_handlerAddr(&handler) { } virtual void operator()(wxEvtHandler *WXUNUSED(handler), wxEvent& event) wxOVERRIDE { // If you get an error here like "must use '.*' or '->*' to call // pointer-to-member function" then you probably tried to call // Bind/Unbind with a method pointer but without a handler pointer or // NULL as a handler e.g.: // Unbind( wxEVT_XXX, &EventHandler::method ); // or // Unbind( wxEVT_XXX, &EventHandler::method, NULL ) m_handler(static_cast<EventArg&>(event)); } virtual bool IsMatching(const wxEventFunctor &functor) const wxOVERRIDE { if ( wxTypeId(functor) != wxTypeId(*this) ) return false; typedef wxEventFunctorFunctor<EventTag, Functor> FunctorThis; const FunctorThis& other = static_cast<const FunctorThis&>(functor); // The only reliable/portable way to compare two functors is by // identity: return m_handlerAddr == other.m_handlerAddr; } private: // Store a copy of the functor to prevent using/calling an already // destroyed instance: Functor m_handler; // Use the address of the original functor for comparison in IsMatching: const void *m_handlerAddr; // Provide a dummy default ctor for type info purposes wxEventFunctorFunctor() { } typedef wxEventFunctorFunctor<EventTag, Functor> thisClass; WX_DECLARE_TYPEINFO_INLINE(thisClass) }; // Create functors for the templatized events, either allocated on the heap for // wxNewXXX() variants (this is needed in wxEvtHandler::Bind<>() to store them // in dynamic event table) or just by returning them as temporary objects (this // is enough for Unbind<>() and we avoid unnecessary heap allocation like this). // Create functors wrapping functions: template <typename EventTag, typename EventArg> inline wxEventFunctorFunction<EventTag, EventArg> * wxNewEventFunctor(const EventTag&, void (*func)(EventArg &)) { return new wxEventFunctorFunction<EventTag, EventArg>(func); } template <typename EventTag, typename EventArg> inline wxEventFunctorFunction<EventTag, EventArg> wxMakeEventFunctor(const EventTag&, void (*func)(EventArg &)) { return wxEventFunctorFunction<EventTag, EventArg>(func); } // Create functors wrapping other functors: template <typename EventTag, typename Functor> inline wxEventFunctorFunctor<EventTag, Functor> * wxNewEventFunctor(const EventTag&, const Functor &func) { return new wxEventFunctorFunctor<EventTag, Functor>(func); } template <typename EventTag, typename Functor> inline wxEventFunctorFunctor<EventTag, Functor> wxMakeEventFunctor(const EventTag&, const Functor &func) { return wxEventFunctorFunctor<EventTag, Functor>(func); } // Create functors wrapping methods: template <typename EventTag, typename Class, typename EventArg, typename EventHandler> inline wxEventFunctorMethod<EventTag, Class, EventArg, EventHandler> * wxNewEventFunctor(const EventTag&, void (Class::*method)(EventArg&), EventHandler *handler) { return new wxEventFunctorMethod<EventTag, Class, EventArg, EventHandler>( method, handler); } template <typename EventTag, typename Class, typename EventArg, typename EventHandler> inline wxEventFunctorMethod<EventTag, Class, EventArg, EventHandler> wxMakeEventFunctor(const EventTag&, void (Class::*method)(EventArg&), EventHandler *handler) { return wxEventFunctorMethod<EventTag, Class, EventArg, EventHandler>( method, handler); } // Create an event functor for the event table via wxDECLARE_EVENT_TABLE_ENTRY: // in this case we don't have the handler (as it's always the same as the // object which generated the event) so we must use Class as its type template <typename EventTag, typename Class, typename EventArg> inline wxEventFunctorMethod<EventTag, Class, EventArg, Class> * wxNewEventTableFunctor(const EventTag&, void (Class::*method)(EventArg&)) { return new wxEventFunctorMethod<EventTag, Class, EventArg, Class>( method, NULL); } // many, but not all, standard event types // some generic events extern WXDLLIMPEXP_BASE const wxEventType wxEVT_NULL; extern WXDLLIMPEXP_BASE const wxEventType wxEVT_FIRST; extern WXDLLIMPEXP_BASE const wxEventType wxEVT_USER_FIRST; // Need events declared to do this class WXDLLIMPEXP_FWD_BASE wxIdleEvent; class WXDLLIMPEXP_FWD_BASE wxThreadEvent; class WXDLLIMPEXP_FWD_BASE wxAsyncMethodCallEvent; class WXDLLIMPEXP_FWD_CORE wxCommandEvent; class WXDLLIMPEXP_FWD_CORE wxMouseEvent; class WXDLLIMPEXP_FWD_CORE wxFocusEvent; class WXDLLIMPEXP_FWD_CORE wxChildFocusEvent; class WXDLLIMPEXP_FWD_CORE wxKeyEvent; class WXDLLIMPEXP_FWD_CORE wxNavigationKeyEvent; class WXDLLIMPEXP_FWD_CORE wxSetCursorEvent; class WXDLLIMPEXP_FWD_CORE wxScrollEvent; class WXDLLIMPEXP_FWD_CORE wxSpinEvent; class WXDLLIMPEXP_FWD_CORE wxScrollWinEvent; class WXDLLIMPEXP_FWD_CORE wxSizeEvent; class WXDLLIMPEXP_FWD_CORE wxMoveEvent; class WXDLLIMPEXP_FWD_CORE wxCloseEvent; class WXDLLIMPEXP_FWD_CORE wxActivateEvent; class WXDLLIMPEXP_FWD_CORE wxWindowCreateEvent; class WXDLLIMPEXP_FWD_CORE wxWindowDestroyEvent; class WXDLLIMPEXP_FWD_CORE wxShowEvent; class WXDLLIMPEXP_FWD_CORE wxIconizeEvent; class WXDLLIMPEXP_FWD_CORE wxMaximizeEvent; class WXDLLIMPEXP_FWD_CORE wxMouseCaptureChangedEvent; class WXDLLIMPEXP_FWD_CORE wxMouseCaptureLostEvent; class WXDLLIMPEXP_FWD_CORE wxPaintEvent; class WXDLLIMPEXP_FWD_CORE wxEraseEvent; class WXDLLIMPEXP_FWD_CORE wxNcPaintEvent; class WXDLLIMPEXP_FWD_CORE wxMenuEvent; class WXDLLIMPEXP_FWD_CORE wxContextMenuEvent; class WXDLLIMPEXP_FWD_CORE wxSysColourChangedEvent; class WXDLLIMPEXP_FWD_CORE wxDisplayChangedEvent; class WXDLLIMPEXP_FWD_CORE wxQueryNewPaletteEvent; class WXDLLIMPEXP_FWD_CORE wxPaletteChangedEvent; class WXDLLIMPEXP_FWD_CORE wxJoystickEvent; class WXDLLIMPEXP_FWD_CORE wxDropFilesEvent; class WXDLLIMPEXP_FWD_CORE wxInitDialogEvent; class WXDLLIMPEXP_FWD_CORE wxUpdateUIEvent; class WXDLLIMPEXP_FWD_CORE wxClipboardTextEvent; class WXDLLIMPEXP_FWD_CORE wxHelpEvent; class WXDLLIMPEXP_FWD_CORE wxGestureEvent; class WXDLLIMPEXP_FWD_CORE wxPanGestureEvent; class WXDLLIMPEXP_FWD_CORE wxZoomGestureEvent; class WXDLLIMPEXP_FWD_CORE wxRotateGestureEvent; class WXDLLIMPEXP_FWD_CORE wxTwoFingerTapEvent; class WXDLLIMPEXP_FWD_CORE wxLongPressEvent; class WXDLLIMPEXP_FWD_CORE wxPressAndTapEvent; // Command events wxDECLARE_EXPORTED_EVENT(WXDLLIMPEXP_CORE, wxEVT_BUTTON, wxCommandEvent); wxDECLARE_EXPORTED_EVENT(WXDLLIMPEXP_CORE, wxEVT_CHECKBOX, wxCommandEvent); wxDECLARE_EXPORTED_EVENT(WXDLLIMPEXP_CORE, wxEVT_CHOICE, wxCommandEvent); wxDECLARE_EXPORTED_EVENT(WXDLLIMPEXP_CORE, wxEVT_LISTBOX, wxCommandEvent); wxDECLARE_EXPORTED_EVENT(WXDLLIMPEXP_CORE, wxEVT_LISTBOX_DCLICK, wxCommandEvent); wxDECLARE_EXPORTED_EVENT(WXDLLIMPEXP_CORE, wxEVT_CHECKLISTBOX, wxCommandEvent); wxDECLARE_EXPORTED_EVENT(WXDLLIMPEXP_CORE, wxEVT_MENU, wxCommandEvent); wxDECLARE_EXPORTED_EVENT(WXDLLIMPEXP_CORE, wxEVT_SLIDER, wxCommandEvent); wxDECLARE_EXPORTED_EVENT(WXDLLIMPEXP_CORE, wxEVT_RADIOBOX, wxCommandEvent); wxDECLARE_EXPORTED_EVENT(WXDLLIMPEXP_CORE, wxEVT_RADIOBUTTON, wxCommandEvent); // wxEVT_SCROLLBAR is deprecated, use wxEVT_SCROLL... events wxDECLARE_EXPORTED_EVENT(WXDLLIMPEXP_CORE, wxEVT_SCROLLBAR, wxCommandEvent); wxDECLARE_EXPORTED_EVENT(WXDLLIMPEXP_CORE, wxEVT_VLBOX, wxCommandEvent); wxDECLARE_EXPORTED_EVENT(WXDLLIMPEXP_CORE, wxEVT_COMBOBOX, wxCommandEvent); wxDECLARE_EXPORTED_EVENT(WXDLLIMPEXP_CORE, wxEVT_TOOL_RCLICKED, wxCommandEvent); wxDECLARE_EXPORTED_EVENT(WXDLLIMPEXP_CORE, wxEVT_TOOL_DROPDOWN, wxCommandEvent); wxDECLARE_EXPORTED_EVENT(WXDLLIMPEXP_CORE, wxEVT_TOOL_ENTER, wxCommandEvent); wxDECLARE_EXPORTED_EVENT(WXDLLIMPEXP_CORE, wxEVT_COMBOBOX_DROPDOWN, wxCommandEvent); wxDECLARE_EXPORTED_EVENT(WXDLLIMPEXP_CORE, wxEVT_COMBOBOX_CLOSEUP, wxCommandEvent); // Thread and asynchronous method call events wxDECLARE_EXPORTED_EVENT(WXDLLIMPEXP_BASE, wxEVT_THREAD, wxThreadEvent); wxDECLARE_EXPORTED_EVENT(WXDLLIMPEXP_BASE, wxEVT_ASYNC_METHOD_CALL, wxAsyncMethodCallEvent); // Mouse event types wxDECLARE_EXPORTED_EVENT(WXDLLIMPEXP_CORE, wxEVT_LEFT_DOWN, wxMouseEvent); wxDECLARE_EXPORTED_EVENT(WXDLLIMPEXP_CORE, wxEVT_LEFT_UP, wxMouseEvent); wxDECLARE_EXPORTED_EVENT(WXDLLIMPEXP_CORE, wxEVT_MIDDLE_DOWN, wxMouseEvent); wxDECLARE_EXPORTED_EVENT(WXDLLIMPEXP_CORE, wxEVT_MIDDLE_UP, wxMouseEvent); wxDECLARE_EXPORTED_EVENT(WXDLLIMPEXP_CORE, wxEVT_RIGHT_DOWN, wxMouseEvent); wxDECLARE_EXPORTED_EVENT(WXDLLIMPEXP_CORE, wxEVT_RIGHT_UP, wxMouseEvent); wxDECLARE_EXPORTED_EVENT(WXDLLIMPEXP_CORE, wxEVT_MOTION, wxMouseEvent); wxDECLARE_EXPORTED_EVENT(WXDLLIMPEXP_CORE, wxEVT_ENTER_WINDOW, wxMouseEvent); wxDECLARE_EXPORTED_EVENT(WXDLLIMPEXP_CORE, wxEVT_LEAVE_WINDOW, wxMouseEvent); wxDECLARE_EXPORTED_EVENT(WXDLLIMPEXP_CORE, wxEVT_LEFT_DCLICK, wxMouseEvent); wxDECLARE_EXPORTED_EVENT(WXDLLIMPEXP_CORE, wxEVT_MIDDLE_DCLICK, wxMouseEvent); wxDECLARE_EXPORTED_EVENT(WXDLLIMPEXP_CORE, wxEVT_RIGHT_DCLICK, wxMouseEvent); wxDECLARE_EXPORTED_EVENT(WXDLLIMPEXP_CORE, wxEVT_SET_FOCUS, wxFocusEvent); wxDECLARE_EXPORTED_EVENT(WXDLLIMPEXP_CORE, wxEVT_KILL_FOCUS, wxFocusEvent); wxDECLARE_EXPORTED_EVENT(WXDLLIMPEXP_CORE, wxEVT_CHILD_FOCUS, wxChildFocusEvent); wxDECLARE_EXPORTED_EVENT(WXDLLIMPEXP_CORE, wxEVT_MOUSEWHEEL, wxMouseEvent); wxDECLARE_EXPORTED_EVENT(WXDLLIMPEXP_CORE, wxEVT_AUX1_DOWN, wxMouseEvent); wxDECLARE_EXPORTED_EVENT(WXDLLIMPEXP_CORE, wxEVT_AUX1_UP, wxMouseEvent); wxDECLARE_EXPORTED_EVENT(WXDLLIMPEXP_CORE, wxEVT_AUX1_DCLICK, wxMouseEvent); wxDECLARE_EXPORTED_EVENT(WXDLLIMPEXP_CORE, wxEVT_AUX2_DOWN, wxMouseEvent); wxDECLARE_EXPORTED_EVENT(WXDLLIMPEXP_CORE, wxEVT_AUX2_UP, wxMouseEvent); wxDECLARE_EXPORTED_EVENT(WXDLLIMPEXP_CORE, wxEVT_AUX2_DCLICK, wxMouseEvent); wxDECLARE_EXPORTED_EVENT(WXDLLIMPEXP_CORE, wxEVT_MAGNIFY, wxMouseEvent); // Character input event type wxDECLARE_EXPORTED_EVENT(WXDLLIMPEXP_CORE, wxEVT_CHAR, wxKeyEvent); wxDECLARE_EXPORTED_EVENT(WXDLLIMPEXP_CORE, wxEVT_CHAR_HOOK, wxKeyEvent); wxDECLARE_EXPORTED_EVENT(WXDLLIMPEXP_CORE, wxEVT_NAVIGATION_KEY, wxNavigationKeyEvent); wxDECLARE_EXPORTED_EVENT(WXDLLIMPEXP_CORE, wxEVT_KEY_DOWN, wxKeyEvent); wxDECLARE_EXPORTED_EVENT(WXDLLIMPEXP_CORE, wxEVT_KEY_UP, wxKeyEvent); #if wxUSE_HOTKEY wxDECLARE_EXPORTED_EVENT(WXDLLIMPEXP_CORE, wxEVT_HOTKEY, wxKeyEvent); #endif // This is a private event used by wxMSW code only and subject to change or // disappear in the future. Don't use. wxDECLARE_EXPORTED_EVENT(WXDLLIMPEXP_CORE, wxEVT_AFTER_CHAR, wxKeyEvent); // Set cursor event wxDECLARE_EXPORTED_EVENT(WXDLLIMPEXP_CORE, wxEVT_SET_CURSOR, wxSetCursorEvent); // wxScrollBar and wxSlider event identifiers wxDECLARE_EXPORTED_EVENT(WXDLLIMPEXP_CORE, wxEVT_SCROLL_TOP, wxScrollEvent); wxDECLARE_EXPORTED_EVENT(WXDLLIMPEXP_CORE, wxEVT_SCROLL_BOTTOM, wxScrollEvent); wxDECLARE_EXPORTED_EVENT(WXDLLIMPEXP_CORE, wxEVT_SCROLL_LINEUP, wxScrollEvent); wxDECLARE_EXPORTED_EVENT(WXDLLIMPEXP_CORE, wxEVT_SCROLL_LINEDOWN, wxScrollEvent); wxDECLARE_EXPORTED_EVENT(WXDLLIMPEXP_CORE, wxEVT_SCROLL_PAGEUP, wxScrollEvent); wxDECLARE_EXPORTED_EVENT(WXDLLIMPEXP_CORE, wxEVT_SCROLL_PAGEDOWN, wxScrollEvent); wxDECLARE_EXPORTED_EVENT(WXDLLIMPEXP_CORE, wxEVT_SCROLL_THUMBTRACK, wxScrollEvent); wxDECLARE_EXPORTED_EVENT(WXDLLIMPEXP_CORE, wxEVT_SCROLL_THUMBRELEASE, wxScrollEvent); wxDECLARE_EXPORTED_EVENT(WXDLLIMPEXP_CORE, wxEVT_SCROLL_CHANGED, wxScrollEvent); // Due to a bug in older wx versions, wxSpinEvents were being sent with type of // wxEVT_SCROLL_LINEUP, wxEVT_SCROLL_LINEDOWN and wxEVT_SCROLL_THUMBTRACK. But // with the type-safe events in place, these event types are associated with // wxScrollEvent. To allow handling of spin events, new event types have been // defined in spinbutt.h/spinnbuttcmn.cpp. To maintain backward compatibility // the spin event types are being initialized with the scroll event types. #if wxUSE_SPINBTN wxDECLARE_EXPORTED_EVENT_ALIAS( WXDLLIMPEXP_CORE, wxEVT_SPIN_UP, wxSpinEvent ); wxDECLARE_EXPORTED_EVENT_ALIAS( WXDLLIMPEXP_CORE, wxEVT_SPIN_DOWN, wxSpinEvent ); wxDECLARE_EXPORTED_EVENT_ALIAS( WXDLLIMPEXP_CORE, wxEVT_SPIN, wxSpinEvent ); #endif // Scroll events from wxWindow wxDECLARE_EXPORTED_EVENT(WXDLLIMPEXP_CORE, wxEVT_SCROLLWIN_TOP, wxScrollWinEvent); wxDECLARE_EXPORTED_EVENT(WXDLLIMPEXP_CORE, wxEVT_SCROLLWIN_BOTTOM, wxScrollWinEvent); wxDECLARE_EXPORTED_EVENT(WXDLLIMPEXP_CORE, wxEVT_SCROLLWIN_LINEUP, wxScrollWinEvent); wxDECLARE_EXPORTED_EVENT(WXDLLIMPEXP_CORE, wxEVT_SCROLLWIN_LINEDOWN, wxScrollWinEvent); wxDECLARE_EXPORTED_EVENT(WXDLLIMPEXP_CORE, wxEVT_SCROLLWIN_PAGEUP, wxScrollWinEvent); wxDECLARE_EXPORTED_EVENT(WXDLLIMPEXP_CORE, wxEVT_SCROLLWIN_PAGEDOWN, wxScrollWinEvent); wxDECLARE_EXPORTED_EVENT(WXDLLIMPEXP_CORE, wxEVT_SCROLLWIN_THUMBTRACK, wxScrollWinEvent); wxDECLARE_EXPORTED_EVENT(WXDLLIMPEXP_CORE, wxEVT_SCROLLWIN_THUMBRELEASE, wxScrollWinEvent); // Gesture events wxDECLARE_EXPORTED_EVENT(WXDLLIMPEXP_CORE, wxEVT_GESTURE_PAN, wxPanGestureEvent); wxDECLARE_EXPORTED_EVENT(WXDLLIMPEXP_CORE, wxEVT_GESTURE_ZOOM, wxZoomGestureEvent); wxDECLARE_EXPORTED_EVENT(WXDLLIMPEXP_CORE, wxEVT_GESTURE_ROTATE, wxRotateGestureEvent); wxDECLARE_EXPORTED_EVENT(WXDLLIMPEXP_CORE, wxEVT_TWO_FINGER_TAP, wxTwoFingerTapEvent); wxDECLARE_EXPORTED_EVENT(WXDLLIMPEXP_CORE, wxEVT_LONG_PRESS, wxLongPressEvent); wxDECLARE_EXPORTED_EVENT(WXDLLIMPEXP_CORE, wxEVT_PRESS_AND_TAP, wxPressAndTapEvent); // System events wxDECLARE_EXPORTED_EVENT(WXDLLIMPEXP_CORE, wxEVT_SIZE, wxSizeEvent); wxDECLARE_EXPORTED_EVENT(WXDLLIMPEXP_CORE, wxEVT_MOVE, wxMoveEvent); wxDECLARE_EXPORTED_EVENT(WXDLLIMPEXP_CORE, wxEVT_CLOSE_WINDOW, wxCloseEvent); wxDECLARE_EXPORTED_EVENT(WXDLLIMPEXP_CORE, wxEVT_END_SESSION, wxCloseEvent); wxDECLARE_EXPORTED_EVENT(WXDLLIMPEXP_CORE, wxEVT_QUERY_END_SESSION, wxCloseEvent); wxDECLARE_EXPORTED_EVENT(WXDLLIMPEXP_CORE, wxEVT_ACTIVATE_APP, wxActivateEvent); wxDECLARE_EXPORTED_EVENT(WXDLLIMPEXP_CORE, wxEVT_ACTIVATE, wxActivateEvent); wxDECLARE_EXPORTED_EVENT(WXDLLIMPEXP_CORE, wxEVT_CREATE, wxWindowCreateEvent); wxDECLARE_EXPORTED_EVENT(WXDLLIMPEXP_CORE, wxEVT_DESTROY, wxWindowDestroyEvent); wxDECLARE_EXPORTED_EVENT(WXDLLIMPEXP_CORE, wxEVT_SHOW, wxShowEvent); wxDECLARE_EXPORTED_EVENT(WXDLLIMPEXP_CORE, wxEVT_ICONIZE, wxIconizeEvent); wxDECLARE_EXPORTED_EVENT(WXDLLIMPEXP_CORE, wxEVT_MAXIMIZE, wxMaximizeEvent); wxDECLARE_EXPORTED_EVENT(WXDLLIMPEXP_CORE, wxEVT_MOUSE_CAPTURE_CHANGED, wxMouseCaptureChangedEvent); wxDECLARE_EXPORTED_EVENT(WXDLLIMPEXP_CORE, wxEVT_MOUSE_CAPTURE_LOST, wxMouseCaptureLostEvent); wxDECLARE_EXPORTED_EVENT(WXDLLIMPEXP_CORE, wxEVT_PAINT, wxPaintEvent); wxDECLARE_EXPORTED_EVENT(WXDLLIMPEXP_CORE, wxEVT_ERASE_BACKGROUND, wxEraseEvent); wxDECLARE_EXPORTED_EVENT(WXDLLIMPEXP_CORE, wxEVT_NC_PAINT, wxNcPaintEvent); wxDECLARE_EXPORTED_EVENT(WXDLLIMPEXP_CORE, wxEVT_MENU_OPEN, wxMenuEvent); wxDECLARE_EXPORTED_EVENT(WXDLLIMPEXP_CORE, wxEVT_MENU_CLOSE, wxMenuEvent); wxDECLARE_EXPORTED_EVENT(WXDLLIMPEXP_CORE, wxEVT_MENU_HIGHLIGHT, wxMenuEvent); wxDECLARE_EXPORTED_EVENT(WXDLLIMPEXP_CORE, wxEVT_CONTEXT_MENU, wxContextMenuEvent); wxDECLARE_EXPORTED_EVENT(WXDLLIMPEXP_CORE, wxEVT_SYS_COLOUR_CHANGED, wxSysColourChangedEvent); wxDECLARE_EXPORTED_EVENT(WXDLLIMPEXP_CORE, wxEVT_DISPLAY_CHANGED, wxDisplayChangedEvent); wxDECLARE_EXPORTED_EVENT(WXDLLIMPEXP_CORE, wxEVT_QUERY_NEW_PALETTE, wxQueryNewPaletteEvent); wxDECLARE_EXPORTED_EVENT(WXDLLIMPEXP_CORE, wxEVT_PALETTE_CHANGED, wxPaletteChangedEvent); wxDECLARE_EXPORTED_EVENT(WXDLLIMPEXP_CORE, wxEVT_JOY_BUTTON_DOWN, wxJoystickEvent); wxDECLARE_EXPORTED_EVENT(WXDLLIMPEXP_CORE, wxEVT_JOY_BUTTON_UP, wxJoystickEvent); wxDECLARE_EXPORTED_EVENT(WXDLLIMPEXP_CORE, wxEVT_JOY_MOVE, wxJoystickEvent); wxDECLARE_EXPORTED_EVENT(WXDLLIMPEXP_CORE, wxEVT_JOY_ZMOVE, wxJoystickEvent); wxDECLARE_EXPORTED_EVENT(WXDLLIMPEXP_CORE, wxEVT_DROP_FILES, wxDropFilesEvent); wxDECLARE_EXPORTED_EVENT(WXDLLIMPEXP_CORE, wxEVT_INIT_DIALOG, wxInitDialogEvent); wxDECLARE_EXPORTED_EVENT(WXDLLIMPEXP_BASE, wxEVT_IDLE, wxIdleEvent); wxDECLARE_EXPORTED_EVENT(WXDLLIMPEXP_CORE, wxEVT_UPDATE_UI, wxUpdateUIEvent); wxDECLARE_EXPORTED_EVENT(WXDLLIMPEXP_CORE, wxEVT_SIZING, wxSizeEvent); wxDECLARE_EXPORTED_EVENT(WXDLLIMPEXP_CORE, wxEVT_MOVING, wxMoveEvent); wxDECLARE_EXPORTED_EVENT(WXDLLIMPEXP_CORE, wxEVT_MOVE_START, wxMoveEvent); wxDECLARE_EXPORTED_EVENT(WXDLLIMPEXP_CORE, wxEVT_MOVE_END, wxMoveEvent); wxDECLARE_EXPORTED_EVENT(WXDLLIMPEXP_CORE, wxEVT_HIBERNATE, wxActivateEvent); // Clipboard events wxDECLARE_EXPORTED_EVENT(WXDLLIMPEXP_CORE, wxEVT_TEXT_COPY, wxClipboardTextEvent); wxDECLARE_EXPORTED_EVENT(WXDLLIMPEXP_CORE, wxEVT_TEXT_CUT, wxClipboardTextEvent); wxDECLARE_EXPORTED_EVENT(WXDLLIMPEXP_CORE, wxEVT_TEXT_PASTE, wxClipboardTextEvent); // Generic command events // Note: a click is a higher-level event than button down/up wxDECLARE_EXPORTED_EVENT(WXDLLIMPEXP_CORE, wxEVT_COMMAND_LEFT_CLICK, wxCommandEvent); wxDECLARE_EXPORTED_EVENT(WXDLLIMPEXP_CORE, wxEVT_COMMAND_LEFT_DCLICK, wxCommandEvent); wxDECLARE_EXPORTED_EVENT(WXDLLIMPEXP_CORE, wxEVT_COMMAND_RIGHT_CLICK, wxCommandEvent); wxDECLARE_EXPORTED_EVENT(WXDLLIMPEXP_CORE, wxEVT_COMMAND_RIGHT_DCLICK, wxCommandEvent); wxDECLARE_EXPORTED_EVENT(WXDLLIMPEXP_CORE, wxEVT_COMMAND_SET_FOCUS, wxCommandEvent); wxDECLARE_EXPORTED_EVENT(WXDLLIMPEXP_CORE, wxEVT_COMMAND_KILL_FOCUS, wxCommandEvent); wxDECLARE_EXPORTED_EVENT(WXDLLIMPEXP_CORE, wxEVT_COMMAND_ENTER, wxCommandEvent); // Help events wxDECLARE_EXPORTED_EVENT(WXDLLIMPEXP_CORE, wxEVT_HELP, wxHelpEvent); wxDECLARE_EXPORTED_EVENT(WXDLLIMPEXP_CORE, wxEVT_DETAILED_HELP, wxHelpEvent); // these 2 events are the same #define wxEVT_TOOL wxEVT_MENU // ---------------------------------------------------------------------------- // Compatibility // ---------------------------------------------------------------------------- // this event is also used by wxComboBox and wxSpinCtrl which don't include // wx/textctrl.h in all ports [yet], so declare it here as well // // still, any new code using it should include wx/textctrl.h explicitly wxDECLARE_EXPORTED_EVENT(WXDLLIMPEXP_CORE, wxEVT_TEXT, wxCommandEvent); // ---------------------------------------------------------------------------- // wxEvent(-derived) classes // ---------------------------------------------------------------------------- // the predefined constants for the number of times we propagate event // upwards window child-parent chain enum wxEventPropagation { // don't propagate it at all wxEVENT_PROPAGATE_NONE = 0, // propagate it until it is processed wxEVENT_PROPAGATE_MAX = INT_MAX }; // The different categories for a wxEvent; see wxEvent::GetEventCategory. // NOTE: they are used as OR-combinable flags by wxEventLoopBase::YieldFor enum wxEventCategory { // this is the category for those events which are generated to update // the appearance of the GUI but which (usually) do not comport data // processing, i.e. which do not provide input or output data // (e.g. size events, scroll events, etc). // They are events NOT directly generated by the user's input devices. wxEVT_CATEGORY_UI = 1, // this category groups those events which are generated directly from the // user through input devices like mouse and keyboard and usually result in // data to be processed from the application. // (e.g. mouse clicks, key presses, etc) wxEVT_CATEGORY_USER_INPUT = 2, // this category is for wxSocketEvent wxEVT_CATEGORY_SOCKET = 4, // this category is for wxTimerEvent wxEVT_CATEGORY_TIMER = 8, // this category is for any event used to send notifications from the // secondary threads to the main one or in general for notifications among // different threads (which may or may not be user-generated) wxEVT_CATEGORY_THREAD = 16, // implementation only // used in the implementations of wxEventLoopBase::YieldFor wxEVT_CATEGORY_UNKNOWN = 32, // a special category used as an argument to wxEventLoopBase::YieldFor to indicate that // Yield() should leave all wxEvents on the queue while emptying the native event queue // (native events will be processed but the wxEvents they generate will be queued) wxEVT_CATEGORY_CLIPBOARD = 64, // shortcut masks // this category groups those events which are emitted in response to // events of the native toolkit and which typically are not-"delayable". wxEVT_CATEGORY_NATIVE_EVENTS = wxEVT_CATEGORY_UI|wxEVT_CATEGORY_USER_INPUT, // used in wxEventLoopBase::YieldFor to specify all event categories should be processed: wxEVT_CATEGORY_ALL = wxEVT_CATEGORY_UI|wxEVT_CATEGORY_USER_INPUT|wxEVT_CATEGORY_SOCKET| \ wxEVT_CATEGORY_TIMER|wxEVT_CATEGORY_THREAD|wxEVT_CATEGORY_UNKNOWN| \ wxEVT_CATEGORY_CLIPBOARD }; /* * wxWidgets events, covering all interesting things that might happen * (button clicking, resizing, setting text in widgets, etc.). * * For each completely new event type, derive a new event class. * An event CLASS represents a C++ class defining a range of similar event TYPES; * examples are canvas events, panel item command events. * An event TYPE is a unique identifier for a particular system event, * such as a button press or a listbox deselection. * */ class WXDLLIMPEXP_BASE wxEvent : public wxObject { public: wxEvent(int winid = 0, wxEventType commandType = wxEVT_NULL ); void SetEventType(wxEventType typ) { m_eventType = typ; } wxEventType GetEventType() const { return m_eventType; } wxObject *GetEventObject() const { return m_eventObject; } void SetEventObject(wxObject *obj) { m_eventObject = obj; } long GetTimestamp() const { return m_timeStamp; } void SetTimestamp(long ts = 0) { m_timeStamp = ts; } int GetId() const { return m_id; } void SetId(int Id) { m_id = Id; } // Returns the user data optionally associated with the event handler when // using Connect() or Bind(). wxObject *GetEventUserData() const { return m_callbackUserData; } // Can instruct event processor that we wish to ignore this event // (treat as if the event table entry had not been found): this must be done // to allow the event processing by the base classes (calling event.Skip() // is the analog of calling the base class version of a virtual function) void Skip(bool skip = true) { m_skipped = skip; } bool GetSkipped() const { return m_skipped; } // This function is used to create a copy of the event polymorphically and // all derived classes must implement it because otherwise wxPostEvent() // for them wouldn't work (it needs to do a copy of the event) virtual wxEvent *Clone() const = 0; // this function is used to selectively process events in wxEventLoopBase::YieldFor // NOTE: by default it returns wxEVT_CATEGORY_UI just because the major // part of wxWidgets events belong to that category. virtual wxEventCategory GetEventCategory() const { return wxEVT_CATEGORY_UI; } // Implementation only: this test is explicitly anti OO and this function // exists only for optimization purposes. bool IsCommandEvent() const { return m_isCommandEvent; } // Determine if this event should be propagating to the parent window. bool ShouldPropagate() const { return m_propagationLevel != wxEVENT_PROPAGATE_NONE; } // Stop an event from propagating to its parent window, returns the old // propagation level value int StopPropagation() { const int propagationLevel = m_propagationLevel; m_propagationLevel = wxEVENT_PROPAGATE_NONE; return propagationLevel; } // Resume the event propagation by restoring the propagation level // (returned by StopPropagation()) void ResumePropagation(int propagationLevel) { m_propagationLevel = propagationLevel; } // This method is for internal use only and allows to get the object that // is propagating this event upwards the window hierarchy, if any. wxEvtHandler* GetPropagatedFrom() const { return m_propagatedFrom; } // This is for internal use only and is only called by // wxEvtHandler::ProcessEvent() to check whether it's the first time this // event is being processed bool WasProcessed() { if ( m_wasProcessed ) return true; m_wasProcessed = true; return false; } // This is for internal use only and is used for setting, testing and // resetting of m_willBeProcessedAgain flag. void SetWillBeProcessedAgain() { m_willBeProcessedAgain = true; } bool WillBeProcessedAgain() { if ( m_willBeProcessedAgain ) { m_willBeProcessedAgain = false; return true; } return false; } // This is also used only internally by ProcessEvent() to check if it // should process the event normally or only restrict the search for the // event handler to this object itself. bool ShouldProcessOnlyIn(wxEvtHandler *h) const { return h == m_handlerToProcessOnlyIn; } // Called to indicate that the result of ShouldProcessOnlyIn() wasn't taken // into account. The existence of this function may seem counterintuitive // but unfortunately it's needed by wxScrollHelperEvtHandler, see comments // there. Don't even think of using this in your own code, this is a gross // hack and is only needed because of wx complicated history and should // never be used anywhere else. void DidntHonourProcessOnlyIn() { m_handlerToProcessOnlyIn = NULL; } protected: wxObject* m_eventObject; wxEventType m_eventType; long m_timeStamp; int m_id; public: // m_callbackUserData is for internal usage only wxObject* m_callbackUserData; private: // If this handler wxEvtHandler *m_handlerToProcessOnlyIn; protected: // the propagation level: while it is positive, we propagate the event to // the parent window (if any) int m_propagationLevel; // The object that the event is being propagated from, initially NULL and // only set by wxPropagateOnce. wxEvtHandler* m_propagatedFrom; bool m_skipped; bool m_isCommandEvent; // initially false but becomes true as soon as WasProcessed() is called for // the first time, as this is done only by ProcessEvent() it explains the // variable name: it becomes true after ProcessEvent() was called at least // once for this event bool m_wasProcessed; // This one is initially false too, but can be set to true to indicate that // the event will be passed to another handler if it's not processed in // this one. bool m_willBeProcessedAgain; protected: wxEvent(const wxEvent&); // for implementing Clone() wxEvent& operator=(const wxEvent&); // for derived classes operator=() private: // It needs to access our m_propagationLevel and m_propagatedFrom fields. friend class WXDLLIMPEXP_FWD_BASE wxPropagateOnce; // and this one needs to access our m_handlerToProcessOnlyIn friend class WXDLLIMPEXP_FWD_BASE wxEventProcessInHandlerOnly; wxDECLARE_ABSTRACT_CLASS(wxEvent); }; /* * Helper class to temporarily change an event not to propagate. */ class WXDLLIMPEXP_BASE wxPropagationDisabler { public: wxPropagationDisabler(wxEvent& event) : m_event(event) { m_propagationLevelOld = m_event.StopPropagation(); } ~wxPropagationDisabler() { m_event.ResumePropagation(m_propagationLevelOld); } private: wxEvent& m_event; int m_propagationLevelOld; wxDECLARE_NO_COPY_CLASS(wxPropagationDisabler); }; /* * Helper used to indicate that an event is propagated upwards the window * hierarchy by the given window. */ class WXDLLIMPEXP_BASE wxPropagateOnce { public: // The handler argument should normally be non-NULL to allow the parent // event handler to know that it's being used to process an event coming // from the child, it's only NULL by default for backwards compatibility. wxPropagateOnce(wxEvent& event, wxEvtHandler* handler = NULL) : m_event(event), m_propagatedFromOld(event.m_propagatedFrom) { wxASSERT_MSG( m_event.m_propagationLevel > 0, wxT("shouldn't be used unless ShouldPropagate()!") ); m_event.m_propagationLevel--; m_event.m_propagatedFrom = handler; } ~wxPropagateOnce() { m_event.m_propagatedFrom = m_propagatedFromOld; m_event.m_propagationLevel++; } private: wxEvent& m_event; wxEvtHandler* const m_propagatedFromOld; wxDECLARE_NO_COPY_CLASS(wxPropagateOnce); }; // A helper object used to temporarily make wxEvent::ShouldProcessOnlyIn() // return true for the handler passed to its ctor. class wxEventProcessInHandlerOnly { public: wxEventProcessInHandlerOnly(wxEvent& event, wxEvtHandler *handler) : m_event(event), m_handlerToProcessOnlyInOld(event.m_handlerToProcessOnlyIn) { m_event.m_handlerToProcessOnlyIn = handler; } ~wxEventProcessInHandlerOnly() { m_event.m_handlerToProcessOnlyIn = m_handlerToProcessOnlyInOld; } private: wxEvent& m_event; wxEvtHandler * const m_handlerToProcessOnlyInOld; wxDECLARE_NO_COPY_CLASS(wxEventProcessInHandlerOnly); }; class WXDLLIMPEXP_BASE wxEventBasicPayloadMixin { public: wxEventBasicPayloadMixin() : m_commandInt(0), m_extraLong(0) { } void SetString(const wxString& s) { m_cmdString = s; } const wxString& GetString() const { return m_cmdString; } void SetInt(int i) { m_commandInt = i; } int GetInt() const { return m_commandInt; } void SetExtraLong(long extraLong) { m_extraLong = extraLong; } long GetExtraLong() const { return m_extraLong; } protected: // Note: these variables have "cmd" or "command" in their name for backward compatibility: // they used to be part of wxCommandEvent, not this mixin. wxString m_cmdString; // String event argument int m_commandInt; long m_extraLong; // Additional information (e.g. select/deselect) wxDECLARE_NO_ASSIGN_CLASS(wxEventBasicPayloadMixin); }; class WXDLLIMPEXP_BASE wxEventAnyPayloadMixin : public wxEventBasicPayloadMixin { public: wxEventAnyPayloadMixin() : wxEventBasicPayloadMixin() {} #if wxUSE_ANY template<typename T> void SetPayload(const T& payload) { m_payload = payload; } template<typename T> T GetPayload() const { return m_payload.As<T>(); } protected: wxAny m_payload; #endif // wxUSE_ANY wxDECLARE_NO_ASSIGN_CLASS(wxEventBasicPayloadMixin); }; // Idle event /* wxEVT_IDLE */ // Whether to always send idle events to windows, or // to only send update events to those with the // wxWS_EX_PROCESS_IDLE style. enum wxIdleMode { // Send idle events to all windows wxIDLE_PROCESS_ALL, // Send idle events to windows that have // the wxWS_EX_PROCESS_IDLE flag specified wxIDLE_PROCESS_SPECIFIED }; class WXDLLIMPEXP_BASE wxIdleEvent : public wxEvent { public: wxIdleEvent() : wxEvent(0, wxEVT_IDLE), m_requestMore(false) { } wxIdleEvent(const wxIdleEvent& event) : wxEvent(event), m_requestMore(event.m_requestMore) { } void RequestMore(bool needMore = true) { m_requestMore = needMore; } bool MoreRequested() const { return m_requestMore; } virtual wxEvent *Clone() const wxOVERRIDE { return new wxIdleEvent(*this); } // Specify how wxWidgets will send idle events: to // all windows, or only to those which specify that they // will process the events. static void SetMode(wxIdleMode mode) { sm_idleMode = mode; } // Returns the idle event mode static wxIdleMode GetMode() { return sm_idleMode; } protected: bool m_requestMore; static wxIdleMode sm_idleMode; private: wxDECLARE_DYNAMIC_CLASS_NO_ASSIGN(wxIdleEvent); }; // Thread event class WXDLLIMPEXP_BASE wxThreadEvent : public wxEvent, public wxEventAnyPayloadMixin { public: wxThreadEvent(wxEventType eventType = wxEVT_THREAD, int id = wxID_ANY) : wxEvent(id, eventType) { } wxThreadEvent(const wxThreadEvent& event) : wxEvent(event), wxEventAnyPayloadMixin(event) { // make sure our string member (which uses COW, aka refcounting) is not // shared by other wxString instances: SetString(GetString().Clone()); } virtual wxEvent *Clone() const wxOVERRIDE { return new wxThreadEvent(*this); } // this is important to avoid that calling wxEventLoopBase::YieldFor thread events // gets processed when this is unwanted: virtual wxEventCategory GetEventCategory() const wxOVERRIDE { return wxEVT_CATEGORY_THREAD; } private: wxDECLARE_DYNAMIC_CLASS_NO_ASSIGN(wxThreadEvent); }; // Asynchronous method call events: these event are processed by wxEvtHandler // itself and result in a call to its Execute() method which simply calls the // specified method. The difference with a simple method call is that this is // done asynchronously, i.e. at some later time, instead of immediately when // the event object is constructed. #ifdef wxHAS_CALL_AFTER // This is a base class used to process all method calls. class wxAsyncMethodCallEvent : public wxEvent { public: wxAsyncMethodCallEvent(wxObject* object) : wxEvent(wxID_ANY, wxEVT_ASYNC_METHOD_CALL) { SetEventObject(object); } wxAsyncMethodCallEvent(const wxAsyncMethodCallEvent& other) : wxEvent(other) { } virtual void Execute() = 0; }; // This is a version for calling methods without parameters. template <typename T> class wxAsyncMethodCallEvent0 : public wxAsyncMethodCallEvent { public: typedef T ObjectType; typedef void (ObjectType::*MethodType)(); wxAsyncMethodCallEvent0(ObjectType* object, MethodType method) : wxAsyncMethodCallEvent(object), m_object(object), m_method(method) { } wxAsyncMethodCallEvent0(const wxAsyncMethodCallEvent0& other) : wxAsyncMethodCallEvent(other), m_object(other.m_object), m_method(other.m_method) { } virtual wxEvent *Clone() const wxOVERRIDE { return new wxAsyncMethodCallEvent0(*this); } virtual void Execute() wxOVERRIDE { (m_object->*m_method)(); } private: ObjectType* const m_object; const MethodType m_method; }; // This is a version for calling methods with a single parameter. template <typename T, typename T1> class wxAsyncMethodCallEvent1 : public wxAsyncMethodCallEvent { public: typedef T ObjectType; typedef void (ObjectType::*MethodType)(T1 x1); typedef typename wxRemoveRef<T1>::type ParamType1; wxAsyncMethodCallEvent1(ObjectType* object, MethodType method, const ParamType1& x1) : wxAsyncMethodCallEvent(object), m_object(object), m_method(method), m_param1(x1) { } wxAsyncMethodCallEvent1(const wxAsyncMethodCallEvent1& other) : wxAsyncMethodCallEvent(other), m_object(other.m_object), m_method(other.m_method), m_param1(other.m_param1) { } virtual wxEvent *Clone() const wxOVERRIDE { return new wxAsyncMethodCallEvent1(*this); } virtual void Execute() wxOVERRIDE { (m_object->*m_method)(m_param1); } private: ObjectType* const m_object; const MethodType m_method; const ParamType1 m_param1; }; // This is a version for calling methods with two parameters. template <typename T, typename T1, typename T2> class wxAsyncMethodCallEvent2 : public wxAsyncMethodCallEvent { public: typedef T ObjectType; typedef void (ObjectType::*MethodType)(T1 x1, T2 x2); typedef typename wxRemoveRef<T1>::type ParamType1; typedef typename wxRemoveRef<T2>::type ParamType2; wxAsyncMethodCallEvent2(ObjectType* object, MethodType method, const ParamType1& x1, const ParamType2& x2) : wxAsyncMethodCallEvent(object), m_object(object), m_method(method), m_param1(x1), m_param2(x2) { } wxAsyncMethodCallEvent2(const wxAsyncMethodCallEvent2& other) : wxAsyncMethodCallEvent(other), m_object(other.m_object), m_method(other.m_method), m_param1(other.m_param1), m_param2(other.m_param2) { } virtual wxEvent *Clone() const wxOVERRIDE { return new wxAsyncMethodCallEvent2(*this); } virtual void Execute() wxOVERRIDE { (m_object->*m_method)(m_param1, m_param2); } private: ObjectType* const m_object; const MethodType m_method; const ParamType1 m_param1; const ParamType2 m_param2; }; // This is a version for calling any functors template <typename T> class wxAsyncMethodCallEventFunctor : public wxAsyncMethodCallEvent { public: typedef T FunctorType; wxAsyncMethodCallEventFunctor(wxObject *object, const FunctorType& fn) : wxAsyncMethodCallEvent(object), m_fn(fn) { } wxAsyncMethodCallEventFunctor(const wxAsyncMethodCallEventFunctor& other) : wxAsyncMethodCallEvent(other), m_fn(other.m_fn) { } virtual wxEvent *Clone() const wxOVERRIDE { return new wxAsyncMethodCallEventFunctor(*this); } virtual void Execute() wxOVERRIDE { m_fn(); } private: FunctorType m_fn; }; #endif // wxHAS_CALL_AFTER #if wxUSE_GUI // Item or menu event class /* wxEVT_BUTTON wxEVT_CHECKBOX wxEVT_CHOICE wxEVT_LISTBOX wxEVT_LISTBOX_DCLICK wxEVT_TEXT wxEVT_TEXT_ENTER wxEVT_MENU wxEVT_SLIDER wxEVT_RADIOBOX wxEVT_RADIOBUTTON wxEVT_SCROLLBAR wxEVT_VLBOX wxEVT_COMBOBOX wxEVT_TOGGLEBUTTON */ class WXDLLIMPEXP_CORE wxCommandEvent : public wxEvent, public wxEventBasicPayloadMixin { public: wxCommandEvent(wxEventType commandType = wxEVT_NULL, int winid = 0) : wxEvent(winid, commandType) { m_clientData = NULL; m_clientObject = NULL; m_isCommandEvent = true; // the command events are propagated upwards by default m_propagationLevel = wxEVENT_PROPAGATE_MAX; } wxCommandEvent(const wxCommandEvent& event) : wxEvent(event), wxEventBasicPayloadMixin(event), m_clientData(event.m_clientData), m_clientObject(event.m_clientObject) { // Because GetString() can retrieve the string text only on demand, we // need to copy it explicitly. if ( m_cmdString.empty() ) m_cmdString = event.GetString(); } // Set/Get client data from controls void SetClientData(void* clientData) { m_clientData = clientData; } void *GetClientData() const { return m_clientData; } // Set/Get client object from controls void SetClientObject(wxClientData* clientObject) { m_clientObject = clientObject; } wxClientData *GetClientObject() const { return m_clientObject; } // Note: this shadows wxEventBasicPayloadMixin::GetString(), because it does some // GUI-specific hacks wxString GetString() const; // Get listbox selection if single-choice int GetSelection() const { return m_commandInt; } // Get checkbox value bool IsChecked() const { return m_commandInt != 0; } // true if the listbox event was a selection. bool IsSelection() const { return (m_extraLong != 0); } virtual wxEvent *Clone() const wxOVERRIDE { return new wxCommandEvent(*this); } virtual wxEventCategory GetEventCategory() const wxOVERRIDE { return wxEVT_CATEGORY_USER_INPUT; } protected: void* m_clientData; // Arbitrary client data wxClientData* m_clientObject; // Arbitrary client object private: wxDECLARE_DYNAMIC_CLASS_NO_ASSIGN(wxCommandEvent); }; // this class adds a possibility to react (from the user) code to a control // notification: allow or veto the operation being reported. class WXDLLIMPEXP_CORE wxNotifyEvent : public wxCommandEvent { public: wxNotifyEvent(wxEventType commandType = wxEVT_NULL, int winid = 0) : wxCommandEvent(commandType, winid) { m_bAllow = true; } wxNotifyEvent(const wxNotifyEvent& event) : wxCommandEvent(event) { m_bAllow = event.m_bAllow; } // veto the operation (usually it's allowed by default) void Veto() { m_bAllow = false; } // allow the operation if it was disabled by default void Allow() { m_bAllow = true; } // for implementation code only: is the operation allowed? bool IsAllowed() const { return m_bAllow; } virtual wxEvent *Clone() const wxOVERRIDE { return new wxNotifyEvent(*this); } private: bool m_bAllow; private: wxDECLARE_DYNAMIC_CLASS_NO_ASSIGN(wxNotifyEvent); }; // Scroll event class, derived form wxCommandEvent. wxScrollEvents are // sent by wxSlider and wxScrollBar. /* wxEVT_SCROLL_TOP wxEVT_SCROLL_BOTTOM wxEVT_SCROLL_LINEUP wxEVT_SCROLL_LINEDOWN wxEVT_SCROLL_PAGEUP wxEVT_SCROLL_PAGEDOWN wxEVT_SCROLL_THUMBTRACK wxEVT_SCROLL_THUMBRELEASE wxEVT_SCROLL_CHANGED */ class WXDLLIMPEXP_CORE wxScrollEvent : public wxCommandEvent { public: wxScrollEvent(wxEventType commandType = wxEVT_NULL, int winid = 0, int pos = 0, int orient = 0); int GetOrientation() const { return (int) m_extraLong; } int GetPosition() const { return m_commandInt; } void SetOrientation(int orient) { m_extraLong = (long) orient; } void SetPosition(int pos) { m_commandInt = pos; } virtual wxEvent *Clone() const wxOVERRIDE { return new wxScrollEvent(*this); } private: wxDECLARE_DYNAMIC_CLASS_NO_ASSIGN(wxScrollEvent); }; // ScrollWin event class, derived fom wxEvent. wxScrollWinEvents // are sent by wxWindow. /* wxEVT_SCROLLWIN_TOP wxEVT_SCROLLWIN_BOTTOM wxEVT_SCROLLWIN_LINEUP wxEVT_SCROLLWIN_LINEDOWN wxEVT_SCROLLWIN_PAGEUP wxEVT_SCROLLWIN_PAGEDOWN wxEVT_SCROLLWIN_THUMBTRACK wxEVT_SCROLLWIN_THUMBRELEASE */ class WXDLLIMPEXP_CORE wxScrollWinEvent : public wxEvent { public: wxScrollWinEvent(wxEventType commandType = wxEVT_NULL, int pos = 0, int orient = 0); wxScrollWinEvent(const wxScrollWinEvent& event) : wxEvent(event) { m_commandInt = event.m_commandInt; m_extraLong = event.m_extraLong; } int GetOrientation() const { return (int) m_extraLong; } int GetPosition() const { return m_commandInt; } void SetOrientation(int orient) { m_extraLong = (long) orient; } void SetPosition(int pos) { m_commandInt = pos; } virtual wxEvent *Clone() const wxOVERRIDE { return new wxScrollWinEvent(*this); } protected: int m_commandInt; long m_extraLong; private: wxDECLARE_DYNAMIC_CLASS_NO_ASSIGN(wxScrollWinEvent); }; // Mouse event class /* wxEVT_LEFT_DOWN wxEVT_LEFT_UP wxEVT_MIDDLE_DOWN wxEVT_MIDDLE_UP wxEVT_RIGHT_DOWN wxEVT_RIGHT_UP wxEVT_MOTION wxEVT_ENTER_WINDOW wxEVT_LEAVE_WINDOW wxEVT_LEFT_DCLICK wxEVT_MIDDLE_DCLICK wxEVT_RIGHT_DCLICK */ enum wxMouseWheelAxis { wxMOUSE_WHEEL_VERTICAL, wxMOUSE_WHEEL_HORIZONTAL }; class WXDLLIMPEXP_CORE wxMouseEvent : public wxEvent, public wxMouseState { public: wxMouseEvent(wxEventType mouseType = wxEVT_NULL); wxMouseEvent(const wxMouseEvent& event) : wxEvent(event), wxMouseState(event) { Assign(event); } // Was it a button event? (*doesn't* mean: is any button *down*?) bool IsButton() const { return Button(wxMOUSE_BTN_ANY); } // Was it a down event from this (or any) button? bool ButtonDown(int but = wxMOUSE_BTN_ANY) const; // Was it a dclick event from this (or any) button? bool ButtonDClick(int but = wxMOUSE_BTN_ANY) const; // Was it a up event from this (or any) button? bool ButtonUp(int but = wxMOUSE_BTN_ANY) const; // Was this event generated by the given button? bool Button(int but) const; // Get the button which is changing state (wxMOUSE_BTN_NONE if none) int GetButton() const; // Find which event was just generated bool LeftDown() const { return (m_eventType == wxEVT_LEFT_DOWN); } bool MiddleDown() const { return (m_eventType == wxEVT_MIDDLE_DOWN); } bool RightDown() const { return (m_eventType == wxEVT_RIGHT_DOWN); } bool Aux1Down() const { return (m_eventType == wxEVT_AUX1_DOWN); } bool Aux2Down() const { return (m_eventType == wxEVT_AUX2_DOWN); } bool LeftUp() const { return (m_eventType == wxEVT_LEFT_UP); } bool MiddleUp() const { return (m_eventType == wxEVT_MIDDLE_UP); } bool RightUp() const { return (m_eventType == wxEVT_RIGHT_UP); } bool Aux1Up() const { return (m_eventType == wxEVT_AUX1_UP); } bool Aux2Up() const { return (m_eventType == wxEVT_AUX2_UP); } bool LeftDClick() const { return (m_eventType == wxEVT_LEFT_DCLICK); } bool MiddleDClick() const { return (m_eventType == wxEVT_MIDDLE_DCLICK); } bool RightDClick() const { return (m_eventType == wxEVT_RIGHT_DCLICK); } bool Aux1DClick() const { return (m_eventType == wxEVT_AUX1_DCLICK); } bool Aux2DClick() const { return (m_eventType == wxEVT_AUX2_DCLICK); } bool Magnify() const { return (m_eventType == wxEVT_MAGNIFY); } // True if a button is down and the mouse is moving bool Dragging() const { return (m_eventType == wxEVT_MOTION) && ButtonIsDown(wxMOUSE_BTN_ANY); } // True if the mouse is moving, and no button is down bool Moving() const { return (m_eventType == wxEVT_MOTION) && !ButtonIsDown(wxMOUSE_BTN_ANY); } // True if the mouse is just entering the window bool Entering() const { return (m_eventType == wxEVT_ENTER_WINDOW); } // True if the mouse is just leaving the window bool Leaving() const { return (m_eventType == wxEVT_LEAVE_WINDOW); } // Returns the number of mouse clicks associated with this event. int GetClickCount() const { return m_clickCount; } // Find the logical position of the event given the DC wxPoint GetLogicalPosition(const wxDC& dc) const; // Get wheel rotation, positive or negative indicates direction of // rotation. Current devices all send an event when rotation is equal to // +/-WheelDelta, but this allows for finer resolution devices to be // created in the future. Because of this you shouldn't assume that one // event is equal to 1 line or whatever, but you should be able to either // do partial line scrolling or wait until +/-WheelDelta rotation values // have been accumulated before scrolling. int GetWheelRotation() const { return m_wheelRotation; } // Get wheel delta, normally 120. This is the threshold for action to be // taken, and one such action (for example, scrolling one increment) // should occur for each delta. int GetWheelDelta() const { return m_wheelDelta; } // Gets the axis the wheel operation concerns; wxMOUSE_WHEEL_VERTICAL // (most common case) or wxMOUSE_WHEEL_HORIZONTAL (for horizontal scrolling // using e.g. a trackpad). wxMouseWheelAxis GetWheelAxis() const { return m_wheelAxis; } // Returns the configured number of lines (or whatever) to be scrolled per // wheel action. Defaults to three. int GetLinesPerAction() const { return m_linesPerAction; } // Returns the configured number of columns (or whatever) to be scrolled per // wheel action. Defaults to three. int GetColumnsPerAction() const { return m_columnsPerAction; } // Is the system set to do page scrolling? bool IsPageScroll() const { return ((unsigned int)m_linesPerAction == UINT_MAX); } float GetMagnification() const { return m_magnification; } virtual wxEvent *Clone() const wxOVERRIDE { return new wxMouseEvent(*this); } virtual wxEventCategory GetEventCategory() const wxOVERRIDE { return wxEVT_CATEGORY_USER_INPUT; } wxMouseEvent& operator=(const wxMouseEvent& event) { if (&event != this) Assign(event); return *this; } public: int m_clickCount; wxMouseWheelAxis m_wheelAxis; int m_wheelRotation; int m_wheelDelta; int m_linesPerAction; int m_columnsPerAction; float m_magnification; protected: void Assign(const wxMouseEvent& evt); private: wxDECLARE_DYNAMIC_CLASS(wxMouseEvent); }; // Cursor set event /* wxEVT_SET_CURSOR */ class WXDLLIMPEXP_CORE wxSetCursorEvent : public wxEvent { public: wxSetCursorEvent(wxCoord x = 0, wxCoord y = 0) : wxEvent(0, wxEVT_SET_CURSOR), m_x(x), m_y(y), m_cursor() { } wxSetCursorEvent(const wxSetCursorEvent& event) : wxEvent(event), m_x(event.m_x), m_y(event.m_y), m_cursor(event.m_cursor) { } wxCoord GetX() const { return m_x; } wxCoord GetY() const { return m_y; } void SetCursor(const wxCursor& cursor) { m_cursor = cursor; } const wxCursor& GetCursor() const { return m_cursor; } bool HasCursor() const { return m_cursor.IsOk(); } virtual wxEvent *Clone() const wxOVERRIDE { return new wxSetCursorEvent(*this); } private: wxCoord m_x, m_y; wxCursor m_cursor; private: wxDECLARE_DYNAMIC_CLASS_NO_ASSIGN(wxSetCursorEvent); }; // Gesture Event const unsigned int wxTwoFingerTimeInterval = 200; class WXDLLIMPEXP_CORE wxGestureEvent : public wxEvent { public: wxGestureEvent(wxWindowID winid = 0, wxEventType type = wxEVT_NULL) : wxEvent(winid, type) { m_isStart = false; m_isEnd = false; } wxGestureEvent(const wxGestureEvent& event) : wxEvent(event) { m_pos = event.m_pos; m_isStart = event.m_isStart; m_isEnd = event.m_isEnd; } const wxPoint& GetPosition() const { return m_pos; } void SetPosition(const wxPoint& pos) { m_pos = pos; } bool IsGestureStart() const { return m_isStart; } void SetGestureStart(bool isStart = true) { m_isStart = isStart; } bool IsGestureEnd() const { return m_isEnd; } void SetGestureEnd(bool isEnd = true) { m_isEnd = isEnd; } virtual wxEvent *Clone() const wxOVERRIDE { return new wxGestureEvent(*this); } protected: wxPoint m_pos; bool m_isStart, m_isEnd; wxDECLARE_DYNAMIC_CLASS_NO_ASSIGN(wxGestureEvent); }; // Pan Gesture Event /* wxEVT_GESTURE_PAN */ class WXDLLIMPEXP_CORE wxPanGestureEvent : public wxGestureEvent { public: wxPanGestureEvent(wxWindowID winid = 0) : wxGestureEvent(winid, wxEVT_GESTURE_PAN) { } wxPanGestureEvent(const wxPanGestureEvent& event) : wxGestureEvent(event), m_delta(event.m_delta) { } wxPoint GetDelta() const { return m_delta; } void SetDelta(const wxPoint& delta) { m_delta = delta; } virtual wxEvent *Clone() const wxOVERRIDE { return new wxPanGestureEvent(*this); } private: wxPoint m_delta; wxDECLARE_DYNAMIC_CLASS_NO_ASSIGN(wxPanGestureEvent); }; // Zoom Gesture Event /* wxEVT_GESTURE_ZOOM */ class WXDLLIMPEXP_CORE wxZoomGestureEvent : public wxGestureEvent { public: wxZoomGestureEvent(wxWindowID winid = 0) : wxGestureEvent(winid, wxEVT_GESTURE_ZOOM) { m_zoomFactor = 1.0; } wxZoomGestureEvent(const wxZoomGestureEvent& event) : wxGestureEvent(event) { m_zoomFactor = event.m_zoomFactor; } double GetZoomFactor() const { return m_zoomFactor; } void SetZoomFactor(double zoomFactor) { m_zoomFactor = zoomFactor; } virtual wxEvent *Clone() const wxOVERRIDE { return new wxZoomGestureEvent(*this); } private: double m_zoomFactor; wxDECLARE_DYNAMIC_CLASS_NO_ASSIGN(wxZoomGestureEvent); }; // Rotate Gesture Event /* wxEVT_GESTURE_ROTATE */ class WXDLLIMPEXP_CORE wxRotateGestureEvent : public wxGestureEvent { public: wxRotateGestureEvent(wxWindowID winid = 0) : wxGestureEvent(winid, wxEVT_GESTURE_ROTATE) { m_rotationAngle = 0.0; } wxRotateGestureEvent(const wxRotateGestureEvent& event) : wxGestureEvent(event) { m_rotationAngle = event.m_rotationAngle; } double GetRotationAngle() const { return m_rotationAngle; } void SetRotationAngle(double rotationAngle) { m_rotationAngle = rotationAngle; } virtual wxEvent *Clone() const wxOVERRIDE { return new wxRotateGestureEvent(*this); } private: double m_rotationAngle; wxDECLARE_DYNAMIC_CLASS_NO_ASSIGN(wxRotateGestureEvent); }; // Two Finger Tap Gesture Event /* wxEVT_TWO_FINGER_TAP */ class WXDLLIMPEXP_CORE wxTwoFingerTapEvent : public wxGestureEvent { public: wxTwoFingerTapEvent(wxWindowID winid = 0) : wxGestureEvent(winid, wxEVT_TWO_FINGER_TAP) { } wxTwoFingerTapEvent(const wxTwoFingerTapEvent& event) : wxGestureEvent(event) { } virtual wxEvent *Clone() const wxOVERRIDE { return new wxTwoFingerTapEvent(*this); } private: wxDECLARE_DYNAMIC_CLASS_NO_ASSIGN(wxTwoFingerTapEvent); }; // Long Press Gesture Event /* wxEVT_LONG_PRESS */ class WXDLLIMPEXP_CORE wxLongPressEvent : public wxGestureEvent { public: wxLongPressEvent(wxWindowID winid = 0) : wxGestureEvent(winid, wxEVT_LONG_PRESS) { } wxLongPressEvent(const wxLongPressEvent& event) : wxGestureEvent(event) { } virtual wxEvent *Clone() const wxOVERRIDE { return new wxLongPressEvent(*this); } private: wxDECLARE_DYNAMIC_CLASS_NO_ASSIGN(wxLongPressEvent); }; // Press And Tap Gesture Event /* wxEVT_PRESS_AND_TAP */ class WXDLLIMPEXP_CORE wxPressAndTapEvent : public wxGestureEvent { public: wxPressAndTapEvent(wxWindowID winid = 0) : wxGestureEvent(winid, wxEVT_PRESS_AND_TAP) { } wxPressAndTapEvent(const wxPressAndTapEvent& event) : wxGestureEvent(event) { } virtual wxEvent *Clone() const wxOVERRIDE { return new wxPressAndTapEvent(*this); } private: wxDECLARE_DYNAMIC_CLASS_NO_ASSIGN(wxPressAndTapEvent); }; // Keyboard input event class /* wxEVT_CHAR wxEVT_CHAR_HOOK wxEVT_KEY_DOWN wxEVT_KEY_UP wxEVT_HOTKEY */ // key categories: the bit flags for IsKeyInCategory() function // // the enum values used may change in future version of wx // use the named constants only, or bitwise combinations thereof enum wxKeyCategoryFlags { // arrow keys, on and off numeric keypads WXK_CATEGORY_ARROW = 1, // page up and page down keys, on and off numeric keypads WXK_CATEGORY_PAGING = 2, // home and end keys, on and off numeric keypads WXK_CATEGORY_JUMP = 4, // tab key, on and off numeric keypads WXK_CATEGORY_TAB = 8, // backspace and delete keys, on and off numeric keypads WXK_CATEGORY_CUT = 16, // all keys usually used for navigation WXK_CATEGORY_NAVIGATION = WXK_CATEGORY_ARROW | WXK_CATEGORY_PAGING | WXK_CATEGORY_JUMP }; class WXDLLIMPEXP_CORE wxKeyEvent : public wxEvent, public wxKeyboardState { public: wxKeyEvent(wxEventType keyType = wxEVT_NULL); // Normal copy ctor and a ctor creating a new event for the same key as the // given one but a different event type (this is used in implementation // code only, do not use outside of the library). wxKeyEvent(const wxKeyEvent& evt); wxKeyEvent(wxEventType eventType, const wxKeyEvent& evt); // get the key code: an ASCII7 char or an element of wxKeyCode enum int GetKeyCode() const { return (int)m_keyCode; } // returns true iff this event's key code is of a certain type bool IsKeyInCategory(int category) const; #if wxUSE_UNICODE // get the Unicode character corresponding to this key wxChar GetUnicodeKey() const { return m_uniChar; } #endif // wxUSE_UNICODE // get the raw key code (platform-dependent) wxUint32 GetRawKeyCode() const { return m_rawCode; } // get the raw key flags (platform-dependent) wxUint32 GetRawKeyFlags() const { return m_rawFlags; } // Find the position of the event void GetPosition(wxCoord *xpos, wxCoord *ypos) const { if (xpos) *xpos = GetX(); if (ypos) *ypos = GetY(); } // This version if provided only for backwards compatiblity, don't use. void GetPosition(long *xpos, long *ypos) const { if (xpos) *xpos = GetX(); if (ypos) *ypos = GetY(); } wxPoint GetPosition() const { return wxPoint(GetX(), GetY()); } // Get X position wxCoord GetX() const; // Get Y position wxCoord GetY() const; // Can be called from wxEVT_CHAR_HOOK handler to allow generation of normal // key events even though the event had been handled (by default they would // not be generated in this case). void DoAllowNextEvent() { m_allowNext = true; } // Return the value of the "allow next" flag, for internal use only. bool IsNextEventAllowed() const { return m_allowNext; } virtual wxEvent *Clone() const wxOVERRIDE { return new wxKeyEvent(*this); } virtual wxEventCategory GetEventCategory() const wxOVERRIDE { return wxEVT_CATEGORY_USER_INPUT; } // we do need to copy wxKeyEvent sometimes (in wxTreeCtrl code, for // example) wxKeyEvent& operator=(const wxKeyEvent& evt) { if ( &evt != this ) { wxEvent::operator=(evt); // Borland C++ 5.82 doesn't compile an explicit call to an // implicitly defined operator=() so need to do it this way: *static_cast<wxKeyboardState *>(this) = evt; DoAssignMembers(evt); } return *this; } public: // Do not use these fields directly, they are initialized on demand, so // call GetX() and GetY() or GetPosition() instead. wxCoord m_x, m_y; long m_keyCode; #if wxUSE_UNICODE // This contains the full Unicode character // in a character events in Unicode mode wxChar m_uniChar; #endif // these fields contain the platform-specific information about // key that was pressed wxUint32 m_rawCode; wxUint32 m_rawFlags; private: // Set the event to propagate if necessary, i.e. if it's of wxEVT_CHAR_HOOK // type. This is used by all ctors. void InitPropagation() { if ( m_eventType == wxEVT_CHAR_HOOK ) m_propagationLevel = wxEVENT_PROPAGATE_MAX; m_allowNext = false; } // Copy only the event data present in this class, this is used by // AssignKeyData() and copy ctor. void DoAssignMembers(const wxKeyEvent& evt) { m_x = evt.m_x; m_y = evt.m_y; m_hasPosition = evt.m_hasPosition; m_keyCode = evt.m_keyCode; m_rawCode = evt.m_rawCode; m_rawFlags = evt.m_rawFlags; #if wxUSE_UNICODE m_uniChar = evt.m_uniChar; #endif } // Initialize m_x and m_y using the current mouse cursor position if // necessary. void InitPositionIfNecessary() const; // If this flag is true, the normal key events should still be generated // even if wxEVT_CHAR_HOOK had been handled. By default it is false as // handling wxEVT_CHAR_HOOK suppresses all the subsequent events. bool m_allowNext; // If true, m_x and m_y were already initialized. If false, try to get them // when they're requested. bool m_hasPosition; wxDECLARE_DYNAMIC_CLASS(wxKeyEvent); }; // Size event class /* wxEVT_SIZE */ class WXDLLIMPEXP_CORE wxSizeEvent : public wxEvent { public: wxSizeEvent() : wxEvent(0, wxEVT_SIZE) { } wxSizeEvent(const wxSize& sz, int winid = 0) : wxEvent(winid, wxEVT_SIZE), m_size(sz) { } wxSizeEvent(const wxSizeEvent& event) : wxEvent(event), m_size(event.m_size), m_rect(event.m_rect) { } wxSizeEvent(const wxRect& rect, int id = 0) : m_size(rect.GetSize()), m_rect(rect) { m_eventType = wxEVT_SIZING; m_id = id; } wxSize GetSize() const { return m_size; } void SetSize(wxSize size) { m_size = size; } wxRect GetRect() const { return m_rect; } void SetRect(const wxRect& rect) { m_rect = rect; } virtual wxEvent *Clone() const wxOVERRIDE { return new wxSizeEvent(*this); } public: // For internal usage only. Will be converted to protected members. wxSize m_size; wxRect m_rect; // Used for wxEVT_SIZING private: wxDECLARE_DYNAMIC_CLASS_NO_ASSIGN(wxSizeEvent); }; // Move event class /* wxEVT_MOVE */ class WXDLLIMPEXP_CORE wxMoveEvent : public wxEvent { public: wxMoveEvent() : wxEvent(0, wxEVT_MOVE) { } wxMoveEvent(const wxPoint& pos, int winid = 0) : wxEvent(winid, wxEVT_MOVE), m_pos(pos) { } wxMoveEvent(const wxMoveEvent& event) : wxEvent(event), m_pos(event.m_pos) { } wxMoveEvent(const wxRect& rect, int id = 0) : m_pos(rect.GetPosition()), m_rect(rect) { m_eventType = wxEVT_MOVING; m_id = id; } wxPoint GetPosition() const { return m_pos; } void SetPosition(const wxPoint& pos) { m_pos = pos; } wxRect GetRect() const { return m_rect; } void SetRect(const wxRect& rect) { m_rect = rect; } virtual wxEvent *Clone() const wxOVERRIDE { return new wxMoveEvent(*this); } protected: wxPoint m_pos; wxRect m_rect; private: wxDECLARE_DYNAMIC_CLASS_NO_ASSIGN(wxMoveEvent); }; // Paint event class /* wxEVT_PAINT wxEVT_NC_PAINT */ #if wxDEBUG_LEVEL && defined(__WXMSW__) #define wxHAS_PAINT_DEBUG // see comments in src/msw/dcclient.cpp where g_isPainting is defined extern WXDLLIMPEXP_CORE int g_isPainting; #endif // debug class WXDLLIMPEXP_CORE wxPaintEvent : public wxEvent { public: wxPaintEvent(int Id = 0) : wxEvent(Id, wxEVT_PAINT) { #ifdef wxHAS_PAINT_DEBUG // set the internal flag for the duration of redrawing g_isPainting++; #endif // debug } // default copy ctor and dtor are normally fine, we only need them to keep // g_isPainting updated in debug build #ifdef wxHAS_PAINT_DEBUG wxPaintEvent(const wxPaintEvent& event) : wxEvent(event) { g_isPainting++; } virtual ~wxPaintEvent() { g_isPainting--; } #endif // debug virtual wxEvent *Clone() const wxOVERRIDE { return new wxPaintEvent(*this); } private: wxDECLARE_DYNAMIC_CLASS_NO_ASSIGN(wxPaintEvent); }; class WXDLLIMPEXP_CORE wxNcPaintEvent : public wxEvent { public: wxNcPaintEvent(int winid = 0) : wxEvent(winid, wxEVT_NC_PAINT) { } virtual wxEvent *Clone() const wxOVERRIDE { return new wxNcPaintEvent(*this); } private: wxDECLARE_DYNAMIC_CLASS_NO_ASSIGN(wxNcPaintEvent); }; // Erase background event class /* wxEVT_ERASE_BACKGROUND */ class WXDLLIMPEXP_CORE wxEraseEvent : public wxEvent { public: wxEraseEvent(int Id = 0, wxDC *dc = NULL) : wxEvent(Id, wxEVT_ERASE_BACKGROUND), m_dc(dc) { } wxEraseEvent(const wxEraseEvent& event) : wxEvent(event), m_dc(event.m_dc) { } wxDC *GetDC() const { return m_dc; } virtual wxEvent *Clone() const wxOVERRIDE { return new wxEraseEvent(*this); } protected: wxDC *m_dc; private: wxDECLARE_DYNAMIC_CLASS_NO_ASSIGN(wxEraseEvent); }; // Focus event class /* wxEVT_SET_FOCUS wxEVT_KILL_FOCUS */ class WXDLLIMPEXP_CORE wxFocusEvent : public wxEvent { public: wxFocusEvent(wxEventType type = wxEVT_NULL, int winid = 0) : wxEvent(winid, type) { m_win = NULL; } wxFocusEvent(const wxFocusEvent& event) : wxEvent(event) { m_win = event.m_win; } // The window associated with this event is the window which had focus // before for SET event and the window which will have focus for the KILL // one. NB: it may be NULL in both cases! wxWindow *GetWindow() const { return m_win; } void SetWindow(wxWindow *win) { m_win = win; } virtual wxEvent *Clone() const wxOVERRIDE { return new wxFocusEvent(*this); } private: wxWindow *m_win; private: wxDECLARE_DYNAMIC_CLASS_NO_ASSIGN(wxFocusEvent); }; // wxChildFocusEvent notifies the parent that a child has got the focus: unlike // wxFocusEvent it is propagated upwards the window chain class WXDLLIMPEXP_CORE wxChildFocusEvent : public wxCommandEvent { public: wxChildFocusEvent(wxWindow *win = NULL); wxWindow *GetWindow() const { return (wxWindow *)GetEventObject(); } virtual wxEvent *Clone() const wxOVERRIDE { return new wxChildFocusEvent(*this); } private: wxDECLARE_DYNAMIC_CLASS_NO_ASSIGN(wxChildFocusEvent); }; // Activate event class /* wxEVT_ACTIVATE wxEVT_ACTIVATE_APP wxEVT_HIBERNATE */ class WXDLLIMPEXP_CORE wxActivateEvent : public wxEvent { public: // Type of activation. For now we can only detect if it was by mouse or by // some other method and even this is only available under wxMSW. enum Reason { Reason_Mouse, Reason_Unknown }; wxActivateEvent(wxEventType type = wxEVT_NULL, bool active = true, int Id = 0, Reason activationReason = Reason_Unknown) : wxEvent(Id, type), m_activationReason(activationReason) { m_active = active; } wxActivateEvent(const wxActivateEvent& event) : wxEvent(event) { m_active = event.m_active; m_activationReason = event.m_activationReason; } bool GetActive() const { return m_active; } Reason GetActivationReason() const { return m_activationReason;} virtual wxEvent *Clone() const wxOVERRIDE { return new wxActivateEvent(*this); } private: bool m_active; Reason m_activationReason; private: wxDECLARE_DYNAMIC_CLASS_NO_ASSIGN(wxActivateEvent); }; // InitDialog event class /* wxEVT_INIT_DIALOG */ class WXDLLIMPEXP_CORE wxInitDialogEvent : public wxEvent { public: wxInitDialogEvent(int Id = 0) : wxEvent(Id, wxEVT_INIT_DIALOG) { } virtual wxEvent *Clone() const wxOVERRIDE { return new wxInitDialogEvent(*this); } private: wxDECLARE_DYNAMIC_CLASS_NO_ASSIGN(wxInitDialogEvent); }; // Miscellaneous menu event class /* wxEVT_MENU_OPEN, wxEVT_MENU_CLOSE, wxEVT_MENU_HIGHLIGHT, */ class WXDLLIMPEXP_CORE wxMenuEvent : public wxEvent { public: wxMenuEvent(wxEventType type = wxEVT_NULL, int winid = 0, wxMenu* menu = NULL) : wxEvent(winid, type) { m_menuId = winid; m_menu = menu; } wxMenuEvent(const wxMenuEvent& event) : wxEvent(event) { m_menuId = event.m_menuId; m_menu = event.m_menu; } // only for wxEVT_MENU_HIGHLIGHT int GetMenuId() const { return m_menuId; } // only for wxEVT_MENU_OPEN/CLOSE bool IsPopup() const { return m_menuId == wxID_ANY; } // only for wxEVT_MENU_OPEN/CLOSE wxMenu* GetMenu() const { return m_menu; } virtual wxEvent *Clone() const wxOVERRIDE { return new wxMenuEvent(*this); } private: int m_menuId; wxMenu* m_menu; wxDECLARE_DYNAMIC_CLASS_NO_ASSIGN(wxMenuEvent); }; // Window close or session close event class /* wxEVT_CLOSE_WINDOW, wxEVT_END_SESSION, wxEVT_QUERY_END_SESSION */ class WXDLLIMPEXP_CORE wxCloseEvent : public wxEvent { public: wxCloseEvent(wxEventType type = wxEVT_NULL, int winid = 0) : wxEvent(winid, type), m_loggingOff(true), m_veto(false), // should be false by default m_canVeto(true) {} wxCloseEvent(const wxCloseEvent& event) : wxEvent(event), m_loggingOff(event.m_loggingOff), m_veto(event.m_veto), m_canVeto(event.m_canVeto) {} void SetLoggingOff(bool logOff) { m_loggingOff = logOff; } bool GetLoggingOff() const { // m_loggingOff flag is only used by wxEVT_[QUERY_]END_SESSION, it // doesn't make sense for wxEVT_CLOSE_WINDOW wxASSERT_MSG( m_eventType != wxEVT_CLOSE_WINDOW, wxT("this flag is for end session events only") ); return m_loggingOff; } void Veto(bool veto = true) { // GetVeto() will return false anyhow... wxCHECK_RET( m_canVeto, wxT("call to Veto() ignored (can't veto this event)") ); m_veto = veto; } void SetCanVeto(bool canVeto) { m_canVeto = canVeto; } bool CanVeto() const { return m_canVeto; } bool GetVeto() const { return m_canVeto && m_veto; } virtual wxEvent *Clone() const wxOVERRIDE { return new wxCloseEvent(*this); } protected: bool m_loggingOff, m_veto, m_canVeto; private: wxDECLARE_DYNAMIC_CLASS_NO_ASSIGN(wxCloseEvent); }; /* wxEVT_SHOW */ class WXDLLIMPEXP_CORE wxShowEvent : public wxEvent { public: wxShowEvent(int winid = 0, bool show = false) : wxEvent(winid, wxEVT_SHOW) { m_show = show; } wxShowEvent(const wxShowEvent& event) : wxEvent(event) { m_show = event.m_show; } void SetShow(bool show) { m_show = show; } // return true if the window was shown, false if hidden bool IsShown() const { return m_show; } #if WXWIN_COMPATIBILITY_2_8 wxDEPRECATED( bool GetShow() const { return IsShown(); } ) #endif virtual wxEvent *Clone() const wxOVERRIDE { return new wxShowEvent(*this); } protected: bool m_show; private: wxDECLARE_DYNAMIC_CLASS_NO_ASSIGN(wxShowEvent); }; /* wxEVT_ICONIZE */ class WXDLLIMPEXP_CORE wxIconizeEvent : public wxEvent { public: wxIconizeEvent(int winid = 0, bool iconized = true) : wxEvent(winid, wxEVT_ICONIZE) { m_iconized = iconized; } wxIconizeEvent(const wxIconizeEvent& event) : wxEvent(event) { m_iconized = event.m_iconized; } #if WXWIN_COMPATIBILITY_2_8 wxDEPRECATED( bool Iconized() const { return IsIconized(); } ) #endif // return true if the frame was iconized, false if restored bool IsIconized() const { return m_iconized; } virtual wxEvent *Clone() const wxOVERRIDE { return new wxIconizeEvent(*this); } protected: bool m_iconized; private: wxDECLARE_DYNAMIC_CLASS_NO_ASSIGN(wxIconizeEvent); }; /* wxEVT_MAXIMIZE */ class WXDLLIMPEXP_CORE wxMaximizeEvent : public wxEvent { public: wxMaximizeEvent(int winid = 0) : wxEvent(winid, wxEVT_MAXIMIZE) { } virtual wxEvent *Clone() const wxOVERRIDE { return new wxMaximizeEvent(*this); } private: wxDECLARE_DYNAMIC_CLASS_NO_ASSIGN(wxMaximizeEvent); }; // Joystick event class /* wxEVT_JOY_BUTTON_DOWN, wxEVT_JOY_BUTTON_UP, wxEVT_JOY_MOVE, wxEVT_JOY_ZMOVE */ // Which joystick? Same as Windows ids so no conversion necessary. enum { wxJOYSTICK1, wxJOYSTICK2 }; // Which button is down? enum { wxJOY_BUTTON_ANY = -1, wxJOY_BUTTON1 = 1, wxJOY_BUTTON2 = 2, wxJOY_BUTTON3 = 4, wxJOY_BUTTON4 = 8 }; class WXDLLIMPEXP_CORE wxJoystickEvent : public wxEvent { protected: wxPoint m_pos; int m_zPosition; int m_buttonChange; // Which button changed? int m_buttonState; // Which buttons are down? int m_joyStick; // Which joystick? public: wxJoystickEvent(wxEventType type = wxEVT_NULL, int state = 0, int joystick = wxJOYSTICK1, int change = 0) : wxEvent(0, type), m_pos(), m_zPosition(0), m_buttonChange(change), m_buttonState(state), m_joyStick(joystick) { } wxJoystickEvent(const wxJoystickEvent& event) : wxEvent(event), m_pos(event.m_pos), m_zPosition(event.m_zPosition), m_buttonChange(event.m_buttonChange), m_buttonState(event.m_buttonState), m_joyStick(event.m_joyStick) { } wxPoint GetPosition() const { return m_pos; } int GetZPosition() const { return m_zPosition; } int GetButtonState() const { return m_buttonState; } int GetButtonChange() const { return m_buttonChange; } int GetButtonOrdinal() const { return wxCTZ(m_buttonChange); } int GetJoystick() const { return m_joyStick; } void SetJoystick(int stick) { m_joyStick = stick; } void SetButtonState(int state) { m_buttonState = state; } void SetButtonChange(int change) { m_buttonChange = change; } void SetPosition(const wxPoint& pos) { m_pos = pos; } void SetZPosition(int zPos) { m_zPosition = zPos; } // Was it a button event? (*doesn't* mean: is any button *down*?) bool IsButton() const { return ((GetEventType() == wxEVT_JOY_BUTTON_DOWN) || (GetEventType() == wxEVT_JOY_BUTTON_UP)); } // Was it a move event? bool IsMove() const { return (GetEventType() == wxEVT_JOY_MOVE); } // Was it a zmove event? bool IsZMove() const { return (GetEventType() == wxEVT_JOY_ZMOVE); } // Was it a down event from button 1, 2, 3, 4 or any? bool ButtonDown(int but = wxJOY_BUTTON_ANY) const { return ((GetEventType() == wxEVT_JOY_BUTTON_DOWN) && ((but == wxJOY_BUTTON_ANY) || (but == m_buttonChange))); } // Was it a up event from button 1, 2, 3 or any? bool ButtonUp(int but = wxJOY_BUTTON_ANY) const { return ((GetEventType() == wxEVT_JOY_BUTTON_UP) && ((but == wxJOY_BUTTON_ANY) || (but == m_buttonChange))); } // Was the given button 1,2,3,4 or any in Down state? bool ButtonIsDown(int but = wxJOY_BUTTON_ANY) const { return (((but == wxJOY_BUTTON_ANY) && (m_buttonState != 0)) || ((m_buttonState & but) == but)); } virtual wxEvent *Clone() const wxOVERRIDE { return new wxJoystickEvent(*this); } private: wxDECLARE_DYNAMIC_CLASS_NO_ASSIGN(wxJoystickEvent); }; // Drop files event class /* wxEVT_DROP_FILES */ class WXDLLIMPEXP_CORE wxDropFilesEvent : public wxEvent { public: int m_noFiles; wxPoint m_pos; wxString* m_files; wxDropFilesEvent(wxEventType type = wxEVT_NULL, int noFiles = 0, wxString *files = NULL) : wxEvent(0, type), m_noFiles(noFiles), m_pos(), m_files(files) { } // we need a copy ctor to avoid deleting m_files pointer twice wxDropFilesEvent(const wxDropFilesEvent& other) : wxEvent(other), m_noFiles(other.m_noFiles), m_pos(other.m_pos), m_files(NULL) { m_files = new wxString[m_noFiles]; for ( int n = 0; n < m_noFiles; n++ ) { m_files[n] = other.m_files[n]; } } virtual ~wxDropFilesEvent() { delete [] m_files; } wxPoint GetPosition() const { return m_pos; } int GetNumberOfFiles() const { return m_noFiles; } wxString *GetFiles() const { return m_files; } virtual wxEvent *Clone() const wxOVERRIDE { return new wxDropFilesEvent(*this); } private: wxDECLARE_DYNAMIC_CLASS_NO_ASSIGN(wxDropFilesEvent); }; // Update UI event /* wxEVT_UPDATE_UI */ // Whether to always send update events to windows, or // to only send update events to those with the // wxWS_EX_PROCESS_UI_UPDATES style. enum wxUpdateUIMode { // Send UI update events to all windows wxUPDATE_UI_PROCESS_ALL, // Send UI update events to windows that have // the wxWS_EX_PROCESS_UI_UPDATES flag specified wxUPDATE_UI_PROCESS_SPECIFIED }; class WXDLLIMPEXP_CORE wxUpdateUIEvent : public wxCommandEvent { public: wxUpdateUIEvent(wxWindowID commandId = 0) : wxCommandEvent(wxEVT_UPDATE_UI, commandId) { m_checked = m_enabled = m_shown = m_setEnabled = m_setShown = m_setText = m_setChecked = false; } wxUpdateUIEvent(const wxUpdateUIEvent& event) : wxCommandEvent(event), m_checked(event.m_checked), m_enabled(event.m_enabled), m_shown(event.m_shown), m_setEnabled(event.m_setEnabled), m_setShown(event.m_setShown), m_setText(event.m_setText), m_setChecked(event.m_setChecked), m_text(event.m_text) { } bool GetChecked() const { return m_checked; } bool GetEnabled() const { return m_enabled; } bool GetShown() const { return m_shown; } wxString GetText() const { return m_text; } bool GetSetText() const { return m_setText; } bool GetSetChecked() const { return m_setChecked; } bool GetSetEnabled() const { return m_setEnabled; } bool GetSetShown() const { return m_setShown; } void Check(bool check) { m_checked = check; m_setChecked = true; } void Enable(bool enable) { m_enabled = enable; m_setEnabled = true; } void Show(bool show) { m_shown = show; m_setShown = true; } void SetText(const wxString& text) { m_text = text; m_setText = true; } // Sets the interval between updates in milliseconds. // Set to -1 to disable updates, or to 0 to update as frequently as possible. static void SetUpdateInterval(long updateInterval) { sm_updateInterval = updateInterval; } // Returns the current interval between updates in milliseconds static long GetUpdateInterval() { return sm_updateInterval; } // Can we update this window? static bool CanUpdate(wxWindowBase *win); // Reset the update time to provide a delay until the next // time we should update static void ResetUpdateTime(); // Specify how wxWidgets will send update events: to // all windows, or only to those which specify that they // will process the events. static void SetMode(wxUpdateUIMode mode) { sm_updateMode = mode; } // Returns the UI update mode static wxUpdateUIMode GetMode() { return sm_updateMode; } virtual wxEvent *Clone() const wxOVERRIDE { return new wxUpdateUIEvent(*this); } protected: bool m_checked; bool m_enabled; bool m_shown; bool m_setEnabled; bool m_setShown; bool m_setText; bool m_setChecked; wxString m_text; #if wxUSE_LONGLONG static wxLongLong sm_lastUpdate; #endif static long sm_updateInterval; static wxUpdateUIMode sm_updateMode; private: wxDECLARE_DYNAMIC_CLASS_NO_ASSIGN(wxUpdateUIEvent); }; /* wxEVT_SYS_COLOUR_CHANGED */ // TODO: shouldn't all events record the window ID? class WXDLLIMPEXP_CORE wxSysColourChangedEvent : public wxEvent { public: wxSysColourChangedEvent() : wxEvent(0, wxEVT_SYS_COLOUR_CHANGED) { } virtual wxEvent *Clone() const wxOVERRIDE { return new wxSysColourChangedEvent(*this); } private: wxDECLARE_DYNAMIC_CLASS_NO_ASSIGN(wxSysColourChangedEvent); }; /* wxEVT_MOUSE_CAPTURE_CHANGED The window losing the capture receives this message (even if it released the capture itself). */ class WXDLLIMPEXP_CORE wxMouseCaptureChangedEvent : public wxEvent { public: wxMouseCaptureChangedEvent(wxWindowID winid = 0, wxWindow* gainedCapture = NULL) : wxEvent(winid, wxEVT_MOUSE_CAPTURE_CHANGED), m_gainedCapture(gainedCapture) { } wxMouseCaptureChangedEvent(const wxMouseCaptureChangedEvent& event) : wxEvent(event), m_gainedCapture(event.m_gainedCapture) { } virtual wxEvent *Clone() const wxOVERRIDE { return new wxMouseCaptureChangedEvent(*this); } wxWindow* GetCapturedWindow() const { return m_gainedCapture; } private: wxWindow* m_gainedCapture; wxDECLARE_DYNAMIC_CLASS_NO_ASSIGN(wxMouseCaptureChangedEvent); }; /* wxEVT_MOUSE_CAPTURE_LOST The window losing the capture receives this message, unless it released it it itself or unless wxWindow::CaptureMouse was called on another window (and so capture will be restored when the new capturer releases it). */ class WXDLLIMPEXP_CORE wxMouseCaptureLostEvent : public wxEvent { public: wxMouseCaptureLostEvent(wxWindowID winid = 0) : wxEvent(winid, wxEVT_MOUSE_CAPTURE_LOST) {} wxMouseCaptureLostEvent(const wxMouseCaptureLostEvent& event) : wxEvent(event) {} virtual wxEvent *Clone() const wxOVERRIDE { return new wxMouseCaptureLostEvent(*this); } wxDECLARE_DYNAMIC_CLASS_NO_ASSIGN(wxMouseCaptureLostEvent); }; /* wxEVT_DISPLAY_CHANGED */ class WXDLLIMPEXP_CORE wxDisplayChangedEvent : public wxEvent { private: wxDECLARE_DYNAMIC_CLASS_NO_ASSIGN(wxDisplayChangedEvent); public: wxDisplayChangedEvent() : wxEvent(0, wxEVT_DISPLAY_CHANGED) { } virtual wxEvent *Clone() const wxOVERRIDE { return new wxDisplayChangedEvent(*this); } }; /* wxEVT_PALETTE_CHANGED */ class WXDLLIMPEXP_CORE wxPaletteChangedEvent : public wxEvent { public: wxPaletteChangedEvent(wxWindowID winid = 0) : wxEvent(winid, wxEVT_PALETTE_CHANGED), m_changedWindow(NULL) { } wxPaletteChangedEvent(const wxPaletteChangedEvent& event) : wxEvent(event), m_changedWindow(event.m_changedWindow) { } void SetChangedWindow(wxWindow* win) { m_changedWindow = win; } wxWindow* GetChangedWindow() const { return m_changedWindow; } virtual wxEvent *Clone() const wxOVERRIDE { return new wxPaletteChangedEvent(*this); } protected: wxWindow* m_changedWindow; private: wxDECLARE_DYNAMIC_CLASS_NO_ASSIGN(wxPaletteChangedEvent); }; /* wxEVT_QUERY_NEW_PALETTE Indicates the window is getting keyboard focus and should re-do its palette. */ class WXDLLIMPEXP_CORE wxQueryNewPaletteEvent : public wxEvent { public: wxQueryNewPaletteEvent(wxWindowID winid = 0) : wxEvent(winid, wxEVT_QUERY_NEW_PALETTE), m_paletteRealized(false) { } wxQueryNewPaletteEvent(const wxQueryNewPaletteEvent& event) : wxEvent(event), m_paletteRealized(event.m_paletteRealized) { } // App sets this if it changes the palette. void SetPaletteRealized(bool realized) { m_paletteRealized = realized; } bool GetPaletteRealized() const { return m_paletteRealized; } virtual wxEvent *Clone() const wxOVERRIDE { return new wxQueryNewPaletteEvent(*this); } protected: bool m_paletteRealized; private: wxDECLARE_DYNAMIC_CLASS_NO_ASSIGN(wxQueryNewPaletteEvent); }; /* Event generated by dialog navigation keys wxEVT_NAVIGATION_KEY */ // NB: don't derive from command event to avoid being propagated to the parent class WXDLLIMPEXP_CORE wxNavigationKeyEvent : public wxEvent { public: wxNavigationKeyEvent() : wxEvent(0, wxEVT_NAVIGATION_KEY), m_flags(IsForward | FromTab), // defaults are for TAB m_focus(NULL) { m_propagationLevel = wxEVENT_PROPAGATE_NONE; } wxNavigationKeyEvent(const wxNavigationKeyEvent& event) : wxEvent(event), m_flags(event.m_flags), m_focus(event.m_focus) { } // direction: forward (true) or backward (false) bool GetDirection() const { return (m_flags & IsForward) != 0; } void SetDirection(bool bForward) { if ( bForward ) m_flags |= IsForward; else m_flags &= ~IsForward; } // it may be a window change event (MDI, notebook pages...) or a control // change event bool IsWindowChange() const { return (m_flags & WinChange) != 0; } void SetWindowChange(bool bIs) { if ( bIs ) m_flags |= WinChange; else m_flags &= ~WinChange; } // Set to true under MSW if the event was generated using the tab key. // This is required for proper navogation over radio buttons bool IsFromTab() const { return (m_flags & FromTab) != 0; } void SetFromTab(bool bIs) { if ( bIs ) m_flags |= FromTab; else m_flags &= ~FromTab; } // the child which has the focus currently (may be NULL - use // wxWindow::FindFocus then) wxWindow* GetCurrentFocus() const { return m_focus; } void SetCurrentFocus(wxWindow *win) { m_focus = win; } // Set flags void SetFlags(long flags) { m_flags = flags; } virtual wxEvent *Clone() const wxOVERRIDE { return new wxNavigationKeyEvent(*this); } enum wxNavigationKeyEventFlags { IsBackward = 0x0000, IsForward = 0x0001, WinChange = 0x0002, FromTab = 0x0004 }; long m_flags; wxWindow *m_focus; private: wxDECLARE_DYNAMIC_CLASS_NO_ASSIGN(wxNavigationKeyEvent); }; // Window creation/destruction events: the first is sent as soon as window is // created (i.e. the underlying GUI object exists), but when the C++ object is // fully initialized (so virtual functions may be called). The second, // wxEVT_DESTROY, is sent right before the window is destroyed - again, it's // still safe to call virtual functions at this moment /* wxEVT_CREATE wxEVT_DESTROY */ class WXDLLIMPEXP_CORE wxWindowCreateEvent : public wxCommandEvent { public: wxWindowCreateEvent(wxWindow *win = NULL); wxWindow *GetWindow() const { return (wxWindow *)GetEventObject(); } virtual wxEvent *Clone() const wxOVERRIDE { return new wxWindowCreateEvent(*this); } private: wxDECLARE_DYNAMIC_CLASS_NO_ASSIGN(wxWindowCreateEvent); }; class WXDLLIMPEXP_CORE wxWindowDestroyEvent : public wxCommandEvent { public: wxWindowDestroyEvent(wxWindow *win = NULL); wxWindow *GetWindow() const { return (wxWindow *)GetEventObject(); } virtual wxEvent *Clone() const wxOVERRIDE { return new wxWindowDestroyEvent(*this); } private: wxDECLARE_DYNAMIC_CLASS_NO_ASSIGN(wxWindowDestroyEvent); }; // A help event is sent when the user clicks on a window in context-help mode. /* wxEVT_HELP wxEVT_DETAILED_HELP */ class WXDLLIMPEXP_CORE wxHelpEvent : public wxCommandEvent { public: // how was this help event generated? enum Origin { Origin_Unknown, // unrecognized event source Origin_Keyboard, // event generated from F1 key press Origin_HelpButton // event from [?] button on the title bar (Windows) }; wxHelpEvent(wxEventType type = wxEVT_NULL, wxWindowID winid = 0, const wxPoint& pt = wxDefaultPosition, Origin origin = Origin_Unknown) : wxCommandEvent(type, winid), m_pos(pt), m_origin(GuessOrigin(origin)) { } wxHelpEvent(const wxHelpEvent& event) : wxCommandEvent(event), m_pos(event.m_pos), m_target(event.m_target), m_link(event.m_link), m_origin(event.m_origin) { } // Position of event (in screen coordinates) const wxPoint& GetPosition() const { return m_pos; } void SetPosition(const wxPoint& pos) { m_pos = pos; } // Optional link to further help const wxString& GetLink() const { return m_link; } void SetLink(const wxString& link) { m_link = link; } // Optional target to display help in. E.g. a window specification const wxString& GetTarget() const { return m_target; } void SetTarget(const wxString& target) { m_target = target; } virtual wxEvent *Clone() const wxOVERRIDE { return new wxHelpEvent(*this); } // optional indication of the event source Origin GetOrigin() const { return m_origin; } void SetOrigin(Origin origin) { m_origin = origin; } protected: wxPoint m_pos; wxString m_target; wxString m_link; Origin m_origin; // we can try to guess the event origin ourselves, even if none is // specified in the ctor static Origin GuessOrigin(Origin origin); private: wxDECLARE_DYNAMIC_CLASS_NO_ASSIGN(wxHelpEvent); }; // A Clipboard Text event is sent when a window intercepts text copy/cut/paste // message, i.e. the user has cut/copied/pasted data from/into a text control // via ctrl-C/X/V, ctrl/shift-del/insert, a popup menu command, etc. // NOTE : under windows these events are *NOT* generated automatically // for a Rich Edit text control. /* wxEVT_TEXT_COPY wxEVT_TEXT_CUT wxEVT_TEXT_PASTE */ class WXDLLIMPEXP_CORE wxClipboardTextEvent : public wxCommandEvent { public: wxClipboardTextEvent(wxEventType type = wxEVT_NULL, wxWindowID winid = 0) : wxCommandEvent(type, winid) { } wxClipboardTextEvent(const wxClipboardTextEvent& event) : wxCommandEvent(event) { } virtual wxEvent *Clone() const wxOVERRIDE { return new wxClipboardTextEvent(*this); } private: wxDECLARE_DYNAMIC_CLASS_NO_ASSIGN(wxClipboardTextEvent); }; // A Context event is sent when the user right clicks on a window or // presses Shift-F10 // NOTE : Under windows this is a repackaged WM_CONTETXMENU message // Under other systems it may have to be generated from a right click event /* wxEVT_CONTEXT_MENU */ class WXDLLIMPEXP_CORE wxContextMenuEvent : public wxCommandEvent { public: wxContextMenuEvent(wxEventType type = wxEVT_NULL, wxWindowID winid = 0, const wxPoint& pt = wxDefaultPosition) : wxCommandEvent(type, winid), m_pos(pt) { } wxContextMenuEvent(const wxContextMenuEvent& event) : wxCommandEvent(event), m_pos(event.m_pos) { } // Position of event (in screen coordinates) const wxPoint& GetPosition() const { return m_pos; } void SetPosition(const wxPoint& pos) { m_pos = pos; } virtual wxEvent *Clone() const wxOVERRIDE { return new wxContextMenuEvent(*this); } protected: wxPoint m_pos; private: wxDECLARE_DYNAMIC_CLASS_NO_ASSIGN(wxContextMenuEvent); }; /* TODO wxEVT_SETTING_CHANGED, // WM_WININICHANGE // wxEVT_FONT_CHANGED, // WM_FONTCHANGE: roll into wxEVT_SETTING_CHANGED, but remember to propagate // wxEVT_FONT_CHANGED to all other windows (maybe). wxEVT_DRAW_ITEM, // Leave these three as virtual functions in wxControl?? Platform-specific. wxEVT_MEASURE_ITEM, wxEVT_COMPARE_ITEM */ #endif // wxUSE_GUI // ============================================================================ // event handler and related classes // ============================================================================ // struct containing the members common to static and dynamic event tables // entries struct WXDLLIMPEXP_BASE wxEventTableEntryBase { wxEventTableEntryBase(int winid, int idLast, wxEventFunctor* fn, wxObject *data) : m_id(winid), m_lastId(idLast), m_fn(fn), m_callbackUserData(data) { wxASSERT_MSG( idLast == wxID_ANY || winid <= idLast, "invalid IDs range: lower bound > upper bound" ); } wxEventTableEntryBase( const wxEventTableEntryBase &entry ) : m_id( entry.m_id ), m_lastId( entry.m_lastId ), m_fn( entry.m_fn ), m_callbackUserData( entry.m_callbackUserData ) { // This is a 'hack' to ensure that only one instance tries to delete // the functor pointer. It is safe as long as the only place where the // copy constructor is being called is when the static event tables are // being initialized (a temporary instance is created and then this // constructor is called). const_cast<wxEventTableEntryBase&>( entry ).m_fn = NULL; } ~wxEventTableEntryBase() { delete m_fn; } // the range of ids for this entry: if m_lastId == wxID_ANY, the range // consists only of m_id, otherwise it is m_id..m_lastId inclusive int m_id, m_lastId; // function/method/functor to call wxEventFunctor* m_fn; // arbitrary user data associated with the callback wxObject* m_callbackUserData; private: wxDECLARE_NO_ASSIGN_CLASS(wxEventTableEntryBase); }; // an entry from a static event table struct WXDLLIMPEXP_BASE wxEventTableEntry : public wxEventTableEntryBase { wxEventTableEntry(const int& evType, int winid, int idLast, wxEventFunctor* fn, wxObject *data) : wxEventTableEntryBase(winid, idLast, fn, data), m_eventType(evType) { } // the reference to event type: this allows us to not care about the // (undefined) order in which the event table entries and the event types // are initialized: initially the value of this reference might be // invalid, but by the time it is used for the first time, all global // objects will have been initialized (including the event type constants) // and so it will have the correct value when it is needed const int& m_eventType; private: wxDECLARE_NO_ASSIGN_CLASS(wxEventTableEntry); }; // an entry used in dynamic event table managed by wxEvtHandler::Connect() struct WXDLLIMPEXP_BASE wxDynamicEventTableEntry : public wxEventTableEntryBase { wxDynamicEventTableEntry(int evType, int winid, int idLast, wxEventFunctor* fn, wxObject *data) : wxEventTableEntryBase(winid, idLast, fn, data), m_eventType(evType) { } // not a reference here as we can't keep a reference to a temporary int // created to wrap the constant value typically passed to Connect() - nor // do we need it int m_eventType; private: wxDECLARE_NO_ASSIGN_CLASS(wxDynamicEventTableEntry); }; // ---------------------------------------------------------------------------- // wxEventTable: an array of event entries terminated with {0, 0, 0, 0, 0} // ---------------------------------------------------------------------------- struct WXDLLIMPEXP_BASE wxEventTable { const wxEventTable *baseTable; // base event table (next in chain) const wxEventTableEntry *entries; // bottom of entry array }; // ---------------------------------------------------------------------------- // wxEventHashTable: a helper of wxEvtHandler to speed up wxEventTable lookups. // ---------------------------------------------------------------------------- WX_DEFINE_ARRAY_PTR(const wxEventTableEntry*, wxEventTableEntryPointerArray); class WXDLLIMPEXP_BASE wxEventHashTable { private: // Internal data structs struct EventTypeTable { wxEventType eventType; wxEventTableEntryPointerArray eventEntryTable; }; typedef EventTypeTable* EventTypeTablePointer; public: // Constructor, needs the event table it needs to hash later on. // Note: hashing of the event table is not done in the constructor as it // can be that the event table is not yet full initialize, the hash // will gets initialized when handling the first event look-up request. wxEventHashTable(const wxEventTable &table); // Destructor. ~wxEventHashTable(); // Handle the given event, in other words search the event table hash // and call self->ProcessEvent() if a match was found. bool HandleEvent(wxEvent& event, wxEvtHandler *self); // Clear table void Clear(); #if wxUSE_MEMORY_TRACING // Clear all tables: only used to work around problems in memory tracing // code static void ClearAll(); #endif // wxUSE_MEMORY_TRACING protected: // Init the hash table with the entries of the static event table. void InitHashTable(); // Helper function of InitHashTable() to insert 1 entry into the hash table. void AddEntry(const wxEventTableEntry &entry); // Allocate and init with null pointers the base hash table. void AllocEventTypeTable(size_t size); // Grow the hash table in size and transfer all items currently // in the table to the correct location in the new table. void GrowEventTypeTable(); protected: const wxEventTable &m_table; bool m_rebuildHash; size_t m_size; EventTypeTablePointer *m_eventTypeTable; static wxEventHashTable* sm_first; wxEventHashTable* m_previous; wxEventHashTable* m_next; wxDECLARE_NO_COPY_CLASS(wxEventHashTable); }; // ---------------------------------------------------------------------------- // wxEvtHandler: the base class for all objects handling wxWidgets events // ---------------------------------------------------------------------------- class WXDLLIMPEXP_BASE wxEvtHandler : public wxObject , public wxTrackable { public: wxEvtHandler(); virtual ~wxEvtHandler(); // Event handler chain // ------------------- wxEvtHandler *GetNextHandler() const { return m_nextHandler; } wxEvtHandler *GetPreviousHandler() const { return m_previousHandler; } virtual void SetNextHandler(wxEvtHandler *handler) { m_nextHandler = handler; } virtual void SetPreviousHandler(wxEvtHandler *handler) { m_previousHandler = handler; } void SetEvtHandlerEnabled(bool enabled) { m_enabled = enabled; } bool GetEvtHandlerEnabled() const { return m_enabled; } void Unlink(); bool IsUnlinked() const; // Global event filters // -------------------- // Add an event filter whose FilterEvent() method will be called for each // and every event processed by wxWidgets. The filters are called in LIFO // order and wxApp is registered as an event filter by default. The pointer // must remain valid until it's removed with RemoveFilter() and is not // deleted by wxEvtHandler. static void AddFilter(wxEventFilter* filter); // Remove a filter previously installed with AddFilter(). static void RemoveFilter(wxEventFilter* filter); // Event queuing and processing // ---------------------------- // Process an event right now: this can only be called from the main // thread, use QueueEvent() for scheduling the events for // processing from other threads. virtual bool ProcessEvent(wxEvent& event); // Process an event by calling ProcessEvent and handling any exceptions // thrown by event handlers. It's mostly useful when processing wx events // when called from C code (e.g. in GTK+ callback) when the exception // wouldn't correctly propagate to wxEventLoop. bool SafelyProcessEvent(wxEvent& event); // NOTE: uses ProcessEvent() // This method tries to process the event in this event handler, including // any preprocessing done by TryBefore() and all the handlers chained to // it, but excluding the post-processing done in TryAfter(). // // It is meant to be called from ProcessEvent() only and is not virtual, // additional event handlers can be hooked into the normal event processing // logic using TryBefore() and TryAfter() hooks. // // You can also call it yourself to forward an event to another handler but // without propagating it upwards if it's unhandled (this is usually // unwanted when forwarding as the original handler would already do it if // needed normally). bool ProcessEventLocally(wxEvent& event); // Schedule the given event to be processed later. It takes ownership of // the event pointer, i.e. it will be deleted later. This is safe to call // from multiple threads although you still need to ensure that wxString // fields of the event object are deep copies and not use the same string // buffer as other wxString objects in this thread. virtual void QueueEvent(wxEvent *event); // Add an event to be processed later: notice that this function is not // safe to call from threads other than main, use QueueEvent() virtual void AddPendingEvent(const wxEvent& event) { // notice that the thread-safety problem comes from the fact that // Clone() doesn't make deep copies of wxString fields of wxEvent // object and so the same wxString could be used from both threads when // the event object is destroyed in this one -- QueueEvent() avoids // this problem as the event pointer is not used any more in this // thread at all after it is called. QueueEvent(event.Clone()); } void ProcessPendingEvents(); // NOTE: uses ProcessEvent() void DeletePendingEvents(); #if wxUSE_THREADS bool ProcessThreadEvent(const wxEvent& event); // NOTE: uses AddPendingEvent(); call only from secondary threads #endif #if wxUSE_EXCEPTIONS // This is a private function which handles any exceptions arising during // the execution of user-defined code called in the event loop context by // forwarding them to wxApp::OnExceptionInMainLoop() and, if it rethrows, // to wxApp::OnUnhandledException(). In any case this function ensures that // no exceptions ever escape from it and so is useful to call at module // boundary. // // It must be only called when handling an active exception. static void WXConsumeException(); #endif // wxUSE_EXCEPTIONS #ifdef wxHAS_CALL_AFTER // Asynchronous method calls: these methods schedule the given method // pointer for a later call (during the next idle event loop iteration). // // Notice that the method is called on this object itself, so the object // CallAfter() is called on must have the correct dynamic type. // // These method can be used from another thread. template <typename T> void CallAfter(void (T::*method)()) { QueueEvent( new wxAsyncMethodCallEvent0<T>(static_cast<T*>(this), method) ); } // Notice that we use P1 and not T1 for the parameter to allow passing // parameters that are convertible to the type taken by the method // instead of being exactly the same, to be closer to the usual method call // semantics. template <typename T, typename T1, typename P1> void CallAfter(void (T::*method)(T1 x1), P1 x1) { QueueEvent( new wxAsyncMethodCallEvent1<T, T1>( static_cast<T*>(this), method, x1) ); } template <typename T, typename T1, typename T2, typename P1, typename P2> void CallAfter(void (T::*method)(T1 x1, T2 x2), P1 x1, P2 x2) { QueueEvent( new wxAsyncMethodCallEvent2<T, T1, T2>( static_cast<T*>(this), method, x1, x2) ); } template <typename T> void CallAfter(const T& fn) { QueueEvent(new wxAsyncMethodCallEventFunctor<T>(this, fn)); } #endif // wxHAS_CALL_AFTER // Connecting and disconnecting // ---------------------------- // These functions are used for old, untyped, event handlers and don't // check that the type of the function passed to them actually matches the // type of the event. They also only allow connecting events to methods of // wxEvtHandler-derived classes. // // The template Connect() methods below are safer and allow connecting // events to arbitrary functions or functors -- but require compiler // support for templates. // Dynamic association of a member function handler with the event handler, // winid and event type void Connect(int winid, int lastId, wxEventType eventType, wxObjectEventFunction func, wxObject *userData = NULL, wxEvtHandler *eventSink = NULL) { DoBind(winid, lastId, eventType, wxNewEventFunctor(eventType, func, eventSink), userData); } // Convenience function: take just one id void Connect(int winid, wxEventType eventType, wxObjectEventFunction func, wxObject *userData = NULL, wxEvtHandler *eventSink = NULL) { Connect(winid, wxID_ANY, eventType, func, userData, eventSink); } // Even more convenient: without id (same as using id of wxID_ANY) void Connect(wxEventType eventType, wxObjectEventFunction func, wxObject *userData = NULL, wxEvtHandler *eventSink = NULL) { Connect(wxID_ANY, wxID_ANY, eventType, func, userData, eventSink); } bool Disconnect(int winid, int lastId, wxEventType eventType, wxObjectEventFunction func = NULL, wxObject *userData = NULL, wxEvtHandler *eventSink = NULL) { return DoUnbind(winid, lastId, eventType, wxMakeEventFunctor(eventType, func, eventSink), userData ); } bool Disconnect(int winid = wxID_ANY, wxEventType eventType = wxEVT_NULL, wxObjectEventFunction func = NULL, wxObject *userData = NULL, wxEvtHandler *eventSink = NULL) { return Disconnect(winid, wxID_ANY, eventType, func, userData, eventSink); } bool Disconnect(wxEventType eventType, wxObjectEventFunction func, wxObject *userData = NULL, wxEvtHandler *eventSink = NULL) { return Disconnect(wxID_ANY, eventType, func, userData, eventSink); } // Bind functions to an event: template <typename EventTag, typename EventArg> void Bind(const EventTag& eventType, void (*function)(EventArg &), int winid = wxID_ANY, int lastId = wxID_ANY, wxObject *userData = NULL) { DoBind(winid, lastId, eventType, wxNewEventFunctor(eventType, function), userData); } template <typename EventTag, typename EventArg> bool Unbind(const EventTag& eventType, void (*function)(EventArg &), int winid = wxID_ANY, int lastId = wxID_ANY, wxObject *userData = NULL) { return DoUnbind(winid, lastId, eventType, wxMakeEventFunctor(eventType, function), userData); } // Bind functors to an event: template <typename EventTag, typename Functor> void Bind(const EventTag& eventType, const Functor &functor, int winid = wxID_ANY, int lastId = wxID_ANY, wxObject *userData = NULL) { DoBind(winid, lastId, eventType, wxNewEventFunctor(eventType, functor), userData); } template <typename EventTag, typename Functor> bool Unbind(const EventTag& eventType, const Functor &functor, int winid = wxID_ANY, int lastId = wxID_ANY, wxObject *userData = NULL) { return DoUnbind(winid, lastId, eventType, wxMakeEventFunctor(eventType, functor), userData); } // Bind a method of a class (called on the specified handler which must // be convertible to this class) object to an event: template <typename EventTag, typename Class, typename EventArg, typename EventHandler> void Bind(const EventTag &eventType, void (Class::*method)(EventArg &), EventHandler *handler, int winid = wxID_ANY, int lastId = wxID_ANY, wxObject *userData = NULL) { DoBind(winid, lastId, eventType, wxNewEventFunctor(eventType, method, handler), userData); } template <typename EventTag, typename Class, typename EventArg, typename EventHandler> bool Unbind(const EventTag &eventType, void (Class::*method)(EventArg&), EventHandler *handler, int winid = wxID_ANY, int lastId = wxID_ANY, wxObject *userData = NULL ) { return DoUnbind(winid, lastId, eventType, wxMakeEventFunctor(eventType, method, handler), userData); } // User data can be associated with each wxEvtHandler void SetClientObject( wxClientData *data ) { DoSetClientObject(data); } wxClientData *GetClientObject() const { return DoGetClientObject(); } void SetClientData( void *data ) { DoSetClientData(data); } void *GetClientData() const { return DoGetClientData(); } // implementation from now on // -------------------------- // check if the given event table entry matches this event by id (the check // for the event type should be done by caller) and call the handler if it // does // // return true if the event was processed, false otherwise (no match or the // handler decided to skip the event) static bool ProcessEventIfMatchesId(const wxEventTableEntryBase& tableEntry, wxEvtHandler *handler, wxEvent& event); // Allow iterating over all connected dynamic event handlers: you must pass // the same "cookie" to GetFirst() and GetNext() and call them until null // is returned. // // These functions are for internal use only. wxDynamicEventTableEntry* GetFirstDynamicEntry(size_t& cookie) const; wxDynamicEventTableEntry* GetNextDynamicEntry(size_t& cookie) const; virtual bool SearchEventTable(wxEventTable& table, wxEvent& event); bool SearchDynamicEventTable( wxEvent& event ); // Avoid problems at exit by cleaning up static hash table gracefully void ClearEventHashTable() { GetEventHashTable().Clear(); } void OnSinkDestroyed( wxEvtHandler *sink ); private: void DoBind(int winid, int lastId, wxEventType eventType, wxEventFunctor *func, wxObject* userData = NULL); bool DoUnbind(int winid, int lastId, wxEventType eventType, const wxEventFunctor& func, wxObject *userData = NULL); static const wxEventTableEntry sm_eventTableEntries[]; protected: // hooks for wxWindow used by ProcessEvent() // ----------------------------------------- // this one is called before trying our own event table to allow plugging // in the event handlers overriding the default logic, this is used by e.g. // validators. virtual bool TryBefore(wxEvent& event); // This one is not a hook but just a helper which looks up the handler in // this object itself. // // It is called from ProcessEventLocally() and normally shouldn't be called // directly as doing it would ignore any chained event handlers bool TryHereOnly(wxEvent& event); // Another helper which simply calls pre-processing hook and then tries to // handle the event at this handler level. bool TryBeforeAndHere(wxEvent& event) { return TryBefore(event) || TryHereOnly(event); } // this one is called after failing to find the event handle in our own // table to give a chance to the other windows to process it // // base class implementation passes the event to wxTheApp virtual bool TryAfter(wxEvent& event); #if WXWIN_COMPATIBILITY_2_8 // deprecated method: override TryBefore() instead of this one wxDEPRECATED_BUT_USED_INTERNALLY_INLINE( virtual bool TryValidator(wxEvent& WXUNUSED(event)), return false; ) wxDEPRECATED_BUT_USED_INTERNALLY_INLINE( virtual bool TryParent(wxEvent& event), return DoTryApp(event); ) #endif // WXWIN_COMPATIBILITY_2_8 // Overriding this method allows filtering the event handlers dynamically // connected to this object. If this method returns false, the handler is // not connected at all. If it returns true, it is connected using the // possibly modified fields of the given entry. virtual bool OnDynamicBind(wxDynamicEventTableEntry& WXUNUSED(entry)) { return true; } static const wxEventTable sm_eventTable; virtual const wxEventTable *GetEventTable() const; static wxEventHashTable sm_eventHashTable; virtual wxEventHashTable& GetEventHashTable() const; wxEvtHandler* m_nextHandler; wxEvtHandler* m_previousHandler; typedef wxVector<wxDynamicEventTableEntry*> DynamicEvents; DynamicEvents* m_dynamicEvents; wxList* m_pendingEvents; #if wxUSE_THREADS // critical section protecting m_pendingEvents wxCriticalSection m_pendingEventsLock; #endif // wxUSE_THREADS // Is event handler enabled? bool m_enabled; // The user data: either an object which will be deleted by the container // when it's deleted or some raw pointer which we do nothing with - only // one type of data can be used with the given window (i.e. you cannot set // the void data and then associate the container with wxClientData or vice // versa) union { wxClientData *m_clientObject; void *m_clientData; }; // what kind of data do we have? wxClientDataType m_clientDataType; // client data accessors virtual void DoSetClientObject( wxClientData *data ); virtual wxClientData *DoGetClientObject() const; virtual void DoSetClientData( void *data ); virtual void *DoGetClientData() const; // Search tracker objects for event connection with this sink wxEventConnectionRef *FindRefInTrackerList(wxEvtHandler *handler); private: // pass the event to wxTheApp instance, called from TryAfter() bool DoTryApp(wxEvent& event); // try to process events in all handlers chained to this one bool DoTryChain(wxEvent& event); // Head of the event filter linked list. static wxEventFilter* ms_filterList; wxDECLARE_DYNAMIC_CLASS_NO_COPY(wxEvtHandler); }; WX_DEFINE_ARRAY_WITH_DECL_PTR(wxEvtHandler *, wxEvtHandlerArray, class WXDLLIMPEXP_BASE); // Define an inline method of wxObjectEventFunctor which couldn't be defined // before wxEvtHandler declaration: at least Sun CC refuses to compile function // calls through pointer to member for forward-declared classes (see #12452). inline void wxObjectEventFunctor::operator()(wxEvtHandler *handler, wxEvent& event) { wxEvtHandler * const realHandler = m_handler ? m_handler : handler; (realHandler->*m_method)(event); } // ---------------------------------------------------------------------------- // wxEventConnectionRef represents all connections between two event handlers // and enables automatic disconnect when an event handler sink goes out of // scope. Each connection/disconnect increases/decreases ref count, and // when it reaches zero the node goes out of scope. // ---------------------------------------------------------------------------- class wxEventConnectionRef : public wxTrackerNode { public: wxEventConnectionRef() : m_src(NULL), m_sink(NULL), m_refCount(0) { } wxEventConnectionRef(wxEvtHandler *src, wxEvtHandler *sink) : m_src(src), m_sink(sink), m_refCount(1) { m_sink->AddNode(this); } // The sink is being destroyed virtual void OnObjectDestroy( ) wxOVERRIDE { if ( m_src ) m_src->OnSinkDestroyed( m_sink ); delete this; } virtual wxEventConnectionRef *ToEventConnection() wxOVERRIDE { return this; } void IncRef() { m_refCount++; } void DecRef() { if ( !--m_refCount ) { // The sink holds the only external pointer to this object if ( m_sink ) m_sink->RemoveNode(this); delete this; } } private: wxEvtHandler *m_src, *m_sink; int m_refCount; friend class wxEvtHandler; wxDECLARE_NO_ASSIGN_CLASS(wxEventConnectionRef); }; // Post a message to the given event handler which will be processed during the // next event loop iteration. // // Notice that this one is not thread-safe, use wxQueueEvent() inline void wxPostEvent(wxEvtHandler *dest, const wxEvent& event) { wxCHECK_RET( dest, "need an object to post event to" ); dest->AddPendingEvent(event); } // Wrapper around wxEvtHandler::QueueEvent(): adds an event for later // processing, unlike wxPostEvent it is safe to use from different thread even // for events with wxString members inline void wxQueueEvent(wxEvtHandler *dest, wxEvent *event) { wxCHECK_RET( dest, "need an object to queue event for" ); dest->QueueEvent(event); } typedef void (wxEvtHandler::*wxEventFunction)(wxEvent&); typedef void (wxEvtHandler::*wxIdleEventFunction)(wxIdleEvent&); typedef void (wxEvtHandler::*wxThreadEventFunction)(wxThreadEvent&); #define wxEventHandler(func) \ wxEVENT_HANDLER_CAST(wxEventFunction, func) #define wxIdleEventHandler(func) \ wxEVENT_HANDLER_CAST(wxIdleEventFunction, func) #define wxThreadEventHandler(func) \ wxEVENT_HANDLER_CAST(wxThreadEventFunction, func) #if wxUSE_GUI // ---------------------------------------------------------------------------- // wxEventBlocker: helper class to temporarily disable event handling for a window // ---------------------------------------------------------------------------- class WXDLLIMPEXP_CORE wxEventBlocker : public wxEvtHandler { public: wxEventBlocker(wxWindow *win, wxEventType type = wxEVT_ANY); virtual ~wxEventBlocker(); void Block(wxEventType type) { m_eventsToBlock.push_back(type); } virtual bool ProcessEvent(wxEvent& event) wxOVERRIDE; protected: wxArrayInt m_eventsToBlock; wxWindow *m_window; wxDECLARE_NO_COPY_CLASS(wxEventBlocker); }; typedef void (wxEvtHandler::*wxCommandEventFunction)(wxCommandEvent&); typedef void (wxEvtHandler::*wxScrollEventFunction)(wxScrollEvent&); typedef void (wxEvtHandler::*wxScrollWinEventFunction)(wxScrollWinEvent&); typedef void (wxEvtHandler::*wxSizeEventFunction)(wxSizeEvent&); typedef void (wxEvtHandler::*wxMoveEventFunction)(wxMoveEvent&); typedef void (wxEvtHandler::*wxPaintEventFunction)(wxPaintEvent&); typedef void (wxEvtHandler::*wxNcPaintEventFunction)(wxNcPaintEvent&); typedef void (wxEvtHandler::*wxEraseEventFunction)(wxEraseEvent&); typedef void (wxEvtHandler::*wxMouseEventFunction)(wxMouseEvent&); typedef void (wxEvtHandler::*wxCharEventFunction)(wxKeyEvent&); typedef void (wxEvtHandler::*wxFocusEventFunction)(wxFocusEvent&); typedef void (wxEvtHandler::*wxChildFocusEventFunction)(wxChildFocusEvent&); typedef void (wxEvtHandler::*wxActivateEventFunction)(wxActivateEvent&); typedef void (wxEvtHandler::*wxMenuEventFunction)(wxMenuEvent&); typedef void (wxEvtHandler::*wxJoystickEventFunction)(wxJoystickEvent&); typedef void (wxEvtHandler::*wxDropFilesEventFunction)(wxDropFilesEvent&); typedef void (wxEvtHandler::*wxInitDialogEventFunction)(wxInitDialogEvent&); typedef void (wxEvtHandler::*wxSysColourChangedEventFunction)(wxSysColourChangedEvent&); typedef void (wxEvtHandler::*wxDisplayChangedEventFunction)(wxDisplayChangedEvent&); typedef void (wxEvtHandler::*wxUpdateUIEventFunction)(wxUpdateUIEvent&); typedef void (wxEvtHandler::*wxCloseEventFunction)(wxCloseEvent&); typedef void (wxEvtHandler::*wxShowEventFunction)(wxShowEvent&); typedef void (wxEvtHandler::*wxIconizeEventFunction)(wxIconizeEvent&); typedef void (wxEvtHandler::*wxMaximizeEventFunction)(wxMaximizeEvent&); typedef void (wxEvtHandler::*wxNavigationKeyEventFunction)(wxNavigationKeyEvent&); typedef void (wxEvtHandler::*wxPaletteChangedEventFunction)(wxPaletteChangedEvent&); typedef void (wxEvtHandler::*wxQueryNewPaletteEventFunction)(wxQueryNewPaletteEvent&); typedef void (wxEvtHandler::*wxWindowCreateEventFunction)(wxWindowCreateEvent&); typedef void (wxEvtHandler::*wxWindowDestroyEventFunction)(wxWindowDestroyEvent&); typedef void (wxEvtHandler::*wxSetCursorEventFunction)(wxSetCursorEvent&); typedef void (wxEvtHandler::*wxNotifyEventFunction)(wxNotifyEvent&); typedef void (wxEvtHandler::*wxHelpEventFunction)(wxHelpEvent&); typedef void (wxEvtHandler::*wxContextMenuEventFunction)(wxContextMenuEvent&); typedef void (wxEvtHandler::*wxMouseCaptureChangedEventFunction)(wxMouseCaptureChangedEvent&); typedef void (wxEvtHandler::*wxMouseCaptureLostEventFunction)(wxMouseCaptureLostEvent&); typedef void (wxEvtHandler::*wxClipboardTextEventFunction)(wxClipboardTextEvent&); typedef void (wxEvtHandler::*wxPanGestureEventFunction)(wxPanGestureEvent&); typedef void (wxEvtHandler::*wxZoomGestureEventFunction)(wxZoomGestureEvent&); typedef void (wxEvtHandler::*wxRotateGestureEventFunction)(wxRotateGestureEvent&); typedef void (wxEvtHandler::*wxTwoFingerTapEventFunction)(wxTwoFingerTapEvent&); typedef void (wxEvtHandler::*wxLongPressEventFunction)(wxLongPressEvent&); typedef void (wxEvtHandler::*wxPressAndTapEventFunction)(wxPressAndTapEvent&); #define wxCommandEventHandler(func) \ wxEVENT_HANDLER_CAST(wxCommandEventFunction, func) #define wxScrollEventHandler(func) \ wxEVENT_HANDLER_CAST(wxScrollEventFunction, func) #define wxScrollWinEventHandler(func) \ wxEVENT_HANDLER_CAST(wxScrollWinEventFunction, func) #define wxSizeEventHandler(func) \ wxEVENT_HANDLER_CAST(wxSizeEventFunction, func) #define wxMoveEventHandler(func) \ wxEVENT_HANDLER_CAST(wxMoveEventFunction, func) #define wxPaintEventHandler(func) \ wxEVENT_HANDLER_CAST(wxPaintEventFunction, func) #define wxNcPaintEventHandler(func) \ wxEVENT_HANDLER_CAST(wxNcPaintEventFunction, func) #define wxEraseEventHandler(func) \ wxEVENT_HANDLER_CAST(wxEraseEventFunction, func) #define wxMouseEventHandler(func) \ wxEVENT_HANDLER_CAST(wxMouseEventFunction, func) #define wxCharEventHandler(func) \ wxEVENT_HANDLER_CAST(wxCharEventFunction, func) #define wxKeyEventHandler(func) wxCharEventHandler(func) #define wxFocusEventHandler(func) \ wxEVENT_HANDLER_CAST(wxFocusEventFunction, func) #define wxChildFocusEventHandler(func) \ wxEVENT_HANDLER_CAST(wxChildFocusEventFunction, func) #define wxActivateEventHandler(func) \ wxEVENT_HANDLER_CAST(wxActivateEventFunction, func) #define wxMenuEventHandler(func) \ wxEVENT_HANDLER_CAST(wxMenuEventFunction, func) #define wxJoystickEventHandler(func) \ wxEVENT_HANDLER_CAST(wxJoystickEventFunction, func) #define wxDropFilesEventHandler(func) \ wxEVENT_HANDLER_CAST(wxDropFilesEventFunction, func) #define wxInitDialogEventHandler(func) \ wxEVENT_HANDLER_CAST(wxInitDialogEventFunction, func) #define wxSysColourChangedEventHandler(func) \ wxEVENT_HANDLER_CAST(wxSysColourChangedEventFunction, func) #define wxDisplayChangedEventHandler(func) \ wxEVENT_HANDLER_CAST(wxDisplayChangedEventFunction, func) #define wxUpdateUIEventHandler(func) \ wxEVENT_HANDLER_CAST(wxUpdateUIEventFunction, func) #define wxCloseEventHandler(func) \ wxEVENT_HANDLER_CAST(wxCloseEventFunction, func) #define wxShowEventHandler(func) \ wxEVENT_HANDLER_CAST(wxShowEventFunction, func) #define wxIconizeEventHandler(func) \ wxEVENT_HANDLER_CAST(wxIconizeEventFunction, func) #define wxMaximizeEventHandler(func) \ wxEVENT_HANDLER_CAST(wxMaximizeEventFunction, func) #define wxNavigationKeyEventHandler(func) \ wxEVENT_HANDLER_CAST(wxNavigationKeyEventFunction, func) #define wxPaletteChangedEventHandler(func) \ wxEVENT_HANDLER_CAST(wxPaletteChangedEventFunction, func) #define wxQueryNewPaletteEventHandler(func) \ wxEVENT_HANDLER_CAST(wxQueryNewPaletteEventFunction, func) #define wxWindowCreateEventHandler(func) \ wxEVENT_HANDLER_CAST(wxWindowCreateEventFunction, func) #define wxWindowDestroyEventHandler(func) \ wxEVENT_HANDLER_CAST(wxWindowDestroyEventFunction, func) #define wxSetCursorEventHandler(func) \ wxEVENT_HANDLER_CAST(wxSetCursorEventFunction, func) #define wxNotifyEventHandler(func) \ wxEVENT_HANDLER_CAST(wxNotifyEventFunction, func) #define wxHelpEventHandler(func) \ wxEVENT_HANDLER_CAST(wxHelpEventFunction, func) #define wxContextMenuEventHandler(func) \ wxEVENT_HANDLER_CAST(wxContextMenuEventFunction, func) #define wxMouseCaptureChangedEventHandler(func) \ wxEVENT_HANDLER_CAST(wxMouseCaptureChangedEventFunction, func) #define wxMouseCaptureLostEventHandler(func) \ wxEVENT_HANDLER_CAST(wxMouseCaptureLostEventFunction, func) #define wxClipboardTextEventHandler(func) \ wxEVENT_HANDLER_CAST(wxClipboardTextEventFunction, func) #define wxPanGestureEventHandler(func) \ wxEVENT_HANDLER_CAST(wxPanGestureEventFunction, func) #define wxZoomGestureEventHandler(func) \ wxEVENT_HANDLER_CAST(wxZoomGestureEventFunction, func) #define wxRotateGestureEventHandler(func) \ wxEVENT_HANDLER_CAST(wxRotateGestureEventFunction, func) #define wxTwoFingerTapEventHandler(func) \ wxEVENT_HANDLER_CAST(wxTwoFingerTapEventFunction, func) #define wxLongPressEventHandler(func) \ wxEVENT_HANDLER_CAST(wxLongPressEventFunction, func) #define wxPressAndTapEventHandler(func) \ wxEVENT_HANDLER_CAST(wxPressAndTapEventFunction, func) #endif // wxUSE_GUI // N.B. In GNU-WIN32, you *have* to take the address of a member function // (use &) or the compiler crashes... #define wxDECLARE_EVENT_TABLE() \ private: \ static const wxEventTableEntry sm_eventTableEntries[]; \ protected: \ wxCLANG_WARNING_SUPPRESS(inconsistent-missing-override) \ const wxEventTable* GetEventTable() const; \ wxEventHashTable& GetEventHashTable() const; \ wxCLANG_WARNING_RESTORE(inconsistent-missing-override) \ static const wxEventTable sm_eventTable; \ static wxEventHashTable sm_eventHashTable // N.B.: when building DLL with Borland C++ 5.5 compiler, you must initialize // sm_eventTable before using it in GetEventTable() or the compiler gives // E2233 (see http://groups.google.com/groups?selm=397dcc8a%241_2%40dnews) #define wxBEGIN_EVENT_TABLE(theClass, baseClass) \ const wxEventTable theClass::sm_eventTable = \ { &baseClass::sm_eventTable, &theClass::sm_eventTableEntries[0] }; \ const wxEventTable *theClass::GetEventTable() const \ { return &theClass::sm_eventTable; } \ wxEventHashTable theClass::sm_eventHashTable(theClass::sm_eventTable); \ wxEventHashTable &theClass::GetEventHashTable() const \ { return theClass::sm_eventHashTable; } \ const wxEventTableEntry theClass::sm_eventTableEntries[] = { \ #define wxBEGIN_EVENT_TABLE_TEMPLATE1(theClass, baseClass, T1) \ template<typename T1> \ const wxEventTable theClass<T1>::sm_eventTable = \ { &baseClass::sm_eventTable, &theClass<T1>::sm_eventTableEntries[0] }; \ template<typename T1> \ const wxEventTable *theClass<T1>::GetEventTable() const \ { return &theClass<T1>::sm_eventTable; } \ template<typename T1> \ wxEventHashTable theClass<T1>::sm_eventHashTable(theClass<T1>::sm_eventTable); \ template<typename T1> \ wxEventHashTable &theClass<T1>::GetEventHashTable() const \ { return theClass<T1>::sm_eventHashTable; } \ template<typename T1> \ const wxEventTableEntry theClass<T1>::sm_eventTableEntries[] = { \ #define wxBEGIN_EVENT_TABLE_TEMPLATE2(theClass, baseClass, T1, T2) \ template<typename T1, typename T2> \ const wxEventTable theClass<T1, T2>::sm_eventTable = \ { &baseClass::sm_eventTable, &theClass<T1, T2>::sm_eventTableEntries[0] }; \ template<typename T1, typename T2> \ const wxEventTable *theClass<T1, T2>::GetEventTable() const \ { return &theClass<T1, T2>::sm_eventTable; } \ template<typename T1, typename T2> \ wxEventHashTable theClass<T1, T2>::sm_eventHashTable(theClass<T1, T2>::sm_eventTable); \ template<typename T1, typename T2> \ wxEventHashTable &theClass<T1, T2>::GetEventHashTable() const \ { return theClass<T1, T2>::sm_eventHashTable; } \ template<typename T1, typename T2> \ const wxEventTableEntry theClass<T1, T2>::sm_eventTableEntries[] = { \ #define wxBEGIN_EVENT_TABLE_TEMPLATE3(theClass, baseClass, T1, T2, T3) \ template<typename T1, typename T2, typename T3> \ const wxEventTable theClass<T1, T2, T3>::sm_eventTable = \ { &baseClass::sm_eventTable, &theClass<T1, T2, T3>::sm_eventTableEntries[0] }; \ template<typename T1, typename T2, typename T3> \ const wxEventTable *theClass<T1, T2, T3>::GetEventTable() const \ { return &theClass<T1, T2, T3>::sm_eventTable; } \ template<typename T1, typename T2, typename T3> \ wxEventHashTable theClass<T1, T2, T3>::sm_eventHashTable(theClass<T1, T2, T3>::sm_eventTable); \ template<typename T1, typename T2, typename T3> \ wxEventHashTable &theClass<T1, T2, T3>::GetEventHashTable() const \ { return theClass<T1, T2, T3>::sm_eventHashTable; } \ template<typename T1, typename T2, typename T3> \ const wxEventTableEntry theClass<T1, T2, T3>::sm_eventTableEntries[] = { \ #define wxBEGIN_EVENT_TABLE_TEMPLATE4(theClass, baseClass, T1, T2, T3, T4) \ template<typename T1, typename T2, typename T3, typename T4> \ const wxEventTable theClass<T1, T2, T3, T4>::sm_eventTable = \ { &baseClass::sm_eventTable, &theClass<T1, T2, T3, T4>::sm_eventTableEntries[0] }; \ template<typename T1, typename T2, typename T3, typename T4> \ const wxEventTable *theClass<T1, T2, T3, T4>::GetEventTable() const \ { return &theClass<T1, T2, T3, T4>::sm_eventTable; } \ template<typename T1, typename T2, typename T3, typename T4> \ wxEventHashTable theClass<T1, T2, T3, T4>::sm_eventHashTable(theClass<T1, T2, T3, T4>::sm_eventTable); \ template<typename T1, typename T2, typename T3, typename T4> \ wxEventHashTable &theClass<T1, T2, T3, T4>::GetEventHashTable() const \ { return theClass<T1, T2, T3, T4>::sm_eventHashTable; } \ template<typename T1, typename T2, typename T3, typename T4> \ const wxEventTableEntry theClass<T1, T2, T3, T4>::sm_eventTableEntries[] = { \ #define wxBEGIN_EVENT_TABLE_TEMPLATE5(theClass, baseClass, T1, T2, T3, T4, T5) \ template<typename T1, typename T2, typename T3, typename T4, typename T5> \ const wxEventTable theClass<T1, T2, T3, T4, T5>::sm_eventTable = \ { &baseClass::sm_eventTable, &theClass<T1, T2, T3, T4, T5>::sm_eventTableEntries[0] }; \ template<typename T1, typename T2, typename T3, typename T4, typename T5> \ const wxEventTable *theClass<T1, T2, T3, T4, T5>::GetEventTable() const \ { return &theClass<T1, T2, T3, T4, T5>::sm_eventTable; } \ template<typename T1, typename T2, typename T3, typename T4, typename T5> \ wxEventHashTable theClass<T1, T2, T3, T4, T5>::sm_eventHashTable(theClass<T1, T2, T3, T4, T5>::sm_eventTable); \ template<typename T1, typename T2, typename T3, typename T4, typename T5> \ wxEventHashTable &theClass<T1, T2, T3, T4, T5>::GetEventHashTable() const \ { return theClass<T1, T2, T3, T4, T5>::sm_eventHashTable; } \ template<typename T1, typename T2, typename T3, typename T4, typename T5> \ const wxEventTableEntry theClass<T1, T2, T3, T4, T5>::sm_eventTableEntries[] = { \ #define wxBEGIN_EVENT_TABLE_TEMPLATE7(theClass, baseClass, T1, T2, T3, T4, T5, T6, T7) \ template<typename T1, typename T2, typename T3, typename T4, typename T5, typename T6, typename T7> \ const wxEventTable theClass<T1, T2, T3, T4, T5, T6, T7>::sm_eventTable = \ { &baseClass::sm_eventTable, &theClass<T1, T2, T3, T4, T5, T6, T7>::sm_eventTableEntries[0] }; \ template<typename T1, typename T2, typename T3, typename T4, typename T5, typename T6, typename T7> \ const wxEventTable *theClass<T1, T2, T3, T4, T5, T6, T7>::GetEventTable() const \ { return &theClass<T1, T2, T3, T4, T5, T6, T7>::sm_eventTable; } \ template<typename T1, typename T2, typename T3, typename T4, typename T5, typename T6, typename T7> \ wxEventHashTable theClass<T1, T2, T3, T4, T5, T6, T7>::sm_eventHashTable(theClass<T1, T2, T3, T4, T5, T6, T7>::sm_eventTable); \ template<typename T1, typename T2, typename T3, typename T4, typename T5, typename T6, typename T7> \ wxEventHashTable &theClass<T1, T2, T3, T4, T5, T6, T7>::GetEventHashTable() const \ { return theClass<T1, T2, T3, T4, T5, T6, T7>::sm_eventHashTable; } \ template<typename T1, typename T2, typename T3, typename T4, typename T5, typename T6, typename T7> \ const wxEventTableEntry theClass<T1, T2, T3, T4, T5, T6, T7>::sm_eventTableEntries[] = { \ #define wxBEGIN_EVENT_TABLE_TEMPLATE8(theClass, baseClass, T1, T2, T3, T4, T5, T6, T7, T8) \ template<typename T1, typename T2, typename T3, typename T4, typename T5, typename T6, typename T7, typename T8> \ const wxEventTable theClass<T1, T2, T3, T4, T5, T6, T7, T8>::sm_eventTable = \ { &baseClass::sm_eventTable, &theClass<T1, T2, T3, T4, T5, T6, T7, T8>::sm_eventTableEntries[0] }; \ template<typename T1, typename T2, typename T3, typename T4, typename T5, typename T6, typename T7, typename T8> \ const wxEventTable *theClass<T1, T2, T3, T4, T5, T6, T7, T8>::GetEventTable() const \ { return &theClass<T1, T2, T3, T4, T5, T6, T7, T8>::sm_eventTable; } \ template<typename T1, typename T2, typename T3, typename T4, typename T5, typename T6, typename T7, typename T8> \ wxEventHashTable theClass<T1, T2, T3, T4, T5, T6, T7, T8>::sm_eventHashTable(theClass<T1, T2, T3, T4, T5, T6, T7, T8>::sm_eventTable); \ template<typename T1, typename T2, typename T3, typename T4, typename T5, typename T6, typename T7, typename T8> \ wxEventHashTable &theClass<T1, T2, T3, T4, T5, T6, T7, T8>::GetEventHashTable() const \ { return theClass<T1, T2, T3, T4, T5, T6, T7, T8>::sm_eventHashTable; } \ template<typename T1, typename T2, typename T3, typename T4, typename T5, typename T6, typename T7, typename T8> \ const wxEventTableEntry theClass<T1, T2, T3, T4, T5, T6, T7, T8>::sm_eventTableEntries[] = { \ #define wxEND_EVENT_TABLE() \ wxDECLARE_EVENT_TABLE_TERMINATOR() }; /* * Event table macros */ // helpers for writing shorter code below: declare an event macro taking 2, 1 // or none ids (the missing ids default to wxID_ANY) // // macro arguments: // - evt one of wxEVT_XXX constants // - id1, id2 ids of the first/last id // - fn the function (should be cast to the right type) #define wx__DECLARE_EVT2(evt, id1, id2, fn) \ wxDECLARE_EVENT_TABLE_ENTRY(evt, id1, id2, fn, NULL), #define wx__DECLARE_EVT1(evt, id, fn) \ wx__DECLARE_EVT2(evt, id, wxID_ANY, fn) #define wx__DECLARE_EVT0(evt, fn) \ wx__DECLARE_EVT1(evt, wxID_ANY, fn) // Generic events #define EVT_CUSTOM(event, winid, func) \ wx__DECLARE_EVT1(event, winid, wxEventHandler(func)) #define EVT_CUSTOM_RANGE(event, id1, id2, func) \ wx__DECLARE_EVT2(event, id1, id2, wxEventHandler(func)) // EVT_COMMAND #define EVT_COMMAND(winid, event, func) \ wx__DECLARE_EVT1(event, winid, wxCommandEventHandler(func)) #define EVT_COMMAND_RANGE(id1, id2, event, func) \ wx__DECLARE_EVT2(event, id1, id2, wxCommandEventHandler(func)) #define EVT_NOTIFY(event, winid, func) \ wx__DECLARE_EVT1(event, winid, wxNotifyEventHandler(func)) #define EVT_NOTIFY_RANGE(event, id1, id2, func) \ wx__DECLARE_EVT2(event, id1, id2, wxNotifyEventHandler(func)) // Miscellaneous #define EVT_SIZE(func) wx__DECLARE_EVT0(wxEVT_SIZE, wxSizeEventHandler(func)) #define EVT_SIZING(func) wx__DECLARE_EVT0(wxEVT_SIZING, wxSizeEventHandler(func)) #define EVT_MOVE(func) wx__DECLARE_EVT0(wxEVT_MOVE, wxMoveEventHandler(func)) #define EVT_MOVING(func) wx__DECLARE_EVT0(wxEVT_MOVING, wxMoveEventHandler(func)) #define EVT_MOVE_START(func) wx__DECLARE_EVT0(wxEVT_MOVE_START, wxMoveEventHandler(func)) #define EVT_MOVE_END(func) wx__DECLARE_EVT0(wxEVT_MOVE_END, wxMoveEventHandler(func)) #define EVT_CLOSE(func) wx__DECLARE_EVT0(wxEVT_CLOSE_WINDOW, wxCloseEventHandler(func)) #define EVT_END_SESSION(func) wx__DECLARE_EVT0(wxEVT_END_SESSION, wxCloseEventHandler(func)) #define EVT_QUERY_END_SESSION(func) wx__DECLARE_EVT0(wxEVT_QUERY_END_SESSION, wxCloseEventHandler(func)) #define EVT_PAINT(func) wx__DECLARE_EVT0(wxEVT_PAINT, wxPaintEventHandler(func)) #define EVT_NC_PAINT(func) wx__DECLARE_EVT0(wxEVT_NC_PAINT, wxNcPaintEventHandler(func)) #define EVT_ERASE_BACKGROUND(func) wx__DECLARE_EVT0(wxEVT_ERASE_BACKGROUND, wxEraseEventHandler(func)) #define EVT_CHAR(func) wx__DECLARE_EVT0(wxEVT_CHAR, wxCharEventHandler(func)) #define EVT_KEY_DOWN(func) wx__DECLARE_EVT0(wxEVT_KEY_DOWN, wxKeyEventHandler(func)) #define EVT_KEY_UP(func) wx__DECLARE_EVT0(wxEVT_KEY_UP, wxKeyEventHandler(func)) #if wxUSE_HOTKEY #define EVT_HOTKEY(winid, func) wx__DECLARE_EVT1(wxEVT_HOTKEY, winid, wxCharEventHandler(func)) #endif #define EVT_CHAR_HOOK(func) wx__DECLARE_EVT0(wxEVT_CHAR_HOOK, wxCharEventHandler(func)) #define EVT_MENU_OPEN(func) wx__DECLARE_EVT0(wxEVT_MENU_OPEN, wxMenuEventHandler(func)) #define EVT_MENU_CLOSE(func) wx__DECLARE_EVT0(wxEVT_MENU_CLOSE, wxMenuEventHandler(func)) #define EVT_MENU_HIGHLIGHT(winid, func) wx__DECLARE_EVT1(wxEVT_MENU_HIGHLIGHT, winid, wxMenuEventHandler(func)) #define EVT_MENU_HIGHLIGHT_ALL(func) wx__DECLARE_EVT0(wxEVT_MENU_HIGHLIGHT, wxMenuEventHandler(func)) #define EVT_SET_FOCUS(func) wx__DECLARE_EVT0(wxEVT_SET_FOCUS, wxFocusEventHandler(func)) #define EVT_KILL_FOCUS(func) wx__DECLARE_EVT0(wxEVT_KILL_FOCUS, wxFocusEventHandler(func)) #define EVT_CHILD_FOCUS(func) wx__DECLARE_EVT0(wxEVT_CHILD_FOCUS, wxChildFocusEventHandler(func)) #define EVT_ACTIVATE(func) wx__DECLARE_EVT0(wxEVT_ACTIVATE, wxActivateEventHandler(func)) #define EVT_ACTIVATE_APP(func) wx__DECLARE_EVT0(wxEVT_ACTIVATE_APP, wxActivateEventHandler(func)) #define EVT_HIBERNATE(func) wx__DECLARE_EVT0(wxEVT_HIBERNATE, wxActivateEventHandler(func)) #define EVT_END_SESSION(func) wx__DECLARE_EVT0(wxEVT_END_SESSION, wxCloseEventHandler(func)) #define EVT_QUERY_END_SESSION(func) wx__DECLARE_EVT0(wxEVT_QUERY_END_SESSION, wxCloseEventHandler(func)) #define EVT_DROP_FILES(func) wx__DECLARE_EVT0(wxEVT_DROP_FILES, wxDropFilesEventHandler(func)) #define EVT_INIT_DIALOG(func) wx__DECLARE_EVT0(wxEVT_INIT_DIALOG, wxInitDialogEventHandler(func)) #define EVT_SYS_COLOUR_CHANGED(func) wx__DECLARE_EVT0(wxEVT_SYS_COLOUR_CHANGED, wxSysColourChangedEventHandler(func)) #define EVT_DISPLAY_CHANGED(func) wx__DECLARE_EVT0(wxEVT_DISPLAY_CHANGED, wxDisplayChangedEventHandler(func)) #define EVT_SHOW(func) wx__DECLARE_EVT0(wxEVT_SHOW, wxShowEventHandler(func)) #define EVT_MAXIMIZE(func) wx__DECLARE_EVT0(wxEVT_MAXIMIZE, wxMaximizeEventHandler(func)) #define EVT_ICONIZE(func) wx__DECLARE_EVT0(wxEVT_ICONIZE, wxIconizeEventHandler(func)) #define EVT_NAVIGATION_KEY(func) wx__DECLARE_EVT0(wxEVT_NAVIGATION_KEY, wxNavigationKeyEventHandler(func)) #define EVT_PALETTE_CHANGED(func) wx__DECLARE_EVT0(wxEVT_PALETTE_CHANGED, wxPaletteChangedEventHandler(func)) #define EVT_QUERY_NEW_PALETTE(func) wx__DECLARE_EVT0(wxEVT_QUERY_NEW_PALETTE, wxQueryNewPaletteEventHandler(func)) #define EVT_WINDOW_CREATE(func) wx__DECLARE_EVT0(wxEVT_CREATE, wxWindowCreateEventHandler(func)) #define EVT_WINDOW_DESTROY(func) wx__DECLARE_EVT0(wxEVT_DESTROY, wxWindowDestroyEventHandler(func)) #define EVT_SET_CURSOR(func) wx__DECLARE_EVT0(wxEVT_SET_CURSOR, wxSetCursorEventHandler(func)) #define EVT_MOUSE_CAPTURE_CHANGED(func) wx__DECLARE_EVT0(wxEVT_MOUSE_CAPTURE_CHANGED, wxMouseCaptureChangedEventHandler(func)) #define EVT_MOUSE_CAPTURE_LOST(func) wx__DECLARE_EVT0(wxEVT_MOUSE_CAPTURE_LOST, wxMouseCaptureLostEventHandler(func)) // Mouse events #define EVT_LEFT_DOWN(func) wx__DECLARE_EVT0(wxEVT_LEFT_DOWN, wxMouseEventHandler(func)) #define EVT_LEFT_UP(func) wx__DECLARE_EVT0(wxEVT_LEFT_UP, wxMouseEventHandler(func)) #define EVT_MIDDLE_DOWN(func) wx__DECLARE_EVT0(wxEVT_MIDDLE_DOWN, wxMouseEventHandler(func)) #define EVT_MIDDLE_UP(func) wx__DECLARE_EVT0(wxEVT_MIDDLE_UP, wxMouseEventHandler(func)) #define EVT_RIGHT_DOWN(func) wx__DECLARE_EVT0(wxEVT_RIGHT_DOWN, wxMouseEventHandler(func)) #define EVT_RIGHT_UP(func) wx__DECLARE_EVT0(wxEVT_RIGHT_UP, wxMouseEventHandler(func)) #define EVT_MOTION(func) wx__DECLARE_EVT0(wxEVT_MOTION, wxMouseEventHandler(func)) #define EVT_LEFT_DCLICK(func) wx__DECLARE_EVT0(wxEVT_LEFT_DCLICK, wxMouseEventHandler(func)) #define EVT_MIDDLE_DCLICK(func) wx__DECLARE_EVT0(wxEVT_MIDDLE_DCLICK, wxMouseEventHandler(func)) #define EVT_RIGHT_DCLICK(func) wx__DECLARE_EVT0(wxEVT_RIGHT_DCLICK, wxMouseEventHandler(func)) #define EVT_LEAVE_WINDOW(func) wx__DECLARE_EVT0(wxEVT_LEAVE_WINDOW, wxMouseEventHandler(func)) #define EVT_ENTER_WINDOW(func) wx__DECLARE_EVT0(wxEVT_ENTER_WINDOW, wxMouseEventHandler(func)) #define EVT_MOUSEWHEEL(func) wx__DECLARE_EVT0(wxEVT_MOUSEWHEEL, wxMouseEventHandler(func)) #define EVT_MOUSE_AUX1_DOWN(func) wx__DECLARE_EVT0(wxEVT_AUX1_DOWN, wxMouseEventHandler(func)) #define EVT_MOUSE_AUX1_UP(func) wx__DECLARE_EVT0(wxEVT_AUX1_UP, wxMouseEventHandler(func)) #define EVT_MOUSE_AUX1_DCLICK(func) wx__DECLARE_EVT0(wxEVT_AUX1_DCLICK, wxMouseEventHandler(func)) #define EVT_MOUSE_AUX2_DOWN(func) wx__DECLARE_EVT0(wxEVT_AUX2_DOWN, wxMouseEventHandler(func)) #define EVT_MOUSE_AUX2_UP(func) wx__DECLARE_EVT0(wxEVT_AUX2_UP, wxMouseEventHandler(func)) #define EVT_MOUSE_AUX2_DCLICK(func) wx__DECLARE_EVT0(wxEVT_AUX2_DCLICK, wxMouseEventHandler(func)) #define EVT_MAGNIFY(func) wx__DECLARE_EVT0(wxEVT_MAGNIFY, wxMouseEventHandler(func)) // All mouse events #define EVT_MOUSE_EVENTS(func) \ EVT_LEFT_DOWN(func) \ EVT_LEFT_UP(func) \ EVT_LEFT_DCLICK(func) \ EVT_MIDDLE_DOWN(func) \ EVT_MIDDLE_UP(func) \ EVT_MIDDLE_DCLICK(func) \ EVT_RIGHT_DOWN(func) \ EVT_RIGHT_UP(func) \ EVT_RIGHT_DCLICK(func) \ EVT_MOUSE_AUX1_DOWN(func) \ EVT_MOUSE_AUX1_UP(func) \ EVT_MOUSE_AUX1_DCLICK(func) \ EVT_MOUSE_AUX2_DOWN(func) \ EVT_MOUSE_AUX2_UP(func) \ EVT_MOUSE_AUX2_DCLICK(func) \ EVT_MOTION(func) \ EVT_LEAVE_WINDOW(func) \ EVT_ENTER_WINDOW(func) \ EVT_MOUSEWHEEL(func) \ EVT_MAGNIFY(func) // Scrolling from wxWindow (sent to wxScrolledWindow) #define EVT_SCROLLWIN_TOP(func) wx__DECLARE_EVT0(wxEVT_SCROLLWIN_TOP, wxScrollWinEventHandler(func)) #define EVT_SCROLLWIN_BOTTOM(func) wx__DECLARE_EVT0(wxEVT_SCROLLWIN_BOTTOM, wxScrollWinEventHandler(func)) #define EVT_SCROLLWIN_LINEUP(func) wx__DECLARE_EVT0(wxEVT_SCROLLWIN_LINEUP, wxScrollWinEventHandler(func)) #define EVT_SCROLLWIN_LINEDOWN(func) wx__DECLARE_EVT0(wxEVT_SCROLLWIN_LINEDOWN, wxScrollWinEventHandler(func)) #define EVT_SCROLLWIN_PAGEUP(func) wx__DECLARE_EVT0(wxEVT_SCROLLWIN_PAGEUP, wxScrollWinEventHandler(func)) #define EVT_SCROLLWIN_PAGEDOWN(func) wx__DECLARE_EVT0(wxEVT_SCROLLWIN_PAGEDOWN, wxScrollWinEventHandler(func)) #define EVT_SCROLLWIN_THUMBTRACK(func) wx__DECLARE_EVT0(wxEVT_SCROLLWIN_THUMBTRACK, wxScrollWinEventHandler(func)) #define EVT_SCROLLWIN_THUMBRELEASE(func) wx__DECLARE_EVT0(wxEVT_SCROLLWIN_THUMBRELEASE, wxScrollWinEventHandler(func)) #define EVT_SCROLLWIN(func) \ EVT_SCROLLWIN_TOP(func) \ EVT_SCROLLWIN_BOTTOM(func) \ EVT_SCROLLWIN_LINEUP(func) \ EVT_SCROLLWIN_LINEDOWN(func) \ EVT_SCROLLWIN_PAGEUP(func) \ EVT_SCROLLWIN_PAGEDOWN(func) \ EVT_SCROLLWIN_THUMBTRACK(func) \ EVT_SCROLLWIN_THUMBRELEASE(func) // Scrolling from wxSlider and wxScrollBar #define EVT_SCROLL_TOP(func) wx__DECLARE_EVT0(wxEVT_SCROLL_TOP, wxScrollEventHandler(func)) #define EVT_SCROLL_BOTTOM(func) wx__DECLARE_EVT0(wxEVT_SCROLL_BOTTOM, wxScrollEventHandler(func)) #define EVT_SCROLL_LINEUP(func) wx__DECLARE_EVT0(wxEVT_SCROLL_LINEUP, wxScrollEventHandler(func)) #define EVT_SCROLL_LINEDOWN(func) wx__DECLARE_EVT0(wxEVT_SCROLL_LINEDOWN, wxScrollEventHandler(func)) #define EVT_SCROLL_PAGEUP(func) wx__DECLARE_EVT0(wxEVT_SCROLL_PAGEUP, wxScrollEventHandler(func)) #define EVT_SCROLL_PAGEDOWN(func) wx__DECLARE_EVT0(wxEVT_SCROLL_PAGEDOWN, wxScrollEventHandler(func)) #define EVT_SCROLL_THUMBTRACK(func) wx__DECLARE_EVT0(wxEVT_SCROLL_THUMBTRACK, wxScrollEventHandler(func)) #define EVT_SCROLL_THUMBRELEASE(func) wx__DECLARE_EVT0(wxEVT_SCROLL_THUMBRELEASE, wxScrollEventHandler(func)) #define EVT_SCROLL_CHANGED(func) wx__DECLARE_EVT0(wxEVT_SCROLL_CHANGED, wxScrollEventHandler(func)) #define EVT_SCROLL(func) \ EVT_SCROLL_TOP(func) \ EVT_SCROLL_BOTTOM(func) \ EVT_SCROLL_LINEUP(func) \ EVT_SCROLL_LINEDOWN(func) \ EVT_SCROLL_PAGEUP(func) \ EVT_SCROLL_PAGEDOWN(func) \ EVT_SCROLL_THUMBTRACK(func) \ EVT_SCROLL_THUMBRELEASE(func) \ EVT_SCROLL_CHANGED(func) // Scrolling from wxSlider and wxScrollBar, with an id #define EVT_COMMAND_SCROLL_TOP(winid, func) wx__DECLARE_EVT1(wxEVT_SCROLL_TOP, winid, wxScrollEventHandler(func)) #define EVT_COMMAND_SCROLL_BOTTOM(winid, func) wx__DECLARE_EVT1(wxEVT_SCROLL_BOTTOM, winid, wxScrollEventHandler(func)) #define EVT_COMMAND_SCROLL_LINEUP(winid, func) wx__DECLARE_EVT1(wxEVT_SCROLL_LINEUP, winid, wxScrollEventHandler(func)) #define EVT_COMMAND_SCROLL_LINEDOWN(winid, func) wx__DECLARE_EVT1(wxEVT_SCROLL_LINEDOWN, winid, wxScrollEventHandler(func)) #define EVT_COMMAND_SCROLL_PAGEUP(winid, func) wx__DECLARE_EVT1(wxEVT_SCROLL_PAGEUP, winid, wxScrollEventHandler(func)) #define EVT_COMMAND_SCROLL_PAGEDOWN(winid, func) wx__DECLARE_EVT1(wxEVT_SCROLL_PAGEDOWN, winid, wxScrollEventHandler(func)) #define EVT_COMMAND_SCROLL_THUMBTRACK(winid, func) wx__DECLARE_EVT1(wxEVT_SCROLL_THUMBTRACK, winid, wxScrollEventHandler(func)) #define EVT_COMMAND_SCROLL_THUMBRELEASE(winid, func) wx__DECLARE_EVT1(wxEVT_SCROLL_THUMBRELEASE, winid, wxScrollEventHandler(func)) #define EVT_COMMAND_SCROLL_CHANGED(winid, func) wx__DECLARE_EVT1(wxEVT_SCROLL_CHANGED, winid, wxScrollEventHandler(func)) #define EVT_COMMAND_SCROLL(winid, func) \ EVT_COMMAND_SCROLL_TOP(winid, func) \ EVT_COMMAND_SCROLL_BOTTOM(winid, func) \ EVT_COMMAND_SCROLL_LINEUP(winid, func) \ EVT_COMMAND_SCROLL_LINEDOWN(winid, func) \ EVT_COMMAND_SCROLL_PAGEUP(winid, func) \ EVT_COMMAND_SCROLL_PAGEDOWN(winid, func) \ EVT_COMMAND_SCROLL_THUMBTRACK(winid, func) \ EVT_COMMAND_SCROLL_THUMBRELEASE(winid, func) \ EVT_COMMAND_SCROLL_CHANGED(winid, func) // Gesture events #define EVT_GESTURE_PAN(winid, func) wx__DECLARE_EVT1(wxEVT_GESTURE_PAN, winid, wxPanGestureEventHandler(func)) #define EVT_GESTURE_ZOOM(winid, func) wx__DECLARE_EVT1(wxEVT_GESTURE_ZOOM, winid, wxZoomGestureEventHandler(func)) #define EVT_GESTURE_ROTATE(winid, func) wx__DECLARE_EVT1(wxEVT_GESTURE_ROTATE, winid, wxRotateGestureEventHandler(func)) #define EVT_TWO_FINGER_TAP(winid, func) wx__DECLARE_EVT1(wxEVT_TWO_FINGER_TAP, winid, wxTwoFingerTapEventHandler(func)) #define EVT_LONG_PRESS(winid, func) wx__DECLARE_EVT1(wxEVT_LONG_PRESS, winid, wxLongPressEventHandler(func)) #define EVT_PRESS_AND_TAP(winid, func) wx__DECLARE_EVT1(wxEVT_PRESS_AND_TAP, winid, wxPressAndTapEvent(func)) // Convenience macros for commonly-used commands #define EVT_CHECKBOX(winid, func) wx__DECLARE_EVT1(wxEVT_CHECKBOX, winid, wxCommandEventHandler(func)) #define EVT_CHOICE(winid, func) wx__DECLARE_EVT1(wxEVT_CHOICE, winid, wxCommandEventHandler(func)) #define EVT_LISTBOX(winid, func) wx__DECLARE_EVT1(wxEVT_LISTBOX, winid, wxCommandEventHandler(func)) #define EVT_LISTBOX_DCLICK(winid, func) wx__DECLARE_EVT1(wxEVT_LISTBOX_DCLICK, winid, wxCommandEventHandler(func)) #define EVT_MENU(winid, func) wx__DECLARE_EVT1(wxEVT_MENU, winid, wxCommandEventHandler(func)) #define EVT_MENU_RANGE(id1, id2, func) wx__DECLARE_EVT2(wxEVT_MENU, id1, id2, wxCommandEventHandler(func)) #define EVT_BUTTON(winid, func) wx__DECLARE_EVT1(wxEVT_BUTTON, winid, wxCommandEventHandler(func)) #define EVT_SLIDER(winid, func) wx__DECLARE_EVT1(wxEVT_SLIDER, winid, wxCommandEventHandler(func)) #define EVT_RADIOBOX(winid, func) wx__DECLARE_EVT1(wxEVT_RADIOBOX, winid, wxCommandEventHandler(func)) #define EVT_RADIOBUTTON(winid, func) wx__DECLARE_EVT1(wxEVT_RADIOBUTTON, winid, wxCommandEventHandler(func)) // EVT_SCROLLBAR is now obsolete since we use EVT_COMMAND_SCROLL... events #define EVT_SCROLLBAR(winid, func) wx__DECLARE_EVT1(wxEVT_SCROLLBAR, winid, wxCommandEventHandler(func)) #define EVT_VLBOX(winid, func) wx__DECLARE_EVT1(wxEVT_VLBOX, winid, wxCommandEventHandler(func)) #define EVT_COMBOBOX(winid, func) wx__DECLARE_EVT1(wxEVT_COMBOBOX, winid, wxCommandEventHandler(func)) #define EVT_TOOL(winid, func) wx__DECLARE_EVT1(wxEVT_TOOL, winid, wxCommandEventHandler(func)) #define EVT_TOOL_DROPDOWN(winid, func) wx__DECLARE_EVT1(wxEVT_TOOL_DROPDOWN, winid, wxCommandEventHandler(func)) #define EVT_TOOL_RANGE(id1, id2, func) wx__DECLARE_EVT2(wxEVT_TOOL, id1, id2, wxCommandEventHandler(func)) #define EVT_TOOL_RCLICKED(winid, func) wx__DECLARE_EVT1(wxEVT_TOOL_RCLICKED, winid, wxCommandEventHandler(func)) #define EVT_TOOL_RCLICKED_RANGE(id1, id2, func) wx__DECLARE_EVT2(wxEVT_TOOL_RCLICKED, id1, id2, wxCommandEventHandler(func)) #define EVT_TOOL_ENTER(winid, func) wx__DECLARE_EVT1(wxEVT_TOOL_ENTER, winid, wxCommandEventHandler(func)) #define EVT_CHECKLISTBOX(winid, func) wx__DECLARE_EVT1(wxEVT_CHECKLISTBOX, winid, wxCommandEventHandler(func)) #define EVT_COMBOBOX_DROPDOWN(winid, func) wx__DECLARE_EVT1(wxEVT_COMBOBOX_DROPDOWN, winid, wxCommandEventHandler(func)) #define EVT_COMBOBOX_CLOSEUP(winid, func) wx__DECLARE_EVT1(wxEVT_COMBOBOX_CLOSEUP, winid, wxCommandEventHandler(func)) // Generic command events #define EVT_COMMAND_LEFT_CLICK(winid, func) wx__DECLARE_EVT1(wxEVT_COMMAND_LEFT_CLICK, winid, wxCommandEventHandler(func)) #define EVT_COMMAND_LEFT_DCLICK(winid, func) wx__DECLARE_EVT1(wxEVT_COMMAND_LEFT_DCLICK, winid, wxCommandEventHandler(func)) #define EVT_COMMAND_RIGHT_CLICK(winid, func) wx__DECLARE_EVT1(wxEVT_COMMAND_RIGHT_CLICK, winid, wxCommandEventHandler(func)) #define EVT_COMMAND_RIGHT_DCLICK(winid, func) wx__DECLARE_EVT1(wxEVT_COMMAND_RIGHT_DCLICK, winid, wxCommandEventHandler(func)) #define EVT_COMMAND_SET_FOCUS(winid, func) wx__DECLARE_EVT1(wxEVT_COMMAND_SET_FOCUS, winid, wxCommandEventHandler(func)) #define EVT_COMMAND_KILL_FOCUS(winid, func) wx__DECLARE_EVT1(wxEVT_COMMAND_KILL_FOCUS, winid, wxCommandEventHandler(func)) #define EVT_COMMAND_ENTER(winid, func) wx__DECLARE_EVT1(wxEVT_COMMAND_ENTER, winid, wxCommandEventHandler(func)) // Joystick events #define EVT_JOY_BUTTON_DOWN(func) wx__DECLARE_EVT0(wxEVT_JOY_BUTTON_DOWN, wxJoystickEventHandler(func)) #define EVT_JOY_BUTTON_UP(func) wx__DECLARE_EVT0(wxEVT_JOY_BUTTON_UP, wxJoystickEventHandler(func)) #define EVT_JOY_MOVE(func) wx__DECLARE_EVT0(wxEVT_JOY_MOVE, wxJoystickEventHandler(func)) #define EVT_JOY_ZMOVE(func) wx__DECLARE_EVT0(wxEVT_JOY_ZMOVE, wxJoystickEventHandler(func)) // All joystick events #define EVT_JOYSTICK_EVENTS(func) \ EVT_JOY_BUTTON_DOWN(func) \ EVT_JOY_BUTTON_UP(func) \ EVT_JOY_MOVE(func) \ EVT_JOY_ZMOVE(func) // Idle event #define EVT_IDLE(func) wx__DECLARE_EVT0(wxEVT_IDLE, wxIdleEventHandler(func)) // Update UI event #define EVT_UPDATE_UI(winid, func) wx__DECLARE_EVT1(wxEVT_UPDATE_UI, winid, wxUpdateUIEventHandler(func)) #define EVT_UPDATE_UI_RANGE(id1, id2, func) wx__DECLARE_EVT2(wxEVT_UPDATE_UI, id1, id2, wxUpdateUIEventHandler(func)) // Help events #define EVT_HELP(winid, func) wx__DECLARE_EVT1(wxEVT_HELP, winid, wxHelpEventHandler(func)) #define EVT_HELP_RANGE(id1, id2, func) wx__DECLARE_EVT2(wxEVT_HELP, id1, id2, wxHelpEventHandler(func)) #define EVT_DETAILED_HELP(winid, func) wx__DECLARE_EVT1(wxEVT_DETAILED_HELP, winid, wxHelpEventHandler(func)) #define EVT_DETAILED_HELP_RANGE(id1, id2, func) wx__DECLARE_EVT2(wxEVT_DETAILED_HELP, id1, id2, wxHelpEventHandler(func)) // Context Menu Events #define EVT_CONTEXT_MENU(func) wx__DECLARE_EVT0(wxEVT_CONTEXT_MENU, wxContextMenuEventHandler(func)) #define EVT_COMMAND_CONTEXT_MENU(winid, func) wx__DECLARE_EVT1(wxEVT_CONTEXT_MENU, winid, wxContextMenuEventHandler(func)) // Clipboard text Events #define EVT_TEXT_CUT(winid, func) wx__DECLARE_EVT1(wxEVT_TEXT_CUT, winid, wxClipboardTextEventHandler(func)) #define EVT_TEXT_COPY(winid, func) wx__DECLARE_EVT1(wxEVT_TEXT_COPY, winid, wxClipboardTextEventHandler(func)) #define EVT_TEXT_PASTE(winid, func) wx__DECLARE_EVT1(wxEVT_TEXT_PASTE, winid, wxClipboardTextEventHandler(func)) // Thread events #define EVT_THREAD(id, func) wx__DECLARE_EVT1(wxEVT_THREAD, id, wxThreadEventHandler(func)) // ---------------------------------------------------------------------------- // Helper functions // ---------------------------------------------------------------------------- #if wxUSE_GUI // Find a window with the focus, that is also a descendant of the given window. // This is used to determine the window to initially send commands to. WXDLLIMPEXP_CORE wxWindow* wxFindFocusDescendant(wxWindow* ancestor); #endif // wxUSE_GUI // ---------------------------------------------------------------------------- // Compatibility macro aliases // ---------------------------------------------------------------------------- // deprecated variants _not_ requiring a semicolon after them and without wx prefix // (note that also some wx-prefixed macro do _not_ require a semicolon because // it's not always possible to force the compiler to require it) #define DECLARE_EVENT_TABLE_ENTRY(type, winid, idLast, fn, obj) \ wxDECLARE_EVENT_TABLE_ENTRY(type, winid, idLast, fn, obj) #define DECLARE_EVENT_TABLE_TERMINATOR() wxDECLARE_EVENT_TABLE_TERMINATOR() #define DECLARE_EVENT_TABLE() wxDECLARE_EVENT_TABLE(); #define BEGIN_EVENT_TABLE(a,b) wxBEGIN_EVENT_TABLE(a,b) #define BEGIN_EVENT_TABLE_TEMPLATE1(a,b,c) wxBEGIN_EVENT_TABLE_TEMPLATE1(a,b,c) #define BEGIN_EVENT_TABLE_TEMPLATE2(a,b,c,d) wxBEGIN_EVENT_TABLE_TEMPLATE2(a,b,c,d) #define BEGIN_EVENT_TABLE_TEMPLATE3(a,b,c,d,e) wxBEGIN_EVENT_TABLE_TEMPLATE3(a,b,c,d,e) #define BEGIN_EVENT_TABLE_TEMPLATE4(a,b,c,d,e,f) wxBEGIN_EVENT_TABLE_TEMPLATE4(a,b,c,d,e,f) #define BEGIN_EVENT_TABLE_TEMPLATE5(a,b,c,d,e,f,g) wxBEGIN_EVENT_TABLE_TEMPLATE5(a,b,c,d,e,f,g) #define BEGIN_EVENT_TABLE_TEMPLATE6(a,b,c,d,e,f,g,h) wxBEGIN_EVENT_TABLE_TEMPLATE6(a,b,c,d,e,f,g,h) #define END_EVENT_TABLE() wxEND_EVENT_TABLE() // other obsolete event declaration/definition macros; we don't need them any longer // but we keep them for compatibility as it doesn't cost us anything anyhow #define BEGIN_DECLARE_EVENT_TYPES() #define END_DECLARE_EVENT_TYPES() #define DECLARE_EXPORTED_EVENT_TYPE(expdecl, name, value) \ extern expdecl const wxEventType name; #define DECLARE_EVENT_TYPE(name, value) \ DECLARE_EXPORTED_EVENT_TYPE(WXDLLIMPEXP_CORE, name, value) #define DECLARE_LOCAL_EVENT_TYPE(name, value) \ DECLARE_EXPORTED_EVENT_TYPE(wxEMPTY_PARAMETER_VALUE, name, value) #define DEFINE_EVENT_TYPE(name) const wxEventType name = wxNewEventType(); #define DEFINE_LOCAL_EVENT_TYPE(name) DEFINE_EVENT_TYPE(name) // alias for backward compatibility with 2.9.0: #define wxEVT_COMMAND_THREAD wxEVT_THREAD // other old wxEVT_COMMAND_* constants #define wxEVT_COMMAND_BUTTON_CLICKED wxEVT_BUTTON #define wxEVT_COMMAND_CHECKBOX_CLICKED wxEVT_CHECKBOX #define wxEVT_COMMAND_CHOICE_SELECTED wxEVT_CHOICE #define wxEVT_COMMAND_LISTBOX_SELECTED wxEVT_LISTBOX #define wxEVT_COMMAND_LISTBOX_DOUBLECLICKED wxEVT_LISTBOX_DCLICK #define wxEVT_COMMAND_CHECKLISTBOX_TOGGLED wxEVT_CHECKLISTBOX #define wxEVT_COMMAND_MENU_SELECTED wxEVT_MENU #define wxEVT_COMMAND_TOOL_CLICKED wxEVT_TOOL #define wxEVT_COMMAND_SLIDER_UPDATED wxEVT_SLIDER #define wxEVT_COMMAND_RADIOBOX_SELECTED wxEVT_RADIOBOX #define wxEVT_COMMAND_RADIOBUTTON_SELECTED wxEVT_RADIOBUTTON #define wxEVT_COMMAND_SCROLLBAR_UPDATED wxEVT_SCROLLBAR #define wxEVT_COMMAND_VLBOX_SELECTED wxEVT_VLBOX #define wxEVT_COMMAND_COMBOBOX_SELECTED wxEVT_COMBOBOX #define wxEVT_COMMAND_TOOL_RCLICKED wxEVT_TOOL_RCLICKED #define wxEVT_COMMAND_TOOL_DROPDOWN_CLICKED wxEVT_TOOL_DROPDOWN #define wxEVT_COMMAND_TOOL_ENTER wxEVT_TOOL_ENTER #define wxEVT_COMMAND_COMBOBOX_DROPDOWN wxEVT_COMBOBOX_DROPDOWN #define wxEVT_COMMAND_COMBOBOX_CLOSEUP wxEVT_COMBOBOX_CLOSEUP #define wxEVT_COMMAND_TEXT_COPY wxEVT_TEXT_COPY #define wxEVT_COMMAND_TEXT_CUT wxEVT_TEXT_CUT #define wxEVT_COMMAND_TEXT_PASTE wxEVT_TEXT_PASTE #define wxEVT_COMMAND_TEXT_UPDATED wxEVT_TEXT #endif // _WX_EVENT_H_
h
rticonnextdds-usecases
data/projects/rticonnextdds-usecases/VehicleTracking/ExampleCode/thirdparty/wxWidgets-3.1.2/Win64/include/wx/catch_cppunit.h
///////////////////////////////////////////////////////////////////////////// // Name: wx/catch_cppunit.h // Purpose: Reimplementation of CppUnit macros in terms of CATCH // Author: Vadim Zeitlin // Created: 2017-10-30 // Copyright: (c) 2017 Vadim Zeitlin <[email protected]> ///////////////////////////////////////////////////////////////////////////// #ifndef _WX_CATCH_CPPUNIT_H_ #define _WX_CATCH_CPPUNIT_H_ #include "catch.hpp" // CppUnit-compatible macros. // CPPUNIT_ASSERTs are mapped to REQUIRE(), not CHECK(), as this is how CppUnit // works but in many cases they really should be CHECK()s instead, i.e. the // test should continue to run even if one assert failed. Unfortunately there // is no automatic way to know it, so the existing code will need to be // reviewed and CHECK() used explicitly where appropriate. // // Also notice that we don't use parentheses around x and y macro arguments in // the macro expansion, as usual. This is because these parentheses would then // appear in CATCH error messages if the assertion fails, making them much less // readable and omitting should be fine here, exceptionally, as the arguments // of these macros are usually just simple expressions. #define CPPUNIT_ASSERT(cond) REQUIRE(cond) #define CPPUNIT_ASSERT_EQUAL(x, y) REQUIRE(x == y) // Using INFO() disallows putting more than one of these macros on the same // line but this can happen if they're used inside another macro, so wrap it // inside a scope. #define CPPUNIT_ASSERT_MESSAGE(msg, cond) \ do { INFO(msg); REQUIRE(cond); } while (Catch::alwaysFalse()) #define CPPUNIT_ASSERT_EQUAL_MESSAGE(msg, x, y) \ do { INFO(msg); REQUIRE(x == y); } while (Catch::alwaysFalse()) // CATCH Approx class uses the upper bound of "epsilon*(scale + max(|x|, |y|))" // for |x - y| which is not really compatible with our fixed delta, so we can't // use it here. #define CPPUNIT_ASSERT_DOUBLES_EQUAL(x, y, delta) \ REQUIRE(std::abs(x - y) < delta) #define CPPUNIT_FAIL(msg) FAIL(msg) #define CPPUNIT_ASSERT_THROW(expr, exception) \ try \ { \ expr; \ FAIL("Expected exception of type " #exception \ " not thrown by " #expr); \ } \ catch ( exception& ) {} // Define conversions to strings for some common wxWidgets types. namespace Catch { template <> struct StringMaker<wxUniChar> { static std::string convert(wxUniChar uc) { return wxString(uc).ToStdString(wxConvUTF8); } }; template <> struct StringMaker<wxUniCharRef> { static std::string convert(wxUniCharRef ucr) { return wxString(ucr).ToStdString(wxConvUTF8); } }; // While this conversion already works due to the existence of the stream // insertion operator for wxString, define a custom one making it more // obvious when strings containing non-printable characters differ. template <> struct StringMaker<wxString> { static std::string convert(const wxString& wxs) { std::string s; s.reserve(wxs.length()); for ( wxString::const_iterator i = wxs.begin(); i != wxs.end(); ++i ) { #if wxUSE_UNICODE if ( !iswprint(*i) ) s += wxString::Format("\\u%04X", *i).ToStdString(); else #endif // wxUSE_UNICODE s += *i; } return s; } }; } // Use a different namespace for our mock ups of the real declarations in // CppUnit namespace to avoid clashes if we end up being linked with the real // CppUnit library, but bring it into scope with a using directive below to // make it possible to compile the original code using CppUnit unmodified. namespace CatchCppUnit { namespace CppUnit { // These classes don't really correspond to the real CppUnit ones, but contain // just the minimum we need to make CPPUNIT_TEST() macro and our mock up of // TestSuite class work. class Test { public: // Name argument exists only for compatibility with the real CppUnit but is // not used here. explicit Test(const std::string& name = std::string()) : m_name(name) { } virtual ~Test() { } virtual void runTest() = 0; const std::string& getName() const { return m_name; } private: std::string m_name; }; class TestCase : public Test { public: explicit TestCase(const std::string& name = std::string()) : Test(name) { } virtual void setUp() {} virtual void tearDown() {} }; class TestSuite : public Test { public: explicit TestSuite(const std::string& name = std::string()) : Test(name) { } ~TestSuite() { for ( size_t n = 0; n < m_tests.size(); ++n ) { delete m_tests[n]; } } void addTest(Test* test) { m_tests.push_back(test); } size_t getChildTestCount() const { return m_tests.size(); } void runTest() wxOVERRIDE { for ( size_t n = 0; n < m_tests.size(); ++n ) { m_tests[n]->runTest(); } } private: std::vector<Test*> m_tests; wxDECLARE_NO_COPY_CLASS(TestSuite); }; } // namespace CppUnit } // namespace CatchCppUnit using namespace CatchCppUnit; // Helpers used in the implementation of the macros below. namespace wxPrivate { // An object which resets a string to its old value when going out of scope. class TempStringAssign { public: explicit TempStringAssign(std::string& str, const char* value) : m_str(str), m_orig(str) { str = value; } ~TempStringAssign() { m_str = m_orig; } private: std::string& m_str; const std::string m_orig; wxDECLARE_NO_COPY_CLASS(TempStringAssign); }; // These two strings are used to implement wxGetCurrentTestName() and must be // defined in the test driver. extern std::string wxTheCurrentTestClass, wxTheCurrentTestMethod; } // namespace wxPrivate inline std::string wxGetCurrentTestName() { std::string s = wxPrivate::wxTheCurrentTestClass; if ( !s.empty() && !wxPrivate::wxTheCurrentTestMethod.empty() ) s += "::"; s += wxPrivate::wxTheCurrentTestMethod; return s; } // Notice that the use of this macro unconditionally changes the protection for // everything that follows it to "public". This is necessary to allow taking // the address of the runTest() method in CPPUNIT_TEST_SUITE_REGISTRATION() // below and there just doesn't seem to be any way around it. #define CPPUNIT_TEST_SUITE(testclass) \ public: \ void runTest() wxOVERRIDE \ { \ using namespace wxPrivate; \ TempStringAssign setClass(wxTheCurrentTestClass, #testclass) #define CPPUNIT_TEST(testname) \ SECTION(#testname) \ { \ TempStringAssign setMethod(wxTheCurrentTestMethod, #testname); \ setUp(); \ try \ { \ testname(); \ } \ catch ( ... ) \ { \ tearDown(); \ throw; \ } \ tearDown(); \ } #define CPPUNIT_TEST_SUITE_END() \ } \ struct EatNextSemicolon #define wxREGISTER_UNIT_TEST_WITH_TAGS(testclass, tags) \ METHOD_AS_TEST_CASE(testclass::runTest, #testclass, tags) \ struct EatNextSemicolon #define CPPUNIT_TEST_SUITE_NAMED_REGISTRATION(testclass, suitename) \ wxREGISTER_UNIT_TEST_WITH_TAGS(testclass, "[" suitename "]") // Existings tests always use both this macro and the named registration one // above, but we can't register the same test case twice with CATCH, so simply // ignore this one. #define CPPUNIT_TEST_SUITE_REGISTRATION(testclass) \ struct EatNextSemicolon // ---------------------------------------------------------------------------- // wxWidgets-specific macros // ---------------------------------------------------------------------------- // Convenient variant of INFO() which uses wxString::Format() internally. #define wxINFO_FMT_HELPER(fmt, ...) \ wxString::Format(fmt, __VA_ARGS__).ToStdString(wxConvUTF8) #define wxINFO_FMT(...) INFO(wxINFO_FMT_HELPER(__VA_ARGS__)) // Use this macro to assert with the given formatted message (it should contain // the format string and arguments in a separate pair of parentheses) #define WX_ASSERT_MESSAGE(msg, cond) \ CPPUNIT_ASSERT_MESSAGE(std::string(wxString::Format msg .mb_str()), (cond)) #define WX_ASSERT_EQUAL_MESSAGE(msg, expected, actual) \ CPPUNIT_ASSERT_EQUAL_MESSAGE(std::string(wxString::Format msg .mb_str()), \ (expected), (actual)) #endif // _WX_CATCH_CPPUNIT_H_
h
rticonnextdds-usecases
data/projects/rticonnextdds-usecases/VehicleTracking/ExampleCode/thirdparty/wxWidgets-3.1.2/Win64/include/wx/panel.h
///////////////////////////////////////////////////////////////////////////// // Name: wx/panel.h // Purpose: Base header for wxPanel // Author: Julian Smart // Modified by: // Created: // Copyright: (c) Julian Smart // (c) 2011 Vadim Zeitlin <[email protected]> // Licence: wxWindows Licence ///////////////////////////////////////////////////////////////////////////// #ifndef _WX_PANEL_H_BASE_ #define _WX_PANEL_H_BASE_ // ---------------------------------------------------------------------------- // headers and forward declarations // ---------------------------------------------------------------------------- #include "wx/window.h" #include "wx/containr.h" class WXDLLIMPEXP_FWD_CORE wxControlContainer; extern WXDLLIMPEXP_DATA_CORE(const char) wxPanelNameStr[]; // ---------------------------------------------------------------------------- // wxPanel contains other controls and implements TAB traversal between them // ---------------------------------------------------------------------------- class WXDLLIMPEXP_CORE wxPanelBase : public wxNavigationEnabled<wxWindow> { public: wxPanelBase() { } // Derived classes should also provide this constructor: /* wxPanelBase(wxWindow *parent, wxWindowID winid = wxID_ANY, const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxDefaultSize, long style = wxTAB_TRAVERSAL | wxNO_BORDER, const wxString& name = wxPanelNameStr); */ // Pseudo ctor bool Create(wxWindow *parent, wxWindowID winid = wxID_ANY, const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxDefaultSize, long style = wxTAB_TRAVERSAL | wxNO_BORDER, const wxString& name = wxPanelNameStr); // implementation from now on // -------------------------- virtual void InitDialog() wxOVERRIDE; private: wxDECLARE_NO_COPY_CLASS(wxPanelBase); }; #if defined(__WXUNIVERSAL__) #include "wx/univ/panel.h" #elif defined(__WXMSW__) #include "wx/msw/panel.h" #else #define wxHAS_GENERIC_PANEL #include "wx/generic/panelg.h" #endif #endif // _WX_PANELH_BASE_
h
rticonnextdds-usecases
data/projects/rticonnextdds-usecases/VehicleTracking/ExampleCode/thirdparty/wxWidgets-3.1.2/Win64/include/wx/object.h
///////////////////////////////////////////////////////////////////////////// // Name: wx/object.h // Purpose: wxObject class, plus run-time type information macros // Author: Julian Smart // Modified by: Ron Lee // Created: 01/02/97 // Copyright: (c) 1997 Julian Smart // (c) 2001 Ron Lee <[email protected]> // Licence: wxWindows licence ///////////////////////////////////////////////////////////////////////////// #ifndef _WX_OBJECTH__ #define _WX_OBJECTH__ // ---------------------------------------------------------------------------- // headers // ---------------------------------------------------------------------------- #include "wx/memory.h" #define wxDECLARE_CLASS_INFO_ITERATORS() \ class WXDLLIMPEXP_BASE const_iterator \ { \ typedef wxHashTable_Node Node; \ public: \ typedef const wxClassInfo* value_type; \ typedef const value_type& const_reference; \ typedef const_iterator itor; \ typedef value_type* ptr_type; \ \ Node* m_node; \ wxHashTable* m_table; \ public: \ typedef const_reference reference_type; \ typedef ptr_type pointer_type; \ \ const_iterator(Node* node, wxHashTable* table) \ : m_node(node), m_table(table) { } \ const_iterator() : m_node(NULL), m_table(NULL) { } \ value_type operator*() const; \ itor& operator++(); \ const itor operator++(int); \ bool operator!=(const itor& it) const \ { return it.m_node != m_node; } \ bool operator==(const itor& it) const \ { return it.m_node == m_node; } \ }; \ \ static const_iterator begin_classinfo(); \ static const_iterator end_classinfo() // based on the value of wxUSE_EXTENDED_RTTI symbol, // only one of the RTTI system will be compiled: // - the "old" one (defined by rtti.h) or // - the "new" one (defined by xti.h) #include "wx/xti.h" #include "wx/rtti.h" #define wxIMPLEMENT_CLASS(name, basename) \ wxIMPLEMENT_ABSTRACT_CLASS(name, basename) #define wxIMPLEMENT_CLASS2(name, basename1, basename2) \ wxIMPLEMENT_ABSTRACT_CLASS2(name, basename1, basename2) // ----------------------------------- // for pluggable classes // ----------------------------------- // NOTE: this should probably be the very first statement // in the class declaration so wxPluginSentinel is // the first member initialised and the last destroyed. // _DECLARE_DL_SENTINEL(name) wxPluginSentinel m_pluginsentinel; #if wxUSE_NESTED_CLASSES #define _DECLARE_DL_SENTINEL(name, exportdecl) \ class exportdecl name##PluginSentinel { \ private: \ static const wxString sm_className; \ public: \ name##PluginSentinel(); \ ~name##PluginSentinel(); \ }; \ name##PluginSentinel m_pluginsentinel #define _IMPLEMENT_DL_SENTINEL(name) \ const wxString name::name##PluginSentinel::sm_className(#name); \ name::name##PluginSentinel::name##PluginSentinel() { \ wxPluginLibrary *e = (wxPluginLibrary*) wxPluginLibrary::ms_classes.Get(#name); \ if( e != 0 ) { e->RefObj(); } \ } \ name::name##PluginSentinel::~name##PluginSentinel() { \ wxPluginLibrary *e = (wxPluginLibrary*) wxPluginLibrary::ms_classes.Get(#name); \ if( e != 0 ) { e->UnrefObj(); } \ } #else #define _DECLARE_DL_SENTINEL(name) #define _IMPLEMENT_DL_SENTINEL(name) #endif // wxUSE_NESTED_CLASSES #define wxDECLARE_PLUGGABLE_CLASS(name) \ wxDECLARE_DYNAMIC_CLASS(name); _DECLARE_DL_SENTINEL(name, WXDLLIMPEXP_CORE) #define wxDECLARE_ABSTRACT_PLUGGABLE_CLASS(name) \ wxDECLARE_ABSTRACT_CLASS(name); _DECLARE_DL_SENTINEL(name, WXDLLIMPEXP_CORE) #define wxDECLARE_USER_EXPORTED_PLUGGABLE_CLASS(name, usergoo) \ wxDECLARE_DYNAMIC_CLASS(name); _DECLARE_DL_SENTINEL(name, usergoo) #define wxDECLARE_USER_EXPORTED_ABSTRACT_PLUGGABLE_CLASS(name, usergoo) \ wxDECLARE_ABSTRACT_CLASS(name); _DECLARE_DL_SENTINEL(name, usergoo) #define wxIMPLEMENT_PLUGGABLE_CLASS(name, basename) \ wxIMPLEMENT_DYNAMIC_CLASS(name, basename) _IMPLEMENT_DL_SENTINEL(name) #define wxIMPLEMENT_PLUGGABLE_CLASS2(name, basename1, basename2) \ wxIMPLEMENT_DYNAMIC_CLASS2(name, basename1, basename2) _IMPLEMENT_DL_SENTINEL(name) #define wxIMPLEMENT_ABSTRACT_PLUGGABLE_CLASS(name, basename) \ wxIMPLEMENT_ABSTRACT_CLASS(name, basename) _IMPLEMENT_DL_SENTINEL(name) #define wxIMPLEMENT_ABSTRACT_PLUGGABLE_CLASS2(name, basename1, basename2) \ wxIMPLEMENT_ABSTRACT_CLASS2(name, basename1, basename2) _IMPLEMENT_DL_SENTINEL(name) #define wxIMPLEMENT_USER_EXPORTED_PLUGGABLE_CLASS(name, basename) \ wxIMPLEMENT_PLUGGABLE_CLASS(name, basename) #define wxIMPLEMENT_USER_EXPORTED_PLUGGABLE_CLASS2(name, basename1, basename2) \ wxIMPLEMENT_PLUGGABLE_CLASS2(name, basename1, basename2) #define wxIMPLEMENT_USER_EXPORTED_ABSTRACT_PLUGGABLE_CLASS(name, basename) \ wxIMPLEMENT_ABSTRACT_PLUGGABLE_CLASS(name, basename) #define wxIMPLEMENT_USER_EXPORTED_ABSTRACT_PLUGGABLE_CLASS2(name, basename1, basename2) \ wxIMPLEMENT_ABSTRACT_PLUGGABLE_CLASS2(name, basename1, basename2) #define wxCLASSINFO(name) (&name::ms_classInfo) #define wxIS_KIND_OF(obj, className) obj->IsKindOf(&className::ms_classInfo) // Just seems a bit nicer-looking (pretend it's not a macro) #define wxIsKindOf(obj, className) obj->IsKindOf(&className::ms_classInfo) // this cast does some more checks at compile time as it uses static_cast // internally // // note that it still has different semantics from dynamic_cast<> and so can't // be replaced by it as long as there are any compilers not supporting it #define wxDynamicCast(obj, className) \ ((className *) wxCheckDynamicCast( \ const_cast<wxObject *>(static_cast<const wxObject *>(\ const_cast<className *>(static_cast<const className *>(obj)))), \ &className::ms_classInfo)) // The 'this' pointer is always true, so use this version // to cast the this pointer and avoid compiler warnings. #define wxDynamicCastThis(className) \ (IsKindOf(&className::ms_classInfo) ? (className *)(this) : (className *)0) template <class T> inline T *wxCheckCast(const void *ptr) { wxASSERT_MSG( wxDynamicCast(ptr, T), "wxStaticCast() used incorrectly" ); return const_cast<T *>(static_cast<const T *>(ptr)); } #define wxStaticCast(obj, className) wxCheckCast<className>(obj) // ---------------------------------------------------------------------------- // set up memory debugging macros // ---------------------------------------------------------------------------- /* Which new/delete operator variants do we want? _WX_WANT_NEW_SIZET_WXCHAR_INT = void *operator new (size_t size, wxChar *fileName = 0, int lineNum = 0) _WX_WANT_DELETE_VOID = void operator delete (void * buf) _WX_WANT_DELETE_VOID_WXCHAR_INT = void operator delete(void *buf, wxChar*, int) _WX_WANT_ARRAY_NEW_SIZET_WXCHAR_INT = void *operator new[] (size_t size, wxChar *fileName , int lineNum = 0) _WX_WANT_ARRAY_DELETE_VOID = void operator delete[] (void *buf) _WX_WANT_ARRAY_DELETE_VOID_WXCHAR_INT = void operator delete[] (void* buf, wxChar*, int ) */ #if wxUSE_MEMORY_TRACING // All compilers get these ones #define _WX_WANT_NEW_SIZET_WXCHAR_INT #define _WX_WANT_DELETE_VOID #if defined(__VISUALC__) #define _WX_WANT_DELETE_VOID_WXCHAR_INT #endif // Now see who (if anyone) gets the array memory operators #if wxUSE_ARRAY_MEMORY_OPERATORS // Everyone except Visual C++ (cause problems for VC++ - crashes) #if !defined(__VISUALC__) #define _WX_WANT_ARRAY_NEW_SIZET_WXCHAR_INT #endif // Everyone except Visual C++ (cause problems for VC++ - crashes) #if !defined(__VISUALC__) #define _WX_WANT_ARRAY_DELETE_VOID #endif #endif // wxUSE_ARRAY_MEMORY_OPERATORS #endif // wxUSE_MEMORY_TRACING // ---------------------------------------------------------------------------- // Compatibility macro aliases DECLARE group // ---------------------------------------------------------------------------- // deprecated variants _not_ requiring a semicolon after them and without wx prefix. // (note that also some wx-prefixed macro do _not_ require a semicolon because // it's not always possible to force the compiler to require it) #define DECLARE_CLASS_INFO_ITERATORS() wxDECLARE_CLASS_INFO_ITERATORS(); #define DECLARE_ABSTRACT_CLASS(n) wxDECLARE_ABSTRACT_CLASS(n); #define DECLARE_DYNAMIC_CLASS_NO_ASSIGN(n) wxDECLARE_DYNAMIC_CLASS_NO_ASSIGN(n); #define DECLARE_DYNAMIC_CLASS_NO_COPY(n) wxDECLARE_DYNAMIC_CLASS_NO_COPY(n); #define DECLARE_DYNAMIC_CLASS(n) wxDECLARE_DYNAMIC_CLASS(n); #define DECLARE_CLASS(n) wxDECLARE_CLASS(n); #define DECLARE_PLUGGABLE_CLASS(n) wxDECLARE_PLUGGABLE_CLASS(n); #define DECLARE_ABSTRACT_PLUGGABLE_CLASS(n) wxDECLARE_ABSTRACT_PLUGGABLE_CLASS(n); #define DECLARE_USER_EXPORTED_PLUGGABLE_CLASS(n,u) wxDECLARE_USER_EXPORTED_PLUGGABLE_CLASS(n,u); #define DECLARE_USER_EXPORTED_ABSTRACT_PLUGGABLE_CLASS(n,u) wxDECLARE_USER_EXPORTED_ABSTRACT_PLUGGABLE_CLASS(n,u); // ---------------------------------------------------------------------------- // wxRefCounter: ref counted data "manager" // ---------------------------------------------------------------------------- class WXDLLIMPEXP_BASE wxRefCounter { public: wxRefCounter() { m_count = 1; } int GetRefCount() const { return m_count; } void IncRef() { m_count++; } void DecRef(); protected: // this object should never be destroyed directly but only as a // result of a DecRef() call: virtual ~wxRefCounter() { } private: // our refcount: int m_count; // It doesn't make sense to copy the reference counted objects, a new ref // counter should be created for a new object instead and compilation // errors in the code using wxRefCounter due to the lack of copy ctor often // indicate a problem, e.g. a forgotten copy ctor implementation somewhere. wxDECLARE_NO_COPY_CLASS(wxRefCounter); }; // ---------------------------------------------------------------------------- // wxObjectRefData: ref counted data meant to be stored in wxObject // ---------------------------------------------------------------------------- typedef wxRefCounter wxObjectRefData; // ---------------------------------------------------------------------------- // wxObjectDataPtr: helper class to avoid memleaks because of missing calls // to wxObjectRefData::DecRef // ---------------------------------------------------------------------------- template <class T> class wxObjectDataPtr { public: typedef T element_type; explicit wxObjectDataPtr(T *ptr = NULL) : m_ptr(ptr) {} // copy ctor wxObjectDataPtr(const wxObjectDataPtr<T> &tocopy) : m_ptr(tocopy.m_ptr) { if (m_ptr) m_ptr->IncRef(); } ~wxObjectDataPtr() { if (m_ptr) m_ptr->DecRef(); } T *get() const { return m_ptr; } // test for pointer validity: defining conversion to unspecified_bool_type // and not more obvious bool to avoid implicit conversions to integer types typedef T *(wxObjectDataPtr<T>::*unspecified_bool_type)() const; operator unspecified_bool_type() const { return m_ptr ? &wxObjectDataPtr<T>::get : NULL; } T& operator*() const { wxASSERT(m_ptr != NULL); return *(m_ptr); } T *operator->() const { wxASSERT(m_ptr != NULL); return get(); } void reset(T *ptr) { if (m_ptr) m_ptr->DecRef(); m_ptr = ptr; } wxObjectDataPtr& operator=(const wxObjectDataPtr &tocopy) { if (m_ptr) m_ptr->DecRef(); m_ptr = tocopy.m_ptr; if (m_ptr) m_ptr->IncRef(); return *this; } wxObjectDataPtr& operator=(T *ptr) { if (m_ptr) m_ptr->DecRef(); m_ptr = ptr; return *this; } private: T *m_ptr; }; // ---------------------------------------------------------------------------- // wxObject: the root class of wxWidgets object hierarchy // ---------------------------------------------------------------------------- class WXDLLIMPEXP_BASE wxObject { wxDECLARE_ABSTRACT_CLASS(wxObject); public: wxObject() { m_refData = NULL; } virtual ~wxObject() { UnRef(); } wxObject(const wxObject& other) { m_refData = other.m_refData; if (m_refData) m_refData->IncRef(); } wxObject& operator=(const wxObject& other) { if ( this != &other ) { Ref(other); } return *this; } bool IsKindOf(const wxClassInfo *info) const; // Turn on the correct set of new and delete operators #ifdef _WX_WANT_NEW_SIZET_WXCHAR_INT void *operator new ( size_t size, const wxChar *fileName = NULL, int lineNum = 0 ); #endif #ifdef _WX_WANT_DELETE_VOID void operator delete ( void * buf ); #endif #ifdef _WX_WANT_DELETE_VOID_WXCHAR_INT void operator delete ( void *buf, const wxChar*, int ); #endif #ifdef _WX_WANT_ARRAY_NEW_SIZET_WXCHAR_INT void *operator new[] ( size_t size, const wxChar *fileName = NULL, int lineNum = 0 ); #endif #ifdef _WX_WANT_ARRAY_DELETE_VOID void operator delete[] ( void *buf ); #endif #ifdef _WX_WANT_ARRAY_DELETE_VOID_WXCHAR_INT void operator delete[] (void* buf, const wxChar*, int ); #endif // ref counted data handling methods // get/set wxObjectRefData *GetRefData() const { return m_refData; } void SetRefData(wxObjectRefData *data) { m_refData = data; } // make a 'clone' of the object void Ref(const wxObject& clone); // destroy a reference void UnRef(); // Make sure this object has only one reference void UnShare() { AllocExclusive(); } // check if this object references the same data as the other one bool IsSameAs(const wxObject& o) const { return m_refData == o.m_refData; } protected: // ensure that our data is not shared with anybody else: if we have no // data, it is created using CreateRefData() below, if we have shared data // it is copied using CloneRefData(), otherwise nothing is done void AllocExclusive(); // both methods must be implemented if AllocExclusive() is used, not pure // virtual only because of the backwards compatibility reasons // create a new m_refData virtual wxObjectRefData *CreateRefData() const; // create a new m_refData initialized with the given one virtual wxObjectRefData *CloneRefData(const wxObjectRefData *data) const; wxObjectRefData *m_refData; }; inline wxObject *wxCheckDynamicCast(wxObject *obj, wxClassInfo *classInfo) { return obj && obj->GetClassInfo()->IsKindOf(classInfo) ? obj : NULL; } #include "wx/xti2.h" // ---------------------------------------------------------------------------- // more debugging macros // ---------------------------------------------------------------------------- #if wxUSE_DEBUG_NEW_ALWAYS #define WXDEBUG_NEW new(__TFILE__,__LINE__) #if wxUSE_GLOBAL_MEMORY_OPERATORS #define new WXDEBUG_NEW #elif defined(__VISUALC__) // Including this file redefines new and allows leak reports to // contain line numbers #include "wx/msw/msvcrt.h" #endif #endif // wxUSE_DEBUG_NEW_ALWAYS // ---------------------------------------------------------------------------- // Compatibility macro aliases IMPLEMENT group // ---------------------------------------------------------------------------- // deprecated variants _not_ requiring a semicolon after them and without wx prefix. // (note that also some wx-prefixed macro do _not_ require a semicolon because // it's not always possible to force the compiler to require it) #define IMPLEMENT_DYNAMIC_CLASS(n,b) wxIMPLEMENT_DYNAMIC_CLASS(n,b) #define IMPLEMENT_DYNAMIC_CLASS2(n,b1,b2) wxIMPLEMENT_DYNAMIC_CLASS2(n,b1,b2) #define IMPLEMENT_ABSTRACT_CLASS(n,b) wxIMPLEMENT_ABSTRACT_CLASS(n,b) #define IMPLEMENT_ABSTRACT_CLASS2(n,b1,b2) wxIMPLEMENT_ABSTRACT_CLASS2(n,b1,b2) #define IMPLEMENT_CLASS(n,b) wxIMPLEMENT_CLASS(n,b) #define IMPLEMENT_CLASS2(n,b1,b2) wxIMPLEMENT_CLASS2(n,b1,b2) #define IMPLEMENT_PLUGGABLE_CLASS(n,b) wxIMPLEMENT_PLUGGABLE_CLASS(n,b) #define IMPLEMENT_PLUGGABLE_CLASS2(n,b,b2) wxIMPLEMENT_PLUGGABLE_CLASS2(n,b,b2) #define IMPLEMENT_ABSTRACT_PLUGGABLE_CLASS(n,b) wxIMPLEMENT_ABSTRACT_PLUGGABLE_CLASS(n,b) #define IMPLEMENT_ABSTRACT_PLUGGABLE_CLASS2(n,b,b2) wxIMPLEMENT_ABSTRACT_PLUGGABLE_CLASS2(n,b,b2) #define IMPLEMENT_USER_EXPORTED_PLUGGABLE_CLASS(n,b) wxIMPLEMENT_USER_EXPORTED_PLUGGABLE_CLASS(n,b) #define IMPLEMENT_USER_EXPORTED_PLUGGABLE_CLASS2(n,b,b2) wxIMPLEMENT_USER_EXPORTED_PLUGGABLE_CLASS2(n,b,b2) #define IMPLEMENT_USER_EXPORTED_ABSTRACT_PLUGGABLE_CLASS(n,b) wxIMPLEMENT_USER_EXPORTED_ABSTRACT_PLUGGABLE_CLASS(n,b) #define IMPLEMENT_USER_EXPORTED_ABSTRACT_PLUGGABLE_CLASS2(n,b,b2) wxIMPLEMENT_USER_EXPORTED_ABSTRACT_PLUGGABLE_CLASS2(n,b,b2) #define CLASSINFO(n) wxCLASSINFO(n) #endif // _WX_OBJECTH__
h
rticonnextdds-usecases
data/projects/rticonnextdds-usecases/VehicleTracking/ExampleCode/thirdparty/wxWidgets-3.1.2/Win64/include/wx/longlong.h
///////////////////////////////////////////////////////////////////////////// // Name: wx/longlong.h // Purpose: declaration of wxLongLong class - best implementation of a 64 // bit integer for the current platform. // Author: Jeffrey C. Ollie <[email protected]>, Vadim Zeitlin // Modified by: // Created: 10.02.99 // Copyright: (c) 1998 Vadim Zeitlin <[email protected]> // Licence: wxWindows licence ///////////////////////////////////////////////////////////////////////////// #ifndef _WX_LONGLONG_H #define _WX_LONGLONG_H #include "wx/defs.h" #if wxUSE_LONGLONG #include "wx/string.h" #include <limits.h> // for LONG_MAX // define this to compile wxLongLongWx in "test" mode: the results of all // calculations will be compared with the real results taken from // wxLongLongNative -- this is extremely useful to find the bugs in // wxLongLongWx class! // #define wxLONGLONG_TEST_MODE #ifdef wxLONGLONG_TEST_MODE #define wxUSE_LONGLONG_WX 1 #define wxUSE_LONGLONG_NATIVE 1 #endif // wxLONGLONG_TEST_MODE // ---------------------------------------------------------------------------- // decide upon which class we will use // ---------------------------------------------------------------------------- #ifndef wxLongLong_t // both warning and pragma warning are not portable, but at least an // unknown pragma should never be an error -- except that, actually, some // broken compilers don't like it, so we have to disable it in this case // <sigh> #ifdef __GNUC__ #warning "Your compiler does not appear to support 64 bit "\ "integers, using emulation class instead.\n" \ "Please report your compiler version to " \ "[email protected]!" #else #pragma warning "Your compiler does not appear to support 64 bit "\ "integers, using emulation class instead.\n" \ "Please report your compiler version to " \ "[email protected]!" #endif #define wxUSE_LONGLONG_WX 1 #endif // compiler // the user may predefine wxUSE_LONGLONG_NATIVE and/or wxUSE_LONGLONG_NATIVE // to disable automatic testing (useful for the test program which defines // both classes) but by default we only use one class #if (defined(wxUSE_LONGLONG_WX) && wxUSE_LONGLONG_WX) || !defined(wxLongLong_t) // don't use both classes unless wxUSE_LONGLONG_NATIVE was explicitly set: // this is useful in test programs and only there #ifndef wxUSE_LONGLONG_NATIVE #define wxUSE_LONGLONG_NATIVE 0 #endif class WXDLLIMPEXP_FWD_BASE wxLongLongWx; class WXDLLIMPEXP_FWD_BASE wxULongLongWx; #if defined(__VISUALC__) && !defined(__WIN32__) #define wxLongLong wxLongLongWx #define wxULongLong wxULongLongWx #else typedef wxLongLongWx wxLongLong; typedef wxULongLongWx wxULongLong; #endif #else // if nothing is defined, use native implementation by default, of course #ifndef wxUSE_LONGLONG_NATIVE #define wxUSE_LONGLONG_NATIVE 1 #endif #endif #ifndef wxUSE_LONGLONG_WX #define wxUSE_LONGLONG_WX 0 class WXDLLIMPEXP_FWD_BASE wxLongLongNative; class WXDLLIMPEXP_FWD_BASE wxULongLongNative; typedef wxLongLongNative wxLongLong; typedef wxULongLongNative wxULongLong; #endif // NB: if both wxUSE_LONGLONG_WX and NATIVE are defined, the user code should // typedef wxLongLong as it wants, we don't do it // ---------------------------------------------------------------------------- // choose the appropriate class // ---------------------------------------------------------------------------- // we use iostream for wxLongLong output #include "wx/iosfwrap.h" #if wxUSE_LONGLONG_NATIVE class WXDLLIMPEXP_BASE wxLongLongNative { public: // ctors // default ctor initializes to 0 wxLongLongNative() : m_ll(0) { } // from long long wxLongLongNative(wxLongLong_t ll) : m_ll(ll) { } // from 2 longs wxLongLongNative(wxInt32 hi, wxUint32 lo) { // cast to wxLongLong_t first to avoid precision loss! m_ll = ((wxLongLong_t) hi) << 32; m_ll |= (wxLongLong_t) lo; } #if wxUSE_LONGLONG_WX wxLongLongNative(wxLongLongWx ll); #endif // default copy ctor is ok // no dtor // assignment operators // from native 64 bit integer #ifndef wxLongLongIsLong wxLongLongNative& operator=(wxLongLong_t ll) { m_ll = ll; return *this; } wxLongLongNative& operator=(wxULongLong_t ll) { m_ll = ll; return *this; } #endif // !wxLongLongNative wxLongLongNative& operator=(const wxULongLongNative &ll); wxLongLongNative& operator=(int l) { m_ll = l; return *this; } wxLongLongNative& operator=(long l) { m_ll = l; return *this; } wxLongLongNative& operator=(unsigned int l) { m_ll = l; return *this; } wxLongLongNative& operator=(unsigned long l) { m_ll = l; return *this; } #if wxUSE_LONGLONG_WX wxLongLongNative& operator=(wxLongLongWx ll); wxLongLongNative& operator=(const class wxULongLongWx &ll); #endif // from double: this one has an explicit name because otherwise we // would have ambiguity with "ll = int" and also because we don't want // to have implicit conversions between doubles and wxLongLongs wxLongLongNative& Assign(double d) { m_ll = (wxLongLong_t)d; return *this; } // assignment operators from wxLongLongNative is ok // accessors // get high part wxInt32 GetHi() const { return wx_truncate_cast(wxInt32, m_ll >> 32); } // get low part wxUint32 GetLo() const { return wx_truncate_cast(wxUint32, m_ll); } // get absolute value wxLongLongNative Abs() const { return wxLongLongNative(*this).Abs(); } wxLongLongNative& Abs() { if ( m_ll < 0 ) m_ll = -m_ll; return *this; } // convert to native long long wxLongLong_t GetValue() const { return m_ll; } // convert to long with range checking in debug mode (only!) long ToLong() const { // This assert is useless if long long is the same as long (which is // the case under the standard Unix LP64 model). #ifdef wxHAS_LONG_LONG_T_DIFFERENT_FROM_LONG wxASSERT_MSG( (m_ll >= LONG_MIN) && (m_ll <= LONG_MAX), wxT("wxLongLong to long conversion loss of precision") ); #endif return wx_truncate_cast(long, m_ll); } // convert to double double ToDouble() const { return wx_truncate_cast(double, m_ll); } // don't provide implicit conversion to wxLongLong_t or we will have an // ambiguity for all arithmetic operations //operator wxLongLong_t() const { return m_ll; } // operations // addition wxLongLongNative operator+(const wxLongLongNative& ll) const { return wxLongLongNative(m_ll + ll.m_ll); } wxLongLongNative& operator+=(const wxLongLongNative& ll) { m_ll += ll.m_ll; return *this; } wxLongLongNative operator+(const wxLongLong_t ll) const { return wxLongLongNative(m_ll + ll); } wxLongLongNative& operator+=(const wxLongLong_t ll) { m_ll += ll; return *this; } // pre increment wxLongLongNative& operator++() { m_ll++; return *this; } // post increment wxLongLongNative operator++(int) { wxLongLongNative value(*this); m_ll++; return value; } // negation operator wxLongLongNative operator-() const { return wxLongLongNative(-m_ll); } wxLongLongNative& Negate() { m_ll = -m_ll; return *this; } // subtraction wxLongLongNative operator-(const wxLongLongNative& ll) const { return wxLongLongNative(m_ll - ll.m_ll); } wxLongLongNative& operator-=(const wxLongLongNative& ll) { m_ll -= ll.m_ll; return *this; } wxLongLongNative operator-(const wxLongLong_t ll) const { return wxLongLongNative(m_ll - ll); } wxLongLongNative& operator-=(const wxLongLong_t ll) { m_ll -= ll; return *this; } // pre decrement wxLongLongNative& operator--() { m_ll--; return *this; } // post decrement wxLongLongNative operator--(int) { wxLongLongNative value(*this); m_ll--; return value; } // shifts // left shift wxLongLongNative operator<<(int shift) const { return wxLongLongNative(m_ll << shift); } wxLongLongNative& operator<<=(int shift) { m_ll <<= shift; return *this; } // right shift wxLongLongNative operator>>(int shift) const { return wxLongLongNative(m_ll >> shift); } wxLongLongNative& operator>>=(int shift) { m_ll >>= shift; return *this; } // bitwise operators wxLongLongNative operator&(const wxLongLongNative& ll) const { return wxLongLongNative(m_ll & ll.m_ll); } wxLongLongNative& operator&=(const wxLongLongNative& ll) { m_ll &= ll.m_ll; return *this; } wxLongLongNative operator|(const wxLongLongNative& ll) const { return wxLongLongNative(m_ll | ll.m_ll); } wxLongLongNative& operator|=(const wxLongLongNative& ll) { m_ll |= ll.m_ll; return *this; } wxLongLongNative operator^(const wxLongLongNative& ll) const { return wxLongLongNative(m_ll ^ ll.m_ll); } wxLongLongNative& operator^=(const wxLongLongNative& ll) { m_ll ^= ll.m_ll; return *this; } // multiplication/division wxLongLongNative operator*(const wxLongLongNative& ll) const { return wxLongLongNative(m_ll * ll.m_ll); } wxLongLongNative operator*(long l) const { return wxLongLongNative(m_ll * l); } wxLongLongNative& operator*=(const wxLongLongNative& ll) { m_ll *= ll.m_ll; return *this; } wxLongLongNative& operator*=(long l) { m_ll *= l; return *this; } wxLongLongNative operator/(const wxLongLongNative& ll) const { return wxLongLongNative(m_ll / ll.m_ll); } wxLongLongNative operator/(long l) const { return wxLongLongNative(m_ll / l); } wxLongLongNative& operator/=(const wxLongLongNative& ll) { m_ll /= ll.m_ll; return *this; } wxLongLongNative& operator/=(long l) { m_ll /= l; return *this; } wxLongLongNative operator%(const wxLongLongNative& ll) const { return wxLongLongNative(m_ll % ll.m_ll); } wxLongLongNative operator%(long l) const { return wxLongLongNative(m_ll % l); } // comparison bool operator==(const wxLongLongNative& ll) const { return m_ll == ll.m_ll; } bool operator==(long l) const { return m_ll == l; } bool operator!=(const wxLongLongNative& ll) const { return m_ll != ll.m_ll; } bool operator!=(long l) const { return m_ll != l; } bool operator<(const wxLongLongNative& ll) const { return m_ll < ll.m_ll; } bool operator<(long l) const { return m_ll < l; } bool operator>(const wxLongLongNative& ll) const { return m_ll > ll.m_ll; } bool operator>(long l) const { return m_ll > l; } bool operator<=(const wxLongLongNative& ll) const { return m_ll <= ll.m_ll; } bool operator<=(long l) const { return m_ll <= l; } bool operator>=(const wxLongLongNative& ll) const { return m_ll >= ll.m_ll; } bool operator>=(long l) const { return m_ll >= l; } // miscellaneous // return the string representation of this number wxString ToString() const; // conversion to byte array: returns a pointer to static buffer! void *asArray() const; #if wxUSE_STD_IOSTREAM // input/output friend WXDLLIMPEXP_BASE wxSTD ostream& operator<<(wxSTD ostream&, const wxLongLongNative&); #endif friend WXDLLIMPEXP_BASE wxString& operator<<(wxString&, const wxLongLongNative&); #if wxUSE_STREAMS friend WXDLLIMPEXP_BASE class wxTextOutputStream& operator<<(class wxTextOutputStream&, const wxLongLongNative&); friend WXDLLIMPEXP_BASE class wxTextInputStream& operator>>(class wxTextInputStream&, wxLongLongNative&); #endif private: wxLongLong_t m_ll; }; class WXDLLIMPEXP_BASE wxULongLongNative { public: // ctors // default ctor initializes to 0 wxULongLongNative() : m_ll(0) { } // from long long wxULongLongNative(wxULongLong_t ll) : m_ll(ll) { } // from 2 longs wxULongLongNative(wxUint32 hi, wxUint32 lo) : m_ll(0) { // cast to wxLongLong_t first to avoid precision loss! m_ll = ((wxULongLong_t) hi) << 32; m_ll |= (wxULongLong_t) lo; } #if wxUSE_LONGLONG_WX wxULongLongNative(const class wxULongLongWx &ll); #endif // default copy ctor is ok // no dtor // assignment operators // from native 64 bit integer #ifndef wxLongLongIsLong wxULongLongNative& operator=(wxULongLong_t ll) { m_ll = ll; return *this; } wxULongLongNative& operator=(wxLongLong_t ll) { m_ll = ll; return *this; } #endif // !wxLongLongNative wxULongLongNative& operator=(int l) { m_ll = l; return *this; } wxULongLongNative& operator=(long l) { m_ll = l; return *this; } wxULongLongNative& operator=(unsigned int l) { m_ll = l; return *this; } wxULongLongNative& operator=(unsigned long l) { m_ll = l; return *this; } wxULongLongNative& operator=(const wxLongLongNative &ll) { m_ll = ll.GetValue(); return *this; } #if wxUSE_LONGLONG_WX wxULongLongNative& operator=(wxLongLongWx ll); wxULongLongNative& operator=(const class wxULongLongWx &ll); #endif // assignment operators from wxULongLongNative is ok // accessors // get high part wxUint32 GetHi() const { return wx_truncate_cast(wxUint32, m_ll >> 32); } // get low part wxUint32 GetLo() const { return wx_truncate_cast(wxUint32, m_ll); } // convert to native ulong long wxULongLong_t GetValue() const { return m_ll; } // convert to ulong with range checking in debug mode (only!) unsigned long ToULong() const { wxASSERT_MSG( m_ll <= ULONG_MAX, wxT("wxULongLong to long conversion loss of precision") ); return wx_truncate_cast(unsigned long, m_ll); } // convert to double double ToDouble() const { return wx_truncate_cast(double, m_ll); } // operations // addition wxULongLongNative operator+(const wxULongLongNative& ll) const { return wxULongLongNative(m_ll + ll.m_ll); } wxULongLongNative& operator+=(const wxULongLongNative& ll) { m_ll += ll.m_ll; return *this; } wxULongLongNative operator+(const wxULongLong_t ll) const { return wxULongLongNative(m_ll + ll); } wxULongLongNative& operator+=(const wxULongLong_t ll) { m_ll += ll; return *this; } // pre increment wxULongLongNative& operator++() { m_ll++; return *this; } // post increment wxULongLongNative operator++(int) { wxULongLongNative value(*this); m_ll++; return value; } // subtraction wxULongLongNative operator-(const wxULongLongNative& ll) const { return wxULongLongNative(m_ll - ll.m_ll); } wxULongLongNative& operator-=(const wxULongLongNative& ll) { m_ll -= ll.m_ll; return *this; } wxULongLongNative operator-(const wxULongLong_t ll) const { return wxULongLongNative(m_ll - ll); } wxULongLongNative& operator-=(const wxULongLong_t ll) { m_ll -= ll; return *this; } // pre decrement wxULongLongNative& operator--() { m_ll--; return *this; } // post decrement wxULongLongNative operator--(int) { wxULongLongNative value(*this); m_ll--; return value; } // shifts // left shift wxULongLongNative operator<<(int shift) const { return wxULongLongNative(m_ll << shift); } wxULongLongNative& operator<<=(int shift) { m_ll <<= shift; return *this; } // right shift wxULongLongNative operator>>(int shift) const { return wxULongLongNative(m_ll >> shift); } wxULongLongNative& operator>>=(int shift) { m_ll >>= shift; return *this; } // bitwise operators wxULongLongNative operator&(const wxULongLongNative& ll) const { return wxULongLongNative(m_ll & ll.m_ll); } wxULongLongNative& operator&=(const wxULongLongNative& ll) { m_ll &= ll.m_ll; return *this; } wxULongLongNative operator|(const wxULongLongNative& ll) const { return wxULongLongNative(m_ll | ll.m_ll); } wxULongLongNative& operator|=(const wxULongLongNative& ll) { m_ll |= ll.m_ll; return *this; } wxULongLongNative operator^(const wxULongLongNative& ll) const { return wxULongLongNative(m_ll ^ ll.m_ll); } wxULongLongNative& operator^=(const wxULongLongNative& ll) { m_ll ^= ll.m_ll; return *this; } // multiplication/division wxULongLongNative operator*(const wxULongLongNative& ll) const { return wxULongLongNative(m_ll * ll.m_ll); } wxULongLongNative operator*(unsigned long l) const { return wxULongLongNative(m_ll * l); } wxULongLongNative& operator*=(const wxULongLongNative& ll) { m_ll *= ll.m_ll; return *this; } wxULongLongNative& operator*=(unsigned long l) { m_ll *= l; return *this; } wxULongLongNative operator/(const wxULongLongNative& ll) const { return wxULongLongNative(m_ll / ll.m_ll); } wxULongLongNative operator/(unsigned long l) const { return wxULongLongNative(m_ll / l); } wxULongLongNative& operator/=(const wxULongLongNative& ll) { m_ll /= ll.m_ll; return *this; } wxULongLongNative& operator/=(unsigned long l) { m_ll /= l; return *this; } wxULongLongNative operator%(const wxULongLongNative& ll) const { return wxULongLongNative(m_ll % ll.m_ll); } wxULongLongNative operator%(unsigned long l) const { return wxULongLongNative(m_ll % l); } // comparison bool operator==(const wxULongLongNative& ll) const { return m_ll == ll.m_ll; } bool operator==(unsigned long l) const { return m_ll == l; } bool operator!=(const wxULongLongNative& ll) const { return m_ll != ll.m_ll; } bool operator!=(unsigned long l) const { return m_ll != l; } bool operator<(const wxULongLongNative& ll) const { return m_ll < ll.m_ll; } bool operator<(unsigned long l) const { return m_ll < l; } bool operator>(const wxULongLongNative& ll) const { return m_ll > ll.m_ll; } bool operator>(unsigned long l) const { return m_ll > l; } bool operator<=(const wxULongLongNative& ll) const { return m_ll <= ll.m_ll; } bool operator<=(unsigned long l) const { return m_ll <= l; } bool operator>=(const wxULongLongNative& ll) const { return m_ll >= ll.m_ll; } bool operator>=(unsigned long l) const { return m_ll >= l; } // miscellaneous // return the string representation of this number wxString ToString() const; // conversion to byte array: returns a pointer to static buffer! void *asArray() const; #if wxUSE_STD_IOSTREAM // input/output friend WXDLLIMPEXP_BASE wxSTD ostream& operator<<(wxSTD ostream&, const wxULongLongNative&); #endif friend WXDLLIMPEXP_BASE wxString& operator<<(wxString&, const wxULongLongNative&); #if wxUSE_STREAMS friend WXDLLIMPEXP_BASE class wxTextOutputStream& operator<<(class wxTextOutputStream&, const wxULongLongNative&); friend WXDLLIMPEXP_BASE class wxTextInputStream& operator>>(class wxTextInputStream&, wxULongLongNative&); #endif private: wxULongLong_t m_ll; }; inline wxLongLongNative& wxLongLongNative::operator=(const wxULongLongNative &ll) { m_ll = ll.GetValue(); return *this; } #endif // wxUSE_LONGLONG_NATIVE #if wxUSE_LONGLONG_WX class WXDLLIMPEXP_BASE wxLongLongWx { public: // ctors // default ctor initializes to 0 wxLongLongWx() { m_lo = m_hi = 0; #ifdef wxLONGLONG_TEST_MODE m_ll = 0; Check(); #endif // wxLONGLONG_TEST_MODE } // from long wxLongLongWx(long l) { *this = l; } // from 2 longs wxLongLongWx(long hi, unsigned long lo) { m_hi = hi; m_lo = lo; #ifdef wxLONGLONG_TEST_MODE m_ll = hi; m_ll <<= 32; m_ll |= lo; Check(); #endif // wxLONGLONG_TEST_MODE } // default copy ctor is ok in both cases // no dtor // assignment operators // from long wxLongLongWx& operator=(long l) { m_lo = l; m_hi = (l < 0 ? -1l : 0l); #ifdef wxLONGLONG_TEST_MODE m_ll = l; Check(); #endif // wxLONGLONG_TEST_MODE return *this; } // from int wxLongLongWx& operator=(int l) { return operator=((long)l); } wxLongLongWx& operator=(unsigned long l) { m_lo = l; m_hi = 0; #ifdef wxLONGLONG_TEST_MODE m_ll = l; Check(); #endif // wxLONGLONG_TEST_MODE return *this; } wxLongLongWx& operator=(unsigned int l) { return operator=((unsigned long)l); } wxLongLongWx& operator=(const class wxULongLongWx &ll); // from double wxLongLongWx& Assign(double d); // can't have assignment operator from 2 longs // accessors // get high part long GetHi() const { return m_hi; } // get low part unsigned long GetLo() const { return m_lo; } // get absolute value wxLongLongWx Abs() const { return wxLongLongWx(*this).Abs(); } wxLongLongWx& Abs() { if ( m_hi < 0 ) m_hi = -m_hi; #ifdef wxLONGLONG_TEST_MODE if ( m_ll < 0 ) m_ll = -m_ll; Check(); #endif // wxLONGLONG_TEST_MODE return *this; } // convert to long with range checking in debug mode (only!) long ToLong() const { wxASSERT_MSG( (m_hi == 0l) || (m_hi == -1l), wxT("wxLongLong to long conversion loss of precision") ); return (long)m_lo; } // convert to double double ToDouble() const; // operations // addition wxLongLongWx operator+(const wxLongLongWx& ll) const; wxLongLongWx& operator+=(const wxLongLongWx& ll); wxLongLongWx operator+(long l) const; wxLongLongWx& operator+=(long l); // pre increment operator wxLongLongWx& operator++(); // post increment operator wxLongLongWx& operator++(int) { return ++(*this); } // negation operator wxLongLongWx operator-() const; wxLongLongWx& Negate(); // subraction wxLongLongWx operator-(const wxLongLongWx& ll) const; wxLongLongWx& operator-=(const wxLongLongWx& ll); // pre decrement operator wxLongLongWx& operator--(); // post decrement operator wxLongLongWx& operator--(int) { return --(*this); } // shifts // left shift wxLongLongWx operator<<(int shift) const; wxLongLongWx& operator<<=(int shift); // right shift wxLongLongWx operator>>(int shift) const; wxLongLongWx& operator>>=(int shift); // bitwise operators wxLongLongWx operator&(const wxLongLongWx& ll) const; wxLongLongWx& operator&=(const wxLongLongWx& ll); wxLongLongWx operator|(const wxLongLongWx& ll) const; wxLongLongWx& operator|=(const wxLongLongWx& ll); wxLongLongWx operator^(const wxLongLongWx& ll) const; wxLongLongWx& operator^=(const wxLongLongWx& ll); wxLongLongWx operator~() const; // comparison bool operator==(const wxLongLongWx& ll) const { return m_lo == ll.m_lo && m_hi == ll.m_hi; } #if wxUSE_LONGLONG_NATIVE bool operator==(const wxLongLongNative& ll) const { return m_lo == ll.GetLo() && m_hi == ll.GetHi(); } #endif bool operator!=(const wxLongLongWx& ll) const { return !(*this == ll); } bool operator<(const wxLongLongWx& ll) const; bool operator>(const wxLongLongWx& ll) const; bool operator<=(const wxLongLongWx& ll) const { return *this < ll || *this == ll; } bool operator>=(const wxLongLongWx& ll) const { return *this > ll || *this == ll; } bool operator<(long l) const { return *this < wxLongLongWx(l); } bool operator>(long l) const { return *this > wxLongLongWx(l); } bool operator==(long l) const { return l >= 0 ? (m_hi == 0 && m_lo == (unsigned long)l) : (m_hi == -1 && m_lo == (unsigned long)l); } bool operator<=(long l) const { return *this < l || *this == l; } bool operator>=(long l) const { return *this > l || *this == l; } // multiplication wxLongLongWx operator*(const wxLongLongWx& ll) const; wxLongLongWx& operator*=(const wxLongLongWx& ll); // division wxLongLongWx operator/(const wxLongLongWx& ll) const; wxLongLongWx& operator/=(const wxLongLongWx& ll); wxLongLongWx operator%(const wxLongLongWx& ll) const; void Divide(const wxLongLongWx& divisor, wxLongLongWx& quotient, wxLongLongWx& remainder) const; // input/output // return the string representation of this number wxString ToString() const; void *asArray() const; #if wxUSE_STD_IOSTREAM friend WXDLLIMPEXP_BASE wxSTD ostream& operator<<(wxSTD ostream&, const wxLongLongWx&); #endif // wxUSE_STD_IOSTREAM friend WXDLLIMPEXP_BASE wxString& operator<<(wxString&, const wxLongLongWx&); #if wxUSE_STREAMS friend WXDLLIMPEXP_BASE class wxTextOutputStream& operator<<(class wxTextOutputStream&, const wxLongLongWx&); friend WXDLLIMPEXP_BASE class wxTextInputStream& operator>>(class wxTextInputStream&, wxLongLongWx&); #endif private: // long is at least 32 bits, so represent our 64bit number as 2 longs long m_hi; // signed bit is in the high part unsigned long m_lo; #ifdef wxLONGLONG_TEST_MODE void Check() { wxASSERT( (m_ll >> 32) == m_hi && (unsigned long)m_ll == m_lo ); } wxLongLong_t m_ll; #endif // wxLONGLONG_TEST_MODE }; class WXDLLIMPEXP_BASE wxULongLongWx { public: // ctors // default ctor initializes to 0 wxULongLongWx() { m_lo = m_hi = 0; #ifdef wxLONGLONG_TEST_MODE m_ll = 0; Check(); #endif // wxLONGLONG_TEST_MODE } // from ulong wxULongLongWx(unsigned long l) { *this = l; } // from 2 ulongs wxULongLongWx(unsigned long hi, unsigned long lo) { m_hi = hi; m_lo = lo; #ifdef wxLONGLONG_TEST_MODE m_ll = hi; m_ll <<= 32; m_ll |= lo; Check(); #endif // wxLONGLONG_TEST_MODE } // from signed to unsigned wxULongLongWx(wxLongLongWx ll) { wxASSERT(ll.GetHi() >= 0); m_hi = (unsigned long)ll.GetHi(); m_lo = ll.GetLo(); } // default copy ctor is ok in both cases // no dtor // assignment operators // from long wxULongLongWx& operator=(unsigned long l) { m_lo = l; m_hi = 0; #ifdef wxLONGLONG_TEST_MODE m_ll = l; Check(); #endif // wxLONGLONG_TEST_MODE return *this; } wxULongLongWx& operator=(long l) { m_lo = l; m_hi = (unsigned long) ((l<0) ? -1l : 0); #ifdef wxLONGLONG_TEST_MODE m_ll = (wxULongLong_t) (wxLongLong_t) l; Check(); #endif // wxLONGLONG_TEST_MODE return *this; } wxULongLongWx& operator=(const class wxLongLongWx &ll) { // Should we use an assert like it was before in the constructor? // wxASSERT(ll.GetHi() >= 0); m_hi = (unsigned long)ll.GetHi(); m_lo = ll.GetLo(); return *this; } // can't have assignment operator from 2 longs // accessors // get high part unsigned long GetHi() const { return m_hi; } // get low part unsigned long GetLo() const { return m_lo; } // convert to long with range checking in debug mode (only!) unsigned long ToULong() const { wxASSERT_MSG( m_hi == 0ul, wxT("wxULongLong to long conversion loss of precision") ); return (unsigned long)m_lo; } // convert to double double ToDouble() const; // operations // addition wxULongLongWx operator+(const wxULongLongWx& ll) const; wxULongLongWx& operator+=(const wxULongLongWx& ll); wxULongLongWx operator+(unsigned long l) const; wxULongLongWx& operator+=(unsigned long l); // pre increment operator wxULongLongWx& operator++(); // post increment operator wxULongLongWx& operator++(int) { return ++(*this); } // subtraction wxLongLongWx operator-(const wxULongLongWx& ll) const; wxULongLongWx& operator-=(const wxULongLongWx& ll); // pre decrement operator wxULongLongWx& operator--(); // post decrement operator wxULongLongWx& operator--(int) { return --(*this); } // shifts // left shift wxULongLongWx operator<<(int shift) const; wxULongLongWx& operator<<=(int shift); // right shift wxULongLongWx operator>>(int shift) const; wxULongLongWx& operator>>=(int shift); // bitwise operators wxULongLongWx operator&(const wxULongLongWx& ll) const; wxULongLongWx& operator&=(const wxULongLongWx& ll); wxULongLongWx operator|(const wxULongLongWx& ll) const; wxULongLongWx& operator|=(const wxULongLongWx& ll); wxULongLongWx operator^(const wxULongLongWx& ll) const; wxULongLongWx& operator^=(const wxULongLongWx& ll); wxULongLongWx operator~() const; // comparison bool operator==(const wxULongLongWx& ll) const { return m_lo == ll.m_lo && m_hi == ll.m_hi; } bool operator!=(const wxULongLongWx& ll) const { return !(*this == ll); } bool operator<(const wxULongLongWx& ll) const; bool operator>(const wxULongLongWx& ll) const; bool operator<=(const wxULongLongWx& ll) const { return *this < ll || *this == ll; } bool operator>=(const wxULongLongWx& ll) const { return *this > ll || *this == ll; } bool operator<(unsigned long l) const { return *this < wxULongLongWx(l); } bool operator>(unsigned long l) const { return *this > wxULongLongWx(l); } bool operator==(unsigned long l) const { return (m_hi == 0 && m_lo == (unsigned long)l); } bool operator<=(unsigned long l) const { return *this < l || *this == l; } bool operator>=(unsigned long l) const { return *this > l || *this == l; } // multiplication wxULongLongWx operator*(const wxULongLongWx& ll) const; wxULongLongWx& operator*=(const wxULongLongWx& ll); // division wxULongLongWx operator/(const wxULongLongWx& ll) const; wxULongLongWx& operator/=(const wxULongLongWx& ll); wxULongLongWx operator%(const wxULongLongWx& ll) const; void Divide(const wxULongLongWx& divisor, wxULongLongWx& quotient, wxULongLongWx& remainder) const; // input/output // return the string representation of this number wxString ToString() const; void *asArray() const; #if wxUSE_STD_IOSTREAM friend WXDLLIMPEXP_BASE wxSTD ostream& operator<<(wxSTD ostream&, const wxULongLongWx&); #endif // wxUSE_STD_IOSTREAM friend WXDLLIMPEXP_BASE wxString& operator<<(wxString&, const wxULongLongWx&); #if wxUSE_STREAMS friend WXDLLIMPEXP_BASE class wxTextOutputStream& operator<<(class wxTextOutputStream&, const wxULongLongWx&); friend WXDLLIMPEXP_BASE class wxTextInputStream& operator>>(class wxTextInputStream&, wxULongLongWx&); #endif private: // long is at least 32 bits, so represent our 64bit number as 2 longs unsigned long m_hi; unsigned long m_lo; #ifdef wxLONGLONG_TEST_MODE void Check() { wxASSERT( (m_ll >> 32) == m_hi && (unsigned long)m_ll == m_lo ); } wxULongLong_t m_ll; #endif // wxLONGLONG_TEST_MODE }; #endif // wxUSE_LONGLONG_WX // ---------------------------------------------------------------------------- // binary operators // ---------------------------------------------------------------------------- inline bool operator<(long l, const wxLongLong& ll) { return ll > l; } inline bool operator>(long l, const wxLongLong& ll) { return ll < l; } inline bool operator<=(long l, const wxLongLong& ll) { return ll >= l; } inline bool operator>=(long l, const wxLongLong& ll) { return ll <= l; } inline bool operator==(long l, const wxLongLong& ll) { return ll == l; } inline bool operator!=(long l, const wxLongLong& ll) { return ll != l; } inline wxLongLong operator+(long l, const wxLongLong& ll) { return ll + l; } inline wxLongLong operator-(long l, const wxLongLong& ll) { return wxLongLong(l) - ll; } inline bool operator<(unsigned long l, const wxULongLong& ull) { return ull > l; } inline bool operator>(unsigned long l, const wxULongLong& ull) { return ull < l; } inline bool operator<=(unsigned long l, const wxULongLong& ull) { return ull >= l; } inline bool operator>=(unsigned long l, const wxULongLong& ull) { return ull <= l; } inline bool operator==(unsigned long l, const wxULongLong& ull) { return ull == l; } inline bool operator!=(unsigned long l, const wxULongLong& ull) { return ull != l; } inline wxULongLong operator+(unsigned long l, const wxULongLong& ull) { return ull + l; } inline wxLongLong operator-(unsigned long l, const wxULongLong& ull) { const wxULongLong ret = wxULongLong(l) - ull; return wxLongLong((wxInt32)ret.GetHi(),ret.GetLo()); } #if wxUSE_LONGLONG_NATIVE && wxUSE_STREAMS WXDLLIMPEXP_BASE class wxTextOutputStream &operator<<(class wxTextOutputStream &stream, wxULongLong_t value); WXDLLIMPEXP_BASE class wxTextOutputStream &operator<<(class wxTextOutputStream &stream, wxLongLong_t value); WXDLLIMPEXP_BASE class wxTextInputStream &operator>>(class wxTextInputStream &stream, wxULongLong_t &value); WXDLLIMPEXP_BASE class wxTextInputStream &operator>>(class wxTextInputStream &stream, wxLongLong_t &value); #endif // ---------------------------------------------------------------------------- // Specialize numeric_limits<> for our long long wrapper classes. // ---------------------------------------------------------------------------- #if wxUSE_LONGLONG_NATIVE #include <limits> namespace std { #ifdef __clang__ // libstdc++ (used by Clang) uses struct for numeric_limits; unlike gcc, clang // warns about this template<> struct numeric_limits<wxLongLong> : public numeric_limits<wxLongLong_t> {}; template<> struct numeric_limits<wxULongLong> : public numeric_limits<wxULongLong_t> {}; #else template<> class numeric_limits<wxLongLong> : public numeric_limits<wxLongLong_t> {}; template<> class numeric_limits<wxULongLong> : public numeric_limits<wxULongLong_t> {}; #endif } // namespace std #endif // wxUSE_LONGLONG_NATIVE // ---------------------------------------------------------------------------- // Specialize wxArgNormalizer to allow using wxLongLong directly with wx pseudo // vararg functions. // ---------------------------------------------------------------------------- // Notice that this must be done here and not in wx/strvararg.h itself because // we can't include wx/longlong.h from there as this header itself includes // wx/string.h which includes wx/strvararg.h too, so to avoid the circular // dependencies we can only do it here (or add another header just for this but // it doesn't seem necessary). #include "wx/strvararg.h" template<> struct WXDLLIMPEXP_BASE wxArgNormalizer<wxLongLong> { wxArgNormalizer(wxLongLong value, const wxFormatString *fmt, unsigned index) : m_value(value) { wxASSERT_ARG_TYPE( fmt, index, wxFormatString::Arg_LongLongInt ); } wxLongLong_t get() const { return m_value.GetValue(); } wxLongLong m_value; }; #endif // wxUSE_LONGLONG #endif // _WX_LONGLONG_H
h
rticonnextdds-usecases
data/projects/rticonnextdds-usecases/VehicleTracking/ExampleCode/thirdparty/wxWidgets-3.1.2/Win64/include/wx/calctrl.h
/////////////////////////////////////////////////////////////////////////////// // Name: wx/calctrl.h // Purpose: date-picker control // Author: Vadim Zeitlin // Modified by: // Created: 29.12.99 // Copyright: (c) 1999 Vadim Zeitlin <[email protected]> // Licence: wxWindows licence /////////////////////////////////////////////////////////////////////////////// #ifndef _WX_CALCTRL_H_ #define _WX_CALCTRL_H_ #include "wx/defs.h" #if wxUSE_CALENDARCTRL #include "wx/dateevt.h" #include "wx/colour.h" #include "wx/font.h" #include "wx/control.h" // ---------------------------------------------------------------------------- // wxCalendarCtrl flags // ---------------------------------------------------------------------------- enum { // show Sunday as the first day of the week (default) wxCAL_SUNDAY_FIRST = 0x0080, // show Monday as the first day of the week wxCAL_MONDAY_FIRST = 0x0001, // highlight holidays wxCAL_SHOW_HOLIDAYS = 0x0002, // disable the year change control, show only the month change one // deprecated wxCAL_NO_YEAR_CHANGE = 0x0004, // don't allow changing neither month nor year (implies // wxCAL_NO_YEAR_CHANGE) wxCAL_NO_MONTH_CHANGE = 0x000c, // use MS-style month-selection instead of combo-spin combination wxCAL_SEQUENTIAL_MONTH_SELECTION = 0x0010, // show the neighbouring weeks in the previous and next month wxCAL_SHOW_SURROUNDING_WEEKS = 0x0020, // show week numbers on the left side of the calendar. wxCAL_SHOW_WEEK_NUMBERS = 0x0040 }; // ---------------------------------------------------------------------------- // constants // ---------------------------------------------------------------------------- // return values for the HitTest() method enum wxCalendarHitTestResult { wxCAL_HITTEST_NOWHERE, // outside of anything wxCAL_HITTEST_HEADER, // on the header (weekdays) wxCAL_HITTEST_DAY, // on a day in the calendar wxCAL_HITTEST_INCMONTH, wxCAL_HITTEST_DECMONTH, wxCAL_HITTEST_SURROUNDING_WEEK, wxCAL_HITTEST_WEEK }; // border types for a date enum wxCalendarDateBorder { wxCAL_BORDER_NONE, // no border (default) wxCAL_BORDER_SQUARE, // a rectangular border wxCAL_BORDER_ROUND // a round border }; // ---------------------------------------------------------------------------- // wxCalendarDateAttr: custom attributes for a calendar date // ---------------------------------------------------------------------------- class WXDLLIMPEXP_CORE wxCalendarDateAttr { public: // ctors wxCalendarDateAttr(const wxColour& colText = wxNullColour, const wxColour& colBack = wxNullColour, const wxColour& colBorder = wxNullColour, const wxFont& font = wxNullFont, wxCalendarDateBorder border = wxCAL_BORDER_NONE) : m_colText(colText), m_colBack(colBack), m_colBorder(colBorder), m_font(font) { Init(border); } wxCalendarDateAttr(wxCalendarDateBorder border, const wxColour& colBorder = wxNullColour) : m_colBorder(colBorder) { Init(border); } // setters void SetTextColour(const wxColour& colText) { m_colText = colText; } void SetBackgroundColour(const wxColour& colBack) { m_colBack = colBack; } void SetBorderColour(const wxColour& col) { m_colBorder = col; } void SetFont(const wxFont& font) { m_font = font; } void SetBorder(wxCalendarDateBorder border) { m_border = border; } void SetHoliday(bool holiday) { m_holiday = holiday; } // accessors bool HasTextColour() const { return m_colText.IsOk(); } bool HasBackgroundColour() const { return m_colBack.IsOk(); } bool HasBorderColour() const { return m_colBorder.IsOk(); } bool HasFont() const { return m_font.IsOk(); } bool HasBorder() const { return m_border != wxCAL_BORDER_NONE; } bool IsHoliday() const { return m_holiday; } const wxColour& GetTextColour() const { return m_colText; } const wxColour& GetBackgroundColour() const { return m_colBack; } const wxColour& GetBorderColour() const { return m_colBorder; } const wxFont& GetFont() const { return m_font; } wxCalendarDateBorder GetBorder() const { return m_border; } // get or change the "mark" attribute, i.e. the one used for the items // marked with wxCalendarCtrl::Mark() static const wxCalendarDateAttr& GetMark() { return m_mark; } static void SetMark(wxCalendarDateAttr const& m) { m_mark = m; } protected: void Init(wxCalendarDateBorder border = wxCAL_BORDER_NONE) { m_border = border; m_holiday = false; } private: static wxCalendarDateAttr m_mark; wxColour m_colText, m_colBack, m_colBorder; wxFont m_font; wxCalendarDateBorder m_border; bool m_holiday; }; // ---------------------------------------------------------------------------- // wxCalendarCtrl events // ---------------------------------------------------------------------------- class WXDLLIMPEXP_FWD_CORE wxCalendarCtrl; class WXDLLIMPEXP_CORE wxCalendarEvent : public wxDateEvent { public: wxCalendarEvent() : m_wday(wxDateTime::Inv_WeekDay) { } wxCalendarEvent(wxWindow *win, const wxDateTime& dt, wxEventType type) : wxDateEvent(win, dt, type), m_wday(wxDateTime::Inv_WeekDay) { } wxCalendarEvent(const wxCalendarEvent& event) : wxDateEvent(event), m_wday(event.m_wday) { } void SetWeekDay(wxDateTime::WeekDay wd) { m_wday = wd; } wxDateTime::WeekDay GetWeekDay() const { return m_wday; } virtual wxEvent *Clone() const wxOVERRIDE { return new wxCalendarEvent(*this); } private: wxDateTime::WeekDay m_wday; wxDECLARE_DYNAMIC_CLASS_NO_ASSIGN(wxCalendarEvent); }; // ---------------------------------------------------------------------------- // wxCalendarCtrlBase // ---------------------------------------------------------------------------- class WXDLLIMPEXP_CORE wxCalendarCtrlBase : public wxControl { public: // do we allow changing the month/year? bool AllowMonthChange() const { return !HasFlag(wxCAL_NO_MONTH_CHANGE); } // get/set the current date virtual wxDateTime GetDate() const = 0; virtual bool SetDate(const wxDateTime& date) = 0; // restricting the dates shown by the control to the specified range: only // implemented in the generic and MSW versions for now // if either date is set, the corresponding limit will be enforced and true // returned; if none are set, the existing restrictions are removed and // false is returned virtual bool SetDateRange(const wxDateTime& WXUNUSED(lowerdate) = wxDefaultDateTime, const wxDateTime& WXUNUSED(upperdate) = wxDefaultDateTime) { return false; } // retrieves the limits currently in use (wxDefaultDateTime if none) in the // provided pointers (which may be NULL) and returns true if there are any // limits or false if none virtual bool GetDateRange(wxDateTime *lowerdate, wxDateTime *upperdate) const { if ( lowerdate ) *lowerdate = wxDefaultDateTime; if ( upperdate ) *upperdate = wxDefaultDateTime; return false; } // returns one of wxCAL_HITTEST_XXX constants and fills either date or wd // with the corresponding value (none for NOWHERE, the date for DAY and wd // for HEADER) // // notice that this is not implemented in all versions virtual wxCalendarHitTestResult HitTest(const wxPoint& WXUNUSED(pos), wxDateTime* WXUNUSED(date) = NULL, wxDateTime::WeekDay* WXUNUSED(wd) = NULL) { return wxCAL_HITTEST_NOWHERE; } // allow or disable changing the current month (and year), return true if // the value of this option really changed or false if it was already set // to the required value // // NB: we provide implementation for this pure virtual function, derived // classes should call it virtual bool EnableMonthChange(bool enable = true) = 0; // an item without custom attributes is drawn with the default colours and // font and without border, setting custom attributes allows to modify this // // the day parameter should be in 1..31 range, for days 29, 30, 31 the // corresponding attribute is just unused if there is no such day in the // current month // // notice that currently arbitrary attributes are supported only in the // generic version, the native controls only support Mark() which assigns // some special appearance (which can be customized using SetMark() for the // generic version) to the given day virtual void Mark(size_t day, bool mark) = 0; virtual wxCalendarDateAttr *GetAttr(size_t WXUNUSED(day)) const { return NULL; } virtual void SetAttr(size_t WXUNUSED(day), wxCalendarDateAttr *attr) { delete attr; } virtual void ResetAttr(size_t WXUNUSED(day)) { } // holidays support // // currently only the generic version implements all functions in this // section; wxMSW implements simple support for holidays (they can be // just enabled or disabled) and wxGTK doesn't support them at all // equivalent to changing wxCAL_SHOW_HOLIDAYS flag but should be called // instead of just changing it virtual void EnableHolidayDisplay(bool display = true); // set/get the colours to use for holidays (if they're enabled) virtual void SetHolidayColours(const wxColour& WXUNUSED(colFg), const wxColour& WXUNUSED(colBg)) { } virtual const wxColour& GetHolidayColourFg() const { return wxNullColour; } virtual const wxColour& GetHolidayColourBg() const { return wxNullColour; } // mark the given day of the current month as being a holiday virtual void SetHoliday(size_t WXUNUSED(day)) { } // customizing the colours of the controls // // most of the methods in this section are only implemented by the native // version of the control and do nothing in the native ones // set/get the colours to use for the display of the week day names at the // top of the controls virtual void SetHeaderColours(const wxColour& WXUNUSED(colFg), const wxColour& WXUNUSED(colBg)) { } virtual const wxColour& GetHeaderColourFg() const { return wxNullColour; } virtual const wxColour& GetHeaderColourBg() const { return wxNullColour; } // set/get the colours used for the currently selected date virtual void SetHighlightColours(const wxColour& WXUNUSED(colFg), const wxColour& WXUNUSED(colBg)) { } virtual const wxColour& GetHighlightColourFg() const { return wxNullColour; } virtual const wxColour& GetHighlightColourBg() const { return wxNullColour; } // implementation only from now on // generate the given calendar event, return true if it was processed // // NB: this is public because it's used from GTK+ callbacks bool GenerateEvent(wxEventType type) { wxCalendarEvent event(this, GetDate(), type); return HandleWindowEvent(event); } protected: // generate all the events for the selection change from dateOld to current // date: SEL_CHANGED, PAGE_CHANGED if necessary and also one of (deprecated) // YEAR/MONTH/DAY_CHANGED ones // // returns true if page changed event was generated, false if the new date // is still in the same month as before bool GenerateAllChangeEvents(const wxDateTime& dateOld); // call SetHoliday() for all holidays in the current month // // should be called on month change, does nothing if wxCAL_SHOW_HOLIDAYS is // not set and returns false in this case, true if we do show them bool SetHolidayAttrs(); // called by SetHolidayAttrs() to forget the previously set holidays virtual void ResetHolidayAttrs() { } // called by EnableHolidayDisplay() virtual void RefreshHolidays() { } // does the week start on monday based on flags and OS settings? bool WeekStartsOnMonday() const; }; // ---------------------------------------------------------------------------- // wxCalendarCtrl // ---------------------------------------------------------------------------- #define wxCalendarNameStr "CalendarCtrl" #ifndef __WXUNIVERSAL__ #if defined(__WXGTK20__) #define wxHAS_NATIVE_CALENDARCTRL #include "wx/gtk/calctrl.h" #define wxCalendarCtrl wxGtkCalendarCtrl #elif defined(__WXMSW__) #define wxHAS_NATIVE_CALENDARCTRL #include "wx/msw/calctrl.h" #elif defined(__WXQT__) #define wxHAS_NATIVE_CALENDARCTRL #include "wx/qt/calctrl.h" #endif #endif // !__WXUNIVERSAL__ #ifndef wxHAS_NATIVE_CALENDARCTRL #include "wx/generic/calctrlg.h" #define wxCalendarCtrl wxGenericCalendarCtrl #endif // ---------------------------------------------------------------------------- // calendar event types and macros for handling them // ---------------------------------------------------------------------------- wxDECLARE_EXPORTED_EVENT( WXDLLIMPEXP_CORE, wxEVT_CALENDAR_SEL_CHANGED, wxCalendarEvent ); wxDECLARE_EXPORTED_EVENT( WXDLLIMPEXP_CORE, wxEVT_CALENDAR_PAGE_CHANGED, wxCalendarEvent ); wxDECLARE_EXPORTED_EVENT( WXDLLIMPEXP_CORE, wxEVT_CALENDAR_DOUBLECLICKED, wxCalendarEvent ); wxDECLARE_EXPORTED_EVENT( WXDLLIMPEXP_CORE, wxEVT_CALENDAR_WEEKDAY_CLICKED, wxCalendarEvent ); wxDECLARE_EXPORTED_EVENT( WXDLLIMPEXP_CORE, wxEVT_CALENDAR_WEEK_CLICKED, wxCalendarEvent ); // deprecated events wxDECLARE_EXPORTED_EVENT( WXDLLIMPEXP_CORE, wxEVT_CALENDAR_DAY_CHANGED, wxCalendarEvent ); wxDECLARE_EXPORTED_EVENT( WXDLLIMPEXP_CORE, wxEVT_CALENDAR_MONTH_CHANGED, wxCalendarEvent ); wxDECLARE_EXPORTED_EVENT( WXDLLIMPEXP_CORE, wxEVT_CALENDAR_YEAR_CHANGED, wxCalendarEvent ); typedef void (wxEvtHandler::*wxCalendarEventFunction)(wxCalendarEvent&); #define wxCalendarEventHandler(func) \ wxEVENT_HANDLER_CAST(wxCalendarEventFunction, func) #define wx__DECLARE_CALEVT(evt, id, fn) \ wx__DECLARE_EVT1(wxEVT_CALENDAR_ ## evt, id, wxCalendarEventHandler(fn)) #define EVT_CALENDAR(id, fn) wx__DECLARE_CALEVT(DOUBLECLICKED, id, fn) #define EVT_CALENDAR_SEL_CHANGED(id, fn) wx__DECLARE_CALEVT(SEL_CHANGED, id, fn) #define EVT_CALENDAR_PAGE_CHANGED(id, fn) wx__DECLARE_CALEVT(PAGE_CHANGED, id, fn) #define EVT_CALENDAR_WEEKDAY_CLICKED(id, fn) wx__DECLARE_CALEVT(WEEKDAY_CLICKED, id, fn) #define EVT_CALENDAR_WEEK_CLICKED(id, fn) wx__DECLARE_CALEVT(WEEK_CLICKED, id, fn) // deprecated events #define EVT_CALENDAR_DAY(id, fn) wx__DECLARE_CALEVT(DAY_CHANGED, id, fn) #define EVT_CALENDAR_MONTH(id, fn) wx__DECLARE_CALEVT(MONTH_CHANGED, id, fn) #define EVT_CALENDAR_YEAR(id, fn) wx__DECLARE_CALEVT(YEAR_CHANGED, id, fn) #endif // wxUSE_CALENDARCTRL #endif // _WX_CALCTRL_H_
h
rticonnextdds-usecases
data/projects/rticonnextdds-usecases/VehicleTracking/ExampleCode/thirdparty/wxWidgets-3.1.2/Win64/include/wx/webviewfshandler.h
///////////////////////////////////////////////////////////////////////////// // Name: webviewfshandler.h // Purpose: Custom webview handler for virtual file system // Author: Nick Matthews // Copyright: (c) 2012 Steven Lamerton // Licence: wxWindows licence ///////////////////////////////////////////////////////////////////////////// // Based on webviewarchivehandler.h file by Steven Lamerton #ifndef _WX_WEBVIEW_FS_HANDLER_H_ #define _WX_WEBVIEW_FS_HANDLER_H_ #include "wx/setup.h" #if wxUSE_WEBVIEW class wxFSFile; class wxFileSystem; #include "wx/webview.h" //Loads from uris such as scheme:example.html class WXDLLIMPEXP_WEBVIEW wxWebViewFSHandler : public wxWebViewHandler { public: wxWebViewFSHandler(const wxString& scheme); virtual ~wxWebViewFSHandler(); virtual wxFSFile* GetFile(const wxString &uri) wxOVERRIDE; private: wxFileSystem* m_fileSystem; }; #endif // wxUSE_WEBVIEW #endif // _WX_WEBVIEW_FS_HANDLER_H_
h
rticonnextdds-usecases
data/projects/rticonnextdds-usecases/VehicleTracking/ExampleCode/thirdparty/wxWidgets-3.1.2/Win64/include/wx/wizard.h
/////////////////////////////////////////////////////////////////////////////// // Name: wx/wizard.h // Purpose: wxWizard class: a GUI control presenting the user with a // sequence of dialogs which allows to simply perform some task // Author: Vadim Zeitlin (partly based on work by Ron Kuris and Kevin B. // Smith) // Modified by: Robert Cavanaugh // Added capability to use .WXR resource files in Wizard pages // Added wxWIZARD_HELP event // Robert Vazan (sizers) // Created: 15.08.99 // Copyright: (c) 1999 Vadim Zeitlin <[email protected]> // Licence: wxWindows licence /////////////////////////////////////////////////////////////////////////////// #ifndef _WX_WIZARD_H_ #define _WX_WIZARD_H_ #include "wx/defs.h" #if wxUSE_WIZARDDLG // ---------------------------------------------------------------------------- // headers and other simple declarations // ---------------------------------------------------------------------------- #include "wx/dialog.h" // the base class #include "wx/panel.h" // ditto #include "wx/event.h" // wxEVT_XXX constants #include "wx/bitmap.h" // Extended style to specify a help button #define wxWIZARD_EX_HELPBUTTON 0x00000010 // Placement flags #define wxWIZARD_VALIGN_TOP 0x01 #define wxWIZARD_VALIGN_CENTRE 0x02 #define wxWIZARD_VALIGN_BOTTOM 0x04 #define wxWIZARD_HALIGN_LEFT 0x08 #define wxWIZARD_HALIGN_CENTRE 0x10 #define wxWIZARD_HALIGN_RIGHT 0x20 #define wxWIZARD_TILE 0x40 // forward declarations class WXDLLIMPEXP_FWD_CORE wxWizard; // ---------------------------------------------------------------------------- // wxWizardPage is one of the wizards screen: it must know what are the // following and preceding pages (which may be NULL for the first/last page). // // Other than GetNext/Prev() functions, wxWizardPage is just a panel and may be // used as such (i.e. controls may be placed directly on it &c). // ---------------------------------------------------------------------------- class WXDLLIMPEXP_CORE wxWizardPage : public wxPanel { public: wxWizardPage() { Init(); } // ctor accepts an optional bitmap which will be used for this page instead // of the default one for this wizard (should be of the same size). Notice // that no other parameters are needed because the wizard will resize and // reposition the page anyhow wxWizardPage(wxWizard *parent, const wxBitmap& bitmap = wxNullBitmap); bool Create(wxWizard *parent, const wxBitmap& bitmap = wxNullBitmap); // these functions are used by the wizard to show another page when the // user chooses "Back" or "Next" button virtual wxWizardPage *GetPrev() const = 0; virtual wxWizardPage *GetNext() const = 0; // default GetBitmap() will just return m_bitmap which is ok in 99% of // cases - override this method if you want to create the bitmap to be used // dynamically or to do something even more fancy. It's ok to return // wxNullBitmap from here - the default one will be used then. virtual wxBitmap GetBitmap() const { return m_bitmap; } #if wxUSE_VALIDATORS // Override the base functions to allow a validator to be assigned to this page. virtual bool TransferDataToWindow() wxOVERRIDE { return GetValidator() ? GetValidator()->TransferToWindow() : wxPanel::TransferDataToWindow(); } virtual bool TransferDataFromWindow() wxOVERRIDE { return GetValidator() ? GetValidator()->TransferFromWindow() : wxPanel::TransferDataFromWindow(); } virtual bool Validate() wxOVERRIDE { return GetValidator() ? GetValidator()->Validate(this) : wxPanel::Validate(); } #endif // wxUSE_VALIDATORS protected: // common part of ctors: void Init(); wxBitmap m_bitmap; private: wxDECLARE_DYNAMIC_CLASS_NO_COPY(wxWizardPage); }; // ---------------------------------------------------------------------------- // wxWizardPageSimple just returns the pointers given to the ctor and is useful // to create a simple wizard where the order of pages never changes. // // OTOH, it is also possible to dynamically decide which page to return (i.e. // depending on the user's choices) as the wizard sample shows - in order to do // this, you must derive from wxWizardPage directly. // ---------------------------------------------------------------------------- class WXDLLIMPEXP_CORE wxWizardPageSimple : public wxWizardPage { public: wxWizardPageSimple() { Init(); } // ctor takes the previous and next pages wxWizardPageSimple(wxWizard *parent, wxWizardPage *prev = NULL, wxWizardPage *next = NULL, const wxBitmap& bitmap = wxNullBitmap) { Create(parent, prev, next, bitmap); } bool Create(wxWizard *parent = NULL, // let it be default ctor too wxWizardPage *prev = NULL, wxWizardPage *next = NULL, const wxBitmap& bitmap = wxNullBitmap) { m_prev = prev; m_next = next; return wxWizardPage::Create(parent, bitmap); } // the pointers may be also set later - but before starting the wizard void SetPrev(wxWizardPage *prev) { m_prev = prev; } void SetNext(wxWizardPage *next) { m_next = next; } // Convenience functions to make the pages follow each other without having // to call their SetPrev() or SetNext() explicitly. wxWizardPageSimple& Chain(wxWizardPageSimple* next) { SetNext(next); next->SetPrev(this); return *next; } static void Chain(wxWizardPageSimple *first, wxWizardPageSimple *second) { wxCHECK_RET( first && second, wxT("NULL passed to wxWizardPageSimple::Chain") ); first->SetNext(second); second->SetPrev(first); } // base class pure virtuals virtual wxWizardPage *GetPrev() const wxOVERRIDE; virtual wxWizardPage *GetNext() const wxOVERRIDE; private: // common part of ctors: void Init() { m_prev = m_next = NULL; } // pointers are private, the derived classes shouldn't mess with them - // just derive from wxWizardPage directly to implement different behaviour wxWizardPage *m_prev, *m_next; wxDECLARE_DYNAMIC_CLASS_NO_COPY(wxWizardPageSimple); }; // ---------------------------------------------------------------------------- // wxWizard // ---------------------------------------------------------------------------- class WXDLLIMPEXP_CORE wxWizardBase : public wxDialog { public: /* The derived class (i.e. the real wxWizard) has a ctor and Create() function taking the following arguments: wxWizard(wxWindow *parent, int id = wxID_ANY, const wxString& title = wxEmptyString, const wxBitmap& bitmap = wxNullBitmap, const wxPoint& pos = wxDefaultPosition, long style = wxDEFAULT_DIALOG_STYLE); */ wxWizardBase() { } // executes the wizard starting from the given page, returns true if it was // successfully finished, false if user cancelled it virtual bool RunWizard(wxWizardPage *firstPage) = 0; // get the current page (NULL if RunWizard() isn't running) virtual wxWizardPage *GetCurrentPage() const = 0; // set the min size which should be available for the pages: a // wizard will take into account the size of the bitmap (if any) // itself and will never be less than some predefined fixed size virtual void SetPageSize(const wxSize& size) = 0; // get the size available for the page virtual wxSize GetPageSize() const = 0; // set the best size for the wizard, i.e. make it big enough to contain all // of the pages starting from the given one // // this function may be called several times and possible with different // pages in which case it will only increase the page size if needed (this // may be useful if not all pages are accessible from the first one by // default) virtual void FitToPage(const wxWizardPage *firstPage) = 0; // Adding pages to page area sizer enlarges wizard virtual wxSizer *GetPageAreaSizer() const = 0; // Set border around page area. Default is 0 if you add at least one // page to GetPageAreaSizer and 5 if you don't. virtual void SetBorder(int border) = 0; // the methods below may be overridden by the derived classes to provide // custom logic for determining the pages order virtual bool HasNextPage(wxWizardPage *page) { return page->GetNext() != NULL; } virtual bool HasPrevPage(wxWizardPage *page) { return page->GetPrev() != NULL; } /// Override these functions to stop InitDialog from calling TransferDataToWindow /// for _all_ pages when the wizard starts. Instead 'ShowPage' will call /// TransferDataToWindow for the first page only. bool TransferDataToWindow() wxOVERRIDE { return true; } bool TransferDataFromWindow() wxOVERRIDE { return true; } bool Validate() wxOVERRIDE { return true; } private: wxDECLARE_NO_COPY_CLASS(wxWizardBase); }; // include the real class declaration #include "wx/generic/wizard.h" // ---------------------------------------------------------------------------- // wxWizardEvent class represents an event generated by the wizard: this event // is first sent to the page itself and, if not processed there, goes up the // window hierarchy as usual // ---------------------------------------------------------------------------- class WXDLLIMPEXP_CORE wxWizardEvent : public wxNotifyEvent { public: wxWizardEvent(wxEventType type = wxEVT_NULL, int id = wxID_ANY, bool direction = true, wxWizardPage* page = NULL); // for EVT_WIZARD_PAGE_CHANGING, return true if we're going forward or // false otherwise and for EVT_WIZARD_PAGE_CHANGED return true if we came // from the previous page and false if we returned from the next one // (this function doesn't make sense for CANCEL events) bool GetDirection() const { return m_direction; } wxWizardPage* GetPage() const { return m_page; } virtual wxEvent *Clone() const wxOVERRIDE { return new wxWizardEvent(*this); } private: bool m_direction; wxWizardPage* m_page; wxDECLARE_DYNAMIC_CLASS_NO_ASSIGN(wxWizardEvent); }; // ---------------------------------------------------------------------------- // macros for handling wxWizardEvents // ---------------------------------------------------------------------------- wxDECLARE_EXPORTED_EVENT( WXDLLIMPEXP_CORE, wxEVT_WIZARD_PAGE_CHANGED, wxWizardEvent ); wxDECLARE_EXPORTED_EVENT( WXDLLIMPEXP_CORE, wxEVT_WIZARD_PAGE_CHANGING, wxWizardEvent ); wxDECLARE_EXPORTED_EVENT( WXDLLIMPEXP_CORE, wxEVT_WIZARD_CANCEL, wxWizardEvent ); wxDECLARE_EXPORTED_EVENT( WXDLLIMPEXP_CORE, wxEVT_WIZARD_HELP, wxWizardEvent ); wxDECLARE_EXPORTED_EVENT( WXDLLIMPEXP_CORE, wxEVT_WIZARD_FINISHED, wxWizardEvent ); wxDECLARE_EXPORTED_EVENT( WXDLLIMPEXP_CORE, wxEVT_WIZARD_PAGE_SHOWN, wxWizardEvent ); wxDECLARE_EXPORTED_EVENT( WXDLLIMPEXP_CORE, wxEVT_WIZARD_BEFORE_PAGE_CHANGED, wxWizardEvent ); typedef void (wxEvtHandler::*wxWizardEventFunction)(wxWizardEvent&); #define wxWizardEventHandler(func) \ wxEVENT_HANDLER_CAST(wxWizardEventFunction, func) #define wx__DECLARE_WIZARDEVT(evt, id, fn) \ wx__DECLARE_EVT1(wxEVT_WIZARD_ ## evt, id, wxWizardEventHandler(fn)) // notifies that the page has just been changed (can't be vetoed) #define EVT_WIZARD_PAGE_CHANGED(id, fn) wx__DECLARE_WIZARDEVT(PAGE_CHANGED, id, fn) // the user pressed "<Back" or "Next>" button and the page is going to be // changed - unless the event handler vetoes the event #define EVT_WIZARD_PAGE_CHANGING(id, fn) wx__DECLARE_WIZARDEVT(PAGE_CHANGING, id, fn) // Called before GetNext/GetPrev is called, so that the handler can change state that will be // used when GetNext/GetPrev is called. PAGE_CHANGING is called too late to influence GetNext/GetPrev. #define EVT_WIZARD_BEFORE_PAGE_CHANGED(id, fn) wx__DECLARE_WIZARDEVT(BEFORE_PAGE_CHANGED, id, fn) // the user pressed "Cancel" button and the wizard is going to be dismissed - // unless the event handler vetoes the event #define EVT_WIZARD_CANCEL(id, fn) wx__DECLARE_WIZARDEVT(CANCEL, id, fn) // the user pressed "Finish" button and the wizard is going to be dismissed - #define EVT_WIZARD_FINISHED(id, fn) wx__DECLARE_WIZARDEVT(FINISHED, id, fn) // the user pressed "Help" button #define EVT_WIZARD_HELP(id, fn) wx__DECLARE_WIZARDEVT(HELP, id, fn) // the page was just shown and laid out #define EVT_WIZARD_PAGE_SHOWN(id, fn) wx__DECLARE_WIZARDEVT(PAGE_SHOWN, id, fn) #endif // wxUSE_WIZARDDLG #endif // _WX_WIZARD_H_
h
rticonnextdds-usecases
data/projects/rticonnextdds-usecases/VehicleTracking/ExampleCode/thirdparty/wxWidgets-3.1.2/Win64/include/wx/variantbase.h
///////////////////////////////////////////////////////////////////////////// // Name: wx/variantbase.h // Purpose: wxVariantBase class, a minimal version of wxVariant used by XTI // Author: Julian Smart // Modified by: Francesco Montorsi // Created: 10/09/98 // Copyright: (c) Julian Smart // Licence: wxWindows licence ///////////////////////////////////////////////////////////////////////////// #ifndef _WX_VARIANTBASE_H_ #define _WX_VARIANTBASE_H_ #include "wx/defs.h" #if wxUSE_VARIANT #include "wx/string.h" #include "wx/arrstr.h" #include "wx/cpp.h" #include <typeinfo> #if wxUSE_DATETIME #include "wx/datetime.h" #endif // wxUSE_DATETIME #include "wx/iosfwrap.h" class wxTypeInfo; class wxObject; class wxClassInfo; /* * wxVariantData stores the actual data in a wxVariant object, * to allow it to store any type of data. * Derive from this to provide custom data handling. * * NB: To prevent addition of extra vtbl pointer to wxVariantData, * we don't multiple-inherit from wxObjectRefData. Instead, * we simply replicate the wxObject ref-counting scheme. * * NB: When you construct a wxVariantData, it will have refcount * of one. Refcount will not be further increased when * it is passed to wxVariant. This simulates old common * scenario where wxVariant took ownership of wxVariantData * passed to it. * If you create wxVariantData for other reasons than passing * it to wxVariant, technically you are not required to call * DecRef() before deleting it. * * TODO: in order to replace wxPropertyValue, we would need * to consider adding constructors that take pointers to C++ variables, * or removing that functionality from the wxProperty library. * Essentially wxPropertyValue takes on some of the wxValidator functionality * by storing pointers and not just actual values, allowing update of C++ data * to be handled automatically. Perhaps there's another way of doing this without * overloading wxVariant with unnecessary functionality. */ class WXDLLIMPEXP_BASE wxVariantData { friend class wxVariantBase; public: wxVariantData() : m_count(1) { } #if wxUSE_STD_IOSTREAM virtual bool Write(wxSTD ostream& WXUNUSED(str)) const { return false; } virtual bool Read(wxSTD istream& WXUNUSED(str)) { return false; } #endif virtual bool Write(wxString& WXUNUSED(str)) const { return false; } virtual bool Read(wxString& WXUNUSED(str)) { return false; } // Override these to provide common functionality virtual bool Eq(wxVariantData& data) const = 0; // What type is it? Return a string name. virtual wxString GetType() const = 0; // returns the type info of the content virtual const wxTypeInfo* GetTypeInfo() const = 0; // If it based on wxObject return the ClassInfo. virtual wxClassInfo* GetValueClassInfo() { return NULL; } int GetRefCount() const { return m_count; } void IncRef() { m_count++; } void DecRef() { if ( --m_count == 0 ) delete this; } protected: // Protected dtor should make some incompatible code // break more louder. That is, they should do data->DecRef() // instead of delete data. virtual ~wxVariantData() {} private: int m_count; }; template<typename T> class wxVariantDataT : public wxVariantData { public: wxVariantDataT(const T& d) : m_data(d) {} virtual ~wxVariantDataT() {} // get a ref to the stored data T & Get() { return m_data; } // get a const ref to the stored data const T & Get() const { return m_data; } // set the data void Set(const T& d) { m_data = d; } // Override these to provide common functionality virtual bool Eq(wxVariantData& WXUNUSED(data)) const { return false; /* FIXME!! */ } // What type is it? Return a string name. virtual wxString GetType() const { return GetTypeInfo()->GetTypeName(); } // return a heap allocated duplicate //virtual wxVariantData* Clone() const { return new wxVariantDataT<T>( Get() ); } // returns the type info of the contentc virtual const wxTypeInfo* GetTypeInfo() const { return wxGetTypeInfo( (T*) NULL ); } private: T m_data; }; /* * wxVariantBase can store any kind of data, but has some basic types * built in. */ class WXDLLIMPEXP_BASE wxVariantBase { public: wxVariantBase(); wxVariantBase(const wxVariantBase& variant); wxVariantBase(wxVariantData* data, const wxString& name = wxEmptyString); template<typename T> wxVariantBase(const T& data, const wxString& name = wxEmptyString) : m_data(new wxVariantDataT<T>(data)), m_name(name) {} virtual ~wxVariantBase(); // generic assignment void operator= (const wxVariantBase& variant); // Assignment using data, e.g. // myVariant = new wxStringVariantData("hello"); void operator= (wxVariantData* variantData); bool operator== (const wxVariantBase& variant) const; bool operator!= (const wxVariantBase& variant) const; // Sets/gets name inline void SetName(const wxString& name) { m_name = name; } inline const wxString& GetName() const { return m_name; } // Tests whether there is data bool IsNull() const; // FIXME: used by wxVariantBase code but is nice wording... bool IsEmpty() const { return IsNull(); } // For compatibility with wxWidgets <= 2.6, this doesn't increase // reference count. wxVariantData* GetData() const { return m_data; } void SetData(wxVariantData* data) ; // make a 'clone' of the object void Ref(const wxVariantBase& clone); // destroy a reference void UnRef(); // Make NULL (i.e. delete the data) void MakeNull(); // write contents to a string (e.g. for debugging) wxString MakeString() const; // Delete data and name void Clear(); // Returns a string representing the type of the variant, // e.g. "string", "bool", "stringlist", "list", "double", "long" wxString GetType() const; bool IsType(const wxString& type) const; bool IsValueKindOf(const wxClassInfo* type) const; // FIXME wxXTI methods: // get the typeinfo of the stored object const wxTypeInfo* GetTypeInfo() const { if (!m_data) return NULL; return m_data->GetTypeInfo(); } // get a ref to the stored data template<typename T> T& Get() { wxVariantDataT<T> *dataptr = wx_dynamic_cast(wxVariantDataT<T>*, m_data); wxASSERT_MSG( dataptr, wxString::Format(wxT("Cast to %s not possible"), typeid(T).name()) ); return dataptr->Get(); } // get a const ref to the stored data template<typename T> const T& Get() const { const wxVariantDataT<T> *dataptr = wx_dynamic_cast(const wxVariantDataT<T>*, m_data); wxASSERT_MSG( dataptr, wxString::Format(wxT("Cast to %s not possible"), typeid(T).name()) ); return dataptr->Get(); } template<typename T> bool HasData() const { const wxVariantDataT<T> *dataptr = wx_dynamic_cast(const wxVariantDataT<T>*, m_data); return dataptr != NULL; } // returns this value as string wxString GetAsString() const; // gets the stored data casted to a wxObject*, // returning NULL if cast is not possible wxObject* GetAsObject(); protected: wxVariantData* m_data; wxString m_name; }; #include "wx/dynarray.h" WX_DECLARE_OBJARRAY_WITH_DECL(wxVariantBase, wxVariantBaseArray, class WXDLLIMPEXP_BASE); // templated streaming, every type must have their specialization for these methods template<typename T> void wxStringReadValue( const wxString &s, T &data ); template<typename T> void wxStringWriteValue( wxString &s, const T &data); template<typename T> void wxToStringConverter( const wxVariantBase &v, wxString &s ) \ { wxStringWriteValue( s, v.Get<T>() ); } template<typename T> void wxFromStringConverter( const wxString &s, wxVariantBase &v ) \ { T d; wxStringReadValue( s, d ); v = wxVariantBase(d); } #endif // wxUSE_VARIANT #endif // _WX_VARIANTBASE_H_
h
rticonnextdds-usecases
data/projects/rticonnextdds-usecases/VehicleTracking/ExampleCode/thirdparty/wxWidgets-3.1.2/Win64/include/wx/tracker.h
///////////////////////////////////////////////////////////////////////////// // Name: wx/tracker.h // Purpose: Support class for object lifetime tracking (wxWeakRef<T>) // Author: Arne Steinarson // Created: 28 Dec 07 // Copyright: (c) 2007 Arne Steinarson // Licence: wxWindows licence ///////////////////////////////////////////////////////////////////////////// #ifndef _WX_TRACKER_H_ #define _WX_TRACKER_H_ #include "wx/defs.h" class wxEventConnectionRef; // This class represents an object tracker and is stored in a linked list // in the tracked object. It is only used in one of its derived forms. class WXDLLIMPEXP_BASE wxTrackerNode { public: wxTrackerNode() : m_nxt(NULL) { } virtual ~wxTrackerNode() { } virtual void OnObjectDestroy() = 0; virtual wxEventConnectionRef *ToEventConnection() { return NULL; } private: wxTrackerNode *m_nxt; friend class wxTrackable; // For list access friend class wxEvtHandler; // For list access }; // Add-on base class for a trackable object. class WXDLLIMPEXP_BASE wxTrackable { public: void AddNode(wxTrackerNode *prn) { prn->m_nxt = m_first; m_first = prn; } void RemoveNode(wxTrackerNode *prn) { for ( wxTrackerNode **pprn = &m_first; *pprn; pprn = &(*pprn)->m_nxt ) { if ( *pprn == prn ) { *pprn = prn->m_nxt; return; } } wxFAIL_MSG( "removing invalid tracker node" ); } wxTrackerNode *GetFirst() const { return m_first; } protected: // this class is only supposed to be used as a base class but never be // created nor destroyed directly so all ctors and dtor are protected wxTrackable() : m_first(NULL) { } // copy ctor and assignment operator intentionally do not copy m_first: the // objects which track the original trackable shouldn't track the new copy wxTrackable(const wxTrackable& WXUNUSED(other)) : m_first(NULL) { } wxTrackable& operator=(const wxTrackable& WXUNUSED(other)) { return *this; } // dtor is not virtual: this class is not supposed to be used // polymorphically and adding a virtual table to it would add unwanted // overhead ~wxTrackable() { // Notify all registered refs while ( m_first ) { wxTrackerNode * const first = m_first; m_first = first->m_nxt; first->OnObjectDestroy(); } } wxTrackerNode *m_first; }; #endif // _WX_TRACKER_H_
h
rticonnextdds-usecases
data/projects/rticonnextdds-usecases/VehicleTracking/ExampleCode/thirdparty/wxWidgets-3.1.2/Win64/include/wx/hashset.h
///////////////////////////////////////////////////////////////////////////// // Name: wx/hashset.h // Purpose: wxHashSet class // Author: Mattia Barbon // Modified by: // Created: 11/08/2003 // Copyright: (c) Mattia Barbon // Licence: wxWindows licence ///////////////////////////////////////////////////////////////////////////// #ifndef _WX_HASHSET_H_ #define _WX_HASHSET_H_ #include "wx/hashmap.h" // see comment in wx/hashmap.h which also applies to different standard hash // set classes #if wxUSE_STD_CONTAINERS && \ (defined(HAVE_STD_UNORDERED_SET) || defined(HAVE_TR1_UNORDERED_SET)) #if defined(HAVE_STD_UNORDERED_SET) #include <unordered_set> #define WX_HASH_SET_BASE_TEMPLATE std::unordered_set #elif defined(HAVE_TR1_UNORDERED_SET) #include <tr1/unordered_set> #define WX_HASH_SET_BASE_TEMPLATE std::tr1::unordered_set #else #error Update this code: unordered_set is available, but I do not know where. #endif #elif wxUSE_STD_CONTAINERS && defined(HAVE_STL_HASH_MAP) #if defined(HAVE_EXT_HASH_MAP) #include <ext/hash_set> #elif defined(HAVE_HASH_MAP) #include <hash_set> #endif #define WX_HASH_SET_BASE_TEMPLATE WX_HASH_MAP_NAMESPACE::hash_set #endif // different hash_set/unordered_set possibilities #ifdef WX_HASH_SET_BASE_TEMPLATE // we need to define the class declared by _WX_DECLARE_HASH_SET as a class and // not a typedef to allow forward declaring it #define _WX_DECLARE_HASH_SET_IMPL( KEY_T, HASH_T, KEY_EQ_T, PTROP, CLASSNAME, CLASSEXP ) \ CLASSEXP CLASSNAME \ : public WX_HASH_SET_BASE_TEMPLATE< KEY_T, HASH_T, KEY_EQ_T > \ { \ public: \ explicit CLASSNAME(size_type n = 3, \ const hasher& h = hasher(), \ const key_equal& ke = key_equal(), \ const allocator_type& a = allocator_type()) \ : WX_HASH_SET_BASE_TEMPLATE< KEY_T, HASH_T, KEY_EQ_T >(n, h, ke, a) \ {} \ template <class InputIterator> \ CLASSNAME(InputIterator f, InputIterator l, \ const hasher& h = hasher(), \ const key_equal& ke = key_equal(), \ const allocator_type& a = allocator_type()) \ : WX_HASH_SET_BASE_TEMPLATE< KEY_T, HASH_T, KEY_EQ_T >(f, l, h, ke, a)\ {} \ CLASSNAME(const WX_HASH_SET_BASE_TEMPLATE< KEY_T, HASH_T, KEY_EQ_T >& s) \ : WX_HASH_SET_BASE_TEMPLATE< KEY_T, HASH_T, KEY_EQ_T >(s) \ {} \ } // In some standard library implementations (in particular, the libstdc++ that // ships with g++ 4.7), std::unordered_set inherits privately from its hasher // and comparator template arguments for purposes of empty base optimization. // As a result, in the declaration of a class deriving from std::unordered_set // the names of the hasher and comparator classes are interpreted as naming // the base class which is inaccessible. // The workaround is to prefix the class names with 'struct'; however, don't // do this on MSVC because it causes a warning there if the class was // declared as a 'class' rather than a 'struct' (and MSVC's std::unordered_set // implementation does not suffer from the access problem). #ifdef _MSC_VER #define WX_MAYBE_PREFIX_WITH_STRUCT(STRUCTNAME) STRUCTNAME #else #define WX_MAYBE_PREFIX_WITH_STRUCT(STRUCTNAME) struct STRUCTNAME #endif #define _WX_DECLARE_HASH_SET( KEY_T, HASH_T, KEY_EQ_T, PTROP, CLASSNAME, CLASSEXP ) \ _WX_DECLARE_HASH_SET_IMPL( \ KEY_T, \ WX_MAYBE_PREFIX_WITH_STRUCT(HASH_T), \ WX_MAYBE_PREFIX_WITH_STRUCT(KEY_EQ_T), \ PTROP, \ CLASSNAME, \ CLASSEXP) #else // no appropriate STL class, use our own implementation // this is a complex way of defining an easily inlineable identity function... #define _WX_DECLARE_HASH_SET_KEY_EX( KEY_T, CLASSNAME, CLASSEXP ) \ CLASSEXP CLASSNAME \ { \ typedef KEY_T key_type; \ typedef const key_type const_key_type; \ typedef const_key_type& const_key_reference; \ public: \ CLASSNAME() { } \ const_key_reference operator()( const_key_reference key ) const \ { return key; } \ \ /* 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; } \ }; #define _WX_DECLARE_HASH_SET( KEY_T, HASH_T, KEY_EQ_T, PTROP, CLASSNAME, CLASSEXP )\ _WX_DECLARE_HASH_SET_KEY_EX( KEY_T, CLASSNAME##_wxImplementation_KeyEx, CLASSEXP ) \ _WX_DECLARE_HASHTABLE( KEY_T, KEY_T, HASH_T, \ CLASSNAME##_wxImplementation_KeyEx, KEY_EQ_T, PTROP, \ CLASSNAME##_wxImplementation_HashTable, CLASSEXP, grow_lf70, never_shrink ) \ CLASSEXP CLASSNAME:public CLASSNAME##_wxImplementation_HashTable \ { \ public: \ _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() ) {} \ \ Insert_Result insert( const key_type& key ) \ { \ bool created; \ Node *node = GetOrCreateNode( key, created ); \ return Insert_Result( iterator( node, this ), created ); \ } \ \ 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 ); \ } \ \ size_type erase( const key_type& k ) \ { return CLASSNAME##_wxImplementation_HashTable::erase( k ); } \ void erase( const iterator& it ) { erase( *it ); } \ void erase( const const_iterator& it ) { erase( *it ); } \ \ /* count() == 0 | 1 */ \ size_type count( const const_key_type& key ) const \ { return GetNode( key ) ? 1 : 0; } \ } #endif // STL/wx implementations // these macros are to be used in the user code #define WX_DECLARE_HASH_SET( KEY_T, HASH_T, KEY_EQ_T, CLASSNAME) \ _WX_DECLARE_HASH_SET( KEY_T, HASH_T, KEY_EQ_T, wxPTROP_NORMAL, CLASSNAME, class ) // and these do exactly the same thing but should be used inside the // library #define WX_DECLARE_HASH_SET_WITH_DECL( KEY_T, HASH_T, KEY_EQ_T, CLASSNAME, DECL) \ _WX_DECLARE_HASH_SET( KEY_T, HASH_T, KEY_EQ_T, wxPTROP_NORMAL, CLASSNAME, DECL ) #define WX_DECLARE_EXPORTED_HASH_SET( KEY_T, HASH_T, KEY_EQ_T, CLASSNAME) \ WX_DECLARE_HASH_SET_WITH_DECL( KEY_T, HASH_T, KEY_EQ_T, \ CLASSNAME, class WXDLLIMPEXP_CORE ) // Finally these versions allow to define hash sets of non-objects (including // pointers, hence the confusing but wxArray-compatible name) without // operator->() which can't be used for them. This is mostly used inside the // library itself to avoid warnings when using such hash sets with some less // common compilers (notably Sun CC). #define WX_DECLARE_HASH_SET_PTR( KEY_T, HASH_T, KEY_EQ_T, CLASSNAME) \ _WX_DECLARE_HASH_SET( KEY_T, HASH_T, KEY_EQ_T, wxPTROP_NOP, CLASSNAME, class ) #define WX_DECLARE_HASH_SET_WITH_DECL_PTR( KEY_T, HASH_T, KEY_EQ_T, CLASSNAME, DECL) \ _WX_DECLARE_HASH_SET( KEY_T, HASH_T, KEY_EQ_T, wxPTROP_NOP, CLASSNAME, DECL ) // 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_SET(type, hashset) \ { \ type::iterator it, en; \ for( it = (hashset).begin(), en = (hashset).end(); it != en; ++it ) \ delete *it; \ (hashset).clear(); \ } #endif // _WX_HASHSET_H_
h
rticonnextdds-usecases
data/projects/rticonnextdds-usecases/VehicleTracking/ExampleCode/thirdparty/wxWidgets-3.1.2/Win64/include/wx/imagpcx.h
///////////////////////////////////////////////////////////////////////////// // Name: wx/imagpcx.h // Purpose: wxImage PCX handler // Author: Guillermo Rodriguez Garcia <[email protected]> // Copyright: (c) 1999 Guillermo Rodriguez Garcia // Licence: wxWindows licence ///////////////////////////////////////////////////////////////////////////// #ifndef _WX_IMAGPCX_H_ #define _WX_IMAGPCX_H_ #include "wx/image.h" //----------------------------------------------------------------------------- // wxPCXHandler //----------------------------------------------------------------------------- #if wxUSE_PCX class WXDLLIMPEXP_CORE wxPCXHandler : public wxImageHandler { public: inline wxPCXHandler() { m_name = wxT("PCX file"); m_extension = wxT("pcx"); m_type = wxBITMAP_TYPE_PCX; m_mime = wxT("image/pcx"); } #if wxUSE_STREAMS virtual bool LoadFile( wxImage *image, wxInputStream& stream, bool verbose=true, int index=-1 ) wxOVERRIDE; virtual bool SaveFile( wxImage *image, wxOutputStream& stream, bool verbose=true ) wxOVERRIDE; protected: virtual bool DoCanRead( wxInputStream& stream ) wxOVERRIDE; #endif // wxUSE_STREAMS private: wxDECLARE_DYNAMIC_CLASS(wxPCXHandler); }; #endif // wxUSE_PCX #endif // _WX_IMAGPCX_H_
h
rticonnextdds-usecases
data/projects/rticonnextdds-usecases/VehicleTracking/ExampleCode/thirdparty/wxWidgets-3.1.2/Win64/include/wx/dateevt.h
/////////////////////////////////////////////////////////////////////////////// // Name: wx/dateevt.h // Purpose: declares wxDateEvent class // Author: Vadim Zeitlin // Modified by: // Created: 2005-01-10 // Copyright: (c) 2005 Vadim Zeitlin <[email protected]> // Licence: wxWindows licence /////////////////////////////////////////////////////////////////////////////// #ifndef _WX_DATEEVT_H_ #define _WX_DATEEVT_H_ #include "wx/event.h" #include "wx/datetime.h" #include "wx/window.h" // ---------------------------------------------------------------------------- // wxDateEvent: used by wxCalendarCtrl, wxDatePickerCtrl and wxTimePickerCtrl. // ---------------------------------------------------------------------------- class WXDLLIMPEXP_ADV wxDateEvent : public wxCommandEvent { public: wxDateEvent() { } wxDateEvent(wxWindow *win, const wxDateTime& dt, wxEventType type) : wxCommandEvent(type, win->GetId()), m_date(dt) { SetEventObject(win); } const wxDateTime& GetDate() const { return m_date; } void SetDate(const wxDateTime &date) { m_date = date; } // default copy ctor, assignment operator and dtor are ok virtual wxEvent *Clone() const wxOVERRIDE { return new wxDateEvent(*this); } private: wxDateTime m_date; wxDECLARE_DYNAMIC_CLASS_NO_ASSIGN(wxDateEvent); }; // ---------------------------------------------------------------------------- // event types and macros for handling them // ---------------------------------------------------------------------------- wxDECLARE_EXPORTED_EVENT(WXDLLIMPEXP_ADV, wxEVT_DATE_CHANGED, wxDateEvent); wxDECLARE_EXPORTED_EVENT(WXDLLIMPEXP_ADV, wxEVT_TIME_CHANGED, wxDateEvent); typedef void (wxEvtHandler::*wxDateEventFunction)(wxDateEvent&); #define wxDateEventHandler(func) \ wxEVENT_HANDLER_CAST(wxDateEventFunction, func) #define EVT_DATE_CHANGED(id, fn) \ wx__DECLARE_EVT1(wxEVT_DATE_CHANGED, id, wxDateEventHandler(fn)) #define EVT_TIME_CHANGED(id, fn) \ wx__DECLARE_EVT1(wxEVT_TIME_CHANGED, id, wxDateEventHandler(fn)) #endif // _WX_DATEEVT_H_
h
rticonnextdds-usecases
data/projects/rticonnextdds-usecases/VehicleTracking/ExampleCode/thirdparty/wxWidgets-3.1.2/Win64/include/wx/sstream.h
/////////////////////////////////////////////////////////////////////////////// // Name: wx/sstream.h // Purpose: string-based streams // Author: Vadim Zeitlin // Modified by: // Created: 2004-09-19 // Copyright: (c) 2004 Vadim Zeitlin <[email protected]> // Licence: wxWindows licence /////////////////////////////////////////////////////////////////////////////// #ifndef _WX_SSTREAM_H_ #define _WX_SSTREAM_H_ #include "wx/stream.h" #if wxUSE_STREAMS // ---------------------------------------------------------------------------- // wxStringInputStream is a stream reading from the given (fixed size) string // ---------------------------------------------------------------------------- class WXDLLIMPEXP_BASE wxStringInputStream : public wxInputStream { public: // ctor associates the stream with the given string which makes a copy of // it wxStringInputStream(const wxString& s); virtual wxFileOffset GetLength() const wxOVERRIDE; virtual bool IsSeekable() const wxOVERRIDE { return true; } protected: virtual wxFileOffset OnSysSeek(wxFileOffset ofs, wxSeekMode mode) wxOVERRIDE; virtual wxFileOffset OnSysTell() const wxOVERRIDE; virtual size_t OnSysRead(void *buffer, size_t size) wxOVERRIDE; private: // the string that was passed in the ctor wxString m_str; // the buffer we're reading from wxCharBuffer m_buf; // length of the buffer we're reading from size_t m_len; // position in the stream in bytes, *not* in chars size_t m_pos; wxDECLARE_NO_COPY_CLASS(wxStringInputStream); }; // ---------------------------------------------------------------------------- // wxStringOutputStream writes data to the given string, expanding it as needed // ---------------------------------------------------------------------------- class WXDLLIMPEXP_BASE wxStringOutputStream : public wxOutputStream { public: // The stream will write data either to the provided string or to an // internal string which can be retrieved using GetString() // // Note that the conversion object should have the life time greater than // this stream. explicit wxStringOutputStream(wxString *pString = NULL, wxMBConv& conv = wxConvUTF8); // get the string containing current output const wxString& GetString() const { return *m_str; } virtual bool IsSeekable() const wxOVERRIDE { return true; } protected: virtual wxFileOffset OnSysTell() const wxOVERRIDE; virtual size_t OnSysWrite(const void *buffer, size_t size) wxOVERRIDE; private: // internal string, not used if caller provided his own string wxString m_strInternal; // pointer given by the caller or just pointer to m_strInternal wxString *m_str; // position in the stream in bytes, *not* in chars size_t m_pos; // converter to use: notice that with the default UTF-8 one the input // stream must contain valid UTF-8 data, use wxConvISO8859_1 to work with // arbitrary 8 bit data wxMBConv& m_conv; #if wxUSE_UNICODE // unconverted data from the last call to OnSysWrite() wxMemoryBuffer m_unconv; #endif // wxUSE_UNICODE wxDECLARE_NO_COPY_CLASS(wxStringOutputStream); }; #endif // wxUSE_STREAMS #endif // _WX_SSTREAM_H_
h
rticonnextdds-usecases
data/projects/rticonnextdds-usecases/VehicleTracking/ExampleCode/thirdparty/wxWidgets-3.1.2/Win64/include/wx/bookctrl.h
/////////////////////////////////////////////////////////////////////////////// // Name: wx/bookctrl.h // Purpose: wxBookCtrlBase: common base class for wxList/Tree/Notebook // Author: Vadim Zeitlin // Modified by: // Created: 19.08.03 // Copyright: (c) 2003 Vadim Zeitlin <[email protected]> // Licence: wxWindows licence /////////////////////////////////////////////////////////////////////////////// #ifndef _WX_BOOKCTRL_H_ #define _WX_BOOKCTRL_H_ // ---------------------------------------------------------------------------- // headers // ---------------------------------------------------------------------------- #include "wx/defs.h" #if wxUSE_BOOKCTRL #include "wx/control.h" #include "wx/vector.h" #include "wx/withimages.h" class WXDLLIMPEXP_FWD_CORE wxImageList; class WXDLLIMPEXP_FWD_CORE wxBookCtrlEvent; // ---------------------------------------------------------------------------- // constants // ---------------------------------------------------------------------------- // wxBookCtrl hit results enum { wxBK_HITTEST_NOWHERE = 1, // not on tab wxBK_HITTEST_ONICON = 2, // on icon wxBK_HITTEST_ONLABEL = 4, // on label wxBK_HITTEST_ONITEM = 16, // on tab control but not on its icon or label wxBK_HITTEST_ONPAGE = 8 // not on tab control, but over the selected page }; // wxBookCtrl flags (common for wxNotebook, wxListbook, wxChoicebook, wxTreebook) #define wxBK_DEFAULT 0x0000 #define wxBK_TOP 0x0010 #define wxBK_BOTTOM 0x0020 #define wxBK_LEFT 0x0040 #define wxBK_RIGHT 0x0080 #define wxBK_ALIGN_MASK (wxBK_TOP | wxBK_BOTTOM | wxBK_LEFT | wxBK_RIGHT) // ---------------------------------------------------------------------------- // wxBookCtrlBase // ---------------------------------------------------------------------------- class WXDLLIMPEXP_CORE wxBookCtrlBase : public wxControl, public wxWithImages { public: // construction // ------------ wxBookCtrlBase() { Init(); } wxBookCtrlBase(wxWindow *parent, wxWindowID winid, const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxDefaultSize, long style = 0, const wxString& name = wxEmptyString) { Init(); (void)Create(parent, winid, pos, size, style, name); } // quasi ctor bool Create(wxWindow *parent, wxWindowID winid, const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxDefaultSize, long style = 0, const wxString& name = wxEmptyString); // accessors // --------- // get number of pages in the dialog virtual size_t GetPageCount() const { return m_pages.size(); } // get the panel which represents the given page virtual wxWindow *GetPage(size_t n) const { return m_pages.at(n); } // get the current page or NULL if none wxWindow *GetCurrentPage() const { const int n = GetSelection(); return n == wxNOT_FOUND ? NULL : GetPage(n); } // get the currently selected page or wxNOT_FOUND if none virtual int GetSelection() const { return m_selection; } // set/get the title of a page virtual bool SetPageText(size_t n, const wxString& strText) = 0; virtual wxString GetPageText(size_t n) const = 0; // image list stuff: each page may have an image associated with it (all // images belong to the same image list) // --------------------------------------------------------------------- // sets/returns item's image index in the current image list virtual int GetPageImage(size_t n) const = 0; virtual bool SetPageImage(size_t n, int imageId) = 0; // geometry // -------- // resize the notebook so that all pages will have the specified size virtual void SetPageSize(const wxSize& size); // return the size of the area needed to accommodate the controller wxSize GetControllerSize() const; // calculate the size of the control from the size of its page // // by default this simply returns size enough to fit both the page and the // controller virtual wxSize CalcSizeFromPage(const wxSize& sizePage) const; // get/set size of area between book control area and page area unsigned int GetInternalBorder() const { return m_internalBorder; } void SetInternalBorder(unsigned int border) { m_internalBorder = border; } // Sets/gets the margin around the controller void SetControlMargin(int margin) { m_controlMargin = margin; } int GetControlMargin() const { return m_controlMargin; } // returns true if we have wxBK_TOP or wxBK_BOTTOM style bool IsVertical() const { return HasFlag(wxBK_BOTTOM | wxBK_TOP); } // set/get option to shrink to fit current page void SetFitToCurrentPage(bool fit) { m_fitToCurrentPage = fit; } bool GetFitToCurrentPage() const { return m_fitToCurrentPage; } // returns the sizer containing the control, if any wxSizer* GetControlSizer() const { return m_controlSizer; } // operations // ---------- // remove one page from the control and delete it virtual bool DeletePage(size_t n); // remove one page from the notebook, without deleting it virtual bool RemovePage(size_t n) { DoInvalidateBestSize(); return DoRemovePage(n) != NULL; } // remove all pages and delete them virtual bool DeleteAllPages() { m_selection = wxNOT_FOUND; DoInvalidateBestSize(); WX_CLEAR_ARRAY(m_pages); return true; } // adds a new page to the control virtual bool AddPage(wxWindow *page, const wxString& text, bool bSelect = false, int imageId = NO_IMAGE) { DoInvalidateBestSize(); return InsertPage(GetPageCount(), page, text, bSelect, imageId); } // the same as AddPage(), but adds the page at the specified position virtual bool InsertPage(size_t n, wxWindow *page, const wxString& text, bool bSelect = false, int imageId = NO_IMAGE) = 0; // set the currently selected page, return the index of the previously // selected one (or wxNOT_FOUND on error) // // NB: this function will generate PAGE_CHANGING/ED events virtual int SetSelection(size_t n) = 0; // acts as SetSelection but does not generate events virtual int ChangeSelection(size_t n) = 0; // cycle thru the pages void AdvanceSelection(bool forward = true) { int nPage = GetNextPage(forward); if ( nPage != wxNOT_FOUND ) { // cast is safe because of the check above SetSelection((size_t)nPage); } } // return the index of the given page or wxNOT_FOUND int FindPage(const wxWindow* page) const; // hit test: returns which page is hit and, optionally, where (icon, label) virtual int HitTest(const wxPoint& WXUNUSED(pt), long * WXUNUSED(flags) = NULL) const { return wxNOT_FOUND; } // we do have multiple pages virtual bool HasMultiplePages() const wxOVERRIDE { return true; } // returns true if the platform should explicitly apply a theme border virtual bool CanApplyThemeBorder() const wxOVERRIDE { return false; } protected: // flags for DoSetSelection() enum { SetSelection_SendEvent = 1 }; // choose the default border for this window virtual wxBorder GetDefaultBorder() const wxOVERRIDE { return wxBORDER_NONE; } // After the insertion of the page in the method InsertPage, calling this // method sets the selection to the given page or the first one if there is // still no selection. The "selection changed" event is sent only if // bSelect is true, so when it is false, no event is sent even if the // selection changed from wxNOT_FOUND to 0 when inserting the first page. // // Returns true if the selection was set to the specified page (explicitly // because of bSelect == true or implicitly because it's the first page) or // false otherwise. bool DoSetSelectionAfterInsertion(size_t n, bool bSelect); // Update the selection after removing the page at the given index, // typically called from the derived class overridden DoRemovePage(). void DoSetSelectionAfterRemoval(size_t n); // set the selection to the given page, sending the events (which can // possibly prevent the page change from taking place) if SendEvent flag is // included virtual int DoSetSelection(size_t nPage, int flags = 0); // if the derived class uses DoSetSelection() for implementing // [Set|Change]Selection, it must override UpdateSelectedPage(), // CreatePageChangingEvent() and MakeChangedEvent(), but as it might not // use it, these functions are not pure virtual // called to notify the control about a new current page virtual void UpdateSelectedPage(size_t WXUNUSED(newsel)) { wxFAIL_MSG(wxT("Override this function!")); } // create a new "page changing" event virtual wxBookCtrlEvent* CreatePageChangingEvent() const { wxFAIL_MSG(wxT("Override this function!")); return NULL; } // modify the event created by CreatePageChangingEvent() to "page changed" // event, usually by just calling SetEventType() on it virtual void MakeChangedEvent(wxBookCtrlEvent& WXUNUSED(event)) { wxFAIL_MSG(wxT("Override this function!")); } // The derived class also may override the following method, also called // from DoSetSelection(), to show/hide pages differently. virtual void DoShowPage(wxWindow* page, bool show) { page->Show(show); } // Should we accept NULL page pointers in Add/InsertPage()? // // Default is no but derived classes may override it if they can treat NULL // pages in some sensible way (e.g. wxTreebook overrides this to allow // having nodes without any associated page) virtual bool AllowNullPage() const { return false; } // For classes that allow null pages, we also need a way to find the // closest non-NULL page corresponding to the given index, e.g. the first // leaf item in wxTreebook tree and this method must be overridden to // return it if AllowNullPage() is overridden. Note that it can still // return null if there are no valid pages after this one. virtual wxWindow *TryGetNonNullPage(size_t page) { return m_pages[page]; } // Remove the page and return a pointer to it. // // It also needs to update the current selection if necessary, i.e. if the // page being removed comes before the selected one and the helper method // DoSetSelectionAfterRemoval() can be used for this. virtual wxWindow *DoRemovePage(size_t page) = 0; // our best size is the size which fits all our pages virtual wxSize DoGetBestSize() const wxOVERRIDE; // helper: get the next page wrapping if we reached the end int GetNextPage(bool forward) const; // Lay out controls virtual void DoSize(); // It is better to make this control transparent so that by default the controls on // its pages are on the same colour background as the rest of the window. If the user // prefers a coloured background they can set the background colour on the page panel virtual bool HasTransparentBackground() wxOVERRIDE { return true; } // This method also invalidates the size of the controller and should be // called instead of just InvalidateBestSize() whenever pages are added or // removed as this also affects the controller void DoInvalidateBestSize(); #if wxUSE_HELP // Show the help for the corresponding page void OnHelp(wxHelpEvent& event); #endif // wxUSE_HELP // the array of all pages of this control wxVector<wxWindow*> m_pages; // get the page area virtual wxRect GetPageRect() const; // event handlers void OnSize(wxSizeEvent& event); // controller buddy if available, NULL otherwise (usually for native book controls like wxNotebook) wxControl *m_bookctrl; // Whether to shrink to fit current page bool m_fitToCurrentPage; // the sizer containing the choice control wxSizer *m_controlSizer; // the margin around the choice control int m_controlMargin; // The currently selected page (in range 0..m_pages.size()-1 inclusive) or // wxNOT_FOUND if none (this can normally only be the case for an empty // control without any pages). int m_selection; private: // common part of all ctors void Init(); // internal border unsigned int m_internalBorder; wxDECLARE_ABSTRACT_CLASS(wxBookCtrlBase); wxDECLARE_NO_COPY_CLASS(wxBookCtrlBase); wxDECLARE_EVENT_TABLE(); }; // ---------------------------------------------------------------------------- // wxBookCtrlEvent: page changing events generated by book classes // ---------------------------------------------------------------------------- class WXDLLIMPEXP_CORE wxBookCtrlEvent : public wxNotifyEvent { public: wxBookCtrlEvent(wxEventType commandType = wxEVT_NULL, int winid = 0, int nSel = wxNOT_FOUND, int nOldSel = wxNOT_FOUND) : wxNotifyEvent(commandType, winid) { m_nSel = nSel; m_nOldSel = nOldSel; } wxBookCtrlEvent(const wxBookCtrlEvent& event) : wxNotifyEvent(event) { m_nSel = event.m_nSel; m_nOldSel = event.m_nOldSel; } virtual wxEvent *Clone() const wxOVERRIDE { return new wxBookCtrlEvent(*this); } // accessors // the currently selected page (wxNOT_FOUND if none) int GetSelection() const { return m_nSel; } void SetSelection(int nSel) { m_nSel = nSel; } // the page that was selected before the change (wxNOT_FOUND if none) int GetOldSelection() const { return m_nOldSel; } void SetOldSelection(int nOldSel) { m_nOldSel = nOldSel; } private: int m_nSel, // currently selected page m_nOldSel; // previously selected page wxDECLARE_DYNAMIC_CLASS_NO_ASSIGN(wxBookCtrlEvent); }; typedef void (wxEvtHandler::*wxBookCtrlEventFunction)(wxBookCtrlEvent&); #define wxBookCtrlEventHandler(func) \ wxEVENT_HANDLER_CAST(wxBookCtrlEventFunction, func) // obsolete name, defined for compatibility only #define wxBookCtrlBaseEvent wxBookCtrlEvent // make a default book control for given platform #if wxUSE_NOTEBOOK // dedicated to majority of desktops #include "wx/notebook.h" #define wxBookCtrl wxNotebook #define wxEVT_BOOKCTRL_PAGE_CHANGED wxEVT_NOTEBOOK_PAGE_CHANGED #define wxEVT_BOOKCTRL_PAGE_CHANGING wxEVT_NOTEBOOK_PAGE_CHANGING #define EVT_BOOKCTRL_PAGE_CHANGED(id, fn) EVT_NOTEBOOK_PAGE_CHANGED(id, fn) #define EVT_BOOKCTRL_PAGE_CHANGING(id, fn) EVT_NOTEBOOK_PAGE_CHANGING(id, fn) #else // dedicated to Smartphones #include "wx/choicebk.h" #define wxBookCtrl wxChoicebook #define wxEVT_BOOKCTRL_PAGE_CHANGED wxEVT_CHOICEBOOK_PAGE_CHANGED #define wxEVT_BOOKCTRL_PAGE_CHANGING wxEVT_CHOICEBOOK_PAGE_CHANGING #define EVT_BOOKCTRL_PAGE_CHANGED(id, fn) EVT_CHOICEBOOK_PAGE_CHANGED(id, fn) #define EVT_BOOKCTRL_PAGE_CHANGING(id, fn) EVT_CHOICEBOOK_PAGE_CHANGING(id, fn) #endif // old wxEVT_COMMAND_* constants #define wxEVT_COMMAND_BOOKCTRL_PAGE_CHANGED wxEVT_BOOKCTRL_PAGE_CHANGED #define wxEVT_COMMAND_BOOKCTRL_PAGE_CHANGING wxEVT_BOOKCTRL_PAGE_CHANGING #endif // wxUSE_BOOKCTRL #endif // _WX_BOOKCTRL_H_
h
rticonnextdds-usecases
data/projects/rticonnextdds-usecases/VehicleTracking/ExampleCode/thirdparty/wxWidgets-3.1.2/Win64/include/wx/toolbar.h
///////////////////////////////////////////////////////////////////////////// // Name: wx/toolbar.h // Purpose: wxToolBar interface declaration // Author: Vadim Zeitlin // Modified by: // Created: 20.11.99 // Copyright: (c) Vadim Zeitlin // Licence: wxWindows licence ///////////////////////////////////////////////////////////////////////////// #ifndef _WX_TOOLBAR_H_BASE_ #define _WX_TOOLBAR_H_BASE_ #include "wx/defs.h" // ---------------------------------------------------------------------------- // wxToolBar style flags // ---------------------------------------------------------------------------- enum { // lay out the toolbar horizontally wxTB_HORIZONTAL = wxHORIZONTAL, // == 0x0004 wxTB_TOP = wxTB_HORIZONTAL, // lay out the toolbar vertically wxTB_VERTICAL = wxVERTICAL, // == 0x0008 wxTB_LEFT = wxTB_VERTICAL, // "flat" buttons (Win32/GTK only) wxTB_FLAT = 0x0020, // dockable toolbar (GTK only) wxTB_DOCKABLE = 0x0040, // don't show the icons (they're shown by default) wxTB_NOICONS = 0x0080, // show the text (not shown by default) wxTB_TEXT = 0x0100, // don't show the divider between toolbar and the window (Win32 only) wxTB_NODIVIDER = 0x0200, // no automatic alignment (Win32 only, useless) wxTB_NOALIGN = 0x0400, // show the text and the icons alongside, not vertically stacked (Win32/GTK) wxTB_HORZ_LAYOUT = 0x0800, wxTB_HORZ_TEXT = wxTB_HORZ_LAYOUT | wxTB_TEXT, // don't show the toolbar short help tooltips wxTB_NO_TOOLTIPS = 0x1000, // lay out toolbar at the bottom of the window wxTB_BOTTOM = 0x2000, // lay out toolbar at the right edge of the window wxTB_RIGHT = 0x4000, wxTB_DEFAULT_STYLE = wxTB_HORIZONTAL }; #if wxUSE_TOOLBAR #include "wx/tbarbase.h" // the base class for all toolbars #if defined(__WXUNIVERSAL__) #include "wx/univ/toolbar.h" #elif defined(__WXMSW__) #include "wx/msw/toolbar.h" #elif defined(__WXMOTIF__) #include "wx/motif/toolbar.h" #elif defined(__WXGTK20__) #include "wx/gtk/toolbar.h" #elif defined(__WXGTK__) #include "wx/gtk1/toolbar.h" #elif defined(__WXMAC__) #include "wx/osx/toolbar.h" #elif defined(__WXQT__) #include "wx/qt/toolbar.h" #endif #endif // wxUSE_TOOLBAR #endif // _WX_TOOLBAR_H_BASE_
h
rticonnextdds-usecases
data/projects/rticonnextdds-usecases/VehicleTracking/ExampleCode/thirdparty/wxWidgets-3.1.2/Win64/include/wx/dynload.h
///////////////////////////////////////////////////////////////////////////// // Name: wx/dynload.h // Purpose: Dynamic loading framework // Author: Ron Lee, David Falkinder, Vadim Zeitlin and a cast of 1000's // (derived in part from dynlib.cpp (c) 1998 Guilhem Lavaux) // Modified by: // Created: 03/12/01 // Copyright: (c) 2001 Ron Lee <[email protected]> // Licence: wxWindows licence ///////////////////////////////////////////////////////////////////////////// #ifndef _WX_DYNAMICLOADER_H__ #define _WX_DYNAMICLOADER_H__ // ---------------------------------------------------------------------------- // headers // ---------------------------------------------------------------------------- #include "wx/defs.h" #if wxUSE_DYNAMIC_LOADER #include "wx/dynlib.h" #include "wx/hashmap.h" #include "wx/module.h" class WXDLLIMPEXP_FWD_BASE wxPluginLibrary; WX_DECLARE_STRING_HASH_MAP_WITH_DECL(wxPluginLibrary *, wxDLManifest, class WXDLLIMPEXP_BASE); typedef wxDLManifest wxDLImports; // --------------------------------------------------------------------------- // wxPluginLibrary // --------------------------------------------------------------------------- // NOTE: Do not attempt to use a base class pointer to this class. // wxDL is not virtual and we deliberately hide some of it's // methods here. // // Unless you know exacty why you need to, you probably shouldn't // instantiate this class directly anyway, use wxPluginManager // instead. class WXDLLIMPEXP_BASE wxPluginLibrary : public wxDynamicLibrary { public: static wxDLImports* ms_classes; // Static hash of all imported classes. wxPluginLibrary( const wxString &libname, int flags = wxDL_DEFAULT ); ~wxPluginLibrary(); wxPluginLibrary *RefLib(); bool UnrefLib(); // These two are called by the PluginSentinel on (PLUGGABLE) object // creation/destruction. There is usually no reason for the user to // call them directly. We have to separate this from the link count, // since the two are not interchangeable. // FIXME: for even better debugging PluginSentinel should register // the name of the class created too, then we can state // exactly which object was not destroyed which may be // difficult to find otherwise. Also this code should // probably only be active in DEBUG mode, but let's just // get it right first. void RefObj() { ++m_objcount; } void UnrefObj() { wxASSERT_MSG( m_objcount > 0, wxT("Too many objects deleted??") ); --m_objcount; } // Override/hide some base class methods bool IsLoaded() const { return m_linkcount > 0; } void Unload() { UnrefLib(); } private: // These pointers may be NULL but if they are not, then m_ourLast follows // m_ourFirst in the linked list, i.e. can be found by calling GetNext() a // sufficient number of times. const wxClassInfo *m_ourFirst; // first class info in this plugin const wxClassInfo *m_ourLast; // ..and the last one size_t m_linkcount; // Ref count of library link calls size_t m_objcount; // ..and (pluggable) object instantiations. wxModuleList m_wxmodules; // any wxModules that we initialised. void UpdateClasses(); // Update ms_classes void RestoreClasses(); // Removes this library from ms_classes void RegisterModules(); // Init any wxModules in the lib. void UnregisterModules(); // Cleanup any wxModules we installed. wxDECLARE_NO_COPY_CLASS(wxPluginLibrary); }; class WXDLLIMPEXP_BASE wxPluginManager { public: // Static accessors. static wxPluginLibrary *LoadLibrary( const wxString &libname, int flags = wxDL_DEFAULT ); static bool UnloadLibrary(const wxString &libname); // Instance methods. wxPluginManager() : m_entry(NULL) {} wxPluginManager(const wxString &libname, int flags = wxDL_DEFAULT) { Load(libname, flags); } ~wxPluginManager() { if ( IsLoaded() ) Unload(); } bool Load(const wxString &libname, int flags = wxDL_DEFAULT); void Unload(); bool IsLoaded() const { return m_entry && m_entry->IsLoaded(); } void *GetSymbol(const wxString &symbol, bool *success = 0) { return m_entry->GetSymbol( symbol, success ); } static void CreateManifest() { ms_manifest = new wxDLManifest(wxKEY_STRING); } static void ClearManifest() { delete ms_manifest; ms_manifest = NULL; } private: // return the pointer to the entry for the library with given name in // ms_manifest or NULL if none static wxPluginLibrary *FindByName(const wxString& name) { const wxDLManifest::iterator i = ms_manifest->find(name); return i == ms_manifest->end() ? NULL : i->second; } static wxDLManifest* ms_manifest; // Static hash of loaded libs. wxPluginLibrary* m_entry; // Cache our entry in the manifest. // We could allow this class to be copied if we really // wanted to, but not without modification. wxDECLARE_NO_COPY_CLASS(wxPluginManager); }; #endif // wxUSE_DYNAMIC_LOADER #endif // _WX_DYNAMICLOADER_H__
h
rticonnextdds-usecases
data/projects/rticonnextdds-usecases/VehicleTracking/ExampleCode/thirdparty/wxWidgets-3.1.2/Win64/include/wx/wxcrt.h
/////////////////////////////////////////////////////////////////////////////// // Name: wx/wxcrt.h // Purpose: Type-safe ANSI and Unicode builds compatible wrappers for // CRT functions // Author: Joel Farley, Ove Kaaven // Modified by: Vadim Zeitlin, Robert Roebling, Ron Lee, Vaclav Slavik // Created: 1998/06/12 // Copyright: (c) 1998-2006 wxWidgets dev team // Licence: wxWindows licence /////////////////////////////////////////////////////////////////////////////// #ifndef _WX_WXCRT_H_ #define _WX_WXCRT_H_ #include "wx/wxcrtbase.h" #include "wx/string.h" #ifndef __WX_SETUP_H__ // For non-configure builds assume vsscanf is available, if not Visual C #if !defined (__VISUALC__) #define HAVE_VSSCANF 1 #endif #endif // ============================================================================ // misc functions // ============================================================================ /* checks whether the passed in pointer is NULL and if the string is empty */ inline bool wxIsEmpty(const char *s) { return !s || !*s; } inline bool wxIsEmpty(const wchar_t *s) { return !s || !*s; } inline bool wxIsEmpty(const wxScopedCharBuffer& s) { return wxIsEmpty(s.data()); } inline bool wxIsEmpty(const wxScopedWCharBuffer& s) { return wxIsEmpty(s.data()); } inline bool wxIsEmpty(const wxString& s) { return s.empty(); } inline bool wxIsEmpty(const wxCStrData& s) { return s.AsString().empty(); } /* multibyte to wide char conversion functions and macros */ /* multibyte<->widechar conversion */ WXDLLIMPEXP_BASE size_t wxMB2WC(wchar_t *buf, const char *psz, size_t n); WXDLLIMPEXP_BASE size_t wxWC2MB(char *buf, const wchar_t *psz, size_t n); #if wxUSE_UNICODE #define wxMB2WX wxMB2WC #define wxWX2MB wxWC2MB #define wxWC2WX wxStrncpy #define wxWX2WC wxStrncpy #else #define wxMB2WX wxStrncpy #define wxWX2MB wxStrncpy #define wxWC2WX wxWC2MB #define wxWX2WC wxMB2WC #endif // RN: We could do the usual tricky compiler detection here, // and use their variant (such as wmemchr, etc.). The problem // is that these functions are quite rare, even though they are // part of the current POSIX standard. In addition, most compilers // (including even MSC) inline them just like we do right in their // headers. // #include <string.h> #if wxUSE_UNICODE //implement our own wmem variants inline wxChar* wxTmemchr(const wxChar* s, wxChar c, size_t l) { for(;l && *s != c;--l, ++s) {} if(l) return const_cast<wxChar*>(s); return NULL; } inline int wxTmemcmp(const wxChar* sz1, const wxChar* sz2, size_t len) { for(; *sz1 == *sz2 && len; --len, ++sz1, ++sz2) {} if(len) return *sz1 < *sz2 ? -1 : *sz1 > *sz2; else return 0; } inline wxChar* wxTmemcpy(wxChar* szOut, const wxChar* szIn, size_t len) { return (wxChar*) memcpy(szOut, szIn, len * sizeof(wxChar)); } inline wxChar* wxTmemmove(wxChar* szOut, const wxChar* szIn, size_t len) { return (wxChar*) memmove(szOut, szIn, len * sizeof(wxChar)); } inline wxChar* wxTmemset(wxChar* szOut, wxChar cIn, size_t len) { wxChar* szRet = szOut; while (len--) *szOut++ = cIn; return szRet; } #endif /* wxUSE_UNICODE */ // provide trivial wrappers for char* versions for both ANSI and Unicode builds // (notice that these intentionally return "char *" and not "void *" unlike the // standard memxxx() for symmetry with the wide char versions): inline char* wxTmemchr(const char* s, char c, size_t len) { return (char*)memchr(s, c, len); } inline int wxTmemcmp(const char* sz1, const char* sz2, size_t len) { return memcmp(sz1, sz2, len); } inline char* wxTmemcpy(char* szOut, const char* szIn, size_t len) { return (char*)memcpy(szOut, szIn, len); } inline char* wxTmemmove(char* szOut, const char* szIn, size_t len) { return (char*)memmove(szOut, szIn, len); } inline char* wxTmemset(char* szOut, char cIn, size_t len) { return (char*)memset(szOut, cIn, len); } // ============================================================================ // wx wrappers for CRT functions in both char* and wchar_t* versions // ============================================================================ // A few notes on implementation of these wrappers: // // We need both char* and wchar_t* versions of functions like wxStrlen() for // compatibility with both ANSI and Unicode builds. // // This makes passing wxString or c_str()/mb_str()/wc_str() result to them // ambiguous, so we need to provide overrides for that as well (in cases where // it makes sense). // // We can do this without problems for some functions (wxStrlen()), but in some // cases, we can't stay compatible with both ANSI and Unicode builds, e.g. for // wxStrcpy(const wxString&), which can only return either char* or wchar_t*. // In these cases, we preserve ANSI build compatibility by returning char*. // ---------------------------------------------------------------------------- // locale functions // ---------------------------------------------------------------------------- // NB: we can't provide const wchar_t* (= wxChar*) overload, because calling // wxSetlocale(category, NULL) -- which is a common thing to do -- would be // ambiguous WXDLLIMPEXP_BASE char* wxSetlocale(int category, const char *locale); inline char* wxSetlocale(int category, const wxScopedCharBuffer& locale) { return wxSetlocale(category, locale.data()); } inline char* wxSetlocale(int category, const wxString& locale) { return wxSetlocale(category, locale.mb_str()); } inline char* wxSetlocale(int category, const wxCStrData& locale) { return wxSetlocale(category, locale.AsCharBuf()); } // ---------------------------------------------------------------------------- // string functions // ---------------------------------------------------------------------------- /* safe version of strlen() (returns 0 if passed NULL pointer) */ // NB: these are defined in wxcrtbase.h, see the comment there // inline size_t wxStrlen(const char *s) { return s ? strlen(s) : 0; } // inline size_t wxStrlen(const wchar_t *s) { return s ? wxCRT_Strlen_(s) : 0; } inline size_t wxStrlen(const wxScopedCharBuffer& s) { return wxStrlen(s.data()); } inline size_t wxStrlen(const wxScopedWCharBuffer& s) { return wxStrlen(s.data()); } inline size_t wxStrlen(const wxString& s) { return s.length(); } inline size_t wxStrlen(const wxCStrData& s) { return s.AsString().length(); } // this is a function new in 2.9 so we don't care about backwards compatibility and // so don't need to support wxScopedCharBuffer/wxScopedWCharBuffer overloads #if defined(wxCRT_StrnlenA) inline size_t wxStrnlen(const char *str, size_t maxlen) { return wxCRT_StrnlenA(str, maxlen); } #else inline size_t wxStrnlen(const char *str, size_t maxlen) { size_t n; for ( n = 0; n < maxlen; n++ ) if ( !str[n] ) break; return n; } #endif #if defined(wxCRT_StrnlenW) inline size_t wxStrnlen(const wchar_t *str, size_t maxlen) { return wxCRT_StrnlenW(str, maxlen); } #else inline size_t wxStrnlen(const wchar_t *str, size_t maxlen) { size_t n; for ( n = 0; n < maxlen; n++ ) if ( !str[n] ) break; return n; } #endif // NB: these are defined in wxcrtbase.h, see the comment there // inline char* wxStrdup(const char *s) { return wxStrdupA(s); } // inline wchar_t* wxStrdup(const wchar_t *s) { return wxStrdupW(s); } inline char* wxStrdup(const wxScopedCharBuffer& s) { return wxStrdup(s.data()); } inline wchar_t* wxStrdup(const wxScopedWCharBuffer& s) { return wxStrdup(s.data()); } inline char* wxStrdup(const wxString& s) { return wxStrdup(s.mb_str()); } inline char* wxStrdup(const wxCStrData& s) { return wxStrdup(s.AsCharBuf()); } inline char *wxStrcpy(char *dest, const char *src) { return wxCRT_StrcpyA(dest, src); } inline wchar_t *wxStrcpy(wchar_t *dest, const wchar_t *src) { return wxCRT_StrcpyW(dest, src); } inline char *wxStrcpy(char *dest, const wxString& src) { return wxCRT_StrcpyA(dest, src.mb_str()); } inline char *wxStrcpy(char *dest, const wxCStrData& src) { return wxCRT_StrcpyA(dest, src.AsCharBuf()); } inline char *wxStrcpy(char *dest, const wxScopedCharBuffer& src) { return wxCRT_StrcpyA(dest, src.data()); } inline wchar_t *wxStrcpy(wchar_t *dest, const wxString& src) { return wxCRT_StrcpyW(dest, src.wc_str()); } inline wchar_t *wxStrcpy(wchar_t *dest, const wxCStrData& src) { return wxCRT_StrcpyW(dest, src.AsWCharBuf()); } inline wchar_t *wxStrcpy(wchar_t *dest, const wxScopedWCharBuffer& src) { return wxCRT_StrcpyW(dest, src.data()); } inline char *wxStrcpy(char *dest, const wchar_t *src) { return wxCRT_StrcpyA(dest, wxConvLibc.cWC2MB(src)); } inline wchar_t *wxStrcpy(wchar_t *dest, const char *src) { return wxCRT_StrcpyW(dest, wxConvLibc.cMB2WC(src)); } inline char *wxStrncpy(char *dest, const char *src, size_t n) { return wxCRT_StrncpyA(dest, src, n); } inline wchar_t *wxStrncpy(wchar_t *dest, const wchar_t *src, size_t n) { return wxCRT_StrncpyW(dest, src, n); } inline char *wxStrncpy(char *dest, const wxString& src, size_t n) { return wxCRT_StrncpyA(dest, src.mb_str(), n); } inline char *wxStrncpy(char *dest, const wxCStrData& src, size_t n) { return wxCRT_StrncpyA(dest, src.AsCharBuf(), n); } inline char *wxStrncpy(char *dest, const wxScopedCharBuffer& src, size_t n) { return wxCRT_StrncpyA(dest, src.data(), n); } inline wchar_t *wxStrncpy(wchar_t *dest, const wxString& src, size_t n) { return wxCRT_StrncpyW(dest, src.wc_str(), n); } inline wchar_t *wxStrncpy(wchar_t *dest, const wxCStrData& src, size_t n) { return wxCRT_StrncpyW(dest, src.AsWCharBuf(), n); } inline wchar_t *wxStrncpy(wchar_t *dest, const wxScopedWCharBuffer& src, size_t n) { return wxCRT_StrncpyW(dest, src.data(), n); } inline char *wxStrncpy(char *dest, const wchar_t *src, size_t n) { return wxCRT_StrncpyA(dest, wxConvLibc.cWC2MB(src), n); } inline wchar_t *wxStrncpy(wchar_t *dest, const char *src, size_t n) { return wxCRT_StrncpyW(dest, wxConvLibc.cMB2WC(src), n); } // this is a function new in 2.9 so we don't care about backwards compatibility and // so don't need to support wchar_t/char overloads inline size_t wxStrlcpy(char *dest, const char *src, size_t n) { const size_t len = wxCRT_StrlenA(src); if ( n ) { if ( n-- > len ) n = len; memcpy(dest, src, n); dest[n] = '\0'; } return len; } inline size_t wxStrlcpy(wchar_t *dest, const wchar_t *src, size_t n) { const size_t len = wxCRT_StrlenW(src); if ( n ) { if ( n-- > len ) n = len; memcpy(dest, src, n * sizeof(wchar_t)); dest[n] = L'\0'; } return len; } inline char *wxStrcat(char *dest, const char *src) { return wxCRT_StrcatA(dest, src); } inline wchar_t *wxStrcat(wchar_t *dest, const wchar_t *src) { return wxCRT_StrcatW(dest, src); } inline char *wxStrcat(char *dest, const wxString& src) { return wxCRT_StrcatA(dest, src.mb_str()); } inline char *wxStrcat(char *dest, const wxCStrData& src) { return wxCRT_StrcatA(dest, src.AsCharBuf()); } inline char *wxStrcat(char *dest, const wxScopedCharBuffer& src) { return wxCRT_StrcatA(dest, src.data()); } inline wchar_t *wxStrcat(wchar_t *dest, const wxString& src) { return wxCRT_StrcatW(dest, src.wc_str()); } inline wchar_t *wxStrcat(wchar_t *dest, const wxCStrData& src) { return wxCRT_StrcatW(dest, src.AsWCharBuf()); } inline wchar_t *wxStrcat(wchar_t *dest, const wxScopedWCharBuffer& src) { return wxCRT_StrcatW(dest, src.data()); } inline char *wxStrcat(char *dest, const wchar_t *src) { return wxCRT_StrcatA(dest, wxConvLibc.cWC2MB(src)); } inline wchar_t *wxStrcat(wchar_t *dest, const char *src) { return wxCRT_StrcatW(dest, wxConvLibc.cMB2WC(src)); } inline char *wxStrncat(char *dest, const char *src, size_t n) { return wxCRT_StrncatA(dest, src, n); } inline wchar_t *wxStrncat(wchar_t *dest, const wchar_t *src, size_t n) { return wxCRT_StrncatW(dest, src, n); } inline char *wxStrncat(char *dest, const wxString& src, size_t n) { return wxCRT_StrncatA(dest, src.mb_str(), n); } inline char *wxStrncat(char *dest, const wxCStrData& src, size_t n) { return wxCRT_StrncatA(dest, src.AsCharBuf(), n); } inline char *wxStrncat(char *dest, const wxScopedCharBuffer& src, size_t n) { return wxCRT_StrncatA(dest, src.data(), n); } inline wchar_t *wxStrncat(wchar_t *dest, const wxString& src, size_t n) { return wxCRT_StrncatW(dest, src.wc_str(), n); } inline wchar_t *wxStrncat(wchar_t *dest, const wxCStrData& src, size_t n) { return wxCRT_StrncatW(dest, src.AsWCharBuf(), n); } inline wchar_t *wxStrncat(wchar_t *dest, const wxScopedWCharBuffer& src, size_t n) { return wxCRT_StrncatW(dest, src.data(), n); } inline char *wxStrncat(char *dest, const wchar_t *src, size_t n) { return wxCRT_StrncatA(dest, wxConvLibc.cWC2MB(src), n); } inline wchar_t *wxStrncat(wchar_t *dest, const char *src, size_t n) { return wxCRT_StrncatW(dest, wxConvLibc.cMB2WC(src), n); } #define WX_STR_DECL(name, T1, T2) name(T1 s1, T2 s2) #define WX_STR_CALL(func, a1, a2) func(a1, a2) // This macro defines string function for all possible variants of arguments, // except for those taking wxString or wxCStrData as second argument. // Parameters: // rettype - return type // name - name of the (overloaded) function to define // crtA - function to call for char* versions (takes two arguments) // crtW - ditto for wchar_t* function // forString - function to call when the *first* argument is wxString; // the second argument can be any string type, so this is // typically a template #define WX_STR_FUNC_NO_INVERT(rettype, name, crtA, crtW, forString) \ inline rettype WX_STR_DECL(name, const char *, const char *) \ { return WX_STR_CALL(crtA, s1, s2); } \ inline rettype WX_STR_DECL(name, const char *, const wchar_t *) \ { return WX_STR_CALL(forString, wxString(s1), wxString(s2)); } \ inline rettype WX_STR_DECL(name, const char *, const wxScopedCharBuffer&) \ { return WX_STR_CALL(crtA, s1, s2.data()); } \ inline rettype WX_STR_DECL(name, const char *, const wxScopedWCharBuffer&) \ { return WX_STR_CALL(forString, wxString(s1), s2.data()); } \ \ inline rettype WX_STR_DECL(name, const wchar_t *, const wchar_t *) \ { return WX_STR_CALL(crtW, s1, s2); } \ inline rettype WX_STR_DECL(name, const wchar_t *, const char *) \ { return WX_STR_CALL(forString, wxString(s1), wxString(s2)); } \ inline rettype WX_STR_DECL(name, const wchar_t *, const wxScopedWCharBuffer&) \ { return WX_STR_CALL(crtW, s1, s2.data()); } \ inline rettype WX_STR_DECL(name, const wchar_t *, const wxScopedCharBuffer&) \ { return WX_STR_CALL(forString, wxString(s1), s2.data()); } \ \ inline rettype WX_STR_DECL(name, const wxScopedCharBuffer&, const char *) \ { return WX_STR_CALL(crtA, s1.data(), s2); } \ inline rettype WX_STR_DECL(name, const wxScopedCharBuffer&, const wchar_t *) \ { return WX_STR_CALL(forString, wxString(s1), wxString(s2)); } \ inline rettype WX_STR_DECL(name, const wxScopedCharBuffer&, const wxScopedCharBuffer&)\ { return WX_STR_CALL(crtA, s1.data(), s2.data()); } \ inline rettype WX_STR_DECL(name, const wxScopedCharBuffer&, const wxScopedWCharBuffer&) \ { return WX_STR_CALL(forString, wxString(s1), wxString(s2)); } \ \ inline rettype WX_STR_DECL(name, const wxScopedWCharBuffer&, const wchar_t *) \ { return WX_STR_CALL(crtW, s1.data(), s2); } \ inline rettype WX_STR_DECL(name, const wxScopedWCharBuffer&, const char *) \ { return WX_STR_CALL(forString, wxString(s1), wxString(s2)); } \ inline rettype WX_STR_DECL(name, const wxScopedWCharBuffer&, const wxScopedWCharBuffer&) \ { return WX_STR_CALL(crtW, s1.data(), s2.data()); } \ inline rettype WX_STR_DECL(name, const wxScopedWCharBuffer&, const wxScopedCharBuffer&) \ { return WX_STR_CALL(forString, wxString(s1), wxString(s2)); } \ \ inline rettype WX_STR_DECL(name, const wxString&, const char*) \ { return WX_STR_CALL(forString, s1, s2); } \ inline rettype WX_STR_DECL(name, const wxString&, const wchar_t*) \ { return WX_STR_CALL(forString, s1, s2); } \ inline rettype WX_STR_DECL(name, const wxString&, const wxScopedCharBuffer&) \ { return WX_STR_CALL(forString, s1, s2); } \ inline rettype WX_STR_DECL(name, const wxString&, const wxScopedWCharBuffer&) \ { return WX_STR_CALL(forString, s1, s2); } \ inline rettype WX_STR_DECL(name, const wxString&, const wxString&) \ { return WX_STR_CALL(forString, s1, s2); } \ inline rettype WX_STR_DECL(name, const wxString&, const wxCStrData&) \ { return WX_STR_CALL(forString, s1, s2); } \ \ inline rettype WX_STR_DECL(name, const wxCStrData&, const char*) \ { return WX_STR_CALL(forString, s1.AsString(), s2); } \ inline rettype WX_STR_DECL(name, const wxCStrData&, const wchar_t*) \ { return WX_STR_CALL(forString, s1.AsString(), s2); } \ inline rettype WX_STR_DECL(name, const wxCStrData&, const wxScopedCharBuffer&) \ { return WX_STR_CALL(forString, s1.AsString(), s2); } \ inline rettype WX_STR_DECL(name, const wxCStrData&, const wxScopedWCharBuffer&) \ { return WX_STR_CALL(forString, s1.AsString(), s2); } \ inline rettype WX_STR_DECL(name, const wxCStrData&, const wxString&) \ { return WX_STR_CALL(forString, s1.AsString(), s2); } \ inline rettype WX_STR_DECL(name, const wxCStrData&, const wxCStrData&) \ { return WX_STR_CALL(forString, s1.AsString(), s2); } // This defines strcmp-like function, i.e. one returning the result of // comparison; see WX_STR_FUNC_NO_INVERT for explanation of the arguments #define WX_STRCMP_FUNC(name, crtA, crtW, forString) \ WX_STR_FUNC_NO_INVERT(int, name, crtA, crtW, forString) \ \ inline int WX_STR_DECL(name, const char *, const wxCStrData&) \ { return -WX_STR_CALL(forString, s2.AsString(), s1); } \ inline int WX_STR_DECL(name, const char *, const wxString&) \ { return -WX_STR_CALL(forString, s2, s1); } \ \ inline int WX_STR_DECL(name, const wchar_t *, const wxCStrData&) \ { return -WX_STR_CALL(forString, s2.AsString(), s1); } \ inline int WX_STR_DECL(name, const wchar_t *, const wxString&) \ { return -WX_STR_CALL(forString, s2, s1); } \ \ inline int WX_STR_DECL(name, const wxScopedCharBuffer&, const wxCStrData&) \ { return -WX_STR_CALL(forString, s2.AsString(), s1.data()); } \ inline int WX_STR_DECL(name, const wxScopedCharBuffer&, const wxString&) \ { return -WX_STR_CALL(forString, s2, s1.data()); } \ \ inline int WX_STR_DECL(name, const wxScopedWCharBuffer&, const wxCStrData&) \ { return -WX_STR_CALL(forString, s2.AsString(), s1.data()); } \ inline int WX_STR_DECL(name, const wxScopedWCharBuffer&, const wxString&) \ { return -WX_STR_CALL(forString, s2, s1.data()); } // This defines a string function that is *not* strcmp-like, i.e. doesn't // return the result of comparison and so if the second argument is a string, // it has to be converted to char* or wchar_t* #define WX_STR_FUNC(rettype, name, crtA, crtW, forString) \ WX_STR_FUNC_NO_INVERT(rettype, name, crtA, crtW, forString) \ \ inline rettype WX_STR_DECL(name, const char *, const wxCStrData&) \ { return WX_STR_CALL(crtA, s1, s2.AsCharBuf()); } \ inline rettype WX_STR_DECL(name, const char *, const wxString&) \ { return WX_STR_CALL(crtA, s1, s2.mb_str()); } \ \ inline rettype WX_STR_DECL(name, const wchar_t *, const wxCStrData&) \ { return WX_STR_CALL(crtW, s1, s2.AsWCharBuf()); } \ inline rettype WX_STR_DECL(name, const wchar_t *, const wxString&) \ { return WX_STR_CALL(crtW, s1, s2.wc_str()); } \ \ inline rettype WX_STR_DECL(name, const wxScopedCharBuffer&, const wxCStrData&) \ { return WX_STR_CALL(crtA, s1.data(), s2.AsCharBuf()); } \ inline rettype WX_STR_DECL(name, const wxScopedCharBuffer&, const wxString&) \ { return WX_STR_CALL(crtA, s1.data(), s2.mb_str()); } \ \ inline rettype WX_STR_DECL(name, const wxScopedWCharBuffer&, const wxCStrData&) \ { return WX_STR_CALL(crtW, s1.data(), s2.AsWCharBuf()); } \ inline rettype WX_STR_DECL(name, const wxScopedWCharBuffer&, const wxString&) \ { return WX_STR_CALL(crtW, s1.data(), s2.wc_str()); } template<typename T> inline int wxStrcmp_String(const wxString& s1, const T& s2) { return s1.compare(s2); } WX_STRCMP_FUNC(wxStrcmp, wxCRT_StrcmpA, wxCRT_StrcmpW, wxStrcmp_String) template<typename T> inline int wxStricmp_String(const wxString& s1, const T& s2) { return s1.CmpNoCase(s2); } WX_STRCMP_FUNC(wxStricmp, wxCRT_StricmpA, wxCRT_StricmpW, wxStricmp_String) #if defined(wxCRT_StrcollA) && defined(wxCRT_StrcollW) // GCC 3.4 and other compilers have a bug that causes it to fail compilation if // the template's implementation uses overloaded function declared later (see // the wxStrcoll() call in wxStrcoll_String<T>()), so we have to // forward-declare the template and implement it below WX_STRCMP_FUNC. OTOH, // this causes problems with GCC visibility in newer GCC versions. #if !(wxCHECK_GCC_VERSION(3,5) && !wxCHECK_GCC_VERSION(4,7)) || defined(__clang__) #define wxNEEDS_DECL_BEFORE_TEMPLATE #endif #ifdef wxNEEDS_DECL_BEFORE_TEMPLATE template<typename T> inline int wxStrcoll_String(const wxString& s1, const T& s2); WX_STRCMP_FUNC(wxStrcoll, wxCRT_StrcollA, wxCRT_StrcollW, wxStrcoll_String) #endif // wxNEEDS_DECL_BEFORE_TEMPLATE template<typename T> inline int wxStrcoll_String(const wxString& s1, const T& s2) { #if wxUSE_UNICODE // NB: strcoll() doesn't work correctly on UTF-8 strings, so we have to use // wc_str() even if wxUSE_UNICODE_UTF8; the (const wchar_t*) cast is // there just as optimization to avoid going through // wxStrcoll<wxScopedWCharBuffer>: return wxStrcoll((const wchar_t*)s1.wc_str(), s2); #else return wxStrcoll((const char*)s1.mb_str(), s2); #endif } #ifndef wxNEEDS_DECL_BEFORE_TEMPLATE // this is exactly the same WX_STRCMP_FUNC line as above, insde the // wxNEEDS_DECL_BEFORE_TEMPLATE case WX_STRCMP_FUNC(wxStrcoll, wxCRT_StrcollA, wxCRT_StrcollW, wxStrcoll_String) #endif #endif // defined(wxCRT_Strcoll[AW]) template<typename T> inline size_t wxStrspn_String(const wxString& s1, const T& s2) { size_t pos = s1.find_first_not_of(s2); return pos == wxString::npos ? s1.length() : pos; } WX_STR_FUNC(size_t, wxStrspn, wxCRT_StrspnA, wxCRT_StrspnW, wxStrspn_String) template<typename T> inline size_t wxStrcspn_String(const wxString& s1, const T& s2) { size_t pos = s1.find_first_of(s2); return pos == wxString::npos ? s1.length() : pos; } WX_STR_FUNC(size_t, wxStrcspn, wxCRT_StrcspnA, wxCRT_StrcspnW, wxStrcspn_String) #undef WX_STR_DECL #undef WX_STR_CALL #define WX_STR_DECL(name, T1, T2) name(T1 s1, T2 s2, size_t n) #define WX_STR_CALL(func, a1, a2) func(a1, a2, n) template<typename T> inline int wxStrncmp_String(const wxString& s1, const T& s2, size_t n) { return s1.compare(0, n, s2, 0, n); } WX_STRCMP_FUNC(wxStrncmp, wxCRT_StrncmpA, wxCRT_StrncmpW, wxStrncmp_String) template<typename T> inline int wxStrnicmp_String(const wxString& s1, const T& s2, size_t n) { return s1.substr(0, n).CmpNoCase(wxString(s2).substr(0, n)); } WX_STRCMP_FUNC(wxStrnicmp, wxCRT_StrnicmpA, wxCRT_StrnicmpW, wxStrnicmp_String) #undef WX_STR_DECL #undef WX_STR_CALL #undef WX_STRCMP_FUNC #undef WX_STR_FUNC #undef WX_STR_FUNC_NO_INVERT #if defined(wxCRT_StrxfrmA) && defined(wxCRT_StrxfrmW) inline size_t wxStrxfrm(char *dest, const char *src, size_t n) { return wxCRT_StrxfrmA(dest, src, n); } inline size_t wxStrxfrm(wchar_t *dest, const wchar_t *src, size_t n) { return wxCRT_StrxfrmW(dest, src, n); } template<typename T> inline size_t wxStrxfrm(T *dest, const wxScopedCharTypeBuffer<T>& src, size_t n) { return wxStrxfrm(dest, src.data(), n); } inline size_t wxStrxfrm(char *dest, const wxString& src, size_t n) { return wxCRT_StrxfrmA(dest, src.mb_str(), n); } inline size_t wxStrxfrm(wchar_t *dest, const wxString& src, size_t n) { return wxCRT_StrxfrmW(dest, src.wc_str(), n); } inline size_t wxStrxfrm(char *dest, const wxCStrData& src, size_t n) { return wxCRT_StrxfrmA(dest, src.AsCharBuf(), n); } inline size_t wxStrxfrm(wchar_t *dest, const wxCStrData& src, size_t n) { return wxCRT_StrxfrmW(dest, src.AsWCharBuf(), n); } #endif // defined(wxCRT_Strxfrm[AW]) inline char *wxStrtok(char *str, const char *delim, char **saveptr) { return wxCRT_StrtokA(str, delim, saveptr); } inline wchar_t *wxStrtok(wchar_t *str, const wchar_t *delim, wchar_t **saveptr) { return wxCRT_StrtokW(str, delim, saveptr); } template<typename T> inline T *wxStrtok(T *str, const wxScopedCharTypeBuffer<T>& delim, T **saveptr) { return wxStrtok(str, delim.data(), saveptr); } inline char *wxStrtok(char *str, const wxCStrData& delim, char **saveptr) { return wxCRT_StrtokA(str, delim.AsCharBuf(), saveptr); } inline wchar_t *wxStrtok(wchar_t *str, const wxCStrData& delim, wchar_t **saveptr) { return wxCRT_StrtokW(str, delim.AsWCharBuf(), saveptr); } inline char *wxStrtok(char *str, const wxString& delim, char **saveptr) { return wxCRT_StrtokA(str, delim.mb_str(), saveptr); } inline wchar_t *wxStrtok(wchar_t *str, const wxString& delim, wchar_t **saveptr) { return wxCRT_StrtokW(str, delim.wc_str(), saveptr); } inline const char *wxStrstr(const char *haystack, const char *needle) { return wxCRT_StrstrA(haystack, needle); } inline const wchar_t *wxStrstr(const wchar_t *haystack, const wchar_t *needle) { return wxCRT_StrstrW(haystack, needle); } inline const char *wxStrstr(const char *haystack, const wxString& needle) { return wxCRT_StrstrA(haystack, needle.mb_str()); } inline const wchar_t *wxStrstr(const wchar_t *haystack, const wxString& needle) { return wxCRT_StrstrW(haystack, needle.wc_str()); } // these functions return char* pointer into the non-temporary conversion buffer // used by c_str()'s implicit conversion to char*, for ANSI build compatibility inline const char *wxStrstr(const wxString& haystack, const wxString& needle) { return wxCRT_StrstrA(haystack.c_str(), needle.mb_str()); } inline const char *wxStrstr(const wxCStrData& haystack, const wxString& needle) { return wxCRT_StrstrA(haystack, needle.mb_str()); } inline const char *wxStrstr(const wxCStrData& haystack, const wxCStrData& needle) { return wxCRT_StrstrA(haystack, needle.AsCharBuf()); } // if 'needle' is char/wchar_t, then the same is probably wanted as return value inline const char *wxStrstr(const wxString& haystack, const char *needle) { return wxCRT_StrstrA(haystack.c_str(), needle); } inline const char *wxStrstr(const wxCStrData& haystack, const char *needle) { return wxCRT_StrstrA(haystack, needle); } inline const wchar_t *wxStrstr(const wxString& haystack, const wchar_t *needle) { return wxCRT_StrstrW(haystack.c_str(), needle); } inline const wchar_t *wxStrstr(const wxCStrData& haystack, const wchar_t *needle) { return wxCRT_StrstrW(haystack, needle); } inline const char *wxStrchr(const char *s, char c) { return wxCRT_StrchrA(s, c); } inline const wchar_t *wxStrchr(const wchar_t *s, wchar_t c) { return wxCRT_StrchrW(s, c); } inline const char *wxStrrchr(const char *s, char c) { return wxCRT_StrrchrA(s, c); } inline const wchar_t *wxStrrchr(const wchar_t *s, wchar_t c) { return wxCRT_StrrchrW(s, c); } inline const char *wxStrchr(const char *s, const wxUniChar& uc) { char c; return uc.GetAsChar(&c) ? wxCRT_StrchrA(s, c) : NULL; } inline const wchar_t *wxStrchr(const wchar_t *s, const wxUniChar& c) { return wxCRT_StrchrW(s, (wchar_t)c); } inline const char *wxStrrchr(const char *s, const wxUniChar& uc) { char c; return uc.GetAsChar(&c) ? wxCRT_StrrchrA(s, c) : NULL; } inline const wchar_t *wxStrrchr(const wchar_t *s, const wxUniChar& c) { return wxCRT_StrrchrW(s, (wchar_t)c); } inline const char *wxStrchr(const char *s, const wxUniCharRef& uc) { char c; return uc.GetAsChar(&c) ? wxCRT_StrchrA(s, c) : NULL; } inline const wchar_t *wxStrchr(const wchar_t *s, const wxUniCharRef& c) { return wxCRT_StrchrW(s, (wchar_t)c); } inline const char *wxStrrchr(const char *s, const wxUniCharRef& uc) { char c; return uc.GetAsChar(&c) ? wxCRT_StrrchrA(s, c) : NULL; } inline const wchar_t *wxStrrchr(const wchar_t *s, const wxUniCharRef& c) { return wxCRT_StrrchrW(s, (wchar_t)c); } template<typename T> inline const T* wxStrchr(const wxScopedCharTypeBuffer<T>& s, T c) { return wxStrchr(s.data(), c); } template<typename T> inline const T* wxStrrchr(const wxScopedCharTypeBuffer<T>& s, T c) { return wxStrrchr(s.data(), c); } template<typename T> inline const T* wxStrchr(const wxScopedCharTypeBuffer<T>& s, const wxUniChar& c) { return wxStrchr(s.data(), (T)c); } template<typename T> inline const T* wxStrrchr(const wxScopedCharTypeBuffer<T>& s, const wxUniChar& c) { return wxStrrchr(s.data(), (T)c); } template<typename T> inline const T* wxStrchr(const wxScopedCharTypeBuffer<T>& s, const wxUniCharRef& c) { return wxStrchr(s.data(), (T)c); } template<typename T> inline const T* wxStrrchr(const wxScopedCharTypeBuffer<T>& s, const wxUniCharRef& c) { return wxStrrchr(s.data(), (T)c); } // these functions return char* pointer into the non-temporary conversion buffer // used by c_str()'s implicit conversion to char*, for ANSI build compatibility inline const char* wxStrchr(const wxString& s, char c) { return wxCRT_StrchrA((const char*)s.c_str(), c); } inline const char* wxStrrchr(const wxString& s, char c) { return wxCRT_StrrchrA((const char*)s.c_str(), c); } inline const char* wxStrchr(const wxString& s, int c) { return wxCRT_StrchrA((const char*)s.c_str(), c); } inline const char* wxStrrchr(const wxString& s, int c) { return wxCRT_StrrchrA((const char*)s.c_str(), c); } inline const char* wxStrchr(const wxString& s, const wxUniChar& uc) { char c; return uc.GetAsChar(&c) ? wxCRT_StrchrA(s.c_str(), c) : NULL; } inline const char* wxStrrchr(const wxString& s, const wxUniChar& uc) { char c; return uc.GetAsChar(&c) ? wxCRT_StrrchrA(s.c_str(), c) : NULL; } inline const char* wxStrchr(const wxString& s, const wxUniCharRef& uc) { char c; return uc.GetAsChar(&c) ? wxCRT_StrchrA(s.c_str(), c) : NULL; } inline const char* wxStrrchr(const wxString& s, const wxUniCharRef& uc) { char c; return uc.GetAsChar(&c) ? wxCRT_StrrchrA(s.c_str(), c) : NULL; } inline const wchar_t* wxStrchr(const wxString& s, wchar_t c) { return wxCRT_StrchrW((const wchar_t*)s.c_str(), c); } inline const wchar_t* wxStrrchr(const wxString& s, wchar_t c) { return wxCRT_StrrchrW((const wchar_t*)s.c_str(), c); } inline const char* wxStrchr(const wxCStrData& s, char c) { return wxCRT_StrchrA(s.AsChar(), c); } inline const char* wxStrrchr(const wxCStrData& s, char c) { return wxCRT_StrrchrA(s.AsChar(), c); } inline const char* wxStrchr(const wxCStrData& s, int c) { return wxCRT_StrchrA(s.AsChar(), c); } inline const char* wxStrrchr(const wxCStrData& s, int c) { return wxCRT_StrrchrA(s.AsChar(), c); } inline const char* wxStrchr(const wxCStrData& s, const wxUniChar& uc) { char c; return uc.GetAsChar(&c) ? wxCRT_StrchrA(s, c) : NULL; } inline const char* wxStrrchr(const wxCStrData& s, const wxUniChar& uc) { char c; return uc.GetAsChar(&c) ? wxCRT_StrrchrA(s, c) : NULL; } inline const char* wxStrchr(const wxCStrData& s, const wxUniCharRef& uc) { char c; return uc.GetAsChar(&c) ? wxCRT_StrchrA(s, c) : NULL; } inline const char* wxStrrchr(const wxCStrData& s, const wxUniCharRef& uc) { char c; return uc.GetAsChar(&c) ? wxCRT_StrrchrA(s, c) : NULL; } inline const wchar_t* wxStrchr(const wxCStrData& s, wchar_t c) { return wxCRT_StrchrW(s.AsWChar(), c); } inline const wchar_t* wxStrrchr(const wxCStrData& s, wchar_t c) { return wxCRT_StrrchrW(s.AsWChar(), c); } inline const char *wxStrpbrk(const char *s, const char *accept) { return wxCRT_StrpbrkA(s, accept); } inline const wchar_t *wxStrpbrk(const wchar_t *s, const wchar_t *accept) { return wxCRT_StrpbrkW(s, accept); } inline const char *wxStrpbrk(const char *s, const wxString& accept) { return wxCRT_StrpbrkA(s, accept.mb_str()); } inline const char *wxStrpbrk(const char *s, const wxCStrData& accept) { return wxCRT_StrpbrkA(s, accept.AsCharBuf()); } inline const wchar_t *wxStrpbrk(const wchar_t *s, const wxString& accept) { return wxCRT_StrpbrkW(s, accept.wc_str()); } inline const wchar_t *wxStrpbrk(const wchar_t *s, const wxCStrData& accept) { return wxCRT_StrpbrkW(s, accept.AsWCharBuf()); } inline const char *wxStrpbrk(const wxString& s, const wxString& accept) { return wxCRT_StrpbrkA(s.c_str(), accept.mb_str()); } inline const char *wxStrpbrk(const wxString& s, const char *accept) { return wxCRT_StrpbrkA(s.c_str(), accept); } inline const wchar_t *wxStrpbrk(const wxString& s, const wchar_t *accept) { return wxCRT_StrpbrkW(s.wc_str(), accept); } inline const char *wxStrpbrk(const wxString& s, const wxCStrData& accept) { return wxCRT_StrpbrkA(s.c_str(), accept.AsCharBuf()); } inline const char *wxStrpbrk(const wxCStrData& s, const wxString& accept) { return wxCRT_StrpbrkA(s.AsChar(), accept.mb_str()); } inline const char *wxStrpbrk(const wxCStrData& s, const char *accept) { return wxCRT_StrpbrkA(s.AsChar(), accept); } inline const wchar_t *wxStrpbrk(const wxCStrData& s, const wchar_t *accept) { return wxCRT_StrpbrkW(s.AsWChar(), accept); } inline const char *wxStrpbrk(const wxCStrData& s, const wxCStrData& accept) { return wxCRT_StrpbrkA(s.AsChar(), accept.AsCharBuf()); } template <typename S, typename T> inline const T *wxStrpbrk(const S& s, const wxScopedCharTypeBuffer<T>& accept) { return wxStrpbrk(s, accept.data()); } /* inlined non-const versions */ template <typename T> inline char *wxStrstr(char *haystack, T needle) { return const_cast<char*>(wxStrstr(const_cast<const char*>(haystack), needle)); } template <typename T> inline wchar_t *wxStrstr(wchar_t *haystack, T needle) { return const_cast<wchar_t*>(wxStrstr(const_cast<const wchar_t*>(haystack), needle)); } template <typename T> inline char * wxStrchr(char *s, T c) { return const_cast<char*>(wxStrchr(const_cast<const char*>(s), c)); } template <typename T> inline wchar_t * wxStrchr(wchar_t *s, T c) { return (wchar_t *)wxStrchr((const wchar_t *)s, c); } template <typename T> inline char * wxStrrchr(char *s, T c) { return const_cast<char*>(wxStrrchr(const_cast<const char*>(s), c)); } template <typename T> inline wchar_t * wxStrrchr(wchar_t *s, T c) { return const_cast<wchar_t*>(wxStrrchr(const_cast<const wchar_t*>(s), c)); } template <typename T> inline char * wxStrpbrk(char *s, T accept) { return const_cast<char*>(wxStrpbrk(const_cast<const char*>(s), accept)); } template <typename T> inline wchar_t * wxStrpbrk(wchar_t *s, T accept) { return const_cast<wchar_t*>(wxStrpbrk(const_cast<const wchar_t*>(s), accept)); } // ---------------------------------------------------------------------------- // stdio.h functions // ---------------------------------------------------------------------------- // NB: using fn_str() for mode is a hack to get the same type (char*/wchar_t*) // as needed, the conversion itself doesn't matter, it's ASCII inline FILE *wxFopen(const wxString& path, const wxString& mode) { return wxCRT_Fopen(path.fn_str(), mode.fn_str()); } inline FILE *wxFreopen(const wxString& path, const wxString& mode, FILE *stream) { return wxCRT_Freopen(path.fn_str(), mode.fn_str(), stream); } inline int wxRemove(const wxString& path) { return wxCRT_Remove(path.fn_str()); } inline int wxRename(const wxString& oldpath, const wxString& newpath) { return wxCRT_Rename(oldpath.fn_str(), newpath.fn_str()); } extern WXDLLIMPEXP_BASE int wxPuts(const wxString& s); extern WXDLLIMPEXP_BASE int wxFputs(const wxString& s, FILE *stream); extern WXDLLIMPEXP_BASE void wxPerror(const wxString& s); extern WXDLLIMPEXP_BASE int wxFputc(const wxUniChar& c, FILE *stream); #define wxPutc(c, stream) wxFputc(c, stream) #define wxPutchar(c) wxFputc(c, stdout) #define wxFputchar(c) wxPutchar(c) // NB: We only provide ANSI version of fgets() because fgetws() interprets the // stream according to current locale, which is rarely what is desired. inline char *wxFgets(char *s, int size, FILE *stream) { return wxCRT_FgetsA(s, size, stream); } // This version calls ANSI version and converts the string using wxConvLibc extern WXDLLIMPEXP_BASE wchar_t *wxFgets(wchar_t *s, int size, FILE *stream); #define wxGets(s) wxGets_is_insecure_and_dangerous_use_wxFgets_instead // NB: We only provide ANSI versions of this for the same reasons as in the // case of wxFgets() above inline int wxFgetc(FILE *stream) { return wxCRT_FgetcA(stream); } inline int wxUngetc(int c, FILE *stream) { return wxCRT_UngetcA(c, stream); } #define wxGetc(stream) wxFgetc(stream) #define wxGetchar() wxFgetc(stdin) #define wxFgetchar() wxGetchar() // ---------------------------------------------------------------------------- // stdlib.h functions // ---------------------------------------------------------------------------- #ifdef wxCRT_AtoiW inline int wxAtoi(const wxString& str) { return wxCRT_AtoiW(str.wc_str()); } #else inline int wxAtoi(const wxString& str) { return wxCRT_AtoiA(str.mb_str()); } #endif #ifdef wxCRT_AtolW inline long wxAtol(const wxString& str) { return wxCRT_AtolW(str.wc_str()); } #else inline long wxAtol(const wxString& str) { return wxCRT_AtolA(str.mb_str()); } #endif #ifdef wxCRT_AtofW inline double wxAtof(const wxString& str) { return wxCRT_AtofW(str.wc_str()); } #else inline double wxAtof(const wxString& str) { return wxCRT_AtofA(str.mb_str()); } #endif inline double wxStrtod(const char *nptr, char **endptr) { return wxCRT_StrtodA(nptr, endptr); } inline double wxStrtod(const wchar_t *nptr, wchar_t **endptr) { return wxCRT_StrtodW(nptr, endptr); } template<typename T> inline double wxStrtod(const wxScopedCharTypeBuffer<T>& nptr, T **endptr) { return wxStrtod(nptr.data(), endptr); } // We implement wxStrto*() like this so that the code compiles when NULL is // passed in - - if we had just char** and wchar_t** overloads for 'endptr', it // would be ambiguous. The solution is to use a template so that endptr can be // any type: when NULL constant is used, the type will be int and we can handle // that case specially. Otherwise, we infer the type that 'nptr' should be // converted to from the type of 'endptr'. We need wxStrtoxCharType<T> template // to make the code compile even for T=int (that's the case when it's not going // to be ever used, but it still has to compile). template<typename T> struct wxStrtoxCharType {}; template<> struct wxStrtoxCharType<char**> { typedef const char* Type; static char** AsPointer(char **p) { return p; } }; template<> struct wxStrtoxCharType<wchar_t**> { typedef const wchar_t* Type; static wchar_t** AsPointer(wchar_t **p) { return p; } }; template<> struct wxStrtoxCharType<int> { typedef const char* Type; /* this one is never used */ static char** AsPointer(int WXUNUSED_UNLESS_DEBUG(p)) { wxASSERT_MSG( p == 0, "passing non-NULL int is invalid" ); return NULL; } }; template<typename T> inline double wxStrtod(const wxString& nptr, T endptr) { if ( endptr == 0 ) { // when we don't care about endptr, use the string representation that // doesn't require any conversion (it doesn't matter for this function // even if its UTF-8): return wxStrtod(nptr.wx_str(), (wxStringCharType**)NULL); } else { // note that it is important to use c_str() here and not mb_str() or // wc_str(), because we store the pointer into (possibly converted) // buffer in endptr and so it must be valid even when wxStrtod() returns typedef typename wxStrtoxCharType<T>::Type CharType; return wxStrtod((CharType)nptr.c_str(), wxStrtoxCharType<T>::AsPointer(endptr)); } } template<typename T> inline double wxStrtod(const wxCStrData& nptr, T endptr) { return wxStrtod(nptr.AsString(), endptr); } #define WX_STRTOX_FUNC(rettype, name, implA, implW) \ /* see wxStrtod() above for explanation of this code: */ \ inline rettype name(const char *nptr, char **endptr, int base) \ { return implA(nptr, endptr, base); } \ inline rettype name(const wchar_t *nptr, wchar_t **endptr, int base) \ { return implW(nptr, endptr, base); } \ template<typename T> \ inline rettype name(const wxScopedCharTypeBuffer<T>& nptr, T **endptr, int)\ { return name(nptr.data(), endptr); } \ template<typename T> \ inline rettype name(const wxString& nptr, T endptr, int base) \ { \ if ( endptr == 0 ) \ return name(nptr.wx_str(), (wxStringCharType**)NULL, base); \ else \ { \ typedef typename wxStrtoxCharType<T>::Type CharType; \ return name((CharType)nptr.c_str(), \ wxStrtoxCharType<T>::AsPointer(endptr), \ base); \ } \ } \ template<typename T> \ inline rettype name(const wxCStrData& nptr, T endptr, int base) \ { return name(nptr.AsString(), endptr, base); } WX_STRTOX_FUNC(long, wxStrtol, wxCRT_StrtolA, wxCRT_StrtolW) WX_STRTOX_FUNC(unsigned long, wxStrtoul, wxCRT_StrtoulA, wxCRT_StrtoulW) #ifdef wxLongLong_t WX_STRTOX_FUNC(wxLongLong_t, wxStrtoll, wxCRT_StrtollA, wxCRT_StrtollW) WX_STRTOX_FUNC(wxULongLong_t, wxStrtoull, wxCRT_StrtoullA, wxCRT_StrtoullW) #endif // wxLongLong_t #undef WX_STRTOX_FUNC // ios doesn't export system starting from iOS 11 anymore and usage was critical before #if defined(__WXOSX__) && wxOSX_USE_IPHONE #else // mingw32 doesn't provide _tsystem() even though it provides other stdlib.h // functions in their wide versions #ifdef wxCRT_SystemW inline int wxSystem(const wxString& str) { return wxCRT_SystemW(str.wc_str()); } #else inline int wxSystem(const wxString& str) { return wxCRT_SystemA(str.mb_str()); } #endif #endif inline char* wxGetenv(const char *name) { return wxCRT_GetenvA(name); } inline wchar_t* wxGetenv(const wchar_t *name) { return wxCRT_GetenvW(name); } inline char* wxGetenv(const wxString& name) { return wxCRT_GetenvA(name.mb_str()); } inline char* wxGetenv(const wxCStrData& name) { return wxCRT_GetenvA(name.AsCharBuf()); } inline char* wxGetenv(const wxScopedCharBuffer& name) { return wxCRT_GetenvA(name.data()); } inline wchar_t* wxGetenv(const wxScopedWCharBuffer& name) { return wxCRT_GetenvW(name.data()); } // ---------------------------------------------------------------------------- // time.h functions // ---------------------------------------------------------------------------- inline size_t wxStrftime(char *s, size_t max, const wxString& format, const struct tm *tm) { return wxCRT_StrftimeA(s, max, format.mb_str(), tm); } inline size_t wxStrftime(wchar_t *s, size_t max, const wxString& format, const struct tm *tm) { return wxCRT_StrftimeW(s, max, format.wc_str(), tm); } // NB: we can't provide both char* and wchar_t* versions for obvious reasons // and returning wxString wouldn't work either (it would be immediately // destroyed and if assigned to char*/wchar_t*, the pointer would be // invalid), so we only keep ASCII version, because the returned value // is always ASCII anyway #define wxAsctime asctime #define wxCtime ctime // ---------------------------------------------------------------------------- // ctype.h functions // ---------------------------------------------------------------------------- // FIXME-UTF8: we'd be better off implementing these ourselves, as the CRT // version is locale-dependent // FIXME-UTF8: these don't work when EOF is passed in because of wxUniChar, // is this OK or not? inline bool wxIsalnum(const wxUniChar& c) { return wxCRT_IsalnumW(c) != 0; } inline bool wxIsalpha(const wxUniChar& c) { return wxCRT_IsalphaW(c) != 0; } inline bool wxIscntrl(const wxUniChar& c) { return wxCRT_IscntrlW(c) != 0; } inline bool wxIsdigit(const wxUniChar& c) { return wxCRT_IsdigitW(c) != 0; } inline bool wxIsgraph(const wxUniChar& c) { return wxCRT_IsgraphW(c) != 0; } inline bool wxIslower(const wxUniChar& c) { return wxCRT_IslowerW(c) != 0; } inline bool wxIsprint(const wxUniChar& c) { return wxCRT_IsprintW(c) != 0; } inline bool wxIspunct(const wxUniChar& c) { return wxCRT_IspunctW(c) != 0; } inline bool wxIsspace(const wxUniChar& c) { return wxCRT_IsspaceW(c) != 0; } inline bool wxIsupper(const wxUniChar& c) { return wxCRT_IsupperW(c) != 0; } inline bool wxIsxdigit(const wxUniChar& c) { return wxCRT_IsxdigitW(c) != 0; } inline wxUniChar wxTolower(const wxUniChar& c) { return wxCRT_TolowerW(c); } inline wxUniChar wxToupper(const wxUniChar& c) { return wxCRT_ToupperW(c); } #if WXWIN_COMPATIBILITY_2_8 // we had goofed and defined wxIsctrl() instead of (correct) wxIscntrl() in the // initial versions of this header -- now it is too late to remove it so // although we fixed the function/macro name above, still provide the // backwards-compatible synonym. wxDEPRECATED( inline int wxIsctrl(const wxUniChar& c) ); inline int wxIsctrl(const wxUniChar& c) { return wxIscntrl(c); } #endif // WXWIN_COMPATIBILITY_2_8 inline bool wxIsascii(const wxUniChar& c) { return c.IsAscii(); } #endif /* _WX_WXCRT_H_ */
h
rticonnextdds-usecases
data/projects/rticonnextdds-usecases/VehicleTracking/ExampleCode/thirdparty/wxWidgets-3.1.2/Win64/include/wx/gauge.h
/////////////////////////////////////////////////////////////////////////////// // Name: wx/gauge.h // Purpose: wxGauge interface // Author: Vadim Zeitlin // Modified by: // Created: 20.02.01 // Copyright: (c) 1996-2001 wxWidgets team // Licence: wxWindows licence /////////////////////////////////////////////////////////////////////////////// #ifndef _WX_GAUGE_H_BASE_ #define _WX_GAUGE_H_BASE_ #include "wx/defs.h" #if wxUSE_GAUGE #include "wx/control.h" // ---------------------------------------------------------------------------- // wxGauge style flags // ---------------------------------------------------------------------------- #define wxGA_HORIZONTAL wxHORIZONTAL #define wxGA_VERTICAL wxVERTICAL // Available since Windows 7 only. With this style, the value of guage will // reflect on the taskbar button. #define wxGA_PROGRESS 0x0010 // Win32 only, is default (and only) on some other platforms #define wxGA_SMOOTH 0x0020 // QT only, display current completed percentage (text default format "%p%") #define wxGA_TEXT 0x0040 // GTK and Mac always have native implementation of the indeterminate mode // wxMSW has native implementation only if comctl32.dll >= 6.00 #if !defined(__WXGTK20__) && !defined(__WXMAC__) #define wxGAUGE_EMULATE_INDETERMINATE_MODE 1 #else #define wxGAUGE_EMULATE_INDETERMINATE_MODE 0 #endif extern WXDLLIMPEXP_DATA_CORE(const char) wxGaugeNameStr[]; class WXDLLIMPEXP_FWD_CORE wxAppProgressIndicator; // ---------------------------------------------------------------------------- // wxGauge: a progress bar // ---------------------------------------------------------------------------- class WXDLLIMPEXP_CORE wxGaugeBase : public wxControl { public: wxGaugeBase() : m_rangeMax(0), m_gaugePos(0), m_appProgressIndicator(NULL) { } virtual ~wxGaugeBase(); bool Create(wxWindow *parent, wxWindowID id, int range, const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxDefaultSize, long style = wxGA_HORIZONTAL, const wxValidator& validator = wxDefaultValidator, const wxString& name = wxGaugeNameStr); // determinate mode API // set/get the control range virtual void SetRange(int range); virtual int GetRange() const; virtual void SetValue(int pos); virtual int GetValue() const; // indeterminate mode API virtual void Pulse(); // simple accessors bool IsVertical() const { return HasFlag(wxGA_VERTICAL); } // overridden base class virtuals virtual bool AcceptsFocus() const wxOVERRIDE { return false; } // Deprecated methods not doing anything since a long time. wxDEPRECATED_MSG("Remove calls to this method, it doesn't do anything") void SetShadowWidth(int WXUNUSED(w)) { } wxDEPRECATED_MSG("Remove calls to this method, it always returns 0") int GetShadowWidth() const { return 0; } wxDEPRECATED_MSG("Remove calls to this method, it doesn't do anything") void SetBezelFace(int WXUNUSED(w)) { } wxDEPRECATED_MSG("Remove calls to this method, it always returns 0") int GetBezelFace() const { return 0; } protected: virtual wxBorder GetDefaultBorder() const wxOVERRIDE { return wxBORDER_NONE; } // Initialize m_appProgressIndicator if necessary, i.e. if this object has // wxGA_PROGRESS style. This method is supposed to be called from the // derived class Create() if it doesn't call the base class Create(), which // already does it, after initializing the window style and range. void InitProgressIndicatorIfNeeded(); // the max position int m_rangeMax; // the current position int m_gaugePos; #if wxGAUGE_EMULATE_INDETERMINATE_MODE int m_nDirection; // can be wxRIGHT or wxLEFT #endif wxAppProgressIndicator *m_appProgressIndicator; wxDECLARE_NO_COPY_CLASS(wxGaugeBase); }; #if defined(__WXUNIVERSAL__) #include "wx/univ/gauge.h" #elif defined(__WXMSW__) #include "wx/msw/gauge.h" #elif defined(__WXMOTIF__) #include "wx/motif/gauge.h" #elif defined(__WXGTK20__) #include "wx/gtk/gauge.h" #elif defined(__WXGTK__) #include "wx/gtk1/gauge.h" #elif defined(__WXMAC__) #include "wx/osx/gauge.h" #elif defined(__WXQT__) #include "wx/qt/gauge.h" #endif #endif // wxUSE_GAUGE #endif // _WX_GAUGE_H_BASE_
h
rticonnextdds-usecases
data/projects/rticonnextdds-usecases/VehicleTracking/ExampleCode/thirdparty/wxWidgets-3.1.2/Win64/include/wx/spinctrl.h
///////////////////////////////////////////////////////////////////////////// // Name: wx/spinctrl.h // Purpose: wxSpinCtrlBase class // Author: Vadim Zeitlin // Modified by: // Created: 22.07.99 // Copyright: (c) Vadim Zeitlin // Licence: wxWindows licence ///////////////////////////////////////////////////////////////////////////// #ifndef _WX_SPINCTRL_H_ #define _WX_SPINCTRL_H_ #include "wx/defs.h" #if wxUSE_SPINCTRL #include "wx/spinbutt.h" // should make wxSpinEvent visible to the app // Events class WXDLLIMPEXP_FWD_CORE wxSpinDoubleEvent; wxDECLARE_EXPORTED_EVENT(WXDLLIMPEXP_CORE, wxEVT_SPINCTRL, wxSpinEvent); wxDECLARE_EXPORTED_EVENT(WXDLLIMPEXP_CORE, wxEVT_SPINCTRLDOUBLE, wxSpinDoubleEvent); // ---------------------------------------------------------------------------- // A spin ctrl is a text control with a spin button which is usually used to // prompt the user for a numeric input. // There are two kinds for number types T=integer or T=double. // ---------------------------------------------------------------------------- class WXDLLIMPEXP_CORE wxSpinCtrlBase : public wxControl { public: wxSpinCtrlBase() {} // accessor functions that derived classes are expected to have // T GetValue() const // T GetMin() const // T GetMax() const // T GetIncrement() const virtual bool GetSnapToTicks() const = 0; // unsigned GetDigits() const - wxSpinCtrlDouble only // operation functions that derived classes are expected to have virtual void SetValue(const wxString& value) = 0; // void SetValue(T val) // void SetRange(T minVal, T maxVal) // void SetIncrement(T inc) virtual void SetSnapToTicks(bool snap_to_ticks) = 0; // void SetDigits(unsigned digits) - wxSpinCtrlDouble only // The base for numbers display, e.g. 10 or 16. virtual int GetBase() const = 0; virtual bool SetBase(int base) = 0; // Select text in the textctrl virtual void SetSelection(long from, long to) = 0; private: wxDECLARE_NO_COPY_CLASS(wxSpinCtrlBase); }; // ---------------------------------------------------------------------------- // wxSpinDoubleEvent - a wxSpinEvent for double valued controls // ---------------------------------------------------------------------------- class WXDLLIMPEXP_CORE wxSpinDoubleEvent : public wxNotifyEvent { public: wxSpinDoubleEvent(wxEventType commandType = wxEVT_NULL, int winid = 0, double value = 0) : wxNotifyEvent(commandType, winid), m_value(value) { } wxSpinDoubleEvent(const wxSpinDoubleEvent& event) : wxNotifyEvent(event), m_value(event.GetValue()) { } double GetValue() const { return m_value; } void SetValue(double value) { m_value = value; } virtual wxEvent *Clone() const wxOVERRIDE { return new wxSpinDoubleEvent(*this); } protected: double m_value; private: wxDECLARE_DYNAMIC_CLASS_NO_ASSIGN(wxSpinDoubleEvent); }; // ---------------------------------------------------------------------------- // wxSpinDoubleEvent event type, see also wxSpinEvent in wx/spinbutt.h // ---------------------------------------------------------------------------- typedef void (wxEvtHandler::*wxSpinDoubleEventFunction)(wxSpinDoubleEvent&); #define wxSpinDoubleEventHandler(func) \ wxEVENT_HANDLER_CAST(wxSpinDoubleEventFunction, func) // macros for handling spinctrl events #define EVT_SPINCTRL(id, fn) \ wx__DECLARE_EVT1(wxEVT_SPINCTRL, id, wxSpinEventHandler(fn)) #define EVT_SPINCTRLDOUBLE(id, fn) \ wx__DECLARE_EVT1(wxEVT_SPINCTRLDOUBLE, id, wxSpinDoubleEventHandler(fn)) // ---------------------------------------------------------------------------- // include the platform-dependent class implementation // ---------------------------------------------------------------------------- // we may have a native wxSpinCtrl implementation, native wxSpinCtrl and // wxSpinCtrlDouble implementations or neither, define the appropriate symbols // and include the generic version if necessary to provide the missing class(es) #if defined(__WXUNIVERSAL__) // nothing, use generic controls #elif defined(__WXMSW__) #define wxHAS_NATIVE_SPINCTRL #include "wx/msw/spinctrl.h" #elif defined(__WXGTK20__) #define wxHAS_NATIVE_SPINCTRL #define wxHAS_NATIVE_SPINCTRLDOUBLE #include "wx/gtk/spinctrl.h" #elif defined(__WXGTK__) #define wxHAS_NATIVE_SPINCTRL #include "wx/gtk1/spinctrl.h" #elif defined(__WXQT__) #define wxHAS_NATIVE_SPINCTRL #define wxHAS_NATIVE_SPINCTRLDOUBLE #include "wx/qt/spinctrl.h" #endif // platform #if !defined(wxHAS_NATIVE_SPINCTRL) || !defined(wxHAS_NATIVE_SPINCTRLDOUBLE) #include "wx/generic/spinctlg.h" #endif namespace wxPrivate { // This is an internal helper function currently used by all ports: return the // string containing hexadecimal representation of the given number. extern wxString wxSpinCtrlFormatAsHex(long val, long maxVal); } // namespace wxPrivate // old wxEVT_COMMAND_* constants #define wxEVT_COMMAND_SPINCTRL_UPDATED wxEVT_SPINCTRL #define wxEVT_COMMAND_SPINCTRLDOUBLE_UPDATED wxEVT_SPINCTRLDOUBLE #endif // wxUSE_SPINCTRL #endif // _WX_SPINCTRL_H_
h
rticonnextdds-usecases
data/projects/rticonnextdds-usecases/VehicleTracking/ExampleCode/thirdparty/wxWidgets-3.1.2/Win64/include/wx/dcgraph.h
///////////////////////////////////////////////////////////////////////////// // Name: wx/dcgraph.h // Purpose: graphics context device bridge header // Author: Stefan Csomor // Modified by: // Created: // Copyright: (c) Stefan Csomor // Licence: wxWindows licence ///////////////////////////////////////////////////////////////////////////// #ifndef _WX_GRAPHICS_DC_H_ #define _WX_GRAPHICS_DC_H_ #if wxUSE_GRAPHICS_CONTEXT #include "wx/dc.h" #include "wx/geometry.h" #include "wx/graphics.h" class WXDLLIMPEXP_FWD_CORE wxWindowDC; class WXDLLIMPEXP_CORE wxGCDC: public wxDC { public: wxGCDC( const wxWindowDC& dc ); wxGCDC( const wxMemoryDC& dc ); #if wxUSE_PRINTING_ARCHITECTURE wxGCDC( const wxPrinterDC& dc ); #endif #if defined(__WXMSW__) && wxUSE_ENH_METAFILE wxGCDC( const wxEnhMetaFileDC& dc ); #endif wxGCDC(wxGraphicsContext* context); wxGCDC(); virtual ~wxGCDC(); #ifdef __WXMSW__ // override wxDC virtual functions to provide access to HDC associated with // this Graphics object (implemented in src/msw/graphics.cpp) virtual WXHDC AcquireHDC() wxOVERRIDE; virtual void ReleaseHDC(WXHDC hdc) wxOVERRIDE; #endif // __WXMSW__ private: wxDECLARE_DYNAMIC_CLASS(wxGCDC); wxDECLARE_NO_COPY_CLASS(wxGCDC); }; class WXDLLIMPEXP_CORE wxGCDCImpl: public wxDCImpl { public: wxGCDCImpl( wxDC *owner, const wxWindowDC& dc ); wxGCDCImpl( wxDC *owner, const wxMemoryDC& dc ); #if wxUSE_PRINTING_ARCHITECTURE wxGCDCImpl( wxDC *owner, const wxPrinterDC& dc ); #endif #if defined(__WXMSW__) && wxUSE_ENH_METAFILE wxGCDCImpl( wxDC *owner, const wxEnhMetaFileDC& dc ); #endif // Ctor using an existing graphics context given to wxGCDC ctor. wxGCDCImpl(wxDC *owner, wxGraphicsContext* context); wxGCDCImpl( wxDC *owner ); virtual ~wxGCDCImpl(); // implement base class pure virtuals // ---------------------------------- virtual void Clear() wxOVERRIDE; virtual bool StartDoc( const wxString& message ) wxOVERRIDE; virtual void EndDoc() wxOVERRIDE; virtual void StartPage() wxOVERRIDE; virtual void EndPage() wxOVERRIDE; // flushing the content of this dc immediately onto screen virtual void Flush() wxOVERRIDE; virtual void SetFont(const wxFont& font) wxOVERRIDE; virtual void SetPen(const wxPen& pen) wxOVERRIDE; virtual void SetBrush(const wxBrush& brush) wxOVERRIDE; virtual void SetBackground(const wxBrush& brush) wxOVERRIDE; virtual void SetBackgroundMode(int mode) wxOVERRIDE; #if wxUSE_PALETTE virtual void SetPalette(const wxPalette& palette) wxOVERRIDE; #endif virtual void DestroyClippingRegion() wxOVERRIDE; virtual wxCoord GetCharHeight() const wxOVERRIDE; virtual wxCoord GetCharWidth() const wxOVERRIDE; virtual bool CanDrawBitmap() const wxOVERRIDE; virtual bool CanGetTextExtent() const wxOVERRIDE; virtual int GetDepth() const wxOVERRIDE; virtual wxSize GetPPI() const wxOVERRIDE; virtual void SetLogicalFunction(wxRasterOperationMode function) wxOVERRIDE; virtual void SetTextForeground(const wxColour& colour) wxOVERRIDE; virtual void SetTextBackground(const wxColour& colour) wxOVERRIDE; virtual void ComputeScaleAndOrigin() wxOVERRIDE; wxGraphicsContext* GetGraphicsContext() const wxOVERRIDE { return m_graphicContext; } virtual void SetGraphicsContext( wxGraphicsContext* ctx ) wxOVERRIDE; virtual void* GetHandle() const wxOVERRIDE; #if wxUSE_DC_TRANSFORM_MATRIX virtual bool CanUseTransformMatrix() const wxOVERRIDE; virtual bool SetTransformMatrix(const wxAffineMatrix2D& matrix) wxOVERRIDE; virtual wxAffineMatrix2D GetTransformMatrix() const wxOVERRIDE; virtual void ResetTransformMatrix() wxOVERRIDE; #endif // wxUSE_DC_TRANSFORM_MATRIX // the true implementations virtual bool DoFloodFill(wxCoord x, wxCoord y, const wxColour& col, wxFloodFillStyle style = wxFLOOD_SURFACE) wxOVERRIDE; virtual void DoGradientFillLinear(const wxRect& rect, const wxColour& initialColour, const wxColour& destColour, wxDirection nDirection = wxEAST) wxOVERRIDE; virtual void DoGradientFillConcentric(const wxRect& rect, const wxColour& initialColour, const wxColour& destColour, const wxPoint& circleCenter) wxOVERRIDE; virtual bool DoGetPixel(wxCoord x, wxCoord y, wxColour *col) const wxOVERRIDE; virtual void DoDrawPoint(wxCoord x, wxCoord y) wxOVERRIDE; #if wxUSE_SPLINES virtual void DoDrawSpline(const wxPointList *points) wxOVERRIDE; #endif virtual void DoDrawLine(wxCoord x1, wxCoord y1, wxCoord x2, wxCoord y2) wxOVERRIDE; virtual void DoDrawArc(wxCoord x1, wxCoord y1, wxCoord x2, wxCoord y2, wxCoord xc, wxCoord yc) wxOVERRIDE; virtual void DoDrawCheckMark(wxCoord x, wxCoord y, wxCoord width, wxCoord height) wxOVERRIDE; virtual void DoDrawEllipticArc(wxCoord x, wxCoord y, wxCoord w, wxCoord h, double sa, double ea) wxOVERRIDE; virtual void DoDrawRectangle(wxCoord x, wxCoord y, wxCoord width, wxCoord height) wxOVERRIDE; virtual void DoDrawRoundedRectangle(wxCoord x, wxCoord y, wxCoord width, wxCoord height, double radius) wxOVERRIDE; virtual void DoDrawEllipse(wxCoord x, wxCoord y, wxCoord width, wxCoord height) wxOVERRIDE; virtual void DoCrossHair(wxCoord x, wxCoord y) wxOVERRIDE; virtual void DoDrawIcon(const wxIcon& icon, wxCoord x, wxCoord y) wxOVERRIDE; virtual void DoDrawBitmap(const wxBitmap &bmp, wxCoord x, wxCoord y, bool useMask = false) wxOVERRIDE; virtual void DoDrawText(const wxString& text, wxCoord x, wxCoord y) wxOVERRIDE; virtual void DoDrawRotatedText(const wxString& text, wxCoord x, wxCoord y, double angle) wxOVERRIDE; virtual bool DoBlit(wxCoord xdest, wxCoord ydest, wxCoord width, wxCoord height, wxDC *source, wxCoord xsrc, wxCoord ysrc, wxRasterOperationMode rop = wxCOPY, bool useMask = false, wxCoord xsrcMask = -1, wxCoord ysrcMask = -1) wxOVERRIDE; virtual bool DoStretchBlit(wxCoord xdest, wxCoord ydest, wxCoord dstWidth, wxCoord dstHeight, wxDC *source, wxCoord xsrc, wxCoord ysrc, wxCoord srcWidth, wxCoord srcHeight, wxRasterOperationMode = wxCOPY, bool useMask = false, wxCoord xsrcMask = wxDefaultCoord, wxCoord ysrcMask = wxDefaultCoord) wxOVERRIDE; virtual void DoGetSize(int *,int *) const wxOVERRIDE; virtual void DoGetSizeMM(int* width, int* height) const wxOVERRIDE; virtual void DoDrawLines(int n, const wxPoint points[], wxCoord xoffset, wxCoord yoffset) wxOVERRIDE; virtual void DoDrawPolygon(int n, const wxPoint points[], wxCoord xoffset, wxCoord yoffset, wxPolygonFillMode fillStyle = wxODDEVEN_RULE) wxOVERRIDE; virtual void DoDrawPolyPolygon(int n, const int count[], const wxPoint points[], wxCoord xoffset, wxCoord yoffset, wxPolygonFillMode fillStyle) wxOVERRIDE; virtual void DoSetDeviceClippingRegion(const wxRegion& region) wxOVERRIDE; virtual void DoSetClippingRegion(wxCoord x, wxCoord y, wxCoord width, wxCoord height) wxOVERRIDE; virtual bool DoGetClippingRect(wxRect& rect) const wxOVERRIDE; virtual void DoGetTextExtent(const wxString& string, wxCoord *x, wxCoord *y, wxCoord *descent = NULL, wxCoord *externalLeading = NULL, const wxFont *theFont = NULL) const wxOVERRIDE; virtual bool DoGetPartialTextExtents(const wxString& text, wxArrayInt& widths) const wxOVERRIDE; #ifdef __WXMSW__ virtual wxRect MSWApplyGDIPlusTransform(const wxRect& r) const wxOVERRIDE; #endif // __WXMSW__ // update the internal clip box variables void UpdateClipBox(); protected: // unused int parameter distinguishes this version, which does not create a // wxGraphicsContext, in the expectation that the derived class will do it wxGCDCImpl(wxDC* owner, int); // scaling variables bool m_logicalFunctionSupported; wxGraphicsMatrix m_matrixOriginal; wxGraphicsMatrix m_matrixCurrent; #if wxUSE_DC_TRANSFORM_MATRIX wxAffineMatrix2D m_matrixExtTransform; #endif // wxUSE_DC_TRANSFORM_MATRIX wxGraphicsContext* m_graphicContext; bool m_isClipBoxValid; private: void Init(wxGraphicsContext*); wxDECLARE_CLASS(wxGCDCImpl); wxDECLARE_NO_COPY_CLASS(wxGCDCImpl); }; #endif // wxUSE_GRAPHICS_CONTEXT #endif // _WX_GRAPHICS_DC_H_
h
rticonnextdds-usecases
data/projects/rticonnextdds-usecases/VehicleTracking/ExampleCode/thirdparty/wxWidgets-3.1.2/Win64/include/wx/file.h
///////////////////////////////////////////////////////////////////////////// // Name: wx/file.h // Purpose: wxFile - encapsulates low-level "file descriptor" // wxTempFile - safely replace the old file // Author: Vadim Zeitlin // Modified by: // Created: 29/01/98 // Copyright: (c) 1998 Vadim Zeitlin <[email protected]> // Licence: wxWindows licence ///////////////////////////////////////////////////////////////////////////// #ifndef _WX_FILEH__ #define _WX_FILEH__ #include "wx/defs.h" #if wxUSE_FILE #include "wx/string.h" #include "wx/filefn.h" #include "wx/convauto.h" // ---------------------------------------------------------------------------- // class wxFile: raw file IO // // NB: for space efficiency this class has no virtual functions, including // dtor which is _not_ virtual, so it shouldn't be used as a base class. // ---------------------------------------------------------------------------- class WXDLLIMPEXP_BASE wxFile { public: // more file constants // ------------------- // opening mode enum OpenMode { read, write, read_write, write_append, write_excl }; // standard values for file descriptor enum { fd_invalid = -1, fd_stdin, fd_stdout, fd_stderr }; // static functions // ---------------- // check whether a regular file by this name exists static bool Exists(const wxString& name); // check whether we can access the given file in given mode // (only read and write make sense here) static bool Access(const wxString& name, OpenMode mode); // ctors // ----- // def ctor wxFile() { m_fd = fd_invalid; m_lasterror = 0; } // open specified file (may fail, use IsOpened()) wxFile(const wxString& fileName, OpenMode mode = read); // attach to (already opened) file wxFile(int lfd) { m_fd = lfd; m_lasterror = 0; } // open/close // create a new file (with the default value of bOverwrite, it will fail if // the file already exists, otherwise it will overwrite it and succeed) bool Create(const wxString& fileName, bool bOverwrite = false, int access = wxS_DEFAULT); bool Open(const wxString& fileName, OpenMode mode = read, int access = wxS_DEFAULT); bool Close(); // Close is a NOP if not opened // assign an existing file descriptor and get it back from wxFile object void Attach(int lfd) { Close(); m_fd = lfd; m_lasterror = 0; } int Detach() { const int fdOld = m_fd; m_fd = fd_invalid; return fdOld; } int fd() const { return m_fd; } // read/write (unbuffered) // read all data from the file into a string (useful for text files) bool ReadAll(wxString *str, const wxMBConv& conv = wxConvAuto()); // returns number of bytes read or wxInvalidOffset on error ssize_t Read(void *pBuf, size_t nCount); // returns the number of bytes written size_t Write(const void *pBuf, size_t nCount); // returns true on success bool Write(const wxString& s, const wxMBConv& conv = wxConvAuto()); // flush data not yet written bool Flush(); // file pointer operations (return wxInvalidOffset on failure) // move ptr ofs bytes related to start/current offset/end of file wxFileOffset Seek(wxFileOffset ofs, wxSeekMode mode = wxFromStart); // move ptr to ofs bytes before the end wxFileOffset SeekEnd(wxFileOffset ofs = 0) { return Seek(ofs, wxFromEnd); } // get current offset wxFileOffset Tell() const; // get current file length wxFileOffset Length() const; // simple accessors // is file opened? bool IsOpened() const { return m_fd != fd_invalid; } // is end of file reached? bool Eof() const; // has an error occurred? bool Error() const { return m_lasterror != 0; } // get last errno int GetLastError() const { return m_lasterror; } // reset error state void ClearLastError() { m_lasterror = 0; } // type such as disk or pipe wxFileKind GetKind() const { return wxGetFileKind(m_fd); } // dtor closes the file if opened ~wxFile() { Close(); } private: // copy ctor and assignment operator are private because // it doesn't make sense to copy files this way: // attempt to do it will provoke a compile-time error. wxFile(const wxFile&); wxFile& operator=(const wxFile&); // Copy the value of errno into m_lasterror if rc == -1 and return true in // this case (indicating that we've got an error). Otherwise return false. // // Notice that we use the possibly 64 bit wxFileOffset instead of int here so // that it works for checking the result of functions such as tell() too. bool CheckForError(wxFileOffset rc) const; int m_fd; // file descriptor or INVALID_FD if not opened int m_lasterror; // errno value of last error }; // ---------------------------------------------------------------------------- // class wxTempFile: if you want to replace another file, create an instance // of wxTempFile passing the name of the file to be replaced to the ctor. Then // you can write to wxTempFile and call Commit() function to replace the old // file (and close this one) or call Discard() to cancel the modification. If // you call neither of them, dtor will call Discard(). // ---------------------------------------------------------------------------- class WXDLLIMPEXP_BASE wxTempFile { public: // ctors // default wxTempFile() { } // associates the temp file with the file to be replaced and opens it wxTempFile(const wxString& strName); // open the temp file (strName is the name of file to be replaced) bool Open(const wxString& strName); // is the file opened? bool IsOpened() const { return m_file.IsOpened(); } // get current file length wxFileOffset Length() const { return m_file.Length(); } // move ptr ofs bytes related to start/current offset/end of file wxFileOffset Seek(wxFileOffset ofs, wxSeekMode mode = wxFromStart) { return m_file.Seek(ofs, mode); } // get current offset wxFileOffset Tell() const { return m_file.Tell(); } // I/O (both functions return true on success, false on failure) bool Write(const void *p, size_t n) { return m_file.Write(p, n) == n; } bool Write(const wxString& str, const wxMBConv& conv = wxMBConvUTF8()) { return m_file.Write(str, conv); } // flush data: can be called before closing file to ensure that data was // correctly written out bool Flush() { return m_file.Flush(); } // different ways to close the file // validate changes and delete the old file of name m_strName bool Commit(); // discard changes void Discard(); // dtor calls Discard() if file is still opened ~wxTempFile(); private: // no copy ctor/assignment operator wxTempFile(const wxTempFile&); wxTempFile& operator=(const wxTempFile&); wxString m_strName, // name of the file to replace in Commit() m_strTemp; // temporary file name wxFile m_file; // the temporary file }; #endif // wxUSE_FILE #endif // _WX_FILEH__
h
rticonnextdds-usecases
data/projects/rticonnextdds-usecases/VehicleTracking/ExampleCode/thirdparty/wxWidgets-3.1.2/Win64/include/wx/filesys.h
///////////////////////////////////////////////////////////////////////////// // Name: wx/filesys.h // Purpose: class for opening files - virtual file system // Author: Vaclav Slavik // Copyright: (c) 1999 Vaclav Slavik // Licence: wxWindows licence ///////////////////////////////////////////////////////////////////////////// #ifndef __FILESYS_H__ #define __FILESYS_H__ #include "wx/defs.h" #if wxUSE_FILESYSTEM #if !wxUSE_STREAMS #error You cannot compile virtual file systems without wxUSE_STREAMS #endif #if wxUSE_HTML && !wxUSE_FILESYSTEM #error You cannot compile wxHTML without virtual file systems #endif #include "wx/stream.h" #include "wx/datetime.h" #include "wx/filename.h" #include "wx/hashmap.h" class WXDLLIMPEXP_FWD_BASE wxFSFile; class WXDLLIMPEXP_FWD_BASE wxFileSystemHandler; class WXDLLIMPEXP_FWD_BASE wxFileSystem; //-------------------------------------------------------------------------------- // wxFSFile // This class is a file opened using wxFileSystem. It consists of // input stream, location, mime type & optional anchor // (in 'index.htm#chapter2', 'chapter2' is anchor) //-------------------------------------------------------------------------------- class WXDLLIMPEXP_BASE wxFSFile : public wxObject { public: wxFSFile(wxInputStream *stream, const wxString& loc, const wxString& mimetype, const wxString& anchor #if wxUSE_DATETIME , wxDateTime modif #endif // wxUSE_DATETIME ) { m_Stream = stream; m_Location = loc; m_MimeType = mimetype.Lower(); m_Anchor = anchor; #if wxUSE_DATETIME m_Modif = modif; #endif // wxUSE_DATETIME } virtual ~wxFSFile() { delete m_Stream; } // returns stream. This doesn't give away ownership of the stream object. wxInputStream *GetStream() const { return m_Stream; } // gives away the ownership of the current stream. wxInputStream *DetachStream() { wxInputStream *stream = m_Stream; m_Stream = NULL; return stream; } // deletes the current stream and takes ownership of another. void SetStream(wxInputStream *stream) { delete m_Stream; m_Stream = stream; } // returns file's mime type const wxString& GetMimeType() const; // returns the original location (aka filename) of the file const wxString& GetLocation() const { return m_Location; } const wxString& GetAnchor() const { return m_Anchor; } #if wxUSE_DATETIME wxDateTime GetModificationTime() const { return m_Modif; } #endif // wxUSE_DATETIME private: wxInputStream *m_Stream; wxString m_Location; wxString m_MimeType; wxString m_Anchor; #if wxUSE_DATETIME wxDateTime m_Modif; #endif // wxUSE_DATETIME wxDECLARE_ABSTRACT_CLASS(wxFSFile); wxDECLARE_NO_COPY_CLASS(wxFSFile); }; //-------------------------------------------------------------------------------- // wxFileSystemHandler // This class is FS handler for wxFileSystem. It provides // interface to access certain // kinds of files (HTPP, FTP, local, tar.gz etc..) //-------------------------------------------------------------------------------- class WXDLLIMPEXP_BASE wxFileSystemHandler : public wxObject { public: wxFileSystemHandler() : wxObject() {} // returns true if this handler is able to open given location virtual bool CanOpen(const wxString& location) = 0; // opens given file and returns pointer to input stream. // Returns NULL if opening failed. // The location is always absolute path. virtual wxFSFile* OpenFile(wxFileSystem& fs, const wxString& location) = 0; // Finds first/next file that matches spec wildcard. flags can be wxDIR for restricting // the query to directories or wxFILE for files only or 0 for either. // Returns filename or empty string if no more matching file exists virtual wxString FindFirst(const wxString& spec, int flags = 0); virtual wxString FindNext(); // Returns MIME type of the file - w/o need to open it // (default behaviour is that it returns type based on extension) static wxString GetMimeTypeFromExt(const wxString& location); protected: // returns protocol ("file", "http", "tar" etc.) The last (most right) // protocol is used: // {it returns "tar" for "file:subdir/archive.tar.gz#tar:/README.txt"} static wxString GetProtocol(const wxString& location); // returns left part of address: // {it returns "file:subdir/archive.tar.gz" for "file:subdir/archive.tar.gz#tar:/README.txt"} static wxString GetLeftLocation(const wxString& location); // returns anchor part of address: // {it returns "anchor" for "file:subdir/archive.tar.gz#tar:/README.txt#anchor"} // NOTE: anchor is NOT a part of GetLeftLocation()'s return value static wxString GetAnchor(const wxString& location); // returns right part of address: // {it returns "/README.txt" for "file:subdir/archive.tar.gz#tar:/README.txt"} static wxString GetRightLocation(const wxString& location); wxDECLARE_ABSTRACT_CLASS(wxFileSystemHandler); }; //-------------------------------------------------------------------------------- // wxFileSystem // This class provides simple interface for opening various // kinds of files (HTPP, FTP, local, tar.gz etc..) //-------------------------------------------------------------------------------- // Open Bit Flags enum wxFileSystemOpenFlags { wxFS_READ = 1, // Open for reading wxFS_SEEKABLE = 4 // Returned stream will be seekable }; WX_DECLARE_VOIDPTR_HASH_MAP_WITH_DECL(wxFileSystemHandler*, wxFSHandlerHash, class WXDLLIMPEXP_BASE); class WXDLLIMPEXP_BASE wxFileSystem : public wxObject { public: wxFileSystem() : wxObject() { m_FindFileHandler = NULL;} virtual ~wxFileSystem(); // sets the current location. Every call to OpenFile is // relative to this location. // NOTE !! // unless is_dir = true 'location' is *not* the directory but // file contained in this directory // (so ChangePathTo("dir/subdir/xh.htm") sets m_Path to "dir/subdir/") void ChangePathTo(const wxString& location, bool is_dir = false); wxString GetPath() const {return m_Path;} // opens given file and returns pointer to input stream. // Returns NULL if opening failed. // It first tries to open the file in relative scope // (based on ChangePathTo()'s value) and then as an absolute // path. wxFSFile* OpenFile(const wxString& location, int flags = wxFS_READ); // Finds first/next file that matches spec wildcard. flags can be wxDIR for restricting // the query to directories or wxFILE for files only or 0 for either. // Returns filename or empty string if no more matching file exists wxString FindFirst(const wxString& spec, int flags = 0); wxString FindNext(); // find a file in a list of directories, returns false if not found bool FindFileInPath(wxString *pStr, const wxString& path, const wxString& file); // Adds FS handler. // In fact, this class is only front-end to the FS handlers :-) static void AddHandler(wxFileSystemHandler *handler); // Removes FS handler static wxFileSystemHandler* RemoveHandler(wxFileSystemHandler *handler); // Returns true if there is a handler which can open the given location. static bool HasHandlerForPath(const wxString& location); // remove all items from the m_Handlers list static void CleanUpHandlers(); // Returns the native path for a file URL static wxFileName URLToFileName(const wxString& url); // Returns the file URL for a native path static wxString FileNameToURL(const wxFileName& filename); protected: wxFileSystemHandler *MakeLocal(wxFileSystemHandler *h); wxString m_Path; // the path (location) we are currently in // this is path, not file! // (so if you opened test/demo.htm, it is // "test/", not "test/demo.htm") wxString m_LastName; // name of last opened file (full path) static wxList m_Handlers; // list of FS handlers wxFileSystemHandler *m_FindFileHandler; // handler that succeed in FindFirst query wxFSHandlerHash m_LocalHandlers; // Handlers local to this instance wxDECLARE_DYNAMIC_CLASS(wxFileSystem); wxDECLARE_NO_COPY_CLASS(wxFileSystem); }; /* 'location' syntax: To determine FS type, we're using standard KDE notation: file:/absolute/path/file.htm file:relative_path/xxxxx.html /some/path/x.file ('file:' is default) http://www.gnome.org file:subdir/archive.tar.gz#tar:/README.txt special characters : ':' - FS identificator is before this char '#' - separator. It can be either HTML anchor ("index.html#news") (in case there is no ':' in the string to the right from it) or FS separator (example : http://www.wxhtml.org/wxhtml-0.1.tar.gz#tar:/include/wxhtml/filesys.h" this would access tgz archive stored on web) '/' - directory (path) separator. It is used to determine upper-level path. HEY! Don't use \ even if you're on Windows! */ class WXDLLIMPEXP_BASE wxLocalFSHandler : public wxFileSystemHandler { public: virtual bool CanOpen(const wxString& location) wxOVERRIDE; virtual wxFSFile* OpenFile(wxFileSystem& fs, const wxString& location) wxOVERRIDE; virtual wxString FindFirst(const wxString& spec, int flags = 0) wxOVERRIDE; virtual wxString FindNext() wxOVERRIDE; // wxLocalFSHandler will prefix all filenames with 'root' before accessing // files on disk. This effectively makes 'root' the top-level directory // and prevents access to files outside this directory. // (This is similar to Unix command 'chroot'.) static void Chroot(const wxString& root) { ms_root = root; } protected: static wxString ms_root; }; // Stream reading data from wxFSFile: this allows to use virtual files with any // wx functions accepting streams. class WXDLLIMPEXP_BASE wxFSInputStream : public wxWrapperInputStream { public: // Notice that wxFS_READ is implied in flags. wxFSInputStream(const wxString& filename, int flags = 0); virtual ~wxFSInputStream(); private: wxFSFile* m_file; wxDECLARE_NO_COPY_CLASS(wxFSInputStream); }; #endif // wxUSE_FILESYSTEM #endif // __FILESYS_H__
h
rticonnextdds-usecases
data/projects/rticonnextdds-usecases/VehicleTracking/ExampleCode/thirdparty/wxWidgets-3.1.2/Win64/include/wx/region.h
///////////////////////////////////////////////////////////////////////////// // Name: wx/region.h // Purpose: Base header for wxRegion // Author: Julian Smart // Modified by: // Created: // Copyright: (c) Julian Smart // Licence: wxWindows Licence ///////////////////////////////////////////////////////////////////////////// #ifndef _WX_REGION_H_BASE_ #define _WX_REGION_H_BASE_ #include "wx/gdiobj.h" #include "wx/gdicmn.h" class WXDLLIMPEXP_FWD_CORE wxBitmap; class WXDLLIMPEXP_FWD_CORE wxColour; class WXDLLIMPEXP_FWD_CORE wxRegion; // ---------------------------------------------------------------------------- // constants // ---------------------------------------------------------------------------- // result of wxRegion::Contains() call enum wxRegionContain { wxOutRegion = 0, wxPartRegion = 1, wxInRegion = 2 }; // these constants are used with wxRegion::Combine() in the ports which have // this method enum wxRegionOp { // Creates the intersection of the two combined regions. wxRGN_AND, // Creates a copy of the region wxRGN_COPY, // Combines the parts of first region that are not in the second one wxRGN_DIFF, // Creates the union of two combined regions. wxRGN_OR, // Creates the union of two regions except for any overlapping areas. wxRGN_XOR }; // ---------------------------------------------------------------------------- // wxRegionBase defines wxRegion API // ---------------------------------------------------------------------------- class WXDLLIMPEXP_CORE wxRegionBase : public wxGDIObject { public: // ctors // ----- // none are defined here but the following should be available: #if 0 wxRegion(); wxRegion(wxCoord x, wxCoord y, wxCoord w, wxCoord h); wxRegion(const wxPoint& topLeft, const wxPoint& bottomRight); wxRegion(const wxRect& rect); wxRegion(size_t n, const wxPoint *points, wxPolygonFillMode fillStyle = wxODDEVEN_RULE); wxRegion(const wxBitmap& bmp); wxRegion(const wxBitmap& bmp, const wxColour& transp, int tolerance = 0); #endif // 0 // operators // --------- bool operator==(const wxRegion& region) const { return IsEqual(region); } bool operator!=(const wxRegion& region) const { return !(*this == region); } // accessors // --------- // Is region empty? virtual bool IsEmpty() const = 0; bool Empty() const { return IsEmpty(); } // Is region equal (i.e. covers the same area as another one)? bool IsEqual(const wxRegion& region) const; // Get the bounding box bool GetBox(wxCoord& x, wxCoord& y, wxCoord& w, wxCoord& h) const { return DoGetBox(x, y, w, h); } wxRect GetBox() const { wxCoord x, y, w, h; return DoGetBox(x, y, w, h) ? wxRect(x, y, w, h) : wxRect(); } // Test if the given point or rectangle is inside this region wxRegionContain Contains(wxCoord x, wxCoord y) const { return DoContainsPoint(x, y); } wxRegionContain Contains(const wxPoint& pt) const { return DoContainsPoint(pt.x, pt.y); } wxRegionContain Contains(wxCoord x, wxCoord y, wxCoord w, wxCoord h) const { return DoContainsRect(wxRect(x, y, w, h)); } wxRegionContain Contains(const wxRect& rect) const { return DoContainsRect(rect); } // operations // ---------- virtual void Clear() = 0; // Move the region bool Offset(wxCoord x, wxCoord y) { return DoOffset(x, y); } bool Offset(const wxPoint& pt) { return DoOffset(pt.x, pt.y); } // Union rectangle or region with this region. bool Union(wxCoord x, wxCoord y, wxCoord w, wxCoord h) { return DoUnionWithRect(wxRect(x, y, w, h)); } bool Union(const wxRect& rect) { return DoUnionWithRect(rect); } bool Union(const wxRegion& region) { return DoUnionWithRegion(region); } #if wxUSE_IMAGE // Use the non-transparent pixels of a wxBitmap for the region to combine // with this region. First version takes transparency from bitmap's mask, // second lets the user specify the colour to be treated as transparent // along with an optional tolerance value. // NOTE: implemented in common/rgncmn.cpp bool Union(const wxBitmap& bmp); bool Union(const wxBitmap& bmp, const wxColour& transp, int tolerance = 0); #endif // wxUSE_IMAGE // Intersect rectangle or region with this one. bool Intersect(wxCoord x, wxCoord y, wxCoord w, wxCoord h); bool Intersect(const wxRect& rect); bool Intersect(const wxRegion& region) { return DoIntersect(region); } // Subtract rectangle or region from this: // Combines the parts of 'this' that are not part of the second region. bool Subtract(wxCoord x, wxCoord y, wxCoord w, wxCoord h); bool Subtract(const wxRect& rect); bool Subtract(const wxRegion& region) { return DoSubtract(region); } // XOR: the union of two combined regions except for any overlapping areas. bool Xor(wxCoord x, wxCoord y, wxCoord w, wxCoord h); bool Xor(const wxRect& rect); bool Xor(const wxRegion& region) { return DoXor(region); } // Convert the region to a B&W bitmap with the white pixels being inside // the region. wxBitmap ConvertToBitmap() const; protected: virtual bool DoIsEqual(const wxRegion& region) const = 0; virtual bool DoGetBox(wxCoord& x, wxCoord& y, wxCoord& w, wxCoord& h) const = 0; virtual wxRegionContain DoContainsPoint(wxCoord x, wxCoord y) const = 0; virtual wxRegionContain DoContainsRect(const wxRect& rect) const = 0; virtual bool DoOffset(wxCoord x, wxCoord y) = 0; virtual bool DoUnionWithRect(const wxRect& rect) = 0; virtual bool DoUnionWithRegion(const wxRegion& region) = 0; virtual bool DoIntersect(const wxRegion& region) = 0; virtual bool DoSubtract(const wxRegion& region) = 0; virtual bool DoXor(const wxRegion& region) = 0; }; // some ports implement a generic Combine() function while others only // implement individual wxRegion operations, factor out the common code for the // ports with Combine() in this class #if defined(__WXMSW__) || \ ( defined(__WXMAC__) && wxOSX_USE_COCOA_OR_CARBON ) #define wxHAS_REGION_COMBINE class WXDLLIMPEXP_CORE wxRegionWithCombine : public wxRegionBase { public: // these methods are not part of public API as they're not implemented on // all ports bool Combine(wxCoord x, wxCoord y, wxCoord w, wxCoord h, wxRegionOp op); bool Combine(const wxRect& rect, wxRegionOp op); bool Combine(const wxRegion& region, wxRegionOp op) { return DoCombine(region, op); } protected: // the real Combine() method, to be defined in the derived class virtual bool DoCombine(const wxRegion& region, wxRegionOp op) = 0; // implement some wxRegionBase pure virtuals in terms of Combine() virtual bool DoUnionWithRect(const wxRect& rect) wxOVERRIDE; virtual bool DoUnionWithRegion(const wxRegion& region) wxOVERRIDE; virtual bool DoIntersect(const wxRegion& region) wxOVERRIDE; virtual bool DoSubtract(const wxRegion& region) wxOVERRIDE; virtual bool DoXor(const wxRegion& region) wxOVERRIDE; }; #endif // ports with wxRegion::Combine() #if defined(__WXMSW__) #include "wx/msw/region.h" #elif defined(__WXGTK20__) #include "wx/gtk/region.h" #elif defined(__WXGTK__) #include "wx/gtk1/region.h" #elif defined(__WXMOTIF__) || defined(__WXX11__) #include "wx/x11/region.h" #elif defined(__WXDFB__) #include "wx/dfb/region.h" #elif defined(__WXMAC__) #include "wx/osx/region.h" #elif defined(__WXQT__) #include "wx/qt/region.h" #endif // ---------------------------------------------------------------------------- // inline functions implementation // ---------------------------------------------------------------------------- // NB: these functions couldn't be defined in the class declaration as they use // wxRegion and so can be only defined after including the header declaring // the real class inline bool wxRegionBase::Intersect(const wxRect& rect) { return DoIntersect(wxRegion(rect)); } inline bool wxRegionBase::Subtract(const wxRect& rect) { return DoSubtract(wxRegion(rect)); } inline bool wxRegionBase::Xor(const wxRect& rect) { return DoXor(wxRegion(rect)); } // ...and these functions are here because they call the ones above, and its // not really proper to call an inline function before its defined inline. inline bool wxRegionBase::Intersect(wxCoord x, wxCoord y, wxCoord w, wxCoord h) { return Intersect(wxRect(x, y, w, h)); } inline bool wxRegionBase::Subtract(wxCoord x, wxCoord y, wxCoord w, wxCoord h) { return Subtract(wxRect(x, y, w, h)); } inline bool wxRegionBase::Xor(wxCoord x, wxCoord y, wxCoord w, wxCoord h) { return Xor(wxRect(x, y, w, h)); } #ifdef wxHAS_REGION_COMBINE inline bool wxRegionWithCombine::Combine(wxCoord x, wxCoord y, wxCoord w, wxCoord h, wxRegionOp op) { return DoCombine(wxRegion(x, y, w, h), op); } inline bool wxRegionWithCombine::Combine(const wxRect& rect, wxRegionOp op) { return DoCombine(wxRegion(rect), op); } #endif // wxHAS_REGION_COMBINE #endif // _WX_REGION_H_BASE_
h
rticonnextdds-usecases
data/projects/rticonnextdds-usecases/VehicleTracking/ExampleCode/thirdparty/wxWidgets-3.1.2/Win64/include/wx/eventfilter.h
/////////////////////////////////////////////////////////////////////////////// // Name: wx/eventfilter.h // Purpose: wxEventFilter class declaration. // Author: Vadim Zeitlin // Created: 2011-11-21 // Copyright: (c) 2011 Vadim Zeitlin <[email protected]> // Licence: wxWindows licence /////////////////////////////////////////////////////////////////////////////// #ifndef _WX_EVENTFILTER_H_ #define _WX_EVENTFILTER_H_ #include "wx/defs.h" class WXDLLIMPEXP_FWD_BASE wxEvent; class WXDLLIMPEXP_FWD_BASE wxEvtHandler; // ---------------------------------------------------------------------------- // wxEventFilter is used with wxEvtHandler::AddFilter() and ProcessEvent(). // ---------------------------------------------------------------------------- class wxEventFilter { public: // Possible return values for FilterEvent(). // // Notice that the values of these enum elements are fixed due to backwards // compatibility constraints. enum { // Process event as usual. Event_Skip = -1, // Don't process the event normally at all. Event_Ignore = 0, // Event was already handled, don't process it normally. Event_Processed = 1 }; wxEventFilter() { m_next = NULL; } virtual ~wxEventFilter() { wxASSERT_MSG( !m_next, "Forgot to call wxEvtHandler::RemoveFilter()?" ); } // This method allows to filter all the events processed by the program, so // you should try to return quickly from it to avoid slowing down the // program to a crawl. // // Return value should be -1 to continue with the normal event processing, // or true or false to stop further processing and pretend that the event // had been already processed or won't be processed at all, respectively. virtual int FilterEvent(wxEvent& event) = 0; private: // Objects of this class are made to be stored in a linked list in // wxEvtHandler so put the next node ponter directly in the class itself. wxEventFilter* m_next; // And provide access to it for wxEvtHandler [only]. friend class wxEvtHandler; wxDECLARE_NO_COPY_CLASS(wxEventFilter); }; #endif // _WX_EVENTFILTER_H_
h
rticonnextdds-usecases
data/projects/rticonnextdds-usecases/VehicleTracking/ExampleCode/thirdparty/wxWidgets-3.1.2/Win64/include/wx/stopwatch.h
///////////////////////////////////////////////////////////////////////////// // Name: wx/stopwatch.h // Purpose: wxStopWatch and global time-related functions // Author: Julian Smart (wxTimer), Sylvain Bougnoux (wxStopWatch), // Vadim Zeitlin (time functions, current wxStopWatch) // Created: 26.06.03 (extracted from wx/timer.h) // Copyright: (c) 1998-2003 Julian Smart, Sylvain Bougnoux // (c) 2011 Vadim Zeitlin // Licence: wxWindows licence ///////////////////////////////////////////////////////////////////////////// #ifndef _WX_STOPWATCH_H_ #define _WX_STOPWATCH_H_ #include "wx/defs.h" #include "wx/longlong.h" // Time-related functions are also available via this header for compatibility // but you should include wx/time.h directly if you need only them and not // wxStopWatch itself. #include "wx/time.h" // ---------------------------------------------------------------------------- // wxStopWatch: measure time intervals with up to 1ms resolution // ---------------------------------------------------------------------------- #if wxUSE_STOPWATCH class WXDLLIMPEXP_BASE wxStopWatch { public: // ctor starts the stop watch wxStopWatch() { m_pauseCount = 0; Start(); } // Start the stop watch at the moment t0 expressed in milliseconds (i.e. // calling Time() immediately afterwards returns t0). This can be used to // restart an existing stopwatch. void Start(long t0 = 0); // pause the stop watch void Pause() { if ( m_pauseCount++ == 0 ) m_elapsedBeforePause = GetCurrentClockValue() - m_t0; } // resume it void Resume() { wxASSERT_MSG( m_pauseCount > 0, wxT("Resuming stop watch which is not paused") ); if ( --m_pauseCount == 0 ) { DoStart(); m_t0 -= m_elapsedBeforePause; } } // Get elapsed time since the last Start() in microseconds. wxLongLong TimeInMicro() const; // get elapsed time since the last Start() in milliseconds long Time() const { return (TimeInMicro()/1000).ToLong(); } private: // Really starts the stop watch. The initial time is set to current clock // value. void DoStart(); // Returns the current clock value in its native units. wxLongLong GetCurrentClockValue() const; // Return the frequency of the clock used in its ticks per second. wxLongLong GetClockFreq() const; // The clock value when the stop watch was last started. Its units vary // depending on the platform. wxLongLong m_t0; // The elapsed time as of last Pause() call (only valid if m_pauseCount > // 0) in the same units as m_t0. wxLongLong m_elapsedBeforePause; // if > 0, the stop watch is paused, otherwise it is running int m_pauseCount; }; #endif // wxUSE_STOPWATCH #endif // _WX_STOPWATCH_H_
h
rticonnextdds-usecases
data/projects/rticonnextdds-usecases/VehicleTracking/ExampleCode/thirdparty/wxWidgets-3.1.2/Win64/include/wx/init.h
/////////////////////////////////////////////////////////////////////////////// // Name: wx/init.h // Purpose: wxWidgets initialization and finalization functions // Author: Vadim Zeitlin // Modified by: // Created: 29.06.2003 // Copyright: (c) 2003 Vadim Zeitlin <[email protected]> // Licence: wxWindows licence /////////////////////////////////////////////////////////////////////////////// #ifndef _WX_INIT_H_ #define _WX_INIT_H_ #include "wx/defs.h" #include "wx/chartype.h" // ---------------------------------------------------------------------------- // wxEntry helper functions which allow to have more fine grained control // ---------------------------------------------------------------------------- // do common initialization, return true if ok (in this case wxEntryCleanup // must be called later), otherwise the program can't use wxWidgets at all // // this function also creates wxTheApp as a side effect, if wxIMPLEMENT_APP // hadn't been used a dummy default application object is created // // note that the parameters may be modified, this is why we pass them by // reference! extern bool WXDLLIMPEXP_BASE wxEntryStart(int& argc, wxChar **argv); // free the resources allocated by the library in wxEntryStart() and shut it // down (wxEntryStart() may be called again afterwards if necessary) extern void WXDLLIMPEXP_BASE wxEntryCleanup(); // ---------------------------------------------------------------------------- // wxEntry: this function initializes the library, runs the main event loop // and cleans it up // ---------------------------------------------------------------------------- // note that other, platform-specific, overloads of wxEntry may exist as well // but this one always exists under all platforms // // returns the program exit code extern int WXDLLIMPEXP_BASE wxEntry(int& argc, wxChar **argv); // we overload wxEntry[Start]() to take "char **" pointers too #if wxUSE_UNICODE extern bool WXDLLIMPEXP_BASE wxEntryStart(int& argc, char **argv); extern int WXDLLIMPEXP_BASE wxEntry(int& argc, char **argv); #endif// wxUSE_UNICODE // Under Windows we define additional wxEntry() overloads with signature // compatible with WinMain() and not the traditional main(). #ifdef __WINDOWS__ #include "wx/msw/init.h" #endif // ---------------------------------------------------------------------------- // Using the library without (explicit) application object: you may avoid using // wxDECLARE_APP and wxIMPLEMENT_APP macros and call the functions below instead at // the program startup and termination // ---------------------------------------------------------------------------- // initialize the library (may be called as many times as needed, but each // call to wxInitialize() must be matched by wxUninitialize()) extern bool WXDLLIMPEXP_BASE wxInitialize(); extern bool WXDLLIMPEXP_BASE wxInitialize(int& argc, wxChar **argv); #if wxUSE_UNICODE extern bool WXDLLIMPEXP_BASE wxInitialize(int& argc, char **argv); #endif // clean up -- the library can't be used any more after the last call to // wxUninitialize() extern void WXDLLIMPEXP_BASE wxUninitialize(); // create an object of this class on stack to initialize/cleanup the library // automatically class WXDLLIMPEXP_BASE wxInitializer { public: // initialize the library wxInitializer() { m_ok = wxInitialize(); } wxInitializer(int& argc, wxChar **argv) { m_ok = wxInitialize(argc, argv); } #if wxUSE_UNICODE wxInitializer(int& argc, char **argv) { m_ok = wxInitialize(argc, argv); } #endif // wxUSE_UNICODE // has the initialization been successful? (explicit test) bool IsOk() const { return m_ok; } // has the initialization been successful? (implicit test) operator bool() const { return m_ok; } // dtor only does clean up if we initialized the library properly ~wxInitializer() { if ( m_ok ) wxUninitialize(); } private: bool m_ok; }; #endif // _WX_INIT_H_
h
rticonnextdds-usecases
data/projects/rticonnextdds-usecases/VehicleTracking/ExampleCode/thirdparty/wxWidgets-3.1.2/Win64/include/wx/textcompleter.h
/////////////////////////////////////////////////////////////////////////////// // Name: wx/textcompleter.h // Purpose: Declaration of wxTextCompleter class. // Author: Vadim Zeitlin // Created: 2011-04-13 // Copyright: (c) 2011 Vadim Zeitlin <[email protected]> // Licence: wxWindows licence /////////////////////////////////////////////////////////////////////////////// #ifndef _WX_TEXTCOMPLETER_H_ #define _WX_TEXTCOMPLETER_H_ #include "wx/defs.h" #include "wx/arrstr.h" // ---------------------------------------------------------------------------- // wxTextCompleter: used by wxTextEnter::AutoComplete() // ---------------------------------------------------------------------------- class WXDLLIMPEXP_CORE wxTextCompleter { public: wxTextCompleter() { } // The virtual functions to be implemented by the derived classes: the // first one is called to start preparing for completions for the given // prefix and, if it returns true, GetNext() is called until it returns an // empty string indicating that there are no more completions. virtual bool Start(const wxString& prefix) = 0; virtual wxString GetNext() = 0; virtual ~wxTextCompleter(); private: wxDECLARE_NO_COPY_CLASS(wxTextCompleter); }; // ---------------------------------------------------------------------------- // wxTextCompleterSimple: returns the entire set of completions at once // ---------------------------------------------------------------------------- class WXDLLIMPEXP_CORE wxTextCompleterSimple : public wxTextCompleter { public: wxTextCompleterSimple() { } // Must be implemented to return all the completions for the given prefix. virtual void GetCompletions(const wxString& prefix, wxArrayString& res) = 0; virtual bool Start(const wxString& prefix) wxOVERRIDE; virtual wxString GetNext() wxOVERRIDE; private: wxArrayString m_completions; unsigned m_index; wxDECLARE_NO_COPY_CLASS(wxTextCompleterSimple); }; // ---------------------------------------------------------------------------- // wxTextCompleterFixed: Trivial wxTextCompleter implementation which always // returns the same fixed array of completions. // ---------------------------------------------------------------------------- // NB: This class is private and intentionally not documented as it is // currently used only for implementation of completion with the fixed list // of strings only by wxWidgets itself, do not use it outside of wxWidgets. class wxTextCompleterFixed : public wxTextCompleterSimple { public: void SetCompletions(const wxArrayString& strings) { m_strings = strings; } virtual void GetCompletions(const wxString& WXUNUSED(prefix), wxArrayString& res) wxOVERRIDE { res = m_strings; } private: wxArrayString m_strings; }; #endif // _WX_TEXTCOMPLETER_H_
h
rticonnextdds-usecases
data/projects/rticonnextdds-usecases/VehicleTracking/ExampleCode/thirdparty/wxWidgets-3.1.2/Win64/include/wx/datectrl.h
/////////////////////////////////////////////////////////////////////////////// // Name: wx/datectrl.h // Purpose: implements wxDatePickerCtrl // Author: Vadim Zeitlin // Modified by: // Created: 2005-01-09 // Copyright: (c) 2005 Vadim Zeitlin <[email protected]> // Licence: wxWindows licence /////////////////////////////////////////////////////////////////////////////// #ifndef _WX_DATECTRL_H_ #define _WX_DATECTRL_H_ #include "wx/defs.h" #if wxUSE_DATEPICKCTRL #include "wx/datetimectrl.h" // the base class #define wxDatePickerCtrlNameStr wxT("datectrl") // wxDatePickerCtrl styles enum { // default style on this platform, either wxDP_SPIN or wxDP_DROPDOWN wxDP_DEFAULT = 0, // a spin control-like date picker (not supported in generic version) wxDP_SPIN = 1, // a combobox-like date picker (not supported in mac version) wxDP_DROPDOWN = 2, // always show century in the default date display (otherwise it depends on // the system date format which may include the century or not) wxDP_SHOWCENTURY = 4, // allow not having any valid date in the control (by default it always has // some date, today initially if no valid date specified in ctor) wxDP_ALLOWNONE = 8 }; // ---------------------------------------------------------------------------- // wxDatePickerCtrl: allow the user to enter the date // ---------------------------------------------------------------------------- class WXDLLIMPEXP_ADV wxDatePickerCtrlBase : public wxDateTimePickerCtrl { public: /* The derived classes should implement ctor and Create() method with the following signature: bool Create(wxWindow *parent, wxWindowID id, const wxDateTime& dt = wxDefaultDateTime, const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxDefaultSize, long style = wxDP_DEFAULT | wxDP_SHOWCENTURY, const wxValidator& validator = wxDefaultValidator, const wxString& name = wxDatePickerCtrlNameStr); */ /* We inherit the methods to set/get the date from the base class. virtual void SetValue(const wxDateTime& dt) = 0; virtual wxDateTime GetValue() const = 0; */ // And add methods to set/get the allowed valid range for the dates. If // either/both of them are invalid, there is no corresponding limit and if // neither is set, GetRange() returns false. virtual void SetRange(const wxDateTime& dt1, const wxDateTime& dt2) = 0; virtual bool GetRange(wxDateTime *dt1, wxDateTime *dt2) const = 0; }; #if defined(__WXMSW__) && !defined(__WXUNIVERSAL__) #include "wx/msw/datectrl.h" #define wxHAS_NATIVE_DATEPICKCTRL #elif defined(__WXOSX_COCOA__) && !defined(__WXUNIVERSAL__) #include "wx/osx/datectrl.h" #define wxHAS_NATIVE_DATEPICKCTRL #else #include "wx/generic/datectrl.h" class WXDLLIMPEXP_ADV wxDatePickerCtrl : public wxDatePickerCtrlGeneric { public: wxDatePickerCtrl() { } wxDatePickerCtrl(wxWindow *parent, wxWindowID id, const wxDateTime& date = wxDefaultDateTime, const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxDefaultSize, long style = wxDP_DEFAULT | wxDP_SHOWCENTURY, const wxValidator& validator = wxDefaultValidator, const wxString& name = wxDatePickerCtrlNameStr) : wxDatePickerCtrlGeneric(parent, id, date, pos, size, style, validator, name) { } private: wxDECLARE_DYNAMIC_CLASS_NO_COPY(wxDatePickerCtrl); }; #endif #endif // wxUSE_DATEPICKCTRL #endif // _WX_DATECTRL_H_
h
rticonnextdds-usecases
data/projects/rticonnextdds-usecases/VehicleTracking/ExampleCode/thirdparty/wxWidgets-3.1.2/Win64/include/wx/webview.h
///////////////////////////////////////////////////////////////////////////// // Name: webview.h // Purpose: Common interface and events for web view component // Author: Marianne Gagnon // Copyright: (c) 2010 Marianne Gagnon, 2011 Steven Lamerton // Licence: wxWindows licence ///////////////////////////////////////////////////////////////////////////// #ifndef _WX_WEBVIEW_H_ #define _WX_WEBVIEW_H_ #include "wx/defs.h" #if wxUSE_WEBVIEW #include "wx/control.h" #include "wx/event.h" #include "wx/sstream.h" #include "wx/sharedptr.h" #include "wx/vector.h" #if defined(__WXOSX__) #include "wx/osx/webviewhistoryitem_webkit.h" #elif defined(__WXGTK__) #include "wx/gtk/webviewhistoryitem_webkit.h" #elif defined(__WXMSW__) #include "wx/msw/webviewhistoryitem_ie.h" #else #error "wxWebView not implemented on this platform." #endif class wxFSFile; class wxFileSystem; class wxWebView; enum wxWebViewZoom { wxWEBVIEW_ZOOM_TINY, wxWEBVIEW_ZOOM_SMALL, wxWEBVIEW_ZOOM_MEDIUM, wxWEBVIEW_ZOOM_LARGE, wxWEBVIEW_ZOOM_LARGEST }; enum wxWebViewZoomType { //Scales entire page, including images wxWEBVIEW_ZOOM_TYPE_LAYOUT, wxWEBVIEW_ZOOM_TYPE_TEXT }; enum wxWebViewNavigationError { wxWEBVIEW_NAV_ERR_CONNECTION, wxWEBVIEW_NAV_ERR_CERTIFICATE, wxWEBVIEW_NAV_ERR_AUTH, wxWEBVIEW_NAV_ERR_SECURITY, wxWEBVIEW_NAV_ERR_NOT_FOUND, wxWEBVIEW_NAV_ERR_REQUEST, wxWEBVIEW_NAV_ERR_USER_CANCELLED, wxWEBVIEW_NAV_ERR_OTHER }; enum wxWebViewReloadFlags { //Default, may access cache wxWEBVIEW_RELOAD_DEFAULT, wxWEBVIEW_RELOAD_NO_CACHE }; enum wxWebViewFindFlags { wxWEBVIEW_FIND_WRAP = 0x0001, wxWEBVIEW_FIND_ENTIRE_WORD = 0x0002, wxWEBVIEW_FIND_MATCH_CASE = 0x0004, wxWEBVIEW_FIND_HIGHLIGHT_RESULT = 0x0008, wxWEBVIEW_FIND_BACKWARDS = 0x0010, wxWEBVIEW_FIND_DEFAULT = 0 }; enum wxWebViewNavigationActionFlags { wxWEBVIEW_NAV_ACTION_NONE, wxWEBVIEW_NAV_ACTION_USER, wxWEBVIEW_NAV_ACTION_OTHER }; //Base class for custom scheme handlers class WXDLLIMPEXP_WEBVIEW wxWebViewHandler { public: wxWebViewHandler(const wxString& scheme) : m_scheme(scheme) {} virtual ~wxWebViewHandler() {} virtual wxString GetName() const { return m_scheme; } virtual wxFSFile* GetFile(const wxString &uri) = 0; private: wxString m_scheme; }; extern WXDLLIMPEXP_DATA_WEBVIEW(const char) wxWebViewNameStr[]; extern WXDLLIMPEXP_DATA_WEBVIEW(const char) wxWebViewDefaultURLStr[]; extern WXDLLIMPEXP_DATA_WEBVIEW(const char) wxWebViewBackendDefault[]; extern WXDLLIMPEXP_DATA_WEBVIEW(const char) wxWebViewBackendIE[]; extern WXDLLIMPEXP_DATA_WEBVIEW(const char) wxWebViewBackendWebKit[]; class WXDLLIMPEXP_WEBVIEW wxWebViewFactory : public wxObject { public: virtual wxWebView* Create() = 0; virtual wxWebView* Create(wxWindow* parent, wxWindowID id, const wxString& url = wxWebViewDefaultURLStr, const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxDefaultSize, long style = 0, const wxString& name = wxWebViewNameStr) = 0; }; WX_DECLARE_STRING_HASH_MAP(wxSharedPtr<wxWebViewFactory>, wxStringWebViewFactoryMap); class WXDLLIMPEXP_WEBVIEW wxWebView : public wxControl { public: wxWebView() { m_showMenu = true; m_runScriptCount = 0; } virtual ~wxWebView() {} virtual bool Create(wxWindow* parent, wxWindowID id, const wxString& url = wxWebViewDefaultURLStr, const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxDefaultSize, long style = 0, const wxString& name = wxWebViewNameStr) = 0; // Factory methods allowing the use of custom factories registered with // RegisterFactory static wxWebView* New(const wxString& backend = wxWebViewBackendDefault); static wxWebView* New(wxWindow* parent, wxWindowID id, const wxString& url = wxWebViewDefaultURLStr, const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxDefaultSize, const wxString& backend = wxWebViewBackendDefault, long style = 0, const wxString& name = wxWebViewNameStr); static void RegisterFactory(const wxString& backend, wxSharedPtr<wxWebViewFactory> factory); // General methods virtual void EnableContextMenu(bool enable = true) { m_showMenu = enable; } virtual wxString GetCurrentTitle() const = 0; virtual wxString GetCurrentURL() const = 0; // TODO: handle choosing a frame when calling GetPageSource()? virtual wxString GetPageSource() const = 0; virtual wxString GetPageText() const = 0; virtual bool IsBusy() const = 0; virtual bool IsContextMenuEnabled() const { return m_showMenu; } virtual bool IsEditable() const = 0; virtual void LoadURL(const wxString& url) = 0; virtual void Print() = 0; virtual void RegisterHandler(wxSharedPtr<wxWebViewHandler> handler) = 0; virtual void Reload(wxWebViewReloadFlags flags = wxWEBVIEW_RELOAD_DEFAULT) = 0; virtual bool RunScript(const wxString& javascript, wxString* output = NULL) = 0; virtual void SetEditable(bool enable = true) = 0; void SetPage(const wxString& html, const wxString& baseUrl) { DoSetPage(html, baseUrl); } void SetPage(wxInputStream& html, wxString baseUrl) { wxStringOutputStream stream; stream.Write(html); DoSetPage(stream.GetString(), baseUrl); } virtual void Stop() = 0; //History virtual bool CanGoBack() const = 0; virtual bool CanGoForward() const = 0; virtual void GoBack() = 0; virtual void GoForward() = 0; virtual void ClearHistory() = 0; virtual void EnableHistory(bool enable = true) = 0; virtual wxVector<wxSharedPtr<wxWebViewHistoryItem> > GetBackwardHistory() = 0; virtual wxVector<wxSharedPtr<wxWebViewHistoryItem> > GetForwardHistory() = 0; virtual void LoadHistoryItem(wxSharedPtr<wxWebViewHistoryItem> item) = 0; //Zoom virtual bool CanSetZoomType(wxWebViewZoomType type) const = 0; virtual wxWebViewZoom GetZoom() const = 0; virtual wxWebViewZoomType GetZoomType() const = 0; virtual void SetZoom(wxWebViewZoom zoom) = 0; virtual void SetZoomType(wxWebViewZoomType zoomType) = 0; //Selection virtual void SelectAll() = 0; virtual bool HasSelection() const = 0; virtual void DeleteSelection() = 0; virtual wxString GetSelectedText() const = 0; virtual wxString GetSelectedSource() const = 0; virtual void ClearSelection() = 0; //Clipboard functions virtual bool CanCut() const = 0; virtual bool CanCopy() const = 0; virtual bool CanPaste() const = 0; virtual void Cut() = 0; virtual void Copy() = 0; virtual void Paste() = 0; //Undo / redo functionality virtual bool CanUndo() const = 0; virtual bool CanRedo() const = 0; virtual void Undo() = 0; virtual void Redo() = 0; //Get the pointer to the underlying native engine. virtual void* GetNativeBackend() const = 0; //Find function virtual long Find(const wxString& text, int flags = wxWEBVIEW_FIND_DEFAULT) = 0; protected: virtual void DoSetPage(const wxString& html, const wxString& baseUrl) = 0; // Count the number of calls to RunScript() in order to prevent // the_same variable from being used twice in more than one call. int m_runScriptCount; private: static void InitFactoryMap(); static wxStringWebViewFactoryMap::iterator FindFactory(const wxString &backend); bool m_showMenu; static wxStringWebViewFactoryMap m_factoryMap; wxDECLARE_ABSTRACT_CLASS(wxWebView); }; class WXDLLIMPEXP_WEBVIEW wxWebViewEvent : public wxNotifyEvent { public: wxWebViewEvent() {} wxWebViewEvent(wxEventType type, int id, const wxString& url, const wxString target, wxWebViewNavigationActionFlags flags = wxWEBVIEW_NAV_ACTION_NONE) : wxNotifyEvent(type, id), m_url(url), m_target(target), m_actionFlags(flags) {} const wxString& GetURL() const { return m_url; } const wxString& GetTarget() const { return m_target; } wxWebViewNavigationActionFlags GetNavigationAction() const { return m_actionFlags; } virtual wxEvent* Clone() const wxOVERRIDE { return new wxWebViewEvent(*this); } private: wxString m_url; wxString m_target; wxWebViewNavigationActionFlags m_actionFlags; wxDECLARE_DYNAMIC_CLASS_NO_ASSIGN(wxWebViewEvent); }; wxDECLARE_EXPORTED_EVENT( WXDLLIMPEXP_WEBVIEW, wxEVT_WEBVIEW_NAVIGATING, wxWebViewEvent ); wxDECLARE_EXPORTED_EVENT( WXDLLIMPEXP_WEBVIEW, wxEVT_WEBVIEW_NAVIGATED, wxWebViewEvent ); wxDECLARE_EXPORTED_EVENT( WXDLLIMPEXP_WEBVIEW, wxEVT_WEBVIEW_LOADED, wxWebViewEvent ); wxDECLARE_EXPORTED_EVENT( WXDLLIMPEXP_WEBVIEW, wxEVT_WEBVIEW_ERROR, wxWebViewEvent ); wxDECLARE_EXPORTED_EVENT( WXDLLIMPEXP_WEBVIEW, wxEVT_WEBVIEW_NEWWINDOW, wxWebViewEvent ); wxDECLARE_EXPORTED_EVENT( WXDLLIMPEXP_WEBVIEW, wxEVT_WEBVIEW_TITLE_CHANGED, wxWebViewEvent ); typedef void (wxEvtHandler::*wxWebViewEventFunction) (wxWebViewEvent&); #define wxWebViewEventHandler(func) \ wxEVENT_HANDLER_CAST(wxWebViewEventFunction, func) #define EVT_WEBVIEW_NAVIGATING(id, fn) \ wx__DECLARE_EVT1(wxEVT_WEBVIEW_NAVIGATING, id, \ wxWebViewEventHandler(fn)) #define EVT_WEBVIEW_NAVIGATED(id, fn) \ wx__DECLARE_EVT1(wxEVT_WEBVIEW_NAVIGATED, id, \ wxWebViewEventHandler(fn)) #define EVT_WEBVIEW_LOADED(id, fn) \ wx__DECLARE_EVT1(wxEVT_WEBVIEW_LOADED, id, \ wxWebViewEventHandler(fn)) #define EVT_WEBVIEW_ERROR(id, fn) \ wx__DECLARE_EVT1(wxEVT_WEBVIEW_ERROR, id, \ wxWebViewEventHandler(fn)) #define EVT_WEBVIEW_NEWWINDOW(id, fn) \ wx__DECLARE_EVT1(wxEVT_WEBVIEW_NEWWINDOW, id, \ wxWebViewEventHandler(fn)) #define EVT_WEBVIEW_TITLE_CHANGED(id, fn) \ wx__DECLARE_EVT1(wxEVT_WEBVIEW_TITLE_CHANGED, id, \ wxWebViewEventHandler(fn)) // old wxEVT_COMMAND_* constants #define wxEVT_COMMAND_WEBVIEW_NAVIGATING wxEVT_WEBVIEW_NAVIGATING #define wxEVT_COMMAND_WEBVIEW_NAVIGATED wxEVT_WEBVIEW_NAVIGATED #define wxEVT_COMMAND_WEBVIEW_LOADED wxEVT_WEBVIEW_LOADED #define wxEVT_COMMAND_WEBVIEW_ERROR wxEVT_WEBVIEW_ERROR #define wxEVT_COMMAND_WEBVIEW_NEWWINDOW wxEVT_WEBVIEW_NEWWINDOW #define wxEVT_COMMAND_WEBVIEW_TITLE_CHANGED wxEVT_WEBVIEW_TITLE_CHANGED #endif // wxUSE_WEBVIEW #endif // _WX_WEBVIEW_H_
h
rticonnextdds-usecases
data/projects/rticonnextdds-usecases/VehicleTracking/ExampleCode/thirdparty/wxWidgets-3.1.2/Win64/include/wx/list.h
///////////////////////////////////////////////////////////////////////////// // Name: wx/list.h // Purpose: wxList, wxStringList classes // Author: Julian Smart // Modified by: VZ at 16/11/98: WX_DECLARE_LIST() and typesafe lists added // Created: 29/01/98 // Copyright: (c) 1998 Julian Smart // Licence: wxWindows licence ///////////////////////////////////////////////////////////////////////////// /* All this is quite ugly but serves two purposes: 1. Be almost 100% compatible with old, untyped, wxList class 2. Ensure compile-time type checking for the linked lists The idea is to have one base class (wxListBase) working with "void *" data, but to hide these untyped functions - i.e. make them protected, so they can only be used from derived classes which have inline member functions working with right types. This achieves the 2nd goal. As for the first one, we provide a special derivation of wxListBase called wxList which looks just like the old class. */ #ifndef _WX_LIST_H_ #define _WX_LIST_H_ // ----------------------------------------------------------------------------- // headers // ----------------------------------------------------------------------------- #include "wx/defs.h" #include "wx/object.h" #include "wx/string.h" #include "wx/vector.h" #if wxUSE_STD_CONTAINERS #include "wx/beforestd.h" #include <algorithm> #include <iterator> #include <list> #include "wx/afterstd.h" #endif // ---------------------------------------------------------------------------- // types // ---------------------------------------------------------------------------- class WXDLLIMPEXP_FWD_BASE wxObjectListNode; typedef wxObjectListNode wxNode; #if wxUSE_STD_CONTAINERS #define wxLIST_COMPATIBILITY #define WX_DECLARE_LIST_3(elT, dummy1, liT, dummy2, decl) \ WX_DECLARE_LIST_WITH_DECL(elT, liT, decl) #define WX_DECLARE_LIST_PTR_3(elT, dummy1, liT, dummy2, decl) \ WX_DECLARE_LIST_3(elT, dummy1, liT, dummy2, decl) #define WX_DECLARE_LIST_2(elT, liT, dummy, decl) \ WX_DECLARE_LIST_WITH_DECL(elT, liT, decl) #define WX_DECLARE_LIST_PTR_2(elT, liT, dummy, decl) \ WX_DECLARE_LIST_2(elT, liT, dummy, decl) \ #define WX_DECLARE_LIST_WITH_DECL(elT, liT, decl) \ WX_DECLARE_LIST_XO(elT*, liT, decl) template<class T> class wxList_SortFunction { public: wxList_SortFunction(wxSortCompareFunction f) : m_f(f) { } bool operator()(const T& i1, const T& i2) { return m_f((T*)&i1, (T*)&i2) < 0; } private: wxSortCompareFunction m_f; }; /* Note 1: the outer helper class _WX_LIST_HELPER_##liT below is a workaround for mingw 3.2.3 compiler bug that prevents a static function of liT class from being exported into dll. A minimal code snippet reproducing the bug: struct WXDLLIMPEXP_CORE Foo { static void Bar(); struct SomeInnerClass { friend class Foo; // comment this out to make it link }; ~Foo() { Bar(); } }; The program does not link under mingw_gcc 3.2.3 producing undefined reference to Foo::Bar() function Note 2: the EmptyList is needed to allow having a NULL pointer-like invalid iterator. We used to use just an uninitialized iterator object instead but this fails with some debug/checked versions of STL, notably the glibc version activated with _GLIBCXX_DEBUG, so we need to have a separate invalid iterator. */ // the real wxList-class declaration #define WX_DECLARE_LIST_XO(elT, liT, decl) \ decl _WX_LIST_HELPER_##liT \ { \ typedef elT _WX_LIST_ITEM_TYPE_##liT; \ typedef std::list<elT> BaseListType; \ public: \ static BaseListType EmptyList; \ static void DeleteFunction( _WX_LIST_ITEM_TYPE_##liT X ); \ }; \ \ class liT : public std::list<elT> \ { \ private: \ typedef std::list<elT> BaseListType; \ \ bool m_destroy; \ \ public: \ class compatibility_iterator \ { \ private: \ friend class liT; \ \ iterator m_iter; \ liT * m_list; \ \ public: \ compatibility_iterator() \ : m_iter(_WX_LIST_HELPER_##liT::EmptyList.end()), m_list( NULL ) {} \ compatibility_iterator( liT* li, iterator i ) \ : m_iter( i ), m_list( li ) {} \ compatibility_iterator( const liT* li, iterator i ) \ : m_iter( i ), m_list( const_cast< liT* >( li ) ) {} \ \ compatibility_iterator* operator->() { return this; } \ const compatibility_iterator* operator->() const { return this; } \ \ bool operator==(const compatibility_iterator& i) const \ { \ wxASSERT_MSG( m_list && i.m_list, \ wxT("comparing invalid iterators is illegal") ); \ return (m_list == i.m_list) && (m_iter == i.m_iter); \ } \ bool operator!=(const compatibility_iterator& i) const \ { return !( operator==( i ) ); } \ operator bool() const \ { return m_list ? m_iter != m_list->end() : false; } \ bool operator !() const \ { return !( operator bool() ); } \ \ elT GetData() const \ { return *m_iter; } \ void SetData( elT e ) \ { *m_iter = e; } \ \ compatibility_iterator GetNext() const \ { \ iterator i = m_iter; \ return compatibility_iterator( m_list, ++i ); \ } \ compatibility_iterator GetPrevious() const \ { \ if ( m_iter == m_list->begin() ) \ return compatibility_iterator(); \ \ iterator i = m_iter; \ return compatibility_iterator( m_list, --i ); \ } \ int IndexOf() const \ { \ return *this ? (int)std::distance( m_list->begin(), m_iter ) \ : wxNOT_FOUND; \ } \ }; \ public: \ liT() : m_destroy( false ) {} \ \ compatibility_iterator Find( const elT e ) const \ { \ liT* _this = const_cast< liT* >( this ); \ return compatibility_iterator( _this, \ std::find( _this->begin(), _this->end(), e ) ); \ } \ \ bool IsEmpty() const \ { return empty(); } \ size_t GetCount() const \ { return size(); } \ int Number() const \ { return static_cast< int >( GetCount() ); } \ \ compatibility_iterator Item( size_t idx ) const \ { \ iterator i = const_cast< liT* >(this)->begin(); \ std::advance( i, idx ); \ return compatibility_iterator( this, i ); \ } \ elT operator[](size_t idx) const \ { \ return Item(idx).GetData(); \ } \ \ compatibility_iterator GetFirst() const \ { \ return compatibility_iterator( this, \ const_cast< liT* >(this)->begin() ); \ } \ compatibility_iterator GetLast() const \ { \ iterator i = const_cast< liT* >(this)->end(); \ return compatibility_iterator( this, !empty() ? --i : i ); \ } \ bool Member( elT e ) const \ { return Find( e ); } \ compatibility_iterator Nth( int n ) const \ { return Item( n ); } \ int IndexOf( elT e ) const \ { return Find( e ).IndexOf(); } \ \ compatibility_iterator Append( elT e ) \ { \ push_back( e ); \ return GetLast(); \ } \ compatibility_iterator Insert( elT e ) \ { \ push_front( e ); \ return compatibility_iterator( this, begin() ); \ } \ compatibility_iterator Insert(const compatibility_iterator & i, elT e)\ { \ return compatibility_iterator( this, insert( i.m_iter, e ) ); \ } \ compatibility_iterator Insert( size_t idx, elT e ) \ { \ return compatibility_iterator( this, \ insert( Item( idx ).m_iter, e ) ); \ } \ \ void DeleteContents( bool destroy ) \ { m_destroy = destroy; } \ bool GetDeleteContents() const \ { return m_destroy; } \ void Erase( const compatibility_iterator& i ) \ { \ if ( m_destroy ) \ _WX_LIST_HELPER_##liT::DeleteFunction( i->GetData() ); \ erase( i.m_iter ); \ } \ bool DeleteNode( const compatibility_iterator& i ) \ { \ if( i ) \ { \ Erase( i ); \ return true; \ } \ return false; \ } \ bool DeleteObject( elT e ) \ { \ return DeleteNode( Find( e ) ); \ } \ void Clear() \ { \ if ( m_destroy ) \ std::for_each( begin(), end(), \ _WX_LIST_HELPER_##liT::DeleteFunction ); \ clear(); \ } \ /* Workaround for broken VC6 std::list::sort() see above */ \ void Sort( wxSortCompareFunction compfunc ) \ { sort( wxList_SortFunction<elT>(compfunc ) ); } \ ~liT() { Clear(); } \ \ /* It needs access to our EmptyList */ \ friend class compatibility_iterator; \ } #define WX_DECLARE_LIST(elementtype, listname) \ WX_DECLARE_LIST_WITH_DECL(elementtype, listname, class) #define WX_DECLARE_LIST_PTR(elementtype, listname) \ WX_DECLARE_LIST(elementtype, listname) #define WX_DECLARE_EXPORTED_LIST(elementtype, listname) \ WX_DECLARE_LIST_WITH_DECL(elementtype, listname, class WXDLLIMPEXP_CORE) #define WX_DECLARE_EXPORTED_LIST_PTR(elementtype, listname) \ WX_DECLARE_EXPORTED_LIST(elementtype, listname) #define WX_DECLARE_USER_EXPORTED_LIST(elementtype, listname, usergoo) \ WX_DECLARE_LIST_WITH_DECL(elementtype, listname, class usergoo) #define WX_DECLARE_USER_EXPORTED_LIST_PTR(elementtype, listname, usergoo) \ WX_DECLARE_USER_EXPORTED_LIST(elementtype, listname, usergoo) // this macro must be inserted in your program after // #include "wx/listimpl.cpp" #define WX_DEFINE_LIST(name) "don't forget to include listimpl.cpp!" #define WX_DEFINE_EXPORTED_LIST(name) WX_DEFINE_LIST(name) #define WX_DEFINE_USER_EXPORTED_LIST(name) WX_DEFINE_LIST(name) #else // if !wxUSE_STD_CONTAINERS // undef it to get rid of old, deprecated functions #define wxLIST_COMPATIBILITY // ----------------------------------------------------------------------------- // key stuff: a list may be optionally keyed on integer or string key // ----------------------------------------------------------------------------- union wxListKeyValue { long integer; wxString *string; }; // a struct which may contain both types of keys // // implementation note: on one hand, this class allows to have only one function // for any keyed operation instead of 2 almost equivalent. OTOH, it's needed to // resolve ambiguity which we would otherwise have with wxStringList::Find() and // wxList::Find(const char *). class WXDLLIMPEXP_BASE wxListKey { public: // implicit ctors wxListKey() : m_keyType(wxKEY_NONE) { } wxListKey(long i) : m_keyType(wxKEY_INTEGER) { m_key.integer = i; } wxListKey(const wxString& s) : m_keyType(wxKEY_STRING) { m_key.string = new wxString(s); } wxListKey(const char *s) : m_keyType(wxKEY_STRING) { m_key.string = new wxString(s); } wxListKey(const wchar_t *s) : m_keyType(wxKEY_STRING) { m_key.string = new wxString(s); } // accessors wxKeyType GetKeyType() const { return m_keyType; } const wxString GetString() const { wxASSERT( m_keyType == wxKEY_STRING ); return *m_key.string; } long GetNumber() const { wxASSERT( m_keyType == wxKEY_INTEGER ); return m_key.integer; } // comparison // Note: implementation moved to list.cpp to prevent BC++ inline // expansion warning. bool operator==(wxListKeyValue value) const ; // dtor ~wxListKey() { if ( m_keyType == wxKEY_STRING ) delete m_key.string; } private: wxKeyType m_keyType; wxListKeyValue m_key; }; // ----------------------------------------------------------------------------- // wxNodeBase class is a (base for) node in a double linked list // ----------------------------------------------------------------------------- extern WXDLLIMPEXP_DATA_BASE(wxListKey) wxDefaultListKey; class WXDLLIMPEXP_FWD_BASE wxListBase; class WXDLLIMPEXP_BASE wxNodeBase { friend class wxListBase; public: // ctor wxNodeBase(wxListBase *list = NULL, wxNodeBase *previous = NULL, wxNodeBase *next = NULL, void *data = NULL, const wxListKey& key = wxDefaultListKey); virtual ~wxNodeBase(); // FIXME no check is done that the list is really keyed on strings wxString GetKeyString() const { return *m_key.string; } long GetKeyInteger() const { return m_key.integer; } // Necessary for some existing code void SetKeyString(const wxString& s) { m_key.string = new wxString(s); } void SetKeyInteger(long i) { m_key.integer = i; } #ifdef wxLIST_COMPATIBILITY // compatibility methods, use Get* instead. wxDEPRECATED( wxNode *Next() const ); wxDEPRECATED( wxNode *Previous() const ); wxDEPRECATED( wxObject *Data() const ); #endif // wxLIST_COMPATIBILITY protected: // all these are going to be "overloaded" in the derived classes wxNodeBase *GetNext() const { return m_next; } wxNodeBase *GetPrevious() const { return m_previous; } void *GetData() const { return m_data; } void SetData(void *data) { m_data = data; } // get 0-based index of this node within the list or wxNOT_FOUND int IndexOf() const; virtual void DeleteData() { } public: // for wxList::iterator void** GetDataPtr() const { return &(const_cast<wxNodeBase*>(this)->m_data); } private: // optional key stuff wxListKeyValue m_key; void *m_data; // user data wxNodeBase *m_next, // next and previous nodes in the list *m_previous; wxListBase *m_list; // list we belong to wxDECLARE_NO_COPY_CLASS(wxNodeBase); }; // ----------------------------------------------------------------------------- // a double-linked list class // ----------------------------------------------------------------------------- class WXDLLIMPEXP_FWD_BASE wxList; class WXDLLIMPEXP_BASE wxListBase { friend class wxNodeBase; // should be able to call DetachNode() friend class wxHashTableBase; // should be able to call untyped Find() public: // default ctor & dtor wxListBase(wxKeyType keyType = wxKEY_NONE) { Init(keyType); } virtual ~wxListBase(); // accessors // count of items in the list size_t GetCount() const { return m_count; } // return true if this list is empty bool IsEmpty() const { return m_count == 0; } // operations // delete all nodes void Clear(); // instruct it to destroy user data when deleting nodes void DeleteContents(bool destroy) { m_destroy = destroy; } // query if to delete bool GetDeleteContents() const { return m_destroy; } // get the keytype wxKeyType GetKeyType() const { return m_keyType; } // set the keytype (required by the serial code) void SetKeyType(wxKeyType keyType) { wxASSERT( m_count==0 ); m_keyType = keyType; } #ifdef wxLIST_COMPATIBILITY // compatibility methods from old wxList wxDEPRECATED( int Number() const ); // use GetCount instead. wxDEPRECATED( wxNode *First() const ); // use GetFirst wxDEPRECATED( wxNode *Last() const ); // use GetLast wxDEPRECATED( wxNode *Nth(size_t n) const ); // use Item // kludge for typesafe list migration in core classes. wxDEPRECATED( operator wxList&() const ); #endif // wxLIST_COMPATIBILITY protected: // all methods here are "overloaded" in derived classes to provide compile // time type checking // create a node for the list of this type virtual wxNodeBase *CreateNode(wxNodeBase *prev, wxNodeBase *next, void *data, const wxListKey& key = wxDefaultListKey) = 0; // ctors // from an array wxListBase(size_t count, void *elements[]); // from a sequence of objects wxListBase(void *object, ... /* terminate with NULL */); protected: void Assign(const wxListBase& list) { Clear(); DoCopy(list); } // get list head/tail wxNodeBase *GetFirst() const { return m_nodeFirst; } wxNodeBase *GetLast() const { return m_nodeLast; } // by (0-based) index wxNodeBase *Item(size_t index) const; // get the list item's data void *operator[](size_t n) const { wxNodeBase *node = Item(n); return node ? node->GetData() : NULL; } // operations // append to end of list wxNodeBase *Prepend(void *object) { return (wxNodeBase *)wxListBase::Insert(object); } // append to beginning of list wxNodeBase *Append(void *object); // insert a new item at the beginning of the list wxNodeBase *Insert(void *object) { return Insert(static_cast<wxNodeBase *>(NULL), object); } // insert a new item at the given position wxNodeBase *Insert(size_t pos, void *object) { return pos == GetCount() ? Append(object) : Insert(Item(pos), object); } // insert before given node or at front of list if prev == NULL wxNodeBase *Insert(wxNodeBase *prev, void *object); // keyed append wxNodeBase *Append(long key, void *object); wxNodeBase *Append(const wxString& key, void *object); // removes node from the list but doesn't delete it (returns pointer // to the node or NULL if it wasn't found in the list) wxNodeBase *DetachNode(wxNodeBase *node); // delete element from list, returns false if node not found bool DeleteNode(wxNodeBase *node); // finds object pointer and deletes node (and object if DeleteContents // is on), returns false if object not found bool DeleteObject(void *object); // search (all return NULL if item not found) // by data wxNodeBase *Find(const void *object) const; // by key wxNodeBase *Find(const wxListKey& key) const; // get 0-based index of object or wxNOT_FOUND int IndexOf( void *object ) const; // this function allows the sorting of arbitrary lists by giving // a function to compare two list elements. The list is sorted in place. void Sort(const wxSortCompareFunction compfunc); // functions for iterating over the list void *FirstThat(wxListIterateFunction func); void ForEach(wxListIterateFunction func); void *LastThat(wxListIterateFunction func); // for STL interface, "last" points to one after the last node // of the controlled sequence (NULL for the end of the list) void Reverse(); void DeleteNodes(wxNodeBase* first, wxNodeBase* last); private: // common part of all ctors void Init(wxKeyType keyType = wxKEY_NONE); // helpers // common part of copy ctor and assignment operator void DoCopy(const wxListBase& list); // common part of all Append()s wxNodeBase *AppendCommon(wxNodeBase *node); // free node's data and node itself void DoDeleteNode(wxNodeBase *node); size_t m_count; // number of elements in the list bool m_destroy; // destroy user data when deleting list items? wxNodeBase *m_nodeFirst, // pointers to the head and tail of the list *m_nodeLast; wxKeyType m_keyType; // type of our keys (may be wxKEY_NONE) }; // ----------------------------------------------------------------------------- // macros for definition of "template" list type // ----------------------------------------------------------------------------- // Helper macro defining common iterator typedefs #if wxUSE_STD_CONTAINERS_COMPATIBLY #include <iterator> #define WX_DECLARE_LIST_ITER_DIFF_AND_CATEGORY() \ typedef std::ptrdiff_t difference_type; \ typedef std::bidirectional_iterator_tag iterator_category; #else #define WX_DECLARE_LIST_ITER_DIFF_AND_CATEGORY() #endif // and now some heavy magic... // declare a list type named 'name' and containing elements of type 'T *' // (as a by product of macro expansion you also get wx##name##Node // wxNode-derived type) // // implementation details: // 1. We define _WX_LIST_ITEM_TYPE_##name typedef to save in it the item type // for the list of given type - this allows us to pass only the list name // to WX_DEFINE_LIST() even if it needs both the name and the type // // 2. We redefine all non-type-safe wxList functions with type-safe versions // which don't take any space (everything is inline), but bring compile // time error checking. // // 3. The macro which is usually used (WX_DECLARE_LIST) is defined in terms of // a more generic WX_DECLARE_LIST_2 macro which, in turn, uses the most // generic WX_DECLARE_LIST_3 one. The last macro adds a sometimes // interesting capability to store polymorphic objects in the list and is // particularly useful with, for example, "wxWindow *" list where the // wxWindowBase pointers are put into the list, but wxWindow pointers are // retrieved from it. // // 4. final hack is that WX_DECLARE_LIST_3 is defined in terms of // WX_DECLARE_LIST_4 to allow defining classes without operator->() as // it results in compiler warnings when this operator doesn't make sense // (i.e. stored elements are not pointers) // common part of WX_DECLARE_LIST_3 and WX_DECLARE_LIST_PTR_3 #define WX_DECLARE_LIST_4(T, Tbase, name, nodetype, classexp, ptrop) \ typedef int (*wxSortFuncFor_##name)(const T **, const T **); \ \ classexp nodetype : public wxNodeBase \ { \ public: \ nodetype(wxListBase *list = NULL, \ nodetype *previous = NULL, \ nodetype *next = NULL, \ T *data = NULL, \ const wxListKey& key = wxDefaultListKey) \ : wxNodeBase(list, previous, next, data, key) { } \ \ nodetype *GetNext() const \ { return (nodetype *)wxNodeBase::GetNext(); } \ nodetype *GetPrevious() const \ { return (nodetype *)wxNodeBase::GetPrevious(); } \ \ T *GetData() const \ { return (T *)wxNodeBase::GetData(); } \ void SetData(T *data) \ { wxNodeBase::SetData(data); } \ \ protected: \ virtual void DeleteData() wxOVERRIDE; \ \ wxDECLARE_NO_COPY_CLASS(nodetype); \ }; \ \ classexp name : public wxListBase \ { \ public: \ typedef nodetype Node; \ classexp compatibility_iterator \ { \ public: \ compatibility_iterator(Node *ptr = NULL) : m_ptr(ptr) { } \ \ Node *operator->() const { return m_ptr; } \ operator Node *() const { return m_ptr; } \ \ private: \ Node *m_ptr; \ }; \ \ name(wxKeyType keyType = wxKEY_NONE) : wxListBase(keyType) \ { } \ name(const name& list) : wxListBase(list.GetKeyType()) \ { Assign(list); } \ name(size_t count, T *elements[]) \ : wxListBase(count, (void **)elements) { } \ \ name& operator=(const name& list) \ { if (&list != this) Assign(list); return *this; } \ \ nodetype *GetFirst() const \ { return (nodetype *)wxListBase::GetFirst(); } \ nodetype *GetLast() const \ { return (nodetype *)wxListBase::GetLast(); } \ \ nodetype *Item(size_t index) const \ { return (nodetype *)wxListBase::Item(index); } \ \ T *operator[](size_t index) const \ { \ nodetype *node = Item(index); \ return node ? (T*)(node->GetData()) : NULL; \ } \ \ nodetype *Append(Tbase *object) \ { return (nodetype *)wxListBase::Append(object); } \ nodetype *Insert(Tbase *object) \ { return (nodetype *)Insert(static_cast<nodetype *>(NULL), \ object); } \ nodetype *Insert(size_t pos, Tbase *object) \ { return (nodetype *)wxListBase::Insert(pos, object); } \ nodetype *Insert(nodetype *prev, Tbase *object) \ { return (nodetype *)wxListBase::Insert(prev, object); } \ \ nodetype *Append(long key, void *object) \ { return (nodetype *)wxListBase::Append(key, object); } \ nodetype *Append(const wxChar *key, void *object) \ { return (nodetype *)wxListBase::Append(key, object); } \ \ nodetype *DetachNode(nodetype *node) \ { return (nodetype *)wxListBase::DetachNode(node); } \ bool DeleteNode(nodetype *node) \ { return wxListBase::DeleteNode(node); } \ bool DeleteObject(Tbase *object) \ { return wxListBase::DeleteObject(object); } \ void Erase(nodetype *it) \ { DeleteNode(it); } \ \ nodetype *Find(const Tbase *object) const \ { return (nodetype *)wxListBase::Find(object); } \ \ virtual nodetype *Find(const wxListKey& key) const \ { return (nodetype *)wxListBase::Find(key); } \ \ bool Member(const Tbase *object) const \ { return Find(object) != NULL; } \ \ int IndexOf(Tbase *object) const \ { return wxListBase::IndexOf(object); } \ \ void Sort(wxSortCompareFunction func) \ { wxListBase::Sort(func); } \ void Sort(wxSortFuncFor_##name func) \ { Sort((wxSortCompareFunction)func); } \ \ protected: \ virtual wxNodeBase *CreateNode(wxNodeBase *prev, wxNodeBase *next, \ void *data, \ const wxListKey& key = wxDefaultListKey) \ wxOVERRIDE \ { \ return new nodetype(this, \ (nodetype *)prev, (nodetype *)next, \ (T *)data, key); \ } \ /* STL interface */ \ public: \ typedef size_t size_type; \ typedef int difference_type; \ typedef T* value_type; \ typedef Tbase* base_value_type; \ typedef value_type& reference; \ typedef const value_type& const_reference; \ typedef base_value_type& base_reference; \ typedef const base_value_type& const_base_reference; \ \ classexp iterator \ { \ public: \ WX_DECLARE_LIST_ITER_DIFF_AND_CATEGORY() \ typedef T* value_type; \ typedef value_type* pointer; \ typedef value_type& reference; \ \ typedef nodetype Node; \ typedef iterator itor; \ \ Node* m_node; \ Node* m_init; \ public: \ /* Compatibility typedefs, don't use */ \ typedef reference reference_type; \ typedef pointer pointer_type; \ \ iterator(Node* node, Node* init) : m_node(node), m_init(init) {}\ iterator() : m_node(NULL), m_init(NULL) { } \ reference_type operator*() const \ { return *(pointer_type)m_node->GetDataPtr(); } \ ptrop \ itor& operator++() \ { \ wxASSERT_MSG( m_node, wxT("uninitialized iterator") ); \ m_node = m_node->GetNext(); \ return *this; \ } \ const itor operator++(int) \ { \ itor tmp = *this; \ wxASSERT_MSG( m_node, wxT("uninitialized iterator") ); \ m_node = m_node->GetNext(); \ return tmp; \ } \ itor& operator--() \ { \ m_node = m_node ? m_node->GetPrevious() : m_init; \ return *this; \ } \ const itor operator--(int) \ { \ itor tmp = *this; \ m_node = m_node ? m_node->GetPrevious() : m_init; \ return tmp; \ } \ bool operator!=(const itor& it) const \ { return it.m_node != m_node; } \ bool operator==(const itor& it) const \ { return it.m_node == m_node; } \ }; \ classexp const_iterator \ { \ public: \ WX_DECLARE_LIST_ITER_DIFF_AND_CATEGORY() \ typedef T* value_type; \ typedef const value_type* pointer; \ typedef const value_type& reference; \ \ typedef nodetype Node; \ typedef const_iterator itor; \ \ Node* m_node; \ Node* m_init; \ public: \ typedef reference reference_type; \ typedef pointer pointer_type; \ \ const_iterator(Node* node, Node* init) \ : m_node(node), m_init(init) { } \ const_iterator() : m_node(NULL), m_init(NULL) { } \ const_iterator(const iterator& it) \ : m_node(it.m_node), m_init(it.m_init) { } \ reference_type operator*() const \ { return *(pointer_type)m_node->GetDataPtr(); } \ ptrop \ itor& operator++() \ { \ wxASSERT_MSG( m_node, wxT("uninitialized iterator") ); \ m_node = m_node->GetNext(); \ return *this; \ } \ const itor operator++(int) \ { \ itor tmp = *this; \ wxASSERT_MSG( m_node, wxT("uninitialized iterator") ); \ m_node = m_node->GetNext(); \ return tmp; \ } \ itor& operator--() \ { \ m_node = m_node ? m_node->GetPrevious() : m_init; \ return *this; \ } \ const itor operator--(int) \ { \ itor tmp = *this; \ m_node = m_node ? m_node->GetPrevious() : m_init; \ return tmp; \ } \ bool operator!=(const itor& it) const \ { return it.m_node != m_node; } \ bool operator==(const itor& it) const \ { return it.m_node == m_node; } \ }; \ classexp reverse_iterator \ { \ public: \ WX_DECLARE_LIST_ITER_DIFF_AND_CATEGORY() \ typedef T* value_type; \ typedef value_type* pointer; \ typedef value_type& reference; \ \ typedef nodetype Node; \ typedef reverse_iterator itor; \ \ Node* m_node; \ Node* m_init; \ public: \ typedef reference reference_type; \ typedef pointer pointer_type; \ \ reverse_iterator(Node* node, Node* init) \ : m_node(node), m_init(init) { } \ reverse_iterator() : m_node(NULL), m_init(NULL) { } \ reference_type operator*() const \ { return *(pointer_type)m_node->GetDataPtr(); } \ ptrop \ itor& operator++() \ { m_node = m_node->GetPrevious(); return *this; } \ const itor operator++(int) \ { itor tmp = *this; m_node = m_node->GetPrevious(); return tmp; }\ itor& operator--() \ { m_node = m_node ? m_node->GetNext() : m_init; return *this; } \ const itor operator--(int) \ { \ itor tmp = *this; \ m_node = m_node ? m_node->GetNext() : m_init; \ return tmp; \ } \ bool operator!=(const itor& it) const \ { return it.m_node != m_node; } \ bool operator==(const itor& it) const \ { return it.m_node == m_node; } \ }; \ classexp const_reverse_iterator \ { \ public: \ WX_DECLARE_LIST_ITER_DIFF_AND_CATEGORY() \ typedef T* value_type; \ typedef const value_type* pointer; \ typedef const value_type& reference; \ \ typedef nodetype Node; \ typedef const_reverse_iterator itor; \ \ Node* m_node; \ Node* m_init; \ public: \ typedef reference reference_type; \ typedef pointer pointer_type; \ \ const_reverse_iterator(Node* node, Node* init) \ : m_node(node), m_init(init) { } \ const_reverse_iterator() : m_node(NULL), m_init(NULL) { } \ const_reverse_iterator(const reverse_iterator& it) \ : m_node(it.m_node), m_init(it.m_init) { } \ reference_type operator*() const \ { return *(pointer_type)m_node->GetDataPtr(); } \ ptrop \ itor& operator++() \ { m_node = m_node->GetPrevious(); return *this; } \ const itor operator++(int) \ { itor tmp = *this; m_node = m_node->GetPrevious(); return tmp; }\ itor& operator--() \ { m_node = m_node ? m_node->GetNext() : m_init; return *this;}\ const itor operator--(int) \ { \ itor tmp = *this; \ m_node = m_node ? m_node->GetNext() : m_init; \ return tmp; \ } \ bool operator!=(const itor& it) const \ { return it.m_node != m_node; } \ bool operator==(const itor& it) const \ { return it.m_node == m_node; } \ }; \ \ explicit name(size_type n, const_reference v = value_type()) \ { assign(n, v); } \ name(const const_iterator& first, const const_iterator& last) \ { assign(first, last); } \ iterator begin() { return iterator(GetFirst(), GetLast()); } \ const_iterator begin() const \ { return const_iterator(GetFirst(), GetLast()); } \ iterator end() { return iterator(NULL, GetLast()); } \ const_iterator end() const { return const_iterator(NULL, GetLast()); }\ reverse_iterator rbegin() \ { return reverse_iterator(GetLast(), GetFirst()); } \ const_reverse_iterator rbegin() const \ { return const_reverse_iterator(GetLast(), GetFirst()); } \ reverse_iterator rend() { return reverse_iterator(NULL, GetFirst()); }\ const_reverse_iterator rend() const \ { return const_reverse_iterator(NULL, GetFirst()); } \ void resize(size_type n, value_type v = value_type()) \ { \ while (n < size()) \ pop_back(); \ while (n > size()) \ push_back(v); \ } \ size_type size() const { return GetCount(); } \ size_type max_size() const { return INT_MAX; } \ bool empty() const { return IsEmpty(); } \ reference front() { return *begin(); } \ const_reference front() const { return *begin(); } \ reference back() { iterator tmp = end(); return *--tmp; } \ const_reference back() const { const_iterator tmp = end(); return *--tmp; }\ void push_front(const_reference v = value_type()) \ { Insert(GetFirst(), (const_base_reference)v); } \ void pop_front() { DeleteNode(GetFirst()); } \ void push_back(const_reference v = value_type()) \ { Append((const_base_reference)v); } \ void pop_back() { DeleteNode(GetLast()); } \ void assign(const_iterator first, const const_iterator& last) \ { \ clear(); \ for(; first != last; ++first) \ Append((const_base_reference)*first); \ } \ void assign(size_type n, const_reference v = value_type()) \ { \ clear(); \ for(size_type i = 0; i < n; ++i) \ Append((const_base_reference)v); \ } \ iterator insert(const iterator& it, const_reference v) \ { \ if ( it == end() ) \ { \ Append((const_base_reference)v); \ /* \ note that this is the new end(), the old one was \ invalidated by the Append() call, and this is why we \ can't use the same code as in the normal case below \ */ \ iterator itins(end()); \ return --itins; \ } \ else \ { \ Insert(it.m_node, (const_base_reference)v); \ iterator itins(it); \ return --itins; \ } \ } \ void insert(const iterator& it, size_type n, const_reference v) \ { \ for(size_type i = 0; i < n; ++i) \ insert(it, v); \ } \ void insert(const iterator& it, \ const_iterator first, const const_iterator& last) \ { \ for(; first != last; ++first) \ insert(it, *first); \ } \ iterator erase(const iterator& it) \ { \ iterator next = iterator(it.m_node->GetNext(), GetLast()); \ DeleteNode(it.m_node); return next; \ } \ iterator erase(const iterator& first, const iterator& last) \ { \ iterator next = last; \ if ( next != end() ) \ ++next; \ DeleteNodes(first.m_node, last.m_node); \ return next; \ } \ void clear() { Clear(); } \ void splice(const iterator& it, name& l, const iterator& first, const iterator& last)\ { insert(it, first, last); l.erase(first, last); } \ void splice(const iterator& it, name& l) \ { splice(it, l, l.begin(), l.end() ); } \ void splice(const iterator& it, name& l, const iterator& first) \ { \ if ( it != first ) \ { \ insert(it, *first); \ l.erase(first); \ } \ } \ void remove(const_reference v) \ { DeleteObject((const_base_reference)v); } \ void reverse() \ { Reverse(); } \ /* void swap(name& l) \ { \ { size_t t = m_count; m_count = l.m_count; l.m_count = t; } \ { bool t = m_destroy; m_destroy = l.m_destroy; l.m_destroy = t; }\ { wxNodeBase* t = m_nodeFirst; m_nodeFirst = l.m_nodeFirst; l.m_nodeFirst = t; }\ { wxNodeBase* t = m_nodeLast; m_nodeLast = l.m_nodeLast; l.m_nodeLast = t; }\ { wxKeyType t = m_keyType; m_keyType = l.m_keyType; l.m_keyType = t; }\ } */ \ } #define WX_LIST_PTROP \ pointer_type operator->() const \ { return (pointer_type)m_node->GetDataPtr(); } #define WX_LIST_PTROP_NONE #define WX_DECLARE_LIST_3(T, Tbase, name, nodetype, classexp) \ WX_DECLARE_LIST_4(T, Tbase, name, nodetype, classexp, WX_LIST_PTROP_NONE) #define WX_DECLARE_LIST_PTR_3(T, Tbase, name, nodetype, classexp) \ WX_DECLARE_LIST_4(T, Tbase, name, nodetype, classexp, WX_LIST_PTROP) #define WX_DECLARE_LIST_2(elementtype, listname, nodename, classexp) \ WX_DECLARE_LIST_3(elementtype, elementtype, listname, nodename, classexp) #define WX_DECLARE_LIST_PTR_2(elementtype, listname, nodename, classexp) \ WX_DECLARE_LIST_PTR_3(elementtype, elementtype, listname, nodename, classexp) #define WX_DECLARE_LIST(elementtype, listname) \ typedef elementtype _WX_LIST_ITEM_TYPE_##listname; \ WX_DECLARE_LIST_2(elementtype, listname, wx##listname##Node, class) #define WX_DECLARE_LIST_PTR(elementtype, listname) \ typedef elementtype _WX_LIST_ITEM_TYPE_##listname; \ WX_DECLARE_LIST_PTR_2(elementtype, listname, wx##listname##Node, class) #define WX_DECLARE_LIST_WITH_DECL(elementtype, listname, decl) \ typedef elementtype _WX_LIST_ITEM_TYPE_##listname; \ WX_DECLARE_LIST_2(elementtype, listname, wx##listname##Node, decl) #define WX_DECLARE_EXPORTED_LIST(elementtype, listname) \ WX_DECLARE_LIST_WITH_DECL(elementtype, listname, class WXDLLIMPEXP_CORE) #define WX_DECLARE_EXPORTED_LIST_PTR(elementtype, listname) \ typedef elementtype _WX_LIST_ITEM_TYPE_##listname; \ WX_DECLARE_LIST_PTR_2(elementtype, listname, wx##listname##Node, class WXDLLIMPEXP_CORE) #define WX_DECLARE_USER_EXPORTED_LIST(elementtype, listname, usergoo) \ typedef elementtype _WX_LIST_ITEM_TYPE_##listname; \ WX_DECLARE_LIST_2(elementtype, listname, wx##listname##Node, class usergoo) #define WX_DECLARE_USER_EXPORTED_LIST_PTR(elementtype, listname, usergoo) \ typedef elementtype _WX_LIST_ITEM_TYPE_##listname; \ WX_DECLARE_LIST_PTR_2(elementtype, listname, wx##listname##Node, class usergoo) // this macro must be inserted in your program after // #include "wx/listimpl.cpp" #define WX_DEFINE_LIST(name) "don't forget to include listimpl.cpp!" #define WX_DEFINE_EXPORTED_LIST(name) WX_DEFINE_LIST(name) #define WX_DEFINE_USER_EXPORTED_LIST(name) WX_DEFINE_LIST(name) #endif // !wxUSE_STD_CONTAINERS // ============================================================================ // now we can define classes 100% compatible with the old ones // ============================================================================ // ---------------------------------------------------------------------------- // commonly used list classes // ---------------------------------------------------------------------------- #if defined(wxLIST_COMPATIBILITY) // inline compatibility functions #if !wxUSE_STD_CONTAINERS // ---------------------------------------------------------------------------- // wxNodeBase deprecated methods // ---------------------------------------------------------------------------- inline wxNode *wxNodeBase::Next() const { return (wxNode *)GetNext(); } inline wxNode *wxNodeBase::Previous() const { return (wxNode *)GetPrevious(); } inline wxObject *wxNodeBase::Data() const { return (wxObject *)GetData(); } // ---------------------------------------------------------------------------- // wxListBase deprecated methods // ---------------------------------------------------------------------------- inline int wxListBase::Number() const { return (int)GetCount(); } inline wxNode *wxListBase::First() const { return (wxNode *)GetFirst(); } inline wxNode *wxListBase::Last() const { return (wxNode *)GetLast(); } inline wxNode *wxListBase::Nth(size_t n) const { return (wxNode *)Item(n); } inline wxListBase::operator wxList&() const { return *(wxList*)this; } #endif // define this to make a lot of noise about use of the old wxList classes. //#define wxWARN_COMPAT_LIST_USE // ---------------------------------------------------------------------------- // wxList compatibility class: in fact, it's a list of wxObjects // ---------------------------------------------------------------------------- WX_DECLARE_LIST_2(wxObject, wxObjectList, wxObjectListNode, class WXDLLIMPEXP_BASE); class WXDLLIMPEXP_BASE wxList : public wxObjectList { public: #if defined(wxWARN_COMPAT_LIST_USE) && !wxUSE_STD_CONTAINERS wxList() { } wxDEPRECATED( wxList(int key_type) ); #elif !wxUSE_STD_CONTAINERS wxList(int key_type = wxKEY_NONE); #endif // this destructor is required for Darwin ~wxList() { } #if !wxUSE_STD_CONTAINERS wxList& operator=(const wxList& list) { if (&list != this) Assign(list); return *this; } // compatibility methods void Sort(wxSortCompareFunction compfunc) { wxListBase::Sort(compfunc); } #endif // !wxUSE_STD_CONTAINERS template<typename T> wxVector<T> AsVector() const { wxVector<T> vector(size()); size_t i = 0; for ( const_iterator it = begin(); it != end(); ++it ) { vector[i++] = static_cast<T>(*it); } return vector; } }; #if !wxUSE_STD_CONTAINERS // ----------------------------------------------------------------------------- // wxStringList class for compatibility with the old code // ----------------------------------------------------------------------------- WX_DECLARE_LIST_2(wxChar, wxStringListBase, wxStringListNode, class WXDLLIMPEXP_BASE); class WXDLLIMPEXP_BASE wxStringList : public wxStringListBase { public: // ctors and such // default #ifdef wxWARN_COMPAT_LIST_USE wxStringList(); wxDEPRECATED( wxStringList(const wxChar *first ...) ); // FIXME-UTF8 #else wxStringList(); wxStringList(const wxChar *first ...); // FIXME-UTF8 #endif // copying the string list: the strings are copied, too (extremely // inefficient!) wxStringList(const wxStringList& other) : wxStringListBase() { DeleteContents(true); DoCopy(other); } wxStringList& operator=(const wxStringList& other) { if (&other != this) { Clear(); DoCopy(other); } return *this; } // operations // makes a copy of the string wxNode *Add(const wxChar *s); // Append to beginning of list wxNode *Prepend(const wxChar *s); bool Delete(const wxChar *s); wxChar **ListToArray(bool new_copies = false) const; bool Member(const wxChar *s) const; // alphabetic sort void Sort(); private: void DoCopy(const wxStringList&); // common part of copy ctor and operator= }; #else // if wxUSE_STD_CONTAINERS WX_DECLARE_LIST_XO(wxString, wxStringListBase, class WXDLLIMPEXP_BASE); class WXDLLIMPEXP_BASE wxStringList : public wxStringListBase { public: compatibility_iterator Append(wxChar* s) { wxString tmp = s; delete[] s; return wxStringListBase::Append(tmp); } compatibility_iterator Insert(wxChar* s) { wxString tmp = s; delete[] s; return wxStringListBase::Insert(tmp); } compatibility_iterator Insert(size_t pos, wxChar* s) { wxString tmp = s; delete[] s; return wxStringListBase::Insert(pos, tmp); } compatibility_iterator Add(const wxChar* s) { push_back(s); return GetLast(); } compatibility_iterator Prepend(const wxChar* s) { push_front(s); return GetFirst(); } }; #endif // wxUSE_STD_CONTAINERS #endif // wxLIST_COMPATIBILITY // delete all list elements // // NB: the class declaration of the list 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_LIST(type, list) \ { \ type::iterator it, en; \ for( it = (list).begin(), en = (list).end(); it != en; ++it ) \ delete *it; \ (list).clear(); \ } // append all element of one list to another one #define WX_APPEND_LIST(list, other) \ { \ wxList::compatibility_iterator node = other->GetFirst(); \ while ( node ) \ { \ (list)->push_back(node->GetData()); \ node = node->GetNext(); \ } \ } #endif // _WX_LISTH__
h
rticonnextdds-usecases
data/projects/rticonnextdds-usecases/VehicleTracking/ExampleCode/thirdparty/wxWidgets-3.1.2/Win64/include/wx/richtooltip.h
/////////////////////////////////////////////////////////////////////////////// // Name: wx/richtooltip.h // Purpose: Declaration of wxRichToolTip class. // Author: Vadim Zeitlin // Created: 2011-10-07 // Copyright: (c) 2011 Vadim Zeitlin <[email protected]> // Licence: wxWindows licence /////////////////////////////////////////////////////////////////////////////// #ifndef _WX_RICHTOOLTIP_H_ #define _WX_RICHTOOLTIP_H_ #include "wx/defs.h" #if wxUSE_RICHTOOLTIP #include "wx/colour.h" class WXDLLIMPEXP_FWD_CORE wxFont; class WXDLLIMPEXP_FWD_CORE wxIcon; class WXDLLIMPEXP_FWD_CORE wxWindow; class wxRichToolTipImpl; // This enum describes the kind of the tip shown which combines both the tip // position and appearance because the two are related (when the tip is // positioned asymmetrically, a right handed triangle is used but an // equilateral one when it's in the middle of a side). // // Automatic selects the tip appearance best suited for the current platform // and the position best suited for the window the tooltip is shown for, i.e. // chosen in such a way that the tooltip is always fully on screen. // // Other values describe the position of the tooltip itself, not the window it // relates to. E.g. wxTipKind_Top places the tip on the top of the tooltip and // so the tooltip itself is located beneath its associated window. enum wxTipKind { wxTipKind_None, wxTipKind_TopLeft, wxTipKind_Top, wxTipKind_TopRight, wxTipKind_BottomLeft, wxTipKind_Bottom, wxTipKind_BottomRight, wxTipKind_Auto }; // ---------------------------------------------------------------------------- // wxRichToolTip: a customizable but not necessarily native tooltip. // ---------------------------------------------------------------------------- // Notice that this class does not inherit from wxWindow. class WXDLLIMPEXP_ADV wxRichToolTip { public: // Ctor must specify the tooltip title and main message, additional // attributes can be set later. wxRichToolTip(const wxString& title, const wxString& message); // Set the background colour: if two colours are specified, the background // is drawn using a gradient from top to bottom, otherwise a single solid // colour is used. void SetBackgroundColour(const wxColour& col, const wxColour& colEnd = wxColour()); // Set the small icon to show: either one of the standard information/ // warning/error ones (the question icon doesn't make sense for a tooltip) // or a custom icon. void SetIcon(int icon = wxICON_INFORMATION); void SetIcon(const wxIcon& icon); // Set timeout after which the tooltip should disappear, in milliseconds. // By default the tooltip is hidden after system-dependent interval of time // elapses but this method can be used to change this or also disable // hiding the tooltip automatically entirely by passing 0 in this parameter // (but doing this can result in native version not being used). // Optionally specify a show delay. void SetTimeout(unsigned milliseconds, unsigned millisecondsShowdelay = 0); // Choose the tip kind, possibly none. By default the tip is positioned // automatically, as if wxTipKind_Auto was used. void SetTipKind(wxTipKind tipKind); // Set the title text font. By default it's emphasized using the font style // or colour appropriate for the current platform. void SetTitleFont(const wxFont& font); // Show the tooltip for the given window and optionally a specified area. void ShowFor(wxWindow* win, const wxRect* rect = NULL); // Non-virtual dtor as this class is not supposed to be derived from. ~wxRichToolTip(); private: wxRichToolTipImpl* const m_impl; wxDECLARE_NO_COPY_CLASS(wxRichToolTip); }; #endif // wxUSE_RICHTOOLTIP #endif // _WX_RICHTOOLTIP_H_
h
rticonnextdds-usecases
data/projects/rticonnextdds-usecases/VehicleTracking/ExampleCode/thirdparty/wxWidgets-3.1.2/Win64/include/wx/evtloop.h
/////////////////////////////////////////////////////////////////////////////// // Name: wx/evtloop.h // Purpose: declares wxEventLoop class // Author: Vadim Zeitlin // Modified by: // Created: 01.06.01 // Copyright: (c) 2001 Vadim Zeitlin <[email protected]> // Licence: wxWindows licence /////////////////////////////////////////////////////////////////////////////// #ifndef _WX_EVTLOOP_H_ #define _WX_EVTLOOP_H_ #include "wx/event.h" #include "wx/utils.h" // TODO: implement wxEventLoopSource for MSW (it should wrap a HANDLE and be // monitored using MsgWaitForMultipleObjects()) #if defined(__WXOSX__) || (defined(__UNIX__) && !defined(__WINDOWS__)) #define wxUSE_EVENTLOOP_SOURCE 1 #else #define wxUSE_EVENTLOOP_SOURCE 0 #endif #if wxUSE_EVENTLOOP_SOURCE class wxEventLoopSource; class wxEventLoopSourceHandler; #endif /* NOTE ABOUT wxEventLoopBase::YieldFor LOGIC ------------------------------------------ The YieldFor() function helps to avoid re-entrancy problems and problems caused by out-of-order event processing (see "wxYield-like problems" and "wxProgressDialog+threading BUG" wx-dev threads). The logic behind YieldFor() is simple: it analyzes the queue of the native events generated by the underlying GUI toolkit and picks out and processes only those matching the given mask. It's important to note that YieldFor() is used to selectively process the events generated by the NATIVE toolkit. Events syntethized by wxWidgets code or by user code are instead selectively processed thanks to the logic built into wxEvtHandler::ProcessPendingEvents(). In fact, when wxEvtHandler::ProcessPendingEvents gets called from inside a YieldFor() call, wxEventLoopBase::IsEventAllowedInsideYield is used to decide if the pending events for that event handler can be processed. If all the pending events associated with that event handler result as "not processable", the event handler "delays" itself calling wxEventLoopBase::DelayPendingEventHandler (so it's moved: m_handlersWithPendingEvents => m_handlersWithPendingDelayedEvents). Last, wxEventLoopBase::ProcessPendingEvents() before exiting moves the delayed event handlers back into the list of handlers with pending events (m_handlersWithPendingDelayedEvents => m_handlersWithPendingEvents) so that a later call to ProcessPendingEvents() (possibly outside the YieldFor() call) will process all pending events as usual. */ // ---------------------------------------------------------------------------- // wxEventLoopBase: interface for wxEventLoop // ---------------------------------------------------------------------------- class WXDLLIMPEXP_BASE wxEventLoopBase { public: wxEventLoopBase(); virtual ~wxEventLoopBase(); // use this to check whether the event loop was successfully created before // using it virtual bool IsOk() const { return true; } // returns true if this is the main loop bool IsMain() const; #if wxUSE_EVENTLOOP_SOURCE // create a new event loop source wrapping the given file descriptor and // monitor it for events occurring on this descriptor in all event loops static wxEventLoopSource * AddSourceForFD(int fd, wxEventLoopSourceHandler *handler, int flags); #endif // wxUSE_EVENTLOOP_SOURCE // dispatch&processing // ------------------- // start the event loop, return the exit code when it is finished // // notice that wx ports should override DoRun(), this method is virtual // only to allow overriding it in the user code for custom event loops virtual int Run(); // is this event loop running now? // // notice that even if this event loop hasn't terminated yet but has just // spawned a nested (e.g. modal) event loop, this would return false bool IsRunning() const; // exit from the loop with the given exit code // // this can be only used to exit the currently running loop, use // ScheduleExit() if this might not be the case virtual void Exit(int rc = 0); // ask the event loop to exit with the given exit code, can be used even if // this loop is not running right now but the loop must have been started, // i.e. Run() should have been already called virtual void ScheduleExit(int rc = 0) = 0; // return true if any events are available virtual bool Pending() const = 0; // dispatch a single event, return false if we should exit from the loop virtual bool Dispatch() = 0; // same as Dispatch() but doesn't wait for longer than the specified (in // ms) timeout, return true if an event was processed, false if we should // exit the loop or -1 if timeout expired virtual int DispatchTimeout(unsigned long timeout) = 0; // implement this to wake up the loop: usually done by posting a dummy event // to it (can be called from non main thread) virtual void WakeUp() = 0; // idle handling // ------------- // make sure that idle events are sent again: this is just an obsolete // synonym for WakeUp() void WakeUpIdle() { WakeUp(); } // this virtual function is called when the application // becomes idle and by default it forwards to wxApp::ProcessIdle() and // while it can be overridden in a custom event loop, you must call the // base class version to ensure that idle events are still generated // // it should return true if more idle events are needed, false if not virtual bool ProcessIdle(); // Yield-related hooks // ------------------- // process all currently pending events right now // // if onlyIfNeeded is true, returns false without doing anything else if // we're already inside Yield() // // WARNING: this function is dangerous as it can lead to unexpected // reentrancies (i.e. when called from an event handler it // may result in calling the same event handler again), use // with _extreme_ care or, better, don't use at all! bool Yield(bool onlyIfNeeded = false); // more selective version of Yield() // // notice that it is virtual for backwards-compatibility but new code // should override DoYieldFor() and not YieldFor() itself virtual bool YieldFor(long eventsToProcess); // returns true if the main thread is inside a Yield() call virtual bool IsYielding() const { return m_yieldLevel != 0; } // returns true if events of the given event category should be immediately // processed inside a wxApp::Yield() call or rather should be queued for // later processing by the main event loop virtual bool IsEventAllowedInsideYield(wxEventCategory cat) const { return (m_eventsToProcessInsideYield & cat) != 0; } // no SafeYield hooks since it uses wxWindow which is not available when wxUSE_GUI=0 // active loop // ----------- // return currently active (running) event loop, may be NULL static wxEventLoopBase *GetActive() { return ms_activeLoop; } // set currently active (running) event loop static void SetActive(wxEventLoopBase* loop); protected: // real implementation of Run() virtual int DoRun() = 0; // And the real, port-specific, implementation of YieldFor(). // // The base class version is pure virtual to ensure that it is overridden // in the derived classes but does have an implementation which processes // pending events in wxApp if eventsToProcess allows it, and so should be // called from the overridden version at an appropriate place (i.e. after // processing the native events but before doing anything else that could // be affected by pending events dispatching). virtual void DoYieldFor(long eventsToProcess) = 0; // this function should be called before the event loop terminates, whether // this happens normally (because of Exit() call) or abnormally (because of // an exception thrown from inside the loop) virtual void OnExit(); // Return true if we're currently inside our Run(), even if another nested // event loop is currently running, unlike IsRunning() (which should have // been really called IsActive() but it's too late to change this now). bool IsInsideRun() const { return m_isInsideRun; } // the pointer to currently active loop static wxEventLoopBase *ms_activeLoop; // should we exit the loop? bool m_shouldExit; // incremented each time on entering Yield() and decremented on leaving it int m_yieldLevel; // the argument of the last call to YieldFor() long m_eventsToProcessInsideYield; private: // this flag is set on entry into Run() and reset before leaving it bool m_isInsideRun; wxDECLARE_NO_COPY_CLASS(wxEventLoopBase); }; #if defined(__WINDOWS__) || defined(__WXMAC__) || defined(__WXDFB__) || (defined(__UNIX__) && !defined(__WXOSX__)) // this class can be used to implement a standard event loop logic using // Pending() and Dispatch() // // it also handles idle processing automatically class WXDLLIMPEXP_BASE wxEventLoopManual : public wxEventLoopBase { public: wxEventLoopManual(); // sets the "should exit" flag and wakes up the loop so that it terminates // soon virtual void ScheduleExit(int rc = 0) wxOVERRIDE; protected: // enters a loop calling OnNextIteration(), Pending() and Dispatch() and // terminating when Exit() is called virtual int DoRun() wxOVERRIDE; // may be overridden to perform some action at the start of each new event // loop iteration virtual void OnNextIteration() { } // the loop exit code int m_exitcode; private: // process all already pending events and dispatch a new one (blocking // until it appears in the event queue if necessary) // // returns the return value of Dispatch() bool ProcessEvents(); wxDECLARE_NO_COPY_CLASS(wxEventLoopManual); }; #endif // platforms using "manual" loop // we're moving away from old m_impl wxEventLoop model as otherwise the user // code doesn't have access to platform-specific wxEventLoop methods and this // can sometimes be very useful (e.g. under MSW this is necessary for // integration with MFC) but currently this is not done for all ports yet (e.g. // wxX11) so fall back to the old wxGUIEventLoop definition below for them #if defined(__DARWIN__) // CoreFoundation-based event loop is currently in wxBase so include it in // any case too (although maybe it actually shouldn't be there at all) #include "wx/osx/core/evtloop.h" #endif // include the header defining wxConsoleEventLoop #if defined(__UNIX__) && !defined(__WINDOWS__) #include "wx/unix/evtloop.h" #elif defined(__WINDOWS__) #include "wx/msw/evtloopconsole.h" #endif #if wxUSE_GUI // include the appropriate header defining wxGUIEventLoop #if defined(__WXMSW__) #include "wx/msw/evtloop.h" #elif defined(__WXOSX__) #include "wx/osx/evtloop.h" #elif defined(__WXDFB__) #include "wx/dfb/evtloop.h" #elif defined(__WXGTK20__) #include "wx/gtk/evtloop.h" #elif defined(__WXQT__) #include "wx/qt/evtloop.h" #else // other platform #include "wx/stopwatch.h" // for wxMilliClock_t class WXDLLIMPEXP_FWD_CORE wxEventLoopImpl; class WXDLLIMPEXP_CORE wxGUIEventLoop : public wxEventLoopBase { public: wxGUIEventLoop() { m_impl = NULL; } virtual ~wxGUIEventLoop(); virtual void ScheduleExit(int rc = 0); virtual bool Pending() const; virtual bool Dispatch(); virtual int DispatchTimeout(unsigned long timeout) { // TODO: this is, of course, horribly inefficient and a proper wait with // timeout should be implemented for all ports natively... const wxMilliClock_t timeEnd = wxGetLocalTimeMillis() + timeout; for ( ;; ) { if ( Pending() ) return Dispatch(); if ( wxGetLocalTimeMillis() >= timeEnd ) return -1; } } virtual void WakeUp() { } protected: virtual int DoRun(); virtual void DoYieldFor(long eventsToProcess); // the pointer to the port specific implementation class wxEventLoopImpl *m_impl; wxDECLARE_NO_COPY_CLASS(wxGUIEventLoop); }; #endif // platforms #endif // wxUSE_GUI #if wxUSE_GUI // we use a class rather than a typedef because wxEventLoop is // forward-declared in many places class wxEventLoop : public wxGUIEventLoop { }; #else // !wxUSE_GUI // we can't define wxEventLoop differently in GUI and base libraries so use // a #define to still allow writing wxEventLoop in the user code #if wxUSE_CONSOLE_EVENTLOOP && (defined(__WINDOWS__) || defined(__UNIX__)) #define wxEventLoop wxConsoleEventLoop #else // we still must define it somehow for the code below... #define wxEventLoop wxEventLoopBase #endif #endif inline bool wxEventLoopBase::IsRunning() const { return GetActive() == this; } #if wxUSE_GUI && !defined(__WXOSX__) // ---------------------------------------------------------------------------- // wxModalEventLoop // ---------------------------------------------------------------------------- // this is a naive generic implementation which uses wxWindowDisabler to // implement modality, we will surely need platform-specific implementations // too, this generic implementation is here only temporarily to see how it // works class WXDLLIMPEXP_CORE wxModalEventLoop : public wxGUIEventLoop { public: wxModalEventLoop(wxWindow *winModal) { m_windowDisabler = new wxWindowDisabler(winModal); } protected: virtual void OnExit() wxOVERRIDE { delete m_windowDisabler; m_windowDisabler = NULL; wxGUIEventLoop::OnExit(); } private: wxWindowDisabler *m_windowDisabler; }; #endif //wxUSE_GUI // ---------------------------------------------------------------------------- // wxEventLoopActivator: helper class for wxEventLoop implementations // ---------------------------------------------------------------------------- // this object sets the wxEventLoop given to the ctor as the currently active // one and unsets it in its dtor, this is especially useful in presence of // exceptions but is more tidy even when we don't use them class wxEventLoopActivator { public: wxEventLoopActivator(wxEventLoopBase *evtLoop) { m_evtLoopOld = wxEventLoopBase::GetActive(); wxEventLoopBase::SetActive(evtLoop); } ~wxEventLoopActivator() { // restore the previously active event loop wxEventLoopBase::SetActive(m_evtLoopOld); } private: wxEventLoopBase *m_evtLoopOld; }; #if wxUSE_GUI || wxUSE_CONSOLE_EVENTLOOP class wxEventLoopGuarantor { public: wxEventLoopGuarantor() { m_evtLoopNew = NULL; if (!wxEventLoop::GetActive()) { m_evtLoopNew = new wxEventLoop; wxEventLoop::SetActive(m_evtLoopNew); } } ~wxEventLoopGuarantor() { if (m_evtLoopNew) { wxEventLoop::SetActive(NULL); delete m_evtLoopNew; } } private: wxEventLoop *m_evtLoopNew; }; #endif // wxUSE_GUI || wxUSE_CONSOLE_EVENTLOOP #endif // _WX_EVTLOOP_H_
h
rticonnextdds-usecases
data/projects/rticonnextdds-usecases/VehicleTracking/ExampleCode/thirdparty/wxWidgets-3.1.2/Win64/include/wx/listbase.h
/////////////////////////////////////////////////////////////////////////////// // Name: wx/listbase.h // Purpose: wxListCtrl class // Author: Vadim Zeitlin // Modified by: // Created: 04.12.99 // Copyright: (c) wxWidgets team // Licence: wxWindows licence /////////////////////////////////////////////////////////////////////////////// #ifndef _WX_LISTBASE_H_BASE_ #define _WX_LISTBASE_H_BASE_ #include "wx/colour.h" #include "wx/font.h" #include "wx/gdicmn.h" #include "wx/event.h" #include "wx/control.h" #include "wx/itemattr.h" #include "wx/systhemectrl.h" class WXDLLIMPEXP_FWD_CORE wxImageList; // ---------------------------------------------------------------------------- // types // ---------------------------------------------------------------------------- // type of compare function for wxListCtrl sort operation typedef int (wxCALLBACK *wxListCtrlCompare)(wxIntPtr item1, wxIntPtr item2, wxIntPtr sortData); // ---------------------------------------------------------------------------- // wxListCtrl constants // ---------------------------------------------------------------------------- // style flags #define wxLC_VRULES 0x0001 #define wxLC_HRULES 0x0002 #define wxLC_ICON 0x0004 #define wxLC_SMALL_ICON 0x0008 #define wxLC_LIST 0x0010 #define wxLC_REPORT 0x0020 #define wxLC_ALIGN_TOP 0x0040 #define wxLC_ALIGN_LEFT 0x0080 #define wxLC_AUTOARRANGE 0x0100 #define wxLC_VIRTUAL 0x0200 #define wxLC_EDIT_LABELS 0x0400 #define wxLC_NO_HEADER 0x0800 #define wxLC_NO_SORT_HEADER 0x1000 #define wxLC_SINGLE_SEL 0x2000 #define wxLC_SORT_ASCENDING 0x4000 #define wxLC_SORT_DESCENDING 0x8000 #define wxLC_MASK_TYPE (wxLC_ICON | wxLC_SMALL_ICON | wxLC_LIST | wxLC_REPORT) #define wxLC_MASK_ALIGN (wxLC_ALIGN_TOP | wxLC_ALIGN_LEFT) #define wxLC_MASK_SORT (wxLC_SORT_ASCENDING | wxLC_SORT_DESCENDING) // for compatibility only #define wxLC_USER_TEXT wxLC_VIRTUAL // Omitted because // (a) too much detail // (b) not enough style flags // (c) not implemented anyhow in the generic version // // #define wxLC_NO_SCROLL // #define wxLC_NO_LABEL_WRAP // #define wxLC_OWNERDRAW_FIXED // #define wxLC_SHOW_SEL_ALWAYS // Mask flags to tell app/GUI what fields of wxListItem are valid #define wxLIST_MASK_STATE 0x0001 #define wxLIST_MASK_TEXT 0x0002 #define wxLIST_MASK_IMAGE 0x0004 #define wxLIST_MASK_DATA 0x0008 #define wxLIST_SET_ITEM 0x0010 #define wxLIST_MASK_WIDTH 0x0020 #define wxLIST_MASK_FORMAT 0x0040 // State flags for indicating the state of an item #define wxLIST_STATE_DONTCARE 0x0000 #define wxLIST_STATE_DROPHILITED 0x0001 // MSW only #define wxLIST_STATE_FOCUSED 0x0002 #define wxLIST_STATE_SELECTED 0x0004 #define wxLIST_STATE_CUT 0x0008 // MSW only #define wxLIST_STATE_DISABLED 0x0010 // Not used #define wxLIST_STATE_FILTERED 0x0020 // Not used #define wxLIST_STATE_INUSE 0x0040 // Not used #define wxLIST_STATE_PICKED 0x0080 // Not used #define wxLIST_STATE_SOURCE 0x0100 // Not used // Hit test flags, used in HitTest #define wxLIST_HITTEST_ABOVE 0x0001 // Above the control's client area. #define wxLIST_HITTEST_BELOW 0x0002 // Below the control's client area. #define wxLIST_HITTEST_NOWHERE 0x0004 // Inside the control's client area but not over an item. #define wxLIST_HITTEST_ONITEMICON 0x0020 // Over an item's icon. #define wxLIST_HITTEST_ONITEMLABEL 0x0080 // Over an item's text. #define wxLIST_HITTEST_ONITEMRIGHT 0x0100 // Not used #define wxLIST_HITTEST_ONITEMSTATEICON 0x0200 // Over the checkbox of an item. #define wxLIST_HITTEST_TOLEFT 0x0400 // To the left of the control's client area. #define wxLIST_HITTEST_TORIGHT 0x0800 // To the right of the control's client area. #define wxLIST_HITTEST_ONITEM (wxLIST_HITTEST_ONITEMICON | wxLIST_HITTEST_ONITEMLABEL | wxLIST_HITTEST_ONITEMSTATEICON) // GetSubItemRect constants #define wxLIST_GETSUBITEMRECT_WHOLEITEM -1l // Flags for GetNextItem (MSW only except wxLIST_NEXT_ALL) enum { wxLIST_NEXT_ABOVE, // Searches for an item above the specified item wxLIST_NEXT_ALL, // Searches for subsequent item by index wxLIST_NEXT_BELOW, // Searches for an item below the specified item wxLIST_NEXT_LEFT, // Searches for an item to the left of the specified item wxLIST_NEXT_RIGHT // Searches for an item to the right of the specified item }; // Alignment flags for Arrange (MSW only except wxLIST_ALIGN_LEFT) enum { wxLIST_ALIGN_DEFAULT, wxLIST_ALIGN_LEFT, wxLIST_ALIGN_TOP, wxLIST_ALIGN_SNAP_TO_GRID }; // Column format (MSW only except wxLIST_FORMAT_LEFT) enum wxListColumnFormat { wxLIST_FORMAT_LEFT, wxLIST_FORMAT_RIGHT, wxLIST_FORMAT_CENTRE, wxLIST_FORMAT_CENTER = wxLIST_FORMAT_CENTRE }; // Autosize values for SetColumnWidth enum { wxLIST_AUTOSIZE = -1, wxLIST_AUTOSIZE_USEHEADER = -2 // partly supported by generic version }; // Flag values for GetItemRect enum { wxLIST_RECT_BOUNDS, wxLIST_RECT_ICON, wxLIST_RECT_LABEL }; // Flag values for FindItem (MSW only) enum { wxLIST_FIND_UP, wxLIST_FIND_DOWN, wxLIST_FIND_LEFT, wxLIST_FIND_RIGHT }; // For compatibility, define the old name for this class. There is no need to // deprecate it as it doesn't cost us anything to keep this typedef, but the // new code should prefer to use the new wxItemAttr name. typedef wxItemAttr wxListItemAttr; // ---------------------------------------------------------------------------- // wxListItem: the item or column info, used to exchange data with wxListCtrl // ---------------------------------------------------------------------------- class WXDLLIMPEXP_CORE wxListItem : public wxObject { public: wxListItem() { Init(); m_attr = NULL; } wxListItem(const wxListItem& item) : wxObject(), m_mask(item.m_mask), m_itemId(item.m_itemId), m_col(item.m_col), m_state(item.m_state), m_stateMask(item.m_stateMask), m_text(item.m_text), m_image(item.m_image), m_data(item.m_data), m_format(item.m_format), m_width(item.m_width), m_attr(NULL) { // copy list item attributes if ( item.HasAttributes() ) m_attr = new wxItemAttr(*item.GetAttributes()); } wxListItem& operator=(const wxListItem& item) { if ( &item != this ) { m_mask = item.m_mask; m_itemId = item.m_itemId; m_col = item.m_col; m_state = item.m_state; m_stateMask = item.m_stateMask; m_text = item.m_text; m_image = item.m_image; m_data = item.m_data; m_format = item.m_format; m_width = item.m_width; m_attr = item.m_attr ? new wxItemAttr(*item.m_attr) : NULL; } return *this; } virtual ~wxListItem() { delete m_attr; } // resetting void Clear() { Init(); m_text.clear(); ClearAttributes(); } void ClearAttributes() { if ( m_attr ) { delete m_attr; m_attr = NULL; } } // setters void SetMask(long mask) { m_mask = mask; } void SetId(long id) { m_itemId = id; } void SetColumn(int col) { m_col = col; } void SetState(long state) { m_mask |= wxLIST_MASK_STATE; m_state = state; m_stateMask |= state; } void SetStateMask(long stateMask) { m_stateMask = stateMask; } void SetText(const wxString& text) { m_mask |= wxLIST_MASK_TEXT; m_text = text; } void SetImage(int image) { m_mask |= wxLIST_MASK_IMAGE; m_image = image; } void SetData(long data) { m_mask |= wxLIST_MASK_DATA; m_data = data; } void SetData(void *data) { m_mask |= wxLIST_MASK_DATA; m_data = wxPtrToUInt(data); } void SetWidth(int width) { m_mask |= wxLIST_MASK_WIDTH; m_width = width; } void SetAlign(wxListColumnFormat align) { m_mask |= wxLIST_MASK_FORMAT; m_format = align; } void SetTextColour(const wxColour& colText) { Attributes().SetTextColour(colText); } void SetBackgroundColour(const wxColour& colBack) { Attributes().SetBackgroundColour(colBack); } void SetFont(const wxFont& font) { Attributes().SetFont(font); } // accessors long GetMask() const { return m_mask; } long GetId() const { return m_itemId; } int GetColumn() const { return m_col; } long GetState() const { return m_state & m_stateMask; } const wxString& GetText() const { return m_text; } int GetImage() const { return m_image; } wxUIntPtr GetData() const { return m_data; } int GetWidth() const { return m_width; } wxListColumnFormat GetAlign() const { return (wxListColumnFormat)m_format; } wxItemAttr *GetAttributes() const { return m_attr; } bool HasAttributes() const { return m_attr != NULL; } wxColour GetTextColour() const { return HasAttributes() ? m_attr->GetTextColour() : wxNullColour; } wxColour GetBackgroundColour() const { return HasAttributes() ? m_attr->GetBackgroundColour() : wxNullColour; } wxFont GetFont() const { return HasAttributes() ? m_attr->GetFont() : wxNullFont; } // this conversion is necessary to make old code using GetItem() to // compile operator long() const { return m_itemId; } // these members are public for compatibility long m_mask; // Indicates what fields are valid long m_itemId; // The zero-based item position int m_col; // Zero-based column, if in report mode long m_state; // The state of the item long m_stateMask;// Which flags of m_state are valid (uses same flags) wxString m_text; // The label/header text int m_image; // The zero-based index into an image list wxUIntPtr m_data; // App-defined data // For columns only int m_format; // left, right, centre int m_width; // width of column protected: // creates m_attr if we don't have it yet wxItemAttr& Attributes() { if ( !m_attr ) m_attr = new wxItemAttr; return *m_attr; } void Init() { m_mask = 0; m_itemId = -1; m_col = 0; m_state = 0; m_stateMask = 0; m_image = -1; m_data = 0; m_format = wxLIST_FORMAT_CENTRE; m_width = 0; } wxItemAttr *m_attr; // optional pointer to the items style private: wxDECLARE_DYNAMIC_CLASS(wxListItem); }; // ---------------------------------------------------------------------------- // wxListCtrlBase: the base class for the main control itself. // ---------------------------------------------------------------------------- // Unlike other base classes, this class doesn't currently define the API of // the real control class but is just used for implementation convenience. We // should define the public class functions as pure virtual here in the future // however. class WXDLLIMPEXP_CORE wxListCtrlBase : public wxSystemThemedControl<wxControl> { public: wxListCtrlBase() { } // Image list methods. // ------------------- // Associate the given (possibly NULL to indicate that no images will be // used) image list with the control. The ownership of the image list // passes to the control, i.e. it will be deleted when the control itself // is destroyed. // // The value of "which" must be one of wxIMAGE_LIST_{NORMAL,SMALL,STATE}. virtual void AssignImageList(wxImageList* imageList, int which) = 0; // Same as AssignImageList() but the control does not delete the image list // so it can be shared among several controls. virtual void SetImageList(wxImageList* imageList, int which) = 0; // Return the currently used image list, may be NULL. virtual wxImageList* GetImageList(int which) const = 0; // Column-related methods. // ----------------------- // All these methods can only be used in report view mode. // Appends a new column. // // Returns the index of the newly inserted column or -1 on error. long AppendColumn(const wxString& heading, wxListColumnFormat format = wxLIST_FORMAT_LEFT, int width = -1); // Add a new column to the control at the position "col". // // Returns the index of the newly inserted column or -1 on error. long InsertColumn(long col, const wxListItem& info); long InsertColumn(long col, const wxString& heading, int format = wxLIST_FORMAT_LEFT, int width = wxLIST_AUTOSIZE); // Delete the given or all columns. virtual bool DeleteColumn(int col) = 0; virtual bool DeleteAllColumns() = 0; // Return the current number of columns. virtual int GetColumnCount() const = 0; // Get or update information about the given column. Set item mask to // indicate the fields to retrieve or change. // // Returns false on error, e.g. if the column index is invalid. virtual bool GetColumn(int col, wxListItem& item) const = 0; virtual bool SetColumn(int col, const wxListItem& item) = 0; // Convenient wrappers for the above methods which get or update just the // column width. virtual int GetColumnWidth(int col) const = 0; virtual bool SetColumnWidth(int col, int width) = 0; // return the attribute for the item (may return NULL if none) virtual wxItemAttr *OnGetItemAttr(long item) const; // Other miscellaneous accessors. // ------------------------------ // Convenient functions for testing the list control mode: bool InReportView() const { return HasFlag(wxLC_REPORT); } bool IsVirtual() const { return HasFlag(wxLC_VIRTUAL); } // 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) { } void EnableAlternateRowColours(bool enable = true); void SetAlternateRowColour(const wxColour& colour); wxColour GetAlternateRowColour() const { return m_alternateRowColour.GetBackgroundColour(); } // Header attributes support: only implemented in wxMSW currently. virtual bool SetHeaderAttr(const wxItemAttr& WXUNUSED(attr)) { return false; } // Checkboxes support. virtual bool HasCheckBoxes() const { return false; } virtual bool EnableCheckBoxes(bool WXUNUSED(enable) = true) { return false; } virtual bool IsItemChecked(long WXUNUSED(item)) const { return false; } virtual void CheckItem(long WXUNUSED(item), bool WXUNUSED(check)) { } protected: // Real implementations methods to which our public forwards. virtual long DoInsertColumn(long col, const wxListItem& info) = 0; // Overridden methods of the base class. virtual wxSize DoGetBestClientSize() const wxOVERRIDE; private: // user defined color to draw row lines, may be invalid wxItemAttr m_alternateRowColour; }; // ---------------------------------------------------------------------------- // wxListEvent - the event class for the wxListCtrl notifications // ---------------------------------------------------------------------------- class WXDLLIMPEXP_CORE wxListEvent : public wxNotifyEvent { public: wxListEvent(wxEventType commandType = wxEVT_NULL, int winid = 0) : wxNotifyEvent(commandType, winid) , m_code(-1) , m_oldItemIndex(-1) , m_itemIndex(-1) , m_col(-1) , m_pointDrag() , m_item() , m_editCancelled(false) { } wxListEvent(const wxListEvent& event) : wxNotifyEvent(event) , m_code(event.m_code) , m_oldItemIndex(event.m_oldItemIndex) , m_itemIndex(event.m_itemIndex) , m_col(event.m_col) , m_pointDrag(event.m_pointDrag) , m_item(event.m_item) , m_editCancelled(event.m_editCancelled) { } int GetKeyCode() const { return m_code; } long GetIndex() const { return m_itemIndex; } int GetColumn() const { return m_col; } wxPoint GetPoint() const { return m_pointDrag; } const wxString& GetLabel() const { return m_item.m_text; } const wxString& GetText() const { return m_item.m_text; } int GetImage() const { return m_item.m_image; } wxUIntPtr GetData() const { return m_item.m_data; } long GetMask() const { return m_item.m_mask; } const wxListItem& GetItem() const { return m_item; } void SetKeyCode(int code) { m_code = code; } void SetIndex(long index) { m_itemIndex = index; } void SetColumn(int col) { m_col = col; } void SetPoint(const wxPoint& point) { m_pointDrag = point; } void SetItem(const wxListItem& item) { m_item = item; } // for wxEVT_LIST_CACHE_HINT only long GetCacheFrom() const { return m_oldItemIndex; } long GetCacheTo() const { return m_itemIndex; } void SetCacheFrom(long cacheFrom) { m_oldItemIndex = cacheFrom; } void SetCacheTo(long cacheTo) { m_itemIndex = cacheTo; } // was label editing canceled? (for wxEVT_LIST_END_LABEL_EDIT only) bool IsEditCancelled() const { return m_editCancelled; } void SetEditCanceled(bool editCancelled) { m_editCancelled = editCancelled; } virtual wxEvent *Clone() const wxOVERRIDE { return new wxListEvent(*this); } //protected: -- not for backwards compatibility int m_code; long m_oldItemIndex; // only for wxEVT_LIST_CACHE_HINT long m_itemIndex; int m_col; wxPoint m_pointDrag; wxListItem m_item; protected: bool m_editCancelled; private: wxDECLARE_DYNAMIC_CLASS_NO_ASSIGN(wxListEvent); }; // ---------------------------------------------------------------------------- // wxListCtrl event macros // ---------------------------------------------------------------------------- wxDECLARE_EXPORTED_EVENT( WXDLLIMPEXP_CORE, wxEVT_LIST_BEGIN_DRAG, wxListEvent ); wxDECLARE_EXPORTED_EVENT( WXDLLIMPEXP_CORE, wxEVT_LIST_BEGIN_RDRAG, wxListEvent ); wxDECLARE_EXPORTED_EVENT( WXDLLIMPEXP_CORE, wxEVT_LIST_BEGIN_LABEL_EDIT, wxListEvent ); wxDECLARE_EXPORTED_EVENT( WXDLLIMPEXP_CORE, wxEVT_LIST_END_LABEL_EDIT, wxListEvent ); wxDECLARE_EXPORTED_EVENT( WXDLLIMPEXP_CORE, wxEVT_LIST_DELETE_ITEM, wxListEvent ); wxDECLARE_EXPORTED_EVENT( WXDLLIMPEXP_CORE, wxEVT_LIST_DELETE_ALL_ITEMS, wxListEvent ); wxDECLARE_EXPORTED_EVENT( WXDLLIMPEXP_CORE, wxEVT_LIST_ITEM_SELECTED, wxListEvent ); wxDECLARE_EXPORTED_EVENT( WXDLLIMPEXP_CORE, wxEVT_LIST_ITEM_DESELECTED, wxListEvent ); wxDECLARE_EXPORTED_EVENT( WXDLLIMPEXP_CORE, wxEVT_LIST_KEY_DOWN, wxListEvent ); wxDECLARE_EXPORTED_EVENT( WXDLLIMPEXP_CORE, wxEVT_LIST_INSERT_ITEM, wxListEvent ); wxDECLARE_EXPORTED_EVENT( WXDLLIMPEXP_CORE, wxEVT_LIST_COL_CLICK, wxListEvent ); wxDECLARE_EXPORTED_EVENT( WXDLLIMPEXP_CORE, wxEVT_LIST_ITEM_RIGHT_CLICK, wxListEvent ); wxDECLARE_EXPORTED_EVENT( WXDLLIMPEXP_CORE, wxEVT_LIST_ITEM_MIDDLE_CLICK, wxListEvent ); wxDECLARE_EXPORTED_EVENT( WXDLLIMPEXP_CORE, wxEVT_LIST_ITEM_ACTIVATED, wxListEvent ); wxDECLARE_EXPORTED_EVENT( WXDLLIMPEXP_CORE, wxEVT_LIST_CACHE_HINT, wxListEvent ); wxDECLARE_EXPORTED_EVENT( WXDLLIMPEXP_CORE, wxEVT_LIST_COL_RIGHT_CLICK, wxListEvent ); wxDECLARE_EXPORTED_EVENT( WXDLLIMPEXP_CORE, wxEVT_LIST_COL_BEGIN_DRAG, wxListEvent ); wxDECLARE_EXPORTED_EVENT( WXDLLIMPEXP_CORE, wxEVT_LIST_COL_DRAGGING, wxListEvent ); wxDECLARE_EXPORTED_EVENT( WXDLLIMPEXP_CORE, wxEVT_LIST_COL_END_DRAG, wxListEvent ); wxDECLARE_EXPORTED_EVENT( WXDLLIMPEXP_CORE, wxEVT_LIST_ITEM_FOCUSED, wxListEvent ); wxDECLARE_EXPORTED_EVENT( WXDLLIMPEXP_CORE, wxEVT_LIST_ITEM_CHECKED, wxListEvent ); wxDECLARE_EXPORTED_EVENT( WXDLLIMPEXP_CORE, wxEVT_LIST_ITEM_UNCHECKED, wxListEvent ); typedef void (wxEvtHandler::*wxListEventFunction)(wxListEvent&); #define wxListEventHandler(func) \ wxEVENT_HANDLER_CAST(wxListEventFunction, func) #define wx__DECLARE_LISTEVT(evt, id, fn) \ wx__DECLARE_EVT1(wxEVT_LIST_ ## evt, id, wxListEventHandler(fn)) #define EVT_LIST_BEGIN_DRAG(id, fn) wx__DECLARE_LISTEVT(BEGIN_DRAG, id, fn) #define EVT_LIST_BEGIN_RDRAG(id, fn) wx__DECLARE_LISTEVT(BEGIN_RDRAG, id, fn) #define EVT_LIST_BEGIN_LABEL_EDIT(id, fn) wx__DECLARE_LISTEVT(BEGIN_LABEL_EDIT, id, fn) #define EVT_LIST_END_LABEL_EDIT(id, fn) wx__DECLARE_LISTEVT(END_LABEL_EDIT, id, fn) #define EVT_LIST_DELETE_ITEM(id, fn) wx__DECLARE_LISTEVT(DELETE_ITEM, id, fn) #define EVT_LIST_DELETE_ALL_ITEMS(id, fn) wx__DECLARE_LISTEVT(DELETE_ALL_ITEMS, id, fn) #define EVT_LIST_KEY_DOWN(id, fn) wx__DECLARE_LISTEVT(KEY_DOWN, id, fn) #define EVT_LIST_INSERT_ITEM(id, fn) wx__DECLARE_LISTEVT(INSERT_ITEM, id, fn) #define EVT_LIST_COL_CLICK(id, fn) wx__DECLARE_LISTEVT(COL_CLICK, id, fn) #define EVT_LIST_COL_RIGHT_CLICK(id, fn) wx__DECLARE_LISTEVT(COL_RIGHT_CLICK, id, fn) #define EVT_LIST_COL_BEGIN_DRAG(id, fn) wx__DECLARE_LISTEVT(COL_BEGIN_DRAG, id, fn) #define EVT_LIST_COL_DRAGGING(id, fn) wx__DECLARE_LISTEVT(COL_DRAGGING, id, fn) #define EVT_LIST_COL_END_DRAG(id, fn) wx__DECLARE_LISTEVT(COL_END_DRAG, id, fn) #define EVT_LIST_ITEM_SELECTED(id, fn) wx__DECLARE_LISTEVT(ITEM_SELECTED, id, fn) #define EVT_LIST_ITEM_DESELECTED(id, fn) wx__DECLARE_LISTEVT(ITEM_DESELECTED, id, fn) #define EVT_LIST_ITEM_RIGHT_CLICK(id, fn) wx__DECLARE_LISTEVT(ITEM_RIGHT_CLICK, id, fn) #define EVT_LIST_ITEM_MIDDLE_CLICK(id, fn) wx__DECLARE_LISTEVT(ITEM_MIDDLE_CLICK, id, fn) #define EVT_LIST_ITEM_ACTIVATED(id, fn) wx__DECLARE_LISTEVT(ITEM_ACTIVATED, id, fn) #define EVT_LIST_ITEM_FOCUSED(id, fn) wx__DECLARE_LISTEVT(ITEM_FOCUSED, id, fn) #define EVT_LIST_ITEM_CHECKED(id, fn) wx__DECLARE_LISTEVT(ITEM_CHECKED, id, fn) #define EVT_LIST_ITEM_UNCHECKED(id, fn) wx__DECLARE_LISTEVT(ITEM_UNCHECKED, id, fn) #define EVT_LIST_CACHE_HINT(id, fn) wx__DECLARE_LISTEVT(CACHE_HINT, id, fn) // old wxEVT_COMMAND_* constants #define wxEVT_COMMAND_LIST_BEGIN_DRAG wxEVT_LIST_BEGIN_DRAG #define wxEVT_COMMAND_LIST_BEGIN_RDRAG wxEVT_LIST_BEGIN_RDRAG #define wxEVT_COMMAND_LIST_BEGIN_LABEL_EDIT wxEVT_LIST_BEGIN_LABEL_EDIT #define wxEVT_COMMAND_LIST_END_LABEL_EDIT wxEVT_LIST_END_LABEL_EDIT #define wxEVT_COMMAND_LIST_DELETE_ITEM wxEVT_LIST_DELETE_ITEM #define wxEVT_COMMAND_LIST_DELETE_ALL_ITEMS wxEVT_LIST_DELETE_ALL_ITEMS #define wxEVT_COMMAND_LIST_ITEM_SELECTED wxEVT_LIST_ITEM_SELECTED #define wxEVT_COMMAND_LIST_ITEM_DESELECTED wxEVT_LIST_ITEM_DESELECTED #define wxEVT_COMMAND_LIST_KEY_DOWN wxEVT_LIST_KEY_DOWN #define wxEVT_COMMAND_LIST_INSERT_ITEM wxEVT_LIST_INSERT_ITEM #define wxEVT_COMMAND_LIST_COL_CLICK wxEVT_LIST_COL_CLICK #define wxEVT_COMMAND_LIST_ITEM_RIGHT_CLICK wxEVT_LIST_ITEM_RIGHT_CLICK #define wxEVT_COMMAND_LIST_ITEM_MIDDLE_CLICK wxEVT_LIST_ITEM_MIDDLE_CLICK #define wxEVT_COMMAND_LIST_ITEM_ACTIVATED wxEVT_LIST_ITEM_ACTIVATED #define wxEVT_COMMAND_LIST_CACHE_HINT wxEVT_LIST_CACHE_HINT #define wxEVT_COMMAND_LIST_COL_RIGHT_CLICK wxEVT_LIST_COL_RIGHT_CLICK #define wxEVT_COMMAND_LIST_COL_BEGIN_DRAG wxEVT_LIST_COL_BEGIN_DRAG #define wxEVT_COMMAND_LIST_COL_DRAGGING wxEVT_LIST_COL_DRAGGING #define wxEVT_COMMAND_LIST_COL_END_DRAG wxEVT_LIST_COL_END_DRAG #define wxEVT_COMMAND_LIST_ITEM_FOCUSED wxEVT_LIST_ITEM_FOCUSED #endif // _WX_LISTCTRL_H_BASE_
h
rticonnextdds-usecases
data/projects/rticonnextdds-usecases/VehicleTracking/ExampleCode/thirdparty/wxWidgets-3.1.2/Win64/include/wx/ipc.h
/////////////////////////////////////////////////////////////////////////////// // Name: wx/ipc.h // Purpose: wrapper around different wxIPC classes implementations // Author: Vadim Zeitlin // Modified by: // Created: 15.04.02 // Copyright: (c) 2002 Vadim Zeitlin // Licence: wxWindows licence /////////////////////////////////////////////////////////////////////////////// #ifndef _WX_IPC_H_ #define _WX_IPC_H_ // Set wxUSE_DDE_FOR_IPC to 1 to use DDE for IPC under Windows. If it is set to // 0, or if the platform is not Windows, use TCP/IP for IPC implementation #if !defined(wxUSE_DDE_FOR_IPC) #ifdef __WINDOWS__ #define wxUSE_DDE_FOR_IPC 1 #else #define wxUSE_DDE_FOR_IPC 0 #endif #endif // !defined(wxUSE_DDE_FOR_IPC) #if !defined(__WINDOWS__) #undef wxUSE_DDE_FOR_IPC #define wxUSE_DDE_FOR_IPC 0 #endif #if wxUSE_DDE_FOR_IPC #define wxConnection wxDDEConnection #define wxServer wxDDEServer #define wxClient wxDDEClient #include "wx/dde.h" #else // !wxUSE_DDE_FOR_IPC #define wxConnection wxTCPConnection #define wxServer wxTCPServer #define wxClient wxTCPClient #include "wx/sckipc.h" #endif // wxUSE_DDE_FOR_IPC/!wxUSE_DDE_FOR_IPC #endif // _WX_IPC_H_
h
rticonnextdds-usecases
data/projects/rticonnextdds-usecases/VehicleTracking/ExampleCode/thirdparty/wxWidgets-3.1.2/Win64/include/wx/palette.h
///////////////////////////////////////////////////////////////////////////// // Name: wx/palette.h // Purpose: Common header and base class for wxPalette // Author: Julian Smart // Modified by: // Created: // Copyright: (c) Julian Smart // Licence: wxWindows Licence ///////////////////////////////////////////////////////////////////////////// #ifndef _WX_PALETTE_H_BASE_ #define _WX_PALETTE_H_BASE_ #include "wx/defs.h" #if wxUSE_PALETTE #include "wx/object.h" #include "wx/gdiobj.h" // wxPaletteBase class WXDLLIMPEXP_CORE wxPaletteBase: public wxGDIObject { public: virtual ~wxPaletteBase() { } virtual int GetColoursCount() const { wxFAIL_MSG( wxT("not implemented") ); return 0; } }; #if defined(__WXMSW__) #include "wx/msw/palette.h" #elif defined(__WXX11__) || defined(__WXMOTIF__) #include "wx/x11/palette.h" #elif defined(__WXGTK__) #include "wx/generic/paletteg.h" #elif defined(__WXMAC__) #include "wx/osx/palette.h" #elif defined(__WXQT__) #include "wx/qt/palette.h" #endif #endif // wxUSE_PALETTE #endif // _WX_PALETTE_H_BASE_
h
rticonnextdds-usecases
data/projects/rticonnextdds-usecases/VehicleTracking/ExampleCode/thirdparty/wxWidgets-3.1.2/Win64/include/wx/affinematrix2dbase.h
///////////////////////////////////////////////////////////////////////////// // Name: wx/affinematrix2dbase.h // Purpose: Common interface for 2D transformation matrices. // Author: Catalin Raceanu // Created: 2011-04-06 // Copyright: (c) wxWidgets team // Licence: wxWindows licence ///////////////////////////////////////////////////////////////////////////// #ifndef _WX_AFFINEMATRIX2DBASE_H_ #define _WX_AFFINEMATRIX2DBASE_H_ #include "wx/defs.h" #if wxUSE_GEOMETRY #include "wx/geometry.h" struct wxMatrix2D { wxMatrix2D(wxDouble v11 = 1, wxDouble v12 = 0, wxDouble v21 = 0, wxDouble v22 = 1) { m_11 = v11; m_12 = v12; m_21 = v21; m_22 = v22; } wxDouble m_11, m_12, m_21, m_22; }; // A 2x3 matrix representing an affine 2D transformation. // // This is an abstract base class implemented by wxAffineMatrix2D only so far, // but in the future we also plan to derive wxGraphicsMatrix from it (it should // also be documented then as currently only wxAffineMatrix2D itself is). class WXDLLIMPEXP_CORE wxAffineMatrix2DBase { public: wxAffineMatrix2DBase() {} virtual ~wxAffineMatrix2DBase() {} // sets the matrix to the respective values virtual void Set(const wxMatrix2D& mat2D, const wxPoint2DDouble& tr) = 0; // gets the component valuess of the matrix virtual void Get(wxMatrix2D* mat2D, wxPoint2DDouble* tr) const = 0; // concatenates the matrix virtual void Concat(const wxAffineMatrix2DBase& t) = 0; // makes this the inverse matrix virtual bool Invert() = 0; // return true if this is the identity matrix virtual bool IsIdentity() const = 0; // returns true if the elements of the transformation matrix are equal ? virtual bool IsEqual(const wxAffineMatrix2DBase& t) const = 0; bool operator==(const wxAffineMatrix2DBase& t) const { return IsEqual(t); } bool operator!=(const wxAffineMatrix2DBase& t) const { return !IsEqual(t); } // // transformations // // add the translation to this matrix virtual void Translate(wxDouble dx, wxDouble dy) = 0; // add the scale to this matrix virtual void Scale(wxDouble xScale, wxDouble yScale) = 0; // add the rotation to this matrix (counter clockwise, radians) virtual void Rotate(wxDouble ccRadians) = 0; // add mirroring to this matrix void Mirror(int direction = wxHORIZONTAL) { wxDouble x = (direction & wxHORIZONTAL) ? -1 : 1; wxDouble y = (direction & wxVERTICAL) ? -1 : 1; Scale(x, y); } // applies that matrix to the point wxPoint2DDouble TransformPoint(const wxPoint2DDouble& src) const { return DoTransformPoint(src); } void TransformPoint(wxDouble* x, wxDouble* y) const { wxCHECK_RET( x && y, "Can't be NULL" ); const wxPoint2DDouble dst = DoTransformPoint(wxPoint2DDouble(*x, *y)); *x = dst.m_x; *y = dst.m_y; } // applies the matrix except for translations wxPoint2DDouble TransformDistance(const wxPoint2DDouble& src) const { return DoTransformDistance(src); } void TransformDistance(wxDouble* dx, wxDouble* dy) const { wxCHECK_RET( dx && dy, "Can't be NULL" ); const wxPoint2DDouble dst = DoTransformDistance(wxPoint2DDouble(*dx, *dy)); *dx = dst.m_x; *dy = dst.m_y; } protected: virtual wxPoint2DDouble DoTransformPoint(const wxPoint2DDouble& p) const = 0; virtual wxPoint2DDouble DoTransformDistance(const wxPoint2DDouble& p) const = 0; }; #endif // wxUSE_GEOMETRY #endif // _WX_AFFINEMATRIX2DBASE_H_
h
rticonnextdds-usecases
data/projects/rticonnextdds-usecases/VehicleTracking/ExampleCode/thirdparty/wxWidgets-3.1.2/Win64/include/wx/menu.h
/////////////////////////////////////////////////////////////////////////////// // Name: wx/menu.h // Purpose: wxMenu and wxMenuBar classes // Author: Vadim Zeitlin // Modified by: // Created: 26.10.99 // Copyright: (c) wxWidgets team // Licence: wxWindows licence /////////////////////////////////////////////////////////////////////////////// #ifndef _WX_MENU_H_BASE_ #define _WX_MENU_H_BASE_ #include "wx/defs.h" #if wxUSE_MENUS // ---------------------------------------------------------------------------- // headers // ---------------------------------------------------------------------------- #include "wx/list.h" // for "template" list classes #include "wx/window.h" // base class for wxMenuBar // also include this one to ensure compatibility with old code which only // included wx/menu.h #include "wx/menuitem.h" class WXDLLIMPEXP_FWD_CORE wxFrame; class WXDLLIMPEXP_FWD_CORE wxMenu; class WXDLLIMPEXP_FWD_CORE wxMenuBarBase; class WXDLLIMPEXP_FWD_CORE wxMenuBar; class WXDLLIMPEXP_FWD_CORE wxMenuItem; // pseudo template list classes WX_DECLARE_EXPORTED_LIST(wxMenu, wxMenuList); WX_DECLARE_EXPORTED_LIST(wxMenuItem, wxMenuItemList); // ---------------------------------------------------------------------------- // wxMenu // ---------------------------------------------------------------------------- class WXDLLIMPEXP_CORE wxMenuBase : public wxEvtHandler { public: // create a menu static wxMenu *New(const wxString& title = wxEmptyString, long style = 0); // ctors wxMenuBase(const wxString& title, long style = 0) : m_title(title) { Init(style); } wxMenuBase(long style = 0) { Init(style); } // dtor deletes all the menu items we own virtual ~wxMenuBase(); // menu construction // ----------------- // append any kind of item (normal/check/radio/separator) wxMenuItem* Append(int itemid, const wxString& text = wxEmptyString, const wxString& help = wxEmptyString, wxItemKind kind = wxITEM_NORMAL) { return DoAppend(wxMenuItem::New((wxMenu *)this, itemid, text, help, kind)); } // append a separator to the menu wxMenuItem* AppendSeparator() { return Append(wxID_SEPARATOR); } // append a check item wxMenuItem* AppendCheckItem(int itemid, const wxString& text, const wxString& help = wxEmptyString) { return Append(itemid, text, help, wxITEM_CHECK); } // append a radio item wxMenuItem* AppendRadioItem(int itemid, const wxString& text, const wxString& help = wxEmptyString) { return Append(itemid, text, help, wxITEM_RADIO); } // append a submenu wxMenuItem* AppendSubMenu(wxMenu *submenu, const wxString& text, const wxString& help = wxEmptyString) { return DoAppend(wxMenuItem::New((wxMenu *)this, wxID_ANY, text, help, wxITEM_NORMAL, submenu)); } // the most generic form of Append() - append anything wxMenuItem* Append(wxMenuItem *item) { return DoAppend(item); } // insert a break in the menu (only works when appending the items, not // inserting them) virtual void Break() { } // insert an item before given position wxMenuItem* Insert(size_t pos, wxMenuItem *item); // insert an item before given position wxMenuItem* Insert(size_t pos, int itemid, const wxString& text = wxEmptyString, const wxString& help = wxEmptyString, wxItemKind kind = wxITEM_NORMAL) { return Insert(pos, wxMenuItem::New((wxMenu *)this, itemid, text, help, kind)); } // insert a separator wxMenuItem* InsertSeparator(size_t pos) { return Insert(pos, wxMenuItem::New((wxMenu *)this, wxID_SEPARATOR)); } // insert a check item wxMenuItem* InsertCheckItem(size_t pos, int itemid, const wxString& text, const wxString& help = wxEmptyString) { return Insert(pos, itemid, text, help, wxITEM_CHECK); } // insert a radio item wxMenuItem* InsertRadioItem(size_t pos, int itemid, const wxString& text, const wxString& help = wxEmptyString) { return Insert(pos, itemid, text, help, wxITEM_RADIO); } // insert a submenu wxMenuItem* Insert(size_t pos, int itemid, const wxString& text, wxMenu *submenu, const wxString& help = wxEmptyString) { return Insert(pos, wxMenuItem::New((wxMenu *)this, itemid, text, help, wxITEM_NORMAL, submenu)); } // prepend an item to the menu wxMenuItem* Prepend(wxMenuItem *item) { return Insert(0u, item); } // prepend any item to the menu wxMenuItem* Prepend(int itemid, const wxString& text = wxEmptyString, const wxString& help = wxEmptyString, wxItemKind kind = wxITEM_NORMAL) { return Insert(0u, itemid, text, help, kind); } // prepend a separator wxMenuItem* PrependSeparator() { return InsertSeparator(0u); } // prepend a check item wxMenuItem* PrependCheckItem(int itemid, const wxString& text, const wxString& help = wxEmptyString) { return InsertCheckItem(0u, itemid, text, help); } // prepend a radio item wxMenuItem* PrependRadioItem(int itemid, const wxString& text, const wxString& help = wxEmptyString) { return InsertRadioItem(0u, itemid, text, help); } // prepend a submenu wxMenuItem* Prepend(int itemid, const wxString& text, wxMenu *submenu, const wxString& help = wxEmptyString) { return Insert(0u, itemid, text, submenu, help); } // detach an item from the menu, but don't delete it so that it can be // added back later (but if it's not, the caller is responsible for // deleting it!) wxMenuItem *Remove(int itemid) { return Remove(FindChildItem(itemid)); } wxMenuItem *Remove(wxMenuItem *item); // delete an item from the menu (submenus are not destroyed by this // function, see Destroy) bool Delete(int itemid) { return Delete(FindChildItem(itemid)); } bool Delete(wxMenuItem *item); // delete the item from menu and destroy it (if it's a submenu) bool Destroy(int itemid) { return Destroy(FindChildItem(itemid)); } bool Destroy(wxMenuItem *item); // menu items access // ----------------- // get the items size_t GetMenuItemCount() const { return m_items.GetCount(); } const wxMenuItemList& GetMenuItems() const { return m_items; } wxMenuItemList& GetMenuItems() { return m_items; } // search virtual int FindItem(const wxString& item) const; wxMenuItem* FindItem(int itemid, wxMenu **menu = NULL) const; // find by position wxMenuItem* FindItemByPosition(size_t position) const; // get/set items attributes void Enable(int itemid, bool enable); bool IsEnabled(int itemid) const; void Check(int itemid, bool check); bool IsChecked(int itemid) const; void SetLabel(int itemid, const wxString& label); wxString GetLabel(int itemid) const; // Returns the stripped label wxString GetLabelText(int itemid) const { return wxMenuItem::GetLabelText(GetLabel(itemid)); } virtual void SetHelpString(int itemid, const wxString& helpString); virtual wxString GetHelpString(int itemid) const; // misc accessors // -------------- // the title virtual void SetTitle(const wxString& title) { m_title = title; } const wxString& GetTitle() const { return m_title; } // event handler void SetEventHandler(wxEvtHandler *handler) { m_eventHandler = handler; } wxEvtHandler *GetEventHandler() const { return m_eventHandler; } // Invoking window: this is set by wxWindow::PopupMenu() before showing a // popup menu and reset after it's hidden. Notice that you probably want to // use GetWindow() below instead of GetInvokingWindow() as the latter only // returns non-NULL for the top level menus // // NB: avoid calling SetInvokingWindow() directly if possible, use // wxMenuInvokingWindowSetter class below instead void SetInvokingWindow(wxWindow *win); wxWindow *GetInvokingWindow() const { return m_invokingWindow; } // the window associated with this menu: this is the invoking window for // popup menus or the top level window to which the menu bar is attached // for menus which are part of a menu bar wxWindow *GetWindow() const; // style long GetStyle() const { return m_style; } // implementation helpers // ---------------------- // Updates the UI for a menu and all submenus recursively by generating // wxEVT_UPDATE_UI for all the items. // // Do not use the "source" argument, it allows to override the event // handler to use for these events, but this should never be needed. void UpdateUI(wxEvtHandler* source = NULL); // get the menu bar this menu is attached to (may be NULL, always NULL for // popup menus). Traverse up the menu hierarchy to find it. wxMenuBar *GetMenuBar() const; // called when the menu is attached/detached to/from a menu bar virtual void Attach(wxMenuBarBase *menubar); virtual void Detach(); // is the menu attached to a menu bar (or is it a popup one)? bool IsAttached() const { return GetMenuBar() != NULL; } // set/get the parent of this menu void SetParent(wxMenu *parent) { m_menuParent = parent; } wxMenu *GetParent() const { return m_menuParent; } // implementation only from now on // ------------------------------- // unlike FindItem(), this function doesn't recurse but only looks through // our direct children and also may return the index of the found child if // pos != NULL wxMenuItem *FindChildItem(int itemid, size_t *pos = NULL) const; // called to generate a wxCommandEvent, return true if it was processed, // false otherwise // // the checked parameter may have boolean value or -1 for uncheckable items bool SendEvent(int itemid, int checked = -1); // called to dispatch a wxMenuEvent to the right recipients, menu pointer // can be NULL if we failed to find the associated menu (this happens at // least in wxMSW for the events from the system menus) static bool ProcessMenuEvent(wxMenu* menu, wxMenuEvent& event, wxWindow* win); // compatibility: these functions are deprecated, use the new ones instead // ----------------------------------------------------------------------- // use the versions taking wxItem_XXX now instead, they're more readable // and allow adding the radio items as well void Append(int itemid, const wxString& text, const wxString& help, bool isCheckable) { Append(itemid, text, help, isCheckable ? wxITEM_CHECK : wxITEM_NORMAL); } // use more readable and not requiring unused itemid AppendSubMenu() instead wxMenuItem* Append(int itemid, const wxString& text, wxMenu *submenu, const wxString& help = wxEmptyString) { return DoAppend(wxMenuItem::New((wxMenu *)this, itemid, text, help, wxITEM_NORMAL, submenu)); } void Insert(size_t pos, int itemid, const wxString& text, const wxString& help, bool isCheckable) { Insert(pos, itemid, text, help, isCheckable ? wxITEM_CHECK : wxITEM_NORMAL); } void Prepend(int itemid, const wxString& text, const wxString& help, bool isCheckable) { Insert(0u, itemid, text, help, isCheckable); } static void LockAccels(bool locked) { ms_locked = locked; } protected: // virtuals to override in derived classes // --------------------------------------- virtual wxMenuItem* DoAppend(wxMenuItem *item); virtual wxMenuItem* DoInsert(size_t pos, wxMenuItem *item); virtual wxMenuItem *DoRemove(wxMenuItem *item); virtual bool DoDelete(wxMenuItem *item); virtual bool DoDestroy(wxMenuItem *item); // helpers // ------- // common part of all ctors void Init(long style); // associate the submenu with this menu void AddSubMenu(wxMenu *submenu); wxMenuBar *m_menuBar; // menubar we belong to or NULL wxMenu *m_menuParent; // parent menu or NULL wxString m_title; // the menu title or label wxMenuItemList m_items; // the list of menu items wxWindow *m_invokingWindow; // for popup menus long m_style; // combination of wxMENU_XXX flags wxEvtHandler *m_eventHandler; // a pluggable in event handler static bool ms_locked; private: // Common part of SendEvent() and ProcessMenuEvent(): sends the event to // its intended recipients, returns true if it was processed. static bool DoProcessEvent(wxMenuBase* menu, wxEvent& event, wxWindow* win); wxDECLARE_NO_COPY_CLASS(wxMenuBase); }; #if wxUSE_EXTENDED_RTTI // ---------------------------------------------------------------------------- // XTI accessor // ---------------------------------------------------------------------------- class WXDLLEXPORT wxMenuInfoHelper : public wxObject { public: wxMenuInfoHelper() { m_menu = NULL; } virtual ~wxMenuInfoHelper() { } bool Create( wxMenu *menu, const wxString &title ) { m_menu = menu; m_title = title; return true; } wxMenu* GetMenu() const { return m_menu; } wxString GetTitle() const { return m_title; } private: wxMenu *m_menu; wxString m_title; wxDECLARE_DYNAMIC_CLASS(wxMenuInfoHelper); }; WX_DECLARE_EXPORTED_LIST(wxMenuInfoHelper, wxMenuInfoHelperList ); #endif // ---------------------------------------------------------------------------- // wxMenuBar // ---------------------------------------------------------------------------- class WXDLLIMPEXP_CORE wxMenuBarBase : public wxWindow { public: // default ctor wxMenuBarBase(); // dtor will delete all menus we own virtual ~wxMenuBarBase(); // menu bar construction // --------------------- // append a menu to the end of menubar, return true if ok virtual bool Append(wxMenu *menu, const wxString& title); // insert a menu before the given position into the menubar, return true // if inserted ok virtual bool Insert(size_t pos, wxMenu *menu, const wxString& title); // menu bar items access // --------------------- // get the number of menus in the menu bar size_t GetMenuCount() const { return m_menus.GetCount(); } // get the menu at given position wxMenu *GetMenu(size_t pos) const; // replace the menu at given position with another one, returns the // previous menu (which should be deleted by the caller) virtual wxMenu *Replace(size_t pos, wxMenu *menu, const wxString& title); // delete the menu at given position from the menu bar, return the pointer // to the menu (which should be deleted by the caller) virtual wxMenu *Remove(size_t pos); // enable or disable a submenu virtual void EnableTop(size_t pos, bool enable) = 0; // is the menu enabled? virtual bool IsEnabledTop(size_t WXUNUSED(pos)) const { return true; } // get or change the label of the menu at given position virtual void SetMenuLabel(size_t pos, const wxString& label) = 0; virtual wxString GetMenuLabel(size_t pos) const = 0; // get the stripped label of the menu at given position virtual wxString GetMenuLabelText(size_t pos) const { return wxMenuItem::GetLabelText(GetMenuLabel(pos)); } // item search // ----------- // by menu and item names, returns wxNOT_FOUND if not found or id of the // found item virtual int FindMenuItem(const wxString& menu, const wxString& item) const; // find item by id (in any menu), returns NULL if not found // // if menu is !NULL, it will be filled with wxMenu this item belongs to virtual wxMenuItem* FindItem(int itemid, wxMenu **menu = NULL) const; // find menu by its caption, return wxNOT_FOUND on failure int FindMenu(const wxString& title) const; // item access // ----------- // all these functions just use FindItem() and then call an appropriate // method on it // // NB: under MSW, these methods can only be used after the menubar had // been attached to the frame void Enable(int itemid, bool enable); void Check(int itemid, bool check); bool IsChecked(int itemid) const; bool IsEnabled(int itemid) const; virtual bool IsEnabled() const { return wxWindow::IsEnabled(); } void SetLabel(int itemid, const wxString &label); wxString GetLabel(int itemid) const; void SetHelpString(int itemid, const wxString& helpString); wxString GetHelpString(int itemid) const; // implementation helpers // get the frame we are attached to (may return NULL) wxFrame *GetFrame() const { return m_menuBarFrame; } // returns true if we're attached to a frame bool IsAttached() const { return GetFrame() != NULL; } // associate the menubar with the frame virtual void Attach(wxFrame *frame); // called before deleting the menubar normally virtual void Detach(); // need to override these ones to avoid virtual function hiding virtual bool Enable(bool enable = true) wxOVERRIDE { return wxWindow::Enable(enable); } virtual void SetLabel(const wxString& s) wxOVERRIDE { wxWindow::SetLabel(s); } virtual wxString GetLabel() const wxOVERRIDE { return wxWindow::GetLabel(); } // don't want menu bars to accept the focus by tabbing to them virtual bool AcceptsFocusFromKeyboard() const wxOVERRIDE { return false; } // update all menu item states in all menus virtual void UpdateMenus(); virtual bool CanBeOutsideClientArea() const wxOVERRIDE { return true; } #if wxUSE_EXTENDED_RTTI // XTI helpers: bool AppendMenuInfo( const wxMenuInfoHelper *info ) { return Append( info->GetMenu(), info->GetTitle() ); } const wxMenuInfoHelperList& GetMenuInfos() const; #endif #if WXWIN_COMPATIBILITY_2_8 // get or change the label of the menu at given position // Deprecated in favour of SetMenuLabel wxDEPRECATED( void SetLabelTop(size_t pos, const wxString& label) ); // Deprecated in favour of GetMenuLabelText wxDEPRECATED( wxString GetLabelTop(size_t pos) const ); #endif protected: // the list of all our menus wxMenuList m_menus; #if wxUSE_EXTENDED_RTTI // used by XTI wxMenuInfoHelperList m_menuInfos; #endif // the frame we are attached to (may be NULL) wxFrame *m_menuBarFrame; wxDECLARE_NO_COPY_CLASS(wxMenuBarBase); }; // ---------------------------------------------------------------------------- // include the real class declaration // ---------------------------------------------------------------------------- #ifdef wxUSE_BASE_CLASSES_ONLY #define wxMenuItem wxMenuItemBase #else // !wxUSE_BASE_CLASSES_ONLY #if defined(__WXUNIVERSAL__) #include "wx/univ/menu.h" #elif defined(__WXMSW__) #include "wx/msw/menu.h" #elif defined(__WXMOTIF__) #include "wx/motif/menu.h" #elif defined(__WXGTK20__) #include "wx/gtk/menu.h" #elif defined(__WXGTK__) #include "wx/gtk1/menu.h" #elif defined(__WXMAC__) #include "wx/osx/menu.h" #elif defined(__WXQT__) #include "wx/qt/menu.h" #endif #endif // wxUSE_BASE_CLASSES_ONLY/!wxUSE_BASE_CLASSES_ONLY // ---------------------------------------------------------------------------- // Helper class used in the implementation only: sets the invoking window of // the given menu in its ctor and resets it in dtor. // ---------------------------------------------------------------------------- class wxMenuInvokingWindowSetter { public: // Ctor sets the invoking window for the given menu. // // The menu lifetime must be greater than that of this class. wxMenuInvokingWindowSetter(wxMenu& menu, wxWindow *win) : m_menu(menu) { menu.SetInvokingWindow(win); } // Dtor resets the invoking window. ~wxMenuInvokingWindowSetter() { m_menu.SetInvokingWindow(NULL); } private: wxMenu& m_menu; wxDECLARE_NO_COPY_CLASS(wxMenuInvokingWindowSetter); }; #endif // wxUSE_MENUS #endif // _WX_MENU_H_BASE_
h
rticonnextdds-usecases
data/projects/rticonnextdds-usecases/VehicleTracking/ExampleCode/thirdparty/wxWidgets-3.1.2/Win64/include/wx/colour.h
///////////////////////////////////////////////////////////////////////////// // Name: wx/colour.h // Purpose: wxColourBase definition // Author: Julian Smart // Modified by: Francesco Montorsi // Created: // Copyright: Julian Smart // Licence: wxWindows licence ///////////////////////////////////////////////////////////////////////////// #ifndef _WX_COLOUR_H_BASE_ #define _WX_COLOUR_H_BASE_ #include "wx/defs.h" #include "wx/gdiobj.h" class WXDLLIMPEXP_FWD_CORE wxColour; // A macro to define the standard wxColour constructors: // // It avoids the need to repeat these lines across all colour.h files, since // Set() is a virtual function and thus cannot be called by wxColourBase ctors #define DEFINE_STD_WXCOLOUR_CONSTRUCTORS \ wxColour() { Init(); } \ wxColour(ChannelType red, \ ChannelType green, \ ChannelType blue, \ ChannelType alpha = wxALPHA_OPAQUE) \ { Init(); Set(red, green, blue, alpha); } \ wxColour(unsigned long colRGB) { Init(); Set(colRGB ); } \ wxColour(const wxString& colourName) { Init(); Set(colourName); } \ wxColour(const char *colourName) { Init(); Set(colourName); } \ wxColour(const wchar_t *colourName) { Init(); Set(colourName); } // flags for wxColour -> wxString conversion (see wxColour::GetAsString) enum { wxC2S_NAME = 1, // return colour name, when possible wxC2S_CSS_SYNTAX = 2, // return colour in rgb(r,g,b) syntax wxC2S_HTML_SYNTAX = 4 // return colour in #rrggbb syntax }; const unsigned char wxALPHA_TRANSPARENT = 0; const unsigned char wxALPHA_OPAQUE = 0xff; // a valid but fully transparent colour #define wxTransparentColour wxColour(0, 0, 0, wxALPHA_TRANSPARENT) #define wxTransparentColor wxTransparentColour // ---------------------------------------------------------------------------- // wxVariant support // ---------------------------------------------------------------------------- #if wxUSE_VARIANT #include "wx/variant.h" DECLARE_VARIANT_OBJECT_EXPORTED(wxColour,WXDLLIMPEXP_CORE) #endif //----------------------------------------------------------------------------- // wxColourBase: this class has no data members, just some functions to avoid // code redundancy in all native wxColour implementations //----------------------------------------------------------------------------- /* Transition from wxGDIObject to wxObject is incomplete. If your port does not need the wxGDIObject machinery to handle colors, please add it to the list of ports which do not need it. */ #if defined( __WXMSW__ ) || defined( __WXQT__ ) #define wxCOLOUR_IS_GDIOBJECT 0 #else #define wxCOLOUR_IS_GDIOBJECT 1 #endif class WXDLLIMPEXP_CORE wxColourBase : public #if wxCOLOUR_IS_GDIOBJECT wxGDIObject #else wxObject #endif { public: // type of a single colour component typedef unsigned char ChannelType; wxColourBase() {} virtual ~wxColourBase() {} // Set() functions // --------------- void Set(ChannelType red, ChannelType green, ChannelType blue, ChannelType alpha = wxALPHA_OPAQUE) { InitRGBA(red, green, blue, alpha); } // implemented in colourcmn.cpp bool Set(const wxString &str) { return FromString(str); } void Set(unsigned long colRGB) { // we don't need to know sizeof(long) here because we assume that the three // least significant bytes contain the R, G and B values Set((ChannelType)(0xFF & colRGB), (ChannelType)(0xFF & (colRGB >> 8)), (ChannelType)(0xFF & (colRGB >> 16))); } // accessors // --------- virtual ChannelType Red() const = 0; virtual ChannelType Green() const = 0; virtual ChannelType Blue() const = 0; virtual ChannelType Alpha() const { return wxALPHA_OPAQUE ; } virtual bool IsSolid() const { return true; } // implemented in colourcmn.cpp virtual wxString GetAsString(long flags = wxC2S_NAME | wxC2S_CSS_SYNTAX) const; void SetRGB(wxUint32 colRGB) { Set((ChannelType)(0xFF & colRGB), (ChannelType)(0xFF & (colRGB >> 8)), (ChannelType)(0xFF & (colRGB >> 16))); } void SetRGBA(wxUint32 colRGBA) { Set((ChannelType)(0xFF & colRGBA), (ChannelType)(0xFF & (colRGBA >> 8)), (ChannelType)(0xFF & (colRGBA >> 16)), (ChannelType)(0xFF & (colRGBA >> 24))); } wxUint32 GetRGB() const { return Red() | (Green() << 8) | (Blue() << 16); } wxUint32 GetRGBA() const { return Red() | (Green() << 8) | (Blue() << 16) | (Alpha() << 24); } #if !wxCOLOUR_IS_GDIOBJECT virtual bool IsOk() const= 0; // older version, for backwards compatibility only (but not deprecated // because it's still widely used) bool Ok() const { return IsOk(); } #endif // manipulation // ------------ // These methods are static because they are mostly used // within tight loops (where we don't want to instantiate wxColour's) static void MakeMono (unsigned char* r, unsigned char* g, unsigned char* b, bool on); static void MakeDisabled(unsigned char* r, unsigned char* g, unsigned char* b, unsigned char brightness = 255); static void MakeGrey (unsigned char* r, unsigned char* g, unsigned char* b); // integer version static void MakeGrey (unsigned char* r, unsigned char* g, unsigned char* b, double weight_r, double weight_g, double weight_b); // floating point version static unsigned char AlphaBlend (unsigned char fg, unsigned char bg, double alpha); static void ChangeLightness(unsigned char* r, unsigned char* g, unsigned char* b, int ialpha); wxColour ChangeLightness(int ialpha) const; wxColour& MakeDisabled(unsigned char brightness = 255); protected: // Some ports need Init() and while we don't, provide a stub so that the // ports which don't need it are not forced to define it void Init() { } virtual void InitRGBA(ChannelType r, ChannelType g, ChannelType b, ChannelType a) = 0; virtual bool FromString(const wxString& s); #if wxCOLOUR_IS_GDIOBJECT // wxColour doesn't use reference counted data (at least not in all ports) // so provide stubs for the functions which need to be defined if we do use // them virtual wxGDIRefData *CreateGDIRefData() const wxOVERRIDE { wxFAIL_MSG( "must be overridden if used" ); return NULL; } virtual wxGDIRefData *CloneGDIRefData(const wxGDIRefData *WXUNUSED(data)) const wxOVERRIDE { wxFAIL_MSG( "must be overridden if used" ); return NULL; } #endif }; // wxColour <-> wxString utilities, used by wxConfig, defined in colourcmn.cpp WXDLLIMPEXP_CORE wxString wxToString(const wxColourBase& col); WXDLLIMPEXP_CORE bool wxFromString(const wxString& str, wxColourBase* col); #if defined(__WXMSW__) #include "wx/msw/colour.h" #elif defined(__WXMOTIF__) #include "wx/motif/colour.h" #elif defined(__WXGTK20__) #include "wx/gtk/colour.h" #elif defined(__WXGTK__) #include "wx/gtk1/colour.h" #elif defined(__WXDFB__) #include "wx/generic/colour.h" #elif defined(__WXX11__) #include "wx/x11/colour.h" #elif defined(__WXMAC__) #include "wx/osx/colour.h" #elif defined(__WXQT__) #include "wx/qt/colour.h" #endif #define wxColor wxColour #endif // _WX_COLOUR_H_BASE_
h
rticonnextdds-usecases
data/projects/rticonnextdds-usecases/VehicleTracking/ExampleCode/thirdparty/wxWidgets-3.1.2/Win64/include/wx/checkbox.h
/////////////////////////////////////////////////////////////////////////////// // Name: wx/checkbox.h // Purpose: wxCheckBox class interface // Author: Vadim Zeitlin // Modified by: // Created: 07.09.00 // Copyright: (c) wxWidgets team // Licence: wxWindows licence /////////////////////////////////////////////////////////////////////////////// #ifndef _WX_CHECKBOX_H_BASE_ #define _WX_CHECKBOX_H_BASE_ #include "wx/defs.h" #if wxUSE_CHECKBOX #include "wx/control.h" /* * wxCheckBox style flags * (Using wxCHK_* because wxCB_* is used by wxComboBox). * Determine whether to use a 3-state or 2-state * checkbox. 3-state enables to differentiate * between 'unchecked', 'checked' and 'undetermined'. * * In addition to the styles here it is also possible to specify just 0 which * is treated the same as wxCHK_2STATE for compatibility (but using explicit * flag is preferred). */ #define wxCHK_2STATE 0x4000 #define wxCHK_3STATE 0x1000 /* * If this style is set the user can set the checkbox to the * undetermined state. If not set the undetermined set can only * be set programmatically. * This style can only be used with 3 state checkboxes. */ #define wxCHK_ALLOW_3RD_STATE_FOR_USER 0x2000 extern WXDLLIMPEXP_DATA_CORE(const char) wxCheckBoxNameStr[]; // ---------------------------------------------------------------------------- // wxCheckBox: a control which shows a label and a box which may be checked // ---------------------------------------------------------------------------- class WXDLLIMPEXP_CORE wxCheckBoxBase : public wxControl { public: wxCheckBoxBase() { } // set/get the checked status of the listbox virtual void SetValue(bool value) = 0; virtual bool GetValue() const = 0; bool IsChecked() const { wxASSERT_MSG( !Is3State(), wxT("Calling IsChecked() doesn't make sense for") wxT(" a three state checkbox, Use Get3StateValue() instead") ); return GetValue(); } wxCheckBoxState Get3StateValue() const { wxCheckBoxState state = DoGet3StateValue(); if ( state == wxCHK_UNDETERMINED && !Is3State() ) { // Undetermined state with a 2-state checkbox?? wxFAIL_MSG( wxT("DoGet3StateValue() says the 2-state checkbox is ") wxT("in an undetermined/third state") ); state = wxCHK_UNCHECKED; } return state; } void Set3StateValue(wxCheckBoxState state) { if ( state == wxCHK_UNDETERMINED && !Is3State() ) { wxFAIL_MSG(wxT("Setting a 2-state checkbox to undetermined state")); state = wxCHK_UNCHECKED; } DoSet3StateValue(state); } bool Is3State() const { return HasFlag(wxCHK_3STATE); } bool Is3rdStateAllowedForUser() const { return HasFlag(wxCHK_ALLOW_3RD_STATE_FOR_USER); } virtual bool HasTransparentBackground() wxOVERRIDE { return true; } // wxCheckBox-specific processing after processing the update event virtual void DoUpdateWindowUI(wxUpdateUIEvent& event) wxOVERRIDE { wxControl::DoUpdateWindowUI(event); if ( event.GetSetChecked() ) SetValue(event.GetChecked()); } protected: // choose the default border for this window virtual wxBorder GetDefaultBorder() const wxOVERRIDE { return wxBORDER_NONE; } virtual void DoSet3StateValue(wxCheckBoxState WXUNUSED(state)) { wxFAIL; } virtual wxCheckBoxState DoGet3StateValue() const { wxFAIL; return wxCHK_UNCHECKED; } // Helper function to be called from derived classes Create() // implementations: it checks that the style doesn't contain any // incompatible bits and modifies it to be sane if it does. static void WXValidateStyle(long *stylePtr) { long& style = *stylePtr; if ( !(style & (wxCHK_2STATE | wxCHK_3STATE)) ) { // For compatibility we use absence of style flags as wxCHK_2STATE // because wxCHK_2STATE used to have the value of 0 and some // existing code uses 0 instead of it. Moreover, some code even // uses some non-0 style, e.g. wxBORDER_XXX, but doesn't specify // neither wxCHK_2STATE nor wxCHK_3STATE -- to avoid breaking it, // assume (much more common) 2 state checkbox by default. style |= wxCHK_2STATE; } if ( style & wxCHK_3STATE ) { if ( style & wxCHK_2STATE ) { wxFAIL_MSG( "wxCHK_2STATE and wxCHK_3STATE can't be used " "together" ); style &= ~wxCHK_3STATE; } } else // No wxCHK_3STATE { if ( style & wxCHK_ALLOW_3RD_STATE_FOR_USER ) { wxFAIL_MSG( "wxCHK_ALLOW_3RD_STATE_FOR_USER doesn't make sense " "without wxCHK_3STATE" ); style &= ~wxCHK_ALLOW_3RD_STATE_FOR_USER; } } } private: wxDECLARE_NO_COPY_CLASS(wxCheckBoxBase); }; // Most ports support 3 state checkboxes so define this by default. #define wxHAS_3STATE_CHECKBOX #if defined(__WXUNIVERSAL__) #include "wx/univ/checkbox.h" #elif defined(__WXMSW__) #include "wx/msw/checkbox.h" #elif defined(__WXMOTIF__) #include "wx/motif/checkbox.h" #elif defined(__WXGTK20__) #include "wx/gtk/checkbox.h" #elif defined(__WXGTK__) #undef wxHAS_3STATE_CHECKBOX #include "wx/gtk1/checkbox.h" #elif defined(__WXMAC__) #include "wx/osx/checkbox.h" #elif defined(__WXQT__) #include "wx/qt/checkbox.h" #endif #endif // wxUSE_CHECKBOX #endif // _WX_CHECKBOX_H_BASE_
h
rticonnextdds-usecases
data/projects/rticonnextdds-usecases/VehicleTracking/ExampleCode/thirdparty/wxWidgets-3.1.2/Win64/include/wx/snglinst.h
/////////////////////////////////////////////////////////////////////////////// // Name: wx/snglinst.h // Purpose: wxSingleInstanceChecker can be used to restrict the number of // simultaneously running copies of a program to one // Author: Vadim Zeitlin // Modified by: // Created: 08.06.01 // Copyright: (c) 2001 Vadim Zeitlin <[email protected]> // Licence: wxWindows licence /////////////////////////////////////////////////////////////////////////////// #ifndef _WX_SNGLINST_H_ #define _WX_SNGLINST_H_ #if wxUSE_SNGLINST_CHECKER #include "wx/app.h" #include "wx/utils.h" // ---------------------------------------------------------------------------- // wxSingleInstanceChecker // ---------------------------------------------------------------------------- class WXDLLIMPEXP_BASE wxSingleInstanceChecker { public: // default ctor, use Create() after it wxSingleInstanceChecker() { Init(); } // like Create() but no error checking (dangerous!) wxSingleInstanceChecker(const wxString& name, const wxString& path = wxEmptyString) { Init(); Create(name, path); } // notice that calling Create() is optional now, if you don't do it before // calling IsAnotherRunning(), CreateDefault() is used automatically // // name it is used as the mutex name under Win32 and the lock file name // under Unix so it should be as unique as possible and must be non-empty // // path is optional and is ignored under Win32 and used as the directory to // create the lock file in under Unix (default is wxGetHomeDir()) // // returns false if initialization failed, it doesn't mean that another // instance is running - use IsAnotherRunning() to check it bool Create(const wxString& name, const wxString& path = wxEmptyString); // use the default name, which is a combination of wxTheApp->GetAppName() // and wxGetUserId() for mutex/lock file // // this is called implicitly by IsAnotherRunning() if the checker hadn't // been created until then bool CreateDefault() { wxCHECK_MSG( wxTheApp, false, "must have application instance" ); return Create(wxTheApp->GetAppName() + '-' + wxGetUserId()); } // is another copy of this program already running? bool IsAnotherRunning() const { if ( !m_impl ) { if ( !const_cast<wxSingleInstanceChecker *>(this)->CreateDefault() ) { // if creation failed, return false as it's better to not // prevent this instance from starting up if there is an error return false; } } return DoIsAnotherRunning(); } // dtor is not virtual, this class is not meant to be used polymorphically ~wxSingleInstanceChecker(); private: // common part of all ctors void Init() { m_impl = NULL; } // do check if another instance is running, called only if m_impl != NULL bool DoIsAnotherRunning() const; // the implementation details (platform specific) class WXDLLIMPEXP_FWD_BASE wxSingleInstanceCheckerImpl *m_impl; wxDECLARE_NO_COPY_CLASS(wxSingleInstanceChecker); }; #endif // wxUSE_SNGLINST_CHECKER #endif // _WX_SNGLINST_H_
h
rticonnextdds-usecases
data/projects/rticonnextdds-usecases/VehicleTracking/ExampleCode/thirdparty/wxWidgets-3.1.2/Win64/include/wx/tipdlg.h
/////////////////////////////////////////////////////////////////////////////// // Name: wx/tipdlg.h // Purpose: declaration of wxTipDialog // Author: Vadim Zeitlin // Modified by: // Created: 28.06.99 // Copyright: (c) Vadim Zeitlin // Licence: wxWindows licence /////////////////////////////////////////////////////////////////////////////// #ifndef _WX_TIPDLG_H_ #define _WX_TIPDLG_H_ // ---------------------------------------------------------------------------- // headers which we must include here // ---------------------------------------------------------------------------- #include "wx/defs.h" #if wxUSE_STARTUP_TIPS #include "wx/textfile.h" // ---------------------------------------------------------------------------- // wxTipProvider - a class which is used by wxTipDialog to get the text of the // tips // ---------------------------------------------------------------------------- // the abstract base class: it provides the tips, i.e. implements the GetTip() // function which returns the new tip each time it's called. To support this, // wxTipProvider evidently needs some internal state which is the tip "index" // and which should be saved/restored by the program to not always show one and // the same tip (of course, you may use random starting position as well...) class WXDLLIMPEXP_ADV wxTipProvider { public: wxTipProvider(size_t currentTip) { m_currentTip = currentTip; } // get the current tip and update the internal state to return the next tip // when called for the next time virtual wxString GetTip() = 0; // get the current tip "index" (or whatever allows the tip provider to know // from where to start the next time) size_t GetCurrentTip() const { return m_currentTip; } // virtual dtor for the base class virtual ~wxTipProvider() { } #if WXWIN_COMPATIBILITY_3_0 wxDEPRECATED_MSG("this method does nothing, simply don't call it") wxString PreprocessTip(const wxString& tip) { return tip; } #endif protected: size_t m_currentTip; }; // a function which returns an implementation of wxTipProvider using the // specified text file as the source of tips (each line is a tip). // // NB: the caller is responsible for deleting the pointer! #if wxUSE_TEXTFILE WXDLLIMPEXP_ADV wxTipProvider *wxCreateFileTipProvider(const wxString& filename, size_t currentTip); #endif // wxUSE_TEXTFILE // ---------------------------------------------------------------------------- // wxTipDialog // ---------------------------------------------------------------------------- // A dialog which shows a "tip" - a short and helpful messages describing to // the user some program characteristic. Many programs show the tips at // startup, so the dialog has "Show tips on startup" checkbox which allows to // the user to disable this (however, it's the program which should show, or // not, the dialog on startup depending on its value, not this class). // // The function returns true if this checkbox is checked, false otherwise. WXDLLIMPEXP_ADV bool wxShowTip(wxWindow *parent, wxTipProvider *tipProvider, bool showAtStartup = true); #endif // wxUSE_STARTUP_TIPS #endif // _WX_TIPDLG_H_
h
rticonnextdds-usecases
data/projects/rticonnextdds-usecases/VehicleTracking/ExampleCode/thirdparty/wxWidgets-3.1.2/Win64/include/wx/bmpbuttn.h
///////////////////////////////////////////////////////////////////////////// // Name: wx/bmpbuttn.h // Purpose: wxBitmapButton class interface // Author: Vadim Zeitlin // Modified by: // Created: 25.08.00 // Copyright: (c) 2000 Vadim Zeitlin // Licence: wxWindows licence ///////////////////////////////////////////////////////////////////////////// #ifndef _WX_BMPBUTTON_H_BASE_ #define _WX_BMPBUTTON_H_BASE_ #include "wx/defs.h" #if wxUSE_BMPBUTTON #include "wx/button.h" // FIXME: right now only wxMSW, wxGTK and wxOSX implement bitmap support in wxButton // itself, this shouldn't be used for the other platforms neither // when all of them do it #if (defined(__WXMSW__) || defined(__WXGTK20__) || defined(__WXOSX__) || defined(__WXQT__)) && !defined(__WXUNIVERSAL__) #define wxHAS_BUTTON_BITMAP #endif class WXDLLIMPEXP_FWD_CORE wxBitmapButton; // ---------------------------------------------------------------------------- // wxBitmapButton: a button which shows bitmaps instead of the usual string. // It has different bitmaps for different states (focused/disabled/pressed) // ---------------------------------------------------------------------------- class WXDLLIMPEXP_CORE wxBitmapButtonBase : public wxButton { public: wxBitmapButtonBase() { #ifndef wxHAS_BUTTON_BITMAP m_marginX = m_marginY = 0; #endif // wxHAS_BUTTON_BITMAP } bool Create(wxWindow *parent, wxWindowID winid, const wxPoint& pos, const wxSize& size, long style, const wxValidator& validator, const wxString& name) { // We use wxBU_NOTEXT to let the base class Create() know that we are // not going to show the label: this is a hack needed for wxGTK where // we can show both label and bitmap only with GTK 2.6+ but we always // can show just one of them and this style allows us to choose which // one we need. // // And we also use wxBU_EXACTFIT to avoid being resized up to the // standard button size as this doesn't make sense for bitmap buttons // which are not standard anyhow and should fit their bitmap size. return wxButton::Create(parent, winid, wxString(), pos, size, style | wxBU_NOTEXT | wxBU_EXACTFIT, validator, name); } // Special creation function for a standard "Close" bitmap. It allows to // simply create a close button with the image appropriate for the current // platform. static wxBitmapButton* NewCloseButton(wxWindow* parent, wxWindowID winid); // set/get the margins around the button virtual void SetMargins(int x, int y) { DoSetBitmapMargins(x, y); } int GetMarginX() const { return DoGetBitmapMargins().x; } int GetMarginY() const { return DoGetBitmapMargins().y; } protected: #ifndef wxHAS_BUTTON_BITMAP // function called when any of the bitmaps changes virtual void OnSetBitmap() { InvalidateBestSize(); Refresh(); } virtual wxBitmap DoGetBitmap(State which) const { return m_bitmaps[which]; } virtual void DoSetBitmap(const wxBitmap& bitmap, State which) { m_bitmaps[which] = bitmap; OnSetBitmap(); } virtual wxSize DoGetBitmapMargins() const { return wxSize(m_marginX, m_marginY); } virtual void DoSetBitmapMargins(int x, int y) { m_marginX = x; m_marginY = y; } // the bitmaps for various states wxBitmap m_bitmaps[State_Max]; // the margins around the bitmap int m_marginX, m_marginY; #endif // !wxHAS_BUTTON_BITMAP wxDECLARE_NO_COPY_CLASS(wxBitmapButtonBase); }; #if defined(__WXUNIVERSAL__) #include "wx/univ/bmpbuttn.h" #elif defined(__WXMSW__) #include "wx/msw/bmpbuttn.h" #elif defined(__WXMOTIF__) #include "wx/motif/bmpbuttn.h" #elif defined(__WXGTK20__) #include "wx/gtk/bmpbuttn.h" #elif defined(__WXGTK__) #include "wx/gtk1/bmpbuttn.h" #elif defined(__WXMAC__) #include "wx/osx/bmpbuttn.h" #elif defined(__WXQT__) #include "wx/qt/bmpbuttn.h" #endif #endif // wxUSE_BMPBUTTON #endif // _WX_BMPBUTTON_H_BASE_
h
rticonnextdds-usecases
data/projects/rticonnextdds-usecases/VehicleTracking/ExampleCode/thirdparty/wxWidgets-3.1.2/Win64/include/wx/sysopt.h
///////////////////////////////////////////////////////////////////////////// // Name: wx/sysopt.h // Purpose: wxSystemOptions // Author: Julian Smart // Modified by: // Created: 2001-07-10 // Copyright: (c) Julian Smart // Licence: wxWindows licence ///////////////////////////////////////////////////////////////////////////// #ifndef _WX_SYSOPT_H_ #define _WX_SYSOPT_H_ #include "wx/object.h" // ---------------------------------------------------------------------------- // Enables an application to influence the wxWidgets implementation // ---------------------------------------------------------------------------- class #if wxUSE_SYSTEM_OPTIONS WXDLLIMPEXP_BASE #endif wxSystemOptions : public wxObject { public: wxSystemOptions() { } // User-customizable hints to wxWidgets or associated libraries // These could also be used to influence GetSystem... calls, indeed // to implement SetSystemColour/Font/Metric #if wxUSE_SYSTEM_OPTIONS static void SetOption(const wxString& name, const wxString& value); static void SetOption(const wxString& name, int value); #endif // wxUSE_SYSTEM_OPTIONS static wxString GetOption(const wxString& name); static int GetOptionInt(const wxString& name); static bool HasOption(const wxString& name); static bool IsFalse(const wxString& name) { return HasOption(name) && GetOptionInt(name) == 0; } }; #if !wxUSE_SYSTEM_OPTIONS // define inline stubs for accessors to make it possible to use wxSystemOptions // in the library itself without checking for wxUSE_SYSTEM_OPTIONS all the time /* static */ inline wxString wxSystemOptions::GetOption(const wxString& WXUNUSED(name)) { return wxEmptyString; } /* static */ inline int wxSystemOptions::GetOptionInt(const wxString& WXUNUSED(name)) { return 0; } /* static */ inline bool wxSystemOptions::HasOption(const wxString& WXUNUSED(name)) { return false; } #endif // !wxUSE_SYSTEM_OPTIONS #endif // _WX_SYSOPT_H_
h
rticonnextdds-usecases
data/projects/rticonnextdds-usecases/VehicleTracking/ExampleCode/thirdparty/wxWidgets-3.1.2/Win64/include/wx/matrix.h
///////////////////////////////////////////////////////////////////////////// // Name: wx/matrix.h // Purpose: wxTransformMatrix class. NOT YET USED // Author: Chris Breeze, Julian Smart // Modified by: Klaas Holwerda // Created: 01/02/97 // Copyright: (c) Julian Smart, Chris Breeze // Licence: wxWindows licence ///////////////////////////////////////////////////////////////////////////// #ifndef _WX_MATRIXH__ #define _WX_MATRIXH__ //! headerfiles="matrix.h wx/object.h" #include "wx/object.h" #include "wx/math.h" //! codefiles="matrix.cpp" // A simple 3x3 matrix. This may be replaced by a more general matrix // class some day. // // Note: this is intended to be used in wxDC at some point to replace // the current system of scaling/translation. It is not yet used. //:definition // A 3x3 matrix to do 2D transformations. // It can be used to map data to window coordinates, // and also for manipulating your own data. // For example drawing a picture (composed of several primitives) // at a certain coordinate and angle within another parent picture. // At all times m_isIdentity is set if the matrix itself is an Identity matrix. // It is used where possible to optimize calculations. class WXDLLIMPEXP_CORE wxTransformMatrix: public wxObject { public: wxTransformMatrix(void); wxTransformMatrix(const wxTransformMatrix& mat); //get the value in the matrix at col,row //rows are horizontal (second index of m_matrix member) //columns are vertical (first index of m_matrix member) double GetValue(int col, int row) const; //set the value in the matrix at col,row //rows are horizontal (second index of m_matrix member) //columns are vertical (first index of m_matrix member) void SetValue(int col, int row, double value); void operator = (const wxTransformMatrix& mat); bool operator == (const wxTransformMatrix& mat) const; bool operator != (const wxTransformMatrix& mat) const; //multiply every element by t wxTransformMatrix& operator*=(const double& t); //divide every element by t wxTransformMatrix& operator/=(const double& t); //add matrix m to this t wxTransformMatrix& operator+=(const wxTransformMatrix& m); //subtract matrix m from this wxTransformMatrix& operator-=(const wxTransformMatrix& m); //multiply matrix m with this wxTransformMatrix& operator*=(const wxTransformMatrix& m); // constant operators //multiply every element by t and return result wxTransformMatrix operator*(const double& t) const; //divide this matrix by t and return result wxTransformMatrix operator/(const double& t) const; //add matrix m to this and return result wxTransformMatrix operator+(const wxTransformMatrix& m) const; //subtract matrix m from this and return result wxTransformMatrix operator-(const wxTransformMatrix& m) const; //multiply this by matrix m and return result wxTransformMatrix operator*(const wxTransformMatrix& m) const; wxTransformMatrix operator-() const; //rows are horizontal (second index of m_matrix member) //columns are vertical (first index of m_matrix member) double& operator()(int col, int row); //rows are horizontal (second index of m_matrix member) //columns are vertical (first index of m_matrix member) double operator()(int col, int row) const; // Invert matrix bool Invert(void); // Make into identity matrix bool Identity(void); // Is the matrix the identity matrix? // Only returns a flag, which is set whenever an operation // is done. inline bool IsIdentity(void) const { return m_isIdentity; } // This does an actual check. inline bool IsIdentity1(void) const ; //Scale by scale (isotropic scaling i.e. the same in x and y): //!ex: //!code: | scale 0 0 | //!code: matrix' = | 0 scale 0 | x matrix //!code: | 0 0 scale | bool Scale(double scale); //Scale with center point and x/y scale // //!ex: //!code: | xs 0 xc(1-xs) | //!code: matrix' = | 0 ys yc(1-ys) | x matrix //!code: | 0 0 1 | wxTransformMatrix& Scale(const double &xs, const double &ys,const double &xc, const double &yc); // mirror a matrix in x, y //!ex: //!code: | -1 0 0 | //!code: matrix' = | 0 -1 0 | x matrix //!code: | 0 0 1 | wxTransformMatrix& Mirror(bool x=true, bool y=false); // Translate by dx, dy: //!ex: //!code: | 1 0 dx | //!code: matrix' = | 0 1 dy | x matrix //!code: | 0 0 1 | bool Translate(double x, double y); // Rotate clockwise by the given number of degrees: //!ex: //!code: | cos sin 0 | //!code: matrix' = | -sin cos 0 | x matrix //!code: | 0 0 1 | bool Rotate(double angle); //Rotate counter clockwise with point of rotation // //!ex: //!code: | cos(r) -sin(r) x(1-cos(r))+y(sin(r)| //!code: matrix' = | sin(r) cos(r) y(1-cos(r))-x(sin(r)| x matrix //!code: | 0 0 1 | wxTransformMatrix& Rotate(const double &r, const double &x, const double &y); // Transform X value from logical to device inline double TransformX(double x) const; // Transform Y value from logical to device inline double TransformY(double y) const; // Transform a point from logical to device coordinates bool TransformPoint(double x, double y, double& tx, double& ty) const; // Transform a point from device to logical coordinates. // Example of use: // wxTransformMatrix mat = dc.GetTransformation(); // mat.Invert(); // mat.InverseTransformPoint(x, y, x1, y1); // OR (shorthand:) // dc.LogicalToDevice(x, y, x1, y1); // The latter is slightly less efficient if we're doing several // conversions, since the matrix is inverted several times. // N.B. 'this' matrix is the inverse at this point bool InverseTransformPoint(double x, double y, double& tx, double& ty) const; double Get_scaleX(); double Get_scaleY(); double GetRotation(); void SetRotation(double rotation); public: double m_matrix[3][3]; bool m_isIdentity; }; /* Chris Breeze reported, that some functions of wxTransformMatrix cannot work because it is not known if he matrix has been inverted. Be careful when using it. */ // Transform X value from logical to device // warning: this function can only be used for this purpose // because no rotation is involved when mapping logical to device coordinates // mirror and scaling for x and y will be part of the matrix // if you have a matrix that is rotated, eg a shape containing a matrix to place // it in the logical coordinate system, use TransformPoint inline double wxTransformMatrix::TransformX(double x) const { //normally like this, but since no rotation is involved (only mirror and scale) //we can do without Y -> m_matrix[1]{0] is -sin(rotation angle) and therefore zero //(x * m_matrix[0][0] + y * m_matrix[1][0] + m_matrix[2][0])) return (m_isIdentity ? x : (x * m_matrix[0][0] + m_matrix[2][0])); } // Transform Y value from logical to device // warning: this function can only be used for this purpose // because no rotation is involved when mapping logical to device coordinates // mirror and scaling for x and y will be part of the matrix // if you have a matrix that is rotated, eg a shape containing a matrix to place // it in the logical coordinate system, use TransformPoint inline double wxTransformMatrix::TransformY(double y) const { //normally like this, but since no rotation is involved (only mirror and scale) //we can do without X -> m_matrix[0]{1] is sin(rotation angle) and therefore zero //(x * m_matrix[0][1] + y * m_matrix[1][1] + m_matrix[2][1])) return (m_isIdentity ? y : (y * m_matrix[1][1] + m_matrix[2][1])); } // Is the matrix the identity matrix? // Each operation checks whether the result is still the identity matrix and sets a flag. inline bool wxTransformMatrix::IsIdentity1(void) const { return ( wxIsSameDouble(m_matrix[0][0], 1.0) && wxIsSameDouble(m_matrix[1][1], 1.0) && wxIsSameDouble(m_matrix[2][2], 1.0) && wxIsSameDouble(m_matrix[1][0], 0.0) && wxIsSameDouble(m_matrix[2][0], 0.0) && wxIsSameDouble(m_matrix[0][1], 0.0) && wxIsSameDouble(m_matrix[2][1], 0.0) && wxIsSameDouble(m_matrix[0][2], 0.0) && wxIsSameDouble(m_matrix[1][2], 0.0) ); } // Calculates the determinant of a 2 x 2 matrix inline double wxCalculateDet(double a11, double a21, double a12, double a22) { return a11 * a22 - a12 * a21; } #endif // _WX_MATRIXH__
h
rticonnextdds-usecases
data/projects/rticonnextdds-usecases/VehicleTracking/ExampleCode/thirdparty/wxWidgets-3.1.2/Win64/include/wx/custombgwin.h
/////////////////////////////////////////////////////////////////////////////// // Name: wx/custombgwin.h // Purpose: Class adding support for custom window backgrounds. // Author: Vadim Zeitlin // Created: 2011-10-10 // Copyright: (c) 2011 Vadim Zeitlin <[email protected]> // Licence: wxWindows licence /////////////////////////////////////////////////////////////////////////////// #ifndef _WX_CUSTOMBGWIN_H_ #define _WX_CUSTOMBGWIN_H_ #include "wx/defs.h" class WXDLLIMPEXP_FWD_CORE wxBitmap; // ---------------------------------------------------------------------------- // wxCustomBackgroundWindow: Adds support for custom backgrounds to any // wxWindow-derived class. // ---------------------------------------------------------------------------- class wxCustomBackgroundWindowBase { public: // Trivial default ctor. wxCustomBackgroundWindowBase() { } // Also a trivial but virtual -- to suppress g++ warnings -- dtor. virtual ~wxCustomBackgroundWindowBase() { } // Use the given bitmap to tile the background of this window. This bitmap // will show through any transparent children. // // Notice that you must not prevent the base class EVT_ERASE_BACKGROUND // handler from running (i.e. not to handle this event yourself) for this // to work. void SetBackgroundBitmap(const wxBitmap& bmp) { DoSetBackgroundBitmap(bmp); } protected: virtual void DoSetBackgroundBitmap(const wxBitmap& bmp) = 0; wxDECLARE_NO_COPY_CLASS(wxCustomBackgroundWindowBase); }; #if defined(__WXUNIVERSAL__) #include "wx/univ/custombgwin.h" #elif defined(__WXMSW__) #include "wx/msw/custombgwin.h" #else #include "wx/generic/custombgwin.h" #endif #endif // _WX_CUSTOMBGWIN_H_
h
rticonnextdds-usecases
data/projects/rticonnextdds-usecases/VehicleTracking/ExampleCode/thirdparty/wxWidgets-3.1.2/Win64/include/wx/textfile.h
/////////////////////////////////////////////////////////////////////////////// // Name: wx/textfile.h // Purpose: class wxTextFile to work with text files of _small_ size // (file is fully loaded in memory) and which understands CR/LF // differences between platforms. // Author: Vadim Zeitlin // Modified by: // Created: 03.04.98 // Copyright: (c) 1998 Vadim Zeitlin <[email protected]> // Licence: wxWindows licence /////////////////////////////////////////////////////////////////////////////// #ifndef _WX_TEXTFILE_H #define _WX_TEXTFILE_H #include "wx/defs.h" #include "wx/textbuf.h" #if wxUSE_TEXTFILE #include "wx/file.h" // ---------------------------------------------------------------------------- // wxTextFile // ---------------------------------------------------------------------------- class WXDLLIMPEXP_BASE wxTextFile : public wxTextBuffer { public: // constructors wxTextFile() { } wxTextFile(const wxString& strFileName); protected: // implement the base class pure virtuals virtual bool OnExists() const wxOVERRIDE; virtual bool OnOpen(const wxString &strBufferName, wxTextBufferOpenMode openMode) wxOVERRIDE; virtual bool OnClose() wxOVERRIDE; virtual bool OnRead(const wxMBConv& conv) wxOVERRIDE; virtual bool OnWrite(wxTextFileType typeNew, const wxMBConv& conv) wxOVERRIDE; private: wxFile m_file; wxDECLARE_NO_COPY_CLASS(wxTextFile); }; #else // !wxUSE_TEXTFILE // old code relies on the static methods of wxTextFile being always available // and they still are available in wxTextBuffer (even if !wxUSE_TEXTBUFFER), so // make it possible to use them in a backwards compatible way typedef wxTextBuffer wxTextFile; #endif // wxUSE_TEXTFILE/!wxUSE_TEXTFILE #endif // _WX_TEXTFILE_H
h
rticonnextdds-usecases
data/projects/rticonnextdds-usecases/VehicleTracking/ExampleCode/thirdparty/wxWidgets-3.1.2/Win64/include/wx/mediactrl.h
/////////////////////////////////////////////////////////////////////////////// // Name: wx/mediactrl.h // Purpose: wxMediaCtrl class // Author: Ryan Norton <[email protected]> // Modified by: // Created: 11/07/04 // Copyright: (c) Ryan Norton // Licence: wxWindows licence /////////////////////////////////////////////////////////////////////////////// // ============================================================================ // Definitions // ============================================================================ // ---------------------------------------------------------------------------- // Header guard // ---------------------------------------------------------------------------- #ifndef _WX_MEDIACTRL_H_ #define _WX_MEDIACTRL_H_ // ---------------------------------------------------------------------------- // Pre-compiled header stuff // ---------------------------------------------------------------------------- #include "wx/defs.h" // ---------------------------------------------------------------------------- // Compilation guard // ---------------------------------------------------------------------------- #if wxUSE_MEDIACTRL // ---------------------------------------------------------------------------- // Includes // ---------------------------------------------------------------------------- #include "wx/control.h" #include "wx/uri.h" // ============================================================================ // Declarations // ============================================================================ // ---------------------------------------------------------------------------- // // Enumerations // // ---------------------------------------------------------------------------- enum wxMediaState { wxMEDIASTATE_STOPPED, wxMEDIASTATE_PAUSED, wxMEDIASTATE_PLAYING }; enum wxMediaCtrlPlayerControls { wxMEDIACTRLPLAYERCONTROLS_NONE = 0, //Step controls like fastforward, step one frame etc. wxMEDIACTRLPLAYERCONTROLS_STEP = 1 << 0, //Volume controls like the speaker icon, volume slider, etc. wxMEDIACTRLPLAYERCONTROLS_VOLUME = 1 << 1, wxMEDIACTRLPLAYERCONTROLS_DEFAULT = wxMEDIACTRLPLAYERCONTROLS_STEP | wxMEDIACTRLPLAYERCONTROLS_VOLUME }; #define wxMEDIABACKEND_DIRECTSHOW wxT("wxAMMediaBackend") #define wxMEDIABACKEND_MCI wxT("wxMCIMediaBackend") #define wxMEDIABACKEND_QUICKTIME wxT("wxQTMediaBackend") #define wxMEDIABACKEND_GSTREAMER wxT("wxGStreamerMediaBackend") #define wxMEDIABACKEND_REALPLAYER wxT("wxRealPlayerMediaBackend") #define wxMEDIABACKEND_WMP10 wxT("wxWMP10MediaBackend") // ---------------------------------------------------------------------------- // // wxMediaEvent // // ---------------------------------------------------------------------------- class WXDLLIMPEXP_MEDIA wxMediaEvent : public wxNotifyEvent { public: // ------------------------------------------------------------------------ // wxMediaEvent Constructor // // Normal constructor, much the same as wxNotifyEvent // ------------------------------------------------------------------------ wxMediaEvent(wxEventType commandType = wxEVT_NULL, int winid = 0) : wxNotifyEvent(commandType, winid) { } // ------------------------------------------------------------------------ // wxMediaEvent Copy Constructor // // Normal copy constructor, much the same as wxNotifyEvent // ------------------------------------------------------------------------ wxMediaEvent(const wxMediaEvent &clone) : wxNotifyEvent(clone) { } // ------------------------------------------------------------------------ // wxMediaEvent::Clone // // Allocates a copy of this object. // Required for wxEvtHandler::AddPendingEvent // ------------------------------------------------------------------------ virtual wxEvent *Clone() const wxOVERRIDE { return new wxMediaEvent(*this); } // Put this class on wxWidget's RTTI table wxDECLARE_DYNAMIC_CLASS(wxMediaEvent); }; // ---------------------------------------------------------------------------- // // wxMediaCtrl // // ---------------------------------------------------------------------------- class WXDLLIMPEXP_MEDIA wxMediaCtrl : public wxControl { public: wxMediaCtrl() : m_imp(NULL), m_bLoaded(false) { } wxMediaCtrl(wxWindow* parent, wxWindowID winid, const wxString& fileName = wxEmptyString, const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxDefaultSize, long style = 0, const wxString& szBackend = wxEmptyString, const wxValidator& validator = wxDefaultValidator, const wxString& name = wxT("mediaCtrl")) : m_imp(NULL), m_bLoaded(false) { Create(parent, winid, fileName, pos, size, style, szBackend, validator, name); } wxMediaCtrl(wxWindow* parent, wxWindowID winid, const wxURI& location, const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxDefaultSize, long style = 0, const wxString& szBackend = wxEmptyString, const wxValidator& validator = wxDefaultValidator, const wxString& name = wxT("mediaCtrl")) : m_imp(NULL), m_bLoaded(false) { Create(parent, winid, location, pos, size, style, szBackend, validator, name); } virtual ~wxMediaCtrl(); bool Create(wxWindow* parent, wxWindowID winid, const wxString& fileName = wxEmptyString, const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxDefaultSize, long style = 0, const wxString& szBackend = wxEmptyString, const wxValidator& validator = wxDefaultValidator, const wxString& name = wxT("mediaCtrl")); bool Create(wxWindow* parent, wxWindowID winid, const wxURI& location, const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxDefaultSize, long style = 0, const wxString& szBackend = wxEmptyString, const wxValidator& validator = wxDefaultValidator, const wxString& name = wxT("mediaCtrl")); bool DoCreate(const wxClassInfo* instance, wxWindow* parent, wxWindowID winid, const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxDefaultSize, long style = 0, const wxValidator& validator = wxDefaultValidator, const wxString& name = wxT("mediaCtrl")); bool Play(); bool Pause(); bool Stop(); bool Load(const wxString& fileName); wxMediaState GetState(); wxFileOffset Seek(wxFileOffset where, wxSeekMode mode = wxFromStart); wxFileOffset Tell(); //FIXME: This should be const wxFileOffset Length(); //FIXME: This should be const double GetPlaybackRate(); //All but MCI & GStreamer bool SetPlaybackRate(double dRate); //All but MCI & GStreamer bool Load(const wxURI& location); bool Load(const wxURI& location, const wxURI& proxy); wxFileOffset GetDownloadProgress(); // DirectShow only wxFileOffset GetDownloadTotal(); // DirectShow only double GetVolume(); bool SetVolume(double dVolume); bool ShowPlayerControls( wxMediaCtrlPlayerControls flags = wxMEDIACTRLPLAYERCONTROLS_DEFAULT); //helpers for the wxPython people bool LoadURI(const wxString& fileName) { return Load(wxURI(fileName)); } bool LoadURIWithProxy(const wxString& fileName, const wxString& proxy) { return Load(wxURI(fileName), wxURI(proxy)); } protected: static const wxClassInfo* NextBackend(wxClassInfo::const_iterator* it); void OnMediaFinished(wxMediaEvent& evt); virtual void DoMoveWindow(int x, int y, int w, int h) wxOVERRIDE; wxSize DoGetBestSize() const wxOVERRIDE; class wxMediaBackend* m_imp; bool m_bLoaded; wxDECLARE_DYNAMIC_CLASS(wxMediaCtrl); }; // ---------------------------------------------------------------------------- // // wxMediaBackend // // Derive from this and use standard wxWidgets RTTI // (wxDECLARE_DYNAMIC_CLASS and wxIMPLEMENT_CLASS) to make a backend // for wxMediaCtrl. Backends are searched alphabetically - // the one with the earliest letter is tried first. // // Note that this is currently not API or ABI compatible - // so statically link or make the client compile on-site. // // ---------------------------------------------------------------------------- class WXDLLIMPEXP_MEDIA wxMediaBackend : public wxObject { public: wxMediaBackend() { } virtual ~wxMediaBackend(); virtual bool CreateControl(wxControl* WXUNUSED(ctrl), wxWindow* WXUNUSED(parent), wxWindowID WXUNUSED(winid), const wxPoint& WXUNUSED(pos), const wxSize& WXUNUSED(size), long WXUNUSED(style), const wxValidator& WXUNUSED(validator), const wxString& WXUNUSED(name)) { return false; } virtual bool Play() { return false; } virtual bool Pause() { return false; } virtual bool Stop() { return false; } virtual bool Load(const wxString& WXUNUSED(fileName)) { return false; } virtual bool Load(const wxURI& WXUNUSED(location)) { return false; } virtual bool SetPosition(wxLongLong WXUNUSED(where)) { return 0; } virtual wxLongLong GetPosition() { return 0; } virtual wxLongLong GetDuration() { return 0; } virtual void Move(int WXUNUSED(x), int WXUNUSED(y), int WXUNUSED(w), int WXUNUSED(h)) { } virtual wxSize GetVideoSize() const { return wxSize(0,0); } virtual double GetPlaybackRate() { return 0.0; } virtual bool SetPlaybackRate(double WXUNUSED(dRate)) { return false; } virtual wxMediaState GetState() { return wxMEDIASTATE_STOPPED; } virtual double GetVolume() { return 0.0; } virtual bool SetVolume(double WXUNUSED(dVolume)) { return false; } virtual bool Load(const wxURI& WXUNUSED(location), const wxURI& WXUNUSED(proxy)) { return false; } virtual bool ShowPlayerControls( wxMediaCtrlPlayerControls WXUNUSED(flags)) { return false; } virtual bool IsInterfaceShown() { return false; } virtual wxLongLong GetDownloadProgress() { return 0; } virtual wxLongLong GetDownloadTotal() { return 0; } virtual void MacVisibilityChanged() { } virtual void RESERVED9() {} wxDECLARE_DYNAMIC_CLASS(wxMediaBackend); }; //Our events wxDECLARE_EXPORTED_EVENT( WXDLLIMPEXP_MEDIA, wxEVT_MEDIA_FINISHED, wxMediaEvent ); wxDECLARE_EXPORTED_EVENT( WXDLLIMPEXP_MEDIA, wxEVT_MEDIA_STOP, wxMediaEvent ); //Function type(s) our events need typedef void (wxEvtHandler::*wxMediaEventFunction)(wxMediaEvent&); #define wxMediaEventHandler(func) \ wxEVENT_HANDLER_CAST(wxMediaEventFunction, func) //Macro for usage with message maps #define EVT_MEDIA_FINISHED(winid, fn) wxDECLARE_EVENT_TABLE_ENTRY( wxEVT_MEDIA_FINISHED, winid, wxID_ANY, wxMediaEventHandler(fn), NULL ), #define EVT_MEDIA_STOP(winid, fn) wxDECLARE_EVENT_TABLE_ENTRY( wxEVT_MEDIA_STOP, winid, wxID_ANY, wxMediaEventHandler(fn), NULL ), wxDECLARE_EXPORTED_EVENT( WXDLLIMPEXP_MEDIA, wxEVT_MEDIA_LOADED, wxMediaEvent ); #define EVT_MEDIA_LOADED(winid, fn) wxDECLARE_EVENT_TABLE_ENTRY( wxEVT_MEDIA_LOADED, winid, wxID_ANY, wxMediaEventHandler(fn), NULL ), wxDECLARE_EXPORTED_EVENT( WXDLLIMPEXP_MEDIA, wxEVT_MEDIA_STATECHANGED, wxMediaEvent ); wxDECLARE_EXPORTED_EVENT( WXDLLIMPEXP_MEDIA, wxEVT_MEDIA_PLAY, wxMediaEvent ); wxDECLARE_EXPORTED_EVENT( WXDLLIMPEXP_MEDIA, wxEVT_MEDIA_PAUSE, wxMediaEvent ); #define EVT_MEDIA_STATECHANGED(winid, fn) wxDECLARE_EVENT_TABLE_ENTRY( wxEVT_MEDIA_STATECHANGED, winid, wxID_ANY, wxMediaEventHandler(fn), NULL ), #define EVT_MEDIA_PLAY(winid, fn) wxDECLARE_EVENT_TABLE_ENTRY( wxEVT_MEDIA_PLAY, winid, wxID_ANY, wxMediaEventHandler(fn), NULL ), #define EVT_MEDIA_PAUSE(winid, fn) wxDECLARE_EVENT_TABLE_ENTRY( wxEVT_MEDIA_PAUSE, winid, wxID_ANY, wxMediaEventHandler(fn), NULL ), // ---------------------------------------------------------------------------- // common backend base class used by many other backends // ---------------------------------------------------------------------------- class WXDLLIMPEXP_MEDIA wxMediaBackendCommonBase : public wxMediaBackend { public: // add a pending wxMediaEvent of the given type void QueueEvent(wxEventType evtType); // notify that the movie playback is finished void QueueFinishEvent() { QueueEvent(wxEVT_MEDIA_STATECHANGED); QueueEvent(wxEVT_MEDIA_FINISHED); } // send the stop event and return true if it hasn't been vetoed bool SendStopEvent(); // Queue pause event void QueuePlayEvent(); // Queue pause event void QueuePauseEvent(); // Queue stop event (no veto) void QueueStopEvent(); protected: // call this when the movie size has changed but not because it has just // been loaded (in this case, call NotifyMovieLoaded() below) void NotifyMovieSizeChanged(); // call this when the movie is fully loaded void NotifyMovieLoaded(); wxMediaCtrl *m_ctrl; // parent control }; // ---------------------------------------------------------------------------- // End compilation guard // ---------------------------------------------------------------------------- #endif // wxUSE_MEDIACTRL // ---------------------------------------------------------------------------- // End header guard and header itself // ---------------------------------------------------------------------------- #endif // _WX_MEDIACTRL_H_
h
rticonnextdds-usecases
data/projects/rticonnextdds-usecases/VehicleTracking/ExampleCode/thirdparty/wxWidgets-3.1.2/Win64/include/wx/convauto.h
/////////////////////////////////////////////////////////////////////////////// // Name: wx/convauto.h // Purpose: wxConvAuto class declaration // Author: Vadim Zeitlin // Created: 2006-04-03 // Copyright: (c) 2006 Vadim Zeitlin // Licence: wxWindows licence /////////////////////////////////////////////////////////////////////////////// #ifndef _WX_CONVAUTO_H_ #define _WX_CONVAUTO_H_ #include "wx/strconv.h" #include "wx/fontenc.h" // ---------------------------------------------------------------------------- // wxConvAuto: uses BOM to automatically detect input encoding // ---------------------------------------------------------------------------- // All currently recognized BOM values. enum wxBOM { wxBOM_Unknown = -1, wxBOM_None, wxBOM_UTF32BE, wxBOM_UTF32LE, wxBOM_UTF16BE, wxBOM_UTF16LE, wxBOM_UTF8 }; class WXDLLIMPEXP_BASE wxConvAuto : public wxMBConv { public: // default ctor, the real conversion will be created on demand wxConvAuto(wxFontEncoding enc = wxFONTENCODING_DEFAULT) { Init(); m_encDefault = enc; } // copy ctor doesn't initialize anything neither as conversion can only be // deduced on first use wxConvAuto(const wxConvAuto& other) : wxMBConv() { Init(); m_encDefault = other.m_encDefault; } virtual ~wxConvAuto() { if ( m_ownsConv ) delete m_conv; } // get/set the fall-back encoding used when the input text doesn't have BOM // and isn't UTF-8 // // special values are wxFONTENCODING_MAX meaning not to use any fall back // at all (but just fail to convert in this case) and wxFONTENCODING_SYSTEM // meaning to use the encoding of the system locale static wxFontEncoding GetFallbackEncoding() { return ms_defaultMBEncoding; } static void SetFallbackEncoding(wxFontEncoding enc); static void DisableFallbackEncoding() { SetFallbackEncoding(wxFONTENCODING_MAX); } // override the base class virtual function(s) to use our m_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 { return m_conv->GetMBNulLen(); } virtual wxMBConv *Clone() const wxOVERRIDE { return new wxConvAuto(*this); } // return the BOM type of this buffer static wxBOM DetectBOM(const char *src, size_t srcLen); // return the characters composing the given BOM. static const char* GetBOMChars(wxBOM bomType, size_t* count); wxBOM GetBOM() const { return m_bomType; } private: // common part of all ctors void Init() { // We don't initialize m_encDefault here as different ctors do it // differently. m_conv = NULL; m_bomType = wxBOM_Unknown; m_ownsConv = false; m_consumedBOM = false; } // initialize m_conv with the UTF-8 conversion void InitWithUTF8() { m_conv = &wxConvUTF8; m_ownsConv = false; } // create the correct conversion object for the given BOM type void InitFromBOM(wxBOM bomType); // create the correct conversion object for the BOM present in the // beginning of the buffer // // return false if the buffer is too short to allow us to determine if we // have BOM or not bool InitFromInput(const char *src, size_t len); // adjust src and len to skip over the BOM (identified by m_bomType) at the // start of the buffer void SkipBOM(const char **src, size_t *len) const; // fall-back multibyte encoding to use, may be wxFONTENCODING_SYSTEM or // wxFONTENCODING_MAX but not wxFONTENCODING_DEFAULT static wxFontEncoding ms_defaultMBEncoding; // conversion object which we really use, NULL until the first call to // either ToWChar() or FromWChar() wxMBConv *m_conv; // the multibyte encoding to use by default if input isn't Unicode wxFontEncoding m_encDefault; // our BOM type wxBOM m_bomType; // true if we allocated m_conv ourselves, false if we just use an existing // global conversion bool m_ownsConv; // true if we already skipped BOM when converting (and not just calculating // the size) bool m_consumedBOM; wxDECLARE_NO_ASSIGN_CLASS(wxConvAuto); }; #endif // _WX_CONVAUTO_H_
h
rticonnextdds-usecases
data/projects/rticonnextdds-usecases/VehicleTracking/ExampleCode/thirdparty/wxWidgets-3.1.2/Win64/include/wx/cmdline.h
/////////////////////////////////////////////////////////////////////////////// // Name: wx/cmdline.h // Purpose: wxCmdLineParser and related classes for parsing the command // line options // Author: Vadim Zeitlin // Modified by: // Created: 04.01.00 // Copyright: (c) 2000 Vadim Zeitlin <[email protected]> // Licence: wxWindows licence /////////////////////////////////////////////////////////////////////////////// #ifndef _WX_CMDLINE_H_ #define _WX_CMDLINE_H_ #include "wx/defs.h" #include "wx/string.h" #include "wx/arrstr.h" #include "wx/cmdargs.h" // determines ConvertStringToArgs() behaviour enum wxCmdLineSplitType { wxCMD_LINE_SPLIT_DOS, wxCMD_LINE_SPLIT_UNIX }; #if wxUSE_CMDLINE_PARSER class WXDLLIMPEXP_FWD_BASE wxCmdLineParser; class WXDLLIMPEXP_FWD_BASE wxDateTime; // ---------------------------------------------------------------------------- // constants // ---------------------------------------------------------------------------- // by default, options are optional (sic) and each call to AddParam() allows // one more parameter - this may be changed by giving non-default flags to it enum wxCmdLineEntryFlags { wxCMD_LINE_OPTION_MANDATORY = 0x01, // this option must be given wxCMD_LINE_PARAM_OPTIONAL = 0x02, // the parameter may be omitted wxCMD_LINE_PARAM_MULTIPLE = 0x04, // the parameter may be repeated wxCMD_LINE_OPTION_HELP = 0x08, // this option is a help request wxCMD_LINE_NEEDS_SEPARATOR = 0x10, // must have sep before the value wxCMD_LINE_SWITCH_NEGATABLE = 0x20, // this switch can be negated (e.g. /S-) wxCMD_LINE_HIDDEN = 0x40 // this switch is not listed by Usage() }; // an option value or parameter may be a string (the most common case), a // number or a date enum wxCmdLineParamType { wxCMD_LINE_VAL_STRING, // should be 0 (default) wxCMD_LINE_VAL_NUMBER, wxCMD_LINE_VAL_DATE, wxCMD_LINE_VAL_DOUBLE, wxCMD_LINE_VAL_NONE }; // for constructing the cmd line description using Init() enum wxCmdLineEntryType { wxCMD_LINE_SWITCH, wxCMD_LINE_OPTION, wxCMD_LINE_PARAM, wxCMD_LINE_USAGE_TEXT, wxCMD_LINE_NONE // to terminate the list }; // Possible return values of wxCmdLineParser::FoundSwitch() enum wxCmdLineSwitchState { wxCMD_SWITCH_OFF = -1, // Found but turned off/negated. wxCMD_SWITCH_NOT_FOUND, // Not found at all. wxCMD_SWITCH_ON // Found in normal state. }; // ---------------------------------------------------------------------------- // wxCmdLineEntryDesc is a description of one command line // switch/option/parameter // ---------------------------------------------------------------------------- struct wxCmdLineEntryDesc { wxCmdLineEntryType kind; const char *shortName; const char *longName; const char *description; wxCmdLineParamType type; int flags; }; // the list of wxCmdLineEntryDesc objects should be terminated with this one #define wxCMD_LINE_DESC_END \ { wxCMD_LINE_NONE, NULL, NULL, NULL, wxCMD_LINE_VAL_NONE, 0x0 } // ---------------------------------------------------------------------------- // wxCmdLineArg contains the value for one command line argument // ---------------------------------------------------------------------------- class WXDLLIMPEXP_BASE wxCmdLineArg { public: virtual ~wxCmdLineArg() {} virtual double GetDoubleVal() const = 0; virtual long GetLongVal() const = 0; virtual const wxString& GetStrVal() const = 0; #if wxUSE_DATETIME virtual const wxDateTime& GetDateVal() const = 0; #endif // wxUSE_DATETIME virtual bool IsNegated() const = 0; virtual wxCmdLineEntryType GetKind() const = 0; virtual wxString GetShortName() const = 0; virtual wxString GetLongName() const = 0; virtual wxCmdLineParamType GetType() const = 0; }; // ---------------------------------------------------------------------------- // wxCmdLineArgs is a container of command line arguments actually parsed and // allows enumerating them using the standard iterator-based approach. // ---------------------------------------------------------------------------- class WXDLLIMPEXP_BASE wxCmdLineArgs { public: class WXDLLIMPEXP_BASE const_iterator { public: typedef int difference_type; typedef wxCmdLineArg value_type; typedef const wxCmdLineArg* pointer; typedef const wxCmdLineArg& reference; // We avoid dependency on standard library by default but if we do use // std::string, then it's ok to use iterator tags as well. #if wxUSE_STD_STRING typedef std::bidirectional_iterator_tag iterator_category; #endif // wx_USE_STD_STRING const_iterator() : m_parser(NULL), m_index(0) {} reference operator *() const; pointer operator ->() const; const_iterator &operator ++ (); const_iterator operator ++ (int); const_iterator &operator -- (); const_iterator operator -- (int); bool operator == (const const_iterator &other) const { return m_parser==other.m_parser && m_index==other.m_index; } bool operator != (const const_iterator &other) const { return !operator==(other); } private: const_iterator (const wxCmdLineParser& parser, size_t index) : m_parser(&parser), m_index(index) { } const wxCmdLineParser* m_parser; size_t m_index; friend class wxCmdLineArgs; }; wxCmdLineArgs (const wxCmdLineParser& parser) : m_parser(parser) {} const_iterator begin() const { return const_iterator(m_parser, 0); } const_iterator end() const { return const_iterator(m_parser, size()); } size_t size() const; private: const wxCmdLineParser& m_parser; wxDECLARE_NO_ASSIGN_CLASS(wxCmdLineArgs); }; // ---------------------------------------------------------------------------- // wxCmdLineParser is a class for parsing command line. // // It has the following features: // // 1. distinguishes options, switches and parameters; allows option grouping // 2. allows both short and long options // 3. automatically generates the usage message from the cmd line description // 4. does type checks on the options values (number, date, ...) // // To use it you should: // // 1. construct it giving it the cmd line to parse and optionally its desc // 2. construct the cmd line description using AddXXX() if not done in (1) // 3. call Parse() // 4. use GetXXX() to retrieve the parsed info // ---------------------------------------------------------------------------- class WXDLLIMPEXP_BASE wxCmdLineParser { public: // ctors and initializers // ---------------------- // default ctor or ctor giving the cmd line in either Unix or Win form wxCmdLineParser() { Init(); } wxCmdLineParser(int argc, char **argv) { Init(); SetCmdLine(argc, argv); } #if wxUSE_UNICODE wxCmdLineParser(int argc, wxChar **argv) { Init(); SetCmdLine(argc, argv); } wxCmdLineParser(int argc, const wxCmdLineArgsArray& argv) { Init(); SetCmdLine(argc, argv); } #endif // wxUSE_UNICODE wxCmdLineParser(const wxString& cmdline) { Init(); SetCmdLine(cmdline); } // the same as above, but also gives the cmd line description - otherwise, // use AddXXX() later wxCmdLineParser(const wxCmdLineEntryDesc *desc) { Init(); SetDesc(desc); } wxCmdLineParser(const wxCmdLineEntryDesc *desc, int argc, char **argv) { Init(); SetCmdLine(argc, argv); SetDesc(desc); } #if wxUSE_UNICODE wxCmdLineParser(const wxCmdLineEntryDesc *desc, int argc, wxChar **argv) { Init(); SetCmdLine(argc, argv); SetDesc(desc); } wxCmdLineParser(const wxCmdLineEntryDesc *desc, int argc, const wxCmdLineArgsArray& argv) { Init(); SetCmdLine(argc, argv); SetDesc(desc); } #endif // wxUSE_UNICODE wxCmdLineParser(const wxCmdLineEntryDesc *desc, const wxString& cmdline) { Init(); SetCmdLine(cmdline); SetDesc(desc); } // set cmd line to parse after using one of the ctors which don't do it void SetCmdLine(int argc, char **argv); #if wxUSE_UNICODE void SetCmdLine(int argc, wxChar **argv); void SetCmdLine(int argc, const wxCmdLineArgsArray& argv); #endif // wxUSE_UNICODE void SetCmdLine(const wxString& cmdline); // not virtual, don't use this class polymorphically ~wxCmdLineParser(); // set different parser options // ---------------------------- // by default, '-' is switch char under Unix, '-' or '/' under Win: // switchChars contains all characters with which an option or switch may // start void SetSwitchChars(const wxString& switchChars); // long options are not POSIX-compliant, this option allows to disable them void EnableLongOptions(bool enable = true); void DisableLongOptions() { EnableLongOptions(false); } bool AreLongOptionsEnabled() const; // extra text may be shown by Usage() method if set by this function void SetLogo(const wxString& logo); // construct the cmd line description // ---------------------------------- // take the cmd line description from the wxCMD_LINE_NONE terminated table void SetDesc(const wxCmdLineEntryDesc *desc); // a switch: i.e. an option without value void AddSwitch(const wxString& name, const wxString& lng = wxEmptyString, const wxString& desc = wxEmptyString, int flags = 0); void AddLongSwitch(const wxString& lng, const wxString& desc = wxEmptyString, int flags = 0) { AddSwitch(wxString(), lng, desc, flags); } // an option taking a value of the given type void AddOption(const wxString& name, const wxString& lng = wxEmptyString, const wxString& desc = wxEmptyString, wxCmdLineParamType type = wxCMD_LINE_VAL_STRING, int flags = 0); void AddLongOption(const wxString& lng, const wxString& desc = wxEmptyString, wxCmdLineParamType type = wxCMD_LINE_VAL_STRING, int flags = 0) { AddOption(wxString(), lng, desc, type, flags); } // a parameter void AddParam(const wxString& desc = wxEmptyString, wxCmdLineParamType type = wxCMD_LINE_VAL_STRING, int flags = 0); // add an explanatory text to be shown to the user in help void AddUsageText(const wxString& text); // actions // ------- // parse the command line, return 0 if ok, -1 if "-h" or "--help" option // was encountered and the help message was given or a positive value if a // syntax error occurred // // if showUsage is true, Usage() is called in case of syntax error or if // help was requested int Parse(bool showUsage = true); // give the usage message describing all program options void Usage() const; // return the usage string, call Usage() to directly show it to the user wxString GetUsageString() const; // get the command line arguments // ------------------------------ // returns true if the given switch was found bool Found(const wxString& name) const; // Returns wxCMD_SWITCH_NOT_FOUND if the switch was not found at all, // wxCMD_SWITCH_ON if it was found in normal state and wxCMD_SWITCH_OFF if // it was found but negated (i.e. followed by "-", this can only happen for // the switches with wxCMD_LINE_SWITCH_NEGATABLE flag). wxCmdLineSwitchState FoundSwitch(const wxString& name) const; // returns true if an option taking a string value was found and stores the // value in the provided pointer bool Found(const wxString& name, wxString *value) const; // returns true if an option taking an integer value was found and stores // the value in the provided pointer bool Found(const wxString& name, long *value) const; // returns true if an option taking a double value was found and stores // the value in the provided pointer bool Found(const wxString& name, double *value) const; #if wxUSE_DATETIME // returns true if an option taking a date value was found and stores the // value in the provided pointer bool Found(const wxString& name, wxDateTime *value) const; #endif // wxUSE_DATETIME // gets the number of parameters found size_t GetParamCount() const; // gets the value of Nth parameter (as string only for now) wxString GetParam(size_t n = 0u) const; // returns a reference to the container of all command line arguments wxCmdLineArgs GetArguments() const { return wxCmdLineArgs(*this); } // Resets switches and options void Reset(); // break down the command line in arguments static wxArrayString ConvertStringToArgs(const wxString& cmdline, wxCmdLineSplitType type = wxCMD_LINE_SPLIT_DOS); private: // common part of all ctors void Init(); struct wxCmdLineParserData *m_data; friend class wxCmdLineArgs; friend class wxCmdLineArgs::const_iterator; wxDECLARE_NO_COPY_CLASS(wxCmdLineParser); }; #else // !wxUSE_CMDLINE_PARSER // this function is always available (even if !wxUSE_CMDLINE_PARSER) because it // is used by wxWin itself under Windows class WXDLLIMPEXP_BASE wxCmdLineParser { public: static wxArrayString ConvertStringToArgs(const wxString& cmdline, wxCmdLineSplitType type = wxCMD_LINE_SPLIT_DOS); }; #endif // wxUSE_CMDLINE_PARSER/!wxUSE_CMDLINE_PARSER #endif // _WX_CMDLINE_H_
h
rticonnextdds-usecases
data/projects/rticonnextdds-usecases/VehicleTracking/ExampleCode/thirdparty/wxWidgets-3.1.2/Win64/include/wx/kbdstate.h
/////////////////////////////////////////////////////////////////////////////// // Name: wx/kbdstate.h // Purpose: Declaration of wxKeyboardState class // Author: Vadim Zeitlin // Created: 2008-09-19 // Copyright: (c) 2008 Vadim Zeitlin <[email protected]> // Licence: wxWindows licence /////////////////////////////////////////////////////////////////////////////// #ifndef _WX_KBDSTATE_H_ #define _WX_KBDSTATE_H_ #include "wx/defs.h" // ---------------------------------------------------------------------------- // wxKeyboardState stores the state of the keyboard modifier keys // ---------------------------------------------------------------------------- class WXDLLIMPEXP_CORE wxKeyboardState { public: wxKeyboardState(bool controlDown = false, bool shiftDown = false, bool altDown = false, bool metaDown = false) : m_controlDown(controlDown), m_shiftDown(shiftDown), m_altDown(altDown), m_metaDown(metaDown) #ifdef __WXOSX__ ,m_rawControlDown(false) #endif { } // default copy ctor, assignment operator and dtor are ok // accessors for the various modifier keys // --------------------------------------- // should be used check if the key event has exactly the given modifiers: // "GetModifiers() = wxMOD_CONTROL" is easier to write than "ControlDown() // && !MetaDown() && !AltDown() && !ShiftDown()" int GetModifiers() const { return (m_controlDown ? wxMOD_CONTROL : 0) | (m_shiftDown ? wxMOD_SHIFT : 0) | (m_metaDown ? wxMOD_META : 0) | #ifdef __WXOSX__ (m_rawControlDown ? wxMOD_RAW_CONTROL : 0) | #endif (m_altDown ? wxMOD_ALT : 0); } // returns true if any modifiers at all are pressed bool HasAnyModifiers() const { return GetModifiers() != wxMOD_NONE; } // returns true if any modifiers changing the usual key interpretation are // pressed, notably excluding Shift bool HasModifiers() const { return ControlDown() || RawControlDown() || AltDown(); } // accessors for individual modifier keys bool ControlDown() const { return m_controlDown; } bool RawControlDown() const { #ifdef __WXOSX__ return m_rawControlDown; #else return m_controlDown; #endif } bool ShiftDown() const { return m_shiftDown; } bool MetaDown() const { return m_metaDown; } bool AltDown() const { return m_altDown; } // "Cmd" is a pseudo key which is Control for PC and Unix platforms but // Apple ("Command") key under Macs: it makes often sense to use it instead // of, say, ControlDown() because Cmd key is used for the same thing under // Mac as Ctrl elsewhere (but Ctrl still exists, just not used for this // purpose under Mac) bool CmdDown() const { return ControlDown(); } // these functions are mostly used by wxWidgets itself // --------------------------------------------------- void SetControlDown(bool down) { m_controlDown = down; } void SetRawControlDown(bool down) { #ifdef __WXOSX__ m_rawControlDown = down; #else m_controlDown = down; #endif } void SetShiftDown(bool down) { m_shiftDown = down; } void SetAltDown(bool down) { m_altDown = down; } void SetMetaDown(bool down) { m_metaDown = down; } // for backwards compatibility with the existing code accessing these // members of wxKeyEvent directly, these variables are public, however you // should not use them in any new code, please use the accessors instead public: bool m_controlDown : 1; bool m_shiftDown : 1; bool m_altDown : 1; bool m_metaDown : 1; #ifdef __WXOSX__ bool m_rawControlDown : 1; #endif }; #endif // _WX_KBDSTATE_H_
h
rticonnextdds-usecases
data/projects/rticonnextdds-usecases/VehicleTracking/ExampleCode/thirdparty/wxWidgets-3.1.2/Win64/include/wx/taskbarbutton.h
///////////////////////////////////////////////////////////////////////////// // Name: include/taskbarbutton.h // Purpose: Defines wxTaskBarButton class for manipulating buttons on the // windows taskbar. // Author: Chaobin Zhang <[email protected]> // Created: 2014-04-30 // Copyright: (c) 2014 wxWidgets development team // Licence: wxWindows licence ///////////////////////////////////////////////////////////////////////////// #ifndef _WX_TASKBARBUTTON_H_ #define _WX_TASKBARBUTTON_H_ #include "wx/defs.h" #if wxUSE_TASKBARBUTTON #include "wx/icon.h" #include "wx/string.h" class WXDLLIMPEXP_FWD_CORE wxTaskBarButton; class WXDLLIMPEXP_FWD_CORE wxTaskBarJumpListCategory; class WXDLLIMPEXP_FWD_CORE wxTaskBarJumpList; class WXDLLIMPEXP_FWD_CORE wxTaskBarJumpListImpl; // ---------------------------------------------------------------------------- // wxTaskBarButton: define wxTaskBarButton interface. // ---------------------------------------------------------------------------- /** State of the task bar button. */ enum wxTaskBarButtonState { wxTASKBAR_BUTTON_NO_PROGRESS = 0, wxTASKBAR_BUTTON_INDETERMINATE = 1, wxTASKBAR_BUTTON_NORMAL = 2, wxTASKBAR_BUTTON_ERROR = 4, wxTASKBAR_BUTTON_PAUSED = 8 }; class WXDLLIMPEXP_CORE wxThumbBarButton : public wxObject { public: wxThumbBarButton() : m_taskBarButtonParent(NULL) { } wxThumbBarButton(int id, const wxIcon& icon, const wxString& tooltip = wxString(), bool enable = true, bool dismissOnClick = false, bool hasBackground = true, bool shown = true, bool interactive = true); bool Create(int id, const wxIcon& icon, const wxString& tooltip = wxString(), bool enable = true, bool dismissOnClick = false, bool hasBackground = true, bool shown = true, bool interactive = true); int GetID() const { return m_id; } const wxIcon& GetIcon() const { return m_icon; } const wxString& GetTooltip() const { return m_tooltip; } bool IsEnable() const { return m_enable; } void Enable(bool enable = true); void Disable() { Enable(false); } bool IsDismissOnClick() const { return m_dismissOnClick; } void EnableDismissOnClick(bool enable = true); void DisableDimissOnClick() { EnableDismissOnClick(false); } bool HasBackground() const { return m_hasBackground; } void SetHasBackground(bool has = true); bool IsShown() const { return m_shown; } void Show(bool shown = true); void Hide() { Show(false); } bool IsInteractive() const { return m_interactive; } void SetInteractive(bool interactive = true); void SetParent(wxTaskBarButton *parent) { m_taskBarButtonParent = parent; } wxTaskBarButton* GetParent() const { return m_taskBarButtonParent; } private: bool UpdateParentTaskBarButton(); int m_id; wxIcon m_icon; wxString m_tooltip; bool m_enable; bool m_dismissOnClick; bool m_hasBackground; bool m_shown; bool m_interactive; wxTaskBarButton *m_taskBarButtonParent; wxDECLARE_DYNAMIC_CLASS(wxThumbBarButton); }; class WXDLLIMPEXP_CORE wxTaskBarButton { public: // Factory function, may return NULL if task bar buttons are not supported // by the current system. static wxTaskBarButton* New(wxWindow* parent); virtual ~wxTaskBarButton() { } // Operations: virtual void SetProgressRange(int range) = 0; virtual void SetProgressValue(int value) = 0; virtual void PulseProgress() = 0; virtual void Show(bool show = true) = 0; virtual void Hide() = 0; virtual void SetThumbnailTooltip(const wxString& tooltip) = 0; virtual void SetProgressState(wxTaskBarButtonState state) = 0; virtual void SetOverlayIcon(const wxIcon& icon, const wxString& description = wxString()) = 0; virtual void SetThumbnailClip(const wxRect& rect) = 0; virtual void SetThumbnailContents(const wxWindow *child) = 0; virtual bool InsertThumbBarButton(size_t pos, wxThumbBarButton *button) = 0; virtual bool AppendThumbBarButton(wxThumbBarButton *button) = 0; virtual bool AppendSeparatorInThumbBar() = 0; virtual wxThumbBarButton* RemoveThumbBarButton(wxThumbBarButton *button) = 0; virtual wxThumbBarButton* RemoveThumbBarButton(int id) = 0; virtual void Realize() = 0; protected: wxTaskBarButton() { } private: wxDECLARE_NO_COPY_CLASS(wxTaskBarButton); }; enum wxTaskBarJumpListItemType { wxTASKBAR_JUMP_LIST_SEPARATOR, wxTASKBAR_JUMP_LIST_TASK, wxTASKBAR_JUMP_LIST_DESTINATION }; class WXDLLIMPEXP_CORE wxTaskBarJumpListItem { public: wxTaskBarJumpListItem(wxTaskBarJumpListCategory *parentCategory = NULL, wxTaskBarJumpListItemType type = wxTASKBAR_JUMP_LIST_SEPARATOR, const wxString& title = wxEmptyString, const wxString& filePath = wxEmptyString, const wxString& arguments = wxEmptyString, const wxString& tooltip = wxEmptyString, const wxString& iconPath = wxEmptyString, int iconIndex = 0); wxTaskBarJumpListItemType GetType() const; void SetType(wxTaskBarJumpListItemType type); const wxString& GetTitle() const; void SetTitle(const wxString& title); const wxString& GetFilePath() const; void SetFilePath(const wxString& filePath); const wxString& GetArguments() const; void SetArguments(const wxString& arguments); const wxString& GetTooltip() const; void SetTooltip(const wxString& tooltip); const wxString& GetIconPath() const; void SetIconPath(const wxString& iconPath); int GetIconIndex() const; void SetIconIndex(int iconIndex); wxTaskBarJumpListCategory* GetCategory() const; void SetCategory(wxTaskBarJumpListCategory *category); private: wxTaskBarJumpListCategory *m_parentCategory; wxTaskBarJumpListItemType m_type; wxString m_title; wxString m_filePath; wxString m_arguments; wxString m_tooltip; wxString m_iconPath; int m_iconIndex; wxDECLARE_NO_COPY_CLASS(wxTaskBarJumpListItem); }; typedef wxVector<wxTaskBarJumpListItem*> wxTaskBarJumpListItems; class WXDLLIMPEXP_CORE wxTaskBarJumpListCategory { public: wxTaskBarJumpListCategory(wxTaskBarJumpList *parent = NULL, const wxString& title = wxEmptyString); virtual ~wxTaskBarJumpListCategory(); wxTaskBarJumpListItem* Append(wxTaskBarJumpListItem *item); void Delete(wxTaskBarJumpListItem *item); wxTaskBarJumpListItem* Remove(wxTaskBarJumpListItem *item); wxTaskBarJumpListItem* FindItemByPosition(size_t pos) const; wxTaskBarJumpListItem* Insert(size_t pos, wxTaskBarJumpListItem *item); wxTaskBarJumpListItem* Prepend(wxTaskBarJumpListItem *item); void SetTitle(const wxString& title); const wxString& GetTitle() const; const wxTaskBarJumpListItems& GetItems() const; private: friend class wxTaskBarJumpListItem; void Update(); wxTaskBarJumpList *m_parent; wxTaskBarJumpListItems m_items; wxString m_title; wxDECLARE_NO_COPY_CLASS(wxTaskBarJumpListCategory); }; typedef wxVector<wxTaskBarJumpListCategory*> wxTaskBarJumpListCategories; class WXDLLIMPEXP_CORE wxTaskBarJumpList { public: wxTaskBarJumpList(const wxString& appID = wxEmptyString); virtual ~wxTaskBarJumpList(); void ShowRecentCategory(bool shown = true); void HideRecentCategory(); void ShowFrequentCategory(bool shown = true); void HideFrequentCategory(); wxTaskBarJumpListCategory& GetTasks() const; const wxTaskBarJumpListCategory& GetFrequentCategory() const; const wxTaskBarJumpListCategory& GetRecentCategory() const; const wxTaskBarJumpListCategories& GetCustomCategories() const; void AddCustomCategory(wxTaskBarJumpListCategory* category); wxTaskBarJumpListCategory* RemoveCustomCategory(const wxString& title); void DeleteCustomCategory(const wxString& title); private: friend class wxTaskBarJumpListCategory; void Update(); wxTaskBarJumpListImpl *m_jumpListImpl; wxDECLARE_NO_COPY_CLASS(wxTaskBarJumpList); }; #endif // wxUSE_TASKBARBUTTON #endif // _WX_TASKBARBUTTON_H_
h
rticonnextdds-usecases
data/projects/rticonnextdds-usecases/VehicleTracking/ExampleCode/thirdparty/wxWidgets-3.1.2/Win64/include/wx/xti2.h
///////////////////////////////////////////////////////////////////////////// // Name: wx/wxt2.h // Purpose: runtime metadata information (extended class info) // Author: Stefan Csomor // Modified by: Francesco Montorsi // Created: 27/07/03 // Copyright: (c) 1997 Julian Smart // (c) 2003 Stefan Csomor ///////////////////////////////////////////////////////////////////////////// #ifndef _WX_XTI2H__ #define _WX_XTI2H__ // ---------------------------------------------------------------------------- // second part of xti headers, is included from object.h // ---------------------------------------------------------------------------- #if wxUSE_EXTENDED_RTTI // ---------------------------------------------------------------------------- // wxDynamicObject class, its instances connect to a 'super class instance' // ---------------------------------------------------------------------------- class WXDLLIMPEXP_BASE wxDynamicObject : public wxObject { friend class WXDLLIMPEXP_FWD_BASE wxDynamicClassInfo ; public: // instantiates this object with an instance of its superclass wxDynamicObject(wxObject* superClassInstance, const wxDynamicClassInfo *info) ; virtual ~wxDynamicObject(); void SetProperty (const wxChar *propertyName, const wxAny &value); wxAny GetProperty (const wxChar *propertyName) const ; // get the runtime identity of this object wxClassInfo *GetClassInfo() const { #ifdef _MSC_VER return (wxClassInfo*) m_classInfo; #else wxDynamicClassInfo *nonconst = const_cast<wxDynamicClassInfo *>(m_classInfo); return static_cast<wxClassInfo *>(nonconst); #endif } wxObject* GetSuperClassInstance() const { return m_superClassInstance ; } private : // removes an existing runtime-property void RemoveProperty( const wxChar *propertyName ) ; // renames an existing runtime-property void RenameProperty( const wxChar *oldPropertyName , const wxChar *newPropertyName ) ; wxObject *m_superClassInstance ; const wxDynamicClassInfo *m_classInfo; struct wxDynamicObjectInternal; wxDynamicObjectInternal *m_data; }; // ---------------------------------------------------------------------------- // String conversion templates supporting older compilers // ---------------------------------------------------------------------------- #if wxUSE_FUNC_TEMPLATE_POINTER # define wxTO_STRING(type) wxToStringConverter<type> # define wxTO_STRING_IMP(type) # define wxFROM_STRING(type) wxFromStringConverter<type> # define wxFROM_STRING_IMP(type) #else # define wxTO_STRING(type) ToString##type # define wxTO_STRING_IMP(type) \ inline void ToString##type( const wxAny& data, wxString &result ) \ { wxToStringConverter<type>(data, result); } # define wxFROM_STRING(type) FromString##type # define wxFROM_STRING_IMP(type) \ inline void FromString##type( const wxString& data, wxAny &result ) \ { wxFromStringConverter<type>(data, result); } #endif #include "wx/xtiprop.h" #include "wx/xtictor.h" // ---------------------------------------------------------------------------- // wxIMPLEMENT class macros for concrete classes // ---------------------------------------------------------------------------- // Single inheritance with one base class #define _DEFAULT_CONSTRUCTOR(name) \ wxObject* wxConstructorFor##name() \ { return new name; } #define _DEFAULT_CONVERTERS(name) \ wxObject* wxVariantOfPtrToObjectConverter##name ( const wxAny &data ) \ { return data.As( (name**)NULL ); } \ wxAny wxObjectToVariantConverter##name ( wxObject *data ) \ { return wxAny( wx_dynamic_cast(name*, data) ); } #define _TYPEINFO_CLASSES(n, toString, fromString ) \ wxClassTypeInfo s_typeInfo##n(wxT_OBJECT, &n::ms_classInfo, \ toString, fromString, typeid(n).name()); \ wxClassTypeInfo s_typeInfoPtr##n(wxT_OBJECT_PTR, &n::ms_classInfo, \ toString, fromString, typeid(n*).name()); #define _IMPLEMENT_DYNAMIC_CLASS(name, basename, unit, callback) \ _DEFAULT_CONSTRUCTOR(name) \ _DEFAULT_CONVERTERS(name) \ \ const wxClassInfo* name::ms_classParents[] = \ { &basename::ms_classInfo, NULL }; \ wxClassInfo name::ms_classInfo(name::ms_classParents, wxT(unit), \ wxT(#name), (int) sizeof(name), (wxObjectConstructorFn) wxConstructorFor##name, \ name::GetPropertiesStatic, name::GetHandlersStatic, name::ms_constructor, \ name::ms_constructorProperties, name::ms_constructorPropertiesCount, \ wxVariantOfPtrToObjectConverter##name, NULL, wxObjectToVariantConverter##name, \ callback); #define _IMPLEMENT_DYNAMIC_CLASS_WITH_COPY(name, basename, unit, callback ) \ _DEFAULT_CONSTRUCTOR(name) \ _DEFAULT_CONVERTERS(name) \ void wxVariantToObjectConverter##name ( const wxAny &data, wxObjectFunctor* fn ) \ { name o = data.As<name>(); (*fn)( &o ); } \ \ const wxClassInfo* name::ms_classParents[] = { &basename::ms_classInfo,NULL }; \ wxClassInfo name::ms_classInfo(name::ms_classParents, wxT(unit), \ wxT(#name), (int) sizeof(name), (wxObjectConstructorFn) wxConstructorFor##name, \ name::GetPropertiesStatic,name::GetHandlersStatic,name::ms_constructor, \ name::ms_constructorProperties, name::ms_constructorPropertiesCount, \ wxVariantOfPtrToObjectConverter##name, wxVariantToObjectConverter##name, \ wxObjectToVariantConverter##name, callback); #define wxIMPLEMENT_DYNAMIC_CLASS_WITH_COPY( name, basename ) \ _IMPLEMENT_DYNAMIC_CLASS_WITH_COPY( name, basename, "", NULL ) \ _TYPEINFO_CLASSES(name, NULL, NULL) \ const wxPropertyInfo *name::GetPropertiesStatic() \ { return (wxPropertyInfo*) NULL; } \ const wxHandlerInfo *name::GetHandlersStatic() \ { return (wxHandlerInfo*) NULL; } \ wxCONSTRUCTOR_DUMMY( name ) #define wxIMPLEMENT_DYNAMIC_CLASS( name, basename ) \ _IMPLEMENT_DYNAMIC_CLASS( name, basename, "", NULL ) \ _TYPEINFO_CLASSES(name, NULL, NULL) \ wxPropertyInfo *name::GetPropertiesStatic() \ { return (wxPropertyInfo*) NULL; } \ wxHandlerInfo *name::GetHandlersStatic() \ { return (wxHandlerInfo*) NULL; } \ wxCONSTRUCTOR_DUMMY( name ) #define wxIMPLEMENT_DYNAMIC_CLASS_XTI( name, basename, unit ) \ _IMPLEMENT_DYNAMIC_CLASS( name, basename, unit, NULL ) \ _TYPEINFO_CLASSES(name, NULL, NULL) #define wxIMPLEMENT_DYNAMIC_CLASS_XTI_CALLBACK( name, basename, unit, callback )\ _IMPLEMENT_DYNAMIC_CLASS( name, basename, unit, &callback ) \ _TYPEINFO_CLASSES(name, NULL, NULL) #define wxIMPLEMENT_DYNAMIC_CLASS_WITH_COPY_XTI( name, basename, unit ) \ _IMPLEMENT_DYNAMIC_CLASS_WITH_COPY( name, basename, unit, NULL ) \ _TYPEINFO_CLASSES(name, NULL, NULL) #define wxIMPLEMENT_DYNAMIC_CLASS_WITH_COPY_AND_STREAMERS_XTI( name, basename, \ unit, toString, \ fromString ) \ _IMPLEMENT_DYNAMIC_CLASS_WITH_COPY( name, basename, unit, NULL ) \ _TYPEINFO_CLASSES(name, toString, fromString) // this is for classes that do not derive from wxObject, there are no creators for these #define wxIMPLEMENT_DYNAMIC_CLASS_NO_WXOBJECT_NO_BASE_XTI( name, unit ) \ const wxClassInfo* name::ms_classParents[] = { NULL }; \ wxClassInfo name::ms_classInfo(name::ms_classParents, wxEmptyString, \ wxT(#name), (int) sizeof(name), (wxObjectConstructorFn) 0, \ name::GetPropertiesStatic,name::GetHandlersStatic, 0, 0, \ 0, 0, 0 ); \ _TYPEINFO_CLASSES(name, NULL, NULL) // this is for subclasses that still do not derive from wxObject #define wxIMPLEMENT_DYNAMIC_CLASS_NO_WXOBJECT_XTI( name, basename, unit ) \ const wxClassInfo* name::ms_classParents[] = { &basename::ms_classInfo, NULL }; \ wxClassInfo name::ms_classInfo(name::ms_classParents, wxEmptyString, \ wxT(#name), (int) sizeof(name), (wxObjectConstructorFn) 0, \ name::GetPropertiesStatic,name::GetHandlersStatic, 0, 0, \ 0, 0, 0 ); \ _TYPEINFO_CLASSES(name, NULL, NULL) // Multiple inheritance with two base classes #define _IMPLEMENT_DYNAMIC_CLASS2(name, basename, basename2, unit, callback) \ _DEFAULT_CONSTRUCTOR(name) \ _DEFAULT_CONVERTERS(name) \ \ const wxClassInfo* name::ms_classParents[] = \ { &basename::ms_classInfo,&basename2::ms_classInfo, NULL }; \ wxClassInfo name::ms_classInfo(name::ms_classParents, wxT(unit), \ wxT(#name), (int) sizeof(name), (wxObjectConstructorFn) wxConstructorFor##name, \ name::GetPropertiesStatic,name::GetHandlersStatic,name::ms_constructor, \ name::ms_constructorProperties, name::ms_constructorPropertiesCount, \ wxVariantOfPtrToObjectConverter##name, NULL, wxObjectToVariantConverter##name, \ callback); #define wxIMPLEMENT_DYNAMIC_CLASS2( name, basename, basename2) \ _IMPLEMENT_DYNAMIC_CLASS2( name, basename, basename2, "", NULL) \ _TYPEINFO_CLASSES(name, NULL, NULL) \ wxPropertyInfo *name::GetPropertiesStatic() { return (wxPropertyInfo*) NULL; } \ wxHandlerInfo *name::GetHandlersStatic() { return (wxHandlerInfo*) NULL; } \ wxCONSTRUCTOR_DUMMY( name ) #define wxIMPLEMENT_DYNAMIC_CLASS2_XTI( name, basename, basename2, unit) \ _IMPLEMENT_DYNAMIC_CLASS2( name, basename, basename2, unit, NULL) \ _TYPEINFO_CLASSES(name, NULL, NULL) // ---------------------------------------------------------------------------- // wxIMPLEMENT class macros for abstract classes // ---------------------------------------------------------------------------- // Single inheritance with one base class #define _IMPLEMENT_ABSTRACT_CLASS(name, basename) \ _DEFAULT_CONVERTERS(name) \ \ const wxClassInfo* name::ms_classParents[] = \ { &basename::ms_classInfo,NULL }; \ wxClassInfo name::ms_classInfo(name::ms_classParents, wxEmptyString, \ wxT(#name), (int) sizeof(name), (wxObjectConstructorFn) 0, \ name::GetPropertiesStatic,name::GetHandlersStatic, 0, 0, \ 0, wxVariantOfPtrToObjectConverter##name,0, \ wxObjectToVariantConverter##name); \ _TYPEINFO_CLASSES(name, NULL, NULL) #define wxIMPLEMENT_ABSTRACT_CLASS( name, basename ) \ _IMPLEMENT_ABSTRACT_CLASS( name, basename ) \ wxHandlerInfo *name::GetHandlersStatic() { return (wxHandlerInfo*) NULL; } \ wxPropertyInfo *name::GetPropertiesStatic() { return (wxPropertyInfo*) NULL; } // Multiple inheritance with two base classes #define wxIMPLEMENT_ABSTRACT_CLASS2(name, basename1, basename2) \ wxClassInfo name::ms_classInfo(wxT(#name), wxT(#basename1), \ wxT(#basename2), (int) sizeof(name), \ (wxObjectConstructorFn) 0); // templated streaming, every type that can be converted to wxString // must have their specialization for these methods template<typename T> void wxStringReadValue( const wxString &s, T &data ); template<typename T> void wxStringWriteValue( wxString &s, const T &data); template<typename T> void wxToStringConverter( const wxAny &v, wxString &s ) { wxStringWriteValue(s, v.As<T>()); } template<typename T> void wxFromStringConverter( const wxString &s, wxAny &v) { T d; wxStringReadValue(s, d); v = wxAny(d); } // -------------------------------------------------------------------------- // Collection Support // -------------------------------------------------------------------------- template<typename iter, typename collection_t > void wxListCollectionToAnyList( const collection_t& coll, wxAnyList &value ) { for ( iter current = coll.GetFirst(); current; current = current->GetNext() ) { value.Append( new wxAny(current->GetData()) ); } } template<typename collection_t> void wxArrayCollectionToVariantArray( const collection_t& coll, wxAnyList &value ) { for( size_t i = 0; i < coll.GetCount(); i++ ) { value.Append( new wxAny(coll[i]) ); } } #endif #endif // _WX_XTIH2__
h
rticonnextdds-usecases
data/projects/rticonnextdds-usecases/VehicleTracking/ExampleCode/thirdparty/wxWidgets-3.1.2/Win64/include/wx/thread.h
///////////////////////////////////////////////////////////////////////////// // Name: wx/thread.h // Purpose: Thread API // Author: Guilhem Lavaux // Modified by: Vadim Zeitlin (modifications partly inspired by omnithreads // package from Olivetti & Oracle Research Laboratory) // Created: 04/13/98 // Copyright: (c) Guilhem Lavaux // Licence: wxWindows licence ///////////////////////////////////////////////////////////////////////////// #ifndef _WX_THREAD_H_ #define _WX_THREAD_H_ // ---------------------------------------------------------------------------- // headers // ---------------------------------------------------------------------------- // get the value of wxUSE_THREADS configuration flag #include "wx/defs.h" #if wxUSE_THREADS // ---------------------------------------------------------------------------- // constants // ---------------------------------------------------------------------------- enum wxMutexError { wxMUTEX_NO_ERROR = 0, // operation completed successfully wxMUTEX_INVALID, // mutex hasn't been initialized wxMUTEX_DEAD_LOCK, // mutex is already locked by the calling thread wxMUTEX_BUSY, // mutex is already locked by another thread wxMUTEX_UNLOCKED, // attempt to unlock a mutex which is not locked wxMUTEX_TIMEOUT, // LockTimeout() has timed out wxMUTEX_MISC_ERROR // any other error }; enum wxCondError { wxCOND_NO_ERROR = 0, wxCOND_INVALID, wxCOND_TIMEOUT, // WaitTimeout() has timed out wxCOND_MISC_ERROR }; enum wxSemaError { wxSEMA_NO_ERROR = 0, wxSEMA_INVALID, // semaphore hasn't been initialized successfully wxSEMA_BUSY, // returned by TryWait() if Wait() would block wxSEMA_TIMEOUT, // returned by WaitTimeout() wxSEMA_OVERFLOW, // Post() would increase counter past the max wxSEMA_MISC_ERROR }; enum wxThreadError { wxTHREAD_NO_ERROR = 0, // No error wxTHREAD_NO_RESOURCE, // No resource left to create a new thread wxTHREAD_RUNNING, // The thread is already running wxTHREAD_NOT_RUNNING, // The thread isn't running wxTHREAD_KILLED, // Thread we waited for had to be killed wxTHREAD_MISC_ERROR // Some other error }; enum wxThreadKind { wxTHREAD_DETACHED, wxTHREAD_JOINABLE }; enum wxThreadWait { wxTHREAD_WAIT_BLOCK, wxTHREAD_WAIT_YIELD, // process events while waiting; MSW only // For compatibility reasons we use wxTHREAD_WAIT_YIELD by default as this // was the default behaviour of wxMSW 2.8 but it should be avoided as it's // dangerous and not portable. #if WXWIN_COMPATIBILITY_2_8 wxTHREAD_WAIT_DEFAULT = wxTHREAD_WAIT_YIELD #else wxTHREAD_WAIT_DEFAULT = wxTHREAD_WAIT_BLOCK #endif }; // Obsolete synonyms for wxPRIORITY_XXX for backwards compatibility-only enum { WXTHREAD_MIN_PRIORITY = wxPRIORITY_MIN, WXTHREAD_DEFAULT_PRIORITY = wxPRIORITY_DEFAULT, WXTHREAD_MAX_PRIORITY = wxPRIORITY_MAX }; // There are 2 types of mutexes: normal mutexes and recursive ones. The attempt // to lock a normal mutex by a thread which already owns it results in // undefined behaviour (it always works under Windows, it will almost always // result in a deadlock under Unix). Locking a recursive mutex in such // situation always succeeds and it must be unlocked as many times as it has // been locked. // // However recursive mutexes have several important drawbacks: first, in the // POSIX implementation, they're less efficient. Second, and more importantly, // they CAN NOT BE USED WITH CONDITION VARIABLES under Unix! Using them with // wxCondition will work under Windows and some Unices (notably Linux) but will // deadlock under other Unix versions (e.g. Solaris). As it might be difficult // to ensure that a recursive mutex is not used with wxCondition, it is a good // idea to avoid using recursive mutexes at all. Also, the last problem with // them is that some (older) Unix versions don't support this at all -- which // results in a configure warning when building and a deadlock when using them. enum wxMutexType { // normal mutex: try to always use this one wxMUTEX_DEFAULT, // recursive mutex: don't use these ones with wxCondition wxMUTEX_RECURSIVE }; // forward declarations class WXDLLIMPEXP_FWD_BASE wxThreadHelper; class WXDLLIMPEXP_FWD_BASE wxConditionInternal; class WXDLLIMPEXP_FWD_BASE wxMutexInternal; class WXDLLIMPEXP_FWD_BASE wxSemaphoreInternal; class WXDLLIMPEXP_FWD_BASE wxThreadInternal; // ---------------------------------------------------------------------------- // A mutex object is a synchronization object whose state is set to signaled // when it is not owned by any thread, and nonsignaled when it is owned. Its // name comes from its usefulness in coordinating mutually-exclusive access to // a shared resource. Only one thread at a time can own a mutex object. // ---------------------------------------------------------------------------- // you should consider wxMutexLocker whenever possible instead of directly // working with wxMutex class - it is safer class WXDLLIMPEXP_BASE wxMutex { public: // constructor & destructor // ------------------------ // create either default (always safe) or recursive mutex wxMutex(wxMutexType mutexType = wxMUTEX_DEFAULT); // destroys the mutex kernel object ~wxMutex(); // test if the mutex has been created successfully bool IsOk() const; // mutex operations // ---------------- // Lock the mutex, blocking on it until it is unlocked by the other thread. // The result of locking a mutex already locked by the current thread // depend on the mutex type. // // The caller must call Unlock() later if Lock() returned wxMUTEX_NO_ERROR. wxMutexError Lock(); // Same as Lock() but return wxMUTEX_TIMEOUT if the mutex can't be locked // during the given number of milliseconds wxMutexError LockTimeout(unsigned long ms); // Try to lock the mutex: if it is currently locked, return immediately // with an error. Otherwise the caller must call Unlock(). wxMutexError TryLock(); // Unlock the mutex. It is an error to unlock an already unlocked mutex wxMutexError Unlock(); protected: wxMutexInternal *m_internal; friend class wxConditionInternal; wxDECLARE_NO_COPY_CLASS(wxMutex); }; // a helper class which locks the mutex in the ctor and unlocks it in the dtor: // this ensures that mutex is always unlocked, even if the function returns or // throws an exception before it reaches the end class WXDLLIMPEXP_BASE wxMutexLocker { public: // lock the mutex in the ctor wxMutexLocker(wxMutex& mutex) : m_isOk(false), m_mutex(mutex) { m_isOk = ( m_mutex.Lock() == wxMUTEX_NO_ERROR ); } // returns true if mutex was successfully locked in ctor bool IsOk() const { return m_isOk; } // unlock the mutex in dtor ~wxMutexLocker() { if ( IsOk() ) m_mutex.Unlock(); } private: // no assignment operator nor copy ctor wxMutexLocker(const wxMutexLocker&); wxMutexLocker& operator=(const wxMutexLocker&); bool m_isOk; wxMutex& m_mutex; }; // ---------------------------------------------------------------------------- // Critical section: this is the same as mutex but is only visible to the // threads of the same process. For the platforms which don't have native // support for critical sections, they're implemented entirely in terms of // mutexes. // // NB: wxCriticalSection object does not allocate any memory in its ctor // which makes it possible to have static globals of this class // ---------------------------------------------------------------------------- // in order to avoid any overhead under platforms where critical sections are // just mutexes make all wxCriticalSection class functions inline #if !defined(__WINDOWS__) #define wxCRITSECT_IS_MUTEX 1 #define wxCRITSECT_INLINE WXEXPORT inline #else // MSW #define wxCRITSECT_IS_MUTEX 0 #define wxCRITSECT_INLINE #endif // MSW/!MSW enum wxCriticalSectionType { // recursive critical section wxCRITSEC_DEFAULT, // non-recursive critical section wxCRITSEC_NON_RECURSIVE }; // you should consider wxCriticalSectionLocker whenever possible instead of // directly working with wxCriticalSection class - it is safer class WXDLLIMPEXP_BASE wxCriticalSection { public: // ctor & dtor wxCRITSECT_INLINE wxCriticalSection( wxCriticalSectionType critSecType = wxCRITSEC_DEFAULT ); wxCRITSECT_INLINE ~wxCriticalSection(); // enter the section (the same as locking a mutex) wxCRITSECT_INLINE void Enter(); // try to enter the section (the same as trying to lock a mutex) wxCRITSECT_INLINE bool TryEnter(); // leave the critical section (same as unlocking a mutex) wxCRITSECT_INLINE void Leave(); private: #if wxCRITSECT_IS_MUTEX wxMutex m_mutex; #elif defined(__WINDOWS__) // we can't allocate any memory in the ctor, so use placement new - // unfortunately, we have to hardcode the sizeof() here because we can't // include windows.h from this public header and we also have to use the // union to force the correct (i.e. maximal) alignment // // if CRITICAL_SECTION size changes in Windows, you'll get an assert from // thread.cpp and will need to increase the buffer size #ifdef __WIN64__ typedef char wxCritSectBuffer[40]; #else // __WIN32__ typedef char wxCritSectBuffer[24]; #endif union { unsigned long m_dummy1; void *m_dummy2; wxCritSectBuffer m_buffer; }; #endif // Unix/Win32 wxDECLARE_NO_COPY_CLASS(wxCriticalSection); }; #if wxCRITSECT_IS_MUTEX // implement wxCriticalSection using mutexes inline wxCriticalSection::wxCriticalSection( wxCriticalSectionType critSecType ) : m_mutex( critSecType == wxCRITSEC_DEFAULT ? wxMUTEX_RECURSIVE : wxMUTEX_DEFAULT ) { } inline wxCriticalSection::~wxCriticalSection() { } inline void wxCriticalSection::Enter() { (void)m_mutex.Lock(); } inline bool wxCriticalSection::TryEnter() { return m_mutex.TryLock() == wxMUTEX_NO_ERROR; } inline void wxCriticalSection::Leave() { (void)m_mutex.Unlock(); } #endif // wxCRITSECT_IS_MUTEX #undef wxCRITSECT_INLINE #undef wxCRITSECT_IS_MUTEX // wxCriticalSectionLocker is the same to critical sections as wxMutexLocker is // to mutexes class WXDLLIMPEXP_BASE wxCriticalSectionLocker { public: wxCriticalSectionLocker(wxCriticalSection& cs) : m_critsect(cs) { m_critsect.Enter(); } ~wxCriticalSectionLocker() { m_critsect.Leave(); } private: wxCriticalSection& m_critsect; wxDECLARE_NO_COPY_CLASS(wxCriticalSectionLocker); }; // ---------------------------------------------------------------------------- // wxCondition models a POSIX condition variable which allows one (or more) // thread(s) to wait until some condition is fulfilled // ---------------------------------------------------------------------------- class WXDLLIMPEXP_BASE wxCondition { public: // Each wxCondition object is associated with a (single) wxMutex object. // The mutex object MUST be locked before calling Wait() wxCondition(wxMutex& mutex); // dtor is not virtual, don't use this class polymorphically ~wxCondition(); // return true if the condition has been created successfully bool IsOk() const; // NB: the associated mutex MUST be locked beforehand by the calling thread // // it atomically releases the lock on the associated mutex // and starts waiting to be woken up by a Signal()/Broadcast() // once its signaled, then it will wait until it can reacquire // the lock on the associated mutex object, before returning. wxCondError Wait(); // std::condition_variable-like variant that evaluates the associated condition template<typename Functor> wxCondError Wait(const Functor& predicate) { while ( !predicate() ) { wxCondError e = Wait(); if ( e != wxCOND_NO_ERROR ) return e; } return wxCOND_NO_ERROR; } // exactly as Wait() except that it may also return if the specified // timeout elapses even if the condition hasn't been signalled: in this // case, the return value is wxCOND_TIMEOUT, otherwise (i.e. in case of a // normal return) it is wxCOND_NO_ERROR. // // the timeout parameter specifies an interval that needs to be waited for // in milliseconds wxCondError WaitTimeout(unsigned long milliseconds); // NB: the associated mutex may or may not be locked by the calling thread // // this method unblocks one thread if any are blocking on the condition. // if no thread is blocking in Wait(), then the signal is NOT remembered // The thread which was blocking on Wait() will then reacquire the lock // on the associated mutex object before returning wxCondError Signal(); // NB: the associated mutex may or may not be locked by the calling thread // // this method unblocks all threads if any are blocking on the condition. // if no thread is blocking in Wait(), then the signal is NOT remembered // The threads which were blocking on Wait() will then reacquire the lock // on the associated mutex object before returning. wxCondError Broadcast(); private: wxConditionInternal *m_internal; wxDECLARE_NO_COPY_CLASS(wxCondition); }; // ---------------------------------------------------------------------------- // wxSemaphore: a counter limiting the number of threads concurrently accessing // a shared resource // ---------------------------------------------------------------------------- class WXDLLIMPEXP_BASE wxSemaphore { public: // specifying a maxcount of 0 actually makes wxSemaphore behave as if there // is no upper limit, if maxcount is 1 the semaphore behaves as a mutex wxSemaphore( int initialcount = 0, int maxcount = 0 ); // dtor is not virtual, don't use this class polymorphically ~wxSemaphore(); // return true if the semaphore has been created successfully bool IsOk() const; // wait indefinitely, until the semaphore count goes beyond 0 // and then decrement it and return (this method might have been called // Acquire()) wxSemaError Wait(); // same as Wait(), but does not block, returns wxSEMA_NO_ERROR if // successful and wxSEMA_BUSY if the count is currently zero wxSemaError TryWait(); // same as Wait(), but as a timeout limit, returns wxSEMA_NO_ERROR if the // semaphore was acquired and wxSEMA_TIMEOUT if the timeout has elapsed wxSemaError WaitTimeout(unsigned long milliseconds); // increments the semaphore count and signals one of the waiting threads wxSemaError Post(); private: wxSemaphoreInternal *m_internal; wxDECLARE_NO_COPY_CLASS(wxSemaphore); }; // ---------------------------------------------------------------------------- // wxThread: class encapsulating a thread of execution // ---------------------------------------------------------------------------- // there are two different kinds of threads: joinable and detached (default) // ones. Only joinable threads can return a return code and only detached // threads auto-delete themselves - the user should delete the joinable // threads manually. // NB: in the function descriptions the words "this thread" mean the thread // created by the wxThread object while "main thread" is the thread created // during the process initialization (a.k.a. the GUI thread) // On VMS thread pointers are 64 bits (also needed for other systems??? #ifdef __VMS typedef unsigned long long wxThreadIdType; #else typedef unsigned long wxThreadIdType; #endif class WXDLLIMPEXP_BASE wxThread { public: // the return type for the thread function typedef void *ExitCode; // static functions // Returns the wxThread object for the calling thread. NULL is returned // if the caller is the main thread (but it's recommended to use // IsMain() and only call This() for threads other than the main one // because NULL is also returned on error). If the thread wasn't // created with wxThread class, the returned value is undefined. static wxThread *This(); // Returns true if current thread is the main thread. // // Notice that it also returns true if main thread id hadn't been // initialized yet on the assumption that it's too early in wx startup // process for any other threads to have been created in this case. static bool IsMain() { return !ms_idMainThread || GetCurrentId() == ms_idMainThread; } // Return the main thread id static wxThreadIdType GetMainId() { return ms_idMainThread; } // Release the rest of our time slice letting the other threads run static void Yield(); // Sleep during the specified period of time in milliseconds // // This is the same as wxMilliSleep(). static void Sleep(unsigned long milliseconds); // get the number of system CPUs - useful with SetConcurrency() // (the "best" value for it is usually number of CPUs + 1) // // Returns -1 if unknown, number of CPUs otherwise static int GetCPUCount(); // Get the platform specific thread ID and return as a long. This // can be used to uniquely identify threads, even if they are not // wxThreads. This is used by wxPython. static wxThreadIdType GetCurrentId(); // sets the concurrency level: this is, roughly, the number of threads // the system tries to schedule to run in parallel. 0 means the // default value (usually acceptable, but may not yield the best // performance for this process) // // Returns true on success, false otherwise (if not implemented, for // example) static bool SetConcurrency(size_t level); // constructor only creates the C++ thread object and doesn't create (or // start) the real thread wxThread(wxThreadKind kind = wxTHREAD_DETACHED); // functions that change the thread state: all these can only be called // from _another_ thread (typically the thread that created this one, e.g. // the main thread), not from the thread itself // create a new thread and optionally set the stack size on // platforms that support that - call Run() to start it wxThreadError Create(unsigned int stackSize = 0); // starts execution of the thread - from the moment Run() is called // the execution of wxThread::Entry() may start at any moment, caller // shouldn't suppose that it starts after (or before) Run() returns. wxThreadError Run(); // stops the thread if it's running and deletes the wxThread object if // this is a detached thread freeing its memory - otherwise (for // joinable threads) you still need to delete wxThread object // yourself. // // this function only works if the thread calls TestDestroy() // periodically - the thread will only be deleted the next time it // does it! // // will fill the rc pointer with the thread exit code if it's !NULL wxThreadError Delete(ExitCode *rc = NULL, wxThreadWait waitMode = wxTHREAD_WAIT_DEFAULT); // waits for a joinable thread to finish and returns its exit code // // Returns (ExitCode)-1 on error (for example, if the thread is not // joinable) ExitCode Wait(wxThreadWait waitMode = wxTHREAD_WAIT_DEFAULT); // kills the thread without giving it any chance to clean up - should // not be used under normal circumstances, use Delete() instead. // It is a dangerous function that should only be used in the most // extreme cases! // // The wxThread object is deleted by Kill() if the thread is // detachable, but you still have to delete it manually for joinable // threads. wxThreadError Kill(); // pause a running thread: as Delete(), this only works if the thread // calls TestDestroy() regularly wxThreadError Pause(); // resume a paused thread wxThreadError Resume(); // priority // Sets the priority to "prio" which must be in 0..100 range (see // also wxPRIORITY_XXX constants). // // NB: under MSW the priority can only be set after the thread is // created (but possibly before it is launched) void SetPriority(unsigned int prio); // Get the current priority. unsigned int GetPriority() const; // thread status inquiries // Returns true if the thread is alive: i.e. running or suspended bool IsAlive() const; // Returns true if the thread is running (not paused, not killed). bool IsRunning() const; // Returns true if the thread is suspended bool IsPaused() const; // is the thread of detached kind? bool IsDetached() const { return m_isDetached; } // Get the thread ID - a platform dependent number which uniquely // identifies a thread inside a process wxThreadIdType GetId() const; #ifdef __WINDOWS__ // Get the internal OS handle WXHANDLE MSWGetHandle() const; #endif // __WINDOWS__ wxThreadKind GetKind() const { return m_isDetached ? wxTHREAD_DETACHED : wxTHREAD_JOINABLE; } // Returns true if the thread was asked to terminate: this function should // be called by the thread from time to time, otherwise the main thread // will be left forever in Delete()! virtual bool TestDestroy(); // dtor is public, but the detached threads should never be deleted - use // Delete() instead (or leave the thread terminate by itself) virtual ~wxThread(); protected: // exits from the current thread - can be called only from this thread void Exit(ExitCode exitcode = 0); // entry point for the thread - called by Run() and executes in the context // of this thread. virtual void *Entry() = 0; // use this to call the Entry() virtual method void *CallEntry(); // Callbacks which may be overridden by the derived class to perform some // specific actions when the thread is deleted or killed. By default they // do nothing. // This one is called by Delete() before actually deleting the thread and // is executed in the context of the thread that called Delete(). virtual void OnDelete() {} // This one is called by Kill() before killing the thread and is executed // in the context of the thread that called Kill(). virtual void OnKill() {} private: // no copy ctor/assignment operator wxThread(const wxThread&); wxThread& operator=(const wxThread&); // called when the thread exits - in the context of this thread // // NB: this function will not be called if the thread is Kill()ed virtual void OnExit() { } friend class wxThreadInternal; friend class wxThreadModule; // the main thread identifier, should be set on startup static wxThreadIdType ms_idMainThread; // the (platform-dependent) thread class implementation wxThreadInternal *m_internal; // protects access to any methods of wxThreadInternal object wxCriticalSection m_critsect; // true if the thread is detached, false if it is joinable bool m_isDetached; }; // wxThreadHelperThread class // -------------------------- class WXDLLIMPEXP_BASE wxThreadHelperThread : public wxThread { public: // constructor only creates the C++ thread object and doesn't create (or // start) the real thread wxThreadHelperThread(wxThreadHelper& owner, wxThreadKind kind) : wxThread(kind), m_owner(owner) { } protected: // entry point for the thread -- calls Entry() in owner. virtual void *Entry() wxOVERRIDE; private: // the owner of the thread wxThreadHelper& m_owner; // no copy ctor/assignment operator wxThreadHelperThread(const wxThreadHelperThread&); wxThreadHelperThread& operator=(const wxThreadHelperThread&); }; // ---------------------------------------------------------------------------- // wxThreadHelper: this class implements the threading logic to run a // background task in another object (such as a window). It is a mix-in: just // derive from it to implement a threading background task in your class. // ---------------------------------------------------------------------------- class WXDLLIMPEXP_BASE wxThreadHelper { private: void KillThread() { // If wxThreadHelperThread is detached and is about to finish, it will // set m_thread to NULL so don't delete it then. // But if KillThread is called before wxThreadHelperThread (in detached mode) // sets it to NULL, then the thread object still exists and can be killed wxCriticalSectionLocker locker(m_critSection); if ( m_thread ) { m_thread->Kill(); if ( m_kind == wxTHREAD_JOINABLE ) delete m_thread; m_thread = NULL; } } public: // constructor only initializes m_thread to NULL wxThreadHelper(wxThreadKind kind = wxTHREAD_JOINABLE) : m_thread(NULL), m_kind(kind) { } // destructor deletes m_thread virtual ~wxThreadHelper() { KillThread(); } #if WXWIN_COMPATIBILITY_2_8 wxDEPRECATED( wxThreadError Create(unsigned int stackSize = 0) ); #endif // create a new thread (and optionally set the stack size on platforms that // support/need that), call Run() to start it wxThreadError CreateThread(wxThreadKind kind = wxTHREAD_JOINABLE, unsigned int stackSize = 0) { KillThread(); m_kind = kind; m_thread = new wxThreadHelperThread(*this, m_kind); return m_thread->Create(stackSize); } // entry point for the thread - called by Run() and executes in the context // of this thread. virtual void *Entry() = 0; // returns a pointer to the thread which can be used to call Run() wxThread *GetThread() const { wxCriticalSectionLocker locker((wxCriticalSection&)m_critSection); wxThread* thread = m_thread; return thread; } protected: wxThread *m_thread; wxThreadKind m_kind; wxCriticalSection m_critSection; // To guard the m_thread variable friend class wxThreadHelperThread; }; #if WXWIN_COMPATIBILITY_2_8 inline wxThreadError wxThreadHelper::Create(unsigned int stackSize) { return CreateThread(m_kind, stackSize); } #endif // call Entry() in owner, put it down here to avoid circular declarations inline void *wxThreadHelperThread::Entry() { void * const result = m_owner.Entry(); wxCriticalSectionLocker locker(m_owner.m_critSection); // Detached thread will be deleted after returning, so make sure // wxThreadHelper::GetThread will not return an invalid pointer. // And that wxThreadHelper::KillThread will not try to kill // an already deleted thread if ( m_owner.m_kind == wxTHREAD_DETACHED ) m_owner.m_thread = NULL; return result; } // ---------------------------------------------------------------------------- // Automatic initialization // ---------------------------------------------------------------------------- // GUI mutex handling. void WXDLLIMPEXP_BASE wxMutexGuiEnter(); void WXDLLIMPEXP_BASE wxMutexGuiLeave(); // macros for entering/leaving critical sections which may be used without // having to take them inside "#if wxUSE_THREADS" #define wxENTER_CRIT_SECT(cs) (cs).Enter() #define wxLEAVE_CRIT_SECT(cs) (cs).Leave() #define wxCRIT_SECT_DECLARE(cs) static wxCriticalSection cs #define wxCRIT_SECT_DECLARE_MEMBER(cs) wxCriticalSection cs #define wxCRIT_SECT_LOCKER(name, cs) wxCriticalSectionLocker name(cs) // function for checking if we're in the main thread which may be used whether // wxUSE_THREADS is 0 or 1 inline bool wxIsMainThread() { return wxThread::IsMain(); } #else // !wxUSE_THREADS // no thread support inline void wxMutexGuiEnter() { } inline void wxMutexGuiLeave() { } // macros for entering/leaving critical sections which may be used without // having to take them inside "#if wxUSE_THREADS" // (the implementation uses dummy structs to force semicolon after the macro) #define wxENTER_CRIT_SECT(cs) do {} while (0) #define wxLEAVE_CRIT_SECT(cs) do {} while (0) #define wxCRIT_SECT_DECLARE(cs) struct wxDummyCS##cs #define wxCRIT_SECT_DECLARE_MEMBER(cs) struct wxDummyCSMember##cs { } #define wxCRIT_SECT_LOCKER(name, cs) struct wxDummyCSLocker##name // if there is only one thread, it is always the main one inline bool wxIsMainThread() { return true; } #endif // wxUSE_THREADS/!wxUSE_THREADS // mark part of code as being a critical section: this macro declares a // critical section with the given name and enters it immediately and leaves // it at the end of the current scope // // example: // // int Count() // { // static int s_counter = 0; // // wxCRITICAL_SECTION(counter); // // return ++s_counter; // } // // this function is MT-safe in presence of the threads but there is no // overhead when the library is compiled without threads #define wxCRITICAL_SECTION(name) \ wxCRIT_SECT_DECLARE(s_cs##name); \ wxCRIT_SECT_LOCKER(cs##name##Locker, s_cs##name) // automatically lock GUI mutex in ctor and unlock it in dtor class WXDLLIMPEXP_BASE wxMutexGuiLocker { public: wxMutexGuiLocker() { wxMutexGuiEnter(); } ~wxMutexGuiLocker() { wxMutexGuiLeave(); } }; // ----------------------------------------------------------------------------- // implementation only until the end of file // ----------------------------------------------------------------------------- #if wxUSE_THREADS #if defined(__WINDOWS__) || defined(__DARWIN__) // unlock GUI if there are threads waiting for and lock it back when // there are no more of them - should be called periodically by the main // thread extern void WXDLLIMPEXP_BASE wxMutexGuiLeaveOrEnter(); // returns true if the main thread has GUI lock extern bool WXDLLIMPEXP_BASE wxGuiOwnedByMainThread(); // wakes up the main thread if it's sleeping inside ::GetMessage() extern void WXDLLIMPEXP_BASE wxWakeUpMainThread(); #ifndef __DARWIN__ // return true if the main thread is waiting for some other to terminate: // wxApp then should block all "dangerous" messages extern bool WXDLLIMPEXP_BASE wxIsWaitingForThread(); #endif #endif // MSW, OSX #endif // wxUSE_THREADS #endif // _WX_THREAD_H_
h
rticonnextdds-usecases
data/projects/rticonnextdds-usecases/VehicleTracking/ExampleCode/thirdparty/wxWidgets-3.1.2/Win64/include/wx/lzmastream.h
/////////////////////////////////////////////////////////////////////////////// // Name: wx/lzmastream.h // Purpose: Filters streams using LZMA(2) compression // Author: Vadim Zeitlin // Created: 2018-03-29 // Copyright: (c) 2018 Vadim Zeitlin <[email protected]> // Licence: wxWindows licence /////////////////////////////////////////////////////////////////////////////// #ifndef _WX_LZMASTREAM_H_ #define _WX_LZMASTREAM_H_ #include "wx/defs.h" #if wxUSE_LIBLZMA && wxUSE_STREAMS #include "wx/stream.h" #include "wx/versioninfo.h" namespace wxPrivate { // Private wrapper for lzma_stream struct. struct wxLZMAStream; // Common part of input and output LZMA streams: this is just an implementation // detail and is not part of the public API. class WXDLLIMPEXP_BASE wxLZMAData { protected: wxLZMAData(); ~wxLZMAData(); wxLZMAStream* m_stream; wxUint8* m_streamBuf; wxFileOffset m_pos; wxDECLARE_NO_COPY_CLASS(wxLZMAData); }; } // namespace wxPrivate // ---------------------------------------------------------------------------- // Filter for decompressing data compressed using LZMA // ---------------------------------------------------------------------------- class WXDLLIMPEXP_BASE wxLZMAInputStream : public wxFilterInputStream, private wxPrivate::wxLZMAData { public: explicit wxLZMAInputStream(wxInputStream& stream) : wxFilterInputStream(stream) { Init(); } explicit wxLZMAInputStream(wxInputStream* stream) : wxFilterInputStream(stream) { Init(); } char Peek() wxOVERRIDE { return wxInputStream::Peek(); } wxFileOffset GetLength() const wxOVERRIDE { return wxInputStream::GetLength(); } protected: size_t OnSysRead(void *buffer, size_t size) wxOVERRIDE; wxFileOffset OnSysTell() const wxOVERRIDE { return m_pos; } private: void Init(); }; // ---------------------------------------------------------------------------- // Filter for compressing data using LZMA(2) algorithm // ---------------------------------------------------------------------------- class WXDLLIMPEXP_BASE wxLZMAOutputStream : public wxFilterOutputStream, private wxPrivate::wxLZMAData { public: explicit wxLZMAOutputStream(wxOutputStream& stream, int level = -1) : wxFilterOutputStream(stream) { Init(level); } explicit wxLZMAOutputStream(wxOutputStream* stream, int level = -1) : wxFilterOutputStream(stream) { Init(level); } virtual ~wxLZMAOutputStream() { Close(); } void Sync() wxOVERRIDE { DoFlush(false); } bool Close() wxOVERRIDE; wxFileOffset GetLength() const wxOVERRIDE { return m_pos; } protected: size_t OnSysWrite(const void *buffer, size_t size) wxOVERRIDE; wxFileOffset OnSysTell() const wxOVERRIDE { return m_pos; } private: void Init(int level); // Write the contents of the internal buffer to the output stream. bool UpdateOutput(); // Write out the current buffer if necessary, i.e. if no space remains in // it, and reinitialize m_stream to point to it. Returns false on success // or false on error, in which case m_lasterror is updated. bool UpdateOutputIfNecessary(); // Run LZMA_FINISH (if argument is true) or LZMA_FULL_FLUSH, return true on // success or false on error. bool DoFlush(bool finish); }; // ---------------------------------------------------------------------------- // Support for creating LZMA streams from extension/MIME type // ---------------------------------------------------------------------------- class WXDLLIMPEXP_BASE wxLZMAClassFactory: public wxFilterClassFactory { public: wxLZMAClassFactory(); wxFilterInputStream *NewStream(wxInputStream& stream) const wxOVERRIDE { return new wxLZMAInputStream(stream); } wxFilterOutputStream *NewStream(wxOutputStream& stream) const wxOVERRIDE { return new wxLZMAOutputStream(stream, -1); } wxFilterInputStream *NewStream(wxInputStream *stream) const wxOVERRIDE { return new wxLZMAInputStream(stream); } wxFilterOutputStream *NewStream(wxOutputStream *stream) const wxOVERRIDE { return new wxLZMAOutputStream(stream, -1); } const wxChar * const *GetProtocols(wxStreamProtocolType type = wxSTREAM_PROTOCOL) const wxOVERRIDE; private: wxDECLARE_DYNAMIC_CLASS(wxLZMAClassFactory); }; WXDLLIMPEXP_BASE wxVersionInfo wxGetLibLZMAVersionInfo(); #endif // wxUSE_LIBLZMA && wxUSE_STREAMS #endif // _WX_LZMASTREAM_H_
h
rticonnextdds-usecases
data/projects/rticonnextdds-usecases/VehicleTracking/ExampleCode/thirdparty/wxWidgets-3.1.2/Win64/include/wx/wxhtml.h
///////////////////////////////////////////////////////////////////////////// // Name: wx/wxhtml.h // Purpose: wxHTML library for wxWidgets // Author: Vaclav Slavik // Copyright: (c) 1999 Vaclav Slavik // Licence: wxWindows licence ///////////////////////////////////////////////////////////////////////////// #ifndef _WX_HTML_H_ #define _WX_HTML_H_ #include "wx/html/htmldefs.h" #include "wx/html/htmltag.h" #include "wx/html/htmlcell.h" #include "wx/html/htmlpars.h" #include "wx/html/htmlwin.h" #include "wx/html/winpars.h" #include "wx/filesys.h" #include "wx/html/helpctrl.h" #endif // __WXHTML_H__
h
rticonnextdds-usecases
data/projects/rticonnextdds-usecases/VehicleTracking/ExampleCode/thirdparty/wxWidgets-3.1.2/Win64/include/wx/imagpnm.h
///////////////////////////////////////////////////////////////////////////// // Name: wx/imagpnm.h // Purpose: wxImage PNM handler // Author: Sylvain Bougnoux // Copyright: (c) Sylvain Bougnoux // Licence: wxWindows licence ///////////////////////////////////////////////////////////////////////////// #ifndef _WX_IMAGPNM_H_ #define _WX_IMAGPNM_H_ #include "wx/image.h" //----------------------------------------------------------------------------- // wxPNMHandler //----------------------------------------------------------------------------- #if wxUSE_PNM class WXDLLIMPEXP_CORE wxPNMHandler : public wxImageHandler { public: inline wxPNMHandler() { m_name = wxT("PNM file"); m_extension = wxT("pnm"); m_altExtensions.Add(wxT("ppm")); m_altExtensions.Add(wxT("pgm")); m_altExtensions.Add(wxT("pbm")); m_type = wxBITMAP_TYPE_PNM; m_mime = wxT("image/pnm"); } #if wxUSE_STREAMS virtual bool LoadFile( wxImage *image, wxInputStream& stream, bool verbose=true, int index=-1 ) wxOVERRIDE; virtual bool SaveFile( wxImage *image, wxOutputStream& stream, bool verbose=true ) wxOVERRIDE; protected: virtual bool DoCanRead( wxInputStream& stream ) wxOVERRIDE; #endif private: wxDECLARE_DYNAMIC_CLASS(wxPNMHandler); }; #endif #endif // _WX_IMAGPNM_H_
h
rticonnextdds-usecases
data/projects/rticonnextdds-usecases/VehicleTracking/ExampleCode/thirdparty/wxWidgets-3.1.2/Win64/include/wx/unichar.h
/////////////////////////////////////////////////////////////////////////////// // Name: wx/unichar.h // Purpose: wxUniChar and wxUniCharRef classes // Author: Vaclav Slavik // Created: 2007-03-19 // Copyright: (c) 2007 REA Elektronik GmbH // Licence: wxWindows licence /////////////////////////////////////////////////////////////////////////////// #ifndef _WX_UNICHAR_H_ #define _WX_UNICHAR_H_ #include "wx/defs.h" #include "wx/chartype.h" #include "wx/stringimpl.h" // We need to get std::swap() declaration in order to specialize it below and // it is declared in different headers for C++98 and C++11. Instead of testing // which one is being used, just include both of them as it's simpler and less // error-prone. #include <algorithm> // std::swap() for C++98 #include <utility> // std::swap() for C++11 class WXDLLIMPEXP_FWD_BASE wxUniCharRef; class WXDLLIMPEXP_FWD_BASE wxString; // This class represents single Unicode character. It can be converted to // and from char or wchar_t and implements commonly used character operations. class WXDLLIMPEXP_BASE wxUniChar { public: // NB: this is not wchar_t on purpose, it needs to represent the entire // Unicode code points range and wchar_t may be too small for that // (e.g. on Win32 where wchar_t* is encoded in UTF-16) typedef wxUint32 value_type; wxUniChar() : m_value(0) {} // Create the character from 8bit character value encoded in the current // locale's charset. wxUniChar(char c) { m_value = From8bit(c); } wxUniChar(unsigned char c) { m_value = From8bit((char)c); } #define wxUNICHAR_DEFINE_CTOR(type) \ wxUniChar(type c) { m_value = (value_type)c; } wxDO_FOR_INT_TYPES(wxUNICHAR_DEFINE_CTOR) #undef wxUNICHAR_DEFINE_CTOR wxUniChar(const wxUniCharRef& c); // Returns Unicode code point value of the character value_type GetValue() const { return m_value; } #if wxUSE_UNICODE_UTF8 // buffer for single UTF-8 character struct Utf8CharBuffer { char data[5]; operator const char*() const { return data; } }; // returns the character encoded as UTF-8 // (NB: implemented in stringops.cpp) Utf8CharBuffer AsUTF8() const; #endif // wxUSE_UNICODE_UTF8 // Returns true if the character is an ASCII character: bool IsAscii() const { return m_value < 0x80; } // Returns true if the character is representable as a single byte in the // current locale encoding and return this byte in output argument c (which // must be non-NULL) bool GetAsChar(char *c) const { #if wxUSE_UNICODE if ( !IsAscii() ) { #if !wxUSE_UTF8_LOCALE_ONLY if ( GetAsHi8bit(m_value, c) ) return true; #endif // !wxUSE_UTF8_LOCALE_ONLY return false; } #endif // wxUSE_UNICODE *c = wx_truncate_cast(char, m_value); return true; } // Returns true if the character is a BMP character: static bool IsBMP(wxUint32 value) { return value < 0x10000; } // Returns true if the character is a supplementary character: static bool IsSupplementary(wxUint32 value) { return 0x10000 <= value && value < 0x110000; } // Returns the high surrogate code unit for the supplementary character static wxUint16 HighSurrogate(wxUint32 value) { wxASSERT_MSG(IsSupplementary(value), "wxUniChar::HighSurrogate() must be called on a supplementary character"); return static_cast<wxUint16>(0xD800 | ((value - 0x10000) >> 10)); } // Returns the low surrogate code unit for the supplementary character static wxUint16 LowSurrogate(wxUint32 value) { wxASSERT_MSG(IsSupplementary(value), "wxUniChar::LowSurrogate() must be called on a supplementary character"); return static_cast<wxUint16>(0xDC00 | ((value - 0x10000) & 0x03FF)); } // Returns true if the character is a BMP character: bool IsBMP() const { return IsBMP(m_value); } // Returns true if the character is a supplementary character: bool IsSupplementary() const { return IsSupplementary(m_value); } // Returns the high surrogate code unit for the supplementary character wxUint16 HighSurrogate() const { return HighSurrogate(m_value); } // Returns the low surrogate code unit for the supplementary character wxUint16 LowSurrogate() const { return LowSurrogate(m_value); } // Conversions to char and wchar_t types: all of those are needed to be // able to pass wxUniChars to verious standard narrow and wide character // functions operator char() const { return To8bit(m_value); } operator unsigned char() const { return (unsigned char)To8bit(m_value); } #define wxUNICHAR_DEFINE_OPERATOR_PAREN(type) \ operator type() const { return (type)m_value; } wxDO_FOR_INT_TYPES(wxUNICHAR_DEFINE_OPERATOR_PAREN) #undef wxUNICHAR_DEFINE_OPERATOR_PAREN // We need this operator for the "*p" part of expressions like "for ( // const_iterator p = begin() + nStart; *p; ++p )". In this case, // compilation would fail without it because the conversion to bool would // be ambiguous (there are all these int types conversions...). (And adding // operator unspecified_bool_type() would only makes the ambiguity worse.) operator bool() const { return m_value != 0; } bool operator!() const { return !((bool)*this); } // And this one is needed by some (not all, but not using ifdefs makes the // code easier) compilers to parse "str[0] && *p" successfully bool operator&&(bool v) const { return (bool)*this && v; } // Assignment operators: wxUniChar& operator=(const wxUniChar& c) { if (&c != this) m_value = c.m_value; return *this; } wxUniChar& operator=(const wxUniCharRef& c); wxUniChar& operator=(char c) { m_value = From8bit(c); return *this; } wxUniChar& operator=(unsigned char c) { m_value = From8bit((char)c); return *this; } #define wxUNICHAR_DEFINE_OPERATOR_EQUAL(type) \ wxUniChar& operator=(type c) { m_value = (value_type)c; return *this; } wxDO_FOR_INT_TYPES(wxUNICHAR_DEFINE_OPERATOR_EQUAL) #undef wxUNICHAR_DEFINE_OPERATOR_EQUAL // Comparison operators: #define wxDEFINE_UNICHAR_CMP_WITH_INT(T, op) \ bool operator op(T c) const { return m_value op (value_type)c; } // define the given comparison operator for all the types #define wxDEFINE_UNICHAR_OPERATOR(op) \ bool operator op(const wxUniChar& c) const { return m_value op c.m_value; }\ bool operator op(char c) const { return m_value op From8bit(c); } \ bool operator op(unsigned char c) const { return m_value op From8bit((char)c); } \ wxDO_FOR_INT_TYPES_1(wxDEFINE_UNICHAR_CMP_WITH_INT, op) wxFOR_ALL_COMPARISONS(wxDEFINE_UNICHAR_OPERATOR) #undef wxDEFINE_UNICHAR_OPERATOR #undef wxDEFINE_UNCHAR_CMP_WITH_INT // this is needed for expressions like 'Z'-c int operator-(const wxUniChar& c) const { return m_value - c.m_value; } int operator-(char c) const { return m_value - From8bit(c); } int operator-(unsigned char c) const { return m_value - From8bit((char)c); } int operator-(wchar_t c) const { return m_value - (value_type)c; } private: // notice that we implement these functions inline for 7-bit ASCII // characters purely for performance reasons static value_type From8bit(char c) { #if wxUSE_UNICODE if ( (unsigned char)c < 0x80 ) return c; return FromHi8bit(c); #else return c; #endif } static char To8bit(value_type c) { #if wxUSE_UNICODE if ( c < 0x80 ) return wx_truncate_cast(char, c); return ToHi8bit(c); #else return wx_truncate_cast(char, c); #endif } // helpers of the functions above called to deal with non-ASCII chars static value_type FromHi8bit(char c); static char ToHi8bit(value_type v); static bool GetAsHi8bit(value_type v, char *c); private: value_type m_value; }; // Writeable reference to a character in wxString. // // This class can be used in the same way wxChar is used, except that changing // its value updates the underlying string object. class WXDLLIMPEXP_BASE wxUniCharRef { private: typedef wxStringImpl::iterator iterator; // create the reference #if wxUSE_UNICODE_UTF8 wxUniCharRef(wxString& str, iterator pos) : m_str(str), m_pos(pos) {} #else wxUniCharRef(iterator pos) : m_pos(pos) {} #endif public: // NB: we have to make this public, because we don't have wxString // declaration available here and so can't declare wxString::iterator // as friend; so at least don't use a ctor but a static function // that must be used explicitly (this is more than using 'explicit' // keyword on ctor!): #if wxUSE_UNICODE_UTF8 static wxUniCharRef CreateForString(wxString& str, iterator pos) { return wxUniCharRef(str, pos); } #else static wxUniCharRef CreateForString(iterator pos) { return wxUniCharRef(pos); } #endif wxUniChar::value_type GetValue() const { return UniChar().GetValue(); } #if wxUSE_UNICODE_UTF8 wxUniChar::Utf8CharBuffer AsUTF8() const { return UniChar().AsUTF8(); } #endif // wxUSE_UNICODE_UTF8 bool IsAscii() const { return UniChar().IsAscii(); } bool GetAsChar(char *c) const { return UniChar().GetAsChar(c); } bool IsBMP() const { return UniChar().IsBMP(); } bool IsSupplementary() const { return UniChar().IsSupplementary(); } wxUint16 HighSurrogate() const { return UniChar().HighSurrogate(); } wxUint16 LowSurrogate() const { return UniChar().LowSurrogate(); } // Assignment operators: #if wxUSE_UNICODE_UTF8 wxUniCharRef& operator=(const wxUniChar& c); #else wxUniCharRef& operator=(const wxUniChar& c) { *m_pos = c; return *this; } #endif wxUniCharRef& operator=(const wxUniCharRef& c) { if (&c != this) *this = c.UniChar(); return *this; } #define wxUNICHAR_REF_DEFINE_OPERATOR_EQUAL(type) \ wxUniCharRef& operator=(type c) { return *this = wxUniChar(c); } wxDO_FOR_CHAR_INT_TYPES(wxUNICHAR_REF_DEFINE_OPERATOR_EQUAL) #undef wxUNICHAR_REF_DEFINE_OPERATOR_EQUAL // Conversions to the same types as wxUniChar is convertible too: #define wxUNICHAR_REF_DEFINE_OPERATOR_PAREN(type) \ operator type() const { return UniChar(); } wxDO_FOR_CHAR_INT_TYPES(wxUNICHAR_REF_DEFINE_OPERATOR_PAREN) #undef wxUNICHAR_REF_DEFINE_OPERATOR_PAREN // see wxUniChar::operator bool etc. for explanation operator bool() const { return (bool)UniChar(); } bool operator!() const { return !UniChar(); } bool operator&&(bool v) const { return UniChar() && v; } #define wxDEFINE_UNICHARREF_CMP_WITH_INT(T, op) \ bool operator op(T c) const { return UniChar() op c; } // Comparison operators: #define wxDEFINE_UNICHARREF_OPERATOR(op) \ bool operator op(const wxUniCharRef& c) const { return UniChar() op c.UniChar(); }\ bool operator op(const wxUniChar& c) const { return UniChar() op c; } \ wxDO_FOR_CHAR_INT_TYPES_1(wxDEFINE_UNICHARREF_CMP_WITH_INT, op) wxFOR_ALL_COMPARISONS(wxDEFINE_UNICHARREF_OPERATOR) #undef wxDEFINE_UNICHARREF_OPERATOR #undef wxDEFINE_UNICHARREF_CMP_WITH_INT // for expressions like c-'A': int operator-(const wxUniCharRef& c) const { return UniChar() - c.UniChar(); } int operator-(const wxUniChar& c) const { return UniChar() - c; } int operator-(char c) const { return UniChar() - c; } int operator-(unsigned char c) const { return UniChar() - c; } int operator-(wchar_t c) const { return UniChar() - c; } private: #if wxUSE_UNICODE_UTF8 wxUniChar UniChar() const; #else wxUniChar UniChar() const { return *m_pos; } #endif friend class WXDLLIMPEXP_FWD_BASE wxUniChar; private: // reference to the string and pointer to the character in string #if wxUSE_UNICODE_UTF8 wxString& m_str; #endif iterator m_pos; }; inline wxUniChar::wxUniChar(const wxUniCharRef& c) { m_value = c.UniChar().m_value; } inline wxUniChar& wxUniChar::operator=(const wxUniCharRef& c) { m_value = c.UniChar().m_value; return *this; } // wxUniCharRef doesn't behave quite like a reference, notably because template // deduction from wxUniCharRef doesn't yield wxUniChar as would have been the // case if it were a real reference. This results in a number of problems and // we can't fix all of them but we can at least provide a working swap() for // it, instead of the default version which doesn't work because a "wrong" type // is deduced. namespace std { template <> inline void swap<wxUniCharRef>(wxUniCharRef& lhs, wxUniCharRef& rhs) { if ( &lhs != &rhs ) { // The use of wxUniChar here is the crucial difference: in the default // implementation, tmp would be wxUniCharRef and so assigning to lhs // would modify it too. Here we make a real copy, not affected by // changing lhs, instead. wxUniChar tmp = lhs; lhs = rhs; rhs = tmp; } } } // namespace std // Comparison operators for the case when wxUniChar(Ref) is the second operand // implemented in terms of member comparison functions wxDEFINE_COMPARISONS_BY_REV(char, const wxUniChar&) wxDEFINE_COMPARISONS_BY_REV(char, const wxUniCharRef&) wxDEFINE_COMPARISONS_BY_REV(wchar_t, const wxUniChar&) wxDEFINE_COMPARISONS_BY_REV(wchar_t, const wxUniCharRef&) wxDEFINE_COMPARISONS_BY_REV(const wxUniChar&, const wxUniCharRef&) // for expressions like c-'A': inline int operator-(char c1, const wxUniCharRef& c2) { return -(c2 - c1); } inline int operator-(const wxUniChar& c1, const wxUniCharRef& c2) { return -(c2 - c1); } inline int operator-(wchar_t c1, const wxUniCharRef& c2) { return -(c2 - c1); } #endif /* _WX_UNICHAR_H_ */
h
rticonnextdds-usecases
data/projects/rticonnextdds-usecases/VehicleTracking/ExampleCode/thirdparty/wxWidgets-3.1.2/Win64/include/wx/mdi.h
///////////////////////////////////////////////////////////////////////////// // Name: wx/mdi.h // Purpose: wxMDI base header // Author: Julian Smart (original) // Vadim Zeitlin (base MDI classes refactoring) // Copyright: (c) 1998 Julian Smart // (c) 2008 Vadim Zeitlin // Licence: wxWindows licence ///////////////////////////////////////////////////////////////////////////// #ifndef _WX_MDI_H_BASE_ #define _WX_MDI_H_BASE_ #include "wx/defs.h" #if wxUSE_MDI #include "wx/frame.h" #include "wx/menu.h" // forward declarations class WXDLLIMPEXP_FWD_CORE wxMDIParentFrame; class WXDLLIMPEXP_FWD_CORE wxMDIChildFrame; class WXDLLIMPEXP_FWD_CORE wxMDIClientWindowBase; class WXDLLIMPEXP_FWD_CORE wxMDIClientWindow; // ---------------------------------------------------------------------------- // wxMDIParentFrameBase: base class for parent frame for MDI children // ---------------------------------------------------------------------------- class WXDLLIMPEXP_CORE wxMDIParentFrameBase : public wxFrame { public: wxMDIParentFrameBase() { m_clientWindow = NULL; m_currentChild = NULL; #if wxUSE_MENUS m_windowMenu = NULL; #endif // wxUSE_MENUS } /* Derived classes should provide ctor and Create() with the following declaration: bool Create(wxWindow *parent, wxWindowID winid, const wxString& title, const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxDefaultSize, long style = wxDEFAULT_FRAME_STYLE | wxVSCROLL | wxHSCROLL, const wxString& name = wxFrameNameStr); */ #if wxUSE_MENUS virtual ~wxMDIParentFrameBase() { delete m_windowMenu; } #endif // wxUSE_MENUS // accessors // --------- // Get or change the active MDI child window virtual wxMDIChildFrame *GetActiveChild() const { return m_currentChild; } virtual void SetActiveChild(wxMDIChildFrame *child) { m_currentChild = child; } // Get the client window wxMDIClientWindowBase *GetClientWindow() const { return m_clientWindow; } // MDI windows menu functions // -------------------------- #if wxUSE_MENUS // return the pointer to the current window menu or NULL if we don't have // because of wxFRAME_NO_WINDOW_MENU style wxMenu* GetWindowMenu() const { return m_windowMenu; } // use the given menu instead of the default window menu // // menu can be NULL to disable the window menu completely virtual void SetWindowMenu(wxMenu *menu) { if ( menu != m_windowMenu ) { delete m_windowMenu; m_windowMenu = menu; } } #endif // wxUSE_MENUS // standard MDI window management functions // ---------------------------------------- virtual void Cascade() { } virtual void Tile(wxOrientation WXUNUSED(orient) = wxHORIZONTAL) { } virtual void ArrangeIcons() { } virtual void ActivateNext() = 0; virtual void ActivatePrevious() = 0; /* Derived classes must provide the following function: static bool IsTDI(); */ // Create the client window class (don't Create() the window here, just // return a new object of a wxMDIClientWindow-derived class) // // Notice that if you override this method you should use the default // constructor and Create() and not the constructor creating the window // when creating the frame or your overridden version is not going to be // called (as the call to a virtual function from ctor will be dispatched // to this class version) virtual wxMDIClientWindow *OnCreateClient(); protected: // Override to pass menu/toolbar events to the active child first. virtual bool TryBefore(wxEvent& event) wxOVERRIDE; // This is wxMDIClientWindow for all the native implementations but not for // the generic MDI version which has its own wxGenericMDIClientWindow and // so we store it as just a base class pointer because we don't need its // exact type anyhow wxMDIClientWindowBase *m_clientWindow; wxMDIChildFrame *m_currentChild; #if wxUSE_MENUS // the current window menu or NULL if we are not using it wxMenu *m_windowMenu; #endif // wxUSE_MENUS }; // ---------------------------------------------------------------------------- // wxMDIChildFrameBase: child frame managed by wxMDIParentFrame // ---------------------------------------------------------------------------- class WXDLLIMPEXP_CORE wxMDIChildFrameBase : public wxFrame { public: wxMDIChildFrameBase() { m_mdiParent = NULL; } /* Derived classes should provide Create() with the following signature: bool Create(wxMDIParentFrame *parent, wxWindowID id, const wxString& title, const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxDefaultSize, long style = wxDEFAULT_FRAME_STYLE, const wxString& name = wxFrameNameStr); And setting m_mdiParent to parent parameter. */ // MDI children specific methods virtual void Activate() = 0; // Return the MDI parent frame: notice that it may not be the same as // GetParent() (our parent may be the client window or even its subwindow // in some implementations) wxMDIParentFrame *GetMDIParent() const { return m_mdiParent; } // Synonym for GetMDIParent(), was used in some other ports wxMDIParentFrame *GetMDIParentFrame() const { return GetMDIParent(); } // in most ports MDI children frames are not really top-level, the only // exception are the Mac ports in which MDI children are just normal top // level windows too virtual bool IsTopLevel() const wxOVERRIDE { return false; } // In all ports keyboard navigation must stop at MDI child frame level and // can't cross its boundary. Indicate this by overriding this function to // return true. virtual bool IsTopNavigationDomain(NavigationKind kind) const wxOVERRIDE { switch ( kind ) { case Navigation_Tab: return true; case Navigation_Accel: // Parent frame accelerators should work inside MDI child, so // don't block their processing by returning true for them. break; } return false; } // Raising any frame is supposed to show it but wxFrame Raise() // implementation doesn't work for MDI child frames in most forms so // forward this to Activate() which serves the same purpose by default. virtual void Raise() wxOVERRIDE { Activate(); } protected: wxMDIParentFrame *m_mdiParent; }; // ---------------------------------------------------------------------------- // wxTDIChildFrame: child frame used by TDI implementations // ---------------------------------------------------------------------------- class WXDLLIMPEXP_CORE wxTDIChildFrame : public wxMDIChildFrameBase { public: // override wxFrame methods for this non top-level window #if wxUSE_STATUSBAR // no status bars // // TODO: MDI children should have their own status bars, why not? virtual wxStatusBar* CreateStatusBar(int WXUNUSED(number) = 1, long WXUNUSED(style) = 1, wxWindowID WXUNUSED(id) = 1, const wxString& WXUNUSED(name) = wxEmptyString) wxOVERRIDE { return NULL; } virtual wxStatusBar *GetStatusBar() const wxOVERRIDE { return NULL; } virtual void SetStatusText(const wxString &WXUNUSED(text), int WXUNUSED(number)=0) wxOVERRIDE { } virtual void SetStatusWidths(int WXUNUSED(n), const int WXUNUSED(widths)[]) wxOVERRIDE { } #endif // wxUSE_STATUSBAR #if wxUSE_TOOLBAR // no toolbar // // TODO: again, it should be possible to have tool bars virtual wxToolBar *CreateToolBar(long WXUNUSED(style), wxWindowID WXUNUSED(id), const wxString& WXUNUSED(name)) wxOVERRIDE { return NULL; } virtual wxToolBar *GetToolBar() const wxOVERRIDE { return NULL; } #endif // wxUSE_TOOLBAR // no icon virtual void SetIcons(const wxIconBundle& WXUNUSED(icons)) wxOVERRIDE { } // title is used as the tab label virtual wxString GetTitle() const wxOVERRIDE { return m_title; } virtual void SetTitle(const wxString& title) wxOVERRIDE = 0; // no maximize etc virtual void Maximize(bool WXUNUSED(maximize) = true) wxOVERRIDE { } virtual bool IsMaximized() const wxOVERRIDE { return true; } virtual bool IsAlwaysMaximized() const wxOVERRIDE { return true; } virtual void Iconize(bool WXUNUSED(iconize) = true) wxOVERRIDE { } virtual bool IsIconized() const wxOVERRIDE { return false; } virtual void Restore() wxOVERRIDE { } virtual bool ShowFullScreen(bool WXUNUSED(show), long WXUNUSED(style)) wxOVERRIDE { return false; } virtual bool IsFullScreen() const wxOVERRIDE { return false; } // we need to override these functions to ensure that a child window is // created even though we derive from wxFrame -- basically we make it // behave as just a wxWindow by short-circuiting wxTLW changes to the base // class behaviour virtual void AddChild(wxWindowBase *child) wxOVERRIDE { wxWindow::AddChild(child); } virtual bool Destroy() wxOVERRIDE { return wxWindow::Destroy(); } // extra platform-specific hacks #ifdef __WXMSW__ virtual WXDWORD MSWGetStyle(long flags, WXDWORD *exstyle = NULL) const wxOVERRIDE { return wxWindow::MSWGetStyle(flags, exstyle); } virtual WXHWND MSWGetParent() const wxOVERRIDE { return wxWindow::MSWGetParent(); } WXLRESULT MSWWindowProc(WXUINT message, WXWPARAM wParam, WXLPARAM lParam) wxOVERRIDE { return wxWindow::MSWWindowProc(message, wParam, lParam); } #endif // __WXMSW__ protected: virtual void DoGetSize(int *width, int *height) const wxOVERRIDE { wxWindow::DoGetSize(width, height); } virtual void DoSetSize(int x, int y, int width, int height, int sizeFlags) wxOVERRIDE { wxWindow::DoSetSize(x, y, width, height, sizeFlags); } virtual void DoGetClientSize(int *width, int *height) const wxOVERRIDE { wxWindow::DoGetClientSize(width, height); } virtual void DoSetClientSize(int width, int height) wxOVERRIDE { wxWindow::DoSetClientSize(width, height); } virtual void DoMoveWindow(int x, int y, int width, int height) wxOVERRIDE { wxWindow::DoMoveWindow(x, y, width, height); } // no size hints virtual void DoSetSizeHints(int WXUNUSED(minW), int WXUNUSED(minH), int WXUNUSED(maxW), int WXUNUSED(maxH), int WXUNUSED(incW), int WXUNUSED(incH)) wxOVERRIDE { } wxString m_title; }; // ---------------------------------------------------------------------------- // wxMDIClientWindowBase: child of parent frame, parent of children frames // ---------------------------------------------------------------------------- class WXDLLIMPEXP_CORE wxMDIClientWindowBase : public wxWindow { public: /* The derived class must provide the default ctor only (CreateClient() will be called later). */ // Can be overridden in the derived classes but the base class version must // be usually called first to really create the client window. virtual bool CreateClient(wxMDIParentFrame *parent, long style = wxVSCROLL | wxHSCROLL) = 0; }; // ---------------------------------------------------------------------------- // Include the port-specific implementation of the base classes defined above // ---------------------------------------------------------------------------- // wxUSE_GENERIC_MDI_AS_NATIVE may be predefined to force the generic MDI // implementation use even on the platforms which usually don't use it // // notice that generic MDI can still be used without this, but you would need // to explicitly use wxGenericMDIXXX classes in your code (and currently also // add src/generic/mdig.cpp to your build as it's not compiled in if generic // MDI is not used by default -- but this may change later...) #ifndef wxUSE_GENERIC_MDI_AS_NATIVE // wxUniv always uses the generic MDI implementation and so do the ports // without native version (although wxCocoa seems to have one -- but it's // probably not functional?) #if defined(__WXMOTIF__) || \ defined(__WXUNIVERSAL__) #define wxUSE_GENERIC_MDI_AS_NATIVE 1 #else #define wxUSE_GENERIC_MDI_AS_NATIVE 0 #endif #endif // wxUSE_GENERIC_MDI_AS_NATIVE #if wxUSE_GENERIC_MDI_AS_NATIVE #include "wx/generic/mdig.h" #elif defined(__WXMSW__) #include "wx/msw/mdi.h" #elif defined(__WXGTK20__) #include "wx/gtk/mdi.h" #elif defined(__WXGTK__) #include "wx/gtk1/mdi.h" #elif defined(__WXMAC__) #include "wx/osx/mdi.h" #elif defined(__WXQT__) #include "wx/qt/mdi.h" #endif inline wxMDIClientWindow *wxMDIParentFrameBase::OnCreateClient() { return new wxMDIClientWindow; } inline bool wxMDIParentFrameBase::TryBefore(wxEvent& event) { // Menu (and toolbar) events should be sent to the active child frame // first, if any. if ( event.GetEventType() == wxEVT_MENU || event.GetEventType() == wxEVT_UPDATE_UI ) { wxMDIChildFrame * const child = GetActiveChild(); if ( child ) { // However avoid sending the event back to the child if it's // currently being propagated to us from it. wxWindow* const from = static_cast<wxWindow*>(event.GetPropagatedFrom()); if ( !from || !from->IsDescendant(child) ) { if ( child->ProcessWindowEventLocally(event) ) return true; } } } return wxFrame::TryBefore(event); } #endif // wxUSE_MDI #endif // _WX_MDI_H_BASE_
h
rticonnextdds-usecases
data/projects/rticonnextdds-usecases/VehicleTracking/ExampleCode/thirdparty/wxWidgets-3.1.2/Win64/include/wx/memconf.h
/////////////////////////////////////////////////////////////////////////////// // Name: wx/memconf.h // Purpose: wxMemoryConfig class: a wxConfigBase implementation which only // stores the settings in memory (thus they are lost when the // program terminates) // Author: Vadim Zeitlin // Modified by: // Created: 22.01.00 // Copyright: (c) 2000 Vadim Zeitlin <[email protected]> // Licence: wxWindows licence /////////////////////////////////////////////////////////////////////////////// /* * NB: I don't see how this class may possibly be useful to the application * program (as the settings are lost on program termination), but it is * handy to have it inside wxWidgets. So for now let's say that this class * is private and should only be used by wxWidgets itself - this might * change in the future. */ #ifndef _WX_MEMCONF_H_ #define _WX_MEMCONF_H_ #if wxUSE_CONFIG #include "wx/fileconf.h" // the base class // ---------------------------------------------------------------------------- // wxMemoryConfig: a config class which stores settings in non-persistent way // ---------------------------------------------------------------------------- // notice that we inherit from wxFileConfig which already stores its data in // memory and just disable file reading/writing - this is probably not optimal // and might be changed in future as well (this class will always deriev from // wxConfigBase though) class wxMemoryConfig : public wxFileConfig { public: // default (and only) ctor wxMemoryConfig() : wxFileConfig(wxEmptyString, // default app name wxEmptyString, // default vendor name wxEmptyString, // no local config file wxEmptyString, // no system config file 0) // don't use any files { } wxDECLARE_NO_COPY_CLASS(wxMemoryConfig); }; #endif // wxUSE_CONFIG #endif // _WX_MEMCONF_H_
h
rticonnextdds-usecases
data/projects/rticonnextdds-usecases/VehicleTracking/ExampleCode/thirdparty/wxWidgets-3.1.2/Win64/include/wx/valtext.h
///////////////////////////////////////////////////////////////////////////// // Name: wx/valtext.h // Purpose: wxTextValidator class // Author: Julian Smart // Modified by: Francesco Montorsi // Created: 29/01/98 // Copyright: (c) 1998 Julian Smart // Licence: wxWindows licence ///////////////////////////////////////////////////////////////////////////// #ifndef _WX_VALTEXT_H_ #define _WX_VALTEXT_H_ #include "wx/defs.h" #if wxUSE_VALIDATORS && (wxUSE_TEXTCTRL || wxUSE_COMBOBOX) class WXDLLIMPEXP_FWD_CORE wxTextEntry; #include "wx/validate.h" enum wxTextValidatorStyle { wxFILTER_NONE = 0x0, wxFILTER_EMPTY = 0x1, wxFILTER_ASCII = 0x2, wxFILTER_ALPHA = 0x4, wxFILTER_ALPHANUMERIC = 0x8, wxFILTER_DIGITS = 0x10, wxFILTER_NUMERIC = 0x20, wxFILTER_INCLUDE_LIST = 0x40, wxFILTER_INCLUDE_CHAR_LIST = 0x80, wxFILTER_EXCLUDE_LIST = 0x100, wxFILTER_EXCLUDE_CHAR_LIST = 0x200 }; class WXDLLIMPEXP_CORE wxTextValidator: public wxValidator { public: wxTextValidator(long style = wxFILTER_NONE, wxString *val = NULL); wxTextValidator(const wxTextValidator& val); virtual ~wxTextValidator(){} // 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 wxOVERRIDE { return new wxTextValidator(*this); } bool Copy(const wxTextValidator& val); // Called when the value in the window must be validated. // This function can pop up an error message. virtual bool Validate(wxWindow *parent) wxOVERRIDE; // Called to transfer data to the window virtual bool TransferToWindow() wxOVERRIDE; // Called to transfer data from the window virtual bool TransferFromWindow() wxOVERRIDE; // Filter keystrokes void OnChar(wxKeyEvent& event); // ACCESSORS inline long GetStyle() const { return m_validatorStyle; } void SetStyle(long style); wxTextEntry *GetTextEntry(); void SetCharIncludes(const wxString& chars); void SetIncludes(const wxArrayString& includes) { m_includes = includes; } inline wxArrayString& GetIncludes() { return m_includes; } void SetCharExcludes(const wxString& chars); void SetExcludes(const wxArrayString& excludes) { m_excludes = excludes; } inline wxArrayString& GetExcludes() { return m_excludes; } bool HasFlag(wxTextValidatorStyle style) const { return (m_validatorStyle & style) != 0; } protected: // returns true if all characters of the given string are present in m_includes bool ContainsOnlyIncludedCharacters(const wxString& val) const; // returns true if at least one character of the given string is present in m_excludes bool ContainsExcludedCharacters(const wxString& val) const; // returns the error message if the contents of 'val' are invalid virtual wxString IsValid(const wxString& val) const; protected: long m_validatorStyle; wxString* m_stringValue; wxArrayString m_includes; wxArrayString m_excludes; private: wxDECLARE_NO_ASSIGN_CLASS(wxTextValidator); wxDECLARE_DYNAMIC_CLASS(wxTextValidator); wxDECLARE_EVENT_TABLE(); }; #endif // wxUSE_VALIDATORS && (wxUSE_TEXTCTRL || wxUSE_COMBOBOX) #endif // _WX_VALTEXT_H_
h
rticonnextdds-usecases
data/projects/rticonnextdds-usecases/VehicleTracking/ExampleCode/thirdparty/wxWidgets-3.1.2/Win64/include/wx/xpmdecod.h
///////////////////////////////////////////////////////////////////////////// // Name: wx/xpmdecod.h // Purpose: wxXPMDecoder, XPM reader for wxImage and wxBitmap // Author: Vaclav Slavik // Copyright: (c) 2001 Vaclav Slavik // Licence: wxWindows licence ///////////////////////////////////////////////////////////////////////////// #ifndef _WX_XPMDECOD_H_ #define _WX_XPMDECOD_H_ #include "wx/defs.h" #if wxUSE_IMAGE && wxUSE_XPM class WXDLLIMPEXP_FWD_CORE wxImage; class WXDLLIMPEXP_FWD_BASE wxInputStream; // -------------------------------------------------------------------------- // wxXPMDecoder class // -------------------------------------------------------------------------- class WXDLLIMPEXP_CORE wxXPMDecoder { public: // constructor, destructor, etc. wxXPMDecoder() {} ~wxXPMDecoder() {} #if wxUSE_STREAMS // Is the stream XPM file? // NOTE: this function modifies the current stream position bool CanRead(wxInputStream& stream); // Read XPM file from the stream, parse it and create image from it wxImage ReadFile(wxInputStream& stream); #endif // Read directly from XPM data (as passed to wxBitmap ctor): wxImage ReadData(const char* const* xpm_data); #ifdef __BORLANDC__ // needed for Borland 5.5 wxImage ReadData(char** xpm_data) { return ReadData(const_cast<const char* const*>(xpm_data)); } #endif }; #endif // wxUSE_IMAGE && wxUSE_XPM #endif // _WX_XPM_H_
h
rticonnextdds-usecases
data/projects/rticonnextdds-usecases/VehicleTracking/ExampleCode/thirdparty/wxWidgets-3.1.2/Win64/include/wx/dcmirror.h
/////////////////////////////////////////////////////////////////////////////// // Name: wx/dcmirror.h // Purpose: wxMirrorDC class // Author: Vadim Zeitlin // Modified by: // Created: 21.07.2003 // Copyright: (c) 2003 Vadim Zeitlin <[email protected]> // Licence: wxWindows licence /////////////////////////////////////////////////////////////////////////////// #ifndef _WX_DCMIRROR_H_ #define _WX_DCMIRROR_H_ #include "wx/dc.h" // ---------------------------------------------------------------------------- // wxMirrorDC allows to write the same code for horz/vertical layout // ---------------------------------------------------------------------------- class WXDLLIMPEXP_CORE wxMirrorDCImpl : public wxDCImpl { public: // constructs a mirror DC associated with the given real DC // // if mirror parameter is true, all vertical and horizontal coordinates are // exchanged, otherwise this class behaves in exactly the same way as a // plain DC wxMirrorDCImpl(wxDC *owner, wxDCImpl& dc, bool mirror) : wxDCImpl(owner), m_dc(dc) { m_mirror = mirror; } // wxDCBase operations virtual void Clear() wxOVERRIDE { m_dc.Clear(); } virtual void SetFont(const wxFont& font) wxOVERRIDE { m_dc.SetFont(font); } virtual void SetPen(const wxPen& pen) wxOVERRIDE { m_dc.SetPen(pen); } virtual void SetBrush(const wxBrush& brush) wxOVERRIDE { m_dc.SetBrush(brush); } virtual void SetBackground(const wxBrush& brush) wxOVERRIDE { m_dc.SetBackground(brush); } virtual void SetBackgroundMode(int mode) wxOVERRIDE { m_dc.SetBackgroundMode(mode); } #if wxUSE_PALETTE virtual void SetPalette(const wxPalette& palette) wxOVERRIDE { m_dc.SetPalette(palette); } #endif // wxUSE_PALETTE virtual void DestroyClippingRegion() wxOVERRIDE { m_dc.DestroyClippingRegion(); } virtual wxCoord GetCharHeight() const wxOVERRIDE { return m_dc.GetCharHeight(); } virtual wxCoord GetCharWidth() const wxOVERRIDE { return m_dc.GetCharWidth(); } virtual bool CanDrawBitmap() const wxOVERRIDE { return m_dc.CanDrawBitmap(); } virtual bool CanGetTextExtent() const wxOVERRIDE { return m_dc.CanGetTextExtent(); } virtual int GetDepth() const wxOVERRIDE { return m_dc.GetDepth(); } virtual wxSize GetPPI() const wxOVERRIDE { return m_dc.GetPPI(); } virtual bool IsOk() const wxOVERRIDE { return m_dc.IsOk(); } virtual void SetMapMode(wxMappingMode mode) wxOVERRIDE { m_dc.SetMapMode(mode); } virtual void SetUserScale(double x, double y) wxOVERRIDE { m_dc.SetUserScale(GetX(x, y), GetY(x, y)); } virtual void SetLogicalOrigin(wxCoord x, wxCoord y) wxOVERRIDE { m_dc.SetLogicalOrigin(GetX(x, y), GetY(x, y)); } virtual void SetDeviceOrigin(wxCoord x, wxCoord y) wxOVERRIDE { m_dc.SetDeviceOrigin(GetX(x, y), GetY(x, y)); } virtual void SetAxisOrientation(bool xLeftRight, bool yBottomUp) wxOVERRIDE { m_dc.SetAxisOrientation(GetX(xLeftRight, yBottomUp), GetY(xLeftRight, yBottomUp)); } virtual void SetLogicalFunction(wxRasterOperationMode function) wxOVERRIDE { m_dc.SetLogicalFunction(function); } virtual void* GetHandle() const wxOVERRIDE { return m_dc.GetHandle(); } protected: // returns x and y if not mirroring or y and x if mirroring wxCoord GetX(wxCoord x, wxCoord y) const { return m_mirror ? y : x; } wxCoord GetY(wxCoord x, wxCoord y) const { return m_mirror ? x : y; } double GetX(double x, double y) const { return m_mirror ? y : x; } double GetY(double x, double y) const { return m_mirror ? x : y; } bool GetX(bool x, bool y) const { return m_mirror ? y : x; } bool GetY(bool x, bool y) const { return m_mirror ? x : y; } // same thing but for pointers wxCoord *GetX(wxCoord *x, wxCoord *y) const { return m_mirror ? y : x; } wxCoord *GetY(wxCoord *x, wxCoord *y) const { return m_mirror ? x : y; } // exchange x and y components of all points in the array if necessary wxPoint* Mirror(int n, const wxPoint*& points) const { wxPoint* points_alloc = NULL; if ( m_mirror ) { points_alloc = new wxPoint[n]; for ( int i = 0; i < n; i++ ) { points_alloc[i].x = points[i].y; points_alloc[i].y = points[i].x; } points = points_alloc; } return points_alloc; } // wxDCBase functions virtual bool DoFloodFill(wxCoord x, wxCoord y, const wxColour& col, wxFloodFillStyle style = wxFLOOD_SURFACE) wxOVERRIDE { return m_dc.DoFloodFill(GetX(x, y), GetY(x, y), col, style); } virtual bool DoGetPixel(wxCoord x, wxCoord y, wxColour *col) const wxOVERRIDE { return m_dc.DoGetPixel(GetX(x, y), GetY(x, y), col); } virtual void DoDrawPoint(wxCoord x, wxCoord y) wxOVERRIDE { m_dc.DoDrawPoint(GetX(x, y), GetY(x, y)); } virtual void DoDrawLine(wxCoord x1, wxCoord y1, wxCoord x2, wxCoord y2) wxOVERRIDE { m_dc.DoDrawLine(GetX(x1, y1), GetY(x1, y1), GetX(x2, y2), GetY(x2, y2)); } virtual void DoDrawArc(wxCoord x1, wxCoord y1, wxCoord x2, wxCoord y2, wxCoord xc, wxCoord yc) wxOVERRIDE { wxFAIL_MSG( wxT("this is probably wrong") ); m_dc.DoDrawArc(GetX(x1, y1), GetY(x1, y1), GetX(x2, y2), GetY(x2, y2), xc, yc); } virtual void DoDrawCheckMark(wxCoord x, wxCoord y, wxCoord w, wxCoord h) wxOVERRIDE { m_dc.DoDrawCheckMark(GetX(x, y), GetY(x, y), GetX(w, h), GetY(w, h)); } virtual void DoDrawEllipticArc(wxCoord x, wxCoord y, wxCoord w, wxCoord h, double sa, double ea) wxOVERRIDE { wxFAIL_MSG( wxT("this is probably wrong") ); m_dc.DoDrawEllipticArc(GetX(x, y), GetY(x, y), GetX(w, h), GetY(w, h), sa, ea); } virtual void DoDrawRectangle(wxCoord x, wxCoord y, wxCoord w, wxCoord h) wxOVERRIDE { m_dc.DoDrawRectangle(GetX(x, y), GetY(x, y), GetX(w, h), GetY(w, h)); } virtual void DoDrawRoundedRectangle(wxCoord x, wxCoord y, wxCoord w, wxCoord h, double radius) wxOVERRIDE { m_dc.DoDrawRoundedRectangle(GetX(x, y), GetY(x, y), GetX(w, h), GetY(w, h), radius); } virtual void DoDrawEllipse(wxCoord x, wxCoord y, wxCoord w, wxCoord h) wxOVERRIDE { m_dc.DoDrawEllipse(GetX(x, y), GetY(x, y), GetX(w, h), GetY(w, h)); } virtual void DoCrossHair(wxCoord x, wxCoord y) wxOVERRIDE { m_dc.DoCrossHair(GetX(x, y), GetY(x, y)); } virtual void DoDrawIcon(const wxIcon& icon, wxCoord x, wxCoord y) wxOVERRIDE { m_dc.DoDrawIcon(icon, GetX(x, y), GetY(x, y)); } virtual void DoDrawBitmap(const wxBitmap &bmp, wxCoord x, wxCoord y, bool useMask = false) wxOVERRIDE { m_dc.DoDrawBitmap(bmp, GetX(x, y), GetY(x, y), useMask); } virtual void DoDrawText(const wxString& text, wxCoord x, wxCoord y) wxOVERRIDE { // this is never mirrored m_dc.DoDrawText(text, x, y); } virtual void DoDrawRotatedText(const wxString& text, wxCoord x, wxCoord y, double angle) wxOVERRIDE { // this is never mirrored m_dc.DoDrawRotatedText(text, x, y, angle); } virtual bool DoBlit(wxCoord xdest, wxCoord ydest, wxCoord w, wxCoord h, wxDC *source, wxCoord xsrc, wxCoord ysrc, wxRasterOperationMode rop = wxCOPY, bool useMask = false, wxCoord xsrcMask = wxDefaultCoord, wxCoord ysrcMask = wxDefaultCoord) wxOVERRIDE { return m_dc.DoBlit(GetX(xdest, ydest), GetY(xdest, ydest), GetX(w, h), GetY(w, h), source, GetX(xsrc, ysrc), GetY(xsrc, ysrc), rop, useMask, GetX(xsrcMask, ysrcMask), GetX(xsrcMask, ysrcMask)); } virtual void DoGetSize(int *w, int *h) const wxOVERRIDE { m_dc.DoGetSize(GetX(w, h), GetY(w, h)); } virtual void DoGetSizeMM(int *w, int *h) const wxOVERRIDE { m_dc.DoGetSizeMM(GetX(w, h), GetY(w, h)); } virtual void DoDrawLines(int n, const wxPoint points[], wxCoord xoffset, wxCoord yoffset) wxOVERRIDE { wxPoint* points_alloc = Mirror(n, points); m_dc.DoDrawLines(n, points, GetX(xoffset, yoffset), GetY(xoffset, yoffset)); delete[] points_alloc; } virtual void DoDrawPolygon(int n, const wxPoint points[], wxCoord xoffset, wxCoord yoffset, wxPolygonFillMode fillStyle = wxODDEVEN_RULE) wxOVERRIDE { wxPoint* points_alloc = Mirror(n, points); m_dc.DoDrawPolygon(n, points, GetX(xoffset, yoffset), GetY(xoffset, yoffset), fillStyle); delete[] points_alloc; } virtual void DoSetDeviceClippingRegion(const wxRegion& WXUNUSED(region)) wxOVERRIDE { wxFAIL_MSG( wxT("not implemented") ); } virtual void DoSetClippingRegion(wxCoord x, wxCoord y, wxCoord w, wxCoord h) wxOVERRIDE { m_dc.DoSetClippingRegion(GetX(x, y), GetY(x, y), GetX(w, h), GetY(w, h)); } virtual void DoGetTextExtent(const wxString& string, wxCoord *x, wxCoord *y, wxCoord *descent = NULL, wxCoord *externalLeading = NULL, const wxFont *theFont = NULL) const wxOVERRIDE { // never mirrored m_dc.DoGetTextExtent(string, x, y, descent, externalLeading, theFont); } private: wxDCImpl& m_dc; bool m_mirror; wxDECLARE_NO_COPY_CLASS(wxMirrorDCImpl); }; class WXDLLIMPEXP_CORE wxMirrorDC : public wxDC { public: wxMirrorDC(wxDC& dc, bool mirror) : wxDC(new wxMirrorDCImpl(this, *dc.GetImpl(), mirror)) { m_mirror = mirror; } // helper functions which may be useful for the users of this class wxSize Reflect(const wxSize& sizeOrig) { return m_mirror ? wxSize(sizeOrig.y, sizeOrig.x) : sizeOrig; } private: bool m_mirror; wxDECLARE_NO_COPY_CLASS(wxMirrorDC); }; #endif // _WX_DCMIRROR_H_
h
rticonnextdds-usecases
data/projects/rticonnextdds-usecases/VehicleTracking/ExampleCode/thirdparty/wxWidgets-3.1.2/Win64/include/wx/filehistory.h
///////////////////////////////////////////////////////////////////////////// // Name: wx/filehistory.h // Purpose: wxFileHistory class // Author: Julian Smart, Vaclav Slavik // Created: 2010-05-03 // Copyright: (c) Julian Smart, Vaclav Slavik // Licence: wxWindows licence ///////////////////////////////////////////////////////////////////////////// #ifndef _WX_FILEHISTORY_H_ #define _WX_FILEHISTORY_H_ #include "wx/defs.h" #if wxUSE_FILE_HISTORY #include "wx/windowid.h" #include "wx/object.h" #include "wx/list.h" #include "wx/string.h" #include "wx/arrstr.h" class WXDLLIMPEXP_FWD_CORE wxMenu; class WXDLLIMPEXP_FWD_BASE wxConfigBase; class WXDLLIMPEXP_FWD_BASE wxFileName; // ---------------------------------------------------------------------------- // File history management // ---------------------------------------------------------------------------- class WXDLLIMPEXP_CORE wxFileHistoryBase : public wxObject { public: wxFileHistoryBase(size_t maxFiles = 9, wxWindowID idBase = wxID_FILE1); // Operations virtual void AddFileToHistory(const wxString& file); virtual void RemoveFileFromHistory(size_t i); virtual int GetMaxFiles() const { return (int)m_fileMaxFiles; } virtual void UseMenu(wxMenu *menu); // Remove menu from the list (MDI child may be closing) virtual void RemoveMenu(wxMenu *menu); #if wxUSE_CONFIG virtual void Load(const wxConfigBase& config); virtual void Save(wxConfigBase& config); #endif // wxUSE_CONFIG virtual void AddFilesToMenu(); virtual void AddFilesToMenu(wxMenu* menu); // Single menu // Accessors virtual wxString GetHistoryFile(size_t i) const { return m_fileHistory[i]; } virtual size_t GetCount() const { return m_fileHistory.GetCount(); } const wxList& GetMenus() const { return m_fileMenus; } // Set/get base id void SetBaseId(wxWindowID baseId) { m_idBase = baseId; } wxWindowID GetBaseId() const { return m_idBase; } protected: // Last n files wxArrayString m_fileHistory; // Menus to maintain (may need several for an MDI app) wxList m_fileMenus; // Max files to maintain size_t m_fileMaxFiles; private: // The ID of the first history menu item (Doesn't have to be wxID_FILE1) wxWindowID m_idBase; // Normalize a file name to canonical form. We have a special function for // this to ensure the same normalization is used everywhere. static wxString NormalizeFileName(const wxFileName& filename); // Remove any existing entries from the associated menus. void RemoveExistingHistory(); wxDECLARE_NO_COPY_CLASS(wxFileHistoryBase); }; #if defined(__WXGTK20__) #include "wx/gtk/filehistory.h" #else // no platform-specific implementation of wxFileHistory yet class WXDLLIMPEXP_CORE wxFileHistory : public wxFileHistoryBase { public: wxFileHistory(size_t maxFiles = 9, wxWindowID idBase = wxID_FILE1) : wxFileHistoryBase(maxFiles, idBase) {} wxDECLARE_DYNAMIC_CLASS(wxFileHistory); }; #endif #endif // wxUSE_FILE_HISTORY #endif // _WX_FILEHISTORY_H_
h
rticonnextdds-usecases
data/projects/rticonnextdds-usecases/VehicleTracking/ExampleCode/thirdparty/wxWidgets-3.1.2/Win64/include/wx/hash.h
///////////////////////////////////////////////////////////////////////////// // Name: wx/hash.h // Purpose: wxHashTable class // Author: Julian Smart // Modified by: VZ at 25.02.00: type safe hashes with WX_DECLARE_HASH() // Created: 01/02/97 // Copyright: (c) Julian Smart // Licence: wxWindows licence ///////////////////////////////////////////////////////////////////////////// #ifndef _WX_HASH_H__ #define _WX_HASH_H__ #include "wx/defs.h" #include "wx/string.h" #if !wxUSE_STD_CONTAINERS #include "wx/object.h" #else class WXDLLIMPEXP_FWD_BASE wxObject; #endif // the default size of the hash #define wxHASH_SIZE_DEFAULT (1000) /* * A hash table is an array of user-definable size with lists * of data items hanging off the array positions. Usually there'll * be a hit, so no search is required; otherwise we'll have to run down * the list to find the desired item. */ union wxHashKeyValue { long integer; wxString *string; }; // for some compilers (AIX xlC), defining it as friend inside the class is not // enough, so provide a real forward declaration class WXDLLIMPEXP_FWD_BASE wxHashTableBase; // and clang doesn't like using WXDLLIMPEXP_FWD_BASE inside a typedef. class WXDLLIMPEXP_FWD_BASE wxHashTableBase_Node; class WXDLLIMPEXP_BASE wxHashTableBase_Node { friend class wxHashTableBase; typedef class wxHashTableBase_Node _Node; public: wxHashTableBase_Node( long key, void* value, wxHashTableBase* table ); wxHashTableBase_Node( const wxString& key, void* value, wxHashTableBase* table ); ~wxHashTableBase_Node(); long GetKeyInteger() const { return m_key.integer; } const wxString& GetKeyString() const { return *m_key.string; } void* GetData() const { return m_value; } void SetData( void* data ) { m_value = data; } protected: _Node* GetNext() const { return m_next; } protected: // next node in the chain wxHashTableBase_Node* m_next; // key wxHashKeyValue m_key; // value void* m_value; // pointer to the hash containing the node, used to remove the // node from the hash when the user deletes the node iterating // through it // TODO: move it to wxHashTable_Node (only wxHashTable supports // iteration) wxHashTableBase* m_hashPtr; }; class WXDLLIMPEXP_BASE wxHashTableBase #if !wxUSE_STD_CONTAINERS : public wxObject #endif { friend class WXDLLIMPEXP_FWD_BASE wxHashTableBase_Node; public: typedef wxHashTableBase_Node Node; wxHashTableBase(); virtual ~wxHashTableBase() { } void Create( wxKeyType keyType = wxKEY_INTEGER, size_t size = wxHASH_SIZE_DEFAULT ); void Clear(); void Destroy(); size_t GetSize() const { return m_size; } size_t GetCount() const { return m_count; } void DeleteContents( bool flag ) { m_deleteContents = flag; } static long MakeKey(const wxString& string); protected: void DoPut( long key, long hash, void* data ); void DoPut( const wxString& key, long hash, void* data ); void* DoGet( long key, long hash ) const; void* DoGet( const wxString& key, long hash ) const; void* DoDelete( long key, long hash ); void* DoDelete( const wxString& key, long hash ); private: // Remove the node from the hash, *only called from // ~wxHashTable*_Node destructor void DoRemoveNode( wxHashTableBase_Node* node ); // destroys data contained in the node if appropriate: // deletes the key if it is a string and destrys // the value if m_deleteContents is true void DoDestroyNode( wxHashTableBase_Node* node ); // inserts a node in the table (at the end of the chain) void DoInsertNode( size_t bucket, wxHashTableBase_Node* node ); // removes a node from the table (fiven a pointer to the previous // but does not delete it (only deletes its contents) void DoUnlinkNode( size_t bucket, wxHashTableBase_Node* node, wxHashTableBase_Node* prev ); // unconditionally deletes node value (invoking the // correct destructor) virtual void DoDeleteContents( wxHashTableBase_Node* node ) = 0; protected: // number of buckets size_t m_size; // number of nodes (key/value pairs) size_t m_count; // table Node** m_table; // key typ (INTEGER/STRING) wxKeyType m_keyType; // delete contents when hash is cleared bool m_deleteContents; private: wxDECLARE_NO_COPY_CLASS(wxHashTableBase); }; // ---------------------------------------------------------------------------- // for compatibility only // ---------------------------------------------------------------------------- class WXDLLIMPEXP_BASE wxHashTable_Node : public wxHashTableBase_Node { friend class WXDLLIMPEXP_FWD_BASE wxHashTable; public: wxHashTable_Node( long key, void* value, wxHashTableBase* table ) : wxHashTableBase_Node( key, value, table ) { } wxHashTable_Node( const wxString& key, void* value, wxHashTableBase* table ) : wxHashTableBase_Node( key, value, table ) { } wxObject* GetData() const { return (wxObject*)wxHashTableBase_Node::GetData(); } void SetData( wxObject* data ) { wxHashTableBase_Node::SetData( data ); } wxHashTable_Node* GetNext() const { return (wxHashTable_Node*)wxHashTableBase_Node::GetNext(); } }; // should inherit protectedly, but it is public for compatibility in // order to publicly inherit from wxObject class WXDLLIMPEXP_BASE wxHashTable : public wxHashTableBase { typedef wxHashTableBase hash; public: typedef wxHashTable_Node Node; typedef wxHashTable_Node* compatibility_iterator; public: wxHashTable( wxKeyType keyType = wxKEY_INTEGER, size_t size = wxHASH_SIZE_DEFAULT ) : wxHashTableBase() { Create( keyType, size ); BeginFind(); } wxHashTable( const wxHashTable& table ); virtual ~wxHashTable() { Destroy(); } const wxHashTable& operator=( const wxHashTable& ); // key and value are the same void Put(long value, wxObject *object) { DoPut( value, value, object ); } void Put(long lhash, long value, wxObject *object) { DoPut( value, lhash, object ); } void Put(const wxString& value, wxObject *object) { DoPut( value, MakeKey( value ), object ); } void Put(long lhash, const wxString& value, wxObject *object) { DoPut( value, lhash, object ); } // key and value are the same wxObject *Get(long value) const { return (wxObject*)DoGet( value, value ); } wxObject *Get(long lhash, long value) const { return (wxObject*)DoGet( value, lhash ); } wxObject *Get(const wxString& value) const { return (wxObject*)DoGet( value, MakeKey( value ) ); } wxObject *Get(long lhash, const wxString& value) const { return (wxObject*)DoGet( value, lhash ); } // Deletes entry and returns data if found wxObject *Delete(long key) { return (wxObject*)DoDelete( key, key ); } wxObject *Delete(long lhash, long key) { return (wxObject*)DoDelete( key, lhash ); } wxObject *Delete(const wxString& key) { return (wxObject*)DoDelete( key, MakeKey( key ) ); } wxObject *Delete(long lhash, const wxString& key) { return (wxObject*)DoDelete( key, lhash ); } // Way of iterating through whole hash table (e.g. to delete everything) // Not necessary, of course, if you're only storing pointers to // objects maintained separately void BeginFind() { m_curr = NULL; m_currBucket = 0; } Node* Next(); void Clear() { wxHashTableBase::Clear(); } size_t GetCount() const { return wxHashTableBase::GetCount(); } protected: // copy helper void DoCopy( const wxHashTable& copy ); // searches the next node starting from bucket bucketStart and sets // m_curr to it and m_currBucket to its bucket void GetNextNode( size_t bucketStart ); private: virtual void DoDeleteContents( wxHashTableBase_Node* node ) wxOVERRIDE; // current node Node* m_curr; // bucket the current node belongs to size_t m_currBucket; }; // defines a new type safe hash table which stores the elements of type eltype // in lists of class listclass #define _WX_DECLARE_HASH(eltype, dummy, hashclass, classexp) \ classexp hashclass : public wxHashTableBase \ { \ public: \ hashclass(wxKeyType keyType = wxKEY_INTEGER, \ size_t size = wxHASH_SIZE_DEFAULT) \ : wxHashTableBase() { Create(keyType, size); } \ \ virtual ~hashclass() { Destroy(); } \ \ void Put(long key, eltype *data) { DoPut(key, key, (void*)data); } \ void Put(long lhash, long key, eltype *data) \ { DoPut(key, lhash, (void*)data); } \ eltype *Get(long key) const { return (eltype*)DoGet(key, key); } \ eltype *Get(long lhash, long key) const \ { return (eltype*)DoGet(key, lhash); } \ eltype *Delete(long key) { return (eltype*)DoDelete(key, key); } \ eltype *Delete(long lhash, long key) \ { return (eltype*)DoDelete(key, lhash); } \ private: \ virtual void DoDeleteContents( wxHashTableBase_Node* node ) wxOVERRIDE\ { delete (eltype*)node->GetData(); } \ \ wxDECLARE_NO_COPY_CLASS(hashclass); \ } // this macro is to be used in the user code #define WX_DECLARE_HASH(el, list, hash) \ _WX_DECLARE_HASH(el, list, hash, class) // and this one does exactly the same thing but should be used inside the // library #define WX_DECLARE_EXPORTED_HASH(el, list, hash) \ _WX_DECLARE_HASH(el, list, hash, class WXDLLIMPEXP_CORE) #define WX_DECLARE_USER_EXPORTED_HASH(el, list, hash, usergoo) \ _WX_DECLARE_HASH(el, list, hash, class usergoo) // 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_TABLE(hash) \ { \ (hash).BeginFind(); \ wxHashTable::compatibility_iterator it = (hash).Next(); \ while( it ) \ { \ delete it->GetData(); \ it = (hash).Next(); \ } \ (hash).Clear(); \ } #endif // _WX_HASH_H__
h
rticonnextdds-usecases
data/projects/rticonnextdds-usecases/VehicleTracking/ExampleCode/thirdparty/wxWidgets-3.1.2/Win64/include/wx/xti.h
///////////////////////////////////////////////////////////////////////////// // Name: wx/xti.h // Purpose: runtime metadata information (extended class info) // Author: Stefan Csomor // Modified by: Francesco Montorsi // Created: 27/07/03 // Copyright: (c) 1997 Julian Smart // (c) 2003 Stefan Csomor // Licence: wxWindows licence ///////////////////////////////////////////////////////////////////////////// #ifndef _WX_XTIH__ #define _WX_XTIH__ // We want to support properties, event sources and events sinks through // explicit declarations, using templates and specialization to make the // effort as painless as possible. // // This means we have the following domains : // // - Type Information for categorizing built in types as well as custom types // this includes information about enums, their values and names // - Type safe value storage : a kind of wxVariant, called right now wxAny // which will be merged with wxVariant // - Property Information and Property Accessors providing access to a class' // values and exposed event delegates // - Information about event handlers // - extended Class Information for accessing all these // ---------------------------------------------------------------------------- // headers // ---------------------------------------------------------------------------- #include "wx/defs.h" #if wxUSE_EXTENDED_RTTI class WXDLLIMPEXP_FWD_BASE wxAny; class WXDLLIMPEXP_FWD_BASE wxAnyList; class WXDLLIMPEXP_FWD_BASE wxObject; class WXDLLIMPEXP_FWD_BASE wxString; class WXDLLIMPEXP_FWD_BASE wxClassInfo; class WXDLLIMPEXP_FWD_BASE wxHashTable; class WXDLLIMPEXP_FWD_BASE wxObject; class WXDLLIMPEXP_FWD_BASE wxPluginLibrary; class WXDLLIMPEXP_FWD_BASE wxHashTable; class WXDLLIMPEXP_FWD_BASE wxHashTable_Node; class WXDLLIMPEXP_FWD_BASE wxStringToAnyHashMap; class WXDLLIMPEXP_FWD_BASE wxPropertyInfoMap; class WXDLLIMPEXP_FWD_BASE wxPropertyAccessor; class WXDLLIMPEXP_FWD_BASE wxObjectAllocatorAndCreator; class WXDLLIMPEXP_FWD_BASE wxObjectAllocator; #define wx_dynamic_cast(t, x) dynamic_cast<t>(x) #include "wx/xtitypes.h" #include "wx/xtihandler.h" // ---------------------------------------------------------------------------- // wxClassInfo // ---------------------------------------------------------------------------- class WXDLLIMPEXP_BASE wxObjectFunctor { public: virtual ~wxObjectFunctor(); // Invoke the actual event handler: virtual void operator()(const wxObject *) = 0; }; class WXDLLIMPEXP_FWD_BASE wxPropertyInfo; class WXDLLIMPEXP_FWD_BASE wxHandlerInfo; typedef wxObject *(*wxObjectConstructorFn)(void); typedef wxPropertyInfo *(*wxPropertyInfoFn)(void); typedef wxHandlerInfo *(*wxHandlerInfoFn)(void); typedef void (*wxVariantToObjectConverter)( const wxAny &data, wxObjectFunctor* fn ); typedef wxObject* (*wxVariantToObjectPtrConverter) ( const wxAny& data); typedef wxAny (*wxObjectToVariantConverter)( wxObject* ); WXDLLIMPEXP_BASE wxString wxAnyGetAsString( const wxAny& data); WXDLLIMPEXP_BASE const wxObject* wxAnyGetAsObjectPtr( const wxAny& data); class WXDLLIMPEXP_BASE wxObjectWriter; class WXDLLIMPEXP_BASE wxObjectWriterCallback; typedef bool (*wxObjectStreamingCallback) ( const wxObject *, wxObjectWriter *, \ wxObjectWriterCallback *, const wxStringToAnyHashMap & ); class WXDLLIMPEXP_BASE wxClassInfo { friend class WXDLLIMPEXP_BASE wxPropertyInfo; friend class /* WXDLLIMPEXP_BASE */ wxHandlerInfo; friend wxObject *wxCreateDynamicObject(const wxString& name); public: wxClassInfo(const wxClassInfo **_Parents, const wxChar *_UnitName, const wxChar *_ClassName, int size, wxObjectConstructorFn ctor, wxPropertyInfoFn _Props, wxHandlerInfoFn _Handlers, wxObjectAllocatorAndCreator* _Constructor, const wxChar ** _ConstructorProperties, const int _ConstructorPropertiesCount, wxVariantToObjectPtrConverter _PtrConverter1, wxVariantToObjectConverter _Converter2, wxObjectToVariantConverter _Converter3, wxObjectStreamingCallback _streamingCallback = NULL) : m_className(_ClassName), m_objectSize(size), m_objectConstructor(ctor), m_next(sm_first), m_firstPropertyFn(_Props), m_firstHandlerFn(_Handlers), m_firstProperty(NULL), m_firstHandler(NULL), m_firstInited(false), m_parents(_Parents), m_unitName(_UnitName), m_constructor(_Constructor), m_constructorProperties(_ConstructorProperties), m_constructorPropertiesCount(_ConstructorPropertiesCount), m_variantOfPtrToObjectConverter(_PtrConverter1), m_variantToObjectConverter(_Converter2), m_objectToVariantConverter(_Converter3), m_streamingCallback(_streamingCallback) { sm_first = this; Register(); } wxClassInfo(const wxChar *_UnitName, const wxChar *_ClassName, const wxClassInfo **_Parents) : m_className(_ClassName), m_objectSize(0), m_objectConstructor(NULL), m_next(sm_first), m_firstPropertyFn(NULL), m_firstHandlerFn(NULL), m_firstProperty(NULL), m_firstHandler(NULL), m_firstInited(true), m_parents(_Parents), m_unitName(_UnitName), m_constructor(NULL), m_constructorProperties(NULL), m_constructorPropertiesCount(0), m_variantOfPtrToObjectConverter(NULL), m_variantToObjectConverter(NULL), m_objectToVariantConverter(NULL), m_streamingCallback(NULL) { sm_first = this; Register(); } // ctor compatible with old RTTI system wxClassInfo(const wxChar *_ClassName, const wxClassInfo *_Parent1, const wxClassInfo *_Parent2, int size, wxObjectConstructorFn ctor) : m_className(_ClassName), m_objectSize(size), m_objectConstructor(ctor), m_next(sm_first), m_firstPropertyFn(NULL), m_firstHandlerFn(NULL), m_firstProperty(NULL), m_firstHandler(NULL), m_firstInited(true), m_parents(NULL), m_unitName(NULL), m_constructor(NULL), m_constructorProperties(NULL), m_constructorPropertiesCount(0), m_variantOfPtrToObjectConverter(NULL), m_variantToObjectConverter(NULL), m_objectToVariantConverter(NULL), m_streamingCallback(NULL) { sm_first = this; m_parents[0] = _Parent1; m_parents[1] = _Parent2; m_parents[2] = NULL; Register(); } virtual ~wxClassInfo(); // allocates an instance of this class, this object does not have to be // initialized or fully constructed as this call will be followed by a call to Create virtual wxObject *AllocateObject() const { return m_objectConstructor ? (*m_objectConstructor)() : 0; } // 'old naming' for AllocateObject staying here for backward compatibility wxObject *CreateObject() const { return AllocateObject(); } // direct construction call for classes that cannot construct instances via alloc/create wxObject *ConstructObject(int ParamCount, wxAny *Params) const; bool NeedsDirectConstruction() const; const wxChar *GetClassName() const { return m_className; } const wxChar *GetBaseClassName1() const { return m_parents[0] ? m_parents[0]->GetClassName() : NULL; } const wxChar *GetBaseClassName2() const { return (m_parents[0] && m_parents[1]) ? m_parents[1]->GetClassName() : NULL; } const wxClassInfo *GetBaseClass1() const { return m_parents[0]; } const wxClassInfo *GetBaseClass2() const { return m_parents[0] ? m_parents[1] : NULL; } const wxChar *GetIncludeName() const { return m_unitName; } const wxClassInfo **GetParents() const { return m_parents; } int GetSize() const { return m_objectSize; } bool IsDynamic() const { return (NULL != m_objectConstructor); } wxObjectConstructorFn GetConstructor() const { return m_objectConstructor; } const wxClassInfo *GetNext() const { return m_next; } // statics: static void CleanUp(); static wxClassInfo *FindClass(const wxString& className); static const wxClassInfo *GetFirst() { return sm_first; } // Climb upwards through inheritance hierarchy. // Dual inheritance is catered for. bool IsKindOf(const wxClassInfo *info) const; wxDECLARE_CLASS_INFO_ITERATORS(); // if there is a callback registered with that class it will be called // before this object will be written to disk, it can veto streaming out // this object by returning false, if this class has not registered a // callback, the search will go up the inheritance tree if no callback has // been registered true will be returned by default bool BeforeWriteObject( const wxObject *obj, wxObjectWriter *streamer, wxObjectWriterCallback *writercallback, const wxStringToAnyHashMap &metadata) const; // gets the streaming callback from this class or any superclass wxObjectStreamingCallback GetStreamingCallback() const; // returns the first property wxPropertyInfo* GetFirstProperty() const { EnsureInfosInited(); return m_firstProperty; } // returns the first handler wxHandlerInfo* GetFirstHandler() const { EnsureInfosInited(); return m_firstHandler; } // Call the Create upon an instance of the class, in the end the object is fully // initialized virtual bool Create (wxObject *object, int ParamCount, wxAny *Params) const; // get number of parameters for constructor virtual int GetCreateParamCount() const { return m_constructorPropertiesCount; } // get n-th constructor parameter virtual const wxChar* GetCreateParamName(int n) const { return m_constructorProperties[n]; } // Runtime access to objects for simple properties (get/set) by property // name and variant data virtual void SetProperty (wxObject *object, const wxChar *propertyName, const wxAny &value) const; virtual wxAny GetProperty (wxObject *object, const wxChar *propertyName) const; // Runtime access to objects for collection properties by property name virtual wxAnyList GetPropertyCollection(wxObject *object, const wxChar *propertyName) const; virtual void AddToPropertyCollection(wxObject *object, const wxChar *propertyName, const wxAny& value) const; // we must be able to cast variants to wxObject pointers, templates seem // not to be suitable void CallOnAny( const wxAny &data, wxObjectFunctor* functor ) const; wxObject* AnyToObjectPtr( const wxAny &data) const; wxAny ObjectPtrToAny( wxObject *object ) const; // find property by name virtual const wxPropertyInfo *FindPropertyInfo (const wxChar *PropertyName) const; // find handler by name virtual const wxHandlerInfo *FindHandlerInfo (const wxChar *handlerName) const; // find property by name virtual wxPropertyInfo *FindPropertyInfoInThisClass (const wxChar *PropertyName) const; // find handler by name virtual wxHandlerInfo *FindHandlerInfoInThisClass (const wxChar *handlerName) const; // puts all the properties of this class and its superclasses in the map, // as long as there is not yet an entry with the same name (overriding mechanism) void GetProperties( wxPropertyInfoMap &map ) const; private: const wxChar *m_className; int m_objectSize; wxObjectConstructorFn m_objectConstructor; // class info object live in a linked list: // pointers to its head and the next element in it static wxClassInfo *sm_first; wxClassInfo *m_next; static wxHashTable *sm_classTable; wxPropertyInfoFn m_firstPropertyFn; wxHandlerInfoFn m_firstHandlerFn; protected: void EnsureInfosInited() const { if ( !m_firstInited) { if ( m_firstPropertyFn != NULL) m_firstProperty = (*m_firstPropertyFn)(); if ( m_firstHandlerFn != NULL) m_firstHandler = (*m_firstHandlerFn)(); m_firstInited = true; } } mutable wxPropertyInfo* m_firstProperty; mutable wxHandlerInfo* m_firstHandler; private: mutable bool m_firstInited; const wxClassInfo** m_parents; const wxChar* m_unitName; wxObjectAllocatorAndCreator* m_constructor; const wxChar ** m_constructorProperties; const int m_constructorPropertiesCount; wxVariantToObjectPtrConverter m_variantOfPtrToObjectConverter; wxVariantToObjectConverter m_variantToObjectConverter; wxObjectToVariantConverter m_objectToVariantConverter; wxObjectStreamingCallback m_streamingCallback; const wxPropertyAccessor *FindAccessor (const wxChar *propertyName) const; protected: // registers the class void Register(); void Unregister(); wxDECLARE_NO_COPY_CLASS(wxClassInfo); }; WXDLLIMPEXP_BASE wxObject *wxCreateDynamicObject(const wxString& name); // ---------------------------------------------------------------------------- // wxDynamicClassInfo // ---------------------------------------------------------------------------- // this object leads to having a pure runtime-instantiation class WXDLLIMPEXP_BASE wxDynamicClassInfo : public wxClassInfo { friend class WXDLLIMPEXP_BASE wxDynamicObject; public: wxDynamicClassInfo( const wxChar *_UnitName, const wxChar *_ClassName, const wxClassInfo* superClass ); virtual ~wxDynamicClassInfo(); // constructs a wxDynamicObject with an instance virtual wxObject *AllocateObject() const; // Call the Create method for a class virtual bool Create (wxObject *object, int ParamCount, wxAny *Params) const; // get number of parameters for constructor virtual int GetCreateParamCount() const; // get i-th constructor parameter virtual const wxChar* GetCreateParamName(int i) const; // Runtime access to objects by property name, and variant data virtual void SetProperty (wxObject *object, const wxChar *PropertyName, const wxAny &Value) const; virtual wxAny GetProperty (wxObject *object, const wxChar *PropertyName) const; // adds a property to this class at runtime void AddProperty( const wxChar *propertyName, const wxTypeInfo* typeInfo ); // removes an existing runtime-property void RemoveProperty( const wxChar *propertyName ); // renames an existing runtime-property void RenameProperty( const wxChar *oldPropertyName, const wxChar *newPropertyName ); // as a handler to this class at runtime void AddHandler( const wxChar *handlerName, wxObjectEventFunction address, const wxClassInfo* eventClassInfo ); // removes an existing runtime-handler void RemoveHandler( const wxChar *handlerName ); // renames an existing runtime-handler void RenameHandler( const wxChar *oldHandlerName, const wxChar *newHandlerName ); private: struct wxDynamicClassInfoInternal; wxDynamicClassInfoInternal* m_data; }; // ---------------------------------------------------------------------------- // wxDECLARE class macros // ---------------------------------------------------------------------------- #define _DECLARE_DYNAMIC_CLASS(name) \ public: \ static wxClassInfo ms_classInfo; \ static const wxClassInfo* ms_classParents[]; \ static wxPropertyInfo* GetPropertiesStatic(); \ static wxHandlerInfo* GetHandlersStatic(); \ static wxClassInfo *GetClassInfoStatic() \ { return &name::ms_classInfo; } \ virtual wxClassInfo *GetClassInfo() const \ { return &name::ms_classInfo; } #define wxDECLARE_DYNAMIC_CLASS(name) \ static wxObjectAllocatorAndCreator* ms_constructor; \ static const wxChar * ms_constructorProperties[]; \ static const int ms_constructorPropertiesCount; \ _DECLARE_DYNAMIC_CLASS(name) #define wxDECLARE_DYNAMIC_CLASS_NO_ASSIGN(name) \ wxDECLARE_NO_ASSIGN_CLASS(name); \ wxDECLARE_DYNAMIC_CLASS(name) #define wxDECLARE_DYNAMIC_CLASS_NO_COPY(name) \ wxDECLARE_NO_COPY_CLASS(name); \ wxDECLARE_DYNAMIC_CLASS(name) #define wxDECLARE_CLASS(name) \ wxDECLARE_DYNAMIC_CLASS(name) #define wxDECLARE_ABSTRACT_CLASS(name) _DECLARE_DYNAMIC_CLASS(name) #define wxCLASSINFO(name) (&name::ms_classInfo) #endif // wxUSE_EXTENDED_RTTI #endif // _WX_XTIH__
h
rticonnextdds-usecases
data/projects/rticonnextdds-usecases/VehicleTracking/ExampleCode/thirdparty/wxWidgets-3.1.2/Win64/include/wx/effects.h
///////////////////////////////////////////////////////////////////////////// // Name: wx/effects.h // Purpose: wxEffects class // Draws 3D effects. // Author: Julian Smart et al // Modified by: // Created: 25/4/2000 // Copyright: (c) Julian Smart // Licence: wxWindows licence ///////////////////////////////////////////////////////////////////////////// #ifndef _WX_EFFECTS_H_ #define _WX_EFFECTS_H_ // this class is deprecated and will be removed in the next wx version // // please use wxRenderer::DrawBorder() instead of DrawSunkenEdge(); there is no // replacement for TileBitmap() but it doesn't seem to be very useful anyhow #if WXWIN_COMPATIBILITY_2_8 /* * wxEffects: various 3D effects */ #include "wx/object.h" #include "wx/colour.h" #include "wx/gdicmn.h" #include "wx/dc.h" class WXDLLIMPEXP_CORE wxEffectsImpl: public wxObject { public: // Assume system colours wxEffectsImpl() ; // Going from lightest to darkest wxEffectsImpl(const wxColour& highlightColour, const wxColour& lightShadow, const wxColour& faceColour, const wxColour& mediumShadow, const wxColour& darkShadow) ; // Accessors wxColour GetHighlightColour() const { return m_highlightColour; } wxColour GetLightShadow() const { return m_lightShadow; } wxColour GetFaceColour() const { return m_faceColour; } wxColour GetMediumShadow() const { return m_mediumShadow; } wxColour GetDarkShadow() const { return m_darkShadow; } void SetHighlightColour(const wxColour& c) { m_highlightColour = c; } void SetLightShadow(const wxColour& c) { m_lightShadow = c; } void SetFaceColour(const wxColour& c) { m_faceColour = c; } void SetMediumShadow(const wxColour& c) { m_mediumShadow = c; } void SetDarkShadow(const wxColour& c) { m_darkShadow = c; } void Set(const wxColour& highlightColour, const wxColour& lightShadow, const wxColour& faceColour, const wxColour& mediumShadow, const wxColour& darkShadow) { SetHighlightColour(highlightColour); SetLightShadow(lightShadow); SetFaceColour(faceColour); SetMediumShadow(mediumShadow); SetDarkShadow(darkShadow); } // Draw a sunken edge void DrawSunkenEdge(wxDC& dc, const wxRect& rect, int borderSize = 1); // Tile a bitmap bool TileBitmap(const wxRect& rect, wxDC& dc, const wxBitmap& bitmap); protected: wxColour m_highlightColour; // Usually white wxColour m_lightShadow; // Usually light grey wxColour m_faceColour; // Usually grey wxColour m_mediumShadow; // Usually dark grey wxColour m_darkShadow; // Usually black wxDECLARE_CLASS(wxEffectsImpl); }; // current versions of g++ don't generate deprecation warnings for classes // declared deprecated, so define wxEffects as a typedef instead: this does // generate warnings with both g++ and VC (which also has no troubles with // directly deprecating the classes...) // // note that this g++ bug (16370) is supposed to be fixed in g++ 4.3.0 typedef wxEffectsImpl wxDEPRECATED(wxEffects); #endif // WXWIN_COMPATIBILITY_2_8 #endif // _WX_EFFECTS_H_
h
rticonnextdds-usecases
data/projects/rticonnextdds-usecases/VehicleTracking/ExampleCode/thirdparty/wxWidgets-3.1.2/Win64/include/wx/recguard.h
/////////////////////////////////////////////////////////////////////////////// // Name: wx/recguard.h // Purpose: declaration and implementation of wxRecursionGuard class // Author: Vadim Zeitlin // Modified by: // Created: 14.08.2003 // Copyright: (c) 2003 Vadim Zeitlin <[email protected]> // Licence: wxWindows licence /////////////////////////////////////////////////////////////////////////////// #ifndef _WX_RECGUARD_H_ #define _WX_RECGUARD_H_ #include "wx/defs.h" // ---------------------------------------------------------------------------- // wxRecursionGuardFlag is used with wxRecursionGuard // ---------------------------------------------------------------------------- typedef int wxRecursionGuardFlag; // ---------------------------------------------------------------------------- // wxRecursionGuard is the simplest way to protect a function from reentrancy // ---------------------------------------------------------------------------- class WXDLLIMPEXP_BASE wxRecursionGuard { public: wxRecursionGuard(wxRecursionGuardFlag& flag) : m_flag(flag) { m_isInside = flag++ != 0; } ~wxRecursionGuard() { wxASSERT_MSG( m_flag > 0, wxT("unbalanced wxRecursionGuards!?") ); m_flag--; } bool IsInside() const { return m_isInside; } private: wxRecursionGuardFlag& m_flag; // true if the flag had been already set when we were created bool m_isInside; }; #endif // _WX_RECGUARD_H_
h
rticonnextdds-usecases
data/projects/rticonnextdds-usecases/VehicleTracking/ExampleCode/thirdparty/wxWidgets-3.1.2/Win64/include/wx/itemid.h
/////////////////////////////////////////////////////////////////////////////// // Name: wx/itemid.h // Purpose: wxItemId class declaration. // Author: Vadim Zeitlin // Created: 2011-08-17 // Copyright: (c) 2011 Vadim Zeitlin <[email protected]> // Licence: wxWindows licence /////////////////////////////////////////////////////////////////////////////// #ifndef _WX_ITEMID_H_ #define _WX_ITEMID_H_ // ---------------------------------------------------------------------------- // wxItemId: an opaque item identifier used with wx{Tree,TreeList,DataView}Ctrl. // ---------------------------------------------------------------------------- // The template argument T is typically a pointer to some opaque type. While // wxTreeItemId and wxDataViewItem use a pointer to void, this is dangerous and // not recommended for the new item id classes. template <typename T> class wxItemId { public: typedef T Type; // This ctor is implicit which is fine for non-void* types, but if you use // this class with void* you're strongly advised to make the derived class // ctor explicit as implicitly converting from any pointer is simply too // dangerous. wxItemId(Type item = NULL) : m_pItem(item) { } // Default copy ctor, assignment operator and dtor are ok. bool IsOk() const { return m_pItem != NULL; } Type GetID() const { return m_pItem; } operator const Type() const { return m_pItem; } // This is used for implementation purposes only. Type operator->() const { return m_pItem; } void Unset() { m_pItem = NULL; } // This field is public *only* for compatibility with the old wxTreeItemId // implementation and must not be used in any new code. //private: Type m_pItem; }; template <typename T> bool operator==(const wxItemId<T>& left, const wxItemId<T>& right) { return left.GetID() == right.GetID(); } template <typename T> bool operator!=(const wxItemId<T>& left, const wxItemId<T>& right) { return !(left == right); } #endif // _WX_ITEMID_H_
h
rticonnextdds-usecases
data/projects/rticonnextdds-usecases/VehicleTracking/ExampleCode/thirdparty/wxWidgets-3.1.2/Win64/include/wx/grid.h
///////////////////////////////////////////////////////////////////////////// // Name: wx/grid.h // Purpose: wxGrid base header // Author: Julian Smart // Modified by: // Created: // Copyright: (c) Julian Smart // Licence: wxWindows licence ///////////////////////////////////////////////////////////////////////////// #ifndef _WX_GRID_H_BASE_ #define _WX_GRID_H_BASE_ #include "wx/generic/grid.h" // these headers used to be included from the above header but isn't any more, // still do it from here for compatibility #include "wx/generic/grideditors.h" #include "wx/generic/gridctrl.h" #endif // _WX_GRID_H_BASE_
h
rticonnextdds-usecases
data/projects/rticonnextdds-usecases/VehicleTracking/ExampleCode/thirdparty/wxWidgets-3.1.2/Win64/include/wx/colourdata.h
///////////////////////////////////////////////////////////////////////////// // Name: wx/colourdata.h // Author: Julian Smart // Copyright: (c) Julian Smart // Licence: wxWindows licence ///////////////////////////////////////////////////////////////////////////// #ifndef _WX_COLOURDATA_H_ #define _WX_COLOURDATA_H_ #include "wx/colour.h" class WXDLLIMPEXP_CORE wxColourData : public wxObject { public: // number of custom colours we store enum { NUM_CUSTOM = 16 }; wxColourData(); wxColourData(const wxColourData& data); wxColourData& operator=(const wxColourData& data); virtual ~wxColourData(); void SetChooseFull(bool flag) { m_chooseFull = flag; } bool GetChooseFull() const { return m_chooseFull; } void SetChooseAlpha(bool flag) { m_chooseAlpha = flag; } bool GetChooseAlpha() const { return m_chooseAlpha; } void SetColour(const wxColour& colour) { m_dataColour = colour; } const wxColour& GetColour() const { return m_dataColour; } wxColour& GetColour() { return m_dataColour; } // SetCustomColour() modifies colours in an internal array of NUM_CUSTOM // custom colours; void SetCustomColour(int i, const wxColour& colour); wxColour GetCustomColour(int i) const; // Serialize the object to a string and restore it from it wxString ToString() const; bool FromString(const wxString& str); // public for backwards compatibility only: don't use directly wxColour m_dataColour; wxColour m_custColours[NUM_CUSTOM]; bool m_chooseFull; protected: bool m_chooseAlpha; wxDECLARE_DYNAMIC_CLASS(wxColourData); }; #endif // _WX_COLOURDATA_H_
h
rticonnextdds-usecases
data/projects/rticonnextdds-usecases/VehicleTracking/ExampleCode/thirdparty/wxWidgets-3.1.2/Win64/include/wx/stackwalk.h
/////////////////////////////////////////////////////////////////////////////// // Name: wx/stackwalk.h // Purpose: wxStackWalker and related classes, common part // Author: Vadim Zeitlin // Modified by: // Created: 2005-01-07 // Copyright: (c) 2004 Vadim Zeitlin <[email protected]> // Licence: wxWindows licence /////////////////////////////////////////////////////////////////////////////// #ifndef _WX_STACKWALK_H_ #define _WX_STACKWALK_H_ #include "wx/defs.h" #if wxUSE_STACKWALKER #include "wx/string.h" class WXDLLIMPEXP_FWD_BASE wxStackFrame; #define wxSTACKWALKER_MAX_DEPTH (200) // ---------------------------------------------------------------------------- // wxStackFrame: a single stack level // ---------------------------------------------------------------------------- class WXDLLIMPEXP_BASE wxStackFrameBase { private: // put this inline function here so that it is defined before use wxStackFrameBase *ConstCast() const { return const_cast<wxStackFrameBase *>(this); } public: wxStackFrameBase(size_t level, void *address = NULL) { m_level = level; m_line = m_offset = 0; m_address = address; } // get the level of this frame (deepest/innermost one is 0) size_t GetLevel() const { return m_level; } // return the address of this frame void *GetAddress() const { return m_address; } // return the unmangled (if possible) name of the function containing this // frame wxString GetName() const { ConstCast()->OnGetName(); return m_name; } // return the instruction pointer offset from the start of the function size_t GetOffset() const { ConstCast()->OnGetName(); return m_offset; } // get the module this function belongs to (not always available) wxString GetModule() const { ConstCast()->OnGetName(); return m_module; } // return true if we have the filename and line number for this frame bool HasSourceLocation() const { return !GetFileName().empty(); } // return the name of the file containing this frame, empty if // unavailable (typically because debug info is missing) wxString GetFileName() const { ConstCast()->OnGetLocation(); return m_filename; } // return the line number of this frame, 0 if unavailable size_t GetLine() const { ConstCast()->OnGetLocation(); return m_line; } // return the number of parameters of this function (may return 0 if we // can't retrieve the parameters info even although the function does have // parameters) virtual size_t GetParamCount() const { return 0; } // get the name, type and value (in text form) of the given parameter // // any pointer may be NULL // // return true if at least some values could be retrieved virtual bool GetParam(size_t WXUNUSED(n), wxString * WXUNUSED(type), wxString * WXUNUSED(name), wxString * WXUNUSED(value)) const { return false; } // although this class is not supposed to be used polymorphically, give it // a virtual dtor to silence compiler warnings virtual ~wxStackFrameBase() { } protected: // hooks for derived classes to initialize some fields on demand virtual void OnGetName() { } virtual void OnGetLocation() { } // fields are protected, not private, so that OnGetXXX() could modify them // directly size_t m_level; wxString m_name, m_module, m_filename; size_t m_line; void *m_address; size_t m_offset; }; // ---------------------------------------------------------------------------- // wxStackWalker: class for enumerating stack frames // ---------------------------------------------------------------------------- class WXDLLIMPEXP_BASE wxStackWalkerBase { public: // ctor does nothing, use Walk() to walk the stack wxStackWalkerBase() { } // dtor does nothing neither but should be virtual virtual ~wxStackWalkerBase() { } // enumerate stack frames from the current location, skipping the initial // number of them (this can be useful when Walk() is called from some known // location and you don't want to see the first few frames anyhow; also // notice that Walk() frame itself is not included if skip >= 1) virtual void Walk(size_t skip = 1, size_t maxDepth = wxSTACKWALKER_MAX_DEPTH) = 0; #if wxUSE_ON_FATAL_EXCEPTION // enumerate stack frames from the location of uncaught exception // // this version can only be called from wxApp::OnFatalException() virtual void WalkFromException(size_t maxDepth = wxSTACKWALKER_MAX_DEPTH) = 0; #endif // wxUSE_ON_FATAL_EXCEPTION protected: // this function must be overrided to process the given frame virtual void OnStackFrame(const wxStackFrame& frame) = 0; }; #ifdef __WINDOWS__ #include "wx/msw/stackwalk.h" #elif defined(__UNIX__) #include "wx/unix/stackwalk.h" #else #error "wxStackWalker is not supported, set wxUSE_STACKWALKER to 0" #endif #endif // wxUSE_STACKWALKER #endif // _WX_STACKWALK_H_
h