repo_name
stringclasses
10 values
file_path
stringlengths
29
222
content
stringlengths
24
926k
extention
stringclasses
5 values
rticonnextdds-usecases
data/projects/rticonnextdds-usecases/VehicleTracking/ExampleCode/thirdparty/wxWidgets-3.1.2/Linux/include/wx/base64.h
/////////////////////////////////////////////////////////////////////////////// // Name: wx/base64.h // Purpose: declaration of BASE64 encoding/decoding functionality // Author: Charles Reimers, Vadim Zeitlin // Created: 2007-06-18 // Licence: wxWindows licence /////////////////////////////////////////////////////////////////////////////// #ifndef _WX_BASE64_H_ #define _WX_BASE64_H_ #include "wx/defs.h" #if wxUSE_BASE64 #include "wx/string.h" #include "wx/buffer.h" // ---------------------------------------------------------------------------- // encoding functions // ---------------------------------------------------------------------------- // return the size needed for the buffer containing the encoded representation // of a buffer of given length inline size_t wxBase64EncodedSize(size_t len) { return 4*((len+2)/3); } // raw base64 encoding function which encodes the contents of a buffer of the // specified length into the buffer of the specified size // // returns the length of the encoded data or wxCONV_FAILED if the buffer is not // large enough; to determine the needed size you can either allocate a buffer // of wxBase64EncodedSize(srcLen) size or call the function with NULL buffer in // which case the required size will be returned WXDLLIMPEXP_BASE size_t wxBase64Encode(char *dst, size_t dstLen, const void *src, size_t srcLen); // encode the contents of the given buffer using base64 and return as string // (there is no error return) inline wxString wxBase64Encode(const void *src, size_t srcLen) { const size_t dstLen = wxBase64EncodedSize(srcLen); wxCharBuffer dst(dstLen); wxBase64Encode(dst.data(), dstLen, src, srcLen); return dst; } inline wxString wxBase64Encode(const wxMemoryBuffer& buf) { return wxBase64Encode(buf.GetData(), buf.GetDataLen()); } // ---------------------------------------------------------------------------- // decoding functions // ---------------------------------------------------------------------------- // elements of this enum specify the possible behaviours of wxBase64Decode() // when an invalid character is encountered enum wxBase64DecodeMode { // normal behaviour: stop at any invalid characters wxBase64DecodeMode_Strict, // skip whitespace characters wxBase64DecodeMode_SkipWS, // the most lenient behaviour: simply ignore all invalid characters wxBase64DecodeMode_Relaxed }; // return the buffer size necessary for decoding a base64 string of the given // length inline size_t wxBase64DecodedSize(size_t srcLen) { return 3*srcLen/4; } // raw decoding function which decodes the contents of the string of specified // length (or NUL-terminated by default) into the provided buffer of the given // size // // the function normally stops at any character invalid inside a base64-encoded // string (i.e. not alphanumeric nor '+' nor '/') but can be made to skip the // whitespace or all invalid characters using its mode argument // // returns the length of the decoded data or wxCONV_FAILED if an error occurs // such as the buffer is too small or the encoded string is invalid; in the // latter case the posErr is filled with the position where the decoding // stopped if it is not NULL WXDLLIMPEXP_BASE size_t wxBase64Decode(void *dst, size_t dstLen, const char *src, size_t srcLen = wxNO_LEN, wxBase64DecodeMode mode = wxBase64DecodeMode_Strict, size_t *posErr = NULL); inline size_t wxBase64Decode(void *dst, size_t dstLen, const wxString& src, wxBase64DecodeMode mode = wxBase64DecodeMode_Strict, size_t *posErr = NULL) { // don't use str.length() here as the ASCII buffer is shorter than it for // strings with embedded NULs return wxBase64Decode(dst, dstLen, src.ToAscii(), wxNO_LEN, mode, posErr); } // decode the contents of the given string; the returned buffer is empty if an // error occurs during decoding WXDLLIMPEXP_BASE wxMemoryBuffer wxBase64Decode(const char *src, size_t srcLen = wxNO_LEN, wxBase64DecodeMode mode = wxBase64DecodeMode_Strict, size_t *posErr = NULL); inline wxMemoryBuffer wxBase64Decode(const wxString& src, wxBase64DecodeMode mode = wxBase64DecodeMode_Strict, size_t *posErr = NULL) { // don't use str.length() here as the ASCII buffer is shorter than it for // strings with embedded NULs return wxBase64Decode(src.ToAscii(), wxNO_LEN, mode, posErr); } #endif // wxUSE_BASE64 #endif // _WX_BASE64_H_
h
rticonnextdds-usecases
data/projects/rticonnextdds-usecases/VehicleTracking/ExampleCode/thirdparty/wxWidgets-3.1.2/Linux/include/wx/combo.h
/////////////////////////////////////////////////////////////////////////////// // Name: wx/combo.h // Purpose: wxComboCtrl declaration // Author: Jaakko Salli // Modified by: // Created: Apr-30-2006 // Copyright: (c) Jaakko Salli // Licence: wxWindows licence /////////////////////////////////////////////////////////////////////////////// #ifndef _WX_COMBOCONTROL_H_BASE_ #define _WX_COMBOCONTROL_H_BASE_ /* A few words about all the classes defined in this file are probably in order: why do we need extra wxComboCtrl and wxComboPopup classes? This is because a traditional combobox is a combination of a text control (with a button allowing to open the pop down list) with a listbox and wxComboBox class is exactly such control, however we want to also have other combinations - in fact, we want to allow anything at all to be used as pop down list, not just a wxListBox. So we define a base wxComboCtrl which can use any control as pop down list and wxComboBox deriving from it which implements the standard wxWidgets combobox API. wxComboCtrl needs to be told somehow which control to use and this is done by SetPopupControl(). However, we need something more than just a wxControl in this method as, for example, we need to call SetSelection("initial text value") and wxControl doesn't have such method. So we also need a wxComboPopup which is just a very simple interface which must be implemented by a control to be usable as a popup. We couldn't derive wxComboPopup from wxControl as this would make it impossible to have a class deriving from both wxListBx and from it, so instead it is just a mix-in. */ #include "wx/defs.h" #if wxUSE_COMBOCTRL #include "wx/control.h" #include "wx/renderer.h" // this is needed for wxCONTROL_XXX flags #include "wx/bitmap.h" // wxBitmap used by-value #include "wx/textentry.h" #include "wx/time.h" // needed for wxMilliClock_t class WXDLLIMPEXP_FWD_CORE wxTextCtrl; class WXDLLIMPEXP_FWD_CORE wxComboPopup; // // New window styles for wxComboCtrlBase // enum { // Double-clicking a read-only combo triggers call to popup's OnComboPopup. // In wxOwnerDrawnComboBox, for instance, it cycles item. wxCC_SPECIAL_DCLICK = 0x0100, // Dropbutton acts like standard push button. wxCC_STD_BUTTON = 0x0200 }; // wxComboCtrl internal flags enum { // First those that can be passed to Customize. // It is Windows style for all flags to be clear. // Button is preferred outside the border (GTK style) wxCC_BUTTON_OUTSIDE_BORDER = 0x0001, // Show popup on mouse up instead of mouse down (which is the Windows style) wxCC_POPUP_ON_MOUSE_UP = 0x0002, // All text is not automatically selected on click wxCC_NO_TEXT_AUTO_SELECT = 0x0004, // Drop-button stays down as long as popup is displayed. wxCC_BUTTON_STAYS_DOWN = 0x0008, // Drop-button covers the entire control. wxCC_FULL_BUTTON = 0x0010, // Drop-button goes over the custom-border (used under WinVista). wxCC_BUTTON_COVERS_BORDER = 0x0020, // Internal use: signals creation is complete wxCC_IFLAG_CREATED = 0x0100, // Internal use: really put button outside wxCC_IFLAG_BUTTON_OUTSIDE = 0x0200, // Internal use: SetMargins has been successfully called wxCC_IFLAG_LEFT_MARGIN_SET = 0x0400, // Internal use: Set wxTAB_TRAVERSAL to parent when popup is dismissed wxCC_IFLAG_PARENT_TAB_TRAVERSAL = 0x0800, // Internal use: Secondary popup window type should be used (if available). wxCC_IFLAG_USE_ALT_POPUP = 0x1000, // Internal use: Skip popup animation. wxCC_IFLAG_DISABLE_POPUP_ANIM = 0x2000, // Internal use: Drop-button is a bitmap button or has non-default size // (but can still be on either side of the control), regardless whether // specified by the platform or the application. wxCC_IFLAG_HAS_NONSTANDARD_BUTTON = 0x4000 }; // Flags used by PreprocessMouseEvent and HandleButtonMouseEvent enum { wxCC_MF_ON_BUTTON = 0x0001, // cursor is on dropbutton area wxCC_MF_ON_CLICK_AREA = 0x0002 // cursor is on dropbutton or other area // that can be clicked to show the popup. }; // Namespace for wxComboCtrl feature flags struct wxComboCtrlFeatures { enum { MovableButton = 0x0001, // Button can be on either side of control BitmapButton = 0x0002, // Button may be replaced with bitmap ButtonSpacing = 0x0004, // Button can have spacing from the edge // of the control TextIndent = 0x0008, // SetMargins can be used to control // left margin. PaintControl = 0x0010, // Combo control itself can be custom painted PaintWritable = 0x0020, // A variable-width area in front of writable // combo control's textctrl can be custom // painted Borderless = 0x0040, // wxNO_BORDER window style works // There are no feature flags for... // PushButtonBitmapBackground - if its in wxRendererNative, then it should be // not an issue to have it automatically under the bitmap. All = MovableButton|BitmapButton| ButtonSpacing|TextIndent| PaintControl|PaintWritable| Borderless }; }; class WXDLLIMPEXP_CORE wxComboCtrlBase : public wxControl, public wxTextEntry { friend class wxComboPopup; friend class wxComboPopupEvtHandler; public: // ctors and such wxComboCtrlBase() : wxControl(), wxTextEntry() { Init(); } bool Create(wxWindow *parent, wxWindowID id, const wxString& value, const wxPoint& pos, const wxSize& size, long style, const wxValidator& validator, const wxString& name); virtual ~wxComboCtrlBase(); // Show/hide popup window (wxComboBox-compatible methods) virtual void Popup(); virtual void Dismiss() { HidePopup(true); } // Show/hide popup window. // TODO: Maybe deprecate in favor of Popup()/Dismiss(). // However, these functions are still called internally // so it is not straightforward. virtual void ShowPopup(); virtual void HidePopup(bool generateEvent=false); // Override for totally custom combo action virtual void OnButtonClick(); // return true if the popup is currently shown bool IsPopupShown() const { return m_popupWinState == Visible; } // set interface class instance derived from wxComboPopup // NULL popup can be used to indicate default in a derived class void SetPopupControl( wxComboPopup* popup ) { DoSetPopupControl(popup); } // get interface class instance derived from wxComboPopup wxComboPopup* GetPopupControl() { EnsurePopupControl(); return m_popupInterface; } // get the popup window containing the popup control wxWindow *GetPopupWindow() const { return m_winPopup; } // Get the text control which is part of the combobox. wxTextCtrl *GetTextCtrl() const { return m_text; } // get the dropdown button which is part of the combobox // note: its not necessarily a wxButton or wxBitmapButton wxWindow *GetButton() const { return m_btn; } // forward these methods to all subcontrols virtual bool Enable(bool enable = true) wxOVERRIDE; virtual bool Show(bool show = true) wxOVERRIDE; virtual bool SetFont(const wxFont& font) wxOVERRIDE; // // wxTextEntry methods // // NB: We basically need to override all of them because there is // no guarantee how platform-specific wxTextEntry is implemented. // virtual void SetValue(const wxString& value) wxOVERRIDE { wxTextEntryBase::SetValue(value); } virtual void ChangeValue(const wxString& value) wxOVERRIDE { wxTextEntryBase::ChangeValue(value); } virtual void WriteText(const wxString& text) wxOVERRIDE; virtual void AppendText(const wxString& text) wxOVERRIDE { wxTextEntryBase::AppendText(text); } virtual wxString GetValue() const wxOVERRIDE { return wxTextEntryBase::GetValue(); } virtual wxString GetRange(long from, long to) const wxOVERRIDE { return wxTextEntryBase::GetRange(from, to); } // Replace() and DoSetValue() need to be fully re-implemented since // EventSuppressor utility class does not work with the way // wxComboCtrl is implemented. virtual void Replace(long from, long to, const wxString& value) wxOVERRIDE; virtual void Remove(long from, long to) wxOVERRIDE; virtual void Copy() wxOVERRIDE; virtual void Cut() wxOVERRIDE; virtual void Paste() wxOVERRIDE; virtual void Undo() wxOVERRIDE; virtual void Redo() wxOVERRIDE; virtual bool CanUndo() const wxOVERRIDE; virtual bool CanRedo() const wxOVERRIDE; virtual void SetInsertionPoint(long pos) wxOVERRIDE; virtual long GetInsertionPoint() const wxOVERRIDE; virtual long GetLastPosition() const wxOVERRIDE; virtual void SetSelection(long from, long to) wxOVERRIDE; virtual void GetSelection(long *from, long *to) const wxOVERRIDE; virtual bool IsEditable() const wxOVERRIDE; virtual void SetEditable(bool editable) wxOVERRIDE; virtual bool SetHint(const wxString& hint) wxOVERRIDE; virtual wxString GetHint() const wxOVERRIDE; // This method sets the text without affecting list selection // (ie. wxComboPopup::SetStringValue doesn't get called). void SetText(const wxString& value); // This method sets value and also optionally sends EVT_TEXT // (needed by combo popups) wxDEPRECATED( void SetValueWithEvent(const wxString& value, bool withEvent = true) ); // Changes value of the control as if user had done it by selecting an // item from a combo box drop-down list. Needs to be public so that // derived popup classes can call it. void SetValueByUser(const wxString& value); // // Popup customization methods // // Sets minimum width of the popup. If wider than combo control, it will extend to the left. // Remarks: // * Value -1 indicates the default. // * Custom popup may choose to ignore this (wxOwnerDrawnComboBox does not). void SetPopupMinWidth( int width ) { m_widthMinPopup = width; } // Sets preferred maximum height of the popup. // Remarks: // * Value -1 indicates the default. // * Custom popup may choose to ignore this (wxOwnerDrawnComboBox does not). void SetPopupMaxHeight( int height ) { m_heightPopup = height; } // Extends popup size horizontally, relative to the edges of the combo control. // Remarks: // * Popup minimum width may override extLeft (ie. it has higher precedence). // * Values 0 indicate default. // * Custom popup may not take this fully into account (wxOwnerDrawnComboBox takes). void SetPopupExtents( int extLeft, int extRight ) { m_extLeft = extLeft; m_extRight = extRight; } // Set width, in pixels, of custom paint area in writable combo. // In read-only, used to indicate area that is not covered by the // focus rectangle (which may or may not be drawn, depending on the // popup type). void SetCustomPaintWidth( int width ); int GetCustomPaintWidth() const { return m_widthCustomPaint; } // Set side of the control to which the popup will align itself. // Valid values are wxLEFT, wxRIGHT and 0. The default value 0 wmeans // that the side of the button will be used. void SetPopupAnchor( int anchorSide ) { m_anchorSide = anchorSide; } // Set position of dropdown button. // width: button width. <= 0 for default. // height: button height. <= 0 for default. // side: wxLEFT or wxRIGHT, indicates on which side the button will be placed. // spacingX: empty space on sides of the button. Default is 0. // Remarks: // There is no spacingY - the button will be centred vertically. void SetButtonPosition( int width = -1, int height = -1, int side = wxRIGHT, int spacingX = 0 ); // Returns current size of the dropdown button. wxSize GetButtonSize(); // // Sets dropbutton to be drawn with custom bitmaps. // // bmpNormal: drawn when cursor is not on button // pushButtonBg: Draw push button background below the image. // NOTE! This is usually only properly supported on platforms with appropriate // method in wxRendererNative. // bmpPressed: drawn when button is depressed // bmpHover: drawn when cursor hovers on button. This is ignored on platforms // that do not generally display hover differently. // bmpDisabled: drawn when combobox is disabled. void SetButtonBitmaps( const wxBitmap& bmpNormal, bool pushButtonBg = false, const wxBitmap& bmpPressed = wxNullBitmap, const wxBitmap& bmpHover = wxNullBitmap, const wxBitmap& bmpDisabled = wxNullBitmap ); #if WXWIN_COMPATIBILITY_2_8 // // This will set the space in pixels between left edge of the control and the // text, regardless whether control is read-only (ie. no wxTextCtrl) or not. // Platform-specific default can be set with value-1. // Remarks // * This method may do nothing on some native implementations. wxDEPRECATED( void SetTextIndent( int indent ) ); // Returns actual indentation in pixels. wxDEPRECATED( wxCoord GetTextIndent() const ); #endif // Returns area covered by the text field. const wxRect& GetTextRect() const { return m_tcArea; } // Call with enable as true to use a type of popup window that guarantees ability // to focus the popup control, and normal function of common native controls. // This alternative popup window is usually a wxDialog, and as such it's parent // frame will appear as if the focus has been lost from it. void UseAltPopupWindow( bool enable = true ) { wxASSERT_MSG( !m_winPopup, wxT("call this only before SetPopupControl") ); if ( enable ) m_iFlags |= wxCC_IFLAG_USE_ALT_POPUP; else m_iFlags &= ~wxCC_IFLAG_USE_ALT_POPUP; } // Call with false to disable popup animation, if any. void EnablePopupAnimation( bool enable = true ) { if ( enable ) m_iFlags &= ~wxCC_IFLAG_DISABLE_POPUP_ANIM; else m_iFlags |= wxCC_IFLAG_DISABLE_POPUP_ANIM; } // // Utilities needed by the popups or native implementations // // Returns true if given key combination should toggle the popup. // NB: This is a separate from other keyboard handling because: // 1) Replaceability. // 2) Centralized code (otherwise it'd be split up between // wxComboCtrl key handler and wxVListBoxComboPopup's // key handler). virtual bool IsKeyPopupToggle(const wxKeyEvent& event) const = 0; // Prepare background of combo control or an item in a dropdown list // in a way typical on platform. This includes painting the focus/disabled // background and setting the clipping region. // Unless you plan to paint your own focus indicator, you should always call this // in your wxComboPopup::PaintComboControl implementation. // In addition, it sets pen and text colour to what looks good and proper // against the background. // flags: wxRendererNative flags: wxCONTROL_ISSUBMENU: is drawing a list item instead of combo control // wxCONTROL_SELECTED: list item is selected // wxCONTROL_DISABLED: control/item is disabled virtual void PrepareBackground( wxDC& dc, const wxRect& rect, int flags ) const; // Returns true if focus indicator should be drawn in the control. bool ShouldDrawFocus() const { const wxWindow* curFocus = FindFocus(); return ( IsPopupWindowState(Hidden) && (curFocus == m_mainCtrlWnd || (m_btn && curFocus == m_btn)) && (m_windowStyle & wxCB_READONLY) ); } // These methods return references to appropriate dropbutton bitmaps const wxBitmap& GetBitmapNormal() const { return m_bmpNormal; } const wxBitmap& GetBitmapPressed() const { return m_bmpPressed; } const wxBitmap& GetBitmapHover() const { return m_bmpHover; } const wxBitmap& GetBitmapDisabled() const { return m_bmpDisabled; } // Set custom style flags for embedded wxTextCtrl. Usually must be used // with two-step creation, before Create() call. void SetTextCtrlStyle( int style ); // Return internal flags wxUint32 GetInternalFlags() const { return m_iFlags; } // Return true if Create has finished bool IsCreated() const { return m_iFlags & wxCC_IFLAG_CREATED ? true : false; } // Need to override to return text area background colour wxColour GetBackgroundColour() const; // common code to be called on popup hide/dismiss void OnPopupDismiss(bool generateEvent); // PopupShown states enum { Hidden = 0, Closing = 1, Animating = 2, Visible = 3 }; bool IsPopupWindowState( int state ) const { return (state == m_popupWinState) ? true : false; } wxByte GetPopupWindowState() const { return m_popupWinState; } // Set value returned by GetMainWindowOfCompositeControl void SetCtrlMainWnd( wxWindow* wnd ) { m_mainCtrlWnd = wnd; } // This is public so we can access it from wxComboCtrlTextCtrl virtual wxWindow *GetMainWindowOfCompositeControl() wxOVERRIDE { return m_mainCtrlWnd; } // also set the embedded wxTextCtrl colours virtual bool SetForegroundColour(const wxColour& colour) wxOVERRIDE; virtual bool SetBackgroundColour(const wxColour& colour) wxOVERRIDE; protected: // Returns true if hint text should be drawn in the control bool ShouldUseHintText(int flags = 0) const { return ( !m_text && !(flags & wxCONTROL_ISSUBMENU) && !m_valueString.length() && m_hintText.length() && !ShouldDrawFocus() ); } // // Override these for customization purposes // // called from wxSizeEvent handler virtual void OnResize() = 0; // Return native text indentation // (i.e. text margin, for pure text, not textctrl) virtual wxCoord GetNativeTextIndent() const; // Called in syscolourchanged handler and base create virtual void OnThemeChange(); // Creates wxTextCtrl. // extraStyle: Extra style parameters void CreateTextCtrl( int extraStyle ); // Called when text was changed programmatically // (e.g. from WriteText()) void OnSetValue(const wxString& value); // Installs standard input handler to combo (and optionally to the textctrl) void InstallInputHandlers(); // Flags for DrawButton enum { Button_PaintBackground = 0x0001, // Paints control background below the button Button_BitmapOnly = 0x0002 // Only paints the bitmap }; // Draws dropbutton. Using wxRenderer or bitmaps, as appropriate. // Flags are defined above. virtual void DrawButton( wxDC& dc, const wxRect& rect, int flags = Button_PaintBackground ); // Call if cursor is on button area or mouse is captured for the button. //bool HandleButtonMouseEvent( wxMouseEvent& event, bool isInside ); bool HandleButtonMouseEvent( wxMouseEvent& event, int flags ); // returns true if event was consumed or filtered (event type is also set to 0 in this case) bool PreprocessMouseEvent( wxMouseEvent& event, int flags ); // // This will handle left_down and left_dclick events outside button in a Windows-like manner. // If you need alternate behaviour, it is recommended you manipulate and filter events to it // instead of building your own handling routine (for reference, on wxEVT_LEFT_DOWN it will // toggle popup and on wxEVT_LEFT_DCLICK it will do the same or run the popup's dclick method, // if defined - you should pass events of other types of it for common processing). void HandleNormalMouseEvent( wxMouseEvent& event ); // Creates popup window, calls interface->Create(), etc void CreatePopup(); // Destroy popup window and all related constructs void DestroyPopup(); // override the base class virtuals involved in geometry calculations // The common version only sets a default width, so the derived classes // should override it and set the height and change the width as needed. virtual wxSize DoGetBestSize() const wxOVERRIDE; virtual wxSize DoGetSizeFromTextSize(int xlen, int ylen = -1) const wxOVERRIDE; // NULL popup can be used to indicate default in a derived class virtual void DoSetPopupControl(wxComboPopup* popup); // ensures there is at least the default popup void EnsurePopupControl(); // Recalculates button and textctrl areas. Called when size or button setup change. // btnWidth: default/calculated width of the dropbutton. 0 means unchanged, // just recalculate. void CalculateAreas( int btnWidth = 0 ); // Standard textctrl positioning routine. Just give it platform-dependent // textctrl coordinate adjustment. virtual void PositionTextCtrl( int textCtrlXAdjust = 0, int textCtrlYAdjust = 0); // event handlers void OnSizeEvent( wxSizeEvent& event ); void OnFocusEvent(wxFocusEvent& event); void OnIdleEvent(wxIdleEvent& event); void OnTextCtrlEvent(wxCommandEvent& event); void OnSysColourChanged(wxSysColourChangedEvent& event); void OnKeyEvent(wxKeyEvent& event); void OnCharEvent(wxKeyEvent& event); // Set customization flags (directs how wxComboCtrlBase helpers behave) void Customize( wxUint32 flags ) { m_iFlags |= flags; } // Dispatches size event and refreshes void RecalcAndRefresh(); // Flags for DoShowPopup and AnimateShow enum { ShowBelow = 0x0000, // Showing popup below the control ShowAbove = 0x0001, // Showing popup above the control CanDeferShow = 0x0002 // Can only return true from AnimateShow if this is set }; // Shows and positions the popup. virtual void DoShowPopup( const wxRect& rect, int flags ); // Implement in derived class to create a drop-down animation. // Return true if finished immediately. Otherwise popup is only // shown when the derived class call DoShowPopup. // Flags are same as for DoShowPopup. virtual bool AnimateShow( const wxRect& rect, int flags ); #if wxUSE_TOOLTIPS virtual void DoSetToolTip( wxToolTip *tip ) wxOVERRIDE; #endif // protected wxTextEntry methods virtual void DoSetValue(const wxString& value, int flags) wxOVERRIDE; virtual wxString DoGetValue() const wxOVERRIDE; virtual wxWindow *GetEditableWindow() wxOVERRIDE { return this; } // margins functions virtual bool DoSetMargins(const wxPoint& pt) wxOVERRIDE; virtual wxPoint DoGetMargins() const wxOVERRIDE; // This is used when m_text is hidden (readonly). wxString m_valueString; // This is used when control is unfocused and m_valueString is empty wxString m_hintText; // the text control and button we show all the time wxTextCtrl* m_text; wxWindow* m_btn; // wxPopupWindow or similar containing the window managed by the interface. wxWindow* m_winPopup; // the popup control/panel wxWindow* m_popup; // popup interface wxComboPopup* m_popupInterface; // this is input etc. handler for the text control wxEvtHandler* m_textEvtHandler; // this is for the top level window wxEvtHandler* m_toplevEvtHandler; // this is for the control in popup wxEvtHandler* m_popupEvtHandler; // this is for the popup window wxEvtHandler* m_popupWinEvtHandler; // main (ie. topmost) window of a composite control (default = this) wxWindow* m_mainCtrlWnd; // used to prevent immediate re-popupping in case closed popup // by clicking on the combo control (needed because of inconsistent // transient implementation across platforms). wxMilliClock_t m_timeCanAcceptClick; // how much popup should expand to the left/right of the control wxCoord m_extLeft; wxCoord m_extRight; // minimum popup width wxCoord m_widthMinPopup; // preferred popup height wxCoord m_heightPopup; // how much of writable combo is custom-paint by callback? // also used to indicate area that is not covered by "blue" // selection indicator. wxCoord m_widthCustomPaint; // left margin, in pixels wxCoord m_marginLeft; // side on which the popup is aligned int m_anchorSide; // Width of the "fake" border wxCoord m_widthCustomBorder; // The button and textctrl click/paint areas wxRect m_tcArea; wxRect m_btnArea; // Colour of the text area, in case m_text is NULL wxColour m_tcBgCol; // current button state (uses renderer flags) int m_btnState; // button position int m_btnWid; int m_btnHei; int m_btnSide; int m_btnSpacingX; // last default button width int m_btnWidDefault; // custom dropbutton bitmaps wxBitmap m_bmpNormal; wxBitmap m_bmpPressed; wxBitmap m_bmpHover; wxBitmap m_bmpDisabled; // area used by the button wxSize m_btnSize; // platform-dependent customization and other flags wxUint32 m_iFlags; // custom style for m_text int m_textCtrlStyle; // draw blank button background under bitmap? bool m_blankButtonBg; // is the popup window currently shown? wxByte m_popupWinState; // should the focus be reset to the textctrl in idle time? bool m_resetFocus; // is the text-area background colour overridden? bool m_hasTcBgCol; private: void Init(); wxByte m_ignoreEvtText; // Number of next EVT_TEXTs to ignore // Is popup window wxPopupTransientWindow, wxPopupWindow or wxDialog? wxByte m_popupWinType; wxDECLARE_EVENT_TABLE(); wxDECLARE_ABSTRACT_CLASS(wxComboCtrlBase); }; // ---------------------------------------------------------------------------- // wxComboPopup is the interface which must be implemented by a control to be // used as a popup by wxComboCtrl // ---------------------------------------------------------------------------- // wxComboPopup internal flags enum { wxCP_IFLAG_CREATED = 0x0001 // Set by wxComboCtrlBase after Create is called }; class WXDLLIMPEXP_FWD_CORE wxComboCtrl; class WXDLLIMPEXP_CORE wxComboPopup { friend class wxComboCtrlBase; public: wxComboPopup() { m_combo = NULL; m_iFlags = 0; } // This is called immediately after construction finishes. m_combo member // variable has been initialized before the call. // NOTE: It is not in constructor so the derived class doesn't need to redefine // a default constructor of its own. virtual void Init() { } virtual ~wxComboPopup(); // Create the popup child control. // Return true for success. virtual bool Create(wxWindow* parent) = 0; // Calls Destroy() for the popup control (i.e. one returned by // GetControl()) and makes sure that 'this' is deleted at the end. // Default implementation works for both cases where popup control // class is multiple inherited or created on heap as a separate // object. virtual void DestroyPopup(); // We must have an associated control which is subclassed by the combobox. virtual wxWindow *GetControl() = 0; // Called immediately after the popup is shown virtual void OnPopup(); // Called when popup is dismissed virtual void OnDismiss(); // Called just prior to displaying popup. // Default implementation does nothing. virtual void SetStringValue( const wxString& value ); // Gets displayed string representation of the value. virtual wxString GetStringValue() const = 0; // Called to check if the popup - when an item container - actually // has matching item. Case-sensitivity checking etc. is up to the // implementation. If the found item matched the string, but is // different, it should be written back to pItem. Default implementation // always return true and does not alter trueItem. virtual bool FindItem(const wxString& item, wxString* trueItem=NULL); // This is called to custom paint in the combo control itself (ie. not the popup). // Default implementation draws value as string. virtual void PaintComboControl( wxDC& dc, const wxRect& rect ); // Receives wxEVT_KEY_DOWN key events from the parent wxComboCtrl. // Events not handled should be skipped, as usual. virtual void OnComboKeyEvent( wxKeyEvent& event ); // Receives wxEVT_CHAR key events from the parent wxComboCtrl. // Events not handled should be skipped, as usual. virtual void OnComboCharEvent( wxKeyEvent& event ); // Implement if you need to support special action when user // double-clicks on the parent wxComboCtrl. virtual void OnComboDoubleClick(); // Return final size of popup. Called on every popup, just prior to OnShow. // minWidth = preferred minimum width for window // prefHeight = preferred height. Only applies if > 0, // maxHeight = max height for window, as limited by screen size // and should only be rounded down, if necessary. virtual wxSize GetAdjustedSize( int minWidth, int prefHeight, int maxHeight ); // Return true if you want delay call to Create until the popup is shown // for the first time. It is more efficient, but note that it is often // more convenient to have the control created immediately. // Default returns false. virtual bool LazyCreate(); // // Utilities // // Hides the popup void Dismiss(); // Returns true if Create has been called. bool IsCreated() const { return (m_iFlags & wxCP_IFLAG_CREATED) ? true : false; } // Returns pointer to the associated parent wxComboCtrl. wxComboCtrl* GetComboCtrl() const; // Default PaintComboControl behaviour static void DefaultPaintComboControl( wxComboCtrlBase* combo, wxDC& dc, const wxRect& rect ); protected: wxComboCtrlBase* m_combo; wxUint32 m_iFlags; private: // Called in wxComboCtrlBase::SetPopupControl void InitBase(wxComboCtrlBase *combo) { m_combo = combo; } }; // ---------------------------------------------------------------------------- // include the platform-dependent header defining the real class // ---------------------------------------------------------------------------- #if defined(__WXUNIVERSAL__) // No native universal (but it must still be first in the list) #elif defined(__WXMSW__) #include "wx/msw/combo.h" #endif // Any ports may need generic as an alternative #include "wx/generic/combo.h" #endif // wxUSE_COMBOCTRL #endif // _WX_COMBOCONTROL_H_BASE_
h
rticonnextdds-usecases
data/projects/rticonnextdds-usecases/VehicleTracking/ExampleCode/thirdparty/wxWidgets-3.1.2/Linux/include/wx/animate.h
///////////////////////////////////////////////////////////////////////////// // Name: wx/animate.h // Purpose: wxAnimation and wxAnimationCtrl // Author: Julian Smart and Guillermo Rodriguez Garcia // Modified by: Francesco Montorsi // Created: 13/8/99 // Copyright: (c) Julian Smart and Guillermo Rodriguez Garcia // Licence: wxWindows licence ///////////////////////////////////////////////////////////////////////////// #ifndef _WX_ANIMATE_H_ #define _WX_ANIMATE_H_ #include "wx/defs.h" #if wxUSE_ANIMATIONCTRL #include "wx/animdecod.h" #include "wx/control.h" #include "wx/timer.h" #include "wx/bitmap.h" class WXDLLIMPEXP_FWD_CORE wxAnimation; extern WXDLLIMPEXP_DATA_CORE(wxAnimation) wxNullAnimation; extern WXDLLIMPEXP_DATA_CORE(const char) wxAnimationCtrlNameStr[]; // ---------------------------------------------------------------------------- // wxAnimationBase // ---------------------------------------------------------------------------- class WXDLLIMPEXP_CORE wxAnimationBase : public wxObject { public: wxAnimationBase() {} virtual bool IsOk() const = 0; // can be -1 virtual int GetDelay(unsigned int frame) const = 0; virtual unsigned int GetFrameCount() const = 0; virtual wxImage GetFrame(unsigned int frame) const = 0; virtual wxSize GetSize() const = 0; virtual bool LoadFile(const wxString& name, wxAnimationType type = wxANIMATION_TYPE_ANY) = 0; virtual bool Load(wxInputStream& stream, wxAnimationType type = wxANIMATION_TYPE_ANY) = 0; protected: wxDECLARE_ABSTRACT_CLASS(wxAnimationBase); }; // ---------------------------------------------------------------------------- // wxAnimationCtrlBase // ---------------------------------------------------------------------------- // do not autoresize to the animation's size when SetAnimation() is called #define wxAC_NO_AUTORESIZE (0x0010) // default style does not include wxAC_NO_AUTORESIZE, that is, the control // auto-resizes by default to fit the new animation when SetAnimation() is called #define wxAC_DEFAULT_STYLE (wxBORDER_NONE) class WXDLLIMPEXP_CORE wxAnimationCtrlBase : public wxControl { public: wxAnimationCtrlBase() { } // public API virtual bool LoadFile(const wxString& filename, wxAnimationType type = wxANIMATION_TYPE_ANY) = 0; virtual bool Load(wxInputStream& stream, wxAnimationType type = wxANIMATION_TYPE_ANY) = 0; virtual void SetAnimation(const wxAnimation &anim) = 0; virtual wxAnimation GetAnimation() const = 0; virtual bool Play() = 0; virtual void Stop() = 0; virtual bool IsPlaying() const = 0; virtual void SetInactiveBitmap(const wxBitmap &bmp); // always return the original bitmap set in this control wxBitmap GetInactiveBitmap() const { return m_bmpStatic; } protected: // the inactive bitmap as it was set by the user wxBitmap m_bmpStatic; // the inactive bitmap currently shown in the control // (may differ in the size from m_bmpStatic) wxBitmap m_bmpStaticReal; // updates m_bmpStaticReal from m_bmpStatic if needed virtual void UpdateStaticImage(); // called by SetInactiveBitmap virtual void DisplayStaticImage() = 0; private: wxDECLARE_ABSTRACT_CLASS(wxAnimationCtrlBase); }; // ---------------------------------------------------------------------------- // include the platform-specific version of the wxAnimationCtrl class // ---------------------------------------------------------------------------- #if defined(__WXGTK20__) && !defined(__WXUNIVERSAL__) #include "wx/gtk/animate.h" #else #include "wx/generic/animate.h" #endif #endif // wxUSE_ANIMATIONCTRL #endif // _WX_ANIMATE_H_
h
rticonnextdds-usecases
data/projects/rticonnextdds-usecases/VehicleTracking/ExampleCode/thirdparty/wxWidgets-3.1.2/Linux/include/wx/types.h
/* * Name: wx/types.h * Purpose: Declarations of common wx types and related constants. * Author: Vadim Zeitlin (extracted from wx/defs.h) * Created: 2018-01-07 * Copyright: (c) 1997-2018 wxWidgets dev team * Licence: wxWindows licence */ /* THIS IS A C FILE, DON'T USE C++ FEATURES (IN PARTICULAR COMMENTS) IN IT */ #ifndef _WX_TYPES_H_ #define _WX_TYPES_H_ /* Don't include wx/defs.h from here as we're included from it, but do include wx/platform.h which will take care of including wx/setup.h too. */ #include "wx/platform.h" /* ---------------------------------------------------------------------------- */ /* standard wxWidgets types */ /* ---------------------------------------------------------------------------- */ /* the type for screen and DC coordinates */ typedef int wxCoord; enum { wxDefaultCoord = -1 }; /* ---------------------------------------------------------------------------- */ /* define fixed length types */ /* ---------------------------------------------------------------------------- */ #if defined(__MINGW32__) #include <sys/types.h> #endif /* chars are always one byte (by definition), shorts are always two (in */ /* practice) */ /* 8bit */ typedef signed char wxInt8; typedef unsigned char wxUint8; typedef wxUint8 wxByte; /* 16bit */ #ifdef SIZEOF_SHORT #if SIZEOF_SHORT != 2 #error "wxWidgets assumes sizeof(short) == 2, please fix the code" #endif #else #define SIZEOF_SHORT 2 #endif typedef signed short wxInt16; typedef unsigned short wxUint16; typedef wxUint16 wxWord; /* things are getting more interesting with ints, longs and pointers there are several different standard data models described by this table: +-----------+----------------------------+ |type\model | LP64 ILP64 LLP64 ILP32 LP32| +-----------+----------------------------+ |char | 8 8 8 8 8 | |short | 16 16 16 16 16 | |int | 32 64 32 32 16 | |long | 64 64 32 32 32 | |long long | 64 64 64 -- -- | |void * | 64 64 64 32 32 | +-----------+----------------------------+ Win16 used LP32 (but we don't support it any longer), Win32 obviously used ILP32 and Win64 uses LLP64 (a.k.a. P64) Under Unix LP64 is the most widely used (the only I've ever seen, in fact) */ /* 32bit */ #if defined(__WINDOWS__) #if defined(__WIN32__) typedef int wxInt32; typedef unsigned int wxUint32; /* Win64 uses LLP64 model and so ints and longs have the same size as in Win32. */ #ifndef SIZEOF_INT #define SIZEOF_INT 4 #endif #ifndef SIZEOF_LONG #define SIZEOF_LONG 4 #endif #ifndef SIZEOF_LONG_LONG #define SIZEOF_LONG_LONG 8 #endif #ifndef SIZEOF_WCHAR_T /* Windows uses UTF-16 */ #define SIZEOF_WCHAR_T 2 #endif #ifndef SIZEOF_SIZE_T /* Under Win64 sizeof(size_t) == 8 and so it is neither unsigned int nor unsigned long! */ #ifdef __WIN64__ #define SIZEOF_SIZE_T 8 #undef wxSIZE_T_IS_UINT #else /* Win32 */ #define SIZEOF_SIZE_T 4 #define wxSIZE_T_IS_UINT #endif #undef wxSIZE_T_IS_ULONG #endif #ifndef SIZEOF_VOID_P #ifdef __WIN64__ #define SIZEOF_VOID_P 8 #else /* Win32 */ #define SIZEOF_VOID_P 4 #endif /* Win64/32 */ #endif #else #error "Unsupported Windows version" #endif #else /* !Windows */ /* SIZEOF_XXX are normally defined by configure */ #ifdef SIZEOF_INT #if SIZEOF_INT == 8 /* must be ILP64 data model, there is normally a special 32 bit */ /* type in it but we don't know what it is... */ #error "No 32bit int type on this platform" #elif SIZEOF_INT == 4 typedef int wxInt32; typedef unsigned int wxUint32; #elif SIZEOF_INT == 2 /* must be LP32 */ #if SIZEOF_LONG != 4 #error "No 32bit int type on this platform" #endif typedef long wxInt32; typedef unsigned long wxUint32; #else /* wxWidgets is not ready for 128bit systems yet... */ #error "Unknown sizeof(int) value, what are you compiling for?" #endif #else /* !defined(SIZEOF_INT) */ /* assume default 32bit machine -- what else can we do? */ wxCOMPILE_TIME_ASSERT( sizeof(int) == 4, IntMustBeExactly4Bytes); wxCOMPILE_TIME_ASSERT( sizeof(size_t) == 4, SizeTMustBeExactly4Bytes); wxCOMPILE_TIME_ASSERT( sizeof(void *) == 4, PtrMustBeExactly4Bytes); #define SIZEOF_INT 4 #define SIZEOF_SIZE_T 4 #define SIZEOF_VOID_P 4 typedef int wxInt32; typedef unsigned int wxUint32; #if defined(__MACH__) && !defined(SIZEOF_WCHAR_T) #define SIZEOF_WCHAR_T 4 #endif #if !defined(SIZEOF_WCHAR_T) /* also assume that sizeof(wchar_t) == 2 (under Unix the most */ /* common case is 4 but there configure would have defined */ /* SIZEOF_WCHAR_T for us) */ /* the most common case */ wxCOMPILE_TIME_ASSERT( sizeof(wchar_t) == 2, Wchar_tMustBeExactly2Bytes); #define SIZEOF_WCHAR_T 2 #endif /* !defined(SIZEOF_WCHAR_T) */ #endif #endif /* Win/!Win */ #ifndef SIZEOF_WCHAR_T #error "SIZEOF_WCHAR_T must be defined, but isn't" #endif /* also define C99-like sized MIN/MAX constants */ #define wxINT8_MIN CHAR_MIN #define wxINT8_MAX CHAR_MAX #define wxUINT8_MAX UCHAR_MAX #define wxINT16_MIN SHRT_MIN #define wxINT16_MAX SHRT_MAX #define wxUINT16_MAX USHRT_MAX #if SIZEOF_INT == 4 #define wxINT32_MIN INT_MIN #define wxINT32_MAX INT_MAX #define wxUINT32_MAX UINT_MAX #elif SIZEOF_LONG == 4 #define wxINT32_MIN LONG_MIN #define wxINT32_MAX LONG_MAX #define wxUINT32_MAX ULONG_MAX #else #error "Unknown 32 bit type" #endif typedef wxUint32 wxDword; #ifdef LLONG_MAX #define wxINT64_MIN LLONG_MIN #define wxINT64_MAX LLONG_MAX #define wxUINT64_MAX ULLONG_MAX #else #define wxINT64_MIN (wxLL(-9223372036854775807)-1) #define wxINT64_MAX wxLL(9223372036854775807) #define wxUINT64_MAX wxULL(0xFFFFFFFFFFFFFFFF) #endif /* 64 bit */ /* NB: we #define and not typedef wxLongLong_t because we use "#ifdef */ /* wxLongLong_t" in wx/longlong.h */ /* wxULongLong_t is set later (usually to unsigned wxLongLong_t) */ /* to avoid compilation problems on 64bit machines with ambiguous method calls */ /* we will need to define this */ #undef wxLongLongIsLong /* First check for specific compilers which have known 64 bit integer types, this avoids clashes with SIZEOF_LONG[_LONG] being defined incorrectly for e.g. MSVC builds (Python.h defines it as 8 even for MSVC). Also notice that we check for "long long" before checking for 64 bit long as we still want to use "long long" and not "long" for wxLongLong_t on 64 bit architectures to be able to pass wxLongLong_t to the standard functions prototyped as taking "long long" such as strtoll(). */ #if (defined(__VISUALC__) || defined(__INTELC__)) && defined(__WIN32__) #define wxLongLong_t __int64 #define wxLongLongSuffix i64 #define wxLongLongFmtSpec "I64" #elif defined(__BORLANDC__) && defined(__WIN32__) && (__BORLANDC__ >= 0x520) #define wxLongLong_t __int64 #define wxLongLongSuffix i64 #define wxLongLongFmtSpec "L" #elif defined(__MINGW32__) && \ (defined(__USE_MINGW_ANSI_STDIO) && (__USE_MINGW_ANSI_STDIO != 1)) #define wxLongLong_t long long #define wxLongLongSuffix ll #define wxLongLongFmtSpec "I64" #elif (defined(SIZEOF_LONG_LONG) && SIZEOF_LONG_LONG >= 8) || \ defined(__GNUC__) || \ defined(__CYGWIN__) #define wxLongLong_t long long #define wxLongLongSuffix ll #define wxLongLongFmtSpec "ll" #elif defined(SIZEOF_LONG) && (SIZEOF_LONG == 8) #define wxLongLong_t long #define wxLongLongSuffix l #define wxLongLongFmtSpec "l" #define wxLongLongIsLong #endif #ifdef wxLongLong_t #define wxULongLong_t unsigned wxLongLong_t /* wxLL() and wxULL() macros allow to define 64 bit constants in a portable way. */ #ifndef wxCOMPILER_BROKEN_CONCAT_OPER #define wxLL(x) wxCONCAT(x, wxLongLongSuffix) #define wxULL(x) wxCONCAT(x, wxCONCAT(u, wxLongLongSuffix)) #else /* Currently only Borland compiler has broken concatenation operator and this compiler is known to use [u]i64 suffix. */ #define wxLL(x) wxAPPEND_i64(x) #define wxULL(x) wxAPPEND_ui64(x) #endif typedef wxLongLong_t wxInt64; typedef wxULongLong_t wxUint64; #define wxHAS_INT64 1 #ifndef wxLongLongIsLong #define wxHAS_LONG_LONG_T_DIFFERENT_FROM_LONG #endif #elif wxUSE_LONGLONG /* these macros allow to define 64 bit constants in a portable way */ #define wxLL(x) wxLongLong(x) #define wxULL(x) wxULongLong(x) #define wxInt64 wxLongLong #define wxUint64 wxULongLong #define wxHAS_INT64 1 #else /* !wxUSE_LONGLONG */ #define wxHAS_INT64 0 #endif /* Helper macro for conditionally compiling some code only if wxLongLong_t is available and is a type different from the other integer types (i.e. not long). */ #ifdef wxHAS_LONG_LONG_T_DIFFERENT_FROM_LONG #define wxIF_LONG_LONG_TYPE(x) x #else #define wxIF_LONG_LONG_TYPE(x) #endif /* Make sure ssize_t is defined (a signed type the same size as size_t). */ /* (HAVE_SSIZE_T is not already defined by configure) */ #ifndef HAVE_SSIZE_T #ifdef __MINGW32__ #if defined(_SSIZE_T_) || defined(_SSIZE_T_DEFINED) #define HAVE_SSIZE_T #endif #endif #endif /* !HAVE_SSIZE_T */ /* If we really don't have ssize_t, provide our own version. */ #ifdef HAVE_SSIZE_T #ifdef __UNIX__ #include <sys/types.h> #endif #else /* !HAVE_SSIZE_T */ #if SIZEOF_SIZE_T == 4 typedef wxInt32 ssize_t; #elif SIZEOF_SIZE_T == 8 typedef wxInt64 ssize_t; #else #error "error defining ssize_t, size_t is not 4 or 8 bytes" #endif /* prevent ssize_t redefinitions in other libraries */ #define HAVE_SSIZE_T #endif /* We can't rely on Windows _W64 being defined as windows.h may not be included so define our own equivalent: this should be used with types like WXLPARAM or WXWPARAM which are 64 bit under Win64 to avoid warnings each time we cast it to a pointer or a handle (which results in hundreds of warnings as Win32 API often passes pointers in them) */ #ifdef __VISUALC__ #define wxW64 __w64 #else #define wxW64 #endif /* Define signed and unsigned integral types big enough to contain all of long, size_t and void *. */ #if SIZEOF_LONG >= SIZEOF_VOID_P /* Normal case when long is the largest integral type. */ typedef long wxIntPtr; typedef unsigned long wxUIntPtr; #elif SIZEOF_SIZE_T >= SIZEOF_VOID_P /* Win64 case: size_t is the only integral type big enough for "void *". Notice that we must use __w64 to avoid warnings about casting pointers to wxIntPtr (which we do often as this is what it is defined for) in 32 bit build with MSVC. */ typedef wxW64 ssize_t wxIntPtr; typedef size_t wxUIntPtr; #else /* This should never happen for the current architectures but if you're using one where it does, please contact [email protected]. */ #error "Pointers can't be stored inside integer types." #endif #endif // _WX_TYPES_H_
h
rticonnextdds-usecases
data/projects/rticonnextdds-usecases/VehicleTracking/ExampleCode/thirdparty/wxWidgets-3.1.2/Linux/include/wx/dcmemory.h
///////////////////////////////////////////////////////////////////////////// // Name: wx/dcmemory.h // Purpose: wxMemoryDC base header // Author: Julian Smart // Modified by: // Created: // Copyright: (c) Julian Smart // Licence: wxWindows Licence ///////////////////////////////////////////////////////////////////////////// #ifndef _WX_DCMEMORY_H_BASE_ #define _WX_DCMEMORY_H_BASE_ #include "wx/dc.h" #include "wx/bitmap.h" //----------------------------------------------------------------------------- // wxMemoryDC //----------------------------------------------------------------------------- class WXDLLIMPEXP_CORE wxMemoryDC: public wxDC { public: wxMemoryDC(); wxMemoryDC( wxBitmap& bitmap ); wxMemoryDC( wxDC *dc ); // select the given bitmap to draw on it void SelectObject(wxBitmap& bmp); // select the given bitmap for read-only void SelectObjectAsSource(const wxBitmap& bmp); // get selected bitmap const wxBitmap& GetSelectedBitmap() const; wxBitmap& GetSelectedBitmap(); private: wxDECLARE_DYNAMIC_CLASS(wxMemoryDC); }; #endif // _WX_DCMEMORY_H_BASE_
h
rticonnextdds-usecases
data/projects/rticonnextdds-usecases/VehicleTracking/ExampleCode/thirdparty/wxWidgets-3.1.2/Linux/include/wx/anybutton.h
///////////////////////////////////////////////////////////////////////////// // Name: wx/anybutton.h // Purpose: wxAnyButtonBase class // Author: Vadim Zeitlin // Created: 2000-08-15 (extracted from button.h) // Copyright: (c) Vadim Zeitlin // Licence: wxWindows licence ///////////////////////////////////////////////////////////////////////////// #ifndef _WX_ANYBUTTON_H_BASE_ #define _WX_ANYBUTTON_H_BASE_ #include "wx/defs.h" #ifdef wxHAS_ANY_BUTTON // ---------------------------------------------------------------------------- // wxAnyButton specific flags // ---------------------------------------------------------------------------- // These flags affect label alignment #define wxBU_LEFT 0x0040 #define wxBU_TOP 0x0080 #define wxBU_RIGHT 0x0100 #define wxBU_BOTTOM 0x0200 #define wxBU_ALIGN_MASK ( wxBU_LEFT | wxBU_TOP | wxBU_RIGHT | wxBU_BOTTOM ) // These two flags are obsolete and have no effect any longer. #define wxBU_NOAUTODRAW 0x0000 #define wxBU_AUTODRAW 0x0004 // by default, the buttons will be created with some (system dependent) // minimal size to make them look nicer, giving this style will make them as // small as possible #define wxBU_EXACTFIT 0x0001 // this flag can be used to disable using the text label in the button: it is // mostly useful when creating buttons showing bitmap and having stock id as // without it both the standard label corresponding to the stock id and the // bitmap would be shown #define wxBU_NOTEXT 0x0002 #include "wx/bitmap.h" #include "wx/control.h" // ---------------------------------------------------------------------------- // wxAnyButton: common button functionality // ---------------------------------------------------------------------------- class WXDLLIMPEXP_CORE wxAnyButtonBase : public wxControl { public: wxAnyButtonBase() { } // show the image in the button in addition to the label: this method is // supported on all (major) platforms void SetBitmap(const wxBitmap& bitmap, wxDirection dir = wxLEFT) { SetBitmapLabel(bitmap); SetBitmapPosition(dir); } wxBitmap GetBitmap() const { return DoGetBitmap(State_Normal); } // Methods for setting individual images for different states: normal, // selected (meaning pushed or pressed), focused (meaning normal state for // a focused button), disabled or hover (a.k.a. hot or current). // // Remember that SetBitmap() itself must be called before any other // SetBitmapXXX() methods (except for SetBitmapLabel() which is a synonym // for it anyhow) and that all bitmaps passed to these functions should be // of the same size. void SetBitmapLabel(const wxBitmap& bitmap) { DoSetBitmap(bitmap, State_Normal); } void SetBitmapPressed(const wxBitmap& bitmap) { DoSetBitmap(bitmap, State_Pressed); } void SetBitmapDisabled(const wxBitmap& bitmap) { DoSetBitmap(bitmap, State_Disabled); } void SetBitmapCurrent(const wxBitmap& bitmap) { DoSetBitmap(bitmap, State_Current); } void SetBitmapFocus(const wxBitmap& bitmap) { DoSetBitmap(bitmap, State_Focused); } wxBitmap GetBitmapLabel() const { return DoGetBitmap(State_Normal); } wxBitmap GetBitmapPressed() const { return DoGetBitmap(State_Pressed); } wxBitmap GetBitmapDisabled() const { return DoGetBitmap(State_Disabled); } wxBitmap GetBitmapCurrent() const { return DoGetBitmap(State_Current); } wxBitmap GetBitmapFocus() const { return DoGetBitmap(State_Focused); } // set the margins around the image void SetBitmapMargins(wxCoord x, wxCoord y) { DoSetBitmapMargins(x, y); } void SetBitmapMargins(const wxSize& sz) { DoSetBitmapMargins(sz.x, sz.y); } wxSize GetBitmapMargins() { return DoGetBitmapMargins(); } // set the image position relative to the text, i.e. wxLEFT means that the // image is to the left of the text (this is the default) void SetBitmapPosition(wxDirection dir); // Buttons on MSW can look bad if they are not native colours, because // then they become owner-drawn and not theme-drawn. Disable it here // in wxAnyButtonBase to make it consistent. virtual bool ShouldInheritColours() const wxOVERRIDE { return false; } // wxUniv-compatible and deprecated equivalents to SetBitmapXXX() #if WXWIN_COMPATIBILITY_2_8 void SetImageLabel(const wxBitmap& bitmap) { SetBitmap(bitmap); } void SetImageMargins(wxCoord x, wxCoord y) { SetBitmapMargins(x, y); } #endif // WXWIN_COMPATIBILITY_2_8 // backwards compatible names for pressed/current bitmaps: they're not // deprecated as there is nothing really wrong with using them and no real // advantage to using the new names but the new names are still preferred wxBitmap GetBitmapSelected() const { return GetBitmapPressed(); } wxBitmap GetBitmapHover() const { return GetBitmapCurrent(); } void SetBitmapSelected(const wxBitmap& bitmap) { SetBitmapPressed(bitmap); } void SetBitmapHover(const wxBitmap& bitmap) { SetBitmapCurrent(bitmap); } // this enum is not part of wx public API, it is public because it is used // in non wxAnyButton-derived classes internally // // also notice that MSW code relies on the values of the enum elements, do // not change them without revising src/msw/button.cpp enum State { State_Normal, State_Current, // a.k.a. hot or "hovering" State_Pressed, // a.k.a. "selected" in public API for some reason State_Disabled, State_Focused, State_Max }; // return the current setting for the "normal" state of the button, it can // be different from State_Normal for a wxToggleButton virtual State GetNormalState() const { return State_Normal; } // return true if this button shouldn't show the text label, either because // it doesn't have it or because it was explicitly disabled with wxBU_NOTEXT bool DontShowLabel() const { return HasFlag(wxBU_NOTEXT) || GetLabel().empty(); } // return true if we do show the label bool ShowsLabel() const { return !DontShowLabel(); } protected: // choose the default border for this window virtual wxBorder GetDefaultBorder() const wxOVERRIDE { return wxBORDER_NONE; } virtual wxBitmap DoGetBitmap(State WXUNUSED(which)) const { return wxBitmap(); } virtual void DoSetBitmap(const wxBitmap& WXUNUSED(bitmap), State WXUNUSED(which)) { } virtual wxSize DoGetBitmapMargins() const { return wxSize(0, 0); } virtual void DoSetBitmapMargins(wxCoord WXUNUSED(x), wxCoord WXUNUSED(y)) { } virtual void DoSetBitmapPosition(wxDirection WXUNUSED(dir)) { } virtual bool DoGetAuthNeeded() const { return false; } virtual void DoSetAuthNeeded(bool WXUNUSED(show)) { } wxDECLARE_NO_COPY_CLASS(wxAnyButtonBase); }; #if defined(__WXUNIVERSAL__) #include "wx/univ/anybutton.h" #elif defined(__WXMSW__) #include "wx/msw/anybutton.h" //#elif defined(__WXMOTIF__) // #include "wx/motif/anybutton.h" #elif defined(__WXGTK20__) #include "wx/gtk/anybutton.h" //#elif defined(__WXGTK__) // #include "wx/gtk1/anybutton.h" #elif defined(__WXMAC__) #include "wx/osx/anybutton.h" #elif defined(__WXQT__) #include "wx/qt/anybutton.h" #else typedef wxAnyButtonBase wxAnyButton; #endif #endif // wxHAS_ANY_BUTTON #endif // _WX_ANYBUTTON_H_BASE_
h
rticonnextdds-usecases
data/projects/rticonnextdds-usecases/VehicleTracking/ExampleCode/thirdparty/wxWidgets-3.1.2/Linux/include/wx/graphics.h
///////////////////////////////////////////////////////////////////////////// // Name: wx/graphics.h // Purpose: graphics context header // Author: Stefan Csomor // Modified by: // Created: // Copyright: (c) Stefan Csomor // Licence: wxWindows licence ///////////////////////////////////////////////////////////////////////////// #ifndef _WX_GRAPHICS_H_ #define _WX_GRAPHICS_H_ #include "wx/defs.h" #if wxUSE_GRAPHICS_CONTEXT #include "wx/affinematrix2d.h" #include "wx/geometry.h" #include "wx/colour.h" #include "wx/dynarray.h" #include "wx/font.h" #include "wx/image.h" #include "wx/peninfobase.h" #include "wx/vector.h" enum wxAntialiasMode { wxANTIALIAS_NONE, // should be 0 wxANTIALIAS_DEFAULT }; enum wxInterpolationQuality { // default interpolation wxINTERPOLATION_DEFAULT, // no interpolation wxINTERPOLATION_NONE, // fast interpolation, suited for interactivity wxINTERPOLATION_FAST, // better quality wxINTERPOLATION_GOOD, // best quality, not suited for interactivity wxINTERPOLATION_BEST }; enum wxCompositionMode { // R = Result, S = Source, D = Destination, premultiplied with alpha // Ra, Sa, Da their alpha components // classic Porter-Duff compositions // http://keithp.com/~keithp/porterduff/p253-porter.pdf wxCOMPOSITION_INVALID = -1, /* indicates invalid/unsupported mode */ wxCOMPOSITION_CLEAR, /* R = 0 */ wxCOMPOSITION_SOURCE, /* R = S */ wxCOMPOSITION_OVER, /* R = S + D*(1 - Sa) */ wxCOMPOSITION_IN, /* R = S*Da */ wxCOMPOSITION_OUT, /* R = S*(1 - Da) */ wxCOMPOSITION_ATOP, /* R = S*Da + D*(1 - Sa) */ wxCOMPOSITION_DEST, /* R = D, essentially a noop */ wxCOMPOSITION_DEST_OVER, /* R = S*(1 - Da) + D */ wxCOMPOSITION_DEST_IN, /* R = D*Sa */ wxCOMPOSITION_DEST_OUT, /* R = D*(1 - Sa) */ wxCOMPOSITION_DEST_ATOP, /* R = S*(1 - Da) + D*Sa */ wxCOMPOSITION_XOR, /* R = S*(1 - Da) + D*(1 - Sa) */ // mathematical compositions wxCOMPOSITION_ADD /* R = S + D */ }; class WXDLLIMPEXP_FWD_CORE wxDC; class WXDLLIMPEXP_FWD_CORE wxWindowDC; class WXDLLIMPEXP_FWD_CORE wxMemoryDC; #if wxUSE_PRINTING_ARCHITECTURE class WXDLLIMPEXP_FWD_CORE wxPrinterDC; #endif #ifdef __WXMSW__ #if wxUSE_ENH_METAFILE class WXDLLIMPEXP_FWD_CORE wxEnhMetaFileDC; #endif #endif class WXDLLIMPEXP_FWD_CORE wxGraphicsContext; class WXDLLIMPEXP_FWD_CORE wxGraphicsPath; class WXDLLIMPEXP_FWD_CORE wxGraphicsMatrix; class WXDLLIMPEXP_FWD_CORE wxGraphicsFigure; class WXDLLIMPEXP_FWD_CORE wxGraphicsRenderer; class WXDLLIMPEXP_FWD_CORE wxGraphicsPen; class WXDLLIMPEXP_FWD_CORE wxGraphicsBrush; class WXDLLIMPEXP_FWD_CORE wxGraphicsFont; class WXDLLIMPEXP_FWD_CORE wxGraphicsBitmap; /* * notes about the graphics context apis * * angles : are measured in radians, 0.0 being in direction of positiv x axis, PI/2 being * in direction of positive y axis. */ // Base class of all objects used for drawing in the new graphics API, the always point back to their // originating rendering engine, there is no dynamic unloading of a renderer currently allowed, // these references are not counted // // The data used by objects like graphics pens etc is ref counted, in order to avoid unnecessary expensive // duplication. Any operation on a shared instance that results in a modified state, uncouples this // instance from the other instances that were shared - using copy on write semantics // class WXDLLIMPEXP_FWD_CORE wxGraphicsObjectRefData; class WXDLLIMPEXP_FWD_CORE wxGraphicsBitmapData; class WXDLLIMPEXP_FWD_CORE wxGraphicsMatrixData; class WXDLLIMPEXP_FWD_CORE wxGraphicsPathData; class WXDLLIMPEXP_CORE wxGraphicsObject : public wxObject { public: wxGraphicsObject(); wxGraphicsObject( wxGraphicsRenderer* renderer ); virtual ~wxGraphicsObject(); bool IsNull() const; // returns the renderer that was used to create this instance, or NULL if it has not been initialized yet wxGraphicsRenderer* GetRenderer() const; wxGraphicsObjectRefData* GetGraphicsData() const; protected: virtual wxObjectRefData* CreateRefData() const wxOVERRIDE; virtual wxObjectRefData* CloneRefData(const wxObjectRefData* data) const wxOVERRIDE; wxDECLARE_DYNAMIC_CLASS(wxGraphicsObject); }; // ---------------------------------------------------------------------------- // wxGraphicsPenInfo describes a wxGraphicsPen // ---------------------------------------------------------------------------- class wxGraphicsPenInfo : public wxPenInfoBase<wxGraphicsPenInfo> { public: explicit wxGraphicsPenInfo(const wxColour& colour = wxColour(), wxDouble width = 1.0, wxPenStyle style = wxPENSTYLE_SOLID) : wxPenInfoBase<wxGraphicsPenInfo>(colour, style) { m_width = width; } // Setters wxGraphicsPenInfo& Width(wxDouble width) { m_width = width; return *this; } // Accessors wxDouble GetWidth() const { return m_width; } private: wxDouble m_width; }; class WXDLLIMPEXP_CORE wxGraphicsPen : public wxGraphicsObject { public: wxGraphicsPen() {} virtual ~wxGraphicsPen() {} private: wxDECLARE_DYNAMIC_CLASS(wxGraphicsPen); }; extern WXDLLIMPEXP_DATA_CORE(wxGraphicsPen) wxNullGraphicsPen; class WXDLLIMPEXP_CORE wxGraphicsBrush : public wxGraphicsObject { public: wxGraphicsBrush() {} virtual ~wxGraphicsBrush() {} private: wxDECLARE_DYNAMIC_CLASS(wxGraphicsBrush); }; extern WXDLLIMPEXP_DATA_CORE(wxGraphicsBrush) wxNullGraphicsBrush; class WXDLLIMPEXP_CORE wxGraphicsFont : public wxGraphicsObject { public: wxGraphicsFont() {} virtual ~wxGraphicsFont() {} private: wxDECLARE_DYNAMIC_CLASS(wxGraphicsFont); }; extern WXDLLIMPEXP_DATA_CORE(wxGraphicsFont) wxNullGraphicsFont; class WXDLLIMPEXP_CORE wxGraphicsBitmap : public wxGraphicsObject { public: wxGraphicsBitmap() {} virtual ~wxGraphicsBitmap() {} // Convert bitmap to wxImage: this is more efficient than converting to // wxBitmap first and then to wxImage and also works without X server // connection under Unix that wxBitmap requires. #if wxUSE_IMAGE wxImage ConvertToImage() const; #endif // wxUSE_IMAGE void* GetNativeBitmap() const; const wxGraphicsBitmapData* GetBitmapData() const { return (const wxGraphicsBitmapData*) GetRefData(); } wxGraphicsBitmapData* GetBitmapData() { return (wxGraphicsBitmapData*) GetRefData(); } private: wxDECLARE_DYNAMIC_CLASS(wxGraphicsBitmap); }; extern WXDLLIMPEXP_DATA_CORE(wxGraphicsBitmap) wxNullGraphicsBitmap; class WXDLLIMPEXP_CORE wxGraphicsMatrix : public wxGraphicsObject { public: wxGraphicsMatrix() {} virtual ~wxGraphicsMatrix() {} // concatenates the matrix virtual void Concat( const wxGraphicsMatrix *t ); void Concat( const wxGraphicsMatrix &t ) { Concat( &t ); } // sets the matrix to the respective values virtual void Set(wxDouble a=1.0, wxDouble b=0.0, wxDouble c=0.0, wxDouble d=1.0, wxDouble tx=0.0, wxDouble ty=0.0); // gets the component valuess of the matrix virtual void Get(wxDouble* a=NULL, wxDouble* b=NULL, wxDouble* c=NULL, wxDouble* d=NULL, wxDouble* tx=NULL, wxDouble* ty=NULL) const; // makes this the inverse matrix virtual void Invert(); // returns true if the elements of the transformation matrix are equal ? virtual bool IsEqual( const wxGraphicsMatrix* t) const; bool IsEqual( const wxGraphicsMatrix& t) const { return IsEqual( &t ); } // return true if this is the identity matrix virtual bool IsIdentity() const; // // transformation // // add the translation to this matrix virtual void Translate( wxDouble dx , wxDouble dy ); // add the scale to this matrix virtual void Scale( wxDouble xScale , wxDouble yScale ); // add the rotation to this matrix (radians) virtual void Rotate( wxDouble angle ); // // apply the transforms // // applies that matrix to the point virtual void TransformPoint( wxDouble *x, wxDouble *y ) const; // applies the matrix except for translations virtual void TransformDistance( wxDouble *dx, wxDouble *dy ) const; // returns the native representation virtual void * GetNativeMatrix() const; const wxGraphicsMatrixData* GetMatrixData() const { return (const wxGraphicsMatrixData*) GetRefData(); } wxGraphicsMatrixData* GetMatrixData() { return (wxGraphicsMatrixData*) GetRefData(); } private: wxDECLARE_DYNAMIC_CLASS(wxGraphicsMatrix); }; extern WXDLLIMPEXP_DATA_CORE(wxGraphicsMatrix) wxNullGraphicsMatrix; class WXDLLIMPEXP_CORE wxGraphicsPath : public wxGraphicsObject { public: wxGraphicsPath() {} virtual ~wxGraphicsPath() {} // // These are the path primitives from which everything else can be constructed // // begins a new subpath at (x,y) virtual void MoveToPoint( wxDouble x, wxDouble y ); void MoveToPoint( const wxPoint2DDouble& p); // adds a straight line from the current point to (x,y) virtual void AddLineToPoint( wxDouble x, wxDouble y ); void AddLineToPoint( const wxPoint2DDouble& p); // adds a cubic Bezier curve from the current point, using two control points and an end point virtual void AddCurveToPoint( wxDouble cx1, wxDouble cy1, wxDouble cx2, wxDouble cy2, wxDouble x, wxDouble y ); void AddCurveToPoint( const wxPoint2DDouble& c1, const wxPoint2DDouble& c2, const wxPoint2DDouble& e); // adds another path virtual void AddPath( const wxGraphicsPath& path ); // closes the current sub-path virtual void CloseSubpath(); // gets the last point of the current path, (0,0) if not yet set virtual void GetCurrentPoint( wxDouble* x, wxDouble* y) const; wxPoint2DDouble GetCurrentPoint() const; // adds an arc of a circle centering at (x,y) with radius (r) from startAngle to endAngle virtual void AddArc( wxDouble x, wxDouble y, wxDouble r, wxDouble startAngle, wxDouble endAngle, bool clockwise ); void AddArc( const wxPoint2DDouble& c, wxDouble r, wxDouble startAngle, wxDouble endAngle, bool clockwise); // // These are convenience functions which - if not available natively will be assembled // using the primitives from above // // adds a quadratic Bezier curve from the current point, using a control point and an end point virtual void AddQuadCurveToPoint( wxDouble cx, wxDouble cy, wxDouble x, wxDouble y ); // appends a rectangle as a new closed subpath virtual void AddRectangle( wxDouble x, wxDouble y, wxDouble w, wxDouble h ); // appends an ellipsis as a new closed subpath fitting the passed rectangle virtual void AddCircle( wxDouble x, wxDouble y, wxDouble r ); // appends a an arc to two tangents connecting (current) to (x1,y1) and (x1,y1) to (x2,y2), also a straight line from (current) to (x1,y1) virtual void AddArcToPoint( wxDouble x1, wxDouble y1 , wxDouble x2, wxDouble y2, wxDouble r ); // appends an ellipse virtual void AddEllipse( wxDouble x, wxDouble y, wxDouble w, wxDouble h); // appends a rounded rectangle virtual void AddRoundedRectangle( wxDouble x, wxDouble y, wxDouble w, wxDouble h, wxDouble radius); // returns the native path virtual void * GetNativePath() const; // give the native path returned by GetNativePath() back (there might be some deallocations necessary) virtual void UnGetNativePath(void *p)const; // transforms each point of this path by the matrix virtual void Transform( const wxGraphicsMatrix& matrix ); // gets the bounding box enclosing all points (possibly including control points) virtual void GetBox(wxDouble *x, wxDouble *y, wxDouble *w, wxDouble *h)const; wxRect2DDouble GetBox()const; virtual bool Contains( wxDouble x, wxDouble y, wxPolygonFillMode fillStyle = wxODDEVEN_RULE)const; bool Contains( const wxPoint2DDouble& c, wxPolygonFillMode fillStyle = wxODDEVEN_RULE)const; const wxGraphicsPathData* GetPathData() const { return (const wxGraphicsPathData*) GetRefData(); } wxGraphicsPathData* GetPathData() { return (wxGraphicsPathData*) GetRefData(); } private: wxDECLARE_DYNAMIC_CLASS(wxGraphicsPath); }; extern WXDLLIMPEXP_DATA_CORE(wxGraphicsPath) wxNullGraphicsPath; // Describes a single gradient stop. class wxGraphicsGradientStop { public: wxGraphicsGradientStop(wxColour col = wxTransparentColour, float pos = 0.) : m_col(col), m_pos(pos) { } // default copy ctor, assignment operator and dtor are ok const wxColour& GetColour() const { return m_col; } void SetColour(const wxColour& col) { m_col = col; } float GetPosition() const { return m_pos; } void SetPosition(float pos) { wxASSERT_MSG( pos >= 0 && pos <= 1, "invalid gradient stop position" ); m_pos = pos; } private: // The colour of this gradient band. wxColour m_col; // Its starting position: 0 is the beginning and 1 is the end. float m_pos; }; // A collection of gradient stops ordered by their positions (from lowest to // highest). The first stop (index 0, position 0.0) is always the starting // colour and the last one (index GetCount() - 1, position 1.0) is the end // colour. class WXDLLIMPEXP_CORE wxGraphicsGradientStops { public: wxGraphicsGradientStops(wxColour startCol = wxTransparentColour, wxColour endCol = wxTransparentColour) { // we can't use Add() here as it relies on having start/end stops as // first/last array elements so do it manually m_stops.push_back(wxGraphicsGradientStop(startCol, 0.f)); m_stops.push_back(wxGraphicsGradientStop(endCol, 1.f)); } // default copy ctor, assignment operator and dtor are ok for this class // Add a stop in correct order. void Add(const wxGraphicsGradientStop& stop); void Add(wxColour col, float pos) { Add(wxGraphicsGradientStop(col, pos)); } // Get the number of stops. size_t GetCount() const { return m_stops.size(); } // Return the stop at the given index (which must be valid). wxGraphicsGradientStop Item(unsigned n) const { return m_stops.at(n); } // Get/set start and end colours. void SetStartColour(wxColour col) { m_stops[0].SetColour(col); } wxColour GetStartColour() const { return m_stops[0].GetColour(); } void SetEndColour(wxColour col) { m_stops[m_stops.size() - 1].SetColour(col); } wxColour GetEndColour() const { return m_stops[m_stops.size() - 1].GetColour(); } private: // All the stops stored in ascending order of positions. wxVector<wxGraphicsGradientStop> m_stops; }; class WXDLLIMPEXP_CORE wxGraphicsContext : public wxGraphicsObject { public: wxGraphicsContext(wxGraphicsRenderer* renderer, wxWindow* window = NULL); virtual ~wxGraphicsContext(); static wxGraphicsContext* Create( const wxWindowDC& dc); static wxGraphicsContext * Create( const wxMemoryDC& dc); #if wxUSE_PRINTING_ARCHITECTURE static wxGraphicsContext * Create( const wxPrinterDC& dc); #endif #ifdef __WXMSW__ #if wxUSE_ENH_METAFILE static wxGraphicsContext * Create( const wxEnhMetaFileDC& dc); #endif #endif // Create a context from a DC of unknown type, if supported, returns NULL otherwise static wxGraphicsContext* CreateFromUnknownDC(const wxDC& dc); static wxGraphicsContext* CreateFromNative( void * context ); static wxGraphicsContext* CreateFromNativeWindow( void * window ); #ifdef __WXMSW__ static wxGraphicsContext* CreateFromNativeHDC(WXHDC dc); #endif static wxGraphicsContext* Create( wxWindow* window ); #if wxUSE_IMAGE // Create a context for drawing onto a wxImage. The image life time must be // greater than that of the context itself as when the context is destroyed // it will copy its contents to the specified image. static wxGraphicsContext* Create(wxImage& image); #endif // wxUSE_IMAGE // create a context that can be used for measuring texts only, no drawing allowed static wxGraphicsContext * Create(); // Return the window this context is associated with, if any. wxWindow* GetWindow() const { return m_window; } // begin a new document (relevant only for printing / pdf etc) if there is a progress dialog, message will be shown virtual bool StartDoc( const wxString& message ); // done with that document (relevant only for printing / pdf etc) virtual void EndDoc(); // opens a new page (relevant only for printing / pdf etc) with the given size in points // (if both are null the default page size will be used) virtual void StartPage( wxDouble width = 0, wxDouble height = 0 ); // ends the current page (relevant only for printing / pdf etc) virtual void EndPage(); // make sure that the current content of this context is immediately visible virtual void Flush(); wxGraphicsPath CreatePath() const; wxGraphicsPen CreatePen(const wxPen& pen) const; wxGraphicsPen CreatePen(const wxGraphicsPenInfo& info) const { return DoCreatePen(info); } virtual wxGraphicsBrush CreateBrush(const wxBrush& brush ) const; // sets the brush to a linear gradient, starting at (x1,y1) and ending at // (x2,y2) with the given boundary colours or the specified stops wxGraphicsBrush CreateLinearGradientBrush(wxDouble x1, wxDouble y1, wxDouble x2, wxDouble y2, const wxColour& c1, const wxColour& c2) const; wxGraphicsBrush CreateLinearGradientBrush(wxDouble x1, wxDouble y1, wxDouble x2, wxDouble y2, const wxGraphicsGradientStops& stops) const; // sets the brush to a radial gradient originating at (xo,yc) and ending // on a circle around (xc,yc) with the given radius; the colours may be // specified by just the two extremes or the full array of gradient stops wxGraphicsBrush CreateRadialGradientBrush(wxDouble xo, wxDouble yo, wxDouble xc, wxDouble yc, wxDouble radius, const wxColour& oColor, const wxColour& cColor) const; wxGraphicsBrush CreateRadialGradientBrush(wxDouble xo, wxDouble yo, wxDouble xc, wxDouble yc, wxDouble radius, const wxGraphicsGradientStops& stops) const; // creates a font virtual wxGraphicsFont CreateFont( const wxFont &font , const wxColour &col = *wxBLACK ) const; virtual wxGraphicsFont CreateFont(double sizeInPixels, const wxString& facename, int flags = wxFONTFLAG_DEFAULT, const wxColour& col = *wxBLACK) const; // create a native bitmap representation virtual wxGraphicsBitmap CreateBitmap( const wxBitmap &bitmap ) const; #if wxUSE_IMAGE wxGraphicsBitmap CreateBitmapFromImage(const wxImage& image) const; #endif // wxUSE_IMAGE // create a native bitmap representation virtual wxGraphicsBitmap CreateSubBitmap( const wxGraphicsBitmap &bitmap, wxDouble x, wxDouble y, wxDouble w, wxDouble h ) const; // create a 'native' matrix corresponding to these values virtual wxGraphicsMatrix CreateMatrix( wxDouble a=1.0, wxDouble b=0.0, wxDouble c=0.0, wxDouble d=1.0, wxDouble tx=0.0, wxDouble ty=0.0) const; wxGraphicsMatrix CreateMatrix( const wxAffineMatrix2DBase& mat ) const { wxMatrix2D mat2D; wxPoint2DDouble tr; mat.Get(&mat2D, &tr); return CreateMatrix(mat2D.m_11, mat2D.m_12, mat2D.m_21, mat2D.m_22, tr.m_x, tr.m_y); } // push the current state of the context, ie the transformation matrix on a stack virtual void PushState() = 0; // pops a stored state from the stack virtual void PopState() = 0; // clips drawings to the region intersected with the current clipping region virtual void Clip( const wxRegion &region ) = 0; // clips drawings to the rect intersected with the current clipping region virtual void Clip( wxDouble x, wxDouble y, wxDouble w, wxDouble h ) = 0; // resets the clipping to original extent virtual void ResetClip() = 0; // returns bounding box of the clipping region virtual void GetClipBox(wxDouble* x, wxDouble* y, wxDouble* w, wxDouble* h) = 0; // returns the native context virtual void * GetNativeContext() = 0; // returns the current shape antialiasing mode virtual wxAntialiasMode GetAntialiasMode() const { return m_antialias; } // sets the antialiasing mode, returns true if it supported virtual bool SetAntialiasMode(wxAntialiasMode antialias) = 0; // returns the current interpolation quality virtual wxInterpolationQuality GetInterpolationQuality() const { return m_interpolation; } // sets the interpolation quality, returns true if it supported virtual bool SetInterpolationQuality(wxInterpolationQuality interpolation) = 0; // returns the current compositing operator virtual wxCompositionMode GetCompositionMode() const { return m_composition; } // sets the compositing operator, returns true if it supported virtual bool SetCompositionMode(wxCompositionMode op) = 0; // returns the size of the graphics context in device coordinates void GetSize(wxDouble* width, wxDouble* height) const { if ( width ) *width = m_width; if ( height ) *height = m_height; } // returns the resolution of the graphics context in device points per inch virtual void GetDPI( wxDouble* dpiX, wxDouble* dpiY); #if 0 // sets the current alpha on this context virtual void SetAlpha( wxDouble alpha ); // returns the alpha on this context virtual wxDouble GetAlpha() const; #endif // all rendering is done into a fully transparent temporary context virtual void BeginLayer(wxDouble opacity) = 0; // composites back the drawings into the context with the opacity given at // the BeginLayer call virtual void EndLayer() = 0; // // transformation : changes the current transformation matrix CTM of the context // // translate virtual void Translate( wxDouble dx , wxDouble dy ) = 0; // scale virtual void Scale( wxDouble xScale , wxDouble yScale ) = 0; // rotate (radians) virtual void Rotate( wxDouble angle ) = 0; // concatenates this transform with the current transform of this context virtual void ConcatTransform( const wxGraphicsMatrix& matrix ) = 0; // sets the transform of this context virtual void SetTransform( const wxGraphicsMatrix& matrix ) = 0; // gets the matrix of this context virtual wxGraphicsMatrix GetTransform() const = 0; // // setting the paint // // sets the pen virtual void SetPen( const wxGraphicsPen& pen ); void SetPen( const wxPen& pen ); // sets the brush for filling virtual void SetBrush( const wxGraphicsBrush& brush ); void SetBrush( const wxBrush& brush ); // sets the font virtual void SetFont( const wxGraphicsFont& font ); void SetFont( const wxFont& font, const wxColour& colour ); // strokes along a path with the current pen virtual void StrokePath( const wxGraphicsPath& path ) = 0; // fills a path with the current brush virtual void FillPath( const wxGraphicsPath& path, wxPolygonFillMode fillStyle = wxODDEVEN_RULE ) = 0; // draws a path by first filling and then stroking virtual void DrawPath( const wxGraphicsPath& path, wxPolygonFillMode fillStyle = wxODDEVEN_RULE ); // paints a transparent rectangle (only useful for bitmaps or windows) virtual void ClearRectangle(wxDouble x, wxDouble y, wxDouble w, wxDouble h); // // text // void DrawText( const wxString &str, wxDouble x, wxDouble y ) { DoDrawText(str, x, y); } void DrawText( const wxString &str, wxDouble x, wxDouble y, wxDouble angle ) { DoDrawRotatedText(str, x, y, angle); } void DrawText( const wxString &str, wxDouble x, wxDouble y, const wxGraphicsBrush& backgroundBrush ) { DoDrawFilledText(str, x, y, backgroundBrush); } void DrawText( const wxString &str, wxDouble x, wxDouble y, wxDouble angle, const wxGraphicsBrush& backgroundBrush ) { DoDrawRotatedFilledText(str, x, y, angle, backgroundBrush); } virtual void GetTextExtent( const wxString &text, wxDouble *width, wxDouble *height, wxDouble *descent = NULL, wxDouble *externalLeading = NULL ) const = 0; virtual void GetPartialTextExtents(const wxString& text, wxArrayDouble& widths) const = 0; // // image support // virtual void DrawBitmap( const wxGraphicsBitmap &bmp, wxDouble x, wxDouble y, wxDouble w, wxDouble h ) = 0; virtual void DrawBitmap( const wxBitmap &bmp, wxDouble x, wxDouble y, wxDouble w, wxDouble h ) = 0; virtual void DrawIcon( const wxIcon &icon, wxDouble x, wxDouble y, wxDouble w, wxDouble h ) = 0; // // convenience methods // // strokes a single line virtual void StrokeLine( wxDouble x1, wxDouble y1, wxDouble x2, wxDouble y2); // stroke lines connecting each of the points virtual void StrokeLines( size_t n, const wxPoint2DDouble *points); // stroke disconnected lines from begin to end points virtual void StrokeLines( size_t n, const wxPoint2DDouble *beginPoints, const wxPoint2DDouble *endPoints); // draws a polygon virtual void DrawLines( size_t n, const wxPoint2DDouble *points, wxPolygonFillMode fillStyle = wxODDEVEN_RULE ); // draws a rectangle virtual void DrawRectangle( wxDouble x, wxDouble y, wxDouble w, wxDouble h); // draws an ellipse virtual void DrawEllipse( wxDouble x, wxDouble y, wxDouble w, wxDouble h); // draws a rounded rectangle virtual void DrawRoundedRectangle( wxDouble x, wxDouble y, wxDouble w, wxDouble h, wxDouble radius); // wrappers using wxPoint2DDouble TODO // helper to determine if a 0.5 offset should be applied for the drawing operation virtual bool ShouldOffset() const { return false; } // indicates whether the context should try to offset for pixel boundaries, this only makes sense on // bitmap devices like screen, by default this is turned off virtual void EnableOffset(bool enable = true); void DisableOffset() { EnableOffset(false); } bool OffsetEnabled() { return m_enableOffset; } protected: // These fields must be initialized in the derived class ctors. wxDouble m_width, m_height; wxGraphicsPen m_pen; wxGraphicsBrush m_brush; wxGraphicsFont m_font; wxAntialiasMode m_antialias; wxCompositionMode m_composition; wxInterpolationQuality m_interpolation; bool m_enableOffset; protected: // implementations of overloaded public functions: we use different names // for them to avoid the virtual function hiding problems in the derived // classes virtual wxGraphicsPen DoCreatePen(const wxGraphicsPenInfo& info) const; virtual void DoDrawText(const wxString& str, wxDouble x, wxDouble y) = 0; virtual void DoDrawRotatedText(const wxString& str, wxDouble x, wxDouble y, wxDouble angle); virtual void DoDrawFilledText(const wxString& str, wxDouble x, wxDouble y, const wxGraphicsBrush& backgroundBrush); virtual void DoDrawRotatedFilledText(const wxString& str, wxDouble x, wxDouble y, wxDouble angle, const wxGraphicsBrush& backgroundBrush); private: // The associated window, if any, i.e. if one was passed directly to // Create() or the associated window of the wxDC this context was created // from. wxWindow* const m_window; wxDECLARE_NO_COPY_CLASS(wxGraphicsContext); wxDECLARE_ABSTRACT_CLASS(wxGraphicsContext); }; #if 0 // // A graphics figure allows to cache path, pen etc creations, also will be a basis for layering/grouping elements // class WXDLLIMPEXP_CORE wxGraphicsFigure : public wxGraphicsObject { public: wxGraphicsFigure(wxGraphicsRenderer* renderer); virtual ~wxGraphicsFigure(); void SetPath( wxGraphicsMatrix* matrix ); void SetMatrix( wxGraphicsPath* path); // draws this object on the context virtual void Draw( wxGraphicsContext* cg ); // returns the path of this object wxGraphicsPath* GetPath() { return m_path; } // returns the transformation matrix of this object, may be null if there is no transformation necessary wxGraphicsMatrix* GetMatrix() { return m_matrix; } private: wxGraphicsMatrix* m_matrix; wxGraphicsPath* m_path; wxDECLARE_DYNAMIC_CLASS(wxGraphicsFigure); }; #endif // // The graphics renderer is the instance corresponding to the rendering engine used, eg there is ONE core graphics renderer // instance on OSX. This instance is pointed back to by all objects created by it. Therefore you can create eg additional // paths at any point from a given matrix etc. // class WXDLLIMPEXP_CORE wxGraphicsRenderer : public wxObject { public: wxGraphicsRenderer() {} virtual ~wxGraphicsRenderer() {} static wxGraphicsRenderer* GetDefaultRenderer(); static wxGraphicsRenderer* GetCairoRenderer(); #ifdef __WXMSW__ #if wxUSE_GRAPHICS_GDIPLUS static wxGraphicsRenderer* GetGDIPlusRenderer(); #endif #if wxUSE_GRAPHICS_DIRECT2D static wxGraphicsRenderer* GetDirect2DRenderer(); #endif #endif // Context virtual wxGraphicsContext * CreateContext( const wxWindowDC& dc) = 0; virtual wxGraphicsContext * CreateContext( const wxMemoryDC& dc) = 0; #if wxUSE_PRINTING_ARCHITECTURE virtual wxGraphicsContext * CreateContext( const wxPrinterDC& dc) = 0; #endif #ifdef __WXMSW__ #if wxUSE_ENH_METAFILE virtual wxGraphicsContext * CreateContext( const wxEnhMetaFileDC& dc) = 0; #endif #endif virtual wxGraphicsContext * CreateContextFromNativeContext( void * context ) = 0; virtual wxGraphicsContext * CreateContextFromNativeWindow( void * window ) = 0; #ifdef __WXMSW__ virtual wxGraphicsContext * CreateContextFromNativeHDC(WXHDC dc) = 0; #endif virtual wxGraphicsContext * CreateContext( wxWindow* window ) = 0; #if wxUSE_IMAGE virtual wxGraphicsContext * CreateContextFromImage(wxImage& image) = 0; #endif // wxUSE_IMAGE // create a context that can be used for measuring texts only, no drawing allowed virtual wxGraphicsContext * CreateMeasuringContext() = 0; // Path virtual wxGraphicsPath CreatePath() = 0; // Matrix virtual wxGraphicsMatrix CreateMatrix( wxDouble a=1.0, wxDouble b=0.0, wxDouble c=0.0, wxDouble d=1.0, wxDouble tx=0.0, wxDouble ty=0.0) = 0; // Paints virtual wxGraphicsPen CreatePen(const wxGraphicsPenInfo& info) = 0; virtual wxGraphicsBrush CreateBrush(const wxBrush& brush ) = 0; // Gradient brush creation functions may not honour all the stops specified // stops and use just its boundary colours (this is currently the case // under OS X) virtual wxGraphicsBrush CreateLinearGradientBrush(wxDouble x1, wxDouble y1, wxDouble x2, wxDouble y2, const wxGraphicsGradientStops& stops) = 0; virtual wxGraphicsBrush CreateRadialGradientBrush(wxDouble xo, wxDouble yo, wxDouble xc, wxDouble yc, wxDouble radius, const wxGraphicsGradientStops& stops) = 0; // sets the font virtual wxGraphicsFont CreateFont( const wxFont &font , const wxColour &col = *wxBLACK ) = 0; virtual wxGraphicsFont CreateFont(double sizeInPixels, const wxString& facename, int flags = wxFONTFLAG_DEFAULT, const wxColour& col = *wxBLACK) = 0; // create a native bitmap representation virtual wxGraphicsBitmap CreateBitmap( const wxBitmap &bitmap ) = 0; #if wxUSE_IMAGE virtual wxGraphicsBitmap CreateBitmapFromImage(const wxImage& image) = 0; virtual wxImage CreateImageFromBitmap(const wxGraphicsBitmap& bmp) = 0; #endif // wxUSE_IMAGE // create a graphics bitmap from a native bitmap virtual wxGraphicsBitmap CreateBitmapFromNativeBitmap( void* bitmap ) = 0; // create a subimage from a native image representation virtual wxGraphicsBitmap CreateSubBitmap( const wxGraphicsBitmap &bitmap, wxDouble x, wxDouble y, wxDouble w, wxDouble h ) = 0; virtual wxString GetName() const = 0; virtual void GetVersion(int* major, int* minor = NULL, int* micro = NULL) const = 0; private: wxDECLARE_NO_COPY_CLASS(wxGraphicsRenderer); wxDECLARE_ABSTRACT_CLASS(wxGraphicsRenderer); }; #if wxUSE_IMAGE inline wxImage wxGraphicsBitmap::ConvertToImage() const { wxGraphicsRenderer* renderer = GetRenderer(); return renderer ? renderer->CreateImageFromBitmap(*this) : wxNullImage; } #endif // wxUSE_IMAGE #endif // wxUSE_GRAPHICS_CONTEXT #endif // _WX_GRAPHICS_H_
h
rticonnextdds-usecases
data/projects/rticonnextdds-usecases/VehicleTracking/ExampleCode/thirdparty/wxWidgets-3.1.2/Linux/include/wx/dirctrl.h
///////////////////////////////////////////////////////////////////////////// // Name: wx/dirctrl.h // Purpose: Directory control base header // Author: Julian Smart // Modified by: // Created: // Copyright: (c) Julian Smart // Licence: wxWindows Licence ///////////////////////////////////////////////////////////////////////////// #ifndef _WX_DIRCTRL_H_BASE_ #define _WX_DIRCTRL_H_BASE_ #include "wx/generic/dirctrlg.h" #endif // _WX_DIRCTRL_H_BASE_
h
rticonnextdds-usecases
data/projects/rticonnextdds-usecases/VehicleTracking/ExampleCode/thirdparty/wxWidgets-3.1.2/Linux/include/wx/cshelp.h
///////////////////////////////////////////////////////////////////////////// // Name: wx/cshelp.h // Purpose: Context-sensitive help support classes // Author: Julian Smart, Vadim Zeitlin // Modified by: // Created: 08/09/2000 // Copyright: (c) 2000 Julian Smart, Vadim Zeitlin // Licence: wxWindows licence ///////////////////////////////////////////////////////////////////////////// #ifndef _WX_CSHELP_H_ #define _WX_CSHELP_H_ #include "wx/defs.h" #if wxUSE_HELP #include "wx/help.h" #include "wx/hashmap.h" #if wxUSE_BMPBUTTON #include "wx/bmpbuttn.h" #endif #include "wx/event.h" // ---------------------------------------------------------------------------- // classes used to implement context help UI // ---------------------------------------------------------------------------- /* * wxContextHelp * Invokes context-sensitive help. When the user * clicks on a window, a wxEVT_HELP event will be sent to that * window for the application to display help for. */ class WXDLLIMPEXP_CORE wxContextHelp : public wxObject { public: wxContextHelp(wxWindow* win = NULL, bool beginHelp = true); virtual ~wxContextHelp(); bool BeginContextHelp(wxWindow* win); bool EndContextHelp(); bool EventLoop(); bool DispatchEvent(wxWindow* win, const wxPoint& pt); void SetStatus(bool status) { m_status = status; } protected: bool m_inHelp; bool m_status; // true if the user left-clicked private: wxDECLARE_DYNAMIC_CLASS(wxContextHelp); }; #if wxUSE_BMPBUTTON /* * wxContextHelpButton * You can add this to your dialogs (especially on non-Windows platforms) * to put the application into context help mode. */ class WXDLLIMPEXP_CORE wxContextHelpButton : public wxBitmapButton { public: wxContextHelpButton() {} wxContextHelpButton(wxWindow* parent, wxWindowID id = wxID_CONTEXT_HELP, const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxDefaultSize, long style = 0) { Create(parent, id, pos, size, style); } bool Create(wxWindow* parent, wxWindowID id = wxID_CONTEXT_HELP, const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxDefaultSize, long style = 0); void OnContextHelp(wxCommandEvent& event); private: wxDECLARE_DYNAMIC_CLASS_NO_COPY(wxContextHelpButton); wxDECLARE_EVENT_TABLE(); }; #endif // ---------------------------------------------------------------------------- // classes used to implement context help support // ---------------------------------------------------------------------------- // wxHelpProvider is an abstract class used by the program implementing context help to // show the help text (or whatever: it may be HTML page or anything else) for // the given window. // // The current help provider must be explicitly set by the application using // wxHelpProvider::Set(). // // Special note about ShowHelpAtPoint() and ShowHelp(): we want to be able to // override ShowHelpAtPoint() when we need to use different help messages for // different parts of the window, but it should also be possible to override // just ShowHelp() both for backwards compatibility and just because most // often the help does not, in fact, depend on the position and so // implementing just ShowHelp() is simpler and more natural, so by default // ShowHelpAtPoint() forwards to ShowHelp(). But this means that // wxSimpleHelpProvider has to override ShowHelp() and not ShowHelpAtPoint() // for backwards compatibility as otherwise the existing code deriving from it // and overriding ShowHelp() but calling the base class version wouldn't work // any more, which forces us to use a rather ugly hack and pass the extra // parameters of ShowHelpAtPoint() to ShowHelp() via member variables. class WXDLLIMPEXP_CORE wxHelpProvider { public: // get/set the current (application-global) help provider (Set() returns // the previous one) static wxHelpProvider *Set(wxHelpProvider *helpProvider) { wxHelpProvider *helpProviderOld = ms_helpProvider; ms_helpProvider = helpProvider; return helpProviderOld; } // unlike some other class, the help provider is not created on demand, // this must be explicitly done by the application static wxHelpProvider *Get() { return ms_helpProvider; } // get the help string (whose interpretation is help provider dependent // except that empty string always means that no help is associated with // the window) for this window virtual wxString GetHelp(const wxWindowBase *window) = 0; // do show help for the given window (uses window->GetHelpAtPoint() // internally if applicable), return true if it was done or false // if no help available for this window virtual bool ShowHelpAtPoint(wxWindowBase *window, const wxPoint& pt, wxHelpEvent::Origin origin) { wxCHECK_MSG( window, false, wxT("window must not be NULL") ); m_helptextAtPoint = pt; m_helptextOrigin = origin; return ShowHelp(window); } // show help for the given window, see ShowHelpAtPoint() above virtual bool ShowHelp(wxWindowBase * WXUNUSED(window)) { return false; } // associate the text with the given window or id: although all help // providers have these functions to allow making wxWindow::SetHelpText() // work, not all of them implement them virtual void AddHelp(wxWindowBase *window, const wxString& text); // this version associates the given text with all window with this id // (may be used to set the same help string for all [Cancel] buttons in // the application, for example) virtual void AddHelp(wxWindowID id, const wxString& text); // removes the association virtual void RemoveHelp(wxWindowBase* window); // virtual dtor for any base class virtual ~wxHelpProvider(); protected: wxHelpProvider() : m_helptextAtPoint(wxDefaultPosition), m_helptextOrigin(wxHelpEvent::Origin_Unknown) { } // helper method used by ShowHelp(): returns the help string to use by // using m_helptextAtPoint/m_helptextOrigin if they're set or just GetHelp // otherwise wxString GetHelpTextMaybeAtPoint(wxWindowBase *window); // parameters of the last ShowHelpAtPoint() call, used by ShowHelp() wxPoint m_helptextAtPoint; wxHelpEvent::Origin m_helptextOrigin; private: static wxHelpProvider *ms_helpProvider; }; WX_DECLARE_EXPORTED_HASH_MAP( wxUIntPtr, wxString, wxIntegerHash, wxIntegerEqual, wxSimpleHelpProviderHashMap ); // wxSimpleHelpProvider is an implementation of wxHelpProvider which supports // only plain text help strings and shows the string associated with the // control (if any) in a tooltip class WXDLLIMPEXP_CORE wxSimpleHelpProvider : public wxHelpProvider { public: // implement wxHelpProvider methods virtual wxString GetHelp(const wxWindowBase *window) wxOVERRIDE; // override ShowHelp() and not ShowHelpAtPoint() as explained above virtual bool ShowHelp(wxWindowBase *window) wxOVERRIDE; virtual void AddHelp(wxWindowBase *window, const wxString& text) wxOVERRIDE; virtual void AddHelp(wxWindowID id, const wxString& text) wxOVERRIDE; virtual void RemoveHelp(wxWindowBase* window) wxOVERRIDE; protected: // we use 2 hashes for storing the help strings associated with windows // and the ids wxSimpleHelpProviderHashMap m_hashWindows, m_hashIds; }; // wxHelpControllerHelpProvider is an implementation of wxHelpProvider which supports // both context identifiers and plain text help strings. If the help text is an integer, // it is passed to wxHelpController::DisplayContextPopup. Otherwise, it shows the string // in a tooltip as per wxSimpleHelpProvider. class WXDLLIMPEXP_CORE wxHelpControllerHelpProvider : public wxSimpleHelpProvider { public: // Note that it doesn't own the help controller. The help controller // should be deleted separately. wxHelpControllerHelpProvider(wxHelpControllerBase* hc = NULL); // implement wxHelpProvider methods // again (see above): this should be ShowHelpAtPoint() but we need to // override ShowHelp() to avoid breaking existing code virtual bool ShowHelp(wxWindowBase *window) wxOVERRIDE; // Other accessors void SetHelpController(wxHelpControllerBase* hc) { m_helpController = hc; } wxHelpControllerBase* GetHelpController() const { return m_helpController; } protected: wxHelpControllerBase* m_helpController; wxDECLARE_NO_COPY_CLASS(wxHelpControllerHelpProvider); }; // Convenience function for turning context id into wxString WXDLLIMPEXP_CORE wxString wxContextId(int id); #endif // wxUSE_HELP #endif // _WX_CSHELP_H_
h
rticonnextdds-usecases
data/projects/rticonnextdds-usecases/VehicleTracking/ExampleCode/thirdparty/wxWidgets-3.1.2/Linux/include/wx/sckipc.h
///////////////////////////////////////////////////////////////////////////// // Name: wx/sckipc.h // Purpose: Interprocess communication implementation (wxSocket version) // Author: Julian Smart // Modified by: Guilhem Lavaux (big rewrite) May 1997, 1998 // Guillermo Rodriguez (updated for wxSocket v2) Jan 2000 // (callbacks deprecated) Mar 2000 // Created: 1993 // Copyright: (c) Julian Smart 1993 // (c) Guilhem Lavaux 1997, 1998 // (c) 2000 Guillermo Rodriguez <[email protected]> // Licence: wxWindows licence ///////////////////////////////////////////////////////////////////////////// #ifndef _WX_SCKIPC_H #define _WX_SCKIPC_H #include "wx/defs.h" #if wxUSE_SOCKETS && wxUSE_IPC #include "wx/ipcbase.h" #include "wx/socket.h" #include "wx/sckstrm.h" #include "wx/datstrm.h" /* * Mini-DDE implementation Most transactions involve a topic name and an item name (choose these as befits your application). A client can: - ask the server to execute commands (data) associated with a topic - request data from server by topic and item - poke data into the server - ask the server to start an advice loop on topic/item - ask the server to stop an advice loop A server can: - respond to execute, request, poke and advice start/stop - send advise data to client Note that this limits the server in the ways it can send data to the client, i.e. it can't send unsolicited information. * */ class WXDLLIMPEXP_FWD_NET wxTCPServer; class WXDLLIMPEXP_FWD_NET wxTCPClient; class wxIPCSocketStreams; class WXDLLIMPEXP_NET wxTCPConnection : public wxConnectionBase { public: wxTCPConnection() { Init(); } wxTCPConnection(void *buffer, size_t size) : wxConnectionBase(buffer, size) { Init(); } virtual ~wxTCPConnection(); // implement base class pure virtual methods virtual const void *Request(const wxString& item, size_t *size = NULL, wxIPCFormat format = wxIPC_TEXT) wxOVERRIDE; virtual bool StartAdvise(const wxString& item) wxOVERRIDE; virtual bool StopAdvise(const wxString& item) wxOVERRIDE; virtual bool Disconnect(void) wxOVERRIDE; // Will be used in the future to enable the compression but does nothing // for now. void Compress(bool on); protected: virtual bool DoExecute(const void *data, size_t size, wxIPCFormat format) wxOVERRIDE; virtual bool DoPoke(const wxString& item, const void *data, size_t size, wxIPCFormat format) wxOVERRIDE; virtual bool DoAdvise(const wxString& item, const void *data, size_t size, wxIPCFormat format) wxOVERRIDE; // notice that all the members below are only initialized once the // connection is made, i.e. in MakeConnection() for the client objects and // after OnAcceptConnection() in the server ones // the underlying socket (wxSocketClient for IPC client and wxSocketServer // for IPC server) wxSocketBase *m_sock; // various streams that we use wxIPCSocketStreams *m_streams; // the topic of this connection wxString m_topic; private: // common part of both ctors void Init(); friend class wxTCPServer; friend class wxTCPClient; friend class wxTCPEventHandler; wxDECLARE_NO_COPY_CLASS(wxTCPConnection); wxDECLARE_DYNAMIC_CLASS(wxTCPConnection); }; class WXDLLIMPEXP_NET wxTCPServer : public wxServerBase { public: wxTCPServer(); virtual ~wxTCPServer(); // Returns false on error (e.g. port number is already in use) virtual bool Create(const wxString& serverName) wxOVERRIDE; virtual wxConnectionBase *OnAcceptConnection(const wxString& topic) wxOVERRIDE; protected: wxSocketServer *m_server; #ifdef __UNIX_LIKE__ // the name of the file associated to the Unix domain socket, may be empty wxString m_filename; #endif // __UNIX_LIKE__ wxDECLARE_NO_COPY_CLASS(wxTCPServer); wxDECLARE_DYNAMIC_CLASS(wxTCPServer); }; class WXDLLIMPEXP_NET wxTCPClient : public wxClientBase { public: wxTCPClient(); virtual bool ValidHost(const wxString& host) wxOVERRIDE; // Call this to make a connection. Returns NULL if cannot. virtual wxConnectionBase *MakeConnection(const wxString& host, const wxString& server, const wxString& topic) wxOVERRIDE; // Callbacks to CLIENT - override at will virtual wxConnectionBase *OnMakeConnection() wxOVERRIDE; private: wxDECLARE_DYNAMIC_CLASS(wxTCPClient); }; #endif // wxUSE_SOCKETS && wxUSE_IPC #endif // _WX_SCKIPC_H
h
rticonnextdds-usecases
data/projects/rticonnextdds-usecases/VehicleTracking/ExampleCode/thirdparty/wxWidgets-3.1.2/Linux/include/wx/iconbndl.h
/////////////////////////////////////////////////////////////////////////////// // Name: wx/iconbndl.h // Purpose: wxIconBundle // Author: Mattia barbon // Modified by: // Created: 23.03.02 // Copyright: (c) Mattia Barbon // Licence: wxWindows licence /////////////////////////////////////////////////////////////////////////////// #ifndef _WX_ICONBNDL_H_ #define _WX_ICONBNDL_H_ #include "wx/gdiobj.h" #include "wx/gdicmn.h" // for wxSize #include "wx/icon.h" #include "wx/dynarray.h" class WXDLLIMPEXP_FWD_BASE wxInputStream; WX_DECLARE_EXPORTED_OBJARRAY(wxIcon, wxIconArray); // Load icons of multiple sizes from files or resources (MSW-only). class WXDLLIMPEXP_CORE wxIconBundle : public wxGDIObject { public: // Flags that determine what happens if GetIcon() doesn't find the icon of // exactly the requested size. enum { // Return invalid icon if exact size is not found. FALLBACK_NONE = 0, // Return the icon of the system icon size if exact size is not found. // May be combined with other non-NONE enum elements to determine what // happens if the system icon size is not found neither. FALLBACK_SYSTEM = 1, // Return the icon of closest larger size or, if there is no icon of // larger size in the bundle, the closest icon of smaller size. FALLBACK_NEAREST_LARGER = 2 }; // default constructor wxIconBundle(); // initializes the bundle with the icon(s) found in the file #if wxUSE_STREAMS && wxUSE_IMAGE #if wxUSE_FFILE || wxUSE_FILE wxIconBundle(const wxString& file, wxBitmapType type = wxBITMAP_TYPE_ANY); #endif // wxUSE_FFILE || wxUSE_FILE wxIconBundle(wxInputStream& stream, wxBitmapType type = wxBITMAP_TYPE_ANY); #endif // wxUSE_STREAMS && wxUSE_IMAGE // initializes the bundle with a single icon wxIconBundle(const wxIcon& icon); #if defined(__WINDOWS__) && wxUSE_ICO_CUR // initializes the bundle with the icons from a group icon stored as an MS Windows resource wxIconBundle(const wxString& resourceName, WXHINSTANCE module); #endif // default copy ctor and assignment operator are OK // adds all the icons contained in the file to the collection, // if the collection already contains icons with the same // width and height, they are replaced #if wxUSE_STREAMS && wxUSE_IMAGE #if wxUSE_FFILE || wxUSE_FILE void AddIcon(const wxString& file, wxBitmapType type = wxBITMAP_TYPE_ANY); #endif // wxUSE_FFILE || wxUSE_FILE void AddIcon(wxInputStream& stream, wxBitmapType type = wxBITMAP_TYPE_ANY); #endif // wxUSE_STREAMS && wxUSE_IMAGE #if defined(__WINDOWS__) && wxUSE_ICO_CUR // loads all the icons from a group icon stored in an MS Windows resource void AddIcon(const wxString& resourceName, WXHINSTANCE module); #endif // adds the icon to the collection, if the collection already // contains an icon with the same width and height, it is // replaced void AddIcon(const wxIcon& icon); // returns the icon with the given size; if no such icon exists, // behavior is specified by the flags. wxIcon GetIcon(const wxSize& size, int flags = FALLBACK_SYSTEM) const; // equivalent to GetIcon(wxSize(size, size)) wxIcon GetIcon(wxCoord size = wxDefaultCoord, int flags = FALLBACK_SYSTEM) const { return GetIcon(wxSize(size, size), flags); } // returns the icon exactly of the specified size or wxNullIcon if no icon // of exactly given size are available wxIcon GetIconOfExactSize(const wxSize& size) const; wxIcon GetIconOfExactSize(wxCoord size) const { return GetIconOfExactSize(wxSize(size, size)); } // enumerate all icons in the bundle: don't use these functions if ti can // be avoided, using GetIcon() directly is better // return the number of available icons size_t GetIconCount() const; // return the icon at index (must be < GetIconCount()) wxIcon GetIconByIndex(size_t n) const; // check if we have any icons at all bool IsEmpty() const { return GetIconCount() == 0; } #if WXWIN_COMPATIBILITY_2_8 #if wxUSE_STREAMS && wxUSE_IMAGE && (wxUSE_FFILE || wxUSE_FILE) wxDEPRECATED( void AddIcon(const wxString& file, long type) { AddIcon(file, (wxBitmapType)type); } ) wxDEPRECATED_CONSTRUCTOR( wxIconBundle (const wxString& file, long type) { AddIcon(file, (wxBitmapType)type); } ) #endif // wxUSE_STREAMS && wxUSE_IMAGE && (wxUSE_FFILE || wxUSE_FILE) #endif // WXWIN_COMPATIBILITY_2_8 protected: virtual wxGDIRefData *CreateGDIRefData() const wxOVERRIDE; virtual wxGDIRefData *CloneGDIRefData(const wxGDIRefData *data) const wxOVERRIDE; private: // delete all icons void DeleteIcons(); wxDECLARE_DYNAMIC_CLASS(wxIconBundle); }; #endif // _WX_ICONBNDL_H_
h
rticonnextdds-usecases
data/projects/rticonnextdds-usecases/VehicleTracking/ExampleCode/thirdparty/wxWidgets-3.1.2/Linux/include/wx/toplevel.h
/////////////////////////////////////////////////////////////////////////////// // Name: wx/toplevel.h // Purpose: declares wxTopLevelWindow class, the base class for all // top level windows (such as frames and dialogs) // Author: Vadim Zeitlin, Vaclav Slavik // Modified by: // Created: 06.08.01 // Copyright: (c) 2001 Vadim Zeitlin <[email protected]> // Vaclav Slavik <[email protected]> // Licence: wxWindows licence /////////////////////////////////////////////////////////////////////////////// #ifndef _WX_TOPLEVEL_BASE_H_ #define _WX_TOPLEVEL_BASE_H_ // ---------------------------------------------------------------------------- // headers // ---------------------------------------------------------------------------- #include "wx/nonownedwnd.h" #include "wx/iconbndl.h" #include "wx/weakref.h" // the default names for various classes extern WXDLLIMPEXP_DATA_CORE(const char) wxFrameNameStr[]; // ---------------------------------------------------------------------------- // constants // ---------------------------------------------------------------------------- /* Summary of the bits used (some of them are defined in wx/frame.h and wx/dialog.h and not here): +--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+ |15|14|13|12|11|10| 9| 8| 7| 6| 5| 4| 3| 2| 1| 0| +--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | \_ wxCENTRE | | | | | | | | | | | | | | \____ wxFRAME_NO_TASKBAR | | | | | | | | | | | | | \_______ wxFRAME_TOOL_WINDOW | | | | | | | | | | | | \__________ wxFRAME_FLOAT_ON_PARENT | | | | | | | | | | | \_____________ wxFRAME_SHAPED | | | | | | | | | | \________________ wxDIALOG_NO_PARENT | | | | | | | | | \___________________ wxRESIZE_BORDER | | | | | | | | \______________________ wxTINY_CAPTION_VERT | | | | | | | \_________________________ | | | | | | \____________________________ wxMAXIMIZE_BOX | | | | | \_______________________________ wxMINIMIZE_BOX | | | | \__________________________________ wxSYSTEM_MENU | | | \_____________________________________ wxCLOSE_BOX | | \________________________________________ wxMAXIMIZE | \___________________________________________ wxMINIMIZE \______________________________________________ wxSTAY_ON_TOP Notice that the 8 lower bits overlap with wxCENTRE and the button selection bits (wxYES, wxOK wxNO, wxCANCEL, wxAPPLY, wxCLOSE and wxNO_DEFAULT) which can be combined with the dialog style for several standard dialogs and hence shouldn't overlap with any styles which can be used for the dialogs. Additionally, wxCENTRE can be used with frames also. */ // style common to both wxFrame and wxDialog #define wxSTAY_ON_TOP 0x8000 #define wxICONIZE 0x4000 #define wxMINIMIZE wxICONIZE #define wxMAXIMIZE 0x2000 #define wxCLOSE_BOX 0x1000 // == wxHELP so can't be used with it #define wxSYSTEM_MENU 0x0800 #define wxMINIMIZE_BOX 0x0400 #define wxMAXIMIZE_BOX 0x0200 #define wxTINY_CAPTION 0x0080 // clashes with wxNO_DEFAULT #define wxRESIZE_BORDER 0x0040 // == wxCLOSE #if WXWIN_COMPATIBILITY_2_8 // HORIZ and VERT styles are equivalent anyhow so don't use different names // for them #define wxTINY_CAPTION_HORIZ wxTINY_CAPTION #define wxTINY_CAPTION_VERT wxTINY_CAPTION #endif // default style #define wxDEFAULT_FRAME_STYLE \ (wxSYSTEM_MENU | \ wxRESIZE_BORDER | \ wxMINIMIZE_BOX | \ wxMAXIMIZE_BOX | \ wxCLOSE_BOX | \ wxCAPTION | \ wxCLIP_CHILDREN) // Dialogs are created in a special way #define wxTOPLEVEL_EX_DIALOG 0x00000008 // Styles for ShowFullScreen // (note that wxTopLevelWindow only handles wxFULLSCREEN_NOBORDER and // wxFULLSCREEN_NOCAPTION; the rest is handled by wxTopLevelWindow) enum { wxFULLSCREEN_NOMENUBAR = 0x0001, wxFULLSCREEN_NOTOOLBAR = 0x0002, wxFULLSCREEN_NOSTATUSBAR = 0x0004, wxFULLSCREEN_NOBORDER = 0x0008, wxFULLSCREEN_NOCAPTION = 0x0010, wxFULLSCREEN_ALL = wxFULLSCREEN_NOMENUBAR | wxFULLSCREEN_NOTOOLBAR | wxFULLSCREEN_NOSTATUSBAR | wxFULLSCREEN_NOBORDER | wxFULLSCREEN_NOCAPTION }; // Styles for RequestUserAttention enum { wxUSER_ATTENTION_INFO = 1, wxUSER_ATTENTION_ERROR = 2 }; // ---------------------------------------------------------------------------- // wxTopLevelWindow: a top level (as opposed to child) window // ---------------------------------------------------------------------------- class WXDLLIMPEXP_CORE wxTopLevelWindowBase : public wxNonOwnedWindow { public: // construction wxTopLevelWindowBase(); virtual ~wxTopLevelWindowBase(); // top level wnd state // -------------------- // maximize = true => maximize, otherwise - restore virtual void Maximize(bool maximize = true) = 0; // undo Maximize() or Iconize() virtual void Restore() = 0; // iconize = true => iconize, otherwise - restore virtual void Iconize(bool iconize = true) = 0; // return true if the frame is maximized virtual bool IsMaximized() const = 0; // return true if the frame is always maximized // due to native guidelines or current policy virtual bool IsAlwaysMaximized() const; // return true if the frame is iconized virtual bool IsIconized() const = 0; // get the frame icon wxIcon GetIcon() const; // get the frame icons const wxIconBundle& GetIcons() const { return m_icons; } // set the frame icon: implemented in terms of SetIcons() void SetIcon(const wxIcon& icon); // set the frame icons virtual void SetIcons(const wxIconBundle& icons) { m_icons = icons; } virtual bool EnableFullScreenView(bool WXUNUSED(enable) = true) { return false; } // maximize the window to cover entire screen virtual bool ShowFullScreen(bool show, long style = wxFULLSCREEN_ALL) = 0; // shows the window, but doesn't activate it. If the base code is being run, // it means the port doesn't implement this method yet and so alert the user. virtual void ShowWithoutActivating() { wxFAIL_MSG("ShowWithoutActivating not implemented on this platform."); } // return true if the frame is in fullscreen mode virtual bool IsFullScreen() const = 0; // the title of the top level window: the text which the // window shows usually at the top of the frame/dialog in dedicated bar virtual void SetTitle(const wxString& title) = 0; virtual wxString GetTitle() const = 0; // enable/disable close button [x] virtual bool EnableCloseButton(bool WXUNUSED(enable) = true) { return false; } virtual bool EnableMaximizeButton(bool WXUNUSED(enable) = true) { return false; } virtual bool EnableMinimizeButton(bool WXUNUSED(enable) = true) { return false; } // Attracts the users attention to this window if the application is // inactive (should be called when a background event occurs) virtual void RequestUserAttention(int flags = wxUSER_ATTENTION_INFO); // Is this the active frame (highlighted in the taskbar)? // // A TLW is active only if it contains the currently focused window. virtual bool IsActive() { return IsDescendant(FindFocus()); } // this function may be overridden to return false to allow closing the // application even when this top level window is still open // // notice that the window is still closed prior to the application exit and // so it can still veto it even if it returns false from here virtual bool ShouldPreventAppExit() const { return true; } // centre the window on screen: this is just a shortcut void CentreOnScreen(int dir = wxBOTH) { DoCentre(dir | wxCENTRE_ON_SCREEN); } void CenterOnScreen(int dir = wxBOTH) { CentreOnScreen(dir); } // Get the default size for a new top level window. This is used when // creating a wxTLW under some platforms if no explicit size given. static wxSize GetDefaultSize(); // default item access: we have a permanent default item which is the one // set by the user code but we may also have a temporary default item which // would be chosen if the user pressed "Enter" now but the default action // reverts to the "permanent" default as soon as this temporary default // item loses focus // get the default item, temporary or permanent wxWindow *GetDefaultItem() const { return m_winTmpDefault ? m_winTmpDefault : m_winDefault; } // set the permanent default item, return the old default wxWindow *SetDefaultItem(wxWindow *win) { wxWindow *old = GetDefaultItem(); m_winDefault = win; return old; } // return the temporary default item, can be NULL wxWindow *GetTmpDefaultItem() const { return m_winTmpDefault; } // set a temporary default item, SetTmpDefaultItem(NULL) should be called // soon after a call to SetTmpDefaultItem(window), return the old default wxWindow *SetTmpDefaultItem(wxWindow *win) { wxWindow *old = GetDefaultItem(); m_winTmpDefault = win; return old; } // Class for saving/restoring fields describing the window geometry. // // This class is used by the functions below to allow saving the geometry // of the window and restoring it later. The components describing geometry // are platform-dependent, so there is no struct containing them and // instead the methods of this class are used to save or [try to] restore // whichever components are used under the current platform. class GeometrySerializer { public: virtual ~GeometrySerializer() {} // If saving a field returns false, it's fatal error and SaveGeometry() // will return false. virtual bool SaveField(const wxString& name, int value) const = 0; // If restoring a field returns false, it just means that the field is // not present and RestoreToGeometry() still continues with restoring // the other values. virtual bool RestoreField(const wxString& name, int* value) = 0; }; // Save the current window geometry using the provided serializer and // restore the window to the previously saved geometry. bool SaveGeometry(const GeometrySerializer& ser) const; bool RestoreToGeometry(GeometrySerializer& ser); // implementation only from now on // ------------------------------- // override some base class virtuals virtual bool Destroy() wxOVERRIDE; virtual bool IsTopLevel() const wxOVERRIDE { return true; } virtual bool IsTopNavigationDomain(NavigationKind kind) const wxOVERRIDE; virtual bool IsVisible() const { return IsShown(); } // event handlers void OnCloseWindow(wxCloseEvent& event); void OnSize(wxSizeEvent& WXUNUSED(event)) { DoLayout(); } // Get rect to be used to center top-level children virtual void GetRectForTopLevelChildren(int *x, int *y, int *w, int *h); // this should go away, but for now it's called from docview.cpp, // so should be there for all platforms void OnActivate(wxActivateEvent &WXUNUSED(event)) { } // do the window-specific processing after processing the update event virtual void DoUpdateWindowUI(wxUpdateUIEvent& event) wxOVERRIDE ; // a different API for SetSizeHints virtual void SetMinSize(const wxSize& minSize) wxOVERRIDE; virtual void SetMaxSize(const wxSize& maxSize) wxOVERRIDE; virtual void OSXSetModified(bool modified) { m_modified = modified; } virtual bool OSXIsModified() const { return m_modified; } virtual void SetRepresentedFilename(const wxString& WXUNUSED(filename)) { } protected: // the frame client to screen translation should take account of the // toolbar which may shift the origin of the client area virtual void DoClientToScreen(int *x, int *y) const wxOVERRIDE; virtual void DoScreenToClient(int *x, int *y) const wxOVERRIDE; // add support for wxCENTRE_ON_SCREEN virtual void DoCentre(int dir) wxOVERRIDE; // no need to do client to screen translation to get our position in screen // coordinates: this is already the case virtual void DoGetScreenPosition(int *x, int *y) const wxOVERRIDE { DoGetPosition(x, y); } // test whether this window makes part of the frame // (menubar, toolbar and statusbar are excluded from automatic layout) virtual bool IsOneOfBars(const wxWindow *WXUNUSED(win)) const { return false; } // check if we should exit the program after deleting this window bool IsLastBeforeExit() const; // send the iconize event, return true if processed bool SendIconizeEvent(bool iconized = true); // do TLW-specific layout: we resize our unique child to fill the entire // client area void DoLayout(); static int WidthDefault(int w) { return w == wxDefaultCoord ? GetDefaultSize().x : w; } static int HeightDefault(int h) { return h == wxDefaultCoord ? GetDefaultSize().y : h; } // the frame icon wxIconBundle m_icons; // a default window (usually a button) or NULL wxWindowRef m_winDefault; // a temporary override of m_winDefault, use the latter if NULL wxWindowRef m_winTmpDefault; bool m_modified; wxDECLARE_NO_COPY_CLASS(wxTopLevelWindowBase); wxDECLARE_EVENT_TABLE(); }; // include the real class declaration #if defined(__WXMSW__) #include "wx/msw/toplevel.h" #define wxTopLevelWindowNative wxTopLevelWindowMSW #elif defined(__WXGTK20__) #include "wx/gtk/toplevel.h" #define wxTopLevelWindowNative wxTopLevelWindowGTK #elif defined(__WXGTK__) #include "wx/gtk1/toplevel.h" #define wxTopLevelWindowNative wxTopLevelWindowGTK #elif defined(__WXX11__) #include "wx/x11/toplevel.h" #define wxTopLevelWindowNative wxTopLevelWindowX11 #elif defined(__WXDFB__) #include "wx/dfb/toplevel.h" #define wxTopLevelWindowNative wxTopLevelWindowDFB #elif defined(__WXMAC__) #include "wx/osx/toplevel.h" #define wxTopLevelWindowNative wxTopLevelWindowMac #elif defined(__WXMOTIF__) #include "wx/motif/toplevel.h" #define wxTopLevelWindowNative wxTopLevelWindowMotif #elif defined(__WXQT__) #include "wx/qt/toplevel.h" #define wxTopLevelWindowNative wxTopLevelWindowQt #endif #ifdef __WXUNIVERSAL__ #include "wx/univ/toplevel.h" #else // !__WXUNIVERSAL__ class WXDLLIMPEXP_CORE wxTopLevelWindow : public wxTopLevelWindowNative { public: // construction wxTopLevelWindow() { } wxTopLevelWindow(wxWindow *parent, wxWindowID winid, const wxString& title, const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxDefaultSize, long style = wxDEFAULT_FRAME_STYLE, const wxString& name = wxFrameNameStr) : wxTopLevelWindowNative(parent, winid, title, pos, size, style, name) { } wxDECLARE_DYNAMIC_CLASS_NO_COPY(wxTopLevelWindow); }; #endif // __WXUNIVERSAL__/!__WXUNIVERSAL__ #endif // _WX_TOPLEVEL_BASE_H_
h
rticonnextdds-usecases
data/projects/rticonnextdds-usecases/VehicleTracking/ExampleCode/thirdparty/wxWidgets-3.1.2/Linux/include/wx/build.h
/////////////////////////////////////////////////////////////////////////////// // Name: wx/build.h // Purpose: Runtime build options checking // Author: Vadim Zeitlin, Vaclav Slavik // Modified by: // Created: 07.05.02 // Copyright: (c) 2002 Vadim Zeitlin <[email protected]> // Licence: wxWindows licence /////////////////////////////////////////////////////////////////////////////// #ifndef _WX_BUILD_H_ #define _WX_BUILD_H_ #include "wx/version.h" // NB: This file contains macros for checking binary compatibility of libraries // in multilib builds, plugins and user components. // The WX_BUILD_OPTIONS_SIGNATURE macro expands into string that should // uniquely identify binary compatible builds: i.e. if two builds of the // library are binary compatible, their signature string should be the // same; if two builds are binary incompatible, their signatures should // be different. // // Therefore, wxUSE_XXX flags that affect binary compatibility (vtables, // function signatures) should be accounted for here. So should compilers // and compiler versions (but note that binary compatible compiler versions // such as gcc-2.95.2 and gcc-2.95.3 should have same signature!). // ---------------------------------------------------------------------------- // WX_BUILD_OPTIONS_SIGNATURE // ---------------------------------------------------------------------------- #define __WX_BO_STRINGIZE(x) __WX_BO_STRINGIZE0(x) #define __WX_BO_STRINGIZE0(x) #x #if (wxMINOR_VERSION % 2) == 0 #define __WX_BO_VERSION(x,y,z) \ __WX_BO_STRINGIZE(x) "." __WX_BO_STRINGIZE(y) #else #define __WX_BO_VERSION(x,y,z) \ __WX_BO_STRINGIZE(x) "." __WX_BO_STRINGIZE(y) "." __WX_BO_STRINGIZE(z) #endif #if wxUSE_UNICODE_UTF8 #define __WX_BO_UNICODE "UTF-8" #elif wxUSE_UNICODE_WCHAR #define __WX_BO_UNICODE "wchar_t" #else #define __WX_BO_UNICODE "ANSI" #endif // GCC and Intel C++ share same C++ ABI (and possibly others in the future), // check if compiler versions are compatible: #if defined(__GXX_ABI_VERSION) // All the changes since ABI version 1002 so far have been insignificant, // so just check for this value, first used for g++ 3.4 and used by default // by all g++ 4 versions, as checking for the exact ABI version simply // results in run-time breakage whenever a new gcc version is released, // even if there are no real problems. #if __GXX_ABI_VERSION >= 1002 #define __WX_BO_COMPILER \ ",compiler with C++ ABI compatible with gcc 4" #else #define __WX_BO_COMPILER \ ",compiler with C++ ABI " __WX_BO_STRINGIZE(__GXX_ABI_VERSION) #endif #elif defined(__GNUG__) #define __WX_BO_COMPILER ",GCC " \ __WX_BO_STRINGIZE(__GNUC__) "." __WX_BO_STRINGIZE(__GNUC_MINOR__) #elif defined(__VISUALC__) // VC15 (a.k.a. MSVS 2017) is ABI-compatible with VC14 (MSVS 2015), so use // the same ABI version for both of them. #if _MSC_VER >= 1900 && _MSC_VER < 2000 #define wxMSVC_ABI_VERSION 1900 #else #define wxMSVC_ABI_VERSION _MSC_VER #endif #define __WX_BO_COMPILER ",Visual C++ " __WX_BO_STRINGIZE(wxMSVC_ABI_VERSION) #elif defined(__INTEL_COMPILER) // Notice that this must come after MSVC check as ICC under Windows is // ABI-compatible with the corresponding version of the MSVC and we want to // allow using it compile the application code using MSVC-built DLLs. #define __WX_BO_COMPILER ",Intel C++" #elif defined(__BORLANDC__) #define __WX_BO_COMPILER ",Borland C++" #else #define __WX_BO_COMPILER #endif // WXWIN_COMPATIBILITY macros affect presence of virtual functions #if WXWIN_COMPATIBILITY_2_8 #define __WX_BO_WXWIN_COMPAT_2_8 ",compatible with 2.8" #else #define __WX_BO_WXWIN_COMPAT_2_8 #endif #if WXWIN_COMPATIBILITY_3_0 #define __WX_BO_WXWIN_COMPAT_3_0 ",compatible with 3.0" #else #define __WX_BO_WXWIN_COMPAT_3_0 #endif // deriving wxWin containers from STL ones changes them completely: #if wxUSE_STD_CONTAINERS #define __WX_BO_STL ",STL containers" #else #define __WX_BO_STL ",wx containers" #endif // This macro is passed as argument to wxAppConsole::CheckBuildOptions() #define WX_BUILD_OPTIONS_SIGNATURE \ __WX_BO_VERSION(wxMAJOR_VERSION, wxMINOR_VERSION, wxRELEASE_NUMBER) \ " (" __WX_BO_UNICODE \ __WX_BO_COMPILER \ __WX_BO_STL \ __WX_BO_WXWIN_COMPAT_2_8 __WX_BO_WXWIN_COMPAT_3_0 \ ")" // ---------------------------------------------------------------------------- // WX_CHECK_BUILD_OPTIONS // ---------------------------------------------------------------------------- // Use this macro to check build options. Adding it to a file in DLL will // ensure that the DLL checks build options in same way wxIMPLEMENT_APP() does. #define WX_CHECK_BUILD_OPTIONS(libName) \ static struct wxBuildOptionsChecker \ { \ wxBuildOptionsChecker() \ { \ wxAppConsole::CheckBuildOptions(WX_BUILD_OPTIONS_SIGNATURE, \ libName); \ } \ } gs_buildOptionsCheck; #endif // _WX_BUILD_H_
h
rticonnextdds-usecases
data/projects/rticonnextdds-usecases/VehicleTracking/ExampleCode/thirdparty/wxWidgets-3.1.2/Linux/include/wx/sound.h
///////////////////////////////////////////////////////////////////////////// // Name: wx/sound.h // Purpose: wxSoundBase class // Author: Vaclav Slavik // Modified by: // Created: 2004/02/01 // Copyright: (c) 2004, Vaclav Slavik // Licence: wxWindows licence ///////////////////////////////////////////////////////////////////////////// #ifndef _WX_SOUND_H_BASE_ #define _WX_SOUND_H_BASE_ #include "wx/defs.h" #if wxUSE_SOUND #include "wx/object.h" // ---------------------------------------------------------------------------- // wxSoundBase: common wxSound code and interface // ---------------------------------------------------------------------------- // Flags for wxSound::Play // NB: We can't use enum with some compilers, because they keep reporting // nonexistent ambiguities between Play(unsigned) and static Play(const // wxString&, unsigned). #define wxSOUND_SYNC ((unsigned)0) #define wxSOUND_ASYNC ((unsigned)1) #define wxSOUND_LOOP ((unsigned)2) // Base class for wxSound implementations class WXDLLIMPEXP_ADV wxSoundBase : public wxObject { public: // Play the sound: bool Play(unsigned flags = wxSOUND_ASYNC) const { wxASSERT_MSG( (flags & wxSOUND_LOOP) == 0 || (flags & wxSOUND_ASYNC) != 0, wxT("sound can only be looped asynchronously") ); return DoPlay(flags); } // Plays sound from filename: static bool Play(const wxString& filename, unsigned flags = wxSOUND_ASYNC); protected: virtual bool DoPlay(unsigned flags) const = 0; }; // ---------------------------------------------------------------------------- // wxSound class implementation // ---------------------------------------------------------------------------- #if defined(__WINDOWS__) #include "wx/msw/sound.h" #elif defined(__WXMAC__) #include "wx/osx/sound.h" #elif defined(__UNIX__) #include "wx/unix/sound.h" #endif // ---------------------------------------------------------------------------- // wxSoundBase methods // ---------------------------------------------------------------------------- inline bool wxSoundBase::Play(const wxString& filename, unsigned flags) { wxSound snd(filename); return snd.IsOk() ? snd.Play(flags) : false; } #endif // wxUSE_SOUND #endif // _WX_SOUND_H_BASE_
h
rticonnextdds-usecases
data/projects/rticonnextdds-usecases/VehicleTracking/ExampleCode/thirdparty/wxWidgets-3.1.2/Linux/include/wx/tooltip.h
///////////////////////////////////////////////////////////////////////////// // Name: wx/tooltip.h // Purpose: wxToolTip base header // Author: Robert Roebling // Modified by: // Created: // Copyright: (c) Robert Roebling // Licence: wxWindows licence ///////////////////////////////////////////////////////////////////////////// #ifndef _WX_TOOLTIP_H_BASE_ #define _WX_TOOLTIP_H_BASE_ #include "wx/defs.h" #if wxUSE_TOOLTIPS #if defined(__WXMSW__) #include "wx/msw/tooltip.h" #elif defined(__WXMOTIF__) // #include "wx/motif/tooltip.h" #elif defined(__WXGTK20__) #include "wx/gtk/tooltip.h" #elif defined(__WXGTK__) #include "wx/gtk1/tooltip.h" #elif defined(__WXMAC__) #include "wx/osx/tooltip.h" #elif defined(__WXQT__) #include "wx/qt/tooltip.h" #endif #endif // wxUSE_TOOLTIPS #endif // _WX_TOOLTIP_H_BASE_
h
rticonnextdds-usecases
data/projects/rticonnextdds-usecases/VehicleTracking/ExampleCode/thirdparty/wxWidgets-3.1.2/Linux/include/wx/vscroll.h
///////////////////////////////////////////////////////////////////////////// // Name: wx/vscroll.h // Purpose: Variable scrolled windows (wx[V/H/HV]ScrolledWindow) // Author: Vadim Zeitlin // Modified by: Brad Anderson, Bryan Petty // Created: 30.05.03 // Copyright: (c) 2003 Vadim Zeitlin <[email protected]> // Licence: wxWindows licence ///////////////////////////////////////////////////////////////////////////// #ifndef _WX_VSCROLL_H_ #define _WX_VSCROLL_H_ #include "wx/panel.h" #include "wx/position.h" #include "wx/scrolwin.h" class WXDLLIMPEXP_FWD_CORE wxVarScrollHelperEvtHandler; // Using the same techniques as the wxScrolledWindow class | // hierarchy, the wx[V/H/HV]ScrolledWindow classes are slightly | // more complex (compare with the diagram outlined in | // scrolwin.h) for the purpose of reducing code duplication | // through the use of mix-in classes. | // | // wxAnyScrollHelperBase | // | | // | | // | | // V | // wxVarScrollHelperBase | // / \ | // / \ | // V V | // wxVarHScrollHelper wxVarVScrollHelper | // | \ / | | // | \ / | | // | V V | | // | wxVarHVScrollHelper | | // | | | | // | | V | // | wxPanel | wxVarVScrollLegacyAdaptor | // | / \ \ | | | // | / \ `-----|----------. | | // | / \ | \ | | // | / \ | \ | | // V V \ | V V | // wxHScrolledWindow \ | wxVScrolledWindow | // V V | // wxHVScrolledWindow | // | // | // Border added to suppress GCC multi-line comment warnings ->| // =========================================================================== // wxVarScrollHelperBase // =========================================================================== // Provides all base common scroll calculations needed for either orientation, // automatic scrollbar functionality, saved scroll positions, functionality // for changing the target window to be scrolled, as well as defining all // required virtual functions that need to be implemented for any orientation // specific work. class WXDLLIMPEXP_CORE wxVarScrollHelperBase : public wxAnyScrollHelperBase { public: // constructors and such // --------------------- wxVarScrollHelperBase(wxWindow *winToScroll); virtual ~wxVarScrollHelperBase(); // operations // ---------- // with physical scrolling on, the device origin is changed properly when // a wxPaintDC is prepared, children are actually moved and laid out // properly, and the contents of the window (pixels) are actually moved void EnablePhysicalScrolling(bool scrolling = true) { m_physicalScrolling = scrolling; } // wxNOT_FOUND if none, i.e. if it is below the last item int VirtualHitTest(wxCoord coord) const; // recalculate all our parameters and redisplay all units virtual void RefreshAll(); // accessors // --------- // get the first currently visible unit size_t GetVisibleBegin() const { return m_unitFirst; } // get the last currently visible unit size_t GetVisibleEnd() const { return m_unitFirst + m_nUnitsVisible; } // is this unit currently visible? bool IsVisible(size_t unit) const { return unit >= m_unitFirst && unit < GetVisibleEnd(); } // translate between scrolled and unscrolled coordinates int CalcScrolledPosition(int coord) const { return DoCalcScrolledPosition(coord); } int CalcUnscrolledPosition(int coord) const { return DoCalcUnscrolledPosition(coord); } virtual int DoCalcScrolledPosition(int coord) const; virtual int DoCalcUnscrolledPosition(int coord) const; // update the thumb size shown by the scrollbar virtual void UpdateScrollbar(); void RemoveScrollbar(); // Normally the wxScrolledWindow will scroll itself, but in some rare // occasions you might want it to scroll [part of] another window (e.g. a // child of it in order to scroll only a portion the area between the // scrollbars (spreadsheet: only cell area will move). virtual void SetTargetWindow(wxWindow *target); // change the DC origin according to the scroll position. To properly // forward calls to wxWindow::Layout use WX_FORWARD_TO_SCROLL_HELPER() // derived class virtual void DoPrepareDC(wxDC& dc) wxOVERRIDE; // the methods to be called from the window event handlers void HandleOnScroll(wxScrollWinEvent& event); void HandleOnSize(wxSizeEvent& event); #if wxUSE_MOUSEWHEEL void HandleOnMouseWheel(wxMouseEvent& event); #endif // wxUSE_MOUSEWHEEL // these functions must be overidden in the derived class to return // orientation specific data (e.g. the width for vertically scrolling // derivatives in the case of GetOrientationTargetSize()) virtual int GetOrientationTargetSize() const = 0; virtual int GetNonOrientationTargetSize() const = 0; virtual wxOrientation GetOrientation() const = 0; protected: // all *Unit* functions are protected to be exposed by // wxVarScrollHelperBase implementations (with appropriate names) // get the number of units this window contains (previously set by // SetUnitCount()) size_t GetUnitCount() const { return m_unitMax; } // set the number of units the helper contains: the derived class must // provide the sizes for all units with indices up to the one given here // in its OnGetUnitSize() void SetUnitCount(size_t count); // redraw the specified unit virtual void RefreshUnit(size_t unit); // redraw all units in the specified range (inclusive) virtual void RefreshUnits(size_t from, size_t to); // scroll to the specified unit: it will become the first visible unit in // the window // // return true if we scrolled the window, false if nothing was done bool DoScrollToUnit(size_t unit); // scroll by the specified number of units/pages virtual bool DoScrollUnits(int units); virtual bool DoScrollPages(int pages); // this function must be overridden in the derived class and it should // return the size of the given unit in pixels virtual wxCoord OnGetUnitSize(size_t n) const = 0; // this function doesn't have to be overridden but it may be useful to do // it if calculating the units' sizes is a relatively expensive operation // as it gives the user code a possibility to calculate several of them at // once // // OnGetUnitsSizeHint() is normally called just before OnGetUnitSize() but // you shouldn't rely on the latter being called for all units in the // interval specified here. It is also possible that OnGetUnitHeight() will // be called for the units outside of this interval, so this is really just // a hint, not a promise. // // finally note that unitMin is inclusive, while unitMax is exclusive, as // usual virtual void OnGetUnitsSizeHint(size_t WXUNUSED(unitMin), size_t WXUNUSED(unitMax)) const { } // when the number of units changes, we try to estimate the total size // of all units which is a rather expensive operation in terms of unit // access, so if the user code may estimate the average size // better/faster than we do, it should override this function to implement // its own logic // // this function should return the best guess for the total size it may // make virtual wxCoord EstimateTotalSize() const { return DoEstimateTotalSize(); } wxCoord DoEstimateTotalSize() const; // find the index of the unit we need to show to fit the specified unit on // the opposite side either fully or partially (depending on fullyVisible) size_t FindFirstVisibleFromLast(size_t last, bool fullyVisible = false) const; // get the total size of the units between unitMin (inclusive) and // unitMax (exclusive) wxCoord GetUnitsSize(size_t unitMin, size_t unitMax) const; // get the offset of the first visible unit wxCoord GetScrollOffset() const { return GetUnitsSize(0, GetVisibleBegin()); } // get the size of the target window wxSize GetTargetSize() const { return m_targetWindow->GetClientSize(); } void GetTargetSize(int *w, int *h) { wxSize size = GetTargetSize(); if ( w ) *w = size.x; if ( h ) *h = size.y; } // calculate the new scroll position based on scroll event type size_t GetNewScrollPosition(wxScrollWinEvent& event) const; // replacement implementation of wxWindow::Layout virtual method. To // properly forward calls to wxWindow::Layout use // WX_FORWARD_TO_SCROLL_HELPER() derived class bool ScrollLayout(); #ifdef __WXMAC__ // queue mac window update after handling scroll event virtual void UpdateMacScrollWindow() { } #endif // __WXMAC__ // change the target window void DoSetTargetWindow(wxWindow *target); // delete the event handler we installed void DeleteEvtHandler(); // helper function abstracting the orientation test: with vertical // orientation, it assigns the first value to x and the second one to y, // with horizontal orientation it reverses them, i.e. the first value is // assigned to y and the second one to x void AssignOrient(wxCoord& x, wxCoord& y, wxCoord first, wxCoord second); // similar to "oriented assignment" above but does "oriented increment": // for vertical orientation, y is incremented by the given value and x if // left unchanged, for horizontal orientation x is incremented void IncOrient(wxCoord& x, wxCoord& y, wxCoord inc); private: // the total number of (logical) units size_t m_unitMax; // the total (estimated) size wxCoord m_sizeTotal; // the first currently visible unit size_t m_unitFirst; // the number of currently visible units (including the last, possibly only // partly, visible one) size_t m_nUnitsVisible; // accumulated mouse wheel rotation #if wxUSE_MOUSEWHEEL int m_sumWheelRotation; #endif // do child scrolling (used in DoPrepareDC()) bool m_physicalScrolling; // handler injected into target window to forward some useful events to us wxVarScrollHelperEvtHandler *m_handler; }; // =========================================================================== // wxVarVScrollHelper // =========================================================================== // Provides public API functions targeted for vertical-specific scrolling, // wrapping the functionality of wxVarScrollHelperBase. class WXDLLIMPEXP_CORE wxVarVScrollHelper : public wxVarScrollHelperBase { public: // constructors and such // --------------------- // ctor must be given the associated window wxVarVScrollHelper(wxWindow *winToScroll) : wxVarScrollHelperBase(winToScroll) { } // operators void SetRowCount(size_t rowCount) { SetUnitCount(rowCount); } bool ScrollToRow(size_t row) { return DoScrollToUnit(row); } virtual bool ScrollRows(int rows) { return DoScrollUnits(rows); } virtual bool ScrollRowPages(int pages) { return DoScrollPages(pages); } virtual void RefreshRow(size_t row) { RefreshUnit(row); } virtual void RefreshRows(size_t from, size_t to) { RefreshUnits(from, to); } // accessors size_t GetRowCount() const { return GetUnitCount(); } size_t GetVisibleRowsBegin() const { return GetVisibleBegin(); } size_t GetVisibleRowsEnd() const { return GetVisibleEnd(); } bool IsRowVisible(size_t row) const { return IsVisible(row); } virtual int GetOrientationTargetSize() const wxOVERRIDE { return GetTargetWindow()->GetClientSize().y; } virtual int GetNonOrientationTargetSize() const wxOVERRIDE { return GetTargetWindow()->GetClientSize().x; } virtual wxOrientation GetOrientation() const wxOVERRIDE { return wxVERTICAL; } protected: // this function must be overridden in the derived class and it should // return the size of the given row in pixels virtual wxCoord OnGetRowHeight(size_t n) const = 0; wxCoord OnGetUnitSize(size_t n) const wxOVERRIDE { return OnGetRowHeight(n); } virtual void OnGetRowsHeightHint(size_t WXUNUSED(rowMin), size_t WXUNUSED(rowMax)) const { } // forward calls to OnGetRowsHeightHint() virtual void OnGetUnitsSizeHint(size_t unitMin, size_t unitMax) const wxOVERRIDE { OnGetRowsHeightHint(unitMin, unitMax); } // again, if not overridden, it will fall back on default method virtual wxCoord EstimateTotalHeight() const { return DoEstimateTotalSize(); } // forward calls to EstimateTotalHeight() virtual wxCoord EstimateTotalSize() const wxOVERRIDE { return EstimateTotalHeight(); } wxCoord GetRowsHeight(size_t rowMin, size_t rowMax) const { return GetUnitsSize(rowMin, rowMax); } }; // =========================================================================== // wxVarHScrollHelper // =========================================================================== // Provides public API functions targeted for horizontal-specific scrolling, // wrapping the functionality of wxVarScrollHelperBase. class WXDLLIMPEXP_CORE wxVarHScrollHelper : public wxVarScrollHelperBase { public: // constructors and such // --------------------- // ctor must be given the associated window wxVarHScrollHelper(wxWindow *winToScroll) : wxVarScrollHelperBase(winToScroll) { } // operators void SetColumnCount(size_t columnCount) { SetUnitCount(columnCount); } bool ScrollToColumn(size_t column) { return DoScrollToUnit(column); } virtual bool ScrollColumns(int columns) { return DoScrollUnits(columns); } virtual bool ScrollColumnPages(int pages) { return DoScrollPages(pages); } virtual void RefreshColumn(size_t column) { RefreshUnit(column); } virtual void RefreshColumns(size_t from, size_t to) { RefreshUnits(from, to); } // accessors size_t GetColumnCount() const { return GetUnitCount(); } size_t GetVisibleColumnsBegin() const { return GetVisibleBegin(); } size_t GetVisibleColumnsEnd() const { return GetVisibleEnd(); } bool IsColumnVisible(size_t column) const { return IsVisible(column); } virtual int GetOrientationTargetSize() const wxOVERRIDE { return GetTargetWindow()->GetClientSize().x; } virtual int GetNonOrientationTargetSize() const wxOVERRIDE { return GetTargetWindow()->GetClientSize().y; } virtual wxOrientation GetOrientation() const wxOVERRIDE { return wxHORIZONTAL; } protected: // this function must be overridden in the derived class and it should // return the size of the given column in pixels virtual wxCoord OnGetColumnWidth(size_t n) const = 0; wxCoord OnGetUnitSize(size_t n) const wxOVERRIDE { return OnGetColumnWidth(n); } virtual void OnGetColumnsWidthHint(size_t WXUNUSED(columnMin), size_t WXUNUSED(columnMax)) const { } // forward calls to OnGetColumnsWidthHint() virtual void OnGetUnitsSizeHint(size_t unitMin, size_t unitMax) const wxOVERRIDE { OnGetColumnsWidthHint(unitMin, unitMax); } // again, if not overridden, it will fall back on default method virtual wxCoord EstimateTotalWidth() const { return DoEstimateTotalSize(); } // forward calls to EstimateTotalWidth() virtual wxCoord EstimateTotalSize() const wxOVERRIDE { return EstimateTotalWidth(); } wxCoord GetColumnsWidth(size_t columnMin, size_t columnMax) const { return GetUnitsSize(columnMin, columnMax); } }; // =========================================================================== // wxVarHVScrollHelper // =========================================================================== // Provides public API functions targeted at functions with similar names in // both wxVScrollHelper and wxHScrollHelper so class scope doesn't need to be // specified (since we are using multiple inheritance). It also provides // functions to make changing values for both orientations at the same time // easier. class WXDLLIMPEXP_CORE wxVarHVScrollHelper : public wxVarVScrollHelper, public wxVarHScrollHelper { public: // constructors and such // --------------------- // ctor must be given the associated window wxVarHVScrollHelper(wxWindow *winToScroll) : wxVarVScrollHelper(winToScroll), wxVarHScrollHelper(winToScroll) { } // operators // --------- // set the number of units the window contains for each axis: the derived // class must provide the widths and heights for all units with indices up // to each of the one given here in its OnGetColumnWidth() and // OnGetRowHeight() void SetRowColumnCount(size_t rowCount, size_t columnCount); // with physical scrolling on, the device origin is changed properly when // a wxPaintDC is prepared, children are actually moved and laid out // properly, and the contents of the window (pixels) are actually moved void EnablePhysicalScrolling(bool vscrolling = true, bool hscrolling = true) { wxVarVScrollHelper::EnablePhysicalScrolling(vscrolling); wxVarHScrollHelper::EnablePhysicalScrolling(hscrolling); } // scroll to the specified row/column: it will become the first visible // cell in the window // // return true if we scrolled the window, false if nothing was done bool ScrollToRowColumn(size_t row, size_t column); bool ScrollToRowColumn(const wxPosition &pos) { return ScrollToRowColumn(pos.GetRow(), pos.GetColumn()); } // redraw the specified cell virtual void RefreshRowColumn(size_t row, size_t column); virtual void RefreshRowColumn(const wxPosition &pos) { RefreshRowColumn(pos.GetRow(), pos.GetColumn()); } // redraw the specified regions (inclusive). If the target window for // both orientations is the same the rectangle of cells is refreshed; if // the target windows differ the entire client size opposite the // orientation direction is refreshed between the specified limits virtual void RefreshRowsColumns(size_t fromRow, size_t toRow, size_t fromColumn, size_t toColumn); virtual void RefreshRowsColumns(const wxPosition& from, const wxPosition& to) { RefreshRowsColumns(from.GetRow(), to.GetRow(), from.GetColumn(), to.GetColumn()); } // locate the virtual position from the given device coordinates wxPosition VirtualHitTest(wxCoord x, wxCoord y) const; wxPosition VirtualHitTest(const wxPoint &pos) const { return VirtualHitTest(pos.x, pos.y); } // change the DC origin according to the scroll position. To properly // forward calls to wxWindow::Layout use WX_FORWARD_TO_SCROLL_HELPER() // derived class. We use this version to call both base classes' // DoPrepareDC() virtual void DoPrepareDC(wxDC& dc) wxOVERRIDE; // replacement implementation of wxWindow::Layout virtual method. To // properly forward calls to wxWindow::Layout use // WX_FORWARD_TO_SCROLL_HELPER() derived class. We use this version to // call both base classes' ScrollLayout() bool ScrollLayout(); // accessors // --------- // get the number of units this window contains (previously set by // Set[Column/Row/RowColumn/Unit]Count()) wxSize GetRowColumnCount() const; // get the first currently visible units wxPosition GetVisibleBegin() const; wxPosition GetVisibleEnd() const; // is this cell currently visible? bool IsVisible(size_t row, size_t column) const; bool IsVisible(const wxPosition &pos) const { return IsVisible(pos.GetRow(), pos.GetColumn()); } }; #if WXWIN_COMPATIBILITY_2_8 // =========================================================================== // wxVarVScrollLegacyAdaptor // =========================================================================== // Provides backwards compatible API for applications originally built using // wxVScrolledWindow in 2.6 or 2.8. Originally, wxVScrolledWindow referred // to scrolling "lines". We use "units" in wxVarScrollHelperBase to avoid // implying any orientation (since the functions are used for both horizontal // and vertical scrolling in derived classes). And in the new // wxVScrolledWindow and wxHScrolledWindow classes, we refer to them as // "rows" and "columns", respectively. This is to help clear some confusion // in not only those classes, but also in wxHVScrolledWindow where functions // are inherited from both. class WXDLLIMPEXP_CORE wxVarVScrollLegacyAdaptor : public wxVarVScrollHelper { public: // constructors and such // --------------------- wxVarVScrollLegacyAdaptor(wxWindow *winToScroll) : wxVarVScrollHelper(winToScroll) { } // accessors // --------- // this is the same as GetVisibleRowsBegin(), exists to match // GetLastVisibleLine() and for backwards compatibility only wxDEPRECATED( size_t GetFirstVisibleLine() const ); // get the last currently visible line // // this function is unsafe as it returns (size_t)-1 (i.e. a huge positive // number) if the control is empty, use GetVisibleRowsEnd() instead, this // one is kept for backwards compatibility wxDEPRECATED( size_t GetLastVisibleLine() const ); // "line" to "unit" compatibility functions // ---------------------------------------- // get the number of lines this window contains (set by SetLineCount()) wxDEPRECATED( size_t GetLineCount() const ); // set the number of lines the helper contains: the derived class must // provide the sizes for all lines with indices up to the one given here // in its OnGetLineHeight() wxDEPRECATED( void SetLineCount(size_t count) ); // redraw the specified line wxDEPRECATED( virtual void RefreshLine(size_t line) ); // redraw all lines in the specified range (inclusive) wxDEPRECATED( virtual void RefreshLines(size_t from, size_t to) ); // scroll to the specified line: it will become the first visible line in // the window // // return true if we scrolled the window, false if nothing was done wxDEPRECATED( bool ScrollToLine(size_t line) ); // scroll by the specified number of lines/pages wxDEPRECATED( virtual bool ScrollLines(int lines) ); wxDEPRECATED( virtual bool ScrollPages(int pages) ); protected: // unless the code has been updated to override OnGetRowHeight() instead, // this function must be overridden in the derived class and it should // return the height of the given row in pixels wxDEPRECATED_BUT_USED_INTERNALLY( virtual wxCoord OnGetLineHeight(size_t n) const ); // forwards the calls from base class pure virtual function to pure virtual // OnGetLineHeight instead (backwards compatible name) // note that we don't need to forward OnGetUnitSize() as it is already // forwarded to OnGetRowHeight() in wxVarVScrollHelper virtual wxCoord OnGetRowHeight(size_t n) const; // this function doesn't have to be overridden but it may be useful to do // it if calculating the lines heights is a relatively expensive operation // as it gives the user code a possibility to calculate several of them at // once // // OnGetLinesHint() is normally called just before OnGetLineHeight() but you // shouldn't rely on the latter being called for all lines in the interval // specified here. It is also possible that OnGetLineHeight() will be // called for the lines outside of this interval, so this is really just a // hint, not a promise. // // finally note that lineMin is inclusive, while lineMax is exclusive, as // usual wxDEPRECATED_BUT_USED_INTERNALLY( virtual void OnGetLinesHint( size_t lineMin, size_t lineMax) const ); // forwards the calls from base class pure virtual function to pure virtual // OnGetLinesHint instead (backwards compatible name) void OnGetRowsHeightHint(size_t rowMin, size_t rowMax) const; }; #else // !WXWIN_COMPATIBILITY_2_8 // shortcut to avoid checking compatibility modes later // remove this and all references to wxVarVScrollLegacyAdaptor once // wxWidgets 2.6 and 2.8 compatibility is removed typedef wxVarVScrollHelper wxVarVScrollLegacyAdaptor; #endif // WXWIN_COMPATIBILITY_2_8/!WXWIN_COMPATIBILITY_2_8 // this macro must be used in declaration of wxVarScrollHelperBase-derived // classes #define WX_FORWARD_TO_VAR_SCROLL_HELPER() \ public: \ virtual void PrepareDC(wxDC& dc) wxOVERRIDE { DoPrepareDC(dc); } \ virtual bool Layout() wxOVERRIDE { return ScrollLayout(); } // =========================================================================== // wxVScrolledWindow // =========================================================================== // In the name of this class, "V" may stand for "variable" because it can be // used for scrolling rows of variable heights; "virtual", because it is not // necessary to know the heights of all rows in advance -- only those which // are shown on the screen need to be measured; or even "vertical", because // this class only supports scrolling vertically. // In any case, this is a generalization of the wxScrolledWindow class which // can be only used when all rows have the same heights. It lacks some other // wxScrolledWindow features however, notably it can't scroll only a rectangle // of the window and not its entire client area. class WXDLLIMPEXP_CORE wxVScrolledWindow : public wxPanel, public wxVarVScrollLegacyAdaptor { public: // constructors and such // --------------------- // default ctor, you must call Create() later wxVScrolledWindow() : wxVarVScrollLegacyAdaptor(this) { } // normal ctor, no need to call Create() after this one // // note that wxVSCROLL is always automatically added to our style, there is // no need to specify it explicitly wxVScrolledWindow(wxWindow *parent, wxWindowID id = wxID_ANY, const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxDefaultSize, long style = 0, const wxString& name = wxPanelNameStr) : wxVarVScrollLegacyAdaptor(this) { (void)Create(parent, id, pos, size, style, name); } // same as the previous ctor but returns status code: true if ok // // just as with the ctor above, wxVSCROLL style is always used, there is no // need to specify it bool Create(wxWindow *parent, wxWindowID id = wxID_ANY, const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxDefaultSize, long style = 0, const wxString& name = wxPanelNameStr) { return wxPanel::Create(parent, id, pos, size, style | wxVSCROLL, name); } #if WXWIN_COMPATIBILITY_2_8 // Make sure we prefer our version of HitTest rather than wxWindow's // These functions should no longer be masked in favor of VirtualHitTest() int HitTest(wxCoord WXUNUSED(x), wxCoord y) const { return wxVarVScrollHelper::VirtualHitTest(y); } int HitTest(const wxPoint& pt) const { return HitTest(pt.x, pt.y); } #endif // WXWIN_COMPATIBILITY_2_8 WX_FORWARD_TO_VAR_SCROLL_HELPER() #ifdef __WXMAC__ protected: virtual void UpdateMacScrollWindow() wxOVERRIDE { Update(); } #endif // __WXMAC__ private: wxDECLARE_NO_COPY_CLASS(wxVScrolledWindow); wxDECLARE_ABSTRACT_CLASS(wxVScrolledWindow); }; // =========================================================================== // wxHScrolledWindow // =========================================================================== // In the name of this class, "H" stands for "horizontal" because it can be // used for scrolling columns of variable widths. It is not necessary to know // the widths of all columns in advance -- only those which are shown on the // screen need to be measured. // This is a generalization of the wxScrolledWindow class which can be only // used when all columns have the same width. It lacks some other // wxScrolledWindow features however, notably it can't scroll only a rectangle // of the window and not its entire client area. class WXDLLIMPEXP_CORE wxHScrolledWindow : public wxPanel, public wxVarHScrollHelper { public: // constructors and such // --------------------- // default ctor, you must call Create() later wxHScrolledWindow() : wxVarHScrollHelper(this) { } // normal ctor, no need to call Create() after this one // // note that wxHSCROLL is always automatically added to our style, there is // no need to specify it explicitly wxHScrolledWindow(wxWindow *parent, wxWindowID id = wxID_ANY, const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxDefaultSize, long style = 0, const wxString& name = wxPanelNameStr) : wxVarHScrollHelper(this) { (void)Create(parent, id, pos, size, style, name); } // same as the previous ctor but returns status code: true if ok // // just as with the ctor above, wxHSCROLL style is always used, there is no // need to specify it bool Create(wxWindow *parent, wxWindowID id = wxID_ANY, const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxDefaultSize, long style = 0, const wxString& name = wxPanelNameStr) { return wxPanel::Create(parent, id, pos, size, style | wxHSCROLL, name); } WX_FORWARD_TO_VAR_SCROLL_HELPER() #ifdef __WXMAC__ protected: virtual void UpdateMacScrollWindow() wxOVERRIDE { Update(); } #endif // __WXMAC__ private: wxDECLARE_NO_COPY_CLASS(wxHScrolledWindow); wxDECLARE_ABSTRACT_CLASS(wxHScrolledWindow); }; // =========================================================================== // wxHVScrolledWindow // =========================================================================== // This window inherits all functionality of both vertical and horizontal // scrolled windows automatically handling everything needed to scroll both // axis simultaneously. class WXDLLIMPEXP_CORE wxHVScrolledWindow : public wxPanel, public wxVarHVScrollHelper { public: // constructors and such // --------------------- // default ctor, you must call Create() later wxHVScrolledWindow() : wxPanel(), wxVarHVScrollHelper(this) { } // normal ctor, no need to call Create() after this one // // note that wxVSCROLL and wxHSCROLL are always automatically added to our // style, there is no need to specify them explicitly wxHVScrolledWindow(wxWindow *parent, wxWindowID id = wxID_ANY, const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxDefaultSize, long style = 0, const wxString& name = wxPanelNameStr) : wxPanel(), wxVarHVScrollHelper(this) { (void)Create(parent, id, pos, size, style, name); } // same as the previous ctor but returns status code: true if ok // // just as with the ctor above, wxVSCROLL and wxHSCROLL styles are always // used, there is no need to specify them bool Create(wxWindow *parent, wxWindowID id = wxID_ANY, const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxDefaultSize, long style = 0, const wxString& name = wxPanelNameStr) { return wxPanel::Create(parent, id, pos, size, style | wxVSCROLL | wxHSCROLL, name); } WX_FORWARD_TO_VAR_SCROLL_HELPER() #ifdef __WXMAC__ protected: virtual void UpdateMacScrollWindow() wxOVERRIDE { Update(); } #endif // __WXMAC__ private: wxDECLARE_NO_COPY_CLASS(wxHVScrolledWindow); wxDECLARE_ABSTRACT_CLASS(wxHVScrolledWindow); }; #endif // _WX_VSCROLL_H_
h
rticonnextdds-usecases
data/projects/rticonnextdds-usecases/VehicleTracking/ExampleCode/thirdparty/wxWidgets-3.1.2/Linux/include/wx/stattext.h
///////////////////////////////////////////////////////////////////////////// // Name: wx/stattext.h // Purpose: wxStaticText base header // Author: Julian Smart // Modified by: // Created: // Copyright: (c) Julian Smart // Licence: wxWindows licence ///////////////////////////////////////////////////////////////////////////// #ifndef _WX_STATTEXT_H_BASE_ #define _WX_STATTEXT_H_BASE_ #include "wx/defs.h" #if wxUSE_STATTEXT #include "wx/control.h" /* * wxStaticText flags */ #define wxST_NO_AUTORESIZE 0x0001 // free 0x0002 bit #define wxST_ELLIPSIZE_START 0x0004 #define wxST_ELLIPSIZE_MIDDLE 0x0008 #define wxST_ELLIPSIZE_END 0x0010 #define wxST_ELLIPSIZE_MASK \ (wxST_ELLIPSIZE_START | wxST_ELLIPSIZE_MIDDLE | wxST_ELLIPSIZE_END) extern WXDLLIMPEXP_DATA_CORE(const char) wxStaticTextNameStr[]; class WXDLLIMPEXP_CORE wxStaticTextBase : public wxControl { public: wxStaticTextBase() { } // wrap the text of the control so that no line is longer than the given // width (if possible: this function won't break words) // This function will modify the value returned by GetLabel()! void Wrap(int width); // overridden base virtuals virtual bool AcceptsFocus() const wxOVERRIDE { return false; } virtual bool HasTransparentBackground() wxOVERRIDE { return true; } bool IsEllipsized() const { return (GetWindowStyle() & wxST_ELLIPSIZE_MASK) != 0; } protected: // functions required for wxST_ELLIPSIZE_* support // choose the default border for this window virtual wxBorder GetDefaultBorder() const wxOVERRIDE { return wxBORDER_NONE; } // Calls Ellipsize() on the real label if necessary. Unlike GetLabelText(), // keeps the mnemonics instead of removing them. virtual wxString GetEllipsizedLabel() const; // Replaces parts of the string with ellipsis according to the ellipsize // style. Shouldn't be called if we don't have any. wxString Ellipsize(const wxString& label) const; // to be called when updating the size of the static text: // updates the label redoing ellipsization calculations void UpdateLabel(); // These functions are platform-specific and must be overridden in ports // which do not natively support ellipsization and they must be implemented // in a way so that the m_labelOrig member of wxControl is not touched: // returns the real label currently displayed inside the control. virtual wxString DoGetLabel() const { return wxEmptyString; } // sets the real label currently displayed inside the control, // _without_ invalidating the size. The text passed is always markup-free // but may contain the mnemonic characters. virtual void DoSetLabel(const wxString& WXUNUSED(str)) { } // Update the current size to match the best size unless wxST_NO_AUTORESIZE // style is explicitly used. void AutoResizeIfNecessary(); private: wxDECLARE_NO_COPY_CLASS(wxStaticTextBase); }; // see wx/generic/stattextg.h for the explanation #ifndef wxNO_PORT_STATTEXT_INCLUDE #if defined(__WXUNIVERSAL__) #include "wx/univ/stattext.h" #elif defined(__WXMSW__) #include "wx/msw/stattext.h" #elif defined(__WXMOTIF__) #include "wx/motif/stattext.h" #elif defined(__WXGTK20__) #include "wx/gtk/stattext.h" #elif defined(__WXGTK__) #include "wx/gtk1/stattext.h" #elif defined(__WXMAC__) #include "wx/osx/stattext.h" #elif defined(__WXQT__) #include "wx/qt/stattext.h" #endif #endif // !wxNO_PORT_STATTEXT_INCLUDE #endif // wxUSE_STATTEXT #endif // _WX_STATTEXT_H_BASE_
h
rticonnextdds-usecases
data/projects/rticonnextdds-usecases/VehicleTracking/ExampleCode/thirdparty/wxWidgets-3.1.2/Linux/include/wx/wxcrtvararg.h
/////////////////////////////////////////////////////////////////////////////// // Name: wx/wxcrtvararg.h // Purpose: Type-safe ANSI and Unicode builds compatible wrappers for // printf(), scanf() and related CRT functions // Author: Joel Farley, Ove Kåven // Modified by: Vadim Zeitlin, Robert Roebling, Ron Lee // Created: 2007-02-19 // Copyright: (c) 2007 REA Elektronik GmbH // Licence: wxWindows licence /////////////////////////////////////////////////////////////////////////////// #ifndef _WX_WXCRTVARARG_H_ #define _WX_WXCRTVARARG_H_ // NB: User code should include wx/crt.h instead of including this // header directly. #include "wx/wxcrt.h" #include "wx/strvararg.h" #include "wx/string.h" // ---------------------------------------------------------------------------- // CRT functions aliases // ---------------------------------------------------------------------------- /* Required for wxPrintf() etc */ #include <stdarg.h> /* printf() family saga */ /* For many old Unix systems [v]snprintf()/vsscanf() exists in the system libraries but not in the headers, so we need to declare it ourselves to be able to use it. */ #ifdef __UNIX__ #if defined(HAVE_VSNPRINTF) && !defined(HAVE_VSNPRINTF_DECL) #ifdef __cplusplus extern "C" #else extern #endif int vsnprintf(char *str, size_t size, const char *format, va_list ap); #endif /* !HAVE_VSNPRINTF_DECL */ #if defined(HAVE_SNPRINTF) && !defined(HAVE_SNPRINTF_DECL) #ifdef __cplusplus extern "C" #else extern #endif int snprintf(char *str, size_t size, const char *format, ...); #endif /* !HAVE_SNPRINTF_DECL */ #if defined(HAVE_VSSCANF) && !defined(HAVE_VSSCANF_DECL) #ifdef __cplusplus extern "C" #else extern #endif int vsscanf(const char *str, const char *format, va_list ap); #endif /* !HAVE_VSSCANF_DECL */ /* Wrapper for vsnprintf if it's 3rd parameter is non-const. Note: the * same isn't done for snprintf below, the builtin wxSnprintf_ is used * instead since it's already a simple wrapper */ #if defined __cplusplus && defined HAVE_BROKEN_VSNPRINTF_DECL inline int wx_fixed_vsnprintf(char *str, size_t size, const char *format, va_list ap) { return vsnprintf(str, size, (char*)format, ap); } #endif #endif /* __UNIX__ */ /* mingw32 normally uses MSVCRT which has non-standard vswprintf() and so normally _vsnwprintf() is used instead, the only exception is when mingw32 is used with STLPort which does have a standard vswprintf() starting from version 5.1 which we can use. */ #ifdef __MINGW32__ #if defined(_STLPORT_VERSION) && _STLPORT_VERSION >= 0x510 #ifndef HAVE_VSWPRINTF #define HAVE_VSWPRINTF #endif #elif defined(HAVE_VSWPRINTF) /* can't use non-standard vswprintf() */ #undef HAVE_VSWPRINTF #endif #endif /* __MINGW32__ */ #if wxUSE_PRINTF_POS_PARAMS /* The systems where vsnprintf() supports positional parameters should define the HAVE_UNIX98_PRINTF symbol. On systems which don't (e.g. Windows) we are forced to use our wxVsnprintf() implementation. */ #if defined(HAVE_UNIX98_PRINTF) #ifdef HAVE_VSWPRINTF #define wxCRT_VsnprintfW vswprintf #endif #ifdef HAVE_BROKEN_VSNPRINTF_DECL #define wxCRT_VsnprintfA wx_fixed_vsnprintf #else #define wxCRT_VsnprintfA vsnprintf #endif #else /* !HAVE_UNIX98_PRINTF */ /* The only compiler with positional parameters support under Windows is VC++ 8.0 which provides a new xxprintf_p() functions family. The 2003 PSDK includes a slightly earlier version of VC8 than the main release and does not have the printf_p functions. */ #if defined _MSC_FULL_VER && _MSC_FULL_VER >= 140050727 #define wxCRT_VsnprintfA _vsprintf_p #define wxCRT_VsnprintfW _vswprintf_p #endif #endif /* HAVE_UNIX98_PRINTF/!HAVE_UNIX98_PRINTF */ #else /* !wxUSE_PRINTF_POS_PARAMS */ /* We always want to define safe snprintf() function to be used instead of sprintf(). Some compilers already have it (or rather vsnprintf() which we really need...), otherwise we implement it using our own printf() code. We define function with a trailing underscore here because the real one is a wrapper around it as explained below */ #if defined(__VISUALC__) || \ (defined(__BORLANDC__) && __BORLANDC__ >= 0x540) #define wxCRT_VsnprintfA _vsnprintf #define wxCRT_VsnprintfW _vsnwprintf #else #if defined(HAVE__VSNWPRINTF) #define wxCRT_VsnprintfW _vsnwprintf #elif defined(HAVE_VSWPRINTF) #define wxCRT_VsnprintfW vswprintf #endif #if defined(HAVE_VSNPRINTF) #ifdef HAVE_BROKEN_VSNPRINTF_DECL #define wxCRT_VsnprintfA wx_fixed_vsnprintf #else #define wxCRT_VsnprintfA vsnprintf #endif #endif #endif #endif /* wxUSE_PRINTF_POS_PARAMS/!wxUSE_PRINTF_POS_PARAMS */ #ifndef wxCRT_VsnprintfW /* no (suitable) vsnprintf(), cook our own */ WXDLLIMPEXP_BASE int wxCRT_VsnprintfW(wchar_t *buf, size_t len, const wchar_t *format, va_list argptr); #define wxUSE_WXVSNPRINTFW 1 #else #define wxUSE_WXVSNPRINTFW 0 #endif #ifndef wxCRT_VsnprintfA /* no (suitable) vsnprintf(), cook our own */ WXDLLIMPEXP_BASE int wxCRT_VsnprintfA(char *buf, size_t len, const char *format, va_list argptr); #define wxUSE_WXVSNPRINTFA 1 #else #define wxUSE_WXVSNPRINTFA 0 #endif // for wxString code, define wxUSE_WXVSNPRINTF to indicate that wx // implementation is used no matter what (in UTF-8 build, either *A or *W // version may be called): #if !wxUSE_UNICODE #define wxUSE_WXVSNPRINTF wxUSE_WXVSNPRINTFA #elif wxUSE_UNICODE_WCHAR #define wxUSE_WXVSNPRINTF wxUSE_WXVSNPRINTFW #elif wxUSE_UTF8_LOCALE_ONLY #define wxUSE_WXVSNPRINTF wxUSE_WXVSNPRINTFA #else // UTF-8 under any locale #define wxUSE_WXVSNPRINTF (wxUSE_WXVSNPRINTFA && wxUSE_WXVSNPRINTFW) #endif #define wxCRT_FprintfA fprintf #define wxCRT_PrintfA printf #define wxCRT_VfprintfA vfprintf #define wxCRT_VprintfA vprintf #define wxCRT_VsprintfA vsprintf /* In Unicode mode we need to have all standard functions such as wprintf() and so on but not all systems have them so use our own implementations in this case. */ #if !defined(wxHAVE_TCHAR_SUPPORT) && !defined(HAVE_WPRINTF) #define wxNEED_WPRINTF #endif #if !defined(wxHAVE_TCHAR_SUPPORT) && !defined(HAVE_VSWSCANF) && defined(HAVE_VSSCANF) #define wxNEED_VSWSCANF #endif #if defined(wxNEED_WPRINTF) /* we need to implement all wide character printf functions either because we don't have them at all or because they don't have the semantics we need */ int wxCRT_PrintfW( const wchar_t *format, ... ); int wxCRT_FprintfW( FILE *stream, const wchar_t *format, ... ); int wxCRT_VfprintfW( FILE *stream, const wchar_t *format, va_list ap ); int wxCRT_VprintfW( const wchar_t *format, va_list ap ); int wxCRT_VsprintfW( wchar_t *str, const wchar_t *format, va_list ap ); #else /* !wxNEED_WPRINTF */ #define wxCRT_FprintfW fwprintf #define wxCRT_PrintfW wprintf #define wxCRT_VfprintfW vfwprintf #define wxCRT_VprintfW vwprintf #if defined(__WINDOWS__) && !defined(HAVE_VSWPRINTF) // only non-standard vswprintf() without buffer size argument can be used here #define wxCRT_VsprintfW vswprintf #endif #endif /* wxNEED_WPRINTF */ /* Required for wxScanf() etc. */ #define wxCRT_ScanfA scanf #define wxCRT_SscanfA sscanf #define wxCRT_FscanfA fscanf /* vsscanf() may have a wrong declaration with non-const first parameter, fix * this by wrapping it if necessary. */ #if defined __cplusplus && defined HAVE_BROKEN_VSSCANF_DECL inline int wxCRT_VsscanfA(const char *str, const char *format, va_list ap) { return vsscanf(const_cast<char *>(str), format, ap); } #else wxDECL_FOR_STRICT_MINGW32(int, vsscanf, (const char*, const char*, va_list)) #define wxCRT_VsscanfA vsscanf #endif #if defined(wxNEED_WPRINTF) int wxCRT_ScanfW(const wchar_t *format, ...); int wxCRT_SscanfW(const wchar_t *str, const wchar_t *format, ...); int wxCRT_FscanfW(FILE *stream, const wchar_t *format, ...); #else #define wxCRT_ScanfW wxVMS_USE_STD wscanf #define wxCRT_SscanfW wxVMS_USE_STD swscanf #define wxCRT_FscanfW wxVMS_USE_STD fwscanf #endif #ifdef wxNEED_VSWSCANF int wxCRT_VsscanfW(const wchar_t *str, const wchar_t *format, va_list ap); #else wxDECL_FOR_STRICT_MINGW32(int, vswscanf, (const wchar_t*, const wchar_t*, va_list)) #define wxCRT_VsscanfW wxVMS_USE_STD vswscanf #endif // ---------------------------------------------------------------------------- // user-friendly wrappers to CRT functions // ---------------------------------------------------------------------------- // FIXME-UTF8: remove this #if wxUSE_UNICODE #define wxCRT_PrintfNative wxCRT_PrintfW #define wxCRT_FprintfNative wxCRT_FprintfW #else #define wxCRT_PrintfNative wxCRT_PrintfA #define wxCRT_FprintfNative wxCRT_FprintfA #endif WX_DEFINE_VARARG_FUNC_SANS_N0(int, wxPrintf, 1, (const wxFormatString&), wxCRT_PrintfNative, wxCRT_PrintfA) inline int wxPrintf(const wxFormatString& s) { return wxPrintf("%s", s.InputAsString()); } WX_DEFINE_VARARG_FUNC_SANS_N0(int, wxFprintf, 2, (FILE*, const wxFormatString&), wxCRT_FprintfNative, wxCRT_FprintfA) inline int wxFprintf(FILE *f, const wxFormatString& s) { return wxFprintf(f, "%s", s.InputAsString()); } // va_list versions of printf functions simply forward to the respective // CRT function; note that they assume that va_list was created using // wxArgNormalizer<T>! #if wxUSE_UNICODE_UTF8 #if wxUSE_UTF8_LOCALE_ONLY #define WX_VARARG_VFOO_IMPL(args, implW, implA) \ return implA args #else #define WX_VARARG_VFOO_IMPL(args, implW, implA) \ if ( wxLocaleIsUtf8 ) return implA args; \ else return implW args #endif #elif wxUSE_UNICODE_WCHAR #define WX_VARARG_VFOO_IMPL(args, implW, implA) \ return implW args #else // ANSI #define WX_VARARG_VFOO_IMPL(args, implW, implA) \ return implA args #endif inline int wxVprintf(const wxString& format, va_list ap) { WX_VARARG_VFOO_IMPL((wxFormatString(format), ap), wxCRT_VprintfW, wxCRT_VprintfA); } inline int wxVfprintf(FILE *f, const wxString& format, va_list ap) { WX_VARARG_VFOO_IMPL((f, wxFormatString(format), ap), wxCRT_VfprintfW, wxCRT_VfprintfA); } #undef WX_VARARG_VFOO_IMPL // wxSprintf() and friends have to be implemented in two forms, one for // writing to char* buffer and one for writing to wchar_t*: #if !wxUSE_UTF8_LOCALE_ONLY int WXDLLIMPEXP_BASE wxDoSprintfWchar(char *str, const wxChar *format, ...); #endif #if wxUSE_UNICODE_UTF8 int WXDLLIMPEXP_BASE wxDoSprintfUtf8(char *str, const char *format, ...); #endif WX_DEFINE_VARARG_FUNC(int, wxSprintf, 2, (char*, const wxFormatString&), wxDoSprintfWchar, wxDoSprintfUtf8) int WXDLLIMPEXP_BASE wxVsprintf(char *str, const wxString& format, va_list argptr); #if !wxUSE_UTF8_LOCALE_ONLY int WXDLLIMPEXP_BASE wxDoSnprintfWchar(char *str, size_t size, const wxChar *format, ...); #endif #if wxUSE_UNICODE_UTF8 int WXDLLIMPEXP_BASE wxDoSnprintfUtf8(char *str, size_t size, const char *format, ...); #endif WX_DEFINE_VARARG_FUNC(int, wxSnprintf, 3, (char*, size_t, const wxFormatString&), wxDoSnprintfWchar, wxDoSnprintfUtf8) int WXDLLIMPEXP_BASE wxVsnprintf(char *str, size_t size, const wxString& format, va_list argptr); #if wxUSE_UNICODE #if !wxUSE_UTF8_LOCALE_ONLY int WXDLLIMPEXP_BASE wxDoSprintfWchar(wchar_t *str, const wxChar *format, ...); #endif #if wxUSE_UNICODE_UTF8 int WXDLLIMPEXP_BASE wxDoSprintfUtf8(wchar_t *str, const char *format, ...); #endif WX_DEFINE_VARARG_FUNC(int, wxSprintf, 2, (wchar_t*, const wxFormatString&), wxDoSprintfWchar, wxDoSprintfUtf8) int WXDLLIMPEXP_BASE wxVsprintf(wchar_t *str, const wxString& format, va_list argptr); #if !wxUSE_UTF8_LOCALE_ONLY int WXDLLIMPEXP_BASE wxDoSnprintfWchar(wchar_t *str, size_t size, const wxChar *format, ...); #endif #if wxUSE_UNICODE_UTF8 int WXDLLIMPEXP_BASE wxDoSnprintfUtf8(wchar_t *str, size_t size, const char *format, ...); #endif WX_DEFINE_VARARG_FUNC(int, wxSnprintf, 3, (wchar_t*, size_t, const wxFormatString&), wxDoSnprintfWchar, wxDoSnprintfUtf8) int WXDLLIMPEXP_BASE wxVsnprintf(wchar_t *str, size_t size, const wxString& format, va_list argptr); #endif // wxUSE_UNICODE // We can't use wxArgNormalizer<T> for variadic arguments to wxScanf() etc. // because they are writable, so instead of providing friendly template // vararg-like functions, we just provide both char* and wchar_t* variants // of these functions. The type of output variadic arguments for %s must match // the type of 'str' and 'format' arguments. // // For compatibility with earlier wx versions, we also provide wxSscanf() // version with the first argument (input string) wxString; for this version, // the type of output string values is determined by the type of format string // only. #define _WX_SCANFUNC_EXTRACT_ARGS_1(x) x #define _WX_SCANFUNC_EXTRACT_ARGS_2(x,y) x, y #define _WX_SCANFUNC_EXTRACT_ARGS(N, args) _WX_SCANFUNC_EXTRACT_ARGS_##N args #define _WX_VARARG_PASS_WRITABLE(i) a##i #define _WX_DEFINE_SCANFUNC(N, dummy1, name, impl, passfixed, numfixed, fixed)\ template<_WX_VARARG_JOIN(N, _WX_VARARG_TEMPL)> \ int name(_WX_SCANFUNC_EXTRACT_ARGS(numfixed, fixed), \ _WX_VARARG_JOIN(N, _WX_VARARG_ARG)) \ { \ return impl(_WX_SCANFUNC_EXTRACT_ARGS(numfixed, passfixed), \ _WX_VARARG_JOIN(N, _WX_VARARG_PASS_WRITABLE)); \ } #define WX_DEFINE_SCANFUNC(name, numfixed, fixed, impl, passfixed) \ _WX_VARARG_ITER(_WX_VARARG_MAX_ARGS, \ _WX_DEFINE_SCANFUNC, \ dummy1, name, impl, passfixed, numfixed, fixed) // this is needed to normalize the format string, see src/common/strvararg.cpp // for more details #ifdef __WINDOWS__ #define wxScanfConvertFormatW(fmt) fmt #else const wxScopedWCharBuffer WXDLLIMPEXP_BASE wxScanfConvertFormatW(const wchar_t *format); #endif WX_DEFINE_SCANFUNC(wxScanf, 1, (const char *format), wxCRT_ScanfA, (format)) WX_DEFINE_SCANFUNC(wxScanf, 1, (const wchar_t *format), wxCRT_ScanfW, (wxScanfConvertFormatW(format))) WX_DEFINE_SCANFUNC(wxFscanf, 2, (FILE *stream, const char *format), wxCRT_FscanfA, (stream, format)) WX_DEFINE_SCANFUNC(wxFscanf, 2, (FILE *stream, const wchar_t *format), wxCRT_FscanfW, (stream, wxScanfConvertFormatW(format))) WX_DEFINE_SCANFUNC(wxSscanf, 2, (const char *str, const char *format), wxCRT_SscanfA, (str, format)) WX_DEFINE_SCANFUNC(wxSscanf, 2, (const wchar_t *str, const wchar_t *format), wxCRT_SscanfW, (str, wxScanfConvertFormatW(format))) WX_DEFINE_SCANFUNC(wxSscanf, 2, (const wxScopedCharBuffer& str, const char *format), wxCRT_SscanfA, (str.data(), format)) WX_DEFINE_SCANFUNC(wxSscanf, 2, (const wxScopedWCharBuffer& str, const wchar_t *format), wxCRT_SscanfW, (str.data(), wxScanfConvertFormatW(format))) WX_DEFINE_SCANFUNC(wxSscanf, 2, (const wxString& str, const char *format), wxCRT_SscanfA, (str.mb_str(), format)) WX_DEFINE_SCANFUNC(wxSscanf, 2, (const wxString& str, const wchar_t *format), wxCRT_SscanfW, (str.wc_str(), wxScanfConvertFormatW(format))) WX_DEFINE_SCANFUNC(wxSscanf, 2, (const wxCStrData& str, const char *format), wxCRT_SscanfA, (str.AsCharBuf(), format)) WX_DEFINE_SCANFUNC(wxSscanf, 2, (const wxCStrData& str, const wchar_t *format), wxCRT_SscanfW, (str.AsWCharBuf(), wxScanfConvertFormatW(format))) // Visual C++ doesn't provide vsscanf() #ifndef __VISUALC___ int WXDLLIMPEXP_BASE wxVsscanf(const char *str, const char *format, va_list ap); int WXDLLIMPEXP_BASE wxVsscanf(const wchar_t *str, const wchar_t *format, va_list ap); int WXDLLIMPEXP_BASE wxVsscanf(const wxScopedCharBuffer& str, const char *format, va_list ap); int WXDLLIMPEXP_BASE wxVsscanf(const wxScopedWCharBuffer& str, const wchar_t *format, va_list ap); int WXDLLIMPEXP_BASE wxVsscanf(const wxString& str, const char *format, va_list ap); int WXDLLIMPEXP_BASE wxVsscanf(const wxString& str, const wchar_t *format, va_list ap); int WXDLLIMPEXP_BASE wxVsscanf(const wxCStrData& str, const char *format, va_list ap); int WXDLLIMPEXP_BASE wxVsscanf(const wxCStrData& str, const wchar_t *format, va_list ap); #endif // !__VISUALC__ #endif /* _WX_WXCRTVARARG_H_ */
h
rticonnextdds-usecases
data/projects/rticonnextdds-usecases/VehicleTracking/ExampleCode/thirdparty/wxWidgets-3.1.2/Linux/include/wx/debugrpt.h
/////////////////////////////////////////////////////////////////////////////// // Name: wx/debugrpt.h // Purpose: declaration of wxDebugReport class // Author: Vadim Zeitlin // Created: 2005-01-17 // Copyright: (c) 2005 Vadim Zeitlin <[email protected]> // Licence: wxWindows licence /////////////////////////////////////////////////////////////////////////////// #ifndef _WX_DEBUGRPT_H_ #define _WX_DEBUGRPT_H_ #include "wx/defs.h" #if wxUSE_DEBUGREPORT && wxUSE_XML #include "wx/string.h" #include "wx/arrstr.h" #include "wx/filename.h" class WXDLLIMPEXP_FWD_XML wxXmlNode; // ---------------------------------------------------------------------------- // wxDebugReport: generate a debug report, processing is done in derived class // ---------------------------------------------------------------------------- class WXDLLIMPEXP_QA wxDebugReport { friend class wxDebugReportDialog; public: // this is used for the functions which may report either the current state // or the state during the last (fatal) exception enum Context { Context_Current, Context_Exception }; // ctor creates a temporary directory where we create the files which will // be included in the report, use IsOk() to check for errors wxDebugReport(); // dtor normally destroys the temporary directory created in the ctor (with // all the files it contains), call Reset() to prevent this from happening virtual ~wxDebugReport(); // return the name of the directory used for this report const wxString& GetDirectory() const { return m_dir; } // return true if the object was successfully initialized bool IsOk() const { return !GetDirectory().empty(); } // reset the directory name we use, the object can't be used any more after // this as it becomes invalid/uninitialized void Reset() { m_dir.clear(); } // add another file to the report: the file must already exist, its name // can be either absolute in which case it is copied to the debug report // directory or relative to GetDirectory() // // description is shown to the user in the report summary virtual void AddFile(const wxString& filename, const wxString& description); // convenience function: write the given text to a file with the given name // and then add it to the report (the difference with AddFile() is that the // file will be created by this function and doesn't have to already exist) bool AddText(const wxString& filename, const wxString& text, const wxString& description); #if wxUSE_STACKWALKER // add an XML file containing the current or exception context and the // stack trace bool AddCurrentContext() { return AddContext(Context_Current); } bool AddExceptionContext() { return AddContext(Context_Exception); } virtual bool AddContext(Context ctx); #endif #if wxUSE_CRASHREPORT // add a file with crash report bool AddCurrentDump() { return AddDump(Context_Current); } bool AddExceptionDump() { return AddDump(Context_Exception); } virtual bool AddDump(Context ctx); #endif // wxUSE_CRASHREPORT // add all available information to the report void AddAll(Context context = Context_Exception); // process this report: the base class simply notifies the user that the // report has been generated, this is usually not enough -- instead you // should override this method to do something more useful to you bool Process(); // get the name used as base name for various files, by default // wxApp::GetName() virtual wxString GetReportName() const; // get the files in this report size_t GetFilesCount() const { return m_files.GetCount(); } bool GetFile(size_t n, wxString *name, wxString *desc) const; // remove the file from report: this is used by wxDebugReportPreview to // allow the user to remove files potentially containing private // information from the report void RemoveFile(const wxString& name); protected: #if wxUSE_STACKWALKER // used by AddContext() virtual bool DoAddSystemInfo(wxXmlNode *nodeSystemInfo); virtual bool DoAddLoadedModules(wxXmlNode *nodeModules); virtual bool DoAddExceptionInfo(wxXmlNode *nodeContext); virtual void DoAddCustomContext(wxXmlNode * WXUNUSED(nodeRoot)) { } #endif // used by Process() virtual bool DoProcess(); // return the location where the report will be saved virtual wxFileName GetSaveLocation() const; private: // name of the report directory wxString m_dir; // the arrays of files in this report and their descriptions wxArrayString m_files, m_descriptions; }; #if wxUSE_ZIPSTREAM // ---------------------------------------------------------------------------- // wxDebugReportCompress: compress all files of this debug report in a .ZIP // ---------------------------------------------------------------------------- class WXDLLIMPEXP_QA wxDebugReportCompress : public wxDebugReport { public: wxDebugReportCompress() { } // you can optionally specify the directory and/or name of the file where // the debug report should be generated, a default location under the // directory containing temporary files will be used if you don't // // both of these functions should be called before Process()ing the report // if they're called at all void SetCompressedFileDirectory(const wxString& dir); void SetCompressedFileBaseName(const wxString& name); // returns the full path of the compressed file (empty if creation failed) const wxString& GetCompressedFileName() const { return m_zipfile; } protected: virtual bool DoProcess() wxOVERRIDE; // return the location where the report will be saved wxFileName GetSaveLocation() const wxOVERRIDE; private: // user-specified file directory/base name, use defaults if empty wxString m_zipDir, m_zipName; // full path to the ZIP file we created wxString m_zipfile; }; // ---------------------------------------------------------------------------- // wxDebugReportUploader: uploads compressed file using HTTP POST request // ---------------------------------------------------------------------------- class WXDLLIMPEXP_QA wxDebugReportUpload : public wxDebugReportCompress { public: // this class will upload the compressed file created by its base class to // an HTML multipart/form-data form at the specified address // // the URL is the base address, input is the name of the "type=file" // control on the form used for the file name and action is the value of // the form action field wxDebugReportUpload(const wxString& url, const wxString& input, const wxString& action, const wxString& curl = wxT("curl")); protected: virtual bool DoProcess() wxOVERRIDE; // this function may be overridden in a derived class to show the output // from curl: this may be an HTML page or anything else that the server // returned // // return value becomes the return value of Process() virtual bool OnServerReply(const wxArrayString& WXUNUSED(reply)) { return true; } private: // the full URL to use with HTTP POST request wxString m_uploadURL; // the name of the input field containing the file name in the form at // above URL wxString m_inputField; // the curl command (by default it is just "curl" but could be full path to // curl or a wrapper script with curl-compatible syntax) wxString m_curlCmd; }; #endif // wxUSE_ZIPSTREAM // ---------------------------------------------------------------------------- // wxDebugReportPreview: presents the debug report to the user and allows him // to veto report entirely or remove some parts of it // ---------------------------------------------------------------------------- class WXDLLIMPEXP_QA wxDebugReportPreview { public: // ctor is trivial wxDebugReportPreview() { } // present the report to the user and allow him to modify it by removing // some or all of the files and, potentially, adding some notes // // return true if the report should be processed or false if the user chose // to cancel report generation or removed all files from it virtual bool Show(wxDebugReport& dbgrpt) const = 0; // dtor is trivial as well but should be virtual for a base class virtual ~wxDebugReportPreview() { } }; #if wxUSE_GUI // ---------------------------------------------------------------------------- // wxDebugReportPreviewStd: standard debug report preview window // ---------------------------------------------------------------------------- class WXDLLIMPEXP_QA wxDebugReportPreviewStd : public wxDebugReportPreview { public: wxDebugReportPreviewStd() { } virtual bool Show(wxDebugReport& dbgrpt) const wxOVERRIDE; }; #endif // wxUSE_GUI #endif // wxUSE_DEBUGREPORT && wxUSE_XML #endif // _WX_DEBUGRPT_H_
h
rticonnextdds-usecases
data/projects/rticonnextdds-usecases/VehicleTracking/ExampleCode/thirdparty/wxWidgets-3.1.2/Linux/include/wx/fontmap.h
///////////////////////////////////////////////////////////////////////////// // Name: wx/fontmap.h // Purpose: wxFontMapper class // Author: Vadim Zeitlin // Modified by: // Created: 04.11.99 // Copyright: (c) Vadim Zeitlin // Licence: wxWindows licence ///////////////////////////////////////////////////////////////////////////// #ifndef _WX_FONTMAPPER_H_ #define _WX_FONTMAPPER_H_ // ---------------------------------------------------------------------------- // headers // ---------------------------------------------------------------------------- #if wxUSE_FONTMAP #include "wx/fontenc.h" // for wxFontEncoding #if wxUSE_GUI #include "wx/fontutil.h" // for wxNativeEncodingInfo #endif // wxUSE_GUI #if wxUSE_CONFIG && wxUSE_FILECONFIG class WXDLLIMPEXP_FWD_BASE wxConfigBase; #endif // wxUSE_CONFIG class WXDLLIMPEXP_FWD_CORE wxFontMapper; #if wxUSE_GUI class WXDLLIMPEXP_FWD_CORE wxWindow; #endif // wxUSE_GUI // ============================================================================ // wxFontMapper manages user-definable correspondence between wxWidgets font // encodings and the fonts present on the machine. // // This is a singleton class, font mapper objects can only be accessed using // wxFontMapper::Get(). // ============================================================================ // ---------------------------------------------------------------------------- // wxFontMapperBase: this is a non-interactive class which just uses its built // in knowledge of the encodings equivalence // ---------------------------------------------------------------------------- class WXDLLIMPEXP_BASE wxFontMapperBase { public: // constructor and such // --------------------- // default ctor wxFontMapperBase(); // virtual dtor for any base class virtual ~wxFontMapperBase(); // return instance of the wxFontMapper singleton // wxBase code only cares that it's a wxFontMapperBase // In wxBase, wxFontMapper is only forward declared // so one cannot implicitly cast from it to wxFontMapperBase. static wxFontMapperBase *Get(); // set the singleton to 'mapper' instance and return previous one static wxFontMapper *Set(wxFontMapper *mapper); // delete the existing font mapper if any static void Reset(); // translates charset strings to encoding // -------------------------------------- // returns the encoding for the given charset (in the form of RFC 2046) or // wxFONTENCODING_SYSTEM if couldn't decode it // // interactive parameter is ignored in the base class, we behave as if it // were always false virtual wxFontEncoding CharsetToEncoding(const wxString& charset, bool interactive = true); // information about supported encodings // ------------------------------------- // get the number of font encodings we know about static size_t GetSupportedEncodingsCount(); // get the n-th supported encoding static wxFontEncoding GetEncoding(size_t n); // return canonical name of this encoding (this is a short string, // GetEncodingDescription() returns a longer one) static wxString GetEncodingName(wxFontEncoding encoding); // return a list of all names of this encoding (see GetEncodingName) static const wxChar** GetAllEncodingNames(wxFontEncoding encoding); // return user-readable string describing the given encoding // // NB: hard-coded now, but might change later (read it from config?) static wxString GetEncodingDescription(wxFontEncoding encoding); // find the encoding corresponding to the given name, inverse of // GetEncodingName() and less general than CharsetToEncoding() // // returns wxFONTENCODING_MAX if the name is not a supported encoding static wxFontEncoding GetEncodingFromName(const wxString& name); // functions which allow to configure the config object used: by default, // the global one (from wxConfigBase::Get() will be used) and the default // root path for the config settings is the string returned by // GetDefaultConfigPath() // ---------------------------------------------------------------------- #if wxUSE_CONFIG && wxUSE_FILECONFIG // set the root config path to use (should be an absolute path) void SetConfigPath(const wxString& prefix); // return default config path static const wxString& GetDefaultConfigPath(); #endif // wxUSE_CONFIG // returns true for the base class and false for a "real" font mapper object // (implementation-only) virtual bool IsDummy() { return true; } protected: #if wxUSE_CONFIG && wxUSE_FILECONFIG // get the config object we're using -- either the global config object // or a wxMemoryConfig object created by this class otherwise wxConfigBase *GetConfig(); // gets the root path for our settings -- if it wasn't set explicitly, use // GetDefaultConfigPath() const wxString& GetConfigPath(); // change to the given (relative) path in the config, return true if ok // (then GetConfig() will return something !NULL), false if no config // object // // caller should provide a pointer to the string variable which should be // later passed to RestorePath() bool ChangePath(const wxString& pathNew, wxString *pathOld); // restore the config path after use void RestorePath(const wxString& pathOld); // config object and path (in it) to use wxConfigBase *m_configDummy; wxString m_configRootPath; #endif // wxUSE_CONFIG // the real implementation of the base class version of CharsetToEncoding() // // returns wxFONTENCODING_UNKNOWN if encoding is unknown and we shouldn't // ask the user about it, wxFONTENCODING_SYSTEM if it is unknown but we // should/could ask the user int NonInteractiveCharsetToEncoding(const wxString& charset); private: // the global fontmapper object or NULL static wxFontMapper *sm_instance; friend class wxFontMapperPathChanger; wxDECLARE_NO_COPY_CLASS(wxFontMapperBase); }; // ---------------------------------------------------------------------------- // wxFontMapper: interactive extension of wxFontMapperBase // // The default implementations of all functions will ask the user if they are // not capable of finding the answer themselves and store the answer in a // config file (configurable via SetConfigXXX functions). This behaviour may // be disabled by giving the value of false to "interactive" parameter. // However, the functions will always consult the config file to allow the // user-defined values override the default logic and there is no way to // disable this -- which shouldn't be ever needed because if "interactive" was // never true, the config file is never created anyhow. // ---------------------------------------------------------------------------- #if wxUSE_GUI class WXDLLIMPEXP_CORE wxFontMapper : public wxFontMapperBase { public: // default ctor wxFontMapper(); // virtual dtor for a base class virtual ~wxFontMapper(); // working with the encodings // -------------------------- // returns the encoding for the given charset (in the form of RFC 2046) or // wxFONTENCODING_SYSTEM if couldn't decode it virtual wxFontEncoding CharsetToEncoding(const wxString& charset, bool interactive = true) wxOVERRIDE; // find an alternative for the given encoding (which is supposed to not be // available on this system). If successful, return true and fill info // structure with the parameters required to create the font, otherwise // return false virtual bool GetAltForEncoding(wxFontEncoding encoding, wxNativeEncodingInfo *info, const wxString& facename = wxEmptyString, bool interactive = true); // version better suitable for 'public' use. Returns wxFontEcoding // that can be used it wxFont ctor bool GetAltForEncoding(wxFontEncoding encoding, wxFontEncoding *alt_encoding, const wxString& facename = wxEmptyString, bool interactive = true); // checks whether given encoding is available in given face or not. // // if no facename is given (default), return true if it's available in any // facename at alll. virtual bool IsEncodingAvailable(wxFontEncoding encoding, const wxString& facename = wxEmptyString); // configure the appearance of the dialogs we may popup // ---------------------------------------------------- // the parent window for modal dialogs void SetDialogParent(wxWindow *parent) { m_windowParent = parent; } // the title for the dialogs (note that default is quite reasonable) void SetDialogTitle(const wxString& title) { m_titleDialog = title; } // GUI code needs to know it's a wxFontMapper because there // are additional methods in the subclass. static wxFontMapper *Get(); // pseudo-RTTI since we aren't a wxObject. virtual bool IsDummy() wxOVERRIDE { return false; } protected: // GetAltForEncoding() helper: tests for the existence of the given // encoding and saves the result in config if ok - this results in the // following (desired) behaviour: when an unknown/unavailable encoding is // requested for the first time, the user is asked about a replacement, // but if he doesn't choose any and the default logic finds one, it will // be saved in the config so that the user won't be asked about it any // more bool TestAltEncoding(const wxString& configEntry, wxFontEncoding encReplacement, wxNativeEncodingInfo *info); // the title for our dialogs wxString m_titleDialog; // the parent window for our dialogs wxWindow *m_windowParent; private: wxDECLARE_NO_COPY_CLASS(wxFontMapper); }; #endif // wxUSE_GUI // ---------------------------------------------------------------------------- // global variables // ---------------------------------------------------------------------------- // the default font mapper for wxWidgets programs do NOT use! This is for // backward compatibility, use wxFontMapper::Get() instead #define wxTheFontMapper (wxFontMapper::Get()) #else // !wxUSE_FONTMAP #if wxUSE_GUI // wxEncodingToCodepage (utils.cpp) needs wxGetNativeFontEncoding #include "wx/fontutil.h" #endif #endif // wxUSE_FONTMAP/!wxUSE_FONTMAP #endif // _WX_FONTMAPPER_H_
h
rticonnextdds-usecases
data/projects/rticonnextdds-usecases/VehicleTracking/ExampleCode/thirdparty/wxWidgets-3.1.2/Linux/include/wx/image.h
///////////////////////////////////////////////////////////////////////////// // Name: wx/image.h // Purpose: wxImage class // Author: Robert Roebling // Copyright: (c) Robert Roebling // Licence: wxWindows licence ///////////////////////////////////////////////////////////////////////////// #ifndef _WX_IMAGE_H_ #define _WX_IMAGE_H_ #include "wx/defs.h" #if wxUSE_IMAGE #include "wx/object.h" #include "wx/string.h" #include "wx/gdicmn.h" #include "wx/hashmap.h" #include "wx/arrstr.h" #if wxUSE_STREAMS # include "wx/stream.h" #endif // on some systems (Unixware 7.x) index is defined as a macro in the headers // which breaks the compilation below #undef index #define wxIMAGE_OPTION_QUALITY wxString(wxS("quality")) #define wxIMAGE_OPTION_FILENAME wxString(wxS("FileName")) #define wxIMAGE_OPTION_RESOLUTION wxString(wxS("Resolution")) #define wxIMAGE_OPTION_RESOLUTIONX wxString(wxS("ResolutionX")) #define wxIMAGE_OPTION_RESOLUTIONY wxString(wxS("ResolutionY")) #define wxIMAGE_OPTION_RESOLUTIONUNIT wxString(wxS("ResolutionUnit")) #define wxIMAGE_OPTION_MAX_WIDTH wxString(wxS("MaxWidth")) #define wxIMAGE_OPTION_MAX_HEIGHT wxString(wxS("MaxHeight")) #define wxIMAGE_OPTION_ORIGINAL_WIDTH wxString(wxS("OriginalWidth")) #define wxIMAGE_OPTION_ORIGINAL_HEIGHT wxString(wxS("OriginalHeight")) // constants used with wxIMAGE_OPTION_RESOLUTIONUNIT // // NB: don't change these values, they correspond to libjpeg constants enum wxImageResolution { // Resolution not specified wxIMAGE_RESOLUTION_NONE = 0, // Resolution specified in inches wxIMAGE_RESOLUTION_INCHES = 1, // Resolution specified in centimeters wxIMAGE_RESOLUTION_CM = 2 }; // Constants for wxImage::Scale() for determining the level of quality enum wxImageResizeQuality { // different image resizing algorithms used by Scale() and Rescale() wxIMAGE_QUALITY_NEAREST = 0, wxIMAGE_QUALITY_BILINEAR = 1, wxIMAGE_QUALITY_BICUBIC = 2, wxIMAGE_QUALITY_BOX_AVERAGE = 3, // default quality is low (but fast) wxIMAGE_QUALITY_NORMAL = wxIMAGE_QUALITY_NEAREST, // highest (but best) quality wxIMAGE_QUALITY_HIGH = 4 }; // alpha channel values: fully transparent, default threshold separating // transparent pixels from opaque for a few functions dealing with alpha and // fully opaque const unsigned char wxIMAGE_ALPHA_TRANSPARENT = 0; const unsigned char wxIMAGE_ALPHA_THRESHOLD = 0x80; const unsigned char wxIMAGE_ALPHA_OPAQUE = 0xff; //----------------------------------------------------------------------------- // classes //----------------------------------------------------------------------------- class WXDLLIMPEXP_FWD_CORE wxImageHandler; class WXDLLIMPEXP_FWD_CORE wxImage; class WXDLLIMPEXP_FWD_CORE wxPalette; //----------------------------------------------------------------------------- // wxVariant support //----------------------------------------------------------------------------- #if wxUSE_VARIANT #include "wx/variant.h" DECLARE_VARIANT_OBJECT_EXPORTED(wxImage,WXDLLIMPEXP_CORE) #endif //----------------------------------------------------------------------------- // wxImageHandler //----------------------------------------------------------------------------- class WXDLLIMPEXP_CORE wxImageHandler: public wxObject { public: wxImageHandler() : m_name(wxEmptyString), m_extension(wxEmptyString), m_mime(), m_type(wxBITMAP_TYPE_INVALID) { } #if wxUSE_STREAMS // NOTE: LoadFile and SaveFile are not pure virtuals to allow derived classes // to implement only one of the two virtual bool LoadFile( wxImage *WXUNUSED(image), wxInputStream& WXUNUSED(stream), bool WXUNUSED(verbose)=true, int WXUNUSED(index)=-1 ) { return false; } virtual bool SaveFile( wxImage *WXUNUSED(image), wxOutputStream& WXUNUSED(stream), bool WXUNUSED(verbose)=true ) { return false; } int GetImageCount( wxInputStream& stream ); // save the stream position, call DoGetImageCount() and restore the position bool CanRead( wxInputStream& stream ) { return CallDoCanRead(stream); } bool CanRead( const wxString& name ); #endif // wxUSE_STREAMS void SetName(const wxString& name) { m_name = name; } void SetExtension(const wxString& ext) { m_extension = ext; } void SetAltExtensions(const wxArrayString& exts) { m_altExtensions = exts; } void SetType(wxBitmapType type) { m_type = type; } void SetMimeType(const wxString& type) { m_mime = type; } const wxString& GetName() const { return m_name; } const wxString& GetExtension() const { return m_extension; } const wxArrayString& GetAltExtensions() const { return m_altExtensions; } wxBitmapType GetType() const { return m_type; } const wxString& GetMimeType() const { return m_mime; } #if WXWIN_COMPATIBILITY_2_8 wxDEPRECATED( void SetType(long type) { SetType((wxBitmapType)type); } ) #endif // WXWIN_COMPATIBILITY_2_8 protected: #if wxUSE_STREAMS // NOTE: this function is allowed to change the current stream position // since GetImageCount() will take care of restoring it later virtual int DoGetImageCount( wxInputStream& WXUNUSED(stream) ) { return 1; } // default return value is 1 image // NOTE: this function is allowed to change the current stream position // since CallDoCanRead() will take care of restoring it later virtual bool DoCanRead( wxInputStream& stream ) = 0; // save the stream position, call DoCanRead() and restore the position bool CallDoCanRead(wxInputStream& stream); #endif // wxUSE_STREAMS // helper for the derived classes SaveFile() implementations: returns the // values of x- and y-resolution options specified as the image options if // any static wxImageResolution GetResolutionFromOptions(const wxImage& image, int *x, int *y); wxString m_name; wxString m_extension; wxArrayString m_altExtensions; wxString m_mime; wxBitmapType m_type; private: wxDECLARE_CLASS(wxImageHandler); }; //----------------------------------------------------------------------------- // wxImageHistogram //----------------------------------------------------------------------------- class WXDLLIMPEXP_CORE wxImageHistogramEntry { public: wxImageHistogramEntry() { index = value = 0; } unsigned long index; unsigned long value; }; WX_DECLARE_EXPORTED_HASH_MAP(unsigned long, wxImageHistogramEntry, wxIntegerHash, wxIntegerEqual, wxImageHistogramBase); class WXDLLIMPEXP_CORE wxImageHistogram : public wxImageHistogramBase { public: wxImageHistogram() : wxImageHistogramBase(256) { } // get the key in the histogram for the given RGB values static unsigned long MakeKey(unsigned char r, unsigned char g, unsigned char b) { return (r << 16) | (g << 8) | b; } // find first colour that is not used in the image and has higher // RGB values than RGB(startR, startG, startB) // // returns true and puts this colour in r, g, b (each of which may be NULL) // on success or returns false if there are no more free colours bool FindFirstUnusedColour(unsigned char *r, unsigned char *g, unsigned char *b, unsigned char startR = 1, unsigned char startG = 0, unsigned char startB = 0 ) const; }; //----------------------------------------------------------------------------- // wxImage //----------------------------------------------------------------------------- class WXDLLIMPEXP_CORE wxImage: public wxObject { public: // red, green and blue are 8 bit unsigned integers in the range of 0..255 // We use the identifier RGBValue instead of RGB, since RGB is #defined class RGBValue { public: RGBValue(unsigned char r=0, unsigned char g=0, unsigned char b=0) : red(r), green(g), blue(b) {} unsigned char red; unsigned char green; unsigned char blue; }; // hue, saturation and value are doubles in the range 0.0..1.0 class HSVValue { public: HSVValue(double h=0.0, double s=0.0, double v=0.0) : hue(h), saturation(s), value(v) {} double hue; double saturation; double value; }; wxImage() {} wxImage( int width, int height, bool clear = true ) { Create( width, height, clear ); } wxImage( int width, int height, unsigned char* data, bool static_data = false ) { Create( width, height, data, static_data ); } wxImage( int width, int height, unsigned char* data, unsigned char* alpha, bool static_data = false ) { Create( width, height, data, alpha, static_data ); } // ctor variants using wxSize: wxImage( const wxSize& sz, bool clear = true ) { Create( sz, clear ); } wxImage( const wxSize& sz, unsigned char* data, bool static_data = false ) { Create( sz, data, static_data ); } wxImage( const wxSize& sz, unsigned char* data, unsigned char* alpha, bool static_data = false ) { Create( sz, data, alpha, static_data ); } wxImage( const wxString& name, wxBitmapType type = wxBITMAP_TYPE_ANY, int index = -1 ) { LoadFile( name, type, index ); } wxImage( const wxString& name, const wxString& mimetype, int index = -1 ) { LoadFile( name, mimetype, index ); } wxImage( const char* const* xpmData ) { Create(xpmData); } #if wxUSE_STREAMS wxImage( wxInputStream& stream, wxBitmapType type = wxBITMAP_TYPE_ANY, int index = -1 ) { LoadFile( stream, type, index ); } wxImage( wxInputStream& stream, const wxString& mimetype, int index = -1 ) { LoadFile( stream, mimetype, index ); } #endif // wxUSE_STREAMS bool Create( const char* const* xpmData ); #ifdef __BORLANDC__ // needed for Borland 5.5 wxImage( char** xpmData ) { Create(const_cast<const char* const*>(xpmData)); } bool Create( char** xpmData ) { return Create(const_cast<const char* const*>(xpmData)); } #endif bool Create( int width, int height, bool clear = true ); bool Create( int width, int height, unsigned char* data, bool static_data = false ); bool Create( int width, int height, unsigned char* data, unsigned char* alpha, bool static_data = false ); // Create() variants using wxSize: bool Create( const wxSize& sz, bool clear = true ) { return Create(sz.GetWidth(), sz.GetHeight(), clear); } bool Create( const wxSize& sz, unsigned char* data, bool static_data = false ) { return Create(sz.GetWidth(), sz.GetHeight(), data, static_data); } bool Create( const wxSize& sz, unsigned char* data, unsigned char* alpha, bool static_data = false ) { return Create(sz.GetWidth(), sz.GetHeight(), data, alpha, static_data); } void Destroy(); // initialize the image data with zeroes void Clear(unsigned char value = 0); // creates an identical copy of the image (the = operator // just raises the ref count) wxImage Copy() const; // return the new image with size width*height wxImage GetSubImage( const wxRect& rect) const; // Paste the image or part of this image into an image of the given size at the pos // any newly exposed areas will be filled with the rgb colour // by default if r = g = b = -1 then fill with this image's mask colour or find and // set a suitable mask colour wxImage Size( const wxSize& size, const wxPoint& pos, int r = -1, int g = -1, int b = -1 ) const; // pastes image into this instance and takes care of // the mask colour and out of bounds problems void Paste( const wxImage &image, int x, int y ); // return the new image with size width*height wxImage Scale( int width, int height, wxImageResizeQuality quality = wxIMAGE_QUALITY_NORMAL ) const; // box averager and bicubic filters for up/down sampling wxImage ResampleNearest(int width, int height) const; wxImage ResampleBox(int width, int height) const; wxImage ResampleBilinear(int width, int height) const; wxImage ResampleBicubic(int width, int height) const; // blur the image according to the specified pixel radius wxImage Blur(int radius) const; wxImage BlurHorizontal(int radius) const; wxImage BlurVertical(int radius) const; wxImage ShrinkBy( int xFactor , int yFactor ) const ; // rescales the image in place wxImage& Rescale( int width, int height, wxImageResizeQuality quality = wxIMAGE_QUALITY_NORMAL ) { return *this = Scale(width, height, quality); } // resizes the image in place wxImage& Resize( const wxSize& size, const wxPoint& pos, int r = -1, int g = -1, int b = -1 ) { return *this = Size(size, pos, r, g, b); } // Rotates the image about the given point, 'angle' radians. // Returns the rotated image, leaving this image intact. wxImage Rotate(double angle, const wxPoint & centre_of_rotation, bool interpolating = true, wxPoint * offset_after_rotation = NULL) const; wxImage Rotate90( bool clockwise = true ) const; wxImage Rotate180() const; wxImage Mirror( bool horizontally = true ) const; // replace one colour with another void Replace( unsigned char r1, unsigned char g1, unsigned char b1, unsigned char r2, unsigned char g2, unsigned char b2 ); // Convert to greyscale image. Uses the luminance component (Y) of the image. // The luma value (YUV) is calculated using (R * weight_r) + (G * weight_g) + (B * weight_b), defaults to ITU-T BT.601 wxImage ConvertToGreyscale(double weight_r, double weight_g, double weight_b) const; wxImage ConvertToGreyscale(void) const; // convert to monochrome image (<r,g,b> will be replaced by white, // everything else by black) wxImage ConvertToMono( unsigned char r, unsigned char g, unsigned char b ) const; // Convert to disabled (dimmed) image. wxImage ConvertToDisabled(unsigned char brightness = 255) const; // these routines are slow but safe void SetRGB( int x, int y, unsigned char r, unsigned char g, unsigned char b ); void SetRGB( const wxRect& rect, unsigned char r, unsigned char g, unsigned char b ); unsigned char GetRed( int x, int y ) const; unsigned char GetGreen( int x, int y ) const; unsigned char GetBlue( int x, int y ) const; void SetAlpha(int x, int y, unsigned char alpha); unsigned char GetAlpha(int x, int y) const; // find first colour that is not used in the image and has higher // RGB values than <startR,startG,startB> bool FindFirstUnusedColour( unsigned char *r, unsigned char *g, unsigned char *b, unsigned char startR = 1, unsigned char startG = 0, unsigned char startB = 0 ) const; // Set image's mask to the area of 'mask' that has <r,g,b> colour bool SetMaskFromImage(const wxImage & mask, unsigned char mr, unsigned char mg, unsigned char mb); // converts image's alpha channel to mask (choosing mask colour // automatically or using the specified colour for the mask), if it has // any, does nothing otherwise: bool ConvertAlphaToMask(unsigned char threshold = wxIMAGE_ALPHA_THRESHOLD); bool ConvertAlphaToMask(unsigned char mr, unsigned char mg, unsigned char mb, unsigned char threshold = wxIMAGE_ALPHA_THRESHOLD); // This method converts an image where the original alpha // information is only available as a shades of a colour // (actually shades of grey) typically when you draw anti- // aliased text into a bitmap. The DC drawinf routines // draw grey values on the black background although they // actually mean to draw white with differnt alpha values. // This method reverses it, assuming a black (!) background // and white text (actually only the red channel is read). // The method will then fill up the whole image with the // colour given. bool ConvertColourToAlpha( unsigned char r, unsigned char g, unsigned char b ); // Methods for controlling LoadFile() behaviour. Currently they allow to // specify whether the function should log warnings if there are any // problems with the image file not completely preventing it from being // loaded. By default the warnings are logged, but this can be disabled // either globally or for a particular image object. enum { Load_Verbose = 1 }; static void SetDefaultLoadFlags(int flags); static int GetDefaultLoadFlags(); void SetLoadFlags(int flags); int GetLoadFlags() const; static bool CanRead( const wxString& name ); static int GetImageCount( const wxString& name, wxBitmapType type = wxBITMAP_TYPE_ANY ); virtual bool LoadFile( const wxString& name, wxBitmapType type = wxBITMAP_TYPE_ANY, int index = -1 ); virtual bool LoadFile( const wxString& name, const wxString& mimetype, int index = -1 ); #if wxUSE_STREAMS static bool CanRead( wxInputStream& stream ); static int GetImageCount( wxInputStream& stream, wxBitmapType type = wxBITMAP_TYPE_ANY ); virtual bool LoadFile( wxInputStream& stream, wxBitmapType type = wxBITMAP_TYPE_ANY, int index = -1 ); virtual bool LoadFile( wxInputStream& stream, const wxString& mimetype, int index = -1 ); #endif virtual bool SaveFile( const wxString& name ) const; virtual bool SaveFile( const wxString& name, wxBitmapType type ) const; virtual bool SaveFile( const wxString& name, const wxString& mimetype ) const; #if wxUSE_STREAMS virtual bool SaveFile( wxOutputStream& stream, wxBitmapType type ) const; virtual bool SaveFile( wxOutputStream& stream, const wxString& mimetype ) const; #endif bool Ok() const { return IsOk(); } bool IsOk() const; int GetWidth() const; int GetHeight() const; wxSize GetSize() const { return wxSize(GetWidth(), GetHeight()); } // Gets the type of image found by LoadFile or specified with SaveFile wxBitmapType GetType() const; // Set the image type, this is normally only called if the image is being // created from data in the given format but not using LoadFile() (e.g. // wxGIFDecoder uses this) void SetType(wxBitmapType type); // these functions provide fastest access to wxImage data but should be // used carefully as no checks are done unsigned char *GetData() const; void SetData( unsigned char *data, bool static_data=false ); void SetData( unsigned char *data, int new_width, int new_height, bool static_data=false ); unsigned char *GetAlpha() const; // may return NULL! bool HasAlpha() const { return GetAlpha() != NULL; } void SetAlpha(unsigned char *alpha = NULL, bool static_data=false); void InitAlpha(); void ClearAlpha(); // return true if this pixel is masked or has alpha less than specified // threshold bool IsTransparent(int x, int y, unsigned char threshold = wxIMAGE_ALPHA_THRESHOLD) const; // Mask functions void SetMaskColour( unsigned char r, unsigned char g, unsigned char b ); // Get the current mask colour or find a suitable colour // returns true if using current mask colour bool GetOrFindMaskColour( unsigned char *r, unsigned char *g, unsigned char *b ) const; unsigned char GetMaskRed() const; unsigned char GetMaskGreen() const; unsigned char GetMaskBlue() const; void SetMask( bool mask = true ); bool HasMask() const; #if wxUSE_PALETTE // Palette functions bool HasPalette() const; const wxPalette& GetPalette() const; void SetPalette(const wxPalette& palette); #endif // wxUSE_PALETTE // Option functions (arbitrary name/value mapping) void SetOption(const wxString& name, const wxString& value); void SetOption(const wxString& name, int value); wxString GetOption(const wxString& name) const; int GetOptionInt(const wxString& name) const; bool HasOption(const wxString& name) const; unsigned long CountColours( unsigned long stopafter = (unsigned long) -1 ) const; // Computes the histogram of the image and fills a hash table, indexed // with integer keys built as 0xRRGGBB, containing wxImageHistogramEntry // objects. Each of them contains an 'index' (useful to build a palette // with the image colours) and a 'value', which is the number of pixels // in the image with that colour. // Returned value: # of entries in the histogram unsigned long ComputeHistogram( wxImageHistogram &h ) const; // Rotates the hue of each pixel of the image. angle is a double in the range // -1.0..1.0 where -1.0 is -360 degrees and 1.0 is 360 degrees void RotateHue(double angle); static wxList& GetHandlers() { return sm_handlers; } static void AddHandler( wxImageHandler *handler ); static void InsertHandler( wxImageHandler *handler ); static bool RemoveHandler( const wxString& name ); static wxImageHandler *FindHandler( const wxString& name ); static wxImageHandler *FindHandler( const wxString& extension, wxBitmapType imageType ); static wxImageHandler *FindHandler( wxBitmapType imageType ); static wxImageHandler *FindHandlerMime( const wxString& mimetype ); static wxString GetImageExtWildcard(); static void CleanUpHandlers(); static void InitStandardHandlers(); static HSVValue RGBtoHSV(const RGBValue& rgb); static RGBValue HSVtoRGB(const HSVValue& hsv); #if WXWIN_COMPATIBILITY_2_8 wxDEPRECATED_CONSTRUCTOR( wxImage(const wxString& name, long type, int index = -1) { LoadFile(name, (wxBitmapType)type, index); } ) #if wxUSE_STREAMS wxDEPRECATED_CONSTRUCTOR( wxImage(wxInputStream& stream, long type, int index = -1) { LoadFile(stream, (wxBitmapType)type, index); } ) wxDEPRECATED( bool LoadFile(wxInputStream& stream, long type, int index = -1) { return LoadFile(stream, (wxBitmapType)type, index); } ) wxDEPRECATED( bool SaveFile(wxOutputStream& stream, long type) const { return SaveFile(stream, (wxBitmapType)type); } ) #endif // wxUSE_STREAMS wxDEPRECATED( bool LoadFile(const wxString& name, long type, int index = -1) { return LoadFile(name, (wxBitmapType)type, index); } ) wxDEPRECATED( bool SaveFile(const wxString& name, long type) const { return SaveFile(name, (wxBitmapType)type); } ) static wxDEPRECATED( wxImageHandler *FindHandler(const wxString& ext, long type) { return FindHandler(ext, (wxBitmapType)type); } ) static wxDEPRECATED( wxImageHandler *FindHandler(long imageType) { return FindHandler((wxBitmapType)imageType); } ) #endif // WXWIN_COMPATIBILITY_2_8 protected: static wxList sm_handlers; // return the index of the point with the given coordinates or -1 if the // image is invalid of the coordinates are out of range // // note that index must be multiplied by 3 when using it with RGB array long XYToIndex(int x, int y) const; virtual wxObjectRefData* CreateRefData() const wxOVERRIDE; virtual wxObjectRefData* CloneRefData(const wxObjectRefData* data) const wxOVERRIDE; private: friend class WXDLLIMPEXP_FWD_CORE wxImageHandler; // Possible values for MakeEmptyClone() flags. enum { // Create an image with the same orientation as this one. This is the // default and only exists for symmetry with SwapOrientation. Clone_SameOrientation = 0, // Create an image with the same height as this image width and the // same width as this image height. Clone_SwapOrientation = 1 }; // Returns a new blank image with the same dimensions (or with width and // height swapped if Clone_SwapOrientation flag is given), alpha, and mask // as this image itself. This is used by several functions creating // modified versions of this image. wxImage MakeEmptyClone(int flags = Clone_SameOrientation) const; #if wxUSE_STREAMS // read the image from the specified stream updating image type if // successful bool DoLoad(wxImageHandler& handler, wxInputStream& stream, int index); // write the image to the specified stream and also update the image type // if successful bool DoSave(wxImageHandler& handler, wxOutputStream& stream) const; #endif // wxUSE_STREAMS wxDECLARE_DYNAMIC_CLASS(wxImage); }; extern void WXDLLIMPEXP_CORE wxInitAllImageHandlers(); extern WXDLLIMPEXP_DATA_CORE(wxImage) wxNullImage; //----------------------------------------------------------------------------- // wxImage handlers //----------------------------------------------------------------------------- #include "wx/imagbmp.h" #include "wx/imagpng.h" #include "wx/imaggif.h" #include "wx/imagpcx.h" #include "wx/imagjpeg.h" #include "wx/imagtga.h" #include "wx/imagtiff.h" #include "wx/imagpnm.h" #include "wx/imagxpm.h" #include "wx/imagiff.h" #endif // wxUSE_IMAGE #endif // _WX_IMAGE_H_
h
rticonnextdds-usecases
data/projects/rticonnextdds-usecases/VehicleTracking/ExampleCode/thirdparty/wxWidgets-3.1.2/Linux/include/wx/statusbr.h
///////////////////////////////////////////////////////////////////////////// // Name: wx/statusbr.h // Purpose: wxStatusBar class interface // Author: Vadim Zeitlin // Modified by: // Created: 05.02.00 // Copyright: (c) Vadim Zeitlin // Licence: wxWindows licence ///////////////////////////////////////////////////////////////////////////// #ifndef _WX_STATUSBR_H_BASE_ #define _WX_STATUSBR_H_BASE_ #include "wx/defs.h" #if wxUSE_STATUSBAR #include "wx/control.h" #include "wx/list.h" #include "wx/dynarray.h" extern WXDLLIMPEXP_DATA_CORE(const char) wxStatusBarNameStr[]; // ---------------------------------------------------------------------------- // wxStatusBar constants // ---------------------------------------------------------------------------- // wxStatusBar styles #define wxSTB_SIZEGRIP 0x0010 #define wxSTB_SHOW_TIPS 0x0020 #define wxSTB_ELLIPSIZE_START 0x0040 #define wxSTB_ELLIPSIZE_MIDDLE 0x0080 #define wxSTB_ELLIPSIZE_END 0x0100 #define wxSTB_DEFAULT_STYLE (wxSTB_SIZEGRIP|wxSTB_ELLIPSIZE_END|wxSTB_SHOW_TIPS|wxFULL_REPAINT_ON_RESIZE) // old compat style name: #define wxST_SIZEGRIP wxSTB_SIZEGRIP // style flags for wxStatusBar fields #define wxSB_NORMAL 0x0000 #define wxSB_FLAT 0x0001 #define wxSB_RAISED 0x0002 #define wxSB_SUNKEN 0x0003 // ---------------------------------------------------------------------------- // wxStatusBarPane: an helper for wxStatusBar // ---------------------------------------------------------------------------- class WXDLLIMPEXP_CORE wxStatusBarPane { public: wxStatusBarPane(int style = wxSB_NORMAL, int width = 0) : m_nStyle(style), m_nWidth(width) { m_bEllipsized = false; } int GetWidth() const { return m_nWidth; } int GetStyle() const { return m_nStyle; } wxString GetText() const { return m_text; } // implementation-only from now on // ------------------------------- bool IsEllipsized() const { return m_bEllipsized; } void SetIsEllipsized(bool isEllipsized) { m_bEllipsized = isEllipsized; } void SetWidth(int width) { m_nWidth = width; } void SetStyle(int style) { m_nStyle = style; } // set text, return true if it changed or false if it was already set to // this value bool SetText(const wxString& text); // save the existing text on top of our stack and make the new text // current; return true if the text really changed bool PushText(const wxString& text); // restore the message saved by the last call to Push() (unless it was // changed by an intervening call to SetText()) and return true if we // really restored anything bool PopText(); private: int m_nStyle; int m_nWidth; // may be negative, indicating a variable-width field wxString m_text; // the array used to keep the previous values of this pane after a // PushStatusText() call, its top element is the value to restore after the // next PopStatusText() call while the currently shown value is always in // m_text wxArrayString m_arrStack; // is the currently shown value shown with ellipsis in the status bar? bool m_bEllipsized; }; WX_DECLARE_EXPORTED_OBJARRAY(wxStatusBarPane, wxStatusBarPaneArray); // ---------------------------------------------------------------------------- // wxStatusBar: a window near the bottom of the frame used for status info // ---------------------------------------------------------------------------- class WXDLLIMPEXP_CORE wxStatusBarBase : public wxControl { public: wxStatusBarBase(); virtual ~wxStatusBarBase(); // field count // ----------- // set the number of fields and call SetStatusWidths(widths) if widths are // given virtual void SetFieldsCount(int number = 1, const int *widths = NULL); int GetFieldsCount() const { return (int)m_panes.GetCount(); } // field text // ---------- // just change or get the currently shown text void SetStatusText(const wxString& text, int number = 0); wxString GetStatusText(int number = 0) const; // change the currently shown text to the new one and save the current // value to be restored by the next call to PopStatusText() void PushStatusText(const wxString& text, int number = 0); void PopStatusText(int number = 0); // fields widths // ------------- // set status field widths as absolute numbers: positive widths mean that // the field has the specified absolute width, negative widths are // interpreted as the sizer options, i.e. the extra space (total space // minus the sum of fixed width fields) is divided between the fields with // negative width according to the abs value of the width (field with width // -2 grows twice as much as one with width -1 &c) virtual void SetStatusWidths(int n, const int widths[]); int GetStatusWidth(int n) const { return m_panes[n].GetWidth(); } // field styles // ------------ // Set the field border style to one of wxSB_XXX values. virtual void SetStatusStyles(int n, const int styles[]); int GetStatusStyle(int n) const { return m_panes[n].GetStyle(); } // geometry // -------- // Get the position and size of the field's internal bounding rectangle virtual bool GetFieldRect(int i, wxRect& rect) const = 0; // sets the minimal vertical size of the status bar virtual void SetMinHeight(int height) = 0; // get the dimensions of the horizontal and vertical borders virtual int GetBorderX() const = 0; virtual int GetBorderY() const = 0; wxSize GetBorders() const { return wxSize(GetBorderX(), GetBorderY()); } // miscellaneous // ------------- const wxStatusBarPane& GetField(int n) const { return m_panes[n]; } // wxWindow overrides: // don't want status bars to accept the focus at all virtual bool AcceptsFocus() const wxOVERRIDE { return false; } // the client size of a toplevel window doesn't include the status bar virtual bool CanBeOutsideClientArea() const wxOVERRIDE { return true; } protected: // called after the status bar pane text changed and should update its // display virtual void DoUpdateStatusText(int number) = 0; // wxWindow overrides: #if wxUSE_TOOLTIPS virtual void DoSetToolTip( wxToolTip *tip ) wxOVERRIDE { wxASSERT_MSG(!HasFlag(wxSTB_SHOW_TIPS), "Do not set tooltip(s) manually when using wxSTB_SHOW_TIPS!"); wxWindow::DoSetToolTip(tip); } #endif // wxUSE_TOOLTIPS virtual wxBorder GetDefaultBorder() const wxOVERRIDE { return wxBORDER_NONE; } // internal helpers & data: // calculate the real field widths for the given total available size wxArrayInt CalculateAbsWidths(wxCoord widthTotal) const; // should be called to remember if the pane text is currently being show // ellipsized or not void SetEllipsizedFlag(int n, bool isEllipsized); // the array with the pane infos: wxStatusBarPaneArray m_panes; // if true overrides the width info of the wxStatusBarPanes bool m_bSameWidthForAllPanes; wxDECLARE_NO_COPY_CLASS(wxStatusBarBase); }; // ---------------------------------------------------------------------------- // include the actual wxStatusBar class declaration // ---------------------------------------------------------------------------- #if defined(__WXUNIVERSAL__) #define wxStatusBarUniv wxStatusBar #include "wx/univ/statusbr.h" #elif defined(__WXMSW__) && wxUSE_NATIVE_STATUSBAR #include "wx/msw/statusbar.h" #elif defined(__WXMAC__) #define wxStatusBarMac wxStatusBar #include "wx/generic/statusbr.h" #include "wx/osx/statusbr.h" #elif defined(__WXQT__) #include "wx/qt/statusbar.h" #else #define wxStatusBarGeneric wxStatusBar #include "wx/generic/statusbr.h" #endif #endif // wxUSE_STATUSBAR #endif // _WX_STATUSBR_H_BASE_
h
rticonnextdds-usecases
data/projects/rticonnextdds-usecases/VehicleTracking/ExampleCode/thirdparty/wxWidgets-3.1.2/Linux/include/wx/xtixml.h
///////////////////////////////////////////////////////////////////////////// // Name: wx/xtixml.h // Purpose: xml streaming runtime metadata information (extended class info) // Author: Stefan Csomor // Modified by: // Created: 27/07/03 // Copyright: (c) 2003 Stefan Csomor // Licence: wxWindows licence ///////////////////////////////////////////////////////////////////////////// #ifndef _WX_XTIXMLH__ #define _WX_XTIXMLH__ #include "wx/defs.h" #if wxUSE_EXTENDED_RTTI #include "wx/string.h" #include "wx/xtistrm.h" /* class WXDLLIMPEXP_XML wxXmlNode; class WXDLLIMPEXP_BASE wxPropertyInfo; class WXDLLIMPEXP_BASE wxObject; class WXDLLIMPEXP_BASE wxClassInfo; class WXDLLIMPEXP_BASE wxAnyList; class WXDLLIMPEXP_BASE wxHandlerInfo; class WXDLLIMPEXP_BASE wxObjectWriterCallback; */ class WXDLLIMPEXP_XML wxObjectXmlWriter: public wxObjectWriter { public: wxObjectXmlWriter( wxXmlNode * parent ); virtual ~wxObjectXmlWriter(); // // streaming callbacks // // these callbacks really write out the values in the stream format // // // streaming callbacks // // these callbacks really write out the values in the stream format // begins writing out a new toplevel entry which has the indicated unique name virtual void DoBeginWriteTopLevelEntry( const wxString &name ); // ends writing out a new toplevel entry which has the indicated unique name virtual void DoEndWriteTopLevelEntry( const wxString &name ); // start of writing an object having the passed in ID virtual void DoBeginWriteObject(const wxObject *object, const wxClassInfo *classInfo, int objectID, const wxStringToAnyHashMap &metadata ); // end of writing an toplevel object name param is used for unique // identification within the container virtual void DoEndWriteObject(const wxObject *object, const wxClassInfo *classInfo, int objectID ); // writes a simple property in the stream format virtual void DoWriteSimpleType( const wxAny &value ); // start of writing a complex property into the stream ( virtual void DoBeginWriteProperty( const wxPropertyInfo *propInfo ); // end of writing a complex property into the stream virtual void DoEndWriteProperty( const wxPropertyInfo *propInfo ); virtual void DoBeginWriteElement(); virtual void DoEndWriteElement(); // insert an object reference to an already written object virtual void DoWriteRepeatedObject( int objectID ); // insert a null reference virtual void DoWriteNullObject(); // writes a delegate in the stream format virtual void DoWriteDelegate( const wxObject *object, const wxClassInfo* classInfo, const wxPropertyInfo *propInfo, const wxObject *eventSink, int sinkObjectID, const wxClassInfo* eventSinkClassInfo, const wxHandlerInfo* handlerIndo ); private: struct wxObjectXmlWriterInternal; wxObjectXmlWriterInternal* m_data; }; /* wxObjectXmlReader handles streaming in a class from XML */ class WXDLLIMPEXP_XML wxObjectXmlReader: public wxObjectReader { public: wxObjectXmlReader(wxXmlNode *parent) { m_parent = parent; } virtual ~wxObjectXmlReader() {} // Reads a component from XML. The return value is the root object ID, which can // then be used to ask the readercallback about that object virtual int ReadObject( const wxString &name, wxObjectReaderCallback *readercallback ); private: int ReadComponent(wxXmlNode *parent, wxObjectReaderCallback *callbacks); // read the content of this node (simple type) and return the corresponding value wxAny ReadValue(wxXmlNode *Node, const wxTypeInfo *type ); wxXmlNode * m_parent; }; #endif // wxUSE_EXTENDED_RTTI #endif
h
rticonnextdds-usecases
data/projects/rticonnextdds-usecases/VehicleTracking/ExampleCode/thirdparty/wxWidgets-3.1.2/Linux/include/wx/memtext.h
/////////////////////////////////////////////////////////////////////////////// // Name: wx/memtext.h // Purpose: wxMemoryText allows to use wxTextBuffer without a file // Created: 14.11.01 // Author: Morten Hanssen // Copyright: (c) 2001 Morten Hanssen // Licence: wxWindows licence /////////////////////////////////////////////////////////////////////////////// #ifndef _WX_MEMTEXT_H #define _WX_MEMTEXT_H #include "wx/defs.h" // there is no separate setting for wxMemoryText, it's smallish anyhow #if wxUSE_TEXTBUFFER // ---------------------------------------------------------------------------- // wxMemoryText // ---------------------------------------------------------------------------- class WXDLLIMPEXP_BASE wxMemoryText : public wxTextBuffer { public: // Constructors. wxMemoryText() { } wxMemoryText(const wxString& name) : wxTextBuffer(name) { } protected: virtual bool OnExists() const wxOVERRIDE { return false; } virtual bool OnOpen(const wxString & WXUNUSED(strBufferName), wxTextBufferOpenMode WXUNUSED(OpenMode)) wxOVERRIDE { return true; } virtual bool OnClose() wxOVERRIDE { return true; } virtual bool OnRead(const wxMBConv& WXUNUSED(conv)) wxOVERRIDE { return true; } virtual bool OnWrite(wxTextFileType WXUNUSED(typeNew), const wxMBConv& WXUNUSED(conv) = wxMBConvUTF8()) wxOVERRIDE { return true; } private: wxDECLARE_NO_COPY_CLASS(wxMemoryText); }; #endif // wxUSE_TEXTBUFFER #endif // _WX_MEMTEXT_H
h
rticonnextdds-usecases
data/projects/rticonnextdds-usecases/VehicleTracking/ExampleCode/thirdparty/wxWidgets-3.1.2/Linux/include/wx/debug.h
///////////////////////////////////////////////////////////////////////////// // Name: wx/debug.h // Purpose: Misc debug functions and macros // Author: Vadim Zeitlin // Created: 29/01/98 // Copyright: (c) 1998-2009 Vadim Zeitlin <[email protected]> // Licence: wxWindows licence ///////////////////////////////////////////////////////////////////////////// #ifndef _WX_DEBUG_H_ #define _WX_DEBUG_H_ #include <assert.h> #include <limits.h> // for CHAR_BIT used below #include "wx/chartype.h" // for __TFILE__ and wxChar #include "wx/cpp.h" // for __WXFUNCTION__ #include "wx/dlimpexp.h" // for WXDLLIMPEXP_FWD_BASE class WXDLLIMPEXP_FWD_BASE wxString; class WXDLLIMPEXP_FWD_BASE wxCStrData; // ---------------------------------------------------------------------------- // Defines controlling the debugging macros // ---------------------------------------------------------------------------- /* wxWidgets can be built with several different levels of debug support specified by the value of wxDEBUG_LEVEL constant: 0: No assertion macros at all, this should only be used when optimizing for resource-constrained systems (typically embedded ones). 1: Default level, most of the assertions are enabled. 2: Maximal (at least for now): asserts which are "expensive" (performance-wise) or only make sense for finding errors in wxWidgets itself, as opposed to bugs in applications using it, are also enabled. */ // unless wxDEBUG_LEVEL is predefined (by configure or via wx/setup.h under // Windows), use the default #if !defined(wxDEBUG_LEVEL) #define wxDEBUG_LEVEL 1 #endif // !defined(wxDEBUG_LEVEL) /* __WXDEBUG__ is defined when wxDEBUG_LEVEL != 0. This is done mostly for compatibility but it also provides a simpler way to check if asserts and debug logging is enabled at all. */ #if wxDEBUG_LEVEL > 0 #ifndef __WXDEBUG__ #define __WXDEBUG__ #endif #else #undef __WXDEBUG__ #endif // Finally there is also a very old WXDEBUG macro not used anywhere at all, it // is only defined for compatibility. #ifdef __WXDEBUG__ #if !defined(WXDEBUG) || !WXDEBUG #undef WXDEBUG #define WXDEBUG 1 #endif // !WXDEBUG #endif // __WXDEBUG__ // ---------------------------------------------------------------------------- // Handling assertion failures // ---------------------------------------------------------------------------- /* Type for the function called in case of assert failure, see wxSetAssertHandler(). */ typedef void (*wxAssertHandler_t)(const wxString& file, int line, const wxString& func, const wxString& cond, const wxString& msg); #if wxDEBUG_LEVEL // the global assert handler function, if it is NULL asserts don't check their // conditions extern WXDLLIMPEXP_DATA_BASE(wxAssertHandler_t) wxTheAssertHandler; /* Sets the function to be called in case of assertion failure. The default assert handler forwards to wxApp::OnAssertFailure() whose default behaviour is, in turn, to show the standard assertion failure dialog if a wxApp object exists or shows the same dialog itself directly otherwise. While usually it is enough -- and more convenient -- to just override OnAssertFailure(), to handle all assertion failures, including those occurring even before wxApp object creation or after its destruction you need to provide your assertion handler function. This function also provides a simple way to disable all asserts: simply pass NULL pointer to it. Doing this will result in not even evaluating assert conditions at all, avoiding almost all run-time cost of asserts. Notice that this function is not MT-safe, so you should call it before starting any other threads. The return value of this function is the previous assertion handler. It can be called after any pre-processing by your handler and can also be restored later if you uninstall your handler. */ inline wxAssertHandler_t wxSetAssertHandler(wxAssertHandler_t handler) { const wxAssertHandler_t old = wxTheAssertHandler; wxTheAssertHandler = handler; return old; } /* Reset the default assert handler. This may be used to enable asserts, which are disabled by default in this case, for programs built in release build (NDEBUG defined). */ extern void WXDLLIMPEXP_BASE wxSetDefaultAssertHandler(); #else // !wxDEBUG_LEVEL // provide empty stubs in case assertions are completely disabled // // NB: can't use WXUNUSED() here as we're included from wx/defs.h before it is // defined inline wxAssertHandler_t wxSetAssertHandler(wxAssertHandler_t /* handler */) { return NULL; } inline void wxSetDefaultAssertHandler() { } #endif // wxDEBUG_LEVEL/!wxDEBUG_LEVEL // simply a synonym for wxSetAssertHandler(NULL) inline void wxDisableAsserts() { wxSetAssertHandler(NULL); } /* A macro which disables asserts for applications compiled in release build. By default, wxIMPLEMENT_APP (or rather wxIMPLEMENT_WXWIN_MAIN) disable the asserts in the applications compiled in the release build by calling this. It does nothing if NDEBUG is not defined. */ #ifdef NDEBUG #define wxDISABLE_ASSERTS_IN_RELEASE_BUILD() wxDisableAsserts() #else #define wxDISABLE_ASSERTS_IN_RELEASE_BUILD() #endif #if wxDEBUG_LEVEL /* wxOnAssert() is used by the debugging macros defined below. Different overloads are needed because these macros can be used with or without wxT(). All of them are implemented in src/common/appcmn.cpp and unconditionally call wxTheAssertHandler so the caller must check that it is non-NULL (assert macros do it). */ #if wxUSE_UNICODE // these overloads are the ones typically used by debugging macros: we have to // provide wxChar* msg version because it's common to use wxT() in the macros // and finally, we can't use const wx(char)* msg = NULL, because that would // be ambiguous // // also notice that these functions can't be inline as wxString is not defined // yet (and can't be as wxString code itself may use assertions) extern WXDLLIMPEXP_BASE void wxOnAssert(const char *file, int line, const char *func, const char *cond); extern WXDLLIMPEXP_BASE void wxOnAssert(const char *file, int line, const char *func, const char *cond, const char *msg); extern WXDLLIMPEXP_BASE void wxOnAssert(const char *file, int line, const char *func, const char *cond, const wxChar *msg) ; #endif /* wxUSE_UNICODE */ // this version is for compatibility with wx 2.8 Unicode build only, we don't // use it ourselves any more except in ANSI-only build in which case it is all // we need extern WXDLLIMPEXP_BASE void wxOnAssert(const wxChar *file, int line, const char *func, const wxChar *cond, const wxChar *msg = NULL); // these overloads work when msg passed to debug macro is a string and we // also have to provide wxCStrData overload to resolve ambiguity which would // otherwise arise from wxASSERT( s.c_str() ) extern WXDLLIMPEXP_BASE void wxOnAssert(const wxString& file, int line, const wxString& func, const wxString& cond, const wxString& msg); extern WXDLLIMPEXP_BASE void wxOnAssert(const wxString& file, int line, const wxString& func, const wxString& cond); extern WXDLLIMPEXP_BASE void wxOnAssert(const char *file, int line, const char *func, const char *cond, const wxCStrData& msg); extern WXDLLIMPEXP_BASE void wxOnAssert(const char *file, int line, const char *func, const char *cond, const wxString& msg); #endif // wxDEBUG_LEVEL // ---------------------------------------------------------------------------- // Debugging macros // ---------------------------------------------------------------------------- /* Assertion macros: check if the condition is true and call assert handler (which will by default notify the user about failure) if it isn't. wxASSERT and wxFAIL macros as well as wxTrap() function do nothing at all if wxDEBUG_LEVEL is 0 however they do check their conditions at default debug level 1, unlike the previous wxWidgets versions. wxASSERT_LEVEL_2 is meant to be used for "expensive" asserts which should normally be disabled because they have a big impact on performance and so this macro only does anything if wxDEBUG_LEVEL >= 2. */ #if wxDEBUG_LEVEL // wxTrap() can be used to break into the debugger unconditionally // (assuming the program is running under debugger, of course). // // If possible, we prefer to define it as a macro rather than as a function // to open the debugger at the position where we trapped and not inside the // trap function itself which is not very useful. #ifdef __VISUALC__ #define wxTrap() __debugbreak() #elif defined(__GNUC__) #if defined(__i386) || defined(__x86_64) #define wxTrap() asm volatile ("int $3") #endif #endif #ifndef wxTrap // For all the other cases, use a generic function. extern WXDLLIMPEXP_BASE void wxTrap(); #endif // Global flag used to indicate that assert macros should call wxTrap(): it // is set by the default assert handler if the user answers yes to the // question of whether to trap. extern WXDLLIMPEXP_DATA_BASE(bool) wxTrapInAssert; // This macro checks if the condition is true and calls the assert handler // with the provided message if it isn't and finally traps if the special // flag indicating that it should do it was set by the handler. // // Notice that we don't use the handler return value for compatibility // reasons (if we changed its return type, we'd need to change wxApp:: // OnAssertFailure() too which would break user code overriding it), hence // the need for the ugly global flag. #define wxASSERT_MSG_AT(cond, msg, file, line, func) \ wxSTATEMENT_MACRO_BEGIN \ if ( wxTheAssertHandler && !(cond) && \ (wxOnAssert(file, line, func, #cond, msg), \ wxTrapInAssert) ) \ { \ wxTrapInAssert = false; \ wxTrap(); \ } \ wxSTATEMENT_MACRO_END // A version asserting at the current location. #define wxASSERT_MSG(cond, msg) \ wxASSERT_MSG_AT(cond, msg, __FILE__, __LINE__, __WXFUNCTION__) // a version without any additional message, don't use unless condition // itself is fully self-explanatory #define wxASSERT(cond) wxASSERT_MSG(cond, (const char*)NULL) // wxFAIL is a special form of assert: it always triggers (and so is // usually used in normally unreachable code) #define wxFAIL_COND_MSG_AT(cond, msg, file, line, func) \ wxSTATEMENT_MACRO_BEGIN \ if ( wxTheAssertHandler && \ (wxOnAssert(file, line, func, #cond, msg), \ wxTrapInAssert) ) \ { \ wxTrapInAssert = false; \ wxTrap(); \ } \ wxSTATEMENT_MACRO_END #define wxFAIL_MSG_AT(msg, file, line, func) \ wxFAIL_COND_MSG_AT("Assert failure", msg, file, line, func) #define wxFAIL_COND_MSG(cond, msg) \ wxFAIL_COND_MSG_AT(cond, msg, __FILE__, __LINE__, __WXFUNCTION__) #define wxFAIL_MSG(msg) wxFAIL_COND_MSG("Assert failure", msg) #define wxFAIL wxFAIL_MSG((const char*)NULL) #else // !wxDEBUG_LEVEL #define wxTrap() #define wxASSERT(cond) #define wxASSERT_MSG(cond, msg) #define wxFAIL #define wxFAIL_MSG(msg) #define wxFAIL_COND_MSG(cond, msg) #endif // wxDEBUG_LEVEL #if wxDEBUG_LEVEL >= 2 #define wxASSERT_LEVEL_2_MSG(cond, msg) wxASSERT_MSG(cond, msg) #define wxASSERT_LEVEL_2(cond) wxASSERT(cond) #else // wxDEBUG_LEVEL < 2 #define wxASSERT_LEVEL_2_MSG(cond, msg) #define wxASSERT_LEVEL_2(cond) #endif // This is simply a wrapper for the standard abort() which is not available // under all platforms. // // It isn't really debug-related but there doesn't seem to be any better place // for it, so declare it here and define it in appbase.cpp, together with // wxTrap(). extern void WXDLLIMPEXP_BASE wxAbort(); /* wxCHECK macros always check their conditions, setting debug level to 0 only makes them silent in case of failure, otherwise -- including at default debug level 1 -- they call the assert handler if the condition is false They are supposed to be used only in invalid situation: for example, an invalid parameter (e.g. a NULL pointer) is passed to a function. Instead of dereferencing it and causing core dump the function might use wxCHECK_RET( p != NULL, "pointer can't be NULL" ) */ // the generic macro: takes the condition to check, the statement to be executed // in case the condition is false and the message to pass to the assert handler #define wxCHECK2_MSG(cond, op, msg) \ if ( cond ) \ {} \ else \ { \ wxFAIL_COND_MSG(#cond, msg); \ op; \ } \ struct wxDummyCheckStruct /* just to force a semicolon */ // check which returns with the specified return code if the condition fails #define wxCHECK_MSG(cond, rc, msg) wxCHECK2_MSG(cond, return rc, msg) // check that expression is true, "return" if not (also FAILs in debug mode) #define wxCHECK(cond, rc) wxCHECK_MSG(cond, rc, (const char*)NULL) // check that expression is true, perform op if not #define wxCHECK2(cond, op) wxCHECK2_MSG(cond, op, (const char*)NULL) // special form of wxCHECK2: as wxCHECK, but for use in void functions // // NB: there is only one form (with msg parameter) and it's intentional: // there is no other way to tell the caller what exactly went wrong // from the void function (of course, the function shouldn't be void // to begin with...) #define wxCHECK_RET(cond, msg) wxCHECK2_MSG(cond, return, msg) // ---------------------------------------------------------------------------- // Compile time asserts // // Unlike the normal assert and related macros above which are checked during // the program run-time the macros below will result in a compilation error if // the condition they check is false. This is usually used to check the // expressions containing sizeof()s which cannot be tested with the // preprocessor. If you can use the #if's, do use them as you can give a more // detailed error message then. // ---------------------------------------------------------------------------- /* How this works (you don't have to understand it to be able to use the macros): we rely on the fact that it is invalid to define a named bit field in a struct of width 0. All the rest are just the hacks to minimize the possibility of the compiler warnings when compiling this macro: in particular, this is why we define a struct and not an object (which would result in a warning about unused variable) and a named struct (otherwise we'd get a warning about an unnamed struct not used to define an object!). */ #define wxMAKE_UNIQUE_ASSERT_NAME wxMAKE_UNIQUE_NAME(wxAssert_) /* The second argument of this macro must be a valid C++ identifier and not a string. I.e. you should use it like this: wxCOMPILE_TIME_ASSERT( sizeof(int) >= 2, YourIntsAreTooSmall ); It may be used both within a function and in the global scope. */ #if defined( __VMS ) namespace wxdebug{ // HP aCC cannot deal with missing names for template value parameters template <bool x> struct STATIC_ASSERTION_FAILURE; template <> struct STATIC_ASSERTION_FAILURE<true> { enum { value = 1 }; }; // HP aCC cannot deal with missing names for template value parameters template<int x> struct static_assert_test{}; } #define WX_JOIN( X, Y ) X##Y #define WX_STATIC_ASSERT_BOOL_CAST(x) (bool)(x) #define wxCOMPILE_TIME_ASSERT(expr, msg) \ typedef ::wxdebug::static_assert_test<\ sizeof(::wxdebug::STATIC_ASSERTION_FAILURE< WX_STATIC_ASSERT_BOOL_CAST( expr ) >)>\ WX_JOIN(wx_static_assert_typedef_, __LINE__) #else #define wxCOMPILE_TIME_ASSERT(expr, msg) \ struct wxMAKE_UNIQUE_ASSERT_NAME { unsigned int msg: expr; } #endif /* When using VC++ 6 with "Edit and Continue" on, the compiler completely mishandles __LINE__ and so wxCOMPILE_TIME_ASSERT() doesn't work, provide a way to make "unique" assert names by specifying a unique prefix explicitly */ #define wxMAKE_UNIQUE_ASSERT_NAME2(text) wxCONCAT(wxAssert_, text) #define wxCOMPILE_TIME_ASSERT2(expr, msg, text) \ struct wxMAKE_UNIQUE_ASSERT_NAME2(text) { unsigned int msg: expr; } // helpers for wxCOMPILE_TIME_ASSERT below, for private use only #define wxMAKE_BITSIZE_MSG(type, size) type ## SmallerThan ## size ## Bits // a special case of compile time assert: check that the size of the given type // is at least the given number of bits #define wxASSERT_MIN_BITSIZE(type, size) \ wxCOMPILE_TIME_ASSERT(sizeof(type) * CHAR_BIT >= size, \ wxMAKE_BITSIZE_MSG(type, size)) // ---------------------------------------------------------------------------- // other miscellaneous debugger-related functions // ---------------------------------------------------------------------------- /* Return true if we're running under debugger. Currently only really works under Win32 and just returns false elsewhere. */ #if defined(__WIN32__) extern bool WXDLLIMPEXP_BASE wxIsDebuggerRunning(); #else // !Mac inline bool wxIsDebuggerRunning() { return false; } #endif // Mac/!Mac // An assert helper used to avoid warning when testing constant expressions, // i.e. wxASSERT( sizeof(int) == 4 ) can generate a compiler warning about // expression being always true, but not using // wxASSERT( wxAssertIsEqual(sizeof(int), 4) ) // // NB: this is made obsolete by wxCOMPILE_TIME_ASSERT() and should no // longer be used. extern bool WXDLLIMPEXP_BASE wxAssertIsEqual(int x, int y); // Use of wxFalse instead of false suppresses compiler warnings about testing // constant expression extern WXDLLIMPEXP_DATA_BASE(const bool) wxFalse; #define wxAssertFailure wxFalse // This is similar to WXUNUSED() and useful for parameters which are only used // in assertions. #if wxDEBUG_LEVEL #define WXUNUSED_UNLESS_DEBUG(param) param #else #define WXUNUSED_UNLESS_DEBUG(param) WXUNUSED(param) #endif #endif // _WX_DEBUG_H_
h
rticonnextdds-usecases
data/projects/rticonnextdds-usecases/VehicleTracking/ExampleCode/thirdparty/wxWidgets-3.1.2/Linux/include/wx/imaggif.h
///////////////////////////////////////////////////////////////////////////// // Name: wx/imaggif.h // Purpose: wxImage GIF handler // Author: Vaclav Slavik, Guillermo Rodriguez Garcia, Gershon Elber, Troels K // Copyright: (c) 1999-2011 Vaclav Slavik, Guillermo Rodriguez Garcia, Gershon Elber, Troels K // Licence: wxWindows licence ///////////////////////////////////////////////////////////////////////////// #ifndef _WX_IMAGGIF_H_ #define _WX_IMAGGIF_H_ #include "wx/image.h" //----------------------------------------------------------------------------- // wxGIFHandler //----------------------------------------------------------------------------- #if wxUSE_GIF #define wxIMAGE_OPTION_GIF_COMMENT wxT("GifComment") #define wxIMAGE_OPTION_GIF_TRANSPARENCY wxS("Transparency") #define wxIMAGE_OPTION_GIF_TRANSPARENCY_HIGHLIGHT wxS("Highlight") #define wxIMAGE_OPTION_GIF_TRANSPARENCY_UNCHANGED wxS("Unchanged") struct wxRGB; struct GifHashTableType; class WXDLLIMPEXP_FWD_CORE wxImageArray; // anidecod.h class WXDLLIMPEXP_CORE wxGIFHandler : public wxImageHandler { public: inline wxGIFHandler() { m_name = wxT("GIF file"); m_extension = wxT("gif"); m_type = wxBITMAP_TYPE_GIF; m_mime = wxT("image/gif"); m_hashTable = NULL; } #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; // Save animated gif bool SaveAnimation(const wxImageArray& images, wxOutputStream *stream, bool verbose = true, int delayMilliSecs = 1000); protected: virtual int DoGetImageCount(wxInputStream& stream) wxOVERRIDE; virtual bool DoCanRead(wxInputStream& stream) wxOVERRIDE; bool DoSaveFile(const wxImage&, wxOutputStream *, bool verbose, bool first, int delayMilliSecs, bool loop, const wxRGB *pal, int palCount, int mask_index); #endif // wxUSE_STREAMS protected: // Declarations for saving unsigned long m_crntShiftDWord; /* For bytes decomposition into codes. */ int m_pixelCount; struct GifHashTableType *m_hashTable; wxInt16 m_EOFCode, /* The EOF LZ code. */ m_clearCode, /* The CLEAR LZ code. */ m_runningCode, /* The next code algorithm can generate. */ m_runningBits, /* The number of bits required to represent RunningCode. */ m_maxCode1, /* 1 bigger than max. possible code, in RunningBits bits. */ m_crntCode, /* Current algorithm code. */ m_crntShiftState; /* Number of bits in CrntShiftDWord. */ wxUint8 m_LZBuf[256]; /* Compressed input is buffered here. */ bool InitHashTable(); void ClearHashTable(); void InsertHashTable(unsigned long key, int code); int ExistsHashTable(unsigned long key); #if wxUSE_STREAMS bool CompressOutput(wxOutputStream *, int code); bool SetupCompress(wxOutputStream *, int bpp); bool CompressLine(wxOutputStream *, const wxUint8 *line, int lineLen); #endif private: wxDECLARE_DYNAMIC_CLASS(wxGIFHandler); }; #endif // wxUSE_GIF #endif // _WX_IMAGGIF_H_
h
rticonnextdds-usecases
data/projects/rticonnextdds-usecases/VehicleTracking/ExampleCode/thirdparty/wxWidgets-3.1.2/Linux/include/wx/simplebook.h
/////////////////////////////////////////////////////////////////////////////// // Name: wx/simplebook.h // Purpose: wxBookCtrlBase-derived class without any controller. // Author: Vadim Zeitlin // Created: 2012-08-21 // Copyright: (c) 2012 Vadim Zeitlin <[email protected]> // Licence: wxWindows licence /////////////////////////////////////////////////////////////////////////////// #ifndef _WX_SIMPLEBOOK_H_ #define _WX_SIMPLEBOOK_H_ #include "wx/bookctrl.h" #if wxUSE_BOOKCTRL #include "wx/vector.h" // ---------------------------------------------------------------------------- // wxSimplebook: a book control without any user-actionable controller. // ---------------------------------------------------------------------------- // NB: This class doesn't use DLL export declaration as it's fully inline. class wxSimplebook : public wxBookCtrlBase { public: wxSimplebook() { Init(); } wxSimplebook(wxWindow *parent, wxWindowID winid = wxID_ANY, const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxDefaultSize, long style = 0, const wxString& name = wxEmptyString) : wxBookCtrlBase(parent, winid, pos, size, style | wxBK_TOP, name) { Init(); } bool Create(wxWindow *parent, wxWindowID winid = wxID_ANY, const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxDefaultSize, long style = 0, const wxString& name = wxEmptyString) { return wxBookCtrlBase::Create(parent, winid, pos, size, style | wxBK_TOP, name); } // Methods specific to this class. // A method allowing to add a new page without any label (which is unused // by this control) and show it immediately. bool ShowNewPage(wxWindow* page) { return AddPage(page, wxString(), true /* select it */); } // Set effect to use for showing/hiding pages. void SetEffects(wxShowEffect showEffect, wxShowEffect hideEffect) { m_showEffect = showEffect; m_hideEffect = hideEffect; } // Or the same effect for both of them. void SetEffect(wxShowEffect effect) { SetEffects(effect, effect); } // And the same for time outs. void SetEffectsTimeouts(unsigned showTimeout, unsigned hideTimeout) { m_showTimeout = showTimeout; m_hideTimeout = hideTimeout; } void SetEffectTimeout(unsigned timeout) { SetEffectsTimeouts(timeout, timeout); } // Implement base class pure virtual methods. // Page management virtual bool InsertPage(size_t n, wxWindow *page, const wxString& text, bool bSelect = false, int imageId = NO_IMAGE) wxOVERRIDE { if ( !wxBookCtrlBase::InsertPage(n, page, text, bSelect, imageId) ) return false; m_pageTexts.insert(m_pageTexts.begin() + n, text); if ( !DoSetSelectionAfterInsertion(n, bSelect) ) page->Hide(); return true; } virtual int SetSelection(size_t n) wxOVERRIDE { return DoSetSelection(n, SetSelection_SendEvent); } virtual int ChangeSelection(size_t n) wxOVERRIDE { return DoSetSelection(n); } // Neither labels nor images are supported but we still store the labels // just in case the user code attaches some importance to them. virtual bool SetPageText(size_t n, const wxString& strText) wxOVERRIDE { wxCHECK_MSG( n < GetPageCount(), false, wxS("Invalid page") ); m_pageTexts[n] = strText; return true; } virtual wxString GetPageText(size_t n) const wxOVERRIDE { wxCHECK_MSG( n < GetPageCount(), wxString(), wxS("Invalid page") ); return m_pageTexts[n]; } virtual bool SetPageImage(size_t WXUNUSED(n), int WXUNUSED(imageId)) wxOVERRIDE { return false; } virtual int GetPageImage(size_t WXUNUSED(n)) const wxOVERRIDE { return NO_IMAGE; } // Override some wxWindow methods too. virtual void SetFocus() wxOVERRIDE { wxWindow* const page = GetCurrentPage(); if ( page ) page->SetFocus(); } protected: virtual void UpdateSelectedPage(size_t WXUNUSED(newsel)) wxOVERRIDE { // Nothing to do here, but must be overridden to avoid the assert in // the base class version. } virtual wxBookCtrlEvent* CreatePageChangingEvent() const wxOVERRIDE { return new wxBookCtrlEvent(wxEVT_BOOKCTRL_PAGE_CHANGING, GetId()); } virtual void MakeChangedEvent(wxBookCtrlEvent& event) wxOVERRIDE { event.SetEventType(wxEVT_BOOKCTRL_PAGE_CHANGED); } virtual wxWindow *DoRemovePage(size_t page) wxOVERRIDE { wxWindow* const win = wxBookCtrlBase::DoRemovePage(page); if ( win ) { m_pageTexts.erase(m_pageTexts.begin() + page); DoSetSelectionAfterRemoval(page); } return win; } virtual void DoSize() wxOVERRIDE { wxWindow* const page = GetCurrentPage(); if ( page ) page->SetSize(GetPageRect()); } virtual void DoShowPage(wxWindow* page, bool show) wxOVERRIDE { if ( show ) page->ShowWithEffect(m_showEffect, m_showTimeout); else page->HideWithEffect(m_hideEffect, m_hideTimeout); } private: void Init() { // We don't need any border as we don't have anything to separate the // page contents from. SetInternalBorder(0); // No effects by default. m_showEffect = m_hideEffect = wxSHOW_EFFECT_NONE; m_showTimeout = m_hideTimeout = 0; } wxVector<wxString> m_pageTexts; wxShowEffect m_showEffect, m_hideEffect; unsigned m_showTimeout, m_hideTimeout; wxDECLARE_NO_COPY_CLASS(wxSimplebook); }; #endif // wxUSE_BOOKCTRL #endif // _WX_SIMPLEBOOK_H_
h
rticonnextdds-usecases
data/projects/rticonnextdds-usecases/VehicleTracking/ExampleCode/thirdparty/wxWidgets-3.1.2/Linux/include/wx/xtiprop.h
///////////////////////////////////////////////////////////////////////////// // Name: wx/xtiprop.h // Purpose: XTI properties // Author: Stefan Csomor // Modified by: Francesco Montorsi // Created: 27/07/03 // Copyright: (c) 1997 Julian Smart // (c) 2003 Stefan Csomor // Licence: wxWindows licence ///////////////////////////////////////////////////////////////////////////// #ifndef _XTIPROP_H_ #define _XTIPROP_H_ #include "wx/defs.h" #if wxUSE_EXTENDED_RTTI #include "wx/xti.h" #include "wx/any.h" /* class WXDLLIMPEXP_BASE wxObject; class WXDLLIMPEXP_BASE wxClassInfo; class WXDLLIMPEXP_BASE wxDynamicClassInfo; */ class WXDLLIMPEXP_BASE wxHashTable; class WXDLLIMPEXP_BASE wxHashTable_Node; class WXDLLIMPEXP_BASE wxEvent; class WXDLLIMPEXP_BASE wxEvtHandler; // ---------------------------------------------------------------------------- // Property Accessors // // wxPropertySetter/Getter/CollectionGetter/CollectionAdder are all property // accessors which are managed by wxPropertyAccessor class which in turn is // handled by wxPropertyInfo. // ---------------------------------------------------------------------------- class WXDLLIMPEXP_BASE wxPropertySetter { public: wxPropertySetter( const wxString name ) { m_name = name; } virtual ~wxPropertySetter() {} virtual void Set( wxObject *object, const wxAny &variantValue ) const = 0; const wxString& GetName() const { return m_name; } private: wxString m_name; }; class WXDLLIMPEXP_BASE wxPropertyGetter { public: wxPropertyGetter( const wxString name ) { m_name = name; } virtual ~wxPropertyGetter() {} virtual void Get( const wxObject *object, wxAny& result) const = 0; const wxString& GetName() const { return m_name; } private: wxString m_name; }; class WXDLLIMPEXP_BASE wxPropertyCollectionGetter { public: wxPropertyCollectionGetter( const wxString name ) { m_name = name; } virtual ~wxPropertyCollectionGetter() {} virtual void Get( const wxObject *object, wxAnyList& result) const = 0; const wxString& GetName() const { return m_name; } private: wxString m_name; }; template<typename coll_t> void WXDLLIMPEXP_BASE \ wxCollectionToVariantArray( const coll_t& coll, wxAnyList& result ); class WXDLLIMPEXP_BASE wxPropertyCollectionAdder { public: wxPropertyCollectionAdder( const wxString name ) { m_name = name; } virtual ~wxPropertyCollectionAdder() {} virtual void Add( wxObject *object, const wxAny &variantValue ) const= 0; const wxString& GetName() const { return m_name; } private: wxString m_name; }; #define wxPROPERTY_SETTER( property, Klass, valueType, setterMethod ) \ class wxPropertySetter##property : public wxPropertySetter \ { \ public: \ wxPropertySetter##property() : wxPropertySetter( wxT(#setterMethod) ) {} \ virtual ~wxPropertySetter##property() {} \ \ void Set( wxObject *object, const wxAny &variantValue ) const \ { \ Klass *obj = dynamic_cast<Klass*>(object); \ valueType tempobj; \ if ( variantValue.GetAs(&tempobj) ) \ obj->setterMethod(tempobj); \ else \ obj->setterMethod(*variantValue.As<valueType*>()); \ } \ }; #define wxPROPERTY_GETTER( property, Klass, valueType, gettermethod ) \ class wxPropertyGetter##property : public wxPropertyGetter \ { \ public: \ wxPropertyGetter##property() : wxPropertyGetter( wxT(#gettermethod) ) {} \ virtual ~wxPropertyGetter##property() {} \ \ void Get( const wxObject *object, wxAny &result) const \ { \ const Klass *obj = dynamic_cast<const Klass*>(object); \ result = wxAny( obj->gettermethod() ); \ } \ }; #define wxPROPERTY_COLLECTION_ADDER( property, Klass, valueType, addermethod ) \ class wxPropertyCollectionAdder##property : public wxPropertyCollectionAdder \ { \ public: \ wxPropertyCollectionAdder##property() : wxPropertyCollectionAdder( wxT(#addermethod) ) {} \ virtual ~wxPropertyCollectionAdder##property() {} \ \ void Add( wxObject *object, const wxAny &variantValue ) const \ { \ Klass *obj = dynamic_cast<Klass*>(object); \ valueType tempobj; \ if ( variantValue.GetAs(&tempobj) ) \ obj->addermethod(tempobj); \ else \ obj->addermethod(*variantValue.As<valueType*>()); \ } \ }; #define wxPROPERTY_COLLECTION_GETTER( property, Klass, valueType, gettermethod ) \ class wxPropertyCollectionGetter##property : public wxPropertyCollectionGetter \ { \ public: \ wxPropertyCollectionGetter##property() : wxPropertyCollectionGetter( wxT(#gettermethod) ) {} \ virtual ~wxPropertyCollectionGetter##property() {} \ \ void Get( const wxObject *object, wxAnyList &result) const \ { \ const Klass *obj = dynamic_cast<const Klass*>(object); \ wxCollectionToVariantArray( obj->gettermethod(), result ); \ } \ }; class WXDLLIMPEXP_BASE wxPropertyAccessor { public: wxPropertyAccessor( wxPropertySetter *setter, wxPropertyGetter *getter, wxPropertyCollectionAdder *adder, wxPropertyCollectionGetter *collectionGetter ) { m_setter = setter; m_getter = getter; m_adder = adder; m_collectionGetter = collectionGetter; } virtual ~wxPropertyAccessor() {} // Setting a simple property (non-collection) virtual void SetProperty(wxObject *object, const wxAny &value) const { if ( m_setter ) m_setter->Set( object, value ); else wxLogError( wxGetTranslation("SetProperty called w/o valid setter") ); } // Getting a simple property (non-collection) virtual void GetProperty(const wxObject *object, wxAny &result) const { if ( m_getter ) m_getter->Get( object, result ); else wxLogError( wxGetTranslation("GetProperty called w/o valid getter") ); } // Adding an element to a collection property virtual void AddToPropertyCollection(wxObject *object, const wxAny &value) const { if ( m_adder ) m_adder->Add( object, value ); else wxLogError( wxGetTranslation("AddToPropertyCollection called w/o valid adder") ); } // Getting a collection property virtual void GetPropertyCollection( const wxObject *obj, wxAnyList &result) const { if ( m_collectionGetter ) m_collectionGetter->Get( obj, result); else wxLogError( wxGetTranslation("GetPropertyCollection called w/o valid collection getter") ); } virtual bool HasSetter() const { return m_setter != NULL; } virtual bool HasCollectionGetter() const { return m_collectionGetter != NULL; } virtual bool HasGetter() const { return m_getter != NULL; } virtual bool HasAdder() const { return m_adder != NULL; } virtual const wxString& GetCollectionGetterName() const { return m_collectionGetter->GetName(); } virtual const wxString& GetGetterName() const { return m_getter->GetName(); } virtual const wxString& GetSetterName() const { return m_setter->GetName(); } virtual const wxString& GetAdderName() const { return m_adder->GetName(); } protected: wxPropertySetter *m_setter; wxPropertyCollectionAdder *m_adder; wxPropertyGetter *m_getter; wxPropertyCollectionGetter* m_collectionGetter; }; class WXDLLIMPEXP_BASE wxGenericPropertyAccessor : public wxPropertyAccessor { public: wxGenericPropertyAccessor( const wxString &propName ); virtual ~wxGenericPropertyAccessor(); void RenameProperty( const wxString& WXUNUSED_UNLESS_DEBUG(oldName), const wxString& newName ) { wxASSERT( oldName == m_propertyName ); m_propertyName = newName; } virtual bool HasSetter() const { return true; } virtual bool HasGetter() const { return true; } virtual bool HasAdder() const { return false; } virtual bool HasCollectionGetter() const { return false; } virtual const wxString& GetGetterName() const { return m_getterName; } virtual const wxString& GetSetterName() const { return m_setterName; } virtual void SetProperty(wxObject *object, const wxAny &value) const; virtual void GetProperty(const wxObject *object, wxAny &value) const; // Adding an element to a collection property virtual void AddToPropertyCollection(wxObject *WXUNUSED(object), const wxAny &WXUNUSED(value)) const { wxLogError( wxGetTranslation("AddToPropertyCollection called on a generic accessor") ); } // Getting a collection property virtual void GetPropertyCollection( const wxObject *WXUNUSED(obj), wxAnyList &WXUNUSED(result)) const { wxLogError ( wxGetTranslation("GetPropertyCollection called on a generic accessor") ); } private: struct wxGenericPropertyAccessorInternal; wxGenericPropertyAccessorInternal* m_data; wxString m_propertyName; wxString m_setterName; wxString m_getterName; }; typedef long wxPropertyInfoFlags; enum { // will be removed in future releases wxPROP_DEPRECATED = 0x00000001, // object graph property, will be streamed with priority (after constructor properties) wxPROP_OBJECT_GRAPH = 0x00000002, // this will only be streamed out and in as enum/set, the internal representation // is still a long wxPROP_ENUM_STORE_LONG = 0x00000004, // don't stream out this property, needed eg to avoid streaming out children // that are always created by their parents wxPROP_DONT_STREAM = 0x00000008 }; // ---------------------------------------------------------------------------- // Property Support // // wxPropertyInfo is used to inquire of the property by name. It doesn't // provide access to the property, only information about it. If you // want access, look at wxPropertyAccessor. // ---------------------------------------------------------------------------- class WXDLLIMPEXP_BASE wxPropertyInfo { friend class /* WXDLLIMPEXP_BASE */ wxDynamicClassInfo; public: wxPropertyInfo(wxPropertyInfo* &iter, wxClassInfo* itsClass, const wxString& name, const wxString& typeName, wxPropertyAccessor *accessor, wxAny dv, wxPropertyInfoFlags flags = 0, const wxString& helpString = wxEmptyString, const wxString& groupString = wxEmptyString) : m_itsClass(itsClass), m_name(name), m_typeInfo(NULL), m_typeName(typeName), m_collectionElementTypeInfo(NULL), m_accessor(accessor), m_defaultValue(dv), m_flags(flags), m_helpString(helpString), m_groupString(groupString) { Insert(iter); } wxPropertyInfo(wxPropertyInfo* &iter, wxClassInfo* itsClass, const wxString& name, wxEventSourceTypeInfo* type, wxPropertyAccessor *accessor, wxAny dv, wxPropertyInfoFlags flags = 0, const wxString& helpString = wxEmptyString, const wxString& groupString = wxEmptyString) : m_itsClass(itsClass), m_name(name), m_typeInfo(type), m_collectionElementTypeInfo(NULL), m_accessor(accessor), m_defaultValue(dv), m_flags(flags), m_helpString(helpString), m_groupString(groupString) { Insert(iter); } wxPropertyInfo(wxPropertyInfo* &iter, wxClassInfo* itsClass, const wxString& name, const wxString& collectionTypeName, const wxString& elementTypeName, wxPropertyAccessor *accessor, wxPropertyInfoFlags flags = 0, const wxString& helpString = wxEmptyString, const wxString& groupString = wxEmptyString) : m_itsClass(itsClass), m_name(name), m_typeInfo(NULL), m_typeName(collectionTypeName), m_collectionElementTypeInfo(NULL), m_collectionElementTypeName(elementTypeName), m_accessor(accessor), m_flags(flags), m_helpString(helpString), m_groupString(groupString) { Insert(iter); } ~wxPropertyInfo() { Remove(); } // return the class this property is declared in const wxClassInfo* GetDeclaringClass() const { return m_itsClass; } // return the name of this property const wxString& GetName() const { return m_name; } // returns the flags of this property wxPropertyInfoFlags GetFlags() const { return m_flags; } // returns the short help string of this property const wxString& GetHelpString() const { return m_helpString; } // returns the group string of this property const wxString& GetGroupString() const { return m_groupString; } // return the element type info of this property (for collections, otherwise NULL) const wxTypeInfo * GetCollectionElementTypeInfo() const { if ( m_collectionElementTypeInfo == NULL ) m_collectionElementTypeInfo = wxTypeInfo::FindType(m_collectionElementTypeName); return m_collectionElementTypeInfo; } // return the type info of this property const wxTypeInfo * GetTypeInfo() const { if ( m_typeInfo == NULL ) m_typeInfo = wxTypeInfo::FindType(m_typeName); return m_typeInfo; } // return the accessor for this property wxPropertyAccessor* GetAccessor() const { return m_accessor; } // returns NULL if this is the last property of this class wxPropertyInfo* GetNext() const { return m_next; } // returns the default value of this property, its kind may be wxT_VOID if it is not valid wxAny GetDefaultValue() const { return m_defaultValue; } private: // inserts this property at the end of the linked chain which begins // with "iter" property. void Insert(wxPropertyInfo* &iter); // removes this property from the linked chain of the m_itsClass properties. void Remove(); wxClassInfo* m_itsClass; wxString m_name; mutable wxTypeInfo* m_typeInfo; wxString m_typeName; mutable wxTypeInfo* m_collectionElementTypeInfo; wxString m_collectionElementTypeName; wxPropertyAccessor* m_accessor; wxAny m_defaultValue; wxPropertyInfoFlags m_flags; wxString m_helpString; wxString m_groupString; wxPropertyInfo* m_next; // FIXME: what's this comment about?? // string representation of the default value // to be assigned by the designer to the property // when the component is dropped on the container. }; // stl is giving problems when forwarding declarations, therefore we define it as a subclass WX_DECLARE_STRING_HASH_MAP_WITH_DECL( wxPropertyInfo*, wxPropertyInfoMapBase, class WXDLLIMPEXP_BASE ); class WXDLLIMPEXP_BASE wxPropertyInfoMap : public wxPropertyInfoMapBase { }; WX_DECLARE_STRING_HASH_MAP_WITH_DECL( wxAny, wxStringToAnyHashMapBase, class WXDLLIMPEXP_BASE ); class WXDLLIMPEXP_FWD_BASE wxStringToAnyHashMap : public wxStringToAnyHashMapBase { }; #define wxBEGIN_PROPERTIES_TABLE(theClass) \ wxPropertyInfo *theClass::GetPropertiesStatic() \ { \ typedef theClass class_t; \ static wxPropertyInfo* first = NULL; #define wxEND_PROPERTIES_TABLE() \ return first; } #define wxHIDE_PROPERTY( pname ) \ static wxPropertyInfo _propertyInfo##pname( first, class_t::GetClassInfoStatic(), \ wxT(#pname), typeid(void).name(), NULL, wxAny(), wxPROP_DONT_STREAM, \ wxEmptyString, wxEmptyString ); #define wxPROPERTY( pname, type, setter, getter, defaultValue, flags, help, group) \ wxPROPERTY_SETTER( pname, class_t, type, setter ) \ static wxPropertySetter##pname _setter##pname; \ wxPROPERTY_GETTER( pname, class_t, type, getter ) \ static wxPropertyGetter##pname _getter##pname; \ static wxPropertyAccessor _accessor##pname( &_setter##pname, \ &_getter##pname, NULL, NULL ); \ static wxPropertyInfo _propertyInfo##pname( first, class_t::GetClassInfoStatic(), \ wxT(#pname), typeid(type).name(), &_accessor##pname, \ wxAny(defaultValue), flags, group, help ); #define wxPROPERTY_FLAGS( pname, flags, type, setter, getter,defaultValue, \ pflags, help, group) \ wxPROPERTY_SETTER( pname, class_t, type, setter ) \ static wxPropertySetter##pname _setter##pname; \ wxPROPERTY_GETTER( pname, class_t, type, getter ) \ static wxPropertyGetter##pname _getter##pname; \ static wxPropertyAccessor _accessor##pname( &_setter##pname, \ &_getter##pname, NULL, NULL ); \ static wxPropertyInfo _propertyInfo##pname( first, class_t::GetClassInfoStatic(), \ wxT(#pname), typeid(flags).name(), &_accessor##pname, \ wxAny(defaultValue), wxPROP_ENUM_STORE_LONG | pflags, help, group ); #define wxREADONLY_PROPERTY( pname, type, getter,defaultValue, flags, help, group) \ wxPROPERTY_GETTER( pname, class_t, type, getter ) \ static wxPropertyGetter##pname _getter##pname; \ static wxPropertyAccessor _accessor##pname( NULL, &_getter##pname, NULL, NULL ); \ static wxPropertyInfo _propertyInfo##pname( first, class_t::GetClassInfoStatic(), \ wxT(#pname), typeid(type).name(),&_accessor##pname, \ wxAny(defaultValue), flags, help, group ); #define wxREADONLY_PROPERTY_FLAGS( pname, flags, type, getter,defaultValue, \ pflags, help, group) \ wxPROPERTY_GETTER( pname, class_t, type, getter ) \ static wxPropertyGetter##pname _getter##pname; \ static wxPropertyAccessor _accessor##pname( NULL, &_getter##pname, NULL, NULL ); \ static wxPropertyInfo _propertyInfo##pname( first, class_t::GetClassInfoStatic(), \ wxT(#pname), typeid(flags).name(),&_accessor##pname, \ wxAny(defaultValue), wxPROP_ENUM_STORE_LONG | pflags, help, group ); #define wxPROPERTY_COLLECTION( pname, colltype, addelemtype, adder, getter, \ flags, help, group ) \ wxPROPERTY_COLLECTION_ADDER( pname, class_t, addelemtype, adder ) \ static wxPropertyCollectionAdder##pname _adder##pname; \ wxPROPERTY_COLLECTION_GETTER( pname, class_t, colltype, getter ) \ static wxPropertyCollectionGetter##pname _collectionGetter##pname; \ static wxPropertyAccessor _accessor##pname( NULL, NULL,&_adder##pname, \ &_collectionGetter##pname ); \ static wxPropertyInfo _propertyInfo##pname( first, class_t::GetClassInfoStatic(), \ wxT(#pname), typeid(colltype).name(),typeid(addelemtype).name(), \ &_accessor##pname, flags, help, group ); #define wxREADONLY_PROPERTY_COLLECTION( pname, colltype, addelemtype, getter, \ flags, help, group) \ wxPROPERTY_COLLECTION_GETTER( pname, class_t, colltype, getter ) \ static wxPropertyCollectionGetter##pname _collectionGetter##pname; \ static wxPropertyAccessor _accessor##pname( NULL, NULL, NULL, \ &_collectionGetter##pname ); \ static wxPropertyInfo _propertyInfo##pname( first,class_t::GetClassInfoStatic(), \ wxT(#pname), typeid(colltype).name(),typeid(addelemtype).name(), \ &_accessor##pname, flags, help, group ); #define wxEVENT_PROPERTY( name, eventType, eventClass ) \ static wxEventSourceTypeInfo _typeInfo##name( eventType, wxCLASSINFO( eventClass ) ); \ static wxPropertyInfo _propertyInfo##name( first,class_t::GetClassInfoStatic(), \ wxT(#name), &_typeInfo##name, NULL, wxAny() ); #define wxEVENT_RANGE_PROPERTY( name, eventType, lastEventType, eventClass ) \ static wxEventSourceTypeInfo _typeInfo##name( eventType, lastEventType, \ wxCLASSINFO( eventClass ) ); \ static wxPropertyInfo _propertyInfo##name( first, class_t::GetClassInfoStatic(), \ wxT(#name), &_typeInfo##name, NULL, wxAny() ); // ---------------------------------------------------------------------------- // Implementation Helper for Simple Properties // ---------------------------------------------------------------------------- #define wxIMPLEMENT_PROPERTY(name, type) \ private: \ type m_##name; \ public: \ void Set##name( type const & p) { m_##name = p; } \ type const & Get##name() const { return m_##name; } #endif // wxUSE_EXTENDED_RTTI #endif // _XTIPROP_H_
h
rticonnextdds-usecases
data/projects/rticonnextdds-usecases/VehicleTracking/ExampleCode/thirdparty/wxWidgets-3.1.2/Linux/include/wx/xpmhand.h
///////////////////////////////////////////////////////////////////////////// // Name: wx/xpmhand.h // Purpose: XPM handler base header // Author: Julian Smart // Modified by: // Created: // Copyright: (c) Julian Smart // Licence: wxWindows licence ///////////////////////////////////////////////////////////////////////////// #ifndef _WX_XPMHAND_H_BASE_ #define _WX_XPMHAND_H_BASE_ // Only wxMSW currently defines a separate XPM handler, since // mostly Windows apps won't need XPMs. #if defined(__WXMSW__) #error xpmhand.h is no longer needed since wxImage now handles XPMs. #endif #endif // _WX_XPMHAND_H_BASE_
h
rticonnextdds-usecases
data/projects/rticonnextdds-usecases/VehicleTracking/ExampleCode/thirdparty/wxWidgets-3.1.2/Linux/include/wx/clntdata.h
///////////////////////////////////////////////////////////////////////////// // Name: wx/clntdata.h // Purpose: A mixin class for holding a wxClientData or void pointer // Author: Robin Dunn // Modified by: // Created: 9-Oct-2001 // Copyright: (c) wxWidgets team // Licence: wxWindows licence ///////////////////////////////////////////////////////////////////////////// #ifndef _WX_CLNTDATAH__ #define _WX_CLNTDATAH__ #include "wx/defs.h" #include "wx/string.h" #include "wx/hashmap.h" typedef int (*wxShadowObjectMethod)(void*, void*); WX_DECLARE_STRING_HASH_MAP_WITH_DECL( wxShadowObjectMethod, wxShadowObjectMethods, class WXDLLIMPEXP_BASE ); WX_DECLARE_STRING_HASH_MAP_WITH_DECL( void *, wxShadowObjectFields, class WXDLLIMPEXP_BASE ); class WXDLLIMPEXP_BASE wxShadowObject { public: wxShadowObject() { } void AddMethod( const wxString &name, wxShadowObjectMethod method ) { wxShadowObjectMethods::iterator it = m_methods.find( name ); if (it == m_methods.end()) m_methods[ name ] = method; else it->second = method; } bool InvokeMethod( const wxString &name, void* window, void* param, int* returnValue ) { wxShadowObjectMethods::iterator it = m_methods.find( name ); if (it == m_methods.end()) return false; wxShadowObjectMethod method = it->second; const int ret = (*method)(window, param); if (returnValue) *returnValue = ret; return true; } void AddField( const wxString &name, void* initialValue = NULL ) { wxShadowObjectFields::iterator it = m_fields.find( name ); if (it == m_fields.end()) m_fields[ name ] = initialValue; else it->second = initialValue; } void SetField( const wxString &name, void* value ) { wxShadowObjectFields::iterator it = m_fields.find( name ); if (it == m_fields.end()) return; it->second = value; } void* GetField( const wxString &name, void *defaultValue = NULL ) { wxShadowObjectFields::iterator it = m_fields.find( name ); if (it == m_fields.end()) return defaultValue; return it->second; } private: wxShadowObjectMethods m_methods; wxShadowObjectFields m_fields; }; // ---------------------------------------------------------------------------- // what kind of client data do we have? enum wxClientDataType { wxClientData_None, // we don't know yet because we don't have it at all wxClientData_Object, // our client data is typed and we own it wxClientData_Void // client data is untyped and we don't own it }; class WXDLLIMPEXP_BASE wxClientData { public: wxClientData() { } virtual ~wxClientData() { } }; class WXDLLIMPEXP_BASE wxStringClientData : public wxClientData { public: wxStringClientData() : m_data() { } wxStringClientData( const wxString &data ) : m_data(data) { } void SetData( const wxString &data ) { m_data = data; } const wxString& GetData() const { return m_data; } private: wxString m_data; }; // This class is a mixin that provides storage and management of "client // data." The client data stored can either be a pointer to a wxClientData // object in which case it is managed by the container (i.e. it will delete // the data when it's destroyed) or an untyped pointer which won't be deleted // by the container - but not both of them // // NOTE: This functionality is currently duplicated in wxEvtHandler in order // to avoid having more than one vtable in that class hierarchy. class WXDLLIMPEXP_BASE wxClientDataContainer { public: wxClientDataContainer(); virtual ~wxClientDataContainer(); void SetClientObject( wxClientData *data ) { DoSetClientObject(data); } wxClientData *GetClientObject() const { return DoGetClientObject(); } void SetClientData( void *data ) { DoSetClientData(data); } void *GetClientData() const { return DoGetClientData(); } protected: // 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; }; // client data accessors virtual void DoSetClientObject( wxClientData *data ); virtual wxClientData *DoGetClientObject() const; virtual void DoSetClientData( void *data ); virtual void *DoGetClientData() const; // what kind of data do we have? wxClientDataType m_clientDataType; }; #endif // _WX_CLNTDATAH__
h
rticonnextdds-usecases
data/projects/rticonnextdds-usecases/VehicleTracking/ExampleCode/thirdparty/wxWidgets-3.1.2/Linux/include/wx/imaglist.h
///////////////////////////////////////////////////////////////////////////// // Name: wx/imaglist.h // Purpose: wxImageList base header // Author: Julian Smart // Modified by: // Created: // Copyright: (c) Julian Smart // Licence: wxWindows licence ///////////////////////////////////////////////////////////////////////////// #ifndef _WX_IMAGLIST_H_BASE_ #define _WX_IMAGLIST_H_BASE_ #include "wx/defs.h" /* * wxImageList is used for wxListCtrl, wxTreeCtrl. These controls refer to * images for their items by an index into an image list. * A wxImageList is capable of creating images with optional masks from * a variety of sources - a single bitmap plus a colour to indicate the mask, * two bitmaps, or an icon. * * Image lists can also create and draw images used for drag and drop functionality. * This is not yet implemented in wxImageList. We need to discuss a generic API * for doing drag and drop. * See below for candidate functions and an explanation of how they might be * used. */ // Flag values for Set/GetImageList enum { wxIMAGE_LIST_NORMAL, // Normal icons wxIMAGE_LIST_SMALL, // Small icons wxIMAGE_LIST_STATE // State icons: unimplemented (see WIN32 documentation) }; // Flags for Draw #define wxIMAGELIST_DRAW_NORMAL 0x0001 #define wxIMAGELIST_DRAW_TRANSPARENT 0x0002 #define wxIMAGELIST_DRAW_SELECTED 0x0004 #define wxIMAGELIST_DRAW_FOCUSED 0x0008 #if defined(__WXMSW__) #include "wx/msw/imaglist.h" #define wxHAS_NATIVE_IMAGELIST #else #include "wx/generic/imaglist.h" #endif #endif // _WX_IMAGLIST_H_BASE_
h
rticonnextdds-usecases
data/projects/rticonnextdds-usecases/VehicleTracking/ExampleCode/thirdparty/wxWidgets-3.1.2/Linux/include/wx/valgen.h
///////////////////////////////////////////////////////////////////////////// // Name: wx/valgen.h // Purpose: wxGenericValidator class // Author: Kevin Smith // Created: Jan 22 1999 // Copyright: (c) 1999 Julian Smart (assigned from Kevin) // Licence: wxWindows licence ///////////////////////////////////////////////////////////////////////////// #ifndef _WX_VALGENH__ #define _WX_VALGENH__ #include "wx/validate.h" #if wxUSE_VALIDATORS class WXDLLIMPEXP_FWD_BASE wxDateTime; class WXDLLIMPEXP_FWD_BASE wxFileName; // ---------------------------------------------------------------------------- // wxGenericValidator performs data transfer between many standard controls and // variables of the type corresponding to their values. // // It doesn't do any validation so its name is a slight misnomer. // ---------------------------------------------------------------------------- class WXDLLIMPEXP_CORE wxGenericValidator: public wxValidator { public: // Different constructors: each of them creates a validator which can only // be used with some controls, the comments before each constructor // indicate which ones: // wxCheckBox, wxRadioButton, wx(Bitmap)ToggleButton wxGenericValidator(bool* val); // wxChoice, wxGauge, wxRadioBox, wxScrollBar, wxSlider, wxSpinButton wxGenericValidator(int* val); // wxComboBox, wxTextCtrl, wxButton, wxStaticText (read-only) wxGenericValidator(wxString* val); // wxListBox, wxCheckListBox wxGenericValidator(wxArrayInt* val); #if wxUSE_DATETIME // wxDatePickerCtrl wxGenericValidator(wxDateTime* val); #endif // wxUSE_DATETIME // wxTextCtrl wxGenericValidator(wxFileName* val); // wxTextCtrl wxGenericValidator(float* val); // wxTextCtrl wxGenericValidator(double* val); wxGenericValidator(const wxGenericValidator& copyFrom); virtual ~wxGenericValidator(){} // 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 wxGenericValidator(*this); } bool Copy(const wxGenericValidator& val); // Called when the value in the window must be validated: this is not used // by this class virtual bool Validate(wxWindow * WXUNUSED(parent)) wxOVERRIDE { return true; } // Called to transfer data to the window virtual bool TransferToWindow() wxOVERRIDE; // Called to transfer data to the window virtual bool TransferFromWindow() wxOVERRIDE; protected: void Initialize(); bool* m_pBool; int* m_pInt; wxString* m_pString; wxArrayInt* m_pArrayInt; #if wxUSE_DATETIME wxDateTime* m_pDateTime; #endif // wxUSE_DATETIME wxFileName* m_pFileName; float* m_pFloat; double* m_pDouble; private: wxDECLARE_CLASS(wxGenericValidator); wxDECLARE_NO_ASSIGN_CLASS(wxGenericValidator); }; #endif // wxUSE_VALIDATORS #endif // _WX_VALGENH__
h
rticonnextdds-usecases
data/projects/rticonnextdds-usecases/VehicleTracking/ExampleCode/thirdparty/wxWidgets-3.1.2/Linux/include/wx/cmdargs.h
/////////////////////////////////////////////////////////////////////////////// // Name: wx/cmdargs.h // Purpose: declaration of wxCmdLineArgsArray helper class // Author: Vadim Zeitlin // Created: 2007-11-12 // Copyright: (c) 2007 Vadim Zeitlin <[email protected]> // Licence: wxWindows licence /////////////////////////////////////////////////////////////////////////////// #ifndef _WX_CMDARGS_H_ #define _WX_CMDARGS_H_ #include "wx/arrstr.h" // ---------------------------------------------------------------------------- // wxCmdLineArgsArray: helper class used by wxApp::argv // ---------------------------------------------------------------------------- #if wxUSE_UNICODE // this class is used instead of either "char **" or "wchar_t **" (neither of // which would be backwards compatible with all the existing code) for argv // field of wxApp // // as it's used for compatibility, it tries to look as much as traditional // (char **) argv as possible, in particular it provides implicit conversions // to "char **" and also array-like operator[] class WXDLLIMPEXP_BASE wxCmdLineArgsArray { public: wxCmdLineArgsArray() { m_argsA = NULL; m_argsW = NULL; } template <typename T> void Init(int argc, T **argv) { FreeArgs(); m_args.clear(); m_args.reserve(argc); for ( int i = 0; i < argc; i++ ) { m_args.push_back(argv[i]); } } operator char**() const { if ( !m_argsA ) { const size_t count = m_args.size(); m_argsA = new char *[count + 1]; for ( size_t n = 0; n < count; n++ ) m_argsA[n] = wxStrdup(m_args[n].ToAscii()); m_argsA[count] = NULL; } return m_argsA; } operator wchar_t**() const { if ( !m_argsW ) { const size_t count = m_args.size(); m_argsW = new wchar_t *[count + 1]; for ( size_t n = 0; n < count; n++ ) m_argsW[n] = wxStrdup(m_args[n].wc_str()); m_argsW[count] = NULL; } return m_argsW; } // existing code does checks like "if ( argv )" and we want it to continue // to compile, so provide this conversion even if it is pretty dangerous operator bool() const { return !m_args.empty(); } // and the same for "if ( !argv )" checks bool operator!() const { return m_args.empty(); } wxString operator[](size_t n) const { return m_args[n]; } // we must provide this overload for g++ 3.4 which can't choose between // our operator[](size_t) and ::operator[](char**, int) otherwise wxString operator[](int n) const { return m_args[n]; } // convenience methods, i.e. not existing only for backwards compatibility // do we have any arguments at all? bool IsEmpty() const { return m_args.empty(); } // access the arguments as a convenient array of wxStrings const wxArrayString& GetArguments() const { return m_args; } ~wxCmdLineArgsArray() { FreeArgs(); } private: template <typename T> void Free(T**& args) { if ( !args ) return; const size_t count = m_args.size(); for ( size_t n = 0; n < count; n++ ) free(args[n]); delete [] args; args = NULL; } void FreeArgs() { Free(m_argsA); Free(m_argsW); } wxArrayString m_args; mutable char **m_argsA; mutable wchar_t **m_argsW; wxDECLARE_NO_COPY_CLASS(wxCmdLineArgsArray); }; // provide global operator overload for compatibility with the existing code // doing things like "if ( condition && argv )" inline bool operator&&(bool cond, const wxCmdLineArgsArray& array) { return cond && !array.IsEmpty(); } #endif // wxUSE_UNICODE #endif // _WX_CMDARGS_H_
h
rticonnextdds-usecases
data/projects/rticonnextdds-usecases/VehicleTracking/ExampleCode/thirdparty/wxWidgets-3.1.2/Linux/include/wx/webviewarchivehandler.h
///////////////////////////////////////////////////////////////////////////// // Name: webviewarchivehandler.h // Purpose: Custom webview handler to allow archive browsing // Author: Steven Lamerton // Copyright: (c) 2011 Steven Lamerton // Licence: wxWindows licence ///////////////////////////////////////////////////////////////////////////// #ifndef _WX_WEBVIEW_FILE_HANDLER_H_ #define _WX_WEBVIEW_FILE_HANDLER_H_ #include "wx/setup.h" #if wxUSE_WEBVIEW class wxFSFile; class wxFileSystem; #include "wx/webview.h" //Loads from uris such as scheme:///C:/example/example.html or archives such as //scheme:///C:/example/example.zip;protocol=zip/example.html class WXDLLIMPEXP_WEBVIEW wxWebViewArchiveHandler : public wxWebViewHandler { public: wxWebViewArchiveHandler(const wxString& scheme); virtual ~wxWebViewArchiveHandler(); virtual wxFSFile* GetFile(const wxString &uri) wxOVERRIDE; private: wxFileSystem* m_fileSystem; }; #endif // wxUSE_WEBVIEW #endif // _WX_WEBVIEW_FILE_HANDLER_H_
h
rticonnextdds-usecases
data/projects/rticonnextdds-usecases/VehicleTracking/ExampleCode/thirdparty/wxWidgets-3.1.2/Linux/include/wx/preferences.h
/////////////////////////////////////////////////////////////////////////////// // Name: wx/preferences.h // Purpose: Declaration of wxPreferencesEditor class. // Author: Vaclav Slavik // Created: 2013-02-19 // Copyright: (c) 2013 Vaclav Slavik <[email protected]> // Licence: wxWindows licence /////////////////////////////////////////////////////////////////////////////// #ifndef _WX_PREFERENCES_H_ #define _WX_PREFERENCES_H_ #include "wx/defs.h" #if wxUSE_PREFERENCES_EDITOR #include "wx/bitmap.h" #include "wx/vector.h" class WXDLLIMPEXP_FWD_CORE wxWindow; class wxPreferencesEditorImpl; #if defined(__WXOSX_COCOA__) // GetLargeIcon() is used #define wxHAS_PREF_EDITOR_ICONS // Changes should be applied immediately #define wxHAS_PREF_EDITOR_APPLY_IMMEDIATELY // The dialog is shown non-modally. #define wxHAS_PREF_EDITOR_MODELESS #elif defined(__WXGTK__) // Changes should be applied immediately #define wxHAS_PREF_EDITOR_APPLY_IMMEDIATELY // The dialog is shown non-modally. #define wxHAS_PREF_EDITOR_MODELESS #endif // ---------------------------------------------------------------------------- // wxPreferencesEditor: Native preferences editing // ---------------------------------------------------------------------------- // One page of a preferences window class WXDLLIMPEXP_CORE wxPreferencesPage { public: wxPreferencesPage() {} virtual ~wxPreferencesPage() {} // Name of the page, used e.g. for tabs virtual wxString GetName() const = 0; // Return 32x32 icon used for the page. Currently only used on OS X, where // implementation is required; unused on other platforms. Because of this, // the method is only pure virtual on platforms that use it. #ifdef wxHAS_PREF_EDITOR_ICONS virtual wxBitmap GetLargeIcon() const = 0; #else virtual wxBitmap GetLargeIcon() const { return wxBitmap(); } #endif // Create a window (usually a wxPanel) for this page. The caller takes // ownership of the returned window. virtual wxWindow *CreateWindow(wxWindow *parent) = 0; wxDECLARE_NO_COPY_CLASS(wxPreferencesPage); }; // Helper for implementing some common pages (General, Advanced) class WXDLLIMPEXP_CORE wxStockPreferencesPage : public wxPreferencesPage { public: enum Kind { Kind_General, Kind_Advanced }; wxStockPreferencesPage(Kind kind) : m_kind(kind) {} Kind GetKind() const { return m_kind; } virtual wxString GetName() const wxOVERRIDE; #ifdef __WXOSX_COCOA__ virtual wxBitmap GetLargeIcon() const wxOVERRIDE; #endif private: Kind m_kind; }; // Notice that this class does not inherit from wxWindow. class WXDLLIMPEXP_CORE wxPreferencesEditor { public: // Ctor creates an empty editor, use AddPage() to add controls to it. wxPreferencesEditor(const wxString& title = wxString()); // Dtor destroys the dialog if still shown. virtual ~wxPreferencesEditor(); // Add a new page to the editor. The editor takes ownership of the page // and won't delete it until it is destroyed itself. void AddPage(wxPreferencesPage *page); // Show the preferences dialog or bring it to the top if it's already // shown. Notice that this method may or may not block depending on the // platform, i.e. depending on whether the dialog is modal or not. virtual void Show(wxWindow* parent); // Hide the currently shown dialog, if any. This is typically used to // dismiss the dialog if the object whose preferences it is editing was // closed. void Dismiss(); // Whether changes to values in the pages should be applied immediately // (OS X, GTK+) or only when the user clicks OK/Apply (Windows) static bool ShouldApplyChangesImmediately() { #ifdef wxHAS_PREF_EDITOR_APPLY_IMMEDIATELY return true; #else return false; #endif } // Whether the dialog is shown modally, i.e. Show() blocks, or not. static bool ShownModally() { #ifdef wxHAS_PREF_EDITOR_MODELESS return false; #else return true; #endif } private: wxPreferencesEditorImpl* m_impl; wxDECLARE_NO_COPY_CLASS(wxPreferencesEditor); }; #endif // wxUSE_PREFERENCES_EDITOR #endif // _WX_PREFERENCES_H_
h
rticonnextdds-usecases
data/projects/rticonnextdds-usecases/VehicleTracking/ExampleCode/thirdparty/wxWidgets-3.1.2/Linux/include/wx/xlocale.h
////////////////////////////////////////////////////////////////////////////// // Name: wx/xlocale.h // Purpose: Header to provide some xlocale wrappers // Author: Brian Vanderburg II, Vadim Zeitlin // Created: 2008-01-07 // Copyright: (c) 2008 Brian Vanderburg II // 2008 Vadim Zeitlin <[email protected]> // Licence: wxWindows licence /////////////////////////////////////////////////////////////////////////////// /* This header defines portable wrappers around xlocale foo_l() functions or their MSVC proprietary _foo_l() equivalents when they are available and implements these functions for the "C" locale [only] if they are not. This allows the program running under the default user locale to still use "C" locale for operations such as reading data from files where they are stored using decimal point &c. TODO: Currently only the character classification and transformation functions and number <-> string functions, are implemented, we also need at least - formatted IO: scanf_l(), printf_l() &c - time: strftime_l(), strptime_l() */ #ifndef _WX_XLOCALE_H_ #define _WX_XLOCALE_H_ #include "wx/defs.h" // wxUSE_XLOCALE #if wxUSE_XLOCALE #include "wx/crt.h" // Includes wx/chartype.h, wx/wxcrt.h(wx/string.h) #include "wx/intl.h" // wxLanguage // The platform-specific locale type // If wxXLocale_t is not defined, then only "C" locale support is provided #ifdef wxHAS_XLOCALE_SUPPORT #if wxCHECK_VISUALC_VERSION(8) typedef _locale_t wxXLocale_t; #define wxXLOCALE_IDENT(name) _ ## name #elif defined(HAVE_LOCALE_T) // Some systems (notably macOS) require including a separate header for // locale_t and related functions. #ifdef HAVE_XLOCALE_H #include <xlocale.h> #endif #include <locale.h> #include <ctype.h> #include <stdlib.h> #if wxUSE_UNICODE #include <wctype.h> #endif // Locale type and identifier name typedef locale_t wxXLocale_t; #define wxXLOCALE_IDENT(name) name #else #error "Unknown xlocale support" #endif #endif // wxHAS_XLOCALE_SUPPORT // wxXLocale is a wrapper around the native type representing a locale. // // It is not to be confused with wxLocale, which handles actually changing the // locale, loading message catalogs, etc. This just stores a locale value. // The similarity of names is unfortunate, but there doesn't seem to be any // better alternative right now. Perhaps by wxWidgets 4.0 better naming could // be used, or this class could become wxLocale (a wrapper for the value), and // some other class could be used to load the language catalogs or something // that would be clearer #ifdef wxHAS_XLOCALE_SUPPORT class WXDLLIMPEXP_BASE wxXLocale { public: // Construct an uninitialized locale wxXLocale() { m_locale = NULL; } #if wxUSE_INTL // Construct from a symbolic language constant wxXLocale(wxLanguage lang); #endif // Construct from the given language string wxXLocale(const char *loc) { Init(loc); } // Destroy the locale ~wxXLocale() { Free(); } // Get the global "C" locale object static wxXLocale& GetCLocale(); // Check if the object represents a valid locale (notice that without // wxHAS_XLOCALE_SUPPORT the only valid locale is the "C" one) bool IsOk() const { return m_locale != NULL; } // Get the type wxXLocale_t Get() const { return m_locale; } bool operator== (const wxXLocale& loc) const { return m_locale == loc.m_locale; } private: // Special ctor for the "C" locale, it's only used internally as the user // code is supposed to use GetCLocale() wxXLocale(struct wxXLocaleCTag * WXUNUSED(dummy)) { Init("C"); } // Create from the given language string (called from ctors) void Init(const char *loc); // Free the locale if it's non-NULL void Free(); // The corresponding locale handle, NULL if invalid wxXLocale_t m_locale; // POSIX xlocale API provides a duplocale() function but MSVC locale API // doesn't give us any means to copy a _locale_t object so we reduce the // functionality to least common denominator here -- it shouldn't be a // problem as copying the locale objects shouldn't be often needed wxDECLARE_NO_COPY_CLASS(wxXLocale); }; #else // !wxHAS_XLOCALE_SUPPORT // Skeleton version supporting only the "C" locale for the systems without // xlocale support class WXDLLIMPEXP_BASE wxXLocale { public: // Construct an uninitialized locale wxXLocale() { m_isC = false; } // Construct from a symbolic language constant: unless the language is // wxLANGUAGE_ENGLISH_US (which we suppose to be the same as "C" locale) // the object will be invalid wxXLocale(wxLanguage lang) { m_isC = lang == wxLANGUAGE_ENGLISH_US; } // Construct from the given language string: unless the string is "C" or // "POSIX" the object will be invalid wxXLocale(const char *loc) { m_isC = loc && (strcmp(loc, "C") == 0 || strcmp(loc, "POSIX") == 0); } // Default copy ctor, assignment operator and dtor are ok (or would be if // we didn't use wxDECLARE_NO_COPY_CLASS() for consistency with the // xlocale version) // Get the global "C" locale object static wxXLocale& GetCLocale(); // Check if the object represents a valid locale (notice that without // wxHAS_XLOCALE_SUPPORT the only valid locale is the "C" one) bool IsOk() const { return m_isC; } private: // Special ctor for the "C" locale, it's only used internally as the user // code is supposed to use GetCLocale() wxXLocale(struct wxXLocaleCTag * WXUNUSED(dummy)) { m_isC = true; } // Without xlocale support this class can only represent "C" locale, if // this is false the object is invalid bool m_isC; // although it's not a problem to copy the objects of this class, we use // this macro in this implementation for consistency with the xlocale-based // one which can't be copied when using MSVC locale API wxDECLARE_NO_COPY_CLASS(wxXLocale); }; #endif // wxHAS_XLOCALE_SUPPORT/!wxHAS_XLOCALE_SUPPORT // A shorter synonym for the most commonly used locale object #define wxCLocale (wxXLocale::GetCLocale()) extern WXDLLIMPEXP_DATA_BASE(wxXLocale) wxNullXLocale; // Wrappers for various functions: #ifdef wxHAS_XLOCALE_SUPPORT // ctype functions #define wxCRT_Isalnum_lA wxXLOCALE_IDENT(isalnum_l) #define wxCRT_Isalpha_lA wxXLOCALE_IDENT(isalpha_l) #define wxCRT_Iscntrl_lA wxXLOCALE_IDENT(iscntrl_l) #define wxCRT_Isdigit_lA wxXLOCALE_IDENT(isdigit_l) #define wxCRT_Isgraph_lA wxXLOCALE_IDENT(isgraph_l) #define wxCRT_Islower_lA wxXLOCALE_IDENT(islower_l) #define wxCRT_Isprint_lA wxXLOCALE_IDENT(isprint_l) #define wxCRT_Ispunct_lA wxXLOCALE_IDENT(ispunct_l) #define wxCRT_Isspace_lA wxXLOCALE_IDENT(isspace_l) #define wxCRT_Isupper_lA wxXLOCALE_IDENT(isupper_l) #define wxCRT_Isxdigit_lA wxXLOCALE_IDENT(isxdigit_l) #define wxCRT_Tolower_lA wxXLOCALE_IDENT(tolower_l) #define wxCRT_Toupper_lA wxXLOCALE_IDENT(toupper_l) inline int wxIsalnum_l(char c, const wxXLocale& loc) { return wxCRT_Isalnum_lA(static_cast<unsigned char>(c), loc.Get()); } inline int wxIsalpha_l(char c, const wxXLocale& loc) { return wxCRT_Isalpha_lA(static_cast<unsigned char>(c), loc.Get()); } inline int wxIscntrl_l(char c, const wxXLocale& loc) { return wxCRT_Iscntrl_lA(static_cast<unsigned char>(c), loc.Get()); } inline int wxIsdigit_l(char c, const wxXLocale& loc) { return wxCRT_Isdigit_lA(static_cast<unsigned char>(c), loc.Get()); } inline int wxIsgraph_l(char c, const wxXLocale& loc) { return wxCRT_Isgraph_lA(static_cast<unsigned char>(c), loc.Get()); } inline int wxIslower_l(char c, const wxXLocale& loc) { return wxCRT_Islower_lA(static_cast<unsigned char>(c), loc.Get()); } inline int wxIsprint_l(char c, const wxXLocale& loc) { return wxCRT_Isprint_lA(static_cast<unsigned char>(c), loc.Get()); } inline int wxIspunct_l(char c, const wxXLocale& loc) { return wxCRT_Ispunct_lA(static_cast<unsigned char>(c), loc.Get()); } inline int wxIsspace_l(char c, const wxXLocale& loc) { return wxCRT_Isspace_lA(static_cast<unsigned char>(c), loc.Get()); } inline int wxIsupper_l(char c, const wxXLocale& loc) { return wxCRT_Isupper_lA(static_cast<unsigned char>(c), loc.Get()); } inline int wxIsxdigit_l(char c, const wxXLocale& loc) { return wxCRT_Isxdigit_lA(static_cast<unsigned char>(c), loc.Get()); } inline int wxTolower_l(char c, const wxXLocale& loc) { return wxCRT_Tolower_lA(static_cast<unsigned char>(c), loc.Get()); } inline int wxToupper_l(char c, const wxXLocale& loc) { return wxCRT_Toupper_lA(static_cast<unsigned char>(c), loc.Get()); } // stdlib functions for numeric <-> string conversion // NOTE: GNU libc does not have ato[fil]_l functions; // MSVC++8 does not have _strto[u]ll_l functions; // thus we take the minimal set of functions provided in both environments: #define wxCRT_Strtod_lA wxXLOCALE_IDENT(strtod_l) #define wxCRT_Strtol_lA wxXLOCALE_IDENT(strtol_l) #define wxCRT_Strtoul_lA wxXLOCALE_IDENT(strtoul_l) inline double wxStrtod_lA(const char *c, char **endptr, const wxXLocale& loc) { return wxCRT_Strtod_lA(c, endptr, loc.Get()); } inline long wxStrtol_lA(const char *c, char **endptr, int base, const wxXLocale& loc) { return wxCRT_Strtol_lA(c, endptr, base, loc.Get()); } inline unsigned long wxStrtoul_lA(const char *c, char **endptr, int base, const wxXLocale& loc) { return wxCRT_Strtoul_lA(c, endptr, base, loc.Get()); } #if wxUSE_UNICODE // ctype functions #define wxCRT_Isalnum_lW wxXLOCALE_IDENT(iswalnum_l) #define wxCRT_Isalpha_lW wxXLOCALE_IDENT(iswalpha_l) #define wxCRT_Iscntrl_lW wxXLOCALE_IDENT(iswcntrl_l) #define wxCRT_Isdigit_lW wxXLOCALE_IDENT(iswdigit_l) #define wxCRT_Isgraph_lW wxXLOCALE_IDENT(iswgraph_l) #define wxCRT_Islower_lW wxXLOCALE_IDENT(iswlower_l) #define wxCRT_Isprint_lW wxXLOCALE_IDENT(iswprint_l) #define wxCRT_Ispunct_lW wxXLOCALE_IDENT(iswpunct_l) #define wxCRT_Isspace_lW wxXLOCALE_IDENT(iswspace_l) #define wxCRT_Isupper_lW wxXLOCALE_IDENT(iswupper_l) #define wxCRT_Isxdigit_lW wxXLOCALE_IDENT(iswxdigit_l) #define wxCRT_Tolower_lW wxXLOCALE_IDENT(towlower_l) #define wxCRT_Toupper_lW wxXLOCALE_IDENT(towupper_l) inline int wxIsalnum_l(wchar_t c, const wxXLocale& loc) { return wxCRT_Isalnum_lW(c, loc.Get()); } inline int wxIsalpha_l(wchar_t c, const wxXLocale& loc) { return wxCRT_Isalpha_lW(c, loc.Get()); } inline int wxIscntrl_l(wchar_t c, const wxXLocale& loc) { return wxCRT_Iscntrl_lW(c, loc.Get()); } inline int wxIsdigit_l(wchar_t c, const wxXLocale& loc) { return wxCRT_Isdigit_lW(c, loc.Get()); } inline int wxIsgraph_l(wchar_t c, const wxXLocale& loc) { return wxCRT_Isgraph_lW(c, loc.Get()); } inline int wxIslower_l(wchar_t c, const wxXLocale& loc) { return wxCRT_Islower_lW(c, loc.Get()); } inline int wxIsprint_l(wchar_t c, const wxXLocale& loc) { return wxCRT_Isprint_lW(c, loc.Get()); } inline int wxIspunct_l(wchar_t c, const wxXLocale& loc) { return wxCRT_Ispunct_lW(c, loc.Get()); } inline int wxIsspace_l(wchar_t c, const wxXLocale& loc) { return wxCRT_Isspace_lW(c, loc.Get()); } inline int wxIsupper_l(wchar_t c, const wxXLocale& loc) { return wxCRT_Isupper_lW(c, loc.Get()); } inline int wxIsxdigit_l(wchar_t c, const wxXLocale& loc) { return wxCRT_Isxdigit_lW(c, loc.Get()); } inline wchar_t wxTolower_l(wchar_t c, const wxXLocale& loc) { return wxCRT_Tolower_lW(c, loc.Get()); } inline wchar_t wxToupper_l(wchar_t c, const wxXLocale& loc) { return wxCRT_Toupper_lW(c, loc.Get()); } // stdlib functions for numeric <-> string conversion // (see notes above about missing functions) #define wxCRT_Strtod_lW wxXLOCALE_IDENT(wcstod_l) #define wxCRT_Strtol_lW wxXLOCALE_IDENT(wcstol_l) #define wxCRT_Strtoul_lW wxXLOCALE_IDENT(wcstoul_l) inline double wxStrtod_l(const wchar_t *c, wchar_t **endptr, const wxXLocale& loc) { return wxCRT_Strtod_lW(c, endptr, loc.Get()); } inline long wxStrtol_l(const wchar_t *c, wchar_t **endptr, int base, const wxXLocale& loc) { return wxCRT_Strtol_lW(c, endptr, base, loc.Get()); } inline unsigned long wxStrtoul_l(const wchar_t *c, wchar_t **endptr, int base, const wxXLocale& loc) { return wxCRT_Strtoul_lW(c, endptr, base, loc.Get()); } #else // !wxUSE_UNICODE inline double wxStrtod_l(const char *c, char **endptr, const wxXLocale& loc) { return wxCRT_Strtod_lA(c, endptr, loc.Get()); } inline long wxStrtol_l(const char *c, char **endptr, int base, const wxXLocale& loc) { return wxCRT_Strtol_lA(c, endptr, base, loc.Get()); } inline unsigned long wxStrtoul_l(const char *c, char **endptr, int base, const wxXLocale& loc) { return wxCRT_Strtoul_lA(c, endptr, base, loc.Get()); } #endif // wxUSE_UNICODE #else // !wxHAS_XLOCALE_SUPPORT // ctype functions int WXDLLIMPEXP_BASE wxIsalnum_l(const wxUniChar& c, const wxXLocale& loc); int WXDLLIMPEXP_BASE wxIsalpha_l(const wxUniChar& c, const wxXLocale& loc); int WXDLLIMPEXP_BASE wxIscntrl_l(const wxUniChar& c, const wxXLocale& loc); int WXDLLIMPEXP_BASE wxIsdigit_l(const wxUniChar& c, const wxXLocale& loc); int WXDLLIMPEXP_BASE wxIsgraph_l(const wxUniChar& c, const wxXLocale& loc); int WXDLLIMPEXP_BASE wxIslower_l(const wxUniChar& c, const wxXLocale& loc); int WXDLLIMPEXP_BASE wxIsprint_l(const wxUniChar& c, const wxXLocale& loc); int WXDLLIMPEXP_BASE wxIspunct_l(const wxUniChar& c, const wxXLocale& loc); int WXDLLIMPEXP_BASE wxIsspace_l(const wxUniChar& c, const wxXLocale& loc); int WXDLLIMPEXP_BASE wxIsupper_l(const wxUniChar& c, const wxXLocale& loc); int WXDLLIMPEXP_BASE wxIsxdigit_l(const wxUniChar& c, const wxXLocale& loc); int WXDLLIMPEXP_BASE wxTolower_l(const wxUniChar& c, const wxXLocale& loc); int WXDLLIMPEXP_BASE wxToupper_l(const wxUniChar& c, const wxXLocale& loc); // stdlib functions double WXDLLIMPEXP_BASE wxStrtod_l(const wchar_t* str, wchar_t **endptr, const wxXLocale& loc); double WXDLLIMPEXP_BASE wxStrtod_l(const char* str, char **endptr, const wxXLocale& loc); long WXDLLIMPEXP_BASE wxStrtol_l(const wchar_t* str, wchar_t **endptr, int base, const wxXLocale& loc); long WXDLLIMPEXP_BASE wxStrtol_l(const char* str, char **endptr, int base, const wxXLocale& loc); unsigned long WXDLLIMPEXP_BASE wxStrtoul_l(const wchar_t* str, wchar_t **endptr, int base, const wxXLocale& loc); unsigned long WXDLLIMPEXP_BASE wxStrtoul_l(const char* str, char **endptr, int base, const wxXLocale& loc); #endif // wxHAS_XLOCALE_SUPPORT/!wxHAS_XLOCALE_SUPPORT #endif // wxUSE_XLOCALE #endif // _WX_XLOCALE_H_
h
rticonnextdds-usecases
data/projects/rticonnextdds-usecases/VehicleTracking/ExampleCode/thirdparty/wxWidgets-3.1.2/Linux/include/wx/afterstd.h
/////////////////////////////////////////////////////////////////////////////// // Name: wx/afterstd.h // Purpose: #include after STL headers // Author: Vadim Zeitlin // Modified by: // Created: 07/07/03 // Copyright: (c) 2003 Vadim Zeitlin <[email protected]> // Licence: wxWindows licence /////////////////////////////////////////////////////////////////////////////// /** See the comments in beforestd.h. */ #if defined(__WINDOWS__) #include "wx/msw/winundef.h" #endif // undo what we did in wx/beforestd.h #if defined(__VISUALC__) && __VISUALC__ <= 1201 #pragma warning(pop) #endif // see beforestd.h for explanation #if defined(HAVE_VISIBILITY) && defined(HAVE_BROKEN_LIBSTDCXX_VISIBILITY) #pragma GCC visibility pop #endif
h
rticonnextdds-usecases
data/projects/rticonnextdds-usecases/VehicleTracking/ExampleCode/thirdparty/wxWidgets-3.1.2/Linux/include/wx/imagxpm.h
///////////////////////////////////////////////////////////////////////////// // Name: wx/imagxpm.h // Purpose: wxImage XPM handler // Author: Vaclav Slavik // Copyright: (c) 2001 Vaclav Slavik // Licence: wxWindows licence ///////////////////////////////////////////////////////////////////////////// #ifndef _WX_IMAGXPM_H_ #define _WX_IMAGXPM_H_ #include "wx/image.h" #if wxUSE_XPM //----------------------------------------------------------------------------- // wxXPMHandler //----------------------------------------------------------------------------- class WXDLLIMPEXP_CORE wxXPMHandler : public wxImageHandler { public: inline wxXPMHandler() { m_name = wxT("XPM file"); m_extension = wxT("xpm"); m_type = wxBITMAP_TYPE_XPM; m_mime = wxT("image/xpm"); } #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(wxXPMHandler); }; #endif // wxUSE_XPM #endif // _WX_IMAGXPM_H_
h
rticonnextdds-usecases
data/projects/rticonnextdds-usecases/VehicleTracking/ExampleCode/thirdparty/wxWidgets-3.1.2/Linux/include/wx/iosfwrap.h
/////////////////////////////////////////////////////////////////////////////// // Name: wx/iosfwrap.h // Purpose: includes the correct stream-related forward declarations // Author: Jan van Dijk <[email protected]> // Modified by: // Created: 18.12.2002 // Copyright: wxWidgets team // Licence: wxWindows licence /////////////////////////////////////////////////////////////////////////////// #if wxUSE_STD_IOSTREAM #if wxUSE_IOSTREAMH // There is no pre-ANSI iosfwd header so we include the full declarations. # include <iostream.h> #else # include <iosfwd> #endif #ifdef __WINDOWS__ # include "wx/msw/winundef.h" #endif #endif // wxUSE_STD_IOSTREAM
h
rticonnextdds-usecases
data/projects/rticonnextdds-usecases/VehicleTracking/ExampleCode/thirdparty/wxWidgets-3.1.2/Linux/include/wx/valnum.h
///////////////////////////////////////////////////////////////////////////// // Name: wx/valnum.h // Purpose: Numeric validator classes. // Author: Vadim Zeitlin based on the submission of Fulvio Senore // Created: 2010-11-06 // Copyright: (c) 2010 wxWidgets team // (c) 2011 Vadim Zeitlin <[email protected]> // Licence: wxWindows licence ///////////////////////////////////////////////////////////////////////////// #ifndef _WX_VALNUM_H_ #define _WX_VALNUM_H_ #include "wx/defs.h" #if wxUSE_VALIDATORS #include "wx/textentry.h" #include "wx/validate.h" // This header uses std::numeric_limits<>::min/max, but these symbols are, // unfortunately, often defined as macros and the code here wouldn't compile in // this case, so preventively undefine them to avoid this problem. #undef min #undef max #include <limits> // Bit masks used for numeric validator styles. enum wxNumValidatorStyle { wxNUM_VAL_DEFAULT = 0x0, wxNUM_VAL_THOUSANDS_SEPARATOR = 0x1, wxNUM_VAL_ZERO_AS_BLANK = 0x2, wxNUM_VAL_NO_TRAILING_ZEROES = 0x4 }; // ---------------------------------------------------------------------------- // Base class for all numeric validators. // ---------------------------------------------------------------------------- class WXDLLIMPEXP_CORE wxNumValidatorBase : public wxValidator { public: // Change the validator style. Usually it's specified during construction. void SetStyle(int style) { m_style = style; } // Override base class method to not do anything but always return success: // we don't need this as we do our validation on the fly here. virtual bool Validate(wxWindow * WXUNUSED(parent)) wxOVERRIDE { return true; } // Override base class method to check that the window is a text control or // combobox. virtual void SetWindow(wxWindow *win) wxOVERRIDE; protected: wxNumValidatorBase(int style) { m_style = style; } wxNumValidatorBase(const wxNumValidatorBase& other) : wxValidator(other) { m_style = other.m_style; } bool HasFlag(wxNumValidatorStyle style) const { return (m_style & style) != 0; } // Get the text entry of the associated control. Normally shouldn't ever // return NULL (and will assert if it does return it) but the caller should // still test the return value for safety. wxTextEntry *GetTextEntry() const; // Convert wxNUM_VAL_THOUSANDS_SEPARATOR and wxNUM_VAL_NO_TRAILING_ZEROES // bits of our style to the corresponding wxNumberFormatter::Style values. int GetFormatFlags() const; // Return true if pressing a '-' key is acceptable for the current control // contents and insertion point. This is meant to be called from the // derived class IsCharOk() implementation. bool IsMinusOk(const wxString& val, int pos) const; // Return the string which would result from inserting the given character // at the specified position. wxString GetValueAfterInsertingChar(wxString val, int pos, wxChar ch) const { val.insert(pos, ch); return val; } private: // Check whether the specified character can be inserted in the control at // the given position in the string representing the current controls // contents. // // Notice that the base class checks for '-' itself so it's never passed to // this function. virtual bool IsCharOk(const wxString& val, int pos, wxChar ch) const = 0; // NormalizeString the contents of the string if it's a valid number, return // empty string otherwise. virtual wxString NormalizeString(const wxString& s) const = 0; // Event handlers. void OnChar(wxKeyEvent& event); void OnKillFocus(wxFocusEvent& event); // Determine the current insertion point and text in the associated control. void GetCurrentValueAndInsertionPoint(wxString& val, int& pos) const; // Combination of wxVAL_NUM_XXX values. int m_style; wxDECLARE_EVENT_TABLE(); wxDECLARE_NO_ASSIGN_CLASS(wxNumValidatorBase); }; namespace wxPrivate { // This is a helper class used by wxIntegerValidator and wxFloatingPointValidator // below that implements Transfer{To,From}Window() adapted to the type of the // variable. // // The template argument B is the name of the base class which must derive from // wxNumValidatorBase and define LongestValueType type and {To,As}String() // methods i.e. basically be one of wx{Integer,Number}ValidatorBase classes. // // The template argument T is just the type handled by the validator that will // inherit from this one. template <class B, typename T> class wxNumValidator : public B { public: typedef B BaseValidator; typedef T ValueType; typedef typename BaseValidator::LongestValueType LongestValueType; wxCOMPILE_TIME_ASSERT ( sizeof(ValueType) <= sizeof(LongestValueType), UnsupportedType ); void SetMin(ValueType min) { this->DoSetMin(min); } void SetMax(ValueType max) { this->DoSetMax(max); } void SetRange(ValueType min, ValueType max) { SetMin(min); SetMax(max); } virtual bool TransferToWindow() wxOVERRIDE { if ( m_value ) { wxTextEntry * const control = BaseValidator::GetTextEntry(); if ( !control ) return false; control->SetValue(NormalizeValue(*m_value)); } return true; } virtual bool TransferFromWindow() wxOVERRIDE { if ( m_value ) { wxTextEntry * const control = BaseValidator::GetTextEntry(); if ( !control ) return false; const wxString s(control->GetValue()); LongestValueType value; if ( s.empty() && BaseValidator::HasFlag(wxNUM_VAL_ZERO_AS_BLANK) ) value = 0; else if ( !BaseValidator::FromString(s, &value) ) return false; if ( !this->IsInRange(value) ) return false; *m_value = static_cast<ValueType>(value); } return true; } protected: wxNumValidator(ValueType *value, int style) : BaseValidator(style), m_value(value) { } // Implement wxNumValidatorBase virtual method which is the same for // both integer and floating point numbers. virtual wxString NormalizeString(const wxString& s) const wxOVERRIDE { LongestValueType value; return BaseValidator::FromString(s, &value) ? NormalizeValue(value) : wxString(); } private: // Just a helper which is a common part of TransferToWindow() and // NormalizeString(): returns string representation of a number honouring // wxNUM_VAL_ZERO_AS_BLANK flag. wxString NormalizeValue(LongestValueType value) const { // We really want to compare with the exact 0 here, so disable gcc // warning about doing this. wxGCC_WARNING_SUPPRESS(float-equal) wxString s; if ( value != 0 || !BaseValidator::HasFlag(wxNUM_VAL_ZERO_AS_BLANK) ) s = this->ToString(value); wxGCC_WARNING_RESTORE(float-equal) return s; } ValueType * const m_value; wxDECLARE_NO_ASSIGN_CLASS(wxNumValidator); }; } // namespace wxPrivate // ---------------------------------------------------------------------------- // Validators for integer numbers. // ---------------------------------------------------------------------------- // Base class for integer numbers validator. This class contains all non // type-dependent code of wxIntegerValidator<> and always works with values of // type LongestValueType. It is not meant to be used directly, please use // wxIntegerValidator<> only instead. class WXDLLIMPEXP_CORE wxIntegerValidatorBase : public wxNumValidatorBase { protected: // Define the type we use here, it should be the maximal-sized integer type // we support to make it possible to base wxIntegerValidator<> for any type // on it. #ifdef wxLongLong_t typedef wxLongLong_t LongestValueType; #else typedef long LongestValueType; #endif wxIntegerValidatorBase(int style) : wxNumValidatorBase(style) { wxASSERT_MSG( !(style & wxNUM_VAL_NO_TRAILING_ZEROES), "This style doesn't make sense for integers." ); } wxIntegerValidatorBase(const wxIntegerValidatorBase& other) : wxNumValidatorBase(other) { m_min = other.m_min; m_max = other.m_max; } // Provide methods for wxNumValidator use. wxString ToString(LongestValueType value) const; static bool FromString(const wxString& s, LongestValueType *value); void DoSetMin(LongestValueType min) { m_min = min; } void DoSetMax(LongestValueType max) { m_max = max; } bool IsInRange(LongestValueType value) const { return m_min <= value && value <= m_max; } // Implement wxNumValidatorBase pure virtual method. virtual bool IsCharOk(const wxString& val, int pos, wxChar ch) const wxOVERRIDE; private: // Minimal and maximal values accepted (inclusive). LongestValueType m_min, m_max; wxDECLARE_NO_ASSIGN_CLASS(wxIntegerValidatorBase); }; // Validator for integer numbers. It can actually work with any integer type // (short, int or long and long long if supported) and their unsigned versions // as well. template <typename T> class wxIntegerValidator : public wxPrivate::wxNumValidator<wxIntegerValidatorBase, T> { public: typedef T ValueType; typedef wxPrivate::wxNumValidator<wxIntegerValidatorBase, T> Base; // Ctor for an integer validator. // // Sets the range appropriately for the type, including setting 0 as the // minimal value for the unsigned types. wxIntegerValidator(ValueType *value = NULL, int style = wxNUM_VAL_DEFAULT) : Base(value, style) { this->DoSetMin(std::numeric_limits<ValueType>::min()); this->DoSetMax(std::numeric_limits<ValueType>::max()); } virtual wxObject *Clone() const wxOVERRIDE { return new wxIntegerValidator(*this); } private: wxDECLARE_NO_ASSIGN_CLASS(wxIntegerValidator); }; // Helper function for creating integer validators which allows to avoid // explicitly specifying the type as it deduces it from its parameter. template <typename T> inline wxIntegerValidator<T> wxMakeIntegerValidator(T *value, int style = wxNUM_VAL_DEFAULT) { return wxIntegerValidator<T>(value, style); } // ---------------------------------------------------------------------------- // Validators for floating point numbers. // ---------------------------------------------------------------------------- // Similar to wxIntegerValidatorBase, this class is not meant to be used // directly, only wxFloatingPointValidator<> should be used in the user code. class WXDLLIMPEXP_CORE wxFloatingPointValidatorBase : public wxNumValidatorBase { public: // Set precision i.e. the number of digits shown (and accepted on input) // after the decimal point. By default this is set to the maximal precision // supported by the type handled by the validator. void SetPrecision(unsigned precision) { m_precision = precision; } // Set multiplier applied for displaying the value, e.g. 100 if the value // should be displayed in percents, so that the variable containing 0.5 // would be displayed as 50. void SetFactor(double factor) { m_factor = factor; } protected: // Notice that we can't use "long double" here because it's not supported // by wxNumberFormatter yet, so restrict ourselves to just double (and // float). typedef double LongestValueType; wxFloatingPointValidatorBase(int style) : wxNumValidatorBase(style) { m_factor = 1.0; } wxFloatingPointValidatorBase(const wxFloatingPointValidatorBase& other) : wxNumValidatorBase(other) { m_precision = other.m_precision; m_factor = other.m_factor; m_min = other.m_min; m_max = other.m_max; } // Provide methods for wxNumValidator use. wxString ToString(LongestValueType value) const; bool FromString(const wxString& s, LongestValueType *value) const; void DoSetMin(LongestValueType min) { m_min = min; } void DoSetMax(LongestValueType max) { m_max = max; } bool IsInRange(LongestValueType value) const { return m_min <= value && value <= m_max; } // Implement wxNumValidatorBase pure virtual method. virtual bool IsCharOk(const wxString& val, int pos, wxChar ch) const wxOVERRIDE; private: // Maximum number of decimals digits after the decimal separator. unsigned m_precision; // Factor applied for the displayed the value. double m_factor; // Minimal and maximal values accepted (inclusive). LongestValueType m_min, m_max; wxDECLARE_NO_ASSIGN_CLASS(wxFloatingPointValidatorBase); }; // Validator for floating point numbers. It can be used with float, double or // long double values. template <typename T> class wxFloatingPointValidator : public wxPrivate::wxNumValidator<wxFloatingPointValidatorBase, T> { public: typedef T ValueType; typedef wxPrivate::wxNumValidator<wxFloatingPointValidatorBase, T> Base; // Ctor using implicit (maximal) precision for this type. wxFloatingPointValidator(ValueType *value = NULL, int style = wxNUM_VAL_DEFAULT) : Base(value, style) { DoSetMinMax(); this->SetPrecision(std::numeric_limits<ValueType>::digits10); } // Ctor specifying an explicit precision. wxFloatingPointValidator(int precision, ValueType *value = NULL, int style = wxNUM_VAL_DEFAULT) : Base(value, style) { DoSetMinMax(); this->SetPrecision(precision); } virtual wxObject *Clone() const wxOVERRIDE { return new wxFloatingPointValidator(*this); } private: void DoSetMinMax() { // NB: Do not use min(), it's not the smallest representable value for // the floating point types but rather the smallest representable // positive value. this->DoSetMin(-std::numeric_limits<ValueType>::max()); this->DoSetMax( std::numeric_limits<ValueType>::max()); } }; // Helper similar to wxMakeIntValidator(). // // NB: Unfortunately we can't just have a wxMakeNumericValidator() which would // return either wxIntegerValidator<> or wxFloatingPointValidator<> so we // do need two different functions. template <typename T> inline wxFloatingPointValidator<T> wxMakeFloatingPointValidator(T *value, int style = wxNUM_VAL_DEFAULT) { return wxFloatingPointValidator<T>(value, style); } template <typename T> inline wxFloatingPointValidator<T> wxMakeFloatingPointValidator(int precision, T *value, int style = wxNUM_VAL_DEFAULT) { return wxFloatingPointValidator<T>(precision, value, style); } #endif // wxUSE_VALIDATORS #endif // _WX_VALNUM_H_
h
rticonnextdds-usecases
data/projects/rticonnextdds-usecases/VehicleTracking/ExampleCode/thirdparty/wxWidgets-3.1.2/Linux/include/wx/ffile.h
///////////////////////////////////////////////////////////////////////////// // Name: wx/ffile.h // Purpose: wxFFile - encapsulates "FILE *" stream // Author: Vadim Zeitlin // Modified by: // Created: 14.07.99 // Copyright: (c) 1998 Vadim Zeitlin <[email protected]> // Licence: wxWindows licence ///////////////////////////////////////////////////////////////////////////// #ifndef _WX_FFILE_H_ #define _WX_FFILE_H_ #include "wx/defs.h" // for wxUSE_FFILE #if wxUSE_FFILE #include "wx/string.h" #include "wx/filefn.h" #include "wx/convauto.h" #include <stdio.h> // ---------------------------------------------------------------------------- // class wxFFile: standard C stream library 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 wxFFile { public: // ctors // ----- // def ctor wxFFile() { m_fp = NULL; } // open specified file (may fail, use IsOpened()) wxFFile(const wxString& filename, const wxString& mode = wxT("r")); // attach to (already opened) file wxFFile(FILE *lfp) { m_fp = lfp; } // open/close // open a file (existing or not - the mode controls what happens) bool Open(const wxString& filename, const wxString& mode = wxT("r")); // closes the opened file (this is a NOP if not opened) bool Close(); // assign an existing file descriptor and get it back from wxFFile object void Attach(FILE *lfp, const wxString& name = wxEmptyString) { Close(); m_fp = lfp; m_name = name; } FILE* Detach() { FILE* fpOld = m_fp; m_fp = NULL; return fpOld; } FILE *fp() const { return m_fp; } // 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 - use Eof() and Error() to see if an error // occurred or not size_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 ofsInvalid on failure) // move ptr ofs bytes related to start/current pos/end of file bool Seek(wxFileOffset ofs, wxSeekMode mode = wxFromStart); // move ptr to ofs bytes before the end bool SeekEnd(wxFileOffset ofs = 0) { return Seek(ofs, wxFromEnd); } // get current position in the file wxFileOffset Tell() const; // get current file length wxFileOffset Length() const; // simple accessors: note that Eof() and Error() may only be called if // IsOpened(). Otherwise they assert and return false. // is file opened? bool IsOpened() const { return m_fp != NULL; } // is end of file reached? bool Eof() const; // has an error occurred? bool Error() const; // get the file name const wxString& GetName() const { return m_name; } // type such as disk or pipe wxFileKind GetKind() const { return wxGetFileKind(m_fp); } // dtor closes the file if opened ~wxFFile() { 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. wxFFile(const wxFFile&); wxFFile& operator=(const wxFFile&); FILE *m_fp; // IO stream or NULL if not opened wxString m_name; // the name of the file (for diagnostic messages) }; #endif // wxUSE_FFILE #endif // _WX_FFILE_H_
h
rticonnextdds-usecases
data/projects/rticonnextdds-usecases/VehicleTracking/ExampleCode/thirdparty/wxWidgets-3.1.2/Linux/include/wx/radiobut.h
/////////////////////////////////////////////////////////////////////////////// // Name: wx/radiobut.h // Purpose: wxRadioButton declaration // Author: Vadim Zeitlin // Modified by: // Created: 07.09.00 // Copyright: (c) Vadim Zeitlin // Licence: wxWindows licence /////////////////////////////////////////////////////////////////////////////// #ifndef _WX_RADIOBUT_H_BASE_ #define _WX_RADIOBUT_H_BASE_ #include "wx/defs.h" #if wxUSE_RADIOBTN /* There is no wxRadioButtonBase class as wxRadioButton interface is the same as wxCheckBox(Base), but under some platforms wxRadioButton really derives from wxCheckBox and on the others it doesn't. The pseudo-declaration of wxRadioButtonBase would look like this: class wxRadioButtonBase : public ... { public: virtual void SetValue(bool value); virtual bool GetValue() const; }; */ #include "wx/control.h" extern WXDLLIMPEXP_DATA_CORE(const char) wxRadioButtonNameStr[]; #if defined(__WXUNIVERSAL__) #include "wx/univ/radiobut.h" #elif defined(__WXMSW__) #include "wx/msw/radiobut.h" #elif defined(__WXMOTIF__) #include "wx/motif/radiobut.h" #elif defined(__WXGTK20__) #include "wx/gtk/radiobut.h" #elif defined(__WXGTK__) #include "wx/gtk1/radiobut.h" #elif defined(__WXMAC__) #include "wx/osx/radiobut.h" #elif defined(__WXQT__) #include "wx/qt/radiobut.h" #endif #endif // wxUSE_RADIOBTN #endif // _WX_RADIOBUT_H_BASE_
h
rticonnextdds-usecases
data/projects/rticonnextdds-usecases/VehicleTracking/ExampleCode/thirdparty/wxWidgets-3.1.2/Linux/include/wx/display.h
///////////////////////////////////////////////////////////////////////////// // Name: wx/display.h // Purpose: wxDisplay class // Author: Royce Mitchell III, Vadim Zeitlin // Created: 06/21/02 // Copyright: (c) 2002-2006 wxWidgets team // Licence: wxWindows licence ///////////////////////////////////////////////////////////////////////////// #ifndef _WX_DISPLAY_H_BASE_ #define _WX_DISPLAY_H_BASE_ #include "wx/defs.h" #include "wx/gdicmn.h" // wxSize // NB: no #if wxUSE_DISPLAY here, the display geometry part of this class (but // not the video mode stuff) is always available but if wxUSE_DISPLAY == 0 // it becomes just a trivial wrapper around the old wxDisplayXXX() functions #if wxUSE_DISPLAY #include "wx/dynarray.h" #include "wx/vidmode.h" WX_DECLARE_EXPORTED_OBJARRAY(wxVideoMode, wxArrayVideoModes); // default, uninitialized, video mode object extern WXDLLIMPEXP_DATA_CORE(const wxVideoMode) wxDefaultVideoMode; #endif // wxUSE_DISPLAY class WXDLLIMPEXP_FWD_CORE wxWindow; class WXDLLIMPEXP_FWD_CORE wxPoint; class WXDLLIMPEXP_FWD_CORE wxRect; class WXDLLIMPEXP_FWD_BASE wxString; class WXDLLIMPEXP_FWD_CORE wxDisplayFactory; class WXDLLIMPEXP_FWD_CORE wxDisplayImpl; // ---------------------------------------------------------------------------- // wxDisplay: represents a display/monitor attached to the system // ---------------------------------------------------------------------------- class WXDLLIMPEXP_CORE wxDisplay { public: // initialize the object containing all information about the given // display // // the displays are numbered from 0 to GetCount() - 1, 0 is always the // primary display and the only one which is always supported wxDisplay(unsigned n = 0); // create display object corresponding to the display of the given window // or the default one if the window display couldn't be found explicit wxDisplay(const wxWindow* window); // dtor is not virtual as this is a concrete class not meant to be derived // from // return the number of available displays, valid parameters to // wxDisplay ctor are from 0 up to this number static unsigned GetCount(); // find the display where the given point lies, return wxNOT_FOUND if // it doesn't belong to any display static int GetFromPoint(const wxPoint& pt); // find the display where the given window lies, return wxNOT_FOUND if it // is not shown at all static int GetFromWindow(const wxWindow *window); // return true if the object was initialized successfully bool IsOk() const { return m_impl != NULL; } // get the full display size wxRect GetGeometry() const; // get the client area of the display, i.e. without taskbars and such wxRect GetClientArea() const; // get the depth, i.e. number of bits per pixel (0 if unknown) int GetDepth() const; // get the resolution of this monitor in pixels per inch wxSize GetPPI() const; // name may be empty wxString GetName() const; // display 0 is usually the primary display bool IsPrimary() const; #if wxUSE_DISPLAY // enumerate all video modes supported by this display matching the given // one (in the sense of wxVideoMode::Match()) // // as any mode matches the default value of the argument and there is // always at least one video mode supported by display, the returned array // is only empty for the default value of the argument if this function is // not supported at all on this platform wxArrayVideoModes GetModes(const wxVideoMode& mode = wxDefaultVideoMode) const; // get current video mode wxVideoMode GetCurrentMode() const; // change current mode, return true if succeeded, false otherwise // // for the default value of the argument restores the video mode to default bool ChangeMode(const wxVideoMode& mode = wxDefaultVideoMode); // restore the default video mode (just a more readable synonym) void ResetMode() { (void)ChangeMode(); } #endif // wxUSE_DISPLAY private: // returns the factory used to implement our static methods and create new // displays static wxDisplayFactory& Factory(); // creates the factory object, called by Factory() when it is called for // the first time and should return a pointer allocated with new (the // caller will delete it) // // this method must be implemented in platform-specific code if // wxUSE_DISPLAY == 1 (if it is 0 we provide the stub in common code) static wxDisplayFactory *CreateFactory(); // the real implementation wxDisplayImpl *m_impl; wxDECLARE_NO_COPY_CLASS(wxDisplay); }; #endif // _WX_DISPLAY_H_BASE_
h
rticonnextdds-usecases
data/projects/rticonnextdds-usecases/VehicleTracking/ExampleCode/thirdparty/wxWidgets-3.1.2/Linux/include/wx/variant.h
///////////////////////////////////////////////////////////////////////////// // Name: wx/variant.h // Purpose: wxVariant class, container for any type // Author: Julian Smart // Modified by: // Created: 10/09/98 // Copyright: (c) Julian Smart // Licence: wxWindows licence ///////////////////////////////////////////////////////////////////////////// #ifndef _WX_VARIANT_H_ #define _WX_VARIANT_H_ #include "wx/defs.h" #if wxUSE_VARIANT #include "wx/object.h" #include "wx/string.h" #include "wx/arrstr.h" #include "wx/list.h" #include "wx/cpp.h" #include "wx/longlong.h" #if wxUSE_DATETIME #include "wx/datetime.h" #endif // wxUSE_DATETIME #include "wx/iosfwrap.h" class wxAny; /* * 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: 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 : public wxObjectRefData { friend class wxVariant; public: wxVariantData() { } // Override these to provide common functionality virtual bool Eq(wxVariantData& data) const = 0; #if wxUSE_STD_IOSTREAM virtual bool Write(wxSTD ostream& WXUNUSED(str)) const { return false; } #endif virtual bool Write(wxString& WXUNUSED(str)) const { return false; } #if wxUSE_STD_IOSTREAM virtual bool Read(wxSTD istream& WXUNUSED(str)) { return false; } #endif virtual bool Read(wxString& WXUNUSED(str)) { return false; } // What type is it? Return a string name. virtual wxString GetType() const = 0; // If it based on wxObject return the ClassInfo. virtual wxClassInfo* GetValueClassInfo() { return NULL; } // Implement this to make wxVariant::UnShare work. Returns // a copy of the data. virtual wxVariantData* Clone() const { return NULL; } #if wxUSE_ANY // Converts value to wxAny, if possible. Return true if successful. virtual bool GetAsAny(wxAny* WXUNUSED(any)) const { return false; } #endif protected: // Protected dtor should make some incompatible code // break more louder. That is, they should do data->DecRef() // instead of delete data. virtual ~wxVariantData() { } }; /* * wxVariant can store any kind of data, but has some basic types * built in. */ class WXDLLIMPEXP_FWD_BASE wxVariant; WX_DECLARE_LIST_WITH_DECL(wxVariant, wxVariantList, class WXDLLIMPEXP_BASE); class WXDLLIMPEXP_BASE wxVariant: public wxObject { public: wxVariant(); wxVariant(const wxVariant& variant); wxVariant(wxVariantData* data, const wxString& name = wxEmptyString); #if wxUSE_ANY wxVariant(const wxAny& any); #endif virtual ~wxVariant(); // generic assignment void operator= (const wxVariant& variant); // Assignment using data, e.g. // myVariant = new wxStringVariantData("hello"); void operator= (wxVariantData* variantData); bool operator== (const wxVariant& variant) const; bool operator!= (const wxVariant& 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; // For compatibility with wxWidgets <= 2.6, this doesn't increase // reference count. wxVariantData* GetData() const { return (wxVariantData*) m_refData; } void SetData(wxVariantData* data) ; // make a 'clone' of the object void Ref(const wxVariant& clone) { wxObject::Ref(clone); } // ensure that the data is exclusive to this variant, and not shared bool Unshare(); // Make NULL (i.e. delete the data) void MakeNull(); // 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; // write contents to a string (e.g. for debugging) wxString MakeString() const; #if wxUSE_ANY wxAny GetAny() const; #endif // double wxVariant(double val, const wxString& name = wxEmptyString); bool operator== (double value) const; bool operator!= (double value) const; void operator= (double value) ; inline operator double () const { return GetDouble(); } inline double GetReal() const { return GetDouble(); } double GetDouble() const; // long wxVariant(long val, const wxString& name = wxEmptyString); wxVariant(int val, const wxString& name = wxEmptyString); wxVariant(short val, const wxString& name = wxEmptyString); bool operator== (long value) const; bool operator!= (long value) const; void operator= (long value) ; inline operator long () const { return GetLong(); } inline long GetInteger() const { return GetLong(); } long GetLong() const; // bool wxVariant(bool val, const wxString& name = wxEmptyString); bool operator== (bool value) const; bool operator!= (bool value) const; void operator= (bool value) ; inline operator bool () const { return GetBool(); } bool GetBool() const ; // wxDateTime #if wxUSE_DATETIME wxVariant(const wxDateTime& val, const wxString& name = wxEmptyString); bool operator== (const wxDateTime& value) const; bool operator!= (const wxDateTime& value) const; void operator= (const wxDateTime& value) ; inline operator wxDateTime () const { return GetDateTime(); } wxDateTime GetDateTime() const; #endif // wxString wxVariant(const wxString& val, const wxString& name = wxEmptyString); // these overloads are necessary to prevent the compiler from using bool // version instead of wxString one: wxVariant(const char* val, const wxString& name = wxEmptyString); wxVariant(const wchar_t* val, const wxString& name = wxEmptyString); wxVariant(const wxCStrData& val, const wxString& name = wxEmptyString); wxVariant(const wxScopedCharBuffer& val, const wxString& name = wxEmptyString); wxVariant(const wxScopedWCharBuffer& val, const wxString& name = wxEmptyString); bool operator== (const wxString& value) const; bool operator!= (const wxString& value) const; wxVariant& operator=(const wxString& value); // these overloads are necessary to prevent the compiler from using bool // version instead of wxString one: wxVariant& operator=(const char* value) { return *this = wxString(value); } wxVariant& operator=(const wchar_t* value) { return *this = wxString(value); } wxVariant& operator=(const wxCStrData& value) { return *this = value.AsString(); } template<typename T> wxVariant& operator=(const wxScopedCharTypeBuffer<T>& value) { return *this = value.data(); } inline operator wxString () const { return MakeString(); } wxString GetString() const; #if wxUSE_STD_STRING wxVariant(const std::string& val, const wxString& name = wxEmptyString); bool operator==(const std::string& value) const { return operator==(wxString(value)); } bool operator!=(const std::string& value) const { return operator!=(wxString(value)); } wxVariant& operator=(const std::string& value) { return operator=(wxString(value)); } operator std::string() const { return (operator wxString()).ToStdString(); } wxVariant(const wxStdWideString& val, const wxString& name = wxEmptyString); bool operator==(const wxStdWideString& value) const { return operator==(wxString(value)); } bool operator!=(const wxStdWideString& value) const { return operator!=(wxString(value)); } wxVariant& operator=(const wxStdWideString& value) { return operator=(wxString(value)); } operator wxStdWideString() const { return (operator wxString()).ToStdWstring(); } #endif // wxUSE_STD_STRING // wxUniChar wxVariant(const wxUniChar& val, const wxString& name = wxEmptyString); wxVariant(const wxUniCharRef& val, const wxString& name = wxEmptyString); wxVariant(char val, const wxString& name = wxEmptyString); wxVariant(wchar_t val, const wxString& name = wxEmptyString); bool operator==(const wxUniChar& value) const; bool operator==(const wxUniCharRef& value) const { return *this == wxUniChar(value); } bool operator==(char value) const { return *this == wxUniChar(value); } bool operator==(wchar_t value) const { return *this == wxUniChar(value); } bool operator!=(const wxUniChar& value) const { return !(*this == value); } bool operator!=(const wxUniCharRef& value) const { return !(*this == value); } bool operator!=(char value) const { return !(*this == value); } bool operator!=(wchar_t value) const { return !(*this == value); } wxVariant& operator=(const wxUniChar& value); wxVariant& operator=(const wxUniCharRef& value) { return *this = wxUniChar(value); } wxVariant& operator=(char value) { return *this = wxUniChar(value); } wxVariant& operator=(wchar_t value) { return *this = wxUniChar(value); } operator wxUniChar() const { return GetChar(); } operator char() const { return GetChar(); } operator wchar_t() const { return GetChar(); } wxUniChar GetChar() const; // wxArrayString wxVariant(const wxArrayString& val, const wxString& name = wxEmptyString); bool operator== (const wxArrayString& value) const; bool operator!= (const wxArrayString& value) const; void operator= (const wxArrayString& value); operator wxArrayString () const { return GetArrayString(); } wxArrayString GetArrayString() const; // void* wxVariant(void* ptr, const wxString& name = wxEmptyString); bool operator== (void* value) const; bool operator!= (void* value) const; void operator= (void* value); operator void* () const { return GetVoidPtr(); } void* GetVoidPtr() const; // wxObject* wxVariant(wxObject* ptr, const wxString& name = wxEmptyString); bool operator== (wxObject* value) const; bool operator!= (wxObject* value) const; void operator= (wxObject* value); wxObject* GetWxObjectPtr() const; #if wxUSE_LONGLONG // wxLongLong wxVariant(wxLongLong, const wxString& name = wxEmptyString); bool operator==(wxLongLong value) const; bool operator!=(wxLongLong value) const; void operator=(wxLongLong value); operator wxLongLong() const { return GetLongLong(); } wxLongLong GetLongLong() const; // wxULongLong wxVariant(wxULongLong, const wxString& name = wxEmptyString); bool operator==(wxULongLong value) const; bool operator!=(wxULongLong value) const; void operator=(wxULongLong value); operator wxULongLong() const { return GetULongLong(); } wxULongLong GetULongLong() const; #endif // ------------------------------ // list operations // ------------------------------ wxVariant(const wxVariantList& val, const wxString& name = wxEmptyString); // List of variants bool operator== (const wxVariantList& value) const; bool operator!= (const wxVariantList& value) const; void operator= (const wxVariantList& value) ; // Treat a list variant as an array wxVariant operator[] (size_t idx) const; wxVariant& operator[] (size_t idx) ; wxVariantList& GetList() const ; // Return the number of elements in a list size_t GetCount() const; // Make empty list void NullList(); // Append to list void Append(const wxVariant& value); // Insert at front of list void Insert(const wxVariant& value); // Returns true if the variant is a member of the list bool Member(const wxVariant& value) const; // Deletes the nth element of the list bool Delete(size_t item); // Clear list void ClearList(); public: // Type conversion bool Convert(long* value) const; bool Convert(bool* value) const; bool Convert(double* value) const; bool Convert(wxString* value) const; bool Convert(wxUniChar* value) const; bool Convert(char* value) const; bool Convert(wchar_t* value) const; #if wxUSE_DATETIME bool Convert(wxDateTime* value) const; #endif // wxUSE_DATETIME #if wxUSE_LONGLONG bool Convert(wxLongLong* value) const; bool Convert(wxULongLong* value) const; #ifdef wxLongLong_t bool Convert(wxLongLong_t* value) const { wxLongLong temp; if ( !Convert(&temp) ) return false; *value = temp.GetValue(); return true; } bool Convert(wxULongLong_t* value) const { wxULongLong temp; if ( !Convert(&temp) ) return false; *value = temp.GetValue(); return true; } #endif // wxLongLong_t #endif // wxUSE_LONGLONG // Attributes protected: virtual wxObjectRefData *CreateRefData() const wxOVERRIDE; virtual wxObjectRefData *CloneRefData(const wxObjectRefData *data) const wxOVERRIDE; wxString m_name; private: wxDECLARE_DYNAMIC_CLASS(wxVariant); }; // // wxVariant <-> wxAny conversion code // #if wxUSE_ANY #include "wx/any.h" // In order to convert wxAny to wxVariant, we need to be able to associate // wxAnyValueType with a wxVariantData factory function. typedef wxVariantData* (*wxVariantDataFactory)(const wxAny& any); // Actual Any-to-Variant registration must be postponed to a time when all // global variables have been initialized. Hence this arrangement. // wxAnyToVariantRegistration instances are kept in global scope and // wxAnyValueTypeGlobals in any.cpp will use their data when the time is // right. class WXDLLIMPEXP_BASE wxAnyToVariantRegistration { public: wxAnyToVariantRegistration(wxVariantDataFactory factory); virtual ~wxAnyToVariantRegistration(); virtual wxAnyValueType* GetAssociatedType() = 0; wxVariantDataFactory GetFactory() const { return m_factory; } private: wxVariantDataFactory m_factory; }; template<typename T> class wxAnyToVariantRegistrationImpl : public wxAnyToVariantRegistration { public: wxAnyToVariantRegistrationImpl(wxVariantDataFactory factory) : wxAnyToVariantRegistration(factory) { } virtual wxAnyValueType* GetAssociatedType() wxOVERRIDE { return wxAnyValueTypeImpl<T>::GetInstance(); } private: }; #define DECLARE_WXANY_CONVERSION() \ virtual bool GetAsAny(wxAny* any) const wxOVERRIDE; \ static wxVariantData* VariantDataFactory(const wxAny& any); #define _REGISTER_WXANY_CONVERSION(T, CLASSNAME, FUNC) \ static wxAnyToVariantRegistrationImpl<T> \ gs_##CLASSNAME##AnyToVariantRegistration = \ wxAnyToVariantRegistrationImpl<T>(&FUNC); #define REGISTER_WXANY_CONVERSION(T, CLASSNAME) \ _REGISTER_WXANY_CONVERSION(T, CLASSNAME, CLASSNAME::VariantDataFactory) #define IMPLEMENT_TRIVIAL_WXANY_CONVERSION(T, CLASSNAME) \ bool CLASSNAME::GetAsAny(wxAny* any) const \ { \ *any = m_value; \ return true; \ } \ wxVariantData* CLASSNAME::VariantDataFactory(const wxAny& any) \ { \ return new CLASSNAME(any.As<T>()); \ } \ REGISTER_WXANY_CONVERSION(T, CLASSNAME) #else // if !wxUSE_ANY #define DECLARE_WXANY_CONVERSION() #define REGISTER_WXANY_CONVERSION(T, CLASSNAME) #define IMPLEMENT_TRIVIAL_WXANY_CONVERSION(T, CLASSNAME) #endif // wxUSE_ANY/!wxUSE_ANY #define DECLARE_VARIANT_OBJECT(classname) \ DECLARE_VARIANT_OBJECT_EXPORTED(classname, wxEMPTY_PARAMETER_VALUE) #define DECLARE_VARIANT_OBJECT_EXPORTED(classname,expdecl) \ expdecl classname& operator << ( classname &object, const wxVariant &variant ); \ expdecl wxVariant& operator << ( wxVariant &variant, const classname &object ); #define IMPLEMENT_VARIANT_OBJECT(classname) \ IMPLEMENT_VARIANT_OBJECT_EXPORTED(classname, wxEMPTY_PARAMETER_VALUE) #define IMPLEMENT_VARIANT_OBJECT_EXPORTED_NO_EQ(classname,expdecl) \ class classname##VariantData: public wxVariantData \ { \ public:\ classname##VariantData() {} \ classname##VariantData( const classname &value ) { m_value = value; } \ \ classname &GetValue() { return m_value; } \ \ virtual bool Eq(wxVariantData& data) const wxOVERRIDE; \ \ virtual wxString GetType() const wxOVERRIDE; \ virtual wxClassInfo* GetValueClassInfo() wxOVERRIDE; \ \ virtual wxVariantData* Clone() const wxOVERRIDE { return new classname##VariantData(m_value); } \ \ DECLARE_WXANY_CONVERSION() \ protected:\ classname m_value; \ };\ \ wxString classname##VariantData::GetType() const\ {\ return m_value.GetClassInfo()->GetClassName();\ }\ \ wxClassInfo* classname##VariantData::GetValueClassInfo()\ {\ return m_value.GetClassInfo();\ }\ \ expdecl classname& operator << ( classname &value, const wxVariant &variant )\ {\ wxASSERT( variant.GetType() == #classname );\ \ classname##VariantData *data = (classname##VariantData*) variant.GetData();\ value = data->GetValue();\ return value;\ }\ \ expdecl wxVariant& operator << ( wxVariant &variant, const classname &value )\ {\ classname##VariantData *data = new classname##VariantData( value );\ variant.SetData( data );\ return variant;\ } \ IMPLEMENT_TRIVIAL_WXANY_CONVERSION(classname, classname##VariantData) // implements a wxVariantData-derived class using for the Eq() method the // operator== which must have been provided by "classname" #define IMPLEMENT_VARIANT_OBJECT_EXPORTED(classname,expdecl) \ IMPLEMENT_VARIANT_OBJECT_EXPORTED_NO_EQ(classname,wxEMPTY_PARAMETER_VALUE expdecl) \ \ bool classname##VariantData::Eq(wxVariantData& data) const \ {\ wxASSERT( GetType() == data.GetType() );\ \ classname##VariantData & otherData = (classname##VariantData &) data;\ \ return otherData.m_value == m_value;\ }\ // implements a wxVariantData-derived class using for the Eq() method a shallow // comparison (through wxObject::IsSameAs function) #define IMPLEMENT_VARIANT_OBJECT_SHALLOWCMP(classname) \ IMPLEMENT_VARIANT_OBJECT_EXPORTED_SHALLOWCMP(classname, wxEMPTY_PARAMETER_VALUE) #define IMPLEMENT_VARIANT_OBJECT_EXPORTED_SHALLOWCMP(classname,expdecl) \ IMPLEMENT_VARIANT_OBJECT_EXPORTED_NO_EQ(classname,wxEMPTY_PARAMETER_VALUE expdecl) \ \ bool classname##VariantData::Eq(wxVariantData& data) const \ {\ wxASSERT( GetType() == data.GetType() );\ \ classname##VariantData & otherData = (classname##VariantData &) data;\ \ return (otherData.m_value.IsSameAs(m_value));\ }\ // Since we want type safety wxVariant we need to fetch and dynamic_cast // in a seemingly safe way so the compiler can check, so we define // a dynamic_cast /wxDynamicCast analogue. #define wxGetVariantCast(var,classname) \ ((classname*)(var.IsValueKindOf(&classname::ms_classInfo) ?\ var.GetWxObjectPtr() : NULL)); // Replacement for using wxDynamicCast on a wxVariantData object #ifndef wxNO_RTTI #define wxDynamicCastVariantData(data, classname) dynamic_cast<classname*>(data) #endif #define wxStaticCastVariantData(data, classname) static_cast<classname*>(data) extern wxVariant WXDLLIMPEXP_BASE wxNullVariant; #endif // wxUSE_VARIANT #endif // _WX_VARIANT_H_
h
rticonnextdds-usecases
data/projects/rticonnextdds-usecases/VehicleTracking/ExampleCode/thirdparty/wxWidgets-3.1.2/Linux/include/wx/scopedarray.h
///////////////////////////////////////////////////////////////////////////// // Name: wx/scopedarray.h // Purpose: scoped smart pointer class // Author: Vadim Zeitlin // Created: 2009-02-03 // Copyright: (c) Jesse Lovelace and original Boost authors (see below) // (c) 2009 Vadim Zeitlin // Licence: wxWindows licence ///////////////////////////////////////////////////////////////////////////// #ifndef _WX_SCOPED_ARRAY_H_ #define _WX_SCOPED_ARRAY_H_ #include "wx/defs.h" #include "wx/checkeddelete.h" // ---------------------------------------------------------------------------- // wxScopedArray: A scoped array // ---------------------------------------------------------------------------- template <class T> class wxScopedArray { public: typedef T element_type; explicit wxScopedArray(T * array = NULL) : m_array(array) { } explicit wxScopedArray(size_t count) : m_array(new T[count]) { } ~wxScopedArray() { delete [] m_array; } // test for pointer validity: defining conversion to unspecified_bool_type // and not more obvious bool to avoid implicit conversions to integer types typedef T *(wxScopedArray<T>::*unspecified_bool_type)() const; operator unspecified_bool_type() const { return m_array ? &wxScopedArray<T>::get : NULL; } void reset(T *array = NULL) { if ( array != m_array ) { delete [] m_array; m_array = array; } } T& operator[](size_t n) const { return m_array[n]; } T *get() const { return m_array; } void swap(wxScopedArray &other) { T * const tmp = other.m_array; other.m_array = m_array; m_array = tmp; } private: T *m_array; wxDECLARE_NO_COPY_TEMPLATE_CLASS(wxScopedArray, T); }; // ---------------------------------------------------------------------------- // old macro based implementation // ---------------------------------------------------------------------------- // the same but for arrays instead of simple pointers #define wxDECLARE_SCOPED_ARRAY(T, name)\ class name \ { \ private: \ T * m_ptr; \ name(name const &); \ name & operator=(name const &); \ \ public: \ explicit name(T * p = NULL) : m_ptr(p) \ {} \ \ ~name(); \ void reset(T * p = NULL); \ \ T & operator[](long int i) const\ { \ wxASSERT(m_ptr != NULL); \ wxASSERT(i >= 0); \ return m_ptr[i]; \ } \ \ T * get() const \ { \ return m_ptr; \ } \ \ void swap(name & ot) \ { \ T * tmp = ot.m_ptr; \ ot.m_ptr = m_ptr; \ m_ptr = tmp; \ } \ }; #define wxDEFINE_SCOPED_ARRAY(T, name) \ name::~name() \ { \ wxCHECKED_DELETE_ARRAY(m_ptr); \ } \ void name::reset(T * p){ \ if (m_ptr != p) \ { \ wxCHECKED_DELETE_ARRAY(m_ptr); \ m_ptr = p; \ } \ } #endif // _WX_SCOPED_ARRAY_H_
h
rticonnextdds-usecases
data/projects/rticonnextdds-usecases/VehicleTracking/ExampleCode/thirdparty/wxWidgets-3.1.2/Linux/include/wx/any.h
///////////////////////////////////////////////////////////////////////////// // Name: wx/any.h // Purpose: wxAny class // Author: Jaakko Salli // Modified by: // Created: 07/05/2009 // Copyright: (c) wxWidgets team // Licence: wxWindows licence ///////////////////////////////////////////////////////////////////////////// #ifndef _WX_ANY_H_ #define _WX_ANY_H_ #include "wx/defs.h" #if wxUSE_ANY #include <new> // for placement new #include "wx/string.h" #include "wx/meta/if.h" #include "wx/typeinfo.h" #include "wx/list.h" // Size of the wxAny value buffer. enum { WX_ANY_VALUE_BUFFER_SIZE = 16 }; union wxAnyValueBuffer { union Alignment { #if wxHAS_INT64 wxInt64 m_int64; #endif long double m_longDouble; void ( *m_funcPtr )(void); void ( wxAnyValueBuffer::*m_mFuncPtr )(void); } m_alignment; void* m_ptr; wxByte m_buffer[WX_ANY_VALUE_BUFFER_SIZE]; }; // // wxAnyValueType is base class for value type functionality for C++ data // types used with wxAny. Usually the default template (wxAnyValueTypeImpl<>) // will create a satisfactory wxAnyValueType implementation for a data type. // class WXDLLIMPEXP_BASE wxAnyValueType { WX_DECLARE_ABSTRACT_TYPEINFO(wxAnyValueType) public: /** Default constructor. */ wxAnyValueType() { } /** Destructor. */ virtual ~wxAnyValueType() { } /** This function is used for internal type matching. */ virtual bool IsSameType(const wxAnyValueType* otherType) const = 0; /** This function is called every time the data in wxAny buffer needs to be freed. */ virtual void DeleteValue(wxAnyValueBuffer& buf) const = 0; /** Implement this for buffer-to-buffer copy. @param src This is the source data buffer. @param dst This is the destination data buffer that is in either uninitialized or freed state. */ virtual void CopyBuffer(const wxAnyValueBuffer& src, wxAnyValueBuffer& dst) const = 0; /** Convert value into buffer of different type. Return false if not possible. */ virtual bool ConvertValue(const wxAnyValueBuffer& src, wxAnyValueType* dstType, wxAnyValueBuffer& dst) const = 0; /** Use this template function for checking if wxAnyValueType represents a specific C++ data type. @see wxAny::CheckType() */ template <typename T> bool CheckType() const; #if wxUSE_EXTENDED_RTTI virtual const wxTypeInfo* GetTypeInfo() const = 0; #endif private: }; // // We need to allocate wxAnyValueType instances in heap, and need to use // scoped ptr to properly deallocate them in dynamic library use cases. // Here we have a minimal specialized scoped ptr implementation to deal // with various compiler-specific problems with template class' static // member variable of template type with explicit constructor which // is initialized in global scope. // class wxAnyValueTypeScopedPtr { public: wxAnyValueTypeScopedPtr(wxAnyValueType* ptr) : m_ptr(ptr) { } ~wxAnyValueTypeScopedPtr() { delete m_ptr; } wxAnyValueType* get() const { return m_ptr; } private: wxAnyValueType* m_ptr; }; // Deprecated macro for checking the type which was originally introduced for // MSVC6 compatibility and is not needed any longer now that this compiler is // not supported any more. #define wxANY_VALUE_TYPE_CHECK_TYPE(valueTypePtr, T) \ wxAnyValueTypeImpl<T>::IsSameClass(valueTypePtr) /** Helper macro for defining user value types. Even though C++ RTTI would be fully available to use, we'd have to to facilitate sub-type system which allows, for instance, wxAny with signed short '15' to be treated equal to wxAny with signed long long '15'. Having sm_instance is important here. NB: We really need to have wxAnyValueType instances allocated in heap. They are stored as static template member variables, and with them we just can't be too careful (eg. not allocating them in heap broke the type identification in GCC). */ #define WX_DECLARE_ANY_VALUE_TYPE(CLS) \ friend class wxAny; \ WX_DECLARE_TYPEINFO_INLINE(CLS) \ public: \ static bool IsSameClass(const wxAnyValueType* otherType) \ { \ return AreSameClasses(*sm_instance.get(), *otherType); \ } \ virtual bool IsSameType(const wxAnyValueType* otherType) const wxOVERRIDE \ { \ return IsSameClass(otherType); \ } \ private: \ static bool AreSameClasses(const wxAnyValueType& a, const wxAnyValueType& b) \ { \ return wxTypeId(a) == wxTypeId(b); \ } \ static wxAnyValueTypeScopedPtr sm_instance; \ public: \ static wxAnyValueType* GetInstance() \ { \ return sm_instance.get(); \ } #define WX_IMPLEMENT_ANY_VALUE_TYPE(CLS) \ wxAnyValueTypeScopedPtr CLS::sm_instance(new CLS()); /** Following are helper classes for the wxAnyValueTypeImplBase. */ namespace wxPrivate { template<typename T> class wxAnyValueTypeOpsInplace { public: static void DeleteValue(wxAnyValueBuffer& buf) { GetValue(buf).~T(); } static void SetValue(const T& value, wxAnyValueBuffer& buf) { // Use placement new void* const place = buf.m_buffer; ::new(place) T(value); } static const T& GetValue(const wxAnyValueBuffer& buf) { // Use a union to avoid undefined behaviour (and gcc -Wstrict-alias // warnings about it) which would occur if we just casted a wxByte // pointer to a T one. union { const T* ptr; const wxByte *buf; } u; u.buf = buf.m_buffer; return *u.ptr; } }; template<typename T> class wxAnyValueTypeOpsGeneric { public: template<typename T2> class DataHolder { public: DataHolder(const T2& value) { m_value = value; } virtual ~DataHolder() { } T2 m_value; private: wxDECLARE_NO_COPY_CLASS(DataHolder); }; static void DeleteValue(wxAnyValueBuffer& buf) { DataHolder<T>* holder = static_cast<DataHolder<T>*>(buf.m_ptr); delete holder; } static void SetValue(const T& value, wxAnyValueBuffer& buf) { DataHolder<T>* holder = new DataHolder<T>(value); buf.m_ptr = holder; } static const T& GetValue(const wxAnyValueBuffer& buf) { DataHolder<T>* holder = static_cast<DataHolder<T>*>(buf.m_ptr); return holder->m_value; } }; template <typename T> struct wxAnyAsImpl; } // namespace wxPrivate /** Intermediate template for the generic value type implementation. We can derive from this same value type for multiple actual types (for instance, we can have wxAnyValueTypeImplInt for all signed integer types), and also easily implement specialized templates with specific dynamic type conversion. */ template<typename T> class wxAnyValueTypeImplBase : public wxAnyValueType { typedef typename wxIf< sizeof(T) <= WX_ANY_VALUE_BUFFER_SIZE, wxPrivate::wxAnyValueTypeOpsInplace<T>, wxPrivate::wxAnyValueTypeOpsGeneric<T> >::value Ops; public: wxAnyValueTypeImplBase() : wxAnyValueType() { } virtual ~wxAnyValueTypeImplBase() { } virtual void DeleteValue(wxAnyValueBuffer& buf) const wxOVERRIDE { Ops::DeleteValue(buf); } virtual void CopyBuffer(const wxAnyValueBuffer& src, wxAnyValueBuffer& dst) const wxOVERRIDE { Ops::SetValue(Ops::GetValue(src), dst); } /** It is important to reimplement this in any specialized template classes that inherit from wxAnyValueTypeImplBase. */ static void SetValue(const T& value, wxAnyValueBuffer& buf) { Ops::SetValue(value, buf); } /** It is important to reimplement this in any specialized template classes that inherit from wxAnyValueTypeImplBase. */ static const T& GetValue(const wxAnyValueBuffer& buf) { return Ops::GetValue(buf); } #if wxUSE_EXTENDED_RTTI virtual const wxTypeInfo* GetTypeInfo() const { return wxGetTypeInfo((T*)NULL); } #endif }; /* Generic value type template. Note that bulk of the implementation resides in wxAnyValueTypeImplBase. */ template<typename T> class wxAnyValueTypeImpl : public wxAnyValueTypeImplBase<T> { WX_DECLARE_ANY_VALUE_TYPE(wxAnyValueTypeImpl<T>) public: wxAnyValueTypeImpl() : wxAnyValueTypeImplBase<T>() { } virtual ~wxAnyValueTypeImpl() { } virtual bool ConvertValue(const wxAnyValueBuffer& src, wxAnyValueType* dstType, wxAnyValueBuffer& dst) const wxOVERRIDE { wxUnusedVar(src); wxUnusedVar(dstType); wxUnusedVar(dst); return false; } }; template<typename T> wxAnyValueTypeScopedPtr wxAnyValueTypeImpl<T>::sm_instance = new wxAnyValueTypeImpl<T>(); // // Helper macro for using same base value type implementation for multiple // actual C++ data types. // #define _WX_ANY_DEFINE_SUB_TYPE(T, CLSTYPE) \ template<> \ class wxAnyValueTypeImpl<T> : public wxAnyValueTypeImpl##CLSTYPE \ { \ typedef wxAnyBase##CLSTYPE##Type UseDataType; \ public: \ wxAnyValueTypeImpl() : wxAnyValueTypeImpl##CLSTYPE() { } \ virtual ~wxAnyValueTypeImpl() { } \ static void SetValue(const T& value, wxAnyValueBuffer& buf) \ { \ void* voidPtr = reinterpret_cast<void*>(&buf.m_buffer[0]); \ UseDataType* dptr = reinterpret_cast<UseDataType*>(voidPtr); \ *dptr = static_cast<UseDataType>(value); \ } \ static T GetValue(const wxAnyValueBuffer& buf) \ { \ const void* voidPtr = \ reinterpret_cast<const void*>(&buf.m_buffer[0]); \ const UseDataType* sptr = \ reinterpret_cast<const UseDataType*>(voidPtr); \ return static_cast<T>(*sptr); \ } #if wxUSE_EXTENDED_RTTI #define WX_ANY_DEFINE_SUB_TYPE(T, CLSTYPE) \ _WX_ANY_DEFINE_SUB_TYPE(T, CLSTYPE)\ virtual const wxTypeInfo* GetTypeInfo() const \ { \ return wxGetTypeInfo((T*)NULL); \ } \ }; #else #define WX_ANY_DEFINE_SUB_TYPE(T, CLSTYPE) \ _WX_ANY_DEFINE_SUB_TYPE(T, CLSTYPE)\ }; #endif // // Integer value types // #ifdef wxLongLong_t typedef wxLongLong_t wxAnyBaseIntType; typedef wxULongLong_t wxAnyBaseUintType; #else typedef long wxAnyBaseIntType; typedef unsigned long wxAnyBaseUintType; #endif class WXDLLIMPEXP_BASE wxAnyValueTypeImplInt : public wxAnyValueTypeImplBase<wxAnyBaseIntType> { WX_DECLARE_ANY_VALUE_TYPE(wxAnyValueTypeImplInt) public: wxAnyValueTypeImplInt() : wxAnyValueTypeImplBase<wxAnyBaseIntType>() { } virtual ~wxAnyValueTypeImplInt() { } virtual bool ConvertValue(const wxAnyValueBuffer& src, wxAnyValueType* dstType, wxAnyValueBuffer& dst) const wxOVERRIDE; }; class WXDLLIMPEXP_BASE wxAnyValueTypeImplUint : public wxAnyValueTypeImplBase<wxAnyBaseUintType> { WX_DECLARE_ANY_VALUE_TYPE(wxAnyValueTypeImplUint) public: wxAnyValueTypeImplUint() : wxAnyValueTypeImplBase<wxAnyBaseUintType>() { } virtual ~wxAnyValueTypeImplUint() { } virtual bool ConvertValue(const wxAnyValueBuffer& src, wxAnyValueType* dstType, wxAnyValueBuffer& dst) const wxOVERRIDE; }; WX_ANY_DEFINE_SUB_TYPE(signed long, Int) WX_ANY_DEFINE_SUB_TYPE(signed int, Int) WX_ANY_DEFINE_SUB_TYPE(signed short, Int) WX_ANY_DEFINE_SUB_TYPE(signed char, Int) #ifdef wxLongLong_t WX_ANY_DEFINE_SUB_TYPE(wxLongLong_t, Int) #endif WX_ANY_DEFINE_SUB_TYPE(unsigned long, Uint) WX_ANY_DEFINE_SUB_TYPE(unsigned int, Uint) WX_ANY_DEFINE_SUB_TYPE(unsigned short, Uint) WX_ANY_DEFINE_SUB_TYPE(unsigned char, Uint) #ifdef wxLongLong_t WX_ANY_DEFINE_SUB_TYPE(wxULongLong_t, Uint) #endif // // This macro is used in header, but then in source file we must have: // WX_IMPLEMENT_ANY_VALUE_TYPE(wxAnyValueTypeImpl##TYPENAME) // #define _WX_ANY_DEFINE_CONVERTIBLE_TYPE(T, TYPENAME, CONVFUNC, GV) \ class WXDLLIMPEXP_BASE wxAnyValueTypeImpl##TYPENAME : \ public wxAnyValueTypeImplBase<T> \ { \ WX_DECLARE_ANY_VALUE_TYPE(wxAnyValueTypeImpl##TYPENAME) \ public: \ wxAnyValueTypeImpl##TYPENAME() : \ wxAnyValueTypeImplBase<T>() { } \ virtual ~wxAnyValueTypeImpl##TYPENAME() { } \ virtual bool ConvertValue(const wxAnyValueBuffer& src, \ wxAnyValueType* dstType, \ wxAnyValueBuffer& dst) const wxOVERRIDE \ { \ GV value = GetValue(src); \ return CONVFUNC(value, dstType, dst); \ } \ }; \ template<> \ class wxAnyValueTypeImpl<T> : public wxAnyValueTypeImpl##TYPENAME \ { \ public: \ wxAnyValueTypeImpl() : wxAnyValueTypeImpl##TYPENAME() { } \ virtual ~wxAnyValueTypeImpl() { } \ }; #define WX_ANY_DEFINE_CONVERTIBLE_TYPE(T, TYPENAME, CONVFUNC, BT) \ _WX_ANY_DEFINE_CONVERTIBLE_TYPE(T, TYPENAME, CONVFUNC, BT) \ #define WX_ANY_DEFINE_CONVERTIBLE_TYPE_BASE(T, TYPENAME, CONVFUNC) \ _WX_ANY_DEFINE_CONVERTIBLE_TYPE(T, TYPENAME, \ CONVFUNC, const T&) \ // // String value type // // Convert wxString to destination wxAny value type extern WXDLLIMPEXP_BASE bool wxAnyConvertString(const wxString& value, wxAnyValueType* dstType, wxAnyValueBuffer& dst); WX_ANY_DEFINE_CONVERTIBLE_TYPE_BASE(wxString, wxString, wxAnyConvertString) WX_ANY_DEFINE_CONVERTIBLE_TYPE(const char*, ConstCharPtr, wxAnyConvertString, wxString) WX_ANY_DEFINE_CONVERTIBLE_TYPE(const wchar_t*, ConstWchar_tPtr, wxAnyConvertString, wxString) // // Bool value type // template<> class WXDLLIMPEXP_BASE wxAnyValueTypeImpl<bool> : public wxAnyValueTypeImplBase<bool> { WX_DECLARE_ANY_VALUE_TYPE(wxAnyValueTypeImpl<bool>) public: wxAnyValueTypeImpl() : wxAnyValueTypeImplBase<bool>() { } virtual ~wxAnyValueTypeImpl() { } virtual bool ConvertValue(const wxAnyValueBuffer& src, wxAnyValueType* dstType, wxAnyValueBuffer& dst) const wxOVERRIDE; }; // // Floating point value type // class WXDLLIMPEXP_BASE wxAnyValueTypeImplDouble : public wxAnyValueTypeImplBase<double> { WX_DECLARE_ANY_VALUE_TYPE(wxAnyValueTypeImplDouble) public: wxAnyValueTypeImplDouble() : wxAnyValueTypeImplBase<double>() { } virtual ~wxAnyValueTypeImplDouble() { } virtual bool ConvertValue(const wxAnyValueBuffer& src, wxAnyValueType* dstType, wxAnyValueBuffer& dst) const wxOVERRIDE; }; // WX_ANY_DEFINE_SUB_TYPE requires this typedef double wxAnyBaseDoubleType; WX_ANY_DEFINE_SUB_TYPE(float, Double) WX_ANY_DEFINE_SUB_TYPE(double, Double) // // Defines a dummy wxAnyValueTypeImpl<> with given export // declaration. This is needed if a class is used with // wxAny in both user shared library and application. // #define wxDECLARE_ANY_TYPE(CLS, DECL) \ template<> \ class DECL wxAnyValueTypeImpl<CLS> : \ public wxAnyValueTypeImplBase<CLS> \ { \ WX_DECLARE_ANY_VALUE_TYPE(wxAnyValueTypeImpl<CLS>) \ public: \ wxAnyValueTypeImpl() : \ wxAnyValueTypeImplBase<CLS>() { } \ virtual ~wxAnyValueTypeImpl() { } \ \ virtual bool ConvertValue(const wxAnyValueBuffer& src, \ wxAnyValueType* dstType, \ wxAnyValueBuffer& dst) const wxOVERRIDE \ { \ wxUnusedVar(src); \ wxUnusedVar(dstType); \ wxUnusedVar(dst); \ return false; \ } \ }; // Make sure some of wx's own types get the right wxAnyValueType export // (this is needed only for types that are referred to from wxBase. // currently we may not use any of these types from there, but let's // use the macro on at least one to make sure it compiles since we can't // really test it properly in unit tests since a separate DLL would // be needed). #if wxUSE_DATETIME #include "wx/datetime.h" wxDECLARE_ANY_TYPE(wxDateTime, WXDLLIMPEXP_BASE) #endif //#include "wx/object.h" //wxDECLARE_ANY_TYPE(wxObject*, WXDLLIMPEXP_BASE) //#include "wx/arrstr.h" //wxDECLARE_ANY_TYPE(wxArrayString, WXDLLIMPEXP_BASE) #if wxUSE_VARIANT class WXDLLIMPEXP_FWD_BASE wxAnyToVariantRegistration; // Because of header inter-dependencies, cannot include this earlier #include "wx/variant.h" // // wxVariantData* data type implementation. For cases when appropriate // wxAny<->wxVariant conversion code is missing. // class WXDLLIMPEXP_BASE wxAnyValueTypeImplVariantData : public wxAnyValueTypeImplBase<wxVariantData*> { WX_DECLARE_ANY_VALUE_TYPE(wxAnyValueTypeImplVariantData) public: wxAnyValueTypeImplVariantData() : wxAnyValueTypeImplBase<wxVariantData*>() { } virtual ~wxAnyValueTypeImplVariantData() { } virtual void DeleteValue(wxAnyValueBuffer& buf) const wxOVERRIDE { wxVariantData* data = static_cast<wxVariantData*>(buf.m_ptr); if ( data ) data->DecRef(); } virtual void CopyBuffer(const wxAnyValueBuffer& src, wxAnyValueBuffer& dst) const wxOVERRIDE { wxVariantData* data = static_cast<wxVariantData*>(src.m_ptr); if ( data ) data->IncRef(); dst.m_ptr = data; } static void SetValue(wxVariantData* value, wxAnyValueBuffer& buf) { value->IncRef(); buf.m_ptr = value; } static wxVariantData* GetValue(const wxAnyValueBuffer& buf) { return static_cast<wxVariantData*>(buf.m_ptr); } virtual bool ConvertValue(const wxAnyValueBuffer& src, wxAnyValueType* dstType, wxAnyValueBuffer& dst) const wxOVERRIDE { wxUnusedVar(src); wxUnusedVar(dstType); wxUnusedVar(dst); return false; } }; template<> class wxAnyValueTypeImpl<wxVariantData*> : public wxAnyValueTypeImplVariantData { public: wxAnyValueTypeImpl() : wxAnyValueTypeImplVariantData() { } virtual ~wxAnyValueTypeImpl() { } }; #endif // wxUSE_VARIANT /* Let's define a discrete Null value so we don't have to really ever check if wxAny.m_type pointer is NULL or not. This is an optimization, mostly. Implementation of this value type is "hidden" in the source file. */ extern WXDLLIMPEXP_DATA_BASE(wxAnyValueType*) wxAnyNullValueType; // // We need to implement custom signed/unsigned int equals operators // for signed/unsigned (eg. wxAny(128UL) == 128L) comparisons to work. #define WXANY_IMPLEMENT_INT_EQ_OP(TS, TUS) \ bool operator==(TS value) const \ { \ if ( wxAnyValueTypeImpl<TS>::IsSameClass(m_type) ) \ return (value == static_cast<TS> \ (wxAnyValueTypeImpl<TS>::GetValue(m_buffer))); \ if ( wxAnyValueTypeImpl<TUS>::IsSameClass(m_type) ) \ return (value == static_cast<TS> \ (wxAnyValueTypeImpl<TUS>::GetValue(m_buffer))); \ return false; \ } \ bool operator==(TUS value) const \ { \ if ( wxAnyValueTypeImpl<TUS>::IsSameClass(m_type) ) \ return (value == static_cast<TUS> \ (wxAnyValueTypeImpl<TUS>::GetValue(m_buffer))); \ if ( wxAnyValueTypeImpl<TS>::IsSameClass(m_type) ) \ return (value == static_cast<TUS> \ (wxAnyValueTypeImpl<TS>::GetValue(m_buffer))); \ return false; \ } #if wxUSE_VARIANT // Note that the following functions are implemented outside wxAny class // so that it can reside entirely in header and lack the export declaration. // Helper function used to associate wxAnyValueType with a wxVariantData. extern WXDLLIMPEXP_BASE void wxPreRegisterAnyToVariant(wxAnyToVariantRegistration* reg); // This function performs main wxAny to wxVariant conversion duties. extern WXDLLIMPEXP_BASE bool wxConvertAnyToVariant(const wxAny& any, wxVariant* variant); #endif // wxUSE_VARIANT // // The wxAny class represents a container for any type. A variant's value // can be changed at run time, possibly to a different type of value. // // As standard, wxAny can store value of almost any type, in a fairly // optimal manner even. // class wxAny { public: /** Default constructor. */ wxAny() { m_type = wxAnyNullValueType; } /** Destructor. */ ~wxAny() { m_type->DeleteValue(m_buffer); } //@{ /** Various constructors. */ template<typename T> wxAny(const T& value) { m_type = wxAnyValueTypeImpl<T>::sm_instance.get(); wxAnyValueTypeImpl<T>::SetValue(value, m_buffer); } // These two constructors are needed to deal with string literals wxAny(const char* value) { m_type = wxAnyValueTypeImpl<const char*>::sm_instance.get(); wxAnyValueTypeImpl<const char*>::SetValue(value, m_buffer); } wxAny(const wchar_t* value) { m_type = wxAnyValueTypeImpl<const wchar_t*>::sm_instance.get(); wxAnyValueTypeImpl<const wchar_t*>::SetValue(value, m_buffer); } wxAny(const wxAny& any) { m_type = wxAnyNullValueType; AssignAny(any); } #if wxUSE_VARIANT wxAny(const wxVariant& variant) { m_type = wxAnyNullValueType; AssignVariant(variant); } #endif //@} /** Use this template function for checking if this wxAny holds a specific C++ data type. @see wxAnyValueType::CheckType() */ template <typename T> bool CheckType() const { return m_type->CheckType<T>(); } /** Returns the value type as wxAnyValueType instance. @remarks You cannot reliably test whether two wxAnys are of same value type by simply comparing return values of wxAny::GetType(). Instead, use wxAny::HasSameType(). @see HasSameType() */ const wxAnyValueType* GetType() const { return m_type; } /** Returns @true if this and another wxAny have the same value type. */ bool HasSameType(const wxAny& other) const { return GetType()->IsSameType(other.GetType()); } /** Tests if wxAny is null (that is, whether there is no data). */ bool IsNull() const { return (m_type == wxAnyNullValueType); } /** Makes wxAny null (that is, clears it). */ void MakeNull() { m_type->DeleteValue(m_buffer); m_type = wxAnyNullValueType; } //@{ /** Assignment operators. */ template<typename T> wxAny& operator=(const T &value) { m_type->DeleteValue(m_buffer); m_type = wxAnyValueTypeImpl<T>::sm_instance.get(); wxAnyValueTypeImpl<T>::SetValue(value, m_buffer); return *this; } wxAny& operator=(const wxAny &any) { if (this != &any) AssignAny(any); return *this; } #if wxUSE_VARIANT wxAny& operator=(const wxVariant &variant) { AssignVariant(variant); return *this; } #endif // These two operators are needed to deal with string literals wxAny& operator=(const char* value) { Assign(value); return *this; } wxAny& operator=(const wchar_t* value) { Assign(value); return *this; } //@{ /** Equality operators. */ bool operator==(const wxString& value) const { wxString value2; if ( !GetAs(&value2) ) return false; return value == value2; } bool operator==(const char* value) const { return (*this) == wxString(value); } bool operator==(const wchar_t* value) const { return (*this) == wxString(value); } // // We need to implement custom signed/unsigned int equals operators // for signed/unsigned (eg. wxAny(128UL) == 128L) comparisons to work. WXANY_IMPLEMENT_INT_EQ_OP(signed char, unsigned char) WXANY_IMPLEMENT_INT_EQ_OP(signed short, unsigned short) WXANY_IMPLEMENT_INT_EQ_OP(signed int, unsigned int) WXANY_IMPLEMENT_INT_EQ_OP(signed long, unsigned long) #ifdef wxLongLong_t WXANY_IMPLEMENT_INT_EQ_OP(wxLongLong_t, wxULongLong_t) #endif wxGCC_WARNING_SUPPRESS(float-equal) bool operator==(float value) const { if ( !wxAnyValueTypeImpl<float>::IsSameClass(m_type) ) return false; return value == static_cast<float> (wxAnyValueTypeImpl<float>::GetValue(m_buffer)); } bool operator==(double value) const { if ( !wxAnyValueTypeImpl<double>::IsSameClass(m_type) ) return false; return value == static_cast<double> (wxAnyValueTypeImpl<double>::GetValue(m_buffer)); } wxGCC_WARNING_RESTORE(float-equal) bool operator==(bool value) const { if ( !wxAnyValueTypeImpl<bool>::IsSameClass(m_type) ) return false; return value == (wxAnyValueTypeImpl<bool>::GetValue(m_buffer)); } //@} //@{ /** Inequality operators (implement as template). */ template<typename T> bool operator!=(const T& value) const { return !((*this) == value); } //@} /** This template function converts wxAny into given type. In most cases no type conversion is performed, so if the type is incorrect an assertion failure will occur. @remarks For convenience, conversion is done when T is wxString. This is useful when a string literal (which are treated as const char* and const wchar_t*) has been assigned to wxAny. */ template <typename T> T As(T* = NULL) const { return wxPrivate::wxAnyAsImpl<T>::DoAs(*this); } // Semi private helper: get the value without coercion, for all types. template <typename T> T RawAs() const { if ( !wxAnyValueTypeImpl<T>::IsSameClass(m_type) ) { wxFAIL_MSG("Incorrect or non-convertible data type"); } return static_cast<T>(wxAnyValueTypeImpl<T>::GetValue(m_buffer)); } #if wxUSE_EXTENDED_RTTI const wxTypeInfo* GetTypeInfo() const { return m_type->GetTypeInfo(); } #endif /** Template function that retrieves and converts the value of this variant to the type that T* value is. @return Returns @true if conversion was successful. */ template<typename T> bool GetAs(T* value) const { if ( !wxAnyValueTypeImpl<T>::IsSameClass(m_type) ) { wxAnyValueType* otherType = wxAnyValueTypeImpl<T>::sm_instance.get(); wxAnyValueBuffer temp_buf; if ( !m_type->ConvertValue(m_buffer, otherType, temp_buf) ) return false; *value = static_cast<T>(wxAnyValueTypeImpl<T>::GetValue(temp_buf)); otherType->DeleteValue(temp_buf); return true; } *value = static_cast<T>(wxAnyValueTypeImpl<T>::GetValue(m_buffer)); return true; } #if wxUSE_VARIANT // GetAs() wxVariant specialization bool GetAs(wxVariant* value) const { return wxConvertAnyToVariant(*this, value); } #endif private: // Assignment functions void AssignAny(const wxAny& any) { // Must delete value - CopyBuffer() never does that m_type->DeleteValue(m_buffer); wxAnyValueType* newType = any.m_type; if ( !newType->IsSameType(m_type) ) m_type = newType; newType->CopyBuffer(any.m_buffer, m_buffer); } #if wxUSE_VARIANT void AssignVariant(const wxVariant& variant) { wxVariantData* data = variant.GetData(); if ( data && data->GetAsAny(this) ) return; m_type->DeleteValue(m_buffer); if ( variant.IsNull() ) { // Init as Null m_type = wxAnyNullValueType; } else { // If everything else fails, wrap the whole wxVariantData m_type = wxAnyValueTypeImpl<wxVariantData*>::sm_instance.get(); wxAnyValueTypeImpl<wxVariantData*>::SetValue(data, m_buffer); } } #endif template<typename T> void Assign(const T &value) { m_type->DeleteValue(m_buffer); m_type = wxAnyValueTypeImpl<T>::sm_instance.get(); wxAnyValueTypeImpl<T>::SetValue(value, m_buffer); } // Data wxAnyValueBuffer m_buffer; wxAnyValueType* m_type; }; namespace wxPrivate { // Dispatcher for template wxAny::As() implementation which is different for // wxString and all the other types: the generic implementation check if the // value is of the right type and returns it. template <typename T> struct wxAnyAsImpl { static T DoAs(const wxAny& any) { return any.RawAs<T>(); } }; // Specialization for wxString does coercion. template <> struct wxAnyAsImpl<wxString> { static wxString DoAs(const wxAny& any) { wxString value; if ( !any.GetAs(&value) ) { wxFAIL_MSG("Incorrect or non-convertible data type"); } return value; } }; } // See comment for wxANY_VALUE_TYPE_CHECK_TYPE. #define wxANY_CHECK_TYPE(any, T) \ wxANY_VALUE_TYPE_CHECK_TYPE((any).GetType(), T) // This macro shouldn't be used any longer for the same reasons as // wxANY_VALUE_TYPE_CHECK_TYPE(), just call As() directly. #define wxANY_AS(any, T) \ (any).As(static_cast<T*>(NULL)) template<typename T> inline bool wxAnyValueType::CheckType() const { return wxAnyValueTypeImpl<T>::IsSameClass(this); } WX_DECLARE_LIST_WITH_DECL(wxAny, wxAnyList, class WXDLLIMPEXP_BASE); #endif // wxUSE_ANY #endif // _WX_ANY_H_
h
rticonnextdds-usecases
data/projects/rticonnextdds-usecases/VehicleTracking/ExampleCode/thirdparty/wxWidgets-3.1.2/Linux/include/wx/radiobox.h
/////////////////////////////////////////////////////////////////////////////// // Name: wx/radiobox.h // Purpose: wxRadioBox declaration // Author: Vadim Zeitlin // Modified by: // Created: 10.09.00 // Copyright: (c) Vadim Zeitlin // Licence: wxWindows licence /////////////////////////////////////////////////////////////////////////////// #ifndef _WX_RADIOBOX_H_BASE_ #define _WX_RADIOBOX_H_BASE_ #include "wx/defs.h" #if wxUSE_RADIOBOX #include "wx/ctrlsub.h" #if wxUSE_TOOLTIPS #include "wx/dynarray.h" class WXDLLIMPEXP_FWD_CORE wxToolTip; WX_DEFINE_EXPORTED_ARRAY_PTR(wxToolTip *, wxToolTipArray); #endif // wxUSE_TOOLTIPS extern WXDLLIMPEXP_DATA_CORE(const char) wxRadioBoxNameStr[]; // ---------------------------------------------------------------------------- // wxRadioBoxBase is not a normal base class, but rather a mix-in because the // real wxRadioBox derives from different classes on different platforms: for // example, it is a wxStaticBox in wxUniv and wxMSW but not in other ports // ---------------------------------------------------------------------------- class WXDLLIMPEXP_CORE wxRadioBoxBase : public wxItemContainerImmutable { public: virtual ~wxRadioBoxBase(); // change/query the individual radio button state virtual bool Enable(unsigned int n, bool enable = true) = 0; virtual bool Show(unsigned int n, bool show = true) = 0; virtual bool IsItemEnabled(unsigned int n) const = 0; virtual bool IsItemShown(unsigned int n) const = 0; // return number of columns/rows in this radiobox unsigned int GetColumnCount() const { return m_numCols; } unsigned int GetRowCount() const { return m_numRows; } // return the next active (i.e. shown and not disabled) item above/below/to // the left/right of the given one int GetNextItem(int item, wxDirection dir, long style) const; #if wxUSE_TOOLTIPS // set the tooltip text for a radio item, empty string unsets any tooltip void SetItemToolTip(unsigned int item, const wxString& text); // get the individual items tooltip; returns NULL if none wxToolTip *GetItemToolTip(unsigned int item) const { return m_itemsTooltips ? (*m_itemsTooltips)[item] : NULL; } #endif // wxUSE_TOOLTIPS #if wxUSE_HELP // set helptext for a particular item, pass an empty string to erase it void SetItemHelpText(unsigned int n, const wxString& helpText); // retrieve helptext for a particular item, empty string means no help text wxString GetItemHelpText(unsigned int n) const; #else // wxUSE_HELP // just silently ignore the help text, it's better than requiring using // conditional compilation in all code using this function void SetItemHelpText(unsigned int WXUNUSED(n), const wxString& WXUNUSED(helpText)) { } #endif // wxUSE_HELP // returns the radio item at the given position or wxNOT_FOUND if none // (currently implemented only under MSW and GTK) virtual int GetItemFromPoint(const wxPoint& WXUNUSED(pt)) const { return wxNOT_FOUND; } protected: wxRadioBoxBase() { m_numCols = m_numRows = m_majorDim = 0; #if wxUSE_TOOLTIPS m_itemsTooltips = NULL; #endif // wxUSE_TOOLTIPS } virtual wxBorder GetDefaultBorder() const { return wxBORDER_NONE; } // return the number of items in major direction (which depends on whether // we have wxRA_SPECIFY_COLS or wxRA_SPECIFY_ROWS style) unsigned int GetMajorDim() const { return m_majorDim; } // sets m_majorDim and also updates m_numCols/Rows // // the style parameter should be the style of the radiobox itself void SetMajorDim(unsigned int majorDim, long style); #if wxUSE_TOOLTIPS // called from SetItemToolTip() to really set the tooltip for the specified // item in the box (or, if tooltip is NULL, to remove any existing one). // // NB: this function should really be pure virtual but to avoid breaking // the build of the ports for which it's not implemented yet we provide // an empty stub in the base class for now virtual void DoSetItemToolTip(unsigned int item, wxToolTip *tooltip); // returns true if we have any item tooltips bool HasItemToolTips() const { return m_itemsTooltips != NULL; } #endif // wxUSE_TOOLTIPS #if wxUSE_HELP // Retrieve help text for an item: this is a helper for the implementation // of wxWindow::GetHelpTextAtPoint() in the real radiobox class wxString DoGetHelpTextAtPoint(const wxWindow *derived, const wxPoint& pt, wxHelpEvent::Origin origin) const; #endif // wxUSE_HELP private: // the number of elements in major dimension (i.e. number of columns if // wxRA_SPECIFY_COLS or the number of rows if wxRA_SPECIFY_ROWS) and also // the number of rows/columns calculated from it unsigned int m_majorDim, m_numCols, m_numRows; #if wxUSE_TOOLTIPS // array of tooltips for the individual items // // this array is initially NULL and initialized on first use wxToolTipArray *m_itemsTooltips; #endif #if wxUSE_HELP // help text associated with a particular item or empty string if none wxArrayString m_itemsHelpTexts; #endif // wxUSE_HELP }; #if defined(__WXUNIVERSAL__) #include "wx/univ/radiobox.h" #elif defined(__WXMSW__) #include "wx/msw/radiobox.h" #elif defined(__WXMOTIF__) #include "wx/motif/radiobox.h" #elif defined(__WXGTK20__) #include "wx/gtk/radiobox.h" #elif defined(__WXGTK__) #include "wx/gtk1/radiobox.h" #elif defined(__WXMAC__) #include "wx/osx/radiobox.h" #elif defined(__WXQT__) #include "wx/qt/radiobox.h" #endif #endif // wxUSE_RADIOBOX #endif // _WX_RADIOBOX_H_BASE_
h
rticonnextdds-usecases
data/projects/rticonnextdds-usecases/VehicleTracking/ExampleCode/thirdparty/wxWidgets-3.1.2/Linux/include/wx/regex.h
/////////////////////////////////////////////////////////////////////////////// // Name: wx/regex.h // Purpose: regular expression matching // Author: Karsten Ballueder // Modified by: VZ at 13.07.01 (integrated to wxWin) // Created: 05.02.2000 // Copyright: (c) 2000 Karsten Ballueder <[email protected]> // Licence: wxWindows licence /////////////////////////////////////////////////////////////////////////////// #ifndef _WX_REGEX_H_ #define _WX_REGEX_H_ #include "wx/defs.h" #if wxUSE_REGEX #include "wx/string.h" // ---------------------------------------------------------------------------- // constants // ---------------------------------------------------------------------------- // flags for regex compilation: these can be used with Compile() enum { // use extended regex syntax wxRE_EXTENDED = 0, // use advanced RE syntax (built-in regex only) #ifdef wxHAS_REGEX_ADVANCED wxRE_ADVANCED = 1, #endif // use basic RE syntax wxRE_BASIC = 2, // ignore case in match wxRE_ICASE = 4, // only check match, don't set back references wxRE_NOSUB = 8, // if not set, treat '\n' as an ordinary character, otherwise it is // special: it is not matched by '.' and '^' and '$' always match // after/before it regardless of the setting of wxRE_NOT[BE]OL wxRE_NEWLINE = 16, // default flags wxRE_DEFAULT = wxRE_EXTENDED }; // flags for regex matching: these can be used with Matches() // // these flags are mainly useful when doing several matches in a long string, // they can be used to prevent erroneous matches for '^' and '$' enum { // '^' doesn't match at the start of line wxRE_NOTBOL = 32, // '$' doesn't match at the end of line wxRE_NOTEOL = 64 }; // ---------------------------------------------------------------------------- // wxRegEx: a regular expression // ---------------------------------------------------------------------------- class WXDLLIMPEXP_FWD_BASE wxRegExImpl; class WXDLLIMPEXP_BASE wxRegEx { public: // default ctor: use Compile() later wxRegEx() { Init(); } // create and compile wxRegEx(const wxString& expr, int flags = wxRE_DEFAULT) { Init(); (void)Compile(expr, flags); } // return true if this is a valid compiled regular expression bool IsValid() const { return m_impl != NULL; } // compile the string into regular expression, return true if ok or false // if string has a syntax error bool Compile(const wxString& pattern, int flags = wxRE_DEFAULT); // matches the precompiled regular expression against a string, return // true if matches and false otherwise // // flags may be combination of wxRE_NOTBOL and wxRE_NOTEOL // len may be the length of text (ignored by most system regex libs) // // may only be called after successful call to Compile() bool Matches(const wxString& text, int flags = 0) const; bool Matches(const wxChar *text, int flags, size_t len) const { return Matches(wxString(text, len), flags); } // get the start index and the length of the match of the expression // (index 0) or a bracketed subexpression (index != 0) // // may only be called after successful call to Matches() // // return false if no match or on error bool GetMatch(size_t *start, size_t *len, size_t index = 0) const; // return the part of string corresponding to the match, empty string is // returned if match failed // // may only be called after successful call to Matches() wxString GetMatch(const wxString& text, size_t index = 0) const; // return the size of the array of matches, i.e. the number of bracketed // subexpressions plus one for the expression itself, or 0 on error. // // may only be called after successful call to Compile() size_t GetMatchCount() const; // replaces the current regular expression in the string pointed to by // pattern, with the text in replacement and return number of matches // replaced (maybe 0 if none found) or -1 on error // // the replacement text may contain backreferences (\number) which will be // replaced with the value of the corresponding subexpression in the // pattern match // // maxMatches may be used to limit the number of replacements made, setting // it to 1, for example, will only replace first occurrence (if any) of the // pattern in the text while default value of 0 means replace all int Replace(wxString *text, const wxString& replacement, size_t maxMatches = 0) const; // replace the first occurrence int ReplaceFirst(wxString *text, const wxString& replacement) const { return Replace(text, replacement, 1); } // replace all occurrences: this is actually a synonym for Replace() int ReplaceAll(wxString *text, const wxString& replacement) const { return Replace(text, replacement, 0); } // dtor not virtual, don't derive from this class ~wxRegEx(); private: // common part of all ctors void Init(); // the real guts of this class wxRegExImpl *m_impl; // as long as the class wxRegExImpl is not ref-counted, // instances of the handle wxRegEx must not be copied. wxRegEx(const wxRegEx&); wxRegEx &operator=(const wxRegEx&); }; #endif // wxUSE_REGEX #endif // _WX_REGEX_H_
h
rticonnextdds-usecases
data/projects/rticonnextdds-usecases/VehicleTracking/ExampleCode/thirdparty/wxWidgets-3.1.2/Linux/include/wx/gdicmn.h
///////////////////////////////////////////////////////////////////////////// // Name: wx/gdicmn.h // Purpose: Common GDI classes, types and declarations // Author: Julian Smart // Modified by: // Created: 01/02/97 // Copyright: (c) Julian Smart // Licence: wxWindows licence ///////////////////////////////////////////////////////////////////////////// #ifndef _WX_GDICMNH__ #define _WX_GDICMNH__ // --------------------------------------------------------------------------- // headers // --------------------------------------------------------------------------- #include "wx/defs.h" #include "wx/list.h" #include "wx/string.h" #include "wx/fontenc.h" #include "wx/hashmap.h" #include "wx/math.h" // --------------------------------------------------------------------------- // forward declarations // --------------------------------------------------------------------------- class WXDLLIMPEXP_FWD_CORE wxBitmap; class WXDLLIMPEXP_FWD_CORE wxBrush; class WXDLLIMPEXP_FWD_CORE wxColour; class WXDLLIMPEXP_FWD_CORE wxCursor; class WXDLLIMPEXP_FWD_CORE wxFont; class WXDLLIMPEXP_FWD_CORE wxIcon; class WXDLLIMPEXP_FWD_CORE wxPalette; class WXDLLIMPEXP_FWD_CORE wxPen; class WXDLLIMPEXP_FWD_CORE wxRegion; class WXDLLIMPEXP_FWD_BASE wxString; class WXDLLIMPEXP_FWD_CORE wxIconBundle; class WXDLLIMPEXP_FWD_CORE wxPoint; // --------------------------------------------------------------------------- // constants // --------------------------------------------------------------------------- // Bitmap flags enum wxBitmapType { wxBITMAP_TYPE_INVALID, // should be == 0 for compatibility! wxBITMAP_TYPE_BMP, wxBITMAP_TYPE_BMP_RESOURCE, wxBITMAP_TYPE_RESOURCE = wxBITMAP_TYPE_BMP_RESOURCE, wxBITMAP_TYPE_ICO, wxBITMAP_TYPE_ICO_RESOURCE, wxBITMAP_TYPE_CUR, wxBITMAP_TYPE_CUR_RESOURCE, wxBITMAP_TYPE_XBM, wxBITMAP_TYPE_XBM_DATA, wxBITMAP_TYPE_XPM, wxBITMAP_TYPE_XPM_DATA, wxBITMAP_TYPE_TIFF, wxBITMAP_TYPE_TIF = wxBITMAP_TYPE_TIFF, wxBITMAP_TYPE_TIFF_RESOURCE, wxBITMAP_TYPE_TIF_RESOURCE = wxBITMAP_TYPE_TIFF_RESOURCE, wxBITMAP_TYPE_GIF, wxBITMAP_TYPE_GIF_RESOURCE, wxBITMAP_TYPE_PNG, wxBITMAP_TYPE_PNG_RESOURCE, wxBITMAP_TYPE_JPEG, wxBITMAP_TYPE_JPEG_RESOURCE, wxBITMAP_TYPE_PNM, wxBITMAP_TYPE_PNM_RESOURCE, wxBITMAP_TYPE_PCX, wxBITMAP_TYPE_PCX_RESOURCE, wxBITMAP_TYPE_PICT, wxBITMAP_TYPE_PICT_RESOURCE, wxBITMAP_TYPE_ICON, wxBITMAP_TYPE_ICON_RESOURCE, wxBITMAP_TYPE_ANI, wxBITMAP_TYPE_IFF, wxBITMAP_TYPE_TGA, wxBITMAP_TYPE_MACCURSOR, wxBITMAP_TYPE_MACCURSOR_RESOURCE, wxBITMAP_TYPE_MAX, wxBITMAP_TYPE_ANY = 50 }; // Polygon filling mode enum wxPolygonFillMode { wxODDEVEN_RULE = 1, wxWINDING_RULE }; // Standard cursors enum wxStockCursor { wxCURSOR_NONE, // should be 0 wxCURSOR_ARROW, wxCURSOR_RIGHT_ARROW, wxCURSOR_BULLSEYE, wxCURSOR_CHAR, wxCURSOR_CROSS, wxCURSOR_HAND, wxCURSOR_IBEAM, wxCURSOR_LEFT_BUTTON, wxCURSOR_MAGNIFIER, wxCURSOR_MIDDLE_BUTTON, wxCURSOR_NO_ENTRY, wxCURSOR_PAINT_BRUSH, wxCURSOR_PENCIL, wxCURSOR_POINT_LEFT, wxCURSOR_POINT_RIGHT, wxCURSOR_QUESTION_ARROW, wxCURSOR_RIGHT_BUTTON, wxCURSOR_SIZENESW, wxCURSOR_SIZENS, wxCURSOR_SIZENWSE, wxCURSOR_SIZEWE, wxCURSOR_SIZING, wxCURSOR_SPRAYCAN, wxCURSOR_WAIT, wxCURSOR_WATCH, wxCURSOR_BLANK, #ifdef __WXGTK__ wxCURSOR_DEFAULT, // standard X11 cursor #endif #ifdef __WXMAC__ wxCURSOR_COPY_ARROW , // MacOS Theme Plus arrow #endif #ifdef __X__ // Not yet implemented for Windows wxCURSOR_CROSS_REVERSE, wxCURSOR_DOUBLE_ARROW, wxCURSOR_BASED_ARROW_UP, wxCURSOR_BASED_ARROW_DOWN, #endif // X11 wxCURSOR_ARROWWAIT, #ifdef __WXMAC__ wxCURSOR_OPEN_HAND, wxCURSOR_CLOSED_HAND, #endif wxCURSOR_MAX }; #ifndef __WXGTK__ #define wxCURSOR_DEFAULT wxCURSOR_ARROW #endif #ifndef __WXMAC__ // TODO CS supply openhand and closedhand cursors #define wxCURSOR_OPEN_HAND wxCURSOR_HAND #define wxCURSOR_CLOSED_HAND wxCURSOR_HAND #endif // ---------------------------------------------------------------------------- // Ellipsize() constants // ---------------------------------------------------------------------------- enum wxEllipsizeFlags { wxELLIPSIZE_FLAGS_NONE = 0, wxELLIPSIZE_FLAGS_PROCESS_MNEMONICS = 1, wxELLIPSIZE_FLAGS_EXPAND_TABS = 2, wxELLIPSIZE_FLAGS_DEFAULT = wxELLIPSIZE_FLAGS_PROCESS_MNEMONICS | wxELLIPSIZE_FLAGS_EXPAND_TABS }; // NB: Don't change the order of these values, they're the same as in // PangoEllipsizeMode enum. enum wxEllipsizeMode { wxELLIPSIZE_NONE, wxELLIPSIZE_START, wxELLIPSIZE_MIDDLE, wxELLIPSIZE_END }; // --------------------------------------------------------------------------- // macros // --------------------------------------------------------------------------- #if defined(__WINDOWS__) && wxUSE_WXDIB #define wxHAS_IMAGES_IN_RESOURCES #endif /* Useful macro for creating icons portably, for example: wxIcon *icon = new wxICON(sample); expands into: wxIcon *icon = new wxIcon("sample"); // On Windows wxIcon *icon = new wxIcon(sample_xpm); // On wxGTK/Linux */ #ifdef wxHAS_IMAGES_IN_RESOURCES // Load from a resource #define wxICON(X) wxIcon(wxT(#X)) #elif defined(__WXDFB__) // Initialize from an included XPM #define wxICON(X) wxIcon( X##_xpm ) #elif defined(__WXGTK__) // Initialize from an included XPM #define wxICON(X) wxIcon( X##_xpm ) #elif defined(__WXMAC__) // Initialize from an included XPM #define wxICON(X) wxIcon( X##_xpm ) #elif defined(__WXMOTIF__) // Initialize from an included XPM #define wxICON(X) wxIcon( X##_xpm ) #elif defined(__WXX11__) // Initialize from an included XPM #define wxICON(X) wxIcon( X##_xpm ) #elif defined(__WXQT__) // Initialize from an included XPM #define wxICON(X) wxIcon( X##_xpm ) #else // This will usually mean something on any platform #define wxICON(X) wxIcon(wxT(#X)) #endif // platform /* Another macro: this one is for portable creation of bitmaps. We assume that under Unix bitmaps live in XPMs and under Windows they're in ressources. */ #if defined(__WINDOWS__) && wxUSE_WXDIB #define wxBITMAP(name) wxBitmap(wxT(#name), wxBITMAP_TYPE_BMP_RESOURCE) #elif defined(__WXGTK__) || \ defined(__WXMOTIF__) || \ defined(__WXX11__) || \ defined(__WXMAC__) || \ defined(__WXDFB__) // Initialize from an included XPM #define wxBITMAP(name) wxBitmap(name##_xpm) #else // other platforms #define wxBITMAP(name) wxBitmap(name##_xpm, wxBITMAP_TYPE_XPM) #endif // platform // Macro for creating wxBitmap from in-memory PNG data. // // It reads PNG data from name_png static byte arrays that can be created using // e.g. misc/scripts/png2c.py. // // This macro exists mostly as a helper for wxBITMAP_PNG() below but also // because it's slightly more convenient to use than NewFromPNGData() directly. #define wxBITMAP_PNG_FROM_DATA(name) \ wxBitmap::NewFromPNGData(name##_png, WXSIZEOF(name##_png)) // Similar to wxBITMAP but used for the bitmaps in PNG format. // // Under Windows they should be embedded into the resource file using RT_RCDATA // resource type and under OS X the PNG file with the specified name must be // available in the resource subdirectory of the bundle. Elsewhere, this is // exactly the same thing as wxBITMAP_PNG_FROM_DATA() described above. #if (defined(__WINDOWS__) && wxUSE_WXDIB) || defined(__WXOSX__) #define wxBITMAP_PNG(name) wxBitmap(wxS(#name), wxBITMAP_TYPE_PNG_RESOURCE) #else #define wxBITMAP_PNG(name) wxBITMAP_PNG_FROM_DATA(name) #endif // =========================================================================== // classes // =========================================================================== // --------------------------------------------------------------------------- // wxSize // --------------------------------------------------------------------------- class WXDLLIMPEXP_CORE wxSize { public: // members are public for compatibility, don't use them directly. int x, y; // constructors wxSize() : x(0), y(0) { } wxSize(int xx, int yy) : x(xx), y(yy) { } // no copy ctor or assignment operator - the defaults are ok wxSize& operator+=(const wxSize& sz) { x += sz.x; y += sz.y; return *this; } wxSize& operator-=(const wxSize& sz) { x -= sz.x; y -= sz.y; return *this; } wxSize& operator/=(int i) { x /= i; y /= i; return *this; } wxSize& operator*=(int i) { x *= i; y *= i; return *this; } wxSize& operator/=(unsigned int i) { x /= i; y /= i; return *this; } wxSize& operator*=(unsigned int i) { x *= i; y *= i; return *this; } wxSize& operator/=(long i) { x /= i; y /= i; return *this; } wxSize& operator*=(long i) { x *= i; y *= i; return *this; } wxSize& operator/=(unsigned long i) { x /= i; y /= i; return *this; } wxSize& operator*=(unsigned long i) { x *= i; y *= i; return *this; } wxSize& operator/=(double i) { x = wxRound(x/i); y = wxRound(y/i); return *this; } wxSize& operator*=(double i) { x = wxRound(x*i); y = wxRound(y*i); return *this; } void IncTo(const wxSize& sz) { if ( sz.x > x ) x = sz.x; if ( sz.y > y ) y = sz.y; } void DecTo(const wxSize& sz) { if ( sz.x < x ) x = sz.x; if ( sz.y < y ) y = sz.y; } void DecToIfSpecified(const wxSize& sz) { if ( sz.x != wxDefaultCoord && sz.x < x ) x = sz.x; if ( sz.y != wxDefaultCoord && sz.y < y ) y = sz.y; } void IncBy(int dx, int dy) { x += dx; y += dy; } void IncBy(const wxPoint& pt); void IncBy(const wxSize& sz) { IncBy(sz.x, sz.y); } void IncBy(int d) { IncBy(d, d); } void DecBy(int dx, int dy) { IncBy(-dx, -dy); } void DecBy(const wxPoint& pt); void DecBy(const wxSize& sz) { DecBy(sz.x, sz.y); } void DecBy(int d) { DecBy(d, d); } wxSize& Scale(double xscale, double yscale) { x = wxRound(x*xscale); y = wxRound(y*yscale); return *this; } // accessors void Set(int xx, int yy) { x = xx; y = yy; } void SetWidth(int w) { x = w; } void SetHeight(int h) { y = h; } int GetWidth() const { return x; } int GetHeight() const { return y; } bool IsFullySpecified() const { return x != wxDefaultCoord && y != wxDefaultCoord; } // combine this size with the other one replacing the default (i.e. equal // to wxDefaultCoord) components of this object with those of the other void SetDefaults(const wxSize& size) { if ( x == wxDefaultCoord ) x = size.x; if ( y == wxDefaultCoord ) y = size.y; } // compatibility int GetX() const { return x; } int GetY() const { return y; } }; inline bool operator==(const wxSize& s1, const wxSize& s2) { return s1.x == s2.x && s1.y == s2.y; } inline bool operator!=(const wxSize& s1, const wxSize& s2) { return s1.x != s2.x || s1.y != s2.y; } inline wxSize operator+(const wxSize& s1, const wxSize& s2) { return wxSize(s1.x + s2.x, s1.y + s2.y); } inline wxSize operator-(const wxSize& s1, const wxSize& s2) { return wxSize(s1.x - s2.x, s1.y - s2.y); } inline wxSize operator/(const wxSize& s, int i) { return wxSize(s.x / i, s.y / i); } inline wxSize operator*(const wxSize& s, int i) { return wxSize(s.x * i, s.y * i); } inline wxSize operator*(int i, const wxSize& s) { return wxSize(s.x * i, s.y * i); } inline wxSize operator/(const wxSize& s, unsigned int i) { return wxSize(s.x / i, s.y / i); } inline wxSize operator*(const wxSize& s, unsigned int i) { return wxSize(s.x * i, s.y * i); } inline wxSize operator*(unsigned int i, const wxSize& s) { return wxSize(s.x * i, s.y * i); } inline wxSize operator/(const wxSize& s, long i) { return wxSize(s.x / i, s.y / i); } inline wxSize operator*(const wxSize& s, long i) { return wxSize(int(s.x * i), int(s.y * i)); } inline wxSize operator*(long i, const wxSize& s) { return wxSize(int(s.x * i), int(s.y * i)); } inline wxSize operator/(const wxSize& s, unsigned long i) { return wxSize(int(s.x / i), int(s.y / i)); } inline wxSize operator*(const wxSize& s, unsigned long i) { return wxSize(int(s.x * i), int(s.y * i)); } inline wxSize operator*(unsigned long i, const wxSize& s) { return wxSize(int(s.x * i), int(s.y * i)); } inline wxSize operator*(const wxSize& s, double i) { return wxSize(wxRound(s.x * i), wxRound(s.y * i)); } inline wxSize operator*(double i, const wxSize& s) { return wxSize(wxRound(s.x * i), wxRound(s.y * i)); } // --------------------------------------------------------------------------- // Point classes: with real or integer coordinates // --------------------------------------------------------------------------- class WXDLLIMPEXP_CORE wxRealPoint { public: double x; double y; wxRealPoint() : x(0.0), y(0.0) { } wxRealPoint(double xx, double yy) : x(xx), y(yy) { } wxRealPoint(const wxPoint& pt); // no copy ctor or assignment operator - the defaults are ok //assignment operators wxRealPoint& operator+=(const wxRealPoint& p) { x += p.x; y += p.y; return *this; } wxRealPoint& operator-=(const wxRealPoint& p) { x -= p.x; y -= p.y; return *this; } wxRealPoint& operator+=(const wxSize& s) { x += s.GetWidth(); y += s.GetHeight(); return *this; } wxRealPoint& operator-=(const wxSize& s) { x -= s.GetWidth(); y -= s.GetHeight(); return *this; } }; inline bool operator==(const wxRealPoint& p1, const wxRealPoint& p2) { return wxIsSameDouble(p1.x, p2.x) && wxIsSameDouble(p1.y, p2.y); } inline bool operator!=(const wxRealPoint& p1, const wxRealPoint& p2) { return !(p1 == p2); } inline wxRealPoint operator+(const wxRealPoint& p1, const wxRealPoint& p2) { return wxRealPoint(p1.x + p2.x, p1.y + p2.y); } inline wxRealPoint operator-(const wxRealPoint& p1, const wxRealPoint& p2) { return wxRealPoint(p1.x - p2.x, p1.y - p2.y); } inline wxRealPoint operator/(const wxRealPoint& s, int i) { return wxRealPoint(s.x / i, s.y / i); } inline wxRealPoint operator*(const wxRealPoint& s, int i) { return wxRealPoint(s.x * i, s.y * i); } inline wxRealPoint operator*(int i, const wxRealPoint& s) { return wxRealPoint(s.x * i, s.y * i); } inline wxRealPoint operator/(const wxRealPoint& s, unsigned int i) { return wxRealPoint(s.x / i, s.y / i); } inline wxRealPoint operator*(const wxRealPoint& s, unsigned int i) { return wxRealPoint(s.x * i, s.y * i); } inline wxRealPoint operator*(unsigned int i, const wxRealPoint& s) { return wxRealPoint(s.x * i, s.y * i); } inline wxRealPoint operator/(const wxRealPoint& s, long i) { return wxRealPoint(s.x / i, s.y / i); } inline wxRealPoint operator*(const wxRealPoint& s, long i) { return wxRealPoint(s.x * i, s.y * i); } inline wxRealPoint operator*(long i, const wxRealPoint& s) { return wxRealPoint(s.x * i, s.y * i); } inline wxRealPoint operator/(const wxRealPoint& s, unsigned long i) { return wxRealPoint(s.x / i, s.y / i); } inline wxRealPoint operator*(const wxRealPoint& s, unsigned long i) { return wxRealPoint(s.x * i, s.y * i); } inline wxRealPoint operator*(unsigned long i, const wxRealPoint& s) { return wxRealPoint(s.x * i, s.y * i); } inline wxRealPoint operator*(const wxRealPoint& s, double i) { return wxRealPoint(s.x * i, s.y * i); } inline wxRealPoint operator*(double i, const wxRealPoint& s) { return wxRealPoint(s.x * i, s.y * i); } // ---------------------------------------------------------------------------- // wxPoint: 2D point with integer coordinates // ---------------------------------------------------------------------------- class WXDLLIMPEXP_CORE wxPoint { public: int x, y; wxPoint() : x(0), y(0) { } wxPoint(int xx, int yy) : x(xx), y(yy) { } wxPoint(const wxRealPoint& pt) : x(wxRound(pt.x)), y(wxRound(pt.y)) { } // no copy ctor or assignment operator - the defaults are ok //assignment operators wxPoint& operator+=(const wxPoint& p) { x += p.x; y += p.y; return *this; } wxPoint& operator-=(const wxPoint& p) { x -= p.x; y -= p.y; return *this; } wxPoint& operator+=(const wxSize& s) { x += s.GetWidth(); y += s.GetHeight(); return *this; } wxPoint& operator-=(const wxSize& s) { x -= s.GetWidth(); y -= s.GetHeight(); return *this; } // check if both components are set/initialized bool IsFullySpecified() const { return x != wxDefaultCoord && y != wxDefaultCoord; } // fill in the unset components with the values from the other point void SetDefaults(const wxPoint& pt) { if ( x == wxDefaultCoord ) x = pt.x; if ( y == wxDefaultCoord ) y = pt.y; } }; // comparison inline bool operator==(const wxPoint& p1, const wxPoint& p2) { return p1.x == p2.x && p1.y == p2.y; } inline bool operator!=(const wxPoint& p1, const wxPoint& p2) { return !(p1 == p2); } // arithmetic operations (component wise) inline wxPoint operator+(const wxPoint& p1, const wxPoint& p2) { return wxPoint(p1.x + p2.x, p1.y + p2.y); } inline wxPoint operator-(const wxPoint& p1, const wxPoint& p2) { return wxPoint(p1.x - p2.x, p1.y - p2.y); } inline wxPoint operator+(const wxPoint& p, const wxSize& s) { return wxPoint(p.x + s.x, p.y + s.y); } inline wxPoint operator-(const wxPoint& p, const wxSize& s) { return wxPoint(p.x - s.x, p.y - s.y); } inline wxPoint operator+(const wxSize& s, const wxPoint& p) { return wxPoint(p.x + s.x, p.y + s.y); } inline wxPoint operator-(const wxSize& s, const wxPoint& p) { return wxPoint(s.x - p.x, s.y - p.y); } inline wxPoint operator-(const wxPoint& p) { return wxPoint(-p.x, -p.y); } inline wxPoint operator/(const wxPoint& s, int i) { return wxPoint(s.x / i, s.y / i); } inline wxPoint operator*(const wxPoint& s, int i) { return wxPoint(s.x * i, s.y * i); } inline wxPoint operator*(int i, const wxPoint& s) { return wxPoint(s.x * i, s.y * i); } inline wxPoint operator/(const wxPoint& s, unsigned int i) { return wxPoint(s.x / i, s.y / i); } inline wxPoint operator*(const wxPoint& s, unsigned int i) { return wxPoint(s.x * i, s.y * i); } inline wxPoint operator*(unsigned int i, const wxPoint& s) { return wxPoint(s.x * i, s.y * i); } inline wxPoint operator/(const wxPoint& s, long i) { return wxPoint(s.x / i, s.y / i); } inline wxPoint operator*(const wxPoint& s, long i) { return wxPoint(int(s.x * i), int(s.y * i)); } inline wxPoint operator*(long i, const wxPoint& s) { return wxPoint(int(s.x * i), int(s.y * i)); } inline wxPoint operator/(const wxPoint& s, unsigned long i) { return wxPoint(s.x / i, s.y / i); } inline wxPoint operator*(const wxPoint& s, unsigned long i) { return wxPoint(int(s.x * i), int(s.y * i)); } inline wxPoint operator*(unsigned long i, const wxPoint& s) { return wxPoint(int(s.x * i), int(s.y * i)); } inline wxPoint operator*(const wxPoint& s, double i) { return wxPoint(int(s.x * i), int(s.y * i)); } inline wxPoint operator*(double i, const wxPoint& s) { return wxPoint(int(s.x * i), int(s.y * i)); } WX_DECLARE_LIST_WITH_DECL(wxPoint, wxPointList, class WXDLLIMPEXP_CORE); // --------------------------------------------------------------------------- // wxRect // --------------------------------------------------------------------------- class WXDLLIMPEXP_CORE wxRect { public: wxRect() : x(0), y(0), width(0), height(0) { } wxRect(int xx, int yy, int ww, int hh) : x(xx), y(yy), width(ww), height(hh) { } wxRect(const wxPoint& topLeft, const wxPoint& bottomRight); wxRect(const wxPoint& pt, const wxSize& size) : x(pt.x), y(pt.y), width(size.x), height(size.y) { } wxRect(const wxSize& size) : x(0), y(0), width(size.x), height(size.y) { } // default copy ctor and assignment operators ok int GetX() const { return x; } void SetX(int xx) { x = xx; } int GetY() const { return y; } void SetY(int yy) { y = yy; } int GetWidth() const { return width; } void SetWidth(int w) { width = w; } int GetHeight() const { return height; } void SetHeight(int h) { height = h; } wxPoint GetPosition() const { return wxPoint(x, y); } void SetPosition( const wxPoint &p ) { x = p.x; y = p.y; } wxSize GetSize() const { return wxSize(width, height); } void SetSize( const wxSize &s ) { width = s.GetWidth(); height = s.GetHeight(); } bool IsEmpty() const { return (width <= 0) || (height <= 0); } int GetLeft() const { return x; } int GetTop() const { return y; } int GetBottom() const { return y + height - 1; } int GetRight() const { return x + width - 1; } void SetLeft(int left) { x = left; } void SetRight(int right) { width = right - x + 1; } void SetTop(int top) { y = top; } void SetBottom(int bottom) { height = bottom - y + 1; } wxPoint GetTopLeft() const { return GetPosition(); } wxPoint GetLeftTop() const { return GetTopLeft(); } void SetTopLeft(const wxPoint &p) { SetPosition(p); } void SetLeftTop(const wxPoint &p) { SetTopLeft(p); } wxPoint GetBottomRight() const { return wxPoint(GetRight(), GetBottom()); } wxPoint GetRightBottom() const { return GetBottomRight(); } void SetBottomRight(const wxPoint &p) { SetRight(p.x); SetBottom(p.y); } void SetRightBottom(const wxPoint &p) { SetBottomRight(p); } wxPoint GetTopRight() const { return wxPoint(GetRight(), GetTop()); } wxPoint GetRightTop() const { return GetTopRight(); } void SetTopRight(const wxPoint &p) { SetRight(p.x); SetTop(p.y); } void SetRightTop(const wxPoint &p) { SetTopRight(p); } wxPoint GetBottomLeft() const { return wxPoint(GetLeft(), GetBottom()); } wxPoint GetLeftBottom() const { return GetBottomLeft(); } void SetBottomLeft(const wxPoint &p) { SetLeft(p.x); SetBottom(p.y); } void SetLeftBottom(const wxPoint &p) { SetBottomLeft(p); } // operations with rect wxRect& Inflate(wxCoord dx, wxCoord dy); wxRect& Inflate(const wxSize& d) { return Inflate(d.x, d.y); } wxRect& Inflate(wxCoord d) { return Inflate(d, d); } wxRect Inflate(wxCoord dx, wxCoord dy) const { wxRect r = *this; r.Inflate(dx, dy); return r; } wxRect& Deflate(wxCoord dx, wxCoord dy) { return Inflate(-dx, -dy); } wxRect& Deflate(const wxSize& d) { return Inflate(-d.x, -d.y); } wxRect& Deflate(wxCoord d) { return Inflate(-d); } wxRect Deflate(wxCoord dx, wxCoord dy) const { wxRect r = *this; r.Deflate(dx, dy); return r; } void Offset(wxCoord dx, wxCoord dy) { x += dx; y += dy; } void Offset(const wxPoint& pt) { Offset(pt.x, pt.y); } wxRect& Intersect(const wxRect& rect); wxRect Intersect(const wxRect& rect) const { wxRect r = *this; r.Intersect(rect); return r; } wxRect& Union(const wxRect& rect); wxRect Union(const wxRect& rect) const { wxRect r = *this; r.Union(rect); return r; } // return true if the point is (not strcitly) inside the rect bool Contains(int x, int y) const; bool Contains(const wxPoint& pt) const { return Contains(pt.x, pt.y); } // return true if the rectangle 'rect' is (not strictly) inside this rect bool Contains(const wxRect& rect) const; // return true if the rectangles have a non empty intersection bool Intersects(const wxRect& rect) const; // like Union() but don't ignore empty rectangles wxRect& operator+=(const wxRect& rect); // intersections of two rectrangles not testing for empty rectangles wxRect& operator*=(const wxRect& rect); // centre this rectangle in the given (usually, but not necessarily, // larger) one wxRect CentreIn(const wxRect& r, int dir = wxBOTH) const { return wxRect(dir & wxHORIZONTAL ? r.x + (r.width - width)/2 : x, dir & wxVERTICAL ? r.y + (r.height - height)/2 : y, width, height); } wxRect CenterIn(const wxRect& r, int dir = wxBOTH) const { return CentreIn(r, dir); } public: int x, y, width, height; }; // compare rectangles inline bool operator==(const wxRect& r1, const wxRect& r2) { return (r1.x == r2.x) && (r1.y == r2.y) && (r1.width == r2.width) && (r1.height == r2.height); } inline bool operator!=(const wxRect& r1, const wxRect& r2) { return !(r1 == r2); } // like Union() but don't treat empty rectangles specially WXDLLIMPEXP_CORE wxRect operator+(const wxRect& r1, const wxRect& r2); // intersections of two rectangles WXDLLIMPEXP_CORE wxRect operator*(const wxRect& r1, const wxRect& r2); // define functions which couldn't be defined above because of declarations // order inline void wxSize::IncBy(const wxPoint& pt) { IncBy(pt.x, pt.y); } inline void wxSize::DecBy(const wxPoint& pt) { DecBy(pt.x, pt.y); } // --------------------------------------------------------------------------- // Management of pens, brushes and fonts // --------------------------------------------------------------------------- typedef wxInt8 wxDash; class WXDLLIMPEXP_CORE wxGDIObjListBase { public: wxGDIObjListBase(); ~wxGDIObjListBase(); protected: wxList list; }; WX_DECLARE_STRING_HASH_MAP(wxColour*, wxStringToColourHashMap); class WXDLLIMPEXP_CORE wxColourDatabase { public: wxColourDatabase(); ~wxColourDatabase(); // find colour by name or name for the given colour wxColour Find(const wxString& name) const; wxString FindName(const wxColour& colour) const; // add a new colour to the database void AddColour(const wxString& name, const wxColour& colour); private: // load the database with the built in colour values when called for the // first time, do nothing after this void Initialize(); wxStringToColourHashMap *m_map; }; class WXDLLIMPEXP_CORE wxResourceCache: public wxList { public: wxResourceCache() { } #if !wxUSE_STD_CONTAINERS wxResourceCache(unsigned int keyType) : wxList(keyType) { } #endif virtual ~wxResourceCache(); }; // --------------------------------------------------------------------------- // global variables // --------------------------------------------------------------------------- /* Stock objects wxStockGDI creates the stock GDI objects on demand. Pointers to the created objects are stored in the ms_stockObject array, which is indexed by the Item enum values. Platorm-specific fonts can be created by implementing a derived class with an override for the GetFont function. wxStockGDI operates as a singleton, accessed through the ms_instance pointer. By default this pointer is set to an instance of wxStockGDI. A derived class must arrange to set this pointer to an instance of itself. */ class WXDLLIMPEXP_CORE wxStockGDI { public: enum Item { BRUSH_BLACK, BRUSH_BLUE, BRUSH_CYAN, BRUSH_GREEN, BRUSH_YELLOW, BRUSH_GREY, BRUSH_LIGHTGREY, BRUSH_MEDIUMGREY, BRUSH_RED, BRUSH_TRANSPARENT, BRUSH_WHITE, COLOUR_BLACK, COLOUR_BLUE, COLOUR_CYAN, COLOUR_GREEN, COLOUR_YELLOW, COLOUR_LIGHTGREY, COLOUR_RED, COLOUR_WHITE, CURSOR_CROSS, CURSOR_HOURGLASS, CURSOR_STANDARD, FONT_ITALIC, FONT_NORMAL, FONT_SMALL, FONT_SWISS, PEN_BLACK, PEN_BLACKDASHED, PEN_BLUE, PEN_CYAN, PEN_GREEN, PEN_YELLOW, PEN_GREY, PEN_LIGHTGREY, PEN_MEDIUMGREY, PEN_RED, PEN_TRANSPARENT, PEN_WHITE, ITEMCOUNT }; wxStockGDI(); virtual ~wxStockGDI(); static void DeleteAll(); static wxStockGDI& instance() { return *ms_instance; } static const wxBrush* GetBrush(Item item); static const wxColour* GetColour(Item item); static const wxCursor* GetCursor(Item item); // Can be overridden by platform-specific derived classes virtual const wxFont* GetFont(Item item); static const wxPen* GetPen(Item item); protected: static wxStockGDI* ms_instance; static wxObject* ms_stockObject[ITEMCOUNT]; wxDECLARE_NO_COPY_CLASS(wxStockGDI); }; #define wxITALIC_FONT wxStockGDI::instance().GetFont(wxStockGDI::FONT_ITALIC) #define wxNORMAL_FONT wxStockGDI::instance().GetFont(wxStockGDI::FONT_NORMAL) #define wxSMALL_FONT wxStockGDI::instance().GetFont(wxStockGDI::FONT_SMALL) #define wxSWISS_FONT wxStockGDI::instance().GetFont(wxStockGDI::FONT_SWISS) #define wxBLACK_DASHED_PEN wxStockGDI::GetPen(wxStockGDI::PEN_BLACKDASHED) #define wxBLACK_PEN wxStockGDI::GetPen(wxStockGDI::PEN_BLACK) #define wxBLUE_PEN wxStockGDI::GetPen(wxStockGDI::PEN_BLUE) #define wxCYAN_PEN wxStockGDI::GetPen(wxStockGDI::PEN_CYAN) #define wxGREEN_PEN wxStockGDI::GetPen(wxStockGDI::PEN_GREEN) #define wxYELLOW_PEN wxStockGDI::GetPen(wxStockGDI::PEN_YELLOW) #define wxGREY_PEN wxStockGDI::GetPen(wxStockGDI::PEN_GREY) #define wxLIGHT_GREY_PEN wxStockGDI::GetPen(wxStockGDI::PEN_LIGHTGREY) #define wxMEDIUM_GREY_PEN wxStockGDI::GetPen(wxStockGDI::PEN_MEDIUMGREY) #define wxRED_PEN wxStockGDI::GetPen(wxStockGDI::PEN_RED) #define wxTRANSPARENT_PEN wxStockGDI::GetPen(wxStockGDI::PEN_TRANSPARENT) #define wxWHITE_PEN wxStockGDI::GetPen(wxStockGDI::PEN_WHITE) #define wxBLACK_BRUSH wxStockGDI::GetBrush(wxStockGDI::BRUSH_BLACK) #define wxBLUE_BRUSH wxStockGDI::GetBrush(wxStockGDI::BRUSH_BLUE) #define wxCYAN_BRUSH wxStockGDI::GetBrush(wxStockGDI::BRUSH_CYAN) #define wxGREEN_BRUSH wxStockGDI::GetBrush(wxStockGDI::BRUSH_GREEN) #define wxYELLOW_BRUSH wxStockGDI::GetBrush(wxStockGDI::BRUSH_YELLOW) #define wxGREY_BRUSH wxStockGDI::GetBrush(wxStockGDI::BRUSH_GREY) #define wxLIGHT_GREY_BRUSH wxStockGDI::GetBrush(wxStockGDI::BRUSH_LIGHTGREY) #define wxMEDIUM_GREY_BRUSH wxStockGDI::GetBrush(wxStockGDI::BRUSH_MEDIUMGREY) #define wxRED_BRUSH wxStockGDI::GetBrush(wxStockGDI::BRUSH_RED) #define wxTRANSPARENT_BRUSH wxStockGDI::GetBrush(wxStockGDI::BRUSH_TRANSPARENT) #define wxWHITE_BRUSH wxStockGDI::GetBrush(wxStockGDI::BRUSH_WHITE) #define wxBLACK wxStockGDI::GetColour(wxStockGDI::COLOUR_BLACK) #define wxBLUE wxStockGDI::GetColour(wxStockGDI::COLOUR_BLUE) #define wxCYAN wxStockGDI::GetColour(wxStockGDI::COLOUR_CYAN) #define wxGREEN wxStockGDI::GetColour(wxStockGDI::COLOUR_GREEN) #define wxYELLOW wxStockGDI::GetColour(wxStockGDI::COLOUR_YELLOW) #define wxLIGHT_GREY wxStockGDI::GetColour(wxStockGDI::COLOUR_LIGHTGREY) #define wxRED wxStockGDI::GetColour(wxStockGDI::COLOUR_RED) #define wxWHITE wxStockGDI::GetColour(wxStockGDI::COLOUR_WHITE) #define wxCROSS_CURSOR wxStockGDI::GetCursor(wxStockGDI::CURSOR_CROSS) #define wxHOURGLASS_CURSOR wxStockGDI::GetCursor(wxStockGDI::CURSOR_HOURGLASS) #define wxSTANDARD_CURSOR wxStockGDI::GetCursor(wxStockGDI::CURSOR_STANDARD) // 'Null' objects extern WXDLLIMPEXP_DATA_CORE(wxBitmap) wxNullBitmap; extern WXDLLIMPEXP_DATA_CORE(wxIcon) wxNullIcon; extern WXDLLIMPEXP_DATA_CORE(wxCursor) wxNullCursor; extern WXDLLIMPEXP_DATA_CORE(wxPen) wxNullPen; extern WXDLLIMPEXP_DATA_CORE(wxBrush) wxNullBrush; extern WXDLLIMPEXP_DATA_CORE(wxPalette) wxNullPalette; extern WXDLLIMPEXP_DATA_CORE(wxFont) wxNullFont; extern WXDLLIMPEXP_DATA_CORE(wxColour) wxNullColour; extern WXDLLIMPEXP_DATA_CORE(wxIconBundle) wxNullIconBundle; extern WXDLLIMPEXP_DATA_CORE(wxColourDatabase*) wxTheColourDatabase; extern WXDLLIMPEXP_DATA_CORE(const char) wxPanelNameStr[]; extern WXDLLIMPEXP_DATA_CORE(const wxSize) wxDefaultSize; extern WXDLLIMPEXP_DATA_CORE(const wxPoint) wxDefaultPosition; // --------------------------------------------------------------------------- // global functions // --------------------------------------------------------------------------- // resource management extern void WXDLLIMPEXP_CORE wxInitializeStockLists(); extern void WXDLLIMPEXP_CORE wxDeleteStockLists(); // Note: all the display-related functions here exist for compatibility only, // please use wxDisplay class in the new code // is the display colour (or monochrome)? extern bool WXDLLIMPEXP_CORE wxColourDisplay(); // Returns depth of screen extern int WXDLLIMPEXP_CORE wxDisplayDepth(); #define wxGetDisplayDepth wxDisplayDepth // get the display size extern void WXDLLIMPEXP_CORE wxDisplaySize(int *width, int *height); extern wxSize WXDLLIMPEXP_CORE wxGetDisplaySize(); extern void WXDLLIMPEXP_CORE wxDisplaySizeMM(int *width, int *height); extern wxSize WXDLLIMPEXP_CORE wxGetDisplaySizeMM(); extern wxSize WXDLLIMPEXP_CORE wxGetDisplayPPI(); // Get position and size of the display workarea extern void WXDLLIMPEXP_CORE wxClientDisplayRect(int *x, int *y, int *width, int *height); extern wxRect WXDLLIMPEXP_CORE wxGetClientDisplayRect(); // set global cursor extern void WXDLLIMPEXP_CORE wxSetCursor(const wxCursor& cursor); #endif // _WX_GDICMNH__
h
rticonnextdds-usecases
data/projects/rticonnextdds-usecases/VehicleTracking/ExampleCode/thirdparty/wxWidgets-3.1.2/Linux/include/wx/hyperlink.h
///////////////////////////////////////////////////////////////////////////// // Name: wx/hyperlink.h // Purpose: Hyperlink control // Author: David Norris <[email protected]>, Otto Wyss // Modified by: Ryan Norton, Francesco Montorsi // Created: 04/02/2005 // Copyright: (c) 2005 David Norris // Licence: wxWindows licence ///////////////////////////////////////////////////////////////////////////// #ifndef _WX_HYPERLINK_H_ #define _WX_HYPERLINK_H_ #include "wx/defs.h" #if wxUSE_HYPERLINKCTRL #include "wx/control.h" // ---------------------------------------------------------------------------- // constants // ---------------------------------------------------------------------------- #define wxHL_CONTEXTMENU 0x0001 #define wxHL_ALIGN_LEFT 0x0002 #define wxHL_ALIGN_RIGHT 0x0004 #define wxHL_ALIGN_CENTRE 0x0008 #define wxHL_DEFAULT_STYLE (wxHL_CONTEXTMENU|wxNO_BORDER|wxHL_ALIGN_CENTRE) extern WXDLLIMPEXP_DATA_CORE(const char) wxHyperlinkCtrlNameStr[]; // ---------------------------------------------------------------------------- // wxHyperlinkCtrl // ---------------------------------------------------------------------------- // A static text control that emulates a hyperlink. The link is displayed // in an appropriate text style, derived from the control's normal font. // When the mouse rolls over the link, the cursor changes to a hand and the // link's color changes to the active color. // // Clicking on the link does not launch a web browser; instead, a // HyperlinkEvent is fired. The event propagates upward until it is caught, // just like a wxCommandEvent. // // Use the EVT_HYPERLINK() to catch link events. class WXDLLIMPEXP_CORE wxHyperlinkCtrlBase : public wxControl { public: // get/set virtual wxColour GetHoverColour() const = 0; virtual void SetHoverColour(const wxColour &colour) = 0; virtual wxColour GetNormalColour() const = 0; virtual void SetNormalColour(const wxColour &colour) = 0; virtual wxColour GetVisitedColour() const = 0; virtual void SetVisitedColour(const wxColour &colour) = 0; virtual wxString GetURL() const = 0; virtual void SetURL (const wxString &url) = 0; virtual void SetVisited(bool visited = true) = 0; virtual bool GetVisited() const = 0; // NOTE: also wxWindow::Set/GetLabel, wxWindow::Set/GetBackgroundColour, // wxWindow::Get/SetFont, wxWindow::Get/SetCursor are important ! virtual bool HasTransparentBackground() wxOVERRIDE { return true; } protected: virtual wxBorder GetDefaultBorder() const wxOVERRIDE { return wxBORDER_NONE; } // checks for validity some of the ctor/Create() function parameters void CheckParams(const wxString& label, const wxString& url, long style); public: // Send wxHyperlinkEvent and open our link in the default browser if it // wasn't handled. // // not part of the public API but needs to be public as used by // GTK+ callbacks: void SendEvent(); }; // ---------------------------------------------------------------------------- // wxHyperlinkEvent // ---------------------------------------------------------------------------- class WXDLLIMPEXP_FWD_CORE wxHyperlinkEvent; wxDECLARE_EXPORTED_EVENT( WXDLLIMPEXP_CORE, wxEVT_HYPERLINK, wxHyperlinkEvent ); // // An event fired when the user clicks on the label in a hyperlink control. // See HyperlinkControl for details. // class WXDLLIMPEXP_CORE wxHyperlinkEvent : public wxCommandEvent { public: wxHyperlinkEvent() {} wxHyperlinkEvent(wxObject *generator, wxWindowID id, const wxString& url) : wxCommandEvent(wxEVT_HYPERLINK, id), m_url(url) { SetEventObject(generator); } // Returns the URL associated with the hyperlink control // that the user clicked on. wxString GetURL() const { return m_url; } void SetURL(const wxString &url) { m_url=url; } // default copy ctor, assignment operator and dtor are ok virtual wxEvent *Clone() const wxOVERRIDE { return new wxHyperlinkEvent(*this); } private: // URL associated with the hyperlink control that the used clicked on. wxString m_url; wxDECLARE_DYNAMIC_CLASS_NO_ASSIGN(wxHyperlinkEvent); }; // ---------------------------------------------------------------------------- // event types and macros // ---------------------------------------------------------------------------- typedef void (wxEvtHandler::*wxHyperlinkEventFunction)(wxHyperlinkEvent&); #define wxHyperlinkEventHandler(func) \ wxEVENT_HANDLER_CAST(wxHyperlinkEventFunction, func) #define EVT_HYPERLINK(id, fn) \ wx__DECLARE_EVT1(wxEVT_HYPERLINK, id, wxHyperlinkEventHandler(fn)) #if defined(__WXGTK210__) && !defined(__WXUNIVERSAL__) #include "wx/gtk/hyperlink.h" // Note that the native control is only available in Unicode version under MSW. #elif defined(__WXMSW__) && wxUSE_UNICODE && !defined(__WXUNIVERSAL__) #include "wx/msw/hyperlink.h" #else #include "wx/generic/hyperlink.h" class WXDLLIMPEXP_CORE wxHyperlinkCtrl : public wxGenericHyperlinkCtrl { public: wxHyperlinkCtrl() { } wxHyperlinkCtrl(wxWindow *parent, wxWindowID id, const wxString& label, const wxString& url, const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxDefaultSize, long style = wxHL_DEFAULT_STYLE, const wxString& name = wxHyperlinkCtrlNameStr) : wxGenericHyperlinkCtrl(parent, id, label, url, pos, size, style, name) { } private: wxDECLARE_DYNAMIC_CLASS_NO_COPY( wxHyperlinkCtrl ); }; #endif // old wxEVT_COMMAND_* constants #define wxEVT_COMMAND_HYPERLINK wxEVT_HYPERLINK #endif // wxUSE_HYPERLINKCTRL #endif // _WX_HYPERLINK_H_
h
rticonnextdds-usecases
data/projects/rticonnextdds-usecases/VehicleTracking/ExampleCode/thirdparty/wxWidgets-3.1.2/Linux/include/wx/numformatter.h
///////////////////////////////////////////////////////////////////////////// // Name: wx/numformatter.h // Purpose: wxNumberFormatter class // Author: Fulvio Senore, Vadim Zeitlin // Created: 2010-11-06 // Copyright: (c) 2010 wxWidgets team // Licence: wxWindows licence ///////////////////////////////////////////////////////////////////////////// #ifndef _WX_NUMFORMATTER_H_ #define _WX_NUMFORMATTER_H_ #include "wx/string.h" // Helper class for formatting numbers with thousands separators which also // supports parsing the numbers formatted by it. class WXDLLIMPEXP_BASE wxNumberFormatter { public: // Bit masks for ToString() enum Style { Style_None = 0x00, Style_WithThousandsSep = 0x01, Style_NoTrailingZeroes = 0x02 // Only for floating point numbers }; // Format a number as a string. By default, the thousands separator is // used, specify Style_None to prevent this. For floating point numbers, // precision can also be specified. static wxString ToString(long val, int style = Style_WithThousandsSep); #ifdef wxHAS_LONG_LONG_T_DIFFERENT_FROM_LONG static wxString ToString(wxLongLong_t val, int style = Style_WithThousandsSep); #endif // wxHAS_LONG_LONG_T_DIFFERENT_FROM_LONG static wxString ToString(double val, int precision, int style = Style_WithThousandsSep); // Parse a string representing a number, possibly with thousands separator. // // Return true on success and stores the result in the provided location // which must be a valid non-NULL pointer. static bool FromString(wxString s, long *val); #ifdef wxHAS_LONG_LONG_T_DIFFERENT_FROM_LONG static bool FromString(wxString s, wxLongLong_t *val); #endif // wxHAS_LONG_LONG_T_DIFFERENT_FROM_LONG static bool FromString(wxString s, double *val); // Get the decimal separator for the current locale. It is always defined // and we fall back to returning '.' in case of an error. static wxChar GetDecimalSeparator(); // Get the thousands separator if grouping of the digits is used by the // current locale. The value returned in sep should be only used if the // function returns true. static bool GetThousandsSeparatorIfUsed(wxChar *sep); private: // Post-process the string representing an integer. static wxString PostProcessIntString(wxString s, int style); // Add the thousands separators to a string representing a number without // the separators. This is used by ToString(Style_WithThousandsSep). static void AddThousandsSeparators(wxString& s); // Remove trailing zeroes and, if there is nothing left after it, the // decimal separator itself from a string representing a floating point // number. Also used by ToString(). static void RemoveTrailingZeroes(wxString& s); // Remove all thousands separators from a string representing a number. static void RemoveThousandsSeparators(wxString& s); }; #endif // _WX_NUMFORMATTER_H_
h
rticonnextdds-usecases
data/projects/rticonnextdds-usecases/VehicleTracking/ExampleCode/thirdparty/wxWidgets-3.1.2/Linux/include/wx/position.h
///////////////////////////////////////////////////////////////////////////// // Name: wx/position.h // Purpose: Common structure and methods for positional information. // Author: Vadim Zeitlin, Robin Dunn, Brad Anderson, Bryan Petty // Created: 2007-03-13 // Copyright: (c) 2007 The wxWidgets Team // Licence: wxWindows licence ///////////////////////////////////////////////////////////////////////////// #ifndef _WX_POSITION_H_ #define _WX_POSITION_H_ #include "wx/gdicmn.h" class WXDLLIMPEXP_CORE wxPosition { public: wxPosition() : m_row(0), m_column(0) {} wxPosition(int row, int col) : m_row(row), m_column(col) {} // default copy ctor and assignment operator are okay. int GetRow() const { return m_row; } int GetColumn() const { return m_column; } int GetCol() const { return GetColumn(); } void SetRow(int row) { m_row = row; } void SetColumn(int column) { m_column = column; } void SetCol(int column) { SetColumn(column); } bool operator==(const wxPosition& p) const { return m_row == p.m_row && m_column == p.m_column; } bool operator!=(const wxPosition& p) const { return !(*this == p); } wxPosition& operator+=(const wxPosition& p) { m_row += p.m_row; m_column += p.m_column; return *this; } wxPosition& operator-=(const wxPosition& p) { m_row -= p.m_row; m_column -= p.m_column; return *this; } wxPosition& operator+=(const wxSize& s) { m_row += s.y; m_column += s.x; return *this; } wxPosition& operator-=(const wxSize& s) { m_row -= s.y; m_column -= s.x; return *this; } wxPosition operator+(const wxPosition& p) const { return wxPosition(m_row + p.m_row, m_column + p.m_column); } wxPosition operator-(const wxPosition& p) const { return wxPosition(m_row - p.m_row, m_column - p.m_column); } wxPosition operator+(const wxSize& s) const { return wxPosition(m_row + s.y, m_column + s.x); } wxPosition operator-(const wxSize& s) const { return wxPosition(m_row - s.y, m_column - s.x); } private: int m_row; int m_column; }; #endif // _WX_POSITION_H_
h
rticonnextdds-usecases
data/projects/rticonnextdds-usecases/VehicleTracking/ExampleCode/thirdparty/wxWidgets-3.1.2/Linux/include/wx/module.h
///////////////////////////////////////////////////////////////////////////// // Name: wx/module.h // Purpose: Modules handling // Author: Wolfram Gloger/adapted by Guilhem Lavaux // Modified by: // Created: 04/11/98 // Copyright: (c) Wolfram Gloger and Guilhem Lavaux // Licence: wxWindows licence ///////////////////////////////////////////////////////////////////////////// #ifndef _WX_MODULE_H_ #define _WX_MODULE_H_ #include "wx/object.h" #include "wx/list.h" #include "wx/arrstr.h" #include "wx/dynarray.h" // declare a linked list of modules class WXDLLIMPEXP_FWD_BASE wxModule; WX_DECLARE_USER_EXPORTED_LIST(wxModule, wxModuleList, WXDLLIMPEXP_BASE); // and an array of class info objects WX_DEFINE_USER_EXPORTED_ARRAY_PTR(wxClassInfo *, wxArrayClassInfo, class WXDLLIMPEXP_BASE); // declaring a class derived from wxModule will automatically create an // instance of this class on program startup, call its OnInit() method and call // OnExit() on program termination (but only if OnInit() succeeded) class WXDLLIMPEXP_BASE wxModule : public wxObject { public: wxModule() {} virtual ~wxModule() {} // if module init routine returns false the application // will fail to startup bool Init() { return OnInit(); } void Exit() { OnExit(); } // Override both of these // called on program startup virtual bool OnInit() = 0; // called just before program termination, but only if OnInit() // succeeded virtual void OnExit() = 0; static void RegisterModule(wxModule *module); static void RegisterModules(); static bool InitializeModules(); static void CleanUpModules() { DoCleanUpModules(m_modules); } // used by wxObjectLoader when unloading shared libs's static void UnregisterModule(wxModule *module); protected: static wxModuleList m_modules; // the function to call from constructor of a deriving class add module // dependency which will be initialized before the module and unloaded // after that void AddDependency(wxClassInfo *dep) { wxCHECK_RET( dep, wxT("NULL module dependency") ); m_dependencies.Add(dep); } // same as the version above except it will look up wxClassInfo by name on // its own void AddDependency(const char *className) { m_namedDependencies.Add(className); } private: // initialize module and Append it to initializedModules list recursively // calling itself to satisfy module dependencies if needed static bool DoInitializeModule(wxModule *module, wxModuleList &initializedModules); // cleanup the modules in the specified list (which may not contain all // modules if we're called during initialization because not all modules // could be initialized) and also empty m_modules itself static void DoCleanUpModules(const wxModuleList& modules); // resolve all named dependencies and add them to the normal m_dependencies bool ResolveNamedDependencies(); // module dependencies: contains wxClassInfo pointers for all modules which // must be initialized before this one wxArrayClassInfo m_dependencies; // and the named dependencies: those will be resolved during run-time and // added to m_dependencies wxArrayString m_namedDependencies; // used internally while initializing/cleaning up modules enum { State_Registered, // module registered but not initialized yet State_Initializing, // we're initializing this module but not done yet State_Initialized // module initialized successfully } m_state; wxDECLARE_CLASS(wxModule); }; #endif // _WX_MODULE_H_
h
rticonnextdds-usecases
data/projects/rticonnextdds-usecases/VehicleTracking/ExampleCode/thirdparty/wxWidgets-3.1.2/Linux/include/wx/dynlib.h
///////////////////////////////////////////////////////////////////////////// // Name: wx/dynlib.h // Purpose: Dynamic library loading classes // Author: Guilhem Lavaux, Vadim Zeitlin, Vaclav Slavik // Modified by: // Created: 20/07/98 // Copyright: (c) 1998 Guilhem Lavaux // Licence: wxWindows licence ///////////////////////////////////////////////////////////////////////////// #ifndef _WX_DYNLIB_H__ #define _WX_DYNLIB_H__ #include "wx/defs.h" #if wxUSE_DYNLIB_CLASS #include "wx/string.h" #include "wx/dynarray.h" // note that we have our own dlerror() implementation under Darwin #if defined(HAVE_DLERROR) || defined(__DARWIN__) #define wxHAVE_DYNLIB_ERROR #endif class WXDLLIMPEXP_FWD_BASE wxDynamicLibraryDetailsCreator; // ---------------------------------------------------------------------------- // conditional compilation // ---------------------------------------------------------------------------- #if defined(__WINDOWS__) typedef WXHMODULE wxDllType; #elif defined(__DARWIN__) // Don't include dlfcn.h on Darwin, we may be using our own replacements. typedef void *wxDllType; #elif defined(HAVE_DLOPEN) #include <dlfcn.h> typedef void *wxDllType; #elif defined(HAVE_SHL_LOAD) #include <dl.h> typedef shl_t wxDllType; #elif defined(__WXMAC__) #include <CodeFragments.h> typedef CFragConnectionID wxDllType; #else #error "Dynamic Loading classes can't be compiled on this platform, sorry." #endif // ---------------------------------------------------------------------------- // constants // ---------------------------------------------------------------------------- enum wxDLFlags { wxDL_LAZY = 0x00000001, // resolve undefined symbols at first use // (only works on some Unix versions) wxDL_NOW = 0x00000002, // resolve undefined symbols on load // (default, always the case under Win32) wxDL_GLOBAL = 0x00000004, // export extern symbols to subsequently // loaded libs. wxDL_VERBATIM = 0x00000008, // attempt to load the supplied library // name without appending the usual dll // filename extension. // this flag is obsolete, don't use wxDL_NOSHARE = 0x00000010, // load new DLL, don't reuse already loaded // (only for wxPluginManager) wxDL_QUIET = 0x00000020, // don't log an error if failed to load // this flag is dangerous, for internal use of wxMSW only, don't use at all // and especially don't use directly, use wxLoadedDLL instead if you really // do need it wxDL_GET_LOADED = 0x00000040, // Win32 only: return handle of already // loaded DLL or NULL otherwise; Unload() // should not be called so don't forget to // Detach() if you use this function wxDL_DEFAULT = wxDL_NOW // default flags correspond to Win32 }; enum wxDynamicLibraryCategory { wxDL_LIBRARY, // standard library wxDL_MODULE // loadable module/plugin }; enum wxPluginCategory { wxDL_PLUGIN_GUI, // plugin that uses GUI classes wxDL_PLUGIN_BASE // wxBase-only plugin }; // ---------------------------------------------------------------------------- // macros // ---------------------------------------------------------------------------- // when loading a function from a DLL you always have to cast the returned // "void *" pointer to the correct type and, even more annoyingly, you have to // repeat this type twice if you want to declare and define a function pointer // all in one line // // this macro makes this slightly less painful by allowing you to specify the // type only once, as the first parameter, and creating a variable of this type // called "pfn<name>" initialized with the "name" from the "dynlib" #define wxDYNLIB_FUNCTION(type, name, dynlib) \ type pfn ## name = (type)(dynlib).GetSymbol(wxT(#name)) // a more convenient function replacing wxDYNLIB_FUNCTION above // // it uses the convention that the type of the function is its name suffixed // with "_t" but it doesn't define a variable but just assigns the loaded value // to it and also allows to pass it the prefix to be used instead of hardcoding // "pfn" (the prefix can be "m_" or "gs_pfn" or whatever) // // notice that this function doesn't generate error messages if the symbol // couldn't be loaded, the caller should generate the appropriate message #define wxDL_INIT_FUNC(pfx, name, dynlib) \ pfx ## name = (name ## _t)(dynlib).RawGetSymbol(#name) #ifdef __WINDOWS__ // same as wxDL_INIT_FUNC() but appends 'A' or 'W' to the function name, see // wxDynamicLibrary::GetSymbolAorW() #define wxDL_INIT_FUNC_AW(pfx, name, dynlib) \ pfx ## name = (name ## _t)(dynlib).GetSymbolAorW(#name) #endif // __WINDOWS__ // the following macros can be used to redirect a whole library to a class and // check at run-time if the library is present and contains all required // methods // // notice that they are supposed to be used inside a class which has "m_ok" // member variable indicating if the library had been successfully loaded // helper macros constructing the name of the variable storing the function // pointer and the name of its type from the function name #define wxDL_METHOD_NAME(name) m_pfn ## name #define wxDL_METHOD_TYPE(name) name ## _t // parameters are: // - rettype: return type of the function, e.g. "int" // - name: name of the function, e.g. "foo" // - args: function signature in parentheses, e.g. "(int x, int y)" // - argnames: the names of the parameters in parentheses, e.g. "(x, y)" // - defret: the value to return if the library wasn't successfully loaded #define wxDL_METHOD_DEFINE( rettype, name, args, argnames, defret ) \ typedef rettype (* wxDL_METHOD_TYPE(name)) args ; \ wxDL_METHOD_TYPE(name) wxDL_METHOD_NAME(name); \ rettype name args \ { return m_ok ? wxDL_METHOD_NAME(name) argnames : defret; } #define wxDL_VOIDMETHOD_DEFINE( name, args, argnames ) \ typedef void (* wxDL_METHOD_TYPE(name)) args ; \ wxDL_METHOD_TYPE(name) wxDL_METHOD_NAME(name); \ void name args \ { if ( m_ok ) wxDL_METHOD_NAME(name) argnames ; } #define wxDL_METHOD_LOAD(lib, name) \ wxDL_METHOD_NAME(name) = \ (wxDL_METHOD_TYPE(name)) lib.GetSymbol(#name, &m_ok); \ if ( !m_ok ) return false // ---------------------------------------------------------------------------- // wxDynamicLibraryDetails: contains details about a loaded wxDynamicLibrary // ---------------------------------------------------------------------------- class WXDLLIMPEXP_BASE wxDynamicLibraryDetails { public: // ctor, normally never used as these objects are only created by // wxDynamicLibrary::ListLoaded() wxDynamicLibraryDetails() { m_address = NULL; m_length = 0; } // get the (base) name wxString GetName() const { return m_name; } // get the full path of this object wxString GetPath() const { return m_path; } // get the load address and the extent, return true if this information is // available bool GetAddress(void **addr, size_t *len) const { if ( !m_address ) return false; if ( addr ) *addr = m_address; if ( len ) *len = m_length; return true; } // return the version of the DLL (may be empty if no version info) wxString GetVersion() const { return m_version; } private: wxString m_name, m_path, m_version; void *m_address; size_t m_length; friend class wxDynamicLibraryDetailsCreator; }; WX_DECLARE_USER_EXPORTED_OBJARRAY(wxDynamicLibraryDetails, wxDynamicLibraryDetailsArray, WXDLLIMPEXP_BASE); // ---------------------------------------------------------------------------- // wxDynamicLibrary: represents a handle to a DLL/shared object // ---------------------------------------------------------------------------- class WXDLLIMPEXP_BASE wxDynamicLibrary { public: // return a valid handle for the main program itself or NULL if back // linking is not supported by the current platform (e.g. Win32) static wxDllType GetProgramHandle(); // return the platform standard DLL extension (with leading dot) static wxString GetDllExt(wxDynamicLibraryCategory cat = wxDL_LIBRARY); wxDynamicLibrary() : m_handle(0) { } wxDynamicLibrary(const wxString& libname, int flags = wxDL_DEFAULT) : m_handle(0) { Load(libname, flags); } // NOTE: this class is (deliberately) not virtual, do not attempt // to use it polymorphically. ~wxDynamicLibrary() { Unload(); } // return true if the library was loaded successfully bool IsLoaded() const { return m_handle != 0; } // load the library with the given name (full or not), return true if ok bool Load(const wxString& libname, int flags = wxDL_DEFAULT); // raw function for loading dynamic libs: always behaves as if // wxDL_VERBATIM were specified and doesn't log error message if the // library couldn't be loaded but simply returns NULL static wxDllType RawLoad(const wxString& libname, int flags = wxDL_DEFAULT); // detach the library object from its handle, i.e. prevent the object from // unloading the library in its dtor -- the caller is now responsible for // doing this wxDllType Detach() { wxDllType h = m_handle; m_handle = 0; return h; } // unload the given library handle (presumably returned by Detach() before) static void Unload(wxDllType handle); // unload the library, also done automatically in dtor void Unload() { if ( IsLoaded() ) { Unload(m_handle); m_handle = 0; } } // Return the raw handle from dlopen and friends. wxDllType GetLibHandle() const { return m_handle; } // check if the given symbol is present in the library, useful to verify if // a loadable module is our plugin, for example, without provoking error // messages from GetSymbol() bool HasSymbol(const wxString& name) const { bool ok; DoGetSymbol(name, &ok); return ok; } // resolve a symbol in a loaded DLL, such as a variable or function name. // 'name' is the (possibly mangled) name of the symbol. (use extern "C" to // export unmangled names) // // Since it is perfectly valid for the returned symbol to actually be NULL, // that is not always indication of an error. Pass and test the parameter // 'success' for a true indication of success or failure to load the // symbol. // // Returns a pointer to the symbol on success, or NULL if an error occurred // or the symbol wasn't found. void *GetSymbol(const wxString& name, bool *success = NULL) const; // low-level version of GetSymbol() static void *RawGetSymbol(wxDllType handle, const wxString& name); void *RawGetSymbol(const wxString& name) const { return RawGetSymbol(m_handle, name); } #ifdef __WINDOWS__ // this function is useful for loading functions from the standard Windows // DLLs: such functions have an 'A' (in ANSI build) or 'W' (in Unicode, or // wide character build) suffix if they take string parameters static void *RawGetSymbolAorW(wxDllType handle, const wxString& name) { return RawGetSymbol ( handle, name + #if wxUSE_UNICODE L'W' #else 'A' #endif ); } void *GetSymbolAorW(const wxString& name) const { return RawGetSymbolAorW(m_handle, name); } #endif // __WINDOWS__ // return all modules/shared libraries in the address space of this process // // returns an empty array if not implemented or an error occurred static wxDynamicLibraryDetailsArray ListLoaded(); // return platform-specific name of dynamic library with proper extension // and prefix (e.g. "foo.dll" on Windows or "libfoo.so" on Linux) static wxString CanonicalizeName(const wxString& name, wxDynamicLibraryCategory cat = wxDL_LIBRARY); // return name of wxWidgets plugin (adds compiler and version info // to the filename): static wxString CanonicalizePluginName(const wxString& name, wxPluginCategory cat = wxDL_PLUGIN_GUI); // return plugin directory on platforms where it makes sense and empty // string on others: static wxString GetPluginsDirectory(); // Return the load address of the module containing the given address or // NULL if not found. // // If path output parameter is non-NULL, fill it with the full path to this // module disk file on success. static void* GetModuleFromAddress(const void* addr, wxString* path = NULL); #ifdef __WINDOWS__ // return the handle (HMODULE/HINSTANCE) of the DLL with the given name // and/or containing the specified address: for XP and later systems only // the address is used and the name is ignored but for the previous systems // only the name (which may be either a full path to the DLL or just its // base name, possibly even without extension) is used // // the returned handle reference count is not incremented so it doesn't // need to be freed using FreeLibrary() but it also means that it can // become invalid if the DLL is unloaded static WXHMODULE MSWGetModuleHandle(const wxString& name, void *addr); #endif // __WINDOWS__ protected: // common part of GetSymbol() and HasSymbol() void *DoGetSymbol(const wxString& name, bool *success = 0) const; #ifdef wxHAVE_DYNLIB_ERROR // log the error after a dlxxx() function failure static void Error(); #endif // wxHAVE_DYNLIB_ERROR // the handle to DLL or NULL wxDllType m_handle; // no copy ctor/assignment operators (or we'd try to unload the library // twice) wxDECLARE_NO_COPY_CLASS(wxDynamicLibrary); }; #ifdef __WINDOWS__ // ---------------------------------------------------------------------------- // wxLoadedDLL is a MSW-only internal helper class allowing to dynamically bind // to a DLL already loaded into the project address space // ---------------------------------------------------------------------------- class wxLoadedDLL : public wxDynamicLibrary { public: wxLoadedDLL(const wxString& dllname) : wxDynamicLibrary(dllname, wxDL_GET_LOADED | wxDL_VERBATIM | wxDL_QUIET) { } ~wxLoadedDLL() { Detach(); } }; #endif // __WINDOWS__ // ---------------------------------------------------------------------------- // Interesting defines // ---------------------------------------------------------------------------- #define WXDLL_ENTRY_FUNCTION() \ extern "C" WXEXPORT const wxClassInfo *wxGetClassFirst(); \ const wxClassInfo *wxGetClassFirst() { \ return wxClassInfo::GetFirst(); \ } #endif // wxUSE_DYNLIB_CLASS #endif // _WX_DYNLIB_H__
h
rticonnextdds-usecases
data/projects/rticonnextdds-usecases/VehicleTracking/ExampleCode/thirdparty/wxWidgets-3.1.2/Linux/include/wx/propdlg.h
///////////////////////////////////////////////////////////////////////////// // Name: wx/propdlg.h // Purpose: wxPropertySheetDialog base header // Author: Julian Smart // Modified by: // Created: // Copyright: (c) Julian Smart // Licence: wxWindows licence ///////////////////////////////////////////////////////////////////////////// #ifndef _WX_PROPDLG_H_BASE_ #define _WX_PROPDLG_H_BASE_ #include "wx/generic/propdlg.h" #endif // _WX_PROPDLG_H_BASE_
h
rticonnextdds-usecases
data/projects/rticonnextdds-usecases/VehicleTracking/ExampleCode/thirdparty/wxWidgets-3.1.2/Linux/include/wx/fileconf.h
/////////////////////////////////////////////////////////////////////////////// // Name: wx/fileconf.h // Purpose: wxFileConfig derivation of wxConfigBase // Author: Vadim Zeitlin // Modified by: // Created: 07.04.98 (adapted from appconf.cpp) // Copyright: (c) 1997 Karsten Ballueder & Vadim Zeitlin // [email protected] <[email protected]> // Licence: wxWindows licence /////////////////////////////////////////////////////////////////////////////// #ifndef _FILECONF_H #define _FILECONF_H #include "wx/defs.h" #if wxUSE_CONFIG #include "wx/textfile.h" #include "wx/string.h" #include "wx/confbase.h" #include "wx/filename.h" // ---------------------------------------------------------------------------- // wxFileConfig // ---------------------------------------------------------------------------- /* wxFileConfig derives from base Config and implements file based config class, i.e. it uses ASCII disk files to store the information. These files are alternatively called INI, .conf or .rc in the documentation. They are organized in groups or sections, which can nest (i.e. a group contains subgroups, which contain their own subgroups &c). Each group has some number of entries, which are "key = value" pairs. More precisely, the format is: # comments are allowed after either ';' or '#' (Win/UNIX standard) # blank lines (as above) are ignored # global entries are members of special (no name) top group written_for = Windows platform = Linux # the start of the group 'Foo' [Foo] # may put comments like this also # following 3 lines are entries key = value another_key = " strings with spaces in the beginning should be quoted, \ otherwise the spaces are lost" last_key = but you don't have to put " normally (nor quote them, like here) # subgroup of the group 'Foo' # (order is not important, only the name is: separator is '/', as in paths) [Foo/Bar] # entries prefixed with "!" are immutable, i.e. can't be changed if they are # set in the system-wide config file !special_key = value bar_entry = whatever [Foo/Bar/Fubar] # depth is (theoretically :-) unlimited # may have the same name as key in another section bar_entry = whatever not You have {read/write/delete}Entry functions (guess what they do) and also setCurrentPath to select current group. enum{Subgroups/Entries} allow you to get all entries in the config file (in the current group). Finally, flush() writes immediately all changed entries to disk (otherwise it would be done automatically in dtor) wxFileConfig manages not less than 2 config files for each program: global and local (or system and user if you prefer). Entries are read from both of them and the local entries override the global ones unless the latter is immutable (prefixed with '!') in which case a warning message is generated and local value is ignored. Of course, the changes are always written to local file only. The names of these files can be specified in a number of ways. First of all, you can use the standard convention: using the ctor which takes 'strAppName' parameter will probably be sufficient for 90% of cases. If, for whatever reason you wish to use the files with some other names, you can always use the second ctor. wxFileConfig also may automatically expand the values of environment variables in the entries it reads: for example, if you have an entry score_file = $HOME/.score a call to Read(&str, "score_file") will return a complete path to .score file unless the expansion was previously disabled with SetExpandEnvVars(false) call (it's on by default, the current status can be retrieved with IsExpandingEnvVars function). */ class WXDLLIMPEXP_FWD_BASE wxFileConfigGroup; class WXDLLIMPEXP_FWD_BASE wxFileConfigEntry; class WXDLLIMPEXP_FWD_BASE wxFileConfigLineList; #if wxUSE_STREAMS class WXDLLIMPEXP_FWD_BASE wxInputStream; class WXDLLIMPEXP_FWD_BASE wxOutputStream; #endif // wxUSE_STREAMS class WXDLLIMPEXP_BASE wxFileConfig : public wxConfigBase { public: // construct the "standard" full name for global (system-wide) and // local (user-specific) config files from the base file name. // // the following are the filenames returned by this functions: // global local // Unix /etc/file.ext ~/.file // Win %windir%\file.ext %USERPROFILE%\file.ext // // where file is the basename of szFile, ext is its extension // or .conf (Unix) or .ini (Win) if it has none static wxFileName GetGlobalFile(const wxString& szFile); static wxFileName GetLocalFile(const wxString& szFile, int style = 0); static wxString GetGlobalFileName(const wxString& szFile) { return GetGlobalFile(szFile).GetFullPath(); } static wxString GetLocalFileName(const wxString& szFile, int style = 0) { return GetLocalFile(szFile, style).GetFullPath(); } // ctor & dtor // New constructor: one size fits all. Specify wxCONFIG_USE_LOCAL_FILE or // wxCONFIG_USE_GLOBAL_FILE to say which files should be used. wxFileConfig(const wxString& appName = wxEmptyString, const wxString& vendorName = wxEmptyString, const wxString& localFilename = wxEmptyString, const wxString& globalFilename = wxEmptyString, long style = wxCONFIG_USE_LOCAL_FILE | wxCONFIG_USE_GLOBAL_FILE, const wxMBConv& conv = wxConvAuto()); #if wxUSE_STREAMS // ctor that takes an input stream. wxFileConfig(wxInputStream &inStream, const wxMBConv& conv = wxConvAuto()); #endif // wxUSE_STREAMS // dtor will save unsaved data virtual ~wxFileConfig(); // under Unix, set the umask to be used for the file creation, do nothing // under other systems #ifdef __UNIX__ void SetUmask(int mode) { m_umask = mode; } #else // !__UNIX__ void SetUmask(int WXUNUSED(mode)) { } #endif // __UNIX__/!__UNIX__ // implement inherited pure virtual functions virtual void SetPath(const wxString& strPath) wxOVERRIDE; virtual const wxString& GetPath() const wxOVERRIDE; virtual bool GetFirstGroup(wxString& str, long& lIndex) const wxOVERRIDE; virtual bool GetNextGroup (wxString& str, long& lIndex) const wxOVERRIDE; virtual bool GetFirstEntry(wxString& str, long& lIndex) const wxOVERRIDE; virtual bool GetNextEntry (wxString& str, long& lIndex) const wxOVERRIDE; virtual size_t GetNumberOfEntries(bool bRecursive = false) const wxOVERRIDE; virtual size_t GetNumberOfGroups(bool bRecursive = false) const wxOVERRIDE; virtual bool HasGroup(const wxString& strName) const wxOVERRIDE; virtual bool HasEntry(const wxString& strName) const wxOVERRIDE; virtual bool Flush(bool bCurrentOnly = false) wxOVERRIDE; virtual bool RenameEntry(const wxString& oldName, const wxString& newName) wxOVERRIDE; virtual bool RenameGroup(const wxString& oldName, const wxString& newName) wxOVERRIDE; virtual bool DeleteEntry(const wxString& key, bool bGroupIfEmptyAlso = true) wxOVERRIDE; virtual bool DeleteGroup(const wxString& szKey) wxOVERRIDE; virtual bool DeleteAll() wxOVERRIDE; // additional, wxFileConfig-specific, functionality #if wxUSE_STREAMS // save the entire config file text to the given stream, note that the text // won't be saved again in dtor when Flush() is called if you use this method // as it won't be "changed" any more virtual bool Save(wxOutputStream& os, const wxMBConv& conv = wxConvAuto()); #endif // wxUSE_STREAMS public: // functions to work with this list wxFileConfigLineList *LineListAppend(const wxString& str); wxFileConfigLineList *LineListInsert(const wxString& str, wxFileConfigLineList *pLine); // NULL => Prepend() void LineListRemove(wxFileConfigLineList *pLine); bool LineListIsEmpty(); protected: virtual bool DoReadString(const wxString& key, wxString *pStr) const wxOVERRIDE; virtual bool DoReadLong(const wxString& key, long *pl) const wxOVERRIDE; #if wxUSE_BASE64 virtual bool DoReadBinary(const wxString& key, wxMemoryBuffer* buf) const wxOVERRIDE; #endif // wxUSE_BASE64 virtual bool DoWriteString(const wxString& key, const wxString& szValue) wxOVERRIDE; virtual bool DoWriteLong(const wxString& key, long lValue) wxOVERRIDE; #if wxUSE_BASE64 virtual bool DoWriteBinary(const wxString& key, const wxMemoryBuffer& buf) wxOVERRIDE; #endif // wxUSE_BASE64 private: // GetXXXFileName helpers: return ('/' terminated) directory names static wxString GetGlobalDir(); static wxString GetLocalDir(int style = 0); // common part of all ctors (assumes that m_str{Local|Global}File are already // initialized void Init(); // common part of from dtor and DeleteAll void CleanUp(); // parse the whole file void Parse(const wxTextBuffer& buffer, bool bLocal); // the same as SetPath("/") void SetRootPath(); // real SetPath() implementation, returns true if path could be set or false // if path doesn't exist and createMissingComponents == false bool DoSetPath(const wxString& strPath, bool createMissingComponents); // set/test the dirty flag void SetDirty() { m_isDirty = true; } void ResetDirty() { m_isDirty = false; } bool IsDirty() const { return m_isDirty; } // member variables // ---------------- wxFileConfigLineList *m_linesHead, // head of the linked list *m_linesTail; // tail wxFileName m_fnLocalFile, // local file name passed to ctor m_fnGlobalFile; // global wxString m_strPath; // current path (not '/' terminated) wxFileConfigGroup *m_pRootGroup, // the top (unnamed) group *m_pCurrentGroup; // the current group wxMBConv *m_conv; #ifdef __UNIX__ int m_umask; // the umask to use for file creation #endif // __UNIX__ bool m_isDirty; // if true, we have unsaved changes wxDECLARE_NO_COPY_CLASS(wxFileConfig); wxDECLARE_ABSTRACT_CLASS(wxFileConfig); }; #endif // wxUSE_CONFIG #endif //_FILECONF_H
h
rticonnextdds-usecases
data/projects/rticonnextdds-usecases/VehicleTracking/ExampleCode/thirdparty/wxWidgets-3.1.2/Linux/include/wx/beforestd.h
/////////////////////////////////////////////////////////////////////////////// // Name: wx/beforestd.h // Purpose: #include before STL headers // Author: Vadim Zeitlin // Modified by: // Created: 07/07/03 // Copyright: (c) 2003 Vadim Zeitlin <[email protected]> // Licence: wxWindows licence /////////////////////////////////////////////////////////////////////////////// /** Unfortunately, when compiling at maximum warning level, the standard headers themselves may generate warnings -- and really lots of them. So before including them, this header should be included to temporarily suppress the warnings and after this the header afterstd.h should be included to enable them back again. Note that there are intentionally no inclusion guards in this file, because it can be included several times. */ // VC 7.x isn't as bad as VC6 and doesn't give these warnings but eVC (which // defines _MSC_VER as 1201) does need to be included as it's VC6-like #if defined(__VISUALC__) && __VISUALC__ <= 1201 // these warning have to be disabled and not just temporarily disabled // because they will be given at the end of the compilation of the // current source and there is absolutely nothing we can do about them so // disable them before warning(push) below // 'foo': unreferenced inline function has been removed #pragma warning(disable:4514) // 'function' : function not inlined #pragma warning(disable:4710) // 'id': identifier was truncated to 'num' characters in the debug info #pragma warning(disable:4786) // we have to disable (and reenable in afterstd.h) this one because, // even though it is of level 4, it is not disabled by warning(push, 1) // below for VC7.1! // unreachable code #pragma warning(disable:4702) #pragma warning(push, 1) #endif // VC++ < 7 /** GCC's visibility support is broken for libstdc++ in some older versions (namely Debian/Ubuntu's GCC 4.1, see https://bugs.launchpad.net/ubuntu/+source/gcc-4.1/+bug/109262). We fix it here by mimicking newer versions' behaviour of using default visibility for libstdc++ code. */ #if defined(HAVE_VISIBILITY) && defined(HAVE_BROKEN_LIBSTDCXX_VISIBILITY) #pragma GCC visibility push(default) #endif
h
rticonnextdds-usecases
data/projects/rticonnextdds-usecases/VehicleTracking/ExampleCode/thirdparty/wxWidgets-3.1.2/Linux/include/wx/stdpaths.h
/////////////////////////////////////////////////////////////////////////////// // Name: wx/stdpaths.h // Purpose: declaration of wxStandardPaths class // Author: Vadim Zeitlin // Modified by: // Created: 2004-10-17 // Copyright: (c) 2004 Vadim Zeitlin <[email protected]> // Licence: wxWindows licence /////////////////////////////////////////////////////////////////////////////// #ifndef _WX_STDPATHS_H_ #define _WX_STDPATHS_H_ #include "wx/defs.h" #include "wx/string.h" #include "wx/filefn.h" class WXDLLIMPEXP_FWD_BASE wxStandardPaths; // ---------------------------------------------------------------------------- // wxStandardPaths returns the standard locations in the file system // ---------------------------------------------------------------------------- // NB: This is always compiled in, wxUSE_STDPATHS=0 only disables native // wxStandardPaths class, but a minimal version is always available class WXDLLIMPEXP_BASE wxStandardPathsBase { public: // possible resources categories enum ResourceCat { // no special category ResourceCat_None, // message catalog resources ResourceCat_Messages, // end of enum marker ResourceCat_Max }; // what should we use to construct paths unique to this application: // (AppInfo_AppName and AppInfo_VendorName can be combined together) enum { AppInfo_None = 0, // nothing AppInfo_AppName = 1, // the application name AppInfo_VendorName = 2 // the vendor name }; enum Dir { Dir_Cache, Dir_Documents, Dir_Desktop, Dir_Downloads, Dir_Music, Dir_Pictures, Dir_Videos }; // Layout to use for user config/data files under Unix. enum FileLayout { FileLayout_Classic, // Default: use home directory. FileLayout_XDG // Recommended: use XDG specification. }; // Naming convention for the config files under Unix. enum ConfigFileConv { ConfigFileConv_Dot, // Classic Unix dot-file convention. ConfigFileConv_Ext // Use .conf extension. }; // return the global standard paths object static wxStandardPaths& Get(); // return the path (directory+filename) of the running executable or // wxEmptyString if it couldn't be determined. // The path is returned as an absolute path whenever possible. // Default implementation only try to use wxApp->argv[0]. virtual wxString GetExecutablePath() const; // return the directory with system config files: // /etc under Unix, c:\Documents and Settings\All Users\Application Data // under Windows, /Library/Preferences for Mac virtual wxString GetConfigDir() const = 0; // return the directory for the user config files: // $HOME under Unix, c:\Documents and Settings\username under Windows, // ~/Library/Preferences under Mac // // only use this if you have a single file to put there, otherwise // GetUserDataDir() is more appropriate virtual wxString GetUserConfigDir() const = 0; // return the location of the applications global, i.e. not user-specific, // data files // // prefix/share/appname under Unix, c:\Program Files\appname under Windows, // appname.app/Contents/SharedSupport app bundle directory under Mac virtual wxString GetDataDir() const = 0; // return the location for application data files which are host-specific // // same as GetDataDir() except under Unix where it is /etc/appname virtual wxString GetLocalDataDir() const; // return the directory for the user-dependent application data files // // $HOME/.appname under Unix, // c:\Documents and Settings\username\Application Data\appname under Windows // and ~/Library/Application Support/appname under Mac virtual wxString GetUserDataDir() const = 0; // return the directory for user data files which shouldn't be shared with // the other machines // // same as GetUserDataDir() for all platforms except Windows where it is // the "Local Settings\Application Data\appname" directory virtual wxString GetUserLocalDataDir() const; // return the directory where the loadable modules (plugins) live // // prefix/lib/appname under Unix, program directory under Windows and // Contents/Plugins app bundle subdirectory under Mac virtual wxString GetPluginsDir() const = 0; // get resources directory: resources are auxiliary files used by the // application and include things like image and sound files // // same as GetDataDir() for all platforms except Mac where it returns // Contents/Resources subdirectory of the app bundle virtual wxString GetResourcesDir() const { return GetDataDir(); } // get localized resources directory containing the resource files of the // specified category for the given language // // in general this is just GetResourcesDir()/lang under Windows and Unix // and GetResourcesDir()/lang.lproj under Mac but is something quite // different under Unix for message catalog category (namely the standard // prefix/share/locale/lang/LC_MESSAGES) virtual wxString GetLocalizedResourcesDir(const wxString& lang, ResourceCat WXUNUSED(category) = ResourceCat_None) const { return GetResourcesDir() + wxFILE_SEP_PATH + lang; } // return the "Documents" directory for the current user // // C:\Documents and Settings\username\My Documents under Windows, // $HOME under Unix and ~/Documents under Mac virtual wxString GetDocumentsDir() const { return GetUserDir(Dir_Documents); } // return the directory for the documents files used by this application: // it's a subdirectory of GetDocumentsDir() constructed using the // application name/vendor if it exists or just GetDocumentsDir() otherwise virtual wxString GetAppDocumentsDir() const; // return the temporary directory for the current user virtual wxString GetTempDir() const; virtual wxString GetUserDir(Dir userDir) const; virtual wxString MakeConfigFileName(const wxString& basename, ConfigFileConv conv = ConfigFileConv_Ext) const = 0; // virtual dtor for the base class virtual ~wxStandardPathsBase(); // Information used by AppendAppInfo void UseAppInfo(int info) { m_usedAppInfo = info; } bool UsesAppInfo(int info) const { return (m_usedAppInfo & info) != 0; } void SetFileLayout(FileLayout layout) { m_fileLayout = layout; } FileLayout GetFileLayout() const { return m_fileLayout; } protected: // Ctor is protected as this is a base class which should never be created // directly. wxStandardPathsBase(); // append the path component, with a leading path separator if a // path separator or dot (.) is not already at the end of dir static wxString AppendPathComponent(const wxString& dir, const wxString& component); // append application information determined by m_usedAppInfo to dir wxString AppendAppInfo(const wxString& dir) const; // combination of AppInfo_XXX flags used by AppendAppInfo() int m_usedAppInfo; // The file layout to use, currently only used under Unix. FileLayout m_fileLayout; }; #if wxUSE_STDPATHS #if defined(__WINDOWS__) #include "wx/msw/stdpaths.h" #define wxHAS_NATIVE_STDPATHS #elif defined(__WXOSX_COCOA__) || defined(__WXOSX_IPHONE__) || defined(__DARWIN__) #include "wx/osx/cocoa/stdpaths.h" #define wxHAS_NATIVE_STDPATHS #elif defined(__UNIX__) #include "wx/unix/stdpaths.h" #define wxHAS_NATIVE_STDPATHS #define wxHAS_STDPATHS_INSTALL_PREFIX #endif #endif // ---------------------------------------------------------------------------- // Minimal generic implementation // ---------------------------------------------------------------------------- // NB: Note that this minimal implementation is compiled in even if // wxUSE_STDPATHS=0, so that our code can still use wxStandardPaths. #ifndef wxHAS_NATIVE_STDPATHS #define wxHAS_STDPATHS_INSTALL_PREFIX class WXDLLIMPEXP_BASE wxStandardPaths : public wxStandardPathsBase { public: void SetInstallPrefix(const wxString& prefix) { m_prefix = prefix; } wxString GetInstallPrefix() const { return m_prefix; } virtual wxString GetExecutablePath() const { return m_prefix; } virtual wxString GetConfigDir() const { return m_prefix; } virtual wxString GetUserConfigDir() const { return m_prefix; } virtual wxString GetDataDir() const { return m_prefix; } virtual wxString GetLocalDataDir() const { return m_prefix; } virtual wxString GetUserDataDir() const { return m_prefix; } virtual wxString GetPluginsDir() const { return m_prefix; } virtual wxString GetUserDir(Dir WXUNUSED(userDir)) const { return m_prefix; } virtual wxString MakeConfigFileName(const wxString& basename, ConfigFileConv WXUNUSED(conv) = ConfigFileConv_Ext) const { return m_prefix + wxS("/") + basename; } protected: // Ctor is protected because wxStandardPaths::Get() should always be used // to access the global wxStandardPaths object of the correct type instead // of creating one of a possibly wrong type yourself. wxStandardPaths() { } private: wxString m_prefix; }; #endif // !wxHAS_NATIVE_STDPATHS #endif // _WX_STDPATHS_H_
h
rticonnextdds-usecases
data/projects/rticonnextdds-usecases/VehicleTracking/ExampleCode/thirdparty/wxWidgets-3.1.2/Linux/include/wx/defs.h
/* * Name: wx/defs.h * Purpose: Declarations/definitions common to all wx source files * Author: Julian Smart and others * Modified by: Ryan Norton (Converted to C) * Created: 01/02/97 * Copyright: (c) Julian Smart * Licence: wxWindows licence */ /* THIS IS A C FILE, DON'T USE C++ FEATURES (IN PARTICULAR COMMENTS) IN IT */ /* We want to avoid compilation and, even more perniciously, link errors if the user code includes <windows.h> before include wxWidgets headers. These error happen because <windows.h> #define's many common symbols, such as Yield or GetClassInfo, which are also used in wxWidgets API. Including our "cleanup" header below un-#defines them to fix this. Moreover, notice that it is also possible for the user code to include some wx header (this including wx/defs.h), then include <windows.h> and then include another wx header. To avoid the problem for the second header inclusion, we must include wx/msw/winundef.h from here always and not just during the first inclusion, so it has to be outside of _WX_DEFS_H_ guard check below. */ #ifdef __cplusplus /* Test for _WINDOWS_, used as header guard by windows.h itself, not our own __WINDOWS__, which is not defined yet. */ # ifdef _WINDOWS_ # include "wx/msw/winundef.h" # endif /* WIN32 */ #endif /* __cplusplus */ #ifndef _WX_DEFS_H_ #define _WX_DEFS_H_ /* ---------------------------------------------------------------------------- */ /* compiler and OS identification */ /* ---------------------------------------------------------------------------- */ #include "wx/platform.h" #ifdef __cplusplus /* Make sure the environment is set correctly */ # if defined(__WXMSW__) && defined(__X__) # error "Target can't be both X and MSW" # elif !defined(__WXMOTIF__) && \ !defined(__WXMSW__) && \ !defined(__WXGTK__) && \ !defined(__WXOSX_COCOA__) && \ !defined(__WXOSX_IPHONE__) && \ !defined(__X__) && \ !defined(__WXDFB__) && \ !defined(__WXX11__) && \ !defined(__WXQT__) && \ wxUSE_GUI # ifdef __UNIX__ # error "No Target! You should use wx-config program for compilation flags!" # else /* !Unix */ # error "No Target! You should use supplied makefiles for compilation!" # endif /* Unix/!Unix */ # endif #endif /*__cplusplus*/ #ifndef __WXWINDOWS__ #define __WXWINDOWS__ 1 #endif #ifndef wxUSE_BASE /* by default consider that this is a monolithic build */ #define wxUSE_BASE 1 #endif #if !wxUSE_GUI && !defined(__WXBASE__) #define __WXBASE__ #endif /* suppress some Visual C++ warnings */ #ifdef __VISUALC__ /* the only "real" warning here is 4244 but there are just too many of them */ /* in our code... one day someone should go and fix them but until then... */ # pragma warning(disable:4097) /* typedef used as class */ # pragma warning(disable:4201) /* nonstandard extension used: nameless struct/union */ # pragma warning(disable:4244) /* conversion from double to float */ # pragma warning(disable:4355) /* 'this' used in base member initializer list */ # pragma warning(disable:4511) /* copy ctor couldn't be generated */ # pragma warning(disable:4512) /* operator=() couldn't be generated */ # pragma warning(disable:4514) /* unreferenced inline func has been removed */ # pragma warning(disable:4710) /* function not inlined */ /* TODO: this warning should really be enabled as it can be genuinely useful, check where does it occur in wxWidgets */ #pragma warning(disable: 4127) /* conditional expression is constant */ /* There are too many false positivies for this one, particularly when using templates like wxVector<T> */ /* class 'foo' needs to have dll-interface to be used by clients of class 'bar'" */ # pragma warning(disable:4251) /* This is a similar warning which occurs when deriving from standard containers. MSDN even mentions that it can be ignored in this case (albeit only in debug build while the warning is the same in release too and seems equally harmless). */ #if wxUSE_STD_CONTAINERS # pragma warning(disable:4275) #endif /* wxUSE_STD_CONTAINERS */ # ifdef __VISUALC5__ /* For VC++ 5.0 for release mode, the warning 'C4702: unreachable code */ /* is buggy, and occurs for code that does actually get executed */ # ifndef __WXDEBUG__ # pragma warning(disable:4702) /* unreachable code */ # endif /* The VC++ 5.0 warning 'C4003: not enough actual parameters for macro' * is incompatible with the wxWidgets headers since it is given when * parameters are empty but not missing. */ # pragma warning(disable:4003) /* not enough actual parameters for macro */ # endif /* When compiling with VC++ 7 /Wp64 option we get thousands of warnings for conversion from size_t to int or long. Some precious few of them might be worth looking into but unfortunately it seems infeasible to fix all the other, harmless ones (e.g. inserting static_cast<int>(s.length()) everywhere this method is used though we are quite sure that using >4GB strings is a bad idea anyhow) so just disable it globally for now. */ #if wxCHECK_VISUALC_VERSION(7) /* conversion from 'size_t' to 'unsigned long', possible loss of data */ #pragma warning(disable:4267) #endif /* VC++ 7 or later */ /* VC++ 8 gives a warning when using standard functions such as sprintf, localtime, ... -- stop this madness, unless the user had already done it */ #if wxCHECK_VISUALC_VERSION(8) #ifndef _CRT_SECURE_NO_DEPRECATE #define _CRT_SECURE_NO_DEPRECATE 1 #endif #ifndef _CRT_NON_CONFORMING_SWPRINTFS #define _CRT_NON_CONFORMING_SWPRINTFS 1 #endif #ifndef _SCL_SECURE_NO_WARNINGS #define _SCL_SECURE_NO_WARNINGS 1 #endif #endif /* VC++ 8 */ #endif /* __VISUALC__ */ /* suppress some Borland C++ warnings */ #ifdef __BORLANDC__ # pragma warn -inl /* Functions containing reserved words and certain constructs are not expanded inline */ #endif /* __BORLANDC__ */ /* g++ gives a warning when a class has private dtor if it has no friends but this is a perfectly valid situation for a ref-counted class which destroys itself when its ref count drops to 0, so provide a macro to suppress this warning */ #ifdef __GNUG__ # define wxSUPPRESS_GCC_PRIVATE_DTOR_WARNING(name) \ friend class wxDummyFriendFor ## name; #else /* !g++ */ # define wxSUPPRESS_GCC_PRIVATE_DTOR_WARNING(name) #endif /* Clang Support */ #ifndef WX_HAS_CLANG_FEATURE # ifndef __has_feature # define WX_HAS_CLANG_FEATURE(x) 0 # else # define WX_HAS_CLANG_FEATURE(x) __has_feature(x) # endif #endif /* ---------------------------------------------------------------------------- */ /* wxWidgets version and compatibility defines */ /* ---------------------------------------------------------------------------- */ #include "wx/version.h" /* ============================================================================ */ /* non portable C++ features */ /* ============================================================================ */ /* ---------------------------------------------------------------------------- */ /* compiler defects workarounds */ /* ---------------------------------------------------------------------------- */ /* Digital Unix C++ compiler only defines this symbol for .cxx and .hxx files, so define it ourselves (newer versions do it for all files, though, and don't allow it to be redefined) */ #if defined(__DECCXX) && !defined(__VMS) && !defined(__cplusplus) #define __cplusplus #endif /* __DECCXX */ /* Resolves linking problems under HP-UX when compiling with gcc/g++ */ #if defined(__HPUX__) && defined(__GNUG__) #define va_list __gnuc_va_list #endif /* HP-UX */ /* Prevents conflicts between sys/types.h and winsock.h with Cygwin, */ /* when using Windows sockets. */ #if defined(__CYGWIN__) && defined(__WINDOWS__) #define __USE_W32_SOCKETS #endif /* ---------------------------------------------------------------------------- */ /* check for native bool type and TRUE/FALSE constants */ /* ---------------------------------------------------------------------------- */ /* for backwards compatibility, also define TRUE and FALSE */ /* */ /* note that these definitions should work both in C++ and C code, so don't */ /* use true/false below */ #ifndef TRUE #define TRUE 1 #endif #ifndef FALSE #define FALSE 0 #endif typedef short int WXTYPE; /* ---------------------------------------------------------------------------- */ /* other feature tests */ /* ---------------------------------------------------------------------------- */ #ifdef __cplusplus /* Every ride down a slippery slope begins with a single step.. */ /* */ /* Yes, using nested classes is indeed against our coding standards in */ /* general, but there are places where you can use them to advantage */ /* without totally breaking ports that cannot use them. If you do, then */ /* wrap it in this guard, but such cases should still be relatively rare. */ #define wxUSE_NESTED_CLASSES 1 /* This macro is obsolete, use the 'explicit' keyword in the new code. */ #define wxEXPLICIT explicit /* check for override keyword support */ #ifndef HAVE_OVERRIDE #if __cplusplus >= 201103L /* All C++11 compilers should have it. */ #define HAVE_OVERRIDE #elif wxCHECK_VISUALC_VERSION(11) /* VC++ supports override keyword since version 8 but doesn't define __cplusplus as indicating C++11 support (at least up to and including 12), so handle its case specially. Also note that while the keyword is supported, using it with versions 8, 9 and 10 results in C4481 compiler warning ("nonstandard extension used") and so we avoid using it there, you could disable this warning and predefine HAVE_OVERRIDE if you don't care about it. */ #define HAVE_OVERRIDE #elif WX_HAS_CLANG_FEATURE(cxx_override_control) #define HAVE_OVERRIDE #endif #endif /* !HAVE_OVERRIDE */ #ifdef HAVE_OVERRIDE #define wxOVERRIDE override #else /* !HAVE_OVERRIDE */ #define wxOVERRIDE #endif /* HAVE_OVERRIDE */ /* wxFALLTHROUGH is used to notate explicit fallthroughs in switch statements */ #if __cplusplus >= 201703L #define wxFALLTHROUGH [[fallthrough]] #elif __cplusplus >= 201103L && defined(__has_warning) && WX_HAS_CLANG_FEATURE(cxx_attributes) #define wxFALLTHROUGH [[clang::fallthrough]] #elif wxCHECK_GCC_VERSION(7, 0) #define wxFALLTHROUGH __attribute__ ((fallthrough)) #endif #ifndef wxFALLTHROUGH #define wxFALLTHROUGH ((void)0) #endif /* these macros are obsolete, use the standard C++ casts directly now */ #define wx_static_cast(t, x) static_cast<t>(x) #define wx_const_cast(t, x) const_cast<t>(x) #define wx_reinterpret_cast(t, x) reinterpret_cast<t>(x) /* This one is a wx invention: like static cast but used when we intentionally truncate from a larger to smaller type, static_cast<> can't be used for it as it results in warnings when using some compilers (SGI mipspro for example) */ #if defined(__INTELC__) template <typename T, typename X> inline T wx_truncate_cast_impl(X x) { #pragma warning(push) /* implicit conversion of a 64-bit integral type to a smaller integral type */ #pragma warning(disable: 1682) /* conversion from "X" to "T" may lose significant bits */ #pragma warning(disable: 810) /* non-pointer conversion from "foo" to "bar" may lose significant bits */ #pragma warning(disable: 2259) return x; #pragma warning(pop) } #define wx_truncate_cast(t, x) wx_truncate_cast_impl<t>(x) #elif defined(__VISUALC__) && __VISUALC__ >= 1310 template <typename T, typename X> inline T wx_truncate_cast_impl(X x) { #pragma warning(push) /* conversion from 'size_t' to 'type', possible loss of data */ #pragma warning(disable: 4267) /* conversion from 'type1' to 'type2', possible loss of data */ #pragma warning(disable: 4242) return x; #pragma warning(pop) } #define wx_truncate_cast(t, x) wx_truncate_cast_impl<t>(x) #else #define wx_truncate_cast(t, x) ((t)(x)) #endif /* for consistency with wxStatic/DynamicCast defined in wx/object.h */ #define wxConstCast(obj, className) const_cast<className *>(obj) #ifndef HAVE_STD_WSTRING #if __cplusplus >= 201103L #define HAVE_STD_WSTRING #elif defined(__VISUALC__) #define HAVE_STD_WSTRING #elif defined(__MINGW32__) #define HAVE_STD_WSTRING #endif #endif #ifndef HAVE_STD_STRING_COMPARE #if __cplusplus >= 201103L #define HAVE_STD_STRING_COMPARE #elif defined(__VISUALC__) #define HAVE_STD_STRING_COMPARE #elif defined(__MINGW32__) || defined(__CYGWIN32__) #define HAVE_STD_STRING_COMPARE #endif #endif #ifndef HAVE_TR1_TYPE_TRAITS #if defined(__VISUALC__) && (_MSC_FULL_VER >= 150030729) #define HAVE_TR1_TYPE_TRAITS #endif #endif /* If using configure, stick to the options detected by it even if different compiler options could result in detecting something different here, as it would cause ABI issues otherwise (see #18034). */ #ifndef __WX_SETUP_H__ /* Check for C++11 compilers, it is important to do it before the __has_include() checks because at least g++ 4.9.2+ __has_include() returns true for C++11 headers which can't be compiled in non-C++11 mode. */ #if __cplusplus >= 201103L || wxCHECK_VISUALC_VERSION(10) #ifndef HAVE_TYPE_TRAITS #define HAVE_TYPE_TRAITS #endif #ifndef HAVE_STD_UNORDERED_MAP #define HAVE_STD_UNORDERED_MAP #endif #ifndef HAVE_STD_UNORDERED_SET #define HAVE_STD_UNORDERED_SET #endif #elif defined(__has_include) /* We're in non-C++11 mode here, so only test for pre-C++11 headers. As mentioned above, using __has_include() to test for C++11 would wrongly detect them even though they can't be used in this case, don't do it. */ #if !defined(HAVE_TR1_TYPE_TRAITS) && __has_include(<tr1/type_traits>) #define HAVE_TR1_TYPE_TRAITS #endif #if !defined(HAVE_TR1_UNORDERED_MAP) && __has_include(<tr1/unordered_map>) #define HAVE_TR1_UNORDERED_MAP #endif #if !defined(HAVE_TR1_UNORDERED_SET) && __has_include(<tr1/unordered_set>) #define HAVE_TR1_UNORDERED_SET #endif #endif /* defined(__has_include) */ #endif /* __cplusplus */ #endif /* __WX_SETUP_H__ */ /* provide replacement for C99 va_copy() if the compiler doesn't have it */ /* could be already defined by configure or the user */ #ifndef wxVaCopy /* if va_copy is a macro or configure detected that we have it, use it */ #if defined(va_copy) || defined(HAVE_VA_COPY) #define wxVaCopy va_copy #else /* no va_copy, try to provide a replacement */ /* configure tries to determine whether va_list is an array or struct type, but it may not be used under Windows, so deal with a few special cases. */ #if defined(__PPC__) && (defined(_CALL_SYSV) || defined (_WIN32)) /* PPC using SysV ABI and NT/PPC are special in that they use an extra level of indirection. */ #define VA_LIST_IS_POINTER #endif /* SysV or Win32 on __PPC__ */ /* note that we use memmove(), not memcpy(), in case anybody tries to do wxVaCopy(ap, ap) */ #if defined(VA_LIST_IS_POINTER) #define wxVaCopy(d, s) memmove(*(d), *(s), sizeof(va_list)) #elif defined(VA_LIST_IS_ARRAY) #define wxVaCopy(d, s) memmove((d), (s), sizeof(va_list)) #else /* we can only hope that va_lists are simple lvalues */ #define wxVaCopy(d, s) ((d) = (s)) #endif #endif /* va_copy/!va_copy */ #endif /* wxVaCopy */ #ifndef HAVE_WOSTREAM /* Mingw <= 3.4 and all versions of Cygwin don't have std::wostream */ #if (defined(__MINGW32__) && !wxCHECK_GCC_VERSION(4, 0)) || \ defined(__CYGWIN__) #define wxNO_WOSTREAM #endif /* VC++ doesn't have it in the old iostream library */ #if defined(__VISUALC__) && wxUSE_IOSTREAMH #define wxNO_WOSTREAM #endif #ifndef wxNO_WOSTREAM #define HAVE_WOSTREAM #endif #undef wxNO_WOSTREAM #endif /* HAVE_WOSTREAM */ /* ---------------------------------------------------------------------------- */ /* portable calling conventions macros */ /* ---------------------------------------------------------------------------- */ /* stdcall is used for all functions called by Windows under Windows */ #if defined(__WINDOWS__) #if defined(__GNUWIN32__) #define wxSTDCALL __attribute__((stdcall)) #else /* both VC++ and Borland understand this */ #define wxSTDCALL _stdcall #endif #else /* Win */ /* no such stupidness under Unix */ #define wxSTDCALL #endif /* platform */ /* LINKAGEMODE mode is most likely empty everywhere */ #ifndef LINKAGEMODE #define LINKAGEMODE #endif /* LINKAGEMODE */ /* wxCALLBACK should be used for the functions which are called back by */ /* Windows (such as compare function for wxListCtrl) */ #if defined(__WIN32__) #define wxCALLBACK wxSTDCALL #else /* no stdcall under Unix nor Win16 */ #define wxCALLBACK #endif /* platform */ /* generic calling convention for the extern "C" functions */ #if defined(__VISUALC__) #define wxC_CALLING_CONV _cdecl #else /* !Visual C++ */ #define wxC_CALLING_CONV #endif /* compiler */ /* callling convention for the qsort(3) callback */ #define wxCMPFUNC_CONV wxC_CALLING_CONV /* compatibility :-( */ #define CMPFUNC_CONV wxCMPFUNC_CONV /* DLL import/export declarations */ #include "wx/dlimpexp.h" /* ---------------------------------------------------------------------------- */ /* Very common macros */ /* ---------------------------------------------------------------------------- */ /* Printf-like attribute definitions to obtain warnings with GNU C/C++ */ #ifndef WX_ATTRIBUTE_PRINTF # if defined(__GNUC__) && !wxUSE_UNICODE # define WX_ATTRIBUTE_PRINTF(m, n) __attribute__ ((__format__ (__printf__, m, n))) # else # define WX_ATTRIBUTE_PRINTF(m, n) # endif # define WX_ATTRIBUTE_PRINTF_1 WX_ATTRIBUTE_PRINTF(1, 2) # define WX_ATTRIBUTE_PRINTF_2 WX_ATTRIBUTE_PRINTF(2, 3) # define WX_ATTRIBUTE_PRINTF_3 WX_ATTRIBUTE_PRINTF(3, 4) # define WX_ATTRIBUTE_PRINTF_4 WX_ATTRIBUTE_PRINTF(4, 5) # define WX_ATTRIBUTE_PRINTF_5 WX_ATTRIBUTE_PRINTF(5, 6) #endif /* !defined(WX_ATTRIBUTE_PRINTF) */ #ifndef WX_ATTRIBUTE_NORETURN # if WX_HAS_CLANG_FEATURE(attribute_analyzer_noreturn) # define WX_ATTRIBUTE_NORETURN __attribute__((analyzer_noreturn)) # elif defined( __GNUC__ ) # define WX_ATTRIBUTE_NORETURN __attribute__ ((noreturn)) # elif defined(__VISUALC__) # define WX_ATTRIBUTE_NORETURN __declspec(noreturn) # else # define WX_ATTRIBUTE_NORETURN # endif #endif #if defined(__GNUC__) #define WX_ATTRIBUTE_UNUSED __attribute__ ((unused)) #else #define WX_ATTRIBUTE_UNUSED #endif /* Macros for marking functions as being deprecated. The preferred macro in the new code is wxDEPRECATED_MSG() which allows to explain why is the function deprecated. Almost all the existing code uses the older wxDEPRECATED() or its variants currently, but this will hopefully change in the future. */ /* The basic compiler-specific construct to generate a deprecation warning. */ #ifdef __clang__ #define wxDEPRECATED_DECL __attribute__((deprecated)) #elif defined(__GNUC__) #define wxDEPRECATED_DECL __attribute__((deprecated)) #elif defined(__VISUALC__) #define wxDEPRECATED_DECL __declspec(deprecated) #else #define wxDEPRECATED_DECL #endif /* Macro taking the deprecation message. It applies to the next declaration. If the compiler doesn't support showing the message, this degrades to a simple wxDEPRECATED(), i.e. at least gives a warning, if possible. */ #if defined(__clang__) && defined(__has_extension) #if __has_extension(attribute_deprecated_with_message) #define wxDEPRECATED_MSG(msg) __attribute__((deprecated(msg))) #else #define wxDEPRECATED_MSG(msg) __attribute__((deprecated)) #endif #elif wxCHECK_GCC_VERSION(4, 5) #define wxDEPRECATED_MSG(msg) __attribute__((deprecated(msg))) #elif wxCHECK_VISUALC_VERSION(8) #define wxDEPRECATED_MSG(msg) __declspec(deprecated("deprecated: " msg)) #else #define wxDEPRECATED_MSG(msg) wxDEPRECATED_DECL #endif /* Macro taking the declaration that it deprecates. Prefer to use wxDEPRECATED_MSG() instead as it's simpler (wrapping the entire declaration makes the code unclear) and allows to specify the explanation. */ #define wxDEPRECATED(x) wxDEPRECATED_DECL x #if defined(__GNUC__) && !wxCHECK_GCC_VERSION(3, 4) /* We need to add dummy "inline" to allow gcc < 3.4 to handle the deprecation attribute on the constructors. */ #define wxDEPRECATED_CONSTRUCTOR(x) wxDEPRECATED( inline x) #else #define wxDEPRECATED_CONSTRUCTOR(x) wxDEPRECATED(x) #endif /* Macro which marks the function as being deprecated but also defines it inline. Currently it's defined in the same trivial way in all cases but it could need a special definition with some other compilers in the future which explains why do we have it. */ #define wxDEPRECATED_INLINE(func, body) wxDEPRECATED(func) { body } /* A macro to define a simple deprecated accessor. */ #define wxDEPRECATED_ACCESSOR(func, what) wxDEPRECATED_INLINE(func, return what;) /* Special variant of the macro above which should be used for the functions which are deprecated but called by wx itself: this often happens with deprecated virtual functions which are called by the library. */ #ifdef WXBUILDING # define wxDEPRECATED_BUT_USED_INTERNALLY(x) x #else # define wxDEPRECATED_BUT_USED_INTERNALLY(x) wxDEPRECATED(x) #endif /* Macros to suppress and restore gcc warnings, requires g++ >= 4.6 and don't do anything otherwise. Example of use: wxGCC_WARNING_SUPPRESS(float-equal) inline bool wxIsSameDouble(double x, double y) { return x == y; } wxGCC_WARNING_RESTORE(float-equal) */ #if defined(__clang__) || wxCHECK_GCC_VERSION(4, 6) # define wxGCC_WARNING_SUPPRESS(x) \ _Pragma (wxSTRINGIZE(GCC diagnostic push)) \ _Pragma (wxSTRINGIZE(GCC diagnostic ignored wxSTRINGIZE(wxCONCAT(-W,x)))) # define wxGCC_WARNING_RESTORE(x) \ _Pragma (wxSTRINGIZE(GCC diagnostic pop)) #else /* gcc < 4.6 or not gcc and not clang at all */ # define wxGCC_WARNING_SUPPRESS(x) # define wxGCC_WARNING_RESTORE(x) #endif /* Specific macros for -Wcast-function-type warning new in gcc 8. */ #if wxCHECK_GCC_VERSION(8, 0) #define wxGCC_WARNING_SUPPRESS_CAST_FUNCTION_TYPE() \ wxGCC_WARNING_SUPPRESS(cast-function-type) #define wxGCC_WARNING_RESTORE_CAST_FUNCTION_TYPE() \ wxGCC_WARNING_RESTORE(cast-function-type) #else #define wxGCC_WARNING_SUPPRESS_CAST_FUNCTION_TYPE() #define wxGCC_WARNING_RESTORE_CAST_FUNCTION_TYPE() #endif /* Macros to suppress and restore clang warning only when it is valid. Example: wxCLANG_WARNING_SUPPRESS(inconsistent-missing-override) virtual wxClassInfo *GetClassInfo() const wxCLANG_WARNING_RESTORE(inconsistent-missing-override) */ #if defined(__clang__) && defined(__has_warning) # define wxCLANG_HAS_WARNING(x) __has_warning(x) /* allow macro expansion for the warning name */ # define wxCLANG_IF_VALID_WARNING(x,y) \ wxCONCAT(wxCLANG_IF_VALID_WARNING_,wxCLANG_HAS_WARNING(wxSTRINGIZE(wxCONCAT(-W,x))))(y) # define wxCLANG_IF_VALID_WARNING_0(x) # define wxCLANG_IF_VALID_WARNING_1(x) x # define wxCLANG_WARNING_SUPPRESS(x) \ wxCLANG_IF_VALID_WARNING(x,wxGCC_WARNING_SUPPRESS(x)) # define wxCLANG_WARNING_RESTORE(x) \ wxCLANG_IF_VALID_WARNING(x,wxGCC_WARNING_RESTORE(x)) #else # define wxCLANG_WARNING_SUPPRESS(x) # define wxCLANG_WARNING_RESTORE(x) #endif /* Combination of the two variants above: should be used for deprecated functions which are defined inline and are used by wxWidgets itself. */ #ifdef WXBUILDING # define wxDEPRECATED_BUT_USED_INTERNALLY_INLINE(func, body) func { body } #else # define wxDEPRECATED_BUT_USED_INTERNALLY_INLINE(func, body) \ wxDEPRECATED(func) { body } #endif /* NULL declaration: it must be defined as 0 for C++ programs (in particular, */ /* it must not be defined as "(void *)0" which is standard for C but completely */ /* breaks C++ code) */ #include <stddef.h> /* size of statically declared array */ #define WXSIZEOF(array) (sizeof(array)/sizeof(array[0])) /* symbolic constant used by all Find()-like functions returning positive */ /* integer on success as failure indicator */ #define wxNOT_FOUND (-1) /* the default value for some length parameters meaning that the string is */ /* NUL-terminated */ #define wxNO_LEN ((size_t)-1) /* ---------------------------------------------------------------------------- */ /* macros dealing with comparison operators */ /* ---------------------------------------------------------------------------- */ /* Expands into m(op, args...) for each op in the set { ==, !=, <, <=, >, >= }. */ #define wxFOR_ALL_COMPARISONS(m) \ m(==) m(!=) m(>=) m(<=) m(>) m(<) #define wxFOR_ALL_COMPARISONS_1(m, x) \ m(==,x) m(!=,x) m(>=,x) m(<=,x) m(>,x) m(<,x) #define wxFOR_ALL_COMPARISONS_2(m, x, y) \ m(==,x,y) m(!=,x,y) m(>=,x,y) m(<=,x,y) m(>,x,y) m(<,x,y) #define wxFOR_ALL_COMPARISONS_3(m, x, y, z) \ m(==,x,y,z) m(!=,x,y,z) m(>=,x,y,z) m(<=,x,y,z) m(>,x,y,z) m(<,x,y,z) /* These are only used with wxDEFINE_COMPARISON_[BY_]REV: they pass both the normal and the reversed comparison operators to the macro. */ #define wxFOR_ALL_COMPARISONS_2_REV(m, x, y) \ m(==,x,y,==) m(!=,x,y,!=) m(>=,x,y,<=) \ m(<=,x,y,>=) m(>,x,y,<) m(<,x,y,>) #define wxFOR_ALL_COMPARISONS_3_REV(m, x, y, z) \ m(==,x,y,z,==) m(!=,x,y,z,!=) m(>=,x,y,z,<=) \ m(<=,x,y,z,>=) m(>,x,y,z,<) m(<,x,y,z,>) #define wxDEFINE_COMPARISON(op, T1, T2, cmp) \ inline bool operator op(T1 x, T2 y) { return cmp(x, y, op); } #define wxDEFINE_COMPARISON_REV(op, T1, T2, cmp, oprev) \ inline bool operator op(T2 y, T1 x) { return cmp(x, y, oprev); } #define wxDEFINE_COMPARISON_BY_REV(op, T1, T2, oprev) \ inline bool operator op(T1 x, T2 y) { return y oprev x; } /* Define all 6 comparison operators (==, !=, <, <=, >, >=) for the given types in the specified order. The implementation is provided by the cmp macro. Normally wxDEFINE_ALL_COMPARISONS should be used as comparison operators are usually symmetric. */ #define wxDEFINE_COMPARISONS(T1, T2, cmp) \ wxFOR_ALL_COMPARISONS_3(wxDEFINE_COMPARISON, T1, T2, cmp) /* Define all 6 comparison operators (==, !=, <, <=, >, >=) for the given types in the specified order, implemented in terms of existing operators for the reverse order. */ #define wxDEFINE_COMPARISONS_BY_REV(T1, T2) \ wxFOR_ALL_COMPARISONS_2_REV(wxDEFINE_COMPARISON_BY_REV, T1, T2) /* This macro allows to define all 12 comparison operators (6 operators for both orders of arguments) for the given types using the provided "cmp" macro to implement the actual comparison: the macro is called with the 2 arguments names, the first of type T1 and the second of type T2, and the comparison operator being implemented. */ #define wxDEFINE_ALL_COMPARISONS(T1, T2, cmp) \ wxFOR_ALL_COMPARISONS_3(wxDEFINE_COMPARISON, T1, T2, cmp) \ wxFOR_ALL_COMPARISONS_3_REV(wxDEFINE_COMPARISON_REV, T1, T2, cmp) /* ---------------------------------------------------------------------------- */ /* macros to avoid compiler warnings */ /* ---------------------------------------------------------------------------- */ /* Macro to cut down on compiler warnings. */ #if 1 /* there should be no more any compilers needing the "#else" version */ #define WXUNUSED(identifier) /* identifier */ #else /* stupid, broken compiler */ #define WXUNUSED(identifier) identifier #endif /* some arguments are not used in unicode mode */ #if wxUSE_UNICODE #define WXUNUSED_IN_UNICODE(param) WXUNUSED(param) #else #define WXUNUSED_IN_UNICODE(param) param #endif /* unused parameters in non stream builds */ #if wxUSE_STREAMS #define WXUNUSED_UNLESS_STREAMS(param) param #else #define WXUNUSED_UNLESS_STREAMS(param) WXUNUSED(param) #endif /* some compilers give warning about a possibly unused variable if it is */ /* initialized in both branches of if/else and shut up if it is initialized */ /* when declared, but other compilers then give warnings about unused variable */ /* value -- this should satisfy both of them */ #if defined(__VISUALC__) #define wxDUMMY_INITIALIZE(val) = val #else #define wxDUMMY_INITIALIZE(val) #endif /* sometimes the value of a variable is *really* not used, to suppress the */ /* resulting warning you may pass it to this function */ #ifdef __cplusplus # ifdef __BORLANDC__ # define wxUnusedVar(identifier) identifier # else template <class T> inline void wxUnusedVar(const T& WXUNUSED(t)) { } # endif #endif /* ---------------------------------------------------------------------------- */ /* compiler specific settings */ /* ---------------------------------------------------------------------------- */ /* where should i put this? we need to make sure of this as it breaks */ /* the <iostream> code. */ #if !wxUSE_IOSTREAMH && defined(__WXDEBUG__) # undef wxUSE_DEBUG_NEW_ALWAYS # define wxUSE_DEBUG_NEW_ALWAYS 0 #endif #include "wx/types.h" #ifdef __cplusplus // everybody gets the assert and other debug macros #include "wx/debug.h" // delete pointer if it is not NULL and NULL it afterwards template <typename T> inline void wxDELETE(T*& ptr) { typedef char TypeIsCompleteCheck[sizeof(T)] WX_ATTRIBUTE_UNUSED; if ( ptr != NULL ) { delete ptr; ptr = NULL; } } // delete an array and NULL it (see comments above) template <typename T> inline void wxDELETEA(T*& ptr) { typedef char TypeIsCompleteCheck[sizeof(T)] WX_ATTRIBUTE_UNUSED; if ( ptr != NULL ) { delete [] ptr; ptr = NULL; } } // trivial implementation of std::swap() for primitive types template <typename T> inline void wxSwap(T& first, T& second) { T tmp(first); first = second; second = tmp; } /* And also define a couple of simple functions to cast pointer to/from it. */ inline wxUIntPtr wxPtrToUInt(const void *p) { /* VC++ 7.1 gives warnings about casts such as below even when they're explicit with /Wp64 option, suppress them as we really know what we're doing here. Same thing with icc with -Wall. */ #ifdef __VISUALC__ #pragma warning(push) /* pointer truncation from '' to '' */ #pragma warning(disable: 4311) #elif defined(__INTELC__) #pragma warning(push) /* conversion from pointer to same-sized integral type */ #pragma warning(disable: 1684) #endif return reinterpret_cast<wxUIntPtr>(p); #if defined(__VISUALC__) || defined(__INTELC__) #pragma warning(pop) #endif } inline void *wxUIntToPtr(wxUIntPtr p) { #ifdef __VISUALC__ #pragma warning(push) /* conversion to type of greater size */ #pragma warning(disable: 4312) #elif defined(__INTELC__) #pragma warning(push) /* invalid type conversion: "wxUIntPtr={unsigned long}" to "void *" */ #pragma warning(disable: 171) #endif return reinterpret_cast<void *>(p); #if defined(__VISUALC__) || defined(__INTELC__) #pragma warning(pop) #endif } #endif /*__cplusplus*/ /* base floating point types */ /* wxFloat32: 32 bit IEEE float ( 1 sign, 8 exponent bits, 23 fraction bits ) */ /* wxFloat64: 64 bit IEEE float ( 1 sign, 11 exponent bits, 52 fraction bits ) */ /* wxDouble: native fastest representation that has at least wxFloat64 */ /* precision, so use the IEEE types for storage, and this for */ /* calculations */ typedef float wxFloat32; typedef double wxFloat64; typedef double wxDouble; /* Some (non standard) compilers typedef wchar_t as an existing type instead of treating it as a real fundamental type, set wxWCHAR_T_IS_REAL_TYPE to 0 for them and to 1 for all the others. */ #ifndef wxWCHAR_T_IS_REAL_TYPE /* VC++ typedefs wchar_t as unsigned short by default until VC8, that is unless /Za or /Zc:wchar_t option is used in which case _WCHAR_T_DEFINED is defined. */ # if defined(__VISUALC__) && !defined(_NATIVE_WCHAR_T_DEFINED) # define wxWCHAR_T_IS_REAL_TYPE 0 # else /* compiler having standard-conforming wchar_t */ # define wxWCHAR_T_IS_REAL_TYPE 1 # endif #endif /* !defined(wxWCHAR_T_IS_REAL_TYPE) */ /* Helper macro for doing something dependent on whether wchar_t is or isn't a typedef inside another macro. */ #if wxWCHAR_T_IS_REAL_TYPE #define wxIF_WCHAR_T_TYPE(x) x #else /* !wxWCHAR_T_IS_REAL_TYPE */ #define wxIF_WCHAR_T_TYPE(x) #endif /* wxWCHAR_T_IS_REAL_TYPE/!wxWCHAR_T_IS_REAL_TYPE */ /* This constant should be used instead of NULL in vararg functions taking wxChar* arguments: passing NULL (which is the same as 0, unless the compiler defines it specially, e.g. like gcc does with its __null built-in) doesn't work in this case as va_arg() wouldn't interpret the integer 0 correctly when trying to convert it to a pointer on architectures where sizeof(int) is strictly less than sizeof(void *). Examples of places where this must be used include wxFileTypeInfo ctor. */ #define wxNullPtr ((void *)NULL) /* Define wxChar16 and wxChar32 */ #if SIZEOF_WCHAR_T == 2 #define wxWCHAR_T_IS_WXCHAR16 typedef wchar_t wxChar16; #else typedef wxUint16 wxChar16; #endif #if SIZEOF_WCHAR_T == 4 #define wxWCHAR_T_IS_WXCHAR32 typedef wchar_t wxChar32; #else typedef wxUint32 wxChar32; #endif /* Helper macro expanding into the given "m" macro invoked with each of the integer types as parameter (notice that this does not include char/unsigned char and bool but does include wchar_t). */ #define wxDO_FOR_INT_TYPES(m) \ m(short) \ m(unsigned short) \ m(int) \ m(unsigned int) \ m(long) \ m(unsigned long) \ wxIF_LONG_LONG_TYPE( m(wxLongLong_t) ) \ wxIF_LONG_LONG_TYPE( m(wxULongLong_t) ) \ wxIF_WCHAR_T_TYPE( m(wchar_t) ) /* Same as wxDO_FOR_INT_TYPES() but does include char and unsigned char. Notice that we use "char" and "unsigned char" here but not "signed char" which would be more correct as "char" could be unsigned by default. But wxWidgets code currently supposes that char is signed and we'd need to clean up assumptions about it, notably in wx/unichar.h, to be able to use "signed char" here. */ #define wxDO_FOR_CHAR_INT_TYPES(m) \ m(char) \ m(unsigned char) \ wxDO_FOR_INT_TYPES(m) /* Same as wxDO_FOR_INT_TYPES() above except that m macro takes the type as the first argument and some extra argument, passed from this macro itself, as the second one. */ #define wxDO_FOR_INT_TYPES_1(m, arg) \ m(short, arg) \ m(unsigned short, arg) \ m(int, arg) \ m(unsigned int, arg) \ m(long, arg) \ m(unsigned long, arg) \ wxIF_LONG_LONG_TYPE( m(wxLongLong_t, arg) ) \ wxIF_LONG_LONG_TYPE( m(wxULongLong_t, arg) ) \ wxIF_WCHAR_T_TYPE( m(wchar_t, arg) ) /* Combination of wxDO_FOR_CHAR_INT_TYPES() and wxDO_FOR_INT_TYPES_1(): invokes the given macro with the specified argument as its second parameter for all char and int types. */ #define wxDO_FOR_CHAR_INT_TYPES_1(m, arg) \ m(char, arg) \ m(unsigned char, arg) \ wxDO_FOR_INT_TYPES_1(m, arg) /* ---------------------------------------------------------------------------- */ /* byte ordering related definition and macros */ /* ---------------------------------------------------------------------------- */ /* byte sex */ #define wxBIG_ENDIAN 4321 #define wxLITTLE_ENDIAN 1234 #define wxPDP_ENDIAN 3412 #ifdef WORDS_BIGENDIAN #define wxBYTE_ORDER wxBIG_ENDIAN #else #define wxBYTE_ORDER wxLITTLE_ENDIAN #endif /* byte swapping */ #define wxUINT16_SWAP_ALWAYS(val) \ ((wxUint16) ( \ (((wxUint16) (val) & (wxUint16) 0x00ffU) << 8) | \ (((wxUint16) (val) & (wxUint16) 0xff00U) >> 8))) #define wxINT16_SWAP_ALWAYS(val) \ ((wxInt16) ( \ (((wxUint16) (val) & (wxUint16) 0x00ffU) << 8) | \ (((wxUint16) (val) & (wxUint16) 0xff00U) >> 8))) #define wxUINT32_SWAP_ALWAYS(val) \ ((wxUint32) ( \ (((wxUint32) (val) & (wxUint32) 0x000000ffU) << 24) | \ (((wxUint32) (val) & (wxUint32) 0x0000ff00U) << 8) | \ (((wxUint32) (val) & (wxUint32) 0x00ff0000U) >> 8) | \ (((wxUint32) (val) & (wxUint32) 0xff000000U) >> 24))) #define wxINT32_SWAP_ALWAYS(val) \ ((wxInt32) ( \ (((wxUint32) (val) & (wxUint32) 0x000000ffU) << 24) | \ (((wxUint32) (val) & (wxUint32) 0x0000ff00U) << 8) | \ (((wxUint32) (val) & (wxUint32) 0x00ff0000U) >> 8) | \ (((wxUint32) (val) & (wxUint32) 0xff000000U) >> 24))) /* machine specific byte swapping */ #ifdef wxLongLong_t #define wxUINT64_SWAP_ALWAYS(val) \ ((wxUint64) ( \ (((wxUint64) (val) & (wxUint64) wxULL(0x00000000000000ff)) << 56) | \ (((wxUint64) (val) & (wxUint64) wxULL(0x000000000000ff00)) << 40) | \ (((wxUint64) (val) & (wxUint64) wxULL(0x0000000000ff0000)) << 24) | \ (((wxUint64) (val) & (wxUint64) wxULL(0x00000000ff000000)) << 8) | \ (((wxUint64) (val) & (wxUint64) wxULL(0x000000ff00000000)) >> 8) | \ (((wxUint64) (val) & (wxUint64) wxULL(0x0000ff0000000000)) >> 24) | \ (((wxUint64) (val) & (wxUint64) wxULL(0x00ff000000000000)) >> 40) | \ (((wxUint64) (val) & (wxUint64) wxULL(0xff00000000000000)) >> 56))) #define wxINT64_SWAP_ALWAYS(val) \ ((wxInt64) ( \ (((wxUint64) (val) & (wxUint64) wxULL(0x00000000000000ff)) << 56) | \ (((wxUint64) (val) & (wxUint64) wxULL(0x000000000000ff00)) << 40) | \ (((wxUint64) (val) & (wxUint64) wxULL(0x0000000000ff0000)) << 24) | \ (((wxUint64) (val) & (wxUint64) wxULL(0x00000000ff000000)) << 8) | \ (((wxUint64) (val) & (wxUint64) wxULL(0x000000ff00000000)) >> 8) | \ (((wxUint64) (val) & (wxUint64) wxULL(0x0000ff0000000000)) >> 24) | \ (((wxUint64) (val) & (wxUint64) wxULL(0x00ff000000000000)) >> 40) | \ (((wxUint64) (val) & (wxUint64) wxULL(0xff00000000000000)) >> 56))) #elif wxUSE_LONGLONG /* !wxLongLong_t */ #define wxUINT64_SWAP_ALWAYS(val) \ ((wxUint64) ( \ ((wxULongLong(val) & wxULongLong(0L, 0x000000ffU)) << 56) | \ ((wxULongLong(val) & wxULongLong(0L, 0x0000ff00U)) << 40) | \ ((wxULongLong(val) & wxULongLong(0L, 0x00ff0000U)) << 24) | \ ((wxULongLong(val) & wxULongLong(0L, 0xff000000U)) << 8) | \ ((wxULongLong(val) & wxULongLong(0x000000ffL, 0U)) >> 8) | \ ((wxULongLong(val) & wxULongLong(0x0000ff00L, 0U)) >> 24) | \ ((wxULongLong(val) & wxULongLong(0x00ff0000L, 0U)) >> 40) | \ ((wxULongLong(val) & wxULongLong(0xff000000L, 0U)) >> 56))) #define wxINT64_SWAP_ALWAYS(val) \ ((wxInt64) ( \ ((wxLongLong(val) & wxLongLong(0L, 0x000000ffU)) << 56) | \ ((wxLongLong(val) & wxLongLong(0L, 0x0000ff00U)) << 40) | \ ((wxLongLong(val) & wxLongLong(0L, 0x00ff0000U)) << 24) | \ ((wxLongLong(val) & wxLongLong(0L, 0xff000000U)) << 8) | \ ((wxLongLong(val) & wxLongLong(0x000000ffL, 0U)) >> 8) | \ ((wxLongLong(val) & wxLongLong(0x0000ff00L, 0U)) >> 24) | \ ((wxLongLong(val) & wxLongLong(0x00ff0000L, 0U)) >> 40) | \ ((wxLongLong(val) & wxLongLong(0xff000000L, 0U)) >> 56))) #endif /* wxLongLong_t/!wxLongLong_t */ #ifdef WORDS_BIGENDIAN #define wxUINT16_SWAP_ON_BE(val) wxUINT16_SWAP_ALWAYS(val) #define wxINT16_SWAP_ON_BE(val) wxINT16_SWAP_ALWAYS(val) #define wxUINT16_SWAP_ON_LE(val) (val) #define wxINT16_SWAP_ON_LE(val) (val) #define wxUINT32_SWAP_ON_BE(val) wxUINT32_SWAP_ALWAYS(val) #define wxINT32_SWAP_ON_BE(val) wxINT32_SWAP_ALWAYS(val) #define wxUINT32_SWAP_ON_LE(val) (val) #define wxINT32_SWAP_ON_LE(val) (val) #if wxHAS_INT64 #define wxUINT64_SWAP_ON_BE(val) wxUINT64_SWAP_ALWAYS(val) #define wxUINT64_SWAP_ON_LE(val) (val) #define wxINT64_SWAP_ON_BE(val) wxINT64_SWAP_ALWAYS(val) #define wxINT64_SWAP_ON_LE(val) (val) #define wxUINT64_SWAP_ON_BE_IN_PLACE(val) val = wxUINT64_SWAP_ALWAYS(val) #define wxINT64_SWAP_ON_BE_IN_PLACE(val) val = wxINT64_SWAP_ALWAYS(val) #define wxUINT64_SWAP_ON_LE_IN_PLACE(val) #define wxINT64_SWAP_ON_LE_IN_PLACE(val) #endif #define wxUINT16_SWAP_ON_BE_IN_PLACE(val) val = wxUINT16_SWAP_ALWAYS(val) #define wxINT16_SWAP_ON_BE_IN_PLACE(val) val = wxINT16_SWAP_ALWAYS(val) #define wxUINT16_SWAP_ON_LE_IN_PLACE(val) #define wxINT16_SWAP_ON_LE_IN_PLACE(val) #define wxUINT32_SWAP_ON_BE_IN_PLACE(val) val = wxUINT32_SWAP_ALWAYS(val) #define wxINT32_SWAP_ON_BE_IN_PLACE(val) val = wxINT32_SWAP_ALWAYS(val) #define wxUINT32_SWAP_ON_LE_IN_PLACE(val) #define wxINT32_SWAP_ON_LE_IN_PLACE(val) #else #define wxUINT16_SWAP_ON_LE(val) wxUINT16_SWAP_ALWAYS(val) #define wxINT16_SWAP_ON_LE(val) wxINT16_SWAP_ALWAYS(val) #define wxUINT16_SWAP_ON_BE(val) (val) #define wxINT16_SWAP_ON_BE(val) (val) #define wxUINT32_SWAP_ON_LE(val) wxUINT32_SWAP_ALWAYS(val) #define wxINT32_SWAP_ON_LE(val) wxINT32_SWAP_ALWAYS(val) #define wxUINT32_SWAP_ON_BE(val) (val) #define wxINT32_SWAP_ON_BE(val) (val) #if wxHAS_INT64 #define wxUINT64_SWAP_ON_LE(val) wxUINT64_SWAP_ALWAYS(val) #define wxUINT64_SWAP_ON_BE(val) (val) #define wxINT64_SWAP_ON_LE(val) wxINT64_SWAP_ALWAYS(val) #define wxINT64_SWAP_ON_BE(val) (val) #define wxUINT64_SWAP_ON_BE_IN_PLACE(val) #define wxINT64_SWAP_ON_BE_IN_PLACE(val) #define wxUINT64_SWAP_ON_LE_IN_PLACE(val) val = wxUINT64_SWAP_ALWAYS(val) #define wxINT64_SWAP_ON_LE_IN_PLACE(val) val = wxINT64_SWAP_ALWAYS(val) #endif #define wxUINT16_SWAP_ON_BE_IN_PLACE(val) #define wxINT16_SWAP_ON_BE_IN_PLACE(val) #define wxUINT16_SWAP_ON_LE_IN_PLACE(val) val = wxUINT16_SWAP_ALWAYS(val) #define wxINT16_SWAP_ON_LE_IN_PLACE(val) val = wxINT16_SWAP_ALWAYS(val) #define wxUINT32_SWAP_ON_BE_IN_PLACE(val) #define wxINT32_SWAP_ON_BE_IN_PLACE(val) #define wxUINT32_SWAP_ON_LE_IN_PLACE(val) val = wxUINT32_SWAP_ALWAYS(val) #define wxINT32_SWAP_ON_LE_IN_PLACE(val) val = wxINT32_SWAP_ALWAYS(val) #endif /* ---------------------------------------------------------------------------- */ /* Geometric flags */ /* ---------------------------------------------------------------------------- */ enum wxGeometryCentre { wxCENTRE = 0x0001, wxCENTER = wxCENTRE }; /* centering into frame rather than screen (obsolete) */ #define wxCENTER_FRAME 0x0000 /* centre on screen rather than parent */ #define wxCENTRE_ON_SCREEN 0x0002 #define wxCENTER_ON_SCREEN wxCENTRE_ON_SCREEN enum wxOrientation { /* don't change the values of these elements, they are used elsewhere */ wxHORIZONTAL = 0x0004, wxVERTICAL = 0x0008, wxBOTH = wxVERTICAL | wxHORIZONTAL, /* a mask to extract orientation from the combination of flags */ wxORIENTATION_MASK = wxBOTH }; enum wxDirection { wxLEFT = 0x0010, wxRIGHT = 0x0020, wxUP = 0x0040, wxDOWN = 0x0080, wxTOP = wxUP, wxBOTTOM = wxDOWN, wxNORTH = wxUP, wxSOUTH = wxDOWN, wxWEST = wxLEFT, wxEAST = wxRIGHT, wxALL = (wxUP | wxDOWN | wxRIGHT | wxLEFT), /* a mask to extract direction from the combination of flags */ wxDIRECTION_MASK = wxALL }; enum wxAlignment { /* 0 is a valid wxAlignment value (both wxALIGN_LEFT and wxALIGN_TOP use it) so define a symbolic name for an invalid alignment value which can be assumed to be different from anything else */ wxALIGN_INVALID = -1, wxALIGN_NOT = 0x0000, wxALIGN_CENTER_HORIZONTAL = 0x0100, wxALIGN_CENTRE_HORIZONTAL = wxALIGN_CENTER_HORIZONTAL, wxALIGN_LEFT = wxALIGN_NOT, wxALIGN_TOP = wxALIGN_NOT, wxALIGN_RIGHT = 0x0200, wxALIGN_BOTTOM = 0x0400, wxALIGN_CENTER_VERTICAL = 0x0800, wxALIGN_CENTRE_VERTICAL = wxALIGN_CENTER_VERTICAL, wxALIGN_CENTER = (wxALIGN_CENTER_HORIZONTAL | wxALIGN_CENTER_VERTICAL), wxALIGN_CENTRE = wxALIGN_CENTER, /* a mask to extract alignment from the combination of flags */ wxALIGN_MASK = 0x0f00 }; /* misc. flags for wxSizer items */ enum wxSizerFlagBits { /* wxADJUST_MINSIZE doesn't do anything any more but we still define it for compatibility. Notice that it may be also predefined (as 0, hopefully) in the user code in order to use it even in !WXWIN_COMPATIBILITY_2_8 builds so don't redefine it in such case. */ #if WXWIN_COMPATIBILITY_2_8 && !defined(wxADJUST_MINSIZE) wxADJUST_MINSIZE = 0, #endif wxFIXED_MINSIZE = 0x8000, wxRESERVE_SPACE_EVEN_IF_HIDDEN = 0x0002, /* a mask to extract wxSizerFlagBits from combination of flags */ wxSIZER_FLAG_BITS_MASK = 0x8002 }; enum wxStretch { wxSTRETCH_NOT = 0x0000, wxSHRINK = 0x1000, wxGROW = 0x2000, wxEXPAND = wxGROW, wxSHAPED = 0x4000, wxTILE = wxSHAPED | wxFIXED_MINSIZE, /* a mask to extract stretch from the combination of flags */ wxSTRETCH_MASK = 0x7000 /* sans wxTILE */ }; /* border flags: the values are chosen for backwards compatibility */ enum wxBorder { /* this is different from wxBORDER_NONE as by default the controls do have */ /* border */ wxBORDER_DEFAULT = 0, wxBORDER_NONE = 0x00200000, wxBORDER_STATIC = 0x01000000, wxBORDER_SIMPLE = 0x02000000, wxBORDER_RAISED = 0x04000000, wxBORDER_SUNKEN = 0x08000000, wxBORDER_DOUBLE = 0x10000000, /* deprecated */ wxBORDER_THEME = wxBORDER_DOUBLE, /* a mask to extract border style from the combination of flags */ wxBORDER_MASK = 0x1f200000 }; /* This makes it easier to specify a 'normal' border for a control */ #define wxDEFAULT_CONTROL_BORDER wxBORDER_SUNKEN /* ---------------------------------------------------------------------------- */ /* Window style flags */ /* ---------------------------------------------------------------------------- */ /* * Values are chosen so they can be |'ed in a bit list. * Some styles are used across more than one group, * so the values mustn't clash with others in the group. * Otherwise, numbers can be reused across groups. */ /* Summary of the bits used by various styles. High word, containing styles which can be used with many windows: +--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+ |31|30|29|28|27|26|25|24|23|22|21|20|19|18|17|16| +--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | \_ wxFULL_REPAINT_ON_RESIZE | | | | | | | | | | | | | | \____ wxPOPUP_WINDOW | | | | | | | | | | | | | \_______ wxWANTS_CHARS | | | | | | | | | | | | \__________ wxTAB_TRAVERSAL | | | | | | | | | | | \_____________ wxTRANSPARENT_WINDOW | | | | | | | | | | \________________ wxBORDER_NONE | | | | | | | | | \___________________ wxCLIP_CHILDREN | | | | | | | | \______________________ wxALWAYS_SHOW_SB | | | | | | | \_________________________ wxBORDER_STATIC | | | | | | \____________________________ wxBORDER_SIMPLE | | | | | \_______________________________ wxBORDER_RAISED | | | | \__________________________________ wxBORDER_SUNKEN | | | \_____________________________________ wxBORDER_{DOUBLE,THEME} | | \________________________________________ wxCAPTION/wxCLIP_SIBLINGS | \___________________________________________ wxHSCROLL \______________________________________________ wxVSCROLL Low word style bits is class-specific meaning that the same bit can have different meanings for different controls (e.g. 0x10 is wxCB_READONLY meaning that the control can't be modified for wxComboBox but wxLB_SORT meaning that the control should be kept sorted for wxListBox, while wxLB_SORT has a different value -- and this is just fine). */ /* * Window (Frame/dialog/subwindow/panel item) style flags */ /* The cast is needed to avoid g++ -Wnarrowing warnings when initializing * values of int type with wxVSCROLL on 32 bit platforms, where its value is * greater than INT_MAX. */ #define wxVSCROLL ((int)0x80000000) #define wxHSCROLL 0x40000000 #define wxCAPTION 0x20000000 /* New styles (border styles are now in their own enum) */ #define wxDOUBLE_BORDER wxBORDER_DOUBLE #define wxSUNKEN_BORDER wxBORDER_SUNKEN #define wxRAISED_BORDER wxBORDER_RAISED #define wxBORDER wxBORDER_SIMPLE #define wxSIMPLE_BORDER wxBORDER_SIMPLE #define wxSTATIC_BORDER wxBORDER_STATIC #define wxNO_BORDER wxBORDER_NONE /* wxALWAYS_SHOW_SB: instead of hiding the scrollbar when it is not needed, */ /* disable it - but still show (see also wxLB_ALWAYS_SB style) */ /* */ /* NB: as this style is only supported by wxUniversal and wxMSW so far */ #define wxALWAYS_SHOW_SB 0x00800000 /* Clip children when painting, which reduces flicker in e.g. frames and */ /* splitter windows, but can't be used in a panel where a static box must be */ /* 'transparent' (panel paints the background for it) */ #define wxCLIP_CHILDREN 0x00400000 /* Note we're reusing the wxCAPTION style because we won't need captions */ /* for subwindows/controls */ #define wxCLIP_SIBLINGS 0x20000000 #define wxTRANSPARENT_WINDOW 0x00100000 /* Add this style to a panel to get tab traversal working outside of dialogs */ /* (on by default for wxPanel, wxDialog, wxScrolledWindow) */ #define wxTAB_TRAVERSAL 0x00080000 /* Add this style if the control wants to get all keyboard messages (under */ /* Windows, it won't normally get the dialog navigation key events) */ #define wxWANTS_CHARS 0x00040000 /* Make window retained (Motif only, see src/generic/scrolwing.cpp) * This is non-zero only under wxMotif, to avoid a clash with wxPOPUP_WINDOW * on other platforms */ #ifdef __WXMOTIF__ #define wxRETAINED 0x00020000 #else #define wxRETAINED 0x00000000 #endif #define wxBACKINGSTORE wxRETAINED /* set this flag to create a special popup window: it will be always shown on */ /* top of other windows, will capture the mouse and will be dismissed when the */ /* mouse is clicked outside of it or if it loses focus in any other way */ #define wxPOPUP_WINDOW 0x00020000 /* force a full repaint when the window is resized (instead of repainting just */ /* the invalidated area) */ #define wxFULL_REPAINT_ON_RESIZE 0x00010000 /* obsolete: now this is the default behaviour */ /* */ /* don't invalidate the whole window (resulting in a PAINT event) when the */ /* window is resized (currently, makes sense for wxMSW only) */ #define wxNO_FULL_REPAINT_ON_RESIZE 0 /* A mask which can be used to filter (out) all wxWindow-specific styles. */ #define wxWINDOW_STYLE_MASK \ (wxVSCROLL|wxHSCROLL|wxBORDER_MASK|wxALWAYS_SHOW_SB|wxCLIP_CHILDREN| \ wxCLIP_SIBLINGS|wxTRANSPARENT_WINDOW|wxTAB_TRAVERSAL|wxWANTS_CHARS| \ wxRETAINED|wxPOPUP_WINDOW|wxFULL_REPAINT_ON_RESIZE) /* * Extra window style flags (use wxWS_EX prefix to make it clear that they * should be passed to wxWindow::SetExtraStyle(), not SetWindowStyle()) */ /* This flag is obsolete as recursive validation is now the default (and only * possible) behaviour. Simply don't use it any more in the new code. */ #define wxWS_EX_VALIDATE_RECURSIVELY 0x00000000 /* used to be 1 */ /* wxCommandEvents and the objects of the derived classes are forwarded to the */ /* parent window and so on recursively by default. Using this flag for the */ /* given window allows to block this propagation at this window, i.e. prevent */ /* the events from being propagated further upwards. The dialogs have this */ /* flag on by default. */ #define wxWS_EX_BLOCK_EVENTS 0x00000002 /* don't use this window as an implicit parent for the other windows: this must */ /* be used with transient windows as otherwise there is the risk of creating a */ /* dialog/frame with this window as a parent which would lead to a crash if the */ /* parent is destroyed before the child */ #define wxWS_EX_TRANSIENT 0x00000004 /* don't paint the window background, we'll assume it will */ /* be done by a theming engine. This is not yet used but could */ /* possibly be made to work in the future, at least on Windows */ #define wxWS_EX_THEMED_BACKGROUND 0x00000008 /* this window should always process idle events */ #define wxWS_EX_PROCESS_IDLE 0x00000010 /* this window should always process UI update events */ #define wxWS_EX_PROCESS_UI_UPDATES 0x00000020 /* Draw the window in a metal theme on Mac */ #define wxFRAME_EX_METAL 0x00000040 #define wxDIALOG_EX_METAL 0x00000040 /* Use this style to add a context-sensitive help to the window (currently for */ /* Win32 only and it doesn't work if wxMINIMIZE_BOX or wxMAXIMIZE_BOX are used) */ #define wxWS_EX_CONTEXTHELP 0x00000080 /* synonyms for wxWS_EX_CONTEXTHELP for compatibility */ #define wxFRAME_EX_CONTEXTHELP wxWS_EX_CONTEXTHELP #define wxDIALOG_EX_CONTEXTHELP wxWS_EX_CONTEXTHELP /* Create a window which is attachable to another top level window */ #define wxFRAME_DRAWER 0x0020 /* * MDI parent frame style flags * Can overlap with some of the above. */ #define wxFRAME_NO_WINDOW_MENU 0x0100 /* * wxMenuBar style flags */ /* use native docking */ #define wxMB_DOCKABLE 0x0001 /* * wxMenu style flags */ #define wxMENU_TEAROFF 0x0001 /* * Apply to all panel items */ #define wxCOLOURED 0x0800 #define wxFIXED_LENGTH 0x0400 /* * Styles for wxListBox */ #define wxLB_SORT 0x0010 #define wxLB_SINGLE 0x0020 #define wxLB_MULTIPLE 0x0040 #define wxLB_EXTENDED 0x0080 /* wxLB_OWNERDRAW is Windows-only */ #define wxLB_NEEDED_SB 0x0000 #define wxLB_OWNERDRAW 0x0100 #define wxLB_ALWAYS_SB 0x0200 #define wxLB_NO_SB 0x0400 #define wxLB_HSCROLL wxHSCROLL /* always show an entire number of rows */ #define wxLB_INT_HEIGHT 0x0800 /* * wxComboBox style flags */ #define wxCB_SIMPLE 0x0004 #define wxCB_SORT 0x0008 #define wxCB_READONLY 0x0010 #define wxCB_DROPDOWN 0x0020 /* * wxRadioBox style flags */ /* should we number the items from left to right or from top to bottom in a 2d */ /* radiobox? */ #define wxRA_LEFTTORIGHT 0x0001 #define wxRA_TOPTOBOTTOM 0x0002 /* New, more intuitive names to specify majorDim argument */ #define wxRA_SPECIFY_COLS wxHORIZONTAL #define wxRA_SPECIFY_ROWS wxVERTICAL /* Old names for compatibility */ #define wxRA_HORIZONTAL wxHORIZONTAL #define wxRA_VERTICAL wxVERTICAL /* * wxRadioButton style flag */ #define wxRB_GROUP 0x0004 #define wxRB_SINGLE 0x0008 /* * wxScrollBar flags */ #define wxSB_HORIZONTAL wxHORIZONTAL #define wxSB_VERTICAL wxVERTICAL /* * wxSpinButton flags. * Note that a wxSpinCtrl is sometimes defined as a wxTextCtrl, and so the * flags shouldn't overlap with wxTextCtrl flags that can be used for a single * line controls (currently we reuse wxTE_CHARWRAP and wxTE_RICH2 neither of * which makes sense for them). */ #define wxSP_HORIZONTAL wxHORIZONTAL /* 4 */ #define wxSP_VERTICAL wxVERTICAL /* 8 */ #define wxSP_ARROW_KEYS 0x4000 #define wxSP_WRAP 0x8000 /* * wxTabCtrl flags */ #define wxTC_RIGHTJUSTIFY 0x0010 #define wxTC_FIXEDWIDTH 0x0020 #define wxTC_TOP 0x0000 /* default */ #define wxTC_LEFT 0x0020 #define wxTC_RIGHT 0x0040 #define wxTC_BOTTOM 0x0080 #define wxTC_MULTILINE 0x0200 /* == wxNB_MULTILINE */ #define wxTC_OWNERDRAW 0x0400 /* * wxStaticBitmap flags */ #define wxBI_EXPAND wxEXPAND /* * wxStaticLine flags */ #define wxLI_HORIZONTAL wxHORIZONTAL #define wxLI_VERTICAL wxVERTICAL /* * extended dialog specifiers. these values are stored in a different * flag and thus do not overlap with other style flags. note that these * values do not correspond to the return values of the dialogs (for * those values, look at the wxID_XXX defines). */ /* wxCENTRE already defined as 0x00000001 */ #define wxYES 0x00000002 #define wxOK 0x00000004 #define wxNO 0x00000008 #define wxYES_NO (wxYES | wxNO) #define wxCANCEL 0x00000010 #define wxAPPLY 0x00000020 #define wxCLOSE 0x00000040 #define wxOK_DEFAULT 0x00000000 /* has no effect (default) */ #define wxYES_DEFAULT 0x00000000 /* has no effect (default) */ #define wxNO_DEFAULT 0x00000080 /* only valid with wxYES_NO */ #define wxCANCEL_DEFAULT 0x80000000 /* only valid with wxCANCEL */ #define wxICON_WARNING 0x00000100 #define wxICON_ERROR 0x00000200 #define wxICON_QUESTION 0x00000400 #define wxICON_INFORMATION 0x00000800 #define wxICON_EXCLAMATION wxICON_WARNING #define wxICON_HAND wxICON_ERROR #define wxICON_STOP wxICON_ERROR #define wxICON_ASTERISK wxICON_INFORMATION #define wxHELP 0x00001000 #define wxFORWARD 0x00002000 #define wxBACKWARD 0x00004000 #define wxRESET 0x00008000 #define wxMORE 0x00010000 #define wxSETUP 0x00020000 #define wxICON_NONE 0x00040000 #define wxICON_AUTH_NEEDED 0x00080000 #define wxICON_MASK \ (wxICON_EXCLAMATION|wxICON_HAND|wxICON_QUESTION|wxICON_INFORMATION|wxICON_NONE|wxICON_AUTH_NEEDED) /* * Background styles. See wxWindow::SetBackgroundStyle */ enum wxBackgroundStyle { /* background is erased in the EVT_ERASE_BACKGROUND handler or using the system default background if no such handler is defined (this is the default style) */ wxBG_STYLE_ERASE, /* background is erased by the system, no EVT_ERASE_BACKGROUND event is generated at all */ wxBG_STYLE_SYSTEM, /* background is erased in EVT_PAINT handler and not erased at all before it, this should be used if the paint handler paints over the entire window to avoid flicker */ wxBG_STYLE_PAINT, /* Indicates that the window background is not erased, letting the parent window show through. */ wxBG_STYLE_TRANSPARENT, /* this style is deprecated and doesn't do anything, don't use */ wxBG_STYLE_COLOUR, /* this style is deprecated and is synonymous with wxBG_STYLE_PAINT, use the new name */ wxBG_STYLE_CUSTOM = wxBG_STYLE_PAINT }; /* * Key types used by (old style) lists and hashes. */ enum wxKeyType { wxKEY_NONE, wxKEY_INTEGER, wxKEY_STRING }; /* ---------------------------------------------------------------------------- */ /* standard IDs */ /* ---------------------------------------------------------------------------- */ /* Standard menu IDs */ enum wxStandardID { /* These ids delimit the range used by automatically-generated ids (i.e. those used when wxID_ANY is specified during construction). */ #if defined(__WXMSW__) || wxUSE_AUTOID_MANAGEMENT /* On MSW the range is always restricted no matter if id management is used or not because the native window ids are limited to short range. On other platforms the range is only restricted if id management is used so the reference count buffer won't be so big. */ wxID_AUTO_LOWEST = -32000, wxID_AUTO_HIGHEST = -2000, #else wxID_AUTO_LOWEST = -1000000, wxID_AUTO_HIGHEST = -2000, #endif /* no id matches this one when compared to it */ wxID_NONE = -3, /* id for a separator line in the menu (invalid for normal item) */ wxID_SEPARATOR = -2, /* any id: means that we don't care about the id, whether when installing * an event handler or when creating a new window */ wxID_ANY = -1, /* all predefined ids are between wxID_LOWEST and wxID_HIGHEST */ wxID_LOWEST = 4999, wxID_OPEN, wxID_CLOSE, wxID_NEW, wxID_SAVE, wxID_SAVEAS, wxID_REVERT, wxID_EXIT, wxID_UNDO, wxID_REDO, wxID_HELP, wxID_PRINT, wxID_PRINT_SETUP, wxID_PAGE_SETUP, wxID_PREVIEW, wxID_ABOUT, wxID_HELP_CONTENTS, wxID_HELP_INDEX, wxID_HELP_SEARCH, wxID_HELP_COMMANDS, wxID_HELP_PROCEDURES, wxID_HELP_CONTEXT, wxID_CLOSE_ALL, wxID_PREFERENCES, wxID_EDIT = 5030, wxID_CUT, wxID_COPY, wxID_PASTE, wxID_CLEAR, wxID_FIND, wxID_DUPLICATE, wxID_SELECTALL, wxID_DELETE, wxID_REPLACE, wxID_REPLACE_ALL, wxID_PROPERTIES, wxID_VIEW_DETAILS, wxID_VIEW_LARGEICONS, wxID_VIEW_SMALLICONS, wxID_VIEW_LIST, wxID_VIEW_SORTDATE, wxID_VIEW_SORTNAME, wxID_VIEW_SORTSIZE, wxID_VIEW_SORTTYPE, wxID_FILE = 5050, wxID_FILE1, wxID_FILE2, wxID_FILE3, wxID_FILE4, wxID_FILE5, wxID_FILE6, wxID_FILE7, wxID_FILE8, wxID_FILE9, /* Standard button and menu IDs */ wxID_OK = 5100, wxID_CANCEL, wxID_APPLY, wxID_YES, wxID_NO, wxID_STATIC, wxID_FORWARD, wxID_BACKWARD, wxID_DEFAULT, wxID_MORE, wxID_SETUP, wxID_RESET, wxID_CONTEXT_HELP, wxID_YESTOALL, wxID_NOTOALL, wxID_ABORT, wxID_RETRY, wxID_IGNORE, wxID_ADD, wxID_REMOVE, wxID_UP, wxID_DOWN, wxID_HOME, wxID_REFRESH, wxID_STOP, wxID_INDEX, wxID_BOLD, wxID_ITALIC, wxID_JUSTIFY_CENTER, wxID_JUSTIFY_FILL, wxID_JUSTIFY_RIGHT, wxID_JUSTIFY_LEFT, wxID_UNDERLINE, wxID_INDENT, wxID_UNINDENT, wxID_ZOOM_100, wxID_ZOOM_FIT, wxID_ZOOM_IN, wxID_ZOOM_OUT, wxID_UNDELETE, wxID_REVERT_TO_SAVED, wxID_CDROM, wxID_CONVERT, wxID_EXECUTE, wxID_FLOPPY, wxID_HARDDISK, wxID_BOTTOM, wxID_FIRST, wxID_LAST, wxID_TOP, wxID_INFO, wxID_JUMP_TO, wxID_NETWORK, wxID_SELECT_COLOR, wxID_SELECT_FONT, wxID_SORT_ASCENDING, wxID_SORT_DESCENDING, wxID_SPELL_CHECK, wxID_STRIKETHROUGH, /* System menu IDs (used by wxUniv): */ wxID_SYSTEM_MENU = 5200, wxID_CLOSE_FRAME, wxID_MOVE_FRAME, wxID_RESIZE_FRAME, wxID_MAXIMIZE_FRAME, wxID_ICONIZE_FRAME, wxID_RESTORE_FRAME, /* MDI window menu ids */ wxID_MDI_WINDOW_FIRST = 5230, wxID_MDI_WINDOW_CASCADE = wxID_MDI_WINDOW_FIRST, wxID_MDI_WINDOW_TILE_HORZ, wxID_MDI_WINDOW_TILE_VERT, wxID_MDI_WINDOW_ARRANGE_ICONS, wxID_MDI_WINDOW_PREV, wxID_MDI_WINDOW_NEXT, wxID_MDI_WINDOW_LAST = wxID_MDI_WINDOW_NEXT, /* OS X system menu ids */ wxID_OSX_MENU_FIRST = 5250, wxID_OSX_HIDE = wxID_OSX_MENU_FIRST, wxID_OSX_HIDEOTHERS, wxID_OSX_SHOWALL, #if wxABI_VERSION >= 30001 wxID_OSX_SERVICES, wxID_OSX_MENU_LAST = wxID_OSX_SERVICES, #else wxID_OSX_MENU_LAST = wxID_OSX_SHOWALL, #endif /* IDs used by generic file dialog (13 consecutive starting from this value) */ wxID_FILEDLGG = 5900, /* IDs used by generic file ctrl (4 consecutive starting from this value) */ wxID_FILECTRL = 5950, wxID_HIGHEST = 5999 }; /* ---------------------------------------------------------------------------- */ /* wxWindowID type */ /* ---------------------------------------------------------------------------- */ /* * wxWindowID used to be just a typedef defined here, now it's a class, but we * still continue to define it here for compatibility, so that the code using * it continues to compile even if it includes just wx/defs.h. * * Notice that wx/windowid.h can only be included after wxID_XYZ definitions * (as it uses them). */ #if defined(__cplusplus) && wxUSE_GUI #include "wx/windowid.h" #endif /* ---------------------------------------------------------------------------- */ /* other constants */ /* ---------------------------------------------------------------------------- */ /* menu and toolbar item kinds */ enum wxItemKind { wxITEM_SEPARATOR = -1, wxITEM_NORMAL, wxITEM_CHECK, wxITEM_RADIO, wxITEM_DROPDOWN, wxITEM_MAX }; /* * The possible states of a 3-state checkbox (Compatible * with the 2-state checkbox). */ enum wxCheckBoxState { wxCHK_UNCHECKED, wxCHK_CHECKED, wxCHK_UNDETERMINED /* 3-state checkbox only */ }; /* hit test results */ enum wxHitTest { wxHT_NOWHERE, /* scrollbar */ wxHT_SCROLLBAR_FIRST = wxHT_NOWHERE, wxHT_SCROLLBAR_ARROW_LINE_1, /* left or upper arrow to scroll by line */ wxHT_SCROLLBAR_ARROW_LINE_2, /* right or down */ wxHT_SCROLLBAR_ARROW_PAGE_1, /* left or upper arrow to scroll by page */ wxHT_SCROLLBAR_ARROW_PAGE_2, /* right or down */ wxHT_SCROLLBAR_THUMB, /* on the thumb */ wxHT_SCROLLBAR_BAR_1, /* bar to the left/above the thumb */ wxHT_SCROLLBAR_BAR_2, /* bar to the right/below the thumb */ wxHT_SCROLLBAR_LAST, /* window */ wxHT_WINDOW_OUTSIDE, /* not in this window at all */ wxHT_WINDOW_INSIDE, /* in the client area */ wxHT_WINDOW_VERT_SCROLLBAR, /* on the vertical scrollbar */ wxHT_WINDOW_HORZ_SCROLLBAR, /* on the horizontal scrollbar */ wxHT_WINDOW_CORNER, /* on the corner between 2 scrollbars */ wxHT_MAX }; /* ---------------------------------------------------------------------------- */ /* Possible SetSize flags */ /* ---------------------------------------------------------------------------- */ /* Use internally-calculated width if -1 */ #define wxSIZE_AUTO_WIDTH 0x0001 /* Use internally-calculated height if -1 */ #define wxSIZE_AUTO_HEIGHT 0x0002 /* Use internally-calculated width and height if each is -1 */ #define wxSIZE_AUTO (wxSIZE_AUTO_WIDTH|wxSIZE_AUTO_HEIGHT) /* Ignore missing (-1) dimensions (use existing). */ /* For readability only: test for wxSIZE_AUTO_WIDTH/HEIGHT in code. */ #define wxSIZE_USE_EXISTING 0x0000 /* Allow -1 as a valid position */ #define wxSIZE_ALLOW_MINUS_ONE 0x0004 /* Don't do parent client adjustments (for implementation only) */ #define wxSIZE_NO_ADJUSTMENTS 0x0008 /* Change the window position even if it seems to be already correct */ #define wxSIZE_FORCE 0x0010 /* Emit size event even if size didn't change */ #define wxSIZE_FORCE_EVENT 0x0020 /* ---------------------------------------------------------------------------- */ /* GDI descriptions */ /* ---------------------------------------------------------------------------- */ // Hatch styles used by both pen and brush styles. // // NB: Do not use these constants directly, they're for internal use only, use // wxBRUSHSTYLE_XXX_HATCH and wxPENSTYLE_XXX_HATCH instead. enum wxHatchStyle { wxHATCHSTYLE_INVALID = -1, /* The value of the first style is chosen to fit with wxDeprecatedGUIConstants values below, don't change it. */ wxHATCHSTYLE_FIRST = 111, wxHATCHSTYLE_BDIAGONAL = wxHATCHSTYLE_FIRST, wxHATCHSTYLE_CROSSDIAG, wxHATCHSTYLE_FDIAGONAL, wxHATCHSTYLE_CROSS, wxHATCHSTYLE_HORIZONTAL, wxHATCHSTYLE_VERTICAL, wxHATCHSTYLE_LAST = wxHATCHSTYLE_VERTICAL }; /* WARNING: the following styles are deprecated; use the wxFontFamily, wxFontStyle, wxFontWeight, wxBrushStyle, wxPenStyle, wxPenCap, wxPenJoin enum values instead! */ /* don't use any elements of this enum in the new code */ enum wxDeprecatedGUIConstants { /* Text font families */ wxDEFAULT = 70, wxDECORATIVE, wxROMAN, wxSCRIPT, wxSWISS, wxMODERN, wxTELETYPE, /* @@@@ */ /* Proportional or Fixed width fonts (not yet used) */ wxVARIABLE = 80, wxFIXED, wxNORMAL = 90, wxLIGHT, wxBOLD, /* Also wxNORMAL for normal (non-italic text) */ wxITALIC, wxSLANT, /* Pen styles */ wxSOLID = 100, wxDOT, wxLONG_DASH, wxSHORT_DASH, wxDOT_DASH, wxUSER_DASH, wxTRANSPARENT, /* Brush & Pen Stippling. Note that a stippled pen cannot be dashed!! */ /* Note also that stippling a Pen IS meaningful, because a Line is */ wxSTIPPLE_MASK_OPAQUE, /* mask is used for blitting monochrome using text fore and back ground colors */ wxSTIPPLE_MASK, /* mask is used for masking areas in the stipple bitmap (TO DO) */ /* drawn with a Pen, and without any Brush -- and it can be stippled. */ wxSTIPPLE = 110, wxBDIAGONAL_HATCH = wxHATCHSTYLE_BDIAGONAL, wxCROSSDIAG_HATCH = wxHATCHSTYLE_CROSSDIAG, wxFDIAGONAL_HATCH = wxHATCHSTYLE_FDIAGONAL, wxCROSS_HATCH = wxHATCHSTYLE_CROSS, wxHORIZONTAL_HATCH = wxHATCHSTYLE_HORIZONTAL, wxVERTICAL_HATCH = wxHATCHSTYLE_VERTICAL, wxFIRST_HATCH = wxHATCHSTYLE_FIRST, wxLAST_HATCH = wxHATCHSTYLE_LAST }; /* ToolPanel in wxFrame (VZ: unused?) */ enum { wxTOOL_TOP = 1, wxTOOL_BOTTOM, wxTOOL_LEFT, wxTOOL_RIGHT }; /* the values of the format constants should be the same as corresponding */ /* CF_XXX constants in Windows API */ enum wxDataFormatId { wxDF_INVALID = 0, wxDF_TEXT = 1, /* CF_TEXT */ wxDF_BITMAP = 2, /* CF_BITMAP */ wxDF_METAFILE = 3, /* CF_METAFILEPICT */ wxDF_SYLK = 4, wxDF_DIF = 5, wxDF_TIFF = 6, wxDF_OEMTEXT = 7, /* CF_OEMTEXT */ wxDF_DIB = 8, /* CF_DIB */ wxDF_PALETTE = 9, wxDF_PENDATA = 10, wxDF_RIFF = 11, wxDF_WAVE = 12, wxDF_UNICODETEXT = 13, wxDF_ENHMETAFILE = 14, wxDF_FILENAME = 15, /* CF_HDROP */ wxDF_LOCALE = 16, wxDF_PRIVATE = 20, wxDF_HTML = 30, /* Note: does not correspond to CF_ constant */ wxDF_MAX }; /* Key codes */ enum wxKeyCode { WXK_NONE = 0, WXK_CONTROL_A = 1, WXK_CONTROL_B, WXK_CONTROL_C, WXK_CONTROL_D, WXK_CONTROL_E, WXK_CONTROL_F, WXK_CONTROL_G, WXK_CONTROL_H, WXK_CONTROL_I, WXK_CONTROL_J, WXK_CONTROL_K, WXK_CONTROL_L, WXK_CONTROL_M, WXK_CONTROL_N, WXK_CONTROL_O, WXK_CONTROL_P, WXK_CONTROL_Q, WXK_CONTROL_R, WXK_CONTROL_S, WXK_CONTROL_T, WXK_CONTROL_U, WXK_CONTROL_V, WXK_CONTROL_W, WXK_CONTROL_X, WXK_CONTROL_Y, WXK_CONTROL_Z, WXK_BACK = 8, /* backspace */ WXK_TAB = 9, WXK_RETURN = 13, WXK_ESCAPE = 27, /* values from 33 to 126 are reserved for the standard ASCII characters */ WXK_SPACE = 32, WXK_DELETE = 127, /* values from 128 to 255 are reserved for ASCII extended characters (note that there isn't a single fixed standard for the meaning of these values; avoid them in portable apps!) */ /* These are not compatible with unicode characters. If you want to get a unicode character from a key event, use wxKeyEvent::GetUnicodeKey */ WXK_START = 300, WXK_LBUTTON, WXK_RBUTTON, WXK_CANCEL, WXK_MBUTTON, WXK_CLEAR, WXK_SHIFT, WXK_ALT, WXK_CONTROL, WXK_MENU, WXK_PAUSE, WXK_CAPITAL, WXK_END, WXK_HOME, WXK_LEFT, WXK_UP, WXK_RIGHT, WXK_DOWN, WXK_SELECT, WXK_PRINT, WXK_EXECUTE, WXK_SNAPSHOT, WXK_INSERT, WXK_HELP, WXK_NUMPAD0, WXK_NUMPAD1, WXK_NUMPAD2, WXK_NUMPAD3, WXK_NUMPAD4, WXK_NUMPAD5, WXK_NUMPAD6, WXK_NUMPAD7, WXK_NUMPAD8, WXK_NUMPAD9, WXK_MULTIPLY, WXK_ADD, WXK_SEPARATOR, WXK_SUBTRACT, WXK_DECIMAL, WXK_DIVIDE, WXK_F1, WXK_F2, WXK_F3, WXK_F4, WXK_F5, WXK_F6, WXK_F7, WXK_F8, WXK_F9, WXK_F10, WXK_F11, WXK_F12, WXK_F13, WXK_F14, WXK_F15, WXK_F16, WXK_F17, WXK_F18, WXK_F19, WXK_F20, WXK_F21, WXK_F22, WXK_F23, WXK_F24, WXK_NUMLOCK, WXK_SCROLL, WXK_PAGEUP, WXK_PAGEDOWN, WXK_NUMPAD_SPACE, WXK_NUMPAD_TAB, WXK_NUMPAD_ENTER, WXK_NUMPAD_F1, WXK_NUMPAD_F2, WXK_NUMPAD_F3, WXK_NUMPAD_F4, WXK_NUMPAD_HOME, WXK_NUMPAD_LEFT, WXK_NUMPAD_UP, WXK_NUMPAD_RIGHT, WXK_NUMPAD_DOWN, WXK_NUMPAD_PAGEUP, WXK_NUMPAD_PAGEDOWN, WXK_NUMPAD_END, WXK_NUMPAD_BEGIN, WXK_NUMPAD_INSERT, WXK_NUMPAD_DELETE, WXK_NUMPAD_EQUAL, WXK_NUMPAD_MULTIPLY, WXK_NUMPAD_ADD, WXK_NUMPAD_SEPARATOR, WXK_NUMPAD_SUBTRACT, WXK_NUMPAD_DECIMAL, WXK_NUMPAD_DIVIDE, WXK_WINDOWS_LEFT, WXK_WINDOWS_RIGHT, WXK_WINDOWS_MENU , #ifdef __WXOSX__ WXK_RAW_CONTROL, #else WXK_RAW_CONTROL = WXK_CONTROL, #endif WXK_COMMAND = WXK_CONTROL, /* Hardware-specific buttons */ WXK_SPECIAL1 = WXK_WINDOWS_MENU + 2, /* Skip WXK_RAW_CONTROL if necessary */ WXK_SPECIAL2, WXK_SPECIAL3, WXK_SPECIAL4, WXK_SPECIAL5, WXK_SPECIAL6, WXK_SPECIAL7, WXK_SPECIAL8, WXK_SPECIAL9, WXK_SPECIAL10, WXK_SPECIAL11, WXK_SPECIAL12, WXK_SPECIAL13, WXK_SPECIAL14, WXK_SPECIAL15, WXK_SPECIAL16, WXK_SPECIAL17, WXK_SPECIAL18, WXK_SPECIAL19, WXK_SPECIAL20, WXK_BROWSER_BACK, WXK_BROWSER_FORWARD, WXK_BROWSER_REFRESH, WXK_BROWSER_STOP, WXK_BROWSER_SEARCH, WXK_BROWSER_FAVORITES, WXK_BROWSER_HOME, WXK_VOLUME_MUTE, WXK_VOLUME_DOWN, WXK_VOLUME_UP, WXK_MEDIA_NEXT_TRACK, WXK_MEDIA_PREV_TRACK, WXK_MEDIA_STOP, WXK_MEDIA_PLAY_PAUSE, WXK_LAUNCH_MAIL, WXK_LAUNCH_APP1, WXK_LAUNCH_APP2 }; /* This enum contains bit mask constants used in wxKeyEvent */ enum wxKeyModifier { wxMOD_NONE = 0x0000, wxMOD_ALT = 0x0001, wxMOD_CONTROL = 0x0002, wxMOD_ALTGR = wxMOD_ALT | wxMOD_CONTROL, wxMOD_SHIFT = 0x0004, wxMOD_META = 0x0008, wxMOD_WIN = wxMOD_META, #if defined(__WXMAC__) wxMOD_RAW_CONTROL = 0x0010, #else wxMOD_RAW_CONTROL = wxMOD_CONTROL, #endif wxMOD_CMD = wxMOD_CONTROL, wxMOD_ALL = 0xffff }; /* Shortcut for easier dialog-unit-to-pixel conversion */ #define wxDLG_UNIT(parent, pt) parent->ConvertDialogToPixels(pt) /* Paper types */ enum wxPaperSize { wxPAPER_NONE, /* Use specific dimensions */ wxPAPER_LETTER, /* Letter, 8 1/2 by 11 inches */ wxPAPER_LEGAL, /* Legal, 8 1/2 by 14 inches */ wxPAPER_A4, /* A4 Sheet, 210 by 297 millimeters */ wxPAPER_CSHEET, /* C Sheet, 17 by 22 inches */ wxPAPER_DSHEET, /* D Sheet, 22 by 34 inches */ wxPAPER_ESHEET, /* E Sheet, 34 by 44 inches */ wxPAPER_LETTERSMALL, /* Letter Small, 8 1/2 by 11 inches */ wxPAPER_TABLOID, /* Tabloid, 11 by 17 inches */ wxPAPER_LEDGER, /* Ledger, 17 by 11 inches */ wxPAPER_STATEMENT, /* Statement, 5 1/2 by 8 1/2 inches */ wxPAPER_EXECUTIVE, /* Executive, 7 1/4 by 10 1/2 inches */ wxPAPER_A3, /* A3 sheet, 297 by 420 millimeters */ wxPAPER_A4SMALL, /* A4 small sheet, 210 by 297 millimeters */ wxPAPER_A5, /* A5 sheet, 148 by 210 millimeters */ wxPAPER_B4, /* B4 sheet, 250 by 354 millimeters */ wxPAPER_B5, /* B5 sheet, 182-by-257-millimeter paper */ wxPAPER_FOLIO, /* Folio, 8-1/2-by-13-inch paper */ wxPAPER_QUARTO, /* Quarto, 215-by-275-millimeter paper */ wxPAPER_10X14, /* 10-by-14-inch sheet */ wxPAPER_11X17, /* 11-by-17-inch sheet */ wxPAPER_NOTE, /* Note, 8 1/2 by 11 inches */ wxPAPER_ENV_9, /* #9 Envelope, 3 7/8 by 8 7/8 inches */ wxPAPER_ENV_10, /* #10 Envelope, 4 1/8 by 9 1/2 inches */ wxPAPER_ENV_11, /* #11 Envelope, 4 1/2 by 10 3/8 inches */ wxPAPER_ENV_12, /* #12 Envelope, 4 3/4 by 11 inches */ wxPAPER_ENV_14, /* #14 Envelope, 5 by 11 1/2 inches */ wxPAPER_ENV_DL, /* DL Envelope, 110 by 220 millimeters */ wxPAPER_ENV_C5, /* C5 Envelope, 162 by 229 millimeters */ wxPAPER_ENV_C3, /* C3 Envelope, 324 by 458 millimeters */ wxPAPER_ENV_C4, /* C4 Envelope, 229 by 324 millimeters */ wxPAPER_ENV_C6, /* C6 Envelope, 114 by 162 millimeters */ wxPAPER_ENV_C65, /* C65 Envelope, 114 by 229 millimeters */ wxPAPER_ENV_B4, /* B4 Envelope, 250 by 353 millimeters */ wxPAPER_ENV_B5, /* B5 Envelope, 176 by 250 millimeters */ wxPAPER_ENV_B6, /* B6 Envelope, 176 by 125 millimeters */ wxPAPER_ENV_ITALY, /* Italy Envelope, 110 by 230 millimeters */ wxPAPER_ENV_MONARCH, /* Monarch Envelope, 3 7/8 by 7 1/2 inches */ wxPAPER_ENV_PERSONAL, /* 6 3/4 Envelope, 3 5/8 by 6 1/2 inches */ wxPAPER_FANFOLD_US, /* US Std Fanfold, 14 7/8 by 11 inches */ wxPAPER_FANFOLD_STD_GERMAN, /* German Std Fanfold, 8 1/2 by 12 inches */ wxPAPER_FANFOLD_LGL_GERMAN, /* German Legal Fanfold, 8 1/2 by 13 inches */ wxPAPER_ISO_B4, /* B4 (ISO) 250 x 353 mm */ wxPAPER_JAPANESE_POSTCARD, /* Japanese Postcard 100 x 148 mm */ wxPAPER_9X11, /* 9 x 11 in */ wxPAPER_10X11, /* 10 x 11 in */ wxPAPER_15X11, /* 15 x 11 in */ wxPAPER_ENV_INVITE, /* Envelope Invite 220 x 220 mm */ wxPAPER_LETTER_EXTRA, /* Letter Extra 9 \275 x 12 in */ wxPAPER_LEGAL_EXTRA, /* Legal Extra 9 \275 x 15 in */ wxPAPER_TABLOID_EXTRA, /* Tabloid Extra 11.69 x 18 in */ wxPAPER_A4_EXTRA, /* A4 Extra 9.27 x 12.69 in */ wxPAPER_LETTER_TRANSVERSE, /* Letter Transverse 8 \275 x 11 in */ wxPAPER_A4_TRANSVERSE, /* A4 Transverse 210 x 297 mm */ wxPAPER_LETTER_EXTRA_TRANSVERSE, /* Letter Extra Transverse 9\275 x 12 in */ wxPAPER_A_PLUS, /* SuperA/SuperA/A4 227 x 356 mm */ wxPAPER_B_PLUS, /* SuperB/SuperB/A3 305 x 487 mm */ wxPAPER_LETTER_PLUS, /* Letter Plus 8.5 x 12.69 in */ wxPAPER_A4_PLUS, /* A4 Plus 210 x 330 mm */ wxPAPER_A5_TRANSVERSE, /* A5 Transverse 148 x 210 mm */ wxPAPER_B5_TRANSVERSE, /* B5 (JIS) Transverse 182 x 257 mm */ wxPAPER_A3_EXTRA, /* A3 Extra 322 x 445 mm */ wxPAPER_A5_EXTRA, /* A5 Extra 174 x 235 mm */ wxPAPER_B5_EXTRA, /* B5 (ISO) Extra 201 x 276 mm */ wxPAPER_A2, /* A2 420 x 594 mm */ wxPAPER_A3_TRANSVERSE, /* A3 Transverse 297 x 420 mm */ wxPAPER_A3_EXTRA_TRANSVERSE, /* A3 Extra Transverse 322 x 445 mm */ wxPAPER_DBL_JAPANESE_POSTCARD,/* Japanese Double Postcard 200 x 148 mm */ wxPAPER_A6, /* A6 105 x 148 mm */ wxPAPER_JENV_KAKU2, /* Japanese Envelope Kaku #2 */ wxPAPER_JENV_KAKU3, /* Japanese Envelope Kaku #3 */ wxPAPER_JENV_CHOU3, /* Japanese Envelope Chou #3 */ wxPAPER_JENV_CHOU4, /* Japanese Envelope Chou #4 */ wxPAPER_LETTER_ROTATED, /* Letter Rotated 11 x 8 1/2 in */ wxPAPER_A3_ROTATED, /* A3 Rotated 420 x 297 mm */ wxPAPER_A4_ROTATED, /* A4 Rotated 297 x 210 mm */ wxPAPER_A5_ROTATED, /* A5 Rotated 210 x 148 mm */ wxPAPER_B4_JIS_ROTATED, /* B4 (JIS) Rotated 364 x 257 mm */ wxPAPER_B5_JIS_ROTATED, /* B5 (JIS) Rotated 257 x 182 mm */ wxPAPER_JAPANESE_POSTCARD_ROTATED,/* Japanese Postcard Rotated 148 x 100 mm */ wxPAPER_DBL_JAPANESE_POSTCARD_ROTATED,/* Double Japanese Postcard Rotated 148 x 200 mm */ wxPAPER_A6_ROTATED, /* A6 Rotated 148 x 105 mm */ wxPAPER_JENV_KAKU2_ROTATED, /* Japanese Envelope Kaku #2 Rotated */ wxPAPER_JENV_KAKU3_ROTATED, /* Japanese Envelope Kaku #3 Rotated */ wxPAPER_JENV_CHOU3_ROTATED, /* Japanese Envelope Chou #3 Rotated */ wxPAPER_JENV_CHOU4_ROTATED, /* Japanese Envelope Chou #4 Rotated */ wxPAPER_B6_JIS, /* B6 (JIS) 128 x 182 mm */ wxPAPER_B6_JIS_ROTATED, /* B6 (JIS) Rotated 182 x 128 mm */ wxPAPER_12X11, /* 12 x 11 in */ wxPAPER_JENV_YOU4, /* Japanese Envelope You #4 */ wxPAPER_JENV_YOU4_ROTATED, /* Japanese Envelope You #4 Rotated */ wxPAPER_P16K, /* PRC 16K 146 x 215 mm */ wxPAPER_P32K, /* PRC 32K 97 x 151 mm */ wxPAPER_P32KBIG, /* PRC 32K(Big) 97 x 151 mm */ wxPAPER_PENV_1, /* PRC Envelope #1 102 x 165 mm */ wxPAPER_PENV_2, /* PRC Envelope #2 102 x 176 mm */ wxPAPER_PENV_3, /* PRC Envelope #3 125 x 176 mm */ wxPAPER_PENV_4, /* PRC Envelope #4 110 x 208 mm */ wxPAPER_PENV_5, /* PRC Envelope #5 110 x 220 mm */ wxPAPER_PENV_6, /* PRC Envelope #6 120 x 230 mm */ wxPAPER_PENV_7, /* PRC Envelope #7 160 x 230 mm */ wxPAPER_PENV_8, /* PRC Envelope #8 120 x 309 mm */ wxPAPER_PENV_9, /* PRC Envelope #9 229 x 324 mm */ wxPAPER_PENV_10, /* PRC Envelope #10 324 x 458 mm */ wxPAPER_P16K_ROTATED, /* PRC 16K Rotated */ wxPAPER_P32K_ROTATED, /* PRC 32K Rotated */ wxPAPER_P32KBIG_ROTATED, /* PRC 32K(Big) Rotated */ wxPAPER_PENV_1_ROTATED, /* PRC Envelope #1 Rotated 165 x 102 mm */ wxPAPER_PENV_2_ROTATED, /* PRC Envelope #2 Rotated 176 x 102 mm */ wxPAPER_PENV_3_ROTATED, /* PRC Envelope #3 Rotated 176 x 125 mm */ wxPAPER_PENV_4_ROTATED, /* PRC Envelope #4 Rotated 208 x 110 mm */ wxPAPER_PENV_5_ROTATED, /* PRC Envelope #5 Rotated 220 x 110 mm */ wxPAPER_PENV_6_ROTATED, /* PRC Envelope #6 Rotated 230 x 120 mm */ wxPAPER_PENV_7_ROTATED, /* PRC Envelope #7 Rotated 230 x 160 mm */ wxPAPER_PENV_8_ROTATED, /* PRC Envelope #8 Rotated 309 x 120 mm */ wxPAPER_PENV_9_ROTATED, /* PRC Envelope #9 Rotated 324 x 229 mm */ wxPAPER_PENV_10_ROTATED, /* PRC Envelope #10 Rotated 458 x 324 m */ wxPAPER_A0, /* A0 Sheet 841 x 1189 mm */ wxPAPER_A1 /* A1 Sheet 594 x 841 mm */ }; /* Printing orientation */ enum wxPrintOrientation { wxPORTRAIT = 1, wxLANDSCAPE }; /* Duplex printing modes */ enum wxDuplexMode { wxDUPLEX_SIMPLEX, /* Non-duplex */ wxDUPLEX_HORIZONTAL, wxDUPLEX_VERTICAL }; /* Print quality. */ #define wxPRINT_QUALITY_HIGH -1 #define wxPRINT_QUALITY_MEDIUM -2 #define wxPRINT_QUALITY_LOW -3 #define wxPRINT_QUALITY_DRAFT -4 typedef int wxPrintQuality; /* Print mode (currently PostScript only) */ enum wxPrintMode { wxPRINT_MODE_NONE = 0, wxPRINT_MODE_PREVIEW = 1, /* Preview in external application */ wxPRINT_MODE_FILE = 2, /* Print to file */ wxPRINT_MODE_PRINTER = 3, /* Send to printer */ wxPRINT_MODE_STREAM = 4 /* Send postscript data into a stream */ }; /* ---------------------------------------------------------------------------- */ /* UpdateWindowUI flags */ /* ---------------------------------------------------------------------------- */ enum wxUpdateUI { wxUPDATE_UI_NONE = 0x0000, wxUPDATE_UI_RECURSE = 0x0001, wxUPDATE_UI_FROMIDLE = 0x0002 /* Invoked from On(Internal)Idle */ }; /* ---------------------------------------------------------------------------- */ /* wxList types */ /* ---------------------------------------------------------------------------- */ /* type of compare function for list sort operation (as in 'qsort'): it should return a negative value, 0 or positive value if the first element is less than, equal or greater than the second */ typedef int (* LINKAGEMODE wxSortCompareFunction)(const void *elem1, const void *elem2); /* wxList iterator function */ typedef int (* LINKAGEMODE wxListIterateFunction)(void *current); /* ---------------------------------------------------------------------------- */ /* miscellaneous */ /* ---------------------------------------------------------------------------- */ /* define this macro if font handling is done using the X font names */ #if (defined(__WXGTK__) && !defined(__WXGTK20__)) || defined(__X__) #define _WX_X_FONTLIKE #endif /* macro to specify "All Files" on different platforms */ #if defined(__WXMSW__) # define wxALL_FILES_PATTERN wxT("*.*") # define wxALL_FILES gettext_noop("All files (*.*)|*.*") #else # define wxALL_FILES_PATTERN wxT("*") # define wxALL_FILES gettext_noop("All files (*)|*") #endif #if defined(__CYGWIN__) && defined(__WXMSW__) # if wxUSE_STD_CONTAINERS || defined(wxUSE_STD_STRING) /* NASTY HACK because the gethostname in sys/unistd.h which the gnu stl includes and wx builds with by default clash with each other (windows version 2nd param is int, sys/unistd.h version is unsigned int). */ # define gethostname gethostnameHACK # include <unistd.h> # undef gethostname # endif #endif /* --------------------------------------------------------------------------- */ /* macros that enable wxWidgets apps to be compiled in absence of the */ /* system headers, although some platform specific types are used in the */ /* platform specific (implementation) parts of the headers */ /* --------------------------------------------------------------------------- */ #ifdef __DARWIN__ #define DECLARE_WXOSX_OPAQUE_CFREF( name ) typedef struct __##name* name##Ref; #define DECLARE_WXOSX_OPAQUE_CONST_CFREF( name ) typedef const struct __##name* name##Ref; #endif #ifdef __WXMAC__ #define WX_OPAQUE_TYPE( name ) struct wxOpaque##name typedef void* WXHCURSOR; typedef void* WXRECTPTR; typedef void* WXPOINTPTR; typedef void* WXHWND; typedef void* WXEVENTREF; typedef void* WXEVENTHANDLERREF; typedef void* WXEVENTHANDLERCALLREF; typedef void* WXAPPLEEVENTREF; typedef unsigned int WXUINT; typedef unsigned long WXDWORD; typedef unsigned short WXWORD; typedef WX_OPAQUE_TYPE(PicHandle ) * WXHMETAFILE ; typedef void* WXDisplay; /* * core frameworks */ typedef const void * CFTypeRef; DECLARE_WXOSX_OPAQUE_CONST_CFREF( CFData ) DECLARE_WXOSX_OPAQUE_CONST_CFREF( CFString ) typedef struct __CFString * CFMutableStringRef; DECLARE_WXOSX_OPAQUE_CONST_CFREF( CFDictionary ) DECLARE_WXOSX_OPAQUE_CONST_CFREF( CFArray ) typedef struct __CFArray * CFMutableArrayRef; DECLARE_WXOSX_OPAQUE_CFREF( CFRunLoopSource ) DECLARE_WXOSX_OPAQUE_CONST_CFREF( CTFont ) DECLARE_WXOSX_OPAQUE_CONST_CFREF( CTFontDescriptor ) #define DECLARE_WXOSX_OPAQUE_CGREF( name ) typedef struct name* name##Ref; DECLARE_WXOSX_OPAQUE_CGREF( CGColor ) DECLARE_WXOSX_OPAQUE_CGREF( CGImage ) DECLARE_WXOSX_OPAQUE_CGREF( CGContext ) DECLARE_WXOSX_OPAQUE_CGREF( CGFont ) typedef CGColorRef WXCOLORREF; typedef CGImageRef WXCGIMAGEREF; typedef CGContextRef WXHDC; typedef CGContextRef WXHBITMAP; /* * carbon */ typedef const struct __HIShape * HIShapeRef; typedef struct __HIShape * HIMutableShapeRef; #define DECLARE_WXMAC_OPAQUE_REF( name ) typedef struct Opaque##name* name; DECLARE_WXMAC_OPAQUE_REF( PasteboardRef ) DECLARE_WXMAC_OPAQUE_REF( IconRef ) DECLARE_WXMAC_OPAQUE_REF( MenuRef ) typedef IconRef WXHICON ; typedef HIShapeRef WXHRGN; #endif // __WXMAC__ #if defined(__WXMAC__) /* Definitions of 32-bit/64-bit types * These are typedef'd exactly the same way in newer OS X headers so * redefinition when real headers are included should not be a problem. If * it is, the types are being defined wrongly here. * The purpose of these types is so they can be used from public wx headers. * and also because the older (pre-Leopard) headers don't define them. */ /* NOTE: We don't pollute namespace with CGFLOAT_MIN/MAX/IS_DOUBLE macros * since they are unlikely to be needed in a public header. */ #if defined(__LP64__) && __LP64__ typedef double CGFloat; #else typedef float CGFloat; #endif #if (defined(__LP64__) && __LP64__) || (defined(NS_BUILD_32_LIKE_64) && NS_BUILD_32_LIKE_64) typedef long NSInteger; typedef unsigned long NSUInteger; #else typedef int NSInteger; typedef unsigned int NSUInteger; #endif /* Objective-C type declarations. * These are to be used in public headers in lieu of NSSomething* because * Objective-C class names are not available in C/C++ code. */ /* NOTE: This ought to work with other compilers too, but I'm being cautious */ #if (defined(__GNUC__) && defined(__APPLE__)) /* It's desirable to have type safety for Objective-C(++) code as it does at least catch typos of method names among other things. However, it is not possible to declare an Objective-C class from plain old C or C++ code. Furthermore, because of C++ name mangling, the type name must be the same for both C++ and Objective-C++ code. Therefore, we define what should be a pointer to an Objective-C class as a pointer to a plain old C struct with the same name. Unfortunately, because the compiler does not see a struct as an Objective-C class we cannot declare it as a struct in Objective-C(++) mode. */ #if defined(__OBJC__) #define DECLARE_WXCOCOA_OBJC_CLASS(klass) \ @class klass; \ typedef klass *WX_##klass #else /* not defined(__OBJC__) */ #define DECLARE_WXCOCOA_OBJC_CLASS(klass) \ typedef struct klass *WX_##klass #endif /* defined(__OBJC__) */ #else /* not Apple's gcc */ #warning "Objective-C types will not be checked by the compiler." /* NOTE: typedef struct objc_object *id; */ /* IOW, we're declaring these using the id type without using that name, */ /* since "id" is used extensively not only within wxWidgets itself, but */ /* also in wxWidgets application code. The following works fine when */ /* compiling C(++) code, and works without typesafety for Obj-C(++) code */ #define DECLARE_WXCOCOA_OBJC_CLASS(klass) \ typedef struct objc_object *WX_##klass #endif /* (defined(__GNUC__) && defined(__APPLE__)) */ DECLARE_WXCOCOA_OBJC_CLASS(NSArray); DECLARE_WXCOCOA_OBJC_CLASS(NSData); DECLARE_WXCOCOA_OBJC_CLASS(NSMutableArray); DECLARE_WXCOCOA_OBJC_CLASS(NSString); #if wxOSX_USE_COCOA DECLARE_WXCOCOA_OBJC_CLASS(NSApplication); DECLARE_WXCOCOA_OBJC_CLASS(NSBitmapImageRep); DECLARE_WXCOCOA_OBJC_CLASS(NSBox); DECLARE_WXCOCOA_OBJC_CLASS(NSButton); DECLARE_WXCOCOA_OBJC_CLASS(NSColor); DECLARE_WXCOCOA_OBJC_CLASS(NSColorPanel); DECLARE_WXCOCOA_OBJC_CLASS(NSControl); DECLARE_WXCOCOA_OBJC_CLASS(NSCursor); DECLARE_WXCOCOA_OBJC_CLASS(NSEvent); DECLARE_WXCOCOA_OBJC_CLASS(NSFont); DECLARE_WXCOCOA_OBJC_CLASS(NSFontDescriptor); DECLARE_WXCOCOA_OBJC_CLASS(NSFontPanel); DECLARE_WXCOCOA_OBJC_CLASS(NSImage); DECLARE_WXCOCOA_OBJC_CLASS(NSLayoutManager); DECLARE_WXCOCOA_OBJC_CLASS(NSMenu); DECLARE_WXCOCOA_OBJC_CLASS(NSMenuExtra); DECLARE_WXCOCOA_OBJC_CLASS(NSMenuItem); DECLARE_WXCOCOA_OBJC_CLASS(NSNotification); DECLARE_WXCOCOA_OBJC_CLASS(NSObject); DECLARE_WXCOCOA_OBJC_CLASS(NSPanel); DECLARE_WXCOCOA_OBJC_CLASS(NSResponder); DECLARE_WXCOCOA_OBJC_CLASS(NSScrollView); DECLARE_WXCOCOA_OBJC_CLASS(NSSound); DECLARE_WXCOCOA_OBJC_CLASS(NSStatusItem); DECLARE_WXCOCOA_OBJC_CLASS(NSTableColumn); DECLARE_WXCOCOA_OBJC_CLASS(NSTableView); DECLARE_WXCOCOA_OBJC_CLASS(NSTextContainer); DECLARE_WXCOCOA_OBJC_CLASS(NSTextField); DECLARE_WXCOCOA_OBJC_CLASS(NSTextStorage); DECLARE_WXCOCOA_OBJC_CLASS(NSThread); DECLARE_WXCOCOA_OBJC_CLASS(NSWindow); DECLARE_WXCOCOA_OBJC_CLASS(NSView); DECLARE_WXCOCOA_OBJC_CLASS(NSOpenGLContext); DECLARE_WXCOCOA_OBJC_CLASS(NSOpenGLPixelFormat); DECLARE_WXCOCOA_OBJC_CLASS(NSPrintInfo); DECLARE_WXCOCOA_OBJC_CLASS(NSGestureRecognizer); DECLARE_WXCOCOA_OBJC_CLASS(NSPanGestureRecognizer); DECLARE_WXCOCOA_OBJC_CLASS(NSMagnificationGestureRecognizer); DECLARE_WXCOCOA_OBJC_CLASS(NSRotationGestureRecognizer); DECLARE_WXCOCOA_OBJC_CLASS(NSPressGestureRecognizer); DECLARE_WXCOCOA_OBJC_CLASS(NSTouch); DECLARE_WXCOCOA_OBJC_CLASS(NSPasteboard); typedef WX_NSWindow WXWindow; typedef WX_NSView WXWidget; typedef WX_NSImage WXImage; typedef WX_NSMenu WXHMENU; typedef WX_NSOpenGLPixelFormat WXGLPixelFormat; typedef WX_NSOpenGLContext WXGLContext; typedef WX_NSPasteboard OSXPasteboard; #elif wxOSX_USE_IPHONE DECLARE_WXCOCOA_OBJC_CLASS(UIWindow); DECLARE_WXCOCOA_OBJC_CLASS(UImage); DECLARE_WXCOCOA_OBJC_CLASS(UIView); DECLARE_WXCOCOA_OBJC_CLASS(UIFont); DECLARE_WXCOCOA_OBJC_CLASS(UIImage); DECLARE_WXCOCOA_OBJC_CLASS(UIEvent); DECLARE_WXCOCOA_OBJC_CLASS(NSSet); DECLARE_WXCOCOA_OBJC_CLASS(EAGLContext); DECLARE_WXCOCOA_OBJC_CLASS(UIWebView); DECLARE_WXCOCOA_OBJC_CLASS(UIPasteboard); typedef WX_UIWindow WXWindow; typedef WX_UIView WXWidget; typedef WX_UIImage WXImage; typedef WX_EAGLContext WXGLContext; typedef WX_NSString WXGLPixelFormat; typedef WX_UIWebView OSXWebViewPtr; typedef WX_UIPasteboard OSXPasteboard; #endif #if wxOSX_USE_COCOA_OR_CARBON DECLARE_WXCOCOA_OBJC_CLASS(WebView); typedef WX_WebView OSXWebViewPtr; #endif #endif /* __WXMAC__ */ /* ABX: check __WIN32__ instead of __WXMSW__ for the same MSWBase in any Win32 port */ #if defined(__WIN32__) /* Stand-ins for Windows types to avoid #including all of windows.h */ #ifndef NO_STRICT #define WX_MSW_DECLARE_HANDLE(type) typedef struct type##__ * WX##type #else #define WX_MSW_DECLARE_HANDLE(type) typedef void * WX##type #endif typedef void* WXHANDLE; WX_MSW_DECLARE_HANDLE(HWND); WX_MSW_DECLARE_HANDLE(HICON); WX_MSW_DECLARE_HANDLE(HFONT); WX_MSW_DECLARE_HANDLE(HMENU); WX_MSW_DECLARE_HANDLE(HPEN); WX_MSW_DECLARE_HANDLE(HBRUSH); WX_MSW_DECLARE_HANDLE(HPALETTE); WX_MSW_DECLARE_HANDLE(HCURSOR); WX_MSW_DECLARE_HANDLE(HRGN); WX_MSW_DECLARE_HANDLE(RECTPTR); WX_MSW_DECLARE_HANDLE(HACCEL); WX_MSW_DECLARE_HANDLE(HINSTANCE); WX_MSW_DECLARE_HANDLE(HBITMAP); WX_MSW_DECLARE_HANDLE(HIMAGELIST); WX_MSW_DECLARE_HANDLE(HGLOBAL); WX_MSW_DECLARE_HANDLE(HDC); typedef WXHINSTANCE WXHMODULE; #undef WX_MSW_DECLARE_HANDLE typedef unsigned int WXUINT; typedef unsigned long WXDWORD; typedef unsigned short WXWORD; typedef unsigned long WXCOLORREF; typedef void * WXRGNDATA; typedef struct tagMSG WXMSG; typedef void * WXHCONV; typedef void * WXHKEY; typedef void * WXHTREEITEM; typedef void * WXDRAWITEMSTRUCT; typedef void * WXMEASUREITEMSTRUCT; typedef void * WXLPCREATESTRUCT; #ifdef __WXMSW__ typedef WXHWND WXWidget; #endif #ifdef __WIN64__ typedef wxUint64 WXWPARAM; typedef wxInt64 WXLPARAM; typedef wxInt64 WXLRESULT; #else typedef wxW64 unsigned int WXWPARAM; typedef wxW64 long WXLPARAM; typedef wxW64 long WXLRESULT; #endif /* This is defined for compatibility only, it's not really the same thing as FARPROC. */ #if defined(__GNUWIN32__) typedef int (*WXFARPROC)(); #else typedef int (__stdcall *WXFARPROC)(); #endif typedef WXLRESULT (wxSTDCALL *WXWNDPROC)(WXHWND, WXUINT, WXWPARAM, WXLPARAM); #endif /* __WIN32__ */ #if defined(__WXMOTIF__) || defined(__WXX11__) /* Stand-ins for X/Xt/Motif types */ typedef void* WXWindow; typedef void* WXWidget; typedef void* WXAppContext; typedef void* WXColormap; typedef void* WXColor; typedef void WXDisplay; typedef void WXEvent; typedef void* WXCursor; typedef void* WXPixmap; typedef void* WXFontStructPtr; typedef void* WXGC; typedef void* WXRegion; typedef void* WXFont; typedef void* WXImage; typedef void* WXFontList; typedef void* WXFontSet; typedef void* WXRendition; typedef void* WXRenderTable; typedef void* WXFontType; /* either a XmFontList or XmRenderTable */ typedef void* WXString; typedef unsigned long Atom; /* this might fail on a few architectures */ typedef long WXPixel; /* safety catch in src/motif/colour.cpp */ #endif /* Motif */ #ifdef __WXGTK__ /* Stand-ins for GLIB types */ typedef struct _GSList GSList; /* Stand-ins for GDK types */ typedef struct _GdkColor GdkColor; typedef struct _GdkCursor GdkCursor; typedef struct _GdkDragContext GdkDragContext; #if defined(__WXGTK20__) typedef struct _GdkAtom* GdkAtom; #else typedef unsigned long GdkAtom; #endif #if !defined(__WXGTK3__) typedef struct _GdkColormap GdkColormap; typedef struct _GdkFont GdkFont; typedef struct _GdkGC GdkGC; typedef struct _GdkRegion GdkRegion; #endif #if defined(__WXGTK3__) typedef struct _GdkWindow GdkWindow; typedef struct _GdkEventSequence GdkEventSequence; #elif defined(__WXGTK20__) typedef struct _GdkDrawable GdkWindow; typedef struct _GdkDrawable GdkPixmap; #else typedef struct _GdkWindow GdkWindow; typedef struct _GdkWindow GdkBitmap; typedef struct _GdkWindow GdkPixmap; #endif /* Stand-ins for GTK types */ typedef struct _GtkWidget GtkWidget; typedef struct _GtkRcStyle GtkRcStyle; typedef struct _GtkAdjustment GtkAdjustment; typedef struct _GtkToolbar GtkToolbar; typedef struct _GtkNotebook GtkNotebook; typedef struct _GtkNotebookPage GtkNotebookPage; typedef struct _GtkAccelGroup GtkAccelGroup; typedef struct _GtkSelectionData GtkSelectionData; typedef struct _GtkTextBuffer GtkTextBuffer; typedef struct _GtkRange GtkRange; typedef struct _GtkCellRenderer GtkCellRenderer; typedef GtkWidget *WXWidget; #ifndef __WXGTK20__ #define GTK_OBJECT_GET_CLASS(object) (GTK_OBJECT(object)->klass) #define GTK_CLASS_TYPE(klass) ((klass)->type) #endif #endif /* __WXGTK__ */ #if defined(__WXGTK20__) || (defined(__WXX11__) && wxUSE_UNICODE) #define wxUSE_PANGO 1 #else #define wxUSE_PANGO 0 #endif #if wxUSE_PANGO /* Stand-ins for Pango types */ typedef struct _PangoContext PangoContext; typedef struct _PangoLayout PangoLayout; typedef struct _PangoFontDescription PangoFontDescription; #endif #ifdef __WXDFB__ /* DirectFB doesn't have the concept of non-TLW window, so use something arbitrary */ typedef const void* WXWidget; #endif /* DFB */ #ifdef __WXQT__ #include "wx/qt/defs.h" #endif /* include the feature test macros */ #include "wx/features.h" /* --------------------------------------------------------------------------- */ /* macros to define a class without copy ctor nor assignment operator */ /* --------------------------------------------------------------------------- */ #define wxDECLARE_NO_COPY_CLASS(classname) \ private: \ classname(const classname&); \ classname& operator=(const classname&) #define wxDECLARE_NO_COPY_TEMPLATE_CLASS(classname, arg) \ private: \ classname(const classname<arg>&); \ classname& operator=(const classname<arg>&) #define wxDECLARE_NO_COPY_TEMPLATE_CLASS_2(classname, arg1, arg2) \ private: \ classname(const classname<arg1, arg2>&); \ classname& operator=(const classname<arg1, arg2>&) #define wxDECLARE_NO_ASSIGN_CLASS(classname) \ private: \ classname& operator=(const classname&) /* deprecated variants _not_ requiring a semicolon after them */ #define DECLARE_NO_COPY_CLASS(classname) \ wxDECLARE_NO_COPY_CLASS(classname); #define DECLARE_NO_COPY_TEMPLATE_CLASS(classname, arg) \ wxDECLARE_NO_COPY_TEMPLATE_CLASS(classname, arg); #define DECLARE_NO_ASSIGN_CLASS(classname) \ wxDECLARE_NO_ASSIGN_CLASS(classname); /* --------------------------------------------------------------------------- */ /* If a manifest is being automatically generated, add common controls 6 to it */ /* --------------------------------------------------------------------------- */ #if wxUSE_GUI && \ (!defined wxUSE_NO_MANIFEST || wxUSE_NO_MANIFEST == 0 ) && \ ( defined _MSC_FULL_VER && _MSC_FULL_VER >= 140040130 ) #define WX_CC_MANIFEST(cpu) \ "/manifestdependency:\"type='win32' \ name='Microsoft.Windows.Common-Controls' \ version='6.0.0.0' \ processorArchitecture='" cpu "' \ publicKeyToken='6595b64144ccf1df' \ language='*'\"" #if defined _M_IX86 #pragma comment(linker, WX_CC_MANIFEST("x86")) #elif defined _M_X64 #pragma comment(linker, WX_CC_MANIFEST("amd64")) #elif defined _M_ARM64 #pragma comment(linker, WX_CC_MANIFEST("arm64")) #elif defined _M_IA64 #pragma comment(linker, WX_CC_MANIFEST("ia64")) #else #pragma comment(linker, WX_CC_MANIFEST("*")) #endif #endif /* !wxUSE_NO_MANIFEST && _MSC_FULL_VER >= 140040130 */ /* wxThread and wxProcess priorities */ enum { wxPRIORITY_MIN = 0u, /* lowest possible priority */ wxPRIORITY_DEFAULT = 50u, /* normal priority */ wxPRIORITY_MAX = 100u /* highest possible priority */ }; #endif /* _WX_DEFS_H_ */
h
rticonnextdds-usecases
data/projects/rticonnextdds-usecases/VehicleTracking/ExampleCode/thirdparty/wxWidgets-3.1.2/Linux/include/wx/checklst.h
/////////////////////////////////////////////////////////////////////////////// // Name: wx/checklst.h // Purpose: wxCheckListBox class interface // Author: Vadim Zeitlin // Modified by: // Created: 12.09.00 // Copyright: (c) Vadim Zeitlin // Licence: wxWindows licence /////////////////////////////////////////////////////////////////////////////// #ifndef _WX_CHECKLST_H_BASE_ #define _WX_CHECKLST_H_BASE_ #include "wx/defs.h" #if wxUSE_CHECKLISTBOX #include "wx/listbox.h" // ---------------------------------------------------------------------------- // wxCheckListBox: a listbox whose items may be checked // ---------------------------------------------------------------------------- class WXDLLIMPEXP_CORE wxCheckListBoxBase : public wxListBox { public: wxCheckListBoxBase() { } // check list box specific methods virtual bool IsChecked(unsigned int item) const = 0; virtual void Check(unsigned int item, bool check = true) = 0; virtual unsigned int GetCheckedItems(wxArrayInt& checkedItems) const; wxDECLARE_NO_COPY_CLASS(wxCheckListBoxBase); }; #if defined(__WXUNIVERSAL__) #include "wx/univ/checklst.h" #elif defined(__WXMSW__) #include "wx/msw/checklst.h" #elif defined(__WXMOTIF__) #include "wx/motif/checklst.h" #elif defined(__WXGTK20__) #include "wx/gtk/checklst.h" #elif defined(__WXGTK__) #include "wx/gtk1/checklst.h" #elif defined(__WXMAC__) #include "wx/osx/checklst.h" #elif defined(__WXQT__) #include "wx/qt/checklst.h" #endif #endif // wxUSE_CHECKLISTBOX #endif // _WX_CHECKLST_H_BASE_
h
rticonnextdds-usecases
data/projects/rticonnextdds-usecases/VehicleTracking/ExampleCode/thirdparty/wxWidgets-3.1.2/Linux/include/wx/secretstore.h
/////////////////////////////////////////////////////////////////////////////// // Name: wx/secretstore.h // Purpose: Storing and retrieving secrets using OS-provided facilities. // Author: Vadim Zeitlin // Created: 2016-05-27 // Copyright: (c) 2016 Vadim Zeitlin <[email protected]> // Licence: wxWindows licence /////////////////////////////////////////////////////////////////////////////// #ifndef _WX_SECRETSTORE_H_ #define _WX_SECRETSTORE_H_ #include "wx/defs.h" #if wxUSE_SECRETSTORE #include "wx/string.h" // Initial version of wxSecretStore required passing user name to Load(), which // didn't make much sense without support for multiple usernames per service, // so the API was changed to load the username too. Test for this symbol to // distinguish between the old and the new API, it wasn't defined before the // API change. #define wxHAS_SECRETSTORE_LOAD_USERNAME class wxSecretStoreImpl; class wxSecretValueImpl; // ---------------------------------------------------------------------------- // Represents a secret value, e.g. a password string. // ---------------------------------------------------------------------------- // This is an immutable value-like class which tries to ensure that the secret // value will be wiped out from memory once it's not needed any more. class WXDLLIMPEXP_BASE wxSecretValue { public: // Creates an empty secret value (not the same as an empty password). wxSecretValue() : m_impl(NULL) { } // Creates a secret value from the given data. wxSecretValue(size_t size, const void *data) : m_impl(NewImpl(size, data)) { } // Creates a secret value from string. explicit wxSecretValue(const wxString& secret) { const wxScopedCharBuffer buf(secret.utf8_str()); m_impl = NewImpl(buf.length(), buf.data()); } wxSecretValue(const wxSecretValue& other); wxSecretValue& operator=(const wxSecretValue& other); ~wxSecretValue(); // Check if a secret is not empty. bool IsOk() const { return m_impl != NULL; } // Compare with another secret. bool operator==(const wxSecretValue& other) const; bool operator!=(const wxSecretValue& other) const { return !(*this == other); } // Get the size, in bytes, of the secret data. size_t GetSize() const; // Get read-only access to the secret data. // // Don't assume it is NUL-terminated, use GetSize() instead. const void *GetData() const; // Get the secret data as a string. // // Notice that you may want to overwrite the string contents after using it // by calling WipeString(). wxString GetAsString(const wxMBConv& conv = wxConvWhateverWorks) const; // Erase the given area of memory overwriting its presumably sensitive // content. static void Wipe(size_t size, void *data); // Overwrite the contents of the given wxString. static void WipeString(wxString& str); private: // This method is implemented in platform-specific code and must return a // new heap-allocated object initialized with the given data. static wxSecretValueImpl* NewImpl(size_t size, const void *data); // This ctor is only used by wxSecretStore and takes ownership of the // provided existing impl pointer. explicit wxSecretValue(wxSecretValueImpl* impl) : m_impl(impl) { } wxSecretValueImpl* m_impl; friend class wxSecretStore; }; // ---------------------------------------------------------------------------- // A collection of secrets, sometimes called a key chain. // ---------------------------------------------------------------------------- class WXDLLIMPEXP_BASE wxSecretStore { public: // Returns the default secrets collection to use. // // Currently this is the only way to create a secret store object. In the // future we could add more factory functions to e.g. create non-persistent // stores or allow creating stores corresponding to the native facilities // being used (e.g. specify schema name under Linux or a SecKeychainRef // under OS X). static wxSecretStore GetDefault(); // This class has no default ctor, use GetDefault() instead. // But it can be copied, a copy refers to the same store as the original. wxSecretStore(const wxSecretStore& store); // Dtor is not virtual, this class is not supposed to be derived from. ~wxSecretStore(); // Check if this object is valid. bool IsOk() const { return m_impl != NULL; } // Store a username/password combination. // // The service name should be user readable and unique. // // If a secret with the same service name already exists, it will be // overwritten with the new value. // // Returns false after logging an error message if an error occurs, // otherwise returns true indicating that the secret has been stored. bool Save(const wxString& service, const wxString& username, const wxSecretValue& password); // Look up the username/password for the given service. // // If no username/password is found for the given service, false is // returned. // // Otherwise the function returns true and updates the provided user name // and password arguments. bool Load(const wxString& service, wxString& username, wxSecretValue& password) const; // Delete a previously stored username/password combination. // // If anything was deleted, returns true. Otherwise returns false and // logs an error if any error other than not finding any matches occurred. bool Delete(const wxString& service); private: // Ctor takes ownership of the passed pointer. explicit wxSecretStore(wxSecretStoreImpl* impl) : m_impl(impl) { } wxSecretStoreImpl* const m_impl; }; #endif // wxUSE_SECRETSTORE #endif // _WX_SECRETSTORE_H_
h
rticonnextdds-usecases
data/projects/rticonnextdds-usecases/VehicleTracking/ExampleCode/thirdparty/wxWidgets-3.1.2/Linux/include/wx/gdiobj.h
///////////////////////////////////////////////////////////////////////////// // Name: wx/gdiobj.h // Purpose: wxGDIObject base header // Author: Julian Smart // Modified by: // Created: // Copyright: (c) Julian Smart // Licence: wxWindows Licence ///////////////////////////////////////////////////////////////////////////// #ifndef _WX_GDIOBJ_H_BASE_ #define _WX_GDIOBJ_H_BASE_ #include "wx/object.h" // ---------------------------------------------------------------------------- // wxGDIRefData is the base class for wxXXXData structures which contain the // real data for the GDI object and are shared among all wxWin objects sharing // the same native GDI object // ---------------------------------------------------------------------------- class WXDLLIMPEXP_CORE wxGDIRefData : public wxObjectRefData { public: // Default ctor which needs to be defined just because we use // wxDECLARE_NO_COPY_CLASS() below. wxGDIRefData() { } // override this in the derived classes to check if this data object is // really fully initialized virtual bool IsOk() const { return true; } private: wxDECLARE_NO_COPY_CLASS(wxGDIRefData); }; // ---------------------------------------------------------------------------- // wxGDIObject: base class for bitmaps, pens, brushes, ... // ---------------------------------------------------------------------------- class WXDLLIMPEXP_CORE wxGDIObject : public wxObject { public: // checks if the object can be used virtual bool IsOk() const { // the cast here is safe because the derived classes always create // wxGDIRefData objects return m_refData && static_cast<wxGDIRefData *>(m_refData)->IsOk(); } // don't use in the new code, use IsOk() instead bool IsNull() const { return m_refData == NULL; } // older version, for backwards compatibility only (but not deprecated // because it's still widely used) bool Ok() const { return IsOk(); } #if defined(__WXMSW__) // Creates the resource virtual bool RealizeResource() { return false; } // Frees the resource virtual bool FreeResource(bool WXUNUSED(force) = false) { return false; } virtual bool IsFree() const { return false; } // Returns handle. virtual WXHANDLE GetResourceHandle() const { return 0; } #endif // defined(__WXMSW__) protected: // replace base class functions using wxObjectRefData with our own which // use wxGDIRefData to ensure that we always work with data objects of the // correct type (i.e. derived from wxGDIRefData) virtual wxObjectRefData *CreateRefData() const wxOVERRIDE { return CreateGDIRefData(); } virtual wxObjectRefData *CloneRefData(const wxObjectRefData *data) const wxOVERRIDE { return CloneGDIRefData(static_cast<const wxGDIRefData *>(data)); } virtual wxGDIRefData *CreateGDIRefData() const = 0; virtual wxGDIRefData *CloneGDIRefData(const wxGDIRefData *data) const = 0; wxDECLARE_DYNAMIC_CLASS(wxGDIObject); }; #endif // _WX_GDIOBJ_H_BASE_
h
rticonnextdds-usecases
data/projects/rticonnextdds-usecases/VehicleTracking/ExampleCode/thirdparty/wxWidgets-3.1.2/Linux/include/wx/listbox.h
/////////////////////////////////////////////////////////////////////////////// // Name: wx/listbox.h // Purpose: wxListBox class interface // Author: Vadim Zeitlin // Modified by: // Created: 22.10.99 // Copyright: (c) wxWidgets team // Licence: wxWindows licence /////////////////////////////////////////////////////////////////////////////// #ifndef _WX_LISTBOX_H_BASE_ #define _WX_LISTBOX_H_BASE_ // ---------------------------------------------------------------------------- // headers // ---------------------------------------------------------------------------- #include "wx/defs.h" #if wxUSE_LISTBOX #include "wx/ctrlsub.h" // base class // forward declarations are enough here class WXDLLIMPEXP_FWD_BASE wxArrayInt; class WXDLLIMPEXP_FWD_BASE wxArrayString; // ---------------------------------------------------------------------------- // global data // ---------------------------------------------------------------------------- extern WXDLLIMPEXP_DATA_CORE(const char) wxListBoxNameStr[]; // ---------------------------------------------------------------------------- // wxListBox interface is defined by the class wxListBoxBase // ---------------------------------------------------------------------------- class WXDLLIMPEXP_CORE wxListBoxBase : public wxControlWithItems { public: wxListBoxBase() { } virtual ~wxListBoxBase(); void InsertItems(unsigned int nItems, const wxString *items, unsigned int pos) { Insert(nItems, items, pos); } void InsertItems(const wxArrayString& items, unsigned int pos) { Insert(items, pos); } // multiple selection logic virtual bool IsSelected(int n) const = 0; virtual void SetSelection(int n) wxOVERRIDE; void SetSelection(int n, bool select) { DoSetSelection(n, select); } void Deselect(int n) { DoSetSelection(n, false); } void DeselectAll(int itemToLeaveSelected = -1); virtual bool SetStringSelection(const wxString& s, bool select); virtual bool SetStringSelection(const wxString& s) { return SetStringSelection(s, true); } // works for single as well as multiple selection listboxes (unlike // GetSelection which only works for listboxes with single selection) virtual int GetSelections(wxArrayInt& aSelections) const = 0; // set the specified item at the first visible item or scroll to max // range. void SetFirstItem(int n) { DoSetFirstItem(n); } void SetFirstItem(const wxString& s); // ensures that the given item is visible scrolling the listbox if // necessary virtual void EnsureVisible(int n); virtual int GetTopItem() const { return wxNOT_FOUND; } virtual int GetCountPerPage() const { return -1; } // a combination of Append() and EnsureVisible(): appends the item to the // listbox and ensures that it is visible i.e. not scrolled out of view void AppendAndEnsureVisible(const wxString& s); // return true if the listbox allows multiple selection bool HasMultipleSelection() const { return (m_windowStyle & wxLB_MULTIPLE) || (m_windowStyle & wxLB_EXTENDED); } // override wxItemContainer::IsSorted virtual bool IsSorted() const wxOVERRIDE { return HasFlag( wxLB_SORT ); } // emulate selecting or deselecting the item event.GetInt() (depending on // event.GetExtraLong()) void Command(wxCommandEvent& event) wxOVERRIDE; // return the index of the item at this position or wxNOT_FOUND int HitTest(const wxPoint& point) const { return DoListHitTest(point); } int HitTest(int x, int y) const { return DoListHitTest(wxPoint(x, y)); } protected: virtual void DoSetFirstItem(int n) = 0; virtual void DoSetSelection(int n, bool select) = 0; // there is already wxWindow::DoHitTest() so call this one differently virtual int DoListHitTest(const wxPoint& WXUNUSED(point)) const { return wxNOT_FOUND; } // Helper for the code generating events in single selection mode: updates // m_oldSelections and return true if the selection really changed. // Otherwise just returns false. bool DoChangeSingleSelection(int item); // Helper for generating events in multiple and extended mode: compare the // current selections with the previously recorded ones (in // m_oldSelections) and send the appropriate event if they differ, // otherwise just return false. bool CalcAndSendEvent(); // Send a listbox (de)selection or double click event. // // Returns true if the event was processed. bool SendEvent(wxEventType evtType, int item, bool selected); // Array storing the indices of all selected items that we already notified // the user code about for multi selection list boxes. // // For single selection list boxes, we reuse this array to store the single // currently selected item, this is used by DoChangeSingleSelection(). // // TODO-OPT: wxSelectionStore would be more efficient for big list boxes. wxArrayInt m_oldSelections; // Update m_oldSelections with currently selected items (does nothing in // single selection mode on platforms other than MSW). void UpdateOldSelections(); private: wxDECLARE_NO_COPY_CLASS(wxListBoxBase); }; // ---------------------------------------------------------------------------- // include the platform-specific class declaration // ---------------------------------------------------------------------------- #if defined(__WXUNIVERSAL__) #include "wx/univ/listbox.h" #elif defined(__WXMSW__) #include "wx/msw/listbox.h" #elif defined(__WXMOTIF__) #include "wx/motif/listbox.h" #elif defined(__WXGTK20__) #include "wx/gtk/listbox.h" #elif defined(__WXGTK__) #include "wx/gtk1/listbox.h" #elif defined(__WXMAC__) #include "wx/osx/listbox.h" #elif defined(__WXQT__) #include "wx/qt/listbox.h" #endif #endif // wxUSE_LISTBOX #endif // _WX_LISTBOX_H_BASE_
h
rticonnextdds-usecases
data/projects/rticonnextdds-usecases/VehicleTracking/ExampleCode/thirdparty/wxWidgets-3.1.2/Linux/include/wx/sharedptr.h
///////////////////////////////////////////////////////////////////////////// // Name: wx/sharedptr.h // Purpose: Shared pointer based on the counted_ptr<> template, which // is in the public domain // Author: Robert Roebling, Yonat Sharon // Copyright: Robert Roebling // Licence: wxWindows licence ///////////////////////////////////////////////////////////////////////////// #ifndef _WX_SHAREDPTR_H_ #define _WX_SHAREDPTR_H_ #include "wx/defs.h" #include "wx/atomic.h" // ---------------------------------------------------------------------------- // wxSharedPtr: A smart pointer with non-intrusive reference counting. // ---------------------------------------------------------------------------- template <class T> class wxSharedPtr { public: typedef T element_type; explicit wxSharedPtr( T* ptr = NULL ) : m_ref(NULL) { if (ptr) m_ref = new reftype(ptr); } template<typename Deleter> explicit wxSharedPtr(T* ptr, Deleter d) : m_ref(NULL) { if (ptr) m_ref = new reftype_with_deleter<Deleter>(ptr, d); } ~wxSharedPtr() { Release(); } wxSharedPtr(const wxSharedPtr& tocopy) { Acquire(tocopy.m_ref); } wxSharedPtr& operator=( const wxSharedPtr& tocopy ) { if (this != &tocopy) { Release(); Acquire(tocopy.m_ref); } return *this; } wxSharedPtr& operator=( T* ptr ) { if (get() != ptr) { Release(); if (ptr) m_ref = new reftype(ptr); } return *this; } // test for pointer validity: defining conversion to unspecified_bool_type // and not more obvious bool to avoid implicit conversions to integer types typedef T *(wxSharedPtr<T>::*unspecified_bool_type)() const; operator unspecified_bool_type() const { if (m_ref && m_ref->m_ptr) return &wxSharedPtr<T>::get; else return NULL; } T& operator*() const { wxASSERT(m_ref != NULL); wxASSERT(m_ref->m_ptr != NULL); return *(m_ref->m_ptr); } T* operator->() const { wxASSERT(m_ref != NULL); wxASSERT(m_ref->m_ptr != NULL); return m_ref->m_ptr; } T* get() const { return m_ref ? m_ref->m_ptr : NULL; } void reset( T* ptr = NULL ) { Release(); if (ptr) m_ref = new reftype(ptr); } template<typename Deleter> void reset(T* ptr, Deleter d) { Release(); if (ptr) m_ref = new reftype_with_deleter<Deleter>(ptr, d); } bool unique() const { return (m_ref ? m_ref->m_count == 1 : true); } long use_count() const { return (m_ref ? (long)m_ref->m_count : 0); } private: struct reftype { reftype(T* ptr) : m_ptr(ptr), m_count(1) {} virtual ~reftype() {} virtual void delete_ptr() { delete m_ptr; } T* m_ptr; wxAtomicInt m_count; }; template<typename Deleter> struct reftype_with_deleter : public reftype { reftype_with_deleter(T* ptr, Deleter d) : reftype(ptr), m_deleter(d) {} virtual void delete_ptr() { m_deleter(this->m_ptr); } Deleter m_deleter; }; reftype* m_ref; void Acquire(reftype* ref) { m_ref = ref; if (ref) wxAtomicInc( ref->m_count ); } void Release() { if (m_ref) { if (!wxAtomicDec( m_ref->m_count )) { m_ref->delete_ptr(); delete m_ref; } m_ref = NULL; } } }; template <class T, class U> bool operator == (wxSharedPtr<T> const &a, wxSharedPtr<U> const &b ) { return a.get() == b.get(); } template <class T, class U> bool operator != (wxSharedPtr<T> const &a, wxSharedPtr<U> const &b ) { return a.get() != b.get(); } #endif // _WX_SHAREDPTR_H_
h
rticonnextdds-usecases
data/projects/rticonnextdds-usecases/VehicleTracking/ExampleCode/thirdparty/wxWidgets-3.1.2/Linux/include/wx/textentry.h
/////////////////////////////////////////////////////////////////////////////// // Name: wx/textentry.h // Purpose: declares wxTextEntry interface defining a simple text entry // Author: Vadim Zeitlin // Created: 2007-09-24 // Copyright: (c) 2007 Vadim Zeitlin <[email protected]> // Licence: wxWindows licence /////////////////////////////////////////////////////////////////////////////// #ifndef _WX_TEXTENTRY_H_ #define _WX_TEXTENTRY_H_ // wxTextPos is the position in the text (currently it's hardly used anywhere // and should probably be replaced with int anyhow) typedef long wxTextPos; class WXDLLIMPEXP_FWD_BASE wxArrayString; class WXDLLIMPEXP_FWD_CORE wxTextCompleter; class WXDLLIMPEXP_FWD_CORE wxTextEntryHintData; class WXDLLIMPEXP_FWD_CORE wxWindow; #include "wx/filefn.h" // for wxFILE and wxDIR only #include "wx/gdicmn.h" // for wxPoint // ---------------------------------------------------------------------------- // wxTextEntryBase // ---------------------------------------------------------------------------- class WXDLLIMPEXP_CORE wxTextEntryBase { public: wxTextEntryBase() { m_eventsBlock = 0; m_hintData = NULL; } virtual ~wxTextEntryBase(); // accessing the value // ------------------- // SetValue() generates a text change event, ChangeValue() doesn't virtual void SetValue(const wxString& value) { DoSetValue(value, SetValue_SendEvent); } virtual void ChangeValue(const wxString& value); // writing text inserts it at the current position replacing any current // selection, appending always inserts it at the end and doesn't remove any // existing text (but it will reset the selection if there is any) virtual void WriteText(const wxString& text) = 0; virtual void AppendText(const wxString& text); virtual wxString GetValue() const; virtual wxString GetRange(long from, long to) const; bool IsEmpty() const { return GetLastPosition() <= 0; } // editing operations // ------------------ virtual void Replace(long from, long to, const wxString& value); virtual void Remove(long from, long to) = 0; virtual void Clear() { Remove(0, -1); } void RemoveSelection(); // clipboard operations // -------------------- virtual void Copy() = 0; virtual void Cut() = 0; virtual void Paste() = 0; virtual bool CanCopy() const; virtual bool CanCut() const; virtual bool CanPaste() const; // undo/redo // --------- virtual void Undo() = 0; virtual void Redo() = 0; virtual bool CanUndo() const = 0; virtual bool CanRedo() const = 0; // insertion point // --------------- // note that moving insertion point removes any current selection virtual void SetInsertionPoint(long pos) = 0; virtual void SetInsertionPointEnd() { SetInsertionPoint(-1); } virtual long GetInsertionPoint() const = 0; virtual long GetLastPosition() const = 0; // selection // --------- virtual void SetSelection(long from, long to) = 0; virtual void SelectAll() { SetSelection(-1, -1); } virtual void SelectNone() { const long pos = GetInsertionPoint(); SetSelection(pos, pos); } virtual void GetSelection(long *from, long *to) const = 0; bool HasSelection() const; virtual wxString GetStringSelection() const; // auto-completion // --------------- // these functions allow to auto-complete the text already entered into the // control using either the given fixed list of strings, the paths from the // file system or an arbitrary user-defined completer // // they all return true if completion was enabled or false on error (most // commonly meaning that this functionality is not available under the // current platform) bool AutoComplete(const wxArrayString& choices) { return DoAutoCompleteStrings(choices); } bool AutoCompleteFileNames() { return DoAutoCompleteFileNames(wxFILE); } bool AutoCompleteDirectories() { return DoAutoCompleteFileNames(wxDIR); } // notice that we take ownership of the pointer and will delete it // // if the pointer is NULL auto-completion is disabled bool AutoComplete(wxTextCompleter *completer) { return DoAutoCompleteCustom(completer); } // status // ------ virtual bool IsEditable() const = 0; virtual void SetEditable(bool editable) = 0; // input restrictions // ------------------ // set the max number of characters which may be entered in a single line // text control virtual void SetMaxLength(unsigned long WXUNUSED(len)) { } // convert any lower-case characters to upper-case on the fly in this entry virtual void ForceUpper(); // hints // ----- // hint is the (usually greyed out) text shown in the control as long as // it's empty and doesn't have focus, it is typically used in controls used // for searching to let the user know what is supposed to be entered there virtual bool SetHint(const wxString& hint); virtual wxString GetHint() const; // margins // ------- // margins are the empty space between borders of control and the text // itself. When setting margin, use value -1 to indicate that specific // margin should not be changed. bool SetMargins(const wxPoint& pt) { return DoSetMargins(pt); } bool SetMargins(wxCoord left, wxCoord top = -1) { return DoSetMargins(wxPoint(left, top)); } wxPoint GetMargins() const { return DoGetMargins(); } // implementation only // ------------------- // generate the wxEVT_TEXT event for GetEditableWindow(), // like SetValue() does and return true if the event was processed // // NB: this is public for wxRichTextCtrl use only right now, do not call it static bool SendTextUpdatedEvent(wxWindow *win); // generate the wxEVT_TEXT event for this window bool SendTextUpdatedEvent() { return SendTextUpdatedEvent(GetEditableWindow()); } // generate the wxEVT_TEXT event for this window if the // events are not currently disabled void SendTextUpdatedEventIfAllowed() { if ( EventsAllowed() ) SendTextUpdatedEvent(); } // this function is provided solely for the purpose of forwarding text // change notifications state from one control to another, e.g. it can be // used by a wxComboBox which derives from wxTextEntry if it delegates all // of its methods to another wxTextCtrl void ForwardEnableTextChangedEvents(bool enable) { // it's important to call the functions which update m_eventsBlock here // and not just our own EnableTextChangedEvents() because our state // (i.e. the result of EventsAllowed()) must change as well if ( enable ) ResumeTextChangedEvents(); else SuppressTextChangedEvents(); } // change the entry value to be in upper case only, if needed (i.e. if it's // not already the case) void ConvertToUpperCase(); protected: // flags for DoSetValue(): common part of SetValue() and ChangeValue() and // also used to implement WriteText() in wxMSW enum { SetValue_NoEvent = 0, SetValue_SendEvent = 1, SetValue_SelectionOnly = 2 }; virtual void DoSetValue(const wxString& value, int flags); virtual wxString DoGetValue() const = 0; // override this to return the associated window, it will be used for event // generation and also by generic hints implementation virtual wxWindow *GetEditableWindow() = 0; // margins functions virtual bool DoSetMargins(const wxPoint& pt); virtual wxPoint DoGetMargins() const; // the derived classes should override these virtual methods to implement // auto-completion, they do the same thing as their public counterparts but // have different names to allow overriding just one of them without hiding // the other one(s) virtual bool DoAutoCompleteStrings(const wxArrayString& WXUNUSED(choices)) { return false; } virtual bool DoAutoCompleteFileNames(int WXUNUSED(flags)) // wxFILE | wxDIR { return false; } virtual bool DoAutoCompleteCustom(wxTextCompleter *completer); // class which should be used to temporarily disable text change events // // if suppress argument in ctor is false, nothing is done class EventsSuppressor { public: EventsSuppressor(wxTextEntryBase *text, bool suppress = true) : m_text(text), m_suppress(suppress) { if ( m_suppress ) m_text->SuppressTextChangedEvents(); } ~EventsSuppressor() { if ( m_suppress ) m_text->ResumeTextChangedEvents(); } private: wxTextEntryBase *m_text; bool m_suppress; }; friend class EventsSuppressor; private: // suppress or resume the text changed events generation: don't use these // functions directly, use EventsSuppressor class above instead void SuppressTextChangedEvents() { if ( !m_eventsBlock++ ) EnableTextChangedEvents(false); } void ResumeTextChangedEvents() { if ( !--m_eventsBlock ) EnableTextChangedEvents(true); } // this must be overridden in the derived classes if our implementation of // SetValue() or Replace() is used to disable (and enable back) generation // of the text changed events // // initially the generation of the events is enabled virtual void EnableTextChangedEvents(bool WXUNUSED(enable)) { } // return true if the events are currently not suppressed bool EventsAllowed() const { return m_eventsBlock == 0; } // if this counter is non-null, events are blocked unsigned m_eventsBlock; // hint-related stuff, only allocated if/when SetHint() is used wxTextEntryHintData *m_hintData; // It needs to call our Do{Get,Set}Value() to work with the real control // contents. friend class wxTextEntryHintData; }; #ifdef __WXUNIVERSAL__ // TODO: we need to use wxTextEntryDelegate here, but for now just prevent // the GTK/MSW classes from being used in wxUniv build class WXDLLIMPEXP_CORE wxTextEntry : public wxTextEntryBase { }; #elif defined(__WXGTK20__) #include "wx/gtk/textentry.h" #elif defined(__WXMAC__) #include "wx/osx/textentry.h" #elif defined(__WXMSW__) #include "wx/msw/textentry.h" #elif defined(__WXMOTIF__) #include "wx/motif/textentry.h" #elif defined(__WXQT__) #include "wx/qt/textentry.h" #else // no platform-specific implementation of wxTextEntry yet class WXDLLIMPEXP_CORE wxTextEntry : public wxTextEntryBase { }; #endif #endif // _WX_TEXTENTRY_H_
h
rticonnextdds-usecases
data/projects/rticonnextdds-usecases/VehicleTracking/ExampleCode/thirdparty/wxWidgets-3.1.2/Linux/include/wx/xtictor.h
///////////////////////////////////////////////////////////////////////////// // Name: wx/xtictor.h // Purpose: XTI constructors // Author: Stefan Csomor // Modified by: Francesco Montorsi // Created: 27/07/03 // Copyright: (c) 1997 Julian Smart // (c) 2003 Stefan Csomor // Licence: wxWindows licence ///////////////////////////////////////////////////////////////////////////// #ifndef _XTICTOR_H_ #define _XTICTOR_H_ #include "wx/defs.h" #if wxUSE_EXTENDED_RTTI #include "wx/xti.h" // ---------------------------------------------------------------------------- // Constructor Bridges // ---------------------------------------------------------------------------- // A constructor bridge allows to call a ctor with an arbitrary number // or parameters during runtime class WXDLLIMPEXP_BASE wxObjectAllocatorAndCreator { public: virtual ~wxObjectAllocatorAndCreator() { } virtual bool Create(wxObject * &o, wxAny *args) = 0; }; // a direct constructor bridge calls the operator new for this class and // passes all params to the constructor. Needed for classes that cannot be // instantiated using alloc-create semantics class WXDLLIMPEXP_BASE wxObjectAllocator : public wxObjectAllocatorAndCreator { public: virtual bool Create(wxObject * &o, wxAny *args) = 0; }; // ---------------------------------------------------------------------------- // Constructor Bridges for all Numbers of Params // ---------------------------------------------------------------------------- // no params template<typename Class> struct wxObjectAllocatorAndCreator_0 : public wxObjectAllocatorAndCreator { bool Create(wxObject * &o, wxAny *) { Class *obj = wx_dynamic_cast(Class*, o); return obj->Create(); } }; struct wxObjectAllocatorAndCreator_Dummy : public wxObjectAllocatorAndCreator { bool Create(wxObject *&, wxAny *) { return true; } }; #define wxCONSTRUCTOR_0(klass) \ wxObjectAllocatorAndCreator_0<klass> constructor##klass; \ wxObjectAllocatorAndCreator* klass::ms_constructor = &constructor##klass; \ const wxChar *klass::ms_constructorProperties[] = { NULL }; \ const int klass::ms_constructorPropertiesCount = 0; #define wxCONSTRUCTOR_DUMMY(klass) \ wxObjectAllocatorAndCreator_Dummy constructor##klass; \ wxObjectAllocatorAndCreator* klass::ms_constructor = &constructor##klass; \ const wxChar *klass::ms_constructorProperties[] = { NULL }; \ const int klass::ms_constructorPropertiesCount = 0; // direct constructor version template<typename Class> struct wxDirectConstructorBridge_0 : public wxObjectAllocator { bool Create(wxObject * &o, wxAny *args) { o = new Class( ); return o != NULL; } }; #define wxDIRECT_CONSTRUCTOR_0(klass) \ wxDirectConstructorBridge_0<klass> constructor##klass; \ wxObjectAllocatorAndCreator* klass::ms_constructor = &constructor##klass; \ const wxChar *klass::ms_constructorProperties[] = { NULL }; \ const int klass::ms_constructorPropertiesCount = 0; // 1 param template<typename Class, typename T0> struct wxObjectAllocatorAndCreator_1 : public wxObjectAllocatorAndCreator { bool Create(wxObject * &o, wxAny *args) { Class *obj = wx_dynamic_cast(Class*, o); return obj->Create( (args[0]).As(static_cast<T0*>(NULL)) ); } }; #define wxCONSTRUCTOR_1(klass,t0,v0) \ wxObjectAllocatorAndCreator_1<klass,t0> constructor##klass; \ wxObjectAllocatorAndCreator* klass::ms_constructor = &constructor##klass; \ const wxChar *klass::ms_constructorProperties[] = { wxT(#v0) }; \ const int klass::ms_constructorPropertiesCount = 1; // direct constructor version template<typename Class, typename T0> struct wxDirectConstructorBridge_1 : public wxObjectAllocator { bool Create(wxObject * &o, wxAny *args) { o = new Class( (args[0]).As(static_cast<T0*>(NULL)) ); return o != NULL; } }; #define wxDIRECT_CONSTRUCTOR_1(klass,t0,v0) \ wxDirectConstructorBridge_1<klass,t0,t1> constructor##klass; \ wxObjectAllocatorAndCreator* klass::ms_constructor = &constructor##klass; \ const wxChar *klass::ms_constructorProperties[] = { wxT(#v0) }; \ const int klass::ms_constructorPropertiesCount = 1; // 2 params template<typename Class, typename T0, typename T1> struct wxObjectAllocatorAndCreator_2 : public wxObjectAllocatorAndCreator { bool Create(wxObject * &o, wxAny *args) { Class *obj = wx_dynamic_cast(Class*, o); return obj->Create( (args[0]).As(static_cast<T0*>(NULL)), (args[1]).As(static_cast<T1*>(NULL)) ); } }; #define wxCONSTRUCTOR_2(klass,t0,v0,t1,v1) \ wxObjectAllocatorAndCreator_2<klass,t0,t1> constructor##klass; \ wxObjectAllocatorAndCreator* klass::ms_constructor = &constructor##klass; \ const wxChar *klass::ms_constructorProperties[] = { wxT(#v0), wxT(#v1) }; \ const int klass::ms_constructorPropertiesCount = 2; // direct constructor version template<typename Class, typename T0, typename T1> struct wxDirectConstructorBridge_2 : public wxObjectAllocator { bool Create(wxObject * &o, wxAny *args) { o = new Class( (args[0]).As(static_cast<T0*>(NULL)), (args[1]).As(static_cast<T1*>(NULL)) ); return o != NULL; } }; #define wxDIRECT_CONSTRUCTOR_2(klass,t0,v0,t1,v1) \ wxDirectConstructorBridge_2<klass,t0,t1> constructor##klass; \ wxObjectAllocatorAndCreator* klass::ms_constructor = &constructor##klass; \ const wxChar *klass::ms_constructorProperties[] = { wxT(#v0), wxT(#v1) }; \ const int klass::ms_constructorPropertiesCount = 2; // 3 params template<typename Class, typename T0, typename T1, typename T2> struct wxObjectAllocatorAndCreator_3 : public wxObjectAllocatorAndCreator { bool Create(wxObject * &o, wxAny *args) { Class *obj = wx_dynamic_cast(Class*, o); return obj->Create( (args[0]).As(static_cast<T0*>(NULL)), (args[1]).As(static_cast<T1*>(NULL)), (args[2]).As(static_cast<T2*>(NULL)) ); } }; #define wxCONSTRUCTOR_3(klass,t0,v0,t1,v1,t2,v2) \ wxObjectAllocatorAndCreator_3<klass,t0,t1,t2> constructor##klass; \ wxObjectAllocatorAndCreator* klass::ms_constructor = &constructor##klass; \ const wxChar *klass::ms_constructorProperties[] = { wxT(#v0), wxT(#v1), wxT(#v2) }; \ const int klass::ms_constructorPropertiesCount = 3; // direct constructor version template<typename Class, typename T0, typename T1, typename T2> struct wxDirectConstructorBridge_3 : public wxObjectAllocator { bool Create(wxObject * &o, wxAny *args) { o = new Class( (args[0]).As(static_cast<T0*>(NULL)), (args[1]).As(static_cast<T1*>(NULL)), (args[2]).As(static_cast<T2*>(NULL)) ); return o != NULL; } }; #define wxDIRECT_CONSTRUCTOR_3(klass,t0,v0,t1,v1,t2,v2) \ wxDirectConstructorBridge_3<klass,t0,t1,t2> constructor##klass; \ wxObjectAllocatorAndCreator* klass::ms_constructor = &constructor##klass; \ const wxChar *klass::ms_constructorProperties[] = { wxT(#v0), wxT(#v1), wxT(#v2) }; \ const int klass::ms_constructorPropertiesCount = 3; // 4 params template<typename Class, typename T0, typename T1, typename T2, typename T3> struct wxObjectAllocatorAndCreator_4 : public wxObjectAllocatorAndCreator { bool Create(wxObject * &o, wxAny *args) { Class *obj = wx_dynamic_cast(Class*, o); return obj->Create( (args[0]).As(static_cast<T0*>(NULL)), (args[1]).As(static_cast<T1*>(NULL)), (args[2]).As(static_cast<T2*>(NULL)), (args[3]).As(static_cast<T3*>(NULL)) ); } }; #define wxCONSTRUCTOR_4(klass,t0,v0,t1,v1,t2,v2,t3,v3) \ wxObjectAllocatorAndCreator_4<klass,t0,t1,t2,t3> constructor##klass; \ wxObjectAllocatorAndCreator* klass::ms_constructor = &constructor##klass; \ const wxChar *klass::ms_constructorProperties[] = \ { wxT(#v0), wxT(#v1), wxT(#v2), wxT(#v3) }; \ const int klass::ms_constructorPropertiesCount = 4; // direct constructor version template<typename Class, typename T0, typename T1, typename T2, typename T3> struct wxDirectConstructorBridge_4 : public wxObjectAllocator { bool Create(wxObject * &o, wxAny *args) { o = new Class( (args[0]).As(static_cast<T0*>(NULL)), (args[1]).As(static_cast<T1*>(NULL)), (args[2]).As(static_cast<T2*>(NULL)), (args[3]).As(static_cast<T3*>(NULL)) ); return o != NULL; } }; #define wxDIRECT_CONSTRUCTOR_4(klass,t0,v0,t1,v1,t2,v2,t3,v3) \ wxDirectConstructorBridge_4<klass,t0,t1,t2,t3> constructor##klass; \ wxObjectAllocatorAndCreator* klass::ms_constructor = &constructor##klass; \ const wxChar *klass::ms_constructorProperties[] = \ { wxT(#v0), wxT(#v1), wxT(#v2), wxT(#v3) }; \ const int klass::ms_constructorPropertiesCount = 4; // 5 params template<typename Class, typename T0, typename T1, typename T2, typename T3, typename T4> struct wxObjectAllocatorAndCreator_5 : public wxObjectAllocatorAndCreator { bool Create(wxObject * &o, wxAny *args) { Class *obj = wx_dynamic_cast(Class*, o); return obj->Create( (args[0]).As(static_cast<T0*>(NULL)), (args[1]).As(static_cast<T1*>(NULL)), (args[2]).As(static_cast<T2*>(NULL)), (args[3]).As(static_cast<T3*>(NULL)), (args[4]).As(static_cast<T4*>(NULL)) ); } }; #define wxCONSTRUCTOR_5(klass,t0,v0,t1,v1,t2,v2,t3,v3,t4,v4) \ wxObjectAllocatorAndCreator_5<klass,t0,t1,t2,t3,t4> constructor##klass; \ wxObjectAllocatorAndCreator* klass::ms_constructor = &constructor##klass; \ const wxChar *klass::ms_constructorProperties[] = \ { wxT(#v0), wxT(#v1), wxT(#v2), wxT(#v3), wxT(#v4) }; \ const int klass::ms_constructorPropertiesCount = 5; // direct constructor version template<typename Class, typename T0, typename T1, typename T2, typename T3, typename T4> struct wxDirectConstructorBridge_5 : public wxObjectAllocator { bool Create(wxObject * &o, wxAny *args) { o = new Class( (args[0]).As(static_cast<T0*>(NULL)), (args[1]).As(static_cast<T1*>(NULL)), (args[2]).As(static_cast<T2*>(NULL)), (args[3]).As(static_cast<T3*>(NULL)), (args[4]).As(static_cast<T4*>(NULL)) ); return o != NULL; } }; #define wxDIRECT_CONSTRUCTOR_5(klass,t0,v0,t1,v1,t2,v2,t3,v3,t4,v4) \ wxDirectConstructorBridge_5<klass,t0,t1,t2,t3,t4> constructor##klass; \ wxObjectAllocatorAndCreator* klass::ms_constructor = &constructor##klass; \ const wxChar *klass::ms_constructorProperties[] = \ { wxT(#v0), wxT(#v1), wxT(#v2), wxT(#v3), wxT(#v4) }; \ const int klass::ms_constructorPropertiesCount = 5; // 6 params template<typename Class, typename T0, typename T1, typename T2, typename T3, typename T4, typename T5> struct wxObjectAllocatorAndCreator_6 : public wxObjectAllocatorAndCreator { bool Create(wxObject * &o, wxAny *args) { Class *obj = wx_dynamic_cast(Class*, o); return obj->Create( (args[0]).As(static_cast<T0*>(NULL)), (args[1]).As(static_cast<T1*>(NULL)), (args[2]).As(static_cast<T2*>(NULL)), (args[3]).As(static_cast<T3*>(NULL)), (args[4]).As(static_cast<T4*>(NULL)), (args[5]).As(static_cast<T5*>(NULL)) ); } }; #define wxCONSTRUCTOR_6(klass,t0,v0,t1,v1,t2,v2,t3,v3,t4,v4,t5,v5) \ wxObjectAllocatorAndCreator_6<klass,t0,t1,t2,t3,t4,t5> constructor##klass; \ wxObjectAllocatorAndCreator* klass::ms_constructor = &constructor##klass; \ const wxChar *klass::ms_constructorProperties[] = \ { wxT(#v0), wxT(#v1), wxT(#v2), wxT(#v3), wxT(#v4), wxT(#v5) }; \ const int klass::ms_constructorPropertiesCount = 6; // direct constructor version template<typename Class, typename T0, typename T1, typename T2, typename T3, typename T4, typename T5> struct wxDirectConstructorBridge_6 : public wxObjectAllocator { bool Create(wxObject * &o, wxAny *args) { o = new Class( (args[0]).As(static_cast<T0*>(NULL)), (args[1]).As(static_cast<T1*>(NULL)), (args[2]).As(static_cast<T2*>(NULL)), (args[3]).As(static_cast<T3*>(NULL)), (args[4]).As(static_cast<T4*>(NULL)), (args[5]).As(static_cast<T5*>(NULL)) ); return o != NULL; } }; #define wxDIRECT_CONSTRUCTOR_6(klass,t0,v0,t1,v1,t2,v2,t3,v3,t4,v4,t5,v5) \ wxDirectConstructorBridge_6<klass,t0,t1,t2,t3,t4,t5> constructor##klass; \ wxObjectAllocatorAndCreator* klass::ms_constructor = &constructor##klass; \ const wxChar *klass::ms_constructorProperties[] = { wxT(#v0), wxT(#v1), \ wxT(#v2), wxT(#v3), wxT(#v4), wxT(#v5) }; \ const int klass::ms_constructorPropertiesCount = 6; // 7 params template<typename Class, typename T0, typename T1, typename T2, typename T3, typename T4, typename T5, typename T6> struct wxObjectAllocatorAndCreator_7 : public wxObjectAllocatorAndCreator { bool Create(wxObject * &o, wxAny *args) { Class *obj = wx_dynamic_cast(Class*, o); return obj->Create( (args[0]).As(static_cast<T0*>(NULL)), (args[1]).As(static_cast<T1*>(NULL)), (args[2]).As(static_cast<T2*>(NULL)), (args[3]).As(static_cast<T3*>(NULL)), (args[4]).As(static_cast<T4*>(NULL)), (args[5]).As(static_cast<T5*>(NULL)), (args[6]).As(static_cast<T6*>(NULL)) ); } }; #define wxCONSTRUCTOR_7(klass,t0,v0,t1,v1,t2,v2,t3,v3,t4,v4,t5,v5,t6,v6) \ wxObjectAllocatorAndCreator_7<klass,t0,t1,t2,t3,t4,t5,t6> constructor##klass; \ wxObjectAllocatorAndCreator* klass::ms_constructor = &constructor##klass; \ const wxChar *klass::ms_constructorProperties[] = { wxT(#v0), wxT(#v1), \ wxT(#v2), wxT(#v3), wxT(#v4), wxT(#v5), wxT(#v6) }; \ const int klass::ms_constructorPropertiesCount = 7; // direct constructor version template<typename Class, typename T0, typename T1, typename T2, typename T3, typename T4, typename T5, typename T6> struct wxDirectConstructorBridge_7 : public wxObjectAllocator { bool Create(wxObject * &o, wxAny *args) { o = new Class( (args[0]).As(static_cast<T0*>(NULL)), (args[1]).As(static_cast<T1*>(NULL)), (args[2]).As(static_cast<T2*>(NULL)), (args[3]).As(static_cast<T3*>(NULL)), (args[4]).As(static_cast<T4*>(NULL)), (args[5]).As(static_cast<T5*>(NULL)), (args[6]).As(static_cast<T6*>(NULL)) ); return o != NULL; } }; #define wxDIRECT_CONSTRUCTOR_7(klass,t0,v0,t1,v1,t2,v2,t3,v3,t4,v4,t5,v5,t6,v6) \ wxDirectConstructorBridge_7<klass,t0,t1,t2,t3,t4,t5,t6> constructor##klass; \ wxObjectAllocatorAndCreator* klass::ms_constructor = &constructor##klass; \ const wxChar *klass::ms_constructorProperties[] = \ { wxT(#v0), wxT(#v1), wxT(#v2), wxT(#v3), wxT(#v4), wxT(#v5), wxT(#v6) }; \ const int klass::ms_constructorPropertiesCount = 7; // 8 params template<typename Class, typename T0, typename T1, typename T2, typename T3, typename T4, typename T5, \ typename T6, typename T7> struct wxObjectAllocatorAndCreator_8 : public wxObjectAllocatorAndCreator { bool Create(wxObject * &o, wxAny *args) { Class *obj = wx_dynamic_cast(Class*, o); return obj->Create( (args[0]).As(static_cast<T0*>(NULL)), (args[1]).As(static_cast<T1*>(NULL)), (args[2]).As(static_cast<T2*>(NULL)), (args[3]).As(static_cast<T3*>(NULL)), (args[4]).As(static_cast<T4*>(NULL)), (args[5]).As(static_cast<T5*>(NULL)), (args[6]).As(static_cast<T6*>(NULL)), (args[7]).As(static_cast<T7*>(NULL)) ); } }; #define wxCONSTRUCTOR_8(klass,t0,v0,t1,v1,t2,v2,t3,v3,t4,v4,t5,v5,t6,v6,t7,v7) \ wxObjectAllocatorAndCreator_8<klass,t0,t1,t2,t3,t4,t5,t6,t7> constructor##klass; \ wxObjectAllocatorAndCreator* klass::ms_constructor = &constructor##klass; \ const wxChar *klass::ms_constructorProperties[] = \ { wxT(#v0), wxT(#v1), wxT(#v2), wxT(#v3), wxT(#v4), wxT(#v5), wxT(#v6), wxT(#v7) }; \ const int klass::ms_constructorPropertiesCount = 8; // direct constructor version template<typename Class, typename T0, typename T1, typename T2, typename T3, typename T4, typename T5, \ typename T6, typename T7> struct wxDirectConstructorBridge_8 : public wxObjectAllocator { bool Create(wxObject * &o, wxAny *args) { o = new Class( (args[0]).As(static_cast<T0*>(NULL)), (args[1]).As(static_cast<T1*>(NULL)), (args[2]).As(static_cast<T2*>(NULL)), (args[3]).As(static_cast<T3*>(NULL)), (args[4]).As(static_cast<T4*>(NULL)), (args[5]).As(static_cast<T5*>(NULL)), (args[6]).As(static_cast<T6*>(NULL)), (args[7]).As(static_cast<T7*>(NULL)) ); return o != NULL; } }; #define wxDIRECT_CONSTRUCTOR_8(klass,t0,v0,t1,v1,t2,v2,t3,v3,t4,v4,t5,v5,t6,v6,t7,v7) \ wxDirectConstructorBridge_8<klass,t0,t1,t2,t3,t4,t5,t6,t7> constructor##klass; \ wxObjectAllocatorAndCreator* klass::ms_constructor = &constructor##klass; \ const wxChar *klass::ms_constructorProperties[] = \ { wxT(#v0), wxT(#v1), wxT(#v2), wxT(#v3), wxT(#v4), wxT(#v5), wxT(#v6), wxT(#v7) }; \ const int klass::ms_constructorPropertiesCount = 8; #endif // wxUSE_EXTENDED_RTTI #endif // _XTICTOR_H_
h
rticonnextdds-usecases
data/projects/rticonnextdds-usecases/VehicleTracking/ExampleCode/thirdparty/wxWidgets-3.1.2/Linux/include/wx/nativewin.h
/////////////////////////////////////////////////////////////////////////////// // Name: wx/nativewin.h // Purpose: classes allowing to wrap a native window handle // Author: Vadim Zeitlin // Created: 2008-03-05 // Copyright: (c) 2008 Vadim Zeitlin <[email protected]> // Licence: wxWindows licence /////////////////////////////////////////////////////////////////////////////// #ifndef _WX_NATIVEWIN_H_ #define _WX_NATIVEWIN_H_ #include "wx/toplevel.h" // These symbols can be tested in the user code to see if the current wx port // has support for creating wxNativeContainerWindow and wxNativeWindow from // native windows. // // Be optimistic by default, we undefine them below if necessary. #define wxHAS_NATIVE_CONTAINER_WINDOW #define wxHAS_NATIVE_WINDOW // we define the following typedefs for each of the platform supporting native // windows wrapping: // // - wxNativeContainerWindowHandle is the toolkit-level handle of the native // window, i.e. HWND/GdkWindow*/NSWindow // // - wxNativeContainerWindowId is the lowest level identifier of the native // window, i.e. HWND/GdkNativeWindow/NSWindow (so it's the same as above for // all platforms except GTK where we also can work with Window/XID) // // - wxNativeWindowHandle for child windows, i.e. HWND/GtkWidget*/NSControl #if defined(__WXMSW__) #include "wx/msw/wrapwin.h" typedef HWND wxNativeContainerWindowId; typedef HWND wxNativeContainerWindowHandle; typedef HWND wxNativeWindowHandle; #elif defined(__WXGTK__) // GdkNativeWindow is guint32 under GDK/X11 and gpointer under GDK/WIN32 #ifdef __UNIX__ typedef unsigned long wxNativeContainerWindowId; #else typedef void *wxNativeContainerWindowId; #endif typedef GdkWindow *wxNativeContainerWindowHandle; typedef GtkWidget *wxNativeWindowHandle; #elif defined(__WXOSX_COCOA__) typedef NSView *wxNativeWindowHandle; // no support for using native TLWs yet #undef wxHAS_NATIVE_CONTAINER_WINDOW #else // no support for using native windows under this platform yet #undef wxHAS_NATIVE_CONTAINER_WINDOW #undef wxHAS_NATIVE_WINDOW #endif #ifdef wxHAS_NATIVE_WINDOW // ---------------------------------------------------------------------------- // wxNativeWindow: for using native windows inside wxWidgets windows // ---------------------------------------------------------------------------- class WXDLLIMPEXP_CORE wxNativeWindow : public wxWindow { public: // Default ctor, Create() must be called later to really create the window. wxNativeWindow() { Init(); } // Create a window from an existing native window handle. // // Notice that this ctor doesn't take the usual pos and size parameters, // they're taken from the window handle itself. // // Use GetHandle() to check if the creation was successful, it will return // 0 if the handle was invalid. wxNativeWindow(wxWindow* parent, wxWindowID winid, wxNativeWindowHandle handle) { Init(); Create(parent, winid, handle); } // Same as non-default ctor, but with a return code. bool Create(wxWindow* parent, wxWindowID winid, wxNativeWindowHandle handle); // By default the native window with which this wxWindow is associated is // owned by the user code and needs to be destroyed by it in a platform // specific way, however this function can be called to let wxNativeWindow // dtor take care of destroying the native window instead of having to do // it from the user code. void Disown() { wxCHECK_RET( m_ownedByUser, wxS("Can't disown more than once") ); m_ownedByUser = false; DoDisown(); } #ifdef __WXMSW__ // Prevent the native window, not owned by us, from being destroyed by the // base class dtor, unless Disown() had been called. virtual ~wxNativeWindow(); #endif // __WXMSW__ private: void Init() { m_ownedByUser = true; } // This is implemented in platform-specific code. void DoDisown(); // If the native widget owned by the user code. bool m_ownedByUser; wxDECLARE_NO_COPY_CLASS(wxNativeWindow); }; #endif // wxHAS_NATIVE_WINDOW #ifdef wxHAS_NATIVE_CONTAINER_WINDOW // ---------------------------------------------------------------------------- // wxNativeContainerWindow: can be used for creating other wxWindows inside it // ---------------------------------------------------------------------------- class WXDLLIMPEXP_CORE wxNativeContainerWindow : public wxTopLevelWindow { public: // default ctor, call Create() later wxNativeContainerWindow() { } // create a window from an existing native window handle // // use GetHandle() to check if the creation was successful, it will return // 0 if the handle was invalid wxNativeContainerWindow(wxNativeContainerWindowHandle handle) { Create(handle); } // same as ctor above but with a return code bool Create(wxNativeContainerWindowHandle handle); #if defined(__WXGTK__) // this is a convenient ctor for wxGTK applications which can also create // the objects of this class from the really native window handles and not // only the GdkWindow objects // // wxNativeContainerWindowId is Window (i.e. an XID, i.e. an int) under X11 // (when GDK_WINDOWING_X11 is defined) or HWND under Win32 wxNativeContainerWindow(wxNativeContainerWindowId winid) { Create(winid); } bool Create(wxNativeContainerWindowId winid); #endif // wxGTK // unlike for the normal windows, dtor will not destroy the native window // as it normally doesn't belong to us virtual ~wxNativeContainerWindow(); // provide (trivial) implementation of the base class pure virtuals virtual void SetTitle(const wxString& WXUNUSED(title)) wxOVERRIDE { wxFAIL_MSG( "not implemented for native windows" ); } virtual wxString GetTitle() const wxOVERRIDE { wxFAIL_MSG( "not implemented for native windows" ); return wxString(); } virtual void Maximize(bool WXUNUSED(maximize) = true) wxOVERRIDE { wxFAIL_MSG( "not implemented for native windows" ); } virtual bool IsMaximized() const wxOVERRIDE { wxFAIL_MSG( "not implemented for native windows" ); return false; } virtual void Iconize(bool WXUNUSED(iconize) = true) wxOVERRIDE { wxFAIL_MSG( "not implemented for native windows" ); } virtual bool IsIconized() const wxOVERRIDE { // this is called by wxGTK implementation so don't assert return false; } virtual void Restore() wxOVERRIDE { wxFAIL_MSG( "not implemented for native windows" ); } virtual bool ShowFullScreen(bool WXUNUSED(show), long WXUNUSED(style) = wxFULLSCREEN_ALL) wxOVERRIDE { wxFAIL_MSG( "not implemented for native windows" ); return false; } virtual bool IsFullScreen() const wxOVERRIDE { wxFAIL_MSG( "not implemented for native windows" ); return false; } #ifdef __WXMSW__ virtual bool IsShown() const wxOVERRIDE; #endif // __WXMSW__ // this is an implementation detail: called when the native window is // destroyed by an outside agency; deletes the C++ object too but can in // principle be overridden to something else (knowing that the window // handle of this object and all of its children is invalid any more) virtual void OnNativeDestroyed(); protected: #ifdef __WXMSW__ virtual WXLRESULT MSWWindowProc(WXUINT nMsg, WXWPARAM wParam, WXLPARAM lParam) wxOVERRIDE; #endif // __WXMSW__ private: wxDECLARE_NO_COPY_CLASS(wxNativeContainerWindow); }; #endif // wxHAS_NATIVE_CONTAINER_WINDOW #endif // _WX_NATIVEWIN_H_
h
rticonnextdds-usecases
data/projects/rticonnextdds-usecases/VehicleTracking/ExampleCode/thirdparty/wxWidgets-3.1.2/Linux/include/wx/dynarray.h
/////////////////////////////////////////////////////////////////////////////// // Name: wx/dynarray.h // Purpose: auto-resizable (i.e. dynamic) array support // Author: Vadim Zeitlin // Modified by: // Created: 12.09.97 // Copyright: (c) 1998 Vadim Zeitlin <[email protected]> // Licence: wxWindows licence /////////////////////////////////////////////////////////////////////////////// #ifndef _DYNARRAY_H #define _DYNARRAY_H #include "wx/defs.h" #include "wx/vector.h" /* This header defines legacy dynamic arrays and object arrays (i.e. arrays which own their elements) classes. Do *NOT* use them in the new code, these classes exist for compatibility only. Simply use standard container, e.g. std::vector<>, in your own code. */ #define _WX_ERROR_REMOVE "removing inexistent element in wxArray::Remove" // ---------------------------------------------------------------------------- // types // ---------------------------------------------------------------------------- /* Callback compare function for quick sort. It must return negative value, 0 or positive value if the first item is less than, equal to or greater than the second one. */ extern "C" { typedef int (wxCMPFUNC_CONV *CMPFUNC)(const void* pItem1, const void* pItem2); } // ---------------------------------------------------------------------------- // Array class providing legacy dynamic arrays API on top of wxVector<> // ---------------------------------------------------------------------------- // For some reasons lost in the depths of time, sort functions with different // signatures are used to sort normal arrays and to keep sorted arrays sorted. // These two functors can be used as predicates with std::sort() adapting the // sort function to it, whichever signature it uses. template<class T> class wxArray_SortFunction { public: typedef int (wxCMPFUNC_CONV *CMPFUNC)(T* pItem1, T* pItem2); wxArray_SortFunction(CMPFUNC f) : m_f(f) { } bool operator()(const T& i1, const T& i2) { return m_f(const_cast<T*>(&i1), const_cast<T*>(&i2)) < 0; } private: CMPFUNC m_f; }; template<class T> class wxSortedArray_SortFunction { public: typedef int (wxCMPFUNC_CONV *CMPFUNC)(T, T); wxSortedArray_SortFunction(CMPFUNC f) : m_f(f) { } bool operator()(const T& i1, const T& i2) { return m_f(i1, i2) < 0; } private: CMPFUNC m_f; }; template <typename T, typename Sorter = wxSortedArray_SortFunction<T> > class wxBaseArray : public wxVector<T> { public: typedef typename Sorter::CMPFUNC SCMPFUNC; typedef typename wxArray_SortFunction<T>::CMPFUNC CMPFUNC; typedef wxVector<T> base_vec; typedef typename base_vec::value_type value_type; typedef typename base_vec::reference reference; typedef typename base_vec::const_reference const_reference; typedef typename base_vec::iterator iterator; typedef typename base_vec::const_iterator const_iterator; typedef typename base_vec::const_reverse_iterator const_reverse_iterator; typedef typename base_vec::difference_type difference_type; typedef typename base_vec::size_type size_type; public: typedef T base_type; wxBaseArray() : base_vec() { } explicit wxBaseArray(size_t n) : base_vec(n) { } wxBaseArray(size_t n, const_reference v) : base_vec(n, v) { } template <class InputIterator> wxBaseArray(InputIterator first, InputIterator last) : base_vec(first, last) { } void Empty() { this->clear(); } void Clear() { this->clear(); } void Alloc(size_t uiSize) { this->reserve(uiSize); } void Shrink() { wxShrinkToFit(*this); } size_t GetCount() const { return this->size(); } void SetCount(size_t n, T v = T()) { this->resize(n, v); } bool IsEmpty() const { return this->empty(); } size_t Count() const { return this->size(); } T& Item(size_t uiIndex) const { wxASSERT( uiIndex < this->size() ); return const_cast<T&>((*this)[uiIndex]); } T& Last() const { return Item(this->size() - 1); } int Index(T item, bool bFromEnd = false) const { if ( bFromEnd ) { const const_reverse_iterator b = this->rbegin(), e = this->rend(); for ( const_reverse_iterator i = b; i != e; ++i ) if ( *i == item ) return (int)(e - i - 1); } else { const const_iterator b = this->begin(), e = this->end(); for ( const_iterator i = b; i != e; ++i ) if ( *i == item ) return (int)(i - b); } return wxNOT_FOUND; } int Index(T lItem, SCMPFUNC fnCompare) const { Sorter p(fnCompare); const_iterator i = std::lower_bound(this->begin(), this->end(), lItem, p); return i != this->end() && !p(lItem, *i) ? (int)(i - this->begin()) : wxNOT_FOUND; } size_t IndexForInsert(T lItem, SCMPFUNC fnCompare) const { Sorter p(fnCompare); const_iterator i = std::lower_bound(this->begin(), this->end(), lItem, p); return i - this->begin(); } void Add(T lItem, size_t nInsert = 1) { this->insert(this->end(), nInsert, lItem); } size_t Add(T lItem, SCMPFUNC fnCompare) { size_t n = IndexForInsert(lItem, fnCompare); Insert(lItem, n); return n; } void Insert(T lItem, size_t uiIndex, size_t nInsert = 1) { this->insert(this->begin() + uiIndex, nInsert, lItem); } void Remove(T lItem) { int n = Index(lItem); wxCHECK_RET( n != wxNOT_FOUND, _WX_ERROR_REMOVE ); RemoveAt((size_t)n); } void RemoveAt(size_t uiIndex, size_t nRemove = 1) { this->erase(this->begin() + uiIndex, this->begin() + uiIndex + nRemove); } void Sort(CMPFUNC fCmp) { wxArray_SortFunction<T> p(fCmp); std::sort(this->begin(), this->end(), p); } void Sort(SCMPFUNC fCmp) { Sorter p(fCmp); std::sort(this->begin(), this->end(), p); } }; // ============================================================================ // The private helper macros containing the core of the array classes // ============================================================================ // ---------------------------------------------------------------------------- // _WX_DEFINE_SORTED_TYPEARRAY: sorted array for simple data types // cannot handle types with size greater than pointer because of sorting // ---------------------------------------------------------------------------- // Note that "classdecl" here is intentionally not used because this class has // only inline methods and so never needs to be exported from a DLL. #define _WX_DEFINE_SORTED_TYPEARRAY_2(T, name, base, defcomp, classdecl) \ typedef wxBaseSortedArray<T> wxBaseSortedArrayFor##name; \ class name : public wxBaseSortedArrayFor##name \ { \ public: \ name(wxBaseSortedArrayFor##name::SCMPFUNC fn defcomp) \ : wxBaseSortedArrayFor##name(fn) { } \ } template <typename T, typename Sorter = wxSortedArray_SortFunction<T> > class wxBaseSortedArray : public wxBaseArray<T, Sorter> { public: typedef typename Sorter::CMPFUNC SCMPFUNC; explicit wxBaseSortedArray(SCMPFUNC fn) : m_fnCompare(fn) { } wxBaseSortedArray& operator=(const wxBaseSortedArray& src) { wxBaseArray<T, Sorter>::operator=(src); m_fnCompare = src.m_fnCompare; return *this; } size_t IndexForInsert(T item) const { return this->wxBaseArray<T, Sorter>::IndexForInsert(item, m_fnCompare); } void AddAt(T item, size_t index) { this->insert(this->begin() + index, item); } size_t Add(T item) { return this->wxBaseArray<T, Sorter>::Add(item, m_fnCompare); } void push_back(T item) { Add(item); } private: SCMPFUNC m_fnCompare; }; // ---------------------------------------------------------------------------- // _WX_DECLARE_OBJARRAY: an array for pointers to type T with owning semantics // ---------------------------------------------------------------------------- // This class must be able to be declared with incomplete types, so it doesn't // actually use type T in its definition, and relies on a helper template // parameter, which is declared by WX_DECLARE_OBJARRAY() and defined by // WX_DEFINE_OBJARRAY(), for providing a way to create and destroy objects of // type T template <typename T, typename Traits> class wxBaseObjectArray : private wxBaseArray<T*> { typedef wxBaseArray<T*> base; public: typedef T value_type; typedef int (wxCMPFUNC_CONV *CMPFUNC)(T **pItem1, T **pItem2); wxBaseObjectArray() { } wxBaseObjectArray(const wxBaseObjectArray& src) : base() { DoCopy(src); } wxBaseObjectArray& operator=(const wxBaseObjectArray& src) { Empty(); DoCopy(src); return *this; } ~wxBaseObjectArray() { Empty(); } void Alloc(size_t count) { base::reserve(count); } void reserve(size_t count) { base::reserve(count); } size_t GetCount() const { return base::size(); } size_t size() const { return base::size(); } bool IsEmpty() const { return base::empty(); } bool empty() const { return base::empty(); } size_t Count() const { return base::size(); } void Shrink() { base::Shrink(); } T& operator[](size_t uiIndex) const { return *base::operator[](uiIndex); } T& Item(size_t uiIndex) const { return *base::operator[](uiIndex); } T& Last() const { return *(base::operator[](size() - 1)); } int Index(const T& item, bool bFromEnd = false) const { if ( bFromEnd ) { if ( size() > 0 ) { size_t ui = size() - 1; do { if ( base::operator[](ui) == &item ) return static_cast<int>(ui); ui--; } while ( ui != 0 ); } } else { for ( size_t ui = 0; ui < size(); ++ui ) { if( base::operator[](ui) == &item ) return static_cast<int>(ui); } } return wxNOT_FOUND; } void Add(const T& item, size_t nInsert = 1) { if ( nInsert == 0 ) return; T* const pItem = Traits::Clone(item); const size_t nOldSize = size(); if ( pItem != NULL ) base::insert(this->end(), nInsert, pItem); for ( size_t i = 1; i < nInsert; i++ ) base::operator[](nOldSize + i) = Traits::Clone(item); } void Add(const T* pItem) { base::push_back(const_cast<T*>(pItem)); } void push_back(const T* pItem) { Add(pItem); } void push_back(const T& item) { Add(item); } void Insert(const T& item, size_t uiIndex, size_t nInsert = 1) { if ( nInsert == 0 ) return; T* const pItem = Traits::Clone(item); if ( pItem != NULL ) base::insert(this->begin() + uiIndex, nInsert, pItem); for ( size_t i = 1; i < nInsert; ++i ) base::operator[](uiIndex + i) = Traits::Clone(item); } void Insert(const T* pItem, size_t uiIndex) { base::insert(this->begin() + uiIndex, (T*)pItem); } void Empty() { DoEmpty(); base::clear(); } void Clear() { DoEmpty(); base::clear(); } T* Detach(size_t uiIndex) { T* const p = base::operator[](uiIndex); base::erase(this->begin() + uiIndex); return p; } void RemoveAt(size_t uiIndex, size_t nRemove = 1) { wxCHECK_RET( uiIndex < size(), "bad index in RemoveAt()" ); for ( size_t i = 0; i < nRemove; ++i ) Traits::Free(base::operator[](uiIndex + i)); base::erase(this->begin() + uiIndex, this->begin() + uiIndex + nRemove); } void Sort(CMPFUNC fCmp) { base::Sort(fCmp); } private: void DoEmpty() { for ( size_t n = 0; n < size(); ++n ) Traits::Free(base::operator[](n)); } void DoCopy(const wxBaseObjectArray& src) { reserve(src.size()); for ( size_t n = 0; n < src.size(); ++n ) Add(src[n]); } }; // ============================================================================ // The public macros for declaration and definition of the dynamic arrays // ============================================================================ // Please note that for each macro WX_FOO_ARRAY we also have // WX_FOO_EXPORTED_ARRAY and WX_FOO_USER_EXPORTED_ARRAY which are exactly the // same except that they use an additional __declspec(dllexport) or equivalent // under Windows if needed. // // The first (just EXPORTED) macros do it if wxWidgets was compiled as a DLL // and so must be used used inside the library. The second kind (USER_EXPORTED) // allow the user code to do it when it wants. This is needed if you have a dll // that wants to export a wxArray daubed with your own import/export goo. // // Finally, you can define the macro below as something special to modify the // arrays defined by a simple WX_FOO_ARRAY as well. By default is empty. #define wxARRAY_DEFAULT_EXPORT // ---------------------------------------------------------------------------- // WX_DECLARE_BASEARRAY(T, name): now is the same as WX_DEFINE_TYPEARRAY() // below, only preserved for compatibility. // ---------------------------------------------------------------------------- #define wxARRAY_DUMMY_BASE #define WX_DECLARE_BASEARRAY(T, name) \ WX_DEFINE_TYPEARRAY(T, name) #define WX_DECLARE_EXPORTED_BASEARRAY(T, name) \ WX_DEFINE_EXPORTED_TYPEARRAY(T, name, WXDLLIMPEXP_CORE) #define WX_DECLARE_USER_EXPORTED_BASEARRAY(T, name, expmode) \ WX_DEFINE_TYPEARRAY_WITH_DECL(T, name, wxARRAY_DUMMY_BASE, class expmode) // ---------------------------------------------------------------------------- // WX_DEFINE_TYPEARRAY(T, name, base) define an array class named "name" // containing the elements of type T. Note that the argument "base" is unused // and is preserved for compatibility only. Also, macros with and without // "_PTR" suffix are identical, and the latter ones are also kept only for // compatibility. // ---------------------------------------------------------------------------- #define WX_DEFINE_TYPEARRAY(T, name, base) \ WX_DEFINE_TYPEARRAY_WITH_DECL(T, name, base, class wxARRAY_DEFAULT_EXPORT) #define WX_DEFINE_TYPEARRAY_PTR(T, name, base) \ WX_DEFINE_TYPEARRAY_WITH_DECL_PTR(T, name, base, class wxARRAY_DEFAULT_EXPORT) #define WX_DEFINE_EXPORTED_TYPEARRAY(T, name, base) \ WX_DEFINE_TYPEARRAY_WITH_DECL(T, name, base, class WXDLLIMPEXP_CORE) #define WX_DEFINE_EXPORTED_TYPEARRAY_PTR(T, name, base) \ WX_DEFINE_TYPEARRAY_WITH_DECL_PTR(T, name, base, class WXDLLIMPEXP_CORE) #define WX_DEFINE_USER_EXPORTED_TYPEARRAY(T, name, base, expdecl) \ WX_DEFINE_TYPEARRAY_WITH_DECL(T, name, base, class expdecl) #define WX_DEFINE_USER_EXPORTED_TYPEARRAY_PTR(T, name, base, expdecl) \ WX_DEFINE_TYPEARRAY_WITH_DECL_PTR(T, name, base, class expdecl) // This is the only non-trivial macro, which actually defines the array class // with the given name containing the elements of the specified type. // // Note that "name" must be a class and not just a typedef because it can be // (and is) forward declared in the existing code. // // As mentioned above, "base" is unused and so is "classdecl" as this class has // only inline methods and so never needs to be exported from MSW DLLs. // // Note about apparently redundant wxBaseArray##name typedef: this is needed to // avoid clashes between T and symbols defined in wxBaseArray<> scope, e.g. if // we didn't do this, we would have compilation problems with arrays of type // "Item" (which is also the name of a method in wxBaseArray<>). #define WX_DEFINE_TYPEARRAY_WITH_DECL(T, name, base, classdecl) \ typedef wxBaseArray<T> wxBaseArrayFor##name; \ class name : public wxBaseArrayFor##name \ { \ typedef wxBaseArrayFor##name Base; \ public: \ name() : Base() { } \ explicit name(size_t n) : Base(n) { } \ name(size_t n, Base::const_reference v) : Base(n, v) { } \ template <class InputIterator> \ name(InputIterator first, InputIterator last) : Base(first, last) { } \ } #define WX_DEFINE_TYPEARRAY_WITH_DECL_PTR(T, name, base, classdecl) \ WX_DEFINE_TYPEARRAY_WITH_DECL(T, name, base, classdecl) // ---------------------------------------------------------------------------- // WX_DEFINE_SORTED_TYPEARRAY: this is the same as the previous macro, but it // defines a sorted array. // // Differences: // 1) it must be given a COMPARE function in ctor which takes 2 items of type // T* and should return -1, 0 or +1 if the first one is less/greater // than/equal to the second one. // 2) the Add() method inserts the item in such was that the array is always // sorted (it uses the COMPARE function) // 3) it has no Sort() method because it's always sorted // 4) Index() method is much faster (the sorted arrays use binary search // instead of linear one), but Add() is slower. // 5) there is no Insert() method because you can't insert an item into the // given position in a sorted array but there is IndexForInsert()/AddAt() // pair which may be used to optimize a common operation of "insert only if // not found" // // Note that you have to specify the comparison function when creating the // objects of this array type. If, as in 99% of cases, the comparison function // is the same for all objects of a class, WX_DEFINE_SORTED_TYPEARRAY_CMP below // is more convenient. // // Summary: use this class when the speed of Index() function is important, use // the normal arrays otherwise. // ---------------------------------------------------------------------------- // we need a macro which expands to nothing to pass correct number of // parameters to a nested macro invocation even when we don't have anything to // pass it #define wxARRAY_EMPTY #define WX_DEFINE_SORTED_TYPEARRAY(T, name, base) \ WX_DEFINE_SORTED_USER_EXPORTED_TYPEARRAY(T, name, base, \ wxARRAY_DEFAULT_EXPORT) #define WX_DEFINE_SORTED_EXPORTED_TYPEARRAY(T, name, base) \ WX_DEFINE_SORTED_USER_EXPORTED_TYPEARRAY(T, name, base, WXDLLIMPEXP_CORE) #define WX_DEFINE_SORTED_USER_EXPORTED_TYPEARRAY(T, name, base, expmode) \ typedef T _wxArray##name; \ _WX_DEFINE_SORTED_TYPEARRAY_2(_wxArray##name, name, base, \ wxARRAY_EMPTY, class expmode) // ---------------------------------------------------------------------------- // WX_DEFINE_SORTED_TYPEARRAY_CMP: exactly the same as above but the comparison // function is provided by this macro and the objects of this class have a // default constructor which just uses it. // // The arguments are: the element type, the comparison function and the array // name // // NB: this is, of course, how WX_DEFINE_SORTED_TYPEARRAY() should have worked // from the very beginning - unfortunately I didn't think about this earlier // ---------------------------------------------------------------------------- #define WX_DEFINE_SORTED_TYPEARRAY_CMP(T, cmpfunc, name, base) \ WX_DEFINE_SORTED_USER_EXPORTED_TYPEARRAY_CMP(T, cmpfunc, name, base, \ wxARRAY_DEFAULT_EXPORT) #define WX_DEFINE_SORTED_EXPORTED_TYPEARRAY_CMP(T, cmpfunc, name, base) \ WX_DEFINE_SORTED_USER_EXPORTED_TYPEARRAY_CMP(T, cmpfunc, name, base, \ WXDLLIMPEXP_CORE) #define WX_DEFINE_SORTED_USER_EXPORTED_TYPEARRAY_CMP(T, cmpfunc, name, base, \ expmode) \ typedef T _wxArray##name; \ _WX_DEFINE_SORTED_TYPEARRAY_2(_wxArray##name, name, base, = cmpfunc, \ class expmode) // ---------------------------------------------------------------------------- // WX_DECLARE_OBJARRAY(T, name): this macro generates a new array class // named "name" which owns the objects of type T it contains, i.e. it will // delete them when it is destroyed. // // An element is of type T*, but arguments of type T& are taken (see below!) // and T& is returned. // // Don't use this for simple types such as "int" or "long"! // // Note on Add/Insert functions: // 1) function(T*) gives the object to the array, i.e. it will delete the // object when it's removed or in the array's dtor // 2) function(T&) will create a copy of the object and work with it // // Also: // 1) Remove() will delete the object after removing it from the array // 2) Detach() just removes the object from the array (returning pointer to it) // // NB1: Base type T should have an accessible copy ctor if Add(T&) is used // NB2: Never ever cast a array to it's base type: as dtor is not virtual // and so you risk having at least the memory leaks and probably worse // // Some functions of this class are not inline, so it takes some space to // define new class from this template even if you don't use it - which is not // the case for the simple (non-object) array classes // // To use an objarray class you must // #include "dynarray.h" // WX_DECLARE_OBJARRAY(element_type, list_class_name) // #include "arrimpl.cpp" // WX_DEFINE_OBJARRAY(list_class_name) // name must be the same as above! // // This is necessary because at the moment of DEFINE_OBJARRAY class parsing the // element_type must be fully defined (i.e. forward declaration is not // enough), while WX_DECLARE_OBJARRAY may be done anywhere. The separation of // two allows to break cicrcular dependencies with classes which have member // variables of objarray type. // ---------------------------------------------------------------------------- #define WX_DECLARE_OBJARRAY(T, name) \ WX_DECLARE_USER_EXPORTED_OBJARRAY(T, name, wxARRAY_DEFAULT_EXPORT) #define WX_DECLARE_EXPORTED_OBJARRAY(T, name) \ WX_DECLARE_USER_EXPORTED_OBJARRAY(T, name, WXDLLIMPEXP_CORE) #define WX_DECLARE_OBJARRAY_WITH_DECL(T, name, classdecl) \ classdecl wxObjectArrayTraitsFor##name \ { \ public: \ static T* Clone(T const& item); \ static void Free(T* p); \ }; \ typedef wxBaseObjectArray<T, wxObjectArrayTraitsFor##name> \ wxBaseObjectArrayFor##name; \ classdecl name : public wxBaseObjectArrayFor##name \ { \ public: \ name() : wxBaseObjectArrayFor##name() { } \ name(const name& src) : wxBaseObjectArrayFor##name(src) { } \ } #define WX_DECLARE_USER_EXPORTED_OBJARRAY(T, name, expmode) \ WX_DECLARE_OBJARRAY_WITH_DECL(T, name, class expmode) // WX_DEFINE_OBJARRAY is going to be redefined when arrimpl.cpp is included, // try to provoke a human-understandable error if it used incorrectly. // // there is no real need for 3 different macros in the DEFINE case but do it // anyhow for consistency #define WX_DEFINE_OBJARRAY(name) DidYouIncludeArrimplCpp #define WX_DEFINE_EXPORTED_OBJARRAY(name) WX_DEFINE_OBJARRAY(name) #define WX_DEFINE_USER_EXPORTED_OBJARRAY(name) WX_DEFINE_OBJARRAY(name) // ---------------------------------------------------------------------------- // Some commonly used predefined base arrays // ---------------------------------------------------------------------------- WX_DECLARE_USER_EXPORTED_BASEARRAY(const void *, wxBaseArrayPtrVoid, WXDLLIMPEXP_BASE); WX_DECLARE_USER_EXPORTED_BASEARRAY(char, wxBaseArrayChar, WXDLLIMPEXP_BASE); WX_DECLARE_USER_EXPORTED_BASEARRAY(short, wxBaseArrayShort, WXDLLIMPEXP_BASE); WX_DECLARE_USER_EXPORTED_BASEARRAY(int, wxBaseArrayInt, WXDLLIMPEXP_BASE); WX_DECLARE_USER_EXPORTED_BASEARRAY(long, wxBaseArrayLong, WXDLLIMPEXP_BASE); WX_DECLARE_USER_EXPORTED_BASEARRAY(size_t, wxBaseArraySizeT, WXDLLIMPEXP_BASE); WX_DECLARE_USER_EXPORTED_BASEARRAY(double, wxBaseArrayDouble, WXDLLIMPEXP_BASE); // ---------------------------------------------------------------------------- // Convenience macros to define arrays from base arrays // ---------------------------------------------------------------------------- #define WX_DEFINE_ARRAY(T, name) \ WX_DEFINE_TYPEARRAY(T, name, wxBaseArrayPtrVoid) #define WX_DEFINE_ARRAY_PTR(T, name) \ WX_DEFINE_TYPEARRAY_PTR(T, name, wxBaseArrayPtrVoid) #define WX_DEFINE_EXPORTED_ARRAY(T, name) \ WX_DEFINE_EXPORTED_TYPEARRAY(T, name, wxBaseArrayPtrVoid) #define WX_DEFINE_EXPORTED_ARRAY_PTR(T, name) \ WX_DEFINE_EXPORTED_TYPEARRAY_PTR(T, name, wxBaseArrayPtrVoid) #define WX_DEFINE_ARRAY_WITH_DECL_PTR(T, name, decl) \ WX_DEFINE_TYPEARRAY_WITH_DECL_PTR(T, name, wxBaseArrayPtrVoid, decl) #define WX_DEFINE_USER_EXPORTED_ARRAY(T, name, expmode) \ WX_DEFINE_TYPEARRAY_WITH_DECL(T, name, wxBaseArrayPtrVoid, wxARRAY_EMPTY expmode) #define WX_DEFINE_USER_EXPORTED_ARRAY_PTR(T, name, expmode) \ WX_DEFINE_TYPEARRAY_WITH_DECL_PTR(T, name, wxBaseArrayPtrVoid, wxARRAY_EMPTY expmode) #define WX_DEFINE_ARRAY_CHAR(T, name) \ WX_DEFINE_TYPEARRAY_PTR(T, name, wxBaseArrayChar) #define WX_DEFINE_EXPORTED_ARRAY_CHAR(T, name) \ WX_DEFINE_EXPORTED_TYPEARRAY_PTR(T, name, wxBaseArrayChar) #define WX_DEFINE_USER_EXPORTED_ARRAY_CHAR(T, name, expmode) \ WX_DEFINE_TYPEARRAY_WITH_DECL_PTR(T, name, wxBaseArrayChar, wxARRAY_EMPTY expmode) #define WX_DEFINE_ARRAY_SHORT(T, name) \ WX_DEFINE_TYPEARRAY_PTR(T, name, wxBaseArrayShort) #define WX_DEFINE_EXPORTED_ARRAY_SHORT(T, name) \ WX_DEFINE_EXPORTED_TYPEARRAY_PTR(T, name, wxBaseArrayShort) #define WX_DEFINE_USER_EXPORTED_ARRAY_SHORT(T, name, expmode) \ WX_DEFINE_TYPEARRAY_WITH_DECL_PTR(T, name, wxBaseArrayShort, wxARRAY_EMPTY expmode) #define WX_DEFINE_ARRAY_INT(T, name) \ WX_DEFINE_TYPEARRAY_PTR(T, name, wxBaseArrayInt) #define WX_DEFINE_EXPORTED_ARRAY_INT(T, name) \ WX_DEFINE_EXPORTED_TYPEARRAY_PTR(T, name, wxBaseArrayInt) #define WX_DEFINE_USER_EXPORTED_ARRAY_INT(T, name, expmode) \ WX_DEFINE_TYPEARRAY_WITH_DECL_PTR(T, name, wxBaseArrayInt, wxARRAY_EMPTY expmode) #define WX_DEFINE_ARRAY_LONG(T, name) \ WX_DEFINE_TYPEARRAY_PTR(T, name, wxBaseArrayLong) #define WX_DEFINE_EXPORTED_ARRAY_LONG(T, name) \ WX_DEFINE_EXPORTED_TYPEARRAY_PTR(T, name, wxBaseArrayLong) #define WX_DEFINE_USER_EXPORTED_ARRAY_LONG(T, name, expmode) \ WX_DEFINE_TYPEARRAY_WITH_DECL_PTR(T, name, wxBaseArrayLong, wxARRAY_EMPTY expmode) #define WX_DEFINE_ARRAY_SIZE_T(T, name) \ WX_DEFINE_TYPEARRAY_PTR(T, name, wxBaseArraySizeT) #define WX_DEFINE_EXPORTED_ARRAY_SIZE_T(T, name) \ WX_DEFINE_EXPORTED_TYPEARRAY_PTR(T, name, wxBaseArraySizeT) #define WX_DEFINE_USER_EXPORTED_ARRAY_SIZE_T(T, name, expmode) \ WX_DEFINE_TYPEARRAY_WITH_DECL_PTR(T, name, wxBaseArraySizeT, wxARRAY_EMPTY expmode) #define WX_DEFINE_ARRAY_DOUBLE(T, name) \ WX_DEFINE_TYPEARRAY_PTR(T, name, wxBaseArrayDouble) #define WX_DEFINE_EXPORTED_ARRAY_DOUBLE(T, name) \ WX_DEFINE_EXPORTED_TYPEARRAY_PTR(T, name, wxBaseArrayDouble) #define WX_DEFINE_USER_EXPORTED_ARRAY_DOUBLE(T, name, expmode) \ WX_DEFINE_TYPEARRAY_WITH_DECL_PTR(T, name, wxBaseArrayDouble, wxARRAY_EMPTY expmode) // ---------------------------------------------------------------------------- // Convenience macros to define sorted arrays from base arrays // ---------------------------------------------------------------------------- #define WX_DEFINE_SORTED_ARRAY(T, name) \ WX_DEFINE_SORTED_TYPEARRAY(T, name, wxBaseArrayPtrVoid) #define WX_DEFINE_SORTED_EXPORTED_ARRAY(T, name) \ WX_DEFINE_SORTED_EXPORTED_TYPEARRAY(T, name, wxBaseArrayPtrVoid) #define WX_DEFINE_SORTED_USER_EXPORTED_ARRAY(T, name, expmode) \ WX_DEFINE_SORTED_USER_EXPORTED_TYPEARRAY(T, name, wxBaseArrayPtrVoid, wxARRAY_EMPTY expmode) #define WX_DEFINE_SORTED_ARRAY_CHAR(T, name) \ WX_DEFINE_SORTED_TYPEARRAY(T, name, wxBaseArrayChar) #define WX_DEFINE_SORTED_EXPORTED_ARRAY_CHAR(T, name) \ WX_DEFINE_SORTED_EXPORTED_TYPEARRAY(T, name, wxBaseArrayChar) #define WX_DEFINE_SORTED_USER_EXPORTED_ARRAY_CHAR(T, name, expmode) \ WX_DEFINE_SORTED_USER_EXPORTED_TYPEARRAY(T, name, wxBaseArrayChar, wxARRAY_EMPTY expmode) #define WX_DEFINE_SORTED_ARRAY_SHORT(T, name) \ WX_DEFINE_SORTED_TYPEARRAY(T, name, wxBaseArrayShort) #define WX_DEFINE_SORTED_EXPORTED_ARRAY_SHORT(T, name) \ WX_DEFINE_SORTED_EXPORTED_TYPEARRAY(T, name, wxBaseArrayShort) #define WX_DEFINE_SORTED_USER_EXPORTED_ARRAY_SHORT(T, name, expmode) \ WX_DEFINE_SORTED_USER_EXPORTED_TYPEARRAY(T, name, wxBaseArrayShort, wxARRAY_EMPTY expmode) #define WX_DEFINE_SORTED_ARRAY_INT(T, name) \ WX_DEFINE_SORTED_TYPEARRAY(T, name, wxBaseArrayInt) #define WX_DEFINE_SORTED_EXPORTED_ARRAY_INT(T, name) \ WX_DEFINE_SORTED_EXPORTED_TYPEARRAY(T, name, wxBaseArrayInt) #define WX_DEFINE_SORTED_USER_EXPORTED_ARRAY_INT(T, name, expmode) \ WX_DEFINE_SORTED_USER_EXPORTED_TYPEARRAY(T, name, wxBaseArrayInt, expmode) #define WX_DEFINE_SORTED_ARRAY_LONG(T, name) \ WX_DEFINE_SORTED_TYPEARRAY(T, name, wxBaseArrayLong) #define WX_DEFINE_SORTED_EXPORTED_ARRAY_LONG(T, name) \ WX_DEFINE_SORTED_EXPORTED_TYPEARRAY(T, name, wxBaseArrayLong) #define WX_DEFINE_SORTED_USER_EXPORTED_ARRAY_LONG(T, name, expmode) \ WX_DEFINE_SORTED_USER_EXPORTED_TYPEARRAY(T, name, wxBaseArrayLong, expmode) #define WX_DEFINE_SORTED_ARRAY_SIZE_T(T, name) \ WX_DEFINE_SORTED_TYPEARRAY(T, name, wxBaseArraySizeT) #define WX_DEFINE_SORTED_EXPORTED_ARRAY_SIZE_T(T, name) \ WX_DEFINE_SORTED_EXPORTED_TYPEARRAY(T, name, wxBaseArraySizeT) #define WX_DEFINE_SORTED_USER_EXPORTED_ARRAY_SIZE_T(T, name, expmode) \ WX_DEFINE_SORTED_USER_EXPORTED_TYPEARRAY(T, name, wxBaseArraySizeT, wxARRAY_EMPTY expmode) // ---------------------------------------------------------------------------- // Convenience macros to define sorted arrays from base arrays // ---------------------------------------------------------------------------- #define WX_DEFINE_SORTED_ARRAY_CMP(T, cmpfunc, name) \ WX_DEFINE_SORTED_TYPEARRAY_CMP(T, cmpfunc, name, wxBaseArrayPtrVoid) #define WX_DEFINE_SORTED_EXPORTED_ARRAY_CMP(T, cmpfunc, name) \ WX_DEFINE_SORTED_EXPORTED_TYPEARRAY_CMP(T, cmpfunc, name, wxBaseArrayPtrVoid) #define WX_DEFINE_SORTED_USER_EXPORTED_ARRAY_CMP(T, cmpfunc, \ name, expmode) \ WX_DEFINE_SORTED_USER_EXPORTED_TYPEARRAY_CMP(T, cmpfunc, name, \ wxBaseArrayPtrVoid, \ wxARRAY_EMPTY expmode) #define WX_DEFINE_SORTED_ARRAY_CMP_CHAR(T, cmpfunc, name) \ WX_DEFINE_SORTED_TYPEARRAY_CMP(T, cmpfunc, name, wxBaseArrayChar) #define WX_DEFINE_SORTED_EXPORTED_ARRAY_CMP_CHAR(T, cmpfunc, name) \ WX_DEFINE_SORTED_EXPORTED_TYPEARRAY_CMP(T, cmpfunc, name, wxBaseArrayChar) #define WX_DEFINE_SORTED_USER_EXPORTED_ARRAY_CMP_CHAR(T, cmpfunc, \ name, expmode) \ WX_DEFINE_SORTED_USER_EXPORTED_TYPEARRAY_CMP(T, cmpfunc, name, \ wxBaseArrayChar, \ wxARRAY_EMPTY expmode) #define WX_DEFINE_SORTED_ARRAY_CMP_SHORT(T, cmpfunc, name) \ WX_DEFINE_SORTED_TYPEARRAY_CMP(T, cmpfunc, name, wxBaseArrayShort) #define WX_DEFINE_SORTED_EXPORTED_ARRAY_CMP_SHORT(T, cmpfunc, name) \ WX_DEFINE_SORTED_EXPORTED_TYPEARRAY_CMP(T, cmpfunc, name, wxBaseArrayShort) #define WX_DEFINE_SORTED_USER_EXPORTED_ARRAY_CMP_SHORT(T, cmpfunc, \ name, expmode) \ WX_DEFINE_SORTED_USER_EXPORTED_TYPEARRAY_CMP(T, cmpfunc, name, \ wxBaseArrayShort, \ wxARRAY_EMPTY expmode) #define WX_DEFINE_SORTED_ARRAY_CMP_INT(T, cmpfunc, name) \ WX_DEFINE_SORTED_TYPEARRAY_CMP(T, cmpfunc, name, wxBaseArrayInt) #define WX_DEFINE_SORTED_EXPORTED_ARRAY_CMP_INT(T, cmpfunc, name) \ WX_DEFINE_SORTED_EXPORTED_TYPEARRAY_CMP(T, cmpfunc, name, wxBaseArrayInt) #define WX_DEFINE_SORTED_USER_EXPORTED_ARRAY_CMP_INT(T, cmpfunc, \ name, expmode) \ WX_DEFINE_SORTED_USER_EXPORTED_TYPEARRAY_CMP(T, cmpfunc, name, \ wxBaseArrayInt, \ wxARRAY_EMPTY expmode) #define WX_DEFINE_SORTED_ARRAY_CMP_LONG(T, cmpfunc, name) \ WX_DEFINE_SORTED_TYPEARRAY_CMP(T, cmpfunc, name, wxBaseArrayLong) #define WX_DEFINE_SORTED_EXPORTED_ARRAY_CMP_LONG(T, cmpfunc, name) \ WX_DEFINE_SORTED_EXPORTED_TYPEARRAY_CMP(T, cmpfunc, name, wxBaseArrayLong) #define WX_DEFINE_SORTED_USER_EXPORTED_ARRAY_CMP_LONG(T, cmpfunc, \ name, expmode) \ WX_DEFINE_SORTED_USER_EXPORTED_TYPEARRAY_CMP(T, cmpfunc, name, \ wxBaseArrayLong, \ wxARRAY_EMPTY expmode) #define WX_DEFINE_SORTED_ARRAY_CMP_SIZE_T(T, cmpfunc, name) \ WX_DEFINE_SORTED_TYPEARRAY_CMP(T, cmpfunc, name, wxBaseArraySizeT) #define WX_DEFINE_SORTED_EXPORTED_ARRAY_CMP_SIZE_T(T, cmpfunc, name) \ WX_DEFINE_SORTED_EXPORTED_TYPEARRAY_CMP(T, cmpfunc, name, wxBaseArraySizeT) #define WX_DEFINE_SORTED_USER_EXPORTED_ARRAY_CMP_SIZE_T(T, cmpfunc, \ name, expmode) \ WX_DEFINE_SORTED_USER_EXPORTED_TYPEARRAY_CMP(T, cmpfunc, name, \ wxBaseArraySizeT, \ wxARRAY_EMPTY expmode) // ---------------------------------------------------------------------------- // Some commonly used predefined arrays // ---------------------------------------------------------------------------- WX_DEFINE_USER_EXPORTED_ARRAY_SHORT(short, wxArrayShort, class WXDLLIMPEXP_BASE); WX_DEFINE_USER_EXPORTED_ARRAY_INT(int, wxArrayInt, class WXDLLIMPEXP_BASE); WX_DEFINE_USER_EXPORTED_ARRAY_DOUBLE(double, wxArrayDouble, class WXDLLIMPEXP_BASE); WX_DEFINE_USER_EXPORTED_ARRAY_LONG(long, wxArrayLong, class WXDLLIMPEXP_BASE); WX_DEFINE_USER_EXPORTED_ARRAY_PTR(void *, wxArrayPtrVoid, class WXDLLIMPEXP_BASE); // ----------------------------------------------------------------------------- // convenience functions: they used to be macros, hence the naming convention // ----------------------------------------------------------------------------- // prepend all element of one array to another one; e.g. if first array contains // elements X,Y,Z and the second contains A,B,C (in those orders), then the // first array will be result as A,B,C,X,Y,Z template <typename A1, typename A2> inline void WX_PREPEND_ARRAY(A1& array, const A2& other) { const size_t size = other.size(); array.reserve(size); for ( size_t n = 0; n < size; n++ ) { array.Insert(other[n], n); } } // append all element of one array to another one template <typename A1, typename A2> inline void WX_APPEND_ARRAY(A1& array, const A2& other) { size_t size = other.size(); array.reserve(size); for ( size_t n = 0; n < size; n++ ) { array.push_back(other[n]); } } // delete all array elements // // NB: the class declaration of the array 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)! template <typename A> inline void WX_CLEAR_ARRAY(A& array) { size_t size = array.size(); for ( size_t n = 0; n < size; n++ ) { delete array[n]; } array.clear(); } #endif // _DYNARRAY_H
h
rticonnextdds-usecases
data/projects/rticonnextdds-usecases/VehicleTracking/ExampleCode/thirdparty/wxWidgets-3.1.2/Linux/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/Linux/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/Linux/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/Linux/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/Linux/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/Linux/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/Linux/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/Linux/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/Linux/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/Linux/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/Linux/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/Linux/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/Linux/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/Linux/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/Linux/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/Linux/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/Linux/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/Linux/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/Linux/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/Linux/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/Linux/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/Linux/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/Linux/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/Linux/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/Linux/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/Linux/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/Linux/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/Linux/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/Linux/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/Linux/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/Linux/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/Linux/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