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/except.h | ///////////////////////////////////////////////////////////////////////////////
// Name: wx/except.h
// Purpose: C++ exception related stuff
// Author: Vadim Zeitlin
// Modified by:
// Created: 17.09.2003
// Copyright: (c) 2003 Vadim Zeitlin <[email protected]>
// Licence: wxWindows licence
///////////////////////////////////////////////////////////////////////////////
#ifndef _WX_EXCEPT_H_
#define _WX_EXCEPT_H_
#include "wx/defs.h"
// ----------------------------------------------------------------------------
// macros working whether wxUSE_EXCEPTIONS is 0 or 1
// ----------------------------------------------------------------------------
// even if the library itself was compiled with exceptions support, the user
// code using it might be compiling with a compiler switch disabling them in
// which cases we shouldn't use try/catch in the headers -- this results in
// compilation errors in e.g. wx/scopeguard.h with at least g++ 4
#if !wxUSE_EXCEPTIONS || \
(defined(__GNUG__) && !defined(__EXCEPTIONS))
#ifndef wxNO_EXCEPTIONS
#define wxNO_EXCEPTIONS
#endif
#endif
#ifdef wxNO_EXCEPTIONS
#define wxTRY
#define wxCATCH_ALL(code)
#else // do use exceptions
#define wxTRY try
#define wxCATCH_ALL(code) catch ( ... ) { code }
#endif // wxNO_EXCEPTIONS/!wxNO_EXCEPTIONS
#endif // _WX_EXCEPT_H_
| h |
rticonnextdds-usecases | data/projects/rticonnextdds-usecases/VehicleTracking/ExampleCode/thirdparty/wxWidgets-3.1.2/Linux/include/wx/gifdecod.h | /////////////////////////////////////////////////////////////////////////////
// Name: wx/gifdecod.h
// Purpose: wxGIFDecoder, GIF reader for wxImage and wxAnimation
// Author: Guillermo Rodriguez Garcia <[email protected]>
// Version: 3.02
// Copyright: (c) 1999 Guillermo Rodriguez Garcia
// Licence: wxWindows licence
/////////////////////////////////////////////////////////////////////////////
#ifndef _WX_GIFDECOD_H_
#define _WX_GIFDECOD_H_
#include "wx/defs.h"
#if wxUSE_STREAMS && wxUSE_GIF
#include "wx/stream.h"
#include "wx/image.h"
#include "wx/animdecod.h"
#include "wx/dynarray.h"
// internal utility used to store a frame in 8bit-per-pixel format
class GIFImage;
// --------------------------------------------------------------------------
// Constants
// --------------------------------------------------------------------------
// Error codes:
// Note that the error code wxGIF_TRUNCATED means that the image itself
// is most probably OK, but the decoder didn't reach the end of the data
// stream; this means that if it was not reading directly from file,
// the stream will not be correctly positioned.
//
enum wxGIFErrorCode
{
wxGIF_OK = 0, // everything was OK
wxGIF_INVFORMAT, // error in GIF header
wxGIF_MEMERR, // error allocating memory
wxGIF_TRUNCATED // file appears to be truncated
};
// --------------------------------------------------------------------------
// wxGIFDecoder class
// --------------------------------------------------------------------------
class WXDLLIMPEXP_CORE wxGIFDecoder : public wxAnimationDecoder
{
public:
// constructor, destructor, etc.
wxGIFDecoder();
~wxGIFDecoder();
// get data of current frame
unsigned char* GetData(unsigned int frame) const;
unsigned char* GetPalette(unsigned int frame) const;
unsigned int GetNcolours(unsigned int frame) const;
int GetTransparentColourIndex(unsigned int frame) const;
wxColour GetTransparentColour(unsigned int frame) const wxOVERRIDE;
virtual wxSize GetFrameSize(unsigned int frame) const wxOVERRIDE;
virtual wxPoint GetFramePosition(unsigned int frame) const wxOVERRIDE;
virtual wxAnimationDisposal GetDisposalMethod(unsigned int frame) const wxOVERRIDE;
virtual long GetDelay(unsigned int frame) const wxOVERRIDE;
// GIFs can contain both static images and animations
bool IsAnimation() const
{ return m_nFrames > 1; }
// load function which returns more info than just Load():
wxGIFErrorCode LoadGIF( wxInputStream& stream );
// free all internal frames
void Destroy();
// implementation of wxAnimationDecoder's pure virtuals
virtual bool Load( wxInputStream& stream ) wxOVERRIDE
{ return LoadGIF(stream) == wxGIF_OK; }
bool ConvertToImage(unsigned int frame, wxImage *image) const wxOVERRIDE;
wxAnimationDecoder *Clone() const wxOVERRIDE
{ return new wxGIFDecoder; }
wxAnimationType GetType() const wxOVERRIDE
{ return wxANIMATION_TYPE_GIF; }
private:
// wxAnimationDecoder pure virtual
virtual bool DoCanRead( wxInputStream& stream ) const wxOVERRIDE;
// modifies current stream position (see wxAnimationDecoder::CanRead)
int getcode(wxInputStream& stream, int bits, int abfin);
wxGIFErrorCode dgif(wxInputStream& stream,
GIFImage *img, int interl, int bits);
// array of all frames
wxArrayPtrVoid m_frames;
// decoder state vars
int m_restbits; // remaining valid bits
unsigned int m_restbyte; // remaining bytes in this block
unsigned int m_lastbyte; // last byte read
unsigned char m_buffer[256]; // buffer for reading
unsigned char *m_bufp; // pointer to next byte in buffer
wxDECLARE_NO_COPY_CLASS(wxGIFDecoder);
};
#endif // wxUSE_STREAMS && wxUSE_GIF
#endif // _WX_GIFDECOD_H_
| h |
rticonnextdds-usecases | data/projects/rticonnextdds-usecases/VehicleTracking/ExampleCode/thirdparty/wxWidgets-3.1.2/Linux/include/wx/dragimag.h | /////////////////////////////////////////////////////////////////////////////
// Name: wx/dragimag.h
// Purpose: wxDragImage base header
// Author: Julian Smart
// Modified by:
// Created:
// Copyright: (c) Julian Smart
// Licence: wxWindows Licence
/////////////////////////////////////////////////////////////////////////////
#ifndef _WX_DRAGIMAG_H_BASE_
#define _WX_DRAGIMAG_H_BASE_
#if wxUSE_DRAGIMAGE
class WXDLLIMPEXP_FWD_CORE wxRect;
class WXDLLIMPEXP_FWD_CORE wxMemoryDC;
class WXDLLIMPEXP_FWD_CORE wxDC;
#if defined(__WXMSW__)
# if defined(__WXUNIVERSAL__)
# include "wx/generic/dragimgg.h"
# define wxDragImage wxGenericDragImage
# else
# include "wx/msw/dragimag.h"
# endif
#elif defined(__WXMOTIF__)
# include "wx/generic/dragimgg.h"
# define wxDragImage wxGenericDragImage
#elif defined(__WXGTK__)
# include "wx/generic/dragimgg.h"
# define wxDragImage wxGenericDragImage
#elif defined(__WXX11__)
# include "wx/generic/dragimgg.h"
# define wxDragImage wxGenericDragImage
#elif defined(__WXMAC__)
# include "wx/generic/dragimgg.h"
# define wxDragImage wxGenericDragImage
#elif defined(__WXQT__)
# include "wx/generic/dragimgg.h"
# define wxDragImage wxGenericDragImage
#endif
#endif // wxUSE_DRAGIMAGE
#endif
// _WX_DRAGIMAG_H_BASE_
| h |
rticonnextdds-usecases | data/projects/rticonnextdds-usecases/VehicleTracking/ExampleCode/thirdparty/wxWidgets-3.1.2/Linux/include/wx/taskbar.h | /////////////////////////////////////////////////////////////////////////////
// Name: wx/taskbar.h
// Purpose: wxTaskBarIcon base header and class
// Author: Julian Smart
// Modified by:
// Created:
// Copyright: (c) Julian Smart
// Licence: wxWindows licence
/////////////////////////////////////////////////////////////////////////////
#ifndef _WX_TASKBAR_H_BASE_
#define _WX_TASKBAR_H_BASE_
#include "wx/defs.h"
#if wxUSE_TASKBARICON
#include "wx/event.h"
class WXDLLIMPEXP_FWD_CORE wxTaskBarIconEvent;
// ----------------------------------------------------------------------------
// type of taskbar item to create. Only applicable in wxOSX_COCOA
enum wxTaskBarIconType
{
wxTBI_DOCK,
wxTBI_CUSTOM_STATUSITEM,
#if defined(wxOSX_USE_COCOA) && wxOSX_USE_COCOA
wxTBI_DEFAULT_TYPE = wxTBI_CUSTOM_STATUSITEM
#else
wxTBI_DEFAULT_TYPE = wxTBI_DOCK
#endif
};
// ----------------------------------------------------------------------------
// wxTaskBarIconBase: define wxTaskBarIcon interface
// ----------------------------------------------------------------------------
class WXDLLIMPEXP_CORE wxTaskBarIconBase : public wxEvtHandler
{
public:
wxTaskBarIconBase() { }
#if defined(__WXGTK__) || defined(__WXX11__) || defined(__WXMOTIF__) || defined(__WXQT__)
static bool IsAvailable();
#else
static bool IsAvailable() { return true; }
#endif
// Operations:
virtual bool SetIcon(const wxIcon& icon,
const wxString& tooltip = wxEmptyString) = 0;
virtual bool RemoveIcon() = 0;
virtual bool PopupMenu(wxMenu *menu) = 0;
// delayed destruction (similarly to wxWindow::Destroy())
void Destroy();
protected:
// creates menu to be displayed when user clicks on the icon
virtual wxMenu *CreatePopupMenu() { return NULL; }
private:
// default events handling, calls CreatePopupMenu:
void OnRightButtonDown(wxTaskBarIconEvent& event);
wxDECLARE_EVENT_TABLE();
wxDECLARE_NO_COPY_CLASS(wxTaskBarIconBase);
};
// ----------------------------------------------------------------------------
// now include the actual class declaration
// ----------------------------------------------------------------------------
#if defined(__WXMSW__)
#include "wx/msw/taskbar.h"
#elif defined(__WXGTK20__)
#include "wx/gtk/taskbar.h"
#elif defined(__WXGTK__) || defined(__WXX11__) || defined(__WXMOTIF__)
#include "wx/unix/taskbarx11.h"
#elif defined (__WXMAC__)
#include "wx/osx/taskbarosx.h"
#elif defined (__WXQT__)
#include "wx/qt/taskbar.h"
#endif
// ----------------------------------------------------------------------------
// wxTaskBarIcon events
// ----------------------------------------------------------------------------
class WXDLLIMPEXP_CORE wxTaskBarIconEvent : public wxEvent
{
public:
wxTaskBarIconEvent(wxEventType evtType, wxTaskBarIcon *tbIcon)
: wxEvent(wxID_ANY, evtType)
{
SetEventObject(tbIcon);
}
virtual wxEvent *Clone() const wxOVERRIDE { return new wxTaskBarIconEvent(*this); }
private:
wxDECLARE_NO_ASSIGN_CLASS(wxTaskBarIconEvent);
};
typedef void (wxEvtHandler::*wxTaskBarIconEventFunction)(wxTaskBarIconEvent&);
wxDECLARE_EXPORTED_EVENT( WXDLLIMPEXP_CORE, wxEVT_TASKBAR_MOVE, wxTaskBarIconEvent );
wxDECLARE_EXPORTED_EVENT( WXDLLIMPEXP_CORE, wxEVT_TASKBAR_LEFT_DOWN, wxTaskBarIconEvent );
wxDECLARE_EXPORTED_EVENT( WXDLLIMPEXP_CORE, wxEVT_TASKBAR_LEFT_UP, wxTaskBarIconEvent );
wxDECLARE_EXPORTED_EVENT( WXDLLIMPEXP_CORE, wxEVT_TASKBAR_RIGHT_DOWN, wxTaskBarIconEvent );
wxDECLARE_EXPORTED_EVENT( WXDLLIMPEXP_CORE, wxEVT_TASKBAR_RIGHT_UP, wxTaskBarIconEvent );
wxDECLARE_EXPORTED_EVENT( WXDLLIMPEXP_CORE, wxEVT_TASKBAR_LEFT_DCLICK, wxTaskBarIconEvent );
wxDECLARE_EXPORTED_EVENT( WXDLLIMPEXP_CORE, wxEVT_TASKBAR_RIGHT_DCLICK, wxTaskBarIconEvent );
wxDECLARE_EXPORTED_EVENT( WXDLLIMPEXP_CORE, wxEVT_TASKBAR_BALLOON_TIMEOUT, wxTaskBarIconEvent );
wxDECLARE_EXPORTED_EVENT( WXDLLIMPEXP_CORE, wxEVT_TASKBAR_BALLOON_CLICK, wxTaskBarIconEvent );
#define wxTaskBarIconEventHandler(func) \
wxEVENT_HANDLER_CAST(wxTaskBarIconEventFunction, func)
#define wx__DECLARE_TASKBAREVT(evt, fn) \
wx__DECLARE_EVT0(wxEVT_TASKBAR_ ## evt, wxTaskBarIconEventHandler(fn))
#define EVT_TASKBAR_MOVE(fn) wx__DECLARE_TASKBAREVT(MOVE, fn)
#define EVT_TASKBAR_LEFT_DOWN(fn) wx__DECLARE_TASKBAREVT(LEFT_DOWN, fn)
#define EVT_TASKBAR_LEFT_UP(fn) wx__DECLARE_TASKBAREVT(LEFT_UP, fn)
#define EVT_TASKBAR_RIGHT_DOWN(fn) wx__DECLARE_TASKBAREVT(RIGHT_DOWN, fn)
#define EVT_TASKBAR_RIGHT_UP(fn) wx__DECLARE_TASKBAREVT(RIGHT_UP, fn)
#define EVT_TASKBAR_LEFT_DCLICK(fn) wx__DECLARE_TASKBAREVT(LEFT_DCLICK, fn)
#define EVT_TASKBAR_RIGHT_DCLICK(fn) wx__DECLARE_TASKBAREVT(RIGHT_DCLICK, fn)
// taskbar menu is shown on right button press under all platforms except MSW
// where it's shown on right button release, using this event type and macro
// allows to write code which works correctly on all platforms
#ifdef __WXMSW__
#define wxEVT_TASKBAR_CLICK wxEVT_TASKBAR_RIGHT_UP
#else
#define wxEVT_TASKBAR_CLICK wxEVT_TASKBAR_RIGHT_DOWN
#endif
#define EVT_TASKBAR_CLICK(fn) wx__DECLARE_TASKBAREVT(CLICK, fn)
// these events are currently generated only under wxMSW and only after (MSW-
// specific) ShowBalloon() had been called, don't use them in portable code
#define EVT_TASKBAR_BALLOON_TIMEOUT(fn) \
wx__DECLARE_TASKBAREVT(BALLOON_TIMEOUT, fn)
#define EVT_TASKBAR_BALLOON_CLICK(fn) \
wx__DECLARE_TASKBAREVT(BALLOON_CLICK, fn)
#endif // wxUSE_TASKBARICON
#endif // _WX_TASKBAR_H_BASE_
| h |
rticonnextdds-usecases | data/projects/rticonnextdds-usecases/VehicleTracking/ExampleCode/thirdparty/wxWidgets-3.1.2/Linux/include/wx/sckstrm.h | /////////////////////////////////////////////////////////////////////////////
// Name: wx/sckstrm.h
// Purpose: wxSocket*Stream
// Author: Guilhem Lavaux
// Modified by:
// Created: 17/07/97
// Copyright: (c)
// Licence: wxWindows licence
/////////////////////////////////////////////////////////////////////////////
#ifndef __SCK_STREAM_H__
#define __SCK_STREAM_H__
#include "wx/stream.h"
#if wxUSE_SOCKETS && wxUSE_STREAMS
#include "wx/socket.h"
class WXDLLIMPEXP_NET wxSocketOutputStream : public wxOutputStream
{
public:
wxSocketOutputStream(wxSocketBase& s);
virtual ~wxSocketOutputStream();
protected:
wxSocketBase *m_o_socket;
size_t OnSysWrite(const void *buffer, size_t bufsize) wxOVERRIDE;
// socket streams are both un-seekable and size-less streams:
wxFileOffset OnSysTell() const wxOVERRIDE
{ return wxInvalidOffset; }
wxFileOffset OnSysSeek(wxFileOffset WXUNUSED(pos), wxSeekMode WXUNUSED(mode)) wxOVERRIDE
{ return wxInvalidOffset; }
wxDECLARE_NO_COPY_CLASS(wxSocketOutputStream);
};
class WXDLLIMPEXP_NET wxSocketInputStream : public wxInputStream
{
public:
wxSocketInputStream(wxSocketBase& s);
virtual ~wxSocketInputStream();
protected:
wxSocketBase *m_i_socket;
size_t OnSysRead(void *buffer, size_t bufsize) wxOVERRIDE;
// socket streams are both un-seekable and size-less streams:
wxFileOffset OnSysTell() const wxOVERRIDE
{ return wxInvalidOffset; }
wxFileOffset OnSysSeek(wxFileOffset WXUNUSED(pos), wxSeekMode WXUNUSED(mode)) wxOVERRIDE
{ return wxInvalidOffset; }
wxDECLARE_NO_COPY_CLASS(wxSocketInputStream);
};
class WXDLLIMPEXP_NET wxSocketStream : public wxSocketInputStream,
public wxSocketOutputStream
{
public:
wxSocketStream(wxSocketBase& s);
virtual ~wxSocketStream();
wxDECLARE_NO_COPY_CLASS(wxSocketStream);
};
#endif
// wxUSE_SOCKETS && wxUSE_STREAMS
#endif
// __SCK_STREAM_H__
| h |
rticonnextdds-usecases | data/projects/rticonnextdds-usecases/VehicleTracking/ExampleCode/thirdparty/wxWidgets-3.1.2/Linux/include/wx/minifram.h | /////////////////////////////////////////////////////////////////////////////
// Name: wx/minifram.h
// Purpose: wxMiniFrame base header
// Author: Julian Smart
// Modified by:
// Created:
// Copyright: (c) Julian Smart
// Copyright: (c) 2014 wxWidgets dev team
/////////////////////////////////////////////////////////////////////////////
#ifndef _WX_MINIFRAM_H_BASE_
#define _WX_MINIFRAM_H_BASE_
#include "wx/defs.h"
#if wxUSE_MINIFRAME
#if defined(__WXMSW__)
#include "wx/msw/minifram.h"
#elif defined(__WXMOTIF__)
#include "wx/motif/minifram.h"
#elif defined(__WXGTK20__)
#include "wx/gtk/minifram.h"
#elif defined(__WXGTK__)
#include "wx/gtk1/minifram.h"
#elif defined(__WXX11__)
#include "wx/x11/minifram.h"
#elif defined(__WXMAC__)
#include "wx/osx/minifram.h"
#elif defined(__WXQT__)
#include "wx/qt/minifram.h"
#else
// TODO: it seems that wxMiniFrame could be just defined here generically
// instead of having all the above port-specific headers
#include "wx/frame.h"
typedef wxFrame wxMiniFrame;
#endif
#endif // wxUSE_MINIFRAME
#endif // _WX_MINIFRAM_H_BASE_
| h |
rticonnextdds-usecases | data/projects/rticonnextdds-usecases/VehicleTracking/ExampleCode/thirdparty/wxWidgets-3.1.2/Linux/include/wx/pen.h | /////////////////////////////////////////////////////////////////////////////
// Name: wx/pen.h
// Purpose: Base header for wxPen
// Author: Julian Smart
// Modified by:
// Created:
// Copyright: (c) Julian Smart
// Licence: wxWindows Licence
/////////////////////////////////////////////////////////////////////////////
#ifndef _WX_PEN_H_BASE_
#define _WX_PEN_H_BASE_
#include "wx/gdiobj.h"
#include "wx/peninfobase.h"
// ----------------------------------------------------------------------------
// wxPenInfo contains all parameters describing a wxPen
// ----------------------------------------------------------------------------
class wxPenInfo : public wxPenInfoBase<wxPenInfo>
{
public:
explicit wxPenInfo(const wxColour& colour = wxColour(),
int width = 1,
wxPenStyle style = wxPENSTYLE_SOLID)
: wxPenInfoBase<wxPenInfo>(colour, style)
{
m_width = width;
}
// Setters
wxPenInfo& Width(int width)
{ m_width = width; return *this; }
// Accessors
int GetWidth() const { return m_width; }
private:
int m_width;
};
class WXDLLIMPEXP_CORE wxPenBase : public wxGDIObject
{
public:
virtual ~wxPenBase() { }
virtual void SetColour(const wxColour& col) = 0;
virtual void SetColour(unsigned char r, unsigned char g, unsigned char b) = 0;
virtual void SetWidth(int width) = 0;
virtual void SetStyle(wxPenStyle style) = 0;
virtual void SetStipple(const wxBitmap& stipple) = 0;
virtual void SetDashes(int nb_dashes, const wxDash *dash) = 0;
virtual void SetJoin(wxPenJoin join) = 0;
virtual void SetCap(wxPenCap cap) = 0;
virtual wxColour GetColour() const = 0;
virtual wxBitmap *GetStipple() const = 0;
virtual wxPenStyle GetStyle() const = 0;
virtual wxPenJoin GetJoin() const = 0;
virtual wxPenCap GetCap() const = 0;
virtual int GetWidth() const = 0;
virtual int GetDashes(wxDash **ptr) const = 0;
// Convenient helpers for testing whether the pen is a transparent one:
// unlike GetStyle() == wxPENSTYLE_TRANSPARENT, they work correctly even if
// the pen is invalid (they both return false in this case).
bool IsTransparent() const
{
return IsOk() && GetStyle() == wxPENSTYLE_TRANSPARENT;
}
bool IsNonTransparent() const
{
return IsOk() && GetStyle() != wxPENSTYLE_TRANSPARENT;
}
};
#if defined(__WXMSW__)
#include "wx/msw/pen.h"
#elif defined(__WXMOTIF__) || defined(__WXX11__)
#include "wx/x11/pen.h"
#elif defined(__WXGTK20__)
#include "wx/gtk/pen.h"
#elif defined(__WXGTK__)
#include "wx/gtk1/pen.h"
#elif defined(__WXDFB__)
#include "wx/dfb/pen.h"
#elif defined(__WXMAC__)
#include "wx/osx/pen.h"
#elif defined(__WXQT__)
#include "wx/qt/pen.h"
#endif
class WXDLLIMPEXP_CORE wxPenList: public wxGDIObjListBase
{
public:
wxPen *FindOrCreatePen(const wxColour& colour,
int width = 1,
wxPenStyle style = wxPENSTYLE_SOLID);
wxDEPRECATED_MSG("use wxPENSTYLE_XXX constants")
wxPen *FindOrCreatePen(const wxColour& colour, int width, int style)
{ return FindOrCreatePen(colour, width, (wxPenStyle)style); }
};
extern WXDLLIMPEXP_DATA_CORE(wxPenList*) wxThePenList;
// provide comparison operators to allow code such as
//
// if ( pen.GetStyle() == wxTRANSPARENT )
//
// to compile without warnings which it would otherwise provoke from some
// compilers as it compares elements of different enums
// Unfortunately some compilers have ambiguity issues when enum comparisons are
// overloaded so we have to disable the overloads in this case, see
// wxCOMPILER_NO_OVERLOAD_ON_ENUM definition in wx/platform.h for more details.
#ifndef wxCOMPILER_NO_OVERLOAD_ON_ENUM
wxDEPRECATED_MSG("use wxPENSTYLE_XXX constants")
inline bool operator==(wxPenStyle s, wxDeprecatedGUIConstants t)
{
return static_cast<int>(s) == static_cast<int>(t);
}
wxDEPRECATED_MSG("use wxPENSTYLE_XXX constants")
inline bool operator!=(wxPenStyle s, wxDeprecatedGUIConstants t)
{
return static_cast<int>(s) != static_cast<int>(t);
}
#endif // wxCOMPILER_NO_OVERLOAD_ON_ENUM
#endif // _WX_PEN_H_BASE_
| h |
rticonnextdds-usecases | data/projects/rticonnextdds-usecases/VehicleTracking/ExampleCode/thirdparty/wxWidgets-3.1.2/Linux/include/wx/listimpl.cpp | /////////////////////////////////////////////////////////////////////////////
// Name: wx/listimpl.cpp
// Purpose: second-part of macro based implementation of template lists
// Author: Vadim Zeitlin
// Modified by:
// Created: 16/11/98
// Copyright: (c) 1998 Vadim Zeitlin
// Licence: wxWindows licence
/////////////////////////////////////////////////////////////////////////////
#if wxUSE_STD_CONTAINERS
#undef WX_DEFINE_LIST
#define WX_DEFINE_LIST(name) \
void _WX_LIST_HELPER_##name::DeleteFunction( _WX_LIST_ITEM_TYPE_##name X )\
{ \
delete X; \
} \
_WX_LIST_HELPER_##name::BaseListType _WX_LIST_HELPER_##name::EmptyList;
#else // !wxUSE_STD_CONTAINERS
#undef WX_DEFINE_LIST_2
#define WX_DEFINE_LIST_2(T, name) \
void wx##name##Node::DeleteData() \
{ \
delete (T *)GetData(); \
}
// redefine the macro so that now it will generate the class implementation
// old value would provoke a compile-time error if this file is not included
#undef WX_DEFINE_LIST
#define WX_DEFINE_LIST(name) WX_DEFINE_LIST_2(_WX_LIST_ITEM_TYPE_##name, name)
#endif // wxUSE_STD_CONTAINERS/!wxUSE_STD_CONTAINERS
| cpp |
rticonnextdds-usecases | data/projects/rticonnextdds-usecases/VehicleTracking/ExampleCode/thirdparty/wxWidgets-3.1.2/Linux/include/wx/dialog.h | /////////////////////////////////////////////////////////////////////////////
// Name: wx/dialog.h
// Purpose: wxDialogBase class
// Author: Vadim Zeitlin
// Modified by:
// Created: 29.06.99
// Copyright: (c) Vadim Zeitlin
// Licence: wxWindows licence
/////////////////////////////////////////////////////////////////////////////
#ifndef _WX_DIALOG_H_BASE_
#define _WX_DIALOG_H_BASE_
#include "wx/toplevel.h"
#include "wx/containr.h"
#include "wx/sharedptr.h"
class WXDLLIMPEXP_FWD_CORE wxSizer;
class WXDLLIMPEXP_FWD_CORE wxStdDialogButtonSizer;
class WXDLLIMPEXP_FWD_CORE wxBoxSizer;
class WXDLLIMPEXP_FWD_CORE wxDialogLayoutAdapter;
class WXDLLIMPEXP_FWD_CORE wxDialog;
class WXDLLIMPEXP_FWD_CORE wxButton;
class WXDLLIMPEXP_FWD_CORE wxScrolledWindow;
class wxTextSizerWrapper;
// Also see the bit summary table in wx/toplevel.h.
#define wxDIALOG_NO_PARENT 0x00000020 // Don't make owned by apps top window
#define wxDEFAULT_DIALOG_STYLE (wxCAPTION | wxSYSTEM_MENU | wxCLOSE_BOX)
// Layout adaptation levels, for SetLayoutAdaptationLevel
// Don't do any layout adaptation
#define wxDIALOG_ADAPTATION_NONE 0
// Only look for wxStdDialogButtonSizer for non-scrolling part
#define wxDIALOG_ADAPTATION_STANDARD_SIZER 1
// Also look for any suitable sizer for non-scrolling part
#define wxDIALOG_ADAPTATION_ANY_SIZER 2
// Also look for 'loose' standard buttons for non-scrolling part
#define wxDIALOG_ADAPTATION_LOOSE_BUTTONS 3
// Layout adaptation mode, for SetLayoutAdaptationMode
enum wxDialogLayoutAdaptationMode
{
wxDIALOG_ADAPTATION_MODE_DEFAULT = 0, // use global adaptation enabled status
wxDIALOG_ADAPTATION_MODE_ENABLED = 1, // enable this dialog overriding global status
wxDIALOG_ADAPTATION_MODE_DISABLED = 2 // disable this dialog overriding global status
};
enum wxDialogModality
{
wxDIALOG_MODALITY_NONE = 0,
wxDIALOG_MODALITY_WINDOW_MODAL = 1,
wxDIALOG_MODALITY_APP_MODAL = 2
};
extern WXDLLIMPEXP_DATA_CORE(const char) wxDialogNameStr[];
class WXDLLIMPEXP_CORE wxDialogBase : public wxNavigationEnabled<wxTopLevelWindow>
{
public:
wxDialogBase();
virtual ~wxDialogBase() { }
// define public wxDialog methods to be implemented by the derived classes
virtual int ShowModal() = 0;
virtual void EndModal(int retCode) = 0;
virtual bool IsModal() const = 0;
// show the dialog frame-modally (needs a parent), using app-modal
// dialogs on platforms that don't support it
virtual void ShowWindowModal () ;
virtual void SendWindowModalDialogEvent ( wxEventType type );
template<typename Functor>
void ShowWindowModalThenDo(const Functor& onEndModal);
// Modal dialogs have a return code - usually the id of the last
// pressed button
void SetReturnCode(int returnCode) { m_returnCode = returnCode; }
int GetReturnCode() const { return m_returnCode; }
// Set the identifier for the affirmative button: this button will close
// the dialog after validating data and calling TransferDataFromWindow()
void SetAffirmativeId(int affirmativeId);
int GetAffirmativeId() const { return m_affirmativeId; }
// Set identifier for Esc key translation: the button with this id will
// close the dialog without doing anything else; special value wxID_NONE
// means to not handle Esc at all while wxID_ANY means to map Esc to
// wxID_CANCEL if present and GetAffirmativeId() otherwise
void SetEscapeId(int escapeId);
int GetEscapeId() const { return m_escapeId; }
// Find the parent to use for modal dialog: try to use the specified parent
// but fall back to the current active window or main application window as
// last resort if it is unsuitable.
//
// As this function is often called from the ctor, the window style may be
// not set yet and hence must be passed explicitly to it so that we could
// check whether it contains wxDIALOG_NO_PARENT bit.
//
// This function always returns a valid top level window or NULL.
wxWindow *GetParentForModalDialog(wxWindow *parent, long style) const;
// This overload can only be used for already initialized windows, i.e. not
// from the ctor. It uses the current window parent and style.
wxWindow *GetParentForModalDialog() const
{
return GetParentForModalDialog(GetParent(), GetWindowStyle());
}
#if wxUSE_STATTEXT // && wxUSE_TEXTCTRL
// splits text up at newlines and places the lines into a vertical
// wxBoxSizer, with the given maximum width, lines will not be wrapped
// for negative values of widthMax
wxSizer *CreateTextSizer(const wxString& message, int widthMax = -1);
// same as above but uses a customized wxTextSizerWrapper to create
// non-standard controls for the lines
wxSizer *CreateTextSizer(const wxString& message,
wxTextSizerWrapper& wrapper,
int widthMax = -1);
#endif // wxUSE_STATTEXT // && wxUSE_TEXTCTRL
// returns a horizontal wxBoxSizer containing the given buttons
//
// notice that the returned sizer can be NULL if no buttons are put in the
// sizer (this mostly happens under smart phones and other atypical
// platforms which have hardware buttons replacing OK/Cancel and such)
wxSizer *CreateButtonSizer(long flags);
// returns a sizer containing the given one and a static line separating it
// from the preceding elements if it's appropriate for the current platform
wxSizer *CreateSeparatedSizer(wxSizer *sizer);
// returns the sizer containing CreateButtonSizer() below a separating
// static line for the platforms which use static lines for items
// separation (i.e. not Mac)
//
// this is just a combination of CreateButtonSizer() and
// CreateSeparatedSizer()
wxSizer *CreateSeparatedButtonSizer(long flags);
#if wxUSE_BUTTON
wxStdDialogButtonSizer *CreateStdDialogButtonSizer( long flags );
#endif // wxUSE_BUTTON
// Do layout adaptation
virtual bool DoLayoutAdaptation();
// Can we do layout adaptation?
virtual bool CanDoLayoutAdaptation();
// Returns a content window if there is one. This can be used by the layout adapter, for
// example to make the pages of a book control into scrolling windows
virtual wxWindow* GetContentWindow() const { return NULL; }
// Add an id to the list of main button identifiers that should be in the button sizer
void AddMainButtonId(wxWindowID id) { m_mainButtonIds.Add((int) id); }
wxArrayInt& GetMainButtonIds() { return m_mainButtonIds; }
// Is this id in the main button id array?
bool IsMainButtonId(wxWindowID id) const { return (m_mainButtonIds.Index((int) id) != wxNOT_FOUND); }
// Level of adaptation, from none (Level 0) to full (Level 3). To disable adaptation,
// set level 0, for example in your dialog constructor. You might
// do this if you know that you are displaying on a large screen and you don't want the
// dialog changed.
void SetLayoutAdaptationLevel(int level) { m_layoutAdaptationLevel = level; }
int GetLayoutAdaptationLevel() const { return m_layoutAdaptationLevel; }
/// Override global adaptation enabled/disabled status
void SetLayoutAdaptationMode(wxDialogLayoutAdaptationMode mode) { m_layoutAdaptationMode = mode; }
wxDialogLayoutAdaptationMode GetLayoutAdaptationMode() const { return m_layoutAdaptationMode; }
// Returns true if the adaptation has been done
void SetLayoutAdaptationDone(bool adaptationDone) { m_layoutAdaptationDone = adaptationDone; }
bool GetLayoutAdaptationDone() const { return m_layoutAdaptationDone; }
// Set layout adapter class, returning old adapter
static wxDialogLayoutAdapter* SetLayoutAdapter(wxDialogLayoutAdapter* adapter);
static wxDialogLayoutAdapter* GetLayoutAdapter() { return sm_layoutAdapter; }
// Global switch for layout adaptation
static bool IsLayoutAdaptationEnabled() { return sm_layoutAdaptation; }
static void EnableLayoutAdaptation(bool enable) { sm_layoutAdaptation = enable; }
// modality kind
virtual wxDialogModality GetModality() const;
protected:
// emulate click of a button with the given id if it's present in the dialog
//
// return true if button was "clicked" or false if we don't have it
bool EmulateButtonClickIfPresent(int id);
// this function is used by OnCharHook() to decide whether the given key
// should close the dialog
//
// for most platforms the default implementation (which just checks for
// Esc) is sufficient, but Mac port also adds Cmd-. here and other ports
// could do something different if needed
virtual bool IsEscapeKey(const wxKeyEvent& event);
// end either modal or modeless dialog, for the modal dialog rc is used as
// the dialog return code
void EndDialog(int rc);
// call Validate() and TransferDataFromWindow() and close dialog with
// wxID_OK return code
void AcceptAndClose();
// The return code from modal dialog
int m_returnCode;
// The identifier for the affirmative button (usually wxID_OK)
int m_affirmativeId;
// The identifier for cancel button (usually wxID_CANCEL)
int m_escapeId;
// Flags whether layout adaptation has been done for this dialog
bool m_layoutAdaptationDone;
// Extra button identifiers to be taken as 'main' button identifiers
// to be placed in the non-scrolling area
wxArrayInt m_mainButtonIds;
// Adaptation level
int m_layoutAdaptationLevel;
// Local override for global adaptation enabled status
wxDialogLayoutAdaptationMode m_layoutAdaptationMode;
// Global layout adapter
static wxDialogLayoutAdapter* sm_layoutAdapter;
// Global adaptation switch
static bool sm_layoutAdaptation;
private:
// helper of GetParentForModalDialog(): returns the passed in window if it
// can be used as our parent or NULL if it can't
wxWindow *CheckIfCanBeUsedAsParent(wxWindow *parent) const;
// Helper of OnCharHook() and OnCloseWindow(): find the appropriate button
// for closing the dialog and send a click event for it.
//
// Return true if we found a button to close the dialog and "clicked" it or
// false otherwise.
bool SendCloseButtonClickEvent();
// handle Esc key presses
void OnCharHook(wxKeyEvent& event);
// handle closing the dialog window
void OnCloseWindow(wxCloseEvent& event);
// handle the standard buttons
void OnButton(wxCommandEvent& event);
// update the background colour
void OnSysColourChanged(wxSysColourChangedEvent& event);
wxDECLARE_NO_COPY_CLASS(wxDialogBase);
wxDECLARE_EVENT_TABLE();
};
/*!
* Base class for layout adapters - code that, for example, turns a dialog into a
* scrolling dialog if there isn't enough screen space. You can derive further
* adapter classes to do any other kind of adaptation, such as applying a watermark, or adding
* a help mechanism.
*/
class WXDLLIMPEXP_CORE wxDialogLayoutAdapter: public wxObject
{
wxDECLARE_CLASS(wxDialogLayoutAdapter);
public:
wxDialogLayoutAdapter() {}
// Override this function to indicate that adaptation should be done
virtual bool CanDoLayoutAdaptation(wxDialog* dialog) = 0;
// Override this function to do the adaptation
virtual bool DoLayoutAdaptation(wxDialog* dialog) = 0;
};
/*!
* Standard adapter. Does scrolling adaptation for paged and regular dialogs.
*
*/
class WXDLLIMPEXP_CORE wxStandardDialogLayoutAdapter: public wxDialogLayoutAdapter
{
wxDECLARE_CLASS(wxStandardDialogLayoutAdapter);
public:
wxStandardDialogLayoutAdapter() {}
// Overrides
// Indicate that adaptation should be done
virtual bool CanDoLayoutAdaptation(wxDialog* dialog) wxOVERRIDE;
// Do layout adaptation
virtual bool DoLayoutAdaptation(wxDialog* dialog) wxOVERRIDE;
// Implementation
// Create the scrolled window
virtual wxScrolledWindow* CreateScrolledWindow(wxWindow* parent);
#if wxUSE_BUTTON
// Find a standard or horizontal box sizer
virtual wxSizer* FindButtonSizer(bool stdButtonSizer, wxDialog* dialog, wxSizer* sizer, int& retBorder, int accumlatedBorder = 0);
// Check if this sizer contains standard buttons, and so can be repositioned in the dialog
virtual bool IsOrdinaryButtonSizer(wxDialog* dialog, wxBoxSizer* sizer);
// Check if this is a standard button
virtual bool IsStandardButton(wxDialog* dialog, wxButton* button);
// Find 'loose' main buttons in the existing layout and add them to the standard dialog sizer
virtual bool FindLooseButtons(wxDialog* dialog, wxStdDialogButtonSizer* buttonSizer, wxSizer* sizer, int& count);
#endif // wxUSE_BUTTON
// Reparent the controls to the scrolled window, except those in buttonSizer
virtual void ReparentControls(wxWindow* parent, wxWindow* reparentTo, wxSizer* buttonSizer = NULL);
static void DoReparentControls(wxWindow* parent, wxWindow* reparentTo, wxSizer* buttonSizer = NULL);
// A function to fit the dialog around its contents, and then adjust for screen size.
// If scrolled windows are passed, scrolling is enabled in the required orientation(s).
virtual bool FitWithScrolling(wxDialog* dialog, wxScrolledWindow* scrolledWindow);
virtual bool FitWithScrolling(wxDialog* dialog, wxWindowList& windows);
static bool DoFitWithScrolling(wxDialog* dialog, wxScrolledWindow* scrolledWindow);
static bool DoFitWithScrolling(wxDialog* dialog, wxWindowList& windows);
// Find whether scrolling will be necessary for the dialog, returning wxVERTICAL, wxHORIZONTAL or both
virtual int MustScroll(wxDialog* dialog, wxSize& windowSize, wxSize& displaySize);
static int DoMustScroll(wxDialog* dialog, wxSize& windowSize, wxSize& displaySize);
};
#if defined(__WXUNIVERSAL__)
#include "wx/univ/dialog.h"
#else
#if defined(__WXMSW__)
#include "wx/msw/dialog.h"
#elif defined(__WXMOTIF__)
#include "wx/motif/dialog.h"
#elif defined(__WXGTK20__)
#include "wx/gtk/dialog.h"
#elif defined(__WXGTK__)
#include "wx/gtk1/dialog.h"
#elif defined(__WXMAC__)
#include "wx/osx/dialog.h"
#elif defined(__WXQT__)
#include "wx/qt/dialog.h"
#endif
#endif
class WXDLLIMPEXP_CORE wxWindowModalDialogEvent : public wxCommandEvent
{
public:
wxWindowModalDialogEvent (wxEventType commandType = wxEVT_NULL, int id = 0)
: wxCommandEvent(commandType, id) { }
wxDialog *GetDialog() const
{ return wxStaticCast(GetEventObject(), wxDialog); }
int GetReturnCode() const
{ return GetDialog()->GetReturnCode(); }
virtual wxEvent *Clone() const wxOVERRIDE { return new wxWindowModalDialogEvent (*this); }
private:
wxDECLARE_DYNAMIC_CLASS_NO_ASSIGN(wxWindowModalDialogEvent);
};
wxDECLARE_EXPORTED_EVENT(WXDLLIMPEXP_CORE, wxEVT_WINDOW_MODAL_DIALOG_CLOSED , wxWindowModalDialogEvent );
typedef void (wxEvtHandler::*wxWindowModalDialogEventFunction)(wxWindowModalDialogEvent &);
#define wxWindowModalDialogEventHandler(func) \
wxEVENT_HANDLER_CAST(wxWindowModalDialogEventFunction, func)
#define EVT_WINDOW_MODAL_DIALOG_CLOSED(winid, func) \
wx__DECLARE_EVT1(wxEVT_WINDOW_MODAL_DIALOG_CLOSED, winid, wxWindowModalDialogEventHandler(func))
template<typename Functor>
class wxWindowModalDialogEventFunctor
{
public:
wxWindowModalDialogEventFunctor(const Functor& f)
: m_f(new Functor(f))
{}
void operator()(wxWindowModalDialogEvent& event)
{
if ( m_f )
{
// We only want to call this handler once. Also, by deleting
// the functor here, its data (such as wxWindowPtr pointing to
// the dialog) are freed immediately after exiting this operator().
wxSharedPtr<Functor> functor(m_f);
m_f.reset();
(*functor)(event.GetReturnCode());
}
else // was already called once
{
event.Skip();
}
}
private:
wxSharedPtr<Functor> m_f;
};
template<typename Functor>
void wxDialogBase::ShowWindowModalThenDo(const Functor& onEndModal)
{
Bind(wxEVT_WINDOW_MODAL_DIALOG_CLOSED,
wxWindowModalDialogEventFunctor<Functor>(onEndModal));
ShowWindowModal();
}
#endif
// _WX_DIALOG_H_BASE_
| h |
rticonnextdds-usecases | data/projects/rticonnextdds-usecases/VehicleTracking/ExampleCode/thirdparty/wxWidgets-3.1.2/Linux/include/wx/memory.h | /////////////////////////////////////////////////////////////////////////////
// Name: wx/memory.h
// Purpose: Memory operations
// Author: Arthur Seaton, Julian Smart
// Modified by:
// Created: 29/01/98
// Copyright: (c) 1998 Julian Smart
// Licence: wxWindows licence
/////////////////////////////////////////////////////////////////////////////
#ifndef _WX_MEMORY_H_
#define _WX_MEMORY_H_
#include "wx/defs.h"
#include "wx/string.h"
#include "wx/msgout.h"
#if wxUSE_MEMORY_TRACING || wxUSE_DEBUG_CONTEXT
#include <stddef.h>
WXDLLIMPEXP_BASE void * wxDebugAlloc(size_t size, wxChar * fileName, int lineNum, bool isObject, bool isVect = false);
WXDLLIMPEXP_BASE void wxDebugFree(void * buf, bool isVect = false);
//**********************************************************************************
/*
The global operator new used for everything apart from getting
dynamic storage within this function itself.
*/
// We'll only do malloc and free for the moment: leave the interesting
// stuff for the wxObject versions.
#if wxUSE_GLOBAL_MEMORY_OPERATORS
// Undefine temporarily (new is #defined in object.h) because we want to
// declare some new operators.
#ifdef new
#undef new
#endif
#if defined(__SUNCC__)
#define wxUSE_ARRAY_MEMORY_OPERATORS 0
#elif defined (__SGI_CC_)
// only supported by -n32 compilers
#ifndef __EDG_ABI_COMPATIBILITY_VERSION
#define wxUSE_ARRAY_MEMORY_OPERATORS 0
#endif
#else
#define wxUSE_ARRAY_MEMORY_OPERATORS 1
#endif
// devik 2000-8-29: All new/delete ops are now inline because they can't
// be marked as dllexport/dllimport. It then leads to weird bugs when
// used on MSW as DLL
#if defined(__WINDOWS__) && (defined(WXUSINGDLL) || defined(WXMAKINGDLL_BASE))
inline void * operator new (size_t size, wxChar * fileName, int lineNum)
{
return wxDebugAlloc(size, fileName, lineNum, false, false);
}
inline void * operator new (size_t size)
{
return wxDebugAlloc(size, NULL, 0, false);
}
inline void operator delete (void * buf)
{
wxDebugFree(buf, false);
}
#if wxUSE_ARRAY_MEMORY_OPERATORS
inline void * operator new[] (size_t size)
{
return wxDebugAlloc(size, NULL, 0, false, true);
}
inline void * operator new[] (size_t size, wxChar * fileName, int lineNum)
{
return wxDebugAlloc(size, fileName, lineNum, false, true);
}
inline void operator delete[] (void * buf)
{
wxDebugFree(buf, true);
}
#endif // wxUSE_ARRAY_MEMORY_OPERATORS
#else
void * operator new (size_t size, wxChar * fileName, int lineNum);
void * operator new (size_t size);
void operator delete (void * buf);
#if wxUSE_ARRAY_MEMORY_OPERATORS
void * operator new[] (size_t size);
void * operator new[] (size_t size, wxChar * fileName, int lineNum);
void operator delete[] (void * buf);
#endif // wxUSE_ARRAY_MEMORY_OPERATORS
#endif // defined(__WINDOWS__) && (defined(WXUSINGDLL) || defined(WXMAKINGDLL_BASE))
#if defined(__VISUALC__)
inline void operator delete(void* pData, wxChar* /* fileName */, int /* lineNum */)
{
wxDebugFree(pData, false);
}
inline void operator delete[](void* pData, wxChar* /* fileName */, int /* lineNum */)
{
wxDebugFree(pData, true);
}
#endif // __VISUALC__
#endif // wxUSE_GLOBAL_MEMORY_OPERATORS
//**********************************************************************************
typedef unsigned int wxMarkerType;
/*
Define the struct which will be placed at the start of all dynamically
allocated memory.
*/
class WXDLLIMPEXP_BASE wxMemStruct {
friend class WXDLLIMPEXP_FWD_BASE wxDebugContext; // access to the m_next pointer for list traversal.
public:
public:
int AssertList ();
size_t RequestSize () { return m_reqSize; }
wxMarkerType Marker () { return m_firstMarker; }
// When an object is deleted we set the id slot to a specific value.
inline void SetDeleted ();
inline int IsDeleted ();
int Append ();
int Unlink ();
// Used to determine if the object is really a wxMemStruct.
// Not a foolproof test by any means, but better than none I hope!
int AssertIt ();
// Do all validation on a node.
int ValidateNode ();
// Check the integrity of a node and of the list, node by node.
int CheckBlock ();
int CheckAllPrevious ();
// Print a single node.
void PrintNode ();
// Called when the memory linking functions get an error.
void ErrorMsg (const char *);
void ErrorMsg ();
inline void *GetActualData(void) const { return m_actualData; }
void Dump(void);
public:
// Check for underwriting. There are 2 of these checks. This one
// inside the struct and another right after the struct.
wxMarkerType m_firstMarker;
// File name and line number are from cpp.
wxChar* m_fileName;
int m_lineNum;
// The amount of memory requested by the caller.
size_t m_reqSize;
// Used to try to verify that we really are dealing with an object
// of the required class. Can be 1 of 2 values these indicating a valid
// wxMemStruct object, or a deleted wxMemStruct object.
wxMarkerType m_id;
wxMemStruct * m_prev;
wxMemStruct * m_next;
void * m_actualData;
bool m_isObject;
};
typedef void (wxMemStruct::*PmSFV) ();
// Type of the app function that can be installed and called at wxWidgets shutdown
// (after all other registered files with global destructors have been closed down).
typedef void (*wxShutdownNotifyFunction)();
/*
Debugging class. This will only have a single instance, but it's
a reasonable way to keep everything together and to make this
available for change if needed by someone else.
A lot of this stuff would be better off within the wxMemStruct class, but
it's stuff which we need to access at times when there is no wxMemStruct
object so we use this class instead. Think of it as a collection of
globals which have to do with the wxMemStruct class.
*/
class WXDLLIMPEXP_BASE wxDebugContext {
protected:
// Used to set alignment for markers.
static size_t CalcAlignment ();
// Returns the amount of padding needed after something of the given
// size. This is so that when we cast pointers backwards and forwards
// the pointer value will be valid for a wxMarkerType.
static size_t GetPadding (size_t size) ;
// Traverse the list.
static void TraverseList (PmSFV, wxMemStruct *from = NULL);
static int debugLevel;
static bool debugOn;
static int m_balign; // byte alignment
static int m_balignmask; // mask for performing byte alignment
public:
// Set a checkpoint to dump only the memory from
// a given point
static wxMemStruct *checkPoint;
wxDebugContext(void);
~wxDebugContext(void);
static int GetLevel(void) { return debugLevel; }
static void SetLevel(int level) { debugLevel = level; }
static bool GetDebugMode(void) { return debugOn; }
static void SetDebugMode(bool flag) { debugOn = flag; }
static void SetCheckpoint(bool all = false);
static wxMemStruct *GetCheckpoint(void) { return checkPoint; }
// Calculated from the request size and any padding needed
// before the final marker.
static size_t PaddedSize (size_t reqSize);
// Calc the total amount of space we need from the system
// to satisfy a caller request. This includes all padding.
static size_t TotSize (size_t reqSize);
// Return valid pointers to offsets within the allocated memory.
static char * StructPos (const char * buf);
static char * MidMarkerPos (const char * buf);
static char * CallerMemPos (const char * buf);
static char * EndMarkerPos (const char * buf, size_t size);
// Given a pointer to the start of the caller requested area
// return a pointer to the start of the entire alloc\'d buffer.
static char * StartPos (const char * caller);
// Access to the list.
static wxMemStruct * GetHead () { return m_head; }
static wxMemStruct * GetTail () { return m_tail; }
// Set the list sentinals.
static wxMemStruct * SetHead (wxMemStruct * st) { return (m_head = st); }
static wxMemStruct * SetTail (wxMemStruct * st) { return (m_tail = st); }
// If this is set then every new operation checks the validity
// of the all previous nodes in the list.
static bool GetCheckPrevious () { return m_checkPrevious; }
static void SetCheckPrevious (bool value) { m_checkPrevious = value; }
// Checks all nodes, or all nodes if checkAll is true
static int Check(bool checkAll = false);
// Print out the list of wxMemStruct nodes.
static bool PrintList(void);
// Dump objects
static bool Dump(void);
// Print statistics
static bool PrintStatistics(bool detailed = true);
// Print out the classes in the application.
static bool PrintClasses(void);
// Count the number of non-wxDebugContext-related objects
// that are outstanding
static int CountObjectsLeft(bool sinceCheckpoint = false);
// This function is used to output the dump
static void OutputDumpLine(const wxChar *szFormat, ...);
static void SetShutdownNotifyFunction(wxShutdownNotifyFunction shutdownFn);
private:
// Store these here to allow access to the list without
// needing to have a wxMemStruct object.
static wxMemStruct* m_head;
static wxMemStruct* m_tail;
// Set to false if we're not checking all previous nodes when
// we do a new. Set to true when we are.
static bool m_checkPrevious;
// Holds a pointer to an optional application function to call at shutdown.
static wxShutdownNotifyFunction sm_shutdownFn;
// Have to access our shutdown hook
friend class wxDebugContextDumpDelayCounter;
};
// Final cleanup (e.g. deleting the log object and doing memory leak checking)
// will be delayed until all wxDebugContextDumpDelayCounter objects have been
// destructed. Adding one wxDebugContextDumpDelayCounter per file will delay
// memory leak checking until after destructing all global objects.
class WXDLLIMPEXP_BASE wxDebugContextDumpDelayCounter
{
public:
wxDebugContextDumpDelayCounter();
~wxDebugContextDumpDelayCounter();
private:
void DoDump();
static int sm_count;
};
// make leak dump after all globals have been destructed
static wxDebugContextDumpDelayCounter wxDebugContextDumpDelayCounter_File;
#define WXDEBUG_DUMPDELAYCOUNTER \
static wxDebugContextDumpDelayCounter wxDebugContextDumpDelayCounter_Extra;
// Output a debug message, in a system dependent fashion.
void WXDLLIMPEXP_BASE wxTrace(const wxChar *fmt ...) WX_ATTRIBUTE_PRINTF_1;
void WXDLLIMPEXP_BASE wxTraceLevel(int level, const wxChar *fmt ...) WX_ATTRIBUTE_PRINTF_2;
#define WXTRACE wxTrace
#define WXTRACELEVEL wxTraceLevel
#else // wxUSE_MEMORY_TRACING) || wxUSE_DEBUG_CONTEXT
#define WXDEBUG_DUMPDELAYCOUNTER
// Borland C++ Builder 6 seems to have troubles with inline functions (see bug
// 819700)
#if 0
inline void wxTrace(const wxChar *WXUNUSED(fmt)) {}
inline void wxTraceLevel(int WXUNUSED(level), const wxChar *WXUNUSED(fmt)) {}
#else
#define wxTrace(fmt)
#define wxTraceLevel(l, fmt)
#endif
#define WXTRACE true ? (void)0 : wxTrace
#define WXTRACELEVEL true ? (void)0 : wxTraceLevel
#endif // wxUSE_MEMORY_TRACING) || wxUSE_DEBUG_CONTEXT
#endif // _WX_MEMORY_H_
| h |
rticonnextdds-usecases | data/projects/rticonnextdds-usecases/VehicleTracking/ExampleCode/thirdparty/wxWidgets-3.1.2/Linux/include/wx/txtstrm.h | /////////////////////////////////////////////////////////////////////////////
// Name: wx/txtstrm.h
// Purpose: Text stream classes
// Author: Guilhem Lavaux
// Modified by:
// Created: 28/06/1998
// Copyright: (c) Guilhem Lavaux
// Licence: wxWindows licence
/////////////////////////////////////////////////////////////////////////////
#ifndef _WX_TXTSTREAM_H_
#define _WX_TXTSTREAM_H_
#include "wx/stream.h"
#include "wx/convauto.h"
#if wxUSE_STREAMS
class WXDLLIMPEXP_FWD_BASE wxTextInputStream;
class WXDLLIMPEXP_FWD_BASE wxTextOutputStream;
typedef wxTextInputStream& (*__wxTextInputManip)(wxTextInputStream&);
typedef wxTextOutputStream& (*__wxTextOutputManip)(wxTextOutputStream&);
WXDLLIMPEXP_BASE wxTextOutputStream &endl( wxTextOutputStream &stream );
// Obsolete constant defined only for compatibility, not used.
#define wxEOT wxT('\4')
// If you're scanning through a file using wxTextInputStream, you should check for EOF _before_
// reading the next item (word / number), because otherwise the last item may get lost.
// You should however be prepared to receive an empty item (empty string / zero number) at the
// end of file, especially on Windows systems. This is unavoidable because most (but not all) files end
// with whitespace (i.e. usually a newline).
class WXDLLIMPEXP_BASE wxTextInputStream
{
public:
#if wxUSE_UNICODE
wxTextInputStream(wxInputStream& s,
const wxString &sep=wxT(" \t"),
const wxMBConv& conv = wxConvAuto());
#else
wxTextInputStream(wxInputStream& s, const wxString &sep=wxT(" \t"));
#endif
~wxTextInputStream();
const wxInputStream& GetInputStream() const { return m_input; }
// base may be between 2 and 36, inclusive, or the special 0 (= C format)
wxUint64 Read64(int base = 10);
wxUint32 Read32(int base = 10);
wxUint16 Read16(int base = 10);
wxUint8 Read8(int base = 10);
wxInt64 Read64S(int base = 10);
wxInt32 Read32S(int base = 10);
wxInt16 Read16S(int base = 10);
wxInt8 Read8S(int base = 10);
double ReadDouble();
wxString ReadLine();
wxString ReadWord();
wxChar GetChar();
wxString GetStringSeparators() const { return m_separators; }
void SetStringSeparators(const wxString &c) { m_separators = c; }
// Operators
wxTextInputStream& operator>>(wxString& word);
wxTextInputStream& operator>>(char& c);
#if wxUSE_UNICODE && wxWCHAR_T_IS_REAL_TYPE
wxTextInputStream& operator>>(wchar_t& wc);
#endif // wxUSE_UNICODE
wxTextInputStream& operator>>(wxInt16& i);
wxTextInputStream& operator>>(wxInt32& i);
wxTextInputStream& operator>>(wxInt64& i);
wxTextInputStream& operator>>(wxUint16& i);
wxTextInputStream& operator>>(wxUint32& i);
wxTextInputStream& operator>>(wxUint64& i);
wxTextInputStream& operator>>(double& i);
wxTextInputStream& operator>>(float& f);
wxTextInputStream& operator>>( __wxTextInputManip func) { return func(*this); }
protected:
wxInputStream &m_input;
wxString m_separators;
// Data possibly (see m_validXXX) read from the stream but not decoded yet.
// This is necessary because GetChar() may only return a single character
// but we may get more than one character when decoding raw input bytes.
char m_lastBytes[10];
// The bytes [0, m_validEnd) of m_lastBytes contain the bytes read by the
// last GetChar() call (this interval may be empty if GetChar() hasn't been
// called yet). The bytes [0, m_validBegin) have been already decoded and
// returned to caller or stored in m_lastWChar in the particularly
// egregious case of decoding a non-BMP character when using UTF-16 for
// wchar_t. Finally, the bytes [m_validBegin, m_validEnd) remain to be
// decoded and returned during the next call (again, this interval can, and
// usually will, be empty too if m_validBegin == m_validEnd).
size_t m_validBegin,
m_validEnd;
#if wxUSE_UNICODE
wxMBConv *m_conv;
// The second half of a surrogate character when using UTF-16 for wchar_t:
// we can't return it immediately from GetChar() when we read a Unicode
// code point outside of the BMP, but we can't keep it in m_lastBytes
// neither because it can't separately decoded, so we have a separate 1
// wchar_t buffer just for this case.
#if SIZEOF_WCHAR_T == 2
wchar_t m_lastWChar;
#endif // SIZEOF_WCHAR_T == 2
#endif // wxUSE_UNICODE
bool EatEOL(const wxChar &c);
void UngetLast(); // should be used instead of wxInputStream::Ungetch() because of Unicode issues
wxChar NextNonSeparators();
wxDECLARE_NO_COPY_CLASS(wxTextInputStream);
};
enum wxEOL
{
wxEOL_NATIVE,
wxEOL_UNIX,
wxEOL_MAC,
wxEOL_DOS
};
class WXDLLIMPEXP_BASE wxTextOutputStream
{
public:
#if wxUSE_UNICODE
wxTextOutputStream(wxOutputStream& s,
wxEOL mode = wxEOL_NATIVE,
const wxMBConv& conv = wxConvAuto());
#else
wxTextOutputStream(wxOutputStream& s, wxEOL mode = wxEOL_NATIVE);
#endif
virtual ~wxTextOutputStream();
const wxOutputStream& GetOutputStream() const { return m_output; }
void SetMode( wxEOL mode = wxEOL_NATIVE );
wxEOL GetMode() { return m_mode; }
template<typename T>
void Write(const T& i)
{
wxString str;
str << i;
WriteString(str);
}
void Write64(wxUint64 i);
void Write32(wxUint32 i);
void Write16(wxUint16 i);
void Write8(wxUint8 i);
virtual void WriteDouble(double d);
virtual void WriteString(const wxString& string);
wxTextOutputStream& PutChar(wxChar c);
void Flush();
wxTextOutputStream& operator<<(const wxString& string);
wxTextOutputStream& operator<<(char c);
#if wxUSE_UNICODE && wxWCHAR_T_IS_REAL_TYPE
wxTextOutputStream& operator<<(wchar_t wc);
#endif // wxUSE_UNICODE
wxTextOutputStream& operator<<(wxInt16 c);
wxTextOutputStream& operator<<(wxInt32 c);
wxTextOutputStream& operator<<(wxInt64 c);
wxTextOutputStream& operator<<(wxUint16 c);
wxTextOutputStream& operator<<(wxUint32 c);
wxTextOutputStream& operator<<(wxUint64 c);
wxTextOutputStream& operator<<(double f);
wxTextOutputStream& operator<<(float f);
wxTextOutputStream& operator<<( __wxTextOutputManip func) { return func(*this); }
protected:
wxOutputStream &m_output;
wxEOL m_mode;
#if wxUSE_UNICODE
wxMBConv *m_conv;
#if SIZEOF_WCHAR_T == 2
// The first half of a surrogate character if one was passed to PutChar()
// and couldn't be output when it was called the last time.
wchar_t m_lastWChar;
#endif // SIZEOF_WCHAR_T == 2
#endif // wxUSE_UNICODE
wxDECLARE_NO_COPY_CLASS(wxTextOutputStream);
};
#endif
// wxUSE_STREAMS
#endif
// _WX_DATSTREAM_H_
| h |
rticonnextdds-usecases | data/projects/rticonnextdds-usecases/VehicleTracking/ExampleCode/thirdparty/wxWidgets-3.1.2/Linux/include/wx/toolbook.h | ///////////////////////////////////////////////////////////////////////////////
// Name: wx/toolbook.h
// Purpose: wxToolbook: wxToolBar and wxNotebook combination
// Author: Julian Smart
// Modified by:
// Created: 2006-01-29
// Copyright: (c) 2006 Julian Smart
// Licence: wxWindows licence
///////////////////////////////////////////////////////////////////////////////
#ifndef _WX_TOOLBOOK_H_
#define _WX_TOOLBOOK_H_
#include "wx/defs.h"
#if wxUSE_TOOLBOOK
#include "wx/bookctrl.h"
#include "wx/containr.h"
class WXDLLIMPEXP_FWD_CORE wxToolBarBase;
class WXDLLIMPEXP_FWD_CORE wxCommandEvent;
wxDECLARE_EXPORTED_EVENT( WXDLLIMPEXP_CORE, wxEVT_TOOLBOOK_PAGE_CHANGED, wxBookCtrlEvent );
wxDECLARE_EXPORTED_EVENT( WXDLLIMPEXP_CORE, wxEVT_TOOLBOOK_PAGE_CHANGING, wxBookCtrlEvent );
// Use wxButtonToolBar
#define wxTBK_BUTTONBAR 0x0100
// Use wxTB_HORZ_LAYOUT style for the controlling toolbar
#define wxTBK_HORZ_LAYOUT 0x8000
// deprecated synonym, don't use
#if WXWIN_COMPATIBILITY_2_8
#define wxBK_BUTTONBAR wxTBK_BUTTONBAR
#endif
// ----------------------------------------------------------------------------
// wxToolbook
// ----------------------------------------------------------------------------
class WXDLLIMPEXP_CORE wxToolbook : public wxNavigationEnabled<wxBookCtrlBase>
{
public:
wxToolbook()
{
Init();
}
wxToolbook(wxWindow *parent,
wxWindowID id,
const wxPoint& pos = wxDefaultPosition,
const wxSize& size = wxDefaultSize,
long style = 0,
const wxString& name = wxEmptyString)
{
Init();
(void)Create(parent, id, pos, size, style, name);
}
// quasi ctor
bool Create(wxWindow *parent,
wxWindowID id,
const wxPoint& pos = wxDefaultPosition,
const wxSize& size = wxDefaultSize,
long style = 0,
const wxString& name = wxEmptyString);
// implement base class virtuals
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 bool InsertPage(size_t n,
wxWindow *page,
const wxString& text,
bool bSelect = false,
int imageId = NO_IMAGE) wxOVERRIDE;
virtual int SetSelection(size_t n) wxOVERRIDE { return DoSetSelection(n, SetSelection_SendEvent); }
virtual int ChangeSelection(size_t n) wxOVERRIDE { return DoSetSelection(n); }
virtual void SetImageList(wxImageList *imageList) wxOVERRIDE;
virtual bool DeleteAllPages() wxOVERRIDE;
virtual int HitTest(const wxPoint& pt, long *flags = NULL) const wxOVERRIDE;
// methods which are not part of base wxBookctrl API
// get the underlying toolbar
wxToolBarBase* GetToolBar() const { return (wxToolBarBase*)m_bookctrl; }
// enable/disable a page
bool EnablePage(wxWindow *page, bool enable);
bool EnablePage(size_t page, bool enable);
// must be called in OnIdle or by application to realize the toolbar and
// select the initial page.
void Realize();
protected:
virtual wxWindow *DoRemovePage(size_t page) wxOVERRIDE;
// event handlers
void OnToolSelected(wxCommandEvent& event);
void OnSize(wxSizeEvent& event);
void OnIdle(wxIdleEvent& event);
void UpdateSelectedPage(size_t newsel) wxOVERRIDE;
wxBookCtrlEvent* CreatePageChangingEvent() const wxOVERRIDE;
void MakeChangedEvent(wxBookCtrlEvent &event) wxOVERRIDE;
// whether the toolbar needs to be realized
bool m_needsRealizing;
// maximum bitmap size
wxSize m_maxBitmapSize;
private:
// common part of all constructors
void Init();
// returns the tool identifier for the specified page
int PageToToolId(size_t page) const;
// returns the page index for the specified tool ID or
// wxNOT_FOUND if there is no page with that tool ID
int ToolIdToPage(int toolId) const;
wxDECLARE_EVENT_TABLE();
wxDECLARE_DYNAMIC_CLASS_NO_COPY(wxToolbook);
};
// ----------------------------------------------------------------------------
// listbook event class and related stuff
// ----------------------------------------------------------------------------
// wxToolbookEvent is obsolete and defined for compatibility only
#define wxToolbookEvent wxBookCtrlEvent
typedef wxBookCtrlEventFunction wxToolbookEventFunction;
#define wxToolbookEventHandler(func) wxBookCtrlEventHandler(func)
#define EVT_TOOLBOOK_PAGE_CHANGED(winid, fn) \
wx__DECLARE_EVT1(wxEVT_TOOLBOOK_PAGE_CHANGED, winid, wxBookCtrlEventHandler(fn))
#define EVT_TOOLBOOK_PAGE_CHANGING(winid, fn) \
wx__DECLARE_EVT1(wxEVT_TOOLBOOK_PAGE_CHANGING, winid, wxBookCtrlEventHandler(fn))
// old wxEVT_COMMAND_* constants
#define wxEVT_COMMAND_TOOLBOOK_PAGE_CHANGED wxEVT_TOOLBOOK_PAGE_CHANGED
#define wxEVT_COMMAND_TOOLBOOK_PAGE_CHANGING wxEVT_TOOLBOOK_PAGE_CHANGING
#endif // wxUSE_TOOLBOOK
#endif // _WX_TOOLBOOK_H_
| h |
rticonnextdds-usecases | data/projects/rticonnextdds-usecases/VehicleTracking/ExampleCode/thirdparty/wxWidgets-3.1.2/Linux/include/wx/crt.h | //////////////////////////////////////////////////////////////////////////////
// Name: wx/crt.h
// Purpose: Header to include all headers with wrappers for CRT functions
// Author: Robert Roebling
// Created: 2007-05-30
// Copyright: (c) 2007 wxWidgets dev team
// Licence: wxWindows licence
///////////////////////////////////////////////////////////////////////////////
#ifndef _WX_CRT_H_
#define _WX_CRT_H_
#include "wx/defs.h"
// include wxChar type definition:
#include "wx/chartype.h"
// and wrappers for CRT functions:
#include "wx/wxcrt.h"
#include "wx/wxcrtvararg.h"
#endif // _WX_CRT_H_
| h |
rticonnextdds-usecases | data/projects/rticonnextdds-usecases/VehicleTracking/ExampleCode/thirdparty/wxWidgets-3.1.2/Linux/include/wx/vlbox.h | ///////////////////////////////////////////////////////////////////////////////
// Name: wx/vlbox.h
// Purpose: wxVListBox is a virtual listbox with lines of variable height
// Author: Vadim Zeitlin
// Modified by:
// Created: 31.05.03
// Copyright: (c) 2003 Vadim Zeitlin <[email protected]>
// Licence: wxWindows licence
///////////////////////////////////////////////////////////////////////////////
#ifndef _WX_VLBOX_H_
#define _WX_VLBOX_H_
#include "wx/vscroll.h" // base class
#include "wx/bitmap.h"
class WXDLLIMPEXP_FWD_CORE wxSelectionStore;
extern WXDLLIMPEXP_DATA_CORE(const char) wxVListBoxNameStr[];
// ----------------------------------------------------------------------------
// wxVListBox
// ----------------------------------------------------------------------------
/*
This class has two main differences from a regular listbox: it can have an
arbitrarily huge number of items because it doesn't store them itself but
uses OnDrawItem() callback to draw them and its items can have variable
height as determined by OnMeasureItem().
It emits the same events as wxListBox and the same event macros may be used
with it.
*/
class WXDLLIMPEXP_CORE wxVListBox : public wxVScrolledWindow
{
public:
// constructors and such
// ---------------------
// default constructor, you must call Create() later
wxVListBox() { Init(); }
// normal constructor which calls Create() internally
wxVListBox(wxWindow *parent,
wxWindowID id = wxID_ANY,
const wxPoint& pos = wxDefaultPosition,
const wxSize& size = wxDefaultSize,
long style = 0,
const wxString& name = wxVListBoxNameStr)
{
Init();
(void)Create(parent, id, pos, size, style, name);
}
// really creates the control and sets the initial number of items in it
// (which may be changed later with SetItemCount())
//
// the only special style which may be specified here is wxLB_MULTIPLE
//
// returns true on success or false if the control couldn't be created
bool Create(wxWindow *parent,
wxWindowID id = wxID_ANY,
const wxPoint& pos = wxDefaultPosition,
const wxSize& size = wxDefaultSize,
long style = 0,
const wxString& name = wxVListBoxNameStr);
// dtor does some internal cleanup (deletes m_selStore if any)
virtual ~wxVListBox();
// accessors
// ---------
// get the number of items in the control
size_t GetItemCount() const { return GetRowCount(); }
// does this control use multiple selection?
bool HasMultipleSelection() const { return m_selStore != NULL; }
// get the currently selected item or wxNOT_FOUND if there is no selection
//
// this method is only valid for the single selection listboxes
int GetSelection() const
{
wxASSERT_MSG( !HasMultipleSelection(),
wxT("GetSelection() can't be used with wxLB_MULTIPLE") );
return m_current;
}
// is this item the current one?
bool IsCurrent(size_t item) const { return item == (size_t)m_current; }
#ifdef __WXUNIVERSAL__
bool IsCurrent() const { return wxVScrolledWindow::IsCurrent(); }
#endif
// is this item selected?
bool IsSelected(size_t item) const;
// get the number of the selected items (maybe 0)
//
// this method is valid for both single and multi selection listboxes
size_t GetSelectedCount() const;
// get the first selected item, returns wxNOT_FOUND if none
//
// cookie is an opaque parameter which should be passed to
// GetNextSelected() later
//
// this method is only valid for the multi selection listboxes
int GetFirstSelected(unsigned long& cookie) const;
// get next selection item, return wxNOT_FOUND if no more
//
// cookie must be the same parameter that was passed to GetFirstSelected()
// before
//
// this method is only valid for the multi selection listboxes
int GetNextSelected(unsigned long& cookie) const;
// get the margins around each item
wxPoint GetMargins() const { return m_ptMargins; }
// get the background colour of selected cells
const wxColour& GetSelectionBackground() const { return m_colBgSel; }
// get the item rect, returns empty rect if the item is not visible
wxRect GetItemRect(size_t n) const;
// operations
// ----------
// set the number of items to be shown in the control
//
// this is just a synonym for wxVScrolledWindow::SetRowCount()
virtual void SetItemCount(size_t count);
// delete all items from the control
void Clear() { SetItemCount(0); }
// set the selection to the specified item, if it is wxNOT_FOUND the
// selection is unset
//
// this function is only valid for the single selection listboxes
void SetSelection(int selection);
// selects or deselects the specified item which must be valid (i.e. not
// equal to wxNOT_FOUND)
//
// return true if the items selection status has changed or false
// otherwise
//
// this function is only valid for the multiple selection listboxes
bool Select(size_t item, bool select = true);
// selects the items in the specified range whose end points may be given
// in any order
//
// return true if any items selection status has changed, false otherwise
//
// this function is only valid for the single selection listboxes
bool SelectRange(size_t from, size_t to);
// toggle the selection of the specified item (must be valid)
//
// this function is only valid for the multiple selection listboxes
void Toggle(size_t item) { Select(item, !IsSelected(item)); }
// select all items in the listbox
//
// the return code indicates if any items were affected by this operation
// (true) or if nothing has changed (false)
bool SelectAll() { return DoSelectAll(true); }
// unselect all items in the listbox
//
// the return code has the same meaning as for SelectAll()
bool DeselectAll() { return DoSelectAll(false); }
// set the margins: horizontal margin is the distance between the window
// border and the item contents while vertical margin is half of the
// distance between items
//
// by default both margins are 0
void SetMargins(const wxPoint& pt);
void SetMargins(wxCoord x, wxCoord y) { SetMargins(wxPoint(x, y)); }
// change the background colour of the selected cells
void SetSelectionBackground(const wxColour& col);
// refreshes only the selected items
void RefreshSelected();
virtual wxVisualAttributes GetDefaultAttributes() const wxOVERRIDE
{
return GetClassDefaultAttributes(GetWindowVariant());
}
static wxVisualAttributes
GetClassDefaultAttributes(wxWindowVariant variant = wxWINDOW_VARIANT_NORMAL);
protected:
virtual wxBorder GetDefaultBorder() const wxOVERRIDE { return wxBORDER_THEME; }
// the derived class must implement this function to actually draw the item
// with the given index on the provided DC
virtual void OnDrawItem(wxDC& dc, const wxRect& rect, size_t n) const = 0;
// the derived class must implement this method to return the height of the
// specified item
virtual wxCoord OnMeasureItem(size_t n) const = 0;
// this method may be used to draw separators between the lines; note that
// the rectangle may be modified, typically to deflate it a bit before
// passing to OnDrawItem()
//
// the base class version doesn't do anything
virtual void OnDrawSeparator(wxDC& dc, wxRect& rect, size_t n) const;
// this method is used to draw the items background and, maybe, a border
// around it
//
// the base class version implements a reasonable default behaviour which
// consists in drawing the selected item with the standard background
// colour and drawing a border around the item if it is either selected or
// current
virtual void OnDrawBackground(wxDC& dc, const wxRect& rect, size_t n) const;
// we implement OnGetRowHeight() in terms of OnMeasureItem() because this
// allows us to add borders to the items easily
//
// this function is not supposed to be overridden by the derived classes
virtual wxCoord OnGetRowHeight(size_t line) const wxOVERRIDE;
// event handlers
void OnPaint(wxPaintEvent& event);
void OnKeyDown(wxKeyEvent& event);
void OnLeftDown(wxMouseEvent& event);
void OnLeftDClick(wxMouseEvent& event);
void OnSetOrKillFocus(wxFocusEvent& event);
void OnSize(wxSizeEvent& event);
// common part of all ctors
void Init();
// send the wxEVT_LISTBOX event
void SendSelectedEvent();
virtual void InitEvent(wxCommandEvent& event, int n);
// common implementation of SelectAll() and DeselectAll()
bool DoSelectAll(bool select);
// change the current item (in single selection listbox it also implicitly
// changes the selection); current may be wxNOT_FOUND in which case there
// will be no current item any more
//
// return true if the current item changed, false otherwise
bool DoSetCurrent(int current);
// flags for DoHandleItemClick
enum
{
ItemClick_Shift = 1, // item shift-clicked
ItemClick_Ctrl = 2, // ctrl
ItemClick_Kbd = 4 // item selected from keyboard
};
// common part of keyboard and mouse handling processing code
void DoHandleItemClick(int item, int flags);
// paint the background of the given item using the provided colour if it's
// valid, otherwise just return false and do nothing (this is used by
// OnDrawBackground())
bool DoDrawSolidBackground(const wxColour& col,
wxDC& dc,
const wxRect& rect,
size_t n) const;
private:
// the current item or wxNOT_FOUND
//
// if m_selStore == NULL this is also the selected item, otherwise the
// selections are managed by m_selStore
int m_current;
// the anchor of the selection for the multiselection listboxes:
// shift-clicking an item extends the selection from m_anchor to the item
// clicked, for example
//
// always wxNOT_FOUND for single selection listboxes
int m_anchor;
// the object managing our selected items if not NULL
wxSelectionStore *m_selStore;
// margins
wxPoint m_ptMargins;
// the selection bg colour
wxColour m_colBgSel;
wxDECLARE_EVENT_TABLE();
wxDECLARE_NO_COPY_CLASS(wxVListBox);
wxDECLARE_ABSTRACT_CLASS(wxVListBox);
};
#endif // _WX_VLBOX_H_
| h |
rticonnextdds-usecases | data/projects/rticonnextdds-usecases/VehicleTracking/ExampleCode/thirdparty/wxWidgets-3.1.2/Linux/include/wx/stringops.h | ///////////////////////////////////////////////////////////////////////////////
// Name: wx/stringops.h
// Purpose: implementation of wxString primitive operations
// Author: Vaclav Slavik
// Modified by:
// Created: 2007-04-16
// Copyright: (c) 2007 REA Elektronik GmbH
// Licence: wxWindows licence
///////////////////////////////////////////////////////////////////////////////
#ifndef _WX_WXSTRINGOPS_H__
#define _WX_WXSTRINGOPS_H__
#include "wx/chartype.h"
#include "wx/stringimpl.h"
#include "wx/unichar.h"
#include "wx/buffer.h"
// This header contains wxStringOperations "namespace" class that implements
// elementary operations on string data as static methods; wxString methods and
// iterators are implemented in terms of it. Two implementations are available,
// one for UTF-8 encoded char* string and one for "raw" wchar_t* strings (or
// char* in ANSI build).
// FIXME-UTF8: only wchar after we remove ANSI build
#if wxUSE_UNICODE_WCHAR || !wxUSE_UNICODE
struct WXDLLIMPEXP_BASE wxStringOperationsWchar
{
// moves the iterator to the next Unicode character
template <typename Iterator>
static void IncIter(Iterator& i) { ++i; }
// moves the iterator to the previous Unicode character
template <typename Iterator>
static void DecIter(Iterator& i) { --i; }
// moves the iterator by n Unicode characters
template <typename Iterator>
static Iterator AddToIter(const Iterator& i, ptrdiff_t n)
{ return i + n; }
// returns distance of the two iterators in Unicode characters
template <typename Iterator>
static ptrdiff_t DiffIters(const Iterator& i1, const Iterator& i2)
{ return i1 - i2; }
#if wxUSE_UNICODE_UTF16
// encodes the characters as UTF-16:
struct Utf16CharBuffer
{
// Notice that data is left uninitialized, it is filled by EncodeChar()
// which is the only function creating objects of this class.
wchar_t data[3];
operator const wchar_t*() const { return data; }
};
static Utf16CharBuffer EncodeChar(const wxUniChar& ch);
static wxWCharBuffer EncodeNChars(size_t n, const wxUniChar& ch);
static bool IsSingleCodeUnitCharacter(const wxUniChar& ch)
{ return !ch.IsSupplementary(); }
#else
// encodes the character to a form used to represent it in internal
// representation
struct SingleCharBuffer
{
wxChar data[2];
operator const wxChar*() const { return data; }
};
static SingleCharBuffer EncodeChar(const wxUniChar& ch)
{
SingleCharBuffer buf;
buf.data[0] = (wxChar)ch;
buf.data[1] = 0;
return buf;
}
static wxWxCharBuffer EncodeNChars(size_t n, const wxUniChar& ch);
static bool IsSingleCodeUnitCharacter(const wxUniChar&) { return true; }
#endif
static wxUniChar DecodeChar(const wxStringImpl::const_iterator& i)
{ return *i; }
};
#endif // wxUSE_UNICODE_WCHAR || !wxUSE_UNICODE
#if wxUSE_UNICODE_UTF8
struct WXDLLIMPEXP_BASE wxStringOperationsUtf8
{
// checks correctness of UTF-8 sequence
static bool IsValidUtf8String(const char *c,
size_t len = wxStringImpl::npos);
static bool IsValidUtf8LeadByte(unsigned char c)
{
return (c <= 0x7F) || (c >= 0xC2 && c <= 0xF4);
}
// table of offsets to skip forward when iterating over UTF-8 sequence
static const unsigned char ms_utf8IterTable[256];
template<typename Iterator>
static void IncIter(Iterator& i)
{
wxASSERT( IsValidUtf8LeadByte(*i) );
i += ms_utf8IterTable[(unsigned char)*i];
}
template<typename Iterator>
static void DecIter(Iterator& i)
{
// Non-lead bytes are all in the 0x80..0xBF range (i.e. 10xxxxxx in
// binary), so we just have to go back until we hit a byte that is
// either < 0x80 (i.e. 0xxxxxxx in binary) or 0xC0..0xFF (11xxxxxx in
// binary; this includes some invalid values, but we can ignore it
// here, because we assume valid UTF-8 input for the purpose of
// efficient implementation).
--i;
while ( ((*i) & 0xC0) == 0x80 /* 2 highest bits are '10' */ )
--i;
}
template<typename Iterator>
static Iterator AddToIter(const Iterator& i, ptrdiff_t n)
{
Iterator out(i);
if ( n > 0 )
{
for ( ptrdiff_t j = 0; j < n; ++j )
IncIter(out);
}
else if ( n < 0 )
{
for ( ptrdiff_t j = 0; j > n; --j )
DecIter(out);
}
return out;
}
template<typename Iterator>
static ptrdiff_t DiffIters(Iterator i1, Iterator i2)
{
ptrdiff_t dist = 0;
if ( i1 < i2 )
{
while ( i1 != i2 )
{
IncIter(i1);
dist--;
}
}
else if ( i2 < i1 )
{
while ( i2 != i1 )
{
IncIter(i2);
dist++;
}
}
return dist;
}
static bool IsSingleCodeUnitCharacter(const wxUniChar& ch)
{ return ch.IsAscii(); }
// encodes the character as UTF-8:
typedef wxUniChar::Utf8CharBuffer Utf8CharBuffer;
static Utf8CharBuffer EncodeChar(const wxUniChar& ch)
{ return ch.AsUTF8(); }
// returns n copies of ch encoded in UTF-8 string
static wxCharBuffer EncodeNChars(size_t n, const wxUniChar& ch);
// returns the length of UTF-8 encoding of the character with lead byte 'c'
static size_t GetUtf8CharLength(char c)
{
wxASSERT( IsValidUtf8LeadByte(c) );
return ms_utf8IterTable[(unsigned char)c];
}
// decodes single UTF-8 character from UTF-8 string
static wxUniChar DecodeChar(wxStringImpl::const_iterator i)
{
if ( (unsigned char)*i < 0x80 )
return (int)*i;
return DecodeNonAsciiChar(i);
}
private:
static wxUniChar DecodeNonAsciiChar(wxStringImpl::const_iterator i);
};
#endif // wxUSE_UNICODE_UTF8
#if wxUSE_UNICODE_UTF8
typedef wxStringOperationsUtf8 wxStringOperations;
#else
typedef wxStringOperationsWchar wxStringOperations;
#endif
#endif // _WX_WXSTRINGOPS_H_
| h |
rticonnextdds-usecases | data/projects/rticonnextdds-usecases/VehicleTracking/ExampleCode/thirdparty/wxWidgets-3.1.2/Linux/include/wx/intl.h | /////////////////////////////////////////////////////////////////////////////
// Name: wx/intl.h
// Purpose: Internationalization and localisation for wxWidgets
// Author: Vadim Zeitlin
// Modified by: Michael N. Filippov <[email protected]>
// (2003/09/30 - plural forms support)
// Created: 29/01/98
// Copyright: (c) 1998 Vadim Zeitlin <[email protected]>
// Licence: wxWindows licence
/////////////////////////////////////////////////////////////////////////////
#ifndef _WX_INTL_H_
#define _WX_INTL_H_
#include "wx/defs.h"
#include "wx/string.h"
#include "wx/translation.h"
// Make wxLayoutDirection enum available without need for wxUSE_INTL so wxWindow, wxApp
// and other classes are not distrubed by wxUSE_INTL
enum wxLayoutDirection
{
wxLayout_Default,
wxLayout_LeftToRight,
wxLayout_RightToLeft
};
#if wxUSE_INTL
#include "wx/fontenc.h"
#include "wx/language.h"
// ============================================================================
// global decls
// ============================================================================
// ----------------------------------------------------------------------------
// macros
// ----------------------------------------------------------------------------
// ----------------------------------------------------------------------------
// forward decls
// ----------------------------------------------------------------------------
class WXDLLIMPEXP_FWD_BASE wxLocale;
class WXDLLIMPEXP_FWD_BASE wxLanguageInfoArray;
// ============================================================================
// locale support
// ============================================================================
// ----------------------------------------------------------------------------
// wxLanguageInfo: encapsulates wxLanguage to OS native lang.desc.
// translation information
// ----------------------------------------------------------------------------
struct WXDLLIMPEXP_BASE wxLanguageInfo
{
int Language; // wxLanguage id
wxString CanonicalName; // Canonical name, e.g. fr_FR
#ifdef __WINDOWS__
wxUint32 WinLang, // Win32 language identifiers
WinSublang;
#endif // __WINDOWS__
wxString Description; // human-readable name of the language
wxLayoutDirection LayoutDirection;
#ifdef __WINDOWS__
// return the LCID corresponding to this language
wxUint32 GetLCID() const;
#endif // __WINDOWS__
// return the locale name corresponding to this language usable with
// setlocale() on the current system or empty string if this locale is not
// supported
wxString GetLocaleName() const;
// Call setlocale() and return non-null value if it works for this language.
//
// This function is mostly for internal use, as changing locale involves
// more than just calling setlocale() on some platforms, use wxLocale to
// do everything that needs to be done instead of calling this method.
const char* TrySetLocale() const;
};
// ----------------------------------------------------------------------------
// wxLocaleCategory: the category of locale settings
// ----------------------------------------------------------------------------
enum wxLocaleCategory
{
// (any) numbers
wxLOCALE_CAT_NUMBER,
// date/time
wxLOCALE_CAT_DATE,
// monetary value
wxLOCALE_CAT_MONEY,
// default category for wxLocaleInfo values which only apply to a single
// category (e.g. wxLOCALE_SHORT_DATE_FMT)
wxLOCALE_CAT_DEFAULT,
wxLOCALE_CAT_MAX
};
// ----------------------------------------------------------------------------
// wxLocaleInfo: the items understood by wxLocale::GetInfo()
// ----------------------------------------------------------------------------
enum wxLocaleInfo
{
// the thousands separator (for wxLOCALE_CAT_NUMBER or MONEY)
wxLOCALE_THOUSANDS_SEP,
// the character used as decimal point (for wxLOCALE_CAT_NUMBER or MONEY)
wxLOCALE_DECIMAL_POINT,
// the stftime()-formats used for short/long date and time representations
// (under some platforms short and long date formats are the same)
//
// NB: these elements should appear in this order, code in GetInfo() relies
// on it
wxLOCALE_SHORT_DATE_FMT,
wxLOCALE_LONG_DATE_FMT,
wxLOCALE_DATE_TIME_FMT,
wxLOCALE_TIME_FMT
};
// ----------------------------------------------------------------------------
// wxLocale: encapsulates all language dependent settings, including current
// message catalogs, date, time and currency formats (TODO) &c
// ----------------------------------------------------------------------------
enum wxLocaleInitFlags
{
wxLOCALE_DONT_LOAD_DEFAULT = 0x0000, // don't load wxwin.mo
wxLOCALE_LOAD_DEFAULT = 0x0001 // load wxwin.mo?
#if WXWIN_COMPATIBILITY_2_8
,wxLOCALE_CONV_ENCODING = 0x0002 // no longer used, simply remove
// it from the existing code
#endif
};
class WXDLLIMPEXP_BASE wxLocale
{
public:
// ctor & dtor
// -----------
// call Init() if you use this ctor
wxLocale() { DoCommonInit(); }
// the ctor has a side effect of changing current locale
wxLocale(const wxString& name, // name (for messages)
const wxString& shortName = wxEmptyString, // dir prefix (for msg files)
const wxString& locale = wxEmptyString, // locale (for setlocale)
bool bLoadDefault = true // preload wxstd.mo?
#if WXWIN_COMPATIBILITY_2_8
,bool bConvertEncoding = true // convert Win<->Unix if necessary?
#endif
)
{
DoCommonInit();
#if WXWIN_COMPATIBILITY_2_8
Init(name, shortName, locale, bLoadDefault, bConvertEncoding);
#else
Init(name, shortName, locale, bLoadDefault);
#endif
}
wxLocale(int language, // wxLanguage id or custom language
int flags = wxLOCALE_LOAD_DEFAULT)
{
DoCommonInit();
Init(language, flags);
}
// the same as a function (returns true on success)
bool Init(const wxString& name,
const wxString& shortName = wxEmptyString,
const wxString& locale = wxEmptyString,
bool bLoadDefault = true
#if WXWIN_COMPATIBILITY_2_8
,bool bConvertEncoding = true
#endif
);
// same as second ctor (returns true on success)
bool Init(int language = wxLANGUAGE_DEFAULT,
int flags = wxLOCALE_LOAD_DEFAULT);
// restores old locale
virtual ~wxLocale();
// Try to get user's (or OS's) preferred language setting.
// Return wxLANGUAGE_UNKNOWN if language-guessing algorithm failed
static int GetSystemLanguage();
// get the encoding used by default for text on this system, returns
// wxFONTENCODING_SYSTEM if it couldn't be determined
static wxFontEncoding GetSystemEncoding();
// get the string describing the system encoding, return empty string if
// couldn't be determined
static wxString GetSystemEncodingName();
// get the values of the given locale-dependent datum: the current locale
// is used, the US default value is returned if everything else fails
static wxString GetInfo(wxLocaleInfo index,
wxLocaleCategory cat = wxLOCALE_CAT_DEFAULT);
// Same as GetInfo() but uses current locale at the OS level to retrieve
// the information. Normally it should be the same as the one used by
// GetInfo() but there are two exceptions: the most important one is that
// if no locale had been set, GetInfo() would fall back to "C" locale,
// while this one uses the default OS locale. Another, more rare, one is
// that some locales might not supported by the OS.
//
// Currently this is the same as GetInfo() under non-MSW platforms.
static wxString GetOSInfo(wxLocaleInfo index,
wxLocaleCategory cat = wxLOCALE_CAT_DEFAULT);
// return true if the locale was set successfully
bool IsOk() const { return m_pszOldLocale != NULL; }
// returns locale name
const wxString& GetLocale() const { return m_strLocale; }
// return current locale wxLanguage value
int GetLanguage() const { return m_language; }
// return locale name to be passed to setlocale()
wxString GetSysName() const;
// return 'canonical' name, i.e. in the form of xx[_YY], where xx is
// language code according to ISO 639 and YY is country name
// as specified by ISO 3166.
wxString GetCanonicalName() const { return m_strShort; }
// add a prefix to the catalog lookup path: the message catalog files will be
// looked up under prefix/<lang>/LC_MESSAGES, prefix/LC_MESSAGES and prefix
// (in this order).
//
// This only applies to subsequent invocations of AddCatalog()!
static void AddCatalogLookupPathPrefix(const wxString& prefix)
{ wxFileTranslationsLoader::AddCatalogLookupPathPrefix(prefix); }
// add a catalog: it's searched for in standard places (current directory
// first, system one after), but the you may prepend additional directories to
// the search path with AddCatalogLookupPathPrefix().
//
// The loaded catalog will be used for message lookup by GetString().
//
// Returns 'true' if it was successfully loaded
bool AddCatalog(const wxString& domain);
bool AddCatalog(const wxString& domain, wxLanguage msgIdLanguage);
bool AddCatalog(const wxString& domain,
wxLanguage msgIdLanguage, const wxString& msgIdCharset);
// check if the given locale is provided by OS and C run time
static bool IsAvailable(int lang);
// check if the given catalog is loaded
bool IsLoaded(const wxString& domain) const;
// Retrieve the language info struct for the given language
//
// Returns NULL if no info found, pointer must *not* be deleted by caller
static const wxLanguageInfo *GetLanguageInfo(int lang);
// Returns language name in English or empty string if the language
// is not in database
static wxString GetLanguageName(int lang);
// Returns ISO code ("canonical name") of language or empty string if the
// language is not in database
static wxString GetLanguageCanonicalName(int lang);
// Find the language for the given locale string which may be either a
// canonical ISO 2 letter language code ("xx"), a language code followed by
// the country code ("xx_XX") or a Windows full language name ("Xxxxx...")
//
// Returns NULL if no info found, pointer must *not* be deleted by caller
static const wxLanguageInfo *FindLanguageInfo(const wxString& locale);
// Add custom language to the list of known languages.
// Notes: 1) wxLanguageInfo contains platform-specific data
// 2) must be called before Init to have effect
static void AddLanguage(const wxLanguageInfo& info);
// retrieve the translation for a string in all loaded domains unless
// the szDomain parameter is specified (and then only this domain is
// searched)
// n - additional parameter for PluralFormsParser
//
// return original string if translation is not available
// (in this case an error message is generated the first time
// a string is not found; use wxLogNull to suppress it)
//
// domains are searched in the last to first order, i.e. catalogs
// added later override those added before.
const wxString& GetString(const wxString& origString,
const wxString& domain = wxEmptyString) const
{
return wxGetTranslation(origString, domain);
}
// plural form version of the same:
const wxString& GetString(const wxString& origString,
const wxString& origString2,
unsigned n,
const wxString& domain = wxEmptyString) const
{
return wxGetTranslation(origString, origString2, n, domain);
}
// Returns the current short name for the locale
const wxString& GetName() const { return m_strShort; }
// return the contents of .po file header
wxString GetHeaderValue(const wxString& header,
const wxString& domain = wxEmptyString) const;
// These two methods are for internal use only. First one creates
// ms_languagesDB if it doesn't already exist, second one destroys
// it.
static void CreateLanguagesDB();
static void DestroyLanguagesDB();
private:
// This method is trivial and just updates the corresponding member
// variables without doing anything else.
void DoInit(const wxString& name,
const wxString& shortName,
int language);
// copy default table of languages from global static array to
// m_langugagesInfo, called by InitLanguagesDB
static void InitLanguagesDB();
// initialize the member fields to default values
void DoCommonInit();
// After trying to set locale, call this method to give the appropriate
// error if it couldn't be set (success == false) and to load the
// translations for the given language, if necessary.
//
// The return value is the same as "success" parameter.
bool DoCommonPostInit(bool success,
const wxString& name,
const wxString& shortName,
bool bLoadDefault);
wxString m_strLocale, // this locale name
m_strShort; // short name for the locale
int m_language; // this locale wxLanguage value
const char *m_pszOldLocale; // previous locale from setlocale()
wxLocale *m_pOldLocale; // previous wxLocale
bool m_initialized;
wxTranslations m_translations;
static wxLanguageInfoArray *ms_languagesDB;
wxDECLARE_NO_COPY_CLASS(wxLocale);
};
// ----------------------------------------------------------------------------
// global functions
// ----------------------------------------------------------------------------
// get the current locale object (note that it may be NULL!)
extern WXDLLIMPEXP_BASE wxLocale* wxGetLocale();
#endif // wxUSE_INTL
#endif // _WX_INTL_H_
| h |
rticonnextdds-usecases | data/projects/rticonnextdds-usecases/VehicleTracking/ExampleCode/thirdparty/wxWidgets-3.1.2/Linux/include/wx/vector.h | ///////////////////////////////////////////////////////////////////////////////
// Name: wx/vector.h
// Purpose: STL vector clone
// Author: Lindsay Mathieson
// Modified by: Vaclav Slavik - make it a template
// Created: 30.07.2001
// Copyright: (c) 2001 Lindsay Mathieson <[email protected]>,
// 2007 Vaclav Slavik <[email protected]>
// Licence: wxWindows licence
///////////////////////////////////////////////////////////////////////////////
#ifndef _WX_VECTOR_H_
#define _WX_VECTOR_H_
#include "wx/defs.h"
#if wxUSE_STD_CONTAINERS
#include <vector>
#include <algorithm>
#define wxVector std::vector
template<typename T>
inline void wxVectorSort(wxVector<T>& v)
{
std::sort(v.begin(), v.end());
}
#else // !wxUSE_STD_CONTAINERS
#include "wx/scopeguard.h"
#include "wx/meta/movable.h"
#include "wx/meta/if.h"
#include "wx/beforestd.h"
#if wxUSE_STD_CONTAINERS_COMPATIBLY
#include <iterator>
#endif
#include <new> // for placement new
#include "wx/afterstd.h"
// wxQsort is declared in wx/utils.h, but can't include that file here,
// it indirectly includes this file. Just lovely...
typedef int (*wxSortCallback)(const void* pItem1,
const void* pItem2,
const void* user_data);
WXDLLIMPEXP_BASE void wxQsort(void* pbase, size_t total_elems,
size_t size, wxSortCallback cmp,
const void* user_data);
namespace wxPrivate
{
// These templates encapsulate memory operations for use by wxVector; there are
// two implementations, both in generic way for any C++ types and as an
// optimized version for "movable" types that uses realloc() and memmove().
// version for movable types:
template<typename T>
struct wxVectorMemOpsMovable
{
static void Free(T* array)
{ free(array); }
static T* Realloc(T* old, size_t newCapacity, size_t WXUNUSED(occupiedSize))
{ return (T*)realloc(old, newCapacity * sizeof(T)); }
static void MemmoveBackward(T* dest, T* source, size_t count)
{ memmove(dest, source, count * sizeof(T)); }
static void MemmoveForward(T* dest, T* source, size_t count)
{ memmove(dest, source, count * sizeof(T)); }
};
// generic version for non-movable types:
template<typename T>
struct wxVectorMemOpsGeneric
{
static void Free(T* array)
{ ::operator delete(array); }
static T* Realloc(T* old, size_t newCapacity, size_t occupiedSize)
{
T *mem = (T*)::operator new(newCapacity * sizeof(T));
for ( size_t i = 0; i < occupiedSize; i++ )
{
::new(mem + i) T(old[i]);
old[i].~T();
}
::operator delete(old);
return mem;
}
static void MemmoveBackward(T* dest, T* source, size_t count)
{
wxASSERT( dest < source );
T* destptr = dest;
T* sourceptr = source;
for ( size_t i = count; i > 0; --i, ++destptr, ++sourceptr )
{
::new(destptr) T(*sourceptr);
sourceptr->~T();
}
}
static void MemmoveForward(T* dest, T* source, size_t count)
{
wxASSERT( dest > source );
T* destptr = dest + count - 1;
T* sourceptr = source + count - 1;
for ( size_t i = count; i > 0; --i, --destptr, --sourceptr )
{
::new(destptr) T(*sourceptr);
sourceptr->~T();
}
}
};
// We need to distinguish integers from iterators in assign() overloads and the
// simplest way to do it would be by using std::iterator_traits<>, however this
// might break existing code using custom iterator classes but not specializing
// iterator_traits<> for them, so we approach the problem from the other end
// and use our own traits that we specialize for all integer types.
struct IsIntType {};
struct IsNotIntType {};
template <typename T> struct IsInt : IsNotIntType {};
#define WX_DECLARE_TYPE_IS_INT(type) \
template <> struct IsInt<type> : IsIntType {}
WX_DECLARE_TYPE_IS_INT(unsigned char);
WX_DECLARE_TYPE_IS_INT(signed char);
WX_DECLARE_TYPE_IS_INT(unsigned short int);
WX_DECLARE_TYPE_IS_INT(signed short int);
WX_DECLARE_TYPE_IS_INT(unsigned int);
WX_DECLARE_TYPE_IS_INT(signed int);
WX_DECLARE_TYPE_IS_INT(unsigned long int);
WX_DECLARE_TYPE_IS_INT(signed long int);
#ifdef wxLongLong_t
WX_DECLARE_TYPE_IS_INT(wxLongLong_t);
WX_DECLARE_TYPE_IS_INT(wxULongLong_t);
#endif
#undef WX_DECLARE_TYPE_IS_INT
} // namespace wxPrivate
template<typename T>
class wxVector
{
private:
// This cryptic expression means "typedef Ops to wxVectorMemOpsMovable if
// type T is movable type, otherwise to wxVectorMemOpsGeneric".
//
// Note that bcc needs the extra parentheses for non-type template
// arguments to compile this expression.
typedef typename wxIf< (wxIsMovable<T>::value),
wxPrivate::wxVectorMemOpsMovable<T>,
wxPrivate::wxVectorMemOpsGeneric<T> >::value
Ops;
public:
typedef size_t size_type;
typedef ptrdiff_t difference_type;
typedef T value_type;
typedef value_type* pointer;
typedef const value_type* const_pointer;
typedef value_type* iterator;
typedef const value_type* const_iterator;
typedef value_type& reference;
typedef const value_type& const_reference;
class reverse_iterator
{
public:
#if wxUSE_STD_CONTAINERS_COMPATIBLY
typedef std::random_access_iterator_tag iterator_category;
#endif
typedef ptrdiff_t difference_type;
typedef T value_type;
typedef value_type* pointer;
typedef value_type& reference;
reverse_iterator() : m_ptr(NULL) { }
explicit reverse_iterator(iterator it) : m_ptr(it) { }
reverse_iterator(const reverse_iterator& it) : m_ptr(it.m_ptr) { }
reference operator*() const { return *m_ptr; }
pointer operator->() const { return m_ptr; }
iterator base() const { return m_ptr; }
reverse_iterator& operator++()
{ --m_ptr; return *this; }
reverse_iterator operator++(int)
{ reverse_iterator tmp = *this; --m_ptr; return tmp; }
reverse_iterator& operator--()
{ ++m_ptr; return *this; }
reverse_iterator operator--(int)
{ reverse_iterator tmp = *this; ++m_ptr; return tmp; }
reverse_iterator operator+(difference_type n) const
{ return reverse_iterator(m_ptr - n); }
reverse_iterator& operator+=(difference_type n)
{ m_ptr -= n; return *this; }
reverse_iterator operator-(difference_type n) const
{ return reverse_iterator(m_ptr + n); }
reverse_iterator& operator-=(difference_type n)
{ m_ptr += n; return *this; }
difference_type operator-(const reverse_iterator& it) const
{ return it.m_ptr - m_ptr; }
reference operator[](difference_type n) const
{ return *(*this + n); }
bool operator ==(const reverse_iterator& it) const
{ return m_ptr == it.m_ptr; }
bool operator !=(const reverse_iterator& it) const
{ return m_ptr != it.m_ptr; }
bool operator<(const reverse_iterator& it) const
{ return m_ptr > it.m_ptr; }
bool operator>(const reverse_iterator& it) const
{ return m_ptr < it.m_ptr; }
bool operator<=(const reverse_iterator& it) const
{ return m_ptr >= it.m_ptr; }
bool operator>=(const reverse_iterator& it) const
{ return m_ptr <= it.m_ptr; }
private:
value_type *m_ptr;
friend class const_reverse_iterator;
};
class const_reverse_iterator
{
public:
#if wxUSE_STD_CONTAINERS_COMPATIBLY
typedef std::random_access_iterator_tag iterator_category;
#endif
typedef ptrdiff_t difference_type;
typedef T value_type;
typedef const value_type* pointer;
typedef const value_type& reference;
const_reverse_iterator() : m_ptr(NULL) { }
explicit const_reverse_iterator(const_iterator it) : m_ptr(it) { }
const_reverse_iterator(const reverse_iterator& it) : m_ptr(it.m_ptr) { }
const_reverse_iterator(const const_reverse_iterator& it) : m_ptr(it.m_ptr) { }
const_reference operator*() const { return *m_ptr; }
const_pointer operator->() const { return m_ptr; }
const_iterator base() const { return m_ptr; }
const_reverse_iterator& operator++()
{ --m_ptr; return *this; }
const_reverse_iterator operator++(int)
{ const_reverse_iterator tmp = *this; --m_ptr; return tmp; }
const_reverse_iterator& operator--()
{ ++m_ptr; return *this; }
const_reverse_iterator operator--(int)
{ const_reverse_iterator tmp = *this; ++m_ptr; return tmp; }
const_reverse_iterator operator+(difference_type n) const
{ return const_reverse_iterator(m_ptr - n); }
const_reverse_iterator& operator+=(difference_type n)
{ m_ptr -= n; return *this; }
const_reverse_iterator operator-(difference_type n) const
{ return const_reverse_iterator(m_ptr + n); }
const_reverse_iterator& operator-=(difference_type n)
{ m_ptr += n; return *this; }
difference_type operator-(const const_reverse_iterator& it) const
{ return it.m_ptr - m_ptr; }
const_reference operator[](difference_type n) const
{ return *(*this + n); }
bool operator ==(const const_reverse_iterator& it) const
{ return m_ptr == it.m_ptr; }
bool operator !=(const const_reverse_iterator& it) const
{ return m_ptr != it.m_ptr; }
bool operator<(const const_reverse_iterator& it) const
{ return m_ptr > it.m_ptr; }
bool operator>(const const_reverse_iterator& it) const
{ return m_ptr < it.m_ptr; }
bool operator<=(const const_reverse_iterator& it) const
{ return m_ptr >= it.m_ptr; }
bool operator>=(const const_reverse_iterator& it) const
{ return m_ptr <= it.m_ptr; }
protected:
const value_type *m_ptr;
};
wxVector() : m_size(0), m_capacity(0), m_values(NULL) {}
wxVector(size_type p_size)
: m_size(0), m_capacity(0), m_values(NULL)
{
reserve(p_size);
for ( size_t n = 0; n < p_size; n++ )
push_back(value_type());
}
wxVector(size_type p_size, const value_type& v)
: m_size(0), m_capacity(0), m_values(NULL)
{
reserve(p_size);
for ( size_t n = 0; n < p_size; n++ )
push_back(v);
}
wxVector(const wxVector& c) : m_size(0), m_capacity(0), m_values(NULL)
{
Copy(c);
}
template <class InputIterator>
wxVector(InputIterator first, InputIterator last)
: m_size(0), m_capacity(0), m_values(NULL)
{
assign(first, last);
}
~wxVector()
{
clear();
}
void assign(size_type p_size, const value_type& v)
{
AssignFromValue(p_size, v);
}
template <typename InputIterator>
void assign(InputIterator first, InputIterator last)
{
AssignDispatch(first, last, typename wxPrivate::IsInt<InputIterator>());
}
void swap(wxVector& v)
{
wxSwap(m_size, v.m_size);
wxSwap(m_capacity, v.m_capacity);
wxSwap(m_values, v.m_values);
}
void clear()
{
// call destructors of stored objects:
for ( size_type i = 0; i < m_size; i++ )
{
m_values[i].~T();
}
Ops::Free(m_values);
m_values = NULL;
m_size =
m_capacity = 0;
}
void reserve(size_type n)
{
if ( n <= m_capacity )
return;
// increase the size twice, unless we're already too big or unless
// more is requested
//
// NB: casts to size_type are needed to suppress warnings about
// mixing enumeral and non-enumeral type in conditional expression
const size_type increment = m_size > ALLOC_INITIAL_SIZE
? m_size
: (size_type)ALLOC_INITIAL_SIZE;
if ( m_capacity + increment > n )
n = m_capacity + increment;
m_values = Ops::Realloc(m_values, n, m_size);
m_capacity = n;
}
void resize(size_type n)
{
if ( n < m_size )
Shrink(n);
else if ( n > m_size )
Extend(n, value_type());
}
void resize(size_type n, const value_type& v)
{
if ( n < m_size )
Shrink(n);
else if ( n > m_size )
Extend(n, v);
}
size_type size() const
{
return m_size;
}
size_type capacity() const
{
return m_capacity;
}
void shrink_to_fit()
{
m_values = Ops::Realloc(m_values, m_size, m_size);
m_capacity = m_size;
}
bool empty() const
{
return size() == 0;
}
wxVector& operator=(const wxVector& vb)
{
if (this != &vb)
{
clear();
Copy(vb);
}
return *this;
}
bool operator==(const wxVector& vb) const
{
if ( vb.m_size != m_size )
return false;
for ( size_type i = 0; i < m_size; i++ )
{
if ( vb.m_values[i] != m_values[i] )
return false;
}
return true;
}
bool operator!=(const wxVector& vb) const
{
return !(*this == vb);
}
void push_back(const value_type& v)
{
reserve(size() + 1);
// use placement new to initialize new object in preallocated place in
// m_values and store 'v' in it:
void* const place = m_values + m_size;
::new(place) value_type(v);
// only increase m_size if the ctor didn't throw an exception; notice
// that if it _did_ throw, everything is OK, because we only increased
// vector's capacity so far and possibly written some data to
// uninitialized memory at the end of m_values
m_size++;
}
void pop_back()
{
erase(end() - 1);
}
const value_type& at(size_type idx) const
{
wxASSERT(idx < m_size);
return m_values[idx];
}
value_type& at(size_type idx)
{
wxASSERT(idx < m_size);
return m_values[idx];
}
const value_type& operator[](size_type idx) const { return at(idx); }
value_type& operator[](size_type idx) { return at(idx); }
const value_type& front() const { return at(0); }
value_type& front() { return at(0); }
const value_type& back() const { return at(size() - 1); }
value_type& back() { return at(size() - 1); }
const_iterator begin() const { return m_values; }
iterator begin() { return m_values; }
const_iterator end() const { return m_values + size(); }
iterator end() { return m_values + size(); }
reverse_iterator rbegin() { return reverse_iterator(end() - 1); }
reverse_iterator rend() { return reverse_iterator(begin() - 1); }
const_reverse_iterator rbegin() const { return const_reverse_iterator(end() - 1); }
const_reverse_iterator rend() const { return const_reverse_iterator(begin() - 1); }
iterator insert(iterator it, size_type count, const value_type& v)
{
// NB: this must be done before reserve(), because reserve()
// invalidates iterators!
const size_t idx = it - begin();
const size_t after = end() - it;
reserve(size() + count);
// the place where the new element is going to be inserted
value_type * const place = m_values + idx;
// unless we're inserting at the end, move following elements out of
// the way:
if ( after > 0 )
Ops::MemmoveForward(place + count, place, after);
// if the ctor called below throws an exception, we need to move all
// the elements back to their original positions in m_values
wxScopeGuard moveBack = wxMakeGuard(
Ops::MemmoveBackward, place, place + count, after);
if ( !after )
moveBack.Dismiss();
// use placement new to initialize new object in preallocated place in
// m_values and store 'v' in it:
for ( size_type i = 0; i < count; i++ )
::new(place + i) value_type(v);
// now that we did successfully add the new element, increment the size
// and disable moving the items back
moveBack.Dismiss();
m_size += count;
return begin() + idx;
}
iterator insert(iterator it, const value_type& v = value_type())
{
return insert(it, 1, v);
}
iterator erase(iterator it)
{
return erase(it, it + 1);
}
iterator erase(iterator first, iterator last)
{
if ( first == last )
return first;
wxASSERT( first < end() && last <= end() );
const size_type idx = first - begin();
const size_type count = last - first;
const size_type after = end() - last;
// erase elements by calling their destructors:
for ( iterator i = first; i < last; ++i )
i->~T();
// once that's done, move following elements over to the freed space:
if ( after > 0 )
{
Ops::MemmoveBackward(m_values + idx, m_values + idx + count, after);
}
m_size -= count;
return begin() + idx;
}
#if WXWIN_COMPATIBILITY_2_8
wxDEPRECATED( size_type erase(size_type n) );
#endif // WXWIN_COMPATIBILITY_2_8
private:
static const size_type ALLOC_INITIAL_SIZE = 16;
void Copy(const wxVector& vb)
{
reserve(vb.size());
for ( const_iterator i = vb.begin(); i != vb.end(); ++i )
push_back(*i);
}
private:
void Shrink(size_type n)
{
for ( size_type i = n; i < m_size; i++ )
m_values[i].~T();
m_size = n;
}
void Extend(size_type n, const value_type& v)
{
reserve(n);
for ( size_type i = m_size; i < n; i++ )
push_back(v);
}
void AssignFromValue(size_type p_size, const value_type& v)
{
clear();
reserve(p_size);
for ( size_t n = 0; n < p_size; n++ )
push_back(v);
}
template <typename InputIterator>
void AssignDispatch(InputIterator first, InputIterator last,
wxPrivate::IsIntType)
{
AssignFromValue(static_cast<size_type>(first),
static_cast<const value_type&>(last));
}
template <typename InputIterator>
void AssignDispatch(InputIterator first, InputIterator last,
wxPrivate::IsNotIntType)
{
clear();
// Notice that it would be nice to call reserve() here but we can't do
// it for arbitrary input iterators, we should have a dispatch on
// iterator type and call it if possible.
for ( InputIterator it = first; it != last; ++it )
push_back(*it);
}
size_type m_size,
m_capacity;
value_type *m_values;
};
#if WXWIN_COMPATIBILITY_2_8
template<typename T>
inline typename wxVector<T>::size_type wxVector<T>::erase(size_type n)
{
erase(begin() + n);
return n;
}
#endif // WXWIN_COMPATIBILITY_2_8
namespace wxPrivate
{
// This is a helper for the wxVectorSort function, and should not be used
// directly in user's code.
template<typename T>
struct wxVectorComparator
{
static int
Compare(const void* pitem1, const void* pitem2, const void* )
{
const T& item1 = *reinterpret_cast<const T*>(pitem1);
const T& item2 = *reinterpret_cast<const T*>(pitem2);
if (item1 < item2)
return -1;
else if (item2 < item1)
return 1;
else
return 0;
}
};
} // namespace wxPrivate
template<typename T>
void wxVectorSort(wxVector<T>& v)
{
wxQsort(v.begin(), v.size(), sizeof(T),
wxPrivate::wxVectorComparator<T>::Compare, NULL);
}
#endif // wxUSE_STD_CONTAINERS/!wxUSE_STD_CONTAINERS
// Define vector::shrink_to_fit() equivalent which can be always used, even
// when using pre-C++11 std::vector.
template<typename T>
inline void wxShrinkToFit(wxVector<T>& v)
{
#if !wxUSE_STD_CONTAINERS || __cplusplus >= 201103L || wxCHECK_VISUALC_VERSION(10)
v.shrink_to_fit();
#else
wxVector<T> tmp(v);
v.swap(tmp);
#endif
}
#if WXWIN_COMPATIBILITY_2_8
#define WX_DECLARE_VECTORBASE(obj, cls) typedef wxVector<obj> cls
#define _WX_DECLARE_VECTOR(obj, cls, exp) WX_DECLARE_VECTORBASE(obj, cls)
#define WX_DECLARE_VECTOR(obj, cls) WX_DECLARE_VECTORBASE(obj, cls)
#endif // WXWIN_COMPATIBILITY_2_8
#endif // _WX_VECTOR_H_
| h |
rticonnextdds-usecases | data/projects/rticonnextdds-usecases/VehicleTracking/ExampleCode/thirdparty/wxWidgets-3.1.2/Linux/include/wx/scopeguard.h | ///////////////////////////////////////////////////////////////////////////////
// Name: wx/scopeguard.h
// Purpose: declares wxScopeGuard and related macros
// Author: Vadim Zeitlin
// Modified by:
// Created: 03.07.2003
// Copyright: (c) 2003 Vadim Zeitlin <[email protected]>
// Licence: wxWindows licence
///////////////////////////////////////////////////////////////////////////////
/*
Acknowledgements: this header is heavily based on (well, almost the exact
copy of) ScopeGuard.h by Andrei Alexandrescu and Petru Marginean published
in December 2000 issue of C/C++ Users Journal.
http://www.cuj.com/documents/cujcexp1812alexandr/
*/
#ifndef _WX_SCOPEGUARD_H_
#define _WX_SCOPEGUARD_H_
#include "wx/defs.h"
#include "wx/except.h"
// ----------------------------------------------------------------------------
// helpers
// ----------------------------------------------------------------------------
namespace wxPrivate
{
// in the original implementation this was a member template function of
// ScopeGuardImplBase but gcc 2.8 which is still used for OS/2 doesn't
// support member templates and so we must make it global
template <class ScopeGuardImpl>
void OnScopeExit(ScopeGuardImpl& guard)
{
if ( !guard.WasDismissed() )
{
// we're called from ScopeGuardImpl dtor and so we must not throw
wxTRY
{
guard.Execute();
}
wxCATCH_ALL(;) // do nothing, just eat the exception
}
}
// just to avoid the warning about unused variables
template <class T>
void Use(const T& WXUNUSED(t))
{
}
} // namespace wxPrivate
#define wxPrivateOnScopeExit(n) wxPrivate::OnScopeExit(n)
#define wxPrivateUse(n) wxPrivate::Use(n)
// ============================================================================
// wxScopeGuard for functions and functors
// ============================================================================
// ----------------------------------------------------------------------------
// wxScopeGuardImplBase: used by wxScopeGuardImpl[0..N] below
// ----------------------------------------------------------------------------
class wxScopeGuardImplBase
{
public:
wxScopeGuardImplBase() : m_wasDismissed(false) { }
wxScopeGuardImplBase(const wxScopeGuardImplBase& other)
: m_wasDismissed(other.m_wasDismissed)
{
other.Dismiss();
}
void Dismiss() const { m_wasDismissed = true; }
// for OnScopeExit() only (we can't make it friend, unfortunately)!
bool WasDismissed() const { return m_wasDismissed; }
protected:
~wxScopeGuardImplBase() { }
// must be mutable for copy ctor to work
mutable bool m_wasDismissed;
private:
wxScopeGuardImplBase& operator=(const wxScopeGuardImplBase&);
};
// wxScopeGuard is just a reference, see the explanation in CUJ article
typedef const wxScopeGuardImplBase& wxScopeGuard;
// ----------------------------------------------------------------------------
// wxScopeGuardImpl0: scope guard for actions without parameters
// ----------------------------------------------------------------------------
template <class F>
class wxScopeGuardImpl0 : public wxScopeGuardImplBase
{
public:
static wxScopeGuardImpl0<F> MakeGuard(F fun)
{
return wxScopeGuardImpl0<F>(fun);
}
~wxScopeGuardImpl0() { wxPrivateOnScopeExit(*this); }
void Execute() { m_fun(); }
protected:
wxScopeGuardImpl0(F fun) : m_fun(fun) { }
F m_fun;
wxScopeGuardImpl0& operator=(const wxScopeGuardImpl0&);
};
template <class F>
inline wxScopeGuardImpl0<F> wxMakeGuard(F fun)
{
return wxScopeGuardImpl0<F>::MakeGuard(fun);
}
// ----------------------------------------------------------------------------
// wxScopeGuardImpl1: scope guard for actions with 1 parameter
// ----------------------------------------------------------------------------
template <class F, class P1>
class wxScopeGuardImpl1 : public wxScopeGuardImplBase
{
public:
static wxScopeGuardImpl1<F, P1> MakeGuard(F fun, P1 p1)
{
return wxScopeGuardImpl1<F, P1>(fun, p1);
}
~wxScopeGuardImpl1() { wxPrivateOnScopeExit(* this); }
void Execute() { m_fun(m_p1); }
protected:
wxScopeGuardImpl1(F fun, P1 p1) : m_fun(fun), m_p1(p1) { }
F m_fun;
const P1 m_p1;
wxScopeGuardImpl1& operator=(const wxScopeGuardImpl1&);
};
template <class F, class P1>
inline wxScopeGuardImpl1<F, P1> wxMakeGuard(F fun, P1 p1)
{
return wxScopeGuardImpl1<F, P1>::MakeGuard(fun, p1);
}
// ----------------------------------------------------------------------------
// wxScopeGuardImpl2: scope guard for actions with 2 parameters
// ----------------------------------------------------------------------------
template <class F, class P1, class P2>
class wxScopeGuardImpl2 : public wxScopeGuardImplBase
{
public:
static wxScopeGuardImpl2<F, P1, P2> MakeGuard(F fun, P1 p1, P2 p2)
{
return wxScopeGuardImpl2<F, P1, P2>(fun, p1, p2);
}
~wxScopeGuardImpl2() { wxPrivateOnScopeExit(*this); }
void Execute() { m_fun(m_p1, m_p2); }
protected:
wxScopeGuardImpl2(F fun, P1 p1, P2 p2) : m_fun(fun), m_p1(p1), m_p2(p2) { }
F m_fun;
const P1 m_p1;
const P2 m_p2;
wxScopeGuardImpl2& operator=(const wxScopeGuardImpl2&);
};
template <class F, class P1, class P2>
inline wxScopeGuardImpl2<F, P1, P2> wxMakeGuard(F fun, P1 p1, P2 p2)
{
return wxScopeGuardImpl2<F, P1, P2>::MakeGuard(fun, p1, p2);
}
// ----------------------------------------------------------------------------
// wxScopeGuardImpl3: scope guard for actions with 3 parameters
// ----------------------------------------------------------------------------
template <class F, class P1, class P2, class P3>
class wxScopeGuardImpl3 : public wxScopeGuardImplBase
{
public:
static wxScopeGuardImpl3<F, P1, P2, P3> MakeGuard(F fun, P1 p1, P2 p2, P3 p3)
{
return wxScopeGuardImpl3<F, P1, P2, P3>(fun, p1, p2, p3);
}
~wxScopeGuardImpl3() { wxPrivateOnScopeExit(*this); }
void Execute() { m_fun(m_p1, m_p2, m_p3); }
protected:
wxScopeGuardImpl3(F fun, P1 p1, P2 p2, P3 p3)
: m_fun(fun), m_p1(p1), m_p2(p2), m_p3(p3) { }
F m_fun;
const P1 m_p1;
const P2 m_p2;
const P3 m_p3;
wxScopeGuardImpl3& operator=(const wxScopeGuardImpl3&);
};
template <class F, class P1, class P2, class P3>
inline wxScopeGuardImpl3<F, P1, P2, P3> wxMakeGuard(F fun, P1 p1, P2 p2, P3 p3)
{
return wxScopeGuardImpl3<F, P1, P2, P3>::MakeGuard(fun, p1, p2, p3);
}
// ============================================================================
// wxScopeGuards for object methods
// ============================================================================
// ----------------------------------------------------------------------------
// wxObjScopeGuardImpl0
// ----------------------------------------------------------------------------
template <class Obj, class MemFun>
class wxObjScopeGuardImpl0 : public wxScopeGuardImplBase
{
public:
static wxObjScopeGuardImpl0<Obj, MemFun>
MakeObjGuard(Obj& obj, MemFun memFun)
{
return wxObjScopeGuardImpl0<Obj, MemFun>(obj, memFun);
}
~wxObjScopeGuardImpl0() { wxPrivateOnScopeExit(*this); }
void Execute() { (m_obj.*m_memfun)(); }
protected:
wxObjScopeGuardImpl0(Obj& obj, MemFun memFun)
: m_obj(obj), m_memfun(memFun) { }
Obj& m_obj;
MemFun m_memfun;
};
template <class Obj, class MemFun>
inline wxObjScopeGuardImpl0<Obj, MemFun> wxMakeObjGuard(Obj& obj, MemFun memFun)
{
return wxObjScopeGuardImpl0<Obj, MemFun>::MakeObjGuard(obj, memFun);
}
template <class Obj, class MemFun, class P1>
class wxObjScopeGuardImpl1 : public wxScopeGuardImplBase
{
public:
static wxObjScopeGuardImpl1<Obj, MemFun, P1>
MakeObjGuard(Obj& obj, MemFun memFun, P1 p1)
{
return wxObjScopeGuardImpl1<Obj, MemFun, P1>(obj, memFun, p1);
}
~wxObjScopeGuardImpl1() { wxPrivateOnScopeExit(*this); }
void Execute() { (m_obj.*m_memfun)(m_p1); }
protected:
wxObjScopeGuardImpl1(Obj& obj, MemFun memFun, P1 p1)
: m_obj(obj), m_memfun(memFun), m_p1(p1) { }
Obj& m_obj;
MemFun m_memfun;
const P1 m_p1;
};
template <class Obj, class MemFun, class P1>
inline wxObjScopeGuardImpl1<Obj, MemFun, P1>
wxMakeObjGuard(Obj& obj, MemFun memFun, P1 p1)
{
return wxObjScopeGuardImpl1<Obj, MemFun, P1>::MakeObjGuard(obj, memFun, p1);
}
template <class Obj, class MemFun, class P1, class P2>
class wxObjScopeGuardImpl2 : public wxScopeGuardImplBase
{
public:
static wxObjScopeGuardImpl2<Obj, MemFun, P1, P2>
MakeObjGuard(Obj& obj, MemFun memFun, P1 p1, P2 p2)
{
return wxObjScopeGuardImpl2<Obj, MemFun, P1, P2>(obj, memFun, p1, p2);
}
~wxObjScopeGuardImpl2() { wxPrivateOnScopeExit(*this); }
void Execute() { (m_obj.*m_memfun)(m_p1, m_p2); }
protected:
wxObjScopeGuardImpl2(Obj& obj, MemFun memFun, P1 p1, P2 p2)
: m_obj(obj), m_memfun(memFun), m_p1(p1), m_p2(p2) { }
Obj& m_obj;
MemFun m_memfun;
const P1 m_p1;
const P2 m_p2;
};
template <class Obj, class MemFun, class P1, class P2>
inline wxObjScopeGuardImpl2<Obj, MemFun, P1, P2>
wxMakeObjGuard(Obj& obj, MemFun memFun, P1 p1, P2 p2)
{
return wxObjScopeGuardImpl2<Obj, MemFun, P1, P2>::
MakeObjGuard(obj, memFun, p1, p2);
}
template <class Obj, class MemFun, class P1, class P2, class P3>
class wxObjScopeGuardImpl3 : public wxScopeGuardImplBase
{
public:
static wxObjScopeGuardImpl3<Obj, MemFun, P1, P2, P3>
MakeObjGuard(Obj& obj, MemFun memFun, P1 p1, P2 p2, P3 p3)
{
return wxObjScopeGuardImpl3<Obj, MemFun, P1, P2, P3>(obj, memFun, p1, p2, p3);
}
~wxObjScopeGuardImpl3() { wxPrivateOnScopeExit(*this); }
void Execute() { (m_obj.*m_memfun)(m_p1, m_p2, m_p3); }
protected:
wxObjScopeGuardImpl3(Obj& obj, MemFun memFun, P1 p1, P2 p2, P3 p3)
: m_obj(obj), m_memfun(memFun), m_p1(p1), m_p2(p2), m_p3(p3) { }
Obj& m_obj;
MemFun m_memfun;
const P1 m_p1;
const P2 m_p2;
const P3 m_p3;
};
template <class Obj, class MemFun, class P1, class P2, class P3>
inline wxObjScopeGuardImpl3<Obj, MemFun, P1, P2, P3>
wxMakeObjGuard(Obj& obj, MemFun memFun, P1 p1, P2 p2, P3 p3)
{
return wxObjScopeGuardImpl3<Obj, MemFun, P1, P2, P3>::
MakeObjGuard(obj, memFun, p1, p2, p3);
}
// ----------------------------------------------------------------------------
// wxVariableSetter: use the same technique as for wxScopeGuard to allow
// setting a variable to some value on block exit
// ----------------------------------------------------------------------------
namespace wxPrivate
{
// empty class just to be able to define a reference to it
class VariableSetterBase : public wxScopeGuardImplBase { };
typedef const VariableSetterBase& VariableSetter;
template <typename T, typename U>
class VariableSetterImpl : public VariableSetterBase
{
public:
VariableSetterImpl(T& var, U value)
: m_var(var),
m_value(value)
{
}
~VariableSetterImpl() { wxPrivateOnScopeExit(*this); }
void Execute() { m_var = m_value; }
private:
T& m_var;
const U m_value;
// suppress the warning about assignment operator not being generated
VariableSetterImpl<T, U>& operator=(const VariableSetterImpl<T, U>&);
};
template <typename T>
class VariableNullerImpl : public VariableSetterBase
{
public:
VariableNullerImpl(T& var)
: m_var(var)
{
}
~VariableNullerImpl() { wxPrivateOnScopeExit(*this); }
void Execute() { m_var = NULL; }
private:
T& m_var;
VariableNullerImpl<T>& operator=(const VariableNullerImpl<T>&);
};
} // namespace wxPrivate
template <typename T, typename U>
inline
wxPrivate::VariableSetterImpl<T, U> wxMakeVarSetter(T& var, U value)
{
return wxPrivate::VariableSetterImpl<T, U>(var, value);
}
// calling wxMakeVarSetter(ptr, NULL) doesn't work because U is deduced to be
// "int" and subsequent assignment of "U" to "T *" fails, so provide a special
// function for this special case
template <typename T>
inline
wxPrivate::VariableNullerImpl<T> wxMakeVarNuller(T& var)
{
return wxPrivate::VariableNullerImpl<T>(var);
}
// ============================================================================
// macros for declaring unnamed scoped guards (which can't be dismissed)
// ============================================================================
// NB: the original code has a single (and much nicer) ON_BLOCK_EXIT macro
// but this results in compiler warnings about unused variables and I
// didn't find a way to work around this other than by having different
// macros with different names or using a less natural syntax for passing
// the arguments (e.g. as Boost preprocessor sequences, which would mean
// having to write wxON_BLOCK_EXIT(fwrite, (buf)(size)(n)(fp)) instead of
// wxON_BLOCK_EXIT4(fwrite, buf, size, n, fp)).
#define wxGuardName wxMAKE_UNIQUE_NAME(wxScopeGuard)
#define wxON_BLOCK_EXIT0_IMPL(n, f) \
wxScopeGuard n = wxMakeGuard(f); \
wxPrivateUse(n)
#define wxON_BLOCK_EXIT0(f) \
wxON_BLOCK_EXIT0_IMPL(wxGuardName, f)
#define wxON_BLOCK_EXIT_OBJ0_IMPL(n, o, m) \
wxScopeGuard n = wxMakeObjGuard(o, m); \
wxPrivateUse(n)
#define wxON_BLOCK_EXIT_OBJ0(o, m) \
wxON_BLOCK_EXIT_OBJ0_IMPL(wxGuardName, o, &m)
#define wxON_BLOCK_EXIT_THIS0(m) \
wxON_BLOCK_EXIT_OBJ0(*this, m)
#define wxON_BLOCK_EXIT1_IMPL(n, f, p1) \
wxScopeGuard n = wxMakeGuard(f, p1); \
wxPrivateUse(n)
#define wxON_BLOCK_EXIT1(f, p1) \
wxON_BLOCK_EXIT1_IMPL(wxGuardName, f, p1)
#define wxON_BLOCK_EXIT_OBJ1_IMPL(n, o, m, p1) \
wxScopeGuard n = wxMakeObjGuard(o, m, p1); \
wxPrivateUse(n)
#define wxON_BLOCK_EXIT_OBJ1(o, m, p1) \
wxON_BLOCK_EXIT_OBJ1_IMPL(wxGuardName, o, &m, p1)
#define wxON_BLOCK_EXIT_THIS1(m, p1) \
wxON_BLOCK_EXIT_OBJ1(*this, m, p1)
#define wxON_BLOCK_EXIT2_IMPL(n, f, p1, p2) \
wxScopeGuard n = wxMakeGuard(f, p1, p2); \
wxPrivateUse(n)
#define wxON_BLOCK_EXIT2(f, p1, p2) \
wxON_BLOCK_EXIT2_IMPL(wxGuardName, f, p1, p2)
#define wxON_BLOCK_EXIT_OBJ2_IMPL(n, o, m, p1, p2) \
wxScopeGuard n = wxMakeObjGuard(o, m, p1, p2); \
wxPrivateUse(n)
#define wxON_BLOCK_EXIT_OBJ2(o, m, p1, p2) \
wxON_BLOCK_EXIT_OBJ2_IMPL(wxGuardName, o, &m, p1, p2)
#define wxON_BLOCK_EXIT_THIS2(m, p1, p2) \
wxON_BLOCK_EXIT_OBJ2(*this, m, p1, p2)
#define wxON_BLOCK_EXIT3_IMPL(n, f, p1, p2, p3) \
wxScopeGuard n = wxMakeGuard(f, p1, p2, p3); \
wxPrivateUse(n)
#define wxON_BLOCK_EXIT3(f, p1, p2, p3) \
wxON_BLOCK_EXIT3_IMPL(wxGuardName, f, p1, p2, p3)
#define wxON_BLOCK_EXIT_OBJ3_IMPL(n, o, m, p1, p2, p3) \
wxScopeGuard n = wxMakeObjGuard(o, m, p1, p2, p3); \
wxPrivateUse(n)
#define wxON_BLOCK_EXIT_OBJ3(o, m, p1, p2, p3) \
wxON_BLOCK_EXIT_OBJ3_IMPL(wxGuardName, o, &m, p1, p2, p3)
#define wxON_BLOCK_EXIT_THIS3(m, p1, p2, p3) \
wxON_BLOCK_EXIT_OBJ3(*this, m, p1, p2, p3)
#define wxSetterName wxMAKE_UNIQUE_NAME(wxVarSetter)
#define wxON_BLOCK_EXIT_SET_IMPL(n, var, value) \
wxPrivate::VariableSetter n = wxMakeVarSetter(var, value); \
wxPrivateUse(n)
#define wxON_BLOCK_EXIT_SET(var, value) \
wxON_BLOCK_EXIT_SET_IMPL(wxSetterName, var, value)
#define wxON_BLOCK_EXIT_NULL_IMPL(n, var) \
wxPrivate::VariableSetter n = wxMakeVarNuller(var); \
wxPrivateUse(n)
#define wxON_BLOCK_EXIT_NULL(ptr) \
wxON_BLOCK_EXIT_NULL_IMPL(wxSetterName, ptr)
#endif // _WX_SCOPEGUARD_H_
| h |
rticonnextdds-usecases | data/projects/rticonnextdds-usecases/VehicleTracking/ExampleCode/thirdparty/wxWidgets-3.1.2/Linux/include/wx/icon.h | /////////////////////////////////////////////////////////////////////////////
// Name: wx/icon.h
// Purpose: wxIcon base header
// Author: Julian Smart
// Modified by:
// Created:
// Copyright: (c) Julian Smart
// Licence: wxWindows licence
/////////////////////////////////////////////////////////////////////////////
#ifndef _WX_ICON_H_BASE_
#define _WX_ICON_H_BASE_
#include "wx/iconloc.h"
// a more readable way to tell
#define wxICON_SCREEN_DEPTH (-1)
// the wxICON_DEFAULT_TYPE (the wxIcon equivalent of wxBITMAP_DEFAULT_TYPE)
// constant defines the default argument value for wxIcon ctor and wxIcon::LoadFile()
// functions.
#if defined(__WXMSW__)
#define wxICON_DEFAULT_TYPE wxBITMAP_TYPE_ICO_RESOURCE
#include "wx/msw/icon.h"
#elif defined(__WXMOTIF__)
#define wxICON_DEFAULT_TYPE wxBITMAP_TYPE_XPM
#include "wx/motif/icon.h"
#elif defined(__WXGTK20__)
#ifdef __WINDOWS__
#define wxICON_DEFAULT_TYPE wxBITMAP_TYPE_ICO_RESOURCE
#else
#define wxICON_DEFAULT_TYPE wxBITMAP_TYPE_XPM
#endif
#include "wx/generic/icon.h"
#elif defined(__WXGTK__)
#define wxICON_DEFAULT_TYPE wxBITMAP_TYPE_XPM
#include "wx/generic/icon.h"
#elif defined(__WXX11__)
#define wxICON_DEFAULT_TYPE wxBITMAP_TYPE_XPM
#include "wx/generic/icon.h"
#elif defined(__WXDFB__)
#define wxICON_DEFAULT_TYPE wxBITMAP_TYPE_XPM
#include "wx/generic/icon.h"
#elif defined(__WXMAC__)
#if wxOSX_USE_COCOA_OR_CARBON
#define wxICON_DEFAULT_TYPE wxBITMAP_TYPE_ICON_RESOURCE
#include "wx/generic/icon.h"
#else
// iOS and others
#define wxICON_DEFAULT_TYPE wxBITMAP_TYPE_PNG_RESOURCE
#include "wx/generic/icon.h"
#endif
#elif defined(__WXQT__)
#define wxICON_DEFAULT_TYPE wxBITMAP_TYPE_XPM
#include "wx/generic/icon.h"
#endif
//-----------------------------------------------------------------------------
// wxVariant support
//-----------------------------------------------------------------------------
#if wxUSE_VARIANT
#include "wx/variant.h"
DECLARE_VARIANT_OBJECT_EXPORTED(wxIcon,WXDLLIMPEXP_CORE)
#endif
#endif
// _WX_ICON_H_BASE_
| h |
rticonnextdds-usecases | data/projects/rticonnextdds-usecases/VehicleTracking/ExampleCode/thirdparty/wxWidgets-3.1.2/Linux/include/wx/windowptr.h | /////////////////////////////////////////////////////////////////////////////
// Name: wx/windowptr.h
// Purpose: smart pointer for holding wxWindow instances
// Author: Vaclav Slavik
// Created: 2013-09-01
// Copyright: (c) 2013 Vaclav Slavik
// Licence: wxWindows licence
/////////////////////////////////////////////////////////////////////////////
#ifndef _WX_WINDOWPTR_H_
#define _WX_WINDOWPTR_H_
#include "wx/sharedptr.h"
// ----------------------------------------------------------------------------
// wxWindowPtr: A smart pointer with correct wxWindow destruction.
// ----------------------------------------------------------------------------
namespace wxPrivate
{
struct wxWindowDeleter
{
void operator()(wxWindow *win)
{
win->Destroy();
}
};
} // namespace wxPrivate
template<typename T>
class wxWindowPtr : public wxSharedPtr<T>
{
public:
typedef T element_type;
explicit wxWindowPtr(element_type* win)
: wxSharedPtr<T>(win, wxPrivate::wxWindowDeleter())
{
}
wxWindowPtr() {}
wxWindowPtr(const wxWindowPtr& tocopy) : wxSharedPtr<T>(tocopy) {}
wxWindowPtr& operator=(const wxWindowPtr& tocopy)
{
wxSharedPtr<T>::operator=(tocopy);
return *this;
}
wxWindowPtr& operator=(element_type* win)
{
return operator=(wxWindowPtr(win));
}
void reset(T* ptr = NULL)
{
wxSharedPtr<T>::reset(ptr, wxPrivate::wxWindowDeleter());
}
};
#endif // _WX_WINDOWPTR_H_
| h |
rticonnextdds-usecases | data/projects/rticonnextdds-usecases/VehicleTracking/ExampleCode/thirdparty/wxWidgets-3.1.2/Linux/include/wx/rtti.h | /////////////////////////////////////////////////////////////////////////////
// Name: wx/rtti.h
// Purpose: old RTTI macros (use XTI when possible instead)
// 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_RTTIH__
#define _WX_RTTIH__
#if !wxUSE_EXTENDED_RTTI // XTI system is meant to replace these macros
// ----------------------------------------------------------------------------
// headers
// ----------------------------------------------------------------------------
#include "wx/memory.h"
// ----------------------------------------------------------------------------
// forward declarations
// ----------------------------------------------------------------------------
class WXDLLIMPEXP_FWD_BASE wxObject;
class WXDLLIMPEXP_FWD_BASE wxString;
class WXDLLIMPEXP_FWD_BASE wxClassInfo;
class WXDLLIMPEXP_FWD_BASE wxHashTable;
class WXDLLIMPEXP_FWD_BASE wxObject;
class WXDLLIMPEXP_FWD_BASE wxPluginLibrary;
class WXDLLIMPEXP_FWD_BASE wxHashTable_Node;
// ----------------------------------------------------------------------------
// wxClassInfo
// ----------------------------------------------------------------------------
typedef wxObject *(*wxObjectConstructorFn)(void);
class WXDLLIMPEXP_BASE wxClassInfo
{
friend class WXDLLIMPEXP_FWD_BASE wxObject;
friend WXDLLIMPEXP_BASE wxObject *wxCreateDynamicObject(const wxString& name);
public:
wxClassInfo( const wxChar *className,
const wxClassInfo *baseInfo1,
const wxClassInfo *baseInfo2,
int size,
wxObjectConstructorFn ctor )
: m_className(className)
, m_objectSize(size)
, m_objectConstructor(ctor)
, m_baseInfo1(baseInfo1)
, m_baseInfo2(baseInfo2)
, m_next(sm_first)
{
sm_first = this;
Register();
}
~wxClassInfo();
wxObject *CreateObject() const
{ return m_objectConstructor ? (*m_objectConstructor)() : 0; }
bool IsDynamic() const { return (NULL != m_objectConstructor); }
const wxChar *GetClassName() const { return m_className; }
const wxChar *GetBaseClassName1() const
{ return m_baseInfo1 ? m_baseInfo1->GetClassName() : NULL; }
const wxChar *GetBaseClassName2() const
{ return m_baseInfo2 ? m_baseInfo2->GetClassName() : NULL; }
const wxClassInfo *GetBaseClass1() const { return m_baseInfo1; }
const wxClassInfo *GetBaseClass2() const { return m_baseInfo2; }
int GetSize() const { return m_objectSize; }
wxObjectConstructorFn GetConstructor() const
{ return m_objectConstructor; }
static const wxClassInfo *GetFirst() { return sm_first; }
const wxClassInfo *GetNext() const { return m_next; }
static wxClassInfo *FindClass(const wxString& className);
// Climb upwards through inheritance hierarchy.
// Dual inheritance is catered for.
bool IsKindOf(const wxClassInfo *info) const
{
if ( info == this )
return true;
if ( m_baseInfo1 )
{
if ( m_baseInfo1->IsKindOf(info) )
return true;
}
if ( m_baseInfo2 )
{
if ( m_baseInfo2->IsKindOf(info) )
return true;
}
return false;
}
wxDECLARE_CLASS_INFO_ITERATORS();
private:
const wxChar *m_className;
int m_objectSize;
wxObjectConstructorFn m_objectConstructor;
// Pointers to base wxClassInfos
const wxClassInfo *m_baseInfo1;
const wxClassInfo *m_baseInfo2;
// class info object live in a linked list:
// pointers to its head and the next element in it
static wxClassInfo *sm_first;
wxClassInfo *m_next;
static wxHashTable *sm_classTable;
protected:
// registers the class
void Register();
void Unregister();
wxDECLARE_NO_COPY_CLASS(wxClassInfo);
};
WXDLLIMPEXP_BASE wxObject *wxCreateDynamicObject(const wxString& name);
// ----------------------------------------------------------------------------
// Dynamic class macros
// ----------------------------------------------------------------------------
#define wxDECLARE_ABSTRACT_CLASS(name) \
public: \
static wxClassInfo ms_classInfo; \
wxCLANG_WARNING_SUPPRESS(inconsistent-missing-override) \
virtual wxClassInfo *GetClassInfo() const \
wxCLANG_WARNING_RESTORE(inconsistent-missing-override)
#define wxDECLARE_DYNAMIC_CLASS_NO_ASSIGN(name) \
wxDECLARE_NO_ASSIGN_CLASS(name); \
wxDECLARE_DYNAMIC_CLASS(name)
#define wxDECLARE_DYNAMIC_CLASS_NO_COPY(name) \
wxDECLARE_NO_COPY_CLASS(name); \
wxDECLARE_DYNAMIC_CLASS(name)
#define wxDECLARE_DYNAMIC_CLASS(name) \
wxDECLARE_ABSTRACT_CLASS(name); \
static wxObject* wxCreateObject()
#define wxDECLARE_CLASS(name) \
wxDECLARE_ABSTRACT_CLASS(name)
// common part of the macros below
#define wxIMPLEMENT_CLASS_COMMON(name, basename, baseclsinfo2, func) \
wxClassInfo name::ms_classInfo(wxT(#name), \
&basename::ms_classInfo, \
baseclsinfo2, \
(int) sizeof(name), \
func); \
\
wxClassInfo *name::GetClassInfo() const \
{ return &name::ms_classInfo; }
#define wxIMPLEMENT_CLASS_COMMON1(name, basename, func) \
wxIMPLEMENT_CLASS_COMMON(name, basename, NULL, func)
#define wxIMPLEMENT_CLASS_COMMON2(name, basename1, basename2, func) \
wxIMPLEMENT_CLASS_COMMON(name, basename1, &basename2::ms_classInfo, func)
// -----------------------------------
// for concrete classes
// -----------------------------------
// Single inheritance with one base class
#define wxIMPLEMENT_DYNAMIC_CLASS(name, basename) \
wxIMPLEMENT_CLASS_COMMON1(name, basename, name::wxCreateObject) \
wxObject* name::wxCreateObject() \
{ return new name; }
// Multiple inheritance with two base classes
#define wxIMPLEMENT_DYNAMIC_CLASS2(name, basename1, basename2) \
wxIMPLEMENT_CLASS_COMMON2(name, basename1, basename2, \
name::wxCreateObject) \
wxObject* name::wxCreateObject() \
{ return new name; }
// -----------------------------------
// for abstract classes
// -----------------------------------
// Single inheritance with one base class
#define wxIMPLEMENT_ABSTRACT_CLASS(name, basename) \
wxIMPLEMENT_CLASS_COMMON1(name, basename, NULL)
// Multiple inheritance with two base classes
#define wxIMPLEMENT_ABSTRACT_CLASS2(name, basename1, basename2) \
wxIMPLEMENT_CLASS_COMMON2(name, basename1, basename2, NULL)
// -----------------------------------
// XTI-compatible macros
// -----------------------------------
#include "wx/flags.h"
// these macros only do something when wxUSE_EXTENDED_RTTI=1
// (and in that case they are defined by xti.h); however to avoid
// to be forced to wrap these macros (in user's source files) with
//
// #if wxUSE_EXTENDED_RTTI
// ...
// #endif
//
// blocks, we define them here as empty.
#define wxEMPTY_PARAMETER_VALUE /**/
#define wxBEGIN_ENUM( e ) wxEMPTY_PARAMETER_VALUE
#define wxENUM_MEMBER( v ) wxEMPTY_PARAMETER_VALUE
#define wxEND_ENUM( e ) wxEMPTY_PARAMETER_VALUE
#define wxIMPLEMENT_SET_STREAMING(SetName,e) wxEMPTY_PARAMETER_VALUE
#define wxBEGIN_FLAGS( e ) wxEMPTY_PARAMETER_VALUE
#define wxFLAGS_MEMBER( v ) wxEMPTY_PARAMETER_VALUE
#define wxEND_FLAGS( e ) wxEMPTY_PARAMETER_VALUE
#define wxCOLLECTION_TYPE_INFO( element, collection ) wxEMPTY_PARAMETER_VALUE
#define wxHANDLER(name,eventClassType) wxEMPTY_PARAMETER_VALUE
#define wxBEGIN_HANDLERS_TABLE(theClass) wxEMPTY_PARAMETER_VALUE
#define wxEND_HANDLERS_TABLE() wxEMPTY_PARAMETER_VALUE
#define wxIMPLEMENT_DYNAMIC_CLASS_XTI( name, basename, unit ) \
wxIMPLEMENT_DYNAMIC_CLASS( name, basename )
#define wxIMPLEMENT_DYNAMIC_CLASS_XTI_CALLBACK( name, basename, unit, callback ) \
wxIMPLEMENT_DYNAMIC_CLASS( name, basename )
#define wxIMPLEMENT_DYNAMIC_CLASS_WITH_COPY_XTI( name, basename, unit ) \
wxIMPLEMENT_DYNAMIC_CLASS( name, basename)
#define wxIMPLEMENT_DYNAMIC_CLASS_WITH_COPY_AND_STREAMERS_XTI( name, basename, \
unit, toString, \
fromString ) wxEMPTY_PARAMETER_VALUE
#define wxIMPLEMENT_DYNAMIC_CLASS_NO_WXOBJECT_NO_BASE_XTI( name, unit ) wxEMPTY_PARAMETER_VALUE
#define wxIMPLEMENT_DYNAMIC_CLASS_NO_WXOBJECT_XTI( name, basename, unit ) wxEMPTY_PARAMETER_VALUE
#define wxIMPLEMENT_DYNAMIC_CLASS2_XTI( name, basename, basename2, unit) wxIMPLEMENT_DYNAMIC_CLASS2( name, basename, basename2 )
#define wxCONSTRUCTOR_0(klass) \
wxEMPTY_PARAMETER_VALUE
#define wxCONSTRUCTOR_DUMMY(klass) \
wxEMPTY_PARAMETER_VALUE
#define wxDIRECT_CONSTRUCTOR_0(klass) \
wxEMPTY_PARAMETER_VALUE
#define wxCONSTRUCTOR_1(klass,t0,v0) \
wxEMPTY_PARAMETER_VALUE
#define wxDIRECT_CONSTRUCTOR_1(klass,t0,v0) \
wxEMPTY_PARAMETER_VALUE
#define wxCONSTRUCTOR_2(klass,t0,v0,t1,v1) \
wxEMPTY_PARAMETER_VALUE
#define wxDIRECT_CONSTRUCTOR_2(klass,t0,v0,t1,v1) \
wxEMPTY_PARAMETER_VALUE
#define wxCONSTRUCTOR_3(klass,t0,v0,t1,v1,t2,v2) \
wxEMPTY_PARAMETER_VALUE
#define wxDIRECT_CONSTRUCTOR_3(klass,t0,v0,t1,v1,t2,v2) \
wxEMPTY_PARAMETER_VALUE
#define wxCONSTRUCTOR_4(klass,t0,v0,t1,v1,t2,v2,t3,v3) \
wxEMPTY_PARAMETER_VALUE
#define wxDIRECT_CONSTRUCTOR_4(klass,t0,v0,t1,v1,t2,v2,t3,v3) \
wxEMPTY_PARAMETER_VALUE
#define wxCONSTRUCTOR_5(klass,t0,v0,t1,v1,t2,v2,t3,v3,t4,v4) \
wxEMPTY_PARAMETER_VALUE
#define wxDIRECT_CONSTRUCTOR_5(klass,t0,v0,t1,v1,t2,v2,t3,v3,t4,v4) \
wxEMPTY_PARAMETER_VALUE
#define wxCONSTRUCTOR_6(klass,t0,v0,t1,v1,t2,v2,t3,v3,t4,v4,t5,v5) \
wxEMPTY_PARAMETER_VALUE
#define wxDIRECT_CONSTRUCTOR_6(klass,t0,v0,t1,v1,t2,v2,t3,v3,t4,v4,t5,v5) \
wxEMPTY_PARAMETER_VALUE
#define wxCONSTRUCTOR_7(klass,t0,v0,t1,v1,t2,v2,t3,v3,t4,v4,t5,v5,t6,v6) \
wxEMPTY_PARAMETER_VALUE
#define wxDIRECT_CONSTRUCTOR_7(klass,t0,v0,t1,v1,t2,v2,t3,v3,t4,v4,t5,v5,t6,v6) \
wxEMPTY_PARAMETER_VALUE
#define wxCONSTRUCTOR_8(klass,t0,v0,t1,v1,t2,v2,t3,v3,t4,v4,t5,v5,t6,v6,t7,v7) \
wxEMPTY_PARAMETER_VALUE
#define wxDIRECT_CONSTRUCTOR_8(klass,t0,v0,t1,v1,t2,v2,t3,v3,t4,v4,t5,v5,t6,v6,t7,v7) \
wxEMPTY_PARAMETER_VALUE
#define wxSETTER( property, Klass, valueType, setterMethod ) wxEMPTY_PARAMETER_VALUE
#define wxGETTER( property, Klass, valueType, gettermethod ) wxEMPTY_PARAMETER_VALUE
#define wxADDER( property, Klass, valueType, addermethod ) wxEMPTY_PARAMETER_VALUE
#define wxCOLLECTION_GETTER( property, Klass, valueType, gettermethod ) wxEMPTY_PARAMETER_VALUE
#define wxBEGIN_PROPERTIES_TABLE(theClass) wxEMPTY_PARAMETER_VALUE
#define wxEND_PROPERTIES_TABLE() wxEMPTY_PARAMETER_VALUE
#define wxHIDE_PROPERTY( pname ) wxEMPTY_PARAMETER_VALUE
#define wxPROPERTY( pname, type, setter, getter, defaultValue, flags, help, group) \
wxEMPTY_PARAMETER_VALUE
#define wxPROPERTY_FLAGS( pname, flags, type, setter, getter,defaultValue, \
pflags, help, group) wxEMPTY_PARAMETER_VALUE
#define wxREADONLY_PROPERTY( pname, type, getter,defaultValue, flags, help, group) \
wxGETTER( pname, class_t, type, getter ) wxEMPTY_PARAMETER_VALUE
#define wxREADONLY_PROPERTY_FLAGS( pname, flags, type, getter,defaultValue, \
pflags, help, group) wxEMPTY_PARAMETER_VALUE
#define wxPROPERTY_COLLECTION( pname, colltype, addelemtype, adder, getter, \
flags, help, group ) wxEMPTY_PARAMETER_VALUE
#define wxREADONLY_PROPERTY_COLLECTION( pname, colltype, addelemtype, getter, \
flags, help, group) wxEMPTY_PARAMETER_VALUE
#define wxEVENT_PROPERTY( name, eventType, eventClass ) wxEMPTY_PARAMETER_VALUE
#define wxEVENT_RANGE_PROPERTY( name, eventType, lastEventType, eventClass ) wxEMPTY_PARAMETER_VALUE
#define wxIMPLEMENT_PROPERTY(name, type) wxEMPTY_PARAMETER_VALUE
#define wxEMPTY_HANDLERS_TABLE(name) wxEMPTY_PARAMETER_VALUE
#endif // !wxUSE_EXTENDED_RTTI
#endif // _WX_RTTIH__
| h |
rticonnextdds-usecases | data/projects/rticonnextdds-usecases/VehicleTracking/ExampleCode/thirdparty/wxWidgets-3.1.2/Linux/include/wx/range.h | /////////////////////////////////////////////////////////////////////////////
// Name: wx/range.h
// Purpose: Range Value Class
// Author: Stefan Csomor
// Modified by:
// Created: 2011-01-07
// Copyright: (c) 2011 Stefan Csomor
// Licence: wxWindows licence
/////////////////////////////////////////////////////////////////////////////
#ifndef _WX_RANGE_H_
#define _WX_RANGE_H_
#include "wx/defs.h"
class wxRange
{
public :
wxRange(): m_minVal(0), m_maxVal(0) {}
wxRange( int minVal, int maxVal) : m_minVal(minVal), m_maxVal(maxVal) {}
int GetMin() const { return m_minVal; }
int GetMax() const { return m_maxVal; }
private :
int m_minVal;
int m_maxVal;
};
#endif // _WX_RANGE_H_
| h |
rticonnextdds-usecases | data/projects/rticonnextdds-usecases/VehicleTracking/ExampleCode/thirdparty/wxWidgets-3.1.2/Linux/include/wx/flags.h | /////////////////////////////////////////////////////////////////////////////
// Name: wx/flags.h
// Purpose: a bitset suited for replacing the current style flags
// Author: Stefan Csomor
// Modified by:
// Created: 27/07/03
// Copyright: (c) 2003 Stefan Csomor
// Licence: wxWindows licence
/////////////////////////////////////////////////////////////////////////////
#ifndef _WX_SETH__
#define _WX_SETH__
// wxBitset should be applied to an enum, then this can be used like
// bitwise operators but keeps the type safety and information, the
// enums must be in a sequence , their value determines the bit position
// that they represent
// The api is made as close as possible to <bitset>
template <class T> class wxBitset
{
friend class wxEnumData ;
public:
// creates a wxBitset<> object with all flags initialized to 0
wxBitset() { m_data = 0; }
// created a wxBitset<> object initialized according to the bits of the
// integral value val
wxBitset(unsigned long val) { m_data = val ; }
// copies the content in the new wxBitset<> object from another one
wxBitset(const wxBitset &src) { m_data = src.m_data; }
// creates a wxBitset<> object that has the specific flag set
wxBitset(const T el) { m_data |= 1 << el; }
// returns the integral value that the bits of this object represent
unsigned long to_ulong() const { return m_data ; }
// assignment
wxBitset &operator =(const wxBitset &rhs)
{
m_data = rhs.m_data;
return *this;
}
// bitwise or operator, sets all bits that are in rhs and leaves
// the rest unchanged
wxBitset &operator |=(const wxBitset &rhs)
{
m_data |= rhs.m_data;
return *this;
}
// bitwsie exclusive-or operator, toggles the value of all bits
// that are set in bits and leaves all others unchanged
wxBitset &operator ^=(const wxBitset &rhs) // difference
{
m_data ^= rhs.m_data;
return *this;
}
// bitwise and operator, resets all bits that are not in rhs and leaves
// all others unchanged
wxBitset &operator &=(const wxBitset &rhs) // intersection
{
m_data &= rhs.m_data;
return *this;
}
// bitwise or operator, returns a new bitset that has all bits set that set are in
// bitset2 or in this bitset
wxBitset operator |(const wxBitset &bitset2) const // union
{
wxBitset<T> s;
s.m_data = m_data | bitset2.m_data;
return s;
}
// bitwise exclusive-or operator, returns a new bitset that has all bits set that are set either in
// bitset2 or in this bitset but not in both
wxBitset operator ^(const wxBitset &bitset2) const // difference
{
wxBitset<T> s;
s.m_data = m_data ^ bitset2.m_data;
return s;
}
// bitwise and operator, returns a new bitset that has all bits set that are set both in
// bitset2 and in this bitset
wxBitset operator &(const wxBitset &bitset2) const // intersection
{
wxBitset<T> s;
s.m_data = m_data & bitset2.m_data;
return s;
}
// sets appropriate the bit to true
wxBitset& set(const T el) //Add element
{
m_data |= 1 << el;
return *this;
}
// clears the appropriate flag to false
wxBitset& reset(const T el) //remove element
{
m_data &= ~(1 << el);
return *this;
}
// clear all flags
wxBitset& reset()
{
m_data = 0;
return *this;
}
// true if this flag is set
bool test(const T el) const
{
return (m_data & (1 << el)) ? true : false;
}
// true if no flag is set
bool none() const
{
return m_data == 0;
}
// true if any flag is set
bool any() const
{
return m_data != 0;
}
// true if both have the same flags
bool operator ==(const wxBitset &rhs) const
{
return m_data == rhs.m_data;
}
// true if both differ in their flags set
bool operator !=(const wxBitset &rhs) const
{
return !operator==(rhs);
}
bool operator[] (const T el) const { return test(el) ; }
private :
unsigned long m_data;
};
#if wxUSE_EXTENDED_RTTI
#define wxDEFINE_FLAGS( flags ) \
class WXDLLIMPEXP_BASE flags \
{\
public : \
flags(long data=0) :m_data(data) {} \
long m_data ;\
bool operator ==(const flags &rhs) const { return m_data == rhs.m_data; }\
} ;
#else
#define wxDEFINE_FLAGS( flags )
#endif
#if WXWIN_COMPATIBILITY_2_8
#define WX_DEFINE_FLAGS wxDEFINE_FLAGS
#endif
#endif
| h |
rticonnextdds-usecases | data/projects/rticonnextdds-usecases/VehicleTracking/ExampleCode/thirdparty/wxWidgets-3.1.2/Linux/include/wx/process.h | /////////////////////////////////////////////////////////////////////////////
// Name: wx/process.h
// Purpose: wxProcess class
// Author: Guilhem Lavaux
// Modified by: Vadim Zeitlin to check error codes, added Detach() method
// Created: 24/06/98
// Copyright: (c) 1998 Guilhem Lavaux
// Licence: wxWindows licence
/////////////////////////////////////////////////////////////////////////////
#ifndef _WX_PROCESSH__
#define _WX_PROCESSH__
#include "wx/event.h"
#if wxUSE_STREAMS
#include "wx/stream.h"
#endif
#include "wx/utils.h" // for wxSignal
// the wxProcess creation flags
enum
{
// no redirection
wxPROCESS_DEFAULT = 0,
// redirect the IO of the child process
wxPROCESS_REDIRECT = 1
};
// ----------------------------------------------------------------------------
// A wxProcess object should be passed to wxExecute - than its OnTerminate()
// function will be called when the process terminates.
// ----------------------------------------------------------------------------
class WXDLLIMPEXP_BASE wxProcess : public wxEvtHandler
{
public:
// kill the process with the given PID
static wxKillError Kill(int pid, wxSignal sig = wxSIGTERM, int flags = wxKILL_NOCHILDREN);
// test if the given process exists
static bool Exists(int pid);
// this function replaces the standard popen() one: it launches a process
// asynchronously and allows the caller to get the streams connected to its
// std{in|out|err}
//
// on error NULL is returned, in any case the process object will be
// deleted automatically when the process terminates and should *not* be
// deleted by the caller
static wxProcess *Open(const wxString& cmd, int flags = wxEXEC_ASYNC);
// ctors
wxProcess(wxEvtHandler *parent = NULL, int nId = wxID_ANY)
{ Init(parent, nId, wxPROCESS_DEFAULT); }
wxProcess(int flags) { Init(NULL, wxID_ANY, flags); }
virtual ~wxProcess();
// get the process ID of the process executed by Open()
long GetPid() const { return m_pid; }
// may be overridden to be notified about process termination
virtual void OnTerminate(int pid, int status);
// call this before passing the object to wxExecute() to redirect the
// launched process stdin/stdout, then use GetInputStream() and
// GetOutputStream() to get access to them
void Redirect() { m_redirect = true; }
bool IsRedirected() const { return m_redirect; }
// detach from the parent - should be called by the parent if it's deleted
// before the process it started terminates
void Detach();
// Activates a GUI process by bringing its (main) window to the front.
//
// Currently only implemented in wxMSW, simply returns false under the
// other platforms.
bool Activate() const;
#if wxUSE_STREAMS
// Pipe handling
wxInputStream *GetInputStream() const { return m_inputStream; }
wxInputStream *GetErrorStream() const { return m_errorStream; }
wxOutputStream *GetOutputStream() const { return m_outputStream; }
// close the output stream indicating that nothing more will be written
void CloseOutput() { delete m_outputStream; m_outputStream = NULL; }
// return true if the child process stdout is not closed
bool IsInputOpened() const;
// return true if any input is available on the child process stdout/err
bool IsInputAvailable() const;
bool IsErrorAvailable() const;
// implementation only (for wxExecute)
//
// NB: the streams passed here should correspond to the child process
// stdout, stdin and stderr and here the normal naming convention is
// used unlike elsewhere in this class
void SetPipeStreams(wxInputStream *outStream,
wxOutputStream *inStream,
wxInputStream *errStream);
#endif // wxUSE_STREAMS
// priority
// Sets the priority to the given value: see wxPRIORITY_XXX constants.
//
// NB: the priority can only be set before the process is created
void SetPriority(unsigned priority);
// Get the current priority.
unsigned GetPriority() const { return m_priority; }
// implementation only - don't use!
// --------------------------------
// needs to be public since it needs to be used from wxExecute() global func
void SetPid(long pid) { m_pid = pid; }
protected:
void Init(wxEvtHandler *parent, int id, int flags);
int m_id;
long m_pid;
unsigned m_priority;
#if wxUSE_STREAMS
// these streams are connected to stdout, stderr and stdin of the child
// process respectively (yes, m_inputStream corresponds to stdout -- very
// confusing but too late to change now)
wxInputStream *m_inputStream,
*m_errorStream;
wxOutputStream *m_outputStream;
#endif // wxUSE_STREAMS
bool m_redirect;
wxDECLARE_DYNAMIC_CLASS(wxProcess);
wxDECLARE_NO_COPY_CLASS(wxProcess);
};
// ----------------------------------------------------------------------------
// wxProcess events
// ----------------------------------------------------------------------------
class WXDLLIMPEXP_FWD_BASE wxProcessEvent;
wxDECLARE_EXPORTED_EVENT( WXDLLIMPEXP_BASE, wxEVT_END_PROCESS, wxProcessEvent );
class WXDLLIMPEXP_BASE wxProcessEvent : public wxEvent
{
public:
wxProcessEvent(int nId = 0, int pid = 0, int exitcode = 0) : wxEvent(nId)
{
m_eventType = wxEVT_END_PROCESS;
m_pid = pid;
m_exitcode = exitcode;
}
// accessors
// PID of process which terminated
int GetPid() { return m_pid; }
// the exit code
int GetExitCode() { return m_exitcode; }
// implement the base class pure virtual
virtual wxEvent *Clone() const wxOVERRIDE { return new wxProcessEvent(*this); }
public:
int m_pid,
m_exitcode;
wxDECLARE_DYNAMIC_CLASS_NO_ASSIGN(wxProcessEvent);
};
typedef void (wxEvtHandler::*wxProcessEventFunction)(wxProcessEvent&);
#define wxProcessEventHandler(func) \
wxEVENT_HANDLER_CAST(wxProcessEventFunction, func)
#define EVT_END_PROCESS(id, func) \
wx__DECLARE_EVT1(wxEVT_END_PROCESS, id, wxProcessEventHandler(func))
#endif // _WX_PROCESSH__
| h |
rticonnextdds-usecases | data/projects/rticonnextdds-usecases/VehicleTracking/ExampleCode/thirdparty/wxWidgets-3.1.2/Linux/include/wx/editlbox.h | /////////////////////////////////////////////////////////////////////////////
// Name: wx/editlbox.h
// Purpose: ListBox with editable items
// Author: Vaclav Slavik
// Copyright: (c) Vaclav Slavik
// Licence: wxWindows licence
/////////////////////////////////////////////////////////////////////////////
#ifndef __WX_EDITLBOX_H__
#define __WX_EDITLBOX_H__
#include "wx/defs.h"
#if wxUSE_EDITABLELISTBOX
#include "wx/panel.h"
class WXDLLIMPEXP_FWD_CORE wxBitmapButton;
class WXDLLIMPEXP_FWD_CORE wxListCtrl;
class WXDLLIMPEXP_FWD_CORE wxListEvent;
#define wxEL_ALLOW_NEW 0x0100
#define wxEL_ALLOW_EDIT 0x0200
#define wxEL_ALLOW_DELETE 0x0400
#define wxEL_NO_REORDER 0x0800
#define wxEL_DEFAULT_STYLE (wxEL_ALLOW_NEW | wxEL_ALLOW_EDIT | wxEL_ALLOW_DELETE)
extern WXDLLIMPEXP_DATA_CORE(const char) wxEditableListBoxNameStr[];
// This class provides a composite control that lets the
// user easily enter list of strings
class WXDLLIMPEXP_CORE wxEditableListBox : public wxPanel
{
public:
wxEditableListBox() { Init(); }
wxEditableListBox(wxWindow *parent, wxWindowID id,
const wxString& label,
const wxPoint& pos = wxDefaultPosition,
const wxSize& size = wxDefaultSize,
long style = wxEL_DEFAULT_STYLE,
const wxString& name = wxEditableListBoxNameStr)
{
Init();
Create(parent, id, label, pos, size, style, name);
}
bool Create(wxWindow *parent, wxWindowID id,
const wxString& label,
const wxPoint& pos = wxDefaultPosition,
const wxSize& size = wxDefaultSize,
long style = wxEL_DEFAULT_STYLE,
const wxString& name = wxEditableListBoxNameStr);
void SetStrings(const wxArrayString& strings);
void GetStrings(wxArrayString& strings) const;
wxListCtrl* GetListCtrl() { return m_listCtrl; }
wxBitmapButton* GetDelButton() { return m_bDel; }
wxBitmapButton* GetNewButton() { return m_bNew; }
wxBitmapButton* GetUpButton() { return m_bUp; }
wxBitmapButton* GetDownButton() { return m_bDown; }
wxBitmapButton* GetEditButton() { return m_bEdit; }
protected:
wxBitmapButton *m_bDel, *m_bNew, *m_bUp, *m_bDown, *m_bEdit;
wxListCtrl *m_listCtrl;
int m_selection;
long m_style;
void Init()
{
m_style = 0;
m_selection = 0;
m_bEdit = m_bNew = m_bDel = m_bUp = m_bDown = NULL;
m_listCtrl = NULL;
}
void OnItemSelected(wxListEvent& event);
void OnEndLabelEdit(wxListEvent& event);
void OnNewItem(wxCommandEvent& event);
void OnDelItem(wxCommandEvent& event);
void OnEditItem(wxCommandEvent& event);
void OnUpItem(wxCommandEvent& event);
void OnDownItem(wxCommandEvent& event);
wxDECLARE_CLASS(wxEditableListBox);
wxDECLARE_EVENT_TABLE();
private:
void SwapItems(long i1, long i2);
};
#endif // wxUSE_EDITABLELISTBOX
#endif // __WX_EDITLBOX_H__
| h |
rticonnextdds-usecases | data/projects/rticonnextdds-usecases/VehicleTracking/ExampleCode/thirdparty/wxWidgets-3.1.2/Linux/include/wx/cursor.h | /////////////////////////////////////////////////////////////////////////////
// Name: wx/cursor.h
// Purpose: wxCursor base header
// Author: Julian Smart, Vadim Zeitlin
// Created:
// Copyright: (c) Julian Smart
// (c) 2014 Vadim Zeitlin (wxCursorBase)
// Licence: wxWindows Licence
/////////////////////////////////////////////////////////////////////////////
#ifndef _WX_CURSOR_H_BASE_
#define _WX_CURSOR_H_BASE_
#include "wx/gdiobj.h"
#include "wx/gdicmn.h"
// Under most ports, wxCursor derives directly from wxGDIObject, but in wxMSW
// there is an intermediate wxGDIImage class.
#ifdef __WXMSW__
#include "wx/msw/gdiimage.h"
#else
typedef wxGDIObject wxGDIImage;
#endif
class WXDLLIMPEXP_CORE wxCursorBase : public wxGDIImage
{
public:
/*
wxCursor classes should provide the following ctors:
wxCursor();
wxCursor(const wxImage& image);
wxCursor(const wxString& name,
wxBitmapType type = wxCURSOR_DEFAULT_TYPE,
int hotSpotX = 0, int hotSpotY = 0);
wxCursor(wxStockCursor id) { InitFromStock(id); }
#if WXWIN_COMPATIBILITY_2_8
wxCursor(int id) { InitFromStock((wxStockCursor)id); }
#endif
*/
virtual wxPoint GetHotSpot() const { return wxDefaultPosition; }
};
#if defined(__WXMSW__)
#define wxCURSOR_DEFAULT_TYPE wxBITMAP_TYPE_CUR_RESOURCE
#include "wx/msw/cursor.h"
#elif defined(__WXMOTIF__)
#define wxCURSOR_DEFAULT_TYPE wxBITMAP_TYPE_XBM
#include "wx/motif/cursor.h"
#elif defined(__WXGTK20__)
#ifdef __WINDOWS__
#define wxCURSOR_DEFAULT_TYPE wxBITMAP_TYPE_CUR_RESOURCE
#else
#define wxCURSOR_DEFAULT_TYPE wxBITMAP_TYPE_XPM
#endif
#include "wx/gtk/cursor.h"
#elif defined(__WXGTK__)
#define wxCURSOR_DEFAULT_TYPE wxBITMAP_TYPE_XPM
#include "wx/gtk1/cursor.h"
#elif defined(__WXX11__)
#define wxCURSOR_DEFAULT_TYPE wxBITMAP_TYPE_XPM
#include "wx/x11/cursor.h"
#elif defined(__WXDFB__)
#define wxCURSOR_DEFAULT_TYPE wxBITMAP_TYPE_CUR_RESOURCE
#include "wx/dfb/cursor.h"
#elif defined(__WXMAC__)
#define wxCURSOR_DEFAULT_TYPE wxBITMAP_TYPE_MACCURSOR_RESOURCE
#include "wx/osx/cursor.h"
#elif defined(__WXQT__)
#define wxCURSOR_DEFAULT_TYPE wxBITMAP_TYPE_CUR
#include "wx/qt/cursor.h"
#endif
#include "wx/utils.h"
/* This is a small class which can be used by all ports
to temporarily suspend the busy cursor. Useful in modal
dialogs.
Actually that is not (any longer) quite true.. currently it is
only used in wxGTK Dialog::ShowModal() and now uses static
wxBusyCursor methods that are only implemented for wxGTK so far.
The BusyCursor handling code should probably be implemented in
common code somewhere instead of the separate implementations we
currently have. Also the name BusyCursorSuspender is a little
misleading since it doesn't actually suspend the BusyCursor, just
masks one that is already showing.
If another call to wxBeginBusyCursor is made while this is active
the Busy Cursor will again be shown. But at least now it doesn't
interfere with the state of wxIsBusy() -- RL
*/
class wxBusyCursorSuspender
{
public:
wxBusyCursorSuspender()
{
if( wxIsBusy() )
{
wxSetCursor( wxBusyCursor::GetStoredCursor() );
}
}
~wxBusyCursorSuspender()
{
if( wxIsBusy() )
{
wxSetCursor( wxBusyCursor::GetBusyCursor() );
}
}
};
#endif
// _WX_CURSOR_H_BASE_
| h |
rticonnextdds-usecases | data/projects/rticonnextdds-usecases/VehicleTracking/ExampleCode/thirdparty/wxWidgets-3.1.2/Linux/include/wx/math.h | /**
* Name: wx/math.h
* Purpose: Declarations/definitions of common math functions
* Author: John Labenski and others
* Modified by:
* Created: 02/02/03
* Copyright: (c) John Labenski
* Licence: wxWindows licence
*/
/* THIS IS A C FILE, DON'T USE C++ FEATURES (IN PARTICULAR COMMENTS) IN IT */
#ifndef _WX_MATH_H_
#define _WX_MATH_H_
#include "wx/defs.h"
#include <math.h>
#ifndef M_PI
#define M_PI 3.1415926535897932384626433832795
#endif
/* Scaling factors for various unit conversions: 1 inch = 2.54 cm */
#ifndef METRIC_CONVERSION_CONSTANT
#define METRIC_CONVERSION_CONSTANT (1/25.4)
#endif
#ifndef mm2inches
#define mm2inches (METRIC_CONVERSION_CONSTANT)
#endif
#ifndef inches2mm
#define inches2mm (1/(mm2inches))
#endif
#ifndef mm2twips
#define mm2twips (METRIC_CONVERSION_CONSTANT*1440)
#endif
#ifndef twips2mm
#define twips2mm (1/(mm2twips))
#endif
#ifndef mm2pt
#define mm2pt (METRIC_CONVERSION_CONSTANT*72)
#endif
#ifndef pt2mm
#define pt2mm (1/(mm2pt))
#endif
#ifdef __cplusplus
/*
Things are simple with C++11: we have everything we need in std.
Eventually we will only have this section and not the legacy stuff below.
*/
#if __cplusplus >= 201103
#include <cmath>
#define wxFinite(x) std::isfinite(x)
#define wxIsNaN(x) std::isnan(x)
#else /* C++98 */
#if defined(__VISUALC__) || defined(__BORLANDC__)
#include <float.h>
#define wxFinite(x) _finite(x)
#elif defined(__MINGW64_TOOLCHAIN__) || defined(__clang__)
/*
add more compilers with C99 support here: using C99 isfinite() is
preferable to using BSD-ish finite()
*/
#if defined(_GLIBCXX_CMATH) || defined(_LIBCPP_CMATH)
// these <cmath> headers #undef isfinite
#define wxFinite(x) std::isfinite(x)
#else
#define wxFinite(x) isfinite(x)
#endif
#elif defined(wxNEEDS_STRICT_ANSI_WORKAROUNDS)
wxDECL_FOR_STRICT_MINGW32(int, _finite, (double))
#define wxFinite(x) _finite(x)
#elif ( defined(__GNUG__)||defined(__GNUWIN32__)|| \
defined(__SGI_CC__)||defined(__SUNCC__)||defined(__XLC__)|| \
defined(__HPUX__) ) && ( !defined(wxOSX_USE_IPHONE) || wxOSX_USE_IPHONE == 0 )
#ifdef __SOLARIS__
#include <ieeefp.h>
#endif
#define wxFinite(x) finite(x)
#else
#define wxFinite(x) ((x) == (x))
#endif
#if defined(__VISUALC__)||defined(__BORLAND__)
#define wxIsNaN(x) _isnan(x)
#elif defined(__GNUG__)||defined(__GNUWIN32__)|| \
defined(__SGI_CC__)||defined(__SUNCC__)||defined(__XLC__)|| \
defined(__HPUX__)
#define wxIsNaN(x) isnan(x)
#else
#define wxIsNaN(x) ((x) != (x))
#endif
#endif /* C++11/C++98 */
#ifdef __INTELC__
inline bool wxIsSameDouble(double x, double y)
{
// VZ: this warning, given for operators==() and !=() is not wrong, as ==
// shouldn't be used with doubles, but we get too many of them and
// removing these operators is probably not a good idea
//
// Maybe we should always compare doubles up to some "epsilon" precision
#pragma warning(push)
// floating-point equality and inequality comparisons are unreliable
#pragma warning(disable: 1572)
return x == y;
#pragma warning(pop)
}
#else /* !__INTELC__ */
wxGCC_WARNING_SUPPRESS(float-equal)
inline bool wxIsSameDouble(double x, double y) { return x == y; }
wxGCC_WARNING_RESTORE(float-equal)
#endif /* __INTELC__/!__INTELC__ */
inline bool wxIsNullDouble(double x) { return wxIsSameDouble(x, 0.); }
inline int wxRound(double x)
{
wxASSERT_MSG( x > INT_MIN - 0.5 && x < INT_MAX + 0.5,
wxT("argument out of supported range") );
#if defined(HAVE_ROUND)
return int(round(x));
#else
return (int)(x < 0 ? x - 0.5 : x + 0.5);
#endif
}
// Convert between degrees and radians.
inline double wxDegToRad(double deg) { return (deg * M_PI) / 180.0; }
inline double wxRadToDeg(double rad) { return (rad * 180.0) / M_PI; }
// Count trailing zeros.
WXDLLIMPEXP_BASE unsigned int wxCTZ(wxUint32 x);
#endif /* __cplusplus */
#if defined(__WINDOWS__)
#define wxMulDivInt32( a , b , c ) ::MulDiv( a , b , c )
#else
#define wxMulDivInt32( a , b , c ) (wxRound((a)*(((wxDouble)b)/((wxDouble)c))))
#endif
#if wxUSE_APPLE_IEEE
#ifdef __cplusplus
extern "C" {
#endif
/* functions from common/extended.c */
WXDLLIMPEXP_BASE wxFloat64 wxConvertFromIeeeExtended(const wxInt8 *bytes);
WXDLLIMPEXP_BASE void wxConvertToIeeeExtended(wxFloat64 num, wxInt8 *bytes);
/* use wxConvertFromIeeeExtended() and wxConvertToIeeeExtended() instead */
#if WXWIN_COMPATIBILITY_2_8
wxDEPRECATED( WXDLLIMPEXP_BASE wxFloat64 ConvertFromIeeeExtended(const wxInt8 *bytes) );
wxDEPRECATED( WXDLLIMPEXP_BASE void ConvertToIeeeExtended(wxFloat64 num, wxInt8 *bytes) );
#endif
#ifdef __cplusplus
}
#endif
#endif /* wxUSE_APPLE_IEEE */
/* Compute the greatest common divisor of two positive integers */
WXDLLIMPEXP_BASE unsigned int wxGCD(unsigned int u, unsigned int v);
#endif /* _WX_MATH_H_ */
| h |
rticonnextdds-usecases | data/projects/rticonnextdds-usecases/VehicleTracking/ExampleCode/thirdparty/wxWidgets-3.1.2/Linux/include/wx/odcombo.h | /////////////////////////////////////////////////////////////////////////////
// Name: wx/odcombo.h
// Purpose: wxOwnerDrawnComboBox and wxVListBoxPopup
// Author: Jaakko Salli
// Modified by:
// Created: Apr-30-2006
// Copyright: (c) Jaakko Salli
// Licence: wxWindows licence
/////////////////////////////////////////////////////////////////////////////
#ifndef _WX_ODCOMBO_H_
#define _WX_ODCOMBO_H_
#include "wx/defs.h"
#if wxUSE_ODCOMBOBOX
#include "wx/combo.h"
#include "wx/ctrlsub.h"
#include "wx/vlbox.h"
#include "wx/timer.h"
//
// New window styles for wxOwnerDrawnComboBox
//
enum
{
// Double-clicking cycles item if wxCB_READONLY is also used.
wxODCB_DCLICK_CYCLES = wxCC_SPECIAL_DCLICK,
// If used, control itself is not custom paint using callback.
// Even if this is not used, writable combo is never custom paint
// until SetCustomPaintWidth is called
wxODCB_STD_CONTROL_PAINT = 0x1000
};
//
// Callback flags (see wxOwnerDrawnComboBox::OnDrawItem)
//
enum wxOwnerDrawnComboBoxPaintingFlags
{
// when set, we are painting the selected item in control,
// not in the popup
wxODCB_PAINTING_CONTROL = 0x0001,
// when set, we are painting an item which should have
// focus rectangle painted in the background. Text colour
// and clipping region are then appropriately set in
// the default OnDrawBackground implementation.
wxODCB_PAINTING_SELECTED = 0x0002
};
// ----------------------------------------------------------------------------
// wxVListBoxComboPopup is a wxVListBox customized to act as a popup control.
//
// Notes:
// wxOwnerDrawnComboBox uses this as its popup. However, it always derives
// from native wxComboCtrl. If you need to use this popup with
// wxGenericComboControl, then remember that vast majority of item manipulation
// functionality is implemented in the wxVListBoxComboPopup class itself.
//
// ----------------------------------------------------------------------------
class WXDLLIMPEXP_ADV wxVListBoxComboPopup : public wxVListBox,
public wxComboPopup
{
friend class wxOwnerDrawnComboBox;
public:
// init and dtor
wxVListBoxComboPopup() : wxVListBox(), wxComboPopup() { }
virtual ~wxVListBoxComboPopup();
// required virtuals
virtual void Init() wxOVERRIDE;
virtual bool Create(wxWindow* parent) wxOVERRIDE;
virtual void SetFocus() wxOVERRIDE;
virtual wxWindow *GetControl() wxOVERRIDE { return this; }
virtual void SetStringValue( const wxString& value ) wxOVERRIDE;
virtual wxString GetStringValue() const wxOVERRIDE;
// more customization
virtual void OnPopup() wxOVERRIDE;
virtual wxSize GetAdjustedSize( int minWidth, int prefHeight, int maxHeight ) wxOVERRIDE;
virtual void PaintComboControl( wxDC& dc, const wxRect& rect ) wxOVERRIDE;
virtual void OnComboKeyEvent( wxKeyEvent& event ) wxOVERRIDE;
virtual void OnComboCharEvent( wxKeyEvent& event ) wxOVERRIDE;
virtual void OnComboDoubleClick() wxOVERRIDE;
virtual bool LazyCreate() wxOVERRIDE;
virtual bool FindItem(const wxString& item, wxString* trueItem) wxOVERRIDE;
// Item management
void SetSelection( int item );
void Insert( const wxString& item, int pos );
int Append(const wxString& item);
void Clear();
void Delete( unsigned int item );
void SetItemClientData(unsigned int n, void* clientData, wxClientDataType clientDataItemsType);
void *GetItemClientData(unsigned int n) const;
void SetString( int item, const wxString& str );
wxString GetString( int item ) const;
unsigned int GetCount() const;
int FindString(const wxString& s, bool bCase = false) const;
int GetSelection() const;
//void Populate( int n, const wxString choices[] );
void Populate( const wxArrayString& choices );
void ClearClientDatas();
// helpers
int GetItemAtPosition( const wxPoint& pos ) { return HitTest(pos); }
wxCoord GetTotalHeight() const { return EstimateTotalHeight(); }
wxCoord GetLineHeight(int line) const { return OnGetRowHeight(line); }
protected:
// Called by OnComboDoubleClick and OnCombo{Key,Char}Event
bool HandleKey( int keycode, bool saturate, wxChar keychar = 0 );
// sends combobox select event from the parent combo control
void SendComboBoxEvent( int selection );
// gets value, sends event and dismisses
void DismissWithEvent();
// OnMeasureItemWidth will be called on next GetAdjustedSize.
void ItemWidthChanged(unsigned int item)
{
m_widths[item] = -1;
m_widthsDirty = true;
}
// Callbacks for drawing and measuring items. Override in a derived class for
// owner-drawnness. Font, background and text colour have been prepared according
// to selection, focus and such.
//
// item: item index to be drawn, may be wxNOT_FOUND when painting combo control itself
// and there is no valid selection
// flags: wxODCB_PAINTING_CONTROL is set if painting to combo control instead of list
//
// NOTE: If wxVListBoxComboPopup is used with a wxComboCtrl class not derived from
// wxOwnerDrawnComboBox, this method must be overridden.
virtual void OnDrawItem( wxDC& dc, const wxRect& rect, int item, int flags) const;
// This is same as in wxVListBox
virtual wxCoord OnMeasureItem( size_t item ) const wxOVERRIDE;
// Return item width, or -1 for calculating from text extent (default)
virtual wxCoord OnMeasureItemWidth( size_t item ) const;
// Draw item and combo control background. Flags are same as with OnDrawItem.
// NB: Can't use name OnDrawBackground because of virtual function hiding warnings.
virtual void OnDrawBg(wxDC& dc, const wxRect& rect, int item, int flags) const;
// Additional wxVListBox implementation (no need to override in derived classes)
virtual void OnDrawItem(wxDC& dc, const wxRect& rect, size_t n) const wxOVERRIDE;
void OnDrawBackground(wxDC& dc, const wxRect& rect, size_t n) const wxOVERRIDE;
// filter mouse move events happening outside the list box
// move selection with cursor
void OnMouseMove(wxMouseEvent& event);
void OnKey(wxKeyEvent& event);
void OnChar(wxKeyEvent& event);
void OnLeftClick(wxMouseEvent& event);
// Return the widest item width (recalculating it if necessary)
int GetWidestItemWidth() { CalcWidths(); return m_widestWidth; }
// Return the index of the widest item (recalculating it if necessary)
int GetWidestItem() { CalcWidths(); return m_widestItem; }
// Stop partial completion (when some other event occurs)
void StopPartialCompletion();
wxArrayString m_strings;
wxArrayPtrVoid m_clientDatas;
wxFont m_useFont;
//wxString m_stringValue; // displayed text (may be different from m_strings[m_value])
int m_value; // selection
int m_itemHover; // on which item the cursor is
int m_itemHeight; // default item height (calculate from font size
// and used in the absence of callback)
wxClientDataType m_clientDataItemsType;
private:
// Cached item widths (in pixels).
wxVector<int> m_widths;
// Width of currently widest item.
int m_widestWidth;
// Index of currently widest item.
int m_widestItem;
// Measure some items in next GetAdjustedSize?
bool m_widthsDirty;
// Find widest item in next GetAdjustedSize?
bool m_findWidest;
// has the mouse been released on this control?
bool m_clicked;
// Recalculate widths if they are dirty
void CalcWidths();
// Partial completion string
wxString m_partialCompletionString;
wxString m_stringValue;
#if wxUSE_TIMER
// Partial completion timer
wxTimer m_partialCompletionTimer;
#endif // wxUSE_TIMER
wxDECLARE_EVENT_TABLE();
};
// ----------------------------------------------------------------------------
// wxOwnerDrawnComboBox: a generic wxComboBox that allows custom paint items
// in addition to many other types of customization already allowed by
// the wxComboCtrl.
// ----------------------------------------------------------------------------
class WXDLLIMPEXP_ADV wxOwnerDrawnComboBox :
public wxWindowWithItems<wxComboCtrl, wxItemContainer>
{
//friend class wxComboPopupWindow;
friend class wxVListBoxComboPopup;
public:
// ctors and such
wxOwnerDrawnComboBox() { Init(); }
wxOwnerDrawnComboBox(wxWindow *parent,
wxWindowID id,
const wxString& value,
const wxPoint& pos,
const wxSize& size,
int n,
const wxString choices[],
long style = 0,
const wxValidator& validator = wxDefaultValidator,
const wxString& name = wxComboBoxNameStr)
{
Init();
(void)Create(parent, id, value, pos, size, n,
choices, style, validator, name);
}
bool Create(wxWindow *parent,
wxWindowID id,
const wxString& value = wxEmptyString,
const wxPoint& pos = wxDefaultPosition,
const wxSize& size = wxDefaultSize,
long style = 0,
const wxValidator& validator = wxDefaultValidator,
const wxString& name = wxComboBoxNameStr);
wxOwnerDrawnComboBox(wxWindow *parent,
wxWindowID id,
const wxString& value = wxEmptyString,
const wxPoint& pos = wxDefaultPosition,
const wxSize& size = wxDefaultSize,
const wxArrayString& choices = wxArrayString(),
long style = 0,
const wxValidator& validator = wxDefaultValidator,
const wxString& name = wxComboBoxNameStr);
bool Create(wxWindow *parent,
wxWindowID id,
const wxString& value,
const wxPoint& pos,
const wxSize& size,
int n,
const wxString choices[],
long style = 0,
const wxValidator& validator = wxDefaultValidator,
const wxString& name = wxComboBoxNameStr);
bool Create(wxWindow *parent,
wxWindowID id,
const wxString& value,
const wxPoint& pos,
const wxSize& size,
const wxArrayString& choices,
long style = 0,
const wxValidator& validator = wxDefaultValidator,
const wxString& name = wxComboBoxNameStr);
virtual ~wxOwnerDrawnComboBox();
// Prevent app from using wxComboPopup
void SetPopupControl(wxVListBoxComboPopup* popup)
{
DoSetPopupControl(popup);
}
// wxControlWithItems methods
virtual unsigned int GetCount() const wxOVERRIDE;
virtual wxString GetString(unsigned int n) const wxOVERRIDE;
virtual void SetString(unsigned int n, const wxString& s) wxOVERRIDE;
virtual int FindString(const wxString& s, bool bCase = false) const wxOVERRIDE;
virtual void Select(int n);
virtual int GetSelection() const wxOVERRIDE;
// See wxComboBoxBase discussion of IsEmpty().
bool IsListEmpty() const { return wxItemContainer::IsEmpty(); }
bool IsTextEmpty() const { return wxTextEntry::IsEmpty(); }
// Override these just to maintain consistency with virtual methods
// between classes.
virtual void Clear() wxOVERRIDE;
virtual void GetSelection(long *from, long *to) const wxOVERRIDE;
virtual void SetSelection(int n) wxOVERRIDE { Select(n); }
// Prevent a method from being hidden
virtual void SetSelection(long from, long to) wxOVERRIDE
{
wxComboCtrl::SetSelection(from,to);
}
// Return the widest item width (recalculating it if necessary)
virtual int GetWidestItemWidth() { EnsurePopupControl(); return GetVListBoxComboPopup()->GetWidestItemWidth(); }
// Return the index of the widest item (recalculating it if necessary)
virtual int GetWidestItem() { EnsurePopupControl(); return GetVListBoxComboPopup()->GetWidestItem(); }
virtual bool IsSorted() const wxOVERRIDE { return HasFlag(wxCB_SORT); }
protected:
virtual void DoClear() wxOVERRIDE;
virtual void DoDeleteOneItem(unsigned int n) wxOVERRIDE;
// Callback for drawing. Font, background and text colour have been
// prepared according to selection, focus and such.
// item: item index to be drawn, may be wxNOT_FOUND when painting combo control itself
// and there is no valid selection
// flags: wxODCB_PAINTING_CONTROL is set if painting to combo control instead of list
virtual void OnDrawItem( wxDC& dc, const wxRect& rect, int item, int flags ) const;
// Callback for item height, or -1 for default
virtual wxCoord OnMeasureItem( size_t item ) const;
// Callback for item width, or -1 for default/undetermined
virtual wxCoord OnMeasureItemWidth( size_t item ) const;
// override base implementation so we can return the size for the
// largest item
virtual wxSize DoGetBestSize() const wxOVERRIDE;
// Callback for background drawing. Flags are same as with
// OnDrawItem.
virtual void OnDrawBackground( wxDC& dc, const wxRect& rect, int item, int flags ) const;
// NULL popup can be used to indicate default interface
virtual void DoSetPopupControl(wxComboPopup* popup) wxOVERRIDE;
// clears all allocated client datas
void ClearClientDatas();
wxVListBoxComboPopup* GetVListBoxComboPopup() const
{
return (wxVListBoxComboPopup*) m_popupInterface;
}
virtual int DoInsertItems(const wxArrayStringsAdapter& items,
unsigned int pos,
void **clientData, wxClientDataType type) wxOVERRIDE;
virtual void DoSetItemClientData(unsigned int n, void* clientData) wxOVERRIDE;
virtual void* DoGetItemClientData(unsigned int n) const wxOVERRIDE;
// temporary storage for the initial choices
//const wxString* m_baseChoices;
//int m_baseChoicesCount;
wxArrayString m_initChs;
private:
void Init();
wxDECLARE_EVENT_TABLE();
wxDECLARE_DYNAMIC_CLASS(wxOwnerDrawnComboBox);
};
#endif // wxUSE_ODCOMBOBOX
#endif
// _WX_ODCOMBO_H_
| h |
rticonnextdds-usecases | data/projects/rticonnextdds-usecases/VehicleTracking/ExampleCode/thirdparty/wxWidgets-3.1.2/Linux/include/wx/dnd.h | ///////////////////////////////////////////////////////////////////////////////
// Name: wx/dnd.h
// Purpose: Drag and drop classes declarations
// Author: Vadim Zeitlin, Robert Roebling
// Modified by:
// Created: 26.05.99
// Copyright: (c) wxWidgets Team
// Licence: wxWindows licence
///////////////////////////////////////////////////////////////////////////////
#ifndef _WX_DND_H_BASE_
#define _WX_DND_H_BASE_
#include "wx/defs.h"
#if wxUSE_DRAG_AND_DROP
#include "wx/dataobj.h"
#include "wx/cursor.h"
// ----------------------------------------------------------------------------
// constants
// ----------------------------------------------------------------------------
// flags for wxDropSource::DoDragDrop()
//
// NB: wxDrag_CopyOnly must be 0 (== FALSE) and wxDrag_AllowMove must be 1
// (== TRUE) for compatibility with the old DoDragDrop(bool) method!
enum
{
wxDrag_CopyOnly = 0, // allow only copying
wxDrag_AllowMove = 1, // allow moving (copying is always allowed)
wxDrag_DefaultMove = 3 // the default operation is move, not copy
};
// result of wxDropSource::DoDragDrop() call
enum wxDragResult
{
wxDragError, // error prevented the d&d operation from completing
wxDragNone, // drag target didn't accept the data
wxDragCopy, // the data was successfully copied
wxDragMove, // the data was successfully moved (MSW only)
wxDragLink, // operation is a drag-link
wxDragCancel // the operation was cancelled by user (not an error)
};
// return true if res indicates that something was done during a dnd operation,
// i.e. is neither error nor none nor cancel
WXDLLIMPEXP_CORE bool wxIsDragResultOk(wxDragResult res);
// ----------------------------------------------------------------------------
// wxDropSource is the object you need to create (and call DoDragDrop on it)
// to initiate a drag-and-drop operation
// ----------------------------------------------------------------------------
class WXDLLIMPEXP_CORE wxDropSourceBase
{
public:
wxDropSourceBase(const wxCursor &cursorCopy = wxNullCursor,
const wxCursor &cursorMove = wxNullCursor,
const wxCursor &cursorStop = wxNullCursor)
: m_cursorCopy(cursorCopy),
m_cursorMove(cursorMove),
m_cursorStop(cursorStop)
{ m_data = NULL; }
virtual ~wxDropSourceBase() { }
// set the data which is transferred by drag and drop
void SetData(wxDataObject& data)
{ m_data = &data; }
wxDataObject *GetDataObject()
{ return m_data; }
// set the icon corresponding to given drag result
void SetCursor(wxDragResult res, const wxCursor& cursor)
{
if ( res == wxDragCopy )
m_cursorCopy = cursor;
else if ( res == wxDragMove )
m_cursorMove = cursor;
else
m_cursorStop = cursor;
}
// start drag action, see enum wxDragResult for return value description
//
// if flags contains wxDrag_AllowMove, moving (and only copying) data is
// allowed, if it contains wxDrag_DefaultMove (which includes the previous
// flag), it is even the default operation
virtual wxDragResult DoDragDrop(int flags = wxDrag_CopyOnly) = 0;
// override to give feedback depending on the current operation result
// "effect" and return true if you did something, false to let the library
// give the default feedback
virtual bool GiveFeedback(wxDragResult WXUNUSED(effect)) { return false; }
protected:
const wxCursor& GetCursor(wxDragResult res) const
{
if ( res == wxDragCopy )
return m_cursorCopy;
else if ( res == wxDragMove )
return m_cursorMove;
else
return m_cursorStop;
}
// the data we're dragging
wxDataObject *m_data;
// the cursors to use for feedback
wxCursor m_cursorCopy,
m_cursorMove,
m_cursorStop;
wxDECLARE_NO_COPY_CLASS(wxDropSourceBase);
};
// ----------------------------------------------------------------------------
// wxDropTarget should be associated with a window if it wants to be able to
// receive data via drag and drop.
//
// To use this class, you should derive from wxDropTarget and implement
// OnData() pure virtual method. You may also wish to override OnDrop() if you
// want to accept the data only inside some region of the window (this may
// avoid having to copy the data to this application which happens only when
// OnData() is called)
// ----------------------------------------------------------------------------
class WXDLLIMPEXP_CORE wxDropTargetBase
{
public:
// ctor takes a pointer to heap-allocated wxDataObject which will be owned
// by wxDropTarget and deleted by it automatically. If you don't give it
// here, you can use SetDataObject() later.
wxDropTargetBase(wxDataObject *dataObject = NULL)
{ m_dataObject = dataObject; m_defaultAction = wxDragNone; }
// dtor deletes our data object
virtual ~wxDropTargetBase()
{ delete m_dataObject; }
// get/set the associated wxDataObject
wxDataObject *GetDataObject() const
{ return m_dataObject; }
void SetDataObject(wxDataObject *dataObject)
{ if (m_dataObject) delete m_dataObject;
m_dataObject = dataObject; }
// these functions are called when data is moved over position (x, y) and
// may return either wxDragCopy, wxDragMove or wxDragNone depending on
// what would happen if the data were dropped here.
//
// the last parameter is what would happen by default and is determined by
// the platform-specific logic (for example, under Windows it's wxDragCopy
// if Ctrl key is pressed and wxDragMove otherwise) except that it will
// always be wxDragNone if the carried data is in an unsupported format.
// called when the mouse enters the window (only once until OnLeave())
virtual wxDragResult OnEnter(wxCoord x, wxCoord y, wxDragResult def)
{ return OnDragOver(x, y, def); }
// called when the mouse moves in the window - shouldn't take long to
// execute or otherwise mouse movement would be too slow
virtual wxDragResult OnDragOver(wxCoord WXUNUSED(x), wxCoord WXUNUSED(y),
wxDragResult def)
{ return def; }
// called when mouse leaves the window: might be used to remove the
// feedback which was given in OnEnter()
virtual void OnLeave() { }
// this function is called when data is dropped at position (x, y) - if it
// returns true, OnData() will be called immediately afterwards which will
// allow to retrieve the data dropped.
virtual bool OnDrop(wxCoord x, wxCoord y) = 0;
// called after OnDrop() returns TRUE: you will usually just call
// GetData() from here and, probably, also refresh something to update the
// new data and, finally, return the code indicating how did the operation
// complete (returning default value in case of success and wxDragError on
// failure is usually ok)
virtual wxDragResult OnData(wxCoord x, wxCoord y, wxDragResult def) = 0;
// may be called *only* from inside OnData() and will fill m_dataObject
// with the data from the drop source if it returns true
virtual bool GetData() = 0;
// sets the default action for drag and drop:
// use wxDragMove or wxDragCopy to set deafult action to move or copy
// and use wxDragNone (default) to set default action specified by
// initialization of draging (see wxDropSourceBase::DoDragDrop())
void SetDefaultAction(wxDragResult action)
{ m_defaultAction = action; }
// returns default action for drag and drop or
// wxDragNone if this not specified
wxDragResult GetDefaultAction()
{ return m_defaultAction; }
protected:
wxDataObject *m_dataObject;
wxDragResult m_defaultAction;
wxDECLARE_NO_COPY_CLASS(wxDropTargetBase);
};
// ----------------------------------------------------------------------------
// include platform dependent class declarations
// ----------------------------------------------------------------------------
#if defined(__WXMSW__)
#include "wx/msw/ole/dropsrc.h"
#include "wx/msw/ole/droptgt.h"
#elif defined(__WXMOTIF__)
#include "wx/motif/dnd.h"
#elif defined(__WXX11__)
#include "wx/x11/dnd.h"
#elif defined(__WXGTK20__)
#include "wx/gtk/dnd.h"
#elif defined(__WXGTK__)
#include "wx/gtk1/dnd.h"
#elif defined(__WXMAC__)
#include "wx/osx/dnd.h"
#elif defined(__WXQT__)
#include "wx/qt/dnd.h"
#endif
// ----------------------------------------------------------------------------
// standard wxDropTarget implementations (implemented in common/dobjcmn.cpp)
// ----------------------------------------------------------------------------
// A simple wxDropTarget derived class for text data: you only need to
// override OnDropText() to get something working
class WXDLLIMPEXP_CORE wxTextDropTarget : public wxDropTarget
{
public:
wxTextDropTarget();
virtual bool OnDropText(wxCoord x, wxCoord y, const wxString& text) = 0;
virtual wxDragResult OnData(wxCoord x, wxCoord y, wxDragResult def) wxOVERRIDE;
private:
wxDECLARE_NO_COPY_CLASS(wxTextDropTarget);
};
// A drop target which accepts files (dragged from File Manager or Explorer)
class WXDLLIMPEXP_CORE wxFileDropTarget : public wxDropTarget
{
public:
wxFileDropTarget();
// parameters are the number of files and the array of file names
virtual bool OnDropFiles(wxCoord x, wxCoord y,
const wxArrayString& filenames) = 0;
virtual wxDragResult OnData(wxCoord x, wxCoord y, wxDragResult def) wxOVERRIDE;
private:
wxDECLARE_NO_COPY_CLASS(wxFileDropTarget);
};
#endif // wxUSE_DRAG_AND_DROP
#endif // _WX_DND_H_BASE_
| h |
rticonnextdds-usecases | data/projects/rticonnextdds-usecases/VehicleTracking/ExampleCode/thirdparty/wxWidgets-3.1.2/Linux/include/wx/popupwin.h | ///////////////////////////////////////////////////////////////////////////////
// Name: wx/popupwin.h
// Purpose: wxPopupWindow interface declaration
// Author: Vadim Zeitlin
// Modified by:
// Created: 06.01.01
// Copyright: (c) 2001 Vadim Zeitlin <[email protected]>
// Licence: wxWindows licence
///////////////////////////////////////////////////////////////////////////////
#ifndef _WX_POPUPWIN_H_BASE_
#define _WX_POPUPWIN_H_BASE_
#include "wx/defs.h"
#if wxUSE_POPUPWIN
#include "wx/nonownedwnd.h"
// ----------------------------------------------------------------------------
// wxPopupWindow: a special kind of top level window used for popup menus,
// combobox popups and such.
// ----------------------------------------------------------------------------
class WXDLLIMPEXP_CORE wxPopupWindowBase : public wxNonOwnedWindow
{
public:
wxPopupWindowBase() { }
virtual ~wxPopupWindowBase();
// create the popup window
//
// style may only contain border flags
bool Create(wxWindow *parent, int style = wxBORDER_NONE);
// move the popup window to the right position, i.e. such that it is
// entirely visible
//
// the popup is positioned at ptOrigin + size if it opens below and to the
// right (default), at ptOrigin - sizePopup if it opens above and to the
// left &c
//
// the point must be given in screen coordinates!
virtual void Position(const wxPoint& ptOrigin,
const wxSize& size);
virtual bool IsTopLevel() const wxOVERRIDE { return true; }
wxDECLARE_NO_COPY_CLASS(wxPopupWindowBase);
};
// include the real class declaration
#if defined(__WXMSW__)
#include "wx/msw/popupwin.h"
#elif defined(__WXGTK20__)
#include "wx/gtk/popupwin.h"
#elif defined(__WXGTK__)
#include "wx/gtk1/popupwin.h"
#elif defined(__WXX11__)
#include "wx/x11/popupwin.h"
#elif defined(__WXMOTIF__)
#include "wx/motif/popupwin.h"
#elif defined(__WXDFB__)
#include "wx/dfb/popupwin.h"
#elif defined(__WXMAC__)
#include "wx/osx/popupwin.h"
#elif defined(__WXQT__)
#include "wx/qt/popupwin.h"
#else
#error "wxPopupWindow is not supported under this platform."
#endif
// ----------------------------------------------------------------------------
// wxPopupTransientWindow: a wxPopupWindow which disappears automatically
// when the user clicks mouse outside it or if it loses focus in any other way
// ----------------------------------------------------------------------------
// Define the public API of wxPopupTransientWindow:
class WXDLLIMPEXP_CORE wxPopupTransientWindowBase : public wxPopupWindow
{
public:
// popup the window (this will show it too) and keep focus at winFocus
// (or itself if it's NULL), dismiss the popup if we lose focus
virtual void Popup(wxWindow *focus = NULL) = 0;
// hide the window
virtual void Dismiss() = 0;
// can the window be dismissed now?
//
// VZ: where is this used??
virtual bool CanDismiss()
{ return true; }
// called when a mouse is pressed while the popup is shown: return true
// from here to prevent its normal processing by the popup (which consists
// in dismissing it if the mouse is clicked outside it)
virtual bool ProcessLeftDown(wxMouseEvent& WXUNUSED(event))
{ return false; }
// Override to implement delayed destruction of this window.
virtual bool Destroy() wxOVERRIDE;
protected:
// this is called when the popup is disappeared because of anything
// else but direct call to Dismiss()
virtual void OnDismiss() { }
// dismiss and notify the derived class
void DismissAndNotify()
{
Dismiss();
OnDismiss();
}
};
#ifdef __WXMSW__
class WXDLLIMPEXP_CORE wxPopupTransientWindow : public wxPopupTransientWindowBase
{
public:
// ctors
wxPopupTransientWindow() { }
wxPopupTransientWindow(wxWindow *parent, int style = wxBORDER_NONE)
{ Create(parent, style); }
// Implement base class pure virtuals.
virtual void Popup(wxWindow *focus = NULL) wxOVERRIDE;
virtual void Dismiss() wxOVERRIDE;
// Override to handle WM_NCACTIVATE.
virtual bool MSWHandleMessage(WXLRESULT *result,
WXUINT message,
WXWPARAM wParam,
WXLPARAM lParam) wxOVERRIDE;
private:
wxDECLARE_DYNAMIC_CLASS(wxPopupTransientWindow);
wxDECLARE_NO_COPY_CLASS(wxPopupTransientWindow);
};
#else // !__WXMSW__
class WXDLLIMPEXP_FWD_CORE wxPopupWindowHandler;
class WXDLLIMPEXP_FWD_CORE wxPopupFocusHandler;
class WXDLLIMPEXP_CORE wxPopupTransientWindow : public wxPopupTransientWindowBase
{
public:
// ctors
wxPopupTransientWindow() { Init(); }
wxPopupTransientWindow(wxWindow *parent, int style = wxBORDER_NONE);
virtual ~wxPopupTransientWindow();
// Implement base class pure virtuals.
virtual void Popup(wxWindow *focus = NULL) wxOVERRIDE;
virtual void Dismiss() wxOVERRIDE;
// Overridden to grab the input on some plaforms
virtual bool Show( bool show = true ) wxOVERRIDE;
protected:
// common part of all ctors
void Init();
// remove our event handlers
void PopHandlers();
// get alerted when child gets deleted from under us
void OnDestroy(wxWindowDestroyEvent& event);
#if defined(__WXMAC__) && wxOSX_USE_COCOA_OR_CARBON
// Check if the mouse needs to be captured or released: we must release
// when it's inside our window if we want the embedded controls to work.
void OnIdle(wxIdleEvent& event);
#endif
// the child of this popup if any
wxWindow *m_child;
// the window which has the focus while we're shown
wxWindow *m_focus;
// these classes may call our DismissAndNotify()
friend class wxPopupWindowHandler;
friend class wxPopupFocusHandler;
// the handlers we created, may be NULL (if not, must be deleted)
wxPopupWindowHandler *m_handlerPopup;
wxPopupFocusHandler *m_handlerFocus;
wxDECLARE_EVENT_TABLE();
wxDECLARE_DYNAMIC_CLASS(wxPopupTransientWindow);
wxDECLARE_NO_COPY_CLASS(wxPopupTransientWindow);
};
#endif // __WXMSW__/!__WXMSW__
#if wxUSE_COMBOBOX && defined(__WXUNIVERSAL__)
// ----------------------------------------------------------------------------
// wxPopupComboWindow: wxPopupTransientWindow used by wxComboBox
// ----------------------------------------------------------------------------
class WXDLLIMPEXP_FWD_CORE wxComboBox;
class WXDLLIMPEXP_FWD_CORE wxComboCtrl;
class WXDLLIMPEXP_CORE wxPopupComboWindow : public wxPopupTransientWindow
{
public:
wxPopupComboWindow() { m_combo = NULL; }
wxPopupComboWindow(wxComboCtrl *parent);
bool Create(wxComboCtrl *parent);
// position the window correctly relatively to the combo
void PositionNearCombo();
protected:
// notify the combo here
virtual void OnDismiss();
// forward the key presses to the combobox
void OnKeyDown(wxKeyEvent& event);
// the parent combobox
wxComboCtrl *m_combo;
wxDECLARE_EVENT_TABLE();
wxDECLARE_DYNAMIC_CLASS(wxPopupComboWindow);
};
#endif // wxUSE_COMBOBOX && defined(__WXUNIVERSAL__)
#endif // wxUSE_POPUPWIN
#endif // _WX_POPUPWIN_H_BASE_
| h |
rticonnextdds-usecases | data/projects/rticonnextdds-usecases/VehicleTracking/ExampleCode/thirdparty/wxWidgets-3.1.2/Linux/include/wx/caret.h | ///////////////////////////////////////////////////////////////////////////////
// Name: wx/caret.h
// Purpose: wxCaretBase class - the interface of wxCaret
// Author: Vadim Zeitlin
// Modified by:
// Created: 23.05.99
// Copyright: (c) wxWidgets team
// Licence: wxWindows licence
///////////////////////////////////////////////////////////////////////////////
#ifndef _WX_CARET_H_BASE_
#define _WX_CARET_H_BASE_
#include "wx/defs.h"
#if wxUSE_CARET
// ---------------------------------------------------------------------------
// forward declarations
// ---------------------------------------------------------------------------
class WXDLLIMPEXP_FWD_CORE wxWindow;
class WXDLLIMPEXP_FWD_CORE wxWindowBase;
// ----------------------------------------------------------------------------
// headers we have to include
// ----------------------------------------------------------------------------
#include "wx/gdicmn.h" // for wxPoint, wxSize
// ----------------------------------------------------------------------------
// A caret is a blinking cursor showing the position where the typed text will
// appear. It can be either a solid block or a custom bitmap (TODO)
// ----------------------------------------------------------------------------
class WXDLLIMPEXP_CORE wxCaretBase
{
public:
// ctors
// -----
// default - use Create
wxCaretBase() { Init(); }
// create the caret of given (in pixels) width and height and associate
// with the given window
wxCaretBase(wxWindowBase *window, int width, int height)
{
Init();
(void)Create(window, width, height);
}
// same as above
wxCaretBase(wxWindowBase *window, const wxSize& size)
{
Init();
(void)Create(window, size);
}
// a virtual dtor has been provided since this class has virtual members
virtual ~wxCaretBase() { }
// Create() functions - same as ctor but returns the success code
// --------------------------------------------------------------
// same as ctor
bool Create(wxWindowBase *window, int width, int height)
{ return DoCreate(window, width, height); }
// same as ctor
bool Create(wxWindowBase *window, const wxSize& size)
{ return DoCreate(window, size.x, size.y); }
// accessors
// ---------
// is the caret valid?
bool IsOk() const { return m_width != 0 && m_height != 0; }
// is the caret currently shown?
bool IsVisible() const { return m_countVisible > 0; }
// get the caret position
void GetPosition(int *x, int *y) const
{
if ( x ) *x = m_x;
if ( y ) *y = m_y;
}
wxPoint GetPosition() const { return wxPoint(m_x, m_y); }
// get the caret size
void GetSize(int *width, int *height) const
{
if ( width ) *width = m_width;
if ( height ) *height = m_height;
}
wxSize GetSize() const { return wxSize(m_width, m_height); }
// get the window we're associated with
wxWindow *GetWindow() const { return (wxWindow *)m_window; }
// change the size of the caret
void SetSize(int width, int height) {
m_width = width;
m_height = height;
DoSize();
}
void SetSize(const wxSize& size) { SetSize(size.x, size.y); }
// operations
// ----------
// move the caret to given position (in logical coords)
void Move(int x, int y) { m_x = x; m_y = y; DoMove(); }
void Move(const wxPoint& pt) { m_x = pt.x; m_y = pt.y; DoMove(); }
// show/hide the caret (should be called by wxWindow when needed):
// Show() must be called as many times as Hide() + 1 to make the caret
// visible
virtual void Show(bool show = true)
{
if ( show )
{
if ( m_countVisible++ == 0 )
DoShow();
}
else
{
if ( --m_countVisible == 0 )
DoHide();
}
}
virtual void Hide() { Show(false); }
// blink time is measured in milliseconds and is the time elapsed
// between 2 inversions of the caret (blink time of the caret is common
// to all carets in the Universe, so these functions are static)
static int GetBlinkTime();
static void SetBlinkTime(int milliseconds);
// implementation from now on
// --------------------------
// these functions should be called by wxWindow when the window gets/loses
// the focus - we create/show and hide/destroy the caret here
virtual void OnSetFocus() { }
virtual void OnKillFocus() { }
protected:
// these functions may be overridden in the derived classes, but they
// should call the base class version first
virtual bool DoCreate(wxWindowBase *window, int width, int height)
{
m_window = window;
m_width = width;
m_height = height;
return true;
}
// pure virtuals to implement in the derived class
virtual void DoShow() = 0;
virtual void DoHide() = 0;
virtual void DoMove() = 0;
virtual void DoSize() { }
// the common initialization
void Init()
{
m_window = NULL;
m_x = m_y = 0;
m_width = m_height = 0;
m_countVisible = 0;
}
// the size of the caret
int m_width, m_height;
// the position of the caret
int m_x, m_y;
// the window we're associated with
wxWindowBase *m_window;
// visibility count: the caret is visible only if it's positive
int m_countVisible;
private:
wxDECLARE_NO_COPY_CLASS(wxCaretBase);
};
// ---------------------------------------------------------------------------
// now include the real thing
// ---------------------------------------------------------------------------
#if defined(__WXMSW__)
#include "wx/msw/caret.h"
#else
#include "wx/generic/caret.h"
#endif // platform
// ----------------------------------------------------------------------------
// wxCaretSuspend: a simple class which hides the caret in its ctor and
// restores it in the dtor, this should be used when drawing on the screen to
// avoid overdrawing the caret
// ----------------------------------------------------------------------------
#ifdef wxHAS_CARET_USING_OVERLAYS
// we don't need to hide the caret if it's rendered using overlays
class WXDLLIMPEXP_CORE wxCaretSuspend
{
public:
wxCaretSuspend(wxWindow *WXUNUSED(win)) {}
wxDECLARE_NO_COPY_CLASS(wxCaretSuspend);
};
#else // !wxHAS_CARET_USING_OVERLAYS
class WXDLLIMPEXP_CORE wxCaretSuspend
{
public:
wxCaretSuspend(wxWindow *win)
{
m_caret = win->GetCaret();
m_show = false;
if ( m_caret && m_caret->IsVisible() )
{
m_caret->Hide();
m_show = true;
}
}
~wxCaretSuspend()
{
if ( m_caret && m_show )
m_caret->Show();
}
private:
wxCaret *m_caret;
bool m_show;
wxDECLARE_NO_COPY_CLASS(wxCaretSuspend);
};
#endif // wxHAS_CARET_USING_OVERLAYS/!wxHAS_CARET_USING_OVERLAYS
#endif // wxUSE_CARET
#endif // _WX_CARET_H_BASE_
| h |
rticonnextdds-usecases | data/projects/rticonnextdds-usecases/VehicleTracking/ExampleCode/thirdparty/wxWidgets-3.1.2/Linux/include/wx/evtloopsrc.h | ///////////////////////////////////////////////////////////////////////////////
// Name: wx/evtloopsrc.h
// Purpose: declaration of wxEventLoopSource class
// Author: Vadim Zeitlin
// Created: 2009-10-21
// Copyright: (c) 2009 Vadim Zeitlin <[email protected]>
// Licence: wxWindows licence
///////////////////////////////////////////////////////////////////////////////
#ifndef _WX_EVTLOOPSRC_H_
#define _WX_EVTLOOPSRC_H_
// Include the header to get wxUSE_EVENTLOOP_SOURCE definition from it.
#include "wx/evtloop.h"
// ----------------------------------------------------------------------------
// wxEventLoopSource: a source of events which may be added to wxEventLoop
// ----------------------------------------------------------------------------
// TODO: refactor wxSocket under Unix to reuse wxEventLoopSource instead of
// duplicating much of its logic
//
// TODO: freeze the API and document it
#if wxUSE_EVENTLOOP_SOURCE
#define wxTRACE_EVT_SOURCE "EventSource"
// handler used to process events on event loop sources
class wxEventLoopSourceHandler
{
public:
// called when descriptor is available for non-blocking read
virtual void OnReadWaiting() = 0;
// called when descriptor is available for non-blocking write
virtual void OnWriteWaiting() = 0;
// called when there is exception on descriptor
virtual void OnExceptionWaiting() = 0;
// virtual dtor for the base class
virtual ~wxEventLoopSourceHandler() { }
};
// flags describing which kind of IO events we're interested in
enum
{
wxEVENT_SOURCE_INPUT = 0x01,
wxEVENT_SOURCE_OUTPUT = 0x02,
wxEVENT_SOURCE_EXCEPTION = 0x04,
wxEVENT_SOURCE_ALL = wxEVENT_SOURCE_INPUT |
wxEVENT_SOURCE_OUTPUT |
wxEVENT_SOURCE_EXCEPTION
};
// wxEventLoopSource itself is an ABC and can't be created directly, currently
// the only way to create it is by using wxEventLoop::AddSourceForFD().
class wxEventLoopSource
{
public:
// dtor is pure virtual because it must be overridden to remove the source
// from the event loop monitoring it
virtual ~wxEventLoopSource() = 0;
void SetHandler(wxEventLoopSourceHandler* handler) { m_handler = handler; }
wxEventLoopSourceHandler* GetHandler() const { return m_handler; }
void SetFlags(int flags) { m_flags = flags; }
int GetFlags() const { return m_flags; }
protected:
// ctor is only used by the derived classes
wxEventLoopSource(wxEventLoopSourceHandler *handler, int flags)
: m_handler(handler),
m_flags(flags)
{
}
wxEventLoopSourceHandler* m_handler;
int m_flags;
wxDECLARE_NO_COPY_CLASS(wxEventLoopSource);
};
inline wxEventLoopSource::~wxEventLoopSource() { }
#if defined(__UNIX__)
#include "wx/unix/evtloopsrc.h"
#endif // __UNIX__
#if defined(__WXGTK20__)
#include "wx/gtk/evtloopsrc.h"
#endif
#if defined(__DARWIN__)
#include "wx/osx/evtloopsrc.h"
#elif defined(__WXQT__)
#include "wx/unix/evtloopsrc.h"
#endif
#endif // wxUSE_EVENTLOOP_SOURCE
#endif // _WX_EVTLOOPSRC_H_
| h |
rticonnextdds-usecases | data/projects/rticonnextdds-usecases/VehicleTracking/ExampleCode/thirdparty/wxWidgets-3.1.2/Linux/include/wx/treebase.h | /////////////////////////////////////////////////////////////////////////////
// Name: wx/treebase.h
// Purpose: wxTreeCtrl base classes and types
// Author: Julian Smart et al
// Modified by:
// Created: 01/02/97
// Copyright: (c) 1997,1998 Robert Roebling
// Licence: wxWindows licence
/////////////////////////////////////////////////////////////////////////////
#ifndef _WX_TREEBASE_H_
#define _WX_TREEBASE_H_
// ----------------------------------------------------------------------------
// headers
// ----------------------------------------------------------------------------
#include "wx/defs.h"
#if wxUSE_TREECTRL
#include "wx/window.h" // for wxClientData
#include "wx/event.h"
#include "wx/dynarray.h"
#include "wx/itemid.h"
// ----------------------------------------------------------------------------
// wxTreeItemId identifies an element of the tree. It's opaque for the
// application and the only method which can be used by user code is IsOk().
// ----------------------------------------------------------------------------
// This is a class and not a typedef because existing code may forward declare
// wxTreeItemId as a class and we don't want to break it without good reason.
class wxTreeItemId : public wxItemId<void*>
{
public:
wxTreeItemId() : wxItemId<void*>() { }
wxTreeItemId(void* pItem) : wxItemId<void*>(pItem) { }
};
// ----------------------------------------------------------------------------
// wxTreeItemData is some (arbitrary) user class associated with some item. The
// main advantage of having this class (compared to old untyped interface) is
// that wxTreeItemData's are destroyed automatically by the tree and, as this
// class has virtual dtor, it means that the memory will be automatically
// freed. OTOH, we don't just use wxObject instead of wxTreeItemData because
// the size of this class is critical: in any real application, each tree leaf
// will have wxTreeItemData associated with it and number of leaves may be
// quite big.
//
// Because the objects of this class are deleted by the tree, they should
// always be allocated on the heap!
// ----------------------------------------------------------------------------
class WXDLLIMPEXP_CORE wxTreeItemData: public wxClientData
{
friend class WXDLLIMPEXP_FWD_CORE wxTreeCtrl;
friend class WXDLLIMPEXP_FWD_CORE wxGenericTreeCtrl;
public:
// creation/destruction
// --------------------
// default ctor
wxTreeItemData() { }
// default copy ctor/assignment operator are ok
// accessor: get the item associated with us
const wxTreeItemId& GetId() const { return m_pItem; }
void SetId(const wxTreeItemId& id) { m_pItem = id; }
protected:
wxTreeItemId m_pItem;
};
typedef void *wxTreeItemIdValue;
WX_DEFINE_EXPORTED_ARRAY_PTR(wxTreeItemIdValue, wxArrayTreeItemIdsBase);
// this is a wrapper around the array class defined above which allow to wok
// with values of natural wxTreeItemId type instead of using wxTreeItemIdValue
// and does it without any loss of efficiency
class wxArrayTreeItemIds : public wxArrayTreeItemIdsBase
{
public:
void Add(const wxTreeItemId& id)
{ wxArrayTreeItemIdsBase::Add(id.m_pItem); }
void Insert(const wxTreeItemId& id, size_t pos)
{ wxArrayTreeItemIdsBase::Insert(id.m_pItem, pos); }
wxTreeItemId Item(size_t i) const
{ return wxTreeItemId(wxArrayTreeItemIdsBase::Item(i)); }
wxTreeItemId operator[](size_t i) const { return Item(i); }
};
// ----------------------------------------------------------------------------
// constants
// ----------------------------------------------------------------------------
// enum for different images associated with a treectrl item
enum wxTreeItemIcon
{
wxTreeItemIcon_Normal, // not selected, not expanded
wxTreeItemIcon_Selected, // selected, not expanded
wxTreeItemIcon_Expanded, // not selected, expanded
wxTreeItemIcon_SelectedExpanded, // selected, expanded
wxTreeItemIcon_Max
};
// special values for the 'state' parameter of wxTreeCtrl::SetItemState()
static const int wxTREE_ITEMSTATE_NONE = -1; // not state (no display state image)
static const int wxTREE_ITEMSTATE_NEXT = -2; // cycle to the next state
static const int wxTREE_ITEMSTATE_PREV = -3; // cycle to the previous state
// ----------------------------------------------------------------------------
// wxTreeCtrl flags
// ----------------------------------------------------------------------------
#define wxTR_NO_BUTTONS 0x0000 // for convenience
#define wxTR_HAS_BUTTONS 0x0001 // draw collapsed/expanded btns
#define wxTR_NO_LINES 0x0004 // don't draw lines at all
#define wxTR_LINES_AT_ROOT 0x0008 // connect top-level nodes
#define wxTR_TWIST_BUTTONS 0x0010 // still used by wxTreeListCtrl
#define wxTR_SINGLE 0x0000 // for convenience
#define wxTR_MULTIPLE 0x0020 // can select multiple items
#if WXWIN_COMPATIBILITY_2_8
#define wxTR_EXTENDED 0x0040 // deprecated, don't use
#endif // WXWIN_COMPATIBILITY_2_8
#define wxTR_HAS_VARIABLE_ROW_HEIGHT 0x0080 // what it says
#define wxTR_EDIT_LABELS 0x0200 // can edit item labels
#define wxTR_ROW_LINES 0x0400 // put border around items
#define wxTR_HIDE_ROOT 0x0800 // don't display root node
#define wxTR_FULL_ROW_HIGHLIGHT 0x2000 // highlight full horz space
// make the default control appearance look more native-like depending on the
// platform
#if defined(__WXGTK20__)
#define wxTR_DEFAULT_STYLE (wxTR_HAS_BUTTONS | wxTR_NO_LINES)
#elif defined(__WXMAC__)
#define wxTR_DEFAULT_STYLE \
(wxTR_HAS_BUTTONS | wxTR_NO_LINES | wxTR_FULL_ROW_HIGHLIGHT)
#else
#define wxTR_DEFAULT_STYLE (wxTR_HAS_BUTTONS | wxTR_LINES_AT_ROOT)
#endif
// values for the `flags' parameter of wxTreeCtrl::HitTest() which determine
// where exactly the specified point is situated:
static const int wxTREE_HITTEST_ABOVE = 0x0001;
static const int wxTREE_HITTEST_BELOW = 0x0002;
static const int wxTREE_HITTEST_NOWHERE = 0x0004;
// on the button associated with an item.
static const int wxTREE_HITTEST_ONITEMBUTTON = 0x0008;
// on the bitmap associated with an item.
static const int wxTREE_HITTEST_ONITEMICON = 0x0010;
// on the indent associated with an item.
static const int wxTREE_HITTEST_ONITEMINDENT = 0x0020;
// on the label (string) associated with an item.
static const int wxTREE_HITTEST_ONITEMLABEL = 0x0040;
// on the right of the label associated with an item.
static const int wxTREE_HITTEST_ONITEMRIGHT = 0x0080;
// on the label (string) associated with an item.
static const int wxTREE_HITTEST_ONITEMSTATEICON = 0x0100;
// on the left of the wxTreeCtrl.
static const int wxTREE_HITTEST_TOLEFT = 0x0200;
// on the right of the wxTreeCtrl.
static const int wxTREE_HITTEST_TORIGHT = 0x0400;
// on the upper part (first half) of the item.
static const int wxTREE_HITTEST_ONITEMUPPERPART = 0x0800;
// on the lower part (second half) of the item.
static const int wxTREE_HITTEST_ONITEMLOWERPART = 0x1000;
// anywhere on the item
static const int wxTREE_HITTEST_ONITEM = wxTREE_HITTEST_ONITEMICON |
wxTREE_HITTEST_ONITEMLABEL;
// tree ctrl default name
extern WXDLLIMPEXP_DATA_CORE(const char) wxTreeCtrlNameStr[];
// ----------------------------------------------------------------------------
// wxTreeEvent is a special class for all events associated with tree controls
//
// NB: note that not all accessors make sense for all events, see the event
// descriptions below
// ----------------------------------------------------------------------------
class WXDLLIMPEXP_FWD_CORE wxTreeCtrlBase;
class WXDLLIMPEXP_CORE wxTreeEvent : public wxNotifyEvent
{
public:
wxTreeEvent(wxEventType commandType = wxEVT_NULL, int id = 0);
wxTreeEvent(wxEventType commandType,
wxTreeCtrlBase *tree,
const wxTreeItemId &item = wxTreeItemId());
wxTreeEvent(const wxTreeEvent& event);
virtual wxEvent *Clone() const wxOVERRIDE { return new wxTreeEvent(*this); }
// accessors
// get the item on which the operation was performed or the newly
// selected item for wxEVT_TREE_SEL_CHANGED/ING events
wxTreeItemId GetItem() const { return m_item; }
void SetItem(const wxTreeItemId& item) { m_item = item; }
// for wxEVT_TREE_SEL_CHANGED/ING events, get the previously
// selected item
wxTreeItemId GetOldItem() const { return m_itemOld; }
void SetOldItem(const wxTreeItemId& item) { m_itemOld = item; }
// the point where the mouse was when the drag operation started (for
// wxEVT_TREE_BEGIN_(R)DRAG events only) or click position
wxPoint GetPoint() const { return m_pointDrag; }
void SetPoint(const wxPoint& pt) { m_pointDrag = pt; }
// keyboard data (for wxEVT_TREE_KEY_DOWN only)
const wxKeyEvent& GetKeyEvent() const { return m_evtKey; }
int GetKeyCode() const { return m_evtKey.GetKeyCode(); }
void SetKeyEvent(const wxKeyEvent& evt) { m_evtKey = evt; }
// label (for EVT_TREE_{BEGIN|END}_LABEL_EDIT only)
const wxString& GetLabel() const { return m_label; }
void SetLabel(const wxString& label) { m_label = label; }
// edit cancel flag (for EVT_TREE_{BEGIN|END}_LABEL_EDIT only)
bool IsEditCancelled() const { return m_editCancelled; }
void SetEditCanceled(bool editCancelled) { m_editCancelled = editCancelled; }
// Set the tooltip for the item (for EVT_TREE_ITEM_GETTOOLTIP events)
void SetToolTip(const wxString& toolTip) { m_label = toolTip; }
wxString GetToolTip() const { return m_label; }
private:
// not all of the members are used (or initialized) for all events
wxKeyEvent m_evtKey;
wxTreeItemId m_item,
m_itemOld;
wxPoint m_pointDrag;
wxString m_label;
bool m_editCancelled;
friend class WXDLLIMPEXP_FWD_CORE wxTreeCtrl;
friend class WXDLLIMPEXP_FWD_CORE wxGenericTreeCtrl;
wxDECLARE_DYNAMIC_CLASS(wxTreeEvent);
};
typedef void (wxEvtHandler::*wxTreeEventFunction)(wxTreeEvent&);
// ----------------------------------------------------------------------------
// tree control events and macros for handling them
// ----------------------------------------------------------------------------
wxDECLARE_EXPORTED_EVENT( WXDLLIMPEXP_CORE, wxEVT_TREE_BEGIN_DRAG, wxTreeEvent );
wxDECLARE_EXPORTED_EVENT( WXDLLIMPEXP_CORE, wxEVT_TREE_BEGIN_RDRAG, wxTreeEvent );
wxDECLARE_EXPORTED_EVENT( WXDLLIMPEXP_CORE, wxEVT_TREE_BEGIN_LABEL_EDIT, wxTreeEvent );
wxDECLARE_EXPORTED_EVENT( WXDLLIMPEXP_CORE, wxEVT_TREE_END_LABEL_EDIT, wxTreeEvent );
wxDECLARE_EXPORTED_EVENT( WXDLLIMPEXP_CORE, wxEVT_TREE_DELETE_ITEM, wxTreeEvent );
wxDECLARE_EXPORTED_EVENT( WXDLLIMPEXP_CORE, wxEVT_TREE_GET_INFO, wxTreeEvent );
wxDECLARE_EXPORTED_EVENT( WXDLLIMPEXP_CORE, wxEVT_TREE_SET_INFO, wxTreeEvent );
wxDECLARE_EXPORTED_EVENT( WXDLLIMPEXP_CORE, wxEVT_TREE_ITEM_EXPANDED, wxTreeEvent );
wxDECLARE_EXPORTED_EVENT( WXDLLIMPEXP_CORE, wxEVT_TREE_ITEM_EXPANDING, wxTreeEvent );
wxDECLARE_EXPORTED_EVENT( WXDLLIMPEXP_CORE, wxEVT_TREE_ITEM_COLLAPSED, wxTreeEvent );
wxDECLARE_EXPORTED_EVENT( WXDLLIMPEXP_CORE, wxEVT_TREE_ITEM_COLLAPSING, wxTreeEvent );
wxDECLARE_EXPORTED_EVENT( WXDLLIMPEXP_CORE, wxEVT_TREE_SEL_CHANGED, wxTreeEvent );
wxDECLARE_EXPORTED_EVENT( WXDLLIMPEXP_CORE, wxEVT_TREE_SEL_CHANGING, wxTreeEvent );
wxDECLARE_EXPORTED_EVENT( WXDLLIMPEXP_CORE, wxEVT_TREE_KEY_DOWN, wxTreeEvent );
wxDECLARE_EXPORTED_EVENT( WXDLLIMPEXP_CORE, wxEVT_TREE_ITEM_ACTIVATED, wxTreeEvent );
wxDECLARE_EXPORTED_EVENT( WXDLLIMPEXP_CORE, wxEVT_TREE_ITEM_RIGHT_CLICK, wxTreeEvent );
wxDECLARE_EXPORTED_EVENT( WXDLLIMPEXP_CORE, wxEVT_TREE_ITEM_MIDDLE_CLICK, wxTreeEvent );
wxDECLARE_EXPORTED_EVENT( WXDLLIMPEXP_CORE, wxEVT_TREE_END_DRAG, wxTreeEvent );
wxDECLARE_EXPORTED_EVENT( WXDLLIMPEXP_CORE, wxEVT_TREE_STATE_IMAGE_CLICK, wxTreeEvent );
wxDECLARE_EXPORTED_EVENT( WXDLLIMPEXP_CORE, wxEVT_TREE_ITEM_GETTOOLTIP, wxTreeEvent );
wxDECLARE_EXPORTED_EVENT( WXDLLIMPEXP_CORE, wxEVT_TREE_ITEM_MENU, wxTreeEvent );
#define wxTreeEventHandler(func) \
wxEVENT_HANDLER_CAST(wxTreeEventFunction, func)
#define wx__DECLARE_TREEEVT(evt, id, fn) \
wx__DECLARE_EVT1(wxEVT_TREE_ ## evt, id, wxTreeEventHandler(fn))
// GetItem() returns the item being dragged, GetPoint() the mouse coords
//
// if you call event.Allow(), the drag operation will start and a
// EVT_TREE_END_DRAG event will be sent when the drag is over.
#define EVT_TREE_BEGIN_DRAG(id, fn) wx__DECLARE_TREEEVT(BEGIN_DRAG, id, fn)
#define EVT_TREE_BEGIN_RDRAG(id, fn) wx__DECLARE_TREEEVT(BEGIN_RDRAG, id, fn)
// GetItem() is the item on which the drop occurred (if any) and GetPoint() the
// current mouse coords
#define EVT_TREE_END_DRAG(id, fn) wx__DECLARE_TREEEVT(END_DRAG, id, fn)
// GetItem() returns the itme whose label is being edited, GetLabel() returns
// the current item label for BEGIN and the would be new one for END.
//
// Vetoing BEGIN event means that label editing won't happen at all,
// vetoing END means that the new value is discarded and the old one kept
#define EVT_TREE_BEGIN_LABEL_EDIT(id, fn) wx__DECLARE_TREEEVT(BEGIN_LABEL_EDIT, id, fn)
#define EVT_TREE_END_LABEL_EDIT(id, fn) wx__DECLARE_TREEEVT(END_LABEL_EDIT, id, fn)
// provide/update information about GetItem() item
#define EVT_TREE_GET_INFO(id, fn) wx__DECLARE_TREEEVT(GET_INFO, id, fn)
#define EVT_TREE_SET_INFO(id, fn) wx__DECLARE_TREEEVT(SET_INFO, id, fn)
// GetItem() is the item being expanded/collapsed, the "ING" versions can use
#define EVT_TREE_ITEM_EXPANDED(id, fn) wx__DECLARE_TREEEVT(ITEM_EXPANDED, id, fn)
#define EVT_TREE_ITEM_EXPANDING(id, fn) wx__DECLARE_TREEEVT(ITEM_EXPANDING, id, fn)
#define EVT_TREE_ITEM_COLLAPSED(id, fn) wx__DECLARE_TREEEVT(ITEM_COLLAPSED, id, fn)
#define EVT_TREE_ITEM_COLLAPSING(id, fn) wx__DECLARE_TREEEVT(ITEM_COLLAPSING, id, fn)
// GetOldItem() is the item which had the selection previously, GetItem() is
// the item which acquires selection
#define EVT_TREE_SEL_CHANGED(id, fn) wx__DECLARE_TREEEVT(SEL_CHANGED, id, fn)
#define EVT_TREE_SEL_CHANGING(id, fn) wx__DECLARE_TREEEVT(SEL_CHANGING, id, fn)
// GetKeyCode() returns the key code
// NB: this is the only message for which GetItem() is invalid (you may get the
// item from GetSelection())
#define EVT_TREE_KEY_DOWN(id, fn) wx__DECLARE_TREEEVT(KEY_DOWN, id, fn)
// GetItem() returns the item being deleted, the associated data (if any) will
// be deleted just after the return of this event handler (if any)
#define EVT_TREE_DELETE_ITEM(id, fn) wx__DECLARE_TREEEVT(DELETE_ITEM, id, fn)
// GetItem() returns the item that was activated (double click, enter, space)
#define EVT_TREE_ITEM_ACTIVATED(id, fn) wx__DECLARE_TREEEVT(ITEM_ACTIVATED, id, fn)
// GetItem() returns the item for which the context menu shall be shown
#define EVT_TREE_ITEM_MENU(id, fn) wx__DECLARE_TREEEVT(ITEM_MENU, id, fn)
// GetItem() returns the item that was clicked on
#define EVT_TREE_ITEM_RIGHT_CLICK(id, fn) wx__DECLARE_TREEEVT(ITEM_RIGHT_CLICK, id, fn)
#define EVT_TREE_ITEM_MIDDLE_CLICK(id, fn) wx__DECLARE_TREEEVT(ITEM_MIDDLE_CLICK, id, fn)
// GetItem() returns the item whose state image was clicked on
#define EVT_TREE_STATE_IMAGE_CLICK(id, fn) wx__DECLARE_TREEEVT(STATE_IMAGE_CLICK, id, fn)
// GetItem() is the item for which the tooltip is being requested
#define EVT_TREE_ITEM_GETTOOLTIP(id, fn) wx__DECLARE_TREEEVT(ITEM_GETTOOLTIP, id, fn)
// old wxEVT_COMMAND_* constants
#define wxEVT_COMMAND_TREE_BEGIN_DRAG wxEVT_TREE_BEGIN_DRAG
#define wxEVT_COMMAND_TREE_BEGIN_RDRAG wxEVT_TREE_BEGIN_RDRAG
#define wxEVT_COMMAND_TREE_BEGIN_LABEL_EDIT wxEVT_TREE_BEGIN_LABEL_EDIT
#define wxEVT_COMMAND_TREE_END_LABEL_EDIT wxEVT_TREE_END_LABEL_EDIT
#define wxEVT_COMMAND_TREE_DELETE_ITEM wxEVT_TREE_DELETE_ITEM
#define wxEVT_COMMAND_TREE_GET_INFO wxEVT_TREE_GET_INFO
#define wxEVT_COMMAND_TREE_SET_INFO wxEVT_TREE_SET_INFO
#define wxEVT_COMMAND_TREE_ITEM_EXPANDED wxEVT_TREE_ITEM_EXPANDED
#define wxEVT_COMMAND_TREE_ITEM_EXPANDING wxEVT_TREE_ITEM_EXPANDING
#define wxEVT_COMMAND_TREE_ITEM_COLLAPSED wxEVT_TREE_ITEM_COLLAPSED
#define wxEVT_COMMAND_TREE_ITEM_COLLAPSING wxEVT_TREE_ITEM_COLLAPSING
#define wxEVT_COMMAND_TREE_SEL_CHANGED wxEVT_TREE_SEL_CHANGED
#define wxEVT_COMMAND_TREE_SEL_CHANGING wxEVT_TREE_SEL_CHANGING
#define wxEVT_COMMAND_TREE_KEY_DOWN wxEVT_TREE_KEY_DOWN
#define wxEVT_COMMAND_TREE_ITEM_ACTIVATED wxEVT_TREE_ITEM_ACTIVATED
#define wxEVT_COMMAND_TREE_ITEM_RIGHT_CLICK wxEVT_TREE_ITEM_RIGHT_CLICK
#define wxEVT_COMMAND_TREE_ITEM_MIDDLE_CLICK wxEVT_TREE_ITEM_MIDDLE_CLICK
#define wxEVT_COMMAND_TREE_END_DRAG wxEVT_TREE_END_DRAG
#define wxEVT_COMMAND_TREE_STATE_IMAGE_CLICK wxEVT_TREE_STATE_IMAGE_CLICK
#define wxEVT_COMMAND_TREE_ITEM_GETTOOLTIP wxEVT_TREE_ITEM_GETTOOLTIP
#define wxEVT_COMMAND_TREE_ITEM_MENU wxEVT_TREE_ITEM_MENU
#endif // wxUSE_TREECTRL
#endif // _WX_TREEBASE_H_
| h |
rticonnextdds-usecases | data/projects/rticonnextdds-usecases/VehicleTracking/ExampleCode/thirdparty/wxWidgets-3.1.2/Linux/include/wx/stringimpl.h | ///////////////////////////////////////////////////////////////////////////////
// Name: wx/stringimpl.h
// Purpose: wxStringImpl class, implementation of wxString
// Author: Vadim Zeitlin
// Modified by:
// Created: 29/01/98
// Copyright: (c) 1998 Vadim Zeitlin <[email protected]>
// Licence: wxWindows licence
///////////////////////////////////////////////////////////////////////////////
/*
This header implements std::string-like string class, wxStringImpl, that is
used by wxString to store the data. Alternatively, if wxUSE_STD_STRING=1,
wxStringImpl is just a typedef to std:: string class.
*/
#ifndef _WX_WXSTRINGIMPL_H__
#define _WX_WXSTRINGIMPL_H__
// ----------------------------------------------------------------------------
// headers
// ----------------------------------------------------------------------------
#include "wx/defs.h" // everybody should include this
#include "wx/chartype.h" // for wxChar
#include "wx/wxcrtbase.h" // for wxStrlen() etc.
#include <stdlib.h>
// ---------------------------------------------------------------------------
// macros
// ---------------------------------------------------------------------------
// implementation only
#define wxASSERT_VALID_INDEX(i) \
wxASSERT_MSG( (size_t)(i) <= length(), wxT("invalid index in wxString") )
// ----------------------------------------------------------------------------
// global data
// ----------------------------------------------------------------------------
// global pointer to empty string
extern WXDLLIMPEXP_DATA_BASE(const wxChar*) wxEmptyString;
#if wxUSE_UNICODE_UTF8
// FIXME-UTF8: we should have only one wxEmptyString
extern WXDLLIMPEXP_DATA_BASE(const wxStringCharType*) wxEmptyStringImpl;
#endif
// ----------------------------------------------------------------------------
// deal with various build options
// ----------------------------------------------------------------------------
// we use STL-based string internally if we use std::string at all now, there
// should be no reason to prefer our internal implement but if you really need
// it you can predefine wxUSE_STL_BASED_WXSTRING as 0 when building the library
#ifndef wxUSE_STL_BASED_WXSTRING
#define wxUSE_STL_BASED_WXSTRING wxUSE_STD_STRING
#endif
// in both cases we need to define wxStdString
#if wxUSE_STL_BASED_WXSTRING || wxUSE_STD_STRING
#include "wx/beforestd.h"
#include <string>
#include "wx/afterstd.h"
#ifdef HAVE_STD_WSTRING
typedef std::wstring wxStdWideString;
#else
typedef std::basic_string<wchar_t> wxStdWideString;
#endif
#if wxUSE_UNICODE_WCHAR
typedef wxStdWideString wxStdString;
#else
typedef std::string wxStdString;
#endif
#endif // wxUSE_STL_BASED_WXSTRING || wxUSE_STD_STRING
#if wxUSE_STL_BASED_WXSTRING
// we always want ctor from std::string when using std::string internally
#undef wxUSE_STD_STRING
#define wxUSE_STD_STRING 1
typedef wxStdString wxStringImpl;
#else // if !wxUSE_STL_BASED_WXSTRING
// in non-STL mode, compare() is implemented in wxString and not wxStringImpl
#undef HAVE_STD_STRING_COMPARE
// ---------------------------------------------------------------------------
// string data prepended with some housekeeping info (used by wxString class),
// is never used directly (but had to be put here to allow inlining)
// ---------------------------------------------------------------------------
struct WXDLLIMPEXP_BASE wxStringData
{
int nRefs; // reference count
size_t nDataLength, // actual string length
nAllocLength; // allocated memory size
// mimics declaration 'wxStringCharType data[nAllocLength]'
wxStringCharType* data() const { return (wxStringCharType*)(this + 1); }
// empty string has a special ref count so it's never deleted
bool IsEmpty() const { return (nRefs == -1); }
bool IsShared() const { return (nRefs > 1); }
// lock/unlock
void Lock() { if ( !IsEmpty() ) nRefs++; }
// VC++ will refuse to inline Unlock but profiling shows that it is wrong
#if defined(__VISUALC__)
__forceinline
#endif
// VC++ free must take place in same DLL as allocation when using non dll
// run-time library (e.g. Multithreaded instead of Multithreaded DLL)
#if defined(__VISUALC__) && defined(_MT) && !defined(_DLL)
void Unlock() { if ( !IsEmpty() && --nRefs == 0) Free(); }
// we must not inline deallocation since allocation is not inlined
void Free();
#else
void Unlock() { if ( !IsEmpty() && --nRefs == 0) free(this); }
#endif
// if we had taken control over string memory (GetWriteBuf), it's
// intentionally put in invalid state
void Validate(bool b) { nRefs = (b ? 1 : 0); }
bool IsValid() const { return (nRefs != 0); }
};
class WXDLLIMPEXP_BASE wxStringImpl
{
public:
// an 'invalid' value for string index, moved to this place due to a CW bug
static const size_t npos;
protected:
// points to data preceded by wxStringData structure with ref count info
wxStringCharType *m_pchData;
// accessor to string data
wxStringData* GetStringData() const { return (wxStringData*)m_pchData - 1; }
// string (re)initialization functions
// initializes the string to the empty value (must be called only from
// ctors, use Reinit() otherwise)
#if wxUSE_UNICODE_UTF8
void Init() { m_pchData = (wxStringCharType *)wxEmptyStringImpl; } // FIXME-UTF8
#else
void Init() { m_pchData = (wxStringCharType *)wxEmptyString; }
#endif
// initializes the string with (a part of) C-string
void InitWith(const wxStringCharType *psz, size_t nPos = 0, size_t nLen = npos);
// as Init, but also frees old data
void Reinit() { GetStringData()->Unlock(); Init(); }
// memory allocation
// allocates memory for string of length nLen
bool AllocBuffer(size_t nLen);
// effectively copies data to string
bool AssignCopy(size_t, const wxStringCharType *);
// append a (sub)string
bool ConcatSelf(size_t nLen, const wxStringCharType *src, size_t nMaxLen);
bool ConcatSelf(size_t nLen, const wxStringCharType *src)
{ return ConcatSelf(nLen, src, nLen); }
// functions called before writing to the string: they copy it if there
// are other references to our data (should be the only owner when writing)
bool CopyBeforeWrite();
bool AllocBeforeWrite(size_t);
// compatibility with wxString
bool Alloc(size_t nLen);
public:
// standard types
typedef wxStringCharType value_type;
typedef wxStringCharType char_type;
typedef size_t size_type;
typedef value_type& reference;
typedef const value_type& const_reference;
typedef value_type* pointer;
typedef const value_type* const_pointer;
// macro to define the bulk of iterator and const_iterator classes
#define WX_DEFINE_STRINGIMPL_ITERATOR(iterator_name, ref_type, ptr_type) \
public: \
typedef wxStringCharType value_type; \
typedef ref_type reference; \
typedef ptr_type pointer; \
typedef int difference_type; \
\
iterator_name() : m_ptr(NULL) { } \
iterator_name(pointer ptr) : m_ptr(ptr) { } \
\
reference operator*() const { return *m_ptr; } \
\
iterator_name& operator++() { m_ptr++; return *this; } \
iterator_name operator++(int) \
{ \
const iterator_name tmp(*this); \
m_ptr++; \
return tmp; \
} \
\
iterator_name& operator--() { m_ptr--; return *this; } \
iterator_name operator--(int) \
{ \
const iterator_name tmp(*this); \
m_ptr--; \
return tmp; \
} \
\
iterator_name operator+(ptrdiff_t n) const \
{ return iterator_name(m_ptr + n); } \
iterator_name operator-(ptrdiff_t n) const \
{ return iterator_name(m_ptr - n); } \
iterator_name& operator+=(ptrdiff_t n) \
{ m_ptr += n; return *this; } \
iterator_name& operator-=(ptrdiff_t n) \
{ m_ptr -= n; return *this; } \
\
difference_type operator-(const iterator_name& i) const \
{ return m_ptr - i.m_ptr; } \
\
bool operator==(const iterator_name& i) const \
{ return m_ptr == i.m_ptr; } \
bool operator!=(const iterator_name& i) const \
{ return m_ptr != i.m_ptr; } \
\
bool operator<(const iterator_name& i) const \
{ return m_ptr < i.m_ptr; } \
bool operator>(const iterator_name& i) const \
{ return m_ptr > i.m_ptr; } \
bool operator<=(const iterator_name& i) const \
{ return m_ptr <= i.m_ptr; } \
bool operator>=(const iterator_name& i) const \
{ return m_ptr >= i.m_ptr; } \
\
private: \
/* for wxStringImpl use only */ \
pointer GetPtr() const { return m_ptr; } \
\
friend class wxStringImpl; \
\
pointer m_ptr
// we need to declare const_iterator in wxStringImpl scope, the friend
// declaration inside iterator class itself is not enough, or at least not
// for g++ 3.4 (g++ 4 is ok)
class WXDLLIMPEXP_FWD_BASE const_iterator;
class WXDLLIMPEXP_BASE iterator
{
WX_DEFINE_STRINGIMPL_ITERATOR(iterator,
wxStringCharType&,
wxStringCharType*);
friend class const_iterator;
};
class WXDLLIMPEXP_BASE const_iterator
{
public:
const_iterator(iterator i) : m_ptr(i.m_ptr) { }
WX_DEFINE_STRINGIMPL_ITERATOR(const_iterator,
const wxStringCharType&,
const wxStringCharType*);
};
#undef WX_DEFINE_STRINGIMPL_ITERATOR
// constructors and destructor
// ctor for an empty string
wxStringImpl() { Init(); }
// copy ctor
wxStringImpl(const wxStringImpl& stringSrc)
{
wxASSERT_MSG( stringSrc.GetStringData()->IsValid(),
wxT("did you forget to call UngetWriteBuf()?") );
if ( stringSrc.empty() ) {
// nothing to do for an empty string
Init();
}
else {
m_pchData = stringSrc.m_pchData; // share same data
GetStringData()->Lock(); // => one more copy
}
}
// string containing nRepeat copies of ch
wxStringImpl(size_type nRepeat, wxStringCharType ch);
// ctor takes first nLength characters from C string
// (default value of npos means take all the string)
wxStringImpl(const wxStringCharType *psz)
{ InitWith(psz, 0, npos); }
wxStringImpl(const wxStringCharType *psz, size_t nLength)
{ InitWith(psz, 0, nLength); }
// take nLen chars starting at nPos
wxStringImpl(const wxStringImpl& str, size_t nPos, size_t nLen)
{
wxASSERT_MSG( str.GetStringData()->IsValid(),
wxT("did you forget to call UngetWriteBuf()?") );
Init();
size_t strLen = str.length() - nPos; nLen = strLen < nLen ? strLen : nLen;
InitWith(str.c_str(), nPos, nLen);
}
// take everything between start and end
wxStringImpl(const_iterator start, const_iterator end);
// ctor from and conversion to std::string
#if wxUSE_STD_STRING
wxStringImpl(const wxStdString& impl)
{ InitWith(impl.c_str(), 0, impl.length()); }
operator wxStdString() const
{ return wxStdString(c_str(), length()); }
#endif
#if defined(__VISUALC__)
// disable warning about Unlock() below not being inlined (first, it
// seems to be inlined nevertheless and second, even if it isn't, there
// is nothing we can do about this
#pragma warning(push)
#pragma warning (disable:4714)
#endif
// dtor is not virtual, this class must not be inherited from!
~wxStringImpl()
{
GetStringData()->Unlock();
}
#if defined(__VISUALC__)
#pragma warning(pop)
#endif
// overloaded assignment
// from another wxString
wxStringImpl& operator=(const wxStringImpl& stringSrc);
// from a character
wxStringImpl& operator=(wxStringCharType ch);
// from a C string
wxStringImpl& operator=(const wxStringCharType *psz);
// return the length of the string
size_type length() const { return GetStringData()->nDataLength; }
// return the length of the string
size_type size() const { return length(); }
// return the maximum size of the string
size_type max_size() const { return npos; }
// resize the string, filling the space with c if c != 0
void resize(size_t nSize, wxStringCharType ch = '\0');
// delete the contents of the string
void clear() { erase(0, npos); }
// returns true if the string is empty
bool empty() const { return length() == 0; }
// inform string about planned change in size
void reserve(size_t sz) { Alloc(sz); }
size_type capacity() const { return GetStringData()->nAllocLength; }
// lib.string.access
// return the character at position n
value_type operator[](size_type n) const { return m_pchData[n]; }
value_type at(size_type n) const
{ wxASSERT_VALID_INDEX( n ); return m_pchData[n]; }
// returns the writable character at position n
reference operator[](size_type n) { CopyBeforeWrite(); return m_pchData[n]; }
reference at(size_type n)
{
wxASSERT_VALID_INDEX( n );
CopyBeforeWrite();
return m_pchData[n];
} // FIXME-UTF8: not useful for us...?
// lib.string.modifiers
// append elements str[pos], ..., str[pos+n]
wxStringImpl& append(const wxStringImpl& str, size_t pos, size_t n)
{
wxASSERT(pos <= str.length());
ConcatSelf(n, str.c_str() + pos, str.length() - pos);
return *this;
}
// append a string
wxStringImpl& append(const wxStringImpl& str)
{ ConcatSelf(str.length(), str.c_str()); return *this; }
// append first n (or all if n == npos) characters of sz
wxStringImpl& append(const wxStringCharType *sz)
{ ConcatSelf(wxStrlen(sz), sz); return *this; }
wxStringImpl& append(const wxStringCharType *sz, size_t n)
{ ConcatSelf(n, sz); return *this; }
// append n copies of ch
wxStringImpl& append(size_t n, wxStringCharType ch);
// append from first to last
wxStringImpl& append(const_iterator first, const_iterator last)
{ ConcatSelf(last - first, first.GetPtr()); return *this; }
// same as `this_string = str'
wxStringImpl& assign(const wxStringImpl& str)
{ return *this = str; }
// same as ` = str[pos..pos + n]
wxStringImpl& assign(const wxStringImpl& str, size_t pos, size_t n)
{ return replace(0, npos, str, pos, n); }
// same as `= first n (or all if n == npos) characters of sz'
wxStringImpl& assign(const wxStringCharType *sz)
{ return replace(0, npos, sz, wxStrlen(sz)); }
wxStringImpl& assign(const wxStringCharType *sz, size_t n)
{ return replace(0, npos, sz, n); }
// same as `= n copies of ch'
wxStringImpl& assign(size_t n, wxStringCharType ch)
{ return replace(0, npos, n, ch); }
// assign from first to last
wxStringImpl& assign(const_iterator first, const_iterator last)
{ return replace(begin(), end(), first, last); }
// first valid index position
const_iterator begin() const { return m_pchData; }
iterator begin();
// position one after the last valid one
const_iterator end() const { return m_pchData + length(); }
iterator end();
// insert another string
wxStringImpl& insert(size_t nPos, const wxStringImpl& str)
{
wxASSERT( str.GetStringData()->IsValid() );
return insert(nPos, str.c_str(), str.length());
}
// insert n chars of str starting at nStart (in str)
wxStringImpl& insert(size_t nPos, const wxStringImpl& str, size_t nStart, size_t n)
{
wxASSERT( str.GetStringData()->IsValid() );
wxASSERT( nStart < str.length() );
size_t strLen = str.length() - nStart;
n = strLen < n ? strLen : n;
return insert(nPos, str.c_str() + nStart, n);
}
// insert first n (or all if n == npos) characters of sz
wxStringImpl& insert(size_t nPos, const wxStringCharType *sz, size_t n = npos);
// insert n copies of ch
wxStringImpl& insert(size_t nPos, size_t n, wxStringCharType ch)
{ return insert(nPos, wxStringImpl(n, ch)); }
iterator insert(iterator it, wxStringCharType ch)
{ size_t idx = it - begin(); insert(idx, 1, ch); return begin() + idx; }
void insert(iterator it, const_iterator first, const_iterator last)
{ insert(it - begin(), first.GetPtr(), last - first); }
void insert(iterator it, size_type n, wxStringCharType ch)
{ insert(it - begin(), n, ch); }
// delete characters from nStart to nStart + nLen
wxStringImpl& erase(size_type pos = 0, size_type n = npos);
iterator erase(iterator first, iterator last)
{
size_t idx = first - begin();
erase(idx, last - first);
return begin() + idx;
}
iterator erase(iterator first);
// explicit conversion to C string (use this with printf()!)
const wxStringCharType* c_str() const { return m_pchData; }
const wxStringCharType* data() const { return m_pchData; }
// replaces the substring of length nLen starting at nStart
wxStringImpl& replace(size_t nStart, size_t nLen, const wxStringCharType* sz)
{ return replace(nStart, nLen, sz, npos); }
// replaces the substring of length nLen starting at nStart
wxStringImpl& replace(size_t nStart, size_t nLen, const wxStringImpl& str)
{ return replace(nStart, nLen, str.c_str(), str.length()); }
// replaces the substring with nCount copies of ch
wxStringImpl& replace(size_t nStart, size_t nLen,
size_t nCount, wxStringCharType ch)
{ return replace(nStart, nLen, wxStringImpl(nCount, ch)); }
// replaces a substring with another substring
wxStringImpl& replace(size_t nStart, size_t nLen,
const wxStringImpl& str, size_t nStart2, size_t nLen2)
{ return replace(nStart, nLen, str.substr(nStart2, nLen2)); }
// replaces the substring with first nCount chars of sz
wxStringImpl& replace(size_t nStart, size_t nLen,
const wxStringCharType* sz, size_t nCount);
wxStringImpl& replace(iterator first, iterator last, const_pointer s)
{ return replace(first - begin(), last - first, s); }
wxStringImpl& replace(iterator first, iterator last, const_pointer s,
size_type n)
{ return replace(first - begin(), last - first, s, n); }
wxStringImpl& replace(iterator first, iterator last, const wxStringImpl& s)
{ return replace(first - begin(), last - first, s); }
wxStringImpl& replace(iterator first, iterator last, size_type n, wxStringCharType c)
{ return replace(first - begin(), last - first, n, c); }
wxStringImpl& replace(iterator first, iterator last,
const_iterator first1, const_iterator last1)
{ return replace(first - begin(), last - first, first1.GetPtr(), last1 - first1); }
// swap two strings
void swap(wxStringImpl& str);
// All find() functions take the nStart argument which specifies the
// position to start the search on, the default value is 0. All functions
// return npos if there were no match.
// find a substring
size_t find(const wxStringImpl& str, size_t nStart = 0) const;
// find first n characters of sz
size_t find(const wxStringCharType* sz, size_t nStart = 0, size_t n = npos) const;
// find the first occurrence of character ch after nStart
size_t find(wxStringCharType ch, size_t nStart = 0) const;
// rfind() family is exactly like find() but works right to left
// as find, but from the end
size_t rfind(const wxStringImpl& str, size_t nStart = npos) const;
// as find, but from the end
size_t rfind(const wxStringCharType* sz, size_t nStart = npos,
size_t n = npos) const;
// as find, but from the end
size_t rfind(wxStringCharType ch, size_t nStart = npos) const;
size_type copy(wxStringCharType* s, size_type n, size_type pos = 0);
// substring extraction
wxStringImpl substr(size_t nStart = 0, size_t nLen = npos) const;
// string += string
wxStringImpl& operator+=(const wxStringImpl& s) { return append(s); }
// string += C string
wxStringImpl& operator+=(const wxStringCharType *psz) { return append(psz); }
// string += char
wxStringImpl& operator+=(wxStringCharType ch) { return append(1, ch); }
// helpers for wxStringBuffer and wxStringBufferLength
wxStringCharType *DoGetWriteBuf(size_t nLen);
void DoUngetWriteBuf();
void DoUngetWriteBuf(size_t nLen);
friend class WXDLLIMPEXP_FWD_BASE wxString;
};
#endif // !wxUSE_STL_BASED_WXSTRING
// don't pollute the library user's name space
#undef wxASSERT_VALID_INDEX
#endif // _WX_WXSTRINGIMPL_H__
| h |
rticonnextdds-usecases | data/projects/rticonnextdds-usecases/VehicleTracking/ExampleCode/thirdparty/wxWidgets-3.1.2/Linux/include/wx/joystick.h | /////////////////////////////////////////////////////////////////////////////
// Name: wx/joystick.h
// Purpose: wxJoystick base header
// Author: wxWidgets Team
// Modified by:
// Created:
// Copyright: (c) wxWidgets Team
// Licence: wxWindows licence
/////////////////////////////////////////////////////////////////////////////
#ifndef _WX_JOYSTICK_H_BASE_
#define _WX_JOYSTICK_H_BASE_
#include "wx/defs.h"
#if wxUSE_JOYSTICK
#if defined(__WINDOWS__)
#include "wx/msw/joystick.h"
#elif defined(__WXMOTIF__)
#include "wx/unix/joystick.h"
#elif defined(__WXGTK__)
#include "wx/unix/joystick.h"
#elif defined(__WXX11__)
#include "wx/unix/joystick.h"
#elif defined(__DARWIN__)
#include "wx/osx/core/joystick.h"
#elif defined(__WXMAC__)
#include "wx/osx/joystick.h"
#elif defined(__WXQT__)
#include "wx/unix/joystick.h"
#endif
#endif // wxUSE_JOYSTICK
#endif
// _WX_JOYSTICK_H_BASE_
| h |
rticonnextdds-usecases | data/projects/rticonnextdds-usecases/VehicleTracking/ExampleCode/thirdparty/wxWidgets-3.1.2/Linux/include/wx/brush.h | /////////////////////////////////////////////////////////////////////////////
// Name: wx/brush.h
// Purpose: Includes platform-specific wxBrush file
// Author: Julian Smart
// Modified by:
// Created:
// Copyright: Julian Smart
// Licence: wxWindows Licence
/////////////////////////////////////////////////////////////////////////////
#ifndef _WX_BRUSH_H_BASE_
#define _WX_BRUSH_H_BASE_
#include "wx/defs.h"
#include "wx/object.h"
#include "wx/gdiobj.h"
#include "wx/gdicmn.h" // for wxGDIObjListBase
// NOTE: these values cannot be combined together!
enum wxBrushStyle
{
wxBRUSHSTYLE_INVALID = -1,
wxBRUSHSTYLE_SOLID = wxSOLID,
wxBRUSHSTYLE_TRANSPARENT = wxTRANSPARENT,
wxBRUSHSTYLE_STIPPLE_MASK_OPAQUE = wxSTIPPLE_MASK_OPAQUE,
wxBRUSHSTYLE_STIPPLE_MASK = wxSTIPPLE_MASK,
wxBRUSHSTYLE_STIPPLE = wxSTIPPLE,
wxBRUSHSTYLE_BDIAGONAL_HATCH = wxHATCHSTYLE_BDIAGONAL,
wxBRUSHSTYLE_CROSSDIAG_HATCH = wxHATCHSTYLE_CROSSDIAG,
wxBRUSHSTYLE_FDIAGONAL_HATCH = wxHATCHSTYLE_FDIAGONAL,
wxBRUSHSTYLE_CROSS_HATCH = wxHATCHSTYLE_CROSS,
wxBRUSHSTYLE_HORIZONTAL_HATCH = wxHATCHSTYLE_HORIZONTAL,
wxBRUSHSTYLE_VERTICAL_HATCH = wxHATCHSTYLE_VERTICAL,
wxBRUSHSTYLE_FIRST_HATCH = wxHATCHSTYLE_FIRST,
wxBRUSHSTYLE_LAST_HATCH = wxHATCHSTYLE_LAST
};
// wxBrushBase
class WXDLLIMPEXP_CORE wxBrushBase: public wxGDIObject
{
public:
virtual ~wxBrushBase() { }
virtual void SetColour(const wxColour& col) = 0;
virtual void SetColour(unsigned char r, unsigned char g, unsigned char b) = 0;
virtual void SetStyle(wxBrushStyle style) = 0;
virtual void SetStipple(const wxBitmap& stipple) = 0;
virtual wxColour GetColour() const = 0;
virtual wxBrushStyle GetStyle() const = 0;
virtual wxBitmap *GetStipple() const = 0;
virtual bool IsHatch() const
{ return (GetStyle()>=wxBRUSHSTYLE_FIRST_HATCH) && (GetStyle()<=wxBRUSHSTYLE_LAST_HATCH); }
// Convenient helpers for testing whether the brush is a transparent one:
// unlike GetStyle() == wxBRUSHSTYLE_TRANSPARENT, they work correctly even
// if the brush is invalid (they both return false in this case).
bool IsTransparent() const
{
return IsOk() && GetStyle() == wxBRUSHSTYLE_TRANSPARENT;
}
bool IsNonTransparent() const
{
return IsOk() && GetStyle() != wxBRUSHSTYLE_TRANSPARENT;
}
};
#if defined(__WXMSW__)
#include "wx/msw/brush.h"
#elif defined(__WXMOTIF__) || defined(__WXX11__)
#include "wx/x11/brush.h"
#elif defined(__WXGTK20__)
#include "wx/gtk/brush.h"
#elif defined(__WXGTK__)
#include "wx/gtk1/brush.h"
#elif defined(__WXDFB__)
#include "wx/dfb/brush.h"
#elif defined(__WXMAC__)
#include "wx/osx/brush.h"
#elif defined(__WXQT__)
#include "wx/qt/brush.h"
#endif
class WXDLLIMPEXP_CORE wxBrushList: public wxGDIObjListBase
{
public:
wxBrush *FindOrCreateBrush(const wxColour& colour,
wxBrushStyle style = wxBRUSHSTYLE_SOLID);
wxDEPRECATED_MSG("use wxBRUSHSTYLE_XXX constants")
wxBrush *FindOrCreateBrush(const wxColour& colour, int style)
{ return FindOrCreateBrush(colour, (wxBrushStyle)style); }
};
extern WXDLLIMPEXP_DATA_CORE(wxBrushList*) wxTheBrushList;
// provide comparison operators to allow code such as
//
// if ( brush.GetStyle() == wxTRANSPARENT )
//
// to compile without warnings which it would otherwise provoke from some
// compilers as it compares elements of different enums
// Unfortunately some compilers have ambiguity issues when enum comparisons are
// overloaded so we have to disable the overloads in this case, see
// wxCOMPILER_NO_OVERLOAD_ON_ENUM definition in wx/platform.h for more details.
#ifndef wxCOMPILER_NO_OVERLOAD_ON_ENUM
wxDEPRECATED_MSG("use wxBRUSHSTYLE_XXX constants only")
inline bool operator==(wxBrushStyle s, wxDeprecatedGUIConstants t)
{
return static_cast<int>(s) == static_cast<int>(t);
}
wxDEPRECATED_MSG("use wxBRUSHSTYLE_XXX constants only")
inline bool operator!=(wxBrushStyle s, wxDeprecatedGUIConstants t)
{
return static_cast<int>(s) != static_cast<int>(t);
}
#endif // wxCOMPILER_NO_OVERLOAD_ON_ENUM
#endif // _WX_BRUSH_H_BASE_
| h |
rticonnextdds-usecases | data/projects/rticonnextdds-usecases/VehicleTracking/ExampleCode/thirdparty/wxWidgets-3.1.2/Linux/include/wx/clipbrd.h | /////////////////////////////////////////////////////////////////////////////
// Name: wx/clipbrd.h
// Purpose: wxClipboad class and clipboard functions
// Author: Vadim Zeitlin
// Modified by:
// Created: 19.10.99
// Copyright: (c) wxWidgets Team
// Licence: wxWindows licence
/////////////////////////////////////////////////////////////////////////////
#ifndef _WX_CLIPBRD_H_BASE_
#define _WX_CLIPBRD_H_BASE_
#include "wx/defs.h"
#if wxUSE_CLIPBOARD
#include "wx/event.h"
#include "wx/chartype.h"
#include "wx/dataobj.h" // for wxDataFormat
#include "wx/vector.h"
class WXDLLIMPEXP_FWD_CORE wxClipboard;
// ----------------------------------------------------------------------------
// wxClipboard represents the system clipboard. Normally, you should use
// wxTheClipboard which is a global pointer to the (unique) clipboard.
//
// Clipboard can be used to copy data to/paste data from. It works together
// with wxDataObject.
// ----------------------------------------------------------------------------
class WXDLLIMPEXP_CORE wxClipboardBase : public wxObject
{
public:
wxClipboardBase() { m_usePrimary = false; }
// open the clipboard before Add/SetData() and GetData()
virtual bool Open() = 0;
// close the clipboard after Add/SetData() and GetData()
virtual void Close() = 0;
// query whether the clipboard is opened
virtual bool IsOpened() const = 0;
// add to the clipboard data
//
// NB: the clipboard owns the pointer and will delete it, so data must be
// allocated on the heap
virtual bool AddData( wxDataObject *data ) = 0;
// set the clipboard data, this is the same as Clear() followed by
// AddData()
virtual bool SetData( wxDataObject *data ) = 0;
// ask if data in correct format is available
virtual bool IsSupported( const wxDataFormat& format ) = 0;
// ask if data in correct format is available
virtual bool IsSupportedAsync( wxEvtHandler *sink );
// fill data with data on the clipboard (if available)
virtual bool GetData( wxDataObject& data ) = 0;
// clears wxTheClipboard and the system's clipboard if possible
virtual void Clear() = 0;
// flushes the clipboard: this means that the data which is currently on
// clipboard will stay available even after the application exits (possibly
// eating memory), otherwise the clipboard will be emptied on exit
virtual bool Flush() { return false; }
// this allows to choose whether we work with CLIPBOARD (default) or
// PRIMARY selection on X11-based systems
//
// on the other ones, working with primary selection does nothing: this
// allows to write code which sets the primary selection when something is
// selected without any ill effects (i.e. without overwriting the
// clipboard which would be wrong on the platforms without X11 PRIMARY)
virtual void UsePrimarySelection(bool usePrimary = false)
{
m_usePrimary = usePrimary;
}
// return true if we're using primary selection
bool IsUsingPrimarySelection() const { return m_usePrimary; }
// Returns global instance (wxTheClipboard) of the object:
static wxClipboard *Get();
// don't use this directly, it is public for compatibility with some ports
// (wxX11, wxMotif, ...) only
bool m_usePrimary;
};
// ----------------------------------------------------------------------------
// asynchronous clipboard event
// ----------------------------------------------------------------------------
class WXDLLIMPEXP_CORE wxClipboardEvent : public wxEvent
{
public:
wxClipboardEvent(wxEventType evtType = wxEVT_NULL)
: wxEvent(0, evtType)
{
}
wxClipboardEvent(const wxClipboardEvent& event)
: wxEvent(event),
m_formats(event.m_formats)
{
}
bool SupportsFormat(const wxDataFormat& format) const;
void AddFormat(const wxDataFormat& format);
virtual wxEvent *Clone() const wxOVERRIDE
{
return new wxClipboardEvent(*this);
}
protected:
wxVector<wxDataFormat> m_formats;
wxDECLARE_DYNAMIC_CLASS_NO_ASSIGN(wxClipboardEvent);
};
wxDECLARE_EXPORTED_EVENT( WXDLLIMPEXP_CORE, wxEVT_CLIPBOARD_CHANGED, wxClipboardEvent );
typedef void (wxEvtHandler::*wxClipboardEventFunction)(wxClipboardEvent&);
#define wxClipboardEventHandler(func) \
wxEVENT_HANDLER_CAST(wxClipboardEventFunction, func)
#define EVT_CLIPBOARD_CHANGED(func) wx__DECLARE_EVT0(wxEVT_CLIPBOARD_CHANGED, wxClipboardEventHandler(func))
// ----------------------------------------------------------------------------
// globals
// ----------------------------------------------------------------------------
// The global clipboard object - backward compatible access macro:
#define wxTheClipboard (wxClipboard::Get())
// ----------------------------------------------------------------------------
// include platform-specific class declaration
// ----------------------------------------------------------------------------
#if defined(__WXMSW__)
#include "wx/msw/clipbrd.h"
#elif defined(__WXMOTIF__)
#include "wx/motif/clipbrd.h"
#elif defined(__WXGTK20__)
#include "wx/gtk/clipbrd.h"
#elif defined(__WXGTK__)
#include "wx/gtk1/clipbrd.h"
#elif defined(__WXX11__)
#include "wx/x11/clipbrd.h"
#elif defined(__WXMAC__)
#include "wx/osx/clipbrd.h"
#elif defined(__WXQT__)
#include "wx/qt/clipbrd.h"
#endif
// ----------------------------------------------------------------------------
// helpful class for opening the clipboard and automatically closing it
// ----------------------------------------------------------------------------
class WXDLLIMPEXP_CORE wxClipboardLocker
{
public:
wxClipboardLocker(wxClipboard *clipboard = NULL)
{
m_clipboard = clipboard ? clipboard : wxTheClipboard;
if ( m_clipboard )
{
m_clipboard->Open();
}
}
bool operator!() const { return !m_clipboard->IsOpened(); }
~wxClipboardLocker()
{
if ( m_clipboard )
{
m_clipboard->Close();
}
}
private:
wxClipboard *m_clipboard;
wxDECLARE_NO_COPY_CLASS(wxClipboardLocker);
};
#endif // wxUSE_CLIPBOARD
#endif // _WX_CLIPBRD_H_BASE_
| h |
rticonnextdds-usecases | data/projects/rticonnextdds-usecases/VehicleTracking/ExampleCode/thirdparty/wxWidgets-3.1.2/Linux/include/wx/collpane.h | /////////////////////////////////////////////////////////////////////////////
// Name: wx/collpane.h
// Purpose: wxCollapsiblePane
// Author: Francesco Montorsi
// Modified by:
// Created: 8/10/2006
// Copyright: (c) Francesco Montorsi
// Licence: wxWindows Licence
/////////////////////////////////////////////////////////////////////////////
#ifndef _WX_COLLAPSABLE_PANE_H_BASE_
#define _WX_COLLAPSABLE_PANE_H_BASE_
#include "wx/defs.h"
#if wxUSE_COLLPANE
#include "wx/control.h"
// class name
extern WXDLLIMPEXP_DATA_CORE(const char) wxCollapsiblePaneNameStr[];
// ----------------------------------------------------------------------------
// wxCollapsiblePaneBase: interface for wxCollapsiblePane
// ----------------------------------------------------------------------------
#define wxCP_DEFAULT_STYLE (wxTAB_TRAVERSAL | wxNO_BORDER)
#define wxCP_NO_TLW_RESIZE (0x0002)
class WXDLLIMPEXP_CORE wxCollapsiblePaneBase : public wxControl
{
public:
wxCollapsiblePaneBase() {}
virtual void Collapse(bool collapse = true) = 0;
void Expand() { Collapse(false); }
virtual bool IsCollapsed() const = 0;
bool IsExpanded() const { return !IsCollapsed(); }
virtual wxWindow *GetPane() const = 0;
virtual wxString GetLabel() const wxOVERRIDE = 0;
virtual void SetLabel(const wxString& label) wxOVERRIDE = 0;
virtual bool
InformFirstDirection(int direction,
int size,
int availableOtherDir) wxOVERRIDE
{
wxWindow* const p = GetPane();
if ( !p )
return false;
if ( !p->InformFirstDirection(direction, size, availableOtherDir) )
return false;
InvalidateBestSize();
return true;
}
};
// ----------------------------------------------------------------------------
// event types and macros
// ----------------------------------------------------------------------------
class WXDLLIMPEXP_FWD_CORE wxCollapsiblePaneEvent;
wxDECLARE_EXPORTED_EVENT( WXDLLIMPEXP_CORE, wxEVT_COLLAPSIBLEPANE_CHANGED, wxCollapsiblePaneEvent );
class WXDLLIMPEXP_CORE wxCollapsiblePaneEvent : public wxCommandEvent
{
public:
wxCollapsiblePaneEvent() {}
wxCollapsiblePaneEvent(wxObject *generator, int id, bool collapsed)
: wxCommandEvent(wxEVT_COLLAPSIBLEPANE_CHANGED, id),
m_bCollapsed(collapsed)
{
SetEventObject(generator);
}
bool GetCollapsed() const { return m_bCollapsed; }
void SetCollapsed(bool c) { m_bCollapsed = c; }
// default copy ctor, assignment operator and dtor are ok
virtual wxEvent *Clone() const wxOVERRIDE { return new wxCollapsiblePaneEvent(*this); }
private:
bool m_bCollapsed;
wxDECLARE_DYNAMIC_CLASS_NO_ASSIGN(wxCollapsiblePaneEvent);
};
// ----------------------------------------------------------------------------
// event types and macros
// ----------------------------------------------------------------------------
typedef void (wxEvtHandler::*wxCollapsiblePaneEventFunction)(wxCollapsiblePaneEvent&);
#define wxCollapsiblePaneEventHandler(func) \
wxEVENT_HANDLER_CAST(wxCollapsiblePaneEventFunction, func)
#define EVT_COLLAPSIBLEPANE_CHANGED(id, fn) \
wx__DECLARE_EVT1(wxEVT_COLLAPSIBLEPANE_CHANGED, id, wxCollapsiblePaneEventHandler(fn))
#if defined(__WXGTK20__) && !defined(__WXUNIVERSAL__)
#include "wx/gtk/collpane.h"
#else
#include "wx/generic/collpaneg.h"
// use #define and not a typedef to allow forward declaring the class
#define wxCollapsiblePane wxGenericCollapsiblePane
#endif
// old wxEVT_COMMAND_* constant
#define wxEVT_COMMAND_COLLPANE_CHANGED wxEVT_COLLAPSIBLEPANE_CHANGED
#endif // wxUSE_COLLPANE
#endif // _WX_COLLAPSABLE_PANE_H_BASE_
| h |
rticonnextdds-usecases | data/projects/rticonnextdds-usecases/VehicleTracking/ExampleCode/thirdparty/wxWidgets-3.1.2/Linux/include/wx/vidmode.h | ///////////////////////////////////////////////////////////////////////////////
// Name: wx/vidmode.h
// Purpose: declares wxVideoMode class used by both wxDisplay and wxApp
// Author: Vadim Zeitlin
// Modified by:
// Created: 27.09.2003 (extracted from wx/display.h)
// Copyright: (c) 2003 Vadim Zeitlin <[email protected]>
// Licence: wxWindows licence
///////////////////////////////////////////////////////////////////////////////
#ifndef _WX_VMODE_H_
#define _WX_VMODE_H_
// ----------------------------------------------------------------------------
// wxVideoMode: a simple struct containing video mode parameters for a display
// ----------------------------------------------------------------------------
struct WXDLLIMPEXP_CORE wxVideoMode
{
wxVideoMode(int width = 0, int height = 0, int depth = 0, int freq = 0)
{
w = width;
h = height;
bpp = depth;
refresh = freq;
}
// default copy ctor and assignment operator are ok
bool operator==(const wxVideoMode& m) const
{
return w == m.w && h == m.h && bpp == m.bpp && refresh == m.refresh;
}
bool operator!=(const wxVideoMode& mode) const
{
return !operator==(mode);
}
// returns true if this mode matches the other one in the sense that all
// non zero fields of the other mode have the same value in this one
// (except for refresh which is allowed to have a greater value)
bool Matches(const wxVideoMode& other) const
{
return (!other.w || w == other.w) &&
(!other.h || h == other.h) &&
(!other.bpp || bpp == other.bpp) &&
(!other.refresh || refresh >= other.refresh);
}
// trivial accessors
int GetWidth() const { return w; }
int GetHeight() const { return h; }
int GetDepth() const { return bpp; }
int GetRefresh() const { return refresh; }
// returns true if the object has been initialized
bool IsOk() const { return w && h; }
// the screen size in pixels (e.g. 640*480), 0 means unspecified
int w, h;
// bits per pixel (e.g. 32), 1 is monochrome and 0 means unspecified/known
int bpp;
// refresh frequency in Hz, 0 means unspecified/unknown
int refresh;
};
#endif // _WX_VMODE_H_
| h |
rticonnextdds-usecases | data/projects/rticonnextdds-usecases/VehicleTracking/ExampleCode/thirdparty/wxWidgets-3.1.2/Linux/include/wx/tarstrm.h | /////////////////////////////////////////////////////////////////////////////
// Name: wx/tarstrm.h
// Purpose: Streams for Tar files
// Author: Mike Wetherell
// Copyright: (c) 2004 Mike Wetherell
// Licence: wxWindows licence
/////////////////////////////////////////////////////////////////////////////
#ifndef _WX_WXTARSTREAM_H__
#define _WX_WXTARSTREAM_H__
#include "wx/defs.h"
#if wxUSE_TARSTREAM
#include "wx/archive.h"
#include "wx/hashmap.h"
/////////////////////////////////////////////////////////////////////////////
// Constants
// TypeFlag values
enum wxTarType
{
wxTAR_REGTYPE = '0', // regular file
wxTAR_LNKTYPE = '1', // hard link
wxTAR_SYMTYPE = '2', // symbolic link
wxTAR_CHRTYPE = '3', // character special
wxTAR_BLKTYPE = '4', // block special
wxTAR_DIRTYPE = '5', // directory
wxTAR_FIFOTYPE = '6', // named pipe
wxTAR_CONTTYPE = '7' // contiguous file
};
// Archive Formats (use wxTAR_PAX, it's backward compatible)
enum wxTarFormat
{
wxTAR_USTAR, // POSIX.1-1990 tar format
wxTAR_PAX // POSIX.1-2001 tar format
};
/////////////////////////////////////////////////////////////////////////////
// wxTarNotifier
class WXDLLIMPEXP_BASE wxTarNotifier
{
public:
virtual ~wxTarNotifier() { }
virtual void OnEntryUpdated(class wxTarEntry& entry) = 0;
};
/////////////////////////////////////////////////////////////////////////////
// Tar Entry - hold the meta data for a file in the tar
class WXDLLIMPEXP_BASE wxTarEntry : public wxArchiveEntry
{
public:
wxTarEntry(const wxString& name = wxEmptyString,
const wxDateTime& dt = wxDateTime::Now(),
wxFileOffset size = wxInvalidOffset);
virtual ~wxTarEntry();
wxTarEntry(const wxTarEntry& entry);
wxTarEntry& operator=(const wxTarEntry& entry);
// Get accessors
wxString GetName(wxPathFormat format = wxPATH_NATIVE) const wxOVERRIDE;
wxString GetInternalName() const wxOVERRIDE { return m_Name; }
wxPathFormat GetInternalFormat() const wxOVERRIDE { return wxPATH_UNIX; }
int GetMode() const;
int GetUserId() const { return m_UserId; }
int GetGroupId() const { return m_GroupId; }
wxFileOffset GetSize() const wxOVERRIDE { return m_Size; }
wxFileOffset GetOffset() const wxOVERRIDE { return m_Offset; }
wxDateTime GetDateTime() const wxOVERRIDE { return m_ModifyTime; }
wxDateTime GetAccessTime() const { return m_AccessTime; }
wxDateTime GetCreateTime() const { return m_CreateTime; }
int GetTypeFlag() const { return m_TypeFlag; }
wxString GetLinkName() const { return m_LinkName; }
wxString GetUserName() const { return m_UserName; }
wxString GetGroupName() const { return m_GroupName; }
int GetDevMajor() const { return m_DevMajor; }
int GetDevMinor() const { return m_DevMinor; }
// is accessors
bool IsDir() const wxOVERRIDE;
bool IsReadOnly() const wxOVERRIDE { return !(m_Mode & 0222); }
// set accessors
void SetName(const wxString& name, wxPathFormat format = wxPATH_NATIVE) wxOVERRIDE;
void SetUserId(int id) { m_UserId = id; }
void SetGroupId(int id) { m_GroupId = id; }
void SetMode(int mode);
void SetSize(wxFileOffset size) wxOVERRIDE { m_Size = size; }
void SetDateTime(const wxDateTime& dt) wxOVERRIDE { m_ModifyTime = dt; }
void SetAccessTime(const wxDateTime& dt) { m_AccessTime = dt; }
void SetCreateTime(const wxDateTime& dt) { m_CreateTime = dt; }
void SetTypeFlag(int type) { m_TypeFlag = type; }
void SetLinkName(const wxString& link) { m_LinkName = link; }
void SetUserName(const wxString& user) { m_UserName = user; }
void SetGroupName(const wxString& group) { m_GroupName = group; }
void SetDevMajor(int dev) { m_DevMajor = dev; }
void SetDevMinor(int dev) { m_DevMinor = dev; }
// set is accessors
void SetIsDir(bool isDir = true) wxOVERRIDE;
void SetIsReadOnly(bool isReadOnly = true) wxOVERRIDE;
static wxString GetInternalName(const wxString& name,
wxPathFormat format = wxPATH_NATIVE,
bool *pIsDir = NULL);
wxTarEntry *Clone() const { return new wxTarEntry(*this); }
void SetNotifier(wxTarNotifier& WXUNUSED(notifier)) { }
private:
void SetOffset(wxFileOffset offset) wxOVERRIDE { m_Offset = offset; }
virtual wxArchiveEntry* DoClone() const wxOVERRIDE { return Clone(); }
wxString m_Name;
int m_Mode;
bool m_IsModeSet;
int m_UserId;
int m_GroupId;
wxFileOffset m_Size;
wxFileOffset m_Offset;
wxDateTime m_ModifyTime;
wxDateTime m_AccessTime;
wxDateTime m_CreateTime;
int m_TypeFlag;
wxString m_LinkName;
wxString m_UserName;
wxString m_GroupName;
int m_DevMajor;
int m_DevMinor;
friend class wxTarInputStream;
wxDECLARE_DYNAMIC_CLASS(wxTarEntry);
};
/////////////////////////////////////////////////////////////////////////////
// wxTarInputStream
WX_DECLARE_STRING_HASH_MAP(wxString, wxTarHeaderRecords);
class WXDLLIMPEXP_BASE wxTarInputStream : public wxArchiveInputStream
{
public:
typedef wxTarEntry entry_type;
wxTarInputStream(wxInputStream& stream, wxMBConv& conv = wxConvLocal);
wxTarInputStream(wxInputStream *stream, wxMBConv& conv = wxConvLocal);
virtual ~wxTarInputStream();
bool OpenEntry(wxTarEntry& entry);
bool CloseEntry() wxOVERRIDE;
wxTarEntry *GetNextEntry();
wxFileOffset GetLength() const wxOVERRIDE { return m_size; }
bool IsSeekable() const wxOVERRIDE { return m_parent_i_stream->IsSeekable(); }
protected:
size_t OnSysRead(void *buffer, size_t size) wxOVERRIDE;
wxFileOffset OnSysTell() const wxOVERRIDE { return m_pos; }
wxFileOffset OnSysSeek(wxFileOffset seek, wxSeekMode mode) wxOVERRIDE;
private:
void Init();
wxArchiveEntry *DoGetNextEntry() wxOVERRIDE { return GetNextEntry(); }
bool OpenEntry(wxArchiveEntry& entry) wxOVERRIDE;
bool IsOpened() const { return m_pos != wxInvalidOffset; }
wxStreamError ReadHeaders();
bool ReadExtendedHeader(wxTarHeaderRecords*& recs);
wxString GetExtendedHeader(const wxString& key) const;
wxString GetHeaderPath() const;
wxFileOffset GetHeaderNumber(int id) const;
wxString GetHeaderString(int id) const;
wxDateTime GetHeaderDate(const wxString& key) const;
wxFileOffset m_pos; // position within the current entry
wxFileOffset m_offset; // offset to the start of the entry's data
wxFileOffset m_size; // size of the current entry's data
int m_sumType;
int m_tarType;
class wxTarHeaderBlock *m_hdr;
wxTarHeaderRecords *m_HeaderRecs;
wxTarHeaderRecords *m_GlobalHeaderRecs;
wxDECLARE_NO_COPY_CLASS(wxTarInputStream);
};
/////////////////////////////////////////////////////////////////////////////
// wxTarOutputStream
class WXDLLIMPEXP_BASE wxTarOutputStream : public wxArchiveOutputStream
{
public:
wxTarOutputStream(wxOutputStream& stream,
wxTarFormat format = wxTAR_PAX,
wxMBConv& conv = wxConvLocal);
wxTarOutputStream(wxOutputStream *stream,
wxTarFormat format = wxTAR_PAX,
wxMBConv& conv = wxConvLocal);
virtual ~wxTarOutputStream();
bool PutNextEntry(wxTarEntry *entry);
bool PutNextEntry(const wxString& name,
const wxDateTime& dt = wxDateTime::Now(),
wxFileOffset size = wxInvalidOffset) wxOVERRIDE;
bool PutNextDirEntry(const wxString& name,
const wxDateTime& dt = wxDateTime::Now()) wxOVERRIDE;
bool CopyEntry(wxTarEntry *entry, wxTarInputStream& inputStream);
bool CopyArchiveMetaData(wxTarInputStream& WXUNUSED(s)) { return true; }
void Sync() wxOVERRIDE;
bool CloseEntry() wxOVERRIDE;
bool Close() wxOVERRIDE;
bool IsSeekable() const wxOVERRIDE { return m_parent_o_stream->IsSeekable(); }
void SetBlockingFactor(int factor) { m_BlockingFactor = factor; }
int GetBlockingFactor() const { return m_BlockingFactor; }
protected:
size_t OnSysWrite(const void *buffer, size_t size) wxOVERRIDE;
wxFileOffset OnSysTell() const wxOVERRIDE { return m_pos; }
wxFileOffset OnSysSeek(wxFileOffset pos, wxSeekMode mode) wxOVERRIDE;
private:
void Init(wxTarFormat format);
bool PutNextEntry(wxArchiveEntry *entry) wxOVERRIDE;
bool CopyEntry(wxArchiveEntry *entry, wxArchiveInputStream& stream) wxOVERRIDE;
bool CopyArchiveMetaData(wxArchiveInputStream& WXUNUSED(s)) wxOVERRIDE { return true; }
bool IsOpened() const { return m_pos != wxInvalidOffset; }
bool WriteHeaders(wxTarEntry& entry);
bool ModifyHeader();
wxString PaxHeaderPath(const wxString& format, const wxString& path);
void SetExtendedHeader(const wxString& key, const wxString& value);
void SetHeaderPath(const wxString& name);
bool SetHeaderNumber(int id, wxFileOffset n);
void SetHeaderString(int id, const wxString& str);
void SetHeaderDate(const wxString& key, const wxDateTime& datetime);
wxFileOffset m_pos; // position within the current entry
wxFileOffset m_maxpos; // max pos written
wxFileOffset m_size; // expected entry size
wxFileOffset m_headpos; // offset within the file to the entry's header
wxFileOffset m_datapos; // offset within the file to the entry's data
wxFileOffset m_tarstart;// offset within the file to the tar
wxFileOffset m_tarsize; // size of tar so far
bool m_pax;
int m_BlockingFactor;
wxUint32 m_chksum;
bool m_large;
class wxTarHeaderBlock *m_hdr;
class wxTarHeaderBlock *m_hdr2;
char *m_extendedHdr;
size_t m_extendedSize;
wxString m_badfit;
bool m_endrecWritten;
wxDECLARE_NO_COPY_CLASS(wxTarOutputStream);
};
/////////////////////////////////////////////////////////////////////////////
// Iterators
#if wxUSE_STL || defined WX_TEST_ARCHIVE_ITERATOR
typedef wxArchiveIterator<wxTarInputStream> wxTarIter;
typedef wxArchiveIterator<wxTarInputStream,
std::pair<wxString, wxTarEntry*> > wxTarPairIter;
#endif
/////////////////////////////////////////////////////////////////////////////
// wxTarClassFactory
class WXDLLIMPEXP_BASE wxTarClassFactory : public wxArchiveClassFactory
{
public:
typedef wxTarEntry entry_type;
typedef wxTarInputStream instream_type;
typedef wxTarOutputStream outstream_type;
typedef wxTarNotifier notifier_type;
#if wxUSE_STL || defined WX_TEST_ARCHIVE_ITERATOR
typedef wxTarIter iter_type;
typedef wxTarPairIter pairiter_type;
#endif
wxTarClassFactory();
wxTarEntry *NewEntry() const
{ return new wxTarEntry; }
wxTarInputStream *NewStream(wxInputStream& stream) const
{ return new wxTarInputStream(stream, GetConv()); }
wxTarOutputStream *NewStream(wxOutputStream& stream) const
{ return new wxTarOutputStream(stream, wxTAR_PAX, GetConv()); }
wxTarInputStream *NewStream(wxInputStream *stream) const
{ return new wxTarInputStream(stream, GetConv()); }
wxTarOutputStream *NewStream(wxOutputStream *stream) const
{ return new wxTarOutputStream(stream, wxTAR_PAX, GetConv()); }
wxString GetInternalName(const wxString& name,
wxPathFormat format = wxPATH_NATIVE) const wxOVERRIDE
{ return wxTarEntry::GetInternalName(name, format); }
const wxChar * const *GetProtocols(wxStreamProtocolType type
= wxSTREAM_PROTOCOL) const wxOVERRIDE;
protected:
wxArchiveEntry *DoNewEntry() const wxOVERRIDE
{ return NewEntry(); }
wxArchiveInputStream *DoNewStream(wxInputStream& stream) const wxOVERRIDE
{ return NewStream(stream); }
wxArchiveOutputStream *DoNewStream(wxOutputStream& stream) const wxOVERRIDE
{ return NewStream(stream); }
wxArchiveInputStream *DoNewStream(wxInputStream *stream) const wxOVERRIDE
{ return NewStream(stream); }
wxArchiveOutputStream *DoNewStream(wxOutputStream *stream) const wxOVERRIDE
{ return NewStream(stream); }
private:
wxDECLARE_DYNAMIC_CLASS(wxTarClassFactory);
};
#endif // wxUSE_TARSTREAM
#endif // _WX_WXTARSTREAM_H__
| h |
rticonnextdds-usecases | data/projects/rticonnextdds-usecases/VehicleTracking/ExampleCode/thirdparty/wxWidgets-3.1.2/Linux/include/wx/imagjpeg.h | /////////////////////////////////////////////////////////////////////////////
// Name: wx/imagjpeg.h
// Purpose: wxImage JPEG handler
// Author: Vaclav Slavik
// Copyright: (c) Vaclav Slavik
// Licence: wxWindows licence
/////////////////////////////////////////////////////////////////////////////
#ifndef _WX_IMAGJPEG_H_
#define _WX_IMAGJPEG_H_
#include "wx/defs.h"
//-----------------------------------------------------------------------------
// wxJPEGHandler
//-----------------------------------------------------------------------------
#if wxUSE_LIBJPEG
#include "wx/image.h"
#include "wx/versioninfo.h"
class WXDLLIMPEXP_CORE wxJPEGHandler: public wxImageHandler
{
public:
inline wxJPEGHandler()
{
m_name = wxT("JPEG file");
m_extension = wxT("jpg");
m_altExtensions.Add(wxT("jpeg"));
m_altExtensions.Add(wxT("jpe"));
m_type = wxBITMAP_TYPE_JPEG;
m_mime = wxT("image/jpeg");
}
static wxVersionInfo GetLibraryVersionInfo();
#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(wxJPEGHandler);
};
#endif // wxUSE_LIBJPEG
#endif // _WX_IMAGJPEG_H_
| h |
rticonnextdds-usecases | data/projects/rticonnextdds-usecases/VehicleTracking/ExampleCode/thirdparty/wxWidgets-3.1.2/Linux/include/wx/sizer.h | /////////////////////////////////////////////////////////////////////////////
// Name: wx/sizer.h
// Purpose: provide wxSizer class for layout
// Author: Robert Roebling and Robin Dunn
// Modified by: Ron Lee, Vadim Zeitlin (wxSizerFlags)
// Created:
// Copyright: (c) Robin Dunn, Robert Roebling
// Licence: wxWindows licence
/////////////////////////////////////////////////////////////////////////////
#ifndef __WXSIZER_H__
#define __WXSIZER_H__
#include "wx/defs.h"
#include "wx/window.h"
//---------------------------------------------------------------------------
// classes
//---------------------------------------------------------------------------
class WXDLLIMPEXP_FWD_CORE wxButton;
class WXDLLIMPEXP_FWD_CORE wxBoxSizer;
class WXDLLIMPEXP_FWD_CORE wxSizerItem;
class WXDLLIMPEXP_FWD_CORE wxSizer;
#ifndef wxUSE_BORDER_BY_DEFAULT
#define wxUSE_BORDER_BY_DEFAULT 1
#endif
// ----------------------------------------------------------------------------
// wxSizerFlags: flags used for an item in the sizer
// ----------------------------------------------------------------------------
class WXDLLIMPEXP_CORE wxSizerFlags
{
public:
// construct the flags object initialized with the given proportion (0 by
// default)
wxSizerFlags(int proportion = 0) : m_proportion(proportion)
{
m_flags = 0;
m_borderInPixels = 0;
}
// setters for all sizer flags, they all return the object itself so that
// calls to them can be chained
wxSizerFlags& Proportion(int proportion)
{
m_proportion = proportion;
return *this;
}
wxSizerFlags& Expand()
{
m_flags |= wxEXPAND;
return *this;
}
// notice that Align() replaces the current alignment flags, use specific
// methods below such as Top(), Left() &c if you want to set just the
// vertical or horizontal alignment
wxSizerFlags& Align(int alignment) // combination of wxAlignment values
{
m_flags &= ~wxALIGN_MASK;
m_flags |= alignment;
return *this;
}
// some shortcuts for Align()
wxSizerFlags& Centre() { return Align(wxALIGN_CENTRE); }
wxSizerFlags& Center() { return Centre(); }
wxSizerFlags& CentreVertical() { return Align(wxALIGN_CENTRE_VERTICAL); }
wxSizerFlags& CenterVertical() { return CentreVertical(); }
wxSizerFlags& CentreHorizontal() { return Align(wxALIGN_CENTRE_HORIZONTAL); }
wxSizerFlags& CenterHorizontal() { return CentreHorizontal(); }
wxSizerFlags& Top()
{
m_flags &= ~(wxALIGN_BOTTOM | wxALIGN_CENTRE_VERTICAL);
return *this;
}
wxSizerFlags& Left()
{
m_flags &= ~(wxALIGN_RIGHT | wxALIGN_CENTRE_HORIZONTAL);
return *this;
}
wxSizerFlags& Right()
{
m_flags = (m_flags & ~wxALIGN_CENTRE_HORIZONTAL) | wxALIGN_RIGHT;
return *this;
}
wxSizerFlags& Bottom()
{
m_flags = (m_flags & ~wxALIGN_CENTRE_VERTICAL) | wxALIGN_BOTTOM;
return *this;
}
// default border size used by Border() below
static int GetDefaultBorder()
{
#if wxUSE_BORDER_BY_DEFAULT
#ifdef __WXGTK20__
// GNOME HIG says to use 6px as the base unit:
// http://library.gnome.org/devel/hig-book/stable/design-window.html.en
return 6;
#elif defined(__WXMAC__)
// Not sure if this is really the correct size for the border.
return 5;
#else
// For the other platforms, we need to scale raw pixel values using the
// current DPI, do it once (and cache the result) in another function.
#define wxNEEDS_BORDER_IN_PX
// We don't react to dynamic DPI changes, so we can cache the values of
// the border in on-screen pixels after computing it once. This
// could/should change in the future.
if ( !ms_defaultBorderInPx )
ms_defaultBorderInPx = DoGetDefaultBorderInPx();
return ms_defaultBorderInPx;
#endif
#else
return 0;
#endif
}
wxSizerFlags& Border(int direction, int borderInPixels)
{
wxCHECK_MSG( !(direction & ~wxALL), *this,
wxS("direction must be a combination of wxDirection ")
wxS("enum values.") );
m_flags &= ~wxALL;
m_flags |= direction;
m_borderInPixels = borderInPixels;
return *this;
}
wxSizerFlags& Border(int direction = wxALL)
{
#if wxUSE_BORDER_BY_DEFAULT
return Border(direction, GetDefaultBorder());
#else
// no borders by default on limited size screen
wxUnusedVar(direction);
return *this;
#endif
}
wxSizerFlags& DoubleBorder(int direction = wxALL)
{
#if wxUSE_BORDER_BY_DEFAULT
return Border(direction, 2*GetDefaultBorder());
#else
wxUnusedVar(direction);
return *this;
#endif
}
wxSizerFlags& TripleBorder(int direction = wxALL)
{
#if wxUSE_BORDER_BY_DEFAULT
return Border(direction, 3*GetDefaultBorder());
#else
wxUnusedVar(direction);
return *this;
#endif
}
wxSizerFlags& HorzBorder()
{
#if wxUSE_BORDER_BY_DEFAULT
return Border(wxLEFT | wxRIGHT, GetDefaultBorder());
#else
return *this;
#endif
}
wxSizerFlags& DoubleHorzBorder()
{
#if wxUSE_BORDER_BY_DEFAULT
return Border(wxLEFT | wxRIGHT, 2*GetDefaultBorder());
#else
return *this;
#endif
}
// setters for the others flags
wxSizerFlags& Shaped()
{
m_flags |= wxSHAPED;
return *this;
}
wxSizerFlags& FixedMinSize()
{
m_flags |= wxFIXED_MINSIZE;
return *this;
}
// makes the item ignore window's visibility status
wxSizerFlags& ReserveSpaceEvenIfHidden()
{
m_flags |= wxRESERVE_SPACE_EVEN_IF_HIDDEN;
return *this;
}
// accessors for wxSizer only
int GetProportion() const { return m_proportion; }
int GetFlags() const { return m_flags; }
int GetBorderInPixels() const { return m_borderInPixels; }
private:
#ifdef wxNEEDS_BORDER_IN_PX
static int DoGetDefaultBorderInPx();
static int ms_defaultBorderInPx;
#endif // wxNEEDS_BORDER_IN_PX
int m_proportion;
int m_flags;
int m_borderInPixels;
};
// ----------------------------------------------------------------------------
// wxSizerSpacer: used by wxSizerItem to represent a spacer
// ----------------------------------------------------------------------------
class WXDLLIMPEXP_CORE wxSizerSpacer
{
public:
wxSizerSpacer(const wxSize& size) : m_size(size), m_isShown(true) { }
void SetSize(const wxSize& size) { m_size = size; }
const wxSize& GetSize() const { return m_size; }
void Show(bool show) { m_isShown = show; }
bool IsShown() const { return m_isShown; }
private:
// the size, in pixel
wxSize m_size;
// is the spacer currently shown?
bool m_isShown;
};
// ----------------------------------------------------------------------------
// wxSizerItem
// ----------------------------------------------------------------------------
class WXDLLIMPEXP_CORE wxSizerItem : public wxObject
{
public:
// window
wxSizerItem( wxWindow *window,
int proportion=0,
int flag=0,
int border=0,
wxObject* userData=NULL );
// window with flags
wxSizerItem(wxWindow *window, const wxSizerFlags& flags)
{
Init(flags);
DoSetWindow(window);
}
// subsizer
wxSizerItem( wxSizer *sizer,
int proportion=0,
int flag=0,
int border=0,
wxObject* userData=NULL );
// sizer with flags
wxSizerItem(wxSizer *sizer, const wxSizerFlags& flags)
{
Init(flags);
DoSetSizer(sizer);
}
// spacer
wxSizerItem( int width,
int height,
int proportion=0,
int flag=0,
int border=0,
wxObject* userData=NULL);
// spacer with flags
wxSizerItem(int width, int height, const wxSizerFlags& flags)
{
Init(flags);
DoSetSpacer(wxSize(width, height));
}
wxSizerItem();
virtual ~wxSizerItem();
virtual void DeleteWindows();
// Enable deleting the SizerItem without destroying the contained sizer.
void DetachSizer() { m_sizer = NULL; }
virtual wxSize GetSize() const;
virtual wxSize CalcMin();
virtual void SetDimension( const wxPoint& pos, const wxSize& size );
wxSize GetMinSize() const
{ return m_minSize; }
wxSize GetMinSizeWithBorder() const;
wxSize GetMaxSize() const
{ return IsWindow() ? m_window->GetMaxSize() : wxDefaultSize; }
wxSize GetMaxSizeWithBorder() const;
void SetMinSize(const wxSize& size)
{
if ( IsWindow() )
m_window->SetMinSize(size);
m_minSize = size;
}
void SetMinSize( int x, int y )
{ SetMinSize(wxSize(x, y)); }
void SetInitSize( int x, int y )
{ SetMinSize(wxSize(x, y)); }
// if either of dimensions is zero, ratio is assumed to be 1
// to avoid "divide by zero" errors
void SetRatio(int width, int height)
{ m_ratio = (width && height) ? ((float) width / (float) height) : 1; }
void SetRatio(const wxSize& size)
{ SetRatio(size.x, size.y); }
void SetRatio(float ratio)
{ m_ratio = ratio; }
float GetRatio() const
{ return m_ratio; }
virtual wxRect GetRect() { return m_rect; }
// set a sizer item id (different from a window id, all sizer items,
// including spacers, can have an associated id)
void SetId(int id) { m_id = id; }
int GetId() const { return m_id; }
bool IsWindow() const { return m_kind == Item_Window; }
bool IsSizer() const { return m_kind == Item_Sizer; }
bool IsSpacer() const { return m_kind == Item_Spacer; }
void SetProportion( int proportion )
{ m_proportion = proportion; }
int GetProportion() const
{ return m_proportion; }
void SetFlag( int flag )
{ m_flag = flag; }
int GetFlag() const
{ return m_flag; }
void SetBorder( int border )
{ m_border = border; }
int GetBorder() const
{ return m_border; }
wxWindow *GetWindow() const
{ return m_kind == Item_Window ? m_window : NULL; }
wxSizer *GetSizer() const
{ return m_kind == Item_Sizer ? m_sizer : NULL; }
wxSize GetSpacer() const;
// This function behaves obviously for the windows and spacers but for the
// sizers it returns true if any sizer element is shown and only returns
// false if all of them are hidden. Also, it always returns true if
// wxRESERVE_SPACE_EVEN_IF_HIDDEN flag was used.
bool IsShown() const;
void Show(bool show);
void SetUserData(wxObject* userData)
{ delete m_userData; m_userData = userData; }
wxObject* GetUserData() const
{ return m_userData; }
wxPoint GetPosition() const
{ return m_pos; }
// Called once the first component of an item has been decided. This is
// used in algorithms that depend on knowing the size in one direction
// before the min size in the other direction can be known.
// Returns true if it made use of the information (and min size was changed).
bool InformFirstDirection( int direction, int size, int availableOtherDir=-1 );
// these functions delete the current contents of the item if it's a sizer
// or a spacer but not if it is a window
void AssignWindow(wxWindow *window)
{
Free();
DoSetWindow(window);
}
void AssignSizer(wxSizer *sizer)
{
Free();
DoSetSizer(sizer);
}
void AssignSpacer(const wxSize& size)
{
Free();
DoSetSpacer(size);
}
void AssignSpacer(int w, int h) { AssignSpacer(wxSize(w, h)); }
#if WXWIN_COMPATIBILITY_2_8
// these functions do not free the old sizer/spacer and so can easily
// provoke the memory leaks and so shouldn't be used, use Assign() instead
wxDEPRECATED( void SetWindow(wxWindow *window) );
wxDEPRECATED( void SetSizer(wxSizer *sizer) );
wxDEPRECATED( void SetSpacer(const wxSize& size) );
wxDEPRECATED( void SetSpacer(int width, int height) );
#endif // WXWIN_COMPATIBILITY_2_8
protected:
// common part of several ctors
void Init() { m_userData = NULL; m_kind = Item_None; }
// common part of ctors taking wxSizerFlags
void Init(const wxSizerFlags& flags);
// free current contents
void Free();
// common parts of Set/AssignXXX()
void DoSetWindow(wxWindow *window);
void DoSetSizer(wxSizer *sizer);
void DoSetSpacer(const wxSize& size);
// Add the border specified for this item to the given size
// if it's != wxDefaultSize, just return wxDefaultSize otherwise.
wxSize AddBorderToSize(const wxSize& size) const;
// discriminated union: depending on m_kind one of the fields is valid
enum
{
Item_None,
Item_Window,
Item_Sizer,
Item_Spacer,
Item_Max
} m_kind;
union
{
wxWindow *m_window;
wxSizer *m_sizer;
wxSizerSpacer *m_spacer;
};
wxPoint m_pos;
wxSize m_minSize;
int m_proportion;
int m_border;
int m_flag;
int m_id;
// on screen rectangle of this item (not including borders)
wxRect m_rect;
// Aspect ratio can always be calculated from m_size,
// but this would cause precision loss when the window
// is shrunk. It is safer to preserve the initial value.
float m_ratio;
wxObject *m_userData;
private:
wxDECLARE_CLASS(wxSizerItem);
wxDECLARE_NO_COPY_CLASS(wxSizerItem);
};
WX_DECLARE_EXPORTED_LIST( wxSizerItem, wxSizerItemList );
//---------------------------------------------------------------------------
// wxSizer
//---------------------------------------------------------------------------
class WXDLLIMPEXP_CORE wxSizer: public wxObject, public wxClientDataContainer
{
public:
wxSizer() { m_containingWindow = NULL; }
virtual ~wxSizer();
// methods for adding elements to the sizer: there are Add/Insert/Prepend
// overloads for each of window/sizer/spacer/wxSizerItem
wxSizerItem* Add(wxWindow *window,
int proportion = 0,
int flag = 0,
int border = 0,
wxObject* userData = NULL);
wxSizerItem* Add(wxSizer *sizer,
int proportion = 0,
int flag = 0,
int border = 0,
wxObject* userData = NULL);
wxSizerItem* Add(int width,
int height,
int proportion = 0,
int flag = 0,
int border = 0,
wxObject* userData = NULL);
wxSizerItem* Add( wxWindow *window, const wxSizerFlags& flags);
wxSizerItem* Add( wxSizer *sizer, const wxSizerFlags& flags);
wxSizerItem* Add( int width, int height, const wxSizerFlags& flags);
wxSizerItem* Add( wxSizerItem *item);
virtual wxSizerItem *AddSpacer(int size);
wxSizerItem* AddStretchSpacer(int prop = 1);
wxSizerItem* Insert(size_t index,
wxWindow *window,
int proportion = 0,
int flag = 0,
int border = 0,
wxObject* userData = NULL);
wxSizerItem* Insert(size_t index,
wxSizer *sizer,
int proportion = 0,
int flag = 0,
int border = 0,
wxObject* userData = NULL);
wxSizerItem* Insert(size_t index,
int width,
int height,
int proportion = 0,
int flag = 0,
int border = 0,
wxObject* userData = NULL);
wxSizerItem* Insert(size_t index,
wxWindow *window,
const wxSizerFlags& flags);
wxSizerItem* Insert(size_t index,
wxSizer *sizer,
const wxSizerFlags& flags);
wxSizerItem* Insert(size_t index,
int width,
int height,
const wxSizerFlags& flags);
// NB: do _not_ override this function in the derived classes, this one is
// virtual for compatibility reasons only to allow old code overriding
// it to continue to work, override DoInsert() instead in the new code
virtual wxSizerItem* Insert(size_t index, wxSizerItem *item);
wxSizerItem* InsertSpacer(size_t index, int size);
wxSizerItem* InsertStretchSpacer(size_t index, int prop = 1);
wxSizerItem* Prepend(wxWindow *window,
int proportion = 0,
int flag = 0,
int border = 0,
wxObject* userData = NULL);
wxSizerItem* Prepend(wxSizer *sizer,
int proportion = 0,
int flag = 0,
int border = 0,
wxObject* userData = NULL);
wxSizerItem* Prepend(int width,
int height,
int proportion = 0,
int flag = 0,
int border = 0,
wxObject* userData = NULL);
wxSizerItem* Prepend(wxWindow *window, const wxSizerFlags& flags);
wxSizerItem* Prepend(wxSizer *sizer, const wxSizerFlags& flags);
wxSizerItem* Prepend(int width, int height, const wxSizerFlags& flags);
wxSizerItem* Prepend(wxSizerItem *item);
wxSizerItem* PrependSpacer(int size);
wxSizerItem* PrependStretchSpacer(int prop = 1);
// set (or possibly unset if window is NULL) or get the window this sizer
// is used in
void SetContainingWindow(wxWindow *window);
wxWindow *GetContainingWindow() const { return m_containingWindow; }
virtual bool Remove( wxSizer *sizer );
virtual bool Remove( int index );
virtual bool Detach( wxWindow *window );
virtual bool Detach( wxSizer *sizer );
virtual bool Detach( int index );
virtual bool Replace( wxWindow *oldwin, wxWindow *newwin, bool recursive = false );
virtual bool Replace( wxSizer *oldsz, wxSizer *newsz, bool recursive = false );
virtual bool Replace( size_t index, wxSizerItem *newitem );
virtual void Clear( bool delete_windows = false );
virtual void DeleteWindows();
// Inform sizer about the first direction that has been decided (by parent item)
// Returns true if it made use of the information (and recalculated min size)
//
// Note that while this method doesn't do anything by default, it should
// almost always be overridden in the derived classes and should have been
// pure virtual if not for backwards compatibility constraints.
virtual bool InformFirstDirection( int WXUNUSED(direction), int WXUNUSED(size), int WXUNUSED(availableOtherDir) )
{ return false; }
void SetMinSize( int width, int height )
{ DoSetMinSize( width, height ); }
void SetMinSize( const wxSize& size )
{ DoSetMinSize( size.x, size.y ); }
// Searches recursively
bool SetItemMinSize( wxWindow *window, int width, int height )
{ return DoSetItemMinSize( window, width, height ); }
bool SetItemMinSize( wxWindow *window, const wxSize& size )
{ return DoSetItemMinSize( window, size.x, size.y ); }
// Searches recursively
bool SetItemMinSize( wxSizer *sizer, int width, int height )
{ return DoSetItemMinSize( sizer, width, height ); }
bool SetItemMinSize( wxSizer *sizer, const wxSize& size )
{ return DoSetItemMinSize( sizer, size.x, size.y ); }
bool SetItemMinSize( size_t index, int width, int height )
{ return DoSetItemMinSize( index, width, height ); }
bool SetItemMinSize( size_t index, const wxSize& size )
{ return DoSetItemMinSize( index, size.x, size.y ); }
wxSize GetSize() const
{ return m_size; }
wxPoint GetPosition() const
{ return m_position; }
// Calculate the minimal size or return m_minSize if bigger.
wxSize GetMinSize();
// These virtual functions are used by the layout algorithm: first
// CalcMin() is called to calculate the minimal size of the sizer and
// prepare for laying it out and then RecalcSizes() is called to really
// update all the sizer items
virtual wxSize CalcMin() = 0;
virtual void RecalcSizes() = 0;
virtual void Layout();
wxSize ComputeFittingClientSize(wxWindow *window);
wxSize ComputeFittingWindowSize(wxWindow *window);
wxSize Fit( wxWindow *window );
void FitInside( wxWindow *window );
void SetSizeHints( wxWindow *window );
#if WXWIN_COMPATIBILITY_2_8
// This only calls FitInside() since 2.9
wxDEPRECATED( void SetVirtualSizeHints( wxWindow *window ) );
#endif
wxSizerItemList& GetChildren()
{ return m_children; }
const wxSizerItemList& GetChildren() const
{ return m_children; }
void SetDimension(const wxPoint& pos, const wxSize& size)
{
m_position = pos;
m_size = size;
Layout();
// This call is required for wxWrapSizer to be able to calculate its
// minimal size correctly.
InformFirstDirection(wxHORIZONTAL, size.x, size.y);
}
void SetDimension(int x, int y, int width, int height)
{ SetDimension(wxPoint(x, y), wxSize(width, height)); }
size_t GetItemCount() const { return m_children.GetCount(); }
bool IsEmpty() const { return m_children.IsEmpty(); }
wxSizerItem* GetItem( wxWindow *window, bool recursive = false );
wxSizerItem* GetItem( wxSizer *sizer, bool recursive = false );
wxSizerItem* GetItem( size_t index );
wxSizerItem* GetItemById( int id, bool recursive = false );
// Manage whether individual scene items are considered
// in the layout calculations or not.
bool Show( wxWindow *window, bool show = true, bool recursive = false );
bool Show( wxSizer *sizer, bool show = true, bool recursive = false );
bool Show( size_t index, bool show = true );
bool Hide( wxSizer *sizer, bool recursive = false )
{ return Show( sizer, false, recursive ); }
bool Hide( wxWindow *window, bool recursive = false )
{ return Show( window, false, recursive ); }
bool Hide( size_t index )
{ return Show( index, false ); }
bool IsShown( wxWindow *window ) const;
bool IsShown( wxSizer *sizer ) const;
bool IsShown( size_t index ) const;
// Recursively call wxWindow::Show () on all sizer items.
virtual void ShowItems (bool show);
void Show(bool show) { ShowItems(show); }
// This is the ShowItems() counterpart and returns true if any of the sizer
// items are shown.
virtual bool AreAnyItemsShown() const;
protected:
wxSize m_size;
wxSize m_minSize;
wxPoint m_position;
wxSizerItemList m_children;
// the window this sizer is used in, can be NULL
wxWindow *m_containingWindow;
wxSize GetMaxClientSize( wxWindow *window ) const;
wxSize GetMinClientSize( wxWindow *window );
wxSize VirtualFitSize( wxWindow *window );
virtual void DoSetMinSize( int width, int height );
virtual bool DoSetItemMinSize( wxWindow *window, int width, int height );
virtual bool DoSetItemMinSize( wxSizer *sizer, int width, int height );
virtual bool DoSetItemMinSize( size_t index, int width, int height );
// insert a new item into m_children at given index and return the item
// itself
virtual wxSizerItem* DoInsert(size_t index, wxSizerItem *item);
private:
wxDECLARE_CLASS(wxSizer);
};
//---------------------------------------------------------------------------
// wxGridSizer
//---------------------------------------------------------------------------
class WXDLLIMPEXP_CORE wxGridSizer: public wxSizer
{
public:
// ctors specifying the number of columns only: number of rows will be
// deduced automatically depending on the number of sizer elements
wxGridSizer( int cols, int vgap, int hgap );
wxGridSizer( int cols, const wxSize& gap = wxSize(0, 0) );
// ctors specifying the number of rows and columns
wxGridSizer( int rows, int cols, int vgap, int hgap );
wxGridSizer( int rows, int cols, const wxSize& gap );
virtual void RecalcSizes() wxOVERRIDE;
virtual wxSize CalcMin() wxOVERRIDE;
void SetCols( int cols )
{
wxASSERT_MSG( cols >= 0, "Number of columns must be non-negative");
m_cols = cols;
}
void SetRows( int rows )
{
wxASSERT_MSG( rows >= 0, "Number of rows must be non-negative");
m_rows = rows;
}
void SetVGap( int gap ) { m_vgap = gap; }
void SetHGap( int gap ) { m_hgap = gap; }
int GetCols() const { return m_cols; }
int GetRows() const { return m_rows; }
int GetVGap() const { return m_vgap; }
int GetHGap() const { return m_hgap; }
int GetEffectiveColsCount() const { return m_cols ? m_cols : CalcCols(); }
int GetEffectiveRowsCount() const { return m_rows ? m_rows : CalcRows(); }
// return the number of total items and the number of columns and rows
// (for internal use only)
int CalcRowsCols(int& rows, int& cols) const;
protected:
// the number of rows/columns in the sizer, if 0 then it is determined
// dynamically depending on the total number of items
int m_rows;
int m_cols;
// gaps between rows and columns
int m_vgap;
int m_hgap;
virtual wxSizerItem *DoInsert(size_t index, wxSizerItem *item) wxOVERRIDE;
void SetItemBounds( wxSizerItem *item, int x, int y, int w, int h );
// returns the number of columns/rows needed for the current total number
// of children (and the fixed number of rows/columns)
int CalcCols() const
{
wxCHECK_MSG
(
m_rows, 0,
"Can't calculate number of cols if number of rows is not specified"
);
return int(m_children.GetCount() + m_rows - 1) / m_rows;
}
int CalcRows() const
{
wxCHECK_MSG
(
m_cols, 0,
"Can't calculate number of cols if number of rows is not specified"
);
return int(m_children.GetCount() + m_cols - 1) / m_cols;
}
private:
wxDECLARE_CLASS(wxGridSizer);
};
//---------------------------------------------------------------------------
// wxFlexGridSizer
//---------------------------------------------------------------------------
// values which define the behaviour for resizing wxFlexGridSizer cells in the
// "non-flexible" direction
enum wxFlexSizerGrowMode
{
// don't resize the cells in non-flexible direction at all
wxFLEX_GROWMODE_NONE,
// uniformly resize only the specified ones (default)
wxFLEX_GROWMODE_SPECIFIED,
// uniformly resize all cells
wxFLEX_GROWMODE_ALL
};
class WXDLLIMPEXP_CORE wxFlexGridSizer: public wxGridSizer
{
public:
// ctors specifying the number of columns only: number of rows will be
// deduced automatically depending on the number of sizer elements
wxFlexGridSizer( int cols, int vgap, int hgap );
wxFlexGridSizer( int cols, const wxSize& gap = wxSize(0, 0) );
// ctors specifying the number of rows and columns
wxFlexGridSizer( int rows, int cols, int vgap, int hgap );
wxFlexGridSizer( int rows, int cols, const wxSize& gap );
// dtor
virtual ~wxFlexGridSizer();
// set the rows/columns which will grow (the others will remain of the
// constant initial size)
void AddGrowableRow( size_t idx, int proportion = 0 );
void RemoveGrowableRow( size_t idx );
void AddGrowableCol( size_t idx, int proportion = 0 );
void RemoveGrowableCol( size_t idx );
bool IsRowGrowable( size_t idx );
bool IsColGrowable( size_t idx );
// the sizer cells may grow in both directions, not grow at all or only
// grow in one direction but not the other
// the direction may be wxVERTICAL, wxHORIZONTAL or wxBOTH (default)
void SetFlexibleDirection(int direction) { m_flexDirection = direction; }
int GetFlexibleDirection() const { return m_flexDirection; }
// note that the grow mode only applies to the direction which is not
// flexible
void SetNonFlexibleGrowMode(wxFlexSizerGrowMode mode) { m_growMode = mode; }
wxFlexSizerGrowMode GetNonFlexibleGrowMode() const { return m_growMode; }
// Read-only access to the row heights and col widths arrays
const wxArrayInt& GetRowHeights() const { return m_rowHeights; }
const wxArrayInt& GetColWidths() const { return m_colWidths; }
// implementation
virtual void RecalcSizes() wxOVERRIDE;
virtual wxSize CalcMin() wxOVERRIDE;
protected:
void AdjustForFlexDirection();
void AdjustForGrowables(const wxSize& sz);
void FindWidthsAndHeights(int nrows, int ncols);
// the heights/widths of all rows/columns
wxArrayInt m_rowHeights,
m_colWidths;
// indices of the growable columns and rows
wxArrayInt m_growableRows,
m_growableCols;
// proportion values of the corresponding growable rows and columns
wxArrayInt m_growableRowsProportions,
m_growableColsProportions;
// parameters describing whether the growable cells should be resized in
// both directions or only one
int m_flexDirection;
wxFlexSizerGrowMode m_growMode;
// saves CalcMin result to optimize RecalcSizes
wxSize m_calculatedMinSize;
private:
wxDECLARE_CLASS(wxFlexGridSizer);
wxDECLARE_NO_COPY_CLASS(wxFlexGridSizer);
};
//---------------------------------------------------------------------------
// wxBoxSizer
//---------------------------------------------------------------------------
class WXDLLIMPEXP_CORE wxBoxSizer: public wxSizer
{
public:
wxBoxSizer(int orient)
{
m_orient = orient;
m_totalProportion = 0;
wxASSERT_MSG( m_orient == wxHORIZONTAL || m_orient == wxVERTICAL,
wxT("invalid value for wxBoxSizer orientation") );
}
virtual wxSizerItem *AddSpacer(int size) wxOVERRIDE;
int GetOrientation() const { return m_orient; }
bool IsVertical() const { return m_orient == wxVERTICAL; }
void SetOrientation(int orient) { m_orient = orient; }
// implementation of our resizing logic
virtual wxSize CalcMin() wxOVERRIDE;
virtual void RecalcSizes() wxOVERRIDE;
virtual bool InformFirstDirection(int direction,
int size,
int availableOtherDir) wxOVERRIDE;
protected:
// Only overridden to perform extra debugging checks.
virtual wxSizerItem *DoInsert(size_t index, wxSizerItem *item) wxOVERRIDE;
// helpers for our code: this returns the component of the given wxSize in
// the direction of the sizer and in the other direction, respectively
int GetSizeInMajorDir(const wxSize& sz) const
{
return m_orient == wxHORIZONTAL ? sz.x : sz.y;
}
int& SizeInMajorDir(wxSize& sz)
{
return m_orient == wxHORIZONTAL ? sz.x : sz.y;
}
int& PosInMajorDir(wxPoint& pt)
{
return m_orient == wxHORIZONTAL ? pt.x : pt.y;
}
int GetSizeInMinorDir(const wxSize& sz) const
{
return m_orient == wxHORIZONTAL ? sz.y : sz.x;
}
int& SizeInMinorDir(wxSize& sz)
{
return m_orient == wxHORIZONTAL ? sz.y : sz.x;
}
int& PosInMinorDir(wxPoint& pt)
{
return m_orient == wxHORIZONTAL ? pt.y : pt.x;
}
// another helper: creates wxSize from major and minor components
wxSize SizeFromMajorMinor(int major, int minor) const
{
if ( m_orient == wxHORIZONTAL )
{
return wxSize(major, minor);
}
else // wxVERTICAL
{
return wxSize(minor, major);
}
}
// either wxHORIZONTAL or wxVERTICAL
int m_orient;
// the sum of proportion of all of our elements
int m_totalProportion;
// the minimal size needed for this sizer as calculated by the last call to
// our CalcMin()
wxSize m_calculatedMinSize;
private:
wxDECLARE_CLASS(wxBoxSizer);
};
//---------------------------------------------------------------------------
// wxStaticBoxSizer
//---------------------------------------------------------------------------
#if wxUSE_STATBOX
class WXDLLIMPEXP_FWD_CORE wxStaticBox;
class WXDLLIMPEXP_CORE wxStaticBoxSizer: public wxBoxSizer
{
public:
wxStaticBoxSizer(wxStaticBox *box, int orient);
wxStaticBoxSizer(int orient, wxWindow *win, const wxString& label = wxEmptyString);
virtual ~wxStaticBoxSizer();
void RecalcSizes() wxOVERRIDE;
wxSize CalcMin() wxOVERRIDE;
wxStaticBox *GetStaticBox() const
{ return m_staticBox; }
// override to hide/show the static box as well
virtual void ShowItems (bool show) wxOVERRIDE;
virtual bool AreAnyItemsShown() const wxOVERRIDE;
virtual bool Detach( wxWindow *window ) wxOVERRIDE;
virtual bool Detach( wxSizer *sizer ) wxOVERRIDE { return wxBoxSizer::Detach(sizer); }
virtual bool Detach( int index ) wxOVERRIDE { return wxBoxSizer::Detach(index); }
protected:
wxStaticBox *m_staticBox;
private:
wxDECLARE_CLASS(wxStaticBoxSizer);
wxDECLARE_NO_COPY_CLASS(wxStaticBoxSizer);
};
#endif // wxUSE_STATBOX
//---------------------------------------------------------------------------
// wxStdDialogButtonSizer
//---------------------------------------------------------------------------
#if wxUSE_BUTTON
class WXDLLIMPEXP_CORE wxStdDialogButtonSizer: public wxBoxSizer
{
public:
// Constructor just creates a new wxBoxSizer, not much else.
// Box sizer orientation is automatically determined here:
// vertical for PDAs, horizontal for everything else?
wxStdDialogButtonSizer();
// Checks button ID against system IDs and sets one of the pointers below
// to this button. Does not do any sizer-related things here.
void AddButton(wxButton *button);
// Use these if no standard ID can/should be used
void SetAffirmativeButton( wxButton *button );
void SetNegativeButton( wxButton *button );
void SetCancelButton( wxButton *button );
// All platform-specific code here, checks which buttons exist and add
// them to the sizer accordingly.
// Note - one potential hack on Mac we could use here,
// if m_buttonAffirmative is wxID_SAVE then ensure wxID_SAVE
// is set to _("Save") and m_buttonNegative is set to _("Don't Save")
// I wouldn't add any other hacks like that into here,
// but this one I can see being useful.
void Realize();
wxButton *GetAffirmativeButton() const { return m_buttonAffirmative; }
wxButton *GetApplyButton() const { return m_buttonApply; }
wxButton *GetNegativeButton() const { return m_buttonNegative; }
wxButton *GetCancelButton() const { return m_buttonCancel; }
wxButton *GetHelpButton() const { return m_buttonHelp; }
protected:
wxButton *m_buttonAffirmative; // wxID_OK, wxID_YES, wxID_SAVE go here
wxButton *m_buttonApply; // wxID_APPLY
wxButton *m_buttonNegative; // wxID_NO
wxButton *m_buttonCancel; // wxID_CANCEL, wxID_CLOSE
wxButton *m_buttonHelp; // wxID_HELP, wxID_CONTEXT_HELP
private:
wxDECLARE_CLASS(wxStdDialogButtonSizer);
wxDECLARE_NO_COPY_CLASS(wxStdDialogButtonSizer);
};
#endif // wxUSE_BUTTON
// ----------------------------------------------------------------------------
// inline functions implementation
// ----------------------------------------------------------------------------
#if WXWIN_COMPATIBILITY_2_8
inline void wxSizerItem::SetWindow(wxWindow *window)
{
DoSetWindow(window);
}
inline void wxSizerItem::SetSizer(wxSizer *sizer)
{
DoSetSizer(sizer);
}
inline void wxSizerItem::SetSpacer(const wxSize& size)
{
DoSetSpacer(size);
}
inline void wxSizerItem::SetSpacer(int width, int height)
{
DoSetSpacer(wxSize(width, height));
}
#endif // WXWIN_COMPATIBILITY_2_8
inline wxSizerItem*
wxSizer::Insert(size_t index, wxSizerItem *item)
{
return DoInsert(index, item);
}
inline wxSizerItem*
wxSizer::Add( wxSizerItem *item )
{
return Insert( m_children.GetCount(), item );
}
inline wxSizerItem*
wxSizer::Add( wxWindow *window, int proportion, int flag, int border, wxObject* userData )
{
return Add( new wxSizerItem( window, proportion, flag, border, userData ) );
}
inline wxSizerItem*
wxSizer::Add( wxSizer *sizer, int proportion, int flag, int border, wxObject* userData )
{
return Add( new wxSizerItem( sizer, proportion, flag, border, userData ) );
}
inline wxSizerItem*
wxSizer::Add( int width, int height, int proportion, int flag, int border, wxObject* userData )
{
return Add( new wxSizerItem( width, height, proportion, flag, border, userData ) );
}
inline wxSizerItem*
wxSizer::Add( wxWindow *window, const wxSizerFlags& flags )
{
return Add( new wxSizerItem(window, flags) );
}
inline wxSizerItem*
wxSizer::Add( wxSizer *sizer, const wxSizerFlags& flags )
{
return Add( new wxSizerItem(sizer, flags) );
}
inline wxSizerItem*
wxSizer::Add( int width, int height, const wxSizerFlags& flags )
{
return Add( new wxSizerItem(width, height, flags) );
}
inline wxSizerItem*
wxSizer::AddSpacer(int size)
{
return Add(size, size);
}
inline wxSizerItem*
wxSizer::AddStretchSpacer(int prop)
{
return Add(0, 0, prop);
}
inline wxSizerItem*
wxSizer::Prepend( wxSizerItem *item )
{
return Insert( 0, item );
}
inline wxSizerItem*
wxSizer::Prepend( wxWindow *window, int proportion, int flag, int border, wxObject* userData )
{
return Prepend( new wxSizerItem( window, proportion, flag, border, userData ) );
}
inline wxSizerItem*
wxSizer::Prepend( wxSizer *sizer, int proportion, int flag, int border, wxObject* userData )
{
return Prepend( new wxSizerItem( sizer, proportion, flag, border, userData ) );
}
inline wxSizerItem*
wxSizer::Prepend( int width, int height, int proportion, int flag, int border, wxObject* userData )
{
return Prepend( new wxSizerItem( width, height, proportion, flag, border, userData ) );
}
inline wxSizerItem*
wxSizer::PrependSpacer(int size)
{
return Prepend(size, size);
}
inline wxSizerItem*
wxSizer::PrependStretchSpacer(int prop)
{
return Prepend(0, 0, prop);
}
inline wxSizerItem*
wxSizer::Prepend( wxWindow *window, const wxSizerFlags& flags )
{
return Prepend( new wxSizerItem(window, flags) );
}
inline wxSizerItem*
wxSizer::Prepend( wxSizer *sizer, const wxSizerFlags& flags )
{
return Prepend( new wxSizerItem(sizer, flags) );
}
inline wxSizerItem*
wxSizer::Prepend( int width, int height, const wxSizerFlags& flags )
{
return Prepend( new wxSizerItem(width, height, flags) );
}
inline wxSizerItem*
wxSizer::Insert( size_t index,
wxWindow *window,
int proportion,
int flag,
int border,
wxObject* userData )
{
return Insert( index, new wxSizerItem( window, proportion, flag, border, userData ) );
}
inline wxSizerItem*
wxSizer::Insert( size_t index,
wxSizer *sizer,
int proportion,
int flag,
int border,
wxObject* userData )
{
return Insert( index, new wxSizerItem( sizer, proportion, flag, border, userData ) );
}
inline wxSizerItem*
wxSizer::Insert( size_t index,
int width,
int height,
int proportion,
int flag,
int border,
wxObject* userData )
{
return Insert( index, new wxSizerItem( width, height, proportion, flag, border, userData ) );
}
inline wxSizerItem*
wxSizer::Insert( size_t index, wxWindow *window, const wxSizerFlags& flags )
{
return Insert( index, new wxSizerItem(window, flags) );
}
inline wxSizerItem*
wxSizer::Insert( size_t index, wxSizer *sizer, const wxSizerFlags& flags )
{
return Insert( index, new wxSizerItem(sizer, flags) );
}
inline wxSizerItem*
wxSizer::Insert( size_t index, int width, int height, const wxSizerFlags& flags )
{
return Insert( index, new wxSizerItem(width, height, flags) );
}
inline wxSizerItem*
wxSizer::InsertSpacer(size_t index, int size)
{
return Insert(index, size, size);
}
inline wxSizerItem*
wxSizer::InsertStretchSpacer(size_t index, int prop)
{
return Insert(index, 0, 0, prop);
}
#endif // __WXSIZER_H__
| h |
rticonnextdds-usecases | data/projects/rticonnextdds-usecases/VehicleTracking/ExampleCode/thirdparty/wxWidgets-3.1.2/Linux/include/wx/compositewin.h | ///////////////////////////////////////////////////////////////////////////////
// Name: wx/compositewin.h
// Purpose: wxCompositeWindow<> declaration
// Author: Vadim Zeitlin
// Created: 2011-01-02
// Copyright: (c) 2011 Vadim Zeitlin <[email protected]>
// Licence: wxWindows licence
///////////////////////////////////////////////////////////////////////////////
#ifndef _WX_COMPOSITEWIN_H_
#define _WX_COMPOSITEWIN_H_
#include "wx/window.h"
#include "wx/containr.h"
class WXDLLIMPEXP_FWD_CORE wxToolTip;
// NB: This is an experimental and, as for now, undocumented class used only by
// wxWidgets itself internally. Don't use it in your code until its API is
// officially stabilized unless you are ready to change it with the next
// wxWidgets release.
// ----------------------------------------------------------------------------
// wxCompositeWindow is a helper for implementing composite windows: to define
// a class using subwindows, simply inherit from it specialized with the real
// base class name and implement GetCompositeWindowParts() pure virtual method.
// ----------------------------------------------------------------------------
// This is the base class of wxCompositeWindow which takes care of propagating
// colours, fonts etc changes to all the children, but doesn't bother with
// handling their events or focus. There should be rarely any need to use it
// rather than the full wxCompositeWindow.
// The template parameter W must be a wxWindow-derived class.
template <class W>
class wxCompositeWindowSettersOnly : public W
{
public:
typedef W BaseWindowClass;
// Override all wxWindow methods which must be forwarded to the composite
// window parts.
// Attribute setters group.
//
// NB: Unfortunately we can't factor out the call for the setter itself
// into DoSetForAllParts() because we can't call the function passed to
// it non-virtually and we need to do this to avoid infinite recursion,
// so we work around this by calling the method of this object itself
// manually in each function.
virtual bool SetForegroundColour(const wxColour& colour) wxOVERRIDE
{
if ( !BaseWindowClass::SetForegroundColour(colour) )
return false;
SetForAllParts(&wxWindowBase::SetForegroundColour, colour);
return true;
}
virtual bool SetBackgroundColour(const wxColour& colour) wxOVERRIDE
{
if ( !BaseWindowClass::SetBackgroundColour(colour) )
return false;
SetForAllParts(&wxWindowBase::SetBackgroundColour, colour);
return true;
}
virtual bool SetFont(const wxFont& font) wxOVERRIDE
{
if ( !BaseWindowClass::SetFont(font) )
return false;
SetForAllParts(&wxWindowBase::SetFont, font);
return true;
}
virtual bool SetCursor(const wxCursor& cursor) wxOVERRIDE
{
if ( !BaseWindowClass::SetCursor(cursor) )
return false;
SetForAllParts(&wxWindowBase::SetCursor, cursor);
return true;
}
virtual void SetLayoutDirection(wxLayoutDirection dir) wxOVERRIDE
{
BaseWindowClass::SetLayoutDirection(dir);
SetForAllParts(&wxWindowBase::SetLayoutDirection, dir);
// The child layout almost invariably depends on the layout direction,
// so redo it when it changes.
//
// However avoid doing it when we're called from wxWindow::Create() in
// wxGTK as the derived window is not fully created yet and calling its
// SetSize() may be unexpected. This does mean that any future calls to
// SetLayoutDirection(wxLayout_Default) wouldn't result in a re-layout
// neither, but then we're not supposed to be called with it at all.
if ( dir != wxLayout_Default )
this->SetSize(-1, -1, -1, -1, wxSIZE_FORCE);
}
#if wxUSE_TOOLTIPS
virtual void DoSetToolTipText(const wxString &tip) wxOVERRIDE
{
BaseWindowClass::DoSetToolTipText(tip);
// Use a variable to disambiguate between SetToolTip() overloads.
void (wxWindowBase::*func)(const wxString&) = &wxWindowBase::SetToolTip;
SetForAllParts(func, tip);
}
virtual void DoSetToolTip(wxToolTip *tip) wxOVERRIDE
{
BaseWindowClass::DoSetToolTip(tip);
SetForAllParts(&wxWindowBase::CopyToolTip, tip);
}
#endif // wxUSE_TOOLTIPS
protected:
// Trivial but necessary default ctor.
wxCompositeWindowSettersOnly()
{
}
private:
// Must be implemented by the derived class to return all children to which
// the public methods we override should forward to.
virtual wxWindowList GetCompositeWindowParts() const = 0;
template <class T, class TArg, class R>
void SetForAllParts(R (wxWindowBase::*func)(TArg), T arg)
{
// Simply call the setters for all parts of this composite window.
const wxWindowList parts = GetCompositeWindowParts();
for ( wxWindowList::const_iterator i = parts.begin();
i != parts.end();
++i )
{
wxWindow * const child = *i;
// Allow NULL elements in the list, this makes the code of derived
// composite controls which may have optionally shown children
// simpler and it doesn't cost us much here.
if ( child )
(child->*func)(arg);
}
}
wxDECLARE_NO_COPY_TEMPLATE_CLASS(wxCompositeWindowSettersOnly, W);
};
// The real wxCompositeWindow itself, inheriting all the setters defined above.
template <class W>
class wxCompositeWindow : public wxCompositeWindowSettersOnly<W>
{
public:
virtual void SetFocus() wxOVERRIDE
{
wxSetFocusToChild(this, NULL);
}
protected:
// Default ctor sets things up for handling children events correctly.
wxCompositeWindow()
{
this->Bind(wxEVT_CREATE, &wxCompositeWindow::OnWindowCreate, this);
}
private:
void OnWindowCreate(wxWindowCreateEvent& event)
{
event.Skip();
// Attach a few event handlers to all parts of the composite window.
// This makes the composite window behave more like a simple control
// and allows other code (such as wxDataViewCtrl's inline editing
// support) to hook into its event processing.
wxWindow *child = event.GetWindow();
// Check that it's one of our children: it could also be this window
// itself (for which we don't need to handle focus at all) or one of
// its grandchildren and we don't want to bind to those as child
// controls are supposed to be well-behaved and get their own focus
// event if any of their children get focus anyhow, so binding to them
// would only result in duplicate events.
//
// Notice that we can't use GetCompositeWindowParts() here because the
// member variables that are typically used in its implementation in
// the derived classes would typically not be initialized yet, as this
// event is generated by "m_child = new wxChildControl(this, ...)" code
// before "m_child" is assigned.
if ( child->GetParent() != this )
return;
child->Bind(wxEVT_SET_FOCUS, &wxCompositeWindow::OnSetFocus, this);
child->Bind(wxEVT_KILL_FOCUS, &wxCompositeWindow::OnKillFocus, this);
// Some events should be only handled for non-toplevel children. For
// example, we want to close the control in wxDataViewCtrl when Enter
// is pressed in the inline editor, but not when it's pressed in a
// popup dialog it opens.
wxWindow *win = child;
while ( win && win != this )
{
if ( win->IsTopLevel() )
return;
win = win->GetParent();
}
child->Bind(wxEVT_CHAR, &wxCompositeWindow::OnChar, this);
}
void OnChar(wxKeyEvent& event)
{
if ( !this->ProcessWindowEvent(event) )
event.Skip();
}
void OnSetFocus(wxFocusEvent& event)
{
event.Skip();
// When a child of a composite window gains focus, the entire composite
// focus gains focus as well -- unless it had it already.
//
// We suppose that we hadn't had focus if the event doesn't carry the
// previously focused window as it normally means that it comes from
// outside of this program.
wxWindow* const oldFocus = event.GetWindow();
if ( !oldFocus || oldFocus->GetMainWindowOfCompositeControl() != this )
{
wxFocusEvent eventThis(wxEVT_SET_FOCUS, this->GetId());
eventThis.SetEventObject(this);
eventThis.SetWindow(event.GetWindow());
this->ProcessWindowEvent(eventThis);
}
}
void OnKillFocus(wxFocusEvent& event)
{
// Ignore focus changes within the composite control:
wxWindow *win = event.GetWindow();
while ( win )
{
if ( win == this )
{
event.Skip();
return;
}
// Note that we don't use IsTopLevel() check here, because we do
// want to ignore focus changes going to toplevel window that have
// the composite control as its parent; these would typically be
// some kind of control's popup window.
win = win->GetParent();
}
// The event shouldn't be ignored, forward it to the main control:
if ( !this->ProcessWindowEvent(event) )
event.Skip();
}
wxDECLARE_NO_COPY_TEMPLATE_CLASS(wxCompositeWindow, W);
};
#endif // _WX_COMPOSITEWIN_H_
| h |
rticonnextdds-usecases | data/projects/rticonnextdds-usecases/VehicleTracking/ExampleCode/thirdparty/wxWidgets-3.1.2/Linux/include/wx/geometry.h | /////////////////////////////////////////////////////////////////////////////
// Name: wx/geometry.h
// Purpose: Common Geometry Classes
// Author: Stefan Csomor
// Modified by:
// Created: 08/05/99
// Copyright: (c) 1999 Stefan Csomor
// Licence: wxWindows licence
/////////////////////////////////////////////////////////////////////////////
#ifndef _WX_GEOMETRY_H_
#define _WX_GEOMETRY_H_
#include "wx/defs.h"
#if wxUSE_GEOMETRY
#include "wx/utils.h"
#include "wx/gdicmn.h"
#include "wx/math.h"
class WXDLLIMPEXP_FWD_BASE wxDataInputStream;
class WXDLLIMPEXP_FWD_BASE wxDataOutputStream;
// clipping from Cohen-Sutherland
enum wxOutCode
{
wxInside = 0x00 ,
wxOutLeft = 0x01 ,
wxOutRight = 0x02 ,
wxOutTop = 0x08 ,
wxOutBottom = 0x04
};
class WXDLLIMPEXP_CORE wxPoint2DInt
{
public :
inline wxPoint2DInt();
inline wxPoint2DInt( wxInt32 x , wxInt32 y );
inline wxPoint2DInt( const wxPoint2DInt &pt );
inline wxPoint2DInt( const wxPoint &pt );
// noops for this class, just return the coords
inline void GetFloor( wxInt32 *x , wxInt32 *y ) const;
inline void GetRounded( wxInt32 *x , wxInt32 *y ) const;
inline wxDouble GetVectorLength() const;
wxDouble GetVectorAngle() const;
inline void SetVectorLength( wxDouble length );
void SetVectorAngle( wxDouble degrees );
// set the vector length to 1.0, preserving the angle
inline void Normalize();
inline wxDouble GetDistance( const wxPoint2DInt &pt ) const;
inline wxDouble GetDistanceSquare( const wxPoint2DInt &pt ) const;
inline wxInt32 GetDotProduct( const wxPoint2DInt &vec ) const;
inline wxInt32 GetCrossProduct( const wxPoint2DInt &vec ) const;
// the reflection of this point
inline wxPoint2DInt operator-();
inline wxPoint2DInt& operator=(const wxPoint2DInt& pt);
inline wxPoint2DInt& operator+=(const wxPoint2DInt& pt);
inline wxPoint2DInt& operator-=(const wxPoint2DInt& pt);
inline wxPoint2DInt& operator*=(const wxPoint2DInt& pt);
inline wxPoint2DInt& operator*=(wxDouble n);
inline wxPoint2DInt& operator*=(wxInt32 n);
inline wxPoint2DInt& operator/=(const wxPoint2DInt& pt);
inline wxPoint2DInt& operator/=(wxDouble n);
inline wxPoint2DInt& operator/=(wxInt32 n);
inline operator wxPoint() const;
inline bool operator==(const wxPoint2DInt& pt) const;
inline bool operator!=(const wxPoint2DInt& pt) const;
#if wxUSE_STREAMS
void WriteTo( wxDataOutputStream &stream ) const;
void ReadFrom( wxDataInputStream &stream );
#endif // wxUSE_STREAMS
wxInt32 m_x;
wxInt32 m_y;
};
inline wxPoint2DInt operator+(const wxPoint2DInt& pt1 , const wxPoint2DInt& pt2);
inline wxPoint2DInt operator-(const wxPoint2DInt& pt1 , const wxPoint2DInt& pt2);
inline wxPoint2DInt operator*(const wxPoint2DInt& pt1 , const wxPoint2DInt& pt2);
inline wxPoint2DInt operator*(wxInt32 n , const wxPoint2DInt& pt);
inline wxPoint2DInt operator*(wxDouble n , const wxPoint2DInt& pt);
inline wxPoint2DInt operator*(const wxPoint2DInt& pt , wxInt32 n);
inline wxPoint2DInt operator*(const wxPoint2DInt& pt , wxDouble n);
inline wxPoint2DInt operator/(const wxPoint2DInt& pt1 , const wxPoint2DInt& pt2);
inline wxPoint2DInt operator/(const wxPoint2DInt& pt , wxInt32 n);
inline wxPoint2DInt operator/(const wxPoint2DInt& pt , wxDouble n);
inline wxPoint2DInt::wxPoint2DInt()
{
m_x = 0;
m_y = 0;
}
inline wxPoint2DInt::wxPoint2DInt( wxInt32 x , wxInt32 y )
{
m_x = x;
m_y = y;
}
inline wxPoint2DInt::wxPoint2DInt( const wxPoint2DInt &pt )
{
m_x = pt.m_x;
m_y = pt.m_y;
}
inline wxPoint2DInt::wxPoint2DInt( const wxPoint &pt )
{
m_x = pt.x;
m_y = pt.y;
}
inline void wxPoint2DInt::GetFloor( wxInt32 *x , wxInt32 *y ) const
{
if ( x )
*x = m_x;
if ( y )
*y = m_y;
}
inline void wxPoint2DInt::GetRounded( wxInt32 *x , wxInt32 *y ) const
{
GetFloor(x, y);
}
inline wxDouble wxPoint2DInt::GetVectorLength() const
{
// cast needed MIPSpro compiler under SGI
return sqrt( (double)(m_x)*(m_x) + (m_y)*(m_y) );
}
inline void wxPoint2DInt::SetVectorLength( wxDouble length )
{
wxDouble before = GetVectorLength();
m_x = (wxInt32)(m_x * length / before);
m_y = (wxInt32)(m_y * length / before);
}
inline void wxPoint2DInt::Normalize()
{
SetVectorLength( 1 );
}
inline wxDouble wxPoint2DInt::GetDistance( const wxPoint2DInt &pt ) const
{
return sqrt( GetDistanceSquare( pt ) );
}
inline wxDouble wxPoint2DInt::GetDistanceSquare( const wxPoint2DInt &pt ) const
{
return ( (pt.m_x-m_x)*(pt.m_x-m_x) + (pt.m_y-m_y)*(pt.m_y-m_y) );
}
inline wxInt32 wxPoint2DInt::GetDotProduct( const wxPoint2DInt &vec ) const
{
return ( m_x * vec.m_x + m_y * vec.m_y );
}
inline wxInt32 wxPoint2DInt::GetCrossProduct( const wxPoint2DInt &vec ) const
{
return ( m_x * vec.m_y - vec.m_x * m_y );
}
inline wxPoint2DInt::operator wxPoint() const
{
return wxPoint( m_x, m_y);
}
inline wxPoint2DInt wxPoint2DInt::operator-()
{
return wxPoint2DInt( -m_x, -m_y);
}
inline wxPoint2DInt& wxPoint2DInt::operator=(const wxPoint2DInt& pt)
{
if (this != &pt)
{
m_x = pt.m_x;
m_y = pt.m_y;
}
return *this;
}
inline wxPoint2DInt& wxPoint2DInt::operator+=(const wxPoint2DInt& pt)
{
m_x = m_x + pt.m_x;
m_y = m_y + pt.m_y;
return *this;
}
inline wxPoint2DInt& wxPoint2DInt::operator-=(const wxPoint2DInt& pt)
{
m_x = m_x - pt.m_x;
m_y = m_y - pt.m_y;
return *this;
}
inline wxPoint2DInt& wxPoint2DInt::operator*=(const wxPoint2DInt& pt)
{
m_x = m_x * pt.m_x;
m_y = m_y * pt.m_y;
return *this;
}
inline wxPoint2DInt& wxPoint2DInt::operator/=(const wxPoint2DInt& pt)
{
m_x = m_x / pt.m_x;
m_y = m_y / pt.m_y;
return *this;
}
inline bool wxPoint2DInt::operator==(const wxPoint2DInt& pt) const
{
return m_x == pt.m_x && m_y == pt.m_y;
}
inline bool wxPoint2DInt::operator!=(const wxPoint2DInt& pt) const
{
return m_x != pt.m_x || m_y != pt.m_y;
}
inline wxPoint2DInt operator+(const wxPoint2DInt& pt1 , const wxPoint2DInt& pt2)
{
return wxPoint2DInt( pt1.m_x + pt2.m_x , pt1.m_y + pt2.m_y );
}
inline wxPoint2DInt operator-(const wxPoint2DInt& pt1 , const wxPoint2DInt& pt2)
{
return wxPoint2DInt( pt1.m_x - pt2.m_x , pt1.m_y - pt2.m_y );
}
inline wxPoint2DInt operator*(const wxPoint2DInt& pt1 , const wxPoint2DInt& pt2)
{
return wxPoint2DInt( pt1.m_x * pt2.m_x , pt1.m_y * pt2.m_y );
}
inline wxPoint2DInt operator*(wxInt32 n , const wxPoint2DInt& pt)
{
return wxPoint2DInt( pt.m_x * n , pt.m_y * n );
}
inline wxPoint2DInt operator*(wxDouble n , const wxPoint2DInt& pt)
{
return wxPoint2DInt( static_cast<wxInt32>(pt.m_x * n) ,
static_cast<wxInt32>(pt.m_y * n) );
}
inline wxPoint2DInt operator*(const wxPoint2DInt& pt , wxInt32 n)
{
return wxPoint2DInt( pt.m_x * n , pt.m_y * n );
}
inline wxPoint2DInt operator*(const wxPoint2DInt& pt , wxDouble n)
{
return wxPoint2DInt( static_cast<wxInt32>(pt.m_x * n) ,
static_cast<wxInt32>(pt.m_y * n) );
}
inline wxPoint2DInt operator/(const wxPoint2DInt& pt1 , const wxPoint2DInt& pt2)
{
return wxPoint2DInt( pt1.m_x / pt2.m_x , pt1.m_y / pt2.m_y );
}
inline wxPoint2DInt operator/(const wxPoint2DInt& pt , wxInt32 n)
{
return wxPoint2DInt( pt.m_x / n , pt.m_y / n );
}
inline wxPoint2DInt operator/(const wxPoint2DInt& pt , wxDouble n)
{
return wxPoint2DInt( static_cast<wxInt32>(pt.m_x / n) ,
static_cast<wxInt32>(pt.m_y / n) );
}
// wxPoint2Ds represent a point or a vector in a 2d coordinate system
class WXDLLIMPEXP_CORE wxPoint2DDouble
{
public :
inline wxPoint2DDouble();
inline wxPoint2DDouble( wxDouble x , wxDouble y );
inline wxPoint2DDouble( const wxPoint2DDouble &pt );
wxPoint2DDouble( const wxPoint2DInt &pt )
{ m_x = (wxDouble) pt.m_x ; m_y = (wxDouble) pt.m_y ; }
wxPoint2DDouble( const wxPoint &pt )
{ m_x = (wxDouble) pt.x ; m_y = (wxDouble) pt.y ; }
// two different conversions to integers, floor and rounding
inline void GetFloor( wxInt32 *x , wxInt32 *y ) const;
inline void GetRounded( wxInt32 *x , wxInt32 *y ) const;
inline wxDouble GetVectorLength() const;
wxDouble GetVectorAngle() const ;
void SetVectorLength( wxDouble length );
void SetVectorAngle( wxDouble degrees );
// set the vector length to 1.0, preserving the angle
void Normalize();
inline wxDouble GetDistance( const wxPoint2DDouble &pt ) const;
inline wxDouble GetDistanceSquare( const wxPoint2DDouble &pt ) const;
inline wxDouble GetDotProduct( const wxPoint2DDouble &vec ) const;
inline wxDouble GetCrossProduct( const wxPoint2DDouble &vec ) const;
// the reflection of this point
inline wxPoint2DDouble operator-();
inline wxPoint2DDouble& operator=(const wxPoint2DDouble& pt);
inline wxPoint2DDouble& operator+=(const wxPoint2DDouble& pt);
inline wxPoint2DDouble& operator-=(const wxPoint2DDouble& pt);
inline wxPoint2DDouble& operator*=(const wxPoint2DDouble& pt);
inline wxPoint2DDouble& operator*=(wxDouble n);
inline wxPoint2DDouble& operator*=(wxInt32 n);
inline wxPoint2DDouble& operator/=(const wxPoint2DDouble& pt);
inline wxPoint2DDouble& operator/=(wxDouble n);
inline wxPoint2DDouble& operator/=(wxInt32 n);
inline bool operator==(const wxPoint2DDouble& pt) const;
inline bool operator!=(const wxPoint2DDouble& pt) const;
wxDouble m_x;
wxDouble m_y;
};
inline wxPoint2DDouble operator+(const wxPoint2DDouble& pt1 , const wxPoint2DDouble& pt2);
inline wxPoint2DDouble operator-(const wxPoint2DDouble& pt1 , const wxPoint2DDouble& pt2);
inline wxPoint2DDouble operator*(const wxPoint2DDouble& pt1 , const wxPoint2DDouble& pt2);
inline wxPoint2DDouble operator*(wxDouble n , const wxPoint2DDouble& pt);
inline wxPoint2DDouble operator*(wxInt32 n , const wxPoint2DDouble& pt);
inline wxPoint2DDouble operator*(const wxPoint2DDouble& pt , wxDouble n);
inline wxPoint2DDouble operator*(const wxPoint2DDouble& pt , wxInt32 n);
inline wxPoint2DDouble operator/(const wxPoint2DDouble& pt1 , const wxPoint2DDouble& pt2);
inline wxPoint2DDouble operator/(const wxPoint2DDouble& pt , wxDouble n);
inline wxPoint2DDouble operator/(const wxPoint2DDouble& pt , wxInt32 n);
inline wxPoint2DDouble::wxPoint2DDouble()
{
m_x = 0.0;
m_y = 0.0;
}
inline wxPoint2DDouble::wxPoint2DDouble( wxDouble x , wxDouble y )
{
m_x = x;
m_y = y;
}
inline wxPoint2DDouble::wxPoint2DDouble( const wxPoint2DDouble &pt )
{
m_x = pt.m_x;
m_y = pt.m_y;
}
inline void wxPoint2DDouble::GetFloor( wxInt32 *x , wxInt32 *y ) const
{
*x = (wxInt32) floor( m_x );
*y = (wxInt32) floor( m_y );
}
inline void wxPoint2DDouble::GetRounded( wxInt32 *x , wxInt32 *y ) const
{
*x = (wxInt32) floor( m_x + 0.5 );
*y = (wxInt32) floor( m_y + 0.5);
}
inline wxDouble wxPoint2DDouble::GetVectorLength() const
{
return sqrt( (m_x)*(m_x) + (m_y)*(m_y) ) ;
}
inline void wxPoint2DDouble::SetVectorLength( wxDouble length )
{
wxDouble before = GetVectorLength() ;
m_x = (m_x * length / before) ;
m_y = (m_y * length / before) ;
}
inline void wxPoint2DDouble::Normalize()
{
SetVectorLength( 1 );
}
inline wxDouble wxPoint2DDouble::GetDistance( const wxPoint2DDouble &pt ) const
{
return sqrt( GetDistanceSquare( pt ) );
}
inline wxDouble wxPoint2DDouble::GetDistanceSquare( const wxPoint2DDouble &pt ) const
{
return ( (pt.m_x-m_x)*(pt.m_x-m_x) + (pt.m_y-m_y)*(pt.m_y-m_y) );
}
inline wxDouble wxPoint2DDouble::GetDotProduct( const wxPoint2DDouble &vec ) const
{
return ( m_x * vec.m_x + m_y * vec.m_y );
}
inline wxDouble wxPoint2DDouble::GetCrossProduct( const wxPoint2DDouble &vec ) const
{
return ( m_x * vec.m_y - vec.m_x * m_y );
}
inline wxPoint2DDouble wxPoint2DDouble::operator-()
{
return wxPoint2DDouble( -m_x, -m_y);
}
inline wxPoint2DDouble& wxPoint2DDouble::operator=(const wxPoint2DDouble& pt)
{
if (this != &pt)
{
m_x = pt.m_x;
m_y = pt.m_y;
}
return *this;
}
inline wxPoint2DDouble& wxPoint2DDouble::operator+=(const wxPoint2DDouble& pt)
{
m_x = m_x + pt.m_x;
m_y = m_y + pt.m_y;
return *this;
}
inline wxPoint2DDouble& wxPoint2DDouble::operator-=(const wxPoint2DDouble& pt)
{
m_x = m_x - pt.m_x;
m_y = m_y - pt.m_y;
return *this;
}
inline wxPoint2DDouble& wxPoint2DDouble::operator*=(const wxPoint2DDouble& pt)
{
m_x = m_x * pt.m_x;
m_y = m_y * pt.m_y;
return *this;
}
inline wxPoint2DDouble& wxPoint2DDouble::operator/=(const wxPoint2DDouble& pt)
{
m_x = m_x / pt.m_x;
m_y = m_y / pt.m_y;
return *this;
}
inline bool wxPoint2DDouble::operator==(const wxPoint2DDouble& pt) const
{
return wxIsSameDouble(m_x, pt.m_x) && wxIsSameDouble(m_y, pt.m_y);
}
inline bool wxPoint2DDouble::operator!=(const wxPoint2DDouble& pt) const
{
return !(*this == pt);
}
inline wxPoint2DDouble operator+(const wxPoint2DDouble& pt1 , const wxPoint2DDouble& pt2)
{
return wxPoint2DDouble( pt1.m_x + pt2.m_x , pt1.m_y + pt2.m_y );
}
inline wxPoint2DDouble operator-(const wxPoint2DDouble& pt1 , const wxPoint2DDouble& pt2)
{
return wxPoint2DDouble( pt1.m_x - pt2.m_x , pt1.m_y - pt2.m_y );
}
inline wxPoint2DDouble operator*(const wxPoint2DDouble& pt1 , const wxPoint2DDouble& pt2)
{
return wxPoint2DDouble( pt1.m_x * pt2.m_x , pt1.m_y * pt2.m_y );
}
inline wxPoint2DDouble operator*(wxDouble n , const wxPoint2DDouble& pt)
{
return wxPoint2DDouble( pt.m_x * n , pt.m_y * n );
}
inline wxPoint2DDouble operator*(wxInt32 n , const wxPoint2DDouble& pt)
{
return wxPoint2DDouble( pt.m_x * n , pt.m_y * n );
}
inline wxPoint2DDouble operator*(const wxPoint2DDouble& pt , wxDouble n)
{
return wxPoint2DDouble( pt.m_x * n , pt.m_y * n );
}
inline wxPoint2DDouble operator*(const wxPoint2DDouble& pt , wxInt32 n)
{
return wxPoint2DDouble( pt.m_x * n , pt.m_y * n );
}
inline wxPoint2DDouble operator/(const wxPoint2DDouble& pt1 , const wxPoint2DDouble& pt2)
{
return wxPoint2DDouble( pt1.m_x / pt2.m_x , pt1.m_y / pt2.m_y );
}
inline wxPoint2DDouble operator/(const wxPoint2DDouble& pt , wxDouble n)
{
return wxPoint2DDouble( pt.m_x / n , pt.m_y / n );
}
inline wxPoint2DDouble operator/(const wxPoint2DDouble& pt , wxInt32 n)
{
return wxPoint2DDouble( pt.m_x / n , pt.m_y / n );
}
// wxRect2Ds are a axis-aligned rectangles, each side of the rect is parallel to the x- or m_y- axis. The rectangle is either defined by the
// top left and bottom right corner, or by the top left corner and size. A point is contained within the rectangle if
// left <= x < right and top <= m_y < bottom , thus it is a half open interval.
class WXDLLIMPEXP_CORE wxRect2DDouble
{
public:
wxRect2DDouble()
{ m_x = m_y = m_width = m_height = 0; }
wxRect2DDouble(wxDouble x, wxDouble y, wxDouble w, wxDouble h)
{ m_x = x; m_y = y; m_width = w; m_height = h; }
/*
wxRect2DDouble(const wxPoint2DDouble& topLeft, const wxPoint2DDouble& bottomRight);
wxRect2DDouble(const wxPoint2DDouble& pos, const wxSize& size);
wxRect2DDouble(const wxRect2DDouble& rect);
*/
// single attribute accessors
wxPoint2DDouble GetPosition() const
{ return wxPoint2DDouble(m_x, m_y); }
wxSize GetSize() const
{ return wxSize((int) m_width, (int) m_height); }
// for the edge and corner accessors there are two setters counterparts, the Set.. functions keep the other corners at their
// position whenever sensible, the Move.. functions keep the size of the rect and move the other corners appropriately
inline wxDouble GetLeft() const { return m_x; }
inline void SetLeft( wxDouble n ) { m_width += m_x - n; m_x = n; }
inline void MoveLeftTo( wxDouble n ) { m_x = n; }
inline wxDouble GetTop() const { return m_y; }
inline void SetTop( wxDouble n ) { m_height += m_y - n; m_y = n; }
inline void MoveTopTo( wxDouble n ) { m_y = n; }
inline wxDouble GetBottom() const { return m_y + m_height; }
inline void SetBottom( wxDouble n ) { m_height += n - (m_y+m_height);}
inline void MoveBottomTo( wxDouble n ) { m_y = n - m_height; }
inline wxDouble GetRight() const { return m_x + m_width; }
inline void SetRight( wxDouble n ) { m_width += n - (m_x+m_width) ; }
inline void MoveRightTo( wxDouble n ) { m_x = n - m_width; }
inline wxPoint2DDouble GetLeftTop() const
{ return wxPoint2DDouble( m_x , m_y ); }
inline void SetLeftTop( const wxPoint2DDouble &pt )
{ m_width += m_x - pt.m_x; m_height += m_y - pt.m_y; m_x = pt.m_x; m_y = pt.m_y; }
inline void MoveLeftTopTo( const wxPoint2DDouble &pt )
{ m_x = pt.m_x; m_y = pt.m_y; }
inline wxPoint2DDouble GetLeftBottom() const
{ return wxPoint2DDouble( m_x , m_y + m_height ); }
inline void SetLeftBottom( const wxPoint2DDouble &pt )
{ m_width += m_x - pt.m_x; m_height += pt.m_y - (m_y+m_height) ; m_x = pt.m_x; }
inline void MoveLeftBottomTo( const wxPoint2DDouble &pt )
{ m_x = pt.m_x; m_y = pt.m_y - m_height; }
inline wxPoint2DDouble GetRightTop() const
{ return wxPoint2DDouble( m_x+m_width , m_y ); }
inline void SetRightTop( const wxPoint2DDouble &pt )
{ m_width += pt.m_x - ( m_x + m_width ); m_height += m_y - pt.m_y; m_y = pt.m_y; }
inline void MoveRightTopTo( const wxPoint2DDouble &pt )
{ m_x = pt.m_x - m_width; m_y = pt.m_y; }
inline wxPoint2DDouble GetRightBottom() const
{ return wxPoint2DDouble( m_x+m_width , m_y + m_height ); }
inline void SetRightBottom( const wxPoint2DDouble &pt )
{ m_width += pt.m_x - ( m_x + m_width ); m_height += pt.m_y - (m_y+m_height);}
inline void MoveRightBottomTo( const wxPoint2DDouble &pt )
{ m_x = pt.m_x - m_width; m_y = pt.m_y - m_height; }
inline wxPoint2DDouble GetCentre() const
{ return wxPoint2DDouble( m_x+m_width/2 , m_y+m_height/2 ); }
inline void SetCentre( const wxPoint2DDouble &pt )
{ MoveCentreTo( pt ); } // since this is impossible without moving...
inline void MoveCentreTo( const wxPoint2DDouble &pt )
{ m_x += pt.m_x - (m_x+m_width/2); m_y += pt.m_y -(m_y+m_height/2); }
inline wxOutCode GetOutCode( const wxPoint2DDouble &pt ) const
{ return (wxOutCode) (( ( pt.m_x < m_x ) ? wxOutLeft : 0 ) +
( ( pt.m_x > m_x + m_width ) ? wxOutRight : 0 ) +
( ( pt.m_y < m_y ) ? wxOutTop : 0 ) +
( ( pt.m_y > m_y + m_height ) ? wxOutBottom : 0 )); }
inline wxOutCode GetOutcode(const wxPoint2DDouble &pt) const
{ return GetOutCode(pt) ; }
inline bool Contains( const wxPoint2DDouble &pt ) const
{ return GetOutCode( pt ) == wxInside; }
inline bool Contains( const wxRect2DDouble &rect ) const
{ return ( ( ( m_x <= rect.m_x ) && ( rect.m_x + rect.m_width <= m_x + m_width ) ) &&
( ( m_y <= rect.m_y ) && ( rect.m_y + rect.m_height <= m_y + m_height ) ) ); }
inline bool IsEmpty() const
{ return m_width <= 0 || m_height <= 0; }
inline bool HaveEqualSize( const wxRect2DDouble &rect ) const
{ return wxIsSameDouble(rect.m_width, m_width) && wxIsSameDouble(rect.m_height, m_height); }
inline void Inset( wxDouble x , wxDouble y )
{ m_x += x; m_y += y; m_width -= 2 * x; m_height -= 2 * y; }
inline void Inset( wxDouble left , wxDouble top ,wxDouble right , wxDouble bottom )
{ m_x += left; m_y += top; m_width -= left + right; m_height -= top + bottom;}
inline void Offset( const wxPoint2DDouble &pt )
{ m_x += pt.m_x; m_y += pt.m_y; }
void ConstrainTo( const wxRect2DDouble &rect );
inline wxPoint2DDouble Interpolate( wxInt32 widthfactor , wxInt32 heightfactor )
{ return wxPoint2DDouble( m_x + m_width * widthfactor , m_y + m_height * heightfactor ); }
static void Intersect( const wxRect2DDouble &src1 , const wxRect2DDouble &src2 , wxRect2DDouble *dest );
inline void Intersect( const wxRect2DDouble &otherRect )
{ Intersect( *this , otherRect , this ); }
inline wxRect2DDouble CreateIntersection( const wxRect2DDouble &otherRect ) const
{ wxRect2DDouble result; Intersect( *this , otherRect , &result); return result; }
bool Intersects( const wxRect2DDouble &rect ) const;
static void Union( const wxRect2DDouble &src1 , const wxRect2DDouble &src2 , wxRect2DDouble *dest );
void Union( const wxRect2DDouble &otherRect )
{ Union( *this , otherRect , this ); }
void Union( const wxPoint2DDouble &pt );
inline wxRect2DDouble CreateUnion( const wxRect2DDouble &otherRect ) const
{ wxRect2DDouble result; Union( *this , otherRect , &result); return result; }
inline void Scale( wxDouble f )
{ m_x *= f; m_y *= f; m_width *= f; m_height *= f;}
inline void Scale( wxInt32 num , wxInt32 denum )
{ m_x *= ((wxDouble)num)/((wxDouble)denum); m_y *= ((wxDouble)num)/((wxDouble)denum);
m_width *= ((wxDouble)num)/((wxDouble)denum); m_height *= ((wxDouble)num)/((wxDouble)denum);}
wxRect2DDouble& operator = (const wxRect2DDouble& rect);
inline bool operator == (const wxRect2DDouble& rect) const
{ return wxIsSameDouble(m_x, rect.m_x) && wxIsSameDouble(m_y, rect.m_y) && HaveEqualSize(rect); }
inline bool operator != (const wxRect2DDouble& rect) const
{ return !(*this == rect); }
wxDouble m_x;
wxDouble m_y;
wxDouble m_width;
wxDouble m_height;
};
// wxRect2Ds are a axis-aligned rectangles, each side of the rect is parallel to the x- or m_y- axis. The rectangle is either defined by the
// top left and bottom right corner, or by the top left corner and size. A point is contained within the rectangle if
// left <= x < right and top <= m_y < bottom , thus it is a half open interval.
class WXDLLIMPEXP_CORE wxRect2DInt
{
public:
wxRect2DInt() { m_x = m_y = m_width = m_height = 0; }
wxRect2DInt( const wxRect& r ) { m_x = r.x ; m_y = r.y ; m_width = r.width ; m_height = r.height ; }
wxRect2DInt(wxInt32 x, wxInt32 y, wxInt32 w, wxInt32 h) { m_x = x; m_y = y; m_width = w; m_height = h; }
wxRect2DInt(const wxPoint2DInt& topLeft, const wxPoint2DInt& bottomRight);
inline wxRect2DInt(const wxPoint2DInt& pos, const wxSize& size);
inline wxRect2DInt(const wxRect2DInt& rect);
// single attribute accessors
wxPoint2DInt GetPosition() const { return wxPoint2DInt(m_x, m_y); }
wxSize GetSize() const { return wxSize(m_width, m_height); }
// for the edge and corner accessors there are two setters counterparts, the Set.. functions keep the other corners at their
// position whenever sensible, the Move.. functions keep the size of the rect and move the other corners appropriately
inline wxInt32 GetLeft() const { return m_x; }
inline void SetLeft( wxInt32 n ) { m_width += m_x - n; m_x = n; }
inline void MoveLeftTo( wxInt32 n ) { m_x = n; }
inline wxInt32 GetTop() const { return m_y; }
inline void SetTop( wxInt32 n ) { m_height += m_y - n; m_y = n; }
inline void MoveTopTo( wxInt32 n ) { m_y = n; }
inline wxInt32 GetBottom() const { return m_y + m_height; }
inline void SetBottom( wxInt32 n ) { m_height += n - (m_y+m_height);}
inline void MoveBottomTo( wxInt32 n ) { m_y = n - m_height; }
inline wxInt32 GetRight() const { return m_x + m_width; }
inline void SetRight( wxInt32 n ) { m_width += n - (m_x+m_width) ; }
inline void MoveRightTo( wxInt32 n ) { m_x = n - m_width; }
inline wxPoint2DInt GetLeftTop() const { return wxPoint2DInt( m_x , m_y ); }
inline void SetLeftTop( const wxPoint2DInt &pt ) { m_width += m_x - pt.m_x; m_height += m_y - pt.m_y; m_x = pt.m_x; m_y = pt.m_y; }
inline void MoveLeftTopTo( const wxPoint2DInt &pt ) { m_x = pt.m_x; m_y = pt.m_y; }
inline wxPoint2DInt GetLeftBottom() const { return wxPoint2DInt( m_x , m_y + m_height ); }
inline void SetLeftBottom( const wxPoint2DInt &pt ) { m_width += m_x - pt.m_x; m_height += pt.m_y - (m_y+m_height) ; m_x = pt.m_x; }
inline void MoveLeftBottomTo( const wxPoint2DInt &pt ) { m_x = pt.m_x; m_y = pt.m_y - m_height; }
inline wxPoint2DInt GetRightTop() const { return wxPoint2DInt( m_x+m_width , m_y ); }
inline void SetRightTop( const wxPoint2DInt &pt ) { m_width += pt.m_x - ( m_x + m_width ); m_height += m_y - pt.m_y; m_y = pt.m_y; }
inline void MoveRightTopTo( const wxPoint2DInt &pt ) { m_x = pt.m_x - m_width; m_y = pt.m_y; }
inline wxPoint2DInt GetRightBottom() const { return wxPoint2DInt( m_x+m_width , m_y + m_height ); }
inline void SetRightBottom( const wxPoint2DInt &pt ) { m_width += pt.m_x - ( m_x + m_width ); m_height += pt.m_y - (m_y+m_height);}
inline void MoveRightBottomTo( const wxPoint2DInt &pt ) { m_x = pt.m_x - m_width; m_y = pt.m_y - m_height; }
inline wxPoint2DInt GetCentre() const { return wxPoint2DInt( m_x+m_width/2 , m_y+m_height/2 ); }
inline void SetCentre( const wxPoint2DInt &pt ) { MoveCentreTo( pt ); } // since this is impossible without moving...
inline void MoveCentreTo( const wxPoint2DInt &pt ) { m_x += pt.m_x - (m_x+m_width/2); m_y += pt.m_y -(m_y+m_height/2); }
inline wxOutCode GetOutCode( const wxPoint2DInt &pt ) const
{ return (wxOutCode) (( ( pt.m_x < m_x ) ? wxOutLeft : 0 ) +
( ( pt.m_x >= m_x + m_width ) ? wxOutRight : 0 ) +
( ( pt.m_y < m_y ) ? wxOutTop : 0 ) +
( ( pt.m_y >= m_y + m_height ) ? wxOutBottom : 0 )); }
inline wxOutCode GetOutcode( const wxPoint2DInt &pt ) const
{ return GetOutCode( pt ) ; }
inline bool Contains( const wxPoint2DInt &pt ) const
{ return GetOutCode( pt ) == wxInside; }
inline bool Contains( const wxRect2DInt &rect ) const
{ return ( ( ( m_x <= rect.m_x ) && ( rect.m_x + rect.m_width <= m_x + m_width ) ) &&
( ( m_y <= rect.m_y ) && ( rect.m_y + rect.m_height <= m_y + m_height ) ) ); }
inline bool IsEmpty() const
{ return ( m_width <= 0 || m_height <= 0 ); }
inline bool HaveEqualSize( const wxRect2DInt &rect ) const
{ return ( rect.m_width == m_width && rect.m_height == m_height ); }
inline void Inset( wxInt32 x , wxInt32 y ) { m_x += x; m_y += y; m_width -= 2 * x; m_height -= 2 * y; }
inline void Inset( wxInt32 left , wxInt32 top ,wxInt32 right , wxInt32 bottom )
{ m_x += left; m_y += top; m_width -= left + right; m_height -= top + bottom;}
inline void Offset( const wxPoint2DInt &pt ) { m_x += pt.m_x; m_y += pt.m_y; }
void ConstrainTo( const wxRect2DInt &rect );
inline wxPoint2DInt Interpolate( wxInt32 widthfactor , wxInt32 heightfactor ) { return wxPoint2DInt( m_x + m_width * widthfactor , m_y + m_height * heightfactor ); }
static void Intersect( const wxRect2DInt &src1 , const wxRect2DInt &src2 , wxRect2DInt *dest );
inline void Intersect( const wxRect2DInt &otherRect ) { Intersect( *this , otherRect , this ); }
inline wxRect2DInt CreateIntersection( const wxRect2DInt &otherRect ) const { wxRect2DInt result; Intersect( *this , otherRect , &result); return result; }
bool Intersects( const wxRect2DInt &rect ) const;
static void Union( const wxRect2DInt &src1 , const wxRect2DInt &src2 , wxRect2DInt *dest );
void Union( const wxRect2DInt &otherRect ) { Union( *this , otherRect , this ); }
void Union( const wxPoint2DInt &pt );
inline wxRect2DInt CreateUnion( const wxRect2DInt &otherRect ) const { wxRect2DInt result; Union( *this , otherRect , &result); return result; }
inline void Scale( wxInt32 f ) { m_x *= f; m_y *= f; m_width *= f; m_height *= f;}
inline void Scale( wxInt32 num , wxInt32 denum )
{ m_x *= ((wxInt32)num)/((wxInt32)denum); m_y *= ((wxInt32)num)/((wxInt32)denum);
m_width *= ((wxInt32)num)/((wxInt32)denum); m_height *= ((wxInt32)num)/((wxInt32)denum);}
wxRect2DInt& operator = (const wxRect2DInt& rect);
bool operator == (const wxRect2DInt& rect) const;
bool operator != (const wxRect2DInt& rect) const;
#if wxUSE_STREAMS
void WriteTo( wxDataOutputStream &stream ) const;
void ReadFrom( wxDataInputStream &stream );
#endif // wxUSE_STREAMS
wxInt32 m_x;
wxInt32 m_y;
wxInt32 m_width;
wxInt32 m_height;
};
inline wxRect2DInt::wxRect2DInt( const wxRect2DInt &r )
{
m_x = r.m_x;
m_y = r.m_y;
m_width = r.m_width;
m_height = r.m_height;
}
inline wxRect2DInt::wxRect2DInt( const wxPoint2DInt &a , const wxPoint2DInt &b)
{
m_x = wxMin( a.m_x , b.m_x );
m_y = wxMin( a.m_y , b.m_y );
m_width = abs( a.m_x - b.m_x );
m_height = abs( a.m_y - b.m_y );
}
inline wxRect2DInt::wxRect2DInt( const wxPoint2DInt& pos, const wxSize& size)
{
m_x = pos.m_x;
m_y = pos.m_y;
m_width = size.x;
m_height = size.y;
}
inline bool wxRect2DInt::operator == (const wxRect2DInt& rect) const
{
return (m_x==rect.m_x && m_y==rect.m_y &&
m_width==rect.m_width && m_height==rect.m_height);
}
inline bool wxRect2DInt::operator != (const wxRect2DInt& rect) const
{
return !(*this == rect);
}
class WXDLLIMPEXP_CORE wxTransform2D
{
public :
virtual ~wxTransform2D() { }
virtual void Transform( wxPoint2DInt* pt )const = 0;
virtual void Transform( wxRect2DInt* r ) const;
virtual wxPoint2DInt Transform( const wxPoint2DInt &pt ) const;
virtual wxRect2DInt Transform( const wxRect2DInt &r ) const ;
virtual void InverseTransform( wxPoint2DInt* pt ) const = 0;
virtual void InverseTransform( wxRect2DInt* r ) const ;
virtual wxPoint2DInt InverseTransform( const wxPoint2DInt &pt ) const ;
virtual wxRect2DInt InverseTransform( const wxRect2DInt &r ) const ;
};
#endif // wxUSE_GEOMETRY
#endif // _WX_GEOMETRY_H_
| h |
rticonnextdds-usecases | data/projects/rticonnextdds-usecases/VehicleTracking/ExampleCode/thirdparty/wxWidgets-3.1.2/Linux/include/wx/timectrl.h | ///////////////////////////////////////////////////////////////////////////////
// Name: wx/timectrl.h
// Purpose: Declaration of wxTimePickerCtrl class.
// Author: Vadim Zeitlin
// Created: 2011-09-22
// Copyright: (c) 2011 Vadim Zeitlin <[email protected]>
// Licence: wxWindows licence
///////////////////////////////////////////////////////////////////////////////
#ifndef _WX_TIMECTRL_H_
#define _WX_TIMECTRL_H_
#include "wx/defs.h"
#if wxUSE_TIMEPICKCTRL
#include "wx/datetimectrl.h"
#define wxTimePickerCtrlNameStr wxS("timectrl")
// No special styles are currently defined for this control but still define a
// symbolic constant for the default style for consistency.
enum
{
wxTP_DEFAULT = 0
};
// ----------------------------------------------------------------------------
// wxTimePickerCtrl: Allow the user to enter the time.
// ----------------------------------------------------------------------------
class WXDLLIMPEXP_ADV wxTimePickerCtrlBase : public wxDateTimePickerCtrl
{
public:
/*
The derived classes should implement ctor and Create() method with the
following signature:
bool Create(wxWindow *parent,
wxWindowID id,
const wxDateTime& dt = wxDefaultDateTime,
const wxPoint& pos = wxDefaultPosition,
const wxSize& size = wxDefaultSize,
long style = wxTP_DEFAULT,
const wxValidator& validator = wxDefaultValidator,
const wxString& name = wxTimePickerCtrlNameStr);
*/
/*
We also inherit Set/GetValue() methods from the base class which define
our public API. Notice that the date portion of the date passed as
input or received as output is or should be ignored, only the time part
of wxDateTime objects is really significant here. Use Set/GetTime()
below for possibly simpler interface.
*/
// Set the given time.
bool SetTime(int hour, int min, int sec)
{
// Notice that we should use a date on which DST doesn't change to
// avoid any problems with time discontinuity so use a fixed date (on
// which nobody changes DST) instead of e.g. today.
wxDateTime dt(1, wxDateTime::Jan, 2012, hour, min, sec);
if ( !dt.IsValid() )
{
// No need to assert here, wxDateTime already does it for us.
return false;
}
SetValue(dt);
return true;
}
// Get the current time components. All pointers must be non-NULL.
bool GetTime(int* hour, int* min, int* sec) const
{
wxCHECK_MSG( hour && min && sec, false,
wxS("Time component pointers must be non-NULL") );
const wxDateTime::Tm tm = GetValue().GetTm();
*hour = tm.hour;
*min = tm.min;
*sec = tm.sec;
return true;
}
};
#if defined(__WXMSW__) && !defined(__WXUNIVERSAL__)
#include "wx/msw/timectrl.h"
#define wxHAS_NATIVE_TIMEPICKERCTRL
#elif defined(__WXOSX_COCOA__) && !defined(__WXUNIVERSAL__)
#include "wx/osx/timectrl.h"
#define wxHAS_NATIVE_TIMEPICKERCTRL
#else
#include "wx/generic/timectrl.h"
class WXDLLIMPEXP_ADV wxTimePickerCtrl : public wxTimePickerCtrlGeneric
{
public:
wxTimePickerCtrl() { }
wxTimePickerCtrl(wxWindow *parent,
wxWindowID id,
const wxDateTime& date = wxDefaultDateTime,
const wxPoint& pos = wxDefaultPosition,
const wxSize& size = wxDefaultSize,
long style = wxTP_DEFAULT,
const wxValidator& validator = wxDefaultValidator,
const wxString& name = wxTimePickerCtrlNameStr)
: wxTimePickerCtrlGeneric(parent, id, date, pos, size, style, validator, name)
{
}
private:
wxDECLARE_DYNAMIC_CLASS_NO_COPY(wxTimePickerCtrl);
};
#endif
#endif // wxUSE_TIMEPICKCTRL
#endif // _WX_TIMECTRL_H_
| h |
rticonnextdds-usecases | data/projects/rticonnextdds-usecases/VehicleTracking/ExampleCode/thirdparty/wxWidgets-3.1.2/Linux/include/wx/filepicker.h | /////////////////////////////////////////////////////////////////////////////
// Name: wx/filepicker.h
// Purpose: wxFilePickerCtrl, wxDirPickerCtrl base header
// Author: Francesco Montorsi
// Modified by:
// Created: 14/4/2006
// Copyright: (c) Francesco Montorsi
// Licence: wxWindows Licence
/////////////////////////////////////////////////////////////////////////////
#ifndef _WX_FILEDIRPICKER_H_BASE_
#define _WX_FILEDIRPICKER_H_BASE_
#include "wx/defs.h"
#if wxUSE_FILEPICKERCTRL || wxUSE_DIRPICKERCTRL
#include "wx/pickerbase.h"
#include "wx/filename.h"
class WXDLLIMPEXP_FWD_CORE wxDialog;
class WXDLLIMPEXP_FWD_CORE wxFileDirPickerEvent;
extern WXDLLIMPEXP_DATA_CORE(const char) wxFilePickerWidgetLabel[];
extern WXDLLIMPEXP_DATA_CORE(const char) wxFilePickerWidgetNameStr[];
extern WXDLLIMPEXP_DATA_CORE(const char) wxFilePickerCtrlNameStr[];
extern WXDLLIMPEXP_DATA_CORE(const char) wxFileSelectorPromptStr[];
extern WXDLLIMPEXP_DATA_CORE(const char) wxDirPickerWidgetLabel[];
extern WXDLLIMPEXP_DATA_CORE(const char) wxDirPickerWidgetNameStr[];
extern WXDLLIMPEXP_DATA_CORE(const char) wxDirPickerCtrlNameStr[];
extern WXDLLIMPEXP_DATA_CORE(const char) wxDirSelectorPromptStr[];
// ----------------------------------------------------------------------------
// wxFileDirPickerEvent: used by wxFilePickerCtrl and wxDirPickerCtrl only
// ----------------------------------------------------------------------------
class WXDLLIMPEXP_CORE wxFileDirPickerEvent : public wxCommandEvent
{
public:
wxFileDirPickerEvent() {}
wxFileDirPickerEvent(wxEventType type, wxObject *generator, int id, const wxString &path)
: wxCommandEvent(type, id),
m_path(path)
{
SetEventObject(generator);
}
wxString GetPath() const { return m_path; }
void SetPath(const wxString &p) { m_path = p; }
// default copy ctor, assignment operator and dtor are ok
virtual wxEvent *Clone() const wxOVERRIDE { return new wxFileDirPickerEvent(*this); }
private:
wxString m_path;
wxDECLARE_DYNAMIC_CLASS_NO_ASSIGN(wxFileDirPickerEvent);
};
wxDECLARE_EXPORTED_EVENT( WXDLLIMPEXP_CORE, wxEVT_FILEPICKER_CHANGED, wxFileDirPickerEvent );
wxDECLARE_EXPORTED_EVENT( WXDLLIMPEXP_CORE, wxEVT_DIRPICKER_CHANGED, wxFileDirPickerEvent );
// ----------------------------------------------------------------------------
// event types and macros
// ----------------------------------------------------------------------------
typedef void (wxEvtHandler::*wxFileDirPickerEventFunction)(wxFileDirPickerEvent&);
#define wxFileDirPickerEventHandler(func) \
wxEVENT_HANDLER_CAST(wxFileDirPickerEventFunction, func)
#define EVT_FILEPICKER_CHANGED(id, fn) \
wx__DECLARE_EVT1(wxEVT_FILEPICKER_CHANGED, id, wxFileDirPickerEventHandler(fn))
#define EVT_DIRPICKER_CHANGED(id, fn) \
wx__DECLARE_EVT1(wxEVT_DIRPICKER_CHANGED, id, wxFileDirPickerEventHandler(fn))
// ----------------------------------------------------------------------------
// wxFileDirPickerWidgetBase: a generic abstract interface which must be
// implemented by controls used by wxFileDirPickerCtrlBase
// ----------------------------------------------------------------------------
class WXDLLIMPEXP_CORE wxFileDirPickerWidgetBase
{
public:
wxFileDirPickerWidgetBase() { }
virtual ~wxFileDirPickerWidgetBase() { }
// Path here is the name of the selected file or directory.
wxString GetPath() const { return m_path; }
virtual void SetPath(const wxString &str) { m_path=str; }
// Set the directory to open the file browse dialog at initially.
virtual void SetInitialDirectory(const wxString& dir) = 0;
// returns the picker widget cast to wxControl
virtual wxControl *AsControl() = 0;
protected:
virtual void UpdateDialogPath(wxDialog *) = 0;
virtual void UpdatePathFromDialog(wxDialog *) = 0;
wxString m_path;
};
// Styles which must be supported by all controls implementing wxFileDirPickerWidgetBase
// NB: these styles must be defined to carefully-chosen values to
// avoid conflicts with wxButton's styles
#define wxFLP_OPEN 0x0400
#define wxFLP_SAVE 0x0800
#define wxFLP_OVERWRITE_PROMPT 0x1000
#define wxFLP_FILE_MUST_EXIST 0x2000
#define wxFLP_CHANGE_DIR 0x4000
#define wxFLP_SMALL wxPB_SMALL
// NOTE: wxMULTIPLE is not supported !
#define wxDIRP_DIR_MUST_EXIST 0x0008
#define wxDIRP_CHANGE_DIR 0x0010
#define wxDIRP_SMALL wxPB_SMALL
// map platform-dependent controls which implement the wxFileDirPickerWidgetBase
// under the name "wxFilePickerWidget" and "wxDirPickerWidget".
// NOTE: wxFileDirPickerCtrlBase will allocate a wx{File|Dir}PickerWidget and this
// requires that all classes being mapped as wx{File|Dir}PickerWidget have the
// same prototype for the contructor...
// since GTK >= 2.6, there is GtkFileButton
#if defined(__WXGTK20__) && !defined(__WXUNIVERSAL__)
#include "wx/gtk/filepicker.h"
#define wxFilePickerWidget wxFileButton
#define wxDirPickerWidget wxDirButton
#else
#include "wx/generic/filepickerg.h"
#define wxFilePickerWidget wxGenericFileButton
#define wxDirPickerWidget wxGenericDirButton
#endif
// ----------------------------------------------------------------------------
// wxFileDirPickerCtrlBase
// ----------------------------------------------------------------------------
class WXDLLIMPEXP_CORE wxFileDirPickerCtrlBase : public wxPickerBase
{
public:
wxFileDirPickerCtrlBase() {}
protected:
// NB: no default values since this function will never be used
// directly by the user and derived classes wouldn't use them
bool CreateBase(wxWindow *parent,
wxWindowID id,
const wxString& path,
const wxString &message,
const wxString &wildcard,
const wxPoint& pos,
const wxSize& size,
long style,
const wxValidator& validator,
const wxString& name);
public: // public API
wxString GetPath() const;
void SetPath(const wxString &str);
// Set the directory to open the file browse dialog at initially.
void SetInitialDirectory(const wxString& dir)
{
m_pickerIface->SetInitialDirectory(dir);
}
public: // internal functions
void UpdatePickerFromTextCtrl() wxOVERRIDE;
void UpdateTextCtrlFromPicker() wxOVERRIDE;
// event handler for our picker
void OnFileDirChange(wxFileDirPickerEvent &);
// TRUE if any textctrl change should update the current working directory
virtual bool IsCwdToUpdate() const = 0;
// Returns the event type sent by this picker
virtual wxEventType GetEventType() const = 0;
virtual void DoConnect( wxControl *sender, wxFileDirPickerCtrlBase *eventSink ) = 0;
// Returns the filtered value currently placed in the text control (if present).
virtual wxString GetTextCtrlValue() const = 0;
protected:
// creates the picker control
virtual
wxFileDirPickerWidgetBase *CreatePicker(wxWindow *parent,
const wxString& path,
const wxString& message,
const wxString& wildcard) = 0;
protected:
// m_picker object as wxFileDirPickerWidgetBase interface
wxFileDirPickerWidgetBase *m_pickerIface;
};
#endif // wxUSE_FILEPICKERCTRL || wxUSE_DIRPICKERCTRL
#if wxUSE_FILEPICKERCTRL
// ----------------------------------------------------------------------------
// wxFilePickerCtrl: platform-independent class which embeds the
// platform-dependent wxFilePickerWidget and, if wxFLP_USE_TEXTCTRL style is
// used, a textctrl next to it.
// ----------------------------------------------------------------------------
#define wxFLP_USE_TEXTCTRL (wxPB_USE_TEXTCTRL)
#ifdef __WXGTK__
// GTK apps usually don't have a textctrl next to the picker
#define wxFLP_DEFAULT_STYLE (wxFLP_OPEN|wxFLP_FILE_MUST_EXIST)
#else
#define wxFLP_DEFAULT_STYLE (wxFLP_USE_TEXTCTRL|wxFLP_OPEN|wxFLP_FILE_MUST_EXIST)
#endif
class WXDLLIMPEXP_CORE wxFilePickerCtrl : public wxFileDirPickerCtrlBase
{
public:
wxFilePickerCtrl() {}
wxFilePickerCtrl(wxWindow *parent,
wxWindowID id,
const wxString& path = wxEmptyString,
const wxString& message = wxFileSelectorPromptStr,
const wxString& wildcard = wxFileSelectorDefaultWildcardStr,
const wxPoint& pos = wxDefaultPosition,
const wxSize& size = wxDefaultSize,
long style = wxFLP_DEFAULT_STYLE,
const wxValidator& validator = wxDefaultValidator,
const wxString& name = wxFilePickerCtrlNameStr)
{
Create(parent, id, path, message, wildcard, pos, size, style,
validator, name);
}
bool Create(wxWindow *parent,
wxWindowID id,
const wxString& path = wxEmptyString,
const wxString& message = wxFileSelectorPromptStr,
const wxString& wildcard = wxFileSelectorDefaultWildcardStr,
const wxPoint& pos = wxDefaultPosition,
const wxSize& size = wxDefaultSize,
long style = wxFLP_DEFAULT_STYLE,
const wxValidator& validator = wxDefaultValidator,
const wxString& name = wxFilePickerCtrlNameStr);
void SetFileName(const wxFileName &filename)
{ SetPath(filename.GetFullPath()); }
wxFileName GetFileName() const
{ return wxFileName(GetPath()); }
public: // overrides
// return the text control value in canonical form
wxString GetTextCtrlValue() const wxOVERRIDE;
bool IsCwdToUpdate() const wxOVERRIDE
{ return HasFlag(wxFLP_CHANGE_DIR); }
wxEventType GetEventType() const wxOVERRIDE
{ return wxEVT_FILEPICKER_CHANGED; }
virtual void DoConnect( wxControl *sender, wxFileDirPickerCtrlBase *eventSink ) wxOVERRIDE
{
sender->Bind(wxEVT_FILEPICKER_CHANGED,
&wxFileDirPickerCtrlBase::OnFileDirChange, eventSink );
}
protected:
virtual
wxFileDirPickerWidgetBase *CreatePicker(wxWindow *parent,
const wxString& path,
const wxString& message,
const wxString& wildcard) wxOVERRIDE
{
return new wxFilePickerWidget(parent, wxID_ANY,
wxGetTranslation(wxFilePickerWidgetLabel),
path, message, wildcard,
wxDefaultPosition, wxDefaultSize,
GetPickerStyle(GetWindowStyle()));
}
// extracts the style for our picker from wxFileDirPickerCtrlBase's style
long GetPickerStyle(long style) const wxOVERRIDE
{
return style & (wxFLP_OPEN |
wxFLP_SAVE |
wxFLP_OVERWRITE_PROMPT |
wxFLP_FILE_MUST_EXIST |
wxFLP_CHANGE_DIR |
wxFLP_USE_TEXTCTRL |
wxFLP_SMALL);
}
private:
wxDECLARE_DYNAMIC_CLASS(wxFilePickerCtrl);
};
#endif // wxUSE_FILEPICKERCTRL
#if wxUSE_DIRPICKERCTRL
// ----------------------------------------------------------------------------
// wxDirPickerCtrl: platform-independent class which embeds the
// platform-dependent wxDirPickerWidget and eventually a textctrl
// (see wxDIRP_USE_TEXTCTRL) next to it.
// ----------------------------------------------------------------------------
#define wxDIRP_USE_TEXTCTRL (wxPB_USE_TEXTCTRL)
#ifdef __WXGTK__
// GTK apps usually don't have a textctrl next to the picker
#define wxDIRP_DEFAULT_STYLE (wxDIRP_DIR_MUST_EXIST)
#else
#define wxDIRP_DEFAULT_STYLE (wxDIRP_USE_TEXTCTRL|wxDIRP_DIR_MUST_EXIST)
#endif
class WXDLLIMPEXP_CORE wxDirPickerCtrl : public wxFileDirPickerCtrlBase
{
public:
wxDirPickerCtrl() {}
wxDirPickerCtrl(wxWindow *parent, wxWindowID id,
const wxString& path = wxEmptyString,
const wxString& message = wxDirSelectorPromptStr,
const wxPoint& pos = wxDefaultPosition,
const wxSize& size = wxDefaultSize,
long style = wxDIRP_DEFAULT_STYLE,
const wxValidator& validator = wxDefaultValidator,
const wxString& name = wxDirPickerCtrlNameStr)
{
Create(parent, id, path, message, pos, size, style, validator, name);
}
bool Create(wxWindow *parent, wxWindowID id,
const wxString& path = wxEmptyString,
const wxString& message = wxDirSelectorPromptStr,
const wxPoint& pos = wxDefaultPosition,
const wxSize& size = wxDefaultSize,
long style = wxDIRP_DEFAULT_STYLE,
const wxValidator& validator = wxDefaultValidator,
const wxString& name = wxDirPickerCtrlNameStr);
void SetDirName(const wxFileName &dirname)
{ SetPath(dirname.GetPath()); }
wxFileName GetDirName() const
{ return wxFileName::DirName(GetPath()); }
public: // overrides
wxString GetTextCtrlValue() const wxOVERRIDE;
bool IsCwdToUpdate() const wxOVERRIDE
{ return HasFlag(wxDIRP_CHANGE_DIR); }
wxEventType GetEventType() const wxOVERRIDE
{ return wxEVT_DIRPICKER_CHANGED; }
virtual void DoConnect( wxControl *sender, wxFileDirPickerCtrlBase *eventSink ) wxOVERRIDE
{
sender->Bind( wxEVT_DIRPICKER_CHANGED,
&wxFileDirPickerCtrlBase::OnFileDirChange, eventSink );
}
protected:
virtual
wxFileDirPickerWidgetBase *CreatePicker(wxWindow *parent,
const wxString& path,
const wxString& message,
const wxString& WXUNUSED(wildcard)) wxOVERRIDE
{
return new wxDirPickerWidget(parent, wxID_ANY,
wxGetTranslation(wxDirPickerWidgetLabel),
path, message,
wxDefaultPosition, wxDefaultSize,
GetPickerStyle(GetWindowStyle()));
}
// extracts the style for our picker from wxFileDirPickerCtrlBase's style
long GetPickerStyle(long style) const wxOVERRIDE
{
return style & (wxDIRP_DIR_MUST_EXIST |
wxDIRP_CHANGE_DIR |
wxDIRP_USE_TEXTCTRL |
wxDIRP_SMALL);
}
private:
wxDECLARE_DYNAMIC_CLASS(wxDirPickerCtrl);
};
#endif // wxUSE_DIRPICKERCTRL
// old wxEVT_COMMAND_* constants
#define wxEVT_COMMAND_FILEPICKER_CHANGED wxEVT_FILEPICKER_CHANGED
#define wxEVT_COMMAND_DIRPICKER_CHANGED wxEVT_DIRPICKER_CHANGED
#endif // _WX_FILEDIRPICKER_H_BASE_
| h |
rticonnextdds-usecases | data/projects/rticonnextdds-usecases/VehicleTracking/ExampleCode/thirdparty/wxWidgets-3.1.2/Linux/include/wx/tglbtn.h | /////////////////////////////////////////////////////////////////////////////
// Name: wx/tglbtn.h
// Purpose: This dummy header includes the proper header file for the
// system we're compiling under.
// Author: John Norris, minor changes by Axel Schlueter
// Modified by:
// Created: 08.02.01
// Copyright: (c) 2000 Johnny C. Norris II
// Licence: wxWindows Licence
/////////////////////////////////////////////////////////////////////////////
#ifndef _WX_TOGGLEBUTTON_H_BASE_
#define _WX_TOGGLEBUTTON_H_BASE_
#include "wx/defs.h"
#if wxUSE_TOGGLEBTN
#include "wx/event.h"
#include "wx/anybutton.h" // base class
extern WXDLLIMPEXP_DATA_CORE(const char) wxCheckBoxNameStr[];
wxDECLARE_EXPORTED_EVENT( WXDLLIMPEXP_CORE, wxEVT_TOGGLEBUTTON, wxCommandEvent );
// ----------------------------------------------------------------------------
// wxToggleButtonBase
// ----------------------------------------------------------------------------
class WXDLLIMPEXP_CORE wxToggleButtonBase : public wxAnyButton
{
public:
wxToggleButtonBase() { }
// Get/set the value
virtual void SetValue(bool state) = 0;
virtual bool GetValue() const = 0;
// The current "normal" state for the toggle button depends upon its value.
virtual State GetNormalState() const wxOVERRIDE
{
return GetValue() ? State_Pressed : State_Normal;
}
void UpdateWindowUI(long flags) wxOVERRIDE
{
wxControl::UpdateWindowUI(flags);
if ( !IsShown() )
return;
wxWindow *tlw = wxGetTopLevelParent( this );
if (tlw && wxPendingDelete.Member( tlw ))
return;
wxUpdateUIEvent event( GetId() );
event.SetEventObject(this);
if (GetEventHandler()->ProcessEvent(event) )
{
if ( event.GetSetChecked() )
SetValue( event.GetChecked() );
}
}
protected:
wxDECLARE_NO_COPY_CLASS(wxToggleButtonBase);
};
#define EVT_TOGGLEBUTTON(id, fn) \
wx__DECLARE_EVT1(wxEVT_TOGGLEBUTTON, id, wxCommandEventHandler(fn))
#if defined(__WXUNIVERSAL__)
#include "wx/univ/tglbtn.h"
#elif defined(__WXMSW__)
#include "wx/msw/tglbtn.h"
#define wxHAS_BITMAPTOGGLEBUTTON
#elif defined(__WXGTK20__)
#include "wx/gtk/tglbtn.h"
#define wxHAS_BITMAPTOGGLEBUTTON
#elif defined(__WXGTK__)
#include "wx/gtk1/tglbtn.h"
# elif defined(__WXMOTIF__)
#include "wx/motif/tglbtn.h"
#elif defined(__WXMAC__)
#include "wx/osx/tglbtn.h"
#define wxHAS_BITMAPTOGGLEBUTTON
#elif defined(__WXQT__)
#include "wx/qt/tglbtn.h"
#endif
// old wxEVT_COMMAND_* constants
#define wxEVT_COMMAND_TOGGLEBUTTON_CLICKED wxEVT_TOGGLEBUTTON
#endif // wxUSE_TOGGLEBTN
#endif // _WX_TOGGLEBUTTON_H_BASE_
| h |
rticonnextdds-usecases | data/projects/rticonnextdds-usecases/VehicleTracking/ExampleCode/thirdparty/wxWidgets-3.1.2/Linux/include/wx/layout.h | /////////////////////////////////////////////////////////////////////////////
// Name: wx/layout.h
// Purpose: OBSOLETE layout constraint classes, use sizers instead
// Author: Julian Smart
// Modified by:
// Created: 29/01/98
// Copyright: (c) 1998 Julian Smart
// Licence: wxWindows licence
/////////////////////////////////////////////////////////////////////////////
#ifndef _WX_LAYOUT_H_
#define _WX_LAYOUT_H_
// ----------------------------------------------------------------------------
// headers
// ----------------------------------------------------------------------------
#include "wx/object.h"
// X stupidly defines these in X.h
#ifdef Above
#undef Above
#endif
#ifdef Below
#undef Below
#endif
#if wxUSE_CONSTRAINTS
// ----------------------------------------------------------------------------
// forward declrations
// ----------------------------------------------------------------------------
class WXDLLIMPEXP_FWD_CORE wxWindowBase;
class WXDLLIMPEXP_FWD_CORE wxLayoutConstraints;
// ----------------------------------------------------------------------------
// constants
// ----------------------------------------------------------------------------
#define wxLAYOUT_DEFAULT_MARGIN 0
enum wxEdge
{
wxLeft, wxTop, wxRight, wxBottom, wxWidth, wxHeight,
wxCentre, wxCenter = wxCentre, wxCentreX, wxCentreY
};
enum wxRelationship
{
wxUnconstrained = 0,
wxAsIs,
wxPercentOf,
wxAbove,
wxBelow,
wxLeftOf,
wxRightOf,
wxSameAs,
wxAbsolute
};
// ----------------------------------------------------------------------------
// wxIndividualLayoutConstraint: a constraint on window position
// ----------------------------------------------------------------------------
class WXDLLIMPEXP_CORE wxIndividualLayoutConstraint : public wxObject
{
public:
wxIndividualLayoutConstraint();
// note that default copy ctor and assignment operators are ok
virtual ~wxIndividualLayoutConstraint(){}
void Set(wxRelationship rel, wxWindowBase *otherW, wxEdge otherE, int val = 0, int marg = wxLAYOUT_DEFAULT_MARGIN);
//
// Sibling relationships
//
void LeftOf(wxWindowBase *sibling, int marg = wxLAYOUT_DEFAULT_MARGIN);
void RightOf(wxWindowBase *sibling, int marg = wxLAYOUT_DEFAULT_MARGIN);
void Above(wxWindowBase *sibling, int marg = wxLAYOUT_DEFAULT_MARGIN);
void Below(wxWindowBase *sibling, int marg = wxLAYOUT_DEFAULT_MARGIN);
//
// 'Same edge' alignment
//
void SameAs(wxWindowBase *otherW, wxEdge edge, int marg = wxLAYOUT_DEFAULT_MARGIN);
// The edge is a percentage of the other window's edge
void PercentOf(wxWindowBase *otherW, wxEdge wh, int per);
//
// Edge has absolute value
//
void Absolute(int val);
//
// Dimension is unconstrained
//
void Unconstrained() { relationship = wxUnconstrained; }
//
// Dimension is 'as is' (use current size settings)
//
void AsIs() { relationship = wxAsIs; }
//
// Accessors
//
wxWindowBase *GetOtherWindow() { return otherWin; }
wxEdge GetMyEdge() const { return myEdge; }
void SetEdge(wxEdge which) { myEdge = which; }
void SetValue(int v) { value = v; }
int GetMargin() { return margin; }
void SetMargin(int m) { margin = m; }
int GetValue() const { return value; }
int GetPercent() const { return percent; }
int GetOtherEdge() const { return otherEdge; }
bool GetDone() const { return done; }
void SetDone(bool d) { done = d; }
wxRelationship GetRelationship() { return relationship; }
void SetRelationship(wxRelationship r) { relationship = r; }
// Reset constraint if it mentions otherWin
bool ResetIfWin(wxWindowBase *otherW);
// Try to satisfy constraint
bool SatisfyConstraint(wxLayoutConstraints *constraints, wxWindowBase *win);
// Get the value of this edge or dimension, or if this
// is not determinable, -1.
int GetEdge(wxEdge which, wxWindowBase *thisWin, wxWindowBase *other) const;
protected:
// To be allowed to modify the internal variables
friend class wxIndividualLayoutConstraint_Serialize;
// 'This' window is the parent or sibling of otherWin
wxWindowBase *otherWin;
wxEdge myEdge;
wxRelationship relationship;
int margin;
int value;
int percent;
wxEdge otherEdge;
bool done;
wxDECLARE_DYNAMIC_CLASS(wxIndividualLayoutConstraint);
};
// ----------------------------------------------------------------------------
// wxLayoutConstraints: the complete set of constraints for a window
// ----------------------------------------------------------------------------
class WXDLLIMPEXP_CORE wxLayoutConstraints : public wxObject
{
public:
// Edge constraints
wxIndividualLayoutConstraint left;
wxIndividualLayoutConstraint top;
wxIndividualLayoutConstraint right;
wxIndividualLayoutConstraint bottom;
// Size constraints
wxIndividualLayoutConstraint width;
wxIndividualLayoutConstraint height;
// Centre constraints
wxIndividualLayoutConstraint centreX;
wxIndividualLayoutConstraint centreY;
wxLayoutConstraints();
// note that default copy ctor and assignment operators are ok
virtual ~wxLayoutConstraints(){}
bool SatisfyConstraints(wxWindowBase *win, int *noChanges);
bool AreSatisfied() const
{
return left.GetDone() && top.GetDone() &&
width.GetDone() && height.GetDone();
}
wxDECLARE_DYNAMIC_CLASS(wxLayoutConstraints);
};
#endif // wxUSE_CONSTRAINTS
#endif // _WX_LAYOUT_H_
| h |
rticonnextdds-usecases | data/projects/rticonnextdds-usecases/VehicleTracking/ExampleCode/thirdparty/wxWidgets-3.1.2/Linux/include/wx/ipcbase.h | /////////////////////////////////////////////////////////////////////////////
// Name: wx/ipcbase.h
// Purpose: Base classes for IPC
// Author: Julian Smart
// Modified by:
// Created: 4/1/98
// Copyright: (c) Julian Smart
// Licence: wxWindows licence
/////////////////////////////////////////////////////////////////////////////
#ifndef _WX_IPCBASEH__
#define _WX_IPCBASEH__
#include "wx/defs.h"
#include "wx/object.h"
#include "wx/string.h"
enum wxIPCFormat
{
wxIPC_INVALID = 0,
wxIPC_TEXT = 1, /* CF_TEXT */
wxIPC_BITMAP = 2, /* CF_BITMAP */
wxIPC_METAFILE = 3, /* CF_METAFILEPICT */
wxIPC_SYLK = 4,
wxIPC_DIF = 5,
wxIPC_TIFF = 6,
wxIPC_OEMTEXT = 7, /* CF_OEMTEXT */
wxIPC_DIB = 8, /* CF_DIB */
wxIPC_PALETTE = 9,
wxIPC_PENDATA = 10,
wxIPC_RIFF = 11,
wxIPC_WAVE = 12,
wxIPC_UTF16TEXT = 13, /* CF_UNICODE */
wxIPC_ENHMETAFILE = 14,
wxIPC_FILENAME = 15, /* CF_HDROP */
wxIPC_LOCALE = 16,
wxIPC_UTF8TEXT = 17,
wxIPC_UTF32TEXT = 18,
#if SIZEOF_WCHAR_T == 2
wxIPC_UNICODETEXT = wxIPC_UTF16TEXT,
#elif SIZEOF_WCHAR_T == 4
wxIPC_UNICODETEXT = wxIPC_UTF32TEXT,
#else
# error "Unknown wchar_t size"
#endif
wxIPC_PRIVATE = 20
};
class WXDLLIMPEXP_FWD_BASE wxServerBase;
class WXDLLIMPEXP_FWD_BASE wxClientBase;
class WXDLLIMPEXP_BASE wxConnectionBase: public wxObject
{
public:
wxConnectionBase(void *buffer, size_t size); // use external buffer
wxConnectionBase(); // use internal, adaptive buffer
wxConnectionBase(const wxConnectionBase& copy);
virtual ~wxConnectionBase();
void SetConnected( bool c ) { m_connected = c; }
bool GetConnected() { return m_connected; }
// Calls that CLIENT can make
bool Execute(const void *data, size_t size, wxIPCFormat fmt = wxIPC_PRIVATE)
{ return DoExecute(data, size, fmt); }
bool Execute(const char *s, size_t size = wxNO_LEN)
{ return DoExecute(s, size == wxNO_LEN ? strlen(s) + 1
: size, wxIPC_TEXT); }
bool Execute(const wchar_t *ws, size_t size = wxNO_LEN)
{ return DoExecute(ws, size == wxNO_LEN ? (wcslen(ws) + 1)*sizeof(wchar_t)
: size, wxIPC_UNICODETEXT); }
bool Execute(const wxString& s)
{
const wxScopedCharBuffer buf = s.utf8_str();
return DoExecute(buf, strlen(buf) + 1, wxIPC_UTF8TEXT);
}
bool Execute(const wxCStrData& cs)
{ return Execute(cs.AsString()); }
virtual const void *Request(const wxString& item,
size_t *size = NULL,
wxIPCFormat format = wxIPC_TEXT) = 0;
bool Poke(const wxString& item, const void *data, size_t size,
wxIPCFormat fmt = wxIPC_PRIVATE)
{ return DoPoke(item, data, size, fmt); }
bool Poke(const wxString& item, const char *s, size_t size = wxNO_LEN)
{ return DoPoke(item, s, size == wxNO_LEN ? strlen(s) + 1
: size, wxIPC_TEXT); }
bool Poke(const wxString& item, const wchar_t *ws, size_t size = wxNO_LEN)
{ return DoPoke(item, ws,
size == wxNO_LEN ? (wcslen(ws) + 1)*sizeof(wchar_t)
: size, wxIPC_UNICODETEXT); }
bool Poke(const wxString& item, const wxString& s)
{
const wxScopedCharBuffer buf = s.utf8_str();
return DoPoke(item, buf, strlen(buf) + 1, wxIPC_UTF8TEXT);
}
bool Poke(const wxString& item, const wxCStrData& cs)
{ return Poke(item, cs.AsString()); }
virtual bool StartAdvise(const wxString& item) = 0;
virtual bool StopAdvise(const wxString& item) = 0;
// Calls that SERVER can make
bool Advise(const wxString& item, const void *data, size_t size,
wxIPCFormat fmt = wxIPC_PRIVATE)
{ return DoAdvise(item, data, size, fmt); }
bool Advise(const wxString& item, const char *s, size_t size = wxNO_LEN)
{ return DoAdvise(item, s, size == wxNO_LEN ? strlen(s) + 1
: size, wxIPC_TEXT); }
bool Advise(const wxString& item, const wchar_t *ws, size_t size = wxNO_LEN)
{ return DoAdvise(item, ws,
size == wxNO_LEN ? (wcslen(ws) + 1)*sizeof(wchar_t)
: size, wxIPC_UNICODETEXT); }
bool Advise(const wxString& item, const wxString& s)
{
const wxScopedCharBuffer buf = s.utf8_str();
return DoAdvise(item, buf, strlen(buf) + 1, wxIPC_UTF8TEXT);
}
bool Advise(const wxString& item, const wxCStrData& cs)
{ return Advise(item, cs.AsString()); }
// Calls that both can make
virtual bool Disconnect() = 0;
// Callbacks to SERVER - override at will
virtual bool OnExec(const wxString& WXUNUSED(topic),
const wxString& WXUNUSED(data))
{
wxFAIL_MSG( "This method shouldn't be called, if it is, it probably "
"means that you didn't update your old code overriding "
"OnExecute() to use the new parameter types (\"const void *\" "
"instead of \"wxChar *\" and \"size_t\" instead of \"int\"), "
"you must do it or your code wouldn't be executed at all!" );
return false;
}
// deprecated function kept for backwards compatibility: usually you will
// want to override OnExec() above instead which receives its data in a more
// convenient format
virtual bool OnExecute(const wxString& topic,
const void *data,
size_t size,
wxIPCFormat format)
{ return OnExec(topic, GetTextFromData(data, size, format)); }
virtual const void *OnRequest(const wxString& WXUNUSED(topic),
const wxString& WXUNUSED(item),
size_t *size,
wxIPCFormat WXUNUSED(format))
{ *size = 0; return NULL; }
virtual bool OnPoke(const wxString& WXUNUSED(topic),
const wxString& WXUNUSED(item),
const void *WXUNUSED(data),
size_t WXUNUSED(size),
wxIPCFormat WXUNUSED(format))
{ return false; }
virtual bool OnStartAdvise(const wxString& WXUNUSED(topic),
const wxString& WXUNUSED(item))
{ return false; }
virtual bool OnStopAdvise(const wxString& WXUNUSED(topic),
const wxString& WXUNUSED(item))
{ return false; }
// Callbacks to CLIENT - override at will
virtual bool OnAdvise(const wxString& WXUNUSED(topic),
const wxString& WXUNUSED(item),
const void *WXUNUSED(data),
size_t WXUNUSED(size),
wxIPCFormat WXUNUSED(format))
{ return false; }
// Callbacks to BOTH
virtual bool OnDisconnect() { delete this; return true; }
// return true if this is one of the formats used for textual data
// transmission
static bool IsTextFormat(wxIPCFormat format)
{
return format == wxIPC_TEXT ||
format == wxIPC_UTF8TEXT ||
format == wxIPC_UTF16TEXT ||
format == wxIPC_UTF32TEXT;
}
// converts from the data and format into a wxString automatically
//
// this function accepts data in all of wxIPC_TEXT, wxIPC_UNICODETEXT, and
// wxIPC_UTF8TEXT formats but asserts if the format is anything else (i.e.
// such that IsTextFormat(format) doesn't return true)
//
// notice that the size parameter here contains the total size of the data,
// including the terminating '\0' or L'\0'
static
wxString GetTextFromData(const void *data, size_t size, wxIPCFormat format);
// return a buffer at least this size, reallocating buffer if needed
// returns NULL if using an inadequate user buffer which can't be resized
void *GetBufferAtLeast(size_t bytes);
protected:
virtual bool DoExecute(const void *data, size_t size, wxIPCFormat format) = 0;
virtual bool DoPoke(const wxString& item, const void *data, size_t size,
wxIPCFormat format) = 0;
virtual bool DoAdvise(const wxString& item, const void *data, size_t size,
wxIPCFormat format) = 0;
private:
char *m_buffer;
size_t m_buffersize;
bool m_deletebufferwhendone;
protected:
bool m_connected;
wxDECLARE_NO_ASSIGN_CLASS(wxConnectionBase);
wxDECLARE_CLASS(wxConnectionBase);
};
class WXDLLIMPEXP_BASE wxServerBase : public wxObject
{
public:
wxServerBase() { }
virtual ~wxServerBase() { }
// Returns false on error (e.g. port number is already in use)
virtual bool Create(const wxString& serverName) = 0;
// Callbacks to SERVER - override at will
virtual wxConnectionBase *OnAcceptConnection(const wxString& topic) = 0;
wxDECLARE_CLASS(wxServerBase);
};
class WXDLLIMPEXP_BASE wxClientBase : public wxObject
{
public:
wxClientBase() { }
virtual ~wxClientBase() { }
virtual bool ValidHost(const wxString& host) = 0;
// Call this to make a connection. Returns NULL if cannot.
virtual wxConnectionBase *MakeConnection(const wxString& host,
const wxString& server,
const wxString& topic) = 0;
// Callbacks to CLIENT - override at will
virtual wxConnectionBase *OnMakeConnection() = 0;
wxDECLARE_CLASS(wxClientBase);
};
#endif // _WX_IPCBASEH__
| h |
rticonnextdds-usecases | data/projects/rticonnextdds-usecases/VehicleTracking/ExampleCode/thirdparty/wxWidgets-3.1.2/Linux/include/wx/fontenc.h | /////////////////////////////////////////////////////////////////////////////
// Name: wx/fontenc.h
// Purpose: wxFontEncoding constants
// Author: Vadim Zeitlin
// Modified by:
// Created: 29.03.00
// Copyright: (c) Vadim Zeitlin
// Licence: wxWindows licence
/////////////////////////////////////////////////////////////////////////////
#ifndef _WX_FONTENC_H_
#define _WX_FONTENC_H_
// font encodings
enum wxFontEncoding
{
wxFONTENCODING_SYSTEM = -1, // system default
wxFONTENCODING_DEFAULT, // current default encoding
// ISO8859 standard defines a number of single-byte charsets
wxFONTENCODING_ISO8859_1, // West European (Latin1)
wxFONTENCODING_ISO8859_2, // Central and East European (Latin2)
wxFONTENCODING_ISO8859_3, // Esperanto (Latin3)
wxFONTENCODING_ISO8859_4, // Baltic (old) (Latin4)
wxFONTENCODING_ISO8859_5, // Cyrillic
wxFONTENCODING_ISO8859_6, // Arabic
wxFONTENCODING_ISO8859_7, // Greek
wxFONTENCODING_ISO8859_8, // Hebrew
wxFONTENCODING_ISO8859_9, // Turkish (Latin5)
wxFONTENCODING_ISO8859_10, // Variation of Latin4 (Latin6)
wxFONTENCODING_ISO8859_11, // Thai
wxFONTENCODING_ISO8859_12, // doesn't exist currently, but put it
// here anyhow to make all ISO8859
// consecutive numbers
wxFONTENCODING_ISO8859_13, // Baltic (Latin7)
wxFONTENCODING_ISO8859_14, // Latin8
wxFONTENCODING_ISO8859_15, // Latin9 (a.k.a. Latin0, includes euro)
wxFONTENCODING_ISO8859_MAX,
// Cyrillic charset soup (see http://czyborra.com/charsets/cyrillic.html)
wxFONTENCODING_KOI8, // KOI8 Russian
wxFONTENCODING_KOI8_U, // KOI8 Ukrainian
wxFONTENCODING_ALTERNATIVE, // same as MS-DOS CP866
wxFONTENCODING_BULGARIAN, // used under Linux in Bulgaria
// what would we do without Microsoft? They have their own encodings
// for DOS
wxFONTENCODING_CP437, // original MS-DOS codepage
wxFONTENCODING_CP850, // CP437 merged with Latin1
wxFONTENCODING_CP852, // CP437 merged with Latin2
wxFONTENCODING_CP855, // another cyrillic encoding
wxFONTENCODING_CP866, // and another one
// and for Windows
wxFONTENCODING_CP874, // WinThai
wxFONTENCODING_CP932, // Japanese (shift-JIS)
wxFONTENCODING_CP936, // Chinese simplified (GB)
wxFONTENCODING_CP949, // Korean (Hangul charset, a.k.a. EUC-KR)
wxFONTENCODING_CP950, // Chinese (traditional - Big5)
wxFONTENCODING_CP1250, // WinLatin2
wxFONTENCODING_CP1251, // WinCyrillic
wxFONTENCODING_CP1252, // WinLatin1
wxFONTENCODING_CP1253, // WinGreek (8859-7)
wxFONTENCODING_CP1254, // WinTurkish
wxFONTENCODING_CP1255, // WinHebrew
wxFONTENCODING_CP1256, // WinArabic
wxFONTENCODING_CP1257, // WinBaltic (same as Latin 7)
wxFONTENCODING_CP1258, // WinVietnamese
wxFONTENCODING_CP1361, // Johab Korean character set.
wxFONTENCODING_CP12_MAX,
wxFONTENCODING_UTF7, // UTF-7 Unicode encoding
wxFONTENCODING_UTF8, // UTF-8 Unicode encoding
wxFONTENCODING_EUC_JP, // Extended Unix Codepage for Japanese
wxFONTENCODING_UTF16BE, // UTF-16 Big Endian Unicode encoding
wxFONTENCODING_UTF16LE, // UTF-16 Little Endian Unicode encoding
wxFONTENCODING_UTF32BE, // UTF-32 Big Endian Unicode encoding
wxFONTENCODING_UTF32LE, // UTF-32 Little Endian Unicode encoding
wxFONTENCODING_MACROMAN, // the standard mac encodings
wxFONTENCODING_MACJAPANESE,
wxFONTENCODING_MACCHINESETRAD,
wxFONTENCODING_MACKOREAN,
wxFONTENCODING_MACARABIC,
wxFONTENCODING_MACHEBREW,
wxFONTENCODING_MACGREEK,
wxFONTENCODING_MACCYRILLIC,
wxFONTENCODING_MACDEVANAGARI,
wxFONTENCODING_MACGURMUKHI,
wxFONTENCODING_MACGUJARATI,
wxFONTENCODING_MACORIYA,
wxFONTENCODING_MACBENGALI,
wxFONTENCODING_MACTAMIL,
wxFONTENCODING_MACTELUGU,
wxFONTENCODING_MACKANNADA,
wxFONTENCODING_MACMALAJALAM,
wxFONTENCODING_MACSINHALESE,
wxFONTENCODING_MACBURMESE,
wxFONTENCODING_MACKHMER,
wxFONTENCODING_MACTHAI,
wxFONTENCODING_MACLAOTIAN,
wxFONTENCODING_MACGEORGIAN,
wxFONTENCODING_MACARMENIAN,
wxFONTENCODING_MACCHINESESIMP,
wxFONTENCODING_MACTIBETAN,
wxFONTENCODING_MACMONGOLIAN,
wxFONTENCODING_MACETHIOPIC,
wxFONTENCODING_MACCENTRALEUR,
wxFONTENCODING_MACVIATNAMESE,
wxFONTENCODING_MACARABICEXT,
wxFONTENCODING_MACSYMBOL,
wxFONTENCODING_MACDINGBATS,
wxFONTENCODING_MACTURKISH,
wxFONTENCODING_MACCROATIAN,
wxFONTENCODING_MACICELANDIC,
wxFONTENCODING_MACROMANIAN,
wxFONTENCODING_MACCELTIC,
wxFONTENCODING_MACGAELIC,
wxFONTENCODING_MACKEYBOARD,
// more CJK encodings (for historical reasons some are already declared
// above)
wxFONTENCODING_ISO2022_JP, // ISO-2022-JP JIS encoding
wxFONTENCODING_MAX, // highest enumerated encoding value
wxFONTENCODING_MACMIN = wxFONTENCODING_MACROMAN ,
wxFONTENCODING_MACMAX = wxFONTENCODING_MACKEYBOARD ,
// aliases for endian-dependent UTF encodings
#ifdef WORDS_BIGENDIAN
wxFONTENCODING_UTF16 = wxFONTENCODING_UTF16BE, // native UTF-16
wxFONTENCODING_UTF32 = wxFONTENCODING_UTF32BE, // native UTF-32
#else // WORDS_BIGENDIAN
wxFONTENCODING_UTF16 = wxFONTENCODING_UTF16LE, // native UTF-16
wxFONTENCODING_UTF32 = wxFONTENCODING_UTF32LE, // native UTF-32
#endif // WORDS_BIGENDIAN
// alias for the native Unicode encoding on this platform
// (this is used by wxEncodingConverter and wxUTFFile only for now)
#if SIZEOF_WCHAR_T == 2
wxFONTENCODING_UNICODE = wxFONTENCODING_UTF16,
#else // SIZEOF_WCHAR_T == 4
wxFONTENCODING_UNICODE = wxFONTENCODING_UTF32,
#endif
// alternative names for Far Eastern encodings
// Chinese
wxFONTENCODING_GB2312 = wxFONTENCODING_CP936, // Simplified Chinese
wxFONTENCODING_BIG5 = wxFONTENCODING_CP950, // Traditional Chinese
// Japanese (see http://zsigri.tripod.com/fontboard/cjk/jis.html)
wxFONTENCODING_SHIFT_JIS = wxFONTENCODING_CP932, // Shift JIS
// Korean (CP 949 not actually the same but close enough)
wxFONTENCODING_EUC_KR = wxFONTENCODING_CP949,
wxFONTENCODING_JOHAB = wxFONTENCODING_CP1361,
// Vietnamese
wxFONTENCODING_VIETNAMESE = wxFONTENCODING_CP1258
};
#endif // _WX_FONTENC_H_
| h |
rticonnextdds-usecases | data/projects/rticonnextdds-usecases/VehicleTracking/ExampleCode/thirdparty/wxWidgets-3.1.2/Linux/include/wx/fs_mem.h | /////////////////////////////////////////////////////////////////////////////
// Name: wx/fs_mem.h
// Purpose: in-memory file system
// Author: Vaclav Slavik
// Copyright: (c) 2000 Vaclav Slavik
// Licence: wxWindows licence
/////////////////////////////////////////////////////////////////////////////
#ifndef _WX_FS_MEM_H_
#define _WX_FS_MEM_H_
#include "wx/defs.h"
#if wxUSE_FILESYSTEM
#include "wx/filesys.h"
#include "wx/hashmap.h"
class wxMemoryFSFile;
WX_DECLARE_STRING_HASH_MAP(wxMemoryFSFile *, wxMemoryFSHash);
#if wxUSE_GUI
#include "wx/bitmap.h"
#endif // wxUSE_GUI
// ----------------------------------------------------------------------------
// wxMemoryFSHandlerBase
// ----------------------------------------------------------------------------
class WXDLLIMPEXP_BASE wxMemoryFSHandlerBase : public wxFileSystemHandler
{
public:
wxMemoryFSHandlerBase();
virtual ~wxMemoryFSHandlerBase();
// Add file to list of files stored in memory. Stored data (bitmap, text or
// raw data) will be copied into private memory stream and available under
// name "memory:" + filename
static void AddFile(const wxString& filename, const wxString& textdata);
static void AddFile(const wxString& filename, const void *binarydata, size_t size);
static void AddFileWithMimeType(const wxString& filename,
const wxString& textdata,
const wxString& mimetype);
static void AddFileWithMimeType(const wxString& filename,
const void *binarydata, size_t size,
const wxString& mimetype);
// Remove file from memory FS and free occupied memory
static void RemoveFile(const wxString& filename);
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;
protected:
// check that the given file is not already present in m_Hash; logs an
// error and returns false if it does exist
static bool CheckDoesntExist(const wxString& filename);
// the hash map indexed by the names of the files stored in the memory FS
static wxMemoryFSHash m_Hash;
// the file name currently being searched for, i.e. the argument of the
// last FindFirst() call or empty string if FindFirst() hasn't been called
// yet or FindNext() didn't find anything
wxString m_findArgument;
// iterator into m_Hash used by FindFirst/Next(), possibly m_Hash.end() or
// even invalid (can only be used when m_findArgument is not empty)
wxMemoryFSHash::const_iterator m_findIter;
};
// ----------------------------------------------------------------------------
// wxMemoryFSHandler
// ----------------------------------------------------------------------------
#if wxUSE_GUI
// add GUI-only operations to the base class
class WXDLLIMPEXP_CORE wxMemoryFSHandler : public wxMemoryFSHandlerBase
{
public:
// bring the base class versions into the scope, otherwise they would be
// inaccessible in wxMemoryFSHandler
// (unfortunately "using" can't be used as gcc 2.95 doesn't have it...)
static void AddFile(const wxString& filename, const wxString& textdata)
{
wxMemoryFSHandlerBase::AddFile(filename, textdata);
}
static void AddFile(const wxString& filename,
const void *binarydata,
size_t size)
{
wxMemoryFSHandlerBase::AddFile(filename, binarydata, size);
}
static void AddFileWithMimeType(const wxString& filename,
const wxString& textdata,
const wxString& mimetype)
{
wxMemoryFSHandlerBase::AddFileWithMimeType(filename,
textdata,
mimetype);
}
static void AddFileWithMimeType(const wxString& filename,
const void *binarydata, size_t size,
const wxString& mimetype)
{
wxMemoryFSHandlerBase::AddFileWithMimeType(filename,
binarydata, size,
mimetype);
}
#if wxUSE_IMAGE
static void AddFile(const wxString& filename,
const wxImage& image,
wxBitmapType type);
static void AddFile(const wxString& filename,
const wxBitmap& bitmap,
wxBitmapType type);
#endif // wxUSE_IMAGE
};
#else // !wxUSE_GUI
// just the same thing as the base class in wxBase
class WXDLLIMPEXP_BASE wxMemoryFSHandler : public wxMemoryFSHandlerBase
{
};
#endif // wxUSE_GUI/!wxUSE_GUI
#endif // wxUSE_FILESYSTEM
#endif // _WX_FS_MEM_H_
| h |
rticonnextdds-usecases | data/projects/rticonnextdds-usecases/VehicleTracking/ExampleCode/thirdparty/wxWidgets-3.1.2/Linux/include/wx/scrolwin.h | /////////////////////////////////////////////////////////////////////////////
// Name: wx/scrolwin.h
// Purpose: wxScrolledWindow, wxScrolledControl and wxScrollHelper
// Author: Vadim Zeitlin
// Modified by:
// Created: 30.08.00
// Copyright: (c) 2000 Vadim Zeitlin <[email protected]>
// Licence: wxWindows licence
/////////////////////////////////////////////////////////////////////////////
#ifndef _WX_SCROLWIN_H_BASE_
#define _WX_SCROLWIN_H_BASE_
#include "wx/panel.h"
class WXDLLIMPEXP_FWD_CORE wxScrollHelperEvtHandler;
class WXDLLIMPEXP_FWD_BASE wxTimer;
// default scrolled window style: scroll in both directions
#define wxScrolledWindowStyle (wxHSCROLL | wxVSCROLL)
// values for the second argument of wxScrollHelper::ShowScrollbars()
enum wxScrollbarVisibility
{
wxSHOW_SB_NEVER = -1, // never show the scrollbar at all
wxSHOW_SB_DEFAULT, // show scrollbar only if it is needed
wxSHOW_SB_ALWAYS // always show scrollbar, even if not needed
};
// ----------------------------------------------------------------------------
// The hierarchy of scrolling classes is a bit complicated because we want to
// put as much functionality as possible in a mix-in class not deriving from
// wxWindow so that other classes could derive from the same base class on all
// platforms irrespectively of whether they are native controls (and hence
// don't use our scrolling) or not.
//
// So we have
//
// wxAnyScrollHelperBase
// |
// |
// \|/
// wxScrollHelperBase
// |
// |
// \|/
// wxWindow wxScrollHelper
// | \ / /
// | \ / /
// | _| |_ /
// | wxScrolledWindow /
// | /
// \|/ /
// wxControl /
// \ /
// \ /
// _| |_
// wxScrolledControl
//
// ----------------------------------------------------------------------------
// This class allows reusing some of wxScrollHelperBase functionality in
// wxVarScrollHelperBase in wx/vscroll.h without duplicating its code.
class WXDLLIMPEXP_CORE wxAnyScrollHelperBase
{
public:
explicit wxAnyScrollHelperBase(wxWindow* win);
virtual ~wxAnyScrollHelperBase() {}
// Disable use of keyboard keys for scrolling. By default cursor movement
// keys (including Home, End, Page Up and Down) are used to scroll the
// window appropriately. If the derived class uses these keys for something
// else, e.g. changing the currently selected item, this function can be
// used to disable this behaviour as it's not only not necessary then but
// can actually be actively harmful if another object forwards a keyboard
// event corresponding to one of the above keys to us using
// ProcessWindowEvent() because the event will always be processed which
// can be undesirable.
void DisableKeyboardScrolling() { m_kbdScrollingEnabled = false; }
// Override this function to draw the graphic (or just process EVT_PAINT)
virtual void OnDraw(wxDC& WXUNUSED(dc)) { }
// change the DC origin according to the scroll position.
virtual void DoPrepareDC(wxDC& dc) = 0;
// Simple accessor for the window that is really being scrolled.
wxWindow *GetTargetWindow() const { return m_targetWindow; }
// The methods called from the window event handlers.
void HandleOnChar(wxKeyEvent& event);
void HandleOnPaint(wxPaintEvent& event);
protected:
// the window that receives the scroll events and the window to actually
// scroll, respectively
wxWindow *m_win,
*m_targetWindow;
// whether cursor keys should scroll the window
bool m_kbdScrollingEnabled;
};
// This is the class containing the guts of (uniform) scrolling logic.
class WXDLLIMPEXP_CORE wxScrollHelperBase : public wxAnyScrollHelperBase
{
public:
// ctor must be given the associated window
wxScrollHelperBase(wxWindow *winToScroll);
virtual ~wxScrollHelperBase();
// configure the scrolling
virtual void SetScrollbars(int pixelsPerUnitX, int pixelsPerUnitY,
int noUnitsX, int noUnitsY,
int xPos = 0, int yPos = 0,
bool noRefresh = false );
// scroll to the given (in logical coords) position
//
// notice that for backwards compatibility reasons Scroll() is virtual as
// the existing code could override it but new code should override
// DoScroll() instead
virtual void Scroll(int x, int y) { DoScroll(x, y); }
virtual void Scroll(const wxPoint& pt) { DoScroll(pt.x, pt.y); }
// get/set the page size for this orientation (wxVERTICAL/wxHORIZONTAL)
int GetScrollPageSize(int orient) const;
void SetScrollPageSize(int orient, int pageSize);
// get the number of lines the window can scroll,
// returns 0 if no scrollbars are there.
int GetScrollLines( int orient ) const;
// Set the x, y scrolling increments.
void SetScrollRate( int xstep, int ystep );
// get the size of one logical unit in physical ones
void GetScrollPixelsPerUnit(int *pixelsPerUnitX, int *pixelsPerUnitY) const;
// Set scrollbar visibility: it is possible to show scrollbar only if it is
// needed (i.e. if our virtual size is greater than the current size of the
// associated window), always (as wxALWAYS_SHOW_SB style does) or never (in
// which case you should provide some other way to scroll the window as the
// user wouldn't be able to do it at all)
void ShowScrollbars(wxScrollbarVisibility horz, wxScrollbarVisibility vert)
{
DoShowScrollbars(horz, vert);
}
// Test whether the specified scrollbar is shown.
virtual bool IsScrollbarShown(int orient) const = 0;
// Enable/disable Windows scrolling in either direction. If true, wxWidgets
// scrolls the canvas and only a bit of the canvas is invalidated; no
// Clear() is necessary. If false, the whole canvas is invalidated and a
// Clear() is necessary. Disable for when the scroll increment is used to
// actually scroll a non-constant distance
//
// Notice that calling this method with a false argument doesn't disable
// scrolling the window in this direction, it just changes the mechanism by
// which it is implemented to not use wxWindow::ScrollWindow().
virtual void EnableScrolling(bool x_scrolling, bool y_scrolling);
// Get the view start
void GetViewStart(int *x, int *y) const { DoGetViewStart(x, y); }
wxPoint GetViewStart() const
{
wxPoint pt;
DoGetViewStart(&pt.x, &pt.y);
return pt;
}
// Set the scale factor, used in PrepareDC
void SetScale(double xs, double ys) { m_scaleX = xs; m_scaleY = ys; }
double GetScaleX() const { return m_scaleX; }
double GetScaleY() const { return m_scaleY; }
// translate between scrolled and unscrolled coordinates
void CalcScrolledPosition(int x, int y, int *xx, int *yy) const
{ DoCalcScrolledPosition(x, y, xx, yy); }
wxPoint CalcScrolledPosition(const wxPoint& pt) const
{
wxPoint p2;
DoCalcScrolledPosition(pt.x, pt.y, &p2.x, &p2.y);
return p2;
}
void CalcUnscrolledPosition(int x, int y, int *xx, int *yy) const
{ DoCalcUnscrolledPosition(x, y, xx, yy); }
wxPoint CalcUnscrolledPosition(const wxPoint& pt) const
{
wxPoint p2;
DoCalcUnscrolledPosition(pt.x, pt.y, &p2.x, &p2.y);
return p2;
}
void DoCalcScrolledPosition(int x, int y, int *xx, int *yy) const;
void DoCalcUnscrolledPosition(int x, int y, int *xx, int *yy) const;
// Adjust the scrollbars
virtual void AdjustScrollbars() = 0;
// Calculate scroll increment
int CalcScrollInc(wxScrollWinEvent& event);
// 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).
void SetTargetWindow(wxWindow *target);
void SetTargetRect(const wxRect& rect) { m_rectToScroll = rect; }
wxRect GetTargetRect() const { return m_rectToScroll; }
virtual void DoPrepareDC(wxDC& dc) wxOVERRIDE;
// are we generating the autoscroll events?
bool IsAutoScrolling() const { return m_timerAutoScroll != NULL; }
// stop generating the scroll events when mouse is held outside the window
void StopAutoScrolling();
// this method can be overridden in a derived class to forbid sending the
// auto scroll events - note that unlike StopAutoScrolling() it doesn't
// stop the timer, so it will be called repeatedly and will typically
// return different values depending on the current mouse position
//
// the base class version just returns true
virtual bool SendAutoScrollEvents(wxScrollWinEvent& event) const;
// the methods to be called from the window event handlers
void HandleOnScroll(wxScrollWinEvent& event);
void HandleOnSize(wxSizeEvent& event);
void HandleOnMouseEnter(wxMouseEvent& event);
void HandleOnMouseLeave(wxMouseEvent& event);
#if wxUSE_MOUSEWHEEL
void HandleOnMouseWheel(wxMouseEvent& event);
#endif // wxUSE_MOUSEWHEEL
void HandleOnChildFocus(wxChildFocusEvent& event);
#if WXWIN_COMPATIBILITY_2_8
wxDEPRECATED(
void OnScroll(wxScrollWinEvent& event) { HandleOnScroll(event); }
)
#endif // WXWIN_COMPATIBILITY_2_8
protected:
// get pointer to our scroll rect if we use it or NULL
const wxRect *GetScrollRect() const
{
return m_rectToScroll.width != 0 ? &m_rectToScroll : NULL;
}
// get the size of the target window
wxSize GetTargetSize() const
{
return m_rectToScroll.width != 0 ? m_rectToScroll.GetSize()
: m_targetWindow->GetClientSize();
}
void GetTargetSize(int *w, int *h) const
{
wxSize size = GetTargetSize();
if ( w )
*w = size.x;
if ( h )
*h = size.y;
}
// implementation of public methods with the same name
virtual void DoGetViewStart(int *x, int *y) const;
virtual void DoScroll(int x, int y) = 0;
virtual void DoShowScrollbars(wxScrollbarVisibility horz,
wxScrollbarVisibility vert) = 0;
// implementations of various wxWindow virtual methods which should be
// forwarded to us (this can be done by WX_FORWARD_TO_SCROLL_HELPER())
bool ScrollLayout();
void ScrollDoSetVirtualSize(int x, int y);
wxSize ScrollGetBestVirtualSize() const;
// change just the target window (unlike SetWindow which changes m_win as
// well)
void DoSetTargetWindow(wxWindow *target);
// delete the event handler we installed
void DeleteEvtHandler();
// this function should be overridden to return the size available for
// m_targetWindow inside m_win of the given size
//
// the default implementation is only good for m_targetWindow == m_win
// case, if we're scrolling a subwindow you must override this method
virtual wxSize GetSizeAvailableForScrollTarget(const wxSize& size)
{
// returning just size from here is wrong but it was decided that it is
// not wrong enough to break the existing code (which doesn't override
// this recently added function at all) by adding this assert
//
// wxASSERT_MSG( m_targetWindow == m_win, "must be overridden" );
return size;
}
double m_scaleX;
double m_scaleY;
wxRect m_rectToScroll;
wxTimer *m_timerAutoScroll;
// The number of pixels to scroll in horizontal and vertical directions
// respectively.
//
// If 0, means that the scrolling in the given direction is disabled.
int m_xScrollPixelsPerLine;
int m_yScrollPixelsPerLine;
int m_xScrollPosition;
int m_yScrollPosition;
int m_xScrollLines;
int m_yScrollLines;
int m_xScrollLinesPerPage;
int m_yScrollLinesPerPage;
bool m_xScrollingEnabled;
bool m_yScrollingEnabled;
#if wxUSE_MOUSEWHEEL
int m_wheelRotation;
#endif // wxUSE_MOUSEWHEEL
wxScrollHelperEvtHandler *m_handler;
wxDECLARE_NO_COPY_CLASS(wxScrollHelperBase);
};
// this macro can be used in a wxScrollHelper-derived class to forward wxWindow
// methods to corresponding wxScrollHelper methods
#define WX_FORWARD_TO_SCROLL_HELPER() \
public: \
virtual void PrepareDC(wxDC& dc) wxOVERRIDE { DoPrepareDC(dc); } \
virtual bool Layout() wxOVERRIDE { return ScrollLayout(); } \
virtual bool CanScroll(int orient) const wxOVERRIDE \
{ return IsScrollbarShown(orient); } \
virtual void DoSetVirtualSize(int x, int y) wxOVERRIDE \
{ ScrollDoSetVirtualSize(x, y); } \
virtual wxSize GetBestVirtualSize() const wxOVERRIDE \
{ return ScrollGetBestVirtualSize(); }
// include the declaration of the real wxScrollHelper
#if defined(__WXGTK20__) && !defined(__WXUNIVERSAL__)
#include "wx/gtk/scrolwin.h"
#elif defined(__WXGTK__) && !defined(__WXUNIVERSAL__)
#include "wx/gtk1/scrolwin.h"
#else
#define wxHAS_GENERIC_SCROLLWIN
#include "wx/generic/scrolwin.h"
#endif
// ----------------------------------------------------------------------------
// wxScrolled<T>: a wxWindow which knows how to scroll
// ----------------------------------------------------------------------------
// helper class for wxScrolled<T> below
struct WXDLLIMPEXP_CORE wxScrolledT_Helper
{
static wxSize FilterBestSize(const wxWindow *win,
const wxScrollHelper *helper,
const wxSize& origBest);
#ifdef __WXMSW__
static WXLRESULT FilterMSWWindowProc(WXUINT nMsg, WXLRESULT origResult);
#endif
};
// Scrollable window base on window type T. This used to be wxScrolledWindow,
// but wxScrolledWindow includes wxControlContainer functionality and that's
// not always desirable.
template<class T>
class wxScrolled : public T,
public wxScrollHelper,
private wxScrolledT_Helper
{
public:
wxScrolled() : wxScrollHelper(this) { }
wxScrolled(wxWindow *parent,
wxWindowID winid = wxID_ANY,
const wxPoint& pos = wxDefaultPosition,
const wxSize& size = wxDefaultSize,
long style = wxScrolledWindowStyle,
const wxString& name = wxPanelNameStr)
: wxScrollHelper(this)
{
Create(parent, winid, pos, size, style, name);
}
bool Create(wxWindow *parent,
wxWindowID winid,
const wxPoint& pos = wxDefaultPosition,
const wxSize& size = wxDefaultSize,
long style = wxScrolledWindowStyle,
const wxString& name = wxPanelNameStr)
{
m_targetWindow = this;
#ifdef __WXMAC__
this->MacSetClipChildren(true);
#endif
// by default, we're scrollable in both directions (but if one of the
// styles is specified explicitly, we shouldn't add the other one
// automatically)
if ( !(style & (wxHSCROLL | wxVSCROLL)) )
style |= wxHSCROLL | wxVSCROLL;
return T::Create(parent, winid, pos, size, style, name);
}
#ifdef __WXMSW__
// we need to return a special WM_GETDLGCODE value to process just the
// arrows but let the other navigation characters through
virtual WXLRESULT MSWWindowProc(WXUINT nMsg, WXWPARAM wParam, WXLPARAM lParam) wxOVERRIDE
{
return FilterMSWWindowProc(nMsg, T::MSWWindowProc(nMsg, wParam, lParam));
}
// Take into account the scroll origin.
virtual void MSWAdjustBrushOrg(int* xOrg, int* yOrg) const wxOVERRIDE
{
CalcUnscrolledPosition(*xOrg, *yOrg, xOrg, yOrg);
}
#endif // __WXMSW__
WX_FORWARD_TO_SCROLL_HELPER()
protected:
virtual wxSize DoGetBestSize() const wxOVERRIDE
{
return FilterBestSize(this, this, T::DoGetBestSize());
}
private:
wxDECLARE_NO_COPY_CLASS(wxScrolled);
};
// for compatibility with existing code, we provide wxScrolledWindow
// "typedef" for wxScrolled<wxPanel>. It's not a real typedef because we
// want wxScrolledWindow to show in wxRTTI information (the class is widely
// used and likelihood of its wxRTTI information being used too is high):
class WXDLLIMPEXP_CORE wxScrolledWindow : public wxScrolled<wxPanel>
{
public:
wxScrolledWindow() : wxScrolled<wxPanel>() {}
wxScrolledWindow(wxWindow *parent,
wxWindowID winid = wxID_ANY,
const wxPoint& pos = wxDefaultPosition,
const wxSize& size = wxDefaultSize,
long style = wxScrolledWindowStyle,
const wxString& name = wxPanelNameStr)
: wxScrolled<wxPanel>(parent, winid, pos, size, style, name) {}
wxDECLARE_DYNAMIC_CLASS_NO_COPY(wxScrolledWindow);
};
typedef wxScrolled<wxWindow> wxScrolledCanvas;
#endif // _WX_SCROLWIN_H_BASE_
| h |
rticonnextdds-usecases | data/projects/rticonnextdds-usecases/VehicleTracking/ExampleCode/thirdparty/wxWidgets-3.1.2/Linux/include/wx/dcscreen.h | /////////////////////////////////////////////////////////////////////////////
// Name: wx/dcscreen.h
// Purpose: wxScreenDC base header
// Author: Julian Smart
// Modified by:
// Created:
// Copyright: (c) Julian Smart
// Licence: wxWindows Licence
/////////////////////////////////////////////////////////////////////////////
#ifndef _WX_DCSCREEN_H_BASE_
#define _WX_DCSCREEN_H_BASE_
#include "wx/defs.h"
#include "wx/dc.h"
class WXDLLIMPEXP_CORE wxScreenDC : public wxDC
{
public:
wxScreenDC();
static bool StartDrawingOnTop(wxWindow * WXUNUSED(window))
{ return true; }
static bool StartDrawingOnTop(wxRect * WXUNUSED(rect) = NULL)
{ return true; }
static bool EndDrawingOnTop()
{ return true; }
private:
wxDECLARE_DYNAMIC_CLASS(wxScreenDC);
};
#endif
// _WX_DCSCREEN_H_BASE_
| h |
rticonnextdds-usecases | data/projects/rticonnextdds-usecases/VehicleTracking/ExampleCode/thirdparty/wxWidgets-3.1.2/Linux/include/wx/rawbmp.h | ///////////////////////////////////////////////////////////////////////////////
// Name: wx/rawbmp.h
// Purpose: macros for fast, raw bitmap data access
// Author: Eric Kidd, Vadim Zeitlin
// Modified by:
// Created: 10.03.03
// Copyright: (c) 2002 Vadim Zeitlin <[email protected]>
// Licence: wxWindows licence
///////////////////////////////////////////////////////////////////////////////
#ifndef _WX_RAWBMP_H_
#define _WX_RAWBMP_H_
#include "wx/defs.h"
#ifdef wxHAS_RAW_BITMAP
#include "wx/image.h"
#include "wx/bitmap.h"
// ----------------------------------------------------------------------------
// Abstract Pixel API
//
// We need to access our raw bitmap data (1) portably and (2) efficiently.
// We do this using a two-dimensional "iteration" interface. Performance
// is extremely important here: these functions will be called hundreds
// of thousands of times in a row, and even small inefficiencies will
// make applications seem slow.
//
// We can't always rely on inline functions, because not all compilers actually
// bother to inline them unless we crank the optimization levels way up.
// Therefore, we also provide macros to wring maximum speed out of compiler
// unconditionally (e.g. even in debug builds). Of course, if the performance
// isn't absolutely crucial for you you shouldn't be using them but the inline
// functions instead.
// ----------------------------------------------------------------------------
/*
Usage example:
typedef wxPixelData<wxBitmap, wxNativePixelFormat> PixelData;
wxBitmap bmp;
PixelData data(bmp);
if ( !data )
{
... raw access to bitmap data unavailable, do something else ...
return;
}
if ( data.GetWidth() < 20 || data.GetHeight() < 20 )
{
... complain: the bitmap it too small ...
return;
}
PixelData::Iterator p(data);
// we draw a (10, 10)-(20, 20) rect manually using the given r, g, b
p.Offset(data, 10, 10);
for ( int y = 0; y < 10; ++y )
{
PixelData::Iterator rowStart = p;
for ( int x = 0; x < 10; ++x, ++p )
{
p.Red() = r;
p.Green() = g;
p.Blue() = b;
}
p = rowStart;
p.OffsetY(data, 1);
}
*/
/*
Note: we do not use WXDLLIMPEXP_CORE with classes in this file because VC++ has
problems with exporting inner class defined inside a specialization of a
template class from a DLL. Besides, as all the methods are inline it's not
really necessary to put them in DLL at all.
*/
// ----------------------------------------------------------------------------
// wxPixelFormat
// ----------------------------------------------------------------------------
/*
wxPixelFormat is a template class describing the bitmap data format. It
contains the constants describing the format of pixel data, but does not
describe how the entire bitmap is stored (i.e. top-to-bottom,
bottom-to-top, ...). It is also a "traits"-like class, i.e. it only
contains some constants and maybe static methods but nothing more, so it
can be safely used without incurring any overhead as all accesses to it are
done at compile-time.
Current limitations: we don't support RAGABA and ARAGAB formats supported
by Mac OS X. If there is sufficient interest, these classes could be
extended to deal with them. Neither do we support alpha channel having
different representation from the RGB ones (happens under QNX/Photon I
think), but again this could be achieved with some small extra effort.
Template parameters are:
- type of a single pixel component
- size of the single pixel in bits
- indices of red, green and blue pixel components inside the pixel
- index of the alpha component or -1 if none
- type which can contain the full pixel value (all channels)
*/
template <class Channel,
size_t Bpp, int R, int G, int B, int A = -1,
class Pixel = wxUint32>
struct wxPixelFormat
{
// iterator over pixels is usually of type "ChannelType *"
typedef Channel ChannelType;
// the type which may hold the entire pixel value
typedef Pixel PixelType;
// size of one pixel in bits
static const int BitsPerPixel = Bpp;
// size of one pixel in ChannelType units (usually bytes)
static const int SizePixel = Bpp / (8 * sizeof(Channel));
// the channels indices inside the pixel
enum
{
RED = R,
GREEN = G,
BLUE = B,
ALPHA = A
};
// true if we have an alpha channel (together with the other channels, this
// doesn't cover the case of wxImage which stores alpha separately)
enum { HasAlpha = A != -1 };
};
// some "predefined" pixel formats
// -------------------------------
// wxImage format is common to all platforms
typedef wxPixelFormat<unsigned char, 24, 0, 1, 2> wxImagePixelFormat;
// the (most common) native bitmap format without alpha support
#if defined(__WXMSW__)
// under MSW the RGB components are reversed, they're in BGR order
typedef wxPixelFormat<unsigned char, 24, 2, 1, 0> wxNativePixelFormat;
#define wxPIXEL_FORMAT_ALPHA 3
#elif defined(__WXMAC__)
// under Mac, first component is unused but still present, hence we use
// 32bpp, not 24
typedef wxPixelFormat<unsigned char, 32, 1, 2, 3> wxNativePixelFormat;
#define wxPIXEL_FORMAT_ALPHA 0
#elif defined(__WXGTK__)
// Under GTK+ 2.X we use GdkPixbuf, which is standard RGB or RGBA
typedef wxPixelFormat<unsigned char, 24, 0, 1, 2> wxNativePixelFormat;
#define wxPIXEL_FORMAT_ALPHA 3
#elif defined(__WXDFB__)
// Under DirectFB, RGB components are reversed, they're in BGR order
typedef wxPixelFormat<unsigned char, 24, 2, 1, 0> wxNativePixelFormat;
#define wxPIXEL_FORMAT_ALPHA 3
#elif defined(__WXQT__)
typedef wxPixelFormat<unsigned char, 24, 0, 1, 2> wxNativePixelFormat;
#define wxPIXEL_FORMAT_ALPHA 3
#endif
// the (most common) native format for bitmaps with alpha channel
#ifdef wxPIXEL_FORMAT_ALPHA
typedef wxPixelFormat<unsigned char, 32,
wxNativePixelFormat::RED,
wxNativePixelFormat::GREEN,
wxNativePixelFormat::BLUE,
wxPIXEL_FORMAT_ALPHA> wxAlphaPixelFormat;
#endif // wxPIXEL_FORMAT_ALPHA
// we also define the (default/best) pixel format for the given class: this is
// used as default value for the pixel format in wxPixelIterator template
template <class T> struct wxPixelFormatFor;
#if wxUSE_IMAGE
// wxPixelFormatFor is only defined for wxImage, attempt to use it with other
// classes (wxBitmap...) will result in compile errors which is exactly what we
// want
template <>
struct wxPixelFormatFor<wxImage>
{
typedef wxImagePixelFormat Format;
};
#endif //wxUSE_IMAGE
// ----------------------------------------------------------------------------
// wxPixelData
// ----------------------------------------------------------------------------
/*
wxPixelDataBase is just a helper for wxPixelData: it contains things common
to both wxImage and wxBitmap specializations.
*/
class wxPixelDataBase
{
public:
// origin of the rectangular region we represent
wxPoint GetOrigin() const { return m_ptOrigin; }
// width and height of the region we represent
int GetWidth() const { return m_width; }
int GetHeight() const { return m_height; }
wxSize GetSize() const { return wxSize(m_width, m_height); }
// the distance between two rows
int GetRowStride() const { return m_stride; }
// private: -- see comment in the beginning of the file
// the origin of this image inside the bigger bitmap (usually (0, 0))
wxPoint m_ptOrigin;
// the size of the image we address, in pixels
int m_width,
m_height;
// this parameter is the offset of the start of the (N+1)st row from the
// Nth one and can be different from m_bypp*width in some cases:
// a) the most usual one is to force 32/64 bit alignment of rows
// b) another one is for bottom-to-top images where it's negative
// c) finally, it could conceivably be 0 for the images with all
// lines being identical
int m_stride;
protected:
// ctor is protected because this class is only meant to be used as the
// base class by wxPixelData
wxPixelDataBase()
{
m_width =
m_height =
m_stride = 0;
}
};
/*
wxPixelData represents the entire bitmap data, i.e. unlike
wxPixelFormat (which it uses) it also stores the global bitmap
characteristics such as its size, inter-row separation and so on.
Because of this it can be used to move the pixel iterators (which don't
have enough information about the bitmap themselves). This may seem a bit
unnatural but must be done in this way to keep the iterator objects as
small as possible for maximum efficiency as otherwise they wouldn't be put
into the CPU registers by the compiler any more.
Implementation note: we use the standard workaround for lack of partial
template specialization support in VC7: instead of partly specializing the
class Foo<T, U> for some T we introduce FooOut<T> and FooIn<U> nested in
it, make Foo<T, U> equivalent to FooOut<T>::FooIn<U> and fully specialize
FooOut (FIXME-VC7).
Also note that this class doesn't have any default definition because we
can't really do anything without knowing the exact image class. We do
provide wxPixelDataBase to make it simpler to write new wxPixelData
specializations.
*/
// we need to define this skeleton template to mollify VC++
template <class Image>
struct wxPixelDataOut
{
template <class PixelFormat>
class wxPixelDataIn
{
public:
class Iterator { };
};
};
#if wxUSE_IMAGE
// wxPixelData specialization for wxImage: this is the simplest case as we
// don't have to care about different pixel formats here
template <>
struct wxPixelDataOut<wxImage>
{
// NB: this is a template class even though it doesn't use its template
// parameter because otherwise wxPixelData couldn't compile
template <class dummyPixelFormat>
class wxPixelDataIn : public wxPixelDataBase
{
public:
// the type of the class we're working with
typedef wxImage ImageType;
// the iterator which should be used for working with data in this
// format
class Iterator
{
public:
// the pixel format we use
typedef wxImagePixelFormat PixelFormat;
// the pixel data we're working with
typedef
wxPixelDataOut<wxImage>::wxPixelDataIn<PixelFormat> PixelData;
// go back to (0, 0)
void Reset(const PixelData& data)
{
*this = data.GetPixels();
}
// creates the iterator pointing to the beginning of data
Iterator(PixelData& data)
{
Reset(data);
}
// creates the iterator initially pointing to the image origin
Iterator(const wxImage& image)
{
m_pRGB = image.GetData();
if ( image.HasAlpha() )
{
m_pAlpha = image.GetAlpha();
}
else // alpha is not used at all
{
m_pAlpha = NULL;
}
}
// true if the iterator is valid
bool IsOk() const { return m_pRGB != NULL; }
// navigation
// ----------
// advance the iterator to the next pixel, prefix version
Iterator& operator++()
{
m_pRGB += PixelFormat::SizePixel;
if ( m_pAlpha )
++m_pAlpha;
return *this;
}
// postfix (hence less efficient -- don't use it unless you
// absolutely must) version
Iterator operator++(int)
{
Iterator p(*this);
++*this;
return p;
}
// move x pixels to the right and y down
//
// note that the rows don't wrap!
void Offset(const PixelData& data, int x, int y)
{
m_pRGB += data.GetRowStride()*y + PixelFormat::SizePixel*x;
if ( m_pAlpha )
m_pAlpha += data.GetWidth()*y + x;
}
// move x pixels to the right (again, no row wrapping)
void OffsetX(const PixelData& WXUNUSED(data), int x)
{
m_pRGB += PixelFormat::SizePixel*x;
if ( m_pAlpha )
m_pAlpha += x;
}
// move y rows to the bottom
void OffsetY(const PixelData& data, int y)
{
m_pRGB += data.GetRowStride()*y;
if ( m_pAlpha )
m_pAlpha += data.GetWidth()*y;
}
// go to the given position
void MoveTo(const PixelData& data, int x, int y)
{
Reset(data);
Offset(data, x, y);
}
// data access
// -----------
// access to individual colour components
PixelFormat::ChannelType& Red() { return m_pRGB[PixelFormat::RED]; }
PixelFormat::ChannelType& Green() { return m_pRGB[PixelFormat::GREEN]; }
PixelFormat::ChannelType& Blue() { return m_pRGB[PixelFormat::BLUE]; }
PixelFormat::ChannelType& Alpha() { return *m_pAlpha; }
// address the pixel contents directly (always RGB, without alpha)
//
// this can't be used to modify the image as assigning a 32bpp
// value to 24bpp pixel would overwrite an extra byte in the next
// pixel or beyond the end of image
const typename PixelFormat::PixelType& Data()
{ return *(typename PixelFormat::PixelType *)m_pRGB; }
// private: -- see comment in the beginning of the file
// pointer into RGB buffer
unsigned char *m_pRGB;
// pointer into alpha buffer or NULL if alpha isn't used
unsigned char *m_pAlpha;
};
// initializes us with the data of the given image
wxPixelDataIn(ImageType& image) : m_image(image), m_pixels(image)
{
m_width = image.GetWidth();
m_height = image.GetHeight();
m_stride = Iterator::PixelFormat::SizePixel * m_width;
}
// initializes us with the given region of the specified image
wxPixelDataIn(ImageType& image,
const wxPoint& pt,
const wxSize& sz) : m_image(image), m_pixels(image)
{
m_stride = Iterator::PixelFormat::SizePixel * m_width;
InitRect(pt, sz);
}
// initializes us with the given region of the specified image
wxPixelDataIn(ImageType& image,
const wxRect& rect) : m_image(image), m_pixels(image)
{
m_stride = Iterator::PixelFormat::SizePixel * m_width;
InitRect(rect.GetPosition(), rect.GetSize());
}
// we evaluate to true only if we could get access to bitmap data
// successfully
operator bool() const { return m_pixels.IsOk(); }
// get the iterator pointing to the origin
Iterator GetPixels() const { return m_pixels; }
private:
void InitRect(const wxPoint& pt, const wxSize& sz)
{
m_width = sz.x;
m_height = sz.y;
m_ptOrigin = pt;
m_pixels.Offset(*this, pt.x, pt.y);
}
// the image we're working with
ImageType& m_image;
// the iterator pointing to the image origin
Iterator m_pixels;
};
};
#endif //wxUSE_IMAGE
#if wxUSE_GUI
// wxPixelData specialization for wxBitmap: here things are more interesting as
// we also have to support different pixel formats
template <>
struct wxPixelDataOut<wxBitmap>
{
template <class Format>
class wxPixelDataIn : public wxPixelDataBase
{
public:
// the type of the class we're working with
typedef wxBitmap ImageType;
class Iterator
{
public:
// the pixel format we use
typedef Format PixelFormat;
// the type of the pixel components
typedef typename PixelFormat::ChannelType ChannelType;
// the pixel data we're working with
typedef wxPixelDataOut<wxBitmap>::wxPixelDataIn<Format> PixelData;
// go back to (0, 0)
void Reset(const PixelData& data)
{
*this = data.GetPixels();
}
// initializes the iterator to point to the origin of the given
// pixel data
Iterator(PixelData& data)
{
Reset(data);
}
// initializes the iterator to point to the origin of the given
// bitmap
Iterator(wxBitmap& bmp, PixelData& data)
{
// using cast here is ugly but it should be safe as
// GetRawData() real return type should be consistent with
// BitsPerPixel (which is in turn defined by ChannelType) and
// this is the only thing we can do without making GetRawData()
// a template function which is undesirable
m_ptr = (ChannelType *)
bmp.GetRawData(data, PixelFormat::BitsPerPixel);
}
// default constructor
Iterator()
{
m_ptr = NULL;
}
// return true if this iterator is valid
bool IsOk() const { return m_ptr != NULL; }
// navigation
// ----------
// advance the iterator to the next pixel, prefix version
Iterator& operator++()
{
m_ptr += PixelFormat::SizePixel;
return *this;
}
// postfix (hence less efficient -- don't use it unless you
// absolutely must) version
Iterator operator++(int)
{
Iterator p(*this);
++*this;
return p;
}
// move x pixels to the right and y down
//
// note that the rows don't wrap!
void Offset(const PixelData& data, int x, int y)
{
m_ptr += data.GetRowStride()*y + PixelFormat::SizePixel*x;
}
// move x pixels to the right (again, no row wrapping)
void OffsetX(const PixelData& WXUNUSED(data), int x)
{
m_ptr += PixelFormat::SizePixel*x;
}
// move y rows to the bottom
void OffsetY(const PixelData& data, int y)
{
m_ptr += data.GetRowStride()*y;
}
// go to the given position
void MoveTo(const PixelData& data, int x, int y)
{
Reset(data);
Offset(data, x, y);
}
// data access
// -----------
// access to individual colour components
ChannelType& Red() { return m_ptr[PixelFormat::RED]; }
ChannelType& Green() { return m_ptr[PixelFormat::GREEN]; }
ChannelType& Blue() { return m_ptr[PixelFormat::BLUE]; }
ChannelType& Alpha() { return m_ptr[PixelFormat::ALPHA]; }
// address the pixel contents directly
//
// warning: the format is platform dependent
//
// warning 2: assigning to Data() only works correctly for 16bpp or
// 32bpp formats but using it for 24bpp ones overwrites
// one extra byte and so can't be done
typename PixelFormat::PixelType& Data()
{ return *(typename PixelFormat::PixelType *)m_ptr; }
// private: -- see comment in the beginning of the file
// for efficiency reasons this class should not have any other
// fields, otherwise it won't be put into a CPU register (as it
// should inside the inner loops) by some compilers, notably gcc
ChannelType *m_ptr;
};
// ctor associates this pointer with a bitmap and locks the bitmap for
// raw access, it will be unlocked only by our dtor and so these
// objects should normally be only created on the stack, i.e. have
// limited life-time
wxPixelDataIn(wxBitmap& bmp) : m_bmp(bmp), m_pixels(bmp, *this)
{
}
wxPixelDataIn(wxBitmap& bmp, const wxRect& rect)
: m_bmp(bmp), m_pixels(bmp, *this)
{
InitRect(rect.GetPosition(), rect.GetSize());
}
wxPixelDataIn(wxBitmap& bmp, const wxPoint& pt, const wxSize& sz)
: m_bmp(bmp), m_pixels(bmp, *this)
{
InitRect(pt, sz);
}
// we evaluate to true only if we could get access to bitmap data
// successfully
operator bool() const { return m_pixels.IsOk(); }
// get the iterator pointing to the origin
Iterator GetPixels() const { return m_pixels; }
// dtor unlocks the bitmap
~wxPixelDataIn()
{
if ( m_pixels.IsOk() )
{
#if defined(__WXMSW__) || defined(__WXMAC__)
// this is a hack to mark wxBitmap as using alpha channel
if ( Format::HasAlpha )
m_bmp.UseAlpha();
#endif
m_bmp.UngetRawData(*this);
}
// else: don't call UngetRawData() if GetRawData() failed
}
#if WXWIN_COMPATIBILITY_2_8
// not needed anymore, calls to it should be simply removed
wxDEPRECATED_INLINE( void UseAlpha(), wxEMPTY_PARAMETER_VALUE )
#endif
// private: -- see comment in the beginning of the file
// the bitmap we're associated with
wxBitmap m_bmp;
// the iterator pointing to the image origin
Iterator m_pixels;
private:
void InitRect(const wxPoint& pt, const wxSize& sz)
{
m_pixels.Offset(*this, pt.x, pt.y);
m_ptOrigin = pt;
m_width = sz.x;
m_height = sz.y;
}
};
};
#endif //wxUSE_GUI
template <class Image,
class PixelFormat = typename wxPixelFormatFor<Image>::Format >
class wxPixelData :
public wxPixelDataOut<Image>::template wxPixelDataIn<PixelFormat>
{
public:
typedef
typename wxPixelDataOut<Image>::template wxPixelDataIn<PixelFormat>
Base;
wxPixelData(Image& image) : Base(image) { }
wxPixelData(Image& i, const wxRect& rect) : Base(i, rect) { }
wxPixelData(Image& i, const wxPoint& pt, const wxSize& sz)
: Base(i, pt, sz)
{
}
};
// some "predefined" pixel data classes
#if wxUSE_IMAGE
typedef wxPixelData<wxImage> wxImagePixelData;
#endif //wxUSE_IMAGE
#if wxUSE_GUI
typedef wxPixelData<wxBitmap, wxNativePixelFormat> wxNativePixelData;
typedef wxPixelData<wxBitmap, wxAlphaPixelFormat> wxAlphaPixelData;
#endif //wxUSE_GUI
// ----------------------------------------------------------------------------
// wxPixelIterator
// ----------------------------------------------------------------------------
/*
wxPixel::Iterator represents something which points to the pixel data and
allows us to iterate over it. In the simplest case of wxBitmap it is,
indeed, just a pointer, but it can be something more complicated and,
moreover, you are free to specialize it for other image classes and bitmap
formats.
Note that although it would have been much more intuitive to have a real
class here instead of what we have now, this class would need two template
parameters, and this can't be done because we'd need compiler support for
partial template specialization then and VC7 doesn't provide it.
*/
template < class Image, class PixelFormat = wxPixelFormatFor<Image> >
struct wxPixelIterator : public wxPixelData<Image, PixelFormat>::Iterator
{
};
#endif // wxHAS_RAW_BITMAP
#endif // _WX_RAWBMP_H_
| h |
rticonnextdds-usecases | data/projects/rticonnextdds-usecases/VehicleTracking/ExampleCode/thirdparty/wxWidgets-3.1.2/Linux/include/wx/imagiff.h | /////////////////////////////////////////////////////////////////////////////
// Name: wx/imagiff.h
// Purpose: wxImage handler for Amiga IFF images
// Author: Steffen Gutmann
// Copyright: (c) Steffen Gutmann, 2002
// Licence: wxWindows licence
/////////////////////////////////////////////////////////////////////////////
#ifndef _WX_IMAGE_IFF_H_
#define _WX_IMAGE_IFF_H_
#include "wx/image.h"
//-----------------------------------------------------------------------------
// wxIFFHandler
//-----------------------------------------------------------------------------
#if wxUSE_IMAGE && wxUSE_IFF
class WXDLLIMPEXP_CORE wxIFFHandler : public wxImageHandler
{
public:
wxIFFHandler()
{
m_name = wxT("IFF file");
m_extension = wxT("iff");
m_type = wxBITMAP_TYPE_IFF;
m_mime = wxT("image/x-iff");
}
#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
wxDECLARE_DYNAMIC_CLASS(wxIFFHandler);
};
#endif // wxUSE_IMAGE && wxUSE_IFF
#endif // _WX_IMAGE_IFF_H_
| h |
rticonnextdds-usecases | data/projects/rticonnextdds-usecases/VehicleTracking/ExampleCode/thirdparty/wxWidgets-3.1.2/Linux/include/wx/splitter.h | /////////////////////////////////////////////////////////////////////////////
// Name: wx/splitter.h
// Purpose: Base header for wxSplitterWindow
// Author: Julian Smart
// Modified by:
// Created:
// Copyright: (c) Julian Smart
// Licence: wxWindows Licence
/////////////////////////////////////////////////////////////////////////////
#ifndef _WX_SPLITTER_H_BASE_
#define _WX_SPLITTER_H_BASE_
#include "wx/event.h"
// ----------------------------------------------------------------------------
// wxSplitterWindow flags
// ----------------------------------------------------------------------------
#define wxSP_NOBORDER 0x0000
#define wxSP_THIN_SASH 0x0000 // NB: the default is 3D sash
#define wxSP_NOSASH 0x0010
#define wxSP_PERMIT_UNSPLIT 0x0040
#define wxSP_LIVE_UPDATE 0x0080
#define wxSP_3DSASH 0x0100
#define wxSP_3DBORDER 0x0200
#define wxSP_NO_XP_THEME 0x0400
#define wxSP_BORDER wxSP_3DBORDER
#define wxSP_3D (wxSP_3DBORDER | wxSP_3DSASH)
class WXDLLIMPEXP_FWD_CORE wxSplitterEvent;
wxDECLARE_EXPORTED_EVENT( WXDLLIMPEXP_CORE, wxEVT_SPLITTER_SASH_POS_CHANGED, wxSplitterEvent );
wxDECLARE_EXPORTED_EVENT( WXDLLIMPEXP_CORE, wxEVT_SPLITTER_SASH_POS_CHANGING, wxSplitterEvent );
wxDECLARE_EXPORTED_EVENT( WXDLLIMPEXP_CORE, wxEVT_SPLITTER_DOUBLECLICKED, wxSplitterEvent );
wxDECLARE_EXPORTED_EVENT( WXDLLIMPEXP_CORE, wxEVT_SPLITTER_UNSPLIT, wxSplitterEvent );
#include "wx/generic/splitter.h"
#endif // _WX_SPLITTER_H_BASE_
| h |
rticonnextdds-usecases | data/projects/rticonnextdds-usecases/VehicleTracking/ExampleCode/thirdparty/wxWidgets-3.1.2/Linux/include/wx/mousestate.h | ///////////////////////////////////////////////////////////////////////////////
// Name: wx/mousestate.h
// Purpose: Declaration of wxMouseState class
// Author: Vadim Zeitlin
// Created: 2008-09-19 (extracted from wx/utils.h)
// Copyright: (c) 2008 Vadim Zeitlin <[email protected]>
// Licence: wxWindows licence
///////////////////////////////////////////////////////////////////////////////
#ifndef _WX_MOUSESTATE_H_
#define _WX_MOUSESTATE_H_
#include "wx/gdicmn.h" // for wxPoint
#include "wx/kbdstate.h"
// the symbolic names for the mouse buttons
enum wxMouseButton
{
wxMOUSE_BTN_ANY = -1,
wxMOUSE_BTN_NONE = 0,
wxMOUSE_BTN_LEFT = 1,
wxMOUSE_BTN_MIDDLE = 2,
wxMOUSE_BTN_RIGHT = 3,
wxMOUSE_BTN_AUX1 = 4,
wxMOUSE_BTN_AUX2 = 5,
wxMOUSE_BTN_MAX
};
// ----------------------------------------------------------------------------
// wxMouseState contains the information about mouse position, buttons and also
// key modifiers
// ----------------------------------------------------------------------------
// wxMouseState is used to hold information about button and modifier state
// and is what is returned from wxGetMouseState.
class WXDLLIMPEXP_CORE wxMouseState : public wxKeyboardState
{
public:
wxMouseState()
: m_leftDown(false), m_middleDown(false), m_rightDown(false),
m_aux1Down(false), m_aux2Down(false),
m_x(0), m_y(0)
{
}
// default copy ctor, assignment operator and dtor are ok
// accessors for the mouse position
wxCoord GetX() const { return m_x; }
wxCoord GetY() const { return m_y; }
wxPoint GetPosition() const { return wxPoint(m_x, m_y); }
void GetPosition(wxCoord *x, wxCoord *y) const
{
if ( x )
*x = m_x;
if ( y )
*y = m_y;
}
// this overload is for compatibility only
void GetPosition(long *x, long *y) const
{
if ( x )
*x = m_x;
if ( y )
*y = m_y;
}
// accessors for the pressed buttons
bool LeftIsDown() const { return m_leftDown; }
bool MiddleIsDown() const { return m_middleDown; }
bool RightIsDown() const { return m_rightDown; }
bool Aux1IsDown() const { return m_aux1Down; }
bool Aux2IsDown() const { return m_aux2Down; }
bool ButtonIsDown(wxMouseButton but) const
{
switch ( but )
{
case wxMOUSE_BTN_ANY:
return LeftIsDown() || MiddleIsDown() || RightIsDown() ||
Aux1IsDown() || Aux2IsDown();
case wxMOUSE_BTN_LEFT:
return LeftIsDown();
case wxMOUSE_BTN_MIDDLE:
return MiddleIsDown();
case wxMOUSE_BTN_RIGHT:
return RightIsDown();
case wxMOUSE_BTN_AUX1:
return Aux1IsDown();
case wxMOUSE_BTN_AUX2:
return Aux2IsDown();
case wxMOUSE_BTN_NONE:
case wxMOUSE_BTN_MAX:
break;
}
wxFAIL_MSG(wxS("invalid parameter"));
return false;
}
// these functions are mostly used by wxWidgets itself
void SetX(wxCoord x) { m_x = x; }
void SetY(wxCoord y) { m_y = y; }
void SetPosition(const wxPoint& pos) { m_x = pos.x; m_y = pos.y; }
void SetLeftDown(bool down) { m_leftDown = down; }
void SetMiddleDown(bool down) { m_middleDown = down; }
void SetRightDown(bool down) { m_rightDown = down; }
void SetAux1Down(bool down) { m_aux1Down = down; }
void SetAux2Down(bool down) { m_aux2Down = down; }
// this mostly makes sense in the derived classes such as wxMouseEvent
void SetState(const wxMouseState& state) { *this = state; }
// these functions are for compatibility only, they were used in 2.8
// version of wxMouseState but their names are confusing as wxMouseEvent
// has methods with the same names which do something quite different so
// don't use them any more
#if WXWIN_COMPATIBILITY_2_8
wxDEPRECATED_INLINE(bool LeftDown() const, return LeftIsDown(); )
wxDEPRECATED_INLINE(bool MiddleDown() const, return MiddleIsDown(); )
wxDEPRECATED_INLINE(bool RightDown() const, return RightIsDown(); )
#endif // WXWIN_COMPATIBILITY_2_8
// for compatibility reasons these variables are public as the code using
// wxMouseEvent often uses them directly -- however they should not be
// accessed directly in this class, use the accessors above instead
// private:
bool m_leftDown : 1;
bool m_middleDown : 1;
bool m_rightDown : 1;
bool m_aux1Down : 1;
bool m_aux2Down : 1;
wxCoord m_x,
m_y;
};
#endif // _WX_MOUSESTATE_H_
| h |
rticonnextdds-usecases | data/projects/rticonnextdds-usecases/VehicleTracking/ExampleCode/thirdparty/wxWidgets-3.1.2/Linux/include/wx/choicebk.h | ///////////////////////////////////////////////////////////////////////////////
// Name: wx/choicebk.h
// Purpose: wxChoicebook: wxChoice and wxNotebook combination
// Author: Vadim Zeitlin
// Modified by: Wlodzimierz ABX Skiba from wx/listbook.h
// Created: 15.09.04
// Copyright: (c) Vadim Zeitlin, Wlodzimierz Skiba
// Licence: wxWindows licence
///////////////////////////////////////////////////////////////////////////////
#ifndef _WX_CHOICEBOOK_H_
#define _WX_CHOICEBOOK_H_
#include "wx/defs.h"
#if wxUSE_CHOICEBOOK
#include "wx/bookctrl.h"
#include "wx/choice.h"
#include "wx/containr.h"
class WXDLLIMPEXP_FWD_CORE wxChoice;
wxDECLARE_EXPORTED_EVENT( WXDLLIMPEXP_CORE, wxEVT_CHOICEBOOK_PAGE_CHANGED, wxBookCtrlEvent );
wxDECLARE_EXPORTED_EVENT( WXDLLIMPEXP_CORE, wxEVT_CHOICEBOOK_PAGE_CHANGING, wxBookCtrlEvent );
// wxChoicebook flags
#define wxCHB_DEFAULT wxBK_DEFAULT
#define wxCHB_TOP wxBK_TOP
#define wxCHB_BOTTOM wxBK_BOTTOM
#define wxCHB_LEFT wxBK_LEFT
#define wxCHB_RIGHT wxBK_RIGHT
#define wxCHB_ALIGN_MASK wxBK_ALIGN_MASK
// ----------------------------------------------------------------------------
// wxChoicebook
// ----------------------------------------------------------------------------
class WXDLLIMPEXP_CORE wxChoicebook : public wxNavigationEnabled<wxBookCtrlBase>
{
public:
wxChoicebook() { }
wxChoicebook(wxWindow *parent,
wxWindowID id,
const wxPoint& pos = wxDefaultPosition,
const wxSize& size = wxDefaultSize,
long style = 0,
const wxString& name = wxEmptyString)
{
(void)Create(parent, id, pos, size, style, name);
}
// quasi ctor
bool Create(wxWindow *parent,
wxWindowID id,
const wxPoint& pos = wxDefaultPosition,
const wxSize& size = wxDefaultSize,
long style = 0,
const wxString& name = wxEmptyString);
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 bool InsertPage(size_t n,
wxWindow *page,
const wxString& text,
bool bSelect = false,
int imageId = NO_IMAGE) wxOVERRIDE;
virtual int SetSelection(size_t n) wxOVERRIDE
{ return DoSetSelection(n, SetSelection_SendEvent); }
virtual int ChangeSelection(size_t n) wxOVERRIDE { return DoSetSelection(n); }
virtual void SetImageList(wxImageList *imageList) wxOVERRIDE;
virtual bool DeleteAllPages() wxOVERRIDE;
// returns the choice control
wxChoice* GetChoiceCtrl() const { return (wxChoice*)m_bookctrl; }
protected:
virtual void DoSetWindowVariant(wxWindowVariant variant) wxOVERRIDE;
virtual wxWindow *DoRemovePage(size_t page) wxOVERRIDE;
void UpdateSelectedPage(size_t newsel) wxOVERRIDE
{
GetChoiceCtrl()->Select(newsel);
}
wxBookCtrlEvent* CreatePageChangingEvent() const wxOVERRIDE;
void MakeChangedEvent(wxBookCtrlEvent &event) wxOVERRIDE;
// event handlers
void OnChoiceSelected(wxCommandEvent& event);
private:
wxDECLARE_EVENT_TABLE();
wxDECLARE_DYNAMIC_CLASS_NO_COPY(wxChoicebook);
};
// ----------------------------------------------------------------------------
// choicebook event class and related stuff
// ----------------------------------------------------------------------------
// wxChoicebookEvent is obsolete and defined for compatibility only
#define wxChoicebookEvent wxBookCtrlEvent
typedef wxBookCtrlEventFunction wxChoicebookEventFunction;
#define wxChoicebookEventHandler(func) wxBookCtrlEventHandler(func)
#define EVT_CHOICEBOOK_PAGE_CHANGED(winid, fn) \
wx__DECLARE_EVT1(wxEVT_CHOICEBOOK_PAGE_CHANGED, winid, wxBookCtrlEventHandler(fn))
#define EVT_CHOICEBOOK_PAGE_CHANGING(winid, fn) \
wx__DECLARE_EVT1(wxEVT_CHOICEBOOK_PAGE_CHANGING, winid, wxBookCtrlEventHandler(fn))
// old wxEVT_COMMAND_* constants
#define wxEVT_COMMAND_CHOICEBOOK_PAGE_CHANGED wxEVT_CHOICEBOOK_PAGE_CHANGED
#define wxEVT_COMMAND_CHOICEBOOK_PAGE_CHANGING wxEVT_CHOICEBOOK_PAGE_CHANGING
#endif // wxUSE_CHOICEBOOK
#endif // _WX_CHOICEBOOK_H_
| h |
rticonnextdds-usecases | data/projects/rticonnextdds-usecases/VehicleTracking/ExampleCode/thirdparty/wxWidgets-3.1.2/Linux/include/wx/combobox.h | ///////////////////////////////////////////////////////////////////////////////
// Name: wx/combobox.h
// Purpose: wxComboBox declaration
// Author: Vadim Zeitlin
// Modified by:
// Created: 24.12.00
// Copyright: (c) 1996-2000 wxWidgets team
// Licence: wxWindows licence
///////////////////////////////////////////////////////////////////////////////
#ifndef _WX_COMBOBOX_H_BASE_
#define _WX_COMBOBOX_H_BASE_
#include "wx/defs.h"
#if wxUSE_COMBOBOX
// For compatibility with 2.8 include this header to allow using wxTE_XXX
// styles with wxComboBox without explicitly including it in the user code.
#include "wx/textctrl.h"
extern WXDLLIMPEXP_DATA_CORE(const char) wxComboBoxNameStr[];
// ----------------------------------------------------------------------------
// wxComboBoxBase: this interface defines the methods wxComboBox must implement
// ----------------------------------------------------------------------------
#include "wx/ctrlsub.h"
#include "wx/textentry.h"
class WXDLLIMPEXP_CORE wxComboBoxBase : public wxItemContainer,
public wxTextEntry
{
public:
// override these methods to disambiguate between two base classes versions
virtual void Clear() wxOVERRIDE
{
wxTextEntry::Clear();
wxItemContainer::Clear();
}
// IsEmpty() is ambiguous because we inherit it from both wxItemContainer
// and wxTextEntry, and even if defined it here to help the compiler with
// choosing one of them, it would still be confusing for the human users of
// this class. So instead define the clearly named methods below and leave
// IsEmpty() ambiguous to trigger a compilation error if it's used.
bool IsListEmpty() const { return wxItemContainer::IsEmpty(); }
bool IsTextEmpty() const { return wxTextEntry::IsEmpty(); }
// also bring in GetSelection() versions of both base classes in scope
//
// NB: GetSelection(from, to) could be already implemented in wxTextEntry
// but still make it pure virtual because for some platforms it's not
// implemented there and also because the derived class has to override
// it anyhow to avoid ambiguity with the other GetSelection()
virtual int GetSelection() const wxOVERRIDE = 0;
virtual void GetSelection(long *from, long *to) const wxOVERRIDE = 0;
virtual void Popup() { wxFAIL_MSG( wxT("Not implemented") ); }
virtual void Dismiss() { wxFAIL_MSG( wxT("Not implemented") ); }
// may return value different from GetSelection() when the combobox
// dropdown is shown and the user selected, but not yet accepted, a value
// different from the old one in it
virtual int GetCurrentSelection() const { return GetSelection(); }
};
// ----------------------------------------------------------------------------
// include the platform-dependent header defining the real class
// ----------------------------------------------------------------------------
#if defined(__WXUNIVERSAL__)
#include "wx/univ/combobox.h"
#elif defined(__WXMSW__)
#include "wx/msw/combobox.h"
#elif defined(__WXMOTIF__)
#include "wx/motif/combobox.h"
#elif defined(__WXGTK20__)
#include "wx/gtk/combobox.h"
#elif defined(__WXGTK__)
#include "wx/gtk1/combobox.h"
#elif defined(__WXMAC__)
#include "wx/osx/combobox.h"
#elif defined(__WXQT__)
#include "wx/qt/combobox.h"
#endif
#endif // wxUSE_COMBOBOX
#endif // _WX_COMBOBOX_H_BASE_
| h |
rticonnextdds-usecases | data/projects/rticonnextdds-usecases/VehicleTracking/ExampleCode/thirdparty/wxWidgets-3.1.2/Linux/include/wx/atomic.h | /////////////////////////////////////////////////////////////////////////////
// Name: wx/atomic.h
// Purpose: functions to manipulate atomically integers and pointers
// Author: Armel Asselin
// Created: 12/13/2006
// Copyright: (c) Armel Asselin
// Licence: wxWindows licence
/////////////////////////////////////////////////////////////////////////////
#ifndef _WX_ATOMIC_H_
#define _WX_ATOMIC_H_
// ----------------------------------------------------------------------------
// headers
// ----------------------------------------------------------------------------
// get the value of wxUSE_THREADS configuration flag
#include "wx/defs.h"
// constraints on the various functions:
// - wxAtomicDec must return a zero value if the value is zero once
// decremented else it must return any non-zero value (the true value is OK
// but not necessary).
#if wxUSE_THREADS
#if defined(HAVE_GCC_ATOMIC_BUILTINS)
// NB: we intentionally don't use Linux's asm/atomic.h header, because it's
// an internal kernel header that doesn't always work in userspace:
// http://bugs.mysql.com/bug.php?id=28456
// http://golubenco.org/blog/atomic-operations/
inline void wxAtomicInc (wxUint32 &value)
{
__sync_fetch_and_add(&value, 1);
}
inline wxUint32 wxAtomicDec (wxUint32 &value)
{
return __sync_sub_and_fetch(&value, 1);
}
#elif defined(__WINDOWS__)
// include standard Windows headers
#include "wx/msw/wrapwin.h"
inline void wxAtomicInc (wxUint32 &value)
{
InterlockedIncrement ((LONG*)&value);
}
inline wxUint32 wxAtomicDec (wxUint32 &value)
{
return InterlockedDecrement ((LONG*)&value);
}
#elif defined(__DARWIN__)
#include "libkern/OSAtomic.h"
inline void wxAtomicInc (wxUint32 &value)
{
OSAtomicIncrement32 ((int32_t*)&value);
}
inline wxUint32 wxAtomicDec (wxUint32 &value)
{
return OSAtomicDecrement32 ((int32_t*)&value);
}
#elif defined (__SOLARIS__)
#include <atomic.h>
inline void wxAtomicInc (wxUint32 &value)
{
atomic_add_32 ((uint32_t*)&value, 1);
}
inline wxUint32 wxAtomicDec (wxUint32 &value)
{
return atomic_add_32_nv ((uint32_t*)&value, (uint32_t)-1);
}
#else // unknown platform
// it will result in inclusion if the generic implementation code a bit later in this page
#define wxNEEDS_GENERIC_ATOMIC_OPS
#endif // unknown platform
#else // else of wxUSE_THREADS
// if no threads are used we can safely use simple ++/--
inline void wxAtomicInc (wxUint32 &value) { ++value; }
inline wxUint32 wxAtomicDec (wxUint32 &value) { return --value; }
#endif // !wxUSE_THREADS
// ----------------------------------------------------------------------------
// proxies to actual implementations, but for various other types with same
// behaviour
// ----------------------------------------------------------------------------
#ifdef wxNEEDS_GENERIC_ATOMIC_OPS
#include "wx/thread.h" // for wxCriticalSection
class wxAtomicInt32
{
public:
wxAtomicInt32() { } // non initialized for consistency with basic int type
wxAtomicInt32(wxInt32 v) : m_value(v) { }
wxAtomicInt32(const wxAtomicInt32& a) : m_value(a.m_value) {}
operator wxInt32() const { return m_value; }
operator volatile wxInt32&() { return m_value; }
wxAtomicInt32& operator=(wxInt32 v) { m_value = v; return *this; }
void Inc()
{
wxCriticalSectionLocker lock(m_locker);
++m_value;
}
wxInt32 Dec()
{
wxCriticalSectionLocker lock(m_locker);
return --m_value;
}
private:
volatile wxInt32 m_value;
wxCriticalSection m_locker;
};
inline void wxAtomicInc(wxAtomicInt32 &value) { value.Inc(); }
inline wxInt32 wxAtomicDec(wxAtomicInt32 &value) { return value.Dec(); }
#else // !wxNEEDS_GENERIC_ATOMIC_OPS
#define wxHAS_ATOMIC_OPS
inline void wxAtomicInc(wxInt32 &value) { wxAtomicInc((wxUint32&)value); }
inline wxInt32 wxAtomicDec(wxInt32 &value) { return wxAtomicDec((wxUint32&)value); }
typedef wxInt32 wxAtomicInt32;
#endif // wxNEEDS_GENERIC_ATOMIC_OPS
// all the native implementations use 32 bits currently
// for a 64 bits implementation we could use (a future) wxAtomicInt64 as
// default type
typedef wxAtomicInt32 wxAtomicInt;
#endif // _WX_ATOMIC_H_
| h |
rticonnextdds-usecases | data/projects/rticonnextdds-usecases/VehicleTracking/ExampleCode/thirdparty/wxWidgets-3.1.2/Linux/include/wx/filename.h | /////////////////////////////////////////////////////////////////////////////
// Name: wx/filename.h
// Purpose: wxFileName - encapsulates a file path
// Author: Robert Roebling, Vadim Zeitlin
// Modified by:
// Created: 28.12.00
// Copyright: (c) 2000 Robert Roebling
// Licence: wxWindows licence
/////////////////////////////////////////////////////////////////////////////
#ifndef _WX_FILENAME_H_
#define _WX_FILENAME_H_
#include "wx/arrstr.h"
#include "wx/filefn.h"
#include "wx/datetime.h"
#include "wx/intl.h"
#include "wx/longlong.h"
#include "wx/file.h"
#if wxUSE_FILE
class WXDLLIMPEXP_FWD_BASE wxFile;
#endif
#if wxUSE_FFILE
class WXDLLIMPEXP_FWD_BASE wxFFile;
#endif
// this symbol is defined for the platforms where file systems use volumes in
// paths
#if defined(__WINDOWS__)
#define wxHAS_FILESYSTEM_VOLUMES
#endif
// ----------------------------------------------------------------------------
// constants
// ----------------------------------------------------------------------------
// the various values for the path format: this mainly affects the path
// separator but also whether or not the path has the drive part (as under
// Windows)
enum wxPathFormat
{
wxPATH_NATIVE = 0, // the path format for the current platform
wxPATH_UNIX,
wxPATH_BEOS = wxPATH_UNIX,
wxPATH_MAC,
wxPATH_DOS,
wxPATH_WIN = wxPATH_DOS,
wxPATH_OS2 = wxPATH_DOS,
wxPATH_VMS,
wxPATH_MAX // Not a valid value for specifying path format
};
// different conventions that may be used with GetHumanReadableSize()
enum wxSizeConvention
{
wxSIZE_CONV_TRADITIONAL, // 1024 bytes = 1 KB
wxSIZE_CONV_IEC, // 1024 bytes = 1 KiB
wxSIZE_CONV_SI // 1000 bytes = 1 KB
};
// the kind of normalization to do with the file name: these values can be
// or'd together to perform several operations at once
enum wxPathNormalize
{
wxPATH_NORM_ENV_VARS = 0x0001, // replace env vars with their values
wxPATH_NORM_DOTS = 0x0002, // squeeze all .. and .
wxPATH_NORM_TILDE = 0x0004, // Unix only: replace ~ and ~user
wxPATH_NORM_CASE = 0x0008, // if case insensitive => tolower
wxPATH_NORM_ABSOLUTE = 0x0010, // make the path absolute
wxPATH_NORM_LONG = 0x0020, // make the path the long form
wxPATH_NORM_SHORTCUT = 0x0040, // resolve the shortcut, if it is a shortcut
wxPATH_NORM_ALL = 0x00ff & ~wxPATH_NORM_CASE
};
// what exactly should GetPath() return?
enum
{
wxPATH_NO_SEPARATOR = 0x0000, // for symmetry with wxPATH_GET_SEPARATOR
wxPATH_GET_VOLUME = 0x0001, // include the volume if applicable
wxPATH_GET_SEPARATOR = 0x0002 // terminate the path with the separator
};
// Mkdir flags
enum
{
wxPATH_MKDIR_FULL = 0x0001 // create directories recursively
};
// Rmdir flags
enum
{
wxPATH_RMDIR_FULL = 0x0001, // delete with subdirectories if empty
wxPATH_RMDIR_RECURSIVE = 0x0002 // delete all recursively (dangerous!)
};
// FileExists flags
enum
{
wxFILE_EXISTS_REGULAR = 0x0001, // check for existence of a regular file
wxFILE_EXISTS_DIR = 0x0002, // check for existence of a directory
wxFILE_EXISTS_SYMLINK = 0x1004, // check for existence of a symbolic link;
// also sets wxFILE_EXISTS_NO_FOLLOW as
// it would never be satisfied otherwise
wxFILE_EXISTS_DEVICE = 0x0008, // check for existence of a device
wxFILE_EXISTS_FIFO = 0x0016, // check for existence of a FIFO
wxFILE_EXISTS_SOCKET = 0x0032, // check for existence of a socket
// gap for future types
wxFILE_EXISTS_NO_FOLLOW = 0x1000, // don't dereference a contained symlink
wxFILE_EXISTS_ANY = 0x1FFF // check for existence of anything
};
#if wxUSE_LONGLONG
// error code of wxFileName::GetSize()
extern WXDLLIMPEXP_DATA_BASE(const wxULongLong) wxInvalidSize;
#endif // wxUSE_LONGLONG
// ----------------------------------------------------------------------------
// wxFileName: encapsulates a file path
// ----------------------------------------------------------------------------
class WXDLLIMPEXP_BASE wxFileName
{
public:
// constructors and assignment
// the usual stuff
wxFileName() { Clear(); }
wxFileName(const wxFileName& filepath) { Assign(filepath); }
// from a full filename: if it terminates with a '/', a directory path
// is contructed (the name will be empty), otherwise a file name and
// extension are extracted from it
wxFileName( const wxString& fullpath, wxPathFormat format = wxPATH_NATIVE )
{ Assign( fullpath, format ); m_dontFollowLinks = false; }
// from a directory name and a file name
wxFileName(const wxString& path,
const wxString& name,
wxPathFormat format = wxPATH_NATIVE)
{ Assign(path, name, format); m_dontFollowLinks = false; }
// from a volume, directory name, file base name and extension
wxFileName(const wxString& volume,
const wxString& path,
const wxString& name,
const wxString& ext,
wxPathFormat format = wxPATH_NATIVE)
{ Assign(volume, path, name, ext, format); m_dontFollowLinks = false; }
// from a directory name, file base name and extension
wxFileName(const wxString& path,
const wxString& name,
const wxString& ext,
wxPathFormat format = wxPATH_NATIVE)
{ Assign(path, name, ext, format); m_dontFollowLinks = false; }
// the same for delayed initialization
void Assign(const wxFileName& filepath);
void Assign(const wxString& fullpath,
wxPathFormat format = wxPATH_NATIVE);
void Assign(const wxString& volume,
const wxString& path,
const wxString& name,
const wxString& ext,
bool hasExt,
wxPathFormat format = wxPATH_NATIVE);
void Assign(const wxString& volume,
const wxString& path,
const wxString& name,
const wxString& ext,
wxPathFormat format = wxPATH_NATIVE)
{ Assign(volume, path, name, ext, !ext.empty(), format); }
void Assign(const wxString& path,
const wxString& name,
wxPathFormat format = wxPATH_NATIVE);
void Assign(const wxString& path,
const wxString& name,
const wxString& ext,
wxPathFormat format = wxPATH_NATIVE);
void AssignDir(const wxString& dir, wxPathFormat format = wxPATH_NATIVE);
// assorted assignment operators
wxFileName& operator=(const wxFileName& filename)
{ if (this != &filename) Assign(filename); return *this; }
wxFileName& operator=(const wxString& filename)
{ Assign(filename); return *this; }
// reset all components to default, uninitialized state
void Clear();
// static pseudo constructors
static wxFileName FileName(const wxString& file,
wxPathFormat format = wxPATH_NATIVE);
static wxFileName DirName(const wxString& dir,
wxPathFormat format = wxPATH_NATIVE);
// file tests
// is the filename valid at all?
bool IsOk() const
{
// we're fine if we have the path or the name or if we're a root dir
return m_dirs.size() != 0 || !m_name.empty() || !m_relative ||
!m_ext.empty() || m_hasExt;
}
// does the file with this name exist?
bool FileExists() const;
static bool FileExists( const wxString &file );
// does the directory with this name exist?
bool DirExists() const;
static bool DirExists( const wxString &dir );
// does anything at all with this name (i.e. file, directory or some
// other file system object such as a device, socket, ...) exist?
bool Exists(int flags = wxFILE_EXISTS_ANY) const;
static bool Exists(const wxString& path, int flags = wxFILE_EXISTS_ANY);
// checks on most common flags for files/directories;
// more platform-specific features (like e.g. Unix permissions) are not
// available in wxFileName
bool IsDirWritable() const { return wxIsWritable(GetPath()); }
static bool IsDirWritable(const wxString &path) { return wxDirExists(path) && wxIsWritable(path); }
bool IsDirReadable() const { return wxIsReadable(GetPath()); }
static bool IsDirReadable(const wxString &path) { return wxDirExists(path) && wxIsReadable(path); }
// NOTE: IsDirExecutable() is not present because the meaning of "executable"
// directory is very platform-dependent and also not so useful
bool IsFileWritable() const { return wxIsWritable(GetFullPath()); }
static bool IsFileWritable(const wxString &path) { return wxFileExists(path) && wxIsWritable(path); }
bool IsFileReadable() const { return wxIsReadable(GetFullPath()); }
static bool IsFileReadable(const wxString &path) { return wxFileExists(path) && wxIsReadable(path); }
bool IsFileExecutable() const { return wxIsExecutable(GetFullPath()); }
static bool IsFileExecutable(const wxString &path) { return wxFileExists(path) && wxIsExecutable(path); }
// set the file permissions to a combination of wxPosixPermissions enum
// values
bool SetPermissions(int permissions);
// time functions
#if wxUSE_DATETIME
// set the file last access/mod and creation times
// (any of the pointers may be NULL)
bool SetTimes(const wxDateTime *dtAccess,
const wxDateTime *dtMod,
const wxDateTime *dtCreate) const;
// set the access and modification times to the current moment
bool Touch() const;
// return the last access, last modification and create times
// (any of the pointers may be NULL)
bool GetTimes(wxDateTime *dtAccess,
wxDateTime *dtMod,
wxDateTime *dtCreate) const;
// convenience wrapper: get just the last mod time of the file
wxDateTime GetModificationTime() const
{
wxDateTime dtMod;
(void)GetTimes(NULL, &dtMod, NULL);
return dtMod;
}
#endif // wxUSE_DATETIME
// various file/dir operations
// retrieve the value of the current working directory
void AssignCwd(const wxString& volume = wxEmptyString);
static wxString GetCwd(const wxString& volume = wxEmptyString);
// change the current working directory
bool SetCwd() const;
static bool SetCwd( const wxString &cwd );
// get the value of user home (Unix only mainly)
void AssignHomeDir();
static wxString GetHomeDir();
// get the system temporary directory
static wxString GetTempDir();
#if wxUSE_FILE || wxUSE_FFILE
// get a temp file name starting with the specified prefix
void AssignTempFileName(const wxString& prefix);
static wxString CreateTempFileName(const wxString& prefix);
#endif // wxUSE_FILE
#if wxUSE_FILE
// get a temp file name starting with the specified prefix and open the
// file passed to us using this name for writing (atomically if
// possible)
void AssignTempFileName(const wxString& prefix, wxFile *fileTemp);
static wxString CreateTempFileName(const wxString& prefix,
wxFile *fileTemp);
#endif // wxUSE_FILE
#if wxUSE_FFILE
// get a temp file name starting with the specified prefix and open the
// file passed to us using this name for writing (atomically if
// possible)
void AssignTempFileName(const wxString& prefix, wxFFile *fileTemp);
static wxString CreateTempFileName(const wxString& prefix,
wxFFile *fileTemp);
#endif // wxUSE_FFILE
// directory creation and removal.
bool Mkdir(int perm = wxS_DIR_DEFAULT, int flags = 0) const;
static bool Mkdir(const wxString &dir, int perm = wxS_DIR_DEFAULT,
int flags = 0);
bool Rmdir(int flags = 0) const;
static bool Rmdir(const wxString &dir, int flags = 0);
// operations on the path
// normalize the path: with the default flags value, the path will be
// made absolute, without any ".." and "." and all environment
// variables will be expanded in it
//
// this may be done using another (than current) value of cwd
bool Normalize(int flags = wxPATH_NORM_ALL,
const wxString& cwd = wxEmptyString,
wxPathFormat format = wxPATH_NATIVE);
// get a path path relative to the given base directory, i.e. opposite
// of Normalize
//
// pass an empty string to get a path relative to the working directory
//
// returns true if the file name was modified, false if we failed to do
// anything with it (happens when the file is on a different volume,
// for example)
bool MakeRelativeTo(const wxString& pathBase = wxEmptyString,
wxPathFormat format = wxPATH_NATIVE);
// make the path absolute
//
// this may be done using another (than current) value of cwd
bool MakeAbsolute(const wxString& cwd = wxEmptyString,
wxPathFormat format = wxPATH_NATIVE)
{ return Normalize(wxPATH_NORM_DOTS | wxPATH_NORM_ABSOLUTE |
wxPATH_NORM_TILDE, cwd, format); }
// If the path is a symbolic link (Unix-only), indicate that all
// filesystem operations on this path should be performed on the link
// itself and not on the file it points to, as is the case by default.
//
// No effect if this is not a symbolic link.
void DontFollowLink()
{
m_dontFollowLinks = true;
}
// If the path is a symbolic link (Unix-only), returns whether various
// file operations should act on the link itself, or on its target.
//
// This does not test if the path is really a symlink or not.
bool ShouldFollowLink() const
{
return !m_dontFollowLinks;
}
#if defined(__WIN32__) && wxUSE_OLE
// if the path is a shortcut, return the target and optionally,
// the arguments
bool GetShortcutTarget(const wxString& shortcutPath,
wxString& targetFilename,
wxString* arguments = NULL) const;
#endif
// if the path contains the value of the environment variable named envname
// then this function replaces it with the string obtained from
// wxString::Format(replacementFmtString, value_of_envname_variable)
//
// Example:
// wxFileName fn("/usr/openwin/lib/someFile");
// fn.ReplaceEnvVariable("OPENWINHOME");
// // now fn.GetFullPath() == "$OPENWINHOME/lib/someFile"
bool ReplaceEnvVariable(const wxString& envname,
const wxString& replacementFmtString = "$%s",
wxPathFormat format = wxPATH_NATIVE);
// replaces, if present in the path, the home directory for the given user
// (see wxGetHomeDir) with a tilde
bool ReplaceHomeDir(wxPathFormat format = wxPATH_NATIVE);
// Comparison
// compares with the rules of the given platforms format
bool SameAs(const wxFileName& filepath,
wxPathFormat format = wxPATH_NATIVE) const;
// compare with another filename object
bool operator==(const wxFileName& filename) const
{ return SameAs(filename); }
bool operator!=(const wxFileName& filename) const
{ return !SameAs(filename); }
// compare with a filename string interpreted as a native file name
bool operator==(const wxString& filename) const
{ return SameAs(wxFileName(filename)); }
bool operator!=(const wxString& filename) const
{ return !SameAs(wxFileName(filename)); }
// are the file names of this type cases sensitive?
static bool IsCaseSensitive( wxPathFormat format = wxPATH_NATIVE );
// is this filename absolute?
bool IsAbsolute(wxPathFormat format = wxPATH_NATIVE) const;
// is this filename relative?
bool IsRelative(wxPathFormat format = wxPATH_NATIVE) const
{ return !IsAbsolute(format); }
// Returns the characters that aren't allowed in filenames
// on the specified platform.
static wxString GetForbiddenChars(wxPathFormat format = wxPATH_NATIVE);
// Information about path format
// get the string separating the volume from the path for this format,
// return an empty string if this format doesn't support the notion of
// volumes at all
static wxString GetVolumeSeparator(wxPathFormat format = wxPATH_NATIVE);
// get the string of path separators for this format
static wxString GetPathSeparators(wxPathFormat format = wxPATH_NATIVE);
// get the string of path terminators, i.e. characters which terminate the
// path
static wxString GetPathTerminators(wxPathFormat format = wxPATH_NATIVE);
// get the canonical path separator for this format
static wxUniChar GetPathSeparator(wxPathFormat format = wxPATH_NATIVE)
{ return GetPathSeparators(format)[0u]; }
// is the char a path separator for this format?
static bool IsPathSeparator(wxChar ch, wxPathFormat format = wxPATH_NATIVE);
// is this is a DOS path which beings with a windows unique volume name
// ('\\?\Volume{guid}\')?
static bool IsMSWUniqueVolumeNamePath(const wxString& path,
wxPathFormat format = wxPATH_NATIVE);
// Dir accessors
size_t GetDirCount() const { return m_dirs.size(); }
bool AppendDir(const wxString& dir);
void PrependDir(const wxString& dir);
bool InsertDir(size_t before, const wxString& dir);
void RemoveDir(size_t pos);
void RemoveLastDir() { RemoveDir(GetDirCount() - 1); }
// Other accessors
void SetExt( const wxString &ext ) { m_ext = ext; m_hasExt = !m_ext.empty(); }
void ClearExt() { m_ext.clear(); m_hasExt = false; }
void SetEmptyExt() { m_ext.clear(); m_hasExt = true; }
wxString GetExt() const { return m_ext; }
bool HasExt() const { return m_hasExt; }
void SetName( const wxString &name ) { m_name = name; }
wxString GetName() const { return m_name; }
bool HasName() const { return !m_name.empty(); }
void SetVolume( const wxString &volume ) { m_volume = volume; }
wxString GetVolume() const { return m_volume; }
bool HasVolume() const { return !m_volume.empty(); }
// full name is the file name + extension (but without the path)
void SetFullName(const wxString& fullname);
wxString GetFullName() const;
const wxArrayString& GetDirs() const { return m_dirs; }
// flags are combination of wxPATH_GET_XXX flags
wxString GetPath(int flags = wxPATH_GET_VOLUME,
wxPathFormat format = wxPATH_NATIVE) const;
// Replace current path with this one
void SetPath( const wxString &path, wxPathFormat format = wxPATH_NATIVE );
// Construct full path with name and ext
wxString GetFullPath( wxPathFormat format = wxPATH_NATIVE ) const;
// Return the short form of the path (returns identity on non-Windows platforms)
wxString GetShortPath() const;
// Return the long form of the path (returns identity on non-Windows platforms)
wxString GetLongPath() const;
// Is this a file or directory (not necessarily an existing one)
bool IsDir() const { return m_name.empty() && m_ext.empty(); }
// various helpers
// get the canonical path format for this platform
static wxPathFormat GetFormat( wxPathFormat format = wxPATH_NATIVE );
// split a fullpath into the volume, path, (base) name and extension
// (all of the pointers can be NULL)
static void SplitPath(const wxString& fullpath,
wxString *volume,
wxString *path,
wxString *name,
wxString *ext,
bool *hasExt = NULL,
wxPathFormat format = wxPATH_NATIVE);
static void SplitPath(const wxString& fullpath,
wxString *volume,
wxString *path,
wxString *name,
wxString *ext,
wxPathFormat format)
{
SplitPath(fullpath, volume, path, name, ext, NULL, format);
}
// compatibility version: volume is part of path
static void SplitPath(const wxString& fullpath,
wxString *path,
wxString *name,
wxString *ext,
wxPathFormat format = wxPATH_NATIVE);
// split a path into volume and pure path part
static void SplitVolume(const wxString& fullpathWithVolume,
wxString *volume,
wxString *path,
wxPathFormat format = wxPATH_NATIVE);
// strip the file extension: "foo.bar" => "foo" (but ".baz" => ".baz")
static wxString StripExtension(const wxString& fullpath);
#ifdef wxHAS_FILESYSTEM_VOLUMES
// return the string representing a file system volume, or drive
static wxString GetVolumeString(char drive, int flags = wxPATH_GET_SEPARATOR);
#endif // wxHAS_FILESYSTEM_VOLUMES
// File size
#if wxUSE_LONGLONG
// returns the size of the given filename
wxULongLong GetSize() const;
static wxULongLong GetSize(const wxString &file);
// returns the size in a human readable form
wxString
GetHumanReadableSize(const wxString& nullsize = wxGetTranslation("Not available"),
int precision = 1,
wxSizeConvention conv = wxSIZE_CONV_TRADITIONAL) const;
static wxString
GetHumanReadableSize(const wxULongLong& sz,
const wxString& nullsize = wxGetTranslation("Not available"),
int precision = 1,
wxSizeConvention conv = wxSIZE_CONV_TRADITIONAL);
#endif // wxUSE_LONGLONG
// deprecated methods, don't use any more
// --------------------------------------
wxString GetPath( bool withSep, wxPathFormat format = wxPATH_NATIVE ) const
{ return GetPath(withSep ? wxPATH_GET_SEPARATOR : 0, format); }
wxString GetPathWithSep(wxPathFormat format = wxPATH_NATIVE ) const
{ return GetPath(wxPATH_GET_VOLUME | wxPATH_GET_SEPARATOR, format); }
private:
// check whether this dir is valid for Append/Prepend/InsertDir()
static bool IsValidDirComponent(const wxString& dir);
// the drive/volume/device specification (always empty for Unix)
wxString m_volume;
// the path components of the file
wxArrayString m_dirs;
// the file name and extension (empty for directories)
wxString m_name,
m_ext;
// when m_dirs is empty it may mean either that we have no path at all or
// that our path is '/', i.e. the root directory
//
// we use m_relative to distinguish between these two cases, it will be
// true in the former and false in the latter
//
// NB: the path is not absolute just because m_relative is false, it still
// needs the drive (i.e. volume) in some formats (Windows)
bool m_relative;
// when m_ext is empty, it may be because we don't have any extension or
// because we have an empty extension
//
// the difference is important as file with name "foo" and without
// extension has full name "foo" while with empty extension it is "foo."
bool m_hasExt;
// by default, symlinks are dereferenced but this flag can be set with
// DontFollowLink() to change this and make different operations work on
// this file path itself instead of the target of the symlink
bool m_dontFollowLinks;
};
#endif // _WX_FILENAME_H_
| h |
rticonnextdds-usecases | data/projects/rticonnextdds-usecases/VehicleTracking/ExampleCode/thirdparty/wxWidgets-3.1.2/Linux/include/wx/anidecod.h | /////////////////////////////////////////////////////////////////////////////
// Name: wx/anidecod.h
// Purpose: wxANIDecoder, ANI reader for wxImage and wxAnimation
// Author: Francesco Montorsi
// Copyright: (c) 2006 Francesco Montorsi
// Licence: wxWindows licence
/////////////////////////////////////////////////////////////////////////////
#ifndef _WX_ANIDECOD_H
#define _WX_ANIDECOD_H
#include "wx/defs.h"
#if wxUSE_STREAMS && (wxUSE_ICO_CUR || wxUSE_GIF)
#include "wx/stream.h"
#include "wx/image.h"
#include "wx/animdecod.h"
#include "wx/dynarray.h"
class /*WXDLLIMPEXP_CORE*/ wxANIFrameInfo; // private implementation detail
WX_DECLARE_EXPORTED_OBJARRAY(wxANIFrameInfo, wxANIFrameInfoArray);
WX_DECLARE_EXPORTED_OBJARRAY(wxImage, wxImageArray);
// --------------------------------------------------------------------------
// wxANIDecoder class
// --------------------------------------------------------------------------
class WXDLLIMPEXP_CORE wxANIDecoder : public wxAnimationDecoder
{
public:
// constructor, destructor, etc.
wxANIDecoder();
~wxANIDecoder();
virtual wxSize GetFrameSize(unsigned int frame) const wxOVERRIDE;
virtual wxPoint GetFramePosition(unsigned int frame) const wxOVERRIDE;
virtual wxAnimationDisposal GetDisposalMethod(unsigned int frame) const wxOVERRIDE;
virtual long GetDelay(unsigned int frame) const wxOVERRIDE;
virtual wxColour GetTransparentColour(unsigned int frame) const wxOVERRIDE;
// implementation of wxAnimationDecoder's pure virtuals
virtual bool Load( wxInputStream& stream ) wxOVERRIDE;
bool ConvertToImage(unsigned int frame, wxImage *image) const wxOVERRIDE;
wxAnimationDecoder *Clone() const wxOVERRIDE
{ return new wxANIDecoder; }
wxAnimationType GetType() const wxOVERRIDE
{ return wxANIMATION_TYPE_ANI; }
private:
// wxAnimationDecoder pure virtual:
virtual bool DoCanRead( wxInputStream& stream ) const wxOVERRIDE;
// modifies current stream position (see wxAnimationDecoder::CanRead)
// frames stored as wxImage(s): ANI files are meant to be used mostly for animated
// cursors and thus they do not use any optimization to encode differences between
// two frames: they are just a list of images to display sequentially.
wxImageArray m_images;
// the info about each image stored in m_images.
// NB: m_info.GetCount() may differ from m_images.GetCount()!
wxANIFrameInfoArray m_info;
// this is the wxCURHandler used to load the ICON chunk of the ANI files
static wxCURHandler sm_handler;
wxDECLARE_NO_COPY_CLASS(wxANIDecoder);
};
#endif // wxUSE_STREAMS && (wxUSE_ICO_CUR || wxUSE_GIF)
#endif // _WX_ANIDECOD_H
| h |
rticonnextdds-usecases | data/projects/rticonnextdds-usecases/VehicleTracking/ExampleCode/thirdparty/wxWidgets-3.1.2/Linux/include/wx/setup_inc.h | ///////////////////////////////////////////////////////////////////////////////
// Name: wx/setup_inc.h
// Purpose: setup.h settings
// Author: Vadim Zeitlin
// Modified by:
// Created:
// Copyright: (c) Vadim Zeitlin
// Licence: wxWindows licence
///////////////////////////////////////////////////////////////////////////////
// ----------------------------------------------------------------------------
// global settings
// ----------------------------------------------------------------------------
// define this to 0 when building wxBase library - this can also be done from
// makefile/project file overriding the value here
#ifndef wxUSE_GUI
#define wxUSE_GUI 1
#endif // wxUSE_GUI
// ----------------------------------------------------------------------------
// compatibility settings
// ----------------------------------------------------------------------------
// This setting determines the compatibility with 2.8 API: set it to 0 to
// flag all cases of using deprecated functions.
//
// Default is 1 but please try building your code with 0 as the default will
// change to 0 in the next version and the deprecated functions will disappear
// in the version after it completely.
//
// Recommended setting: 0 (please update your code)
#define WXWIN_COMPATIBILITY_2_8 0
// This setting determines the compatibility with 3.0 API: set it to 0 to
// flag all cases of using deprecated functions.
//
// Default is 1 but please try building your code with 0 as the default will
// change to 0 in the next version and the deprecated functions will disappear
// in the version after it completely.
//
// Recommended setting: 0 (please update your code)
#define WXWIN_COMPATIBILITY_3_0 1
// MSW-only: Set to 0 for accurate dialog units, else 1 for old behaviour when
// default system font is used for wxWindow::GetCharWidth/Height() instead of
// the current font.
//
// Default is 0
//
// Recommended setting: 0
#define wxDIALOG_UNIT_COMPATIBILITY 0
// Provide unsafe implicit conversions in wxString to "const char*" or
// "std::string" (depending on wxUSE_STD_STRING_CONV_IN_WXSTRING value).
//
// Default is 1 but only for compatibility reasons, it is recommended to set
// this to 0 because converting wxString to a narrow (non-Unicode) string may
// fail unless a locale using UTF-8 encoding is used, which is never the case
// under MSW, for example, hence such conversions can result in silent data
// loss.
//
// Recommended setting: 0
#define wxUSE_UNSAFE_WXSTRING_CONV 1
// If set to 1, enables "reproducible builds", i.e. build output should be
// exactly the same if the same build is redone again. As using __DATE__ and
// __TIME__ macros clearly makes the build irreproducible, setting this option
// to 1 disables their use in the library code.
//
// Default is 0
//
// Recommended setting: 0
#define wxUSE_REPRODUCIBLE_BUILD 0
// ----------------------------------------------------------------------------
// debugging settings
// ----------------------------------------------------------------------------
// wxDEBUG_LEVEL will be defined as 1 in wx/debug.h so normally there is no
// need to define it here. You may do it for two reasons: either completely
// disable/compile out the asserts in release version (then do it inside #ifdef
// NDEBUG) or, on the contrary, enable more asserts, including the usually
// disabled ones, in the debug build (then do it inside #ifndef NDEBUG)
//
// #ifdef NDEBUG
// #define wxDEBUG_LEVEL 0
// #else
// #define wxDEBUG_LEVEL 2
// #endif
// wxHandleFatalExceptions() may be used to catch the program faults at run
// time and, instead of terminating the program with a usual GPF message box,
// call the user-defined wxApp::OnFatalException() function. If you set
// wxUSE_ON_FATAL_EXCEPTION to 0, wxHandleFatalExceptions() will not work.
//
// This setting is for Win32 only and can only be enabled if your compiler
// supports Win32 structured exception handling (currently only VC++ does)
//
// Default is 1
//
// Recommended setting: 1 if your compiler supports it.
#define wxUSE_ON_FATAL_EXCEPTION 1
// Set this to 1 to be able to generate a human-readable (unlike
// machine-readable minidump created by wxCrashReport::Generate()) stack back
// trace when your program crashes using wxStackWalker
//
// Default is 1 if supported by the compiler.
//
// Recommended setting: 1, set to 0 if your programs never crash
#define wxUSE_STACKWALKER 1
// Set this to 1 to compile in wxDebugReport class which allows you to create
// and optionally upload to your web site a debug report consisting of back
// trace of the crash (if wxUSE_STACKWALKER == 1) and other information.
//
// Default is 1 if supported by the compiler.
//
// Recommended setting: 1, it is compiled into a separate library so there
// is no overhead if you don't use it
#define wxUSE_DEBUGREPORT 1
// Generic comment about debugging settings: they are very useful if you don't
// use any other memory leak detection tools such as Purify/BoundsChecker, but
// are probably redundant otherwise. Also, Visual C++ CRT has the same features
// as wxWidgets memory debugging subsystem built in since version 5.0 and you
// may prefer to use it instead of built in memory debugging code because it is
// faster and more fool proof.
//
// Using VC++ CRT memory debugging is enabled by default in debug build (_DEBUG
// is defined) if wxUSE_GLOBAL_MEMORY_OPERATORS is *not* enabled (i.e. is 0)
// and if __NO_VC_CRTDBG__ is not defined.
// The rest of the options in this section are obsolete and not supported,
// enable them at your own risk.
// If 1, enables wxDebugContext, for writing error messages to file, etc. If
// __WXDEBUG__ is not defined, will still use the normal memory operators.
//
// Default is 0
//
// Recommended setting: 0
#define wxUSE_DEBUG_CONTEXT 0
// If 1, enables debugging versions of wxObject::new and wxObject::delete *IF*
// __WXDEBUG__ is also defined.
//
// WARNING: this code may not work with all architectures, especially if
// alignment is an issue. This switch is currently ignored for mingw / cygwin
//
// Default is 0
//
// Recommended setting: 1 if you are not using a memory debugging tool, else 0
#define wxUSE_MEMORY_TRACING 0
// In debug mode, cause new and delete to be redefined globally.
// If this causes problems (e.g. link errors which is a common problem
// especially if you use another library which also redefines the global new
// and delete), set this to 0.
// This switch is currently ignored for mingw / cygwin
//
// Default is 0
//
// Recommended setting: 0
#define wxUSE_GLOBAL_MEMORY_OPERATORS 0
// In debug mode, causes new to be defined to be WXDEBUG_NEW (see object.h). If
// this causes problems (e.g. link errors), set this to 0. You may need to set
// this to 0 if using templates (at least for VC++). This switch is currently
// ignored for MinGW/Cygwin.
//
// Default is 0
//
// Recommended setting: 0
#define wxUSE_DEBUG_NEW_ALWAYS 0
// ----------------------------------------------------------------------------
// Unicode support
// ----------------------------------------------------------------------------
// These settings are obsolete: the library is always built in Unicode mode
// now, only set wxUSE_UNICODE to 0 to compile legacy code in ANSI mode if
// absolutely necessary -- updating it is strongly recommended as the ANSI mode
// will disappear completely in future wxWidgets releases.
#ifndef wxUSE_UNICODE
#define wxUSE_UNICODE 1
#endif
// wxUSE_WCHAR_T is required by wxWidgets now, don't change.
#define wxUSE_WCHAR_T 1
// ----------------------------------------------------------------------------
// global features
// ----------------------------------------------------------------------------
// Compile library in exception-safe mode? If set to 1, the library will try to
// behave correctly in presence of exceptions (even though it still will not
// use the exceptions itself) and notify the user code about any unhandled
// exceptions. If set to 0, propagation of the exceptions through the library
// code will lead to undefined behaviour -- but the code itself will be
// slightly smaller and faster.
//
// Note that like wxUSE_THREADS this option is automatically set to 0 if
// wxNO_EXCEPTIONS is defined.
//
// Default is 1
//
// Recommended setting: depends on whether you intend to use C++ exceptions
// in your own code (1 if you do, 0 if you don't)
#define wxUSE_EXCEPTIONS 1
// Set wxUSE_EXTENDED_RTTI to 1 to use extended RTTI
//
// Default is 0
//
// Recommended setting: 0 (this is still work in progress...)
#define wxUSE_EXTENDED_RTTI 0
// Support for message/error logging. This includes wxLogXXX() functions and
// wxLog and derived classes. Don't set this to 0 unless you really know what
// you are doing.
//
// Default is 1
//
// Recommended setting: 1 (always)
#define wxUSE_LOG 1
// Recommended setting: 1
#define wxUSE_LOGWINDOW 1
// Recommended setting: 1
#define wxUSE_LOGGUI 1
// Recommended setting: 1
#define wxUSE_LOG_DIALOG 1
// Support for command line parsing using wxCmdLineParser class.
//
// Default is 1
//
// Recommended setting: 1 (can be set to 0 if you don't use the cmd line)
#define wxUSE_CMDLINE_PARSER 1
// Support for multithreaded applications: if 1, compile in thread classes
// (thread.h) and make the library a bit more thread safe. Although thread
// support is quite stable by now, you may still consider recompiling the
// library without it if you have no use for it - this will result in a
// somewhat smaller and faster operation.
//
// Notice that if wxNO_THREADS is defined, wxUSE_THREADS is automatically reset
// to 0 in wx/chkconf.h, so, for example, if you set USE_THREADS to 0 in
// build/msw/config.* file this value will have no effect.
//
// Default is 1
//
// Recommended setting: 0 unless you do plan to develop MT applications
#define wxUSE_THREADS 1
// If enabled, compiles wxWidgets streams classes
//
// wx stream classes are used for image IO, process IO redirection, network
// protocols implementation and much more and so disabling this results in a
// lot of other functionality being lost.
//
// Default is 1
//
// Recommended setting: 1 as setting it to 0 disables many other things
#define wxUSE_STREAMS 1
// Support for positional parameters (e.g. %1$d, %2$s ...) in wxVsnprintf.
// Note that if the system's implementation does not support positional
// parameters, setting this to 1 forces the use of the wxWidgets implementation
// of wxVsnprintf. The standard vsnprintf() supports positional parameters on
// many Unix systems but usually doesn't under Windows.
//
// Positional parameters are very useful when translating a program since using
// them in formatting strings allow translators to correctly reorder the
// translated sentences.
//
// Default is 1
//
// Recommended setting: 1 if you want to support multiple languages
#define wxUSE_PRINTF_POS_PARAMS 1
// Enable the use of compiler-specific thread local storage keyword, if any.
// This is used for wxTLS_XXX() macros implementation and normally should use
// the compiler-provided support as it's simpler and more efficient, but is
// disabled under Windows in wx/msw/chkconf.h as it can't be used if wxWidgets
// is used in a dynamically loaded Win32 DLL (i.e. using LoadLibrary()) under
// XP as this triggers a bug in compiler TLS support that results in crashes
// when any TLS variables are used.
//
// If you're absolutely sure that your build of wxWidgets is never going to be
// used in such situation, either because it's not going to be linked from any
// kind of plugin or because you only target Vista or later systems, you can
// set this to 2 to force the use of compiler TLS even under MSW.
//
// Default is 1 meaning that compiler TLS is used only if it's 100% safe.
//
// Recommended setting: 2 if you want to have maximal performance and don't
// care about the scenario described above.
#define wxUSE_COMPILER_TLS 1
// ----------------------------------------------------------------------------
// Interoperability with the standard library.
// ----------------------------------------------------------------------------
// Set wxUSE_STL to 1 to enable maximal interoperability with the standard
// library, even at the cost of backwards compatibility.
//
// Default is 0
//
// Recommended setting: 0 as the options below already provide a relatively
// good level of interoperability and changing this option arguably isn't worth
// diverging from the official builds of the library.
#define wxUSE_STL 0
// This is not a real option but is used as the default value for
// wxUSE_STD_IOSTREAM, wxUSE_STD_STRING and wxUSE_STD_CONTAINERS_COMPATIBLY.
//
// Set it to 0 if you want to disable the use of all standard classes
// completely for some reason.
#define wxUSE_STD_DEFAULT 1
// Use standard C++ containers where it can be done without breaking backwards
// compatibility.
//
// This provides better interoperability with the standard library, e.g. with
// this option on it's possible to insert std::vector<> into many wxWidgets
// containers directly.
//
// Default is 1.
//
// Recommended setting is 1 unless you want to avoid all dependencies on the
// standard library.
#define wxUSE_STD_CONTAINERS_COMPATIBLY wxUSE_STD_DEFAULT
// Use standard C++ containers to implement wxVector<>, wxStack<>, wxDList<>
// and wxHashXXX<> classes. If disabled, wxWidgets own (mostly compatible but
// usually more limited) implementations are used which allows to avoid the
// dependency on the C++ run-time library.
//
// Default is 0 for compatibility reasons.
//
// Recommended setting: 1 unless compatibility with the official wxWidgets
// build and/or the existing code is a concern.
#define wxUSE_STD_CONTAINERS 0
// Use standard C++ streams if 1 instead of wx streams in some places. If
// disabled, wx streams are used everywhere and wxWidgets doesn't depend on the
// standard streams library.
//
// Notice that enabling this does not replace wx streams with std streams
// everywhere, in a lot of places wx streams are used no matter what.
//
// Default is 1 if compiler supports it.
//
// Recommended setting: 1 if you use the standard streams anyhow and so
// dependency on the standard streams library is not a
// problem
#define wxUSE_STD_IOSTREAM wxUSE_STD_DEFAULT
// Enable minimal interoperability with the standard C++ string class if 1.
// "Minimal" means that wxString can be constructed from std::string or
// std::wstring but can't be implicitly converted to them. You need to enable
// the option below for the latter.
//
// Default is 1 for most compilers.
//
// Recommended setting: 1 unless you want to ensure your program doesn't use
// the standard C++ library at all.
#define wxUSE_STD_STRING wxUSE_STD_DEFAULT
// Make wxString as much interchangeable with std::[w]string as possible, in
// particular allow implicit conversion of wxString to either of these classes.
// This comes at a price (or a benefit, depending on your point of view) of not
// allowing implicit conversion to "const char *" and "const wchar_t *".
//
// Because a lot of existing code relies on these conversions, this option is
// disabled by default but can be enabled for your build if you don't care
// about compatibility.
//
// Default is 0 if wxUSE_STL has its default value or 1 if it is enabled.
//
// Recommended setting: 0 to remain compatible with the official builds of
// wxWidgets.
#define wxUSE_STD_STRING_CONV_IN_WXSTRING wxUSE_STL
// VC++ 4.2 and above allows <iostream> and <iostream.h> but you can't mix
// them. Set this option to 1 to use <iostream.h>, 0 to use <iostream>.
//
// Note that newer compilers (including VC++ 7.1 and later) don't support
// wxUSE_IOSTREAMH == 1 and so <iostream> will be used anyhow.
//
// Default is 0.
//
// Recommended setting: 0, only set to 1 if you use a really old compiler
#define wxUSE_IOSTREAMH 0
// ----------------------------------------------------------------------------
// non GUI features selection
// ----------------------------------------------------------------------------
// Set wxUSE_LONGLONG to 1 to compile the wxLongLong class. This is a 64 bit
// integer which is implemented in terms of native 64 bit integers if any or
// uses emulation otherwise.
//
// This class is required by wxDateTime and so you should enable it if you want
// to use wxDateTime. For most modern platforms, it will use the native 64 bit
// integers in which case (almost) all of its functions are inline and it
// almost does not take any space, so there should be no reason to switch it
// off.
//
// Recommended setting: 1
#define wxUSE_LONGLONG 1
// Set wxUSE_BASE64 to 1, to compile in Base64 support. This is required for
// storing binary data in wxConfig on most platforms.
//
// Default is 1.
//
// Recommended setting: 1 (but can be safely disabled if you don't use it)
#define wxUSE_BASE64 1
// Set this to 1 to be able to use wxEventLoop even in console applications
// (i.e. using base library only, without GUI). This is mostly useful for
// processing socket events but is also necessary to use timers in console
// applications
//
// Default is 1.
//
// Recommended setting: 1 (but can be safely disabled if you don't use it)
#define wxUSE_CONSOLE_EVENTLOOP 1
// Set wxUSE_(F)FILE to 1 to compile wx(F)File classes. wxFile uses low level
// POSIX functions for file access, wxFFile uses ANSI C stdio.h functions.
//
// Default is 1
//
// Recommended setting: 1 (wxFile is highly recommended as it is required by
// i18n code, wxFileConfig and others)
#define wxUSE_FILE 1
#define wxUSE_FFILE 1
// Use wxFSVolume class providing access to the configured/active mount points
//
// Default is 1
//
// Recommended setting: 1 (but may be safely disabled if you don't use it)
#define wxUSE_FSVOLUME 1
// Use wxSecretStore class for storing passwords using OS-specific facilities.
//
// Default is 1
//
// Recommended setting: 1 (but may be safely disabled if you don't use it)
#define wxUSE_SECRETSTORE 1
// Use wxStandardPaths class which allows to retrieve some standard locations
// in the file system
//
// Default is 1
//
// Recommended setting: 1 (may be disabled to save space, but not much)
#define wxUSE_STDPATHS 1
// use wxTextBuffer class: required by wxTextFile
#define wxUSE_TEXTBUFFER 1
// use wxTextFile class: requires wxFile and wxTextBuffer, required by
// wxFileConfig
#define wxUSE_TEXTFILE 1
// i18n support: _() macro, wxLocale class. Requires wxTextFile.
#define wxUSE_INTL 1
// Provide wxFoo_l() functions similar to standard foo() functions but taking
// an extra locale parameter.
//
// Notice that this is fully implemented only for the systems providing POSIX
// xlocale support or Microsoft Visual C++ >= 8 (which provides proprietary
// almost-equivalent of xlocale functions), otherwise wxFoo_l() functions will
// only work for the current user locale and "C" locale. You can use
// wxHAS_XLOCALE_SUPPORT to test whether the full support is available.
//
// Default is 1
//
// Recommended setting: 1 but may be disabled if you are writing programs
// running only in C locale anyhow
#define wxUSE_XLOCALE 1
// Set wxUSE_DATETIME to 1 to compile the wxDateTime and related classes which
// allow to manipulate dates, times and time intervals.
//
// Requires: wxUSE_LONGLONG
//
// Default is 1
//
// Recommended setting: 1
#define wxUSE_DATETIME 1
// Set wxUSE_TIMER to 1 to compile wxTimer class
//
// Default is 1
//
// Recommended setting: 1
#define wxUSE_TIMER 1
// Use wxStopWatch clas.
//
// Default is 1
//
// Recommended setting: 1 (needed by wxSocket)
#define wxUSE_STOPWATCH 1
// Set wxUSE_FSWATCHER to 1 if you want to enable wxFileSystemWatcher
//
// Default is 1
//
// Recommended setting: 1
#define wxUSE_FSWATCHER 1
// Setting wxUSE_CONFIG to 1 enables the use of wxConfig and related classes
// which allow the application to store its settings in the persistent
// storage. Setting this to 1 will also enable on-demand creation of the
// global config object in wxApp.
//
// See also wxUSE_CONFIG_NATIVE below.
//
// Recommended setting: 1
#define wxUSE_CONFIG 1
// If wxUSE_CONFIG is 1, you may choose to use either the native config
// classes under Windows (using .INI files under Win16 and the registry under
// Win32) or the portable text file format used by the config classes under
// Unix.
//
// Default is 1 to use native classes. Note that you may still use
// wxFileConfig even if you set this to 1 - just the config object created by
// default for the applications needs will be a wxRegConfig or wxIniConfig and
// not wxFileConfig.
//
// Recommended setting: 1
#define wxUSE_CONFIG_NATIVE 1
// If wxUSE_DIALUP_MANAGER is 1, compile in wxDialUpManager class which allows
// to connect/disconnect from the network and be notified whenever the dial-up
// network connection is established/terminated. Requires wxUSE_DYNAMIC_LOADER.
//
// Default is 1.
//
// Recommended setting: 1
#define wxUSE_DIALUP_MANAGER 1
// Compile in classes for run-time DLL loading and function calling.
// Required by wxUSE_DIALUP_MANAGER.
//
// This setting is for Win32 only
//
// Default is 1.
//
// Recommended setting: 1
#define wxUSE_DYNLIB_CLASS 1
// experimental, don't use for now
#define wxUSE_DYNAMIC_LOADER 1
// Set to 1 to use socket classes
#define wxUSE_SOCKETS 1
// Set to 1 to use ipv6 socket classes (requires wxUSE_SOCKETS)
//
// Notice that currently setting this option under Windows will result in
// programs which can only run on recent OS versions (with ws2_32.dll
// installed) which is why it is disabled by default.
//
// Default is 1.
//
// Recommended setting: 1 if you need IPv6 support
#define wxUSE_IPV6 0
// Set to 1 to enable virtual file systems (required by wxHTML)
#define wxUSE_FILESYSTEM 1
// Set to 1 to enable virtual ZIP filesystem (requires wxUSE_FILESYSTEM)
#define wxUSE_FS_ZIP 1
// Set to 1 to enable virtual archive filesystem (requires wxUSE_FILESYSTEM)
#define wxUSE_FS_ARCHIVE 1
// Set to 1 to enable virtual Internet filesystem (requires wxUSE_FILESYSTEM)
#define wxUSE_FS_INET 1
// wxArchive classes for accessing archives such as zip and tar
#define wxUSE_ARCHIVE_STREAMS 1
// Set to 1 to compile wxZipInput/OutputStream classes.
#define wxUSE_ZIPSTREAM 1
// Set to 1 to compile wxTarInput/OutputStream classes.
#define wxUSE_TARSTREAM 1
// Set to 1 to compile wxZlibInput/OutputStream classes. Also required by
// wxUSE_LIBPNG
#define wxUSE_ZLIB 1
// Set to 1 if liblzma is available to enable wxLZMA{Input,Output}Stream
// classes.
//
// Notice that if you enable this build option when not using configure or
// CMake, you need to ensure that liblzma headers and libraries are available
// (i.e. by building the library yourself or downloading its binaries) and can
// be found, either by copying them to one of the locations searched by the
// compiler/linker by default (e.g. any of the directories in the INCLUDE or
// LIB environment variables, respectively, when using MSVC) or modify the
// make- or project files to add references to these directories.
//
// Default is 0 under MSW, auto-detected by configure.
//
// Recommended setting: 1 if you need LZMA compression.
#define wxUSE_LIBLZMA 0
// If enabled, the code written by Apple will be used to write, in a portable
// way, float on the disk. See extended.c for the license which is different
// from wxWidgets one.
//
// Default is 1.
//
// Recommended setting: 1 unless you don't like the license terms (unlikely)
#define wxUSE_APPLE_IEEE 1
// Joystick support class
#define wxUSE_JOYSTICK 1
// wxFontEnumerator class
#define wxUSE_FONTENUM 1
// wxFontMapper class
#define wxUSE_FONTMAP 1
// wxMimeTypesManager class
#define wxUSE_MIMETYPE 1
// wxProtocol and related classes: if you want to use either of wxFTP, wxHTTP
// or wxURL you need to set this to 1.
//
// Default is 1.
//
// Recommended setting: 1
#define wxUSE_PROTOCOL 1
// The settings for the individual URL schemes
#define wxUSE_PROTOCOL_FILE 1
#define wxUSE_PROTOCOL_FTP 1
#define wxUSE_PROTOCOL_HTTP 1
// Define this to use wxURL class.
#define wxUSE_URL 1
// Define this to use native platform url and protocol support.
// Currently valid only for MS-Windows.
// Note: if you set this to 1, you can open ftp/http/gopher sites
// and obtain a valid input stream for these sites
// even when you set wxUSE_PROTOCOL_FTP/HTTP to 0.
// Doing so reduces the code size.
//
// This code is experimental and subject to change.
#define wxUSE_URL_NATIVE 0
// Support for wxVariant class used in several places throughout the library,
// notably in wxDataViewCtrl API.
//
// Default is 1.
//
// Recommended setting: 1 unless you want to reduce the library size as much as
// possible in which case setting this to 0 can gain up to 100KB.
#define wxUSE_VARIANT 1
// Support for wxAny class, the successor for wxVariant.
//
// Default is 1.
//
// Recommended setting: 1 unless you want to reduce the library size by a small amount,
// or your compiler cannot for some reason cope with complexity of templates used.
#define wxUSE_ANY 1
// Support for regular expression matching via wxRegEx class: enable this to
// use POSIX regular expressions in your code. You need to compile regex
// library from src/regex to use it under Windows.
//
// Default is 0
//
// Recommended setting: 1 if your compiler supports it, if it doesn't please
// contribute us a makefile for src/regex for it
#define wxUSE_REGEX 1
// wxSystemOptions class
#define wxUSE_SYSTEM_OPTIONS 1
// wxSound class
#define wxUSE_SOUND 1
// Use wxMediaCtrl
//
// Default is 1.
//
// Recommended setting: 1
#define wxUSE_MEDIACTRL 1
// Use wxWidget's XRC XML-based resource system. Recommended.
//
// Default is 1
//
// Recommended setting: 1 (requires wxUSE_XML)
#define wxUSE_XRC 1
// XML parsing classes. Note that their API will change in the future, so
// using wxXmlDocument and wxXmlNode in your app is not recommended.
//
// Default is the same as wxUSE_XRC, i.e. 1 by default.
//
// Recommended setting: 1 (required by XRC)
#define wxUSE_XML wxUSE_XRC
// Use wxWidget's AUI docking system
//
// Default is 1
//
// Recommended setting: 1
#define wxUSE_AUI 1
// Use wxWidget's Ribbon classes for interfaces
//
// Default is 1
//
// Recommended setting: 1
#define wxUSE_RIBBON 1
// Use wxPropertyGrid.
//
// Default is 1
//
// Recommended setting: 1
#define wxUSE_PROPGRID 1
// Use wxStyledTextCtrl, a wxWidgets implementation of Scintilla.
//
// Default is 1
//
// Recommended setting: 1
#define wxUSE_STC 1
// Use wxWidget's web viewing classes
//
// Default is 1
//
// Recommended setting: 1
#define wxUSE_WEBVIEW 1
// Use the IE wxWebView backend
//
// Default is 1 on MSW
//
// Recommended setting: 1
#ifdef __WXMSW__
#define wxUSE_WEBVIEW_IE 1
#else
#define wxUSE_WEBVIEW_IE 0
#endif
// Use the WebKit wxWebView backend
//
// Default is 1 on GTK and OSX
//
// Recommended setting: 1
#if (defined(__WXGTK__) && !defined(__WXGTK3__)) || defined(__WXOSX__)
#define wxUSE_WEBVIEW_WEBKIT 1
#else
#define wxUSE_WEBVIEW_WEBKIT 0
#endif
// Use the WebKit2 wxWebView backend
//
// Default is 1 on GTK3
//
// Recommended setting: 1
#if defined(__WXGTK3__)
#define wxUSE_WEBVIEW_WEBKIT2 1
#else
#define wxUSE_WEBVIEW_WEBKIT2 0
#endif
// Enable wxGraphicsContext and related classes for a modern 2D drawing API.
//
// Default is 1 except if you're using a compiler without support for GDI+
// under MSW, i.e. gdiplus.h and related headers (MSVC and MinGW >= 4.8 are
// known to have them). For other compilers (e.g. older mingw32) you may need
// to install the headers (and just the headers) yourself. If you do, change
// the setting below manually.
//
// Recommended setting: 1 if supported by the compilation environment
// Notice that we can't use wxCHECK_VISUALC_VERSION() nor wxCHECK_GCC_VERSION()
// here as this file is included from wx/platform.h before they're defined.
#if defined(_MSC_VER) || \
(defined(__MINGW32__) && (__GNUC__ > 4 || __GNUC_MINOR__ >= 8))
#define wxUSE_GRAPHICS_CONTEXT 1
#else
// Disable support for other Windows compilers, enable it if your compiler
// comes with new enough SDK or you installed the headers manually.
//
// Notice that this will be set by configure under non-Windows platforms
// anyhow so the value there is not important.
#define wxUSE_GRAPHICS_CONTEXT 0
#endif
// Enable wxGraphicsContext implementation using Cairo library.
//
// This is not needed under Windows and detected automatically by configure
// under other systems, however you may set this to 1 manually if you installed
// Cairo under Windows yourself and prefer to use it instead the native GDI+
// implementation.
//
// Default is 0
//
// Recommended setting: 0
#define wxUSE_CAIRO 0
// ----------------------------------------------------------------------------
// Individual GUI controls
// ----------------------------------------------------------------------------
// You must set wxUSE_CONTROLS to 1 if you are using any controls at all
// (without it, wxControl class is not compiled)
//
// Default is 1
//
// Recommended setting: 1 (don't change except for very special programs)
#define wxUSE_CONTROLS 1
// Support markup in control labels, i.e. provide wxControl::SetLabelMarkup().
// Currently markup is supported only by a few controls and only some ports but
// their number will increase with time.
//
// Default is 1
//
// Recommended setting: 1 (may be set to 0 if you want to save on code size)
#define wxUSE_MARKUP 1
// wxPopupWindow class is a top level transient window. It is currently used
// to implement wxTipWindow
//
// Default is 1
//
// Recommended setting: 1 (may be set to 0 if you don't wxUSE_TIPWINDOW)
#define wxUSE_POPUPWIN 1
// wxTipWindow allows to implement the custom tooltips, it is used by the
// context help classes. Requires wxUSE_POPUPWIN.
//
// Default is 1
//
// Recommended setting: 1 (may be set to 0)
#define wxUSE_TIPWINDOW 1
// Each of the settings below corresponds to one wxWidgets control. They are
// all switched on by default but may be disabled if you are sure that your
// program (including any standard dialogs it can show!) doesn't need them and
// if you desperately want to save some space. If you use any of these you must
// set wxUSE_CONTROLS as well.
//
// Default is 1
//
// Recommended setting: 1
#define wxUSE_ACTIVITYINDICATOR 1 // wxActivityIndicator
#define wxUSE_ANIMATIONCTRL 1 // wxAnimationCtrl
#define wxUSE_BANNERWINDOW 1 // wxBannerWindow
#define wxUSE_BUTTON 1 // wxButton
#define wxUSE_BMPBUTTON 1 // wxBitmapButton
#define wxUSE_CALENDARCTRL 1 // wxCalendarCtrl
#define wxUSE_CHECKBOX 1 // wxCheckBox
#define wxUSE_CHECKLISTBOX 1 // wxCheckListBox (requires wxUSE_OWNER_DRAWN)
#define wxUSE_CHOICE 1 // wxChoice
#define wxUSE_COLLPANE 1 // wxCollapsiblePane
#define wxUSE_COLOURPICKERCTRL 1 // wxColourPickerCtrl
#define wxUSE_COMBOBOX 1 // wxComboBox
#define wxUSE_COMMANDLINKBUTTON 1 // wxCommandLinkButton
#define wxUSE_DATAVIEWCTRL 1 // wxDataViewCtrl
#define wxUSE_DATEPICKCTRL 1 // wxDatePickerCtrl
#define wxUSE_DIRPICKERCTRL 1 // wxDirPickerCtrl
#define wxUSE_EDITABLELISTBOX 1 // wxEditableListBox
#define wxUSE_FILECTRL 1 // wxFileCtrl
#define wxUSE_FILEPICKERCTRL 1 // wxFilePickerCtrl
#define wxUSE_FONTPICKERCTRL 1 // wxFontPickerCtrl
#define wxUSE_GAUGE 1 // wxGauge
#define wxUSE_HEADERCTRL 1 // wxHeaderCtrl
#define wxUSE_HYPERLINKCTRL 1 // wxHyperlinkCtrl
#define wxUSE_LISTBOX 1 // wxListBox
#define wxUSE_LISTCTRL 1 // wxListCtrl
#define wxUSE_RADIOBOX 1 // wxRadioBox
#define wxUSE_RADIOBTN 1 // wxRadioButton
#define wxUSE_RICHMSGDLG 1 // wxRichMessageDialog
#define wxUSE_SCROLLBAR 1 // wxScrollBar
#define wxUSE_SEARCHCTRL 1 // wxSearchCtrl
#define wxUSE_SLIDER 1 // wxSlider
#define wxUSE_SPINBTN 1 // wxSpinButton
#define wxUSE_SPINCTRL 1 // wxSpinCtrl
#define wxUSE_STATBOX 1 // wxStaticBox
#define wxUSE_STATLINE 1 // wxStaticLine
#define wxUSE_STATTEXT 1 // wxStaticText
#define wxUSE_STATBMP 1 // wxStaticBitmap
#define wxUSE_TEXTCTRL 1 // wxTextCtrl
#define wxUSE_TIMEPICKCTRL 1 // wxTimePickerCtrl
#define wxUSE_TOGGLEBTN 1 // requires wxButton
#define wxUSE_TREECTRL 1 // wxTreeCtrl
#define wxUSE_TREELISTCTRL 1 // wxTreeListCtrl
// Use a status bar class? Depending on the value of wxUSE_NATIVE_STATUSBAR
// below either wxStatusBar95 or a generic wxStatusBar will be used.
//
// Default is 1
//
// Recommended setting: 1
#define wxUSE_STATUSBAR 1
// Two status bar implementations are available under Win32: the generic one
// or the wrapper around native control. For native look and feel the native
// version should be used.
//
// Default is 1 for the platforms where native status bar is supported.
//
// Recommended setting: 1 (there is no advantage in using the generic one)
#define wxUSE_NATIVE_STATUSBAR 1
// wxToolBar related settings: if wxUSE_TOOLBAR is 0, don't compile any toolbar
// classes at all. Otherwise, use the native toolbar class unless
// wxUSE_TOOLBAR_NATIVE is 0.
//
// Default is 1 for all settings.
//
// Recommended setting: 1 for wxUSE_TOOLBAR and wxUSE_TOOLBAR_NATIVE.
#define wxUSE_TOOLBAR 1
#define wxUSE_TOOLBAR_NATIVE 1
// wxNotebook is a control with several "tabs" located on one of its sides. It
// may be used to logically organise the data presented to the user instead of
// putting everything in one huge dialog. It replaces wxTabControl and related
// classes of wxWin 1.6x.
//
// Default is 1.
//
// Recommended setting: 1
#define wxUSE_NOTEBOOK 1
// wxListbook control is similar to wxNotebook but uses wxListCtrl instead of
// the tabs
//
// Default is 1.
//
// Recommended setting: 1
#define wxUSE_LISTBOOK 1
// wxChoicebook control is similar to wxNotebook but uses wxChoice instead of
// the tabs
//
// Default is 1.
//
// Recommended setting: 1
#define wxUSE_CHOICEBOOK 1
// wxTreebook control is similar to wxNotebook but uses wxTreeCtrl instead of
// the tabs
//
// Default is 1.
//
// Recommended setting: 1
#define wxUSE_TREEBOOK 1
// wxToolbook control is similar to wxNotebook but uses wxToolBar instead of
// tabs
//
// Default is 1.
//
// Recommended setting: 1
#define wxUSE_TOOLBOOK 1
// wxTaskBarIcon is a small notification icon shown in the system toolbar or
// dock.
//
// Default is 1.
//
// Recommended setting: 1 (but can be set to 0 if you don't need it)
#define wxUSE_TASKBARICON 1
// wxGrid class
//
// Default is 1, set to 0 to cut down compilation time and binaries size if you
// don't use it.
//
// Recommended setting: 1
//
#define wxUSE_GRID 1
// wxMiniFrame class: a frame with narrow title bar
//
// Default is 1.
//
// Recommended setting: 1 (it doesn't cost almost anything)
#define wxUSE_MINIFRAME 1
// wxComboCtrl and related classes: combobox with custom popup window and
// not necessarily a listbox.
//
// Default is 1.
//
// Recommended setting: 1 but can be safely set to 0 except for wxUniv where it
// it used by wxComboBox
#define wxUSE_COMBOCTRL 1
// wxOwnerDrawnComboBox is a custom combobox allowing to paint the combobox
// items.
//
// Default is 1.
//
// Recommended setting: 1 but can be safely set to 0, except where it is
// needed as a base class for generic wxBitmapComboBox.
#define wxUSE_ODCOMBOBOX 1
// wxBitmapComboBox is a combobox that can have images in front of text items.
//
// Default is 1.
//
// Recommended setting: 1 but can be safely set to 0
#define wxUSE_BITMAPCOMBOBOX 1
// wxRearrangeCtrl is a wxCheckListBox with two buttons allowing to move items
// up and down in it. It is also used as part of wxRearrangeDialog.
//
// Default is 1.
//
// Recommended setting: 1 but can be safely set to 0 (currently used only by
// wxHeaderCtrl)
#define wxUSE_REARRANGECTRL 1
// wxAddRemoveCtrl is a composite control containing a control showing some
// items (e.g. wxListBox, wxListCtrl, wxTreeCtrl, wxDataViewCtrl, ...) and "+"/
// "-" buttons allowing to add and remove items to/from the control.
//
// Default is 1.
//
// Recommended setting: 1 but can be safely set to 0 if you don't need it (not
// used by the library itself).
#define wxUSE_ADDREMOVECTRL 1
// ----------------------------------------------------------------------------
// Miscellaneous GUI stuff
// ----------------------------------------------------------------------------
// wxAcceleratorTable/Entry classes and support for them in wxMenu(Bar)
#define wxUSE_ACCEL 1
// Use the standard art provider. The icons returned by this provider are
// embedded into the library as XPMs so disabling it reduces the library size
// somewhat but this should only be done if you use your own custom art
// provider returning the icons or never use any icons not provided by the
// native art provider (which might not be implemented at all for some
// platforms) or by the Tango icons provider (if it's not itself disabled
// below).
//
// Default is 1.
//
// Recommended setting: 1 unless you use your own custom art provider.
#define wxUSE_ARTPROVIDER_STD 1
// Use art provider providing Tango icons: this art provider has higher quality
// icons than the default ones using smaller size XPM icons without
// transparency but the embedded PNG icons add to the library size.
//
// Default is 1 under non-GTK ports. Under wxGTK the native art provider using
// the GTK+ stock icons replaces it so it is normally not necessary.
//
// Recommended setting: 1 but can be turned off to reduce the library size.
#define wxUSE_ARTPROVIDER_TANGO 1
// Hotkey support (currently Windows only)
#define wxUSE_HOTKEY 1
// Use wxCaret: a class implementing a "cursor" in a text control (called caret
// under Windows).
//
// Default is 1.
//
// Recommended setting: 1 (can be safely set to 0, not used by the library)
#define wxUSE_CARET 1
// Use wxDisplay class: it allows enumerating all displays on a system and
// their geometries as well as finding the display on which the given point or
// window lies.
//
// Default is 1.
//
// Recommended setting: 1 if you need it, can be safely set to 0 otherwise
#define wxUSE_DISPLAY 1
// Miscellaneous geometry code: needed for Canvas library
#define wxUSE_GEOMETRY 1
// Use wxImageList. This class is needed by wxNotebook, wxTreeCtrl and
// wxListCtrl.
//
// Default is 1.
//
// Recommended setting: 1 (set it to 0 if you don't use any of the controls
// enumerated above, then this class is mostly useless too)
#define wxUSE_IMAGLIST 1
// Use wxInfoBar class.
//
// Default is 1.
//
// Recommended setting: 1 (but can be disabled without problems as nothing
// depends on it)
#define wxUSE_INFOBAR 1
// Use wxMenu, wxMenuBar, wxMenuItem.
//
// Default is 1.
//
// Recommended setting: 1 (can't be disabled under MSW)
#define wxUSE_MENUS 1
// Use wxNotificationMessage.
//
// wxNotificationMessage allows to show non-intrusive messages to the user
// using balloons, banners, popups or whatever is the appropriate method for
// the current platform.
//
// Default is 1.
//
// Recommended setting: 1
#define wxUSE_NOTIFICATION_MESSAGE 1
// wxPreferencesEditor provides a common API for different ways of presenting
// the standard "Preferences" or "Properties" dialog under different platforms
// (e.g. some use modal dialogs, some use modeless ones; some apply the changes
// immediately while others require an explicit "Apply" button).
//
// Default is 1.
//
// Recommended setting: 1 (but can be safely disabled if you don't use it)
#define wxUSE_PREFERENCES_EDITOR 1
// wxFont::AddPrivateFont() allows to use fonts not installed on the system by
// loading them from font files during run-time.
//
// Default is 1 except under Unix where it will be turned off by configure if
// the required libraries are not available or not new enough.
//
// Recommended setting: 1 (but can be safely disabled if you don't use it and
// want to avoid extra dependencies under Linux, for example).
#define wxUSE_PRIVATE_FONTS 1
// wxRichToolTip is a customizable tooltip class which has more functionality
// than the stock (but native, unlike this class) wxToolTip.
//
// Default is 1.
//
// Recommended setting: 1 (but can be safely set to 0 if you don't need it)
#define wxUSE_RICHTOOLTIP 1
// Use wxSashWindow class.
//
// Default is 1.
//
// Recommended setting: 1
#define wxUSE_SASH 1
// Use wxSplitterWindow class.
//
// Default is 1.
//
// Recommended setting: 1
#define wxUSE_SPLITTER 1
// Use wxToolTip and wxWindow::Set/GetToolTip() methods.
//
// Default is 1.
//
// Recommended setting: 1
#define wxUSE_TOOLTIPS 1
// wxValidator class and related methods
#define wxUSE_VALIDATORS 1
// Use reference counted ID management: this means that wxWidgets will track
// the automatically allocated ids (those used when you use wxID_ANY when
// creating a window, menu or toolbar item &c) instead of just supposing that
// the program never runs out of them. This is mostly useful only under wxMSW
// where the total ids range is limited to SHRT_MIN..SHRT_MAX and where
// long-running programs can run into problems with ids reuse without this. On
// the other platforms, where the ids have the full int range, this shouldn't
// be necessary.
#ifdef __WXMSW__
#define wxUSE_AUTOID_MANAGEMENT 1
#else
#define wxUSE_AUTOID_MANAGEMENT 0
#endif
// ----------------------------------------------------------------------------
// common dialogs
// ----------------------------------------------------------------------------
// On rare occasions (e.g. using DJGPP) may want to omit common dialogs (e.g.
// file selector, printer dialog). Switching this off also switches off the
// printing architecture and interactive wxPrinterDC.
//
// Default is 1
//
// Recommended setting: 1 (unless it really doesn't work)
#define wxUSE_COMMON_DIALOGS 1
// wxBusyInfo displays window with message when app is busy. Works in same way
// as wxBusyCursor
#define wxUSE_BUSYINFO 1
// Use single/multiple choice dialogs.
//
// Default is 1
//
// Recommended setting: 1 (used in the library itself)
#define wxUSE_CHOICEDLG 1
// Use colour picker dialog
//
// Default is 1
//
// Recommended setting: 1
#define wxUSE_COLOURDLG 1
// wxDirDlg class for getting a directory name from user
#define wxUSE_DIRDLG 1
// TODO: setting to choose the generic or native one
// Use file open/save dialogs.
//
// Default is 1
//
// Recommended setting: 1 (used in many places in the library itself)
#define wxUSE_FILEDLG 1
// Use find/replace dialogs.
//
// Default is 1
//
// Recommended setting: 1 (but may be safely set to 0)
#define wxUSE_FINDREPLDLG 1
// Use font picker dialog
//
// Default is 1
//
// Recommended setting: 1 (used in the library itself)
#define wxUSE_FONTDLG 1
// Use wxMessageDialog and wxMessageBox.
//
// Default is 1
//
// Recommended setting: 1 (used in the library itself)
#define wxUSE_MSGDLG 1
// progress dialog class for lengthy operations
#define wxUSE_PROGRESSDLG 1
// Set to 0 to disable the use of the native progress dialog (currently only
// available under MSW and suffering from some bugs there, hence this option).
#define wxUSE_NATIVE_PROGRESSDLG 1
// support for startup tips (wxShowTip &c)
#define wxUSE_STARTUP_TIPS 1
// text entry dialog and wxGetTextFromUser function
#define wxUSE_TEXTDLG 1
// number entry dialog
#define wxUSE_NUMBERDLG 1
// splash screen class
#define wxUSE_SPLASH 1
// wizards
#define wxUSE_WIZARDDLG 1
// Compile in wxAboutBox() function showing the standard "About" dialog.
//
// Default is 1
//
// Recommended setting: 1 but can be set to 0 to save some space if you don't
// use this function
#define wxUSE_ABOUTDLG 1
// wxFileHistory class
//
// Default is 1
//
// Recommended setting: 1
#define wxUSE_FILE_HISTORY 1
// ----------------------------------------------------------------------------
// Metafiles support
// ----------------------------------------------------------------------------
// Windows supports the graphics format known as metafile which, though not
// portable, is widely used under Windows and so is supported by wxWidgets
// (under Windows only, of course). Both the so-called "Window MetaFiles" or
// WMFs, and "Enhanced MetaFiles" or EMFs are supported in wxWin and, by
// default, EMFs will be used. This may be changed by setting
// wxUSE_WIN_METAFILES_ALWAYS to 1 and/or setting wxUSE_ENH_METAFILE to 0.
// You may also set wxUSE_METAFILE to 0 to not compile in any metafile
// related classes at all.
//
// Default is 1 for wxUSE_ENH_METAFILE and 0 for wxUSE_WIN_METAFILES_ALWAYS.
//
// Recommended setting: default or 0 for everything for portable programs.
#define wxUSE_METAFILE 1
#define wxUSE_ENH_METAFILE 1
#define wxUSE_WIN_METAFILES_ALWAYS 0
// ----------------------------------------------------------------------------
// Big GUI components
// ----------------------------------------------------------------------------
// Set to 0 to disable MDI support.
//
// Requires wxUSE_NOTEBOOK under platforms other than MSW.
//
// Default is 1.
//
// Recommended setting: 1, can be safely set to 0.
#define wxUSE_MDI 1
// Set to 0 to disable document/view architecture
#define wxUSE_DOC_VIEW_ARCHITECTURE 1
// Set to 0 to disable MDI document/view architecture
//
// Requires wxUSE_MDI && wxUSE_DOC_VIEW_ARCHITECTURE
#define wxUSE_MDI_ARCHITECTURE 1
// Set to 0 to disable print/preview architecture code
#define wxUSE_PRINTING_ARCHITECTURE 1
// wxHTML sublibrary allows to display HTML in wxWindow programs and much,
// much more.
//
// Default is 1.
//
// Recommended setting: 1 (wxHTML is great!), set to 0 if you want compile a
// smaller library.
#define wxUSE_HTML 1
// Setting wxUSE_GLCANVAS to 1 enables OpenGL support. You need to have OpenGL
// headers and libraries to be able to compile the library with wxUSE_GLCANVAS
// set to 1 and, under Windows, also to add opengl32.lib and glu32.lib to the
// list of libraries used to link your application (although this is done
// implicitly for Microsoft Visual C++ users).
//
// Default is 1.
//
// Recommended setting: 1 if you intend to use OpenGL, can be safely set to 0
// otherwise.
#define wxUSE_GLCANVAS 1
// wxRichTextCtrl allows editing of styled text.
//
// Default is 1.
//
// Recommended setting: 1, set to 0 if you want compile a
// smaller library.
#define wxUSE_RICHTEXT 1
// ----------------------------------------------------------------------------
// Data transfer
// ----------------------------------------------------------------------------
// Use wxClipboard class for clipboard copy/paste.
//
// Default is 1.
//
// Recommended setting: 1
#define wxUSE_CLIPBOARD 1
// Use wxDataObject and related classes. Needed for clipboard and OLE drag and
// drop
//
// Default is 1.
//
// Recommended setting: 1
#define wxUSE_DATAOBJ 1
// Use wxDropTarget and wxDropSource classes for drag and drop (this is
// different from "built in" drag and drop in wxTreeCtrl which is always
// available). Requires wxUSE_DATAOBJ.
//
// Default is 1.
//
// Recommended setting: 1
#define wxUSE_DRAG_AND_DROP 1
// Use wxAccessible for enhanced and customisable accessibility.
// Depends on wxUSE_OLE on MSW.
//
// Default is 1 on MSW, 0 elsewhere.
//
// Recommended setting (at present): 1 (MSW-only)
#ifdef __WXMSW__
#define wxUSE_ACCESSIBILITY 1
#else
#define wxUSE_ACCESSIBILITY 0
#endif
// ----------------------------------------------------------------------------
// miscellaneous settings
// ----------------------------------------------------------------------------
// wxSingleInstanceChecker class allows to verify at startup if another program
// instance is running.
//
// Default is 1
//
// Recommended setting: 1 (the class is tiny, disabling it won't save much
// space)
#define wxUSE_SNGLINST_CHECKER 1
#define wxUSE_DRAGIMAGE 1
#define wxUSE_IPC 1
// 0 for no interprocess comms
#define wxUSE_HELP 1
// 0 for no help facility
// Should we use MS HTML help for wxHelpController? If disabled, neither
// wxCHMHelpController nor wxBestHelpController are available.
//
// Default is 1 under MSW, 0 is always used for the other platforms.
//
// Recommended setting: 1, only set to 0 if you have trouble compiling
// wxCHMHelpController (could be a problem with really ancient compilers)
#define wxUSE_MS_HTML_HELP 1
// Use wxHTML-based help controller?
#define wxUSE_WXHTML_HELP 1
#define wxUSE_CONSTRAINTS 1
// 0 for no window layout constraint system
#define wxUSE_SPLINES 1
// 0 for no splines
#define wxUSE_MOUSEWHEEL 1
// Include mouse wheel support
// Compile wxUIActionSimulator class?
#define wxUSE_UIACTIONSIMULATOR 1
// ----------------------------------------------------------------------------
// wxDC classes for various output formats
// ----------------------------------------------------------------------------
// Set to 1 for PostScript device context.
#define wxUSE_POSTSCRIPT 0
// Set to 1 to use font metric files in GetTextExtent
#define wxUSE_AFM_FOR_POSTSCRIPT 1
// Set to 1 to compile in support for wxSVGFileDC, a wxDC subclass which allows
// to create files in SVG (Scalable Vector Graphics) format.
#define wxUSE_SVG 1
// Should wxDC provide SetTransformMatrix() and related methods?
//
// Default is 1 but can be set to 0 if this functionality is not used. Notice
// that currently wxMSW, wxGTK3 support this for wxDC and all platforms support
// this for wxGCDC so setting this to 0 doesn't change much if neither of these
// is used (although it will still save a few bytes probably).
//
// Recommended setting: 1.
#define wxUSE_DC_TRANSFORM_MATRIX 1
// ----------------------------------------------------------------------------
// image format support
// ----------------------------------------------------------------------------
// wxImage supports many different image formats which can be configured at
// compile-time. BMP is always supported, others are optional and can be safely
// disabled if you don't plan to use images in such format sometimes saving
// substantial amount of code in the final library.
//
// Some formats require an extra library which is included in wxWin sources
// which is mentioned if it is the case.
// Set to 1 for wxImage support (recommended).
#define wxUSE_IMAGE 1
// Set to 1 for PNG format support (requires libpng). Also requires wxUSE_ZLIB.
#define wxUSE_LIBPNG 1
// Set to 1 for JPEG format support (requires libjpeg)
#define wxUSE_LIBJPEG 1
// Set to 1 for TIFF format support (requires libtiff)
#define wxUSE_LIBTIFF 1
// Set to 1 for TGA format support (loading only)
#define wxUSE_TGA 1
// Set to 1 for GIF format support
#define wxUSE_GIF 1
// Set to 1 for PNM format support
#define wxUSE_PNM 1
// Set to 1 for PCX format support
#define wxUSE_PCX 1
// Set to 1 for IFF format support (Amiga format)
#define wxUSE_IFF 0
// Set to 1 for XPM format support
#define wxUSE_XPM 1
// Set to 1 for MS Icons and Cursors format support
#define wxUSE_ICO_CUR 1
// Set to 1 to compile in wxPalette class
#define wxUSE_PALETTE 1
// ----------------------------------------------------------------------------
// wxUniversal-only options
// ----------------------------------------------------------------------------
// Set to 1 to enable compilation of all themes, this is the default
#define wxUSE_ALL_THEMES 1
// Set to 1 to enable the compilation of individual theme if wxUSE_ALL_THEMES
// is unset, if it is set these options are not used; notice that metal theme
// uses Win32 one
#define wxUSE_THEME_GTK 0
#define wxUSE_THEME_METAL 0
#define wxUSE_THEME_MONO 0
#define wxUSE_THEME_WIN32 0
| h |
rticonnextdds-usecases | data/projects/rticonnextdds-usecases/VehicleTracking/ExampleCode/thirdparty/wxWidgets-3.1.2/Linux/include/wx/zstream.h | /////////////////////////////////////////////////////////////////////////////
// Name: wx/zstream.h
// Purpose: Memory stream classes
// Author: Guilhem Lavaux
// Modified by: Mike Wetherell
// Created: 11/07/98
// Copyright: (c) Guilhem Lavaux
// Licence: wxWindows licence
/////////////////////////////////////////////////////////////////////////////
#ifndef _WX_WXZSTREAM_H__
#define _WX_WXZSTREAM_H__
#include "wx/defs.h"
#if wxUSE_ZLIB && wxUSE_STREAMS
#include "wx/stream.h"
#include "wx/versioninfo.h"
// Compression level
enum wxZlibCompressionLevels {
wxZ_DEFAULT_COMPRESSION = -1,
wxZ_NO_COMPRESSION = 0,
wxZ_BEST_SPEED = 1,
wxZ_BEST_COMPRESSION = 9
};
// Flags
enum wxZLibFlags {
wxZLIB_NO_HEADER = 0, // raw deflate stream, no header or checksum
wxZLIB_ZLIB = 1, // zlib header and checksum
wxZLIB_GZIP = 2, // gzip header and checksum, requires zlib 1.2.1+
wxZLIB_AUTO = 3 // autodetect header zlib or gzip
};
class WXDLLIMPEXP_BASE wxZlibInputStream: public wxFilterInputStream {
public:
wxZlibInputStream(wxInputStream& stream, int flags = wxZLIB_AUTO);
wxZlibInputStream(wxInputStream *stream, int flags = wxZLIB_AUTO);
virtual ~wxZlibInputStream();
char Peek() wxOVERRIDE { return wxInputStream::Peek(); }
wxFileOffset GetLength() const wxOVERRIDE { return wxInputStream::GetLength(); }
static bool CanHandleGZip();
bool SetDictionary(const char *data, size_t datalen);
bool SetDictionary(const wxMemoryBuffer &buf);
protected:
size_t OnSysRead(void *buffer, size_t size) wxOVERRIDE;
wxFileOffset OnSysTell() const wxOVERRIDE { return m_pos; }
private:
void Init(int flags);
protected:
size_t m_z_size;
unsigned char *m_z_buffer;
struct z_stream_s *m_inflate;
wxFileOffset m_pos;
wxDECLARE_NO_COPY_CLASS(wxZlibInputStream);
};
class WXDLLIMPEXP_BASE wxZlibOutputStream: public wxFilterOutputStream {
public:
wxZlibOutputStream(wxOutputStream& stream, int level = -1, int flags = wxZLIB_ZLIB);
wxZlibOutputStream(wxOutputStream *stream, int level = -1, int flags = wxZLIB_ZLIB);
virtual ~wxZlibOutputStream() { Close(); }
void Sync() wxOVERRIDE { DoFlush(false); }
bool Close() wxOVERRIDE;
wxFileOffset GetLength() const wxOVERRIDE { return m_pos; }
static bool CanHandleGZip();
bool SetDictionary(const char *data, size_t datalen);
bool SetDictionary(const wxMemoryBuffer &buf);
protected:
size_t OnSysWrite(const void *buffer, size_t size) wxOVERRIDE;
wxFileOffset OnSysTell() const wxOVERRIDE { return m_pos; }
virtual void DoFlush(bool final);
private:
void Init(int level, int flags);
protected:
size_t m_z_size;
unsigned char *m_z_buffer;
struct z_stream_s *m_deflate;
wxFileOffset m_pos;
wxDECLARE_NO_COPY_CLASS(wxZlibOutputStream);
};
class WXDLLIMPEXP_BASE wxZlibClassFactory: public wxFilterClassFactory
{
public:
wxZlibClassFactory();
wxFilterInputStream *NewStream(wxInputStream& stream) const wxOVERRIDE
{ return new wxZlibInputStream(stream); }
wxFilterOutputStream *NewStream(wxOutputStream& stream) const wxOVERRIDE
{ return new wxZlibOutputStream(stream, -1); }
wxFilterInputStream *NewStream(wxInputStream *stream) const wxOVERRIDE
{ return new wxZlibInputStream(stream); }
wxFilterOutputStream *NewStream(wxOutputStream *stream) const wxOVERRIDE
{ return new wxZlibOutputStream(stream, -1); }
const wxChar * const *GetProtocols(wxStreamProtocolType type
= wxSTREAM_PROTOCOL) const wxOVERRIDE;
private:
wxDECLARE_DYNAMIC_CLASS(wxZlibClassFactory);
};
class WXDLLIMPEXP_BASE wxGzipClassFactory: public wxFilterClassFactory
{
public:
wxGzipClassFactory();
wxFilterInputStream *NewStream(wxInputStream& stream) const wxOVERRIDE
{ return new wxZlibInputStream(stream); }
wxFilterOutputStream *NewStream(wxOutputStream& stream) const wxOVERRIDE
{ return new wxZlibOutputStream(stream, -1); }
wxFilterInputStream *NewStream(wxInputStream *stream) const wxOVERRIDE
{ return new wxZlibInputStream(stream); }
wxFilterOutputStream *NewStream(wxOutputStream *stream) const wxOVERRIDE
{ return new wxZlibOutputStream(stream, -1); }
const wxChar * const *GetProtocols(wxStreamProtocolType type
= wxSTREAM_PROTOCOL) const wxOVERRIDE;
private:
wxDECLARE_DYNAMIC_CLASS(wxGzipClassFactory);
};
WXDLLIMPEXP_BASE wxVersionInfo wxGetZlibVersionInfo();
#endif
// wxUSE_ZLIB && wxUSE_STREAMS
#endif
// _WX_WXZSTREAM_H__
| h |
rticonnextdds-usecases | data/projects/rticonnextdds-usecases/VehicleTracking/ExampleCode/thirdparty/wxWidgets-3.1.2/Linux/include/wx/version.h | /*
* Name: wx/version.h
* Purpose: wxWidgets version numbers
* Author: Julian Smart
* Modified by: Ryan Norton (Converted to C)
* Created: 29/01/98
* Copyright: (c) 1998 Julian Smart
* Licence: wxWindows licence
*/
/* THIS IS A C FILE, DON'T USE C++ FEATURES (IN PARTICULAR COMMENTS) IN IT */
#ifndef _WX_VERSION_H_
#define _WX_VERSION_H_
#include "wx/cpp.h" /* for wxSTRINGIZE */
/* the constants below must be changed with each new version */
/* ---------------------------------------------------------------------------- */
/*
Don't forget to update WX_CURRENT, WX_REVISION and WX_AGE in
build/bakefiles/version.bkl and regenerate the makefiles when you change
this!
*/
/* NB: this file is parsed by automatic tools so don't change its format! */
#define wxMAJOR_VERSION 3
#define wxMINOR_VERSION 1
#define wxRELEASE_NUMBER 2
#define wxSUBRELEASE_NUMBER 0
#define wxVERSION_STRING wxT("wxWidgets 3.1.2")
/* nothing to update below this line when updating the version */
/* ---------------------------------------------------------------------------- */
/* Users can pre-define wxABI_VERSION to a lower value in their
* makefile/project settings to compile code that will be binary compatible
* with earlier versions of the ABI within the same minor version (between
* minor versions binary compatibility breaks anyway). The default is the
* version of wxWidgets being used. A single number with two decimal digits
* for each component, e.g. 20601 for 2.6.1 */
#ifndef wxABI_VERSION
#define wxABI_VERSION ( wxMAJOR_VERSION * 10000 + wxMINOR_VERSION * 100 + 99 )
#endif
/* helpers for wxVERSION_NUM_XXX */
#define wxMAKE_VERSION_STRING(x, y, z) \
wxSTRINGIZE(x) wxSTRINGIZE(y) wxSTRINGIZE(z)
#define wxMAKE_VERSION_DOT_STRING(x, y, z) \
wxSTRINGIZE(x) "." wxSTRINGIZE(y) "." wxSTRINGIZE(z)
#define wxMAKE_VERSION_STRING_T(x, y, z) \
wxSTRINGIZE_T(x) wxSTRINGIZE_T(y) wxSTRINGIZE_T(z)
#define wxMAKE_VERSION_DOT_STRING_T(x, y, z) \
wxSTRINGIZE_T(x) wxT(".") wxSTRINGIZE_T(y) wxT(".") wxSTRINGIZE_T(z)
/* these are used by src/msw/version.rc and should always be ASCII, not Unicode */
#define wxVERSION_NUM_STRING \
wxMAKE_VERSION_STRING(wxMAJOR_VERSION, wxMINOR_VERSION, wxRELEASE_NUMBER)
#define wxVERSION_NUM_DOT_STRING \
wxMAKE_VERSION_DOT_STRING(wxMAJOR_VERSION, wxMINOR_VERSION, wxRELEASE_NUMBER)
/* those are Unicode-friendly */
#define wxVERSION_NUM_STRING_T \
wxMAKE_VERSION_STRING_T(wxMAJOR_VERSION, wxMINOR_VERSION, wxRELEASE_NUMBER)
#define wxVERSION_NUM_DOT_STRING_T \
wxMAKE_VERSION_DOT_STRING_T(wxMAJOR_VERSION, wxMINOR_VERSION, wxRELEASE_NUMBER)
/* some more defines, not really sure if they're [still] useful */
#define wxVERSION_NUMBER ( (wxMAJOR_VERSION * 1000) + (wxMINOR_VERSION * 100) + wxRELEASE_NUMBER )
#define wxBETA_NUMBER 0
#define wxVERSION_FLOAT ( wxMAJOR_VERSION + (wxMINOR_VERSION/10.0) + (wxRELEASE_NUMBER/100.0) + (wxBETA_NUMBER/10000.0) )
/* check if the current version is at least major.minor.release */
#define wxCHECK_VERSION(major,minor,release) \
(wxMAJOR_VERSION > (major) || \
(wxMAJOR_VERSION == (major) && wxMINOR_VERSION > (minor)) || \
(wxMAJOR_VERSION == (major) && wxMINOR_VERSION == (minor) && wxRELEASE_NUMBER >= (release)))
/* the same but check the subrelease also */
#define wxCHECK_VERSION_FULL(major,minor,release,subrel) \
(wxCHECK_VERSION(major, minor, release) && \
((major) != wxMAJOR_VERSION || \
(minor) != wxMINOR_VERSION || \
(release) != wxRELEASE_NUMBER || \
(subrel) <= wxSUBRELEASE_NUMBER))
#endif /* _WX_VERSION_H_ */
| h |
rticonnextdds-usecases | data/projects/rticonnextdds-usecases/VehicleTracking/ExampleCode/thirdparty/wxWidgets-3.1.2/Linux/include/wx/imagpng.h | /////////////////////////////////////////////////////////////////////////////
// Name: wx/imagpng.h
// Purpose: wxImage PNG handler
// Author: Robert Roebling
// Copyright: (c) Robert Roebling
// Licence: wxWindows licence
/////////////////////////////////////////////////////////////////////////////
#ifndef _WX_IMAGPNG_H_
#define _WX_IMAGPNG_H_
#include "wx/defs.h"
//-----------------------------------------------------------------------------
// wxPNGHandler
//-----------------------------------------------------------------------------
#if wxUSE_LIBPNG
#include "wx/image.h"
#include "wx/versioninfo.h"
#define wxIMAGE_OPTION_PNG_FORMAT wxT("PngFormat")
#define wxIMAGE_OPTION_PNG_BITDEPTH wxT("PngBitDepth")
#define wxIMAGE_OPTION_PNG_FILTER wxT("PngF")
#define wxIMAGE_OPTION_PNG_COMPRESSION_LEVEL wxT("PngZL")
#define wxIMAGE_OPTION_PNG_COMPRESSION_MEM_LEVEL wxT("PngZM")
#define wxIMAGE_OPTION_PNG_COMPRESSION_STRATEGY wxT("PngZS")
#define wxIMAGE_OPTION_PNG_COMPRESSION_BUFFER_SIZE wxT("PngZB")
enum
{
wxPNG_TYPE_COLOUR = 0,
wxPNG_TYPE_GREY = 2,
wxPNG_TYPE_GREY_RED = 3,
wxPNG_TYPE_PALETTE = 4
};
class WXDLLIMPEXP_CORE wxPNGHandler: public wxImageHandler
{
public:
inline wxPNGHandler()
{
m_name = wxT("PNG file");
m_extension = wxT("png");
m_type = wxBITMAP_TYPE_PNG;
m_mime = wxT("image/png");
}
static wxVersionInfo GetLibraryVersionInfo();
#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(wxPNGHandler);
};
#endif
// wxUSE_LIBPNG
#endif
// _WX_IMAGPNG_H_
| h |
rticonnextdds-usecases | data/projects/rticonnextdds-usecases/VehicleTracking/ExampleCode/thirdparty/wxWidgets-3.1.2/Linux/include/wx/headerctrl.h | ///////////////////////////////////////////////////////////////////////////////
// Name: wx/headerctrl.h
// Purpose: wxHeaderCtrlBase class: interface of wxHeaderCtrl
// Author: Vadim Zeitlin
// Created: 2008-12-01
// Copyright: (c) 2008 Vadim Zeitlin <[email protected]>
// Licence: wxWindows licence
///////////////////////////////////////////////////////////////////////////////
#ifndef _WX_HEADERCTRL_H_
#define _WX_HEADERCTRL_H_
#include "wx/control.h"
#if wxUSE_HEADERCTRL
#include "wx/dynarray.h"
#include "wx/vector.h"
#include "wx/headercol.h"
// notice that the classes in this header are defined in the core library even
// although currently they're only used by wxGrid which is in wxAdv because we
// plan to use it in wxListCtrl which is in core too in the future
class WXDLLIMPEXP_FWD_CORE wxHeaderCtrlEvent;
// ----------------------------------------------------------------------------
// constants
// ----------------------------------------------------------------------------
enum
{
// allow column drag and drop
wxHD_ALLOW_REORDER = 0x0001,
// allow hiding (and showing back) the columns using the menu shown by
// right clicking the header
wxHD_ALLOW_HIDE = 0x0002,
// force putting column images on right
wxHD_BITMAP_ON_RIGHT = 0x0004,
// style used by default when creating the control
wxHD_DEFAULT_STYLE = wxHD_ALLOW_REORDER
};
extern WXDLLIMPEXP_DATA_CORE(const char) wxHeaderCtrlNameStr[];
// ----------------------------------------------------------------------------
// wxHeaderCtrlBase defines the interface of a header control
// ----------------------------------------------------------------------------
class WXDLLIMPEXP_CORE wxHeaderCtrlBase : public wxControl
{
public:
/*
Derived classes must provide default ctor as well as a ctor and
Create() function with the following signatures:
wxHeaderCtrl(wxWindow *parent,
wxWindowID winid = wxID_ANY,
const wxPoint& pos = wxDefaultPosition,
const wxSize& size = wxDefaultSize,
long style = wxHD_DEFAULT_STYLE,
const wxString& name = wxHeaderCtrlNameStr);
bool Create(wxWindow *parent,
wxWindowID winid = wxID_ANY,
const wxPoint& pos = wxDefaultPosition,
const wxSize& size = wxDefaultSize,
long style = wxHD_DEFAULT_STYLE,
const wxString& name = wxHeaderCtrlNameStr);
*/
// column-related methods
// ----------------------
// set the number of columns in the control
//
// this also calls UpdateColumn() for all columns
void SetColumnCount(unsigned int count);
// return the number of columns in the control as set by SetColumnCount()
unsigned int GetColumnCount() const { return DoGetCount(); }
// return whether the control has any columns
bool IsEmpty() const { return DoGetCount() == 0; }
// update the column with the given index
void UpdateColumn(unsigned int idx)
{
wxCHECK_RET( idx < GetColumnCount(), "invalid column index" );
DoUpdate(idx);
}
// columns order
// -------------
// set the columns order: the array defines the column index which appears
// the given position, it must have GetColumnCount() elements and contain
// all indices exactly once
void SetColumnsOrder(const wxArrayInt& order);
wxArrayInt GetColumnsOrder() const;
// get the index of the column at the given display position
unsigned int GetColumnAt(unsigned int pos) const;
// get the position at which this column is currently displayed
unsigned int GetColumnPos(unsigned int idx) const;
// reset the columns order to the natural one
void ResetColumnsOrder();
// helper function used by the generic version of this control and also
// wxGrid: reshuffles the array of column indices indexed by positions
// (i.e. using the same convention as for SetColumnsOrder()) so that the
// column with the given index is found at the specified position
static void MoveColumnInOrderArray(wxArrayInt& order,
unsigned int idx,
unsigned int pos);
// UI helpers
// ----------
#if wxUSE_MENUS
// show the popup menu containing all columns with check marks for the ones
// which are currently shown and return true if something was done using it
// (in this case UpdateColumnVisibility() will have been called) or false
// if the menu was cancelled
//
// this is called from the default right click handler for the controls
// with wxHD_ALLOW_HIDE style
bool ShowColumnsMenu(const wxPoint& pt, const wxString& title = wxString());
// append the entries for all our columns to the given menu, with the
// currently visible columns being checked
//
// this is used by ShowColumnsMenu() but can also be used if you use your
// own custom columns menu but nevertheless want to show all the columns in
// it
//
// the ids of the items corresponding to the columns are consecutive and
// start from idColumnsBase
void AddColumnsItems(wxMenu& menu, int idColumnsBase = 0);
#endif // wxUSE_MENUS
// show the columns customization dialog and return true if something was
// changed using it (in which case UpdateColumnVisibility() and/or
// UpdateColumnsOrder() will have been called)
//
// this is called by the control itself from ShowColumnsMenu() (which in
// turn is only called by the control if wxHD_ALLOW_HIDE style was
// specified) and if the control has wxHD_ALLOW_REORDER style as well
bool ShowCustomizeDialog();
// compute column title width
int GetColumnTitleWidth(const wxHeaderColumn& col);
// implementation only from now on
// -------------------------------
// the user doesn't need to TAB to this control
virtual bool AcceptsFocusFromKeyboard() const wxOVERRIDE { return false; }
// this method is only overridden in order to synchronize the control with
// the main window when it is scrolled, the derived class must implement
// DoScrollHorz()
virtual void ScrollWindow(int dx, int dy, const wxRect *rect = NULL) wxOVERRIDE;
protected:
// this method must be implemented by the derived classes to return the
// information for the given column
virtual const wxHeaderColumn& GetColumn(unsigned int idx) const = 0;
// this method is called from the default EVT_HEADER_SEPARATOR_DCLICK
// handler to update the fitting column width of the given column, it
// should return true if the width was really updated
virtual bool UpdateColumnWidthToFit(unsigned int WXUNUSED(idx),
int WXUNUSED(widthTitle))
{
return false;
}
// this method is called from ShowColumnsMenu() and must be overridden to
// update the internal column visibility (there is no need to call
// UpdateColumn() from here, this will be done internally)
virtual void UpdateColumnVisibility(unsigned int WXUNUSED(idx),
bool WXUNUSED(show))
{
wxFAIL_MSG( "must be overridden if called" );
}
// this method is called from ShowCustomizeDialog() to reorder all columns
// at once and should be implemented for controls using wxHD_ALLOW_REORDER
// style (there is no need to call SetColumnsOrder() from here, this is
// done by the control itself)
virtual void UpdateColumnsOrder(const wxArrayInt& WXUNUSED(order))
{
wxFAIL_MSG( "must be overridden if called" );
}
// this method can be overridden in the derived classes to do something
// (e.g. update/resize some internal data structures) before the number of
// columns in the control changes
virtual void OnColumnCountChanging(unsigned int WXUNUSED(count)) { }
// helper function for the derived classes: update the array of column
// indices after the number of columns changed
void DoResizeColumnIndices(wxArrayInt& colIndices, unsigned int count);
protected:
// this window doesn't look nice with the border so don't use it by default
virtual wxBorder GetDefaultBorder() const wxOVERRIDE { return wxBORDER_NONE; }
private:
// methods implementing our public API and defined in platform-specific
// implementations
virtual void DoSetCount(unsigned int count) = 0;
virtual unsigned int DoGetCount() const = 0;
virtual void DoUpdate(unsigned int idx) = 0;
virtual void DoScrollHorz(int dx) = 0;
virtual void DoSetColumnsOrder(const wxArrayInt& order) = 0;
virtual wxArrayInt DoGetColumnsOrder() const = 0;
// event handlers
void OnSeparatorDClick(wxHeaderCtrlEvent& event);
#if wxUSE_MENUS
void OnRClick(wxHeaderCtrlEvent& event);
#endif // wxUSE_MENUS
wxDECLARE_EVENT_TABLE();
};
// ----------------------------------------------------------------------------
// wxHeaderCtrl: port-specific header control implementation, notice that this
// is still an ABC which is meant to be used as part of another
// control, see wxHeaderCtrlSimple for a standalone version
// ----------------------------------------------------------------------------
#if defined(__WXMSW__) && !defined(__WXUNIVERSAL__)
#include "wx/msw/headerctrl.h"
#else
#define wxHAS_GENERIC_HEADERCTRL
#include "wx/generic/headerctrlg.h"
#endif // platform
// ----------------------------------------------------------------------------
// wxHeaderCtrlSimple: concrete header control which can be used standalone
// ----------------------------------------------------------------------------
class WXDLLIMPEXP_CORE wxHeaderCtrlSimple : public wxHeaderCtrl
{
public:
// control creation
// ----------------
wxHeaderCtrlSimple() { Init(); }
wxHeaderCtrlSimple(wxWindow *parent,
wxWindowID winid = wxID_ANY,
const wxPoint& pos = wxDefaultPosition,
const wxSize& size = wxDefaultSize,
long style = wxHD_DEFAULT_STYLE,
const wxString& name = wxHeaderCtrlNameStr)
{
Init();
Create(parent, winid, pos, size, style, name);
}
// managing the columns
// --------------------
// insert the column at the given position, using GetColumnCount() as
// position appends it at the end
void InsertColumn(const wxHeaderColumnSimple& col, unsigned int idx)
{
wxCHECK_RET( idx <= GetColumnCount(), "invalid column index" );
DoInsert(col, idx);
}
// append the column to the end of the control
void AppendColumn(const wxHeaderColumnSimple& col)
{
DoInsert(col, GetColumnCount());
}
// delete the column at the given index
void DeleteColumn(unsigned int idx)
{
wxCHECK_RET( idx < GetColumnCount(), "invalid column index" );
DoDelete(idx);
}
// delete all the existing columns
void DeleteAllColumns();
// modifying columns
// -----------------
// show or hide the column, notice that even when a column is hidden we
// still account for it when using indices
void ShowColumn(unsigned int idx, bool show = true)
{
wxCHECK_RET( idx < GetColumnCount(), "invalid column index" );
DoShowColumn(idx, show);
}
void HideColumn(unsigned int idx)
{
ShowColumn(idx, false);
}
// indicate that the column is used for sorting
void ShowSortIndicator(unsigned int idx, bool ascending = true)
{
wxCHECK_RET( idx < GetColumnCount(), "invalid column index" );
DoShowSortIndicator(idx, ascending);
}
// remove the sort indicator completely
void RemoveSortIndicator();
protected:
// implement/override base class methods
virtual const wxHeaderColumn& GetColumn(unsigned int idx) const wxOVERRIDE;
virtual bool UpdateColumnWidthToFit(unsigned int idx, int widthTitle) wxOVERRIDE;
// and define another one to be overridden in the derived classes: it
// should return the best width for the given column contents or -1 if not
// implemented, we use it to implement UpdateColumnWidthToFit()
virtual int GetBestFittingWidth(unsigned int WXUNUSED(idx)) const
{
return -1;
}
private:
// functions implementing our public API
void DoInsert(const wxHeaderColumnSimple& col, unsigned int idx);
void DoDelete(unsigned int idx);
void DoShowColumn(unsigned int idx, bool show);
void DoShowSortIndicator(unsigned int idx, bool ascending);
// common part of all ctors
void Init();
// bring the column count in sync with the number of columns we store
void UpdateColumnCount()
{
SetColumnCount(static_cast<int>(m_cols.size()));
}
// all our current columns
typedef wxVector<wxHeaderColumnSimple> Columns;
Columns m_cols;
// the column currently used for sorting or -1 if none
unsigned int m_sortKey;
wxDECLARE_NO_COPY_CLASS(wxHeaderCtrlSimple);
};
// ----------------------------------------------------------------------------
// wxHeaderCtrl events
// ----------------------------------------------------------------------------
class WXDLLIMPEXP_CORE wxHeaderCtrlEvent : public wxNotifyEvent
{
public:
wxHeaderCtrlEvent(wxEventType commandType = wxEVT_NULL, int winid = 0)
: wxNotifyEvent(commandType, winid),
m_col(-1),
m_width(0),
m_order(static_cast<unsigned int>(-1))
{
}
wxHeaderCtrlEvent(const wxHeaderCtrlEvent& event)
: wxNotifyEvent(event),
m_col(event.m_col),
m_width(event.m_width),
m_order(event.m_order)
{
}
// the column which this event pertains to: valid for all header events
int GetColumn() const { return m_col; }
void SetColumn(int col) { m_col = col; }
// the width of the column: valid for column resizing/dragging events only
int GetWidth() const { return m_width; }
void SetWidth(int width) { m_width = width; }
// the new position of the column: for end reorder events only
unsigned int GetNewOrder() const { return m_order; }
void SetNewOrder(unsigned int order) { m_order = order; }
virtual wxEvent *Clone() const wxOVERRIDE { return new wxHeaderCtrlEvent(*this); }
protected:
// the column affected by the event
int m_col;
// the current width for the dragging events
int m_width;
// the new column position for end reorder event
unsigned int m_order;
private:
wxDECLARE_DYNAMIC_CLASS_NO_ASSIGN(wxHeaderCtrlEvent);
};
wxDECLARE_EXPORTED_EVENT( WXDLLIMPEXP_CORE, wxEVT_HEADER_CLICK, wxHeaderCtrlEvent );
wxDECLARE_EXPORTED_EVENT( WXDLLIMPEXP_CORE, wxEVT_HEADER_RIGHT_CLICK, wxHeaderCtrlEvent );
wxDECLARE_EXPORTED_EVENT( WXDLLIMPEXP_CORE, wxEVT_HEADER_MIDDLE_CLICK, wxHeaderCtrlEvent );
wxDECLARE_EXPORTED_EVENT( WXDLLIMPEXP_CORE, wxEVT_HEADER_DCLICK, wxHeaderCtrlEvent );
wxDECLARE_EXPORTED_EVENT( WXDLLIMPEXP_CORE, wxEVT_HEADER_RIGHT_DCLICK, wxHeaderCtrlEvent );
wxDECLARE_EXPORTED_EVENT( WXDLLIMPEXP_CORE, wxEVT_HEADER_MIDDLE_DCLICK, wxHeaderCtrlEvent );
wxDECLARE_EXPORTED_EVENT( WXDLLIMPEXP_CORE, wxEVT_HEADER_SEPARATOR_DCLICK, wxHeaderCtrlEvent );
wxDECLARE_EXPORTED_EVENT( WXDLLIMPEXP_CORE, wxEVT_HEADER_BEGIN_RESIZE, wxHeaderCtrlEvent );
wxDECLARE_EXPORTED_EVENT( WXDLLIMPEXP_CORE, wxEVT_HEADER_RESIZING, wxHeaderCtrlEvent );
wxDECLARE_EXPORTED_EVENT( WXDLLIMPEXP_CORE, wxEVT_HEADER_END_RESIZE, wxHeaderCtrlEvent );
wxDECLARE_EXPORTED_EVENT( WXDLLIMPEXP_CORE, wxEVT_HEADER_BEGIN_REORDER, wxHeaderCtrlEvent );
wxDECLARE_EXPORTED_EVENT( WXDLLIMPEXP_CORE, wxEVT_HEADER_END_REORDER, wxHeaderCtrlEvent );
wxDECLARE_EXPORTED_EVENT( WXDLLIMPEXP_CORE, wxEVT_HEADER_DRAGGING_CANCELLED, wxHeaderCtrlEvent );
typedef void (wxEvtHandler::*wxHeaderCtrlEventFunction)(wxHeaderCtrlEvent&);
#define wxHeaderCtrlEventHandler(func) \
wxEVENT_HANDLER_CAST(wxHeaderCtrlEventFunction, func)
#define wx__DECLARE_HEADER_EVT(evt, id, fn) \
wx__DECLARE_EVT1(wxEVT_HEADER_ ## evt, id, wxHeaderCtrlEventHandler(fn))
#define EVT_HEADER_CLICK(id, fn) wx__DECLARE_HEADER_EVT(CLICK, id, fn)
#define EVT_HEADER_RIGHT_CLICK(id, fn) wx__DECLARE_HEADER_EVT(RIGHT_CLICK, id, fn)
#define EVT_HEADER_MIDDLE_CLICK(id, fn) wx__DECLARE_HEADER_EVT(MIDDLE_CLICK, id, fn)
#define EVT_HEADER_DCLICK(id, fn) wx__DECLARE_HEADER_EVT(DCLICK, id, fn)
#define EVT_HEADER_RIGHT_DCLICK(id, fn) wx__DECLARE_HEADER_EVT(RIGHT_DCLICK, id, fn)
#define EVT_HEADER_MIDDLE_DCLICK(id, fn) wx__DECLARE_HEADER_EVT(MIDDLE_DCLICK, id, fn)
#define EVT_HEADER_SEPARATOR_DCLICK(id, fn) wx__DECLARE_HEADER_EVT(SEPARATOR_DCLICK, id, fn)
#define EVT_HEADER_BEGIN_RESIZE(id, fn) wx__DECLARE_HEADER_EVT(BEGIN_RESIZE, id, fn)
#define EVT_HEADER_RESIZING(id, fn) wx__DECLARE_HEADER_EVT(RESIZING, id, fn)
#define EVT_HEADER_END_RESIZE(id, fn) wx__DECLARE_HEADER_EVT(END_RESIZE, id, fn)
#define EVT_HEADER_BEGIN_REORDER(id, fn) wx__DECLARE_HEADER_EVT(BEGIN_REORDER, id, fn)
#define EVT_HEADER_END_REORDER(id, fn) wx__DECLARE_HEADER_EVT(END_REORDER, id, fn)
#define EVT_HEADER_DRAGGING_CANCELLED(id, fn) wx__DECLARE_HEADER_EVT(DRAGGING_CANCELLED, id, fn)
// old wxEVT_COMMAND_* constants
#define wxEVT_COMMAND_HEADER_CLICK wxEVT_HEADER_CLICK
#define wxEVT_COMMAND_HEADER_RIGHT_CLICK wxEVT_HEADER_RIGHT_CLICK
#define wxEVT_COMMAND_HEADER_MIDDLE_CLICK wxEVT_HEADER_MIDDLE_CLICK
#define wxEVT_COMMAND_HEADER_DCLICK wxEVT_HEADER_DCLICK
#define wxEVT_COMMAND_HEADER_RIGHT_DCLICK wxEVT_HEADER_RIGHT_DCLICK
#define wxEVT_COMMAND_HEADER_MIDDLE_DCLICK wxEVT_HEADER_MIDDLE_DCLICK
#define wxEVT_COMMAND_HEADER_SEPARATOR_DCLICK wxEVT_HEADER_SEPARATOR_DCLICK
#define wxEVT_COMMAND_HEADER_BEGIN_RESIZE wxEVT_HEADER_BEGIN_RESIZE
#define wxEVT_COMMAND_HEADER_RESIZING wxEVT_HEADER_RESIZING
#define wxEVT_COMMAND_HEADER_END_RESIZE wxEVT_HEADER_END_RESIZE
#define wxEVT_COMMAND_HEADER_BEGIN_REORDER wxEVT_HEADER_BEGIN_REORDER
#define wxEVT_COMMAND_HEADER_END_REORDER wxEVT_HEADER_END_REORDER
#define wxEVT_COMMAND_HEADER_DRAGGING_CANCELLED wxEVT_HEADER_DRAGGING_CANCELLED
#endif // wxUSE_HEADERCTRL
#endif // _WX_HEADERCTRL_H_
| h |
rticonnextdds-usecases | data/projects/rticonnextdds-usecases/VehicleTracking/ExampleCode/thirdparty/wxWidgets-3.1.2/Linux/include/wx/systhemectrl.h | /////////////////////////////////////////////////////////////////////////////
// Name: wx/systhemectrl.h
// Purpose: Class to make controls appear in the systems theme
// Author: Tobias Taschner
// Created: 2014-08-14
// Copyright: (c) 2014 wxWidgets development team
// Licence: wxWindows licence
/////////////////////////////////////////////////////////////////////////////
#ifndef _WX_SYSTHEMECTRL_H
#define _WX_SYSTHEMECTRL_H
#include "wx/defs.h"
#if defined(__WXMSW__) && wxUSE_UXTHEME && !defined(__WXUNIVERSAL__)
#define wxHAS_SYSTEM_THEMED_CONTROL
#endif
class WXDLLIMPEXP_FWD_CORE wxWindow;
class WXDLLIMPEXP_CORE wxSystemThemedControlBase
{
public:
wxSystemThemedControlBase() { }
virtual ~wxSystemThemedControlBase() { }
protected:
// This method is virtual and can be overridden, e.g. composite controls do
// it to enable the system theme for all of their parts.
virtual void DoEnableSystemTheme
#ifdef wxHAS_SYSTEM_THEMED_CONTROL
// Only __WXMSW__ has a non-trivial implementation currently.
(bool enable, wxWindow* window);
#else
(bool WXUNUSED(enable), wxWindow* WXUNUSED(window)) { }
#endif // wxHAS_SYSTEM_THEMED_CONTROL
wxDECLARE_NO_COPY_CLASS(wxSystemThemedControlBase);
};
// This class used CRTP, i.e. it should be instantiated for the real base class
// and inherited from.
template <class C>
class wxSystemThemedControl : public C,
public wxSystemThemedControlBase
{
public:
wxSystemThemedControl() { }
void EnableSystemTheme(bool enable = true)
{
DoEnableSystemTheme(enable, this);
}
protected:
wxDECLARE_NO_COPY_TEMPLATE_CLASS(wxSystemThemedControl, C);
};
#endif // _WX_SYSTHEMECTRL_H
| h |
rticonnextdds-usecases | data/projects/rticonnextdds-usecases/VehicleTracking/ExampleCode/thirdparty/wxWidgets-3.1.2/Linux/include/wx/strvararg.h | ///////////////////////////////////////////////////////////////////////////////
// Name: wx/strvararg.h
// Purpose: macros for implementing type-safe vararg passing of strings
// Author: Vaclav Slavik
// Created: 2007-02-19
// Copyright: (c) 2007 REA Elektronik GmbH
// Licence: wxWindows licence
///////////////////////////////////////////////////////////////////////////////
#ifndef _WX_STRVARARG_H_
#define _WX_STRVARARG_H_
#include "wx/platform.h"
#include "wx/cpp.h"
#include "wx/chartype.h"
#include "wx/strconv.h"
#include "wx/buffer.h"
#include "wx/unichar.h"
#if defined(HAVE_TYPE_TRAITS)
#include <type_traits>
#elif defined(HAVE_TR1_TYPE_TRAITS)
#ifdef __VISUALC__
#include <type_traits>
#else
#include <tr1/type_traits>
#endif
#endif
class WXDLLIMPEXP_FWD_BASE wxCStrData;
class WXDLLIMPEXP_FWD_BASE wxString;
// ----------------------------------------------------------------------------
// WX_DEFINE_VARARG_FUNC* macros
// ----------------------------------------------------------------------------
// This macro is used to implement type-safe wrappers for variadic functions
// that accept strings as arguments. This makes it possible to pass char*,
// wchar_t* or even wxString (as opposed to having to use wxString::c_str())
// to e.g. wxPrintf().
//
// This is done by defining a set of N template function taking 1..N arguments
// (currently, N is set to 30 in this header). These functions are just thin
// wrappers around another variadic function ('impl' or 'implUtf8' arguments,
// see below) and the only thing the wrapper does is that it normalizes the
// arguments passed in so that they are of the type expected by variadic
// functions taking string arguments, i.e., char* or wchar_t*, depending on the
// build:
// * char* in the current locale's charset in ANSI build
// * char* with UTF-8 encoding if wxUSE_UNICODE_UTF8 and the app is running
// under an UTF-8 locale
// * wchar_t* if wxUSE_UNICODE_WCHAR or if wxUSE_UNICODE_UTF8 and the current
// locale is not UTF-8
//
// Note that wxFormatString *must* be used for the format parameter of these
// functions, otherwise the implementation won't work correctly. Furthermore,
// it must be passed by value, not reference, because it's modified by the
// vararg templates internally.
//
// Parameters:
// [ there are examples in square brackets showing values of the parameters
// for the wxFprintf() wrapper for fprintf() function with the following
// prototype:
// int wxFprintf(FILE *stream, const wxString& format, ...); ]
//
// rettype Functions' return type [int]
// name Name of the function [fprintf]
// numfixed The number of leading "fixed" (i.e., not variadic)
// arguments of the function (e.g. "stream" and "format"
// arguments of fprintf()); their type is _not_ converted
// using wxArgNormalizer<T>, unlike the rest of
// the function's arguments [2]
// fixed List of types of the leading "fixed" arguments, in
// parenthesis [(FILE*,const wxString&)]
// impl Name of the variadic function that implements 'name' for
// the native strings representation (wchar_t* if
// wxUSE_UNICODE_WCHAR or wxUSE_UNICODE_UTF8 when running under
// non-UTF8 locale, char* in ANSI build) [wxCrt_Fprintf]
// implUtf8 Like 'impl', but for the UTF-8 char* version to be used
// if wxUSE_UNICODE_UTF8 and running under UTF-8 locale
// (ignored otherwise) [fprintf]
//
#define WX_DEFINE_VARARG_FUNC(rettype, name, numfixed, fixed, impl, implUtf8) \
_WX_VARARG_DEFINE_FUNC_N0(rettype, name, impl, implUtf8, numfixed, fixed) \
WX_DEFINE_VARARG_FUNC_SANS_N0(rettype, name, numfixed, fixed, impl, implUtf8)
// ditto, but without the version with 0 template/vararg arguments
#define WX_DEFINE_VARARG_FUNC_SANS_N0(rettype, name, \
numfixed, fixed, impl, implUtf8) \
_WX_VARARG_ITER(_WX_VARARG_MAX_ARGS, \
_WX_VARARG_DEFINE_FUNC, \
rettype, name, impl, implUtf8, numfixed, fixed)
// Like WX_DEFINE_VARARG_FUNC, but for variadic functions that don't return
// a value.
#define WX_DEFINE_VARARG_FUNC_VOID(name, numfixed, fixed, impl, implUtf8) \
_WX_VARARG_DEFINE_FUNC_VOID_N0(name, impl, implUtf8, numfixed, fixed) \
_WX_VARARG_ITER(_WX_VARARG_MAX_ARGS, \
_WX_VARARG_DEFINE_FUNC_VOID, \
void, name, impl, implUtf8, numfixed, fixed)
// Like WX_DEFINE_VARARG_FUNC_VOID, but instead of wrapping an implementation
// function, does nothing in defined functions' bodies.
//
// Used to implement wxLogXXX functions if wxUSE_LOG=0.
#define WX_DEFINE_VARARG_FUNC_NOP(name, numfixed, fixed) \
_WX_VARARG_DEFINE_FUNC_NOP_N0(name, numfixed, fixed) \
_WX_VARARG_ITER(_WX_VARARG_MAX_ARGS, \
_WX_VARARG_DEFINE_FUNC_NOP, \
void, name, dummy, dummy, numfixed, fixed)
// Like WX_DEFINE_VARARG_FUNC_CTOR, but for defining template constructors
#define WX_DEFINE_VARARG_FUNC_CTOR(name, numfixed, fixed, impl, implUtf8) \
_WX_VARARG_DEFINE_FUNC_CTOR_N0(name, impl, implUtf8, numfixed, fixed) \
_WX_VARARG_ITER(_WX_VARARG_MAX_ARGS, \
_WX_VARARG_DEFINE_FUNC_CTOR, \
void, name, impl, implUtf8, numfixed, fixed)
// ----------------------------------------------------------------------------
// wxFormatString
// ----------------------------------------------------------------------------
// This class must be used for format string argument of the functions
// defined using WX_DEFINE_VARARG_FUNC_* macros. It converts the string to
// char* or wchar_t* for passing to implementation function efficiently (i.e.
// without keeping the converted string in memory for longer than necessary,
// like c_str()). It also converts format string to the correct form that
// accounts for string changes done by wxArgNormalizer<>
//
// Note that this class can _only_ be used for function arguments!
class WXDLLIMPEXP_BASE wxFormatString
{
public:
wxFormatString(const char *str)
: m_char(wxScopedCharBuffer::CreateNonOwned(str)), m_str(NULL), m_cstr(NULL) {}
wxFormatString(const wchar_t *str)
: m_wchar(wxScopedWCharBuffer::CreateNonOwned(str)), m_str(NULL), m_cstr(NULL) {}
wxFormatString(const wxString& str)
: m_str(&str), m_cstr(NULL) {}
wxFormatString(const wxCStrData& str)
: m_str(NULL), m_cstr(&str) {}
wxFormatString(const wxScopedCharBuffer& str)
: m_char(str), m_str(NULL), m_cstr(NULL) {}
wxFormatString(const wxScopedWCharBuffer& str)
: m_wchar(str), m_str(NULL), m_cstr(NULL) {}
// Possible argument types. These are or-combinable for wxASSERT_ARG_TYPE
// convenience. Some of the values are or-combined with another value, this
// expresses "supertypes" for use with wxASSERT_ARG_TYPE masks. For example,
// a char* string is also a pointer and an integer is also a char.
enum ArgumentType
{
Arg_Unused = 0, // not used at all; the value of 0 is chosen to
// conveniently pass wxASSERT_ARG_TYPE's check
Arg_Char = 0x0001, // character as char %c
Arg_Pointer = 0x0002, // %p
Arg_String = 0x0004 | Arg_Pointer, // any form of string (%s and %p too)
Arg_Int = 0x0008 | Arg_Char, // (ints can be used with %c)
#if SIZEOF_INT == SIZEOF_LONG
Arg_LongInt = Arg_Int,
#else
Arg_LongInt = 0x0010,
#endif
#if defined(SIZEOF_LONG_LONG) && SIZEOF_LONG_LONG == SIZEOF_LONG
Arg_LongLongInt = Arg_LongInt,
#elif defined(wxLongLong_t)
Arg_LongLongInt = 0x0020,
#endif
Arg_Double = 0x0040,
Arg_LongDouble = 0x0080,
#if defined(wxSIZE_T_IS_UINT)
Arg_Size_t = Arg_Int,
#elif defined(wxSIZE_T_IS_ULONG)
Arg_Size_t = Arg_LongInt,
#elif defined(SIZEOF_LONG_LONG) && SIZEOF_SIZE_T == SIZEOF_LONG_LONG
Arg_Size_t = Arg_LongLongInt,
#else
Arg_Size_t = 0x0100,
#endif
Arg_IntPtr = 0x0200, // %n -- store # of chars written
Arg_ShortIntPtr = 0x0400,
Arg_LongIntPtr = 0x0800,
Arg_Unknown = 0x8000 // unrecognized specifier (likely error)
};
// returns the type of format specifier for n-th variadic argument (this is
// not necessarily n-th format specifier if positional specifiers are used);
// called by wxArgNormalizer<> specializations to get information about
// n-th variadic argument desired representation
ArgumentType GetArgumentType(unsigned n) const;
// returns the value passed to ctor, only converted to wxString, similarly
// to other InputAsXXX() methods
wxString InputAsString() const;
#if !wxUSE_UNICODE_WCHAR
operator const char*() const
{ return const_cast<wxFormatString*>(this)->AsChar(); }
private:
// InputAsChar() returns the value passed to ctor, only converted
// to char, while AsChar() takes the string returned by InputAsChar()
// and does format string conversion on it as well (and similarly for
// ..AsWChar() below)
const char* InputAsChar();
const char* AsChar();
wxScopedCharBuffer m_convertedChar;
#endif // !wxUSE_UNICODE_WCHAR
#if wxUSE_UNICODE && !wxUSE_UTF8_LOCALE_ONLY
public:
operator const wchar_t*() const
{ return const_cast<wxFormatString*>(this)->AsWChar(); }
private:
const wchar_t* InputAsWChar();
const wchar_t* AsWChar();
wxScopedWCharBuffer m_convertedWChar;
#endif // wxUSE_UNICODE && !wxUSE_UTF8_LOCALE_ONLY
private:
wxScopedCharBuffer m_char;
wxScopedWCharBuffer m_wchar;
// NB: we can use a pointer here, because wxFormatString is only used
// as function argument, so it has shorter life than the string
// passed to the ctor
const wxString * const m_str;
const wxCStrData * const m_cstr;
wxDECLARE_NO_ASSIGN_CLASS(wxFormatString);
};
// these two helper classes are used to find wxFormatString argument among fixed
// arguments passed to a vararg template
struct wxFormatStringArgument
{
wxFormatStringArgument(const wxFormatString *s = NULL) : m_str(s) {}
const wxFormatString *m_str;
// overriding this operator allows us to reuse _WX_VARARG_JOIN macro
wxFormatStringArgument operator,(const wxFormatStringArgument& a) const
{
wxASSERT_MSG( m_str == NULL || a.m_str == NULL,
"can't have two format strings in vararg function" );
return wxFormatStringArgument(m_str ? m_str : a.m_str);
}
operator const wxFormatString*() const { return m_str; }
};
template<typename T>
struct wxFormatStringArgumentFinder
{
static wxFormatStringArgument find(T)
{
// by default, arguments are not format strings, so return "not found"
return wxFormatStringArgument();
}
};
template<>
struct wxFormatStringArgumentFinder<const wxFormatString&>
{
static wxFormatStringArgument find(const wxFormatString& arg)
{ return wxFormatStringArgument(&arg); }
};
template<>
struct wxFormatStringArgumentFinder<wxFormatString>
: public wxFormatStringArgumentFinder<const wxFormatString&> {};
// avoid passing big objects by value to wxFormatStringArgumentFinder::find()
// (and especially wx[W]CharBuffer with its auto_ptr<> style semantics!):
template<>
struct wxFormatStringArgumentFinder<wxString>
: public wxFormatStringArgumentFinder<const wxString&> {};
template<>
struct wxFormatStringArgumentFinder<wxScopedCharBuffer>
: public wxFormatStringArgumentFinder<const wxScopedCharBuffer&> {};
template<>
struct wxFormatStringArgumentFinder<wxScopedWCharBuffer>
: public wxFormatStringArgumentFinder<const wxScopedWCharBuffer&> {};
template<>
struct wxFormatStringArgumentFinder<wxCharBuffer>
: public wxFormatStringArgumentFinder<const wxCharBuffer&> {};
template<>
struct wxFormatStringArgumentFinder<wxWCharBuffer>
: public wxFormatStringArgumentFinder<const wxWCharBuffer&> {};
// ----------------------------------------------------------------------------
// wxArgNormalizer*<T> converters
// ----------------------------------------------------------------------------
#if wxDEBUG_LEVEL
// Check that the format specifier for index-th argument in 'fmt' has
// the correct type (one of wxFormatString::Arg_XXX or-combination in
// 'expected_mask').
#define wxASSERT_ARG_TYPE(fmt, index, expected_mask) \
wxSTATEMENT_MACRO_BEGIN \
if ( !fmt ) \
break; \
const int argtype = fmt->GetArgumentType(index); \
wxASSERT_MSG( (argtype & (expected_mask)) == argtype, \
"format specifier doesn't match argument type" ); \
wxSTATEMENT_MACRO_END
#else
// Just define it to suppress "unused parameter" warnings for the
// parameters which we don't use otherwise
#define wxASSERT_ARG_TYPE(fmt, index, expected_mask) \
wxUnusedVar(fmt); \
wxUnusedVar(index)
#endif // wxDEBUG_LEVEL/!wxDEBUG_LEVEL
#if defined(HAVE_TYPE_TRAITS) || defined(HAVE_TR1_TYPE_TRAITS)
// Note: this type is misnamed, so that the error message is easier to
// understand (no error happens for enums, because the IsEnum=true case is
// specialized).
template<bool IsEnum>
struct wxFormatStringSpecifierNonPodType {};
template<>
struct wxFormatStringSpecifierNonPodType<true>
{
enum { value = wxFormatString::Arg_Int };
};
template<typename T>
struct wxFormatStringSpecifier
{
#ifdef HAVE_TYPE_TRAITS
typedef std::is_enum<T> is_enum;
#elif defined HAVE_TR1_TYPE_TRAITS
typedef std::tr1::is_enum<T> is_enum;
#endif
enum { value = wxFormatStringSpecifierNonPodType<is_enum::value>::value };
};
#else // !HAVE_(TR1_)TYPE_TRAITS
template<typename T>
struct wxFormatStringSpecifier
{
// We can't detect enums without is_enum, so the only thing we can
// do is to accept unknown types. However, the only acceptable unknown
// types still are enums, which are promoted to ints, so return Arg_Int
// here. This will at least catch passing of non-POD types through ... at
// runtime.
//
// Furthermore, if the compiler doesn't have partial template
// specialization, we didn't cover pointers either.
enum { value = wxFormatString::Arg_Int };
};
#endif // HAVE_TR1_TYPE_TRAITS/!HAVE_TR1_TYPE_TRAITS
template<typename T>
struct wxFormatStringSpecifier<T*>
{
enum { value = wxFormatString::Arg_Pointer };
};
template<typename T>
struct wxFormatStringSpecifier<const T*>
{
enum { value = wxFormatString::Arg_Pointer };
};
#define wxFORMAT_STRING_SPECIFIER(T, arg) \
template<> struct wxFormatStringSpecifier<T> \
{ \
enum { value = arg }; \
};
wxFORMAT_STRING_SPECIFIER(bool, wxFormatString::Arg_Int)
wxFORMAT_STRING_SPECIFIER(int, wxFormatString::Arg_Int)
wxFORMAT_STRING_SPECIFIER(unsigned int, wxFormatString::Arg_Int)
wxFORMAT_STRING_SPECIFIER(short int, wxFormatString::Arg_Int)
wxFORMAT_STRING_SPECIFIER(short unsigned int, wxFormatString::Arg_Int)
wxFORMAT_STRING_SPECIFIER(long int, wxFormatString::Arg_LongInt)
wxFORMAT_STRING_SPECIFIER(long unsigned int, wxFormatString::Arg_LongInt)
#ifdef wxLongLong_t
wxFORMAT_STRING_SPECIFIER(wxLongLong_t, wxFormatString::Arg_LongLongInt)
wxFORMAT_STRING_SPECIFIER(wxULongLong_t, wxFormatString::Arg_LongLongInt)
#endif
wxFORMAT_STRING_SPECIFIER(float, wxFormatString::Arg_Double)
wxFORMAT_STRING_SPECIFIER(double, wxFormatString::Arg_Double)
wxFORMAT_STRING_SPECIFIER(long double, wxFormatString::Arg_LongDouble)
#if wxWCHAR_T_IS_REAL_TYPE
wxFORMAT_STRING_SPECIFIER(wchar_t, wxFormatString::Arg_Char | wxFormatString::Arg_Int)
#endif
#if !wxUSE_UNICODE
wxFORMAT_STRING_SPECIFIER(char, wxFormatString::Arg_Char | wxFormatString::Arg_Int)
wxFORMAT_STRING_SPECIFIER(signed char, wxFormatString::Arg_Char | wxFormatString::Arg_Int)
wxFORMAT_STRING_SPECIFIER(unsigned char, wxFormatString::Arg_Char | wxFormatString::Arg_Int)
#endif
wxFORMAT_STRING_SPECIFIER(char*, wxFormatString::Arg_String)
wxFORMAT_STRING_SPECIFIER(unsigned char*, wxFormatString::Arg_String)
wxFORMAT_STRING_SPECIFIER(signed char*, wxFormatString::Arg_String)
wxFORMAT_STRING_SPECIFIER(const char*, wxFormatString::Arg_String)
wxFORMAT_STRING_SPECIFIER(const unsigned char*, wxFormatString::Arg_String)
wxFORMAT_STRING_SPECIFIER(const signed char*, wxFormatString::Arg_String)
wxFORMAT_STRING_SPECIFIER(wchar_t*, wxFormatString::Arg_String)
wxFORMAT_STRING_SPECIFIER(const wchar_t*, wxFormatString::Arg_String)
wxFORMAT_STRING_SPECIFIER(int*, wxFormatString::Arg_IntPtr | wxFormatString::Arg_Pointer)
wxFORMAT_STRING_SPECIFIER(short int*, wxFormatString::Arg_ShortIntPtr | wxFormatString::Arg_Pointer)
wxFORMAT_STRING_SPECIFIER(long int*, wxFormatString::Arg_LongIntPtr | wxFormatString::Arg_Pointer)
#undef wxFORMAT_STRING_SPECIFIER
// Converts an argument passed to wxPrint etc. into standard form expected,
// by wxXXX functions, e.g. all strings (wxString, char*, wchar_t*) are
// converted into wchar_t* or char* depending on the build.
template<typename T>
struct wxArgNormalizer
{
// Ctor. 'value' is the value passed as variadic argument, 'fmt' is pointer
// to printf-like format string or NULL if the variadic function doesn't
// use format string and 'index' is index of 'value' in variadic arguments
// list (starting at 1)
wxArgNormalizer(T value,
const wxFormatString *fmt, unsigned index)
: m_value(value)
{
wxASSERT_ARG_TYPE( fmt, index, wxFormatStringSpecifier<T>::value );
}
// Returns the value in a form that can be safely passed to real vararg
// functions. In case of strings, this is char* in ANSI build and wchar_t*
// in Unicode build.
T get() const { return m_value; }
T m_value;
};
// normalizer for passing arguments to functions working with wchar_t* (and
// until ANSI build is removed, char* in ANSI build as well - FIXME-UTF8)
// string representation
#if !wxUSE_UTF8_LOCALE_ONLY
template<typename T>
struct wxArgNormalizerWchar : public wxArgNormalizer<T>
{
wxArgNormalizerWchar(T value,
const wxFormatString *fmt, unsigned index)
: wxArgNormalizer<T>(value, fmt, index) {}
};
#endif // !wxUSE_UTF8_LOCALE_ONLY
// normalizer for passing arguments to functions working with UTF-8 encoded
// char* strings
#if wxUSE_UNICODE_UTF8
template<typename T>
struct wxArgNormalizerUtf8 : public wxArgNormalizer<T>
{
wxArgNormalizerUtf8(T value,
const wxFormatString *fmt, unsigned index)
: wxArgNormalizer<T>(value, fmt, index) {}
};
#define wxArgNormalizerNative wxArgNormalizerUtf8
#else // wxUSE_UNICODE_WCHAR
#define wxArgNormalizerNative wxArgNormalizerWchar
#endif // wxUSE_UNICODE_UTF8 // wxUSE_UNICODE_UTF8
// special cases for converting strings:
// base class for wxArgNormalizer<T> specializations that need to do conversion;
// CharType is either wxStringCharType or wchar_t in UTF-8 build when wrapping
// widechar CRT function
template<typename CharType>
struct wxArgNormalizerWithBuffer
{
typedef wxScopedCharTypeBuffer<CharType> CharBuffer;
wxArgNormalizerWithBuffer() {}
wxArgNormalizerWithBuffer(const CharBuffer& buf,
const wxFormatString *fmt,
unsigned index)
: m_value(buf)
{
wxASSERT_ARG_TYPE( fmt, index, wxFormatString::Arg_String );
}
const CharType *get() const { return m_value; }
CharBuffer m_value;
};
// string objects:
template<>
struct WXDLLIMPEXP_BASE wxArgNormalizerNative<const wxString&>
{
wxArgNormalizerNative(const wxString& s,
const wxFormatString *fmt,
unsigned index)
: m_value(s)
{
wxASSERT_ARG_TYPE( fmt, index, wxFormatString::Arg_String );
}
const wxStringCharType *get() const;
const wxString& m_value;
};
// c_str() values:
template<>
struct WXDLLIMPEXP_BASE wxArgNormalizerNative<const wxCStrData&>
{
wxArgNormalizerNative(const wxCStrData& value,
const wxFormatString *fmt,
unsigned index)
: m_value(value)
{
wxASSERT_ARG_TYPE( fmt, index, wxFormatString::Arg_String );
}
const wxStringCharType *get() const;
const wxCStrData& m_value;
};
// wxString/wxCStrData conversion to wchar_t* value
#if wxUSE_UNICODE_UTF8 && !wxUSE_UTF8_LOCALE_ONLY
template<>
struct WXDLLIMPEXP_BASE wxArgNormalizerWchar<const wxString&>
: public wxArgNormalizerWithBuffer<wchar_t>
{
wxArgNormalizerWchar(const wxString& s,
const wxFormatString *fmt, unsigned index);
};
template<>
struct WXDLLIMPEXP_BASE wxArgNormalizerWchar<const wxCStrData&>
: public wxArgNormalizerWithBuffer<wchar_t>
{
wxArgNormalizerWchar(const wxCStrData& s,
const wxFormatString *fmt, unsigned index);
};
#endif // wxUSE_UNICODE_UTF8 && !wxUSE_UTF8_LOCALE_ONLY
// C string pointers of the wrong type (wchar_t* for ANSI or UTF8 build,
// char* for wchar_t Unicode build or UTF8):
#if wxUSE_UNICODE_WCHAR
template<>
struct wxArgNormalizerWchar<const char*>
: public wxArgNormalizerWithBuffer<wchar_t>
{
wxArgNormalizerWchar(const char* s,
const wxFormatString *fmt, unsigned index)
: wxArgNormalizerWithBuffer<wchar_t>(wxConvLibc.cMB2WC(s), fmt, index) {}
};
#elif wxUSE_UNICODE_UTF8
template<>
struct wxArgNormalizerUtf8<const wchar_t*>
: public wxArgNormalizerWithBuffer<char>
{
wxArgNormalizerUtf8(const wchar_t* s,
const wxFormatString *fmt, unsigned index)
: wxArgNormalizerWithBuffer<char>(wxConvUTF8.cWC2MB(s), fmt, index) {}
};
template<>
struct wxArgNormalizerUtf8<const char*>
: public wxArgNormalizerWithBuffer<char>
{
wxArgNormalizerUtf8(const char* s,
const wxFormatString *fmt,
unsigned index)
{
wxASSERT_ARG_TYPE( fmt, index, wxFormatString::Arg_String );
if ( wxLocaleIsUtf8 )
{
m_value = wxScopedCharBuffer::CreateNonOwned(s);
}
else
{
// convert to widechar string first:
wxScopedWCharBuffer buf(wxConvLibc.cMB2WC(s));
// then to UTF-8:
if ( buf )
m_value = wxConvUTF8.cWC2MB(buf);
}
}
};
// UTF-8 build needs conversion to wchar_t* too:
#if !wxUSE_UTF8_LOCALE_ONLY
template<>
struct wxArgNormalizerWchar<const char*>
: public wxArgNormalizerWithBuffer<wchar_t>
{
wxArgNormalizerWchar(const char* s,
const wxFormatString *fmt, unsigned index)
: wxArgNormalizerWithBuffer<wchar_t>(wxConvLibc.cMB2WC(s), fmt, index) {}
};
#endif // !wxUSE_UTF8_LOCALE_ONLY
#else // ANSI - FIXME-UTF8
template<>
struct wxArgNormalizerWchar<const wchar_t*>
: public wxArgNormalizerWithBuffer<char>
{
wxArgNormalizerWchar(const wchar_t* s,
const wxFormatString *fmt, unsigned index)
: wxArgNormalizerWithBuffer<char>(wxConvLibc.cWC2MB(s), fmt, index) {}
};
#endif // wxUSE_UNICODE_WCHAR/wxUSE_UNICODE_UTF8/ANSI
// this macro is used to implement specialization that are exactly same as
// some other specialization, i.e. to "forward" the implementation (e.g. for
// T=wxString and T=const wxString&). Note that the ctor takes BaseT argument,
// not T!
#if wxUSE_UNICODE_UTF8
#if wxUSE_UTF8_LOCALE_ONLY
#define WX_ARG_NORMALIZER_FORWARD(T, BaseT) \
_WX_ARG_NORMALIZER_FORWARD_IMPL(wxArgNormalizerUtf8, T, BaseT)
#else // possibly non-UTF8 locales
#define WX_ARG_NORMALIZER_FORWARD(T, BaseT) \
_WX_ARG_NORMALIZER_FORWARD_IMPL(wxArgNormalizerWchar, T, BaseT); \
_WX_ARG_NORMALIZER_FORWARD_IMPL(wxArgNormalizerUtf8, T, BaseT)
#endif
#else // wxUSE_UNICODE_WCHAR
#define WX_ARG_NORMALIZER_FORWARD(T, BaseT) \
_WX_ARG_NORMALIZER_FORWARD_IMPL(wxArgNormalizerWchar, T, BaseT)
#endif // wxUSE_UNICODE_UTF8/wxUSE_UNICODE_WCHAR
#define _WX_ARG_NORMALIZER_FORWARD_IMPL(Normalizer, T, BaseT) \
template<> \
struct Normalizer<T> : public Normalizer<BaseT> \
{ \
Normalizer(BaseT value, \
const wxFormatString *fmt, unsigned index) \
: Normalizer<BaseT>(value, fmt, index) {} \
}
// non-reference versions of specializations for string objects
WX_ARG_NORMALIZER_FORWARD(wxString, const wxString&);
WX_ARG_NORMALIZER_FORWARD(wxCStrData, const wxCStrData&);
// versions for passing non-const pointers:
WX_ARG_NORMALIZER_FORWARD(char*, const char*);
WX_ARG_NORMALIZER_FORWARD(wchar_t*, const wchar_t*);
// versions for passing wx[W]CharBuffer:
WX_ARG_NORMALIZER_FORWARD(wxScopedCharBuffer, const char*);
WX_ARG_NORMALIZER_FORWARD(const wxScopedCharBuffer&, const char*);
WX_ARG_NORMALIZER_FORWARD(wxScopedWCharBuffer, const wchar_t*);
WX_ARG_NORMALIZER_FORWARD(const wxScopedWCharBuffer&, const wchar_t*);
WX_ARG_NORMALIZER_FORWARD(wxCharBuffer, const char*);
WX_ARG_NORMALIZER_FORWARD(const wxCharBuffer&, const char*);
WX_ARG_NORMALIZER_FORWARD(wxWCharBuffer, const wchar_t*);
WX_ARG_NORMALIZER_FORWARD(const wxWCharBuffer&, const wchar_t*);
// versions for std::[w]string:
#if wxUSE_STD_STRING
#include "wx/stringimpl.h"
#if !wxUSE_UTF8_LOCALE_ONLY
template<>
struct wxArgNormalizerWchar<const std::string&>
: public wxArgNormalizerWchar<const char*>
{
wxArgNormalizerWchar(const std::string& s,
const wxFormatString *fmt, unsigned index)
: wxArgNormalizerWchar<const char*>(s.c_str(), fmt, index) {}
};
template<>
struct wxArgNormalizerWchar<const wxStdWideString&>
: public wxArgNormalizerWchar<const wchar_t*>
{
wxArgNormalizerWchar(const wxStdWideString& s,
const wxFormatString *fmt, unsigned index)
: wxArgNormalizerWchar<const wchar_t*>(s.c_str(), fmt, index) {}
};
#endif // !wxUSE_UTF8_LOCALE_ONLY
#if wxUSE_UNICODE_UTF8
template<>
struct wxArgNormalizerUtf8<const std::string&>
: public wxArgNormalizerUtf8<const char*>
{
wxArgNormalizerUtf8(const std::string& s,
const wxFormatString *fmt, unsigned index)
: wxArgNormalizerUtf8<const char*>(s.c_str(), fmt, index) {}
};
template<>
struct wxArgNormalizerUtf8<const wxStdWideString&>
: public wxArgNormalizerUtf8<const wchar_t*>
{
wxArgNormalizerUtf8(const wxStdWideString& s,
const wxFormatString *fmt, unsigned index)
: wxArgNormalizerUtf8<const wchar_t*>(s.c_str(), fmt, index) {}
};
#endif // wxUSE_UNICODE_UTF8
WX_ARG_NORMALIZER_FORWARD(std::string, const std::string&);
WX_ARG_NORMALIZER_FORWARD(wxStdWideString, const wxStdWideString&);
#endif // wxUSE_STD_STRING
// versions for wxUniChar, wxUniCharRef:
// (this is same for UTF-8 and Wchar builds, we just convert to wchar_t)
template<>
struct wxArgNormalizer<const wxUniChar&> : public wxArgNormalizer<wchar_t>
{
wxArgNormalizer(const wxUniChar& s,
const wxFormatString *fmt, unsigned index)
: wxArgNormalizer<wchar_t>(wx_truncate_cast(wchar_t, s.GetValue()), fmt, index) {}
};
// for wchar_t, default handler does the right thing
// char has to be treated differently in Unicode builds: a char argument may
// be used either for a character value (which should be converted into
// wxUniChar) or as an integer value (which should be left as-is). We take
// advantage of the fact that both char and wchar_t are converted into int
// in variadic arguments here.
#if wxUSE_UNICODE
template<typename T>
struct wxArgNormalizerNarrowChar
{
wxArgNormalizerNarrowChar(T value,
const wxFormatString *fmt, unsigned index)
{
wxASSERT_ARG_TYPE( fmt, index,
wxFormatString::Arg_Char | wxFormatString::Arg_Int );
// FIXME-UTF8: which one is better default in absence of fmt string
// (i.e. when used like e.g. Foo("foo", "bar", 'c', NULL)?
if ( !fmt || fmt->GetArgumentType(index) == wxFormatString::Arg_Char )
m_value = wx_truncate_cast(T, wxUniChar(value).GetValue());
else
m_value = value;
}
int get() const { return m_value; }
T m_value;
};
template<>
struct wxArgNormalizer<char> : public wxArgNormalizerNarrowChar<char>
{
wxArgNormalizer(char value,
const wxFormatString *fmt, unsigned index)
: wxArgNormalizerNarrowChar<char>(value, fmt, index) {}
};
template<>
struct wxArgNormalizer<unsigned char>
: public wxArgNormalizerNarrowChar<unsigned char>
{
wxArgNormalizer(unsigned char value,
const wxFormatString *fmt, unsigned index)
: wxArgNormalizerNarrowChar<unsigned char>(value, fmt, index) {}
};
template<>
struct wxArgNormalizer<signed char>
: public wxArgNormalizerNarrowChar<signed char>
{
wxArgNormalizer(signed char value,
const wxFormatString *fmt, unsigned index)
: wxArgNormalizerNarrowChar<signed char>(value, fmt, index) {}
};
#endif // wxUSE_UNICODE
// convert references:
WX_ARG_NORMALIZER_FORWARD(wxUniChar, const wxUniChar&);
WX_ARG_NORMALIZER_FORWARD(const wxUniCharRef&, const wxUniChar&);
WX_ARG_NORMALIZER_FORWARD(wxUniCharRef, const wxUniChar&);
WX_ARG_NORMALIZER_FORWARD(const wchar_t&, wchar_t);
WX_ARG_NORMALIZER_FORWARD(const char&, char);
WX_ARG_NORMALIZER_FORWARD(const unsigned char&, unsigned char);
WX_ARG_NORMALIZER_FORWARD(const signed char&, signed char);
#undef WX_ARG_NORMALIZER_FORWARD
#undef _WX_ARG_NORMALIZER_FORWARD_IMPL
// NB: Don't #undef wxASSERT_ARG_TYPE here as it's also used in wx/longlong.h.
// ----------------------------------------------------------------------------
// WX_VA_ARG_STRING
// ----------------------------------------------------------------------------
// Replacement for va_arg() for use with strings in functions that accept
// strings normalized by wxArgNormalizer<T>:
struct WXDLLIMPEXP_BASE wxArgNormalizedString
{
wxArgNormalizedString(const void* ptr) : m_ptr(ptr) {}
// returns true if non-NULL string was passed in
bool IsValid() const { return m_ptr != NULL; }
operator bool() const { return IsValid(); }
// extracts the string, returns empty string if NULL was passed in
wxString GetString() const;
operator wxString() const;
private:
const void *m_ptr;
};
#define WX_VA_ARG_STRING(ap) wxArgNormalizedString(va_arg(ap, const void*))
// ----------------------------------------------------------------------------
// implementation of the WX_DEFINE_VARARG_* macros
// ----------------------------------------------------------------------------
// NB: The vararg emulation code is limited to 30 variadic and 4 fixed
// arguments at the moment.
// If you need more variadic arguments, you need to
// 1) increase the value of _WX_VARARG_MAX_ARGS
// 2) add _WX_VARARG_JOIN_* and _WX_VARARG_ITER_* up to the new
// _WX_VARARG_MAX_ARGS value to the lists below
// If you need more fixed arguments, you need to
// 1) increase the value of _WX_VARARG_MAX_FIXED_ARGS
// 2) add _WX_VARARG_FIXED_EXPAND_* and _WX_VARARG_FIXED_UNUSED_EXPAND_*
// macros below
#define _WX_VARARG_MAX_ARGS 30
#define _WX_VARARG_MAX_FIXED_ARGS 4
#define _WX_VARARG_JOIN_1(m) m(1)
#define _WX_VARARG_JOIN_2(m) _WX_VARARG_JOIN_1(m), m(2)
#define _WX_VARARG_JOIN_3(m) _WX_VARARG_JOIN_2(m), m(3)
#define _WX_VARARG_JOIN_4(m) _WX_VARARG_JOIN_3(m), m(4)
#define _WX_VARARG_JOIN_5(m) _WX_VARARG_JOIN_4(m), m(5)
#define _WX_VARARG_JOIN_6(m) _WX_VARARG_JOIN_5(m), m(6)
#define _WX_VARARG_JOIN_7(m) _WX_VARARG_JOIN_6(m), m(7)
#define _WX_VARARG_JOIN_8(m) _WX_VARARG_JOIN_7(m), m(8)
#define _WX_VARARG_JOIN_9(m) _WX_VARARG_JOIN_8(m), m(9)
#define _WX_VARARG_JOIN_10(m) _WX_VARARG_JOIN_9(m), m(10)
#define _WX_VARARG_JOIN_11(m) _WX_VARARG_JOIN_10(m), m(11)
#define _WX_VARARG_JOIN_12(m) _WX_VARARG_JOIN_11(m), m(12)
#define _WX_VARARG_JOIN_13(m) _WX_VARARG_JOIN_12(m), m(13)
#define _WX_VARARG_JOIN_14(m) _WX_VARARG_JOIN_13(m), m(14)
#define _WX_VARARG_JOIN_15(m) _WX_VARARG_JOIN_14(m), m(15)
#define _WX_VARARG_JOIN_16(m) _WX_VARARG_JOIN_15(m), m(16)
#define _WX_VARARG_JOIN_17(m) _WX_VARARG_JOIN_16(m), m(17)
#define _WX_VARARG_JOIN_18(m) _WX_VARARG_JOIN_17(m), m(18)
#define _WX_VARARG_JOIN_19(m) _WX_VARARG_JOIN_18(m), m(19)
#define _WX_VARARG_JOIN_20(m) _WX_VARARG_JOIN_19(m), m(20)
#define _WX_VARARG_JOIN_21(m) _WX_VARARG_JOIN_20(m), m(21)
#define _WX_VARARG_JOIN_22(m) _WX_VARARG_JOIN_21(m), m(22)
#define _WX_VARARG_JOIN_23(m) _WX_VARARG_JOIN_22(m), m(23)
#define _WX_VARARG_JOIN_24(m) _WX_VARARG_JOIN_23(m), m(24)
#define _WX_VARARG_JOIN_25(m) _WX_VARARG_JOIN_24(m), m(25)
#define _WX_VARARG_JOIN_26(m) _WX_VARARG_JOIN_25(m), m(26)
#define _WX_VARARG_JOIN_27(m) _WX_VARARG_JOIN_26(m), m(27)
#define _WX_VARARG_JOIN_28(m) _WX_VARARG_JOIN_27(m), m(28)
#define _WX_VARARG_JOIN_29(m) _WX_VARARG_JOIN_28(m), m(29)
#define _WX_VARARG_JOIN_30(m) _WX_VARARG_JOIN_29(m), m(30)
#define _WX_VARARG_ITER_1(m,a,b,c,d,e,f) m(1,a,b,c,d,e,f)
#define _WX_VARARG_ITER_2(m,a,b,c,d,e,f) _WX_VARARG_ITER_1(m,a,b,c,d,e,f) m(2,a,b,c,d,e,f)
#define _WX_VARARG_ITER_3(m,a,b,c,d,e,f) _WX_VARARG_ITER_2(m,a,b,c,d,e,f) m(3,a,b,c,d,e,f)
#define _WX_VARARG_ITER_4(m,a,b,c,d,e,f) _WX_VARARG_ITER_3(m,a,b,c,d,e,f) m(4,a,b,c,d,e,f)
#define _WX_VARARG_ITER_5(m,a,b,c,d,e,f) _WX_VARARG_ITER_4(m,a,b,c,d,e,f) m(5,a,b,c,d,e,f)
#define _WX_VARARG_ITER_6(m,a,b,c,d,e,f) _WX_VARARG_ITER_5(m,a,b,c,d,e,f) m(6,a,b,c,d,e,f)
#define _WX_VARARG_ITER_7(m,a,b,c,d,e,f) _WX_VARARG_ITER_6(m,a,b,c,d,e,f) m(7,a,b,c,d,e,f)
#define _WX_VARARG_ITER_8(m,a,b,c,d,e,f) _WX_VARARG_ITER_7(m,a,b,c,d,e,f) m(8,a,b,c,d,e,f)
#define _WX_VARARG_ITER_9(m,a,b,c,d,e,f) _WX_VARARG_ITER_8(m,a,b,c,d,e,f) m(9,a,b,c,d,e,f)
#define _WX_VARARG_ITER_10(m,a,b,c,d,e,f) _WX_VARARG_ITER_9(m,a,b,c,d,e,f) m(10,a,b,c,d,e,f)
#define _WX_VARARG_ITER_11(m,a,b,c,d,e,f) _WX_VARARG_ITER_10(m,a,b,c,d,e,f) m(11,a,b,c,d,e,f)
#define _WX_VARARG_ITER_12(m,a,b,c,d,e,f) _WX_VARARG_ITER_11(m,a,b,c,d,e,f) m(12,a,b,c,d,e,f)
#define _WX_VARARG_ITER_13(m,a,b,c,d,e,f) _WX_VARARG_ITER_12(m,a,b,c,d,e,f) m(13,a,b,c,d,e,f)
#define _WX_VARARG_ITER_14(m,a,b,c,d,e,f) _WX_VARARG_ITER_13(m,a,b,c,d,e,f) m(14,a,b,c,d,e,f)
#define _WX_VARARG_ITER_15(m,a,b,c,d,e,f) _WX_VARARG_ITER_14(m,a,b,c,d,e,f) m(15,a,b,c,d,e,f)
#define _WX_VARARG_ITER_16(m,a,b,c,d,e,f) _WX_VARARG_ITER_15(m,a,b,c,d,e,f) m(16,a,b,c,d,e,f)
#define _WX_VARARG_ITER_17(m,a,b,c,d,e,f) _WX_VARARG_ITER_16(m,a,b,c,d,e,f) m(17,a,b,c,d,e,f)
#define _WX_VARARG_ITER_18(m,a,b,c,d,e,f) _WX_VARARG_ITER_17(m,a,b,c,d,e,f) m(18,a,b,c,d,e,f)
#define _WX_VARARG_ITER_19(m,a,b,c,d,e,f) _WX_VARARG_ITER_18(m,a,b,c,d,e,f) m(19,a,b,c,d,e,f)
#define _WX_VARARG_ITER_20(m,a,b,c,d,e,f) _WX_VARARG_ITER_19(m,a,b,c,d,e,f) m(20,a,b,c,d,e,f)
#define _WX_VARARG_ITER_21(m,a,b,c,d,e,f) _WX_VARARG_ITER_20(m,a,b,c,d,e,f) m(21,a,b,c,d,e,f)
#define _WX_VARARG_ITER_22(m,a,b,c,d,e,f) _WX_VARARG_ITER_21(m,a,b,c,d,e,f) m(22,a,b,c,d,e,f)
#define _WX_VARARG_ITER_23(m,a,b,c,d,e,f) _WX_VARARG_ITER_22(m,a,b,c,d,e,f) m(23,a,b,c,d,e,f)
#define _WX_VARARG_ITER_24(m,a,b,c,d,e,f) _WX_VARARG_ITER_23(m,a,b,c,d,e,f) m(24,a,b,c,d,e,f)
#define _WX_VARARG_ITER_25(m,a,b,c,d,e,f) _WX_VARARG_ITER_24(m,a,b,c,d,e,f) m(25,a,b,c,d,e,f)
#define _WX_VARARG_ITER_26(m,a,b,c,d,e,f) _WX_VARARG_ITER_25(m,a,b,c,d,e,f) m(26,a,b,c,d,e,f)
#define _WX_VARARG_ITER_27(m,a,b,c,d,e,f) _WX_VARARG_ITER_26(m,a,b,c,d,e,f) m(27,a,b,c,d,e,f)
#define _WX_VARARG_ITER_28(m,a,b,c,d,e,f) _WX_VARARG_ITER_27(m,a,b,c,d,e,f) m(28,a,b,c,d,e,f)
#define _WX_VARARG_ITER_29(m,a,b,c,d,e,f) _WX_VARARG_ITER_28(m,a,b,c,d,e,f) m(29,a,b,c,d,e,f)
#define _WX_VARARG_ITER_30(m,a,b,c,d,e,f) _WX_VARARG_ITER_29(m,a,b,c,d,e,f) m(30,a,b,c,d,e,f)
#define _WX_VARARG_FIXED_EXPAND_1(t1) \
t1 f1
#define _WX_VARARG_FIXED_EXPAND_2(t1,t2) \
t1 f1, t2 f2
#define _WX_VARARG_FIXED_EXPAND_3(t1,t2,t3) \
t1 f1, t2 f2, t3 f3
#define _WX_VARARG_FIXED_EXPAND_4(t1,t2,t3,t4) \
t1 f1, t2 f2, t3 f3, t4 f4
#define _WX_VARARG_FIXED_UNUSED_EXPAND_1(t1) \
t1 WXUNUSED(f1)
#define _WX_VARARG_FIXED_UNUSED_EXPAND_2(t1,t2) \
t1 WXUNUSED(f1), t2 WXUNUSED(f2)
#define _WX_VARARG_FIXED_UNUSED_EXPAND_3(t1,t2,t3) \
t1 WXUNUSED(f1), t2 WXUNUSED(f2), t3 WXUNUSED(f3)
#define _WX_VARARG_FIXED_UNUSED_EXPAND_4(t1,t2,t3,t4) \
t1 WXUNUSED(f1), t2 WXUNUSED(f2), t3 WXUNUSED(f3), t4 WXUNUSED(f4)
#define _WX_VARARG_FIXED_TYPEDEFS_1(t1) \
typedef t1 TF1
#define _WX_VARARG_FIXED_TYPEDEFS_2(t1,t2) \
_WX_VARARG_FIXED_TYPEDEFS_1(t1); typedef t2 TF2
#define _WX_VARARG_FIXED_TYPEDEFS_3(t1,t2,t3) \
_WX_VARARG_FIXED_TYPEDEFS_2(t1,t2); typedef t3 TF3
#define _WX_VARARG_FIXED_TYPEDEFS_4(t1,t2,t3,t4) \
_WX_VARARG_FIXED_TYPEDEFS_3(t1,t2,t3); typedef t4 TF4
// This macro expands N-items tuple of fixed arguments types into part of
// function's declaration. For example,
// "_WX_VARARG_FIXED_EXPAND(3, (int, char*, int))" expands into
// "int f1, char* f2, int f3".
#define _WX_VARARG_FIXED_EXPAND(N, args) \
_WX_VARARG_FIXED_EXPAND_IMPL(N, args)
#define _WX_VARARG_FIXED_EXPAND_IMPL(N, args) \
_WX_VARARG_FIXED_EXPAND_##N args
// Ditto for unused arguments
#define _WX_VARARG_FIXED_UNUSED_EXPAND(N, args) \
_WX_VARARG_FIXED_UNUSED_EXPAND_IMPL(N, args)
#define _WX_VARARG_FIXED_UNUSED_EXPAND_IMPL(N, args) \
_WX_VARARG_FIXED_UNUSED_EXPAND_##N args
// Declarates typedefs for fixed arguments types; i-th fixed argument types
// will have TFi typedef.
#define _WX_VARARG_FIXED_TYPEDEFS(N, args) \
_WX_VARARG_FIXED_TYPEDEFS_IMPL(N, args)
#define _WX_VARARG_FIXED_TYPEDEFS_IMPL(N, args) \
_WX_VARARG_FIXED_TYPEDEFS_##N args
// This macro calls another macro 'm' passed as second argument 'N' times,
// with its only argument set to 1..N, and concatenates the results using
// comma as separator.
//
// An example:
// #define foo(i) x##i
// // this expands to "x1,x2,x3,x4"
// _WX_VARARG_JOIN(4, foo)
//
//
// N must not be greater than _WX_VARARG_MAX_ARGS (=30).
#define _WX_VARARG_JOIN(N, m) _WX_VARARG_JOIN_IMPL(N, m)
#define _WX_VARARG_JOIN_IMPL(N, m) _WX_VARARG_JOIN_##N(m)
// This macro calls another macro 'm' passed as second argument 'N' times, with
// its first argument set to 1..N and the remaining arguments set to 'a', 'b',
// 'c', 'd', 'e' and 'f'. The results are separated with whitespace in the
// expansion.
//
// An example:
// // this macro expands to:
// // foo(1,a,b,c,d,e,f)
// // foo(2,a,b,c,d,e,f)
// // foo(3,a,b,c,d,e,f)
// _WX_VARARG_ITER(3, foo, a, b, c, d, e, f)
//
// N must not be greater than _WX_VARARG_MAX_ARGS (=30).
#define _WX_VARARG_ITER(N,m,a,b,c,d,e,f) \
_WX_VARARG_ITER_IMPL(N,m,a,b,c,d,e,f)
#define _WX_VARARG_ITER_IMPL(N,m,a,b,c,d,e,f) \
_WX_VARARG_ITER_##N(m,a,b,c,d,e,f)
// Generates code snippet for i-th "variadic" argument in vararg function's
// prototype:
#define _WX_VARARG_ARG(i) T##i a##i
// Like _WX_VARARG_ARG_UNUSED, but outputs argument's type with WXUNUSED:
#define _WX_VARARG_ARG_UNUSED(i) T##i WXUNUSED(a##i)
// Generates code snippet for i-th type in vararg function's template<...>:
#define _WX_VARARG_TEMPL(i) typename T##i
// Generates code snippet for passing i-th argument of vararg function
// wrapper to its implementation, normalizing it in the process:
#define _WX_VARARG_PASS_WCHAR(i) \
wxArgNormalizerWchar<T##i>(a##i, fmt, i).get()
#define _WX_VARARG_PASS_UTF8(i) \
wxArgNormalizerUtf8<T##i>(a##i, fmt, i).get()
// And the same for fixed arguments, _not_ normalizing it:
#define _WX_VARARG_PASS_FIXED(i) f##i
#define _WX_VARARG_FIND_FMT(i) \
(wxFormatStringArgumentFinder<TF##i>::find(f##i))
#define _WX_VARARG_FORMAT_STRING(numfixed, fixed) \
_WX_VARARG_FIXED_TYPEDEFS(numfixed, fixed); \
const wxFormatString *fmt = \
(_WX_VARARG_JOIN(numfixed, _WX_VARARG_FIND_FMT))
#if wxUSE_UNICODE_UTF8
#define _WX_VARARG_DO_CALL_UTF8(return_kw, impl, implUtf8, N, numfixed) \
return_kw implUtf8(_WX_VARARG_JOIN(numfixed, _WX_VARARG_PASS_FIXED), \
_WX_VARARG_JOIN(N, _WX_VARARG_PASS_UTF8))
#define _WX_VARARG_DO_CALL0_UTF8(return_kw, impl, implUtf8, numfixed) \
return_kw implUtf8(_WX_VARARG_JOIN(numfixed, _WX_VARARG_PASS_FIXED))
#endif // wxUSE_UNICODE_UTF8
#define _WX_VARARG_DO_CALL_WCHAR(return_kw, impl, implUtf8, N, numfixed) \
return_kw impl(_WX_VARARG_JOIN(numfixed, _WX_VARARG_PASS_FIXED), \
_WX_VARARG_JOIN(N, _WX_VARARG_PASS_WCHAR))
#define _WX_VARARG_DO_CALL0_WCHAR(return_kw, impl, implUtf8, numfixed) \
return_kw impl(_WX_VARARG_JOIN(numfixed, _WX_VARARG_PASS_FIXED))
#if wxUSE_UNICODE_UTF8
#if wxUSE_UTF8_LOCALE_ONLY
#define _WX_VARARG_DO_CALL _WX_VARARG_DO_CALL_UTF8
#define _WX_VARARG_DO_CALL0 _WX_VARARG_DO_CALL0_UTF8
#else // possibly non-UTF8 locales
#define _WX_VARARG_DO_CALL(return_kw, impl, implUtf8, N, numfixed) \
if ( wxLocaleIsUtf8 ) \
_WX_VARARG_DO_CALL_UTF8(return_kw, impl, implUtf8, N, numfixed);\
else \
_WX_VARARG_DO_CALL_WCHAR(return_kw, impl, implUtf8, N, numfixed)
#define _WX_VARARG_DO_CALL0(return_kw, impl, implUtf8, numfixed) \
if ( wxLocaleIsUtf8 ) \
_WX_VARARG_DO_CALL0_UTF8(return_kw, impl, implUtf8, numfixed); \
else \
_WX_VARARG_DO_CALL0_WCHAR(return_kw, impl, implUtf8, numfixed)
#endif // wxUSE_UTF8_LOCALE_ONLY or not
#else // wxUSE_UNICODE_WCHAR or ANSI
#define _WX_VARARG_DO_CALL _WX_VARARG_DO_CALL_WCHAR
#define _WX_VARARG_DO_CALL0 _WX_VARARG_DO_CALL0_WCHAR
#endif // wxUSE_UNICODE_UTF8 / wxUSE_UNICODE_WCHAR
// Macro to be used with _WX_VARARG_ITER in the implementation of
// WX_DEFINE_VARARG_FUNC (see its documentation for the meaning of arguments)
#define _WX_VARARG_DEFINE_FUNC(N, rettype, name, \
impl, implUtf8, numfixed, fixed) \
template<_WX_VARARG_JOIN(N, _WX_VARARG_TEMPL)> \
rettype name(_WX_VARARG_FIXED_EXPAND(numfixed, fixed), \
_WX_VARARG_JOIN(N, _WX_VARARG_ARG)) \
{ \
_WX_VARARG_FORMAT_STRING(numfixed, fixed); \
_WX_VARARG_DO_CALL(return, impl, implUtf8, N, numfixed); \
}
#define _WX_VARARG_DEFINE_FUNC_N0(rettype, name, \
impl, implUtf8, numfixed, fixed) \
inline rettype name(_WX_VARARG_FIXED_EXPAND(numfixed, fixed)) \
{ \
_WX_VARARG_DO_CALL0(return, impl, implUtf8, numfixed); \
}
// Macro to be used with _WX_VARARG_ITER in the implementation of
// WX_DEFINE_VARARG_FUNC_VOID (see its documentation for the meaning of
// arguments; rettype is ignored and is used only to satisfy _WX_VARARG_ITER's
// requirements).
#define _WX_VARARG_DEFINE_FUNC_VOID(N, rettype, name, \
impl, implUtf8, numfixed, fixed) \
template<_WX_VARARG_JOIN(N, _WX_VARARG_TEMPL)> \
void name(_WX_VARARG_FIXED_EXPAND(numfixed, fixed), \
_WX_VARARG_JOIN(N, _WX_VARARG_ARG)) \
{ \
_WX_VARARG_FORMAT_STRING(numfixed, fixed); \
_WX_VARARG_DO_CALL(wxEMPTY_PARAMETER_VALUE, \
impl, implUtf8, N, numfixed); \
}
#define _WX_VARARG_DEFINE_FUNC_VOID_N0(name, impl, implUtf8, numfixed, fixed) \
inline void name(_WX_VARARG_FIXED_EXPAND(numfixed, fixed)) \
{ \
_WX_VARARG_DO_CALL0(wxEMPTY_PARAMETER_VALUE, \
impl, implUtf8, numfixed); \
}
// Macro to be used with _WX_VARARG_ITER in the implementation of
// WX_DEFINE_VARARG_FUNC_CTOR (see its documentation for the meaning of
// arguments; rettype is ignored and is used only to satisfy _WX_VARARG_ITER's
// requirements).
#define _WX_VARARG_DEFINE_FUNC_CTOR(N, rettype, name, \
impl, implUtf8, numfixed, fixed) \
template<_WX_VARARG_JOIN(N, _WX_VARARG_TEMPL)> \
name(_WX_VARARG_FIXED_EXPAND(numfixed, fixed), \
_WX_VARARG_JOIN(N, _WX_VARARG_ARG)) \
{ \
_WX_VARARG_FORMAT_STRING(numfixed, fixed); \
_WX_VARARG_DO_CALL(wxEMPTY_PARAMETER_VALUE, \
impl, implUtf8, N, numfixed); \
}
#define _WX_VARARG_DEFINE_FUNC_CTOR_N0(name, impl, implUtf8, numfixed, fixed) \
inline name(_WX_VARARG_FIXED_EXPAND(numfixed, fixed)) \
{ \
_WX_VARARG_DO_CALL0(wxEMPTY_PARAMETER_VALUE, \
impl, implUtf8, numfixed); \
}
// Macro to be used with _WX_VARARG_ITER in the implementation of
// WX_DEFINE_VARARG_FUNC_NOP, i.e. empty stub for a disabled vararg function.
// The rettype and impl arguments are ignored.
#define _WX_VARARG_DEFINE_FUNC_NOP(N, rettype, name, \
impl, implUtf8, numfixed, fixed) \
template<_WX_VARARG_JOIN(N, _WX_VARARG_TEMPL)> \
void name(_WX_VARARG_FIXED_UNUSED_EXPAND(numfixed, fixed), \
_WX_VARARG_JOIN(N, _WX_VARARG_ARG_UNUSED)) \
{}
#define _WX_VARARG_DEFINE_FUNC_NOP_N0(name, numfixed, fixed) \
inline void name(_WX_VARARG_FIXED_UNUSED_EXPAND(numfixed, fixed)) \
{}
#endif // _WX_STRVARARG_H_
| h |
rticonnextdds-usecases | data/projects/rticonnextdds-usecases/VehicleTracking/ExampleCode/thirdparty/wxWidgets-3.1.2/Linux/include/wx/artprov.h | /////////////////////////////////////////////////////////////////////////////
// Name: wx/artprov.h
// Purpose: wxArtProvider class
// Author: Vaclav Slavik
// Modified by:
// Created: 18/03/2002
// Copyright: (c) Vaclav Slavik
// Licence: wxWindows licence
/////////////////////////////////////////////////////////////////////////////
#ifndef _WX_ARTPROV_H_
#define _WX_ARTPROV_H_
#include "wx/string.h"
#include "wx/bitmap.h"
#include "wx/icon.h"
#include "wx/iconbndl.h"
class WXDLLIMPEXP_FWD_CORE wxArtProvidersList;
class WXDLLIMPEXP_FWD_CORE wxArtProviderCache;
class wxArtProviderModule;
// ----------------------------------------------------------------------------
// Types
// ----------------------------------------------------------------------------
typedef wxString wxArtClient;
typedef wxString wxArtID;
#define wxART_MAKE_CLIENT_ID_FROM_STR(id) ((id) + "_C")
#define wxART_MAKE_CLIENT_ID(id) (#id "_C")
#define wxART_MAKE_ART_ID_FROM_STR(id) (id)
#define wxART_MAKE_ART_ID(id) (#id)
// ----------------------------------------------------------------------------
// Art clients
// ----------------------------------------------------------------------------
#define wxART_TOOLBAR wxART_MAKE_CLIENT_ID(wxART_TOOLBAR)
#define wxART_MENU wxART_MAKE_CLIENT_ID(wxART_MENU)
#define wxART_FRAME_ICON wxART_MAKE_CLIENT_ID(wxART_FRAME_ICON)
#define wxART_CMN_DIALOG wxART_MAKE_CLIENT_ID(wxART_CMN_DIALOG)
#define wxART_HELP_BROWSER wxART_MAKE_CLIENT_ID(wxART_HELP_BROWSER)
#define wxART_MESSAGE_BOX wxART_MAKE_CLIENT_ID(wxART_MESSAGE_BOX)
#define wxART_BUTTON wxART_MAKE_CLIENT_ID(wxART_BUTTON)
#define wxART_LIST wxART_MAKE_CLIENT_ID(wxART_LIST)
#define wxART_OTHER wxART_MAKE_CLIENT_ID(wxART_OTHER)
// ----------------------------------------------------------------------------
// Art IDs
// ----------------------------------------------------------------------------
#define wxART_ADD_BOOKMARK wxART_MAKE_ART_ID(wxART_ADD_BOOKMARK)
#define wxART_DEL_BOOKMARK wxART_MAKE_ART_ID(wxART_DEL_BOOKMARK)
#define wxART_HELP_SIDE_PANEL wxART_MAKE_ART_ID(wxART_HELP_SIDE_PANEL)
#define wxART_HELP_SETTINGS wxART_MAKE_ART_ID(wxART_HELP_SETTINGS)
#define wxART_HELP_BOOK wxART_MAKE_ART_ID(wxART_HELP_BOOK)
#define wxART_HELP_FOLDER wxART_MAKE_ART_ID(wxART_HELP_FOLDER)
#define wxART_HELP_PAGE wxART_MAKE_ART_ID(wxART_HELP_PAGE)
#define wxART_GO_BACK wxART_MAKE_ART_ID(wxART_GO_BACK)
#define wxART_GO_FORWARD wxART_MAKE_ART_ID(wxART_GO_FORWARD)
#define wxART_GO_UP wxART_MAKE_ART_ID(wxART_GO_UP)
#define wxART_GO_DOWN wxART_MAKE_ART_ID(wxART_GO_DOWN)
#define wxART_GO_TO_PARENT wxART_MAKE_ART_ID(wxART_GO_TO_PARENT)
#define wxART_GO_HOME wxART_MAKE_ART_ID(wxART_GO_HOME)
#define wxART_GOTO_FIRST wxART_MAKE_ART_ID(wxART_GOTO_FIRST)
#define wxART_GOTO_LAST wxART_MAKE_ART_ID(wxART_GOTO_LAST)
#define wxART_FILE_OPEN wxART_MAKE_ART_ID(wxART_FILE_OPEN)
#define wxART_FILE_SAVE wxART_MAKE_ART_ID(wxART_FILE_SAVE)
#define wxART_FILE_SAVE_AS wxART_MAKE_ART_ID(wxART_FILE_SAVE_AS)
#define wxART_PRINT wxART_MAKE_ART_ID(wxART_PRINT)
#define wxART_HELP wxART_MAKE_ART_ID(wxART_HELP)
#define wxART_TIP wxART_MAKE_ART_ID(wxART_TIP)
#define wxART_REPORT_VIEW wxART_MAKE_ART_ID(wxART_REPORT_VIEW)
#define wxART_LIST_VIEW wxART_MAKE_ART_ID(wxART_LIST_VIEW)
#define wxART_NEW_DIR wxART_MAKE_ART_ID(wxART_NEW_DIR)
#define wxART_HARDDISK wxART_MAKE_ART_ID(wxART_HARDDISK)
#define wxART_FLOPPY wxART_MAKE_ART_ID(wxART_FLOPPY)
#define wxART_CDROM wxART_MAKE_ART_ID(wxART_CDROM)
#define wxART_REMOVABLE wxART_MAKE_ART_ID(wxART_REMOVABLE)
#define wxART_FOLDER wxART_MAKE_ART_ID(wxART_FOLDER)
#define wxART_FOLDER_OPEN wxART_MAKE_ART_ID(wxART_FOLDER_OPEN)
#define wxART_GO_DIR_UP wxART_MAKE_ART_ID(wxART_GO_DIR_UP)
#define wxART_EXECUTABLE_FILE wxART_MAKE_ART_ID(wxART_EXECUTABLE_FILE)
#define wxART_NORMAL_FILE wxART_MAKE_ART_ID(wxART_NORMAL_FILE)
#define wxART_TICK_MARK wxART_MAKE_ART_ID(wxART_TICK_MARK)
#define wxART_CROSS_MARK wxART_MAKE_ART_ID(wxART_CROSS_MARK)
#define wxART_ERROR wxART_MAKE_ART_ID(wxART_ERROR)
#define wxART_QUESTION wxART_MAKE_ART_ID(wxART_QUESTION)
#define wxART_WARNING wxART_MAKE_ART_ID(wxART_WARNING)
#define wxART_INFORMATION wxART_MAKE_ART_ID(wxART_INFORMATION)
#define wxART_MISSING_IMAGE wxART_MAKE_ART_ID(wxART_MISSING_IMAGE)
#define wxART_COPY wxART_MAKE_ART_ID(wxART_COPY)
#define wxART_CUT wxART_MAKE_ART_ID(wxART_CUT)
#define wxART_PASTE wxART_MAKE_ART_ID(wxART_PASTE)
#define wxART_DELETE wxART_MAKE_ART_ID(wxART_DELETE)
#define wxART_NEW wxART_MAKE_ART_ID(wxART_NEW)
#define wxART_UNDO wxART_MAKE_ART_ID(wxART_UNDO)
#define wxART_REDO wxART_MAKE_ART_ID(wxART_REDO)
#define wxART_PLUS wxART_MAKE_ART_ID(wxART_PLUS)
#define wxART_MINUS wxART_MAKE_ART_ID(wxART_MINUS)
#define wxART_CLOSE wxART_MAKE_ART_ID(wxART_CLOSE)
#define wxART_QUIT wxART_MAKE_ART_ID(wxART_QUIT)
#define wxART_FIND wxART_MAKE_ART_ID(wxART_FIND)
#define wxART_FIND_AND_REPLACE wxART_MAKE_ART_ID(wxART_FIND_AND_REPLACE)
#define wxART_FULL_SCREEN wxART_MAKE_ART_ID(wxART_FULL_SCREEN)
#define wxART_EDIT wxART_MAKE_ART_ID(wxART_EDIT)
// ----------------------------------------------------------------------------
// wxArtProvider class
// ----------------------------------------------------------------------------
class WXDLLIMPEXP_CORE wxArtProvider : public wxObject
{
public:
// Dtor removes the provider from providers stack if it's still on it
virtual ~wxArtProvider();
// Does this platform implement native icons theme?
static bool HasNativeProvider();
// Add new provider to the top of providers stack (i.e. the provider will
// be queried first of all).
static void Push(wxArtProvider *provider);
// Add new provider to the bottom of providers stack (i.e. the provider
// will be queried as the last one).
static void PushBack(wxArtProvider *provider);
#if WXWIN_COMPATIBILITY_2_8
// use PushBack(), it's the same thing
static wxDEPRECATED( void Insert(wxArtProvider *provider) );
#endif
// Remove latest added provider and delete it.
static bool Pop();
// Remove provider from providers stack but don't delete it.
static bool Remove(wxArtProvider *provider);
// Delete the given provider and remove it from the providers stack.
static bool Delete(wxArtProvider *provider);
// Query the providers for bitmap with given ID and return it. Return
// wxNullBitmap if no provider provides it.
static wxBitmap GetBitmap(const wxArtID& id,
const wxArtClient& client = wxART_OTHER,
const wxSize& size = wxDefaultSize);
// Query the providers for icon with given ID and return it. Return
// wxNullIcon if no provider provides it.
static wxIcon GetIcon(const wxArtID& id,
const wxArtClient& client = wxART_OTHER,
const wxSize& size = wxDefaultSize);
// Helper used by GetMessageBoxIcon(): return the art id corresponding to
// the standard wxICON_INFORMATION/WARNING/ERROR/QUESTION flags (only one
// can be set)
static wxArtID GetMessageBoxIconId(int flags);
// Helper used by several generic classes: return the icon corresponding to
// the standard wxICON_INFORMATION/WARNING/ERROR/QUESTION flags (only one
// can be set)
static wxIcon GetMessageBoxIcon(int flags)
{
return GetIcon(GetMessageBoxIconId(flags), wxART_MESSAGE_BOX);
}
// Query the providers for iconbundle with given ID and return it. Return
// wxNullIconBundle if no provider provides it.
static wxIconBundle GetIconBundle(const wxArtID& id,
const wxArtClient& client = wxART_OTHER);
// Gets native size for given 'client' or wxDefaultSize if it doesn't
// have native equivalent
static wxSize GetNativeSizeHint(const wxArtClient& client);
// Get the size hint of an icon from a specific wxArtClient, queries
// the topmost provider if platform_dependent = false
static wxSize GetSizeHint(const wxArtClient& client, bool platform_dependent = false);
// Rescale bitmap (used internally if requested size is other than the available).
static void RescaleBitmap(wxBitmap& bmp, const wxSize& sizeNeeded);
protected:
friend class wxArtProviderModule;
#if wxUSE_ARTPROVIDER_STD
// Initializes default provider
static void InitStdProvider();
#endif // wxUSE_ARTPROVIDER_STD
// Initializes Tango-based icon provider
#if wxUSE_ARTPROVIDER_TANGO
static void InitTangoProvider();
#endif // wxUSE_ARTPROVIDER_TANGO
// Initializes platform's native provider, if available (e.g. GTK2)
static void InitNativeProvider();
// Destroy caches & all providers
static void CleanUpProviders();
// Get the default size of an icon for a specific client
virtual wxSize DoGetSizeHint(const wxArtClient& client)
{
return GetSizeHint(client, true);
}
// Derived classes must override CreateBitmap or CreateIconBundle
// (or both) to create requested art resource. This method is called
// only once per instance's lifetime for each requested wxArtID.
virtual wxBitmap CreateBitmap(const wxArtID& WXUNUSED(id),
const wxArtClient& WXUNUSED(client),
const wxSize& WXUNUSED(size))
{
return wxNullBitmap;
}
virtual wxIconBundle CreateIconBundle(const wxArtID& WXUNUSED(id),
const wxArtClient& WXUNUSED(client))
{
return wxNullIconBundle;
}
private:
static void CommonAddingProvider();
static wxIconBundle DoGetIconBundle(const wxArtID& id,
const wxArtClient& client);
private:
// list of providers:
static wxArtProvidersList *sm_providers;
// art resources cache (so that CreateXXX is not called that often):
static wxArtProviderCache *sm_cache;
wxDECLARE_ABSTRACT_CLASS(wxArtProvider);
};
#if !defined(__WXUNIVERSAL__) && \
((defined(__WXGTK__) && defined(__WXGTK20__)) || defined(__WXMSW__) || \
defined(__WXMAC__))
// *some* (partial) native implementation of wxArtProvider exists; this is
// not the same as wxArtProvider::HasNativeProvider()!
#define wxHAS_NATIVE_ART_PROVIDER_IMPL
#endif
#endif // _WX_ARTPROV_H_
| h |
rticonnextdds-usecases | data/projects/rticonnextdds-usecases/VehicleTracking/ExampleCode/thirdparty/wxWidgets-3.1.2/Linux/include/wx/encconv.h | /////////////////////////////////////////////////////////////////////////////
// Name: wx/encconv.h
// Purpose: wxEncodingConverter class for converting between different
// font encodings
// Author: Vaclav Slavik
// Copyright: (c) 1999 Vaclav Slavik
// Licence: wxWindows licence
/////////////////////////////////////////////////////////////////////////////
#ifndef _WX_ENCCONV_H_
#define _WX_ENCCONV_H_
#include "wx/defs.h"
#include "wx/object.h"
#include "wx/fontenc.h"
#include "wx/dynarray.h"
// ----------------------------------------------------------------------------
// constants
// ----------------------------------------------------------------------------
enum
{
wxCONVERT_STRICT,
wxCONVERT_SUBSTITUTE
};
enum
{
wxPLATFORM_CURRENT = -1,
wxPLATFORM_UNIX = 0,
wxPLATFORM_WINDOWS,
wxPLATFORM_MAC
};
// ----------------------------------------------------------------------------
// types
// ----------------------------------------------------------------------------
WX_DEFINE_ARRAY_INT(wxFontEncoding, wxFontEncodingArray);
//--------------------------------------------------------------------------------
// wxEncodingConverter
// This class is capable of converting strings between any two
// 8bit encodings/charsets. It can also convert from/to Unicode
//--------------------------------------------------------------------------------
class WXDLLIMPEXP_BASE wxEncodingConverter : public wxObject
{
public:
wxEncodingConverter();
virtual ~wxEncodingConverter() { if (m_Table) delete[] m_Table; }
// Initialize conversion. Both output or input encoding may
// be wxFONTENCODING_UNICODE.
//
// All subsequent calls to Convert() will interpret it's argument
// as a string in input_enc encoding and will output string in
// output_enc encoding.
//
// You must call this method before calling Convert. You may call
// it more than once in order to switch to another conversion
//
// Method affects behaviour of Convert() in case input character
// cannot be converted because it does not exist in output encoding:
// wxCONVERT_STRICT --
// follow behaviour of GNU Recode - just copy unconvertable
// characters to output and don't change them (it's integer
// value will stay the same)
// wxCONVERT_SUBSTITUTE --
// try some (lossy) substitutions - e.g. replace
// unconvertable latin capitals with acute by ordinary
// capitals, replace en-dash or em-dash by '-' etc.
// both modes guarantee that output string will have same length
// as input string
//
// Returns false if given conversion is impossible, true otherwise
// (conversion may be impossible either if you try to convert
// to Unicode with non-Unicode build of wxWidgets or if input
// or output encoding is not supported.)
bool Init(wxFontEncoding input_enc, wxFontEncoding output_enc, int method = wxCONVERT_STRICT);
// Convert input string according to settings passed to Init.
// Note that you must call Init before using Convert!
bool Convert(const char* input, char* output) const;
bool Convert(char* str) const { return Convert(str, str); }
wxString Convert(const wxString& input) const;
bool Convert(const char* input, wchar_t* output) const;
bool Convert(const wchar_t* input, char* output) const;
bool Convert(const wchar_t* input, wchar_t* output) const;
bool Convert(wchar_t* str) const { return Convert(str, str); }
// Return equivalent(s) for given font that are used
// under given platform. wxPLATFORM_CURRENT means the plaform
// this binary was compiled for
//
// Examples:
// current platform enc returned value
// -----------------------------------------------------
// unix CP1250 {ISO8859_2}
// unix ISO8859_2 {}
// windows ISO8859_2 {CP1250}
//
// Equivalence is defined in terms of convertibility:
// 2 encodings are equivalent if you can convert text between
// then without losing information (it may - and will - happen
// that you lose special chars like quotation marks or em-dashes
// but you shouldn't lose any diacritics and language-specific
// characters when converting between equivalent encodings).
//
// Convert() method is not limited to converting between
// equivalent encodings, it can convert between arbitrary
// two encodings!
//
// Remember that this function does _NOT_ check for presence of
// fonts in system. It only tells you what are most suitable
// encodings. (It usually returns only one encoding)
//
// Note that argument enc itself may be present in returned array!
// (so that you can -- as a side effect -- detect whether the
// encoding is native for this platform or not)
static wxFontEncodingArray GetPlatformEquivalents(wxFontEncoding enc, int platform = wxPLATFORM_CURRENT);
// Similar to GetPlatformEquivalent, but this one will return ALL
// equivalent encodings, regardless the platform, including itself.
static wxFontEncodingArray GetAllEquivalents(wxFontEncoding enc);
// Return true if [any text in] one multibyte encoding can be
// converted to another one losslessly.
//
// Do not call this with wxFONTENCODING_UNICODE, it doesn't make
// sense (always works in one sense and always depends on the text
// to convert in the other)
static bool CanConvert(wxFontEncoding encIn, wxFontEncoding encOut)
{
return GetAllEquivalents(encIn).Index(encOut) != wxNOT_FOUND;
}
private:
wchar_t *m_Table;
bool m_UnicodeInput, m_UnicodeOutput;
bool m_JustCopy;
wxDECLARE_NO_COPY_CLASS(wxEncodingConverter);
};
#endif // _WX_ENCCONV_H_
| h |
rticonnextdds-usecases | data/projects/rticonnextdds-usecases/VehicleTracking/ExampleCode/thirdparty/wxWidgets-3.1.2/Linux/include/wx/glcanvas.h | /////////////////////////////////////////////////////////////////////////////
// Name: wx/glcanvas.h
// Purpose: wxGLCanvas base header
// Author: Julian Smart
// Modified by:
// Created:
// Copyright: (c) Julian Smart
// Licence: wxWindows licence
/////////////////////////////////////////////////////////////////////////////
#ifndef _WX_GLCANVAS_H_BASE_
#define _WX_GLCANVAS_H_BASE_
#include "wx/defs.h"
#if wxUSE_GLCANVAS
#include "wx/app.h"
#include "wx/palette.h"
#include "wx/window.h"
class WXDLLIMPEXP_FWD_GL wxGLCanvas;
class WXDLLIMPEXP_FWD_GL wxGLContext;
// ----------------------------------------------------------------------------
// Constants for attributes list
// ----------------------------------------------------------------------------
// Notice that not all implementation support options such as stereo, auxiliary
// buffers, alpha channel, and accumulator buffer, use IsDisplaySupported() to
// check for individual attributes support.
enum
{
WX_GL_RGBA = 1, // use true color palette (on if no attrs specified)
WX_GL_BUFFER_SIZE, // bits for buffer if not WX_GL_RGBA
WX_GL_LEVEL, // 0 for main buffer, >0 for overlay, <0 for underlay
WX_GL_DOUBLEBUFFER, // use double buffering (on if no attrs specified)
WX_GL_STEREO, // use stereoscopic display
WX_GL_AUX_BUFFERS, // number of auxiliary buffers
WX_GL_MIN_RED, // use red buffer with most bits (> MIN_RED bits)
WX_GL_MIN_GREEN, // use green buffer with most bits (> MIN_GREEN bits)
WX_GL_MIN_BLUE, // use blue buffer with most bits (> MIN_BLUE bits)
WX_GL_MIN_ALPHA, // use alpha buffer with most bits (> MIN_ALPHA bits)
WX_GL_DEPTH_SIZE, // bits for Z-buffer (0,16,32)
WX_GL_STENCIL_SIZE, // bits for stencil buffer
WX_GL_MIN_ACCUM_RED, // use red accum buffer with most bits (> MIN_ACCUM_RED bits)
WX_GL_MIN_ACCUM_GREEN, // use green buffer with most bits (> MIN_ACCUM_GREEN bits)
WX_GL_MIN_ACCUM_BLUE, // use blue buffer with most bits (> MIN_ACCUM_BLUE bits)
WX_GL_MIN_ACCUM_ALPHA, // use alpha buffer with most bits (> MIN_ACCUM_ALPHA bits)
WX_GL_SAMPLE_BUFFERS, // 1 for multisampling support (antialiasing)
WX_GL_SAMPLES, // 4 for 2x2 antialiasing supersampling on most graphics cards
WX_GL_FRAMEBUFFER_SRGB,// capability for sRGB framebuffer
// Context attributes
WX_GL_CORE_PROFILE, // use an OpenGL core profile
WX_GL_MAJOR_VERSION, // major OpenGL version of the core profile
WX_GL_MINOR_VERSION, // minor OpenGL version of the core profile
wx_GL_COMPAT_PROFILE, // use compatible profile (use all versions features)
WX_GL_FORWARD_COMPAT, // forward compatible context. OpenGL >= 3.0
WX_GL_ES2, // ES or ES2 context.
WX_GL_DEBUG, // create a debug context
WX_GL_ROBUST_ACCESS, // robustness.
WX_GL_NO_RESET_NOTIFY, // never deliver notification of reset events
WX_GL_LOSE_ON_RESET, // if graphics reset, all context state is lost
WX_GL_RESET_ISOLATION, // protect other apps or share contexts from reset side-effects
WX_GL_RELEASE_FLUSH, // on context release, flush pending commands
WX_GL_RELEASE_NONE // on context release, pending commands are not flushed
};
#define wxGLCanvasName wxT("GLCanvas")
// ----------------------------------------------------------------------------
// wxGLAttribsBase: OpenGL rendering attributes
// ----------------------------------------------------------------------------
class WXDLLIMPEXP_GL wxGLAttribsBase
{
public:
wxGLAttribsBase() { Reset(); }
// Setters
void AddAttribute(int attribute) { m_GLValues.push_back(attribute); }
// Search for searchVal and combine the next value with combineVal
void AddAttribBits(int searchVal, int combineVal);
// ARB functions necessity
void SetNeedsARB(bool needsARB = true) { m_needsARB = needsARB; }
// Delete contents
void Reset()
{
m_GLValues.clear();
m_needsARB = false;
}
// Accessors
const int* GetGLAttrs() const
{
return (m_GLValues.empty() || !m_GLValues[0]) ? NULL : &*m_GLValues.begin();
}
int GetSize() const { return (int)(m_GLValues.size()); }
// ARB function (e.g. wglCreateContextAttribsARB) is needed
bool NeedsARB() const { return m_needsARB; }
private:
wxVector<int> m_GLValues;
bool m_needsARB;
};
// ----------------------------------------------------------------------------
// wxGLContextAttrs: OpenGL rendering context attributes
// ----------------------------------------------------------------------------
class WXDLLIMPEXP_GL wxGLContextAttrs : public wxGLAttribsBase
{
public:
// Setters, allowing chained calls
wxGLContextAttrs& CoreProfile();
wxGLContextAttrs& MajorVersion(int val);
wxGLContextAttrs& MinorVersion(int val);
wxGLContextAttrs& OGLVersion(int vmayor, int vminor)
{ return MajorVersion(vmayor).MinorVersion(vminor); }
wxGLContextAttrs& CompatibilityProfile();
wxGLContextAttrs& ForwardCompatible();
wxGLContextAttrs& ES2();
wxGLContextAttrs& DebugCtx();
wxGLContextAttrs& Robust();
wxGLContextAttrs& NoResetNotify();
wxGLContextAttrs& LoseOnReset();
wxGLContextAttrs& ResetIsolation();
wxGLContextAttrs& ReleaseFlush(int val = 1); //'int' allows future values
wxGLContextAttrs& PlatformDefaults();
void EndList(); // No more values can be chained
// Currently only used for X11 context creation
bool x11Direct; // X11 direct render
bool renderTypeRGBA;
};
// ----------------------------------------------------------------------------
// wxGLAttributes: canvas configuration
// ----------------------------------------------------------------------------
class WXDLLIMPEXP_GL wxGLAttributes : public wxGLAttribsBase
{
public:
// Setters, allowing chained calls
wxGLAttributes& RGBA();
wxGLAttributes& BufferSize(int val);
wxGLAttributes& Level(int val);
wxGLAttributes& DoubleBuffer();
wxGLAttributes& Stereo();
wxGLAttributes& AuxBuffers(int val);
wxGLAttributes& MinRGBA(int mRed, int mGreen, int mBlue, int mAlpha);
wxGLAttributes& Depth(int val);
wxGLAttributes& Stencil(int val);
wxGLAttributes& MinAcumRGBA(int mRed, int mGreen, int mBlue, int mAlpha);
wxGLAttributes& PlatformDefaults();
wxGLAttributes& Defaults();
wxGLAttributes& SampleBuffers(int val);
wxGLAttributes& Samplers(int val);
wxGLAttributes& FrameBuffersRGB();
void EndList(); // No more values can be chained
// This function is undocumented and can not be chained on purpose!
// To keep backwards compatibility with versions before wx3.1 we add here
// the default values used in those versions for the case of NULL list.
void AddDefaultsForWXBefore31();
};
// ----------------------------------------------------------------------------
// wxGLContextBase: OpenGL rendering context
// ----------------------------------------------------------------------------
class WXDLLIMPEXP_GL wxGLContextBase : public wxObject
{
public:
// The derived class should provide a ctor with this signature:
//
// wxGLContext(wxGLCanvas *win,
// const wxGLContext *other = NULL,
// const wxGLContextAttrs *ctxAttrs = NULL);
// set this context as the current one
virtual bool SetCurrent(const wxGLCanvas& win) const = 0;
bool IsOK() { return m_isOk; }
protected:
bool m_isOk;
};
// ----------------------------------------------------------------------------
// wxGLCanvasBase: window which can be used for OpenGL rendering
// ----------------------------------------------------------------------------
class WXDLLIMPEXP_GL wxGLCanvasBase : public wxWindow
{
public:
// default ctor doesn't initialize the window, use Create() later
wxGLCanvasBase();
virtual ~wxGLCanvasBase();
/*
The derived class should provide a ctor with this signature:
wxGLCanvas(wxWindow *parent,
const wxGLAttributes& dispAttrs,
wxWindowID id = wxID_ANY,
const wxPoint& pos = wxDefaultPosition,
const wxSize& size = wxDefaultSize,
long style = 0,
const wxString& name = wxGLCanvasName,
const wxPalette& palette = wxNullPalette);
*/
// operations
// ----------
// set the given context associated with this window as the current one
bool SetCurrent(const wxGLContext& context) const;
// flush the back buffer (if we have it)
virtual bool SwapBuffers() = 0;
// accessors
// ---------
// check if the given attributes are supported without creating a canvas
static bool IsDisplaySupported(const wxGLAttributes& dispAttrs);
static bool IsDisplaySupported(const int *attribList);
#if wxUSE_PALETTE
const wxPalette *GetPalette() const { return &m_palette; }
#endif // wxUSE_PALETTE
// miscellaneous helper functions
// ------------------------------
// call glcolor() for the colour with the given name, return false if
// colour not found
bool SetColour(const wxString& colour);
// return true if the extension with given name is supported
//
// notice that while this function is implemented for all of GLX, WGL and
// AGL the extensions names are usually not the same for different
// platforms and so the code using it still usually uses conditional
// compilation
static bool IsExtensionSupported(const char *extension);
// Get the wxGLContextAttrs object filled with the context-related values
// of the list of attributes passed at ctor when no wxGLAttributes is used
// as a parameter
wxGLContextAttrs& GetGLCTXAttrs() { return m_GLCTXAttrs; }
// deprecated methods using the implicit wxGLContext
#if WXWIN_COMPATIBILITY_2_8
wxDEPRECATED( wxGLContext* GetContext() const );
wxDEPRECATED( void SetCurrent() );
wxDEPRECATED( void OnSize(wxSizeEvent& event) );
#endif // WXWIN_COMPATIBILITY_2_8
#ifdef __WXUNIVERSAL__
// resolve the conflict with wxWindowUniv::SetCurrent()
virtual bool SetCurrent(bool doit) { return wxWindow::SetCurrent(doit); }
#endif
protected:
// override this to implement SetColour() in GL_INDEX_MODE
// (currently only implemented in wxX11 and wxMotif ports)
virtual int GetColourIndex(const wxColour& WXUNUSED(col)) { return -1; }
// check if the given extension name is present in the space-separated list
// of extensions supported by the current implementation such as returned
// by glXQueryExtensionsString() or glGetString(GL_EXTENSIONS)
static bool IsExtensionInList(const char *list, const char *extension);
// For the case of "int* attribList" at ctor is != 0
wxGLContextAttrs m_GLCTXAttrs;
// Extract pixel format and context attributes.
// Return false if an unknown attribute is found.
static bool ParseAttribList(const int* attribList,
wxGLAttributes& dispAttrs,
wxGLContextAttrs* ctxAttrs = NULL);
#if wxUSE_PALETTE
// create default palette if we're not using RGBA mode
// (not supported in most ports)
virtual wxPalette CreateDefaultPalette() { return wxNullPalette; }
wxPalette m_palette;
#endif // wxUSE_PALETTE
#if WXWIN_COMPATIBILITY_2_8
wxGLContext *m_glContext;
#endif // WXWIN_COMPATIBILITY_2_8
};
// ----------------------------------------------------------------------------
// wxGLApp: a special wxApp subclass for OpenGL applications which must be used
// to select a visual compatible with the given attributes
// ----------------------------------------------------------------------------
class WXDLLIMPEXP_GL wxGLAppBase : public wxApp
{
public:
wxGLAppBase() : wxApp() { }
// use this in the constructor of the user-derived wxGLApp class to
// determine if an OpenGL rendering context with these attributes
// is available - returns true if so, false if not.
virtual bool InitGLVisual(const int *attribList) = 0;
};
#if defined(__WXMSW__)
#include "wx/msw/glcanvas.h"
#elif defined(__WXMOTIF__) || defined(__WXX11__)
#include "wx/x11/glcanvas.h"
#elif defined(__WXGTK20__)
#include "wx/gtk/glcanvas.h"
#elif defined(__WXGTK__)
#include "wx/gtk1/glcanvas.h"
#elif defined(__WXMAC__)
#include "wx/osx/glcanvas.h"
#elif defined(__WXQT__)
#include "wx/qt/glcanvas.h"
#else
#error "wxGLCanvas not supported in this wxWidgets port"
#endif
// wxMac and wxMSW don't need anything extra in wxGLAppBase, so declare it here
#ifndef wxGL_APP_DEFINED
class WXDLLIMPEXP_GL wxGLApp : public wxGLAppBase
{
public:
wxGLApp() : wxGLAppBase() { }
virtual bool InitGLVisual(const int *attribList) wxOVERRIDE;
private:
wxDECLARE_DYNAMIC_CLASS(wxGLApp);
};
#endif // !wxGL_APP_DEFINED
// ----------------------------------------------------------------------------
// wxGLAPI: an API wrapper that allows the use of 'old' APIs even on OpenGL
// platforms that don't support it natively anymore, if the APIs are available
// it's a mere redirect
// ----------------------------------------------------------------------------
#ifndef wxUSE_OPENGL_EMULATION
#define wxUSE_OPENGL_EMULATION 0
#endif
class WXDLLIMPEXP_GL wxGLAPI : public wxObject
{
public:
wxGLAPI();
~wxGLAPI();
static void glFrustum(GLfloat left, GLfloat right, GLfloat bottom,
GLfloat top, GLfloat zNear, GLfloat zFar);
static void glBegin(GLenum mode);
static void glTexCoord2f(GLfloat s, GLfloat t);
static void glVertex3f(GLfloat x, GLfloat y, GLfloat z);
static void glNormal3f(GLfloat nx, GLfloat ny, GLfloat nz);
static void glColor4f(GLfloat r, GLfloat g, GLfloat b, GLfloat a);
static void glColor3f(GLfloat r, GLfloat g, GLfloat b);
static void glEnd();
};
#endif // wxUSE_GLCANVAS
#endif // _WX_GLCANVAS_H_BASE_
| h |
rticonnextdds-usecases | data/projects/rticonnextdds-usecases/VehicleTracking/ExampleCode/thirdparty/wxWidgets-3.1.2/Linux/include/wx/window.h | ///////////////////////////////////////////////////////////////////////////////
// Name: wx/window.h
// Purpose: wxWindowBase class - the interface of wxWindow
// Author: Vadim Zeitlin
// Modified by: Ron Lee
// Created: 01/02/97
// Copyright: (c) Vadim Zeitlin
// Licence: wxWindows licence
///////////////////////////////////////////////////////////////////////////////
#ifndef _WX_WINDOW_H_BASE_
#define _WX_WINDOW_H_BASE_
// ----------------------------------------------------------------------------
// headers which we must include here
// ----------------------------------------------------------------------------
#include "wx/event.h" // the base class
#include "wx/list.h" // defines wxWindowList
#include "wx/cursor.h" // we have member variables of these classes
#include "wx/font.h" // so we can't do without them
#include "wx/colour.h"
#include "wx/region.h"
#include "wx/utils.h"
#include "wx/intl.h"
#include "wx/validate.h" // for wxDefaultValidator (always include it)
#if wxUSE_PALETTE
#include "wx/palette.h"
#endif // wxUSE_PALETTE
#if wxUSE_ACCEL
#include "wx/accel.h"
#endif // wxUSE_ACCEL
#if wxUSE_ACCESSIBILITY
#include "wx/access.h"
#endif
// when building wxUniv/Foo we don't want the code for native menu use to be
// compiled in - it should only be used when building real wxFoo
#ifdef __WXUNIVERSAL__
#define wxUSE_MENUS_NATIVE 0
#else // !__WXUNIVERSAL__
#define wxUSE_MENUS_NATIVE wxUSE_MENUS
#endif // __WXUNIVERSAL__/!__WXUNIVERSAL__
// ----------------------------------------------------------------------------
// forward declarations
// ----------------------------------------------------------------------------
class WXDLLIMPEXP_FWD_CORE wxCaret;
class WXDLLIMPEXP_FWD_CORE wxControl;
class WXDLLIMPEXP_FWD_CORE wxDC;
class WXDLLIMPEXP_FWD_CORE wxDropTarget;
class WXDLLIMPEXP_FWD_CORE wxLayoutConstraints;
class WXDLLIMPEXP_FWD_CORE wxSizer;
class WXDLLIMPEXP_FWD_CORE wxToolTip;
class WXDLLIMPEXP_FWD_CORE wxWindowBase;
class WXDLLIMPEXP_FWD_CORE wxWindow;
class WXDLLIMPEXP_FWD_CORE wxScrollHelper;
#if wxUSE_ACCESSIBILITY
class WXDLLIMPEXP_FWD_CORE wxAccessible;
#endif
// ----------------------------------------------------------------------------
// helper stuff used by wxWindow
// ----------------------------------------------------------------------------
// struct containing all the visual attributes of a control
struct WXDLLIMPEXP_CORE wxVisualAttributes
{
// the font used for control label/text inside it
wxFont font;
// the foreground colour
wxColour colFg;
// the background colour, may be wxNullColour if the controls background
// colour is not solid
wxColour colBg;
};
// different window variants, on platforms like e.g. mac uses different
// rendering sizes
enum wxWindowVariant
{
wxWINDOW_VARIANT_NORMAL, // Normal size
wxWINDOW_VARIANT_SMALL, // Smaller size (about 25 % smaller than normal)
wxWINDOW_VARIANT_MINI, // Mini size (about 33 % smaller than normal)
wxWINDOW_VARIANT_LARGE, // Large size (about 25 % larger than normal)
wxWINDOW_VARIANT_MAX
};
#if wxUSE_SYSTEM_OPTIONS
#define wxWINDOW_DEFAULT_VARIANT wxT("window-default-variant")
#endif
// valid values for Show/HideWithEffect()
enum wxShowEffect
{
wxSHOW_EFFECT_NONE,
wxSHOW_EFFECT_ROLL_TO_LEFT,
wxSHOW_EFFECT_ROLL_TO_RIGHT,
wxSHOW_EFFECT_ROLL_TO_TOP,
wxSHOW_EFFECT_ROLL_TO_BOTTOM,
wxSHOW_EFFECT_SLIDE_TO_LEFT,
wxSHOW_EFFECT_SLIDE_TO_RIGHT,
wxSHOW_EFFECT_SLIDE_TO_TOP,
wxSHOW_EFFECT_SLIDE_TO_BOTTOM,
wxSHOW_EFFECT_BLEND,
wxSHOW_EFFECT_EXPAND,
wxSHOW_EFFECT_MAX
};
// Values for EnableTouchEvents() mask.
enum
{
wxTOUCH_NONE = 0x0000,
wxTOUCH_VERTICAL_PAN_GESTURE = 0x0001,
wxTOUCH_HORIZONTAL_PAN_GESTURE = 0x0002,
wxTOUCH_PAN_GESTURES = wxTOUCH_VERTICAL_PAN_GESTURE |
wxTOUCH_HORIZONTAL_PAN_GESTURE,
wxTOUCH_ZOOM_GESTURE = 0x0004,
wxTOUCH_ROTATE_GESTURE = 0x0008,
wxTOUCH_PRESS_GESTURES = 0x0010,
wxTOUCH_ALL_GESTURES = 0x001f
};
// flags for SendSizeEvent()
enum
{
wxSEND_EVENT_POST = 1
};
// ----------------------------------------------------------------------------
// (pseudo)template list classes
// ----------------------------------------------------------------------------
WX_DECLARE_LIST_3(wxWindow, wxWindowBase, wxWindowList, wxWindowListNode, class WXDLLIMPEXP_CORE);
// ----------------------------------------------------------------------------
// global variables
// ----------------------------------------------------------------------------
extern WXDLLIMPEXP_DATA_CORE(wxWindowList) wxTopLevelWindows;
// declared here for compatibility only, main declaration is in wx/app.h
extern WXDLLIMPEXP_DATA_BASE(wxList) wxPendingDelete;
// ----------------------------------------------------------------------------
// wxWindowBase is the base class for all GUI controls/widgets, this is the public
// interface of this class.
//
// Event handler: windows have themselves as their event handlers by default,
// but their event handlers could be set to another object entirely. This
// separation can reduce the amount of derivation required, and allow
// alteration of a window's functionality (e.g. by a resource editor that
// temporarily switches event handlers).
// ----------------------------------------------------------------------------
class WXDLLIMPEXP_CORE wxWindowBase : public wxEvtHandler
{
public:
// creating the window
// -------------------
// default ctor, initializes everything which can be initialized before
// Create()
wxWindowBase() ;
virtual ~wxWindowBase();
// deleting the window
// -------------------
// ask the window to close itself, return true if the event handler
// honoured our request
bool Close( bool force = false );
// the following functions delete the C++ objects (the window itself
// or its children) as well as the GUI windows and normally should
// never be used directly
// delete window unconditionally (dangerous!), returns true if ok
virtual bool Destroy();
// delete all children of this window, returns true if ok
bool DestroyChildren();
// is the window being deleted?
bool IsBeingDeleted() const;
// window attributes
// -----------------
// label is just the same as the title (but for, e.g., buttons it
// makes more sense to speak about labels), title access
// is available from wxTLW classes only (frames, dialogs)
virtual void SetLabel(const wxString& label) = 0;
virtual wxString GetLabel() const = 0;
// the window name is used for resource setting in X, it is not the
// same as the window title/label
virtual void SetName( const wxString &name ) { m_windowName = name; }
virtual wxString GetName() const { return m_windowName; }
// sets the window variant, calls internally DoSetVariant if variant
// has changed
void SetWindowVariant(wxWindowVariant variant);
wxWindowVariant GetWindowVariant() const { return m_windowVariant; }
// get or change the layout direction (LTR or RTL) for this window,
// wxLayout_Default is returned if layout direction is not supported
virtual wxLayoutDirection GetLayoutDirection() const
{ return wxLayout_Default; }
virtual void SetLayoutDirection(wxLayoutDirection WXUNUSED(dir))
{ }
// mirror coordinates for RTL layout if this window uses it and if the
// mirroring is not done automatically like Win32
virtual wxCoord AdjustForLayoutDirection(wxCoord x,
wxCoord width,
wxCoord widthTotal) const;
// window id uniquely identifies the window among its siblings unless
// it is wxID_ANY which means "don't care"
virtual void SetId( wxWindowID winid ) { m_windowId = winid; }
wxWindowID GetId() const { return m_windowId; }
// generate a unique id (or count of them consecutively), returns a
// valid id in the auto-id range or wxID_NONE if failed. If using
// autoid management, it will mark the id as reserved until it is
// used (by assigning it to a wxWindowIDRef) or unreserved.
static wxWindowID NewControlId(int count = 1)
{
return wxIdManager::ReserveId(count);
}
// If an ID generated from NewControlId is not assigned to a wxWindowIDRef,
// it must be unreserved
static void UnreserveControlId(wxWindowID id, int count = 1)
{
wxIdManager::UnreserveId(id, count);
}
// moving/resizing
// ---------------
// set the window size and/or position
void SetSize( int x, int y, int width, int height,
int sizeFlags = wxSIZE_AUTO )
{ DoSetSize(x, y, width, height, sizeFlags); }
void SetSize( int width, int height )
{ DoSetSize( wxDefaultCoord, wxDefaultCoord, width, height, wxSIZE_USE_EXISTING ); }
void SetSize( const wxSize& size )
{ SetSize( size.x, size.y); }
void SetSize(const wxRect& rect, int sizeFlags = wxSIZE_AUTO)
{ DoSetSize(rect.x, rect.y, rect.width, rect.height, sizeFlags); }
void Move(int x, int y, int flags = wxSIZE_USE_EXISTING)
{ DoSetSize(x, y, wxDefaultCoord, wxDefaultCoord, flags); }
void Move(const wxPoint& pt, int flags = wxSIZE_USE_EXISTING)
{ Move(pt.x, pt.y, flags); }
void SetPosition(const wxPoint& pt) { Move(pt); }
// Z-order
virtual void Raise() = 0;
virtual void Lower() = 0;
// client size is the size of area available for subwindows
void SetClientSize( int width, int height )
{ DoSetClientSize(width, height); }
void SetClientSize( const wxSize& size )
{ DoSetClientSize(size.x, size.y); }
void SetClientSize(const wxRect& rect)
{ SetClientSize( rect.width, rect.height ); }
// get the window position (pointers may be NULL): notice that it is in
// client coordinates for child windows and screen coordinates for the
// top level ones, use GetScreenPosition() if you need screen
// coordinates for all kinds of windows
void GetPosition( int *x, int *y ) const { DoGetPosition(x, y); }
wxPoint GetPosition() const
{
int x, y;
DoGetPosition(&x, &y);
return wxPoint(x, y);
}
// get the window position in screen coordinates
void GetScreenPosition(int *x, int *y) const { DoGetScreenPosition(x, y); }
wxPoint GetScreenPosition() const
{
int x, y;
DoGetScreenPosition(&x, &y);
return wxPoint(x, y);
}
// get the window size (pointers may be NULL)
void GetSize( int *w, int *h ) const { DoGetSize(w, h); }
wxSize GetSize() const
{
int w, h;
DoGetSize(& w, & h);
return wxSize(w, h);
}
void GetClientSize( int *w, int *h ) const { DoGetClientSize(w, h); }
wxSize GetClientSize() const
{
int w, h;
DoGetClientSize(&w, &h);
return wxSize(w, h);
}
// get the position and size at once
wxRect GetRect() const
{
int x, y, w, h;
GetPosition(&x, &y);
GetSize(&w, &h);
return wxRect(x, y, w, h);
}
wxRect GetScreenRect() const
{
int x, y, w, h;
GetScreenPosition(&x, &y);
GetSize(&w, &h);
return wxRect(x, y, w, h);
}
// get the origin of the client area of the window relative to the
// window top left corner (the client area may be shifted because of
// the borders, scrollbars, other decorations...)
virtual wxPoint GetClientAreaOrigin() const;
// get the client rectangle in window (i.e. client) coordinates
wxRect GetClientRect() const
{
return wxRect(GetClientAreaOrigin(), GetClientSize());
}
// client<->window size conversion
virtual wxSize ClientToWindowSize(const wxSize& size) const;
virtual wxSize WindowToClientSize(const wxSize& size) const;
// get the size best suited for the window (in fact, minimal
// acceptable size using which it will still look "nice" in
// most situations)
wxSize GetBestSize() const;
void GetBestSize(int *w, int *h) const
{
wxSize s = GetBestSize();
if ( w )
*w = s.x;
if ( h )
*h = s.y;
}
// Determine the best size in the other direction if one of them is
// fixed. This is used with windows that can wrap their contents and
// returns input-independent best size for the others.
int GetBestHeight(int width) const;
int GetBestWidth(int height) const;
void SetScrollHelper( wxScrollHelper *sh ) { m_scrollHelper = sh; }
wxScrollHelper *GetScrollHelper() { return m_scrollHelper; }
// reset the cached best size value so it will be recalculated the
// next time it is needed.
void InvalidateBestSize();
void CacheBestSize(const wxSize& size) const
{ wxConstCast(this, wxWindowBase)->m_bestSizeCache = size; }
// This function will merge the window's best size into the window's
// minimum size, giving priority to the min size components, and
// returns the results.
virtual wxSize GetEffectiveMinSize() const;
#if WXWIN_COMPATIBILITY_2_8
wxDEPRECATED_MSG("use GetEffectiveMinSize() instead")
wxSize GetBestFittingSize() const;
#endif // WXWIN_COMPATIBILITY_2_8
// A 'Smart' SetSize that will fill in default size values with 'best'
// size. Sets the minsize to what was passed in.
void SetInitialSize(const wxSize& size=wxDefaultSize);
#if WXWIN_COMPATIBILITY_2_8
wxDEPRECATED_MSG("use SetInitialSize() instead")
void SetBestFittingSize(const wxSize& size=wxDefaultSize);
#endif // WXWIN_COMPATIBILITY_2_8
// the generic centre function - centers the window on parent by`
// default or on screen if it doesn't have parent or
// wxCENTER_ON_SCREEN flag is given
void Centre(int dir = wxBOTH) { DoCentre(dir); }
void Center(int dir = wxBOTH) { DoCentre(dir); }
// centre with respect to the parent window
void CentreOnParent(int dir = wxBOTH) { DoCentre(dir); }
void CenterOnParent(int dir = wxBOTH) { CentreOnParent(dir); }
// set window size to wrap around its children
virtual void Fit();
// set virtual size to satisfy children
virtual void FitInside();
// SetSizeHints is actually for setting the size hints
// for the wxTLW for a Window Manager - hence the name -
// and it is therefore overridden in wxTLW to do that.
// In wxWindow(Base), it has (unfortunately) been abused
// to mean the same as SetMinSize() and SetMaxSize().
virtual void SetSizeHints( int minW, int minH,
int maxW = wxDefaultCoord, int maxH = wxDefaultCoord,
int incW = wxDefaultCoord, int incH = wxDefaultCoord )
{ DoSetSizeHints(minW, minH, maxW, maxH, incW, incH); }
void SetSizeHints( const wxSize& minSize,
const wxSize& maxSize=wxDefaultSize,
const wxSize& incSize=wxDefaultSize)
{ DoSetSizeHints(minSize.x, minSize.y, maxSize.x, maxSize.y, incSize.x, incSize.y); }
#if WXWIN_COMPATIBILITY_2_8
// these are useless and do nothing since wxWidgets 2.9
wxDEPRECATED( virtual void SetVirtualSizeHints( int minW, int minH,
int maxW = wxDefaultCoord, int maxH = wxDefaultCoord ) );
wxDEPRECATED( void SetVirtualSizeHints( const wxSize& minSize,
const wxSize& maxSize=wxDefaultSize) );
#endif // WXWIN_COMPATIBILITY_2_8
// Call these to override what GetBestSize() returns. This
// method is only virtual because it is overridden in wxTLW
// as a different API for SetSizeHints().
virtual void SetMinSize(const wxSize& minSize);
virtual void SetMaxSize(const wxSize& maxSize);
// Like Set*Size, but for client, not window, size
virtual void SetMinClientSize(const wxSize& size)
{ SetMinSize(ClientToWindowSize(size)); }
virtual void SetMaxClientSize(const wxSize& size)
{ SetMaxSize(ClientToWindowSize(size)); }
// Override these methods to impose restrictions on min/max size.
// The easier way is to call SetMinSize() and SetMaxSize() which
// will have the same effect. Doing both is non-sense.
virtual wxSize GetMinSize() const { return wxSize(m_minWidth, m_minHeight); }
virtual wxSize GetMaxSize() const { return wxSize(m_maxWidth, m_maxHeight); }
// Like Get*Size, but for client, not window, size
virtual wxSize GetMinClientSize() const
{ return WindowToClientSize(GetMinSize()); }
virtual wxSize GetMaxClientSize() const
{ return WindowToClientSize(GetMaxSize()); }
// Get the min and max values one by one
int GetMinWidth() const { return GetMinSize().x; }
int GetMinHeight() const { return GetMinSize().y; }
int GetMaxWidth() const { return GetMaxSize().x; }
int GetMaxHeight() const { return GetMaxSize().y; }
// Methods for accessing the virtual size of a window. For most
// windows this is just the client area of the window, but for
// some like scrolled windows it is more or less independent of
// the screen window size. You may override the DoXXXVirtual
// methods below for classes where that is the case.
void SetVirtualSize( const wxSize &size ) { DoSetVirtualSize( size.x, size.y ); }
void SetVirtualSize( int x, int y ) { DoSetVirtualSize( x, y ); }
wxSize GetVirtualSize() const { return DoGetVirtualSize(); }
void GetVirtualSize( int *x, int *y ) const
{
wxSize s( DoGetVirtualSize() );
if( x )
*x = s.GetWidth();
if( y )
*y = s.GetHeight();
}
// Override these methods for windows that have a virtual size
// independent of their client size. e.g. the virtual area of a
// wxScrolledWindow.
virtual void DoSetVirtualSize( int x, int y );
virtual wxSize DoGetVirtualSize() const;
// Return the largest of ClientSize and BestSize (as determined
// by a sizer, interior children, or other means)
virtual wxSize GetBestVirtualSize() const
{
wxSize client( GetClientSize() );
wxSize best( GetBestSize() );
return wxSize( wxMax( client.x, best.x ), wxMax( client.y, best.y ) );
}
// returns the magnification of the content of this window
// e.g. 2.0 for a window on a retina screen
virtual double GetContentScaleFactor() const;
// return the size of the left/right and top/bottom borders in x and y
// components of the result respectively
virtual wxSize GetWindowBorderSize() const;
// wxSizer and friends use this to give a chance to a component to recalc
// its min size once one of the final size components is known. Override
// this function when that is useful (such as for wxStaticText which can
// stretch over several lines). Parameter availableOtherDir
// tells the item how much more space there is available in the opposite
// direction (-1 if unknown).
virtual bool
InformFirstDirection(int direction, int size, int availableOtherDir);
// sends a size event to the window using its current size -- this has an
// effect of refreshing the window layout
//
// by default the event is sent, i.e. processed immediately, but if flags
// value includes wxSEND_EVENT_POST then it's posted, i.e. only schedule
// for later processing
virtual void SendSizeEvent(int flags = 0);
// this is a safe wrapper for GetParent()->SendSizeEvent(): it checks that
// we have a parent window and it's not in process of being deleted
//
// this is used by controls such as tool/status bars changes to which must
// also result in parent re-layout
void SendSizeEventToParent(int flags = 0);
// this is a more readable synonym for SendSizeEvent(wxSEND_EVENT_POST)
void PostSizeEvent() { SendSizeEvent(wxSEND_EVENT_POST); }
// this is the same as SendSizeEventToParent() but using PostSizeEvent()
void PostSizeEventToParent() { SendSizeEventToParent(wxSEND_EVENT_POST); }
// These functions should be used before repositioning the children of
// this window to reduce flicker or, in MSW case, even avoid display
// corruption in some situations (so they're more than just optimization).
//
// EndRepositioningChildren() should be called if and only if
// BeginRepositioningChildren() returns true. To ensure that this is always
// done automatically, use ChildrenRepositioningGuard class below.
virtual bool BeginRepositioningChildren() { return false; }
virtual void EndRepositioningChildren() { }
// A simple helper which ensures that EndRepositioningChildren() is called
// from its dtor if and only if calling BeginRepositioningChildren() from
// the ctor returned true.
class ChildrenRepositioningGuard
{
public:
// Notice that window can be NULL here, for convenience. In this case
// this class simply doesn't do anything.
explicit ChildrenRepositioningGuard(wxWindowBase* win)
: m_win(win),
m_callEnd(win && win->BeginRepositioningChildren())
{
}
~ChildrenRepositioningGuard()
{
if ( m_callEnd )
m_win->EndRepositioningChildren();
}
private:
wxWindowBase* const m_win;
const bool m_callEnd;
wxDECLARE_NO_COPY_CLASS(ChildrenRepositioningGuard);
};
// window state
// ------------
// returns true if window was shown/hidden, false if the nothing was
// done (window was already shown/hidden)
virtual bool Show( bool show = true );
bool Hide() { return Show(false); }
// show or hide the window with a special effect, not implemented on
// most platforms (where it is the same as Show()/Hide() respectively)
//
// timeout specifies how long the animation should take, in ms, the
// default value of 0 means to use the default (system-dependent) value
virtual bool ShowWithEffect(wxShowEffect WXUNUSED(effect),
unsigned WXUNUSED(timeout) = 0)
{
return Show();
}
virtual bool HideWithEffect(wxShowEffect WXUNUSED(effect),
unsigned WXUNUSED(timeout) = 0)
{
return Hide();
}
// returns true if window was enabled/disabled, false if nothing done
virtual bool Enable( bool enable = true );
bool Disable() { return Enable(false); }
virtual bool IsShown() const { return m_isShown; }
// returns true if the window is really enabled and false otherwise,
// whether because it had been explicitly disabled itself or because
// its parent is currently disabled -- then this method returns false
// whatever is the intrinsic state of this window, use IsThisEnabled(0
// to retrieve it. In other words, this relation always holds:
//
// IsEnabled() == IsThisEnabled() && parent.IsEnabled()
//
bool IsEnabled() const;
// returns the internal window state independently of the parent(s)
// state, i.e. the state in which the window would be if all its
// parents were enabled (use IsEnabled() above to get the effective
// window state)
bool IsThisEnabled() const { return m_isEnabled; }
// returns true if the window is visible, i.e. IsShown() returns true
// if called on it and all its parents up to the first TLW
virtual bool IsShownOnScreen() const;
// get/set window style (setting style won't update the window and so
// is only useful for internal usage)
virtual void SetWindowStyleFlag( long style ) { m_windowStyle = style; }
virtual long GetWindowStyleFlag() const { return m_windowStyle; }
// just some (somewhat shorter) synonyms
void SetWindowStyle( long style ) { SetWindowStyleFlag(style); }
long GetWindowStyle() const { return GetWindowStyleFlag(); }
// check if the flag is set
bool HasFlag(int flag) const { return (m_windowStyle & flag) != 0; }
virtual bool IsRetained() const { return HasFlag(wxRETAINED); }
// turn the flag on if it had been turned off before and vice versa,
// return true if the flag is currently turned on
bool ToggleWindowStyle(int flag);
// extra style: the less often used style bits which can't be set with
// SetWindowStyleFlag()
virtual void SetExtraStyle(long exStyle) { m_exStyle = exStyle; }
long GetExtraStyle() const { return m_exStyle; }
bool HasExtraStyle(int exFlag) const { return (m_exStyle & exFlag) != 0; }
#if WXWIN_COMPATIBILITY_2_8
// make the window modal (all other windows unresponsive)
wxDEPRECATED( virtual void MakeModal(bool modal = true) );
#endif
// (primitive) theming support
// ---------------------------
virtual void SetThemeEnabled(bool enableTheme) { m_themeEnabled = enableTheme; }
virtual bool GetThemeEnabled() const { return m_themeEnabled; }
// focus and keyboard handling
// ---------------------------
// set focus to this window
virtual void SetFocus() = 0;
// set focus to this window as the result of a keyboard action
virtual void SetFocusFromKbd() { SetFocus(); }
// return the window which currently has the focus or NULL
static wxWindow *FindFocus();
static wxWindow *DoFindFocus() /* = 0: implement in derived classes */;
// return true if the window has focus (handles composite windows
// correctly - returns true if GetMainWindowOfCompositeControl()
// has focus)
virtual bool HasFocus() const;
// can this window have focus in principle?
//
// the difference between AcceptsFocus[FromKeyboard]() and CanAcceptFocus
// [FromKeyboard]() is that the former functions are meant to be
// overridden in the derived classes to simply return false if the
// control can't have focus, while the latter are meant to be used by
// this class clients and take into account the current window state
virtual bool AcceptsFocus() const { return true; }
// can this window or one of its children accept focus?
//
// usually it's the same as AcceptsFocus() but is overridden for
// container windows
virtual bool AcceptsFocusRecursively() const { return AcceptsFocus(); }
// can this window be given focus by keyboard navigation? if not, the
// only way to give it focus (provided it accepts it at all) is to
// click it
virtual bool AcceptsFocusFromKeyboard() const { return AcceptsFocus(); }
// Can this window be focused right now, in its current state? This
// shouldn't be called at all if AcceptsFocus() returns false.
//
// It is a convenient helper for the various functions using it below
// but also a hook allowing to override the default logic for some rare
// cases (currently just wxRadioBox in wxMSW) when it's inappropriate.
virtual bool CanBeFocused() const { return IsShown() && IsEnabled(); }
// can this window itself have focus?
bool IsFocusable() const { return AcceptsFocus() && CanBeFocused(); }
// can this window have focus right now?
//
// if this method returns true, it means that calling SetFocus() will
// put focus either to this window or one of its children, if you need
// to know whether this window accepts focus itself, use IsFocusable()
bool CanAcceptFocus() const
{ return AcceptsFocusRecursively() && CanBeFocused(); }
// can this window be assigned focus from keyboard right now?
bool CanAcceptFocusFromKeyboard() const
{ return AcceptsFocusFromKeyboard() && CanBeFocused(); }
// call this when the return value of AcceptsFocus() changes
virtual void SetCanFocus(bool WXUNUSED(canFocus)) { }
// navigates inside this window
bool NavigateIn(int flags = wxNavigationKeyEvent::IsForward)
{ return DoNavigateIn(flags); }
// navigates in the specified direction from this window, this is
// equivalent to GetParent()->NavigateIn()
bool Navigate(int flags = wxNavigationKeyEvent::IsForward)
{ return m_parent && ((wxWindowBase *)m_parent)->DoNavigateIn(flags); }
// this function will generate the appropriate call to Navigate() if the
// key event is one normally used for keyboard navigation and return true
// in this case
bool HandleAsNavigationKey(const wxKeyEvent& event);
// move this window just before/after the specified one in tab order
// (the other window must be our sibling!)
void MoveBeforeInTabOrder(wxWindow *win)
{ DoMoveInTabOrder(win, OrderBefore); }
void MoveAfterInTabOrder(wxWindow *win)
{ DoMoveInTabOrder(win, OrderAfter); }
// parent/children relations
// -------------------------
// get the list of children
const wxWindowList& GetChildren() const { return m_children; }
wxWindowList& GetChildren() { return m_children; }
// needed just for extended runtime
const wxWindowList& GetWindowChildren() const { return GetChildren() ; }
// get the window before/after this one in the parents children list,
// returns NULL if this is the first/last window
wxWindow *GetPrevSibling() const { return DoGetSibling(OrderBefore); }
wxWindow *GetNextSibling() const { return DoGetSibling(OrderAfter); }
// get the parent or the parent of the parent
wxWindow *GetParent() const { return m_parent; }
inline wxWindow *GetGrandParent() const;
// is this window a top level one?
virtual bool IsTopLevel() const;
// is this window a child or grand child of this one (inside the same
// TLW)?
bool IsDescendant(wxWindowBase* win) const;
// it doesn't really change parent, use Reparent() instead
void SetParent( wxWindowBase *parent );
// change the real parent of this window, return true if the parent
// was changed, false otherwise (error or newParent == oldParent)
virtual bool Reparent( wxWindowBase *newParent );
// implementation mostly
virtual void AddChild( wxWindowBase *child );
virtual void RemoveChild( wxWindowBase *child );
// returns true if the child is in the client area of the window, i.e. is
// not scrollbar, toolbar etc.
virtual bool IsClientAreaChild(const wxWindow *WXUNUSED(child)) const
{ return true; }
// looking for windows
// -------------------
// find window among the descendants of this one either by id or by
// name (return NULL if not found)
wxWindow *FindWindow(long winid) const;
wxWindow *FindWindow(const wxString& name) const;
// Find a window among any window (all return NULL if not found)
static wxWindow *FindWindowById( long winid, const wxWindow *parent = NULL );
static wxWindow *FindWindowByName( const wxString& name,
const wxWindow *parent = NULL );
static wxWindow *FindWindowByLabel( const wxString& label,
const wxWindow *parent = NULL );
// event handler stuff
// -------------------
// get the current event handler
wxEvtHandler *GetEventHandler() const { return m_eventHandler; }
// replace the event handler (allows to completely subclass the
// window)
void SetEventHandler( wxEvtHandler *handler );
// push/pop event handler: allows to chain a custom event handler to
// already existing ones
void PushEventHandler( wxEvtHandler *handler );
wxEvtHandler *PopEventHandler( bool deleteHandler = false );
// find the given handler in the event handler chain and remove (but
// not delete) it from the event handler chain, return true if it was
// found and false otherwise (this also results in an assert failure so
// this function should only be called when the handler is supposed to
// be there)
bool RemoveEventHandler(wxEvtHandler *handler);
// Process an event by calling GetEventHandler()->ProcessEvent(): this
// is a straightforward replacement for ProcessEvent() itself which
// shouldn't be used directly with windows as it doesn't take into
// account any event handlers associated with the window
bool ProcessWindowEvent(wxEvent& event)
{ return GetEventHandler()->ProcessEvent(event); }
// Call GetEventHandler()->ProcessEventLocally(): this should be used
// instead of calling ProcessEventLocally() directly on the window
// itself as this wouldn't take any pushed event handlers into account
// correctly
bool ProcessWindowEventLocally(wxEvent& event)
{ return GetEventHandler()->ProcessEventLocally(event); }
// Process an event by calling GetEventHandler()->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 HandleWindowEvent(wxEvent& event) const;
// disable wxEvtHandler double-linked list mechanism:
virtual void SetNextHandler(wxEvtHandler *handler) wxOVERRIDE;
virtual void SetPreviousHandler(wxEvtHandler *handler) wxOVERRIDE;
protected:
// NOTE: we change the access specifier of the following wxEvtHandler functions
// so that the user won't be able to call them directly.
// Calling wxWindow::ProcessEvent in fact only works when there are NO
// event handlers pushed on the window.
// To ensure correct operation, instead of wxWindow::ProcessEvent
// you must always call wxWindow::GetEventHandler()->ProcessEvent()
// or HandleWindowEvent().
// The same holds for all other wxEvtHandler functions.
using wxEvtHandler::ProcessEvent;
using wxEvtHandler::ProcessEventLocally;
#if wxUSE_THREADS
using wxEvtHandler::ProcessThreadEvent;
#endif
using wxEvtHandler::SafelyProcessEvent;
using wxEvtHandler::ProcessPendingEvents;
using wxEvtHandler::AddPendingEvent;
using wxEvtHandler::QueueEvent;
public:
// validators
// ----------
#if wxUSE_VALIDATORS
// a window may have an associated validator which is used to control
// user input
virtual void SetValidator( const wxValidator &validator );
virtual wxValidator *GetValidator() { return m_windowValidator; }
#endif // wxUSE_VALIDATORS
// dialog oriented functions
// -------------------------
// validate the correctness of input, return true if ok
virtual bool Validate();
// transfer data between internal and GUI representations
virtual bool TransferDataToWindow();
virtual bool TransferDataFromWindow();
virtual void InitDialog();
#if wxUSE_ACCEL
// accelerators
// ------------
virtual void SetAcceleratorTable( const wxAcceleratorTable& accel )
{ m_acceleratorTable = accel; }
wxAcceleratorTable *GetAcceleratorTable()
{ return &m_acceleratorTable; }
#endif // wxUSE_ACCEL
#if wxUSE_HOTKEY
// hot keys (system wide accelerators)
// -----------------------------------
virtual bool RegisterHotKey(int hotkeyId, int modifiers, int keycode);
virtual bool UnregisterHotKey(int hotkeyId);
#endif // wxUSE_HOTKEY
// translation between different units
// -----------------------------------
// DPI-independent pixels, or DIPs, are pixel values for the standard
// 96 DPI display, they are scaled to take the current resolution into
// account (i.e. multiplied by the same factor as returned by
// GetContentScaleFactor()) if necessary for the current platform.
//
// Currently the conversion factor is the same for all windows but this
// will change with the monitor-specific resolution support in the
// future, so prefer using the non-static member functions.
//
// Similarly, currently in practice the factor is the same in both
// horizontal and vertical directions, but this could, in principle,
// change too, so prefer using the overloads taking wxPoint or wxSize.
static wxSize FromDIP(const wxSize& sz, const wxWindowBase* w);
static wxPoint FromDIP(const wxPoint& pt, const wxWindowBase* w)
{
const wxSize sz = FromDIP(wxSize(pt.x, pt.y), w);
return wxPoint(sz.x, sz.y);
}
static int FromDIP(int d, const wxWindowBase* w)
{
return FromDIP(wxSize(d, 0), w).x;
}
wxSize FromDIP(const wxSize& sz) const { return FromDIP(sz, this); }
wxPoint FromDIP(const wxPoint& pt) const { return FromDIP(pt, this); }
int FromDIP(int d) const { return FromDIP(d, this); }
static wxSize ToDIP(const wxSize& sz, const wxWindowBase* w);
static wxPoint ToDIP(const wxPoint& pt, const wxWindowBase* w)
{
const wxSize sz = ToDIP(wxSize(pt.x, pt.y), w);
return wxPoint(sz.x, sz.y);
}
static int ToDIP(int d, const wxWindowBase* w)
{
return ToDIP(wxSize(d, 0), w).x;
}
wxSize ToDIP(const wxSize& sz) const { return ToDIP(sz, this); }
wxPoint ToDIP(const wxPoint& pt) const { return ToDIP(pt, this); }
int ToDIP(int d) const { return ToDIP(d, this); }
// Dialog units are based on the size of the current font.
wxPoint ConvertPixelsToDialog( const wxPoint& pt ) const;
wxPoint ConvertDialogToPixels( const wxPoint& pt ) const;
wxSize ConvertPixelsToDialog( const wxSize& sz ) const
{
wxPoint pt(ConvertPixelsToDialog(wxPoint(sz.x, sz.y)));
return wxSize(pt.x, pt.y);
}
wxSize ConvertDialogToPixels( const wxSize& sz ) const
{
wxPoint pt(ConvertDialogToPixels(wxPoint(sz.x, sz.y)));
return wxSize(pt.x, pt.y);
}
// mouse functions
// ---------------
// move the mouse to the specified position
virtual void WarpPointer(int x, int y) = 0;
// start or end mouse capture, these functions maintain the stack of
// windows having captured the mouse and after calling ReleaseMouse()
// the mouse is not released but returns to the window which had had
// captured it previously (if any)
void CaptureMouse();
void ReleaseMouse();
// get the window which currently captures the mouse or NULL
static wxWindow *GetCapture();
// does this window have the capture?
virtual bool HasCapture() const
{ return (wxWindow *)this == GetCapture(); }
// enable the specified touch events for this window, return false if
// the requested events are not supported
virtual bool EnableTouchEvents(int WXUNUSED(eventsMask))
{
return false;
}
// painting the window
// -------------------
// mark the specified rectangle (or the whole window) as "dirty" so it
// will be repainted
virtual void Refresh( bool eraseBackground = true,
const wxRect *rect = (const wxRect *) NULL ) = 0;
// a less awkward wrapper for Refresh
void RefreshRect(const wxRect& rect, bool eraseBackground = true)
{
Refresh(eraseBackground, &rect);
}
// repaint all invalid areas of the window immediately
virtual void Update() { }
// clear the window background
virtual void ClearBackground();
// freeze the window: don't redraw it until it is thawed
void Freeze();
// thaw the window: redraw it after it had been frozen
void Thaw();
// return true if window had been frozen and not unthawed yet
bool IsFrozen() const { return m_freezeCount != 0; }
// adjust DC for drawing on this window
virtual void PrepareDC( wxDC & WXUNUSED(dc) ) { }
// enable or disable double buffering
virtual void SetDoubleBuffered(bool WXUNUSED(on)) { }
// return true if the window contents is double buffered by the system
virtual bool IsDoubleBuffered() const { return false; }
// the update region of the window contains the areas which must be
// repainted by the program
const wxRegion& GetUpdateRegion() const { return m_updateRegion; }
wxRegion& GetUpdateRegion() { return m_updateRegion; }
// get the update rectangle region bounding box in client coords
wxRect GetUpdateClientRect() const;
// these functions verify whether the given point/rectangle belongs to
// (or at least intersects with) the update region
virtual bool DoIsExposed( int x, int y ) const;
virtual bool DoIsExposed( int x, int y, int w, int h ) const;
bool IsExposed( int x, int y ) const
{ return DoIsExposed(x, y); }
bool IsExposed( int x, int y, int w, int h ) const
{ return DoIsExposed(x, y, w, h); }
bool IsExposed( const wxPoint& pt ) const
{ return DoIsExposed(pt.x, pt.y); }
bool IsExposed( const wxRect& rect ) const
{ return DoIsExposed(rect.x, rect.y, rect.width, rect.height); }
// colours, fonts and cursors
// --------------------------
// get the default attributes for the controls of this class: we
// provide a virtual function which can be used to query the default
// attributes of an existing control and a static function which can
// be used even when no existing object of the given class is
// available, but which won't return any styles specific to this
// particular control, of course (e.g. "Ok" button might have
// different -- bold for example -- font)
virtual wxVisualAttributes GetDefaultAttributes() const
{
return GetClassDefaultAttributes(GetWindowVariant());
}
static wxVisualAttributes
GetClassDefaultAttributes(wxWindowVariant variant = wxWINDOW_VARIANT_NORMAL);
// set/retrieve the window colours (system defaults are used by
// default): SetXXX() functions return true if colour was changed,
// SetDefaultXXX() reset the "m_inheritXXX" flag after setting the
// value to prevent it from being inherited by our children
virtual bool SetBackgroundColour(const wxColour& colour);
void SetOwnBackgroundColour(const wxColour& colour)
{
if ( SetBackgroundColour(colour) )
m_inheritBgCol = false;
}
wxColour GetBackgroundColour() const;
bool InheritsBackgroundColour() const
{
return m_inheritBgCol;
}
bool UseBgCol() const
{
return m_hasBgCol;
}
bool UseBackgroundColour() const
{
return UseBgCol();
}
virtual bool SetForegroundColour(const wxColour& colour);
void SetOwnForegroundColour(const wxColour& colour)
{
if ( SetForegroundColour(colour) )
m_inheritFgCol = false;
}
wxColour GetForegroundColour() const;
bool UseForegroundColour() const
{
return m_hasFgCol;
}
bool InheritsForegroundColour() const
{
return m_inheritFgCol;
}
// Set/get the background style.
virtual bool SetBackgroundStyle(wxBackgroundStyle style);
wxBackgroundStyle GetBackgroundStyle() const
{ return m_backgroundStyle; }
// returns true if the control has "transparent" areas such as a
// wxStaticText and wxCheckBox and the background should be adapted
// from a parent window
virtual bool HasTransparentBackground() { return false; }
// Returns true if background transparency is supported for this
// window, i.e. if calling SetBackgroundStyle(wxBG_STYLE_TRANSPARENT)
// has a chance of succeeding. If reason argument is non-NULL, returns a
// user-readable explanation of why it isn't supported if the return
// value is false.
virtual bool IsTransparentBackgroundSupported(wxString* reason = NULL) const;
// set/retrieve the font for the window (SetFont() returns true if the
// font really changed)
virtual bool SetFont(const wxFont& font) = 0;
void SetOwnFont(const wxFont& font)
{
if ( SetFont(font) )
m_inheritFont = false;
}
wxFont GetFont() const;
// set/retrieve the cursor for this window (SetCursor() returns true
// if the cursor was really changed)
virtual bool SetCursor( const wxCursor &cursor );
const wxCursor& GetCursor() const { return m_cursor; }
#if wxUSE_CARET
// associate a caret with the window
void SetCaret(wxCaret *caret);
// get the current caret (may be NULL)
wxCaret *GetCaret() const { return m_caret; }
#endif // wxUSE_CARET
// get the (average) character size for the current font
virtual int GetCharHeight() const = 0;
virtual int GetCharWidth() const = 0;
// get the width/height/... of the text using current or specified
// font
void GetTextExtent(const wxString& string,
int *x, int *y,
int *descent = NULL,
int *externalLeading = NULL,
const wxFont *font = NULL) const
{
DoGetTextExtent(string, x, y, descent, externalLeading, font);
}
wxSize GetTextExtent(const wxString& string) const
{
wxCoord w, h;
GetTextExtent(string, &w, &h);
return wxSize(w, h);
}
// client <-> screen coords
// ------------------------
// translate to/from screen/client coordinates (pointers may be NULL)
void ClientToScreen( int *x, int *y ) const
{ DoClientToScreen(x, y); }
void ScreenToClient( int *x, int *y ) const
{ DoScreenToClient(x, y); }
// wxPoint interface to do the same thing
wxPoint ClientToScreen(const wxPoint& pt) const
{
int x = pt.x, y = pt.y;
DoClientToScreen(&x, &y);
return wxPoint(x, y);
}
wxPoint ScreenToClient(const wxPoint& pt) const
{
int x = pt.x, y = pt.y;
DoScreenToClient(&x, &y);
return wxPoint(x, y);
}
// test where the given (in client coords) point lies
wxHitTest HitTest(wxCoord x, wxCoord y) const
{ return DoHitTest(x, y); }
wxHitTest HitTest(const wxPoint& pt) const
{ return DoHitTest(pt.x, pt.y); }
// misc
// ----
// get the window border style from the given flags: this is different from
// simply doing flags & wxBORDER_MASK because it uses GetDefaultBorder() to
// translate wxBORDER_DEFAULT to something reasonable
wxBorder GetBorder(long flags) const;
// get border for the flags of this window
wxBorder GetBorder() const { return GetBorder(GetWindowStyleFlag()); }
// send wxUpdateUIEvents to this window, and children if recurse is true
virtual void UpdateWindowUI(long flags = wxUPDATE_UI_NONE);
// do the window-specific processing after processing the update event
virtual void DoUpdateWindowUI(wxUpdateUIEvent& event) ;
#if wxUSE_MENUS
// show popup menu at the given position, generate events for the items
// selected in it
bool PopupMenu(wxMenu *menu, const wxPoint& pos = wxDefaultPosition)
{ return PopupMenu(menu, pos.x, pos.y); }
bool PopupMenu(wxMenu *menu, int x, int y);
// simply return the id of the selected item or wxID_NONE without
// generating any events
int GetPopupMenuSelectionFromUser(wxMenu& menu,
const wxPoint& pos = wxDefaultPosition)
{ return DoGetPopupMenuSelectionFromUser(menu, pos.x, pos.y); }
int GetPopupMenuSelectionFromUser(wxMenu& menu, int x, int y)
{ return DoGetPopupMenuSelectionFromUser(menu, x, y); }
#endif // wxUSE_MENUS
// override this method to return true for controls having multiple pages
virtual bool HasMultiplePages() const { return false; }
// scrollbars
// ----------
// can the window have the scrollbar in this orientation?
virtual bool CanScroll(int orient) const;
// does the window have the scrollbar in this orientation?
bool HasScrollbar(int orient) const;
// configure the window scrollbars
virtual void SetScrollbar( int orient,
int pos,
int thumbvisible,
int range,
bool refresh = true ) = 0;
virtual void SetScrollPos( int orient, int pos, bool refresh = true ) = 0;
virtual int GetScrollPos( int orient ) const = 0;
virtual int GetScrollThumb( int orient ) const = 0;
virtual int GetScrollRange( int orient ) const = 0;
// scroll window to the specified position
virtual void ScrollWindow( int dx, int dy,
const wxRect* rect = NULL ) = 0;
// scrolls window by line/page: note that not all controls support this
//
// return true if the position changed, false otherwise
virtual bool ScrollLines(int WXUNUSED(lines)) { return false; }
virtual bool ScrollPages(int WXUNUSED(pages)) { return false; }
// convenient wrappers for ScrollLines/Pages
bool LineUp() { return ScrollLines(-1); }
bool LineDown() { return ScrollLines(1); }
bool PageUp() { return ScrollPages(-1); }
bool PageDown() { return ScrollPages(1); }
// call this to always show one or both scrollbars, even if the window
// is big enough to not require them
virtual void AlwaysShowScrollbars(bool WXUNUSED(horz) = true,
bool WXUNUSED(vert) = true)
{
}
// return true if AlwaysShowScrollbars() had been called before for the
// corresponding orientation
virtual bool IsScrollbarAlwaysShown(int WXUNUSED(orient)) const
{
return false;
}
// context-sensitive help
// ----------------------
// these are the convenience functions wrapping wxHelpProvider methods
#if wxUSE_HELP
// associate this help text with this window
void SetHelpText(const wxString& text);
#if WXWIN_COMPATIBILITY_2_8
// Associate this help text with all windows with the same id as this one.
// Don't use this, do wxHelpProvider::Get()->AddHelp(id, text);
wxDEPRECATED( void SetHelpTextForId(const wxString& text) );
#endif // WXWIN_COMPATIBILITY_2_8
// get the help string associated with the given position in this window
//
// notice that pt may be invalid if event origin is keyboard or unknown
// and this method should return the global window help text then
virtual wxString GetHelpTextAtPoint(const wxPoint& pt,
wxHelpEvent::Origin origin) const;
// returns the position-independent help text
wxString GetHelpText() const
{
return GetHelpTextAtPoint(wxDefaultPosition, wxHelpEvent::Origin_Unknown);
}
#else // !wxUSE_HELP
// silently ignore SetHelpText() calls
void SetHelpText(const wxString& WXUNUSED(text)) { }
void SetHelpTextForId(const wxString& WXUNUSED(text)) { }
#endif // wxUSE_HELP
// tooltips
// --------
#if wxUSE_TOOLTIPS
// the easiest way to set a tooltip for a window is to use this method
void SetToolTip( const wxString &tip ) { DoSetToolTipText(tip); }
// attach a tooltip to the window, pointer can be NULL to remove
// existing tooltip
void SetToolTip( wxToolTip *tip ) { DoSetToolTip(tip); }
// more readable synonym for SetToolTip(NULL)
void UnsetToolTip() { SetToolTip(NULL); }
// get the associated tooltip or NULL if none
wxToolTip* GetToolTip() const { return m_tooltip; }
wxString GetToolTipText() const;
// Use the same tool tip as the given one (which can be NULL to indicate
// that no tooltip should be used) for this window. This is currently only
// used by wxCompositeWindow::DoSetToolTip() implementation and is not part
// of the public wx API.
//
// Returns true if tip was valid and we copied it or false if it was NULL
// and we reset our own tooltip too.
bool CopyToolTip(wxToolTip *tip);
#else // !wxUSE_TOOLTIPS
// make it much easier to compile apps in an environment
// that doesn't support tooltips
void SetToolTip(const wxString & WXUNUSED(tip)) { }
void UnsetToolTip() { }
#endif // wxUSE_TOOLTIPS/!wxUSE_TOOLTIPS
// drag and drop
// -------------
#if wxUSE_DRAG_AND_DROP
// set/retrieve the drop target associated with this window (may be
// NULL; it's owned by the window and will be deleted by it)
virtual void SetDropTarget( wxDropTarget *dropTarget ) = 0;
virtual wxDropTarget *GetDropTarget() const { return m_dropTarget; }
// Accept files for dragging
virtual void DragAcceptFiles(bool accept)
#ifdef __WXMSW__
// it does have common implementation but not for MSW which has its own
// native version of it
= 0
#endif // __WXMSW__
;
#endif // wxUSE_DRAG_AND_DROP
// constraints and sizers
// ----------------------
#if wxUSE_CONSTRAINTS
// set the constraints for this window or retrieve them (may be NULL)
void SetConstraints( wxLayoutConstraints *constraints );
wxLayoutConstraints *GetConstraints() const { return m_constraints; }
// implementation only
void UnsetConstraints(wxLayoutConstraints *c);
wxWindowList *GetConstraintsInvolvedIn() const
{ return m_constraintsInvolvedIn; }
void AddConstraintReference(wxWindowBase *otherWin);
void RemoveConstraintReference(wxWindowBase *otherWin);
void DeleteRelatedConstraints();
void ResetConstraints();
// these methods may be overridden for special layout algorithms
virtual void SetConstraintSizes(bool recurse = true);
virtual bool LayoutPhase1(int *noChanges);
virtual bool LayoutPhase2(int *noChanges);
virtual bool DoPhase(int phase);
// these methods are virtual but normally won't be overridden
virtual void SetSizeConstraint(int x, int y, int w, int h);
virtual void MoveConstraint(int x, int y);
virtual void GetSizeConstraint(int *w, int *h) const ;
virtual void GetClientSizeConstraint(int *w, int *h) const ;
virtual void GetPositionConstraint(int *x, int *y) const ;
#endif // wxUSE_CONSTRAINTS
// when using constraints or sizers, it makes sense to update
// children positions automatically whenever the window is resized
// - this is done if autoLayout is on
void SetAutoLayout( bool autoLayout ) { m_autoLayout = autoLayout; }
bool GetAutoLayout() const { return m_autoLayout; }
// lay out the window and its children
virtual bool Layout();
// sizers
void SetSizer(wxSizer *sizer, bool deleteOld = true );
void SetSizerAndFit( wxSizer *sizer, bool deleteOld = true );
wxSizer *GetSizer() const { return m_windowSizer; }
// Track if this window is a member of a sizer
void SetContainingSizer(wxSizer* sizer);
wxSizer *GetContainingSizer() const { return m_containingSizer; }
// accessibility
// ----------------------
#if wxUSE_ACCESSIBILITY
// Override to create a specific accessible object.
virtual wxAccessible* CreateAccessible() { return NULL; }
// Sets the accessible object.
void SetAccessible(wxAccessible* accessible) ;
// Returns the accessible object.
wxAccessible* GetAccessible() { return m_accessible; }
// Returns the accessible object, calling CreateAccessible if necessary.
// May return NULL, in which case system-provide accessible is used.
wxAccessible* GetOrCreateAccessible() ;
#endif
// Set window transparency if the platform supports it
virtual bool SetTransparent(wxByte WXUNUSED(alpha)) { return false; }
virtual bool CanSetTransparent() { return false; }
// implementation
// --------------
// event handlers
void OnSysColourChanged( wxSysColourChangedEvent& event );
void OnInitDialog( wxInitDialogEvent &event );
void OnMiddleClick( wxMouseEvent& event );
#if wxUSE_HELP
void OnHelp(wxHelpEvent& event);
#endif // wxUSE_HELP
// virtual function for implementing internal idle
// behaviour
virtual void OnInternalIdle();
// Send idle event to window and all subwindows
// Returns true if more idle time is requested.
virtual bool SendIdleEvents(wxIdleEvent& event);
// get the handle of the window for the underlying window system: this
// is only used for wxWin itself or for user code which wants to call
// platform-specific APIs
virtual WXWidget GetHandle() const = 0;
// associate the window with a new native handle
virtual void AssociateHandle(WXWidget WXUNUSED(handle)) { }
// dissociate the current native handle from the window
virtual void DissociateHandle() { }
#if wxUSE_PALETTE
// Store the palette used by DCs in wxWindow so that the dcs can share
// a palette. And we can respond to palette messages.
wxPalette GetPalette() const { return m_palette; }
// When palette is changed tell the DC to set the system palette to the
// new one.
void SetPalette(const wxPalette& pal);
// return true if we have a specific palette
bool HasCustomPalette() const { return m_hasCustomPalette; }
// return the first parent window with a custom palette or NULL
wxWindow *GetAncestorWithCustomPalette() const;
#endif // wxUSE_PALETTE
// inherit the parents visual attributes if they had been explicitly set
// by the user (i.e. we don't inherit default attributes) and if we don't
// have our own explicitly set
virtual void InheritAttributes();
// returns false from here if this window doesn't want to inherit the
// parents colours even if InheritAttributes() would normally do it
//
// this just provides a simple way to customize InheritAttributes()
// behaviour in the most common case
virtual bool ShouldInheritColours() const { return false; }
// returns true if the window can be positioned outside of parent's client
// area (normal windows can't, but e.g. menubar or statusbar can):
virtual bool CanBeOutsideClientArea() const { return false; }
// returns true if the platform should explicitly apply a theme border. Currently
// used only by Windows
virtual bool CanApplyThemeBorder() const { return true; }
// returns the main window of composite control; this is the window
// that FindFocus returns if the focus is in one of composite control's
// windows
virtual wxWindow *GetMainWindowOfCompositeControl()
{ return (wxWindow*)this; }
enum NavigationKind
{
Navigation_Tab,
Navigation_Accel
};
// If this function returns true, keyboard events of the given kind can't
// escape from it. A typical example of such "navigation domain" is a top
// level window because pressing TAB in one of them must not transfer focus
// to a different top level window. But it's not limited to them, e.g. MDI
// children frames are not top level windows (and their IsTopLevel()
// returns false) but still are self-contained navigation domains for the
// purposes of TAB navigation -- but not for the accelerators.
virtual bool IsTopNavigationDomain(NavigationKind WXUNUSED(kind)) const
{
return false;
}
protected:
// helper for the derived class Create() methods: the first overload, with
// validator parameter, should be used for child windows while the second
// one is used for top level ones
bool CreateBase(wxWindowBase *parent,
wxWindowID winid,
const wxPoint& pos = wxDefaultPosition,
const wxSize& size = wxDefaultSize,
long style = 0,
const wxValidator& validator = wxDefaultValidator,
const wxString& name = wxPanelNameStr);
bool CreateBase(wxWindowBase *parent,
wxWindowID winid,
const wxPoint& pos,
const wxSize& size,
long style,
const wxString& name);
// event handling specific to wxWindow
virtual bool TryBefore(wxEvent& event) wxOVERRIDE;
virtual bool TryAfter(wxEvent& event) wxOVERRIDE;
enum WindowOrder
{
OrderBefore, // insert before the given window
OrderAfter // insert after the given window
};
// common part of GetPrev/NextSibling()
wxWindow *DoGetSibling(WindowOrder order) const;
// common part of MoveBefore/AfterInTabOrder()
virtual void DoMoveInTabOrder(wxWindow *win, WindowOrder move);
// implementation of Navigate() and NavigateIn()
virtual bool DoNavigateIn(int flags);
#if wxUSE_CONSTRAINTS
// satisfy the constraints for the windows but don't set the window sizes
void SatisfyConstraints();
#endif // wxUSE_CONSTRAINTS
// Send the wxWindowDestroyEvent if not done yet and sets m_isBeingDeleted
// to true
void SendDestroyEvent();
// this method should be implemented to use operating system specific code
// to really enable/disable the widget, it will only be called when we
// really need to enable/disable window and so no additional checks on the
// widgets state are necessary
virtual void DoEnable(bool WXUNUSED(enable)) { }
// the window id - a number which uniquely identifies a window among
// its siblings unless it is wxID_ANY
wxWindowIDRef m_windowId;
// the parent window of this window (or NULL) and the list of the children
// of this window
wxWindow *m_parent;
wxWindowList m_children;
// the minimal allowed size for the window (no minimal size if variable(s)
// contain(s) wxDefaultCoord)
int m_minWidth,
m_minHeight,
m_maxWidth,
m_maxHeight;
// event handler for this window: usually is just 'this' but may be
// changed with SetEventHandler()
wxEvtHandler *m_eventHandler;
#if wxUSE_VALIDATORS
// associated validator or NULL if none
wxValidator *m_windowValidator;
#endif // wxUSE_VALIDATORS
#if wxUSE_DRAG_AND_DROP
wxDropTarget *m_dropTarget;
#endif // wxUSE_DRAG_AND_DROP
// visual window attributes
wxCursor m_cursor;
wxFont m_font; // see m_hasFont
wxColour m_backgroundColour, // m_hasBgCol
m_foregroundColour; // m_hasFgCol
#if wxUSE_CARET
wxCaret *m_caret;
#endif // wxUSE_CARET
// the region which should be repainted in response to paint event
wxRegion m_updateRegion;
#if wxUSE_ACCEL
// the accelerator table for the window which translates key strokes into
// command events
wxAcceleratorTable m_acceleratorTable;
#endif // wxUSE_ACCEL
// the tooltip for this window (may be NULL)
#if wxUSE_TOOLTIPS
wxToolTip *m_tooltip;
#endif // wxUSE_TOOLTIPS
// constraints and sizers
#if wxUSE_CONSTRAINTS
// the constraints for this window or NULL
wxLayoutConstraints *m_constraints;
// constraints this window is involved in
wxWindowList *m_constraintsInvolvedIn;
#endif // wxUSE_CONSTRAINTS
// this window's sizer
wxSizer *m_windowSizer;
// The sizer this window is a member of, if any
wxSizer *m_containingSizer;
// Layout() window automatically when its size changes?
bool m_autoLayout:1;
// window state
bool m_isShown:1;
bool m_isEnabled:1;
bool m_isBeingDeleted:1;
// was the window colours/font explicitly changed by user?
bool m_hasBgCol:1;
bool m_hasFgCol:1;
bool m_hasFont:1;
// and should it be inherited by children?
bool m_inheritBgCol:1;
bool m_inheritFgCol:1;
bool m_inheritFont:1;
// window attributes
long m_windowStyle,
m_exStyle;
wxString m_windowName;
bool m_themeEnabled;
wxBackgroundStyle m_backgroundStyle;
#if wxUSE_PALETTE
wxPalette m_palette;
bool m_hasCustomPalette;
#endif // wxUSE_PALETTE
#if wxUSE_ACCESSIBILITY
wxAccessible* m_accessible;
#endif
// Virtual size (scrolling)
wxSize m_virtualSize;
wxScrollHelper *m_scrollHelper;
wxWindowVariant m_windowVariant ;
// override this to change the default (i.e. used when no style is
// specified) border for the window class
virtual wxBorder GetDefaultBorder() const;
// this allows you to implement standard control borders without
// repeating the code in different classes that are not derived from
// wxControl
virtual wxBorder GetDefaultBorderForControl() const { return wxBORDER_THEME; }
// Get the default size for the new window if no explicit size given. TLWs
// have their own default size so this is just for non top-level windows.
static int WidthDefault(int w) { return w == wxDefaultCoord ? 20 : w; }
static int HeightDefault(int h) { return h == wxDefaultCoord ? 20 : h; }
// Used to save the results of DoGetBestSize so it doesn't need to be
// recalculated each time the value is needed.
wxSize m_bestSizeCache;
#if WXWIN_COMPATIBILITY_2_8
wxDEPRECATED_MSG("use SetInitialSize() instead.")
void SetBestSize(const wxSize& size);
wxDEPRECATED_MSG("use SetInitialSize() instead.")
virtual void SetInitialBestSize(const wxSize& size);
#endif // WXWIN_COMPATIBILITY_2_8
// more pure virtual functions
// ---------------------------
// NB: we must have DoSomething() function when Something() is an overloaded
// method: indeed, we can't just have "virtual Something()" in case when
// the function is overloaded because then we'd have to make virtual all
// the variants (otherwise only the virtual function may be called on a
// pointer to derived class according to C++ rules) which is, in
// general, absolutely not needed. So instead we implement all
// overloaded Something()s in terms of DoSomething() which will be the
// only one to be virtual.
// text extent
virtual void DoGetTextExtent(const wxString& string,
int *x, int *y,
int *descent = NULL,
int *externalLeading = NULL,
const wxFont *font = NULL) const = 0;
// coordinates translation
virtual void DoClientToScreen( int *x, int *y ) const = 0;
virtual void DoScreenToClient( int *x, int *y ) const = 0;
virtual wxHitTest DoHitTest(wxCoord x, wxCoord y) const;
// capture/release the mouse, used by Capture/ReleaseMouse()
virtual void DoCaptureMouse() = 0;
virtual void DoReleaseMouse() = 0;
// retrieve the position/size of the window
virtual void DoGetPosition(int *x, int *y) const = 0;
virtual void DoGetScreenPosition(int *x, int *y) const;
virtual void DoGetSize(int *width, int *height) const = 0;
virtual void DoGetClientSize(int *width, int *height) const = 0;
// get the size which best suits the window: for a control, it would be
// the minimal size which doesn't truncate the control, for a panel - the
// same size as it would have after a call to Fit()
virtual wxSize DoGetBestSize() const;
// this method can be overridden instead of DoGetBestSize() if it computes
// the best size of the client area of the window only, excluding borders
// (GetBorderSize() will be used to add them)
virtual wxSize DoGetBestClientSize() const { return wxDefaultSize; }
// These two methods can be overridden to implement intelligent
// width-for-height and/or height-for-width best size determination for the
// window. By default the fixed best size is used.
virtual int DoGetBestClientHeight(int WXUNUSED(width)) const
{ return wxDefaultCoord; }
virtual int DoGetBestClientWidth(int WXUNUSED(height)) const
{ return wxDefaultCoord; }
// this is the virtual function to be overridden in any derived class which
// wants to change how SetSize() or Move() works - it is called by all
// versions of these functions in the base class
virtual void DoSetSize(int x, int y,
int width, int height,
int sizeFlags = wxSIZE_AUTO) = 0;
// same as DoSetSize() for the client size
virtual void DoSetClientSize(int width, int height) = 0;
virtual void DoSetSizeHints( int minW, int minH,
int maxW, int maxH,
int incW, int incH );
// return the total size of the window borders, i.e. the sum of the widths
// of the left and the right border in the x component of the returned size
// and the sum of the heights of the top and bottom borders in the y one
//
// NB: this is currently only implemented properly for wxMSW, wxGTK and
// wxUniv and doesn't behave correctly in the presence of scrollbars in
// the other ports
virtual wxSize DoGetBorderSize() const;
// move the window to the specified location and resize it: this is called
// from both DoSetSize() and DoSetClientSize() and would usually just
// reposition this window except for composite controls which will want to
// arrange themselves inside the given rectangle
//
// Important note: the coordinates passed to this method are in parent's
// *window* coordinates and not parent's client coordinates (as the values
// passed to DoSetSize and returned by DoGetPosition are)!
virtual void DoMoveWindow(int x, int y, int width, int height) = 0;
// centre the window in the specified direction on parent, note that
// wxCENTRE_ON_SCREEN shouldn't be specified here, it only makes sense for
// TLWs
virtual void DoCentre(int dir);
#if wxUSE_TOOLTIPS
virtual void DoSetToolTipText( const wxString &tip );
virtual void DoSetToolTip( wxToolTip *tip );
#endif // wxUSE_TOOLTIPS
#if wxUSE_MENUS
virtual bool DoPopupMenu(wxMenu *menu, int x, int y) = 0;
#endif // wxUSE_MENUS
// Makes an adjustment to the window position to make it relative to the
// parents client area, e.g. if the parent is a frame with a toolbar, its
// (0, 0) is just below the toolbar
virtual void AdjustForParentClientOrigin(int& x, int& y,
int sizeFlags = 0) const;
// implements the window variants
virtual void DoSetWindowVariant( wxWindowVariant variant ) ;
// really freeze/thaw the window (should have port-specific implementation)
virtual void DoFreeze() { }
virtual void DoThaw() { }
// Must be called when mouse capture is lost to send
// wxMouseCaptureLostEvent to windows on capture stack.
static void NotifyCaptureLost();
private:
// recursively call our own and our children DoEnable() when the
// enabled/disabled status changed because a parent window had been
// enabled/disabled
void NotifyWindowOnEnableChange(bool enabled);
#if wxUSE_MENUS
// temporary event handlers used by GetPopupMenuSelectionFromUser()
void InternalOnPopupMenu(wxCommandEvent& event);
void InternalOnPopupMenuUpdate(wxUpdateUIEvent& event);
// implementation of the public GetPopupMenuSelectionFromUser() method
int DoGetPopupMenuSelectionFromUser(wxMenu& menu, int x, int y);
#endif // wxUSE_MENUS
// layout the window children when its size changes unless this was
// explicitly disabled with SetAutoLayout(false)
void InternalOnSize(wxSizeEvent& event);
// base for dialog unit conversion, i.e. average character size
wxSize GetDlgUnitBase() const;
// number of Freeze() calls minus the number of Thaw() calls: we're frozen
// (i.e. not being updated) if it is positive
unsigned int m_freezeCount;
wxDECLARE_ABSTRACT_CLASS(wxWindowBase);
wxDECLARE_NO_COPY_CLASS(wxWindowBase);
wxDECLARE_EVENT_TABLE();
};
#if WXWIN_COMPATIBILITY_2_8
// Inlines for some deprecated methods
inline wxSize wxWindowBase::GetBestFittingSize() const
{
return GetEffectiveMinSize();
}
inline void wxWindowBase::SetBestFittingSize(const wxSize& size)
{
SetInitialSize(size);
}
inline void wxWindowBase::SetBestSize(const wxSize& size)
{
SetInitialSize(size);
}
inline void wxWindowBase::SetInitialBestSize(const wxSize& size)
{
SetInitialSize(size);
}
#endif // WXWIN_COMPATIBILITY_2_8
// ----------------------------------------------------------------------------
// now include the declaration of wxWindow class
// ----------------------------------------------------------------------------
// include the declaration of the platform-specific class
#if defined(__WXMSW__)
#ifdef __WXUNIVERSAL__
#define wxWindowNative wxWindowMSW
#else // !wxUniv
#define wxWindowMSW wxWindow
#endif // wxUniv/!wxUniv
#include "wx/msw/window.h"
#elif defined(__WXMOTIF__)
#include "wx/motif/window.h"
#elif defined(__WXGTK20__)
#ifdef __WXUNIVERSAL__
#define wxWindowNative wxWindowGTK
#else // !wxUniv
#define wxWindowGTK wxWindow
#endif // wxUniv
#include "wx/gtk/window.h"
#ifdef __WXGTK3__
#define wxHAVE_DPI_INDEPENDENT_PIXELS
#endif
#elif defined(__WXGTK__)
#ifdef __WXUNIVERSAL__
#define wxWindowNative wxWindowGTK
#else // !wxUniv
#define wxWindowGTK wxWindow
#endif // wxUniv
#include "wx/gtk1/window.h"
#elif defined(__WXX11__)
#ifdef __WXUNIVERSAL__
#define wxWindowNative wxWindowX11
#else // !wxUniv
#define wxWindowX11 wxWindow
#endif // wxUniv
#include "wx/x11/window.h"
#elif defined(__WXDFB__)
#define wxWindowNative wxWindowDFB
#include "wx/dfb/window.h"
#elif defined(__WXMAC__)
#ifdef __WXUNIVERSAL__
#define wxWindowNative wxWindowMac
#else // !wxUniv
#define wxWindowMac wxWindow
#endif // wxUniv
#include "wx/osx/window.h"
#define wxHAVE_DPI_INDEPENDENT_PIXELS
#elif defined(__WXQT__)
#ifdef __WXUNIVERSAL__
#define wxWindowNative wxWindowQt
#else // !wxUniv
#define wxWindowQt wxWindow
#endif // wxUniv
#include "wx/qt/window.h"
#endif
// for wxUniversal, we now derive the real wxWindow from wxWindow<platform>,
// for the native ports we already have defined it above
#if defined(__WXUNIVERSAL__)
#ifndef wxWindowNative
#error "wxWindowNative must be defined above!"
#endif
#include "wx/univ/window.h"
#endif // wxUniv
// ----------------------------------------------------------------------------
// inline functions which couldn't be declared in the class body because of
// forward dependencies
// ----------------------------------------------------------------------------
inline wxWindow *wxWindowBase::GetGrandParent() const
{
return m_parent ? m_parent->GetParent() : NULL;
}
#ifdef wxHAVE_DPI_INDEPENDENT_PIXELS
// FromDIP() and ToDIP() become trivial in this case, so make them inline to
// avoid any overhead.
/* static */
inline wxSize
wxWindowBase::FromDIP(const wxSize& sz, const wxWindowBase* WXUNUSED(w))
{
return sz;
}
/* static */
inline wxSize
wxWindowBase::ToDIP(const wxSize& sz, const wxWindowBase* WXUNUSED(w))
{
return sz;
}
#endif // wxHAVE_DPI_INDEPENDENT_PIXELS
// ----------------------------------------------------------------------------
// global functions
// ----------------------------------------------------------------------------
// Find the wxWindow at the current mouse position, also returning the mouse
// position.
extern WXDLLIMPEXP_CORE wxWindow* wxFindWindowAtPointer(wxPoint& pt);
// Get the current mouse position.
extern WXDLLIMPEXP_CORE wxPoint wxGetMousePosition();
// get the currently active window of this application or NULL
extern WXDLLIMPEXP_CORE wxWindow *wxGetActiveWindow();
// get the (first) top level parent window
WXDLLIMPEXP_CORE wxWindow* wxGetTopLevelParent(wxWindow *win);
#if wxUSE_ACCESSIBILITY
// ----------------------------------------------------------------------------
// accessible object for windows
// ----------------------------------------------------------------------------
class WXDLLIMPEXP_CORE wxWindowAccessible: public wxAccessible
{
public:
wxWindowAccessible(wxWindow* win): wxAccessible(win) { if (win) win->SetAccessible(this); }
virtual ~wxWindowAccessible() {}
// Overridables
// Can return either a child object, or an integer
// representing the child element, starting from 1.
virtual wxAccStatus HitTest(const wxPoint& pt, int* childId, wxAccessible** childObject) wxOVERRIDE;
// Returns the rectangle for this object (id = 0) or a child element (id > 0).
virtual wxAccStatus GetLocation(wxRect& rect, int elementId) wxOVERRIDE;
// Navigates from fromId to toId/toObject.
virtual wxAccStatus Navigate(wxNavDir navDir, int fromId,
int* toId, wxAccessible** toObject) wxOVERRIDE;
// Gets the name of the specified object.
virtual wxAccStatus GetName(int childId, wxString* name) wxOVERRIDE;
// Gets the number of children.
virtual wxAccStatus GetChildCount(int* childCount) wxOVERRIDE;
// 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 childId, wxAccessible** child) wxOVERRIDE;
// Gets the parent, or NULL.
virtual wxAccStatus GetParent(wxAccessible** parent) wxOVERRIDE;
// 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 childId) wxOVERRIDE;
// 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 childId, wxString* actionName) wxOVERRIDE;
// Returns the description for this object or a child.
virtual wxAccStatus GetDescription(int childId, wxString* description) wxOVERRIDE;
// Returns help text for this object or a child, similar to tooltip text.
virtual wxAccStatus GetHelpText(int childId, wxString* helpText) wxOVERRIDE;
// Returns the keyboard shortcut for this object or child.
// Return e.g. ALT+K
virtual wxAccStatus GetKeyboardShortcut(int childId, wxString* shortcut) wxOVERRIDE;
// Returns a role constant.
virtual wxAccStatus GetRole(int childId, wxAccRole* role) wxOVERRIDE;
// Returns a state constant.
virtual wxAccStatus GetState(int childId, long* state) wxOVERRIDE;
// Returns a localized string representing the value for the object
// or child.
virtual wxAccStatus GetValue(int childId, wxString* strValue) wxOVERRIDE;
// Selects the object or child.
virtual wxAccStatus Select(int childId, wxAccSelectionFlags selectFlags) wxOVERRIDE;
// 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* childId, wxAccessible** child) wxOVERRIDE;
#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* selections) wxOVERRIDE;
#endif // wxUSE_VARIANT
};
#endif // wxUSE_ACCESSIBILITY
#endif // _WX_WINDOW_H_BASE_
| h |
rticonnextdds-usecases | data/projects/rticonnextdds-usecases/VehicleTracking/ExampleCode/thirdparty/wxWidgets-3.1.2/Linux/include/wx/appprogress.h | /////////////////////////////////////////////////////////////////////////////
// Name: wx/appprogress.h
// Purpose: wxAppProgressIndicator interface.
// Author: Chaobin Zhang <[email protected]>
// Created: 2014-09-05
// Copyright: (c) 2014 wxWidgets development team
// Licence: wxWindows licence
/////////////////////////////////////////////////////////////////////////////
#ifndef _WX_APPPROG_H_
#define _WX_APPPROG_H_
#include "wx/defs.h"
class WXDLLIMPEXP_CORE wxAppProgressIndicatorBase
{
public:
wxAppProgressIndicatorBase() {}
virtual ~wxAppProgressIndicatorBase() {}
virtual bool IsAvailable() const = 0;
virtual void SetValue(int value) = 0;
virtual void SetRange(int range) = 0;
virtual void Pulse() = 0;
virtual void Reset() = 0;
private:
wxDECLARE_NO_COPY_CLASS(wxAppProgressIndicatorBase);
};
#if defined(__WXMSW__) && wxUSE_TASKBARBUTTON
#include "wx/msw/appprogress.h"
#elif defined(__WXOSX_COCOA__)
#include "wx/osx/appprogress.h"
#else
class wxAppProgressIndicator : public wxAppProgressIndicatorBase
{
public:
wxAppProgressIndicator(wxWindow* WXUNUSED(parent) = NULL,
int WXUNUSED(maxValue) = 100)
{
}
virtual bool IsAvailable() const wxOVERRIDE { return false; }
virtual void SetValue(int WXUNUSED(value)) wxOVERRIDE { }
virtual void SetRange(int WXUNUSED(range)) wxOVERRIDE { }
virtual void Pulse() wxOVERRIDE { }
virtual void Reset() wxOVERRIDE { }
};
#endif
#endif // _WX_APPPROG_H_
| h |
rticonnextdds-usecases | data/projects/rticonnextdds-usecases/VehicleTracking/ExampleCode/thirdparty/wxWidgets-3.1.2/Linux/include/wx/busyinfo.h | /////////////////////////////////////////////////////////////////////////////
// Name: wx/busyinfo.h
// Purpose: Information window (when app is busy)
// Author: Vaclav Slavik
// Copyright: (c) 1999 Vaclav Slavik
// Licence: wxWindows licence
/////////////////////////////////////////////////////////////////////////////
#ifndef __BUSYINFO_H_BASE__
#define __BUSYINFO_H_BASE__
#include "wx/defs.h"
#if wxUSE_BUSYINFO
#include "wx/colour.h"
#include "wx/icon.h"
class WXDLLIMPEXP_FWD_CORE wxWindow;
// This class is used to pass all the various parameters to wxBusyInfo ctor.
// According to the usual naming conventions (see wxAboutDialogInfo,
// wxFontInfo, ...) it would be called wxBusyInfoInfo, but this would have been
// rather strange, so we call it wxBusyInfoFlags instead.
//
// Methods are mostly self-explanatory except for the difference between "Text"
// and "Label": the former can contain markup, while the latter is just plain
// string which is not parsed in any way.
class wxBusyInfoFlags
{
public:
wxBusyInfoFlags()
{
m_parent = NULL;
m_alpha = wxALPHA_OPAQUE;
}
wxBusyInfoFlags& Parent(wxWindow* parent)
{ m_parent = parent; return *this; }
wxBusyInfoFlags& Icon(const wxIcon& icon)
{ m_icon = icon; return *this; }
wxBusyInfoFlags& Title(const wxString& title)
{ m_title = title; return *this; }
wxBusyInfoFlags& Text(const wxString& text)
{ m_text = text; return *this; }
wxBusyInfoFlags& Label(const wxString& label)
{ m_label = label; return *this; }
wxBusyInfoFlags& Foreground(const wxColour& foreground)
{ m_foreground = foreground; return *this; }
wxBusyInfoFlags& Background(const wxColour& background)
{ m_background = background; return *this; }
wxBusyInfoFlags& Transparency(wxByte alpha)
{ m_alpha = alpha; return *this; }
private:
wxWindow* m_parent;
wxIcon m_icon;
wxString m_title,
m_text,
m_label;
wxColour m_foreground,
m_background;
wxByte m_alpha;
friend class wxBusyInfo;
};
#include "wx/generic/busyinfo.h"
#endif // wxUSE_BUSYINFO
#endif // __BUSYINFO_H_BASE__
| h |
rticonnextdds-usecases | data/projects/rticonnextdds-usecases/VehicleTracking/ExampleCode/thirdparty/wxWidgets-3.1.2/Linux/include/wx/selstore.h | ///////////////////////////////////////////////////////////////////////////////
// Name: wx/selstore.h
// Purpose: wxSelectionStore stores selected items in a control
// Author: Vadim Zeitlin
// Modified by:
// Created: 08.06.03 (extracted from src/generic/listctrl.cpp)
// Copyright: (c) 2000-2003 Vadim Zeitlin <[email protected]>
// Licence: wxWindows licence
///////////////////////////////////////////////////////////////////////////////
#ifndef _WX_SELSTORE_H_
#define _WX_SELSTORE_H_
#include "wx/dynarray.h"
// ----------------------------------------------------------------------------
// wxSelectedIndices is just a sorted array of indices
// ----------------------------------------------------------------------------
inline int CMPFUNC_CONV wxUIntCmp(unsigned n1, unsigned n2)
{
return (int)(n1 - n2);
}
WX_DEFINE_SORTED_EXPORTED_ARRAY_CMP_INT(unsigned, wxUIntCmp, wxSelectedIndices);
// ----------------------------------------------------------------------------
// wxSelectionStore is used to store the selected items in the virtual
// controls, i.e. it is well suited for storing even when the control contains
// a huge (practically infinite) number of items.
//
// Of course, internally it still has to store the selected items somehow (as
// an array currently) but the advantage is that it can handle the selection
// of all items (common operation) efficiently and that it could be made even
// smarter in the future (e.g. store the selections as an array of ranges +
// individual items) without changing its API.
// ----------------------------------------------------------------------------
class WXDLLIMPEXP_CORE wxSelectionStore
{
public:
wxSelectionStore() : m_itemsSel(wxUIntCmp) { Init(); }
// set the total number of items we handle
void SetItemCount(unsigned count);
// special case of SetItemCount(0)
void Clear() { m_itemsSel.Clear(); m_count = 0; m_defaultState = false; }
// must be called when new items are inserted/added
void OnItemsInserted(unsigned item, unsigned numItems);
// must be called when an items is deleted
void OnItemDelete(unsigned item);
// more efficient version for notifying the selection about deleting
// several items at once, return true if any of them were selected
bool OnItemsDeleted(unsigned item, unsigned numItems);
// select one item, use SelectRange() insted if possible!
//
// returns true if the items selection really changed
bool SelectItem(unsigned item, bool select = true);
// select the range of items (inclusive)
//
// return true and fill the itemsChanged array with the indices of items
// which have changed state if "few" of them did, otherwise return false
// (meaning that too many items changed state to bother counting them
// individually)
bool SelectRange(unsigned itemFrom, unsigned itemTo,
bool select = true,
wxArrayInt *itemsChanged = NULL);
// return true if the given item is selected
bool IsSelected(unsigned item) const;
// return true if no items are currently selected
bool IsEmpty() const
{
return m_defaultState ? m_itemsSel.size() == m_count
: m_itemsSel.empty();
}
// return the total number of selected items
unsigned GetSelectedCount() const
{
return m_defaultState ? m_count - m_itemsSel.GetCount()
: m_itemsSel.GetCount();
}
// type of a "cookie" used to preserve the iteration state, this is an
// opaque type, don't rely on its current representation
typedef size_t IterationState;
// constant representing absence of selection and hence end of iteration
static const unsigned NO_SELECTION;
// get the first selected item in index order, return NO_SELECTION if none
unsigned GetFirstSelectedItem(IterationState& cookie) const;
// get the next selected item, return NO_SELECTION if no more
unsigned GetNextSelectedItem(IterationState& cookie) const;
private:
// (re)init
void Init() { m_count = 0; m_defaultState = false; }
// the total number of items we handle
unsigned m_count;
// the default state: normally, false (i.e. off) but maybe set to true if
// there are more selected items than non selected ones - this allows to
// handle selection of all items efficiently
bool m_defaultState;
// the array of items whose selection state is different from default
wxSelectedIndices m_itemsSel;
wxDECLARE_NO_COPY_CLASS(wxSelectionStore);
};
#endif // _WX_SELSTORE_H_
| h |
rticonnextdds-usecases | data/projects/rticonnextdds-usecases/VehicleTracking/ExampleCode/thirdparty/wxWidgets-3.1.2/Linux/include/wx/docmdi.h | /////////////////////////////////////////////////////////////////////////////
// Name: wx/docmdi.h
// Purpose: Frame classes for MDI document/view applications
// Author: Julian Smart
// Created: 01/02/97
// Copyright: (c) 1997 Julian Smart
// (c) 2010 Vadim Zeitlin
// Licence: wxWindows licence
/////////////////////////////////////////////////////////////////////////////
#ifndef _WX_DOCMDI_H_
#define _WX_DOCMDI_H_
#include "wx/defs.h"
#if wxUSE_MDI_ARCHITECTURE
#include "wx/docview.h"
#include "wx/mdi.h"
// Define MDI versions of the doc-view frame classes. Note that we need to
// define them as classes for wxRTTI, otherwise we could simply define them as
// typedefs.
// ----------------------------------------------------------------------------
// An MDI document parent frame
// ----------------------------------------------------------------------------
typedef
wxDocParentFrameAny<wxMDIParentFrame> wxDocMDIParentFrameBase;
class WXDLLIMPEXP_CORE wxDocMDIParentFrame : public wxDocMDIParentFrameBase
{
public:
wxDocMDIParentFrame() : wxDocMDIParentFrameBase() { }
wxDocMDIParentFrame(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)
: wxDocMDIParentFrameBase(manager,
parent, id, title, pos, size, style, name)
{
}
private:
wxDECLARE_CLASS(wxDocMDIParentFrame);
wxDECLARE_NO_COPY_CLASS(wxDocMDIParentFrame);
};
// ----------------------------------------------------------------------------
// An MDI document child frame
// ----------------------------------------------------------------------------
typedef
wxDocChildFrameAny<wxMDIChildFrame, wxMDIParentFrame> wxDocMDIChildFrameBase;
class WXDLLIMPEXP_CORE wxDocMDIChildFrame : public wxDocMDIChildFrameBase
{
public:
wxDocMDIChildFrame() { }
wxDocMDIChildFrame(wxDocument *doc,
wxView *view,
wxMDIParentFrame *parent,
wxWindowID id,
const wxString& title,
const wxPoint& pos = wxDefaultPosition,
const wxSize& size = wxDefaultSize,
long style = wxDEFAULT_FRAME_STYLE,
const wxString& name = wxFrameNameStr)
: wxDocMDIChildFrameBase(doc, view,
parent, id, title, pos, size, style, name)
{
}
private:
wxDECLARE_CLASS(wxDocMDIChildFrame);
wxDECLARE_NO_COPY_CLASS(wxDocMDIChildFrame);
};
#endif // wxUSE_MDI_ARCHITECTURE
#endif // _WX_DOCMDI_H_
| h |
rticonnextdds-usecases | data/projects/rticonnextdds-usecases/VehicleTracking/ExampleCode/thirdparty/wxWidgets-3.1.2/Linux/include/wx/overlay.h | /////////////////////////////////////////////////////////////////////////////
// Name: wx/overlay.h
// Purpose: wxOverlay class
// Author: Stefan Csomor
// Modified by:
// Created: 2006-10-20
// Copyright: (c) wxWidgets team
// Licence: wxWindows licence
/////////////////////////////////////////////////////////////////////////////
#ifndef _WX_OVERLAY_H_
#define _WX_OVERLAY_H_
#include "wx/defs.h"
#if defined(__WXDFB__)
#define wxHAS_NATIVE_OVERLAY 1
#elif defined(__WXOSX__) && wxOSX_USE_COCOA
#define wxHAS_NATIVE_OVERLAY 1
#else
// don't define wxHAS_NATIVE_OVERLAY
#endif
// ----------------------------------------------------------------------------
// creates an overlay over an existing window, allowing for manipulations like
// rubberbanding etc. This API is not stable yet, not to be used outside wx
// internal code
// ----------------------------------------------------------------------------
class WXDLLIMPEXP_FWD_CORE wxOverlayImpl;
class WXDLLIMPEXP_FWD_CORE wxDC;
class WXDLLIMPEXP_CORE wxOverlay
{
public:
wxOverlay();
~wxOverlay();
// clears the overlay without restoring the former state
// to be done eg when the window content has been changed and repainted
void Reset();
// returns (port-specific) implementation of the overlay
wxOverlayImpl *GetImpl() { return m_impl; }
private:
friend class WXDLLIMPEXP_FWD_CORE wxDCOverlay;
// returns true if it has been setup
bool IsOk();
void Init(wxDC* dc, int x , int y , int width , int height);
void BeginDrawing(wxDC* dc);
void EndDrawing(wxDC* dc);
void Clear(wxDC* dc);
wxOverlayImpl* m_impl;
bool m_inDrawing;
wxDECLARE_NO_COPY_CLASS(wxOverlay);
};
class WXDLLIMPEXP_CORE wxDCOverlay
{
public:
// connects this overlay to the corresponding drawing dc, if the overlay is
// not initialized yet this call will do so
wxDCOverlay(wxOverlay &overlay, wxDC *dc, int x , int y , int width , int height);
// convenience wrapper that behaves the same using the entire area of the dc
wxDCOverlay(wxOverlay &overlay, wxDC *dc);
// removes the connection between the overlay and the dc
virtual ~wxDCOverlay();
// clears the layer, restoring the state at the last init
void Clear();
private:
void Init(wxDC *dc, int x , int y , int width , int height);
wxOverlay& m_overlay;
wxDC* m_dc;
wxDECLARE_NO_COPY_CLASS(wxDCOverlay);
};
#endif // _WX_OVERLAY_H_
| h |
rticonnextdds-usecases | data/projects/rticonnextdds-usecases/VehicleTracking/ExampleCode/thirdparty/wxWidgets-3.1.2/Linux/include/wx/dc.h | /////////////////////////////////////////////////////////////////////////////
// Name: wx/dc.h
// Purpose: wxDC class
// Author: Vadim Zeitlin
// Modified by:
// Created: 05/25/99
// Copyright: (c) wxWidgets team
// Licence: wxWindows licence
/////////////////////////////////////////////////////////////////////////////
#ifndef _WX_DC_H_BASE_
#define _WX_DC_H_BASE_
// ----------------------------------------------------------------------------
// headers which we must include here
// ----------------------------------------------------------------------------
#include "wx/object.h" // the base class
#include "wx/intl.h" // for wxLayoutDirection
#include "wx/colour.h" // we have member variables of these classes
#include "wx/font.h" // so we can't do without them
#include "wx/bitmap.h" // for wxNullBitmap
#include "wx/brush.h"
#include "wx/pen.h"
#include "wx/palette.h"
#include "wx/dynarray.h"
#include "wx/math.h"
#include "wx/image.h"
#include "wx/region.h"
#include "wx/affinematrix2d.h"
#define wxUSE_NEW_DC 1
class WXDLLIMPEXP_FWD_CORE wxDC;
class WXDLLIMPEXP_FWD_CORE wxClientDC;
class WXDLLIMPEXP_FWD_CORE wxPaintDC;
class WXDLLIMPEXP_FWD_CORE wxWindowDC;
class WXDLLIMPEXP_FWD_CORE wxScreenDC;
class WXDLLIMPEXP_FWD_CORE wxMemoryDC;
class WXDLLIMPEXP_FWD_CORE wxPrinterDC;
class WXDLLIMPEXP_FWD_CORE wxPrintData;
class WXDLLIMPEXP_FWD_CORE wxWindow;
#if wxUSE_GRAPHICS_CONTEXT
class WXDLLIMPEXP_FWD_CORE wxGraphicsContext;
#endif
// Logical ops
enum wxRasterOperationMode
{
wxCLEAR, // 0
wxXOR, // src XOR dst
wxINVERT, // NOT dst
wxOR_REVERSE, // src OR (NOT dst)
wxAND_REVERSE, // src AND (NOT dst)
wxCOPY, // src
wxAND, // src AND dst
wxAND_INVERT, // (NOT src) AND dst
wxNO_OP, // dst
wxNOR, // (NOT src) AND (NOT dst)
wxEQUIV, // (NOT src) XOR dst
wxSRC_INVERT, // (NOT src)
wxOR_INVERT, // (NOT src) OR dst
wxNAND, // (NOT src) OR (NOT dst)
wxOR, // src OR dst
wxSET // 1
#if WXWIN_COMPATIBILITY_2_8
,wxROP_BLACK = wxCLEAR,
wxBLIT_BLACKNESS = wxCLEAR,
wxROP_XORPEN = wxXOR,
wxBLIT_SRCINVERT = wxXOR,
wxROP_NOT = wxINVERT,
wxBLIT_DSTINVERT = wxINVERT,
wxROP_MERGEPENNOT = wxOR_REVERSE,
wxBLIT_00DD0228 = wxOR_REVERSE,
wxROP_MASKPENNOT = wxAND_REVERSE,
wxBLIT_SRCERASE = wxAND_REVERSE,
wxROP_COPYPEN = wxCOPY,
wxBLIT_SRCCOPY = wxCOPY,
wxROP_MASKPEN = wxAND,
wxBLIT_SRCAND = wxAND,
wxROP_MASKNOTPEN = wxAND_INVERT,
wxBLIT_00220326 = wxAND_INVERT,
wxROP_NOP = wxNO_OP,
wxBLIT_00AA0029 = wxNO_OP,
wxROP_NOTMERGEPEN = wxNOR,
wxBLIT_NOTSRCERASE = wxNOR,
wxROP_NOTXORPEN = wxEQUIV,
wxBLIT_00990066 = wxEQUIV,
wxROP_NOTCOPYPEN = wxSRC_INVERT,
wxBLIT_NOTSCRCOPY = wxSRC_INVERT,
wxROP_MERGENOTPEN = wxOR_INVERT,
wxBLIT_MERGEPAINT = wxOR_INVERT,
wxROP_NOTMASKPEN = wxNAND,
wxBLIT_007700E6 = wxNAND,
wxROP_MERGEPEN = wxOR,
wxBLIT_SRCPAINT = wxOR,
wxROP_WHITE = wxSET,
wxBLIT_WHITENESS = wxSET
#endif //WXWIN_COMPATIBILITY_2_8
};
// Flood styles
enum wxFloodFillStyle
{
wxFLOOD_SURFACE = 1,
wxFLOOD_BORDER
};
// Mapping modes
enum wxMappingMode
{
wxMM_TEXT = 1,
wxMM_METRIC,
wxMM_LOMETRIC,
wxMM_TWIPS,
wxMM_POINTS
};
// Description of text characteristics.
struct wxFontMetrics
{
wxFontMetrics()
{
height =
ascent =
descent =
internalLeading =
externalLeading =
averageWidth = 0;
}
int height, // Total character height.
ascent, // Part of the height above the baseline.
descent, // Part of the height below the baseline.
internalLeading, // Intra-line spacing.
externalLeading, // Inter-line spacing.
averageWidth; // Average font width, a.k.a. "x-width".
};
#if WXWIN_COMPATIBILITY_2_8
//-----------------------------------------------------------------------------
// wxDrawObject helper class
//-----------------------------------------------------------------------------
class WXDLLIMPEXP_CORE wxDrawObject
{
public:
wxDEPRECATED_CONSTRUCTOR(wxDrawObject)()
: m_isBBoxValid(false)
, m_minX(0), m_minY(0), m_maxX(0), m_maxY(0)
{ }
virtual ~wxDrawObject() { }
virtual void Draw(wxDC&) const { }
virtual void CalcBoundingBox(wxCoord x, wxCoord y)
{
if ( m_isBBoxValid )
{
if ( x < m_minX ) m_minX = x;
if ( y < m_minY ) m_minY = y;
if ( x > m_maxX ) m_maxX = x;
if ( y > m_maxY ) m_maxY = y;
}
else
{
m_isBBoxValid = true;
m_minX = x;
m_minY = y;
m_maxX = x;
m_maxY = y;
}
}
void ResetBoundingBox()
{
m_isBBoxValid = false;
m_minX = m_maxX = m_minY = m_maxY = 0;
}
// Get the final bounding box of the PostScript or Metafile picture.
wxCoord MinX() const { return m_minX; }
wxCoord MaxX() const { return m_maxX; }
wxCoord MinY() const { return m_minY; }
wxCoord MaxY() const { return m_maxY; }
//to define the type of object for derived objects
virtual int GetType()=0;
protected:
//for boundingbox calculation
bool m_isBBoxValid:1;
//for boundingbox calculation
wxCoord m_minX, m_minY, m_maxX, m_maxY;
};
#endif // WXWIN_COMPATIBILITY_2_8
//-----------------------------------------------------------------------------
// wxDCFactory
//-----------------------------------------------------------------------------
class WXDLLIMPEXP_FWD_CORE wxDCImpl;
class WXDLLIMPEXP_CORE wxDCFactory
{
public:
wxDCFactory() {}
virtual ~wxDCFactory() {}
virtual wxDCImpl* CreateWindowDC( wxWindowDC *owner, wxWindow *window ) = 0;
virtual wxDCImpl* CreateClientDC( wxClientDC *owner, wxWindow *window ) = 0;
virtual wxDCImpl* CreatePaintDC( wxPaintDC *owner, wxWindow *window ) = 0;
virtual wxDCImpl* CreateMemoryDC( wxMemoryDC *owner ) = 0;
virtual wxDCImpl* CreateMemoryDC( wxMemoryDC *owner, wxBitmap &bitmap ) = 0;
virtual wxDCImpl* CreateMemoryDC( wxMemoryDC *owner, wxDC *dc ) = 0;
virtual wxDCImpl* CreateScreenDC( wxScreenDC *owner ) = 0;
#if wxUSE_PRINTING_ARCHITECTURE
virtual wxDCImpl* CreatePrinterDC( wxPrinterDC *owner, const wxPrintData &data ) = 0;
#endif
static void Set(wxDCFactory *factory);
static wxDCFactory *Get();
private:
static wxDCFactory *m_factory;
};
//-----------------------------------------------------------------------------
// wxNativeDCFactory
//-----------------------------------------------------------------------------
class WXDLLIMPEXP_CORE wxNativeDCFactory: public wxDCFactory
{
public:
wxNativeDCFactory() {}
virtual wxDCImpl* CreateWindowDC( wxWindowDC *owner, wxWindow *window ) wxOVERRIDE;
virtual wxDCImpl* CreateClientDC( wxClientDC *owner, wxWindow *window ) wxOVERRIDE;
virtual wxDCImpl* CreatePaintDC( wxPaintDC *owner, wxWindow *window ) wxOVERRIDE;
virtual wxDCImpl* CreateMemoryDC( wxMemoryDC *owner ) wxOVERRIDE;
virtual wxDCImpl* CreateMemoryDC( wxMemoryDC *owner, wxBitmap &bitmap ) wxOVERRIDE;
virtual wxDCImpl* CreateMemoryDC( wxMemoryDC *owner, wxDC *dc ) wxOVERRIDE;
virtual wxDCImpl* CreateScreenDC( wxScreenDC *owner ) wxOVERRIDE;
#if wxUSE_PRINTING_ARCHITECTURE
virtual wxDCImpl* CreatePrinterDC( wxPrinterDC *owner, const wxPrintData &data ) wxOVERRIDE;
#endif
};
//-----------------------------------------------------------------------------
// wxDCImpl
//-----------------------------------------------------------------------------
class WXDLLIMPEXP_CORE wxDCImpl: public wxObject
{
public:
wxDCImpl( wxDC *owner );
virtual ~wxDCImpl();
wxDC *GetOwner() const { return m_owner; }
wxWindow* GetWindow() const { return m_window; }
virtual bool IsOk() const { return m_ok; }
// query capabilities
virtual bool CanDrawBitmap() const = 0;
virtual bool CanGetTextExtent() const = 0;
// get Cairo context
virtual void* GetCairoContext() const
{
return NULL;
}
virtual void* GetHandle() const { return NULL; }
// query dimension, colour deps, resolution
virtual void DoGetSize(int *width, int *height) const = 0;
void GetSize(int *width, int *height) const
{
DoGetSize(width, height);
return ;
}
wxSize GetSize() const
{
int w, h;
DoGetSize(&w, &h);
return wxSize(w, h);
}
virtual void DoGetSizeMM(int* width, int* height) const = 0;
virtual int GetDepth() const = 0;
virtual wxSize GetPPI() const = 0;
// Right-To-Left (RTL) modes
virtual void SetLayoutDirection(wxLayoutDirection WXUNUSED(dir)) { }
virtual wxLayoutDirection GetLayoutDirection() const { return wxLayout_Default; }
// page and document
virtual bool StartDoc(const wxString& WXUNUSED(message)) { return true; }
virtual void EndDoc() { }
virtual void StartPage() { }
virtual void EndPage() { }
// flushing the content of this dc immediately eg onto screen
virtual void Flush() { }
// bounding box
virtual void CalcBoundingBox(wxCoord x, wxCoord y)
{
// Bounding box is internally stored in device units.
x = LogicalToDeviceX(x);
y = LogicalToDeviceY(y);
if ( m_isBBoxValid )
{
if ( x < m_minX ) m_minX = x;
if ( y < m_minY ) m_minY = y;
if ( x > m_maxX ) m_maxX = x;
if ( y > m_maxY ) m_maxY = y;
}
else
{
m_isBBoxValid = true;
m_minX = x;
m_minY = y;
m_maxX = x;
m_maxY = y;
}
}
void ResetBoundingBox()
{
m_isBBoxValid = false;
m_minX = m_maxX = m_minY = m_maxY = 0;
}
// Get bounding box in logical units.
wxCoord MinX() const { return m_isBBoxValid ? DeviceToLogicalX(m_minX) : 0; }
wxCoord MaxX() const { return m_isBBoxValid ? DeviceToLogicalX(m_maxX) : 0; }
wxCoord MinY() const { return m_isBBoxValid ? DeviceToLogicalY(m_minY) : 0; }
wxCoord MaxY() const { return m_isBBoxValid ? DeviceToLogicalY(m_maxY) : 0; }
// setters and getters
virtual void SetFont(const wxFont& font) = 0;
virtual const wxFont& GetFont() const { return m_font; }
virtual void SetPen(const wxPen& pen) = 0;
virtual const wxPen& GetPen() const { return m_pen; }
virtual void SetBrush(const wxBrush& brush) = 0;
virtual const wxBrush& GetBrush() const { return m_brush; }
virtual void SetBackground(const wxBrush& brush) = 0;
virtual const wxBrush& GetBackground() const { return m_backgroundBrush; }
virtual void SetBackgroundMode(int mode) = 0;
virtual int GetBackgroundMode() const { return m_backgroundMode; }
virtual void SetTextForeground(const wxColour& colour)
{ m_textForegroundColour = colour; }
virtual const wxColour& GetTextForeground() const
{ return m_textForegroundColour; }
virtual void SetTextBackground(const wxColour& colour)
{ m_textBackgroundColour = colour; }
virtual const wxColour& GetTextBackground() const
{ return m_textBackgroundColour; }
#if wxUSE_PALETTE
virtual void SetPalette(const wxPalette& palette) = 0;
#endif // wxUSE_PALETTE
// inherit the DC attributes (font and colours) from the given window
//
// this is called automatically when a window, client or paint DC is
// created
virtual void InheritAttributes(wxWindow *win);
// logical functions
virtual void SetLogicalFunction(wxRasterOperationMode function) = 0;
virtual wxRasterOperationMode GetLogicalFunction() const
{ return m_logicalFunction; }
// text measurement
virtual wxCoord GetCharHeight() const = 0;
virtual wxCoord GetCharWidth() const = 0;
// The derived classes should really override DoGetFontMetrics() to return
// the correct values in the future but for now provide a default
// implementation in terms of DoGetTextExtent() to avoid breaking the
// compilation of all other ports as wxMSW is the only one to implement it.
virtual void DoGetFontMetrics(int *height,
int *ascent,
int *descent,
int *internalLeading,
int *externalLeading,
int *averageWidth) const;
virtual void DoGetTextExtent(const wxString& string,
wxCoord *x, wxCoord *y,
wxCoord *descent = NULL,
wxCoord *externalLeading = NULL,
const wxFont *theFont = NULL) const = 0;
virtual void GetMultiLineTextExtent(const wxString& string,
wxCoord *width,
wxCoord *height,
wxCoord *heightLine = NULL,
const wxFont *font = NULL) const;
virtual bool DoGetPartialTextExtents(const wxString& text, wxArrayInt& widths) const;
// clearing
virtual void Clear() = 0;
// clipping
// Note that this pure virtual method has an implementation that updates
// the values returned by DoGetClippingBox() and so can be called from the
// derived class overridden version if it makes sense (i.e. if the clipping
// box coordinates are not already updated in some other way).
virtual void DoSetClippingRegion(wxCoord x, wxCoord y,
wxCoord w, wxCoord h) = 0;
// NB: this function works with device coordinates, not the logical ones!
virtual void DoSetDeviceClippingRegion(const wxRegion& region) = 0;
// Method used to implement wxDC::GetClippingBox().
//
// Default implementation returns values stored in m_clip[XY][12] member
// variables, so this method doesn't need to be overridden if they're kept
// up to date.
virtual bool DoGetClippingRect(wxRect& rect) const;
#if WXWIN_COMPATIBILITY_3_0
// This method is kept for backwards compatibility but shouldn't be used
// nor overridden in the new code, implement DoGetClippingRect() above
// instead.
wxDEPRECATED_BUT_USED_INTERNALLY(
virtual void DoGetClippingBox(wxCoord *x, wxCoord *y,
wxCoord *w, wxCoord *h) const
);
#endif // WXWIN_COMPATIBILITY_3_0
virtual void DestroyClippingRegion() { ResetClipping(); }
// coordinates conversions and transforms
virtual wxCoord DeviceToLogicalX(wxCoord x) const;
virtual wxCoord DeviceToLogicalY(wxCoord y) const;
virtual wxCoord DeviceToLogicalXRel(wxCoord x) const;
virtual wxCoord DeviceToLogicalYRel(wxCoord y) const;
virtual wxCoord LogicalToDeviceX(wxCoord x) const;
virtual wxCoord LogicalToDeviceY(wxCoord y) const;
virtual wxCoord LogicalToDeviceXRel(wxCoord x) const;
virtual wxCoord LogicalToDeviceYRel(wxCoord y) const;
virtual void SetMapMode(wxMappingMode mode);
virtual wxMappingMode GetMapMode() const { return m_mappingMode; }
virtual void SetUserScale(double x, double y);
virtual void GetUserScale(double *x, double *y) const
{
if ( x ) *x = m_userScaleX;
if ( y ) *y = m_userScaleY;
}
virtual void SetLogicalScale(double x, double y);
virtual void GetLogicalScale(double *x, double *y) const
{
if ( x ) *x = m_logicalScaleX;
if ( y ) *y = m_logicalScaleY;
}
virtual void SetLogicalOrigin(wxCoord x, wxCoord y);
virtual void DoGetLogicalOrigin(wxCoord *x, wxCoord *y) const
{
if ( x ) *x = m_logicalOriginX;
if ( y ) *y = m_logicalOriginY;
}
virtual void SetDeviceOrigin(wxCoord x, wxCoord y);
virtual void DoGetDeviceOrigin(wxCoord *x, wxCoord *y) const
{
if ( x ) *x = m_deviceOriginX;
if ( y ) *y = m_deviceOriginY;
}
#if wxUSE_DC_TRANSFORM_MATRIX
// Transform matrix support is not available in most ports right now
// (currently only wxMSW provides it) so do nothing in these methods by
// default.
virtual bool CanUseTransformMatrix() const
{ return false; }
virtual bool SetTransformMatrix(const wxAffineMatrix2D& WXUNUSED(matrix))
{ return false; }
virtual wxAffineMatrix2D GetTransformMatrix() const
{ return wxAffineMatrix2D(); }
virtual void ResetTransformMatrix()
{ }
#endif // wxUSE_DC_TRANSFORM_MATRIX
virtual void SetDeviceLocalOrigin( wxCoord x, wxCoord y );
virtual void ComputeScaleAndOrigin();
// this needs to overidden if the axis is inverted
virtual void SetAxisOrientation(bool xLeftRight, bool yBottomUp);
virtual double GetContentScaleFactor() const { return m_contentScaleFactor; }
#ifdef __WXMSW__
// Native Windows functions using the underlying HDC don't honour GDI+
// transformations which may be applied to it. Using this function we can
// transform the coordinates manually before passing them to such functions
// (as in e.g. wxRendererMSW code). It doesn't do anything if this is not a
// wxGCDC.
virtual wxRect MSWApplyGDIPlusTransform(const wxRect& r) const
{
return r;
}
#endif // __WXMSW__
// ---------------------------------------------------------
// the actual drawing API
virtual bool DoFloodFill(wxCoord x, wxCoord y, const wxColour& col,
wxFloodFillStyle style = wxFLOOD_SURFACE) = 0;
virtual void DoGradientFillLinear(const wxRect& rect,
const wxColour& initialColour,
const wxColour& destColour,
wxDirection nDirection = wxEAST);
virtual void DoGradientFillConcentric(const wxRect& rect,
const wxColour& initialColour,
const wxColour& destColour,
const wxPoint& circleCenter);
virtual bool DoGetPixel(wxCoord x, wxCoord y, wxColour *col) const = 0;
virtual void DoDrawPoint(wxCoord x, wxCoord y) = 0;
virtual void DoDrawLine(wxCoord x1, wxCoord y1, wxCoord x2, wxCoord y2) = 0;
virtual void DoDrawArc(wxCoord x1, wxCoord y1,
wxCoord x2, wxCoord y2,
wxCoord xc, wxCoord yc) = 0;
virtual void DoDrawCheckMark(wxCoord x, wxCoord y,
wxCoord width, wxCoord height);
virtual void DoDrawEllipticArc(wxCoord x, wxCoord y, wxCoord w, wxCoord h,
double sa, double ea) = 0;
virtual void DoDrawRectangle(wxCoord x, wxCoord y, wxCoord width, wxCoord height) = 0;
virtual void DoDrawRoundedRectangle(wxCoord x, wxCoord y,
wxCoord width, wxCoord height,
double radius) = 0;
virtual void DoDrawEllipse(wxCoord x, wxCoord y,
wxCoord width, wxCoord height) = 0;
virtual void DoCrossHair(wxCoord x, wxCoord y) = 0;
virtual void DoDrawIcon(const wxIcon& icon, wxCoord x, wxCoord y) = 0;
virtual void DoDrawBitmap(const wxBitmap &bmp, wxCoord x, wxCoord y,
bool useMask = false) = 0;
virtual void DoDrawText(const wxString& text, wxCoord x, wxCoord y) = 0;
virtual void DoDrawRotatedText(const wxString& text,
wxCoord x, wxCoord y, double angle) = 0;
virtual bool DoBlit(wxCoord xdest, wxCoord ydest,
wxCoord width, wxCoord height,
wxDC *source,
wxCoord xsrc, wxCoord ysrc,
wxRasterOperationMode rop = wxCOPY,
bool useMask = false,
wxCoord xsrcMask = wxDefaultCoord,
wxCoord ysrcMask = wxDefaultCoord) = 0;
virtual bool DoStretchBlit(wxCoord xdest, wxCoord ydest,
wxCoord dstWidth, wxCoord dstHeight,
wxDC *source,
wxCoord xsrc, wxCoord ysrc,
wxCoord srcWidth, wxCoord srcHeight,
wxRasterOperationMode rop = wxCOPY,
bool useMask = false,
wxCoord xsrcMask = wxDefaultCoord,
wxCoord ysrcMask = wxDefaultCoord);
virtual wxBitmap DoGetAsBitmap(const wxRect *WXUNUSED(subrect)) const
{ return wxNullBitmap; }
virtual void DoDrawLines(int n, const wxPoint points[],
wxCoord xoffset, wxCoord yoffset ) = 0;
virtual void DrawLines(const wxPointList *list,
wxCoord xoffset, wxCoord yoffset );
virtual void DoDrawPolygon(int n, const wxPoint points[],
wxCoord xoffset, wxCoord yoffset,
wxPolygonFillMode fillStyle = wxODDEVEN_RULE) = 0;
virtual void DoDrawPolyPolygon(int n, const int count[], const wxPoint points[],
wxCoord xoffset, wxCoord yoffset,
wxPolygonFillMode fillStyle);
void DrawPolygon(const wxPointList *list,
wxCoord xoffset, wxCoord yoffset,
wxPolygonFillMode fillStyle );
#if wxUSE_SPLINES
void DrawSpline(wxCoord x1, wxCoord y1,
wxCoord x2, wxCoord y2,
wxCoord x3, wxCoord y3);
void DrawSpline(int n, const wxPoint points[]);
void DrawSpline(const wxPointList *points) { DoDrawSpline(points); }
virtual void DoDrawSpline(const wxPointList *points);
#endif
// ---------------------------------------------------------
// wxMemoryDC Impl API
virtual void DoSelect(const wxBitmap& WXUNUSED(bmp))
{ }
virtual const wxBitmap& GetSelectedBitmap() const
{ return wxNullBitmap; }
virtual wxBitmap& GetSelectedBitmap()
{ return wxNullBitmap; }
// ---------------------------------------------------------
// wxPrinterDC Impl API
virtual wxRect GetPaperRect() const
{ int w = 0; int h = 0; DoGetSize( &w, &h ); return wxRect(0,0,w,h); }
virtual int GetResolution() const
{ return -1; }
#if wxUSE_GRAPHICS_CONTEXT
virtual wxGraphicsContext* GetGraphicsContext() const
{ return NULL; }
virtual void SetGraphicsContext( wxGraphicsContext* WXUNUSED(ctx) )
{}
#endif
private:
wxDC *m_owner;
protected:
// This method exists for backwards compatibility only (while it's not
// documented, there are derived classes using it outside wxWidgets
// itself), don't use it in any new code and just call wxDCImpl version of
// DestroyClippingRegion() to reset the clipping information instead.
void ResetClipping()
{
m_clipping = false;
m_clipX1 = m_clipX2 = m_clipY1 = m_clipY2 = 0;
}
// returns adjustment factor for converting wxFont "point size"; in wx
// it is point size on screen and needs to be multiplied by this value
// for rendering on higher-resolution DCs such as printer ones
static float GetFontPointSizeAdjustment(float dpi);
// Return the number of pixels per mm in the horizontal and vertical
// directions, respectively.
//
// If the physical size of the DC is not known, or doesn't make sense, as
// for a SVG DC, for example, a fixed value corresponding to the standard
// DPI is used.
double GetMMToPXx() const;
double GetMMToPXy() const;
// window on which the DC draws or NULL
wxWindow *m_window;
// flags
bool m_colour:1;
bool m_ok:1;
bool m_clipping:1;
bool m_isInteractive:1;
bool m_isBBoxValid:1;
// coordinate system variables
wxCoord m_logicalOriginX, m_logicalOriginY;
wxCoord m_deviceOriginX, m_deviceOriginY; // Usually 0,0, can be change by user
wxCoord m_deviceLocalOriginX, m_deviceLocalOriginY; // non-zero if native top-left corner
// is not at 0,0. This was the case under
// Mac's GrafPorts (coordinate system
// used toplevel window's origin) and
// e.g. for Postscript, where the native
// origin in the bottom left corner.
double m_logicalScaleX, m_logicalScaleY;
double m_userScaleX, m_userScaleY;
double m_scaleX, m_scaleY; // calculated from logical scale and user scale
int m_signX, m_signY; // Used by SetAxisOrientation() to invert the axes
double m_contentScaleFactor; // used by high resolution displays (retina)
// Pixel per mm in horizontal and vertical directions.
//
// These variables are computed on demand by GetMMToPX[xy]() functions,
// don't access them directly other than for assigning to them.
mutable double m_mm_to_pix_x,
m_mm_to_pix_y;
// bounding and clipping boxes
wxCoord m_minX, m_minY, m_maxX, m_maxY; // Bounding box is stored in device units.
wxCoord m_clipX1, m_clipY1, m_clipX2, m_clipY2; // Clipping box is stored in logical units.
wxRasterOperationMode m_logicalFunction;
int m_backgroundMode;
wxMappingMode m_mappingMode;
wxPen m_pen;
wxBrush m_brush;
wxBrush m_backgroundBrush;
wxColour m_textForegroundColour;
wxColour m_textBackgroundColour;
wxFont m_font;
#if wxUSE_PALETTE
wxPalette m_palette;
bool m_hasCustomPalette;
#endif // wxUSE_PALETTE
private:
// Return the full DC area in logical coordinates.
wxRect GetLogicalArea() const;
wxDECLARE_ABSTRACT_CLASS(wxDCImpl);
};
class WXDLLIMPEXP_CORE wxDC : public wxObject
{
public:
// copy attributes (font, colours and writing direction) from another DC
void CopyAttributes(const wxDC& dc);
virtual ~wxDC() { delete m_pimpl; }
wxDCImpl *GetImpl()
{ return m_pimpl; }
const wxDCImpl *GetImpl() const
{ return m_pimpl; }
wxWindow *GetWindow() const
{ return m_pimpl->GetWindow(); }
void *GetHandle() const
{ return m_pimpl->GetHandle(); }
bool IsOk() const
{ return m_pimpl && m_pimpl->IsOk(); }
// query capabilities
bool CanDrawBitmap() const
{ return m_pimpl->CanDrawBitmap(); }
bool CanGetTextExtent() const
{ return m_pimpl->CanGetTextExtent(); }
// query dimension, colour deps, resolution
void GetSize(int *width, int *height) const
{ m_pimpl->DoGetSize(width, height); }
wxSize GetSize() const
{ return m_pimpl->GetSize(); }
void GetSizeMM(int* width, int* height) const
{ m_pimpl->DoGetSizeMM(width, height); }
wxSize GetSizeMM() const
{
int w, h;
m_pimpl->DoGetSizeMM(&w, &h);
return wxSize(w, h);
}
int GetDepth() const
{ return m_pimpl->GetDepth(); }
wxSize GetPPI() const
{ return m_pimpl->GetPPI(); }
virtual int GetResolution() const
{ return m_pimpl->GetResolution(); }
double GetContentScaleFactor() const
{ return m_pimpl->GetContentScaleFactor(); }
// Right-To-Left (RTL) modes
void SetLayoutDirection(wxLayoutDirection dir)
{ m_pimpl->SetLayoutDirection( dir ); }
wxLayoutDirection GetLayoutDirection() const
{ return m_pimpl->GetLayoutDirection(); }
// page and document
bool StartDoc(const wxString& message)
{ return m_pimpl->StartDoc(message); }
void EndDoc()
{ m_pimpl->EndDoc(); }
void StartPage()
{ m_pimpl->StartPage(); }
void EndPage()
{ m_pimpl->EndPage(); }
// bounding box
void CalcBoundingBox(wxCoord x, wxCoord y)
{ m_pimpl->CalcBoundingBox(x,y); }
void ResetBoundingBox()
{ m_pimpl->ResetBoundingBox(); }
wxCoord MinX() const
{ return m_pimpl->MinX(); }
wxCoord MaxX() const
{ return m_pimpl->MaxX(); }
wxCoord MinY() const
{ return m_pimpl->MinY(); }
wxCoord MaxY() const
{ return m_pimpl->MaxY(); }
// setters and getters
void SetFont(const wxFont& font)
{ m_pimpl->SetFont( font ); }
const wxFont& GetFont() const
{ return m_pimpl->GetFont(); }
void SetPen(const wxPen& pen)
{ m_pimpl->SetPen( pen ); }
const wxPen& GetPen() const
{ return m_pimpl->GetPen(); }
void SetBrush(const wxBrush& brush)
{ m_pimpl->SetBrush( brush ); }
const wxBrush& GetBrush() const
{ return m_pimpl->GetBrush(); }
void SetBackground(const wxBrush& brush)
{ m_pimpl->SetBackground( brush ); }
const wxBrush& GetBackground() const
{ return m_pimpl->GetBackground(); }
void SetBackgroundMode(int mode)
{ m_pimpl->SetBackgroundMode( mode ); }
int GetBackgroundMode() const
{ return m_pimpl->GetBackgroundMode(); }
void SetTextForeground(const wxColour& colour)
{ m_pimpl->SetTextForeground(colour); }
const wxColour& GetTextForeground() const
{ return m_pimpl->GetTextForeground(); }
void SetTextBackground(const wxColour& colour)
{ m_pimpl->SetTextBackground(colour); }
const wxColour& GetTextBackground() const
{ return m_pimpl->GetTextBackground(); }
#if wxUSE_PALETTE
void SetPalette(const wxPalette& palette)
{ m_pimpl->SetPalette(palette); }
#endif // wxUSE_PALETTE
// logical functions
void SetLogicalFunction(wxRasterOperationMode function)
{ m_pimpl->SetLogicalFunction(function); }
wxRasterOperationMode GetLogicalFunction() const
{ return m_pimpl->GetLogicalFunction(); }
// text measurement
wxCoord GetCharHeight() const
{ return m_pimpl->GetCharHeight(); }
wxCoord GetCharWidth() const
{ return m_pimpl->GetCharWidth(); }
wxFontMetrics GetFontMetrics() const
{
wxFontMetrics fm;
m_pimpl->DoGetFontMetrics(&fm.height, &fm.ascent, &fm.descent,
&fm.internalLeading, &fm.externalLeading,
&fm.averageWidth);
return fm;
}
void GetTextExtent(const wxString& string,
wxCoord *x, wxCoord *y,
wxCoord *descent = NULL,
wxCoord *externalLeading = NULL,
const wxFont *theFont = NULL) const
{ m_pimpl->DoGetTextExtent(string, x, y, descent, externalLeading, theFont); }
wxSize GetTextExtent(const wxString& string) const
{
wxCoord w, h;
m_pimpl->DoGetTextExtent(string, &w, &h);
return wxSize(w, h);
}
void GetMultiLineTextExtent(const wxString& string,
wxCoord *width,
wxCoord *height,
wxCoord *heightLine = NULL,
const wxFont *font = NULL) const
{ m_pimpl->GetMultiLineTextExtent( string, width, height, heightLine, font ); }
wxSize GetMultiLineTextExtent(const wxString& string) const
{
wxCoord w, h;
m_pimpl->GetMultiLineTextExtent(string, &w, &h);
return wxSize(w, h);
}
bool GetPartialTextExtents(const wxString& text, wxArrayInt& widths) const
{ return m_pimpl->DoGetPartialTextExtents(text, widths); }
// clearing
void Clear()
{ m_pimpl->Clear(); }
// clipping
void SetClippingRegion(wxCoord x, wxCoord y, wxCoord width, wxCoord height)
{ m_pimpl->DoSetClippingRegion(x, y, width, height); }
void SetClippingRegion(const wxPoint& pt, const wxSize& sz)
{ m_pimpl->DoSetClippingRegion(pt.x, pt.y, sz.x, sz.y); }
void SetClippingRegion(const wxRect& rect)
{ m_pimpl->DoSetClippingRegion(rect.x, rect.y, rect.width, rect.height); }
// unlike the functions above, the coordinates of the region used in this
// one are in device coordinates, not the logical ones
void SetDeviceClippingRegion(const wxRegion& region)
{ m_pimpl->DoSetDeviceClippingRegion(region); }
// this function is deprecated because its name is confusing: you may
// expect it to work with logical coordinates but, in fact, it does exactly
// the same thing as SetDeviceClippingRegion()
//
// please review the code using it and either replace it with calls to
// SetDeviceClippingRegion() or correct it if it was [wrongly] passing
// logical coordinates to this function
wxDEPRECATED_INLINE(void SetClippingRegion(const wxRegion& region),
SetDeviceClippingRegion(region); )
void DestroyClippingRegion()
{ m_pimpl->DestroyClippingRegion(); }
bool GetClippingBox(wxCoord *x, wxCoord *y, wxCoord *w, wxCoord *h) const
{
wxRect r;
const bool clipping = m_pimpl->DoGetClippingRect(r);
if ( x )
*x = r.x;
if ( y )
*y = r.y;
if ( w )
*w = r.width;
if ( h )
*h = r.height;
return clipping;
}
bool GetClippingBox(wxRect& rect) const
{ return m_pimpl->DoGetClippingRect(rect); }
// coordinates conversions and transforms
wxCoord DeviceToLogicalX(wxCoord x) const
{ return m_pimpl->DeviceToLogicalX(x); }
wxCoord DeviceToLogicalY(wxCoord y) const
{ return m_pimpl->DeviceToLogicalY(y); }
wxCoord DeviceToLogicalXRel(wxCoord x) const
{ return m_pimpl->DeviceToLogicalXRel(x); }
wxCoord DeviceToLogicalYRel(wxCoord y) const
{ return m_pimpl->DeviceToLogicalYRel(y); }
wxCoord LogicalToDeviceX(wxCoord x) const
{ return m_pimpl->LogicalToDeviceX(x); }
wxCoord LogicalToDeviceY(wxCoord y) const
{ return m_pimpl->LogicalToDeviceY(y); }
wxCoord LogicalToDeviceXRel(wxCoord x) const
{ return m_pimpl->LogicalToDeviceXRel(x); }
wxCoord LogicalToDeviceYRel(wxCoord y) const
{ return m_pimpl->LogicalToDeviceYRel(y); }
void SetMapMode(wxMappingMode mode)
{ m_pimpl->SetMapMode(mode); }
wxMappingMode GetMapMode() const
{ return m_pimpl->GetMapMode(); }
void SetUserScale(double x, double y)
{ m_pimpl->SetUserScale(x,y); }
void GetUserScale(double *x, double *y) const
{ m_pimpl->GetUserScale( x, y ); }
void SetLogicalScale(double x, double y)
{ m_pimpl->SetLogicalScale( x, y ); }
void GetLogicalScale(double *x, double *y) const
{ m_pimpl->GetLogicalScale( x, y ); }
void SetLogicalOrigin(wxCoord x, wxCoord y)
{ m_pimpl->SetLogicalOrigin(x,y); }
void GetLogicalOrigin(wxCoord *x, wxCoord *y) const
{ m_pimpl->DoGetLogicalOrigin(x, y); }
wxPoint GetLogicalOrigin() const
{ wxCoord x, y; m_pimpl->DoGetLogicalOrigin(&x, &y); return wxPoint(x, y); }
void SetDeviceOrigin(wxCoord x, wxCoord y)
{ m_pimpl->SetDeviceOrigin( x, y); }
void GetDeviceOrigin(wxCoord *x, wxCoord *y) const
{ m_pimpl->DoGetDeviceOrigin(x, y); }
wxPoint GetDeviceOrigin() const
{ wxCoord x, y; m_pimpl->DoGetDeviceOrigin(&x, &y); return wxPoint(x, y); }
void SetAxisOrientation(bool xLeftRight, bool yBottomUp)
{ m_pimpl->SetAxisOrientation(xLeftRight, yBottomUp); }
#if wxUSE_DC_TRANSFORM_MATRIX
bool CanUseTransformMatrix() const
{ return m_pimpl->CanUseTransformMatrix(); }
bool SetTransformMatrix(const wxAffineMatrix2D &matrix)
{ return m_pimpl->SetTransformMatrix(matrix); }
wxAffineMatrix2D GetTransformMatrix() const
{ return m_pimpl->GetTransformMatrix(); }
void ResetTransformMatrix()
{ m_pimpl->ResetTransformMatrix(); }
#endif // wxUSE_DC_TRANSFORM_MATRIX
// mostly internal
void SetDeviceLocalOrigin( wxCoord x, wxCoord y )
{ m_pimpl->SetDeviceLocalOrigin( x, y ); }
// -----------------------------------------------
// the actual drawing API
bool FloodFill(wxCoord x, wxCoord y, const wxColour& col,
wxFloodFillStyle style = wxFLOOD_SURFACE)
{ return m_pimpl->DoFloodFill(x, y, col, style); }
bool FloodFill(const wxPoint& pt, const wxColour& col,
wxFloodFillStyle style = wxFLOOD_SURFACE)
{ return m_pimpl->DoFloodFill(pt.x, pt.y, col, style); }
// fill the area specified by rect with a radial gradient, starting from
// initialColour in the centre of the cercle and fading to destColour.
void GradientFillConcentric(const wxRect& rect,
const wxColour& initialColour,
const wxColour& destColour)
{ m_pimpl->DoGradientFillConcentric( rect, initialColour, destColour,
wxPoint(rect.GetWidth() / 2,
rect.GetHeight() / 2)); }
void GradientFillConcentric(const wxRect& rect,
const wxColour& initialColour,
const wxColour& destColour,
const wxPoint& circleCenter)
{ m_pimpl->DoGradientFillConcentric(rect, initialColour, destColour, circleCenter); }
// fill the area specified by rect with a linear gradient
void GradientFillLinear(const wxRect& rect,
const wxColour& initialColour,
const wxColour& destColour,
wxDirection nDirection = wxEAST)
{ m_pimpl->DoGradientFillLinear(rect, initialColour, destColour, nDirection); }
bool GetPixel(wxCoord x, wxCoord y, wxColour *col) const
{ return m_pimpl->DoGetPixel(x, y, col); }
bool GetPixel(const wxPoint& pt, wxColour *col) const
{ return m_pimpl->DoGetPixel(pt.x, pt.y, col); }
void DrawLine(wxCoord x1, wxCoord y1, wxCoord x2, wxCoord y2)
{ m_pimpl->DoDrawLine(x1, y1, x2, y2); }
void DrawLine(const wxPoint& pt1, const wxPoint& pt2)
{ m_pimpl->DoDrawLine(pt1.x, pt1.y, pt2.x, pt2.y); }
void CrossHair(wxCoord x, wxCoord y)
{ m_pimpl->DoCrossHair(x, y); }
void CrossHair(const wxPoint& pt)
{ m_pimpl->DoCrossHair(pt.x, pt.y); }
void DrawArc(wxCoord x1, wxCoord y1, wxCoord x2, wxCoord y2,
wxCoord xc, wxCoord yc)
{ m_pimpl->DoDrawArc(x1, y1, x2, y2, xc, yc); }
void DrawArc(const wxPoint& pt1, const wxPoint& pt2, const wxPoint& centre)
{ m_pimpl->DoDrawArc(pt1.x, pt1.y, pt2.x, pt2.y, centre.x, centre.y); }
void DrawCheckMark(wxCoord x, wxCoord y,
wxCoord width, wxCoord height)
{ m_pimpl->DoDrawCheckMark(x, y, width, height); }
void DrawCheckMark(const wxRect& rect)
{ m_pimpl->DoDrawCheckMark(rect.x, rect.y, rect.width, rect.height); }
void DrawEllipticArc(wxCoord x, wxCoord y, wxCoord w, wxCoord h,
double sa, double ea)
{ m_pimpl->DoDrawEllipticArc(x, y, w, h, sa, ea); }
void DrawEllipticArc(const wxPoint& pt, const wxSize& sz,
double sa, double ea)
{ m_pimpl->DoDrawEllipticArc(pt.x, pt.y, sz.x, sz.y, sa, ea); }
void DrawPoint(wxCoord x, wxCoord y)
{ m_pimpl->DoDrawPoint(x, y); }
void DrawPoint(const wxPoint& pt)
{ m_pimpl->DoDrawPoint(pt.x, pt.y); }
void DrawLines(int n, const wxPoint points[],
wxCoord xoffset = 0, wxCoord yoffset = 0)
{ m_pimpl->DoDrawLines(n, points, xoffset, yoffset); }
void DrawLines(const wxPointList *list,
wxCoord xoffset = 0, wxCoord yoffset = 0)
{ m_pimpl->DrawLines( list, xoffset, yoffset ); }
#if WXWIN_COMPATIBILITY_2_8
wxDEPRECATED( void DrawLines(const wxList *list,
wxCoord xoffset = 0, wxCoord yoffset = 0) );
#endif // WXWIN_COMPATIBILITY_2_8
void DrawPolygon(int n, const wxPoint points[],
wxCoord xoffset = 0, wxCoord yoffset = 0,
wxPolygonFillMode fillStyle = wxODDEVEN_RULE)
{ m_pimpl->DoDrawPolygon(n, points, xoffset, yoffset, fillStyle); }
void DrawPolygon(const wxPointList *list,
wxCoord xoffset = 0, wxCoord yoffset = 0,
wxPolygonFillMode fillStyle = wxODDEVEN_RULE)
{ m_pimpl->DrawPolygon( list, xoffset, yoffset, fillStyle ); }
void DrawPolyPolygon(int n, const int count[], const wxPoint points[],
wxCoord xoffset = 0, wxCoord yoffset = 0,
wxPolygonFillMode fillStyle = wxODDEVEN_RULE)
{ m_pimpl->DoDrawPolyPolygon(n, count, points, xoffset, yoffset, fillStyle); }
#if WXWIN_COMPATIBILITY_2_8
wxDEPRECATED( void DrawPolygon(const wxList *list,
wxCoord xoffset = 0, wxCoord yoffset = 0,
wxPolygonFillMode fillStyle = wxODDEVEN_RULE) );
#endif // WXWIN_COMPATIBILITY_2_8
void DrawRectangle(wxCoord x, wxCoord y, wxCoord width, wxCoord height)
{ m_pimpl->DoDrawRectangle(x, y, width, height); }
void DrawRectangle(const wxPoint& pt, const wxSize& sz)
{ m_pimpl->DoDrawRectangle(pt.x, pt.y, sz.x, sz.y); }
void DrawRectangle(const wxRect& rect)
{ m_pimpl->DoDrawRectangle(rect.x, rect.y, rect.width, rect.height); }
void DrawRoundedRectangle(wxCoord x, wxCoord y, wxCoord width, wxCoord height,
double radius)
{ m_pimpl->DoDrawRoundedRectangle(x, y, width, height, radius); }
void DrawRoundedRectangle(const wxPoint& pt, const wxSize& sz,
double radius)
{ m_pimpl->DoDrawRoundedRectangle(pt.x, pt.y, sz.x, sz.y, radius); }
void DrawRoundedRectangle(const wxRect& r, double radius)
{ m_pimpl->DoDrawRoundedRectangle(r.x, r.y, r.width, r.height, radius); }
void DrawCircle(wxCoord x, wxCoord y, wxCoord radius)
{ m_pimpl->DoDrawEllipse(x - radius, y - radius, 2*radius, 2*radius); }
void DrawCircle(const wxPoint& pt, wxCoord radius)
{ m_pimpl->DoDrawEllipse(pt.x - radius, pt.y - radius, 2*radius, 2*radius); }
void DrawEllipse(wxCoord x, wxCoord y, wxCoord width, wxCoord height)
{ m_pimpl->DoDrawEllipse(x, y, width, height); }
void DrawEllipse(const wxPoint& pt, const wxSize& sz)
{ m_pimpl->DoDrawEllipse(pt.x, pt.y, sz.x, sz.y); }
void DrawEllipse(const wxRect& rect)
{ m_pimpl->DoDrawEllipse(rect.x, rect.y, rect.width, rect.height); }
void DrawIcon(const wxIcon& icon, wxCoord x, wxCoord y)
{ m_pimpl->DoDrawIcon(icon, x, y); }
void DrawIcon(const wxIcon& icon, const wxPoint& pt)
{ m_pimpl->DoDrawIcon(icon, pt.x, pt.y); }
void DrawBitmap(const wxBitmap &bmp, wxCoord x, wxCoord y,
bool useMask = false)
{ m_pimpl->DoDrawBitmap(bmp, x, y, useMask); }
void DrawBitmap(const wxBitmap &bmp, const wxPoint& pt,
bool useMask = false)
{ m_pimpl->DoDrawBitmap(bmp, pt.x, pt.y, useMask); }
void DrawText(const wxString& text, wxCoord x, wxCoord y)
{ m_pimpl->DoDrawText(text, x, y); }
void DrawText(const wxString& text, const wxPoint& pt)
{ m_pimpl->DoDrawText(text, pt.x, pt.y); }
void DrawRotatedText(const wxString& text, wxCoord x, wxCoord y, double angle)
{ m_pimpl->DoDrawRotatedText(text, x, y, angle); }
void DrawRotatedText(const wxString& text, const wxPoint& pt, double angle)
{ m_pimpl->DoDrawRotatedText(text, pt.x, pt.y, angle); }
// this version puts both optional bitmap and the text into the given
// rectangle and aligns is as specified by alignment parameter; it also
// will emphasize the character with the given index if it is != -1 and
// return the bounding rectangle if required
void DrawLabel(const wxString& text,
const wxBitmap& image,
const wxRect& rect,
int alignment = wxALIGN_LEFT | wxALIGN_TOP,
int indexAccel = -1,
wxRect *rectBounding = NULL);
void DrawLabel(const wxString& text, const wxRect& rect,
int alignment = wxALIGN_LEFT | wxALIGN_TOP,
int indexAccel = -1)
{ DrawLabel(text, wxNullBitmap, rect, alignment, indexAccel); }
bool Blit(wxCoord xdest, wxCoord ydest, wxCoord width, wxCoord height,
wxDC *source, wxCoord xsrc, wxCoord ysrc,
wxRasterOperationMode rop = wxCOPY, bool useMask = false,
wxCoord xsrcMask = wxDefaultCoord, wxCoord ysrcMask = wxDefaultCoord)
{
return m_pimpl->DoBlit(xdest, ydest, width, height,
source, xsrc, ysrc, rop, useMask, xsrcMask, ysrcMask);
}
bool Blit(const wxPoint& destPt, const wxSize& sz,
wxDC *source, const wxPoint& srcPt,
wxRasterOperationMode rop = wxCOPY, bool useMask = false,
const wxPoint& srcPtMask = wxDefaultPosition)
{
return m_pimpl->DoBlit(destPt.x, destPt.y, sz.x, sz.y,
source, srcPt.x, srcPt.y, rop, useMask, srcPtMask.x, srcPtMask.y);
}
bool StretchBlit(wxCoord dstX, wxCoord dstY,
wxCoord dstWidth, wxCoord dstHeight,
wxDC *source,
wxCoord srcX, wxCoord srcY,
wxCoord srcWidth, wxCoord srcHeight,
wxRasterOperationMode rop = wxCOPY, bool useMask = false,
wxCoord srcMaskX = wxDefaultCoord, wxCoord srcMaskY = wxDefaultCoord)
{
return m_pimpl->DoStretchBlit(dstX, dstY, dstWidth, dstHeight,
source, srcX, srcY, srcWidth, srcHeight, rop, useMask, srcMaskX, srcMaskY);
}
bool StretchBlit(const wxPoint& dstPt, const wxSize& dstSize,
wxDC *source, const wxPoint& srcPt, const wxSize& srcSize,
wxRasterOperationMode rop = wxCOPY, bool useMask = false,
const wxPoint& srcMaskPt = wxDefaultPosition)
{
return m_pimpl->DoStretchBlit(dstPt.x, dstPt.y, dstSize.x, dstSize.y,
source, srcPt.x, srcPt.y, srcSize.x, srcSize.y, rop, useMask, srcMaskPt.x, srcMaskPt.y);
}
wxBitmap GetAsBitmap(const wxRect *subrect = (const wxRect *) NULL) const
{
return m_pimpl->DoGetAsBitmap(subrect);
}
#if wxUSE_SPLINES
void DrawSpline(wxCoord x1, wxCoord y1,
wxCoord x2, wxCoord y2,
wxCoord x3, wxCoord y3)
{ m_pimpl->DrawSpline(x1,y1,x2,y2,x3,y3); }
void DrawSpline(int n, const wxPoint points[])
{ m_pimpl->DrawSpline(n,points); }
void DrawSpline(const wxPointList *points)
{ m_pimpl->DrawSpline(points); }
#endif // wxUSE_SPLINES
#if WXWIN_COMPATIBILITY_2_8
// for compatibility with the old code when wxCoord was long everywhere
wxDEPRECATED( void GetTextExtent(const wxString& string,
long *x, long *y,
long *descent = NULL,
long *externalLeading = NULL,
const wxFont *theFont = NULL) const );
wxDEPRECATED( void GetLogicalOrigin(long *x, long *y) const );
wxDEPRECATED( void GetDeviceOrigin(long *x, long *y) const );
wxDEPRECATED( void GetClippingBox(long *x, long *y, long *w, long *h) const );
wxDEPRECATED( void DrawObject(wxDrawObject* drawobject) );
#endif // WXWIN_COMPATIBILITY_2_8
#ifdef __WXMSW__
// GetHDC() is the simplest way to retrieve an HDC From a wxDC but only
// works if this wxDC is GDI-based and fails for GDI+ contexts (and
// anything else without HDC, e.g. wxPostScriptDC)
WXHDC GetHDC() const;
// don't use these methods manually, use GetTempHDC() instead
virtual WXHDC AcquireHDC() { return GetHDC(); }
virtual void ReleaseHDC(WXHDC WXUNUSED(hdc)) { }
// helper class holding the result of GetTempHDC() with std::auto_ptr<>-like
// semantics, i.e. it is moved when copied
class TempHDC
{
public:
TempHDC(wxDC& dc)
: m_dc(dc),
m_hdc(dc.AcquireHDC())
{
}
TempHDC(const TempHDC& thdc)
: m_dc(thdc.m_dc),
m_hdc(thdc.m_hdc)
{
const_cast<TempHDC&>(thdc).m_hdc = 0;
}
~TempHDC()
{
if ( m_hdc )
m_dc.ReleaseHDC(m_hdc);
}
WXHDC GetHDC() const { return m_hdc; }
private:
wxDC& m_dc;
WXHDC m_hdc;
wxDECLARE_NO_ASSIGN_CLASS(TempHDC);
};
// GetTempHDC() also works for wxGCDC (but still not for wxPostScriptDC &c)
TempHDC GetTempHDC() { return TempHDC(*this); }
#endif // __WXMSW__
#if wxUSE_GRAPHICS_CONTEXT
virtual wxGraphicsContext* GetGraphicsContext() const
{
return m_pimpl->GetGraphicsContext();
}
virtual void SetGraphicsContext( wxGraphicsContext* ctx )
{
m_pimpl->SetGraphicsContext(ctx);
}
#endif
protected:
// ctor takes ownership of the pointer
wxDC(wxDCImpl *pimpl) : m_pimpl(pimpl) { }
wxDCImpl * const m_pimpl;
private:
wxDECLARE_ABSTRACT_CLASS(wxDC);
wxDECLARE_NO_COPY_CLASS(wxDC);
};
// ----------------------------------------------------------------------------
// helper class: you can use it to temporarily change the DC text colour and
// restore it automatically when the object goes out of scope
// ----------------------------------------------------------------------------
class WXDLLIMPEXP_CORE wxDCTextColourChanger
{
public:
wxDCTextColourChanger(wxDC& dc) : m_dc(dc), m_colFgOld() { }
wxDCTextColourChanger(wxDC& dc, const wxColour& col) : m_dc(dc)
{
Set(col);
}
~wxDCTextColourChanger()
{
if ( m_colFgOld.IsOk() )
m_dc.SetTextForeground(m_colFgOld);
}
void Set(const wxColour& col)
{
if ( !m_colFgOld.IsOk() )
m_colFgOld = m_dc.GetTextForeground();
m_dc.SetTextForeground(col);
}
private:
wxDC& m_dc;
wxColour m_colFgOld;
wxDECLARE_NO_COPY_CLASS(wxDCTextColourChanger);
};
// ----------------------------------------------------------------------------
// helper class: you can use it to temporarily change the DC pen and
// restore it automatically when the object goes out of scope
// ----------------------------------------------------------------------------
class WXDLLIMPEXP_CORE wxDCPenChanger
{
public:
wxDCPenChanger(wxDC& dc, const wxPen& pen) : m_dc(dc), m_penOld(dc.GetPen())
{
m_dc.SetPen(pen);
}
~wxDCPenChanger()
{
if ( m_penOld.IsOk() )
m_dc.SetPen(m_penOld);
}
private:
wxDC& m_dc;
wxPen m_penOld;
wxDECLARE_NO_COPY_CLASS(wxDCPenChanger);
};
// ----------------------------------------------------------------------------
// helper class: you can use it to temporarily change the DC brush and
// restore it automatically when the object goes out of scope
// ----------------------------------------------------------------------------
class WXDLLIMPEXP_CORE wxDCBrushChanger
{
public:
wxDCBrushChanger(wxDC& dc, const wxBrush& brush) : m_dc(dc), m_brushOld(dc.GetBrush())
{
m_dc.SetBrush(brush);
}
~wxDCBrushChanger()
{
if ( m_brushOld.IsOk() )
m_dc.SetBrush(m_brushOld);
}
private:
wxDC& m_dc;
wxBrush m_brushOld;
wxDECLARE_NO_COPY_CLASS(wxDCBrushChanger);
};
// ----------------------------------------------------------------------------
// another small helper class: sets the clipping region in its ctor and
// destroys it in the dtor
// ----------------------------------------------------------------------------
class WXDLLIMPEXP_CORE wxDCClipper
{
public:
wxDCClipper(wxDC& dc, const wxRegion& r) : m_dc(dc)
{
Init(r.GetBox());
}
wxDCClipper(wxDC& dc, const wxRect& r) : m_dc(dc)
{
Init(r);
}
wxDCClipper(wxDC& dc, wxCoord x, wxCoord y, wxCoord w, wxCoord h) : m_dc(dc)
{
Init(wxRect(x, y, w, h));
}
~wxDCClipper()
{
m_dc.DestroyClippingRegion();
if ( m_restoreOld )
m_dc.SetClippingRegion(m_oldClipRect);
}
private:
// Common part of all ctors.
void Init(const wxRect& r)
{
m_restoreOld = m_dc.GetClippingBox(m_oldClipRect);
m_dc.SetClippingRegion(r);
}
wxDC& m_dc;
wxRect m_oldClipRect;
bool m_restoreOld;
wxDECLARE_NO_COPY_CLASS(wxDCClipper);
};
// ----------------------------------------------------------------------------
// helper class: you can use it to temporarily change the DC font and
// restore it automatically when the object goes out of scope
// ----------------------------------------------------------------------------
class WXDLLIMPEXP_CORE wxDCFontChanger
{
public:
wxDCFontChanger(wxDC& dc)
: m_dc(dc), m_fontOld()
{
}
wxDCFontChanger(wxDC& dc, const wxFont& font)
: m_dc(dc), m_fontOld(dc.GetFont())
{
m_dc.SetFont(font);
}
void Set(const wxFont& font)
{
if ( !m_fontOld.IsOk() )
m_fontOld = m_dc.GetFont();
m_dc.SetFont(font);
}
~wxDCFontChanger()
{
if ( m_fontOld.IsOk() )
m_dc.SetFont(m_fontOld);
}
private:
wxDC& m_dc;
wxFont m_fontOld;
wxDECLARE_NO_COPY_CLASS(wxDCFontChanger);
};
#endif // _WX_DC_H_BASE_
| h |
rticonnextdds-usecases | data/projects/rticonnextdds-usecases/VehicleTracking/ExampleCode/thirdparty/wxWidgets-3.1.2/Linux/include/wx/mousemanager.h | ///////////////////////////////////////////////////////////////////////////////
// Name: wx/mousemanager.h
// Purpose: wxMouseEventsManager class declaration
// Author: Vadim Zeitlin
// Created: 2009-04-20
// Copyright: (c) 2009 Vadim Zeitlin <[email protected]>
// Licence: wxWindows licence
///////////////////////////////////////////////////////////////////////////////
#ifndef _WX_MOUSEMANAGER_H_
#define _WX_MOUSEMANAGER_H_
#include "wx/event.h"
// ----------------------------------------------------------------------------
// wxMouseEventsManager
// ----------------------------------------------------------------------------
/*
This class handles mouse events and synthesizes high-level notifications
such as clicks and drag events from low level mouse button presses and
mouse movement events. It is useful because handling the mouse events is
less obvious than might seem at a first glance: for example, clicks on an
object should only be generated if the mouse was both pressed and released
over it and not just released (so it requires storing the previous state)
and dragging shouldn't start before the mouse moves away far enough.
This class encapsulates all these dull details for controls containing
multiple items which can be identified by a positive integer index and you
just need to implement its pure virtual functions to use it.
*/
class WXDLLIMPEXP_CORE wxMouseEventsManager : public wxEvtHandler
{
public:
// a mouse event manager is always associated with a window and must be
// deleted by the window when it is destroyed so if it is created using the
// default ctor Create() must be called later
wxMouseEventsManager() { Init(); }
wxMouseEventsManager(wxWindow *win) { Init(); Create(win); }
bool Create(wxWindow *win);
virtual ~wxMouseEventsManager();
protected:
// called to find the item at the given position: return wxNOT_FOUND (-1)
// if there is no item here
virtual int MouseHitTest(const wxPoint& pos) = 0;
// called when the user clicked (i.e. pressed and released mouse over the
// same item), should normally generate a notification about this click and
// return true if it was handled or false otherwise, determining whether
// the original mouse event is skipped or not
virtual bool MouseClicked(int item) = 0;
// called to start dragging the given item, should generate the appropriate
// BEGIN_DRAG event and return false if dragging this item was forbidden
virtual bool MouseDragBegin(int item, const wxPoint& pos) = 0;
// called while the item is being dragged, should normally update the
// feedback on screen (usually using wxOverlay)
virtual void MouseDragging(int item, const wxPoint& pos) = 0;
// called when the mouse is released after dragging the item
virtual void MouseDragEnd(int item, const wxPoint& pos) = 0;
// called when mouse capture is lost while dragging the item, should remove
// the visual feedback drawn by MouseDragging()
virtual void MouseDragCancelled(int item) = 0;
// you don't need to override those but you will want to do if it your
// control renders pressed items differently
// called when the item is becomes pressed, can be used to change its
// appearance
virtual void MouseClickBegin(int WXUNUSED(item)) { }
// called if the mouse capture was lost while the item was pressed, can be
// used to restore the default item appearance if it was changed in
// MouseClickBegin()
virtual void MouseClickCancelled(int WXUNUSED(item)) { }
private:
/*
Here is a small diagram explaining the switches between different
states:
/---------->NORMAL<--------------- Drag end
/ / / | event
/ / | | ^
/ / | | |
Click / N | | mouse | mouse up
event / | | down |
| / | | DRAGGING
| / | | ^
Y|/ N \ v |Y
+-------------+ +--------+ N +-----------+
|On same item?| |On item?| -----------|Begin drag?|
+-------------+ +--------+ / +-----------+
^ | / ^
| | / |
\ mouse | / mouse moved |
\ up v v far enough /
\--------PRESSED-------------------/
There are also transitions from PRESSED and DRAGGING to NORMAL in case
the mouse capture is lost or Escape key is pressed which are not shown.
*/
enum State
{
State_Normal, // initial, default state
State_Pressed, // mouse was pressed over an item
State_Dragging // the item is being dragged
};
// common part of both ctors
void Init();
// various event handlers
void OnCaptureLost(wxMouseCaptureLostEvent& event);
void OnLeftDown(wxMouseEvent& event);
void OnLeftUp(wxMouseEvent& event);
void OnMove(wxMouseEvent& event);
// the associated window, never NULL except between the calls to the
// default ctor and Create()
wxWindow *m_win;
// the current state
State m_state;
// the details of the operation currently in progress, only valid if
// m_state is not normal
// the item being pressed or dragged (always valid, i.e. != wxNOT_FOUND if
// m_state != State_Normal)
int m_item;
// the position of the last mouse event of interest: either mouse press in
// State_Pressed or last movement event in State_Dragging
wxPoint m_posLast;
wxDECLARE_EVENT_TABLE();
wxDECLARE_NO_COPY_CLASS(wxMouseEventsManager);
};
#endif // _WX_MOUSEMANAGER_H_
| h |
rticonnextdds-usecases | data/projects/rticonnextdds-usecases/VehicleTracking/ExampleCode/thirdparty/wxWidgets-3.1.2/Linux/include/wx/wx.h | /////////////////////////////////////////////////////////////////////////////
// Name: wx/wx.h
// Purpose: wxWidgets central header including the most often used ones
// Author: Julian Smart
// Modified by:
// Created: 01/02/97
// Copyright: (c) Julian Smart
// Licence: wxWindows licence
/////////////////////////////////////////////////////////////////////////////
#ifndef _WX_WX_H_
#define _WX_WX_H_
#include "wx/defs.h"
#include "wx/object.h"
#include "wx/dynarray.h"
#include "wx/list.h"
#include "wx/hash.h"
#include "wx/string.h"
#include "wx/hashmap.h"
#include "wx/arrstr.h"
#include "wx/intl.h"
#include "wx/log.h"
#include "wx/event.h"
#include "wx/app.h"
#include "wx/utils.h"
#include "wx/stream.h"
#include "wx/memory.h"
#include "wx/math.h"
#include "wx/stopwatch.h"
#include "wx/timer.h"
#include "wx/module.h"
#include "wx/wxcrt.h"
#include "wx/wxcrtvararg.h"
#if wxUSE_GUI
#include "wx/window.h"
#include "wx/containr.h"
#include "wx/panel.h"
#include "wx/toplevel.h"
#include "wx/frame.h"
#include "wx/gdicmn.h"
#include "wx/gdiobj.h"
#include "wx/region.h"
#include "wx/bitmap.h"
#include "wx/image.h"
#include "wx/colour.h"
#include "wx/font.h"
#include "wx/dc.h"
#include "wx/dcclient.h"
#include "wx/dcmemory.h"
#include "wx/dcprint.h"
#include "wx/dcscreen.h"
#include "wx/button.h"
#include "wx/menuitem.h"
#include "wx/menu.h"
#include "wx/pen.h"
#include "wx/brush.h"
#include "wx/palette.h"
#include "wx/icon.h"
#include "wx/cursor.h"
#include "wx/dialog.h"
#include "wx/settings.h"
#include "wx/msgdlg.h"
#include "wx/dataobj.h"
#include "wx/control.h"
#include "wx/ctrlsub.h"
#include "wx/bmpbuttn.h"
#include "wx/checkbox.h"
#include "wx/checklst.h"
#include "wx/choice.h"
#include "wx/scrolbar.h"
#include "wx/stattext.h"
#include "wx/statbmp.h"
#include "wx/statbox.h"
#include "wx/listbox.h"
#include "wx/radiobox.h"
#include "wx/radiobut.h"
#include "wx/textctrl.h"
#include "wx/slider.h"
#include "wx/gauge.h"
#include "wx/scrolwin.h"
#include "wx/dirdlg.h"
#include "wx/toolbar.h"
#include "wx/combobox.h"
#include "wx/layout.h"
#include "wx/sizer.h"
#include "wx/statusbr.h"
#include "wx/choicdlg.h"
#include "wx/textdlg.h"
#include "wx/filedlg.h"
// this one is included by exactly one file (mdi.cpp) during wx build so even
// although we keep it here for the library users, don't include it to avoid
// bloating the PCH and (worse) rebuilding the entire library when it changes
// when building the library itself
#ifndef WXBUILDING
#include "wx/mdi.h"
#endif
// always include, even if !wxUSE_VALIDATORS because we need wxDefaultValidator
#include "wx/validate.h"
#if wxUSE_VALIDATORS
#include "wx/valtext.h"
#endif // wxUSE_VALIDATORS
#endif // wxUSE_GUI
#endif // _WX_WX_H_
| h |
rticonnextdds-usecases | data/projects/rticonnextdds-usecases/VehicleTracking/ExampleCode/thirdparty/wxWidgets-3.1.2/Linux/include/wx/msgdlg.h | /////////////////////////////////////////////////////////////////////////////
// Name: wx/msgdlg.h
// Purpose: common header and base class for wxMessageDialog
// Author: Julian Smart
// Modified by:
// Created:
// Copyright: (c) Julian Smart
// Licence: wxWindows licence
/////////////////////////////////////////////////////////////////////////////
#ifndef _WX_MSGDLG_H_BASE_
#define _WX_MSGDLG_H_BASE_
#include "wx/defs.h"
#if wxUSE_MSGDLG
#include "wx/dialog.h"
#include "wx/stockitem.h"
extern WXDLLIMPEXP_DATA_CORE(const char) wxMessageBoxCaptionStr[];
// ----------------------------------------------------------------------------
// wxMessageDialogBase: base class defining wxMessageDialog interface
// ----------------------------------------------------------------------------
class WXDLLIMPEXP_CORE wxMessageDialogBase : public wxDialog
{
public:
// helper class for SetXXXLabels() methods: it makes it possible to pass
// either a stock id (wxID_CLOSE) or a string ("&Close") to them
class ButtonLabel
{
public:
// ctors are not explicit, objects of this class can be implicitly
// constructed from either stock ids or strings
ButtonLabel(int stockId)
: m_stockId(stockId)
{
wxASSERT_MSG( wxIsStockID(stockId), "invalid stock id" );
}
ButtonLabel(const wxString& label)
: m_label(label), m_stockId(wxID_NONE)
{
}
ButtonLabel(const char *label)
: m_label(label), m_stockId(wxID_NONE)
{
}
ButtonLabel(const wchar_t *label)
: m_label(label), m_stockId(wxID_NONE)
{
}
ButtonLabel(const wxCStrData& label)
: m_label(label), m_stockId(wxID_NONE)
{
}
// default copy ctor and dtor are ok
// get the string label, whether it was originally specified directly
// or as a stock id -- this is only useful for platforms without native
// stock items id support
wxString GetAsString() const
{
return m_stockId == wxID_NONE
? m_label
: wxGetStockLabel(m_stockId, wxSTOCK_FOR_BUTTON);
}
// return the stock id or wxID_NONE if this is not a stock label
int GetStockId() const { return m_stockId; }
private:
// the label if explicitly given or empty if this is a stock item
const wxString m_label;
// the stock item id or wxID_NONE if m_label should be used
const int m_stockId;
};
// ctors
wxMessageDialogBase() { m_dialogStyle = 0; }
wxMessageDialogBase(wxWindow *parent,
const wxString& message,
const wxString& caption,
long style)
: m_message(message),
m_caption(caption)
{
m_parent = GetParentForModalDialog(parent, style);
SetMessageDialogStyle(style);
}
// virtual dtor for the base class
virtual ~wxMessageDialogBase() { }
wxString GetCaption() const { return m_caption; }
// Title and caption are the same thing, GetCaption() mostly exists just
// for compatibility.
virtual void SetTitle(const wxString& title) wxOVERRIDE { m_caption = title; }
virtual wxString GetTitle() const wxOVERRIDE { return m_caption; }
virtual void SetMessage(const wxString& message)
{
m_message = message;
}
wxString GetMessage() const { return m_message; }
void SetExtendedMessage(const wxString& extendedMessage)
{
m_extendedMessage = extendedMessage;
}
wxString GetExtendedMessage() const { return m_extendedMessage; }
// change the dialog style flag
void SetMessageDialogStyle(long style)
{
wxASSERT_MSG( ((style & wxYES_NO) == wxYES_NO) || !(style & wxYES_NO),
"wxYES and wxNO may only be used together" );
wxASSERT_MSG( !(style & wxYES) || !(style & wxOK),
"wxOK and wxYES/wxNO can't be used together" );
// It is common to specify just the icon, without wxOK, in the existing
// code, especially one written by Windows programmers as MB_OK is 0
// and so they're used to omitting wxOK. Don't complain about it but
// just add wxOK implicitly for compatibility.
if ( !(style & wxYES) && !(style & wxOK) )
style |= wxOK;
wxASSERT_MSG( (style & wxID_OK) != wxID_OK,
"wxMessageBox: Did you mean wxOK (and not wxID_OK)?" );
wxASSERT_MSG( !(style & wxNO_DEFAULT) || (style & wxNO),
"wxNO_DEFAULT is invalid without wxNO" );
wxASSERT_MSG( !(style & wxCANCEL_DEFAULT) || (style & wxCANCEL),
"wxCANCEL_DEFAULT is invalid without wxCANCEL" );
wxASSERT_MSG( !(style & wxCANCEL_DEFAULT) || !(style & wxNO_DEFAULT),
"only one default button can be specified" );
m_dialogStyle = style;
}
long GetMessageDialogStyle() const { return m_dialogStyle; }
// customization of the message box buttons
virtual bool SetYesNoLabels(const ButtonLabel& yes,const ButtonLabel& no)
{
DoSetCustomLabel(m_yes, yes);
DoSetCustomLabel(m_no, no);
return true;
}
virtual bool SetYesNoCancelLabels(const ButtonLabel& yes,
const ButtonLabel& no,
const ButtonLabel& cancel)
{
DoSetCustomLabel(m_yes, yes);
DoSetCustomLabel(m_no, no);
DoSetCustomLabel(m_cancel, cancel);
return true;
}
virtual bool SetOKLabel(const ButtonLabel& ok)
{
DoSetCustomLabel(m_ok, ok);
return true;
}
virtual bool SetOKCancelLabels(const ButtonLabel& ok,
const ButtonLabel& cancel)
{
DoSetCustomLabel(m_ok, ok);
DoSetCustomLabel(m_cancel, cancel);
return true;
}
virtual bool SetHelpLabel(const ButtonLabel& help)
{
DoSetCustomLabel(m_help, help);
return true;
}
// test if any custom labels were set
bool HasCustomLabels() const
{
return !(m_ok.empty() && m_cancel.empty() && m_help.empty() &&
m_yes.empty() && m_no.empty());
}
// these functions return the label to be used for the button which is
// either a custom label explicitly set by the user or the default label,
// i.e. they always return a valid string
wxString GetYesLabel() const
{ return m_yes.empty() ? GetDefaultYesLabel() : m_yes; }
wxString GetNoLabel() const
{ return m_no.empty() ? GetDefaultNoLabel() : m_no; }
wxString GetOKLabel() const
{ return m_ok.empty() ? GetDefaultOKLabel() : m_ok; }
wxString GetCancelLabel() const
{ return m_cancel.empty() ? GetDefaultCancelLabel() : m_cancel; }
wxString GetHelpLabel() const
{ return m_help.empty() ? GetDefaultHelpLabel() : m_help; }
// based on message dialog style, returns exactly one of: wxICON_NONE,
// wxICON_ERROR, wxICON_WARNING, wxICON_QUESTION, wxICON_INFORMATION,
// wxICON_AUTH_NEEDED
virtual long GetEffectiveIcon() const
{
if ( m_dialogStyle & wxICON_NONE )
return wxICON_NONE;
else if ( m_dialogStyle & wxICON_ERROR )
return wxICON_ERROR;
else if ( m_dialogStyle & wxICON_WARNING )
return wxICON_WARNING;
else if ( m_dialogStyle & wxICON_QUESTION )
return wxICON_QUESTION;
else if ( m_dialogStyle & wxICON_INFORMATION )
return wxICON_INFORMATION;
else if ( m_dialogStyle & wxYES )
return wxICON_QUESTION;
else
return wxICON_INFORMATION;
}
protected:
// for the platforms not supporting separate main and extended messages
// this function should be used to combine both of them in a single string
wxString GetFullMessage() const
{
wxString msg = m_message;
if ( !m_extendedMessage.empty() )
msg << "\n\n" << m_extendedMessage;
return msg;
}
wxString m_message,
m_extendedMessage,
m_caption;
long m_dialogStyle;
// this function is called by our public SetXXXLabels() and should assign
// the value to var with possibly some transformation (e.g. Cocoa version
// currently uses this to remove any accelerators from the button strings
// while GTK+ one handles stock items specifically here)
virtual void DoSetCustomLabel(wxString& var, const ButtonLabel& label)
{
var = label.GetAsString();
}
// these functions return the custom label or empty string and should be
// used only in specific circumstances such as creating the buttons with
// these labels (in which case it makes sense to only use a custom label if
// it was really given and fall back on stock label otherwise), use the
// Get{Yes,No,OK,Cancel}Label() methods above otherwise
const wxString& GetCustomYesLabel() const { return m_yes; }
const wxString& GetCustomNoLabel() const { return m_no; }
const wxString& GetCustomOKLabel() const { return m_ok; }
const wxString& GetCustomHelpLabel() const { return m_help; }
const wxString& GetCustomCancelLabel() const { return m_cancel; }
private:
// these functions may be overridden to provide different defaults for the
// default button labels (this is used by wxGTK)
virtual wxString GetDefaultYesLabel() const { return wxGetTranslation("Yes"); }
virtual wxString GetDefaultNoLabel() const { return wxGetTranslation("No"); }
virtual wxString GetDefaultOKLabel() const { return wxGetTranslation("OK"); }
virtual wxString GetDefaultCancelLabel() const { return wxGetTranslation("Cancel"); }
virtual wxString GetDefaultHelpLabel() const { return wxGetTranslation("Help"); }
// labels for the buttons, initially empty meaning that the defaults should
// be used, use GetYes/No/OK/CancelLabel() to access them
wxString m_yes,
m_no,
m_ok,
m_cancel,
m_help;
wxDECLARE_NO_COPY_CLASS(wxMessageDialogBase);
};
#include "wx/generic/msgdlgg.h"
#if defined(__WX_COMPILING_MSGDLGG_CPP__) || \
defined(__WXUNIVERSAL__) || defined(__WXGPE__) || \
(defined(__WXGTK__) && !defined(__WXGTK20__))
#define wxMessageDialog wxGenericMessageDialog
#elif defined(__WXMSW__)
#include "wx/msw/msgdlg.h"
#elif defined(__WXMOTIF__)
#include "wx/motif/msgdlg.h"
#elif defined(__WXGTK20__)
#include "wx/gtk/msgdlg.h"
#elif defined(__WXMAC__)
#include "wx/osx/msgdlg.h"
#elif defined(__WXQT__)
#include "wx/qt/msgdlg.h"
#endif
// ----------------------------------------------------------------------------
// wxMessageBox: the simplest way to use wxMessageDialog
// ----------------------------------------------------------------------------
int WXDLLIMPEXP_CORE wxMessageBox(const wxString& message,
const wxString& caption = wxMessageBoxCaptionStr,
long style = wxOK | wxCENTRE,
wxWindow *parent = NULL,
int x = wxDefaultCoord, int y = wxDefaultCoord);
#endif // wxUSE_MSGDLG
#endif // _WX_MSGDLG_H_BASE_
| h |
rticonnextdds-usecases | data/projects/rticonnextdds-usecases/VehicleTracking/ExampleCode/thirdparty/wxWidgets-3.1.2/Linux/include/wx/tls.h | ///////////////////////////////////////////////////////////////////////////////
// Name: wx/tls.h
// Purpose: Implementation of thread local storage
// Author: Vadim Zeitlin
// Created: 2008-08-08
// Copyright: (c) 2008 Vadim Zeitlin <[email protected]>
// Licence: wxWindows licence
///////////////////////////////////////////////////////////////////////////////
#ifndef _WX_TLS_H_
#define _WX_TLS_H_
#include "wx/defs.h"
// ----------------------------------------------------------------------------
// check for compiler support of thread-specific variables
// ----------------------------------------------------------------------------
// when not using threads at all, there is no need for thread-specific
// values to be really thread-specific
#if !wxUSE_THREADS
#define wxHAS_COMPILER_TLS
#define wxTHREAD_SPECIFIC_DECL
// otherwise try to find the compiler-specific way to handle TLS unless
// explicitly disabled by setting wxUSE_COMPILER_TLS to 0 (it is 1 by default).
#elif wxUSE_COMPILER_TLS
// __thread keyword is not supported correctly by MinGW, at least in some
// configurations, see http://sourceforge.net/support/tracker.php?aid=2837047
// and when in doubt we prefer to not use it at all.
#if defined(HAVE___THREAD_KEYWORD) && !defined(__MINGW32__)
#define wxHAS_COMPILER_TLS
#define wxTHREAD_SPECIFIC_DECL __thread
// MSVC has its own version which might be supported by some other Windows
// compilers, to be tested
#elif defined(__VISUALC__)
#define wxHAS_COMPILER_TLS
#define wxTHREAD_SPECIFIC_DECL __declspec(thread)
#endif // compilers
#endif // wxUSE_COMPILER_TLS
// ----------------------------------------------------------------------------
// define wxTLS_TYPE()
// ----------------------------------------------------------------------------
#ifdef wxHAS_COMPILER_TLS
#define wxTLS_TYPE(T) wxTHREAD_SPECIFIC_DECL T
#define wxTLS_TYPE_REF(T) T&
#define wxTLS_PTR(var) (&(var))
#define wxTLS_VALUE(var) (var)
#else // !wxHAS_COMPILER_TLS
extern "C"
{
typedef void (*wxTlsDestructorFunction)(void*);
}
#if defined(__WINDOWS__)
#include "wx/msw/tls.h"
#elif defined(__UNIX__)
#include "wx/unix/tls.h"
#else
// TODO: we could emulate TLS for such platforms...
#error Neither compiler nor OS support thread-specific variables.
#endif
#include <stdlib.h> // for calloc()
// wxTlsValue<T> represents a thread-specific value of type T but, unlike
// with native compiler thread-specific variables, it behaves like a
// (never NULL) pointer to T and so needs to be dereferenced before use
//
// Note: T must be a POD!
//
// Note: On Unix, thread-specific T value is freed when the thread exits.
// On Windows, thread-specific values are freed later, when given
// wxTlsValue<T> is destroyed. The only exception to this is the
// value for the main thread, which is always freed when
// wxTlsValue<T> is destroyed.
template <typename T>
class wxTlsValue
{
public:
typedef T ValueType;
// ctor doesn't do anything, the object is created on first access
wxTlsValue() : m_key(free) {}
// dtor is only called in the main thread context and so is not enough
// to free memory allocated by us for the other threads, we use
// destructor function when using Pthreads for this (which is not
// called for the main thread as it doesn't call pthread_exit() but
// just to be safe we also reset the key anyhow)
~wxTlsValue()
{
if ( m_key.Get() )
m_key.Set(NULL); // this deletes the value
}
// access the object creating it on demand
ValueType *Get()
{
void *value = m_key.Get();
if ( !value )
{
// ValueType must be POD to be used in wxHAS_COMPILER_TLS case
// anyhow (at least gcc doesn't accept non-POD values being
// declared with __thread) so initialize it as a POD too
value = calloc(1, sizeof(ValueType));
if ( !m_key.Set(value) )
{
free(value);
// this will probably result in a crash in the caller but
// it's arguably better to crash immediately instead of
// slowly dying from out-of-memory errors which would
// happen as the next access to this object would allocate
// another ValueType instance and so on forever
value = NULL;
}
}
return static_cast<ValueType *>(value);
}
// pointer-like accessors
ValueType *operator->() { return Get(); }
ValueType& operator*() { return *Get(); }
private:
wxTlsKey m_key;
wxDECLARE_NO_COPY_TEMPLATE_CLASS(wxTlsValue, T);
};
#define wxTLS_TYPE(T) wxTlsValue<T>
#define wxTLS_TYPE_REF(T) wxTLS_TYPE(T)&
#define wxTLS_PTR(var) ((var).Get())
#define wxTLS_VALUE(var) (*(var))
#endif // wxHAS_COMPILER_TLS/!wxHAS_COMPILER_TLS
#endif // _WX_TLS_H_
| h |
rticonnextdds-usecases | data/projects/rticonnextdds-usecases/VehicleTracking/ExampleCode/thirdparty/wxWidgets-3.1.2/Linux/include/wx/stockitem.h | /////////////////////////////////////////////////////////////////////////////
// Name: wx/stockitem.h
// Purpose: stock items helpers (privateh header)
// Author: Vaclav Slavik
// Modified by:
// Created: 2004-08-15
// Copyright: (c) Vaclav Slavik, 2004
// Licence: wxWindows licence
/////////////////////////////////////////////////////////////////////////////
#ifndef _WX_STOCKITEM_H_
#define _WX_STOCKITEM_H_
#include "wx/defs.h"
#include "wx/chartype.h"
#include "wx/string.h"
#include "wx/accel.h"
// ----------------------------------------------------------------------------
// Helper functions for stock items handling:
// ----------------------------------------------------------------------------
// Returns true if the ID is in the list of recognized stock actions
WXDLLIMPEXP_CORE bool wxIsStockID(wxWindowID id);
// Returns true of the label is empty or label of a stock button with
// given ID
WXDLLIMPEXP_CORE bool wxIsStockLabel(wxWindowID id, const wxString& label);
enum wxStockLabelQueryFlag
{
wxSTOCK_NOFLAGS = 0,
wxSTOCK_WITH_MNEMONIC = 1,
wxSTOCK_WITH_ACCELERATOR = 2,
// by default, stock items text is returned with ellipsis, if appropriate,
// this flag allows to avoid having it
wxSTOCK_WITHOUT_ELLIPSIS = 4,
// return label for button, not menu item: buttons should always use
// mnemonics and never use ellipsis
wxSTOCK_FOR_BUTTON = wxSTOCK_WITHOUT_ELLIPSIS | wxSTOCK_WITH_MNEMONIC
};
// Returns label that should be used for given stock UI element (e.g. "&OK"
// for wxSTOCK_OK); if wxSTOCK_WITH_MNEMONIC is given, the & character
// is included; if wxSTOCK_WITH_ACCELERATOR is given, the stock accelerator
// for given ID is concatenated to the label using \t as separator
WXDLLIMPEXP_CORE wxString wxGetStockLabel(wxWindowID id,
long flags = wxSTOCK_WITH_MNEMONIC);
#if wxUSE_ACCEL
// Returns the accelerator that should be used for given stock UI element
// (e.g. "Ctrl+x" for wxSTOCK_EXIT)
WXDLLIMPEXP_CORE wxAcceleratorEntry wxGetStockAccelerator(wxWindowID id);
#endif
// wxStockHelpStringClient conceptually works like wxArtClient: it gives a hint to
// wxGetStockHelpString() about the context where the help string is to be used
enum wxStockHelpStringClient
{
wxSTOCK_MENU // help string to use for menu items
};
// Returns an help string for the given stock UI element and for the given "context".
WXDLLIMPEXP_CORE wxString wxGetStockHelpString(wxWindowID id,
wxStockHelpStringClient client = wxSTOCK_MENU);
#ifdef __WXGTK20__
// Translates stock ID to GTK+'s stock item string identifier:
WXDLLIMPEXP_CORE const char *wxGetStockGtkID(wxWindowID id);
#endif
#endif // _WX_STOCKITEM_H_
| h |
rticonnextdds-usecases | data/projects/rticonnextdds-usecases/VehicleTracking/ExampleCode/thirdparty/wxWidgets-3.1.2/Linux/include/wx/windowid.h | ///////////////////////////////////////////////////////////////////////////////
// Name: wx/windowid.h
// Purpose: wxWindowID class - a class for managing window ids
// Author: Brian Vanderburg II
// Created: 2007-09-21
// Copyright: (c) 2007 Brian Vanderburg II
// Licence: wxWindows licence
///////////////////////////////////////////////////////////////////////////////
#ifndef _WX_WINDOWID_H_
#define _WX_WINDOWID_H_
// NB: do not include defs.h as we are included from it
typedef int wxWindowID;
// ----------------------------------------------------------------------------
// wxWindowIDRef: reference counted id value
// ----------------------------------------------------------------------------
// A wxWindowIDRef object wraps an id value and marks it as (un)used as
// necessary. All ids returned from wxWindow::NewControlId() should be assigned
// to an instance of this class to ensure that the id is marked as being in
// use.
//
// This class is always defined but it is trivial if wxUSE_AUTOID_MANAGEMENT is
// off.
class WXDLLIMPEXP_CORE wxWindowIDRef
{
public:
// default ctor
wxWindowIDRef()
{
m_id = wxID_NONE;
}
// ctor taking id values
wxWindowIDRef(int id)
{
Init(id);
}
wxWindowIDRef(long id)
{
Init(wxWindowID(id));
}
wxWindowIDRef(const wxWindowIDRef& id)
{
Init(id.m_id);
}
// dtor
~wxWindowIDRef()
{
Assign(wxID_NONE);
}
// assignment
wxWindowIDRef& operator=(int id)
{
Assign(id);
return *this;
}
wxWindowIDRef& operator=(long id)
{
Assign(wxWindowID(id));
return *this;
}
wxWindowIDRef& operator=(const wxWindowIDRef& id)
{
if (&id != this)
Assign(id.m_id);
return *this;
}
// access to the stored id value
wxWindowID GetValue() const
{
return m_id;
}
operator wxWindowID() const
{
return m_id;
}
private:
#if wxUSE_AUTOID_MANAGEMENT
// common part of all ctors: call Assign() for our new id
void Init(wxWindowID id)
{
// m_id must be initialized before calling Assign()
m_id = wxID_NONE;
Assign(id);
}
// increase reference count of id, decrease the one of m_id
void Assign(wxWindowID id);
#else // !wxUSE_AUTOID_MANAGEMENT
// trivial stubs for the functions above
void Init(wxWindowID id)
{
m_id = id;
}
void Assign(wxWindowID id)
{
m_id = id;
}
#endif // wxUSE_AUTOID_MANAGEMENT/!wxUSE_AUTOID_MANAGEMENT
wxWindowID m_id;
};
// comparison operators
inline bool operator==(const wxWindowIDRef& lhs, const wxWindowIDRef& rhs)
{
return lhs.GetValue() == rhs.GetValue();
}
inline bool operator==(const wxWindowIDRef& lhs, int rhs)
{
return lhs.GetValue() == rhs;
}
inline bool operator==(const wxWindowIDRef& lhs, long rhs)
{
return lhs.GetValue() == rhs;
}
inline bool operator==(int lhs, const wxWindowIDRef& rhs)
{
return rhs == lhs;
}
inline bool operator==(long lhs, const wxWindowIDRef& rhs)
{
return rhs == lhs;
}
inline bool operator!=(const wxWindowIDRef& lhs, const wxWindowIDRef& rhs)
{
return !(lhs == rhs);
}
inline bool operator!=(const wxWindowIDRef& lhs, int rhs)
{
return !(lhs == rhs);
}
inline bool operator!=(const wxWindowIDRef& lhs, long rhs)
{
return !(lhs == rhs);
}
inline bool operator!=(int lhs, const wxWindowIDRef& rhs)
{
return !(lhs == rhs);
}
inline bool operator!=(long lhs, const wxWindowIDRef& rhs)
{
return !(lhs == rhs);
}
// ----------------------------------------------------------------------------
// wxIdManager
// ----------------------------------------------------------------------------
class WXDLLIMPEXP_CORE wxIdManager
{
public:
// This returns an id value and not an wxWindowIDRef. The returned value
// should be assigned a.s.a.p to a wxWindowIDRef. The IDs are marked as
// reserved so that another call to ReserveId before assigning the id to a
// wxWindowIDRef will not use the same ID
static wxWindowID ReserveId(int count = 1);
// This will release an unused reserved ID. This should only be called
// if the ID returned by ReserveId was NOT assigned to a wxWindowIDRef
// for some purpose, maybe an early return from a function
static void UnreserveId(wxWindowID id, int count = 1);
};
#endif // _WX_WINDOWID_H_
| h |
rticonnextdds-usecases | data/projects/rticonnextdds-usecases/VehicleTracking/ExampleCode/thirdparty/wxWidgets-3.1.2/Linux/include/wx/xtitypes.h | /////////////////////////////////////////////////////////////////////////////
// Name: wx/xtitypes.h
// Purpose: enum, set, basic types support
// Author: Stefan Csomor
// Modified by: Francesco Montorsi
// Created: 27/07/03
// Copyright: (c) 1997 Julian Smart
// (c) 2003 Stefan Csomor
// Licence: wxWindows licence
/////////////////////////////////////////////////////////////////////////////
#ifndef _XTITYPES_H_
#define _XTITYPES_H_
#include "wx/defs.h"
#if wxUSE_EXTENDED_RTTI
#include "wx/string.h"
#include "wx/hashmap.h"
#include "wx/arrstr.h"
#include "wx/flags.h"
#include "wx/intl.h"
#include "wx/log.h"
#include <typeinfo>
class WXDLLIMPEXP_BASE wxClassInfo;
// ----------------------------------------------------------------------------
// Enum Support
//
// In the header files XTI requires no change from pure c++ code, however in the
// implementation, an enum needs to be enumerated e.g.:
//
// wxBEGIN_ENUM( wxFlavor )
// wxENUM_MEMBER( Vanilla )
// wxENUM_MEMBER( Chocolate )
// wxENUM_MEMBER( Strawberry )
// wxEND_ENUM( wxFlavor )
// ----------------------------------------------------------------------------
struct WXDLLIMPEXP_BASE wxEnumMemberData
{
const wxChar* m_name;
int m_value;
};
class WXDLLIMPEXP_BASE wxEnumData
{
public:
wxEnumData( wxEnumMemberData* data );
// returns true if the member has been found and sets the int value
// pointed to accordingly (if ptr != null )
// if not found returns false, value left unchanged
bool HasEnumMemberValue( const wxChar *name, int *value = NULL ) const;
// returns the value of the member, if not found in debug mode an
// assert is issued, in release 0 is returned
int GetEnumMemberValue(const wxChar *name ) const;
// returns the name of the enum member having the passed in value
// returns an empty string if not found
const wxChar *GetEnumMemberName(int value) const;
// returns the number of members in this enum
int GetEnumCount() const { return m_count; }
// returns the value of the nth member
int GetEnumMemberValueByIndex( int n ) const;
// returns the value of the nth member
const wxChar *GetEnumMemberNameByIndex( int n ) const;
private:
wxEnumMemberData *m_members;
int m_count;
};
#define wxBEGIN_ENUM( e ) \
wxEnumMemberData s_enumDataMembers##e[] = {
#define wxENUM_MEMBER( v ) { wxT(#v), v },
#define wxEND_ENUM( e ) \
{ NULL, 0 } }; \
wxEnumData s_enumData##e( s_enumDataMembers##e ); \
wxEnumData *wxGetEnumData(e) { return &s_enumData##e; } \
template<> void wxStringReadValue(const wxString& s, e &data ) \
{ data = (e) s_enumData##e.GetEnumMemberValue(s.c_str()); } \
template<> void wxStringWriteValue(wxString &s, const e &data ) \
{ s = s_enumData##e.GetEnumMemberName((int)data); } \
void FromLong##e( long data, wxAny& result ) \
{ result = wxAny((e)data); } \
void ToLong##e( const wxAny& data, long &result ) \
{ result = (long) (data).As(static_cast<e*>(NULL)); } \
\
wxTO_STRING_IMP( e ) \
wxFROM_STRING_IMP( e ) \
wxEnumTypeInfo s_typeInfo##e(wxT_ENUM, &s_enumData##e, \
&wxTO_STRING( e ), &wxFROM_STRING( e ), &ToLong##e, \
&FromLong##e, typeid(e).name() );
// ----------------------------------------------------------------------------
// Set Support
//
// in the header :
//
// enum wxFlavor
// {
// Vanilla,
// Chocolate,
// Strawberry,
// };
//
// typedef wxBitset<wxFlavor> wxCoupe;
//
// in the implementation file :
//
// wxBEGIN_ENUM( wxFlavor )
// wxENUM_MEMBER( Vanilla )
// wxENUM_MEMBER( Chocolate )
// wxENUM_MEMBER( Strawberry )
// wxEND_ENUM( wxFlavor )
//
// wxIMPLEMENT_SET_STREAMING( wxCoupe, wxFlavor )
//
// implementation note: no partial specialization for streaming, but a delegation
// to a different class
//
// ----------------------------------------------------------------------------
void WXDLLIMPEXP_BASE wxSetStringToArray( const wxString &s, wxArrayString &array );
template<typename e>
void wxSetFromString(const wxString &s, wxBitset<e> &data )
{
wxEnumData* edata = wxGetEnumData((e) 0);
data.reset();
wxArrayString array;
wxSetStringToArray( s, array );
wxString flag;
for ( int i = 0; i < array.Count(); ++i )
{
flag = array[i];
int ivalue;
if ( edata->HasEnumMemberValue( flag.c_str(), &ivalue ) )
{
data.set( (e) ivalue );
}
}
}
template<typename e>
void wxSetToString( wxString &s, const wxBitset<e> &data )
{
wxEnumData* edata = wxGetEnumData((e) 0);
int count = edata->GetEnumCount();
int i;
s.Clear();
for ( i = 0; i < count; i++ )
{
e value = (e) edata->GetEnumMemberValueByIndex(i);
if ( data.test( value ) )
{
// this could also be done by the templated calls
if ( !s.empty() )
s += wxT("|");
s += edata->GetEnumMemberNameByIndex(i);
}
}
}
#define wxIMPLEMENT_SET_STREAMING(SetName,e) \
template<> void wxStringReadValue(const wxString &s, wxBitset<e> &data ) \
{ wxSetFromString( s, data ); } \
template<> void wxStringWriteValue( wxString &s, const wxBitset<e> &data ) \
{ wxSetToString( s, data ); } \
void FromLong##SetName( long data, wxAny& result ) \
{ result = wxAny(SetName((unsigned long)data)); } \
void ToLong##SetName( const wxAny& data, long &result ) \
{ result = (long) (data).As(static_cast<SetName*>(NULL)).to_ulong(); } \
wxTO_STRING_IMP( SetName ) \
wxFROM_STRING_IMP( SetName ) \
wxEnumTypeInfo s_typeInfo##SetName(wxT_SET, &s_enumData##e, \
&wxTO_STRING( SetName ), &wxFROM_STRING( SetName ), \
&ToLong##SetName, &FromLong##SetName, typeid(SetName).name() );
template<typename e>
void wxFlagsFromString(const wxString &s, e &data )
{
wxEnumData* edata = wxGetEnumData((e*) 0);
data.m_data = 0;
wxArrayString array;
wxSetStringToArray( s, array );
wxString flag;
for ( size_t i = 0; i < array.Count(); ++i )
{
flag = array[i];
int ivalue;
if ( edata->HasEnumMemberValue( flag.c_str(), &ivalue ) )
{
data.m_data |= ivalue;
}
}
}
template<typename e>
void wxFlagsToString( wxString &s, const e& data )
{
wxEnumData* edata = wxGetEnumData((e*) 0);
int count = edata->GetEnumCount();
int i;
s.Clear();
long dataValue = data.m_data;
for ( i = 0; i < count; i++ )
{
int value = edata->GetEnumMemberValueByIndex(i);
// make this to allow for multi-bit constants to work
if ( value && ( dataValue & value ) == value )
{
// clear the flags we just set
dataValue &= ~value;
// this could also be done by the templated calls
if ( !s.empty() )
s +=wxT("|");
s += edata->GetEnumMemberNameByIndex(i);
}
}
}
#define wxBEGIN_FLAGS( e ) \
wxEnumMemberData s_enumDataMembers##e[] = {
#define wxFLAGS_MEMBER( v ) { wxT(#v), static_cast<int>(v) },
#define wxEND_FLAGS( e ) \
{ NULL, 0 } }; \
wxEnumData s_enumData##e( s_enumDataMembers##e ); \
wxEnumData *wxGetEnumData(e*) { return &s_enumData##e; } \
template<> void wxStringReadValue(const wxString &s, e &data ) \
{ wxFlagsFromString<e>( s, data ); } \
template<> void wxStringWriteValue( wxString &s, const e& data ) \
{ wxFlagsToString<e>( s, data ); } \
void FromLong##e( long data, wxAny& result ) \
{ result = wxAny(e(data)); } \
void ToLong##e( const wxAny& data, long &result ) \
{ result = (long) (data).As(static_cast<e*>(NULL)).m_data; } \
wxTO_STRING_IMP( e ) \
wxFROM_STRING_IMP( e ) \
wxEnumTypeInfo s_typeInfo##e(wxT_SET, &s_enumData##e, \
&wxTO_STRING( e ), &wxFROM_STRING( e ), &ToLong##e, \
&FromLong##e, typeid(e).name() );
// ----------------------------------------------------------------------------
// Type Information
// ----------------------------------------------------------------------------
// All data exposed by the RTTI is characterized using the following classes.
// The first characterization is done by wxTypeKind. All enums up to and including
// wxT_CUSTOM represent so called simple types. These cannot be divided any further.
// They can be converted to and from wxStrings, that's all.
// Other wxTypeKinds can instead be splitted recursively into smaller parts until
// the simple types are reached.
enum wxTypeKind
{
wxT_VOID = 0, // unknown type
wxT_BOOL,
wxT_CHAR,
wxT_UCHAR,
wxT_INT,
wxT_UINT,
wxT_LONG,
wxT_ULONG,
wxT_LONGLONG,
wxT_ULONGLONG,
wxT_FLOAT,
wxT_DOUBLE,
wxT_STRING, // must be wxString
wxT_SET, // must be wxBitset<> template
wxT_ENUM,
wxT_CUSTOM, // user defined type (e.g. wxPoint)
wxT_LAST_SIMPLE_TYPE_KIND = wxT_CUSTOM,
wxT_OBJECT_PTR, // object reference
wxT_OBJECT, // embedded object
wxT_COLLECTION, // collection
wxT_DELEGATE, // for connecting against an event source
wxT_LAST_TYPE_KIND = wxT_DELEGATE // sentinel for bad data, asserts, debugging
};
class WXDLLIMPEXP_BASE wxAny;
class WXDLLIMPEXP_BASE wxTypeInfo;
WX_DECLARE_STRING_HASH_MAP_WITH_DECL( wxTypeInfo*, wxTypeInfoMap, class WXDLLIMPEXP_BASE );
class WXDLLIMPEXP_BASE wxTypeInfo
{
public:
typedef void (*wxVariant2StringFnc)( const wxAny& data, wxString &result );
typedef void (*wxString2VariantFnc)( const wxString& data, wxAny &result );
wxTypeInfo(wxTypeKind kind,
wxVariant2StringFnc to = NULL, wxString2VariantFnc from = NULL,
const wxString &name = wxEmptyString):
m_toString(to), m_fromString(from), m_kind(kind), m_name(name)
{
Register();
}
#if 0 // wxUSE_UNICODE
wxTypeInfo(wxTypeKind kind,
wxVariant2StringFnc to, wxString2VariantFnc from,
const char *name):
m_toString(to), m_fromString(from), m_kind(kind),
m_name(wxString::FromAscii(name))
{
Register();
}
#endif
virtual ~wxTypeInfo()
{
Unregister();
}
// return the kind of this type (wxT_... constants)
wxTypeKind GetKind() const { return m_kind; }
// returns the unique name of this type
const wxString& GetTypeName() const { return m_name; }
// is this type a delegate type
bool IsDelegateType() const { return m_kind == wxT_DELEGATE; }
// is this type a custom type
bool IsCustomType() const { return m_kind == wxT_CUSTOM; }
// is this type an object type
bool IsObjectType() const { return m_kind == wxT_OBJECT || m_kind == wxT_OBJECT_PTR; }
// can the content of this type be converted to and from strings ?
bool HasStringConverters() const { return m_toString != NULL && m_fromString != NULL; }
// convert a wxAny holding data of this type into a string
void ConvertToString( const wxAny& data, wxString &result ) const
{
if ( m_toString )
(*m_toString)( data, result );
else
wxLogError( wxGetTranslation(wxT("String conversions not supported")) );
}
// convert a string into a wxAny holding the corresponding data in this type
void ConvertFromString( const wxString& data, wxAny &result ) const
{
if( m_fromString )
(*m_fromString)( data, result );
else
wxLogError( wxGetTranslation(wxT("String conversions not supported")) );
}
// statics:
// looks for the corresponding type, will return NULL if not found
static wxTypeInfo *FindType( const wxString& typeName );
private:
void Register();
void Unregister();
wxVariant2StringFnc m_toString;
wxString2VariantFnc m_fromString;
wxTypeKind m_kind;
wxString m_name;
// the static list of all types we know about
static wxTypeInfoMap* ms_typeTable;
};
class WXDLLIMPEXP_BASE wxBuiltInTypeInfo : public wxTypeInfo
{
public:
wxBuiltInTypeInfo( wxTypeKind kind, wxVariant2StringFnc to = NULL,
wxString2VariantFnc from = NULL,
const wxString &name = wxEmptyString ) :
wxTypeInfo( kind, to, from, name )
{ wxASSERT_MSG( GetKind() < wxT_SET, wxT("Illegal Kind for Base Type") ); }
};
class WXDLLIMPEXP_BASE wxCustomTypeInfo : public wxTypeInfo
{
public:
wxCustomTypeInfo( const wxString &name, wxVariant2StringFnc to,
wxString2VariantFnc from ) :
wxTypeInfo( wxT_CUSTOM, to, from, name )
{}
};
class WXDLLIMPEXP_BASE wxEnumTypeInfo : public wxTypeInfo
{
public:
typedef void (*converterToLong_t)( const wxAny& data, long &result );
typedef void (*converterFromLong_t)( long data, wxAny &result );
wxEnumTypeInfo( wxTypeKind kind, wxEnumData* enumInfo, wxVariant2StringFnc to,
wxString2VariantFnc from, converterToLong_t toLong,
converterFromLong_t fromLong, const wxString &name ) :
wxTypeInfo( kind, to, from, name ), m_toLong( toLong ), m_fromLong( fromLong )
{
wxASSERT_MSG( kind == wxT_ENUM || kind == wxT_SET,
wxT("Illegal Kind for Enum Type"));
m_enumInfo = enumInfo;
}
const wxEnumData* GetEnumData() const { return m_enumInfo; }
// convert a wxAny holding data of this type into a long
void ConvertToLong( const wxAny& data, long &result ) const
{
if( m_toLong )
(*m_toLong)( data, result );
else
wxLogError( wxGetTranslation(wxT("Long Conversions not supported")) );
}
// convert a long into a wxAny holding the corresponding data in this type
void ConvertFromLong( long data, wxAny &result ) const
{
if( m_fromLong )
(*m_fromLong)( data, result );
else
wxLogError( wxGetTranslation(wxT("Long Conversions not supported")) );
}
private:
converterToLong_t m_toLong;
converterFromLong_t m_fromLong;
wxEnumData *m_enumInfo; // Kind == wxT_ENUM or Kind == wxT_SET
};
class WXDLLIMPEXP_BASE wxClassTypeInfo : public wxTypeInfo
{
public:
wxClassTypeInfo( wxTypeKind kind, wxClassInfo* classInfo,
wxVariant2StringFnc to = NULL, wxString2VariantFnc from = NULL,
const wxString &name = wxEmptyString);
const wxClassInfo *GetClassInfo() const { return m_classInfo; }
private:
wxClassInfo *m_classInfo; // Kind == wxT_OBJECT - could be NULL
};
class WXDLLIMPEXP_BASE wxCollectionTypeInfo : public wxTypeInfo
{
public:
wxCollectionTypeInfo( const wxString &elementName, wxVariant2StringFnc to,
wxString2VariantFnc from , const wxString &name) :
wxTypeInfo( wxT_COLLECTION, to, from, name )
{ m_elementTypeName = elementName; m_elementType = NULL; }
const wxTypeInfo* GetElementType() const
{
if ( m_elementType == NULL )
m_elementType = wxTypeInfo::FindType( m_elementTypeName );
return m_elementType;
}
private:
mutable wxTypeInfo * m_elementType;
wxString m_elementTypeName;
};
class WXDLLIMPEXP_BASE wxEventSourceTypeInfo : public wxTypeInfo
{
public:
wxEventSourceTypeInfo( int eventType, wxClassInfo* eventClass,
wxVariant2StringFnc to = NULL,
wxString2VariantFnc from = NULL );
wxEventSourceTypeInfo( int eventType, int lastEventType, wxClassInfo* eventClass,
wxVariant2StringFnc to = NULL, wxString2VariantFnc from = NULL );
int GetEventType() const { return m_eventType; }
int GetLastEventType() const { return m_lastEventType; }
const wxClassInfo* GetEventClass() const { return m_eventClass; }
private:
const wxClassInfo *m_eventClass; // (extended will merge into classinfo)
int m_eventType;
int m_lastEventType;
};
template<typename T> const wxTypeInfo* wxGetTypeInfo( T * )
{ return wxTypeInfo::FindType(typeid(T).name()); }
// this macro is for usage with custom, non-object derived classes and structs,
// wxPoint is such a custom type
#if wxUSE_FUNC_TEMPLATE_POINTER
#define wxCUSTOM_TYPE_INFO( e, toString, fromString ) \
wxCustomTypeInfo s_typeInfo##e(typeid(e).name(), &toString, &fromString);
#else
#define wxCUSTOM_TYPE_INFO( e, toString, fromString ) \
void ToString##e( const wxAny& data, wxString &result ) \
{ toString(data, result); } \
void FromString##e( const wxString& data, wxAny &result ) \
{ fromString(data, result); } \
wxCustomTypeInfo s_typeInfo##e(typeid(e).name(), \
&ToString##e, &FromString##e);
#endif
#define wxCOLLECTION_TYPE_INFO( element, collection ) \
wxCollectionTypeInfo s_typeInfo##collection( typeid(element).name(), \
NULL, NULL, typeid(collection).name() );
// sometimes a compiler invents specializations that are nowhere called,
// use this macro to satisfy the refs, currently we don't have to play
// tricks, but if we will have to according to the compiler, we will use
// that macro for that
#define wxILLEGAL_TYPE_SPECIALIZATION( a )
#endif // wxUSE_EXTENDED_RTTI
#endif // _XTITYPES_H_
| h |
rticonnextdds-usecases | data/projects/rticonnextdds-usecases/VehicleTracking/ExampleCode/thirdparty/wxWidgets-3.1.2/Linux/include/wx/arrstr.h | ///////////////////////////////////////////////////////////////////////////////
// Name: wx/arrstr.h
// Purpose: wxArrayString class
// Author: Mattia Barbon and Vadim Zeitlin
// Modified by:
// Created: 07/07/03
// Copyright: (c) 2003 Vadim Zeitlin <[email protected]>
// Licence: wxWindows licence
///////////////////////////////////////////////////////////////////////////////
#ifndef _WX_ARRSTR_H
#define _WX_ARRSTR_H
#include "wx/defs.h"
#include "wx/string.h"
#include "wx/dynarray.h"
#if wxUSE_STD_CONTAINERS_COMPATIBLY
#include <vector>
#endif
// these functions are only used in STL build now but we define them in any
// case for compatibility with the existing code outside of the library which
// could be using them
inline int wxCMPFUNC_CONV wxStringSortAscending(const wxString& s1, const wxString& s2)
{
return s1.Cmp(s2);
}
inline int wxCMPFUNC_CONV wxStringSortDescending(const wxString& s1, const wxString& s2)
{
return wxStringSortAscending(s2, s1);
}
// This comparison function ignores case when comparing strings differing not
// in case only, i.e. this ensures that "Aa" comes before "AB", unlike with
// wxStringSortAscending().
inline int wxCMPFUNC_CONV
wxDictionaryStringSortAscending(const wxString& s1, const wxString& s2)
{
const int cmp = s1.CmpNoCase(s2);
return cmp ? cmp : s1.Cmp(s2);
}
inline int wxCMPFUNC_CONV
wxDictionaryStringSortDescending(const wxString& s1, const wxString& s2)
{
return wxDictionaryStringSortAscending(s2, s1);
}
#if wxUSE_STD_CONTAINERS
typedef int (wxCMPFUNC_CONV *CMPFUNCwxString)(wxString*, wxString*);
WX_DEFINE_USER_EXPORTED_TYPEARRAY(wxString, wxArrayStringBase,
wxARRAY_DUMMY_BASE, WXDLLIMPEXP_BASE);
class WXDLLIMPEXP_BASE wxArrayString : public wxArrayStringBase
{
public:
// type of function used by wxArrayString::Sort()
typedef int (wxCMPFUNC_CONV *CompareFunction)(const wxString& first,
const wxString& second);
wxArrayString() { }
wxArrayString(const wxArrayString& a) : wxArrayStringBase(a) { }
wxArrayString(size_t sz, const char** a);
wxArrayString(size_t sz, const wchar_t** a);
wxArrayString(size_t sz, const wxString* a);
int Index(const wxString& str, bool bCase = true, bool bFromEnd = false) const;
void Sort(bool reverseOrder = false);
void Sort(CompareFunction function);
void Sort(CMPFUNCwxString function) { wxArrayStringBase::Sort(function); }
size_t Add(const wxString& string, size_t copies = 1)
{
wxArrayStringBase::Add(string, copies);
return size() - copies;
}
};
// Unlike all the other sorted arrays, this one uses a comparison function
// taking objects by reference rather than value, so define a special functor
// wrapping it.
class wxSortedArrayString_SortFunction
{
public:
typedef int (wxCMPFUNC_CONV *CMPFUNC)(const wxString&, const wxString&);
explicit wxSortedArrayString_SortFunction(CMPFUNC f) : m_f(f) { }
bool operator()(const wxString& s1, const wxString& s2)
{ return m_f(s1, s2) < 0; }
private:
CMPFUNC m_f;
};
typedef wxBaseSortedArray<wxString, wxSortedArrayString_SortFunction>
wxSortedArrayStringBase;
class WXDLLIMPEXP_BASE wxSortedArrayString : public wxSortedArrayStringBase
{
public:
wxSortedArrayString() : wxSortedArrayStringBase(wxStringSortAscending)
{ }
wxSortedArrayString(const wxSortedArrayString& array)
: wxSortedArrayStringBase(array)
{ }
wxSortedArrayString(const wxArrayString& src)
: wxSortedArrayStringBase(wxStringSortAscending)
{
reserve(src.size());
for ( size_t n = 0; n < src.size(); n++ )
Add(src[n]);
}
explicit wxSortedArrayString(wxArrayString::CompareFunction compareFunction)
: wxSortedArrayStringBase(compareFunction)
{ }
int Index(const wxString& str, bool bCase = true, bool bFromEnd = false) const;
private:
void Insert()
{
wxFAIL_MSG( "wxSortedArrayString::Insert() is not to be used" );
}
void Sort()
{
wxFAIL_MSG( "wxSortedArrayString::Sort() is not to be used" );
}
};
#else // if !wxUSE_STD_CONTAINERS
#include "wx/beforestd.h"
#include <iterator>
#include "wx/afterstd.h"
class WXDLLIMPEXP_BASE wxArrayString
{
public:
// type of function used by wxArrayString::Sort()
typedef int (wxCMPFUNC_CONV *CompareFunction)(const wxString& first,
const wxString& second);
// type of function used by wxArrayString::Sort(), for compatibility with
// wxArray
typedef int (wxCMPFUNC_CONV *CompareFunction2)(wxString* first,
wxString* second);
// constructors and destructor
// default ctor
wxArrayString() { Init(false); }
// if autoSort is true, the array is always sorted (in alphabetical order)
//
// NB: the reason for using int and not bool is that like this we can avoid
// using this ctor for implicit conversions from "const char *" (which
// we'd like to be implicitly converted to wxString instead!). This
// wouldn't be needed if the 'explicit' keyword was supported by all
// compilers, or if this was protected ctor for wxSortedArrayString,
// but we're stuck with it now.
explicit wxArrayString(int autoSort) { Init(autoSort != 0); }
// C string array ctor
wxArrayString(size_t sz, const char** a);
wxArrayString(size_t sz, const wchar_t** a);
// wxString string array ctor
wxArrayString(size_t sz, const wxString* a);
// copy ctor
wxArrayString(const wxArrayString& array);
// assignment operator
wxArrayString& operator=(const wxArrayString& src);
// not virtual, this class should not be derived from
~wxArrayString();
// memory management
// empties the list, but doesn't release memory
void Empty();
// empties the list and releases memory
void Clear();
// preallocates memory for given number of items
void Alloc(size_t nCount);
// minimizes the memory usage (by freeing all extra memory)
void Shrink();
// simple accessors
// number of elements in the array
size_t GetCount() const { return m_nCount; }
// is it empty?
bool IsEmpty() const { return m_nCount == 0; }
// number of elements in the array (GetCount is preferred API)
size_t Count() const { return m_nCount; }
// items access (range checking is done in debug version)
// get item at position uiIndex
wxString& Item(size_t nIndex)
{
wxASSERT_MSG( nIndex < m_nCount,
wxT("wxArrayString: index out of bounds") );
return m_pItems[nIndex];
}
const wxString& Item(size_t nIndex) const { return const_cast<wxArrayString*>(this)->Item(nIndex); }
// same as Item()
wxString& operator[](size_t nIndex) { return Item(nIndex); }
const wxString& operator[](size_t nIndex) const { return Item(nIndex); }
// get last item
wxString& Last()
{
wxASSERT_MSG( !IsEmpty(),
wxT("wxArrayString: index out of bounds") );
return Item(GetCount() - 1);
}
const wxString& Last() const { return const_cast<wxArrayString*>(this)->Last(); }
// item management
// Search the element in the array, starting from the beginning if
// bFromEnd is false or from end otherwise. If bCase, comparison is case
// sensitive (default). Returns index of the first item matched or
// wxNOT_FOUND
int Index (const wxString& str, bool bCase = true, bool bFromEnd = false) const;
// add new element at the end (if the array is not sorted), return its
// index
size_t Add(const wxString& str, size_t nInsert = 1);
// add new element at given position
void Insert(const wxString& str, size_t uiIndex, size_t nInsert = 1);
// expand the array to have count elements
void SetCount(size_t count);
// remove first item matching this value
void Remove(const wxString& sz);
// remove item by index
void RemoveAt(size_t nIndex, size_t nRemove = 1);
// sorting
// sort array elements in alphabetical order (or reversed alphabetical
// order if reverseOrder parameter is true)
void Sort(bool reverseOrder = false);
// sort array elements using specified comparison function
void Sort(CompareFunction compareFunction);
void Sort(CompareFunction2 compareFunction);
// comparison
// compare two arrays case sensitively
bool operator==(const wxArrayString& a) const;
// compare two arrays case sensitively
bool operator!=(const wxArrayString& a) const { return !(*this == a); }
// STL-like interface
typedef wxString value_type;
typedef value_type* pointer;
typedef const value_type* const_pointer;
typedef value_type* iterator;
typedef const value_type* const_iterator;
typedef value_type& reference;
typedef const value_type& const_reference;
typedef int difference_type;
typedef size_t size_type;
// TODO: this code duplicates the one in dynarray.h
class reverse_iterator
{
typedef wxString value_type;
typedef value_type* pointer;
typedef value_type& reference;
typedef reverse_iterator itor;
friend itor operator+(int o, const itor& it);
friend itor operator+(const itor& it, int o);
friend itor operator-(const itor& it, int o);
friend difference_type operator -(const itor& i1, const itor& i2);
public:
pointer m_ptr;
reverse_iterator() : m_ptr(NULL) { }
explicit reverse_iterator(pointer ptr) : m_ptr(ptr) { }
reverse_iterator(const itor& it) : m_ptr(it.m_ptr) { }
reference operator*() const { return *m_ptr; }
pointer operator->() const { return m_ptr; }
itor& operator++() { --m_ptr; return *this; }
const itor operator++(int)
{ const reverse_iterator tmp = *this; --m_ptr; return tmp; }
itor& operator--() { ++m_ptr; return *this; }
const itor operator--(int) { const itor tmp = *this; ++m_ptr; return tmp; }
bool operator ==(const itor& it) const { return m_ptr == it.m_ptr; }
bool operator !=(const itor& it) const { return m_ptr != it.m_ptr; }
};
class const_reverse_iterator
{
typedef wxString value_type;
typedef const value_type* pointer;
typedef const value_type& reference;
typedef const_reverse_iterator itor;
friend itor operator+(int o, const itor& it);
friend itor operator+(const itor& it, int o);
friend itor operator-(const itor& it, int o);
friend difference_type operator -(const itor& i1, const itor& i2);
public:
pointer m_ptr;
const_reverse_iterator() : m_ptr(NULL) { }
explicit const_reverse_iterator(pointer ptr) : m_ptr(ptr) { }
const_reverse_iterator(const itor& it) : m_ptr(it.m_ptr) { }
const_reverse_iterator(const reverse_iterator& it) : m_ptr(it.m_ptr) { }
reference operator*() const { return *m_ptr; }
pointer operator->() const { return m_ptr; }
itor& operator++() { --m_ptr; return *this; }
const itor operator++(int)
{ const itor tmp = *this; --m_ptr; return tmp; }
itor& operator--() { ++m_ptr; return *this; }
const itor operator--(int) { const itor tmp = *this; ++m_ptr; return tmp; }
bool operator ==(const itor& it) const { return m_ptr == it.m_ptr; }
bool operator !=(const itor& it) const { return m_ptr != it.m_ptr; }
};
wxArrayString(const_iterator first, const_iterator last)
{ Init(false); assign(first, last); }
wxArrayString(size_type n, const_reference v) { Init(false); assign(n, v); }
template <class Iterator>
void assign(Iterator first, Iterator last)
{
clear();
reserve(std::distance(first, last));
for(; first != last; ++first)
push_back(*first);
}
void assign(size_type n, const_reference v)
{ clear(); Add(v, n); }
reference back() { return *(end() - 1); }
const_reference back() const { return *(end() - 1); }
iterator begin() { return m_pItems; }
const_iterator begin() const { return m_pItems; }
size_type capacity() const { return m_nSize; }
void clear() { Clear(); }
bool empty() const { return IsEmpty(); }
iterator end() { return begin() + GetCount(); }
const_iterator end() const { return begin() + GetCount(); }
iterator erase(iterator first, iterator last)
{
size_t idx = first - begin();
RemoveAt(idx, last - first);
return begin() + idx;
}
iterator erase(iterator it) { return erase(it, it + 1); }
reference front() { return *begin(); }
const_reference front() const { return *begin(); }
void insert(iterator it, size_type n, const_reference v)
{ Insert(v, it - begin(), n); }
iterator insert(iterator it, const_reference v = value_type())
{ size_t idx = it - begin(); Insert(v, idx); return begin() + idx; }
void insert(iterator it, const_iterator first, const_iterator last);
size_type max_size() const { return INT_MAX; }
void pop_back() { RemoveAt(GetCount() - 1); }
void push_back(const_reference v) { Add(v); }
reverse_iterator rbegin() { return reverse_iterator(end() - 1); }
const_reverse_iterator rbegin() const
{ return const_reverse_iterator(end() - 1); }
reverse_iterator rend() { return reverse_iterator(begin() - 1); }
const_reverse_iterator rend() const
{ return const_reverse_iterator(begin() - 1); }
void reserve(size_type n) /* base::reserve*/;
void resize(size_type n, value_type v = value_type());
size_type size() const { return GetCount(); }
void swap(wxArrayString& other)
{
wxSwap(m_nSize, other.m_nSize);
wxSwap(m_nCount, other.m_nCount);
wxSwap(m_pItems, other.m_pItems);
wxSwap(m_autoSort, other.m_autoSort);
}
protected:
void Init(bool autoSort); // common part of all ctors
void Copy(const wxArrayString& src); // copies the contents of another array
CompareFunction m_compareFunction; // set only from wxSortedArrayString
private:
// Allocate the new buffer big enough to hold m_nCount + nIncrement items and
// return the pointer to the old buffer, which must be deleted by the caller
// (if the old buffer is big enough, just return NULL).
wxString *Grow(size_t nIncrement);
size_t m_nSize, // current size of the array
m_nCount; // current number of elements
wxString *m_pItems; // pointer to data
bool m_autoSort; // if true, keep the array always sorted
};
class WXDLLIMPEXP_BASE wxSortedArrayString : public wxArrayString
{
public:
wxSortedArrayString() : wxArrayString(true)
{ }
wxSortedArrayString(const wxArrayString& array) : wxArrayString(true)
{ Copy(array); }
explicit wxSortedArrayString(CompareFunction compareFunction)
: wxArrayString(true)
{ m_compareFunction = compareFunction; }
};
#endif // !wxUSE_STD_CONTAINERS
// this class provides a temporary wxString* from a
// wxArrayString
class WXDLLIMPEXP_BASE wxCArrayString
{
public:
wxCArrayString( const wxArrayString& array )
: m_array( array ), m_strings( NULL )
{ }
~wxCArrayString() { delete[] m_strings; }
size_t GetCount() const { return m_array.GetCount(); }
wxString* GetStrings()
{
if( m_strings ) return m_strings;
const size_t count = m_array.GetCount();
m_strings = new wxString[count];
for( size_t i = 0; i < count; ++i )
m_strings[i] = m_array[i];
return m_strings;
}
wxString* Release()
{
wxString *r = GetStrings();
m_strings = NULL;
return r;
}
private:
const wxArrayString& m_array;
wxString* m_strings;
};
// ----------------------------------------------------------------------------
// helper functions for working with arrays
// ----------------------------------------------------------------------------
// by default, these functions use the escape character to escape the
// separators occurring inside the string to be joined, this can be disabled by
// passing '\0' as escape
WXDLLIMPEXP_BASE wxString wxJoin(const wxArrayString& arr,
const wxChar sep,
const wxChar escape = wxT('\\'));
WXDLLIMPEXP_BASE wxArrayString wxSplit(const wxString& str,
const wxChar sep,
const wxChar escape = wxT('\\'));
// ----------------------------------------------------------------------------
// This helper class allows to pass both C array of wxStrings or wxArrayString
// using the same interface.
//
// Use it when you have two methods taking wxArrayString or (int, wxString[]),
// that do the same thing. This class lets you iterate over input data in the
// same way whether it is a raw array of strings or wxArrayString.
//
// The object does not take ownership of the data -- internally it keeps
// pointers to the data, therefore the data must be disposed of by user
// and only after this object is destroyed. Usually it is not a problem as
// only temporary objects of this class are used.
// ----------------------------------------------------------------------------
class wxArrayStringsAdapter
{
public:
// construct an adapter from a wxArrayString
wxArrayStringsAdapter(const wxArrayString& strings)
: m_type(wxSTRING_ARRAY), m_size(strings.size())
{
m_data.array = &strings;
}
// construct an adapter from a wxString[]
wxArrayStringsAdapter(unsigned int n, const wxString *strings)
: m_type(wxSTRING_POINTER), m_size(n)
{
m_data.ptr = strings;
}
#if wxUSE_STD_CONTAINERS_COMPATIBLY
// construct an adapter from a vector of strings
wxArrayStringsAdapter(const std::vector<wxString>& strings)
: m_type(wxSTRING_POINTER), m_size(strings.size())
{
m_data.ptr = m_size == 0 ? NULL : &strings[0];
}
#endif // wxUSE_STD_CONTAINERS_COMPATIBLY
// construct an adapter from a single wxString
wxArrayStringsAdapter(const wxString& s)
: m_type(wxSTRING_POINTER), m_size(1)
{
m_data.ptr = &s;
}
// default copy constructor is ok
// iteration interface
size_t GetCount() const { return m_size; }
bool IsEmpty() const { return GetCount() == 0; }
const wxString& operator[] (unsigned int i) const
{
wxASSERT_MSG( i < GetCount(), wxT("index out of bounds") );
if(m_type == wxSTRING_POINTER)
return m_data.ptr[i];
return m_data.array->Item(i);
}
wxArrayString AsArrayString() const
{
if(m_type == wxSTRING_ARRAY)
return *m_data.array;
return wxArrayString(GetCount(), m_data.ptr);
}
private:
// type of the data being held
enum wxStringContainerType
{
wxSTRING_ARRAY, // wxArrayString
wxSTRING_POINTER // wxString[]
};
wxStringContainerType m_type;
size_t m_size;
union
{
const wxString * ptr;
const wxArrayString * array;
} m_data;
wxDECLARE_NO_ASSIGN_CLASS(wxArrayStringsAdapter);
};
#endif // _WX_ARRSTR_H
| h |
rticonnextdds-usecases | data/projects/rticonnextdds-usecases/VehicleTracking/ExampleCode/thirdparty/wxWidgets-3.1.2/Linux/include/wx/htmllbox.h | ///////////////////////////////////////////////////////////////////////////////
// Name: wx/htmllbox.h
// Purpose: wxHtmlListBox is a listbox whose items are wxHtmlCells
// Author: Vadim Zeitlin
// Modified by:
// Created: 31.05.03
// Copyright: (c) 2003 Vadim Zeitlin <[email protected]>
// Licence: wxWindows licence
///////////////////////////////////////////////////////////////////////////////
#ifndef _WX_HTMLLBOX_H_
#define _WX_HTMLLBOX_H_
#include "wx/vlbox.h" // base class
#include "wx/html/htmlwin.h"
#include "wx/ctrlsub.h"
#if wxUSE_FILESYSTEM
#include "wx/filesys.h"
#endif // wxUSE_FILESYSTEM
class WXDLLIMPEXP_FWD_HTML wxHtmlCell;
class WXDLLIMPEXP_FWD_HTML wxHtmlWinParser;
class WXDLLIMPEXP_FWD_HTML wxHtmlListBoxCache;
class WXDLLIMPEXP_FWD_HTML wxHtmlListBoxStyle;
extern WXDLLIMPEXP_DATA_HTML(const char) wxHtmlListBoxNameStr[];
extern WXDLLIMPEXP_DATA_HTML(const char) wxSimpleHtmlListBoxNameStr[];
// ----------------------------------------------------------------------------
// wxHtmlListBox
// ----------------------------------------------------------------------------
class WXDLLIMPEXP_HTML wxHtmlListBox : public wxVListBox,
public wxHtmlWindowInterface,
public wxHtmlWindowMouseHelper
{
wxDECLARE_ABSTRACT_CLASS(wxHtmlListBox);
public:
// constructors and such
// ---------------------
// default constructor, you must call Create() later
wxHtmlListBox();
// normal constructor which calls Create() internally
wxHtmlListBox(wxWindow *parent,
wxWindowID id = wxID_ANY,
const wxPoint& pos = wxDefaultPosition,
const wxSize& size = wxDefaultSize,
long style = 0,
const wxString& name = wxHtmlListBoxNameStr);
// really creates the control and sets the initial number of items in it
// (which may be changed later with SetItemCount())
//
// the only special style which may be specified here is wxLB_MULTIPLE
//
// returns true on success or false if the control couldn't be created
bool Create(wxWindow *parent,
wxWindowID id = wxID_ANY,
const wxPoint& pos = wxDefaultPosition,
const wxSize& size = wxDefaultSize,
long style = 0,
const wxString& name = wxHtmlListBoxNameStr);
// destructor cleans up whatever resources we use
virtual ~wxHtmlListBox();
// override some base class virtuals
virtual void RefreshRow(size_t line) wxOVERRIDE;
virtual void RefreshRows(size_t from, size_t to) wxOVERRIDE;
virtual void RefreshAll() wxOVERRIDE;
virtual void SetItemCount(size_t count) wxOVERRIDE;
#if wxUSE_FILESYSTEM
// retrieve the file system used by the wxHtmlWinParser: if you use
// relative paths in your HTML, you should use its ChangePathTo() method
wxFileSystem& GetFileSystem() { return m_filesystem; }
const wxFileSystem& GetFileSystem() const { return m_filesystem; }
#endif // wxUSE_FILESYSTEM
virtual void OnInternalIdle() wxOVERRIDE;
protected:
// this method must be implemented in the derived class and should return
// the body (i.e. without <html>) of the HTML for the given item
virtual wxString OnGetItem(size_t n) const = 0;
// this function may be overridden to decorate HTML returned by OnGetItem()
virtual wxString OnGetItemMarkup(size_t n) const;
// this method allows to customize the selection appearance: it may be used
// to specify the colour of the text which normally has the given colour
// colFg when it is inside the selection
//
// by default, the original colour is not used at all and all text has the
// same (default for this system) colour inside selection
virtual wxColour GetSelectedTextColour(const wxColour& colFg) const;
// this is the same as GetSelectedTextColour() but allows to customize the
// background colour -- this is even more rarely used as you can change it
// globally using SetSelectionBackground()
virtual wxColour GetSelectedTextBgColour(const wxColour& colBg) const;
// we implement both of these functions in terms of OnGetItem(), they are
// not supposed to be overridden by our descendants
virtual void OnDrawItem(wxDC& dc, const wxRect& rect, size_t n) const wxOVERRIDE;
virtual wxCoord OnMeasureItem(size_t n) const wxOVERRIDE;
// override this one to draw custom background for selected items correctly
virtual void OnDrawBackground(wxDC& dc, const wxRect& rect, size_t n) const wxOVERRIDE;
// this method may be overridden to handle clicking on a link in the
// listbox (by default, clicks on links are simply ignored)
virtual void OnLinkClicked(size_t n, const wxHtmlLinkInfo& link);
// event handlers
void OnSize(wxSizeEvent& event);
void OnMouseMove(wxMouseEvent& event);
void OnLeftDown(wxMouseEvent& event);
// common part of all ctors
void Init();
// ensure that the given item is cached
void CacheItem(size_t n) const;
private:
// wxHtmlWindowInterface methods:
virtual void SetHTMLWindowTitle(const wxString& title) wxOVERRIDE;
virtual void OnHTMLLinkClicked(const wxHtmlLinkInfo& link) wxOVERRIDE;
virtual wxHtmlOpeningStatus OnHTMLOpeningURL(wxHtmlURLType type,
const wxString& url,
wxString *redirect) const wxOVERRIDE;
virtual wxPoint HTMLCoordsToWindow(wxHtmlCell *cell,
const wxPoint& pos) const wxOVERRIDE;
virtual wxWindow* GetHTMLWindow() wxOVERRIDE;
virtual wxColour GetHTMLBackgroundColour() const wxOVERRIDE;
virtual void SetHTMLBackgroundColour(const wxColour& clr) wxOVERRIDE;
virtual void SetHTMLBackgroundImage(const wxBitmap& bmpBg) wxOVERRIDE;
virtual void SetHTMLStatusText(const wxString& text) wxOVERRIDE;
virtual wxCursor GetHTMLCursor(HTMLCursor type) const wxOVERRIDE;
// returns index of item that contains given HTML cell
size_t GetItemForCell(const wxHtmlCell *cell) const;
// Create the cell for the given item, caller is responsible for freeing it.
wxHtmlCell* CreateCellForItem(size_t n) const;
// return physical coordinates of root wxHtmlCell of n-th item
wxPoint GetRootCellCoords(size_t n) const;
// Converts physical coordinates stored in @a pos into coordinates
// relative to the root cell of the item under mouse cursor, if any. If no
// cell is found under the cursor, returns false. Otherwise stores the new
// coordinates back into @a pos and pointer to the cell under cursor into
// @a cell and returns true.
bool PhysicalCoordsToCell(wxPoint& pos, wxHtmlCell*& cell) const;
// The opposite of PhysicalCoordsToCell: converts coordinates relative to
// given cell to physical coordinates in the window
wxPoint CellCoordsToPhysical(const wxPoint& pos, wxHtmlCell *cell) const;
private:
// this class caches the pre-parsed HTML to speed up display
wxHtmlListBoxCache *m_cache;
// HTML parser we use
wxHtmlWinParser *m_htmlParser;
#if wxUSE_FILESYSTEM
// file system used by m_htmlParser
wxFileSystem m_filesystem;
#endif // wxUSE_FILESYSTEM
// rendering style for the parser which allows us to customize our colours
wxHtmlListBoxStyle *m_htmlRendStyle;
// it calls our GetSelectedTextColour() and GetSelectedTextBgColour()
friend class wxHtmlListBoxStyle;
friend class wxHtmlListBoxWinInterface;
wxDECLARE_EVENT_TABLE();
wxDECLARE_NO_COPY_CLASS(wxHtmlListBox);
};
// ----------------------------------------------------------------------------
// wxSimpleHtmlListBox
// ----------------------------------------------------------------------------
#define wxHLB_DEFAULT_STYLE wxBORDER_SUNKEN
#define wxHLB_MULTIPLE wxLB_MULTIPLE
class WXDLLIMPEXP_HTML wxSimpleHtmlListBox :
public wxWindowWithItems<wxHtmlListBox, wxItemContainer>
{
wxDECLARE_ABSTRACT_CLASS(wxSimpleHtmlListBox);
public:
// wxListbox-compatible constructors
// ---------------------------------
wxSimpleHtmlListBox() { }
wxSimpleHtmlListBox(wxWindow *parent,
wxWindowID id,
const wxPoint& pos = wxDefaultPosition,
const wxSize& size = wxDefaultSize,
int n = 0, const wxString choices[] = NULL,
long style = wxHLB_DEFAULT_STYLE,
const wxValidator& validator = wxDefaultValidator,
const wxString& name = wxSimpleHtmlListBoxNameStr)
{
Create(parent, id, pos, size, n, choices, style, validator, name);
}
wxSimpleHtmlListBox(wxWindow *parent,
wxWindowID id,
const wxPoint& pos,
const wxSize& size,
const wxArrayString& choices,
long style = wxHLB_DEFAULT_STYLE,
const wxValidator& validator = wxDefaultValidator,
const wxString& name = wxSimpleHtmlListBoxNameStr)
{
Create(parent, id, pos, size, choices, style, validator, name);
}
bool Create(wxWindow *parent, wxWindowID id,
const wxPoint& pos = wxDefaultPosition,
const wxSize& size = wxDefaultSize,
int n = 0, const wxString choices[] = NULL,
long style = wxHLB_DEFAULT_STYLE,
const wxValidator& validator = wxDefaultValidator,
const wxString& name = wxSimpleHtmlListBoxNameStr);
bool Create(wxWindow *parent, wxWindowID id,
const wxPoint& pos,
const wxSize& size,
const wxArrayString& choices,
long style = wxHLB_DEFAULT_STYLE,
const wxValidator& validator = wxDefaultValidator,
const wxString& name = wxSimpleHtmlListBoxNameStr);
virtual ~wxSimpleHtmlListBox();
// these must be overloaded otherwise the compiler will complain
// about wxItemContainerImmutable::[G|S]etSelection being pure virtuals...
void SetSelection(int n) wxOVERRIDE
{ wxVListBox::SetSelection(n); }
int GetSelection() const wxOVERRIDE
{ return wxVListBox::GetSelection(); }
// accessing strings
// -----------------
virtual unsigned int GetCount() const wxOVERRIDE
{ return m_items.GetCount(); }
virtual wxString GetString(unsigned int n) const wxOVERRIDE;
// override default unoptimized wxItemContainer::GetStrings() function
wxArrayString GetStrings() const
{ return m_items; }
virtual void SetString(unsigned int n, const wxString& s) wxOVERRIDE;
// resolve ambiguity between wxItemContainer and wxVListBox versions
void Clear() wxOVERRIDE;
protected:
virtual int DoInsertItems(const wxArrayStringsAdapter & items,
unsigned int pos,
void **clientData, wxClientDataType type) wxOVERRIDE;
virtual void DoSetItemClientData(unsigned int n, void *clientData) wxOVERRIDE
{ m_HTMLclientData[n] = clientData; }
virtual void *DoGetItemClientData(unsigned int n) const wxOVERRIDE
{ return m_HTMLclientData[n]; }
// wxItemContainer methods
virtual void DoClear() wxOVERRIDE;
virtual void DoDeleteOneItem(unsigned int n) wxOVERRIDE;
// calls wxHtmlListBox::SetItemCount() and RefreshAll()
void UpdateCount();
// override these functions just to change their visibility: users of
// wxSimpleHtmlListBox shouldn't be allowed to call them directly!
virtual void SetItemCount(size_t count) wxOVERRIDE
{ wxHtmlListBox::SetItemCount(count); }
virtual void SetRowCount(size_t count)
{ wxHtmlListBox::SetRowCount(count); }
virtual wxString OnGetItem(size_t n) const wxOVERRIDE
{ return m_items[n]; }
virtual void InitEvent(wxCommandEvent& event, int n) wxOVERRIDE
{
// we're not a virtual control and we can include the string
// of the item which was clicked:
event.SetString(m_items[n]);
wxVListBox::InitEvent(event, n);
}
wxArrayString m_items;
wxArrayPtrVoid m_HTMLclientData;
// Note: For the benefit of old compilers (like gcc-2.8) this should
// not be named m_clientdata as that clashes with the name of an
// anonymous struct member in wxEvtHandler, which we derive from.
wxDECLARE_NO_COPY_CLASS(wxSimpleHtmlListBox);
};
#endif // _WX_HTMLLBOX_H_
| h |
rticonnextdds-usecases | data/projects/rticonnextdds-usecases/VehicleTracking/ExampleCode/thirdparty/wxWidgets-3.1.2/Linux/include/wx/datstrm.h | /////////////////////////////////////////////////////////////////////////////
// Name: wx/datstrm.h
// Purpose: Data stream classes
// Author: Guilhem Lavaux
// Modified by: Mickael Gilabert
// Created: 28/06/1998
// Copyright: (c) Guilhem Lavaux
// Licence: wxWindows licence
/////////////////////////////////////////////////////////////////////////////
#ifndef _WX_DATSTREAM_H_
#define _WX_DATSTREAM_H_
#include "wx/stream.h"
#include "wx/longlong.h"
#include "wx/convauto.h"
#if wxUSE_STREAMS
// Common wxDataInputStream and wxDataOutputStream parameters.
class WXDLLIMPEXP_BASE wxDataStreamBase
{
public:
void BigEndianOrdered(bool be_order) { m_be_order = be_order; }
// By default we use extended precision (80 bit) format for both float and
// doubles. Call this function to switch to alternative representation in
// which IEEE 754 single precision (32 bits) is used for floats and double
// precision (64 bits) is used for doubles.
void UseBasicPrecisions()
{
#if wxUSE_APPLE_IEEE
m_useExtendedPrecision = false;
#endif // wxUSE_APPLE_IEEE
}
// UseExtendedPrecision() is not very useful as it corresponds to the
// default value, only call it in your code if you want the compilation
// fail with the error when using wxWidgets library compiled without
// extended precision support.
#if wxUSE_APPLE_IEEE
void UseExtendedPrecision()
{
m_useExtendedPrecision = true;
}
#endif // wxUSE_APPLE_IEEE
#if wxUSE_UNICODE
void SetConv( const wxMBConv &conv );
wxMBConv *GetConv() const { return m_conv; }
#endif
protected:
// Ctor and dtor are both protected, this class is never used directly but
// only by its derived classes.
wxDataStreamBase(const wxMBConv& conv);
~wxDataStreamBase();
bool m_be_order;
#if wxUSE_APPLE_IEEE
bool m_useExtendedPrecision;
#endif // wxUSE_APPLE_IEEE
#if wxUSE_UNICODE
wxMBConv *m_conv;
#endif
wxDECLARE_NO_COPY_CLASS(wxDataStreamBase);
};
class WXDLLIMPEXP_BASE wxDataInputStream : public wxDataStreamBase
{
public:
wxDataInputStream(wxInputStream& s, const wxMBConv& conv = wxConvUTF8);
bool IsOk() { return m_input->IsOk(); }
#if wxHAS_INT64
wxUint64 Read64();
#endif
#if wxUSE_LONGLONG
wxLongLong ReadLL();
#endif
wxUint32 Read32();
wxUint16 Read16();
wxUint8 Read8();
double ReadDouble();
float ReadFloat();
wxString ReadString();
#if wxHAS_INT64
void Read64(wxUint64 *buffer, size_t size);
void Read64(wxInt64 *buffer, size_t size);
#endif
#if defined(wxLongLong_t) && wxUSE_LONGLONG
void Read64(wxULongLong *buffer, size_t size);
void Read64(wxLongLong *buffer, size_t size);
#endif
#if wxUSE_LONGLONG
void ReadLL(wxULongLong *buffer, size_t size);
void ReadLL(wxLongLong *buffer, size_t size);
#endif
void Read32(wxUint32 *buffer, size_t size);
void Read16(wxUint16 *buffer, size_t size);
void Read8(wxUint8 *buffer, size_t size);
void ReadDouble(double *buffer, size_t size);
void ReadFloat(float *buffer, size_t size);
wxDataInputStream& operator>>(wxString& s);
wxDataInputStream& operator>>(wxInt8& c);
wxDataInputStream& operator>>(wxInt16& i);
wxDataInputStream& operator>>(wxInt32& i);
wxDataInputStream& operator>>(wxUint8& c);
wxDataInputStream& operator>>(wxUint16& i);
wxDataInputStream& operator>>(wxUint32& i);
#if wxHAS_INT64
wxDataInputStream& operator>>(wxUint64& i);
wxDataInputStream& operator>>(wxInt64& i);
#endif
#if defined(wxLongLong_t) && wxUSE_LONGLONG
wxDataInputStream& operator>>(wxULongLong& i);
wxDataInputStream& operator>>(wxLongLong& i);
#endif
wxDataInputStream& operator>>(double& d);
wxDataInputStream& operator>>(float& f);
protected:
wxInputStream *m_input;
wxDECLARE_NO_COPY_CLASS(wxDataInputStream);
};
class WXDLLIMPEXP_BASE wxDataOutputStream : public wxDataStreamBase
{
public:
wxDataOutputStream(wxOutputStream& s, const wxMBConv& conv = wxConvUTF8);
bool IsOk() { return m_output->IsOk(); }
#if wxHAS_INT64
void Write64(wxUint64 i);
void Write64(wxInt64 i);
#endif
#if wxUSE_LONGLONG
void WriteLL(const wxLongLong &ll);
void WriteLL(const wxULongLong &ll);
#endif
void Write32(wxUint32 i);
void Write16(wxUint16 i);
void Write8(wxUint8 i);
void WriteDouble(double d);
void WriteFloat(float f);
void WriteString(const wxString& string);
#if wxHAS_INT64
void Write64(const wxUint64 *buffer, size_t size);
void Write64(const wxInt64 *buffer, size_t size);
#endif
#if defined(wxLongLong_t) && wxUSE_LONGLONG
void Write64(const wxULongLong *buffer, size_t size);
void Write64(const wxLongLong *buffer, size_t size);
#endif
#if wxUSE_LONGLONG
void WriteLL(const wxULongLong *buffer, size_t size);
void WriteLL(const wxLongLong *buffer, size_t size);
#endif
void Write32(const wxUint32 *buffer, size_t size);
void Write16(const wxUint16 *buffer, size_t size);
void Write8(const wxUint8 *buffer, size_t size);
void WriteDouble(const double *buffer, size_t size);
void WriteFloat(const float *buffer, size_t size);
wxDataOutputStream& operator<<(const wxString& string);
wxDataOutputStream& operator<<(wxInt8 c);
wxDataOutputStream& operator<<(wxInt16 i);
wxDataOutputStream& operator<<(wxInt32 i);
wxDataOutputStream& operator<<(wxUint8 c);
wxDataOutputStream& operator<<(wxUint16 i);
wxDataOutputStream& operator<<(wxUint32 i);
#if wxHAS_INT64
wxDataOutputStream& operator<<(wxUint64 i);
wxDataOutputStream& operator<<(wxInt64 i);
#endif
#if defined(wxLongLong_t) && wxUSE_LONGLONG
wxDataOutputStream& operator<<(const wxULongLong &i);
wxDataOutputStream& operator<<(const wxLongLong &i);
#endif
wxDataOutputStream& operator<<(double d);
wxDataOutputStream& operator<<(float f);
protected:
wxOutputStream *m_output;
wxDECLARE_NO_COPY_CLASS(wxDataOutputStream);
};
#endif
// wxUSE_STREAMS
#endif
// _WX_DATSTREAM_H_
| h |
rticonnextdds-usecases | data/projects/rticonnextdds-usecases/VehicleTracking/ExampleCode/thirdparty/wxWidgets-3.1.2/Linux/include/wx/clrpicker.h | /////////////////////////////////////////////////////////////////////////////
// Name: wx/clrpicker.h
// Purpose: wxColourPickerCtrl base header
// Author: Francesco Montorsi (based on Vadim Zeitlin's code)
// Modified by:
// Created: 14/4/2006
// Copyright: (c) Vadim Zeitlin, Francesco Montorsi
// Licence: wxWindows Licence
/////////////////////////////////////////////////////////////////////////////
#ifndef _WX_CLRPICKER_H_BASE_
#define _WX_CLRPICKER_H_BASE_
#include "wx/defs.h"
#if wxUSE_COLOURPICKERCTRL
#include "wx/pickerbase.h"
class WXDLLIMPEXP_FWD_CORE wxColourPickerEvent;
extern WXDLLIMPEXP_DATA_CORE(const char) wxColourPickerWidgetNameStr[];
extern WXDLLIMPEXP_DATA_CORE(const char) wxColourPickerCtrlNameStr[];
// show the colour in HTML form (#AABBCC) as colour button label
#define wxCLRBTN_SHOW_LABEL 100
// the default style
#define wxCLRBTN_DEFAULT_STYLE (wxCLRBTN_SHOW_LABEL)
// ----------------------------------------------------------------------------
// wxColourPickerWidgetBase: a generic abstract interface which must be
// implemented by controls used by wxColourPickerCtrl
// ----------------------------------------------------------------------------
class WXDLLIMPEXP_CORE wxColourPickerWidgetBase
{
public:
wxColourPickerWidgetBase() { m_colour = *wxBLACK; }
virtual ~wxColourPickerWidgetBase() {}
wxColour GetColour() const
{ return m_colour; }
virtual void SetColour(const wxColour &col)
{ m_colour = col; UpdateColour(); }
virtual void SetColour(const wxString &col)
{ m_colour.Set(col); UpdateColour(); }
protected:
virtual void UpdateColour() = 0;
// the current colour (may be invalid if none)
wxColour m_colour;
};
// Styles which must be supported by all controls implementing wxColourPickerWidgetBase
// NB: these styles must be defined to carefully-chosen values to
// avoid conflicts with wxButton's styles
// show the colour in HTML form (#AABBCC) as colour button label
// (instead of no label at all)
// NOTE: this style is supported just by wxColourButtonGeneric and
// thus is not exposed in wxColourPickerCtrl
#define wxCLRP_SHOW_LABEL 0x0008
#define wxCLRP_SHOW_ALPHA 0x0010
// map platform-dependent controls which implement the wxColourPickerWidgetBase
// under the name "wxColourPickerWidget".
// NOTE: wxColourPickerCtrl allocates a wxColourPickerWidget and relies on the
// fact that all classes being mapped as wxColourPickerWidget have the
// same prototype for their contructor (and also explains why we use
// define instead of a typedef)
// since GTK > 2.4, there is GtkColorButton
#if defined(__WXGTK20__) && !defined(__WXUNIVERSAL__)
#include "wx/gtk/clrpicker.h"
#define wxColourPickerWidget wxColourButton
#elif defined(__WXQT__) && !defined(__WXUNIVERSAL__)
#include "wx/qt/clrpicker.h"
#else
#include "wx/generic/clrpickerg.h"
#define wxColourPickerWidget wxGenericColourButton
#endif
// ----------------------------------------------------------------------------
// wxColourPickerCtrl: platform-independent class which embeds a
// platform-dependent wxColourPickerWidget and, if wxCLRP_USE_TEXTCTRL style is
// used, a textctrl next to it.
// ----------------------------------------------------------------------------
#define wxCLRP_USE_TEXTCTRL (wxPB_USE_TEXTCTRL)
#define wxCLRP_DEFAULT_STYLE 0
class WXDLLIMPEXP_CORE wxColourPickerCtrl : public wxPickerBase
{
public:
wxColourPickerCtrl() {}
virtual ~wxColourPickerCtrl() {}
wxColourPickerCtrl(wxWindow *parent, wxWindowID id,
const wxColour& col = *wxBLACK, const wxPoint& pos = wxDefaultPosition,
const wxSize& size = wxDefaultSize, long style = wxCLRP_DEFAULT_STYLE,
const wxValidator& validator = wxDefaultValidator,
const wxString& name = wxColourPickerCtrlNameStr)
{ Create(parent, id, col, pos, size, style, validator, name); }
bool Create(wxWindow *parent, wxWindowID id,
const wxColour& col = *wxBLACK,
const wxPoint& pos = wxDefaultPosition,
const wxSize& size = wxDefaultSize,
long style = wxCLRP_DEFAULT_STYLE,
const wxValidator& validator = wxDefaultValidator,
const wxString& name = wxColourPickerCtrlNameStr);
public: // public API
// get the colour chosen
wxColour GetColour() const
{ return ((wxColourPickerWidget *)m_picker)->GetColour(); }
// set currently displayed color
void SetColour(const wxColour& col);
// set colour using RGB(r,g,b) syntax or considering given text as a colour name;
// returns true if the given text was successfully recognized.
bool SetColour(const wxString& text);
public: // internal functions
// update the button colour to match the text control contents
void UpdatePickerFromTextCtrl() wxOVERRIDE;
// update the text control to match the button's colour
void UpdateTextCtrlFromPicker() wxOVERRIDE;
// event handler for our picker
void OnColourChange(wxColourPickerEvent &);
protected:
virtual long GetPickerStyle(long style) const wxOVERRIDE
{ return (style & (wxCLRP_SHOW_LABEL | wxCLRP_SHOW_ALPHA)); }
private:
wxDECLARE_DYNAMIC_CLASS(wxColourPickerCtrl);
};
// ----------------------------------------------------------------------------
// wxColourPickerEvent: used by wxColourPickerCtrl only
// ----------------------------------------------------------------------------
wxDECLARE_EXPORTED_EVENT( WXDLLIMPEXP_CORE, wxEVT_COLOURPICKER_CHANGED, wxColourPickerEvent );
class WXDLLIMPEXP_CORE wxColourPickerEvent : public wxCommandEvent
{
public:
wxColourPickerEvent() {}
wxColourPickerEvent(wxObject *generator, int id, const wxColour &col)
: wxCommandEvent(wxEVT_COLOURPICKER_CHANGED, id),
m_colour(col)
{
SetEventObject(generator);
}
wxColour GetColour() const { return m_colour; }
void SetColour(const wxColour &c) { m_colour = c; }
// default copy ctor, assignment operator and dtor are ok
virtual wxEvent *Clone() const wxOVERRIDE { return new wxColourPickerEvent(*this); }
private:
wxColour m_colour;
wxDECLARE_DYNAMIC_CLASS_NO_ASSIGN(wxColourPickerEvent);
};
// ----------------------------------------------------------------------------
// event types and macros
// ----------------------------------------------------------------------------
typedef void (wxEvtHandler::*wxColourPickerEventFunction)(wxColourPickerEvent&);
#define wxColourPickerEventHandler(func) \
wxEVENT_HANDLER_CAST(wxColourPickerEventFunction, func)
#define EVT_COLOURPICKER_CHANGED(id, fn) \
wx__DECLARE_EVT1(wxEVT_COLOURPICKER_CHANGED, id, wxColourPickerEventHandler(fn))
// old wxEVT_COMMAND_* constant
#define wxEVT_COMMAND_COLOURPICKER_CHANGED wxEVT_COLOURPICKER_CHANGED
#endif // wxUSE_COLOURPICKERCTRL
#endif // _WX_CLRPICKER_H_BASE_
| h |
rticonnextdds-usecases | data/projects/rticonnextdds-usecases/VehicleTracking/ExampleCode/thirdparty/wxWidgets-3.1.2/Linux/include/wx/dialup.h | /////////////////////////////////////////////////////////////////////////////
// Name: wx/dialup.h
// Purpose: Network related wxWidgets classes and functions
// Author: Vadim Zeitlin
// Modified by:
// Created: 07.07.99
// Copyright: (c) Vadim Zeitlin
// Licence: wxWindows licence
/////////////////////////////////////////////////////////////////////////////
#ifndef _WX_DIALUP_H
#define _WX_DIALUP_H
#if wxUSE_DIALUP_MANAGER
#include "wx/event.h"
// ----------------------------------------------------------------------------
// misc
// ----------------------------------------------------------------------------
class WXDLLIMPEXP_FWD_BASE wxArrayString;
#define WXDIALUP_MANAGER_DEFAULT_BEACONHOST wxT("www.yahoo.com")
// ----------------------------------------------------------------------------
// A class which groups functions dealing with connecting to the network from a
// workstation using dial-up access to the net. There is at most one instance
// of this class in the program accessed via GetDialUpManager().
// ----------------------------------------------------------------------------
/* TODO
*
* 1. more configurability for Unix: i.e. how to initiate the connection, how
* to check for online status, &c.
* 2. a function to enumerate all connections (ISPs) and show a dialog in
* Dial() allowing to choose between them if no ISP given
* 3. add an async version of dialing functions which notify the caller about
* the progress (or may be even start another thread to monitor it)
* 4. the static creation/accessor functions are not MT-safe - but is this
* really crucial? I think we may suppose they're always called from the
* main thread?
*/
class WXDLLIMPEXP_CORE wxDialUpManager
{
public:
// this function should create and return the object of the
// platform-specific class derived from wxDialUpManager. It's implemented
// in the platform-specific source files.
static wxDialUpManager *Create();
// could the dialup manager be initialized correctly? If this function
// returns false, no other functions will work neither, so it's a good idea
// to call this function and check its result before calling any other
// wxDialUpManager methods
virtual bool IsOk() const = 0;
// virtual dtor for any base class
virtual ~wxDialUpManager() { }
// operations
// ----------
// fills the array with the names of all possible values for the first
// parameter to Dial() on this machine and returns their number (may be 0)
virtual size_t GetISPNames(wxArrayString& names) const = 0;
// dial the given ISP, use username and password to authentificate
//
// if no nameOfISP is given, the function will select the default one
//
// if no username/password are given, the function will try to do without
// them, but will ask the user if really needed
//
// if async parameter is false, the function waits until the end of dialing
// and returns true upon successful completion.
// if async is true, the function only initiates the connection and returns
// immediately - the result is reported via events (an event is sent
// anyhow, but if dialing failed it will be a DISCONNECTED one)
virtual bool Dial(const wxString& nameOfISP = wxEmptyString,
const wxString& username = wxEmptyString,
const wxString& password = wxEmptyString,
bool async = true) = 0;
// returns true if (async) dialing is in progress
virtual bool IsDialing() const = 0;
// cancel dialing the number initiated with Dial(async = true)
// NB: this won't result in DISCONNECTED event being sent
virtual bool CancelDialing() = 0;
// hang up the currently active dial up connection
virtual bool HangUp() = 0;
// online status
// -------------
// returns true if the computer has a permanent network connection (i.e. is
// on a LAN) and so there is no need to use Dial() function to go online
//
// NB: this functions tries to guess the result and it is not always
// guaranteed to be correct, so it's better to ask user for
// confirmation or give him a possibility to override it
virtual bool IsAlwaysOnline() const = 0;
// returns true if the computer is connected to the network: under Windows,
// this just means that a RAS connection exists, under Unix we check that
// the "well-known host" (as specified by SetWellKnownHost) is reachable
virtual bool IsOnline() const = 0;
// sometimes the built-in logic for determining the online status may fail,
// so, in general, the user should be allowed to override it. This function
// allows to forcefully set the online status - whatever our internal
// algorithm may think about it.
virtual void SetOnlineStatus(bool isOnline = true) = 0;
// set misc wxDialUpManager options
// --------------------------------
// enable automatical checks for the connection status and sending of
// wxEVT_DIALUP_CONNECTED/wxEVT_DIALUP_DISCONNECTED events. The interval
// parameter is only for Unix where we do the check manually: under
// Windows, the notification about the change of connection status is
// instantenous.
//
// Returns false if couldn't set up automatic check for online status.
virtual bool EnableAutoCheckOnlineStatus(size_t nSeconds = 60) = 0;
// disable automatic check for connection status change - notice that the
// wxEVT_DIALUP_XXX events won't be sent any more neither.
virtual void DisableAutoCheckOnlineStatus() = 0;
// additional Unix-only configuration
// ----------------------------------
// under Unix, the value of well-known host is used to check whether we're
// connected to the internet. It's unused under Windows, but this function
// is always safe to call. The default value is www.yahoo.com.
virtual void SetWellKnownHost(const wxString& hostname,
int portno = 80) = 0;
// Sets the commands to start up the network and to hang up again. Used by
// the Unix implementations only.
virtual void
SetConnectCommand(const wxString& commandDial = wxT("/usr/bin/pon"),
const wxString& commandHangup = wxT("/usr/bin/poff")) = 0;
};
// ----------------------------------------------------------------------------
// wxDialUpManager events
// ----------------------------------------------------------------------------
class WXDLLIMPEXP_FWD_CORE wxDialUpEvent;
wxDECLARE_EXPORTED_EVENT( WXDLLIMPEXP_CORE, wxEVT_DIALUP_CONNECTED, wxDialUpEvent );
wxDECLARE_EXPORTED_EVENT( WXDLLIMPEXP_CORE, wxEVT_DIALUP_DISCONNECTED, wxDialUpEvent );
// the event class for the dialup events
class WXDLLIMPEXP_CORE wxDialUpEvent : public wxEvent
{
public:
wxDialUpEvent(bool isConnected, bool isOwnEvent) : wxEvent(isOwnEvent)
{
SetEventType(isConnected ? wxEVT_DIALUP_CONNECTED
: wxEVT_DIALUP_DISCONNECTED);
}
// is this a CONNECTED or DISCONNECTED event?
bool IsConnectedEvent() const
{ return GetEventType() == wxEVT_DIALUP_CONNECTED; }
// does this event come from wxDialUpManager::Dial() or from some external
// process (i.e. does it result from our own attempt to establish the
// connection)?
bool IsOwnEvent() const { return m_id != 0; }
// implement the base class pure virtual
virtual wxEvent *Clone() const wxOVERRIDE { return new wxDialUpEvent(*this); }
private:
wxDECLARE_NO_ASSIGN_CLASS(wxDialUpEvent);
};
// the type of dialup event handler function
typedef void (wxEvtHandler::*wxDialUpEventFunction)(wxDialUpEvent&);
#define wxDialUpEventHandler(func) \
wxEVENT_HANDLER_CAST(wxDialUpEventFunction, func)
// macros to catch dialup events
#define EVT_DIALUP_CONNECTED(func) \
wx__DECLARE_EVT0(wxEVT_DIALUP_CONNECTED, wxDialUpEventHandler(func))
#define EVT_DIALUP_DISCONNECTED(func) \
wx__DECLARE_EVT0(wxEVT_DIALUP_DISCONNECTED, wxDialUpEventHandler(func))
#endif // wxUSE_DIALUP_MANAGER
#endif // _WX_DIALUP_H
| h |
rticonnextdds-usecases | data/projects/rticonnextdds-usecases/VehicleTracking/ExampleCode/thirdparty/wxWidgets-3.1.2/Linux/include/wx/dcbuffer.h | /////////////////////////////////////////////////////////////////////////////
// Name: wx/dcbuffer.h
// Purpose: wxBufferedDC class
// Author: Ron Lee <[email protected]>
// Modified by: Vadim Zeitlin (refactored, added bg preservation)
// Created: 16/03/02
// Copyright: (c) Ron Lee
// Licence: wxWindows licence
/////////////////////////////////////////////////////////////////////////////
#ifndef _WX_DCBUFFER_H_
#define _WX_DCBUFFER_H_
#include "wx/dcmemory.h"
#include "wx/dcclient.h"
#include "wx/window.h"
// Split platforms into two groups - those which have well-working
// double-buffering by default, and those which do not.
#if defined(__WXMAC__) || defined(__WXGTK20__) || defined(__WXDFB__) || defined(__WXQT__)
#define wxALWAYS_NATIVE_DOUBLE_BUFFER 1
#else
#define wxALWAYS_NATIVE_DOUBLE_BUFFER 0
#endif
// ----------------------------------------------------------------------------
// Double buffering helper.
// ----------------------------------------------------------------------------
// Assumes the buffer bitmap covers the entire scrolled window,
// and prepares the window DC accordingly
#define wxBUFFER_VIRTUAL_AREA 0x01
// Assumes the buffer bitmap only covers the client area;
// does not prepare the window DC
#define wxBUFFER_CLIENT_AREA 0x02
// Set when not using specific buffer bitmap. Note that this
// is private style and not returned by GetStyle.
#define wxBUFFER_USES_SHARED_BUFFER 0x04
class WXDLLIMPEXP_CORE wxBufferedDC : public wxMemoryDC
{
public:
// Default ctor, must subsequently call Init for two stage construction.
wxBufferedDC()
: m_dc(NULL),
m_buffer(NULL),
m_style(0)
{
}
// Construct a wxBufferedDC using a user supplied buffer.
wxBufferedDC(wxDC *dc,
wxBitmap& buffer = wxNullBitmap,
int style = wxBUFFER_CLIENT_AREA)
: m_dc(NULL), m_buffer(NULL)
{
Init(dc, buffer, style);
}
// Construct a wxBufferedDC with an internal buffer of 'area'
// (where area is usually something like the size of the window
// being buffered)
wxBufferedDC(wxDC *dc, const wxSize& area, int style = wxBUFFER_CLIENT_AREA)
: m_dc(NULL), m_buffer(NULL)
{
Init(dc, area, style);
}
// The usually desired action in the dtor is to blit the buffer.
virtual ~wxBufferedDC()
{
if ( m_dc )
UnMask();
}
// These reimplement the actions of the ctors for two stage creation
void Init(wxDC *dc,
wxBitmap& buffer = wxNullBitmap,
int style = wxBUFFER_CLIENT_AREA)
{
InitCommon(dc, style);
m_buffer = &buffer;
UseBuffer();
}
void Init(wxDC *dc, const wxSize &area, int style = wxBUFFER_CLIENT_AREA)
{
InitCommon(dc, style);
UseBuffer(area.x, area.y);
}
// Blits the buffer to the dc, and detaches the dc from the buffer (so it
// can be effectively used once only).
//
// Usually called in the dtor or by the dtor of derived classes if the
// BufferedDC must blit before the derived class (which may own the dc it's
// blitting to) is destroyed.
void UnMask();
// Set and get the style
void SetStyle(int style) { m_style = style; }
int GetStyle() const { return m_style & ~wxBUFFER_USES_SHARED_BUFFER; }
private:
// common part of Init()s
void InitCommon(wxDC *dc, int style)
{
wxASSERT_MSG( !m_dc, wxT("wxBufferedDC already initialised") );
m_dc = dc;
m_style = style;
}
// check that the bitmap is valid and use it
void UseBuffer(wxCoord w = -1, wxCoord h = -1);
// the underlying DC to which we copy everything drawn on this one in
// UnMask()
//
// NB: Without the existence of a wxNullDC, this must be a pointer, else it
// could probably be a reference.
wxDC *m_dc;
// the buffer (selected in this DC), initially invalid
wxBitmap *m_buffer;
// the buffering style
int m_style;
wxSize m_area;
wxDECLARE_DYNAMIC_CLASS(wxBufferedDC);
wxDECLARE_NO_COPY_CLASS(wxBufferedDC);
};
// ----------------------------------------------------------------------------
// Double buffered PaintDC.
// ----------------------------------------------------------------------------
// Creates a double buffered wxPaintDC, optionally allowing the
// user to specify their own buffer to use.
class WXDLLIMPEXP_CORE wxBufferedPaintDC : public wxBufferedDC
{
public:
// If no bitmap is supplied by the user, a temporary one will be created.
wxBufferedPaintDC(wxWindow *window, wxBitmap& buffer, int style = wxBUFFER_CLIENT_AREA)
: m_paintdc(window)
{
// If we're buffering the virtual window, scale the paint DC as well
if (style & wxBUFFER_VIRTUAL_AREA)
window->PrepareDC( m_paintdc );
if( buffer.IsOk() )
Init(&m_paintdc, buffer, style);
else
Init(&m_paintdc, GetBufferedSize(window, style), style);
}
// If no bitmap is supplied by the user, a temporary one will be created.
wxBufferedPaintDC(wxWindow *window, int style = wxBUFFER_CLIENT_AREA)
: m_paintdc(window)
{
// If we're using the virtual window, scale the paint DC as well
if (style & wxBUFFER_VIRTUAL_AREA)
window->PrepareDC( m_paintdc );
Init(&m_paintdc, GetBufferedSize(window, style), style);
}
// default copy ctor ok.
virtual ~wxBufferedPaintDC()
{
// We must UnMask here, else by the time the base class
// does it, the PaintDC will have already been destroyed.
UnMask();
}
protected:
// return the size needed by the buffer: this depends on whether we're
// buffering just the currently shown part or the total (scrolled) window
static wxSize GetBufferedSize(wxWindow *window, int style)
{
return style & wxBUFFER_VIRTUAL_AREA ? window->GetVirtualSize()
: window->GetClientSize();
}
private:
wxPaintDC m_paintdc;
wxDECLARE_ABSTRACT_CLASS(wxBufferedPaintDC);
wxDECLARE_NO_COPY_CLASS(wxBufferedPaintDC);
};
//
// wxAutoBufferedPaintDC is a wxPaintDC in toolkits which have double-
// buffering by default. Otherwise it is a wxBufferedPaintDC. Thus,
// you can only expect it work with a simple constructor that
// accepts single wxWindow* argument.
//
#if wxALWAYS_NATIVE_DOUBLE_BUFFER
#define wxAutoBufferedPaintDCBase wxPaintDC
#else
#define wxAutoBufferedPaintDCBase wxBufferedPaintDC
#endif
class WXDLLIMPEXP_CORE wxAutoBufferedPaintDC : public wxAutoBufferedPaintDCBase
{
public:
wxAutoBufferedPaintDC(wxWindow* win)
: wxAutoBufferedPaintDCBase(win)
{
wxASSERT_MSG( win->GetBackgroundStyle() == wxBG_STYLE_PAINT,
"You need to call SetBackgroundStyle(wxBG_STYLE_PAINT) in ctor, "
"and also, if needed, paint the background in wxEVT_PAINT handler."
);
}
virtual ~wxAutoBufferedPaintDC() { }
private:
wxDECLARE_NO_COPY_CLASS(wxAutoBufferedPaintDC);
};
// Check if the window is natively double buffered and will return a wxPaintDC
// if it is, a wxBufferedPaintDC otherwise. It is the caller's responsibility
// to delete the wxDC pointer when finished with it.
inline wxDC* wxAutoBufferedPaintDCFactory(wxWindow* window)
{
if ( window->IsDoubleBuffered() )
return new wxPaintDC(window);
else
return new wxBufferedPaintDC(window);
}
#endif // _WX_DCBUFFER_H_
| h |
rticonnextdds-usecases | data/projects/rticonnextdds-usecases/VehicleTracking/ExampleCode/thirdparty/wxWidgets-3.1.2/Linux/include/wx/uiaction.h | /////////////////////////////////////////////////////////////////////////////
// Name: wx/uiaction.h
// Purpose: wxUIActionSimulator interface
// Author: Kevin Ollivier, Steven Lamerton, Vadim Zeitlin
// Created: 2010-03-06
// Copyright: (c) 2010 Kevin Ollivier
// (c) 2010 Steven Lamerton
// (c) 2010-2016 Vadim Zeitlin
// Licence: wxWindows licence
/////////////////////////////////////////////////////////////////////////////
#ifndef _WX_UIACTIONSIMULATOR_H_
#define _WX_UIACTIONSIMULATOR_H_
#include "wx/defs.h"
#if wxUSE_UIACTIONSIMULATOR
#include "wx/mousestate.h" // for wxMOUSE_BTN_XXX constants
class WXDLLIMPEXP_CORE wxUIActionSimulator
{
public:
wxUIActionSimulator();
~wxUIActionSimulator();
// Mouse simulation
// ----------------
// Low level methods
bool MouseMove(long x, long y);
bool MouseMove(const wxPoint& point) { return MouseMove(point.x, point.y); }
bool MouseDown(int button = wxMOUSE_BTN_LEFT);
bool MouseUp(int button = wxMOUSE_BTN_LEFT);
// Higher level interface, use it if possible instead
bool MouseClick(int button = wxMOUSE_BTN_LEFT);
bool MouseDblClick(int button = wxMOUSE_BTN_LEFT);
bool MouseDragDrop(long x1, long y1, long x2, long y2,
int button = wxMOUSE_BTN_LEFT);
bool MouseDragDrop(const wxPoint& p1, const wxPoint& p2,
int button = wxMOUSE_BTN_LEFT)
{ return MouseDragDrop(p1.x, p1.y, p2.x, p2.y, button); }
// Keyboard simulation
// -------------------
// Low level methods for generating key presses and releases
bool KeyDown(int keycode, int modifiers = wxMOD_NONE)
{ return Key(keycode, modifiers, true); }
bool KeyUp(int keycode, int modifiers = wxMOD_NONE)
{ return Key(keycode, modifiers, false); }
// Higher level methods for generating both the key press and release for a
// single key or for all characters in the ASCII string "text" which can currently
// contain letters, digits and characters for the definition of numbers [+-., ].
bool Char(int keycode, int modifiers = wxMOD_NONE);
bool Text(const char *text);
// Select the item with the given text in the currently focused control.
bool Select(const wxString& text);
private:
// This is the common part of Key{Down,Up}() methods: while we keep them
// separate at public API level for consistency with Mouse{Down,Up}(), at
// implementation level it makes more sense to have them in a single
// function.
//
// It calls DoModifiers() to simulate pressing the modifier keys if
// necessary and then DoKey() for the key itself.
bool Key(int keycode, int modifiers, bool isDown);
// Call DoKey() for all modifier keys whose bits are set in the parameter.
void SimulateModifiers(int modifier, bool isDown);
// This pointer is allocated in the ctor and points to the
// platform-specific implementation.
class wxUIActionSimulatorImpl* const m_impl;
wxDECLARE_NO_COPY_CLASS(wxUIActionSimulator);
};
#endif // wxUSE_UIACTIONSIMULATOR
#endif // _WX_UIACTIONSIMULATOR_H_
| h |
rticonnextdds-usecases | data/projects/rticonnextdds-usecases/VehicleTracking/ExampleCode/thirdparty/wxWidgets-3.1.2/Linux/include/wx/socket.h | /////////////////////////////////////////////////////////////////////////////
// Name: wx/socket.h
// Purpose: Socket handling classes
// Authors: Guilhem Lavaux, Guillermo Rodriguez Garcia
// Modified by:
// Created: April 1997
// Copyright: (c) Guilhem Lavaux
// Licence: wxWindows licence
/////////////////////////////////////////////////////////////////////////////
#ifndef _WX_SOCKET_H_
#define _WX_SOCKET_H_
#include "wx/defs.h"
#if wxUSE_SOCKETS
// ---------------------------------------------------------------------------
// wxSocket headers
// ---------------------------------------------------------------------------
#include "wx/event.h"
#include "wx/sckaddr.h"
#include "wx/list.h"
class wxSocketImpl;
// ------------------------------------------------------------------------
// Types and constants
// ------------------------------------------------------------------------
// Define the type of native sockets.
#if defined(__WINDOWS__)
// Although socket descriptors are still 32 bit values, even under Win64,
// the socket type is 64 bit there.
typedef wxUIntPtr wxSOCKET_T;
#else
typedef int wxSOCKET_T;
#endif
// Types of different socket notifications or events.
//
// NB: the values here should be consecutive and start with 0 as they are
// used to construct the wxSOCKET_XXX_FLAG bit mask values below
enum wxSocketNotify
{
wxSOCKET_INPUT,
wxSOCKET_OUTPUT,
wxSOCKET_CONNECTION,
wxSOCKET_LOST
};
enum
{
wxSOCKET_INPUT_FLAG = 1 << wxSOCKET_INPUT,
wxSOCKET_OUTPUT_FLAG = 1 << wxSOCKET_OUTPUT,
wxSOCKET_CONNECTION_FLAG = 1 << wxSOCKET_CONNECTION,
wxSOCKET_LOST_FLAG = 1 << wxSOCKET_LOST
};
// this is a combination of the bit masks defined above
typedef int wxSocketEventFlags;
enum wxSocketError
{
wxSOCKET_NOERROR = 0,
wxSOCKET_INVOP,
wxSOCKET_IOERR,
wxSOCKET_INVADDR,
wxSOCKET_INVSOCK,
wxSOCKET_NOHOST,
wxSOCKET_INVPORT,
wxSOCKET_WOULDBLOCK,
wxSOCKET_TIMEDOUT,
wxSOCKET_MEMERR,
wxSOCKET_OPTERR
};
// socket options/flags bit masks
enum
{
wxSOCKET_NONE = 0x0000,
wxSOCKET_NOWAIT_READ = 0x0001,
wxSOCKET_NOWAIT_WRITE = 0x0002,
wxSOCKET_NOWAIT = wxSOCKET_NOWAIT_READ | wxSOCKET_NOWAIT_WRITE,
wxSOCKET_WAITALL_READ = 0x0004,
wxSOCKET_WAITALL_WRITE = 0x0008,
wxSOCKET_WAITALL = wxSOCKET_WAITALL_READ | wxSOCKET_WAITALL_WRITE,
wxSOCKET_BLOCK = 0x0010,
wxSOCKET_REUSEADDR = 0x0020,
wxSOCKET_BROADCAST = 0x0040,
wxSOCKET_NOBIND = 0x0080
};
typedef int wxSocketFlags;
// socket kind values (badly defined, don't use)
enum wxSocketType
{
wxSOCKET_UNINIT,
wxSOCKET_CLIENT,
wxSOCKET_SERVER,
wxSOCKET_BASE,
wxSOCKET_DATAGRAM
};
// event
class WXDLLIMPEXP_FWD_NET wxSocketEvent;
wxDECLARE_EXPORTED_EVENT(WXDLLIMPEXP_NET, wxEVT_SOCKET, wxSocketEvent);
// --------------------------------------------------------------------------
// wxSocketBase
// --------------------------------------------------------------------------
class WXDLLIMPEXP_NET wxSocketBase : public wxObject
{
public:
// Public interface
// ----------------
// ctors and dtors
wxSocketBase();
wxSocketBase(wxSocketFlags flags, wxSocketType type);
virtual ~wxSocketBase();
void Init();
bool Destroy();
// state
bool Ok() const { return IsOk(); }
bool IsOk() const { return m_impl != NULL; }
bool Error() const { return LastError() != wxSOCKET_NOERROR; }
bool IsClosed() const { return m_closed; }
bool IsConnected() const { return m_connected; }
bool IsData() { return WaitForRead(0, 0); }
bool IsDisconnected() const { return !IsConnected(); }
wxUint32 LastCount() const { return m_lcount; }
wxUint32 LastReadCount() const { return m_lcount_read; }
wxUint32 LastWriteCount() const { return m_lcount_write; }
wxSocketError LastError() const;
void SaveState();
void RestoreState();
// addresses
virtual bool GetLocal(wxSockAddress& addr_man) const;
virtual bool GetPeer(wxSockAddress& addr_man) const;
virtual bool SetLocal(const wxIPV4address& local);
// base IO
virtual bool Close();
void ShutdownOutput();
wxSocketBase& Discard();
wxSocketBase& Peek(void* buffer, wxUint32 nbytes);
wxSocketBase& Read(void* buffer, wxUint32 nbytes);
wxSocketBase& ReadMsg(void *buffer, wxUint32 nbytes);
wxSocketBase& Unread(const void *buffer, wxUint32 nbytes);
wxSocketBase& Write(const void *buffer, wxUint32 nbytes);
wxSocketBase& WriteMsg(const void *buffer, wxUint32 nbytes);
// all Wait() functions wait until their condition is satisfied or the
// timeout expires; if seconds == -1 (default) then m_timeout value is used
//
// it is also possible to call InterruptWait() to cancel any current Wait()
// wait for anything at all to happen with this socket
bool Wait(long seconds = -1, long milliseconds = 0);
// wait until we can read from or write to the socket without blocking
// (notice that this does not mean that the operation will succeed but only
// that it will return immediately)
bool WaitForRead(long seconds = -1, long milliseconds = 0);
bool WaitForWrite(long seconds = -1, long milliseconds = 0);
// wait until the connection is terminated
bool WaitForLost(long seconds = -1, long milliseconds = 0);
void InterruptWait() { m_interrupt = true; }
wxSocketFlags GetFlags() const { return m_flags; }
void SetFlags(wxSocketFlags flags);
virtual void SetTimeout(long seconds);
long GetTimeout() const { return m_timeout; }
bool GetOption(int level, int optname, void *optval, int *optlen);
bool SetOption(int level, int optname, const void *optval, int optlen);
wxUint32 GetLastIOSize() const { return m_lcount; }
wxUint32 GetLastIOReadSize() const { return m_lcount_read; }
wxUint32 GetLastIOWriteSize() const { return m_lcount_write; }
// event handling
void *GetClientData() const { return m_clientData; }
void SetClientData(void *data) { m_clientData = data; }
void SetEventHandler(wxEvtHandler& handler, int id = wxID_ANY);
void SetNotify(wxSocketEventFlags flags);
void Notify(bool notify);
// Get the underlying socket descriptor.
wxSOCKET_T GetSocket() const;
// initialize/shutdown the sockets (done automatically so there is no need
// to call these functions usually)
//
// should always be called from the main thread only so one of the cases
// where they should indeed be called explicitly is when the first wxSocket
// object in the application is created in a different thread
static bool Initialize();
static void Shutdown();
// check if wxSocket had been already initialized
//
// notice that this function should be only called from the main thread as
// otherwise it is inherently unsafe because Initialize/Shutdown() may be
// called concurrently with it in the main thread
static bool IsInitialized();
// Implementation from now on
// --------------------------
// do not use, should be private (called from wxSocketImpl only)
void OnRequest(wxSocketNotify notify);
// do not use, not documented nor supported
bool IsNoWait() const { return ((m_flags & wxSOCKET_NOWAIT) != 0); }
wxSocketType GetType() const { return m_type; }
// Helper returning wxSOCKET_NONE if non-blocking sockets can be used, i.e.
// the socket is being created in the main thread and the event loop is
// running, or wxSOCKET_BLOCK otherwise.
//
// This is an internal function used only by wxWidgets itself, user code
// should decide if it wants blocking sockets or not and use the
// appropriate style instead of using it (but wxWidgets has to do it like
// this for compatibility with the original network classes behaviour).
static int GetBlockingFlagIfNeeded();
private:
friend class wxSocketClient;
friend class wxSocketServer;
friend class wxDatagramSocket;
// low level IO
wxUint32 DoRead(void* buffer, wxUint32 nbytes);
wxUint32 DoWrite(const void *buffer, wxUint32 nbytes);
// wait until the given flags are set for this socket or the given timeout
// (or m_timeout) expires
//
// notice that wxSOCKET_LOST_FLAG is always taken into account and the
// function returns -1 if the connection was lost; otherwise it returns
// true if any of the events specified by flags argument happened or false
// if the timeout expired
int DoWait(long timeout, wxSocketEventFlags flags);
// a helper calling DoWait() using the same convention as the public
// WaitForXXX() functions use, i.e. use our timeout if seconds == -1 or the
// specified timeout otherwise
int DoWait(long seconds, long milliseconds, wxSocketEventFlags flags);
// another helper calling DoWait() using our m_timeout
int DoWaitWithTimeout(wxSocketEventFlags flags)
{
return DoWait(m_timeout*1000, flags);
}
// pushback buffer
void Pushback(const void *buffer, wxUint32 size);
wxUint32 GetPushback(void *buffer, wxUint32 size, bool peek);
// store the given error as the LastError()
void SetError(wxSocketError error);
private:
// socket
wxSocketImpl *m_impl; // port-specific implementation
wxSocketType m_type; // wxSocket type
// state
wxSocketFlags m_flags; // wxSocket flags
bool m_connected; // connected?
bool m_establishing; // establishing connection?
bool m_reading; // busy reading?
bool m_writing; // busy writing?
bool m_closed; // was the other end closed?
wxUint32 m_lcount; // last IO transaction size
wxUint32 m_lcount_read; // last IO transaction size of Read() direction.
wxUint32 m_lcount_write; // last IO transaction size of Write() direction.
unsigned long m_timeout; // IO timeout value in seconds
// (TODO: remove, wxSocketImpl has it too)
wxList m_states; // stack of states (TODO: remove!)
bool m_interrupt; // interrupt ongoing wait operations?
bool m_beingDeleted; // marked for delayed deletion?
wxIPV4address m_localAddress; // bind to local address?
// pushback buffer
void *m_unread; // pushback buffer
wxUint32 m_unrd_size; // pushback buffer size
wxUint32 m_unrd_cur; // pushback pointer (index into buffer)
// events
int m_id; // socket id
wxEvtHandler *m_handler; // event handler
void *m_clientData; // client data for events
bool m_notify; // notify events to users?
wxSocketEventFlags m_eventmask; // which events to notify?
wxSocketEventFlags m_eventsgot; // collects events received in OnRequest()
friend class wxSocketReadGuard;
friend class wxSocketWriteGuard;
wxDECLARE_CLASS(wxSocketBase);
wxDECLARE_NO_COPY_CLASS(wxSocketBase);
};
// --------------------------------------------------------------------------
// wxSocketServer
// --------------------------------------------------------------------------
class WXDLLIMPEXP_NET wxSocketServer : public wxSocketBase
{
public:
wxSocketServer(const wxSockAddress& addr,
wxSocketFlags flags = wxSOCKET_NONE);
wxSocketBase* Accept(bool wait = true);
bool AcceptWith(wxSocketBase& socket, bool wait = true);
bool WaitForAccept(long seconds = -1, long milliseconds = 0);
wxDECLARE_CLASS(wxSocketServer);
wxDECLARE_NO_COPY_CLASS(wxSocketServer);
};
// --------------------------------------------------------------------------
// wxSocketClient
// --------------------------------------------------------------------------
class WXDLLIMPEXP_NET wxSocketClient : public wxSocketBase
{
public:
wxSocketClient(wxSocketFlags flags = wxSOCKET_NONE);
virtual bool Connect(const wxSockAddress& addr, bool wait = true);
bool Connect(const wxSockAddress& addr,
const wxSockAddress& local,
bool wait = true);
bool WaitOnConnect(long seconds = -1, long milliseconds = 0);
// Sets initial socket buffer sizes using the SO_SNDBUF and SO_RCVBUF
// options before calling connect (either one can be -1 to leave it
// unchanged)
void SetInitialSocketBuffers(int recv, int send)
{
m_initialRecvBufferSize = recv;
m_initialSendBufferSize = send;
}
private:
virtual bool DoConnect(const wxSockAddress& addr,
const wxSockAddress* local,
bool wait = true);
// buffer sizes, -1 if unset and defaults should be used
int m_initialRecvBufferSize;
int m_initialSendBufferSize;
wxDECLARE_CLASS(wxSocketClient);
wxDECLARE_NO_COPY_CLASS(wxSocketClient);
};
// --------------------------------------------------------------------------
// wxDatagramSocket
// --------------------------------------------------------------------------
// WARNING: still in alpha stage
class WXDLLIMPEXP_NET wxDatagramSocket : public wxSocketBase
{
public:
wxDatagramSocket(const wxSockAddress& addr,
wxSocketFlags flags = wxSOCKET_NONE);
wxDatagramSocket& RecvFrom(wxSockAddress& addr,
void *buf,
wxUint32 nBytes);
wxDatagramSocket& SendTo(const wxSockAddress& addr,
const void* buf,
wxUint32 nBytes);
/* TODO:
bool Connect(wxSockAddress& addr);
*/
private:
wxDECLARE_CLASS(wxDatagramSocket);
wxDECLARE_NO_COPY_CLASS(wxDatagramSocket);
};
// --------------------------------------------------------------------------
// wxSocketEvent
// --------------------------------------------------------------------------
class WXDLLIMPEXP_NET wxSocketEvent : public wxEvent
{
public:
wxSocketEvent(int id = 0)
: wxEvent(id, wxEVT_SOCKET)
{
}
wxSocketNotify GetSocketEvent() const { return m_event; }
wxSocketBase *GetSocket() const
{ return (wxSocketBase *) GetEventObject(); }
void *GetClientData() const { return m_clientData; }
virtual wxEvent *Clone() const wxOVERRIDE { return new wxSocketEvent(*this); }
virtual wxEventCategory GetEventCategory() const wxOVERRIDE { return wxEVT_CATEGORY_SOCKET; }
public:
wxSocketNotify m_event;
void *m_clientData;
wxDECLARE_DYNAMIC_CLASS_NO_ASSIGN(wxSocketEvent);
};
typedef void (wxEvtHandler::*wxSocketEventFunction)(wxSocketEvent&);
#define wxSocketEventHandler(func) \
wxEVENT_HANDLER_CAST(wxSocketEventFunction, func)
#define EVT_SOCKET(id, func) \
wx__DECLARE_EVT1(wxEVT_SOCKET, id, wxSocketEventHandler(func))
#endif // wxUSE_SOCKETS
#endif // _WX_SOCKET_H_
| h |
rticonnextdds-usecases | data/projects/rticonnextdds-usecases/VehicleTracking/ExampleCode/thirdparty/wxWidgets-3.1.2/Linux/include/wx/xtihandler.h | /////////////////////////////////////////////////////////////////////////////
// Name: wx/xtihandler.h
// Purpose: XTI handlers
// Author: Stefan Csomor
// Modified by: Francesco Montorsi
// Created: 27/07/03
// Copyright: (c) 1997 Julian Smart
// (c) 2003 Stefan Csomor
// Licence: wxWindows licence
/////////////////////////////////////////////////////////////////////////////
#ifndef _XTIHANDLER_H_
#define _XTIHANDLER_H_
#include "wx/defs.h"
#if wxUSE_EXTENDED_RTTI
#include "wx/xti.h"
// copied from event.h which cannot be included at this place
class WXDLLIMPEXP_FWD_BASE wxEvent;
#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;
typedef void (wxEvtHandler::*wxEventFunction)(wxEvent&);
typedef wxEventFunction wxObjectEventFunction;
// ----------------------------------------------------------------------------
// Handler Info
//
// this describes an event sink
// ----------------------------------------------------------------------------
class WXDLLIMPEXP_BASE wxHandlerInfo
{
friend class WXDLLIMPEXP_BASE wxDynamicClassInfo;
public:
wxHandlerInfo(wxHandlerInfo* &iter,
wxClassInfo* itsClass,
const wxString& name,
wxObjectEventFunction address,
const wxClassInfo* eventClassInfo) :
m_eventFunction(address),
m_name(name),
m_eventClassInfo(eventClassInfo),
m_itsClass(itsClass)
{
Insert(iter);
}
~wxHandlerInfo()
{ Remove(); }
// return the name of this handler
const wxString& GetName() const { return m_name; }
// return the class info of the event
const wxClassInfo *GetEventClassInfo() const { return m_eventClassInfo; }
// get the handler function pointer
wxObjectEventFunction GetEventFunction() const { return m_eventFunction; }
// returns NULL if this is the last handler of this class
wxHandlerInfo* GetNext() const { return m_next; }
// return the class this property is declared in
const wxClassInfo* GetDeclaringClass() const { return m_itsClass; }
private:
// inserts this handler at the end of the linked chain which begins
// with "iter" handler.
void Insert(wxHandlerInfo* &iter);
// removes this handler from the linked chain of the m_itsClass handlers.
void Remove();
wxObjectEventFunction m_eventFunction;
wxString m_name;
const wxClassInfo* m_eventClassInfo;
wxHandlerInfo* m_next;
wxClassInfo* m_itsClass;
};
#define wxHANDLER(name,eventClassType) \
static wxHandlerInfo _handlerInfo##name( first, class_t::GetClassInfoStatic(), \
wxT(#name), (wxObjectEventFunction) (wxEventFunction) &name, \
wxCLASSINFO( eventClassType ) );
#define wxBEGIN_HANDLERS_TABLE(theClass) \
wxHandlerInfo *theClass::GetHandlersStatic() \
{ \
typedef theClass class_t; \
static wxHandlerInfo* first = NULL;
#define wxEND_HANDLERS_TABLE() \
return first; }
#define wxEMPTY_HANDLERS_TABLE(theClass) \
wxBEGIN_HANDLERS_TABLE(theClass) \
wxEND_HANDLERS_TABLE()
#endif // wxUSE_EXTENDED_RTTI
#endif // _XTIHANDLER_H_
| h |
rticonnextdds-usecases | data/projects/rticonnextdds-usecases/VehicleTracking/ExampleCode/thirdparty/wxWidgets-3.1.2/Linux/include/wx/url.h | /////////////////////////////////////////////////////////////////////////////
// Name: wx/url.h
// Purpose: URL parser
// Author: Guilhem Lavaux
// Modified by: Ryan Norton
// Created: 20/07/1997
// Copyright: (c) 1997, 1998 Guilhem Lavaux
// Licence: wxWindows licence
/////////////////////////////////////////////////////////////////////////////
#ifndef _WX_URL_H
#define _WX_URL_H
#include "wx/defs.h"
#if wxUSE_URL
#include "wx/uri.h"
#include "wx/protocol/protocol.h"
#if wxUSE_PROTOCOL_HTTP
#include "wx/protocol/http.h"
#endif
enum wxURLError {
wxURL_NOERR = 0,
wxURL_SNTXERR,
wxURL_NOPROTO,
wxURL_NOHOST,
wxURL_NOPATH,
wxURL_CONNERR,
wxURL_PROTOERR
};
#if wxUSE_URL_NATIVE
class WXDLLIMPEXP_FWD_NET wxURL;
class WXDLLIMPEXP_NET wxURLNativeImp : public wxObject
{
public:
virtual ~wxURLNativeImp() { }
virtual wxInputStream *GetInputStream(wxURL *owner) = 0;
};
#endif // wxUSE_URL_NATIVE
class WXDLLIMPEXP_NET wxURL : public wxURI
{
public:
wxURL(const wxString& sUrl = wxEmptyString);
wxURL(const wxURI& uri);
wxURL(const wxURL& url);
virtual ~wxURL();
wxURL& operator = (const wxString& url);
wxURL& operator = (const wxURI& uri);
wxURL& operator = (const wxURL& url);
wxProtocol& GetProtocol() { return *m_protocol; }
wxURLError GetError() const { return m_error; }
wxString GetURL() const { return m_url; }
wxURLError SetURL(const wxString &url)
{ *this = url; return m_error; }
bool IsOk() const
{ return m_error == wxURL_NOERR; }
wxInputStream *GetInputStream();
#if wxUSE_PROTOCOL_HTTP
static void SetDefaultProxy(const wxString& url_proxy);
void SetProxy(const wxString& url_proxy);
#endif // wxUSE_PROTOCOL_HTTP
protected:
static wxProtoInfo *ms_protocols;
#if wxUSE_PROTOCOL_HTTP
static wxHTTP *ms_proxyDefault;
static bool ms_useDefaultProxy;
wxHTTP *m_proxy;
bool m_useProxy;
#endif // wxUSE_PROTOCOL_HTTP
#if wxUSE_URL_NATIVE
friend class wxURLNativeImp;
// pointer to a native URL implementation object
wxURLNativeImp *m_nativeImp;
// Creates on the heap and returns a native
// implementation object for the current platform.
static wxURLNativeImp *CreateNativeImpObject();
#endif // wxUSE_URL_NATIVE
wxProtoInfo *m_protoinfo;
wxProtocol *m_protocol;
wxURLError m_error;
wxString m_url;
void Init(const wxString&);
bool ParseURL();
void CleanData();
void Free();
bool FetchProtocol();
friend class wxProtoInfo;
friend class wxURLModule;
private:
wxDECLARE_DYNAMIC_CLASS(wxURL);
};
#endif // wxUSE_URL
#endif // _WX_URL_H
| h |
rticonnextdds-usecases | data/projects/rticonnextdds-usecases/VehicleTracking/ExampleCode/thirdparty/wxWidgets-3.1.2/Linux/include/wx/notebook.h | ///////////////////////////////////////////////////////////////////////////////
// Name: wx/notebook.h
// Purpose: wxNotebook interface
// Author: Vadim Zeitlin
// Modified by:
// Created: 01.02.01
// Copyright: (c) 1996-2000 Vadim Zeitlin
// Licence: wxWindows licence
///////////////////////////////////////////////////////////////////////////////
#ifndef _WX_NOTEBOOK_H_BASE_
#define _WX_NOTEBOOK_H_BASE_
// ----------------------------------------------------------------------------
// headers
// ----------------------------------------------------------------------------
#include "wx/defs.h"
#if wxUSE_NOTEBOOK
#include "wx/bookctrl.h"
// ----------------------------------------------------------------------------
// constants
// ----------------------------------------------------------------------------
// wxNotebook hit results, use wxBK_HITTEST so other book controls can share them
// if wxUSE_NOTEBOOK is disabled
enum
{
wxNB_HITTEST_NOWHERE = wxBK_HITTEST_NOWHERE,
wxNB_HITTEST_ONICON = wxBK_HITTEST_ONICON,
wxNB_HITTEST_ONLABEL = wxBK_HITTEST_ONLABEL,
wxNB_HITTEST_ONITEM = wxBK_HITTEST_ONITEM,
wxNB_HITTEST_ONPAGE = wxBK_HITTEST_ONPAGE
};
// wxNotebook flags
// use common book wxBK_* flags for describing alignment
#define wxNB_DEFAULT wxBK_DEFAULT
#define wxNB_TOP wxBK_TOP
#define wxNB_BOTTOM wxBK_BOTTOM
#define wxNB_LEFT wxBK_LEFT
#define wxNB_RIGHT wxBK_RIGHT
#define wxNB_FIXEDWIDTH 0x0100
#define wxNB_MULTILINE 0x0200
#define wxNB_NOPAGETHEME 0x0400
typedef wxWindow wxNotebookPage; // so far, any window can be a page
extern WXDLLIMPEXP_DATA_CORE(const char) wxNotebookNameStr[];
#if wxUSE_EXTENDED_RTTI
// ----------------------------------------------------------------------------
// XTI accessor
// ----------------------------------------------------------------------------
class WXDLLEXPORT wxNotebookPageInfo : public wxObject
{
public:
wxNotebookPageInfo() { m_page = NULL; m_imageId = -1; m_selected = false; }
virtual ~wxNotebookPageInfo() { }
bool Create(wxNotebookPage *page,
const wxString& text,
bool selected,
int imageId)
{
m_page = page;
m_text = text;
m_selected = selected;
m_imageId = imageId;
return true;
}
wxNotebookPage* GetPage() const { return m_page; }
wxString GetText() const { return m_text; }
bool GetSelected() const { return m_selected; }
int GetImageId() const { return m_imageId; }
private:
wxNotebookPage *m_page;
wxString m_text;
bool m_selected;
int m_imageId;
wxDECLARE_DYNAMIC_CLASS(wxNotebookPageInfo);
};
WX_DECLARE_EXPORTED_LIST(wxNotebookPageInfo, wxNotebookPageInfoList );
#endif
// ----------------------------------------------------------------------------
// wxNotebookBase: define wxNotebook interface
// ----------------------------------------------------------------------------
class WXDLLIMPEXP_CORE wxNotebookBase : public wxBookCtrlBase
{
public:
// ctors
// -----
wxNotebookBase() { }
// wxNotebook-specific additions to wxBookCtrlBase interface
// ---------------------------------------------------------
// get the number of rows for a control with wxNB_MULTILINE style (not all
// versions support it - they will always return 1 then)
virtual int GetRowCount() const { return 1; }
// set the padding between tabs (in pixels)
virtual void SetPadding(const wxSize& padding) = 0;
// set the size of the tabs for wxNB_FIXEDWIDTH controls
virtual void SetTabSize(const wxSize& sz) = 0;
// implement some base class functions
virtual wxSize CalcSizeFromPage(const wxSize& sizePage) const wxOVERRIDE;
// On platforms that support it, get the theme page background colour, else invalid colour
virtual wxColour GetThemeBackgroundColour() const { return wxNullColour; }
// send wxEVT_NOTEBOOK_PAGE_CHANGING/ED events
// returns false if the change to nPage is vetoed by the program
bool SendPageChangingEvent(int nPage);
// sends the event about page change from old to new (or GetSelection() if
// new is wxNOT_FOUND)
void SendPageChangedEvent(int nPageOld, int nPageNew = wxNOT_FOUND);
#if wxUSE_EXTENDED_RTTI
// XTI accessors
virtual void AddPageInfo( wxNotebookPageInfo* info );
virtual const wxNotebookPageInfoList& GetPageInfos() const;
#endif
protected:
#if wxUSE_EXTENDED_RTTI
wxNotebookPageInfoList m_pageInfos;
#endif
wxDECLARE_NO_COPY_CLASS(wxNotebookBase);
};
// ----------------------------------------------------------------------------
// notebook event class and related stuff
// ----------------------------------------------------------------------------
// wxNotebookEvent is obsolete and defined for compatibility only (notice that
// we use #define and not typedef to also keep compatibility with the existing
// code which forward declares it)
#define wxNotebookEvent wxBookCtrlEvent
typedef wxBookCtrlEventFunction wxNotebookEventFunction;
#define wxNotebookEventHandler(func) wxBookCtrlEventHandler(func)
wxDECLARE_EXPORTED_EVENT( WXDLLIMPEXP_CORE, wxEVT_NOTEBOOK_PAGE_CHANGED, wxBookCtrlEvent );
wxDECLARE_EXPORTED_EVENT( WXDLLIMPEXP_CORE, wxEVT_NOTEBOOK_PAGE_CHANGING, wxBookCtrlEvent );
#define EVT_NOTEBOOK_PAGE_CHANGED(winid, fn) \
wx__DECLARE_EVT1(wxEVT_NOTEBOOK_PAGE_CHANGED, winid, wxBookCtrlEventHandler(fn))
#define EVT_NOTEBOOK_PAGE_CHANGING(winid, fn) \
wx__DECLARE_EVT1(wxEVT_NOTEBOOK_PAGE_CHANGING, winid, wxBookCtrlEventHandler(fn))
// ----------------------------------------------------------------------------
// wxNotebook class itself
// ----------------------------------------------------------------------------
#if defined(__WXUNIVERSAL__)
#include "wx/univ/notebook.h"
#elif defined(__WXMSW__)
#include "wx/msw/notebook.h"
#elif defined(__WXMOTIF__)
#include "wx/generic/notebook.h"
#elif defined(__WXGTK20__)
#include "wx/gtk/notebook.h"
#elif defined(__WXGTK__)
#include "wx/gtk1/notebook.h"
#elif defined(__WXMAC__)
#include "wx/osx/notebook.h"
#elif defined(__WXQT__)
#include "wx/qt/notebook.h"
#endif
// old wxEVT_COMMAND_* constants
#define wxEVT_COMMAND_NOTEBOOK_PAGE_CHANGED wxEVT_NOTEBOOK_PAGE_CHANGED
#define wxEVT_COMMAND_NOTEBOOK_PAGE_CHANGING wxEVT_NOTEBOOK_PAGE_CHANGING
#endif // wxUSE_NOTEBOOK
#endif
// _WX_NOTEBOOK_H_BASE_
| h |
rticonnextdds-usecases | data/projects/rticonnextdds-usecases/VehicleTracking/ExampleCode/thirdparty/wxWidgets-3.1.2/Linux/include/wx/msgout.h | ///////////////////////////////////////////////////////////////////////////////
// Name: wx/msgout.h
// Purpose: wxMessageOutput class. Shows a message to the user
// Author: Mattia Barbon
// Modified by:
// Created: 17.07.02
// Copyright: (c) Mattia Barbon
// Licence: wxWindows licence
///////////////////////////////////////////////////////////////////////////////
#ifndef _WX_MSGOUT_H_
#define _WX_MSGOUT_H_
// ----------------------------------------------------------------------------
// headers
// ----------------------------------------------------------------------------
#include "wx/defs.h"
#include "wx/chartype.h"
#include "wx/strvararg.h"
// ----------------------------------------------------------------------------
// wxMessageOutput is a class abstracting formatted output target, i.e.
// something you can printf() to
// ----------------------------------------------------------------------------
class WXDLLIMPEXP_BASE wxMessageOutput
{
public:
virtual ~wxMessageOutput() { }
// gets the current wxMessageOutput object (may be NULL during
// initialization or shutdown)
static wxMessageOutput* Get();
// sets the global wxMessageOutput instance; returns the previous one
static wxMessageOutput* Set(wxMessageOutput* msgout);
// show a message to the user
// void Printf(const wxString& format, ...) = 0;
WX_DEFINE_VARARG_FUNC_VOID(Printf, 1, (const wxFormatString&),
DoPrintfWchar, DoPrintfUtf8)
// called by DoPrintf() to output formatted string but can also be called
// directly if no formatting is needed
virtual void Output(const wxString& str) = 0;
protected:
#if !wxUSE_UTF8_LOCALE_ONLY
void DoPrintfWchar(const wxChar *format, ...);
#endif
#if wxUSE_UNICODE_UTF8
void DoPrintfUtf8(const char *format, ...);
#endif
private:
static wxMessageOutput* ms_msgOut;
};
// ----------------------------------------------------------------------------
// helper mix-in for output targets that can use difference encodings
// ----------------------------------------------------------------------------
class WXDLLIMPEXP_BASE wxMessageOutputWithConv
{
protected:
explicit wxMessageOutputWithConv(const wxMBConv& conv)
: m_conv(conv.Clone())
{
}
~wxMessageOutputWithConv()
{
delete m_conv;
}
// return the string with "\n" appended if it doesn't already terminate
// with it (in which case it's returned unchanged)
wxString AppendLineFeedIfNeeded(const wxString& str);
// Prepare the given string for output by appending a new line to it, if
// necessary, and converting it to a narrow string using our conversion
// object.
wxCharBuffer PrepareForOutput(const wxString& str);
const wxMBConv* const m_conv;
};
// ----------------------------------------------------------------------------
// implementation which sends output to stderr or specified file
// ----------------------------------------------------------------------------
class WXDLLIMPEXP_BASE wxMessageOutputStderr : public wxMessageOutput,
protected wxMessageOutputWithConv
{
public:
wxMessageOutputStderr(FILE *fp = stderr,
const wxMBConv &conv = wxConvWhateverWorks);
virtual void Output(const wxString& str) wxOVERRIDE;
protected:
FILE *m_fp;
wxDECLARE_NO_COPY_CLASS(wxMessageOutputStderr);
};
// ----------------------------------------------------------------------------
// implementation showing the message to the user in "best" possible way:
// uses stderr or message box if available according to the flag given to ctor.
// ----------------------------------------------------------------------------
enum wxMessageOutputFlags
{
wxMSGOUT_PREFER_STDERR = 0, // use stderr if available (this is the default)
wxMSGOUT_PREFER_MSGBOX = 1 // always use message box if available
};
class WXDLLIMPEXP_BASE wxMessageOutputBest : public wxMessageOutputStderr
{
public:
wxMessageOutputBest(wxMessageOutputFlags flags = wxMSGOUT_PREFER_STDERR)
: m_flags(flags) { }
virtual void Output(const wxString& str) wxOVERRIDE;
private:
wxMessageOutputFlags m_flags;
};
// ----------------------------------------------------------------------------
// implementation which shows output in a message box
// ----------------------------------------------------------------------------
#if wxUSE_GUI && wxUSE_MSGDLG
class WXDLLIMPEXP_CORE wxMessageOutputMessageBox : public wxMessageOutput
{
public:
wxMessageOutputMessageBox() { }
virtual void Output(const wxString& str) wxOVERRIDE;
};
#endif // wxUSE_GUI && wxUSE_MSGDLG
// ----------------------------------------------------------------------------
// implementation using the native way of outputting debug messages
// ----------------------------------------------------------------------------
class WXDLLIMPEXP_BASE wxMessageOutputDebug : public wxMessageOutputStderr
{
public:
wxMessageOutputDebug() { }
virtual void Output(const wxString& str) wxOVERRIDE;
};
// ----------------------------------------------------------------------------
// implementation using wxLog (mainly for backwards compatibility)
// ----------------------------------------------------------------------------
class WXDLLIMPEXP_BASE wxMessageOutputLog : public wxMessageOutput
{
public:
wxMessageOutputLog() { }
virtual void Output(const wxString& str) wxOVERRIDE;
};
#endif // _WX_MSGOUT_H_
| h |
rticonnextdds-usecases | data/projects/rticonnextdds-usecases/VehicleTracking/ExampleCode/thirdparty/wxWidgets-3.1.2/Linux/include/wx/imagtga.h | /////////////////////////////////////////////////////////////////////////////
// Name: wx/imagtga.h
// Purpose: wxImage TGA handler
// Author: Seth Jackson
// Copyright: (c) 2005 Seth Jackson
// Licence: wxWindows licence
/////////////////////////////////////////////////////////////////////////////
#ifndef _WX_IMAGTGA_H_
#define _WX_IMAGTGA_H_
#include "wx/image.h"
//-----------------------------------------------------------------------------
// wxTGAHandler
//-----------------------------------------------------------------------------
#if wxUSE_TGA
class WXDLLIMPEXP_CORE wxTGAHandler : public wxImageHandler
{
public:
wxTGAHandler()
{
m_name = wxT("TGA file");
m_extension = wxT("tga");
m_altExtensions.Add(wxT("tpic"));
m_type = wxBITMAP_TYPE_TGA;
m_mime = wxT("image/tga");
}
#if wxUSE_STREAMS
virtual bool LoadFile(wxImage* image, wxInputStream& stream,
bool verbose = true, int index = -1) wxOVERRIDE;
virtual bool SaveFile(wxImage* image, wxOutputStream& stream,
bool verbose = true) wxOVERRIDE;
protected:
virtual bool DoCanRead(wxInputStream& stream) wxOVERRIDE;
#endif // wxUSE_STREAMS
wxDECLARE_DYNAMIC_CLASS(wxTGAHandler);
};
#endif // wxUSE_TGA
#endif // _WX_IMAGTGA_H_
| h |
rticonnextdds-usecases | data/projects/rticonnextdds-usecases/VehicleTracking/ExampleCode/thirdparty/wxWidgets-3.1.2/Linux/include/wx/sckaddr.h | /////////////////////////////////////////////////////////////////////////////
// Name: wx/sckaddr.h
// Purpose: Network address classes
// Author: Guilhem Lavaux
// Modified by: Vadim Zeitlin to switch to wxSockAddressImpl implementation
// Created: 26/04/1997
// Copyright: (c) 1997, 1998 Guilhem Lavaux
// (c) 2008, 2009 Vadim Zeitlin
// Licence: wxWindows licence
/////////////////////////////////////////////////////////////////////////////
#ifndef _WX_SCKADDR_H_
#define _WX_SCKADDR_H_
#include "wx/defs.h"
#if wxUSE_SOCKETS
#include "wx/string.h"
class wxSockAddressImpl;
// forward declare it instead of including the system headers defining it which
// can bring in <windows.h> under Windows which we don't want to include from
// public wx headers
struct sockaddr;
// Any socket address kind
class WXDLLIMPEXP_NET wxSockAddress : public wxObject
{
public:
enum Family
{
NONE,
IPV4,
IPV6,
UNIX
};
wxSockAddress();
wxSockAddress(const wxSockAddress& other);
virtual ~wxSockAddress();
wxSockAddress& operator=(const wxSockAddress& other);
virtual void Clear();
virtual Family Type() = 0;
// accessors for the low level address represented by this object
const sockaddr *GetAddressData() const;
int GetAddressDataLen() const;
// we need to be able to create copies of the addresses polymorphically
// (i.e. without knowing the exact address class)
virtual wxSockAddress *Clone() const = 0;
// implementation only, don't use
const wxSockAddressImpl& GetAddress() const { return *m_impl; }
void SetAddress(const wxSockAddressImpl& address);
protected:
wxSockAddressImpl *m_impl;
private:
void Init();
wxDECLARE_ABSTRACT_CLASS(wxSockAddress);
};
// An IP address (either IPv4 or IPv6)
class WXDLLIMPEXP_NET wxIPaddress : public wxSockAddress
{
public:
wxIPaddress() : wxSockAddress() { }
wxIPaddress(const wxIPaddress& other)
: wxSockAddress(other),
m_origHostname(other.m_origHostname)
{
}
bool operator==(const wxIPaddress& addr) const;
bool Hostname(const wxString& name);
bool Service(const wxString& name);
bool Service(unsigned short port);
bool LocalHost();
virtual bool IsLocalHost() const = 0;
bool AnyAddress();
virtual wxString IPAddress() const = 0;
wxString Hostname() const;
unsigned short Service() const;
wxString OrigHostname() const { return m_origHostname; }
protected:
// get m_impl initialized to the right family if it hadn't been done yet
wxSockAddressImpl& GetImpl();
const wxSockAddressImpl& GetImpl() const
{
return const_cast<wxIPaddress *>(this)->GetImpl();
}
// host name originally passed to Hostname()
wxString m_origHostname;
private:
// create the wxSockAddressImpl object of the correct family if it's
// currently uninitialized
virtual void DoInitImpl() = 0;
wxDECLARE_ABSTRACT_CLASS(wxIPaddress);
};
// An IPv4 address
class WXDLLIMPEXP_NET wxIPV4address : public wxIPaddress
{
public:
wxIPV4address() : wxIPaddress() { }
wxIPV4address(const wxIPV4address& other) : wxIPaddress(other) { }
// implement wxSockAddress pure virtuals:
virtual Family Type() wxOVERRIDE { return IPV4; }
virtual wxSockAddress *Clone() const wxOVERRIDE { return new wxIPV4address(*this); }
// implement wxIPaddress pure virtuals:
virtual bool IsLocalHost() const wxOVERRIDE;
virtual wxString IPAddress() const wxOVERRIDE;
// IPv4-specific methods:
bool Hostname(unsigned long addr);
// make base class methods hidden by our overload visible
using wxIPaddress::Hostname;
bool BroadcastAddress();
private:
virtual void DoInitImpl() wxOVERRIDE;
wxDECLARE_DYNAMIC_CLASS(wxIPV4address);
};
#if wxUSE_IPV6
// An IPv6 address
class WXDLLIMPEXP_NET wxIPV6address : public wxIPaddress
{
public:
wxIPV6address() : wxIPaddress() { }
wxIPV6address(const wxIPV6address& other) : wxIPaddress(other) { }
// implement wxSockAddress pure virtuals:
virtual Family Type() wxOVERRIDE { return IPV6; }
virtual wxSockAddress *Clone() const wxOVERRIDE { return new wxIPV6address(*this); }
// implement wxIPaddress pure virtuals:
virtual bool IsLocalHost() const wxOVERRIDE;
virtual wxString IPAddress() const wxOVERRIDE;
// IPv6-specific methods:
bool Hostname(unsigned char addr[16]);
using wxIPaddress::Hostname;
private:
virtual void DoInitImpl() wxOVERRIDE;
wxDECLARE_DYNAMIC_CLASS(wxIPV6address);
};
#endif // wxUSE_IPV6
// Unix domain sockets are only available under, well, Unix
#if defined(__UNIX__) && !defined(__WINDOWS__) && !defined(__WINE__)
#define wxHAS_UNIX_DOMAIN_SOCKETS
#endif
#ifdef wxHAS_UNIX_DOMAIN_SOCKETS
// A Unix domain socket address
class WXDLLIMPEXP_NET wxUNIXaddress : public wxSockAddress
{
public:
wxUNIXaddress() : wxSockAddress() { }
wxUNIXaddress(const wxUNIXaddress& other) : wxSockAddress(other) { }
void Filename(const wxString& name);
wxString Filename() const;
virtual Family Type() wxOVERRIDE { return UNIX; }
virtual wxSockAddress *Clone() const wxOVERRIDE { return new wxUNIXaddress(*this); }
private:
wxSockAddressImpl& GetUNIX();
const wxSockAddressImpl& GetUNIX() const
{
return const_cast<wxUNIXaddress *>(this)->GetUNIX();
}
wxDECLARE_DYNAMIC_CLASS(wxUNIXaddress);
};
#endif // wxHAS_UNIX_DOMAIN_SOCKETS
#endif // wxUSE_SOCKETS
#endif // _WX_SCKADDR_H_
| h |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.