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/Win32/include/wx/snglinst.h | ///////////////////////////////////////////////////////////////////////////////
// Name: wx/snglinst.h
// Purpose: wxSingleInstanceChecker can be used to restrict the number of
// simultaneously running copies of a program to one
// Author: Vadim Zeitlin
// Modified by:
// Created: 08.06.01
// Copyright: (c) 2001 Vadim Zeitlin <[email protected]>
// Licence: wxWindows licence
///////////////////////////////////////////////////////////////////////////////
#ifndef _WX_SNGLINST_H_
#define _WX_SNGLINST_H_
#if wxUSE_SNGLINST_CHECKER
#include "wx/app.h"
#include "wx/utils.h"
// ----------------------------------------------------------------------------
// wxSingleInstanceChecker
// ----------------------------------------------------------------------------
class WXDLLIMPEXP_BASE wxSingleInstanceChecker
{
public:
// default ctor, use Create() after it
wxSingleInstanceChecker() { Init(); }
// like Create() but no error checking (dangerous!)
wxSingleInstanceChecker(const wxString& name,
const wxString& path = wxEmptyString)
{
Init();
Create(name, path);
}
// notice that calling Create() is optional now, if you don't do it before
// calling IsAnotherRunning(), CreateDefault() is used automatically
//
// name it is used as the mutex name under Win32 and the lock file name
// under Unix so it should be as unique as possible and must be non-empty
//
// path is optional and is ignored under Win32 and used as the directory to
// create the lock file in under Unix (default is wxGetHomeDir())
//
// returns false if initialization failed, it doesn't mean that another
// instance is running - use IsAnotherRunning() to check it
bool Create(const wxString& name, const wxString& path = wxEmptyString);
// use the default name, which is a combination of wxTheApp->GetAppName()
// and wxGetUserId() for mutex/lock file
//
// this is called implicitly by IsAnotherRunning() if the checker hadn't
// been created until then
bool CreateDefault()
{
wxCHECK_MSG( wxTheApp, false, "must have application instance" );
return Create(wxTheApp->GetAppName() + '-' + wxGetUserId());
}
// is another copy of this program already running?
bool IsAnotherRunning() const
{
if ( !m_impl )
{
if ( !const_cast<wxSingleInstanceChecker *>(this)->CreateDefault() )
{
// if creation failed, return false as it's better to not
// prevent this instance from starting up if there is an error
return false;
}
}
return DoIsAnotherRunning();
}
// dtor is not virtual, this class is not meant to be used polymorphically
~wxSingleInstanceChecker();
private:
// common part of all ctors
void Init() { m_impl = NULL; }
// do check if another instance is running, called only if m_impl != NULL
bool DoIsAnotherRunning() const;
// the implementation details (platform specific)
class WXDLLIMPEXP_FWD_BASE wxSingleInstanceCheckerImpl *m_impl;
wxDECLARE_NO_COPY_CLASS(wxSingleInstanceChecker);
};
#endif // wxUSE_SNGLINST_CHECKER
#endif // _WX_SNGLINST_H_
| h |
rticonnextdds-usecases | data/projects/rticonnextdds-usecases/VehicleTracking/ExampleCode/thirdparty/wxWidgets-3.1.2/Win32/include/wx/tipdlg.h | ///////////////////////////////////////////////////////////////////////////////
// Name: wx/tipdlg.h
// Purpose: declaration of wxTipDialog
// Author: Vadim Zeitlin
// Modified by:
// Created: 28.06.99
// Copyright: (c) Vadim Zeitlin
// Licence: wxWindows licence
///////////////////////////////////////////////////////////////////////////////
#ifndef _WX_TIPDLG_H_
#define _WX_TIPDLG_H_
// ----------------------------------------------------------------------------
// headers which we must include here
// ----------------------------------------------------------------------------
#include "wx/defs.h"
#if wxUSE_STARTUP_TIPS
#include "wx/textfile.h"
// ----------------------------------------------------------------------------
// wxTipProvider - a class which is used by wxTipDialog to get the text of the
// tips
// ----------------------------------------------------------------------------
// the abstract base class: it provides the tips, i.e. implements the GetTip()
// function which returns the new tip each time it's called. To support this,
// wxTipProvider evidently needs some internal state which is the tip "index"
// and which should be saved/restored by the program to not always show one and
// the same tip (of course, you may use random starting position as well...)
class WXDLLIMPEXP_ADV wxTipProvider
{
public:
wxTipProvider(size_t currentTip) { m_currentTip = currentTip; }
// get the current tip and update the internal state to return the next tip
// when called for the next time
virtual wxString GetTip() = 0;
// get the current tip "index" (or whatever allows the tip provider to know
// from where to start the next time)
size_t GetCurrentTip() const { return m_currentTip; }
// virtual dtor for the base class
virtual ~wxTipProvider() { }
#if WXWIN_COMPATIBILITY_3_0
wxDEPRECATED_MSG("this method does nothing, simply don't call it")
wxString PreprocessTip(const wxString& tip) { return tip; }
#endif
protected:
size_t m_currentTip;
};
// a function which returns an implementation of wxTipProvider using the
// specified text file as the source of tips (each line is a tip).
//
// NB: the caller is responsible for deleting the pointer!
#if wxUSE_TEXTFILE
WXDLLIMPEXP_ADV wxTipProvider *wxCreateFileTipProvider(const wxString& filename,
size_t currentTip);
#endif // wxUSE_TEXTFILE
// ----------------------------------------------------------------------------
// wxTipDialog
// ----------------------------------------------------------------------------
// A dialog which shows a "tip" - a short and helpful messages describing to
// the user some program characteristic. Many programs show the tips at
// startup, so the dialog has "Show tips on startup" checkbox which allows to
// the user to disable this (however, it's the program which should show, or
// not, the dialog on startup depending on its value, not this class).
//
// The function returns true if this checkbox is checked, false otherwise.
WXDLLIMPEXP_ADV bool wxShowTip(wxWindow *parent,
wxTipProvider *tipProvider,
bool showAtStartup = true);
#endif // wxUSE_STARTUP_TIPS
#endif // _WX_TIPDLG_H_
| h |
rticonnextdds-usecases | data/projects/rticonnextdds-usecases/VehicleTracking/ExampleCode/thirdparty/wxWidgets-3.1.2/Win32/include/wx/bmpbuttn.h | /////////////////////////////////////////////////////////////////////////////
// Name: wx/bmpbuttn.h
// Purpose: wxBitmapButton class interface
// Author: Vadim Zeitlin
// Modified by:
// Created: 25.08.00
// Copyright: (c) 2000 Vadim Zeitlin
// Licence: wxWindows licence
/////////////////////////////////////////////////////////////////////////////
#ifndef _WX_BMPBUTTON_H_BASE_
#define _WX_BMPBUTTON_H_BASE_
#include "wx/defs.h"
#if wxUSE_BMPBUTTON
#include "wx/button.h"
// FIXME: right now only wxMSW, wxGTK and wxOSX implement bitmap support in wxButton
// itself, this shouldn't be used for the other platforms neither
// when all of them do it
#if (defined(__WXMSW__) || defined(__WXGTK20__) || defined(__WXOSX__) || defined(__WXQT__)) && !defined(__WXUNIVERSAL__)
#define wxHAS_BUTTON_BITMAP
#endif
class WXDLLIMPEXP_FWD_CORE wxBitmapButton;
// ----------------------------------------------------------------------------
// wxBitmapButton: a button which shows bitmaps instead of the usual string.
// It has different bitmaps for different states (focused/disabled/pressed)
// ----------------------------------------------------------------------------
class WXDLLIMPEXP_CORE wxBitmapButtonBase : public wxButton
{
public:
wxBitmapButtonBase()
{
#ifndef wxHAS_BUTTON_BITMAP
m_marginX =
m_marginY = 0;
#endif // wxHAS_BUTTON_BITMAP
}
bool Create(wxWindow *parent,
wxWindowID winid,
const wxPoint& pos,
const wxSize& size,
long style,
const wxValidator& validator,
const wxString& name)
{
// We use wxBU_NOTEXT to let the base class Create() know that we are
// not going to show the label: this is a hack needed for wxGTK where
// we can show both label and bitmap only with GTK 2.6+ but we always
// can show just one of them and this style allows us to choose which
// one we need.
//
// And we also use wxBU_EXACTFIT to avoid being resized up to the
// standard button size as this doesn't make sense for bitmap buttons
// which are not standard anyhow and should fit their bitmap size.
return wxButton::Create(parent, winid, wxString(),
pos, size,
style | wxBU_NOTEXT | wxBU_EXACTFIT,
validator, name);
}
// Special creation function for a standard "Close" bitmap. It allows to
// simply create a close button with the image appropriate for the current
// platform.
static wxBitmapButton* NewCloseButton(wxWindow* parent, wxWindowID winid);
// set/get the margins around the button
virtual void SetMargins(int x, int y)
{
DoSetBitmapMargins(x, y);
}
int GetMarginX() const { return DoGetBitmapMargins().x; }
int GetMarginY() const { return DoGetBitmapMargins().y; }
protected:
#ifndef wxHAS_BUTTON_BITMAP
// function called when any of the bitmaps changes
virtual void OnSetBitmap() { InvalidateBestSize(); Refresh(); }
virtual wxBitmap DoGetBitmap(State which) const { return m_bitmaps[which]; }
virtual void DoSetBitmap(const wxBitmap& bitmap, State which)
{ m_bitmaps[which] = bitmap; OnSetBitmap(); }
virtual wxSize DoGetBitmapMargins() const
{
return wxSize(m_marginX, m_marginY);
}
virtual void DoSetBitmapMargins(int x, int y)
{
m_marginX = x;
m_marginY = y;
}
// the bitmaps for various states
wxBitmap m_bitmaps[State_Max];
// the margins around the bitmap
int m_marginX,
m_marginY;
#endif // !wxHAS_BUTTON_BITMAP
wxDECLARE_NO_COPY_CLASS(wxBitmapButtonBase);
};
#if defined(__WXUNIVERSAL__)
#include "wx/univ/bmpbuttn.h"
#elif defined(__WXMSW__)
#include "wx/msw/bmpbuttn.h"
#elif defined(__WXMOTIF__)
#include "wx/motif/bmpbuttn.h"
#elif defined(__WXGTK20__)
#include "wx/gtk/bmpbuttn.h"
#elif defined(__WXGTK__)
#include "wx/gtk1/bmpbuttn.h"
#elif defined(__WXMAC__)
#include "wx/osx/bmpbuttn.h"
#elif defined(__WXQT__)
#include "wx/qt/bmpbuttn.h"
#endif
#endif // wxUSE_BMPBUTTON
#endif // _WX_BMPBUTTON_H_BASE_
| h |
rticonnextdds-usecases | data/projects/rticonnextdds-usecases/VehicleTracking/ExampleCode/thirdparty/wxWidgets-3.1.2/Win32/include/wx/sysopt.h | /////////////////////////////////////////////////////////////////////////////
// Name: wx/sysopt.h
// Purpose: wxSystemOptions
// Author: Julian Smart
// Modified by:
// Created: 2001-07-10
// Copyright: (c) Julian Smart
// Licence: wxWindows licence
/////////////////////////////////////////////////////////////////////////////
#ifndef _WX_SYSOPT_H_
#define _WX_SYSOPT_H_
#include "wx/object.h"
// ----------------------------------------------------------------------------
// Enables an application to influence the wxWidgets implementation
// ----------------------------------------------------------------------------
class
#if wxUSE_SYSTEM_OPTIONS
WXDLLIMPEXP_BASE
#endif
wxSystemOptions : public wxObject
{
public:
wxSystemOptions() { }
// User-customizable hints to wxWidgets or associated libraries
// These could also be used to influence GetSystem... calls, indeed
// to implement SetSystemColour/Font/Metric
#if wxUSE_SYSTEM_OPTIONS
static void SetOption(const wxString& name, const wxString& value);
static void SetOption(const wxString& name, int value);
#endif // wxUSE_SYSTEM_OPTIONS
static wxString GetOption(const wxString& name);
static int GetOptionInt(const wxString& name);
static bool HasOption(const wxString& name);
static bool IsFalse(const wxString& name)
{
return HasOption(name) && GetOptionInt(name) == 0;
}
};
#if !wxUSE_SYSTEM_OPTIONS
// define inline stubs for accessors to make it possible to use wxSystemOptions
// in the library itself without checking for wxUSE_SYSTEM_OPTIONS all the time
/* static */ inline
wxString wxSystemOptions::GetOption(const wxString& WXUNUSED(name))
{
return wxEmptyString;
}
/* static */ inline
int wxSystemOptions::GetOptionInt(const wxString& WXUNUSED(name))
{
return 0;
}
/* static */ inline
bool wxSystemOptions::HasOption(const wxString& WXUNUSED(name))
{
return false;
}
#endif // !wxUSE_SYSTEM_OPTIONS
#endif
// _WX_SYSOPT_H_
| h |
rticonnextdds-usecases | data/projects/rticonnextdds-usecases/VehicleTracking/ExampleCode/thirdparty/wxWidgets-3.1.2/Win32/include/wx/matrix.h | /////////////////////////////////////////////////////////////////////////////
// Name: wx/matrix.h
// Purpose: wxTransformMatrix class. NOT YET USED
// Author: Chris Breeze, Julian Smart
// Modified by: Klaas Holwerda
// Created: 01/02/97
// Copyright: (c) Julian Smart, Chris Breeze
// Licence: wxWindows licence
/////////////////////////////////////////////////////////////////////////////
#ifndef _WX_MATRIXH__
#define _WX_MATRIXH__
//! headerfiles="matrix.h wx/object.h"
#include "wx/object.h"
#include "wx/math.h"
//! codefiles="matrix.cpp"
// A simple 3x3 matrix. This may be replaced by a more general matrix
// class some day.
//
// Note: this is intended to be used in wxDC at some point to replace
// the current system of scaling/translation. It is not yet used.
//:definition
// A 3x3 matrix to do 2D transformations.
// It can be used to map data to window coordinates,
// and also for manipulating your own data.
// For example drawing a picture (composed of several primitives)
// at a certain coordinate and angle within another parent picture.
// At all times m_isIdentity is set if the matrix itself is an Identity matrix.
// It is used where possible to optimize calculations.
class WXDLLIMPEXP_CORE wxTransformMatrix: public wxObject
{
public:
wxTransformMatrix(void);
wxTransformMatrix(const wxTransformMatrix& mat);
//get the value in the matrix at col,row
//rows are horizontal (second index of m_matrix member)
//columns are vertical (first index of m_matrix member)
double GetValue(int col, int row) const;
//set the value in the matrix at col,row
//rows are horizontal (second index of m_matrix member)
//columns are vertical (first index of m_matrix member)
void SetValue(int col, int row, double value);
void operator = (const wxTransformMatrix& mat);
bool operator == (const wxTransformMatrix& mat) const;
bool operator != (const wxTransformMatrix& mat) const;
//multiply every element by t
wxTransformMatrix& operator*=(const double& t);
//divide every element by t
wxTransformMatrix& operator/=(const double& t);
//add matrix m to this t
wxTransformMatrix& operator+=(const wxTransformMatrix& m);
//subtract matrix m from this
wxTransformMatrix& operator-=(const wxTransformMatrix& m);
//multiply matrix m with this
wxTransformMatrix& operator*=(const wxTransformMatrix& m);
// constant operators
//multiply every element by t and return result
wxTransformMatrix operator*(const double& t) const;
//divide this matrix by t and return result
wxTransformMatrix operator/(const double& t) const;
//add matrix m to this and return result
wxTransformMatrix operator+(const wxTransformMatrix& m) const;
//subtract matrix m from this and return result
wxTransformMatrix operator-(const wxTransformMatrix& m) const;
//multiply this by matrix m and return result
wxTransformMatrix operator*(const wxTransformMatrix& m) const;
wxTransformMatrix operator-() const;
//rows are horizontal (second index of m_matrix member)
//columns are vertical (first index of m_matrix member)
double& operator()(int col, int row);
//rows are horizontal (second index of m_matrix member)
//columns are vertical (first index of m_matrix member)
double operator()(int col, int row) const;
// Invert matrix
bool Invert(void);
// Make into identity matrix
bool Identity(void);
// Is the matrix the identity matrix?
// Only returns a flag, which is set whenever an operation
// is done.
inline bool IsIdentity(void) const { return m_isIdentity; }
// This does an actual check.
inline bool IsIdentity1(void) const ;
//Scale by scale (isotropic scaling i.e. the same in x and y):
//!ex:
//!code: | scale 0 0 |
//!code: matrix' = | 0 scale 0 | x matrix
//!code: | 0 0 scale |
bool Scale(double scale);
//Scale with center point and x/y scale
//
//!ex:
//!code: | xs 0 xc(1-xs) |
//!code: matrix' = | 0 ys yc(1-ys) | x matrix
//!code: | 0 0 1 |
wxTransformMatrix& Scale(const double &xs, const double &ys,const double &xc, const double &yc);
// mirror a matrix in x, y
//!ex:
//!code: | -1 0 0 |
//!code: matrix' = | 0 -1 0 | x matrix
//!code: | 0 0 1 |
wxTransformMatrix& Mirror(bool x=true, bool y=false);
// Translate by dx, dy:
//!ex:
//!code: | 1 0 dx |
//!code: matrix' = | 0 1 dy | x matrix
//!code: | 0 0 1 |
bool Translate(double x, double y);
// Rotate clockwise by the given number of degrees:
//!ex:
//!code: | cos sin 0 |
//!code: matrix' = | -sin cos 0 | x matrix
//!code: | 0 0 1 |
bool Rotate(double angle);
//Rotate counter clockwise with point of rotation
//
//!ex:
//!code: | cos(r) -sin(r) x(1-cos(r))+y(sin(r)|
//!code: matrix' = | sin(r) cos(r) y(1-cos(r))-x(sin(r)| x matrix
//!code: | 0 0 1 |
wxTransformMatrix& Rotate(const double &r, const double &x, const double &y);
// Transform X value from logical to device
inline double TransformX(double x) const;
// Transform Y value from logical to device
inline double TransformY(double y) const;
// Transform a point from logical to device coordinates
bool TransformPoint(double x, double y, double& tx, double& ty) const;
// Transform a point from device to logical coordinates.
// Example of use:
// wxTransformMatrix mat = dc.GetTransformation();
// mat.Invert();
// mat.InverseTransformPoint(x, y, x1, y1);
// OR (shorthand:)
// dc.LogicalToDevice(x, y, x1, y1);
// The latter is slightly less efficient if we're doing several
// conversions, since the matrix is inverted several times.
// N.B. 'this' matrix is the inverse at this point
bool InverseTransformPoint(double x, double y, double& tx, double& ty) const;
double Get_scaleX();
double Get_scaleY();
double GetRotation();
void SetRotation(double rotation);
public:
double m_matrix[3][3];
bool m_isIdentity;
};
/*
Chris Breeze reported, that
some functions of wxTransformMatrix cannot work because it is not
known if he matrix has been inverted. Be careful when using it.
*/
// Transform X value from logical to device
// warning: this function can only be used for this purpose
// because no rotation is involved when mapping logical to device coordinates
// mirror and scaling for x and y will be part of the matrix
// if you have a matrix that is rotated, eg a shape containing a matrix to place
// it in the logical coordinate system, use TransformPoint
inline double wxTransformMatrix::TransformX(double x) const
{
//normally like this, but since no rotation is involved (only mirror and scale)
//we can do without Y -> m_matrix[1]{0] is -sin(rotation angle) and therefore zero
//(x * m_matrix[0][0] + y * m_matrix[1][0] + m_matrix[2][0]))
return (m_isIdentity ? x : (x * m_matrix[0][0] + m_matrix[2][0]));
}
// Transform Y value from logical to device
// warning: this function can only be used for this purpose
// because no rotation is involved when mapping logical to device coordinates
// mirror and scaling for x and y will be part of the matrix
// if you have a matrix that is rotated, eg a shape containing a matrix to place
// it in the logical coordinate system, use TransformPoint
inline double wxTransformMatrix::TransformY(double y) const
{
//normally like this, but since no rotation is involved (only mirror and scale)
//we can do without X -> m_matrix[0]{1] is sin(rotation angle) and therefore zero
//(x * m_matrix[0][1] + y * m_matrix[1][1] + m_matrix[2][1]))
return (m_isIdentity ? y : (y * m_matrix[1][1] + m_matrix[2][1]));
}
// Is the matrix the identity matrix?
// Each operation checks whether the result is still the identity matrix and sets a flag.
inline bool wxTransformMatrix::IsIdentity1(void) const
{
return
( wxIsSameDouble(m_matrix[0][0], 1.0) &&
wxIsSameDouble(m_matrix[1][1], 1.0) &&
wxIsSameDouble(m_matrix[2][2], 1.0) &&
wxIsSameDouble(m_matrix[1][0], 0.0) &&
wxIsSameDouble(m_matrix[2][0], 0.0) &&
wxIsSameDouble(m_matrix[0][1], 0.0) &&
wxIsSameDouble(m_matrix[2][1], 0.0) &&
wxIsSameDouble(m_matrix[0][2], 0.0) &&
wxIsSameDouble(m_matrix[1][2], 0.0) );
}
// Calculates the determinant of a 2 x 2 matrix
inline double wxCalculateDet(double a11, double a21, double a12, double a22)
{
return a11 * a22 - a12 * a21;
}
#endif // _WX_MATRIXH__
| h |
rticonnextdds-usecases | data/projects/rticonnextdds-usecases/VehicleTracking/ExampleCode/thirdparty/wxWidgets-3.1.2/Win32/include/wx/custombgwin.h | ///////////////////////////////////////////////////////////////////////////////
// Name: wx/custombgwin.h
// Purpose: Class adding support for custom window backgrounds.
// Author: Vadim Zeitlin
// Created: 2011-10-10
// Copyright: (c) 2011 Vadim Zeitlin <[email protected]>
// Licence: wxWindows licence
///////////////////////////////////////////////////////////////////////////////
#ifndef _WX_CUSTOMBGWIN_H_
#define _WX_CUSTOMBGWIN_H_
#include "wx/defs.h"
class WXDLLIMPEXP_FWD_CORE wxBitmap;
// ----------------------------------------------------------------------------
// wxCustomBackgroundWindow: Adds support for custom backgrounds to any
// wxWindow-derived class.
// ----------------------------------------------------------------------------
class wxCustomBackgroundWindowBase
{
public:
// Trivial default ctor.
wxCustomBackgroundWindowBase() { }
// Also a trivial but virtual -- to suppress g++ warnings -- dtor.
virtual ~wxCustomBackgroundWindowBase() { }
// Use the given bitmap to tile the background of this window. This bitmap
// will show through any transparent children.
//
// Notice that you must not prevent the base class EVT_ERASE_BACKGROUND
// handler from running (i.e. not to handle this event yourself) for this
// to work.
void SetBackgroundBitmap(const wxBitmap& bmp)
{
DoSetBackgroundBitmap(bmp);
}
protected:
virtual void DoSetBackgroundBitmap(const wxBitmap& bmp) = 0;
wxDECLARE_NO_COPY_CLASS(wxCustomBackgroundWindowBase);
};
#if defined(__WXUNIVERSAL__)
#include "wx/univ/custombgwin.h"
#elif defined(__WXMSW__)
#include "wx/msw/custombgwin.h"
#else
#include "wx/generic/custombgwin.h"
#endif
#endif // _WX_CUSTOMBGWIN_H_
| h |
rticonnextdds-usecases | data/projects/rticonnextdds-usecases/VehicleTracking/ExampleCode/thirdparty/wxWidgets-3.1.2/Win32/include/wx/textfile.h | ///////////////////////////////////////////////////////////////////////////////
// Name: wx/textfile.h
// Purpose: class wxTextFile to work with text files of _small_ size
// (file is fully loaded in memory) and which understands CR/LF
// differences between platforms.
// Author: Vadim Zeitlin
// Modified by:
// Created: 03.04.98
// Copyright: (c) 1998 Vadim Zeitlin <[email protected]>
// Licence: wxWindows licence
///////////////////////////////////////////////////////////////////////////////
#ifndef _WX_TEXTFILE_H
#define _WX_TEXTFILE_H
#include "wx/defs.h"
#include "wx/textbuf.h"
#if wxUSE_TEXTFILE
#include "wx/file.h"
// ----------------------------------------------------------------------------
// wxTextFile
// ----------------------------------------------------------------------------
class WXDLLIMPEXP_BASE wxTextFile : public wxTextBuffer
{
public:
// constructors
wxTextFile() { }
wxTextFile(const wxString& strFileName);
protected:
// implement the base class pure virtuals
virtual bool OnExists() const wxOVERRIDE;
virtual bool OnOpen(const wxString &strBufferName,
wxTextBufferOpenMode openMode) wxOVERRIDE;
virtual bool OnClose() wxOVERRIDE;
virtual bool OnRead(const wxMBConv& conv) wxOVERRIDE;
virtual bool OnWrite(wxTextFileType typeNew, const wxMBConv& conv) wxOVERRIDE;
private:
wxFile m_file;
wxDECLARE_NO_COPY_CLASS(wxTextFile);
};
#else // !wxUSE_TEXTFILE
// old code relies on the static methods of wxTextFile being always available
// and they still are available in wxTextBuffer (even if !wxUSE_TEXTBUFFER), so
// make it possible to use them in a backwards compatible way
typedef wxTextBuffer wxTextFile;
#endif // wxUSE_TEXTFILE/!wxUSE_TEXTFILE
#endif // _WX_TEXTFILE_H
| h |
rticonnextdds-usecases | data/projects/rticonnextdds-usecases/VehicleTracking/ExampleCode/thirdparty/wxWidgets-3.1.2/Win32/include/wx/mediactrl.h | ///////////////////////////////////////////////////////////////////////////////
// Name: wx/mediactrl.h
// Purpose: wxMediaCtrl class
// Author: Ryan Norton <[email protected]>
// Modified by:
// Created: 11/07/04
// Copyright: (c) Ryan Norton
// Licence: wxWindows licence
///////////////////////////////////////////////////////////////////////////////
// ============================================================================
// Definitions
// ============================================================================
// ----------------------------------------------------------------------------
// Header guard
// ----------------------------------------------------------------------------
#ifndef _WX_MEDIACTRL_H_
#define _WX_MEDIACTRL_H_
// ----------------------------------------------------------------------------
// Pre-compiled header stuff
// ----------------------------------------------------------------------------
#include "wx/defs.h"
// ----------------------------------------------------------------------------
// Compilation guard
// ----------------------------------------------------------------------------
#if wxUSE_MEDIACTRL
// ----------------------------------------------------------------------------
// Includes
// ----------------------------------------------------------------------------
#include "wx/control.h"
#include "wx/uri.h"
// ============================================================================
// Declarations
// ============================================================================
// ----------------------------------------------------------------------------
//
// Enumerations
//
// ----------------------------------------------------------------------------
enum wxMediaState
{
wxMEDIASTATE_STOPPED,
wxMEDIASTATE_PAUSED,
wxMEDIASTATE_PLAYING
};
enum wxMediaCtrlPlayerControls
{
wxMEDIACTRLPLAYERCONTROLS_NONE = 0,
//Step controls like fastforward, step one frame etc.
wxMEDIACTRLPLAYERCONTROLS_STEP = 1 << 0,
//Volume controls like the speaker icon, volume slider, etc.
wxMEDIACTRLPLAYERCONTROLS_VOLUME = 1 << 1,
wxMEDIACTRLPLAYERCONTROLS_DEFAULT =
wxMEDIACTRLPLAYERCONTROLS_STEP |
wxMEDIACTRLPLAYERCONTROLS_VOLUME
};
#define wxMEDIABACKEND_DIRECTSHOW wxT("wxAMMediaBackend")
#define wxMEDIABACKEND_MCI wxT("wxMCIMediaBackend")
#define wxMEDIABACKEND_QUICKTIME wxT("wxQTMediaBackend")
#define wxMEDIABACKEND_GSTREAMER wxT("wxGStreamerMediaBackend")
#define wxMEDIABACKEND_REALPLAYER wxT("wxRealPlayerMediaBackend")
#define wxMEDIABACKEND_WMP10 wxT("wxWMP10MediaBackend")
// ----------------------------------------------------------------------------
//
// wxMediaEvent
//
// ----------------------------------------------------------------------------
class WXDLLIMPEXP_MEDIA wxMediaEvent : public wxNotifyEvent
{
public:
// ------------------------------------------------------------------------
// wxMediaEvent Constructor
//
// Normal constructor, much the same as wxNotifyEvent
// ------------------------------------------------------------------------
wxMediaEvent(wxEventType commandType = wxEVT_NULL, int winid = 0)
: wxNotifyEvent(commandType, winid)
{ }
// ------------------------------------------------------------------------
// wxMediaEvent Copy Constructor
//
// Normal copy constructor, much the same as wxNotifyEvent
// ------------------------------------------------------------------------
wxMediaEvent(const wxMediaEvent &clone)
: wxNotifyEvent(clone)
{ }
// ------------------------------------------------------------------------
// wxMediaEvent::Clone
//
// Allocates a copy of this object.
// Required for wxEvtHandler::AddPendingEvent
// ------------------------------------------------------------------------
virtual wxEvent *Clone() const wxOVERRIDE
{ return new wxMediaEvent(*this); }
// Put this class on wxWidget's RTTI table
wxDECLARE_DYNAMIC_CLASS(wxMediaEvent);
};
// ----------------------------------------------------------------------------
//
// wxMediaCtrl
//
// ----------------------------------------------------------------------------
class WXDLLIMPEXP_MEDIA wxMediaCtrl : public wxControl
{
public:
wxMediaCtrl() : m_imp(NULL), m_bLoaded(false)
{ }
wxMediaCtrl(wxWindow* parent, wxWindowID winid,
const wxString& fileName = wxEmptyString,
const wxPoint& pos = wxDefaultPosition,
const wxSize& size = wxDefaultSize,
long style = 0,
const wxString& szBackend = wxEmptyString,
const wxValidator& validator = wxDefaultValidator,
const wxString& name = wxT("mediaCtrl"))
: m_imp(NULL), m_bLoaded(false)
{ Create(parent, winid, fileName, pos, size, style,
szBackend, validator, name); }
wxMediaCtrl(wxWindow* parent, wxWindowID winid,
const wxURI& location,
const wxPoint& pos = wxDefaultPosition,
const wxSize& size = wxDefaultSize,
long style = 0,
const wxString& szBackend = wxEmptyString,
const wxValidator& validator = wxDefaultValidator,
const wxString& name = wxT("mediaCtrl"))
: m_imp(NULL), m_bLoaded(false)
{ Create(parent, winid, location, pos, size, style,
szBackend, validator, name); }
virtual ~wxMediaCtrl();
bool Create(wxWindow* parent, wxWindowID winid,
const wxString& fileName = wxEmptyString,
const wxPoint& pos = wxDefaultPosition,
const wxSize& size = wxDefaultSize,
long style = 0,
const wxString& szBackend = wxEmptyString,
const wxValidator& validator = wxDefaultValidator,
const wxString& name = wxT("mediaCtrl"));
bool Create(wxWindow* parent, wxWindowID winid,
const wxURI& location,
const wxPoint& pos = wxDefaultPosition,
const wxSize& size = wxDefaultSize,
long style = 0,
const wxString& szBackend = wxEmptyString,
const wxValidator& validator = wxDefaultValidator,
const wxString& name = wxT("mediaCtrl"));
bool DoCreate(const wxClassInfo* instance,
wxWindow* parent, wxWindowID winid,
const wxPoint& pos = wxDefaultPosition,
const wxSize& size = wxDefaultSize,
long style = 0,
const wxValidator& validator = wxDefaultValidator,
const wxString& name = wxT("mediaCtrl"));
bool Play();
bool Pause();
bool Stop();
bool Load(const wxString& fileName);
wxMediaState GetState();
wxFileOffset Seek(wxFileOffset where, wxSeekMode mode = wxFromStart);
wxFileOffset Tell(); //FIXME: This should be const
wxFileOffset Length(); //FIXME: This should be const
double GetPlaybackRate(); //All but MCI & GStreamer
bool SetPlaybackRate(double dRate); //All but MCI & GStreamer
bool Load(const wxURI& location);
bool Load(const wxURI& location, const wxURI& proxy);
wxFileOffset GetDownloadProgress(); // DirectShow only
wxFileOffset GetDownloadTotal(); // DirectShow only
double GetVolume();
bool SetVolume(double dVolume);
bool ShowPlayerControls(
wxMediaCtrlPlayerControls flags = wxMEDIACTRLPLAYERCONTROLS_DEFAULT);
//helpers for the wxPython people
bool LoadURI(const wxString& fileName)
{ return Load(wxURI(fileName)); }
bool LoadURIWithProxy(const wxString& fileName, const wxString& proxy)
{ return Load(wxURI(fileName), wxURI(proxy)); }
protected:
static const wxClassInfo* NextBackend(wxClassInfo::const_iterator* it);
void OnMediaFinished(wxMediaEvent& evt);
virtual void DoMoveWindow(int x, int y, int w, int h) wxOVERRIDE;
wxSize DoGetBestSize() const wxOVERRIDE;
class wxMediaBackend* m_imp;
bool m_bLoaded;
wxDECLARE_DYNAMIC_CLASS(wxMediaCtrl);
};
// ----------------------------------------------------------------------------
//
// wxMediaBackend
//
// Derive from this and use standard wxWidgets RTTI
// (wxDECLARE_DYNAMIC_CLASS and wxIMPLEMENT_CLASS) to make a backend
// for wxMediaCtrl. Backends are searched alphabetically -
// the one with the earliest letter is tried first.
//
// Note that this is currently not API or ABI compatible -
// so statically link or make the client compile on-site.
//
// ----------------------------------------------------------------------------
class WXDLLIMPEXP_MEDIA wxMediaBackend : public wxObject
{
public:
wxMediaBackend()
{ }
virtual ~wxMediaBackend();
virtual bool CreateControl(wxControl* WXUNUSED(ctrl),
wxWindow* WXUNUSED(parent),
wxWindowID WXUNUSED(winid),
const wxPoint& WXUNUSED(pos),
const wxSize& WXUNUSED(size),
long WXUNUSED(style),
const wxValidator& WXUNUSED(validator),
const wxString& WXUNUSED(name))
{ return false; }
virtual bool Play()
{ return false; }
virtual bool Pause()
{ return false; }
virtual bool Stop()
{ return false; }
virtual bool Load(const wxString& WXUNUSED(fileName))
{ return false; }
virtual bool Load(const wxURI& WXUNUSED(location))
{ return false; }
virtual bool SetPosition(wxLongLong WXUNUSED(where))
{ return 0; }
virtual wxLongLong GetPosition()
{ return 0; }
virtual wxLongLong GetDuration()
{ return 0; }
virtual void Move(int WXUNUSED(x), int WXUNUSED(y),
int WXUNUSED(w), int WXUNUSED(h))
{ }
virtual wxSize GetVideoSize() const
{ return wxSize(0,0); }
virtual double GetPlaybackRate()
{ return 0.0; }
virtual bool SetPlaybackRate(double WXUNUSED(dRate))
{ return false; }
virtual wxMediaState GetState()
{ return wxMEDIASTATE_STOPPED; }
virtual double GetVolume()
{ return 0.0; }
virtual bool SetVolume(double WXUNUSED(dVolume))
{ return false; }
virtual bool Load(const wxURI& WXUNUSED(location),
const wxURI& WXUNUSED(proxy))
{ return false; }
virtual bool ShowPlayerControls(
wxMediaCtrlPlayerControls WXUNUSED(flags))
{ return false; }
virtual bool IsInterfaceShown()
{ return false; }
virtual wxLongLong GetDownloadProgress()
{ return 0; }
virtual wxLongLong GetDownloadTotal()
{ return 0; }
virtual void MacVisibilityChanged()
{ }
virtual void RESERVED9() {}
wxDECLARE_DYNAMIC_CLASS(wxMediaBackend);
};
//Our events
wxDECLARE_EXPORTED_EVENT( WXDLLIMPEXP_MEDIA, wxEVT_MEDIA_FINISHED, wxMediaEvent );
wxDECLARE_EXPORTED_EVENT( WXDLLIMPEXP_MEDIA, wxEVT_MEDIA_STOP, wxMediaEvent );
//Function type(s) our events need
typedef void (wxEvtHandler::*wxMediaEventFunction)(wxMediaEvent&);
#define wxMediaEventHandler(func) \
wxEVENT_HANDLER_CAST(wxMediaEventFunction, func)
//Macro for usage with message maps
#define EVT_MEDIA_FINISHED(winid, fn) wxDECLARE_EVENT_TABLE_ENTRY( wxEVT_MEDIA_FINISHED, winid, wxID_ANY, wxMediaEventHandler(fn), NULL ),
#define EVT_MEDIA_STOP(winid, fn) wxDECLARE_EVENT_TABLE_ENTRY( wxEVT_MEDIA_STOP, winid, wxID_ANY, wxMediaEventHandler(fn), NULL ),
wxDECLARE_EXPORTED_EVENT( WXDLLIMPEXP_MEDIA, wxEVT_MEDIA_LOADED, wxMediaEvent );
#define EVT_MEDIA_LOADED(winid, fn) wxDECLARE_EVENT_TABLE_ENTRY( wxEVT_MEDIA_LOADED, winid, wxID_ANY, wxMediaEventHandler(fn), NULL ),
wxDECLARE_EXPORTED_EVENT( WXDLLIMPEXP_MEDIA, wxEVT_MEDIA_STATECHANGED, wxMediaEvent );
wxDECLARE_EXPORTED_EVENT( WXDLLIMPEXP_MEDIA, wxEVT_MEDIA_PLAY, wxMediaEvent );
wxDECLARE_EXPORTED_EVENT( WXDLLIMPEXP_MEDIA, wxEVT_MEDIA_PAUSE, wxMediaEvent );
#define EVT_MEDIA_STATECHANGED(winid, fn) wxDECLARE_EVENT_TABLE_ENTRY( wxEVT_MEDIA_STATECHANGED, winid, wxID_ANY, wxMediaEventHandler(fn), NULL ),
#define EVT_MEDIA_PLAY(winid, fn) wxDECLARE_EVENT_TABLE_ENTRY( wxEVT_MEDIA_PLAY, winid, wxID_ANY, wxMediaEventHandler(fn), NULL ),
#define EVT_MEDIA_PAUSE(winid, fn) wxDECLARE_EVENT_TABLE_ENTRY( wxEVT_MEDIA_PAUSE, winid, wxID_ANY, wxMediaEventHandler(fn), NULL ),
// ----------------------------------------------------------------------------
// common backend base class used by many other backends
// ----------------------------------------------------------------------------
class WXDLLIMPEXP_MEDIA wxMediaBackendCommonBase : public wxMediaBackend
{
public:
// add a pending wxMediaEvent of the given type
void QueueEvent(wxEventType evtType);
// notify that the movie playback is finished
void QueueFinishEvent()
{
QueueEvent(wxEVT_MEDIA_STATECHANGED);
QueueEvent(wxEVT_MEDIA_FINISHED);
}
// send the stop event and return true if it hasn't been vetoed
bool SendStopEvent();
// Queue pause event
void QueuePlayEvent();
// Queue pause event
void QueuePauseEvent();
// Queue stop event (no veto)
void QueueStopEvent();
protected:
// call this when the movie size has changed but not because it has just
// been loaded (in this case, call NotifyMovieLoaded() below)
void NotifyMovieSizeChanged();
// call this when the movie is fully loaded
void NotifyMovieLoaded();
wxMediaCtrl *m_ctrl; // parent control
};
// ----------------------------------------------------------------------------
// End compilation guard
// ----------------------------------------------------------------------------
#endif // wxUSE_MEDIACTRL
// ----------------------------------------------------------------------------
// End header guard and header itself
// ----------------------------------------------------------------------------
#endif // _WX_MEDIACTRL_H_
| h |
rticonnextdds-usecases | data/projects/rticonnextdds-usecases/VehicleTracking/ExampleCode/thirdparty/wxWidgets-3.1.2/Win32/include/wx/convauto.h | ///////////////////////////////////////////////////////////////////////////////
// Name: wx/convauto.h
// Purpose: wxConvAuto class declaration
// Author: Vadim Zeitlin
// Created: 2006-04-03
// Copyright: (c) 2006 Vadim Zeitlin
// Licence: wxWindows licence
///////////////////////////////////////////////////////////////////////////////
#ifndef _WX_CONVAUTO_H_
#define _WX_CONVAUTO_H_
#include "wx/strconv.h"
#include "wx/fontenc.h"
// ----------------------------------------------------------------------------
// wxConvAuto: uses BOM to automatically detect input encoding
// ----------------------------------------------------------------------------
// All currently recognized BOM values.
enum wxBOM
{
wxBOM_Unknown = -1,
wxBOM_None,
wxBOM_UTF32BE,
wxBOM_UTF32LE,
wxBOM_UTF16BE,
wxBOM_UTF16LE,
wxBOM_UTF8
};
class WXDLLIMPEXP_BASE wxConvAuto : public wxMBConv
{
public:
// default ctor, the real conversion will be created on demand
wxConvAuto(wxFontEncoding enc = wxFONTENCODING_DEFAULT)
{
Init();
m_encDefault = enc;
}
// copy ctor doesn't initialize anything neither as conversion can only be
// deduced on first use
wxConvAuto(const wxConvAuto& other) : wxMBConv()
{
Init();
m_encDefault = other.m_encDefault;
}
virtual ~wxConvAuto()
{
if ( m_ownsConv )
delete m_conv;
}
// get/set the fall-back encoding used when the input text doesn't have BOM
// and isn't UTF-8
//
// special values are wxFONTENCODING_MAX meaning not to use any fall back
// at all (but just fail to convert in this case) and wxFONTENCODING_SYSTEM
// meaning to use the encoding of the system locale
static wxFontEncoding GetFallbackEncoding() { return ms_defaultMBEncoding; }
static void SetFallbackEncoding(wxFontEncoding enc);
static void DisableFallbackEncoding()
{
SetFallbackEncoding(wxFONTENCODING_MAX);
}
// override the base class virtual function(s) to use our m_conv
virtual size_t ToWChar(wchar_t *dst, size_t dstLen,
const char *src, size_t srcLen = wxNO_LEN) const wxOVERRIDE;
virtual size_t FromWChar(char *dst, size_t dstLen,
const wchar_t *src, size_t srcLen = wxNO_LEN) const wxOVERRIDE;
virtual size_t GetMBNulLen() const wxOVERRIDE { return m_conv->GetMBNulLen(); }
virtual wxMBConv *Clone() const wxOVERRIDE { return new wxConvAuto(*this); }
// return the BOM type of this buffer
static wxBOM DetectBOM(const char *src, size_t srcLen);
// return the characters composing the given BOM.
static const char* GetBOMChars(wxBOM bomType, size_t* count);
wxBOM GetBOM() const
{
return m_bomType;
}
private:
// common part of all ctors
void Init()
{
// We don't initialize m_encDefault here as different ctors do it
// differently.
m_conv = NULL;
m_bomType = wxBOM_Unknown;
m_ownsConv = false;
m_consumedBOM = false;
}
// initialize m_conv with the UTF-8 conversion
void InitWithUTF8()
{
m_conv = &wxConvUTF8;
m_ownsConv = false;
}
// create the correct conversion object for the given BOM type
void InitFromBOM(wxBOM bomType);
// create the correct conversion object for the BOM present in the
// beginning of the buffer
//
// return false if the buffer is too short to allow us to determine if we
// have BOM or not
bool InitFromInput(const char *src, size_t len);
// adjust src and len to skip over the BOM (identified by m_bomType) at the
// start of the buffer
void SkipBOM(const char **src, size_t *len) const;
// fall-back multibyte encoding to use, may be wxFONTENCODING_SYSTEM or
// wxFONTENCODING_MAX but not wxFONTENCODING_DEFAULT
static wxFontEncoding ms_defaultMBEncoding;
// conversion object which we really use, NULL until the first call to
// either ToWChar() or FromWChar()
wxMBConv *m_conv;
// the multibyte encoding to use by default if input isn't Unicode
wxFontEncoding m_encDefault;
// our BOM type
wxBOM m_bomType;
// true if we allocated m_conv ourselves, false if we just use an existing
// global conversion
bool m_ownsConv;
// true if we already skipped BOM when converting (and not just calculating
// the size)
bool m_consumedBOM;
wxDECLARE_NO_ASSIGN_CLASS(wxConvAuto);
};
#endif // _WX_CONVAUTO_H_
| h |
rticonnextdds-usecases | data/projects/rticonnextdds-usecases/VehicleTracking/ExampleCode/thirdparty/wxWidgets-3.1.2/Win32/include/wx/cmdline.h | ///////////////////////////////////////////////////////////////////////////////
// Name: wx/cmdline.h
// Purpose: wxCmdLineParser and related classes for parsing the command
// line options
// Author: Vadim Zeitlin
// Modified by:
// Created: 04.01.00
// Copyright: (c) 2000 Vadim Zeitlin <[email protected]>
// Licence: wxWindows licence
///////////////////////////////////////////////////////////////////////////////
#ifndef _WX_CMDLINE_H_
#define _WX_CMDLINE_H_
#include "wx/defs.h"
#include "wx/string.h"
#include "wx/arrstr.h"
#include "wx/cmdargs.h"
// determines ConvertStringToArgs() behaviour
enum wxCmdLineSplitType
{
wxCMD_LINE_SPLIT_DOS,
wxCMD_LINE_SPLIT_UNIX
};
#if wxUSE_CMDLINE_PARSER
class WXDLLIMPEXP_FWD_BASE wxCmdLineParser;
class WXDLLIMPEXP_FWD_BASE wxDateTime;
// ----------------------------------------------------------------------------
// constants
// ----------------------------------------------------------------------------
// by default, options are optional (sic) and each call to AddParam() allows
// one more parameter - this may be changed by giving non-default flags to it
enum wxCmdLineEntryFlags
{
wxCMD_LINE_OPTION_MANDATORY = 0x01, // this option must be given
wxCMD_LINE_PARAM_OPTIONAL = 0x02, // the parameter may be omitted
wxCMD_LINE_PARAM_MULTIPLE = 0x04, // the parameter may be repeated
wxCMD_LINE_OPTION_HELP = 0x08, // this option is a help request
wxCMD_LINE_NEEDS_SEPARATOR = 0x10, // must have sep before the value
wxCMD_LINE_SWITCH_NEGATABLE = 0x20, // this switch can be negated (e.g. /S-)
wxCMD_LINE_HIDDEN = 0x40 // this switch is not listed by Usage()
};
// an option value or parameter may be a string (the most common case), a
// number or a date
enum wxCmdLineParamType
{
wxCMD_LINE_VAL_STRING, // should be 0 (default)
wxCMD_LINE_VAL_NUMBER,
wxCMD_LINE_VAL_DATE,
wxCMD_LINE_VAL_DOUBLE,
wxCMD_LINE_VAL_NONE
};
// for constructing the cmd line description using Init()
enum wxCmdLineEntryType
{
wxCMD_LINE_SWITCH,
wxCMD_LINE_OPTION,
wxCMD_LINE_PARAM,
wxCMD_LINE_USAGE_TEXT,
wxCMD_LINE_NONE // to terminate the list
};
// Possible return values of wxCmdLineParser::FoundSwitch()
enum wxCmdLineSwitchState
{
wxCMD_SWITCH_OFF = -1, // Found but turned off/negated.
wxCMD_SWITCH_NOT_FOUND, // Not found at all.
wxCMD_SWITCH_ON // Found in normal state.
};
// ----------------------------------------------------------------------------
// wxCmdLineEntryDesc is a description of one command line
// switch/option/parameter
// ----------------------------------------------------------------------------
struct wxCmdLineEntryDesc
{
wxCmdLineEntryType kind;
const char *shortName;
const char *longName;
const char *description;
wxCmdLineParamType type;
int flags;
};
// the list of wxCmdLineEntryDesc objects should be terminated with this one
#define wxCMD_LINE_DESC_END \
{ wxCMD_LINE_NONE, NULL, NULL, NULL, wxCMD_LINE_VAL_NONE, 0x0 }
// ----------------------------------------------------------------------------
// wxCmdLineArg contains the value for one command line argument
// ----------------------------------------------------------------------------
class WXDLLIMPEXP_BASE wxCmdLineArg
{
public:
virtual ~wxCmdLineArg() {}
virtual double GetDoubleVal() const = 0;
virtual long GetLongVal() const = 0;
virtual const wxString& GetStrVal() const = 0;
#if wxUSE_DATETIME
virtual const wxDateTime& GetDateVal() const = 0;
#endif // wxUSE_DATETIME
virtual bool IsNegated() const = 0;
virtual wxCmdLineEntryType GetKind() const = 0;
virtual wxString GetShortName() const = 0;
virtual wxString GetLongName() const = 0;
virtual wxCmdLineParamType GetType() const = 0;
};
// ----------------------------------------------------------------------------
// wxCmdLineArgs is a container of command line arguments actually parsed and
// allows enumerating them using the standard iterator-based approach.
// ----------------------------------------------------------------------------
class WXDLLIMPEXP_BASE wxCmdLineArgs
{
public:
class WXDLLIMPEXP_BASE const_iterator
{
public:
typedef int difference_type;
typedef wxCmdLineArg value_type;
typedef const wxCmdLineArg* pointer;
typedef const wxCmdLineArg& reference;
// We avoid dependency on standard library by default but if we do use
// std::string, then it's ok to use iterator tags as well.
#if wxUSE_STD_STRING
typedef std::bidirectional_iterator_tag iterator_category;
#endif // wx_USE_STD_STRING
const_iterator() : m_parser(NULL), m_index(0) {}
reference operator *() const;
pointer operator ->() const;
const_iterator &operator ++ ();
const_iterator operator ++ (int);
const_iterator &operator -- ();
const_iterator operator -- (int);
bool operator == (const const_iterator &other) const {
return m_parser==other.m_parser && m_index==other.m_index;
}
bool operator != (const const_iterator &other) const {
return !operator==(other);
}
private:
const_iterator (const wxCmdLineParser& parser, size_t index)
: m_parser(&parser), m_index(index) {
}
const wxCmdLineParser* m_parser;
size_t m_index;
friend class wxCmdLineArgs;
};
wxCmdLineArgs (const wxCmdLineParser& parser) : m_parser(parser) {}
const_iterator begin() const { return const_iterator(m_parser, 0); }
const_iterator end() const { return const_iterator(m_parser, size()); }
size_t size() const;
private:
const wxCmdLineParser& m_parser;
wxDECLARE_NO_ASSIGN_CLASS(wxCmdLineArgs);
};
// ----------------------------------------------------------------------------
// wxCmdLineParser is a class for parsing command line.
//
// It has the following features:
//
// 1. distinguishes options, switches and parameters; allows option grouping
// 2. allows both short and long options
// 3. automatically generates the usage message from the cmd line description
// 4. does type checks on the options values (number, date, ...)
//
// To use it you should:
//
// 1. construct it giving it the cmd line to parse and optionally its desc
// 2. construct the cmd line description using AddXXX() if not done in (1)
// 3. call Parse()
// 4. use GetXXX() to retrieve the parsed info
// ----------------------------------------------------------------------------
class WXDLLIMPEXP_BASE wxCmdLineParser
{
public:
// ctors and initializers
// ----------------------
// default ctor or ctor giving the cmd line in either Unix or Win form
wxCmdLineParser() { Init(); }
wxCmdLineParser(int argc, char **argv) { Init(); SetCmdLine(argc, argv); }
#if wxUSE_UNICODE
wxCmdLineParser(int argc, wxChar **argv) { Init(); SetCmdLine(argc, argv); }
wxCmdLineParser(int argc, const wxCmdLineArgsArray& argv)
{ Init(); SetCmdLine(argc, argv); }
#endif // wxUSE_UNICODE
wxCmdLineParser(const wxString& cmdline) { Init(); SetCmdLine(cmdline); }
// the same as above, but also gives the cmd line description - otherwise,
// use AddXXX() later
wxCmdLineParser(const wxCmdLineEntryDesc *desc)
{ Init(); SetDesc(desc); }
wxCmdLineParser(const wxCmdLineEntryDesc *desc, int argc, char **argv)
{ Init(); SetCmdLine(argc, argv); SetDesc(desc); }
#if wxUSE_UNICODE
wxCmdLineParser(const wxCmdLineEntryDesc *desc, int argc, wxChar **argv)
{ Init(); SetCmdLine(argc, argv); SetDesc(desc); }
wxCmdLineParser(const wxCmdLineEntryDesc *desc,
int argc,
const wxCmdLineArgsArray& argv)
{ Init(); SetCmdLine(argc, argv); SetDesc(desc); }
#endif // wxUSE_UNICODE
wxCmdLineParser(const wxCmdLineEntryDesc *desc, const wxString& cmdline)
{ Init(); SetCmdLine(cmdline); SetDesc(desc); }
// set cmd line to parse after using one of the ctors which don't do it
void SetCmdLine(int argc, char **argv);
#if wxUSE_UNICODE
void SetCmdLine(int argc, wxChar **argv);
void SetCmdLine(int argc, const wxCmdLineArgsArray& argv);
#endif // wxUSE_UNICODE
void SetCmdLine(const wxString& cmdline);
// not virtual, don't use this class polymorphically
~wxCmdLineParser();
// set different parser options
// ----------------------------
// by default, '-' is switch char under Unix, '-' or '/' under Win:
// switchChars contains all characters with which an option or switch may
// start
void SetSwitchChars(const wxString& switchChars);
// long options are not POSIX-compliant, this option allows to disable them
void EnableLongOptions(bool enable = true);
void DisableLongOptions() { EnableLongOptions(false); }
bool AreLongOptionsEnabled() const;
// extra text may be shown by Usage() method if set by this function
void SetLogo(const wxString& logo);
// construct the cmd line description
// ----------------------------------
// take the cmd line description from the wxCMD_LINE_NONE terminated table
void SetDesc(const wxCmdLineEntryDesc *desc);
// a switch: i.e. an option without value
void AddSwitch(const wxString& name, const wxString& lng = wxEmptyString,
const wxString& desc = wxEmptyString,
int flags = 0);
void AddLongSwitch(const wxString& lng,
const wxString& desc = wxEmptyString,
int flags = 0)
{
AddSwitch(wxString(), lng, desc, flags);
}
// an option taking a value of the given type
void AddOption(const wxString& name, const wxString& lng = wxEmptyString,
const wxString& desc = wxEmptyString,
wxCmdLineParamType type = wxCMD_LINE_VAL_STRING,
int flags = 0);
void AddLongOption(const wxString& lng,
const wxString& desc = wxEmptyString,
wxCmdLineParamType type = wxCMD_LINE_VAL_STRING,
int flags = 0)
{
AddOption(wxString(), lng, desc, type, flags);
}
// a parameter
void AddParam(const wxString& desc = wxEmptyString,
wxCmdLineParamType type = wxCMD_LINE_VAL_STRING,
int flags = 0);
// add an explanatory text to be shown to the user in help
void AddUsageText(const wxString& text);
// actions
// -------
// parse the command line, return 0 if ok, -1 if "-h" or "--help" option
// was encountered and the help message was given or a positive value if a
// syntax error occurred
//
// if showUsage is true, Usage() is called in case of syntax error or if
// help was requested
int Parse(bool showUsage = true);
// give the usage message describing all program options
void Usage() const;
// return the usage string, call Usage() to directly show it to the user
wxString GetUsageString() const;
// get the command line arguments
// ------------------------------
// returns true if the given switch was found
bool Found(const wxString& name) const;
// Returns wxCMD_SWITCH_NOT_FOUND if the switch was not found at all,
// wxCMD_SWITCH_ON if it was found in normal state and wxCMD_SWITCH_OFF if
// it was found but negated (i.e. followed by "-", this can only happen for
// the switches with wxCMD_LINE_SWITCH_NEGATABLE flag).
wxCmdLineSwitchState FoundSwitch(const wxString& name) const;
// returns true if an option taking a string value was found and stores the
// value in the provided pointer
bool Found(const wxString& name, wxString *value) const;
// returns true if an option taking an integer value was found and stores
// the value in the provided pointer
bool Found(const wxString& name, long *value) const;
// returns true if an option taking a double value was found and stores
// the value in the provided pointer
bool Found(const wxString& name, double *value) const;
#if wxUSE_DATETIME
// returns true if an option taking a date value was found and stores the
// value in the provided pointer
bool Found(const wxString& name, wxDateTime *value) const;
#endif // wxUSE_DATETIME
// gets the number of parameters found
size_t GetParamCount() const;
// gets the value of Nth parameter (as string only for now)
wxString GetParam(size_t n = 0u) const;
// returns a reference to the container of all command line arguments
wxCmdLineArgs GetArguments() const { return wxCmdLineArgs(*this); }
// Resets switches and options
void Reset();
// break down the command line in arguments
static wxArrayString
ConvertStringToArgs(const wxString& cmdline,
wxCmdLineSplitType type = wxCMD_LINE_SPLIT_DOS);
private:
// common part of all ctors
void Init();
struct wxCmdLineParserData *m_data;
friend class wxCmdLineArgs;
friend class wxCmdLineArgs::const_iterator;
wxDECLARE_NO_COPY_CLASS(wxCmdLineParser);
};
#else // !wxUSE_CMDLINE_PARSER
// this function is always available (even if !wxUSE_CMDLINE_PARSER) because it
// is used by wxWin itself under Windows
class WXDLLIMPEXP_BASE wxCmdLineParser
{
public:
static wxArrayString
ConvertStringToArgs(const wxString& cmdline,
wxCmdLineSplitType type = wxCMD_LINE_SPLIT_DOS);
};
#endif // wxUSE_CMDLINE_PARSER/!wxUSE_CMDLINE_PARSER
#endif // _WX_CMDLINE_H_
| h |
rticonnextdds-usecases | data/projects/rticonnextdds-usecases/VehicleTracking/ExampleCode/thirdparty/wxWidgets-3.1.2/Win32/include/wx/kbdstate.h | ///////////////////////////////////////////////////////////////////////////////
// Name: wx/kbdstate.h
// Purpose: Declaration of wxKeyboardState class
// Author: Vadim Zeitlin
// Created: 2008-09-19
// Copyright: (c) 2008 Vadim Zeitlin <[email protected]>
// Licence: wxWindows licence
///////////////////////////////////////////////////////////////////////////////
#ifndef _WX_KBDSTATE_H_
#define _WX_KBDSTATE_H_
#include "wx/defs.h"
// ----------------------------------------------------------------------------
// wxKeyboardState stores the state of the keyboard modifier keys
// ----------------------------------------------------------------------------
class WXDLLIMPEXP_CORE wxKeyboardState
{
public:
wxKeyboardState(bool controlDown = false,
bool shiftDown = false,
bool altDown = false,
bool metaDown = false)
: m_controlDown(controlDown),
m_shiftDown(shiftDown),
m_altDown(altDown),
m_metaDown(metaDown)
#ifdef __WXOSX__
,m_rawControlDown(false)
#endif
{
}
// default copy ctor, assignment operator and dtor are ok
// accessors for the various modifier keys
// ---------------------------------------
// should be used check if the key event has exactly the given modifiers:
// "GetModifiers() = wxMOD_CONTROL" is easier to write than "ControlDown()
// && !MetaDown() && !AltDown() && !ShiftDown()"
int GetModifiers() const
{
return (m_controlDown ? wxMOD_CONTROL : 0) |
(m_shiftDown ? wxMOD_SHIFT : 0) |
(m_metaDown ? wxMOD_META : 0) |
#ifdef __WXOSX__
(m_rawControlDown ? wxMOD_RAW_CONTROL : 0) |
#endif
(m_altDown ? wxMOD_ALT : 0);
}
// returns true if any modifiers at all are pressed
bool HasAnyModifiers() const { return GetModifiers() != wxMOD_NONE; }
// returns true if any modifiers changing the usual key interpretation are
// pressed, notably excluding Shift
bool HasModifiers() const
{
return ControlDown() || RawControlDown() || AltDown();
}
// accessors for individual modifier keys
bool ControlDown() const { return m_controlDown; }
bool RawControlDown() const
{
#ifdef __WXOSX__
return m_rawControlDown;
#else
return m_controlDown;
#endif
}
bool ShiftDown() const { return m_shiftDown; }
bool MetaDown() const { return m_metaDown; }
bool AltDown() const { return m_altDown; }
// "Cmd" is a pseudo key which is Control for PC and Unix platforms but
// Apple ("Command") key under Macs: it makes often sense to use it instead
// of, say, ControlDown() because Cmd key is used for the same thing under
// Mac as Ctrl elsewhere (but Ctrl still exists, just not used for this
// purpose under Mac)
bool CmdDown() const
{
return ControlDown();
}
// these functions are mostly used by wxWidgets itself
// ---------------------------------------------------
void SetControlDown(bool down) { m_controlDown = down; }
void SetRawControlDown(bool down)
{
#ifdef __WXOSX__
m_rawControlDown = down;
#else
m_controlDown = down;
#endif
}
void SetShiftDown(bool down) { m_shiftDown = down; }
void SetAltDown(bool down) { m_altDown = down; }
void SetMetaDown(bool down) { m_metaDown = down; }
// for backwards compatibility with the existing code accessing these
// members of wxKeyEvent directly, these variables are public, however you
// should not use them in any new code, please use the accessors instead
public:
bool m_controlDown : 1;
bool m_shiftDown : 1;
bool m_altDown : 1;
bool m_metaDown : 1;
#ifdef __WXOSX__
bool m_rawControlDown : 1;
#endif
};
#endif // _WX_KBDSTATE_H_
| h |
rticonnextdds-usecases | data/projects/rticonnextdds-usecases/VehicleTracking/ExampleCode/thirdparty/wxWidgets-3.1.2/Win32/include/wx/taskbarbutton.h | /////////////////////////////////////////////////////////////////////////////
// Name: include/taskbarbutton.h
// Purpose: Defines wxTaskBarButton class for manipulating buttons on the
// windows taskbar.
// Author: Chaobin Zhang <[email protected]>
// Created: 2014-04-30
// Copyright: (c) 2014 wxWidgets development team
// Licence: wxWindows licence
/////////////////////////////////////////////////////////////////////////////
#ifndef _WX_TASKBARBUTTON_H_
#define _WX_TASKBARBUTTON_H_
#include "wx/defs.h"
#if wxUSE_TASKBARBUTTON
#include "wx/icon.h"
#include "wx/string.h"
class WXDLLIMPEXP_FWD_CORE wxTaskBarButton;
class WXDLLIMPEXP_FWD_CORE wxTaskBarJumpListCategory;
class WXDLLIMPEXP_FWD_CORE wxTaskBarJumpList;
class WXDLLIMPEXP_FWD_CORE wxTaskBarJumpListImpl;
// ----------------------------------------------------------------------------
// wxTaskBarButton: define wxTaskBarButton interface.
// ----------------------------------------------------------------------------
/**
State of the task bar button.
*/
enum wxTaskBarButtonState
{
wxTASKBAR_BUTTON_NO_PROGRESS = 0,
wxTASKBAR_BUTTON_INDETERMINATE = 1,
wxTASKBAR_BUTTON_NORMAL = 2,
wxTASKBAR_BUTTON_ERROR = 4,
wxTASKBAR_BUTTON_PAUSED = 8
};
class WXDLLIMPEXP_CORE wxThumbBarButton : public wxObject
{
public:
wxThumbBarButton() : m_taskBarButtonParent(NULL)
{ }
wxThumbBarButton(int id,
const wxIcon& icon,
const wxString& tooltip = wxString(),
bool enable = true,
bool dismissOnClick = false,
bool hasBackground = true,
bool shown = true,
bool interactive = true);
bool Create(int id,
const wxIcon& icon,
const wxString& tooltip = wxString(),
bool enable = true,
bool dismissOnClick = false,
bool hasBackground = true,
bool shown = true,
bool interactive = true);
int GetID() const { return m_id; }
const wxIcon& GetIcon() const { return m_icon; }
const wxString& GetTooltip() const { return m_tooltip; }
bool IsEnable() const { return m_enable; }
void Enable(bool enable = true);
void Disable() { Enable(false); }
bool IsDismissOnClick() const { return m_dismissOnClick; }
void EnableDismissOnClick(bool enable = true);
void DisableDimissOnClick() { EnableDismissOnClick(false); }
bool HasBackground() const { return m_hasBackground; }
void SetHasBackground(bool has = true);
bool IsShown() const { return m_shown; }
void Show(bool shown = true);
void Hide() { Show(false); }
bool IsInteractive() const { return m_interactive; }
void SetInteractive(bool interactive = true);
void SetParent(wxTaskBarButton *parent) { m_taskBarButtonParent = parent; }
wxTaskBarButton* GetParent() const { return m_taskBarButtonParent; }
private:
bool UpdateParentTaskBarButton();
int m_id;
wxIcon m_icon;
wxString m_tooltip;
bool m_enable;
bool m_dismissOnClick;
bool m_hasBackground;
bool m_shown;
bool m_interactive;
wxTaskBarButton *m_taskBarButtonParent;
wxDECLARE_DYNAMIC_CLASS(wxThumbBarButton);
};
class WXDLLIMPEXP_CORE wxTaskBarButton
{
public:
// Factory function, may return NULL if task bar buttons are not supported
// by the current system.
static wxTaskBarButton* New(wxWindow* parent);
virtual ~wxTaskBarButton() { }
// Operations:
virtual void SetProgressRange(int range) = 0;
virtual void SetProgressValue(int value) = 0;
virtual void PulseProgress() = 0;
virtual void Show(bool show = true) = 0;
virtual void Hide() = 0;
virtual void SetThumbnailTooltip(const wxString& tooltip) = 0;
virtual void SetProgressState(wxTaskBarButtonState state) = 0;
virtual void SetOverlayIcon(const wxIcon& icon,
const wxString& description = wxString()) = 0;
virtual void SetThumbnailClip(const wxRect& rect) = 0;
virtual void SetThumbnailContents(const wxWindow *child) = 0;
virtual bool InsertThumbBarButton(size_t pos, wxThumbBarButton *button) = 0;
virtual bool AppendThumbBarButton(wxThumbBarButton *button) = 0;
virtual bool AppendSeparatorInThumbBar() = 0;
virtual wxThumbBarButton* RemoveThumbBarButton(wxThumbBarButton *button) = 0;
virtual wxThumbBarButton* RemoveThumbBarButton(int id) = 0;
virtual void Realize() = 0;
protected:
wxTaskBarButton() { }
private:
wxDECLARE_NO_COPY_CLASS(wxTaskBarButton);
};
enum wxTaskBarJumpListItemType
{
wxTASKBAR_JUMP_LIST_SEPARATOR,
wxTASKBAR_JUMP_LIST_TASK,
wxTASKBAR_JUMP_LIST_DESTINATION
};
class WXDLLIMPEXP_CORE wxTaskBarJumpListItem
{
public:
wxTaskBarJumpListItem(wxTaskBarJumpListCategory *parentCategory = NULL,
wxTaskBarJumpListItemType type = wxTASKBAR_JUMP_LIST_SEPARATOR,
const wxString& title = wxEmptyString,
const wxString& filePath = wxEmptyString,
const wxString& arguments = wxEmptyString,
const wxString& tooltip = wxEmptyString,
const wxString& iconPath = wxEmptyString,
int iconIndex = 0);
wxTaskBarJumpListItemType GetType() const;
void SetType(wxTaskBarJumpListItemType type);
const wxString& GetTitle() const;
void SetTitle(const wxString& title);
const wxString& GetFilePath() const;
void SetFilePath(const wxString& filePath);
const wxString& GetArguments() const;
void SetArguments(const wxString& arguments);
const wxString& GetTooltip() const;
void SetTooltip(const wxString& tooltip);
const wxString& GetIconPath() const;
void SetIconPath(const wxString& iconPath);
int GetIconIndex() const;
void SetIconIndex(int iconIndex);
wxTaskBarJumpListCategory* GetCategory() const;
void SetCategory(wxTaskBarJumpListCategory *category);
private:
wxTaskBarJumpListCategory *m_parentCategory;
wxTaskBarJumpListItemType m_type;
wxString m_title;
wxString m_filePath;
wxString m_arguments;
wxString m_tooltip;
wxString m_iconPath;
int m_iconIndex;
wxDECLARE_NO_COPY_CLASS(wxTaskBarJumpListItem);
};
typedef wxVector<wxTaskBarJumpListItem*> wxTaskBarJumpListItems;
class WXDLLIMPEXP_CORE wxTaskBarJumpListCategory
{
public:
wxTaskBarJumpListCategory(wxTaskBarJumpList *parent = NULL,
const wxString& title = wxEmptyString);
virtual ~wxTaskBarJumpListCategory();
wxTaskBarJumpListItem* Append(wxTaskBarJumpListItem *item);
void Delete(wxTaskBarJumpListItem *item);
wxTaskBarJumpListItem* Remove(wxTaskBarJumpListItem *item);
wxTaskBarJumpListItem* FindItemByPosition(size_t pos) const;
wxTaskBarJumpListItem* Insert(size_t pos, wxTaskBarJumpListItem *item);
wxTaskBarJumpListItem* Prepend(wxTaskBarJumpListItem *item);
void SetTitle(const wxString& title);
const wxString& GetTitle() const;
const wxTaskBarJumpListItems& GetItems() const;
private:
friend class wxTaskBarJumpListItem;
void Update();
wxTaskBarJumpList *m_parent;
wxTaskBarJumpListItems m_items;
wxString m_title;
wxDECLARE_NO_COPY_CLASS(wxTaskBarJumpListCategory);
};
typedef wxVector<wxTaskBarJumpListCategory*> wxTaskBarJumpListCategories;
class WXDLLIMPEXP_CORE wxTaskBarJumpList
{
public:
wxTaskBarJumpList(const wxString& appID = wxEmptyString);
virtual ~wxTaskBarJumpList();
void ShowRecentCategory(bool shown = true);
void HideRecentCategory();
void ShowFrequentCategory(bool shown = true);
void HideFrequentCategory();
wxTaskBarJumpListCategory& GetTasks() const;
const wxTaskBarJumpListCategory& GetFrequentCategory() const;
const wxTaskBarJumpListCategory& GetRecentCategory() const;
const wxTaskBarJumpListCategories& GetCustomCategories() const;
void AddCustomCategory(wxTaskBarJumpListCategory* category);
wxTaskBarJumpListCategory* RemoveCustomCategory(const wxString& title);
void DeleteCustomCategory(const wxString& title);
private:
friend class wxTaskBarJumpListCategory;
void Update();
wxTaskBarJumpListImpl *m_jumpListImpl;
wxDECLARE_NO_COPY_CLASS(wxTaskBarJumpList);
};
#endif // wxUSE_TASKBARBUTTON
#endif // _WX_TASKBARBUTTON_H_
| h |
rticonnextdds-usecases | data/projects/rticonnextdds-usecases/VehicleTracking/ExampleCode/thirdparty/wxWidgets-3.1.2/Win32/include/wx/xti2.h | /////////////////////////////////////////////////////////////////////////////
// Name: wx/wxt2.h
// Purpose: runtime metadata information (extended class info)
// Author: Stefan Csomor
// Modified by: Francesco Montorsi
// Created: 27/07/03
// Copyright: (c) 1997 Julian Smart
// (c) 2003 Stefan Csomor
/////////////////////////////////////////////////////////////////////////////
#ifndef _WX_XTI2H__
#define _WX_XTI2H__
// ----------------------------------------------------------------------------
// second part of xti headers, is included from object.h
// ----------------------------------------------------------------------------
#if wxUSE_EXTENDED_RTTI
// ----------------------------------------------------------------------------
// wxDynamicObject class, its instances connect to a 'super class instance'
// ----------------------------------------------------------------------------
class WXDLLIMPEXP_BASE wxDynamicObject : public wxObject
{
friend class WXDLLIMPEXP_FWD_BASE wxDynamicClassInfo ;
public:
// instantiates this object with an instance of its superclass
wxDynamicObject(wxObject* superClassInstance, const wxDynamicClassInfo *info) ;
virtual ~wxDynamicObject();
void SetProperty (const wxChar *propertyName, const wxAny &value);
wxAny GetProperty (const wxChar *propertyName) const ;
// get the runtime identity of this object
wxClassInfo *GetClassInfo() const
{
#ifdef _MSC_VER
return (wxClassInfo*) m_classInfo;
#else
wxDynamicClassInfo *nonconst = const_cast<wxDynamicClassInfo *>(m_classInfo);
return static_cast<wxClassInfo *>(nonconst);
#endif
}
wxObject* GetSuperClassInstance() const
{
return m_superClassInstance ;
}
private :
// removes an existing runtime-property
void RemoveProperty( const wxChar *propertyName ) ;
// renames an existing runtime-property
void RenameProperty( const wxChar *oldPropertyName , const wxChar *newPropertyName ) ;
wxObject *m_superClassInstance ;
const wxDynamicClassInfo *m_classInfo;
struct wxDynamicObjectInternal;
wxDynamicObjectInternal *m_data;
};
// ----------------------------------------------------------------------------
// String conversion templates supporting older compilers
// ----------------------------------------------------------------------------
#if wxUSE_FUNC_TEMPLATE_POINTER
# define wxTO_STRING(type) wxToStringConverter<type>
# define wxTO_STRING_IMP(type)
# define wxFROM_STRING(type) wxFromStringConverter<type>
# define wxFROM_STRING_IMP(type)
#else
# define wxTO_STRING(type) ToString##type
# define wxTO_STRING_IMP(type) \
inline void ToString##type( const wxAny& data, wxString &result ) \
{ wxToStringConverter<type>(data, result); }
# define wxFROM_STRING(type) FromString##type
# define wxFROM_STRING_IMP(type) \
inline void FromString##type( const wxString& data, wxAny &result ) \
{ wxFromStringConverter<type>(data, result); }
#endif
#include "wx/xtiprop.h"
#include "wx/xtictor.h"
// ----------------------------------------------------------------------------
// wxIMPLEMENT class macros for concrete classes
// ----------------------------------------------------------------------------
// Single inheritance with one base class
#define _DEFAULT_CONSTRUCTOR(name) \
wxObject* wxConstructorFor##name() \
{ return new name; }
#define _DEFAULT_CONVERTERS(name) \
wxObject* wxVariantOfPtrToObjectConverter##name ( const wxAny &data ) \
{ return data.As( (name**)NULL ); } \
wxAny wxObjectToVariantConverter##name ( wxObject *data ) \
{ return wxAny( wx_dynamic_cast(name*, data) ); }
#define _TYPEINFO_CLASSES(n, toString, fromString ) \
wxClassTypeInfo s_typeInfo##n(wxT_OBJECT, &n::ms_classInfo, \
toString, fromString, typeid(n).name()); \
wxClassTypeInfo s_typeInfoPtr##n(wxT_OBJECT_PTR, &n::ms_classInfo, \
toString, fromString, typeid(n*).name());
#define _IMPLEMENT_DYNAMIC_CLASS(name, basename, unit, callback) \
_DEFAULT_CONSTRUCTOR(name) \
_DEFAULT_CONVERTERS(name) \
\
const wxClassInfo* name::ms_classParents[] = \
{ &basename::ms_classInfo, NULL }; \
wxClassInfo name::ms_classInfo(name::ms_classParents, wxT(unit), \
wxT(#name), (int) sizeof(name), (wxObjectConstructorFn) wxConstructorFor##name, \
name::GetPropertiesStatic, name::GetHandlersStatic, name::ms_constructor, \
name::ms_constructorProperties, name::ms_constructorPropertiesCount, \
wxVariantOfPtrToObjectConverter##name, NULL, wxObjectToVariantConverter##name, \
callback);
#define _IMPLEMENT_DYNAMIC_CLASS_WITH_COPY(name, basename, unit, callback ) \
_DEFAULT_CONSTRUCTOR(name) \
_DEFAULT_CONVERTERS(name) \
void wxVariantToObjectConverter##name ( const wxAny &data, wxObjectFunctor* fn ) \
{ name o = data.As<name>(); (*fn)( &o ); } \
\
const wxClassInfo* name::ms_classParents[] = { &basename::ms_classInfo,NULL }; \
wxClassInfo name::ms_classInfo(name::ms_classParents, wxT(unit), \
wxT(#name), (int) sizeof(name), (wxObjectConstructorFn) wxConstructorFor##name, \
name::GetPropertiesStatic,name::GetHandlersStatic,name::ms_constructor, \
name::ms_constructorProperties, name::ms_constructorPropertiesCount, \
wxVariantOfPtrToObjectConverter##name, wxVariantToObjectConverter##name, \
wxObjectToVariantConverter##name, callback);
#define wxIMPLEMENT_DYNAMIC_CLASS_WITH_COPY( name, basename ) \
_IMPLEMENT_DYNAMIC_CLASS_WITH_COPY( name, basename, "", NULL ) \
_TYPEINFO_CLASSES(name, NULL, NULL) \
const wxPropertyInfo *name::GetPropertiesStatic() \
{ return (wxPropertyInfo*) NULL; } \
const wxHandlerInfo *name::GetHandlersStatic() \
{ return (wxHandlerInfo*) NULL; } \
wxCONSTRUCTOR_DUMMY( name )
#define wxIMPLEMENT_DYNAMIC_CLASS( name, basename ) \
_IMPLEMENT_DYNAMIC_CLASS( name, basename, "", NULL ) \
_TYPEINFO_CLASSES(name, NULL, NULL) \
wxPropertyInfo *name::GetPropertiesStatic() \
{ return (wxPropertyInfo*) NULL; } \
wxHandlerInfo *name::GetHandlersStatic() \
{ return (wxHandlerInfo*) NULL; } \
wxCONSTRUCTOR_DUMMY( name )
#define wxIMPLEMENT_DYNAMIC_CLASS_XTI( name, basename, unit ) \
_IMPLEMENT_DYNAMIC_CLASS( name, basename, unit, NULL ) \
_TYPEINFO_CLASSES(name, NULL, NULL)
#define wxIMPLEMENT_DYNAMIC_CLASS_XTI_CALLBACK( name, basename, unit, callback )\
_IMPLEMENT_DYNAMIC_CLASS( name, basename, unit, &callback ) \
_TYPEINFO_CLASSES(name, NULL, NULL)
#define wxIMPLEMENT_DYNAMIC_CLASS_WITH_COPY_XTI( name, basename, unit ) \
_IMPLEMENT_DYNAMIC_CLASS_WITH_COPY( name, basename, unit, NULL ) \
_TYPEINFO_CLASSES(name, NULL, NULL)
#define wxIMPLEMENT_DYNAMIC_CLASS_WITH_COPY_AND_STREAMERS_XTI( name, basename, \
unit, toString, \
fromString ) \
_IMPLEMENT_DYNAMIC_CLASS_WITH_COPY( name, basename, unit, NULL ) \
_TYPEINFO_CLASSES(name, toString, fromString)
// this is for classes that do not derive from wxObject, there are no creators for these
#define wxIMPLEMENT_DYNAMIC_CLASS_NO_WXOBJECT_NO_BASE_XTI( name, unit ) \
const wxClassInfo* name::ms_classParents[] = { NULL }; \
wxClassInfo name::ms_classInfo(name::ms_classParents, wxEmptyString, \
wxT(#name), (int) sizeof(name), (wxObjectConstructorFn) 0, \
name::GetPropertiesStatic,name::GetHandlersStatic, 0, 0, \
0, 0, 0 ); \
_TYPEINFO_CLASSES(name, NULL, NULL)
// this is for subclasses that still do not derive from wxObject
#define wxIMPLEMENT_DYNAMIC_CLASS_NO_WXOBJECT_XTI( name, basename, unit ) \
const wxClassInfo* name::ms_classParents[] = { &basename::ms_classInfo, NULL }; \
wxClassInfo name::ms_classInfo(name::ms_classParents, wxEmptyString, \
wxT(#name), (int) sizeof(name), (wxObjectConstructorFn) 0, \
name::GetPropertiesStatic,name::GetHandlersStatic, 0, 0, \
0, 0, 0 ); \
_TYPEINFO_CLASSES(name, NULL, NULL)
// Multiple inheritance with two base classes
#define _IMPLEMENT_DYNAMIC_CLASS2(name, basename, basename2, unit, callback) \
_DEFAULT_CONSTRUCTOR(name) \
_DEFAULT_CONVERTERS(name) \
\
const wxClassInfo* name::ms_classParents[] = \
{ &basename::ms_classInfo,&basename2::ms_classInfo, NULL }; \
wxClassInfo name::ms_classInfo(name::ms_classParents, wxT(unit), \
wxT(#name), (int) sizeof(name), (wxObjectConstructorFn) wxConstructorFor##name, \
name::GetPropertiesStatic,name::GetHandlersStatic,name::ms_constructor, \
name::ms_constructorProperties, name::ms_constructorPropertiesCount, \
wxVariantOfPtrToObjectConverter##name, NULL, wxObjectToVariantConverter##name, \
callback);
#define wxIMPLEMENT_DYNAMIC_CLASS2( name, basename, basename2) \
_IMPLEMENT_DYNAMIC_CLASS2( name, basename, basename2, "", NULL) \
_TYPEINFO_CLASSES(name, NULL, NULL) \
wxPropertyInfo *name::GetPropertiesStatic() { return (wxPropertyInfo*) NULL; } \
wxHandlerInfo *name::GetHandlersStatic() { return (wxHandlerInfo*) NULL; } \
wxCONSTRUCTOR_DUMMY( name )
#define wxIMPLEMENT_DYNAMIC_CLASS2_XTI( name, basename, basename2, unit) \
_IMPLEMENT_DYNAMIC_CLASS2( name, basename, basename2, unit, NULL) \
_TYPEINFO_CLASSES(name, NULL, NULL)
// ----------------------------------------------------------------------------
// wxIMPLEMENT class macros for abstract classes
// ----------------------------------------------------------------------------
// Single inheritance with one base class
#define _IMPLEMENT_ABSTRACT_CLASS(name, basename) \
_DEFAULT_CONVERTERS(name) \
\
const wxClassInfo* name::ms_classParents[] = \
{ &basename::ms_classInfo,NULL }; \
wxClassInfo name::ms_classInfo(name::ms_classParents, wxEmptyString, \
wxT(#name), (int) sizeof(name), (wxObjectConstructorFn) 0, \
name::GetPropertiesStatic,name::GetHandlersStatic, 0, 0, \
0, wxVariantOfPtrToObjectConverter##name,0, \
wxObjectToVariantConverter##name); \
_TYPEINFO_CLASSES(name, NULL, NULL)
#define wxIMPLEMENT_ABSTRACT_CLASS( name, basename ) \
_IMPLEMENT_ABSTRACT_CLASS( name, basename ) \
wxHandlerInfo *name::GetHandlersStatic() { return (wxHandlerInfo*) NULL; } \
wxPropertyInfo *name::GetPropertiesStatic() { return (wxPropertyInfo*) NULL; }
// Multiple inheritance with two base classes
#define wxIMPLEMENT_ABSTRACT_CLASS2(name, basename1, basename2) \
wxClassInfo name::ms_classInfo(wxT(#name), wxT(#basename1), \
wxT(#basename2), (int) sizeof(name), \
(wxObjectConstructorFn) 0);
// templated streaming, every type that can be converted to wxString
// must have their specialization for these methods
template<typename T>
void wxStringReadValue( const wxString &s, T &data );
template<typename T>
void wxStringWriteValue( wxString &s, const T &data);
template<typename T>
void wxToStringConverter( const wxAny &v, wxString &s )
{ wxStringWriteValue(s, v.As<T>()); }
template<typename T>
void wxFromStringConverter( const wxString &s, wxAny &v)
{ T d; wxStringReadValue(s, d); v = wxAny(d); }
// --------------------------------------------------------------------------
// Collection Support
// --------------------------------------------------------------------------
template<typename iter, typename collection_t > void wxListCollectionToAnyList(
const collection_t& coll, wxAnyList &value )
{
for ( iter current = coll.GetFirst(); current;
current = current->GetNext() )
{
value.Append( new wxAny(current->GetData()) );
}
}
template<typename collection_t> void wxArrayCollectionToVariantArray(
const collection_t& coll, wxAnyList &value )
{
for( size_t i = 0; i < coll.GetCount(); i++ )
{
value.Append( new wxAny(coll[i]) );
}
}
#endif
#endif // _WX_XTIH2__
| h |
rticonnextdds-usecases | data/projects/rticonnextdds-usecases/VehicleTracking/ExampleCode/thirdparty/wxWidgets-3.1.2/Win32/include/wx/thread.h | /////////////////////////////////////////////////////////////////////////////
// Name: wx/thread.h
// Purpose: Thread API
// Author: Guilhem Lavaux
// Modified by: Vadim Zeitlin (modifications partly inspired by omnithreads
// package from Olivetti & Oracle Research Laboratory)
// Created: 04/13/98
// Copyright: (c) Guilhem Lavaux
// Licence: wxWindows licence
/////////////////////////////////////////////////////////////////////////////
#ifndef _WX_THREAD_H_
#define _WX_THREAD_H_
// ----------------------------------------------------------------------------
// headers
// ----------------------------------------------------------------------------
// get the value of wxUSE_THREADS configuration flag
#include "wx/defs.h"
#if wxUSE_THREADS
// ----------------------------------------------------------------------------
// constants
// ----------------------------------------------------------------------------
enum wxMutexError
{
wxMUTEX_NO_ERROR = 0, // operation completed successfully
wxMUTEX_INVALID, // mutex hasn't been initialized
wxMUTEX_DEAD_LOCK, // mutex is already locked by the calling thread
wxMUTEX_BUSY, // mutex is already locked by another thread
wxMUTEX_UNLOCKED, // attempt to unlock a mutex which is not locked
wxMUTEX_TIMEOUT, // LockTimeout() has timed out
wxMUTEX_MISC_ERROR // any other error
};
enum wxCondError
{
wxCOND_NO_ERROR = 0,
wxCOND_INVALID,
wxCOND_TIMEOUT, // WaitTimeout() has timed out
wxCOND_MISC_ERROR
};
enum wxSemaError
{
wxSEMA_NO_ERROR = 0,
wxSEMA_INVALID, // semaphore hasn't been initialized successfully
wxSEMA_BUSY, // returned by TryWait() if Wait() would block
wxSEMA_TIMEOUT, // returned by WaitTimeout()
wxSEMA_OVERFLOW, // Post() would increase counter past the max
wxSEMA_MISC_ERROR
};
enum wxThreadError
{
wxTHREAD_NO_ERROR = 0, // No error
wxTHREAD_NO_RESOURCE, // No resource left to create a new thread
wxTHREAD_RUNNING, // The thread is already running
wxTHREAD_NOT_RUNNING, // The thread isn't running
wxTHREAD_KILLED, // Thread we waited for had to be killed
wxTHREAD_MISC_ERROR // Some other error
};
enum wxThreadKind
{
wxTHREAD_DETACHED,
wxTHREAD_JOINABLE
};
enum wxThreadWait
{
wxTHREAD_WAIT_BLOCK,
wxTHREAD_WAIT_YIELD, // process events while waiting; MSW only
// For compatibility reasons we use wxTHREAD_WAIT_YIELD by default as this
// was the default behaviour of wxMSW 2.8 but it should be avoided as it's
// dangerous and not portable.
#if WXWIN_COMPATIBILITY_2_8
wxTHREAD_WAIT_DEFAULT = wxTHREAD_WAIT_YIELD
#else
wxTHREAD_WAIT_DEFAULT = wxTHREAD_WAIT_BLOCK
#endif
};
// Obsolete synonyms for wxPRIORITY_XXX for backwards compatibility-only
enum
{
WXTHREAD_MIN_PRIORITY = wxPRIORITY_MIN,
WXTHREAD_DEFAULT_PRIORITY = wxPRIORITY_DEFAULT,
WXTHREAD_MAX_PRIORITY = wxPRIORITY_MAX
};
// There are 2 types of mutexes: normal mutexes and recursive ones. The attempt
// to lock a normal mutex by a thread which already owns it results in
// undefined behaviour (it always works under Windows, it will almost always
// result in a deadlock under Unix). Locking a recursive mutex in such
// situation always succeeds and it must be unlocked as many times as it has
// been locked.
//
// However recursive mutexes have several important drawbacks: first, in the
// POSIX implementation, they're less efficient. Second, and more importantly,
// they CAN NOT BE USED WITH CONDITION VARIABLES under Unix! Using them with
// wxCondition will work under Windows and some Unices (notably Linux) but will
// deadlock under other Unix versions (e.g. Solaris). As it might be difficult
// to ensure that a recursive mutex is not used with wxCondition, it is a good
// idea to avoid using recursive mutexes at all. Also, the last problem with
// them is that some (older) Unix versions don't support this at all -- which
// results in a configure warning when building and a deadlock when using them.
enum wxMutexType
{
// normal mutex: try to always use this one
wxMUTEX_DEFAULT,
// recursive mutex: don't use these ones with wxCondition
wxMUTEX_RECURSIVE
};
// forward declarations
class WXDLLIMPEXP_FWD_BASE wxThreadHelper;
class WXDLLIMPEXP_FWD_BASE wxConditionInternal;
class WXDLLIMPEXP_FWD_BASE wxMutexInternal;
class WXDLLIMPEXP_FWD_BASE wxSemaphoreInternal;
class WXDLLIMPEXP_FWD_BASE wxThreadInternal;
// ----------------------------------------------------------------------------
// A mutex object is a synchronization object whose state is set to signaled
// when it is not owned by any thread, and nonsignaled when it is owned. Its
// name comes from its usefulness in coordinating mutually-exclusive access to
// a shared resource. Only one thread at a time can own a mutex object.
// ----------------------------------------------------------------------------
// you should consider wxMutexLocker whenever possible instead of directly
// working with wxMutex class - it is safer
class WXDLLIMPEXP_BASE wxMutex
{
public:
// constructor & destructor
// ------------------------
// create either default (always safe) or recursive mutex
wxMutex(wxMutexType mutexType = wxMUTEX_DEFAULT);
// destroys the mutex kernel object
~wxMutex();
// test if the mutex has been created successfully
bool IsOk() const;
// mutex operations
// ----------------
// Lock the mutex, blocking on it until it is unlocked by the other thread.
// The result of locking a mutex already locked by the current thread
// depend on the mutex type.
//
// The caller must call Unlock() later if Lock() returned wxMUTEX_NO_ERROR.
wxMutexError Lock();
// Same as Lock() but return wxMUTEX_TIMEOUT if the mutex can't be locked
// during the given number of milliseconds
wxMutexError LockTimeout(unsigned long ms);
// Try to lock the mutex: if it is currently locked, return immediately
// with an error. Otherwise the caller must call Unlock().
wxMutexError TryLock();
// Unlock the mutex. It is an error to unlock an already unlocked mutex
wxMutexError Unlock();
protected:
wxMutexInternal *m_internal;
friend class wxConditionInternal;
wxDECLARE_NO_COPY_CLASS(wxMutex);
};
// a helper class which locks the mutex in the ctor and unlocks it in the dtor:
// this ensures that mutex is always unlocked, even if the function returns or
// throws an exception before it reaches the end
class WXDLLIMPEXP_BASE wxMutexLocker
{
public:
// lock the mutex in the ctor
wxMutexLocker(wxMutex& mutex)
: m_isOk(false), m_mutex(mutex)
{ m_isOk = ( m_mutex.Lock() == wxMUTEX_NO_ERROR ); }
// returns true if mutex was successfully locked in ctor
bool IsOk() const
{ return m_isOk; }
// unlock the mutex in dtor
~wxMutexLocker()
{ if ( IsOk() ) m_mutex.Unlock(); }
private:
// no assignment operator nor copy ctor
wxMutexLocker(const wxMutexLocker&);
wxMutexLocker& operator=(const wxMutexLocker&);
bool m_isOk;
wxMutex& m_mutex;
};
// ----------------------------------------------------------------------------
// Critical section: this is the same as mutex but is only visible to the
// threads of the same process. For the platforms which don't have native
// support for critical sections, they're implemented entirely in terms of
// mutexes.
//
// NB: wxCriticalSection object does not allocate any memory in its ctor
// which makes it possible to have static globals of this class
// ----------------------------------------------------------------------------
// in order to avoid any overhead under platforms where critical sections are
// just mutexes make all wxCriticalSection class functions inline
#if !defined(__WINDOWS__)
#define wxCRITSECT_IS_MUTEX 1
#define wxCRITSECT_INLINE WXEXPORT inline
#else // MSW
#define wxCRITSECT_IS_MUTEX 0
#define wxCRITSECT_INLINE
#endif // MSW/!MSW
enum wxCriticalSectionType
{
// recursive critical section
wxCRITSEC_DEFAULT,
// non-recursive critical section
wxCRITSEC_NON_RECURSIVE
};
// you should consider wxCriticalSectionLocker whenever possible instead of
// directly working with wxCriticalSection class - it is safer
class WXDLLIMPEXP_BASE wxCriticalSection
{
public:
// ctor & dtor
wxCRITSECT_INLINE wxCriticalSection( wxCriticalSectionType critSecType = wxCRITSEC_DEFAULT );
wxCRITSECT_INLINE ~wxCriticalSection();
// enter the section (the same as locking a mutex)
wxCRITSECT_INLINE void Enter();
// try to enter the section (the same as trying to lock a mutex)
wxCRITSECT_INLINE bool TryEnter();
// leave the critical section (same as unlocking a mutex)
wxCRITSECT_INLINE void Leave();
private:
#if wxCRITSECT_IS_MUTEX
wxMutex m_mutex;
#elif defined(__WINDOWS__)
// we can't allocate any memory in the ctor, so use placement new -
// unfortunately, we have to hardcode the sizeof() here because we can't
// include windows.h from this public header and we also have to use the
// union to force the correct (i.e. maximal) alignment
//
// if CRITICAL_SECTION size changes in Windows, you'll get an assert from
// thread.cpp and will need to increase the buffer size
#ifdef __WIN64__
typedef char wxCritSectBuffer[40];
#else // __WIN32__
typedef char wxCritSectBuffer[24];
#endif
union
{
unsigned long m_dummy1;
void *m_dummy2;
wxCritSectBuffer m_buffer;
};
#endif // Unix/Win32
wxDECLARE_NO_COPY_CLASS(wxCriticalSection);
};
#if wxCRITSECT_IS_MUTEX
// implement wxCriticalSection using mutexes
inline wxCriticalSection::wxCriticalSection( wxCriticalSectionType critSecType )
: m_mutex( critSecType == wxCRITSEC_DEFAULT ? wxMUTEX_RECURSIVE : wxMUTEX_DEFAULT ) { }
inline wxCriticalSection::~wxCriticalSection() { }
inline void wxCriticalSection::Enter() { (void)m_mutex.Lock(); }
inline bool wxCriticalSection::TryEnter() { return m_mutex.TryLock() == wxMUTEX_NO_ERROR; }
inline void wxCriticalSection::Leave() { (void)m_mutex.Unlock(); }
#endif // wxCRITSECT_IS_MUTEX
#undef wxCRITSECT_INLINE
#undef wxCRITSECT_IS_MUTEX
// wxCriticalSectionLocker is the same to critical sections as wxMutexLocker is
// to mutexes
class WXDLLIMPEXP_BASE wxCriticalSectionLocker
{
public:
wxCriticalSectionLocker(wxCriticalSection& cs)
: m_critsect(cs)
{
m_critsect.Enter();
}
~wxCriticalSectionLocker()
{
m_critsect.Leave();
}
private:
wxCriticalSection& m_critsect;
wxDECLARE_NO_COPY_CLASS(wxCriticalSectionLocker);
};
// ----------------------------------------------------------------------------
// wxCondition models a POSIX condition variable which allows one (or more)
// thread(s) to wait until some condition is fulfilled
// ----------------------------------------------------------------------------
class WXDLLIMPEXP_BASE wxCondition
{
public:
// Each wxCondition object is associated with a (single) wxMutex object.
// The mutex object MUST be locked before calling Wait()
wxCondition(wxMutex& mutex);
// dtor is not virtual, don't use this class polymorphically
~wxCondition();
// return true if the condition has been created successfully
bool IsOk() const;
// NB: the associated mutex MUST be locked beforehand by the calling thread
//
// it atomically releases the lock on the associated mutex
// and starts waiting to be woken up by a Signal()/Broadcast()
// once its signaled, then it will wait until it can reacquire
// the lock on the associated mutex object, before returning.
wxCondError Wait();
// std::condition_variable-like variant that evaluates the associated condition
template<typename Functor>
wxCondError Wait(const Functor& predicate)
{
while ( !predicate() )
{
wxCondError e = Wait();
if ( e != wxCOND_NO_ERROR )
return e;
}
return wxCOND_NO_ERROR;
}
// exactly as Wait() except that it may also return if the specified
// timeout elapses even if the condition hasn't been signalled: in this
// case, the return value is wxCOND_TIMEOUT, otherwise (i.e. in case of a
// normal return) it is wxCOND_NO_ERROR.
//
// the timeout parameter specifies an interval that needs to be waited for
// in milliseconds
wxCondError WaitTimeout(unsigned long milliseconds);
// NB: the associated mutex may or may not be locked by the calling thread
//
// this method unblocks one thread if any are blocking on the condition.
// if no thread is blocking in Wait(), then the signal is NOT remembered
// The thread which was blocking on Wait() will then reacquire the lock
// on the associated mutex object before returning
wxCondError Signal();
// NB: the associated mutex may or may not be locked by the calling thread
//
// this method unblocks all threads if any are blocking on the condition.
// if no thread is blocking in Wait(), then the signal is NOT remembered
// The threads which were blocking on Wait() will then reacquire the lock
// on the associated mutex object before returning.
wxCondError Broadcast();
private:
wxConditionInternal *m_internal;
wxDECLARE_NO_COPY_CLASS(wxCondition);
};
// ----------------------------------------------------------------------------
// wxSemaphore: a counter limiting the number of threads concurrently accessing
// a shared resource
// ----------------------------------------------------------------------------
class WXDLLIMPEXP_BASE wxSemaphore
{
public:
// specifying a maxcount of 0 actually makes wxSemaphore behave as if there
// is no upper limit, if maxcount is 1 the semaphore behaves as a mutex
wxSemaphore( int initialcount = 0, int maxcount = 0 );
// dtor is not virtual, don't use this class polymorphically
~wxSemaphore();
// return true if the semaphore has been created successfully
bool IsOk() const;
// wait indefinitely, until the semaphore count goes beyond 0
// and then decrement it and return (this method might have been called
// Acquire())
wxSemaError Wait();
// same as Wait(), but does not block, returns wxSEMA_NO_ERROR if
// successful and wxSEMA_BUSY if the count is currently zero
wxSemaError TryWait();
// same as Wait(), but as a timeout limit, returns wxSEMA_NO_ERROR if the
// semaphore was acquired and wxSEMA_TIMEOUT if the timeout has elapsed
wxSemaError WaitTimeout(unsigned long milliseconds);
// increments the semaphore count and signals one of the waiting threads
wxSemaError Post();
private:
wxSemaphoreInternal *m_internal;
wxDECLARE_NO_COPY_CLASS(wxSemaphore);
};
// ----------------------------------------------------------------------------
// wxThread: class encapsulating a thread of execution
// ----------------------------------------------------------------------------
// there are two different kinds of threads: joinable and detached (default)
// ones. Only joinable threads can return a return code and only detached
// threads auto-delete themselves - the user should delete the joinable
// threads manually.
// NB: in the function descriptions the words "this thread" mean the thread
// created by the wxThread object while "main thread" is the thread created
// during the process initialization (a.k.a. the GUI thread)
// On VMS thread pointers are 64 bits (also needed for other systems???
#ifdef __VMS
typedef unsigned long long wxThreadIdType;
#else
typedef unsigned long wxThreadIdType;
#endif
class WXDLLIMPEXP_BASE wxThread
{
public:
// the return type for the thread function
typedef void *ExitCode;
// static functions
// Returns the wxThread object for the calling thread. NULL is returned
// if the caller is the main thread (but it's recommended to use
// IsMain() and only call This() for threads other than the main one
// because NULL is also returned on error). If the thread wasn't
// created with wxThread class, the returned value is undefined.
static wxThread *This();
// Returns true if current thread is the main thread.
//
// Notice that it also returns true if main thread id hadn't been
// initialized yet on the assumption that it's too early in wx startup
// process for any other threads to have been created in this case.
static bool IsMain()
{
return !ms_idMainThread || GetCurrentId() == ms_idMainThread;
}
// Return the main thread id
static wxThreadIdType GetMainId() { return ms_idMainThread; }
// Release the rest of our time slice letting the other threads run
static void Yield();
// Sleep during the specified period of time in milliseconds
//
// This is the same as wxMilliSleep().
static void Sleep(unsigned long milliseconds);
// get the number of system CPUs - useful with SetConcurrency()
// (the "best" value for it is usually number of CPUs + 1)
//
// Returns -1 if unknown, number of CPUs otherwise
static int GetCPUCount();
// Get the platform specific thread ID and return as a long. This
// can be used to uniquely identify threads, even if they are not
// wxThreads. This is used by wxPython.
static wxThreadIdType GetCurrentId();
// sets the concurrency level: this is, roughly, the number of threads
// the system tries to schedule to run in parallel. 0 means the
// default value (usually acceptable, but may not yield the best
// performance for this process)
//
// Returns true on success, false otherwise (if not implemented, for
// example)
static bool SetConcurrency(size_t level);
// constructor only creates the C++ thread object and doesn't create (or
// start) the real thread
wxThread(wxThreadKind kind = wxTHREAD_DETACHED);
// functions that change the thread state: all these can only be called
// from _another_ thread (typically the thread that created this one, e.g.
// the main thread), not from the thread itself
// create a new thread and optionally set the stack size on
// platforms that support that - call Run() to start it
wxThreadError Create(unsigned int stackSize = 0);
// starts execution of the thread - from the moment Run() is called
// the execution of wxThread::Entry() may start at any moment, caller
// shouldn't suppose that it starts after (or before) Run() returns.
wxThreadError Run();
// stops the thread if it's running and deletes the wxThread object if
// this is a detached thread freeing its memory - otherwise (for
// joinable threads) you still need to delete wxThread object
// yourself.
//
// this function only works if the thread calls TestDestroy()
// periodically - the thread will only be deleted the next time it
// does it!
//
// will fill the rc pointer with the thread exit code if it's !NULL
wxThreadError Delete(ExitCode *rc = NULL,
wxThreadWait waitMode = wxTHREAD_WAIT_DEFAULT);
// waits for a joinable thread to finish and returns its exit code
//
// Returns (ExitCode)-1 on error (for example, if the thread is not
// joinable)
ExitCode Wait(wxThreadWait waitMode = wxTHREAD_WAIT_DEFAULT);
// kills the thread without giving it any chance to clean up - should
// not be used under normal circumstances, use Delete() instead.
// It is a dangerous function that should only be used in the most
// extreme cases!
//
// The wxThread object is deleted by Kill() if the thread is
// detachable, but you still have to delete it manually for joinable
// threads.
wxThreadError Kill();
// pause a running thread: as Delete(), this only works if the thread
// calls TestDestroy() regularly
wxThreadError Pause();
// resume a paused thread
wxThreadError Resume();
// priority
// Sets the priority to "prio" which must be in 0..100 range (see
// also wxPRIORITY_XXX constants).
//
// NB: under MSW the priority can only be set after the thread is
// created (but possibly before it is launched)
void SetPriority(unsigned int prio);
// Get the current priority.
unsigned int GetPriority() const;
// thread status inquiries
// Returns true if the thread is alive: i.e. running or suspended
bool IsAlive() const;
// Returns true if the thread is running (not paused, not killed).
bool IsRunning() const;
// Returns true if the thread is suspended
bool IsPaused() const;
// is the thread of detached kind?
bool IsDetached() const { return m_isDetached; }
// Get the thread ID - a platform dependent number which uniquely
// identifies a thread inside a process
wxThreadIdType GetId() const;
#ifdef __WINDOWS__
// Get the internal OS handle
WXHANDLE MSWGetHandle() const;
#endif // __WINDOWS__
wxThreadKind GetKind() const
{ return m_isDetached ? wxTHREAD_DETACHED : wxTHREAD_JOINABLE; }
// Returns true if the thread was asked to terminate: this function should
// be called by the thread from time to time, otherwise the main thread
// will be left forever in Delete()!
virtual bool TestDestroy();
// dtor is public, but the detached threads should never be deleted - use
// Delete() instead (or leave the thread terminate by itself)
virtual ~wxThread();
protected:
// exits from the current thread - can be called only from this thread
void Exit(ExitCode exitcode = 0);
// entry point for the thread - called by Run() and executes in the context
// of this thread.
virtual void *Entry() = 0;
// use this to call the Entry() virtual method
void *CallEntry();
// Callbacks which may be overridden by the derived class to perform some
// specific actions when the thread is deleted or killed. By default they
// do nothing.
// This one is called by Delete() before actually deleting the thread and
// is executed in the context of the thread that called Delete().
virtual void OnDelete() {}
// This one is called by Kill() before killing the thread and is executed
// in the context of the thread that called Kill().
virtual void OnKill() {}
private:
// no copy ctor/assignment operator
wxThread(const wxThread&);
wxThread& operator=(const wxThread&);
// called when the thread exits - in the context of this thread
//
// NB: this function will not be called if the thread is Kill()ed
virtual void OnExit() { }
friend class wxThreadInternal;
friend class wxThreadModule;
// the main thread identifier, should be set on startup
static wxThreadIdType ms_idMainThread;
// the (platform-dependent) thread class implementation
wxThreadInternal *m_internal;
// protects access to any methods of wxThreadInternal object
wxCriticalSection m_critsect;
// true if the thread is detached, false if it is joinable
bool m_isDetached;
};
// wxThreadHelperThread class
// --------------------------
class WXDLLIMPEXP_BASE wxThreadHelperThread : public wxThread
{
public:
// constructor only creates the C++ thread object and doesn't create (or
// start) the real thread
wxThreadHelperThread(wxThreadHelper& owner, wxThreadKind kind)
: wxThread(kind), m_owner(owner)
{ }
protected:
// entry point for the thread -- calls Entry() in owner.
virtual void *Entry() wxOVERRIDE;
private:
// the owner of the thread
wxThreadHelper& m_owner;
// no copy ctor/assignment operator
wxThreadHelperThread(const wxThreadHelperThread&);
wxThreadHelperThread& operator=(const wxThreadHelperThread&);
};
// ----------------------------------------------------------------------------
// wxThreadHelper: this class implements the threading logic to run a
// background task in another object (such as a window). It is a mix-in: just
// derive from it to implement a threading background task in your class.
// ----------------------------------------------------------------------------
class WXDLLIMPEXP_BASE wxThreadHelper
{
private:
void KillThread()
{
// If wxThreadHelperThread is detached and is about to finish, it will
// set m_thread to NULL so don't delete it then.
// But if KillThread is called before wxThreadHelperThread (in detached mode)
// sets it to NULL, then the thread object still exists and can be killed
wxCriticalSectionLocker locker(m_critSection);
if ( m_thread )
{
m_thread->Kill();
if ( m_kind == wxTHREAD_JOINABLE )
delete m_thread;
m_thread = NULL;
}
}
public:
// constructor only initializes m_thread to NULL
wxThreadHelper(wxThreadKind kind = wxTHREAD_JOINABLE)
: m_thread(NULL), m_kind(kind) { }
// destructor deletes m_thread
virtual ~wxThreadHelper() { KillThread(); }
#if WXWIN_COMPATIBILITY_2_8
wxDEPRECATED( wxThreadError Create(unsigned int stackSize = 0) );
#endif
// create a new thread (and optionally set the stack size on platforms that
// support/need that), call Run() to start it
wxThreadError CreateThread(wxThreadKind kind = wxTHREAD_JOINABLE,
unsigned int stackSize = 0)
{
KillThread();
m_kind = kind;
m_thread = new wxThreadHelperThread(*this, m_kind);
return m_thread->Create(stackSize);
}
// entry point for the thread - called by Run() and executes in the context
// of this thread.
virtual void *Entry() = 0;
// returns a pointer to the thread which can be used to call Run()
wxThread *GetThread() const
{
wxCriticalSectionLocker locker((wxCriticalSection&)m_critSection);
wxThread* thread = m_thread;
return thread;
}
protected:
wxThread *m_thread;
wxThreadKind m_kind;
wxCriticalSection m_critSection; // To guard the m_thread variable
friend class wxThreadHelperThread;
};
#if WXWIN_COMPATIBILITY_2_8
inline wxThreadError wxThreadHelper::Create(unsigned int stackSize)
{ return CreateThread(m_kind, stackSize); }
#endif
// call Entry() in owner, put it down here to avoid circular declarations
inline void *wxThreadHelperThread::Entry()
{
void * const result = m_owner.Entry();
wxCriticalSectionLocker locker(m_owner.m_critSection);
// Detached thread will be deleted after returning, so make sure
// wxThreadHelper::GetThread will not return an invalid pointer.
// And that wxThreadHelper::KillThread will not try to kill
// an already deleted thread
if ( m_owner.m_kind == wxTHREAD_DETACHED )
m_owner.m_thread = NULL;
return result;
}
// ----------------------------------------------------------------------------
// Automatic initialization
// ----------------------------------------------------------------------------
// GUI mutex handling.
void WXDLLIMPEXP_BASE wxMutexGuiEnter();
void WXDLLIMPEXP_BASE wxMutexGuiLeave();
// macros for entering/leaving critical sections which may be used without
// having to take them inside "#if wxUSE_THREADS"
#define wxENTER_CRIT_SECT(cs) (cs).Enter()
#define wxLEAVE_CRIT_SECT(cs) (cs).Leave()
#define wxCRIT_SECT_DECLARE(cs) static wxCriticalSection cs
#define wxCRIT_SECT_DECLARE_MEMBER(cs) wxCriticalSection cs
#define wxCRIT_SECT_LOCKER(name, cs) wxCriticalSectionLocker name(cs)
// function for checking if we're in the main thread which may be used whether
// wxUSE_THREADS is 0 or 1
inline bool wxIsMainThread() { return wxThread::IsMain(); }
#else // !wxUSE_THREADS
// no thread support
inline void wxMutexGuiEnter() { }
inline void wxMutexGuiLeave() { }
// macros for entering/leaving critical sections which may be used without
// having to take them inside "#if wxUSE_THREADS"
// (the implementation uses dummy structs to force semicolon after the macro)
#define wxENTER_CRIT_SECT(cs) do {} while (0)
#define wxLEAVE_CRIT_SECT(cs) do {} while (0)
#define wxCRIT_SECT_DECLARE(cs) struct wxDummyCS##cs
#define wxCRIT_SECT_DECLARE_MEMBER(cs) struct wxDummyCSMember##cs { }
#define wxCRIT_SECT_LOCKER(name, cs) struct wxDummyCSLocker##name
// if there is only one thread, it is always the main one
inline bool wxIsMainThread() { return true; }
#endif // wxUSE_THREADS/!wxUSE_THREADS
// mark part of code as being a critical section: this macro declares a
// critical section with the given name and enters it immediately and leaves
// it at the end of the current scope
//
// example:
//
// int Count()
// {
// static int s_counter = 0;
//
// wxCRITICAL_SECTION(counter);
//
// return ++s_counter;
// }
//
// this function is MT-safe in presence of the threads but there is no
// overhead when the library is compiled without threads
#define wxCRITICAL_SECTION(name) \
wxCRIT_SECT_DECLARE(s_cs##name); \
wxCRIT_SECT_LOCKER(cs##name##Locker, s_cs##name)
// automatically lock GUI mutex in ctor and unlock it in dtor
class WXDLLIMPEXP_BASE wxMutexGuiLocker
{
public:
wxMutexGuiLocker() { wxMutexGuiEnter(); }
~wxMutexGuiLocker() { wxMutexGuiLeave(); }
};
// -----------------------------------------------------------------------------
// implementation only until the end of file
// -----------------------------------------------------------------------------
#if wxUSE_THREADS
#if defined(__WINDOWS__) || defined(__DARWIN__)
// unlock GUI if there are threads waiting for and lock it back when
// there are no more of them - should be called periodically by the main
// thread
extern void WXDLLIMPEXP_BASE wxMutexGuiLeaveOrEnter();
// returns true if the main thread has GUI lock
extern bool WXDLLIMPEXP_BASE wxGuiOwnedByMainThread();
// wakes up the main thread if it's sleeping inside ::GetMessage()
extern void WXDLLIMPEXP_BASE wxWakeUpMainThread();
#ifndef __DARWIN__
// return true if the main thread is waiting for some other to terminate:
// wxApp then should block all "dangerous" messages
extern bool WXDLLIMPEXP_BASE wxIsWaitingForThread();
#endif
#endif // MSW, OSX
#endif // wxUSE_THREADS
#endif // _WX_THREAD_H_
| h |
rticonnextdds-usecases | data/projects/rticonnextdds-usecases/VehicleTracking/ExampleCode/thirdparty/wxWidgets-3.1.2/Win32/include/wx/lzmastream.h | ///////////////////////////////////////////////////////////////////////////////
// Name: wx/lzmastream.h
// Purpose: Filters streams using LZMA(2) compression
// Author: Vadim Zeitlin
// Created: 2018-03-29
// Copyright: (c) 2018 Vadim Zeitlin <[email protected]>
// Licence: wxWindows licence
///////////////////////////////////////////////////////////////////////////////
#ifndef _WX_LZMASTREAM_H_
#define _WX_LZMASTREAM_H_
#include "wx/defs.h"
#if wxUSE_LIBLZMA && wxUSE_STREAMS
#include "wx/stream.h"
#include "wx/versioninfo.h"
namespace wxPrivate
{
// Private wrapper for lzma_stream struct.
struct wxLZMAStream;
// Common part of input and output LZMA streams: this is just an implementation
// detail and is not part of the public API.
class WXDLLIMPEXP_BASE wxLZMAData
{
protected:
wxLZMAData();
~wxLZMAData();
wxLZMAStream* m_stream;
wxUint8* m_streamBuf;
wxFileOffset m_pos;
wxDECLARE_NO_COPY_CLASS(wxLZMAData);
};
} // namespace wxPrivate
// ----------------------------------------------------------------------------
// Filter for decompressing data compressed using LZMA
// ----------------------------------------------------------------------------
class WXDLLIMPEXP_BASE wxLZMAInputStream : public wxFilterInputStream,
private wxPrivate::wxLZMAData
{
public:
explicit wxLZMAInputStream(wxInputStream& stream)
: wxFilterInputStream(stream)
{
Init();
}
explicit wxLZMAInputStream(wxInputStream* stream)
: wxFilterInputStream(stream)
{
Init();
}
char Peek() wxOVERRIDE { return wxInputStream::Peek(); }
wxFileOffset GetLength() const wxOVERRIDE { return wxInputStream::GetLength(); }
protected:
size_t OnSysRead(void *buffer, size_t size) wxOVERRIDE;
wxFileOffset OnSysTell() const wxOVERRIDE { return m_pos; }
private:
void Init();
};
// ----------------------------------------------------------------------------
// Filter for compressing data using LZMA(2) algorithm
// ----------------------------------------------------------------------------
class WXDLLIMPEXP_BASE wxLZMAOutputStream : public wxFilterOutputStream,
private wxPrivate::wxLZMAData
{
public:
explicit wxLZMAOutputStream(wxOutputStream& stream, int level = -1)
: wxFilterOutputStream(stream)
{
Init(level);
}
explicit wxLZMAOutputStream(wxOutputStream* stream, int level = -1)
: wxFilterOutputStream(stream)
{
Init(level);
}
virtual ~wxLZMAOutputStream() { Close(); }
void Sync() wxOVERRIDE { DoFlush(false); }
bool Close() wxOVERRIDE;
wxFileOffset GetLength() const wxOVERRIDE { return m_pos; }
protected:
size_t OnSysWrite(const void *buffer, size_t size) wxOVERRIDE;
wxFileOffset OnSysTell() const wxOVERRIDE { return m_pos; }
private:
void Init(int level);
// Write the contents of the internal buffer to the output stream.
bool UpdateOutput();
// Write out the current buffer if necessary, i.e. if no space remains in
// it, and reinitialize m_stream to point to it. Returns false on success
// or false on error, in which case m_lasterror is updated.
bool UpdateOutputIfNecessary();
// Run LZMA_FINISH (if argument is true) or LZMA_FULL_FLUSH, return true on
// success or false on error.
bool DoFlush(bool finish);
};
// ----------------------------------------------------------------------------
// Support for creating LZMA streams from extension/MIME type
// ----------------------------------------------------------------------------
class WXDLLIMPEXP_BASE wxLZMAClassFactory: public wxFilterClassFactory
{
public:
wxLZMAClassFactory();
wxFilterInputStream *NewStream(wxInputStream& stream) const wxOVERRIDE
{ return new wxLZMAInputStream(stream); }
wxFilterOutputStream *NewStream(wxOutputStream& stream) const wxOVERRIDE
{ return new wxLZMAOutputStream(stream, -1); }
wxFilterInputStream *NewStream(wxInputStream *stream) const wxOVERRIDE
{ return new wxLZMAInputStream(stream); }
wxFilterOutputStream *NewStream(wxOutputStream *stream) const wxOVERRIDE
{ return new wxLZMAOutputStream(stream, -1); }
const wxChar * const *GetProtocols(wxStreamProtocolType type
= wxSTREAM_PROTOCOL) const wxOVERRIDE;
private:
wxDECLARE_DYNAMIC_CLASS(wxLZMAClassFactory);
};
WXDLLIMPEXP_BASE wxVersionInfo wxGetLibLZMAVersionInfo();
#endif // wxUSE_LIBLZMA && wxUSE_STREAMS
#endif // _WX_LZMASTREAM_H_
| h |
rticonnextdds-usecases | data/projects/rticonnextdds-usecases/VehicleTracking/ExampleCode/thirdparty/wxWidgets-3.1.2/Win32/include/wx/wxhtml.h | /////////////////////////////////////////////////////////////////////////////
// Name: wx/wxhtml.h
// Purpose: wxHTML library for wxWidgets
// Author: Vaclav Slavik
// Copyright: (c) 1999 Vaclav Slavik
// Licence: wxWindows licence
/////////////////////////////////////////////////////////////////////////////
#ifndef _WX_HTML_H_
#define _WX_HTML_H_
#include "wx/html/htmldefs.h"
#include "wx/html/htmltag.h"
#include "wx/html/htmlcell.h"
#include "wx/html/htmlpars.h"
#include "wx/html/htmlwin.h"
#include "wx/html/winpars.h"
#include "wx/filesys.h"
#include "wx/html/helpctrl.h"
#endif // __WXHTML_H__
| h |
rticonnextdds-usecases | data/projects/rticonnextdds-usecases/VehicleTracking/ExampleCode/thirdparty/wxWidgets-3.1.2/Win32/include/wx/imagpnm.h | /////////////////////////////////////////////////////////////////////////////
// Name: wx/imagpnm.h
// Purpose: wxImage PNM handler
// Author: Sylvain Bougnoux
// Copyright: (c) Sylvain Bougnoux
// Licence: wxWindows licence
/////////////////////////////////////////////////////////////////////////////
#ifndef _WX_IMAGPNM_H_
#define _WX_IMAGPNM_H_
#include "wx/image.h"
//-----------------------------------------------------------------------------
// wxPNMHandler
//-----------------------------------------------------------------------------
#if wxUSE_PNM
class WXDLLIMPEXP_CORE wxPNMHandler : public wxImageHandler
{
public:
inline wxPNMHandler()
{
m_name = wxT("PNM file");
m_extension = wxT("pnm");
m_altExtensions.Add(wxT("ppm"));
m_altExtensions.Add(wxT("pgm"));
m_altExtensions.Add(wxT("pbm"));
m_type = wxBITMAP_TYPE_PNM;
m_mime = wxT("image/pnm");
}
#if wxUSE_STREAMS
virtual bool LoadFile( wxImage *image, wxInputStream& stream, bool verbose=true, int index=-1 ) wxOVERRIDE;
virtual bool SaveFile( wxImage *image, wxOutputStream& stream, bool verbose=true ) wxOVERRIDE;
protected:
virtual bool DoCanRead( wxInputStream& stream ) wxOVERRIDE;
#endif
private:
wxDECLARE_DYNAMIC_CLASS(wxPNMHandler);
};
#endif
#endif
// _WX_IMAGPNM_H_
| h |
rticonnextdds-usecases | data/projects/rticonnextdds-usecases/VehicleTracking/ExampleCode/thirdparty/wxWidgets-3.1.2/Win32/include/wx/unichar.h | ///////////////////////////////////////////////////////////////////////////////
// Name: wx/unichar.h
// Purpose: wxUniChar and wxUniCharRef classes
// Author: Vaclav Slavik
// Created: 2007-03-19
// Copyright: (c) 2007 REA Elektronik GmbH
// Licence: wxWindows licence
///////////////////////////////////////////////////////////////////////////////
#ifndef _WX_UNICHAR_H_
#define _WX_UNICHAR_H_
#include "wx/defs.h"
#include "wx/chartype.h"
#include "wx/stringimpl.h"
// We need to get std::swap() declaration in order to specialize it below and
// it is declared in different headers for C++98 and C++11. Instead of testing
// which one is being used, just include both of them as it's simpler and less
// error-prone.
#include <algorithm> // std::swap() for C++98
#include <utility> // std::swap() for C++11
class WXDLLIMPEXP_FWD_BASE wxUniCharRef;
class WXDLLIMPEXP_FWD_BASE wxString;
// This class represents single Unicode character. It can be converted to
// and from char or wchar_t and implements commonly used character operations.
class WXDLLIMPEXP_BASE wxUniChar
{
public:
// NB: this is not wchar_t on purpose, it needs to represent the entire
// Unicode code points range and wchar_t may be too small for that
// (e.g. on Win32 where wchar_t* is encoded in UTF-16)
typedef wxUint32 value_type;
wxUniChar() : m_value(0) {}
// Create the character from 8bit character value encoded in the current
// locale's charset.
wxUniChar(char c) { m_value = From8bit(c); }
wxUniChar(unsigned char c) { m_value = From8bit((char)c); }
#define wxUNICHAR_DEFINE_CTOR(type) \
wxUniChar(type c) { m_value = (value_type)c; }
wxDO_FOR_INT_TYPES(wxUNICHAR_DEFINE_CTOR)
#undef wxUNICHAR_DEFINE_CTOR
wxUniChar(const wxUniCharRef& c);
// Returns Unicode code point value of the character
value_type GetValue() const { return m_value; }
#if wxUSE_UNICODE_UTF8
// buffer for single UTF-8 character
struct Utf8CharBuffer
{
char data[5];
operator const char*() const { return data; }
};
// returns the character encoded as UTF-8
// (NB: implemented in stringops.cpp)
Utf8CharBuffer AsUTF8() const;
#endif // wxUSE_UNICODE_UTF8
// Returns true if the character is an ASCII character:
bool IsAscii() const { return m_value < 0x80; }
// Returns true if the character is representable as a single byte in the
// current locale encoding and return this byte in output argument c (which
// must be non-NULL)
bool GetAsChar(char *c) const
{
#if wxUSE_UNICODE
if ( !IsAscii() )
{
#if !wxUSE_UTF8_LOCALE_ONLY
if ( GetAsHi8bit(m_value, c) )
return true;
#endif // !wxUSE_UTF8_LOCALE_ONLY
return false;
}
#endif // wxUSE_UNICODE
*c = wx_truncate_cast(char, m_value);
return true;
}
// Returns true if the character is a BMP character:
static bool IsBMP(wxUint32 value) { return value < 0x10000; }
// Returns true if the character is a supplementary character:
static bool IsSupplementary(wxUint32 value) { return 0x10000 <= value && value < 0x110000; }
// Returns the high surrogate code unit for the supplementary character
static wxUint16 HighSurrogate(wxUint32 value)
{
wxASSERT_MSG(IsSupplementary(value), "wxUniChar::HighSurrogate() must be called on a supplementary character");
return static_cast<wxUint16>(0xD800 | ((value - 0x10000) >> 10));
}
// Returns the low surrogate code unit for the supplementary character
static wxUint16 LowSurrogate(wxUint32 value)
{
wxASSERT_MSG(IsSupplementary(value), "wxUniChar::LowSurrogate() must be called on a supplementary character");
return static_cast<wxUint16>(0xDC00 | ((value - 0x10000) & 0x03FF));
}
// Returns true if the character is a BMP character:
bool IsBMP() const { return IsBMP(m_value); }
// Returns true if the character is a supplementary character:
bool IsSupplementary() const { return IsSupplementary(m_value); }
// Returns the high surrogate code unit for the supplementary character
wxUint16 HighSurrogate() const { return HighSurrogate(m_value); }
// Returns the low surrogate code unit for the supplementary character
wxUint16 LowSurrogate() const { return LowSurrogate(m_value); }
// Conversions to char and wchar_t types: all of those are needed to be
// able to pass wxUniChars to verious standard narrow and wide character
// functions
operator char() const { return To8bit(m_value); }
operator unsigned char() const { return (unsigned char)To8bit(m_value); }
#define wxUNICHAR_DEFINE_OPERATOR_PAREN(type) \
operator type() const { return (type)m_value; }
wxDO_FOR_INT_TYPES(wxUNICHAR_DEFINE_OPERATOR_PAREN)
#undef wxUNICHAR_DEFINE_OPERATOR_PAREN
// We need this operator for the "*p" part of expressions like "for (
// const_iterator p = begin() + nStart; *p; ++p )". In this case,
// compilation would fail without it because the conversion to bool would
// be ambiguous (there are all these int types conversions...). (And adding
// operator unspecified_bool_type() would only makes the ambiguity worse.)
operator bool() const { return m_value != 0; }
bool operator!() const { return !((bool)*this); }
// And this one is needed by some (not all, but not using ifdefs makes the
// code easier) compilers to parse "str[0] && *p" successfully
bool operator&&(bool v) const { return (bool)*this && v; }
// Assignment operators:
wxUniChar& operator=(const wxUniChar& c) { if (&c != this) m_value = c.m_value; return *this; }
wxUniChar& operator=(const wxUniCharRef& c);
wxUniChar& operator=(char c) { m_value = From8bit(c); return *this; }
wxUniChar& operator=(unsigned char c) { m_value = From8bit((char)c); return *this; }
#define wxUNICHAR_DEFINE_OPERATOR_EQUAL(type) \
wxUniChar& operator=(type c) { m_value = (value_type)c; return *this; }
wxDO_FOR_INT_TYPES(wxUNICHAR_DEFINE_OPERATOR_EQUAL)
#undef wxUNICHAR_DEFINE_OPERATOR_EQUAL
// Comparison operators:
#define wxDEFINE_UNICHAR_CMP_WITH_INT(T, op) \
bool operator op(T c) const { return m_value op (value_type)c; }
// define the given comparison operator for all the types
#define wxDEFINE_UNICHAR_OPERATOR(op) \
bool operator op(const wxUniChar& c) const { return m_value op c.m_value; }\
bool operator op(char c) const { return m_value op From8bit(c); } \
bool operator op(unsigned char c) const { return m_value op From8bit((char)c); } \
wxDO_FOR_INT_TYPES_1(wxDEFINE_UNICHAR_CMP_WITH_INT, op)
wxFOR_ALL_COMPARISONS(wxDEFINE_UNICHAR_OPERATOR)
#undef wxDEFINE_UNICHAR_OPERATOR
#undef wxDEFINE_UNCHAR_CMP_WITH_INT
// this is needed for expressions like 'Z'-c
int operator-(const wxUniChar& c) const { return m_value - c.m_value; }
int operator-(char c) const { return m_value - From8bit(c); }
int operator-(unsigned char c) const { return m_value - From8bit((char)c); }
int operator-(wchar_t c) const { return m_value - (value_type)c; }
private:
// notice that we implement these functions inline for 7-bit ASCII
// characters purely for performance reasons
static value_type From8bit(char c)
{
#if wxUSE_UNICODE
if ( (unsigned char)c < 0x80 )
return c;
return FromHi8bit(c);
#else
return c;
#endif
}
static char To8bit(value_type c)
{
#if wxUSE_UNICODE
if ( c < 0x80 )
return wx_truncate_cast(char, c);
return ToHi8bit(c);
#else
return wx_truncate_cast(char, c);
#endif
}
// helpers of the functions above called to deal with non-ASCII chars
static value_type FromHi8bit(char c);
static char ToHi8bit(value_type v);
static bool GetAsHi8bit(value_type v, char *c);
private:
value_type m_value;
};
// Writeable reference to a character in wxString.
//
// This class can be used in the same way wxChar is used, except that changing
// its value updates the underlying string object.
class WXDLLIMPEXP_BASE wxUniCharRef
{
private:
typedef wxStringImpl::iterator iterator;
// create the reference
#if wxUSE_UNICODE_UTF8
wxUniCharRef(wxString& str, iterator pos) : m_str(str), m_pos(pos) {}
#else
wxUniCharRef(iterator pos) : m_pos(pos) {}
#endif
public:
// NB: we have to make this public, because we don't have wxString
// declaration available here and so can't declare wxString::iterator
// as friend; so at least don't use a ctor but a static function
// that must be used explicitly (this is more than using 'explicit'
// keyword on ctor!):
#if wxUSE_UNICODE_UTF8
static wxUniCharRef CreateForString(wxString& str, iterator pos)
{ return wxUniCharRef(str, pos); }
#else
static wxUniCharRef CreateForString(iterator pos)
{ return wxUniCharRef(pos); }
#endif
wxUniChar::value_type GetValue() const { return UniChar().GetValue(); }
#if wxUSE_UNICODE_UTF8
wxUniChar::Utf8CharBuffer AsUTF8() const { return UniChar().AsUTF8(); }
#endif // wxUSE_UNICODE_UTF8
bool IsAscii() const { return UniChar().IsAscii(); }
bool GetAsChar(char *c) const { return UniChar().GetAsChar(c); }
bool IsBMP() const { return UniChar().IsBMP(); }
bool IsSupplementary() const { return UniChar().IsSupplementary(); }
wxUint16 HighSurrogate() const { return UniChar().HighSurrogate(); }
wxUint16 LowSurrogate() const { return UniChar().LowSurrogate(); }
// Assignment operators:
#if wxUSE_UNICODE_UTF8
wxUniCharRef& operator=(const wxUniChar& c);
#else
wxUniCharRef& operator=(const wxUniChar& c) { *m_pos = c; return *this; }
#endif
wxUniCharRef& operator=(const wxUniCharRef& c)
{ if (&c != this) *this = c.UniChar(); return *this; }
#define wxUNICHAR_REF_DEFINE_OPERATOR_EQUAL(type) \
wxUniCharRef& operator=(type c) { return *this = wxUniChar(c); }
wxDO_FOR_CHAR_INT_TYPES(wxUNICHAR_REF_DEFINE_OPERATOR_EQUAL)
#undef wxUNICHAR_REF_DEFINE_OPERATOR_EQUAL
// Conversions to the same types as wxUniChar is convertible too:
#define wxUNICHAR_REF_DEFINE_OPERATOR_PAREN(type) \
operator type() const { return UniChar(); }
wxDO_FOR_CHAR_INT_TYPES(wxUNICHAR_REF_DEFINE_OPERATOR_PAREN)
#undef wxUNICHAR_REF_DEFINE_OPERATOR_PAREN
// see wxUniChar::operator bool etc. for explanation
operator bool() const { return (bool)UniChar(); }
bool operator!() const { return !UniChar(); }
bool operator&&(bool v) const { return UniChar() && v; }
#define wxDEFINE_UNICHARREF_CMP_WITH_INT(T, op) \
bool operator op(T c) const { return UniChar() op c; }
// Comparison operators:
#define wxDEFINE_UNICHARREF_OPERATOR(op) \
bool operator op(const wxUniCharRef& c) const { return UniChar() op c.UniChar(); }\
bool operator op(const wxUniChar& c) const { return UniChar() op c; } \
wxDO_FOR_CHAR_INT_TYPES_1(wxDEFINE_UNICHARREF_CMP_WITH_INT, op)
wxFOR_ALL_COMPARISONS(wxDEFINE_UNICHARREF_OPERATOR)
#undef wxDEFINE_UNICHARREF_OPERATOR
#undef wxDEFINE_UNICHARREF_CMP_WITH_INT
// for expressions like c-'A':
int operator-(const wxUniCharRef& c) const { return UniChar() - c.UniChar(); }
int operator-(const wxUniChar& c) const { return UniChar() - c; }
int operator-(char c) const { return UniChar() - c; }
int operator-(unsigned char c) const { return UniChar() - c; }
int operator-(wchar_t c) const { return UniChar() - c; }
private:
#if wxUSE_UNICODE_UTF8
wxUniChar UniChar() const;
#else
wxUniChar UniChar() const { return *m_pos; }
#endif
friend class WXDLLIMPEXP_FWD_BASE wxUniChar;
private:
// reference to the string and pointer to the character in string
#if wxUSE_UNICODE_UTF8
wxString& m_str;
#endif
iterator m_pos;
};
inline wxUniChar::wxUniChar(const wxUniCharRef& c)
{
m_value = c.UniChar().m_value;
}
inline wxUniChar& wxUniChar::operator=(const wxUniCharRef& c)
{
m_value = c.UniChar().m_value;
return *this;
}
// wxUniCharRef doesn't behave quite like a reference, notably because template
// deduction from wxUniCharRef doesn't yield wxUniChar as would have been the
// case if it were a real reference. This results in a number of problems and
// we can't fix all of them but we can at least provide a working swap() for
// it, instead of the default version which doesn't work because a "wrong" type
// is deduced.
namespace std
{
template <>
inline
void swap<wxUniCharRef>(wxUniCharRef& lhs, wxUniCharRef& rhs)
{
if ( &lhs != &rhs )
{
// The use of wxUniChar here is the crucial difference: in the default
// implementation, tmp would be wxUniCharRef and so assigning to lhs
// would modify it too. Here we make a real copy, not affected by
// changing lhs, instead.
wxUniChar tmp = lhs;
lhs = rhs;
rhs = tmp;
}
}
} // namespace std
// Comparison operators for the case when wxUniChar(Ref) is the second operand
// implemented in terms of member comparison functions
wxDEFINE_COMPARISONS_BY_REV(char, const wxUniChar&)
wxDEFINE_COMPARISONS_BY_REV(char, const wxUniCharRef&)
wxDEFINE_COMPARISONS_BY_REV(wchar_t, const wxUniChar&)
wxDEFINE_COMPARISONS_BY_REV(wchar_t, const wxUniCharRef&)
wxDEFINE_COMPARISONS_BY_REV(const wxUniChar&, const wxUniCharRef&)
// for expressions like c-'A':
inline int operator-(char c1, const wxUniCharRef& c2) { return -(c2 - c1); }
inline int operator-(const wxUniChar& c1, const wxUniCharRef& c2) { return -(c2 - c1); }
inline int operator-(wchar_t c1, const wxUniCharRef& c2) { return -(c2 - c1); }
#endif /* _WX_UNICHAR_H_ */
| h |
rticonnextdds-usecases | data/projects/rticonnextdds-usecases/VehicleTracking/ExampleCode/thirdparty/wxWidgets-3.1.2/Win32/include/wx/mdi.h | /////////////////////////////////////////////////////////////////////////////
// Name: wx/mdi.h
// Purpose: wxMDI base header
// Author: Julian Smart (original)
// Vadim Zeitlin (base MDI classes refactoring)
// Copyright: (c) 1998 Julian Smart
// (c) 2008 Vadim Zeitlin
// Licence: wxWindows licence
/////////////////////////////////////////////////////////////////////////////
#ifndef _WX_MDI_H_BASE_
#define _WX_MDI_H_BASE_
#include "wx/defs.h"
#if wxUSE_MDI
#include "wx/frame.h"
#include "wx/menu.h"
// forward declarations
class WXDLLIMPEXP_FWD_CORE wxMDIParentFrame;
class WXDLLIMPEXP_FWD_CORE wxMDIChildFrame;
class WXDLLIMPEXP_FWD_CORE wxMDIClientWindowBase;
class WXDLLIMPEXP_FWD_CORE wxMDIClientWindow;
// ----------------------------------------------------------------------------
// wxMDIParentFrameBase: base class for parent frame for MDI children
// ----------------------------------------------------------------------------
class WXDLLIMPEXP_CORE wxMDIParentFrameBase : public wxFrame
{
public:
wxMDIParentFrameBase()
{
m_clientWindow = NULL;
m_currentChild = NULL;
#if wxUSE_MENUS
m_windowMenu = NULL;
#endif // wxUSE_MENUS
}
/*
Derived classes should provide ctor and Create() with the following
declaration:
bool Create(wxWindow *parent,
wxWindowID winid,
const wxString& title,
const wxPoint& pos = wxDefaultPosition,
const wxSize& size = wxDefaultSize,
long style = wxDEFAULT_FRAME_STYLE | wxVSCROLL | wxHSCROLL,
const wxString& name = wxFrameNameStr);
*/
#if wxUSE_MENUS
virtual ~wxMDIParentFrameBase()
{
delete m_windowMenu;
}
#endif // wxUSE_MENUS
// accessors
// ---------
// Get or change the active MDI child window
virtual wxMDIChildFrame *GetActiveChild() const
{ return m_currentChild; }
virtual void SetActiveChild(wxMDIChildFrame *child)
{ m_currentChild = child; }
// Get the client window
wxMDIClientWindowBase *GetClientWindow() const { return m_clientWindow; }
// MDI windows menu functions
// --------------------------
#if wxUSE_MENUS
// return the pointer to the current window menu or NULL if we don't have
// because of wxFRAME_NO_WINDOW_MENU style
wxMenu* GetWindowMenu() const { return m_windowMenu; }
// use the given menu instead of the default window menu
//
// menu can be NULL to disable the window menu completely
virtual void SetWindowMenu(wxMenu *menu)
{
if ( menu != m_windowMenu )
{
delete m_windowMenu;
m_windowMenu = menu;
}
}
#endif // wxUSE_MENUS
// standard MDI window management functions
// ----------------------------------------
virtual void Cascade() { }
virtual void Tile(wxOrientation WXUNUSED(orient) = wxHORIZONTAL) { }
virtual void ArrangeIcons() { }
virtual void ActivateNext() = 0;
virtual void ActivatePrevious() = 0;
/*
Derived classes must provide the following function:
static bool IsTDI();
*/
// Create the client window class (don't Create() the window here, just
// return a new object of a wxMDIClientWindow-derived class)
//
// Notice that if you override this method you should use the default
// constructor and Create() and not the constructor creating the window
// when creating the frame or your overridden version is not going to be
// called (as the call to a virtual function from ctor will be dispatched
// to this class version)
virtual wxMDIClientWindow *OnCreateClient();
protected:
// Override to pass menu/toolbar events to the active child first.
virtual bool TryBefore(wxEvent& event) wxOVERRIDE;
// This is wxMDIClientWindow for all the native implementations but not for
// the generic MDI version which has its own wxGenericMDIClientWindow and
// so we store it as just a base class pointer because we don't need its
// exact type anyhow
wxMDIClientWindowBase *m_clientWindow;
wxMDIChildFrame *m_currentChild;
#if wxUSE_MENUS
// the current window menu or NULL if we are not using it
wxMenu *m_windowMenu;
#endif // wxUSE_MENUS
};
// ----------------------------------------------------------------------------
// wxMDIChildFrameBase: child frame managed by wxMDIParentFrame
// ----------------------------------------------------------------------------
class WXDLLIMPEXP_CORE wxMDIChildFrameBase : public wxFrame
{
public:
wxMDIChildFrameBase() { m_mdiParent = NULL; }
/*
Derived classes should provide Create() with the following signature:
bool Create(wxMDIParentFrame *parent,
wxWindowID id,
const wxString& title,
const wxPoint& pos = wxDefaultPosition,
const wxSize& size = wxDefaultSize,
long style = wxDEFAULT_FRAME_STYLE,
const wxString& name = wxFrameNameStr);
And setting m_mdiParent to parent parameter.
*/
// MDI children specific methods
virtual void Activate() = 0;
// Return the MDI parent frame: notice that it may not be the same as
// GetParent() (our parent may be the client window or even its subwindow
// in some implementations)
wxMDIParentFrame *GetMDIParent() const { return m_mdiParent; }
// Synonym for GetMDIParent(), was used in some other ports
wxMDIParentFrame *GetMDIParentFrame() const { return GetMDIParent(); }
// in most ports MDI children frames are not really top-level, the only
// exception are the Mac ports in which MDI children are just normal top
// level windows too
virtual bool IsTopLevel() const wxOVERRIDE { return false; }
// In all ports keyboard navigation must stop at MDI child frame level and
// can't cross its boundary. Indicate this by overriding this function to
// return true.
virtual bool IsTopNavigationDomain(NavigationKind kind) const wxOVERRIDE
{
switch ( kind )
{
case Navigation_Tab:
return true;
case Navigation_Accel:
// Parent frame accelerators should work inside MDI child, so
// don't block their processing by returning true for them.
break;
}
return false;
}
// Raising any frame is supposed to show it but wxFrame Raise()
// implementation doesn't work for MDI child frames in most forms so
// forward this to Activate() which serves the same purpose by default.
virtual void Raise() wxOVERRIDE { Activate(); }
protected:
wxMDIParentFrame *m_mdiParent;
};
// ----------------------------------------------------------------------------
// wxTDIChildFrame: child frame used by TDI implementations
// ----------------------------------------------------------------------------
class WXDLLIMPEXP_CORE wxTDIChildFrame : public wxMDIChildFrameBase
{
public:
// override wxFrame methods for this non top-level window
#if wxUSE_STATUSBAR
// no status bars
//
// TODO: MDI children should have their own status bars, why not?
virtual wxStatusBar* CreateStatusBar(int WXUNUSED(number) = 1,
long WXUNUSED(style) = 1,
wxWindowID WXUNUSED(id) = 1,
const wxString& WXUNUSED(name)
= wxEmptyString) wxOVERRIDE
{ return NULL; }
virtual wxStatusBar *GetStatusBar() const wxOVERRIDE
{ return NULL; }
virtual void SetStatusText(const wxString &WXUNUSED(text),
int WXUNUSED(number)=0) wxOVERRIDE
{ }
virtual void SetStatusWidths(int WXUNUSED(n),
const int WXUNUSED(widths)[]) wxOVERRIDE
{ }
#endif // wxUSE_STATUSBAR
#if wxUSE_TOOLBAR
// no toolbar
//
// TODO: again, it should be possible to have tool bars
virtual wxToolBar *CreateToolBar(long WXUNUSED(style),
wxWindowID WXUNUSED(id),
const wxString& WXUNUSED(name)) wxOVERRIDE
{ return NULL; }
virtual wxToolBar *GetToolBar() const wxOVERRIDE { return NULL; }
#endif // wxUSE_TOOLBAR
// no icon
virtual void SetIcons(const wxIconBundle& WXUNUSED(icons)) wxOVERRIDE { }
// title is used as the tab label
virtual wxString GetTitle() const wxOVERRIDE { return m_title; }
virtual void SetTitle(const wxString& title) wxOVERRIDE = 0;
// no maximize etc
virtual void Maximize(bool WXUNUSED(maximize) = true) wxOVERRIDE { }
virtual bool IsMaximized() const wxOVERRIDE { return true; }
virtual bool IsAlwaysMaximized() const wxOVERRIDE { return true; }
virtual void Iconize(bool WXUNUSED(iconize) = true) wxOVERRIDE { }
virtual bool IsIconized() const wxOVERRIDE { return false; }
virtual void Restore() wxOVERRIDE { }
virtual bool ShowFullScreen(bool WXUNUSED(show),
long WXUNUSED(style)) wxOVERRIDE { return false; }
virtual bool IsFullScreen() const wxOVERRIDE { return false; }
// we need to override these functions to ensure that a child window is
// created even though we derive from wxFrame -- basically we make it
// behave as just a wxWindow by short-circuiting wxTLW changes to the base
// class behaviour
virtual void AddChild(wxWindowBase *child) wxOVERRIDE { wxWindow::AddChild(child); }
virtual bool Destroy() wxOVERRIDE { return wxWindow::Destroy(); }
// extra platform-specific hacks
#ifdef __WXMSW__
virtual WXDWORD MSWGetStyle(long flags, WXDWORD *exstyle = NULL) const wxOVERRIDE
{
return wxWindow::MSWGetStyle(flags, exstyle);
}
virtual WXHWND MSWGetParent() const wxOVERRIDE
{
return wxWindow::MSWGetParent();
}
WXLRESULT MSWWindowProc(WXUINT message, WXWPARAM wParam, WXLPARAM lParam) wxOVERRIDE
{
return wxWindow::MSWWindowProc(message, wParam, lParam);
}
#endif // __WXMSW__
protected:
virtual void DoGetSize(int *width, int *height) const wxOVERRIDE
{
wxWindow::DoGetSize(width, height);
}
virtual void DoSetSize(int x, int y, int width, int height, int sizeFlags) wxOVERRIDE
{
wxWindow::DoSetSize(x, y, width, height, sizeFlags);
}
virtual void DoGetClientSize(int *width, int *height) const wxOVERRIDE
{
wxWindow::DoGetClientSize(width, height);
}
virtual void DoSetClientSize(int width, int height) wxOVERRIDE
{
wxWindow::DoSetClientSize(width, height);
}
virtual void DoMoveWindow(int x, int y, int width, int height) wxOVERRIDE
{
wxWindow::DoMoveWindow(x, y, width, height);
}
// no size hints
virtual void DoSetSizeHints(int WXUNUSED(minW), int WXUNUSED(minH),
int WXUNUSED(maxW), int WXUNUSED(maxH),
int WXUNUSED(incW), int WXUNUSED(incH)) wxOVERRIDE { }
wxString m_title;
};
// ----------------------------------------------------------------------------
// wxMDIClientWindowBase: child of parent frame, parent of children frames
// ----------------------------------------------------------------------------
class WXDLLIMPEXP_CORE wxMDIClientWindowBase : public wxWindow
{
public:
/*
The derived class must provide the default ctor only (CreateClient()
will be called later).
*/
// Can be overridden in the derived classes but the base class version must
// be usually called first to really create the client window.
virtual bool CreateClient(wxMDIParentFrame *parent,
long style = wxVSCROLL | wxHSCROLL) = 0;
};
// ----------------------------------------------------------------------------
// Include the port-specific implementation of the base classes defined above
// ----------------------------------------------------------------------------
// wxUSE_GENERIC_MDI_AS_NATIVE may be predefined to force the generic MDI
// implementation use even on the platforms which usually don't use it
//
// notice that generic MDI can still be used without this, but you would need
// to explicitly use wxGenericMDIXXX classes in your code (and currently also
// add src/generic/mdig.cpp to your build as it's not compiled in if generic
// MDI is not used by default -- but this may change later...)
#ifndef wxUSE_GENERIC_MDI_AS_NATIVE
// wxUniv always uses the generic MDI implementation and so do the ports
// without native version (although wxCocoa seems to have one -- but it's
// probably not functional?)
#if defined(__WXMOTIF__) || \
defined(__WXUNIVERSAL__)
#define wxUSE_GENERIC_MDI_AS_NATIVE 1
#else
#define wxUSE_GENERIC_MDI_AS_NATIVE 0
#endif
#endif // wxUSE_GENERIC_MDI_AS_NATIVE
#if wxUSE_GENERIC_MDI_AS_NATIVE
#include "wx/generic/mdig.h"
#elif defined(__WXMSW__)
#include "wx/msw/mdi.h"
#elif defined(__WXGTK20__)
#include "wx/gtk/mdi.h"
#elif defined(__WXGTK__)
#include "wx/gtk1/mdi.h"
#elif defined(__WXMAC__)
#include "wx/osx/mdi.h"
#elif defined(__WXQT__)
#include "wx/qt/mdi.h"
#endif
inline wxMDIClientWindow *wxMDIParentFrameBase::OnCreateClient()
{
return new wxMDIClientWindow;
}
inline bool wxMDIParentFrameBase::TryBefore(wxEvent& event)
{
// Menu (and toolbar) events should be sent to the active child frame
// first, if any.
if ( event.GetEventType() == wxEVT_MENU ||
event.GetEventType() == wxEVT_UPDATE_UI )
{
wxMDIChildFrame * const child = GetActiveChild();
if ( child )
{
// However avoid sending the event back to the child if it's
// currently being propagated to us from it.
wxWindow* const
from = static_cast<wxWindow*>(event.GetPropagatedFrom());
if ( !from || !from->IsDescendant(child) )
{
if ( child->ProcessWindowEventLocally(event) )
return true;
}
}
}
return wxFrame::TryBefore(event);
}
#endif // wxUSE_MDI
#endif // _WX_MDI_H_BASE_
| h |
rticonnextdds-usecases | data/projects/rticonnextdds-usecases/VehicleTracking/ExampleCode/thirdparty/wxWidgets-3.1.2/Win32/include/wx/memconf.h | ///////////////////////////////////////////////////////////////////////////////
// Name: wx/memconf.h
// Purpose: wxMemoryConfig class: a wxConfigBase implementation which only
// stores the settings in memory (thus they are lost when the
// program terminates)
// Author: Vadim Zeitlin
// Modified by:
// Created: 22.01.00
// Copyright: (c) 2000 Vadim Zeitlin <[email protected]>
// Licence: wxWindows licence
///////////////////////////////////////////////////////////////////////////////
/*
* NB: I don't see how this class may possibly be useful to the application
* program (as the settings are lost on program termination), but it is
* handy to have it inside wxWidgets. So for now let's say that this class
* is private and should only be used by wxWidgets itself - this might
* change in the future.
*/
#ifndef _WX_MEMCONF_H_
#define _WX_MEMCONF_H_
#if wxUSE_CONFIG
#include "wx/fileconf.h" // the base class
// ----------------------------------------------------------------------------
// wxMemoryConfig: a config class which stores settings in non-persistent way
// ----------------------------------------------------------------------------
// notice that we inherit from wxFileConfig which already stores its data in
// memory and just disable file reading/writing - this is probably not optimal
// and might be changed in future as well (this class will always deriev from
// wxConfigBase though)
class wxMemoryConfig : public wxFileConfig
{
public:
// default (and only) ctor
wxMemoryConfig() : wxFileConfig(wxEmptyString, // default app name
wxEmptyString, // default vendor name
wxEmptyString, // no local config file
wxEmptyString, // no system config file
0) // don't use any files
{
}
wxDECLARE_NO_COPY_CLASS(wxMemoryConfig);
};
#endif // wxUSE_CONFIG
#endif // _WX_MEMCONF_H_
| h |
rticonnextdds-usecases | data/projects/rticonnextdds-usecases/VehicleTracking/ExampleCode/thirdparty/wxWidgets-3.1.2/Win32/include/wx/valtext.h | /////////////////////////////////////////////////////////////////////////////
// Name: wx/valtext.h
// Purpose: wxTextValidator class
// Author: Julian Smart
// Modified by: Francesco Montorsi
// Created: 29/01/98
// Copyright: (c) 1998 Julian Smart
// Licence: wxWindows licence
/////////////////////////////////////////////////////////////////////////////
#ifndef _WX_VALTEXT_H_
#define _WX_VALTEXT_H_
#include "wx/defs.h"
#if wxUSE_VALIDATORS && (wxUSE_TEXTCTRL || wxUSE_COMBOBOX)
class WXDLLIMPEXP_FWD_CORE wxTextEntry;
#include "wx/validate.h"
enum wxTextValidatorStyle
{
wxFILTER_NONE = 0x0,
wxFILTER_EMPTY = 0x1,
wxFILTER_ASCII = 0x2,
wxFILTER_ALPHA = 0x4,
wxFILTER_ALPHANUMERIC = 0x8,
wxFILTER_DIGITS = 0x10,
wxFILTER_NUMERIC = 0x20,
wxFILTER_INCLUDE_LIST = 0x40,
wxFILTER_INCLUDE_CHAR_LIST = 0x80,
wxFILTER_EXCLUDE_LIST = 0x100,
wxFILTER_EXCLUDE_CHAR_LIST = 0x200
};
class WXDLLIMPEXP_CORE wxTextValidator: public wxValidator
{
public:
wxTextValidator(long style = wxFILTER_NONE, wxString *val = NULL);
wxTextValidator(const wxTextValidator& val);
virtual ~wxTextValidator(){}
// Make a clone of this validator (or return NULL) - currently necessary
// if you're passing a reference to a validator.
// Another possibility is to always pass a pointer to a new validator
// (so the calling code can use a copy constructor of the relevant class).
virtual wxObject *Clone() const wxOVERRIDE { return new wxTextValidator(*this); }
bool Copy(const wxTextValidator& val);
// Called when the value in the window must be validated.
// This function can pop up an error message.
virtual bool Validate(wxWindow *parent) wxOVERRIDE;
// Called to transfer data to the window
virtual bool TransferToWindow() wxOVERRIDE;
// Called to transfer data from the window
virtual bool TransferFromWindow() wxOVERRIDE;
// Filter keystrokes
void OnChar(wxKeyEvent& event);
// ACCESSORS
inline long GetStyle() const { return m_validatorStyle; }
void SetStyle(long style);
wxTextEntry *GetTextEntry();
void SetCharIncludes(const wxString& chars);
void SetIncludes(const wxArrayString& includes) { m_includes = includes; }
inline wxArrayString& GetIncludes() { return m_includes; }
void SetCharExcludes(const wxString& chars);
void SetExcludes(const wxArrayString& excludes) { m_excludes = excludes; }
inline wxArrayString& GetExcludes() { return m_excludes; }
bool HasFlag(wxTextValidatorStyle style) const
{ return (m_validatorStyle & style) != 0; }
protected:
// returns true if all characters of the given string are present in m_includes
bool ContainsOnlyIncludedCharacters(const wxString& val) const;
// returns true if at least one character of the given string is present in m_excludes
bool ContainsExcludedCharacters(const wxString& val) const;
// returns the error message if the contents of 'val' are invalid
virtual wxString IsValid(const wxString& val) const;
protected:
long m_validatorStyle;
wxString* m_stringValue;
wxArrayString m_includes;
wxArrayString m_excludes;
private:
wxDECLARE_NO_ASSIGN_CLASS(wxTextValidator);
wxDECLARE_DYNAMIC_CLASS(wxTextValidator);
wxDECLARE_EVENT_TABLE();
};
#endif
// wxUSE_VALIDATORS && (wxUSE_TEXTCTRL || wxUSE_COMBOBOX)
#endif // _WX_VALTEXT_H_
| h |
rticonnextdds-usecases | data/projects/rticonnextdds-usecases/VehicleTracking/ExampleCode/thirdparty/wxWidgets-3.1.2/Win32/include/wx/xpmdecod.h | /////////////////////////////////////////////////////////////////////////////
// Name: wx/xpmdecod.h
// Purpose: wxXPMDecoder, XPM reader for wxImage and wxBitmap
// Author: Vaclav Slavik
// Copyright: (c) 2001 Vaclav Slavik
// Licence: wxWindows licence
/////////////////////////////////////////////////////////////////////////////
#ifndef _WX_XPMDECOD_H_
#define _WX_XPMDECOD_H_
#include "wx/defs.h"
#if wxUSE_IMAGE && wxUSE_XPM
class WXDLLIMPEXP_FWD_CORE wxImage;
class WXDLLIMPEXP_FWD_BASE wxInputStream;
// --------------------------------------------------------------------------
// wxXPMDecoder class
// --------------------------------------------------------------------------
class WXDLLIMPEXP_CORE wxXPMDecoder
{
public:
// constructor, destructor, etc.
wxXPMDecoder() {}
~wxXPMDecoder() {}
#if wxUSE_STREAMS
// Is the stream XPM file?
// NOTE: this function modifies the current stream position
bool CanRead(wxInputStream& stream);
// Read XPM file from the stream, parse it and create image from it
wxImage ReadFile(wxInputStream& stream);
#endif
// Read directly from XPM data (as passed to wxBitmap ctor):
wxImage ReadData(const char* const* xpm_data);
#ifdef __BORLANDC__
// needed for Borland 5.5
wxImage ReadData(char** xpm_data)
{ return ReadData(const_cast<const char* const*>(xpm_data)); }
#endif
};
#endif // wxUSE_IMAGE && wxUSE_XPM
#endif // _WX_XPM_H_
| h |
rticonnextdds-usecases | data/projects/rticonnextdds-usecases/VehicleTracking/ExampleCode/thirdparty/wxWidgets-3.1.2/Win32/include/wx/dcmirror.h | ///////////////////////////////////////////////////////////////////////////////
// Name: wx/dcmirror.h
// Purpose: wxMirrorDC class
// Author: Vadim Zeitlin
// Modified by:
// Created: 21.07.2003
// Copyright: (c) 2003 Vadim Zeitlin <[email protected]>
// Licence: wxWindows licence
///////////////////////////////////////////////////////////////////////////////
#ifndef _WX_DCMIRROR_H_
#define _WX_DCMIRROR_H_
#include "wx/dc.h"
// ----------------------------------------------------------------------------
// wxMirrorDC allows to write the same code for horz/vertical layout
// ----------------------------------------------------------------------------
class WXDLLIMPEXP_CORE wxMirrorDCImpl : public wxDCImpl
{
public:
// constructs a mirror DC associated with the given real DC
//
// if mirror parameter is true, all vertical and horizontal coordinates are
// exchanged, otherwise this class behaves in exactly the same way as a
// plain DC
wxMirrorDCImpl(wxDC *owner, wxDCImpl& dc, bool mirror)
: wxDCImpl(owner),
m_dc(dc)
{
m_mirror = mirror;
}
// wxDCBase operations
virtual void Clear() wxOVERRIDE { m_dc.Clear(); }
virtual void SetFont(const wxFont& font) wxOVERRIDE { m_dc.SetFont(font); }
virtual void SetPen(const wxPen& pen) wxOVERRIDE { m_dc.SetPen(pen); }
virtual void SetBrush(const wxBrush& brush) wxOVERRIDE { m_dc.SetBrush(brush); }
virtual void SetBackground(const wxBrush& brush) wxOVERRIDE
{ m_dc.SetBackground(brush); }
virtual void SetBackgroundMode(int mode) wxOVERRIDE { m_dc.SetBackgroundMode(mode); }
#if wxUSE_PALETTE
virtual void SetPalette(const wxPalette& palette) wxOVERRIDE
{ m_dc.SetPalette(palette); }
#endif // wxUSE_PALETTE
virtual void DestroyClippingRegion() wxOVERRIDE { m_dc.DestroyClippingRegion(); }
virtual wxCoord GetCharHeight() const wxOVERRIDE { return m_dc.GetCharHeight(); }
virtual wxCoord GetCharWidth() const wxOVERRIDE { return m_dc.GetCharWidth(); }
virtual bool CanDrawBitmap() const wxOVERRIDE { return m_dc.CanDrawBitmap(); }
virtual bool CanGetTextExtent() const wxOVERRIDE { return m_dc.CanGetTextExtent(); }
virtual int GetDepth() const wxOVERRIDE { return m_dc.GetDepth(); }
virtual wxSize GetPPI() const wxOVERRIDE { return m_dc.GetPPI(); }
virtual bool IsOk() const wxOVERRIDE { return m_dc.IsOk(); }
virtual void SetMapMode(wxMappingMode mode) wxOVERRIDE { m_dc.SetMapMode(mode); }
virtual void SetUserScale(double x, double y) wxOVERRIDE
{ m_dc.SetUserScale(GetX(x, y), GetY(x, y)); }
virtual void SetLogicalOrigin(wxCoord x, wxCoord y) wxOVERRIDE
{ m_dc.SetLogicalOrigin(GetX(x, y), GetY(x, y)); }
virtual void SetDeviceOrigin(wxCoord x, wxCoord y) wxOVERRIDE
{ m_dc.SetDeviceOrigin(GetX(x, y), GetY(x, y)); }
virtual void SetAxisOrientation(bool xLeftRight, bool yBottomUp) wxOVERRIDE
{ m_dc.SetAxisOrientation(GetX(xLeftRight, yBottomUp),
GetY(xLeftRight, yBottomUp)); }
virtual void SetLogicalFunction(wxRasterOperationMode function) wxOVERRIDE
{ m_dc.SetLogicalFunction(function); }
virtual void* GetHandle() const wxOVERRIDE
{ return m_dc.GetHandle(); }
protected:
// returns x and y if not mirroring or y and x if mirroring
wxCoord GetX(wxCoord x, wxCoord y) const { return m_mirror ? y : x; }
wxCoord GetY(wxCoord x, wxCoord y) const { return m_mirror ? x : y; }
double GetX(double x, double y) const { return m_mirror ? y : x; }
double GetY(double x, double y) const { return m_mirror ? x : y; }
bool GetX(bool x, bool y) const { return m_mirror ? y : x; }
bool GetY(bool x, bool y) const { return m_mirror ? x : y; }
// same thing but for pointers
wxCoord *GetX(wxCoord *x, wxCoord *y) const { return m_mirror ? y : x; }
wxCoord *GetY(wxCoord *x, wxCoord *y) const { return m_mirror ? x : y; }
// exchange x and y components of all points in the array if necessary
wxPoint* Mirror(int n, const wxPoint*& points) const
{
wxPoint* points_alloc = NULL;
if ( m_mirror )
{
points_alloc = new wxPoint[n];
for ( int i = 0; i < n; i++ )
{
points_alloc[i].x = points[i].y;
points_alloc[i].y = points[i].x;
}
points = points_alloc;
}
return points_alloc;
}
// wxDCBase functions
virtual bool DoFloodFill(wxCoord x, wxCoord y, const wxColour& col,
wxFloodFillStyle style = wxFLOOD_SURFACE) wxOVERRIDE
{
return m_dc.DoFloodFill(GetX(x, y), GetY(x, y), col, style);
}
virtual bool DoGetPixel(wxCoord x, wxCoord y, wxColour *col) const wxOVERRIDE
{
return m_dc.DoGetPixel(GetX(x, y), GetY(x, y), col);
}
virtual void DoDrawPoint(wxCoord x, wxCoord y) wxOVERRIDE
{
m_dc.DoDrawPoint(GetX(x, y), GetY(x, y));
}
virtual void DoDrawLine(wxCoord x1, wxCoord y1, wxCoord x2, wxCoord y2) wxOVERRIDE
{
m_dc.DoDrawLine(GetX(x1, y1), GetY(x1, y1), GetX(x2, y2), GetY(x2, y2));
}
virtual void DoDrawArc(wxCoord x1, wxCoord y1,
wxCoord x2, wxCoord y2,
wxCoord xc, wxCoord yc) wxOVERRIDE
{
wxFAIL_MSG( wxT("this is probably wrong") );
m_dc.DoDrawArc(GetX(x1, y1), GetY(x1, y1),
GetX(x2, y2), GetY(x2, y2),
xc, yc);
}
virtual void DoDrawCheckMark(wxCoord x, wxCoord y,
wxCoord w, wxCoord h) wxOVERRIDE
{
m_dc.DoDrawCheckMark(GetX(x, y), GetY(x, y),
GetX(w, h), GetY(w, h));
}
virtual void DoDrawEllipticArc(wxCoord x, wxCoord y, wxCoord w, wxCoord h,
double sa, double ea) wxOVERRIDE
{
wxFAIL_MSG( wxT("this is probably wrong") );
m_dc.DoDrawEllipticArc(GetX(x, y), GetY(x, y),
GetX(w, h), GetY(w, h),
sa, ea);
}
virtual void DoDrawRectangle(wxCoord x, wxCoord y, wxCoord w, wxCoord h) wxOVERRIDE
{
m_dc.DoDrawRectangle(GetX(x, y), GetY(x, y), GetX(w, h), GetY(w, h));
}
virtual void DoDrawRoundedRectangle(wxCoord x, wxCoord y,
wxCoord w, wxCoord h,
double radius) wxOVERRIDE
{
m_dc.DoDrawRoundedRectangle(GetX(x, y), GetY(x, y),
GetX(w, h), GetY(w, h),
radius);
}
virtual void DoDrawEllipse(wxCoord x, wxCoord y, wxCoord w, wxCoord h) wxOVERRIDE
{
m_dc.DoDrawEllipse(GetX(x, y), GetY(x, y), GetX(w, h), GetY(w, h));
}
virtual void DoCrossHair(wxCoord x, wxCoord y) wxOVERRIDE
{
m_dc.DoCrossHair(GetX(x, y), GetY(x, y));
}
virtual void DoDrawIcon(const wxIcon& icon, wxCoord x, wxCoord y) wxOVERRIDE
{
m_dc.DoDrawIcon(icon, GetX(x, y), GetY(x, y));
}
virtual void DoDrawBitmap(const wxBitmap &bmp, wxCoord x, wxCoord y,
bool useMask = false) wxOVERRIDE
{
m_dc.DoDrawBitmap(bmp, GetX(x, y), GetY(x, y), useMask);
}
virtual void DoDrawText(const wxString& text, wxCoord x, wxCoord y) wxOVERRIDE
{
// this is never mirrored
m_dc.DoDrawText(text, x, y);
}
virtual void DoDrawRotatedText(const wxString& text,
wxCoord x, wxCoord y, double angle) wxOVERRIDE
{
// this is never mirrored
m_dc.DoDrawRotatedText(text, x, y, angle);
}
virtual bool DoBlit(wxCoord xdest, wxCoord ydest,
wxCoord w, wxCoord h,
wxDC *source, wxCoord xsrc, wxCoord ysrc,
wxRasterOperationMode rop = wxCOPY,
bool useMask = false,
wxCoord xsrcMask = wxDefaultCoord, wxCoord ysrcMask = wxDefaultCoord) wxOVERRIDE
{
return m_dc.DoBlit(GetX(xdest, ydest), GetY(xdest, ydest),
GetX(w, h), GetY(w, h),
source, GetX(xsrc, ysrc), GetY(xsrc, ysrc),
rop, useMask,
GetX(xsrcMask, ysrcMask), GetX(xsrcMask, ysrcMask));
}
virtual void DoGetSize(int *w, int *h) const wxOVERRIDE
{
m_dc.DoGetSize(GetX(w, h), GetY(w, h));
}
virtual void DoGetSizeMM(int *w, int *h) const wxOVERRIDE
{
m_dc.DoGetSizeMM(GetX(w, h), GetY(w, h));
}
virtual void DoDrawLines(int n, const wxPoint points[],
wxCoord xoffset, wxCoord yoffset) wxOVERRIDE
{
wxPoint* points_alloc = Mirror(n, points);
m_dc.DoDrawLines(n, points,
GetX(xoffset, yoffset), GetY(xoffset, yoffset));
delete[] points_alloc;
}
virtual void DoDrawPolygon(int n, const wxPoint points[],
wxCoord xoffset, wxCoord yoffset,
wxPolygonFillMode fillStyle = wxODDEVEN_RULE) wxOVERRIDE
{
wxPoint* points_alloc = Mirror(n, points);
m_dc.DoDrawPolygon(n, points,
GetX(xoffset, yoffset), GetY(xoffset, yoffset),
fillStyle);
delete[] points_alloc;
}
virtual void DoSetDeviceClippingRegion(const wxRegion& WXUNUSED(region)) wxOVERRIDE
{
wxFAIL_MSG( wxT("not implemented") );
}
virtual void DoSetClippingRegion(wxCoord x, wxCoord y,
wxCoord w, wxCoord h) wxOVERRIDE
{
m_dc.DoSetClippingRegion(GetX(x, y), GetY(x, y), GetX(w, h), GetY(w, h));
}
virtual void DoGetTextExtent(const wxString& string,
wxCoord *x, wxCoord *y,
wxCoord *descent = NULL,
wxCoord *externalLeading = NULL,
const wxFont *theFont = NULL) const wxOVERRIDE
{
// never mirrored
m_dc.DoGetTextExtent(string, x, y, descent, externalLeading, theFont);
}
private:
wxDCImpl& m_dc;
bool m_mirror;
wxDECLARE_NO_COPY_CLASS(wxMirrorDCImpl);
};
class WXDLLIMPEXP_CORE wxMirrorDC : public wxDC
{
public:
wxMirrorDC(wxDC& dc, bool mirror)
: wxDC(new wxMirrorDCImpl(this, *dc.GetImpl(), mirror))
{
m_mirror = mirror;
}
// helper functions which may be useful for the users of this class
wxSize Reflect(const wxSize& sizeOrig)
{
return m_mirror ? wxSize(sizeOrig.y, sizeOrig.x) : sizeOrig;
}
private:
bool m_mirror;
wxDECLARE_NO_COPY_CLASS(wxMirrorDC);
};
#endif // _WX_DCMIRROR_H_
| h |
rticonnextdds-usecases | data/projects/rticonnextdds-usecases/VehicleTracking/ExampleCode/thirdparty/wxWidgets-3.1.2/Win32/include/wx/filehistory.h | /////////////////////////////////////////////////////////////////////////////
// Name: wx/filehistory.h
// Purpose: wxFileHistory class
// Author: Julian Smart, Vaclav Slavik
// Created: 2010-05-03
// Copyright: (c) Julian Smart, Vaclav Slavik
// Licence: wxWindows licence
/////////////////////////////////////////////////////////////////////////////
#ifndef _WX_FILEHISTORY_H_
#define _WX_FILEHISTORY_H_
#include "wx/defs.h"
#if wxUSE_FILE_HISTORY
#include "wx/windowid.h"
#include "wx/object.h"
#include "wx/list.h"
#include "wx/string.h"
#include "wx/arrstr.h"
class WXDLLIMPEXP_FWD_CORE wxMenu;
class WXDLLIMPEXP_FWD_BASE wxConfigBase;
class WXDLLIMPEXP_FWD_BASE wxFileName;
// ----------------------------------------------------------------------------
// File history management
// ----------------------------------------------------------------------------
class WXDLLIMPEXP_CORE wxFileHistoryBase : public wxObject
{
public:
wxFileHistoryBase(size_t maxFiles = 9, wxWindowID idBase = wxID_FILE1);
// Operations
virtual void AddFileToHistory(const wxString& file);
virtual void RemoveFileFromHistory(size_t i);
virtual int GetMaxFiles() const { return (int)m_fileMaxFiles; }
virtual void UseMenu(wxMenu *menu);
// Remove menu from the list (MDI child may be closing)
virtual void RemoveMenu(wxMenu *menu);
#if wxUSE_CONFIG
virtual void Load(const wxConfigBase& config);
virtual void Save(wxConfigBase& config);
#endif // wxUSE_CONFIG
virtual void AddFilesToMenu();
virtual void AddFilesToMenu(wxMenu* menu); // Single menu
// Accessors
virtual wxString GetHistoryFile(size_t i) const { return m_fileHistory[i]; }
virtual size_t GetCount() const { return m_fileHistory.GetCount(); }
const wxList& GetMenus() const { return m_fileMenus; }
// Set/get base id
void SetBaseId(wxWindowID baseId) { m_idBase = baseId; }
wxWindowID GetBaseId() const { return m_idBase; }
protected:
// Last n files
wxArrayString m_fileHistory;
// Menus to maintain (may need several for an MDI app)
wxList m_fileMenus;
// Max files to maintain
size_t m_fileMaxFiles;
private:
// The ID of the first history menu item (Doesn't have to be wxID_FILE1)
wxWindowID m_idBase;
// Normalize a file name to canonical form. We have a special function for
// this to ensure the same normalization is used everywhere.
static wxString NormalizeFileName(const wxFileName& filename);
// Remove any existing entries from the associated menus.
void RemoveExistingHistory();
wxDECLARE_NO_COPY_CLASS(wxFileHistoryBase);
};
#if defined(__WXGTK20__)
#include "wx/gtk/filehistory.h"
#else
// no platform-specific implementation of wxFileHistory yet
class WXDLLIMPEXP_CORE wxFileHistory : public wxFileHistoryBase
{
public:
wxFileHistory(size_t maxFiles = 9, wxWindowID idBase = wxID_FILE1)
: wxFileHistoryBase(maxFiles, idBase) {}
wxDECLARE_DYNAMIC_CLASS(wxFileHistory);
};
#endif
#endif // wxUSE_FILE_HISTORY
#endif // _WX_FILEHISTORY_H_
| h |
rticonnextdds-usecases | data/projects/rticonnextdds-usecases/VehicleTracking/ExampleCode/thirdparty/wxWidgets-3.1.2/Win32/include/wx/hash.h | /////////////////////////////////////////////////////////////////////////////
// Name: wx/hash.h
// Purpose: wxHashTable class
// Author: Julian Smart
// Modified by: VZ at 25.02.00: type safe hashes with WX_DECLARE_HASH()
// Created: 01/02/97
// Copyright: (c) Julian Smart
// Licence: wxWindows licence
/////////////////////////////////////////////////////////////////////////////
#ifndef _WX_HASH_H__
#define _WX_HASH_H__
#include "wx/defs.h"
#include "wx/string.h"
#if !wxUSE_STD_CONTAINERS
#include "wx/object.h"
#else
class WXDLLIMPEXP_FWD_BASE wxObject;
#endif
// the default size of the hash
#define wxHASH_SIZE_DEFAULT (1000)
/*
* A hash table is an array of user-definable size with lists
* of data items hanging off the array positions. Usually there'll
* be a hit, so no search is required; otherwise we'll have to run down
* the list to find the desired item.
*/
union wxHashKeyValue
{
long integer;
wxString *string;
};
// for some compilers (AIX xlC), defining it as friend inside the class is not
// enough, so provide a real forward declaration
class WXDLLIMPEXP_FWD_BASE wxHashTableBase;
// and clang doesn't like using WXDLLIMPEXP_FWD_BASE inside a typedef.
class WXDLLIMPEXP_FWD_BASE wxHashTableBase_Node;
class WXDLLIMPEXP_BASE wxHashTableBase_Node
{
friend class wxHashTableBase;
typedef class wxHashTableBase_Node _Node;
public:
wxHashTableBase_Node( long key, void* value,
wxHashTableBase* table );
wxHashTableBase_Node( const wxString& key, void* value,
wxHashTableBase* table );
~wxHashTableBase_Node();
long GetKeyInteger() const { return m_key.integer; }
const wxString& GetKeyString() const { return *m_key.string; }
void* GetData() const { return m_value; }
void SetData( void* data ) { m_value = data; }
protected:
_Node* GetNext() const { return m_next; }
protected:
// next node in the chain
wxHashTableBase_Node* m_next;
// key
wxHashKeyValue m_key;
// value
void* m_value;
// pointer to the hash containing the node, used to remove the
// node from the hash when the user deletes the node iterating
// through it
// TODO: move it to wxHashTable_Node (only wxHashTable supports
// iteration)
wxHashTableBase* m_hashPtr;
};
class WXDLLIMPEXP_BASE wxHashTableBase
#if !wxUSE_STD_CONTAINERS
: public wxObject
#endif
{
friend class WXDLLIMPEXP_FWD_BASE wxHashTableBase_Node;
public:
typedef wxHashTableBase_Node Node;
wxHashTableBase();
virtual ~wxHashTableBase() { }
void Create( wxKeyType keyType = wxKEY_INTEGER,
size_t size = wxHASH_SIZE_DEFAULT );
void Clear();
void Destroy();
size_t GetSize() const { return m_size; }
size_t GetCount() const { return m_count; }
void DeleteContents( bool flag ) { m_deleteContents = flag; }
static long MakeKey(const wxString& string);
protected:
void DoPut( long key, long hash, void* data );
void DoPut( const wxString& key, long hash, void* data );
void* DoGet( long key, long hash ) const;
void* DoGet( const wxString& key, long hash ) const;
void* DoDelete( long key, long hash );
void* DoDelete( const wxString& key, long hash );
private:
// Remove the node from the hash, *only called from
// ~wxHashTable*_Node destructor
void DoRemoveNode( wxHashTableBase_Node* node );
// destroys data contained in the node if appropriate:
// deletes the key if it is a string and destrys
// the value if m_deleteContents is true
void DoDestroyNode( wxHashTableBase_Node* node );
// inserts a node in the table (at the end of the chain)
void DoInsertNode( size_t bucket, wxHashTableBase_Node* node );
// removes a node from the table (fiven a pointer to the previous
// but does not delete it (only deletes its contents)
void DoUnlinkNode( size_t bucket, wxHashTableBase_Node* node,
wxHashTableBase_Node* prev );
// unconditionally deletes node value (invoking the
// correct destructor)
virtual void DoDeleteContents( wxHashTableBase_Node* node ) = 0;
protected:
// number of buckets
size_t m_size;
// number of nodes (key/value pairs)
size_t m_count;
// table
Node** m_table;
// key typ (INTEGER/STRING)
wxKeyType m_keyType;
// delete contents when hash is cleared
bool m_deleteContents;
private:
wxDECLARE_NO_COPY_CLASS(wxHashTableBase);
};
// ----------------------------------------------------------------------------
// for compatibility only
// ----------------------------------------------------------------------------
class WXDLLIMPEXP_BASE wxHashTable_Node : public wxHashTableBase_Node
{
friend class WXDLLIMPEXP_FWD_BASE wxHashTable;
public:
wxHashTable_Node( long key, void* value,
wxHashTableBase* table )
: wxHashTableBase_Node( key, value, table ) { }
wxHashTable_Node( const wxString& key, void* value,
wxHashTableBase* table )
: wxHashTableBase_Node( key, value, table ) { }
wxObject* GetData() const
{ return (wxObject*)wxHashTableBase_Node::GetData(); }
void SetData( wxObject* data )
{ wxHashTableBase_Node::SetData( data ); }
wxHashTable_Node* GetNext() const
{ return (wxHashTable_Node*)wxHashTableBase_Node::GetNext(); }
};
// should inherit protectedly, but it is public for compatibility in
// order to publicly inherit from wxObject
class WXDLLIMPEXP_BASE wxHashTable : public wxHashTableBase
{
typedef wxHashTableBase hash;
public:
typedef wxHashTable_Node Node;
typedef wxHashTable_Node* compatibility_iterator;
public:
wxHashTable( wxKeyType keyType = wxKEY_INTEGER,
size_t size = wxHASH_SIZE_DEFAULT )
: wxHashTableBase() { Create( keyType, size ); BeginFind(); }
wxHashTable( const wxHashTable& table );
virtual ~wxHashTable() { Destroy(); }
const wxHashTable& operator=( const wxHashTable& );
// key and value are the same
void Put(long value, wxObject *object)
{ DoPut( value, value, object ); }
void Put(long lhash, long value, wxObject *object)
{ DoPut( value, lhash, object ); }
void Put(const wxString& value, wxObject *object)
{ DoPut( value, MakeKey( value ), object ); }
void Put(long lhash, const wxString& value, wxObject *object)
{ DoPut( value, lhash, object ); }
// key and value are the same
wxObject *Get(long value) const
{ return (wxObject*)DoGet( value, value ); }
wxObject *Get(long lhash, long value) const
{ return (wxObject*)DoGet( value, lhash ); }
wxObject *Get(const wxString& value) const
{ return (wxObject*)DoGet( value, MakeKey( value ) ); }
wxObject *Get(long lhash, const wxString& value) const
{ return (wxObject*)DoGet( value, lhash ); }
// Deletes entry and returns data if found
wxObject *Delete(long key)
{ return (wxObject*)DoDelete( key, key ); }
wxObject *Delete(long lhash, long key)
{ return (wxObject*)DoDelete( key, lhash ); }
wxObject *Delete(const wxString& key)
{ return (wxObject*)DoDelete( key, MakeKey( key ) ); }
wxObject *Delete(long lhash, const wxString& key)
{ return (wxObject*)DoDelete( key, lhash ); }
// Way of iterating through whole hash table (e.g. to delete everything)
// Not necessary, of course, if you're only storing pointers to
// objects maintained separately
void BeginFind() { m_curr = NULL; m_currBucket = 0; }
Node* Next();
void Clear() { wxHashTableBase::Clear(); }
size_t GetCount() const { return wxHashTableBase::GetCount(); }
protected:
// copy helper
void DoCopy( const wxHashTable& copy );
// searches the next node starting from bucket bucketStart and sets
// m_curr to it and m_currBucket to its bucket
void GetNextNode( size_t bucketStart );
private:
virtual void DoDeleteContents( wxHashTableBase_Node* node ) wxOVERRIDE;
// current node
Node* m_curr;
// bucket the current node belongs to
size_t m_currBucket;
};
// defines a new type safe hash table which stores the elements of type eltype
// in lists of class listclass
#define _WX_DECLARE_HASH(eltype, dummy, hashclass, classexp) \
classexp hashclass : public wxHashTableBase \
{ \
public: \
hashclass(wxKeyType keyType = wxKEY_INTEGER, \
size_t size = wxHASH_SIZE_DEFAULT) \
: wxHashTableBase() { Create(keyType, size); } \
\
virtual ~hashclass() { Destroy(); } \
\
void Put(long key, eltype *data) { DoPut(key, key, (void*)data); } \
void Put(long lhash, long key, eltype *data) \
{ DoPut(key, lhash, (void*)data); } \
eltype *Get(long key) const { return (eltype*)DoGet(key, key); } \
eltype *Get(long lhash, long key) const \
{ return (eltype*)DoGet(key, lhash); } \
eltype *Delete(long key) { return (eltype*)DoDelete(key, key); } \
eltype *Delete(long lhash, long key) \
{ return (eltype*)DoDelete(key, lhash); } \
private: \
virtual void DoDeleteContents( wxHashTableBase_Node* node ) wxOVERRIDE\
{ delete (eltype*)node->GetData(); } \
\
wxDECLARE_NO_COPY_CLASS(hashclass); \
}
// this macro is to be used in the user code
#define WX_DECLARE_HASH(el, list, hash) \
_WX_DECLARE_HASH(el, list, hash, class)
// and this one does exactly the same thing but should be used inside the
// library
#define WX_DECLARE_EXPORTED_HASH(el, list, hash) \
_WX_DECLARE_HASH(el, list, hash, class WXDLLIMPEXP_CORE)
#define WX_DECLARE_USER_EXPORTED_HASH(el, list, hash, usergoo) \
_WX_DECLARE_HASH(el, list, hash, class usergoo)
// delete all hash elements
//
// NB: the class declaration of the hash elements must be visible from the
// place where you use this macro, otherwise the proper destructor may not
// be called (a decent compiler should give a warning about it, but don't
// count on it)!
#define WX_CLEAR_HASH_TABLE(hash) \
{ \
(hash).BeginFind(); \
wxHashTable::compatibility_iterator it = (hash).Next(); \
while( it ) \
{ \
delete it->GetData(); \
it = (hash).Next(); \
} \
(hash).Clear(); \
}
#endif // _WX_HASH_H__
| h |
rticonnextdds-usecases | data/projects/rticonnextdds-usecases/VehicleTracking/ExampleCode/thirdparty/wxWidgets-3.1.2/Win32/include/wx/xti.h | /////////////////////////////////////////////////////////////////////////////
// Name: wx/xti.h
// Purpose: runtime metadata information (extended class info)
// Author: Stefan Csomor
// Modified by: Francesco Montorsi
// Created: 27/07/03
// Copyright: (c) 1997 Julian Smart
// (c) 2003 Stefan Csomor
// Licence: wxWindows licence
/////////////////////////////////////////////////////////////////////////////
#ifndef _WX_XTIH__
#define _WX_XTIH__
// We want to support properties, event sources and events sinks through
// explicit declarations, using templates and specialization to make the
// effort as painless as possible.
//
// This means we have the following domains :
//
// - Type Information for categorizing built in types as well as custom types
// this includes information about enums, their values and names
// - Type safe value storage : a kind of wxVariant, called right now wxAny
// which will be merged with wxVariant
// - Property Information and Property Accessors providing access to a class'
// values and exposed event delegates
// - Information about event handlers
// - extended Class Information for accessing all these
// ----------------------------------------------------------------------------
// headers
// ----------------------------------------------------------------------------
#include "wx/defs.h"
#if wxUSE_EXTENDED_RTTI
class WXDLLIMPEXP_FWD_BASE wxAny;
class WXDLLIMPEXP_FWD_BASE wxAnyList;
class WXDLLIMPEXP_FWD_BASE wxObject;
class WXDLLIMPEXP_FWD_BASE wxString;
class WXDLLIMPEXP_FWD_BASE wxClassInfo;
class WXDLLIMPEXP_FWD_BASE wxHashTable;
class WXDLLIMPEXP_FWD_BASE wxObject;
class WXDLLIMPEXP_FWD_BASE wxPluginLibrary;
class WXDLLIMPEXP_FWD_BASE wxHashTable;
class WXDLLIMPEXP_FWD_BASE wxHashTable_Node;
class WXDLLIMPEXP_FWD_BASE wxStringToAnyHashMap;
class WXDLLIMPEXP_FWD_BASE wxPropertyInfoMap;
class WXDLLIMPEXP_FWD_BASE wxPropertyAccessor;
class WXDLLIMPEXP_FWD_BASE wxObjectAllocatorAndCreator;
class WXDLLIMPEXP_FWD_BASE wxObjectAllocator;
#define wx_dynamic_cast(t, x) dynamic_cast<t>(x)
#include "wx/xtitypes.h"
#include "wx/xtihandler.h"
// ----------------------------------------------------------------------------
// wxClassInfo
// ----------------------------------------------------------------------------
class WXDLLIMPEXP_BASE wxObjectFunctor
{
public:
virtual ~wxObjectFunctor();
// Invoke the actual event handler:
virtual void operator()(const wxObject *) = 0;
};
class WXDLLIMPEXP_FWD_BASE wxPropertyInfo;
class WXDLLIMPEXP_FWD_BASE wxHandlerInfo;
typedef wxObject *(*wxObjectConstructorFn)(void);
typedef wxPropertyInfo *(*wxPropertyInfoFn)(void);
typedef wxHandlerInfo *(*wxHandlerInfoFn)(void);
typedef void (*wxVariantToObjectConverter)( const wxAny &data, wxObjectFunctor* fn );
typedef wxObject* (*wxVariantToObjectPtrConverter) ( const wxAny& data);
typedef wxAny (*wxObjectToVariantConverter)( wxObject* );
WXDLLIMPEXP_BASE wxString wxAnyGetAsString( const wxAny& data);
WXDLLIMPEXP_BASE const wxObject* wxAnyGetAsObjectPtr( const wxAny& data);
class WXDLLIMPEXP_BASE wxObjectWriter;
class WXDLLIMPEXP_BASE wxObjectWriterCallback;
typedef bool (*wxObjectStreamingCallback) ( const wxObject *, wxObjectWriter *, \
wxObjectWriterCallback *, const wxStringToAnyHashMap & );
class WXDLLIMPEXP_BASE wxClassInfo
{
friend class WXDLLIMPEXP_BASE wxPropertyInfo;
friend class /* WXDLLIMPEXP_BASE */ wxHandlerInfo;
friend wxObject *wxCreateDynamicObject(const wxString& name);
public:
wxClassInfo(const wxClassInfo **_Parents,
const wxChar *_UnitName,
const wxChar *_ClassName,
int size,
wxObjectConstructorFn ctor,
wxPropertyInfoFn _Props,
wxHandlerInfoFn _Handlers,
wxObjectAllocatorAndCreator* _Constructor,
const wxChar ** _ConstructorProperties,
const int _ConstructorPropertiesCount,
wxVariantToObjectPtrConverter _PtrConverter1,
wxVariantToObjectConverter _Converter2,
wxObjectToVariantConverter _Converter3,
wxObjectStreamingCallback _streamingCallback = NULL) :
m_className(_ClassName),
m_objectSize(size),
m_objectConstructor(ctor),
m_next(sm_first),
m_firstPropertyFn(_Props),
m_firstHandlerFn(_Handlers),
m_firstProperty(NULL),
m_firstHandler(NULL),
m_firstInited(false),
m_parents(_Parents),
m_unitName(_UnitName),
m_constructor(_Constructor),
m_constructorProperties(_ConstructorProperties),
m_constructorPropertiesCount(_ConstructorPropertiesCount),
m_variantOfPtrToObjectConverter(_PtrConverter1),
m_variantToObjectConverter(_Converter2),
m_objectToVariantConverter(_Converter3),
m_streamingCallback(_streamingCallback)
{
sm_first = this;
Register();
}
wxClassInfo(const wxChar *_UnitName, const wxChar *_ClassName,
const wxClassInfo **_Parents) :
m_className(_ClassName),
m_objectSize(0),
m_objectConstructor(NULL),
m_next(sm_first),
m_firstPropertyFn(NULL),
m_firstHandlerFn(NULL),
m_firstProperty(NULL),
m_firstHandler(NULL),
m_firstInited(true),
m_parents(_Parents),
m_unitName(_UnitName),
m_constructor(NULL),
m_constructorProperties(NULL),
m_constructorPropertiesCount(0),
m_variantOfPtrToObjectConverter(NULL),
m_variantToObjectConverter(NULL),
m_objectToVariantConverter(NULL),
m_streamingCallback(NULL)
{
sm_first = this;
Register();
}
// ctor compatible with old RTTI system
wxClassInfo(const wxChar *_ClassName,
const wxClassInfo *_Parent1,
const wxClassInfo *_Parent2,
int size,
wxObjectConstructorFn ctor) :
m_className(_ClassName),
m_objectSize(size),
m_objectConstructor(ctor),
m_next(sm_first),
m_firstPropertyFn(NULL),
m_firstHandlerFn(NULL),
m_firstProperty(NULL),
m_firstHandler(NULL),
m_firstInited(true),
m_parents(NULL),
m_unitName(NULL),
m_constructor(NULL),
m_constructorProperties(NULL),
m_constructorPropertiesCount(0),
m_variantOfPtrToObjectConverter(NULL),
m_variantToObjectConverter(NULL),
m_objectToVariantConverter(NULL),
m_streamingCallback(NULL)
{
sm_first = this;
m_parents[0] = _Parent1;
m_parents[1] = _Parent2;
m_parents[2] = NULL;
Register();
}
virtual ~wxClassInfo();
// allocates an instance of this class, this object does not have to be
// initialized or fully constructed as this call will be followed by a call to Create
virtual wxObject *AllocateObject() const
{ return m_objectConstructor ? (*m_objectConstructor)() : 0; }
// 'old naming' for AllocateObject staying here for backward compatibility
wxObject *CreateObject() const { return AllocateObject(); }
// direct construction call for classes that cannot construct instances via alloc/create
wxObject *ConstructObject(int ParamCount, wxAny *Params) const;
bool NeedsDirectConstruction() const;
const wxChar *GetClassName() const
{ return m_className; }
const wxChar *GetBaseClassName1() const
{ return m_parents[0] ? m_parents[0]->GetClassName() : NULL; }
const wxChar *GetBaseClassName2() const
{ return (m_parents[0] && m_parents[1]) ? m_parents[1]->GetClassName() : NULL; }
const wxClassInfo *GetBaseClass1() const
{ return m_parents[0]; }
const wxClassInfo *GetBaseClass2() const
{ return m_parents[0] ? m_parents[1] : NULL; }
const wxChar *GetIncludeName() const
{ return m_unitName; }
const wxClassInfo **GetParents() const
{ return m_parents; }
int GetSize() const
{ return m_objectSize; }
bool IsDynamic() const
{ return (NULL != m_objectConstructor); }
wxObjectConstructorFn GetConstructor() const
{ return m_objectConstructor; }
const wxClassInfo *GetNext() const
{ return m_next; }
// statics:
static void CleanUp();
static wxClassInfo *FindClass(const wxString& className);
static const wxClassInfo *GetFirst()
{ return sm_first; }
// Climb upwards through inheritance hierarchy.
// Dual inheritance is catered for.
bool IsKindOf(const wxClassInfo *info) const;
wxDECLARE_CLASS_INFO_ITERATORS();
// if there is a callback registered with that class it will be called
// before this object will be written to disk, it can veto streaming out
// this object by returning false, if this class has not registered a
// callback, the search will go up the inheritance tree if no callback has
// been registered true will be returned by default
bool BeforeWriteObject( const wxObject *obj, wxObjectWriter *streamer,
wxObjectWriterCallback *writercallback, const wxStringToAnyHashMap &metadata) const;
// gets the streaming callback from this class or any superclass
wxObjectStreamingCallback GetStreamingCallback() const;
// returns the first property
wxPropertyInfo* GetFirstProperty() const
{ EnsureInfosInited(); return m_firstProperty; }
// returns the first handler
wxHandlerInfo* GetFirstHandler() const
{ EnsureInfosInited(); return m_firstHandler; }
// Call the Create upon an instance of the class, in the end the object is fully
// initialized
virtual bool Create (wxObject *object, int ParamCount, wxAny *Params) const;
// get number of parameters for constructor
virtual int GetCreateParamCount() const
{ return m_constructorPropertiesCount; }
// get n-th constructor parameter
virtual const wxChar* GetCreateParamName(int n) const
{ return m_constructorProperties[n]; }
// Runtime access to objects for simple properties (get/set) by property
// name and variant data
virtual void SetProperty (wxObject *object, const wxChar *propertyName,
const wxAny &value) const;
virtual wxAny GetProperty (wxObject *object, const wxChar *propertyName) const;
// Runtime access to objects for collection properties by property name
virtual wxAnyList GetPropertyCollection(wxObject *object,
const wxChar *propertyName) const;
virtual void AddToPropertyCollection(wxObject *object, const wxChar *propertyName,
const wxAny& value) const;
// we must be able to cast variants to wxObject pointers, templates seem
// not to be suitable
void CallOnAny( const wxAny &data, wxObjectFunctor* functor ) const;
wxObject* AnyToObjectPtr( const wxAny &data) const;
wxAny ObjectPtrToAny( wxObject *object ) const;
// find property by name
virtual const wxPropertyInfo *FindPropertyInfo (const wxChar *PropertyName) const;
// find handler by name
virtual const wxHandlerInfo *FindHandlerInfo (const wxChar *handlerName) const;
// find property by name
virtual wxPropertyInfo *FindPropertyInfoInThisClass (const wxChar *PropertyName) const;
// find handler by name
virtual wxHandlerInfo *FindHandlerInfoInThisClass (const wxChar *handlerName) const;
// puts all the properties of this class and its superclasses in the map,
// as long as there is not yet an entry with the same name (overriding mechanism)
void GetProperties( wxPropertyInfoMap &map ) const;
private:
const wxChar *m_className;
int m_objectSize;
wxObjectConstructorFn m_objectConstructor;
// class info object live in a linked list:
// pointers to its head and the next element in it
static wxClassInfo *sm_first;
wxClassInfo *m_next;
static wxHashTable *sm_classTable;
wxPropertyInfoFn m_firstPropertyFn;
wxHandlerInfoFn m_firstHandlerFn;
protected:
void EnsureInfosInited() const
{
if ( !m_firstInited)
{
if ( m_firstPropertyFn != NULL)
m_firstProperty = (*m_firstPropertyFn)();
if ( m_firstHandlerFn != NULL)
m_firstHandler = (*m_firstHandlerFn)();
m_firstInited = true;
}
}
mutable wxPropertyInfo* m_firstProperty;
mutable wxHandlerInfo* m_firstHandler;
private:
mutable bool m_firstInited;
const wxClassInfo** m_parents;
const wxChar* m_unitName;
wxObjectAllocatorAndCreator* m_constructor;
const wxChar ** m_constructorProperties;
const int m_constructorPropertiesCount;
wxVariantToObjectPtrConverter m_variantOfPtrToObjectConverter;
wxVariantToObjectConverter m_variantToObjectConverter;
wxObjectToVariantConverter m_objectToVariantConverter;
wxObjectStreamingCallback m_streamingCallback;
const wxPropertyAccessor *FindAccessor (const wxChar *propertyName) const;
protected:
// registers the class
void Register();
void Unregister();
wxDECLARE_NO_COPY_CLASS(wxClassInfo);
};
WXDLLIMPEXP_BASE wxObject *wxCreateDynamicObject(const wxString& name);
// ----------------------------------------------------------------------------
// wxDynamicClassInfo
// ----------------------------------------------------------------------------
// this object leads to having a pure runtime-instantiation
class WXDLLIMPEXP_BASE wxDynamicClassInfo : public wxClassInfo
{
friend class WXDLLIMPEXP_BASE wxDynamicObject;
public:
wxDynamicClassInfo( const wxChar *_UnitName, const wxChar *_ClassName,
const wxClassInfo* superClass );
virtual ~wxDynamicClassInfo();
// constructs a wxDynamicObject with an instance
virtual wxObject *AllocateObject() const;
// Call the Create method for a class
virtual bool Create (wxObject *object, int ParamCount, wxAny *Params) const;
// get number of parameters for constructor
virtual int GetCreateParamCount() const;
// get i-th constructor parameter
virtual const wxChar* GetCreateParamName(int i) const;
// Runtime access to objects by property name, and variant data
virtual void SetProperty (wxObject *object, const wxChar *PropertyName,
const wxAny &Value) const;
virtual wxAny GetProperty (wxObject *object, const wxChar *PropertyName) const;
// adds a property to this class at runtime
void AddProperty( const wxChar *propertyName, const wxTypeInfo* typeInfo );
// removes an existing runtime-property
void RemoveProperty( const wxChar *propertyName );
// renames an existing runtime-property
void RenameProperty( const wxChar *oldPropertyName, const wxChar *newPropertyName );
// as a handler to this class at runtime
void AddHandler( const wxChar *handlerName, wxObjectEventFunction address,
const wxClassInfo* eventClassInfo );
// removes an existing runtime-handler
void RemoveHandler( const wxChar *handlerName );
// renames an existing runtime-handler
void RenameHandler( const wxChar *oldHandlerName, const wxChar *newHandlerName );
private:
struct wxDynamicClassInfoInternal;
wxDynamicClassInfoInternal* m_data;
};
// ----------------------------------------------------------------------------
// wxDECLARE class macros
// ----------------------------------------------------------------------------
#define _DECLARE_DYNAMIC_CLASS(name) \
public: \
static wxClassInfo ms_classInfo; \
static const wxClassInfo* ms_classParents[]; \
static wxPropertyInfo* GetPropertiesStatic(); \
static wxHandlerInfo* GetHandlersStatic(); \
static wxClassInfo *GetClassInfoStatic() \
{ return &name::ms_classInfo; } \
virtual wxClassInfo *GetClassInfo() const \
{ return &name::ms_classInfo; }
#define wxDECLARE_DYNAMIC_CLASS(name) \
static wxObjectAllocatorAndCreator* ms_constructor; \
static const wxChar * ms_constructorProperties[]; \
static const int ms_constructorPropertiesCount; \
_DECLARE_DYNAMIC_CLASS(name)
#define wxDECLARE_DYNAMIC_CLASS_NO_ASSIGN(name) \
wxDECLARE_NO_ASSIGN_CLASS(name); \
wxDECLARE_DYNAMIC_CLASS(name)
#define wxDECLARE_DYNAMIC_CLASS_NO_COPY(name) \
wxDECLARE_NO_COPY_CLASS(name); \
wxDECLARE_DYNAMIC_CLASS(name)
#define wxDECLARE_CLASS(name) \
wxDECLARE_DYNAMIC_CLASS(name)
#define wxDECLARE_ABSTRACT_CLASS(name) _DECLARE_DYNAMIC_CLASS(name)
#define wxCLASSINFO(name) (&name::ms_classInfo)
#endif // wxUSE_EXTENDED_RTTI
#endif // _WX_XTIH__
| h |
rticonnextdds-usecases | data/projects/rticonnextdds-usecases/VehicleTracking/ExampleCode/thirdparty/wxWidgets-3.1.2/Win32/include/wx/effects.h | /////////////////////////////////////////////////////////////////////////////
// Name: wx/effects.h
// Purpose: wxEffects class
// Draws 3D effects.
// Author: Julian Smart et al
// Modified by:
// Created: 25/4/2000
// Copyright: (c) Julian Smart
// Licence: wxWindows licence
/////////////////////////////////////////////////////////////////////////////
#ifndef _WX_EFFECTS_H_
#define _WX_EFFECTS_H_
// this class is deprecated and will be removed in the next wx version
//
// please use wxRenderer::DrawBorder() instead of DrawSunkenEdge(); there is no
// replacement for TileBitmap() but it doesn't seem to be very useful anyhow
#if WXWIN_COMPATIBILITY_2_8
/*
* wxEffects: various 3D effects
*/
#include "wx/object.h"
#include "wx/colour.h"
#include "wx/gdicmn.h"
#include "wx/dc.h"
class WXDLLIMPEXP_CORE wxEffectsImpl: public wxObject
{
public:
// Assume system colours
wxEffectsImpl() ;
// Going from lightest to darkest
wxEffectsImpl(const wxColour& highlightColour, const wxColour& lightShadow,
const wxColour& faceColour, const wxColour& mediumShadow,
const wxColour& darkShadow) ;
// Accessors
wxColour GetHighlightColour() const { return m_highlightColour; }
wxColour GetLightShadow() const { return m_lightShadow; }
wxColour GetFaceColour() const { return m_faceColour; }
wxColour GetMediumShadow() const { return m_mediumShadow; }
wxColour GetDarkShadow() const { return m_darkShadow; }
void SetHighlightColour(const wxColour& c) { m_highlightColour = c; }
void SetLightShadow(const wxColour& c) { m_lightShadow = c; }
void SetFaceColour(const wxColour& c) { m_faceColour = c; }
void SetMediumShadow(const wxColour& c) { m_mediumShadow = c; }
void SetDarkShadow(const wxColour& c) { m_darkShadow = c; }
void Set(const wxColour& highlightColour, const wxColour& lightShadow,
const wxColour& faceColour, const wxColour& mediumShadow,
const wxColour& darkShadow)
{
SetHighlightColour(highlightColour);
SetLightShadow(lightShadow);
SetFaceColour(faceColour);
SetMediumShadow(mediumShadow);
SetDarkShadow(darkShadow);
}
// Draw a sunken edge
void DrawSunkenEdge(wxDC& dc, const wxRect& rect, int borderSize = 1);
// Tile a bitmap
bool TileBitmap(const wxRect& rect, wxDC& dc, const wxBitmap& bitmap);
protected:
wxColour m_highlightColour; // Usually white
wxColour m_lightShadow; // Usually light grey
wxColour m_faceColour; // Usually grey
wxColour m_mediumShadow; // Usually dark grey
wxColour m_darkShadow; // Usually black
wxDECLARE_CLASS(wxEffectsImpl);
};
// current versions of g++ don't generate deprecation warnings for classes
// declared deprecated, so define wxEffects as a typedef instead: this does
// generate warnings with both g++ and VC (which also has no troubles with
// directly deprecating the classes...)
//
// note that this g++ bug (16370) is supposed to be fixed in g++ 4.3.0
typedef wxEffectsImpl wxDEPRECATED(wxEffects);
#endif // WXWIN_COMPATIBILITY_2_8
#endif // _WX_EFFECTS_H_
| h |
rticonnextdds-usecases | data/projects/rticonnextdds-usecases/VehicleTracking/ExampleCode/thirdparty/wxWidgets-3.1.2/Win32/include/wx/recguard.h | ///////////////////////////////////////////////////////////////////////////////
// Name: wx/recguard.h
// Purpose: declaration and implementation of wxRecursionGuard class
// Author: Vadim Zeitlin
// Modified by:
// Created: 14.08.2003
// Copyright: (c) 2003 Vadim Zeitlin <[email protected]>
// Licence: wxWindows licence
///////////////////////////////////////////////////////////////////////////////
#ifndef _WX_RECGUARD_H_
#define _WX_RECGUARD_H_
#include "wx/defs.h"
// ----------------------------------------------------------------------------
// wxRecursionGuardFlag is used with wxRecursionGuard
// ----------------------------------------------------------------------------
typedef int wxRecursionGuardFlag;
// ----------------------------------------------------------------------------
// wxRecursionGuard is the simplest way to protect a function from reentrancy
// ----------------------------------------------------------------------------
class WXDLLIMPEXP_BASE wxRecursionGuard
{
public:
wxRecursionGuard(wxRecursionGuardFlag& flag)
: m_flag(flag)
{
m_isInside = flag++ != 0;
}
~wxRecursionGuard()
{
wxASSERT_MSG( m_flag > 0, wxT("unbalanced wxRecursionGuards!?") );
m_flag--;
}
bool IsInside() const { return m_isInside; }
private:
wxRecursionGuardFlag& m_flag;
// true if the flag had been already set when we were created
bool m_isInside;
};
#endif // _WX_RECGUARD_H_
| h |
rticonnextdds-usecases | data/projects/rticonnextdds-usecases/VehicleTracking/ExampleCode/thirdparty/wxWidgets-3.1.2/Win32/include/wx/itemid.h | ///////////////////////////////////////////////////////////////////////////////
// Name: wx/itemid.h
// Purpose: wxItemId class declaration.
// Author: Vadim Zeitlin
// Created: 2011-08-17
// Copyright: (c) 2011 Vadim Zeitlin <[email protected]>
// Licence: wxWindows licence
///////////////////////////////////////////////////////////////////////////////
#ifndef _WX_ITEMID_H_
#define _WX_ITEMID_H_
// ----------------------------------------------------------------------------
// wxItemId: an opaque item identifier used with wx{Tree,TreeList,DataView}Ctrl.
// ----------------------------------------------------------------------------
// The template argument T is typically a pointer to some opaque type. While
// wxTreeItemId and wxDataViewItem use a pointer to void, this is dangerous and
// not recommended for the new item id classes.
template <typename T>
class wxItemId
{
public:
typedef T Type;
// This ctor is implicit which is fine for non-void* types, but if you use
// this class with void* you're strongly advised to make the derived class
// ctor explicit as implicitly converting from any pointer is simply too
// dangerous.
wxItemId(Type item = NULL) : m_pItem(item) { }
// Default copy ctor, assignment operator and dtor are ok.
bool IsOk() const { return m_pItem != NULL; }
Type GetID() const { return m_pItem; }
operator const Type() const { return m_pItem; }
// This is used for implementation purposes only.
Type operator->() const { return m_pItem; }
void Unset() { m_pItem = NULL; }
// This field is public *only* for compatibility with the old wxTreeItemId
// implementation and must not be used in any new code.
//private:
Type m_pItem;
};
template <typename T>
bool operator==(const wxItemId<T>& left, const wxItemId<T>& right)
{
return left.GetID() == right.GetID();
}
template <typename T>
bool operator!=(const wxItemId<T>& left, const wxItemId<T>& right)
{
return !(left == right);
}
#endif // _WX_ITEMID_H_
| h |
rticonnextdds-usecases | data/projects/rticonnextdds-usecases/VehicleTracking/ExampleCode/thirdparty/wxWidgets-3.1.2/Win32/include/wx/grid.h | /////////////////////////////////////////////////////////////////////////////
// Name: wx/grid.h
// Purpose: wxGrid base header
// Author: Julian Smart
// Modified by:
// Created:
// Copyright: (c) Julian Smart
// Licence: wxWindows licence
/////////////////////////////////////////////////////////////////////////////
#ifndef _WX_GRID_H_BASE_
#define _WX_GRID_H_BASE_
#include "wx/generic/grid.h"
// these headers used to be included from the above header but isn't any more,
// still do it from here for compatibility
#include "wx/generic/grideditors.h"
#include "wx/generic/gridctrl.h"
#endif // _WX_GRID_H_BASE_
| h |
rticonnextdds-usecases | data/projects/rticonnextdds-usecases/VehicleTracking/ExampleCode/thirdparty/wxWidgets-3.1.2/Win32/include/wx/colourdata.h | /////////////////////////////////////////////////////////////////////////////
// Name: wx/colourdata.h
// Author: Julian Smart
// Copyright: (c) Julian Smart
// Licence: wxWindows licence
/////////////////////////////////////////////////////////////////////////////
#ifndef _WX_COLOURDATA_H_
#define _WX_COLOURDATA_H_
#include "wx/colour.h"
class WXDLLIMPEXP_CORE wxColourData : public wxObject
{
public:
// number of custom colours we store
enum
{
NUM_CUSTOM = 16
};
wxColourData();
wxColourData(const wxColourData& data);
wxColourData& operator=(const wxColourData& data);
virtual ~wxColourData();
void SetChooseFull(bool flag) { m_chooseFull = flag; }
bool GetChooseFull() const { return m_chooseFull; }
void SetChooseAlpha(bool flag) { m_chooseAlpha = flag; }
bool GetChooseAlpha() const { return m_chooseAlpha; }
void SetColour(const wxColour& colour) { m_dataColour = colour; }
const wxColour& GetColour() const { return m_dataColour; }
wxColour& GetColour() { return m_dataColour; }
// SetCustomColour() modifies colours in an internal array of NUM_CUSTOM
// custom colours;
void SetCustomColour(int i, const wxColour& colour);
wxColour GetCustomColour(int i) const;
// Serialize the object to a string and restore it from it
wxString ToString() const;
bool FromString(const wxString& str);
// public for backwards compatibility only: don't use directly
wxColour m_dataColour;
wxColour m_custColours[NUM_CUSTOM];
bool m_chooseFull;
protected:
bool m_chooseAlpha;
wxDECLARE_DYNAMIC_CLASS(wxColourData);
};
#endif // _WX_COLOURDATA_H_
| h |
rticonnextdds-usecases | data/projects/rticonnextdds-usecases/VehicleTracking/ExampleCode/thirdparty/wxWidgets-3.1.2/Win32/include/wx/stackwalk.h | ///////////////////////////////////////////////////////////////////////////////
// Name: wx/stackwalk.h
// Purpose: wxStackWalker and related classes, common part
// Author: Vadim Zeitlin
// Modified by:
// Created: 2005-01-07
// Copyright: (c) 2004 Vadim Zeitlin <[email protected]>
// Licence: wxWindows licence
///////////////////////////////////////////////////////////////////////////////
#ifndef _WX_STACKWALK_H_
#define _WX_STACKWALK_H_
#include "wx/defs.h"
#if wxUSE_STACKWALKER
#include "wx/string.h"
class WXDLLIMPEXP_FWD_BASE wxStackFrame;
#define wxSTACKWALKER_MAX_DEPTH (200)
// ----------------------------------------------------------------------------
// wxStackFrame: a single stack level
// ----------------------------------------------------------------------------
class WXDLLIMPEXP_BASE wxStackFrameBase
{
private:
// put this inline function here so that it is defined before use
wxStackFrameBase *ConstCast() const
{ return const_cast<wxStackFrameBase *>(this); }
public:
wxStackFrameBase(size_t level, void *address = NULL)
{
m_level = level;
m_line =
m_offset = 0;
m_address = address;
}
// get the level of this frame (deepest/innermost one is 0)
size_t GetLevel() const { return m_level; }
// return the address of this frame
void *GetAddress() const { return m_address; }
// return the unmangled (if possible) name of the function containing this
// frame
wxString GetName() const { ConstCast()->OnGetName(); return m_name; }
// return the instruction pointer offset from the start of the function
size_t GetOffset() const { ConstCast()->OnGetName(); return m_offset; }
// get the module this function belongs to (not always available)
wxString GetModule() const { ConstCast()->OnGetName(); return m_module; }
// return true if we have the filename and line number for this frame
bool HasSourceLocation() const { return !GetFileName().empty(); }
// return the name of the file containing this frame, empty if
// unavailable (typically because debug info is missing)
wxString GetFileName() const
{ ConstCast()->OnGetLocation(); return m_filename; }
// return the line number of this frame, 0 if unavailable
size_t GetLine() const { ConstCast()->OnGetLocation(); return m_line; }
// return the number of parameters of this function (may return 0 if we
// can't retrieve the parameters info even although the function does have
// parameters)
virtual size_t GetParamCount() const { return 0; }
// get the name, type and value (in text form) of the given parameter
//
// any pointer may be NULL
//
// return true if at least some values could be retrieved
virtual bool GetParam(size_t WXUNUSED(n),
wxString * WXUNUSED(type),
wxString * WXUNUSED(name),
wxString * WXUNUSED(value)) const
{
return false;
}
// although this class is not supposed to be used polymorphically, give it
// a virtual dtor to silence compiler warnings
virtual ~wxStackFrameBase() { }
protected:
// hooks for derived classes to initialize some fields on demand
virtual void OnGetName() { }
virtual void OnGetLocation() { }
// fields are protected, not private, so that OnGetXXX() could modify them
// directly
size_t m_level;
wxString m_name,
m_module,
m_filename;
size_t m_line;
void *m_address;
size_t m_offset;
};
// ----------------------------------------------------------------------------
// wxStackWalker: class for enumerating stack frames
// ----------------------------------------------------------------------------
class WXDLLIMPEXP_BASE wxStackWalkerBase
{
public:
// ctor does nothing, use Walk() to walk the stack
wxStackWalkerBase() { }
// dtor does nothing neither but should be virtual
virtual ~wxStackWalkerBase() { }
// enumerate stack frames from the current location, skipping the initial
// number of them (this can be useful when Walk() is called from some known
// location and you don't want to see the first few frames anyhow; also
// notice that Walk() frame itself is not included if skip >= 1)
virtual void Walk(size_t skip = 1, size_t maxDepth = wxSTACKWALKER_MAX_DEPTH) = 0;
#if wxUSE_ON_FATAL_EXCEPTION
// enumerate stack frames from the location of uncaught exception
//
// this version can only be called from wxApp::OnFatalException()
virtual void WalkFromException(size_t maxDepth = wxSTACKWALKER_MAX_DEPTH) = 0;
#endif // wxUSE_ON_FATAL_EXCEPTION
protected:
// this function must be overrided to process the given frame
virtual void OnStackFrame(const wxStackFrame& frame) = 0;
};
#ifdef __WINDOWS__
#include "wx/msw/stackwalk.h"
#elif defined(__UNIX__)
#include "wx/unix/stackwalk.h"
#else
#error "wxStackWalker is not supported, set wxUSE_STACKWALKER to 0"
#endif
#endif // wxUSE_STACKWALKER
#endif // _WX_STACKWALK_H_
| h |
rticonnextdds-usecases | data/projects/rticonnextdds-usecases/VehicleTracking/ExampleCode/thirdparty/wxWidgets-3.1.2/Win32/include/wx/fs_arc.h | /////////////////////////////////////////////////////////////////////////////
// Name: wx/fs_arc.h
// Purpose: Archive file system
// Author: Vaclav Slavik, Mike Wetherell
// Copyright: (c) 1999 Vaclav Slavik, (c) 2006 Mike Wetherell
// Licence: wxWindows licence
/////////////////////////////////////////////////////////////////////////////
#ifndef _WX_FS_ARC_H_
#define _WX_FS_ARC_H_
#include "wx/defs.h"
#if wxUSE_FS_ARCHIVE
#include "wx/filesys.h"
#include "wx/hashmap.h"
WX_DECLARE_STRING_HASH_MAP(int, wxArchiveFilenameHashMap);
//---------------------------------------------------------------------------
// wxArchiveFSHandler
//---------------------------------------------------------------------------
class WXDLLIMPEXP_BASE wxArchiveFSHandler : public wxFileSystemHandler
{
public:
wxArchiveFSHandler();
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;
void Cleanup();
virtual ~wxArchiveFSHandler();
private:
class wxArchiveFSCache *m_cache;
wxFileSystem m_fs;
// these vars are used by FindFirst/Next:
class wxArchiveFSCacheData *m_Archive;
struct wxArchiveFSEntry *m_FindEntry;
wxString m_Pattern, m_BaseDir, m_ZipFile;
bool m_AllowDirs, m_AllowFiles;
wxArchiveFilenameHashMap *m_DirsFound;
wxString DoFind();
wxDECLARE_NO_COPY_CLASS(wxArchiveFSHandler);
wxDECLARE_DYNAMIC_CLASS(wxArchiveFSHandler);
};
#endif // wxUSE_FS_ARCHIVE
#endif // _WX_FS_ARC_H_
| h |
rticonnextdds-usecases | data/projects/rticonnextdds-usecases/VehicleTracking/ExampleCode/thirdparty/wxWidgets-3.1.2/Win32/include/wx/tipwin.h | ///////////////////////////////////////////////////////////////////////////////
// Name: wx/tipwin.h
// Purpose: wxTipWindow is a window like the one typically used for
// showing the tooltips
// Author: Vadim Zeitlin
// Modified by:
// Created: 10.09.00
// Copyright: (c) 2000 Vadim Zeitlin <[email protected]>
// Licence: wxWindows licence
///////////////////////////////////////////////////////////////////////////////
#ifndef _WX_TIPWIN_H_
#define _WX_TIPWIN_H_
#if wxUSE_TIPWINDOW
#if wxUSE_POPUPWIN
#include "wx/popupwin.h"
#define wxTipWindowBase wxPopupTransientWindow
#else
#include "wx/frame.h"
#define wxTipWindowBase wxFrame
#endif
#include "wx/arrstr.h"
class WXDLLIMPEXP_FWD_CORE wxTipWindowView;
// ----------------------------------------------------------------------------
// wxTipWindow
// ----------------------------------------------------------------------------
class WXDLLIMPEXP_CORE wxTipWindow : public wxTipWindowBase
{
public:
// the mandatory ctor parameters are: the parent window and the text to
// show
//
// optionally you may also specify the length at which the lines are going
// to be broken in rows (100 pixels by default)
//
// windowPtr and rectBound are just passed to SetTipWindowPtr() and
// SetBoundingRect() - see below
wxTipWindow(wxWindow *parent,
const wxString& text,
wxCoord maxLength = 100,
wxTipWindow** windowPtr = NULL,
wxRect *rectBound = NULL);
virtual ~wxTipWindow();
// If windowPtr is not NULL the given address will be NULLed when the
// window has closed
void SetTipWindowPtr(wxTipWindow** windowPtr) { m_windowPtr = windowPtr; }
// If rectBound is not NULL, the window will disappear automatically when
// the mouse leave the specified rect: note that rectBound should be in the
// screen coordinates!
void SetBoundingRect(const wxRect& rectBound);
// Hide and destroy the window
void Close();
protected:
// called by wxTipWindowView only
bool CheckMouseInBounds(const wxPoint& pos);
// event handlers
void OnMouseClick(wxMouseEvent& event);
#if !wxUSE_POPUPWIN
void OnActivate(wxActivateEvent& event);
void OnKillFocus(wxFocusEvent& event);
#else // wxUSE_POPUPWIN
virtual void OnDismiss() wxOVERRIDE;
#endif // wxUSE_POPUPWIN/!wxUSE_POPUPWIN
private:
wxArrayString m_textLines;
wxCoord m_heightLine;
wxTipWindowView *m_view;
wxTipWindow** m_windowPtr;
wxRect m_rectBound;
wxDECLARE_EVENT_TABLE();
friend class wxTipWindowView;
wxDECLARE_NO_COPY_CLASS(wxTipWindow);
};
#endif // wxUSE_TIPWINDOW
#endif // _WX_TIPWIN_H_
| h |
rticonnextdds-usecases | data/projects/rticonnextdds-usecases/VehicleTracking/ExampleCode/thirdparty/wxWidgets-3.1.2/Win32/include/wx/chartype.h | /*
* Name: wx/chartype.h
* Purpose: Declarations of wxChar and related types
* Author: Joel Farley, Ove Kåven
* Modified by: Vadim Zeitlin, Robert Roebling, Ron Lee
* Created: 1998/06/12
* Copyright: (c) 1998-2006 wxWidgets dev team
* Licence: wxWindows licence
*/
/* THIS IS A C FILE, DON'T USE C++ FEATURES (IN PARTICULAR COMMENTS) IN IT */
#ifndef _WX_WXCHARTYPE_H_
#define _WX_WXCHARTYPE_H_
/*
wx/defs.h indirectly includes this file, so we can't include it here,
include just its subset which defines SIZEOF_WCHAR_T that is used here
(under Unix it's in configure-generated setup.h, so including wx/platform.h
would have been enough, but this is not the case under other platforms).
*/
#include "wx/types.h"
/* check whether we have wchar_t and which size it is if we do */
#if !defined(wxUSE_WCHAR_T)
#if defined(__UNIX__)
#if defined(HAVE_WCSTR_H) || defined(HAVE_WCHAR_H) || defined(__FreeBSD__) || defined(__DARWIN__)
#define wxUSE_WCHAR_T 1
#else
#define wxUSE_WCHAR_T 0
#endif
#elif defined(__GNUWIN32__) && !defined(__MINGW32__)
#define wxUSE_WCHAR_T 0
#else
/* add additional compiler checks if this fails */
#define wxUSE_WCHAR_T 1
#endif
#endif /* !defined(wxUSE_WCHAR_T) */
/* Unicode support requires wchar_t */
#if !wxUSE_WCHAR_T
#error "wchar_t must be available"
#endif /* Unicode */
/*
non Unix compilers which do have wchar.h (but not tchar.h which is included
below and which includes wchar.h anyhow).
Actually MinGW has tchar.h, but it does not include wchar.h
*/
#if defined(__MINGW32__)
#ifndef HAVE_WCHAR_H
#define HAVE_WCHAR_H
#endif
#endif
#ifdef HAVE_WCHAR_H
/* the current (as of Nov 2002) version of cygwin has a bug in its */
/* wchar.h -- there is no extern "C" around the declarations in it */
/* and this results in linking errors later; also, at least on some */
/* Cygwin versions, wchar.h requires sys/types.h */
#ifdef __CYGWIN__
#include <sys/types.h>
#ifdef __cplusplus
extern "C" {
#endif
#endif /* Cygwin */
#include <wchar.h>
#if defined(__CYGWIN__) && defined(__cplusplus)
}
#endif /* Cygwin and C++ */
/* the current (as of Mar 2014) version of Android (up to api level 19) */
/* doesn't include some declarations (wscdup, wcslen, wcscasecmp, etc.) */
/* (moved out from __CYGWIN__ block) */
#if defined(__WXQT__) && !defined(wcsdup) && defined(__ANDROID__)
#ifdef __cplusplus
extern "C" {
#endif
extern wchar_t *wcsdup(const wchar_t *);
extern size_t wcslen (const wchar_t *);
extern size_t wcsnlen (const wchar_t *, size_t );
extern int wcscasecmp (const wchar_t *, const wchar_t *);
extern int wcsncasecmp (const wchar_t *, const wchar_t *, size_t);
#ifdef __cplusplus
}
#endif
#endif /* Android */
#elif defined(HAVE_WCSTR_H)
/* old compilers have relevant declarations here */
#include <wcstr.h>
#elif defined(__FreeBSD__) || defined(__DARWIN__)
/* include stdlib.h for wchar_t */
#include <stdlib.h>
#endif /* HAVE_WCHAR_H */
#ifdef HAVE_WIDEC_H
#include <widec.h>
#endif
/* -------------------------------------------------------------------------- */
/* define wxHAVE_TCHAR_SUPPORT for the compilers which support the TCHAR type */
/* mapped to either char or wchar_t depending on the ASCII/Unicode mode and */
/* have the function mapping _tfoo() -> foo() or wfoo() */
/* -------------------------------------------------------------------------- */
/* VC++ and BC++ starting with 5.2 have TCHAR support */
#ifdef __VISUALC__
#define wxHAVE_TCHAR_SUPPORT
#elif defined(__BORLANDC__) && (__BORLANDC__ >= 0x520)
#define wxHAVE_TCHAR_SUPPORT
#include <ctype.h>
#elif defined(__MINGW32__)
#define wxHAVE_TCHAR_SUPPORT
#include <stddef.h>
#include <string.h>
#include <ctype.h>
#endif /* compilers with (good) TCHAR support */
#ifdef wxHAVE_TCHAR_SUPPORT
/* get TCHAR definition if we've got it */
#include <tchar.h>
/* we surely do have wchar_t if we have TCHAR */
#ifndef wxUSE_WCHAR_T
#define wxUSE_WCHAR_T 1
#endif /* !defined(wxUSE_WCHAR_T) */
#endif /* wxHAVE_TCHAR_SUPPORT */
/* ------------------------------------------------------------------------- */
/* define wxChar type */
/* ------------------------------------------------------------------------- */
/* TODO: define wxCharInt to be equal to either int or wint_t? */
#if !wxUSE_UNICODE
typedef char wxChar;
typedef signed char wxSChar;
typedef unsigned char wxUChar;
#else
/* VZ: note that VC++ defines _T[SU]CHAR simply as wchar_t and not as */
/* signed/unsigned version of it which (a) makes sense to me (unlike */
/* char wchar_t is always unsigned) and (b) was how the previous */
/* definitions worked so keep it like this */
typedef wchar_t wxChar;
typedef wchar_t wxSChar;
typedef wchar_t wxUChar;
#endif /* ASCII/Unicode */
/* ------------------------------------------------------------------------- */
/* define wxStringCharType */
/* ------------------------------------------------------------------------- */
/* depending on the platform, Unicode build can either store wxStrings as
wchar_t* or UTF-8 encoded char*: */
#if wxUSE_UNICODE
/* FIXME-UTF8: what would be better place for this? */
#if defined(wxUSE_UTF8_LOCALE_ONLY) && !defined(wxUSE_UNICODE_UTF8)
#error "wxUSE_UTF8_LOCALE_ONLY only makes sense with wxUSE_UNICODE_UTF8"
#endif
#ifndef wxUSE_UTF8_LOCALE_ONLY
#define wxUSE_UTF8_LOCALE_ONLY 0
#endif
#ifndef wxUSE_UNICODE_UTF8
#define wxUSE_UNICODE_UTF8 0
#endif
#if wxUSE_UNICODE_UTF8
#define wxUSE_UNICODE_WCHAR 0
#else
#define wxUSE_UNICODE_WCHAR 1
#endif
#else
#define wxUSE_UNICODE_WCHAR 0
#define wxUSE_UNICODE_UTF8 0
#define wxUSE_UTF8_LOCALE_ONLY 0
#endif
#ifndef SIZEOF_WCHAR_T
#error "SIZEOF_WCHAR_T must be defined before including this file in wx/defs.h"
#endif
#if wxUSE_UNICODE_WCHAR && SIZEOF_WCHAR_T == 2
#define wxUSE_UNICODE_UTF16 1
#else
#define wxUSE_UNICODE_UTF16 0
#endif
/* define char type used by wxString internal representation: */
#if wxUSE_UNICODE_WCHAR
typedef wchar_t wxStringCharType;
#else /* wxUSE_UNICODE_UTF8 || ANSI */
typedef char wxStringCharType;
#endif
/* ------------------------------------------------------------------------- */
/* define wxT() and related macros */
/* ------------------------------------------------------------------------- */
/* BSD systems define _T() to be something different in ctype.h, override it */
#if defined(__FreeBSD__) || defined(__DARWIN__)
#include <ctype.h>
#undef _T
#endif
/*
wxT ("wx text") macro turns a literal string constant into a wide char
constant. It is mostly unnecessary with wx 2.9 but defined for
compatibility.
*/
#ifndef wxT
#if !wxUSE_UNICODE
#define wxT(x) x
#else /* Unicode */
/*
Notice that we use an intermediate macro to allow x to be expanded
if it's a macro itself.
*/
#ifndef wxCOMPILER_BROKEN_CONCAT_OPER
#define wxT(x) wxCONCAT_HELPER(L, x)
#else
#define wxT(x) wxPREPEND_L(x)
#endif
#endif /* ASCII/Unicode */
#endif /* !defined(wxT) */
/*
wxT_2 exists only for compatibility with wx 2.x and is the same as wxT() in
that version but nothing in the newer ones.
*/
#define wxT_2(x) x
/*
wxS ("wx string") macro can be used to create literals using the same
representation as wxString does internally, i.e. wchar_t in Unicode build
under Windows or char in UTF-8-based Unicode builds and (deprecated) ANSI
builds everywhere (see wxStringCharType definition above).
*/
#if wxUSE_UNICODE_WCHAR
/*
As above with wxT(), wxS() argument is expanded if it's a macro.
*/
#ifndef wxCOMPILER_BROKEN_CONCAT_OPER
#define wxS(x) wxCONCAT_HELPER(L, x)
#else
#define wxS(x) wxPREPEND_L(x)
#endif
#else /* wxUSE_UNICODE_UTF8 || ANSI */
#define wxS(x) x
#endif
/*
_T() is a synonym for wxT() familiar to Windows programmers. As this macro
has even higher risk of conflicting with system headers, its use is
discouraged and you may predefine wxNO__T to disable it. Additionally, we
do it ourselves for Sun CC which is known to use it in its standard headers
(see #10660).
*/
#if defined(__SUNPRO_C) || defined(__SUNPRO_CC)
#ifndef wxNO__T
#define wxNO__T
#endif
#endif
#if !defined(_T) && !defined(wxNO__T)
#define _T(x) wxT(x)
#endif
/* a helper macro allowing to make another macro Unicode-friendly, see below */
#define wxAPPLY_T(x) wxT(x)
/* Unicode-friendly __FILE__, __DATE__ and __TIME__ analogs */
#ifndef __TFILE__
#define __TFILE__ wxAPPLY_T(__FILE__)
#endif
#ifndef __TDATE__
#define __TDATE__ wxAPPLY_T(__DATE__)
#endif
#ifndef __TTIME__
#define __TTIME__ wxAPPLY_T(__TIME__)
#endif
#endif /* _WX_WXCHARTYPE_H_ */
| h |
rticonnextdds-usecases | data/projects/rticonnextdds-usecases/VehicleTracking/ExampleCode/thirdparty/wxWidgets-3.1.2/Win32/include/wx/choicdlg.h | /////////////////////////////////////////////////////////////////////////////
// Name: wx/choicdlg.h
// Purpose: Includes generic choice dialog file
// Author: Julian Smart
// Modified by:
// Created:
// Copyright: Julian Smart
// Licence: wxWindows licence
/////////////////////////////////////////////////////////////////////////////
#ifndef _WX_CHOICDLG_H_BASE_
#define _WX_CHOICDLG_H_BASE_
#include "wx/defs.h"
#if wxUSE_CHOICEDLG
#include "wx/generic/choicdgg.h"
#endif
#endif // _WX_CHOICDLG_H_BASE_
| h |
rticonnextdds-usecases | data/projects/rticonnextdds-usecases/VehicleTracking/ExampleCode/thirdparty/wxWidgets-3.1.2/Win32/include/wx/infobar.h | ///////////////////////////////////////////////////////////////////////////////
// Name: wx/infobar.h
// Purpose: declaration of wxInfoBarBase defining common API of wxInfoBar
// Author: Vadim Zeitlin
// Created: 2009-07-28
// Copyright: (c) 2009 Vadim Zeitlin <[email protected]>
// Licence: wxWindows licence
///////////////////////////////////////////////////////////////////////////////
#ifndef _WX_INFOBAR_H_
#define _WX_INFOBAR_H_
#include "wx/defs.h"
#if wxUSE_INFOBAR
#include "wx/control.h"
// ----------------------------------------------------------------------------
// wxInfoBar shows non-critical but important information to the user
// ----------------------------------------------------------------------------
class WXDLLIMPEXP_CORE wxInfoBarBase : public wxControl
{
public:
// real ctors are provided by the derived classes, just notice that unlike
// most of the other windows, info bar is created hidden and must be
// explicitly shown when it is needed (this is done because it is supposed
// to be shown only intermittently and hiding it after creating it from the
// user code would result in flicker)
wxInfoBarBase() { }
// show the info bar with the given message and optionally an icon
virtual void ShowMessage(const wxString& msg,
int flags = wxICON_INFORMATION) = 0;
// hide the info bar
virtual void Dismiss() = 0;
// add an extra button to the bar, near the message (replacing the default
// close button which is only shown if no extra buttons are used)
virtual void AddButton(wxWindowID btnid,
const wxString& label = wxString()) = 0;
// remove a button previously added by AddButton()
virtual void RemoveButton(wxWindowID btnid) = 0;
// get information about the currently shown buttons
virtual size_t GetButtonCount() const = 0;
virtual wxWindowID GetButtonId(size_t idx) const = 0;
virtual bool HasButtonId(wxWindowID btnid) const = 0;
private:
wxDECLARE_NO_COPY_CLASS(wxInfoBarBase);
};
// currently only GTK+ has a native implementation
#if defined(__WXGTK218__) && !defined(__WXUNIVERSAL__)
#include "wx/gtk/infobar.h"
#define wxHAS_NATIVE_INFOBAR
#endif // wxGTK2
// if the generic version is the only one we have, use it
#ifndef wxHAS_NATIVE_INFOBAR
#include "wx/generic/infobar.h"
#define wxInfoBar wxInfoBarGeneric
#endif
#endif // wxUSE_INFOBAR
#endif // _WX_INFOBAR_H_
| h |
rticonnextdds-usecases | data/projects/rticonnextdds-usecases/VehicleTracking/ExampleCode/thirdparty/wxWidgets-3.1.2/Win32/include/wx/timer.h | /////////////////////////////////////////////////////////////////////////////
// Name: wx/timer.h
// Purpose: wxTimer, wxStopWatch and global time-related functions
// Author: Julian Smart
// Modified by: Vadim Zeitlin (wxTimerBase)
// Guillermo Rodriguez (global clean up)
// Created: 04/01/98
// Copyright: (c) Julian Smart
// Licence: wxWindows licence
/////////////////////////////////////////////////////////////////////////////
#ifndef _WX_TIMER_H_BASE_
#define _WX_TIMER_H_BASE_
#include "wx/defs.h"
#if wxUSE_TIMER
#include "wx/object.h"
#include "wx/longlong.h"
#include "wx/event.h"
#include "wx/stopwatch.h" // for backwards compatibility
#include "wx/utils.h"
// more readable flags for Start():
// generate notifications periodically until the timer is stopped (default)
#define wxTIMER_CONTINUOUS false
// only send the notification once and then stop the timer
#define wxTIMER_ONE_SHOT true
class WXDLLIMPEXP_FWD_BASE wxTimerImpl;
class WXDLLIMPEXP_FWD_BASE wxTimerEvent;
// timer event type
wxDECLARE_EXPORTED_EVENT(WXDLLIMPEXP_BASE, wxEVT_TIMER, wxTimerEvent);
// the interface of wxTimer class
class WXDLLIMPEXP_BASE wxTimer : public wxEvtHandler
{
public:
// ctors and initializers
// ----------------------
// default: if you don't call SetOwner(), your only chance to get timer
// notifications is to override Notify() in the derived class
wxTimer()
{
Init();
SetOwner(this);
}
// ctor which allows to avoid having to override Notify() in the derived
// class: the owner will get timer notifications which can be handled with
// EVT_TIMER
wxTimer(wxEvtHandler *owner, int timerid = wxID_ANY)
{
Init();
SetOwner(owner, timerid);
}
// same as ctor above
void SetOwner(wxEvtHandler *owner, int timerid = wxID_ANY);
virtual ~wxTimer();
// working with the timer
// ----------------------
// NB: Start() and Stop() are not supposed to be overridden, they are only
// virtual for historical reasons, only Notify() can be overridden
// start the timer: if milliseconds == -1, use the same value as for the
// last Start()
//
// it is now valid to call Start() multiple times: this just restarts the
// timer if it is already running
virtual bool Start(int milliseconds = -1, bool oneShot = false);
// start the timer for one iteration only, this is just a simple wrapper
// for Start()
bool StartOnce(int milliseconds = -1) { return Start(milliseconds, true); }
// stop the timer, does nothing if the timer is not running
virtual void Stop();
// override this in your wxTimer-derived class if you want to process timer
// messages in it, use non default ctor or SetOwner() otherwise
virtual void Notify();
// accessors
// ---------
// get the object notified about the timer events
wxEvtHandler *GetOwner() const;
// return true if the timer is running
bool IsRunning() const;
// return the timer ID
int GetId() const;
// get the (last) timer interval in milliseconds
int GetInterval() const;
// return true if the timer is one shot
bool IsOneShot() const;
protected:
// common part of all ctors
void Init();
wxTimerImpl *m_impl;
wxDECLARE_NO_COPY_CLASS(wxTimer);
};
// ----------------------------------------------------------------------------
// wxTimerRunner: starts the timer in its ctor, stops in the dtor
// ----------------------------------------------------------------------------
class WXDLLIMPEXP_BASE wxTimerRunner
{
public:
wxTimerRunner(wxTimer& timer) : m_timer(timer) { }
wxTimerRunner(wxTimer& timer, int milli, bool oneShot = false)
: m_timer(timer)
{
m_timer.Start(milli, oneShot);
}
void Start(int milli, bool oneShot = false)
{
m_timer.Start(milli, oneShot);
}
~wxTimerRunner()
{
if ( m_timer.IsRunning() )
{
m_timer.Stop();
}
}
private:
wxTimer& m_timer;
wxDECLARE_NO_COPY_CLASS(wxTimerRunner);
};
// ----------------------------------------------------------------------------
// wxTimerEvent
// ----------------------------------------------------------------------------
class WXDLLIMPEXP_BASE wxTimerEvent : public wxEvent
{
public:
wxTimerEvent()
: wxEvent(wxID_ANY, wxEVT_TIMER) { m_timer=NULL; }
wxTimerEvent(wxTimer& timer)
: wxEvent(timer.GetId(), wxEVT_TIMER),
m_timer(&timer)
{
SetEventObject(timer.GetOwner());
}
// accessors
int GetInterval() const { return m_timer->GetInterval(); }
wxTimer& GetTimer() const { return *m_timer; }
// implement the base class pure virtual
virtual wxEvent *Clone() const wxOVERRIDE { return new wxTimerEvent(*this); }
virtual wxEventCategory GetEventCategory() const wxOVERRIDE { return wxEVT_CATEGORY_TIMER; }
private:
wxTimer* m_timer;
wxDECLARE_DYNAMIC_CLASS_NO_ASSIGN(wxTimerEvent);
};
typedef void (wxEvtHandler::*wxTimerEventFunction)(wxTimerEvent&);
#define wxTimerEventHandler(func) \
wxEVENT_HANDLER_CAST(wxTimerEventFunction, func)
#define EVT_TIMER(timerid, func) \
wx__DECLARE_EVT1(wxEVT_TIMER, timerid, wxTimerEventHandler(func))
#endif // wxUSE_TIMER
#endif // _WX_TIMER_H_BASE_
| h |
rticonnextdds-usecases | data/projects/rticonnextdds-usecases/VehicleTracking/ExampleCode/thirdparty/wxWidgets-3.1.2/Win32/include/wx/mstream.h | /////////////////////////////////////////////////////////////////////////////
// Name: wx/mstream.h
// Purpose: Memory stream classes
// Author: Guilhem Lavaux
// Modified by:
// Created: 11/07/98
// Copyright: (c) Guilhem Lavaux
// Licence: wxWindows licence
/////////////////////////////////////////////////////////////////////////////
#ifndef _WX_WXMMSTREAM_H__
#define _WX_WXMMSTREAM_H__
#include "wx/defs.h"
#if wxUSE_STREAMS
#include "wx/stream.h"
class WXDLLIMPEXP_FWD_BASE wxMemoryOutputStream;
class WXDLLIMPEXP_BASE wxMemoryInputStream : public wxInputStream
{
public:
wxMemoryInputStream(const void *data, size_t length);
wxMemoryInputStream(const wxMemoryOutputStream& stream);
wxMemoryInputStream(wxInputStream& stream,
wxFileOffset lenFile = wxInvalidOffset)
{
InitFromStream(stream, lenFile);
}
wxMemoryInputStream(wxMemoryInputStream& stream)
: wxInputStream()
{
InitFromStream(stream, wxInvalidOffset);
}
virtual ~wxMemoryInputStream();
virtual wxFileOffset GetLength() const wxOVERRIDE { return m_length; }
virtual bool IsSeekable() const wxOVERRIDE { return true; }
virtual char Peek() wxOVERRIDE;
virtual bool CanRead() const wxOVERRIDE;
wxStreamBuffer *GetInputStreamBuffer() const { return m_i_streambuf; }
protected:
wxStreamBuffer *m_i_streambuf;
size_t OnSysRead(void *buffer, size_t nbytes) wxOVERRIDE;
wxFileOffset OnSysSeek(wxFileOffset pos, wxSeekMode mode) wxOVERRIDE;
wxFileOffset OnSysTell() const wxOVERRIDE;
private:
// common part of ctors taking wxInputStream
void InitFromStream(wxInputStream& stream, wxFileOffset lenFile);
size_t m_length;
// copy ctor is implemented above: it copies the other stream in this one
wxDECLARE_ABSTRACT_CLASS(wxMemoryInputStream);
wxDECLARE_NO_ASSIGN_CLASS(wxMemoryInputStream);
};
class WXDLLIMPEXP_BASE wxMemoryOutputStream : public wxOutputStream
{
public:
// if data is !NULL it must be allocated with malloc()
wxMemoryOutputStream(void *data = NULL, size_t length = 0);
virtual ~wxMemoryOutputStream();
virtual wxFileOffset GetLength() const wxOVERRIDE { return m_o_streambuf->GetLastAccess(); }
virtual bool IsSeekable() const wxOVERRIDE { return true; }
size_t CopyTo(void *buffer, size_t len) const;
wxStreamBuffer *GetOutputStreamBuffer() const { return m_o_streambuf; }
protected:
wxStreamBuffer *m_o_streambuf;
protected:
size_t OnSysWrite(const void *buffer, size_t nbytes) wxOVERRIDE;
wxFileOffset OnSysSeek(wxFileOffset pos, wxSeekMode mode) wxOVERRIDE;
wxFileOffset OnSysTell() const wxOVERRIDE;
wxDECLARE_DYNAMIC_CLASS(wxMemoryOutputStream);
wxDECLARE_NO_COPY_CLASS(wxMemoryOutputStream);
};
#endif
// wxUSE_STREAMS
#endif
// _WX_WXMMSTREAM_H__
| h |
rticonnextdds-usecases | data/projects/rticonnextdds-usecases/VehicleTracking/ExampleCode/thirdparty/wxWidgets-3.1.2/Win32/include/wx/dataview.h | /////////////////////////////////////////////////////////////////////////////
// Name: wx/dataview.h
// Purpose: wxDataViewCtrl base classes
// Author: Robert Roebling
// Modified by: Bo Yang
// Created: 08.01.06
// Copyright: (c) Robert Roebling
// Licence: wxWindows licence
/////////////////////////////////////////////////////////////////////////////
#ifndef _WX_DATAVIEW_H_BASE_
#define _WX_DATAVIEW_H_BASE_
#include "wx/defs.h"
#if wxUSE_DATAVIEWCTRL
#include "wx/textctrl.h"
#include "wx/headercol.h"
#include "wx/variant.h"
#include "wx/dnd.h" // For wxDragResult declaration only.
#include "wx/dynarray.h"
#include "wx/icon.h"
#include "wx/itemid.h"
#include "wx/weakref.h"
#include "wx/vector.h"
#include "wx/dataobj.h"
#include "wx/withimages.h"
#include "wx/systhemectrl.h"
#include "wx/vector.h"
class WXDLLIMPEXP_FWD_CORE wxImageList;
class wxItemAttr;
class WXDLLIMPEXP_FWD_CORE wxHeaderCtrl;
#if !(defined(__WXGTK20__) || defined(__WXOSX__) ) || defined(__WXUNIVERSAL__)
// #if !(defined(__WXOSX__)) || defined(__WXUNIVERSAL__)
#define wxHAS_GENERIC_DATAVIEWCTRL
#endif
#ifdef wxHAS_GENERIC_DATAVIEWCTRL
// this symbol doesn't follow the convention for wxUSE_XXX symbols which
// are normally always defined as either 0 or 1, so its use is deprecated
// and it only exists for backwards compatibility, don't use it any more
// and use wxHAS_GENERIC_DATAVIEWCTRL instead
#define wxUSE_GENERICDATAVIEWCTRL
#endif
// ----------------------------------------------------------------------------
// wxDataViewCtrl globals
// ----------------------------------------------------------------------------
class WXDLLIMPEXP_FWD_CORE wxDataViewModel;
class WXDLLIMPEXP_FWD_CORE wxDataViewCtrl;
class WXDLLIMPEXP_FWD_CORE wxDataViewColumn;
class WXDLLIMPEXP_FWD_CORE wxDataViewRenderer;
class WXDLLIMPEXP_FWD_CORE wxDataViewModelNotifier;
#if wxUSE_ACCESSIBILITY
class WXDLLIMPEXP_FWD_CORE wxDataViewCtrlAccessible;
#endif // wxUSE_ACCESSIBILITY
extern WXDLLIMPEXP_DATA_CORE(const char) wxDataViewCtrlNameStr[];
// ----------------------------------------------------------------------------
// wxDataViewCtrl flags
// ----------------------------------------------------------------------------
// size of a wxDataViewRenderer without contents:
#define wxDVC_DEFAULT_RENDERER_SIZE 20
// the default width of new (text) columns:
#define wxDVC_DEFAULT_WIDTH 80
// the default width of new toggle columns:
#define wxDVC_TOGGLE_DEFAULT_WIDTH 30
// the default minimal width of the columns:
#define wxDVC_DEFAULT_MINWIDTH 30
// The default alignment of wxDataViewRenderers is to take
// the alignment from the column it owns.
#define wxDVR_DEFAULT_ALIGNMENT -1
// ---------------------------------------------------------
// wxDataViewItem
// ---------------------------------------------------------
// Make it a class and not a typedef to allow forward declaring it.
class wxDataViewItem : public wxItemId<void*>
{
public:
wxDataViewItem() : wxItemId<void*>() { }
explicit wxDataViewItem(void* pItem) : wxItemId<void*>(pItem) { }
};
WX_DEFINE_ARRAY(wxDataViewItem, wxDataViewItemArray);
// ---------------------------------------------------------
// wxDataViewModelNotifier
// ---------------------------------------------------------
class WXDLLIMPEXP_CORE wxDataViewModelNotifier
{
public:
wxDataViewModelNotifier() { m_owner = NULL; }
virtual ~wxDataViewModelNotifier() { m_owner = NULL; }
virtual bool ItemAdded( const wxDataViewItem &parent, const wxDataViewItem &item ) = 0;
virtual bool ItemDeleted( const wxDataViewItem &parent, const wxDataViewItem &item ) = 0;
virtual bool ItemChanged( const wxDataViewItem &item ) = 0;
virtual bool ItemsAdded( const wxDataViewItem &parent, const wxDataViewItemArray &items );
virtual bool ItemsDeleted( const wxDataViewItem &parent, const wxDataViewItemArray &items );
virtual bool ItemsChanged( const wxDataViewItemArray &items );
virtual bool ValueChanged( const wxDataViewItem &item, unsigned int col ) = 0;
virtual bool Cleared() = 0;
// some platforms, such as GTK+, may need a two step procedure for ::Reset()
virtual bool BeforeReset() { return true; }
virtual bool AfterReset() { return Cleared(); }
virtual void Resort() = 0;
void SetOwner( wxDataViewModel *owner ) { m_owner = owner; }
wxDataViewModel *GetOwner() const { return m_owner; }
private:
wxDataViewModel *m_owner;
};
// ----------------------------------------------------------------------------
// wxDataViewItemAttr: a structure containing the visual attributes of an item
// ----------------------------------------------------------------------------
// TODO: Merge with wxItemAttr somehow.
class WXDLLIMPEXP_CORE wxDataViewItemAttr
{
public:
// ctors
wxDataViewItemAttr()
{
m_bold = false;
m_italic = false;
m_strikethrough = false;
}
// setters
void SetColour(const wxColour& colour) { m_colour = colour; }
void SetBold( bool set ) { m_bold = set; }
void SetItalic( bool set ) { m_italic = set; }
void SetStrikethrough( bool set ) { m_strikethrough = set; }
void SetBackgroundColour(const wxColour& colour) { m_bgColour = colour; }
// accessors
bool HasColour() const { return m_colour.IsOk(); }
const wxColour& GetColour() const { return m_colour; }
bool HasFont() const { return m_bold || m_italic || m_strikethrough; }
bool GetBold() const { return m_bold; }
bool GetItalic() const { return m_italic; }
bool GetStrikethrough() const { return m_strikethrough; }
bool HasBackgroundColour() const { return m_bgColour.IsOk(); }
const wxColour& GetBackgroundColour() const { return m_bgColour; }
bool IsDefault() const { return !(HasColour() || HasFont() || HasBackgroundColour()); }
// Return the font based on the given one with this attribute applied to it.
wxFont GetEffectiveFont(const wxFont& font) const;
private:
wxColour m_colour;
bool m_bold;
bool m_italic;
bool m_strikethrough;
wxColour m_bgColour;
};
// ---------------------------------------------------------
// wxDataViewModel
// ---------------------------------------------------------
typedef wxVector<wxDataViewModelNotifier*> wxDataViewModelNotifiers;
class WXDLLIMPEXP_CORE wxDataViewModel: public wxRefCounter
{
public:
wxDataViewModel();
virtual unsigned int GetColumnCount() const = 0;
// return type as reported by wxVariant
virtual wxString GetColumnType( unsigned int col ) const = 0;
// get value into a wxVariant
virtual void GetValue( wxVariant &variant,
const wxDataViewItem &item, unsigned int col ) const = 0;
// return true if the given item has a value to display in the given
// column: this is always true except for container items which by default
// only show their label in the first column (but see HasContainerColumns())
bool HasValue(const wxDataViewItem& item, unsigned col) const
{
return col == 0 || !IsContainer(item) || HasContainerColumns(item);
}
// usually ValueChanged() should be called after changing the value in the
// model to update the control, ChangeValue() does it on its own while
// SetValue() does not -- so while you will override SetValue(), you should
// be usually calling ChangeValue()
virtual bool SetValue(const wxVariant &variant,
const wxDataViewItem &item,
unsigned int col) = 0;
bool ChangeValue(const wxVariant& variant,
const wxDataViewItem& item,
unsigned int col)
{
return SetValue(variant, item, col) && ValueChanged(item, col);
}
// Get text attribute, return false of default attributes should be used
virtual bool GetAttr(const wxDataViewItem &WXUNUSED(item),
unsigned int WXUNUSED(col),
wxDataViewItemAttr &WXUNUSED(attr)) const
{
return false;
}
// Override this if you want to disable specific items
virtual bool IsEnabled(const wxDataViewItem &WXUNUSED(item),
unsigned int WXUNUSED(col)) const
{
return true;
}
// define hierarchy
virtual wxDataViewItem GetParent( const wxDataViewItem &item ) const = 0;
virtual bool IsContainer( const wxDataViewItem &item ) const = 0;
// Is the container just a header or an item with all columns
virtual bool HasContainerColumns(const wxDataViewItem& WXUNUSED(item)) const
{ return false; }
virtual unsigned int GetChildren( const wxDataViewItem &item, wxDataViewItemArray &children ) const = 0;
// delegated notifiers
bool ItemAdded( const wxDataViewItem &parent, const wxDataViewItem &item );
bool ItemsAdded( const wxDataViewItem &parent, const wxDataViewItemArray &items );
bool ItemDeleted( const wxDataViewItem &parent, const wxDataViewItem &item );
bool ItemsDeleted( const wxDataViewItem &parent, const wxDataViewItemArray &items );
bool ItemChanged( const wxDataViewItem &item );
bool ItemsChanged( const wxDataViewItemArray &items );
bool ValueChanged( const wxDataViewItem &item, unsigned int col );
bool Cleared();
// some platforms, such as GTK+, may need a two step procedure for ::Reset()
bool BeforeReset();
bool AfterReset();
// delegated action
virtual void Resort();
void AddNotifier( wxDataViewModelNotifier *notifier );
void RemoveNotifier( wxDataViewModelNotifier *notifier );
// default compare function
virtual int Compare( const wxDataViewItem &item1, const wxDataViewItem &item2,
unsigned int column, bool ascending ) const;
virtual bool HasDefaultCompare() const { return false; }
// internal
virtual bool IsListModel() const { return false; }
virtual bool IsVirtualListModel() const { return false; }
protected:
// Dtor is protected because the objects of this class must not be deleted,
// DecRef() must be used instead.
virtual ~wxDataViewModel();
// Helper function used by the default Compare() implementation to compare
// values of types it is not aware about. Can be overridden in the derived
// classes that use columns of custom types.
virtual int DoCompareValues(const wxVariant& WXUNUSED(value1),
const wxVariant& WXUNUSED(value2)) const
{
return 0;
}
private:
wxDataViewModelNotifiers m_notifiers;
};
// ----------------------------------------------------------------------------
// wxDataViewListModel: a model of a list, i.e. flat data structure without any
// branches/containers, used as base class by wxDataViewIndexListModel and
// wxDataViewVirtualListModel
// ----------------------------------------------------------------------------
class WXDLLIMPEXP_CORE wxDataViewListModel : public wxDataViewModel
{
public:
// derived classes should override these methods instead of
// {Get,Set}Value() and GetAttr() inherited from the base class
virtual void GetValueByRow(wxVariant &variant,
unsigned row, unsigned col) const = 0;
virtual bool SetValueByRow(const wxVariant &variant,
unsigned row, unsigned col) = 0;
virtual bool
GetAttrByRow(unsigned WXUNUSED(row), unsigned WXUNUSED(col),
wxDataViewItemAttr &WXUNUSED(attr)) const
{
return false;
}
virtual bool IsEnabledByRow(unsigned int WXUNUSED(row),
unsigned int WXUNUSED(col)) const
{
return true;
}
// helper methods provided by list models only
virtual unsigned GetRow( const wxDataViewItem &item ) const = 0;
// returns the number of rows
virtual unsigned int GetCount() const = 0;
// implement some base class pure virtual directly
virtual wxDataViewItem
GetParent( const wxDataViewItem & WXUNUSED(item) ) const wxOVERRIDE
{
// items never have valid parent in this model
return wxDataViewItem();
}
virtual bool IsContainer( const wxDataViewItem &item ) const wxOVERRIDE
{
// only the invisible (and invalid) root item has children
return !item.IsOk();
}
// and implement some others by forwarding them to our own ones
virtual void GetValue( wxVariant &variant,
const wxDataViewItem &item, unsigned int col ) const wxOVERRIDE
{
GetValueByRow(variant, GetRow(item), col);
}
virtual bool SetValue( const wxVariant &variant,
const wxDataViewItem &item, unsigned int col ) wxOVERRIDE
{
return SetValueByRow( variant, GetRow(item), col );
}
virtual bool GetAttr(const wxDataViewItem &item, unsigned int col,
wxDataViewItemAttr &attr) const wxOVERRIDE
{
return GetAttrByRow( GetRow(item), col, attr );
}
virtual bool IsEnabled(const wxDataViewItem &item, unsigned int col) const wxOVERRIDE
{
return IsEnabledByRow( GetRow(item), col );
}
virtual bool IsListModel() const wxOVERRIDE { return true; }
};
// ---------------------------------------------------------
// wxDataViewIndexListModel
// ---------------------------------------------------------
class WXDLLIMPEXP_CORE wxDataViewIndexListModel: public wxDataViewListModel
{
public:
wxDataViewIndexListModel( unsigned int initial_size = 0 );
void RowPrepended();
void RowInserted( unsigned int before );
void RowAppended();
void RowDeleted( unsigned int row );
void RowsDeleted( const wxArrayInt &rows );
void RowChanged( unsigned int row );
void RowValueChanged( unsigned int row, unsigned int col );
void Reset( unsigned int new_size );
// convert to/from row/wxDataViewItem
virtual unsigned GetRow( const wxDataViewItem &item ) const wxOVERRIDE;
wxDataViewItem GetItem( unsigned int row ) const;
// implement base methods
virtual unsigned int GetChildren( const wxDataViewItem &item, wxDataViewItemArray &children ) const wxOVERRIDE;
unsigned int GetCount() const wxOVERRIDE { return (unsigned int)m_hash.GetCount(); }
private:
wxDataViewItemArray m_hash;
unsigned int m_nextFreeID;
bool m_ordered;
};
// ---------------------------------------------------------
// wxDataViewVirtualListModel
// ---------------------------------------------------------
#ifdef __WXMAC__
// better than nothing
typedef wxDataViewIndexListModel wxDataViewVirtualListModel;
#else
class WXDLLIMPEXP_CORE wxDataViewVirtualListModel: public wxDataViewListModel
{
public:
wxDataViewVirtualListModel( unsigned int initial_size = 0 );
void RowPrepended();
void RowInserted( unsigned int before );
void RowAppended();
void RowDeleted( unsigned int row );
void RowsDeleted( const wxArrayInt &rows );
void RowChanged( unsigned int row );
void RowValueChanged( unsigned int row, unsigned int col );
void Reset( unsigned int new_size );
// convert to/from row/wxDataViewItem
virtual unsigned GetRow( const wxDataViewItem &item ) const wxOVERRIDE;
wxDataViewItem GetItem( unsigned int row ) const;
// compare based on index
virtual int Compare( const wxDataViewItem &item1, const wxDataViewItem &item2,
unsigned int column, bool ascending ) const wxOVERRIDE;
virtual bool HasDefaultCompare() const wxOVERRIDE;
// implement base methods
virtual unsigned int GetChildren( const wxDataViewItem &item, wxDataViewItemArray &children ) const wxOVERRIDE;
unsigned int GetCount() const wxOVERRIDE { return m_size; }
// internal
virtual bool IsVirtualListModel() const wxOVERRIDE { return true; }
private:
unsigned int m_size;
};
#endif
// ----------------------------------------------------------------------------
// wxDataViewRenderer and related classes
// ----------------------------------------------------------------------------
#include "wx/dvrenderers.h"
// ---------------------------------------------------------
// wxDataViewColumnBase
// ---------------------------------------------------------
// for compatibility only, do not use
enum wxDataViewColumnFlags
{
wxDATAVIEW_COL_RESIZABLE = wxCOL_RESIZABLE,
wxDATAVIEW_COL_SORTABLE = wxCOL_SORTABLE,
wxDATAVIEW_COL_REORDERABLE = wxCOL_REORDERABLE,
wxDATAVIEW_COL_HIDDEN = wxCOL_HIDDEN
};
class WXDLLIMPEXP_CORE wxDataViewColumnBase : public wxSettableHeaderColumn
{
public:
// ctor for the text columns: takes ownership of renderer
wxDataViewColumnBase(wxDataViewRenderer *renderer,
unsigned int model_column)
{
Init(renderer, model_column);
}
// ctor for the bitmap columns
wxDataViewColumnBase(const wxBitmap& bitmap,
wxDataViewRenderer *renderer,
unsigned int model_column)
: m_bitmap(bitmap)
{
Init(renderer, model_column);
}
virtual ~wxDataViewColumnBase();
// setters:
virtual void SetOwner( wxDataViewCtrl *owner )
{ m_owner = owner; }
// getters:
unsigned int GetModelColumn() const { return static_cast<unsigned int>(m_model_column); }
wxDataViewCtrl *GetOwner() const { return m_owner; }
wxDataViewRenderer* GetRenderer() const { return m_renderer; }
// implement some of base class pure virtuals (the rest is port-dependent
// and done differently in generic and native versions)
virtual void SetBitmap( const wxBitmap& bitmap ) wxOVERRIDE { m_bitmap = bitmap; }
virtual wxBitmap GetBitmap() const wxOVERRIDE { return m_bitmap; }
protected:
wxDataViewRenderer *m_renderer;
int m_model_column;
wxBitmap m_bitmap;
wxDataViewCtrl *m_owner;
private:
// common part of all ctors
void Init(wxDataViewRenderer *renderer, unsigned int model_column);
};
// ---------------------------------------------------------
// wxDataViewCtrlBase
// ---------------------------------------------------------
#define wxDV_SINGLE 0x0000 // for convenience
#define wxDV_MULTIPLE 0x0001 // can select multiple items
#define wxDV_NO_HEADER 0x0002 // column titles not visible
#define wxDV_HORIZ_RULES 0x0004 // light horizontal rules between rows
#define wxDV_VERT_RULES 0x0008 // light vertical rules between columns
#define wxDV_ROW_LINES 0x0010 // alternating colour in rows
#define wxDV_VARIABLE_LINE_HEIGHT 0x0020 // variable line height
class WXDLLIMPEXP_CORE wxDataViewCtrlBase: public wxSystemThemedControl<wxControl>
{
public:
wxDataViewCtrlBase();
virtual ~wxDataViewCtrlBase();
// model
// -----
virtual bool AssociateModel( wxDataViewModel *model );
wxDataViewModel* GetModel();
const wxDataViewModel* GetModel() const;
// column management
// -----------------
wxDataViewColumn *PrependTextColumn( const wxString &label, unsigned int model_column,
wxDataViewCellMode mode = wxDATAVIEW_CELL_INERT, int width = -1,
wxAlignment align = wxALIGN_NOT,
int flags = wxDATAVIEW_COL_RESIZABLE );
wxDataViewColumn *PrependIconTextColumn( const wxString &label, unsigned int model_column,
wxDataViewCellMode mode = wxDATAVIEW_CELL_INERT, int width = -1,
wxAlignment align = wxALIGN_NOT,
int flags = wxDATAVIEW_COL_RESIZABLE );
wxDataViewColumn *PrependToggleColumn( const wxString &label, unsigned int model_column,
wxDataViewCellMode mode = wxDATAVIEW_CELL_INERT, int width = wxDVC_TOGGLE_DEFAULT_WIDTH,
wxAlignment align = wxALIGN_CENTER,
int flags = wxDATAVIEW_COL_RESIZABLE );
wxDataViewColumn *PrependProgressColumn( const wxString &label, unsigned int model_column,
wxDataViewCellMode mode = wxDATAVIEW_CELL_INERT, int width = wxDVC_DEFAULT_WIDTH,
wxAlignment align = wxALIGN_CENTER,
int flags = wxDATAVIEW_COL_RESIZABLE );
wxDataViewColumn *PrependDateColumn( const wxString &label, unsigned int model_column,
wxDataViewCellMode mode = wxDATAVIEW_CELL_ACTIVATABLE, int width = -1,
wxAlignment align = wxALIGN_NOT,
int flags = wxDATAVIEW_COL_RESIZABLE );
wxDataViewColumn *PrependBitmapColumn( const wxString &label, unsigned int model_column,
wxDataViewCellMode mode = wxDATAVIEW_CELL_INERT, int width = -1,
wxAlignment align = wxALIGN_CENTER,
int flags = wxDATAVIEW_COL_RESIZABLE );
wxDataViewColumn *PrependTextColumn( const wxBitmap &label, unsigned int model_column,
wxDataViewCellMode mode = wxDATAVIEW_CELL_INERT, int width = -1,
wxAlignment align = wxALIGN_NOT,
int flags = wxDATAVIEW_COL_RESIZABLE );
wxDataViewColumn *PrependIconTextColumn( const wxBitmap &label, unsigned int model_column,
wxDataViewCellMode mode = wxDATAVIEW_CELL_INERT, int width = -1,
wxAlignment align = wxALIGN_NOT,
int flags = wxDATAVIEW_COL_RESIZABLE );
wxDataViewColumn *PrependToggleColumn( const wxBitmap &label, unsigned int model_column,
wxDataViewCellMode mode = wxDATAVIEW_CELL_INERT, int width = wxDVC_TOGGLE_DEFAULT_WIDTH,
wxAlignment align = wxALIGN_CENTER,
int flags = wxDATAVIEW_COL_RESIZABLE );
wxDataViewColumn *PrependProgressColumn( const wxBitmap &label, unsigned int model_column,
wxDataViewCellMode mode = wxDATAVIEW_CELL_INERT, int width = wxDVC_DEFAULT_WIDTH,
wxAlignment align = wxALIGN_CENTER,
int flags = wxDATAVIEW_COL_RESIZABLE );
wxDataViewColumn *PrependDateColumn( const wxBitmap &label, unsigned int model_column,
wxDataViewCellMode mode = wxDATAVIEW_CELL_ACTIVATABLE, int width = -1,
wxAlignment align = wxALIGN_NOT,
int flags = wxDATAVIEW_COL_RESIZABLE );
wxDataViewColumn *PrependBitmapColumn( const wxBitmap &label, unsigned int model_column,
wxDataViewCellMode mode = wxDATAVIEW_CELL_INERT, int width = -1,
wxAlignment align = wxALIGN_CENTER,
int flags = wxDATAVIEW_COL_RESIZABLE );
wxDataViewColumn *AppendTextColumn( const wxString &label, unsigned int model_column,
wxDataViewCellMode mode = wxDATAVIEW_CELL_INERT, int width = -1,
wxAlignment align = wxALIGN_NOT,
int flags = wxDATAVIEW_COL_RESIZABLE );
wxDataViewColumn *AppendIconTextColumn( const wxString &label, unsigned int model_column,
wxDataViewCellMode mode = wxDATAVIEW_CELL_INERT, int width = -1,
wxAlignment align = wxALIGN_NOT,
int flags = wxDATAVIEW_COL_RESIZABLE );
wxDataViewColumn *AppendToggleColumn( const wxString &label, unsigned int model_column,
wxDataViewCellMode mode = wxDATAVIEW_CELL_INERT, int width = wxDVC_TOGGLE_DEFAULT_WIDTH,
wxAlignment align = wxALIGN_CENTER,
int flags = wxDATAVIEW_COL_RESIZABLE );
wxDataViewColumn *AppendProgressColumn( const wxString &label, unsigned int model_column,
wxDataViewCellMode mode = wxDATAVIEW_CELL_INERT, int width = wxDVC_DEFAULT_WIDTH,
wxAlignment align = wxALIGN_CENTER,
int flags = wxDATAVIEW_COL_RESIZABLE );
wxDataViewColumn *AppendDateColumn( const wxString &label, unsigned int model_column,
wxDataViewCellMode mode = wxDATAVIEW_CELL_ACTIVATABLE, int width = -1,
wxAlignment align = wxALIGN_NOT,
int flags = wxDATAVIEW_COL_RESIZABLE );
wxDataViewColumn *AppendBitmapColumn( const wxString &label, unsigned int model_column,
wxDataViewCellMode mode = wxDATAVIEW_CELL_INERT, int width = -1,
wxAlignment align = wxALIGN_CENTER,
int flags = wxDATAVIEW_COL_RESIZABLE );
wxDataViewColumn *AppendTextColumn( const wxBitmap &label, unsigned int model_column,
wxDataViewCellMode mode = wxDATAVIEW_CELL_INERT, int width = -1,
wxAlignment align = wxALIGN_NOT,
int flags = wxDATAVIEW_COL_RESIZABLE );
wxDataViewColumn *AppendIconTextColumn( const wxBitmap &label, unsigned int model_column,
wxDataViewCellMode mode = wxDATAVIEW_CELL_INERT, int width = -1,
wxAlignment align = wxALIGN_NOT,
int flags = wxDATAVIEW_COL_RESIZABLE );
wxDataViewColumn *AppendToggleColumn( const wxBitmap &label, unsigned int model_column,
wxDataViewCellMode mode = wxDATAVIEW_CELL_INERT, int width = wxDVC_TOGGLE_DEFAULT_WIDTH,
wxAlignment align = wxALIGN_CENTER,
int flags = wxDATAVIEW_COL_RESIZABLE );
wxDataViewColumn *AppendProgressColumn( const wxBitmap &label, unsigned int model_column,
wxDataViewCellMode mode = wxDATAVIEW_CELL_INERT, int width = wxDVC_DEFAULT_WIDTH,
wxAlignment align = wxALIGN_CENTER,
int flags = wxDATAVIEW_COL_RESIZABLE );
wxDataViewColumn *AppendDateColumn( const wxBitmap &label, unsigned int model_column,
wxDataViewCellMode mode = wxDATAVIEW_CELL_ACTIVATABLE, int width = -1,
wxAlignment align = wxALIGN_NOT,
int flags = wxDATAVIEW_COL_RESIZABLE );
wxDataViewColumn *AppendBitmapColumn( const wxBitmap &label, unsigned int model_column,
wxDataViewCellMode mode = wxDATAVIEW_CELL_INERT, int width = -1,
wxAlignment align = wxALIGN_CENTER,
int flags = wxDATAVIEW_COL_RESIZABLE );
virtual bool PrependColumn( wxDataViewColumn *col );
virtual bool InsertColumn( unsigned int pos, wxDataViewColumn *col );
virtual bool AppendColumn( wxDataViewColumn *col );
virtual unsigned int GetColumnCount() const = 0;
virtual wxDataViewColumn* GetColumn( unsigned int pos ) const = 0;
virtual int GetColumnPosition( const wxDataViewColumn *column ) const = 0;
virtual bool DeleteColumn( wxDataViewColumn *column ) = 0;
virtual bool ClearColumns() = 0;
void SetExpanderColumn( wxDataViewColumn *col )
{ m_expander_column = col ; DoSetExpanderColumn(); }
wxDataViewColumn *GetExpanderColumn() const
{ return m_expander_column; }
virtual wxDataViewColumn *GetSortingColumn() const = 0;
virtual wxVector<wxDataViewColumn *> GetSortingColumns() const
{
wxVector<wxDataViewColumn *> columns;
if ( wxDataViewColumn* col = GetSortingColumn() )
columns.push_back(col);
return columns;
}
// This must be overridden to return true if the control does allow sorting
// by more than one column, which is not the case by default.
virtual bool AllowMultiColumnSort(bool allow)
{
// We can still return true when disabling multi-column sort.
return !allow;
}
// Return true if multi column sort is currently allowed.
virtual bool IsMultiColumnSortAllowed() const { return false; }
// This should also be overridden to actually use the specified column for
// sorting if using multiple columns is supported.
virtual void ToggleSortByColumn(int WXUNUSED(column)) { }
// items management
// ----------------
void SetIndent( int indent )
{ m_indent = indent ; DoSetIndent(); }
int GetIndent() const
{ return m_indent; }
// Current item is the one used by the keyboard navigation, it is the same
// as the (unique) selected item in single selection mode so these
// functions are mostly useful for controls with wxDV_MULTIPLE style.
wxDataViewItem GetCurrentItem() const;
void SetCurrentItem(const wxDataViewItem& item);
virtual wxDataViewItem GetTopItem() const { return wxDataViewItem(0); }
virtual int GetCountPerPage() const { return wxNOT_FOUND; }
// Currently focused column of the current item or NULL if no column has focus
virtual wxDataViewColumn *GetCurrentColumn() const = 0;
// Selection: both GetSelection() and GetSelections() can be used for the
// controls both with and without wxDV_MULTIPLE style. For single selection
// controls GetSelections() is not very useful however. And for multi
// selection controls GetSelection() returns an invalid item if more than
// one item is selected. Use GetSelectedItemsCount() or HasSelection() to
// check if any items are selected at all.
virtual int GetSelectedItemsCount() const = 0;
bool HasSelection() const { return GetSelectedItemsCount() != 0; }
wxDataViewItem GetSelection() const;
virtual int GetSelections( wxDataViewItemArray & sel ) const = 0;
virtual void SetSelections( const wxDataViewItemArray & sel ) = 0;
virtual void Select( const wxDataViewItem & item ) = 0;
virtual void Unselect( const wxDataViewItem & item ) = 0;
virtual bool IsSelected( const wxDataViewItem & item ) const = 0;
virtual void SelectAll() = 0;
virtual void UnselectAll() = 0;
void Expand( const wxDataViewItem & item );
void ExpandAncestors( const wxDataViewItem & item );
virtual void Collapse( const wxDataViewItem & item ) = 0;
virtual bool IsExpanded( const wxDataViewItem & item ) const = 0;
virtual void EnsureVisible( const wxDataViewItem & item,
const wxDataViewColumn *column = NULL ) = 0;
virtual void HitTest( const wxPoint & point, wxDataViewItem &item, wxDataViewColumn* &column ) const = 0;
virtual wxRect GetItemRect( const wxDataViewItem & item, const wxDataViewColumn *column = NULL ) const = 0;
virtual bool SetRowHeight( int WXUNUSED(rowHeight) ) { return false; }
virtual void EditItem(const wxDataViewItem& item, const wxDataViewColumn *column) = 0;
// Use EditItem() instead
wxDEPRECATED( void StartEditor(const wxDataViewItem& item, unsigned int column) );
#if wxUSE_DRAG_AND_DROP
virtual bool EnableDragSource(const wxDataFormat& WXUNUSED(format))
{ return false; }
virtual bool EnableDropTarget(const wxDataFormat& WXUNUSED(format))
{ return false; }
#endif // wxUSE_DRAG_AND_DROP
// define control visual attributes
// --------------------------------
// Header attributes: only implemented in the generic version currently.
virtual bool SetHeaderAttr(const wxItemAttr& WXUNUSED(attr))
{ return false; }
// Set the colour used for the "alternate" rows when wxDV_ROW_LINES is on.
// Also only supported in the generic version, which returns true to
// indicate it.
virtual bool SetAlternateRowColour(const wxColour& WXUNUSED(colour))
{ return false; }
virtual wxVisualAttributes GetDefaultAttributes() const wxOVERRIDE
{
return GetClassDefaultAttributes(GetWindowVariant());
}
static wxVisualAttributes
GetClassDefaultAttributes(wxWindowVariant variant = wxWINDOW_VARIANT_NORMAL)
{
return wxControl::GetCompositeControlsDefaultAttributes(variant);
}
protected:
virtual void DoSetExpanderColumn() = 0 ;
virtual void DoSetIndent() = 0;
// Just expand this item assuming it is already shown, i.e. its parent has
// been already expanded using ExpandAncestors().
virtual void DoExpand(const wxDataViewItem & item) = 0;
private:
// Implementation of the public Set/GetCurrentItem() methods which are only
// called in multi selection case (for single selection controls their
// implementation is trivial and is done in the base class itself).
virtual wxDataViewItem DoGetCurrentItem() const = 0;
virtual void DoSetCurrentItem(const wxDataViewItem& item) = 0;
wxDataViewModel *m_model;
wxDataViewColumn *m_expander_column;
int m_indent ;
protected:
wxDECLARE_DYNAMIC_CLASS_NO_COPY(wxDataViewCtrlBase);
};
// ----------------------------------------------------------------------------
// wxDataViewEvent - the event class for the wxDataViewCtrl notifications
// ----------------------------------------------------------------------------
class WXDLLIMPEXP_CORE wxDataViewEvent : public wxNotifyEvent
{
public:
// Default ctor, normally shouldn't be used and mostly exists only for
// backwards compatibility.
wxDataViewEvent()
: wxNotifyEvent()
{
Init(NULL, NULL, wxDataViewItem());
}
// Constructor for the events affecting columns (and possibly also items).
wxDataViewEvent(wxEventType evtType,
wxDataViewCtrlBase* dvc,
wxDataViewColumn* column,
const wxDataViewItem& item = wxDataViewItem())
: wxNotifyEvent(evtType, dvc->GetId())
{
Init(dvc, column, item);
}
// Constructor for the events affecting only the items.
wxDataViewEvent(wxEventType evtType,
wxDataViewCtrlBase* dvc,
const wxDataViewItem& item)
: wxNotifyEvent(evtType, dvc->GetId())
{
Init(dvc, NULL, item);
}
wxDataViewEvent(const wxDataViewEvent& event)
: wxNotifyEvent(event),
m_item(event.m_item),
m_col(event.m_col),
m_model(event.m_model),
m_value(event.m_value),
m_column(event.m_column),
m_pos(event.m_pos),
m_cacheFrom(event.m_cacheFrom),
m_cacheTo(event.m_cacheTo),
m_editCancelled(event.m_editCancelled)
#if wxUSE_DRAG_AND_DROP
, m_dataObject(event.m_dataObject),
m_dataFormat(event.m_dataFormat),
m_dataBuffer(event.m_dataBuffer),
m_dataSize(event.m_dataSize),
m_dragFlags(event.m_dragFlags),
m_dropEffect(event.m_dropEffect),
m_proposedDropIndex(event.m_proposedDropIndex)
#endif
{ }
wxDataViewItem GetItem() const { return m_item; }
int GetColumn() const { return m_col; }
wxDataViewModel* GetModel() const { return m_model; }
const wxVariant &GetValue() const { return m_value; }
void SetValue( const wxVariant &value ) { m_value = value; }
// for wxEVT_DATAVIEW_ITEM_EDITING_DONE only
bool IsEditCancelled() const { return m_editCancelled; }
// for wxEVT_DATAVIEW_COLUMN_HEADER_CLICKED only
wxDataViewColumn *GetDataViewColumn() const { return m_column; }
// for wxEVT_DATAVIEW_CONTEXT_MENU only
wxPoint GetPosition() const { return m_pos; }
void SetPosition( int x, int y ) { m_pos.x = x; m_pos.y = y; }
// For wxEVT_DATAVIEW_CACHE_HINT
int GetCacheFrom() const { return m_cacheFrom; }
int GetCacheTo() const { return m_cacheTo; }
void SetCache(int from, int to) { m_cacheFrom = from; m_cacheTo = to; }
#if wxUSE_DRAG_AND_DROP
// For drag operations
void SetDataObject( wxDataObject *obj ) { m_dataObject = obj; }
wxDataObject *GetDataObject() const { return m_dataObject; }
// For drop operations
void SetDataFormat( const wxDataFormat &format ) { m_dataFormat = format; }
wxDataFormat GetDataFormat() const { return m_dataFormat; }
void SetDataSize( size_t size ) { m_dataSize = size; }
size_t GetDataSize() const { return m_dataSize; }
void SetDataBuffer( void* buf ) { m_dataBuffer = buf;}
void *GetDataBuffer() const { return m_dataBuffer; }
void SetDragFlags( int flags ) { m_dragFlags = flags; }
int GetDragFlags() const { return m_dragFlags; }
void SetDropEffect( wxDragResult effect ) { m_dropEffect = effect; }
wxDragResult GetDropEffect() const { return m_dropEffect; }
// for plaforms (currently only OSX) that support Drag/Drop insertion of items,
// this is the proposed child index for the insertion
void SetProposedDropIndex(int index) { m_proposedDropIndex = index; }
int GetProposedDropIndex() const { return m_proposedDropIndex;}
#endif // wxUSE_DRAG_AND_DROP
virtual wxEvent *Clone() const wxOVERRIDE { return new wxDataViewEvent(*this); }
// These methods shouldn't be used outside of wxWidgets and wxWidgets
// itself doesn't use them any longer neither as it constructs the events
// with the appropriate ctors directly.
#if WXWIN_COMPATIBILITY_3_0
wxDEPRECATED_MSG("Pass the argument to the ctor instead")
void SetModel( wxDataViewModel *model ) { m_model = model; }
wxDEPRECATED_MSG("Pass the argument to the ctor instead")
void SetDataViewColumn( wxDataViewColumn *col ) { m_column = col; }
wxDEPRECATED_MSG("Pass the argument to the ctor instead")
void SetItem( const wxDataViewItem &item ) { m_item = item; }
#endif // WXWIN_COMPATIBILITY_3_0
void SetColumn( int col ) { m_col = col; }
void SetEditCancelled() { m_editCancelled = true; }
protected:
wxDataViewItem m_item;
int m_col;
wxDataViewModel *m_model;
wxVariant m_value;
wxDataViewColumn *m_column;
wxPoint m_pos;
int m_cacheFrom;
int m_cacheTo;
bool m_editCancelled;
#if wxUSE_DRAG_AND_DROP
wxDataObject *m_dataObject;
wxDataFormat m_dataFormat;
void* m_dataBuffer;
size_t m_dataSize;
int m_dragFlags;
wxDragResult m_dropEffect;
int m_proposedDropIndex;
#endif // wxUSE_DRAG_AND_DROP
private:
// Common part of non-copy ctors.
void Init(wxDataViewCtrlBase* dvc,
wxDataViewColumn* column,
const wxDataViewItem& item);
wxDECLARE_DYNAMIC_CLASS_NO_ASSIGN(wxDataViewEvent);
};
wxDECLARE_EXPORTED_EVENT( WXDLLIMPEXP_CORE, wxEVT_DATAVIEW_SELECTION_CHANGED, wxDataViewEvent );
wxDECLARE_EXPORTED_EVENT( WXDLLIMPEXP_CORE, wxEVT_DATAVIEW_ITEM_ACTIVATED, wxDataViewEvent );
wxDECLARE_EXPORTED_EVENT( WXDLLIMPEXP_CORE, wxEVT_DATAVIEW_ITEM_COLLAPSED, wxDataViewEvent );
wxDECLARE_EXPORTED_EVENT( WXDLLIMPEXP_CORE, wxEVT_DATAVIEW_ITEM_EXPANDED, wxDataViewEvent );
wxDECLARE_EXPORTED_EVENT( WXDLLIMPEXP_CORE, wxEVT_DATAVIEW_ITEM_COLLAPSING, wxDataViewEvent );
wxDECLARE_EXPORTED_EVENT( WXDLLIMPEXP_CORE, wxEVT_DATAVIEW_ITEM_EXPANDING, wxDataViewEvent );
wxDECLARE_EXPORTED_EVENT( WXDLLIMPEXP_CORE, wxEVT_DATAVIEW_ITEM_START_EDITING, wxDataViewEvent );
wxDECLARE_EXPORTED_EVENT( WXDLLIMPEXP_CORE, wxEVT_DATAVIEW_ITEM_EDITING_STARTED, wxDataViewEvent );
wxDECLARE_EXPORTED_EVENT( WXDLLIMPEXP_CORE, wxEVT_DATAVIEW_ITEM_EDITING_DONE, wxDataViewEvent );
wxDECLARE_EXPORTED_EVENT( WXDLLIMPEXP_CORE, wxEVT_DATAVIEW_ITEM_VALUE_CHANGED, wxDataViewEvent );
wxDECLARE_EXPORTED_EVENT( WXDLLIMPEXP_CORE, wxEVT_DATAVIEW_ITEM_CONTEXT_MENU, wxDataViewEvent );
wxDECLARE_EXPORTED_EVENT( WXDLLIMPEXP_CORE, wxEVT_DATAVIEW_COLUMN_HEADER_CLICK, wxDataViewEvent );
wxDECLARE_EXPORTED_EVENT( WXDLLIMPEXP_CORE, wxEVT_DATAVIEW_COLUMN_HEADER_RIGHT_CLICK, wxDataViewEvent );
wxDECLARE_EXPORTED_EVENT( WXDLLIMPEXP_CORE, wxEVT_DATAVIEW_COLUMN_SORTED, wxDataViewEvent );
wxDECLARE_EXPORTED_EVENT( WXDLLIMPEXP_CORE, wxEVT_DATAVIEW_COLUMN_REORDERED, wxDataViewEvent );
wxDECLARE_EXPORTED_EVENT( WXDLLIMPEXP_CORE, wxEVT_DATAVIEW_CACHE_HINT, wxDataViewEvent );
wxDECLARE_EXPORTED_EVENT( WXDLLIMPEXP_CORE, wxEVT_DATAVIEW_ITEM_BEGIN_DRAG, wxDataViewEvent );
wxDECLARE_EXPORTED_EVENT( WXDLLIMPEXP_CORE, wxEVT_DATAVIEW_ITEM_DROP_POSSIBLE, wxDataViewEvent );
wxDECLARE_EXPORTED_EVENT( WXDLLIMPEXP_CORE, wxEVT_DATAVIEW_ITEM_DROP, wxDataViewEvent );
typedef void (wxEvtHandler::*wxDataViewEventFunction)(wxDataViewEvent&);
#define wxDataViewEventHandler(func) \
wxEVENT_HANDLER_CAST(wxDataViewEventFunction, func)
#define wx__DECLARE_DATAVIEWEVT(evt, id, fn) \
wx__DECLARE_EVT1(wxEVT_DATAVIEW_ ## evt, id, wxDataViewEventHandler(fn))
#define EVT_DATAVIEW_SELECTION_CHANGED(id, fn) wx__DECLARE_DATAVIEWEVT(SELECTION_CHANGED, id, fn)
#define EVT_DATAVIEW_ITEM_ACTIVATED(id, fn) wx__DECLARE_DATAVIEWEVT(ITEM_ACTIVATED, id, fn)
#define EVT_DATAVIEW_ITEM_COLLAPSING(id, fn) wx__DECLARE_DATAVIEWEVT(ITEM_COLLAPSING, id, fn)
#define EVT_DATAVIEW_ITEM_COLLAPSED(id, fn) wx__DECLARE_DATAVIEWEVT(ITEM_COLLAPSED, id, fn)
#define EVT_DATAVIEW_ITEM_EXPANDING(id, fn) wx__DECLARE_DATAVIEWEVT(ITEM_EXPANDING, id, fn)
#define EVT_DATAVIEW_ITEM_EXPANDED(id, fn) wx__DECLARE_DATAVIEWEVT(ITEM_EXPANDED, id, fn)
#define EVT_DATAVIEW_ITEM_START_EDITING(id, fn) wx__DECLARE_DATAVIEWEVT(ITEM_START_EDITING, id, fn)
#define EVT_DATAVIEW_ITEM_EDITING_STARTED(id, fn) wx__DECLARE_DATAVIEWEVT(ITEM_EDITING_STARTED, id, fn)
#define EVT_DATAVIEW_ITEM_EDITING_DONE(id, fn) wx__DECLARE_DATAVIEWEVT(ITEM_EDITING_DONE, id, fn)
#define EVT_DATAVIEW_ITEM_VALUE_CHANGED(id, fn) wx__DECLARE_DATAVIEWEVT(ITEM_VALUE_CHANGED, id, fn)
#define EVT_DATAVIEW_ITEM_CONTEXT_MENU(id, fn) wx__DECLARE_DATAVIEWEVT(ITEM_CONTEXT_MENU, id, fn)
#define EVT_DATAVIEW_COLUMN_HEADER_CLICK(id, fn) wx__DECLARE_DATAVIEWEVT(COLUMN_HEADER_CLICK, id, fn)
#define EVT_DATAVIEW_COLUMN_HEADER_RIGHT_CLICK(id, fn) wx__DECLARE_DATAVIEWEVT(COLUMN_HEADER_RIGHT_CLICK, id, fn)
#define EVT_DATAVIEW_COLUMN_SORTED(id, fn) wx__DECLARE_DATAVIEWEVT(COLUMN_SORTED, id, fn)
#define EVT_DATAVIEW_COLUMN_REORDERED(id, fn) wx__DECLARE_DATAVIEWEVT(COLUMN_REORDERED, id, fn)
#define EVT_DATAVIEW_CACHE_HINT(id, fn) wx__DECLARE_DATAVIEWEVT(CACHE_HINT, id, fn)
#define EVT_DATAVIEW_ITEM_BEGIN_DRAG(id, fn) wx__DECLARE_DATAVIEWEVT(ITEM_BEGIN_DRAG, id, fn)
#define EVT_DATAVIEW_ITEM_DROP_POSSIBLE(id, fn) wx__DECLARE_DATAVIEWEVT(ITEM_DROP_POSSIBLE, id, fn)
#define EVT_DATAVIEW_ITEM_DROP(id, fn) wx__DECLARE_DATAVIEWEVT(ITEM_DROP, id, fn)
// Old and not documented synonym, don't use.
#define EVT_DATAVIEW_COLUMN_HEADER_RIGHT_CLICKED(id, fn) EVT_DATAVIEW_COLUMN_HEADER_RIGHT_CLICK(id, fn)
#ifdef wxHAS_GENERIC_DATAVIEWCTRL
#include "wx/generic/dataview.h"
#elif defined(__WXGTK20__)
#include "wx/gtk/dataview.h"
#elif defined(__WXMAC__)
#include "wx/osx/dataview.h"
#elif defined(__WXQT__)
#include "wx/qt/dataview.h"
#else
#error "unknown native wxDataViewCtrl implementation"
#endif
//-----------------------------------------------------------------------------
// wxDataViewListStore
//-----------------------------------------------------------------------------
class WXDLLIMPEXP_CORE wxDataViewListStoreLine
{
public:
wxDataViewListStoreLine( wxUIntPtr data = 0 )
{
m_data = data;
}
void SetData( wxUIntPtr data )
{ m_data = data; }
wxUIntPtr GetData() const
{ return m_data; }
wxVector<wxVariant> m_values;
private:
wxUIntPtr m_data;
};
class WXDLLIMPEXP_CORE wxDataViewListStore: public wxDataViewIndexListModel
{
public:
wxDataViewListStore();
~wxDataViewListStore();
void PrependColumn( const wxString &varianttype );
void InsertColumn( unsigned int pos, const wxString &varianttype );
void AppendColumn( const wxString &varianttype );
void AppendItem( const wxVector<wxVariant> &values, wxUIntPtr data = 0 );
void PrependItem( const wxVector<wxVariant> &values, wxUIntPtr data = 0 );
void InsertItem( unsigned int row, const wxVector<wxVariant> &values, wxUIntPtr data = 0 );
void DeleteItem( unsigned int pos );
void DeleteAllItems();
void ClearColumns();
unsigned int GetItemCount() const;
void SetItemData( const wxDataViewItem& item, wxUIntPtr data );
wxUIntPtr GetItemData( const wxDataViewItem& item ) const;
// override base virtuals
virtual unsigned int GetColumnCount() const wxOVERRIDE;
virtual wxString GetColumnType( unsigned int col ) const wxOVERRIDE;
virtual void GetValueByRow( wxVariant &value,
unsigned int row, unsigned int col ) const wxOVERRIDE;
virtual bool SetValueByRow( const wxVariant &value,
unsigned int row, unsigned int col ) wxOVERRIDE;
public:
wxVector<wxDataViewListStoreLine*> m_data;
wxArrayString m_cols;
};
//-----------------------------------------------------------------------------
class WXDLLIMPEXP_CORE wxDataViewListCtrl: public wxDataViewCtrl
{
public:
wxDataViewListCtrl();
wxDataViewListCtrl( wxWindow *parent, wxWindowID id,
const wxPoint& pos = wxDefaultPosition,
const wxSize& size = wxDefaultSize, long style = wxDV_ROW_LINES,
const wxValidator& validator = wxDefaultValidator );
~wxDataViewListCtrl();
bool Create( wxWindow *parent, wxWindowID id,
const wxPoint& pos = wxDefaultPosition,
const wxSize& size = wxDefaultSize, long style = wxDV_ROW_LINES,
const wxValidator& validator = wxDefaultValidator );
wxDataViewListStore *GetStore()
{ return (wxDataViewListStore*) GetModel(); }
const wxDataViewListStore *GetStore() const
{ return (const wxDataViewListStore*) GetModel(); }
int ItemToRow(const wxDataViewItem &item) const
{ return item.IsOk() ? (int)GetStore()->GetRow(item) : wxNOT_FOUND; }
wxDataViewItem RowToItem(int row) const
{ return row == wxNOT_FOUND ? wxDataViewItem() : GetStore()->GetItem(row); }
int GetSelectedRow() const
{ return ItemToRow(GetSelection()); }
void SelectRow(unsigned row)
{ Select(RowToItem(row)); }
void UnselectRow(unsigned row)
{ Unselect(RowToItem(row)); }
bool IsRowSelected(unsigned row) const
{ return IsSelected(RowToItem(row)); }
bool AppendColumn( wxDataViewColumn *column, const wxString &varianttype );
bool PrependColumn( wxDataViewColumn *column, const wxString &varianttype );
bool InsertColumn( unsigned int pos, wxDataViewColumn *column, const wxString &varianttype );
// overridden from base class
virtual bool PrependColumn( wxDataViewColumn *col ) wxOVERRIDE;
virtual bool InsertColumn( unsigned int pos, wxDataViewColumn *col ) wxOVERRIDE;
virtual bool AppendColumn( wxDataViewColumn *col ) wxOVERRIDE;
virtual bool ClearColumns() wxOVERRIDE;
wxDataViewColumn *AppendTextColumn( const wxString &label,
wxDataViewCellMode mode = wxDATAVIEW_CELL_INERT,
int width = -1, wxAlignment align = wxALIGN_LEFT, int flags = wxDATAVIEW_COL_RESIZABLE );
wxDataViewColumn *AppendToggleColumn( const wxString &label,
wxDataViewCellMode mode = wxDATAVIEW_CELL_ACTIVATABLE,
int width = -1, wxAlignment align = wxALIGN_LEFT, int flags = wxDATAVIEW_COL_RESIZABLE );
wxDataViewColumn *AppendProgressColumn( const wxString &label,
wxDataViewCellMode mode = wxDATAVIEW_CELL_INERT,
int width = -1, wxAlignment align = wxALIGN_LEFT, int flags = wxDATAVIEW_COL_RESIZABLE );
wxDataViewColumn *AppendIconTextColumn( const wxString &label,
wxDataViewCellMode mode = wxDATAVIEW_CELL_INERT,
int width = -1, wxAlignment align = wxALIGN_LEFT, int flags = wxDATAVIEW_COL_RESIZABLE );
void AppendItem( const wxVector<wxVariant> &values, wxUIntPtr data = 0 )
{ GetStore()->AppendItem( values, data ); }
void PrependItem( const wxVector<wxVariant> &values, wxUIntPtr data = 0 )
{ GetStore()->PrependItem( values, data ); }
void InsertItem( unsigned int row, const wxVector<wxVariant> &values, wxUIntPtr data = 0 )
{ GetStore()->InsertItem( row, values, data ); }
void DeleteItem( unsigned row )
{ GetStore()->DeleteItem( row ); }
void DeleteAllItems()
{ GetStore()->DeleteAllItems(); }
void SetValue( const wxVariant &value, unsigned int row, unsigned int col )
{ GetStore()->SetValueByRow( value, row, col );
GetStore()->RowValueChanged( row, col); }
void GetValue( wxVariant &value, unsigned int row, unsigned int col )
{ GetStore()->GetValueByRow( value, row, col ); }
void SetTextValue( const wxString &value, unsigned int row, unsigned int col )
{ GetStore()->SetValueByRow( value, row, col );
GetStore()->RowValueChanged( row, col); }
wxString GetTextValue( unsigned int row, unsigned int col ) const
{ wxVariant value; GetStore()->GetValueByRow( value, row, col ); return value.GetString(); }
void SetToggleValue( bool value, unsigned int row, unsigned int col )
{ GetStore()->SetValueByRow( value, row, col );
GetStore()->RowValueChanged( row, col); }
bool GetToggleValue( unsigned int row, unsigned int col ) const
{ wxVariant value; GetStore()->GetValueByRow( value, row, col ); return value.GetBool(); }
void SetItemData( const wxDataViewItem& item, wxUIntPtr data )
{ GetStore()->SetItemData( item, data ); }
wxUIntPtr GetItemData( const wxDataViewItem& item ) const
{ return GetStore()->GetItemData( item ); }
int GetItemCount() const
{ return GetStore()->GetItemCount(); }
void OnSize( wxSizeEvent &event );
private:
wxDECLARE_EVENT_TABLE();
wxDECLARE_DYNAMIC_CLASS_NO_ASSIGN(wxDataViewListCtrl);
};
//-----------------------------------------------------------------------------
// wxDataViewTreeStore
//-----------------------------------------------------------------------------
class WXDLLIMPEXP_CORE wxDataViewTreeStoreNode
{
public:
wxDataViewTreeStoreNode( wxDataViewTreeStoreNode *parent,
const wxString &text, const wxIcon &icon = wxNullIcon, wxClientData *data = NULL );
virtual ~wxDataViewTreeStoreNode();
void SetText( const wxString &text )
{ m_text = text; }
wxString GetText() const
{ return m_text; }
void SetIcon( const wxIcon &icon )
{ m_icon = icon; }
const wxIcon &GetIcon() const
{ return m_icon; }
void SetData( wxClientData *data )
{ if (m_data) delete m_data; m_data = data; }
wxClientData *GetData() const
{ return m_data; }
wxDataViewItem GetItem() const
{ return wxDataViewItem( (void*) this ); }
virtual bool IsContainer()
{ return false; }
wxDataViewTreeStoreNode *GetParent()
{ return m_parent; }
private:
wxDataViewTreeStoreNode *m_parent;
wxString m_text;
wxIcon m_icon;
wxClientData *m_data;
};
typedef wxVector<wxDataViewTreeStoreNode*> wxDataViewTreeStoreNodes;
class WXDLLIMPEXP_CORE wxDataViewTreeStoreContainerNode: public wxDataViewTreeStoreNode
{
public:
wxDataViewTreeStoreContainerNode( wxDataViewTreeStoreNode *parent,
const wxString &text, const wxIcon &icon = wxNullIcon, const wxIcon &expanded = wxNullIcon,
wxClientData *data = NULL );
virtual ~wxDataViewTreeStoreContainerNode();
const wxDataViewTreeStoreNodes &GetChildren() const
{ return m_children; }
wxDataViewTreeStoreNodes &GetChildren()
{ return m_children; }
wxDataViewTreeStoreNodes::iterator FindChild(wxDataViewTreeStoreNode* node);
void SetExpandedIcon( const wxIcon &icon )
{ m_iconExpanded = icon; }
const wxIcon &GetExpandedIcon() const
{ return m_iconExpanded; }
void SetExpanded( bool expanded = true )
{ m_isExpanded = expanded; }
bool IsExpanded() const
{ return m_isExpanded; }
virtual bool IsContainer() wxOVERRIDE
{ return true; }
void DestroyChildren();
private:
wxDataViewTreeStoreNodes m_children;
wxIcon m_iconExpanded;
bool m_isExpanded;
};
//-----------------------------------------------------------------------------
class WXDLLIMPEXP_CORE wxDataViewTreeStore: public wxDataViewModel
{
public:
wxDataViewTreeStore();
~wxDataViewTreeStore();
wxDataViewItem AppendItem( const wxDataViewItem& parent,
const wxString &text, const wxIcon &icon = wxNullIcon, wxClientData *data = NULL );
wxDataViewItem PrependItem( const wxDataViewItem& parent,
const wxString &text, const wxIcon &icon = wxNullIcon, wxClientData *data = NULL );
wxDataViewItem InsertItem( const wxDataViewItem& parent, const wxDataViewItem& previous,
const wxString &text, const wxIcon &icon = wxNullIcon, wxClientData *data = NULL );
wxDataViewItem PrependContainer( const wxDataViewItem& parent,
const wxString &text, const wxIcon &icon = wxNullIcon, const wxIcon &expanded = wxNullIcon,
wxClientData *data = NULL );
wxDataViewItem AppendContainer( const wxDataViewItem& parent,
const wxString &text, const wxIcon &icon = wxNullIcon, const wxIcon &expanded = wxNullIcon,
wxClientData *data = NULL );
wxDataViewItem InsertContainer( const wxDataViewItem& parent, const wxDataViewItem& previous,
const wxString &text, const wxIcon &icon = wxNullIcon, const wxIcon &expanded = wxNullIcon,
wxClientData *data = NULL );
wxDataViewItem GetNthChild( const wxDataViewItem& parent, unsigned int pos ) const;
int GetChildCount( const wxDataViewItem& parent ) const;
void SetItemText( const wxDataViewItem& item, const wxString &text );
wxString GetItemText( const wxDataViewItem& item ) const;
void SetItemIcon( const wxDataViewItem& item, const wxIcon &icon );
const wxIcon &GetItemIcon( const wxDataViewItem& item ) const;
void SetItemExpandedIcon( const wxDataViewItem& item, const wxIcon &icon );
const wxIcon &GetItemExpandedIcon( const wxDataViewItem& item ) const;
void SetItemData( const wxDataViewItem& item, wxClientData *data );
wxClientData *GetItemData( const wxDataViewItem& item ) const;
void DeleteItem( const wxDataViewItem& item );
void DeleteChildren( const wxDataViewItem& item );
void DeleteAllItems();
// implement base methods
virtual void GetValue( wxVariant &variant,
const wxDataViewItem &item, unsigned int col ) const wxOVERRIDE;
virtual bool SetValue( const wxVariant &variant,
const wxDataViewItem &item, unsigned int col ) wxOVERRIDE;
virtual wxDataViewItem GetParent( const wxDataViewItem &item ) const wxOVERRIDE;
virtual bool IsContainer( const wxDataViewItem &item ) const wxOVERRIDE;
virtual unsigned int GetChildren( const wxDataViewItem &item, wxDataViewItemArray &children ) const wxOVERRIDE;
virtual int Compare( const wxDataViewItem &item1, const wxDataViewItem &item2,
unsigned int column, bool ascending ) const wxOVERRIDE;
virtual bool HasDefaultCompare() const wxOVERRIDE
{ return true; }
virtual unsigned int GetColumnCount() const wxOVERRIDE
{ return 1; }
virtual wxString GetColumnType( unsigned int WXUNUSED(col) ) const wxOVERRIDE
{ return wxT("wxDataViewIconText"); }
wxDataViewTreeStoreNode *FindNode( const wxDataViewItem &item ) const;
wxDataViewTreeStoreContainerNode *FindContainerNode( const wxDataViewItem &item ) const;
wxDataViewTreeStoreNode *GetRoot() const { return m_root; }
public:
wxDataViewTreeStoreNode *m_root;
};
//-----------------------------------------------------------------------------
class WXDLLIMPEXP_CORE wxDataViewTreeCtrl: public wxDataViewCtrl,
public wxWithImages
{
public:
wxDataViewTreeCtrl() { }
wxDataViewTreeCtrl(wxWindow *parent,
wxWindowID id,
const wxPoint& pos = wxDefaultPosition,
const wxSize& size = wxDefaultSize,
long style = wxDV_NO_HEADER | wxDV_ROW_LINES,
const wxValidator& validator = wxDefaultValidator)
{
Create(parent, id, pos, size, style, validator);
}
bool Create(wxWindow *parent,
wxWindowID id,
const wxPoint& pos = wxDefaultPosition,
const wxSize& size = wxDefaultSize,
long style = wxDV_NO_HEADER | wxDV_ROW_LINES,
const wxValidator& validator = wxDefaultValidator);
wxDataViewTreeStore *GetStore()
{ return (wxDataViewTreeStore*) GetModel(); }
const wxDataViewTreeStore *GetStore() const
{ return (const wxDataViewTreeStore*) GetModel(); }
bool IsContainer( const wxDataViewItem& item ) const
{ return GetStore()->IsContainer(item); }
wxDataViewItem AppendItem( const wxDataViewItem& parent,
const wxString &text, int icon = NO_IMAGE, wxClientData *data = NULL );
wxDataViewItem PrependItem( const wxDataViewItem& parent,
const wxString &text, int icon = NO_IMAGE, wxClientData *data = NULL );
wxDataViewItem InsertItem( const wxDataViewItem& parent, const wxDataViewItem& previous,
const wxString &text, int icon = NO_IMAGE, wxClientData *data = NULL );
wxDataViewItem PrependContainer( const wxDataViewItem& parent,
const wxString &text, int icon = NO_IMAGE, int expanded = NO_IMAGE,
wxClientData *data = NULL );
wxDataViewItem AppendContainer( const wxDataViewItem& parent,
const wxString &text, int icon = NO_IMAGE, int expanded = NO_IMAGE,
wxClientData *data = NULL );
wxDataViewItem InsertContainer( const wxDataViewItem& parent, const wxDataViewItem& previous,
const wxString &text, int icon = NO_IMAGE, int expanded = NO_IMAGE,
wxClientData *data = NULL );
wxDataViewItem GetNthChild( const wxDataViewItem& parent, unsigned int pos ) const
{ return GetStore()->GetNthChild(parent, pos); }
int GetChildCount( const wxDataViewItem& parent ) const
{ return GetStore()->GetChildCount(parent); }
void SetItemText( const wxDataViewItem& item, const wxString &text );
wxString GetItemText( const wxDataViewItem& item ) const
{ return GetStore()->GetItemText(item); }
void SetItemIcon( const wxDataViewItem& item, const wxIcon &icon );
const wxIcon &GetItemIcon( const wxDataViewItem& item ) const
{ return GetStore()->GetItemIcon(item); }
void SetItemExpandedIcon( const wxDataViewItem& item, const wxIcon &icon );
const wxIcon &GetItemExpandedIcon( const wxDataViewItem& item ) const
{ return GetStore()->GetItemExpandedIcon(item); }
void SetItemData( const wxDataViewItem& item, wxClientData *data )
{ GetStore()->SetItemData(item,data); }
wxClientData *GetItemData( const wxDataViewItem& item ) const
{ return GetStore()->GetItemData(item); }
void DeleteItem( const wxDataViewItem& item );
void DeleteChildren( const wxDataViewItem& item );
void DeleteAllItems();
void OnExpanded( wxDataViewEvent &event );
void OnCollapsed( wxDataViewEvent &event );
void OnSize( wxSizeEvent &event );
private:
wxDECLARE_EVENT_TABLE();
wxDECLARE_DYNAMIC_CLASS_NO_ASSIGN(wxDataViewTreeCtrl);
};
// old wxEVT_COMMAND_* constants
#define wxEVT_COMMAND_DATAVIEW_SELECTION_CHANGED wxEVT_DATAVIEW_SELECTION_CHANGED
#define wxEVT_COMMAND_DATAVIEW_ITEM_ACTIVATED wxEVT_DATAVIEW_ITEM_ACTIVATED
#define wxEVT_COMMAND_DATAVIEW_ITEM_COLLAPSED wxEVT_DATAVIEW_ITEM_COLLAPSED
#define wxEVT_COMMAND_DATAVIEW_ITEM_EXPANDED wxEVT_DATAVIEW_ITEM_EXPANDED
#define wxEVT_COMMAND_DATAVIEW_ITEM_COLLAPSING wxEVT_DATAVIEW_ITEM_COLLAPSING
#define wxEVT_COMMAND_DATAVIEW_ITEM_EXPANDING wxEVT_DATAVIEW_ITEM_EXPANDING
#define wxEVT_COMMAND_DATAVIEW_ITEM_START_EDITING wxEVT_DATAVIEW_ITEM_START_EDITING
#define wxEVT_COMMAND_DATAVIEW_ITEM_EDITING_STARTED wxEVT_DATAVIEW_ITEM_EDITING_STARTED
#define wxEVT_COMMAND_DATAVIEW_ITEM_EDITING_DONE wxEVT_DATAVIEW_ITEM_EDITING_DONE
#define wxEVT_COMMAND_DATAVIEW_ITEM_VALUE_CHANGED wxEVT_DATAVIEW_ITEM_VALUE_CHANGED
#define wxEVT_COMMAND_DATAVIEW_ITEM_CONTEXT_MENU wxEVT_DATAVIEW_ITEM_CONTEXT_MENU
#define wxEVT_COMMAND_DATAVIEW_COLUMN_HEADER_CLICK wxEVT_DATAVIEW_COLUMN_HEADER_CLICK
#define wxEVT_COMMAND_DATAVIEW_COLUMN_HEADER_RIGHT_CLICK wxEVT_DATAVIEW_COLUMN_HEADER_RIGHT_CLICK
#define wxEVT_COMMAND_DATAVIEW_COLUMN_SORTED wxEVT_DATAVIEW_COLUMN_SORTED
#define wxEVT_COMMAND_DATAVIEW_COLUMN_REORDERED wxEVT_DATAVIEW_COLUMN_REORDERED
#define wxEVT_COMMAND_DATAVIEW_CACHE_HINT wxEVT_DATAVIEW_CACHE_HINT
#define wxEVT_COMMAND_DATAVIEW_ITEM_BEGIN_DRAG wxEVT_DATAVIEW_ITEM_BEGIN_DRAG
#define wxEVT_COMMAND_DATAVIEW_ITEM_DROP_POSSIBLE wxEVT_DATAVIEW_ITEM_DROP_POSSIBLE
#define wxEVT_COMMAND_DATAVIEW_ITEM_DROP wxEVT_DATAVIEW_ITEM_DROP
#endif // wxUSE_DATAVIEWCTRL
#endif
// _WX_DATAVIEW_H_BASE_
| h |
rticonnextdds-usecases | data/projects/rticonnextdds-usecases/VehicleTracking/ExampleCode/thirdparty/wxWidgets-3.1.2/Win32/include/wx/accel.h | ///////////////////////////////////////////////////////////////////////////////
// Name: wx/accel.h
// Purpose: wxAcceleratorEntry and wxAcceleratorTable classes
// Author: Julian Smart, Robert Roebling, Vadim Zeitlin
// Modified by:
// Created: 31.05.01 (extracted from other files)
// Copyright: (c) wxWidgets team
// Licence: wxWindows licence
///////////////////////////////////////////////////////////////////////////////
#ifndef _WX_ACCEL_H_BASE_
#define _WX_ACCEL_H_BASE_
#include "wx/defs.h"
#if wxUSE_ACCEL
#include "wx/object.h"
class WXDLLIMPEXP_FWD_CORE wxAcceleratorTable;
class WXDLLIMPEXP_FWD_CORE wxMenuItem;
class WXDLLIMPEXP_FWD_CORE wxKeyEvent;
// ----------------------------------------------------------------------------
// constants
// ----------------------------------------------------------------------------
// wxAcceleratorEntry flags
enum wxAcceleratorEntryFlags
{
wxACCEL_NORMAL = 0x0000, // no modifiers
wxACCEL_ALT = 0x0001, // hold Alt key down
wxACCEL_CTRL = 0x0002, // hold Ctrl key down
wxACCEL_SHIFT = 0x0004, // hold Shift key down
#if defined(__WXMAC__)
wxACCEL_RAW_CTRL= 0x0008, //
#else
wxACCEL_RAW_CTRL= wxACCEL_CTRL,
#endif
wxACCEL_CMD = wxACCEL_CTRL
};
// ----------------------------------------------------------------------------
// an entry in wxAcceleratorTable corresponds to one accelerator
// ----------------------------------------------------------------------------
class WXDLLIMPEXP_CORE wxAcceleratorEntry
{
public:
wxAcceleratorEntry(int flags = 0, int keyCode = 0, int cmd = 0,
wxMenuItem *item = NULL)
: m_flags(flags)
, m_keyCode(keyCode)
, m_command(cmd)
, m_item(item)
{ }
wxAcceleratorEntry(const wxAcceleratorEntry& entry)
: m_flags(entry.m_flags)
, m_keyCode(entry.m_keyCode)
, m_command(entry.m_command)
, m_item(entry.m_item)
{ }
// create accelerator corresponding to the specified string, return NULL if
// string couldn't be parsed or a pointer to be deleted by the caller
static wxAcceleratorEntry *Create(const wxString& str);
wxAcceleratorEntry& operator=(const wxAcceleratorEntry& entry)
{
if (&entry != this)
Set(entry.m_flags, entry.m_keyCode, entry.m_command, entry.m_item);
return *this;
}
void Set(int flags, int keyCode, int cmd, wxMenuItem *item = NULL)
{
m_flags = flags;
m_keyCode = keyCode;
m_command = cmd;
m_item = item;
}
void SetMenuItem(wxMenuItem *item) { m_item = item; }
int GetFlags() const { return m_flags; }
int GetKeyCode() const { return m_keyCode; }
int GetCommand() const { return m_command; }
wxMenuItem *GetMenuItem() const { return m_item; }
bool operator==(const wxAcceleratorEntry& entry) const
{
return m_flags == entry.m_flags &&
m_keyCode == entry.m_keyCode &&
m_command == entry.m_command &&
m_item == entry.m_item;
}
bool operator!=(const wxAcceleratorEntry& entry) const
{ return !(*this == entry); }
#if defined(__WXMOTIF__)
// Implementation use only
bool MatchesEvent(const wxKeyEvent& event) const;
#endif
bool IsOk() const
{
return m_keyCode != 0;
}
// string <-> wxAcceleratorEntry conversion
// ----------------------------------------
// returns a wxString for the this accelerator.
// this function formats it using the <flags>-<keycode> format
// where <flags> maybe a hyphen-separated list of "shift|alt|ctrl"
wxString ToString() const { return AsPossiblyLocalizedString(true); }
// same as above but without translating, useful if the string is meant to
// be stored in a file or otherwise stored, instead of being shown to the
// user
wxString ToRawString() const { return AsPossiblyLocalizedString(false); }
// returns true if the given string correctly initialized this object
// (i.e. if IsOk() returns true after this call)
bool FromString(const wxString& str);
private:
wxString AsPossiblyLocalizedString(bool localized) const;
// common part of Create() and FromString()
static bool ParseAccel(const wxString& str, int *flags, int *keycode);
int m_flags; // combination of wxACCEL_XXX constants
int m_keyCode; // ASCII or virtual keycode
int m_command; // Command id to generate
// the menu item this entry corresponds to, may be NULL
wxMenuItem *m_item;
// for compatibility with old code, use accessors now!
friend class WXDLLIMPEXP_FWD_CORE wxMenu;
};
// ----------------------------------------------------------------------------
// include wxAcceleratorTable class declaration, it is only used by the library
// and so doesn't have any published user visible interface
// ----------------------------------------------------------------------------
#if defined(__WXUNIVERSAL__)
#include "wx/generic/accel.h"
#elif defined(__WXMSW__)
#include "wx/msw/accel.h"
#elif defined(__WXMOTIF__)
#include "wx/motif/accel.h"
#elif defined(__WXGTK20__)
#include "wx/gtk/accel.h"
#elif defined(__WXGTK__)
#include "wx/gtk1/accel.h"
#elif defined(__WXMAC__)
#include "wx/osx/accel.h"
#elif defined(__WXQT__)
#include "wx/qt/accel.h"
#endif
extern WXDLLIMPEXP_DATA_CORE(wxAcceleratorTable) wxNullAcceleratorTable;
#endif // wxUSE_ACCEL
#endif
// _WX_ACCEL_H_BASE_
| h |
rticonnextdds-usecases | data/projects/rticonnextdds-usecases/VehicleTracking/ExampleCode/thirdparty/wxWidgets-3.1.2/Win32/include/wx/iconloc.h | ///////////////////////////////////////////////////////////////////////////////
// Name: wx/iconloc.h
// Purpose: declaration of wxIconLocation class
// Author: Vadim Zeitlin
// Modified by:
// Created: 21.06.2003
// Copyright: (c) 2003 Vadim Zeitlin <[email protected]>
// Licence: wxWindows licence
///////////////////////////////////////////////////////////////////////////////
#ifndef _WX_ICONLOC_H_
#define _WX_ICONLOC_H_
#include "wx/string.h"
// ----------------------------------------------------------------------------
// wxIconLocation: describes the location of an icon
// ----------------------------------------------------------------------------
class WXDLLIMPEXP_BASE wxIconLocationBase
{
public:
// ctor takes the name of the file where the icon is
explicit wxIconLocationBase(const wxString& filename = wxEmptyString)
: m_filename(filename) { }
// default copy ctor, assignment operator and dtor are ok
// returns true if this object is valid/initialized
bool IsOk() const { return !m_filename.empty(); }
// set/get the icon file name
void SetFileName(const wxString& filename) { m_filename = filename; }
const wxString& GetFileName() const { return m_filename; }
private:
wxString m_filename;
};
// under Windows the same file may contain several icons so we also store the
// index of the icon
#if defined(__WINDOWS__)
class WXDLLIMPEXP_BASE wxIconLocation : public wxIconLocationBase
{
public:
// ctor takes the name of the file where the icon is and the icons index in
// the file
explicit wxIconLocation(const wxString& file = wxEmptyString, int num = 0);
// set/get the icon index
void SetIndex(int num) { m_index = num; }
int GetIndex() const { return m_index; }
private:
int m_index;
};
inline
wxIconLocation::wxIconLocation(const wxString& file, int num)
: wxIconLocationBase(file)
{
SetIndex(num);
}
#else // !__WINDOWS__
// must be a class because we forward declare it as class
class WXDLLIMPEXP_BASE wxIconLocation : public wxIconLocationBase
{
public:
explicit wxIconLocation(const wxString& filename = wxEmptyString)
: wxIconLocationBase(filename) { }
};
#endif // platform
#endif // _WX_ICONLOC_H_
| h |
rticonnextdds-usecases | data/projects/rticonnextdds-usecases/VehicleTracking/ExampleCode/thirdparty/wxWidgets-3.1.2/Win32/include/wx/scrolbar.h | /////////////////////////////////////////////////////////////////////////////
// Name: wx/scrolbar.h
// Purpose: wxScrollBar base header
// Author: Julian Smart
// Modified by:
// Created:
// Copyright: (c) Julian Smart
// Licence: wxWindows licence
/////////////////////////////////////////////////////////////////////////////
#ifndef _WX_SCROLBAR_H_BASE_
#define _WX_SCROLBAR_H_BASE_
#include "wx/defs.h"
#if wxUSE_SCROLLBAR
#include "wx/control.h"
extern WXDLLIMPEXP_DATA_CORE(const char) wxScrollBarNameStr[];
// ----------------------------------------------------------------------------
// wxScrollBar: a scroll bar control
// ----------------------------------------------------------------------------
class WXDLLIMPEXP_CORE wxScrollBarBase : public wxControl
{
public:
wxScrollBarBase() { }
/*
Derived classes should provide the following method and ctor with the
same parameters:
bool Create(wxWindow *parent,
wxWindowID id,
const wxPoint& pos = wxDefaultPosition,
const wxSize& size = wxDefaultSize,
long style = wxSB_HORIZONTAL,
const wxValidator& validator = wxDefaultValidator,
const wxString& name = wxScrollBarNameStr);
*/
// accessors
virtual int GetThumbPosition() const = 0;
virtual int GetThumbSize() const = 0;
virtual int GetPageSize() const = 0;
virtual int GetRange() const = 0;
bool IsVertical() const { return (m_windowStyle & wxVERTICAL) != 0; }
// operations
virtual void SetThumbPosition(int viewStart) = 0;
virtual void SetScrollbar(int position, int thumbSize,
int range, int pageSize,
bool refresh = true) wxOVERRIDE = 0;
// implementation-only
bool IsNeeded() const { return GetRange() > GetThumbSize(); }
private:
wxDECLARE_NO_COPY_CLASS(wxScrollBarBase);
};
#if defined(__WXUNIVERSAL__)
#include "wx/univ/scrolbar.h"
#elif defined(__WXMSW__)
#include "wx/msw/scrolbar.h"
#elif defined(__WXMOTIF__)
#include "wx/motif/scrolbar.h"
#elif defined(__WXGTK20__)
#include "wx/gtk/scrolbar.h"
#elif defined(__WXGTK__)
#include "wx/gtk1/scrolbar.h"
#elif defined(__WXMAC__)
#include "wx/osx/scrolbar.h"
#elif defined(__WXQT__)
#include "wx/qt/scrolbar.h"
#endif
#endif // wxUSE_SCROLLBAR
#endif
// _WX_SCROLBAR_H_BASE_
| h |
rticonnextdds-usecases | data/projects/rticonnextdds-usecases/VehicleTracking/ExampleCode/thirdparty/wxWidgets-3.1.2/Win32/include/wx/features.h | /**
* Name: wx/features.h
* Purpose: test macros for the features which might be available in some
* wxWidgets ports but not others
* Author: Vadim Zeitlin
* Modified by: Ryan Norton (Converted to C)
* Created: 18.03.02
* Copyright: (c) 2002 Vadim Zeitlin <[email protected]>
* Licence: wxWindows licence
*/
/* THIS IS A C FILE, DON'T USE C++ FEATURES (IN PARTICULAR COMMENTS) IN IT */
#ifndef _WX_FEATURES_H_
#define _WX_FEATURES_H_
/* radio menu items are currently not implemented in wxMotif, use this
symbol (kept for compatibility from the time when they were not implemented
under other platforms as well) to test for this */
#if !defined(__WXMOTIF__)
#define wxHAS_RADIO_MENU_ITEMS
#else
#undef wxHAS_RADIO_MENU_ITEMS
#endif
/* the raw keyboard codes are generated under wxGTK and wxMSW only */
#if defined(__WXGTK__) || defined(__WXMSW__) || defined(__WXMAC__) \
|| defined(__WXDFB__)
#define wxHAS_RAW_KEY_CODES
#else
#undef wxHAS_RAW_KEY_CODES
#endif
/* taskbar is implemented in the major ports */
#if defined(__WXMSW__) \
|| defined(__WXGTK__) || defined(__WXMOTIF__) || defined(__WXX11__) \
|| defined(__WXOSX_MAC__) || defined(__WXQT__)
#define wxHAS_TASK_BAR_ICON
#else
#undef wxUSE_TASKBARICON
#define wxUSE_TASKBARICON 0
#undef wxHAS_TASK_BAR_ICON
#endif
/* wxIconLocation appeared in the middle of 2.5.0 so it's handy to have a */
/* separate define for it */
#define wxHAS_ICON_LOCATION
/* same for wxCrashReport */
#ifdef __WXMSW__
#define wxHAS_CRASH_REPORT
#else
#undef wxHAS_CRASH_REPORT
#endif
/* wxRE_ADVANCED is not always available, depending on regex library used
* (it's unavailable only if compiling via configure against system library) */
#ifndef WX_NO_REGEX_ADVANCED
#define wxHAS_REGEX_ADVANCED
#else
#undef wxHAS_REGEX_ADVANCED
#endif
/* Pango-based ports and wxDFB use UTF-8 for text and font encodings
* internally and so their fonts can handle any encodings: */
#if wxUSE_PANGO || defined(__WXDFB__)
#define wxHAS_UTF8_FONTS
#endif
/* This is defined when the underlying toolkit handles tab traversal natively.
Otherwise we implement it ourselves in wxControlContainer. */
#if defined(__WXGTK20__) || defined(__WXQT__)
#define wxHAS_NATIVE_TAB_TRAVERSAL
#endif
/* This is defined when the compiler provides some type of extended locale
functions. Otherwise, we implement them ourselves to only support the
'C' locale */
#if defined(HAVE_LOCALE_T) || \
(wxCHECK_VISUALC_VERSION(8))
#define wxHAS_XLOCALE_SUPPORT
#else
#undef wxHAS_XLOCALE_SUPPORT
#endif
/* Direct access to bitmap data is not implemented in all ports yet */
#if defined(__WXGTK20__) || defined(__WXMAC__) || defined(__WXDFB__) || \
defined(__WXMSW__) || defined(__WXQT__)
/*
HP aCC for PA-RISC can't deal with templates in wx/rawbmp.h.
*/
#if !(defined(__HP_aCC) && defined(__hppa))
#define wxHAS_RAW_BITMAP
#endif
#endif
/* also define deprecated synonym which exists for compatibility only */
#ifdef wxHAS_RAW_BITMAP
#define wxHAVE_RAW_BITMAP
#endif
// Previously this symbol wasn't defined for all compilers as Bind() couldn't
// be implemented for some of them (notably MSVC 6), but this is not the case
// any more and Bind() is always implemented when using any currently supported
// compiler, so this symbol exists purely for compatibility.
#define wxHAS_EVENT_BIND
#endif /* _WX_FEATURES_H_ */
| h |
rticonnextdds-usecases | data/projects/rticonnextdds-usecases/VehicleTracking/ExampleCode/thirdparty/wxWidgets-3.1.2/Win32/include/wx/dde.h | /////////////////////////////////////////////////////////////////////////////
// Name: wx/dde.h
// Purpose: DDE base header
// Author: Julian Smart
// Modified by:
// Created:
// Copyright: (c) Julian Smart
// Licence: wxWindows Licence
/////////////////////////////////////////////////////////////////////////////
#ifndef _WX_DDE_H_BASE_
#define _WX_DDE_H_BASE_
#include "wx/list.h"
class WXDLLIMPEXP_FWD_BASE wxDDEClient;
class WXDLLIMPEXP_FWD_BASE wxDDEServer;
class WXDLLIMPEXP_FWD_BASE wxDDEConnection;
WX_DECLARE_USER_EXPORTED_LIST(wxDDEClient, wxDDEClientList, WXDLLIMPEXP_BASE);
WX_DECLARE_USER_EXPORTED_LIST(wxDDEServer, wxDDEServerList, WXDLLIMPEXP_BASE);
WX_DECLARE_USER_EXPORTED_LIST(wxDDEConnection, wxDDEConnectionList, WXDLLIMPEXP_BASE);
#if defined(__WINDOWS__)
#include "wx/msw/dde.h"
#else
#error DDE is only supported under Windows
#endif
#endif
// _WX_DDE_H_BASE_
| h |
rticonnextdds-usecases | data/projects/rticonnextdds-usecases/VehicleTracking/ExampleCode/thirdparty/wxWidgets-3.1.2/Win32/include/wx/textdlg.h | /////////////////////////////////////////////////////////////////////////////
// Name: wx/textdlg.h
// Purpose: wxTextEntryDialog class
// Author: Julian Smart
// Modified by:
// Created: 01/02/97
// Copyright: (c) Julian Smart
// Licence: wxWindows licence
/////////////////////////////////////////////////////////////////////////////
#ifndef _WX_TEXTDLG_H_BASE_
#define _WX_TEXTDLG_H_BASE_
#include "wx/generic/textdlgg.h"
#endif // _WX_TEXTDLG_H_BASE_
| h |
rticonnextdds-usecases | data/projects/rticonnextdds-usecases/VehicleTracking/ExampleCode/thirdparty/wxWidgets-3.1.2/Win32/include/wx/dirdlg.h | /////////////////////////////////////////////////////////////////////////////
// Name: wx/dirdlg.h
// Purpose: wxDirDialog base class
// Author: Robert Roebling
// Modified by:
// Created:
// Copyright: (c) Robert Roebling
// Licence: wxWindows Licence
/////////////////////////////////////////////////////////////////////////////
#ifndef _WX_DIRDLG_H_BASE_
#define _WX_DIRDLG_H_BASE_
#include "wx/defs.h"
#if wxUSE_DIRDLG
#include "wx/dialog.h"
// ----------------------------------------------------------------------------
// constants
// ----------------------------------------------------------------------------
extern WXDLLIMPEXP_DATA_CORE(const char) wxDirDialogNameStr[];
extern WXDLLIMPEXP_DATA_CORE(const char) wxDirDialogDefaultFolderStr[];
extern WXDLLIMPEXP_DATA_CORE(const char) wxDirSelectorPromptStr[];
#define wxDD_CHANGE_DIR 0x0100
#define wxDD_DIR_MUST_EXIST 0x0200
// deprecated, on by default now, use wxDD_DIR_MUST_EXIST to disable it
#define wxDD_NEW_DIR_BUTTON 0
#define wxDD_DEFAULT_STYLE (wxDEFAULT_DIALOG_STYLE|wxRESIZE_BORDER)
//-------------------------------------------------------------------------
// wxDirDialogBase
//-------------------------------------------------------------------------
class WXDLLIMPEXP_CORE wxDirDialogBase : public wxDialog
{
public:
wxDirDialogBase() {}
wxDirDialogBase(wxWindow *parent,
const wxString& title = wxDirSelectorPromptStr,
const wxString& defaultPath = wxEmptyString,
long style = wxDD_DEFAULT_STYLE,
const wxPoint& pos = wxDefaultPosition,
const wxSize& sz = wxDefaultSize,
const wxString& name = wxDirDialogNameStr)
{
Create(parent, title, defaultPath, style, pos, sz, name);
}
virtual ~wxDirDialogBase() {}
bool Create(wxWindow *parent,
const wxString& title = wxDirSelectorPromptStr,
const wxString& defaultPath = wxEmptyString,
long style = wxDD_DEFAULT_STYLE,
const wxPoint& pos = wxDefaultPosition,
const wxSize& sz = wxDefaultSize,
const wxString& name = wxDirDialogNameStr)
{
if (!wxDialog::Create(parent, wxID_ANY, title, pos, sz, style, name))
return false;
m_path = defaultPath;
m_message = title;
return true;
}
virtual void SetMessage(const wxString& message) { m_message = message; }
virtual void SetPath(const wxString& path) { m_path = path; }
virtual wxString GetMessage() const { return m_message; }
virtual wxString GetPath() const { return m_path; }
protected:
wxString m_message;
wxString m_path;
};
// Universal and non-port related switches with need for generic implementation
#if defined(__WXUNIVERSAL__)
#include "wx/generic/dirdlgg.h"
#define wxDirDialog wxGenericDirDialog
#elif defined(__WXMSW__) && !wxUSE_OLE
#include "wx/generic/dirdlgg.h"
#define wxDirDialog wxGenericDirDialog
#elif defined(__WXMSW__)
#include "wx/msw/dirdlg.h" // Native MSW
#elif defined(__WXGTK20__)
#include "wx/gtk/dirdlg.h" // Native GTK for gtk2.4
#elif defined(__WXGTK__)
#include "wx/generic/dirdlgg.h"
#define wxDirDialog wxGenericDirDialog
#elif defined(__WXMAC__)
#include "wx/osx/dirdlg.h" // Native Mac
#elif defined(__WXMOTIF__) || \
defined(__WXX11__)
#include "wx/generic/dirdlgg.h" // Other ports use generic implementation
#define wxDirDialog wxGenericDirDialog
#elif defined(__WXQT__)
#include "wx/qt/dirdlg.h"
#endif
// ----------------------------------------------------------------------------
// common ::wxDirSelector() function
// ----------------------------------------------------------------------------
WXDLLIMPEXP_CORE wxString
wxDirSelector(const wxString& message = wxDirSelectorPromptStr,
const wxString& defaultPath = wxEmptyString,
long style = wxDD_DEFAULT_STYLE,
const wxPoint& pos = wxDefaultPosition,
wxWindow *parent = NULL);
#endif // wxUSE_DIRDLG
#endif
// _WX_DIRDLG_H_BASE_
| h |
rticonnextdds-usecases | data/projects/rticonnextdds-usecases/VehicleTracking/ExampleCode/thirdparty/wxWidgets-3.1.2/Win32/include/wx/choice.h | /////////////////////////////////////////////////////////////////////////////
// Name: wx/choice.h
// Purpose: wxChoice class interface
// Author: Vadim Zeitlin
// Modified by:
// Created: 26.07.99
// Copyright: (c) wxWidgets team
// Licence: wxWindows licence
/////////////////////////////////////////////////////////////////////////////
#ifndef _WX_CHOICE_H_BASE_
#define _WX_CHOICE_H_BASE_
// ----------------------------------------------------------------------------
// headers
// ----------------------------------------------------------------------------
#include "wx/defs.h"
#if wxUSE_CHOICE
#include "wx/ctrlsub.h" // the base class
// ----------------------------------------------------------------------------
// global data
// ----------------------------------------------------------------------------
extern WXDLLIMPEXP_DATA_CORE(const char) wxChoiceNameStr[];
// ----------------------------------------------------------------------------
// wxChoice allows to select one of a non-modifiable list of strings
// ----------------------------------------------------------------------------
class WXDLLIMPEXP_CORE wxChoiceBase : public wxControlWithItems
{
public:
wxChoiceBase() { }
virtual ~wxChoiceBase();
// all generic methods are in wxControlWithItems
// get the current selection: this can only be different from the normal
// selection if the popup items list is currently opened and the user
// selected some item in it but didn't close the list yet; otherwise (and
// currently always on platforms other than MSW) this is the same as
// GetSelection()
virtual int GetCurrentSelection() const { return GetSelection(); }
// set/get the number of columns in the control (as they're not supported on
// most platforms, they do nothing by default)
virtual void SetColumns(int WXUNUSED(n) = 1 ) { }
virtual int GetColumns() const { return 1 ; }
// emulate selecting the item event.GetInt()
void Command(wxCommandEvent& event) wxOVERRIDE;
// override wxItemContainer::IsSorted
virtual bool IsSorted() const wxOVERRIDE { return HasFlag(wxCB_SORT); }
protected:
// The generic implementation doesn't determine the height correctly and
// doesn't account for the width of the arrow but does take into account
// the string widths, so the derived classes should override it and set the
// height and add the arrow width to the size returned by this version.
virtual wxSize DoGetBestSize() const wxOVERRIDE;
private:
wxDECLARE_NO_COPY_CLASS(wxChoiceBase);
};
// ----------------------------------------------------------------------------
// include the platform-dependent class definition
// ----------------------------------------------------------------------------
#if defined(__WXUNIVERSAL__)
#include "wx/univ/choice.h"
#elif defined(__WXMSW__)
#include "wx/msw/choice.h"
#elif defined(__WXMOTIF__)
#include "wx/motif/choice.h"
#elif defined(__WXGTK20__)
#include "wx/gtk/choice.h"
#elif defined(__WXGTK__)
#include "wx/gtk1/choice.h"
#elif defined(__WXMAC__)
#include "wx/osx/choice.h"
#elif defined(__WXQT__)
#include "wx/qt/choice.h"
#endif
#endif // wxUSE_CHOICE
#endif // _WX_CHOICE_H_BASE_
| h |
rticonnextdds-usecases | data/projects/rticonnextdds-usecases/VehicleTracking/ExampleCode/thirdparty/wxWidgets-3.1.2/Win32/include/wx/wfstream.h | /////////////////////////////////////////////////////////////////////////////
// Name: wx/wfstream.h
// Purpose: File stream classes
// Author: Guilhem Lavaux
// Modified by:
// Created: 11/07/98
// Copyright: (c) Guilhem Lavaux
// Licence: wxWindows licence
/////////////////////////////////////////////////////////////////////////////
#ifndef _WX_WXFSTREAM_H__
#define _WX_WXFSTREAM_H__
#include "wx/defs.h"
#if wxUSE_STREAMS
#include "wx/object.h"
#include "wx/string.h"
#include "wx/stream.h"
#include "wx/file.h"
#include "wx/ffile.h"
#if wxUSE_FILE
// ----------------------------------------------------------------------------
// wxFileStream using wxFile
// ----------------------------------------------------------------------------
class WXDLLIMPEXP_BASE wxFileInputStream : public wxInputStream
{
public:
wxFileInputStream(const wxString& ifileName);
wxFileInputStream(wxFile& file);
wxFileInputStream(int fd);
virtual ~wxFileInputStream();
virtual wxFileOffset GetLength() const wxOVERRIDE;
bool Ok() const { return IsOk(); }
virtual bool IsOk() const wxOVERRIDE;
virtual bool IsSeekable() const wxOVERRIDE { return m_file->GetKind() == wxFILE_KIND_DISK; }
wxFile* GetFile() const { return m_file; }
protected:
wxFileInputStream();
virtual size_t OnSysRead(void *buffer, size_t size) wxOVERRIDE;
virtual wxFileOffset OnSysSeek(wxFileOffset pos, wxSeekMode mode) wxOVERRIDE;
virtual wxFileOffset OnSysTell() const wxOVERRIDE;
protected:
wxFile *m_file;
bool m_file_destroy;
wxDECLARE_NO_COPY_CLASS(wxFileInputStream);
};
class WXDLLIMPEXP_BASE wxFileOutputStream : public wxOutputStream
{
public:
wxFileOutputStream(const wxString& fileName);
wxFileOutputStream(wxFile& file);
wxFileOutputStream(int fd);
virtual ~wxFileOutputStream();
void Sync() wxOVERRIDE;
bool Close() wxOVERRIDE { return m_file_destroy ? m_file->Close() : true; }
virtual wxFileOffset GetLength() const wxOVERRIDE;
bool Ok() const { return IsOk(); }
virtual bool IsOk() const wxOVERRIDE;
virtual bool IsSeekable() const wxOVERRIDE { return m_file->GetKind() == wxFILE_KIND_DISK; }
wxFile* GetFile() const { return m_file; }
protected:
wxFileOutputStream();
virtual size_t OnSysWrite(const void *buffer, size_t size) wxOVERRIDE;
virtual wxFileOffset OnSysSeek(wxFileOffset pos, wxSeekMode mode) wxOVERRIDE;
virtual wxFileOffset OnSysTell() const wxOVERRIDE;
protected:
wxFile *m_file;
bool m_file_destroy;
wxDECLARE_NO_COPY_CLASS(wxFileOutputStream);
};
class WXDLLIMPEXP_BASE wxTempFileOutputStream : public wxOutputStream
{
public:
wxTempFileOutputStream(const wxString& fileName);
virtual ~wxTempFileOutputStream();
bool Close() wxOVERRIDE { return Commit(); }
WXDLLIMPEXP_INLINE_BASE virtual bool Commit() { return m_file->Commit(); }
WXDLLIMPEXP_INLINE_BASE virtual void Discard() { m_file->Discard(); }
virtual wxFileOffset GetLength() const wxOVERRIDE { return m_file->Length(); }
virtual bool IsSeekable() const wxOVERRIDE { return true; }
protected:
virtual size_t OnSysWrite(const void *buffer, size_t size) wxOVERRIDE;
virtual wxFileOffset OnSysSeek(wxFileOffset pos, wxSeekMode mode) wxOVERRIDE
{ return m_file->Seek(pos, mode); }
virtual wxFileOffset OnSysTell() const wxOVERRIDE { return m_file->Tell(); }
private:
wxTempFile *m_file;
wxDECLARE_NO_COPY_CLASS(wxTempFileOutputStream);
};
class WXDLLIMPEXP_BASE wxFileStream : public wxFileInputStream,
public wxFileOutputStream
{
public:
wxFileStream(const wxString& fileName);
virtual bool IsOk() const wxOVERRIDE;
// override (some) virtual functions inherited from both classes to resolve
// ambiguities (this wouldn't be necessary if wxStreamBase were a virtual
// base class but it isn't)
virtual bool IsSeekable() const wxOVERRIDE
{
return wxFileInputStream::IsSeekable();
}
virtual wxFileOffset GetLength() const wxOVERRIDE
{
return wxFileInputStream::GetLength();
}
protected:
virtual wxFileOffset OnSysSeek(wxFileOffset pos, wxSeekMode mode) wxOVERRIDE
{
return wxFileInputStream::OnSysSeek(pos, mode);
}
virtual wxFileOffset OnSysTell() const wxOVERRIDE
{
return wxFileInputStream::OnSysTell();
}
private:
wxDECLARE_NO_COPY_CLASS(wxFileStream);
};
#endif //wxUSE_FILE
#if wxUSE_FFILE
// ----------------------------------------------------------------------------
// wxFFileStream using wxFFile
// ----------------------------------------------------------------------------
class WXDLLIMPEXP_BASE wxFFileInputStream : public wxInputStream
{
public:
wxFFileInputStream(const wxString& fileName, const wxString& mode = "rb");
wxFFileInputStream(wxFFile& file);
wxFFileInputStream(FILE *file);
virtual ~wxFFileInputStream();
virtual wxFileOffset GetLength() const wxOVERRIDE;
bool Ok() const { return IsOk(); }
virtual bool IsOk() const wxOVERRIDE;
virtual bool IsSeekable() const wxOVERRIDE { return m_file->GetKind() == wxFILE_KIND_DISK; }
wxFFile* GetFile() const { return m_file; }
protected:
wxFFileInputStream();
virtual size_t OnSysRead(void *buffer, size_t size) wxOVERRIDE;
virtual wxFileOffset OnSysSeek(wxFileOffset pos, wxSeekMode mode) wxOVERRIDE;
virtual wxFileOffset OnSysTell() const wxOVERRIDE;
protected:
wxFFile *m_file;
bool m_file_destroy;
wxDECLARE_NO_COPY_CLASS(wxFFileInputStream);
};
class WXDLLIMPEXP_BASE wxFFileOutputStream : public wxOutputStream
{
public:
wxFFileOutputStream(const wxString& fileName, const wxString& mode = "wb");
wxFFileOutputStream(wxFFile& file);
wxFFileOutputStream(FILE *file);
virtual ~wxFFileOutputStream();
void Sync() wxOVERRIDE;
bool Close() wxOVERRIDE { return m_file_destroy ? m_file->Close() : true; }
virtual wxFileOffset GetLength() const wxOVERRIDE;
bool Ok() const { return IsOk(); }
virtual bool IsOk() const wxOVERRIDE;
virtual bool IsSeekable() const wxOVERRIDE { return m_file->GetKind() == wxFILE_KIND_DISK; }
wxFFile* GetFile() const { return m_file; }
protected:
wxFFileOutputStream();
virtual size_t OnSysWrite(const void *buffer, size_t size) wxOVERRIDE;
virtual wxFileOffset OnSysSeek(wxFileOffset pos, wxSeekMode mode) wxOVERRIDE;
virtual wxFileOffset OnSysTell() const wxOVERRIDE;
protected:
wxFFile *m_file;
bool m_file_destroy;
wxDECLARE_NO_COPY_CLASS(wxFFileOutputStream);
};
class WXDLLIMPEXP_BASE wxFFileStream : public wxFFileInputStream,
public wxFFileOutputStream
{
public:
wxFFileStream(const wxString& fileName, const wxString& mode = "w+b");
// override some virtual functions to resolve ambiguities, just as in
// wxFileStream
virtual bool IsOk() const wxOVERRIDE;
virtual bool IsSeekable() const wxOVERRIDE
{
return wxFFileInputStream::IsSeekable();
}
virtual wxFileOffset GetLength() const wxOVERRIDE
{
return wxFFileInputStream::GetLength();
}
protected:
virtual wxFileOffset OnSysSeek(wxFileOffset pos, wxSeekMode mode) wxOVERRIDE
{
return wxFFileInputStream::OnSysSeek(pos, mode);
}
virtual wxFileOffset OnSysTell() const wxOVERRIDE
{
return wxFFileInputStream::OnSysTell();
}
private:
wxDECLARE_NO_COPY_CLASS(wxFFileStream);
};
#endif //wxUSE_FFILE
#endif // wxUSE_STREAMS
#endif // _WX_WXFSTREAM_H__
| h |
rticonnextdds-usecases | data/projects/rticonnextdds-usecases/VehicleTracking/ExampleCode/thirdparty/wxWidgets-3.1.2/Win32/include/wx/bitmap.h | ///////////////////////////////////////////////////////////////////////////////
// Name: wx/bitmap.h
// Purpose: wxBitmap class interface
// Author: Vaclav Slavik
// Modified by:
// Created: 22.04.01
// Copyright: (c) wxWidgets team
// Licence: wxWindows licence
///////////////////////////////////////////////////////////////////////////////
#ifndef _WX_BITMAP_H_BASE_
#define _WX_BITMAP_H_BASE_
// ----------------------------------------------------------------------------
// headers
// ----------------------------------------------------------------------------
#include "wx/string.h"
#include "wx/gdicmn.h" // for wxBitmapType
#include "wx/colour.h"
#include "wx/image.h"
class WXDLLIMPEXP_FWD_CORE wxBitmap;
class WXDLLIMPEXP_FWD_CORE wxBitmapHandler;
class WXDLLIMPEXP_FWD_CORE wxIcon;
class WXDLLIMPEXP_FWD_CORE wxMask;
class WXDLLIMPEXP_FWD_CORE wxPalette;
class WXDLLIMPEXP_FWD_CORE wxDC;
// ----------------------------------------------------------------------------
// wxVariant support
// ----------------------------------------------------------------------------
#if wxUSE_VARIANT
#include "wx/variant.h"
DECLARE_VARIANT_OBJECT_EXPORTED(wxBitmap,WXDLLIMPEXP_CORE)
#endif
// ----------------------------------------------------------------------------
// wxMask represents the transparent area of the bitmap
// ----------------------------------------------------------------------------
// TODO: all implementation of wxMask, except the generic one,
// do not derive from wxMaskBase,,, they should
class WXDLLIMPEXP_CORE wxMaskBase : public wxObject
{
public:
// create the mask from bitmap pixels of the given colour
bool Create(const wxBitmap& bitmap, const wxColour& colour);
#if wxUSE_PALETTE
// create the mask from bitmap pixels with the given palette index
bool Create(const wxBitmap& bitmap, int paletteIndex);
#endif // wxUSE_PALETTE
// create the mask from the given mono bitmap
bool Create(const wxBitmap& bitmap);
protected:
// this function is called from Create() to free the existing mask data
virtual void FreeData() = 0;
// these functions must be overridden to implement the corresponding public
// Create() methods, they shouldn't call FreeData() as it's already called
// by the public wrappers
virtual bool InitFromColour(const wxBitmap& bitmap,
const wxColour& colour) = 0;
virtual bool InitFromMonoBitmap(const wxBitmap& bitmap) = 0;
};
#if defined(__WXDFB__) || \
defined(__WXMAC__) || \
defined(__WXGTK__) || \
defined(__WXMOTIF__) || \
defined(__WXX11__) || \
defined(__WXQT__)
#define wxUSE_BITMAP_BASE 1
#else
#define wxUSE_BITMAP_BASE 0
#endif
// a more readable way to tell
#define wxBITMAP_SCREEN_DEPTH (-1)
// ----------------------------------------------------------------------------
// wxBitmapHelpers: container for various bitmap methods common to all ports.
// ----------------------------------------------------------------------------
// Unfortunately, currently wxBitmap does not inherit from wxBitmapBase on all
// platforms and this is not easy to fix. So we extract at least some common
// methods into this class from which both wxBitmapBase (and hence wxBitmap on
// all platforms where it does inherit from it) and wxBitmap in wxMSW and other
// exceptional ports (only wxPM and old wxCocoa) inherit.
class WXDLLIMPEXP_CORE wxBitmapHelpers
{
public:
// Create a new wxBitmap from the PNG data in the given buffer.
static wxBitmap NewFromPNGData(const void* data, size_t size);
};
// All ports except wxMSW use wxBitmapHandler and wxBitmapBase as
// base class for wxBitmapHandler; wxMSW uses wxGDIImageHandler as
// base class since it allows some code reuse there.
#if wxUSE_BITMAP_BASE
// ----------------------------------------------------------------------------
// wxBitmapHandler: class which knows how to create/load/save bitmaps in
// different formats
// ----------------------------------------------------------------------------
class WXDLLIMPEXP_CORE wxBitmapHandler : public wxObject
{
public:
wxBitmapHandler() { m_type = wxBITMAP_TYPE_INVALID; }
virtual ~wxBitmapHandler() { }
// NOTE: the following functions should be pure virtuals, but they aren't
// because otherwise almost all ports would have to implement
// them as "return false"...
virtual bool Create(wxBitmap *WXUNUSED(bitmap), const void* WXUNUSED(data),
wxBitmapType WXUNUSED(type), int WXUNUSED(width), int WXUNUSED(height),
int WXUNUSED(depth) = 1)
{ return false; }
virtual bool LoadFile(wxBitmap *WXUNUSED(bitmap), const wxString& WXUNUSED(name),
wxBitmapType WXUNUSED(type), int WXUNUSED(desiredWidth),
int WXUNUSED(desiredHeight))
{ return false; }
virtual bool SaveFile(const wxBitmap *WXUNUSED(bitmap), const wxString& WXUNUSED(name),
wxBitmapType WXUNUSED(type), const wxPalette *WXUNUSED(palette) = NULL) const
{ return false; }
void SetName(const wxString& name) { m_name = name; }
void SetExtension(const wxString& ext) { m_extension = ext; }
void SetType(wxBitmapType type) { m_type = type; }
const wxString& GetName() const { return m_name; }
const wxString& GetExtension() const { return m_extension; }
wxBitmapType GetType() const { return m_type; }
private:
wxString m_name;
wxString m_extension;
wxBitmapType m_type;
wxDECLARE_ABSTRACT_CLASS(wxBitmapHandler);
};
// ----------------------------------------------------------------------------
// wxBitmap: class which represents platform-dependent bitmap (unlike wxImage)
// ----------------------------------------------------------------------------
class WXDLLIMPEXP_CORE wxBitmapBase : public wxGDIObject,
public wxBitmapHelpers
{
public:
/*
Derived class must implement these:
wxBitmap();
wxBitmap(const wxBitmap& bmp);
wxBitmap(const char bits[], int width, int height, int depth = 1);
wxBitmap(int width, int height, int depth = wxBITMAP_SCREEN_DEPTH);
wxBitmap(const wxSize& sz, int depth = wxBITMAP_SCREEN_DEPTH);
wxBitmap(const char* const* bits);
wxBitmap(const wxString &filename, wxBitmapType type = wxBITMAP_TYPE_XPM);
wxBitmap(const wxImage& image, int depth = wxBITMAP_SCREEN_DEPTH, double scale = 1.0);
static void InitStandardHandlers();
*/
virtual bool Create(int width, int height, int depth = wxBITMAP_SCREEN_DEPTH) = 0;
virtual bool Create(const wxSize& sz, int depth = wxBITMAP_SCREEN_DEPTH) = 0;
virtual bool CreateScaled(int w, int h, int d, double logicalScale)
{ return Create(wxRound(w*logicalScale), wxRound(h*logicalScale), d); }
virtual int GetHeight() const = 0;
virtual int GetWidth() const = 0;
virtual int GetDepth() const = 0;
wxSize GetSize() const
{ return wxSize(GetWidth(), GetHeight()); }
// support for scaled bitmaps
virtual double GetScaleFactor() const { return 1.0; }
virtual double GetScaledWidth() const { return GetWidth() / GetScaleFactor(); }
virtual double GetScaledHeight() const { return GetHeight() / GetScaleFactor(); }
virtual wxSize GetScaledSize() const
{ return wxSize(wxRound(GetScaledWidth()), wxRound(GetScaledHeight())); }
#if wxUSE_IMAGE
virtual wxImage ConvertToImage() const = 0;
// Convert to disabled (dimmed) bitmap.
wxBitmap ConvertToDisabled(unsigned char brightness = 255) const;
#endif // wxUSE_IMAGE
virtual wxMask *GetMask() const = 0;
virtual void SetMask(wxMask *mask) = 0;
virtual wxBitmap GetSubBitmap(const wxRect& rect) const = 0;
virtual bool SaveFile(const wxString &name, wxBitmapType type,
const wxPalette *palette = NULL) const = 0;
virtual bool LoadFile(const wxString &name, wxBitmapType type) = 0;
/*
If raw bitmap access is supported (see wx/rawbmp.h), the following
methods should be implemented:
virtual bool GetRawData(wxRawBitmapData *data) = 0;
virtual void UngetRawData(wxRawBitmapData *data) = 0;
*/
#if wxUSE_PALETTE
virtual wxPalette *GetPalette() const = 0;
virtual void SetPalette(const wxPalette& palette) = 0;
#endif // wxUSE_PALETTE
// copies the contents and mask of the given (colour) icon to the bitmap
virtual bool CopyFromIcon(const wxIcon& icon) = 0;
// implementation:
#if WXWIN_COMPATIBILITY_3_0
// deprecated
virtual void SetHeight(int height) = 0;
virtual void SetWidth(int width) = 0;
virtual void SetDepth(int depth) = 0;
#endif
// Format handling
static inline wxList& GetHandlers() { return sm_handlers; }
static void AddHandler(wxBitmapHandler *handler);
static void InsertHandler(wxBitmapHandler *handler);
static bool RemoveHandler(const wxString& name);
static wxBitmapHandler *FindHandler(const wxString& name);
static wxBitmapHandler *FindHandler(const wxString& extension, wxBitmapType bitmapType);
static wxBitmapHandler *FindHandler(wxBitmapType bitmapType);
//static void InitStandardHandlers();
// (wxBitmap must implement this one)
static void CleanUpHandlers();
// this method is only used by the generic implementation of wxMask
// currently but could be useful elsewhere in the future: it can be
// overridden to quantize the colour to correspond to bitmap colour depth
// if necessary; default implementation simply returns the colour as is
virtual wxColour QuantizeColour(const wxColour& colour) const
{
return colour;
}
protected:
static wxList sm_handlers;
wxDECLARE_ABSTRACT_CLASS(wxBitmapBase);
};
#endif // wxUSE_BITMAP_BASE
// the wxBITMAP_DEFAULT_TYPE constant defines the default argument value
// for wxBitmap's ctor and wxBitmap::LoadFile() functions.
#if defined(__WXMSW__)
#define wxBITMAP_DEFAULT_TYPE wxBITMAP_TYPE_BMP_RESOURCE
#include "wx/msw/bitmap.h"
#elif defined(__WXMOTIF__)
#define wxBITMAP_DEFAULT_TYPE wxBITMAP_TYPE_XPM
#include "wx/x11/bitmap.h"
#elif defined(__WXGTK20__)
#ifdef __WINDOWS__
#define wxBITMAP_DEFAULT_TYPE wxBITMAP_TYPE_BMP_RESOURCE
#else
#define wxBITMAP_DEFAULT_TYPE wxBITMAP_TYPE_XPM
#endif
#include "wx/gtk/bitmap.h"
#elif defined(__WXGTK__)
#define wxBITMAP_DEFAULT_TYPE wxBITMAP_TYPE_XPM
#include "wx/gtk1/bitmap.h"
#elif defined(__WXX11__)
#define wxBITMAP_DEFAULT_TYPE wxBITMAP_TYPE_XPM
#include "wx/x11/bitmap.h"
#elif defined(__WXDFB__)
#define wxBITMAP_DEFAULT_TYPE wxBITMAP_TYPE_BMP_RESOURCE
#include "wx/dfb/bitmap.h"
#elif defined(__WXMAC__)
#define wxBITMAP_DEFAULT_TYPE wxBITMAP_TYPE_PICT_RESOURCE
#include "wx/osx/bitmap.h"
#elif defined(__WXQT__)
#define wxBITMAP_DEFAULT_TYPE wxBITMAP_TYPE_XPM
#include "wx/qt/bitmap.h"
#endif
#if wxUSE_IMAGE
inline
wxBitmap
#if wxUSE_BITMAP_BASE
wxBitmapBase::
#else
wxBitmap::
#endif
ConvertToDisabled(unsigned char brightness) const
{
const wxImage imgDisabled = ConvertToImage().ConvertToDisabled(brightness);
return wxBitmap(imgDisabled, -1, GetScaleFactor());
}
#endif // wxUSE_IMAGE
// we must include generic mask.h after wxBitmap definition
#if defined(__WXDFB__)
#define wxUSE_GENERIC_MASK 1
#else
#define wxUSE_GENERIC_MASK 0
#endif
#if wxUSE_GENERIC_MASK
#include "wx/generic/mask.h"
#endif
#endif // _WX_BITMAP_H_BASE_
| h |
rticonnextdds-usecases | data/projects/rticonnextdds-usecases/VehicleTracking/ExampleCode/thirdparty/wxWidgets-3.1.2/Win32/include/wx/laywin.h | /////////////////////////////////////////////////////////////////////////////
// Name: wx/laywin.h
// Purpose: wxSashLayoutWindow base header
// Author: Julian Smart
// Modified by:
// Created:
// Copyright: (c) Julian Smart
// Licence: wxWindows licence
/////////////////////////////////////////////////////////////////////////////
#ifndef _WX_LAYWIN_H_BASE_
#define _WX_LAYWIN_H_BASE_
#include "wx/generic/laywin.h"
#endif
// _WX_LAYWIN_H_BASE_
| h |
rticonnextdds-usecases | data/projects/rticonnextdds-usecases/VehicleTracking/ExampleCode/thirdparty/wxWidgets-3.1.2/Win32/include/wx/cmndata.h | /////////////////////////////////////////////////////////////////////////////
// Name: wx/cmndata.h
// Purpose: Common GDI data classes
// Author: Julian Smart and others
// Modified by:
// Created: 01/02/97
// Copyright: (c)
// Licence: wxWindows licence
/////////////////////////////////////////////////////////////////////////////
#ifndef _WX_CMNDATA_H_BASE_
#define _WX_CMNDATA_H_BASE_
#include "wx/defs.h"
#if wxUSE_PRINTING_ARCHITECTURE
#include "wx/gdicmn.h"
#if wxUSE_STREAMS
#include "wx/stream.h"
#endif
class WXDLLIMPEXP_FWD_CORE wxPrintNativeDataBase;
/*
* wxPrintData
* Encapsulates printer information (not printer dialog information)
*/
enum wxPrintBin
{
wxPRINTBIN_DEFAULT,
wxPRINTBIN_ONLYONE,
wxPRINTBIN_LOWER,
wxPRINTBIN_MIDDLE,
wxPRINTBIN_MANUAL,
wxPRINTBIN_ENVELOPE,
wxPRINTBIN_ENVMANUAL,
wxPRINTBIN_AUTO,
wxPRINTBIN_TRACTOR,
wxPRINTBIN_SMALLFMT,
wxPRINTBIN_LARGEFMT,
wxPRINTBIN_LARGECAPACITY,
wxPRINTBIN_CASSETTE,
wxPRINTBIN_FORMSOURCE,
wxPRINTBIN_USER
};
const int wxPRINTMEDIA_DEFAULT = 0;
class WXDLLIMPEXP_CORE wxPrintData: public wxObject
{
public:
wxPrintData();
wxPrintData(const wxPrintData& printData);
virtual ~wxPrintData();
int GetNoCopies() const { return m_printNoCopies; }
bool GetCollate() const { return m_printCollate; }
wxPrintOrientation GetOrientation() const { return m_printOrientation; }
bool IsOrientationReversed() const { return m_printOrientationReversed; }
// Is this data OK for showing the print dialog?
bool Ok() const { return IsOk(); }
bool IsOk() const ;
const wxString& GetPrinterName() const { return m_printerName; }
bool GetColour() const { return m_colour; }
wxDuplexMode GetDuplex() const { return m_duplexMode; }
wxPaperSize GetPaperId() const { return m_paperId; }
const wxSize& GetPaperSize() const { return m_paperSize; }
wxPrintQuality GetQuality() const { return m_printQuality; }
wxPrintBin GetBin() const { return m_bin; }
wxPrintMode GetPrintMode() const { return m_printMode; }
int GetMedia() const { return m_media; }
void SetNoCopies(int v) { m_printNoCopies = v; }
void SetCollate(bool flag) { m_printCollate = flag; }
// Please use the overloaded method below
wxDEPRECATED_INLINE(void SetOrientation(int orient),
m_printOrientation = (wxPrintOrientation)orient; )
void SetOrientation(wxPrintOrientation orient) { m_printOrientation = orient; }
void SetOrientationReversed(bool reversed) { m_printOrientationReversed = reversed; }
void SetPrinterName(const wxString& name) { m_printerName = name; }
void SetColour(bool colour) { m_colour = colour; }
void SetDuplex(wxDuplexMode duplex) { m_duplexMode = duplex; }
void SetPaperId(wxPaperSize sizeId) { m_paperId = sizeId; }
void SetPaperSize(const wxSize& sz) { m_paperSize = sz; }
void SetQuality(wxPrintQuality quality) { m_printQuality = quality; }
void SetBin(wxPrintBin bin) { m_bin = bin; }
void SetMedia(int media) { m_media = media; }
void SetPrintMode(wxPrintMode printMode) { m_printMode = printMode; }
wxString GetFilename() const { return m_filename; }
void SetFilename( const wxString &filename ) { m_filename = filename; }
wxPrintData& operator=(const wxPrintData& data);
char* GetPrivData() const { return m_privData; }
int GetPrivDataLen() const { return m_privDataLen; }
void SetPrivData( char *privData, int len );
// Convert between wxPrintData and native data
void ConvertToNative();
void ConvertFromNative();
// Holds the native print data
wxPrintNativeDataBase *GetNativeData() const { return m_nativeData; }
private:
wxPrintBin m_bin;
int m_media;
wxPrintMode m_printMode;
int m_printNoCopies;
wxPrintOrientation m_printOrientation;
bool m_printOrientationReversed;
bool m_printCollate;
wxString m_printerName;
bool m_colour;
wxDuplexMode m_duplexMode;
wxPrintQuality m_printQuality;
wxPaperSize m_paperId;
wxSize m_paperSize;
wxString m_filename;
char* m_privData;
int m_privDataLen;
wxPrintNativeDataBase *m_nativeData;
private:
wxDECLARE_DYNAMIC_CLASS(wxPrintData);
};
/*
* wxPrintDialogData
* Encapsulates information displayed and edited in the printer dialog box.
* Contains a wxPrintData object which is filled in according to the values retrieved
* from the dialog.
*/
class WXDLLIMPEXP_CORE wxPrintDialogData: public wxObject
{
public:
wxPrintDialogData();
wxPrintDialogData(const wxPrintDialogData& dialogData);
wxPrintDialogData(const wxPrintData& printData);
virtual ~wxPrintDialogData();
int GetFromPage() const { return m_printFromPage; }
int GetToPage() const { return m_printToPage; }
int GetMinPage() const { return m_printMinPage; }
int GetMaxPage() const { return m_printMaxPage; }
int GetNoCopies() const { return m_printNoCopies; }
bool GetAllPages() const { return m_printAllPages; }
bool GetSelection() const { return m_printSelection; }
bool GetCollate() const { return m_printCollate; }
bool GetPrintToFile() const { return m_printToFile; }
void SetFromPage(int v) { m_printFromPage = v; }
void SetToPage(int v) { m_printToPage = v; }
void SetMinPage(int v) { m_printMinPage = v; }
void SetMaxPage(int v) { m_printMaxPage = v; }
void SetNoCopies(int v) { m_printNoCopies = v; }
void SetAllPages(bool flag) { m_printAllPages = flag; }
void SetSelection(bool flag) { m_printSelection = flag; }
void SetCollate(bool flag) { m_printCollate = flag; }
void SetPrintToFile(bool flag) { m_printToFile = flag; }
void EnablePrintToFile(bool flag) { m_printEnablePrintToFile = flag; }
void EnableSelection(bool flag) { m_printEnableSelection = flag; }
void EnablePageNumbers(bool flag) { m_printEnablePageNumbers = flag; }
void EnableHelp(bool flag) { m_printEnableHelp = flag; }
bool GetEnablePrintToFile() const { return m_printEnablePrintToFile; }
bool GetEnableSelection() const { return m_printEnableSelection; }
bool GetEnablePageNumbers() const { return m_printEnablePageNumbers; }
bool GetEnableHelp() const { return m_printEnableHelp; }
// Is this data OK for showing the print dialog?
bool Ok() const { return IsOk(); }
bool IsOk() const { return m_printData.IsOk() ; }
wxPrintData& GetPrintData() { return m_printData; }
void SetPrintData(const wxPrintData& printData) { m_printData = printData; }
void operator=(const wxPrintDialogData& data);
void operator=(const wxPrintData& data); // Sets internal m_printData member
private:
int m_printFromPage;
int m_printToPage;
int m_printMinPage;
int m_printMaxPage;
int m_printNoCopies;
bool m_printAllPages;
bool m_printCollate;
bool m_printToFile;
bool m_printSelection;
bool m_printEnableSelection;
bool m_printEnablePageNumbers;
bool m_printEnableHelp;
bool m_printEnablePrintToFile;
wxPrintData m_printData;
private:
wxDECLARE_DYNAMIC_CLASS(wxPrintDialogData);
};
/*
* This is the data used (and returned) by the wxPageSetupDialog.
*/
// Compatibility with old name
#define wxPageSetupData wxPageSetupDialogData
class WXDLLIMPEXP_CORE wxPageSetupDialogData: public wxObject
{
public:
wxPageSetupDialogData();
wxPageSetupDialogData(const wxPageSetupDialogData& dialogData);
wxPageSetupDialogData(const wxPrintData& printData);
virtual ~wxPageSetupDialogData();
wxSize GetPaperSize() const { return m_paperSize; }
wxPaperSize GetPaperId() const { return m_printData.GetPaperId(); }
wxPoint GetMinMarginTopLeft() const { return m_minMarginTopLeft; }
wxPoint GetMinMarginBottomRight() const { return m_minMarginBottomRight; }
wxPoint GetMarginTopLeft() const { return m_marginTopLeft; }
wxPoint GetMarginBottomRight() const { return m_marginBottomRight; }
bool GetDefaultMinMargins() const { return m_defaultMinMargins; }
bool GetEnableMargins() const { return m_enableMargins; }
bool GetEnableOrientation() const { return m_enableOrientation; }
bool GetEnablePaper() const { return m_enablePaper; }
bool GetEnablePrinter() const { return m_enablePrinter; }
bool GetDefaultInfo() const { return m_getDefaultInfo; }
bool GetEnableHelp() const { return m_enableHelp; }
// Is this data OK for showing the page setup dialog?
bool Ok() const { return IsOk(); }
bool IsOk() const { return m_printData.IsOk() ; }
// If a corresponding paper type is found in the paper database, will set the m_printData
// paper size id member as well.
void SetPaperSize(const wxSize& sz);
void SetPaperId(wxPaperSize id) { m_printData.SetPaperId(id); }
// Sets the wxPrintData id, plus the paper width/height if found in the paper database.
void SetPaperSize(wxPaperSize id);
void SetMinMarginTopLeft(const wxPoint& pt) { m_minMarginTopLeft = pt; }
void SetMinMarginBottomRight(const wxPoint& pt) { m_minMarginBottomRight = pt; }
void SetMarginTopLeft(const wxPoint& pt) { m_marginTopLeft = pt; }
void SetMarginBottomRight(const wxPoint& pt) { m_marginBottomRight = pt; }
void SetDefaultMinMargins(bool flag) { m_defaultMinMargins = flag; }
void SetDefaultInfo(bool flag) { m_getDefaultInfo = flag; }
void EnableMargins(bool flag) { m_enableMargins = flag; }
void EnableOrientation(bool flag) { m_enableOrientation = flag; }
void EnablePaper(bool flag) { m_enablePaper = flag; }
void EnablePrinter(bool flag) { m_enablePrinter = flag; }
void EnableHelp(bool flag) { m_enableHelp = flag; }
// Use paper size defined in this object to set the wxPrintData
// paper id
void CalculateIdFromPaperSize();
// Use paper id in wxPrintData to set this object's paper size
void CalculatePaperSizeFromId();
wxPageSetupDialogData& operator=(const wxPageSetupDialogData& data);
wxPageSetupDialogData& operator=(const wxPrintData& data);
wxPrintData& GetPrintData() { return m_printData; }
const wxPrintData& GetPrintData() const { return m_printData; }
void SetPrintData(const wxPrintData& printData);
private:
wxSize m_paperSize; // The dimensions selected by the user (on return, same as in wxPrintData?)
wxPoint m_minMarginTopLeft;
wxPoint m_minMarginBottomRight;
wxPoint m_marginTopLeft;
wxPoint m_marginBottomRight;
bool m_defaultMinMargins;
bool m_enableMargins;
bool m_enableOrientation;
bool m_enablePaper;
bool m_enablePrinter;
bool m_getDefaultInfo; // Equiv. to PSD_RETURNDEFAULT
bool m_enableHelp;
wxPrintData m_printData;
private:
wxDECLARE_DYNAMIC_CLASS(wxPageSetupDialogData);
};
#endif // wxUSE_PRINTING_ARCHITECTURE
#endif
// _WX_CMNDATA_H_BASE_
| h |
rticonnextdds-usecases | data/projects/rticonnextdds-usecases/VehicleTracking/ExampleCode/thirdparty/wxWidgets-3.1.2/Win32/include/wx/listbook.h | ///////////////////////////////////////////////////////////////////////////////
// Name: wx/listbook.h
// Purpose: wxListbook: wxListCtrl and wxNotebook combination
// Author: Vadim Zeitlin
// Modified by:
// Created: 19.08.03
// Copyright: (c) 2003 Vadim Zeitlin <[email protected]>
// Licence: wxWindows licence
///////////////////////////////////////////////////////////////////////////////
#ifndef _WX_LISTBOOK_H_
#define _WX_LISTBOOK_H_
#include "wx/defs.h"
#if wxUSE_LISTBOOK
#include "wx/bookctrl.h"
#include "wx/containr.h"
class WXDLLIMPEXP_FWD_CORE wxListView;
class WXDLLIMPEXP_FWD_CORE wxListEvent;
wxDECLARE_EXPORTED_EVENT( WXDLLIMPEXP_CORE, wxEVT_LISTBOOK_PAGE_CHANGED, wxBookCtrlEvent );
wxDECLARE_EXPORTED_EVENT( WXDLLIMPEXP_CORE, wxEVT_LISTBOOK_PAGE_CHANGING, wxBookCtrlEvent );
// wxListbook flags
#define wxLB_DEFAULT wxBK_DEFAULT
#define wxLB_TOP wxBK_TOP
#define wxLB_BOTTOM wxBK_BOTTOM
#define wxLB_LEFT wxBK_LEFT
#define wxLB_RIGHT wxBK_RIGHT
#define wxLB_ALIGN_MASK wxBK_ALIGN_MASK
// ----------------------------------------------------------------------------
// wxListbook
// ----------------------------------------------------------------------------
class WXDLLIMPEXP_CORE wxListbook : public wxNavigationEnabled<wxBookCtrlBase>
{
public:
wxListbook() { }
wxListbook(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);
// overridden base class methods
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 int HitTest(const wxPoint& pt, long *flags = NULL) const wxOVERRIDE;
virtual void SetImageList(wxImageList *imageList) wxOVERRIDE;
virtual bool DeleteAllPages() wxOVERRIDE;
wxListView* GetListView() const { return (wxListView*)m_bookctrl; }
protected:
virtual wxWindow *DoRemovePage(size_t page) wxOVERRIDE;
void UpdateSelectedPage(size_t newsel) wxOVERRIDE;
wxBookCtrlEvent* CreatePageChangingEvent() const wxOVERRIDE;
void MakeChangedEvent(wxBookCtrlEvent &event) wxOVERRIDE;
// Get the correct wxListCtrl flags to use depending on our own flags.
long GetListCtrlFlags() const;
// event handlers
void OnListSelected(wxListEvent& event);
void OnSize(wxSizeEvent& event);
private:
// this should be called when we need to be relaid out
void UpdateSize();
wxDECLARE_EVENT_TABLE();
wxDECLARE_DYNAMIC_CLASS_NO_COPY(wxListbook);
};
// ----------------------------------------------------------------------------
// listbook event class and related stuff
// ----------------------------------------------------------------------------
// wxListbookEvent 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 wxListbookEvent wxBookCtrlEvent
typedef wxBookCtrlEventFunction wxListbookEventFunction;
#define wxListbookEventHandler(func) wxBookCtrlEventHandler(func)
#define EVT_LISTBOOK_PAGE_CHANGED(winid, fn) \
wx__DECLARE_EVT1(wxEVT_LISTBOOK_PAGE_CHANGED, winid, wxBookCtrlEventHandler(fn))
#define EVT_LISTBOOK_PAGE_CHANGING(winid, fn) \
wx__DECLARE_EVT1(wxEVT_LISTBOOK_PAGE_CHANGING, winid, wxBookCtrlEventHandler(fn))
// old wxEVT_COMMAND_* constants
#define wxEVT_COMMAND_LISTBOOK_PAGE_CHANGED wxEVT_LISTBOOK_PAGE_CHANGED
#define wxEVT_COMMAND_LISTBOOK_PAGE_CHANGING wxEVT_LISTBOOK_PAGE_CHANGING
#endif // wxUSE_LISTBOOK
#endif // _WX_LISTBOOK_H_
| h |
rticonnextdds-usecases | data/projects/rticonnextdds-usecases/VehicleTracking/ExampleCode/thirdparty/wxWidgets-3.1.2/Win32/include/wx/uri.h | /////////////////////////////////////////////////////////////////////////////
// Name: wx/uri.h
// Purpose: wxURI - Class for parsing URIs
// Author: Ryan Norton
// Vadim Zeitlin (UTF-8 URI support, many other changes)
// Created: 07/01/2004
// Copyright: (c) 2004 Ryan Norton
// 2008 Vadim Zeitlin
// Licence: wxWindows Licence
/////////////////////////////////////////////////////////////////////////////
#ifndef _WX_URI_H_
#define _WX_URI_H_
#include "wx/defs.h"
#include "wx/object.h"
#include "wx/string.h"
#include "wx/arrstr.h"
// Host Type that the server component can be
enum wxURIHostType
{
wxURI_REGNAME, // Host is a normal register name (www.mysite.com etc.)
wxURI_IPV4ADDRESS, // Host is a version 4 ip address (192.168.1.100)
wxURI_IPV6ADDRESS, // Host is a version 6 ip address [aa:aa:aa:aa::aa:aa]:5050
wxURI_IPVFUTURE // Host is a future ip address (wxURI is unsure what kind)
};
// Component Flags
enum wxURIFieldType
{
wxURI_SCHEME = 1,
wxURI_USERINFO = 2,
wxURI_SERVER = 4,
wxURI_PORT = 8,
wxURI_PATH = 16,
wxURI_QUERY = 32,
wxURI_FRAGMENT = 64
};
// Miscellaneous other flags
enum wxURIFlags
{
wxURI_STRICT = 1
};
// Generic class for parsing URIs.
//
// See RFC 3986
class WXDLLIMPEXP_BASE wxURI : public wxObject
{
public:
wxURI();
wxURI(const wxString& uri);
// default copy ctor, assignment operator and dtor are ok
bool Create(const wxString& uri);
wxURI& operator=(const wxString& string)
{
Create(string);
return *this;
}
bool operator==(const wxURI& uri) const;
// various accessors
bool HasScheme() const { return (m_fields & wxURI_SCHEME) != 0; }
bool HasUserInfo() const { return (m_fields & wxURI_USERINFO) != 0; }
bool HasServer() const { return (m_fields & wxURI_SERVER) != 0; }
bool HasPort() const { return (m_fields & wxURI_PORT) != 0; }
bool HasPath() const { return (m_fields & wxURI_PATH) != 0; }
bool HasQuery() const { return (m_fields & wxURI_QUERY) != 0; }
bool HasFragment() const { return (m_fields & wxURI_FRAGMENT) != 0; }
const wxString& GetScheme() const { return m_scheme; }
const wxString& GetPath() const { return m_path; }
const wxString& GetQuery() const { return m_query; }
const wxString& GetFragment() const { return m_fragment; }
const wxString& GetPort() const { return m_port; }
const wxString& GetUserInfo() const { return m_userinfo; }
const wxString& GetServer() const { return m_server; }
wxURIHostType GetHostType() const { return m_hostType; }
// these functions only work if the user information part of the URI is in
// the usual (but insecure and hence explicitly recommended against by the
// RFC) "user:password" form
wxString GetUser() const;
wxString GetPassword() const;
// combine all URI components into a single string
//
// BuildURI() returns the real URI suitable for use with network libraries,
// for example, while BuildUnescapedURI() returns a string suitable to be
// shown to the user.
wxString BuildURI() const { return DoBuildURI(&wxURI::Nothing); }
wxString BuildUnescapedURI() const { return DoBuildURI(&wxURI::Unescape); }
// the escaped URI should contain only ASCII characters, including possible
// escape sequences
static wxString Unescape(const wxString& escapedURI);
void Resolve(const wxURI& base, int flags = wxURI_STRICT);
bool IsReference() const;
bool IsRelative() const;
protected:
void Clear();
// common part of BuildURI() and BuildUnescapedURI()
wxString DoBuildURI(wxString (*funcDecode)(const wxString&)) const;
// function which returns its argument unmodified, this is used by
// BuildURI() to tell DoBuildURI() that nothing needs to be done with the
// URI components
static wxString Nothing(const wxString& value) { return value; }
bool Parse(const char* uri);
const char* ParseAuthority (const char* uri);
const char* ParseScheme (const char* uri);
const char* ParseUserInfo (const char* uri);
const char* ParseServer (const char* uri);
const char* ParsePort (const char* uri);
const char* ParsePath (const char* uri);
const char* ParseQuery (const char* uri);
const char* ParseFragment (const char* uri);
static bool ParseH16(const char*& uri);
static bool ParseIPv4address(const char*& uri);
static bool ParseIPv6address(const char*& uri);
static bool ParseIPvFuture(const char*& uri);
// append next character pointer to by p to the string in an escaped form
// and advance p past it
//
// if the next character is '%' and it's followed by 2 hex digits, they are
// not escaped (again) by this function, this allows to keep (backwards-
// compatible) ambiguity about the input format to wxURI::Create(): it can
// be either already escaped or not
void AppendNextEscaped(wxString& s, const char *& p);
// convert hexadecimal digit to its value; return -1 if c isn't valid
static int CharToHex(char c);
// split an URI path string in its component segments (including empty and
// "." ones, no post-processing is done)
static wxArrayString SplitInSegments(const wxString& path);
// various URI grammar helpers
static bool IsUnreserved(char c);
static bool IsReserved(char c);
static bool IsGenDelim(char c);
static bool IsSubDelim(char c);
static bool IsHex(char c);
static bool IsAlpha(char c);
static bool IsDigit(char c);
static bool IsEndPath(char c);
wxString m_scheme;
wxString m_path;
wxString m_query;
wxString m_fragment;
wxString m_userinfo;
wxString m_server;
wxString m_port;
wxURIHostType m_hostType;
size_t m_fields;
wxDECLARE_DYNAMIC_CLASS(wxURI);
};
#endif // _WX_URI_H_
| h |
rticonnextdds-usecases | data/projects/rticonnextdds-usecases/VehicleTracking/ExampleCode/thirdparty/wxWidgets-3.1.2/Win32/include/wx/modalhook.h | ///////////////////////////////////////////////////////////////////////////////
// Name: wx/modalhook.h
// Purpose: Allows to hook into showing modal dialogs.
// Author: Vadim Zeitlin
// Created: 2013-05-19
// Copyright: (c) 2013 Vadim Zeitlin <[email protected]>
// Licence: wxWindows licence
///////////////////////////////////////////////////////////////////////////////
#ifndef _WX_MODALHOOK_H_
#define _WX_MODALHOOK_H_
#include "wx/vector.h"
class WXDLLIMPEXP_FWD_CORE wxDialog;
// ----------------------------------------------------------------------------
// Class allowing to be notified about any modal dialog calls.
// ----------------------------------------------------------------------------
// To be notified about entering and exiting modal dialogs and possibly to
// replace them with something else (e.g. just return a predefined value for
// testing), define an object of this class, override its Enter() and
// possibly Exit() methods and call Register() on it.
class WXDLLIMPEXP_CORE wxModalDialogHook
{
public:
// Default ctor doesn't do anything, call Register() to activate the hook.
wxModalDialogHook() { }
// Dtor unregisters the hook if it had been registered.
virtual ~wxModalDialogHook() { DoUnregister(); }
// Register this hook as being active, i.e. its Enter() and Exit() methods
// will be called.
//
// Notice that the order of registration matters: the last hook registered
// is called first, and if its Enter() returns something != wxID_NONE, the
// subsequent hooks are skipped.
void Register();
// Unregister this hook. Notice that is done automatically from the dtor.
void Unregister();
// Called from wxWidgets code before showing any modal dialogs and calls
// Enter() for every registered hook.
static int CallEnter(wxDialog* dialog);
// Called from wxWidgets code after dismissing the dialog and calls Exit()
// for every registered hook.
static void CallExit(wxDialog* dialog);
protected:
// Called by wxWidgets before showing any modal dialogs, override this to
// be notified about this and return anything but wxID_NONE to skip showing
// the modal dialog entirely and just return the specified result.
virtual int Enter(wxDialog* dialog) = 0;
// Called by wxWidgets after dismissing the modal dialog. Notice that it
// won't be called if Enter() hadn't been.
virtual void Exit(wxDialog* WXUNUSED(dialog)) { }
private:
// Unregister the given hook, return true if it was done or false if the
// hook wasn't found.
bool DoUnregister();
// All the hooks in reverse registration order (i.e. in call order).
typedef wxVector<wxModalDialogHook*> Hooks;
static Hooks ms_hooks;
wxDECLARE_NO_COPY_CLASS(wxModalDialogHook);
};
// Helper object used by WX_MODAL_DIALOG_HOOK below to ensure that CallExit()
// is called on scope exit.
class wxModalDialogHookExitGuard
{
public:
explicit wxModalDialogHookExitGuard(wxDialog* dialog)
: m_dialog(dialog)
{
}
~wxModalDialogHookExitGuard()
{
wxModalDialogHook::CallExit(m_dialog);
}
private:
wxDialog* const m_dialog;
wxDECLARE_NO_COPY_CLASS(wxModalDialogHookExitGuard);
};
// This macro needs to be used at the top of every implementation of
// ShowModal() in order for wxModalDialogHook to work.
#define WX_HOOK_MODAL_DIALOG() \
const int modalDialogHookRC = wxModalDialogHook::CallEnter(this); \
if ( modalDialogHookRC != wxID_NONE ) \
return modalDialogHookRC; \
wxModalDialogHookExitGuard modalDialogHookExit(this)
#endif // _WX_MODALHOOK_H_
| h |
rticonnextdds-usecases | data/projects/rticonnextdds-usecases/VehicleTracking/ExampleCode/thirdparty/wxWidgets-3.1.2/Win32/include/wx/dcsvg.h | /////////////////////////////////////////////////////////////////////////////
// Name: wx/dcsvg.h
// Purpose: wxSVGFileDC
// Author: Chris Elliott
// Modified by:
// Created:
// Copyright: (c) Chris Elliott
// Licence: wxWindows licence
/////////////////////////////////////////////////////////////////////////////
#ifndef _WX_DCSVG_H_
#define _WX_DCSVG_H_
#include "wx/string.h"
#include "wx/dc.h"
#if wxUSE_SVG
#include "wx/scopedptr.h"
#define wxSVGVersion wxT("v0101")
class WXDLLIMPEXP_FWD_BASE wxFileOutputStream;
class WXDLLIMPEXP_FWD_CORE wxSVGFileDC;
// Base class for bitmap handlers used by wxSVGFileDC, used by the standard
// "embed" and "link" handlers below but can also be used to create a custom
// handler.
class WXDLLIMPEXP_CORE wxSVGBitmapHandler
{
public:
// Write the representation of the given bitmap, appearing at the specified
// position, to the provided stream.
virtual bool ProcessBitmap(const wxBitmap& bitmap,
wxCoord x, wxCoord y,
wxOutputStream& stream) const = 0;
virtual ~wxSVGBitmapHandler() {}
};
// Predefined standard bitmap handler: creates a file, stores the bitmap in
// this file and uses the file URI in the generated SVG.
class WXDLLIMPEXP_CORE wxSVGBitmapFileHandler : public wxSVGBitmapHandler
{
public:
virtual bool ProcessBitmap(const wxBitmap& bitmap,
wxCoord x, wxCoord y,
wxOutputStream& stream) const wxOVERRIDE;
};
// Predefined handler which embeds the bitmap (base64-encoding it) inside the
// generated SVG file.
class WXDLLIMPEXP_CORE wxSVGBitmapEmbedHandler : public wxSVGBitmapHandler
{
public:
virtual bool ProcessBitmap(const wxBitmap& bitmap,
wxCoord x, wxCoord y,
wxOutputStream& stream) const wxOVERRIDE;
};
class WXDLLIMPEXP_CORE wxSVGFileDCImpl : public wxDCImpl
{
public:
wxSVGFileDCImpl( wxSVGFileDC *owner, const wxString &filename,
int width = 320, int height = 240, double dpi = 72.0,
const wxString &title = wxString() );
virtual ~wxSVGFileDCImpl();
bool IsOk() const wxOVERRIDE { return m_OK; }
virtual bool CanDrawBitmap() const wxOVERRIDE { return true; }
virtual bool CanGetTextExtent() const wxOVERRIDE { return true; }
virtual int GetDepth() const wxOVERRIDE
{
wxFAIL_MSG(wxT("wxSVGFILEDC::GetDepth Call not implemented"));
return -1;
}
virtual void Clear() wxOVERRIDE;
virtual void DestroyClippingRegion() wxOVERRIDE;
virtual wxCoord GetCharHeight() const wxOVERRIDE;
virtual wxCoord GetCharWidth() const wxOVERRIDE;
#if wxUSE_PALETTE
virtual void SetPalette(const wxPalette& WXUNUSED(palette)) wxOVERRIDE
{
wxFAIL_MSG(wxT("wxSVGFILEDC::SetPalette not implemented"));
}
#endif
virtual void SetLogicalFunction(wxRasterOperationMode WXUNUSED(function)) wxOVERRIDE
{
wxFAIL_MSG(wxT("wxSVGFILEDC::SetLogicalFunction Call not implemented"));
}
virtual wxRasterOperationMode GetLogicalFunction() const wxOVERRIDE
{
wxFAIL_MSG(wxT("wxSVGFILEDC::GetLogicalFunction() not implemented"));
return wxCOPY;
}
virtual void SetLogicalOrigin(wxCoord x, wxCoord y) wxOVERRIDE
{
wxDCImpl::SetLogicalOrigin(x, y);
m_graphics_changed = true;
}
virtual void SetDeviceOrigin(wxCoord x, wxCoord y) wxOVERRIDE
{
wxDCImpl::SetDeviceOrigin(x, y);
m_graphics_changed = true;
}
virtual void SetAxisOrientation(bool xLeftRight, bool yBottomUp) wxOVERRIDE
{
wxDCImpl::SetAxisOrientation(xLeftRight, yBottomUp);
m_graphics_changed = true;
}
virtual void SetBackground( const wxBrush &brush ) wxOVERRIDE;
virtual void SetBackgroundMode( int mode ) wxOVERRIDE;
virtual void SetBrush(const wxBrush& brush) wxOVERRIDE;
virtual void SetFont(const wxFont& font) wxOVERRIDE;
virtual void SetPen(const wxPen& pen) wxOVERRIDE;
virtual void* GetHandle() const wxOVERRIDE { return NULL; }
void SetBitmapHandler(wxSVGBitmapHandler* handler);
private:
virtual bool DoGetPixel(wxCoord, wxCoord, wxColour *) const wxOVERRIDE
{
wxFAIL_MSG(wxT("wxSVGFILEDC::DoGetPixel Call not implemented"));
return true;
}
virtual bool DoBlit(wxCoord, wxCoord, wxCoord, wxCoord, wxDC *,
wxCoord, wxCoord, wxRasterOperationMode = wxCOPY,
bool = 0, int = -1, int = -1) wxOVERRIDE;
virtual void DoCrossHair(wxCoord, wxCoord) wxOVERRIDE
{
wxFAIL_MSG(wxT("wxSVGFILEDC::CrossHair Call not implemented"));
}
virtual void DoDrawArc(wxCoord, wxCoord, wxCoord, wxCoord, wxCoord, wxCoord) wxOVERRIDE;
virtual void DoDrawBitmap(const wxBitmap &, wxCoord, wxCoord, bool = false) wxOVERRIDE;
virtual void DoDrawCheckMark(wxCoord x, wxCoord y, wxCoord w, wxCoord h) wxOVERRIDE;
virtual void DoDrawEllipse(wxCoord x, wxCoord y, wxCoord w, wxCoord h) wxOVERRIDE;
virtual void DoDrawEllipticArc(wxCoord x, wxCoord y, wxCoord w, wxCoord h,
double sa, double ea) wxOVERRIDE;
virtual void DoDrawIcon(const wxIcon &, wxCoord, wxCoord) wxOVERRIDE;
virtual void DoDrawLine (wxCoord x1, wxCoord y1, wxCoord x2, wxCoord y2) wxOVERRIDE;
virtual void DoDrawLines(int n, const wxPoint points[],
wxCoord xoffset = 0, wxCoord yoffset = 0) wxOVERRIDE;
virtual void DoDrawPoint(wxCoord, wxCoord) wxOVERRIDE;
virtual void DoDrawPolygon(int n, const wxPoint points[],
wxCoord xoffset, wxCoord yoffset,
wxPolygonFillMode fillStyle) wxOVERRIDE;
virtual void DoDrawPolyPolygon(int n, const int count[], const wxPoint points[],
wxCoord xoffset, wxCoord yoffset,
wxPolygonFillMode fillStyle) wxOVERRIDE;
virtual void DoDrawRectangle(wxCoord x, wxCoord y, wxCoord w, wxCoord h) wxOVERRIDE;
virtual void DoDrawRotatedText(const wxString& text, wxCoord x, wxCoord y,
double angle) wxOVERRIDE;
virtual void DoDrawRoundedRectangle(wxCoord x, wxCoord y,
wxCoord w, wxCoord h,
double radius = 20) wxOVERRIDE ;
virtual void DoDrawText(const wxString& text, wxCoord x, wxCoord y) wxOVERRIDE;
virtual bool DoFloodFill(wxCoord WXUNUSED(x), wxCoord WXUNUSED(y),
const wxColour& WXUNUSED(col),
wxFloodFillStyle WXUNUSED(style) = wxFLOOD_SURFACE) wxOVERRIDE
{
wxFAIL_MSG(wxT("wxSVGFILEDC::DoFloodFill Call not implemented"));
return false;
}
virtual void DoGetSize(int * x, int *y) const wxOVERRIDE
{
if ( x )
*x = m_width;
if ( y )
*y = m_height;
}
virtual void DoGetTextExtent(const wxString& string, wxCoord *w, wxCoord *h,
wxCoord *descent = NULL,
wxCoord *externalLeading = NULL,
const wxFont *font = NULL) const wxOVERRIDE;
virtual void DoSetDeviceClippingRegion(const wxRegion& region) wxOVERRIDE
{
DoSetClippingRegion(region.GetBox().x, region.GetBox().y,
region.GetBox().width, region.GetBox().height);
}
virtual void DoSetClippingRegion(int x, int y, int width, int height) wxOVERRIDE;
virtual void DoGetSizeMM( int *width, int *height ) const wxOVERRIDE;
virtual wxSize GetPPI() const wxOVERRIDE;
void Init (const wxString &filename, int width, int height,
double dpi, const wxString &title);
void write( const wxString &s );
private:
// If m_graphics_changed is true, close the current <g> element and start a
// new one for the last pen/brush change.
void NewGraphicsIfNeeded();
// Open a new graphics group setting up all the attributes according to
// their current values in wxDC.
void DoStartNewGraphics();
wxString m_filename;
int m_sub_images; // number of png format images we have
bool m_OK;
bool m_graphics_changed; // set by Set{Brush,Pen}()
int m_width, m_height;
double m_dpi;
wxScopedPtr<wxFileOutputStream> m_outfile;
wxScopedPtr<wxSVGBitmapHandler> m_bmp_handler; // class to handle bitmaps
// The clipping nesting level is incremented by every call to
// SetClippingRegion() and reset when DestroyClippingRegion() is called.
size_t m_clipNestingLevel;
// Unique ID for every clipping graphics group: this is simply always
// incremented in each SetClippingRegion() call.
size_t m_clipUniqueId;
wxDECLARE_ABSTRACT_CLASS(wxSVGFileDCImpl);
};
class WXDLLIMPEXP_CORE wxSVGFileDC : public wxDC
{
public:
wxSVGFileDC(const wxString& filename,
int width = 320,
int height = 240,
double dpi = 72.0,
const wxString& title = wxString())
: wxDC(new wxSVGFileDCImpl(this, filename, width, height, dpi, title))
{
}
// wxSVGFileDC-specific methods:
// Use a custom bitmap handler: takes ownership of the handler.
void SetBitmapHandler(wxSVGBitmapHandler* handler);
};
#endif // wxUSE_SVG
#endif // _WX_DCSVG_H_
| h |
rticonnextdds-usecases | data/projects/rticonnextdds-usecases/VehicleTracking/ExampleCode/thirdparty/wxWidgets-3.1.2/Win32/include/wx/affinematrix2d.h | /////////////////////////////////////////////////////////////////////////////
// Name: wx/affinematrix2d.h
// Purpose: wxAffineMatrix2D class.
// Author: Based on wxTransformMatrix by Chris Breeze, Julian Smart
// Created: 2011-04-05
// Copyright: (c) wxWidgets team
// Licence: wxWindows licence
/////////////////////////////////////////////////////////////////////////////
#ifndef _WX_AFFINEMATRIX2D_H_
#define _WX_AFFINEMATRIX2D_H_
#include "wx/defs.h"
#if wxUSE_GEOMETRY
#include "wx/affinematrix2dbase.h"
// A simple implementation of wxAffineMatrix2DBase interface done entirely in
// wxWidgets.
class WXDLLIMPEXP_CORE wxAffineMatrix2D : public wxAffineMatrix2DBase
{
public:
wxAffineMatrix2D() : m_11(1), m_12(0),
m_21(0), m_22(1),
m_tx(0), m_ty(0)
{
}
// Implement base class pure virtual methods.
virtual void Set(const wxMatrix2D& mat2D, const wxPoint2DDouble& tr) wxOVERRIDE;
virtual void Get(wxMatrix2D* mat2D, wxPoint2DDouble* tr) const wxOVERRIDE;
virtual void Concat(const wxAffineMatrix2DBase& t) wxOVERRIDE;
virtual bool Invert() wxOVERRIDE;
virtual bool IsIdentity() const wxOVERRIDE;
virtual bool IsEqual(const wxAffineMatrix2DBase& t) const wxOVERRIDE;
virtual void Translate(wxDouble dx, wxDouble dy) wxOVERRIDE;
virtual void Scale(wxDouble xScale, wxDouble yScale) wxOVERRIDE;
virtual void Rotate(wxDouble cRadians) wxOVERRIDE;
protected:
virtual wxPoint2DDouble DoTransformPoint(const wxPoint2DDouble& p) const wxOVERRIDE;
virtual wxPoint2DDouble DoTransformDistance(const wxPoint2DDouble& p) const wxOVERRIDE;
private:
wxDouble m_11, m_12, m_21, m_22, m_tx, m_ty;
};
#endif // wxUSE_GEOMETRY
#endif // _WX_AFFINEMATRIX2D_H_
| h |
rticonnextdds-usecases | data/projects/rticonnextdds-usecases/VehicleTracking/ExampleCode/thirdparty/wxWidgets-3.1.2/Win32/include/wx/quantize.h | /////////////////////////////////////////////////////////////////////////////
// Name: wx/quantize.h
// Purpose: wxQuantizer class
// Author: Julian Smart
// Modified by:
// Created: 22/6/2000
// Copyright: (c) Julian Smart
// Licence:
/////////////////////////////////////////////////////////////////////////////
#ifndef _WX_QUANTIZE_H_
#define _WX_QUANTIZE_H_
#include "wx/object.h"
/*
* From jquant2.c
*
* Copyright (C) 1991-1996, Thomas G. Lane.
* This file is part of the Independent JPEG Group's software.
* For conditions of distribution and use, see the accompanying README file.
*/
class WXDLLIMPEXP_FWD_CORE wxImage;
class WXDLLIMPEXP_FWD_CORE wxPalette;
/*
* wxQuantize
* Based on the JPEG quantization code. Reduces the number of colours in a wxImage.
*/
#define wxQUANTIZE_INCLUDE_WINDOWS_COLOURS 0x01
#define wxQUANTIZE_RETURN_8BIT_DATA 0x02
#define wxQUANTIZE_FILL_DESTINATION_IMAGE 0x04
class WXDLLIMPEXP_CORE wxQuantize: public wxObject
{
public:
wxDECLARE_DYNAMIC_CLASS(wxQuantize);
//// Constructor
wxQuantize() {}
virtual ~wxQuantize() {}
//// Operations
// Reduce the colours in the source image and put the result into the
// destination image. Both images may be the same, to overwrite the source image.
// Specify an optional palette pointer to receive the resulting palette.
// This palette may be passed to ConvertImageToBitmap, for example.
// If you pass a palette pointer, you must free the palette yourself.
static bool Quantize(const wxImage& src, wxImage& dest, wxPalette** pPalette, int desiredNoColours = 236,
unsigned char** eightBitData = 0, int flags = wxQUANTIZE_INCLUDE_WINDOWS_COLOURS|wxQUANTIZE_FILL_DESTINATION_IMAGE|wxQUANTIZE_RETURN_8BIT_DATA);
// This version sets a palette in the destination image so you don't
// have to manage it yourself.
static bool Quantize(const wxImage& src, wxImage& dest, int desiredNoColours = 236,
unsigned char** eightBitData = 0, int flags = wxQUANTIZE_INCLUDE_WINDOWS_COLOURS|wxQUANTIZE_FILL_DESTINATION_IMAGE|wxQUANTIZE_RETURN_8BIT_DATA);
//// Helpers
// Converts input bitmap(s) into 8bit representation with custom palette
// in_rows and out_rows are arrays [0..h-1] of pointer to rows
// (in_rows contains w * 3 bytes per row, out_rows w bytes per row)
// fills out_rows with indexes into palette (which is also stored into palette variable)
static void DoQuantize(unsigned w, unsigned h, unsigned char **in_rows, unsigned char **out_rows, unsigned char *palette, int desiredNoColours);
};
#endif
// _WX_QUANTIZE_H_
| h |
rticonnextdds-usecases | data/projects/rticonnextdds-usecases/VehicleTracking/ExampleCode/thirdparty/wxWidgets-3.1.2/Win32/include/wx/dlimpexp.h | /*
* Name: wx/dlimpexp.h
* Purpose: Macros for declaring DLL-imported/exported functions
* Author: Vadim Zeitlin
* Modified by:
* Created: 16.10.2003 (extracted from wx/defs.h)
* Copyright: (c) 2003 Vadim Zeitlin <[email protected]>
* Licence: wxWindows licence
*/
/*
This is a C file, not C++ one, do not use C++ comments here!
*/
#ifndef _WX_DLIMPEXP_H_
#define _WX_DLIMPEXP_H_
#if defined(HAVE_VISIBILITY)
# define WXEXPORT __attribute__ ((visibility("default")))
# define WXIMPORT __attribute__ ((visibility("default")))
#elif defined(__WINDOWS__)
/*
__declspec works in BC++ 5 and later as well as VC++.
*/
# if defined(__VISUALC__) || defined(__BORLANDC__)
# define WXEXPORT __declspec(dllexport)
# define WXIMPORT __declspec(dllimport)
/*
While gcc also supports __declspec(dllexport), it created unusably huge
DLL files in gcc 4.[56] (while taking horribly long amounts of time),
see http://gcc.gnu.org/bugzilla/show_bug.cgi?id=43601. Because of this
we rely on binutils auto export/import support which seems to work
quite well for 4.5+. However the problem was fixed in 4.7 and later and
not exporting everything creates smaller DLLs (~8% size difference), so
do use the explicit attributes again for the newer versions.
*/
# elif defined(__GNUC__) && \
(!wxCHECK_GCC_VERSION(4, 5) || wxCHECK_GCC_VERSION(4, 7))
/*
__declspec could be used here too but let's use the native
__attribute__ instead for clarity.
*/
# define WXEXPORT __attribute__((dllexport))
# define WXIMPORT __attribute__((dllimport))
# endif
#elif defined(__CYGWIN__)
# define WXEXPORT __declspec(dllexport)
# define WXIMPORT __declspec(dllimport)
#endif
/* for other platforms/compilers we don't anything */
#ifndef WXEXPORT
# define WXEXPORT
# define WXIMPORT
#endif
/*
We support building wxWidgets as a set of several libraries but we don't
support arbitrary combinations of libs/DLLs: either we build all of them as
DLLs (in which case WXMAKINGDLL is defined) or none (it isn't).
However we have a problem because we need separate WXDLLIMPEXP versions for
different libraries as, for example, wxString class should be dllexported
when compiled in wxBase and dllimported otherwise, so we do define separate
WXMAKING/USINGDLL_XYZ constants for each component XYZ.
*/
#ifdef WXMAKINGDLL
# if wxUSE_BASE
# define WXMAKINGDLL_BASE
# endif
# define WXMAKINGDLL_NET
# define WXMAKINGDLL_CORE
# define WXMAKINGDLL_ADV
# define WXMAKINGDLL_QA
# define WXMAKINGDLL_HTML
# define WXMAKINGDLL_GL
# define WXMAKINGDLL_XML
# define WXMAKINGDLL_XRC
# define WXMAKINGDLL_AUI
# define WXMAKINGDLL_PROPGRID
# define WXMAKINGDLL_RIBBON
# define WXMAKINGDLL_RICHTEXT
# define WXMAKINGDLL_MEDIA
# define WXMAKINGDLL_STC
# define WXMAKINGDLL_WEBVIEW
#endif /* WXMAKINGDLL */
/*
WXDLLIMPEXP_CORE maps to export declaration when building the DLL, to import
declaration if using it or to nothing at all if we don't use wxWin as DLL
*/
#ifdef WXMAKINGDLL_BASE
# define WXDLLIMPEXP_BASE WXEXPORT
# define WXDLLIMPEXP_DATA_BASE(type) WXEXPORT type
# if defined(HAVE_VISIBILITY)
# define WXDLLIMPEXP_INLINE_BASE WXEXPORT
# else
# define WXDLLIMPEXP_INLINE_BASE
# endif
#elif defined(WXUSINGDLL)
# define WXDLLIMPEXP_BASE WXIMPORT
# define WXDLLIMPEXP_DATA_BASE(type) WXIMPORT type
# if defined(HAVE_VISIBILITY)
# define WXDLLIMPEXP_INLINE_BASE WXIMPORT
# else
# define WXDLLIMPEXP_INLINE_BASE
# endif
#else /* not making nor using DLL */
# define WXDLLIMPEXP_BASE
# define WXDLLIMPEXP_DATA_BASE(type) type
# define WXDLLIMPEXP_INLINE_BASE
#endif
#ifdef WXMAKINGDLL_NET
# define WXDLLIMPEXP_NET WXEXPORT
# define WXDLLIMPEXP_DATA_NET(type) WXEXPORT type
#elif defined(WXUSINGDLL)
# define WXDLLIMPEXP_NET WXIMPORT
# define WXDLLIMPEXP_DATA_NET(type) WXIMPORT type
#else /* not making nor using DLL */
# define WXDLLIMPEXP_NET
# define WXDLLIMPEXP_DATA_NET(type) type
#endif
#ifdef WXMAKINGDLL_CORE
# define WXDLLIMPEXP_CORE WXEXPORT
# define WXDLLIMPEXP_DATA_CORE(type) WXEXPORT type
# if defined(HAVE_VISIBILITY)
# define WXDLLIMPEXP_INLINE_CORE WXEXPORT
# else
# define WXDLLIMPEXP_INLINE_CORE
# endif
#elif defined(WXUSINGDLL)
# define WXDLLIMPEXP_CORE WXIMPORT
# define WXDLLIMPEXP_DATA_CORE(type) WXIMPORT type
# if defined(HAVE_VISIBILITY)
# define WXDLLIMPEXP_INLINE_CORE WXIMPORT
# else
# define WXDLLIMPEXP_INLINE_CORE
# endif
#else /* not making nor using DLL */
# define WXDLLIMPEXP_CORE
# define WXDLLIMPEXP_DATA_CORE(type) type
# define WXDLLIMPEXP_INLINE_CORE
#endif
/* Advanced library doesn't exist any longer, but its macros are preserved for
compatibility. Do not use them in the new code. */
#define WXDLLIMPEXP_ADV WXDLLIMPEXP_CORE
#define WXDLLIMPEXP_DATA_ADV(type) WXDLLIMPEXP_DATA_CORE(type)
#ifdef WXMAKINGDLL_QA
# define WXDLLIMPEXP_QA WXEXPORT
# define WXDLLIMPEXP_DATA_QA(type) WXEXPORT type
#elif defined(WXUSINGDLL)
# define WXDLLIMPEXP_QA WXIMPORT
# define WXDLLIMPEXP_DATA_QA(type) WXIMPORT type
#else /* not making nor using DLL */
# define WXDLLIMPEXP_QA
# define WXDLLIMPEXP_DATA_QA(type) type
#endif
#ifdef WXMAKINGDLL_HTML
# define WXDLLIMPEXP_HTML WXEXPORT
# define WXDLLIMPEXP_DATA_HTML(type) WXEXPORT type
#elif defined(WXUSINGDLL)
# define WXDLLIMPEXP_HTML WXIMPORT
# define WXDLLIMPEXP_DATA_HTML(type) WXIMPORT type
#else /* not making nor using DLL */
# define WXDLLIMPEXP_HTML
# define WXDLLIMPEXP_DATA_HTML(type) type
#endif
#ifdef WXMAKINGDLL_GL
# define WXDLLIMPEXP_GL WXEXPORT
#elif defined(WXUSINGDLL)
# define WXDLLIMPEXP_GL WXIMPORT
#else /* not making nor using DLL */
# define WXDLLIMPEXP_GL
#endif
#ifdef WXMAKINGDLL_XML
# define WXDLLIMPEXP_XML WXEXPORT
#elif defined(WXUSINGDLL)
# define WXDLLIMPEXP_XML WXIMPORT
#else /* not making nor using DLL */
# define WXDLLIMPEXP_XML
#endif
#ifdef WXMAKINGDLL_XRC
# define WXDLLIMPEXP_XRC WXEXPORT
#elif defined(WXUSINGDLL)
# define WXDLLIMPEXP_XRC WXIMPORT
#else /* not making nor using DLL */
# define WXDLLIMPEXP_XRC
#endif
#ifdef WXMAKINGDLL_AUI
# define WXDLLIMPEXP_AUI WXEXPORT
#elif defined(WXUSINGDLL)
# define WXDLLIMPEXP_AUI WXIMPORT
#else /* not making nor using DLL */
# define WXDLLIMPEXP_AUI
#endif
#ifdef WXMAKINGDLL_PROPGRID
# define WXDLLIMPEXP_PROPGRID WXEXPORT
# define WXDLLIMPEXP_DATA_PROPGRID(type) WXEXPORT type
#elif defined(WXUSINGDLL)
# define WXDLLIMPEXP_PROPGRID WXIMPORT
# define WXDLLIMPEXP_DATA_PROPGRID(type) WXIMPORT type
#else /* not making nor using DLL */
# define WXDLLIMPEXP_PROPGRID
# define WXDLLIMPEXP_DATA_PROPGRID(type) type
#endif
#ifdef WXMAKINGDLL_RIBBON
# define WXDLLIMPEXP_RIBBON WXEXPORT
#elif defined(WXUSINGDLL)
# define WXDLLIMPEXP_RIBBON WXIMPORT
#else /* not making nor using DLL */
# define WXDLLIMPEXP_RIBBON
#endif
#ifdef WXMAKINGDLL_RICHTEXT
# define WXDLLIMPEXP_RICHTEXT WXEXPORT
#elif defined(WXUSINGDLL)
# define WXDLLIMPEXP_RICHTEXT WXIMPORT
#else /* not making nor using DLL */
# define WXDLLIMPEXP_RICHTEXT
#endif
#ifdef WXMAKINGDLL_MEDIA
# define WXDLLIMPEXP_MEDIA WXEXPORT
#elif defined(WXUSINGDLL)
# define WXDLLIMPEXP_MEDIA WXIMPORT
#else /* not making nor using DLL */
# define WXDLLIMPEXP_MEDIA
#endif
#ifdef WXMAKINGDLL_STC
# define WXDLLIMPEXP_STC WXEXPORT
# define WXDLLIMPEXP_DATA_STC(type) WXEXPORT type
#elif defined(WXUSINGDLL)
# define WXDLLIMPEXP_STC WXIMPORT
# define WXDLLIMPEXP_DATA_STC(type) WXIMPORT type
#else /* not making nor using DLL */
# define WXDLLIMPEXP_STC
# define WXDLLIMPEXP_DATA_STC(type) type
#endif
#ifdef WXMAKINGDLL_WEBVIEW
# define WXDLLIMPEXP_WEBVIEW WXEXPORT
# define WXDLLIMPEXP_DATA_WEBVIEW(type) WXEXPORT type
#elif defined(WXUSINGDLL)
# define WXDLLIMPEXP_WEBVIEW WXIMPORT
# define WXDLLIMPEXP_DATA_WEBVIEW(type) WXIMPORT type
#else /* not making nor using DLL */
# define WXDLLIMPEXP_WEBVIEW
# define WXDLLIMPEXP_DATA_WEBVIEW(type) type
#endif
/*
GCC warns about using __attribute__ (and also __declspec in mingw32 case) on
forward declarations while MSVC complains about forward declarations without
__declspec for the classes later declared with it, so we need a separate set
of macros for forward declarations to hide this difference:
*/
#if defined(HAVE_VISIBILITY) || (defined(__WINDOWS__) && defined(__GNUC__))
#define WXDLLIMPEXP_FWD_BASE
#define WXDLLIMPEXP_FWD_NET
#define WXDLLIMPEXP_FWD_CORE
#define WXDLLIMPEXP_FWD_QA
#define WXDLLIMPEXP_FWD_HTML
#define WXDLLIMPEXP_FWD_GL
#define WXDLLIMPEXP_FWD_XML
#define WXDLLIMPEXP_FWD_XRC
#define WXDLLIMPEXP_FWD_AUI
#define WXDLLIMPEXP_FWD_PROPGRID
#define WXDLLIMPEXP_FWD_RIBBON
#define WXDLLIMPEXP_FWD_RICHTEXT
#define WXDLLIMPEXP_FWD_MEDIA
#define WXDLLIMPEXP_FWD_STC
#define WXDLLIMPEXP_FWD_WEBVIEW
#else
#define WXDLLIMPEXP_FWD_BASE WXDLLIMPEXP_BASE
#define WXDLLIMPEXP_FWD_NET WXDLLIMPEXP_NET
#define WXDLLIMPEXP_FWD_CORE WXDLLIMPEXP_CORE
#define WXDLLIMPEXP_FWD_QA WXDLLIMPEXP_QA
#define WXDLLIMPEXP_FWD_HTML WXDLLIMPEXP_HTML
#define WXDLLIMPEXP_FWD_GL WXDLLIMPEXP_GL
#define WXDLLIMPEXP_FWD_XML WXDLLIMPEXP_XML
#define WXDLLIMPEXP_FWD_XRC WXDLLIMPEXP_XRC
#define WXDLLIMPEXP_FWD_AUI WXDLLIMPEXP_AUI
#define WXDLLIMPEXP_FWD_PROPGRID WXDLLIMPEXP_PROPGRID
#define WXDLLIMPEXP_FWD_RIBBON WXDLLIMPEXP_RIBBON
#define WXDLLIMPEXP_FWD_RICHTEXT WXDLLIMPEXP_RICHTEXT
#define WXDLLIMPEXP_FWD_MEDIA WXDLLIMPEXP_MEDIA
#define WXDLLIMPEXP_FWD_STC WXDLLIMPEXP_STC
#define WXDLLIMPEXP_FWD_WEBVIEW WXDLLIMPEXP_WEBVIEW
#endif
/* This macro continues to exist for backwards compatibility only. */
#define WXDLLIMPEXP_FWD_ADV WXDLLIMPEXP_FWD_CORE
/* for backwards compatibility, define suffix-less versions too */
#define WXDLLEXPORT WXDLLIMPEXP_CORE
#define WXDLLEXPORT_DATA WXDLLIMPEXP_DATA_CORE
#endif /* _WX_DLIMPEXP_H_ */
| h |
rticonnextdds-usecases | data/projects/rticonnextdds-usecases/VehicleTracking/ExampleCode/thirdparty/wxWidgets-3.1.2/Win32/include/wx/stack.h | ///////////////////////////////////////////////////////////////////////////////
// Name: wx/stack.h
// Purpose: STL stack clone
// Author: Lindsay Mathieson, Vadim Zeitlin
// Created: 30.07.2001
// Copyright: (c) 2001 Lindsay Mathieson <[email protected]> (WX_DECLARE_STACK)
// 2011 Vadim Zeitlin <[email protected]>
// Licence: wxWindows licence
///////////////////////////////////////////////////////////////////////////////
#ifndef _WX_STACK_H_
#define _WX_STACK_H_
#include "wx/vector.h"
#if wxUSE_STD_CONTAINERS
#include <stack>
#define wxStack std::stack
#else // !wxUSE_STD_CONTAINERS
// Notice that unlike std::stack, wxStack currently always uses wxVector and
// can't be used with any other underlying container type.
//
// Another difference is that comparison operators between stacks are not
// implemented (but they should be, see 23.2.3.3 of ISO/IEC 14882:1998).
template <typename T>
class wxStack
{
public:
typedef wxVector<T> container_type;
typedef typename container_type::size_type size_type;
typedef typename container_type::value_type value_type;
wxStack() { }
explicit wxStack(const container_type& cont) : m_cont(cont) { }
// Default copy ctor, assignment operator and dtor are ok.
bool empty() const { return m_cont.empty(); }
size_type size() const { return m_cont.size(); }
value_type& top() { return m_cont.back(); }
const value_type& top() const { return m_cont.back(); }
void push(const value_type& val) { m_cont.push_back(val); }
void pop() { m_cont.pop_back(); }
private:
container_type m_cont;
};
#endif // wxUSE_STD_CONTAINERS/!wxUSE_STD_CONTAINERS
// Deprecated macro-based class for compatibility only, don't use any more.
#define WX_DECLARE_STACK(obj, cls) \
class cls : public wxVector<obj> \
{\
public:\
void push(const obj& o)\
{\
push_back(o); \
};\
\
void pop()\
{\
pop_back(); \
};\
\
obj& top()\
{\
return at(size() - 1);\
};\
const obj& top() const\
{\
return at(size() - 1); \
};\
}
#endif // _WX_STACK_H_
| h |
rticonnextdds-usecases | data/projects/rticonnextdds-usecases/VehicleTracking/ExampleCode/thirdparty/wxWidgets-3.1.2/Win32/include/wx/ctrlsub.h | /////////////////////////////////////////////////////////////////////////////
// Name: wx/ctrlsub.h (read: "wxConTRoL with SUBitems")
// Purpose: wxControlWithItems interface
// Author: Vadim Zeitlin
// Modified by:
// Created: 22.10.99
// Copyright: (c) wxWidgets team
// Licence: wxWindows licence
/////////////////////////////////////////////////////////////////////////////
#ifndef _WX_CTRLSUB_H_BASE_
#define _WX_CTRLSUB_H_BASE_
#include "wx/defs.h"
#if wxUSE_CONTROLS
#include "wx/arrstr.h"
#include "wx/control.h" // base class
#if wxUSE_STD_CONTAINERS_COMPATIBLY
#include <vector>
#endif // wxUSE_STD_CONTAINERS_COMPATIBLY
// ----------------------------------------------------------------------------
// wxItemContainer defines an interface which is implemented by all controls
// which have string subitems each of which may be selected.
//
// It is decomposed in wxItemContainerImmutable which omits all methods
// adding/removing items and is used by wxRadioBox and wxItemContainer itself.
//
// Examples: wxListBox, wxCheckListBox, wxChoice and wxComboBox (which
// implements an extended interface deriving from this one)
// ----------------------------------------------------------------------------
class WXDLLIMPEXP_CORE wxItemContainerImmutable
{
public:
wxItemContainerImmutable() { }
virtual ~wxItemContainerImmutable();
// accessing strings
// -----------------
virtual unsigned int GetCount() const = 0;
bool IsEmpty() const { return GetCount() == 0; }
virtual wxString GetString(unsigned int n) const = 0;
wxArrayString GetStrings() const;
virtual void SetString(unsigned int n, const wxString& s) = 0;
// finding string natively is either case sensitive or insensitive
// but never both so fall back to this base version for not
// supported search type
virtual int FindString(const wxString& s, bool bCase = false) const
{
unsigned int count = GetCount();
for ( unsigned int i = 0; i < count ; ++i )
{
if (GetString(i).IsSameAs( s , bCase ))
return (int)i;
}
return wxNOT_FOUND;
}
// selection
// ---------
virtual void SetSelection(int n) = 0;
virtual int GetSelection() const = 0;
// set selection to the specified string, return false if not found
bool SetStringSelection(const wxString& s);
// return the selected string or empty string if none
virtual wxString GetStringSelection() const;
// this is the same as SetSelection( for single-selection controls but
// reads better for multi-selection ones
void Select(int n) { SetSelection(n); }
protected:
// check that the index is valid
bool IsValid(unsigned int n) const { return n < GetCount(); }
bool IsValidInsert(unsigned int n) const { return n <= GetCount(); }
};
// ----------------------------------------------------------------------------
// wxItemContainer extends wxItemContainerImmutable interface with methods
// for adding/removing items.
//
// Classes deriving from this one must override DoInsertItems() to implement
// adding items to the control. This can often be implemented more efficiently
// than simply looping over the elements and inserting them but if this is not
// the case, the generic DoInsertItemsInLoop can be used in implementation, but
// in this case DoInsertItem() needs to be overridden.
// ----------------------------------------------------------------------------
class WXDLLIMPEXP_CORE wxItemContainer : public wxItemContainerImmutable
{
private:
// AppendItems() and InsertItems() helpers just call DoAppend/InsertItems()
// after doing some checks
//
// NB: they're defined here so that they're inlined when used in public part
int AppendItems(const wxArrayStringsAdapter& items,
void **clientData,
wxClientDataType type)
{
if ( items.IsEmpty() )
return wxNOT_FOUND;
return DoAppendItems(items, clientData, type);
}
int AppendItems(const wxArrayStringsAdapter& items)
{
return AppendItems(items, NULL, wxClientData_None);
}
int AppendItems(const wxArrayStringsAdapter& items, void **clientData)
{
wxASSERT_MSG( GetClientDataType() != wxClientData_Object,
wxT("can't mix different types of client data") );
return AppendItems(items, clientData, wxClientData_Void);
}
int AppendItems(const wxArrayStringsAdapter& items,
wxClientData **clientData)
{
wxASSERT_MSG( GetClientDataType() != wxClientData_Void,
wxT("can't mix different types of client data") );
return AppendItems(items, reinterpret_cast<void **>(clientData),
wxClientData_Object);
}
int InsertItems(const wxArrayStringsAdapter& items,
unsigned int pos,
void **clientData,
wxClientDataType type)
{
wxASSERT_MSG( !IsSorted(), wxT("can't insert items in sorted control") );
wxCHECK_MSG( pos <= GetCount(), wxNOT_FOUND,
wxT("position out of range") );
// not all derived classes handle empty arrays correctly in
// DoInsertItems() and besides it really doesn't make much sense to do
// this (for append it could correspond to creating an initially empty
// control but why would anybody need to insert 0 items?)
wxCHECK_MSG( !items.IsEmpty(), wxNOT_FOUND,
wxT("need something to insert") );
return DoInsertItems(items, pos, clientData, type);
}
int InsertItems(const wxArrayStringsAdapter& items, unsigned int pos)
{
return InsertItems(items, pos, NULL, wxClientData_None);
}
int InsertItems(const wxArrayStringsAdapter& items,
unsigned int pos,
void **clientData)
{
wxASSERT_MSG( GetClientDataType() != wxClientData_Object,
wxT("can't mix different types of client data") );
return InsertItems(items, pos, clientData, wxClientData_Void);
}
int InsertItems(const wxArrayStringsAdapter& items,
unsigned int pos,
wxClientData **clientData)
{
wxASSERT_MSG( GetClientDataType() != wxClientData_Void,
wxT("can't mix different types of client data") );
return InsertItems(items, pos,
reinterpret_cast<void **>(clientData),
wxClientData_Object);
}
public:
wxItemContainer() { m_clientDataItemsType = wxClientData_None; }
virtual ~wxItemContainer();
// adding items
// ------------
// append single item, return its position in the control (which can be
// different from the last one if the control is sorted)
int Append(const wxString& item)
{ return AppendItems(item); }
int Append(const wxString& item, void *clientData)
{ return AppendItems(item, &clientData); }
int Append(const wxString& item, wxClientData *clientData)
{ return AppendItems(item, &clientData); }
// append several items at once to the control, return the position of the
// last item appended
int Append(const wxArrayString& items)
{ return AppendItems(items); }
int Append(const wxArrayString& items, void **clientData)
{ return AppendItems(items, clientData); }
int Append(const wxArrayString& items, wxClientData **clientData)
{ return AppendItems(items, clientData); }
int Append(unsigned int n, const wxString *items)
{ return AppendItems(wxArrayStringsAdapter(n, items)); }
int Append(unsigned int n, const wxString *items, void **clientData)
{ return AppendItems(wxArrayStringsAdapter(n, items), clientData); }
int Append(unsigned int n,
const wxString *items,
wxClientData **clientData)
{ return AppendItems(wxArrayStringsAdapter(n, items), clientData); }
#if wxUSE_STD_CONTAINERS_COMPATIBLY
int Append(const std::vector<wxString>& items)
{ return AppendItems(items); }
#endif // wxUSE_STD_CONTAINERS_COMPATIBLY
// only for RTTI needs (separate name)
void AppendString(const wxString& item)
{ Append(item); }
// inserting items: not for sorted controls!
// -----------------------------------------
// insert single item at the given position, return its effective position
int Insert(const wxString& item, unsigned int pos)
{ return InsertItems(item, pos); }
int Insert(const wxString& item, unsigned int pos, void *clientData)
{ return InsertItems(item, pos, &clientData); }
int Insert(const wxString& item, unsigned int pos, wxClientData *clientData)
{ return InsertItems(item, pos, &clientData); }
// insert several items at once into the control, return the index of the
// last item inserted
int Insert(const wxArrayString& items, unsigned int pos)
{ return InsertItems(items, pos); }
int Insert(const wxArrayString& items, unsigned int pos, void **clientData)
{ return InsertItems(items, pos, clientData); }
int Insert(const wxArrayString& items,
unsigned int pos,
wxClientData **clientData)
{ return InsertItems(items, pos, clientData); }
int Insert(unsigned int n, const wxString *items, unsigned int pos)
{ return InsertItems(wxArrayStringsAdapter(n, items), pos); }
int Insert(unsigned int n,
const wxString *items,
unsigned int pos,
void **clientData)
{ return InsertItems(wxArrayStringsAdapter(n, items), pos, clientData); }
int Insert(unsigned int n,
const wxString *items,
unsigned int pos,
wxClientData **clientData)
{ return InsertItems(wxArrayStringsAdapter(n, items), pos, clientData); }
#if wxUSE_STD_CONTAINERS_COMPATIBLY
int Insert(const std::vector<wxString>& items, unsigned int pos)
{ return InsertItems(items, pos); }
#endif // wxUSE_STD_CONTAINERS_COMPATIBLY
// replacing items
// ---------------
void Set(const wxArrayString& items)
{ Clear(); Append(items); }
void Set(const wxArrayString& items, void **clientData)
{ Clear(); Append(items, clientData); }
void Set(const wxArrayString& items, wxClientData **clientData)
{ Clear(); Append(items, clientData); }
void Set(unsigned int n, const wxString *items)
{ Clear(); Append(n, items); }
void Set(unsigned int n, const wxString *items, void **clientData)
{ Clear(); Append(n, items, clientData); }
void Set(unsigned int n, const wxString *items, wxClientData **clientData)
{ Clear(); Append(n, items, clientData); }
#if wxUSE_STD_CONTAINERS_COMPATIBLY
void Set(const std::vector<wxString>& items)
{ Clear(); Append(items); }
#endif // wxUSE_STD_CONTAINERS_COMPATIBLY
// deleting items
// --------------
virtual void Clear();
void Delete(unsigned int pos);
// various accessors
// -----------------
// The control may maintain its items in a sorted order in which case
// items are automatically inserted at the right position when they are
// inserted or appended. Derived classes have to override this method if
// they implement sorting, typically by returning HasFlag(wxXX_SORT)
virtual bool IsSorted() const { return false; }
// client data stuff
// -----------------
void SetClientData(unsigned int n, void* clientData);
void* GetClientData(unsigned int n) const;
// SetClientObject() takes ownership of the pointer, GetClientObject()
// returns it but keeps the ownership while DetachClientObject() expects
// the caller to delete the pointer and also resets the internally stored
// one to NULL for this item
void SetClientObject(unsigned int n, wxClientData* clientData);
wxClientData* GetClientObject(unsigned int n) const;
wxClientData* DetachClientObject(unsigned int n);
// return the type of client data stored in this control: usually it just
// returns m_clientDataItemsType but must be overridden in the controls
// which delegate their client data storage to another one (e.g. wxChoice
// in wxUniv which stores data in wxListBox which it uses anyhow); don't
// forget to override SetClientDataType() if you override this one
//
// NB: for this to work no code should ever access m_clientDataItemsType
// directly but only via this function!
virtual wxClientDataType GetClientDataType() const
{ return m_clientDataItemsType; }
bool HasClientData() const
{ return GetClientDataType() != wxClientData_None; }
bool HasClientObjectData() const
{ return GetClientDataType() == wxClientData_Object; }
bool HasClientUntypedData() const
{ return GetClientDataType() == wxClientData_Void; }
protected:
// there is usually no need to override this method but you can do it if it
// is more convenient to only do "real" insertions in DoInsertItems() and
// to implement items appending here (in which case DoInsertItems() should
// call this method if pos == GetCount() as it can still be called in this
// case if public Insert() is called with such position)
virtual int DoAppendItems(const wxArrayStringsAdapter& items,
void **clientData,
wxClientDataType type)
{
return DoInsertItems(items, GetCount(), clientData, type);
}
// this method must be implemented to insert the items into the control at
// position pos which can be GetCount() meaning that the items should be
// appended; for the sorted controls the position can be ignored
//
// the derived classes typically use AssignNewItemClientData() to
// associate the data with the items as they're being inserted
//
// the method should return the index of the position the last item was
// inserted into or wxNOT_FOUND if an error occurred
virtual int DoInsertItems(const wxArrayStringsAdapter & items,
unsigned int pos,
void **clientData,
wxClientDataType type) = 0;
// before the client data is set for the first time for the control which
// hadn't had it before, DoInitItemClientData() is called which gives the
// derived class the possibility to initialize its client data storage only
// when client data is really used
virtual void DoInitItemClientData() { }
virtual void DoSetItemClientData(unsigned int n, void *clientData) = 0;
virtual void *DoGetItemClientData(unsigned int n) const = 0;
virtual void DoClear() = 0;
virtual void DoDeleteOneItem(unsigned int pos) = 0;
// methods useful for the derived classes which don't have any better way
// of adding multiple items to the control than doing it one by one: such
// classes should call DoInsertItemsInLoop() from their DoInsert() and
// override DoInsertOneItem() to perform the real insertion
virtual int DoInsertOneItem(const wxString& item, unsigned int pos);
int DoInsertItemsInLoop(const wxArrayStringsAdapter& items,
unsigned int pos,
void **clientData,
wxClientDataType type);
// helper for DoInsertItems(): n is the index into clientData, pos is the
// position of the item in the control
void AssignNewItemClientData(unsigned int pos,
void **clientData,
unsigned int n,
wxClientDataType type);
// free the client object associated with the item at given position and
// set it to NULL (must only be called if HasClientObjectData())
void ResetItemClientObject(unsigned int n);
// set the type of the client data stored in this control: override this if
// you override GetClientDataType()
virtual void SetClientDataType(wxClientDataType clientDataItemsType)
{
m_clientDataItemsType = clientDataItemsType;
}
private:
// the type of the client data for the items
wxClientDataType m_clientDataItemsType;
};
// Inheriting directly from a wxWindow-derived class and wxItemContainer
// unfortunately introduces an ambiguity for all GetClientXXX() methods as they
// are inherited twice: the "global" versions from wxWindow and the per-item
// versions taking the index from wxItemContainer.
//
// So we need to explicitly resolve them and this helper template class is
// provided to do it. To use it, simply inherit from wxWindowWithItems<Window,
// Container> instead of Window and Container interface directly.
template <class W, class C>
class wxWindowWithItems : public W, public C
{
public:
typedef W BaseWindowClass;
typedef C BaseContainerInterface;
wxWindowWithItems() { }
void SetClientData(void *data)
{ BaseWindowClass::SetClientData(data); }
void *GetClientData() const
{ return BaseWindowClass::GetClientData(); }
void SetClientObject(wxClientData *data)
{ BaseWindowClass::SetClientObject(data); }
wxClientData *GetClientObject() const
{ return BaseWindowClass::GetClientObject(); }
void SetClientData(unsigned int n, void* clientData)
{ wxItemContainer::SetClientData(n, clientData); }
void* GetClientData(unsigned int n) const
{ return wxItemContainer::GetClientData(n); }
void SetClientObject(unsigned int n, wxClientData* clientData)
{ wxItemContainer::SetClientObject(n, clientData); }
wxClientData* GetClientObject(unsigned int n) const
{ return wxItemContainer::GetClientObject(n); }
};
class WXDLLIMPEXP_CORE wxControlWithItemsBase :
public wxWindowWithItems<wxControl, wxItemContainer>
{
public:
wxControlWithItemsBase() { }
// usually the controls like list/combo boxes have their own background
// colour
virtual bool ShouldInheritColours() const wxOVERRIDE { return false; }
// Implementation only from now on.
// Generate an event of the given type for the selection change.
void SendSelectionChangedEvent(wxEventType eventType);
protected:
// fill in the client object or data field of the event as appropriate
//
// calls InitCommandEvent() and, if n != wxNOT_FOUND, also sets the per
// item client data
void InitCommandEventWithItems(wxCommandEvent& event, int n);
private:
wxDECLARE_NO_COPY_CLASS(wxControlWithItemsBase);
};
// define the platform-specific wxControlWithItems class
#if defined(__WXMSW__)
#include "wx/msw/ctrlsub.h"
#elif defined(__WXMOTIF__)
#include "wx/motif/ctrlsub.h"
#elif defined(__WXQT__)
#include "wx/qt/ctrlsub.h"
#else
class WXDLLIMPEXP_CORE wxControlWithItems : public wxControlWithItemsBase
{
public:
wxControlWithItems() { }
private:
wxDECLARE_ABSTRACT_CLASS(wxControlWithItems);
wxDECLARE_NO_COPY_CLASS(wxControlWithItems);
};
#endif
#endif // wxUSE_CONTROLS
#endif // _WX_CTRLSUB_H_BASE_
| h |
rticonnextdds-usecases | data/projects/rticonnextdds-usecases/VehicleTracking/ExampleCode/thirdparty/wxWidgets-3.1.2/Win32/include/wx/commandlinkbutton.h | /////////////////////////////////////////////////////////////////////////////
// Name: wx/commandlinkbutton.h
// Purpose: wxCommandLinkButtonBase and wxGenericCommandLinkButton classes
// Author: Rickard Westerlund
// Created: 2010-06-11
// Copyright: (c) 2010 wxWidgets team
// Licence: wxWindows licence
/////////////////////////////////////////////////////////////////////////////
#ifndef _WX_COMMANDLINKBUTTON_H_
#define _WX_COMMANDLINKBUTTON_H_
#include "wx/defs.h"
#if wxUSE_COMMANDLINKBUTTON
#include "wx/button.h"
// ----------------------------------------------------------------------------
// Command link button common base class
// ----------------------------------------------------------------------------
// This class has separate "main label" (title-like string) and (possibly
// multiline) "note" which can be set and queried separately but can also be
// set both at once by joining them with a new line and setting them as a
// label and queried by breaking the label into the parts before the first new
// line and after it.
class WXDLLIMPEXP_ADV wxCommandLinkButtonBase : public wxButton
{
public:
wxCommandLinkButtonBase() : wxButton() { }
wxCommandLinkButtonBase(wxWindow *parent,
wxWindowID id,
const wxString& mainLabel = wxEmptyString,
const wxString& note = wxEmptyString,
const wxPoint& pos = wxDefaultPosition,
const wxSize& size = wxDefaultSize,
long style = 0,
const wxValidator& validator =
wxDefaultValidator,
const wxString& name = wxButtonNameStr)
: wxButton(parent,
id,
mainLabel + '\n' + note,
pos,
size,
style,
validator,
name)
{ }
virtual void SetMainLabelAndNote(const wxString& mainLabel,
const wxString& note) = 0;
virtual void SetMainLabel(const wxString& mainLabel)
{
SetMainLabelAndNote(mainLabel, GetNote());
}
virtual void SetNote(const wxString& note)
{
SetMainLabelAndNote(GetMainLabel(), note);
}
virtual wxString GetMainLabel() const
{
return GetLabel().BeforeFirst('\n');
}
virtual wxString GetNote() const
{
return GetLabel().AfterFirst('\n');
}
protected:
virtual bool HasNativeBitmap() const { return false; }
private:
wxDECLARE_NO_COPY_CLASS(wxCommandLinkButtonBase);
};
// ----------------------------------------------------------------------------
// Generic command link button
// ----------------------------------------------------------------------------
// Trivial generic implementation simply using a multiline label to show both
// the main label and the note.
class WXDLLIMPEXP_ADV wxGenericCommandLinkButton
: public wxCommandLinkButtonBase
{
public:
wxGenericCommandLinkButton() : wxCommandLinkButtonBase() { }
wxGenericCommandLinkButton(wxWindow *parent,
wxWindowID id,
const wxString& mainLabel = wxEmptyString,
const wxString& note = wxEmptyString,
const wxPoint& pos = wxDefaultPosition,
const wxSize& size = wxDefaultSize,
long style = 0,
const wxValidator& validator = wxDefaultValidator,
const wxString& name = wxButtonNameStr)
: wxCommandLinkButtonBase()
{
Create(parent, id, mainLabel, note, pos, size, style, validator, name);
}
bool Create(wxWindow *parent,
wxWindowID id,
const wxString& mainLabel = wxEmptyString,
const wxString& note = wxEmptyString,
const wxPoint& pos = wxDefaultPosition,
const wxSize& size = wxDefaultSize,
long style = 0,
const wxValidator& validator = wxDefaultValidator,
const wxString& name = wxButtonNameStr);
virtual void SetMainLabelAndNote(const wxString& mainLabel,
const wxString& note) wxOVERRIDE
{
wxButton::SetLabel(mainLabel + '\n' + note);
}
private:
void SetDefaultBitmap();
wxDECLARE_NO_COPY_CLASS(wxGenericCommandLinkButton);
};
#if defined(__WXMSW__) && !defined(__WXUNIVERSAL__)
#include "wx/msw/commandlinkbutton.h"
#else
class WXDLLIMPEXP_ADV wxCommandLinkButton : public wxGenericCommandLinkButton
{
public:
wxCommandLinkButton() : wxGenericCommandLinkButton() { }
wxCommandLinkButton(wxWindow *parent,
wxWindowID id,
const wxString& mainLabel = wxEmptyString,
const wxString& note = wxEmptyString,
const wxPoint& pos = wxDefaultPosition,
const wxSize& size = wxDefaultSize,
long style = 0,
const wxValidator& validator = wxDefaultValidator,
const wxString& name = wxButtonNameStr)
: wxGenericCommandLinkButton(parent,
id,
mainLabel,
note,
pos,
size,
style,
validator,
name)
{ }
private:
wxDECLARE_DYNAMIC_CLASS_NO_COPY(wxCommandLinkButton);
};
#endif // __WXMSW__/!__WXMSW__
#endif // wxUSE_COMMANDLINKBUTTON
#endif // _WX_COMMANDLINKBUTTON_H_
| h |
rticonnextdds-usecases | data/projects/rticonnextdds-usecases/VehicleTracking/ExampleCode/thirdparty/wxWidgets-3.1.2/Win32/include/wx/filefn.h | /////////////////////////////////////////////////////////////////////////////
// Name: wx/filefn.h
// Purpose: File- and directory-related functions
// Author: Julian Smart
// Modified by:
// Created: 29/01/98
// Copyright: (c) 1998 Julian Smart
// Licence: wxWindows licence
/////////////////////////////////////////////////////////////////////////////
#ifndef _FILEFN_H_
#define _FILEFN_H_
#include "wx/list.h"
#include "wx/arrstr.h"
#include <time.h>
#include <sys/types.h>
#include <sys/stat.h>
#if defined(__UNIX__)
#include <unistd.h>
#include <dirent.h>
#endif
#if defined(__WINDOWS__)
#if !defined( __GNUWIN32__ ) && !defined(__CYGWIN__)
#include <direct.h>
#include <dos.h>
#include <io.h>
#endif // __WINDOWS__
#endif // native Win compiler
#ifdef __BORLANDC__ // Please someone tell me which version of Borland needs
// this (3.1 I believe) and how to test for it.
// If this works for Borland 4.0 as well, then no worries.
#include <dir.h>
#endif
#include <fcntl.h> // O_RDONLY &c
// ----------------------------------------------------------------------------
// constants
// ----------------------------------------------------------------------------
// MSVC doesn't define mode_t, so do it ourselves unless someone else
// had already predefined it.
#if defined(__VISUALC__) && !defined(wxHAS_MODE_T)
#define wxHAS_MODE_T
typedef int mode_t;
#endif
// define off_t
#include <sys/types.h>
#if defined(__VISUALC__)
typedef _off_t off_t;
#endif
enum wxSeekMode
{
wxFromStart,
wxFromCurrent,
wxFromEnd
};
enum wxFileKind
{
wxFILE_KIND_UNKNOWN,
wxFILE_KIND_DISK, // a file supporting seeking to arbitrary offsets
wxFILE_KIND_TERMINAL, // a tty
wxFILE_KIND_PIPE // a pipe
};
// we redefine these constants here because S_IREAD &c are _not_ standard
// however, we do assume that the values correspond to the Unix umask bits
enum wxPosixPermissions
{
// standard Posix names for these permission flags:
wxS_IRUSR = 00400,
wxS_IWUSR = 00200,
wxS_IXUSR = 00100,
wxS_IRGRP = 00040,
wxS_IWGRP = 00020,
wxS_IXGRP = 00010,
wxS_IROTH = 00004,
wxS_IWOTH = 00002,
wxS_IXOTH = 00001,
// longer but more readable synonyms for the constants above:
wxPOSIX_USER_READ = wxS_IRUSR,
wxPOSIX_USER_WRITE = wxS_IWUSR,
wxPOSIX_USER_EXECUTE = wxS_IXUSR,
wxPOSIX_GROUP_READ = wxS_IRGRP,
wxPOSIX_GROUP_WRITE = wxS_IWGRP,
wxPOSIX_GROUP_EXECUTE = wxS_IXGRP,
wxPOSIX_OTHERS_READ = wxS_IROTH,
wxPOSIX_OTHERS_WRITE = wxS_IWOTH,
wxPOSIX_OTHERS_EXECUTE = wxS_IXOTH,
// default mode for the new files: allow reading/writing them to everybody but
// the effective file mode will be set after anding this value with umask and
// so won't include wxS_IW{GRP,OTH} for the default 022 umask value
wxS_DEFAULT = (wxPOSIX_USER_READ | wxPOSIX_USER_WRITE | \
wxPOSIX_GROUP_READ | wxPOSIX_GROUP_WRITE | \
wxPOSIX_OTHERS_READ | wxPOSIX_OTHERS_WRITE),
// default mode for the new directories (see wxFileName::Mkdir): allow
// reading/writing/executing them to everybody, but just like wxS_DEFAULT
// the effective directory mode will be set after anding this value with umask
wxS_DIR_DEFAULT = (wxPOSIX_USER_READ | wxPOSIX_USER_WRITE | wxPOSIX_USER_EXECUTE | \
wxPOSIX_GROUP_READ | wxPOSIX_GROUP_WRITE | wxPOSIX_GROUP_EXECUTE | \
wxPOSIX_OTHERS_READ | wxPOSIX_OTHERS_WRITE | wxPOSIX_OTHERS_EXECUTE)
};
// ----------------------------------------------------------------------------
// declare our versions of low level file functions: some compilers prepend
// underscores to the usual names, some also have Unicode versions of them
// ----------------------------------------------------------------------------
#if defined(__WINDOWS__) && \
( \
defined(__VISUALC__) || \
defined(__MINGW64_TOOLCHAIN__) || \
(defined(__MINGW32__) && !defined(__WINE__)) || \
defined(__BORLANDC__) \
)
// temporary defines just used immediately below
#undef wxHAS_HUGE_FILES
#undef wxHAS_HUGE_STDIO_FILES
// detect compilers which have support for huge files
#if defined(__VISUALC__)
#define wxHAS_HUGE_FILES 1
#elif defined(__MINGW32__)
#define wxHAS_HUGE_FILES 1
#elif defined(_LARGE_FILES)
#define wxHAS_HUGE_FILES 1
#endif
// detect compilers which have support for huge stdio files
#if wxCHECK_VISUALC_VERSION(8)
#define wxHAS_HUGE_STDIO_FILES
#define wxFseek _fseeki64
#define wxFtell _ftelli64
#elif wxCHECK_MINGW32_VERSION(3, 5) // mingw-runtime version (not gcc)
#define wxHAS_HUGE_STDIO_FILES
wxDECL_FOR_STRICT_MINGW32(int, fseeko64, (FILE*, long long, int))
#define wxFseek fseeko64
#ifdef wxNEEDS_STRICT_ANSI_WORKAROUNDS
// Unfortunately ftello64() is not defined in the library for
// whatever reason but as an inline function, so define wxFtell()
// here similarly.
inline long long wxFtell(FILE* fp)
{
fpos_t pos;
return fgetpos(fp, &pos) == 0 ? pos : -1LL;
}
#else
#define wxFtell ftello64
#endif
#endif
// other Windows compilers (Borland) don't have huge file support (or at
// least not all functions needed for it by wx) currently
// types
#ifdef wxHAS_HUGE_FILES
typedef wxLongLong_t wxFileOffset;
#define wxFileOffsetFmtSpec wxLongLongFmtSpec
#else
typedef off_t wxFileOffset;
#endif
// at least Borland 5.5 doesn't like "struct ::stat" so don't use the scope
// resolution operator present in wxPOSIX_IDENT for it
#ifdef __BORLANDC__
#define wxPOSIX_STRUCT(s) struct s
#else
#define wxPOSIX_STRUCT(s) struct wxPOSIX_IDENT(s)
#endif
// Borland is special in that it uses _stat with Unicode functions (for
// MSVC compatibility?) but stat with ANSI ones
#ifdef __BORLANDC__
#if wxHAS_HUGE_FILES
#define wxStructStat struct stati64
#else
#if wxUSE_UNICODE
#define wxStructStat struct _stat
#else
#define wxStructStat struct stat
#endif
#endif
#else // !__BORLANDC__
#ifdef wxHAS_HUGE_FILES
#define wxStructStat struct _stati64
#else
#define wxStructStat struct _stat
#endif
#endif // __BORLANDC__/!__BORLANDC__
// functions
// MSVC and compatible compilers prepend underscores to the POSIX function
// names, other compilers don't and even if their later versions usually do
// define the versions with underscores for MSVC compatibility, it's better
// to avoid using them as they're not present in earlier versions and
// always using the native functions spelling is easier than testing for
// the versions
#if defined(__BORLANDC__) || defined(__MINGW64_TOOLCHAIN__)
#define wxPOSIX_IDENT(func) ::func
#else // by default assume MSVC-compatible names
#define wxPOSIX_IDENT(func) _ ## func
#define wxHAS_UNDERSCORES_IN_POSIX_IDENTS
#endif
// first functions not working with strings, i.e. without ANSI/Unicode
// complications
#define wxClose wxPOSIX_IDENT(close)
#define wxRead wxPOSIX_IDENT(read)
#define wxWrite wxPOSIX_IDENT(write)
#ifdef wxHAS_HUGE_FILES
#ifndef __MINGW64_TOOLCHAIN__
#define wxSeek wxPOSIX_IDENT(lseeki64)
#define wxLseek wxPOSIX_IDENT(lseeki64)
#define wxTell wxPOSIX_IDENT(telli64)
#else
// unfortunately, mingw-W64 is somewhat inconsistent...
#define wxSeek _lseeki64
#define wxLseek _lseeki64
#define wxTell _telli64
#endif
#else // !wxHAS_HUGE_FILES
#define wxSeek wxPOSIX_IDENT(lseek)
#define wxLseek wxPOSIX_IDENT(lseek)
#define wxTell wxPOSIX_IDENT(tell)
#endif // wxHAS_HUGE_FILES/!wxHAS_HUGE_FILES
#if !defined(__BORLANDC__) || (__BORLANDC__ > 0x540)
// NB: this one is not POSIX and always has the underscore
#define wxFsync _commit
// could be already defined by configure (Cygwin)
#ifndef HAVE_FSYNC
#define HAVE_FSYNC
#endif
#endif // BORLANDC
#define wxEof wxPOSIX_IDENT(eof)
// then the functions taking strings
// first the ANSI versions
#define wxCRT_OpenA wxPOSIX_IDENT(open)
#define wxCRT_AccessA wxPOSIX_IDENT(access)
#define wxCRT_ChmodA wxPOSIX_IDENT(chmod)
#define wxCRT_MkDirA wxPOSIX_IDENT(mkdir)
#define wxCRT_RmDirA wxPOSIX_IDENT(rmdir)
#ifdef wxHAS_HUGE_FILES
// MinGW-64 provides underscore-less versions of all file functions
// except for this one.
#ifdef __MINGW64_TOOLCHAIN__
#define wxCRT_StatA _stati64
#else
#define wxCRT_StatA wxPOSIX_IDENT(stati64)
#endif
#else
#define wxCRT_StatA wxPOSIX_IDENT(stat)
#endif
// then wide char ones
#if wxUSE_UNICODE
// special workaround for buggy wopen() in bcc 5.5
#if defined(__BORLANDC__) && \
(__BORLANDC__ >= 0x550 && __BORLANDC__ <= 0x551)
WXDLLIMPEXP_BASE int wxCRT_OpenW(const wxChar *pathname,
int flags, mode_t mode);
#else
#define wxCRT_OpenW _wopen
#endif
wxDECL_FOR_STRICT_MINGW32(int, _wopen, (const wchar_t*, int, ...))
wxDECL_FOR_STRICT_MINGW32(int, _waccess, (const wchar_t*, int))
wxDECL_FOR_STRICT_MINGW32(int, _wchmod, (const wchar_t*, int))
wxDECL_FOR_STRICT_MINGW32(int, _wmkdir, (const wchar_t*))
wxDECL_FOR_STRICT_MINGW32(int, _wrmdir, (const wchar_t*))
wxDECL_FOR_STRICT_MINGW32(int, _wstati64, (const wchar_t*, struct _stati64*))
#define wxCRT_AccessW _waccess
#define wxCRT_ChmodW _wchmod
#define wxCRT_MkDirW _wmkdir
#define wxCRT_RmDirW _wrmdir
#ifdef wxHAS_HUGE_FILES
#define wxCRT_StatW _wstati64
#else
#define wxCRT_StatW _wstat
#endif
#endif // wxUSE_UNICODE
// finally the default char-type versions
#if wxUSE_UNICODE
#define wxCRT_Open wxCRT_OpenW
#define wxCRT_Access wxCRT_AccessW
#define wxCRT_Chmod wxCRT_ChmodW
#define wxCRT_MkDir wxCRT_MkDirW
#define wxCRT_RmDir wxCRT_RmDirW
#define wxCRT_Stat wxCRT_StatW
#else // !wxUSE_UNICODE
#define wxCRT_Open wxCRT_OpenA
#define wxCRT_Access wxCRT_AccessA
#define wxCRT_Chmod wxCRT_ChmodA
#define wxCRT_MkDir wxCRT_MkDirA
#define wxCRT_RmDir wxCRT_RmDirA
#define wxCRT_Stat wxCRT_StatA
#endif // wxUSE_UNICODE/!wxUSE_UNICODE
// constants (unless already defined by the user code)
#ifdef wxHAS_UNDERSCORES_IN_POSIX_IDENTS
#ifndef O_RDONLY
#define O_RDONLY _O_RDONLY
#define O_WRONLY _O_WRONLY
#define O_RDWR _O_RDWR
#define O_EXCL _O_EXCL
#define O_CREAT _O_CREAT
#define O_BINARY _O_BINARY
#endif
#ifndef S_IFMT
#define S_IFMT _S_IFMT
#define S_IFDIR _S_IFDIR
#define S_IFREG _S_IFREG
#endif
#endif // wxHAS_UNDERSCORES_IN_POSIX_IDENTS
#ifdef wxHAS_HUGE_FILES
// wxFile is present and supports large files.
#if wxUSE_FILE
#define wxHAS_LARGE_FILES
#endif
// wxFFile is present and supports large files
#if wxUSE_FFILE && defined wxHAS_HUGE_STDIO_FILES
#define wxHAS_LARGE_FFILES
#endif
#endif
// private defines, undefine so that nobody gets tempted to use
#undef wxHAS_HUGE_FILES
#undef wxHAS_HUGE_STDIO_FILES
#else // Unix or Windows using unknown compiler, assume POSIX supported
typedef off_t wxFileOffset;
#ifdef HAVE_LARGEFILE_SUPPORT
#define wxFileOffsetFmtSpec wxLongLongFmtSpec
wxCOMPILE_TIME_ASSERT( sizeof(off_t) == sizeof(wxLongLong_t),
BadFileSizeType );
// wxFile is present and supports large files
#if wxUSE_FILE
#define wxHAS_LARGE_FILES
#endif
// wxFFile is present and supports large files
#if wxUSE_FFILE && (SIZEOF_LONG == 8 || defined HAVE_FSEEKO)
#define wxHAS_LARGE_FFILES
#endif
#ifdef HAVE_FSEEKO
#define wxFseek fseeko
#define wxFtell ftello
#endif
#else
#define wxFileOffsetFmtSpec wxT("")
#endif
// functions
#define wxClose close
#define wxRead ::read
#define wxWrite ::write
#define wxLseek lseek
#define wxSeek lseek
#define wxFsync fsync
#define wxEof eof
#define wxCRT_MkDir mkdir
#define wxCRT_RmDir rmdir
#define wxTell(fd) lseek(fd, 0, SEEK_CUR)
#define wxStructStat struct stat
#define wxCRT_Open open
#define wxCRT_Stat stat
#define wxCRT_Lstat lstat
#define wxCRT_Access access
#define wxCRT_Chmod chmod
#define wxHAS_NATIVE_LSTAT
#endif // platforms
// if the platform doesn't have symlinks, define wxCRT_Lstat to be the same as
// wxCRT_Stat to avoid #ifdefs in the code using it
#ifndef wxHAS_NATIVE_LSTAT
#define wxCRT_Lstat wxCRT_Stat
#endif
// define wxFseek/wxFtell to large file versions if available (done above) or
// to fseek/ftell if not, to save ifdefs in using code
#ifndef wxFseek
#define wxFseek fseek
#endif
#ifndef wxFtell
#define wxFtell ftell
#endif
inline int wxAccess(const wxString& path, mode_t mode)
{ return wxCRT_Access(path.fn_str(), mode); }
inline int wxChmod(const wxString& path, mode_t mode)
{ return wxCRT_Chmod(path.fn_str(), mode); }
inline int wxOpen(const wxString& path, int flags, mode_t mode)
{ return wxCRT_Open(path.fn_str(), flags, mode); }
inline int wxStat(const wxString& path, wxStructStat *buf)
{ return wxCRT_Stat(path.fn_str(), buf); }
inline int wxLstat(const wxString& path, wxStructStat *buf)
{ return wxCRT_Lstat(path.fn_str(), buf); }
inline int wxRmDir(const wxString& path)
{ return wxCRT_RmDir(path.fn_str()); }
#if (defined(__WINDOWS__) && !defined(__CYGWIN__))
inline int wxMkDir(const wxString& path, mode_t WXUNUSED(mode) = 0)
{ return wxCRT_MkDir(path.fn_str()); }
#else
inline int wxMkDir(const wxString& path, mode_t mode)
{ return wxCRT_MkDir(path.fn_str(), mode); }
#endif
#ifdef O_BINARY
#define wxO_BINARY O_BINARY
#else
#define wxO_BINARY 0
#endif
const int wxInvalidOffset = -1;
// ----------------------------------------------------------------------------
// functions
// ----------------------------------------------------------------------------
WXDLLIMPEXP_BASE bool wxFileExists(const wxString& filename);
// does the path exist? (may have or not '/' or '\\' at the end)
WXDLLIMPEXP_BASE bool wxDirExists(const wxString& pathName);
WXDLLIMPEXP_BASE bool wxIsAbsolutePath(const wxString& filename);
// Get filename
WXDLLIMPEXP_BASE wxChar* wxFileNameFromPath(wxChar *path);
WXDLLIMPEXP_BASE wxString wxFileNameFromPath(const wxString& path);
// Get directory
WXDLLIMPEXP_BASE wxString wxPathOnly(const wxString& path);
// all deprecated functions below are deprecated in favour of wxFileName's methods
#if WXWIN_COMPATIBILITY_2_8
wxDEPRECATED( WXDLLIMPEXP_BASE void wxDos2UnixFilename(char *s) );
wxDEPRECATED( WXDLLIMPEXP_BASE void wxDos2UnixFilename(wchar_t *s) );
wxDEPRECATED_BUT_USED_INTERNALLY(
WXDLLIMPEXP_BASE void wxUnix2DosFilename(char *s) );
wxDEPRECATED_BUT_USED_INTERNALLY(
WXDLLIMPEXP_BASE void wxUnix2DosFilename(wchar_t *s) );
// Strip the extension, in situ
// Deprecated in favour of wxFileName::StripExtension() but notice that their
// behaviour is slightly different, see the manual
wxDEPRECATED( WXDLLIMPEXP_BASE void wxStripExtension(char *buffer) );
wxDEPRECATED( WXDLLIMPEXP_BASE void wxStripExtension(wchar_t *buffer) );
wxDEPRECATED( WXDLLIMPEXP_BASE void wxStripExtension(wxString& buffer) );
// Get a temporary filename
wxDEPRECATED_BUT_USED_INTERNALLY( WXDLLIMPEXP_BASE wxChar* wxGetTempFileName(const wxString& prefix, wxChar *buf = NULL) );
wxDEPRECATED_BUT_USED_INTERNALLY( WXDLLIMPEXP_BASE bool wxGetTempFileName(const wxString& prefix, wxString& buf) );
// Expand file name (~/ and ${OPENWINHOME}/ stuff)
wxDEPRECATED_BUT_USED_INTERNALLY( WXDLLIMPEXP_BASE char* wxExpandPath(char *dest, const wxString& path) );
wxDEPRECATED_BUT_USED_INTERNALLY( WXDLLIMPEXP_BASE wchar_t* wxExpandPath(wchar_t *dest, const wxString& path) );
// DEPRECATED: use wxFileName::Normalize(wxPATH_NORM_ENV_VARS)
// Contract w.r.t environment (</usr/openwin/lib, OPENWHOME> -> ${OPENWINHOME}/lib)
// and make (if under the home tree) relative to home
// [caller must copy-- volatile]
wxDEPRECATED(
WXDLLIMPEXP_BASE wxChar* wxContractPath(const wxString& filename,
const wxString& envname = wxEmptyString,
const wxString& user = wxEmptyString) );
// DEPRECATED: use wxFileName::ReplaceEnvVariable and wxFileName::ReplaceHomeDir
// Destructive removal of /./ and /../ stuff
wxDEPRECATED_BUT_USED_INTERNALLY( WXDLLIMPEXP_BASE char* wxRealPath(char *path) );
wxDEPRECATED_BUT_USED_INTERNALLY( WXDLLIMPEXP_BASE wchar_t* wxRealPath(wchar_t *path) );
wxDEPRECATED_BUT_USED_INTERNALLY( WXDLLIMPEXP_BASE wxString wxRealPath(const wxString& path) );
// DEPRECATED: use wxFileName::Normalize instead
// Allocate a copy of the full absolute path
wxDEPRECATED( WXDLLIMPEXP_BASE wxChar* wxCopyAbsolutePath(const wxString& path) );
// DEPRECATED: use wxFileName::MakeAbsolute instead
#endif
// Get first file name matching given wild card.
// Flags are reserved for future use.
#define wxFILE 1
#define wxDIR 2
WXDLLIMPEXP_BASE wxString wxFindFirstFile(const wxString& spec, int flags = wxFILE);
WXDLLIMPEXP_BASE wxString wxFindNextFile();
// Does the pattern contain wildcards?
WXDLLIMPEXP_BASE bool wxIsWild(const wxString& pattern);
// Does the pattern match the text (usually a filename)?
// If dot_special is true, doesn't match * against . (eliminating
// `hidden' dot files)
WXDLLIMPEXP_BASE bool wxMatchWild(const wxString& pattern, const wxString& text, bool dot_special = true);
// Concatenate two files to form third
WXDLLIMPEXP_BASE bool wxConcatFiles(const wxString& src1, const wxString& src2, const wxString& dest);
// Copy file
WXDLLIMPEXP_BASE bool wxCopyFile(const wxString& src, const wxString& dest,
bool overwrite = true);
// Remove file
WXDLLIMPEXP_BASE bool wxRemoveFile(const wxString& file);
// Rename file
WXDLLIMPEXP_BASE bool wxRenameFile(const wxString& oldpath, const wxString& newpath, bool overwrite = true);
// Get current working directory.
WXDLLIMPEXP_BASE wxString wxGetCwd();
// Set working directory
WXDLLIMPEXP_BASE bool wxSetWorkingDirectory(const wxString& d);
// Make directory
WXDLLIMPEXP_BASE bool wxMkdir(const wxString& dir, int perm = wxS_DIR_DEFAULT);
// Remove directory. Flags reserved for future use.
WXDLLIMPEXP_BASE bool wxRmdir(const wxString& dir, int flags = 0);
// Return the type of an open file
WXDLLIMPEXP_BASE wxFileKind wxGetFileKind(int fd);
WXDLLIMPEXP_BASE wxFileKind wxGetFileKind(FILE *fp);
// permissions; these functions work both on files and directories:
WXDLLIMPEXP_BASE bool wxIsWritable(const wxString &path);
WXDLLIMPEXP_BASE bool wxIsReadable(const wxString &path);
WXDLLIMPEXP_BASE bool wxIsExecutable(const wxString &path);
// ----------------------------------------------------------------------------
// separators in file names
// ----------------------------------------------------------------------------
// between file name and extension
#define wxFILE_SEP_EXT wxT('.')
// between drive/volume name and the path
#define wxFILE_SEP_DSK wxT(':')
// between the path components
#define wxFILE_SEP_PATH_DOS wxT('\\')
#define wxFILE_SEP_PATH_UNIX wxT('/')
#define wxFILE_SEP_PATH_MAC wxT(':')
#define wxFILE_SEP_PATH_VMS wxT('.') // VMS also uses '[' and ']'
// separator in the path list (as in PATH environment variable)
// there is no PATH variable in Classic Mac OS so just use the
// semicolon (it must be different from the file name separator)
// NB: these are strings and not characters on purpose!
#define wxPATH_SEP_DOS wxT(";")
#define wxPATH_SEP_UNIX wxT(":")
#define wxPATH_SEP_MAC wxT(";")
// platform independent versions
#if defined(__UNIX__)
// CYGWIN also uses UNIX settings
#define wxFILE_SEP_PATH wxFILE_SEP_PATH_UNIX
#define wxPATH_SEP wxPATH_SEP_UNIX
#elif defined(__MAC__)
#define wxFILE_SEP_PATH wxFILE_SEP_PATH_MAC
#define wxPATH_SEP wxPATH_SEP_MAC
#else // Windows
#define wxFILE_SEP_PATH wxFILE_SEP_PATH_DOS
#define wxPATH_SEP wxPATH_SEP_DOS
#endif // Unix/Windows
// this is useful for wxString::IsSameAs(): to compare two file names use
// filename1.IsSameAs(filename2, wxARE_FILENAMES_CASE_SENSITIVE)
#if defined(__UNIX__) && !defined(__DARWIN__)
#define wxARE_FILENAMES_CASE_SENSITIVE true
#else // Windows and OSX
#define wxARE_FILENAMES_CASE_SENSITIVE false
#endif // Unix/Windows
// is the char a path separator?
inline bool wxIsPathSeparator(wxChar c)
{
// under DOS/Windows we should understand both Unix and DOS file separators
#if defined(__UNIX__) || defined(__MAC__)
return c == wxFILE_SEP_PATH;
#else
return c == wxFILE_SEP_PATH_DOS || c == wxFILE_SEP_PATH_UNIX;
#endif
}
// does the string ends with path separator?
WXDLLIMPEXP_BASE bool wxEndsWithPathSeparator(const wxString& filename);
#if WXWIN_COMPATIBILITY_2_8
// split the full path into path (including drive for DOS), name and extension
// (understands both '/' and '\\')
// Deprecated in favour of wxFileName::SplitPath
wxDEPRECATED( WXDLLIMPEXP_BASE void wxSplitPath(const wxString& fileName,
wxString *pstrPath,
wxString *pstrName,
wxString *pstrExt) );
#endif
// find a file in a list of directories, returns false if not found
WXDLLIMPEXP_BASE bool wxFindFileInPath(wxString *pStr, const wxString& szPath, const wxString& szFile);
// Get the OS directory if appropriate (such as the Windows directory).
// On non-Windows platform, probably just return the empty string.
WXDLLIMPEXP_BASE wxString wxGetOSDirectory();
#if wxUSE_DATETIME
// Get file modification time
WXDLLIMPEXP_BASE time_t wxFileModificationTime(const wxString& filename);
#endif // wxUSE_DATETIME
// Parses the wildCard, returning the number of filters.
// Returns 0 if none or if there's a problem,
// The arrays will contain an equal number of items found before the error.
// wildCard is in the form:
// "All files (*)|*|Image Files (*.jpeg *.png)|*.jpg;*.png"
WXDLLIMPEXP_BASE int wxParseCommonDialogsFilter(const wxString& wildCard, wxArrayString& descriptions, wxArrayString& filters);
// ----------------------------------------------------------------------------
// classes
// ----------------------------------------------------------------------------
#ifdef __UNIX__
// set umask to the given value in ctor and reset it to the old one in dtor
class WXDLLIMPEXP_BASE wxUmaskChanger
{
public:
// change the umask to the given one if it is not -1: this allows to write
// the same code whether you really want to change umask or not, as is in
// wxFileConfig::Flush() for example
wxUmaskChanger(int umaskNew)
{
m_umaskOld = umaskNew == -1 ? -1 : (int)umask((mode_t)umaskNew);
}
~wxUmaskChanger()
{
if ( m_umaskOld != -1 )
umask((mode_t)m_umaskOld);
}
private:
int m_umaskOld;
};
// this macro expands to an "anonymous" wxUmaskChanger object under Unix and
// nothing elsewhere
#define wxCHANGE_UMASK(m) wxUmaskChanger wxMAKE_UNIQUE_NAME(umaskChanger_)(m)
#else // !__UNIX__
#define wxCHANGE_UMASK(m)
#endif // __UNIX__/!__UNIX__
// Path searching
class WXDLLIMPEXP_BASE wxPathList : public wxArrayString
{
public:
wxPathList() {}
wxPathList(const wxArrayString &arr)
{ Add(arr); }
// Adds all paths in environment variable
void AddEnvList(const wxString& envVariable);
// Adds given path to this list
bool Add(const wxString& path);
void Add(const wxArrayString &paths);
// Find the first full path for which the file exists
wxString FindValidPath(const wxString& filename) const;
// Find the first full path for which the file exists; ensure it's an
// absolute path that gets returned.
wxString FindAbsoluteValidPath(const wxString& filename) const;
// Given full path and filename, add path to list
bool EnsureFileAccessible(const wxString& path);
};
#endif // _WX_FILEFN_H_
| h |
rticonnextdds-usecases | data/projects/rticonnextdds-usecases/VehicleTracking/ExampleCode/thirdparty/wxWidgets-3.1.2/Win32/include/wx/translation.h | /////////////////////////////////////////////////////////////////////////////
// Name: wx/translation.h
// Purpose: Internationalization and localisation for wxWidgets
// Author: Vadim Zeitlin, Vaclav Slavik,
// Michael N. Filippov <[email protected]>
// Created: 2010-04-23
// Copyright: (c) 1998 Vadim Zeitlin <[email protected]>
// (c) 2010 Vaclav Slavik <[email protected]>
// Licence: wxWindows licence
/////////////////////////////////////////////////////////////////////////////
#ifndef _WX_TRANSLATION_H_
#define _WX_TRANSLATION_H_
#include "wx/defs.h"
#include "wx/string.h"
#if wxUSE_INTL
#include "wx/buffer.h"
#include "wx/language.h"
#include "wx/hashmap.h"
#include "wx/strconv.h"
#include "wx/scopedptr.h"
// ============================================================================
// global decls
// ============================================================================
// ----------------------------------------------------------------------------
// macros
// ----------------------------------------------------------------------------
// gettext() style macros (notice that xgettext should be invoked with
// --keyword="_" --keyword="wxPLURAL:1,2" options
// to extract the strings from the sources)
#ifndef WXINTL_NO_GETTEXT_MACRO
#define _(s) wxGetTranslation((s))
#define wxPLURAL(sing, plur, n) wxGetTranslation((sing), (plur), n)
#endif
// wx-specific macro for translating strings in the given context: if you use
// them, you need to also add
// --keyword="wxGETTEXT_IN_CONTEXT:1c,2" --keyword="wxGETTEXT_IN_CONTEXT_PLURAL:1c,2,3"
// options to xgettext invocation.
#define wxGETTEXT_IN_CONTEXT(c, s) \
wxGetTranslation((s), wxString(), c)
#define wxGETTEXT_IN_CONTEXT_PLURAL(c, sing, plur, n) \
wxGetTranslation((sing), (plur), n, wxString(), c)
// another one which just marks the strings for extraction, but doesn't
// perform the translation (use -kwxTRANSLATE with xgettext!)
#define wxTRANSLATE(str) str
// ----------------------------------------------------------------------------
// forward decls
// ----------------------------------------------------------------------------
class WXDLLIMPEXP_FWD_BASE wxArrayString;
class WXDLLIMPEXP_FWD_BASE wxTranslationsLoader;
class WXDLLIMPEXP_FWD_BASE wxLocale;
class wxPluralFormsCalculator;
wxDECLARE_SCOPED_PTR(wxPluralFormsCalculator, wxPluralFormsCalculatorPtr)
// ----------------------------------------------------------------------------
// wxMsgCatalog corresponds to one loaded message catalog.
// ----------------------------------------------------------------------------
class WXDLLIMPEXP_BASE wxMsgCatalog
{
public:
// Ctor is protected, because CreateFromXXX functions must be used,
// but destruction should be unrestricted
#if !wxUSE_UNICODE
~wxMsgCatalog();
#endif
// load the catalog from disk or from data; caller is responsible for
// deleting them if not NULL
static wxMsgCatalog *CreateFromFile(const wxString& filename,
const wxString& domain);
static wxMsgCatalog *CreateFromData(const wxScopedCharBuffer& data,
const wxString& domain);
// get name of the catalog
wxString GetDomain() const { return m_domain; }
// get the translated string: returns NULL if not found
const wxString *GetString(const wxString& sz, unsigned n = UINT_MAX, const wxString& ct = wxEmptyString) const;
protected:
wxMsgCatalog(const wxString& domain)
: m_pNext(NULL), m_domain(domain)
#if !wxUSE_UNICODE
, m_conv(NULL)
#endif
{}
private:
// variable pointing to the next element in a linked list (or NULL)
wxMsgCatalog *m_pNext;
friend class wxTranslations;
wxStringToStringHashMap m_messages; // all messages in the catalog
wxString m_domain; // name of the domain
#if !wxUSE_UNICODE
// the conversion corresponding to this catalog charset if we installed it
// as the global one
wxCSConv *m_conv;
#endif
wxPluralFormsCalculatorPtr m_pluralFormsCalculator;
};
// ----------------------------------------------------------------------------
// wxTranslations: message catalogs
// ----------------------------------------------------------------------------
// this class allows to get translations for strings
class WXDLLIMPEXP_BASE wxTranslations
{
public:
wxTranslations();
~wxTranslations();
// returns current translations object, may return NULL
static wxTranslations *Get();
// sets current translations object (takes ownership; may be NULL)
static void Set(wxTranslations *t);
// changes loader to non-default one; takes ownership of 'loader'
void SetLoader(wxTranslationsLoader *loader);
void SetLanguage(wxLanguage lang);
void SetLanguage(const wxString& lang);
// get languages available for this app
wxArrayString GetAvailableTranslations(const wxString& domain) const;
// find best translation language for given domain
wxString GetBestTranslation(const wxString& domain, wxLanguage msgIdLanguage);
wxString GetBestTranslation(const wxString& domain,
const wxString& msgIdLanguage = "en");
// find best and all other suitable translation languages for given domain
wxArrayString GetAcceptableTranslations(const wxString& domain,
wxLanguage msgIdLanguage);
wxArrayString GetAcceptableTranslations(const wxString& domain,
const wxString& msgIdLanguage = "en");
// add standard wxWidgets catalog ("wxstd")
bool AddStdCatalog();
// add catalog with given domain name and language, looking it up via
// wxTranslationsLoader
bool AddCatalog(const wxString& domain,
wxLanguage msgIdLanguage = wxLANGUAGE_ENGLISH_US);
#if !wxUSE_UNICODE
bool AddCatalog(const wxString& domain,
wxLanguage msgIdLanguage,
const wxString& msgIdCharset);
#endif
// check if the given catalog is loaded
bool IsLoaded(const wxString& domain) const;
// access to translations
const wxString *GetTranslatedString(const wxString& origString,
const wxString& domain = wxEmptyString,
const wxString& context = wxEmptyString) const;
const wxString *GetTranslatedString(const wxString& origString,
unsigned n,
const wxString& domain = wxEmptyString,
const wxString& context = wxEmptyString) const;
wxString GetHeaderValue(const wxString& header,
const wxString& domain = wxEmptyString) const;
// this is hack to work around a problem with wxGetTranslation() which
// returns const wxString& and not wxString, so when it returns untranslated
// string, it needs to have a copy of it somewhere
static const wxString& GetUntranslatedString(const wxString& str);
private:
// perform loading of the catalog via m_loader
bool LoadCatalog(const wxString& domain, const wxString& lang, const wxString& msgIdLang);
// find catalog by name in a linked list, return NULL if !found
wxMsgCatalog *FindCatalog(const wxString& domain) const;
// same as Set(), without taking ownership; only for wxLocale
static void SetNonOwned(wxTranslations *t);
friend class wxLocale;
private:
wxString m_lang;
wxTranslationsLoader *m_loader;
wxMsgCatalog *m_pMsgCat; // pointer to linked list of catalogs
// In addition to keeping all the catalogs in the linked list, we also
// store them in a hash map indexed by the domain name to allow finding
// them by name efficiently.
WX_DECLARE_HASH_MAP(wxString, wxMsgCatalog *, wxStringHash, wxStringEqual, wxMsgCatalogMap);
wxMsgCatalogMap m_catalogMap;
};
// abstraction of translations discovery and loading
class WXDLLIMPEXP_BASE wxTranslationsLoader
{
public:
wxTranslationsLoader() {}
virtual ~wxTranslationsLoader() {}
virtual wxMsgCatalog *LoadCatalog(const wxString& domain,
const wxString& lang) = 0;
virtual wxArrayString GetAvailableTranslations(const wxString& domain) const = 0;
};
// standard wxTranslationsLoader implementation, using filesystem
class WXDLLIMPEXP_BASE wxFileTranslationsLoader
: public wxTranslationsLoader
{
public:
static void AddCatalogLookupPathPrefix(const wxString& prefix);
virtual wxMsgCatalog *LoadCatalog(const wxString& domain,
const wxString& lang) wxOVERRIDE;
virtual wxArrayString GetAvailableTranslations(const wxString& domain) const wxOVERRIDE;
};
#ifdef __WINDOWS__
// loads translations from win32 resources
class WXDLLIMPEXP_BASE wxResourceTranslationsLoader
: public wxTranslationsLoader
{
public:
virtual wxMsgCatalog *LoadCatalog(const wxString& domain,
const wxString& lang) wxOVERRIDE;
virtual wxArrayString GetAvailableTranslations(const wxString& domain) const wxOVERRIDE;
protected:
// returns resource type to use for translations
virtual wxString GetResourceType() const { return "MOFILE"; }
// returns module to load resources from
virtual WXHINSTANCE GetModule() const { return 0; }
};
#endif // __WINDOWS__
// ----------------------------------------------------------------------------
// global functions
// ----------------------------------------------------------------------------
// get the translation of the string in the current locale
inline const wxString& wxGetTranslation(const wxString& str,
const wxString& domain = wxString(),
const wxString& context = wxString())
{
wxTranslations *trans = wxTranslations::Get();
const wxString *transStr = trans ? trans->GetTranslatedString(str, domain, context)
: NULL;
if ( transStr )
return *transStr;
else
// NB: this function returns reference to a string, so we have to keep
// a copy of it somewhere
return wxTranslations::GetUntranslatedString(str);
}
inline const wxString& wxGetTranslation(const wxString& str1,
const wxString& str2,
unsigned n,
const wxString& domain = wxString(),
const wxString& context = wxString())
{
wxTranslations *trans = wxTranslations::Get();
const wxString *transStr = trans ? trans->GetTranslatedString(str1, n, domain, context)
: NULL;
if ( transStr )
return *transStr;
else
// NB: this function returns reference to a string, so we have to keep
// a copy of it somewhere
return n == 1
? wxTranslations::GetUntranslatedString(str1)
: wxTranslations::GetUntranslatedString(str2);
}
#else // !wxUSE_INTL
// the macros should still be defined - otherwise compilation would fail
#if !defined(WXINTL_NO_GETTEXT_MACRO)
#if !defined(_)
#define _(s) (s)
#endif
#define wxPLURAL(sing, plur, n) ((n) == 1 ? (sing) : (plur))
#define wxGETTEXT_IN_CONTEXT(c, s) (s)
#define wxGETTEXT_IN_CONTEXT_PLURAL(c, sing, plur, n) wxPLURAL(sing, plur, n)
#endif
#define wxTRANSLATE(str) str
// NB: we use a template here in order to avoid using
// wxLocale::GetUntranslatedString() above, which would be required if
// we returned const wxString&; this way, the compiler should be able to
// optimize wxGetTranslation() away
template<typename TString>
inline TString wxGetTranslation(TString str)
{ return str; }
template<typename TString, typename TDomain>
inline TString wxGetTranslation(TString str, TDomain WXUNUSED(domain))
{ return str; }
template<typename TString, typename TDomain, typename TContext>
inline TString wxGetTranslation(TString str, TDomain WXUNUSED(domain), TContext WXUNUSED(context))
{ return str; }
template<typename TString, typename TDomain>
inline TString wxGetTranslation(TString str1, TString str2, size_t n)
{ return n == 1 ? str1 : str2; }
template<typename TString, typename TDomain>
inline TString wxGetTranslation(TString str1, TString str2, size_t n,
TDomain WXUNUSED(domain))
{ return n == 1 ? str1 : str2; }
template<typename TString, typename TDomain, typename TContext>
inline TString wxGetTranslation(TString str1, TString str2, size_t n,
TDomain WXUNUSED(domain),
TContext WXUNUSED(context))
{ return n == 1 ? str1 : str2; }
#endif // wxUSE_INTL/!wxUSE_INTL
// define this one just in case it occurs somewhere (instead of preferred
// wxTRANSLATE) too
#if !defined(WXINTL_NO_GETTEXT_MACRO)
#if !defined(gettext_noop)
#define gettext_noop(str) (str)
#endif
#if !defined(N_)
#define N_(s) (s)
#endif
#endif
#endif // _WX_TRANSLATION_H_
| h |
rticonnextdds-usecases | data/projects/rticonnextdds-usecases/VehicleTracking/ExampleCode/thirdparty/wxWidgets-3.1.2/Win32/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/Win32/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/Win32/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/Win32/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/Win32/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/Win32/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/Win32/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/Win32/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/Win32/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/Win32/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/Win32/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/Win32/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/Win32/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/Win32/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/Win32/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/Win32/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/Win32/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/Win32/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/Win32/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/Win32/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/Win32/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/Win32/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/Win32/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/Win32/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/Win32/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/Win32/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/Win32/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/Win32/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/Win32/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/Win32/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/Win32/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/Win32/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/Win32/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/Win32/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/Win32/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/Win32/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 |
Subsets and Splits