repo_name
stringclasses 10
values | file_path
stringlengths 29
222
| content
stringlengths 24
926k
| extention
stringclasses 5
values |
---|---|---|---|
rticonnextdds-usecases | data/projects/rticonnextdds-usecases/VehicleTracking/ExampleCode/thirdparty/wxWidgets-3.1.2/Win64/include/wx/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/Win64/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/Win64/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/Win64/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/Win64/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/Win64/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/Win64/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/Win64/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/Win64/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/Win64/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/Win64/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/Win64/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/Win64/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/Win64/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/Win64/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/Win64/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/Win64/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/Win64/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/Win64/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/Win64/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/Win64/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/Win64/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/Win64/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/Win64/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/Win64/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/Win64/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/Win64/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/Win64/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/Win64/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/Win64/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/Win64/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/Win64/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/Win64/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/Win64/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/Win64/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/Win64/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/Win64/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/Win64/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/Win64/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/Win64/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/Win64/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/Win64/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/Win64/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/Win64/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/Win64/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/Win64/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/Win64/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/Win64/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/Win64/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/Win64/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/Win64/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/Win64/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/Win64/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/Win64/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/Win64/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/Win64/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/Win64/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/Win64/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/Win64/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/Win64/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/Win64/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/Win64/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/Win64/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/Win64/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/Win64/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/Win64/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/Win64/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/Win64/include/wx/brush.h | /////////////////////////////////////////////////////////////////////////////
// Name: wx/brush.h
// Purpose: Includes platform-specific wxBrush file
// Author: Julian Smart
// Modified by:
// Created:
// Copyright: Julian Smart
// Licence: wxWindows Licence
/////////////////////////////////////////////////////////////////////////////
#ifndef _WX_BRUSH_H_BASE_
#define _WX_BRUSH_H_BASE_
#include "wx/defs.h"
#include "wx/object.h"
#include "wx/gdiobj.h"
#include "wx/gdicmn.h" // for wxGDIObjListBase
// NOTE: these values cannot be combined together!
enum wxBrushStyle
{
wxBRUSHSTYLE_INVALID = -1,
wxBRUSHSTYLE_SOLID = wxSOLID,
wxBRUSHSTYLE_TRANSPARENT = wxTRANSPARENT,
wxBRUSHSTYLE_STIPPLE_MASK_OPAQUE = wxSTIPPLE_MASK_OPAQUE,
wxBRUSHSTYLE_STIPPLE_MASK = wxSTIPPLE_MASK,
wxBRUSHSTYLE_STIPPLE = wxSTIPPLE,
wxBRUSHSTYLE_BDIAGONAL_HATCH = wxHATCHSTYLE_BDIAGONAL,
wxBRUSHSTYLE_CROSSDIAG_HATCH = wxHATCHSTYLE_CROSSDIAG,
wxBRUSHSTYLE_FDIAGONAL_HATCH = wxHATCHSTYLE_FDIAGONAL,
wxBRUSHSTYLE_CROSS_HATCH = wxHATCHSTYLE_CROSS,
wxBRUSHSTYLE_HORIZONTAL_HATCH = wxHATCHSTYLE_HORIZONTAL,
wxBRUSHSTYLE_VERTICAL_HATCH = wxHATCHSTYLE_VERTICAL,
wxBRUSHSTYLE_FIRST_HATCH = wxHATCHSTYLE_FIRST,
wxBRUSHSTYLE_LAST_HATCH = wxHATCHSTYLE_LAST
};
// wxBrushBase
class WXDLLIMPEXP_CORE wxBrushBase: public wxGDIObject
{
public:
virtual ~wxBrushBase() { }
virtual void SetColour(const wxColour& col) = 0;
virtual void SetColour(unsigned char r, unsigned char g, unsigned char b) = 0;
virtual void SetStyle(wxBrushStyle style) = 0;
virtual void SetStipple(const wxBitmap& stipple) = 0;
virtual wxColour GetColour() const = 0;
virtual wxBrushStyle GetStyle() const = 0;
virtual wxBitmap *GetStipple() const = 0;
virtual bool IsHatch() const
{ return (GetStyle()>=wxBRUSHSTYLE_FIRST_HATCH) && (GetStyle()<=wxBRUSHSTYLE_LAST_HATCH); }
// Convenient helpers for testing whether the brush is a transparent one:
// unlike GetStyle() == wxBRUSHSTYLE_TRANSPARENT, they work correctly even
// if the brush is invalid (they both return false in this case).
bool IsTransparent() const
{
return IsOk() && GetStyle() == wxBRUSHSTYLE_TRANSPARENT;
}
bool IsNonTransparent() const
{
return IsOk() && GetStyle() != wxBRUSHSTYLE_TRANSPARENT;
}
};
#if defined(__WXMSW__)
#include "wx/msw/brush.h"
#elif defined(__WXMOTIF__) || defined(__WXX11__)
#include "wx/x11/brush.h"
#elif defined(__WXGTK20__)
#include "wx/gtk/brush.h"
#elif defined(__WXGTK__)
#include "wx/gtk1/brush.h"
#elif defined(__WXDFB__)
#include "wx/dfb/brush.h"
#elif defined(__WXMAC__)
#include "wx/osx/brush.h"
#elif defined(__WXQT__)
#include "wx/qt/brush.h"
#endif
class WXDLLIMPEXP_CORE wxBrushList: public wxGDIObjListBase
{
public:
wxBrush *FindOrCreateBrush(const wxColour& colour,
wxBrushStyle style = wxBRUSHSTYLE_SOLID);
wxDEPRECATED_MSG("use wxBRUSHSTYLE_XXX constants")
wxBrush *FindOrCreateBrush(const wxColour& colour, int style)
{ return FindOrCreateBrush(colour, (wxBrushStyle)style); }
};
extern WXDLLIMPEXP_DATA_CORE(wxBrushList*) wxTheBrushList;
// provide comparison operators to allow code such as
//
// if ( brush.GetStyle() == wxTRANSPARENT )
//
// to compile without warnings which it would otherwise provoke from some
// compilers as it compares elements of different enums
// Unfortunately some compilers have ambiguity issues when enum comparisons are
// overloaded so we have to disable the overloads in this case, see
// wxCOMPILER_NO_OVERLOAD_ON_ENUM definition in wx/platform.h for more details.
#ifndef wxCOMPILER_NO_OVERLOAD_ON_ENUM
wxDEPRECATED_MSG("use wxBRUSHSTYLE_XXX constants only")
inline bool operator==(wxBrushStyle s, wxDeprecatedGUIConstants t)
{
return static_cast<int>(s) == static_cast<int>(t);
}
wxDEPRECATED_MSG("use wxBRUSHSTYLE_XXX constants only")
inline bool operator!=(wxBrushStyle s, wxDeprecatedGUIConstants t)
{
return static_cast<int>(s) != static_cast<int>(t);
}
#endif // wxCOMPILER_NO_OVERLOAD_ON_ENUM
#endif // _WX_BRUSH_H_BASE_
| h |
rticonnextdds-usecases | data/projects/rticonnextdds-usecases/VehicleTracking/ExampleCode/thirdparty/wxWidgets-3.1.2/Win64/include/wx/clipbrd.h | /////////////////////////////////////////////////////////////////////////////
// Name: wx/clipbrd.h
// Purpose: wxClipboad class and clipboard functions
// Author: Vadim Zeitlin
// Modified by:
// Created: 19.10.99
// Copyright: (c) wxWidgets Team
// Licence: wxWindows licence
/////////////////////////////////////////////////////////////////////////////
#ifndef _WX_CLIPBRD_H_BASE_
#define _WX_CLIPBRD_H_BASE_
#include "wx/defs.h"
#if wxUSE_CLIPBOARD
#include "wx/event.h"
#include "wx/chartype.h"
#include "wx/dataobj.h" // for wxDataFormat
#include "wx/vector.h"
class WXDLLIMPEXP_FWD_CORE wxClipboard;
// ----------------------------------------------------------------------------
// wxClipboard represents the system clipboard. Normally, you should use
// wxTheClipboard which is a global pointer to the (unique) clipboard.
//
// Clipboard can be used to copy data to/paste data from. It works together
// with wxDataObject.
// ----------------------------------------------------------------------------
class WXDLLIMPEXP_CORE wxClipboardBase : public wxObject
{
public:
wxClipboardBase() { m_usePrimary = false; }
// open the clipboard before Add/SetData() and GetData()
virtual bool Open() = 0;
// close the clipboard after Add/SetData() and GetData()
virtual void Close() = 0;
// query whether the clipboard is opened
virtual bool IsOpened() const = 0;
// add to the clipboard data
//
// NB: the clipboard owns the pointer and will delete it, so data must be
// allocated on the heap
virtual bool AddData( wxDataObject *data ) = 0;
// set the clipboard data, this is the same as Clear() followed by
// AddData()
virtual bool SetData( wxDataObject *data ) = 0;
// ask if data in correct format is available
virtual bool IsSupported( const wxDataFormat& format ) = 0;
// ask if data in correct format is available
virtual bool IsSupportedAsync( wxEvtHandler *sink );
// fill data with data on the clipboard (if available)
virtual bool GetData( wxDataObject& data ) = 0;
// clears wxTheClipboard and the system's clipboard if possible
virtual void Clear() = 0;
// flushes the clipboard: this means that the data which is currently on
// clipboard will stay available even after the application exits (possibly
// eating memory), otherwise the clipboard will be emptied on exit
virtual bool Flush() { return false; }
// this allows to choose whether we work with CLIPBOARD (default) or
// PRIMARY selection on X11-based systems
//
// on the other ones, working with primary selection does nothing: this
// allows to write code which sets the primary selection when something is
// selected without any ill effects (i.e. without overwriting the
// clipboard which would be wrong on the platforms without X11 PRIMARY)
virtual void UsePrimarySelection(bool usePrimary = false)
{
m_usePrimary = usePrimary;
}
// return true if we're using primary selection
bool IsUsingPrimarySelection() const { return m_usePrimary; }
// Returns global instance (wxTheClipboard) of the object:
static wxClipboard *Get();
// don't use this directly, it is public for compatibility with some ports
// (wxX11, wxMotif, ...) only
bool m_usePrimary;
};
// ----------------------------------------------------------------------------
// asynchronous clipboard event
// ----------------------------------------------------------------------------
class WXDLLIMPEXP_CORE wxClipboardEvent : public wxEvent
{
public:
wxClipboardEvent(wxEventType evtType = wxEVT_NULL)
: wxEvent(0, evtType)
{
}
wxClipboardEvent(const wxClipboardEvent& event)
: wxEvent(event),
m_formats(event.m_formats)
{
}
bool SupportsFormat(const wxDataFormat& format) const;
void AddFormat(const wxDataFormat& format);
virtual wxEvent *Clone() const wxOVERRIDE
{
return new wxClipboardEvent(*this);
}
protected:
wxVector<wxDataFormat> m_formats;
wxDECLARE_DYNAMIC_CLASS_NO_ASSIGN(wxClipboardEvent);
};
wxDECLARE_EXPORTED_EVENT( WXDLLIMPEXP_CORE, wxEVT_CLIPBOARD_CHANGED, wxClipboardEvent );
typedef void (wxEvtHandler::*wxClipboardEventFunction)(wxClipboardEvent&);
#define wxClipboardEventHandler(func) \
wxEVENT_HANDLER_CAST(wxClipboardEventFunction, func)
#define EVT_CLIPBOARD_CHANGED(func) wx__DECLARE_EVT0(wxEVT_CLIPBOARD_CHANGED, wxClipboardEventHandler(func))
// ----------------------------------------------------------------------------
// globals
// ----------------------------------------------------------------------------
// The global clipboard object - backward compatible access macro:
#define wxTheClipboard (wxClipboard::Get())
// ----------------------------------------------------------------------------
// include platform-specific class declaration
// ----------------------------------------------------------------------------
#if defined(__WXMSW__)
#include "wx/msw/clipbrd.h"
#elif defined(__WXMOTIF__)
#include "wx/motif/clipbrd.h"
#elif defined(__WXGTK20__)
#include "wx/gtk/clipbrd.h"
#elif defined(__WXGTK__)
#include "wx/gtk1/clipbrd.h"
#elif defined(__WXX11__)
#include "wx/x11/clipbrd.h"
#elif defined(__WXMAC__)
#include "wx/osx/clipbrd.h"
#elif defined(__WXQT__)
#include "wx/qt/clipbrd.h"
#endif
// ----------------------------------------------------------------------------
// helpful class for opening the clipboard and automatically closing it
// ----------------------------------------------------------------------------
class WXDLLIMPEXP_CORE wxClipboardLocker
{
public:
wxClipboardLocker(wxClipboard *clipboard = NULL)
{
m_clipboard = clipboard ? clipboard : wxTheClipboard;
if ( m_clipboard )
{
m_clipboard->Open();
}
}
bool operator!() const { return !m_clipboard->IsOpened(); }
~wxClipboardLocker()
{
if ( m_clipboard )
{
m_clipboard->Close();
}
}
private:
wxClipboard *m_clipboard;
wxDECLARE_NO_COPY_CLASS(wxClipboardLocker);
};
#endif // wxUSE_CLIPBOARD
#endif // _WX_CLIPBRD_H_BASE_
| h |
rticonnextdds-usecases | data/projects/rticonnextdds-usecases/VehicleTracking/ExampleCode/thirdparty/wxWidgets-3.1.2/Win64/include/wx/collpane.h | /////////////////////////////////////////////////////////////////////////////
// Name: wx/collpane.h
// Purpose: wxCollapsiblePane
// Author: Francesco Montorsi
// Modified by:
// Created: 8/10/2006
// Copyright: (c) Francesco Montorsi
// Licence: wxWindows Licence
/////////////////////////////////////////////////////////////////////////////
#ifndef _WX_COLLAPSABLE_PANE_H_BASE_
#define _WX_COLLAPSABLE_PANE_H_BASE_
#include "wx/defs.h"
#if wxUSE_COLLPANE
#include "wx/control.h"
// class name
extern WXDLLIMPEXP_DATA_CORE(const char) wxCollapsiblePaneNameStr[];
// ----------------------------------------------------------------------------
// wxCollapsiblePaneBase: interface for wxCollapsiblePane
// ----------------------------------------------------------------------------
#define wxCP_DEFAULT_STYLE (wxTAB_TRAVERSAL | wxNO_BORDER)
#define wxCP_NO_TLW_RESIZE (0x0002)
class WXDLLIMPEXP_CORE wxCollapsiblePaneBase : public wxControl
{
public:
wxCollapsiblePaneBase() {}
virtual void Collapse(bool collapse = true) = 0;
void Expand() { Collapse(false); }
virtual bool IsCollapsed() const = 0;
bool IsExpanded() const { return !IsCollapsed(); }
virtual wxWindow *GetPane() const = 0;
virtual wxString GetLabel() const wxOVERRIDE = 0;
virtual void SetLabel(const wxString& label) wxOVERRIDE = 0;
virtual bool
InformFirstDirection(int direction,
int size,
int availableOtherDir) wxOVERRIDE
{
wxWindow* const p = GetPane();
if ( !p )
return false;
if ( !p->InformFirstDirection(direction, size, availableOtherDir) )
return false;
InvalidateBestSize();
return true;
}
};
// ----------------------------------------------------------------------------
// event types and macros
// ----------------------------------------------------------------------------
class WXDLLIMPEXP_FWD_CORE wxCollapsiblePaneEvent;
wxDECLARE_EXPORTED_EVENT( WXDLLIMPEXP_CORE, wxEVT_COLLAPSIBLEPANE_CHANGED, wxCollapsiblePaneEvent );
class WXDLLIMPEXP_CORE wxCollapsiblePaneEvent : public wxCommandEvent
{
public:
wxCollapsiblePaneEvent() {}
wxCollapsiblePaneEvent(wxObject *generator, int id, bool collapsed)
: wxCommandEvent(wxEVT_COLLAPSIBLEPANE_CHANGED, id),
m_bCollapsed(collapsed)
{
SetEventObject(generator);
}
bool GetCollapsed() const { return m_bCollapsed; }
void SetCollapsed(bool c) { m_bCollapsed = c; }
// default copy ctor, assignment operator and dtor are ok
virtual wxEvent *Clone() const wxOVERRIDE { return new wxCollapsiblePaneEvent(*this); }
private:
bool m_bCollapsed;
wxDECLARE_DYNAMIC_CLASS_NO_ASSIGN(wxCollapsiblePaneEvent);
};
// ----------------------------------------------------------------------------
// event types and macros
// ----------------------------------------------------------------------------
typedef void (wxEvtHandler::*wxCollapsiblePaneEventFunction)(wxCollapsiblePaneEvent&);
#define wxCollapsiblePaneEventHandler(func) \
wxEVENT_HANDLER_CAST(wxCollapsiblePaneEventFunction, func)
#define EVT_COLLAPSIBLEPANE_CHANGED(id, fn) \
wx__DECLARE_EVT1(wxEVT_COLLAPSIBLEPANE_CHANGED, id, wxCollapsiblePaneEventHandler(fn))
#if defined(__WXGTK20__) && !defined(__WXUNIVERSAL__)
#include "wx/gtk/collpane.h"
#else
#include "wx/generic/collpaneg.h"
// use #define and not a typedef to allow forward declaring the class
#define wxCollapsiblePane wxGenericCollapsiblePane
#endif
// old wxEVT_COMMAND_* constant
#define wxEVT_COMMAND_COLLPANE_CHANGED wxEVT_COLLAPSIBLEPANE_CHANGED
#endif // wxUSE_COLLPANE
#endif // _WX_COLLAPSABLE_PANE_H_BASE_
| h |
rticonnextdds-usecases | data/projects/rticonnextdds-usecases/VehicleTracking/ExampleCode/thirdparty/wxWidgets-3.1.2/Win64/include/wx/vidmode.h | ///////////////////////////////////////////////////////////////////////////////
// Name: wx/vidmode.h
// Purpose: declares wxVideoMode class used by both wxDisplay and wxApp
// Author: Vadim Zeitlin
// Modified by:
// Created: 27.09.2003 (extracted from wx/display.h)
// Copyright: (c) 2003 Vadim Zeitlin <[email protected]>
// Licence: wxWindows licence
///////////////////////////////////////////////////////////////////////////////
#ifndef _WX_VMODE_H_
#define _WX_VMODE_H_
// ----------------------------------------------------------------------------
// wxVideoMode: a simple struct containing video mode parameters for a display
// ----------------------------------------------------------------------------
struct WXDLLIMPEXP_CORE wxVideoMode
{
wxVideoMode(int width = 0, int height = 0, int depth = 0, int freq = 0)
{
w = width;
h = height;
bpp = depth;
refresh = freq;
}
// default copy ctor and assignment operator are ok
bool operator==(const wxVideoMode& m) const
{
return w == m.w && h == m.h && bpp == m.bpp && refresh == m.refresh;
}
bool operator!=(const wxVideoMode& mode) const
{
return !operator==(mode);
}
// returns true if this mode matches the other one in the sense that all
// non zero fields of the other mode have the same value in this one
// (except for refresh which is allowed to have a greater value)
bool Matches(const wxVideoMode& other) const
{
return (!other.w || w == other.w) &&
(!other.h || h == other.h) &&
(!other.bpp || bpp == other.bpp) &&
(!other.refresh || refresh >= other.refresh);
}
// trivial accessors
int GetWidth() const { return w; }
int GetHeight() const { return h; }
int GetDepth() const { return bpp; }
int GetRefresh() const { return refresh; }
// returns true if the object has been initialized
bool IsOk() const { return w && h; }
// the screen size in pixels (e.g. 640*480), 0 means unspecified
int w, h;
// bits per pixel (e.g. 32), 1 is monochrome and 0 means unspecified/known
int bpp;
// refresh frequency in Hz, 0 means unspecified/unknown
int refresh;
};
#endif // _WX_VMODE_H_
| h |
rticonnextdds-usecases | data/projects/rticonnextdds-usecases/VehicleTracking/ExampleCode/thirdparty/wxWidgets-3.1.2/Win64/include/wx/tarstrm.h | /////////////////////////////////////////////////////////////////////////////
// Name: wx/tarstrm.h
// Purpose: Streams for Tar files
// Author: Mike Wetherell
// Copyright: (c) 2004 Mike Wetherell
// Licence: wxWindows licence
/////////////////////////////////////////////////////////////////////////////
#ifndef _WX_WXTARSTREAM_H__
#define _WX_WXTARSTREAM_H__
#include "wx/defs.h"
#if wxUSE_TARSTREAM
#include "wx/archive.h"
#include "wx/hashmap.h"
/////////////////////////////////////////////////////////////////////////////
// Constants
// TypeFlag values
enum wxTarType
{
wxTAR_REGTYPE = '0', // regular file
wxTAR_LNKTYPE = '1', // hard link
wxTAR_SYMTYPE = '2', // symbolic link
wxTAR_CHRTYPE = '3', // character special
wxTAR_BLKTYPE = '4', // block special
wxTAR_DIRTYPE = '5', // directory
wxTAR_FIFOTYPE = '6', // named pipe
wxTAR_CONTTYPE = '7' // contiguous file
};
// Archive Formats (use wxTAR_PAX, it's backward compatible)
enum wxTarFormat
{
wxTAR_USTAR, // POSIX.1-1990 tar format
wxTAR_PAX // POSIX.1-2001 tar format
};
/////////////////////////////////////////////////////////////////////////////
// wxTarNotifier
class WXDLLIMPEXP_BASE wxTarNotifier
{
public:
virtual ~wxTarNotifier() { }
virtual void OnEntryUpdated(class wxTarEntry& entry) = 0;
};
/////////////////////////////////////////////////////////////////////////////
// Tar Entry - hold the meta data for a file in the tar
class WXDLLIMPEXP_BASE wxTarEntry : public wxArchiveEntry
{
public:
wxTarEntry(const wxString& name = wxEmptyString,
const wxDateTime& dt = wxDateTime::Now(),
wxFileOffset size = wxInvalidOffset);
virtual ~wxTarEntry();
wxTarEntry(const wxTarEntry& entry);
wxTarEntry& operator=(const wxTarEntry& entry);
// Get accessors
wxString GetName(wxPathFormat format = wxPATH_NATIVE) const wxOVERRIDE;
wxString GetInternalName() const wxOVERRIDE { return m_Name; }
wxPathFormat GetInternalFormat() const wxOVERRIDE { return wxPATH_UNIX; }
int GetMode() const;
int GetUserId() const { return m_UserId; }
int GetGroupId() const { return m_GroupId; }
wxFileOffset GetSize() const wxOVERRIDE { return m_Size; }
wxFileOffset GetOffset() const wxOVERRIDE { return m_Offset; }
wxDateTime GetDateTime() const wxOVERRIDE { return m_ModifyTime; }
wxDateTime GetAccessTime() const { return m_AccessTime; }
wxDateTime GetCreateTime() const { return m_CreateTime; }
int GetTypeFlag() const { return m_TypeFlag; }
wxString GetLinkName() const { return m_LinkName; }
wxString GetUserName() const { return m_UserName; }
wxString GetGroupName() const { return m_GroupName; }
int GetDevMajor() const { return m_DevMajor; }
int GetDevMinor() const { return m_DevMinor; }
// is accessors
bool IsDir() const wxOVERRIDE;
bool IsReadOnly() const wxOVERRIDE { return !(m_Mode & 0222); }
// set accessors
void SetName(const wxString& name, wxPathFormat format = wxPATH_NATIVE) wxOVERRIDE;
void SetUserId(int id) { m_UserId = id; }
void SetGroupId(int id) { m_GroupId = id; }
void SetMode(int mode);
void SetSize(wxFileOffset size) wxOVERRIDE { m_Size = size; }
void SetDateTime(const wxDateTime& dt) wxOVERRIDE { m_ModifyTime = dt; }
void SetAccessTime(const wxDateTime& dt) { m_AccessTime = dt; }
void SetCreateTime(const wxDateTime& dt) { m_CreateTime = dt; }
void SetTypeFlag(int type) { m_TypeFlag = type; }
void SetLinkName(const wxString& link) { m_LinkName = link; }
void SetUserName(const wxString& user) { m_UserName = user; }
void SetGroupName(const wxString& group) { m_GroupName = group; }
void SetDevMajor(int dev) { m_DevMajor = dev; }
void SetDevMinor(int dev) { m_DevMinor = dev; }
// set is accessors
void SetIsDir(bool isDir = true) wxOVERRIDE;
void SetIsReadOnly(bool isReadOnly = true) wxOVERRIDE;
static wxString GetInternalName(const wxString& name,
wxPathFormat format = wxPATH_NATIVE,
bool *pIsDir = NULL);
wxTarEntry *Clone() const { return new wxTarEntry(*this); }
void SetNotifier(wxTarNotifier& WXUNUSED(notifier)) { }
private:
void SetOffset(wxFileOffset offset) wxOVERRIDE { m_Offset = offset; }
virtual wxArchiveEntry* DoClone() const wxOVERRIDE { return Clone(); }
wxString m_Name;
int m_Mode;
bool m_IsModeSet;
int m_UserId;
int m_GroupId;
wxFileOffset m_Size;
wxFileOffset m_Offset;
wxDateTime m_ModifyTime;
wxDateTime m_AccessTime;
wxDateTime m_CreateTime;
int m_TypeFlag;
wxString m_LinkName;
wxString m_UserName;
wxString m_GroupName;
int m_DevMajor;
int m_DevMinor;
friend class wxTarInputStream;
wxDECLARE_DYNAMIC_CLASS(wxTarEntry);
};
/////////////////////////////////////////////////////////////////////////////
// wxTarInputStream
WX_DECLARE_STRING_HASH_MAP(wxString, wxTarHeaderRecords);
class WXDLLIMPEXP_BASE wxTarInputStream : public wxArchiveInputStream
{
public:
typedef wxTarEntry entry_type;
wxTarInputStream(wxInputStream& stream, wxMBConv& conv = wxConvLocal);
wxTarInputStream(wxInputStream *stream, wxMBConv& conv = wxConvLocal);
virtual ~wxTarInputStream();
bool OpenEntry(wxTarEntry& entry);
bool CloseEntry() wxOVERRIDE;
wxTarEntry *GetNextEntry();
wxFileOffset GetLength() const wxOVERRIDE { return m_size; }
bool IsSeekable() const wxOVERRIDE { return m_parent_i_stream->IsSeekable(); }
protected:
size_t OnSysRead(void *buffer, size_t size) wxOVERRIDE;
wxFileOffset OnSysTell() const wxOVERRIDE { return m_pos; }
wxFileOffset OnSysSeek(wxFileOffset seek, wxSeekMode mode) wxOVERRIDE;
private:
void Init();
wxArchiveEntry *DoGetNextEntry() wxOVERRIDE { return GetNextEntry(); }
bool OpenEntry(wxArchiveEntry& entry) wxOVERRIDE;
bool IsOpened() const { return m_pos != wxInvalidOffset; }
wxStreamError ReadHeaders();
bool ReadExtendedHeader(wxTarHeaderRecords*& recs);
wxString GetExtendedHeader(const wxString& key) const;
wxString GetHeaderPath() const;
wxFileOffset GetHeaderNumber(int id) const;
wxString GetHeaderString(int id) const;
wxDateTime GetHeaderDate(const wxString& key) const;
wxFileOffset m_pos; // position within the current entry
wxFileOffset m_offset; // offset to the start of the entry's data
wxFileOffset m_size; // size of the current entry's data
int m_sumType;
int m_tarType;
class wxTarHeaderBlock *m_hdr;
wxTarHeaderRecords *m_HeaderRecs;
wxTarHeaderRecords *m_GlobalHeaderRecs;
wxDECLARE_NO_COPY_CLASS(wxTarInputStream);
};
/////////////////////////////////////////////////////////////////////////////
// wxTarOutputStream
class WXDLLIMPEXP_BASE wxTarOutputStream : public wxArchiveOutputStream
{
public:
wxTarOutputStream(wxOutputStream& stream,
wxTarFormat format = wxTAR_PAX,
wxMBConv& conv = wxConvLocal);
wxTarOutputStream(wxOutputStream *stream,
wxTarFormat format = wxTAR_PAX,
wxMBConv& conv = wxConvLocal);
virtual ~wxTarOutputStream();
bool PutNextEntry(wxTarEntry *entry);
bool PutNextEntry(const wxString& name,
const wxDateTime& dt = wxDateTime::Now(),
wxFileOffset size = wxInvalidOffset) wxOVERRIDE;
bool PutNextDirEntry(const wxString& name,
const wxDateTime& dt = wxDateTime::Now()) wxOVERRIDE;
bool CopyEntry(wxTarEntry *entry, wxTarInputStream& inputStream);
bool CopyArchiveMetaData(wxTarInputStream& WXUNUSED(s)) { return true; }
void Sync() wxOVERRIDE;
bool CloseEntry() wxOVERRIDE;
bool Close() wxOVERRIDE;
bool IsSeekable() const wxOVERRIDE { return m_parent_o_stream->IsSeekable(); }
void SetBlockingFactor(int factor) { m_BlockingFactor = factor; }
int GetBlockingFactor() const { return m_BlockingFactor; }
protected:
size_t OnSysWrite(const void *buffer, size_t size) wxOVERRIDE;
wxFileOffset OnSysTell() const wxOVERRIDE { return m_pos; }
wxFileOffset OnSysSeek(wxFileOffset pos, wxSeekMode mode) wxOVERRIDE;
private:
void Init(wxTarFormat format);
bool PutNextEntry(wxArchiveEntry *entry) wxOVERRIDE;
bool CopyEntry(wxArchiveEntry *entry, wxArchiveInputStream& stream) wxOVERRIDE;
bool CopyArchiveMetaData(wxArchiveInputStream& WXUNUSED(s)) wxOVERRIDE { return true; }
bool IsOpened() const { return m_pos != wxInvalidOffset; }
bool WriteHeaders(wxTarEntry& entry);
bool ModifyHeader();
wxString PaxHeaderPath(const wxString& format, const wxString& path);
void SetExtendedHeader(const wxString& key, const wxString& value);
void SetHeaderPath(const wxString& name);
bool SetHeaderNumber(int id, wxFileOffset n);
void SetHeaderString(int id, const wxString& str);
void SetHeaderDate(const wxString& key, const wxDateTime& datetime);
wxFileOffset m_pos; // position within the current entry
wxFileOffset m_maxpos; // max pos written
wxFileOffset m_size; // expected entry size
wxFileOffset m_headpos; // offset within the file to the entry's header
wxFileOffset m_datapos; // offset within the file to the entry's data
wxFileOffset m_tarstart;// offset within the file to the tar
wxFileOffset m_tarsize; // size of tar so far
bool m_pax;
int m_BlockingFactor;
wxUint32 m_chksum;
bool m_large;
class wxTarHeaderBlock *m_hdr;
class wxTarHeaderBlock *m_hdr2;
char *m_extendedHdr;
size_t m_extendedSize;
wxString m_badfit;
bool m_endrecWritten;
wxDECLARE_NO_COPY_CLASS(wxTarOutputStream);
};
/////////////////////////////////////////////////////////////////////////////
// Iterators
#if wxUSE_STL || defined WX_TEST_ARCHIVE_ITERATOR
typedef wxArchiveIterator<wxTarInputStream> wxTarIter;
typedef wxArchiveIterator<wxTarInputStream,
std::pair<wxString, wxTarEntry*> > wxTarPairIter;
#endif
/////////////////////////////////////////////////////////////////////////////
// wxTarClassFactory
class WXDLLIMPEXP_BASE wxTarClassFactory : public wxArchiveClassFactory
{
public:
typedef wxTarEntry entry_type;
typedef wxTarInputStream instream_type;
typedef wxTarOutputStream outstream_type;
typedef wxTarNotifier notifier_type;
#if wxUSE_STL || defined WX_TEST_ARCHIVE_ITERATOR
typedef wxTarIter iter_type;
typedef wxTarPairIter pairiter_type;
#endif
wxTarClassFactory();
wxTarEntry *NewEntry() const
{ return new wxTarEntry; }
wxTarInputStream *NewStream(wxInputStream& stream) const
{ return new wxTarInputStream(stream, GetConv()); }
wxTarOutputStream *NewStream(wxOutputStream& stream) const
{ return new wxTarOutputStream(stream, wxTAR_PAX, GetConv()); }
wxTarInputStream *NewStream(wxInputStream *stream) const
{ return new wxTarInputStream(stream, GetConv()); }
wxTarOutputStream *NewStream(wxOutputStream *stream) const
{ return new wxTarOutputStream(stream, wxTAR_PAX, GetConv()); }
wxString GetInternalName(const wxString& name,
wxPathFormat format = wxPATH_NATIVE) const wxOVERRIDE
{ return wxTarEntry::GetInternalName(name, format); }
const wxChar * const *GetProtocols(wxStreamProtocolType type
= wxSTREAM_PROTOCOL) const wxOVERRIDE;
protected:
wxArchiveEntry *DoNewEntry() const wxOVERRIDE
{ return NewEntry(); }
wxArchiveInputStream *DoNewStream(wxInputStream& stream) const wxOVERRIDE
{ return NewStream(stream); }
wxArchiveOutputStream *DoNewStream(wxOutputStream& stream) const wxOVERRIDE
{ return NewStream(stream); }
wxArchiveInputStream *DoNewStream(wxInputStream *stream) const wxOVERRIDE
{ return NewStream(stream); }
wxArchiveOutputStream *DoNewStream(wxOutputStream *stream) const wxOVERRIDE
{ return NewStream(stream); }
private:
wxDECLARE_DYNAMIC_CLASS(wxTarClassFactory);
};
#endif // wxUSE_TARSTREAM
#endif // _WX_WXTARSTREAM_H__
| h |
rticonnextdds-usecases | data/projects/rticonnextdds-usecases/VehicleTracking/ExampleCode/thirdparty/wxWidgets-3.1.2/Win64/include/wx/imagjpeg.h | /////////////////////////////////////////////////////////////////////////////
// Name: wx/imagjpeg.h
// Purpose: wxImage JPEG handler
// Author: Vaclav Slavik
// Copyright: (c) Vaclav Slavik
// Licence: wxWindows licence
/////////////////////////////////////////////////////////////////////////////
#ifndef _WX_IMAGJPEG_H_
#define _WX_IMAGJPEG_H_
#include "wx/defs.h"
//-----------------------------------------------------------------------------
// wxJPEGHandler
//-----------------------------------------------------------------------------
#if wxUSE_LIBJPEG
#include "wx/image.h"
#include "wx/versioninfo.h"
class WXDLLIMPEXP_CORE wxJPEGHandler: public wxImageHandler
{
public:
inline wxJPEGHandler()
{
m_name = wxT("JPEG file");
m_extension = wxT("jpg");
m_altExtensions.Add(wxT("jpeg"));
m_altExtensions.Add(wxT("jpe"));
m_type = wxBITMAP_TYPE_JPEG;
m_mime = wxT("image/jpeg");
}
static wxVersionInfo GetLibraryVersionInfo();
#if wxUSE_STREAMS
virtual bool LoadFile( wxImage *image, wxInputStream& stream, bool verbose=true, int index=-1 ) wxOVERRIDE;
virtual bool SaveFile( wxImage *image, wxOutputStream& stream, bool verbose=true ) wxOVERRIDE;
protected:
virtual bool DoCanRead( wxInputStream& stream ) wxOVERRIDE;
#endif
private:
wxDECLARE_DYNAMIC_CLASS(wxJPEGHandler);
};
#endif // wxUSE_LIBJPEG
#endif // _WX_IMAGJPEG_H_
| h |
rticonnextdds-usecases | data/projects/rticonnextdds-usecases/VehicleTracking/ExampleCode/thirdparty/wxWidgets-3.1.2/Win64/include/wx/sizer.h | /////////////////////////////////////////////////////////////////////////////
// Name: wx/sizer.h
// Purpose: provide wxSizer class for layout
// Author: Robert Roebling and Robin Dunn
// Modified by: Ron Lee, Vadim Zeitlin (wxSizerFlags)
// Created:
// Copyright: (c) Robin Dunn, Robert Roebling
// Licence: wxWindows licence
/////////////////////////////////////////////////////////////////////////////
#ifndef __WXSIZER_H__
#define __WXSIZER_H__
#include "wx/defs.h"
#include "wx/window.h"
//---------------------------------------------------------------------------
// classes
//---------------------------------------------------------------------------
class WXDLLIMPEXP_FWD_CORE wxButton;
class WXDLLIMPEXP_FWD_CORE wxBoxSizer;
class WXDLLIMPEXP_FWD_CORE wxSizerItem;
class WXDLLIMPEXP_FWD_CORE wxSizer;
#ifndef wxUSE_BORDER_BY_DEFAULT
#define wxUSE_BORDER_BY_DEFAULT 1
#endif
// ----------------------------------------------------------------------------
// wxSizerFlags: flags used for an item in the sizer
// ----------------------------------------------------------------------------
class WXDLLIMPEXP_CORE wxSizerFlags
{
public:
// construct the flags object initialized with the given proportion (0 by
// default)
wxSizerFlags(int proportion = 0) : m_proportion(proportion)
{
m_flags = 0;
m_borderInPixels = 0;
}
// setters for all sizer flags, they all return the object itself so that
// calls to them can be chained
wxSizerFlags& Proportion(int proportion)
{
m_proportion = proportion;
return *this;
}
wxSizerFlags& Expand()
{
m_flags |= wxEXPAND;
return *this;
}
// notice that Align() replaces the current alignment flags, use specific
// methods below such as Top(), Left() &c if you want to set just the
// vertical or horizontal alignment
wxSizerFlags& Align(int alignment) // combination of wxAlignment values
{
m_flags &= ~wxALIGN_MASK;
m_flags |= alignment;
return *this;
}
// some shortcuts for Align()
wxSizerFlags& Centre() { return Align(wxALIGN_CENTRE); }
wxSizerFlags& Center() { return Centre(); }
wxSizerFlags& CentreVertical() { return Align(wxALIGN_CENTRE_VERTICAL); }
wxSizerFlags& CenterVertical() { return CentreVertical(); }
wxSizerFlags& CentreHorizontal() { return Align(wxALIGN_CENTRE_HORIZONTAL); }
wxSizerFlags& CenterHorizontal() { return CentreHorizontal(); }
wxSizerFlags& Top()
{
m_flags &= ~(wxALIGN_BOTTOM | wxALIGN_CENTRE_VERTICAL);
return *this;
}
wxSizerFlags& Left()
{
m_flags &= ~(wxALIGN_RIGHT | wxALIGN_CENTRE_HORIZONTAL);
return *this;
}
wxSizerFlags& Right()
{
m_flags = (m_flags & ~wxALIGN_CENTRE_HORIZONTAL) | wxALIGN_RIGHT;
return *this;
}
wxSizerFlags& Bottom()
{
m_flags = (m_flags & ~wxALIGN_CENTRE_VERTICAL) | wxALIGN_BOTTOM;
return *this;
}
// default border size used by Border() below
static int GetDefaultBorder()
{
#if wxUSE_BORDER_BY_DEFAULT
#ifdef __WXGTK20__
// GNOME HIG says to use 6px as the base unit:
// http://library.gnome.org/devel/hig-book/stable/design-window.html.en
return 6;
#elif defined(__WXMAC__)
// Not sure if this is really the correct size for the border.
return 5;
#else
// For the other platforms, we need to scale raw pixel values using the
// current DPI, do it once (and cache the result) in another function.
#define wxNEEDS_BORDER_IN_PX
// We don't react to dynamic DPI changes, so we can cache the values of
// the border in on-screen pixels after computing it once. This
// could/should change in the future.
if ( !ms_defaultBorderInPx )
ms_defaultBorderInPx = DoGetDefaultBorderInPx();
return ms_defaultBorderInPx;
#endif
#else
return 0;
#endif
}
wxSizerFlags& Border(int direction, int borderInPixels)
{
wxCHECK_MSG( !(direction & ~wxALL), *this,
wxS("direction must be a combination of wxDirection ")
wxS("enum values.") );
m_flags &= ~wxALL;
m_flags |= direction;
m_borderInPixels = borderInPixels;
return *this;
}
wxSizerFlags& Border(int direction = wxALL)
{
#if wxUSE_BORDER_BY_DEFAULT
return Border(direction, GetDefaultBorder());
#else
// no borders by default on limited size screen
wxUnusedVar(direction);
return *this;
#endif
}
wxSizerFlags& DoubleBorder(int direction = wxALL)
{
#if wxUSE_BORDER_BY_DEFAULT
return Border(direction, 2*GetDefaultBorder());
#else
wxUnusedVar(direction);
return *this;
#endif
}
wxSizerFlags& TripleBorder(int direction = wxALL)
{
#if wxUSE_BORDER_BY_DEFAULT
return Border(direction, 3*GetDefaultBorder());
#else
wxUnusedVar(direction);
return *this;
#endif
}
wxSizerFlags& HorzBorder()
{
#if wxUSE_BORDER_BY_DEFAULT
return Border(wxLEFT | wxRIGHT, GetDefaultBorder());
#else
return *this;
#endif
}
wxSizerFlags& DoubleHorzBorder()
{
#if wxUSE_BORDER_BY_DEFAULT
return Border(wxLEFT | wxRIGHT, 2*GetDefaultBorder());
#else
return *this;
#endif
}
// setters for the others flags
wxSizerFlags& Shaped()
{
m_flags |= wxSHAPED;
return *this;
}
wxSizerFlags& FixedMinSize()
{
m_flags |= wxFIXED_MINSIZE;
return *this;
}
// makes the item ignore window's visibility status
wxSizerFlags& ReserveSpaceEvenIfHidden()
{
m_flags |= wxRESERVE_SPACE_EVEN_IF_HIDDEN;
return *this;
}
// accessors for wxSizer only
int GetProportion() const { return m_proportion; }
int GetFlags() const { return m_flags; }
int GetBorderInPixels() const { return m_borderInPixels; }
private:
#ifdef wxNEEDS_BORDER_IN_PX
static int DoGetDefaultBorderInPx();
static int ms_defaultBorderInPx;
#endif // wxNEEDS_BORDER_IN_PX
int m_proportion;
int m_flags;
int m_borderInPixels;
};
// ----------------------------------------------------------------------------
// wxSizerSpacer: used by wxSizerItem to represent a spacer
// ----------------------------------------------------------------------------
class WXDLLIMPEXP_CORE wxSizerSpacer
{
public:
wxSizerSpacer(const wxSize& size) : m_size(size), m_isShown(true) { }
void SetSize(const wxSize& size) { m_size = size; }
const wxSize& GetSize() const { return m_size; }
void Show(bool show) { m_isShown = show; }
bool IsShown() const { return m_isShown; }
private:
// the size, in pixel
wxSize m_size;
// is the spacer currently shown?
bool m_isShown;
};
// ----------------------------------------------------------------------------
// wxSizerItem
// ----------------------------------------------------------------------------
class WXDLLIMPEXP_CORE wxSizerItem : public wxObject
{
public:
// window
wxSizerItem( wxWindow *window,
int proportion=0,
int flag=0,
int border=0,
wxObject* userData=NULL );
// window with flags
wxSizerItem(wxWindow *window, const wxSizerFlags& flags)
{
Init(flags);
DoSetWindow(window);
}
// subsizer
wxSizerItem( wxSizer *sizer,
int proportion=0,
int flag=0,
int border=0,
wxObject* userData=NULL );
// sizer with flags
wxSizerItem(wxSizer *sizer, const wxSizerFlags& flags)
{
Init(flags);
DoSetSizer(sizer);
}
// spacer
wxSizerItem( int width,
int height,
int proportion=0,
int flag=0,
int border=0,
wxObject* userData=NULL);
// spacer with flags
wxSizerItem(int width, int height, const wxSizerFlags& flags)
{
Init(flags);
DoSetSpacer(wxSize(width, height));
}
wxSizerItem();
virtual ~wxSizerItem();
virtual void DeleteWindows();
// Enable deleting the SizerItem without destroying the contained sizer.
void DetachSizer() { m_sizer = NULL; }
virtual wxSize GetSize() const;
virtual wxSize CalcMin();
virtual void SetDimension( const wxPoint& pos, const wxSize& size );
wxSize GetMinSize() const
{ return m_minSize; }
wxSize GetMinSizeWithBorder() const;
wxSize GetMaxSize() const
{ return IsWindow() ? m_window->GetMaxSize() : wxDefaultSize; }
wxSize GetMaxSizeWithBorder() const;
void SetMinSize(const wxSize& size)
{
if ( IsWindow() )
m_window->SetMinSize(size);
m_minSize = size;
}
void SetMinSize( int x, int y )
{ SetMinSize(wxSize(x, y)); }
void SetInitSize( int x, int y )
{ SetMinSize(wxSize(x, y)); }
// if either of dimensions is zero, ratio is assumed to be 1
// to avoid "divide by zero" errors
void SetRatio(int width, int height)
{ m_ratio = (width && height) ? ((float) width / (float) height) : 1; }
void SetRatio(const wxSize& size)
{ SetRatio(size.x, size.y); }
void SetRatio(float ratio)
{ m_ratio = ratio; }
float GetRatio() const
{ return m_ratio; }
virtual wxRect GetRect() { return m_rect; }
// set a sizer item id (different from a window id, all sizer items,
// including spacers, can have an associated id)
void SetId(int id) { m_id = id; }
int GetId() const { return m_id; }
bool IsWindow() const { return m_kind == Item_Window; }
bool IsSizer() const { return m_kind == Item_Sizer; }
bool IsSpacer() const { return m_kind == Item_Spacer; }
void SetProportion( int proportion )
{ m_proportion = proportion; }
int GetProportion() const
{ return m_proportion; }
void SetFlag( int flag )
{ m_flag = flag; }
int GetFlag() const
{ return m_flag; }
void SetBorder( int border )
{ m_border = border; }
int GetBorder() const
{ return m_border; }
wxWindow *GetWindow() const
{ return m_kind == Item_Window ? m_window : NULL; }
wxSizer *GetSizer() const
{ return m_kind == Item_Sizer ? m_sizer : NULL; }
wxSize GetSpacer() const;
// This function behaves obviously for the windows and spacers but for the
// sizers it returns true if any sizer element is shown and only returns
// false if all of them are hidden. Also, it always returns true if
// wxRESERVE_SPACE_EVEN_IF_HIDDEN flag was used.
bool IsShown() const;
void Show(bool show);
void SetUserData(wxObject* userData)
{ delete m_userData; m_userData = userData; }
wxObject* GetUserData() const
{ return m_userData; }
wxPoint GetPosition() const
{ return m_pos; }
// Called once the first component of an item has been decided. This is
// used in algorithms that depend on knowing the size in one direction
// before the min size in the other direction can be known.
// Returns true if it made use of the information (and min size was changed).
bool InformFirstDirection( int direction, int size, int availableOtherDir=-1 );
// these functions delete the current contents of the item if it's a sizer
// or a spacer but not if it is a window
void AssignWindow(wxWindow *window)
{
Free();
DoSetWindow(window);
}
void AssignSizer(wxSizer *sizer)
{
Free();
DoSetSizer(sizer);
}
void AssignSpacer(const wxSize& size)
{
Free();
DoSetSpacer(size);
}
void AssignSpacer(int w, int h) { AssignSpacer(wxSize(w, h)); }
#if WXWIN_COMPATIBILITY_2_8
// these functions do not free the old sizer/spacer and so can easily
// provoke the memory leaks and so shouldn't be used, use Assign() instead
wxDEPRECATED( void SetWindow(wxWindow *window) );
wxDEPRECATED( void SetSizer(wxSizer *sizer) );
wxDEPRECATED( void SetSpacer(const wxSize& size) );
wxDEPRECATED( void SetSpacer(int width, int height) );
#endif // WXWIN_COMPATIBILITY_2_8
protected:
// common part of several ctors
void Init() { m_userData = NULL; m_kind = Item_None; }
// common part of ctors taking wxSizerFlags
void Init(const wxSizerFlags& flags);
// free current contents
void Free();
// common parts of Set/AssignXXX()
void DoSetWindow(wxWindow *window);
void DoSetSizer(wxSizer *sizer);
void DoSetSpacer(const wxSize& size);
// Add the border specified for this item to the given size
// if it's != wxDefaultSize, just return wxDefaultSize otherwise.
wxSize AddBorderToSize(const wxSize& size) const;
// discriminated union: depending on m_kind one of the fields is valid
enum
{
Item_None,
Item_Window,
Item_Sizer,
Item_Spacer,
Item_Max
} m_kind;
union
{
wxWindow *m_window;
wxSizer *m_sizer;
wxSizerSpacer *m_spacer;
};
wxPoint m_pos;
wxSize m_minSize;
int m_proportion;
int m_border;
int m_flag;
int m_id;
// on screen rectangle of this item (not including borders)
wxRect m_rect;
// Aspect ratio can always be calculated from m_size,
// but this would cause precision loss when the window
// is shrunk. It is safer to preserve the initial value.
float m_ratio;
wxObject *m_userData;
private:
wxDECLARE_CLASS(wxSizerItem);
wxDECLARE_NO_COPY_CLASS(wxSizerItem);
};
WX_DECLARE_EXPORTED_LIST( wxSizerItem, wxSizerItemList );
//---------------------------------------------------------------------------
// wxSizer
//---------------------------------------------------------------------------
class WXDLLIMPEXP_CORE wxSizer: public wxObject, public wxClientDataContainer
{
public:
wxSizer() { m_containingWindow = NULL; }
virtual ~wxSizer();
// methods for adding elements to the sizer: there are Add/Insert/Prepend
// overloads for each of window/sizer/spacer/wxSizerItem
wxSizerItem* Add(wxWindow *window,
int proportion = 0,
int flag = 0,
int border = 0,
wxObject* userData = NULL);
wxSizerItem* Add(wxSizer *sizer,
int proportion = 0,
int flag = 0,
int border = 0,
wxObject* userData = NULL);
wxSizerItem* Add(int width,
int height,
int proportion = 0,
int flag = 0,
int border = 0,
wxObject* userData = NULL);
wxSizerItem* Add( wxWindow *window, const wxSizerFlags& flags);
wxSizerItem* Add( wxSizer *sizer, const wxSizerFlags& flags);
wxSizerItem* Add( int width, int height, const wxSizerFlags& flags);
wxSizerItem* Add( wxSizerItem *item);
virtual wxSizerItem *AddSpacer(int size);
wxSizerItem* AddStretchSpacer(int prop = 1);
wxSizerItem* Insert(size_t index,
wxWindow *window,
int proportion = 0,
int flag = 0,
int border = 0,
wxObject* userData = NULL);
wxSizerItem* Insert(size_t index,
wxSizer *sizer,
int proportion = 0,
int flag = 0,
int border = 0,
wxObject* userData = NULL);
wxSizerItem* Insert(size_t index,
int width,
int height,
int proportion = 0,
int flag = 0,
int border = 0,
wxObject* userData = NULL);
wxSizerItem* Insert(size_t index,
wxWindow *window,
const wxSizerFlags& flags);
wxSizerItem* Insert(size_t index,
wxSizer *sizer,
const wxSizerFlags& flags);
wxSizerItem* Insert(size_t index,
int width,
int height,
const wxSizerFlags& flags);
// NB: do _not_ override this function in the derived classes, this one is
// virtual for compatibility reasons only to allow old code overriding
// it to continue to work, override DoInsert() instead in the new code
virtual wxSizerItem* Insert(size_t index, wxSizerItem *item);
wxSizerItem* InsertSpacer(size_t index, int size);
wxSizerItem* InsertStretchSpacer(size_t index, int prop = 1);
wxSizerItem* Prepend(wxWindow *window,
int proportion = 0,
int flag = 0,
int border = 0,
wxObject* userData = NULL);
wxSizerItem* Prepend(wxSizer *sizer,
int proportion = 0,
int flag = 0,
int border = 0,
wxObject* userData = NULL);
wxSizerItem* Prepend(int width,
int height,
int proportion = 0,
int flag = 0,
int border = 0,
wxObject* userData = NULL);
wxSizerItem* Prepend(wxWindow *window, const wxSizerFlags& flags);
wxSizerItem* Prepend(wxSizer *sizer, const wxSizerFlags& flags);
wxSizerItem* Prepend(int width, int height, const wxSizerFlags& flags);
wxSizerItem* Prepend(wxSizerItem *item);
wxSizerItem* PrependSpacer(int size);
wxSizerItem* PrependStretchSpacer(int prop = 1);
// set (or possibly unset if window is NULL) or get the window this sizer
// is used in
void SetContainingWindow(wxWindow *window);
wxWindow *GetContainingWindow() const { return m_containingWindow; }
virtual bool Remove( wxSizer *sizer );
virtual bool Remove( int index );
virtual bool Detach( wxWindow *window );
virtual bool Detach( wxSizer *sizer );
virtual bool Detach( int index );
virtual bool Replace( wxWindow *oldwin, wxWindow *newwin, bool recursive = false );
virtual bool Replace( wxSizer *oldsz, wxSizer *newsz, bool recursive = false );
virtual bool Replace( size_t index, wxSizerItem *newitem );
virtual void Clear( bool delete_windows = false );
virtual void DeleteWindows();
// Inform sizer about the first direction that has been decided (by parent item)
// Returns true if it made use of the information (and recalculated min size)
//
// Note that while this method doesn't do anything by default, it should
// almost always be overridden in the derived classes and should have been
// pure virtual if not for backwards compatibility constraints.
virtual bool InformFirstDirection( int WXUNUSED(direction), int WXUNUSED(size), int WXUNUSED(availableOtherDir) )
{ return false; }
void SetMinSize( int width, int height )
{ DoSetMinSize( width, height ); }
void SetMinSize( const wxSize& size )
{ DoSetMinSize( size.x, size.y ); }
// Searches recursively
bool SetItemMinSize( wxWindow *window, int width, int height )
{ return DoSetItemMinSize( window, width, height ); }
bool SetItemMinSize( wxWindow *window, const wxSize& size )
{ return DoSetItemMinSize( window, size.x, size.y ); }
// Searches recursively
bool SetItemMinSize( wxSizer *sizer, int width, int height )
{ return DoSetItemMinSize( sizer, width, height ); }
bool SetItemMinSize( wxSizer *sizer, const wxSize& size )
{ return DoSetItemMinSize( sizer, size.x, size.y ); }
bool SetItemMinSize( size_t index, int width, int height )
{ return DoSetItemMinSize( index, width, height ); }
bool SetItemMinSize( size_t index, const wxSize& size )
{ return DoSetItemMinSize( index, size.x, size.y ); }
wxSize GetSize() const
{ return m_size; }
wxPoint GetPosition() const
{ return m_position; }
// Calculate the minimal size or return m_minSize if bigger.
wxSize GetMinSize();
// These virtual functions are used by the layout algorithm: first
// CalcMin() is called to calculate the minimal size of the sizer and
// prepare for laying it out and then RecalcSizes() is called to really
// update all the sizer items
virtual wxSize CalcMin() = 0;
virtual void RecalcSizes() = 0;
virtual void Layout();
wxSize ComputeFittingClientSize(wxWindow *window);
wxSize ComputeFittingWindowSize(wxWindow *window);
wxSize Fit( wxWindow *window );
void FitInside( wxWindow *window );
void SetSizeHints( wxWindow *window );
#if WXWIN_COMPATIBILITY_2_8
// This only calls FitInside() since 2.9
wxDEPRECATED( void SetVirtualSizeHints( wxWindow *window ) );
#endif
wxSizerItemList& GetChildren()
{ return m_children; }
const wxSizerItemList& GetChildren() const
{ return m_children; }
void SetDimension(const wxPoint& pos, const wxSize& size)
{
m_position = pos;
m_size = size;
Layout();
// This call is required for wxWrapSizer to be able to calculate its
// minimal size correctly.
InformFirstDirection(wxHORIZONTAL, size.x, size.y);
}
void SetDimension(int x, int y, int width, int height)
{ SetDimension(wxPoint(x, y), wxSize(width, height)); }
size_t GetItemCount() const { return m_children.GetCount(); }
bool IsEmpty() const { return m_children.IsEmpty(); }
wxSizerItem* GetItem( wxWindow *window, bool recursive = false );
wxSizerItem* GetItem( wxSizer *sizer, bool recursive = false );
wxSizerItem* GetItem( size_t index );
wxSizerItem* GetItemById( int id, bool recursive = false );
// Manage whether individual scene items are considered
// in the layout calculations or not.
bool Show( wxWindow *window, bool show = true, bool recursive = false );
bool Show( wxSizer *sizer, bool show = true, bool recursive = false );
bool Show( size_t index, bool show = true );
bool Hide( wxSizer *sizer, bool recursive = false )
{ return Show( sizer, false, recursive ); }
bool Hide( wxWindow *window, bool recursive = false )
{ return Show( window, false, recursive ); }
bool Hide( size_t index )
{ return Show( index, false ); }
bool IsShown( wxWindow *window ) const;
bool IsShown( wxSizer *sizer ) const;
bool IsShown( size_t index ) const;
// Recursively call wxWindow::Show () on all sizer items.
virtual void ShowItems (bool show);
void Show(bool show) { ShowItems(show); }
// This is the ShowItems() counterpart and returns true if any of the sizer
// items are shown.
virtual bool AreAnyItemsShown() const;
protected:
wxSize m_size;
wxSize m_minSize;
wxPoint m_position;
wxSizerItemList m_children;
// the window this sizer is used in, can be NULL
wxWindow *m_containingWindow;
wxSize GetMaxClientSize( wxWindow *window ) const;
wxSize GetMinClientSize( wxWindow *window );
wxSize VirtualFitSize( wxWindow *window );
virtual void DoSetMinSize( int width, int height );
virtual bool DoSetItemMinSize( wxWindow *window, int width, int height );
virtual bool DoSetItemMinSize( wxSizer *sizer, int width, int height );
virtual bool DoSetItemMinSize( size_t index, int width, int height );
// insert a new item into m_children at given index and return the item
// itself
virtual wxSizerItem* DoInsert(size_t index, wxSizerItem *item);
private:
wxDECLARE_CLASS(wxSizer);
};
//---------------------------------------------------------------------------
// wxGridSizer
//---------------------------------------------------------------------------
class WXDLLIMPEXP_CORE wxGridSizer: public wxSizer
{
public:
// ctors specifying the number of columns only: number of rows will be
// deduced automatically depending on the number of sizer elements
wxGridSizer( int cols, int vgap, int hgap );
wxGridSizer( int cols, const wxSize& gap = wxSize(0, 0) );
// ctors specifying the number of rows and columns
wxGridSizer( int rows, int cols, int vgap, int hgap );
wxGridSizer( int rows, int cols, const wxSize& gap );
virtual void RecalcSizes() wxOVERRIDE;
virtual wxSize CalcMin() wxOVERRIDE;
void SetCols( int cols )
{
wxASSERT_MSG( cols >= 0, "Number of columns must be non-negative");
m_cols = cols;
}
void SetRows( int rows )
{
wxASSERT_MSG( rows >= 0, "Number of rows must be non-negative");
m_rows = rows;
}
void SetVGap( int gap ) { m_vgap = gap; }
void SetHGap( int gap ) { m_hgap = gap; }
int GetCols() const { return m_cols; }
int GetRows() const { return m_rows; }
int GetVGap() const { return m_vgap; }
int GetHGap() const { return m_hgap; }
int GetEffectiveColsCount() const { return m_cols ? m_cols : CalcCols(); }
int GetEffectiveRowsCount() const { return m_rows ? m_rows : CalcRows(); }
// return the number of total items and the number of columns and rows
// (for internal use only)
int CalcRowsCols(int& rows, int& cols) const;
protected:
// the number of rows/columns in the sizer, if 0 then it is determined
// dynamically depending on the total number of items
int m_rows;
int m_cols;
// gaps between rows and columns
int m_vgap;
int m_hgap;
virtual wxSizerItem *DoInsert(size_t index, wxSizerItem *item) wxOVERRIDE;
void SetItemBounds( wxSizerItem *item, int x, int y, int w, int h );
// returns the number of columns/rows needed for the current total number
// of children (and the fixed number of rows/columns)
int CalcCols() const
{
wxCHECK_MSG
(
m_rows, 0,
"Can't calculate number of cols if number of rows is not specified"
);
return int(m_children.GetCount() + m_rows - 1) / m_rows;
}
int CalcRows() const
{
wxCHECK_MSG
(
m_cols, 0,
"Can't calculate number of cols if number of rows is not specified"
);
return int(m_children.GetCount() + m_cols - 1) / m_cols;
}
private:
wxDECLARE_CLASS(wxGridSizer);
};
//---------------------------------------------------------------------------
// wxFlexGridSizer
//---------------------------------------------------------------------------
// values which define the behaviour for resizing wxFlexGridSizer cells in the
// "non-flexible" direction
enum wxFlexSizerGrowMode
{
// don't resize the cells in non-flexible direction at all
wxFLEX_GROWMODE_NONE,
// uniformly resize only the specified ones (default)
wxFLEX_GROWMODE_SPECIFIED,
// uniformly resize all cells
wxFLEX_GROWMODE_ALL
};
class WXDLLIMPEXP_CORE wxFlexGridSizer: public wxGridSizer
{
public:
// ctors specifying the number of columns only: number of rows will be
// deduced automatically depending on the number of sizer elements
wxFlexGridSizer( int cols, int vgap, int hgap );
wxFlexGridSizer( int cols, const wxSize& gap = wxSize(0, 0) );
// ctors specifying the number of rows and columns
wxFlexGridSizer( int rows, int cols, int vgap, int hgap );
wxFlexGridSizer( int rows, int cols, const wxSize& gap );
// dtor
virtual ~wxFlexGridSizer();
// set the rows/columns which will grow (the others will remain of the
// constant initial size)
void AddGrowableRow( size_t idx, int proportion = 0 );
void RemoveGrowableRow( size_t idx );
void AddGrowableCol( size_t idx, int proportion = 0 );
void RemoveGrowableCol( size_t idx );
bool IsRowGrowable( size_t idx );
bool IsColGrowable( size_t idx );
// the sizer cells may grow in both directions, not grow at all or only
// grow in one direction but not the other
// the direction may be wxVERTICAL, wxHORIZONTAL or wxBOTH (default)
void SetFlexibleDirection(int direction) { m_flexDirection = direction; }
int GetFlexibleDirection() const { return m_flexDirection; }
// note that the grow mode only applies to the direction which is not
// flexible
void SetNonFlexibleGrowMode(wxFlexSizerGrowMode mode) { m_growMode = mode; }
wxFlexSizerGrowMode GetNonFlexibleGrowMode() const { return m_growMode; }
// Read-only access to the row heights and col widths arrays
const wxArrayInt& GetRowHeights() const { return m_rowHeights; }
const wxArrayInt& GetColWidths() const { return m_colWidths; }
// implementation
virtual void RecalcSizes() wxOVERRIDE;
virtual wxSize CalcMin() wxOVERRIDE;
protected:
void AdjustForFlexDirection();
void AdjustForGrowables(const wxSize& sz);
void FindWidthsAndHeights(int nrows, int ncols);
// the heights/widths of all rows/columns
wxArrayInt m_rowHeights,
m_colWidths;
// indices of the growable columns and rows
wxArrayInt m_growableRows,
m_growableCols;
// proportion values of the corresponding growable rows and columns
wxArrayInt m_growableRowsProportions,
m_growableColsProportions;
// parameters describing whether the growable cells should be resized in
// both directions or only one
int m_flexDirection;
wxFlexSizerGrowMode m_growMode;
// saves CalcMin result to optimize RecalcSizes
wxSize m_calculatedMinSize;
private:
wxDECLARE_CLASS(wxFlexGridSizer);
wxDECLARE_NO_COPY_CLASS(wxFlexGridSizer);
};
//---------------------------------------------------------------------------
// wxBoxSizer
//---------------------------------------------------------------------------
class WXDLLIMPEXP_CORE wxBoxSizer: public wxSizer
{
public:
wxBoxSizer(int orient)
{
m_orient = orient;
m_totalProportion = 0;
wxASSERT_MSG( m_orient == wxHORIZONTAL || m_orient == wxVERTICAL,
wxT("invalid value for wxBoxSizer orientation") );
}
virtual wxSizerItem *AddSpacer(int size) wxOVERRIDE;
int GetOrientation() const { return m_orient; }
bool IsVertical() const { return m_orient == wxVERTICAL; }
void SetOrientation(int orient) { m_orient = orient; }
// implementation of our resizing logic
virtual wxSize CalcMin() wxOVERRIDE;
virtual void RecalcSizes() wxOVERRIDE;
virtual bool InformFirstDirection(int direction,
int size,
int availableOtherDir) wxOVERRIDE;
protected:
// Only overridden to perform extra debugging checks.
virtual wxSizerItem *DoInsert(size_t index, wxSizerItem *item) wxOVERRIDE;
// helpers for our code: this returns the component of the given wxSize in
// the direction of the sizer and in the other direction, respectively
int GetSizeInMajorDir(const wxSize& sz) const
{
return m_orient == wxHORIZONTAL ? sz.x : sz.y;
}
int& SizeInMajorDir(wxSize& sz)
{
return m_orient == wxHORIZONTAL ? sz.x : sz.y;
}
int& PosInMajorDir(wxPoint& pt)
{
return m_orient == wxHORIZONTAL ? pt.x : pt.y;
}
int GetSizeInMinorDir(const wxSize& sz) const
{
return m_orient == wxHORIZONTAL ? sz.y : sz.x;
}
int& SizeInMinorDir(wxSize& sz)
{
return m_orient == wxHORIZONTAL ? sz.y : sz.x;
}
int& PosInMinorDir(wxPoint& pt)
{
return m_orient == wxHORIZONTAL ? pt.y : pt.x;
}
// another helper: creates wxSize from major and minor components
wxSize SizeFromMajorMinor(int major, int minor) const
{
if ( m_orient == wxHORIZONTAL )
{
return wxSize(major, minor);
}
else // wxVERTICAL
{
return wxSize(minor, major);
}
}
// either wxHORIZONTAL or wxVERTICAL
int m_orient;
// the sum of proportion of all of our elements
int m_totalProportion;
// the minimal size needed for this sizer as calculated by the last call to
// our CalcMin()
wxSize m_calculatedMinSize;
private:
wxDECLARE_CLASS(wxBoxSizer);
};
//---------------------------------------------------------------------------
// wxStaticBoxSizer
//---------------------------------------------------------------------------
#if wxUSE_STATBOX
class WXDLLIMPEXP_FWD_CORE wxStaticBox;
class WXDLLIMPEXP_CORE wxStaticBoxSizer: public wxBoxSizer
{
public:
wxStaticBoxSizer(wxStaticBox *box, int orient);
wxStaticBoxSizer(int orient, wxWindow *win, const wxString& label = wxEmptyString);
virtual ~wxStaticBoxSizer();
void RecalcSizes() wxOVERRIDE;
wxSize CalcMin() wxOVERRIDE;
wxStaticBox *GetStaticBox() const
{ return m_staticBox; }
// override to hide/show the static box as well
virtual void ShowItems (bool show) wxOVERRIDE;
virtual bool AreAnyItemsShown() const wxOVERRIDE;
virtual bool Detach( wxWindow *window ) wxOVERRIDE;
virtual bool Detach( wxSizer *sizer ) wxOVERRIDE { return wxBoxSizer::Detach(sizer); }
virtual bool Detach( int index ) wxOVERRIDE { return wxBoxSizer::Detach(index); }
protected:
wxStaticBox *m_staticBox;
private:
wxDECLARE_CLASS(wxStaticBoxSizer);
wxDECLARE_NO_COPY_CLASS(wxStaticBoxSizer);
};
#endif // wxUSE_STATBOX
//---------------------------------------------------------------------------
// wxStdDialogButtonSizer
//---------------------------------------------------------------------------
#if wxUSE_BUTTON
class WXDLLIMPEXP_CORE wxStdDialogButtonSizer: public wxBoxSizer
{
public:
// Constructor just creates a new wxBoxSizer, not much else.
// Box sizer orientation is automatically determined here:
// vertical for PDAs, horizontal for everything else?
wxStdDialogButtonSizer();
// Checks button ID against system IDs and sets one of the pointers below
// to this button. Does not do any sizer-related things here.
void AddButton(wxButton *button);
// Use these if no standard ID can/should be used
void SetAffirmativeButton( wxButton *button );
void SetNegativeButton( wxButton *button );
void SetCancelButton( wxButton *button );
// All platform-specific code here, checks which buttons exist and add
// them to the sizer accordingly.
// Note - one potential hack on Mac we could use here,
// if m_buttonAffirmative is wxID_SAVE then ensure wxID_SAVE
// is set to _("Save") and m_buttonNegative is set to _("Don't Save")
// I wouldn't add any other hacks like that into here,
// but this one I can see being useful.
void Realize();
wxButton *GetAffirmativeButton() const { return m_buttonAffirmative; }
wxButton *GetApplyButton() const { return m_buttonApply; }
wxButton *GetNegativeButton() const { return m_buttonNegative; }
wxButton *GetCancelButton() const { return m_buttonCancel; }
wxButton *GetHelpButton() const { return m_buttonHelp; }
protected:
wxButton *m_buttonAffirmative; // wxID_OK, wxID_YES, wxID_SAVE go here
wxButton *m_buttonApply; // wxID_APPLY
wxButton *m_buttonNegative; // wxID_NO
wxButton *m_buttonCancel; // wxID_CANCEL, wxID_CLOSE
wxButton *m_buttonHelp; // wxID_HELP, wxID_CONTEXT_HELP
private:
wxDECLARE_CLASS(wxStdDialogButtonSizer);
wxDECLARE_NO_COPY_CLASS(wxStdDialogButtonSizer);
};
#endif // wxUSE_BUTTON
// ----------------------------------------------------------------------------
// inline functions implementation
// ----------------------------------------------------------------------------
#if WXWIN_COMPATIBILITY_2_8
inline void wxSizerItem::SetWindow(wxWindow *window)
{
DoSetWindow(window);
}
inline void wxSizerItem::SetSizer(wxSizer *sizer)
{
DoSetSizer(sizer);
}
inline void wxSizerItem::SetSpacer(const wxSize& size)
{
DoSetSpacer(size);
}
inline void wxSizerItem::SetSpacer(int width, int height)
{
DoSetSpacer(wxSize(width, height));
}
#endif // WXWIN_COMPATIBILITY_2_8
inline wxSizerItem*
wxSizer::Insert(size_t index, wxSizerItem *item)
{
return DoInsert(index, item);
}
inline wxSizerItem*
wxSizer::Add( wxSizerItem *item )
{
return Insert( m_children.GetCount(), item );
}
inline wxSizerItem*
wxSizer::Add( wxWindow *window, int proportion, int flag, int border, wxObject* userData )
{
return Add( new wxSizerItem( window, proportion, flag, border, userData ) );
}
inline wxSizerItem*
wxSizer::Add( wxSizer *sizer, int proportion, int flag, int border, wxObject* userData )
{
return Add( new wxSizerItem( sizer, proportion, flag, border, userData ) );
}
inline wxSizerItem*
wxSizer::Add( int width, int height, int proportion, int flag, int border, wxObject* userData )
{
return Add( new wxSizerItem( width, height, proportion, flag, border, userData ) );
}
inline wxSizerItem*
wxSizer::Add( wxWindow *window, const wxSizerFlags& flags )
{
return Add( new wxSizerItem(window, flags) );
}
inline wxSizerItem*
wxSizer::Add( wxSizer *sizer, const wxSizerFlags& flags )
{
return Add( new wxSizerItem(sizer, flags) );
}
inline wxSizerItem*
wxSizer::Add( int width, int height, const wxSizerFlags& flags )
{
return Add( new wxSizerItem(width, height, flags) );
}
inline wxSizerItem*
wxSizer::AddSpacer(int size)
{
return Add(size, size);
}
inline wxSizerItem*
wxSizer::AddStretchSpacer(int prop)
{
return Add(0, 0, prop);
}
inline wxSizerItem*
wxSizer::Prepend( wxSizerItem *item )
{
return Insert( 0, item );
}
inline wxSizerItem*
wxSizer::Prepend( wxWindow *window, int proportion, int flag, int border, wxObject* userData )
{
return Prepend( new wxSizerItem( window, proportion, flag, border, userData ) );
}
inline wxSizerItem*
wxSizer::Prepend( wxSizer *sizer, int proportion, int flag, int border, wxObject* userData )
{
return Prepend( new wxSizerItem( sizer, proportion, flag, border, userData ) );
}
inline wxSizerItem*
wxSizer::Prepend( int width, int height, int proportion, int flag, int border, wxObject* userData )
{
return Prepend( new wxSizerItem( width, height, proportion, flag, border, userData ) );
}
inline wxSizerItem*
wxSizer::PrependSpacer(int size)
{
return Prepend(size, size);
}
inline wxSizerItem*
wxSizer::PrependStretchSpacer(int prop)
{
return Prepend(0, 0, prop);
}
inline wxSizerItem*
wxSizer::Prepend( wxWindow *window, const wxSizerFlags& flags )
{
return Prepend( new wxSizerItem(window, flags) );
}
inline wxSizerItem*
wxSizer::Prepend( wxSizer *sizer, const wxSizerFlags& flags )
{
return Prepend( new wxSizerItem(sizer, flags) );
}
inline wxSizerItem*
wxSizer::Prepend( int width, int height, const wxSizerFlags& flags )
{
return Prepend( new wxSizerItem(width, height, flags) );
}
inline wxSizerItem*
wxSizer::Insert( size_t index,
wxWindow *window,
int proportion,
int flag,
int border,
wxObject* userData )
{
return Insert( index, new wxSizerItem( window, proportion, flag, border, userData ) );
}
inline wxSizerItem*
wxSizer::Insert( size_t index,
wxSizer *sizer,
int proportion,
int flag,
int border,
wxObject* userData )
{
return Insert( index, new wxSizerItem( sizer, proportion, flag, border, userData ) );
}
inline wxSizerItem*
wxSizer::Insert( size_t index,
int width,
int height,
int proportion,
int flag,
int border,
wxObject* userData )
{
return Insert( index, new wxSizerItem( width, height, proportion, flag, border, userData ) );
}
inline wxSizerItem*
wxSizer::Insert( size_t index, wxWindow *window, const wxSizerFlags& flags )
{
return Insert( index, new wxSizerItem(window, flags) );
}
inline wxSizerItem*
wxSizer::Insert( size_t index, wxSizer *sizer, const wxSizerFlags& flags )
{
return Insert( index, new wxSizerItem(sizer, flags) );
}
inline wxSizerItem*
wxSizer::Insert( size_t index, int width, int height, const wxSizerFlags& flags )
{
return Insert( index, new wxSizerItem(width, height, flags) );
}
inline wxSizerItem*
wxSizer::InsertSpacer(size_t index, int size)
{
return Insert(index, size, size);
}
inline wxSizerItem*
wxSizer::InsertStretchSpacer(size_t index, int prop)
{
return Insert(index, 0, 0, prop);
}
#endif // __WXSIZER_H__
| h |
rticonnextdds-usecases | data/projects/rticonnextdds-usecases/VehicleTracking/ExampleCode/thirdparty/wxWidgets-3.1.2/Win64/include/wx/compositewin.h | ///////////////////////////////////////////////////////////////////////////////
// Name: wx/compositewin.h
// Purpose: wxCompositeWindow<> declaration
// Author: Vadim Zeitlin
// Created: 2011-01-02
// Copyright: (c) 2011 Vadim Zeitlin <[email protected]>
// Licence: wxWindows licence
///////////////////////////////////////////////////////////////////////////////
#ifndef _WX_COMPOSITEWIN_H_
#define _WX_COMPOSITEWIN_H_
#include "wx/window.h"
#include "wx/containr.h"
class WXDLLIMPEXP_FWD_CORE wxToolTip;
// NB: This is an experimental and, as for now, undocumented class used only by
// wxWidgets itself internally. Don't use it in your code until its API is
// officially stabilized unless you are ready to change it with the next
// wxWidgets release.
// ----------------------------------------------------------------------------
// wxCompositeWindow is a helper for implementing composite windows: to define
// a class using subwindows, simply inherit from it specialized with the real
// base class name and implement GetCompositeWindowParts() pure virtual method.
// ----------------------------------------------------------------------------
// This is the base class of wxCompositeWindow which takes care of propagating
// colours, fonts etc changes to all the children, but doesn't bother with
// handling their events or focus. There should be rarely any need to use it
// rather than the full wxCompositeWindow.
// The template parameter W must be a wxWindow-derived class.
template <class W>
class wxCompositeWindowSettersOnly : public W
{
public:
typedef W BaseWindowClass;
// Override all wxWindow methods which must be forwarded to the composite
// window parts.
// Attribute setters group.
//
// NB: Unfortunately we can't factor out the call for the setter itself
// into DoSetForAllParts() because we can't call the function passed to
// it non-virtually and we need to do this to avoid infinite recursion,
// so we work around this by calling the method of this object itself
// manually in each function.
virtual bool SetForegroundColour(const wxColour& colour) wxOVERRIDE
{
if ( !BaseWindowClass::SetForegroundColour(colour) )
return false;
SetForAllParts(&wxWindowBase::SetForegroundColour, colour);
return true;
}
virtual bool SetBackgroundColour(const wxColour& colour) wxOVERRIDE
{
if ( !BaseWindowClass::SetBackgroundColour(colour) )
return false;
SetForAllParts(&wxWindowBase::SetBackgroundColour, colour);
return true;
}
virtual bool SetFont(const wxFont& font) wxOVERRIDE
{
if ( !BaseWindowClass::SetFont(font) )
return false;
SetForAllParts(&wxWindowBase::SetFont, font);
return true;
}
virtual bool SetCursor(const wxCursor& cursor) wxOVERRIDE
{
if ( !BaseWindowClass::SetCursor(cursor) )
return false;
SetForAllParts(&wxWindowBase::SetCursor, cursor);
return true;
}
virtual void SetLayoutDirection(wxLayoutDirection dir) wxOVERRIDE
{
BaseWindowClass::SetLayoutDirection(dir);
SetForAllParts(&wxWindowBase::SetLayoutDirection, dir);
// The child layout almost invariably depends on the layout direction,
// so redo it when it changes.
//
// However avoid doing it when we're called from wxWindow::Create() in
// wxGTK as the derived window is not fully created yet and calling its
// SetSize() may be unexpected. This does mean that any future calls to
// SetLayoutDirection(wxLayout_Default) wouldn't result in a re-layout
// neither, but then we're not supposed to be called with it at all.
if ( dir != wxLayout_Default )
this->SetSize(-1, -1, -1, -1, wxSIZE_FORCE);
}
#if wxUSE_TOOLTIPS
virtual void DoSetToolTipText(const wxString &tip) wxOVERRIDE
{
BaseWindowClass::DoSetToolTipText(tip);
// Use a variable to disambiguate between SetToolTip() overloads.
void (wxWindowBase::*func)(const wxString&) = &wxWindowBase::SetToolTip;
SetForAllParts(func, tip);
}
virtual void DoSetToolTip(wxToolTip *tip) wxOVERRIDE
{
BaseWindowClass::DoSetToolTip(tip);
SetForAllParts(&wxWindowBase::CopyToolTip, tip);
}
#endif // wxUSE_TOOLTIPS
protected:
// Trivial but necessary default ctor.
wxCompositeWindowSettersOnly()
{
}
private:
// Must be implemented by the derived class to return all children to which
// the public methods we override should forward to.
virtual wxWindowList GetCompositeWindowParts() const = 0;
template <class T, class TArg, class R>
void SetForAllParts(R (wxWindowBase::*func)(TArg), T arg)
{
// Simply call the setters for all parts of this composite window.
const wxWindowList parts = GetCompositeWindowParts();
for ( wxWindowList::const_iterator i = parts.begin();
i != parts.end();
++i )
{
wxWindow * const child = *i;
// Allow NULL elements in the list, this makes the code of derived
// composite controls which may have optionally shown children
// simpler and it doesn't cost us much here.
if ( child )
(child->*func)(arg);
}
}
wxDECLARE_NO_COPY_TEMPLATE_CLASS(wxCompositeWindowSettersOnly, W);
};
// The real wxCompositeWindow itself, inheriting all the setters defined above.
template <class W>
class wxCompositeWindow : public wxCompositeWindowSettersOnly<W>
{
public:
virtual void SetFocus() wxOVERRIDE
{
wxSetFocusToChild(this, NULL);
}
protected:
// Default ctor sets things up for handling children events correctly.
wxCompositeWindow()
{
this->Bind(wxEVT_CREATE, &wxCompositeWindow::OnWindowCreate, this);
}
private:
void OnWindowCreate(wxWindowCreateEvent& event)
{
event.Skip();
// Attach a few event handlers to all parts of the composite window.
// This makes the composite window behave more like a simple control
// and allows other code (such as wxDataViewCtrl's inline editing
// support) to hook into its event processing.
wxWindow *child = event.GetWindow();
// Check that it's one of our children: it could also be this window
// itself (for which we don't need to handle focus at all) or one of
// its grandchildren and we don't want to bind to those as child
// controls are supposed to be well-behaved and get their own focus
// event if any of their children get focus anyhow, so binding to them
// would only result in duplicate events.
//
// Notice that we can't use GetCompositeWindowParts() here because the
// member variables that are typically used in its implementation in
// the derived classes would typically not be initialized yet, as this
// event is generated by "m_child = new wxChildControl(this, ...)" code
// before "m_child" is assigned.
if ( child->GetParent() != this )
return;
child->Bind(wxEVT_SET_FOCUS, &wxCompositeWindow::OnSetFocus, this);
child->Bind(wxEVT_KILL_FOCUS, &wxCompositeWindow::OnKillFocus, this);
// Some events should be only handled for non-toplevel children. For
// example, we want to close the control in wxDataViewCtrl when Enter
// is pressed in the inline editor, but not when it's pressed in a
// popup dialog it opens.
wxWindow *win = child;
while ( win && win != this )
{
if ( win->IsTopLevel() )
return;
win = win->GetParent();
}
child->Bind(wxEVT_CHAR, &wxCompositeWindow::OnChar, this);
}
void OnChar(wxKeyEvent& event)
{
if ( !this->ProcessWindowEvent(event) )
event.Skip();
}
void OnSetFocus(wxFocusEvent& event)
{
event.Skip();
// When a child of a composite window gains focus, the entire composite
// focus gains focus as well -- unless it had it already.
//
// We suppose that we hadn't had focus if the event doesn't carry the
// previously focused window as it normally means that it comes from
// outside of this program.
wxWindow* const oldFocus = event.GetWindow();
if ( !oldFocus || oldFocus->GetMainWindowOfCompositeControl() != this )
{
wxFocusEvent eventThis(wxEVT_SET_FOCUS, this->GetId());
eventThis.SetEventObject(this);
eventThis.SetWindow(event.GetWindow());
this->ProcessWindowEvent(eventThis);
}
}
void OnKillFocus(wxFocusEvent& event)
{
// Ignore focus changes within the composite control:
wxWindow *win = event.GetWindow();
while ( win )
{
if ( win == this )
{
event.Skip();
return;
}
// Note that we don't use IsTopLevel() check here, because we do
// want to ignore focus changes going to toplevel window that have
// the composite control as its parent; these would typically be
// some kind of control's popup window.
win = win->GetParent();
}
// The event shouldn't be ignored, forward it to the main control:
if ( !this->ProcessWindowEvent(event) )
event.Skip();
}
wxDECLARE_NO_COPY_TEMPLATE_CLASS(wxCompositeWindow, W);
};
#endif // _WX_COMPOSITEWIN_H_
| h |
rticonnextdds-usecases | data/projects/rticonnextdds-usecases/VehicleTracking/ExampleCode/thirdparty/wxWidgets-3.1.2/Win64/include/wx/geometry.h | /////////////////////////////////////////////////////////////////////////////
// Name: wx/geometry.h
// Purpose: Common Geometry Classes
// Author: Stefan Csomor
// Modified by:
// Created: 08/05/99
// Copyright: (c) 1999 Stefan Csomor
// Licence: wxWindows licence
/////////////////////////////////////////////////////////////////////////////
#ifndef _WX_GEOMETRY_H_
#define _WX_GEOMETRY_H_
#include "wx/defs.h"
#if wxUSE_GEOMETRY
#include "wx/utils.h"
#include "wx/gdicmn.h"
#include "wx/math.h"
class WXDLLIMPEXP_FWD_BASE wxDataInputStream;
class WXDLLIMPEXP_FWD_BASE wxDataOutputStream;
// clipping from Cohen-Sutherland
enum wxOutCode
{
wxInside = 0x00 ,
wxOutLeft = 0x01 ,
wxOutRight = 0x02 ,
wxOutTop = 0x08 ,
wxOutBottom = 0x04
};
class WXDLLIMPEXP_CORE wxPoint2DInt
{
public :
inline wxPoint2DInt();
inline wxPoint2DInt( wxInt32 x , wxInt32 y );
inline wxPoint2DInt( const wxPoint2DInt &pt );
inline wxPoint2DInt( const wxPoint &pt );
// noops for this class, just return the coords
inline void GetFloor( wxInt32 *x , wxInt32 *y ) const;
inline void GetRounded( wxInt32 *x , wxInt32 *y ) const;
inline wxDouble GetVectorLength() const;
wxDouble GetVectorAngle() const;
inline void SetVectorLength( wxDouble length );
void SetVectorAngle( wxDouble degrees );
// set the vector length to 1.0, preserving the angle
inline void Normalize();
inline wxDouble GetDistance( const wxPoint2DInt &pt ) const;
inline wxDouble GetDistanceSquare( const wxPoint2DInt &pt ) const;
inline wxInt32 GetDotProduct( const wxPoint2DInt &vec ) const;
inline wxInt32 GetCrossProduct( const wxPoint2DInt &vec ) const;
// the reflection of this point
inline wxPoint2DInt operator-();
inline wxPoint2DInt& operator=(const wxPoint2DInt& pt);
inline wxPoint2DInt& operator+=(const wxPoint2DInt& pt);
inline wxPoint2DInt& operator-=(const wxPoint2DInt& pt);
inline wxPoint2DInt& operator*=(const wxPoint2DInt& pt);
inline wxPoint2DInt& operator*=(wxDouble n);
inline wxPoint2DInt& operator*=(wxInt32 n);
inline wxPoint2DInt& operator/=(const wxPoint2DInt& pt);
inline wxPoint2DInt& operator/=(wxDouble n);
inline wxPoint2DInt& operator/=(wxInt32 n);
inline operator wxPoint() const;
inline bool operator==(const wxPoint2DInt& pt) const;
inline bool operator!=(const wxPoint2DInt& pt) const;
#if wxUSE_STREAMS
void WriteTo( wxDataOutputStream &stream ) const;
void ReadFrom( wxDataInputStream &stream );
#endif // wxUSE_STREAMS
wxInt32 m_x;
wxInt32 m_y;
};
inline wxPoint2DInt operator+(const wxPoint2DInt& pt1 , const wxPoint2DInt& pt2);
inline wxPoint2DInt operator-(const wxPoint2DInt& pt1 , const wxPoint2DInt& pt2);
inline wxPoint2DInt operator*(const wxPoint2DInt& pt1 , const wxPoint2DInt& pt2);
inline wxPoint2DInt operator*(wxInt32 n , const wxPoint2DInt& pt);
inline wxPoint2DInt operator*(wxDouble n , const wxPoint2DInt& pt);
inline wxPoint2DInt operator*(const wxPoint2DInt& pt , wxInt32 n);
inline wxPoint2DInt operator*(const wxPoint2DInt& pt , wxDouble n);
inline wxPoint2DInt operator/(const wxPoint2DInt& pt1 , const wxPoint2DInt& pt2);
inline wxPoint2DInt operator/(const wxPoint2DInt& pt , wxInt32 n);
inline wxPoint2DInt operator/(const wxPoint2DInt& pt , wxDouble n);
inline wxPoint2DInt::wxPoint2DInt()
{
m_x = 0;
m_y = 0;
}
inline wxPoint2DInt::wxPoint2DInt( wxInt32 x , wxInt32 y )
{
m_x = x;
m_y = y;
}
inline wxPoint2DInt::wxPoint2DInt( const wxPoint2DInt &pt )
{
m_x = pt.m_x;
m_y = pt.m_y;
}
inline wxPoint2DInt::wxPoint2DInt( const wxPoint &pt )
{
m_x = pt.x;
m_y = pt.y;
}
inline void wxPoint2DInt::GetFloor( wxInt32 *x , wxInt32 *y ) const
{
if ( x )
*x = m_x;
if ( y )
*y = m_y;
}
inline void wxPoint2DInt::GetRounded( wxInt32 *x , wxInt32 *y ) const
{
GetFloor(x, y);
}
inline wxDouble wxPoint2DInt::GetVectorLength() const
{
// cast needed MIPSpro compiler under SGI
return sqrt( (double)(m_x)*(m_x) + (m_y)*(m_y) );
}
inline void wxPoint2DInt::SetVectorLength( wxDouble length )
{
wxDouble before = GetVectorLength();
m_x = (wxInt32)(m_x * length / before);
m_y = (wxInt32)(m_y * length / before);
}
inline void wxPoint2DInt::Normalize()
{
SetVectorLength( 1 );
}
inline wxDouble wxPoint2DInt::GetDistance( const wxPoint2DInt &pt ) const
{
return sqrt( GetDistanceSquare( pt ) );
}
inline wxDouble wxPoint2DInt::GetDistanceSquare( const wxPoint2DInt &pt ) const
{
return ( (pt.m_x-m_x)*(pt.m_x-m_x) + (pt.m_y-m_y)*(pt.m_y-m_y) );
}
inline wxInt32 wxPoint2DInt::GetDotProduct( const wxPoint2DInt &vec ) const
{
return ( m_x * vec.m_x + m_y * vec.m_y );
}
inline wxInt32 wxPoint2DInt::GetCrossProduct( const wxPoint2DInt &vec ) const
{
return ( m_x * vec.m_y - vec.m_x * m_y );
}
inline wxPoint2DInt::operator wxPoint() const
{
return wxPoint( m_x, m_y);
}
inline wxPoint2DInt wxPoint2DInt::operator-()
{
return wxPoint2DInt( -m_x, -m_y);
}
inline wxPoint2DInt& wxPoint2DInt::operator=(const wxPoint2DInt& pt)
{
if (this != &pt)
{
m_x = pt.m_x;
m_y = pt.m_y;
}
return *this;
}
inline wxPoint2DInt& wxPoint2DInt::operator+=(const wxPoint2DInt& pt)
{
m_x = m_x + pt.m_x;
m_y = m_y + pt.m_y;
return *this;
}
inline wxPoint2DInt& wxPoint2DInt::operator-=(const wxPoint2DInt& pt)
{
m_x = m_x - pt.m_x;
m_y = m_y - pt.m_y;
return *this;
}
inline wxPoint2DInt& wxPoint2DInt::operator*=(const wxPoint2DInt& pt)
{
m_x = m_x * pt.m_x;
m_y = m_y * pt.m_y;
return *this;
}
inline wxPoint2DInt& wxPoint2DInt::operator/=(const wxPoint2DInt& pt)
{
m_x = m_x / pt.m_x;
m_y = m_y / pt.m_y;
return *this;
}
inline bool wxPoint2DInt::operator==(const wxPoint2DInt& pt) const
{
return m_x == pt.m_x && m_y == pt.m_y;
}
inline bool wxPoint2DInt::operator!=(const wxPoint2DInt& pt) const
{
return m_x != pt.m_x || m_y != pt.m_y;
}
inline wxPoint2DInt operator+(const wxPoint2DInt& pt1 , const wxPoint2DInt& pt2)
{
return wxPoint2DInt( pt1.m_x + pt2.m_x , pt1.m_y + pt2.m_y );
}
inline wxPoint2DInt operator-(const wxPoint2DInt& pt1 , const wxPoint2DInt& pt2)
{
return wxPoint2DInt( pt1.m_x - pt2.m_x , pt1.m_y - pt2.m_y );
}
inline wxPoint2DInt operator*(const wxPoint2DInt& pt1 , const wxPoint2DInt& pt2)
{
return wxPoint2DInt( pt1.m_x * pt2.m_x , pt1.m_y * pt2.m_y );
}
inline wxPoint2DInt operator*(wxInt32 n , const wxPoint2DInt& pt)
{
return wxPoint2DInt( pt.m_x * n , pt.m_y * n );
}
inline wxPoint2DInt operator*(wxDouble n , const wxPoint2DInt& pt)
{
return wxPoint2DInt( static_cast<wxInt32>(pt.m_x * n) ,
static_cast<wxInt32>(pt.m_y * n) );
}
inline wxPoint2DInt operator*(const wxPoint2DInt& pt , wxInt32 n)
{
return wxPoint2DInt( pt.m_x * n , pt.m_y * n );
}
inline wxPoint2DInt operator*(const wxPoint2DInt& pt , wxDouble n)
{
return wxPoint2DInt( static_cast<wxInt32>(pt.m_x * n) ,
static_cast<wxInt32>(pt.m_y * n) );
}
inline wxPoint2DInt operator/(const wxPoint2DInt& pt1 , const wxPoint2DInt& pt2)
{
return wxPoint2DInt( pt1.m_x / pt2.m_x , pt1.m_y / pt2.m_y );
}
inline wxPoint2DInt operator/(const wxPoint2DInt& pt , wxInt32 n)
{
return wxPoint2DInt( pt.m_x / n , pt.m_y / n );
}
inline wxPoint2DInt operator/(const wxPoint2DInt& pt , wxDouble n)
{
return wxPoint2DInt( static_cast<wxInt32>(pt.m_x / n) ,
static_cast<wxInt32>(pt.m_y / n) );
}
// wxPoint2Ds represent a point or a vector in a 2d coordinate system
class WXDLLIMPEXP_CORE wxPoint2DDouble
{
public :
inline wxPoint2DDouble();
inline wxPoint2DDouble( wxDouble x , wxDouble y );
inline wxPoint2DDouble( const wxPoint2DDouble &pt );
wxPoint2DDouble( const wxPoint2DInt &pt )
{ m_x = (wxDouble) pt.m_x ; m_y = (wxDouble) pt.m_y ; }
wxPoint2DDouble( const wxPoint &pt )
{ m_x = (wxDouble) pt.x ; m_y = (wxDouble) pt.y ; }
// two different conversions to integers, floor and rounding
inline void GetFloor( wxInt32 *x , wxInt32 *y ) const;
inline void GetRounded( wxInt32 *x , wxInt32 *y ) const;
inline wxDouble GetVectorLength() const;
wxDouble GetVectorAngle() const ;
void SetVectorLength( wxDouble length );
void SetVectorAngle( wxDouble degrees );
// set the vector length to 1.0, preserving the angle
void Normalize();
inline wxDouble GetDistance( const wxPoint2DDouble &pt ) const;
inline wxDouble GetDistanceSquare( const wxPoint2DDouble &pt ) const;
inline wxDouble GetDotProduct( const wxPoint2DDouble &vec ) const;
inline wxDouble GetCrossProduct( const wxPoint2DDouble &vec ) const;
// the reflection of this point
inline wxPoint2DDouble operator-();
inline wxPoint2DDouble& operator=(const wxPoint2DDouble& pt);
inline wxPoint2DDouble& operator+=(const wxPoint2DDouble& pt);
inline wxPoint2DDouble& operator-=(const wxPoint2DDouble& pt);
inline wxPoint2DDouble& operator*=(const wxPoint2DDouble& pt);
inline wxPoint2DDouble& operator*=(wxDouble n);
inline wxPoint2DDouble& operator*=(wxInt32 n);
inline wxPoint2DDouble& operator/=(const wxPoint2DDouble& pt);
inline wxPoint2DDouble& operator/=(wxDouble n);
inline wxPoint2DDouble& operator/=(wxInt32 n);
inline bool operator==(const wxPoint2DDouble& pt) const;
inline bool operator!=(const wxPoint2DDouble& pt) const;
wxDouble m_x;
wxDouble m_y;
};
inline wxPoint2DDouble operator+(const wxPoint2DDouble& pt1 , const wxPoint2DDouble& pt2);
inline wxPoint2DDouble operator-(const wxPoint2DDouble& pt1 , const wxPoint2DDouble& pt2);
inline wxPoint2DDouble operator*(const wxPoint2DDouble& pt1 , const wxPoint2DDouble& pt2);
inline wxPoint2DDouble operator*(wxDouble n , const wxPoint2DDouble& pt);
inline wxPoint2DDouble operator*(wxInt32 n , const wxPoint2DDouble& pt);
inline wxPoint2DDouble operator*(const wxPoint2DDouble& pt , wxDouble n);
inline wxPoint2DDouble operator*(const wxPoint2DDouble& pt , wxInt32 n);
inline wxPoint2DDouble operator/(const wxPoint2DDouble& pt1 , const wxPoint2DDouble& pt2);
inline wxPoint2DDouble operator/(const wxPoint2DDouble& pt , wxDouble n);
inline wxPoint2DDouble operator/(const wxPoint2DDouble& pt , wxInt32 n);
inline wxPoint2DDouble::wxPoint2DDouble()
{
m_x = 0.0;
m_y = 0.0;
}
inline wxPoint2DDouble::wxPoint2DDouble( wxDouble x , wxDouble y )
{
m_x = x;
m_y = y;
}
inline wxPoint2DDouble::wxPoint2DDouble( const wxPoint2DDouble &pt )
{
m_x = pt.m_x;
m_y = pt.m_y;
}
inline void wxPoint2DDouble::GetFloor( wxInt32 *x , wxInt32 *y ) const
{
*x = (wxInt32) floor( m_x );
*y = (wxInt32) floor( m_y );
}
inline void wxPoint2DDouble::GetRounded( wxInt32 *x , wxInt32 *y ) const
{
*x = (wxInt32) floor( m_x + 0.5 );
*y = (wxInt32) floor( m_y + 0.5);
}
inline wxDouble wxPoint2DDouble::GetVectorLength() const
{
return sqrt( (m_x)*(m_x) + (m_y)*(m_y) ) ;
}
inline void wxPoint2DDouble::SetVectorLength( wxDouble length )
{
wxDouble before = GetVectorLength() ;
m_x = (m_x * length / before) ;
m_y = (m_y * length / before) ;
}
inline void wxPoint2DDouble::Normalize()
{
SetVectorLength( 1 );
}
inline wxDouble wxPoint2DDouble::GetDistance( const wxPoint2DDouble &pt ) const
{
return sqrt( GetDistanceSquare( pt ) );
}
inline wxDouble wxPoint2DDouble::GetDistanceSquare( const wxPoint2DDouble &pt ) const
{
return ( (pt.m_x-m_x)*(pt.m_x-m_x) + (pt.m_y-m_y)*(pt.m_y-m_y) );
}
inline wxDouble wxPoint2DDouble::GetDotProduct( const wxPoint2DDouble &vec ) const
{
return ( m_x * vec.m_x + m_y * vec.m_y );
}
inline wxDouble wxPoint2DDouble::GetCrossProduct( const wxPoint2DDouble &vec ) const
{
return ( m_x * vec.m_y - vec.m_x * m_y );
}
inline wxPoint2DDouble wxPoint2DDouble::operator-()
{
return wxPoint2DDouble( -m_x, -m_y);
}
inline wxPoint2DDouble& wxPoint2DDouble::operator=(const wxPoint2DDouble& pt)
{
if (this != &pt)
{
m_x = pt.m_x;
m_y = pt.m_y;
}
return *this;
}
inline wxPoint2DDouble& wxPoint2DDouble::operator+=(const wxPoint2DDouble& pt)
{
m_x = m_x + pt.m_x;
m_y = m_y + pt.m_y;
return *this;
}
inline wxPoint2DDouble& wxPoint2DDouble::operator-=(const wxPoint2DDouble& pt)
{
m_x = m_x - pt.m_x;
m_y = m_y - pt.m_y;
return *this;
}
inline wxPoint2DDouble& wxPoint2DDouble::operator*=(const wxPoint2DDouble& pt)
{
m_x = m_x * pt.m_x;
m_y = m_y * pt.m_y;
return *this;
}
inline wxPoint2DDouble& wxPoint2DDouble::operator/=(const wxPoint2DDouble& pt)
{
m_x = m_x / pt.m_x;
m_y = m_y / pt.m_y;
return *this;
}
inline bool wxPoint2DDouble::operator==(const wxPoint2DDouble& pt) const
{
return wxIsSameDouble(m_x, pt.m_x) && wxIsSameDouble(m_y, pt.m_y);
}
inline bool wxPoint2DDouble::operator!=(const wxPoint2DDouble& pt) const
{
return !(*this == pt);
}
inline wxPoint2DDouble operator+(const wxPoint2DDouble& pt1 , const wxPoint2DDouble& pt2)
{
return wxPoint2DDouble( pt1.m_x + pt2.m_x , pt1.m_y + pt2.m_y );
}
inline wxPoint2DDouble operator-(const wxPoint2DDouble& pt1 , const wxPoint2DDouble& pt2)
{
return wxPoint2DDouble( pt1.m_x - pt2.m_x , pt1.m_y - pt2.m_y );
}
inline wxPoint2DDouble operator*(const wxPoint2DDouble& pt1 , const wxPoint2DDouble& pt2)
{
return wxPoint2DDouble( pt1.m_x * pt2.m_x , pt1.m_y * pt2.m_y );
}
inline wxPoint2DDouble operator*(wxDouble n , const wxPoint2DDouble& pt)
{
return wxPoint2DDouble( pt.m_x * n , pt.m_y * n );
}
inline wxPoint2DDouble operator*(wxInt32 n , const wxPoint2DDouble& pt)
{
return wxPoint2DDouble( pt.m_x * n , pt.m_y * n );
}
inline wxPoint2DDouble operator*(const wxPoint2DDouble& pt , wxDouble n)
{
return wxPoint2DDouble( pt.m_x * n , pt.m_y * n );
}
inline wxPoint2DDouble operator*(const wxPoint2DDouble& pt , wxInt32 n)
{
return wxPoint2DDouble( pt.m_x * n , pt.m_y * n );
}
inline wxPoint2DDouble operator/(const wxPoint2DDouble& pt1 , const wxPoint2DDouble& pt2)
{
return wxPoint2DDouble( pt1.m_x / pt2.m_x , pt1.m_y / pt2.m_y );
}
inline wxPoint2DDouble operator/(const wxPoint2DDouble& pt , wxDouble n)
{
return wxPoint2DDouble( pt.m_x / n , pt.m_y / n );
}
inline wxPoint2DDouble operator/(const wxPoint2DDouble& pt , wxInt32 n)
{
return wxPoint2DDouble( pt.m_x / n , pt.m_y / n );
}
// wxRect2Ds are a axis-aligned rectangles, each side of the rect is parallel to the x- or m_y- axis. The rectangle is either defined by the
// top left and bottom right corner, or by the top left corner and size. A point is contained within the rectangle if
// left <= x < right and top <= m_y < bottom , thus it is a half open interval.
class WXDLLIMPEXP_CORE wxRect2DDouble
{
public:
wxRect2DDouble()
{ m_x = m_y = m_width = m_height = 0; }
wxRect2DDouble(wxDouble x, wxDouble y, wxDouble w, wxDouble h)
{ m_x = x; m_y = y; m_width = w; m_height = h; }
/*
wxRect2DDouble(const wxPoint2DDouble& topLeft, const wxPoint2DDouble& bottomRight);
wxRect2DDouble(const wxPoint2DDouble& pos, const wxSize& size);
wxRect2DDouble(const wxRect2DDouble& rect);
*/
// single attribute accessors
wxPoint2DDouble GetPosition() const
{ return wxPoint2DDouble(m_x, m_y); }
wxSize GetSize() const
{ return wxSize((int) m_width, (int) m_height); }
// for the edge and corner accessors there are two setters counterparts, the Set.. functions keep the other corners at their
// position whenever sensible, the Move.. functions keep the size of the rect and move the other corners appropriately
inline wxDouble GetLeft() const { return m_x; }
inline void SetLeft( wxDouble n ) { m_width += m_x - n; m_x = n; }
inline void MoveLeftTo( wxDouble n ) { m_x = n; }
inline wxDouble GetTop() const { return m_y; }
inline void SetTop( wxDouble n ) { m_height += m_y - n; m_y = n; }
inline void MoveTopTo( wxDouble n ) { m_y = n; }
inline wxDouble GetBottom() const { return m_y + m_height; }
inline void SetBottom( wxDouble n ) { m_height += n - (m_y+m_height);}
inline void MoveBottomTo( wxDouble n ) { m_y = n - m_height; }
inline wxDouble GetRight() const { return m_x + m_width; }
inline void SetRight( wxDouble n ) { m_width += n - (m_x+m_width) ; }
inline void MoveRightTo( wxDouble n ) { m_x = n - m_width; }
inline wxPoint2DDouble GetLeftTop() const
{ return wxPoint2DDouble( m_x , m_y ); }
inline void SetLeftTop( const wxPoint2DDouble &pt )
{ m_width += m_x - pt.m_x; m_height += m_y - pt.m_y; m_x = pt.m_x; m_y = pt.m_y; }
inline void MoveLeftTopTo( const wxPoint2DDouble &pt )
{ m_x = pt.m_x; m_y = pt.m_y; }
inline wxPoint2DDouble GetLeftBottom() const
{ return wxPoint2DDouble( m_x , m_y + m_height ); }
inline void SetLeftBottom( const wxPoint2DDouble &pt )
{ m_width += m_x - pt.m_x; m_height += pt.m_y - (m_y+m_height) ; m_x = pt.m_x; }
inline void MoveLeftBottomTo( const wxPoint2DDouble &pt )
{ m_x = pt.m_x; m_y = pt.m_y - m_height; }
inline wxPoint2DDouble GetRightTop() const
{ return wxPoint2DDouble( m_x+m_width , m_y ); }
inline void SetRightTop( const wxPoint2DDouble &pt )
{ m_width += pt.m_x - ( m_x + m_width ); m_height += m_y - pt.m_y; m_y = pt.m_y; }
inline void MoveRightTopTo( const wxPoint2DDouble &pt )
{ m_x = pt.m_x - m_width; m_y = pt.m_y; }
inline wxPoint2DDouble GetRightBottom() const
{ return wxPoint2DDouble( m_x+m_width , m_y + m_height ); }
inline void SetRightBottom( const wxPoint2DDouble &pt )
{ m_width += pt.m_x - ( m_x + m_width ); m_height += pt.m_y - (m_y+m_height);}
inline void MoveRightBottomTo( const wxPoint2DDouble &pt )
{ m_x = pt.m_x - m_width; m_y = pt.m_y - m_height; }
inline wxPoint2DDouble GetCentre() const
{ return wxPoint2DDouble( m_x+m_width/2 , m_y+m_height/2 ); }
inline void SetCentre( const wxPoint2DDouble &pt )
{ MoveCentreTo( pt ); } // since this is impossible without moving...
inline void MoveCentreTo( const wxPoint2DDouble &pt )
{ m_x += pt.m_x - (m_x+m_width/2); m_y += pt.m_y -(m_y+m_height/2); }
inline wxOutCode GetOutCode( const wxPoint2DDouble &pt ) const
{ return (wxOutCode) (( ( pt.m_x < m_x ) ? wxOutLeft : 0 ) +
( ( pt.m_x > m_x + m_width ) ? wxOutRight : 0 ) +
( ( pt.m_y < m_y ) ? wxOutTop : 0 ) +
( ( pt.m_y > m_y + m_height ) ? wxOutBottom : 0 )); }
inline wxOutCode GetOutcode(const wxPoint2DDouble &pt) const
{ return GetOutCode(pt) ; }
inline bool Contains( const wxPoint2DDouble &pt ) const
{ return GetOutCode( pt ) == wxInside; }
inline bool Contains( const wxRect2DDouble &rect ) const
{ return ( ( ( m_x <= rect.m_x ) && ( rect.m_x + rect.m_width <= m_x + m_width ) ) &&
( ( m_y <= rect.m_y ) && ( rect.m_y + rect.m_height <= m_y + m_height ) ) ); }
inline bool IsEmpty() const
{ return m_width <= 0 || m_height <= 0; }
inline bool HaveEqualSize( const wxRect2DDouble &rect ) const
{ return wxIsSameDouble(rect.m_width, m_width) && wxIsSameDouble(rect.m_height, m_height); }
inline void Inset( wxDouble x , wxDouble y )
{ m_x += x; m_y += y; m_width -= 2 * x; m_height -= 2 * y; }
inline void Inset( wxDouble left , wxDouble top ,wxDouble right , wxDouble bottom )
{ m_x += left; m_y += top; m_width -= left + right; m_height -= top + bottom;}
inline void Offset( const wxPoint2DDouble &pt )
{ m_x += pt.m_x; m_y += pt.m_y; }
void ConstrainTo( const wxRect2DDouble &rect );
inline wxPoint2DDouble Interpolate( wxInt32 widthfactor , wxInt32 heightfactor )
{ return wxPoint2DDouble( m_x + m_width * widthfactor , m_y + m_height * heightfactor ); }
static void Intersect( const wxRect2DDouble &src1 , const wxRect2DDouble &src2 , wxRect2DDouble *dest );
inline void Intersect( const wxRect2DDouble &otherRect )
{ Intersect( *this , otherRect , this ); }
inline wxRect2DDouble CreateIntersection( const wxRect2DDouble &otherRect ) const
{ wxRect2DDouble result; Intersect( *this , otherRect , &result); return result; }
bool Intersects( const wxRect2DDouble &rect ) const;
static void Union( const wxRect2DDouble &src1 , const wxRect2DDouble &src2 , wxRect2DDouble *dest );
void Union( const wxRect2DDouble &otherRect )
{ Union( *this , otherRect , this ); }
void Union( const wxPoint2DDouble &pt );
inline wxRect2DDouble CreateUnion( const wxRect2DDouble &otherRect ) const
{ wxRect2DDouble result; Union( *this , otherRect , &result); return result; }
inline void Scale( wxDouble f )
{ m_x *= f; m_y *= f; m_width *= f; m_height *= f;}
inline void Scale( wxInt32 num , wxInt32 denum )
{ m_x *= ((wxDouble)num)/((wxDouble)denum); m_y *= ((wxDouble)num)/((wxDouble)denum);
m_width *= ((wxDouble)num)/((wxDouble)denum); m_height *= ((wxDouble)num)/((wxDouble)denum);}
wxRect2DDouble& operator = (const wxRect2DDouble& rect);
inline bool operator == (const wxRect2DDouble& rect) const
{ return wxIsSameDouble(m_x, rect.m_x) && wxIsSameDouble(m_y, rect.m_y) && HaveEqualSize(rect); }
inline bool operator != (const wxRect2DDouble& rect) const
{ return !(*this == rect); }
wxDouble m_x;
wxDouble m_y;
wxDouble m_width;
wxDouble m_height;
};
// wxRect2Ds are a axis-aligned rectangles, each side of the rect is parallel to the x- or m_y- axis. The rectangle is either defined by the
// top left and bottom right corner, or by the top left corner and size. A point is contained within the rectangle if
// left <= x < right and top <= m_y < bottom , thus it is a half open interval.
class WXDLLIMPEXP_CORE wxRect2DInt
{
public:
wxRect2DInt() { m_x = m_y = m_width = m_height = 0; }
wxRect2DInt( const wxRect& r ) { m_x = r.x ; m_y = r.y ; m_width = r.width ; m_height = r.height ; }
wxRect2DInt(wxInt32 x, wxInt32 y, wxInt32 w, wxInt32 h) { m_x = x; m_y = y; m_width = w; m_height = h; }
wxRect2DInt(const wxPoint2DInt& topLeft, const wxPoint2DInt& bottomRight);
inline wxRect2DInt(const wxPoint2DInt& pos, const wxSize& size);
inline wxRect2DInt(const wxRect2DInt& rect);
// single attribute accessors
wxPoint2DInt GetPosition() const { return wxPoint2DInt(m_x, m_y); }
wxSize GetSize() const { return wxSize(m_width, m_height); }
// for the edge and corner accessors there are two setters counterparts, the Set.. functions keep the other corners at their
// position whenever sensible, the Move.. functions keep the size of the rect and move the other corners appropriately
inline wxInt32 GetLeft() const { return m_x; }
inline void SetLeft( wxInt32 n ) { m_width += m_x - n; m_x = n; }
inline void MoveLeftTo( wxInt32 n ) { m_x = n; }
inline wxInt32 GetTop() const { return m_y; }
inline void SetTop( wxInt32 n ) { m_height += m_y - n; m_y = n; }
inline void MoveTopTo( wxInt32 n ) { m_y = n; }
inline wxInt32 GetBottom() const { return m_y + m_height; }
inline void SetBottom( wxInt32 n ) { m_height += n - (m_y+m_height);}
inline void MoveBottomTo( wxInt32 n ) { m_y = n - m_height; }
inline wxInt32 GetRight() const { return m_x + m_width; }
inline void SetRight( wxInt32 n ) { m_width += n - (m_x+m_width) ; }
inline void MoveRightTo( wxInt32 n ) { m_x = n - m_width; }
inline wxPoint2DInt GetLeftTop() const { return wxPoint2DInt( m_x , m_y ); }
inline void SetLeftTop( const wxPoint2DInt &pt ) { m_width += m_x - pt.m_x; m_height += m_y - pt.m_y; m_x = pt.m_x; m_y = pt.m_y; }
inline void MoveLeftTopTo( const wxPoint2DInt &pt ) { m_x = pt.m_x; m_y = pt.m_y; }
inline wxPoint2DInt GetLeftBottom() const { return wxPoint2DInt( m_x , m_y + m_height ); }
inline void SetLeftBottom( const wxPoint2DInt &pt ) { m_width += m_x - pt.m_x; m_height += pt.m_y - (m_y+m_height) ; m_x = pt.m_x; }
inline void MoveLeftBottomTo( const wxPoint2DInt &pt ) { m_x = pt.m_x; m_y = pt.m_y - m_height; }
inline wxPoint2DInt GetRightTop() const { return wxPoint2DInt( m_x+m_width , m_y ); }
inline void SetRightTop( const wxPoint2DInt &pt ) { m_width += pt.m_x - ( m_x + m_width ); m_height += m_y - pt.m_y; m_y = pt.m_y; }
inline void MoveRightTopTo( const wxPoint2DInt &pt ) { m_x = pt.m_x - m_width; m_y = pt.m_y; }
inline wxPoint2DInt GetRightBottom() const { return wxPoint2DInt( m_x+m_width , m_y + m_height ); }
inline void SetRightBottom( const wxPoint2DInt &pt ) { m_width += pt.m_x - ( m_x + m_width ); m_height += pt.m_y - (m_y+m_height);}
inline void MoveRightBottomTo( const wxPoint2DInt &pt ) { m_x = pt.m_x - m_width; m_y = pt.m_y - m_height; }
inline wxPoint2DInt GetCentre() const { return wxPoint2DInt( m_x+m_width/2 , m_y+m_height/2 ); }
inline void SetCentre( const wxPoint2DInt &pt ) { MoveCentreTo( pt ); } // since this is impossible without moving...
inline void MoveCentreTo( const wxPoint2DInt &pt ) { m_x += pt.m_x - (m_x+m_width/2); m_y += pt.m_y -(m_y+m_height/2); }
inline wxOutCode GetOutCode( const wxPoint2DInt &pt ) const
{ return (wxOutCode) (( ( pt.m_x < m_x ) ? wxOutLeft : 0 ) +
( ( pt.m_x >= m_x + m_width ) ? wxOutRight : 0 ) +
( ( pt.m_y < m_y ) ? wxOutTop : 0 ) +
( ( pt.m_y >= m_y + m_height ) ? wxOutBottom : 0 )); }
inline wxOutCode GetOutcode( const wxPoint2DInt &pt ) const
{ return GetOutCode( pt ) ; }
inline bool Contains( const wxPoint2DInt &pt ) const
{ return GetOutCode( pt ) == wxInside; }
inline bool Contains( const wxRect2DInt &rect ) const
{ return ( ( ( m_x <= rect.m_x ) && ( rect.m_x + rect.m_width <= m_x + m_width ) ) &&
( ( m_y <= rect.m_y ) && ( rect.m_y + rect.m_height <= m_y + m_height ) ) ); }
inline bool IsEmpty() const
{ return ( m_width <= 0 || m_height <= 0 ); }
inline bool HaveEqualSize( const wxRect2DInt &rect ) const
{ return ( rect.m_width == m_width && rect.m_height == m_height ); }
inline void Inset( wxInt32 x , wxInt32 y ) { m_x += x; m_y += y; m_width -= 2 * x; m_height -= 2 * y; }
inline void Inset( wxInt32 left , wxInt32 top ,wxInt32 right , wxInt32 bottom )
{ m_x += left; m_y += top; m_width -= left + right; m_height -= top + bottom;}
inline void Offset( const wxPoint2DInt &pt ) { m_x += pt.m_x; m_y += pt.m_y; }
void ConstrainTo( const wxRect2DInt &rect );
inline wxPoint2DInt Interpolate( wxInt32 widthfactor , wxInt32 heightfactor ) { return wxPoint2DInt( m_x + m_width * widthfactor , m_y + m_height * heightfactor ); }
static void Intersect( const wxRect2DInt &src1 , const wxRect2DInt &src2 , wxRect2DInt *dest );
inline void Intersect( const wxRect2DInt &otherRect ) { Intersect( *this , otherRect , this ); }
inline wxRect2DInt CreateIntersection( const wxRect2DInt &otherRect ) const { wxRect2DInt result; Intersect( *this , otherRect , &result); return result; }
bool Intersects( const wxRect2DInt &rect ) const;
static void Union( const wxRect2DInt &src1 , const wxRect2DInt &src2 , wxRect2DInt *dest );
void Union( const wxRect2DInt &otherRect ) { Union( *this , otherRect , this ); }
void Union( const wxPoint2DInt &pt );
inline wxRect2DInt CreateUnion( const wxRect2DInt &otherRect ) const { wxRect2DInt result; Union( *this , otherRect , &result); return result; }
inline void Scale( wxInt32 f ) { m_x *= f; m_y *= f; m_width *= f; m_height *= f;}
inline void Scale( wxInt32 num , wxInt32 denum )
{ m_x *= ((wxInt32)num)/((wxInt32)denum); m_y *= ((wxInt32)num)/((wxInt32)denum);
m_width *= ((wxInt32)num)/((wxInt32)denum); m_height *= ((wxInt32)num)/((wxInt32)denum);}
wxRect2DInt& operator = (const wxRect2DInt& rect);
bool operator == (const wxRect2DInt& rect) const;
bool operator != (const wxRect2DInt& rect) const;
#if wxUSE_STREAMS
void WriteTo( wxDataOutputStream &stream ) const;
void ReadFrom( wxDataInputStream &stream );
#endif // wxUSE_STREAMS
wxInt32 m_x;
wxInt32 m_y;
wxInt32 m_width;
wxInt32 m_height;
};
inline wxRect2DInt::wxRect2DInt( const wxRect2DInt &r )
{
m_x = r.m_x;
m_y = r.m_y;
m_width = r.m_width;
m_height = r.m_height;
}
inline wxRect2DInt::wxRect2DInt( const wxPoint2DInt &a , const wxPoint2DInt &b)
{
m_x = wxMin( a.m_x , b.m_x );
m_y = wxMin( a.m_y , b.m_y );
m_width = abs( a.m_x - b.m_x );
m_height = abs( a.m_y - b.m_y );
}
inline wxRect2DInt::wxRect2DInt( const wxPoint2DInt& pos, const wxSize& size)
{
m_x = pos.m_x;
m_y = pos.m_y;
m_width = size.x;
m_height = size.y;
}
inline bool wxRect2DInt::operator == (const wxRect2DInt& rect) const
{
return (m_x==rect.m_x && m_y==rect.m_y &&
m_width==rect.m_width && m_height==rect.m_height);
}
inline bool wxRect2DInt::operator != (const wxRect2DInt& rect) const
{
return !(*this == rect);
}
class WXDLLIMPEXP_CORE wxTransform2D
{
public :
virtual ~wxTransform2D() { }
virtual void Transform( wxPoint2DInt* pt )const = 0;
virtual void Transform( wxRect2DInt* r ) const;
virtual wxPoint2DInt Transform( const wxPoint2DInt &pt ) const;
virtual wxRect2DInt Transform( const wxRect2DInt &r ) const ;
virtual void InverseTransform( wxPoint2DInt* pt ) const = 0;
virtual void InverseTransform( wxRect2DInt* r ) const ;
virtual wxPoint2DInt InverseTransform( const wxPoint2DInt &pt ) const ;
virtual wxRect2DInt InverseTransform( const wxRect2DInt &r ) const ;
};
#endif // wxUSE_GEOMETRY
#endif // _WX_GEOMETRY_H_
| h |
rticonnextdds-usecases | data/projects/rticonnextdds-usecases/VehicleTracking/ExampleCode/thirdparty/wxWidgets-3.1.2/Win64/include/wx/timectrl.h | ///////////////////////////////////////////////////////////////////////////////
// Name: wx/timectrl.h
// Purpose: Declaration of wxTimePickerCtrl class.
// Author: Vadim Zeitlin
// Created: 2011-09-22
// Copyright: (c) 2011 Vadim Zeitlin <[email protected]>
// Licence: wxWindows licence
///////////////////////////////////////////////////////////////////////////////
#ifndef _WX_TIMECTRL_H_
#define _WX_TIMECTRL_H_
#include "wx/defs.h"
#if wxUSE_TIMEPICKCTRL
#include "wx/datetimectrl.h"
#define wxTimePickerCtrlNameStr wxS("timectrl")
// No special styles are currently defined for this control but still define a
// symbolic constant for the default style for consistency.
enum
{
wxTP_DEFAULT = 0
};
// ----------------------------------------------------------------------------
// wxTimePickerCtrl: Allow the user to enter the time.
// ----------------------------------------------------------------------------
class WXDLLIMPEXP_ADV wxTimePickerCtrlBase : public wxDateTimePickerCtrl
{
public:
/*
The derived classes should implement ctor and Create() method with the
following signature:
bool Create(wxWindow *parent,
wxWindowID id,
const wxDateTime& dt = wxDefaultDateTime,
const wxPoint& pos = wxDefaultPosition,
const wxSize& size = wxDefaultSize,
long style = wxTP_DEFAULT,
const wxValidator& validator = wxDefaultValidator,
const wxString& name = wxTimePickerCtrlNameStr);
*/
/*
We also inherit Set/GetValue() methods from the base class which define
our public API. Notice that the date portion of the date passed as
input or received as output is or should be ignored, only the time part
of wxDateTime objects is really significant here. Use Set/GetTime()
below for possibly simpler interface.
*/
// Set the given time.
bool SetTime(int hour, int min, int sec)
{
// Notice that we should use a date on which DST doesn't change to
// avoid any problems with time discontinuity so use a fixed date (on
// which nobody changes DST) instead of e.g. today.
wxDateTime dt(1, wxDateTime::Jan, 2012, hour, min, sec);
if ( !dt.IsValid() )
{
// No need to assert here, wxDateTime already does it for us.
return false;
}
SetValue(dt);
return true;
}
// Get the current time components. All pointers must be non-NULL.
bool GetTime(int* hour, int* min, int* sec) const
{
wxCHECK_MSG( hour && min && sec, false,
wxS("Time component pointers must be non-NULL") );
const wxDateTime::Tm tm = GetValue().GetTm();
*hour = tm.hour;
*min = tm.min;
*sec = tm.sec;
return true;
}
};
#if defined(__WXMSW__) && !defined(__WXUNIVERSAL__)
#include "wx/msw/timectrl.h"
#define wxHAS_NATIVE_TIMEPICKERCTRL
#elif defined(__WXOSX_COCOA__) && !defined(__WXUNIVERSAL__)
#include "wx/osx/timectrl.h"
#define wxHAS_NATIVE_TIMEPICKERCTRL
#else
#include "wx/generic/timectrl.h"
class WXDLLIMPEXP_ADV wxTimePickerCtrl : public wxTimePickerCtrlGeneric
{
public:
wxTimePickerCtrl() { }
wxTimePickerCtrl(wxWindow *parent,
wxWindowID id,
const wxDateTime& date = wxDefaultDateTime,
const wxPoint& pos = wxDefaultPosition,
const wxSize& size = wxDefaultSize,
long style = wxTP_DEFAULT,
const wxValidator& validator = wxDefaultValidator,
const wxString& name = wxTimePickerCtrlNameStr)
: wxTimePickerCtrlGeneric(parent, id, date, pos, size, style, validator, name)
{
}
private:
wxDECLARE_DYNAMIC_CLASS_NO_COPY(wxTimePickerCtrl);
};
#endif
#endif // wxUSE_TIMEPICKCTRL
#endif // _WX_TIMECTRL_H_
| h |
rticonnextdds-usecases | data/projects/rticonnextdds-usecases/VehicleTracking/ExampleCode/thirdparty/wxWidgets-3.1.2/Win64/include/wx/filepicker.h | /////////////////////////////////////////////////////////////////////////////
// Name: wx/filepicker.h
// Purpose: wxFilePickerCtrl, wxDirPickerCtrl base header
// Author: Francesco Montorsi
// Modified by:
// Created: 14/4/2006
// Copyright: (c) Francesco Montorsi
// Licence: wxWindows Licence
/////////////////////////////////////////////////////////////////////////////
#ifndef _WX_FILEDIRPICKER_H_BASE_
#define _WX_FILEDIRPICKER_H_BASE_
#include "wx/defs.h"
#if wxUSE_FILEPICKERCTRL || wxUSE_DIRPICKERCTRL
#include "wx/pickerbase.h"
#include "wx/filename.h"
class WXDLLIMPEXP_FWD_CORE wxDialog;
class WXDLLIMPEXP_FWD_CORE wxFileDirPickerEvent;
extern WXDLLIMPEXP_DATA_CORE(const char) wxFilePickerWidgetLabel[];
extern WXDLLIMPEXP_DATA_CORE(const char) wxFilePickerWidgetNameStr[];
extern WXDLLIMPEXP_DATA_CORE(const char) wxFilePickerCtrlNameStr[];
extern WXDLLIMPEXP_DATA_CORE(const char) wxFileSelectorPromptStr[];
extern WXDLLIMPEXP_DATA_CORE(const char) wxDirPickerWidgetLabel[];
extern WXDLLIMPEXP_DATA_CORE(const char) wxDirPickerWidgetNameStr[];
extern WXDLLIMPEXP_DATA_CORE(const char) wxDirPickerCtrlNameStr[];
extern WXDLLIMPEXP_DATA_CORE(const char) wxDirSelectorPromptStr[];
// ----------------------------------------------------------------------------
// wxFileDirPickerEvent: used by wxFilePickerCtrl and wxDirPickerCtrl only
// ----------------------------------------------------------------------------
class WXDLLIMPEXP_CORE wxFileDirPickerEvent : public wxCommandEvent
{
public:
wxFileDirPickerEvent() {}
wxFileDirPickerEvent(wxEventType type, wxObject *generator, int id, const wxString &path)
: wxCommandEvent(type, id),
m_path(path)
{
SetEventObject(generator);
}
wxString GetPath() const { return m_path; }
void SetPath(const wxString &p) { m_path = p; }
// default copy ctor, assignment operator and dtor are ok
virtual wxEvent *Clone() const wxOVERRIDE { return new wxFileDirPickerEvent(*this); }
private:
wxString m_path;
wxDECLARE_DYNAMIC_CLASS_NO_ASSIGN(wxFileDirPickerEvent);
};
wxDECLARE_EXPORTED_EVENT( WXDLLIMPEXP_CORE, wxEVT_FILEPICKER_CHANGED, wxFileDirPickerEvent );
wxDECLARE_EXPORTED_EVENT( WXDLLIMPEXP_CORE, wxEVT_DIRPICKER_CHANGED, wxFileDirPickerEvent );
// ----------------------------------------------------------------------------
// event types and macros
// ----------------------------------------------------------------------------
typedef void (wxEvtHandler::*wxFileDirPickerEventFunction)(wxFileDirPickerEvent&);
#define wxFileDirPickerEventHandler(func) \
wxEVENT_HANDLER_CAST(wxFileDirPickerEventFunction, func)
#define EVT_FILEPICKER_CHANGED(id, fn) \
wx__DECLARE_EVT1(wxEVT_FILEPICKER_CHANGED, id, wxFileDirPickerEventHandler(fn))
#define EVT_DIRPICKER_CHANGED(id, fn) \
wx__DECLARE_EVT1(wxEVT_DIRPICKER_CHANGED, id, wxFileDirPickerEventHandler(fn))
// ----------------------------------------------------------------------------
// wxFileDirPickerWidgetBase: a generic abstract interface which must be
// implemented by controls used by wxFileDirPickerCtrlBase
// ----------------------------------------------------------------------------
class WXDLLIMPEXP_CORE wxFileDirPickerWidgetBase
{
public:
wxFileDirPickerWidgetBase() { }
virtual ~wxFileDirPickerWidgetBase() { }
// Path here is the name of the selected file or directory.
wxString GetPath() const { return m_path; }
virtual void SetPath(const wxString &str) { m_path=str; }
// Set the directory to open the file browse dialog at initially.
virtual void SetInitialDirectory(const wxString& dir) = 0;
// returns the picker widget cast to wxControl
virtual wxControl *AsControl() = 0;
protected:
virtual void UpdateDialogPath(wxDialog *) = 0;
virtual void UpdatePathFromDialog(wxDialog *) = 0;
wxString m_path;
};
// Styles which must be supported by all controls implementing wxFileDirPickerWidgetBase
// NB: these styles must be defined to carefully-chosen values to
// avoid conflicts with wxButton's styles
#define wxFLP_OPEN 0x0400
#define wxFLP_SAVE 0x0800
#define wxFLP_OVERWRITE_PROMPT 0x1000
#define wxFLP_FILE_MUST_EXIST 0x2000
#define wxFLP_CHANGE_DIR 0x4000
#define wxFLP_SMALL wxPB_SMALL
// NOTE: wxMULTIPLE is not supported !
#define wxDIRP_DIR_MUST_EXIST 0x0008
#define wxDIRP_CHANGE_DIR 0x0010
#define wxDIRP_SMALL wxPB_SMALL
// map platform-dependent controls which implement the wxFileDirPickerWidgetBase
// under the name "wxFilePickerWidget" and "wxDirPickerWidget".
// NOTE: wxFileDirPickerCtrlBase will allocate a wx{File|Dir}PickerWidget and this
// requires that all classes being mapped as wx{File|Dir}PickerWidget have the
// same prototype for the contructor...
// since GTK >= 2.6, there is GtkFileButton
#if defined(__WXGTK20__) && !defined(__WXUNIVERSAL__)
#include "wx/gtk/filepicker.h"
#define wxFilePickerWidget wxFileButton
#define wxDirPickerWidget wxDirButton
#else
#include "wx/generic/filepickerg.h"
#define wxFilePickerWidget wxGenericFileButton
#define wxDirPickerWidget wxGenericDirButton
#endif
// ----------------------------------------------------------------------------
// wxFileDirPickerCtrlBase
// ----------------------------------------------------------------------------
class WXDLLIMPEXP_CORE wxFileDirPickerCtrlBase : public wxPickerBase
{
public:
wxFileDirPickerCtrlBase() {}
protected:
// NB: no default values since this function will never be used
// directly by the user and derived classes wouldn't use them
bool CreateBase(wxWindow *parent,
wxWindowID id,
const wxString& path,
const wxString &message,
const wxString &wildcard,
const wxPoint& pos,
const wxSize& size,
long style,
const wxValidator& validator,
const wxString& name);
public: // public API
wxString GetPath() const;
void SetPath(const wxString &str);
// Set the directory to open the file browse dialog at initially.
void SetInitialDirectory(const wxString& dir)
{
m_pickerIface->SetInitialDirectory(dir);
}
public: // internal functions
void UpdatePickerFromTextCtrl() wxOVERRIDE;
void UpdateTextCtrlFromPicker() wxOVERRIDE;
// event handler for our picker
void OnFileDirChange(wxFileDirPickerEvent &);
// TRUE if any textctrl change should update the current working directory
virtual bool IsCwdToUpdate() const = 0;
// Returns the event type sent by this picker
virtual wxEventType GetEventType() const = 0;
virtual void DoConnect( wxControl *sender, wxFileDirPickerCtrlBase *eventSink ) = 0;
// Returns the filtered value currently placed in the text control (if present).
virtual wxString GetTextCtrlValue() const = 0;
protected:
// creates the picker control
virtual
wxFileDirPickerWidgetBase *CreatePicker(wxWindow *parent,
const wxString& path,
const wxString& message,
const wxString& wildcard) = 0;
protected:
// m_picker object as wxFileDirPickerWidgetBase interface
wxFileDirPickerWidgetBase *m_pickerIface;
};
#endif // wxUSE_FILEPICKERCTRL || wxUSE_DIRPICKERCTRL
#if wxUSE_FILEPICKERCTRL
// ----------------------------------------------------------------------------
// wxFilePickerCtrl: platform-independent class which embeds the
// platform-dependent wxFilePickerWidget and, if wxFLP_USE_TEXTCTRL style is
// used, a textctrl next to it.
// ----------------------------------------------------------------------------
#define wxFLP_USE_TEXTCTRL (wxPB_USE_TEXTCTRL)
#ifdef __WXGTK__
// GTK apps usually don't have a textctrl next to the picker
#define wxFLP_DEFAULT_STYLE (wxFLP_OPEN|wxFLP_FILE_MUST_EXIST)
#else
#define wxFLP_DEFAULT_STYLE (wxFLP_USE_TEXTCTRL|wxFLP_OPEN|wxFLP_FILE_MUST_EXIST)
#endif
class WXDLLIMPEXP_CORE wxFilePickerCtrl : public wxFileDirPickerCtrlBase
{
public:
wxFilePickerCtrl() {}
wxFilePickerCtrl(wxWindow *parent,
wxWindowID id,
const wxString& path = wxEmptyString,
const wxString& message = wxFileSelectorPromptStr,
const wxString& wildcard = wxFileSelectorDefaultWildcardStr,
const wxPoint& pos = wxDefaultPosition,
const wxSize& size = wxDefaultSize,
long style = wxFLP_DEFAULT_STYLE,
const wxValidator& validator = wxDefaultValidator,
const wxString& name = wxFilePickerCtrlNameStr)
{
Create(parent, id, path, message, wildcard, pos, size, style,
validator, name);
}
bool Create(wxWindow *parent,
wxWindowID id,
const wxString& path = wxEmptyString,
const wxString& message = wxFileSelectorPromptStr,
const wxString& wildcard = wxFileSelectorDefaultWildcardStr,
const wxPoint& pos = wxDefaultPosition,
const wxSize& size = wxDefaultSize,
long style = wxFLP_DEFAULT_STYLE,
const wxValidator& validator = wxDefaultValidator,
const wxString& name = wxFilePickerCtrlNameStr);
void SetFileName(const wxFileName &filename)
{ SetPath(filename.GetFullPath()); }
wxFileName GetFileName() const
{ return wxFileName(GetPath()); }
public: // overrides
// return the text control value in canonical form
wxString GetTextCtrlValue() const wxOVERRIDE;
bool IsCwdToUpdate() const wxOVERRIDE
{ return HasFlag(wxFLP_CHANGE_DIR); }
wxEventType GetEventType() const wxOVERRIDE
{ return wxEVT_FILEPICKER_CHANGED; }
virtual void DoConnect( wxControl *sender, wxFileDirPickerCtrlBase *eventSink ) wxOVERRIDE
{
sender->Bind(wxEVT_FILEPICKER_CHANGED,
&wxFileDirPickerCtrlBase::OnFileDirChange, eventSink );
}
protected:
virtual
wxFileDirPickerWidgetBase *CreatePicker(wxWindow *parent,
const wxString& path,
const wxString& message,
const wxString& wildcard) wxOVERRIDE
{
return new wxFilePickerWidget(parent, wxID_ANY,
wxGetTranslation(wxFilePickerWidgetLabel),
path, message, wildcard,
wxDefaultPosition, wxDefaultSize,
GetPickerStyle(GetWindowStyle()));
}
// extracts the style for our picker from wxFileDirPickerCtrlBase's style
long GetPickerStyle(long style) const wxOVERRIDE
{
return style & (wxFLP_OPEN |
wxFLP_SAVE |
wxFLP_OVERWRITE_PROMPT |
wxFLP_FILE_MUST_EXIST |
wxFLP_CHANGE_DIR |
wxFLP_USE_TEXTCTRL |
wxFLP_SMALL);
}
private:
wxDECLARE_DYNAMIC_CLASS(wxFilePickerCtrl);
};
#endif // wxUSE_FILEPICKERCTRL
#if wxUSE_DIRPICKERCTRL
// ----------------------------------------------------------------------------
// wxDirPickerCtrl: platform-independent class which embeds the
// platform-dependent wxDirPickerWidget and eventually a textctrl
// (see wxDIRP_USE_TEXTCTRL) next to it.
// ----------------------------------------------------------------------------
#define wxDIRP_USE_TEXTCTRL (wxPB_USE_TEXTCTRL)
#ifdef __WXGTK__
// GTK apps usually don't have a textctrl next to the picker
#define wxDIRP_DEFAULT_STYLE (wxDIRP_DIR_MUST_EXIST)
#else
#define wxDIRP_DEFAULT_STYLE (wxDIRP_USE_TEXTCTRL|wxDIRP_DIR_MUST_EXIST)
#endif
class WXDLLIMPEXP_CORE wxDirPickerCtrl : public wxFileDirPickerCtrlBase
{
public:
wxDirPickerCtrl() {}
wxDirPickerCtrl(wxWindow *parent, wxWindowID id,
const wxString& path = wxEmptyString,
const wxString& message = wxDirSelectorPromptStr,
const wxPoint& pos = wxDefaultPosition,
const wxSize& size = wxDefaultSize,
long style = wxDIRP_DEFAULT_STYLE,
const wxValidator& validator = wxDefaultValidator,
const wxString& name = wxDirPickerCtrlNameStr)
{
Create(parent, id, path, message, pos, size, style, validator, name);
}
bool Create(wxWindow *parent, wxWindowID id,
const wxString& path = wxEmptyString,
const wxString& message = wxDirSelectorPromptStr,
const wxPoint& pos = wxDefaultPosition,
const wxSize& size = wxDefaultSize,
long style = wxDIRP_DEFAULT_STYLE,
const wxValidator& validator = wxDefaultValidator,
const wxString& name = wxDirPickerCtrlNameStr);
void SetDirName(const wxFileName &dirname)
{ SetPath(dirname.GetPath()); }
wxFileName GetDirName() const
{ return wxFileName::DirName(GetPath()); }
public: // overrides
wxString GetTextCtrlValue() const wxOVERRIDE;
bool IsCwdToUpdate() const wxOVERRIDE
{ return HasFlag(wxDIRP_CHANGE_DIR); }
wxEventType GetEventType() const wxOVERRIDE
{ return wxEVT_DIRPICKER_CHANGED; }
virtual void DoConnect( wxControl *sender, wxFileDirPickerCtrlBase *eventSink ) wxOVERRIDE
{
sender->Bind( wxEVT_DIRPICKER_CHANGED,
&wxFileDirPickerCtrlBase::OnFileDirChange, eventSink );
}
protected:
virtual
wxFileDirPickerWidgetBase *CreatePicker(wxWindow *parent,
const wxString& path,
const wxString& message,
const wxString& WXUNUSED(wildcard)) wxOVERRIDE
{
return new wxDirPickerWidget(parent, wxID_ANY,
wxGetTranslation(wxDirPickerWidgetLabel),
path, message,
wxDefaultPosition, wxDefaultSize,
GetPickerStyle(GetWindowStyle()));
}
// extracts the style for our picker from wxFileDirPickerCtrlBase's style
long GetPickerStyle(long style) const wxOVERRIDE
{
return style & (wxDIRP_DIR_MUST_EXIST |
wxDIRP_CHANGE_DIR |
wxDIRP_USE_TEXTCTRL |
wxDIRP_SMALL);
}
private:
wxDECLARE_DYNAMIC_CLASS(wxDirPickerCtrl);
};
#endif // wxUSE_DIRPICKERCTRL
// old wxEVT_COMMAND_* constants
#define wxEVT_COMMAND_FILEPICKER_CHANGED wxEVT_FILEPICKER_CHANGED
#define wxEVT_COMMAND_DIRPICKER_CHANGED wxEVT_DIRPICKER_CHANGED
#endif // _WX_FILEDIRPICKER_H_BASE_
| h |
rticonnextdds-usecases | data/projects/rticonnextdds-usecases/VehicleTracking/ExampleCode/thirdparty/wxWidgets-3.1.2/Win64/include/wx/tglbtn.h | /////////////////////////////////////////////////////////////////////////////
// Name: wx/tglbtn.h
// Purpose: This dummy header includes the proper header file for the
// system we're compiling under.
// Author: John Norris, minor changes by Axel Schlueter
// Modified by:
// Created: 08.02.01
// Copyright: (c) 2000 Johnny C. Norris II
// Licence: wxWindows Licence
/////////////////////////////////////////////////////////////////////////////
#ifndef _WX_TOGGLEBUTTON_H_BASE_
#define _WX_TOGGLEBUTTON_H_BASE_
#include "wx/defs.h"
#if wxUSE_TOGGLEBTN
#include "wx/event.h"
#include "wx/anybutton.h" // base class
extern WXDLLIMPEXP_DATA_CORE(const char) wxCheckBoxNameStr[];
wxDECLARE_EXPORTED_EVENT( WXDLLIMPEXP_CORE, wxEVT_TOGGLEBUTTON, wxCommandEvent );
// ----------------------------------------------------------------------------
// wxToggleButtonBase
// ----------------------------------------------------------------------------
class WXDLLIMPEXP_CORE wxToggleButtonBase : public wxAnyButton
{
public:
wxToggleButtonBase() { }
// Get/set the value
virtual void SetValue(bool state) = 0;
virtual bool GetValue() const = 0;
// The current "normal" state for the toggle button depends upon its value.
virtual State GetNormalState() const wxOVERRIDE
{
return GetValue() ? State_Pressed : State_Normal;
}
void UpdateWindowUI(long flags) wxOVERRIDE
{
wxControl::UpdateWindowUI(flags);
if ( !IsShown() )
return;
wxWindow *tlw = wxGetTopLevelParent( this );
if (tlw && wxPendingDelete.Member( tlw ))
return;
wxUpdateUIEvent event( GetId() );
event.SetEventObject(this);
if (GetEventHandler()->ProcessEvent(event) )
{
if ( event.GetSetChecked() )
SetValue( event.GetChecked() );
}
}
protected:
wxDECLARE_NO_COPY_CLASS(wxToggleButtonBase);
};
#define EVT_TOGGLEBUTTON(id, fn) \
wx__DECLARE_EVT1(wxEVT_TOGGLEBUTTON, id, wxCommandEventHandler(fn))
#if defined(__WXUNIVERSAL__)
#include "wx/univ/tglbtn.h"
#elif defined(__WXMSW__)
#include "wx/msw/tglbtn.h"
#define wxHAS_BITMAPTOGGLEBUTTON
#elif defined(__WXGTK20__)
#include "wx/gtk/tglbtn.h"
#define wxHAS_BITMAPTOGGLEBUTTON
#elif defined(__WXGTK__)
#include "wx/gtk1/tglbtn.h"
# elif defined(__WXMOTIF__)
#include "wx/motif/tglbtn.h"
#elif defined(__WXMAC__)
#include "wx/osx/tglbtn.h"
#define wxHAS_BITMAPTOGGLEBUTTON
#elif defined(__WXQT__)
#include "wx/qt/tglbtn.h"
#endif
// old wxEVT_COMMAND_* constants
#define wxEVT_COMMAND_TOGGLEBUTTON_CLICKED wxEVT_TOGGLEBUTTON
#endif // wxUSE_TOGGLEBTN
#endif // _WX_TOGGLEBUTTON_H_BASE_
| h |
rticonnextdds-usecases | data/projects/rticonnextdds-usecases/VehicleTracking/ExampleCode/thirdparty/wxWidgets-3.1.2/Win64/include/wx/layout.h | /////////////////////////////////////////////////////////////////////////////
// Name: wx/layout.h
// Purpose: OBSOLETE layout constraint classes, use sizers instead
// Author: Julian Smart
// Modified by:
// Created: 29/01/98
// Copyright: (c) 1998 Julian Smart
// Licence: wxWindows licence
/////////////////////////////////////////////////////////////////////////////
#ifndef _WX_LAYOUT_H_
#define _WX_LAYOUT_H_
// ----------------------------------------------------------------------------
// headers
// ----------------------------------------------------------------------------
#include "wx/object.h"
// X stupidly defines these in X.h
#ifdef Above
#undef Above
#endif
#ifdef Below
#undef Below
#endif
#if wxUSE_CONSTRAINTS
// ----------------------------------------------------------------------------
// forward declrations
// ----------------------------------------------------------------------------
class WXDLLIMPEXP_FWD_CORE wxWindowBase;
class WXDLLIMPEXP_FWD_CORE wxLayoutConstraints;
// ----------------------------------------------------------------------------
// constants
// ----------------------------------------------------------------------------
#define wxLAYOUT_DEFAULT_MARGIN 0
enum wxEdge
{
wxLeft, wxTop, wxRight, wxBottom, wxWidth, wxHeight,
wxCentre, wxCenter = wxCentre, wxCentreX, wxCentreY
};
enum wxRelationship
{
wxUnconstrained = 0,
wxAsIs,
wxPercentOf,
wxAbove,
wxBelow,
wxLeftOf,
wxRightOf,
wxSameAs,
wxAbsolute
};
// ----------------------------------------------------------------------------
// wxIndividualLayoutConstraint: a constraint on window position
// ----------------------------------------------------------------------------
class WXDLLIMPEXP_CORE wxIndividualLayoutConstraint : public wxObject
{
public:
wxIndividualLayoutConstraint();
// note that default copy ctor and assignment operators are ok
virtual ~wxIndividualLayoutConstraint(){}
void Set(wxRelationship rel, wxWindowBase *otherW, wxEdge otherE, int val = 0, int marg = wxLAYOUT_DEFAULT_MARGIN);
//
// Sibling relationships
//
void LeftOf(wxWindowBase *sibling, int marg = wxLAYOUT_DEFAULT_MARGIN);
void RightOf(wxWindowBase *sibling, int marg = wxLAYOUT_DEFAULT_MARGIN);
void Above(wxWindowBase *sibling, int marg = wxLAYOUT_DEFAULT_MARGIN);
void Below(wxWindowBase *sibling, int marg = wxLAYOUT_DEFAULT_MARGIN);
//
// 'Same edge' alignment
//
void SameAs(wxWindowBase *otherW, wxEdge edge, int marg = wxLAYOUT_DEFAULT_MARGIN);
// The edge is a percentage of the other window's edge
void PercentOf(wxWindowBase *otherW, wxEdge wh, int per);
//
// Edge has absolute value
//
void Absolute(int val);
//
// Dimension is unconstrained
//
void Unconstrained() { relationship = wxUnconstrained; }
//
// Dimension is 'as is' (use current size settings)
//
void AsIs() { relationship = wxAsIs; }
//
// Accessors
//
wxWindowBase *GetOtherWindow() { return otherWin; }
wxEdge GetMyEdge() const { return myEdge; }
void SetEdge(wxEdge which) { myEdge = which; }
void SetValue(int v) { value = v; }
int GetMargin() { return margin; }
void SetMargin(int m) { margin = m; }
int GetValue() const { return value; }
int GetPercent() const { return percent; }
int GetOtherEdge() const { return otherEdge; }
bool GetDone() const { return done; }
void SetDone(bool d) { done = d; }
wxRelationship GetRelationship() { return relationship; }
void SetRelationship(wxRelationship r) { relationship = r; }
// Reset constraint if it mentions otherWin
bool ResetIfWin(wxWindowBase *otherW);
// Try to satisfy constraint
bool SatisfyConstraint(wxLayoutConstraints *constraints, wxWindowBase *win);
// Get the value of this edge or dimension, or if this
// is not determinable, -1.
int GetEdge(wxEdge which, wxWindowBase *thisWin, wxWindowBase *other) const;
protected:
// To be allowed to modify the internal variables
friend class wxIndividualLayoutConstraint_Serialize;
// 'This' window is the parent or sibling of otherWin
wxWindowBase *otherWin;
wxEdge myEdge;
wxRelationship relationship;
int margin;
int value;
int percent;
wxEdge otherEdge;
bool done;
wxDECLARE_DYNAMIC_CLASS(wxIndividualLayoutConstraint);
};
// ----------------------------------------------------------------------------
// wxLayoutConstraints: the complete set of constraints for a window
// ----------------------------------------------------------------------------
class WXDLLIMPEXP_CORE wxLayoutConstraints : public wxObject
{
public:
// Edge constraints
wxIndividualLayoutConstraint left;
wxIndividualLayoutConstraint top;
wxIndividualLayoutConstraint right;
wxIndividualLayoutConstraint bottom;
// Size constraints
wxIndividualLayoutConstraint width;
wxIndividualLayoutConstraint height;
// Centre constraints
wxIndividualLayoutConstraint centreX;
wxIndividualLayoutConstraint centreY;
wxLayoutConstraints();
// note that default copy ctor and assignment operators are ok
virtual ~wxLayoutConstraints(){}
bool SatisfyConstraints(wxWindowBase *win, int *noChanges);
bool AreSatisfied() const
{
return left.GetDone() && top.GetDone() &&
width.GetDone() && height.GetDone();
}
wxDECLARE_DYNAMIC_CLASS(wxLayoutConstraints);
};
#endif // wxUSE_CONSTRAINTS
#endif // _WX_LAYOUT_H_
| h |
rticonnextdds-usecases | data/projects/rticonnextdds-usecases/VehicleTracking/ExampleCode/thirdparty/wxWidgets-3.1.2/Win64/include/wx/ipcbase.h | /////////////////////////////////////////////////////////////////////////////
// Name: wx/ipcbase.h
// Purpose: Base classes for IPC
// Author: Julian Smart
// Modified by:
// Created: 4/1/98
// Copyright: (c) Julian Smart
// Licence: wxWindows licence
/////////////////////////////////////////////////////////////////////////////
#ifndef _WX_IPCBASEH__
#define _WX_IPCBASEH__
#include "wx/defs.h"
#include "wx/object.h"
#include "wx/string.h"
enum wxIPCFormat
{
wxIPC_INVALID = 0,
wxIPC_TEXT = 1, /* CF_TEXT */
wxIPC_BITMAP = 2, /* CF_BITMAP */
wxIPC_METAFILE = 3, /* CF_METAFILEPICT */
wxIPC_SYLK = 4,
wxIPC_DIF = 5,
wxIPC_TIFF = 6,
wxIPC_OEMTEXT = 7, /* CF_OEMTEXT */
wxIPC_DIB = 8, /* CF_DIB */
wxIPC_PALETTE = 9,
wxIPC_PENDATA = 10,
wxIPC_RIFF = 11,
wxIPC_WAVE = 12,
wxIPC_UTF16TEXT = 13, /* CF_UNICODE */
wxIPC_ENHMETAFILE = 14,
wxIPC_FILENAME = 15, /* CF_HDROP */
wxIPC_LOCALE = 16,
wxIPC_UTF8TEXT = 17,
wxIPC_UTF32TEXT = 18,
#if SIZEOF_WCHAR_T == 2
wxIPC_UNICODETEXT = wxIPC_UTF16TEXT,
#elif SIZEOF_WCHAR_T == 4
wxIPC_UNICODETEXT = wxIPC_UTF32TEXT,
#else
# error "Unknown wchar_t size"
#endif
wxIPC_PRIVATE = 20
};
class WXDLLIMPEXP_FWD_BASE wxServerBase;
class WXDLLIMPEXP_FWD_BASE wxClientBase;
class WXDLLIMPEXP_BASE wxConnectionBase: public wxObject
{
public:
wxConnectionBase(void *buffer, size_t size); // use external buffer
wxConnectionBase(); // use internal, adaptive buffer
wxConnectionBase(const wxConnectionBase& copy);
virtual ~wxConnectionBase();
void SetConnected( bool c ) { m_connected = c; }
bool GetConnected() { return m_connected; }
// Calls that CLIENT can make
bool Execute(const void *data, size_t size, wxIPCFormat fmt = wxIPC_PRIVATE)
{ return DoExecute(data, size, fmt); }
bool Execute(const char *s, size_t size = wxNO_LEN)
{ return DoExecute(s, size == wxNO_LEN ? strlen(s) + 1
: size, wxIPC_TEXT); }
bool Execute(const wchar_t *ws, size_t size = wxNO_LEN)
{ return DoExecute(ws, size == wxNO_LEN ? (wcslen(ws) + 1)*sizeof(wchar_t)
: size, wxIPC_UNICODETEXT); }
bool Execute(const wxString& s)
{
const wxScopedCharBuffer buf = s.utf8_str();
return DoExecute(buf, strlen(buf) + 1, wxIPC_UTF8TEXT);
}
bool Execute(const wxCStrData& cs)
{ return Execute(cs.AsString()); }
virtual const void *Request(const wxString& item,
size_t *size = NULL,
wxIPCFormat format = wxIPC_TEXT) = 0;
bool Poke(const wxString& item, const void *data, size_t size,
wxIPCFormat fmt = wxIPC_PRIVATE)
{ return DoPoke(item, data, size, fmt); }
bool Poke(const wxString& item, const char *s, size_t size = wxNO_LEN)
{ return DoPoke(item, s, size == wxNO_LEN ? strlen(s) + 1
: size, wxIPC_TEXT); }
bool Poke(const wxString& item, const wchar_t *ws, size_t size = wxNO_LEN)
{ return DoPoke(item, ws,
size == wxNO_LEN ? (wcslen(ws) + 1)*sizeof(wchar_t)
: size, wxIPC_UNICODETEXT); }
bool Poke(const wxString& item, const wxString& s)
{
const wxScopedCharBuffer buf = s.utf8_str();
return DoPoke(item, buf, strlen(buf) + 1, wxIPC_UTF8TEXT);
}
bool Poke(const wxString& item, const wxCStrData& cs)
{ return Poke(item, cs.AsString()); }
virtual bool StartAdvise(const wxString& item) = 0;
virtual bool StopAdvise(const wxString& item) = 0;
// Calls that SERVER can make
bool Advise(const wxString& item, const void *data, size_t size,
wxIPCFormat fmt = wxIPC_PRIVATE)
{ return DoAdvise(item, data, size, fmt); }
bool Advise(const wxString& item, const char *s, size_t size = wxNO_LEN)
{ return DoAdvise(item, s, size == wxNO_LEN ? strlen(s) + 1
: size, wxIPC_TEXT); }
bool Advise(const wxString& item, const wchar_t *ws, size_t size = wxNO_LEN)
{ return DoAdvise(item, ws,
size == wxNO_LEN ? (wcslen(ws) + 1)*sizeof(wchar_t)
: size, wxIPC_UNICODETEXT); }
bool Advise(const wxString& item, const wxString& s)
{
const wxScopedCharBuffer buf = s.utf8_str();
return DoAdvise(item, buf, strlen(buf) + 1, wxIPC_UTF8TEXT);
}
bool Advise(const wxString& item, const wxCStrData& cs)
{ return Advise(item, cs.AsString()); }
// Calls that both can make
virtual bool Disconnect() = 0;
// Callbacks to SERVER - override at will
virtual bool OnExec(const wxString& WXUNUSED(topic),
const wxString& WXUNUSED(data))
{
wxFAIL_MSG( "This method shouldn't be called, if it is, it probably "
"means that you didn't update your old code overriding "
"OnExecute() to use the new parameter types (\"const void *\" "
"instead of \"wxChar *\" and \"size_t\" instead of \"int\"), "
"you must do it or your code wouldn't be executed at all!" );
return false;
}
// deprecated function kept for backwards compatibility: usually you will
// want to override OnExec() above instead which receives its data in a more
// convenient format
virtual bool OnExecute(const wxString& topic,
const void *data,
size_t size,
wxIPCFormat format)
{ return OnExec(topic, GetTextFromData(data, size, format)); }
virtual const void *OnRequest(const wxString& WXUNUSED(topic),
const wxString& WXUNUSED(item),
size_t *size,
wxIPCFormat WXUNUSED(format))
{ *size = 0; return NULL; }
virtual bool OnPoke(const wxString& WXUNUSED(topic),
const wxString& WXUNUSED(item),
const void *WXUNUSED(data),
size_t WXUNUSED(size),
wxIPCFormat WXUNUSED(format))
{ return false; }
virtual bool OnStartAdvise(const wxString& WXUNUSED(topic),
const wxString& WXUNUSED(item))
{ return false; }
virtual bool OnStopAdvise(const wxString& WXUNUSED(topic),
const wxString& WXUNUSED(item))
{ return false; }
// Callbacks to CLIENT - override at will
virtual bool OnAdvise(const wxString& WXUNUSED(topic),
const wxString& WXUNUSED(item),
const void *WXUNUSED(data),
size_t WXUNUSED(size),
wxIPCFormat WXUNUSED(format))
{ return false; }
// Callbacks to BOTH
virtual bool OnDisconnect() { delete this; return true; }
// return true if this is one of the formats used for textual data
// transmission
static bool IsTextFormat(wxIPCFormat format)
{
return format == wxIPC_TEXT ||
format == wxIPC_UTF8TEXT ||
format == wxIPC_UTF16TEXT ||
format == wxIPC_UTF32TEXT;
}
// converts from the data and format into a wxString automatically
//
// this function accepts data in all of wxIPC_TEXT, wxIPC_UNICODETEXT, and
// wxIPC_UTF8TEXT formats but asserts if the format is anything else (i.e.
// such that IsTextFormat(format) doesn't return true)
//
// notice that the size parameter here contains the total size of the data,
// including the terminating '\0' or L'\0'
static
wxString GetTextFromData(const void *data, size_t size, wxIPCFormat format);
// return a buffer at least this size, reallocating buffer if needed
// returns NULL if using an inadequate user buffer which can't be resized
void *GetBufferAtLeast(size_t bytes);
protected:
virtual bool DoExecute(const void *data, size_t size, wxIPCFormat format) = 0;
virtual bool DoPoke(const wxString& item, const void *data, size_t size,
wxIPCFormat format) = 0;
virtual bool DoAdvise(const wxString& item, const void *data, size_t size,
wxIPCFormat format) = 0;
private:
char *m_buffer;
size_t m_buffersize;
bool m_deletebufferwhendone;
protected:
bool m_connected;
wxDECLARE_NO_ASSIGN_CLASS(wxConnectionBase);
wxDECLARE_CLASS(wxConnectionBase);
};
class WXDLLIMPEXP_BASE wxServerBase : public wxObject
{
public:
wxServerBase() { }
virtual ~wxServerBase() { }
// Returns false on error (e.g. port number is already in use)
virtual bool Create(const wxString& serverName) = 0;
// Callbacks to SERVER - override at will
virtual wxConnectionBase *OnAcceptConnection(const wxString& topic) = 0;
wxDECLARE_CLASS(wxServerBase);
};
class WXDLLIMPEXP_BASE wxClientBase : public wxObject
{
public:
wxClientBase() { }
virtual ~wxClientBase() { }
virtual bool ValidHost(const wxString& host) = 0;
// Call this to make a connection. Returns NULL if cannot.
virtual wxConnectionBase *MakeConnection(const wxString& host,
const wxString& server,
const wxString& topic) = 0;
// Callbacks to CLIENT - override at will
virtual wxConnectionBase *OnMakeConnection() = 0;
wxDECLARE_CLASS(wxClientBase);
};
#endif // _WX_IPCBASEH__
| h |
rticonnextdds-usecases | data/projects/rticonnextdds-usecases/VehicleTracking/ExampleCode/thirdparty/wxWidgets-3.1.2/Win64/include/wx/fontenc.h | /////////////////////////////////////////////////////////////////////////////
// Name: wx/fontenc.h
// Purpose: wxFontEncoding constants
// Author: Vadim Zeitlin
// Modified by:
// Created: 29.03.00
// Copyright: (c) Vadim Zeitlin
// Licence: wxWindows licence
/////////////////////////////////////////////////////////////////////////////
#ifndef _WX_FONTENC_H_
#define _WX_FONTENC_H_
// font encodings
enum wxFontEncoding
{
wxFONTENCODING_SYSTEM = -1, // system default
wxFONTENCODING_DEFAULT, // current default encoding
// ISO8859 standard defines a number of single-byte charsets
wxFONTENCODING_ISO8859_1, // West European (Latin1)
wxFONTENCODING_ISO8859_2, // Central and East European (Latin2)
wxFONTENCODING_ISO8859_3, // Esperanto (Latin3)
wxFONTENCODING_ISO8859_4, // Baltic (old) (Latin4)
wxFONTENCODING_ISO8859_5, // Cyrillic
wxFONTENCODING_ISO8859_6, // Arabic
wxFONTENCODING_ISO8859_7, // Greek
wxFONTENCODING_ISO8859_8, // Hebrew
wxFONTENCODING_ISO8859_9, // Turkish (Latin5)
wxFONTENCODING_ISO8859_10, // Variation of Latin4 (Latin6)
wxFONTENCODING_ISO8859_11, // Thai
wxFONTENCODING_ISO8859_12, // doesn't exist currently, but put it
// here anyhow to make all ISO8859
// consecutive numbers
wxFONTENCODING_ISO8859_13, // Baltic (Latin7)
wxFONTENCODING_ISO8859_14, // Latin8
wxFONTENCODING_ISO8859_15, // Latin9 (a.k.a. Latin0, includes euro)
wxFONTENCODING_ISO8859_MAX,
// Cyrillic charset soup (see http://czyborra.com/charsets/cyrillic.html)
wxFONTENCODING_KOI8, // KOI8 Russian
wxFONTENCODING_KOI8_U, // KOI8 Ukrainian
wxFONTENCODING_ALTERNATIVE, // same as MS-DOS CP866
wxFONTENCODING_BULGARIAN, // used under Linux in Bulgaria
// what would we do without Microsoft? They have their own encodings
// for DOS
wxFONTENCODING_CP437, // original MS-DOS codepage
wxFONTENCODING_CP850, // CP437 merged with Latin1
wxFONTENCODING_CP852, // CP437 merged with Latin2
wxFONTENCODING_CP855, // another cyrillic encoding
wxFONTENCODING_CP866, // and another one
// and for Windows
wxFONTENCODING_CP874, // WinThai
wxFONTENCODING_CP932, // Japanese (shift-JIS)
wxFONTENCODING_CP936, // Chinese simplified (GB)
wxFONTENCODING_CP949, // Korean (Hangul charset, a.k.a. EUC-KR)
wxFONTENCODING_CP950, // Chinese (traditional - Big5)
wxFONTENCODING_CP1250, // WinLatin2
wxFONTENCODING_CP1251, // WinCyrillic
wxFONTENCODING_CP1252, // WinLatin1
wxFONTENCODING_CP1253, // WinGreek (8859-7)
wxFONTENCODING_CP1254, // WinTurkish
wxFONTENCODING_CP1255, // WinHebrew
wxFONTENCODING_CP1256, // WinArabic
wxFONTENCODING_CP1257, // WinBaltic (same as Latin 7)
wxFONTENCODING_CP1258, // WinVietnamese
wxFONTENCODING_CP1361, // Johab Korean character set.
wxFONTENCODING_CP12_MAX,
wxFONTENCODING_UTF7, // UTF-7 Unicode encoding
wxFONTENCODING_UTF8, // UTF-8 Unicode encoding
wxFONTENCODING_EUC_JP, // Extended Unix Codepage for Japanese
wxFONTENCODING_UTF16BE, // UTF-16 Big Endian Unicode encoding
wxFONTENCODING_UTF16LE, // UTF-16 Little Endian Unicode encoding
wxFONTENCODING_UTF32BE, // UTF-32 Big Endian Unicode encoding
wxFONTENCODING_UTF32LE, // UTF-32 Little Endian Unicode encoding
wxFONTENCODING_MACROMAN, // the standard mac encodings
wxFONTENCODING_MACJAPANESE,
wxFONTENCODING_MACCHINESETRAD,
wxFONTENCODING_MACKOREAN,
wxFONTENCODING_MACARABIC,
wxFONTENCODING_MACHEBREW,
wxFONTENCODING_MACGREEK,
wxFONTENCODING_MACCYRILLIC,
wxFONTENCODING_MACDEVANAGARI,
wxFONTENCODING_MACGURMUKHI,
wxFONTENCODING_MACGUJARATI,
wxFONTENCODING_MACORIYA,
wxFONTENCODING_MACBENGALI,
wxFONTENCODING_MACTAMIL,
wxFONTENCODING_MACTELUGU,
wxFONTENCODING_MACKANNADA,
wxFONTENCODING_MACMALAJALAM,
wxFONTENCODING_MACSINHALESE,
wxFONTENCODING_MACBURMESE,
wxFONTENCODING_MACKHMER,
wxFONTENCODING_MACTHAI,
wxFONTENCODING_MACLAOTIAN,
wxFONTENCODING_MACGEORGIAN,
wxFONTENCODING_MACARMENIAN,
wxFONTENCODING_MACCHINESESIMP,
wxFONTENCODING_MACTIBETAN,
wxFONTENCODING_MACMONGOLIAN,
wxFONTENCODING_MACETHIOPIC,
wxFONTENCODING_MACCENTRALEUR,
wxFONTENCODING_MACVIATNAMESE,
wxFONTENCODING_MACARABICEXT,
wxFONTENCODING_MACSYMBOL,
wxFONTENCODING_MACDINGBATS,
wxFONTENCODING_MACTURKISH,
wxFONTENCODING_MACCROATIAN,
wxFONTENCODING_MACICELANDIC,
wxFONTENCODING_MACROMANIAN,
wxFONTENCODING_MACCELTIC,
wxFONTENCODING_MACGAELIC,
wxFONTENCODING_MACKEYBOARD,
// more CJK encodings (for historical reasons some are already declared
// above)
wxFONTENCODING_ISO2022_JP, // ISO-2022-JP JIS encoding
wxFONTENCODING_MAX, // highest enumerated encoding value
wxFONTENCODING_MACMIN = wxFONTENCODING_MACROMAN ,
wxFONTENCODING_MACMAX = wxFONTENCODING_MACKEYBOARD ,
// aliases for endian-dependent UTF encodings
#ifdef WORDS_BIGENDIAN
wxFONTENCODING_UTF16 = wxFONTENCODING_UTF16BE, // native UTF-16
wxFONTENCODING_UTF32 = wxFONTENCODING_UTF32BE, // native UTF-32
#else // WORDS_BIGENDIAN
wxFONTENCODING_UTF16 = wxFONTENCODING_UTF16LE, // native UTF-16
wxFONTENCODING_UTF32 = wxFONTENCODING_UTF32LE, // native UTF-32
#endif // WORDS_BIGENDIAN
// alias for the native Unicode encoding on this platform
// (this is used by wxEncodingConverter and wxUTFFile only for now)
#if SIZEOF_WCHAR_T == 2
wxFONTENCODING_UNICODE = wxFONTENCODING_UTF16,
#else // SIZEOF_WCHAR_T == 4
wxFONTENCODING_UNICODE = wxFONTENCODING_UTF32,
#endif
// alternative names for Far Eastern encodings
// Chinese
wxFONTENCODING_GB2312 = wxFONTENCODING_CP936, // Simplified Chinese
wxFONTENCODING_BIG5 = wxFONTENCODING_CP950, // Traditional Chinese
// Japanese (see http://zsigri.tripod.com/fontboard/cjk/jis.html)
wxFONTENCODING_SHIFT_JIS = wxFONTENCODING_CP932, // Shift JIS
// Korean (CP 949 not actually the same but close enough)
wxFONTENCODING_EUC_KR = wxFONTENCODING_CP949,
wxFONTENCODING_JOHAB = wxFONTENCODING_CP1361,
// Vietnamese
wxFONTENCODING_VIETNAMESE = wxFONTENCODING_CP1258
};
#endif // _WX_FONTENC_H_
| h |
rticonnextdds-usecases | data/projects/rticonnextdds-usecases/VehicleTracking/ExampleCode/thirdparty/wxWidgets-3.1.2/Win64/include/wx/fs_mem.h | /////////////////////////////////////////////////////////////////////////////
// Name: wx/fs_mem.h
// Purpose: in-memory file system
// Author: Vaclav Slavik
// Copyright: (c) 2000 Vaclav Slavik
// Licence: wxWindows licence
/////////////////////////////////////////////////////////////////////////////
#ifndef _WX_FS_MEM_H_
#define _WX_FS_MEM_H_
#include "wx/defs.h"
#if wxUSE_FILESYSTEM
#include "wx/filesys.h"
#include "wx/hashmap.h"
class wxMemoryFSFile;
WX_DECLARE_STRING_HASH_MAP(wxMemoryFSFile *, wxMemoryFSHash);
#if wxUSE_GUI
#include "wx/bitmap.h"
#endif // wxUSE_GUI
// ----------------------------------------------------------------------------
// wxMemoryFSHandlerBase
// ----------------------------------------------------------------------------
class WXDLLIMPEXP_BASE wxMemoryFSHandlerBase : public wxFileSystemHandler
{
public:
wxMemoryFSHandlerBase();
virtual ~wxMemoryFSHandlerBase();
// Add file to list of files stored in memory. Stored data (bitmap, text or
// raw data) will be copied into private memory stream and available under
// name "memory:" + filename
static void AddFile(const wxString& filename, const wxString& textdata);
static void AddFile(const wxString& filename, const void *binarydata, size_t size);
static void AddFileWithMimeType(const wxString& filename,
const wxString& textdata,
const wxString& mimetype);
static void AddFileWithMimeType(const wxString& filename,
const void *binarydata, size_t size,
const wxString& mimetype);
// Remove file from memory FS and free occupied memory
static void RemoveFile(const wxString& filename);
virtual bool CanOpen(const wxString& location) wxOVERRIDE;
virtual wxFSFile* OpenFile(wxFileSystem& fs, const wxString& location) wxOVERRIDE;
virtual wxString FindFirst(const wxString& spec, int flags = 0) wxOVERRIDE;
virtual wxString FindNext() wxOVERRIDE;
protected:
// check that the given file is not already present in m_Hash; logs an
// error and returns false if it does exist
static bool CheckDoesntExist(const wxString& filename);
// the hash map indexed by the names of the files stored in the memory FS
static wxMemoryFSHash m_Hash;
// the file name currently being searched for, i.e. the argument of the
// last FindFirst() call or empty string if FindFirst() hasn't been called
// yet or FindNext() didn't find anything
wxString m_findArgument;
// iterator into m_Hash used by FindFirst/Next(), possibly m_Hash.end() or
// even invalid (can only be used when m_findArgument is not empty)
wxMemoryFSHash::const_iterator m_findIter;
};
// ----------------------------------------------------------------------------
// wxMemoryFSHandler
// ----------------------------------------------------------------------------
#if wxUSE_GUI
// add GUI-only operations to the base class
class WXDLLIMPEXP_CORE wxMemoryFSHandler : public wxMemoryFSHandlerBase
{
public:
// bring the base class versions into the scope, otherwise they would be
// inaccessible in wxMemoryFSHandler
// (unfortunately "using" can't be used as gcc 2.95 doesn't have it...)
static void AddFile(const wxString& filename, const wxString& textdata)
{
wxMemoryFSHandlerBase::AddFile(filename, textdata);
}
static void AddFile(const wxString& filename,
const void *binarydata,
size_t size)
{
wxMemoryFSHandlerBase::AddFile(filename, binarydata, size);
}
static void AddFileWithMimeType(const wxString& filename,
const wxString& textdata,
const wxString& mimetype)
{
wxMemoryFSHandlerBase::AddFileWithMimeType(filename,
textdata,
mimetype);
}
static void AddFileWithMimeType(const wxString& filename,
const void *binarydata, size_t size,
const wxString& mimetype)
{
wxMemoryFSHandlerBase::AddFileWithMimeType(filename,
binarydata, size,
mimetype);
}
#if wxUSE_IMAGE
static void AddFile(const wxString& filename,
const wxImage& image,
wxBitmapType type);
static void AddFile(const wxString& filename,
const wxBitmap& bitmap,
wxBitmapType type);
#endif // wxUSE_IMAGE
};
#else // !wxUSE_GUI
// just the same thing as the base class in wxBase
class WXDLLIMPEXP_BASE wxMemoryFSHandler : public wxMemoryFSHandlerBase
{
};
#endif // wxUSE_GUI/!wxUSE_GUI
#endif // wxUSE_FILESYSTEM
#endif // _WX_FS_MEM_H_
| h |
rticonnextdds-usecases | data/projects/rticonnextdds-usecases/VehicleTracking/ExampleCode/thirdparty/wxWidgets-3.1.2/Win64/include/wx/scrolwin.h | /////////////////////////////////////////////////////////////////////////////
// Name: wx/scrolwin.h
// Purpose: wxScrolledWindow, wxScrolledControl and wxScrollHelper
// Author: Vadim Zeitlin
// Modified by:
// Created: 30.08.00
// Copyright: (c) 2000 Vadim Zeitlin <[email protected]>
// Licence: wxWindows licence
/////////////////////////////////////////////////////////////////////////////
#ifndef _WX_SCROLWIN_H_BASE_
#define _WX_SCROLWIN_H_BASE_
#include "wx/panel.h"
class WXDLLIMPEXP_FWD_CORE wxScrollHelperEvtHandler;
class WXDLLIMPEXP_FWD_BASE wxTimer;
// default scrolled window style: scroll in both directions
#define wxScrolledWindowStyle (wxHSCROLL | wxVSCROLL)
// values for the second argument of wxScrollHelper::ShowScrollbars()
enum wxScrollbarVisibility
{
wxSHOW_SB_NEVER = -1, // never show the scrollbar at all
wxSHOW_SB_DEFAULT, // show scrollbar only if it is needed
wxSHOW_SB_ALWAYS // always show scrollbar, even if not needed
};
// ----------------------------------------------------------------------------
// The hierarchy of scrolling classes is a bit complicated because we want to
// put as much functionality as possible in a mix-in class not deriving from
// wxWindow so that other classes could derive from the same base class on all
// platforms irrespectively of whether they are native controls (and hence
// don't use our scrolling) or not.
//
// So we have
//
// wxAnyScrollHelperBase
// |
// |
// \|/
// wxScrollHelperBase
// |
// |
// \|/
// wxWindow wxScrollHelper
// | \ / /
// | \ / /
// | _| |_ /
// | wxScrolledWindow /
// | /
// \|/ /
// wxControl /
// \ /
// \ /
// _| |_
// wxScrolledControl
//
// ----------------------------------------------------------------------------
// This class allows reusing some of wxScrollHelperBase functionality in
// wxVarScrollHelperBase in wx/vscroll.h without duplicating its code.
class WXDLLIMPEXP_CORE wxAnyScrollHelperBase
{
public:
explicit wxAnyScrollHelperBase(wxWindow* win);
virtual ~wxAnyScrollHelperBase() {}
// Disable use of keyboard keys for scrolling. By default cursor movement
// keys (including Home, End, Page Up and Down) are used to scroll the
// window appropriately. If the derived class uses these keys for something
// else, e.g. changing the currently selected item, this function can be
// used to disable this behaviour as it's not only not necessary then but
// can actually be actively harmful if another object forwards a keyboard
// event corresponding to one of the above keys to us using
// ProcessWindowEvent() because the event will always be processed which
// can be undesirable.
void DisableKeyboardScrolling() { m_kbdScrollingEnabled = false; }
// Override this function to draw the graphic (or just process EVT_PAINT)
virtual void OnDraw(wxDC& WXUNUSED(dc)) { }
// change the DC origin according to the scroll position.
virtual void DoPrepareDC(wxDC& dc) = 0;
// Simple accessor for the window that is really being scrolled.
wxWindow *GetTargetWindow() const { return m_targetWindow; }
// The methods called from the window event handlers.
void HandleOnChar(wxKeyEvent& event);
void HandleOnPaint(wxPaintEvent& event);
protected:
// the window that receives the scroll events and the window to actually
// scroll, respectively
wxWindow *m_win,
*m_targetWindow;
// whether cursor keys should scroll the window
bool m_kbdScrollingEnabled;
};
// This is the class containing the guts of (uniform) scrolling logic.
class WXDLLIMPEXP_CORE wxScrollHelperBase : public wxAnyScrollHelperBase
{
public:
// ctor must be given the associated window
wxScrollHelperBase(wxWindow *winToScroll);
virtual ~wxScrollHelperBase();
// configure the scrolling
virtual void SetScrollbars(int pixelsPerUnitX, int pixelsPerUnitY,
int noUnitsX, int noUnitsY,
int xPos = 0, int yPos = 0,
bool noRefresh = false );
// scroll to the given (in logical coords) position
//
// notice that for backwards compatibility reasons Scroll() is virtual as
// the existing code could override it but new code should override
// DoScroll() instead
virtual void Scroll(int x, int y) { DoScroll(x, y); }
virtual void Scroll(const wxPoint& pt) { DoScroll(pt.x, pt.y); }
// get/set the page size for this orientation (wxVERTICAL/wxHORIZONTAL)
int GetScrollPageSize(int orient) const;
void SetScrollPageSize(int orient, int pageSize);
// get the number of lines the window can scroll,
// returns 0 if no scrollbars are there.
int GetScrollLines( int orient ) const;
// Set the x, y scrolling increments.
void SetScrollRate( int xstep, int ystep );
// get the size of one logical unit in physical ones
void GetScrollPixelsPerUnit(int *pixelsPerUnitX, int *pixelsPerUnitY) const;
// Set scrollbar visibility: it is possible to show scrollbar only if it is
// needed (i.e. if our virtual size is greater than the current size of the
// associated window), always (as wxALWAYS_SHOW_SB style does) or never (in
// which case you should provide some other way to scroll the window as the
// user wouldn't be able to do it at all)
void ShowScrollbars(wxScrollbarVisibility horz, wxScrollbarVisibility vert)
{
DoShowScrollbars(horz, vert);
}
// Test whether the specified scrollbar is shown.
virtual bool IsScrollbarShown(int orient) const = 0;
// Enable/disable Windows scrolling in either direction. If true, wxWidgets
// scrolls the canvas and only a bit of the canvas is invalidated; no
// Clear() is necessary. If false, the whole canvas is invalidated and a
// Clear() is necessary. Disable for when the scroll increment is used to
// actually scroll a non-constant distance
//
// Notice that calling this method with a false argument doesn't disable
// scrolling the window in this direction, it just changes the mechanism by
// which it is implemented to not use wxWindow::ScrollWindow().
virtual void EnableScrolling(bool x_scrolling, bool y_scrolling);
// Get the view start
void GetViewStart(int *x, int *y) const { DoGetViewStart(x, y); }
wxPoint GetViewStart() const
{
wxPoint pt;
DoGetViewStart(&pt.x, &pt.y);
return pt;
}
// Set the scale factor, used in PrepareDC
void SetScale(double xs, double ys) { m_scaleX = xs; m_scaleY = ys; }
double GetScaleX() const { return m_scaleX; }
double GetScaleY() const { return m_scaleY; }
// translate between scrolled and unscrolled coordinates
void CalcScrolledPosition(int x, int y, int *xx, int *yy) const
{ DoCalcScrolledPosition(x, y, xx, yy); }
wxPoint CalcScrolledPosition(const wxPoint& pt) const
{
wxPoint p2;
DoCalcScrolledPosition(pt.x, pt.y, &p2.x, &p2.y);
return p2;
}
void CalcUnscrolledPosition(int x, int y, int *xx, int *yy) const
{ DoCalcUnscrolledPosition(x, y, xx, yy); }
wxPoint CalcUnscrolledPosition(const wxPoint& pt) const
{
wxPoint p2;
DoCalcUnscrolledPosition(pt.x, pt.y, &p2.x, &p2.y);
return p2;
}
void DoCalcScrolledPosition(int x, int y, int *xx, int *yy) const;
void DoCalcUnscrolledPosition(int x, int y, int *xx, int *yy) const;
// Adjust the scrollbars
virtual void AdjustScrollbars() = 0;
// Calculate scroll increment
int CalcScrollInc(wxScrollWinEvent& event);
// Normally the wxScrolledWindow will scroll itself, but in some rare
// occasions you might want it to scroll [part of] another window (e.g. a
// child of it in order to scroll only a portion the area between the
// scrollbars (spreadsheet: only cell area will move).
void SetTargetWindow(wxWindow *target);
void SetTargetRect(const wxRect& rect) { m_rectToScroll = rect; }
wxRect GetTargetRect() const { return m_rectToScroll; }
virtual void DoPrepareDC(wxDC& dc) wxOVERRIDE;
// are we generating the autoscroll events?
bool IsAutoScrolling() const { return m_timerAutoScroll != NULL; }
// stop generating the scroll events when mouse is held outside the window
void StopAutoScrolling();
// this method can be overridden in a derived class to forbid sending the
// auto scroll events - note that unlike StopAutoScrolling() it doesn't
// stop the timer, so it will be called repeatedly and will typically
// return different values depending on the current mouse position
//
// the base class version just returns true
virtual bool SendAutoScrollEvents(wxScrollWinEvent& event) const;
// the methods to be called from the window event handlers
void HandleOnScroll(wxScrollWinEvent& event);
void HandleOnSize(wxSizeEvent& event);
void HandleOnMouseEnter(wxMouseEvent& event);
void HandleOnMouseLeave(wxMouseEvent& event);
#if wxUSE_MOUSEWHEEL
void HandleOnMouseWheel(wxMouseEvent& event);
#endif // wxUSE_MOUSEWHEEL
void HandleOnChildFocus(wxChildFocusEvent& event);
#if WXWIN_COMPATIBILITY_2_8
wxDEPRECATED(
void OnScroll(wxScrollWinEvent& event) { HandleOnScroll(event); }
)
#endif // WXWIN_COMPATIBILITY_2_8
protected:
// get pointer to our scroll rect if we use it or NULL
const wxRect *GetScrollRect() const
{
return m_rectToScroll.width != 0 ? &m_rectToScroll : NULL;
}
// get the size of the target window
wxSize GetTargetSize() const
{
return m_rectToScroll.width != 0 ? m_rectToScroll.GetSize()
: m_targetWindow->GetClientSize();
}
void GetTargetSize(int *w, int *h) const
{
wxSize size = GetTargetSize();
if ( w )
*w = size.x;
if ( h )
*h = size.y;
}
// implementation of public methods with the same name
virtual void DoGetViewStart(int *x, int *y) const;
virtual void DoScroll(int x, int y) = 0;
virtual void DoShowScrollbars(wxScrollbarVisibility horz,
wxScrollbarVisibility vert) = 0;
// implementations of various wxWindow virtual methods which should be
// forwarded to us (this can be done by WX_FORWARD_TO_SCROLL_HELPER())
bool ScrollLayout();
void ScrollDoSetVirtualSize(int x, int y);
wxSize ScrollGetBestVirtualSize() const;
// change just the target window (unlike SetWindow which changes m_win as
// well)
void DoSetTargetWindow(wxWindow *target);
// delete the event handler we installed
void DeleteEvtHandler();
// this function should be overridden to return the size available for
// m_targetWindow inside m_win of the given size
//
// the default implementation is only good for m_targetWindow == m_win
// case, if we're scrolling a subwindow you must override this method
virtual wxSize GetSizeAvailableForScrollTarget(const wxSize& size)
{
// returning just size from here is wrong but it was decided that it is
// not wrong enough to break the existing code (which doesn't override
// this recently added function at all) by adding this assert
//
// wxASSERT_MSG( m_targetWindow == m_win, "must be overridden" );
return size;
}
double m_scaleX;
double m_scaleY;
wxRect m_rectToScroll;
wxTimer *m_timerAutoScroll;
// The number of pixels to scroll in horizontal and vertical directions
// respectively.
//
// If 0, means that the scrolling in the given direction is disabled.
int m_xScrollPixelsPerLine;
int m_yScrollPixelsPerLine;
int m_xScrollPosition;
int m_yScrollPosition;
int m_xScrollLines;
int m_yScrollLines;
int m_xScrollLinesPerPage;
int m_yScrollLinesPerPage;
bool m_xScrollingEnabled;
bool m_yScrollingEnabled;
#if wxUSE_MOUSEWHEEL
int m_wheelRotation;
#endif // wxUSE_MOUSEWHEEL
wxScrollHelperEvtHandler *m_handler;
wxDECLARE_NO_COPY_CLASS(wxScrollHelperBase);
};
// this macro can be used in a wxScrollHelper-derived class to forward wxWindow
// methods to corresponding wxScrollHelper methods
#define WX_FORWARD_TO_SCROLL_HELPER() \
public: \
virtual void PrepareDC(wxDC& dc) wxOVERRIDE { DoPrepareDC(dc); } \
virtual bool Layout() wxOVERRIDE { return ScrollLayout(); } \
virtual bool CanScroll(int orient) const wxOVERRIDE \
{ return IsScrollbarShown(orient); } \
virtual void DoSetVirtualSize(int x, int y) wxOVERRIDE \
{ ScrollDoSetVirtualSize(x, y); } \
virtual wxSize GetBestVirtualSize() const wxOVERRIDE \
{ return ScrollGetBestVirtualSize(); }
// include the declaration of the real wxScrollHelper
#if defined(__WXGTK20__) && !defined(__WXUNIVERSAL__)
#include "wx/gtk/scrolwin.h"
#elif defined(__WXGTK__) && !defined(__WXUNIVERSAL__)
#include "wx/gtk1/scrolwin.h"
#else
#define wxHAS_GENERIC_SCROLLWIN
#include "wx/generic/scrolwin.h"
#endif
// ----------------------------------------------------------------------------
// wxScrolled<T>: a wxWindow which knows how to scroll
// ----------------------------------------------------------------------------
// helper class for wxScrolled<T> below
struct WXDLLIMPEXP_CORE wxScrolledT_Helper
{
static wxSize FilterBestSize(const wxWindow *win,
const wxScrollHelper *helper,
const wxSize& origBest);
#ifdef __WXMSW__
static WXLRESULT FilterMSWWindowProc(WXUINT nMsg, WXLRESULT origResult);
#endif
};
// Scrollable window base on window type T. This used to be wxScrolledWindow,
// but wxScrolledWindow includes wxControlContainer functionality and that's
// not always desirable.
template<class T>
class wxScrolled : public T,
public wxScrollHelper,
private wxScrolledT_Helper
{
public:
wxScrolled() : wxScrollHelper(this) { }
wxScrolled(wxWindow *parent,
wxWindowID winid = wxID_ANY,
const wxPoint& pos = wxDefaultPosition,
const wxSize& size = wxDefaultSize,
long style = wxScrolledWindowStyle,
const wxString& name = wxPanelNameStr)
: wxScrollHelper(this)
{
Create(parent, winid, pos, size, style, name);
}
bool Create(wxWindow *parent,
wxWindowID winid,
const wxPoint& pos = wxDefaultPosition,
const wxSize& size = wxDefaultSize,
long style = wxScrolledWindowStyle,
const wxString& name = wxPanelNameStr)
{
m_targetWindow = this;
#ifdef __WXMAC__
this->MacSetClipChildren(true);
#endif
// by default, we're scrollable in both directions (but if one of the
// styles is specified explicitly, we shouldn't add the other one
// automatically)
if ( !(style & (wxHSCROLL | wxVSCROLL)) )
style |= wxHSCROLL | wxVSCROLL;
return T::Create(parent, winid, pos, size, style, name);
}
#ifdef __WXMSW__
// we need to return a special WM_GETDLGCODE value to process just the
// arrows but let the other navigation characters through
virtual WXLRESULT MSWWindowProc(WXUINT nMsg, WXWPARAM wParam, WXLPARAM lParam) wxOVERRIDE
{
return FilterMSWWindowProc(nMsg, T::MSWWindowProc(nMsg, wParam, lParam));
}
// Take into account the scroll origin.
virtual void MSWAdjustBrushOrg(int* xOrg, int* yOrg) const wxOVERRIDE
{
CalcUnscrolledPosition(*xOrg, *yOrg, xOrg, yOrg);
}
#endif // __WXMSW__
WX_FORWARD_TO_SCROLL_HELPER()
protected:
virtual wxSize DoGetBestSize() const wxOVERRIDE
{
return FilterBestSize(this, this, T::DoGetBestSize());
}
private:
wxDECLARE_NO_COPY_CLASS(wxScrolled);
};
// for compatibility with existing code, we provide wxScrolledWindow
// "typedef" for wxScrolled<wxPanel>. It's not a real typedef because we
// want wxScrolledWindow to show in wxRTTI information (the class is widely
// used and likelihood of its wxRTTI information being used too is high):
class WXDLLIMPEXP_CORE wxScrolledWindow : public wxScrolled<wxPanel>
{
public:
wxScrolledWindow() : wxScrolled<wxPanel>() {}
wxScrolledWindow(wxWindow *parent,
wxWindowID winid = wxID_ANY,
const wxPoint& pos = wxDefaultPosition,
const wxSize& size = wxDefaultSize,
long style = wxScrolledWindowStyle,
const wxString& name = wxPanelNameStr)
: wxScrolled<wxPanel>(parent, winid, pos, size, style, name) {}
wxDECLARE_DYNAMIC_CLASS_NO_COPY(wxScrolledWindow);
};
typedef wxScrolled<wxWindow> wxScrolledCanvas;
#endif // _WX_SCROLWIN_H_BASE_
| h |
rticonnextdds-usecases | data/projects/rticonnextdds-usecases/VehicleTracking/ExampleCode/thirdparty/wxWidgets-3.1.2/Win64/include/wx/dcscreen.h | /////////////////////////////////////////////////////////////////////////////
// Name: wx/dcscreen.h
// Purpose: wxScreenDC base header
// Author: Julian Smart
// Modified by:
// Created:
// Copyright: (c) Julian Smart
// Licence: wxWindows Licence
/////////////////////////////////////////////////////////////////////////////
#ifndef _WX_DCSCREEN_H_BASE_
#define _WX_DCSCREEN_H_BASE_
#include "wx/defs.h"
#include "wx/dc.h"
class WXDLLIMPEXP_CORE wxScreenDC : public wxDC
{
public:
wxScreenDC();
static bool StartDrawingOnTop(wxWindow * WXUNUSED(window))
{ return true; }
static bool StartDrawingOnTop(wxRect * WXUNUSED(rect) = NULL)
{ return true; }
static bool EndDrawingOnTop()
{ return true; }
private:
wxDECLARE_DYNAMIC_CLASS(wxScreenDC);
};
#endif
// _WX_DCSCREEN_H_BASE_
| h |
rticonnextdds-usecases | data/projects/rticonnextdds-usecases/VehicleTracking/ExampleCode/thirdparty/wxWidgets-3.1.2/Win64/include/wx/rawbmp.h | ///////////////////////////////////////////////////////////////////////////////
// Name: wx/rawbmp.h
// Purpose: macros for fast, raw bitmap data access
// Author: Eric Kidd, Vadim Zeitlin
// Modified by:
// Created: 10.03.03
// Copyright: (c) 2002 Vadim Zeitlin <[email protected]>
// Licence: wxWindows licence
///////////////////////////////////////////////////////////////////////////////
#ifndef _WX_RAWBMP_H_
#define _WX_RAWBMP_H_
#include "wx/defs.h"
#ifdef wxHAS_RAW_BITMAP
#include "wx/image.h"
#include "wx/bitmap.h"
// ----------------------------------------------------------------------------
// Abstract Pixel API
//
// We need to access our raw bitmap data (1) portably and (2) efficiently.
// We do this using a two-dimensional "iteration" interface. Performance
// is extremely important here: these functions will be called hundreds
// of thousands of times in a row, and even small inefficiencies will
// make applications seem slow.
//
// We can't always rely on inline functions, because not all compilers actually
// bother to inline them unless we crank the optimization levels way up.
// Therefore, we also provide macros to wring maximum speed out of compiler
// unconditionally (e.g. even in debug builds). Of course, if the performance
// isn't absolutely crucial for you you shouldn't be using them but the inline
// functions instead.
// ----------------------------------------------------------------------------
/*
Usage example:
typedef wxPixelData<wxBitmap, wxNativePixelFormat> PixelData;
wxBitmap bmp;
PixelData data(bmp);
if ( !data )
{
... raw access to bitmap data unavailable, do something else ...
return;
}
if ( data.GetWidth() < 20 || data.GetHeight() < 20 )
{
... complain: the bitmap it too small ...
return;
}
PixelData::Iterator p(data);
// we draw a (10, 10)-(20, 20) rect manually using the given r, g, b
p.Offset(data, 10, 10);
for ( int y = 0; y < 10; ++y )
{
PixelData::Iterator rowStart = p;
for ( int x = 0; x < 10; ++x, ++p )
{
p.Red() = r;
p.Green() = g;
p.Blue() = b;
}
p = rowStart;
p.OffsetY(data, 1);
}
*/
/*
Note: we do not use WXDLLIMPEXP_CORE with classes in this file because VC++ has
problems with exporting inner class defined inside a specialization of a
template class from a DLL. Besides, as all the methods are inline it's not
really necessary to put them in DLL at all.
*/
// ----------------------------------------------------------------------------
// wxPixelFormat
// ----------------------------------------------------------------------------
/*
wxPixelFormat is a template class describing the bitmap data format. It
contains the constants describing the format of pixel data, but does not
describe how the entire bitmap is stored (i.e. top-to-bottom,
bottom-to-top, ...). It is also a "traits"-like class, i.e. it only
contains some constants and maybe static methods but nothing more, so it
can be safely used without incurring any overhead as all accesses to it are
done at compile-time.
Current limitations: we don't support RAGABA and ARAGAB formats supported
by Mac OS X. If there is sufficient interest, these classes could be
extended to deal with them. Neither do we support alpha channel having
different representation from the RGB ones (happens under QNX/Photon I
think), but again this could be achieved with some small extra effort.
Template parameters are:
- type of a single pixel component
- size of the single pixel in bits
- indices of red, green and blue pixel components inside the pixel
- index of the alpha component or -1 if none
- type which can contain the full pixel value (all channels)
*/
template <class Channel,
size_t Bpp, int R, int G, int B, int A = -1,
class Pixel = wxUint32>
struct wxPixelFormat
{
// iterator over pixels is usually of type "ChannelType *"
typedef Channel ChannelType;
// the type which may hold the entire pixel value
typedef Pixel PixelType;
// size of one pixel in bits
static const int BitsPerPixel = Bpp;
// size of one pixel in ChannelType units (usually bytes)
static const int SizePixel = Bpp / (8 * sizeof(Channel));
// the channels indices inside the pixel
enum
{
RED = R,
GREEN = G,
BLUE = B,
ALPHA = A
};
// true if we have an alpha channel (together with the other channels, this
// doesn't cover the case of wxImage which stores alpha separately)
enum { HasAlpha = A != -1 };
};
// some "predefined" pixel formats
// -------------------------------
// wxImage format is common to all platforms
typedef wxPixelFormat<unsigned char, 24, 0, 1, 2> wxImagePixelFormat;
// the (most common) native bitmap format without alpha support
#if defined(__WXMSW__)
// under MSW the RGB components are reversed, they're in BGR order
typedef wxPixelFormat<unsigned char, 24, 2, 1, 0> wxNativePixelFormat;
#define wxPIXEL_FORMAT_ALPHA 3
#elif defined(__WXMAC__)
// under Mac, first component is unused but still present, hence we use
// 32bpp, not 24
typedef wxPixelFormat<unsigned char, 32, 1, 2, 3> wxNativePixelFormat;
#define wxPIXEL_FORMAT_ALPHA 0
#elif defined(__WXGTK__)
// Under GTK+ 2.X we use GdkPixbuf, which is standard RGB or RGBA
typedef wxPixelFormat<unsigned char, 24, 0, 1, 2> wxNativePixelFormat;
#define wxPIXEL_FORMAT_ALPHA 3
#elif defined(__WXDFB__)
// Under DirectFB, RGB components are reversed, they're in BGR order
typedef wxPixelFormat<unsigned char, 24, 2, 1, 0> wxNativePixelFormat;
#define wxPIXEL_FORMAT_ALPHA 3
#elif defined(__WXQT__)
typedef wxPixelFormat<unsigned char, 24, 0, 1, 2> wxNativePixelFormat;
#define wxPIXEL_FORMAT_ALPHA 3
#endif
// the (most common) native format for bitmaps with alpha channel
#ifdef wxPIXEL_FORMAT_ALPHA
typedef wxPixelFormat<unsigned char, 32,
wxNativePixelFormat::RED,
wxNativePixelFormat::GREEN,
wxNativePixelFormat::BLUE,
wxPIXEL_FORMAT_ALPHA> wxAlphaPixelFormat;
#endif // wxPIXEL_FORMAT_ALPHA
// we also define the (default/best) pixel format for the given class: this is
// used as default value for the pixel format in wxPixelIterator template
template <class T> struct wxPixelFormatFor;
#if wxUSE_IMAGE
// wxPixelFormatFor is only defined for wxImage, attempt to use it with other
// classes (wxBitmap...) will result in compile errors which is exactly what we
// want
template <>
struct wxPixelFormatFor<wxImage>
{
typedef wxImagePixelFormat Format;
};
#endif //wxUSE_IMAGE
// ----------------------------------------------------------------------------
// wxPixelData
// ----------------------------------------------------------------------------
/*
wxPixelDataBase is just a helper for wxPixelData: it contains things common
to both wxImage and wxBitmap specializations.
*/
class wxPixelDataBase
{
public:
// origin of the rectangular region we represent
wxPoint GetOrigin() const { return m_ptOrigin; }
// width and height of the region we represent
int GetWidth() const { return m_width; }
int GetHeight() const { return m_height; }
wxSize GetSize() const { return wxSize(m_width, m_height); }
// the distance between two rows
int GetRowStride() const { return m_stride; }
// private: -- see comment in the beginning of the file
// the origin of this image inside the bigger bitmap (usually (0, 0))
wxPoint m_ptOrigin;
// the size of the image we address, in pixels
int m_width,
m_height;
// this parameter is the offset of the start of the (N+1)st row from the
// Nth one and can be different from m_bypp*width in some cases:
// a) the most usual one is to force 32/64 bit alignment of rows
// b) another one is for bottom-to-top images where it's negative
// c) finally, it could conceivably be 0 for the images with all
// lines being identical
int m_stride;
protected:
// ctor is protected because this class is only meant to be used as the
// base class by wxPixelData
wxPixelDataBase()
{
m_width =
m_height =
m_stride = 0;
}
};
/*
wxPixelData represents the entire bitmap data, i.e. unlike
wxPixelFormat (which it uses) it also stores the global bitmap
characteristics such as its size, inter-row separation and so on.
Because of this it can be used to move the pixel iterators (which don't
have enough information about the bitmap themselves). This may seem a bit
unnatural but must be done in this way to keep the iterator objects as
small as possible for maximum efficiency as otherwise they wouldn't be put
into the CPU registers by the compiler any more.
Implementation note: we use the standard workaround for lack of partial
template specialization support in VC7: instead of partly specializing the
class Foo<T, U> for some T we introduce FooOut<T> and FooIn<U> nested in
it, make Foo<T, U> equivalent to FooOut<T>::FooIn<U> and fully specialize
FooOut (FIXME-VC7).
Also note that this class doesn't have any default definition because we
can't really do anything without knowing the exact image class. We do
provide wxPixelDataBase to make it simpler to write new wxPixelData
specializations.
*/
// we need to define this skeleton template to mollify VC++
template <class Image>
struct wxPixelDataOut
{
template <class PixelFormat>
class wxPixelDataIn
{
public:
class Iterator { };
};
};
#if wxUSE_IMAGE
// wxPixelData specialization for wxImage: this is the simplest case as we
// don't have to care about different pixel formats here
template <>
struct wxPixelDataOut<wxImage>
{
// NB: this is a template class even though it doesn't use its template
// parameter because otherwise wxPixelData couldn't compile
template <class dummyPixelFormat>
class wxPixelDataIn : public wxPixelDataBase
{
public:
// the type of the class we're working with
typedef wxImage ImageType;
// the iterator which should be used for working with data in this
// format
class Iterator
{
public:
// the pixel format we use
typedef wxImagePixelFormat PixelFormat;
// the pixel data we're working with
typedef
wxPixelDataOut<wxImage>::wxPixelDataIn<PixelFormat> PixelData;
// go back to (0, 0)
void Reset(const PixelData& data)
{
*this = data.GetPixels();
}
// creates the iterator pointing to the beginning of data
Iterator(PixelData& data)
{
Reset(data);
}
// creates the iterator initially pointing to the image origin
Iterator(const wxImage& image)
{
m_pRGB = image.GetData();
if ( image.HasAlpha() )
{
m_pAlpha = image.GetAlpha();
}
else // alpha is not used at all
{
m_pAlpha = NULL;
}
}
// true if the iterator is valid
bool IsOk() const { return m_pRGB != NULL; }
// navigation
// ----------
// advance the iterator to the next pixel, prefix version
Iterator& operator++()
{
m_pRGB += PixelFormat::SizePixel;
if ( m_pAlpha )
++m_pAlpha;
return *this;
}
// postfix (hence less efficient -- don't use it unless you
// absolutely must) version
Iterator operator++(int)
{
Iterator p(*this);
++*this;
return p;
}
// move x pixels to the right and y down
//
// note that the rows don't wrap!
void Offset(const PixelData& data, int x, int y)
{
m_pRGB += data.GetRowStride()*y + PixelFormat::SizePixel*x;
if ( m_pAlpha )
m_pAlpha += data.GetWidth()*y + x;
}
// move x pixels to the right (again, no row wrapping)
void OffsetX(const PixelData& WXUNUSED(data), int x)
{
m_pRGB += PixelFormat::SizePixel*x;
if ( m_pAlpha )
m_pAlpha += x;
}
// move y rows to the bottom
void OffsetY(const PixelData& data, int y)
{
m_pRGB += data.GetRowStride()*y;
if ( m_pAlpha )
m_pAlpha += data.GetWidth()*y;
}
// go to the given position
void MoveTo(const PixelData& data, int x, int y)
{
Reset(data);
Offset(data, x, y);
}
// data access
// -----------
// access to individual colour components
PixelFormat::ChannelType& Red() { return m_pRGB[PixelFormat::RED]; }
PixelFormat::ChannelType& Green() { return m_pRGB[PixelFormat::GREEN]; }
PixelFormat::ChannelType& Blue() { return m_pRGB[PixelFormat::BLUE]; }
PixelFormat::ChannelType& Alpha() { return *m_pAlpha; }
// address the pixel contents directly (always RGB, without alpha)
//
// this can't be used to modify the image as assigning a 32bpp
// value to 24bpp pixel would overwrite an extra byte in the next
// pixel or beyond the end of image
const typename PixelFormat::PixelType& Data()
{ return *(typename PixelFormat::PixelType *)m_pRGB; }
// private: -- see comment in the beginning of the file
// pointer into RGB buffer
unsigned char *m_pRGB;
// pointer into alpha buffer or NULL if alpha isn't used
unsigned char *m_pAlpha;
};
// initializes us with the data of the given image
wxPixelDataIn(ImageType& image) : m_image(image), m_pixels(image)
{
m_width = image.GetWidth();
m_height = image.GetHeight();
m_stride = Iterator::PixelFormat::SizePixel * m_width;
}
// initializes us with the given region of the specified image
wxPixelDataIn(ImageType& image,
const wxPoint& pt,
const wxSize& sz) : m_image(image), m_pixels(image)
{
m_stride = Iterator::PixelFormat::SizePixel * m_width;
InitRect(pt, sz);
}
// initializes us with the given region of the specified image
wxPixelDataIn(ImageType& image,
const wxRect& rect) : m_image(image), m_pixels(image)
{
m_stride = Iterator::PixelFormat::SizePixel * m_width;
InitRect(rect.GetPosition(), rect.GetSize());
}
// we evaluate to true only if we could get access to bitmap data
// successfully
operator bool() const { return m_pixels.IsOk(); }
// get the iterator pointing to the origin
Iterator GetPixels() const { return m_pixels; }
private:
void InitRect(const wxPoint& pt, const wxSize& sz)
{
m_width = sz.x;
m_height = sz.y;
m_ptOrigin = pt;
m_pixels.Offset(*this, pt.x, pt.y);
}
// the image we're working with
ImageType& m_image;
// the iterator pointing to the image origin
Iterator m_pixels;
};
};
#endif //wxUSE_IMAGE
#if wxUSE_GUI
// wxPixelData specialization for wxBitmap: here things are more interesting as
// we also have to support different pixel formats
template <>
struct wxPixelDataOut<wxBitmap>
{
template <class Format>
class wxPixelDataIn : public wxPixelDataBase
{
public:
// the type of the class we're working with
typedef wxBitmap ImageType;
class Iterator
{
public:
// the pixel format we use
typedef Format PixelFormat;
// the type of the pixel components
typedef typename PixelFormat::ChannelType ChannelType;
// the pixel data we're working with
typedef wxPixelDataOut<wxBitmap>::wxPixelDataIn<Format> PixelData;
// go back to (0, 0)
void Reset(const PixelData& data)
{
*this = data.GetPixels();
}
// initializes the iterator to point to the origin of the given
// pixel data
Iterator(PixelData& data)
{
Reset(data);
}
// initializes the iterator to point to the origin of the given
// bitmap
Iterator(wxBitmap& bmp, PixelData& data)
{
// using cast here is ugly but it should be safe as
// GetRawData() real return type should be consistent with
// BitsPerPixel (which is in turn defined by ChannelType) and
// this is the only thing we can do without making GetRawData()
// a template function which is undesirable
m_ptr = (ChannelType *)
bmp.GetRawData(data, PixelFormat::BitsPerPixel);
}
// default constructor
Iterator()
{
m_ptr = NULL;
}
// return true if this iterator is valid
bool IsOk() const { return m_ptr != NULL; }
// navigation
// ----------
// advance the iterator to the next pixel, prefix version
Iterator& operator++()
{
m_ptr += PixelFormat::SizePixel;
return *this;
}
// postfix (hence less efficient -- don't use it unless you
// absolutely must) version
Iterator operator++(int)
{
Iterator p(*this);
++*this;
return p;
}
// move x pixels to the right and y down
//
// note that the rows don't wrap!
void Offset(const PixelData& data, int x, int y)
{
m_ptr += data.GetRowStride()*y + PixelFormat::SizePixel*x;
}
// move x pixels to the right (again, no row wrapping)
void OffsetX(const PixelData& WXUNUSED(data), int x)
{
m_ptr += PixelFormat::SizePixel*x;
}
// move y rows to the bottom
void OffsetY(const PixelData& data, int y)
{
m_ptr += data.GetRowStride()*y;
}
// go to the given position
void MoveTo(const PixelData& data, int x, int y)
{
Reset(data);
Offset(data, x, y);
}
// data access
// -----------
// access to individual colour components
ChannelType& Red() { return m_ptr[PixelFormat::RED]; }
ChannelType& Green() { return m_ptr[PixelFormat::GREEN]; }
ChannelType& Blue() { return m_ptr[PixelFormat::BLUE]; }
ChannelType& Alpha() { return m_ptr[PixelFormat::ALPHA]; }
// address the pixel contents directly
//
// warning: the format is platform dependent
//
// warning 2: assigning to Data() only works correctly for 16bpp or
// 32bpp formats but using it for 24bpp ones overwrites
// one extra byte and so can't be done
typename PixelFormat::PixelType& Data()
{ return *(typename PixelFormat::PixelType *)m_ptr; }
// private: -- see comment in the beginning of the file
// for efficiency reasons this class should not have any other
// fields, otherwise it won't be put into a CPU register (as it
// should inside the inner loops) by some compilers, notably gcc
ChannelType *m_ptr;
};
// ctor associates this pointer with a bitmap and locks the bitmap for
// raw access, it will be unlocked only by our dtor and so these
// objects should normally be only created on the stack, i.e. have
// limited life-time
wxPixelDataIn(wxBitmap& bmp) : m_bmp(bmp), m_pixels(bmp, *this)
{
}
wxPixelDataIn(wxBitmap& bmp, const wxRect& rect)
: m_bmp(bmp), m_pixels(bmp, *this)
{
InitRect(rect.GetPosition(), rect.GetSize());
}
wxPixelDataIn(wxBitmap& bmp, const wxPoint& pt, const wxSize& sz)
: m_bmp(bmp), m_pixels(bmp, *this)
{
InitRect(pt, sz);
}
// we evaluate to true only if we could get access to bitmap data
// successfully
operator bool() const { return m_pixels.IsOk(); }
// get the iterator pointing to the origin
Iterator GetPixels() const { return m_pixels; }
// dtor unlocks the bitmap
~wxPixelDataIn()
{
if ( m_pixels.IsOk() )
{
#if defined(__WXMSW__) || defined(__WXMAC__)
// this is a hack to mark wxBitmap as using alpha channel
if ( Format::HasAlpha )
m_bmp.UseAlpha();
#endif
m_bmp.UngetRawData(*this);
}
// else: don't call UngetRawData() if GetRawData() failed
}
#if WXWIN_COMPATIBILITY_2_8
// not needed anymore, calls to it should be simply removed
wxDEPRECATED_INLINE( void UseAlpha(), wxEMPTY_PARAMETER_VALUE )
#endif
// private: -- see comment in the beginning of the file
// the bitmap we're associated with
wxBitmap m_bmp;
// the iterator pointing to the image origin
Iterator m_pixels;
private:
void InitRect(const wxPoint& pt, const wxSize& sz)
{
m_pixels.Offset(*this, pt.x, pt.y);
m_ptOrigin = pt;
m_width = sz.x;
m_height = sz.y;
}
};
};
#endif //wxUSE_GUI
template <class Image,
class PixelFormat = typename wxPixelFormatFor<Image>::Format >
class wxPixelData :
public wxPixelDataOut<Image>::template wxPixelDataIn<PixelFormat>
{
public:
typedef
typename wxPixelDataOut<Image>::template wxPixelDataIn<PixelFormat>
Base;
wxPixelData(Image& image) : Base(image) { }
wxPixelData(Image& i, const wxRect& rect) : Base(i, rect) { }
wxPixelData(Image& i, const wxPoint& pt, const wxSize& sz)
: Base(i, pt, sz)
{
}
};
// some "predefined" pixel data classes
#if wxUSE_IMAGE
typedef wxPixelData<wxImage> wxImagePixelData;
#endif //wxUSE_IMAGE
#if wxUSE_GUI
typedef wxPixelData<wxBitmap, wxNativePixelFormat> wxNativePixelData;
typedef wxPixelData<wxBitmap, wxAlphaPixelFormat> wxAlphaPixelData;
#endif //wxUSE_GUI
// ----------------------------------------------------------------------------
// wxPixelIterator
// ----------------------------------------------------------------------------
/*
wxPixel::Iterator represents something which points to the pixel data and
allows us to iterate over it. In the simplest case of wxBitmap it is,
indeed, just a pointer, but it can be something more complicated and,
moreover, you are free to specialize it for other image classes and bitmap
formats.
Note that although it would have been much more intuitive to have a real
class here instead of what we have now, this class would need two template
parameters, and this can't be done because we'd need compiler support for
partial template specialization then and VC7 doesn't provide it.
*/
template < class Image, class PixelFormat = wxPixelFormatFor<Image> >
struct wxPixelIterator : public wxPixelData<Image, PixelFormat>::Iterator
{
};
#endif // wxHAS_RAW_BITMAP
#endif // _WX_RAWBMP_H_
| h |
rticonnextdds-usecases | data/projects/rticonnextdds-usecases/VehicleTracking/ExampleCode/thirdparty/wxWidgets-3.1.2/Win64/include/wx/imagiff.h | /////////////////////////////////////////////////////////////////////////////
// Name: wx/imagiff.h
// Purpose: wxImage handler for Amiga IFF images
// Author: Steffen Gutmann
// Copyright: (c) Steffen Gutmann, 2002
// Licence: wxWindows licence
/////////////////////////////////////////////////////////////////////////////
#ifndef _WX_IMAGE_IFF_H_
#define _WX_IMAGE_IFF_H_
#include "wx/image.h"
//-----------------------------------------------------------------------------
// wxIFFHandler
//-----------------------------------------------------------------------------
#if wxUSE_IMAGE && wxUSE_IFF
class WXDLLIMPEXP_CORE wxIFFHandler : public wxImageHandler
{
public:
wxIFFHandler()
{
m_name = wxT("IFF file");
m_extension = wxT("iff");
m_type = wxBITMAP_TYPE_IFF;
m_mime = wxT("image/x-iff");
}
#if wxUSE_STREAMS
virtual bool LoadFile(wxImage *image, wxInputStream& stream, bool verbose=true, int index=-1) wxOVERRIDE;
virtual bool SaveFile(wxImage *image, wxOutputStream& stream, bool verbose=true) wxOVERRIDE;
protected:
virtual bool DoCanRead(wxInputStream& stream) wxOVERRIDE;
#endif
wxDECLARE_DYNAMIC_CLASS(wxIFFHandler);
};
#endif // wxUSE_IMAGE && wxUSE_IFF
#endif // _WX_IMAGE_IFF_H_
| h |
rticonnextdds-usecases | data/projects/rticonnextdds-usecases/VehicleTracking/ExampleCode/thirdparty/wxWidgets-3.1.2/Win64/include/wx/splitter.h | /////////////////////////////////////////////////////////////////////////////
// Name: wx/splitter.h
// Purpose: Base header for wxSplitterWindow
// Author: Julian Smart
// Modified by:
// Created:
// Copyright: (c) Julian Smart
// Licence: wxWindows Licence
/////////////////////////////////////////////////////////////////////////////
#ifndef _WX_SPLITTER_H_BASE_
#define _WX_SPLITTER_H_BASE_
#include "wx/event.h"
// ----------------------------------------------------------------------------
// wxSplitterWindow flags
// ----------------------------------------------------------------------------
#define wxSP_NOBORDER 0x0000
#define wxSP_THIN_SASH 0x0000 // NB: the default is 3D sash
#define wxSP_NOSASH 0x0010
#define wxSP_PERMIT_UNSPLIT 0x0040
#define wxSP_LIVE_UPDATE 0x0080
#define wxSP_3DSASH 0x0100
#define wxSP_3DBORDER 0x0200
#define wxSP_NO_XP_THEME 0x0400
#define wxSP_BORDER wxSP_3DBORDER
#define wxSP_3D (wxSP_3DBORDER | wxSP_3DSASH)
class WXDLLIMPEXP_FWD_CORE wxSplitterEvent;
wxDECLARE_EXPORTED_EVENT( WXDLLIMPEXP_CORE, wxEVT_SPLITTER_SASH_POS_CHANGED, wxSplitterEvent );
wxDECLARE_EXPORTED_EVENT( WXDLLIMPEXP_CORE, wxEVT_SPLITTER_SASH_POS_CHANGING, wxSplitterEvent );
wxDECLARE_EXPORTED_EVENT( WXDLLIMPEXP_CORE, wxEVT_SPLITTER_DOUBLECLICKED, wxSplitterEvent );
wxDECLARE_EXPORTED_EVENT( WXDLLIMPEXP_CORE, wxEVT_SPLITTER_UNSPLIT, wxSplitterEvent );
#include "wx/generic/splitter.h"
#endif // _WX_SPLITTER_H_BASE_
| h |
rticonnextdds-usecases | data/projects/rticonnextdds-usecases/VehicleTracking/ExampleCode/thirdparty/wxWidgets-3.1.2/Win64/include/wx/mousestate.h | ///////////////////////////////////////////////////////////////////////////////
// Name: wx/mousestate.h
// Purpose: Declaration of wxMouseState class
// Author: Vadim Zeitlin
// Created: 2008-09-19 (extracted from wx/utils.h)
// Copyright: (c) 2008 Vadim Zeitlin <[email protected]>
// Licence: wxWindows licence
///////////////////////////////////////////////////////////////////////////////
#ifndef _WX_MOUSESTATE_H_
#define _WX_MOUSESTATE_H_
#include "wx/gdicmn.h" // for wxPoint
#include "wx/kbdstate.h"
// the symbolic names for the mouse buttons
enum wxMouseButton
{
wxMOUSE_BTN_ANY = -1,
wxMOUSE_BTN_NONE = 0,
wxMOUSE_BTN_LEFT = 1,
wxMOUSE_BTN_MIDDLE = 2,
wxMOUSE_BTN_RIGHT = 3,
wxMOUSE_BTN_AUX1 = 4,
wxMOUSE_BTN_AUX2 = 5,
wxMOUSE_BTN_MAX
};
// ----------------------------------------------------------------------------
// wxMouseState contains the information about mouse position, buttons and also
// key modifiers
// ----------------------------------------------------------------------------
// wxMouseState is used to hold information about button and modifier state
// and is what is returned from wxGetMouseState.
class WXDLLIMPEXP_CORE wxMouseState : public wxKeyboardState
{
public:
wxMouseState()
: m_leftDown(false), m_middleDown(false), m_rightDown(false),
m_aux1Down(false), m_aux2Down(false),
m_x(0), m_y(0)
{
}
// default copy ctor, assignment operator and dtor are ok
// accessors for the mouse position
wxCoord GetX() const { return m_x; }
wxCoord GetY() const { return m_y; }
wxPoint GetPosition() const { return wxPoint(m_x, m_y); }
void GetPosition(wxCoord *x, wxCoord *y) const
{
if ( x )
*x = m_x;
if ( y )
*y = m_y;
}
// this overload is for compatibility only
void GetPosition(long *x, long *y) const
{
if ( x )
*x = m_x;
if ( y )
*y = m_y;
}
// accessors for the pressed buttons
bool LeftIsDown() const { return m_leftDown; }
bool MiddleIsDown() const { return m_middleDown; }
bool RightIsDown() const { return m_rightDown; }
bool Aux1IsDown() const { return m_aux1Down; }
bool Aux2IsDown() const { return m_aux2Down; }
bool ButtonIsDown(wxMouseButton but) const
{
switch ( but )
{
case wxMOUSE_BTN_ANY:
return LeftIsDown() || MiddleIsDown() || RightIsDown() ||
Aux1IsDown() || Aux2IsDown();
case wxMOUSE_BTN_LEFT:
return LeftIsDown();
case wxMOUSE_BTN_MIDDLE:
return MiddleIsDown();
case wxMOUSE_BTN_RIGHT:
return RightIsDown();
case wxMOUSE_BTN_AUX1:
return Aux1IsDown();
case wxMOUSE_BTN_AUX2:
return Aux2IsDown();
case wxMOUSE_BTN_NONE:
case wxMOUSE_BTN_MAX:
break;
}
wxFAIL_MSG(wxS("invalid parameter"));
return false;
}
// these functions are mostly used by wxWidgets itself
void SetX(wxCoord x) { m_x = x; }
void SetY(wxCoord y) { m_y = y; }
void SetPosition(const wxPoint& pos) { m_x = pos.x; m_y = pos.y; }
void SetLeftDown(bool down) { m_leftDown = down; }
void SetMiddleDown(bool down) { m_middleDown = down; }
void SetRightDown(bool down) { m_rightDown = down; }
void SetAux1Down(bool down) { m_aux1Down = down; }
void SetAux2Down(bool down) { m_aux2Down = down; }
// this mostly makes sense in the derived classes such as wxMouseEvent
void SetState(const wxMouseState& state) { *this = state; }
// these functions are for compatibility only, they were used in 2.8
// version of wxMouseState but their names are confusing as wxMouseEvent
// has methods with the same names which do something quite different so
// don't use them any more
#if WXWIN_COMPATIBILITY_2_8
wxDEPRECATED_INLINE(bool LeftDown() const, return LeftIsDown(); )
wxDEPRECATED_INLINE(bool MiddleDown() const, return MiddleIsDown(); )
wxDEPRECATED_INLINE(bool RightDown() const, return RightIsDown(); )
#endif // WXWIN_COMPATIBILITY_2_8
// for compatibility reasons these variables are public as the code using
// wxMouseEvent often uses them directly -- however they should not be
// accessed directly in this class, use the accessors above instead
// private:
bool m_leftDown : 1;
bool m_middleDown : 1;
bool m_rightDown : 1;
bool m_aux1Down : 1;
bool m_aux2Down : 1;
wxCoord m_x,
m_y;
};
#endif // _WX_MOUSESTATE_H_
| h |
rticonnextdds-usecases | data/projects/rticonnextdds-usecases/VehicleTracking/ExampleCode/thirdparty/wxWidgets-3.1.2/Win64/include/wx/choicebk.h | ///////////////////////////////////////////////////////////////////////////////
// Name: wx/choicebk.h
// Purpose: wxChoicebook: wxChoice and wxNotebook combination
// Author: Vadim Zeitlin
// Modified by: Wlodzimierz ABX Skiba from wx/listbook.h
// Created: 15.09.04
// Copyright: (c) Vadim Zeitlin, Wlodzimierz Skiba
// Licence: wxWindows licence
///////////////////////////////////////////////////////////////////////////////
#ifndef _WX_CHOICEBOOK_H_
#define _WX_CHOICEBOOK_H_
#include "wx/defs.h"
#if wxUSE_CHOICEBOOK
#include "wx/bookctrl.h"
#include "wx/choice.h"
#include "wx/containr.h"
class WXDLLIMPEXP_FWD_CORE wxChoice;
wxDECLARE_EXPORTED_EVENT( WXDLLIMPEXP_CORE, wxEVT_CHOICEBOOK_PAGE_CHANGED, wxBookCtrlEvent );
wxDECLARE_EXPORTED_EVENT( WXDLLIMPEXP_CORE, wxEVT_CHOICEBOOK_PAGE_CHANGING, wxBookCtrlEvent );
// wxChoicebook flags
#define wxCHB_DEFAULT wxBK_DEFAULT
#define wxCHB_TOP wxBK_TOP
#define wxCHB_BOTTOM wxBK_BOTTOM
#define wxCHB_LEFT wxBK_LEFT
#define wxCHB_RIGHT wxBK_RIGHT
#define wxCHB_ALIGN_MASK wxBK_ALIGN_MASK
// ----------------------------------------------------------------------------
// wxChoicebook
// ----------------------------------------------------------------------------
class WXDLLIMPEXP_CORE wxChoicebook : public wxNavigationEnabled<wxBookCtrlBase>
{
public:
wxChoicebook() { }
wxChoicebook(wxWindow *parent,
wxWindowID id,
const wxPoint& pos = wxDefaultPosition,
const wxSize& size = wxDefaultSize,
long style = 0,
const wxString& name = wxEmptyString)
{
(void)Create(parent, id, pos, size, style, name);
}
// quasi ctor
bool Create(wxWindow *parent,
wxWindowID id,
const wxPoint& pos = wxDefaultPosition,
const wxSize& size = wxDefaultSize,
long style = 0,
const wxString& name = wxEmptyString);
virtual bool SetPageText(size_t n, const wxString& strText) wxOVERRIDE;
virtual wxString GetPageText(size_t n) const wxOVERRIDE;
virtual int GetPageImage(size_t n) const wxOVERRIDE;
virtual bool SetPageImage(size_t n, int imageId) wxOVERRIDE;
virtual bool InsertPage(size_t n,
wxWindow *page,
const wxString& text,
bool bSelect = false,
int imageId = NO_IMAGE) wxOVERRIDE;
virtual int SetSelection(size_t n) wxOVERRIDE
{ return DoSetSelection(n, SetSelection_SendEvent); }
virtual int ChangeSelection(size_t n) wxOVERRIDE { return DoSetSelection(n); }
virtual void SetImageList(wxImageList *imageList) wxOVERRIDE;
virtual bool DeleteAllPages() wxOVERRIDE;
// returns the choice control
wxChoice* GetChoiceCtrl() const { return (wxChoice*)m_bookctrl; }
protected:
virtual void DoSetWindowVariant(wxWindowVariant variant) wxOVERRIDE;
virtual wxWindow *DoRemovePage(size_t page) wxOVERRIDE;
void UpdateSelectedPage(size_t newsel) wxOVERRIDE
{
GetChoiceCtrl()->Select(newsel);
}
wxBookCtrlEvent* CreatePageChangingEvent() const wxOVERRIDE;
void MakeChangedEvent(wxBookCtrlEvent &event) wxOVERRIDE;
// event handlers
void OnChoiceSelected(wxCommandEvent& event);
private:
wxDECLARE_EVENT_TABLE();
wxDECLARE_DYNAMIC_CLASS_NO_COPY(wxChoicebook);
};
// ----------------------------------------------------------------------------
// choicebook event class and related stuff
// ----------------------------------------------------------------------------
// wxChoicebookEvent is obsolete and defined for compatibility only
#define wxChoicebookEvent wxBookCtrlEvent
typedef wxBookCtrlEventFunction wxChoicebookEventFunction;
#define wxChoicebookEventHandler(func) wxBookCtrlEventHandler(func)
#define EVT_CHOICEBOOK_PAGE_CHANGED(winid, fn) \
wx__DECLARE_EVT1(wxEVT_CHOICEBOOK_PAGE_CHANGED, winid, wxBookCtrlEventHandler(fn))
#define EVT_CHOICEBOOK_PAGE_CHANGING(winid, fn) \
wx__DECLARE_EVT1(wxEVT_CHOICEBOOK_PAGE_CHANGING, winid, wxBookCtrlEventHandler(fn))
// old wxEVT_COMMAND_* constants
#define wxEVT_COMMAND_CHOICEBOOK_PAGE_CHANGED wxEVT_CHOICEBOOK_PAGE_CHANGED
#define wxEVT_COMMAND_CHOICEBOOK_PAGE_CHANGING wxEVT_CHOICEBOOK_PAGE_CHANGING
#endif // wxUSE_CHOICEBOOK
#endif // _WX_CHOICEBOOK_H_
| h |
rticonnextdds-usecases | data/projects/rticonnextdds-usecases/VehicleTracking/ExampleCode/thirdparty/wxWidgets-3.1.2/Win64/include/wx/combobox.h | ///////////////////////////////////////////////////////////////////////////////
// Name: wx/combobox.h
// Purpose: wxComboBox declaration
// Author: Vadim Zeitlin
// Modified by:
// Created: 24.12.00
// Copyright: (c) 1996-2000 wxWidgets team
// Licence: wxWindows licence
///////////////////////////////////////////////////////////////////////////////
#ifndef _WX_COMBOBOX_H_BASE_
#define _WX_COMBOBOX_H_BASE_
#include "wx/defs.h"
#if wxUSE_COMBOBOX
// For compatibility with 2.8 include this header to allow using wxTE_XXX
// styles with wxComboBox without explicitly including it in the user code.
#include "wx/textctrl.h"
extern WXDLLIMPEXP_DATA_CORE(const char) wxComboBoxNameStr[];
// ----------------------------------------------------------------------------
// wxComboBoxBase: this interface defines the methods wxComboBox must implement
// ----------------------------------------------------------------------------
#include "wx/ctrlsub.h"
#include "wx/textentry.h"
class WXDLLIMPEXP_CORE wxComboBoxBase : public wxItemContainer,
public wxTextEntry
{
public:
// override these methods to disambiguate between two base classes versions
virtual void Clear() wxOVERRIDE
{
wxTextEntry::Clear();
wxItemContainer::Clear();
}
// IsEmpty() is ambiguous because we inherit it from both wxItemContainer
// and wxTextEntry, and even if defined it here to help the compiler with
// choosing one of them, it would still be confusing for the human users of
// this class. So instead define the clearly named methods below and leave
// IsEmpty() ambiguous to trigger a compilation error if it's used.
bool IsListEmpty() const { return wxItemContainer::IsEmpty(); }
bool IsTextEmpty() const { return wxTextEntry::IsEmpty(); }
// also bring in GetSelection() versions of both base classes in scope
//
// NB: GetSelection(from, to) could be already implemented in wxTextEntry
// but still make it pure virtual because for some platforms it's not
// implemented there and also because the derived class has to override
// it anyhow to avoid ambiguity with the other GetSelection()
virtual int GetSelection() const wxOVERRIDE = 0;
virtual void GetSelection(long *from, long *to) const wxOVERRIDE = 0;
virtual void Popup() { wxFAIL_MSG( wxT("Not implemented") ); }
virtual void Dismiss() { wxFAIL_MSG( wxT("Not implemented") ); }
// may return value different from GetSelection() when the combobox
// dropdown is shown and the user selected, but not yet accepted, a value
// different from the old one in it
virtual int GetCurrentSelection() const { return GetSelection(); }
};
// ----------------------------------------------------------------------------
// include the platform-dependent header defining the real class
// ----------------------------------------------------------------------------
#if defined(__WXUNIVERSAL__)
#include "wx/univ/combobox.h"
#elif defined(__WXMSW__)
#include "wx/msw/combobox.h"
#elif defined(__WXMOTIF__)
#include "wx/motif/combobox.h"
#elif defined(__WXGTK20__)
#include "wx/gtk/combobox.h"
#elif defined(__WXGTK__)
#include "wx/gtk1/combobox.h"
#elif defined(__WXMAC__)
#include "wx/osx/combobox.h"
#elif defined(__WXQT__)
#include "wx/qt/combobox.h"
#endif
#endif // wxUSE_COMBOBOX
#endif // _WX_COMBOBOX_H_BASE_
| h |
rticonnextdds-usecases | data/projects/rticonnextdds-usecases/VehicleTracking/ExampleCode/thirdparty/wxWidgets-3.1.2/Win64/include/wx/atomic.h | /////////////////////////////////////////////////////////////////////////////
// Name: wx/atomic.h
// Purpose: functions to manipulate atomically integers and pointers
// Author: Armel Asselin
// Created: 12/13/2006
// Copyright: (c) Armel Asselin
// Licence: wxWindows licence
/////////////////////////////////////////////////////////////////////////////
#ifndef _WX_ATOMIC_H_
#define _WX_ATOMIC_H_
// ----------------------------------------------------------------------------
// headers
// ----------------------------------------------------------------------------
// get the value of wxUSE_THREADS configuration flag
#include "wx/defs.h"
// constraints on the various functions:
// - wxAtomicDec must return a zero value if the value is zero once
// decremented else it must return any non-zero value (the true value is OK
// but not necessary).
#if wxUSE_THREADS
#if defined(HAVE_GCC_ATOMIC_BUILTINS)
// NB: we intentionally don't use Linux's asm/atomic.h header, because it's
// an internal kernel header that doesn't always work in userspace:
// http://bugs.mysql.com/bug.php?id=28456
// http://golubenco.org/blog/atomic-operations/
inline void wxAtomicInc (wxUint32 &value)
{
__sync_fetch_and_add(&value, 1);
}
inline wxUint32 wxAtomicDec (wxUint32 &value)
{
return __sync_sub_and_fetch(&value, 1);
}
#elif defined(__WINDOWS__)
// include standard Windows headers
#include "wx/msw/wrapwin.h"
inline void wxAtomicInc (wxUint32 &value)
{
InterlockedIncrement ((LONG*)&value);
}
inline wxUint32 wxAtomicDec (wxUint32 &value)
{
return InterlockedDecrement ((LONG*)&value);
}
#elif defined(__DARWIN__)
#include "libkern/OSAtomic.h"
inline void wxAtomicInc (wxUint32 &value)
{
OSAtomicIncrement32 ((int32_t*)&value);
}
inline wxUint32 wxAtomicDec (wxUint32 &value)
{
return OSAtomicDecrement32 ((int32_t*)&value);
}
#elif defined (__SOLARIS__)
#include <atomic.h>
inline void wxAtomicInc (wxUint32 &value)
{
atomic_add_32 ((uint32_t*)&value, 1);
}
inline wxUint32 wxAtomicDec (wxUint32 &value)
{
return atomic_add_32_nv ((uint32_t*)&value, (uint32_t)-1);
}
#else // unknown platform
// it will result in inclusion if the generic implementation code a bit later in this page
#define wxNEEDS_GENERIC_ATOMIC_OPS
#endif // unknown platform
#else // else of wxUSE_THREADS
// if no threads are used we can safely use simple ++/--
inline void wxAtomicInc (wxUint32 &value) { ++value; }
inline wxUint32 wxAtomicDec (wxUint32 &value) { return --value; }
#endif // !wxUSE_THREADS
// ----------------------------------------------------------------------------
// proxies to actual implementations, but for various other types with same
// behaviour
// ----------------------------------------------------------------------------
#ifdef wxNEEDS_GENERIC_ATOMIC_OPS
#include "wx/thread.h" // for wxCriticalSection
class wxAtomicInt32
{
public:
wxAtomicInt32() { } // non initialized for consistency with basic int type
wxAtomicInt32(wxInt32 v) : m_value(v) { }
wxAtomicInt32(const wxAtomicInt32& a) : m_value(a.m_value) {}
operator wxInt32() const { return m_value; }
operator volatile wxInt32&() { return m_value; }
wxAtomicInt32& operator=(wxInt32 v) { m_value = v; return *this; }
void Inc()
{
wxCriticalSectionLocker lock(m_locker);
++m_value;
}
wxInt32 Dec()
{
wxCriticalSectionLocker lock(m_locker);
return --m_value;
}
private:
volatile wxInt32 m_value;
wxCriticalSection m_locker;
};
inline void wxAtomicInc(wxAtomicInt32 &value) { value.Inc(); }
inline wxInt32 wxAtomicDec(wxAtomicInt32 &value) { return value.Dec(); }
#else // !wxNEEDS_GENERIC_ATOMIC_OPS
#define wxHAS_ATOMIC_OPS
inline void wxAtomicInc(wxInt32 &value) { wxAtomicInc((wxUint32&)value); }
inline wxInt32 wxAtomicDec(wxInt32 &value) { return wxAtomicDec((wxUint32&)value); }
typedef wxInt32 wxAtomicInt32;
#endif // wxNEEDS_GENERIC_ATOMIC_OPS
// all the native implementations use 32 bits currently
// for a 64 bits implementation we could use (a future) wxAtomicInt64 as
// default type
typedef wxAtomicInt32 wxAtomicInt;
#endif // _WX_ATOMIC_H_
| h |
rticonnextdds-usecases | data/projects/rticonnextdds-usecases/VehicleTracking/ExampleCode/thirdparty/wxWidgets-3.1.2/Win64/include/wx/filename.h | /////////////////////////////////////////////////////////////////////////////
// Name: wx/filename.h
// Purpose: wxFileName - encapsulates a file path
// Author: Robert Roebling, Vadim Zeitlin
// Modified by:
// Created: 28.12.00
// Copyright: (c) 2000 Robert Roebling
// Licence: wxWindows licence
/////////////////////////////////////////////////////////////////////////////
#ifndef _WX_FILENAME_H_
#define _WX_FILENAME_H_
#include "wx/arrstr.h"
#include "wx/filefn.h"
#include "wx/datetime.h"
#include "wx/intl.h"
#include "wx/longlong.h"
#include "wx/file.h"
#if wxUSE_FILE
class WXDLLIMPEXP_FWD_BASE wxFile;
#endif
#if wxUSE_FFILE
class WXDLLIMPEXP_FWD_BASE wxFFile;
#endif
// this symbol is defined for the platforms where file systems use volumes in
// paths
#if defined(__WINDOWS__)
#define wxHAS_FILESYSTEM_VOLUMES
#endif
// ----------------------------------------------------------------------------
// constants
// ----------------------------------------------------------------------------
// the various values for the path format: this mainly affects the path
// separator but also whether or not the path has the drive part (as under
// Windows)
enum wxPathFormat
{
wxPATH_NATIVE = 0, // the path format for the current platform
wxPATH_UNIX,
wxPATH_BEOS = wxPATH_UNIX,
wxPATH_MAC,
wxPATH_DOS,
wxPATH_WIN = wxPATH_DOS,
wxPATH_OS2 = wxPATH_DOS,
wxPATH_VMS,
wxPATH_MAX // Not a valid value for specifying path format
};
// different conventions that may be used with GetHumanReadableSize()
enum wxSizeConvention
{
wxSIZE_CONV_TRADITIONAL, // 1024 bytes = 1 KB
wxSIZE_CONV_IEC, // 1024 bytes = 1 KiB
wxSIZE_CONV_SI // 1000 bytes = 1 KB
};
// the kind of normalization to do with the file name: these values can be
// or'd together to perform several operations at once
enum wxPathNormalize
{
wxPATH_NORM_ENV_VARS = 0x0001, // replace env vars with their values
wxPATH_NORM_DOTS = 0x0002, // squeeze all .. and .
wxPATH_NORM_TILDE = 0x0004, // Unix only: replace ~ and ~user
wxPATH_NORM_CASE = 0x0008, // if case insensitive => tolower
wxPATH_NORM_ABSOLUTE = 0x0010, // make the path absolute
wxPATH_NORM_LONG = 0x0020, // make the path the long form
wxPATH_NORM_SHORTCUT = 0x0040, // resolve the shortcut, if it is a shortcut
wxPATH_NORM_ALL = 0x00ff & ~wxPATH_NORM_CASE
};
// what exactly should GetPath() return?
enum
{
wxPATH_NO_SEPARATOR = 0x0000, // for symmetry with wxPATH_GET_SEPARATOR
wxPATH_GET_VOLUME = 0x0001, // include the volume if applicable
wxPATH_GET_SEPARATOR = 0x0002 // terminate the path with the separator
};
// Mkdir flags
enum
{
wxPATH_MKDIR_FULL = 0x0001 // create directories recursively
};
// Rmdir flags
enum
{
wxPATH_RMDIR_FULL = 0x0001, // delete with subdirectories if empty
wxPATH_RMDIR_RECURSIVE = 0x0002 // delete all recursively (dangerous!)
};
// FileExists flags
enum
{
wxFILE_EXISTS_REGULAR = 0x0001, // check for existence of a regular file
wxFILE_EXISTS_DIR = 0x0002, // check for existence of a directory
wxFILE_EXISTS_SYMLINK = 0x1004, // check for existence of a symbolic link;
// also sets wxFILE_EXISTS_NO_FOLLOW as
// it would never be satisfied otherwise
wxFILE_EXISTS_DEVICE = 0x0008, // check for existence of a device
wxFILE_EXISTS_FIFO = 0x0016, // check for existence of a FIFO
wxFILE_EXISTS_SOCKET = 0x0032, // check for existence of a socket
// gap for future types
wxFILE_EXISTS_NO_FOLLOW = 0x1000, // don't dereference a contained symlink
wxFILE_EXISTS_ANY = 0x1FFF // check for existence of anything
};
#if wxUSE_LONGLONG
// error code of wxFileName::GetSize()
extern WXDLLIMPEXP_DATA_BASE(const wxULongLong) wxInvalidSize;
#endif // wxUSE_LONGLONG
// ----------------------------------------------------------------------------
// wxFileName: encapsulates a file path
// ----------------------------------------------------------------------------
class WXDLLIMPEXP_BASE wxFileName
{
public:
// constructors and assignment
// the usual stuff
wxFileName() { Clear(); }
wxFileName(const wxFileName& filepath) { Assign(filepath); }
// from a full filename: if it terminates with a '/', a directory path
// is contructed (the name will be empty), otherwise a file name and
// extension are extracted from it
wxFileName( const wxString& fullpath, wxPathFormat format = wxPATH_NATIVE )
{ Assign( fullpath, format ); m_dontFollowLinks = false; }
// from a directory name and a file name
wxFileName(const wxString& path,
const wxString& name,
wxPathFormat format = wxPATH_NATIVE)
{ Assign(path, name, format); m_dontFollowLinks = false; }
// from a volume, directory name, file base name and extension
wxFileName(const wxString& volume,
const wxString& path,
const wxString& name,
const wxString& ext,
wxPathFormat format = wxPATH_NATIVE)
{ Assign(volume, path, name, ext, format); m_dontFollowLinks = false; }
// from a directory name, file base name and extension
wxFileName(const wxString& path,
const wxString& name,
const wxString& ext,
wxPathFormat format = wxPATH_NATIVE)
{ Assign(path, name, ext, format); m_dontFollowLinks = false; }
// the same for delayed initialization
void Assign(const wxFileName& filepath);
void Assign(const wxString& fullpath,
wxPathFormat format = wxPATH_NATIVE);
void Assign(const wxString& volume,
const wxString& path,
const wxString& name,
const wxString& ext,
bool hasExt,
wxPathFormat format = wxPATH_NATIVE);
void Assign(const wxString& volume,
const wxString& path,
const wxString& name,
const wxString& ext,
wxPathFormat format = wxPATH_NATIVE)
{ Assign(volume, path, name, ext, !ext.empty(), format); }
void Assign(const wxString& path,
const wxString& name,
wxPathFormat format = wxPATH_NATIVE);
void Assign(const wxString& path,
const wxString& name,
const wxString& ext,
wxPathFormat format = wxPATH_NATIVE);
void AssignDir(const wxString& dir, wxPathFormat format = wxPATH_NATIVE);
// assorted assignment operators
wxFileName& operator=(const wxFileName& filename)
{ if (this != &filename) Assign(filename); return *this; }
wxFileName& operator=(const wxString& filename)
{ Assign(filename); return *this; }
// reset all components to default, uninitialized state
void Clear();
// static pseudo constructors
static wxFileName FileName(const wxString& file,
wxPathFormat format = wxPATH_NATIVE);
static wxFileName DirName(const wxString& dir,
wxPathFormat format = wxPATH_NATIVE);
// file tests
// is the filename valid at all?
bool IsOk() const
{
// we're fine if we have the path or the name or if we're a root dir
return m_dirs.size() != 0 || !m_name.empty() || !m_relative ||
!m_ext.empty() || m_hasExt;
}
// does the file with this name exist?
bool FileExists() const;
static bool FileExists( const wxString &file );
// does the directory with this name exist?
bool DirExists() const;
static bool DirExists( const wxString &dir );
// does anything at all with this name (i.e. file, directory or some
// other file system object such as a device, socket, ...) exist?
bool Exists(int flags = wxFILE_EXISTS_ANY) const;
static bool Exists(const wxString& path, int flags = wxFILE_EXISTS_ANY);
// checks on most common flags for files/directories;
// more platform-specific features (like e.g. Unix permissions) are not
// available in wxFileName
bool IsDirWritable() const { return wxIsWritable(GetPath()); }
static bool IsDirWritable(const wxString &path) { return wxDirExists(path) && wxIsWritable(path); }
bool IsDirReadable() const { return wxIsReadable(GetPath()); }
static bool IsDirReadable(const wxString &path) { return wxDirExists(path) && wxIsReadable(path); }
// NOTE: IsDirExecutable() is not present because the meaning of "executable"
// directory is very platform-dependent and also not so useful
bool IsFileWritable() const { return wxIsWritable(GetFullPath()); }
static bool IsFileWritable(const wxString &path) { return wxFileExists(path) && wxIsWritable(path); }
bool IsFileReadable() const { return wxIsReadable(GetFullPath()); }
static bool IsFileReadable(const wxString &path) { return wxFileExists(path) && wxIsReadable(path); }
bool IsFileExecutable() const { return wxIsExecutable(GetFullPath()); }
static bool IsFileExecutable(const wxString &path) { return wxFileExists(path) && wxIsExecutable(path); }
// set the file permissions to a combination of wxPosixPermissions enum
// values
bool SetPermissions(int permissions);
// time functions
#if wxUSE_DATETIME
// set the file last access/mod and creation times
// (any of the pointers may be NULL)
bool SetTimes(const wxDateTime *dtAccess,
const wxDateTime *dtMod,
const wxDateTime *dtCreate) const;
// set the access and modification times to the current moment
bool Touch() const;
// return the last access, last modification and create times
// (any of the pointers may be NULL)
bool GetTimes(wxDateTime *dtAccess,
wxDateTime *dtMod,
wxDateTime *dtCreate) const;
// convenience wrapper: get just the last mod time of the file
wxDateTime GetModificationTime() const
{
wxDateTime dtMod;
(void)GetTimes(NULL, &dtMod, NULL);
return dtMod;
}
#endif // wxUSE_DATETIME
// various file/dir operations
// retrieve the value of the current working directory
void AssignCwd(const wxString& volume = wxEmptyString);
static wxString GetCwd(const wxString& volume = wxEmptyString);
// change the current working directory
bool SetCwd() const;
static bool SetCwd( const wxString &cwd );
// get the value of user home (Unix only mainly)
void AssignHomeDir();
static wxString GetHomeDir();
// get the system temporary directory
static wxString GetTempDir();
#if wxUSE_FILE || wxUSE_FFILE
// get a temp file name starting with the specified prefix
void AssignTempFileName(const wxString& prefix);
static wxString CreateTempFileName(const wxString& prefix);
#endif // wxUSE_FILE
#if wxUSE_FILE
// get a temp file name starting with the specified prefix and open the
// file passed to us using this name for writing (atomically if
// possible)
void AssignTempFileName(const wxString& prefix, wxFile *fileTemp);
static wxString CreateTempFileName(const wxString& prefix,
wxFile *fileTemp);
#endif // wxUSE_FILE
#if wxUSE_FFILE
// get a temp file name starting with the specified prefix and open the
// file passed to us using this name for writing (atomically if
// possible)
void AssignTempFileName(const wxString& prefix, wxFFile *fileTemp);
static wxString CreateTempFileName(const wxString& prefix,
wxFFile *fileTemp);
#endif // wxUSE_FFILE
// directory creation and removal.
bool Mkdir(int perm = wxS_DIR_DEFAULT, int flags = 0) const;
static bool Mkdir(const wxString &dir, int perm = wxS_DIR_DEFAULT,
int flags = 0);
bool Rmdir(int flags = 0) const;
static bool Rmdir(const wxString &dir, int flags = 0);
// operations on the path
// normalize the path: with the default flags value, the path will be
// made absolute, without any ".." and "." and all environment
// variables will be expanded in it
//
// this may be done using another (than current) value of cwd
bool Normalize(int flags = wxPATH_NORM_ALL,
const wxString& cwd = wxEmptyString,
wxPathFormat format = wxPATH_NATIVE);
// get a path path relative to the given base directory, i.e. opposite
// of Normalize
//
// pass an empty string to get a path relative to the working directory
//
// returns true if the file name was modified, false if we failed to do
// anything with it (happens when the file is on a different volume,
// for example)
bool MakeRelativeTo(const wxString& pathBase = wxEmptyString,
wxPathFormat format = wxPATH_NATIVE);
// make the path absolute
//
// this may be done using another (than current) value of cwd
bool MakeAbsolute(const wxString& cwd = wxEmptyString,
wxPathFormat format = wxPATH_NATIVE)
{ return Normalize(wxPATH_NORM_DOTS | wxPATH_NORM_ABSOLUTE |
wxPATH_NORM_TILDE, cwd, format); }
// If the path is a symbolic link (Unix-only), indicate that all
// filesystem operations on this path should be performed on the link
// itself and not on the file it points to, as is the case by default.
//
// No effect if this is not a symbolic link.
void DontFollowLink()
{
m_dontFollowLinks = true;
}
// If the path is a symbolic link (Unix-only), returns whether various
// file operations should act on the link itself, or on its target.
//
// This does not test if the path is really a symlink or not.
bool ShouldFollowLink() const
{
return !m_dontFollowLinks;
}
#if defined(__WIN32__) && wxUSE_OLE
// if the path is a shortcut, return the target and optionally,
// the arguments
bool GetShortcutTarget(const wxString& shortcutPath,
wxString& targetFilename,
wxString* arguments = NULL) const;
#endif
// if the path contains the value of the environment variable named envname
// then this function replaces it with the string obtained from
// wxString::Format(replacementFmtString, value_of_envname_variable)
//
// Example:
// wxFileName fn("/usr/openwin/lib/someFile");
// fn.ReplaceEnvVariable("OPENWINHOME");
// // now fn.GetFullPath() == "$OPENWINHOME/lib/someFile"
bool ReplaceEnvVariable(const wxString& envname,
const wxString& replacementFmtString = "$%s",
wxPathFormat format = wxPATH_NATIVE);
// replaces, if present in the path, the home directory for the given user
// (see wxGetHomeDir) with a tilde
bool ReplaceHomeDir(wxPathFormat format = wxPATH_NATIVE);
// Comparison
// compares with the rules of the given platforms format
bool SameAs(const wxFileName& filepath,
wxPathFormat format = wxPATH_NATIVE) const;
// compare with another filename object
bool operator==(const wxFileName& filename) const
{ return SameAs(filename); }
bool operator!=(const wxFileName& filename) const
{ return !SameAs(filename); }
// compare with a filename string interpreted as a native file name
bool operator==(const wxString& filename) const
{ return SameAs(wxFileName(filename)); }
bool operator!=(const wxString& filename) const
{ return !SameAs(wxFileName(filename)); }
// are the file names of this type cases sensitive?
static bool IsCaseSensitive( wxPathFormat format = wxPATH_NATIVE );
// is this filename absolute?
bool IsAbsolute(wxPathFormat format = wxPATH_NATIVE) const;
// is this filename relative?
bool IsRelative(wxPathFormat format = wxPATH_NATIVE) const
{ return !IsAbsolute(format); }
// Returns the characters that aren't allowed in filenames
// on the specified platform.
static wxString GetForbiddenChars(wxPathFormat format = wxPATH_NATIVE);
// Information about path format
// get the string separating the volume from the path for this format,
// return an empty string if this format doesn't support the notion of
// volumes at all
static wxString GetVolumeSeparator(wxPathFormat format = wxPATH_NATIVE);
// get the string of path separators for this format
static wxString GetPathSeparators(wxPathFormat format = wxPATH_NATIVE);
// get the string of path terminators, i.e. characters which terminate the
// path
static wxString GetPathTerminators(wxPathFormat format = wxPATH_NATIVE);
// get the canonical path separator for this format
static wxUniChar GetPathSeparator(wxPathFormat format = wxPATH_NATIVE)
{ return GetPathSeparators(format)[0u]; }
// is the char a path separator for this format?
static bool IsPathSeparator(wxChar ch, wxPathFormat format = wxPATH_NATIVE);
// is this is a DOS path which beings with a windows unique volume name
// ('\\?\Volume{guid}\')?
static bool IsMSWUniqueVolumeNamePath(const wxString& path,
wxPathFormat format = wxPATH_NATIVE);
// Dir accessors
size_t GetDirCount() const { return m_dirs.size(); }
bool AppendDir(const wxString& dir);
void PrependDir(const wxString& dir);
bool InsertDir(size_t before, const wxString& dir);
void RemoveDir(size_t pos);
void RemoveLastDir() { RemoveDir(GetDirCount() - 1); }
// Other accessors
void SetExt( const wxString &ext ) { m_ext = ext; m_hasExt = !m_ext.empty(); }
void ClearExt() { m_ext.clear(); m_hasExt = false; }
void SetEmptyExt() { m_ext.clear(); m_hasExt = true; }
wxString GetExt() const { return m_ext; }
bool HasExt() const { return m_hasExt; }
void SetName( const wxString &name ) { m_name = name; }
wxString GetName() const { return m_name; }
bool HasName() const { return !m_name.empty(); }
void SetVolume( const wxString &volume ) { m_volume = volume; }
wxString GetVolume() const { return m_volume; }
bool HasVolume() const { return !m_volume.empty(); }
// full name is the file name + extension (but without the path)
void SetFullName(const wxString& fullname);
wxString GetFullName() const;
const wxArrayString& GetDirs() const { return m_dirs; }
// flags are combination of wxPATH_GET_XXX flags
wxString GetPath(int flags = wxPATH_GET_VOLUME,
wxPathFormat format = wxPATH_NATIVE) const;
// Replace current path with this one
void SetPath( const wxString &path, wxPathFormat format = wxPATH_NATIVE );
// Construct full path with name and ext
wxString GetFullPath( wxPathFormat format = wxPATH_NATIVE ) const;
// Return the short form of the path (returns identity on non-Windows platforms)
wxString GetShortPath() const;
// Return the long form of the path (returns identity on non-Windows platforms)
wxString GetLongPath() const;
// Is this a file or directory (not necessarily an existing one)
bool IsDir() const { return m_name.empty() && m_ext.empty(); }
// various helpers
// get the canonical path format for this platform
static wxPathFormat GetFormat( wxPathFormat format = wxPATH_NATIVE );
// split a fullpath into the volume, path, (base) name and extension
// (all of the pointers can be NULL)
static void SplitPath(const wxString& fullpath,
wxString *volume,
wxString *path,
wxString *name,
wxString *ext,
bool *hasExt = NULL,
wxPathFormat format = wxPATH_NATIVE);
static void SplitPath(const wxString& fullpath,
wxString *volume,
wxString *path,
wxString *name,
wxString *ext,
wxPathFormat format)
{
SplitPath(fullpath, volume, path, name, ext, NULL, format);
}
// compatibility version: volume is part of path
static void SplitPath(const wxString& fullpath,
wxString *path,
wxString *name,
wxString *ext,
wxPathFormat format = wxPATH_NATIVE);
// split a path into volume and pure path part
static void SplitVolume(const wxString& fullpathWithVolume,
wxString *volume,
wxString *path,
wxPathFormat format = wxPATH_NATIVE);
// strip the file extension: "foo.bar" => "foo" (but ".baz" => ".baz")
static wxString StripExtension(const wxString& fullpath);
#ifdef wxHAS_FILESYSTEM_VOLUMES
// return the string representing a file system volume, or drive
static wxString GetVolumeString(char drive, int flags = wxPATH_GET_SEPARATOR);
#endif // wxHAS_FILESYSTEM_VOLUMES
// File size
#if wxUSE_LONGLONG
// returns the size of the given filename
wxULongLong GetSize() const;
static wxULongLong GetSize(const wxString &file);
// returns the size in a human readable form
wxString
GetHumanReadableSize(const wxString& nullsize = wxGetTranslation("Not available"),
int precision = 1,
wxSizeConvention conv = wxSIZE_CONV_TRADITIONAL) const;
static wxString
GetHumanReadableSize(const wxULongLong& sz,
const wxString& nullsize = wxGetTranslation("Not available"),
int precision = 1,
wxSizeConvention conv = wxSIZE_CONV_TRADITIONAL);
#endif // wxUSE_LONGLONG
// deprecated methods, don't use any more
// --------------------------------------
wxString GetPath( bool withSep, wxPathFormat format = wxPATH_NATIVE ) const
{ return GetPath(withSep ? wxPATH_GET_SEPARATOR : 0, format); }
wxString GetPathWithSep(wxPathFormat format = wxPATH_NATIVE ) const
{ return GetPath(wxPATH_GET_VOLUME | wxPATH_GET_SEPARATOR, format); }
private:
// check whether this dir is valid for Append/Prepend/InsertDir()
static bool IsValidDirComponent(const wxString& dir);
// the drive/volume/device specification (always empty for Unix)
wxString m_volume;
// the path components of the file
wxArrayString m_dirs;
// the file name and extension (empty for directories)
wxString m_name,
m_ext;
// when m_dirs is empty it may mean either that we have no path at all or
// that our path is '/', i.e. the root directory
//
// we use m_relative to distinguish between these two cases, it will be
// true in the former and false in the latter
//
// NB: the path is not absolute just because m_relative is false, it still
// needs the drive (i.e. volume) in some formats (Windows)
bool m_relative;
// when m_ext is empty, it may be because we don't have any extension or
// because we have an empty extension
//
// the difference is important as file with name "foo" and without
// extension has full name "foo" while with empty extension it is "foo."
bool m_hasExt;
// by default, symlinks are dereferenced but this flag can be set with
// DontFollowLink() to change this and make different operations work on
// this file path itself instead of the target of the symlink
bool m_dontFollowLinks;
};
#endif // _WX_FILENAME_H_
| h |
rticonnextdds-usecases | data/projects/rticonnextdds-usecases/VehicleTracking/ExampleCode/thirdparty/wxWidgets-3.1.2/Win64/include/wx/anidecod.h | /////////////////////////////////////////////////////////////////////////////
// Name: wx/anidecod.h
// Purpose: wxANIDecoder, ANI reader for wxImage and wxAnimation
// Author: Francesco Montorsi
// Copyright: (c) 2006 Francesco Montorsi
// Licence: wxWindows licence
/////////////////////////////////////////////////////////////////////////////
#ifndef _WX_ANIDECOD_H
#define _WX_ANIDECOD_H
#include "wx/defs.h"
#if wxUSE_STREAMS && (wxUSE_ICO_CUR || wxUSE_GIF)
#include "wx/stream.h"
#include "wx/image.h"
#include "wx/animdecod.h"
#include "wx/dynarray.h"
class /*WXDLLIMPEXP_CORE*/ wxANIFrameInfo; // private implementation detail
WX_DECLARE_EXPORTED_OBJARRAY(wxANIFrameInfo, wxANIFrameInfoArray);
WX_DECLARE_EXPORTED_OBJARRAY(wxImage, wxImageArray);
// --------------------------------------------------------------------------
// wxANIDecoder class
// --------------------------------------------------------------------------
class WXDLLIMPEXP_CORE wxANIDecoder : public wxAnimationDecoder
{
public:
// constructor, destructor, etc.
wxANIDecoder();
~wxANIDecoder();
virtual wxSize GetFrameSize(unsigned int frame) const wxOVERRIDE;
virtual wxPoint GetFramePosition(unsigned int frame) const wxOVERRIDE;
virtual wxAnimationDisposal GetDisposalMethod(unsigned int frame) const wxOVERRIDE;
virtual long GetDelay(unsigned int frame) const wxOVERRIDE;
virtual wxColour GetTransparentColour(unsigned int frame) const wxOVERRIDE;
// implementation of wxAnimationDecoder's pure virtuals
virtual bool Load( wxInputStream& stream ) wxOVERRIDE;
bool ConvertToImage(unsigned int frame, wxImage *image) const wxOVERRIDE;
wxAnimationDecoder *Clone() const wxOVERRIDE
{ return new wxANIDecoder; }
wxAnimationType GetType() const wxOVERRIDE
{ return wxANIMATION_TYPE_ANI; }
private:
// wxAnimationDecoder pure virtual:
virtual bool DoCanRead( wxInputStream& stream ) const wxOVERRIDE;
// modifies current stream position (see wxAnimationDecoder::CanRead)
// frames stored as wxImage(s): ANI files are meant to be used mostly for animated
// cursors and thus they do not use any optimization to encode differences between
// two frames: they are just a list of images to display sequentially.
wxImageArray m_images;
// the info about each image stored in m_images.
// NB: m_info.GetCount() may differ from m_images.GetCount()!
wxANIFrameInfoArray m_info;
// this is the wxCURHandler used to load the ICON chunk of the ANI files
static wxCURHandler sm_handler;
wxDECLARE_NO_COPY_CLASS(wxANIDecoder);
};
#endif // wxUSE_STREAMS && (wxUSE_ICO_CUR || wxUSE_GIF)
#endif // _WX_ANIDECOD_H
| h |
rticonnextdds-usecases | data/projects/rticonnextdds-usecases/VehicleTracking/ExampleCode/thirdparty/wxWidgets-3.1.2/Win64/include/wx/setup_inc.h | ///////////////////////////////////////////////////////////////////////////////
// Name: wx/setup_inc.h
// Purpose: setup.h settings
// Author: Vadim Zeitlin
// Modified by:
// Created:
// Copyright: (c) Vadim Zeitlin
// Licence: wxWindows licence
///////////////////////////////////////////////////////////////////////////////
// ----------------------------------------------------------------------------
// global settings
// ----------------------------------------------------------------------------
// define this to 0 when building wxBase library - this can also be done from
// makefile/project file overriding the value here
#ifndef wxUSE_GUI
#define wxUSE_GUI 1
#endif // wxUSE_GUI
// ----------------------------------------------------------------------------
// compatibility settings
// ----------------------------------------------------------------------------
// This setting determines the compatibility with 2.8 API: set it to 0 to
// flag all cases of using deprecated functions.
//
// Default is 1 but please try building your code with 0 as the default will
// change to 0 in the next version and the deprecated functions will disappear
// in the version after it completely.
//
// Recommended setting: 0 (please update your code)
#define WXWIN_COMPATIBILITY_2_8 0
// This setting determines the compatibility with 3.0 API: set it to 0 to
// flag all cases of using deprecated functions.
//
// Default is 1 but please try building your code with 0 as the default will
// change to 0 in the next version and the deprecated functions will disappear
// in the version after it completely.
//
// Recommended setting: 0 (please update your code)
#define WXWIN_COMPATIBILITY_3_0 1
// MSW-only: Set to 0 for accurate dialog units, else 1 for old behaviour when
// default system font is used for wxWindow::GetCharWidth/Height() instead of
// the current font.
//
// Default is 0
//
// Recommended setting: 0
#define wxDIALOG_UNIT_COMPATIBILITY 0
// Provide unsafe implicit conversions in wxString to "const char*" or
// "std::string" (depending on wxUSE_STD_STRING_CONV_IN_WXSTRING value).
//
// Default is 1 but only for compatibility reasons, it is recommended to set
// this to 0 because converting wxString to a narrow (non-Unicode) string may
// fail unless a locale using UTF-8 encoding is used, which is never the case
// under MSW, for example, hence such conversions can result in silent data
// loss.
//
// Recommended setting: 0
#define wxUSE_UNSAFE_WXSTRING_CONV 1
// If set to 1, enables "reproducible builds", i.e. build output should be
// exactly the same if the same build is redone again. As using __DATE__ and
// __TIME__ macros clearly makes the build irreproducible, setting this option
// to 1 disables their use in the library code.
//
// Default is 0
//
// Recommended setting: 0
#define wxUSE_REPRODUCIBLE_BUILD 0
// ----------------------------------------------------------------------------
// debugging settings
// ----------------------------------------------------------------------------
// wxDEBUG_LEVEL will be defined as 1 in wx/debug.h so normally there is no
// need to define it here. You may do it for two reasons: either completely
// disable/compile out the asserts in release version (then do it inside #ifdef
// NDEBUG) or, on the contrary, enable more asserts, including the usually
// disabled ones, in the debug build (then do it inside #ifndef NDEBUG)
//
// #ifdef NDEBUG
// #define wxDEBUG_LEVEL 0
// #else
// #define wxDEBUG_LEVEL 2
// #endif
// wxHandleFatalExceptions() may be used to catch the program faults at run
// time and, instead of terminating the program with a usual GPF message box,
// call the user-defined wxApp::OnFatalException() function. If you set
// wxUSE_ON_FATAL_EXCEPTION to 0, wxHandleFatalExceptions() will not work.
//
// This setting is for Win32 only and can only be enabled if your compiler
// supports Win32 structured exception handling (currently only VC++ does)
//
// Default is 1
//
// Recommended setting: 1 if your compiler supports it.
#define wxUSE_ON_FATAL_EXCEPTION 1
// Set this to 1 to be able to generate a human-readable (unlike
// machine-readable minidump created by wxCrashReport::Generate()) stack back
// trace when your program crashes using wxStackWalker
//
// Default is 1 if supported by the compiler.
//
// Recommended setting: 1, set to 0 if your programs never crash
#define wxUSE_STACKWALKER 1
// Set this to 1 to compile in wxDebugReport class which allows you to create
// and optionally upload to your web site a debug report consisting of back
// trace of the crash (if wxUSE_STACKWALKER == 1) and other information.
//
// Default is 1 if supported by the compiler.
//
// Recommended setting: 1, it is compiled into a separate library so there
// is no overhead if you don't use it
#define wxUSE_DEBUGREPORT 1
// Generic comment about debugging settings: they are very useful if you don't
// use any other memory leak detection tools such as Purify/BoundsChecker, but
// are probably redundant otherwise. Also, Visual C++ CRT has the same features
// as wxWidgets memory debugging subsystem built in since version 5.0 and you
// may prefer to use it instead of built in memory debugging code because it is
// faster and more fool proof.
//
// Using VC++ CRT memory debugging is enabled by default in debug build (_DEBUG
// is defined) if wxUSE_GLOBAL_MEMORY_OPERATORS is *not* enabled (i.e. is 0)
// and if __NO_VC_CRTDBG__ is not defined.
// The rest of the options in this section are obsolete and not supported,
// enable them at your own risk.
// If 1, enables wxDebugContext, for writing error messages to file, etc. If
// __WXDEBUG__ is not defined, will still use the normal memory operators.
//
// Default is 0
//
// Recommended setting: 0
#define wxUSE_DEBUG_CONTEXT 0
// If 1, enables debugging versions of wxObject::new and wxObject::delete *IF*
// __WXDEBUG__ is also defined.
//
// WARNING: this code may not work with all architectures, especially if
// alignment is an issue. This switch is currently ignored for mingw / cygwin
//
// Default is 0
//
// Recommended setting: 1 if you are not using a memory debugging tool, else 0
#define wxUSE_MEMORY_TRACING 0
// In debug mode, cause new and delete to be redefined globally.
// If this causes problems (e.g. link errors which is a common problem
// especially if you use another library which also redefines the global new
// and delete), set this to 0.
// This switch is currently ignored for mingw / cygwin
//
// Default is 0
//
// Recommended setting: 0
#define wxUSE_GLOBAL_MEMORY_OPERATORS 0
// In debug mode, causes new to be defined to be WXDEBUG_NEW (see object.h). If
// this causes problems (e.g. link errors), set this to 0. You may need to set
// this to 0 if using templates (at least for VC++). This switch is currently
// ignored for MinGW/Cygwin.
//
// Default is 0
//
// Recommended setting: 0
#define wxUSE_DEBUG_NEW_ALWAYS 0
// ----------------------------------------------------------------------------
// Unicode support
// ----------------------------------------------------------------------------
// These settings are obsolete: the library is always built in Unicode mode
// now, only set wxUSE_UNICODE to 0 to compile legacy code in ANSI mode if
// absolutely necessary -- updating it is strongly recommended as the ANSI mode
// will disappear completely in future wxWidgets releases.
#ifndef wxUSE_UNICODE
#define wxUSE_UNICODE 1
#endif
// wxUSE_WCHAR_T is required by wxWidgets now, don't change.
#define wxUSE_WCHAR_T 1
// ----------------------------------------------------------------------------
// global features
// ----------------------------------------------------------------------------
// Compile library in exception-safe mode? If set to 1, the library will try to
// behave correctly in presence of exceptions (even though it still will not
// use the exceptions itself) and notify the user code about any unhandled
// exceptions. If set to 0, propagation of the exceptions through the library
// code will lead to undefined behaviour -- but the code itself will be
// slightly smaller and faster.
//
// Note that like wxUSE_THREADS this option is automatically set to 0 if
// wxNO_EXCEPTIONS is defined.
//
// Default is 1
//
// Recommended setting: depends on whether you intend to use C++ exceptions
// in your own code (1 if you do, 0 if you don't)
#define wxUSE_EXCEPTIONS 1
// Set wxUSE_EXTENDED_RTTI to 1 to use extended RTTI
//
// Default is 0
//
// Recommended setting: 0 (this is still work in progress...)
#define wxUSE_EXTENDED_RTTI 0
// Support for message/error logging. This includes wxLogXXX() functions and
// wxLog and derived classes. Don't set this to 0 unless you really know what
// you are doing.
//
// Default is 1
//
// Recommended setting: 1 (always)
#define wxUSE_LOG 1
// Recommended setting: 1
#define wxUSE_LOGWINDOW 1
// Recommended setting: 1
#define wxUSE_LOGGUI 1
// Recommended setting: 1
#define wxUSE_LOG_DIALOG 1
// Support for command line parsing using wxCmdLineParser class.
//
// Default is 1
//
// Recommended setting: 1 (can be set to 0 if you don't use the cmd line)
#define wxUSE_CMDLINE_PARSER 1
// Support for multithreaded applications: if 1, compile in thread classes
// (thread.h) and make the library a bit more thread safe. Although thread
// support is quite stable by now, you may still consider recompiling the
// library without it if you have no use for it - this will result in a
// somewhat smaller and faster operation.
//
// Notice that if wxNO_THREADS is defined, wxUSE_THREADS is automatically reset
// to 0 in wx/chkconf.h, so, for example, if you set USE_THREADS to 0 in
// build/msw/config.* file this value will have no effect.
//
// Default is 1
//
// Recommended setting: 0 unless you do plan to develop MT applications
#define wxUSE_THREADS 1
// If enabled, compiles wxWidgets streams classes
//
// wx stream classes are used for image IO, process IO redirection, network
// protocols implementation and much more and so disabling this results in a
// lot of other functionality being lost.
//
// Default is 1
//
// Recommended setting: 1 as setting it to 0 disables many other things
#define wxUSE_STREAMS 1
// Support for positional parameters (e.g. %1$d, %2$s ...) in wxVsnprintf.
// Note that if the system's implementation does not support positional
// parameters, setting this to 1 forces the use of the wxWidgets implementation
// of wxVsnprintf. The standard vsnprintf() supports positional parameters on
// many Unix systems but usually doesn't under Windows.
//
// Positional parameters are very useful when translating a program since using
// them in formatting strings allow translators to correctly reorder the
// translated sentences.
//
// Default is 1
//
// Recommended setting: 1 if you want to support multiple languages
#define wxUSE_PRINTF_POS_PARAMS 1
// Enable the use of compiler-specific thread local storage keyword, if any.
// This is used for wxTLS_XXX() macros implementation and normally should use
// the compiler-provided support as it's simpler and more efficient, but is
// disabled under Windows in wx/msw/chkconf.h as it can't be used if wxWidgets
// is used in a dynamically loaded Win32 DLL (i.e. using LoadLibrary()) under
// XP as this triggers a bug in compiler TLS support that results in crashes
// when any TLS variables are used.
//
// If you're absolutely sure that your build of wxWidgets is never going to be
// used in such situation, either because it's not going to be linked from any
// kind of plugin or because you only target Vista or later systems, you can
// set this to 2 to force the use of compiler TLS even under MSW.
//
// Default is 1 meaning that compiler TLS is used only if it's 100% safe.
//
// Recommended setting: 2 if you want to have maximal performance and don't
// care about the scenario described above.
#define wxUSE_COMPILER_TLS 1
// ----------------------------------------------------------------------------
// Interoperability with the standard library.
// ----------------------------------------------------------------------------
// Set wxUSE_STL to 1 to enable maximal interoperability with the standard
// library, even at the cost of backwards compatibility.
//
// Default is 0
//
// Recommended setting: 0 as the options below already provide a relatively
// good level of interoperability and changing this option arguably isn't worth
// diverging from the official builds of the library.
#define wxUSE_STL 0
// This is not a real option but is used as the default value for
// wxUSE_STD_IOSTREAM, wxUSE_STD_STRING and wxUSE_STD_CONTAINERS_COMPATIBLY.
//
// Set it to 0 if you want to disable the use of all standard classes
// completely for some reason.
#define wxUSE_STD_DEFAULT 1
// Use standard C++ containers where it can be done without breaking backwards
// compatibility.
//
// This provides better interoperability with the standard library, e.g. with
// this option on it's possible to insert std::vector<> into many wxWidgets
// containers directly.
//
// Default is 1.
//
// Recommended setting is 1 unless you want to avoid all dependencies on the
// standard library.
#define wxUSE_STD_CONTAINERS_COMPATIBLY wxUSE_STD_DEFAULT
// Use standard C++ containers to implement wxVector<>, wxStack<>, wxDList<>
// and wxHashXXX<> classes. If disabled, wxWidgets own (mostly compatible but
// usually more limited) implementations are used which allows to avoid the
// dependency on the C++ run-time library.
//
// Default is 0 for compatibility reasons.
//
// Recommended setting: 1 unless compatibility with the official wxWidgets
// build and/or the existing code is a concern.
#define wxUSE_STD_CONTAINERS 0
// Use standard C++ streams if 1 instead of wx streams in some places. If
// disabled, wx streams are used everywhere and wxWidgets doesn't depend on the
// standard streams library.
//
// Notice that enabling this does not replace wx streams with std streams
// everywhere, in a lot of places wx streams are used no matter what.
//
// Default is 1 if compiler supports it.
//
// Recommended setting: 1 if you use the standard streams anyhow and so
// dependency on the standard streams library is not a
// problem
#define wxUSE_STD_IOSTREAM wxUSE_STD_DEFAULT
// Enable minimal interoperability with the standard C++ string class if 1.
// "Minimal" means that wxString can be constructed from std::string or
// std::wstring but can't be implicitly converted to them. You need to enable
// the option below for the latter.
//
// Default is 1 for most compilers.
//
// Recommended setting: 1 unless you want to ensure your program doesn't use
// the standard C++ library at all.
#define wxUSE_STD_STRING wxUSE_STD_DEFAULT
// Make wxString as much interchangeable with std::[w]string as possible, in
// particular allow implicit conversion of wxString to either of these classes.
// This comes at a price (or a benefit, depending on your point of view) of not
// allowing implicit conversion to "const char *" and "const wchar_t *".
//
// Because a lot of existing code relies on these conversions, this option is
// disabled by default but can be enabled for your build if you don't care
// about compatibility.
//
// Default is 0 if wxUSE_STL has its default value or 1 if it is enabled.
//
// Recommended setting: 0 to remain compatible with the official builds of
// wxWidgets.
#define wxUSE_STD_STRING_CONV_IN_WXSTRING wxUSE_STL
// VC++ 4.2 and above allows <iostream> and <iostream.h> but you can't mix
// them. Set this option to 1 to use <iostream.h>, 0 to use <iostream>.
//
// Note that newer compilers (including VC++ 7.1 and later) don't support
// wxUSE_IOSTREAMH == 1 and so <iostream> will be used anyhow.
//
// Default is 0.
//
// Recommended setting: 0, only set to 1 if you use a really old compiler
#define wxUSE_IOSTREAMH 0
// ----------------------------------------------------------------------------
// non GUI features selection
// ----------------------------------------------------------------------------
// Set wxUSE_LONGLONG to 1 to compile the wxLongLong class. This is a 64 bit
// integer which is implemented in terms of native 64 bit integers if any or
// uses emulation otherwise.
//
// This class is required by wxDateTime and so you should enable it if you want
// to use wxDateTime. For most modern platforms, it will use the native 64 bit
// integers in which case (almost) all of its functions are inline and it
// almost does not take any space, so there should be no reason to switch it
// off.
//
// Recommended setting: 1
#define wxUSE_LONGLONG 1
// Set wxUSE_BASE64 to 1, to compile in Base64 support. This is required for
// storing binary data in wxConfig on most platforms.
//
// Default is 1.
//
// Recommended setting: 1 (but can be safely disabled if you don't use it)
#define wxUSE_BASE64 1
// Set this to 1 to be able to use wxEventLoop even in console applications
// (i.e. using base library only, without GUI). This is mostly useful for
// processing socket events but is also necessary to use timers in console
// applications
//
// Default is 1.
//
// Recommended setting: 1 (but can be safely disabled if you don't use it)
#define wxUSE_CONSOLE_EVENTLOOP 1
// Set wxUSE_(F)FILE to 1 to compile wx(F)File classes. wxFile uses low level
// POSIX functions for file access, wxFFile uses ANSI C stdio.h functions.
//
// Default is 1
//
// Recommended setting: 1 (wxFile is highly recommended as it is required by
// i18n code, wxFileConfig and others)
#define wxUSE_FILE 1
#define wxUSE_FFILE 1
// Use wxFSVolume class providing access to the configured/active mount points
//
// Default is 1
//
// Recommended setting: 1 (but may be safely disabled if you don't use it)
#define wxUSE_FSVOLUME 1
// Use wxSecretStore class for storing passwords using OS-specific facilities.
//
// Default is 1
//
// Recommended setting: 1 (but may be safely disabled if you don't use it)
#define wxUSE_SECRETSTORE 1
// Use wxStandardPaths class which allows to retrieve some standard locations
// in the file system
//
// Default is 1
//
// Recommended setting: 1 (may be disabled to save space, but not much)
#define wxUSE_STDPATHS 1
// use wxTextBuffer class: required by wxTextFile
#define wxUSE_TEXTBUFFER 1
// use wxTextFile class: requires wxFile and wxTextBuffer, required by
// wxFileConfig
#define wxUSE_TEXTFILE 1
// i18n support: _() macro, wxLocale class. Requires wxTextFile.
#define wxUSE_INTL 1
// Provide wxFoo_l() functions similar to standard foo() functions but taking
// an extra locale parameter.
//
// Notice that this is fully implemented only for the systems providing POSIX
// xlocale support or Microsoft Visual C++ >= 8 (which provides proprietary
// almost-equivalent of xlocale functions), otherwise wxFoo_l() functions will
// only work for the current user locale and "C" locale. You can use
// wxHAS_XLOCALE_SUPPORT to test whether the full support is available.
//
// Default is 1
//
// Recommended setting: 1 but may be disabled if you are writing programs
// running only in C locale anyhow
#define wxUSE_XLOCALE 1
// Set wxUSE_DATETIME to 1 to compile the wxDateTime and related classes which
// allow to manipulate dates, times and time intervals.
//
// Requires: wxUSE_LONGLONG
//
// Default is 1
//
// Recommended setting: 1
#define wxUSE_DATETIME 1
// Set wxUSE_TIMER to 1 to compile wxTimer class
//
// Default is 1
//
// Recommended setting: 1
#define wxUSE_TIMER 1
// Use wxStopWatch clas.
//
// Default is 1
//
// Recommended setting: 1 (needed by wxSocket)
#define wxUSE_STOPWATCH 1
// Set wxUSE_FSWATCHER to 1 if you want to enable wxFileSystemWatcher
//
// Default is 1
//
// Recommended setting: 1
#define wxUSE_FSWATCHER 1
// Setting wxUSE_CONFIG to 1 enables the use of wxConfig and related classes
// which allow the application to store its settings in the persistent
// storage. Setting this to 1 will also enable on-demand creation of the
// global config object in wxApp.
//
// See also wxUSE_CONFIG_NATIVE below.
//
// Recommended setting: 1
#define wxUSE_CONFIG 1
// If wxUSE_CONFIG is 1, you may choose to use either the native config
// classes under Windows (using .INI files under Win16 and the registry under
// Win32) or the portable text file format used by the config classes under
// Unix.
//
// Default is 1 to use native classes. Note that you may still use
// wxFileConfig even if you set this to 1 - just the config object created by
// default for the applications needs will be a wxRegConfig or wxIniConfig and
// not wxFileConfig.
//
// Recommended setting: 1
#define wxUSE_CONFIG_NATIVE 1
// If wxUSE_DIALUP_MANAGER is 1, compile in wxDialUpManager class which allows
// to connect/disconnect from the network and be notified whenever the dial-up
// network connection is established/terminated. Requires wxUSE_DYNAMIC_LOADER.
//
// Default is 1.
//
// Recommended setting: 1
#define wxUSE_DIALUP_MANAGER 1
// Compile in classes for run-time DLL loading and function calling.
// Required by wxUSE_DIALUP_MANAGER.
//
// This setting is for Win32 only
//
// Default is 1.
//
// Recommended setting: 1
#define wxUSE_DYNLIB_CLASS 1
// experimental, don't use for now
#define wxUSE_DYNAMIC_LOADER 1
// Set to 1 to use socket classes
#define wxUSE_SOCKETS 1
// Set to 1 to use ipv6 socket classes (requires wxUSE_SOCKETS)
//
// Notice that currently setting this option under Windows will result in
// programs which can only run on recent OS versions (with ws2_32.dll
// installed) which is why it is disabled by default.
//
// Default is 1.
//
// Recommended setting: 1 if you need IPv6 support
#define wxUSE_IPV6 0
// Set to 1 to enable virtual file systems (required by wxHTML)
#define wxUSE_FILESYSTEM 1
// Set to 1 to enable virtual ZIP filesystem (requires wxUSE_FILESYSTEM)
#define wxUSE_FS_ZIP 1
// Set to 1 to enable virtual archive filesystem (requires wxUSE_FILESYSTEM)
#define wxUSE_FS_ARCHIVE 1
// Set to 1 to enable virtual Internet filesystem (requires wxUSE_FILESYSTEM)
#define wxUSE_FS_INET 1
// wxArchive classes for accessing archives such as zip and tar
#define wxUSE_ARCHIVE_STREAMS 1
// Set to 1 to compile wxZipInput/OutputStream classes.
#define wxUSE_ZIPSTREAM 1
// Set to 1 to compile wxTarInput/OutputStream classes.
#define wxUSE_TARSTREAM 1
// Set to 1 to compile wxZlibInput/OutputStream classes. Also required by
// wxUSE_LIBPNG
#define wxUSE_ZLIB 1
// Set to 1 if liblzma is available to enable wxLZMA{Input,Output}Stream
// classes.
//
// Notice that if you enable this build option when not using configure or
// CMake, you need to ensure that liblzma headers and libraries are available
// (i.e. by building the library yourself or downloading its binaries) and can
// be found, either by copying them to one of the locations searched by the
// compiler/linker by default (e.g. any of the directories in the INCLUDE or
// LIB environment variables, respectively, when using MSVC) or modify the
// make- or project files to add references to these directories.
//
// Default is 0 under MSW, auto-detected by configure.
//
// Recommended setting: 1 if you need LZMA compression.
#define wxUSE_LIBLZMA 0
// If enabled, the code written by Apple will be used to write, in a portable
// way, float on the disk. See extended.c for the license which is different
// from wxWidgets one.
//
// Default is 1.
//
// Recommended setting: 1 unless you don't like the license terms (unlikely)
#define wxUSE_APPLE_IEEE 1
// Joystick support class
#define wxUSE_JOYSTICK 1
// wxFontEnumerator class
#define wxUSE_FONTENUM 1
// wxFontMapper class
#define wxUSE_FONTMAP 1
// wxMimeTypesManager class
#define wxUSE_MIMETYPE 1
// wxProtocol and related classes: if you want to use either of wxFTP, wxHTTP
// or wxURL you need to set this to 1.
//
// Default is 1.
//
// Recommended setting: 1
#define wxUSE_PROTOCOL 1
// The settings for the individual URL schemes
#define wxUSE_PROTOCOL_FILE 1
#define wxUSE_PROTOCOL_FTP 1
#define wxUSE_PROTOCOL_HTTP 1
// Define this to use wxURL class.
#define wxUSE_URL 1
// Define this to use native platform url and protocol support.
// Currently valid only for MS-Windows.
// Note: if you set this to 1, you can open ftp/http/gopher sites
// and obtain a valid input stream for these sites
// even when you set wxUSE_PROTOCOL_FTP/HTTP to 0.
// Doing so reduces the code size.
//
// This code is experimental and subject to change.
#define wxUSE_URL_NATIVE 0
// Support for wxVariant class used in several places throughout the library,
// notably in wxDataViewCtrl API.
//
// Default is 1.
//
// Recommended setting: 1 unless you want to reduce the library size as much as
// possible in which case setting this to 0 can gain up to 100KB.
#define wxUSE_VARIANT 1
// Support for wxAny class, the successor for wxVariant.
//
// Default is 1.
//
// Recommended setting: 1 unless you want to reduce the library size by a small amount,
// or your compiler cannot for some reason cope with complexity of templates used.
#define wxUSE_ANY 1
// Support for regular expression matching via wxRegEx class: enable this to
// use POSIX regular expressions in your code. You need to compile regex
// library from src/regex to use it under Windows.
//
// Default is 0
//
// Recommended setting: 1 if your compiler supports it, if it doesn't please
// contribute us a makefile for src/regex for it
#define wxUSE_REGEX 1
// wxSystemOptions class
#define wxUSE_SYSTEM_OPTIONS 1
// wxSound class
#define wxUSE_SOUND 1
// Use wxMediaCtrl
//
// Default is 1.
//
// Recommended setting: 1
#define wxUSE_MEDIACTRL 1
// Use wxWidget's XRC XML-based resource system. Recommended.
//
// Default is 1
//
// Recommended setting: 1 (requires wxUSE_XML)
#define wxUSE_XRC 1
// XML parsing classes. Note that their API will change in the future, so
// using wxXmlDocument and wxXmlNode in your app is not recommended.
//
// Default is the same as wxUSE_XRC, i.e. 1 by default.
//
// Recommended setting: 1 (required by XRC)
#define wxUSE_XML wxUSE_XRC
// Use wxWidget's AUI docking system
//
// Default is 1
//
// Recommended setting: 1
#define wxUSE_AUI 1
// Use wxWidget's Ribbon classes for interfaces
//
// Default is 1
//
// Recommended setting: 1
#define wxUSE_RIBBON 1
// Use wxPropertyGrid.
//
// Default is 1
//
// Recommended setting: 1
#define wxUSE_PROPGRID 1
// Use wxStyledTextCtrl, a wxWidgets implementation of Scintilla.
//
// Default is 1
//
// Recommended setting: 1
#define wxUSE_STC 1
// Use wxWidget's web viewing classes
//
// Default is 1
//
// Recommended setting: 1
#define wxUSE_WEBVIEW 1
// Use the IE wxWebView backend
//
// Default is 1 on MSW
//
// Recommended setting: 1
#ifdef __WXMSW__
#define wxUSE_WEBVIEW_IE 1
#else
#define wxUSE_WEBVIEW_IE 0
#endif
// Use the WebKit wxWebView backend
//
// Default is 1 on GTK and OSX
//
// Recommended setting: 1
#if (defined(__WXGTK__) && !defined(__WXGTK3__)) || defined(__WXOSX__)
#define wxUSE_WEBVIEW_WEBKIT 1
#else
#define wxUSE_WEBVIEW_WEBKIT 0
#endif
// Use the WebKit2 wxWebView backend
//
// Default is 1 on GTK3
//
// Recommended setting: 1
#if defined(__WXGTK3__)
#define wxUSE_WEBVIEW_WEBKIT2 1
#else
#define wxUSE_WEBVIEW_WEBKIT2 0
#endif
// Enable wxGraphicsContext and related classes for a modern 2D drawing API.
//
// Default is 1 except if you're using a compiler without support for GDI+
// under MSW, i.e. gdiplus.h and related headers (MSVC and MinGW >= 4.8 are
// known to have them). For other compilers (e.g. older mingw32) you may need
// to install the headers (and just the headers) yourself. If you do, change
// the setting below manually.
//
// Recommended setting: 1 if supported by the compilation environment
// Notice that we can't use wxCHECK_VISUALC_VERSION() nor wxCHECK_GCC_VERSION()
// here as this file is included from wx/platform.h before they're defined.
#if defined(_MSC_VER) || \
(defined(__MINGW32__) && (__GNUC__ > 4 || __GNUC_MINOR__ >= 8))
#define wxUSE_GRAPHICS_CONTEXT 1
#else
// Disable support for other Windows compilers, enable it if your compiler
// comes with new enough SDK or you installed the headers manually.
//
// Notice that this will be set by configure under non-Windows platforms
// anyhow so the value there is not important.
#define wxUSE_GRAPHICS_CONTEXT 0
#endif
// Enable wxGraphicsContext implementation using Cairo library.
//
// This is not needed under Windows and detected automatically by configure
// under other systems, however you may set this to 1 manually if you installed
// Cairo under Windows yourself and prefer to use it instead the native GDI+
// implementation.
//
// Default is 0
//
// Recommended setting: 0
#define wxUSE_CAIRO 0
// ----------------------------------------------------------------------------
// Individual GUI controls
// ----------------------------------------------------------------------------
// You must set wxUSE_CONTROLS to 1 if you are using any controls at all
// (without it, wxControl class is not compiled)
//
// Default is 1
//
// Recommended setting: 1 (don't change except for very special programs)
#define wxUSE_CONTROLS 1
// Support markup in control labels, i.e. provide wxControl::SetLabelMarkup().
// Currently markup is supported only by a few controls and only some ports but
// their number will increase with time.
//
// Default is 1
//
// Recommended setting: 1 (may be set to 0 if you want to save on code size)
#define wxUSE_MARKUP 1
// wxPopupWindow class is a top level transient window. It is currently used
// to implement wxTipWindow
//
// Default is 1
//
// Recommended setting: 1 (may be set to 0 if you don't wxUSE_TIPWINDOW)
#define wxUSE_POPUPWIN 1
// wxTipWindow allows to implement the custom tooltips, it is used by the
// context help classes. Requires wxUSE_POPUPWIN.
//
// Default is 1
//
// Recommended setting: 1 (may be set to 0)
#define wxUSE_TIPWINDOW 1
// Each of the settings below corresponds to one wxWidgets control. They are
// all switched on by default but may be disabled if you are sure that your
// program (including any standard dialogs it can show!) doesn't need them and
// if you desperately want to save some space. If you use any of these you must
// set wxUSE_CONTROLS as well.
//
// Default is 1
//
// Recommended setting: 1
#define wxUSE_ACTIVITYINDICATOR 1 // wxActivityIndicator
#define wxUSE_ANIMATIONCTRL 1 // wxAnimationCtrl
#define wxUSE_BANNERWINDOW 1 // wxBannerWindow
#define wxUSE_BUTTON 1 // wxButton
#define wxUSE_BMPBUTTON 1 // wxBitmapButton
#define wxUSE_CALENDARCTRL 1 // wxCalendarCtrl
#define wxUSE_CHECKBOX 1 // wxCheckBox
#define wxUSE_CHECKLISTBOX 1 // wxCheckListBox (requires wxUSE_OWNER_DRAWN)
#define wxUSE_CHOICE 1 // wxChoice
#define wxUSE_COLLPANE 1 // wxCollapsiblePane
#define wxUSE_COLOURPICKERCTRL 1 // wxColourPickerCtrl
#define wxUSE_COMBOBOX 1 // wxComboBox
#define wxUSE_COMMANDLINKBUTTON 1 // wxCommandLinkButton
#define wxUSE_DATAVIEWCTRL 1 // wxDataViewCtrl
#define wxUSE_DATEPICKCTRL 1 // wxDatePickerCtrl
#define wxUSE_DIRPICKERCTRL 1 // wxDirPickerCtrl
#define wxUSE_EDITABLELISTBOX 1 // wxEditableListBox
#define wxUSE_FILECTRL 1 // wxFileCtrl
#define wxUSE_FILEPICKERCTRL 1 // wxFilePickerCtrl
#define wxUSE_FONTPICKERCTRL 1 // wxFontPickerCtrl
#define wxUSE_GAUGE 1 // wxGauge
#define wxUSE_HEADERCTRL 1 // wxHeaderCtrl
#define wxUSE_HYPERLINKCTRL 1 // wxHyperlinkCtrl
#define wxUSE_LISTBOX 1 // wxListBox
#define wxUSE_LISTCTRL 1 // wxListCtrl
#define wxUSE_RADIOBOX 1 // wxRadioBox
#define wxUSE_RADIOBTN 1 // wxRadioButton
#define wxUSE_RICHMSGDLG 1 // wxRichMessageDialog
#define wxUSE_SCROLLBAR 1 // wxScrollBar
#define wxUSE_SEARCHCTRL 1 // wxSearchCtrl
#define wxUSE_SLIDER 1 // wxSlider
#define wxUSE_SPINBTN 1 // wxSpinButton
#define wxUSE_SPINCTRL 1 // wxSpinCtrl
#define wxUSE_STATBOX 1 // wxStaticBox
#define wxUSE_STATLINE 1 // wxStaticLine
#define wxUSE_STATTEXT 1 // wxStaticText
#define wxUSE_STATBMP 1 // wxStaticBitmap
#define wxUSE_TEXTCTRL 1 // wxTextCtrl
#define wxUSE_TIMEPICKCTRL 1 // wxTimePickerCtrl
#define wxUSE_TOGGLEBTN 1 // requires wxButton
#define wxUSE_TREECTRL 1 // wxTreeCtrl
#define wxUSE_TREELISTCTRL 1 // wxTreeListCtrl
// Use a status bar class? Depending on the value of wxUSE_NATIVE_STATUSBAR
// below either wxStatusBar95 or a generic wxStatusBar will be used.
//
// Default is 1
//
// Recommended setting: 1
#define wxUSE_STATUSBAR 1
// Two status bar implementations are available under Win32: the generic one
// or the wrapper around native control. For native look and feel the native
// version should be used.
//
// Default is 1 for the platforms where native status bar is supported.
//
// Recommended setting: 1 (there is no advantage in using the generic one)
#define wxUSE_NATIVE_STATUSBAR 1
// wxToolBar related settings: if wxUSE_TOOLBAR is 0, don't compile any toolbar
// classes at all. Otherwise, use the native toolbar class unless
// wxUSE_TOOLBAR_NATIVE is 0.
//
// Default is 1 for all settings.
//
// Recommended setting: 1 for wxUSE_TOOLBAR and wxUSE_TOOLBAR_NATIVE.
#define wxUSE_TOOLBAR 1
#define wxUSE_TOOLBAR_NATIVE 1
// wxNotebook is a control with several "tabs" located on one of its sides. It
// may be used to logically organise the data presented to the user instead of
// putting everything in one huge dialog. It replaces wxTabControl and related
// classes of wxWin 1.6x.
//
// Default is 1.
//
// Recommended setting: 1
#define wxUSE_NOTEBOOK 1
// wxListbook control is similar to wxNotebook but uses wxListCtrl instead of
// the tabs
//
// Default is 1.
//
// Recommended setting: 1
#define wxUSE_LISTBOOK 1
// wxChoicebook control is similar to wxNotebook but uses wxChoice instead of
// the tabs
//
// Default is 1.
//
// Recommended setting: 1
#define wxUSE_CHOICEBOOK 1
// wxTreebook control is similar to wxNotebook but uses wxTreeCtrl instead of
// the tabs
//
// Default is 1.
//
// Recommended setting: 1
#define wxUSE_TREEBOOK 1
// wxToolbook control is similar to wxNotebook but uses wxToolBar instead of
// tabs
//
// Default is 1.
//
// Recommended setting: 1
#define wxUSE_TOOLBOOK 1
// wxTaskBarIcon is a small notification icon shown in the system toolbar or
// dock.
//
// Default is 1.
//
// Recommended setting: 1 (but can be set to 0 if you don't need it)
#define wxUSE_TASKBARICON 1
// wxGrid class
//
// Default is 1, set to 0 to cut down compilation time and binaries size if you
// don't use it.
//
// Recommended setting: 1
//
#define wxUSE_GRID 1
// wxMiniFrame class: a frame with narrow title bar
//
// Default is 1.
//
// Recommended setting: 1 (it doesn't cost almost anything)
#define wxUSE_MINIFRAME 1
// wxComboCtrl and related classes: combobox with custom popup window and
// not necessarily a listbox.
//
// Default is 1.
//
// Recommended setting: 1 but can be safely set to 0 except for wxUniv where it
// it used by wxComboBox
#define wxUSE_COMBOCTRL 1
// wxOwnerDrawnComboBox is a custom combobox allowing to paint the combobox
// items.
//
// Default is 1.
//
// Recommended setting: 1 but can be safely set to 0, except where it is
// needed as a base class for generic wxBitmapComboBox.
#define wxUSE_ODCOMBOBOX 1
// wxBitmapComboBox is a combobox that can have images in front of text items.
//
// Default is 1.
//
// Recommended setting: 1 but can be safely set to 0
#define wxUSE_BITMAPCOMBOBOX 1
// wxRearrangeCtrl is a wxCheckListBox with two buttons allowing to move items
// up and down in it. It is also used as part of wxRearrangeDialog.
//
// Default is 1.
//
// Recommended setting: 1 but can be safely set to 0 (currently used only by
// wxHeaderCtrl)
#define wxUSE_REARRANGECTRL 1
// wxAddRemoveCtrl is a composite control containing a control showing some
// items (e.g. wxListBox, wxListCtrl, wxTreeCtrl, wxDataViewCtrl, ...) and "+"/
// "-" buttons allowing to add and remove items to/from the control.
//
// Default is 1.
//
// Recommended setting: 1 but can be safely set to 0 if you don't need it (not
// used by the library itself).
#define wxUSE_ADDREMOVECTRL 1
// ----------------------------------------------------------------------------
// Miscellaneous GUI stuff
// ----------------------------------------------------------------------------
// wxAcceleratorTable/Entry classes and support for them in wxMenu(Bar)
#define wxUSE_ACCEL 1
// Use the standard art provider. The icons returned by this provider are
// embedded into the library as XPMs so disabling it reduces the library size
// somewhat but this should only be done if you use your own custom art
// provider returning the icons or never use any icons not provided by the
// native art provider (which might not be implemented at all for some
// platforms) or by the Tango icons provider (if it's not itself disabled
// below).
//
// Default is 1.
//
// Recommended setting: 1 unless you use your own custom art provider.
#define wxUSE_ARTPROVIDER_STD 1
// Use art provider providing Tango icons: this art provider has higher quality
// icons than the default ones using smaller size XPM icons without
// transparency but the embedded PNG icons add to the library size.
//
// Default is 1 under non-GTK ports. Under wxGTK the native art provider using
// the GTK+ stock icons replaces it so it is normally not necessary.
//
// Recommended setting: 1 but can be turned off to reduce the library size.
#define wxUSE_ARTPROVIDER_TANGO 1
// Hotkey support (currently Windows only)
#define wxUSE_HOTKEY 1
// Use wxCaret: a class implementing a "cursor" in a text control (called caret
// under Windows).
//
// Default is 1.
//
// Recommended setting: 1 (can be safely set to 0, not used by the library)
#define wxUSE_CARET 1
// Use wxDisplay class: it allows enumerating all displays on a system and
// their geometries as well as finding the display on which the given point or
// window lies.
//
// Default is 1.
//
// Recommended setting: 1 if you need it, can be safely set to 0 otherwise
#define wxUSE_DISPLAY 1
// Miscellaneous geometry code: needed for Canvas library
#define wxUSE_GEOMETRY 1
// Use wxImageList. This class is needed by wxNotebook, wxTreeCtrl and
// wxListCtrl.
//
// Default is 1.
//
// Recommended setting: 1 (set it to 0 if you don't use any of the controls
// enumerated above, then this class is mostly useless too)
#define wxUSE_IMAGLIST 1
// Use wxInfoBar class.
//
// Default is 1.
//
// Recommended setting: 1 (but can be disabled without problems as nothing
// depends on it)
#define wxUSE_INFOBAR 1
// Use wxMenu, wxMenuBar, wxMenuItem.
//
// Default is 1.
//
// Recommended setting: 1 (can't be disabled under MSW)
#define wxUSE_MENUS 1
// Use wxNotificationMessage.
//
// wxNotificationMessage allows to show non-intrusive messages to the user
// using balloons, banners, popups or whatever is the appropriate method for
// the current platform.
//
// Default is 1.
//
// Recommended setting: 1
#define wxUSE_NOTIFICATION_MESSAGE 1
// wxPreferencesEditor provides a common API for different ways of presenting
// the standard "Preferences" or "Properties" dialog under different platforms
// (e.g. some use modal dialogs, some use modeless ones; some apply the changes
// immediately while others require an explicit "Apply" button).
//
// Default is 1.
//
// Recommended setting: 1 (but can be safely disabled if you don't use it)
#define wxUSE_PREFERENCES_EDITOR 1
// wxFont::AddPrivateFont() allows to use fonts not installed on the system by
// loading them from font files during run-time.
//
// Default is 1 except under Unix where it will be turned off by configure if
// the required libraries are not available or not new enough.
//
// Recommended setting: 1 (but can be safely disabled if you don't use it and
// want to avoid extra dependencies under Linux, for example).
#define wxUSE_PRIVATE_FONTS 1
// wxRichToolTip is a customizable tooltip class which has more functionality
// than the stock (but native, unlike this class) wxToolTip.
//
// Default is 1.
//
// Recommended setting: 1 (but can be safely set to 0 if you don't need it)
#define wxUSE_RICHTOOLTIP 1
// Use wxSashWindow class.
//
// Default is 1.
//
// Recommended setting: 1
#define wxUSE_SASH 1
// Use wxSplitterWindow class.
//
// Default is 1.
//
// Recommended setting: 1
#define wxUSE_SPLITTER 1
// Use wxToolTip and wxWindow::Set/GetToolTip() methods.
//
// Default is 1.
//
// Recommended setting: 1
#define wxUSE_TOOLTIPS 1
// wxValidator class and related methods
#define wxUSE_VALIDATORS 1
// Use reference counted ID management: this means that wxWidgets will track
// the automatically allocated ids (those used when you use wxID_ANY when
// creating a window, menu or toolbar item &c) instead of just supposing that
// the program never runs out of them. This is mostly useful only under wxMSW
// where the total ids range is limited to SHRT_MIN..SHRT_MAX and where
// long-running programs can run into problems with ids reuse without this. On
// the other platforms, where the ids have the full int range, this shouldn't
// be necessary.
#ifdef __WXMSW__
#define wxUSE_AUTOID_MANAGEMENT 1
#else
#define wxUSE_AUTOID_MANAGEMENT 0
#endif
// ----------------------------------------------------------------------------
// common dialogs
// ----------------------------------------------------------------------------
// On rare occasions (e.g. using DJGPP) may want to omit common dialogs (e.g.
// file selector, printer dialog). Switching this off also switches off the
// printing architecture and interactive wxPrinterDC.
//
// Default is 1
//
// Recommended setting: 1 (unless it really doesn't work)
#define wxUSE_COMMON_DIALOGS 1
// wxBusyInfo displays window with message when app is busy. Works in same way
// as wxBusyCursor
#define wxUSE_BUSYINFO 1
// Use single/multiple choice dialogs.
//
// Default is 1
//
// Recommended setting: 1 (used in the library itself)
#define wxUSE_CHOICEDLG 1
// Use colour picker dialog
//
// Default is 1
//
// Recommended setting: 1
#define wxUSE_COLOURDLG 1
// wxDirDlg class for getting a directory name from user
#define wxUSE_DIRDLG 1
// TODO: setting to choose the generic or native one
// Use file open/save dialogs.
//
// Default is 1
//
// Recommended setting: 1 (used in many places in the library itself)
#define wxUSE_FILEDLG 1
// Use find/replace dialogs.
//
// Default is 1
//
// Recommended setting: 1 (but may be safely set to 0)
#define wxUSE_FINDREPLDLG 1
// Use font picker dialog
//
// Default is 1
//
// Recommended setting: 1 (used in the library itself)
#define wxUSE_FONTDLG 1
// Use wxMessageDialog and wxMessageBox.
//
// Default is 1
//
// Recommended setting: 1 (used in the library itself)
#define wxUSE_MSGDLG 1
// progress dialog class for lengthy operations
#define wxUSE_PROGRESSDLG 1
// Set to 0 to disable the use of the native progress dialog (currently only
// available under MSW and suffering from some bugs there, hence this option).
#define wxUSE_NATIVE_PROGRESSDLG 1
// support for startup tips (wxShowTip &c)
#define wxUSE_STARTUP_TIPS 1
// text entry dialog and wxGetTextFromUser function
#define wxUSE_TEXTDLG 1
// number entry dialog
#define wxUSE_NUMBERDLG 1
// splash screen class
#define wxUSE_SPLASH 1
// wizards
#define wxUSE_WIZARDDLG 1
// Compile in wxAboutBox() function showing the standard "About" dialog.
//
// Default is 1
//
// Recommended setting: 1 but can be set to 0 to save some space if you don't
// use this function
#define wxUSE_ABOUTDLG 1
// wxFileHistory class
//
// Default is 1
//
// Recommended setting: 1
#define wxUSE_FILE_HISTORY 1
// ----------------------------------------------------------------------------
// Metafiles support
// ----------------------------------------------------------------------------
// Windows supports the graphics format known as metafile which, though not
// portable, is widely used under Windows and so is supported by wxWidgets
// (under Windows only, of course). Both the so-called "Window MetaFiles" or
// WMFs, and "Enhanced MetaFiles" or EMFs are supported in wxWin and, by
// default, EMFs will be used. This may be changed by setting
// wxUSE_WIN_METAFILES_ALWAYS to 1 and/or setting wxUSE_ENH_METAFILE to 0.
// You may also set wxUSE_METAFILE to 0 to not compile in any metafile
// related classes at all.
//
// Default is 1 for wxUSE_ENH_METAFILE and 0 for wxUSE_WIN_METAFILES_ALWAYS.
//
// Recommended setting: default or 0 for everything for portable programs.
#define wxUSE_METAFILE 1
#define wxUSE_ENH_METAFILE 1
#define wxUSE_WIN_METAFILES_ALWAYS 0
// ----------------------------------------------------------------------------
// Big GUI components
// ----------------------------------------------------------------------------
// Set to 0 to disable MDI support.
//
// Requires wxUSE_NOTEBOOK under platforms other than MSW.
//
// Default is 1.
//
// Recommended setting: 1, can be safely set to 0.
#define wxUSE_MDI 1
// Set to 0 to disable document/view architecture
#define wxUSE_DOC_VIEW_ARCHITECTURE 1
// Set to 0 to disable MDI document/view architecture
//
// Requires wxUSE_MDI && wxUSE_DOC_VIEW_ARCHITECTURE
#define wxUSE_MDI_ARCHITECTURE 1
// Set to 0 to disable print/preview architecture code
#define wxUSE_PRINTING_ARCHITECTURE 1
// wxHTML sublibrary allows to display HTML in wxWindow programs and much,
// much more.
//
// Default is 1.
//
// Recommended setting: 1 (wxHTML is great!), set to 0 if you want compile a
// smaller library.
#define wxUSE_HTML 1
// Setting wxUSE_GLCANVAS to 1 enables OpenGL support. You need to have OpenGL
// headers and libraries to be able to compile the library with wxUSE_GLCANVAS
// set to 1 and, under Windows, also to add opengl32.lib and glu32.lib to the
// list of libraries used to link your application (although this is done
// implicitly for Microsoft Visual C++ users).
//
// Default is 1.
//
// Recommended setting: 1 if you intend to use OpenGL, can be safely set to 0
// otherwise.
#define wxUSE_GLCANVAS 1
// wxRichTextCtrl allows editing of styled text.
//
// Default is 1.
//
// Recommended setting: 1, set to 0 if you want compile a
// smaller library.
#define wxUSE_RICHTEXT 1
// ----------------------------------------------------------------------------
// Data transfer
// ----------------------------------------------------------------------------
// Use wxClipboard class for clipboard copy/paste.
//
// Default is 1.
//
// Recommended setting: 1
#define wxUSE_CLIPBOARD 1
// Use wxDataObject and related classes. Needed for clipboard and OLE drag and
// drop
//
// Default is 1.
//
// Recommended setting: 1
#define wxUSE_DATAOBJ 1
// Use wxDropTarget and wxDropSource classes for drag and drop (this is
// different from "built in" drag and drop in wxTreeCtrl which is always
// available). Requires wxUSE_DATAOBJ.
//
// Default is 1.
//
// Recommended setting: 1
#define wxUSE_DRAG_AND_DROP 1
// Use wxAccessible for enhanced and customisable accessibility.
// Depends on wxUSE_OLE on MSW.
//
// Default is 1 on MSW, 0 elsewhere.
//
// Recommended setting (at present): 1 (MSW-only)
#ifdef __WXMSW__
#define wxUSE_ACCESSIBILITY 1
#else
#define wxUSE_ACCESSIBILITY 0
#endif
// ----------------------------------------------------------------------------
// miscellaneous settings
// ----------------------------------------------------------------------------
// wxSingleInstanceChecker class allows to verify at startup if another program
// instance is running.
//
// Default is 1
//
// Recommended setting: 1 (the class is tiny, disabling it won't save much
// space)
#define wxUSE_SNGLINST_CHECKER 1
#define wxUSE_DRAGIMAGE 1
#define wxUSE_IPC 1
// 0 for no interprocess comms
#define wxUSE_HELP 1
// 0 for no help facility
// Should we use MS HTML help for wxHelpController? If disabled, neither
// wxCHMHelpController nor wxBestHelpController are available.
//
// Default is 1 under MSW, 0 is always used for the other platforms.
//
// Recommended setting: 1, only set to 0 if you have trouble compiling
// wxCHMHelpController (could be a problem with really ancient compilers)
#define wxUSE_MS_HTML_HELP 1
// Use wxHTML-based help controller?
#define wxUSE_WXHTML_HELP 1
#define wxUSE_CONSTRAINTS 1
// 0 for no window layout constraint system
#define wxUSE_SPLINES 1
// 0 for no splines
#define wxUSE_MOUSEWHEEL 1
// Include mouse wheel support
// Compile wxUIActionSimulator class?
#define wxUSE_UIACTIONSIMULATOR 1
// ----------------------------------------------------------------------------
// wxDC classes for various output formats
// ----------------------------------------------------------------------------
// Set to 1 for PostScript device context.
#define wxUSE_POSTSCRIPT 0
// Set to 1 to use font metric files in GetTextExtent
#define wxUSE_AFM_FOR_POSTSCRIPT 1
// Set to 1 to compile in support for wxSVGFileDC, a wxDC subclass which allows
// to create files in SVG (Scalable Vector Graphics) format.
#define wxUSE_SVG 1
// Should wxDC provide SetTransformMatrix() and related methods?
//
// Default is 1 but can be set to 0 if this functionality is not used. Notice
// that currently wxMSW, wxGTK3 support this for wxDC and all platforms support
// this for wxGCDC so setting this to 0 doesn't change much if neither of these
// is used (although it will still save a few bytes probably).
//
// Recommended setting: 1.
#define wxUSE_DC_TRANSFORM_MATRIX 1
// ----------------------------------------------------------------------------
// image format support
// ----------------------------------------------------------------------------
// wxImage supports many different image formats which can be configured at
// compile-time. BMP is always supported, others are optional and can be safely
// disabled if you don't plan to use images in such format sometimes saving
// substantial amount of code in the final library.
//
// Some formats require an extra library which is included in wxWin sources
// which is mentioned if it is the case.
// Set to 1 for wxImage support (recommended).
#define wxUSE_IMAGE 1
// Set to 1 for PNG format support (requires libpng). Also requires wxUSE_ZLIB.
#define wxUSE_LIBPNG 1
// Set to 1 for JPEG format support (requires libjpeg)
#define wxUSE_LIBJPEG 1
// Set to 1 for TIFF format support (requires libtiff)
#define wxUSE_LIBTIFF 1
// Set to 1 for TGA format support (loading only)
#define wxUSE_TGA 1
// Set to 1 for GIF format support
#define wxUSE_GIF 1
// Set to 1 for PNM format support
#define wxUSE_PNM 1
// Set to 1 for PCX format support
#define wxUSE_PCX 1
// Set to 1 for IFF format support (Amiga format)
#define wxUSE_IFF 0
// Set to 1 for XPM format support
#define wxUSE_XPM 1
// Set to 1 for MS Icons and Cursors format support
#define wxUSE_ICO_CUR 1
// Set to 1 to compile in wxPalette class
#define wxUSE_PALETTE 1
// ----------------------------------------------------------------------------
// wxUniversal-only options
// ----------------------------------------------------------------------------
// Set to 1 to enable compilation of all themes, this is the default
#define wxUSE_ALL_THEMES 1
// Set to 1 to enable the compilation of individual theme if wxUSE_ALL_THEMES
// is unset, if it is set these options are not used; notice that metal theme
// uses Win32 one
#define wxUSE_THEME_GTK 0
#define wxUSE_THEME_METAL 0
#define wxUSE_THEME_MONO 0
#define wxUSE_THEME_WIN32 0
| h |
rticonnextdds-usecases | data/projects/rticonnextdds-usecases/VehicleTracking/ExampleCode/thirdparty/wxWidgets-3.1.2/Win64/include/wx/zstream.h | /////////////////////////////////////////////////////////////////////////////
// Name: wx/zstream.h
// Purpose: Memory stream classes
// Author: Guilhem Lavaux
// Modified by: Mike Wetherell
// Created: 11/07/98
// Copyright: (c) Guilhem Lavaux
// Licence: wxWindows licence
/////////////////////////////////////////////////////////////////////////////
#ifndef _WX_WXZSTREAM_H__
#define _WX_WXZSTREAM_H__
#include "wx/defs.h"
#if wxUSE_ZLIB && wxUSE_STREAMS
#include "wx/stream.h"
#include "wx/versioninfo.h"
// Compression level
enum wxZlibCompressionLevels {
wxZ_DEFAULT_COMPRESSION = -1,
wxZ_NO_COMPRESSION = 0,
wxZ_BEST_SPEED = 1,
wxZ_BEST_COMPRESSION = 9
};
// Flags
enum wxZLibFlags {
wxZLIB_NO_HEADER = 0, // raw deflate stream, no header or checksum
wxZLIB_ZLIB = 1, // zlib header and checksum
wxZLIB_GZIP = 2, // gzip header and checksum, requires zlib 1.2.1+
wxZLIB_AUTO = 3 // autodetect header zlib or gzip
};
class WXDLLIMPEXP_BASE wxZlibInputStream: public wxFilterInputStream {
public:
wxZlibInputStream(wxInputStream& stream, int flags = wxZLIB_AUTO);
wxZlibInputStream(wxInputStream *stream, int flags = wxZLIB_AUTO);
virtual ~wxZlibInputStream();
char Peek() wxOVERRIDE { return wxInputStream::Peek(); }
wxFileOffset GetLength() const wxOVERRIDE { return wxInputStream::GetLength(); }
static bool CanHandleGZip();
bool SetDictionary(const char *data, size_t datalen);
bool SetDictionary(const wxMemoryBuffer &buf);
protected:
size_t OnSysRead(void *buffer, size_t size) wxOVERRIDE;
wxFileOffset OnSysTell() const wxOVERRIDE { return m_pos; }
private:
void Init(int flags);
protected:
size_t m_z_size;
unsigned char *m_z_buffer;
struct z_stream_s *m_inflate;
wxFileOffset m_pos;
wxDECLARE_NO_COPY_CLASS(wxZlibInputStream);
};
class WXDLLIMPEXP_BASE wxZlibOutputStream: public wxFilterOutputStream {
public:
wxZlibOutputStream(wxOutputStream& stream, int level = -1, int flags = wxZLIB_ZLIB);
wxZlibOutputStream(wxOutputStream *stream, int level = -1, int flags = wxZLIB_ZLIB);
virtual ~wxZlibOutputStream() { Close(); }
void Sync() wxOVERRIDE { DoFlush(false); }
bool Close() wxOVERRIDE;
wxFileOffset GetLength() const wxOVERRIDE { return m_pos; }
static bool CanHandleGZip();
bool SetDictionary(const char *data, size_t datalen);
bool SetDictionary(const wxMemoryBuffer &buf);
protected:
size_t OnSysWrite(const void *buffer, size_t size) wxOVERRIDE;
wxFileOffset OnSysTell() const wxOVERRIDE { return m_pos; }
virtual void DoFlush(bool final);
private:
void Init(int level, int flags);
protected:
size_t m_z_size;
unsigned char *m_z_buffer;
struct z_stream_s *m_deflate;
wxFileOffset m_pos;
wxDECLARE_NO_COPY_CLASS(wxZlibOutputStream);
};
class WXDLLIMPEXP_BASE wxZlibClassFactory: public wxFilterClassFactory
{
public:
wxZlibClassFactory();
wxFilterInputStream *NewStream(wxInputStream& stream) const wxOVERRIDE
{ return new wxZlibInputStream(stream); }
wxFilterOutputStream *NewStream(wxOutputStream& stream) const wxOVERRIDE
{ return new wxZlibOutputStream(stream, -1); }
wxFilterInputStream *NewStream(wxInputStream *stream) const wxOVERRIDE
{ return new wxZlibInputStream(stream); }
wxFilterOutputStream *NewStream(wxOutputStream *stream) const wxOVERRIDE
{ return new wxZlibOutputStream(stream, -1); }
const wxChar * const *GetProtocols(wxStreamProtocolType type
= wxSTREAM_PROTOCOL) const wxOVERRIDE;
private:
wxDECLARE_DYNAMIC_CLASS(wxZlibClassFactory);
};
class WXDLLIMPEXP_BASE wxGzipClassFactory: public wxFilterClassFactory
{
public:
wxGzipClassFactory();
wxFilterInputStream *NewStream(wxInputStream& stream) const wxOVERRIDE
{ return new wxZlibInputStream(stream); }
wxFilterOutputStream *NewStream(wxOutputStream& stream) const wxOVERRIDE
{ return new wxZlibOutputStream(stream, -1); }
wxFilterInputStream *NewStream(wxInputStream *stream) const wxOVERRIDE
{ return new wxZlibInputStream(stream); }
wxFilterOutputStream *NewStream(wxOutputStream *stream) const wxOVERRIDE
{ return new wxZlibOutputStream(stream, -1); }
const wxChar * const *GetProtocols(wxStreamProtocolType type
= wxSTREAM_PROTOCOL) const wxOVERRIDE;
private:
wxDECLARE_DYNAMIC_CLASS(wxGzipClassFactory);
};
WXDLLIMPEXP_BASE wxVersionInfo wxGetZlibVersionInfo();
#endif
// wxUSE_ZLIB && wxUSE_STREAMS
#endif
// _WX_WXZSTREAM_H__
| h |
rticonnextdds-usecases | data/projects/rticonnextdds-usecases/VehicleTracking/ExampleCode/thirdparty/wxWidgets-3.1.2/Win64/include/wx/version.h | /*
* Name: wx/version.h
* Purpose: wxWidgets version numbers
* Author: Julian Smart
* Modified by: Ryan Norton (Converted to C)
* Created: 29/01/98
* Copyright: (c) 1998 Julian Smart
* Licence: wxWindows licence
*/
/* THIS IS A C FILE, DON'T USE C++ FEATURES (IN PARTICULAR COMMENTS) IN IT */
#ifndef _WX_VERSION_H_
#define _WX_VERSION_H_
#include "wx/cpp.h" /* for wxSTRINGIZE */
/* the constants below must be changed with each new version */
/* ---------------------------------------------------------------------------- */
/*
Don't forget to update WX_CURRENT, WX_REVISION and WX_AGE in
build/bakefiles/version.bkl and regenerate the makefiles when you change
this!
*/
/* NB: this file is parsed by automatic tools so don't change its format! */
#define wxMAJOR_VERSION 3
#define wxMINOR_VERSION 1
#define wxRELEASE_NUMBER 2
#define wxSUBRELEASE_NUMBER 0
#define wxVERSION_STRING wxT("wxWidgets 3.1.2")
/* nothing to update below this line when updating the version */
/* ---------------------------------------------------------------------------- */
/* Users can pre-define wxABI_VERSION to a lower value in their
* makefile/project settings to compile code that will be binary compatible
* with earlier versions of the ABI within the same minor version (between
* minor versions binary compatibility breaks anyway). The default is the
* version of wxWidgets being used. A single number with two decimal digits
* for each component, e.g. 20601 for 2.6.1 */
#ifndef wxABI_VERSION
#define wxABI_VERSION ( wxMAJOR_VERSION * 10000 + wxMINOR_VERSION * 100 + 99 )
#endif
/* helpers for wxVERSION_NUM_XXX */
#define wxMAKE_VERSION_STRING(x, y, z) \
wxSTRINGIZE(x) wxSTRINGIZE(y) wxSTRINGIZE(z)
#define wxMAKE_VERSION_DOT_STRING(x, y, z) \
wxSTRINGIZE(x) "." wxSTRINGIZE(y) "." wxSTRINGIZE(z)
#define wxMAKE_VERSION_STRING_T(x, y, z) \
wxSTRINGIZE_T(x) wxSTRINGIZE_T(y) wxSTRINGIZE_T(z)
#define wxMAKE_VERSION_DOT_STRING_T(x, y, z) \
wxSTRINGIZE_T(x) wxT(".") wxSTRINGIZE_T(y) wxT(".") wxSTRINGIZE_T(z)
/* these are used by src/msw/version.rc and should always be ASCII, not Unicode */
#define wxVERSION_NUM_STRING \
wxMAKE_VERSION_STRING(wxMAJOR_VERSION, wxMINOR_VERSION, wxRELEASE_NUMBER)
#define wxVERSION_NUM_DOT_STRING \
wxMAKE_VERSION_DOT_STRING(wxMAJOR_VERSION, wxMINOR_VERSION, wxRELEASE_NUMBER)
/* those are Unicode-friendly */
#define wxVERSION_NUM_STRING_T \
wxMAKE_VERSION_STRING_T(wxMAJOR_VERSION, wxMINOR_VERSION, wxRELEASE_NUMBER)
#define wxVERSION_NUM_DOT_STRING_T \
wxMAKE_VERSION_DOT_STRING_T(wxMAJOR_VERSION, wxMINOR_VERSION, wxRELEASE_NUMBER)
/* some more defines, not really sure if they're [still] useful */
#define wxVERSION_NUMBER ( (wxMAJOR_VERSION * 1000) + (wxMINOR_VERSION * 100) + wxRELEASE_NUMBER )
#define wxBETA_NUMBER 0
#define wxVERSION_FLOAT ( wxMAJOR_VERSION + (wxMINOR_VERSION/10.0) + (wxRELEASE_NUMBER/100.0) + (wxBETA_NUMBER/10000.0) )
/* check if the current version is at least major.minor.release */
#define wxCHECK_VERSION(major,minor,release) \
(wxMAJOR_VERSION > (major) || \
(wxMAJOR_VERSION == (major) && wxMINOR_VERSION > (minor)) || \
(wxMAJOR_VERSION == (major) && wxMINOR_VERSION == (minor) && wxRELEASE_NUMBER >= (release)))
/* the same but check the subrelease also */
#define wxCHECK_VERSION_FULL(major,minor,release,subrel) \
(wxCHECK_VERSION(major, minor, release) && \
((major) != wxMAJOR_VERSION || \
(minor) != wxMINOR_VERSION || \
(release) != wxRELEASE_NUMBER || \
(subrel) <= wxSUBRELEASE_NUMBER))
#endif /* _WX_VERSION_H_ */
| h |
rticonnextdds-usecases | data/projects/rticonnextdds-usecases/VehicleTracking/ExampleCode/thirdparty/wxWidgets-3.1.2/Win64/include/wx/imagpng.h | /////////////////////////////////////////////////////////////////////////////
// Name: wx/imagpng.h
// Purpose: wxImage PNG handler
// Author: Robert Roebling
// Copyright: (c) Robert Roebling
// Licence: wxWindows licence
/////////////////////////////////////////////////////////////////////////////
#ifndef _WX_IMAGPNG_H_
#define _WX_IMAGPNG_H_
#include "wx/defs.h"
//-----------------------------------------------------------------------------
// wxPNGHandler
//-----------------------------------------------------------------------------
#if wxUSE_LIBPNG
#include "wx/image.h"
#include "wx/versioninfo.h"
#define wxIMAGE_OPTION_PNG_FORMAT wxT("PngFormat")
#define wxIMAGE_OPTION_PNG_BITDEPTH wxT("PngBitDepth")
#define wxIMAGE_OPTION_PNG_FILTER wxT("PngF")
#define wxIMAGE_OPTION_PNG_COMPRESSION_LEVEL wxT("PngZL")
#define wxIMAGE_OPTION_PNG_COMPRESSION_MEM_LEVEL wxT("PngZM")
#define wxIMAGE_OPTION_PNG_COMPRESSION_STRATEGY wxT("PngZS")
#define wxIMAGE_OPTION_PNG_COMPRESSION_BUFFER_SIZE wxT("PngZB")
enum
{
wxPNG_TYPE_COLOUR = 0,
wxPNG_TYPE_GREY = 2,
wxPNG_TYPE_GREY_RED = 3,
wxPNG_TYPE_PALETTE = 4
};
class WXDLLIMPEXP_CORE wxPNGHandler: public wxImageHandler
{
public:
inline wxPNGHandler()
{
m_name = wxT("PNG file");
m_extension = wxT("png");
m_type = wxBITMAP_TYPE_PNG;
m_mime = wxT("image/png");
}
static wxVersionInfo GetLibraryVersionInfo();
#if wxUSE_STREAMS
virtual bool LoadFile( wxImage *image, wxInputStream& stream, bool verbose=true, int index=-1 ) wxOVERRIDE;
virtual bool SaveFile( wxImage *image, wxOutputStream& stream, bool verbose=true ) wxOVERRIDE;
protected:
virtual bool DoCanRead( wxInputStream& stream ) wxOVERRIDE;
#endif
private:
wxDECLARE_DYNAMIC_CLASS(wxPNGHandler);
};
#endif
// wxUSE_LIBPNG
#endif
// _WX_IMAGPNG_H_
| h |
rticonnextdds-usecases | data/projects/rticonnextdds-usecases/VehicleTracking/ExampleCode/thirdparty/wxWidgets-3.1.2/Win64/include/wx/headerctrl.h | ///////////////////////////////////////////////////////////////////////////////
// Name: wx/headerctrl.h
// Purpose: wxHeaderCtrlBase class: interface of wxHeaderCtrl
// Author: Vadim Zeitlin
// Created: 2008-12-01
// Copyright: (c) 2008 Vadim Zeitlin <[email protected]>
// Licence: wxWindows licence
///////////////////////////////////////////////////////////////////////////////
#ifndef _WX_HEADERCTRL_H_
#define _WX_HEADERCTRL_H_
#include "wx/control.h"
#if wxUSE_HEADERCTRL
#include "wx/dynarray.h"
#include "wx/vector.h"
#include "wx/headercol.h"
// notice that the classes in this header are defined in the core library even
// although currently they're only used by wxGrid which is in wxAdv because we
// plan to use it in wxListCtrl which is in core too in the future
class WXDLLIMPEXP_FWD_CORE wxHeaderCtrlEvent;
// ----------------------------------------------------------------------------
// constants
// ----------------------------------------------------------------------------
enum
{
// allow column drag and drop
wxHD_ALLOW_REORDER = 0x0001,
// allow hiding (and showing back) the columns using the menu shown by
// right clicking the header
wxHD_ALLOW_HIDE = 0x0002,
// force putting column images on right
wxHD_BITMAP_ON_RIGHT = 0x0004,
// style used by default when creating the control
wxHD_DEFAULT_STYLE = wxHD_ALLOW_REORDER
};
extern WXDLLIMPEXP_DATA_CORE(const char) wxHeaderCtrlNameStr[];
// ----------------------------------------------------------------------------
// wxHeaderCtrlBase defines the interface of a header control
// ----------------------------------------------------------------------------
class WXDLLIMPEXP_CORE wxHeaderCtrlBase : public wxControl
{
public:
/*
Derived classes must provide default ctor as well as a ctor and
Create() function with the following signatures:
wxHeaderCtrl(wxWindow *parent,
wxWindowID winid = wxID_ANY,
const wxPoint& pos = wxDefaultPosition,
const wxSize& size = wxDefaultSize,
long style = wxHD_DEFAULT_STYLE,
const wxString& name = wxHeaderCtrlNameStr);
bool Create(wxWindow *parent,
wxWindowID winid = wxID_ANY,
const wxPoint& pos = wxDefaultPosition,
const wxSize& size = wxDefaultSize,
long style = wxHD_DEFAULT_STYLE,
const wxString& name = wxHeaderCtrlNameStr);
*/
// column-related methods
// ----------------------
// set the number of columns in the control
//
// this also calls UpdateColumn() for all columns
void SetColumnCount(unsigned int count);
// return the number of columns in the control as set by SetColumnCount()
unsigned int GetColumnCount() const { return DoGetCount(); }
// return whether the control has any columns
bool IsEmpty() const { return DoGetCount() == 0; }
// update the column with the given index
void UpdateColumn(unsigned int idx)
{
wxCHECK_RET( idx < GetColumnCount(), "invalid column index" );
DoUpdate(idx);
}
// columns order
// -------------
// set the columns order: the array defines the column index which appears
// the given position, it must have GetColumnCount() elements and contain
// all indices exactly once
void SetColumnsOrder(const wxArrayInt& order);
wxArrayInt GetColumnsOrder() const;
// get the index of the column at the given display position
unsigned int GetColumnAt(unsigned int pos) const;
// get the position at which this column is currently displayed
unsigned int GetColumnPos(unsigned int idx) const;
// reset the columns order to the natural one
void ResetColumnsOrder();
// helper function used by the generic version of this control and also
// wxGrid: reshuffles the array of column indices indexed by positions
// (i.e. using the same convention as for SetColumnsOrder()) so that the
// column with the given index is found at the specified position
static void MoveColumnInOrderArray(wxArrayInt& order,
unsigned int idx,
unsigned int pos);
// UI helpers
// ----------
#if wxUSE_MENUS
// show the popup menu containing all columns with check marks for the ones
// which are currently shown and return true if something was done using it
// (in this case UpdateColumnVisibility() will have been called) or false
// if the menu was cancelled
//
// this is called from the default right click handler for the controls
// with wxHD_ALLOW_HIDE style
bool ShowColumnsMenu(const wxPoint& pt, const wxString& title = wxString());
// append the entries for all our columns to the given menu, with the
// currently visible columns being checked
//
// this is used by ShowColumnsMenu() but can also be used if you use your
// own custom columns menu but nevertheless want to show all the columns in
// it
//
// the ids of the items corresponding to the columns are consecutive and
// start from idColumnsBase
void AddColumnsItems(wxMenu& menu, int idColumnsBase = 0);
#endif // wxUSE_MENUS
// show the columns customization dialog and return true if something was
// changed using it (in which case UpdateColumnVisibility() and/or
// UpdateColumnsOrder() will have been called)
//
// this is called by the control itself from ShowColumnsMenu() (which in
// turn is only called by the control if wxHD_ALLOW_HIDE style was
// specified) and if the control has wxHD_ALLOW_REORDER style as well
bool ShowCustomizeDialog();
// compute column title width
int GetColumnTitleWidth(const wxHeaderColumn& col);
// implementation only from now on
// -------------------------------
// the user doesn't need to TAB to this control
virtual bool AcceptsFocusFromKeyboard() const wxOVERRIDE { return false; }
// this method is only overridden in order to synchronize the control with
// the main window when it is scrolled, the derived class must implement
// DoScrollHorz()
virtual void ScrollWindow(int dx, int dy, const wxRect *rect = NULL) wxOVERRIDE;
protected:
// this method must be implemented by the derived classes to return the
// information for the given column
virtual const wxHeaderColumn& GetColumn(unsigned int idx) const = 0;
// this method is called from the default EVT_HEADER_SEPARATOR_DCLICK
// handler to update the fitting column width of the given column, it
// should return true if the width was really updated
virtual bool UpdateColumnWidthToFit(unsigned int WXUNUSED(idx),
int WXUNUSED(widthTitle))
{
return false;
}
// this method is called from ShowColumnsMenu() and must be overridden to
// update the internal column visibility (there is no need to call
// UpdateColumn() from here, this will be done internally)
virtual void UpdateColumnVisibility(unsigned int WXUNUSED(idx),
bool WXUNUSED(show))
{
wxFAIL_MSG( "must be overridden if called" );
}
// this method is called from ShowCustomizeDialog() to reorder all columns
// at once and should be implemented for controls using wxHD_ALLOW_REORDER
// style (there is no need to call SetColumnsOrder() from here, this is
// done by the control itself)
virtual void UpdateColumnsOrder(const wxArrayInt& WXUNUSED(order))
{
wxFAIL_MSG( "must be overridden if called" );
}
// this method can be overridden in the derived classes to do something
// (e.g. update/resize some internal data structures) before the number of
// columns in the control changes
virtual void OnColumnCountChanging(unsigned int WXUNUSED(count)) { }
// helper function for the derived classes: update the array of column
// indices after the number of columns changed
void DoResizeColumnIndices(wxArrayInt& colIndices, unsigned int count);
protected:
// this window doesn't look nice with the border so don't use it by default
virtual wxBorder GetDefaultBorder() const wxOVERRIDE { return wxBORDER_NONE; }
private:
// methods implementing our public API and defined in platform-specific
// implementations
virtual void DoSetCount(unsigned int count) = 0;
virtual unsigned int DoGetCount() const = 0;
virtual void DoUpdate(unsigned int idx) = 0;
virtual void DoScrollHorz(int dx) = 0;
virtual void DoSetColumnsOrder(const wxArrayInt& order) = 0;
virtual wxArrayInt DoGetColumnsOrder() const = 0;
// event handlers
void OnSeparatorDClick(wxHeaderCtrlEvent& event);
#if wxUSE_MENUS
void OnRClick(wxHeaderCtrlEvent& event);
#endif // wxUSE_MENUS
wxDECLARE_EVENT_TABLE();
};
// ----------------------------------------------------------------------------
// wxHeaderCtrl: port-specific header control implementation, notice that this
// is still an ABC which is meant to be used as part of another
// control, see wxHeaderCtrlSimple for a standalone version
// ----------------------------------------------------------------------------
#if defined(__WXMSW__) && !defined(__WXUNIVERSAL__)
#include "wx/msw/headerctrl.h"
#else
#define wxHAS_GENERIC_HEADERCTRL
#include "wx/generic/headerctrlg.h"
#endif // platform
// ----------------------------------------------------------------------------
// wxHeaderCtrlSimple: concrete header control which can be used standalone
// ----------------------------------------------------------------------------
class WXDLLIMPEXP_CORE wxHeaderCtrlSimple : public wxHeaderCtrl
{
public:
// control creation
// ----------------
wxHeaderCtrlSimple() { Init(); }
wxHeaderCtrlSimple(wxWindow *parent,
wxWindowID winid = wxID_ANY,
const wxPoint& pos = wxDefaultPosition,
const wxSize& size = wxDefaultSize,
long style = wxHD_DEFAULT_STYLE,
const wxString& name = wxHeaderCtrlNameStr)
{
Init();
Create(parent, winid, pos, size, style, name);
}
// managing the columns
// --------------------
// insert the column at the given position, using GetColumnCount() as
// position appends it at the end
void InsertColumn(const wxHeaderColumnSimple& col, unsigned int idx)
{
wxCHECK_RET( idx <= GetColumnCount(), "invalid column index" );
DoInsert(col, idx);
}
// append the column to the end of the control
void AppendColumn(const wxHeaderColumnSimple& col)
{
DoInsert(col, GetColumnCount());
}
// delete the column at the given index
void DeleteColumn(unsigned int idx)
{
wxCHECK_RET( idx < GetColumnCount(), "invalid column index" );
DoDelete(idx);
}
// delete all the existing columns
void DeleteAllColumns();
// modifying columns
// -----------------
// show or hide the column, notice that even when a column is hidden we
// still account for it when using indices
void ShowColumn(unsigned int idx, bool show = true)
{
wxCHECK_RET( idx < GetColumnCount(), "invalid column index" );
DoShowColumn(idx, show);
}
void HideColumn(unsigned int idx)
{
ShowColumn(idx, false);
}
// indicate that the column is used for sorting
void ShowSortIndicator(unsigned int idx, bool ascending = true)
{
wxCHECK_RET( idx < GetColumnCount(), "invalid column index" );
DoShowSortIndicator(idx, ascending);
}
// remove the sort indicator completely
void RemoveSortIndicator();
protected:
// implement/override base class methods
virtual const wxHeaderColumn& GetColumn(unsigned int idx) const wxOVERRIDE;
virtual bool UpdateColumnWidthToFit(unsigned int idx, int widthTitle) wxOVERRIDE;
// and define another one to be overridden in the derived classes: it
// should return the best width for the given column contents or -1 if not
// implemented, we use it to implement UpdateColumnWidthToFit()
virtual int GetBestFittingWidth(unsigned int WXUNUSED(idx)) const
{
return -1;
}
private:
// functions implementing our public API
void DoInsert(const wxHeaderColumnSimple& col, unsigned int idx);
void DoDelete(unsigned int idx);
void DoShowColumn(unsigned int idx, bool show);
void DoShowSortIndicator(unsigned int idx, bool ascending);
// common part of all ctors
void Init();
// bring the column count in sync with the number of columns we store
void UpdateColumnCount()
{
SetColumnCount(static_cast<int>(m_cols.size()));
}
// all our current columns
typedef wxVector<wxHeaderColumnSimple> Columns;
Columns m_cols;
// the column currently used for sorting or -1 if none
unsigned int m_sortKey;
wxDECLARE_NO_COPY_CLASS(wxHeaderCtrlSimple);
};
// ----------------------------------------------------------------------------
// wxHeaderCtrl events
// ----------------------------------------------------------------------------
class WXDLLIMPEXP_CORE wxHeaderCtrlEvent : public wxNotifyEvent
{
public:
wxHeaderCtrlEvent(wxEventType commandType = wxEVT_NULL, int winid = 0)
: wxNotifyEvent(commandType, winid),
m_col(-1),
m_width(0),
m_order(static_cast<unsigned int>(-1))
{
}
wxHeaderCtrlEvent(const wxHeaderCtrlEvent& event)
: wxNotifyEvent(event),
m_col(event.m_col),
m_width(event.m_width),
m_order(event.m_order)
{
}
// the column which this event pertains to: valid for all header events
int GetColumn() const { return m_col; }
void SetColumn(int col) { m_col = col; }
// the width of the column: valid for column resizing/dragging events only
int GetWidth() const { return m_width; }
void SetWidth(int width) { m_width = width; }
// the new position of the column: for end reorder events only
unsigned int GetNewOrder() const { return m_order; }
void SetNewOrder(unsigned int order) { m_order = order; }
virtual wxEvent *Clone() const wxOVERRIDE { return new wxHeaderCtrlEvent(*this); }
protected:
// the column affected by the event
int m_col;
// the current width for the dragging events
int m_width;
// the new column position for end reorder event
unsigned int m_order;
private:
wxDECLARE_DYNAMIC_CLASS_NO_ASSIGN(wxHeaderCtrlEvent);
};
wxDECLARE_EXPORTED_EVENT( WXDLLIMPEXP_CORE, wxEVT_HEADER_CLICK, wxHeaderCtrlEvent );
wxDECLARE_EXPORTED_EVENT( WXDLLIMPEXP_CORE, wxEVT_HEADER_RIGHT_CLICK, wxHeaderCtrlEvent );
wxDECLARE_EXPORTED_EVENT( WXDLLIMPEXP_CORE, wxEVT_HEADER_MIDDLE_CLICK, wxHeaderCtrlEvent );
wxDECLARE_EXPORTED_EVENT( WXDLLIMPEXP_CORE, wxEVT_HEADER_DCLICK, wxHeaderCtrlEvent );
wxDECLARE_EXPORTED_EVENT( WXDLLIMPEXP_CORE, wxEVT_HEADER_RIGHT_DCLICK, wxHeaderCtrlEvent );
wxDECLARE_EXPORTED_EVENT( WXDLLIMPEXP_CORE, wxEVT_HEADER_MIDDLE_DCLICK, wxHeaderCtrlEvent );
wxDECLARE_EXPORTED_EVENT( WXDLLIMPEXP_CORE, wxEVT_HEADER_SEPARATOR_DCLICK, wxHeaderCtrlEvent );
wxDECLARE_EXPORTED_EVENT( WXDLLIMPEXP_CORE, wxEVT_HEADER_BEGIN_RESIZE, wxHeaderCtrlEvent );
wxDECLARE_EXPORTED_EVENT( WXDLLIMPEXP_CORE, wxEVT_HEADER_RESIZING, wxHeaderCtrlEvent );
wxDECLARE_EXPORTED_EVENT( WXDLLIMPEXP_CORE, wxEVT_HEADER_END_RESIZE, wxHeaderCtrlEvent );
wxDECLARE_EXPORTED_EVENT( WXDLLIMPEXP_CORE, wxEVT_HEADER_BEGIN_REORDER, wxHeaderCtrlEvent );
wxDECLARE_EXPORTED_EVENT( WXDLLIMPEXP_CORE, wxEVT_HEADER_END_REORDER, wxHeaderCtrlEvent );
wxDECLARE_EXPORTED_EVENT( WXDLLIMPEXP_CORE, wxEVT_HEADER_DRAGGING_CANCELLED, wxHeaderCtrlEvent );
typedef void (wxEvtHandler::*wxHeaderCtrlEventFunction)(wxHeaderCtrlEvent&);
#define wxHeaderCtrlEventHandler(func) \
wxEVENT_HANDLER_CAST(wxHeaderCtrlEventFunction, func)
#define wx__DECLARE_HEADER_EVT(evt, id, fn) \
wx__DECLARE_EVT1(wxEVT_HEADER_ ## evt, id, wxHeaderCtrlEventHandler(fn))
#define EVT_HEADER_CLICK(id, fn) wx__DECLARE_HEADER_EVT(CLICK, id, fn)
#define EVT_HEADER_RIGHT_CLICK(id, fn) wx__DECLARE_HEADER_EVT(RIGHT_CLICK, id, fn)
#define EVT_HEADER_MIDDLE_CLICK(id, fn) wx__DECLARE_HEADER_EVT(MIDDLE_CLICK, id, fn)
#define EVT_HEADER_DCLICK(id, fn) wx__DECLARE_HEADER_EVT(DCLICK, id, fn)
#define EVT_HEADER_RIGHT_DCLICK(id, fn) wx__DECLARE_HEADER_EVT(RIGHT_DCLICK, id, fn)
#define EVT_HEADER_MIDDLE_DCLICK(id, fn) wx__DECLARE_HEADER_EVT(MIDDLE_DCLICK, id, fn)
#define EVT_HEADER_SEPARATOR_DCLICK(id, fn) wx__DECLARE_HEADER_EVT(SEPARATOR_DCLICK, id, fn)
#define EVT_HEADER_BEGIN_RESIZE(id, fn) wx__DECLARE_HEADER_EVT(BEGIN_RESIZE, id, fn)
#define EVT_HEADER_RESIZING(id, fn) wx__DECLARE_HEADER_EVT(RESIZING, id, fn)
#define EVT_HEADER_END_RESIZE(id, fn) wx__DECLARE_HEADER_EVT(END_RESIZE, id, fn)
#define EVT_HEADER_BEGIN_REORDER(id, fn) wx__DECLARE_HEADER_EVT(BEGIN_REORDER, id, fn)
#define EVT_HEADER_END_REORDER(id, fn) wx__DECLARE_HEADER_EVT(END_REORDER, id, fn)
#define EVT_HEADER_DRAGGING_CANCELLED(id, fn) wx__DECLARE_HEADER_EVT(DRAGGING_CANCELLED, id, fn)
// old wxEVT_COMMAND_* constants
#define wxEVT_COMMAND_HEADER_CLICK wxEVT_HEADER_CLICK
#define wxEVT_COMMAND_HEADER_RIGHT_CLICK wxEVT_HEADER_RIGHT_CLICK
#define wxEVT_COMMAND_HEADER_MIDDLE_CLICK wxEVT_HEADER_MIDDLE_CLICK
#define wxEVT_COMMAND_HEADER_DCLICK wxEVT_HEADER_DCLICK
#define wxEVT_COMMAND_HEADER_RIGHT_DCLICK wxEVT_HEADER_RIGHT_DCLICK
#define wxEVT_COMMAND_HEADER_MIDDLE_DCLICK wxEVT_HEADER_MIDDLE_DCLICK
#define wxEVT_COMMAND_HEADER_SEPARATOR_DCLICK wxEVT_HEADER_SEPARATOR_DCLICK
#define wxEVT_COMMAND_HEADER_BEGIN_RESIZE wxEVT_HEADER_BEGIN_RESIZE
#define wxEVT_COMMAND_HEADER_RESIZING wxEVT_HEADER_RESIZING
#define wxEVT_COMMAND_HEADER_END_RESIZE wxEVT_HEADER_END_RESIZE
#define wxEVT_COMMAND_HEADER_BEGIN_REORDER wxEVT_HEADER_BEGIN_REORDER
#define wxEVT_COMMAND_HEADER_END_REORDER wxEVT_HEADER_END_REORDER
#define wxEVT_COMMAND_HEADER_DRAGGING_CANCELLED wxEVT_HEADER_DRAGGING_CANCELLED
#endif // wxUSE_HEADERCTRL
#endif // _WX_HEADERCTRL_H_
| h |
rticonnextdds-usecases | data/projects/rticonnextdds-usecases/VehicleTracking/ExampleCode/thirdparty/wxWidgets-3.1.2/Win64/include/wx/systhemectrl.h | /////////////////////////////////////////////////////////////////////////////
// Name: wx/systhemectrl.h
// Purpose: Class to make controls appear in the systems theme
// Author: Tobias Taschner
// Created: 2014-08-14
// Copyright: (c) 2014 wxWidgets development team
// Licence: wxWindows licence
/////////////////////////////////////////////////////////////////////////////
#ifndef _WX_SYSTHEMECTRL_H
#define _WX_SYSTHEMECTRL_H
#include "wx/defs.h"
#if defined(__WXMSW__) && wxUSE_UXTHEME && !defined(__WXUNIVERSAL__)
#define wxHAS_SYSTEM_THEMED_CONTROL
#endif
class WXDLLIMPEXP_FWD_CORE wxWindow;
class WXDLLIMPEXP_CORE wxSystemThemedControlBase
{
public:
wxSystemThemedControlBase() { }
virtual ~wxSystemThemedControlBase() { }
protected:
// This method is virtual and can be overridden, e.g. composite controls do
// it to enable the system theme for all of their parts.
virtual void DoEnableSystemTheme
#ifdef wxHAS_SYSTEM_THEMED_CONTROL
// Only __WXMSW__ has a non-trivial implementation currently.
(bool enable, wxWindow* window);
#else
(bool WXUNUSED(enable), wxWindow* WXUNUSED(window)) { }
#endif // wxHAS_SYSTEM_THEMED_CONTROL
wxDECLARE_NO_COPY_CLASS(wxSystemThemedControlBase);
};
// This class used CRTP, i.e. it should be instantiated for the real base class
// and inherited from.
template <class C>
class wxSystemThemedControl : public C,
public wxSystemThemedControlBase
{
public:
wxSystemThemedControl() { }
void EnableSystemTheme(bool enable = true)
{
DoEnableSystemTheme(enable, this);
}
protected:
wxDECLARE_NO_COPY_TEMPLATE_CLASS(wxSystemThemedControl, C);
};
#endif // _WX_SYSTHEMECTRL_H
| h |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.