repo_name
stringclasses 10
values | file_path
stringlengths 29
222
| content
stringlengths 24
926k
| extention
stringclasses 5
values |
---|---|---|---|
rticonnextdds-usecases | data/projects/rticonnextdds-usecases/VehicleTracking/ExampleCode/thirdparty/wxWidgets-3.1.2/Linux/include/wx/longlong.h | /////////////////////////////////////////////////////////////////////////////
// Name: wx/longlong.h
// Purpose: declaration of wxLongLong class - best implementation of a 64
// bit integer for the current platform.
// Author: Jeffrey C. Ollie <[email protected]>, Vadim Zeitlin
// Modified by:
// Created: 10.02.99
// Copyright: (c) 1998 Vadim Zeitlin <[email protected]>
// Licence: wxWindows licence
/////////////////////////////////////////////////////////////////////////////
#ifndef _WX_LONGLONG_H
#define _WX_LONGLONG_H
#include "wx/defs.h"
#if wxUSE_LONGLONG
#include "wx/string.h"
#include <limits.h> // for LONG_MAX
// define this to compile wxLongLongWx in "test" mode: the results of all
// calculations will be compared with the real results taken from
// wxLongLongNative -- this is extremely useful to find the bugs in
// wxLongLongWx class!
// #define wxLONGLONG_TEST_MODE
#ifdef wxLONGLONG_TEST_MODE
#define wxUSE_LONGLONG_WX 1
#define wxUSE_LONGLONG_NATIVE 1
#endif // wxLONGLONG_TEST_MODE
// ----------------------------------------------------------------------------
// decide upon which class we will use
// ----------------------------------------------------------------------------
#ifndef wxLongLong_t
// both warning and pragma warning are not portable, but at least an
// unknown pragma should never be an error -- except that, actually, some
// broken compilers don't like it, so we have to disable it in this case
// <sigh>
#ifdef __GNUC__
#warning "Your compiler does not appear to support 64 bit "\
"integers, using emulation class instead.\n" \
"Please report your compiler version to " \
"[email protected]!"
#else
#pragma warning "Your compiler does not appear to support 64 bit "\
"integers, using emulation class instead.\n" \
"Please report your compiler version to " \
"[email protected]!"
#endif
#define wxUSE_LONGLONG_WX 1
#endif // compiler
// the user may predefine wxUSE_LONGLONG_NATIVE and/or wxUSE_LONGLONG_NATIVE
// to disable automatic testing (useful for the test program which defines
// both classes) but by default we only use one class
#if (defined(wxUSE_LONGLONG_WX) && wxUSE_LONGLONG_WX) || !defined(wxLongLong_t)
// don't use both classes unless wxUSE_LONGLONG_NATIVE was explicitly set:
// this is useful in test programs and only there
#ifndef wxUSE_LONGLONG_NATIVE
#define wxUSE_LONGLONG_NATIVE 0
#endif
class WXDLLIMPEXP_FWD_BASE wxLongLongWx;
class WXDLLIMPEXP_FWD_BASE wxULongLongWx;
#if defined(__VISUALC__) && !defined(__WIN32__)
#define wxLongLong wxLongLongWx
#define wxULongLong wxULongLongWx
#else
typedef wxLongLongWx wxLongLong;
typedef wxULongLongWx wxULongLong;
#endif
#else
// if nothing is defined, use native implementation by default, of course
#ifndef wxUSE_LONGLONG_NATIVE
#define wxUSE_LONGLONG_NATIVE 1
#endif
#endif
#ifndef wxUSE_LONGLONG_WX
#define wxUSE_LONGLONG_WX 0
class WXDLLIMPEXP_FWD_BASE wxLongLongNative;
class WXDLLIMPEXP_FWD_BASE wxULongLongNative;
typedef wxLongLongNative wxLongLong;
typedef wxULongLongNative wxULongLong;
#endif
// NB: if both wxUSE_LONGLONG_WX and NATIVE are defined, the user code should
// typedef wxLongLong as it wants, we don't do it
// ----------------------------------------------------------------------------
// choose the appropriate class
// ----------------------------------------------------------------------------
// we use iostream for wxLongLong output
#include "wx/iosfwrap.h"
#if wxUSE_LONGLONG_NATIVE
class WXDLLIMPEXP_BASE wxLongLongNative
{
public:
// ctors
// default ctor initializes to 0
wxLongLongNative() : m_ll(0) { }
// from long long
wxLongLongNative(wxLongLong_t ll) : m_ll(ll) { }
// from 2 longs
wxLongLongNative(wxInt32 hi, wxUint32 lo)
{
// cast to wxLongLong_t first to avoid precision loss!
m_ll = ((wxLongLong_t) hi) << 32;
m_ll |= (wxLongLong_t) lo;
}
#if wxUSE_LONGLONG_WX
wxLongLongNative(wxLongLongWx ll);
#endif
// default copy ctor is ok
// no dtor
// assignment operators
// from native 64 bit integer
#ifndef wxLongLongIsLong
wxLongLongNative& operator=(wxLongLong_t ll)
{ m_ll = ll; return *this; }
wxLongLongNative& operator=(wxULongLong_t ll)
{ m_ll = ll; return *this; }
#endif // !wxLongLongNative
wxLongLongNative& operator=(const wxULongLongNative &ll);
wxLongLongNative& operator=(int l)
{ m_ll = l; return *this; }
wxLongLongNative& operator=(long l)
{ m_ll = l; return *this; }
wxLongLongNative& operator=(unsigned int l)
{ m_ll = l; return *this; }
wxLongLongNative& operator=(unsigned long l)
{ m_ll = l; return *this; }
#if wxUSE_LONGLONG_WX
wxLongLongNative& operator=(wxLongLongWx ll);
wxLongLongNative& operator=(const class wxULongLongWx &ll);
#endif
// from double: this one has an explicit name because otherwise we
// would have ambiguity with "ll = int" and also because we don't want
// to have implicit conversions between doubles and wxLongLongs
wxLongLongNative& Assign(double d)
{ m_ll = (wxLongLong_t)d; return *this; }
// assignment operators from wxLongLongNative is ok
// accessors
// get high part
wxInt32 GetHi() const
{ return wx_truncate_cast(wxInt32, m_ll >> 32); }
// get low part
wxUint32 GetLo() const
{ return wx_truncate_cast(wxUint32, m_ll); }
// get absolute value
wxLongLongNative Abs() const { return wxLongLongNative(*this).Abs(); }
wxLongLongNative& Abs() { if ( m_ll < 0 ) m_ll = -m_ll; return *this; }
// convert to native long long
wxLongLong_t GetValue() const { return m_ll; }
// convert to long with range checking in debug mode (only!)
long ToLong() const
{
// This assert is useless if long long is the same as long (which is
// the case under the standard Unix LP64 model).
#ifdef wxHAS_LONG_LONG_T_DIFFERENT_FROM_LONG
wxASSERT_MSG( (m_ll >= LONG_MIN) && (m_ll <= LONG_MAX),
wxT("wxLongLong to long conversion loss of precision") );
#endif
return wx_truncate_cast(long, m_ll);
}
// convert to double
double ToDouble() const { return wx_truncate_cast(double, m_ll); }
// don't provide implicit conversion to wxLongLong_t or we will have an
// ambiguity for all arithmetic operations
//operator wxLongLong_t() const { return m_ll; }
// operations
// addition
wxLongLongNative operator+(const wxLongLongNative& ll) const
{ return wxLongLongNative(m_ll + ll.m_ll); }
wxLongLongNative& operator+=(const wxLongLongNative& ll)
{ m_ll += ll.m_ll; return *this; }
wxLongLongNative operator+(const wxLongLong_t ll) const
{ return wxLongLongNative(m_ll + ll); }
wxLongLongNative& operator+=(const wxLongLong_t ll)
{ m_ll += ll; return *this; }
// pre increment
wxLongLongNative& operator++()
{ m_ll++; return *this; }
// post increment
wxLongLongNative operator++(int)
{ wxLongLongNative value(*this); m_ll++; return value; }
// negation operator
wxLongLongNative operator-() const
{ return wxLongLongNative(-m_ll); }
wxLongLongNative& Negate() { m_ll = -m_ll; return *this; }
// subtraction
wxLongLongNative operator-(const wxLongLongNative& ll) const
{ return wxLongLongNative(m_ll - ll.m_ll); }
wxLongLongNative& operator-=(const wxLongLongNative& ll)
{ m_ll -= ll.m_ll; return *this; }
wxLongLongNative operator-(const wxLongLong_t ll) const
{ return wxLongLongNative(m_ll - ll); }
wxLongLongNative& operator-=(const wxLongLong_t ll)
{ m_ll -= ll; return *this; }
// pre decrement
wxLongLongNative& operator--()
{ m_ll--; return *this; }
// post decrement
wxLongLongNative operator--(int)
{ wxLongLongNative value(*this); m_ll--; return value; }
// shifts
// left shift
wxLongLongNative operator<<(int shift) const
{ return wxLongLongNative(m_ll << shift); }
wxLongLongNative& operator<<=(int shift)
{ m_ll <<= shift; return *this; }
// right shift
wxLongLongNative operator>>(int shift) const
{ return wxLongLongNative(m_ll >> shift); }
wxLongLongNative& operator>>=(int shift)
{ m_ll >>= shift; return *this; }
// bitwise operators
wxLongLongNative operator&(const wxLongLongNative& ll) const
{ return wxLongLongNative(m_ll & ll.m_ll); }
wxLongLongNative& operator&=(const wxLongLongNative& ll)
{ m_ll &= ll.m_ll; return *this; }
wxLongLongNative operator|(const wxLongLongNative& ll) const
{ return wxLongLongNative(m_ll | ll.m_ll); }
wxLongLongNative& operator|=(const wxLongLongNative& ll)
{ m_ll |= ll.m_ll; return *this; }
wxLongLongNative operator^(const wxLongLongNative& ll) const
{ return wxLongLongNative(m_ll ^ ll.m_ll); }
wxLongLongNative& operator^=(const wxLongLongNative& ll)
{ m_ll ^= ll.m_ll; return *this; }
// multiplication/division
wxLongLongNative operator*(const wxLongLongNative& ll) const
{ return wxLongLongNative(m_ll * ll.m_ll); }
wxLongLongNative operator*(long l) const
{ return wxLongLongNative(m_ll * l); }
wxLongLongNative& operator*=(const wxLongLongNative& ll)
{ m_ll *= ll.m_ll; return *this; }
wxLongLongNative& operator*=(long l)
{ m_ll *= l; return *this; }
wxLongLongNative operator/(const wxLongLongNative& ll) const
{ return wxLongLongNative(m_ll / ll.m_ll); }
wxLongLongNative operator/(long l) const
{ return wxLongLongNative(m_ll / l); }
wxLongLongNative& operator/=(const wxLongLongNative& ll)
{ m_ll /= ll.m_ll; return *this; }
wxLongLongNative& operator/=(long l)
{ m_ll /= l; return *this; }
wxLongLongNative operator%(const wxLongLongNative& ll) const
{ return wxLongLongNative(m_ll % ll.m_ll); }
wxLongLongNative operator%(long l) const
{ return wxLongLongNative(m_ll % l); }
// comparison
bool operator==(const wxLongLongNative& ll) const
{ return m_ll == ll.m_ll; }
bool operator==(long l) const
{ return m_ll == l; }
bool operator!=(const wxLongLongNative& ll) const
{ return m_ll != ll.m_ll; }
bool operator!=(long l) const
{ return m_ll != l; }
bool operator<(const wxLongLongNative& ll) const
{ return m_ll < ll.m_ll; }
bool operator<(long l) const
{ return m_ll < l; }
bool operator>(const wxLongLongNative& ll) const
{ return m_ll > ll.m_ll; }
bool operator>(long l) const
{ return m_ll > l; }
bool operator<=(const wxLongLongNative& ll) const
{ return m_ll <= ll.m_ll; }
bool operator<=(long l) const
{ return m_ll <= l; }
bool operator>=(const wxLongLongNative& ll) const
{ return m_ll >= ll.m_ll; }
bool operator>=(long l) const
{ return m_ll >= l; }
// miscellaneous
// return the string representation of this number
wxString ToString() const;
// conversion to byte array: returns a pointer to static buffer!
void *asArray() const;
#if wxUSE_STD_IOSTREAM
// input/output
friend WXDLLIMPEXP_BASE
wxSTD ostream& operator<<(wxSTD ostream&, const wxLongLongNative&);
#endif
friend WXDLLIMPEXP_BASE
wxString& operator<<(wxString&, const wxLongLongNative&);
#if wxUSE_STREAMS
friend WXDLLIMPEXP_BASE
class wxTextOutputStream& operator<<(class wxTextOutputStream&, const wxLongLongNative&);
friend WXDLLIMPEXP_BASE
class wxTextInputStream& operator>>(class wxTextInputStream&, wxLongLongNative&);
#endif
private:
wxLongLong_t m_ll;
};
class WXDLLIMPEXP_BASE wxULongLongNative
{
public:
// ctors
// default ctor initializes to 0
wxULongLongNative() : m_ll(0) { }
// from long long
wxULongLongNative(wxULongLong_t ll) : m_ll(ll) { }
// from 2 longs
wxULongLongNative(wxUint32 hi, wxUint32 lo) : m_ll(0)
{
// cast to wxLongLong_t first to avoid precision loss!
m_ll = ((wxULongLong_t) hi) << 32;
m_ll |= (wxULongLong_t) lo;
}
#if wxUSE_LONGLONG_WX
wxULongLongNative(const class wxULongLongWx &ll);
#endif
// default copy ctor is ok
// no dtor
// assignment operators
// from native 64 bit integer
#ifndef wxLongLongIsLong
wxULongLongNative& operator=(wxULongLong_t ll)
{ m_ll = ll; return *this; }
wxULongLongNative& operator=(wxLongLong_t ll)
{ m_ll = ll; return *this; }
#endif // !wxLongLongNative
wxULongLongNative& operator=(int l)
{ m_ll = l; return *this; }
wxULongLongNative& operator=(long l)
{ m_ll = l; return *this; }
wxULongLongNative& operator=(unsigned int l)
{ m_ll = l; return *this; }
wxULongLongNative& operator=(unsigned long l)
{ m_ll = l; return *this; }
wxULongLongNative& operator=(const wxLongLongNative &ll)
{ m_ll = ll.GetValue(); return *this; }
#if wxUSE_LONGLONG_WX
wxULongLongNative& operator=(wxLongLongWx ll);
wxULongLongNative& operator=(const class wxULongLongWx &ll);
#endif
// assignment operators from wxULongLongNative is ok
// accessors
// get high part
wxUint32 GetHi() const
{ return wx_truncate_cast(wxUint32, m_ll >> 32); }
// get low part
wxUint32 GetLo() const
{ return wx_truncate_cast(wxUint32, m_ll); }
// convert to native ulong long
wxULongLong_t GetValue() const { return m_ll; }
// convert to ulong with range checking in debug mode (only!)
unsigned long ToULong() const
{
wxASSERT_MSG( m_ll <= ULONG_MAX,
wxT("wxULongLong to long conversion loss of precision") );
return wx_truncate_cast(unsigned long, m_ll);
}
// convert to double
double ToDouble() const { return wx_truncate_cast(double, m_ll); }
// operations
// addition
wxULongLongNative operator+(const wxULongLongNative& ll) const
{ return wxULongLongNative(m_ll + ll.m_ll); }
wxULongLongNative& operator+=(const wxULongLongNative& ll)
{ m_ll += ll.m_ll; return *this; }
wxULongLongNative operator+(const wxULongLong_t ll) const
{ return wxULongLongNative(m_ll + ll); }
wxULongLongNative& operator+=(const wxULongLong_t ll)
{ m_ll += ll; return *this; }
// pre increment
wxULongLongNative& operator++()
{ m_ll++; return *this; }
// post increment
wxULongLongNative operator++(int)
{ wxULongLongNative value(*this); m_ll++; return value; }
// subtraction
wxULongLongNative operator-(const wxULongLongNative& ll) const
{ return wxULongLongNative(m_ll - ll.m_ll); }
wxULongLongNative& operator-=(const wxULongLongNative& ll)
{ m_ll -= ll.m_ll; return *this; }
wxULongLongNative operator-(const wxULongLong_t ll) const
{ return wxULongLongNative(m_ll - ll); }
wxULongLongNative& operator-=(const wxULongLong_t ll)
{ m_ll -= ll; return *this; }
// pre decrement
wxULongLongNative& operator--()
{ m_ll--; return *this; }
// post decrement
wxULongLongNative operator--(int)
{ wxULongLongNative value(*this); m_ll--; return value; }
// shifts
// left shift
wxULongLongNative operator<<(int shift) const
{ return wxULongLongNative(m_ll << shift); }
wxULongLongNative& operator<<=(int shift)
{ m_ll <<= shift; return *this; }
// right shift
wxULongLongNative operator>>(int shift) const
{ return wxULongLongNative(m_ll >> shift); }
wxULongLongNative& operator>>=(int shift)
{ m_ll >>= shift; return *this; }
// bitwise operators
wxULongLongNative operator&(const wxULongLongNative& ll) const
{ return wxULongLongNative(m_ll & ll.m_ll); }
wxULongLongNative& operator&=(const wxULongLongNative& ll)
{ m_ll &= ll.m_ll; return *this; }
wxULongLongNative operator|(const wxULongLongNative& ll) const
{ return wxULongLongNative(m_ll | ll.m_ll); }
wxULongLongNative& operator|=(const wxULongLongNative& ll)
{ m_ll |= ll.m_ll; return *this; }
wxULongLongNative operator^(const wxULongLongNative& ll) const
{ return wxULongLongNative(m_ll ^ ll.m_ll); }
wxULongLongNative& operator^=(const wxULongLongNative& ll)
{ m_ll ^= ll.m_ll; return *this; }
// multiplication/division
wxULongLongNative operator*(const wxULongLongNative& ll) const
{ return wxULongLongNative(m_ll * ll.m_ll); }
wxULongLongNative operator*(unsigned long l) const
{ return wxULongLongNative(m_ll * l); }
wxULongLongNative& operator*=(const wxULongLongNative& ll)
{ m_ll *= ll.m_ll; return *this; }
wxULongLongNative& operator*=(unsigned long l)
{ m_ll *= l; return *this; }
wxULongLongNative operator/(const wxULongLongNative& ll) const
{ return wxULongLongNative(m_ll / ll.m_ll); }
wxULongLongNative operator/(unsigned long l) const
{ return wxULongLongNative(m_ll / l); }
wxULongLongNative& operator/=(const wxULongLongNative& ll)
{ m_ll /= ll.m_ll; return *this; }
wxULongLongNative& operator/=(unsigned long l)
{ m_ll /= l; return *this; }
wxULongLongNative operator%(const wxULongLongNative& ll) const
{ return wxULongLongNative(m_ll % ll.m_ll); }
wxULongLongNative operator%(unsigned long l) const
{ return wxULongLongNative(m_ll % l); }
// comparison
bool operator==(const wxULongLongNative& ll) const
{ return m_ll == ll.m_ll; }
bool operator==(unsigned long l) const
{ return m_ll == l; }
bool operator!=(const wxULongLongNative& ll) const
{ return m_ll != ll.m_ll; }
bool operator!=(unsigned long l) const
{ return m_ll != l; }
bool operator<(const wxULongLongNative& ll) const
{ return m_ll < ll.m_ll; }
bool operator<(unsigned long l) const
{ return m_ll < l; }
bool operator>(const wxULongLongNative& ll) const
{ return m_ll > ll.m_ll; }
bool operator>(unsigned long l) const
{ return m_ll > l; }
bool operator<=(const wxULongLongNative& ll) const
{ return m_ll <= ll.m_ll; }
bool operator<=(unsigned long l) const
{ return m_ll <= l; }
bool operator>=(const wxULongLongNative& ll) const
{ return m_ll >= ll.m_ll; }
bool operator>=(unsigned long l) const
{ return m_ll >= l; }
// miscellaneous
// return the string representation of this number
wxString ToString() const;
// conversion to byte array: returns a pointer to static buffer!
void *asArray() const;
#if wxUSE_STD_IOSTREAM
// input/output
friend WXDLLIMPEXP_BASE
wxSTD ostream& operator<<(wxSTD ostream&, const wxULongLongNative&);
#endif
friend WXDLLIMPEXP_BASE
wxString& operator<<(wxString&, const wxULongLongNative&);
#if wxUSE_STREAMS
friend WXDLLIMPEXP_BASE
class wxTextOutputStream& operator<<(class wxTextOutputStream&, const wxULongLongNative&);
friend WXDLLIMPEXP_BASE
class wxTextInputStream& operator>>(class wxTextInputStream&, wxULongLongNative&);
#endif
private:
wxULongLong_t m_ll;
};
inline
wxLongLongNative& wxLongLongNative::operator=(const wxULongLongNative &ll)
{
m_ll = ll.GetValue();
return *this;
}
#endif // wxUSE_LONGLONG_NATIVE
#if wxUSE_LONGLONG_WX
class WXDLLIMPEXP_BASE wxLongLongWx
{
public:
// ctors
// default ctor initializes to 0
wxLongLongWx()
{
m_lo = m_hi = 0;
#ifdef wxLONGLONG_TEST_MODE
m_ll = 0;
Check();
#endif // wxLONGLONG_TEST_MODE
}
// from long
wxLongLongWx(long l) { *this = l; }
// from 2 longs
wxLongLongWx(long hi, unsigned long lo)
{
m_hi = hi;
m_lo = lo;
#ifdef wxLONGLONG_TEST_MODE
m_ll = hi;
m_ll <<= 32;
m_ll |= lo;
Check();
#endif // wxLONGLONG_TEST_MODE
}
// default copy ctor is ok in both cases
// no dtor
// assignment operators
// from long
wxLongLongWx& operator=(long l)
{
m_lo = l;
m_hi = (l < 0 ? -1l : 0l);
#ifdef wxLONGLONG_TEST_MODE
m_ll = l;
Check();
#endif // wxLONGLONG_TEST_MODE
return *this;
}
// from int
wxLongLongWx& operator=(int l)
{
return operator=((long)l);
}
wxLongLongWx& operator=(unsigned long l)
{
m_lo = l;
m_hi = 0;
#ifdef wxLONGLONG_TEST_MODE
m_ll = l;
Check();
#endif // wxLONGLONG_TEST_MODE
return *this;
}
wxLongLongWx& operator=(unsigned int l)
{
return operator=((unsigned long)l);
}
wxLongLongWx& operator=(const class wxULongLongWx &ll);
// from double
wxLongLongWx& Assign(double d);
// can't have assignment operator from 2 longs
// accessors
// get high part
long GetHi() const { return m_hi; }
// get low part
unsigned long GetLo() const { return m_lo; }
// get absolute value
wxLongLongWx Abs() const { return wxLongLongWx(*this).Abs(); }
wxLongLongWx& Abs()
{
if ( m_hi < 0 )
m_hi = -m_hi;
#ifdef wxLONGLONG_TEST_MODE
if ( m_ll < 0 )
m_ll = -m_ll;
Check();
#endif // wxLONGLONG_TEST_MODE
return *this;
}
// convert to long with range checking in debug mode (only!)
long ToLong() const
{
wxASSERT_MSG( (m_hi == 0l) || (m_hi == -1l),
wxT("wxLongLong to long conversion loss of precision") );
return (long)m_lo;
}
// convert to double
double ToDouble() const;
// operations
// addition
wxLongLongWx operator+(const wxLongLongWx& ll) const;
wxLongLongWx& operator+=(const wxLongLongWx& ll);
wxLongLongWx operator+(long l) const;
wxLongLongWx& operator+=(long l);
// pre increment operator
wxLongLongWx& operator++();
// post increment operator
wxLongLongWx& operator++(int) { return ++(*this); }
// negation operator
wxLongLongWx operator-() const;
wxLongLongWx& Negate();
// subraction
wxLongLongWx operator-(const wxLongLongWx& ll) const;
wxLongLongWx& operator-=(const wxLongLongWx& ll);
// pre decrement operator
wxLongLongWx& operator--();
// post decrement operator
wxLongLongWx& operator--(int) { return --(*this); }
// shifts
// left shift
wxLongLongWx operator<<(int shift) const;
wxLongLongWx& operator<<=(int shift);
// right shift
wxLongLongWx operator>>(int shift) const;
wxLongLongWx& operator>>=(int shift);
// bitwise operators
wxLongLongWx operator&(const wxLongLongWx& ll) const;
wxLongLongWx& operator&=(const wxLongLongWx& ll);
wxLongLongWx operator|(const wxLongLongWx& ll) const;
wxLongLongWx& operator|=(const wxLongLongWx& ll);
wxLongLongWx operator^(const wxLongLongWx& ll) const;
wxLongLongWx& operator^=(const wxLongLongWx& ll);
wxLongLongWx operator~() const;
// comparison
bool operator==(const wxLongLongWx& ll) const
{ return m_lo == ll.m_lo && m_hi == ll.m_hi; }
#if wxUSE_LONGLONG_NATIVE
bool operator==(const wxLongLongNative& ll) const
{ return m_lo == ll.GetLo() && m_hi == ll.GetHi(); }
#endif
bool operator!=(const wxLongLongWx& ll) const
{ return !(*this == ll); }
bool operator<(const wxLongLongWx& ll) const;
bool operator>(const wxLongLongWx& ll) const;
bool operator<=(const wxLongLongWx& ll) const
{ return *this < ll || *this == ll; }
bool operator>=(const wxLongLongWx& ll) const
{ return *this > ll || *this == ll; }
bool operator<(long l) const { return *this < wxLongLongWx(l); }
bool operator>(long l) const { return *this > wxLongLongWx(l); }
bool operator==(long l) const
{
return l >= 0 ? (m_hi == 0 && m_lo == (unsigned long)l)
: (m_hi == -1 && m_lo == (unsigned long)l);
}
bool operator<=(long l) const { return *this < l || *this == l; }
bool operator>=(long l) const { return *this > l || *this == l; }
// multiplication
wxLongLongWx operator*(const wxLongLongWx& ll) const;
wxLongLongWx& operator*=(const wxLongLongWx& ll);
// division
wxLongLongWx operator/(const wxLongLongWx& ll) const;
wxLongLongWx& operator/=(const wxLongLongWx& ll);
wxLongLongWx operator%(const wxLongLongWx& ll) const;
void Divide(const wxLongLongWx& divisor,
wxLongLongWx& quotient,
wxLongLongWx& remainder) const;
// input/output
// return the string representation of this number
wxString ToString() const;
void *asArray() const;
#if wxUSE_STD_IOSTREAM
friend WXDLLIMPEXP_BASE
wxSTD ostream& operator<<(wxSTD ostream&, const wxLongLongWx&);
#endif // wxUSE_STD_IOSTREAM
friend WXDLLIMPEXP_BASE
wxString& operator<<(wxString&, const wxLongLongWx&);
#if wxUSE_STREAMS
friend WXDLLIMPEXP_BASE
class wxTextOutputStream& operator<<(class wxTextOutputStream&, const wxLongLongWx&);
friend WXDLLIMPEXP_BASE
class wxTextInputStream& operator>>(class wxTextInputStream&, wxLongLongWx&);
#endif
private:
// long is at least 32 bits, so represent our 64bit number as 2 longs
long m_hi; // signed bit is in the high part
unsigned long m_lo;
#ifdef wxLONGLONG_TEST_MODE
void Check()
{
wxASSERT( (m_ll >> 32) == m_hi && (unsigned long)m_ll == m_lo );
}
wxLongLong_t m_ll;
#endif // wxLONGLONG_TEST_MODE
};
class WXDLLIMPEXP_BASE wxULongLongWx
{
public:
// ctors
// default ctor initializes to 0
wxULongLongWx()
{
m_lo = m_hi = 0;
#ifdef wxLONGLONG_TEST_MODE
m_ll = 0;
Check();
#endif // wxLONGLONG_TEST_MODE
}
// from ulong
wxULongLongWx(unsigned long l) { *this = l; }
// from 2 ulongs
wxULongLongWx(unsigned long hi, unsigned long lo)
{
m_hi = hi;
m_lo = lo;
#ifdef wxLONGLONG_TEST_MODE
m_ll = hi;
m_ll <<= 32;
m_ll |= lo;
Check();
#endif // wxLONGLONG_TEST_MODE
}
// from signed to unsigned
wxULongLongWx(wxLongLongWx ll)
{
wxASSERT(ll.GetHi() >= 0);
m_hi = (unsigned long)ll.GetHi();
m_lo = ll.GetLo();
}
// default copy ctor is ok in both cases
// no dtor
// assignment operators
// from long
wxULongLongWx& operator=(unsigned long l)
{
m_lo = l;
m_hi = 0;
#ifdef wxLONGLONG_TEST_MODE
m_ll = l;
Check();
#endif // wxLONGLONG_TEST_MODE
return *this;
}
wxULongLongWx& operator=(long l)
{
m_lo = l;
m_hi = (unsigned long) ((l<0) ? -1l : 0);
#ifdef wxLONGLONG_TEST_MODE
m_ll = (wxULongLong_t) (wxLongLong_t) l;
Check();
#endif // wxLONGLONG_TEST_MODE
return *this;
}
wxULongLongWx& operator=(const class wxLongLongWx &ll) {
// Should we use an assert like it was before in the constructor?
// wxASSERT(ll.GetHi() >= 0);
m_hi = (unsigned long)ll.GetHi();
m_lo = ll.GetLo();
return *this;
}
// can't have assignment operator from 2 longs
// accessors
// get high part
unsigned long GetHi() const { return m_hi; }
// get low part
unsigned long GetLo() const { return m_lo; }
// convert to long with range checking in debug mode (only!)
unsigned long ToULong() const
{
wxASSERT_MSG( m_hi == 0ul,
wxT("wxULongLong to long conversion loss of precision") );
return (unsigned long)m_lo;
}
// convert to double
double ToDouble() const;
// operations
// addition
wxULongLongWx operator+(const wxULongLongWx& ll) const;
wxULongLongWx& operator+=(const wxULongLongWx& ll);
wxULongLongWx operator+(unsigned long l) const;
wxULongLongWx& operator+=(unsigned long l);
// pre increment operator
wxULongLongWx& operator++();
// post increment operator
wxULongLongWx& operator++(int) { return ++(*this); }
// subtraction
wxLongLongWx operator-(const wxULongLongWx& ll) const;
wxULongLongWx& operator-=(const wxULongLongWx& ll);
// pre decrement operator
wxULongLongWx& operator--();
// post decrement operator
wxULongLongWx& operator--(int) { return --(*this); }
// shifts
// left shift
wxULongLongWx operator<<(int shift) const;
wxULongLongWx& operator<<=(int shift);
// right shift
wxULongLongWx operator>>(int shift) const;
wxULongLongWx& operator>>=(int shift);
// bitwise operators
wxULongLongWx operator&(const wxULongLongWx& ll) const;
wxULongLongWx& operator&=(const wxULongLongWx& ll);
wxULongLongWx operator|(const wxULongLongWx& ll) const;
wxULongLongWx& operator|=(const wxULongLongWx& ll);
wxULongLongWx operator^(const wxULongLongWx& ll) const;
wxULongLongWx& operator^=(const wxULongLongWx& ll);
wxULongLongWx operator~() const;
// comparison
bool operator==(const wxULongLongWx& ll) const
{ return m_lo == ll.m_lo && m_hi == ll.m_hi; }
bool operator!=(const wxULongLongWx& ll) const
{ return !(*this == ll); }
bool operator<(const wxULongLongWx& ll) const;
bool operator>(const wxULongLongWx& ll) const;
bool operator<=(const wxULongLongWx& ll) const
{ return *this < ll || *this == ll; }
bool operator>=(const wxULongLongWx& ll) const
{ return *this > ll || *this == ll; }
bool operator<(unsigned long l) const { return *this < wxULongLongWx(l); }
bool operator>(unsigned long l) const { return *this > wxULongLongWx(l); }
bool operator==(unsigned long l) const
{
return (m_hi == 0 && m_lo == (unsigned long)l);
}
bool operator<=(unsigned long l) const { return *this < l || *this == l; }
bool operator>=(unsigned long l) const { return *this > l || *this == l; }
// multiplication
wxULongLongWx operator*(const wxULongLongWx& ll) const;
wxULongLongWx& operator*=(const wxULongLongWx& ll);
// division
wxULongLongWx operator/(const wxULongLongWx& ll) const;
wxULongLongWx& operator/=(const wxULongLongWx& ll);
wxULongLongWx operator%(const wxULongLongWx& ll) const;
void Divide(const wxULongLongWx& divisor,
wxULongLongWx& quotient,
wxULongLongWx& remainder) const;
// input/output
// return the string representation of this number
wxString ToString() const;
void *asArray() const;
#if wxUSE_STD_IOSTREAM
friend WXDLLIMPEXP_BASE
wxSTD ostream& operator<<(wxSTD ostream&, const wxULongLongWx&);
#endif // wxUSE_STD_IOSTREAM
friend WXDLLIMPEXP_BASE
wxString& operator<<(wxString&, const wxULongLongWx&);
#if wxUSE_STREAMS
friend WXDLLIMPEXP_BASE
class wxTextOutputStream& operator<<(class wxTextOutputStream&, const wxULongLongWx&);
friend WXDLLIMPEXP_BASE
class wxTextInputStream& operator>>(class wxTextInputStream&, wxULongLongWx&);
#endif
private:
// long is at least 32 bits, so represent our 64bit number as 2 longs
unsigned long m_hi;
unsigned long m_lo;
#ifdef wxLONGLONG_TEST_MODE
void Check()
{
wxASSERT( (m_ll >> 32) == m_hi && (unsigned long)m_ll == m_lo );
}
wxULongLong_t m_ll;
#endif // wxLONGLONG_TEST_MODE
};
#endif // wxUSE_LONGLONG_WX
// ----------------------------------------------------------------------------
// binary operators
// ----------------------------------------------------------------------------
inline bool operator<(long l, const wxLongLong& ll) { return ll > l; }
inline bool operator>(long l, const wxLongLong& ll) { return ll < l; }
inline bool operator<=(long l, const wxLongLong& ll) { return ll >= l; }
inline bool operator>=(long l, const wxLongLong& ll) { return ll <= l; }
inline bool operator==(long l, const wxLongLong& ll) { return ll == l; }
inline bool operator!=(long l, const wxLongLong& ll) { return ll != l; }
inline wxLongLong operator+(long l, const wxLongLong& ll) { return ll + l; }
inline wxLongLong operator-(long l, const wxLongLong& ll)
{
return wxLongLong(l) - ll;
}
inline bool operator<(unsigned long l, const wxULongLong& ull) { return ull > l; }
inline bool operator>(unsigned long l, const wxULongLong& ull) { return ull < l; }
inline bool operator<=(unsigned long l, const wxULongLong& ull) { return ull >= l; }
inline bool operator>=(unsigned long l, const wxULongLong& ull) { return ull <= l; }
inline bool operator==(unsigned long l, const wxULongLong& ull) { return ull == l; }
inline bool operator!=(unsigned long l, const wxULongLong& ull) { return ull != l; }
inline wxULongLong operator+(unsigned long l, const wxULongLong& ull) { return ull + l; }
inline wxLongLong operator-(unsigned long l, const wxULongLong& ull)
{
const wxULongLong ret = wxULongLong(l) - ull;
return wxLongLong((wxInt32)ret.GetHi(),ret.GetLo());
}
#if wxUSE_LONGLONG_NATIVE && wxUSE_STREAMS
WXDLLIMPEXP_BASE class wxTextOutputStream &operator<<(class wxTextOutputStream &stream, wxULongLong_t value);
WXDLLIMPEXP_BASE class wxTextOutputStream &operator<<(class wxTextOutputStream &stream, wxLongLong_t value);
WXDLLIMPEXP_BASE class wxTextInputStream &operator>>(class wxTextInputStream &stream, wxULongLong_t &value);
WXDLLIMPEXP_BASE class wxTextInputStream &operator>>(class wxTextInputStream &stream, wxLongLong_t &value);
#endif
// ----------------------------------------------------------------------------
// Specialize numeric_limits<> for our long long wrapper classes.
// ----------------------------------------------------------------------------
#if wxUSE_LONGLONG_NATIVE
#include <limits>
namespace std
{
#ifdef __clang__
// libstdc++ (used by Clang) uses struct for numeric_limits; unlike gcc, clang
// warns about this
template<> struct numeric_limits<wxLongLong> : public numeric_limits<wxLongLong_t> {};
template<> struct numeric_limits<wxULongLong> : public numeric_limits<wxULongLong_t> {};
#else
template<> class numeric_limits<wxLongLong> : public numeric_limits<wxLongLong_t> {};
template<> class numeric_limits<wxULongLong> : public numeric_limits<wxULongLong_t> {};
#endif
} // namespace std
#endif // wxUSE_LONGLONG_NATIVE
// ----------------------------------------------------------------------------
// Specialize wxArgNormalizer to allow using wxLongLong directly with wx pseudo
// vararg functions.
// ----------------------------------------------------------------------------
// Notice that this must be done here and not in wx/strvararg.h itself because
// we can't include wx/longlong.h from there as this header itself includes
// wx/string.h which includes wx/strvararg.h too, so to avoid the circular
// dependencies we can only do it here (or add another header just for this but
// it doesn't seem necessary).
#include "wx/strvararg.h"
template<>
struct WXDLLIMPEXP_BASE wxArgNormalizer<wxLongLong>
{
wxArgNormalizer(wxLongLong value,
const wxFormatString *fmt, unsigned index)
: m_value(value)
{
wxASSERT_ARG_TYPE( fmt, index, wxFormatString::Arg_LongLongInt );
}
wxLongLong_t get() const { return m_value.GetValue(); }
wxLongLong m_value;
};
#endif // wxUSE_LONGLONG
#endif // _WX_LONGLONG_H
| h |
rticonnextdds-usecases | data/projects/rticonnextdds-usecases/VehicleTracking/ExampleCode/thirdparty/wxWidgets-3.1.2/Linux/include/wx/calctrl.h | ///////////////////////////////////////////////////////////////////////////////
// Name: wx/calctrl.h
// Purpose: date-picker control
// Author: Vadim Zeitlin
// Modified by:
// Created: 29.12.99
// Copyright: (c) 1999 Vadim Zeitlin <[email protected]>
// Licence: wxWindows licence
///////////////////////////////////////////////////////////////////////////////
#ifndef _WX_CALCTRL_H_
#define _WX_CALCTRL_H_
#include "wx/defs.h"
#if wxUSE_CALENDARCTRL
#include "wx/dateevt.h"
#include "wx/colour.h"
#include "wx/font.h"
#include "wx/control.h"
// ----------------------------------------------------------------------------
// wxCalendarCtrl flags
// ----------------------------------------------------------------------------
enum
{
// show Sunday as the first day of the week (default)
wxCAL_SUNDAY_FIRST = 0x0080,
// show Monday as the first day of the week
wxCAL_MONDAY_FIRST = 0x0001,
// highlight holidays
wxCAL_SHOW_HOLIDAYS = 0x0002,
// disable the year change control, show only the month change one
// deprecated
wxCAL_NO_YEAR_CHANGE = 0x0004,
// don't allow changing neither month nor year (implies
// wxCAL_NO_YEAR_CHANGE)
wxCAL_NO_MONTH_CHANGE = 0x000c,
// use MS-style month-selection instead of combo-spin combination
wxCAL_SEQUENTIAL_MONTH_SELECTION = 0x0010,
// show the neighbouring weeks in the previous and next month
wxCAL_SHOW_SURROUNDING_WEEKS = 0x0020,
// show week numbers on the left side of the calendar.
wxCAL_SHOW_WEEK_NUMBERS = 0x0040
};
// ----------------------------------------------------------------------------
// constants
// ----------------------------------------------------------------------------
// return values for the HitTest() method
enum wxCalendarHitTestResult
{
wxCAL_HITTEST_NOWHERE, // outside of anything
wxCAL_HITTEST_HEADER, // on the header (weekdays)
wxCAL_HITTEST_DAY, // on a day in the calendar
wxCAL_HITTEST_INCMONTH,
wxCAL_HITTEST_DECMONTH,
wxCAL_HITTEST_SURROUNDING_WEEK,
wxCAL_HITTEST_WEEK
};
// border types for a date
enum wxCalendarDateBorder
{
wxCAL_BORDER_NONE, // no border (default)
wxCAL_BORDER_SQUARE, // a rectangular border
wxCAL_BORDER_ROUND // a round border
};
// ----------------------------------------------------------------------------
// wxCalendarDateAttr: custom attributes for a calendar date
// ----------------------------------------------------------------------------
class WXDLLIMPEXP_CORE wxCalendarDateAttr
{
public:
// ctors
wxCalendarDateAttr(const wxColour& colText = wxNullColour,
const wxColour& colBack = wxNullColour,
const wxColour& colBorder = wxNullColour,
const wxFont& font = wxNullFont,
wxCalendarDateBorder border = wxCAL_BORDER_NONE)
: m_colText(colText), m_colBack(colBack),
m_colBorder(colBorder), m_font(font)
{
Init(border);
}
wxCalendarDateAttr(wxCalendarDateBorder border,
const wxColour& colBorder = wxNullColour)
: m_colBorder(colBorder)
{
Init(border);
}
// setters
void SetTextColour(const wxColour& colText) { m_colText = colText; }
void SetBackgroundColour(const wxColour& colBack) { m_colBack = colBack; }
void SetBorderColour(const wxColour& col) { m_colBorder = col; }
void SetFont(const wxFont& font) { m_font = font; }
void SetBorder(wxCalendarDateBorder border) { m_border = border; }
void SetHoliday(bool holiday) { m_holiday = holiday; }
// accessors
bool HasTextColour() const { return m_colText.IsOk(); }
bool HasBackgroundColour() const { return m_colBack.IsOk(); }
bool HasBorderColour() const { return m_colBorder.IsOk(); }
bool HasFont() const { return m_font.IsOk(); }
bool HasBorder() const { return m_border != wxCAL_BORDER_NONE; }
bool IsHoliday() const { return m_holiday; }
const wxColour& GetTextColour() const { return m_colText; }
const wxColour& GetBackgroundColour() const { return m_colBack; }
const wxColour& GetBorderColour() const { return m_colBorder; }
const wxFont& GetFont() const { return m_font; }
wxCalendarDateBorder GetBorder() const { return m_border; }
// get or change the "mark" attribute, i.e. the one used for the items
// marked with wxCalendarCtrl::Mark()
static const wxCalendarDateAttr& GetMark() { return m_mark; }
static void SetMark(wxCalendarDateAttr const& m) { m_mark = m; }
protected:
void Init(wxCalendarDateBorder border = wxCAL_BORDER_NONE)
{
m_border = border;
m_holiday = false;
}
private:
static wxCalendarDateAttr m_mark;
wxColour m_colText,
m_colBack,
m_colBorder;
wxFont m_font;
wxCalendarDateBorder m_border;
bool m_holiday;
};
// ----------------------------------------------------------------------------
// wxCalendarCtrl events
// ----------------------------------------------------------------------------
class WXDLLIMPEXP_FWD_CORE wxCalendarCtrl;
class WXDLLIMPEXP_CORE wxCalendarEvent : public wxDateEvent
{
public:
wxCalendarEvent() : m_wday(wxDateTime::Inv_WeekDay) { }
wxCalendarEvent(wxWindow *win, const wxDateTime& dt, wxEventType type)
: wxDateEvent(win, dt, type),
m_wday(wxDateTime::Inv_WeekDay) { }
wxCalendarEvent(const wxCalendarEvent& event)
: wxDateEvent(event), m_wday(event.m_wday) { }
void SetWeekDay(wxDateTime::WeekDay wd) { m_wday = wd; }
wxDateTime::WeekDay GetWeekDay() const { return m_wday; }
virtual wxEvent *Clone() const wxOVERRIDE { return new wxCalendarEvent(*this); }
private:
wxDateTime::WeekDay m_wday;
wxDECLARE_DYNAMIC_CLASS_NO_ASSIGN(wxCalendarEvent);
};
// ----------------------------------------------------------------------------
// wxCalendarCtrlBase
// ----------------------------------------------------------------------------
class WXDLLIMPEXP_CORE wxCalendarCtrlBase : public wxControl
{
public:
// do we allow changing the month/year?
bool AllowMonthChange() const { return !HasFlag(wxCAL_NO_MONTH_CHANGE); }
// get/set the current date
virtual wxDateTime GetDate() const = 0;
virtual bool SetDate(const wxDateTime& date) = 0;
// restricting the dates shown by the control to the specified range: only
// implemented in the generic and MSW versions for now
// if either date is set, the corresponding limit will be enforced and true
// returned; if none are set, the existing restrictions are removed and
// false is returned
virtual bool
SetDateRange(const wxDateTime& WXUNUSED(lowerdate) = wxDefaultDateTime,
const wxDateTime& WXUNUSED(upperdate) = wxDefaultDateTime)
{
return false;
}
// retrieves the limits currently in use (wxDefaultDateTime if none) in the
// provided pointers (which may be NULL) and returns true if there are any
// limits or false if none
virtual bool
GetDateRange(wxDateTime *lowerdate, wxDateTime *upperdate) const
{
if ( lowerdate )
*lowerdate = wxDefaultDateTime;
if ( upperdate )
*upperdate = wxDefaultDateTime;
return false;
}
// returns one of wxCAL_HITTEST_XXX constants and fills either date or wd
// with the corresponding value (none for NOWHERE, the date for DAY and wd
// for HEADER)
//
// notice that this is not implemented in all versions
virtual wxCalendarHitTestResult
HitTest(const wxPoint& WXUNUSED(pos),
wxDateTime* WXUNUSED(date) = NULL,
wxDateTime::WeekDay* WXUNUSED(wd) = NULL)
{
return wxCAL_HITTEST_NOWHERE;
}
// allow or disable changing the current month (and year), return true if
// the value of this option really changed or false if it was already set
// to the required value
//
// NB: we provide implementation for this pure virtual function, derived
// classes should call it
virtual bool EnableMonthChange(bool enable = true) = 0;
// an item without custom attributes is drawn with the default colours and
// font and without border, setting custom attributes allows to modify this
//
// the day parameter should be in 1..31 range, for days 29, 30, 31 the
// corresponding attribute is just unused if there is no such day in the
// current month
//
// notice that currently arbitrary attributes are supported only in the
// generic version, the native controls only support Mark() which assigns
// some special appearance (which can be customized using SetMark() for the
// generic version) to the given day
virtual void Mark(size_t day, bool mark) = 0;
virtual wxCalendarDateAttr *GetAttr(size_t WXUNUSED(day)) const
{ return NULL; }
virtual void SetAttr(size_t WXUNUSED(day), wxCalendarDateAttr *attr)
{ delete attr; }
virtual void ResetAttr(size_t WXUNUSED(day)) { }
// holidays support
//
// currently only the generic version implements all functions in this
// section; wxMSW implements simple support for holidays (they can be
// just enabled or disabled) and wxGTK doesn't support them at all
// equivalent to changing wxCAL_SHOW_HOLIDAYS flag but should be called
// instead of just changing it
virtual void EnableHolidayDisplay(bool display = true);
// set/get the colours to use for holidays (if they're enabled)
virtual void SetHolidayColours(const wxColour& WXUNUSED(colFg),
const wxColour& WXUNUSED(colBg)) { }
virtual const wxColour& GetHolidayColourFg() const { return wxNullColour; }
virtual const wxColour& GetHolidayColourBg() const { return wxNullColour; }
// mark the given day of the current month as being a holiday
virtual void SetHoliday(size_t WXUNUSED(day)) { }
// customizing the colours of the controls
//
// most of the methods in this section are only implemented by the native
// version of the control and do nothing in the native ones
// set/get the colours to use for the display of the week day names at the
// top of the controls
virtual void SetHeaderColours(const wxColour& WXUNUSED(colFg),
const wxColour& WXUNUSED(colBg)) { }
virtual const wxColour& GetHeaderColourFg() const { return wxNullColour; }
virtual const wxColour& GetHeaderColourBg() const { return wxNullColour; }
// set/get the colours used for the currently selected date
virtual void SetHighlightColours(const wxColour& WXUNUSED(colFg),
const wxColour& WXUNUSED(colBg)) { }
virtual const wxColour& GetHighlightColourFg() const { return wxNullColour; }
virtual const wxColour& GetHighlightColourBg() const { return wxNullColour; }
// implementation only from now on
// generate the given calendar event, return true if it was processed
//
// NB: this is public because it's used from GTK+ callbacks
bool GenerateEvent(wxEventType type)
{
wxCalendarEvent event(this, GetDate(), type);
return HandleWindowEvent(event);
}
protected:
// generate all the events for the selection change from dateOld to current
// date: SEL_CHANGED, PAGE_CHANGED if necessary and also one of (deprecated)
// YEAR/MONTH/DAY_CHANGED ones
//
// returns true if page changed event was generated, false if the new date
// is still in the same month as before
bool GenerateAllChangeEvents(const wxDateTime& dateOld);
// call SetHoliday() for all holidays in the current month
//
// should be called on month change, does nothing if wxCAL_SHOW_HOLIDAYS is
// not set and returns false in this case, true if we do show them
bool SetHolidayAttrs();
// called by SetHolidayAttrs() to forget the previously set holidays
virtual void ResetHolidayAttrs() { }
// called by EnableHolidayDisplay()
virtual void RefreshHolidays() { }
// does the week start on monday based on flags and OS settings?
bool WeekStartsOnMonday() const;
};
// ----------------------------------------------------------------------------
// wxCalendarCtrl
// ----------------------------------------------------------------------------
#define wxCalendarNameStr "CalendarCtrl"
#ifndef __WXUNIVERSAL__
#if defined(__WXGTK20__)
#define wxHAS_NATIVE_CALENDARCTRL
#include "wx/gtk/calctrl.h"
#define wxCalendarCtrl wxGtkCalendarCtrl
#elif defined(__WXMSW__)
#define wxHAS_NATIVE_CALENDARCTRL
#include "wx/msw/calctrl.h"
#elif defined(__WXQT__)
#define wxHAS_NATIVE_CALENDARCTRL
#include "wx/qt/calctrl.h"
#endif
#endif // !__WXUNIVERSAL__
#ifndef wxHAS_NATIVE_CALENDARCTRL
#include "wx/generic/calctrlg.h"
#define wxCalendarCtrl wxGenericCalendarCtrl
#endif
// ----------------------------------------------------------------------------
// calendar event types and macros for handling them
// ----------------------------------------------------------------------------
wxDECLARE_EXPORTED_EVENT( WXDLLIMPEXP_CORE, wxEVT_CALENDAR_SEL_CHANGED, wxCalendarEvent );
wxDECLARE_EXPORTED_EVENT( WXDLLIMPEXP_CORE, wxEVT_CALENDAR_PAGE_CHANGED, wxCalendarEvent );
wxDECLARE_EXPORTED_EVENT( WXDLLIMPEXP_CORE, wxEVT_CALENDAR_DOUBLECLICKED, wxCalendarEvent );
wxDECLARE_EXPORTED_EVENT( WXDLLIMPEXP_CORE, wxEVT_CALENDAR_WEEKDAY_CLICKED, wxCalendarEvent );
wxDECLARE_EXPORTED_EVENT( WXDLLIMPEXP_CORE, wxEVT_CALENDAR_WEEK_CLICKED, wxCalendarEvent );
// deprecated events
wxDECLARE_EXPORTED_EVENT( WXDLLIMPEXP_CORE, wxEVT_CALENDAR_DAY_CHANGED, wxCalendarEvent );
wxDECLARE_EXPORTED_EVENT( WXDLLIMPEXP_CORE, wxEVT_CALENDAR_MONTH_CHANGED, wxCalendarEvent );
wxDECLARE_EXPORTED_EVENT( WXDLLIMPEXP_CORE, wxEVT_CALENDAR_YEAR_CHANGED, wxCalendarEvent );
typedef void (wxEvtHandler::*wxCalendarEventFunction)(wxCalendarEvent&);
#define wxCalendarEventHandler(func) \
wxEVENT_HANDLER_CAST(wxCalendarEventFunction, func)
#define wx__DECLARE_CALEVT(evt, id, fn) \
wx__DECLARE_EVT1(wxEVT_CALENDAR_ ## evt, id, wxCalendarEventHandler(fn))
#define EVT_CALENDAR(id, fn) wx__DECLARE_CALEVT(DOUBLECLICKED, id, fn)
#define EVT_CALENDAR_SEL_CHANGED(id, fn) wx__DECLARE_CALEVT(SEL_CHANGED, id, fn)
#define EVT_CALENDAR_PAGE_CHANGED(id, fn) wx__DECLARE_CALEVT(PAGE_CHANGED, id, fn)
#define EVT_CALENDAR_WEEKDAY_CLICKED(id, fn) wx__DECLARE_CALEVT(WEEKDAY_CLICKED, id, fn)
#define EVT_CALENDAR_WEEK_CLICKED(id, fn) wx__DECLARE_CALEVT(WEEK_CLICKED, id, fn)
// deprecated events
#define EVT_CALENDAR_DAY(id, fn) wx__DECLARE_CALEVT(DAY_CHANGED, id, fn)
#define EVT_CALENDAR_MONTH(id, fn) wx__DECLARE_CALEVT(MONTH_CHANGED, id, fn)
#define EVT_CALENDAR_YEAR(id, fn) wx__DECLARE_CALEVT(YEAR_CHANGED, id, fn)
#endif // wxUSE_CALENDARCTRL
#endif // _WX_CALCTRL_H_
| h |
rticonnextdds-usecases | data/projects/rticonnextdds-usecases/VehicleTracking/ExampleCode/thirdparty/wxWidgets-3.1.2/Linux/include/wx/webviewfshandler.h | /////////////////////////////////////////////////////////////////////////////
// Name: webviewfshandler.h
// Purpose: Custom webview handler for virtual file system
// Author: Nick Matthews
// Copyright: (c) 2012 Steven Lamerton
// Licence: wxWindows licence
/////////////////////////////////////////////////////////////////////////////
// Based on webviewarchivehandler.h file by Steven Lamerton
#ifndef _WX_WEBVIEW_FS_HANDLER_H_
#define _WX_WEBVIEW_FS_HANDLER_H_
#include "wx/setup.h"
#if wxUSE_WEBVIEW
class wxFSFile;
class wxFileSystem;
#include "wx/webview.h"
//Loads from uris such as scheme:example.html
class WXDLLIMPEXP_WEBVIEW wxWebViewFSHandler : public wxWebViewHandler
{
public:
wxWebViewFSHandler(const wxString& scheme);
virtual ~wxWebViewFSHandler();
virtual wxFSFile* GetFile(const wxString &uri) wxOVERRIDE;
private:
wxFileSystem* m_fileSystem;
};
#endif // wxUSE_WEBVIEW
#endif // _WX_WEBVIEW_FS_HANDLER_H_
| h |
rticonnextdds-usecases | data/projects/rticonnextdds-usecases/VehicleTracking/ExampleCode/thirdparty/wxWidgets-3.1.2/Linux/include/wx/wizard.h | ///////////////////////////////////////////////////////////////////////////////
// Name: wx/wizard.h
// Purpose: wxWizard class: a GUI control presenting the user with a
// sequence of dialogs which allows to simply perform some task
// Author: Vadim Zeitlin (partly based on work by Ron Kuris and Kevin B.
// Smith)
// Modified by: Robert Cavanaugh
// Added capability to use .WXR resource files in Wizard pages
// Added wxWIZARD_HELP event
// Robert Vazan (sizers)
// Created: 15.08.99
// Copyright: (c) 1999 Vadim Zeitlin <[email protected]>
// Licence: wxWindows licence
///////////////////////////////////////////////////////////////////////////////
#ifndef _WX_WIZARD_H_
#define _WX_WIZARD_H_
#include "wx/defs.h"
#if wxUSE_WIZARDDLG
// ----------------------------------------------------------------------------
// headers and other simple declarations
// ----------------------------------------------------------------------------
#include "wx/dialog.h" // the base class
#include "wx/panel.h" // ditto
#include "wx/event.h" // wxEVT_XXX constants
#include "wx/bitmap.h"
// Extended style to specify a help button
#define wxWIZARD_EX_HELPBUTTON 0x00000010
// Placement flags
#define wxWIZARD_VALIGN_TOP 0x01
#define wxWIZARD_VALIGN_CENTRE 0x02
#define wxWIZARD_VALIGN_BOTTOM 0x04
#define wxWIZARD_HALIGN_LEFT 0x08
#define wxWIZARD_HALIGN_CENTRE 0x10
#define wxWIZARD_HALIGN_RIGHT 0x20
#define wxWIZARD_TILE 0x40
// forward declarations
class WXDLLIMPEXP_FWD_CORE wxWizard;
// ----------------------------------------------------------------------------
// wxWizardPage is one of the wizards screen: it must know what are the
// following and preceding pages (which may be NULL for the first/last page).
//
// Other than GetNext/Prev() functions, wxWizardPage is just a panel and may be
// used as such (i.e. controls may be placed directly on it &c).
// ----------------------------------------------------------------------------
class WXDLLIMPEXP_CORE wxWizardPage : public wxPanel
{
public:
wxWizardPage() { Init(); }
// ctor accepts an optional bitmap which will be used for this page instead
// of the default one for this wizard (should be of the same size). Notice
// that no other parameters are needed because the wizard will resize and
// reposition the page anyhow
wxWizardPage(wxWizard *parent,
const wxBitmap& bitmap = wxNullBitmap);
bool Create(wxWizard *parent,
const wxBitmap& bitmap = wxNullBitmap);
// these functions are used by the wizard to show another page when the
// user chooses "Back" or "Next" button
virtual wxWizardPage *GetPrev() const = 0;
virtual wxWizardPage *GetNext() const = 0;
// default GetBitmap() will just return m_bitmap which is ok in 99% of
// cases - override this method if you want to create the bitmap to be used
// dynamically or to do something even more fancy. It's ok to return
// wxNullBitmap from here - the default one will be used then.
virtual wxBitmap GetBitmap() const { return m_bitmap; }
#if wxUSE_VALIDATORS
// Override the base functions to allow a validator to be assigned to this page.
virtual bool TransferDataToWindow() wxOVERRIDE
{
return GetValidator() ? GetValidator()->TransferToWindow()
: wxPanel::TransferDataToWindow();
}
virtual bool TransferDataFromWindow() wxOVERRIDE
{
return GetValidator() ? GetValidator()->TransferFromWindow()
: wxPanel::TransferDataFromWindow();
}
virtual bool Validate() wxOVERRIDE
{
return GetValidator() ? GetValidator()->Validate(this)
: wxPanel::Validate();
}
#endif // wxUSE_VALIDATORS
protected:
// common part of ctors:
void Init();
wxBitmap m_bitmap;
private:
wxDECLARE_DYNAMIC_CLASS_NO_COPY(wxWizardPage);
};
// ----------------------------------------------------------------------------
// wxWizardPageSimple just returns the pointers given to the ctor and is useful
// to create a simple wizard where the order of pages never changes.
//
// OTOH, it is also possible to dynamically decide which page to return (i.e.
// depending on the user's choices) as the wizard sample shows - in order to do
// this, you must derive from wxWizardPage directly.
// ----------------------------------------------------------------------------
class WXDLLIMPEXP_CORE wxWizardPageSimple : public wxWizardPage
{
public:
wxWizardPageSimple() { Init(); }
// ctor takes the previous and next pages
wxWizardPageSimple(wxWizard *parent,
wxWizardPage *prev = NULL,
wxWizardPage *next = NULL,
const wxBitmap& bitmap = wxNullBitmap)
{
Create(parent, prev, next, bitmap);
}
bool Create(wxWizard *parent = NULL, // let it be default ctor too
wxWizardPage *prev = NULL,
wxWizardPage *next = NULL,
const wxBitmap& bitmap = wxNullBitmap)
{
m_prev = prev;
m_next = next;
return wxWizardPage::Create(parent, bitmap);
}
// the pointers may be also set later - but before starting the wizard
void SetPrev(wxWizardPage *prev) { m_prev = prev; }
void SetNext(wxWizardPage *next) { m_next = next; }
// Convenience functions to make the pages follow each other without having
// to call their SetPrev() or SetNext() explicitly.
wxWizardPageSimple& Chain(wxWizardPageSimple* next)
{
SetNext(next);
next->SetPrev(this);
return *next;
}
static void Chain(wxWizardPageSimple *first, wxWizardPageSimple *second)
{
wxCHECK_RET( first && second,
wxT("NULL passed to wxWizardPageSimple::Chain") );
first->SetNext(second);
second->SetPrev(first);
}
// base class pure virtuals
virtual wxWizardPage *GetPrev() const wxOVERRIDE;
virtual wxWizardPage *GetNext() const wxOVERRIDE;
private:
// common part of ctors:
void Init()
{
m_prev = m_next = NULL;
}
// pointers are private, the derived classes shouldn't mess with them -
// just derive from wxWizardPage directly to implement different behaviour
wxWizardPage *m_prev,
*m_next;
wxDECLARE_DYNAMIC_CLASS_NO_COPY(wxWizardPageSimple);
};
// ----------------------------------------------------------------------------
// wxWizard
// ----------------------------------------------------------------------------
class WXDLLIMPEXP_CORE wxWizardBase : public wxDialog
{
public:
/*
The derived class (i.e. the real wxWizard) has a ctor and Create()
function taking the following arguments:
wxWizard(wxWindow *parent,
int id = wxID_ANY,
const wxString& title = wxEmptyString,
const wxBitmap& bitmap = wxNullBitmap,
const wxPoint& pos = wxDefaultPosition,
long style = wxDEFAULT_DIALOG_STYLE);
*/
wxWizardBase() { }
// executes the wizard starting from the given page, returns true if it was
// successfully finished, false if user cancelled it
virtual bool RunWizard(wxWizardPage *firstPage) = 0;
// get the current page (NULL if RunWizard() isn't running)
virtual wxWizardPage *GetCurrentPage() const = 0;
// set the min size which should be available for the pages: a
// wizard will take into account the size of the bitmap (if any)
// itself and will never be less than some predefined fixed size
virtual void SetPageSize(const wxSize& size) = 0;
// get the size available for the page
virtual wxSize GetPageSize() const = 0;
// set the best size for the wizard, i.e. make it big enough to contain all
// of the pages starting from the given one
//
// this function may be called several times and possible with different
// pages in which case it will only increase the page size if needed (this
// may be useful if not all pages are accessible from the first one by
// default)
virtual void FitToPage(const wxWizardPage *firstPage) = 0;
// Adding pages to page area sizer enlarges wizard
virtual wxSizer *GetPageAreaSizer() const = 0;
// Set border around page area. Default is 0 if you add at least one
// page to GetPageAreaSizer and 5 if you don't.
virtual void SetBorder(int border) = 0;
// the methods below may be overridden by the derived classes to provide
// custom logic for determining the pages order
virtual bool HasNextPage(wxWizardPage *page)
{ return page->GetNext() != NULL; }
virtual bool HasPrevPage(wxWizardPage *page)
{ return page->GetPrev() != NULL; }
/// Override these functions to stop InitDialog from calling TransferDataToWindow
/// for _all_ pages when the wizard starts. Instead 'ShowPage' will call
/// TransferDataToWindow for the first page only.
bool TransferDataToWindow() wxOVERRIDE { return true; }
bool TransferDataFromWindow() wxOVERRIDE { return true; }
bool Validate() wxOVERRIDE { return true; }
private:
wxDECLARE_NO_COPY_CLASS(wxWizardBase);
};
// include the real class declaration
#include "wx/generic/wizard.h"
// ----------------------------------------------------------------------------
// wxWizardEvent class represents an event generated by the wizard: this event
// is first sent to the page itself and, if not processed there, goes up the
// window hierarchy as usual
// ----------------------------------------------------------------------------
class WXDLLIMPEXP_CORE wxWizardEvent : public wxNotifyEvent
{
public:
wxWizardEvent(wxEventType type = wxEVT_NULL,
int id = wxID_ANY,
bool direction = true,
wxWizardPage* page = NULL);
// for EVT_WIZARD_PAGE_CHANGING, return true if we're going forward or
// false otherwise and for EVT_WIZARD_PAGE_CHANGED return true if we came
// from the previous page and false if we returned from the next one
// (this function doesn't make sense for CANCEL events)
bool GetDirection() const { return m_direction; }
wxWizardPage* GetPage() const { return m_page; }
virtual wxEvent *Clone() const wxOVERRIDE { return new wxWizardEvent(*this); }
private:
bool m_direction;
wxWizardPage* m_page;
wxDECLARE_DYNAMIC_CLASS_NO_ASSIGN(wxWizardEvent);
};
// ----------------------------------------------------------------------------
// macros for handling wxWizardEvents
// ----------------------------------------------------------------------------
wxDECLARE_EXPORTED_EVENT( WXDLLIMPEXP_CORE, wxEVT_WIZARD_PAGE_CHANGED, wxWizardEvent );
wxDECLARE_EXPORTED_EVENT( WXDLLIMPEXP_CORE, wxEVT_WIZARD_PAGE_CHANGING, wxWizardEvent );
wxDECLARE_EXPORTED_EVENT( WXDLLIMPEXP_CORE, wxEVT_WIZARD_CANCEL, wxWizardEvent );
wxDECLARE_EXPORTED_EVENT( WXDLLIMPEXP_CORE, wxEVT_WIZARD_HELP, wxWizardEvent );
wxDECLARE_EXPORTED_EVENT( WXDLLIMPEXP_CORE, wxEVT_WIZARD_FINISHED, wxWizardEvent );
wxDECLARE_EXPORTED_EVENT( WXDLLIMPEXP_CORE, wxEVT_WIZARD_PAGE_SHOWN, wxWizardEvent );
wxDECLARE_EXPORTED_EVENT( WXDLLIMPEXP_CORE, wxEVT_WIZARD_BEFORE_PAGE_CHANGED, wxWizardEvent );
typedef void (wxEvtHandler::*wxWizardEventFunction)(wxWizardEvent&);
#define wxWizardEventHandler(func) \
wxEVENT_HANDLER_CAST(wxWizardEventFunction, func)
#define wx__DECLARE_WIZARDEVT(evt, id, fn) \
wx__DECLARE_EVT1(wxEVT_WIZARD_ ## evt, id, wxWizardEventHandler(fn))
// notifies that the page has just been changed (can't be vetoed)
#define EVT_WIZARD_PAGE_CHANGED(id, fn) wx__DECLARE_WIZARDEVT(PAGE_CHANGED, id, fn)
// the user pressed "<Back" or "Next>" button and the page is going to be
// changed - unless the event handler vetoes the event
#define EVT_WIZARD_PAGE_CHANGING(id, fn) wx__DECLARE_WIZARDEVT(PAGE_CHANGING, id, fn)
// Called before GetNext/GetPrev is called, so that the handler can change state that will be
// used when GetNext/GetPrev is called. PAGE_CHANGING is called too late to influence GetNext/GetPrev.
#define EVT_WIZARD_BEFORE_PAGE_CHANGED(id, fn) wx__DECLARE_WIZARDEVT(BEFORE_PAGE_CHANGED, id, fn)
// the user pressed "Cancel" button and the wizard is going to be dismissed -
// unless the event handler vetoes the event
#define EVT_WIZARD_CANCEL(id, fn) wx__DECLARE_WIZARDEVT(CANCEL, id, fn)
// the user pressed "Finish" button and the wizard is going to be dismissed -
#define EVT_WIZARD_FINISHED(id, fn) wx__DECLARE_WIZARDEVT(FINISHED, id, fn)
// the user pressed "Help" button
#define EVT_WIZARD_HELP(id, fn) wx__DECLARE_WIZARDEVT(HELP, id, fn)
// the page was just shown and laid out
#define EVT_WIZARD_PAGE_SHOWN(id, fn) wx__DECLARE_WIZARDEVT(PAGE_SHOWN, id, fn)
#endif // wxUSE_WIZARDDLG
#endif // _WX_WIZARD_H_
| h |
rticonnextdds-usecases | data/projects/rticonnextdds-usecases/VehicleTracking/ExampleCode/thirdparty/wxWidgets-3.1.2/Linux/include/wx/variantbase.h | /////////////////////////////////////////////////////////////////////////////
// Name: wx/variantbase.h
// Purpose: wxVariantBase class, a minimal version of wxVariant used by XTI
// Author: Julian Smart
// Modified by: Francesco Montorsi
// Created: 10/09/98
// Copyright: (c) Julian Smart
// Licence: wxWindows licence
/////////////////////////////////////////////////////////////////////////////
#ifndef _WX_VARIANTBASE_H_
#define _WX_VARIANTBASE_H_
#include "wx/defs.h"
#if wxUSE_VARIANT
#include "wx/string.h"
#include "wx/arrstr.h"
#include "wx/cpp.h"
#include <typeinfo>
#if wxUSE_DATETIME
#include "wx/datetime.h"
#endif // wxUSE_DATETIME
#include "wx/iosfwrap.h"
class wxTypeInfo;
class wxObject;
class wxClassInfo;
/*
* wxVariantData stores the actual data in a wxVariant object,
* to allow it to store any type of data.
* Derive from this to provide custom data handling.
*
* NB: To prevent addition of extra vtbl pointer to wxVariantData,
* we don't multiple-inherit from wxObjectRefData. Instead,
* we simply replicate the wxObject ref-counting scheme.
*
* NB: When you construct a wxVariantData, it will have refcount
* of one. Refcount will not be further increased when
* it is passed to wxVariant. This simulates old common
* scenario where wxVariant took ownership of wxVariantData
* passed to it.
* If you create wxVariantData for other reasons than passing
* it to wxVariant, technically you are not required to call
* DecRef() before deleting it.
*
* TODO: in order to replace wxPropertyValue, we would need
* to consider adding constructors that take pointers to C++ variables,
* or removing that functionality from the wxProperty library.
* Essentially wxPropertyValue takes on some of the wxValidator functionality
* by storing pointers and not just actual values, allowing update of C++ data
* to be handled automatically. Perhaps there's another way of doing this without
* overloading wxVariant with unnecessary functionality.
*/
class WXDLLIMPEXP_BASE wxVariantData
{
friend class wxVariantBase;
public:
wxVariantData()
: m_count(1)
{ }
#if wxUSE_STD_IOSTREAM
virtual bool Write(wxSTD ostream& WXUNUSED(str)) const { return false; }
virtual bool Read(wxSTD istream& WXUNUSED(str)) { return false; }
#endif
virtual bool Write(wxString& WXUNUSED(str)) const { return false; }
virtual bool Read(wxString& WXUNUSED(str)) { return false; }
// Override these to provide common functionality
virtual bool Eq(wxVariantData& data) const = 0;
// What type is it? Return a string name.
virtual wxString GetType() const = 0;
// returns the type info of the content
virtual const wxTypeInfo* GetTypeInfo() const = 0;
// If it based on wxObject return the ClassInfo.
virtual wxClassInfo* GetValueClassInfo() { return NULL; }
int GetRefCount() const
{ return m_count; }
void IncRef()
{ m_count++; }
void DecRef()
{
if ( --m_count == 0 )
delete this;
}
protected:
// Protected dtor should make some incompatible code
// break more louder. That is, they should do data->DecRef()
// instead of delete data.
virtual ~wxVariantData() {}
private:
int m_count;
};
template<typename T> class wxVariantDataT : public wxVariantData
{
public:
wxVariantDataT(const T& d) : m_data(d) {}
virtual ~wxVariantDataT() {}
// get a ref to the stored data
T & Get() { return m_data; }
// get a const ref to the stored data
const T & Get() const { return m_data; }
// set the data
void Set(const T& d) { m_data = d; }
// Override these to provide common functionality
virtual bool Eq(wxVariantData& WXUNUSED(data)) const
{ return false; /* FIXME!! */ }
// What type is it? Return a string name.
virtual wxString GetType() const
{ return GetTypeInfo()->GetTypeName(); }
// return a heap allocated duplicate
//virtual wxVariantData* Clone() const { return new wxVariantDataT<T>( Get() ); }
// returns the type info of the contentc
virtual const wxTypeInfo* GetTypeInfo() const { return wxGetTypeInfo( (T*) NULL ); }
private:
T m_data;
};
/*
* wxVariantBase can store any kind of data, but has some basic types
* built in.
*/
class WXDLLIMPEXP_BASE wxVariantBase
{
public:
wxVariantBase();
wxVariantBase(const wxVariantBase& variant);
wxVariantBase(wxVariantData* data, const wxString& name = wxEmptyString);
template<typename T>
wxVariantBase(const T& data, const wxString& name = wxEmptyString) :
m_data(new wxVariantDataT<T>(data)), m_name(name) {}
virtual ~wxVariantBase();
// generic assignment
void operator= (const wxVariantBase& variant);
// Assignment using data, e.g.
// myVariant = new wxStringVariantData("hello");
void operator= (wxVariantData* variantData);
bool operator== (const wxVariantBase& variant) const;
bool operator!= (const wxVariantBase& variant) const;
// Sets/gets name
inline void SetName(const wxString& name) { m_name = name; }
inline const wxString& GetName() const { return m_name; }
// Tests whether there is data
bool IsNull() const;
// FIXME: used by wxVariantBase code but is nice wording...
bool IsEmpty() const { return IsNull(); }
// For compatibility with wxWidgets <= 2.6, this doesn't increase
// reference count.
wxVariantData* GetData() const { return m_data; }
void SetData(wxVariantData* data) ;
// make a 'clone' of the object
void Ref(const wxVariantBase& clone);
// destroy a reference
void UnRef();
// Make NULL (i.e. delete the data)
void MakeNull();
// write contents to a string (e.g. for debugging)
wxString MakeString() const;
// Delete data and name
void Clear();
// Returns a string representing the type of the variant,
// e.g. "string", "bool", "stringlist", "list", "double", "long"
wxString GetType() const;
bool IsType(const wxString& type) const;
bool IsValueKindOf(const wxClassInfo* type) const;
// FIXME wxXTI methods:
// get the typeinfo of the stored object
const wxTypeInfo* GetTypeInfo() const
{
if (!m_data)
return NULL;
return m_data->GetTypeInfo();
}
// get a ref to the stored data
template<typename T> T& Get()
{
wxVariantDataT<T> *dataptr =
wx_dynamic_cast(wxVariantDataT<T>*, m_data);
wxASSERT_MSG( dataptr,
wxString::Format(wxT("Cast to %s not possible"), typeid(T).name()) );
return dataptr->Get();
}
// get a const ref to the stored data
template<typename T> const T& Get() const
{
const wxVariantDataT<T> *dataptr =
wx_dynamic_cast(const wxVariantDataT<T>*, m_data);
wxASSERT_MSG( dataptr,
wxString::Format(wxT("Cast to %s not possible"), typeid(T).name()) );
return dataptr->Get();
}
template<typename T> bool HasData() const
{
const wxVariantDataT<T> *dataptr =
wx_dynamic_cast(const wxVariantDataT<T>*, m_data);
return dataptr != NULL;
}
// returns this value as string
wxString GetAsString() const;
// gets the stored data casted to a wxObject*,
// returning NULL if cast is not possible
wxObject* GetAsObject();
protected:
wxVariantData* m_data;
wxString m_name;
};
#include "wx/dynarray.h"
WX_DECLARE_OBJARRAY_WITH_DECL(wxVariantBase, wxVariantBaseArray, class WXDLLIMPEXP_BASE);
// templated streaming, every type must have their specialization for these methods
template<typename T>
void wxStringReadValue( const wxString &s, T &data );
template<typename T>
void wxStringWriteValue( wxString &s, const T &data);
template<typename T>
void wxToStringConverter( const wxVariantBase &v, wxString &s ) \
{ wxStringWriteValue( s, v.Get<T>() ); }
template<typename T>
void wxFromStringConverter( const wxString &s, wxVariantBase &v ) \
{ T d; wxStringReadValue( s, d ); v = wxVariantBase(d); }
#endif // wxUSE_VARIANT
#endif // _WX_VARIANTBASE_H_
| h |
rticonnextdds-usecases | data/projects/rticonnextdds-usecases/VehicleTracking/ExampleCode/thirdparty/wxWidgets-3.1.2/Linux/include/wx/tracker.h | /////////////////////////////////////////////////////////////////////////////
// Name: wx/tracker.h
// Purpose: Support class for object lifetime tracking (wxWeakRef<T>)
// Author: Arne Steinarson
// Created: 28 Dec 07
// Copyright: (c) 2007 Arne Steinarson
// Licence: wxWindows licence
/////////////////////////////////////////////////////////////////////////////
#ifndef _WX_TRACKER_H_
#define _WX_TRACKER_H_
#include "wx/defs.h"
class wxEventConnectionRef;
// This class represents an object tracker and is stored in a linked list
// in the tracked object. It is only used in one of its derived forms.
class WXDLLIMPEXP_BASE wxTrackerNode
{
public:
wxTrackerNode() : m_nxt(NULL) { }
virtual ~wxTrackerNode() { }
virtual void OnObjectDestroy() = 0;
virtual wxEventConnectionRef *ToEventConnection() { return NULL; }
private:
wxTrackerNode *m_nxt;
friend class wxTrackable; // For list access
friend class wxEvtHandler; // For list access
};
// Add-on base class for a trackable object.
class WXDLLIMPEXP_BASE wxTrackable
{
public:
void AddNode(wxTrackerNode *prn)
{
prn->m_nxt = m_first;
m_first = prn;
}
void RemoveNode(wxTrackerNode *prn)
{
for ( wxTrackerNode **pprn = &m_first; *pprn; pprn = &(*pprn)->m_nxt )
{
if ( *pprn == prn )
{
*pprn = prn->m_nxt;
return;
}
}
wxFAIL_MSG( "removing invalid tracker node" );
}
wxTrackerNode *GetFirst() const { return m_first; }
protected:
// this class is only supposed to be used as a base class but never be
// created nor destroyed directly so all ctors and dtor are protected
wxTrackable() : m_first(NULL) { }
// copy ctor and assignment operator intentionally do not copy m_first: the
// objects which track the original trackable shouldn't track the new copy
wxTrackable(const wxTrackable& WXUNUSED(other)) : m_first(NULL) { }
wxTrackable& operator=(const wxTrackable& WXUNUSED(other)) { return *this; }
// dtor is not virtual: this class is not supposed to be used
// polymorphically and adding a virtual table to it would add unwanted
// overhead
~wxTrackable()
{
// Notify all registered refs
while ( m_first )
{
wxTrackerNode * const first = m_first;
m_first = first->m_nxt;
first->OnObjectDestroy();
}
}
wxTrackerNode *m_first;
};
#endif // _WX_TRACKER_H_
| h |
rticonnextdds-usecases | data/projects/rticonnextdds-usecases/VehicleTracking/ExampleCode/thirdparty/wxWidgets-3.1.2/Linux/include/wx/hashset.h | /////////////////////////////////////////////////////////////////////////////
// Name: wx/hashset.h
// Purpose: wxHashSet class
// Author: Mattia Barbon
// Modified by:
// Created: 11/08/2003
// Copyright: (c) Mattia Barbon
// Licence: wxWindows licence
/////////////////////////////////////////////////////////////////////////////
#ifndef _WX_HASHSET_H_
#define _WX_HASHSET_H_
#include "wx/hashmap.h"
// see comment in wx/hashmap.h which also applies to different standard hash
// set classes
#if wxUSE_STD_CONTAINERS && \
(defined(HAVE_STD_UNORDERED_SET) || defined(HAVE_TR1_UNORDERED_SET))
#if defined(HAVE_STD_UNORDERED_SET)
#include <unordered_set>
#define WX_HASH_SET_BASE_TEMPLATE std::unordered_set
#elif defined(HAVE_TR1_UNORDERED_SET)
#include <tr1/unordered_set>
#define WX_HASH_SET_BASE_TEMPLATE std::tr1::unordered_set
#else
#error Update this code: unordered_set is available, but I do not know where.
#endif
#elif wxUSE_STD_CONTAINERS && defined(HAVE_STL_HASH_MAP)
#if defined(HAVE_EXT_HASH_MAP)
#include <ext/hash_set>
#elif defined(HAVE_HASH_MAP)
#include <hash_set>
#endif
#define WX_HASH_SET_BASE_TEMPLATE WX_HASH_MAP_NAMESPACE::hash_set
#endif // different hash_set/unordered_set possibilities
#ifdef WX_HASH_SET_BASE_TEMPLATE
// we need to define the class declared by _WX_DECLARE_HASH_SET as a class and
// not a typedef to allow forward declaring it
#define _WX_DECLARE_HASH_SET_IMPL( KEY_T, HASH_T, KEY_EQ_T, PTROP, CLASSNAME, CLASSEXP ) \
CLASSEXP CLASSNAME \
: public WX_HASH_SET_BASE_TEMPLATE< KEY_T, HASH_T, KEY_EQ_T > \
{ \
public: \
explicit CLASSNAME(size_type n = 3, \
const hasher& h = hasher(), \
const key_equal& ke = key_equal(), \
const allocator_type& a = allocator_type()) \
: WX_HASH_SET_BASE_TEMPLATE< KEY_T, HASH_T, KEY_EQ_T >(n, h, ke, a) \
{} \
template <class InputIterator> \
CLASSNAME(InputIterator f, InputIterator l, \
const hasher& h = hasher(), \
const key_equal& ke = key_equal(), \
const allocator_type& a = allocator_type()) \
: WX_HASH_SET_BASE_TEMPLATE< KEY_T, HASH_T, KEY_EQ_T >(f, l, h, ke, a)\
{} \
CLASSNAME(const WX_HASH_SET_BASE_TEMPLATE< KEY_T, HASH_T, KEY_EQ_T >& s) \
: WX_HASH_SET_BASE_TEMPLATE< KEY_T, HASH_T, KEY_EQ_T >(s) \
{} \
}
// In some standard library implementations (in particular, the libstdc++ that
// ships with g++ 4.7), std::unordered_set inherits privately from its hasher
// and comparator template arguments for purposes of empty base optimization.
// As a result, in the declaration of a class deriving from std::unordered_set
// the names of the hasher and comparator classes are interpreted as naming
// the base class which is inaccessible.
// The workaround is to prefix the class names with 'struct'; however, don't
// do this on MSVC because it causes a warning there if the class was
// declared as a 'class' rather than a 'struct' (and MSVC's std::unordered_set
// implementation does not suffer from the access problem).
#ifdef _MSC_VER
#define WX_MAYBE_PREFIX_WITH_STRUCT(STRUCTNAME) STRUCTNAME
#else
#define WX_MAYBE_PREFIX_WITH_STRUCT(STRUCTNAME) struct STRUCTNAME
#endif
#define _WX_DECLARE_HASH_SET( KEY_T, HASH_T, KEY_EQ_T, PTROP, CLASSNAME, CLASSEXP ) \
_WX_DECLARE_HASH_SET_IMPL( \
KEY_T, \
WX_MAYBE_PREFIX_WITH_STRUCT(HASH_T), \
WX_MAYBE_PREFIX_WITH_STRUCT(KEY_EQ_T), \
PTROP, \
CLASSNAME, \
CLASSEXP)
#else // no appropriate STL class, use our own implementation
// this is a complex way of defining an easily inlineable identity function...
#define _WX_DECLARE_HASH_SET_KEY_EX( KEY_T, CLASSNAME, CLASSEXP ) \
CLASSEXP CLASSNAME \
{ \
typedef KEY_T key_type; \
typedef const key_type const_key_type; \
typedef const_key_type& const_key_reference; \
public: \
CLASSNAME() { } \
const_key_reference operator()( const_key_reference key ) const \
{ return key; } \
\
/* the dummy assignment operator is needed to suppress compiler */ \
/* warnings from hash table class' operator=(): gcc complains about */ \
/* "statement with no effect" without it */ \
CLASSNAME& operator=(const CLASSNAME&) { return *this; } \
};
#define _WX_DECLARE_HASH_SET( KEY_T, HASH_T, KEY_EQ_T, PTROP, CLASSNAME, CLASSEXP )\
_WX_DECLARE_HASH_SET_KEY_EX( KEY_T, CLASSNAME##_wxImplementation_KeyEx, CLASSEXP ) \
_WX_DECLARE_HASHTABLE( KEY_T, KEY_T, HASH_T, \
CLASSNAME##_wxImplementation_KeyEx, KEY_EQ_T, PTROP, \
CLASSNAME##_wxImplementation_HashTable, CLASSEXP, grow_lf70, never_shrink ) \
CLASSEXP CLASSNAME:public CLASSNAME##_wxImplementation_HashTable \
{ \
public: \
_WX_DECLARE_PAIR( iterator, bool, Insert_Result, CLASSEXP ) \
\
explicit CLASSNAME( size_type hint = 100, hasher hf = hasher(), \
key_equal eq = key_equal() ) \
: CLASSNAME##_wxImplementation_HashTable( hint, hf, eq, \
CLASSNAME##_wxImplementation_KeyEx() ) {} \
\
Insert_Result insert( const key_type& key ) \
{ \
bool created; \
Node *node = GetOrCreateNode( key, created ); \
return Insert_Result( iterator( node, this ), created ); \
} \
\
const_iterator find( const const_key_type& key ) const \
{ \
return const_iterator( GetNode( key ), this ); \
} \
\
iterator find( const const_key_type& key ) \
{ \
return iterator( GetNode( key ), this ); \
} \
\
size_type erase( const key_type& k ) \
{ return CLASSNAME##_wxImplementation_HashTable::erase( k ); } \
void erase( const iterator& it ) { erase( *it ); } \
void erase( const const_iterator& it ) { erase( *it ); } \
\
/* count() == 0 | 1 */ \
size_type count( const const_key_type& key ) const \
{ return GetNode( key ) ? 1 : 0; } \
}
#endif // STL/wx implementations
// these macros are to be used in the user code
#define WX_DECLARE_HASH_SET( KEY_T, HASH_T, KEY_EQ_T, CLASSNAME) \
_WX_DECLARE_HASH_SET( KEY_T, HASH_T, KEY_EQ_T, wxPTROP_NORMAL, CLASSNAME, class )
// and these do exactly the same thing but should be used inside the
// library
#define WX_DECLARE_HASH_SET_WITH_DECL( KEY_T, HASH_T, KEY_EQ_T, CLASSNAME, DECL) \
_WX_DECLARE_HASH_SET( KEY_T, HASH_T, KEY_EQ_T, wxPTROP_NORMAL, CLASSNAME, DECL )
#define WX_DECLARE_EXPORTED_HASH_SET( KEY_T, HASH_T, KEY_EQ_T, CLASSNAME) \
WX_DECLARE_HASH_SET_WITH_DECL( KEY_T, HASH_T, KEY_EQ_T, \
CLASSNAME, class WXDLLIMPEXP_CORE )
// Finally these versions allow to define hash sets of non-objects (including
// pointers, hence the confusing but wxArray-compatible name) without
// operator->() which can't be used for them. This is mostly used inside the
// library itself to avoid warnings when using such hash sets with some less
// common compilers (notably Sun CC).
#define WX_DECLARE_HASH_SET_PTR( KEY_T, HASH_T, KEY_EQ_T, CLASSNAME) \
_WX_DECLARE_HASH_SET( KEY_T, HASH_T, KEY_EQ_T, wxPTROP_NOP, CLASSNAME, class )
#define WX_DECLARE_HASH_SET_WITH_DECL_PTR( KEY_T, HASH_T, KEY_EQ_T, CLASSNAME, DECL) \
_WX_DECLARE_HASH_SET( KEY_T, HASH_T, KEY_EQ_T, wxPTROP_NOP, CLASSNAME, DECL )
// delete all hash elements
//
// NB: the class declaration of the hash elements must be visible from the
// place where you use this macro, otherwise the proper destructor may not
// be called (a decent compiler should give a warning about it, but don't
// count on it)!
#define WX_CLEAR_HASH_SET(type, hashset) \
{ \
type::iterator it, en; \
for( it = (hashset).begin(), en = (hashset).end(); it != en; ++it ) \
delete *it; \
(hashset).clear(); \
}
#endif // _WX_HASHSET_H_
| h |
rticonnextdds-usecases | data/projects/rticonnextdds-usecases/VehicleTracking/ExampleCode/thirdparty/wxWidgets-3.1.2/Linux/include/wx/imagpcx.h | /////////////////////////////////////////////////////////////////////////////
// Name: wx/imagpcx.h
// Purpose: wxImage PCX handler
// Author: Guillermo Rodriguez Garcia <[email protected]>
// Copyright: (c) 1999 Guillermo Rodriguez Garcia
// Licence: wxWindows licence
/////////////////////////////////////////////////////////////////////////////
#ifndef _WX_IMAGPCX_H_
#define _WX_IMAGPCX_H_
#include "wx/image.h"
//-----------------------------------------------------------------------------
// wxPCXHandler
//-----------------------------------------------------------------------------
#if wxUSE_PCX
class WXDLLIMPEXP_CORE wxPCXHandler : public wxImageHandler
{
public:
inline wxPCXHandler()
{
m_name = wxT("PCX file");
m_extension = wxT("pcx");
m_type = wxBITMAP_TYPE_PCX;
m_mime = wxT("image/pcx");
}
#if wxUSE_STREAMS
virtual bool LoadFile( wxImage *image, wxInputStream& stream, bool verbose=true, int index=-1 ) wxOVERRIDE;
virtual bool SaveFile( wxImage *image, wxOutputStream& stream, bool verbose=true ) wxOVERRIDE;
protected:
virtual bool DoCanRead( wxInputStream& stream ) wxOVERRIDE;
#endif // wxUSE_STREAMS
private:
wxDECLARE_DYNAMIC_CLASS(wxPCXHandler);
};
#endif // wxUSE_PCX
#endif
// _WX_IMAGPCX_H_
| h |
rticonnextdds-usecases | data/projects/rticonnextdds-usecases/VehicleTracking/ExampleCode/thirdparty/wxWidgets-3.1.2/Linux/include/wx/dateevt.h | ///////////////////////////////////////////////////////////////////////////////
// Name: wx/dateevt.h
// Purpose: declares wxDateEvent class
// Author: Vadim Zeitlin
// Modified by:
// Created: 2005-01-10
// Copyright: (c) 2005 Vadim Zeitlin <[email protected]>
// Licence: wxWindows licence
///////////////////////////////////////////////////////////////////////////////
#ifndef _WX_DATEEVT_H_
#define _WX_DATEEVT_H_
#include "wx/event.h"
#include "wx/datetime.h"
#include "wx/window.h"
// ----------------------------------------------------------------------------
// wxDateEvent: used by wxCalendarCtrl, wxDatePickerCtrl and wxTimePickerCtrl.
// ----------------------------------------------------------------------------
class WXDLLIMPEXP_ADV wxDateEvent : public wxCommandEvent
{
public:
wxDateEvent() { }
wxDateEvent(wxWindow *win, const wxDateTime& dt, wxEventType type)
: wxCommandEvent(type, win->GetId()),
m_date(dt)
{
SetEventObject(win);
}
const wxDateTime& GetDate() const { return m_date; }
void SetDate(const wxDateTime &date) { m_date = date; }
// default copy ctor, assignment operator and dtor are ok
virtual wxEvent *Clone() const wxOVERRIDE { return new wxDateEvent(*this); }
private:
wxDateTime m_date;
wxDECLARE_DYNAMIC_CLASS_NO_ASSIGN(wxDateEvent);
};
// ----------------------------------------------------------------------------
// event types and macros for handling them
// ----------------------------------------------------------------------------
wxDECLARE_EXPORTED_EVENT(WXDLLIMPEXP_ADV, wxEVT_DATE_CHANGED, wxDateEvent);
wxDECLARE_EXPORTED_EVENT(WXDLLIMPEXP_ADV, wxEVT_TIME_CHANGED, wxDateEvent);
typedef void (wxEvtHandler::*wxDateEventFunction)(wxDateEvent&);
#define wxDateEventHandler(func) \
wxEVENT_HANDLER_CAST(wxDateEventFunction, func)
#define EVT_DATE_CHANGED(id, fn) \
wx__DECLARE_EVT1(wxEVT_DATE_CHANGED, id, wxDateEventHandler(fn))
#define EVT_TIME_CHANGED(id, fn) \
wx__DECLARE_EVT1(wxEVT_TIME_CHANGED, id, wxDateEventHandler(fn))
#endif // _WX_DATEEVT_H_
| h |
rticonnextdds-usecases | data/projects/rticonnextdds-usecases/VehicleTracking/ExampleCode/thirdparty/wxWidgets-3.1.2/Linux/include/wx/sstream.h | ///////////////////////////////////////////////////////////////////////////////
// Name: wx/sstream.h
// Purpose: string-based streams
// Author: Vadim Zeitlin
// Modified by:
// Created: 2004-09-19
// Copyright: (c) 2004 Vadim Zeitlin <[email protected]>
// Licence: wxWindows licence
///////////////////////////////////////////////////////////////////////////////
#ifndef _WX_SSTREAM_H_
#define _WX_SSTREAM_H_
#include "wx/stream.h"
#if wxUSE_STREAMS
// ----------------------------------------------------------------------------
// wxStringInputStream is a stream reading from the given (fixed size) string
// ----------------------------------------------------------------------------
class WXDLLIMPEXP_BASE wxStringInputStream : public wxInputStream
{
public:
// ctor associates the stream with the given string which makes a copy of
// it
wxStringInputStream(const wxString& s);
virtual wxFileOffset GetLength() const wxOVERRIDE;
virtual bool IsSeekable() const wxOVERRIDE { return true; }
protected:
virtual wxFileOffset OnSysSeek(wxFileOffset ofs, wxSeekMode mode) wxOVERRIDE;
virtual wxFileOffset OnSysTell() const wxOVERRIDE;
virtual size_t OnSysRead(void *buffer, size_t size) wxOVERRIDE;
private:
// the string that was passed in the ctor
wxString m_str;
// the buffer we're reading from
wxCharBuffer m_buf;
// length of the buffer we're reading from
size_t m_len;
// position in the stream in bytes, *not* in chars
size_t m_pos;
wxDECLARE_NO_COPY_CLASS(wxStringInputStream);
};
// ----------------------------------------------------------------------------
// wxStringOutputStream writes data to the given string, expanding it as needed
// ----------------------------------------------------------------------------
class WXDLLIMPEXP_BASE wxStringOutputStream : public wxOutputStream
{
public:
// The stream will write data either to the provided string or to an
// internal string which can be retrieved using GetString()
//
// Note that the conversion object should have the life time greater than
// this stream.
explicit wxStringOutputStream(wxString *pString = NULL,
wxMBConv& conv = wxConvUTF8);
// get the string containing current output
const wxString& GetString() const { return *m_str; }
virtual bool IsSeekable() const wxOVERRIDE { return true; }
protected:
virtual wxFileOffset OnSysTell() const wxOVERRIDE;
virtual size_t OnSysWrite(const void *buffer, size_t size) wxOVERRIDE;
private:
// internal string, not used if caller provided his own string
wxString m_strInternal;
// pointer given by the caller or just pointer to m_strInternal
wxString *m_str;
// position in the stream in bytes, *not* in chars
size_t m_pos;
// converter to use: notice that with the default UTF-8 one the input
// stream must contain valid UTF-8 data, use wxConvISO8859_1 to work with
// arbitrary 8 bit data
wxMBConv& m_conv;
#if wxUSE_UNICODE
// unconverted data from the last call to OnSysWrite()
wxMemoryBuffer m_unconv;
#endif // wxUSE_UNICODE
wxDECLARE_NO_COPY_CLASS(wxStringOutputStream);
};
#endif // wxUSE_STREAMS
#endif // _WX_SSTREAM_H_
| h |
rticonnextdds-usecases | data/projects/rticonnextdds-usecases/VehicleTracking/ExampleCode/thirdparty/wxWidgets-3.1.2/Linux/include/wx/bookctrl.h | ///////////////////////////////////////////////////////////////////////////////
// Name: wx/bookctrl.h
// Purpose: wxBookCtrlBase: common base class for wxList/Tree/Notebook
// Author: Vadim Zeitlin
// Modified by:
// Created: 19.08.03
// Copyright: (c) 2003 Vadim Zeitlin <[email protected]>
// Licence: wxWindows licence
///////////////////////////////////////////////////////////////////////////////
#ifndef _WX_BOOKCTRL_H_
#define _WX_BOOKCTRL_H_
// ----------------------------------------------------------------------------
// headers
// ----------------------------------------------------------------------------
#include "wx/defs.h"
#if wxUSE_BOOKCTRL
#include "wx/control.h"
#include "wx/vector.h"
#include "wx/withimages.h"
class WXDLLIMPEXP_FWD_CORE wxImageList;
class WXDLLIMPEXP_FWD_CORE wxBookCtrlEvent;
// ----------------------------------------------------------------------------
// constants
// ----------------------------------------------------------------------------
// wxBookCtrl hit results
enum
{
wxBK_HITTEST_NOWHERE = 1, // not on tab
wxBK_HITTEST_ONICON = 2, // on icon
wxBK_HITTEST_ONLABEL = 4, // on label
wxBK_HITTEST_ONITEM = 16, // on tab control but not on its icon or label
wxBK_HITTEST_ONPAGE = 8 // not on tab control, but over the selected page
};
// wxBookCtrl flags (common for wxNotebook, wxListbook, wxChoicebook, wxTreebook)
#define wxBK_DEFAULT 0x0000
#define wxBK_TOP 0x0010
#define wxBK_BOTTOM 0x0020
#define wxBK_LEFT 0x0040
#define wxBK_RIGHT 0x0080
#define wxBK_ALIGN_MASK (wxBK_TOP | wxBK_BOTTOM | wxBK_LEFT | wxBK_RIGHT)
// ----------------------------------------------------------------------------
// wxBookCtrlBase
// ----------------------------------------------------------------------------
class WXDLLIMPEXP_CORE wxBookCtrlBase : public wxControl,
public wxWithImages
{
public:
// construction
// ------------
wxBookCtrlBase()
{
Init();
}
wxBookCtrlBase(wxWindow *parent,
wxWindowID winid,
const wxPoint& pos = wxDefaultPosition,
const wxSize& size = wxDefaultSize,
long style = 0,
const wxString& name = wxEmptyString)
{
Init();
(void)Create(parent, winid, pos, size, style, name);
}
// quasi ctor
bool Create(wxWindow *parent,
wxWindowID winid,
const wxPoint& pos = wxDefaultPosition,
const wxSize& size = wxDefaultSize,
long style = 0,
const wxString& name = wxEmptyString);
// accessors
// ---------
// get number of pages in the dialog
virtual size_t GetPageCount() const { return m_pages.size(); }
// get the panel which represents the given page
virtual wxWindow *GetPage(size_t n) const { return m_pages.at(n); }
// get the current page or NULL if none
wxWindow *GetCurrentPage() const
{
const int n = GetSelection();
return n == wxNOT_FOUND ? NULL : GetPage(n);
}
// get the currently selected page or wxNOT_FOUND if none
virtual int GetSelection() const { return m_selection; }
// set/get the title of a page
virtual bool SetPageText(size_t n, const wxString& strText) = 0;
virtual wxString GetPageText(size_t n) const = 0;
// image list stuff: each page may have an image associated with it (all
// images belong to the same image list)
// ---------------------------------------------------------------------
// sets/returns item's image index in the current image list
virtual int GetPageImage(size_t n) const = 0;
virtual bool SetPageImage(size_t n, int imageId) = 0;
// geometry
// --------
// resize the notebook so that all pages will have the specified size
virtual void SetPageSize(const wxSize& size);
// return the size of the area needed to accommodate the controller
wxSize GetControllerSize() const;
// calculate the size of the control from the size of its page
//
// by default this simply returns size enough to fit both the page and the
// controller
virtual wxSize CalcSizeFromPage(const wxSize& sizePage) const;
// get/set size of area between book control area and page area
unsigned int GetInternalBorder() const { return m_internalBorder; }
void SetInternalBorder(unsigned int border) { m_internalBorder = border; }
// Sets/gets the margin around the controller
void SetControlMargin(int margin) { m_controlMargin = margin; }
int GetControlMargin() const { return m_controlMargin; }
// returns true if we have wxBK_TOP or wxBK_BOTTOM style
bool IsVertical() const { return HasFlag(wxBK_BOTTOM | wxBK_TOP); }
// set/get option to shrink to fit current page
void SetFitToCurrentPage(bool fit) { m_fitToCurrentPage = fit; }
bool GetFitToCurrentPage() const { return m_fitToCurrentPage; }
// returns the sizer containing the control, if any
wxSizer* GetControlSizer() const { return m_controlSizer; }
// operations
// ----------
// remove one page from the control and delete it
virtual bool DeletePage(size_t n);
// remove one page from the notebook, without deleting it
virtual bool RemovePage(size_t n)
{
DoInvalidateBestSize();
return DoRemovePage(n) != NULL;
}
// remove all pages and delete them
virtual bool DeleteAllPages()
{
m_selection = wxNOT_FOUND;
DoInvalidateBestSize();
WX_CLEAR_ARRAY(m_pages);
return true;
}
// adds a new page to the control
virtual bool AddPage(wxWindow *page,
const wxString& text,
bool bSelect = false,
int imageId = NO_IMAGE)
{
DoInvalidateBestSize();
return InsertPage(GetPageCount(), page, text, bSelect, imageId);
}
// the same as AddPage(), but adds the page at the specified position
virtual bool InsertPage(size_t n,
wxWindow *page,
const wxString& text,
bool bSelect = false,
int imageId = NO_IMAGE) = 0;
// set the currently selected page, return the index of the previously
// selected one (or wxNOT_FOUND on error)
//
// NB: this function will generate PAGE_CHANGING/ED events
virtual int SetSelection(size_t n) = 0;
// acts as SetSelection but does not generate events
virtual int ChangeSelection(size_t n) = 0;
// cycle thru the pages
void AdvanceSelection(bool forward = true)
{
int nPage = GetNextPage(forward);
if ( nPage != wxNOT_FOUND )
{
// cast is safe because of the check above
SetSelection((size_t)nPage);
}
}
// return the index of the given page or wxNOT_FOUND
int FindPage(const wxWindow* page) const;
// hit test: returns which page is hit and, optionally, where (icon, label)
virtual int HitTest(const wxPoint& WXUNUSED(pt),
long * WXUNUSED(flags) = NULL) const
{
return wxNOT_FOUND;
}
// we do have multiple pages
virtual bool HasMultiplePages() const wxOVERRIDE { return true; }
// returns true if the platform should explicitly apply a theme border
virtual bool CanApplyThemeBorder() const wxOVERRIDE { return false; }
protected:
// flags for DoSetSelection()
enum
{
SetSelection_SendEvent = 1
};
// choose the default border for this window
virtual wxBorder GetDefaultBorder() const wxOVERRIDE { return wxBORDER_NONE; }
// After the insertion of the page in the method InsertPage, calling this
// method sets the selection to the given page or the first one if there is
// still no selection. The "selection changed" event is sent only if
// bSelect is true, so when it is false, no event is sent even if the
// selection changed from wxNOT_FOUND to 0 when inserting the first page.
//
// Returns true if the selection was set to the specified page (explicitly
// because of bSelect == true or implicitly because it's the first page) or
// false otherwise.
bool DoSetSelectionAfterInsertion(size_t n, bool bSelect);
// Update the selection after removing the page at the given index,
// typically called from the derived class overridden DoRemovePage().
void DoSetSelectionAfterRemoval(size_t n);
// set the selection to the given page, sending the events (which can
// possibly prevent the page change from taking place) if SendEvent flag is
// included
virtual int DoSetSelection(size_t nPage, int flags = 0);
// if the derived class uses DoSetSelection() for implementing
// [Set|Change]Selection, it must override UpdateSelectedPage(),
// CreatePageChangingEvent() and MakeChangedEvent(), but as it might not
// use it, these functions are not pure virtual
// called to notify the control about a new current page
virtual void UpdateSelectedPage(size_t WXUNUSED(newsel))
{ wxFAIL_MSG(wxT("Override this function!")); }
// create a new "page changing" event
virtual wxBookCtrlEvent* CreatePageChangingEvent() const
{ wxFAIL_MSG(wxT("Override this function!")); return NULL; }
// modify the event created by CreatePageChangingEvent() to "page changed"
// event, usually by just calling SetEventType() on it
virtual void MakeChangedEvent(wxBookCtrlEvent& WXUNUSED(event))
{ wxFAIL_MSG(wxT("Override this function!")); }
// The derived class also may override the following method, also called
// from DoSetSelection(), to show/hide pages differently.
virtual void DoShowPage(wxWindow* page, bool show) { page->Show(show); }
// Should we accept NULL page pointers in Add/InsertPage()?
//
// Default is no but derived classes may override it if they can treat NULL
// pages in some sensible way (e.g. wxTreebook overrides this to allow
// having nodes without any associated page)
virtual bool AllowNullPage() const { return false; }
// For classes that allow null pages, we also need a way to find the
// closest non-NULL page corresponding to the given index, e.g. the first
// leaf item in wxTreebook tree and this method must be overridden to
// return it if AllowNullPage() is overridden. Note that it can still
// return null if there are no valid pages after this one.
virtual wxWindow *TryGetNonNullPage(size_t page) { return m_pages[page]; }
// Remove the page and return a pointer to it.
//
// It also needs to update the current selection if necessary, i.e. if the
// page being removed comes before the selected one and the helper method
// DoSetSelectionAfterRemoval() can be used for this.
virtual wxWindow *DoRemovePage(size_t page) = 0;
// our best size is the size which fits all our pages
virtual wxSize DoGetBestSize() const wxOVERRIDE;
// helper: get the next page wrapping if we reached the end
int GetNextPage(bool forward) const;
// Lay out controls
virtual void DoSize();
// It is better to make this control transparent so that by default the controls on
// its pages are on the same colour background as the rest of the window. If the user
// prefers a coloured background they can set the background colour on the page panel
virtual bool HasTransparentBackground() wxOVERRIDE { return true; }
// This method also invalidates the size of the controller and should be
// called instead of just InvalidateBestSize() whenever pages are added or
// removed as this also affects the controller
void DoInvalidateBestSize();
#if wxUSE_HELP
// Show the help for the corresponding page
void OnHelp(wxHelpEvent& event);
#endif // wxUSE_HELP
// the array of all pages of this control
wxVector<wxWindow*> m_pages;
// get the page area
virtual wxRect GetPageRect() const;
// event handlers
void OnSize(wxSizeEvent& event);
// controller buddy if available, NULL otherwise (usually for native book controls like wxNotebook)
wxControl *m_bookctrl;
// Whether to shrink to fit current page
bool m_fitToCurrentPage;
// the sizer containing the choice control
wxSizer *m_controlSizer;
// the margin around the choice control
int m_controlMargin;
// The currently selected page (in range 0..m_pages.size()-1 inclusive) or
// wxNOT_FOUND if none (this can normally only be the case for an empty
// control without any pages).
int m_selection;
private:
// common part of all ctors
void Init();
// internal border
unsigned int m_internalBorder;
wxDECLARE_ABSTRACT_CLASS(wxBookCtrlBase);
wxDECLARE_NO_COPY_CLASS(wxBookCtrlBase);
wxDECLARE_EVENT_TABLE();
};
// ----------------------------------------------------------------------------
// wxBookCtrlEvent: page changing events generated by book classes
// ----------------------------------------------------------------------------
class WXDLLIMPEXP_CORE wxBookCtrlEvent : public wxNotifyEvent
{
public:
wxBookCtrlEvent(wxEventType commandType = wxEVT_NULL, int winid = 0,
int nSel = wxNOT_FOUND, int nOldSel = wxNOT_FOUND)
: wxNotifyEvent(commandType, winid)
{
m_nSel = nSel;
m_nOldSel = nOldSel;
}
wxBookCtrlEvent(const wxBookCtrlEvent& event)
: wxNotifyEvent(event)
{
m_nSel = event.m_nSel;
m_nOldSel = event.m_nOldSel;
}
virtual wxEvent *Clone() const wxOVERRIDE { return new wxBookCtrlEvent(*this); }
// accessors
// the currently selected page (wxNOT_FOUND if none)
int GetSelection() const { return m_nSel; }
void SetSelection(int nSel) { m_nSel = nSel; }
// the page that was selected before the change (wxNOT_FOUND if none)
int GetOldSelection() const { return m_nOldSel; }
void SetOldSelection(int nOldSel) { m_nOldSel = nOldSel; }
private:
int m_nSel, // currently selected page
m_nOldSel; // previously selected page
wxDECLARE_DYNAMIC_CLASS_NO_ASSIGN(wxBookCtrlEvent);
};
typedef void (wxEvtHandler::*wxBookCtrlEventFunction)(wxBookCtrlEvent&);
#define wxBookCtrlEventHandler(func) \
wxEVENT_HANDLER_CAST(wxBookCtrlEventFunction, func)
// obsolete name, defined for compatibility only
#define wxBookCtrlBaseEvent wxBookCtrlEvent
// make a default book control for given platform
#if wxUSE_NOTEBOOK
// dedicated to majority of desktops
#include "wx/notebook.h"
#define wxBookCtrl wxNotebook
#define wxEVT_BOOKCTRL_PAGE_CHANGED wxEVT_NOTEBOOK_PAGE_CHANGED
#define wxEVT_BOOKCTRL_PAGE_CHANGING wxEVT_NOTEBOOK_PAGE_CHANGING
#define EVT_BOOKCTRL_PAGE_CHANGED(id, fn) EVT_NOTEBOOK_PAGE_CHANGED(id, fn)
#define EVT_BOOKCTRL_PAGE_CHANGING(id, fn) EVT_NOTEBOOK_PAGE_CHANGING(id, fn)
#else
// dedicated to Smartphones
#include "wx/choicebk.h"
#define wxBookCtrl wxChoicebook
#define wxEVT_BOOKCTRL_PAGE_CHANGED wxEVT_CHOICEBOOK_PAGE_CHANGED
#define wxEVT_BOOKCTRL_PAGE_CHANGING wxEVT_CHOICEBOOK_PAGE_CHANGING
#define EVT_BOOKCTRL_PAGE_CHANGED(id, fn) EVT_CHOICEBOOK_PAGE_CHANGED(id, fn)
#define EVT_BOOKCTRL_PAGE_CHANGING(id, fn) EVT_CHOICEBOOK_PAGE_CHANGING(id, fn)
#endif
// old wxEVT_COMMAND_* constants
#define wxEVT_COMMAND_BOOKCTRL_PAGE_CHANGED wxEVT_BOOKCTRL_PAGE_CHANGED
#define wxEVT_COMMAND_BOOKCTRL_PAGE_CHANGING wxEVT_BOOKCTRL_PAGE_CHANGING
#endif // wxUSE_BOOKCTRL
#endif // _WX_BOOKCTRL_H_
| h |
rticonnextdds-usecases | data/projects/rticonnextdds-usecases/VehicleTracking/ExampleCode/thirdparty/wxWidgets-3.1.2/Linux/include/wx/toolbar.h | /////////////////////////////////////////////////////////////////////////////
// Name: wx/toolbar.h
// Purpose: wxToolBar interface declaration
// Author: Vadim Zeitlin
// Modified by:
// Created: 20.11.99
// Copyright: (c) Vadim Zeitlin
// Licence: wxWindows licence
/////////////////////////////////////////////////////////////////////////////
#ifndef _WX_TOOLBAR_H_BASE_
#define _WX_TOOLBAR_H_BASE_
#include "wx/defs.h"
// ----------------------------------------------------------------------------
// wxToolBar style flags
// ----------------------------------------------------------------------------
enum
{
// lay out the toolbar horizontally
wxTB_HORIZONTAL = wxHORIZONTAL, // == 0x0004
wxTB_TOP = wxTB_HORIZONTAL,
// lay out the toolbar vertically
wxTB_VERTICAL = wxVERTICAL, // == 0x0008
wxTB_LEFT = wxTB_VERTICAL,
// "flat" buttons (Win32/GTK only)
wxTB_FLAT = 0x0020,
// dockable toolbar (GTK only)
wxTB_DOCKABLE = 0x0040,
// don't show the icons (they're shown by default)
wxTB_NOICONS = 0x0080,
// show the text (not shown by default)
wxTB_TEXT = 0x0100,
// don't show the divider between toolbar and the window (Win32 only)
wxTB_NODIVIDER = 0x0200,
// no automatic alignment (Win32 only, useless)
wxTB_NOALIGN = 0x0400,
// show the text and the icons alongside, not vertically stacked (Win32/GTK)
wxTB_HORZ_LAYOUT = 0x0800,
wxTB_HORZ_TEXT = wxTB_HORZ_LAYOUT | wxTB_TEXT,
// don't show the toolbar short help tooltips
wxTB_NO_TOOLTIPS = 0x1000,
// lay out toolbar at the bottom of the window
wxTB_BOTTOM = 0x2000,
// lay out toolbar at the right edge of the window
wxTB_RIGHT = 0x4000,
wxTB_DEFAULT_STYLE = wxTB_HORIZONTAL
};
#if wxUSE_TOOLBAR
#include "wx/tbarbase.h" // the base class for all toolbars
#if defined(__WXUNIVERSAL__)
#include "wx/univ/toolbar.h"
#elif defined(__WXMSW__)
#include "wx/msw/toolbar.h"
#elif defined(__WXMOTIF__)
#include "wx/motif/toolbar.h"
#elif defined(__WXGTK20__)
#include "wx/gtk/toolbar.h"
#elif defined(__WXGTK__)
#include "wx/gtk1/toolbar.h"
#elif defined(__WXMAC__)
#include "wx/osx/toolbar.h"
#elif defined(__WXQT__)
#include "wx/qt/toolbar.h"
#endif
#endif // wxUSE_TOOLBAR
#endif
// _WX_TOOLBAR_H_BASE_
| h |
rticonnextdds-usecases | data/projects/rticonnextdds-usecases/VehicleTracking/ExampleCode/thirdparty/wxWidgets-3.1.2/Linux/include/wx/dynload.h | /////////////////////////////////////////////////////////////////////////////
// Name: wx/dynload.h
// Purpose: Dynamic loading framework
// Author: Ron Lee, David Falkinder, Vadim Zeitlin and a cast of 1000's
// (derived in part from dynlib.cpp (c) 1998 Guilhem Lavaux)
// Modified by:
// Created: 03/12/01
// Copyright: (c) 2001 Ron Lee <[email protected]>
// Licence: wxWindows licence
/////////////////////////////////////////////////////////////////////////////
#ifndef _WX_DYNAMICLOADER_H__
#define _WX_DYNAMICLOADER_H__
// ----------------------------------------------------------------------------
// headers
// ----------------------------------------------------------------------------
#include "wx/defs.h"
#if wxUSE_DYNAMIC_LOADER
#include "wx/dynlib.h"
#include "wx/hashmap.h"
#include "wx/module.h"
class WXDLLIMPEXP_FWD_BASE wxPluginLibrary;
WX_DECLARE_STRING_HASH_MAP_WITH_DECL(wxPluginLibrary *, wxDLManifest,
class WXDLLIMPEXP_BASE);
typedef wxDLManifest wxDLImports;
// ---------------------------------------------------------------------------
// wxPluginLibrary
// ---------------------------------------------------------------------------
// NOTE: Do not attempt to use a base class pointer to this class.
// wxDL is not virtual and we deliberately hide some of it's
// methods here.
//
// Unless you know exacty why you need to, you probably shouldn't
// instantiate this class directly anyway, use wxPluginManager
// instead.
class WXDLLIMPEXP_BASE wxPluginLibrary : public wxDynamicLibrary
{
public:
static wxDLImports* ms_classes; // Static hash of all imported classes.
wxPluginLibrary( const wxString &libname, int flags = wxDL_DEFAULT );
~wxPluginLibrary();
wxPluginLibrary *RefLib();
bool UnrefLib();
// These two are called by the PluginSentinel on (PLUGGABLE) object
// creation/destruction. There is usually no reason for the user to
// call them directly. We have to separate this from the link count,
// since the two are not interchangeable.
// FIXME: for even better debugging PluginSentinel should register
// the name of the class created too, then we can state
// exactly which object was not destroyed which may be
// difficult to find otherwise. Also this code should
// probably only be active in DEBUG mode, but let's just
// get it right first.
void RefObj() { ++m_objcount; }
void UnrefObj()
{
wxASSERT_MSG( m_objcount > 0, wxT("Too many objects deleted??") );
--m_objcount;
}
// Override/hide some base class methods
bool IsLoaded() const { return m_linkcount > 0; }
void Unload() { UnrefLib(); }
private:
// These pointers may be NULL but if they are not, then m_ourLast follows
// m_ourFirst in the linked list, i.e. can be found by calling GetNext() a
// sufficient number of times.
const wxClassInfo *m_ourFirst; // first class info in this plugin
const wxClassInfo *m_ourLast; // ..and the last one
size_t m_linkcount; // Ref count of library link calls
size_t m_objcount; // ..and (pluggable) object instantiations.
wxModuleList m_wxmodules; // any wxModules that we initialised.
void UpdateClasses(); // Update ms_classes
void RestoreClasses(); // Removes this library from ms_classes
void RegisterModules(); // Init any wxModules in the lib.
void UnregisterModules(); // Cleanup any wxModules we installed.
wxDECLARE_NO_COPY_CLASS(wxPluginLibrary);
};
class WXDLLIMPEXP_BASE wxPluginManager
{
public:
// Static accessors.
static wxPluginLibrary *LoadLibrary( const wxString &libname,
int flags = wxDL_DEFAULT );
static bool UnloadLibrary(const wxString &libname);
// Instance methods.
wxPluginManager() : m_entry(NULL) {}
wxPluginManager(const wxString &libname, int flags = wxDL_DEFAULT)
{
Load(libname, flags);
}
~wxPluginManager() { if ( IsLoaded() ) Unload(); }
bool Load(const wxString &libname, int flags = wxDL_DEFAULT);
void Unload();
bool IsLoaded() const { return m_entry && m_entry->IsLoaded(); }
void *GetSymbol(const wxString &symbol, bool *success = 0)
{
return m_entry->GetSymbol( symbol, success );
}
static void CreateManifest() { ms_manifest = new wxDLManifest(wxKEY_STRING); }
static void ClearManifest() { delete ms_manifest; ms_manifest = NULL; }
private:
// return the pointer to the entry for the library with given name in
// ms_manifest or NULL if none
static wxPluginLibrary *FindByName(const wxString& name)
{
const wxDLManifest::iterator i = ms_manifest->find(name);
return i == ms_manifest->end() ? NULL : i->second;
}
static wxDLManifest* ms_manifest; // Static hash of loaded libs.
wxPluginLibrary* m_entry; // Cache our entry in the manifest.
// We could allow this class to be copied if we really
// wanted to, but not without modification.
wxDECLARE_NO_COPY_CLASS(wxPluginManager);
};
#endif // wxUSE_DYNAMIC_LOADER
#endif // _WX_DYNAMICLOADER_H__
| h |
rticonnextdds-usecases | data/projects/rticonnextdds-usecases/VehicleTracking/ExampleCode/thirdparty/wxWidgets-3.1.2/Linux/include/wx/wxcrt.h | ///////////////////////////////////////////////////////////////////////////////
// Name: wx/wxcrt.h
// Purpose: Type-safe ANSI and Unicode builds compatible wrappers for
// CRT functions
// Author: Joel Farley, Ove Kaaven
// Modified by: Vadim Zeitlin, Robert Roebling, Ron Lee, Vaclav Slavik
// Created: 1998/06/12
// Copyright: (c) 1998-2006 wxWidgets dev team
// Licence: wxWindows licence
///////////////////////////////////////////////////////////////////////////////
#ifndef _WX_WXCRT_H_
#define _WX_WXCRT_H_
#include "wx/wxcrtbase.h"
#include "wx/string.h"
#ifndef __WX_SETUP_H__
// For non-configure builds assume vsscanf is available, if not Visual C
#if !defined (__VISUALC__)
#define HAVE_VSSCANF 1
#endif
#endif
// ============================================================================
// misc functions
// ============================================================================
/* checks whether the passed in pointer is NULL and if the string is empty */
inline bool wxIsEmpty(const char *s) { return !s || !*s; }
inline bool wxIsEmpty(const wchar_t *s) { return !s || !*s; }
inline bool wxIsEmpty(const wxScopedCharBuffer& s) { return wxIsEmpty(s.data()); }
inline bool wxIsEmpty(const wxScopedWCharBuffer& s) { return wxIsEmpty(s.data()); }
inline bool wxIsEmpty(const wxString& s) { return s.empty(); }
inline bool wxIsEmpty(const wxCStrData& s) { return s.AsString().empty(); }
/* multibyte to wide char conversion functions and macros */
/* multibyte<->widechar conversion */
WXDLLIMPEXP_BASE size_t wxMB2WC(wchar_t *buf, const char *psz, size_t n);
WXDLLIMPEXP_BASE size_t wxWC2MB(char *buf, const wchar_t *psz, size_t n);
#if wxUSE_UNICODE
#define wxMB2WX wxMB2WC
#define wxWX2MB wxWC2MB
#define wxWC2WX wxStrncpy
#define wxWX2WC wxStrncpy
#else
#define wxMB2WX wxStrncpy
#define wxWX2MB wxStrncpy
#define wxWC2WX wxWC2MB
#define wxWX2WC wxMB2WC
#endif
// RN: We could do the usual tricky compiler detection here,
// and use their variant (such as wmemchr, etc.). The problem
// is that these functions are quite rare, even though they are
// part of the current POSIX standard. In addition, most compilers
// (including even MSC) inline them just like we do right in their
// headers.
//
#include <string.h>
#if wxUSE_UNICODE
//implement our own wmem variants
inline wxChar* wxTmemchr(const wxChar* s, wxChar c, size_t l)
{
for(;l && *s != c;--l, ++s) {}
if(l)
return const_cast<wxChar*>(s);
return NULL;
}
inline int wxTmemcmp(const wxChar* sz1, const wxChar* sz2, size_t len)
{
for(; *sz1 == *sz2 && len; --len, ++sz1, ++sz2) {}
if(len)
return *sz1 < *sz2 ? -1 : *sz1 > *sz2;
else
return 0;
}
inline wxChar* wxTmemcpy(wxChar* szOut, const wxChar* szIn, size_t len)
{
return (wxChar*) memcpy(szOut, szIn, len * sizeof(wxChar));
}
inline wxChar* wxTmemmove(wxChar* szOut, const wxChar* szIn, size_t len)
{
return (wxChar*) memmove(szOut, szIn, len * sizeof(wxChar));
}
inline wxChar* wxTmemset(wxChar* szOut, wxChar cIn, size_t len)
{
wxChar* szRet = szOut;
while (len--)
*szOut++ = cIn;
return szRet;
}
#endif /* wxUSE_UNICODE */
// provide trivial wrappers for char* versions for both ANSI and Unicode builds
// (notice that these intentionally return "char *" and not "void *" unlike the
// standard memxxx() for symmetry with the wide char versions):
inline char* wxTmemchr(const char* s, char c, size_t len)
{ return (char*)memchr(s, c, len); }
inline int wxTmemcmp(const char* sz1, const char* sz2, size_t len)
{ return memcmp(sz1, sz2, len); }
inline char* wxTmemcpy(char* szOut, const char* szIn, size_t len)
{ return (char*)memcpy(szOut, szIn, len); }
inline char* wxTmemmove(char* szOut, const char* szIn, size_t len)
{ return (char*)memmove(szOut, szIn, len); }
inline char* wxTmemset(char* szOut, char cIn, size_t len)
{ return (char*)memset(szOut, cIn, len); }
// ============================================================================
// wx wrappers for CRT functions in both char* and wchar_t* versions
// ============================================================================
// A few notes on implementation of these wrappers:
//
// We need both char* and wchar_t* versions of functions like wxStrlen() for
// compatibility with both ANSI and Unicode builds.
//
// This makes passing wxString or c_str()/mb_str()/wc_str() result to them
// ambiguous, so we need to provide overrides for that as well (in cases where
// it makes sense).
//
// We can do this without problems for some functions (wxStrlen()), but in some
// cases, we can't stay compatible with both ANSI and Unicode builds, e.g. for
// wxStrcpy(const wxString&), which can only return either char* or wchar_t*.
// In these cases, we preserve ANSI build compatibility by returning char*.
// ----------------------------------------------------------------------------
// locale functions
// ----------------------------------------------------------------------------
// NB: we can't provide const wchar_t* (= wxChar*) overload, because calling
// wxSetlocale(category, NULL) -- which is a common thing to do -- would be
// ambiguous
WXDLLIMPEXP_BASE char* wxSetlocale(int category, const char *locale);
inline char* wxSetlocale(int category, const wxScopedCharBuffer& locale)
{ return wxSetlocale(category, locale.data()); }
inline char* wxSetlocale(int category, const wxString& locale)
{ return wxSetlocale(category, locale.mb_str()); }
inline char* wxSetlocale(int category, const wxCStrData& locale)
{ return wxSetlocale(category, locale.AsCharBuf()); }
// ----------------------------------------------------------------------------
// string functions
// ----------------------------------------------------------------------------
/* safe version of strlen() (returns 0 if passed NULL pointer) */
// NB: these are defined in wxcrtbase.h, see the comment there
// inline size_t wxStrlen(const char *s) { return s ? strlen(s) : 0; }
// inline size_t wxStrlen(const wchar_t *s) { return s ? wxCRT_Strlen_(s) : 0; }
inline size_t wxStrlen(const wxScopedCharBuffer& s) { return wxStrlen(s.data()); }
inline size_t wxStrlen(const wxScopedWCharBuffer& s) { return wxStrlen(s.data()); }
inline size_t wxStrlen(const wxString& s) { return s.length(); }
inline size_t wxStrlen(const wxCStrData& s) { return s.AsString().length(); }
// this is a function new in 2.9 so we don't care about backwards compatibility and
// so don't need to support wxScopedCharBuffer/wxScopedWCharBuffer overloads
#if defined(wxCRT_StrnlenA)
inline size_t wxStrnlen(const char *str, size_t maxlen) { return wxCRT_StrnlenA(str, maxlen); }
#else
inline size_t wxStrnlen(const char *str, size_t maxlen)
{
size_t n;
for ( n = 0; n < maxlen; n++ )
if ( !str[n] )
break;
return n;
}
#endif
#if defined(wxCRT_StrnlenW)
inline size_t wxStrnlen(const wchar_t *str, size_t maxlen) { return wxCRT_StrnlenW(str, maxlen); }
#else
inline size_t wxStrnlen(const wchar_t *str, size_t maxlen)
{
size_t n;
for ( n = 0; n < maxlen; n++ )
if ( !str[n] )
break;
return n;
}
#endif
// NB: these are defined in wxcrtbase.h, see the comment there
// inline char* wxStrdup(const char *s) { return wxStrdupA(s); }
// inline wchar_t* wxStrdup(const wchar_t *s) { return wxStrdupW(s); }
inline char* wxStrdup(const wxScopedCharBuffer& s) { return wxStrdup(s.data()); }
inline wchar_t* wxStrdup(const wxScopedWCharBuffer& s) { return wxStrdup(s.data()); }
inline char* wxStrdup(const wxString& s) { return wxStrdup(s.mb_str()); }
inline char* wxStrdup(const wxCStrData& s) { return wxStrdup(s.AsCharBuf()); }
inline char *wxStrcpy(char *dest, const char *src)
{ return wxCRT_StrcpyA(dest, src); }
inline wchar_t *wxStrcpy(wchar_t *dest, const wchar_t *src)
{ return wxCRT_StrcpyW(dest, src); }
inline char *wxStrcpy(char *dest, const wxString& src)
{ return wxCRT_StrcpyA(dest, src.mb_str()); }
inline char *wxStrcpy(char *dest, const wxCStrData& src)
{ return wxCRT_StrcpyA(dest, src.AsCharBuf()); }
inline char *wxStrcpy(char *dest, const wxScopedCharBuffer& src)
{ return wxCRT_StrcpyA(dest, src.data()); }
inline wchar_t *wxStrcpy(wchar_t *dest, const wxString& src)
{ return wxCRT_StrcpyW(dest, src.wc_str()); }
inline wchar_t *wxStrcpy(wchar_t *dest, const wxCStrData& src)
{ return wxCRT_StrcpyW(dest, src.AsWCharBuf()); }
inline wchar_t *wxStrcpy(wchar_t *dest, const wxScopedWCharBuffer& src)
{ return wxCRT_StrcpyW(dest, src.data()); }
inline char *wxStrcpy(char *dest, const wchar_t *src)
{ return wxCRT_StrcpyA(dest, wxConvLibc.cWC2MB(src)); }
inline wchar_t *wxStrcpy(wchar_t *dest, const char *src)
{ return wxCRT_StrcpyW(dest, wxConvLibc.cMB2WC(src)); }
inline char *wxStrncpy(char *dest, const char *src, size_t n)
{ return wxCRT_StrncpyA(dest, src, n); }
inline wchar_t *wxStrncpy(wchar_t *dest, const wchar_t *src, size_t n)
{ return wxCRT_StrncpyW(dest, src, n); }
inline char *wxStrncpy(char *dest, const wxString& src, size_t n)
{ return wxCRT_StrncpyA(dest, src.mb_str(), n); }
inline char *wxStrncpy(char *dest, const wxCStrData& src, size_t n)
{ return wxCRT_StrncpyA(dest, src.AsCharBuf(), n); }
inline char *wxStrncpy(char *dest, const wxScopedCharBuffer& src, size_t n)
{ return wxCRT_StrncpyA(dest, src.data(), n); }
inline wchar_t *wxStrncpy(wchar_t *dest, const wxString& src, size_t n)
{ return wxCRT_StrncpyW(dest, src.wc_str(), n); }
inline wchar_t *wxStrncpy(wchar_t *dest, const wxCStrData& src, size_t n)
{ return wxCRT_StrncpyW(dest, src.AsWCharBuf(), n); }
inline wchar_t *wxStrncpy(wchar_t *dest, const wxScopedWCharBuffer& src, size_t n)
{ return wxCRT_StrncpyW(dest, src.data(), n); }
inline char *wxStrncpy(char *dest, const wchar_t *src, size_t n)
{ return wxCRT_StrncpyA(dest, wxConvLibc.cWC2MB(src), n); }
inline wchar_t *wxStrncpy(wchar_t *dest, const char *src, size_t n)
{ return wxCRT_StrncpyW(dest, wxConvLibc.cMB2WC(src), n); }
// this is a function new in 2.9 so we don't care about backwards compatibility and
// so don't need to support wchar_t/char overloads
inline size_t wxStrlcpy(char *dest, const char *src, size_t n)
{
const size_t len = wxCRT_StrlenA(src);
if ( n )
{
if ( n-- > len )
n = len;
memcpy(dest, src, n);
dest[n] = '\0';
}
return len;
}
inline size_t wxStrlcpy(wchar_t *dest, const wchar_t *src, size_t n)
{
const size_t len = wxCRT_StrlenW(src);
if ( n )
{
if ( n-- > len )
n = len;
memcpy(dest, src, n * sizeof(wchar_t));
dest[n] = L'\0';
}
return len;
}
inline char *wxStrcat(char *dest, const char *src)
{ return wxCRT_StrcatA(dest, src); }
inline wchar_t *wxStrcat(wchar_t *dest, const wchar_t *src)
{ return wxCRT_StrcatW(dest, src); }
inline char *wxStrcat(char *dest, const wxString& src)
{ return wxCRT_StrcatA(dest, src.mb_str()); }
inline char *wxStrcat(char *dest, const wxCStrData& src)
{ return wxCRT_StrcatA(dest, src.AsCharBuf()); }
inline char *wxStrcat(char *dest, const wxScopedCharBuffer& src)
{ return wxCRT_StrcatA(dest, src.data()); }
inline wchar_t *wxStrcat(wchar_t *dest, const wxString& src)
{ return wxCRT_StrcatW(dest, src.wc_str()); }
inline wchar_t *wxStrcat(wchar_t *dest, const wxCStrData& src)
{ return wxCRT_StrcatW(dest, src.AsWCharBuf()); }
inline wchar_t *wxStrcat(wchar_t *dest, const wxScopedWCharBuffer& src)
{ return wxCRT_StrcatW(dest, src.data()); }
inline char *wxStrcat(char *dest, const wchar_t *src)
{ return wxCRT_StrcatA(dest, wxConvLibc.cWC2MB(src)); }
inline wchar_t *wxStrcat(wchar_t *dest, const char *src)
{ return wxCRT_StrcatW(dest, wxConvLibc.cMB2WC(src)); }
inline char *wxStrncat(char *dest, const char *src, size_t n)
{ return wxCRT_StrncatA(dest, src, n); }
inline wchar_t *wxStrncat(wchar_t *dest, const wchar_t *src, size_t n)
{ return wxCRT_StrncatW(dest, src, n); }
inline char *wxStrncat(char *dest, const wxString& src, size_t n)
{ return wxCRT_StrncatA(dest, src.mb_str(), n); }
inline char *wxStrncat(char *dest, const wxCStrData& src, size_t n)
{ return wxCRT_StrncatA(dest, src.AsCharBuf(), n); }
inline char *wxStrncat(char *dest, const wxScopedCharBuffer& src, size_t n)
{ return wxCRT_StrncatA(dest, src.data(), n); }
inline wchar_t *wxStrncat(wchar_t *dest, const wxString& src, size_t n)
{ return wxCRT_StrncatW(dest, src.wc_str(), n); }
inline wchar_t *wxStrncat(wchar_t *dest, const wxCStrData& src, size_t n)
{ return wxCRT_StrncatW(dest, src.AsWCharBuf(), n); }
inline wchar_t *wxStrncat(wchar_t *dest, const wxScopedWCharBuffer& src, size_t n)
{ return wxCRT_StrncatW(dest, src.data(), n); }
inline char *wxStrncat(char *dest, const wchar_t *src, size_t n)
{ return wxCRT_StrncatA(dest, wxConvLibc.cWC2MB(src), n); }
inline wchar_t *wxStrncat(wchar_t *dest, const char *src, size_t n)
{ return wxCRT_StrncatW(dest, wxConvLibc.cMB2WC(src), n); }
#define WX_STR_DECL(name, T1, T2) name(T1 s1, T2 s2)
#define WX_STR_CALL(func, a1, a2) func(a1, a2)
// This macro defines string function for all possible variants of arguments,
// except for those taking wxString or wxCStrData as second argument.
// Parameters:
// rettype - return type
// name - name of the (overloaded) function to define
// crtA - function to call for char* versions (takes two arguments)
// crtW - ditto for wchar_t* function
// forString - function to call when the *first* argument is wxString;
// the second argument can be any string type, so this is
// typically a template
#define WX_STR_FUNC_NO_INVERT(rettype, name, crtA, crtW, forString) \
inline rettype WX_STR_DECL(name, const char *, const char *) \
{ return WX_STR_CALL(crtA, s1, s2); } \
inline rettype WX_STR_DECL(name, const char *, const wchar_t *) \
{ return WX_STR_CALL(forString, wxString(s1), wxString(s2)); } \
inline rettype WX_STR_DECL(name, const char *, const wxScopedCharBuffer&) \
{ return WX_STR_CALL(crtA, s1, s2.data()); } \
inline rettype WX_STR_DECL(name, const char *, const wxScopedWCharBuffer&) \
{ return WX_STR_CALL(forString, wxString(s1), s2.data()); } \
\
inline rettype WX_STR_DECL(name, const wchar_t *, const wchar_t *) \
{ return WX_STR_CALL(crtW, s1, s2); } \
inline rettype WX_STR_DECL(name, const wchar_t *, const char *) \
{ return WX_STR_CALL(forString, wxString(s1), wxString(s2)); } \
inline rettype WX_STR_DECL(name, const wchar_t *, const wxScopedWCharBuffer&) \
{ return WX_STR_CALL(crtW, s1, s2.data()); } \
inline rettype WX_STR_DECL(name, const wchar_t *, const wxScopedCharBuffer&) \
{ return WX_STR_CALL(forString, wxString(s1), s2.data()); } \
\
inline rettype WX_STR_DECL(name, const wxScopedCharBuffer&, const char *) \
{ return WX_STR_CALL(crtA, s1.data(), s2); } \
inline rettype WX_STR_DECL(name, const wxScopedCharBuffer&, const wchar_t *) \
{ return WX_STR_CALL(forString, wxString(s1), wxString(s2)); } \
inline rettype WX_STR_DECL(name, const wxScopedCharBuffer&, const wxScopedCharBuffer&)\
{ return WX_STR_CALL(crtA, s1.data(), s2.data()); } \
inline rettype WX_STR_DECL(name, const wxScopedCharBuffer&, const wxScopedWCharBuffer&) \
{ return WX_STR_CALL(forString, wxString(s1), wxString(s2)); } \
\
inline rettype WX_STR_DECL(name, const wxScopedWCharBuffer&, const wchar_t *) \
{ return WX_STR_CALL(crtW, s1.data(), s2); } \
inline rettype WX_STR_DECL(name, const wxScopedWCharBuffer&, const char *) \
{ return WX_STR_CALL(forString, wxString(s1), wxString(s2)); } \
inline rettype WX_STR_DECL(name, const wxScopedWCharBuffer&, const wxScopedWCharBuffer&) \
{ return WX_STR_CALL(crtW, s1.data(), s2.data()); } \
inline rettype WX_STR_DECL(name, const wxScopedWCharBuffer&, const wxScopedCharBuffer&) \
{ return WX_STR_CALL(forString, wxString(s1), wxString(s2)); } \
\
inline rettype WX_STR_DECL(name, const wxString&, const char*) \
{ return WX_STR_CALL(forString, s1, s2); } \
inline rettype WX_STR_DECL(name, const wxString&, const wchar_t*) \
{ return WX_STR_CALL(forString, s1, s2); } \
inline rettype WX_STR_DECL(name, const wxString&, const wxScopedCharBuffer&) \
{ return WX_STR_CALL(forString, s1, s2); } \
inline rettype WX_STR_DECL(name, const wxString&, const wxScopedWCharBuffer&) \
{ return WX_STR_CALL(forString, s1, s2); } \
inline rettype WX_STR_DECL(name, const wxString&, const wxString&) \
{ return WX_STR_CALL(forString, s1, s2); } \
inline rettype WX_STR_DECL(name, const wxString&, const wxCStrData&) \
{ return WX_STR_CALL(forString, s1, s2); } \
\
inline rettype WX_STR_DECL(name, const wxCStrData&, const char*) \
{ return WX_STR_CALL(forString, s1.AsString(), s2); } \
inline rettype WX_STR_DECL(name, const wxCStrData&, const wchar_t*) \
{ return WX_STR_CALL(forString, s1.AsString(), s2); } \
inline rettype WX_STR_DECL(name, const wxCStrData&, const wxScopedCharBuffer&) \
{ return WX_STR_CALL(forString, s1.AsString(), s2); } \
inline rettype WX_STR_DECL(name, const wxCStrData&, const wxScopedWCharBuffer&) \
{ return WX_STR_CALL(forString, s1.AsString(), s2); } \
inline rettype WX_STR_DECL(name, const wxCStrData&, const wxString&) \
{ return WX_STR_CALL(forString, s1.AsString(), s2); } \
inline rettype WX_STR_DECL(name, const wxCStrData&, const wxCStrData&) \
{ return WX_STR_CALL(forString, s1.AsString(), s2); }
// This defines strcmp-like function, i.e. one returning the result of
// comparison; see WX_STR_FUNC_NO_INVERT for explanation of the arguments
#define WX_STRCMP_FUNC(name, crtA, crtW, forString) \
WX_STR_FUNC_NO_INVERT(int, name, crtA, crtW, forString) \
\
inline int WX_STR_DECL(name, const char *, const wxCStrData&) \
{ return -WX_STR_CALL(forString, s2.AsString(), s1); } \
inline int WX_STR_DECL(name, const char *, const wxString&) \
{ return -WX_STR_CALL(forString, s2, s1); } \
\
inline int WX_STR_DECL(name, const wchar_t *, const wxCStrData&) \
{ return -WX_STR_CALL(forString, s2.AsString(), s1); } \
inline int WX_STR_DECL(name, const wchar_t *, const wxString&) \
{ return -WX_STR_CALL(forString, s2, s1); } \
\
inline int WX_STR_DECL(name, const wxScopedCharBuffer&, const wxCStrData&) \
{ return -WX_STR_CALL(forString, s2.AsString(), s1.data()); } \
inline int WX_STR_DECL(name, const wxScopedCharBuffer&, const wxString&) \
{ return -WX_STR_CALL(forString, s2, s1.data()); } \
\
inline int WX_STR_DECL(name, const wxScopedWCharBuffer&, const wxCStrData&) \
{ return -WX_STR_CALL(forString, s2.AsString(), s1.data()); } \
inline int WX_STR_DECL(name, const wxScopedWCharBuffer&, const wxString&) \
{ return -WX_STR_CALL(forString, s2, s1.data()); }
// This defines a string function that is *not* strcmp-like, i.e. doesn't
// return the result of comparison and so if the second argument is a string,
// it has to be converted to char* or wchar_t*
#define WX_STR_FUNC(rettype, name, crtA, crtW, forString) \
WX_STR_FUNC_NO_INVERT(rettype, name, crtA, crtW, forString) \
\
inline rettype WX_STR_DECL(name, const char *, const wxCStrData&) \
{ return WX_STR_CALL(crtA, s1, s2.AsCharBuf()); } \
inline rettype WX_STR_DECL(name, const char *, const wxString&) \
{ return WX_STR_CALL(crtA, s1, s2.mb_str()); } \
\
inline rettype WX_STR_DECL(name, const wchar_t *, const wxCStrData&) \
{ return WX_STR_CALL(crtW, s1, s2.AsWCharBuf()); } \
inline rettype WX_STR_DECL(name, const wchar_t *, const wxString&) \
{ return WX_STR_CALL(crtW, s1, s2.wc_str()); } \
\
inline rettype WX_STR_DECL(name, const wxScopedCharBuffer&, const wxCStrData&) \
{ return WX_STR_CALL(crtA, s1.data(), s2.AsCharBuf()); } \
inline rettype WX_STR_DECL(name, const wxScopedCharBuffer&, const wxString&) \
{ return WX_STR_CALL(crtA, s1.data(), s2.mb_str()); } \
\
inline rettype WX_STR_DECL(name, const wxScopedWCharBuffer&, const wxCStrData&) \
{ return WX_STR_CALL(crtW, s1.data(), s2.AsWCharBuf()); } \
inline rettype WX_STR_DECL(name, const wxScopedWCharBuffer&, const wxString&) \
{ return WX_STR_CALL(crtW, s1.data(), s2.wc_str()); }
template<typename T>
inline int wxStrcmp_String(const wxString& s1, const T& s2)
{ return s1.compare(s2); }
WX_STRCMP_FUNC(wxStrcmp, wxCRT_StrcmpA, wxCRT_StrcmpW, wxStrcmp_String)
template<typename T>
inline int wxStricmp_String(const wxString& s1, const T& s2)
{ return s1.CmpNoCase(s2); }
WX_STRCMP_FUNC(wxStricmp, wxCRT_StricmpA, wxCRT_StricmpW, wxStricmp_String)
#if defined(wxCRT_StrcollA) && defined(wxCRT_StrcollW)
// GCC 3.4 and other compilers have a bug that causes it to fail compilation if
// the template's implementation uses overloaded function declared later (see
// the wxStrcoll() call in wxStrcoll_String<T>()), so we have to
// forward-declare the template and implement it below WX_STRCMP_FUNC. OTOH,
// this causes problems with GCC visibility in newer GCC versions.
#if !(wxCHECK_GCC_VERSION(3,5) && !wxCHECK_GCC_VERSION(4,7)) || defined(__clang__)
#define wxNEEDS_DECL_BEFORE_TEMPLATE
#endif
#ifdef wxNEEDS_DECL_BEFORE_TEMPLATE
template<typename T>
inline int wxStrcoll_String(const wxString& s1, const T& s2);
WX_STRCMP_FUNC(wxStrcoll, wxCRT_StrcollA, wxCRT_StrcollW, wxStrcoll_String)
#endif // wxNEEDS_DECL_BEFORE_TEMPLATE
template<typename T>
inline int wxStrcoll_String(const wxString& s1, const T& s2)
{
#if wxUSE_UNICODE
// NB: strcoll() doesn't work correctly on UTF-8 strings, so we have to use
// wc_str() even if wxUSE_UNICODE_UTF8; the (const wchar_t*) cast is
// there just as optimization to avoid going through
// wxStrcoll<wxScopedWCharBuffer>:
return wxStrcoll((const wchar_t*)s1.wc_str(), s2);
#else
return wxStrcoll((const char*)s1.mb_str(), s2);
#endif
}
#ifndef wxNEEDS_DECL_BEFORE_TEMPLATE
// this is exactly the same WX_STRCMP_FUNC line as above, insde the
// wxNEEDS_DECL_BEFORE_TEMPLATE case
WX_STRCMP_FUNC(wxStrcoll, wxCRT_StrcollA, wxCRT_StrcollW, wxStrcoll_String)
#endif
#endif // defined(wxCRT_Strcoll[AW])
template<typename T>
inline size_t wxStrspn_String(const wxString& s1, const T& s2)
{
size_t pos = s1.find_first_not_of(s2);
return pos == wxString::npos ? s1.length() : pos;
}
WX_STR_FUNC(size_t, wxStrspn, wxCRT_StrspnA, wxCRT_StrspnW, wxStrspn_String)
template<typename T>
inline size_t wxStrcspn_String(const wxString& s1, const T& s2)
{
size_t pos = s1.find_first_of(s2);
return pos == wxString::npos ? s1.length() : pos;
}
WX_STR_FUNC(size_t, wxStrcspn, wxCRT_StrcspnA, wxCRT_StrcspnW, wxStrcspn_String)
#undef WX_STR_DECL
#undef WX_STR_CALL
#define WX_STR_DECL(name, T1, T2) name(T1 s1, T2 s2, size_t n)
#define WX_STR_CALL(func, a1, a2) func(a1, a2, n)
template<typename T>
inline int wxStrncmp_String(const wxString& s1, const T& s2, size_t n)
{ return s1.compare(0, n, s2, 0, n); }
WX_STRCMP_FUNC(wxStrncmp, wxCRT_StrncmpA, wxCRT_StrncmpW, wxStrncmp_String)
template<typename T>
inline int wxStrnicmp_String(const wxString& s1, const T& s2, size_t n)
{ return s1.substr(0, n).CmpNoCase(wxString(s2).substr(0, n)); }
WX_STRCMP_FUNC(wxStrnicmp, wxCRT_StrnicmpA, wxCRT_StrnicmpW, wxStrnicmp_String)
#undef WX_STR_DECL
#undef WX_STR_CALL
#undef WX_STRCMP_FUNC
#undef WX_STR_FUNC
#undef WX_STR_FUNC_NO_INVERT
#if defined(wxCRT_StrxfrmA) && defined(wxCRT_StrxfrmW)
inline size_t wxStrxfrm(char *dest, const char *src, size_t n)
{ return wxCRT_StrxfrmA(dest, src, n); }
inline size_t wxStrxfrm(wchar_t *dest, const wchar_t *src, size_t n)
{ return wxCRT_StrxfrmW(dest, src, n); }
template<typename T>
inline size_t wxStrxfrm(T *dest, const wxScopedCharTypeBuffer<T>& src, size_t n)
{ return wxStrxfrm(dest, src.data(), n); }
inline size_t wxStrxfrm(char *dest, const wxString& src, size_t n)
{ return wxCRT_StrxfrmA(dest, src.mb_str(), n); }
inline size_t wxStrxfrm(wchar_t *dest, const wxString& src, size_t n)
{ return wxCRT_StrxfrmW(dest, src.wc_str(), n); }
inline size_t wxStrxfrm(char *dest, const wxCStrData& src, size_t n)
{ return wxCRT_StrxfrmA(dest, src.AsCharBuf(), n); }
inline size_t wxStrxfrm(wchar_t *dest, const wxCStrData& src, size_t n)
{ return wxCRT_StrxfrmW(dest, src.AsWCharBuf(), n); }
#endif // defined(wxCRT_Strxfrm[AW])
inline char *wxStrtok(char *str, const char *delim, char **saveptr)
{ return wxCRT_StrtokA(str, delim, saveptr); }
inline wchar_t *wxStrtok(wchar_t *str, const wchar_t *delim, wchar_t **saveptr)
{ return wxCRT_StrtokW(str, delim, saveptr); }
template<typename T>
inline T *wxStrtok(T *str, const wxScopedCharTypeBuffer<T>& delim, T **saveptr)
{ return wxStrtok(str, delim.data(), saveptr); }
inline char *wxStrtok(char *str, const wxCStrData& delim, char **saveptr)
{ return wxCRT_StrtokA(str, delim.AsCharBuf(), saveptr); }
inline wchar_t *wxStrtok(wchar_t *str, const wxCStrData& delim, wchar_t **saveptr)
{ return wxCRT_StrtokW(str, delim.AsWCharBuf(), saveptr); }
inline char *wxStrtok(char *str, const wxString& delim, char **saveptr)
{ return wxCRT_StrtokA(str, delim.mb_str(), saveptr); }
inline wchar_t *wxStrtok(wchar_t *str, const wxString& delim, wchar_t **saveptr)
{ return wxCRT_StrtokW(str, delim.wc_str(), saveptr); }
inline const char *wxStrstr(const char *haystack, const char *needle)
{ return wxCRT_StrstrA(haystack, needle); }
inline const wchar_t *wxStrstr(const wchar_t *haystack, const wchar_t *needle)
{ return wxCRT_StrstrW(haystack, needle); }
inline const char *wxStrstr(const char *haystack, const wxString& needle)
{ return wxCRT_StrstrA(haystack, needle.mb_str()); }
inline const wchar_t *wxStrstr(const wchar_t *haystack, const wxString& needle)
{ return wxCRT_StrstrW(haystack, needle.wc_str()); }
// these functions return char* pointer into the non-temporary conversion buffer
// used by c_str()'s implicit conversion to char*, for ANSI build compatibility
inline const char *wxStrstr(const wxString& haystack, const wxString& needle)
{ return wxCRT_StrstrA(haystack.c_str(), needle.mb_str()); }
inline const char *wxStrstr(const wxCStrData& haystack, const wxString& needle)
{ return wxCRT_StrstrA(haystack, needle.mb_str()); }
inline const char *wxStrstr(const wxCStrData& haystack, const wxCStrData& needle)
{ return wxCRT_StrstrA(haystack, needle.AsCharBuf()); }
// if 'needle' is char/wchar_t, then the same is probably wanted as return value
inline const char *wxStrstr(const wxString& haystack, const char *needle)
{ return wxCRT_StrstrA(haystack.c_str(), needle); }
inline const char *wxStrstr(const wxCStrData& haystack, const char *needle)
{ return wxCRT_StrstrA(haystack, needle); }
inline const wchar_t *wxStrstr(const wxString& haystack, const wchar_t *needle)
{ return wxCRT_StrstrW(haystack.c_str(), needle); }
inline const wchar_t *wxStrstr(const wxCStrData& haystack, const wchar_t *needle)
{ return wxCRT_StrstrW(haystack, needle); }
inline const char *wxStrchr(const char *s, char c)
{ return wxCRT_StrchrA(s, c); }
inline const wchar_t *wxStrchr(const wchar_t *s, wchar_t c)
{ return wxCRT_StrchrW(s, c); }
inline const char *wxStrrchr(const char *s, char c)
{ return wxCRT_StrrchrA(s, c); }
inline const wchar_t *wxStrrchr(const wchar_t *s, wchar_t c)
{ return wxCRT_StrrchrW(s, c); }
inline const char *wxStrchr(const char *s, const wxUniChar& uc)
{ char c; return uc.GetAsChar(&c) ? wxCRT_StrchrA(s, c) : NULL; }
inline const wchar_t *wxStrchr(const wchar_t *s, const wxUniChar& c)
{ return wxCRT_StrchrW(s, (wchar_t)c); }
inline const char *wxStrrchr(const char *s, const wxUniChar& uc)
{ char c; return uc.GetAsChar(&c) ? wxCRT_StrrchrA(s, c) : NULL; }
inline const wchar_t *wxStrrchr(const wchar_t *s, const wxUniChar& c)
{ return wxCRT_StrrchrW(s, (wchar_t)c); }
inline const char *wxStrchr(const char *s, const wxUniCharRef& uc)
{ char c; return uc.GetAsChar(&c) ? wxCRT_StrchrA(s, c) : NULL; }
inline const wchar_t *wxStrchr(const wchar_t *s, const wxUniCharRef& c)
{ return wxCRT_StrchrW(s, (wchar_t)c); }
inline const char *wxStrrchr(const char *s, const wxUniCharRef& uc)
{ char c; return uc.GetAsChar(&c) ? wxCRT_StrrchrA(s, c) : NULL; }
inline const wchar_t *wxStrrchr(const wchar_t *s, const wxUniCharRef& c)
{ return wxCRT_StrrchrW(s, (wchar_t)c); }
template<typename T>
inline const T* wxStrchr(const wxScopedCharTypeBuffer<T>& s, T c)
{ return wxStrchr(s.data(), c); }
template<typename T>
inline const T* wxStrrchr(const wxScopedCharTypeBuffer<T>& s, T c)
{ return wxStrrchr(s.data(), c); }
template<typename T>
inline const T* wxStrchr(const wxScopedCharTypeBuffer<T>& s, const wxUniChar& c)
{ return wxStrchr(s.data(), (T)c); }
template<typename T>
inline const T* wxStrrchr(const wxScopedCharTypeBuffer<T>& s, const wxUniChar& c)
{ return wxStrrchr(s.data(), (T)c); }
template<typename T>
inline const T* wxStrchr(const wxScopedCharTypeBuffer<T>& s, const wxUniCharRef& c)
{ return wxStrchr(s.data(), (T)c); }
template<typename T>
inline const T* wxStrrchr(const wxScopedCharTypeBuffer<T>& s, const wxUniCharRef& c)
{ return wxStrrchr(s.data(), (T)c); }
// these functions return char* pointer into the non-temporary conversion buffer
// used by c_str()'s implicit conversion to char*, for ANSI build compatibility
inline const char* wxStrchr(const wxString& s, char c)
{ return wxCRT_StrchrA((const char*)s.c_str(), c); }
inline const char* wxStrrchr(const wxString& s, char c)
{ return wxCRT_StrrchrA((const char*)s.c_str(), c); }
inline const char* wxStrchr(const wxString& s, int c)
{ return wxCRT_StrchrA((const char*)s.c_str(), c); }
inline const char* wxStrrchr(const wxString& s, int c)
{ return wxCRT_StrrchrA((const char*)s.c_str(), c); }
inline const char* wxStrchr(const wxString& s, const wxUniChar& uc)
{ char c; return uc.GetAsChar(&c) ? wxCRT_StrchrA(s.c_str(), c) : NULL; }
inline const char* wxStrrchr(const wxString& s, const wxUniChar& uc)
{ char c; return uc.GetAsChar(&c) ? wxCRT_StrrchrA(s.c_str(), c) : NULL; }
inline const char* wxStrchr(const wxString& s, const wxUniCharRef& uc)
{ char c; return uc.GetAsChar(&c) ? wxCRT_StrchrA(s.c_str(), c) : NULL; }
inline const char* wxStrrchr(const wxString& s, const wxUniCharRef& uc)
{ char c; return uc.GetAsChar(&c) ? wxCRT_StrrchrA(s.c_str(), c) : NULL; }
inline const wchar_t* wxStrchr(const wxString& s, wchar_t c)
{ return wxCRT_StrchrW((const wchar_t*)s.c_str(), c); }
inline const wchar_t* wxStrrchr(const wxString& s, wchar_t c)
{ return wxCRT_StrrchrW((const wchar_t*)s.c_str(), c); }
inline const char* wxStrchr(const wxCStrData& s, char c)
{ return wxCRT_StrchrA(s.AsChar(), c); }
inline const char* wxStrrchr(const wxCStrData& s, char c)
{ return wxCRT_StrrchrA(s.AsChar(), c); }
inline const char* wxStrchr(const wxCStrData& s, int c)
{ return wxCRT_StrchrA(s.AsChar(), c); }
inline const char* wxStrrchr(const wxCStrData& s, int c)
{ return wxCRT_StrrchrA(s.AsChar(), c); }
inline const char* wxStrchr(const wxCStrData& s, const wxUniChar& uc)
{ char c; return uc.GetAsChar(&c) ? wxCRT_StrchrA(s, c) : NULL; }
inline const char* wxStrrchr(const wxCStrData& s, const wxUniChar& uc)
{ char c; return uc.GetAsChar(&c) ? wxCRT_StrrchrA(s, c) : NULL; }
inline const char* wxStrchr(const wxCStrData& s, const wxUniCharRef& uc)
{ char c; return uc.GetAsChar(&c) ? wxCRT_StrchrA(s, c) : NULL; }
inline const char* wxStrrchr(const wxCStrData& s, const wxUniCharRef& uc)
{ char c; return uc.GetAsChar(&c) ? wxCRT_StrrchrA(s, c) : NULL; }
inline const wchar_t* wxStrchr(const wxCStrData& s, wchar_t c)
{ return wxCRT_StrchrW(s.AsWChar(), c); }
inline const wchar_t* wxStrrchr(const wxCStrData& s, wchar_t c)
{ return wxCRT_StrrchrW(s.AsWChar(), c); }
inline const char *wxStrpbrk(const char *s, const char *accept)
{ return wxCRT_StrpbrkA(s, accept); }
inline const wchar_t *wxStrpbrk(const wchar_t *s, const wchar_t *accept)
{ return wxCRT_StrpbrkW(s, accept); }
inline const char *wxStrpbrk(const char *s, const wxString& accept)
{ return wxCRT_StrpbrkA(s, accept.mb_str()); }
inline const char *wxStrpbrk(const char *s, const wxCStrData& accept)
{ return wxCRT_StrpbrkA(s, accept.AsCharBuf()); }
inline const wchar_t *wxStrpbrk(const wchar_t *s, const wxString& accept)
{ return wxCRT_StrpbrkW(s, accept.wc_str()); }
inline const wchar_t *wxStrpbrk(const wchar_t *s, const wxCStrData& accept)
{ return wxCRT_StrpbrkW(s, accept.AsWCharBuf()); }
inline const char *wxStrpbrk(const wxString& s, const wxString& accept)
{ return wxCRT_StrpbrkA(s.c_str(), accept.mb_str()); }
inline const char *wxStrpbrk(const wxString& s, const char *accept)
{ return wxCRT_StrpbrkA(s.c_str(), accept); }
inline const wchar_t *wxStrpbrk(const wxString& s, const wchar_t *accept)
{ return wxCRT_StrpbrkW(s.wc_str(), accept); }
inline const char *wxStrpbrk(const wxString& s, const wxCStrData& accept)
{ return wxCRT_StrpbrkA(s.c_str(), accept.AsCharBuf()); }
inline const char *wxStrpbrk(const wxCStrData& s, const wxString& accept)
{ return wxCRT_StrpbrkA(s.AsChar(), accept.mb_str()); }
inline const char *wxStrpbrk(const wxCStrData& s, const char *accept)
{ return wxCRT_StrpbrkA(s.AsChar(), accept); }
inline const wchar_t *wxStrpbrk(const wxCStrData& s, const wchar_t *accept)
{ return wxCRT_StrpbrkW(s.AsWChar(), accept); }
inline const char *wxStrpbrk(const wxCStrData& s, const wxCStrData& accept)
{ return wxCRT_StrpbrkA(s.AsChar(), accept.AsCharBuf()); }
template <typename S, typename T>
inline const T *wxStrpbrk(const S& s, const wxScopedCharTypeBuffer<T>& accept)
{ return wxStrpbrk(s, accept.data()); }
/* inlined non-const versions */
template <typename T>
inline char *wxStrstr(char *haystack, T needle)
{ return const_cast<char*>(wxStrstr(const_cast<const char*>(haystack), needle)); }
template <typename T>
inline wchar_t *wxStrstr(wchar_t *haystack, T needle)
{ return const_cast<wchar_t*>(wxStrstr(const_cast<const wchar_t*>(haystack), needle)); }
template <typename T>
inline char * wxStrchr(char *s, T c)
{ return const_cast<char*>(wxStrchr(const_cast<const char*>(s), c)); }
template <typename T>
inline wchar_t * wxStrchr(wchar_t *s, T c)
{ return (wchar_t *)wxStrchr((const wchar_t *)s, c); }
template <typename T>
inline char * wxStrrchr(char *s, T c)
{ return const_cast<char*>(wxStrrchr(const_cast<const char*>(s), c)); }
template <typename T>
inline wchar_t * wxStrrchr(wchar_t *s, T c)
{ return const_cast<wchar_t*>(wxStrrchr(const_cast<const wchar_t*>(s), c)); }
template <typename T>
inline char * wxStrpbrk(char *s, T accept)
{ return const_cast<char*>(wxStrpbrk(const_cast<const char*>(s), accept)); }
template <typename T>
inline wchar_t * wxStrpbrk(wchar_t *s, T accept)
{ return const_cast<wchar_t*>(wxStrpbrk(const_cast<const wchar_t*>(s), accept)); }
// ----------------------------------------------------------------------------
// stdio.h functions
// ----------------------------------------------------------------------------
// NB: using fn_str() for mode is a hack to get the same type (char*/wchar_t*)
// as needed, the conversion itself doesn't matter, it's ASCII
inline FILE *wxFopen(const wxString& path, const wxString& mode)
{ return wxCRT_Fopen(path.fn_str(), mode.fn_str()); }
inline FILE *wxFreopen(const wxString& path, const wxString& mode, FILE *stream)
{ return wxCRT_Freopen(path.fn_str(), mode.fn_str(), stream); }
inline int wxRemove(const wxString& path)
{ return wxCRT_Remove(path.fn_str()); }
inline int wxRename(const wxString& oldpath, const wxString& newpath)
{ return wxCRT_Rename(oldpath.fn_str(), newpath.fn_str()); }
extern WXDLLIMPEXP_BASE int wxPuts(const wxString& s);
extern WXDLLIMPEXP_BASE int wxFputs(const wxString& s, FILE *stream);
extern WXDLLIMPEXP_BASE void wxPerror(const wxString& s);
extern WXDLLIMPEXP_BASE int wxFputc(const wxUniChar& c, FILE *stream);
#define wxPutc(c, stream) wxFputc(c, stream)
#define wxPutchar(c) wxFputc(c, stdout)
#define wxFputchar(c) wxPutchar(c)
// NB: We only provide ANSI version of fgets() because fgetws() interprets the
// stream according to current locale, which is rarely what is desired.
inline char *wxFgets(char *s, int size, FILE *stream)
{ return wxCRT_FgetsA(s, size, stream); }
// This version calls ANSI version and converts the string using wxConvLibc
extern WXDLLIMPEXP_BASE wchar_t *wxFgets(wchar_t *s, int size, FILE *stream);
#define wxGets(s) wxGets_is_insecure_and_dangerous_use_wxFgets_instead
// NB: We only provide ANSI versions of this for the same reasons as in the
// case of wxFgets() above
inline int wxFgetc(FILE *stream) { return wxCRT_FgetcA(stream); }
inline int wxUngetc(int c, FILE *stream) { return wxCRT_UngetcA(c, stream); }
#define wxGetc(stream) wxFgetc(stream)
#define wxGetchar() wxFgetc(stdin)
#define wxFgetchar() wxGetchar()
// ----------------------------------------------------------------------------
// stdlib.h functions
// ----------------------------------------------------------------------------
#ifdef wxCRT_AtoiW
inline int wxAtoi(const wxString& str) { return wxCRT_AtoiW(str.wc_str()); }
#else
inline int wxAtoi(const wxString& str) { return wxCRT_AtoiA(str.mb_str()); }
#endif
#ifdef wxCRT_AtolW
inline long wxAtol(const wxString& str) { return wxCRT_AtolW(str.wc_str()); }
#else
inline long wxAtol(const wxString& str) { return wxCRT_AtolA(str.mb_str()); }
#endif
#ifdef wxCRT_AtofW
inline double wxAtof(const wxString& str) { return wxCRT_AtofW(str.wc_str()); }
#else
inline double wxAtof(const wxString& str) { return wxCRT_AtofA(str.mb_str()); }
#endif
inline double wxStrtod(const char *nptr, char **endptr)
{ return wxCRT_StrtodA(nptr, endptr); }
inline double wxStrtod(const wchar_t *nptr, wchar_t **endptr)
{ return wxCRT_StrtodW(nptr, endptr); }
template<typename T>
inline double wxStrtod(const wxScopedCharTypeBuffer<T>& nptr, T **endptr)
{ return wxStrtod(nptr.data(), endptr); }
// We implement wxStrto*() like this so that the code compiles when NULL is
// passed in - - if we had just char** and wchar_t** overloads for 'endptr', it
// would be ambiguous. The solution is to use a template so that endptr can be
// any type: when NULL constant is used, the type will be int and we can handle
// that case specially. Otherwise, we infer the type that 'nptr' should be
// converted to from the type of 'endptr'. We need wxStrtoxCharType<T> template
// to make the code compile even for T=int (that's the case when it's not going
// to be ever used, but it still has to compile).
template<typename T> struct wxStrtoxCharType {};
template<> struct wxStrtoxCharType<char**>
{
typedef const char* Type;
static char** AsPointer(char **p) { return p; }
};
template<> struct wxStrtoxCharType<wchar_t**>
{
typedef const wchar_t* Type;
static wchar_t** AsPointer(wchar_t **p) { return p; }
};
template<> struct wxStrtoxCharType<int>
{
typedef const char* Type; /* this one is never used */
static char** AsPointer(int WXUNUSED_UNLESS_DEBUG(p))
{
wxASSERT_MSG( p == 0, "passing non-NULL int is invalid" );
return NULL;
}
};
template<typename T>
inline double wxStrtod(const wxString& nptr, T endptr)
{
if ( endptr == 0 )
{
// when we don't care about endptr, use the string representation that
// doesn't require any conversion (it doesn't matter for this function
// even if its UTF-8):
return wxStrtod(nptr.wx_str(), (wxStringCharType**)NULL);
}
else
{
// note that it is important to use c_str() here and not mb_str() or
// wc_str(), because we store the pointer into (possibly converted)
// buffer in endptr and so it must be valid even when wxStrtod() returns
typedef typename wxStrtoxCharType<T>::Type CharType;
return wxStrtod((CharType)nptr.c_str(),
wxStrtoxCharType<T>::AsPointer(endptr));
}
}
template<typename T>
inline double wxStrtod(const wxCStrData& nptr, T endptr)
{ return wxStrtod(nptr.AsString(), endptr); }
#define WX_STRTOX_FUNC(rettype, name, implA, implW) \
/* see wxStrtod() above for explanation of this code: */ \
inline rettype name(const char *nptr, char **endptr, int base) \
{ return implA(nptr, endptr, base); } \
inline rettype name(const wchar_t *nptr, wchar_t **endptr, int base) \
{ return implW(nptr, endptr, base); } \
template<typename T> \
inline rettype name(const wxScopedCharTypeBuffer<T>& nptr, T **endptr, int)\
{ return name(nptr.data(), endptr); } \
template<typename T> \
inline rettype name(const wxString& nptr, T endptr, int base) \
{ \
if ( endptr == 0 ) \
return name(nptr.wx_str(), (wxStringCharType**)NULL, base); \
else \
{ \
typedef typename wxStrtoxCharType<T>::Type CharType; \
return name((CharType)nptr.c_str(), \
wxStrtoxCharType<T>::AsPointer(endptr), \
base); \
} \
} \
template<typename T> \
inline rettype name(const wxCStrData& nptr, T endptr, int base) \
{ return name(nptr.AsString(), endptr, base); }
WX_STRTOX_FUNC(long, wxStrtol, wxCRT_StrtolA, wxCRT_StrtolW)
WX_STRTOX_FUNC(unsigned long, wxStrtoul, wxCRT_StrtoulA, wxCRT_StrtoulW)
#ifdef wxLongLong_t
WX_STRTOX_FUNC(wxLongLong_t, wxStrtoll, wxCRT_StrtollA, wxCRT_StrtollW)
WX_STRTOX_FUNC(wxULongLong_t, wxStrtoull, wxCRT_StrtoullA, wxCRT_StrtoullW)
#endif // wxLongLong_t
#undef WX_STRTOX_FUNC
// ios doesn't export system starting from iOS 11 anymore and usage was critical before
#if defined(__WXOSX__) && wxOSX_USE_IPHONE
#else
// mingw32 doesn't provide _tsystem() even though it provides other stdlib.h
// functions in their wide versions
#ifdef wxCRT_SystemW
inline int wxSystem(const wxString& str) { return wxCRT_SystemW(str.wc_str()); }
#else
inline int wxSystem(const wxString& str) { return wxCRT_SystemA(str.mb_str()); }
#endif
#endif
inline char* wxGetenv(const char *name) { return wxCRT_GetenvA(name); }
inline wchar_t* wxGetenv(const wchar_t *name) { return wxCRT_GetenvW(name); }
inline char* wxGetenv(const wxString& name) { return wxCRT_GetenvA(name.mb_str()); }
inline char* wxGetenv(const wxCStrData& name) { return wxCRT_GetenvA(name.AsCharBuf()); }
inline char* wxGetenv(const wxScopedCharBuffer& name) { return wxCRT_GetenvA(name.data()); }
inline wchar_t* wxGetenv(const wxScopedWCharBuffer& name) { return wxCRT_GetenvW(name.data()); }
// ----------------------------------------------------------------------------
// time.h functions
// ----------------------------------------------------------------------------
inline size_t wxStrftime(char *s, size_t max,
const wxString& format, const struct tm *tm)
{ return wxCRT_StrftimeA(s, max, format.mb_str(), tm); }
inline size_t wxStrftime(wchar_t *s, size_t max,
const wxString& format, const struct tm *tm)
{ return wxCRT_StrftimeW(s, max, format.wc_str(), tm); }
// NB: we can't provide both char* and wchar_t* versions for obvious reasons
// and returning wxString wouldn't work either (it would be immediately
// destroyed and if assigned to char*/wchar_t*, the pointer would be
// invalid), so we only keep ASCII version, because the returned value
// is always ASCII anyway
#define wxAsctime asctime
#define wxCtime ctime
// ----------------------------------------------------------------------------
// ctype.h functions
// ----------------------------------------------------------------------------
// FIXME-UTF8: we'd be better off implementing these ourselves, as the CRT
// version is locale-dependent
// FIXME-UTF8: these don't work when EOF is passed in because of wxUniChar,
// is this OK or not?
inline bool wxIsalnum(const wxUniChar& c) { return wxCRT_IsalnumW(c) != 0; }
inline bool wxIsalpha(const wxUniChar& c) { return wxCRT_IsalphaW(c) != 0; }
inline bool wxIscntrl(const wxUniChar& c) { return wxCRT_IscntrlW(c) != 0; }
inline bool wxIsdigit(const wxUniChar& c) { return wxCRT_IsdigitW(c) != 0; }
inline bool wxIsgraph(const wxUniChar& c) { return wxCRT_IsgraphW(c) != 0; }
inline bool wxIslower(const wxUniChar& c) { return wxCRT_IslowerW(c) != 0; }
inline bool wxIsprint(const wxUniChar& c) { return wxCRT_IsprintW(c) != 0; }
inline bool wxIspunct(const wxUniChar& c) { return wxCRT_IspunctW(c) != 0; }
inline bool wxIsspace(const wxUniChar& c) { return wxCRT_IsspaceW(c) != 0; }
inline bool wxIsupper(const wxUniChar& c) { return wxCRT_IsupperW(c) != 0; }
inline bool wxIsxdigit(const wxUniChar& c) { return wxCRT_IsxdigitW(c) != 0; }
inline wxUniChar wxTolower(const wxUniChar& c) { return wxCRT_TolowerW(c); }
inline wxUniChar wxToupper(const wxUniChar& c) { return wxCRT_ToupperW(c); }
#if WXWIN_COMPATIBILITY_2_8
// we had goofed and defined wxIsctrl() instead of (correct) wxIscntrl() in the
// initial versions of this header -- now it is too late to remove it so
// although we fixed the function/macro name above, still provide the
// backwards-compatible synonym.
wxDEPRECATED( inline int wxIsctrl(const wxUniChar& c) );
inline int wxIsctrl(const wxUniChar& c) { return wxIscntrl(c); }
#endif // WXWIN_COMPATIBILITY_2_8
inline bool wxIsascii(const wxUniChar& c) { return c.IsAscii(); }
#endif /* _WX_WXCRT_H_ */
| h |
rticonnextdds-usecases | data/projects/rticonnextdds-usecases/VehicleTracking/ExampleCode/thirdparty/wxWidgets-3.1.2/Linux/include/wx/gauge.h | ///////////////////////////////////////////////////////////////////////////////
// Name: wx/gauge.h
// Purpose: wxGauge interface
// Author: Vadim Zeitlin
// Modified by:
// Created: 20.02.01
// Copyright: (c) 1996-2001 wxWidgets team
// Licence: wxWindows licence
///////////////////////////////////////////////////////////////////////////////
#ifndef _WX_GAUGE_H_BASE_
#define _WX_GAUGE_H_BASE_
#include "wx/defs.h"
#if wxUSE_GAUGE
#include "wx/control.h"
// ----------------------------------------------------------------------------
// wxGauge style flags
// ----------------------------------------------------------------------------
#define wxGA_HORIZONTAL wxHORIZONTAL
#define wxGA_VERTICAL wxVERTICAL
// Available since Windows 7 only. With this style, the value of guage will
// reflect on the taskbar button.
#define wxGA_PROGRESS 0x0010
// Win32 only, is default (and only) on some other platforms
#define wxGA_SMOOTH 0x0020
// QT only, display current completed percentage (text default format "%p%")
#define wxGA_TEXT 0x0040
// GTK and Mac always have native implementation of the indeterminate mode
// wxMSW has native implementation only if comctl32.dll >= 6.00
#if !defined(__WXGTK20__) && !defined(__WXMAC__)
#define wxGAUGE_EMULATE_INDETERMINATE_MODE 1
#else
#define wxGAUGE_EMULATE_INDETERMINATE_MODE 0
#endif
extern WXDLLIMPEXP_DATA_CORE(const char) wxGaugeNameStr[];
class WXDLLIMPEXP_FWD_CORE wxAppProgressIndicator;
// ----------------------------------------------------------------------------
// wxGauge: a progress bar
// ----------------------------------------------------------------------------
class WXDLLIMPEXP_CORE wxGaugeBase : public wxControl
{
public:
wxGaugeBase() : m_rangeMax(0), m_gaugePos(0),
m_appProgressIndicator(NULL) { }
virtual ~wxGaugeBase();
bool Create(wxWindow *parent,
wxWindowID id,
int range,
const wxPoint& pos = wxDefaultPosition,
const wxSize& size = wxDefaultSize,
long style = wxGA_HORIZONTAL,
const wxValidator& validator = wxDefaultValidator,
const wxString& name = wxGaugeNameStr);
// determinate mode API
// set/get the control range
virtual void SetRange(int range);
virtual int GetRange() const;
virtual void SetValue(int pos);
virtual int GetValue() const;
// indeterminate mode API
virtual void Pulse();
// simple accessors
bool IsVertical() const { return HasFlag(wxGA_VERTICAL); }
// overridden base class virtuals
virtual bool AcceptsFocus() const wxOVERRIDE { return false; }
// Deprecated methods not doing anything since a long time.
wxDEPRECATED_MSG("Remove calls to this method, it doesn't do anything")
void SetShadowWidth(int WXUNUSED(w)) { }
wxDEPRECATED_MSG("Remove calls to this method, it always returns 0")
int GetShadowWidth() const { return 0; }
wxDEPRECATED_MSG("Remove calls to this method, it doesn't do anything")
void SetBezelFace(int WXUNUSED(w)) { }
wxDEPRECATED_MSG("Remove calls to this method, it always returns 0")
int GetBezelFace() const { return 0; }
protected:
virtual wxBorder GetDefaultBorder() const wxOVERRIDE { return wxBORDER_NONE; }
// Initialize m_appProgressIndicator if necessary, i.e. if this object has
// wxGA_PROGRESS style. This method is supposed to be called from the
// derived class Create() if it doesn't call the base class Create(), which
// already does it, after initializing the window style and range.
void InitProgressIndicatorIfNeeded();
// the max position
int m_rangeMax;
// the current position
int m_gaugePos;
#if wxGAUGE_EMULATE_INDETERMINATE_MODE
int m_nDirection; // can be wxRIGHT or wxLEFT
#endif
wxAppProgressIndicator *m_appProgressIndicator;
wxDECLARE_NO_COPY_CLASS(wxGaugeBase);
};
#if defined(__WXUNIVERSAL__)
#include "wx/univ/gauge.h"
#elif defined(__WXMSW__)
#include "wx/msw/gauge.h"
#elif defined(__WXMOTIF__)
#include "wx/motif/gauge.h"
#elif defined(__WXGTK20__)
#include "wx/gtk/gauge.h"
#elif defined(__WXGTK__)
#include "wx/gtk1/gauge.h"
#elif defined(__WXMAC__)
#include "wx/osx/gauge.h"
#elif defined(__WXQT__)
#include "wx/qt/gauge.h"
#endif
#endif // wxUSE_GAUGE
#endif
// _WX_GAUGE_H_BASE_
| h |
rticonnextdds-usecases | data/projects/rticonnextdds-usecases/VehicleTracking/ExampleCode/thirdparty/wxWidgets-3.1.2/Linux/include/wx/spinctrl.h | /////////////////////////////////////////////////////////////////////////////
// Name: wx/spinctrl.h
// Purpose: wxSpinCtrlBase class
// Author: Vadim Zeitlin
// Modified by:
// Created: 22.07.99
// Copyright: (c) Vadim Zeitlin
// Licence: wxWindows licence
/////////////////////////////////////////////////////////////////////////////
#ifndef _WX_SPINCTRL_H_
#define _WX_SPINCTRL_H_
#include "wx/defs.h"
#if wxUSE_SPINCTRL
#include "wx/spinbutt.h" // should make wxSpinEvent visible to the app
// Events
class WXDLLIMPEXP_FWD_CORE wxSpinDoubleEvent;
wxDECLARE_EXPORTED_EVENT(WXDLLIMPEXP_CORE, wxEVT_SPINCTRL, wxSpinEvent);
wxDECLARE_EXPORTED_EVENT(WXDLLIMPEXP_CORE, wxEVT_SPINCTRLDOUBLE, wxSpinDoubleEvent);
// ----------------------------------------------------------------------------
// A spin ctrl is a text control with a spin button which is usually used to
// prompt the user for a numeric input.
// There are two kinds for number types T=integer or T=double.
// ----------------------------------------------------------------------------
class WXDLLIMPEXP_CORE wxSpinCtrlBase : public wxControl
{
public:
wxSpinCtrlBase() {}
// accessor functions that derived classes are expected to have
// T GetValue() const
// T GetMin() const
// T GetMax() const
// T GetIncrement() const
virtual bool GetSnapToTicks() const = 0;
// unsigned GetDigits() const - wxSpinCtrlDouble only
// operation functions that derived classes are expected to have
virtual void SetValue(const wxString& value) = 0;
// void SetValue(T val)
// void SetRange(T minVal, T maxVal)
// void SetIncrement(T inc)
virtual void SetSnapToTicks(bool snap_to_ticks) = 0;
// void SetDigits(unsigned digits) - wxSpinCtrlDouble only
// The base for numbers display, e.g. 10 or 16.
virtual int GetBase() const = 0;
virtual bool SetBase(int base) = 0;
// Select text in the textctrl
virtual void SetSelection(long from, long to) = 0;
private:
wxDECLARE_NO_COPY_CLASS(wxSpinCtrlBase);
};
// ----------------------------------------------------------------------------
// wxSpinDoubleEvent - a wxSpinEvent for double valued controls
// ----------------------------------------------------------------------------
class WXDLLIMPEXP_CORE wxSpinDoubleEvent : public wxNotifyEvent
{
public:
wxSpinDoubleEvent(wxEventType commandType = wxEVT_NULL, int winid = 0,
double value = 0)
: wxNotifyEvent(commandType, winid), m_value(value)
{
}
wxSpinDoubleEvent(const wxSpinDoubleEvent& event)
: wxNotifyEvent(event), m_value(event.GetValue())
{
}
double GetValue() const { return m_value; }
void SetValue(double value) { m_value = value; }
virtual wxEvent *Clone() const wxOVERRIDE { return new wxSpinDoubleEvent(*this); }
protected:
double m_value;
private:
wxDECLARE_DYNAMIC_CLASS_NO_ASSIGN(wxSpinDoubleEvent);
};
// ----------------------------------------------------------------------------
// wxSpinDoubleEvent event type, see also wxSpinEvent in wx/spinbutt.h
// ----------------------------------------------------------------------------
typedef void (wxEvtHandler::*wxSpinDoubleEventFunction)(wxSpinDoubleEvent&);
#define wxSpinDoubleEventHandler(func) \
wxEVENT_HANDLER_CAST(wxSpinDoubleEventFunction, func)
// macros for handling spinctrl events
#define EVT_SPINCTRL(id, fn) \
wx__DECLARE_EVT1(wxEVT_SPINCTRL, id, wxSpinEventHandler(fn))
#define EVT_SPINCTRLDOUBLE(id, fn) \
wx__DECLARE_EVT1(wxEVT_SPINCTRLDOUBLE, id, wxSpinDoubleEventHandler(fn))
// ----------------------------------------------------------------------------
// include the platform-dependent class implementation
// ----------------------------------------------------------------------------
// we may have a native wxSpinCtrl implementation, native wxSpinCtrl and
// wxSpinCtrlDouble implementations or neither, define the appropriate symbols
// and include the generic version if necessary to provide the missing class(es)
#if defined(__WXUNIVERSAL__)
// nothing, use generic controls
#elif defined(__WXMSW__)
#define wxHAS_NATIVE_SPINCTRL
#include "wx/msw/spinctrl.h"
#elif defined(__WXGTK20__)
#define wxHAS_NATIVE_SPINCTRL
#define wxHAS_NATIVE_SPINCTRLDOUBLE
#include "wx/gtk/spinctrl.h"
#elif defined(__WXGTK__)
#define wxHAS_NATIVE_SPINCTRL
#include "wx/gtk1/spinctrl.h"
#elif defined(__WXQT__)
#define wxHAS_NATIVE_SPINCTRL
#define wxHAS_NATIVE_SPINCTRLDOUBLE
#include "wx/qt/spinctrl.h"
#endif // platform
#if !defined(wxHAS_NATIVE_SPINCTRL) || !defined(wxHAS_NATIVE_SPINCTRLDOUBLE)
#include "wx/generic/spinctlg.h"
#endif
namespace wxPrivate
{
// This is an internal helper function currently used by all ports: return the
// string containing hexadecimal representation of the given number.
extern wxString wxSpinCtrlFormatAsHex(long val, long maxVal);
} // namespace wxPrivate
// old wxEVT_COMMAND_* constants
#define wxEVT_COMMAND_SPINCTRL_UPDATED wxEVT_SPINCTRL
#define wxEVT_COMMAND_SPINCTRLDOUBLE_UPDATED wxEVT_SPINCTRLDOUBLE
#endif // wxUSE_SPINCTRL
#endif // _WX_SPINCTRL_H_
| h |
rticonnextdds-usecases | data/projects/rticonnextdds-usecases/VehicleTracking/ExampleCode/thirdparty/wxWidgets-3.1.2/Linux/include/wx/dcgraph.h | /////////////////////////////////////////////////////////////////////////////
// Name: wx/dcgraph.h
// Purpose: graphics context device bridge header
// Author: Stefan Csomor
// Modified by:
// Created:
// Copyright: (c) Stefan Csomor
// Licence: wxWindows licence
/////////////////////////////////////////////////////////////////////////////
#ifndef _WX_GRAPHICS_DC_H_
#define _WX_GRAPHICS_DC_H_
#if wxUSE_GRAPHICS_CONTEXT
#include "wx/dc.h"
#include "wx/geometry.h"
#include "wx/graphics.h"
class WXDLLIMPEXP_FWD_CORE wxWindowDC;
class WXDLLIMPEXP_CORE wxGCDC: public wxDC
{
public:
wxGCDC( const wxWindowDC& dc );
wxGCDC( const wxMemoryDC& dc );
#if wxUSE_PRINTING_ARCHITECTURE
wxGCDC( const wxPrinterDC& dc );
#endif
#if defined(__WXMSW__) && wxUSE_ENH_METAFILE
wxGCDC( const wxEnhMetaFileDC& dc );
#endif
wxGCDC(wxGraphicsContext* context);
wxGCDC();
virtual ~wxGCDC();
#ifdef __WXMSW__
// override wxDC virtual functions to provide access to HDC associated with
// this Graphics object (implemented in src/msw/graphics.cpp)
virtual WXHDC AcquireHDC() wxOVERRIDE;
virtual void ReleaseHDC(WXHDC hdc) wxOVERRIDE;
#endif // __WXMSW__
private:
wxDECLARE_DYNAMIC_CLASS(wxGCDC);
wxDECLARE_NO_COPY_CLASS(wxGCDC);
};
class WXDLLIMPEXP_CORE wxGCDCImpl: public wxDCImpl
{
public:
wxGCDCImpl( wxDC *owner, const wxWindowDC& dc );
wxGCDCImpl( wxDC *owner, const wxMemoryDC& dc );
#if wxUSE_PRINTING_ARCHITECTURE
wxGCDCImpl( wxDC *owner, const wxPrinterDC& dc );
#endif
#if defined(__WXMSW__) && wxUSE_ENH_METAFILE
wxGCDCImpl( wxDC *owner, const wxEnhMetaFileDC& dc );
#endif
// Ctor using an existing graphics context given to wxGCDC ctor.
wxGCDCImpl(wxDC *owner, wxGraphicsContext* context);
wxGCDCImpl( wxDC *owner );
virtual ~wxGCDCImpl();
// implement base class pure virtuals
// ----------------------------------
virtual void Clear() wxOVERRIDE;
virtual bool StartDoc( const wxString& message ) wxOVERRIDE;
virtual void EndDoc() wxOVERRIDE;
virtual void StartPage() wxOVERRIDE;
virtual void EndPage() wxOVERRIDE;
// flushing the content of this dc immediately onto screen
virtual void Flush() wxOVERRIDE;
virtual void SetFont(const wxFont& font) wxOVERRIDE;
virtual void SetPen(const wxPen& pen) wxOVERRIDE;
virtual void SetBrush(const wxBrush& brush) wxOVERRIDE;
virtual void SetBackground(const wxBrush& brush) wxOVERRIDE;
virtual void SetBackgroundMode(int mode) wxOVERRIDE;
#if wxUSE_PALETTE
virtual void SetPalette(const wxPalette& palette) wxOVERRIDE;
#endif
virtual void DestroyClippingRegion() wxOVERRIDE;
virtual wxCoord GetCharHeight() const wxOVERRIDE;
virtual wxCoord GetCharWidth() const wxOVERRIDE;
virtual bool CanDrawBitmap() const wxOVERRIDE;
virtual bool CanGetTextExtent() const wxOVERRIDE;
virtual int GetDepth() const wxOVERRIDE;
virtual wxSize GetPPI() const wxOVERRIDE;
virtual void SetLogicalFunction(wxRasterOperationMode function) wxOVERRIDE;
virtual void SetTextForeground(const wxColour& colour) wxOVERRIDE;
virtual void SetTextBackground(const wxColour& colour) wxOVERRIDE;
virtual void ComputeScaleAndOrigin() wxOVERRIDE;
wxGraphicsContext* GetGraphicsContext() const wxOVERRIDE { return m_graphicContext; }
virtual void SetGraphicsContext( wxGraphicsContext* ctx ) wxOVERRIDE;
virtual void* GetHandle() const wxOVERRIDE;
#if wxUSE_DC_TRANSFORM_MATRIX
virtual bool CanUseTransformMatrix() const wxOVERRIDE;
virtual bool SetTransformMatrix(const wxAffineMatrix2D& matrix) wxOVERRIDE;
virtual wxAffineMatrix2D GetTransformMatrix() const wxOVERRIDE;
virtual void ResetTransformMatrix() wxOVERRIDE;
#endif // wxUSE_DC_TRANSFORM_MATRIX
// the true implementations
virtual bool DoFloodFill(wxCoord x, wxCoord y, const wxColour& col,
wxFloodFillStyle style = wxFLOOD_SURFACE) wxOVERRIDE;
virtual void DoGradientFillLinear(const wxRect& rect,
const wxColour& initialColour,
const wxColour& destColour,
wxDirection nDirection = wxEAST) wxOVERRIDE;
virtual void DoGradientFillConcentric(const wxRect& rect,
const wxColour& initialColour,
const wxColour& destColour,
const wxPoint& circleCenter) wxOVERRIDE;
virtual bool DoGetPixel(wxCoord x, wxCoord y, wxColour *col) const wxOVERRIDE;
virtual void DoDrawPoint(wxCoord x, wxCoord y) wxOVERRIDE;
#if wxUSE_SPLINES
virtual void DoDrawSpline(const wxPointList *points) wxOVERRIDE;
#endif
virtual void DoDrawLine(wxCoord x1, wxCoord y1, wxCoord x2, wxCoord y2) wxOVERRIDE;
virtual void DoDrawArc(wxCoord x1, wxCoord y1,
wxCoord x2, wxCoord y2,
wxCoord xc, wxCoord yc) wxOVERRIDE;
virtual void DoDrawCheckMark(wxCoord x, wxCoord y,
wxCoord width, wxCoord height) wxOVERRIDE;
virtual void DoDrawEllipticArc(wxCoord x, wxCoord y, wxCoord w, wxCoord h,
double sa, double ea) wxOVERRIDE;
virtual void DoDrawRectangle(wxCoord x, wxCoord y, wxCoord width, wxCoord height) wxOVERRIDE;
virtual void DoDrawRoundedRectangle(wxCoord x, wxCoord y,
wxCoord width, wxCoord height,
double radius) wxOVERRIDE;
virtual void DoDrawEllipse(wxCoord x, wxCoord y, wxCoord width, wxCoord height) wxOVERRIDE;
virtual void DoCrossHair(wxCoord x, wxCoord y) wxOVERRIDE;
virtual void DoDrawIcon(const wxIcon& icon, wxCoord x, wxCoord y) wxOVERRIDE;
virtual void DoDrawBitmap(const wxBitmap &bmp, wxCoord x, wxCoord y,
bool useMask = false) wxOVERRIDE;
virtual void DoDrawText(const wxString& text, wxCoord x, wxCoord y) wxOVERRIDE;
virtual void DoDrawRotatedText(const wxString& text, wxCoord x, wxCoord y,
double angle) wxOVERRIDE;
virtual bool DoBlit(wxCoord xdest, wxCoord ydest, wxCoord width, wxCoord height,
wxDC *source, wxCoord xsrc, wxCoord ysrc,
wxRasterOperationMode rop = wxCOPY, bool useMask = false,
wxCoord xsrcMask = -1, wxCoord ysrcMask = -1) wxOVERRIDE;
virtual bool DoStretchBlit(wxCoord xdest, wxCoord ydest,
wxCoord dstWidth, wxCoord dstHeight,
wxDC *source,
wxCoord xsrc, wxCoord ysrc,
wxCoord srcWidth, wxCoord srcHeight,
wxRasterOperationMode = wxCOPY, bool useMask = false,
wxCoord xsrcMask = wxDefaultCoord, wxCoord ysrcMask = wxDefaultCoord) wxOVERRIDE;
virtual void DoGetSize(int *,int *) const wxOVERRIDE;
virtual void DoGetSizeMM(int* width, int* height) const wxOVERRIDE;
virtual void DoDrawLines(int n, const wxPoint points[],
wxCoord xoffset, wxCoord yoffset) wxOVERRIDE;
virtual void DoDrawPolygon(int n, const wxPoint points[],
wxCoord xoffset, wxCoord yoffset,
wxPolygonFillMode fillStyle = wxODDEVEN_RULE) wxOVERRIDE;
virtual void DoDrawPolyPolygon(int n, const int count[], const wxPoint points[],
wxCoord xoffset, wxCoord yoffset,
wxPolygonFillMode fillStyle) wxOVERRIDE;
virtual void DoSetDeviceClippingRegion(const wxRegion& region) wxOVERRIDE;
virtual void DoSetClippingRegion(wxCoord x, wxCoord y,
wxCoord width, wxCoord height) wxOVERRIDE;
virtual bool DoGetClippingRect(wxRect& rect) const wxOVERRIDE;
virtual void DoGetTextExtent(const wxString& string,
wxCoord *x, wxCoord *y,
wxCoord *descent = NULL,
wxCoord *externalLeading = NULL,
const wxFont *theFont = NULL) const wxOVERRIDE;
virtual bool DoGetPartialTextExtents(const wxString& text, wxArrayInt& widths) const wxOVERRIDE;
#ifdef __WXMSW__
virtual wxRect MSWApplyGDIPlusTransform(const wxRect& r) const wxOVERRIDE;
#endif // __WXMSW__
// update the internal clip box variables
void UpdateClipBox();
protected:
// unused int parameter distinguishes this version, which does not create a
// wxGraphicsContext, in the expectation that the derived class will do it
wxGCDCImpl(wxDC* owner, int);
// scaling variables
bool m_logicalFunctionSupported;
wxGraphicsMatrix m_matrixOriginal;
wxGraphicsMatrix m_matrixCurrent;
#if wxUSE_DC_TRANSFORM_MATRIX
wxAffineMatrix2D m_matrixExtTransform;
#endif // wxUSE_DC_TRANSFORM_MATRIX
wxGraphicsContext* m_graphicContext;
bool m_isClipBoxValid;
private:
void Init(wxGraphicsContext*);
wxDECLARE_CLASS(wxGCDCImpl);
wxDECLARE_NO_COPY_CLASS(wxGCDCImpl);
};
#endif // wxUSE_GRAPHICS_CONTEXT
#endif // _WX_GRAPHICS_DC_H_
| h |
rticonnextdds-usecases | data/projects/rticonnextdds-usecases/VehicleTracking/ExampleCode/thirdparty/wxWidgets-3.1.2/Linux/include/wx/file.h | /////////////////////////////////////////////////////////////////////////////
// Name: wx/file.h
// Purpose: wxFile - encapsulates low-level "file descriptor"
// wxTempFile - safely replace the old file
// Author: Vadim Zeitlin
// Modified by:
// Created: 29/01/98
// Copyright: (c) 1998 Vadim Zeitlin <[email protected]>
// Licence: wxWindows licence
/////////////////////////////////////////////////////////////////////////////
#ifndef _WX_FILEH__
#define _WX_FILEH__
#include "wx/defs.h"
#if wxUSE_FILE
#include "wx/string.h"
#include "wx/filefn.h"
#include "wx/convauto.h"
// ----------------------------------------------------------------------------
// class wxFile: raw file IO
//
// NB: for space efficiency this class has no virtual functions, including
// dtor which is _not_ virtual, so it shouldn't be used as a base class.
// ----------------------------------------------------------------------------
class WXDLLIMPEXP_BASE wxFile
{
public:
// more file constants
// -------------------
// opening mode
enum OpenMode { read, write, read_write, write_append, write_excl };
// standard values for file descriptor
enum { fd_invalid = -1, fd_stdin, fd_stdout, fd_stderr };
// static functions
// ----------------
// check whether a regular file by this name exists
static bool Exists(const wxString& name);
// check whether we can access the given file in given mode
// (only read and write make sense here)
static bool Access(const wxString& name, OpenMode mode);
// ctors
// -----
// def ctor
wxFile() { m_fd = fd_invalid; m_lasterror = 0; }
// open specified file (may fail, use IsOpened())
wxFile(const wxString& fileName, OpenMode mode = read);
// attach to (already opened) file
wxFile(int lfd) { m_fd = lfd; m_lasterror = 0; }
// open/close
// create a new file (with the default value of bOverwrite, it will fail if
// the file already exists, otherwise it will overwrite it and succeed)
bool Create(const wxString& fileName, bool bOverwrite = false,
int access = wxS_DEFAULT);
bool Open(const wxString& fileName, OpenMode mode = read,
int access = wxS_DEFAULT);
bool Close(); // Close is a NOP if not opened
// assign an existing file descriptor and get it back from wxFile object
void Attach(int lfd) { Close(); m_fd = lfd; m_lasterror = 0; }
int Detach() { const int fdOld = m_fd; m_fd = fd_invalid; return fdOld; }
int fd() const { return m_fd; }
// read/write (unbuffered)
// read all data from the file into a string (useful for text files)
bool ReadAll(wxString *str, const wxMBConv& conv = wxConvAuto());
// returns number of bytes read or wxInvalidOffset on error
ssize_t Read(void *pBuf, size_t nCount);
// returns the number of bytes written
size_t Write(const void *pBuf, size_t nCount);
// returns true on success
bool Write(const wxString& s, const wxMBConv& conv = wxConvAuto());
// flush data not yet written
bool Flush();
// file pointer operations (return wxInvalidOffset on failure)
// move ptr ofs bytes related to start/current offset/end of file
wxFileOffset Seek(wxFileOffset ofs, wxSeekMode mode = wxFromStart);
// move ptr to ofs bytes before the end
wxFileOffset SeekEnd(wxFileOffset ofs = 0) { return Seek(ofs, wxFromEnd); }
// get current offset
wxFileOffset Tell() const;
// get current file length
wxFileOffset Length() const;
// simple accessors
// is file opened?
bool IsOpened() const { return m_fd != fd_invalid; }
// is end of file reached?
bool Eof() const;
// has an error occurred?
bool Error() const { return m_lasterror != 0; }
// get last errno
int GetLastError() const { return m_lasterror; }
// reset error state
void ClearLastError() { m_lasterror = 0; }
// type such as disk or pipe
wxFileKind GetKind() const { return wxGetFileKind(m_fd); }
// dtor closes the file if opened
~wxFile() { Close(); }
private:
// copy ctor and assignment operator are private because
// it doesn't make sense to copy files this way:
// attempt to do it will provoke a compile-time error.
wxFile(const wxFile&);
wxFile& operator=(const wxFile&);
// Copy the value of errno into m_lasterror if rc == -1 and return true in
// this case (indicating that we've got an error). Otherwise return false.
//
// Notice that we use the possibly 64 bit wxFileOffset instead of int here so
// that it works for checking the result of functions such as tell() too.
bool CheckForError(wxFileOffset rc) const;
int m_fd; // file descriptor or INVALID_FD if not opened
int m_lasterror; // errno value of last error
};
// ----------------------------------------------------------------------------
// class wxTempFile: if you want to replace another file, create an instance
// of wxTempFile passing the name of the file to be replaced to the ctor. Then
// you can write to wxTempFile and call Commit() function to replace the old
// file (and close this one) or call Discard() to cancel the modification. If
// you call neither of them, dtor will call Discard().
// ----------------------------------------------------------------------------
class WXDLLIMPEXP_BASE wxTempFile
{
public:
// ctors
// default
wxTempFile() { }
// associates the temp file with the file to be replaced and opens it
wxTempFile(const wxString& strName);
// open the temp file (strName is the name of file to be replaced)
bool Open(const wxString& strName);
// is the file opened?
bool IsOpened() const { return m_file.IsOpened(); }
// get current file length
wxFileOffset Length() const { return m_file.Length(); }
// move ptr ofs bytes related to start/current offset/end of file
wxFileOffset Seek(wxFileOffset ofs, wxSeekMode mode = wxFromStart)
{ return m_file.Seek(ofs, mode); }
// get current offset
wxFileOffset Tell() const { return m_file.Tell(); }
// I/O (both functions return true on success, false on failure)
bool Write(const void *p, size_t n) { return m_file.Write(p, n) == n; }
bool Write(const wxString& str, const wxMBConv& conv = wxMBConvUTF8())
{ return m_file.Write(str, conv); }
// flush data: can be called before closing file to ensure that data was
// correctly written out
bool Flush() { return m_file.Flush(); }
// different ways to close the file
// validate changes and delete the old file of name m_strName
bool Commit();
// discard changes
void Discard();
// dtor calls Discard() if file is still opened
~wxTempFile();
private:
// no copy ctor/assignment operator
wxTempFile(const wxTempFile&);
wxTempFile& operator=(const wxTempFile&);
wxString m_strName, // name of the file to replace in Commit()
m_strTemp; // temporary file name
wxFile m_file; // the temporary file
};
#endif // wxUSE_FILE
#endif // _WX_FILEH__
| h |
rticonnextdds-usecases | data/projects/rticonnextdds-usecases/VehicleTracking/ExampleCode/thirdparty/wxWidgets-3.1.2/Linux/include/wx/filesys.h | /////////////////////////////////////////////////////////////////////////////
// Name: wx/filesys.h
// Purpose: class for opening files - virtual file system
// Author: Vaclav Slavik
// Copyright: (c) 1999 Vaclav Slavik
// Licence: wxWindows licence
/////////////////////////////////////////////////////////////////////////////
#ifndef __FILESYS_H__
#define __FILESYS_H__
#include "wx/defs.h"
#if wxUSE_FILESYSTEM
#if !wxUSE_STREAMS
#error You cannot compile virtual file systems without wxUSE_STREAMS
#endif
#if wxUSE_HTML && !wxUSE_FILESYSTEM
#error You cannot compile wxHTML without virtual file systems
#endif
#include "wx/stream.h"
#include "wx/datetime.h"
#include "wx/filename.h"
#include "wx/hashmap.h"
class WXDLLIMPEXP_FWD_BASE wxFSFile;
class WXDLLIMPEXP_FWD_BASE wxFileSystemHandler;
class WXDLLIMPEXP_FWD_BASE wxFileSystem;
//--------------------------------------------------------------------------------
// wxFSFile
// This class is a file opened using wxFileSystem. It consists of
// input stream, location, mime type & optional anchor
// (in 'index.htm#chapter2', 'chapter2' is anchor)
//--------------------------------------------------------------------------------
class WXDLLIMPEXP_BASE wxFSFile : public wxObject
{
public:
wxFSFile(wxInputStream *stream, const wxString& loc,
const wxString& mimetype, const wxString& anchor
#if wxUSE_DATETIME
, wxDateTime modif
#endif // wxUSE_DATETIME
)
{
m_Stream = stream;
m_Location = loc;
m_MimeType = mimetype.Lower();
m_Anchor = anchor;
#if wxUSE_DATETIME
m_Modif = modif;
#endif // wxUSE_DATETIME
}
virtual ~wxFSFile() { delete m_Stream; }
// returns stream. This doesn't give away ownership of the stream object.
wxInputStream *GetStream() const { return m_Stream; }
// gives away the ownership of the current stream.
wxInputStream *DetachStream()
{
wxInputStream *stream = m_Stream;
m_Stream = NULL;
return stream;
}
// deletes the current stream and takes ownership of another.
void SetStream(wxInputStream *stream)
{
delete m_Stream;
m_Stream = stream;
}
// returns file's mime type
const wxString& GetMimeType() const;
// returns the original location (aka filename) of the file
const wxString& GetLocation() const { return m_Location; }
const wxString& GetAnchor() const { return m_Anchor; }
#if wxUSE_DATETIME
wxDateTime GetModificationTime() const { return m_Modif; }
#endif // wxUSE_DATETIME
private:
wxInputStream *m_Stream;
wxString m_Location;
wxString m_MimeType;
wxString m_Anchor;
#if wxUSE_DATETIME
wxDateTime m_Modif;
#endif // wxUSE_DATETIME
wxDECLARE_ABSTRACT_CLASS(wxFSFile);
wxDECLARE_NO_COPY_CLASS(wxFSFile);
};
//--------------------------------------------------------------------------------
// wxFileSystemHandler
// This class is FS handler for wxFileSystem. It provides
// interface to access certain
// kinds of files (HTPP, FTP, local, tar.gz etc..)
//--------------------------------------------------------------------------------
class WXDLLIMPEXP_BASE wxFileSystemHandler : public wxObject
{
public:
wxFileSystemHandler() : wxObject() {}
// returns true if this handler is able to open given location
virtual bool CanOpen(const wxString& location) = 0;
// opens given file and returns pointer to input stream.
// Returns NULL if opening failed.
// The location is always absolute path.
virtual wxFSFile* OpenFile(wxFileSystem& fs, const wxString& location) = 0;
// Finds first/next file that matches spec wildcard. flags can be wxDIR for restricting
// the query to directories or wxFILE for files only or 0 for either.
// Returns filename or empty string if no more matching file exists
virtual wxString FindFirst(const wxString& spec, int flags = 0);
virtual wxString FindNext();
// Returns MIME type of the file - w/o need to open it
// (default behaviour is that it returns type based on extension)
static wxString GetMimeTypeFromExt(const wxString& location);
protected:
// returns protocol ("file", "http", "tar" etc.) The last (most right)
// protocol is used:
// {it returns "tar" for "file:subdir/archive.tar.gz#tar:/README.txt"}
static wxString GetProtocol(const wxString& location);
// returns left part of address:
// {it returns "file:subdir/archive.tar.gz" for "file:subdir/archive.tar.gz#tar:/README.txt"}
static wxString GetLeftLocation(const wxString& location);
// returns anchor part of address:
// {it returns "anchor" for "file:subdir/archive.tar.gz#tar:/README.txt#anchor"}
// NOTE: anchor is NOT a part of GetLeftLocation()'s return value
static wxString GetAnchor(const wxString& location);
// returns right part of address:
// {it returns "/README.txt" for "file:subdir/archive.tar.gz#tar:/README.txt"}
static wxString GetRightLocation(const wxString& location);
wxDECLARE_ABSTRACT_CLASS(wxFileSystemHandler);
};
//--------------------------------------------------------------------------------
// wxFileSystem
// This class provides simple interface for opening various
// kinds of files (HTPP, FTP, local, tar.gz etc..)
//--------------------------------------------------------------------------------
// Open Bit Flags
enum wxFileSystemOpenFlags
{
wxFS_READ = 1, // Open for reading
wxFS_SEEKABLE = 4 // Returned stream will be seekable
};
WX_DECLARE_VOIDPTR_HASH_MAP_WITH_DECL(wxFileSystemHandler*, wxFSHandlerHash, class WXDLLIMPEXP_BASE);
class WXDLLIMPEXP_BASE wxFileSystem : public wxObject
{
public:
wxFileSystem() : wxObject() { m_FindFileHandler = NULL;}
virtual ~wxFileSystem();
// sets the current location. Every call to OpenFile is
// relative to this location.
// NOTE !!
// unless is_dir = true 'location' is *not* the directory but
// file contained in this directory
// (so ChangePathTo("dir/subdir/xh.htm") sets m_Path to "dir/subdir/")
void ChangePathTo(const wxString& location, bool is_dir = false);
wxString GetPath() const {return m_Path;}
// opens given file and returns pointer to input stream.
// Returns NULL if opening failed.
// It first tries to open the file in relative scope
// (based on ChangePathTo()'s value) and then as an absolute
// path.
wxFSFile* OpenFile(const wxString& location, int flags = wxFS_READ);
// Finds first/next file that matches spec wildcard. flags can be wxDIR for restricting
// the query to directories or wxFILE for files only or 0 for either.
// Returns filename or empty string if no more matching file exists
wxString FindFirst(const wxString& spec, int flags = 0);
wxString FindNext();
// find a file in a list of directories, returns false if not found
bool FindFileInPath(wxString *pStr,
const wxString& path, const wxString& file);
// Adds FS handler.
// In fact, this class is only front-end to the FS handlers :-)
static void AddHandler(wxFileSystemHandler *handler);
// Removes FS handler
static wxFileSystemHandler* RemoveHandler(wxFileSystemHandler *handler);
// Returns true if there is a handler which can open the given location.
static bool HasHandlerForPath(const wxString& location);
// remove all items from the m_Handlers list
static void CleanUpHandlers();
// Returns the native path for a file URL
static wxFileName URLToFileName(const wxString& url);
// Returns the file URL for a native path
static wxString FileNameToURL(const wxFileName& filename);
protected:
wxFileSystemHandler *MakeLocal(wxFileSystemHandler *h);
wxString m_Path;
// the path (location) we are currently in
// this is path, not file!
// (so if you opened test/demo.htm, it is
// "test/", not "test/demo.htm")
wxString m_LastName;
// name of last opened file (full path)
static wxList m_Handlers;
// list of FS handlers
wxFileSystemHandler *m_FindFileHandler;
// handler that succeed in FindFirst query
wxFSHandlerHash m_LocalHandlers;
// Handlers local to this instance
wxDECLARE_DYNAMIC_CLASS(wxFileSystem);
wxDECLARE_NO_COPY_CLASS(wxFileSystem);
};
/*
'location' syntax:
To determine FS type, we're using standard KDE notation:
file:/absolute/path/file.htm
file:relative_path/xxxxx.html
/some/path/x.file ('file:' is default)
http://www.gnome.org
file:subdir/archive.tar.gz#tar:/README.txt
special characters :
':' - FS identificator is before this char
'#' - separator. It can be either HTML anchor ("index.html#news")
(in case there is no ':' in the string to the right from it)
or FS separator
(example : http://www.wxhtml.org/wxhtml-0.1.tar.gz#tar:/include/wxhtml/filesys.h"
this would access tgz archive stored on web)
'/' - directory (path) separator. It is used to determine upper-level path.
HEY! Don't use \ even if you're on Windows!
*/
class WXDLLIMPEXP_BASE wxLocalFSHandler : public wxFileSystemHandler
{
public:
virtual bool CanOpen(const wxString& location) wxOVERRIDE;
virtual wxFSFile* OpenFile(wxFileSystem& fs, const wxString& location) wxOVERRIDE;
virtual wxString FindFirst(const wxString& spec, int flags = 0) wxOVERRIDE;
virtual wxString FindNext() wxOVERRIDE;
// wxLocalFSHandler will prefix all filenames with 'root' before accessing
// files on disk. This effectively makes 'root' the top-level directory
// and prevents access to files outside this directory.
// (This is similar to Unix command 'chroot'.)
static void Chroot(const wxString& root) { ms_root = root; }
protected:
static wxString ms_root;
};
// Stream reading data from wxFSFile: this allows to use virtual files with any
// wx functions accepting streams.
class WXDLLIMPEXP_BASE wxFSInputStream : public wxWrapperInputStream
{
public:
// Notice that wxFS_READ is implied in flags.
wxFSInputStream(const wxString& filename, int flags = 0);
virtual ~wxFSInputStream();
private:
wxFSFile* m_file;
wxDECLARE_NO_COPY_CLASS(wxFSInputStream);
};
#endif
// wxUSE_FILESYSTEM
#endif
// __FILESYS_H__
| h |
rticonnextdds-usecases | data/projects/rticonnextdds-usecases/VehicleTracking/ExampleCode/thirdparty/wxWidgets-3.1.2/Linux/include/wx/region.h | /////////////////////////////////////////////////////////////////////////////
// Name: wx/region.h
// Purpose: Base header for wxRegion
// Author: Julian Smart
// Modified by:
// Created:
// Copyright: (c) Julian Smart
// Licence: wxWindows Licence
/////////////////////////////////////////////////////////////////////////////
#ifndef _WX_REGION_H_BASE_
#define _WX_REGION_H_BASE_
#include "wx/gdiobj.h"
#include "wx/gdicmn.h"
class WXDLLIMPEXP_FWD_CORE wxBitmap;
class WXDLLIMPEXP_FWD_CORE wxColour;
class WXDLLIMPEXP_FWD_CORE wxRegion;
// ----------------------------------------------------------------------------
// constants
// ----------------------------------------------------------------------------
// result of wxRegion::Contains() call
enum wxRegionContain
{
wxOutRegion = 0,
wxPartRegion = 1,
wxInRegion = 2
};
// these constants are used with wxRegion::Combine() in the ports which have
// this method
enum wxRegionOp
{
// Creates the intersection of the two combined regions.
wxRGN_AND,
// Creates a copy of the region
wxRGN_COPY,
// Combines the parts of first region that are not in the second one
wxRGN_DIFF,
// Creates the union of two combined regions.
wxRGN_OR,
// Creates the union of two regions except for any overlapping areas.
wxRGN_XOR
};
// ----------------------------------------------------------------------------
// wxRegionBase defines wxRegion API
// ----------------------------------------------------------------------------
class WXDLLIMPEXP_CORE wxRegionBase : public wxGDIObject
{
public:
// ctors
// -----
// none are defined here but the following should be available:
#if 0
wxRegion();
wxRegion(wxCoord x, wxCoord y, wxCoord w, wxCoord h);
wxRegion(const wxPoint& topLeft, const wxPoint& bottomRight);
wxRegion(const wxRect& rect);
wxRegion(size_t n, const wxPoint *points, wxPolygonFillMode fillStyle = wxODDEVEN_RULE);
wxRegion(const wxBitmap& bmp);
wxRegion(const wxBitmap& bmp, const wxColour& transp, int tolerance = 0);
#endif // 0
// operators
// ---------
bool operator==(const wxRegion& region) const { return IsEqual(region); }
bool operator!=(const wxRegion& region) const { return !(*this == region); }
// accessors
// ---------
// Is region empty?
virtual bool IsEmpty() const = 0;
bool Empty() const { return IsEmpty(); }
// Is region equal (i.e. covers the same area as another one)?
bool IsEqual(const wxRegion& region) const;
// Get the bounding box
bool GetBox(wxCoord& x, wxCoord& y, wxCoord& w, wxCoord& h) const
{ return DoGetBox(x, y, w, h); }
wxRect GetBox() const
{
wxCoord x, y, w, h;
return DoGetBox(x, y, w, h) ? wxRect(x, y, w, h) : wxRect();
}
// Test if the given point or rectangle is inside this region
wxRegionContain Contains(wxCoord x, wxCoord y) const
{ return DoContainsPoint(x, y); }
wxRegionContain Contains(const wxPoint& pt) const
{ return DoContainsPoint(pt.x, pt.y); }
wxRegionContain Contains(wxCoord x, wxCoord y, wxCoord w, wxCoord h) const
{ return DoContainsRect(wxRect(x, y, w, h)); }
wxRegionContain Contains(const wxRect& rect) const
{ return DoContainsRect(rect); }
// operations
// ----------
virtual void Clear() = 0;
// Move the region
bool Offset(wxCoord x, wxCoord y)
{ return DoOffset(x, y); }
bool Offset(const wxPoint& pt)
{ return DoOffset(pt.x, pt.y); }
// Union rectangle or region with this region.
bool Union(wxCoord x, wxCoord y, wxCoord w, wxCoord h)
{ return DoUnionWithRect(wxRect(x, y, w, h)); }
bool Union(const wxRect& rect)
{ return DoUnionWithRect(rect); }
bool Union(const wxRegion& region)
{ return DoUnionWithRegion(region); }
#if wxUSE_IMAGE
// Use the non-transparent pixels of a wxBitmap for the region to combine
// with this region. First version takes transparency from bitmap's mask,
// second lets the user specify the colour to be treated as transparent
// along with an optional tolerance value.
// NOTE: implemented in common/rgncmn.cpp
bool Union(const wxBitmap& bmp);
bool Union(const wxBitmap& bmp, const wxColour& transp, int tolerance = 0);
#endif // wxUSE_IMAGE
// Intersect rectangle or region with this one.
bool Intersect(wxCoord x, wxCoord y, wxCoord w, wxCoord h);
bool Intersect(const wxRect& rect);
bool Intersect(const wxRegion& region)
{ return DoIntersect(region); }
// Subtract rectangle or region from this:
// Combines the parts of 'this' that are not part of the second region.
bool Subtract(wxCoord x, wxCoord y, wxCoord w, wxCoord h);
bool Subtract(const wxRect& rect);
bool Subtract(const wxRegion& region)
{ return DoSubtract(region); }
// XOR: the union of two combined regions except for any overlapping areas.
bool Xor(wxCoord x, wxCoord y, wxCoord w, wxCoord h);
bool Xor(const wxRect& rect);
bool Xor(const wxRegion& region)
{ return DoXor(region); }
// Convert the region to a B&W bitmap with the white pixels being inside
// the region.
wxBitmap ConvertToBitmap() const;
protected:
virtual bool DoIsEqual(const wxRegion& region) const = 0;
virtual bool DoGetBox(wxCoord& x, wxCoord& y, wxCoord& w, wxCoord& h) const = 0;
virtual wxRegionContain DoContainsPoint(wxCoord x, wxCoord y) const = 0;
virtual wxRegionContain DoContainsRect(const wxRect& rect) const = 0;
virtual bool DoOffset(wxCoord x, wxCoord y) = 0;
virtual bool DoUnionWithRect(const wxRect& rect) = 0;
virtual bool DoUnionWithRegion(const wxRegion& region) = 0;
virtual bool DoIntersect(const wxRegion& region) = 0;
virtual bool DoSubtract(const wxRegion& region) = 0;
virtual bool DoXor(const wxRegion& region) = 0;
};
// some ports implement a generic Combine() function while others only
// implement individual wxRegion operations, factor out the common code for the
// ports with Combine() in this class
#if defined(__WXMSW__) || \
( defined(__WXMAC__) && wxOSX_USE_COCOA_OR_CARBON )
#define wxHAS_REGION_COMBINE
class WXDLLIMPEXP_CORE wxRegionWithCombine : public wxRegionBase
{
public:
// these methods are not part of public API as they're not implemented on
// all ports
bool Combine(wxCoord x, wxCoord y, wxCoord w, wxCoord h, wxRegionOp op);
bool Combine(const wxRect& rect, wxRegionOp op);
bool Combine(const wxRegion& region, wxRegionOp op)
{ return DoCombine(region, op); }
protected:
// the real Combine() method, to be defined in the derived class
virtual bool DoCombine(const wxRegion& region, wxRegionOp op) = 0;
// implement some wxRegionBase pure virtuals in terms of Combine()
virtual bool DoUnionWithRect(const wxRect& rect) wxOVERRIDE;
virtual bool DoUnionWithRegion(const wxRegion& region) wxOVERRIDE;
virtual bool DoIntersect(const wxRegion& region) wxOVERRIDE;
virtual bool DoSubtract(const wxRegion& region) wxOVERRIDE;
virtual bool DoXor(const wxRegion& region) wxOVERRIDE;
};
#endif // ports with wxRegion::Combine()
#if defined(__WXMSW__)
#include "wx/msw/region.h"
#elif defined(__WXGTK20__)
#include "wx/gtk/region.h"
#elif defined(__WXGTK__)
#include "wx/gtk1/region.h"
#elif defined(__WXMOTIF__) || defined(__WXX11__)
#include "wx/x11/region.h"
#elif defined(__WXDFB__)
#include "wx/dfb/region.h"
#elif defined(__WXMAC__)
#include "wx/osx/region.h"
#elif defined(__WXQT__)
#include "wx/qt/region.h"
#endif
// ----------------------------------------------------------------------------
// inline functions implementation
// ----------------------------------------------------------------------------
// NB: these functions couldn't be defined in the class declaration as they use
// wxRegion and so can be only defined after including the header declaring
// the real class
inline bool wxRegionBase::Intersect(const wxRect& rect)
{
return DoIntersect(wxRegion(rect));
}
inline bool wxRegionBase::Subtract(const wxRect& rect)
{
return DoSubtract(wxRegion(rect));
}
inline bool wxRegionBase::Xor(const wxRect& rect)
{
return DoXor(wxRegion(rect));
}
// ...and these functions are here because they call the ones above, and its
// not really proper to call an inline function before its defined inline.
inline bool wxRegionBase::Intersect(wxCoord x, wxCoord y, wxCoord w, wxCoord h)
{
return Intersect(wxRect(x, y, w, h));
}
inline bool wxRegionBase::Subtract(wxCoord x, wxCoord y, wxCoord w, wxCoord h)
{
return Subtract(wxRect(x, y, w, h));
}
inline bool wxRegionBase::Xor(wxCoord x, wxCoord y, wxCoord w, wxCoord h)
{
return Xor(wxRect(x, y, w, h));
}
#ifdef wxHAS_REGION_COMBINE
inline bool wxRegionWithCombine::Combine(wxCoord x,
wxCoord y,
wxCoord w,
wxCoord h,
wxRegionOp op)
{
return DoCombine(wxRegion(x, y, w, h), op);
}
inline bool wxRegionWithCombine::Combine(const wxRect& rect, wxRegionOp op)
{
return DoCombine(wxRegion(rect), op);
}
#endif // wxHAS_REGION_COMBINE
#endif // _WX_REGION_H_BASE_
| h |
rticonnextdds-usecases | data/projects/rticonnextdds-usecases/VehicleTracking/ExampleCode/thirdparty/wxWidgets-3.1.2/Linux/include/wx/eventfilter.h | ///////////////////////////////////////////////////////////////////////////////
// Name: wx/eventfilter.h
// Purpose: wxEventFilter class declaration.
// Author: Vadim Zeitlin
// Created: 2011-11-21
// Copyright: (c) 2011 Vadim Zeitlin <[email protected]>
// Licence: wxWindows licence
///////////////////////////////////////////////////////////////////////////////
#ifndef _WX_EVENTFILTER_H_
#define _WX_EVENTFILTER_H_
#include "wx/defs.h"
class WXDLLIMPEXP_FWD_BASE wxEvent;
class WXDLLIMPEXP_FWD_BASE wxEvtHandler;
// ----------------------------------------------------------------------------
// wxEventFilter is used with wxEvtHandler::AddFilter() and ProcessEvent().
// ----------------------------------------------------------------------------
class wxEventFilter
{
public:
// Possible return values for FilterEvent().
//
// Notice that the values of these enum elements are fixed due to backwards
// compatibility constraints.
enum
{
// Process event as usual.
Event_Skip = -1,
// Don't process the event normally at all.
Event_Ignore = 0,
// Event was already handled, don't process it normally.
Event_Processed = 1
};
wxEventFilter()
{
m_next = NULL;
}
virtual ~wxEventFilter()
{
wxASSERT_MSG( !m_next, "Forgot to call wxEvtHandler::RemoveFilter()?" );
}
// This method allows to filter all the events processed by the program, so
// you should try to return quickly from it to avoid slowing down the
// program to a crawl.
//
// Return value should be -1 to continue with the normal event processing,
// or true or false to stop further processing and pretend that the event
// had been already processed or won't be processed at all, respectively.
virtual int FilterEvent(wxEvent& event) = 0;
private:
// Objects of this class are made to be stored in a linked list in
// wxEvtHandler so put the next node ponter directly in the class itself.
wxEventFilter* m_next;
// And provide access to it for wxEvtHandler [only].
friend class wxEvtHandler;
wxDECLARE_NO_COPY_CLASS(wxEventFilter);
};
#endif // _WX_EVENTFILTER_H_
| h |
rticonnextdds-usecases | data/projects/rticonnextdds-usecases/VehicleTracking/ExampleCode/thirdparty/wxWidgets-3.1.2/Linux/include/wx/stopwatch.h | /////////////////////////////////////////////////////////////////////////////
// Name: wx/stopwatch.h
// Purpose: wxStopWatch and global time-related functions
// Author: Julian Smart (wxTimer), Sylvain Bougnoux (wxStopWatch),
// Vadim Zeitlin (time functions, current wxStopWatch)
// Created: 26.06.03 (extracted from wx/timer.h)
// Copyright: (c) 1998-2003 Julian Smart, Sylvain Bougnoux
// (c) 2011 Vadim Zeitlin
// Licence: wxWindows licence
/////////////////////////////////////////////////////////////////////////////
#ifndef _WX_STOPWATCH_H_
#define _WX_STOPWATCH_H_
#include "wx/defs.h"
#include "wx/longlong.h"
// Time-related functions are also available via this header for compatibility
// but you should include wx/time.h directly if you need only them and not
// wxStopWatch itself.
#include "wx/time.h"
// ----------------------------------------------------------------------------
// wxStopWatch: measure time intervals with up to 1ms resolution
// ----------------------------------------------------------------------------
#if wxUSE_STOPWATCH
class WXDLLIMPEXP_BASE wxStopWatch
{
public:
// ctor starts the stop watch
wxStopWatch() { m_pauseCount = 0; Start(); }
// Start the stop watch at the moment t0 expressed in milliseconds (i.e.
// calling Time() immediately afterwards returns t0). This can be used to
// restart an existing stopwatch.
void Start(long t0 = 0);
// pause the stop watch
void Pause()
{
if ( m_pauseCount++ == 0 )
m_elapsedBeforePause = GetCurrentClockValue() - m_t0;
}
// resume it
void Resume()
{
wxASSERT_MSG( m_pauseCount > 0,
wxT("Resuming stop watch which is not paused") );
if ( --m_pauseCount == 0 )
{
DoStart();
m_t0 -= m_elapsedBeforePause;
}
}
// Get elapsed time since the last Start() in microseconds.
wxLongLong TimeInMicro() const;
// get elapsed time since the last Start() in milliseconds
long Time() const { return (TimeInMicro()/1000).ToLong(); }
private:
// Really starts the stop watch. The initial time is set to current clock
// value.
void DoStart();
// Returns the current clock value in its native units.
wxLongLong GetCurrentClockValue() const;
// Return the frequency of the clock used in its ticks per second.
wxLongLong GetClockFreq() const;
// The clock value when the stop watch was last started. Its units vary
// depending on the platform.
wxLongLong m_t0;
// The elapsed time as of last Pause() call (only valid if m_pauseCount >
// 0) in the same units as m_t0.
wxLongLong m_elapsedBeforePause;
// if > 0, the stop watch is paused, otherwise it is running
int m_pauseCount;
};
#endif // wxUSE_STOPWATCH
#endif // _WX_STOPWATCH_H_
| h |
rticonnextdds-usecases | data/projects/rticonnextdds-usecases/VehicleTracking/ExampleCode/thirdparty/wxWidgets-3.1.2/Linux/include/wx/init.h | ///////////////////////////////////////////////////////////////////////////////
// Name: wx/init.h
// Purpose: wxWidgets initialization and finalization functions
// Author: Vadim Zeitlin
// Modified by:
// Created: 29.06.2003
// Copyright: (c) 2003 Vadim Zeitlin <[email protected]>
// Licence: wxWindows licence
///////////////////////////////////////////////////////////////////////////////
#ifndef _WX_INIT_H_
#define _WX_INIT_H_
#include "wx/defs.h"
#include "wx/chartype.h"
// ----------------------------------------------------------------------------
// wxEntry helper functions which allow to have more fine grained control
// ----------------------------------------------------------------------------
// do common initialization, return true if ok (in this case wxEntryCleanup
// must be called later), otherwise the program can't use wxWidgets at all
//
// this function also creates wxTheApp as a side effect, if wxIMPLEMENT_APP
// hadn't been used a dummy default application object is created
//
// note that the parameters may be modified, this is why we pass them by
// reference!
extern bool WXDLLIMPEXP_BASE wxEntryStart(int& argc, wxChar **argv);
// free the resources allocated by the library in wxEntryStart() and shut it
// down (wxEntryStart() may be called again afterwards if necessary)
extern void WXDLLIMPEXP_BASE wxEntryCleanup();
// ----------------------------------------------------------------------------
// wxEntry: this function initializes the library, runs the main event loop
// and cleans it up
// ----------------------------------------------------------------------------
// note that other, platform-specific, overloads of wxEntry may exist as well
// but this one always exists under all platforms
//
// returns the program exit code
extern int WXDLLIMPEXP_BASE wxEntry(int& argc, wxChar **argv);
// we overload wxEntry[Start]() to take "char **" pointers too
#if wxUSE_UNICODE
extern bool WXDLLIMPEXP_BASE wxEntryStart(int& argc, char **argv);
extern int WXDLLIMPEXP_BASE wxEntry(int& argc, char **argv);
#endif// wxUSE_UNICODE
// Under Windows we define additional wxEntry() overloads with signature
// compatible with WinMain() and not the traditional main().
#ifdef __WINDOWS__
#include "wx/msw/init.h"
#endif
// ----------------------------------------------------------------------------
// Using the library without (explicit) application object: you may avoid using
// wxDECLARE_APP and wxIMPLEMENT_APP macros and call the functions below instead at
// the program startup and termination
// ----------------------------------------------------------------------------
// initialize the library (may be called as many times as needed, but each
// call to wxInitialize() must be matched by wxUninitialize())
extern bool WXDLLIMPEXP_BASE wxInitialize();
extern bool WXDLLIMPEXP_BASE wxInitialize(int& argc, wxChar **argv);
#if wxUSE_UNICODE
extern bool WXDLLIMPEXP_BASE wxInitialize(int& argc, char **argv);
#endif
// clean up -- the library can't be used any more after the last call to
// wxUninitialize()
extern void WXDLLIMPEXP_BASE wxUninitialize();
// create an object of this class on stack to initialize/cleanup the library
// automatically
class WXDLLIMPEXP_BASE wxInitializer
{
public:
// initialize the library
wxInitializer()
{
m_ok = wxInitialize();
}
wxInitializer(int& argc, wxChar **argv)
{
m_ok = wxInitialize(argc, argv);
}
#if wxUSE_UNICODE
wxInitializer(int& argc, char **argv)
{
m_ok = wxInitialize(argc, argv);
}
#endif // wxUSE_UNICODE
// has the initialization been successful? (explicit test)
bool IsOk() const { return m_ok; }
// has the initialization been successful? (implicit test)
operator bool() const { return m_ok; }
// dtor only does clean up if we initialized the library properly
~wxInitializer() { if ( m_ok ) wxUninitialize(); }
private:
bool m_ok;
};
#endif // _WX_INIT_H_
| h |
rticonnextdds-usecases | data/projects/rticonnextdds-usecases/VehicleTracking/ExampleCode/thirdparty/wxWidgets-3.1.2/Linux/include/wx/textcompleter.h | ///////////////////////////////////////////////////////////////////////////////
// Name: wx/textcompleter.h
// Purpose: Declaration of wxTextCompleter class.
// Author: Vadim Zeitlin
// Created: 2011-04-13
// Copyright: (c) 2011 Vadim Zeitlin <[email protected]>
// Licence: wxWindows licence
///////////////////////////////////////////////////////////////////////////////
#ifndef _WX_TEXTCOMPLETER_H_
#define _WX_TEXTCOMPLETER_H_
#include "wx/defs.h"
#include "wx/arrstr.h"
// ----------------------------------------------------------------------------
// wxTextCompleter: used by wxTextEnter::AutoComplete()
// ----------------------------------------------------------------------------
class WXDLLIMPEXP_CORE wxTextCompleter
{
public:
wxTextCompleter() { }
// The virtual functions to be implemented by the derived classes: the
// first one is called to start preparing for completions for the given
// prefix and, if it returns true, GetNext() is called until it returns an
// empty string indicating that there are no more completions.
virtual bool Start(const wxString& prefix) = 0;
virtual wxString GetNext() = 0;
virtual ~wxTextCompleter();
private:
wxDECLARE_NO_COPY_CLASS(wxTextCompleter);
};
// ----------------------------------------------------------------------------
// wxTextCompleterSimple: returns the entire set of completions at once
// ----------------------------------------------------------------------------
class WXDLLIMPEXP_CORE wxTextCompleterSimple : public wxTextCompleter
{
public:
wxTextCompleterSimple() { }
// Must be implemented to return all the completions for the given prefix.
virtual void GetCompletions(const wxString& prefix, wxArrayString& res) = 0;
virtual bool Start(const wxString& prefix) wxOVERRIDE;
virtual wxString GetNext() wxOVERRIDE;
private:
wxArrayString m_completions;
unsigned m_index;
wxDECLARE_NO_COPY_CLASS(wxTextCompleterSimple);
};
// ----------------------------------------------------------------------------
// wxTextCompleterFixed: Trivial wxTextCompleter implementation which always
// returns the same fixed array of completions.
// ----------------------------------------------------------------------------
// NB: This class is private and intentionally not documented as it is
// currently used only for implementation of completion with the fixed list
// of strings only by wxWidgets itself, do not use it outside of wxWidgets.
class wxTextCompleterFixed : public wxTextCompleterSimple
{
public:
void SetCompletions(const wxArrayString& strings)
{
m_strings = strings;
}
virtual void GetCompletions(const wxString& WXUNUSED(prefix),
wxArrayString& res) wxOVERRIDE
{
res = m_strings;
}
private:
wxArrayString m_strings;
};
#endif // _WX_TEXTCOMPLETER_H_
| h |
rticonnextdds-usecases | data/projects/rticonnextdds-usecases/VehicleTracking/ExampleCode/thirdparty/wxWidgets-3.1.2/Linux/include/wx/datectrl.h | ///////////////////////////////////////////////////////////////////////////////
// Name: wx/datectrl.h
// Purpose: implements wxDatePickerCtrl
// Author: Vadim Zeitlin
// Modified by:
// Created: 2005-01-09
// Copyright: (c) 2005 Vadim Zeitlin <[email protected]>
// Licence: wxWindows licence
///////////////////////////////////////////////////////////////////////////////
#ifndef _WX_DATECTRL_H_
#define _WX_DATECTRL_H_
#include "wx/defs.h"
#if wxUSE_DATEPICKCTRL
#include "wx/datetimectrl.h" // the base class
#define wxDatePickerCtrlNameStr wxT("datectrl")
// wxDatePickerCtrl styles
enum
{
// default style on this platform, either wxDP_SPIN or wxDP_DROPDOWN
wxDP_DEFAULT = 0,
// a spin control-like date picker (not supported in generic version)
wxDP_SPIN = 1,
// a combobox-like date picker (not supported in mac version)
wxDP_DROPDOWN = 2,
// always show century in the default date display (otherwise it depends on
// the system date format which may include the century or not)
wxDP_SHOWCENTURY = 4,
// allow not having any valid date in the control (by default it always has
// some date, today initially if no valid date specified in ctor)
wxDP_ALLOWNONE = 8
};
// ----------------------------------------------------------------------------
// wxDatePickerCtrl: allow the user to enter the date
// ----------------------------------------------------------------------------
class WXDLLIMPEXP_ADV wxDatePickerCtrlBase : public wxDateTimePickerCtrl
{
public:
/*
The derived classes should implement ctor and Create() method with the
following signature:
bool Create(wxWindow *parent,
wxWindowID id,
const wxDateTime& dt = wxDefaultDateTime,
const wxPoint& pos = wxDefaultPosition,
const wxSize& size = wxDefaultSize,
long style = wxDP_DEFAULT | wxDP_SHOWCENTURY,
const wxValidator& validator = wxDefaultValidator,
const wxString& name = wxDatePickerCtrlNameStr);
*/
/*
We inherit the methods to set/get the date from the base class.
virtual void SetValue(const wxDateTime& dt) = 0;
virtual wxDateTime GetValue() const = 0;
*/
// And add methods to set/get the allowed valid range for the dates. If
// either/both of them are invalid, there is no corresponding limit and if
// neither is set, GetRange() returns false.
virtual void SetRange(const wxDateTime& dt1, const wxDateTime& dt2) = 0;
virtual bool GetRange(wxDateTime *dt1, wxDateTime *dt2) const = 0;
};
#if defined(__WXMSW__) && !defined(__WXUNIVERSAL__)
#include "wx/msw/datectrl.h"
#define wxHAS_NATIVE_DATEPICKCTRL
#elif defined(__WXOSX_COCOA__) && !defined(__WXUNIVERSAL__)
#include "wx/osx/datectrl.h"
#define wxHAS_NATIVE_DATEPICKCTRL
#else
#include "wx/generic/datectrl.h"
class WXDLLIMPEXP_ADV wxDatePickerCtrl : public wxDatePickerCtrlGeneric
{
public:
wxDatePickerCtrl() { }
wxDatePickerCtrl(wxWindow *parent,
wxWindowID id,
const wxDateTime& date = wxDefaultDateTime,
const wxPoint& pos = wxDefaultPosition,
const wxSize& size = wxDefaultSize,
long style = wxDP_DEFAULT | wxDP_SHOWCENTURY,
const wxValidator& validator = wxDefaultValidator,
const wxString& name = wxDatePickerCtrlNameStr)
: wxDatePickerCtrlGeneric(parent, id, date, pos, size, style, validator, name)
{
}
private:
wxDECLARE_DYNAMIC_CLASS_NO_COPY(wxDatePickerCtrl);
};
#endif
#endif // wxUSE_DATEPICKCTRL
#endif // _WX_DATECTRL_H_
| h |
rticonnextdds-usecases | data/projects/rticonnextdds-usecases/VehicleTracking/ExampleCode/thirdparty/wxWidgets-3.1.2/Linux/include/wx/webview.h | /////////////////////////////////////////////////////////////////////////////
// Name: webview.h
// Purpose: Common interface and events for web view component
// Author: Marianne Gagnon
// Copyright: (c) 2010 Marianne Gagnon, 2011 Steven Lamerton
// Licence: wxWindows licence
/////////////////////////////////////////////////////////////////////////////
#ifndef _WX_WEBVIEW_H_
#define _WX_WEBVIEW_H_
#include "wx/defs.h"
#if wxUSE_WEBVIEW
#include "wx/control.h"
#include "wx/event.h"
#include "wx/sstream.h"
#include "wx/sharedptr.h"
#include "wx/vector.h"
#if defined(__WXOSX__)
#include "wx/osx/webviewhistoryitem_webkit.h"
#elif defined(__WXGTK__)
#include "wx/gtk/webviewhistoryitem_webkit.h"
#elif defined(__WXMSW__)
#include "wx/msw/webviewhistoryitem_ie.h"
#else
#error "wxWebView not implemented on this platform."
#endif
class wxFSFile;
class wxFileSystem;
class wxWebView;
enum wxWebViewZoom
{
wxWEBVIEW_ZOOM_TINY,
wxWEBVIEW_ZOOM_SMALL,
wxWEBVIEW_ZOOM_MEDIUM,
wxWEBVIEW_ZOOM_LARGE,
wxWEBVIEW_ZOOM_LARGEST
};
enum wxWebViewZoomType
{
//Scales entire page, including images
wxWEBVIEW_ZOOM_TYPE_LAYOUT,
wxWEBVIEW_ZOOM_TYPE_TEXT
};
enum wxWebViewNavigationError
{
wxWEBVIEW_NAV_ERR_CONNECTION,
wxWEBVIEW_NAV_ERR_CERTIFICATE,
wxWEBVIEW_NAV_ERR_AUTH,
wxWEBVIEW_NAV_ERR_SECURITY,
wxWEBVIEW_NAV_ERR_NOT_FOUND,
wxWEBVIEW_NAV_ERR_REQUEST,
wxWEBVIEW_NAV_ERR_USER_CANCELLED,
wxWEBVIEW_NAV_ERR_OTHER
};
enum wxWebViewReloadFlags
{
//Default, may access cache
wxWEBVIEW_RELOAD_DEFAULT,
wxWEBVIEW_RELOAD_NO_CACHE
};
enum wxWebViewFindFlags
{
wxWEBVIEW_FIND_WRAP = 0x0001,
wxWEBVIEW_FIND_ENTIRE_WORD = 0x0002,
wxWEBVIEW_FIND_MATCH_CASE = 0x0004,
wxWEBVIEW_FIND_HIGHLIGHT_RESULT = 0x0008,
wxWEBVIEW_FIND_BACKWARDS = 0x0010,
wxWEBVIEW_FIND_DEFAULT = 0
};
enum wxWebViewNavigationActionFlags
{
wxWEBVIEW_NAV_ACTION_NONE,
wxWEBVIEW_NAV_ACTION_USER,
wxWEBVIEW_NAV_ACTION_OTHER
};
//Base class for custom scheme handlers
class WXDLLIMPEXP_WEBVIEW wxWebViewHandler
{
public:
wxWebViewHandler(const wxString& scheme) : m_scheme(scheme) {}
virtual ~wxWebViewHandler() {}
virtual wxString GetName() const { return m_scheme; }
virtual wxFSFile* GetFile(const wxString &uri) = 0;
private:
wxString m_scheme;
};
extern WXDLLIMPEXP_DATA_WEBVIEW(const char) wxWebViewNameStr[];
extern WXDLLIMPEXP_DATA_WEBVIEW(const char) wxWebViewDefaultURLStr[];
extern WXDLLIMPEXP_DATA_WEBVIEW(const char) wxWebViewBackendDefault[];
extern WXDLLIMPEXP_DATA_WEBVIEW(const char) wxWebViewBackendIE[];
extern WXDLLIMPEXP_DATA_WEBVIEW(const char) wxWebViewBackendWebKit[];
class WXDLLIMPEXP_WEBVIEW wxWebViewFactory : public wxObject
{
public:
virtual wxWebView* Create() = 0;
virtual wxWebView* Create(wxWindow* parent,
wxWindowID id,
const wxString& url = wxWebViewDefaultURLStr,
const wxPoint& pos = wxDefaultPosition,
const wxSize& size = wxDefaultSize,
long style = 0,
const wxString& name = wxWebViewNameStr) = 0;
};
WX_DECLARE_STRING_HASH_MAP(wxSharedPtr<wxWebViewFactory>, wxStringWebViewFactoryMap);
class WXDLLIMPEXP_WEBVIEW wxWebView : public wxControl
{
public:
wxWebView()
{
m_showMenu = true;
m_runScriptCount = 0;
}
virtual ~wxWebView() {}
virtual bool Create(wxWindow* parent,
wxWindowID id,
const wxString& url = wxWebViewDefaultURLStr,
const wxPoint& pos = wxDefaultPosition,
const wxSize& size = wxDefaultSize,
long style = 0,
const wxString& name = wxWebViewNameStr) = 0;
// Factory methods allowing the use of custom factories registered with
// RegisterFactory
static wxWebView* New(const wxString& backend = wxWebViewBackendDefault);
static wxWebView* New(wxWindow* parent,
wxWindowID id,
const wxString& url = wxWebViewDefaultURLStr,
const wxPoint& pos = wxDefaultPosition,
const wxSize& size = wxDefaultSize,
const wxString& backend = wxWebViewBackendDefault,
long style = 0,
const wxString& name = wxWebViewNameStr);
static void RegisterFactory(const wxString& backend,
wxSharedPtr<wxWebViewFactory> factory);
// General methods
virtual void EnableContextMenu(bool enable = true)
{
m_showMenu = enable;
}
virtual wxString GetCurrentTitle() const = 0;
virtual wxString GetCurrentURL() const = 0;
// TODO: handle choosing a frame when calling GetPageSource()?
virtual wxString GetPageSource() const = 0;
virtual wxString GetPageText() const = 0;
virtual bool IsBusy() const = 0;
virtual bool IsContextMenuEnabled() const { return m_showMenu; }
virtual bool IsEditable() const = 0;
virtual void LoadURL(const wxString& url) = 0;
virtual void Print() = 0;
virtual void RegisterHandler(wxSharedPtr<wxWebViewHandler> handler) = 0;
virtual void Reload(wxWebViewReloadFlags flags = wxWEBVIEW_RELOAD_DEFAULT) = 0;
virtual bool RunScript(const wxString& javascript, wxString* output = NULL) = 0;
virtual void SetEditable(bool enable = true) = 0;
void SetPage(const wxString& html, const wxString& baseUrl)
{
DoSetPage(html, baseUrl);
}
void SetPage(wxInputStream& html, wxString baseUrl)
{
wxStringOutputStream stream;
stream.Write(html);
DoSetPage(stream.GetString(), baseUrl);
}
virtual void Stop() = 0;
//History
virtual bool CanGoBack() const = 0;
virtual bool CanGoForward() const = 0;
virtual void GoBack() = 0;
virtual void GoForward() = 0;
virtual void ClearHistory() = 0;
virtual void EnableHistory(bool enable = true) = 0;
virtual wxVector<wxSharedPtr<wxWebViewHistoryItem> > GetBackwardHistory() = 0;
virtual wxVector<wxSharedPtr<wxWebViewHistoryItem> > GetForwardHistory() = 0;
virtual void LoadHistoryItem(wxSharedPtr<wxWebViewHistoryItem> item) = 0;
//Zoom
virtual bool CanSetZoomType(wxWebViewZoomType type) const = 0;
virtual wxWebViewZoom GetZoom() const = 0;
virtual wxWebViewZoomType GetZoomType() const = 0;
virtual void SetZoom(wxWebViewZoom zoom) = 0;
virtual void SetZoomType(wxWebViewZoomType zoomType) = 0;
//Selection
virtual void SelectAll() = 0;
virtual bool HasSelection() const = 0;
virtual void DeleteSelection() = 0;
virtual wxString GetSelectedText() const = 0;
virtual wxString GetSelectedSource() const = 0;
virtual void ClearSelection() = 0;
//Clipboard functions
virtual bool CanCut() const = 0;
virtual bool CanCopy() const = 0;
virtual bool CanPaste() const = 0;
virtual void Cut() = 0;
virtual void Copy() = 0;
virtual void Paste() = 0;
//Undo / redo functionality
virtual bool CanUndo() const = 0;
virtual bool CanRedo() const = 0;
virtual void Undo() = 0;
virtual void Redo() = 0;
//Get the pointer to the underlying native engine.
virtual void* GetNativeBackend() const = 0;
//Find function
virtual long Find(const wxString& text, int flags = wxWEBVIEW_FIND_DEFAULT) = 0;
protected:
virtual void DoSetPage(const wxString& html, const wxString& baseUrl) = 0;
// Count the number of calls to RunScript() in order to prevent
// the_same variable from being used twice in more than one call.
int m_runScriptCount;
private:
static void InitFactoryMap();
static wxStringWebViewFactoryMap::iterator FindFactory(const wxString &backend);
bool m_showMenu;
static wxStringWebViewFactoryMap m_factoryMap;
wxDECLARE_ABSTRACT_CLASS(wxWebView);
};
class WXDLLIMPEXP_WEBVIEW wxWebViewEvent : public wxNotifyEvent
{
public:
wxWebViewEvent() {}
wxWebViewEvent(wxEventType type, int id, const wxString& url,
const wxString target,
wxWebViewNavigationActionFlags flags = wxWEBVIEW_NAV_ACTION_NONE)
: wxNotifyEvent(type, id), m_url(url), m_target(target),
m_actionFlags(flags)
{}
const wxString& GetURL() const { return m_url; }
const wxString& GetTarget() const { return m_target; }
wxWebViewNavigationActionFlags GetNavigationAction() const { return m_actionFlags; }
virtual wxEvent* Clone() const wxOVERRIDE { return new wxWebViewEvent(*this); }
private:
wxString m_url;
wxString m_target;
wxWebViewNavigationActionFlags m_actionFlags;
wxDECLARE_DYNAMIC_CLASS_NO_ASSIGN(wxWebViewEvent);
};
wxDECLARE_EXPORTED_EVENT( WXDLLIMPEXP_WEBVIEW, wxEVT_WEBVIEW_NAVIGATING, wxWebViewEvent );
wxDECLARE_EXPORTED_EVENT( WXDLLIMPEXP_WEBVIEW, wxEVT_WEBVIEW_NAVIGATED, wxWebViewEvent );
wxDECLARE_EXPORTED_EVENT( WXDLLIMPEXP_WEBVIEW, wxEVT_WEBVIEW_LOADED, wxWebViewEvent );
wxDECLARE_EXPORTED_EVENT( WXDLLIMPEXP_WEBVIEW, wxEVT_WEBVIEW_ERROR, wxWebViewEvent );
wxDECLARE_EXPORTED_EVENT( WXDLLIMPEXP_WEBVIEW, wxEVT_WEBVIEW_NEWWINDOW, wxWebViewEvent );
wxDECLARE_EXPORTED_EVENT( WXDLLIMPEXP_WEBVIEW, wxEVT_WEBVIEW_TITLE_CHANGED, wxWebViewEvent );
typedef void (wxEvtHandler::*wxWebViewEventFunction)
(wxWebViewEvent&);
#define wxWebViewEventHandler(func) \
wxEVENT_HANDLER_CAST(wxWebViewEventFunction, func)
#define EVT_WEBVIEW_NAVIGATING(id, fn) \
wx__DECLARE_EVT1(wxEVT_WEBVIEW_NAVIGATING, id, \
wxWebViewEventHandler(fn))
#define EVT_WEBVIEW_NAVIGATED(id, fn) \
wx__DECLARE_EVT1(wxEVT_WEBVIEW_NAVIGATED, id, \
wxWebViewEventHandler(fn))
#define EVT_WEBVIEW_LOADED(id, fn) \
wx__DECLARE_EVT1(wxEVT_WEBVIEW_LOADED, id, \
wxWebViewEventHandler(fn))
#define EVT_WEBVIEW_ERROR(id, fn) \
wx__DECLARE_EVT1(wxEVT_WEBVIEW_ERROR, id, \
wxWebViewEventHandler(fn))
#define EVT_WEBVIEW_NEWWINDOW(id, fn) \
wx__DECLARE_EVT1(wxEVT_WEBVIEW_NEWWINDOW, id, \
wxWebViewEventHandler(fn))
#define EVT_WEBVIEW_TITLE_CHANGED(id, fn) \
wx__DECLARE_EVT1(wxEVT_WEBVIEW_TITLE_CHANGED, id, \
wxWebViewEventHandler(fn))
// old wxEVT_COMMAND_* constants
#define wxEVT_COMMAND_WEBVIEW_NAVIGATING wxEVT_WEBVIEW_NAVIGATING
#define wxEVT_COMMAND_WEBVIEW_NAVIGATED wxEVT_WEBVIEW_NAVIGATED
#define wxEVT_COMMAND_WEBVIEW_LOADED wxEVT_WEBVIEW_LOADED
#define wxEVT_COMMAND_WEBVIEW_ERROR wxEVT_WEBVIEW_ERROR
#define wxEVT_COMMAND_WEBVIEW_NEWWINDOW wxEVT_WEBVIEW_NEWWINDOW
#define wxEVT_COMMAND_WEBVIEW_TITLE_CHANGED wxEVT_WEBVIEW_TITLE_CHANGED
#endif // wxUSE_WEBVIEW
#endif // _WX_WEBVIEW_H_
| h |
rticonnextdds-usecases | data/projects/rticonnextdds-usecases/VehicleTracking/ExampleCode/thirdparty/wxWidgets-3.1.2/Linux/include/wx/list.h | /////////////////////////////////////////////////////////////////////////////
// Name: wx/list.h
// Purpose: wxList, wxStringList classes
// Author: Julian Smart
// Modified by: VZ at 16/11/98: WX_DECLARE_LIST() and typesafe lists added
// Created: 29/01/98
// Copyright: (c) 1998 Julian Smart
// Licence: wxWindows licence
/////////////////////////////////////////////////////////////////////////////
/*
All this is quite ugly but serves two purposes:
1. Be almost 100% compatible with old, untyped, wxList class
2. Ensure compile-time type checking for the linked lists
The idea is to have one base class (wxListBase) working with "void *" data,
but to hide these untyped functions - i.e. make them protected, so they
can only be used from derived classes which have inline member functions
working with right types. This achieves the 2nd goal. As for the first one,
we provide a special derivation of wxListBase called wxList which looks just
like the old class.
*/
#ifndef _WX_LIST_H_
#define _WX_LIST_H_
// -----------------------------------------------------------------------------
// headers
// -----------------------------------------------------------------------------
#include "wx/defs.h"
#include "wx/object.h"
#include "wx/string.h"
#include "wx/vector.h"
#if wxUSE_STD_CONTAINERS
#include "wx/beforestd.h"
#include <algorithm>
#include <iterator>
#include <list>
#include "wx/afterstd.h"
#endif
// ----------------------------------------------------------------------------
// types
// ----------------------------------------------------------------------------
class WXDLLIMPEXP_FWD_BASE wxObjectListNode;
typedef wxObjectListNode wxNode;
#if wxUSE_STD_CONTAINERS
#define wxLIST_COMPATIBILITY
#define WX_DECLARE_LIST_3(elT, dummy1, liT, dummy2, decl) \
WX_DECLARE_LIST_WITH_DECL(elT, liT, decl)
#define WX_DECLARE_LIST_PTR_3(elT, dummy1, liT, dummy2, decl) \
WX_DECLARE_LIST_3(elT, dummy1, liT, dummy2, decl)
#define WX_DECLARE_LIST_2(elT, liT, dummy, decl) \
WX_DECLARE_LIST_WITH_DECL(elT, liT, decl)
#define WX_DECLARE_LIST_PTR_2(elT, liT, dummy, decl) \
WX_DECLARE_LIST_2(elT, liT, dummy, decl) \
#define WX_DECLARE_LIST_WITH_DECL(elT, liT, decl) \
WX_DECLARE_LIST_XO(elT*, liT, decl)
template<class T>
class wxList_SortFunction
{
public:
wxList_SortFunction(wxSortCompareFunction f) : m_f(f) { }
bool operator()(const T& i1, const T& i2)
{ return m_f((T*)&i1, (T*)&i2) < 0; }
private:
wxSortCompareFunction m_f;
};
/*
Note 1: the outer helper class _WX_LIST_HELPER_##liT below is a workaround
for mingw 3.2.3 compiler bug that prevents a static function of liT class
from being exported into dll. A minimal code snippet reproducing the bug:
struct WXDLLIMPEXP_CORE Foo
{
static void Bar();
struct SomeInnerClass
{
friend class Foo; // comment this out to make it link
};
~Foo()
{
Bar();
}
};
The program does not link under mingw_gcc 3.2.3 producing undefined
reference to Foo::Bar() function
Note 2: the EmptyList is needed to allow having a NULL pointer-like
invalid iterator. We used to use just an uninitialized iterator object
instead but this fails with some debug/checked versions of STL, notably the
glibc version activated with _GLIBCXX_DEBUG, so we need to have a separate
invalid iterator.
*/
// the real wxList-class declaration
#define WX_DECLARE_LIST_XO(elT, liT, decl) \
decl _WX_LIST_HELPER_##liT \
{ \
typedef elT _WX_LIST_ITEM_TYPE_##liT; \
typedef std::list<elT> BaseListType; \
public: \
static BaseListType EmptyList; \
static void DeleteFunction( _WX_LIST_ITEM_TYPE_##liT X ); \
}; \
\
class liT : public std::list<elT> \
{ \
private: \
typedef std::list<elT> BaseListType; \
\
bool m_destroy; \
\
public: \
class compatibility_iterator \
{ \
private: \
friend class liT; \
\
iterator m_iter; \
liT * m_list; \
\
public: \
compatibility_iterator() \
: m_iter(_WX_LIST_HELPER_##liT::EmptyList.end()), m_list( NULL ) {} \
compatibility_iterator( liT* li, iterator i ) \
: m_iter( i ), m_list( li ) {} \
compatibility_iterator( const liT* li, iterator i ) \
: m_iter( i ), m_list( const_cast< liT* >( li ) ) {} \
\
compatibility_iterator* operator->() { return this; } \
const compatibility_iterator* operator->() const { return this; } \
\
bool operator==(const compatibility_iterator& i) const \
{ \
wxASSERT_MSG( m_list && i.m_list, \
wxT("comparing invalid iterators is illegal") ); \
return (m_list == i.m_list) && (m_iter == i.m_iter); \
} \
bool operator!=(const compatibility_iterator& i) const \
{ return !( operator==( i ) ); } \
operator bool() const \
{ return m_list ? m_iter != m_list->end() : false; } \
bool operator !() const \
{ return !( operator bool() ); } \
\
elT GetData() const \
{ return *m_iter; } \
void SetData( elT e ) \
{ *m_iter = e; } \
\
compatibility_iterator GetNext() const \
{ \
iterator i = m_iter; \
return compatibility_iterator( m_list, ++i ); \
} \
compatibility_iterator GetPrevious() const \
{ \
if ( m_iter == m_list->begin() ) \
return compatibility_iterator(); \
\
iterator i = m_iter; \
return compatibility_iterator( m_list, --i ); \
} \
int IndexOf() const \
{ \
return *this ? (int)std::distance( m_list->begin(), m_iter ) \
: wxNOT_FOUND; \
} \
}; \
public: \
liT() : m_destroy( false ) {} \
\
compatibility_iterator Find( const elT e ) const \
{ \
liT* _this = const_cast< liT* >( this ); \
return compatibility_iterator( _this, \
std::find( _this->begin(), _this->end(), e ) ); \
} \
\
bool IsEmpty() const \
{ return empty(); } \
size_t GetCount() const \
{ return size(); } \
int Number() const \
{ return static_cast< int >( GetCount() ); } \
\
compatibility_iterator Item( size_t idx ) const \
{ \
iterator i = const_cast< liT* >(this)->begin(); \
std::advance( i, idx ); \
return compatibility_iterator( this, i ); \
} \
elT operator[](size_t idx) const \
{ \
return Item(idx).GetData(); \
} \
\
compatibility_iterator GetFirst() const \
{ \
return compatibility_iterator( this, \
const_cast< liT* >(this)->begin() ); \
} \
compatibility_iterator GetLast() const \
{ \
iterator i = const_cast< liT* >(this)->end(); \
return compatibility_iterator( this, !empty() ? --i : i ); \
} \
bool Member( elT e ) const \
{ return Find( e ); } \
compatibility_iterator Nth( int n ) const \
{ return Item( n ); } \
int IndexOf( elT e ) const \
{ return Find( e ).IndexOf(); } \
\
compatibility_iterator Append( elT e ) \
{ \
push_back( e ); \
return GetLast(); \
} \
compatibility_iterator Insert( elT e ) \
{ \
push_front( e ); \
return compatibility_iterator( this, begin() ); \
} \
compatibility_iterator Insert(const compatibility_iterator & i, elT e)\
{ \
return compatibility_iterator( this, insert( i.m_iter, e ) ); \
} \
compatibility_iterator Insert( size_t idx, elT e ) \
{ \
return compatibility_iterator( this, \
insert( Item( idx ).m_iter, e ) ); \
} \
\
void DeleteContents( bool destroy ) \
{ m_destroy = destroy; } \
bool GetDeleteContents() const \
{ return m_destroy; } \
void Erase( const compatibility_iterator& i ) \
{ \
if ( m_destroy ) \
_WX_LIST_HELPER_##liT::DeleteFunction( i->GetData() ); \
erase( i.m_iter ); \
} \
bool DeleteNode( const compatibility_iterator& i ) \
{ \
if( i ) \
{ \
Erase( i ); \
return true; \
} \
return false; \
} \
bool DeleteObject( elT e ) \
{ \
return DeleteNode( Find( e ) ); \
} \
void Clear() \
{ \
if ( m_destroy ) \
std::for_each( begin(), end(), \
_WX_LIST_HELPER_##liT::DeleteFunction ); \
clear(); \
} \
/* Workaround for broken VC6 std::list::sort() see above */ \
void Sort( wxSortCompareFunction compfunc ) \
{ sort( wxList_SortFunction<elT>(compfunc ) ); } \
~liT() { Clear(); } \
\
/* It needs access to our EmptyList */ \
friend class compatibility_iterator; \
}
#define WX_DECLARE_LIST(elementtype, listname) \
WX_DECLARE_LIST_WITH_DECL(elementtype, listname, class)
#define WX_DECLARE_LIST_PTR(elementtype, listname) \
WX_DECLARE_LIST(elementtype, listname)
#define WX_DECLARE_EXPORTED_LIST(elementtype, listname) \
WX_DECLARE_LIST_WITH_DECL(elementtype, listname, class WXDLLIMPEXP_CORE)
#define WX_DECLARE_EXPORTED_LIST_PTR(elementtype, listname) \
WX_DECLARE_EXPORTED_LIST(elementtype, listname)
#define WX_DECLARE_USER_EXPORTED_LIST(elementtype, listname, usergoo) \
WX_DECLARE_LIST_WITH_DECL(elementtype, listname, class usergoo)
#define WX_DECLARE_USER_EXPORTED_LIST_PTR(elementtype, listname, usergoo) \
WX_DECLARE_USER_EXPORTED_LIST(elementtype, listname, usergoo)
// this macro must be inserted in your program after
// #include "wx/listimpl.cpp"
#define WX_DEFINE_LIST(name) "don't forget to include listimpl.cpp!"
#define WX_DEFINE_EXPORTED_LIST(name) WX_DEFINE_LIST(name)
#define WX_DEFINE_USER_EXPORTED_LIST(name) WX_DEFINE_LIST(name)
#else // if !wxUSE_STD_CONTAINERS
// undef it to get rid of old, deprecated functions
#define wxLIST_COMPATIBILITY
// -----------------------------------------------------------------------------
// key stuff: a list may be optionally keyed on integer or string key
// -----------------------------------------------------------------------------
union wxListKeyValue
{
long integer;
wxString *string;
};
// a struct which may contain both types of keys
//
// implementation note: on one hand, this class allows to have only one function
// for any keyed operation instead of 2 almost equivalent. OTOH, it's needed to
// resolve ambiguity which we would otherwise have with wxStringList::Find() and
// wxList::Find(const char *).
class WXDLLIMPEXP_BASE wxListKey
{
public:
// implicit ctors
wxListKey() : m_keyType(wxKEY_NONE)
{ }
wxListKey(long i) : m_keyType(wxKEY_INTEGER)
{ m_key.integer = i; }
wxListKey(const wxString& s) : m_keyType(wxKEY_STRING)
{ m_key.string = new wxString(s); }
wxListKey(const char *s) : m_keyType(wxKEY_STRING)
{ m_key.string = new wxString(s); }
wxListKey(const wchar_t *s) : m_keyType(wxKEY_STRING)
{ m_key.string = new wxString(s); }
// accessors
wxKeyType GetKeyType() const { return m_keyType; }
const wxString GetString() const
{ wxASSERT( m_keyType == wxKEY_STRING ); return *m_key.string; }
long GetNumber() const
{ wxASSERT( m_keyType == wxKEY_INTEGER ); return m_key.integer; }
// comparison
// Note: implementation moved to list.cpp to prevent BC++ inline
// expansion warning.
bool operator==(wxListKeyValue value) const ;
// dtor
~wxListKey()
{
if ( m_keyType == wxKEY_STRING )
delete m_key.string;
}
private:
wxKeyType m_keyType;
wxListKeyValue m_key;
};
// -----------------------------------------------------------------------------
// wxNodeBase class is a (base for) node in a double linked list
// -----------------------------------------------------------------------------
extern WXDLLIMPEXP_DATA_BASE(wxListKey) wxDefaultListKey;
class WXDLLIMPEXP_FWD_BASE wxListBase;
class WXDLLIMPEXP_BASE wxNodeBase
{
friend class wxListBase;
public:
// ctor
wxNodeBase(wxListBase *list = NULL,
wxNodeBase *previous = NULL,
wxNodeBase *next = NULL,
void *data = NULL,
const wxListKey& key = wxDefaultListKey);
virtual ~wxNodeBase();
// FIXME no check is done that the list is really keyed on strings
wxString GetKeyString() const { return *m_key.string; }
long GetKeyInteger() const { return m_key.integer; }
// Necessary for some existing code
void SetKeyString(const wxString& s) { m_key.string = new wxString(s); }
void SetKeyInteger(long i) { m_key.integer = i; }
#ifdef wxLIST_COMPATIBILITY
// compatibility methods, use Get* instead.
wxDEPRECATED( wxNode *Next() const );
wxDEPRECATED( wxNode *Previous() const );
wxDEPRECATED( wxObject *Data() const );
#endif // wxLIST_COMPATIBILITY
protected:
// all these are going to be "overloaded" in the derived classes
wxNodeBase *GetNext() const { return m_next; }
wxNodeBase *GetPrevious() const { return m_previous; }
void *GetData() const { return m_data; }
void SetData(void *data) { m_data = data; }
// get 0-based index of this node within the list or wxNOT_FOUND
int IndexOf() const;
virtual void DeleteData() { }
public:
// for wxList::iterator
void** GetDataPtr() const { return &(const_cast<wxNodeBase*>(this)->m_data); }
private:
// optional key stuff
wxListKeyValue m_key;
void *m_data; // user data
wxNodeBase *m_next, // next and previous nodes in the list
*m_previous;
wxListBase *m_list; // list we belong to
wxDECLARE_NO_COPY_CLASS(wxNodeBase);
};
// -----------------------------------------------------------------------------
// a double-linked list class
// -----------------------------------------------------------------------------
class WXDLLIMPEXP_FWD_BASE wxList;
class WXDLLIMPEXP_BASE wxListBase
{
friend class wxNodeBase; // should be able to call DetachNode()
friend class wxHashTableBase; // should be able to call untyped Find()
public:
// default ctor & dtor
wxListBase(wxKeyType keyType = wxKEY_NONE)
{ Init(keyType); }
virtual ~wxListBase();
// accessors
// count of items in the list
size_t GetCount() const { return m_count; }
// return true if this list is empty
bool IsEmpty() const { return m_count == 0; }
// operations
// delete all nodes
void Clear();
// instruct it to destroy user data when deleting nodes
void DeleteContents(bool destroy) { m_destroy = destroy; }
// query if to delete
bool GetDeleteContents() const
{ return m_destroy; }
// get the keytype
wxKeyType GetKeyType() const
{ return m_keyType; }
// set the keytype (required by the serial code)
void SetKeyType(wxKeyType keyType)
{ wxASSERT( m_count==0 ); m_keyType = keyType; }
#ifdef wxLIST_COMPATIBILITY
// compatibility methods from old wxList
wxDEPRECATED( int Number() const ); // use GetCount instead.
wxDEPRECATED( wxNode *First() const ); // use GetFirst
wxDEPRECATED( wxNode *Last() const ); // use GetLast
wxDEPRECATED( wxNode *Nth(size_t n) const ); // use Item
// kludge for typesafe list migration in core classes.
wxDEPRECATED( operator wxList&() const );
#endif // wxLIST_COMPATIBILITY
protected:
// all methods here are "overloaded" in derived classes to provide compile
// time type checking
// create a node for the list of this type
virtual wxNodeBase *CreateNode(wxNodeBase *prev, wxNodeBase *next,
void *data,
const wxListKey& key = wxDefaultListKey) = 0;
// ctors
// from an array
wxListBase(size_t count, void *elements[]);
// from a sequence of objects
wxListBase(void *object, ... /* terminate with NULL */);
protected:
void Assign(const wxListBase& list)
{ Clear(); DoCopy(list); }
// get list head/tail
wxNodeBase *GetFirst() const { return m_nodeFirst; }
wxNodeBase *GetLast() const { return m_nodeLast; }
// by (0-based) index
wxNodeBase *Item(size_t index) const;
// get the list item's data
void *operator[](size_t n) const
{
wxNodeBase *node = Item(n);
return node ? node->GetData() : NULL;
}
// operations
// append to end of list
wxNodeBase *Prepend(void *object)
{ return (wxNodeBase *)wxListBase::Insert(object); }
// append to beginning of list
wxNodeBase *Append(void *object);
// insert a new item at the beginning of the list
wxNodeBase *Insert(void *object)
{ return Insert(static_cast<wxNodeBase *>(NULL), object); }
// insert a new item at the given position
wxNodeBase *Insert(size_t pos, void *object)
{ return pos == GetCount() ? Append(object)
: Insert(Item(pos), object); }
// insert before given node or at front of list if prev == NULL
wxNodeBase *Insert(wxNodeBase *prev, void *object);
// keyed append
wxNodeBase *Append(long key, void *object);
wxNodeBase *Append(const wxString& key, void *object);
// removes node from the list but doesn't delete it (returns pointer
// to the node or NULL if it wasn't found in the list)
wxNodeBase *DetachNode(wxNodeBase *node);
// delete element from list, returns false if node not found
bool DeleteNode(wxNodeBase *node);
// finds object pointer and deletes node (and object if DeleteContents
// is on), returns false if object not found
bool DeleteObject(void *object);
// search (all return NULL if item not found)
// by data
wxNodeBase *Find(const void *object) const;
// by key
wxNodeBase *Find(const wxListKey& key) const;
// get 0-based index of object or wxNOT_FOUND
int IndexOf( void *object ) const;
// this function allows the sorting of arbitrary lists by giving
// a function to compare two list elements. The list is sorted in place.
void Sort(const wxSortCompareFunction compfunc);
// functions for iterating over the list
void *FirstThat(wxListIterateFunction func);
void ForEach(wxListIterateFunction func);
void *LastThat(wxListIterateFunction func);
// for STL interface, "last" points to one after the last node
// of the controlled sequence (NULL for the end of the list)
void Reverse();
void DeleteNodes(wxNodeBase* first, wxNodeBase* last);
private:
// common part of all ctors
void Init(wxKeyType keyType = wxKEY_NONE);
// helpers
// common part of copy ctor and assignment operator
void DoCopy(const wxListBase& list);
// common part of all Append()s
wxNodeBase *AppendCommon(wxNodeBase *node);
// free node's data and node itself
void DoDeleteNode(wxNodeBase *node);
size_t m_count; // number of elements in the list
bool m_destroy; // destroy user data when deleting list items?
wxNodeBase *m_nodeFirst, // pointers to the head and tail of the list
*m_nodeLast;
wxKeyType m_keyType; // type of our keys (may be wxKEY_NONE)
};
// -----------------------------------------------------------------------------
// macros for definition of "template" list type
// -----------------------------------------------------------------------------
// Helper macro defining common iterator typedefs
#if wxUSE_STD_CONTAINERS_COMPATIBLY
#include <iterator>
#define WX_DECLARE_LIST_ITER_DIFF_AND_CATEGORY() \
typedef std::ptrdiff_t difference_type; \
typedef std::bidirectional_iterator_tag iterator_category;
#else
#define WX_DECLARE_LIST_ITER_DIFF_AND_CATEGORY()
#endif
// and now some heavy magic...
// declare a list type named 'name' and containing elements of type 'T *'
// (as a by product of macro expansion you also get wx##name##Node
// wxNode-derived type)
//
// implementation details:
// 1. We define _WX_LIST_ITEM_TYPE_##name typedef to save in it the item type
// for the list of given type - this allows us to pass only the list name
// to WX_DEFINE_LIST() even if it needs both the name and the type
//
// 2. We redefine all non-type-safe wxList functions with type-safe versions
// which don't take any space (everything is inline), but bring compile
// time error checking.
//
// 3. The macro which is usually used (WX_DECLARE_LIST) is defined in terms of
// a more generic WX_DECLARE_LIST_2 macro which, in turn, uses the most
// generic WX_DECLARE_LIST_3 one. The last macro adds a sometimes
// interesting capability to store polymorphic objects in the list and is
// particularly useful with, for example, "wxWindow *" list where the
// wxWindowBase pointers are put into the list, but wxWindow pointers are
// retrieved from it.
//
// 4. final hack is that WX_DECLARE_LIST_3 is defined in terms of
// WX_DECLARE_LIST_4 to allow defining classes without operator->() as
// it results in compiler warnings when this operator doesn't make sense
// (i.e. stored elements are not pointers)
// common part of WX_DECLARE_LIST_3 and WX_DECLARE_LIST_PTR_3
#define WX_DECLARE_LIST_4(T, Tbase, name, nodetype, classexp, ptrop) \
typedef int (*wxSortFuncFor_##name)(const T **, const T **); \
\
classexp nodetype : public wxNodeBase \
{ \
public: \
nodetype(wxListBase *list = NULL, \
nodetype *previous = NULL, \
nodetype *next = NULL, \
T *data = NULL, \
const wxListKey& key = wxDefaultListKey) \
: wxNodeBase(list, previous, next, data, key) { } \
\
nodetype *GetNext() const \
{ return (nodetype *)wxNodeBase::GetNext(); } \
nodetype *GetPrevious() const \
{ return (nodetype *)wxNodeBase::GetPrevious(); } \
\
T *GetData() const \
{ return (T *)wxNodeBase::GetData(); } \
void SetData(T *data) \
{ wxNodeBase::SetData(data); } \
\
protected: \
virtual void DeleteData() wxOVERRIDE; \
\
wxDECLARE_NO_COPY_CLASS(nodetype); \
}; \
\
classexp name : public wxListBase \
{ \
public: \
typedef nodetype Node; \
classexp compatibility_iterator \
{ \
public: \
compatibility_iterator(Node *ptr = NULL) : m_ptr(ptr) { } \
\
Node *operator->() const { return m_ptr; } \
operator Node *() const { return m_ptr; } \
\
private: \
Node *m_ptr; \
}; \
\
name(wxKeyType keyType = wxKEY_NONE) : wxListBase(keyType) \
{ } \
name(const name& list) : wxListBase(list.GetKeyType()) \
{ Assign(list); } \
name(size_t count, T *elements[]) \
: wxListBase(count, (void **)elements) { } \
\
name& operator=(const name& list) \
{ if (&list != this) Assign(list); return *this; } \
\
nodetype *GetFirst() const \
{ return (nodetype *)wxListBase::GetFirst(); } \
nodetype *GetLast() const \
{ return (nodetype *)wxListBase::GetLast(); } \
\
nodetype *Item(size_t index) const \
{ return (nodetype *)wxListBase::Item(index); } \
\
T *operator[](size_t index) const \
{ \
nodetype *node = Item(index); \
return node ? (T*)(node->GetData()) : NULL; \
} \
\
nodetype *Append(Tbase *object) \
{ return (nodetype *)wxListBase::Append(object); } \
nodetype *Insert(Tbase *object) \
{ return (nodetype *)Insert(static_cast<nodetype *>(NULL), \
object); } \
nodetype *Insert(size_t pos, Tbase *object) \
{ return (nodetype *)wxListBase::Insert(pos, object); } \
nodetype *Insert(nodetype *prev, Tbase *object) \
{ return (nodetype *)wxListBase::Insert(prev, object); } \
\
nodetype *Append(long key, void *object) \
{ return (nodetype *)wxListBase::Append(key, object); } \
nodetype *Append(const wxChar *key, void *object) \
{ return (nodetype *)wxListBase::Append(key, object); } \
\
nodetype *DetachNode(nodetype *node) \
{ return (nodetype *)wxListBase::DetachNode(node); } \
bool DeleteNode(nodetype *node) \
{ return wxListBase::DeleteNode(node); } \
bool DeleteObject(Tbase *object) \
{ return wxListBase::DeleteObject(object); } \
void Erase(nodetype *it) \
{ DeleteNode(it); } \
\
nodetype *Find(const Tbase *object) const \
{ return (nodetype *)wxListBase::Find(object); } \
\
virtual nodetype *Find(const wxListKey& key) const \
{ return (nodetype *)wxListBase::Find(key); } \
\
bool Member(const Tbase *object) const \
{ return Find(object) != NULL; } \
\
int IndexOf(Tbase *object) const \
{ return wxListBase::IndexOf(object); } \
\
void Sort(wxSortCompareFunction func) \
{ wxListBase::Sort(func); } \
void Sort(wxSortFuncFor_##name func) \
{ Sort((wxSortCompareFunction)func); } \
\
protected: \
virtual wxNodeBase *CreateNode(wxNodeBase *prev, wxNodeBase *next, \
void *data, \
const wxListKey& key = wxDefaultListKey) \
wxOVERRIDE \
{ \
return new nodetype(this, \
(nodetype *)prev, (nodetype *)next, \
(T *)data, key); \
} \
/* STL interface */ \
public: \
typedef size_t size_type; \
typedef int difference_type; \
typedef T* value_type; \
typedef Tbase* base_value_type; \
typedef value_type& reference; \
typedef const value_type& const_reference; \
typedef base_value_type& base_reference; \
typedef const base_value_type& const_base_reference; \
\
classexp iterator \
{ \
public: \
WX_DECLARE_LIST_ITER_DIFF_AND_CATEGORY() \
typedef T* value_type; \
typedef value_type* pointer; \
typedef value_type& reference; \
\
typedef nodetype Node; \
typedef iterator itor; \
\
Node* m_node; \
Node* m_init; \
public: \
/* Compatibility typedefs, don't use */ \
typedef reference reference_type; \
typedef pointer pointer_type; \
\
iterator(Node* node, Node* init) : m_node(node), m_init(init) {}\
iterator() : m_node(NULL), m_init(NULL) { } \
reference_type operator*() const \
{ return *(pointer_type)m_node->GetDataPtr(); } \
ptrop \
itor& operator++() \
{ \
wxASSERT_MSG( m_node, wxT("uninitialized iterator") ); \
m_node = m_node->GetNext(); \
return *this; \
} \
const itor operator++(int) \
{ \
itor tmp = *this; \
wxASSERT_MSG( m_node, wxT("uninitialized iterator") ); \
m_node = m_node->GetNext(); \
return tmp; \
} \
itor& operator--() \
{ \
m_node = m_node ? m_node->GetPrevious() : m_init; \
return *this; \
} \
const itor operator--(int) \
{ \
itor tmp = *this; \
m_node = m_node ? m_node->GetPrevious() : m_init; \
return tmp; \
} \
bool operator!=(const itor& it) const \
{ return it.m_node != m_node; } \
bool operator==(const itor& it) const \
{ return it.m_node == m_node; } \
}; \
classexp const_iterator \
{ \
public: \
WX_DECLARE_LIST_ITER_DIFF_AND_CATEGORY() \
typedef T* value_type; \
typedef const value_type* pointer; \
typedef const value_type& reference; \
\
typedef nodetype Node; \
typedef const_iterator itor; \
\
Node* m_node; \
Node* m_init; \
public: \
typedef reference reference_type; \
typedef pointer pointer_type; \
\
const_iterator(Node* node, Node* init) \
: m_node(node), m_init(init) { } \
const_iterator() : m_node(NULL), m_init(NULL) { } \
const_iterator(const iterator& it) \
: m_node(it.m_node), m_init(it.m_init) { } \
reference_type operator*() const \
{ return *(pointer_type)m_node->GetDataPtr(); } \
ptrop \
itor& operator++() \
{ \
wxASSERT_MSG( m_node, wxT("uninitialized iterator") ); \
m_node = m_node->GetNext(); \
return *this; \
} \
const itor operator++(int) \
{ \
itor tmp = *this; \
wxASSERT_MSG( m_node, wxT("uninitialized iterator") ); \
m_node = m_node->GetNext(); \
return tmp; \
} \
itor& operator--() \
{ \
m_node = m_node ? m_node->GetPrevious() : m_init; \
return *this; \
} \
const itor operator--(int) \
{ \
itor tmp = *this; \
m_node = m_node ? m_node->GetPrevious() : m_init; \
return tmp; \
} \
bool operator!=(const itor& it) const \
{ return it.m_node != m_node; } \
bool operator==(const itor& it) const \
{ return it.m_node == m_node; } \
}; \
classexp reverse_iterator \
{ \
public: \
WX_DECLARE_LIST_ITER_DIFF_AND_CATEGORY() \
typedef T* value_type; \
typedef value_type* pointer; \
typedef value_type& reference; \
\
typedef nodetype Node; \
typedef reverse_iterator itor; \
\
Node* m_node; \
Node* m_init; \
public: \
typedef reference reference_type; \
typedef pointer pointer_type; \
\
reverse_iterator(Node* node, Node* init) \
: m_node(node), m_init(init) { } \
reverse_iterator() : m_node(NULL), m_init(NULL) { } \
reference_type operator*() const \
{ return *(pointer_type)m_node->GetDataPtr(); } \
ptrop \
itor& operator++() \
{ m_node = m_node->GetPrevious(); return *this; } \
const itor operator++(int) \
{ itor tmp = *this; m_node = m_node->GetPrevious(); return tmp; }\
itor& operator--() \
{ m_node = m_node ? m_node->GetNext() : m_init; return *this; } \
const itor operator--(int) \
{ \
itor tmp = *this; \
m_node = m_node ? m_node->GetNext() : m_init; \
return tmp; \
} \
bool operator!=(const itor& it) const \
{ return it.m_node != m_node; } \
bool operator==(const itor& it) const \
{ return it.m_node == m_node; } \
}; \
classexp const_reverse_iterator \
{ \
public: \
WX_DECLARE_LIST_ITER_DIFF_AND_CATEGORY() \
typedef T* value_type; \
typedef const value_type* pointer; \
typedef const value_type& reference; \
\
typedef nodetype Node; \
typedef const_reverse_iterator itor; \
\
Node* m_node; \
Node* m_init; \
public: \
typedef reference reference_type; \
typedef pointer pointer_type; \
\
const_reverse_iterator(Node* node, Node* init) \
: m_node(node), m_init(init) { } \
const_reverse_iterator() : m_node(NULL), m_init(NULL) { } \
const_reverse_iterator(const reverse_iterator& it) \
: m_node(it.m_node), m_init(it.m_init) { } \
reference_type operator*() const \
{ return *(pointer_type)m_node->GetDataPtr(); } \
ptrop \
itor& operator++() \
{ m_node = m_node->GetPrevious(); return *this; } \
const itor operator++(int) \
{ itor tmp = *this; m_node = m_node->GetPrevious(); return tmp; }\
itor& operator--() \
{ m_node = m_node ? m_node->GetNext() : m_init; return *this;}\
const itor operator--(int) \
{ \
itor tmp = *this; \
m_node = m_node ? m_node->GetNext() : m_init; \
return tmp; \
} \
bool operator!=(const itor& it) const \
{ return it.m_node != m_node; } \
bool operator==(const itor& it) const \
{ return it.m_node == m_node; } \
}; \
\
explicit name(size_type n, const_reference v = value_type()) \
{ assign(n, v); } \
name(const const_iterator& first, const const_iterator& last) \
{ assign(first, last); } \
iterator begin() { return iterator(GetFirst(), GetLast()); } \
const_iterator begin() const \
{ return const_iterator(GetFirst(), GetLast()); } \
iterator end() { return iterator(NULL, GetLast()); } \
const_iterator end() const { return const_iterator(NULL, GetLast()); }\
reverse_iterator rbegin() \
{ return reverse_iterator(GetLast(), GetFirst()); } \
const_reverse_iterator rbegin() const \
{ return const_reverse_iterator(GetLast(), GetFirst()); } \
reverse_iterator rend() { return reverse_iterator(NULL, GetFirst()); }\
const_reverse_iterator rend() const \
{ return const_reverse_iterator(NULL, GetFirst()); } \
void resize(size_type n, value_type v = value_type()) \
{ \
while (n < size()) \
pop_back(); \
while (n > size()) \
push_back(v); \
} \
size_type size() const { return GetCount(); } \
size_type max_size() const { return INT_MAX; } \
bool empty() const { return IsEmpty(); } \
reference front() { return *begin(); } \
const_reference front() const { return *begin(); } \
reference back() { iterator tmp = end(); return *--tmp; } \
const_reference back() const { const_iterator tmp = end(); return *--tmp; }\
void push_front(const_reference v = value_type()) \
{ Insert(GetFirst(), (const_base_reference)v); } \
void pop_front() { DeleteNode(GetFirst()); } \
void push_back(const_reference v = value_type()) \
{ Append((const_base_reference)v); } \
void pop_back() { DeleteNode(GetLast()); } \
void assign(const_iterator first, const const_iterator& last) \
{ \
clear(); \
for(; first != last; ++first) \
Append((const_base_reference)*first); \
} \
void assign(size_type n, const_reference v = value_type()) \
{ \
clear(); \
for(size_type i = 0; i < n; ++i) \
Append((const_base_reference)v); \
} \
iterator insert(const iterator& it, const_reference v) \
{ \
if ( it == end() ) \
{ \
Append((const_base_reference)v); \
/* \
note that this is the new end(), the old one was \
invalidated by the Append() call, and this is why we \
can't use the same code as in the normal case below \
*/ \
iterator itins(end()); \
return --itins; \
} \
else \
{ \
Insert(it.m_node, (const_base_reference)v); \
iterator itins(it); \
return --itins; \
} \
} \
void insert(const iterator& it, size_type n, const_reference v) \
{ \
for(size_type i = 0; i < n; ++i) \
insert(it, v); \
} \
void insert(const iterator& it, \
const_iterator first, const const_iterator& last) \
{ \
for(; first != last; ++first) \
insert(it, *first); \
} \
iterator erase(const iterator& it) \
{ \
iterator next = iterator(it.m_node->GetNext(), GetLast()); \
DeleteNode(it.m_node); return next; \
} \
iterator erase(const iterator& first, const iterator& last) \
{ \
iterator next = last; \
if ( next != end() ) \
++next; \
DeleteNodes(first.m_node, last.m_node); \
return next; \
} \
void clear() { Clear(); } \
void splice(const iterator& it, name& l, const iterator& first, const iterator& last)\
{ insert(it, first, last); l.erase(first, last); } \
void splice(const iterator& it, name& l) \
{ splice(it, l, l.begin(), l.end() ); } \
void splice(const iterator& it, name& l, const iterator& first) \
{ \
if ( it != first ) \
{ \
insert(it, *first); \
l.erase(first); \
} \
} \
void remove(const_reference v) \
{ DeleteObject((const_base_reference)v); } \
void reverse() \
{ Reverse(); } \
/* void swap(name& l) \
{ \
{ size_t t = m_count; m_count = l.m_count; l.m_count = t; } \
{ bool t = m_destroy; m_destroy = l.m_destroy; l.m_destroy = t; }\
{ wxNodeBase* t = m_nodeFirst; m_nodeFirst = l.m_nodeFirst; l.m_nodeFirst = t; }\
{ wxNodeBase* t = m_nodeLast; m_nodeLast = l.m_nodeLast; l.m_nodeLast = t; }\
{ wxKeyType t = m_keyType; m_keyType = l.m_keyType; l.m_keyType = t; }\
} */ \
}
#define WX_LIST_PTROP \
pointer_type operator->() const \
{ return (pointer_type)m_node->GetDataPtr(); }
#define WX_LIST_PTROP_NONE
#define WX_DECLARE_LIST_3(T, Tbase, name, nodetype, classexp) \
WX_DECLARE_LIST_4(T, Tbase, name, nodetype, classexp, WX_LIST_PTROP_NONE)
#define WX_DECLARE_LIST_PTR_3(T, Tbase, name, nodetype, classexp) \
WX_DECLARE_LIST_4(T, Tbase, name, nodetype, classexp, WX_LIST_PTROP)
#define WX_DECLARE_LIST_2(elementtype, listname, nodename, classexp) \
WX_DECLARE_LIST_3(elementtype, elementtype, listname, nodename, classexp)
#define WX_DECLARE_LIST_PTR_2(elementtype, listname, nodename, classexp) \
WX_DECLARE_LIST_PTR_3(elementtype, elementtype, listname, nodename, classexp)
#define WX_DECLARE_LIST(elementtype, listname) \
typedef elementtype _WX_LIST_ITEM_TYPE_##listname; \
WX_DECLARE_LIST_2(elementtype, listname, wx##listname##Node, class)
#define WX_DECLARE_LIST_PTR(elementtype, listname) \
typedef elementtype _WX_LIST_ITEM_TYPE_##listname; \
WX_DECLARE_LIST_PTR_2(elementtype, listname, wx##listname##Node, class)
#define WX_DECLARE_LIST_WITH_DECL(elementtype, listname, decl) \
typedef elementtype _WX_LIST_ITEM_TYPE_##listname; \
WX_DECLARE_LIST_2(elementtype, listname, wx##listname##Node, decl)
#define WX_DECLARE_EXPORTED_LIST(elementtype, listname) \
WX_DECLARE_LIST_WITH_DECL(elementtype, listname, class WXDLLIMPEXP_CORE)
#define WX_DECLARE_EXPORTED_LIST_PTR(elementtype, listname) \
typedef elementtype _WX_LIST_ITEM_TYPE_##listname; \
WX_DECLARE_LIST_PTR_2(elementtype, listname, wx##listname##Node, class WXDLLIMPEXP_CORE)
#define WX_DECLARE_USER_EXPORTED_LIST(elementtype, listname, usergoo) \
typedef elementtype _WX_LIST_ITEM_TYPE_##listname; \
WX_DECLARE_LIST_2(elementtype, listname, wx##listname##Node, class usergoo)
#define WX_DECLARE_USER_EXPORTED_LIST_PTR(elementtype, listname, usergoo) \
typedef elementtype _WX_LIST_ITEM_TYPE_##listname; \
WX_DECLARE_LIST_PTR_2(elementtype, listname, wx##listname##Node, class usergoo)
// this macro must be inserted in your program after
// #include "wx/listimpl.cpp"
#define WX_DEFINE_LIST(name) "don't forget to include listimpl.cpp!"
#define WX_DEFINE_EXPORTED_LIST(name) WX_DEFINE_LIST(name)
#define WX_DEFINE_USER_EXPORTED_LIST(name) WX_DEFINE_LIST(name)
#endif // !wxUSE_STD_CONTAINERS
// ============================================================================
// now we can define classes 100% compatible with the old ones
// ============================================================================
// ----------------------------------------------------------------------------
// commonly used list classes
// ----------------------------------------------------------------------------
#if defined(wxLIST_COMPATIBILITY)
// inline compatibility functions
#if !wxUSE_STD_CONTAINERS
// ----------------------------------------------------------------------------
// wxNodeBase deprecated methods
// ----------------------------------------------------------------------------
inline wxNode *wxNodeBase::Next() const { return (wxNode *)GetNext(); }
inline wxNode *wxNodeBase::Previous() const { return (wxNode *)GetPrevious(); }
inline wxObject *wxNodeBase::Data() const { return (wxObject *)GetData(); }
// ----------------------------------------------------------------------------
// wxListBase deprecated methods
// ----------------------------------------------------------------------------
inline int wxListBase::Number() const { return (int)GetCount(); }
inline wxNode *wxListBase::First() const { return (wxNode *)GetFirst(); }
inline wxNode *wxListBase::Last() const { return (wxNode *)GetLast(); }
inline wxNode *wxListBase::Nth(size_t n) const { return (wxNode *)Item(n); }
inline wxListBase::operator wxList&() const { return *(wxList*)this; }
#endif
// define this to make a lot of noise about use of the old wxList classes.
//#define wxWARN_COMPAT_LIST_USE
// ----------------------------------------------------------------------------
// wxList compatibility class: in fact, it's a list of wxObjects
// ----------------------------------------------------------------------------
WX_DECLARE_LIST_2(wxObject, wxObjectList, wxObjectListNode,
class WXDLLIMPEXP_BASE);
class WXDLLIMPEXP_BASE wxList : public wxObjectList
{
public:
#if defined(wxWARN_COMPAT_LIST_USE) && !wxUSE_STD_CONTAINERS
wxList() { }
wxDEPRECATED( wxList(int key_type) );
#elif !wxUSE_STD_CONTAINERS
wxList(int key_type = wxKEY_NONE);
#endif
// this destructor is required for Darwin
~wxList() { }
#if !wxUSE_STD_CONTAINERS
wxList& operator=(const wxList& list)
{ if (&list != this) Assign(list); return *this; }
// compatibility methods
void Sort(wxSortCompareFunction compfunc) { wxListBase::Sort(compfunc); }
#endif // !wxUSE_STD_CONTAINERS
template<typename T>
wxVector<T> AsVector() const
{
wxVector<T> vector(size());
size_t i = 0;
for ( const_iterator it = begin(); it != end(); ++it )
{
vector[i++] = static_cast<T>(*it);
}
return vector;
}
};
#if !wxUSE_STD_CONTAINERS
// -----------------------------------------------------------------------------
// wxStringList class for compatibility with the old code
// -----------------------------------------------------------------------------
WX_DECLARE_LIST_2(wxChar, wxStringListBase, wxStringListNode, class WXDLLIMPEXP_BASE);
class WXDLLIMPEXP_BASE wxStringList : public wxStringListBase
{
public:
// ctors and such
// default
#ifdef wxWARN_COMPAT_LIST_USE
wxStringList();
wxDEPRECATED( wxStringList(const wxChar *first ...) ); // FIXME-UTF8
#else
wxStringList();
wxStringList(const wxChar *first ...); // FIXME-UTF8
#endif
// copying the string list: the strings are copied, too (extremely
// inefficient!)
wxStringList(const wxStringList& other) : wxStringListBase() { DeleteContents(true); DoCopy(other); }
wxStringList& operator=(const wxStringList& other)
{
if (&other != this)
{
Clear();
DoCopy(other);
}
return *this;
}
// operations
// makes a copy of the string
wxNode *Add(const wxChar *s);
// Append to beginning of list
wxNode *Prepend(const wxChar *s);
bool Delete(const wxChar *s);
wxChar **ListToArray(bool new_copies = false) const;
bool Member(const wxChar *s) const;
// alphabetic sort
void Sort();
private:
void DoCopy(const wxStringList&); // common part of copy ctor and operator=
};
#else // if wxUSE_STD_CONTAINERS
WX_DECLARE_LIST_XO(wxString, wxStringListBase, class WXDLLIMPEXP_BASE);
class WXDLLIMPEXP_BASE wxStringList : public wxStringListBase
{
public:
compatibility_iterator Append(wxChar* s)
{ wxString tmp = s; delete[] s; return wxStringListBase::Append(tmp); }
compatibility_iterator Insert(wxChar* s)
{ wxString tmp = s; delete[] s; return wxStringListBase::Insert(tmp); }
compatibility_iterator Insert(size_t pos, wxChar* s)
{
wxString tmp = s;
delete[] s;
return wxStringListBase::Insert(pos, tmp);
}
compatibility_iterator Add(const wxChar* s)
{ push_back(s); return GetLast(); }
compatibility_iterator Prepend(const wxChar* s)
{ push_front(s); return GetFirst(); }
};
#endif // wxUSE_STD_CONTAINERS
#endif // wxLIST_COMPATIBILITY
// delete all list elements
//
// NB: the class declaration of the list elements must be visible from the
// place where you use this macro, otherwise the proper destructor may not
// be called (a decent compiler should give a warning about it, but don't
// count on it)!
#define WX_CLEAR_LIST(type, list) \
{ \
type::iterator it, en; \
for( it = (list).begin(), en = (list).end(); it != en; ++it ) \
delete *it; \
(list).clear(); \
}
// append all element of one list to another one
#define WX_APPEND_LIST(list, other) \
{ \
wxList::compatibility_iterator node = other->GetFirst(); \
while ( node ) \
{ \
(list)->push_back(node->GetData()); \
node = node->GetNext(); \
} \
}
#endif // _WX_LISTH__
| h |
rticonnextdds-usecases | data/projects/rticonnextdds-usecases/VehicleTracking/ExampleCode/thirdparty/wxWidgets-3.1.2/Linux/include/wx/richtooltip.h | ///////////////////////////////////////////////////////////////////////////////
// Name: wx/richtooltip.h
// Purpose: Declaration of wxRichToolTip class.
// Author: Vadim Zeitlin
// Created: 2011-10-07
// Copyright: (c) 2011 Vadim Zeitlin <[email protected]>
// Licence: wxWindows licence
///////////////////////////////////////////////////////////////////////////////
#ifndef _WX_RICHTOOLTIP_H_
#define _WX_RICHTOOLTIP_H_
#include "wx/defs.h"
#if wxUSE_RICHTOOLTIP
#include "wx/colour.h"
class WXDLLIMPEXP_FWD_CORE wxFont;
class WXDLLIMPEXP_FWD_CORE wxIcon;
class WXDLLIMPEXP_FWD_CORE wxWindow;
class wxRichToolTipImpl;
// This enum describes the kind of the tip shown which combines both the tip
// position and appearance because the two are related (when the tip is
// positioned asymmetrically, a right handed triangle is used but an
// equilateral one when it's in the middle of a side).
//
// Automatic selects the tip appearance best suited for the current platform
// and the position best suited for the window the tooltip is shown for, i.e.
// chosen in such a way that the tooltip is always fully on screen.
//
// Other values describe the position of the tooltip itself, not the window it
// relates to. E.g. wxTipKind_Top places the tip on the top of the tooltip and
// so the tooltip itself is located beneath its associated window.
enum wxTipKind
{
wxTipKind_None,
wxTipKind_TopLeft,
wxTipKind_Top,
wxTipKind_TopRight,
wxTipKind_BottomLeft,
wxTipKind_Bottom,
wxTipKind_BottomRight,
wxTipKind_Auto
};
// ----------------------------------------------------------------------------
// wxRichToolTip: a customizable but not necessarily native tooltip.
// ----------------------------------------------------------------------------
// Notice that this class does not inherit from wxWindow.
class WXDLLIMPEXP_ADV wxRichToolTip
{
public:
// Ctor must specify the tooltip title and main message, additional
// attributes can be set later.
wxRichToolTip(const wxString& title, const wxString& message);
// Set the background colour: if two colours are specified, the background
// is drawn using a gradient from top to bottom, otherwise a single solid
// colour is used.
void SetBackgroundColour(const wxColour& col,
const wxColour& colEnd = wxColour());
// Set the small icon to show: either one of the standard information/
// warning/error ones (the question icon doesn't make sense for a tooltip)
// or a custom icon.
void SetIcon(int icon = wxICON_INFORMATION);
void SetIcon(const wxIcon& icon);
// Set timeout after which the tooltip should disappear, in milliseconds.
// By default the tooltip is hidden after system-dependent interval of time
// elapses but this method can be used to change this or also disable
// hiding the tooltip automatically entirely by passing 0 in this parameter
// (but doing this can result in native version not being used).
// Optionally specify a show delay.
void SetTimeout(unsigned milliseconds, unsigned millisecondsShowdelay = 0);
// Choose the tip kind, possibly none. By default the tip is positioned
// automatically, as if wxTipKind_Auto was used.
void SetTipKind(wxTipKind tipKind);
// Set the title text font. By default it's emphasized using the font style
// or colour appropriate for the current platform.
void SetTitleFont(const wxFont& font);
// Show the tooltip for the given window and optionally a specified area.
void ShowFor(wxWindow* win, const wxRect* rect = NULL);
// Non-virtual dtor as this class is not supposed to be derived from.
~wxRichToolTip();
private:
wxRichToolTipImpl* const m_impl;
wxDECLARE_NO_COPY_CLASS(wxRichToolTip);
};
#endif // wxUSE_RICHTOOLTIP
#endif // _WX_RICHTOOLTIP_H_
| h |
rticonnextdds-usecases | data/projects/rticonnextdds-usecases/VehicleTracking/ExampleCode/thirdparty/wxWidgets-3.1.2/Linux/include/wx/evtloop.h | ///////////////////////////////////////////////////////////////////////////////
// Name: wx/evtloop.h
// Purpose: declares wxEventLoop class
// Author: Vadim Zeitlin
// Modified by:
// Created: 01.06.01
// Copyright: (c) 2001 Vadim Zeitlin <[email protected]>
// Licence: wxWindows licence
///////////////////////////////////////////////////////////////////////////////
#ifndef _WX_EVTLOOP_H_
#define _WX_EVTLOOP_H_
#include "wx/event.h"
#include "wx/utils.h"
// TODO: implement wxEventLoopSource for MSW (it should wrap a HANDLE and be
// monitored using MsgWaitForMultipleObjects())
#if defined(__WXOSX__) || (defined(__UNIX__) && !defined(__WINDOWS__))
#define wxUSE_EVENTLOOP_SOURCE 1
#else
#define wxUSE_EVENTLOOP_SOURCE 0
#endif
#if wxUSE_EVENTLOOP_SOURCE
class wxEventLoopSource;
class wxEventLoopSourceHandler;
#endif
/*
NOTE ABOUT wxEventLoopBase::YieldFor LOGIC
------------------------------------------
The YieldFor() function helps to avoid re-entrancy problems and problems
caused by out-of-order event processing
(see "wxYield-like problems" and "wxProgressDialog+threading BUG" wx-dev threads).
The logic behind YieldFor() is simple: it analyzes the queue of the native
events generated by the underlying GUI toolkit and picks out and processes
only those matching the given mask.
It's important to note that YieldFor() is used to selectively process the
events generated by the NATIVE toolkit.
Events syntethized by wxWidgets code or by user code are instead selectively
processed thanks to the logic built into wxEvtHandler::ProcessPendingEvents().
In fact, when wxEvtHandler::ProcessPendingEvents gets called from inside a
YieldFor() call, wxEventLoopBase::IsEventAllowedInsideYield is used to decide
if the pending events for that event handler can be processed.
If all the pending events associated with that event handler result as "not processable",
the event handler "delays" itself calling wxEventLoopBase::DelayPendingEventHandler
(so it's moved: m_handlersWithPendingEvents => m_handlersWithPendingDelayedEvents).
Last, wxEventLoopBase::ProcessPendingEvents() before exiting moves the delayed
event handlers back into the list of handlers with pending events
(m_handlersWithPendingDelayedEvents => m_handlersWithPendingEvents) so that
a later call to ProcessPendingEvents() (possibly outside the YieldFor() call)
will process all pending events as usual.
*/
// ----------------------------------------------------------------------------
// wxEventLoopBase: interface for wxEventLoop
// ----------------------------------------------------------------------------
class WXDLLIMPEXP_BASE wxEventLoopBase
{
public:
wxEventLoopBase();
virtual ~wxEventLoopBase();
// use this to check whether the event loop was successfully created before
// using it
virtual bool IsOk() const { return true; }
// returns true if this is the main loop
bool IsMain() const;
#if wxUSE_EVENTLOOP_SOURCE
// create a new event loop source wrapping the given file descriptor and
// monitor it for events occurring on this descriptor in all event loops
static wxEventLoopSource *
AddSourceForFD(int fd, wxEventLoopSourceHandler *handler, int flags);
#endif // wxUSE_EVENTLOOP_SOURCE
// dispatch&processing
// -------------------
// start the event loop, return the exit code when it is finished
//
// notice that wx ports should override DoRun(), this method is virtual
// only to allow overriding it in the user code for custom event loops
virtual int Run();
// is this event loop running now?
//
// notice that even if this event loop hasn't terminated yet but has just
// spawned a nested (e.g. modal) event loop, this would return false
bool IsRunning() const;
// exit from the loop with the given exit code
//
// this can be only used to exit the currently running loop, use
// ScheduleExit() if this might not be the case
virtual void Exit(int rc = 0);
// ask the event loop to exit with the given exit code, can be used even if
// this loop is not running right now but the loop must have been started,
// i.e. Run() should have been already called
virtual void ScheduleExit(int rc = 0) = 0;
// return true if any events are available
virtual bool Pending() const = 0;
// dispatch a single event, return false if we should exit from the loop
virtual bool Dispatch() = 0;
// same as Dispatch() but doesn't wait for longer than the specified (in
// ms) timeout, return true if an event was processed, false if we should
// exit the loop or -1 if timeout expired
virtual int DispatchTimeout(unsigned long timeout) = 0;
// implement this to wake up the loop: usually done by posting a dummy event
// to it (can be called from non main thread)
virtual void WakeUp() = 0;
// idle handling
// -------------
// make sure that idle events are sent again: this is just an obsolete
// synonym for WakeUp()
void WakeUpIdle() { WakeUp(); }
// this virtual function is called when the application
// becomes idle and by default it forwards to wxApp::ProcessIdle() and
// while it can be overridden in a custom event loop, you must call the
// base class version to ensure that idle events are still generated
//
// it should return true if more idle events are needed, false if not
virtual bool ProcessIdle();
// Yield-related hooks
// -------------------
// process all currently pending events right now
//
// if onlyIfNeeded is true, returns false without doing anything else if
// we're already inside Yield()
//
// WARNING: this function is dangerous as it can lead to unexpected
// reentrancies (i.e. when called from an event handler it
// may result in calling the same event handler again), use
// with _extreme_ care or, better, don't use at all!
bool Yield(bool onlyIfNeeded = false);
// more selective version of Yield()
//
// notice that it is virtual for backwards-compatibility but new code
// should override DoYieldFor() and not YieldFor() itself
virtual bool YieldFor(long eventsToProcess);
// returns true if the main thread is inside a Yield() call
virtual bool IsYielding() const
{ return m_yieldLevel != 0; }
// returns true if events of the given event category should be immediately
// processed inside a wxApp::Yield() call or rather should be queued for
// later processing by the main event loop
virtual bool IsEventAllowedInsideYield(wxEventCategory cat) const
{ return (m_eventsToProcessInsideYield & cat) != 0; }
// no SafeYield hooks since it uses wxWindow which is not available when wxUSE_GUI=0
// active loop
// -----------
// return currently active (running) event loop, may be NULL
static wxEventLoopBase *GetActive() { return ms_activeLoop; }
// set currently active (running) event loop
static void SetActive(wxEventLoopBase* loop);
protected:
// real implementation of Run()
virtual int DoRun() = 0;
// And the real, port-specific, implementation of YieldFor().
//
// The base class version is pure virtual to ensure that it is overridden
// in the derived classes but does have an implementation which processes
// pending events in wxApp if eventsToProcess allows it, and so should be
// called from the overridden version at an appropriate place (i.e. after
// processing the native events but before doing anything else that could
// be affected by pending events dispatching).
virtual void DoYieldFor(long eventsToProcess) = 0;
// this function should be called before the event loop terminates, whether
// this happens normally (because of Exit() call) or abnormally (because of
// an exception thrown from inside the loop)
virtual void OnExit();
// Return true if we're currently inside our Run(), even if another nested
// event loop is currently running, unlike IsRunning() (which should have
// been really called IsActive() but it's too late to change this now).
bool IsInsideRun() const { return m_isInsideRun; }
// the pointer to currently active loop
static wxEventLoopBase *ms_activeLoop;
// should we exit the loop?
bool m_shouldExit;
// incremented each time on entering Yield() and decremented on leaving it
int m_yieldLevel;
// the argument of the last call to YieldFor()
long m_eventsToProcessInsideYield;
private:
// this flag is set on entry into Run() and reset before leaving it
bool m_isInsideRun;
wxDECLARE_NO_COPY_CLASS(wxEventLoopBase);
};
#if defined(__WINDOWS__) || defined(__WXMAC__) || defined(__WXDFB__) || (defined(__UNIX__) && !defined(__WXOSX__))
// this class can be used to implement a standard event loop logic using
// Pending() and Dispatch()
//
// it also handles idle processing automatically
class WXDLLIMPEXP_BASE wxEventLoopManual : public wxEventLoopBase
{
public:
wxEventLoopManual();
// sets the "should exit" flag and wakes up the loop so that it terminates
// soon
virtual void ScheduleExit(int rc = 0) wxOVERRIDE;
protected:
// enters a loop calling OnNextIteration(), Pending() and Dispatch() and
// terminating when Exit() is called
virtual int DoRun() wxOVERRIDE;
// may be overridden to perform some action at the start of each new event
// loop iteration
virtual void OnNextIteration() { }
// the loop exit code
int m_exitcode;
private:
// process all already pending events and dispatch a new one (blocking
// until it appears in the event queue if necessary)
//
// returns the return value of Dispatch()
bool ProcessEvents();
wxDECLARE_NO_COPY_CLASS(wxEventLoopManual);
};
#endif // platforms using "manual" loop
// we're moving away from old m_impl wxEventLoop model as otherwise the user
// code doesn't have access to platform-specific wxEventLoop methods and this
// can sometimes be very useful (e.g. under MSW this is necessary for
// integration with MFC) but currently this is not done for all ports yet (e.g.
// wxX11) so fall back to the old wxGUIEventLoop definition below for them
#if defined(__DARWIN__)
// CoreFoundation-based event loop is currently in wxBase so include it in
// any case too (although maybe it actually shouldn't be there at all)
#include "wx/osx/core/evtloop.h"
#endif
// include the header defining wxConsoleEventLoop
#if defined(__UNIX__) && !defined(__WINDOWS__)
#include "wx/unix/evtloop.h"
#elif defined(__WINDOWS__)
#include "wx/msw/evtloopconsole.h"
#endif
#if wxUSE_GUI
// include the appropriate header defining wxGUIEventLoop
#if defined(__WXMSW__)
#include "wx/msw/evtloop.h"
#elif defined(__WXOSX__)
#include "wx/osx/evtloop.h"
#elif defined(__WXDFB__)
#include "wx/dfb/evtloop.h"
#elif defined(__WXGTK20__)
#include "wx/gtk/evtloop.h"
#elif defined(__WXQT__)
#include "wx/qt/evtloop.h"
#else // other platform
#include "wx/stopwatch.h" // for wxMilliClock_t
class WXDLLIMPEXP_FWD_CORE wxEventLoopImpl;
class WXDLLIMPEXP_CORE wxGUIEventLoop : public wxEventLoopBase
{
public:
wxGUIEventLoop() { m_impl = NULL; }
virtual ~wxGUIEventLoop();
virtual void ScheduleExit(int rc = 0);
virtual bool Pending() const;
virtual bool Dispatch();
virtual int DispatchTimeout(unsigned long timeout)
{
// TODO: this is, of course, horribly inefficient and a proper wait with
// timeout should be implemented for all ports natively...
const wxMilliClock_t timeEnd = wxGetLocalTimeMillis() + timeout;
for ( ;; )
{
if ( Pending() )
return Dispatch();
if ( wxGetLocalTimeMillis() >= timeEnd )
return -1;
}
}
virtual void WakeUp() { }
protected:
virtual int DoRun();
virtual void DoYieldFor(long eventsToProcess);
// the pointer to the port specific implementation class
wxEventLoopImpl *m_impl;
wxDECLARE_NO_COPY_CLASS(wxGUIEventLoop);
};
#endif // platforms
#endif // wxUSE_GUI
#if wxUSE_GUI
// we use a class rather than a typedef because wxEventLoop is
// forward-declared in many places
class wxEventLoop : public wxGUIEventLoop { };
#else // !wxUSE_GUI
// we can't define wxEventLoop differently in GUI and base libraries so use
// a #define to still allow writing wxEventLoop in the user code
#if wxUSE_CONSOLE_EVENTLOOP && (defined(__WINDOWS__) || defined(__UNIX__))
#define wxEventLoop wxConsoleEventLoop
#else // we still must define it somehow for the code below...
#define wxEventLoop wxEventLoopBase
#endif
#endif
inline bool wxEventLoopBase::IsRunning() const { return GetActive() == this; }
#if wxUSE_GUI && !defined(__WXOSX__)
// ----------------------------------------------------------------------------
// wxModalEventLoop
// ----------------------------------------------------------------------------
// this is a naive generic implementation which uses wxWindowDisabler to
// implement modality, we will surely need platform-specific implementations
// too, this generic implementation is here only temporarily to see how it
// works
class WXDLLIMPEXP_CORE wxModalEventLoop : public wxGUIEventLoop
{
public:
wxModalEventLoop(wxWindow *winModal)
{
m_windowDisabler = new wxWindowDisabler(winModal);
}
protected:
virtual void OnExit() wxOVERRIDE
{
delete m_windowDisabler;
m_windowDisabler = NULL;
wxGUIEventLoop::OnExit();
}
private:
wxWindowDisabler *m_windowDisabler;
};
#endif //wxUSE_GUI
// ----------------------------------------------------------------------------
// wxEventLoopActivator: helper class for wxEventLoop implementations
// ----------------------------------------------------------------------------
// this object sets the wxEventLoop given to the ctor as the currently active
// one and unsets it in its dtor, this is especially useful in presence of
// exceptions but is more tidy even when we don't use them
class wxEventLoopActivator
{
public:
wxEventLoopActivator(wxEventLoopBase *evtLoop)
{
m_evtLoopOld = wxEventLoopBase::GetActive();
wxEventLoopBase::SetActive(evtLoop);
}
~wxEventLoopActivator()
{
// restore the previously active event loop
wxEventLoopBase::SetActive(m_evtLoopOld);
}
private:
wxEventLoopBase *m_evtLoopOld;
};
#if wxUSE_GUI || wxUSE_CONSOLE_EVENTLOOP
class wxEventLoopGuarantor
{
public:
wxEventLoopGuarantor()
{
m_evtLoopNew = NULL;
if (!wxEventLoop::GetActive())
{
m_evtLoopNew = new wxEventLoop;
wxEventLoop::SetActive(m_evtLoopNew);
}
}
~wxEventLoopGuarantor()
{
if (m_evtLoopNew)
{
wxEventLoop::SetActive(NULL);
delete m_evtLoopNew;
}
}
private:
wxEventLoop *m_evtLoopNew;
};
#endif // wxUSE_GUI || wxUSE_CONSOLE_EVENTLOOP
#endif // _WX_EVTLOOP_H_
| h |
rticonnextdds-usecases | data/projects/rticonnextdds-usecases/VehicleTracking/ExampleCode/thirdparty/wxWidgets-3.1.2/Linux/include/wx/listbase.h | ///////////////////////////////////////////////////////////////////////////////
// Name: wx/listbase.h
// Purpose: wxListCtrl class
// Author: Vadim Zeitlin
// Modified by:
// Created: 04.12.99
// Copyright: (c) wxWidgets team
// Licence: wxWindows licence
///////////////////////////////////////////////////////////////////////////////
#ifndef _WX_LISTBASE_H_BASE_
#define _WX_LISTBASE_H_BASE_
#include "wx/colour.h"
#include "wx/font.h"
#include "wx/gdicmn.h"
#include "wx/event.h"
#include "wx/control.h"
#include "wx/itemattr.h"
#include "wx/systhemectrl.h"
class WXDLLIMPEXP_FWD_CORE wxImageList;
// ----------------------------------------------------------------------------
// types
// ----------------------------------------------------------------------------
// type of compare function for wxListCtrl sort operation
typedef
int (wxCALLBACK *wxListCtrlCompare)(wxIntPtr item1, wxIntPtr item2, wxIntPtr sortData);
// ----------------------------------------------------------------------------
// wxListCtrl constants
// ----------------------------------------------------------------------------
// style flags
#define wxLC_VRULES 0x0001
#define wxLC_HRULES 0x0002
#define wxLC_ICON 0x0004
#define wxLC_SMALL_ICON 0x0008
#define wxLC_LIST 0x0010
#define wxLC_REPORT 0x0020
#define wxLC_ALIGN_TOP 0x0040
#define wxLC_ALIGN_LEFT 0x0080
#define wxLC_AUTOARRANGE 0x0100
#define wxLC_VIRTUAL 0x0200
#define wxLC_EDIT_LABELS 0x0400
#define wxLC_NO_HEADER 0x0800
#define wxLC_NO_SORT_HEADER 0x1000
#define wxLC_SINGLE_SEL 0x2000
#define wxLC_SORT_ASCENDING 0x4000
#define wxLC_SORT_DESCENDING 0x8000
#define wxLC_MASK_TYPE (wxLC_ICON | wxLC_SMALL_ICON | wxLC_LIST | wxLC_REPORT)
#define wxLC_MASK_ALIGN (wxLC_ALIGN_TOP | wxLC_ALIGN_LEFT)
#define wxLC_MASK_SORT (wxLC_SORT_ASCENDING | wxLC_SORT_DESCENDING)
// for compatibility only
#define wxLC_USER_TEXT wxLC_VIRTUAL
// Omitted because
// (a) too much detail
// (b) not enough style flags
// (c) not implemented anyhow in the generic version
//
// #define wxLC_NO_SCROLL
// #define wxLC_NO_LABEL_WRAP
// #define wxLC_OWNERDRAW_FIXED
// #define wxLC_SHOW_SEL_ALWAYS
// Mask flags to tell app/GUI what fields of wxListItem are valid
#define wxLIST_MASK_STATE 0x0001
#define wxLIST_MASK_TEXT 0x0002
#define wxLIST_MASK_IMAGE 0x0004
#define wxLIST_MASK_DATA 0x0008
#define wxLIST_SET_ITEM 0x0010
#define wxLIST_MASK_WIDTH 0x0020
#define wxLIST_MASK_FORMAT 0x0040
// State flags for indicating the state of an item
#define wxLIST_STATE_DONTCARE 0x0000
#define wxLIST_STATE_DROPHILITED 0x0001 // MSW only
#define wxLIST_STATE_FOCUSED 0x0002
#define wxLIST_STATE_SELECTED 0x0004
#define wxLIST_STATE_CUT 0x0008 // MSW only
#define wxLIST_STATE_DISABLED 0x0010 // Not used
#define wxLIST_STATE_FILTERED 0x0020 // Not used
#define wxLIST_STATE_INUSE 0x0040 // Not used
#define wxLIST_STATE_PICKED 0x0080 // Not used
#define wxLIST_STATE_SOURCE 0x0100 // Not used
// Hit test flags, used in HitTest
#define wxLIST_HITTEST_ABOVE 0x0001 // Above the control's client area.
#define wxLIST_HITTEST_BELOW 0x0002 // Below the control's client area.
#define wxLIST_HITTEST_NOWHERE 0x0004 // Inside the control's client area but not over an item.
#define wxLIST_HITTEST_ONITEMICON 0x0020 // Over an item's icon.
#define wxLIST_HITTEST_ONITEMLABEL 0x0080 // Over an item's text.
#define wxLIST_HITTEST_ONITEMRIGHT 0x0100 // Not used
#define wxLIST_HITTEST_ONITEMSTATEICON 0x0200 // Over the checkbox of an item.
#define wxLIST_HITTEST_TOLEFT 0x0400 // To the left of the control's client area.
#define wxLIST_HITTEST_TORIGHT 0x0800 // To the right of the control's client area.
#define wxLIST_HITTEST_ONITEM (wxLIST_HITTEST_ONITEMICON | wxLIST_HITTEST_ONITEMLABEL | wxLIST_HITTEST_ONITEMSTATEICON)
// GetSubItemRect constants
#define wxLIST_GETSUBITEMRECT_WHOLEITEM -1l
// Flags for GetNextItem (MSW only except wxLIST_NEXT_ALL)
enum
{
wxLIST_NEXT_ABOVE, // Searches for an item above the specified item
wxLIST_NEXT_ALL, // Searches for subsequent item by index
wxLIST_NEXT_BELOW, // Searches for an item below the specified item
wxLIST_NEXT_LEFT, // Searches for an item to the left of the specified item
wxLIST_NEXT_RIGHT // Searches for an item to the right of the specified item
};
// Alignment flags for Arrange (MSW only except wxLIST_ALIGN_LEFT)
enum
{
wxLIST_ALIGN_DEFAULT,
wxLIST_ALIGN_LEFT,
wxLIST_ALIGN_TOP,
wxLIST_ALIGN_SNAP_TO_GRID
};
// Column format (MSW only except wxLIST_FORMAT_LEFT)
enum wxListColumnFormat
{
wxLIST_FORMAT_LEFT,
wxLIST_FORMAT_RIGHT,
wxLIST_FORMAT_CENTRE,
wxLIST_FORMAT_CENTER = wxLIST_FORMAT_CENTRE
};
// Autosize values for SetColumnWidth
enum
{
wxLIST_AUTOSIZE = -1,
wxLIST_AUTOSIZE_USEHEADER = -2 // partly supported by generic version
};
// Flag values for GetItemRect
enum
{
wxLIST_RECT_BOUNDS,
wxLIST_RECT_ICON,
wxLIST_RECT_LABEL
};
// Flag values for FindItem (MSW only)
enum
{
wxLIST_FIND_UP,
wxLIST_FIND_DOWN,
wxLIST_FIND_LEFT,
wxLIST_FIND_RIGHT
};
// For compatibility, define the old name for this class. There is no need to
// deprecate it as it doesn't cost us anything to keep this typedef, but the
// new code should prefer to use the new wxItemAttr name.
typedef wxItemAttr wxListItemAttr;
// ----------------------------------------------------------------------------
// wxListItem: the item or column info, used to exchange data with wxListCtrl
// ----------------------------------------------------------------------------
class WXDLLIMPEXP_CORE wxListItem : public wxObject
{
public:
wxListItem() { Init(); m_attr = NULL; }
wxListItem(const wxListItem& item)
: wxObject(),
m_mask(item.m_mask),
m_itemId(item.m_itemId),
m_col(item.m_col),
m_state(item.m_state),
m_stateMask(item.m_stateMask),
m_text(item.m_text),
m_image(item.m_image),
m_data(item.m_data),
m_format(item.m_format),
m_width(item.m_width),
m_attr(NULL)
{
// copy list item attributes
if ( item.HasAttributes() )
m_attr = new wxItemAttr(*item.GetAttributes());
}
wxListItem& operator=(const wxListItem& item)
{
if ( &item != this )
{
m_mask = item.m_mask;
m_itemId = item.m_itemId;
m_col = item.m_col;
m_state = item.m_state;
m_stateMask = item.m_stateMask;
m_text = item.m_text;
m_image = item.m_image;
m_data = item.m_data;
m_format = item.m_format;
m_width = item.m_width;
m_attr = item.m_attr ? new wxItemAttr(*item.m_attr) : NULL;
}
return *this;
}
virtual ~wxListItem() { delete m_attr; }
// resetting
void Clear() { Init(); m_text.clear(); ClearAttributes(); }
void ClearAttributes() { if ( m_attr ) { delete m_attr; m_attr = NULL; } }
// setters
void SetMask(long mask)
{ m_mask = mask; }
void SetId(long id)
{ m_itemId = id; }
void SetColumn(int col)
{ m_col = col; }
void SetState(long state)
{ m_mask |= wxLIST_MASK_STATE; m_state = state; m_stateMask |= state; }
void SetStateMask(long stateMask)
{ m_stateMask = stateMask; }
void SetText(const wxString& text)
{ m_mask |= wxLIST_MASK_TEXT; m_text = text; }
void SetImage(int image)
{ m_mask |= wxLIST_MASK_IMAGE; m_image = image; }
void SetData(long data)
{ m_mask |= wxLIST_MASK_DATA; m_data = data; }
void SetData(void *data)
{ m_mask |= wxLIST_MASK_DATA; m_data = wxPtrToUInt(data); }
void SetWidth(int width)
{ m_mask |= wxLIST_MASK_WIDTH; m_width = width; }
void SetAlign(wxListColumnFormat align)
{ m_mask |= wxLIST_MASK_FORMAT; m_format = align; }
void SetTextColour(const wxColour& colText)
{ Attributes().SetTextColour(colText); }
void SetBackgroundColour(const wxColour& colBack)
{ Attributes().SetBackgroundColour(colBack); }
void SetFont(const wxFont& font)
{ Attributes().SetFont(font); }
// accessors
long GetMask() const { return m_mask; }
long GetId() const { return m_itemId; }
int GetColumn() const { return m_col; }
long GetState() const { return m_state & m_stateMask; }
const wxString& GetText() const { return m_text; }
int GetImage() const { return m_image; }
wxUIntPtr GetData() const { return m_data; }
int GetWidth() const { return m_width; }
wxListColumnFormat GetAlign() const { return (wxListColumnFormat)m_format; }
wxItemAttr *GetAttributes() const { return m_attr; }
bool HasAttributes() const { return m_attr != NULL; }
wxColour GetTextColour() const
{ return HasAttributes() ? m_attr->GetTextColour() : wxNullColour; }
wxColour GetBackgroundColour() const
{ return HasAttributes() ? m_attr->GetBackgroundColour()
: wxNullColour; }
wxFont GetFont() const
{ return HasAttributes() ? m_attr->GetFont() : wxNullFont; }
// this conversion is necessary to make old code using GetItem() to
// compile
operator long() const { return m_itemId; }
// these members are public for compatibility
long m_mask; // Indicates what fields are valid
long m_itemId; // The zero-based item position
int m_col; // Zero-based column, if in report mode
long m_state; // The state of the item
long m_stateMask;// Which flags of m_state are valid (uses same flags)
wxString m_text; // The label/header text
int m_image; // The zero-based index into an image list
wxUIntPtr m_data; // App-defined data
// For columns only
int m_format; // left, right, centre
int m_width; // width of column
protected:
// creates m_attr if we don't have it yet
wxItemAttr& Attributes()
{
if ( !m_attr )
m_attr = new wxItemAttr;
return *m_attr;
}
void Init()
{
m_mask = 0;
m_itemId = -1;
m_col = 0;
m_state = 0;
m_stateMask = 0;
m_image = -1;
m_data = 0;
m_format = wxLIST_FORMAT_CENTRE;
m_width = 0;
}
wxItemAttr *m_attr; // optional pointer to the items style
private:
wxDECLARE_DYNAMIC_CLASS(wxListItem);
};
// ----------------------------------------------------------------------------
// wxListCtrlBase: the base class for the main control itself.
// ----------------------------------------------------------------------------
// Unlike other base classes, this class doesn't currently define the API of
// the real control class but is just used for implementation convenience. We
// should define the public class functions as pure virtual here in the future
// however.
class WXDLLIMPEXP_CORE wxListCtrlBase : public wxSystemThemedControl<wxControl>
{
public:
wxListCtrlBase() { }
// Image list methods.
// -------------------
// Associate the given (possibly NULL to indicate that no images will be
// used) image list with the control. The ownership of the image list
// passes to the control, i.e. it will be deleted when the control itself
// is destroyed.
//
// The value of "which" must be one of wxIMAGE_LIST_{NORMAL,SMALL,STATE}.
virtual void AssignImageList(wxImageList* imageList, int which) = 0;
// Same as AssignImageList() but the control does not delete the image list
// so it can be shared among several controls.
virtual void SetImageList(wxImageList* imageList, int which) = 0;
// Return the currently used image list, may be NULL.
virtual wxImageList* GetImageList(int which) const = 0;
// Column-related methods.
// -----------------------
// All these methods can only be used in report view mode.
// Appends a new column.
//
// Returns the index of the newly inserted column or -1 on error.
long AppendColumn(const wxString& heading,
wxListColumnFormat format = wxLIST_FORMAT_LEFT,
int width = -1);
// Add a new column to the control at the position "col".
//
// Returns the index of the newly inserted column or -1 on error.
long InsertColumn(long col, const wxListItem& info);
long InsertColumn(long col,
const wxString& heading,
int format = wxLIST_FORMAT_LEFT,
int width = wxLIST_AUTOSIZE);
// Delete the given or all columns.
virtual bool DeleteColumn(int col) = 0;
virtual bool DeleteAllColumns() = 0;
// Return the current number of columns.
virtual int GetColumnCount() const = 0;
// Get or update information about the given column. Set item mask to
// indicate the fields to retrieve or change.
//
// Returns false on error, e.g. if the column index is invalid.
virtual bool GetColumn(int col, wxListItem& item) const = 0;
virtual bool SetColumn(int col, const wxListItem& item) = 0;
// Convenient wrappers for the above methods which get or update just the
// column width.
virtual int GetColumnWidth(int col) const = 0;
virtual bool SetColumnWidth(int col, int width) = 0;
// return the attribute for the item (may return NULL if none)
virtual wxItemAttr *OnGetItemAttr(long item) const;
// Other miscellaneous accessors.
// ------------------------------
// Convenient functions for testing the list control mode:
bool InReportView() const { return HasFlag(wxLC_REPORT); }
bool IsVirtual() const { return HasFlag(wxLC_VIRTUAL); }
// Enable or disable beep when incremental match doesn't find any item.
// Only implemented in the generic version currently.
virtual void EnableBellOnNoMatch(bool WXUNUSED(on) = true) { }
void EnableAlternateRowColours(bool enable = true);
void SetAlternateRowColour(const wxColour& colour);
wxColour GetAlternateRowColour() const { return m_alternateRowColour.GetBackgroundColour(); }
// Header attributes support: only implemented in wxMSW currently.
virtual bool SetHeaderAttr(const wxItemAttr& WXUNUSED(attr)) { return false; }
// Checkboxes support.
virtual bool HasCheckBoxes() const { return false; }
virtual bool EnableCheckBoxes(bool WXUNUSED(enable) = true) { return false; }
virtual bool IsItemChecked(long WXUNUSED(item)) const { return false; }
virtual void CheckItem(long WXUNUSED(item), bool WXUNUSED(check)) { }
protected:
// Real implementations methods to which our public forwards.
virtual long DoInsertColumn(long col, const wxListItem& info) = 0;
// Overridden methods of the base class.
virtual wxSize DoGetBestClientSize() const wxOVERRIDE;
private:
// user defined color to draw row lines, may be invalid
wxItemAttr m_alternateRowColour;
};
// ----------------------------------------------------------------------------
// wxListEvent - the event class for the wxListCtrl notifications
// ----------------------------------------------------------------------------
class WXDLLIMPEXP_CORE wxListEvent : public wxNotifyEvent
{
public:
wxListEvent(wxEventType commandType = wxEVT_NULL, int winid = 0)
: wxNotifyEvent(commandType, winid)
, m_code(-1)
, m_oldItemIndex(-1)
, m_itemIndex(-1)
, m_col(-1)
, m_pointDrag()
, m_item()
, m_editCancelled(false)
{ }
wxListEvent(const wxListEvent& event)
: wxNotifyEvent(event)
, m_code(event.m_code)
, m_oldItemIndex(event.m_oldItemIndex)
, m_itemIndex(event.m_itemIndex)
, m_col(event.m_col)
, m_pointDrag(event.m_pointDrag)
, m_item(event.m_item)
, m_editCancelled(event.m_editCancelled)
{ }
int GetKeyCode() const { return m_code; }
long GetIndex() const { return m_itemIndex; }
int GetColumn() const { return m_col; }
wxPoint GetPoint() const { return m_pointDrag; }
const wxString& GetLabel() const { return m_item.m_text; }
const wxString& GetText() const { return m_item.m_text; }
int GetImage() const { return m_item.m_image; }
wxUIntPtr GetData() const { return m_item.m_data; }
long GetMask() const { return m_item.m_mask; }
const wxListItem& GetItem() const { return m_item; }
void SetKeyCode(int code) { m_code = code; }
void SetIndex(long index) { m_itemIndex = index; }
void SetColumn(int col) { m_col = col; }
void SetPoint(const wxPoint& point) { m_pointDrag = point; }
void SetItem(const wxListItem& item) { m_item = item; }
// for wxEVT_LIST_CACHE_HINT only
long GetCacheFrom() const { return m_oldItemIndex; }
long GetCacheTo() const { return m_itemIndex; }
void SetCacheFrom(long cacheFrom) { m_oldItemIndex = cacheFrom; }
void SetCacheTo(long cacheTo) { m_itemIndex = cacheTo; }
// was label editing canceled? (for wxEVT_LIST_END_LABEL_EDIT only)
bool IsEditCancelled() const { return m_editCancelled; }
void SetEditCanceled(bool editCancelled) { m_editCancelled = editCancelled; }
virtual wxEvent *Clone() const wxOVERRIDE { return new wxListEvent(*this); }
//protected: -- not for backwards compatibility
int m_code;
long m_oldItemIndex; // only for wxEVT_LIST_CACHE_HINT
long m_itemIndex;
int m_col;
wxPoint m_pointDrag;
wxListItem m_item;
protected:
bool m_editCancelled;
private:
wxDECLARE_DYNAMIC_CLASS_NO_ASSIGN(wxListEvent);
};
// ----------------------------------------------------------------------------
// wxListCtrl event macros
// ----------------------------------------------------------------------------
wxDECLARE_EXPORTED_EVENT( WXDLLIMPEXP_CORE, wxEVT_LIST_BEGIN_DRAG, wxListEvent );
wxDECLARE_EXPORTED_EVENT( WXDLLIMPEXP_CORE, wxEVT_LIST_BEGIN_RDRAG, wxListEvent );
wxDECLARE_EXPORTED_EVENT( WXDLLIMPEXP_CORE, wxEVT_LIST_BEGIN_LABEL_EDIT, wxListEvent );
wxDECLARE_EXPORTED_EVENT( WXDLLIMPEXP_CORE, wxEVT_LIST_END_LABEL_EDIT, wxListEvent );
wxDECLARE_EXPORTED_EVENT( WXDLLIMPEXP_CORE, wxEVT_LIST_DELETE_ITEM, wxListEvent );
wxDECLARE_EXPORTED_EVENT( WXDLLIMPEXP_CORE, wxEVT_LIST_DELETE_ALL_ITEMS, wxListEvent );
wxDECLARE_EXPORTED_EVENT( WXDLLIMPEXP_CORE, wxEVT_LIST_ITEM_SELECTED, wxListEvent );
wxDECLARE_EXPORTED_EVENT( WXDLLIMPEXP_CORE, wxEVT_LIST_ITEM_DESELECTED, wxListEvent );
wxDECLARE_EXPORTED_EVENT( WXDLLIMPEXP_CORE, wxEVT_LIST_KEY_DOWN, wxListEvent );
wxDECLARE_EXPORTED_EVENT( WXDLLIMPEXP_CORE, wxEVT_LIST_INSERT_ITEM, wxListEvent );
wxDECLARE_EXPORTED_EVENT( WXDLLIMPEXP_CORE, wxEVT_LIST_COL_CLICK, wxListEvent );
wxDECLARE_EXPORTED_EVENT( WXDLLIMPEXP_CORE, wxEVT_LIST_ITEM_RIGHT_CLICK, wxListEvent );
wxDECLARE_EXPORTED_EVENT( WXDLLIMPEXP_CORE, wxEVT_LIST_ITEM_MIDDLE_CLICK, wxListEvent );
wxDECLARE_EXPORTED_EVENT( WXDLLIMPEXP_CORE, wxEVT_LIST_ITEM_ACTIVATED, wxListEvent );
wxDECLARE_EXPORTED_EVENT( WXDLLIMPEXP_CORE, wxEVT_LIST_CACHE_HINT, wxListEvent );
wxDECLARE_EXPORTED_EVENT( WXDLLIMPEXP_CORE, wxEVT_LIST_COL_RIGHT_CLICK, wxListEvent );
wxDECLARE_EXPORTED_EVENT( WXDLLIMPEXP_CORE, wxEVT_LIST_COL_BEGIN_DRAG, wxListEvent );
wxDECLARE_EXPORTED_EVENT( WXDLLIMPEXP_CORE, wxEVT_LIST_COL_DRAGGING, wxListEvent );
wxDECLARE_EXPORTED_EVENT( WXDLLIMPEXP_CORE, wxEVT_LIST_COL_END_DRAG, wxListEvent );
wxDECLARE_EXPORTED_EVENT( WXDLLIMPEXP_CORE, wxEVT_LIST_ITEM_FOCUSED, wxListEvent );
wxDECLARE_EXPORTED_EVENT( WXDLLIMPEXP_CORE, wxEVT_LIST_ITEM_CHECKED, wxListEvent );
wxDECLARE_EXPORTED_EVENT( WXDLLIMPEXP_CORE, wxEVT_LIST_ITEM_UNCHECKED, wxListEvent );
typedef void (wxEvtHandler::*wxListEventFunction)(wxListEvent&);
#define wxListEventHandler(func) \
wxEVENT_HANDLER_CAST(wxListEventFunction, func)
#define wx__DECLARE_LISTEVT(evt, id, fn) \
wx__DECLARE_EVT1(wxEVT_LIST_ ## evt, id, wxListEventHandler(fn))
#define EVT_LIST_BEGIN_DRAG(id, fn) wx__DECLARE_LISTEVT(BEGIN_DRAG, id, fn)
#define EVT_LIST_BEGIN_RDRAG(id, fn) wx__DECLARE_LISTEVT(BEGIN_RDRAG, id, fn)
#define EVT_LIST_BEGIN_LABEL_EDIT(id, fn) wx__DECLARE_LISTEVT(BEGIN_LABEL_EDIT, id, fn)
#define EVT_LIST_END_LABEL_EDIT(id, fn) wx__DECLARE_LISTEVT(END_LABEL_EDIT, id, fn)
#define EVT_LIST_DELETE_ITEM(id, fn) wx__DECLARE_LISTEVT(DELETE_ITEM, id, fn)
#define EVT_LIST_DELETE_ALL_ITEMS(id, fn) wx__DECLARE_LISTEVT(DELETE_ALL_ITEMS, id, fn)
#define EVT_LIST_KEY_DOWN(id, fn) wx__DECLARE_LISTEVT(KEY_DOWN, id, fn)
#define EVT_LIST_INSERT_ITEM(id, fn) wx__DECLARE_LISTEVT(INSERT_ITEM, id, fn)
#define EVT_LIST_COL_CLICK(id, fn) wx__DECLARE_LISTEVT(COL_CLICK, id, fn)
#define EVT_LIST_COL_RIGHT_CLICK(id, fn) wx__DECLARE_LISTEVT(COL_RIGHT_CLICK, id, fn)
#define EVT_LIST_COL_BEGIN_DRAG(id, fn) wx__DECLARE_LISTEVT(COL_BEGIN_DRAG, id, fn)
#define EVT_LIST_COL_DRAGGING(id, fn) wx__DECLARE_LISTEVT(COL_DRAGGING, id, fn)
#define EVT_LIST_COL_END_DRAG(id, fn) wx__DECLARE_LISTEVT(COL_END_DRAG, id, fn)
#define EVT_LIST_ITEM_SELECTED(id, fn) wx__DECLARE_LISTEVT(ITEM_SELECTED, id, fn)
#define EVT_LIST_ITEM_DESELECTED(id, fn) wx__DECLARE_LISTEVT(ITEM_DESELECTED, id, fn)
#define EVT_LIST_ITEM_RIGHT_CLICK(id, fn) wx__DECLARE_LISTEVT(ITEM_RIGHT_CLICK, id, fn)
#define EVT_LIST_ITEM_MIDDLE_CLICK(id, fn) wx__DECLARE_LISTEVT(ITEM_MIDDLE_CLICK, id, fn)
#define EVT_LIST_ITEM_ACTIVATED(id, fn) wx__DECLARE_LISTEVT(ITEM_ACTIVATED, id, fn)
#define EVT_LIST_ITEM_FOCUSED(id, fn) wx__DECLARE_LISTEVT(ITEM_FOCUSED, id, fn)
#define EVT_LIST_ITEM_CHECKED(id, fn) wx__DECLARE_LISTEVT(ITEM_CHECKED, id, fn)
#define EVT_LIST_ITEM_UNCHECKED(id, fn) wx__DECLARE_LISTEVT(ITEM_UNCHECKED, id, fn)
#define EVT_LIST_CACHE_HINT(id, fn) wx__DECLARE_LISTEVT(CACHE_HINT, id, fn)
// old wxEVT_COMMAND_* constants
#define wxEVT_COMMAND_LIST_BEGIN_DRAG wxEVT_LIST_BEGIN_DRAG
#define wxEVT_COMMAND_LIST_BEGIN_RDRAG wxEVT_LIST_BEGIN_RDRAG
#define wxEVT_COMMAND_LIST_BEGIN_LABEL_EDIT wxEVT_LIST_BEGIN_LABEL_EDIT
#define wxEVT_COMMAND_LIST_END_LABEL_EDIT wxEVT_LIST_END_LABEL_EDIT
#define wxEVT_COMMAND_LIST_DELETE_ITEM wxEVT_LIST_DELETE_ITEM
#define wxEVT_COMMAND_LIST_DELETE_ALL_ITEMS wxEVT_LIST_DELETE_ALL_ITEMS
#define wxEVT_COMMAND_LIST_ITEM_SELECTED wxEVT_LIST_ITEM_SELECTED
#define wxEVT_COMMAND_LIST_ITEM_DESELECTED wxEVT_LIST_ITEM_DESELECTED
#define wxEVT_COMMAND_LIST_KEY_DOWN wxEVT_LIST_KEY_DOWN
#define wxEVT_COMMAND_LIST_INSERT_ITEM wxEVT_LIST_INSERT_ITEM
#define wxEVT_COMMAND_LIST_COL_CLICK wxEVT_LIST_COL_CLICK
#define wxEVT_COMMAND_LIST_ITEM_RIGHT_CLICK wxEVT_LIST_ITEM_RIGHT_CLICK
#define wxEVT_COMMAND_LIST_ITEM_MIDDLE_CLICK wxEVT_LIST_ITEM_MIDDLE_CLICK
#define wxEVT_COMMAND_LIST_ITEM_ACTIVATED wxEVT_LIST_ITEM_ACTIVATED
#define wxEVT_COMMAND_LIST_CACHE_HINT wxEVT_LIST_CACHE_HINT
#define wxEVT_COMMAND_LIST_COL_RIGHT_CLICK wxEVT_LIST_COL_RIGHT_CLICK
#define wxEVT_COMMAND_LIST_COL_BEGIN_DRAG wxEVT_LIST_COL_BEGIN_DRAG
#define wxEVT_COMMAND_LIST_COL_DRAGGING wxEVT_LIST_COL_DRAGGING
#define wxEVT_COMMAND_LIST_COL_END_DRAG wxEVT_LIST_COL_END_DRAG
#define wxEVT_COMMAND_LIST_ITEM_FOCUSED wxEVT_LIST_ITEM_FOCUSED
#endif
// _WX_LISTCTRL_H_BASE_
| h |
rticonnextdds-usecases | data/projects/rticonnextdds-usecases/VehicleTracking/ExampleCode/thirdparty/wxWidgets-3.1.2/Linux/include/wx/ipc.h | ///////////////////////////////////////////////////////////////////////////////
// Name: wx/ipc.h
// Purpose: wrapper around different wxIPC classes implementations
// Author: Vadim Zeitlin
// Modified by:
// Created: 15.04.02
// Copyright: (c) 2002 Vadim Zeitlin
// Licence: wxWindows licence
///////////////////////////////////////////////////////////////////////////////
#ifndef _WX_IPC_H_
#define _WX_IPC_H_
// Set wxUSE_DDE_FOR_IPC to 1 to use DDE for IPC under Windows. If it is set to
// 0, or if the platform is not Windows, use TCP/IP for IPC implementation
#if !defined(wxUSE_DDE_FOR_IPC)
#ifdef __WINDOWS__
#define wxUSE_DDE_FOR_IPC 1
#else
#define wxUSE_DDE_FOR_IPC 0
#endif
#endif // !defined(wxUSE_DDE_FOR_IPC)
#if !defined(__WINDOWS__)
#undef wxUSE_DDE_FOR_IPC
#define wxUSE_DDE_FOR_IPC 0
#endif
#if wxUSE_DDE_FOR_IPC
#define wxConnection wxDDEConnection
#define wxServer wxDDEServer
#define wxClient wxDDEClient
#include "wx/dde.h"
#else // !wxUSE_DDE_FOR_IPC
#define wxConnection wxTCPConnection
#define wxServer wxTCPServer
#define wxClient wxTCPClient
#include "wx/sckipc.h"
#endif // wxUSE_DDE_FOR_IPC/!wxUSE_DDE_FOR_IPC
#endif // _WX_IPC_H_
| h |
rticonnextdds-usecases | data/projects/rticonnextdds-usecases/VehicleTracking/ExampleCode/thirdparty/wxWidgets-3.1.2/Linux/include/wx/palette.h | /////////////////////////////////////////////////////////////////////////////
// Name: wx/palette.h
// Purpose: Common header and base class for wxPalette
// Author: Julian Smart
// Modified by:
// Created:
// Copyright: (c) Julian Smart
// Licence: wxWindows Licence
/////////////////////////////////////////////////////////////////////////////
#ifndef _WX_PALETTE_H_BASE_
#define _WX_PALETTE_H_BASE_
#include "wx/defs.h"
#if wxUSE_PALETTE
#include "wx/object.h"
#include "wx/gdiobj.h"
// wxPaletteBase
class WXDLLIMPEXP_CORE wxPaletteBase: public wxGDIObject
{
public:
virtual ~wxPaletteBase() { }
virtual int GetColoursCount() const { wxFAIL_MSG( wxT("not implemented") ); return 0; }
};
#if defined(__WXMSW__)
#include "wx/msw/palette.h"
#elif defined(__WXX11__) || defined(__WXMOTIF__)
#include "wx/x11/palette.h"
#elif defined(__WXGTK__)
#include "wx/generic/paletteg.h"
#elif defined(__WXMAC__)
#include "wx/osx/palette.h"
#elif defined(__WXQT__)
#include "wx/qt/palette.h"
#endif
#endif // wxUSE_PALETTE
#endif // _WX_PALETTE_H_BASE_
| h |
rticonnextdds-usecases | data/projects/rticonnextdds-usecases/VehicleTracking/ExampleCode/thirdparty/wxWidgets-3.1.2/Linux/include/wx/affinematrix2dbase.h | /////////////////////////////////////////////////////////////////////////////
// Name: wx/affinematrix2dbase.h
// Purpose: Common interface for 2D transformation matrices.
// Author: Catalin Raceanu
// Created: 2011-04-06
// Copyright: (c) wxWidgets team
// Licence: wxWindows licence
/////////////////////////////////////////////////////////////////////////////
#ifndef _WX_AFFINEMATRIX2DBASE_H_
#define _WX_AFFINEMATRIX2DBASE_H_
#include "wx/defs.h"
#if wxUSE_GEOMETRY
#include "wx/geometry.h"
struct wxMatrix2D
{
wxMatrix2D(wxDouble v11 = 1,
wxDouble v12 = 0,
wxDouble v21 = 0,
wxDouble v22 = 1)
{
m_11 = v11; m_12 = v12;
m_21 = v21; m_22 = v22;
}
wxDouble m_11, m_12, m_21, m_22;
};
// A 2x3 matrix representing an affine 2D transformation.
//
// This is an abstract base class implemented by wxAffineMatrix2D only so far,
// but in the future we also plan to derive wxGraphicsMatrix from it (it should
// also be documented then as currently only wxAffineMatrix2D itself is).
class WXDLLIMPEXP_CORE wxAffineMatrix2DBase
{
public:
wxAffineMatrix2DBase() {}
virtual ~wxAffineMatrix2DBase() {}
// sets the matrix to the respective values
virtual void Set(const wxMatrix2D& mat2D, const wxPoint2DDouble& tr) = 0;
// gets the component valuess of the matrix
virtual void Get(wxMatrix2D* mat2D, wxPoint2DDouble* tr) const = 0;
// concatenates the matrix
virtual void Concat(const wxAffineMatrix2DBase& t) = 0;
// makes this the inverse matrix
virtual bool Invert() = 0;
// return true if this is the identity matrix
virtual bool IsIdentity() const = 0;
// returns true if the elements of the transformation matrix are equal ?
virtual bool IsEqual(const wxAffineMatrix2DBase& t) const = 0;
bool operator==(const wxAffineMatrix2DBase& t) const { return IsEqual(t); }
bool operator!=(const wxAffineMatrix2DBase& t) const { return !IsEqual(t); }
//
// transformations
//
// add the translation to this matrix
virtual void Translate(wxDouble dx, wxDouble dy) = 0;
// add the scale to this matrix
virtual void Scale(wxDouble xScale, wxDouble yScale) = 0;
// add the rotation to this matrix (counter clockwise, radians)
virtual void Rotate(wxDouble ccRadians) = 0;
// add mirroring to this matrix
void Mirror(int direction = wxHORIZONTAL)
{
wxDouble x = (direction & wxHORIZONTAL) ? -1 : 1;
wxDouble y = (direction & wxVERTICAL) ? -1 : 1;
Scale(x, y);
}
// applies that matrix to the point
wxPoint2DDouble TransformPoint(const wxPoint2DDouble& src) const
{
return DoTransformPoint(src);
}
void TransformPoint(wxDouble* x, wxDouble* y) const
{
wxCHECK_RET( x && y, "Can't be NULL" );
const wxPoint2DDouble dst = DoTransformPoint(wxPoint2DDouble(*x, *y));
*x = dst.m_x;
*y = dst.m_y;
}
// applies the matrix except for translations
wxPoint2DDouble TransformDistance(const wxPoint2DDouble& src) const
{
return DoTransformDistance(src);
}
void TransformDistance(wxDouble* dx, wxDouble* dy) const
{
wxCHECK_RET( dx && dy, "Can't be NULL" );
const wxPoint2DDouble
dst = DoTransformDistance(wxPoint2DDouble(*dx, *dy));
*dx = dst.m_x;
*dy = dst.m_y;
}
protected:
virtual
wxPoint2DDouble DoTransformPoint(const wxPoint2DDouble& p) const = 0;
virtual
wxPoint2DDouble DoTransformDistance(const wxPoint2DDouble& p) const = 0;
};
#endif // wxUSE_GEOMETRY
#endif // _WX_AFFINEMATRIX2DBASE_H_
| h |
rticonnextdds-usecases | data/projects/rticonnextdds-usecases/VehicleTracking/ExampleCode/thirdparty/wxWidgets-3.1.2/Linux/include/wx/menu.h | ///////////////////////////////////////////////////////////////////////////////
// Name: wx/menu.h
// Purpose: wxMenu and wxMenuBar classes
// Author: Vadim Zeitlin
// Modified by:
// Created: 26.10.99
// Copyright: (c) wxWidgets team
// Licence: wxWindows licence
///////////////////////////////////////////////////////////////////////////////
#ifndef _WX_MENU_H_BASE_
#define _WX_MENU_H_BASE_
#include "wx/defs.h"
#if wxUSE_MENUS
// ----------------------------------------------------------------------------
// headers
// ----------------------------------------------------------------------------
#include "wx/list.h" // for "template" list classes
#include "wx/window.h" // base class for wxMenuBar
// also include this one to ensure compatibility with old code which only
// included wx/menu.h
#include "wx/menuitem.h"
class WXDLLIMPEXP_FWD_CORE wxFrame;
class WXDLLIMPEXP_FWD_CORE wxMenu;
class WXDLLIMPEXP_FWD_CORE wxMenuBarBase;
class WXDLLIMPEXP_FWD_CORE wxMenuBar;
class WXDLLIMPEXP_FWD_CORE wxMenuItem;
// pseudo template list classes
WX_DECLARE_EXPORTED_LIST(wxMenu, wxMenuList);
WX_DECLARE_EXPORTED_LIST(wxMenuItem, wxMenuItemList);
// ----------------------------------------------------------------------------
// wxMenu
// ----------------------------------------------------------------------------
class WXDLLIMPEXP_CORE wxMenuBase : public wxEvtHandler
{
public:
// create a menu
static wxMenu *New(const wxString& title = wxEmptyString, long style = 0);
// ctors
wxMenuBase(const wxString& title, long style = 0) : m_title(title)
{ Init(style); }
wxMenuBase(long style = 0)
{ Init(style); }
// dtor deletes all the menu items we own
virtual ~wxMenuBase();
// menu construction
// -----------------
// append any kind of item (normal/check/radio/separator)
wxMenuItem* Append(int itemid,
const wxString& text = wxEmptyString,
const wxString& help = wxEmptyString,
wxItemKind kind = wxITEM_NORMAL)
{
return DoAppend(wxMenuItem::New((wxMenu *)this, itemid, text, help, kind));
}
// append a separator to the menu
wxMenuItem* AppendSeparator() { return Append(wxID_SEPARATOR); }
// append a check item
wxMenuItem* AppendCheckItem(int itemid,
const wxString& text,
const wxString& help = wxEmptyString)
{
return Append(itemid, text, help, wxITEM_CHECK);
}
// append a radio item
wxMenuItem* AppendRadioItem(int itemid,
const wxString& text,
const wxString& help = wxEmptyString)
{
return Append(itemid, text, help, wxITEM_RADIO);
}
// append a submenu
wxMenuItem* AppendSubMenu(wxMenu *submenu,
const wxString& text,
const wxString& help = wxEmptyString)
{
return DoAppend(wxMenuItem::New((wxMenu *)this, wxID_ANY, text, help,
wxITEM_NORMAL, submenu));
}
// the most generic form of Append() - append anything
wxMenuItem* Append(wxMenuItem *item) { return DoAppend(item); }
// insert a break in the menu (only works when appending the items, not
// inserting them)
virtual void Break() { }
// insert an item before given position
wxMenuItem* Insert(size_t pos, wxMenuItem *item);
// insert an item before given position
wxMenuItem* Insert(size_t pos,
int itemid,
const wxString& text = wxEmptyString,
const wxString& help = wxEmptyString,
wxItemKind kind = wxITEM_NORMAL)
{
return Insert(pos, wxMenuItem::New((wxMenu *)this, itemid, text, help, kind));
}
// insert a separator
wxMenuItem* InsertSeparator(size_t pos)
{
return Insert(pos, wxMenuItem::New((wxMenu *)this, wxID_SEPARATOR));
}
// insert a check item
wxMenuItem* InsertCheckItem(size_t pos,
int itemid,
const wxString& text,
const wxString& help = wxEmptyString)
{
return Insert(pos, itemid, text, help, wxITEM_CHECK);
}
// insert a radio item
wxMenuItem* InsertRadioItem(size_t pos,
int itemid,
const wxString& text,
const wxString& help = wxEmptyString)
{
return Insert(pos, itemid, text, help, wxITEM_RADIO);
}
// insert a submenu
wxMenuItem* Insert(size_t pos,
int itemid,
const wxString& text,
wxMenu *submenu,
const wxString& help = wxEmptyString)
{
return Insert(pos, wxMenuItem::New((wxMenu *)this, itemid, text, help,
wxITEM_NORMAL, submenu));
}
// prepend an item to the menu
wxMenuItem* Prepend(wxMenuItem *item)
{
return Insert(0u, item);
}
// prepend any item to the menu
wxMenuItem* Prepend(int itemid,
const wxString& text = wxEmptyString,
const wxString& help = wxEmptyString,
wxItemKind kind = wxITEM_NORMAL)
{
return Insert(0u, itemid, text, help, kind);
}
// prepend a separator
wxMenuItem* PrependSeparator()
{
return InsertSeparator(0u);
}
// prepend a check item
wxMenuItem* PrependCheckItem(int itemid,
const wxString& text,
const wxString& help = wxEmptyString)
{
return InsertCheckItem(0u, itemid, text, help);
}
// prepend a radio item
wxMenuItem* PrependRadioItem(int itemid,
const wxString& text,
const wxString& help = wxEmptyString)
{
return InsertRadioItem(0u, itemid, text, help);
}
// prepend a submenu
wxMenuItem* Prepend(int itemid,
const wxString& text,
wxMenu *submenu,
const wxString& help = wxEmptyString)
{
return Insert(0u, itemid, text, submenu, help);
}
// detach an item from the menu, but don't delete it so that it can be
// added back later (but if it's not, the caller is responsible for
// deleting it!)
wxMenuItem *Remove(int itemid) { return Remove(FindChildItem(itemid)); }
wxMenuItem *Remove(wxMenuItem *item);
// delete an item from the menu (submenus are not destroyed by this
// function, see Destroy)
bool Delete(int itemid) { return Delete(FindChildItem(itemid)); }
bool Delete(wxMenuItem *item);
// delete the item from menu and destroy it (if it's a submenu)
bool Destroy(int itemid) { return Destroy(FindChildItem(itemid)); }
bool Destroy(wxMenuItem *item);
// menu items access
// -----------------
// get the items
size_t GetMenuItemCount() const { return m_items.GetCount(); }
const wxMenuItemList& GetMenuItems() const { return m_items; }
wxMenuItemList& GetMenuItems() { return m_items; }
// search
virtual int FindItem(const wxString& item) const;
wxMenuItem* FindItem(int itemid, wxMenu **menu = NULL) const;
// find by position
wxMenuItem* FindItemByPosition(size_t position) const;
// get/set items attributes
void Enable(int itemid, bool enable);
bool IsEnabled(int itemid) const;
void Check(int itemid, bool check);
bool IsChecked(int itemid) const;
void SetLabel(int itemid, const wxString& label);
wxString GetLabel(int itemid) const;
// Returns the stripped label
wxString GetLabelText(int itemid) const { return wxMenuItem::GetLabelText(GetLabel(itemid)); }
virtual void SetHelpString(int itemid, const wxString& helpString);
virtual wxString GetHelpString(int itemid) const;
// misc accessors
// --------------
// the title
virtual void SetTitle(const wxString& title) { m_title = title; }
const wxString& GetTitle() const { return m_title; }
// event handler
void SetEventHandler(wxEvtHandler *handler) { m_eventHandler = handler; }
wxEvtHandler *GetEventHandler() const { return m_eventHandler; }
// Invoking window: this is set by wxWindow::PopupMenu() before showing a
// popup menu and reset after it's hidden. Notice that you probably want to
// use GetWindow() below instead of GetInvokingWindow() as the latter only
// returns non-NULL for the top level menus
//
// NB: avoid calling SetInvokingWindow() directly if possible, use
// wxMenuInvokingWindowSetter class below instead
void SetInvokingWindow(wxWindow *win);
wxWindow *GetInvokingWindow() const { return m_invokingWindow; }
// the window associated with this menu: this is the invoking window for
// popup menus or the top level window to which the menu bar is attached
// for menus which are part of a menu bar
wxWindow *GetWindow() const;
// style
long GetStyle() const { return m_style; }
// implementation helpers
// ----------------------
// Updates the UI for a menu and all submenus recursively by generating
// wxEVT_UPDATE_UI for all the items.
//
// Do not use the "source" argument, it allows to override the event
// handler to use for these events, but this should never be needed.
void UpdateUI(wxEvtHandler* source = NULL);
// get the menu bar this menu is attached to (may be NULL, always NULL for
// popup menus). Traverse up the menu hierarchy to find it.
wxMenuBar *GetMenuBar() const;
// called when the menu is attached/detached to/from a menu bar
virtual void Attach(wxMenuBarBase *menubar);
virtual void Detach();
// is the menu attached to a menu bar (or is it a popup one)?
bool IsAttached() const { return GetMenuBar() != NULL; }
// set/get the parent of this menu
void SetParent(wxMenu *parent) { m_menuParent = parent; }
wxMenu *GetParent() const { return m_menuParent; }
// implementation only from now on
// -------------------------------
// unlike FindItem(), this function doesn't recurse but only looks through
// our direct children and also may return the index of the found child if
// pos != NULL
wxMenuItem *FindChildItem(int itemid, size_t *pos = NULL) const;
// called to generate a wxCommandEvent, return true if it was processed,
// false otherwise
//
// the checked parameter may have boolean value or -1 for uncheckable items
bool SendEvent(int itemid, int checked = -1);
// called to dispatch a wxMenuEvent to the right recipients, menu pointer
// can be NULL if we failed to find the associated menu (this happens at
// least in wxMSW for the events from the system menus)
static
bool ProcessMenuEvent(wxMenu* menu, wxMenuEvent& event, wxWindow* win);
// compatibility: these functions are deprecated, use the new ones instead
// -----------------------------------------------------------------------
// use the versions taking wxItem_XXX now instead, they're more readable
// and allow adding the radio items as well
void Append(int itemid,
const wxString& text,
const wxString& help,
bool isCheckable)
{
Append(itemid, text, help, isCheckable ? wxITEM_CHECK : wxITEM_NORMAL);
}
// use more readable and not requiring unused itemid AppendSubMenu() instead
wxMenuItem* Append(int itemid,
const wxString& text,
wxMenu *submenu,
const wxString& help = wxEmptyString)
{
return DoAppend(wxMenuItem::New((wxMenu *)this, itemid, text, help,
wxITEM_NORMAL, submenu));
}
void Insert(size_t pos,
int itemid,
const wxString& text,
const wxString& help,
bool isCheckable)
{
Insert(pos, itemid, text, help, isCheckable ? wxITEM_CHECK : wxITEM_NORMAL);
}
void Prepend(int itemid,
const wxString& text,
const wxString& help,
bool isCheckable)
{
Insert(0u, itemid, text, help, isCheckable);
}
static void LockAccels(bool locked)
{
ms_locked = locked;
}
protected:
// virtuals to override in derived classes
// ---------------------------------------
virtual wxMenuItem* DoAppend(wxMenuItem *item);
virtual wxMenuItem* DoInsert(size_t pos, wxMenuItem *item);
virtual wxMenuItem *DoRemove(wxMenuItem *item);
virtual bool DoDelete(wxMenuItem *item);
virtual bool DoDestroy(wxMenuItem *item);
// helpers
// -------
// common part of all ctors
void Init(long style);
// associate the submenu with this menu
void AddSubMenu(wxMenu *submenu);
wxMenuBar *m_menuBar; // menubar we belong to or NULL
wxMenu *m_menuParent; // parent menu or NULL
wxString m_title; // the menu title or label
wxMenuItemList m_items; // the list of menu items
wxWindow *m_invokingWindow; // for popup menus
long m_style; // combination of wxMENU_XXX flags
wxEvtHandler *m_eventHandler; // a pluggable in event handler
static bool ms_locked;
private:
// Common part of SendEvent() and ProcessMenuEvent(): sends the event to
// its intended recipients, returns true if it was processed.
static bool DoProcessEvent(wxMenuBase* menu, wxEvent& event, wxWindow* win);
wxDECLARE_NO_COPY_CLASS(wxMenuBase);
};
#if wxUSE_EXTENDED_RTTI
// ----------------------------------------------------------------------------
// XTI accessor
// ----------------------------------------------------------------------------
class WXDLLEXPORT wxMenuInfoHelper : public wxObject
{
public:
wxMenuInfoHelper() { m_menu = NULL; }
virtual ~wxMenuInfoHelper() { }
bool Create( wxMenu *menu, const wxString &title )
{
m_menu = menu;
m_title = title;
return true;
}
wxMenu* GetMenu() const { return m_menu; }
wxString GetTitle() const { return m_title; }
private:
wxMenu *m_menu;
wxString m_title;
wxDECLARE_DYNAMIC_CLASS(wxMenuInfoHelper);
};
WX_DECLARE_EXPORTED_LIST(wxMenuInfoHelper, wxMenuInfoHelperList );
#endif
// ----------------------------------------------------------------------------
// wxMenuBar
// ----------------------------------------------------------------------------
class WXDLLIMPEXP_CORE wxMenuBarBase : public wxWindow
{
public:
// default ctor
wxMenuBarBase();
// dtor will delete all menus we own
virtual ~wxMenuBarBase();
// menu bar construction
// ---------------------
// append a menu to the end of menubar, return true if ok
virtual bool Append(wxMenu *menu, const wxString& title);
// insert a menu before the given position into the menubar, return true
// if inserted ok
virtual bool Insert(size_t pos, wxMenu *menu, const wxString& title);
// menu bar items access
// ---------------------
// get the number of menus in the menu bar
size_t GetMenuCount() const { return m_menus.GetCount(); }
// get the menu at given position
wxMenu *GetMenu(size_t pos) const;
// replace the menu at given position with another one, returns the
// previous menu (which should be deleted by the caller)
virtual wxMenu *Replace(size_t pos, wxMenu *menu, const wxString& title);
// delete the menu at given position from the menu bar, return the pointer
// to the menu (which should be deleted by the caller)
virtual wxMenu *Remove(size_t pos);
// enable or disable a submenu
virtual void EnableTop(size_t pos, bool enable) = 0;
// is the menu enabled?
virtual bool IsEnabledTop(size_t WXUNUSED(pos)) const { return true; }
// get or change the label of the menu at given position
virtual void SetMenuLabel(size_t pos, const wxString& label) = 0;
virtual wxString GetMenuLabel(size_t pos) const = 0;
// get the stripped label of the menu at given position
virtual wxString GetMenuLabelText(size_t pos) const { return wxMenuItem::GetLabelText(GetMenuLabel(pos)); }
// item search
// -----------
// by menu and item names, returns wxNOT_FOUND if not found or id of the
// found item
virtual int FindMenuItem(const wxString& menu, const wxString& item) const;
// find item by id (in any menu), returns NULL if not found
//
// if menu is !NULL, it will be filled with wxMenu this item belongs to
virtual wxMenuItem* FindItem(int itemid, wxMenu **menu = NULL) const;
// find menu by its caption, return wxNOT_FOUND on failure
int FindMenu(const wxString& title) const;
// item access
// -----------
// all these functions just use FindItem() and then call an appropriate
// method on it
//
// NB: under MSW, these methods can only be used after the menubar had
// been attached to the frame
void Enable(int itemid, bool enable);
void Check(int itemid, bool check);
bool IsChecked(int itemid) const;
bool IsEnabled(int itemid) const;
virtual bool IsEnabled() const { return wxWindow::IsEnabled(); }
void SetLabel(int itemid, const wxString &label);
wxString GetLabel(int itemid) const;
void SetHelpString(int itemid, const wxString& helpString);
wxString GetHelpString(int itemid) const;
// implementation helpers
// get the frame we are attached to (may return NULL)
wxFrame *GetFrame() const { return m_menuBarFrame; }
// returns true if we're attached to a frame
bool IsAttached() const { return GetFrame() != NULL; }
// associate the menubar with the frame
virtual void Attach(wxFrame *frame);
// called before deleting the menubar normally
virtual void Detach();
// need to override these ones to avoid virtual function hiding
virtual bool Enable(bool enable = true) wxOVERRIDE { return wxWindow::Enable(enable); }
virtual void SetLabel(const wxString& s) wxOVERRIDE { wxWindow::SetLabel(s); }
virtual wxString GetLabel() const wxOVERRIDE { return wxWindow::GetLabel(); }
// don't want menu bars to accept the focus by tabbing to them
virtual bool AcceptsFocusFromKeyboard() const wxOVERRIDE { return false; }
// update all menu item states in all menus
virtual void UpdateMenus();
virtual bool CanBeOutsideClientArea() const wxOVERRIDE { return true; }
#if wxUSE_EXTENDED_RTTI
// XTI helpers:
bool AppendMenuInfo( const wxMenuInfoHelper *info )
{ return Append( info->GetMenu(), info->GetTitle() ); }
const wxMenuInfoHelperList& GetMenuInfos() const;
#endif
#if WXWIN_COMPATIBILITY_2_8
// get or change the label of the menu at given position
// Deprecated in favour of SetMenuLabel
wxDEPRECATED( void SetLabelTop(size_t pos, const wxString& label) );
// Deprecated in favour of GetMenuLabelText
wxDEPRECATED( wxString GetLabelTop(size_t pos) const );
#endif
protected:
// the list of all our menus
wxMenuList m_menus;
#if wxUSE_EXTENDED_RTTI
// used by XTI
wxMenuInfoHelperList m_menuInfos;
#endif
// the frame we are attached to (may be NULL)
wxFrame *m_menuBarFrame;
wxDECLARE_NO_COPY_CLASS(wxMenuBarBase);
};
// ----------------------------------------------------------------------------
// include the real class declaration
// ----------------------------------------------------------------------------
#ifdef wxUSE_BASE_CLASSES_ONLY
#define wxMenuItem wxMenuItemBase
#else // !wxUSE_BASE_CLASSES_ONLY
#if defined(__WXUNIVERSAL__)
#include "wx/univ/menu.h"
#elif defined(__WXMSW__)
#include "wx/msw/menu.h"
#elif defined(__WXMOTIF__)
#include "wx/motif/menu.h"
#elif defined(__WXGTK20__)
#include "wx/gtk/menu.h"
#elif defined(__WXGTK__)
#include "wx/gtk1/menu.h"
#elif defined(__WXMAC__)
#include "wx/osx/menu.h"
#elif defined(__WXQT__)
#include "wx/qt/menu.h"
#endif
#endif // wxUSE_BASE_CLASSES_ONLY/!wxUSE_BASE_CLASSES_ONLY
// ----------------------------------------------------------------------------
// Helper class used in the implementation only: sets the invoking window of
// the given menu in its ctor and resets it in dtor.
// ----------------------------------------------------------------------------
class wxMenuInvokingWindowSetter
{
public:
// Ctor sets the invoking window for the given menu.
//
// The menu lifetime must be greater than that of this class.
wxMenuInvokingWindowSetter(wxMenu& menu, wxWindow *win)
: m_menu(menu)
{
menu.SetInvokingWindow(win);
}
// Dtor resets the invoking window.
~wxMenuInvokingWindowSetter()
{
m_menu.SetInvokingWindow(NULL);
}
private:
wxMenu& m_menu;
wxDECLARE_NO_COPY_CLASS(wxMenuInvokingWindowSetter);
};
#endif // wxUSE_MENUS
#endif // _WX_MENU_H_BASE_
| h |
rticonnextdds-usecases | data/projects/rticonnextdds-usecases/VehicleTracking/ExampleCode/thirdparty/wxWidgets-3.1.2/Linux/include/wx/colour.h | /////////////////////////////////////////////////////////////////////////////
// Name: wx/colour.h
// Purpose: wxColourBase definition
// Author: Julian Smart
// Modified by: Francesco Montorsi
// Created:
// Copyright: Julian Smart
// Licence: wxWindows licence
/////////////////////////////////////////////////////////////////////////////
#ifndef _WX_COLOUR_H_BASE_
#define _WX_COLOUR_H_BASE_
#include "wx/defs.h"
#include "wx/gdiobj.h"
class WXDLLIMPEXP_FWD_CORE wxColour;
// A macro to define the standard wxColour constructors:
//
// It avoids the need to repeat these lines across all colour.h files, since
// Set() is a virtual function and thus cannot be called by wxColourBase ctors
#define DEFINE_STD_WXCOLOUR_CONSTRUCTORS \
wxColour() { Init(); } \
wxColour(ChannelType red, \
ChannelType green, \
ChannelType blue, \
ChannelType alpha = wxALPHA_OPAQUE) \
{ Init(); Set(red, green, blue, alpha); } \
wxColour(unsigned long colRGB) { Init(); Set(colRGB ); } \
wxColour(const wxString& colourName) { Init(); Set(colourName); } \
wxColour(const char *colourName) { Init(); Set(colourName); } \
wxColour(const wchar_t *colourName) { Init(); Set(colourName); }
// flags for wxColour -> wxString conversion (see wxColour::GetAsString)
enum {
wxC2S_NAME = 1, // return colour name, when possible
wxC2S_CSS_SYNTAX = 2, // return colour in rgb(r,g,b) syntax
wxC2S_HTML_SYNTAX = 4 // return colour in #rrggbb syntax
};
const unsigned char wxALPHA_TRANSPARENT = 0;
const unsigned char wxALPHA_OPAQUE = 0xff;
// a valid but fully transparent colour
#define wxTransparentColour wxColour(0, 0, 0, wxALPHA_TRANSPARENT)
#define wxTransparentColor wxTransparentColour
// ----------------------------------------------------------------------------
// wxVariant support
// ----------------------------------------------------------------------------
#if wxUSE_VARIANT
#include "wx/variant.h"
DECLARE_VARIANT_OBJECT_EXPORTED(wxColour,WXDLLIMPEXP_CORE)
#endif
//-----------------------------------------------------------------------------
// wxColourBase: this class has no data members, just some functions to avoid
// code redundancy in all native wxColour implementations
//-----------------------------------------------------------------------------
/* Transition from wxGDIObject to wxObject is incomplete. If your port does
not need the wxGDIObject machinery to handle colors, please add it to the
list of ports which do not need it.
*/
#if defined( __WXMSW__ ) || defined( __WXQT__ )
#define wxCOLOUR_IS_GDIOBJECT 0
#else
#define wxCOLOUR_IS_GDIOBJECT 1
#endif
class WXDLLIMPEXP_CORE wxColourBase : public
#if wxCOLOUR_IS_GDIOBJECT
wxGDIObject
#else
wxObject
#endif
{
public:
// type of a single colour component
typedef unsigned char ChannelType;
wxColourBase() {}
virtual ~wxColourBase() {}
// Set() functions
// ---------------
void Set(ChannelType red,
ChannelType green,
ChannelType blue,
ChannelType alpha = wxALPHA_OPAQUE)
{ InitRGBA(red, green, blue, alpha); }
// implemented in colourcmn.cpp
bool Set(const wxString &str)
{ return FromString(str); }
void Set(unsigned long colRGB)
{
// we don't need to know sizeof(long) here because we assume that the three
// least significant bytes contain the R, G and B values
Set((ChannelType)(0xFF & colRGB),
(ChannelType)(0xFF & (colRGB >> 8)),
(ChannelType)(0xFF & (colRGB >> 16)));
}
// accessors
// ---------
virtual ChannelType Red() const = 0;
virtual ChannelType Green() const = 0;
virtual ChannelType Blue() const = 0;
virtual ChannelType Alpha() const
{ return wxALPHA_OPAQUE ; }
virtual bool IsSolid() const
{ return true; }
// implemented in colourcmn.cpp
virtual wxString GetAsString(long flags = wxC2S_NAME | wxC2S_CSS_SYNTAX) const;
void SetRGB(wxUint32 colRGB)
{
Set((ChannelType)(0xFF & colRGB),
(ChannelType)(0xFF & (colRGB >> 8)),
(ChannelType)(0xFF & (colRGB >> 16)));
}
void SetRGBA(wxUint32 colRGBA)
{
Set((ChannelType)(0xFF & colRGBA),
(ChannelType)(0xFF & (colRGBA >> 8)),
(ChannelType)(0xFF & (colRGBA >> 16)),
(ChannelType)(0xFF & (colRGBA >> 24)));
}
wxUint32 GetRGB() const
{ return Red() | (Green() << 8) | (Blue() << 16); }
wxUint32 GetRGBA() const
{ return Red() | (Green() << 8) | (Blue() << 16) | (Alpha() << 24); }
#if !wxCOLOUR_IS_GDIOBJECT
virtual bool IsOk() const= 0;
// older version, for backwards compatibility only (but not deprecated
// because it's still widely used)
bool Ok() const { return IsOk(); }
#endif
// manipulation
// ------------
// These methods are static because they are mostly used
// within tight loops (where we don't want to instantiate wxColour's)
static void MakeMono (unsigned char* r, unsigned char* g, unsigned char* b, bool on);
static void MakeDisabled(unsigned char* r, unsigned char* g, unsigned char* b, unsigned char brightness = 255);
static void MakeGrey (unsigned char* r, unsigned char* g, unsigned char* b); // integer version
static void MakeGrey (unsigned char* r, unsigned char* g, unsigned char* b,
double weight_r, double weight_g, double weight_b); // floating point version
static unsigned char AlphaBlend (unsigned char fg, unsigned char bg, double alpha);
static void ChangeLightness(unsigned char* r, unsigned char* g, unsigned char* b, int ialpha);
wxColour ChangeLightness(int ialpha) const;
wxColour& MakeDisabled(unsigned char brightness = 255);
protected:
// Some ports need Init() and while we don't, provide a stub so that the
// ports which don't need it are not forced to define it
void Init() { }
virtual void
InitRGBA(ChannelType r, ChannelType g, ChannelType b, ChannelType a) = 0;
virtual bool FromString(const wxString& s);
#if wxCOLOUR_IS_GDIOBJECT
// wxColour doesn't use reference counted data (at least not in all ports)
// so provide stubs for the functions which need to be defined if we do use
// them
virtual wxGDIRefData *CreateGDIRefData() const wxOVERRIDE
{
wxFAIL_MSG( "must be overridden if used" );
return NULL;
}
virtual wxGDIRefData *CloneGDIRefData(const wxGDIRefData *WXUNUSED(data)) const wxOVERRIDE
{
wxFAIL_MSG( "must be overridden if used" );
return NULL;
}
#endif
};
// wxColour <-> wxString utilities, used by wxConfig, defined in colourcmn.cpp
WXDLLIMPEXP_CORE wxString wxToString(const wxColourBase& col);
WXDLLIMPEXP_CORE bool wxFromString(const wxString& str, wxColourBase* col);
#if defined(__WXMSW__)
#include "wx/msw/colour.h"
#elif defined(__WXMOTIF__)
#include "wx/motif/colour.h"
#elif defined(__WXGTK20__)
#include "wx/gtk/colour.h"
#elif defined(__WXGTK__)
#include "wx/gtk1/colour.h"
#elif defined(__WXDFB__)
#include "wx/generic/colour.h"
#elif defined(__WXX11__)
#include "wx/x11/colour.h"
#elif defined(__WXMAC__)
#include "wx/osx/colour.h"
#elif defined(__WXQT__)
#include "wx/qt/colour.h"
#endif
#define wxColor wxColour
#endif // _WX_COLOUR_H_BASE_
| h |
rticonnextdds-usecases | data/projects/rticonnextdds-usecases/VehicleTracking/ExampleCode/thirdparty/wxWidgets-3.1.2/Linux/include/wx/checkbox.h | ///////////////////////////////////////////////////////////////////////////////
// Name: wx/checkbox.h
// Purpose: wxCheckBox class interface
// Author: Vadim Zeitlin
// Modified by:
// Created: 07.09.00
// Copyright: (c) wxWidgets team
// Licence: wxWindows licence
///////////////////////////////////////////////////////////////////////////////
#ifndef _WX_CHECKBOX_H_BASE_
#define _WX_CHECKBOX_H_BASE_
#include "wx/defs.h"
#if wxUSE_CHECKBOX
#include "wx/control.h"
/*
* wxCheckBox style flags
* (Using wxCHK_* because wxCB_* is used by wxComboBox).
* Determine whether to use a 3-state or 2-state
* checkbox. 3-state enables to differentiate
* between 'unchecked', 'checked' and 'undetermined'.
*
* In addition to the styles here it is also possible to specify just 0 which
* is treated the same as wxCHK_2STATE for compatibility (but using explicit
* flag is preferred).
*/
#define wxCHK_2STATE 0x4000
#define wxCHK_3STATE 0x1000
/*
* If this style is set the user can set the checkbox to the
* undetermined state. If not set the undetermined set can only
* be set programmatically.
* This style can only be used with 3 state checkboxes.
*/
#define wxCHK_ALLOW_3RD_STATE_FOR_USER 0x2000
extern WXDLLIMPEXP_DATA_CORE(const char) wxCheckBoxNameStr[];
// ----------------------------------------------------------------------------
// wxCheckBox: a control which shows a label and a box which may be checked
// ----------------------------------------------------------------------------
class WXDLLIMPEXP_CORE wxCheckBoxBase : public wxControl
{
public:
wxCheckBoxBase() { }
// set/get the checked status of the listbox
virtual void SetValue(bool value) = 0;
virtual bool GetValue() const = 0;
bool IsChecked() const
{
wxASSERT_MSG( !Is3State(), wxT("Calling IsChecked() doesn't make sense for")
wxT(" a three state checkbox, Use Get3StateValue() instead") );
return GetValue();
}
wxCheckBoxState Get3StateValue() const
{
wxCheckBoxState state = DoGet3StateValue();
if ( state == wxCHK_UNDETERMINED && !Is3State() )
{
// Undetermined state with a 2-state checkbox??
wxFAIL_MSG( wxT("DoGet3StateValue() says the 2-state checkbox is ")
wxT("in an undetermined/third state") );
state = wxCHK_UNCHECKED;
}
return state;
}
void Set3StateValue(wxCheckBoxState state)
{
if ( state == wxCHK_UNDETERMINED && !Is3State() )
{
wxFAIL_MSG(wxT("Setting a 2-state checkbox to undetermined state"));
state = wxCHK_UNCHECKED;
}
DoSet3StateValue(state);
}
bool Is3State() const { return HasFlag(wxCHK_3STATE); }
bool Is3rdStateAllowedForUser() const
{
return HasFlag(wxCHK_ALLOW_3RD_STATE_FOR_USER);
}
virtual bool HasTransparentBackground() wxOVERRIDE { return true; }
// wxCheckBox-specific processing after processing the update event
virtual void DoUpdateWindowUI(wxUpdateUIEvent& event) wxOVERRIDE
{
wxControl::DoUpdateWindowUI(event);
if ( event.GetSetChecked() )
SetValue(event.GetChecked());
}
protected:
// choose the default border for this window
virtual wxBorder GetDefaultBorder() const wxOVERRIDE { return wxBORDER_NONE; }
virtual void DoSet3StateValue(wxCheckBoxState WXUNUSED(state)) { wxFAIL; }
virtual wxCheckBoxState DoGet3StateValue() const
{
wxFAIL;
return wxCHK_UNCHECKED;
}
// Helper function to be called from derived classes Create()
// implementations: it checks that the style doesn't contain any
// incompatible bits and modifies it to be sane if it does.
static void WXValidateStyle(long *stylePtr)
{
long& style = *stylePtr;
if ( !(style & (wxCHK_2STATE | wxCHK_3STATE)) )
{
// For compatibility we use absence of style flags as wxCHK_2STATE
// because wxCHK_2STATE used to have the value of 0 and some
// existing code uses 0 instead of it. Moreover, some code even
// uses some non-0 style, e.g. wxBORDER_XXX, but doesn't specify
// neither wxCHK_2STATE nor wxCHK_3STATE -- to avoid breaking it,
// assume (much more common) 2 state checkbox by default.
style |= wxCHK_2STATE;
}
if ( style & wxCHK_3STATE )
{
if ( style & wxCHK_2STATE )
{
wxFAIL_MSG( "wxCHK_2STATE and wxCHK_3STATE can't be used "
"together" );
style &= ~wxCHK_3STATE;
}
}
else // No wxCHK_3STATE
{
if ( style & wxCHK_ALLOW_3RD_STATE_FOR_USER )
{
wxFAIL_MSG( "wxCHK_ALLOW_3RD_STATE_FOR_USER doesn't make sense "
"without wxCHK_3STATE" );
style &= ~wxCHK_ALLOW_3RD_STATE_FOR_USER;
}
}
}
private:
wxDECLARE_NO_COPY_CLASS(wxCheckBoxBase);
};
// Most ports support 3 state checkboxes so define this by default.
#define wxHAS_3STATE_CHECKBOX
#if defined(__WXUNIVERSAL__)
#include "wx/univ/checkbox.h"
#elif defined(__WXMSW__)
#include "wx/msw/checkbox.h"
#elif defined(__WXMOTIF__)
#include "wx/motif/checkbox.h"
#elif defined(__WXGTK20__)
#include "wx/gtk/checkbox.h"
#elif defined(__WXGTK__)
#undef wxHAS_3STATE_CHECKBOX
#include "wx/gtk1/checkbox.h"
#elif defined(__WXMAC__)
#include "wx/osx/checkbox.h"
#elif defined(__WXQT__)
#include "wx/qt/checkbox.h"
#endif
#endif // wxUSE_CHECKBOX
#endif // _WX_CHECKBOX_H_BASE_
| h |
rticonnextdds-usecases | data/projects/rticonnextdds-usecases/VehicleTracking/ExampleCode/thirdparty/wxWidgets-3.1.2/Linux/include/wx/snglinst.h | ///////////////////////////////////////////////////////////////////////////////
// Name: wx/snglinst.h
// Purpose: wxSingleInstanceChecker can be used to restrict the number of
// simultaneously running copies of a program to one
// Author: Vadim Zeitlin
// Modified by:
// Created: 08.06.01
// Copyright: (c) 2001 Vadim Zeitlin <[email protected]>
// Licence: wxWindows licence
///////////////////////////////////////////////////////////////////////////////
#ifndef _WX_SNGLINST_H_
#define _WX_SNGLINST_H_
#if wxUSE_SNGLINST_CHECKER
#include "wx/app.h"
#include "wx/utils.h"
// ----------------------------------------------------------------------------
// wxSingleInstanceChecker
// ----------------------------------------------------------------------------
class WXDLLIMPEXP_BASE wxSingleInstanceChecker
{
public:
// default ctor, use Create() after it
wxSingleInstanceChecker() { Init(); }
// like Create() but no error checking (dangerous!)
wxSingleInstanceChecker(const wxString& name,
const wxString& path = wxEmptyString)
{
Init();
Create(name, path);
}
// notice that calling Create() is optional now, if you don't do it before
// calling IsAnotherRunning(), CreateDefault() is used automatically
//
// name it is used as the mutex name under Win32 and the lock file name
// under Unix so it should be as unique as possible and must be non-empty
//
// path is optional and is ignored under Win32 and used as the directory to
// create the lock file in under Unix (default is wxGetHomeDir())
//
// returns false if initialization failed, it doesn't mean that another
// instance is running - use IsAnotherRunning() to check it
bool Create(const wxString& name, const wxString& path = wxEmptyString);
// use the default name, which is a combination of wxTheApp->GetAppName()
// and wxGetUserId() for mutex/lock file
//
// this is called implicitly by IsAnotherRunning() if the checker hadn't
// been created until then
bool CreateDefault()
{
wxCHECK_MSG( wxTheApp, false, "must have application instance" );
return Create(wxTheApp->GetAppName() + '-' + wxGetUserId());
}
// is another copy of this program already running?
bool IsAnotherRunning() const
{
if ( !m_impl )
{
if ( !const_cast<wxSingleInstanceChecker *>(this)->CreateDefault() )
{
// if creation failed, return false as it's better to not
// prevent this instance from starting up if there is an error
return false;
}
}
return DoIsAnotherRunning();
}
// dtor is not virtual, this class is not meant to be used polymorphically
~wxSingleInstanceChecker();
private:
// common part of all ctors
void Init() { m_impl = NULL; }
// do check if another instance is running, called only if m_impl != NULL
bool DoIsAnotherRunning() const;
// the implementation details (platform specific)
class WXDLLIMPEXP_FWD_BASE wxSingleInstanceCheckerImpl *m_impl;
wxDECLARE_NO_COPY_CLASS(wxSingleInstanceChecker);
};
#endif // wxUSE_SNGLINST_CHECKER
#endif // _WX_SNGLINST_H_
| h |
rticonnextdds-usecases | data/projects/rticonnextdds-usecases/VehicleTracking/ExampleCode/thirdparty/wxWidgets-3.1.2/Linux/include/wx/tipdlg.h | ///////////////////////////////////////////////////////////////////////////////
// Name: wx/tipdlg.h
// Purpose: declaration of wxTipDialog
// Author: Vadim Zeitlin
// Modified by:
// Created: 28.06.99
// Copyright: (c) Vadim Zeitlin
// Licence: wxWindows licence
///////////////////////////////////////////////////////////////////////////////
#ifndef _WX_TIPDLG_H_
#define _WX_TIPDLG_H_
// ----------------------------------------------------------------------------
// headers which we must include here
// ----------------------------------------------------------------------------
#include "wx/defs.h"
#if wxUSE_STARTUP_TIPS
#include "wx/textfile.h"
// ----------------------------------------------------------------------------
// wxTipProvider - a class which is used by wxTipDialog to get the text of the
// tips
// ----------------------------------------------------------------------------
// the abstract base class: it provides the tips, i.e. implements the GetTip()
// function which returns the new tip each time it's called. To support this,
// wxTipProvider evidently needs some internal state which is the tip "index"
// and which should be saved/restored by the program to not always show one and
// the same tip (of course, you may use random starting position as well...)
class WXDLLIMPEXP_ADV wxTipProvider
{
public:
wxTipProvider(size_t currentTip) { m_currentTip = currentTip; }
// get the current tip and update the internal state to return the next tip
// when called for the next time
virtual wxString GetTip() = 0;
// get the current tip "index" (or whatever allows the tip provider to know
// from where to start the next time)
size_t GetCurrentTip() const { return m_currentTip; }
// virtual dtor for the base class
virtual ~wxTipProvider() { }
#if WXWIN_COMPATIBILITY_3_0
wxDEPRECATED_MSG("this method does nothing, simply don't call it")
wxString PreprocessTip(const wxString& tip) { return tip; }
#endif
protected:
size_t m_currentTip;
};
// a function which returns an implementation of wxTipProvider using the
// specified text file as the source of tips (each line is a tip).
//
// NB: the caller is responsible for deleting the pointer!
#if wxUSE_TEXTFILE
WXDLLIMPEXP_ADV wxTipProvider *wxCreateFileTipProvider(const wxString& filename,
size_t currentTip);
#endif // wxUSE_TEXTFILE
// ----------------------------------------------------------------------------
// wxTipDialog
// ----------------------------------------------------------------------------
// A dialog which shows a "tip" - a short and helpful messages describing to
// the user some program characteristic. Many programs show the tips at
// startup, so the dialog has "Show tips on startup" checkbox which allows to
// the user to disable this (however, it's the program which should show, or
// not, the dialog on startup depending on its value, not this class).
//
// The function returns true if this checkbox is checked, false otherwise.
WXDLLIMPEXP_ADV bool wxShowTip(wxWindow *parent,
wxTipProvider *tipProvider,
bool showAtStartup = true);
#endif // wxUSE_STARTUP_TIPS
#endif // _WX_TIPDLG_H_
| h |
rticonnextdds-usecases | data/projects/rticonnextdds-usecases/VehicleTracking/ExampleCode/thirdparty/wxWidgets-3.1.2/Linux/include/wx/bmpbuttn.h | /////////////////////////////////////////////////////////////////////////////
// Name: wx/bmpbuttn.h
// Purpose: wxBitmapButton class interface
// Author: Vadim Zeitlin
// Modified by:
// Created: 25.08.00
// Copyright: (c) 2000 Vadim Zeitlin
// Licence: wxWindows licence
/////////////////////////////////////////////////////////////////////////////
#ifndef _WX_BMPBUTTON_H_BASE_
#define _WX_BMPBUTTON_H_BASE_
#include "wx/defs.h"
#if wxUSE_BMPBUTTON
#include "wx/button.h"
// FIXME: right now only wxMSW, wxGTK and wxOSX implement bitmap support in wxButton
// itself, this shouldn't be used for the other platforms neither
// when all of them do it
#if (defined(__WXMSW__) || defined(__WXGTK20__) || defined(__WXOSX__) || defined(__WXQT__)) && !defined(__WXUNIVERSAL__)
#define wxHAS_BUTTON_BITMAP
#endif
class WXDLLIMPEXP_FWD_CORE wxBitmapButton;
// ----------------------------------------------------------------------------
// wxBitmapButton: a button which shows bitmaps instead of the usual string.
// It has different bitmaps for different states (focused/disabled/pressed)
// ----------------------------------------------------------------------------
class WXDLLIMPEXP_CORE wxBitmapButtonBase : public wxButton
{
public:
wxBitmapButtonBase()
{
#ifndef wxHAS_BUTTON_BITMAP
m_marginX =
m_marginY = 0;
#endif // wxHAS_BUTTON_BITMAP
}
bool Create(wxWindow *parent,
wxWindowID winid,
const wxPoint& pos,
const wxSize& size,
long style,
const wxValidator& validator,
const wxString& name)
{
// We use wxBU_NOTEXT to let the base class Create() know that we are
// not going to show the label: this is a hack needed for wxGTK where
// we can show both label and bitmap only with GTK 2.6+ but we always
// can show just one of them and this style allows us to choose which
// one we need.
//
// And we also use wxBU_EXACTFIT to avoid being resized up to the
// standard button size as this doesn't make sense for bitmap buttons
// which are not standard anyhow and should fit their bitmap size.
return wxButton::Create(parent, winid, wxString(),
pos, size,
style | wxBU_NOTEXT | wxBU_EXACTFIT,
validator, name);
}
// Special creation function for a standard "Close" bitmap. It allows to
// simply create a close button with the image appropriate for the current
// platform.
static wxBitmapButton* NewCloseButton(wxWindow* parent, wxWindowID winid);
// set/get the margins around the button
virtual void SetMargins(int x, int y)
{
DoSetBitmapMargins(x, y);
}
int GetMarginX() const { return DoGetBitmapMargins().x; }
int GetMarginY() const { return DoGetBitmapMargins().y; }
protected:
#ifndef wxHAS_BUTTON_BITMAP
// function called when any of the bitmaps changes
virtual void OnSetBitmap() { InvalidateBestSize(); Refresh(); }
virtual wxBitmap DoGetBitmap(State which) const { return m_bitmaps[which]; }
virtual void DoSetBitmap(const wxBitmap& bitmap, State which)
{ m_bitmaps[which] = bitmap; OnSetBitmap(); }
virtual wxSize DoGetBitmapMargins() const
{
return wxSize(m_marginX, m_marginY);
}
virtual void DoSetBitmapMargins(int x, int y)
{
m_marginX = x;
m_marginY = y;
}
// the bitmaps for various states
wxBitmap m_bitmaps[State_Max];
// the margins around the bitmap
int m_marginX,
m_marginY;
#endif // !wxHAS_BUTTON_BITMAP
wxDECLARE_NO_COPY_CLASS(wxBitmapButtonBase);
};
#if defined(__WXUNIVERSAL__)
#include "wx/univ/bmpbuttn.h"
#elif defined(__WXMSW__)
#include "wx/msw/bmpbuttn.h"
#elif defined(__WXMOTIF__)
#include "wx/motif/bmpbuttn.h"
#elif defined(__WXGTK20__)
#include "wx/gtk/bmpbuttn.h"
#elif defined(__WXGTK__)
#include "wx/gtk1/bmpbuttn.h"
#elif defined(__WXMAC__)
#include "wx/osx/bmpbuttn.h"
#elif defined(__WXQT__)
#include "wx/qt/bmpbuttn.h"
#endif
#endif // wxUSE_BMPBUTTON
#endif // _WX_BMPBUTTON_H_BASE_
| h |
rticonnextdds-usecases | data/projects/rticonnextdds-usecases/VehicleTracking/ExampleCode/thirdparty/wxWidgets-3.1.2/Linux/include/wx/sysopt.h | /////////////////////////////////////////////////////////////////////////////
// Name: wx/sysopt.h
// Purpose: wxSystemOptions
// Author: Julian Smart
// Modified by:
// Created: 2001-07-10
// Copyright: (c) Julian Smart
// Licence: wxWindows licence
/////////////////////////////////////////////////////////////////////////////
#ifndef _WX_SYSOPT_H_
#define _WX_SYSOPT_H_
#include "wx/object.h"
// ----------------------------------------------------------------------------
// Enables an application to influence the wxWidgets implementation
// ----------------------------------------------------------------------------
class
#if wxUSE_SYSTEM_OPTIONS
WXDLLIMPEXP_BASE
#endif
wxSystemOptions : public wxObject
{
public:
wxSystemOptions() { }
// User-customizable hints to wxWidgets or associated libraries
// These could also be used to influence GetSystem... calls, indeed
// to implement SetSystemColour/Font/Metric
#if wxUSE_SYSTEM_OPTIONS
static void SetOption(const wxString& name, const wxString& value);
static void SetOption(const wxString& name, int value);
#endif // wxUSE_SYSTEM_OPTIONS
static wxString GetOption(const wxString& name);
static int GetOptionInt(const wxString& name);
static bool HasOption(const wxString& name);
static bool IsFalse(const wxString& name)
{
return HasOption(name) && GetOptionInt(name) == 0;
}
};
#if !wxUSE_SYSTEM_OPTIONS
// define inline stubs for accessors to make it possible to use wxSystemOptions
// in the library itself without checking for wxUSE_SYSTEM_OPTIONS all the time
/* static */ inline
wxString wxSystemOptions::GetOption(const wxString& WXUNUSED(name))
{
return wxEmptyString;
}
/* static */ inline
int wxSystemOptions::GetOptionInt(const wxString& WXUNUSED(name))
{
return 0;
}
/* static */ inline
bool wxSystemOptions::HasOption(const wxString& WXUNUSED(name))
{
return false;
}
#endif // !wxUSE_SYSTEM_OPTIONS
#endif
// _WX_SYSOPT_H_
| h |
rticonnextdds-usecases | data/projects/rticonnextdds-usecases/VehicleTracking/ExampleCode/thirdparty/wxWidgets-3.1.2/Linux/include/wx/matrix.h | /////////////////////////////////////////////////////////////////////////////
// Name: wx/matrix.h
// Purpose: wxTransformMatrix class. NOT YET USED
// Author: Chris Breeze, Julian Smart
// Modified by: Klaas Holwerda
// Created: 01/02/97
// Copyright: (c) Julian Smart, Chris Breeze
// Licence: wxWindows licence
/////////////////////////////////////////////////////////////////////////////
#ifndef _WX_MATRIXH__
#define _WX_MATRIXH__
//! headerfiles="matrix.h wx/object.h"
#include "wx/object.h"
#include "wx/math.h"
//! codefiles="matrix.cpp"
// A simple 3x3 matrix. This may be replaced by a more general matrix
// class some day.
//
// Note: this is intended to be used in wxDC at some point to replace
// the current system of scaling/translation. It is not yet used.
//:definition
// A 3x3 matrix to do 2D transformations.
// It can be used to map data to window coordinates,
// and also for manipulating your own data.
// For example drawing a picture (composed of several primitives)
// at a certain coordinate and angle within another parent picture.
// At all times m_isIdentity is set if the matrix itself is an Identity matrix.
// It is used where possible to optimize calculations.
class WXDLLIMPEXP_CORE wxTransformMatrix: public wxObject
{
public:
wxTransformMatrix(void);
wxTransformMatrix(const wxTransformMatrix& mat);
//get the value in the matrix at col,row
//rows are horizontal (second index of m_matrix member)
//columns are vertical (first index of m_matrix member)
double GetValue(int col, int row) const;
//set the value in the matrix at col,row
//rows are horizontal (second index of m_matrix member)
//columns are vertical (first index of m_matrix member)
void SetValue(int col, int row, double value);
void operator = (const wxTransformMatrix& mat);
bool operator == (const wxTransformMatrix& mat) const;
bool operator != (const wxTransformMatrix& mat) const;
//multiply every element by t
wxTransformMatrix& operator*=(const double& t);
//divide every element by t
wxTransformMatrix& operator/=(const double& t);
//add matrix m to this t
wxTransformMatrix& operator+=(const wxTransformMatrix& m);
//subtract matrix m from this
wxTransformMatrix& operator-=(const wxTransformMatrix& m);
//multiply matrix m with this
wxTransformMatrix& operator*=(const wxTransformMatrix& m);
// constant operators
//multiply every element by t and return result
wxTransformMatrix operator*(const double& t) const;
//divide this matrix by t and return result
wxTransformMatrix operator/(const double& t) const;
//add matrix m to this and return result
wxTransformMatrix operator+(const wxTransformMatrix& m) const;
//subtract matrix m from this and return result
wxTransformMatrix operator-(const wxTransformMatrix& m) const;
//multiply this by matrix m and return result
wxTransformMatrix operator*(const wxTransformMatrix& m) const;
wxTransformMatrix operator-() const;
//rows are horizontal (second index of m_matrix member)
//columns are vertical (first index of m_matrix member)
double& operator()(int col, int row);
//rows are horizontal (second index of m_matrix member)
//columns are vertical (first index of m_matrix member)
double operator()(int col, int row) const;
// Invert matrix
bool Invert(void);
// Make into identity matrix
bool Identity(void);
// Is the matrix the identity matrix?
// Only returns a flag, which is set whenever an operation
// is done.
inline bool IsIdentity(void) const { return m_isIdentity; }
// This does an actual check.
inline bool IsIdentity1(void) const ;
//Scale by scale (isotropic scaling i.e. the same in x and y):
//!ex:
//!code: | scale 0 0 |
//!code: matrix' = | 0 scale 0 | x matrix
//!code: | 0 0 scale |
bool Scale(double scale);
//Scale with center point and x/y scale
//
//!ex:
//!code: | xs 0 xc(1-xs) |
//!code: matrix' = | 0 ys yc(1-ys) | x matrix
//!code: | 0 0 1 |
wxTransformMatrix& Scale(const double &xs, const double &ys,const double &xc, const double &yc);
// mirror a matrix in x, y
//!ex:
//!code: | -1 0 0 |
//!code: matrix' = | 0 -1 0 | x matrix
//!code: | 0 0 1 |
wxTransformMatrix& Mirror(bool x=true, bool y=false);
// Translate by dx, dy:
//!ex:
//!code: | 1 0 dx |
//!code: matrix' = | 0 1 dy | x matrix
//!code: | 0 0 1 |
bool Translate(double x, double y);
// Rotate clockwise by the given number of degrees:
//!ex:
//!code: | cos sin 0 |
//!code: matrix' = | -sin cos 0 | x matrix
//!code: | 0 0 1 |
bool Rotate(double angle);
//Rotate counter clockwise with point of rotation
//
//!ex:
//!code: | cos(r) -sin(r) x(1-cos(r))+y(sin(r)|
//!code: matrix' = | sin(r) cos(r) y(1-cos(r))-x(sin(r)| x matrix
//!code: | 0 0 1 |
wxTransformMatrix& Rotate(const double &r, const double &x, const double &y);
// Transform X value from logical to device
inline double TransformX(double x) const;
// Transform Y value from logical to device
inline double TransformY(double y) const;
// Transform a point from logical to device coordinates
bool TransformPoint(double x, double y, double& tx, double& ty) const;
// Transform a point from device to logical coordinates.
// Example of use:
// wxTransformMatrix mat = dc.GetTransformation();
// mat.Invert();
// mat.InverseTransformPoint(x, y, x1, y1);
// OR (shorthand:)
// dc.LogicalToDevice(x, y, x1, y1);
// The latter is slightly less efficient if we're doing several
// conversions, since the matrix is inverted several times.
// N.B. 'this' matrix is the inverse at this point
bool InverseTransformPoint(double x, double y, double& tx, double& ty) const;
double Get_scaleX();
double Get_scaleY();
double GetRotation();
void SetRotation(double rotation);
public:
double m_matrix[3][3];
bool m_isIdentity;
};
/*
Chris Breeze reported, that
some functions of wxTransformMatrix cannot work because it is not
known if he matrix has been inverted. Be careful when using it.
*/
// Transform X value from logical to device
// warning: this function can only be used for this purpose
// because no rotation is involved when mapping logical to device coordinates
// mirror and scaling for x and y will be part of the matrix
// if you have a matrix that is rotated, eg a shape containing a matrix to place
// it in the logical coordinate system, use TransformPoint
inline double wxTransformMatrix::TransformX(double x) const
{
//normally like this, but since no rotation is involved (only mirror and scale)
//we can do without Y -> m_matrix[1]{0] is -sin(rotation angle) and therefore zero
//(x * m_matrix[0][0] + y * m_matrix[1][0] + m_matrix[2][0]))
return (m_isIdentity ? x : (x * m_matrix[0][0] + m_matrix[2][0]));
}
// Transform Y value from logical to device
// warning: this function can only be used for this purpose
// because no rotation is involved when mapping logical to device coordinates
// mirror and scaling for x and y will be part of the matrix
// if you have a matrix that is rotated, eg a shape containing a matrix to place
// it in the logical coordinate system, use TransformPoint
inline double wxTransformMatrix::TransformY(double y) const
{
//normally like this, but since no rotation is involved (only mirror and scale)
//we can do without X -> m_matrix[0]{1] is sin(rotation angle) and therefore zero
//(x * m_matrix[0][1] + y * m_matrix[1][1] + m_matrix[2][1]))
return (m_isIdentity ? y : (y * m_matrix[1][1] + m_matrix[2][1]));
}
// Is the matrix the identity matrix?
// Each operation checks whether the result is still the identity matrix and sets a flag.
inline bool wxTransformMatrix::IsIdentity1(void) const
{
return
( wxIsSameDouble(m_matrix[0][0], 1.0) &&
wxIsSameDouble(m_matrix[1][1], 1.0) &&
wxIsSameDouble(m_matrix[2][2], 1.0) &&
wxIsSameDouble(m_matrix[1][0], 0.0) &&
wxIsSameDouble(m_matrix[2][0], 0.0) &&
wxIsSameDouble(m_matrix[0][1], 0.0) &&
wxIsSameDouble(m_matrix[2][1], 0.0) &&
wxIsSameDouble(m_matrix[0][2], 0.0) &&
wxIsSameDouble(m_matrix[1][2], 0.0) );
}
// Calculates the determinant of a 2 x 2 matrix
inline double wxCalculateDet(double a11, double a21, double a12, double a22)
{
return a11 * a22 - a12 * a21;
}
#endif // _WX_MATRIXH__
| h |
rticonnextdds-usecases | data/projects/rticonnextdds-usecases/VehicleTracking/ExampleCode/thirdparty/wxWidgets-3.1.2/Linux/include/wx/custombgwin.h | ///////////////////////////////////////////////////////////////////////////////
// Name: wx/custombgwin.h
// Purpose: Class adding support for custom window backgrounds.
// Author: Vadim Zeitlin
// Created: 2011-10-10
// Copyright: (c) 2011 Vadim Zeitlin <[email protected]>
// Licence: wxWindows licence
///////////////////////////////////////////////////////////////////////////////
#ifndef _WX_CUSTOMBGWIN_H_
#define _WX_CUSTOMBGWIN_H_
#include "wx/defs.h"
class WXDLLIMPEXP_FWD_CORE wxBitmap;
// ----------------------------------------------------------------------------
// wxCustomBackgroundWindow: Adds support for custom backgrounds to any
// wxWindow-derived class.
// ----------------------------------------------------------------------------
class wxCustomBackgroundWindowBase
{
public:
// Trivial default ctor.
wxCustomBackgroundWindowBase() { }
// Also a trivial but virtual -- to suppress g++ warnings -- dtor.
virtual ~wxCustomBackgroundWindowBase() { }
// Use the given bitmap to tile the background of this window. This bitmap
// will show through any transparent children.
//
// Notice that you must not prevent the base class EVT_ERASE_BACKGROUND
// handler from running (i.e. not to handle this event yourself) for this
// to work.
void SetBackgroundBitmap(const wxBitmap& bmp)
{
DoSetBackgroundBitmap(bmp);
}
protected:
virtual void DoSetBackgroundBitmap(const wxBitmap& bmp) = 0;
wxDECLARE_NO_COPY_CLASS(wxCustomBackgroundWindowBase);
};
#if defined(__WXUNIVERSAL__)
#include "wx/univ/custombgwin.h"
#elif defined(__WXMSW__)
#include "wx/msw/custombgwin.h"
#else
#include "wx/generic/custombgwin.h"
#endif
#endif // _WX_CUSTOMBGWIN_H_
| h |
rticonnextdds-usecases | data/projects/rticonnextdds-usecases/VehicleTracking/ExampleCode/thirdparty/wxWidgets-3.1.2/Linux/include/wx/textfile.h | ///////////////////////////////////////////////////////////////////////////////
// Name: wx/textfile.h
// Purpose: class wxTextFile to work with text files of _small_ size
// (file is fully loaded in memory) and which understands CR/LF
// differences between platforms.
// Author: Vadim Zeitlin
// Modified by:
// Created: 03.04.98
// Copyright: (c) 1998 Vadim Zeitlin <[email protected]>
// Licence: wxWindows licence
///////////////////////////////////////////////////////////////////////////////
#ifndef _WX_TEXTFILE_H
#define _WX_TEXTFILE_H
#include "wx/defs.h"
#include "wx/textbuf.h"
#if wxUSE_TEXTFILE
#include "wx/file.h"
// ----------------------------------------------------------------------------
// wxTextFile
// ----------------------------------------------------------------------------
class WXDLLIMPEXP_BASE wxTextFile : public wxTextBuffer
{
public:
// constructors
wxTextFile() { }
wxTextFile(const wxString& strFileName);
protected:
// implement the base class pure virtuals
virtual bool OnExists() const wxOVERRIDE;
virtual bool OnOpen(const wxString &strBufferName,
wxTextBufferOpenMode openMode) wxOVERRIDE;
virtual bool OnClose() wxOVERRIDE;
virtual bool OnRead(const wxMBConv& conv) wxOVERRIDE;
virtual bool OnWrite(wxTextFileType typeNew, const wxMBConv& conv) wxOVERRIDE;
private:
wxFile m_file;
wxDECLARE_NO_COPY_CLASS(wxTextFile);
};
#else // !wxUSE_TEXTFILE
// old code relies on the static methods of wxTextFile being always available
// and they still are available in wxTextBuffer (even if !wxUSE_TEXTBUFFER), so
// make it possible to use them in a backwards compatible way
typedef wxTextBuffer wxTextFile;
#endif // wxUSE_TEXTFILE/!wxUSE_TEXTFILE
#endif // _WX_TEXTFILE_H
| h |
rticonnextdds-usecases | data/projects/rticonnextdds-usecases/VehicleTracking/ExampleCode/thirdparty/wxWidgets-3.1.2/Linux/include/wx/mediactrl.h | ///////////////////////////////////////////////////////////////////////////////
// Name: wx/mediactrl.h
// Purpose: wxMediaCtrl class
// Author: Ryan Norton <[email protected]>
// Modified by:
// Created: 11/07/04
// Copyright: (c) Ryan Norton
// Licence: wxWindows licence
///////////////////////////////////////////////////////////////////////////////
// ============================================================================
// Definitions
// ============================================================================
// ----------------------------------------------------------------------------
// Header guard
// ----------------------------------------------------------------------------
#ifndef _WX_MEDIACTRL_H_
#define _WX_MEDIACTRL_H_
// ----------------------------------------------------------------------------
// Pre-compiled header stuff
// ----------------------------------------------------------------------------
#include "wx/defs.h"
// ----------------------------------------------------------------------------
// Compilation guard
// ----------------------------------------------------------------------------
#if wxUSE_MEDIACTRL
// ----------------------------------------------------------------------------
// Includes
// ----------------------------------------------------------------------------
#include "wx/control.h"
#include "wx/uri.h"
// ============================================================================
// Declarations
// ============================================================================
// ----------------------------------------------------------------------------
//
// Enumerations
//
// ----------------------------------------------------------------------------
enum wxMediaState
{
wxMEDIASTATE_STOPPED,
wxMEDIASTATE_PAUSED,
wxMEDIASTATE_PLAYING
};
enum wxMediaCtrlPlayerControls
{
wxMEDIACTRLPLAYERCONTROLS_NONE = 0,
//Step controls like fastforward, step one frame etc.
wxMEDIACTRLPLAYERCONTROLS_STEP = 1 << 0,
//Volume controls like the speaker icon, volume slider, etc.
wxMEDIACTRLPLAYERCONTROLS_VOLUME = 1 << 1,
wxMEDIACTRLPLAYERCONTROLS_DEFAULT =
wxMEDIACTRLPLAYERCONTROLS_STEP |
wxMEDIACTRLPLAYERCONTROLS_VOLUME
};
#define wxMEDIABACKEND_DIRECTSHOW wxT("wxAMMediaBackend")
#define wxMEDIABACKEND_MCI wxT("wxMCIMediaBackend")
#define wxMEDIABACKEND_QUICKTIME wxT("wxQTMediaBackend")
#define wxMEDIABACKEND_GSTREAMER wxT("wxGStreamerMediaBackend")
#define wxMEDIABACKEND_REALPLAYER wxT("wxRealPlayerMediaBackend")
#define wxMEDIABACKEND_WMP10 wxT("wxWMP10MediaBackend")
// ----------------------------------------------------------------------------
//
// wxMediaEvent
//
// ----------------------------------------------------------------------------
class WXDLLIMPEXP_MEDIA wxMediaEvent : public wxNotifyEvent
{
public:
// ------------------------------------------------------------------------
// wxMediaEvent Constructor
//
// Normal constructor, much the same as wxNotifyEvent
// ------------------------------------------------------------------------
wxMediaEvent(wxEventType commandType = wxEVT_NULL, int winid = 0)
: wxNotifyEvent(commandType, winid)
{ }
// ------------------------------------------------------------------------
// wxMediaEvent Copy Constructor
//
// Normal copy constructor, much the same as wxNotifyEvent
// ------------------------------------------------------------------------
wxMediaEvent(const wxMediaEvent &clone)
: wxNotifyEvent(clone)
{ }
// ------------------------------------------------------------------------
// wxMediaEvent::Clone
//
// Allocates a copy of this object.
// Required for wxEvtHandler::AddPendingEvent
// ------------------------------------------------------------------------
virtual wxEvent *Clone() const wxOVERRIDE
{ return new wxMediaEvent(*this); }
// Put this class on wxWidget's RTTI table
wxDECLARE_DYNAMIC_CLASS(wxMediaEvent);
};
// ----------------------------------------------------------------------------
//
// wxMediaCtrl
//
// ----------------------------------------------------------------------------
class WXDLLIMPEXP_MEDIA wxMediaCtrl : public wxControl
{
public:
wxMediaCtrl() : m_imp(NULL), m_bLoaded(false)
{ }
wxMediaCtrl(wxWindow* parent, wxWindowID winid,
const wxString& fileName = wxEmptyString,
const wxPoint& pos = wxDefaultPosition,
const wxSize& size = wxDefaultSize,
long style = 0,
const wxString& szBackend = wxEmptyString,
const wxValidator& validator = wxDefaultValidator,
const wxString& name = wxT("mediaCtrl"))
: m_imp(NULL), m_bLoaded(false)
{ Create(parent, winid, fileName, pos, size, style,
szBackend, validator, name); }
wxMediaCtrl(wxWindow* parent, wxWindowID winid,
const wxURI& location,
const wxPoint& pos = wxDefaultPosition,
const wxSize& size = wxDefaultSize,
long style = 0,
const wxString& szBackend = wxEmptyString,
const wxValidator& validator = wxDefaultValidator,
const wxString& name = wxT("mediaCtrl"))
: m_imp(NULL), m_bLoaded(false)
{ Create(parent, winid, location, pos, size, style,
szBackend, validator, name); }
virtual ~wxMediaCtrl();
bool Create(wxWindow* parent, wxWindowID winid,
const wxString& fileName = wxEmptyString,
const wxPoint& pos = wxDefaultPosition,
const wxSize& size = wxDefaultSize,
long style = 0,
const wxString& szBackend = wxEmptyString,
const wxValidator& validator = wxDefaultValidator,
const wxString& name = wxT("mediaCtrl"));
bool Create(wxWindow* parent, wxWindowID winid,
const wxURI& location,
const wxPoint& pos = wxDefaultPosition,
const wxSize& size = wxDefaultSize,
long style = 0,
const wxString& szBackend = wxEmptyString,
const wxValidator& validator = wxDefaultValidator,
const wxString& name = wxT("mediaCtrl"));
bool DoCreate(const wxClassInfo* instance,
wxWindow* parent, wxWindowID winid,
const wxPoint& pos = wxDefaultPosition,
const wxSize& size = wxDefaultSize,
long style = 0,
const wxValidator& validator = wxDefaultValidator,
const wxString& name = wxT("mediaCtrl"));
bool Play();
bool Pause();
bool Stop();
bool Load(const wxString& fileName);
wxMediaState GetState();
wxFileOffset Seek(wxFileOffset where, wxSeekMode mode = wxFromStart);
wxFileOffset Tell(); //FIXME: This should be const
wxFileOffset Length(); //FIXME: This should be const
double GetPlaybackRate(); //All but MCI & GStreamer
bool SetPlaybackRate(double dRate); //All but MCI & GStreamer
bool Load(const wxURI& location);
bool Load(const wxURI& location, const wxURI& proxy);
wxFileOffset GetDownloadProgress(); // DirectShow only
wxFileOffset GetDownloadTotal(); // DirectShow only
double GetVolume();
bool SetVolume(double dVolume);
bool ShowPlayerControls(
wxMediaCtrlPlayerControls flags = wxMEDIACTRLPLAYERCONTROLS_DEFAULT);
//helpers for the wxPython people
bool LoadURI(const wxString& fileName)
{ return Load(wxURI(fileName)); }
bool LoadURIWithProxy(const wxString& fileName, const wxString& proxy)
{ return Load(wxURI(fileName), wxURI(proxy)); }
protected:
static const wxClassInfo* NextBackend(wxClassInfo::const_iterator* it);
void OnMediaFinished(wxMediaEvent& evt);
virtual void DoMoveWindow(int x, int y, int w, int h) wxOVERRIDE;
wxSize DoGetBestSize() const wxOVERRIDE;
class wxMediaBackend* m_imp;
bool m_bLoaded;
wxDECLARE_DYNAMIC_CLASS(wxMediaCtrl);
};
// ----------------------------------------------------------------------------
//
// wxMediaBackend
//
// Derive from this and use standard wxWidgets RTTI
// (wxDECLARE_DYNAMIC_CLASS and wxIMPLEMENT_CLASS) to make a backend
// for wxMediaCtrl. Backends are searched alphabetically -
// the one with the earliest letter is tried first.
//
// Note that this is currently not API or ABI compatible -
// so statically link or make the client compile on-site.
//
// ----------------------------------------------------------------------------
class WXDLLIMPEXP_MEDIA wxMediaBackend : public wxObject
{
public:
wxMediaBackend()
{ }
virtual ~wxMediaBackend();
virtual bool CreateControl(wxControl* WXUNUSED(ctrl),
wxWindow* WXUNUSED(parent),
wxWindowID WXUNUSED(winid),
const wxPoint& WXUNUSED(pos),
const wxSize& WXUNUSED(size),
long WXUNUSED(style),
const wxValidator& WXUNUSED(validator),
const wxString& WXUNUSED(name))
{ return false; }
virtual bool Play()
{ return false; }
virtual bool Pause()
{ return false; }
virtual bool Stop()
{ return false; }
virtual bool Load(const wxString& WXUNUSED(fileName))
{ return false; }
virtual bool Load(const wxURI& WXUNUSED(location))
{ return false; }
virtual bool SetPosition(wxLongLong WXUNUSED(where))
{ return 0; }
virtual wxLongLong GetPosition()
{ return 0; }
virtual wxLongLong GetDuration()
{ return 0; }
virtual void Move(int WXUNUSED(x), int WXUNUSED(y),
int WXUNUSED(w), int WXUNUSED(h))
{ }
virtual wxSize GetVideoSize() const
{ return wxSize(0,0); }
virtual double GetPlaybackRate()
{ return 0.0; }
virtual bool SetPlaybackRate(double WXUNUSED(dRate))
{ return false; }
virtual wxMediaState GetState()
{ return wxMEDIASTATE_STOPPED; }
virtual double GetVolume()
{ return 0.0; }
virtual bool SetVolume(double WXUNUSED(dVolume))
{ return false; }
virtual bool Load(const wxURI& WXUNUSED(location),
const wxURI& WXUNUSED(proxy))
{ return false; }
virtual bool ShowPlayerControls(
wxMediaCtrlPlayerControls WXUNUSED(flags))
{ return false; }
virtual bool IsInterfaceShown()
{ return false; }
virtual wxLongLong GetDownloadProgress()
{ return 0; }
virtual wxLongLong GetDownloadTotal()
{ return 0; }
virtual void MacVisibilityChanged()
{ }
virtual void RESERVED9() {}
wxDECLARE_DYNAMIC_CLASS(wxMediaBackend);
};
//Our events
wxDECLARE_EXPORTED_EVENT( WXDLLIMPEXP_MEDIA, wxEVT_MEDIA_FINISHED, wxMediaEvent );
wxDECLARE_EXPORTED_EVENT( WXDLLIMPEXP_MEDIA, wxEVT_MEDIA_STOP, wxMediaEvent );
//Function type(s) our events need
typedef void (wxEvtHandler::*wxMediaEventFunction)(wxMediaEvent&);
#define wxMediaEventHandler(func) \
wxEVENT_HANDLER_CAST(wxMediaEventFunction, func)
//Macro for usage with message maps
#define EVT_MEDIA_FINISHED(winid, fn) wxDECLARE_EVENT_TABLE_ENTRY( wxEVT_MEDIA_FINISHED, winid, wxID_ANY, wxMediaEventHandler(fn), NULL ),
#define EVT_MEDIA_STOP(winid, fn) wxDECLARE_EVENT_TABLE_ENTRY( wxEVT_MEDIA_STOP, winid, wxID_ANY, wxMediaEventHandler(fn), NULL ),
wxDECLARE_EXPORTED_EVENT( WXDLLIMPEXP_MEDIA, wxEVT_MEDIA_LOADED, wxMediaEvent );
#define EVT_MEDIA_LOADED(winid, fn) wxDECLARE_EVENT_TABLE_ENTRY( wxEVT_MEDIA_LOADED, winid, wxID_ANY, wxMediaEventHandler(fn), NULL ),
wxDECLARE_EXPORTED_EVENT( WXDLLIMPEXP_MEDIA, wxEVT_MEDIA_STATECHANGED, wxMediaEvent );
wxDECLARE_EXPORTED_EVENT( WXDLLIMPEXP_MEDIA, wxEVT_MEDIA_PLAY, wxMediaEvent );
wxDECLARE_EXPORTED_EVENT( WXDLLIMPEXP_MEDIA, wxEVT_MEDIA_PAUSE, wxMediaEvent );
#define EVT_MEDIA_STATECHANGED(winid, fn) wxDECLARE_EVENT_TABLE_ENTRY( wxEVT_MEDIA_STATECHANGED, winid, wxID_ANY, wxMediaEventHandler(fn), NULL ),
#define EVT_MEDIA_PLAY(winid, fn) wxDECLARE_EVENT_TABLE_ENTRY( wxEVT_MEDIA_PLAY, winid, wxID_ANY, wxMediaEventHandler(fn), NULL ),
#define EVT_MEDIA_PAUSE(winid, fn) wxDECLARE_EVENT_TABLE_ENTRY( wxEVT_MEDIA_PAUSE, winid, wxID_ANY, wxMediaEventHandler(fn), NULL ),
// ----------------------------------------------------------------------------
// common backend base class used by many other backends
// ----------------------------------------------------------------------------
class WXDLLIMPEXP_MEDIA wxMediaBackendCommonBase : public wxMediaBackend
{
public:
// add a pending wxMediaEvent of the given type
void QueueEvent(wxEventType evtType);
// notify that the movie playback is finished
void QueueFinishEvent()
{
QueueEvent(wxEVT_MEDIA_STATECHANGED);
QueueEvent(wxEVT_MEDIA_FINISHED);
}
// send the stop event and return true if it hasn't been vetoed
bool SendStopEvent();
// Queue pause event
void QueuePlayEvent();
// Queue pause event
void QueuePauseEvent();
// Queue stop event (no veto)
void QueueStopEvent();
protected:
// call this when the movie size has changed but not because it has just
// been loaded (in this case, call NotifyMovieLoaded() below)
void NotifyMovieSizeChanged();
// call this when the movie is fully loaded
void NotifyMovieLoaded();
wxMediaCtrl *m_ctrl; // parent control
};
// ----------------------------------------------------------------------------
// End compilation guard
// ----------------------------------------------------------------------------
#endif // wxUSE_MEDIACTRL
// ----------------------------------------------------------------------------
// End header guard and header itself
// ----------------------------------------------------------------------------
#endif // _WX_MEDIACTRL_H_
| h |
rticonnextdds-usecases | data/projects/rticonnextdds-usecases/VehicleTracking/ExampleCode/thirdparty/wxWidgets-3.1.2/Linux/include/wx/convauto.h | ///////////////////////////////////////////////////////////////////////////////
// Name: wx/convauto.h
// Purpose: wxConvAuto class declaration
// Author: Vadim Zeitlin
// Created: 2006-04-03
// Copyright: (c) 2006 Vadim Zeitlin
// Licence: wxWindows licence
///////////////////////////////////////////////////////////////////////////////
#ifndef _WX_CONVAUTO_H_
#define _WX_CONVAUTO_H_
#include "wx/strconv.h"
#include "wx/fontenc.h"
// ----------------------------------------------------------------------------
// wxConvAuto: uses BOM to automatically detect input encoding
// ----------------------------------------------------------------------------
// All currently recognized BOM values.
enum wxBOM
{
wxBOM_Unknown = -1,
wxBOM_None,
wxBOM_UTF32BE,
wxBOM_UTF32LE,
wxBOM_UTF16BE,
wxBOM_UTF16LE,
wxBOM_UTF8
};
class WXDLLIMPEXP_BASE wxConvAuto : public wxMBConv
{
public:
// default ctor, the real conversion will be created on demand
wxConvAuto(wxFontEncoding enc = wxFONTENCODING_DEFAULT)
{
Init();
m_encDefault = enc;
}
// copy ctor doesn't initialize anything neither as conversion can only be
// deduced on first use
wxConvAuto(const wxConvAuto& other) : wxMBConv()
{
Init();
m_encDefault = other.m_encDefault;
}
virtual ~wxConvAuto()
{
if ( m_ownsConv )
delete m_conv;
}
// get/set the fall-back encoding used when the input text doesn't have BOM
// and isn't UTF-8
//
// special values are wxFONTENCODING_MAX meaning not to use any fall back
// at all (but just fail to convert in this case) and wxFONTENCODING_SYSTEM
// meaning to use the encoding of the system locale
static wxFontEncoding GetFallbackEncoding() { return ms_defaultMBEncoding; }
static void SetFallbackEncoding(wxFontEncoding enc);
static void DisableFallbackEncoding()
{
SetFallbackEncoding(wxFONTENCODING_MAX);
}
// override the base class virtual function(s) to use our m_conv
virtual size_t ToWChar(wchar_t *dst, size_t dstLen,
const char *src, size_t srcLen = wxNO_LEN) const wxOVERRIDE;
virtual size_t FromWChar(char *dst, size_t dstLen,
const wchar_t *src, size_t srcLen = wxNO_LEN) const wxOVERRIDE;
virtual size_t GetMBNulLen() const wxOVERRIDE { return m_conv->GetMBNulLen(); }
virtual wxMBConv *Clone() const wxOVERRIDE { return new wxConvAuto(*this); }
// return the BOM type of this buffer
static wxBOM DetectBOM(const char *src, size_t srcLen);
// return the characters composing the given BOM.
static const char* GetBOMChars(wxBOM bomType, size_t* count);
wxBOM GetBOM() const
{
return m_bomType;
}
private:
// common part of all ctors
void Init()
{
// We don't initialize m_encDefault here as different ctors do it
// differently.
m_conv = NULL;
m_bomType = wxBOM_Unknown;
m_ownsConv = false;
m_consumedBOM = false;
}
// initialize m_conv with the UTF-8 conversion
void InitWithUTF8()
{
m_conv = &wxConvUTF8;
m_ownsConv = false;
}
// create the correct conversion object for the given BOM type
void InitFromBOM(wxBOM bomType);
// create the correct conversion object for the BOM present in the
// beginning of the buffer
//
// return false if the buffer is too short to allow us to determine if we
// have BOM or not
bool InitFromInput(const char *src, size_t len);
// adjust src and len to skip over the BOM (identified by m_bomType) at the
// start of the buffer
void SkipBOM(const char **src, size_t *len) const;
// fall-back multibyte encoding to use, may be wxFONTENCODING_SYSTEM or
// wxFONTENCODING_MAX but not wxFONTENCODING_DEFAULT
static wxFontEncoding ms_defaultMBEncoding;
// conversion object which we really use, NULL until the first call to
// either ToWChar() or FromWChar()
wxMBConv *m_conv;
// the multibyte encoding to use by default if input isn't Unicode
wxFontEncoding m_encDefault;
// our BOM type
wxBOM m_bomType;
// true if we allocated m_conv ourselves, false if we just use an existing
// global conversion
bool m_ownsConv;
// true if we already skipped BOM when converting (and not just calculating
// the size)
bool m_consumedBOM;
wxDECLARE_NO_ASSIGN_CLASS(wxConvAuto);
};
#endif // _WX_CONVAUTO_H_
| h |
rticonnextdds-usecases | data/projects/rticonnextdds-usecases/VehicleTracking/ExampleCode/thirdparty/wxWidgets-3.1.2/Linux/include/wx/cmdline.h | ///////////////////////////////////////////////////////////////////////////////
// Name: wx/cmdline.h
// Purpose: wxCmdLineParser and related classes for parsing the command
// line options
// Author: Vadim Zeitlin
// Modified by:
// Created: 04.01.00
// Copyright: (c) 2000 Vadim Zeitlin <[email protected]>
// Licence: wxWindows licence
///////////////////////////////////////////////////////////////////////////////
#ifndef _WX_CMDLINE_H_
#define _WX_CMDLINE_H_
#include "wx/defs.h"
#include "wx/string.h"
#include "wx/arrstr.h"
#include "wx/cmdargs.h"
// determines ConvertStringToArgs() behaviour
enum wxCmdLineSplitType
{
wxCMD_LINE_SPLIT_DOS,
wxCMD_LINE_SPLIT_UNIX
};
#if wxUSE_CMDLINE_PARSER
class WXDLLIMPEXP_FWD_BASE wxCmdLineParser;
class WXDLLIMPEXP_FWD_BASE wxDateTime;
// ----------------------------------------------------------------------------
// constants
// ----------------------------------------------------------------------------
// by default, options are optional (sic) and each call to AddParam() allows
// one more parameter - this may be changed by giving non-default flags to it
enum wxCmdLineEntryFlags
{
wxCMD_LINE_OPTION_MANDATORY = 0x01, // this option must be given
wxCMD_LINE_PARAM_OPTIONAL = 0x02, // the parameter may be omitted
wxCMD_LINE_PARAM_MULTIPLE = 0x04, // the parameter may be repeated
wxCMD_LINE_OPTION_HELP = 0x08, // this option is a help request
wxCMD_LINE_NEEDS_SEPARATOR = 0x10, // must have sep before the value
wxCMD_LINE_SWITCH_NEGATABLE = 0x20, // this switch can be negated (e.g. /S-)
wxCMD_LINE_HIDDEN = 0x40 // this switch is not listed by Usage()
};
// an option value or parameter may be a string (the most common case), a
// number or a date
enum wxCmdLineParamType
{
wxCMD_LINE_VAL_STRING, // should be 0 (default)
wxCMD_LINE_VAL_NUMBER,
wxCMD_LINE_VAL_DATE,
wxCMD_LINE_VAL_DOUBLE,
wxCMD_LINE_VAL_NONE
};
// for constructing the cmd line description using Init()
enum wxCmdLineEntryType
{
wxCMD_LINE_SWITCH,
wxCMD_LINE_OPTION,
wxCMD_LINE_PARAM,
wxCMD_LINE_USAGE_TEXT,
wxCMD_LINE_NONE // to terminate the list
};
// Possible return values of wxCmdLineParser::FoundSwitch()
enum wxCmdLineSwitchState
{
wxCMD_SWITCH_OFF = -1, // Found but turned off/negated.
wxCMD_SWITCH_NOT_FOUND, // Not found at all.
wxCMD_SWITCH_ON // Found in normal state.
};
// ----------------------------------------------------------------------------
// wxCmdLineEntryDesc is a description of one command line
// switch/option/parameter
// ----------------------------------------------------------------------------
struct wxCmdLineEntryDesc
{
wxCmdLineEntryType kind;
const char *shortName;
const char *longName;
const char *description;
wxCmdLineParamType type;
int flags;
};
// the list of wxCmdLineEntryDesc objects should be terminated with this one
#define wxCMD_LINE_DESC_END \
{ wxCMD_LINE_NONE, NULL, NULL, NULL, wxCMD_LINE_VAL_NONE, 0x0 }
// ----------------------------------------------------------------------------
// wxCmdLineArg contains the value for one command line argument
// ----------------------------------------------------------------------------
class WXDLLIMPEXP_BASE wxCmdLineArg
{
public:
virtual ~wxCmdLineArg() {}
virtual double GetDoubleVal() const = 0;
virtual long GetLongVal() const = 0;
virtual const wxString& GetStrVal() const = 0;
#if wxUSE_DATETIME
virtual const wxDateTime& GetDateVal() const = 0;
#endif // wxUSE_DATETIME
virtual bool IsNegated() const = 0;
virtual wxCmdLineEntryType GetKind() const = 0;
virtual wxString GetShortName() const = 0;
virtual wxString GetLongName() const = 0;
virtual wxCmdLineParamType GetType() const = 0;
};
// ----------------------------------------------------------------------------
// wxCmdLineArgs is a container of command line arguments actually parsed and
// allows enumerating them using the standard iterator-based approach.
// ----------------------------------------------------------------------------
class WXDLLIMPEXP_BASE wxCmdLineArgs
{
public:
class WXDLLIMPEXP_BASE const_iterator
{
public:
typedef int difference_type;
typedef wxCmdLineArg value_type;
typedef const wxCmdLineArg* pointer;
typedef const wxCmdLineArg& reference;
// We avoid dependency on standard library by default but if we do use
// std::string, then it's ok to use iterator tags as well.
#if wxUSE_STD_STRING
typedef std::bidirectional_iterator_tag iterator_category;
#endif // wx_USE_STD_STRING
const_iterator() : m_parser(NULL), m_index(0) {}
reference operator *() const;
pointer operator ->() const;
const_iterator &operator ++ ();
const_iterator operator ++ (int);
const_iterator &operator -- ();
const_iterator operator -- (int);
bool operator == (const const_iterator &other) const {
return m_parser==other.m_parser && m_index==other.m_index;
}
bool operator != (const const_iterator &other) const {
return !operator==(other);
}
private:
const_iterator (const wxCmdLineParser& parser, size_t index)
: m_parser(&parser), m_index(index) {
}
const wxCmdLineParser* m_parser;
size_t m_index;
friend class wxCmdLineArgs;
};
wxCmdLineArgs (const wxCmdLineParser& parser) : m_parser(parser) {}
const_iterator begin() const { return const_iterator(m_parser, 0); }
const_iterator end() const { return const_iterator(m_parser, size()); }
size_t size() const;
private:
const wxCmdLineParser& m_parser;
wxDECLARE_NO_ASSIGN_CLASS(wxCmdLineArgs);
};
// ----------------------------------------------------------------------------
// wxCmdLineParser is a class for parsing command line.
//
// It has the following features:
//
// 1. distinguishes options, switches and parameters; allows option grouping
// 2. allows both short and long options
// 3. automatically generates the usage message from the cmd line description
// 4. does type checks on the options values (number, date, ...)
//
// To use it you should:
//
// 1. construct it giving it the cmd line to parse and optionally its desc
// 2. construct the cmd line description using AddXXX() if not done in (1)
// 3. call Parse()
// 4. use GetXXX() to retrieve the parsed info
// ----------------------------------------------------------------------------
class WXDLLIMPEXP_BASE wxCmdLineParser
{
public:
// ctors and initializers
// ----------------------
// default ctor or ctor giving the cmd line in either Unix or Win form
wxCmdLineParser() { Init(); }
wxCmdLineParser(int argc, char **argv) { Init(); SetCmdLine(argc, argv); }
#if wxUSE_UNICODE
wxCmdLineParser(int argc, wxChar **argv) { Init(); SetCmdLine(argc, argv); }
wxCmdLineParser(int argc, const wxCmdLineArgsArray& argv)
{ Init(); SetCmdLine(argc, argv); }
#endif // wxUSE_UNICODE
wxCmdLineParser(const wxString& cmdline) { Init(); SetCmdLine(cmdline); }
// the same as above, but also gives the cmd line description - otherwise,
// use AddXXX() later
wxCmdLineParser(const wxCmdLineEntryDesc *desc)
{ Init(); SetDesc(desc); }
wxCmdLineParser(const wxCmdLineEntryDesc *desc, int argc, char **argv)
{ Init(); SetCmdLine(argc, argv); SetDesc(desc); }
#if wxUSE_UNICODE
wxCmdLineParser(const wxCmdLineEntryDesc *desc, int argc, wxChar **argv)
{ Init(); SetCmdLine(argc, argv); SetDesc(desc); }
wxCmdLineParser(const wxCmdLineEntryDesc *desc,
int argc,
const wxCmdLineArgsArray& argv)
{ Init(); SetCmdLine(argc, argv); SetDesc(desc); }
#endif // wxUSE_UNICODE
wxCmdLineParser(const wxCmdLineEntryDesc *desc, const wxString& cmdline)
{ Init(); SetCmdLine(cmdline); SetDesc(desc); }
// set cmd line to parse after using one of the ctors which don't do it
void SetCmdLine(int argc, char **argv);
#if wxUSE_UNICODE
void SetCmdLine(int argc, wxChar **argv);
void SetCmdLine(int argc, const wxCmdLineArgsArray& argv);
#endif // wxUSE_UNICODE
void SetCmdLine(const wxString& cmdline);
// not virtual, don't use this class polymorphically
~wxCmdLineParser();
// set different parser options
// ----------------------------
// by default, '-' is switch char under Unix, '-' or '/' under Win:
// switchChars contains all characters with which an option or switch may
// start
void SetSwitchChars(const wxString& switchChars);
// long options are not POSIX-compliant, this option allows to disable them
void EnableLongOptions(bool enable = true);
void DisableLongOptions() { EnableLongOptions(false); }
bool AreLongOptionsEnabled() const;
// extra text may be shown by Usage() method if set by this function
void SetLogo(const wxString& logo);
// construct the cmd line description
// ----------------------------------
// take the cmd line description from the wxCMD_LINE_NONE terminated table
void SetDesc(const wxCmdLineEntryDesc *desc);
// a switch: i.e. an option without value
void AddSwitch(const wxString& name, const wxString& lng = wxEmptyString,
const wxString& desc = wxEmptyString,
int flags = 0);
void AddLongSwitch(const wxString& lng,
const wxString& desc = wxEmptyString,
int flags = 0)
{
AddSwitch(wxString(), lng, desc, flags);
}
// an option taking a value of the given type
void AddOption(const wxString& name, const wxString& lng = wxEmptyString,
const wxString& desc = wxEmptyString,
wxCmdLineParamType type = wxCMD_LINE_VAL_STRING,
int flags = 0);
void AddLongOption(const wxString& lng,
const wxString& desc = wxEmptyString,
wxCmdLineParamType type = wxCMD_LINE_VAL_STRING,
int flags = 0)
{
AddOption(wxString(), lng, desc, type, flags);
}
// a parameter
void AddParam(const wxString& desc = wxEmptyString,
wxCmdLineParamType type = wxCMD_LINE_VAL_STRING,
int flags = 0);
// add an explanatory text to be shown to the user in help
void AddUsageText(const wxString& text);
// actions
// -------
// parse the command line, return 0 if ok, -1 if "-h" or "--help" option
// was encountered and the help message was given or a positive value if a
// syntax error occurred
//
// if showUsage is true, Usage() is called in case of syntax error or if
// help was requested
int Parse(bool showUsage = true);
// give the usage message describing all program options
void Usage() const;
// return the usage string, call Usage() to directly show it to the user
wxString GetUsageString() const;
// get the command line arguments
// ------------------------------
// returns true if the given switch was found
bool Found(const wxString& name) const;
// Returns wxCMD_SWITCH_NOT_FOUND if the switch was not found at all,
// wxCMD_SWITCH_ON if it was found in normal state and wxCMD_SWITCH_OFF if
// it was found but negated (i.e. followed by "-", this can only happen for
// the switches with wxCMD_LINE_SWITCH_NEGATABLE flag).
wxCmdLineSwitchState FoundSwitch(const wxString& name) const;
// returns true if an option taking a string value was found and stores the
// value in the provided pointer
bool Found(const wxString& name, wxString *value) const;
// returns true if an option taking an integer value was found and stores
// the value in the provided pointer
bool Found(const wxString& name, long *value) const;
// returns true if an option taking a double value was found and stores
// the value in the provided pointer
bool Found(const wxString& name, double *value) const;
#if wxUSE_DATETIME
// returns true if an option taking a date value was found and stores the
// value in the provided pointer
bool Found(const wxString& name, wxDateTime *value) const;
#endif // wxUSE_DATETIME
// gets the number of parameters found
size_t GetParamCount() const;
// gets the value of Nth parameter (as string only for now)
wxString GetParam(size_t n = 0u) const;
// returns a reference to the container of all command line arguments
wxCmdLineArgs GetArguments() const { return wxCmdLineArgs(*this); }
// Resets switches and options
void Reset();
// break down the command line in arguments
static wxArrayString
ConvertStringToArgs(const wxString& cmdline,
wxCmdLineSplitType type = wxCMD_LINE_SPLIT_DOS);
private:
// common part of all ctors
void Init();
struct wxCmdLineParserData *m_data;
friend class wxCmdLineArgs;
friend class wxCmdLineArgs::const_iterator;
wxDECLARE_NO_COPY_CLASS(wxCmdLineParser);
};
#else // !wxUSE_CMDLINE_PARSER
// this function is always available (even if !wxUSE_CMDLINE_PARSER) because it
// is used by wxWin itself under Windows
class WXDLLIMPEXP_BASE wxCmdLineParser
{
public:
static wxArrayString
ConvertStringToArgs(const wxString& cmdline,
wxCmdLineSplitType type = wxCMD_LINE_SPLIT_DOS);
};
#endif // wxUSE_CMDLINE_PARSER/!wxUSE_CMDLINE_PARSER
#endif // _WX_CMDLINE_H_
| h |
rticonnextdds-usecases | data/projects/rticonnextdds-usecases/VehicleTracking/ExampleCode/thirdparty/wxWidgets-3.1.2/Linux/include/wx/kbdstate.h | ///////////////////////////////////////////////////////////////////////////////
// Name: wx/kbdstate.h
// Purpose: Declaration of wxKeyboardState class
// Author: Vadim Zeitlin
// Created: 2008-09-19
// Copyright: (c) 2008 Vadim Zeitlin <[email protected]>
// Licence: wxWindows licence
///////////////////////////////////////////////////////////////////////////////
#ifndef _WX_KBDSTATE_H_
#define _WX_KBDSTATE_H_
#include "wx/defs.h"
// ----------------------------------------------------------------------------
// wxKeyboardState stores the state of the keyboard modifier keys
// ----------------------------------------------------------------------------
class WXDLLIMPEXP_CORE wxKeyboardState
{
public:
wxKeyboardState(bool controlDown = false,
bool shiftDown = false,
bool altDown = false,
bool metaDown = false)
: m_controlDown(controlDown),
m_shiftDown(shiftDown),
m_altDown(altDown),
m_metaDown(metaDown)
#ifdef __WXOSX__
,m_rawControlDown(false)
#endif
{
}
// default copy ctor, assignment operator and dtor are ok
// accessors for the various modifier keys
// ---------------------------------------
// should be used check if the key event has exactly the given modifiers:
// "GetModifiers() = wxMOD_CONTROL" is easier to write than "ControlDown()
// && !MetaDown() && !AltDown() && !ShiftDown()"
int GetModifiers() const
{
return (m_controlDown ? wxMOD_CONTROL : 0) |
(m_shiftDown ? wxMOD_SHIFT : 0) |
(m_metaDown ? wxMOD_META : 0) |
#ifdef __WXOSX__
(m_rawControlDown ? wxMOD_RAW_CONTROL : 0) |
#endif
(m_altDown ? wxMOD_ALT : 0);
}
// returns true if any modifiers at all are pressed
bool HasAnyModifiers() const { return GetModifiers() != wxMOD_NONE; }
// returns true if any modifiers changing the usual key interpretation are
// pressed, notably excluding Shift
bool HasModifiers() const
{
return ControlDown() || RawControlDown() || AltDown();
}
// accessors for individual modifier keys
bool ControlDown() const { return m_controlDown; }
bool RawControlDown() const
{
#ifdef __WXOSX__
return m_rawControlDown;
#else
return m_controlDown;
#endif
}
bool ShiftDown() const { return m_shiftDown; }
bool MetaDown() const { return m_metaDown; }
bool AltDown() const { return m_altDown; }
// "Cmd" is a pseudo key which is Control for PC and Unix platforms but
// Apple ("Command") key under Macs: it makes often sense to use it instead
// of, say, ControlDown() because Cmd key is used for the same thing under
// Mac as Ctrl elsewhere (but Ctrl still exists, just not used for this
// purpose under Mac)
bool CmdDown() const
{
return ControlDown();
}
// these functions are mostly used by wxWidgets itself
// ---------------------------------------------------
void SetControlDown(bool down) { m_controlDown = down; }
void SetRawControlDown(bool down)
{
#ifdef __WXOSX__
m_rawControlDown = down;
#else
m_controlDown = down;
#endif
}
void SetShiftDown(bool down) { m_shiftDown = down; }
void SetAltDown(bool down) { m_altDown = down; }
void SetMetaDown(bool down) { m_metaDown = down; }
// for backwards compatibility with the existing code accessing these
// members of wxKeyEvent directly, these variables are public, however you
// should not use them in any new code, please use the accessors instead
public:
bool m_controlDown : 1;
bool m_shiftDown : 1;
bool m_altDown : 1;
bool m_metaDown : 1;
#ifdef __WXOSX__
bool m_rawControlDown : 1;
#endif
};
#endif // _WX_KBDSTATE_H_
| h |
rticonnextdds-usecases | data/projects/rticonnextdds-usecases/VehicleTracking/ExampleCode/thirdparty/wxWidgets-3.1.2/Linux/include/wx/taskbarbutton.h | /////////////////////////////////////////////////////////////////////////////
// Name: include/taskbarbutton.h
// Purpose: Defines wxTaskBarButton class for manipulating buttons on the
// windows taskbar.
// Author: Chaobin Zhang <[email protected]>
// Created: 2014-04-30
// Copyright: (c) 2014 wxWidgets development team
// Licence: wxWindows licence
/////////////////////////////////////////////////////////////////////////////
#ifndef _WX_TASKBARBUTTON_H_
#define _WX_TASKBARBUTTON_H_
#include "wx/defs.h"
#if wxUSE_TASKBARBUTTON
#include "wx/icon.h"
#include "wx/string.h"
class WXDLLIMPEXP_FWD_CORE wxTaskBarButton;
class WXDLLIMPEXP_FWD_CORE wxTaskBarJumpListCategory;
class WXDLLIMPEXP_FWD_CORE wxTaskBarJumpList;
class WXDLLIMPEXP_FWD_CORE wxTaskBarJumpListImpl;
// ----------------------------------------------------------------------------
// wxTaskBarButton: define wxTaskBarButton interface.
// ----------------------------------------------------------------------------
/**
State of the task bar button.
*/
enum wxTaskBarButtonState
{
wxTASKBAR_BUTTON_NO_PROGRESS = 0,
wxTASKBAR_BUTTON_INDETERMINATE = 1,
wxTASKBAR_BUTTON_NORMAL = 2,
wxTASKBAR_BUTTON_ERROR = 4,
wxTASKBAR_BUTTON_PAUSED = 8
};
class WXDLLIMPEXP_CORE wxThumbBarButton : public wxObject
{
public:
wxThumbBarButton() : m_taskBarButtonParent(NULL)
{ }
wxThumbBarButton(int id,
const wxIcon& icon,
const wxString& tooltip = wxString(),
bool enable = true,
bool dismissOnClick = false,
bool hasBackground = true,
bool shown = true,
bool interactive = true);
bool Create(int id,
const wxIcon& icon,
const wxString& tooltip = wxString(),
bool enable = true,
bool dismissOnClick = false,
bool hasBackground = true,
bool shown = true,
bool interactive = true);
int GetID() const { return m_id; }
const wxIcon& GetIcon() const { return m_icon; }
const wxString& GetTooltip() const { return m_tooltip; }
bool IsEnable() const { return m_enable; }
void Enable(bool enable = true);
void Disable() { Enable(false); }
bool IsDismissOnClick() const { return m_dismissOnClick; }
void EnableDismissOnClick(bool enable = true);
void DisableDimissOnClick() { EnableDismissOnClick(false); }
bool HasBackground() const { return m_hasBackground; }
void SetHasBackground(bool has = true);
bool IsShown() const { return m_shown; }
void Show(bool shown = true);
void Hide() { Show(false); }
bool IsInteractive() const { return m_interactive; }
void SetInteractive(bool interactive = true);
void SetParent(wxTaskBarButton *parent) { m_taskBarButtonParent = parent; }
wxTaskBarButton* GetParent() const { return m_taskBarButtonParent; }
private:
bool UpdateParentTaskBarButton();
int m_id;
wxIcon m_icon;
wxString m_tooltip;
bool m_enable;
bool m_dismissOnClick;
bool m_hasBackground;
bool m_shown;
bool m_interactive;
wxTaskBarButton *m_taskBarButtonParent;
wxDECLARE_DYNAMIC_CLASS(wxThumbBarButton);
};
class WXDLLIMPEXP_CORE wxTaskBarButton
{
public:
// Factory function, may return NULL if task bar buttons are not supported
// by the current system.
static wxTaskBarButton* New(wxWindow* parent);
virtual ~wxTaskBarButton() { }
// Operations:
virtual void SetProgressRange(int range) = 0;
virtual void SetProgressValue(int value) = 0;
virtual void PulseProgress() = 0;
virtual void Show(bool show = true) = 0;
virtual void Hide() = 0;
virtual void SetThumbnailTooltip(const wxString& tooltip) = 0;
virtual void SetProgressState(wxTaskBarButtonState state) = 0;
virtual void SetOverlayIcon(const wxIcon& icon,
const wxString& description = wxString()) = 0;
virtual void SetThumbnailClip(const wxRect& rect) = 0;
virtual void SetThumbnailContents(const wxWindow *child) = 0;
virtual bool InsertThumbBarButton(size_t pos, wxThumbBarButton *button) = 0;
virtual bool AppendThumbBarButton(wxThumbBarButton *button) = 0;
virtual bool AppendSeparatorInThumbBar() = 0;
virtual wxThumbBarButton* RemoveThumbBarButton(wxThumbBarButton *button) = 0;
virtual wxThumbBarButton* RemoveThumbBarButton(int id) = 0;
virtual void Realize() = 0;
protected:
wxTaskBarButton() { }
private:
wxDECLARE_NO_COPY_CLASS(wxTaskBarButton);
};
enum wxTaskBarJumpListItemType
{
wxTASKBAR_JUMP_LIST_SEPARATOR,
wxTASKBAR_JUMP_LIST_TASK,
wxTASKBAR_JUMP_LIST_DESTINATION
};
class WXDLLIMPEXP_CORE wxTaskBarJumpListItem
{
public:
wxTaskBarJumpListItem(wxTaskBarJumpListCategory *parentCategory = NULL,
wxTaskBarJumpListItemType type = wxTASKBAR_JUMP_LIST_SEPARATOR,
const wxString& title = wxEmptyString,
const wxString& filePath = wxEmptyString,
const wxString& arguments = wxEmptyString,
const wxString& tooltip = wxEmptyString,
const wxString& iconPath = wxEmptyString,
int iconIndex = 0);
wxTaskBarJumpListItemType GetType() const;
void SetType(wxTaskBarJumpListItemType type);
const wxString& GetTitle() const;
void SetTitle(const wxString& title);
const wxString& GetFilePath() const;
void SetFilePath(const wxString& filePath);
const wxString& GetArguments() const;
void SetArguments(const wxString& arguments);
const wxString& GetTooltip() const;
void SetTooltip(const wxString& tooltip);
const wxString& GetIconPath() const;
void SetIconPath(const wxString& iconPath);
int GetIconIndex() const;
void SetIconIndex(int iconIndex);
wxTaskBarJumpListCategory* GetCategory() const;
void SetCategory(wxTaskBarJumpListCategory *category);
private:
wxTaskBarJumpListCategory *m_parentCategory;
wxTaskBarJumpListItemType m_type;
wxString m_title;
wxString m_filePath;
wxString m_arguments;
wxString m_tooltip;
wxString m_iconPath;
int m_iconIndex;
wxDECLARE_NO_COPY_CLASS(wxTaskBarJumpListItem);
};
typedef wxVector<wxTaskBarJumpListItem*> wxTaskBarJumpListItems;
class WXDLLIMPEXP_CORE wxTaskBarJumpListCategory
{
public:
wxTaskBarJumpListCategory(wxTaskBarJumpList *parent = NULL,
const wxString& title = wxEmptyString);
virtual ~wxTaskBarJumpListCategory();
wxTaskBarJumpListItem* Append(wxTaskBarJumpListItem *item);
void Delete(wxTaskBarJumpListItem *item);
wxTaskBarJumpListItem* Remove(wxTaskBarJumpListItem *item);
wxTaskBarJumpListItem* FindItemByPosition(size_t pos) const;
wxTaskBarJumpListItem* Insert(size_t pos, wxTaskBarJumpListItem *item);
wxTaskBarJumpListItem* Prepend(wxTaskBarJumpListItem *item);
void SetTitle(const wxString& title);
const wxString& GetTitle() const;
const wxTaskBarJumpListItems& GetItems() const;
private:
friend class wxTaskBarJumpListItem;
void Update();
wxTaskBarJumpList *m_parent;
wxTaskBarJumpListItems m_items;
wxString m_title;
wxDECLARE_NO_COPY_CLASS(wxTaskBarJumpListCategory);
};
typedef wxVector<wxTaskBarJumpListCategory*> wxTaskBarJumpListCategories;
class WXDLLIMPEXP_CORE wxTaskBarJumpList
{
public:
wxTaskBarJumpList(const wxString& appID = wxEmptyString);
virtual ~wxTaskBarJumpList();
void ShowRecentCategory(bool shown = true);
void HideRecentCategory();
void ShowFrequentCategory(bool shown = true);
void HideFrequentCategory();
wxTaskBarJumpListCategory& GetTasks() const;
const wxTaskBarJumpListCategory& GetFrequentCategory() const;
const wxTaskBarJumpListCategory& GetRecentCategory() const;
const wxTaskBarJumpListCategories& GetCustomCategories() const;
void AddCustomCategory(wxTaskBarJumpListCategory* category);
wxTaskBarJumpListCategory* RemoveCustomCategory(const wxString& title);
void DeleteCustomCategory(const wxString& title);
private:
friend class wxTaskBarJumpListCategory;
void Update();
wxTaskBarJumpListImpl *m_jumpListImpl;
wxDECLARE_NO_COPY_CLASS(wxTaskBarJumpList);
};
#endif // wxUSE_TASKBARBUTTON
#endif // _WX_TASKBARBUTTON_H_
| h |
rticonnextdds-usecases | data/projects/rticonnextdds-usecases/VehicleTracking/ExampleCode/thirdparty/wxWidgets-3.1.2/Linux/include/wx/xti2.h | /////////////////////////////////////////////////////////////////////////////
// Name: wx/wxt2.h
// Purpose: runtime metadata information (extended class info)
// Author: Stefan Csomor
// Modified by: Francesco Montorsi
// Created: 27/07/03
// Copyright: (c) 1997 Julian Smart
// (c) 2003 Stefan Csomor
/////////////////////////////////////////////////////////////////////////////
#ifndef _WX_XTI2H__
#define _WX_XTI2H__
// ----------------------------------------------------------------------------
// second part of xti headers, is included from object.h
// ----------------------------------------------------------------------------
#if wxUSE_EXTENDED_RTTI
// ----------------------------------------------------------------------------
// wxDynamicObject class, its instances connect to a 'super class instance'
// ----------------------------------------------------------------------------
class WXDLLIMPEXP_BASE wxDynamicObject : public wxObject
{
friend class WXDLLIMPEXP_FWD_BASE wxDynamicClassInfo ;
public:
// instantiates this object with an instance of its superclass
wxDynamicObject(wxObject* superClassInstance, const wxDynamicClassInfo *info) ;
virtual ~wxDynamicObject();
void SetProperty (const wxChar *propertyName, const wxAny &value);
wxAny GetProperty (const wxChar *propertyName) const ;
// get the runtime identity of this object
wxClassInfo *GetClassInfo() const
{
#ifdef _MSC_VER
return (wxClassInfo*) m_classInfo;
#else
wxDynamicClassInfo *nonconst = const_cast<wxDynamicClassInfo *>(m_classInfo);
return static_cast<wxClassInfo *>(nonconst);
#endif
}
wxObject* GetSuperClassInstance() const
{
return m_superClassInstance ;
}
private :
// removes an existing runtime-property
void RemoveProperty( const wxChar *propertyName ) ;
// renames an existing runtime-property
void RenameProperty( const wxChar *oldPropertyName , const wxChar *newPropertyName ) ;
wxObject *m_superClassInstance ;
const wxDynamicClassInfo *m_classInfo;
struct wxDynamicObjectInternal;
wxDynamicObjectInternal *m_data;
};
// ----------------------------------------------------------------------------
// String conversion templates supporting older compilers
// ----------------------------------------------------------------------------
#if wxUSE_FUNC_TEMPLATE_POINTER
# define wxTO_STRING(type) wxToStringConverter<type>
# define wxTO_STRING_IMP(type)
# define wxFROM_STRING(type) wxFromStringConverter<type>
# define wxFROM_STRING_IMP(type)
#else
# define wxTO_STRING(type) ToString##type
# define wxTO_STRING_IMP(type) \
inline void ToString##type( const wxAny& data, wxString &result ) \
{ wxToStringConverter<type>(data, result); }
# define wxFROM_STRING(type) FromString##type
# define wxFROM_STRING_IMP(type) \
inline void FromString##type( const wxString& data, wxAny &result ) \
{ wxFromStringConverter<type>(data, result); }
#endif
#include "wx/xtiprop.h"
#include "wx/xtictor.h"
// ----------------------------------------------------------------------------
// wxIMPLEMENT class macros for concrete classes
// ----------------------------------------------------------------------------
// Single inheritance with one base class
#define _DEFAULT_CONSTRUCTOR(name) \
wxObject* wxConstructorFor##name() \
{ return new name; }
#define _DEFAULT_CONVERTERS(name) \
wxObject* wxVariantOfPtrToObjectConverter##name ( const wxAny &data ) \
{ return data.As( (name**)NULL ); } \
wxAny wxObjectToVariantConverter##name ( wxObject *data ) \
{ return wxAny( wx_dynamic_cast(name*, data) ); }
#define _TYPEINFO_CLASSES(n, toString, fromString ) \
wxClassTypeInfo s_typeInfo##n(wxT_OBJECT, &n::ms_classInfo, \
toString, fromString, typeid(n).name()); \
wxClassTypeInfo s_typeInfoPtr##n(wxT_OBJECT_PTR, &n::ms_classInfo, \
toString, fromString, typeid(n*).name());
#define _IMPLEMENT_DYNAMIC_CLASS(name, basename, unit, callback) \
_DEFAULT_CONSTRUCTOR(name) \
_DEFAULT_CONVERTERS(name) \
\
const wxClassInfo* name::ms_classParents[] = \
{ &basename::ms_classInfo, NULL }; \
wxClassInfo name::ms_classInfo(name::ms_classParents, wxT(unit), \
wxT(#name), (int) sizeof(name), (wxObjectConstructorFn) wxConstructorFor##name, \
name::GetPropertiesStatic, name::GetHandlersStatic, name::ms_constructor, \
name::ms_constructorProperties, name::ms_constructorPropertiesCount, \
wxVariantOfPtrToObjectConverter##name, NULL, wxObjectToVariantConverter##name, \
callback);
#define _IMPLEMENT_DYNAMIC_CLASS_WITH_COPY(name, basename, unit, callback ) \
_DEFAULT_CONSTRUCTOR(name) \
_DEFAULT_CONVERTERS(name) \
void wxVariantToObjectConverter##name ( const wxAny &data, wxObjectFunctor* fn ) \
{ name o = data.As<name>(); (*fn)( &o ); } \
\
const wxClassInfo* name::ms_classParents[] = { &basename::ms_classInfo,NULL }; \
wxClassInfo name::ms_classInfo(name::ms_classParents, wxT(unit), \
wxT(#name), (int) sizeof(name), (wxObjectConstructorFn) wxConstructorFor##name, \
name::GetPropertiesStatic,name::GetHandlersStatic,name::ms_constructor, \
name::ms_constructorProperties, name::ms_constructorPropertiesCount, \
wxVariantOfPtrToObjectConverter##name, wxVariantToObjectConverter##name, \
wxObjectToVariantConverter##name, callback);
#define wxIMPLEMENT_DYNAMIC_CLASS_WITH_COPY( name, basename ) \
_IMPLEMENT_DYNAMIC_CLASS_WITH_COPY( name, basename, "", NULL ) \
_TYPEINFO_CLASSES(name, NULL, NULL) \
const wxPropertyInfo *name::GetPropertiesStatic() \
{ return (wxPropertyInfo*) NULL; } \
const wxHandlerInfo *name::GetHandlersStatic() \
{ return (wxHandlerInfo*) NULL; } \
wxCONSTRUCTOR_DUMMY( name )
#define wxIMPLEMENT_DYNAMIC_CLASS( name, basename ) \
_IMPLEMENT_DYNAMIC_CLASS( name, basename, "", NULL ) \
_TYPEINFO_CLASSES(name, NULL, NULL) \
wxPropertyInfo *name::GetPropertiesStatic() \
{ return (wxPropertyInfo*) NULL; } \
wxHandlerInfo *name::GetHandlersStatic() \
{ return (wxHandlerInfo*) NULL; } \
wxCONSTRUCTOR_DUMMY( name )
#define wxIMPLEMENT_DYNAMIC_CLASS_XTI( name, basename, unit ) \
_IMPLEMENT_DYNAMIC_CLASS( name, basename, unit, NULL ) \
_TYPEINFO_CLASSES(name, NULL, NULL)
#define wxIMPLEMENT_DYNAMIC_CLASS_XTI_CALLBACK( name, basename, unit, callback )\
_IMPLEMENT_DYNAMIC_CLASS( name, basename, unit, &callback ) \
_TYPEINFO_CLASSES(name, NULL, NULL)
#define wxIMPLEMENT_DYNAMIC_CLASS_WITH_COPY_XTI( name, basename, unit ) \
_IMPLEMENT_DYNAMIC_CLASS_WITH_COPY( name, basename, unit, NULL ) \
_TYPEINFO_CLASSES(name, NULL, NULL)
#define wxIMPLEMENT_DYNAMIC_CLASS_WITH_COPY_AND_STREAMERS_XTI( name, basename, \
unit, toString, \
fromString ) \
_IMPLEMENT_DYNAMIC_CLASS_WITH_COPY( name, basename, unit, NULL ) \
_TYPEINFO_CLASSES(name, toString, fromString)
// this is for classes that do not derive from wxObject, there are no creators for these
#define wxIMPLEMENT_DYNAMIC_CLASS_NO_WXOBJECT_NO_BASE_XTI( name, unit ) \
const wxClassInfo* name::ms_classParents[] = { NULL }; \
wxClassInfo name::ms_classInfo(name::ms_classParents, wxEmptyString, \
wxT(#name), (int) sizeof(name), (wxObjectConstructorFn) 0, \
name::GetPropertiesStatic,name::GetHandlersStatic, 0, 0, \
0, 0, 0 ); \
_TYPEINFO_CLASSES(name, NULL, NULL)
// this is for subclasses that still do not derive from wxObject
#define wxIMPLEMENT_DYNAMIC_CLASS_NO_WXOBJECT_XTI( name, basename, unit ) \
const wxClassInfo* name::ms_classParents[] = { &basename::ms_classInfo, NULL }; \
wxClassInfo name::ms_classInfo(name::ms_classParents, wxEmptyString, \
wxT(#name), (int) sizeof(name), (wxObjectConstructorFn) 0, \
name::GetPropertiesStatic,name::GetHandlersStatic, 0, 0, \
0, 0, 0 ); \
_TYPEINFO_CLASSES(name, NULL, NULL)
// Multiple inheritance with two base classes
#define _IMPLEMENT_DYNAMIC_CLASS2(name, basename, basename2, unit, callback) \
_DEFAULT_CONSTRUCTOR(name) \
_DEFAULT_CONVERTERS(name) \
\
const wxClassInfo* name::ms_classParents[] = \
{ &basename::ms_classInfo,&basename2::ms_classInfo, NULL }; \
wxClassInfo name::ms_classInfo(name::ms_classParents, wxT(unit), \
wxT(#name), (int) sizeof(name), (wxObjectConstructorFn) wxConstructorFor##name, \
name::GetPropertiesStatic,name::GetHandlersStatic,name::ms_constructor, \
name::ms_constructorProperties, name::ms_constructorPropertiesCount, \
wxVariantOfPtrToObjectConverter##name, NULL, wxObjectToVariantConverter##name, \
callback);
#define wxIMPLEMENT_DYNAMIC_CLASS2( name, basename, basename2) \
_IMPLEMENT_DYNAMIC_CLASS2( name, basename, basename2, "", NULL) \
_TYPEINFO_CLASSES(name, NULL, NULL) \
wxPropertyInfo *name::GetPropertiesStatic() { return (wxPropertyInfo*) NULL; } \
wxHandlerInfo *name::GetHandlersStatic() { return (wxHandlerInfo*) NULL; } \
wxCONSTRUCTOR_DUMMY( name )
#define wxIMPLEMENT_DYNAMIC_CLASS2_XTI( name, basename, basename2, unit) \
_IMPLEMENT_DYNAMIC_CLASS2( name, basename, basename2, unit, NULL) \
_TYPEINFO_CLASSES(name, NULL, NULL)
// ----------------------------------------------------------------------------
// wxIMPLEMENT class macros for abstract classes
// ----------------------------------------------------------------------------
// Single inheritance with one base class
#define _IMPLEMENT_ABSTRACT_CLASS(name, basename) \
_DEFAULT_CONVERTERS(name) \
\
const wxClassInfo* name::ms_classParents[] = \
{ &basename::ms_classInfo,NULL }; \
wxClassInfo name::ms_classInfo(name::ms_classParents, wxEmptyString, \
wxT(#name), (int) sizeof(name), (wxObjectConstructorFn) 0, \
name::GetPropertiesStatic,name::GetHandlersStatic, 0, 0, \
0, wxVariantOfPtrToObjectConverter##name,0, \
wxObjectToVariantConverter##name); \
_TYPEINFO_CLASSES(name, NULL, NULL)
#define wxIMPLEMENT_ABSTRACT_CLASS( name, basename ) \
_IMPLEMENT_ABSTRACT_CLASS( name, basename ) \
wxHandlerInfo *name::GetHandlersStatic() { return (wxHandlerInfo*) NULL; } \
wxPropertyInfo *name::GetPropertiesStatic() { return (wxPropertyInfo*) NULL; }
// Multiple inheritance with two base classes
#define wxIMPLEMENT_ABSTRACT_CLASS2(name, basename1, basename2) \
wxClassInfo name::ms_classInfo(wxT(#name), wxT(#basename1), \
wxT(#basename2), (int) sizeof(name), \
(wxObjectConstructorFn) 0);
// templated streaming, every type that can be converted to wxString
// must have their specialization for these methods
template<typename T>
void wxStringReadValue( const wxString &s, T &data );
template<typename T>
void wxStringWriteValue( wxString &s, const T &data);
template<typename T>
void wxToStringConverter( const wxAny &v, wxString &s )
{ wxStringWriteValue(s, v.As<T>()); }
template<typename T>
void wxFromStringConverter( const wxString &s, wxAny &v)
{ T d; wxStringReadValue(s, d); v = wxAny(d); }
// --------------------------------------------------------------------------
// Collection Support
// --------------------------------------------------------------------------
template<typename iter, typename collection_t > void wxListCollectionToAnyList(
const collection_t& coll, wxAnyList &value )
{
for ( iter current = coll.GetFirst(); current;
current = current->GetNext() )
{
value.Append( new wxAny(current->GetData()) );
}
}
template<typename collection_t> void wxArrayCollectionToVariantArray(
const collection_t& coll, wxAnyList &value )
{
for( size_t i = 0; i < coll.GetCount(); i++ )
{
value.Append( new wxAny(coll[i]) );
}
}
#endif
#endif // _WX_XTIH2__
| h |
rticonnextdds-usecases | data/projects/rticonnextdds-usecases/VehicleTracking/ExampleCode/thirdparty/wxWidgets-3.1.2/Linux/include/wx/thread.h | /////////////////////////////////////////////////////////////////////////////
// Name: wx/thread.h
// Purpose: Thread API
// Author: Guilhem Lavaux
// Modified by: Vadim Zeitlin (modifications partly inspired by omnithreads
// package from Olivetti & Oracle Research Laboratory)
// Created: 04/13/98
// Copyright: (c) Guilhem Lavaux
// Licence: wxWindows licence
/////////////////////////////////////////////////////////////////////////////
#ifndef _WX_THREAD_H_
#define _WX_THREAD_H_
// ----------------------------------------------------------------------------
// headers
// ----------------------------------------------------------------------------
// get the value of wxUSE_THREADS configuration flag
#include "wx/defs.h"
#if wxUSE_THREADS
// ----------------------------------------------------------------------------
// constants
// ----------------------------------------------------------------------------
enum wxMutexError
{
wxMUTEX_NO_ERROR = 0, // operation completed successfully
wxMUTEX_INVALID, // mutex hasn't been initialized
wxMUTEX_DEAD_LOCK, // mutex is already locked by the calling thread
wxMUTEX_BUSY, // mutex is already locked by another thread
wxMUTEX_UNLOCKED, // attempt to unlock a mutex which is not locked
wxMUTEX_TIMEOUT, // LockTimeout() has timed out
wxMUTEX_MISC_ERROR // any other error
};
enum wxCondError
{
wxCOND_NO_ERROR = 0,
wxCOND_INVALID,
wxCOND_TIMEOUT, // WaitTimeout() has timed out
wxCOND_MISC_ERROR
};
enum wxSemaError
{
wxSEMA_NO_ERROR = 0,
wxSEMA_INVALID, // semaphore hasn't been initialized successfully
wxSEMA_BUSY, // returned by TryWait() if Wait() would block
wxSEMA_TIMEOUT, // returned by WaitTimeout()
wxSEMA_OVERFLOW, // Post() would increase counter past the max
wxSEMA_MISC_ERROR
};
enum wxThreadError
{
wxTHREAD_NO_ERROR = 0, // No error
wxTHREAD_NO_RESOURCE, // No resource left to create a new thread
wxTHREAD_RUNNING, // The thread is already running
wxTHREAD_NOT_RUNNING, // The thread isn't running
wxTHREAD_KILLED, // Thread we waited for had to be killed
wxTHREAD_MISC_ERROR // Some other error
};
enum wxThreadKind
{
wxTHREAD_DETACHED,
wxTHREAD_JOINABLE
};
enum wxThreadWait
{
wxTHREAD_WAIT_BLOCK,
wxTHREAD_WAIT_YIELD, // process events while waiting; MSW only
// For compatibility reasons we use wxTHREAD_WAIT_YIELD by default as this
// was the default behaviour of wxMSW 2.8 but it should be avoided as it's
// dangerous and not portable.
#if WXWIN_COMPATIBILITY_2_8
wxTHREAD_WAIT_DEFAULT = wxTHREAD_WAIT_YIELD
#else
wxTHREAD_WAIT_DEFAULT = wxTHREAD_WAIT_BLOCK
#endif
};
// Obsolete synonyms for wxPRIORITY_XXX for backwards compatibility-only
enum
{
WXTHREAD_MIN_PRIORITY = wxPRIORITY_MIN,
WXTHREAD_DEFAULT_PRIORITY = wxPRIORITY_DEFAULT,
WXTHREAD_MAX_PRIORITY = wxPRIORITY_MAX
};
// There are 2 types of mutexes: normal mutexes and recursive ones. The attempt
// to lock a normal mutex by a thread which already owns it results in
// undefined behaviour (it always works under Windows, it will almost always
// result in a deadlock under Unix). Locking a recursive mutex in such
// situation always succeeds and it must be unlocked as many times as it has
// been locked.
//
// However recursive mutexes have several important drawbacks: first, in the
// POSIX implementation, they're less efficient. Second, and more importantly,
// they CAN NOT BE USED WITH CONDITION VARIABLES under Unix! Using them with
// wxCondition will work under Windows and some Unices (notably Linux) but will
// deadlock under other Unix versions (e.g. Solaris). As it might be difficult
// to ensure that a recursive mutex is not used with wxCondition, it is a good
// idea to avoid using recursive mutexes at all. Also, the last problem with
// them is that some (older) Unix versions don't support this at all -- which
// results in a configure warning when building and a deadlock when using them.
enum wxMutexType
{
// normal mutex: try to always use this one
wxMUTEX_DEFAULT,
// recursive mutex: don't use these ones with wxCondition
wxMUTEX_RECURSIVE
};
// forward declarations
class WXDLLIMPEXP_FWD_BASE wxThreadHelper;
class WXDLLIMPEXP_FWD_BASE wxConditionInternal;
class WXDLLIMPEXP_FWD_BASE wxMutexInternal;
class WXDLLIMPEXP_FWD_BASE wxSemaphoreInternal;
class WXDLLIMPEXP_FWD_BASE wxThreadInternal;
// ----------------------------------------------------------------------------
// A mutex object is a synchronization object whose state is set to signaled
// when it is not owned by any thread, and nonsignaled when it is owned. Its
// name comes from its usefulness in coordinating mutually-exclusive access to
// a shared resource. Only one thread at a time can own a mutex object.
// ----------------------------------------------------------------------------
// you should consider wxMutexLocker whenever possible instead of directly
// working with wxMutex class - it is safer
class WXDLLIMPEXP_BASE wxMutex
{
public:
// constructor & destructor
// ------------------------
// create either default (always safe) or recursive mutex
wxMutex(wxMutexType mutexType = wxMUTEX_DEFAULT);
// destroys the mutex kernel object
~wxMutex();
// test if the mutex has been created successfully
bool IsOk() const;
// mutex operations
// ----------------
// Lock the mutex, blocking on it until it is unlocked by the other thread.
// The result of locking a mutex already locked by the current thread
// depend on the mutex type.
//
// The caller must call Unlock() later if Lock() returned wxMUTEX_NO_ERROR.
wxMutexError Lock();
// Same as Lock() but return wxMUTEX_TIMEOUT if the mutex can't be locked
// during the given number of milliseconds
wxMutexError LockTimeout(unsigned long ms);
// Try to lock the mutex: if it is currently locked, return immediately
// with an error. Otherwise the caller must call Unlock().
wxMutexError TryLock();
// Unlock the mutex. It is an error to unlock an already unlocked mutex
wxMutexError Unlock();
protected:
wxMutexInternal *m_internal;
friend class wxConditionInternal;
wxDECLARE_NO_COPY_CLASS(wxMutex);
};
// a helper class which locks the mutex in the ctor and unlocks it in the dtor:
// this ensures that mutex is always unlocked, even if the function returns or
// throws an exception before it reaches the end
class WXDLLIMPEXP_BASE wxMutexLocker
{
public:
// lock the mutex in the ctor
wxMutexLocker(wxMutex& mutex)
: m_isOk(false), m_mutex(mutex)
{ m_isOk = ( m_mutex.Lock() == wxMUTEX_NO_ERROR ); }
// returns true if mutex was successfully locked in ctor
bool IsOk() const
{ return m_isOk; }
// unlock the mutex in dtor
~wxMutexLocker()
{ if ( IsOk() ) m_mutex.Unlock(); }
private:
// no assignment operator nor copy ctor
wxMutexLocker(const wxMutexLocker&);
wxMutexLocker& operator=(const wxMutexLocker&);
bool m_isOk;
wxMutex& m_mutex;
};
// ----------------------------------------------------------------------------
// Critical section: this is the same as mutex but is only visible to the
// threads of the same process. For the platforms which don't have native
// support for critical sections, they're implemented entirely in terms of
// mutexes.
//
// NB: wxCriticalSection object does not allocate any memory in its ctor
// which makes it possible to have static globals of this class
// ----------------------------------------------------------------------------
// in order to avoid any overhead under platforms where critical sections are
// just mutexes make all wxCriticalSection class functions inline
#if !defined(__WINDOWS__)
#define wxCRITSECT_IS_MUTEX 1
#define wxCRITSECT_INLINE WXEXPORT inline
#else // MSW
#define wxCRITSECT_IS_MUTEX 0
#define wxCRITSECT_INLINE
#endif // MSW/!MSW
enum wxCriticalSectionType
{
// recursive critical section
wxCRITSEC_DEFAULT,
// non-recursive critical section
wxCRITSEC_NON_RECURSIVE
};
// you should consider wxCriticalSectionLocker whenever possible instead of
// directly working with wxCriticalSection class - it is safer
class WXDLLIMPEXP_BASE wxCriticalSection
{
public:
// ctor & dtor
wxCRITSECT_INLINE wxCriticalSection( wxCriticalSectionType critSecType = wxCRITSEC_DEFAULT );
wxCRITSECT_INLINE ~wxCriticalSection();
// enter the section (the same as locking a mutex)
wxCRITSECT_INLINE void Enter();
// try to enter the section (the same as trying to lock a mutex)
wxCRITSECT_INLINE bool TryEnter();
// leave the critical section (same as unlocking a mutex)
wxCRITSECT_INLINE void Leave();
private:
#if wxCRITSECT_IS_MUTEX
wxMutex m_mutex;
#elif defined(__WINDOWS__)
// we can't allocate any memory in the ctor, so use placement new -
// unfortunately, we have to hardcode the sizeof() here because we can't
// include windows.h from this public header and we also have to use the
// union to force the correct (i.e. maximal) alignment
//
// if CRITICAL_SECTION size changes in Windows, you'll get an assert from
// thread.cpp and will need to increase the buffer size
#ifdef __WIN64__
typedef char wxCritSectBuffer[40];
#else // __WIN32__
typedef char wxCritSectBuffer[24];
#endif
union
{
unsigned long m_dummy1;
void *m_dummy2;
wxCritSectBuffer m_buffer;
};
#endif // Unix/Win32
wxDECLARE_NO_COPY_CLASS(wxCriticalSection);
};
#if wxCRITSECT_IS_MUTEX
// implement wxCriticalSection using mutexes
inline wxCriticalSection::wxCriticalSection( wxCriticalSectionType critSecType )
: m_mutex( critSecType == wxCRITSEC_DEFAULT ? wxMUTEX_RECURSIVE : wxMUTEX_DEFAULT ) { }
inline wxCriticalSection::~wxCriticalSection() { }
inline void wxCriticalSection::Enter() { (void)m_mutex.Lock(); }
inline bool wxCriticalSection::TryEnter() { return m_mutex.TryLock() == wxMUTEX_NO_ERROR; }
inline void wxCriticalSection::Leave() { (void)m_mutex.Unlock(); }
#endif // wxCRITSECT_IS_MUTEX
#undef wxCRITSECT_INLINE
#undef wxCRITSECT_IS_MUTEX
// wxCriticalSectionLocker is the same to critical sections as wxMutexLocker is
// to mutexes
class WXDLLIMPEXP_BASE wxCriticalSectionLocker
{
public:
wxCriticalSectionLocker(wxCriticalSection& cs)
: m_critsect(cs)
{
m_critsect.Enter();
}
~wxCriticalSectionLocker()
{
m_critsect.Leave();
}
private:
wxCriticalSection& m_critsect;
wxDECLARE_NO_COPY_CLASS(wxCriticalSectionLocker);
};
// ----------------------------------------------------------------------------
// wxCondition models a POSIX condition variable which allows one (or more)
// thread(s) to wait until some condition is fulfilled
// ----------------------------------------------------------------------------
class WXDLLIMPEXP_BASE wxCondition
{
public:
// Each wxCondition object is associated with a (single) wxMutex object.
// The mutex object MUST be locked before calling Wait()
wxCondition(wxMutex& mutex);
// dtor is not virtual, don't use this class polymorphically
~wxCondition();
// return true if the condition has been created successfully
bool IsOk() const;
// NB: the associated mutex MUST be locked beforehand by the calling thread
//
// it atomically releases the lock on the associated mutex
// and starts waiting to be woken up by a Signal()/Broadcast()
// once its signaled, then it will wait until it can reacquire
// the lock on the associated mutex object, before returning.
wxCondError Wait();
// std::condition_variable-like variant that evaluates the associated condition
template<typename Functor>
wxCondError Wait(const Functor& predicate)
{
while ( !predicate() )
{
wxCondError e = Wait();
if ( e != wxCOND_NO_ERROR )
return e;
}
return wxCOND_NO_ERROR;
}
// exactly as Wait() except that it may also return if the specified
// timeout elapses even if the condition hasn't been signalled: in this
// case, the return value is wxCOND_TIMEOUT, otherwise (i.e. in case of a
// normal return) it is wxCOND_NO_ERROR.
//
// the timeout parameter specifies an interval that needs to be waited for
// in milliseconds
wxCondError WaitTimeout(unsigned long milliseconds);
// NB: the associated mutex may or may not be locked by the calling thread
//
// this method unblocks one thread if any are blocking on the condition.
// if no thread is blocking in Wait(), then the signal is NOT remembered
// The thread which was blocking on Wait() will then reacquire the lock
// on the associated mutex object before returning
wxCondError Signal();
// NB: the associated mutex may or may not be locked by the calling thread
//
// this method unblocks all threads if any are blocking on the condition.
// if no thread is blocking in Wait(), then the signal is NOT remembered
// The threads which were blocking on Wait() will then reacquire the lock
// on the associated mutex object before returning.
wxCondError Broadcast();
private:
wxConditionInternal *m_internal;
wxDECLARE_NO_COPY_CLASS(wxCondition);
};
// ----------------------------------------------------------------------------
// wxSemaphore: a counter limiting the number of threads concurrently accessing
// a shared resource
// ----------------------------------------------------------------------------
class WXDLLIMPEXP_BASE wxSemaphore
{
public:
// specifying a maxcount of 0 actually makes wxSemaphore behave as if there
// is no upper limit, if maxcount is 1 the semaphore behaves as a mutex
wxSemaphore( int initialcount = 0, int maxcount = 0 );
// dtor is not virtual, don't use this class polymorphically
~wxSemaphore();
// return true if the semaphore has been created successfully
bool IsOk() const;
// wait indefinitely, until the semaphore count goes beyond 0
// and then decrement it and return (this method might have been called
// Acquire())
wxSemaError Wait();
// same as Wait(), but does not block, returns wxSEMA_NO_ERROR if
// successful and wxSEMA_BUSY if the count is currently zero
wxSemaError TryWait();
// same as Wait(), but as a timeout limit, returns wxSEMA_NO_ERROR if the
// semaphore was acquired and wxSEMA_TIMEOUT if the timeout has elapsed
wxSemaError WaitTimeout(unsigned long milliseconds);
// increments the semaphore count and signals one of the waiting threads
wxSemaError Post();
private:
wxSemaphoreInternal *m_internal;
wxDECLARE_NO_COPY_CLASS(wxSemaphore);
};
// ----------------------------------------------------------------------------
// wxThread: class encapsulating a thread of execution
// ----------------------------------------------------------------------------
// there are two different kinds of threads: joinable and detached (default)
// ones. Only joinable threads can return a return code and only detached
// threads auto-delete themselves - the user should delete the joinable
// threads manually.
// NB: in the function descriptions the words "this thread" mean the thread
// created by the wxThread object while "main thread" is the thread created
// during the process initialization (a.k.a. the GUI thread)
// On VMS thread pointers are 64 bits (also needed for other systems???
#ifdef __VMS
typedef unsigned long long wxThreadIdType;
#else
typedef unsigned long wxThreadIdType;
#endif
class WXDLLIMPEXP_BASE wxThread
{
public:
// the return type for the thread function
typedef void *ExitCode;
// static functions
// Returns the wxThread object for the calling thread. NULL is returned
// if the caller is the main thread (but it's recommended to use
// IsMain() and only call This() for threads other than the main one
// because NULL is also returned on error). If the thread wasn't
// created with wxThread class, the returned value is undefined.
static wxThread *This();
// Returns true if current thread is the main thread.
//
// Notice that it also returns true if main thread id hadn't been
// initialized yet on the assumption that it's too early in wx startup
// process for any other threads to have been created in this case.
static bool IsMain()
{
return !ms_idMainThread || GetCurrentId() == ms_idMainThread;
}
// Return the main thread id
static wxThreadIdType GetMainId() { return ms_idMainThread; }
// Release the rest of our time slice letting the other threads run
static void Yield();
// Sleep during the specified period of time in milliseconds
//
// This is the same as wxMilliSleep().
static void Sleep(unsigned long milliseconds);
// get the number of system CPUs - useful with SetConcurrency()
// (the "best" value for it is usually number of CPUs + 1)
//
// Returns -1 if unknown, number of CPUs otherwise
static int GetCPUCount();
// Get the platform specific thread ID and return as a long. This
// can be used to uniquely identify threads, even if they are not
// wxThreads. This is used by wxPython.
static wxThreadIdType GetCurrentId();
// sets the concurrency level: this is, roughly, the number of threads
// the system tries to schedule to run in parallel. 0 means the
// default value (usually acceptable, but may not yield the best
// performance for this process)
//
// Returns true on success, false otherwise (if not implemented, for
// example)
static bool SetConcurrency(size_t level);
// constructor only creates the C++ thread object and doesn't create (or
// start) the real thread
wxThread(wxThreadKind kind = wxTHREAD_DETACHED);
// functions that change the thread state: all these can only be called
// from _another_ thread (typically the thread that created this one, e.g.
// the main thread), not from the thread itself
// create a new thread and optionally set the stack size on
// platforms that support that - call Run() to start it
wxThreadError Create(unsigned int stackSize = 0);
// starts execution of the thread - from the moment Run() is called
// the execution of wxThread::Entry() may start at any moment, caller
// shouldn't suppose that it starts after (or before) Run() returns.
wxThreadError Run();
// stops the thread if it's running and deletes the wxThread object if
// this is a detached thread freeing its memory - otherwise (for
// joinable threads) you still need to delete wxThread object
// yourself.
//
// this function only works if the thread calls TestDestroy()
// periodically - the thread will only be deleted the next time it
// does it!
//
// will fill the rc pointer with the thread exit code if it's !NULL
wxThreadError Delete(ExitCode *rc = NULL,
wxThreadWait waitMode = wxTHREAD_WAIT_DEFAULT);
// waits for a joinable thread to finish and returns its exit code
//
// Returns (ExitCode)-1 on error (for example, if the thread is not
// joinable)
ExitCode Wait(wxThreadWait waitMode = wxTHREAD_WAIT_DEFAULT);
// kills the thread without giving it any chance to clean up - should
// not be used under normal circumstances, use Delete() instead.
// It is a dangerous function that should only be used in the most
// extreme cases!
//
// The wxThread object is deleted by Kill() if the thread is
// detachable, but you still have to delete it manually for joinable
// threads.
wxThreadError Kill();
// pause a running thread: as Delete(), this only works if the thread
// calls TestDestroy() regularly
wxThreadError Pause();
// resume a paused thread
wxThreadError Resume();
// priority
// Sets the priority to "prio" which must be in 0..100 range (see
// also wxPRIORITY_XXX constants).
//
// NB: under MSW the priority can only be set after the thread is
// created (but possibly before it is launched)
void SetPriority(unsigned int prio);
// Get the current priority.
unsigned int GetPriority() const;
// thread status inquiries
// Returns true if the thread is alive: i.e. running or suspended
bool IsAlive() const;
// Returns true if the thread is running (not paused, not killed).
bool IsRunning() const;
// Returns true if the thread is suspended
bool IsPaused() const;
// is the thread of detached kind?
bool IsDetached() const { return m_isDetached; }
// Get the thread ID - a platform dependent number which uniquely
// identifies a thread inside a process
wxThreadIdType GetId() const;
#ifdef __WINDOWS__
// Get the internal OS handle
WXHANDLE MSWGetHandle() const;
#endif // __WINDOWS__
wxThreadKind GetKind() const
{ return m_isDetached ? wxTHREAD_DETACHED : wxTHREAD_JOINABLE; }
// Returns true if the thread was asked to terminate: this function should
// be called by the thread from time to time, otherwise the main thread
// will be left forever in Delete()!
virtual bool TestDestroy();
// dtor is public, but the detached threads should never be deleted - use
// Delete() instead (or leave the thread terminate by itself)
virtual ~wxThread();
protected:
// exits from the current thread - can be called only from this thread
void Exit(ExitCode exitcode = 0);
// entry point for the thread - called by Run() and executes in the context
// of this thread.
virtual void *Entry() = 0;
// use this to call the Entry() virtual method
void *CallEntry();
// Callbacks which may be overridden by the derived class to perform some
// specific actions when the thread is deleted or killed. By default they
// do nothing.
// This one is called by Delete() before actually deleting the thread and
// is executed in the context of the thread that called Delete().
virtual void OnDelete() {}
// This one is called by Kill() before killing the thread and is executed
// in the context of the thread that called Kill().
virtual void OnKill() {}
private:
// no copy ctor/assignment operator
wxThread(const wxThread&);
wxThread& operator=(const wxThread&);
// called when the thread exits - in the context of this thread
//
// NB: this function will not be called if the thread is Kill()ed
virtual void OnExit() { }
friend class wxThreadInternal;
friend class wxThreadModule;
// the main thread identifier, should be set on startup
static wxThreadIdType ms_idMainThread;
// the (platform-dependent) thread class implementation
wxThreadInternal *m_internal;
// protects access to any methods of wxThreadInternal object
wxCriticalSection m_critsect;
// true if the thread is detached, false if it is joinable
bool m_isDetached;
};
// wxThreadHelperThread class
// --------------------------
class WXDLLIMPEXP_BASE wxThreadHelperThread : public wxThread
{
public:
// constructor only creates the C++ thread object and doesn't create (or
// start) the real thread
wxThreadHelperThread(wxThreadHelper& owner, wxThreadKind kind)
: wxThread(kind), m_owner(owner)
{ }
protected:
// entry point for the thread -- calls Entry() in owner.
virtual void *Entry() wxOVERRIDE;
private:
// the owner of the thread
wxThreadHelper& m_owner;
// no copy ctor/assignment operator
wxThreadHelperThread(const wxThreadHelperThread&);
wxThreadHelperThread& operator=(const wxThreadHelperThread&);
};
// ----------------------------------------------------------------------------
// wxThreadHelper: this class implements the threading logic to run a
// background task in another object (such as a window). It is a mix-in: just
// derive from it to implement a threading background task in your class.
// ----------------------------------------------------------------------------
class WXDLLIMPEXP_BASE wxThreadHelper
{
private:
void KillThread()
{
// If wxThreadHelperThread is detached and is about to finish, it will
// set m_thread to NULL so don't delete it then.
// But if KillThread is called before wxThreadHelperThread (in detached mode)
// sets it to NULL, then the thread object still exists and can be killed
wxCriticalSectionLocker locker(m_critSection);
if ( m_thread )
{
m_thread->Kill();
if ( m_kind == wxTHREAD_JOINABLE )
delete m_thread;
m_thread = NULL;
}
}
public:
// constructor only initializes m_thread to NULL
wxThreadHelper(wxThreadKind kind = wxTHREAD_JOINABLE)
: m_thread(NULL), m_kind(kind) { }
// destructor deletes m_thread
virtual ~wxThreadHelper() { KillThread(); }
#if WXWIN_COMPATIBILITY_2_8
wxDEPRECATED( wxThreadError Create(unsigned int stackSize = 0) );
#endif
// create a new thread (and optionally set the stack size on platforms that
// support/need that), call Run() to start it
wxThreadError CreateThread(wxThreadKind kind = wxTHREAD_JOINABLE,
unsigned int stackSize = 0)
{
KillThread();
m_kind = kind;
m_thread = new wxThreadHelperThread(*this, m_kind);
return m_thread->Create(stackSize);
}
// entry point for the thread - called by Run() and executes in the context
// of this thread.
virtual void *Entry() = 0;
// returns a pointer to the thread which can be used to call Run()
wxThread *GetThread() const
{
wxCriticalSectionLocker locker((wxCriticalSection&)m_critSection);
wxThread* thread = m_thread;
return thread;
}
protected:
wxThread *m_thread;
wxThreadKind m_kind;
wxCriticalSection m_critSection; // To guard the m_thread variable
friend class wxThreadHelperThread;
};
#if WXWIN_COMPATIBILITY_2_8
inline wxThreadError wxThreadHelper::Create(unsigned int stackSize)
{ return CreateThread(m_kind, stackSize); }
#endif
// call Entry() in owner, put it down here to avoid circular declarations
inline void *wxThreadHelperThread::Entry()
{
void * const result = m_owner.Entry();
wxCriticalSectionLocker locker(m_owner.m_critSection);
// Detached thread will be deleted after returning, so make sure
// wxThreadHelper::GetThread will not return an invalid pointer.
// And that wxThreadHelper::KillThread will not try to kill
// an already deleted thread
if ( m_owner.m_kind == wxTHREAD_DETACHED )
m_owner.m_thread = NULL;
return result;
}
// ----------------------------------------------------------------------------
// Automatic initialization
// ----------------------------------------------------------------------------
// GUI mutex handling.
void WXDLLIMPEXP_BASE wxMutexGuiEnter();
void WXDLLIMPEXP_BASE wxMutexGuiLeave();
// macros for entering/leaving critical sections which may be used without
// having to take them inside "#if wxUSE_THREADS"
#define wxENTER_CRIT_SECT(cs) (cs).Enter()
#define wxLEAVE_CRIT_SECT(cs) (cs).Leave()
#define wxCRIT_SECT_DECLARE(cs) static wxCriticalSection cs
#define wxCRIT_SECT_DECLARE_MEMBER(cs) wxCriticalSection cs
#define wxCRIT_SECT_LOCKER(name, cs) wxCriticalSectionLocker name(cs)
// function for checking if we're in the main thread which may be used whether
// wxUSE_THREADS is 0 or 1
inline bool wxIsMainThread() { return wxThread::IsMain(); }
#else // !wxUSE_THREADS
// no thread support
inline void wxMutexGuiEnter() { }
inline void wxMutexGuiLeave() { }
// macros for entering/leaving critical sections which may be used without
// having to take them inside "#if wxUSE_THREADS"
// (the implementation uses dummy structs to force semicolon after the macro)
#define wxENTER_CRIT_SECT(cs) do {} while (0)
#define wxLEAVE_CRIT_SECT(cs) do {} while (0)
#define wxCRIT_SECT_DECLARE(cs) struct wxDummyCS##cs
#define wxCRIT_SECT_DECLARE_MEMBER(cs) struct wxDummyCSMember##cs { }
#define wxCRIT_SECT_LOCKER(name, cs) struct wxDummyCSLocker##name
// if there is only one thread, it is always the main one
inline bool wxIsMainThread() { return true; }
#endif // wxUSE_THREADS/!wxUSE_THREADS
// mark part of code as being a critical section: this macro declares a
// critical section with the given name and enters it immediately and leaves
// it at the end of the current scope
//
// example:
//
// int Count()
// {
// static int s_counter = 0;
//
// wxCRITICAL_SECTION(counter);
//
// return ++s_counter;
// }
//
// this function is MT-safe in presence of the threads but there is no
// overhead when the library is compiled without threads
#define wxCRITICAL_SECTION(name) \
wxCRIT_SECT_DECLARE(s_cs##name); \
wxCRIT_SECT_LOCKER(cs##name##Locker, s_cs##name)
// automatically lock GUI mutex in ctor and unlock it in dtor
class WXDLLIMPEXP_BASE wxMutexGuiLocker
{
public:
wxMutexGuiLocker() { wxMutexGuiEnter(); }
~wxMutexGuiLocker() { wxMutexGuiLeave(); }
};
// -----------------------------------------------------------------------------
// implementation only until the end of file
// -----------------------------------------------------------------------------
#if wxUSE_THREADS
#if defined(__WINDOWS__) || defined(__DARWIN__)
// unlock GUI if there are threads waiting for and lock it back when
// there are no more of them - should be called periodically by the main
// thread
extern void WXDLLIMPEXP_BASE wxMutexGuiLeaveOrEnter();
// returns true if the main thread has GUI lock
extern bool WXDLLIMPEXP_BASE wxGuiOwnedByMainThread();
// wakes up the main thread if it's sleeping inside ::GetMessage()
extern void WXDLLIMPEXP_BASE wxWakeUpMainThread();
#ifndef __DARWIN__
// return true if the main thread is waiting for some other to terminate:
// wxApp then should block all "dangerous" messages
extern bool WXDLLIMPEXP_BASE wxIsWaitingForThread();
#endif
#endif // MSW, OSX
#endif // wxUSE_THREADS
#endif // _WX_THREAD_H_
| h |
rticonnextdds-usecases | data/projects/rticonnextdds-usecases/VehicleTracking/ExampleCode/thirdparty/wxWidgets-3.1.2/Linux/include/wx/lzmastream.h | ///////////////////////////////////////////////////////////////////////////////
// Name: wx/lzmastream.h
// Purpose: Filters streams using LZMA(2) compression
// Author: Vadim Zeitlin
// Created: 2018-03-29
// Copyright: (c) 2018 Vadim Zeitlin <[email protected]>
// Licence: wxWindows licence
///////////////////////////////////////////////////////////////////////////////
#ifndef _WX_LZMASTREAM_H_
#define _WX_LZMASTREAM_H_
#include "wx/defs.h"
#if wxUSE_LIBLZMA && wxUSE_STREAMS
#include "wx/stream.h"
#include "wx/versioninfo.h"
namespace wxPrivate
{
// Private wrapper for lzma_stream struct.
struct wxLZMAStream;
// Common part of input and output LZMA streams: this is just an implementation
// detail and is not part of the public API.
class WXDLLIMPEXP_BASE wxLZMAData
{
protected:
wxLZMAData();
~wxLZMAData();
wxLZMAStream* m_stream;
wxUint8* m_streamBuf;
wxFileOffset m_pos;
wxDECLARE_NO_COPY_CLASS(wxLZMAData);
};
} // namespace wxPrivate
// ----------------------------------------------------------------------------
// Filter for decompressing data compressed using LZMA
// ----------------------------------------------------------------------------
class WXDLLIMPEXP_BASE wxLZMAInputStream : public wxFilterInputStream,
private wxPrivate::wxLZMAData
{
public:
explicit wxLZMAInputStream(wxInputStream& stream)
: wxFilterInputStream(stream)
{
Init();
}
explicit wxLZMAInputStream(wxInputStream* stream)
: wxFilterInputStream(stream)
{
Init();
}
char Peek() wxOVERRIDE { return wxInputStream::Peek(); }
wxFileOffset GetLength() const wxOVERRIDE { return wxInputStream::GetLength(); }
protected:
size_t OnSysRead(void *buffer, size_t size) wxOVERRIDE;
wxFileOffset OnSysTell() const wxOVERRIDE { return m_pos; }
private:
void Init();
};
// ----------------------------------------------------------------------------
// Filter for compressing data using LZMA(2) algorithm
// ----------------------------------------------------------------------------
class WXDLLIMPEXP_BASE wxLZMAOutputStream : public wxFilterOutputStream,
private wxPrivate::wxLZMAData
{
public:
explicit wxLZMAOutputStream(wxOutputStream& stream, int level = -1)
: wxFilterOutputStream(stream)
{
Init(level);
}
explicit wxLZMAOutputStream(wxOutputStream* stream, int level = -1)
: wxFilterOutputStream(stream)
{
Init(level);
}
virtual ~wxLZMAOutputStream() { Close(); }
void Sync() wxOVERRIDE { DoFlush(false); }
bool Close() wxOVERRIDE;
wxFileOffset GetLength() const wxOVERRIDE { return m_pos; }
protected:
size_t OnSysWrite(const void *buffer, size_t size) wxOVERRIDE;
wxFileOffset OnSysTell() const wxOVERRIDE { return m_pos; }
private:
void Init(int level);
// Write the contents of the internal buffer to the output stream.
bool UpdateOutput();
// Write out the current buffer if necessary, i.e. if no space remains in
// it, and reinitialize m_stream to point to it. Returns false on success
// or false on error, in which case m_lasterror is updated.
bool UpdateOutputIfNecessary();
// Run LZMA_FINISH (if argument is true) or LZMA_FULL_FLUSH, return true on
// success or false on error.
bool DoFlush(bool finish);
};
// ----------------------------------------------------------------------------
// Support for creating LZMA streams from extension/MIME type
// ----------------------------------------------------------------------------
class WXDLLIMPEXP_BASE wxLZMAClassFactory: public wxFilterClassFactory
{
public:
wxLZMAClassFactory();
wxFilterInputStream *NewStream(wxInputStream& stream) const wxOVERRIDE
{ return new wxLZMAInputStream(stream); }
wxFilterOutputStream *NewStream(wxOutputStream& stream) const wxOVERRIDE
{ return new wxLZMAOutputStream(stream, -1); }
wxFilterInputStream *NewStream(wxInputStream *stream) const wxOVERRIDE
{ return new wxLZMAInputStream(stream); }
wxFilterOutputStream *NewStream(wxOutputStream *stream) const wxOVERRIDE
{ return new wxLZMAOutputStream(stream, -1); }
const wxChar * const *GetProtocols(wxStreamProtocolType type
= wxSTREAM_PROTOCOL) const wxOVERRIDE;
private:
wxDECLARE_DYNAMIC_CLASS(wxLZMAClassFactory);
};
WXDLLIMPEXP_BASE wxVersionInfo wxGetLibLZMAVersionInfo();
#endif // wxUSE_LIBLZMA && wxUSE_STREAMS
#endif // _WX_LZMASTREAM_H_
| h |
rticonnextdds-usecases | data/projects/rticonnextdds-usecases/VehicleTracking/ExampleCode/thirdparty/wxWidgets-3.1.2/Linux/include/wx/wxhtml.h | /////////////////////////////////////////////////////////////////////////////
// Name: wx/wxhtml.h
// Purpose: wxHTML library for wxWidgets
// Author: Vaclav Slavik
// Copyright: (c) 1999 Vaclav Slavik
// Licence: wxWindows licence
/////////////////////////////////////////////////////////////////////////////
#ifndef _WX_HTML_H_
#define _WX_HTML_H_
#include "wx/html/htmldefs.h"
#include "wx/html/htmltag.h"
#include "wx/html/htmlcell.h"
#include "wx/html/htmlpars.h"
#include "wx/html/htmlwin.h"
#include "wx/html/winpars.h"
#include "wx/filesys.h"
#include "wx/html/helpctrl.h"
#endif // __WXHTML_H__
| h |
rticonnextdds-usecases | data/projects/rticonnextdds-usecases/VehicleTracking/ExampleCode/thirdparty/wxWidgets-3.1.2/Linux/include/wx/imagpnm.h | /////////////////////////////////////////////////////////////////////////////
// Name: wx/imagpnm.h
// Purpose: wxImage PNM handler
// Author: Sylvain Bougnoux
// Copyright: (c) Sylvain Bougnoux
// Licence: wxWindows licence
/////////////////////////////////////////////////////////////////////////////
#ifndef _WX_IMAGPNM_H_
#define _WX_IMAGPNM_H_
#include "wx/image.h"
//-----------------------------------------------------------------------------
// wxPNMHandler
//-----------------------------------------------------------------------------
#if wxUSE_PNM
class WXDLLIMPEXP_CORE wxPNMHandler : public wxImageHandler
{
public:
inline wxPNMHandler()
{
m_name = wxT("PNM file");
m_extension = wxT("pnm");
m_altExtensions.Add(wxT("ppm"));
m_altExtensions.Add(wxT("pgm"));
m_altExtensions.Add(wxT("pbm"));
m_type = wxBITMAP_TYPE_PNM;
m_mime = wxT("image/pnm");
}
#if wxUSE_STREAMS
virtual bool LoadFile( wxImage *image, wxInputStream& stream, bool verbose=true, int index=-1 ) wxOVERRIDE;
virtual bool SaveFile( wxImage *image, wxOutputStream& stream, bool verbose=true ) wxOVERRIDE;
protected:
virtual bool DoCanRead( wxInputStream& stream ) wxOVERRIDE;
#endif
private:
wxDECLARE_DYNAMIC_CLASS(wxPNMHandler);
};
#endif
#endif
// _WX_IMAGPNM_H_
| h |
rticonnextdds-usecases | data/projects/rticonnextdds-usecases/VehicleTracking/ExampleCode/thirdparty/wxWidgets-3.1.2/Linux/include/wx/unichar.h | ///////////////////////////////////////////////////////////////////////////////
// Name: wx/unichar.h
// Purpose: wxUniChar and wxUniCharRef classes
// Author: Vaclav Slavik
// Created: 2007-03-19
// Copyright: (c) 2007 REA Elektronik GmbH
// Licence: wxWindows licence
///////////////////////////////////////////////////////////////////////////////
#ifndef _WX_UNICHAR_H_
#define _WX_UNICHAR_H_
#include "wx/defs.h"
#include "wx/chartype.h"
#include "wx/stringimpl.h"
// We need to get std::swap() declaration in order to specialize it below and
// it is declared in different headers for C++98 and C++11. Instead of testing
// which one is being used, just include both of them as it's simpler and less
// error-prone.
#include <algorithm> // std::swap() for C++98
#include <utility> // std::swap() for C++11
class WXDLLIMPEXP_FWD_BASE wxUniCharRef;
class WXDLLIMPEXP_FWD_BASE wxString;
// This class represents single Unicode character. It can be converted to
// and from char or wchar_t and implements commonly used character operations.
class WXDLLIMPEXP_BASE wxUniChar
{
public:
// NB: this is not wchar_t on purpose, it needs to represent the entire
// Unicode code points range and wchar_t may be too small for that
// (e.g. on Win32 where wchar_t* is encoded in UTF-16)
typedef wxUint32 value_type;
wxUniChar() : m_value(0) {}
// Create the character from 8bit character value encoded in the current
// locale's charset.
wxUniChar(char c) { m_value = From8bit(c); }
wxUniChar(unsigned char c) { m_value = From8bit((char)c); }
#define wxUNICHAR_DEFINE_CTOR(type) \
wxUniChar(type c) { m_value = (value_type)c; }
wxDO_FOR_INT_TYPES(wxUNICHAR_DEFINE_CTOR)
#undef wxUNICHAR_DEFINE_CTOR
wxUniChar(const wxUniCharRef& c);
// Returns Unicode code point value of the character
value_type GetValue() const { return m_value; }
#if wxUSE_UNICODE_UTF8
// buffer for single UTF-8 character
struct Utf8CharBuffer
{
char data[5];
operator const char*() const { return data; }
};
// returns the character encoded as UTF-8
// (NB: implemented in stringops.cpp)
Utf8CharBuffer AsUTF8() const;
#endif // wxUSE_UNICODE_UTF8
// Returns true if the character is an ASCII character:
bool IsAscii() const { return m_value < 0x80; }
// Returns true if the character is representable as a single byte in the
// current locale encoding and return this byte in output argument c (which
// must be non-NULL)
bool GetAsChar(char *c) const
{
#if wxUSE_UNICODE
if ( !IsAscii() )
{
#if !wxUSE_UTF8_LOCALE_ONLY
if ( GetAsHi8bit(m_value, c) )
return true;
#endif // !wxUSE_UTF8_LOCALE_ONLY
return false;
}
#endif // wxUSE_UNICODE
*c = wx_truncate_cast(char, m_value);
return true;
}
// Returns true if the character is a BMP character:
static bool IsBMP(wxUint32 value) { return value < 0x10000; }
// Returns true if the character is a supplementary character:
static bool IsSupplementary(wxUint32 value) { return 0x10000 <= value && value < 0x110000; }
// Returns the high surrogate code unit for the supplementary character
static wxUint16 HighSurrogate(wxUint32 value)
{
wxASSERT_MSG(IsSupplementary(value), "wxUniChar::HighSurrogate() must be called on a supplementary character");
return static_cast<wxUint16>(0xD800 | ((value - 0x10000) >> 10));
}
// Returns the low surrogate code unit for the supplementary character
static wxUint16 LowSurrogate(wxUint32 value)
{
wxASSERT_MSG(IsSupplementary(value), "wxUniChar::LowSurrogate() must be called on a supplementary character");
return static_cast<wxUint16>(0xDC00 | ((value - 0x10000) & 0x03FF));
}
// Returns true if the character is a BMP character:
bool IsBMP() const { return IsBMP(m_value); }
// Returns true if the character is a supplementary character:
bool IsSupplementary() const { return IsSupplementary(m_value); }
// Returns the high surrogate code unit for the supplementary character
wxUint16 HighSurrogate() const { return HighSurrogate(m_value); }
// Returns the low surrogate code unit for the supplementary character
wxUint16 LowSurrogate() const { return LowSurrogate(m_value); }
// Conversions to char and wchar_t types: all of those are needed to be
// able to pass wxUniChars to verious standard narrow and wide character
// functions
operator char() const { return To8bit(m_value); }
operator unsigned char() const { return (unsigned char)To8bit(m_value); }
#define wxUNICHAR_DEFINE_OPERATOR_PAREN(type) \
operator type() const { return (type)m_value; }
wxDO_FOR_INT_TYPES(wxUNICHAR_DEFINE_OPERATOR_PAREN)
#undef wxUNICHAR_DEFINE_OPERATOR_PAREN
// We need this operator for the "*p" part of expressions like "for (
// const_iterator p = begin() + nStart; *p; ++p )". In this case,
// compilation would fail without it because the conversion to bool would
// be ambiguous (there are all these int types conversions...). (And adding
// operator unspecified_bool_type() would only makes the ambiguity worse.)
operator bool() const { return m_value != 0; }
bool operator!() const { return !((bool)*this); }
// And this one is needed by some (not all, but not using ifdefs makes the
// code easier) compilers to parse "str[0] && *p" successfully
bool operator&&(bool v) const { return (bool)*this && v; }
// Assignment operators:
wxUniChar& operator=(const wxUniChar& c) { if (&c != this) m_value = c.m_value; return *this; }
wxUniChar& operator=(const wxUniCharRef& c);
wxUniChar& operator=(char c) { m_value = From8bit(c); return *this; }
wxUniChar& operator=(unsigned char c) { m_value = From8bit((char)c); return *this; }
#define wxUNICHAR_DEFINE_OPERATOR_EQUAL(type) \
wxUniChar& operator=(type c) { m_value = (value_type)c; return *this; }
wxDO_FOR_INT_TYPES(wxUNICHAR_DEFINE_OPERATOR_EQUAL)
#undef wxUNICHAR_DEFINE_OPERATOR_EQUAL
// Comparison operators:
#define wxDEFINE_UNICHAR_CMP_WITH_INT(T, op) \
bool operator op(T c) const { return m_value op (value_type)c; }
// define the given comparison operator for all the types
#define wxDEFINE_UNICHAR_OPERATOR(op) \
bool operator op(const wxUniChar& c) const { return m_value op c.m_value; }\
bool operator op(char c) const { return m_value op From8bit(c); } \
bool operator op(unsigned char c) const { return m_value op From8bit((char)c); } \
wxDO_FOR_INT_TYPES_1(wxDEFINE_UNICHAR_CMP_WITH_INT, op)
wxFOR_ALL_COMPARISONS(wxDEFINE_UNICHAR_OPERATOR)
#undef wxDEFINE_UNICHAR_OPERATOR
#undef wxDEFINE_UNCHAR_CMP_WITH_INT
// this is needed for expressions like 'Z'-c
int operator-(const wxUniChar& c) const { return m_value - c.m_value; }
int operator-(char c) const { return m_value - From8bit(c); }
int operator-(unsigned char c) const { return m_value - From8bit((char)c); }
int operator-(wchar_t c) const { return m_value - (value_type)c; }
private:
// notice that we implement these functions inline for 7-bit ASCII
// characters purely for performance reasons
static value_type From8bit(char c)
{
#if wxUSE_UNICODE
if ( (unsigned char)c < 0x80 )
return c;
return FromHi8bit(c);
#else
return c;
#endif
}
static char To8bit(value_type c)
{
#if wxUSE_UNICODE
if ( c < 0x80 )
return wx_truncate_cast(char, c);
return ToHi8bit(c);
#else
return wx_truncate_cast(char, c);
#endif
}
// helpers of the functions above called to deal with non-ASCII chars
static value_type FromHi8bit(char c);
static char ToHi8bit(value_type v);
static bool GetAsHi8bit(value_type v, char *c);
private:
value_type m_value;
};
// Writeable reference to a character in wxString.
//
// This class can be used in the same way wxChar is used, except that changing
// its value updates the underlying string object.
class WXDLLIMPEXP_BASE wxUniCharRef
{
private:
typedef wxStringImpl::iterator iterator;
// create the reference
#if wxUSE_UNICODE_UTF8
wxUniCharRef(wxString& str, iterator pos) : m_str(str), m_pos(pos) {}
#else
wxUniCharRef(iterator pos) : m_pos(pos) {}
#endif
public:
// NB: we have to make this public, because we don't have wxString
// declaration available here and so can't declare wxString::iterator
// as friend; so at least don't use a ctor but a static function
// that must be used explicitly (this is more than using 'explicit'
// keyword on ctor!):
#if wxUSE_UNICODE_UTF8
static wxUniCharRef CreateForString(wxString& str, iterator pos)
{ return wxUniCharRef(str, pos); }
#else
static wxUniCharRef CreateForString(iterator pos)
{ return wxUniCharRef(pos); }
#endif
wxUniChar::value_type GetValue() const { return UniChar().GetValue(); }
#if wxUSE_UNICODE_UTF8
wxUniChar::Utf8CharBuffer AsUTF8() const { return UniChar().AsUTF8(); }
#endif // wxUSE_UNICODE_UTF8
bool IsAscii() const { return UniChar().IsAscii(); }
bool GetAsChar(char *c) const { return UniChar().GetAsChar(c); }
bool IsBMP() const { return UniChar().IsBMP(); }
bool IsSupplementary() const { return UniChar().IsSupplementary(); }
wxUint16 HighSurrogate() const { return UniChar().HighSurrogate(); }
wxUint16 LowSurrogate() const { return UniChar().LowSurrogate(); }
// Assignment operators:
#if wxUSE_UNICODE_UTF8
wxUniCharRef& operator=(const wxUniChar& c);
#else
wxUniCharRef& operator=(const wxUniChar& c) { *m_pos = c; return *this; }
#endif
wxUniCharRef& operator=(const wxUniCharRef& c)
{ if (&c != this) *this = c.UniChar(); return *this; }
#define wxUNICHAR_REF_DEFINE_OPERATOR_EQUAL(type) \
wxUniCharRef& operator=(type c) { return *this = wxUniChar(c); }
wxDO_FOR_CHAR_INT_TYPES(wxUNICHAR_REF_DEFINE_OPERATOR_EQUAL)
#undef wxUNICHAR_REF_DEFINE_OPERATOR_EQUAL
// Conversions to the same types as wxUniChar is convertible too:
#define wxUNICHAR_REF_DEFINE_OPERATOR_PAREN(type) \
operator type() const { return UniChar(); }
wxDO_FOR_CHAR_INT_TYPES(wxUNICHAR_REF_DEFINE_OPERATOR_PAREN)
#undef wxUNICHAR_REF_DEFINE_OPERATOR_PAREN
// see wxUniChar::operator bool etc. for explanation
operator bool() const { return (bool)UniChar(); }
bool operator!() const { return !UniChar(); }
bool operator&&(bool v) const { return UniChar() && v; }
#define wxDEFINE_UNICHARREF_CMP_WITH_INT(T, op) \
bool operator op(T c) const { return UniChar() op c; }
// Comparison operators:
#define wxDEFINE_UNICHARREF_OPERATOR(op) \
bool operator op(const wxUniCharRef& c) const { return UniChar() op c.UniChar(); }\
bool operator op(const wxUniChar& c) const { return UniChar() op c; } \
wxDO_FOR_CHAR_INT_TYPES_1(wxDEFINE_UNICHARREF_CMP_WITH_INT, op)
wxFOR_ALL_COMPARISONS(wxDEFINE_UNICHARREF_OPERATOR)
#undef wxDEFINE_UNICHARREF_OPERATOR
#undef wxDEFINE_UNICHARREF_CMP_WITH_INT
// for expressions like c-'A':
int operator-(const wxUniCharRef& c) const { return UniChar() - c.UniChar(); }
int operator-(const wxUniChar& c) const { return UniChar() - c; }
int operator-(char c) const { return UniChar() - c; }
int operator-(unsigned char c) const { return UniChar() - c; }
int operator-(wchar_t c) const { return UniChar() - c; }
private:
#if wxUSE_UNICODE_UTF8
wxUniChar UniChar() const;
#else
wxUniChar UniChar() const { return *m_pos; }
#endif
friend class WXDLLIMPEXP_FWD_BASE wxUniChar;
private:
// reference to the string and pointer to the character in string
#if wxUSE_UNICODE_UTF8
wxString& m_str;
#endif
iterator m_pos;
};
inline wxUniChar::wxUniChar(const wxUniCharRef& c)
{
m_value = c.UniChar().m_value;
}
inline wxUniChar& wxUniChar::operator=(const wxUniCharRef& c)
{
m_value = c.UniChar().m_value;
return *this;
}
// wxUniCharRef doesn't behave quite like a reference, notably because template
// deduction from wxUniCharRef doesn't yield wxUniChar as would have been the
// case if it were a real reference. This results in a number of problems and
// we can't fix all of them but we can at least provide a working swap() for
// it, instead of the default version which doesn't work because a "wrong" type
// is deduced.
namespace std
{
template <>
inline
void swap<wxUniCharRef>(wxUniCharRef& lhs, wxUniCharRef& rhs)
{
if ( &lhs != &rhs )
{
// The use of wxUniChar here is the crucial difference: in the default
// implementation, tmp would be wxUniCharRef and so assigning to lhs
// would modify it too. Here we make a real copy, not affected by
// changing lhs, instead.
wxUniChar tmp = lhs;
lhs = rhs;
rhs = tmp;
}
}
} // namespace std
// Comparison operators for the case when wxUniChar(Ref) is the second operand
// implemented in terms of member comparison functions
wxDEFINE_COMPARISONS_BY_REV(char, const wxUniChar&)
wxDEFINE_COMPARISONS_BY_REV(char, const wxUniCharRef&)
wxDEFINE_COMPARISONS_BY_REV(wchar_t, const wxUniChar&)
wxDEFINE_COMPARISONS_BY_REV(wchar_t, const wxUniCharRef&)
wxDEFINE_COMPARISONS_BY_REV(const wxUniChar&, const wxUniCharRef&)
// for expressions like c-'A':
inline int operator-(char c1, const wxUniCharRef& c2) { return -(c2 - c1); }
inline int operator-(const wxUniChar& c1, const wxUniCharRef& c2) { return -(c2 - c1); }
inline int operator-(wchar_t c1, const wxUniCharRef& c2) { return -(c2 - c1); }
#endif /* _WX_UNICHAR_H_ */
| h |
rticonnextdds-usecases | data/projects/rticonnextdds-usecases/VehicleTracking/ExampleCode/thirdparty/wxWidgets-3.1.2/Linux/include/wx/mdi.h | /////////////////////////////////////////////////////////////////////////////
// Name: wx/mdi.h
// Purpose: wxMDI base header
// Author: Julian Smart (original)
// Vadim Zeitlin (base MDI classes refactoring)
// Copyright: (c) 1998 Julian Smart
// (c) 2008 Vadim Zeitlin
// Licence: wxWindows licence
/////////////////////////////////////////////////////////////////////////////
#ifndef _WX_MDI_H_BASE_
#define _WX_MDI_H_BASE_
#include "wx/defs.h"
#if wxUSE_MDI
#include "wx/frame.h"
#include "wx/menu.h"
// forward declarations
class WXDLLIMPEXP_FWD_CORE wxMDIParentFrame;
class WXDLLIMPEXP_FWD_CORE wxMDIChildFrame;
class WXDLLIMPEXP_FWD_CORE wxMDIClientWindowBase;
class WXDLLIMPEXP_FWD_CORE wxMDIClientWindow;
// ----------------------------------------------------------------------------
// wxMDIParentFrameBase: base class for parent frame for MDI children
// ----------------------------------------------------------------------------
class WXDLLIMPEXP_CORE wxMDIParentFrameBase : public wxFrame
{
public:
wxMDIParentFrameBase()
{
m_clientWindow = NULL;
m_currentChild = NULL;
#if wxUSE_MENUS
m_windowMenu = NULL;
#endif // wxUSE_MENUS
}
/*
Derived classes should provide ctor and Create() with the following
declaration:
bool Create(wxWindow *parent,
wxWindowID winid,
const wxString& title,
const wxPoint& pos = wxDefaultPosition,
const wxSize& size = wxDefaultSize,
long style = wxDEFAULT_FRAME_STYLE | wxVSCROLL | wxHSCROLL,
const wxString& name = wxFrameNameStr);
*/
#if wxUSE_MENUS
virtual ~wxMDIParentFrameBase()
{
delete m_windowMenu;
}
#endif // wxUSE_MENUS
// accessors
// ---------
// Get or change the active MDI child window
virtual wxMDIChildFrame *GetActiveChild() const
{ return m_currentChild; }
virtual void SetActiveChild(wxMDIChildFrame *child)
{ m_currentChild = child; }
// Get the client window
wxMDIClientWindowBase *GetClientWindow() const { return m_clientWindow; }
// MDI windows menu functions
// --------------------------
#if wxUSE_MENUS
// return the pointer to the current window menu or NULL if we don't have
// because of wxFRAME_NO_WINDOW_MENU style
wxMenu* GetWindowMenu() const { return m_windowMenu; }
// use the given menu instead of the default window menu
//
// menu can be NULL to disable the window menu completely
virtual void SetWindowMenu(wxMenu *menu)
{
if ( menu != m_windowMenu )
{
delete m_windowMenu;
m_windowMenu = menu;
}
}
#endif // wxUSE_MENUS
// standard MDI window management functions
// ----------------------------------------
virtual void Cascade() { }
virtual void Tile(wxOrientation WXUNUSED(orient) = wxHORIZONTAL) { }
virtual void ArrangeIcons() { }
virtual void ActivateNext() = 0;
virtual void ActivatePrevious() = 0;
/*
Derived classes must provide the following function:
static bool IsTDI();
*/
// Create the client window class (don't Create() the window here, just
// return a new object of a wxMDIClientWindow-derived class)
//
// Notice that if you override this method you should use the default
// constructor and Create() and not the constructor creating the window
// when creating the frame or your overridden version is not going to be
// called (as the call to a virtual function from ctor will be dispatched
// to this class version)
virtual wxMDIClientWindow *OnCreateClient();
protected:
// Override to pass menu/toolbar events to the active child first.
virtual bool TryBefore(wxEvent& event) wxOVERRIDE;
// This is wxMDIClientWindow for all the native implementations but not for
// the generic MDI version which has its own wxGenericMDIClientWindow and
// so we store it as just a base class pointer because we don't need its
// exact type anyhow
wxMDIClientWindowBase *m_clientWindow;
wxMDIChildFrame *m_currentChild;
#if wxUSE_MENUS
// the current window menu or NULL if we are not using it
wxMenu *m_windowMenu;
#endif // wxUSE_MENUS
};
// ----------------------------------------------------------------------------
// wxMDIChildFrameBase: child frame managed by wxMDIParentFrame
// ----------------------------------------------------------------------------
class WXDLLIMPEXP_CORE wxMDIChildFrameBase : public wxFrame
{
public:
wxMDIChildFrameBase() { m_mdiParent = NULL; }
/*
Derived classes should provide Create() with the following signature:
bool Create(wxMDIParentFrame *parent,
wxWindowID id,
const wxString& title,
const wxPoint& pos = wxDefaultPosition,
const wxSize& size = wxDefaultSize,
long style = wxDEFAULT_FRAME_STYLE,
const wxString& name = wxFrameNameStr);
And setting m_mdiParent to parent parameter.
*/
// MDI children specific methods
virtual void Activate() = 0;
// Return the MDI parent frame: notice that it may not be the same as
// GetParent() (our parent may be the client window or even its subwindow
// in some implementations)
wxMDIParentFrame *GetMDIParent() const { return m_mdiParent; }
// Synonym for GetMDIParent(), was used in some other ports
wxMDIParentFrame *GetMDIParentFrame() const { return GetMDIParent(); }
// in most ports MDI children frames are not really top-level, the only
// exception are the Mac ports in which MDI children are just normal top
// level windows too
virtual bool IsTopLevel() const wxOVERRIDE { return false; }
// In all ports keyboard navigation must stop at MDI child frame level and
// can't cross its boundary. Indicate this by overriding this function to
// return true.
virtual bool IsTopNavigationDomain(NavigationKind kind) const wxOVERRIDE
{
switch ( kind )
{
case Navigation_Tab:
return true;
case Navigation_Accel:
// Parent frame accelerators should work inside MDI child, so
// don't block their processing by returning true for them.
break;
}
return false;
}
// Raising any frame is supposed to show it but wxFrame Raise()
// implementation doesn't work for MDI child frames in most forms so
// forward this to Activate() which serves the same purpose by default.
virtual void Raise() wxOVERRIDE { Activate(); }
protected:
wxMDIParentFrame *m_mdiParent;
};
// ----------------------------------------------------------------------------
// wxTDIChildFrame: child frame used by TDI implementations
// ----------------------------------------------------------------------------
class WXDLLIMPEXP_CORE wxTDIChildFrame : public wxMDIChildFrameBase
{
public:
// override wxFrame methods for this non top-level window
#if wxUSE_STATUSBAR
// no status bars
//
// TODO: MDI children should have their own status bars, why not?
virtual wxStatusBar* CreateStatusBar(int WXUNUSED(number) = 1,
long WXUNUSED(style) = 1,
wxWindowID WXUNUSED(id) = 1,
const wxString& WXUNUSED(name)
= wxEmptyString) wxOVERRIDE
{ return NULL; }
virtual wxStatusBar *GetStatusBar() const wxOVERRIDE
{ return NULL; }
virtual void SetStatusText(const wxString &WXUNUSED(text),
int WXUNUSED(number)=0) wxOVERRIDE
{ }
virtual void SetStatusWidths(int WXUNUSED(n),
const int WXUNUSED(widths)[]) wxOVERRIDE
{ }
#endif // wxUSE_STATUSBAR
#if wxUSE_TOOLBAR
// no toolbar
//
// TODO: again, it should be possible to have tool bars
virtual wxToolBar *CreateToolBar(long WXUNUSED(style),
wxWindowID WXUNUSED(id),
const wxString& WXUNUSED(name)) wxOVERRIDE
{ return NULL; }
virtual wxToolBar *GetToolBar() const wxOVERRIDE { return NULL; }
#endif // wxUSE_TOOLBAR
// no icon
virtual void SetIcons(const wxIconBundle& WXUNUSED(icons)) wxOVERRIDE { }
// title is used as the tab label
virtual wxString GetTitle() const wxOVERRIDE { return m_title; }
virtual void SetTitle(const wxString& title) wxOVERRIDE = 0;
// no maximize etc
virtual void Maximize(bool WXUNUSED(maximize) = true) wxOVERRIDE { }
virtual bool IsMaximized() const wxOVERRIDE { return true; }
virtual bool IsAlwaysMaximized() const wxOVERRIDE { return true; }
virtual void Iconize(bool WXUNUSED(iconize) = true) wxOVERRIDE { }
virtual bool IsIconized() const wxOVERRIDE { return false; }
virtual void Restore() wxOVERRIDE { }
virtual bool ShowFullScreen(bool WXUNUSED(show),
long WXUNUSED(style)) wxOVERRIDE { return false; }
virtual bool IsFullScreen() const wxOVERRIDE { return false; }
// we need to override these functions to ensure that a child window is
// created even though we derive from wxFrame -- basically we make it
// behave as just a wxWindow by short-circuiting wxTLW changes to the base
// class behaviour
virtual void AddChild(wxWindowBase *child) wxOVERRIDE { wxWindow::AddChild(child); }
virtual bool Destroy() wxOVERRIDE { return wxWindow::Destroy(); }
// extra platform-specific hacks
#ifdef __WXMSW__
virtual WXDWORD MSWGetStyle(long flags, WXDWORD *exstyle = NULL) const wxOVERRIDE
{
return wxWindow::MSWGetStyle(flags, exstyle);
}
virtual WXHWND MSWGetParent() const wxOVERRIDE
{
return wxWindow::MSWGetParent();
}
WXLRESULT MSWWindowProc(WXUINT message, WXWPARAM wParam, WXLPARAM lParam) wxOVERRIDE
{
return wxWindow::MSWWindowProc(message, wParam, lParam);
}
#endif // __WXMSW__
protected:
virtual void DoGetSize(int *width, int *height) const wxOVERRIDE
{
wxWindow::DoGetSize(width, height);
}
virtual void DoSetSize(int x, int y, int width, int height, int sizeFlags) wxOVERRIDE
{
wxWindow::DoSetSize(x, y, width, height, sizeFlags);
}
virtual void DoGetClientSize(int *width, int *height) const wxOVERRIDE
{
wxWindow::DoGetClientSize(width, height);
}
virtual void DoSetClientSize(int width, int height) wxOVERRIDE
{
wxWindow::DoSetClientSize(width, height);
}
virtual void DoMoveWindow(int x, int y, int width, int height) wxOVERRIDE
{
wxWindow::DoMoveWindow(x, y, width, height);
}
// no size hints
virtual void DoSetSizeHints(int WXUNUSED(minW), int WXUNUSED(minH),
int WXUNUSED(maxW), int WXUNUSED(maxH),
int WXUNUSED(incW), int WXUNUSED(incH)) wxOVERRIDE { }
wxString m_title;
};
// ----------------------------------------------------------------------------
// wxMDIClientWindowBase: child of parent frame, parent of children frames
// ----------------------------------------------------------------------------
class WXDLLIMPEXP_CORE wxMDIClientWindowBase : public wxWindow
{
public:
/*
The derived class must provide the default ctor only (CreateClient()
will be called later).
*/
// Can be overridden in the derived classes but the base class version must
// be usually called first to really create the client window.
virtual bool CreateClient(wxMDIParentFrame *parent,
long style = wxVSCROLL | wxHSCROLL) = 0;
};
// ----------------------------------------------------------------------------
// Include the port-specific implementation of the base classes defined above
// ----------------------------------------------------------------------------
// wxUSE_GENERIC_MDI_AS_NATIVE may be predefined to force the generic MDI
// implementation use even on the platforms which usually don't use it
//
// notice that generic MDI can still be used without this, but you would need
// to explicitly use wxGenericMDIXXX classes in your code (and currently also
// add src/generic/mdig.cpp to your build as it's not compiled in if generic
// MDI is not used by default -- but this may change later...)
#ifndef wxUSE_GENERIC_MDI_AS_NATIVE
// wxUniv always uses the generic MDI implementation and so do the ports
// without native version (although wxCocoa seems to have one -- but it's
// probably not functional?)
#if defined(__WXMOTIF__) || \
defined(__WXUNIVERSAL__)
#define wxUSE_GENERIC_MDI_AS_NATIVE 1
#else
#define wxUSE_GENERIC_MDI_AS_NATIVE 0
#endif
#endif // wxUSE_GENERIC_MDI_AS_NATIVE
#if wxUSE_GENERIC_MDI_AS_NATIVE
#include "wx/generic/mdig.h"
#elif defined(__WXMSW__)
#include "wx/msw/mdi.h"
#elif defined(__WXGTK20__)
#include "wx/gtk/mdi.h"
#elif defined(__WXGTK__)
#include "wx/gtk1/mdi.h"
#elif defined(__WXMAC__)
#include "wx/osx/mdi.h"
#elif defined(__WXQT__)
#include "wx/qt/mdi.h"
#endif
inline wxMDIClientWindow *wxMDIParentFrameBase::OnCreateClient()
{
return new wxMDIClientWindow;
}
inline bool wxMDIParentFrameBase::TryBefore(wxEvent& event)
{
// Menu (and toolbar) events should be sent to the active child frame
// first, if any.
if ( event.GetEventType() == wxEVT_MENU ||
event.GetEventType() == wxEVT_UPDATE_UI )
{
wxMDIChildFrame * const child = GetActiveChild();
if ( child )
{
// However avoid sending the event back to the child if it's
// currently being propagated to us from it.
wxWindow* const
from = static_cast<wxWindow*>(event.GetPropagatedFrom());
if ( !from || !from->IsDescendant(child) )
{
if ( child->ProcessWindowEventLocally(event) )
return true;
}
}
}
return wxFrame::TryBefore(event);
}
#endif // wxUSE_MDI
#endif // _WX_MDI_H_BASE_
| h |
rticonnextdds-usecases | data/projects/rticonnextdds-usecases/VehicleTracking/ExampleCode/thirdparty/wxWidgets-3.1.2/Linux/include/wx/memconf.h | ///////////////////////////////////////////////////////////////////////////////
// Name: wx/memconf.h
// Purpose: wxMemoryConfig class: a wxConfigBase implementation which only
// stores the settings in memory (thus they are lost when the
// program terminates)
// Author: Vadim Zeitlin
// Modified by:
// Created: 22.01.00
// Copyright: (c) 2000 Vadim Zeitlin <[email protected]>
// Licence: wxWindows licence
///////////////////////////////////////////////////////////////////////////////
/*
* NB: I don't see how this class may possibly be useful to the application
* program (as the settings are lost on program termination), but it is
* handy to have it inside wxWidgets. So for now let's say that this class
* is private and should only be used by wxWidgets itself - this might
* change in the future.
*/
#ifndef _WX_MEMCONF_H_
#define _WX_MEMCONF_H_
#if wxUSE_CONFIG
#include "wx/fileconf.h" // the base class
// ----------------------------------------------------------------------------
// wxMemoryConfig: a config class which stores settings in non-persistent way
// ----------------------------------------------------------------------------
// notice that we inherit from wxFileConfig which already stores its data in
// memory and just disable file reading/writing - this is probably not optimal
// and might be changed in future as well (this class will always deriev from
// wxConfigBase though)
class wxMemoryConfig : public wxFileConfig
{
public:
// default (and only) ctor
wxMemoryConfig() : wxFileConfig(wxEmptyString, // default app name
wxEmptyString, // default vendor name
wxEmptyString, // no local config file
wxEmptyString, // no system config file
0) // don't use any files
{
}
wxDECLARE_NO_COPY_CLASS(wxMemoryConfig);
};
#endif // wxUSE_CONFIG
#endif // _WX_MEMCONF_H_
| h |
rticonnextdds-usecases | data/projects/rticonnextdds-usecases/VehicleTracking/ExampleCode/thirdparty/wxWidgets-3.1.2/Linux/include/wx/valtext.h | /////////////////////////////////////////////////////////////////////////////
// Name: wx/valtext.h
// Purpose: wxTextValidator class
// Author: Julian Smart
// Modified by: Francesco Montorsi
// Created: 29/01/98
// Copyright: (c) 1998 Julian Smart
// Licence: wxWindows licence
/////////////////////////////////////////////////////////////////////////////
#ifndef _WX_VALTEXT_H_
#define _WX_VALTEXT_H_
#include "wx/defs.h"
#if wxUSE_VALIDATORS && (wxUSE_TEXTCTRL || wxUSE_COMBOBOX)
class WXDLLIMPEXP_FWD_CORE wxTextEntry;
#include "wx/validate.h"
enum wxTextValidatorStyle
{
wxFILTER_NONE = 0x0,
wxFILTER_EMPTY = 0x1,
wxFILTER_ASCII = 0x2,
wxFILTER_ALPHA = 0x4,
wxFILTER_ALPHANUMERIC = 0x8,
wxFILTER_DIGITS = 0x10,
wxFILTER_NUMERIC = 0x20,
wxFILTER_INCLUDE_LIST = 0x40,
wxFILTER_INCLUDE_CHAR_LIST = 0x80,
wxFILTER_EXCLUDE_LIST = 0x100,
wxFILTER_EXCLUDE_CHAR_LIST = 0x200
};
class WXDLLIMPEXP_CORE wxTextValidator: public wxValidator
{
public:
wxTextValidator(long style = wxFILTER_NONE, wxString *val = NULL);
wxTextValidator(const wxTextValidator& val);
virtual ~wxTextValidator(){}
// Make a clone of this validator (or return NULL) - currently necessary
// if you're passing a reference to a validator.
// Another possibility is to always pass a pointer to a new validator
// (so the calling code can use a copy constructor of the relevant class).
virtual wxObject *Clone() const wxOVERRIDE { return new wxTextValidator(*this); }
bool Copy(const wxTextValidator& val);
// Called when the value in the window must be validated.
// This function can pop up an error message.
virtual bool Validate(wxWindow *parent) wxOVERRIDE;
// Called to transfer data to the window
virtual bool TransferToWindow() wxOVERRIDE;
// Called to transfer data from the window
virtual bool TransferFromWindow() wxOVERRIDE;
// Filter keystrokes
void OnChar(wxKeyEvent& event);
// ACCESSORS
inline long GetStyle() const { return m_validatorStyle; }
void SetStyle(long style);
wxTextEntry *GetTextEntry();
void SetCharIncludes(const wxString& chars);
void SetIncludes(const wxArrayString& includes) { m_includes = includes; }
inline wxArrayString& GetIncludes() { return m_includes; }
void SetCharExcludes(const wxString& chars);
void SetExcludes(const wxArrayString& excludes) { m_excludes = excludes; }
inline wxArrayString& GetExcludes() { return m_excludes; }
bool HasFlag(wxTextValidatorStyle style) const
{ return (m_validatorStyle & style) != 0; }
protected:
// returns true if all characters of the given string are present in m_includes
bool ContainsOnlyIncludedCharacters(const wxString& val) const;
// returns true if at least one character of the given string is present in m_excludes
bool ContainsExcludedCharacters(const wxString& val) const;
// returns the error message if the contents of 'val' are invalid
virtual wxString IsValid(const wxString& val) const;
protected:
long m_validatorStyle;
wxString* m_stringValue;
wxArrayString m_includes;
wxArrayString m_excludes;
private:
wxDECLARE_NO_ASSIGN_CLASS(wxTextValidator);
wxDECLARE_DYNAMIC_CLASS(wxTextValidator);
wxDECLARE_EVENT_TABLE();
};
#endif
// wxUSE_VALIDATORS && (wxUSE_TEXTCTRL || wxUSE_COMBOBOX)
#endif // _WX_VALTEXT_H_
| h |
rticonnextdds-usecases | data/projects/rticonnextdds-usecases/VehicleTracking/ExampleCode/thirdparty/wxWidgets-3.1.2/Linux/include/wx/xpmdecod.h | /////////////////////////////////////////////////////////////////////////////
// Name: wx/xpmdecod.h
// Purpose: wxXPMDecoder, XPM reader for wxImage and wxBitmap
// Author: Vaclav Slavik
// Copyright: (c) 2001 Vaclav Slavik
// Licence: wxWindows licence
/////////////////////////////////////////////////////////////////////////////
#ifndef _WX_XPMDECOD_H_
#define _WX_XPMDECOD_H_
#include "wx/defs.h"
#if wxUSE_IMAGE && wxUSE_XPM
class WXDLLIMPEXP_FWD_CORE wxImage;
class WXDLLIMPEXP_FWD_BASE wxInputStream;
// --------------------------------------------------------------------------
// wxXPMDecoder class
// --------------------------------------------------------------------------
class WXDLLIMPEXP_CORE wxXPMDecoder
{
public:
// constructor, destructor, etc.
wxXPMDecoder() {}
~wxXPMDecoder() {}
#if wxUSE_STREAMS
// Is the stream XPM file?
// NOTE: this function modifies the current stream position
bool CanRead(wxInputStream& stream);
// Read XPM file from the stream, parse it and create image from it
wxImage ReadFile(wxInputStream& stream);
#endif
// Read directly from XPM data (as passed to wxBitmap ctor):
wxImage ReadData(const char* const* xpm_data);
#ifdef __BORLANDC__
// needed for Borland 5.5
wxImage ReadData(char** xpm_data)
{ return ReadData(const_cast<const char* const*>(xpm_data)); }
#endif
};
#endif // wxUSE_IMAGE && wxUSE_XPM
#endif // _WX_XPM_H_
| h |
rticonnextdds-usecases | data/projects/rticonnextdds-usecases/VehicleTracking/ExampleCode/thirdparty/wxWidgets-3.1.2/Linux/include/wx/dcmirror.h | ///////////////////////////////////////////////////////////////////////////////
// Name: wx/dcmirror.h
// Purpose: wxMirrorDC class
// Author: Vadim Zeitlin
// Modified by:
// Created: 21.07.2003
// Copyright: (c) 2003 Vadim Zeitlin <[email protected]>
// Licence: wxWindows licence
///////////////////////////////////////////////////////////////////////////////
#ifndef _WX_DCMIRROR_H_
#define _WX_DCMIRROR_H_
#include "wx/dc.h"
// ----------------------------------------------------------------------------
// wxMirrorDC allows to write the same code for horz/vertical layout
// ----------------------------------------------------------------------------
class WXDLLIMPEXP_CORE wxMirrorDCImpl : public wxDCImpl
{
public:
// constructs a mirror DC associated with the given real DC
//
// if mirror parameter is true, all vertical and horizontal coordinates are
// exchanged, otherwise this class behaves in exactly the same way as a
// plain DC
wxMirrorDCImpl(wxDC *owner, wxDCImpl& dc, bool mirror)
: wxDCImpl(owner),
m_dc(dc)
{
m_mirror = mirror;
}
// wxDCBase operations
virtual void Clear() wxOVERRIDE { m_dc.Clear(); }
virtual void SetFont(const wxFont& font) wxOVERRIDE { m_dc.SetFont(font); }
virtual void SetPen(const wxPen& pen) wxOVERRIDE { m_dc.SetPen(pen); }
virtual void SetBrush(const wxBrush& brush) wxOVERRIDE { m_dc.SetBrush(brush); }
virtual void SetBackground(const wxBrush& brush) wxOVERRIDE
{ m_dc.SetBackground(brush); }
virtual void SetBackgroundMode(int mode) wxOVERRIDE { m_dc.SetBackgroundMode(mode); }
#if wxUSE_PALETTE
virtual void SetPalette(const wxPalette& palette) wxOVERRIDE
{ m_dc.SetPalette(palette); }
#endif // wxUSE_PALETTE
virtual void DestroyClippingRegion() wxOVERRIDE { m_dc.DestroyClippingRegion(); }
virtual wxCoord GetCharHeight() const wxOVERRIDE { return m_dc.GetCharHeight(); }
virtual wxCoord GetCharWidth() const wxOVERRIDE { return m_dc.GetCharWidth(); }
virtual bool CanDrawBitmap() const wxOVERRIDE { return m_dc.CanDrawBitmap(); }
virtual bool CanGetTextExtent() const wxOVERRIDE { return m_dc.CanGetTextExtent(); }
virtual int GetDepth() const wxOVERRIDE { return m_dc.GetDepth(); }
virtual wxSize GetPPI() const wxOVERRIDE { return m_dc.GetPPI(); }
virtual bool IsOk() const wxOVERRIDE { return m_dc.IsOk(); }
virtual void SetMapMode(wxMappingMode mode) wxOVERRIDE { m_dc.SetMapMode(mode); }
virtual void SetUserScale(double x, double y) wxOVERRIDE
{ m_dc.SetUserScale(GetX(x, y), GetY(x, y)); }
virtual void SetLogicalOrigin(wxCoord x, wxCoord y) wxOVERRIDE
{ m_dc.SetLogicalOrigin(GetX(x, y), GetY(x, y)); }
virtual void SetDeviceOrigin(wxCoord x, wxCoord y) wxOVERRIDE
{ m_dc.SetDeviceOrigin(GetX(x, y), GetY(x, y)); }
virtual void SetAxisOrientation(bool xLeftRight, bool yBottomUp) wxOVERRIDE
{ m_dc.SetAxisOrientation(GetX(xLeftRight, yBottomUp),
GetY(xLeftRight, yBottomUp)); }
virtual void SetLogicalFunction(wxRasterOperationMode function) wxOVERRIDE
{ m_dc.SetLogicalFunction(function); }
virtual void* GetHandle() const wxOVERRIDE
{ return m_dc.GetHandle(); }
protected:
// returns x and y if not mirroring or y and x if mirroring
wxCoord GetX(wxCoord x, wxCoord y) const { return m_mirror ? y : x; }
wxCoord GetY(wxCoord x, wxCoord y) const { return m_mirror ? x : y; }
double GetX(double x, double y) const { return m_mirror ? y : x; }
double GetY(double x, double y) const { return m_mirror ? x : y; }
bool GetX(bool x, bool y) const { return m_mirror ? y : x; }
bool GetY(bool x, bool y) const { return m_mirror ? x : y; }
// same thing but for pointers
wxCoord *GetX(wxCoord *x, wxCoord *y) const { return m_mirror ? y : x; }
wxCoord *GetY(wxCoord *x, wxCoord *y) const { return m_mirror ? x : y; }
// exchange x and y components of all points in the array if necessary
wxPoint* Mirror(int n, const wxPoint*& points) const
{
wxPoint* points_alloc = NULL;
if ( m_mirror )
{
points_alloc = new wxPoint[n];
for ( int i = 0; i < n; i++ )
{
points_alloc[i].x = points[i].y;
points_alloc[i].y = points[i].x;
}
points = points_alloc;
}
return points_alloc;
}
// wxDCBase functions
virtual bool DoFloodFill(wxCoord x, wxCoord y, const wxColour& col,
wxFloodFillStyle style = wxFLOOD_SURFACE) wxOVERRIDE
{
return m_dc.DoFloodFill(GetX(x, y), GetY(x, y), col, style);
}
virtual bool DoGetPixel(wxCoord x, wxCoord y, wxColour *col) const wxOVERRIDE
{
return m_dc.DoGetPixel(GetX(x, y), GetY(x, y), col);
}
virtual void DoDrawPoint(wxCoord x, wxCoord y) wxOVERRIDE
{
m_dc.DoDrawPoint(GetX(x, y), GetY(x, y));
}
virtual void DoDrawLine(wxCoord x1, wxCoord y1, wxCoord x2, wxCoord y2) wxOVERRIDE
{
m_dc.DoDrawLine(GetX(x1, y1), GetY(x1, y1), GetX(x2, y2), GetY(x2, y2));
}
virtual void DoDrawArc(wxCoord x1, wxCoord y1,
wxCoord x2, wxCoord y2,
wxCoord xc, wxCoord yc) wxOVERRIDE
{
wxFAIL_MSG( wxT("this is probably wrong") );
m_dc.DoDrawArc(GetX(x1, y1), GetY(x1, y1),
GetX(x2, y2), GetY(x2, y2),
xc, yc);
}
virtual void DoDrawCheckMark(wxCoord x, wxCoord y,
wxCoord w, wxCoord h) wxOVERRIDE
{
m_dc.DoDrawCheckMark(GetX(x, y), GetY(x, y),
GetX(w, h), GetY(w, h));
}
virtual void DoDrawEllipticArc(wxCoord x, wxCoord y, wxCoord w, wxCoord h,
double sa, double ea) wxOVERRIDE
{
wxFAIL_MSG( wxT("this is probably wrong") );
m_dc.DoDrawEllipticArc(GetX(x, y), GetY(x, y),
GetX(w, h), GetY(w, h),
sa, ea);
}
virtual void DoDrawRectangle(wxCoord x, wxCoord y, wxCoord w, wxCoord h) wxOVERRIDE
{
m_dc.DoDrawRectangle(GetX(x, y), GetY(x, y), GetX(w, h), GetY(w, h));
}
virtual void DoDrawRoundedRectangle(wxCoord x, wxCoord y,
wxCoord w, wxCoord h,
double radius) wxOVERRIDE
{
m_dc.DoDrawRoundedRectangle(GetX(x, y), GetY(x, y),
GetX(w, h), GetY(w, h),
radius);
}
virtual void DoDrawEllipse(wxCoord x, wxCoord y, wxCoord w, wxCoord h) wxOVERRIDE
{
m_dc.DoDrawEllipse(GetX(x, y), GetY(x, y), GetX(w, h), GetY(w, h));
}
virtual void DoCrossHair(wxCoord x, wxCoord y) wxOVERRIDE
{
m_dc.DoCrossHair(GetX(x, y), GetY(x, y));
}
virtual void DoDrawIcon(const wxIcon& icon, wxCoord x, wxCoord y) wxOVERRIDE
{
m_dc.DoDrawIcon(icon, GetX(x, y), GetY(x, y));
}
virtual void DoDrawBitmap(const wxBitmap &bmp, wxCoord x, wxCoord y,
bool useMask = false) wxOVERRIDE
{
m_dc.DoDrawBitmap(bmp, GetX(x, y), GetY(x, y), useMask);
}
virtual void DoDrawText(const wxString& text, wxCoord x, wxCoord y) wxOVERRIDE
{
// this is never mirrored
m_dc.DoDrawText(text, x, y);
}
virtual void DoDrawRotatedText(const wxString& text,
wxCoord x, wxCoord y, double angle) wxOVERRIDE
{
// this is never mirrored
m_dc.DoDrawRotatedText(text, x, y, angle);
}
virtual bool DoBlit(wxCoord xdest, wxCoord ydest,
wxCoord w, wxCoord h,
wxDC *source, wxCoord xsrc, wxCoord ysrc,
wxRasterOperationMode rop = wxCOPY,
bool useMask = false,
wxCoord xsrcMask = wxDefaultCoord, wxCoord ysrcMask = wxDefaultCoord) wxOVERRIDE
{
return m_dc.DoBlit(GetX(xdest, ydest), GetY(xdest, ydest),
GetX(w, h), GetY(w, h),
source, GetX(xsrc, ysrc), GetY(xsrc, ysrc),
rop, useMask,
GetX(xsrcMask, ysrcMask), GetX(xsrcMask, ysrcMask));
}
virtual void DoGetSize(int *w, int *h) const wxOVERRIDE
{
m_dc.DoGetSize(GetX(w, h), GetY(w, h));
}
virtual void DoGetSizeMM(int *w, int *h) const wxOVERRIDE
{
m_dc.DoGetSizeMM(GetX(w, h), GetY(w, h));
}
virtual void DoDrawLines(int n, const wxPoint points[],
wxCoord xoffset, wxCoord yoffset) wxOVERRIDE
{
wxPoint* points_alloc = Mirror(n, points);
m_dc.DoDrawLines(n, points,
GetX(xoffset, yoffset), GetY(xoffset, yoffset));
delete[] points_alloc;
}
virtual void DoDrawPolygon(int n, const wxPoint points[],
wxCoord xoffset, wxCoord yoffset,
wxPolygonFillMode fillStyle = wxODDEVEN_RULE) wxOVERRIDE
{
wxPoint* points_alloc = Mirror(n, points);
m_dc.DoDrawPolygon(n, points,
GetX(xoffset, yoffset), GetY(xoffset, yoffset),
fillStyle);
delete[] points_alloc;
}
virtual void DoSetDeviceClippingRegion(const wxRegion& WXUNUSED(region)) wxOVERRIDE
{
wxFAIL_MSG( wxT("not implemented") );
}
virtual void DoSetClippingRegion(wxCoord x, wxCoord y,
wxCoord w, wxCoord h) wxOVERRIDE
{
m_dc.DoSetClippingRegion(GetX(x, y), GetY(x, y), GetX(w, h), GetY(w, h));
}
virtual void DoGetTextExtent(const wxString& string,
wxCoord *x, wxCoord *y,
wxCoord *descent = NULL,
wxCoord *externalLeading = NULL,
const wxFont *theFont = NULL) const wxOVERRIDE
{
// never mirrored
m_dc.DoGetTextExtent(string, x, y, descent, externalLeading, theFont);
}
private:
wxDCImpl& m_dc;
bool m_mirror;
wxDECLARE_NO_COPY_CLASS(wxMirrorDCImpl);
};
class WXDLLIMPEXP_CORE wxMirrorDC : public wxDC
{
public:
wxMirrorDC(wxDC& dc, bool mirror)
: wxDC(new wxMirrorDCImpl(this, *dc.GetImpl(), mirror))
{
m_mirror = mirror;
}
// helper functions which may be useful for the users of this class
wxSize Reflect(const wxSize& sizeOrig)
{
return m_mirror ? wxSize(sizeOrig.y, sizeOrig.x) : sizeOrig;
}
private:
bool m_mirror;
wxDECLARE_NO_COPY_CLASS(wxMirrorDC);
};
#endif // _WX_DCMIRROR_H_
| h |
rticonnextdds-usecases | data/projects/rticonnextdds-usecases/VehicleTracking/ExampleCode/thirdparty/wxWidgets-3.1.2/Linux/include/wx/filehistory.h | /////////////////////////////////////////////////////////////////////////////
// Name: wx/filehistory.h
// Purpose: wxFileHistory class
// Author: Julian Smart, Vaclav Slavik
// Created: 2010-05-03
// Copyright: (c) Julian Smart, Vaclav Slavik
// Licence: wxWindows licence
/////////////////////////////////////////////////////////////////////////////
#ifndef _WX_FILEHISTORY_H_
#define _WX_FILEHISTORY_H_
#include "wx/defs.h"
#if wxUSE_FILE_HISTORY
#include "wx/windowid.h"
#include "wx/object.h"
#include "wx/list.h"
#include "wx/string.h"
#include "wx/arrstr.h"
class WXDLLIMPEXP_FWD_CORE wxMenu;
class WXDLLIMPEXP_FWD_BASE wxConfigBase;
class WXDLLIMPEXP_FWD_BASE wxFileName;
// ----------------------------------------------------------------------------
// File history management
// ----------------------------------------------------------------------------
class WXDLLIMPEXP_CORE wxFileHistoryBase : public wxObject
{
public:
wxFileHistoryBase(size_t maxFiles = 9, wxWindowID idBase = wxID_FILE1);
// Operations
virtual void AddFileToHistory(const wxString& file);
virtual void RemoveFileFromHistory(size_t i);
virtual int GetMaxFiles() const { return (int)m_fileMaxFiles; }
virtual void UseMenu(wxMenu *menu);
// Remove menu from the list (MDI child may be closing)
virtual void RemoveMenu(wxMenu *menu);
#if wxUSE_CONFIG
virtual void Load(const wxConfigBase& config);
virtual void Save(wxConfigBase& config);
#endif // wxUSE_CONFIG
virtual void AddFilesToMenu();
virtual void AddFilesToMenu(wxMenu* menu); // Single menu
// Accessors
virtual wxString GetHistoryFile(size_t i) const { return m_fileHistory[i]; }
virtual size_t GetCount() const { return m_fileHistory.GetCount(); }
const wxList& GetMenus() const { return m_fileMenus; }
// Set/get base id
void SetBaseId(wxWindowID baseId) { m_idBase = baseId; }
wxWindowID GetBaseId() const { return m_idBase; }
protected:
// Last n files
wxArrayString m_fileHistory;
// Menus to maintain (may need several for an MDI app)
wxList m_fileMenus;
// Max files to maintain
size_t m_fileMaxFiles;
private:
// The ID of the first history menu item (Doesn't have to be wxID_FILE1)
wxWindowID m_idBase;
// Normalize a file name to canonical form. We have a special function for
// this to ensure the same normalization is used everywhere.
static wxString NormalizeFileName(const wxFileName& filename);
// Remove any existing entries from the associated menus.
void RemoveExistingHistory();
wxDECLARE_NO_COPY_CLASS(wxFileHistoryBase);
};
#if defined(__WXGTK20__)
#include "wx/gtk/filehistory.h"
#else
// no platform-specific implementation of wxFileHistory yet
class WXDLLIMPEXP_CORE wxFileHistory : public wxFileHistoryBase
{
public:
wxFileHistory(size_t maxFiles = 9, wxWindowID idBase = wxID_FILE1)
: wxFileHistoryBase(maxFiles, idBase) {}
wxDECLARE_DYNAMIC_CLASS(wxFileHistory);
};
#endif
#endif // wxUSE_FILE_HISTORY
#endif // _WX_FILEHISTORY_H_
| h |
rticonnextdds-usecases | data/projects/rticonnextdds-usecases/VehicleTracking/ExampleCode/thirdparty/wxWidgets-3.1.2/Linux/include/wx/hash.h | /////////////////////////////////////////////////////////////////////////////
// Name: wx/hash.h
// Purpose: wxHashTable class
// Author: Julian Smart
// Modified by: VZ at 25.02.00: type safe hashes with WX_DECLARE_HASH()
// Created: 01/02/97
// Copyright: (c) Julian Smart
// Licence: wxWindows licence
/////////////////////////////////////////////////////////////////////////////
#ifndef _WX_HASH_H__
#define _WX_HASH_H__
#include "wx/defs.h"
#include "wx/string.h"
#if !wxUSE_STD_CONTAINERS
#include "wx/object.h"
#else
class WXDLLIMPEXP_FWD_BASE wxObject;
#endif
// the default size of the hash
#define wxHASH_SIZE_DEFAULT (1000)
/*
* A hash table is an array of user-definable size with lists
* of data items hanging off the array positions. Usually there'll
* be a hit, so no search is required; otherwise we'll have to run down
* the list to find the desired item.
*/
union wxHashKeyValue
{
long integer;
wxString *string;
};
// for some compilers (AIX xlC), defining it as friend inside the class is not
// enough, so provide a real forward declaration
class WXDLLIMPEXP_FWD_BASE wxHashTableBase;
// and clang doesn't like using WXDLLIMPEXP_FWD_BASE inside a typedef.
class WXDLLIMPEXP_FWD_BASE wxHashTableBase_Node;
class WXDLLIMPEXP_BASE wxHashTableBase_Node
{
friend class wxHashTableBase;
typedef class wxHashTableBase_Node _Node;
public:
wxHashTableBase_Node( long key, void* value,
wxHashTableBase* table );
wxHashTableBase_Node( const wxString& key, void* value,
wxHashTableBase* table );
~wxHashTableBase_Node();
long GetKeyInteger() const { return m_key.integer; }
const wxString& GetKeyString() const { return *m_key.string; }
void* GetData() const { return m_value; }
void SetData( void* data ) { m_value = data; }
protected:
_Node* GetNext() const { return m_next; }
protected:
// next node in the chain
wxHashTableBase_Node* m_next;
// key
wxHashKeyValue m_key;
// value
void* m_value;
// pointer to the hash containing the node, used to remove the
// node from the hash when the user deletes the node iterating
// through it
// TODO: move it to wxHashTable_Node (only wxHashTable supports
// iteration)
wxHashTableBase* m_hashPtr;
};
class WXDLLIMPEXP_BASE wxHashTableBase
#if !wxUSE_STD_CONTAINERS
: public wxObject
#endif
{
friend class WXDLLIMPEXP_FWD_BASE wxHashTableBase_Node;
public:
typedef wxHashTableBase_Node Node;
wxHashTableBase();
virtual ~wxHashTableBase() { }
void Create( wxKeyType keyType = wxKEY_INTEGER,
size_t size = wxHASH_SIZE_DEFAULT );
void Clear();
void Destroy();
size_t GetSize() const { return m_size; }
size_t GetCount() const { return m_count; }
void DeleteContents( bool flag ) { m_deleteContents = flag; }
static long MakeKey(const wxString& string);
protected:
void DoPut( long key, long hash, void* data );
void DoPut( const wxString& key, long hash, void* data );
void* DoGet( long key, long hash ) const;
void* DoGet( const wxString& key, long hash ) const;
void* DoDelete( long key, long hash );
void* DoDelete( const wxString& key, long hash );
private:
// Remove the node from the hash, *only called from
// ~wxHashTable*_Node destructor
void DoRemoveNode( wxHashTableBase_Node* node );
// destroys data contained in the node if appropriate:
// deletes the key if it is a string and destrys
// the value if m_deleteContents is true
void DoDestroyNode( wxHashTableBase_Node* node );
// inserts a node in the table (at the end of the chain)
void DoInsertNode( size_t bucket, wxHashTableBase_Node* node );
// removes a node from the table (fiven a pointer to the previous
// but does not delete it (only deletes its contents)
void DoUnlinkNode( size_t bucket, wxHashTableBase_Node* node,
wxHashTableBase_Node* prev );
// unconditionally deletes node value (invoking the
// correct destructor)
virtual void DoDeleteContents( wxHashTableBase_Node* node ) = 0;
protected:
// number of buckets
size_t m_size;
// number of nodes (key/value pairs)
size_t m_count;
// table
Node** m_table;
// key typ (INTEGER/STRING)
wxKeyType m_keyType;
// delete contents when hash is cleared
bool m_deleteContents;
private:
wxDECLARE_NO_COPY_CLASS(wxHashTableBase);
};
// ----------------------------------------------------------------------------
// for compatibility only
// ----------------------------------------------------------------------------
class WXDLLIMPEXP_BASE wxHashTable_Node : public wxHashTableBase_Node
{
friend class WXDLLIMPEXP_FWD_BASE wxHashTable;
public:
wxHashTable_Node( long key, void* value,
wxHashTableBase* table )
: wxHashTableBase_Node( key, value, table ) { }
wxHashTable_Node( const wxString& key, void* value,
wxHashTableBase* table )
: wxHashTableBase_Node( key, value, table ) { }
wxObject* GetData() const
{ return (wxObject*)wxHashTableBase_Node::GetData(); }
void SetData( wxObject* data )
{ wxHashTableBase_Node::SetData( data ); }
wxHashTable_Node* GetNext() const
{ return (wxHashTable_Node*)wxHashTableBase_Node::GetNext(); }
};
// should inherit protectedly, but it is public for compatibility in
// order to publicly inherit from wxObject
class WXDLLIMPEXP_BASE wxHashTable : public wxHashTableBase
{
typedef wxHashTableBase hash;
public:
typedef wxHashTable_Node Node;
typedef wxHashTable_Node* compatibility_iterator;
public:
wxHashTable( wxKeyType keyType = wxKEY_INTEGER,
size_t size = wxHASH_SIZE_DEFAULT )
: wxHashTableBase() { Create( keyType, size ); BeginFind(); }
wxHashTable( const wxHashTable& table );
virtual ~wxHashTable() { Destroy(); }
const wxHashTable& operator=( const wxHashTable& );
// key and value are the same
void Put(long value, wxObject *object)
{ DoPut( value, value, object ); }
void Put(long lhash, long value, wxObject *object)
{ DoPut( value, lhash, object ); }
void Put(const wxString& value, wxObject *object)
{ DoPut( value, MakeKey( value ), object ); }
void Put(long lhash, const wxString& value, wxObject *object)
{ DoPut( value, lhash, object ); }
// key and value are the same
wxObject *Get(long value) const
{ return (wxObject*)DoGet( value, value ); }
wxObject *Get(long lhash, long value) const
{ return (wxObject*)DoGet( value, lhash ); }
wxObject *Get(const wxString& value) const
{ return (wxObject*)DoGet( value, MakeKey( value ) ); }
wxObject *Get(long lhash, const wxString& value) const
{ return (wxObject*)DoGet( value, lhash ); }
// Deletes entry and returns data if found
wxObject *Delete(long key)
{ return (wxObject*)DoDelete( key, key ); }
wxObject *Delete(long lhash, long key)
{ return (wxObject*)DoDelete( key, lhash ); }
wxObject *Delete(const wxString& key)
{ return (wxObject*)DoDelete( key, MakeKey( key ) ); }
wxObject *Delete(long lhash, const wxString& key)
{ return (wxObject*)DoDelete( key, lhash ); }
// Way of iterating through whole hash table (e.g. to delete everything)
// Not necessary, of course, if you're only storing pointers to
// objects maintained separately
void BeginFind() { m_curr = NULL; m_currBucket = 0; }
Node* Next();
void Clear() { wxHashTableBase::Clear(); }
size_t GetCount() const { return wxHashTableBase::GetCount(); }
protected:
// copy helper
void DoCopy( const wxHashTable& copy );
// searches the next node starting from bucket bucketStart and sets
// m_curr to it and m_currBucket to its bucket
void GetNextNode( size_t bucketStart );
private:
virtual void DoDeleteContents( wxHashTableBase_Node* node ) wxOVERRIDE;
// current node
Node* m_curr;
// bucket the current node belongs to
size_t m_currBucket;
};
// defines a new type safe hash table which stores the elements of type eltype
// in lists of class listclass
#define _WX_DECLARE_HASH(eltype, dummy, hashclass, classexp) \
classexp hashclass : public wxHashTableBase \
{ \
public: \
hashclass(wxKeyType keyType = wxKEY_INTEGER, \
size_t size = wxHASH_SIZE_DEFAULT) \
: wxHashTableBase() { Create(keyType, size); } \
\
virtual ~hashclass() { Destroy(); } \
\
void Put(long key, eltype *data) { DoPut(key, key, (void*)data); } \
void Put(long lhash, long key, eltype *data) \
{ DoPut(key, lhash, (void*)data); } \
eltype *Get(long key) const { return (eltype*)DoGet(key, key); } \
eltype *Get(long lhash, long key) const \
{ return (eltype*)DoGet(key, lhash); } \
eltype *Delete(long key) { return (eltype*)DoDelete(key, key); } \
eltype *Delete(long lhash, long key) \
{ return (eltype*)DoDelete(key, lhash); } \
private: \
virtual void DoDeleteContents( wxHashTableBase_Node* node ) wxOVERRIDE\
{ delete (eltype*)node->GetData(); } \
\
wxDECLARE_NO_COPY_CLASS(hashclass); \
}
// this macro is to be used in the user code
#define WX_DECLARE_HASH(el, list, hash) \
_WX_DECLARE_HASH(el, list, hash, class)
// and this one does exactly the same thing but should be used inside the
// library
#define WX_DECLARE_EXPORTED_HASH(el, list, hash) \
_WX_DECLARE_HASH(el, list, hash, class WXDLLIMPEXP_CORE)
#define WX_DECLARE_USER_EXPORTED_HASH(el, list, hash, usergoo) \
_WX_DECLARE_HASH(el, list, hash, class usergoo)
// delete all hash elements
//
// NB: the class declaration of the hash elements must be visible from the
// place where you use this macro, otherwise the proper destructor may not
// be called (a decent compiler should give a warning about it, but don't
// count on it)!
#define WX_CLEAR_HASH_TABLE(hash) \
{ \
(hash).BeginFind(); \
wxHashTable::compatibility_iterator it = (hash).Next(); \
while( it ) \
{ \
delete it->GetData(); \
it = (hash).Next(); \
} \
(hash).Clear(); \
}
#endif // _WX_HASH_H__
| h |
rticonnextdds-usecases | data/projects/rticonnextdds-usecases/VehicleTracking/ExampleCode/thirdparty/wxWidgets-3.1.2/Linux/include/wx/xti.h | /////////////////////////////////////////////////////////////////////////////
// Name: wx/xti.h
// Purpose: runtime metadata information (extended class info)
// Author: Stefan Csomor
// Modified by: Francesco Montorsi
// Created: 27/07/03
// Copyright: (c) 1997 Julian Smart
// (c) 2003 Stefan Csomor
// Licence: wxWindows licence
/////////////////////////////////////////////////////////////////////////////
#ifndef _WX_XTIH__
#define _WX_XTIH__
// We want to support properties, event sources and events sinks through
// explicit declarations, using templates and specialization to make the
// effort as painless as possible.
//
// This means we have the following domains :
//
// - Type Information for categorizing built in types as well as custom types
// this includes information about enums, their values and names
// - Type safe value storage : a kind of wxVariant, called right now wxAny
// which will be merged with wxVariant
// - Property Information and Property Accessors providing access to a class'
// values and exposed event delegates
// - Information about event handlers
// - extended Class Information for accessing all these
// ----------------------------------------------------------------------------
// headers
// ----------------------------------------------------------------------------
#include "wx/defs.h"
#if wxUSE_EXTENDED_RTTI
class WXDLLIMPEXP_FWD_BASE wxAny;
class WXDLLIMPEXP_FWD_BASE wxAnyList;
class WXDLLIMPEXP_FWD_BASE wxObject;
class WXDLLIMPEXP_FWD_BASE wxString;
class WXDLLIMPEXP_FWD_BASE wxClassInfo;
class WXDLLIMPEXP_FWD_BASE wxHashTable;
class WXDLLIMPEXP_FWD_BASE wxObject;
class WXDLLIMPEXP_FWD_BASE wxPluginLibrary;
class WXDLLIMPEXP_FWD_BASE wxHashTable;
class WXDLLIMPEXP_FWD_BASE wxHashTable_Node;
class WXDLLIMPEXP_FWD_BASE wxStringToAnyHashMap;
class WXDLLIMPEXP_FWD_BASE wxPropertyInfoMap;
class WXDLLIMPEXP_FWD_BASE wxPropertyAccessor;
class WXDLLIMPEXP_FWD_BASE wxObjectAllocatorAndCreator;
class WXDLLIMPEXP_FWD_BASE wxObjectAllocator;
#define wx_dynamic_cast(t, x) dynamic_cast<t>(x)
#include "wx/xtitypes.h"
#include "wx/xtihandler.h"
// ----------------------------------------------------------------------------
// wxClassInfo
// ----------------------------------------------------------------------------
class WXDLLIMPEXP_BASE wxObjectFunctor
{
public:
virtual ~wxObjectFunctor();
// Invoke the actual event handler:
virtual void operator()(const wxObject *) = 0;
};
class WXDLLIMPEXP_FWD_BASE wxPropertyInfo;
class WXDLLIMPEXP_FWD_BASE wxHandlerInfo;
typedef wxObject *(*wxObjectConstructorFn)(void);
typedef wxPropertyInfo *(*wxPropertyInfoFn)(void);
typedef wxHandlerInfo *(*wxHandlerInfoFn)(void);
typedef void (*wxVariantToObjectConverter)( const wxAny &data, wxObjectFunctor* fn );
typedef wxObject* (*wxVariantToObjectPtrConverter) ( const wxAny& data);
typedef wxAny (*wxObjectToVariantConverter)( wxObject* );
WXDLLIMPEXP_BASE wxString wxAnyGetAsString( const wxAny& data);
WXDLLIMPEXP_BASE const wxObject* wxAnyGetAsObjectPtr( const wxAny& data);
class WXDLLIMPEXP_BASE wxObjectWriter;
class WXDLLIMPEXP_BASE wxObjectWriterCallback;
typedef bool (*wxObjectStreamingCallback) ( const wxObject *, wxObjectWriter *, \
wxObjectWriterCallback *, const wxStringToAnyHashMap & );
class WXDLLIMPEXP_BASE wxClassInfo
{
friend class WXDLLIMPEXP_BASE wxPropertyInfo;
friend class /* WXDLLIMPEXP_BASE */ wxHandlerInfo;
friend wxObject *wxCreateDynamicObject(const wxString& name);
public:
wxClassInfo(const wxClassInfo **_Parents,
const wxChar *_UnitName,
const wxChar *_ClassName,
int size,
wxObjectConstructorFn ctor,
wxPropertyInfoFn _Props,
wxHandlerInfoFn _Handlers,
wxObjectAllocatorAndCreator* _Constructor,
const wxChar ** _ConstructorProperties,
const int _ConstructorPropertiesCount,
wxVariantToObjectPtrConverter _PtrConverter1,
wxVariantToObjectConverter _Converter2,
wxObjectToVariantConverter _Converter3,
wxObjectStreamingCallback _streamingCallback = NULL) :
m_className(_ClassName),
m_objectSize(size),
m_objectConstructor(ctor),
m_next(sm_first),
m_firstPropertyFn(_Props),
m_firstHandlerFn(_Handlers),
m_firstProperty(NULL),
m_firstHandler(NULL),
m_firstInited(false),
m_parents(_Parents),
m_unitName(_UnitName),
m_constructor(_Constructor),
m_constructorProperties(_ConstructorProperties),
m_constructorPropertiesCount(_ConstructorPropertiesCount),
m_variantOfPtrToObjectConverter(_PtrConverter1),
m_variantToObjectConverter(_Converter2),
m_objectToVariantConverter(_Converter3),
m_streamingCallback(_streamingCallback)
{
sm_first = this;
Register();
}
wxClassInfo(const wxChar *_UnitName, const wxChar *_ClassName,
const wxClassInfo **_Parents) :
m_className(_ClassName),
m_objectSize(0),
m_objectConstructor(NULL),
m_next(sm_first),
m_firstPropertyFn(NULL),
m_firstHandlerFn(NULL),
m_firstProperty(NULL),
m_firstHandler(NULL),
m_firstInited(true),
m_parents(_Parents),
m_unitName(_UnitName),
m_constructor(NULL),
m_constructorProperties(NULL),
m_constructorPropertiesCount(0),
m_variantOfPtrToObjectConverter(NULL),
m_variantToObjectConverter(NULL),
m_objectToVariantConverter(NULL),
m_streamingCallback(NULL)
{
sm_first = this;
Register();
}
// ctor compatible with old RTTI system
wxClassInfo(const wxChar *_ClassName,
const wxClassInfo *_Parent1,
const wxClassInfo *_Parent2,
int size,
wxObjectConstructorFn ctor) :
m_className(_ClassName),
m_objectSize(size),
m_objectConstructor(ctor),
m_next(sm_first),
m_firstPropertyFn(NULL),
m_firstHandlerFn(NULL),
m_firstProperty(NULL),
m_firstHandler(NULL),
m_firstInited(true),
m_parents(NULL),
m_unitName(NULL),
m_constructor(NULL),
m_constructorProperties(NULL),
m_constructorPropertiesCount(0),
m_variantOfPtrToObjectConverter(NULL),
m_variantToObjectConverter(NULL),
m_objectToVariantConverter(NULL),
m_streamingCallback(NULL)
{
sm_first = this;
m_parents[0] = _Parent1;
m_parents[1] = _Parent2;
m_parents[2] = NULL;
Register();
}
virtual ~wxClassInfo();
// allocates an instance of this class, this object does not have to be
// initialized or fully constructed as this call will be followed by a call to Create
virtual wxObject *AllocateObject() const
{ return m_objectConstructor ? (*m_objectConstructor)() : 0; }
// 'old naming' for AllocateObject staying here for backward compatibility
wxObject *CreateObject() const { return AllocateObject(); }
// direct construction call for classes that cannot construct instances via alloc/create
wxObject *ConstructObject(int ParamCount, wxAny *Params) const;
bool NeedsDirectConstruction() const;
const wxChar *GetClassName() const
{ return m_className; }
const wxChar *GetBaseClassName1() const
{ return m_parents[0] ? m_parents[0]->GetClassName() : NULL; }
const wxChar *GetBaseClassName2() const
{ return (m_parents[0] && m_parents[1]) ? m_parents[1]->GetClassName() : NULL; }
const wxClassInfo *GetBaseClass1() const
{ return m_parents[0]; }
const wxClassInfo *GetBaseClass2() const
{ return m_parents[0] ? m_parents[1] : NULL; }
const wxChar *GetIncludeName() const
{ return m_unitName; }
const wxClassInfo **GetParents() const
{ return m_parents; }
int GetSize() const
{ return m_objectSize; }
bool IsDynamic() const
{ return (NULL != m_objectConstructor); }
wxObjectConstructorFn GetConstructor() const
{ return m_objectConstructor; }
const wxClassInfo *GetNext() const
{ return m_next; }
// statics:
static void CleanUp();
static wxClassInfo *FindClass(const wxString& className);
static const wxClassInfo *GetFirst()
{ return sm_first; }
// Climb upwards through inheritance hierarchy.
// Dual inheritance is catered for.
bool IsKindOf(const wxClassInfo *info) const;
wxDECLARE_CLASS_INFO_ITERATORS();
// if there is a callback registered with that class it will be called
// before this object will be written to disk, it can veto streaming out
// this object by returning false, if this class has not registered a
// callback, the search will go up the inheritance tree if no callback has
// been registered true will be returned by default
bool BeforeWriteObject( const wxObject *obj, wxObjectWriter *streamer,
wxObjectWriterCallback *writercallback, const wxStringToAnyHashMap &metadata) const;
// gets the streaming callback from this class or any superclass
wxObjectStreamingCallback GetStreamingCallback() const;
// returns the first property
wxPropertyInfo* GetFirstProperty() const
{ EnsureInfosInited(); return m_firstProperty; }
// returns the first handler
wxHandlerInfo* GetFirstHandler() const
{ EnsureInfosInited(); return m_firstHandler; }
// Call the Create upon an instance of the class, in the end the object is fully
// initialized
virtual bool Create (wxObject *object, int ParamCount, wxAny *Params) const;
// get number of parameters for constructor
virtual int GetCreateParamCount() const
{ return m_constructorPropertiesCount; }
// get n-th constructor parameter
virtual const wxChar* GetCreateParamName(int n) const
{ return m_constructorProperties[n]; }
// Runtime access to objects for simple properties (get/set) by property
// name and variant data
virtual void SetProperty (wxObject *object, const wxChar *propertyName,
const wxAny &value) const;
virtual wxAny GetProperty (wxObject *object, const wxChar *propertyName) const;
// Runtime access to objects for collection properties by property name
virtual wxAnyList GetPropertyCollection(wxObject *object,
const wxChar *propertyName) const;
virtual void AddToPropertyCollection(wxObject *object, const wxChar *propertyName,
const wxAny& value) const;
// we must be able to cast variants to wxObject pointers, templates seem
// not to be suitable
void CallOnAny( const wxAny &data, wxObjectFunctor* functor ) const;
wxObject* AnyToObjectPtr( const wxAny &data) const;
wxAny ObjectPtrToAny( wxObject *object ) const;
// find property by name
virtual const wxPropertyInfo *FindPropertyInfo (const wxChar *PropertyName) const;
// find handler by name
virtual const wxHandlerInfo *FindHandlerInfo (const wxChar *handlerName) const;
// find property by name
virtual wxPropertyInfo *FindPropertyInfoInThisClass (const wxChar *PropertyName) const;
// find handler by name
virtual wxHandlerInfo *FindHandlerInfoInThisClass (const wxChar *handlerName) const;
// puts all the properties of this class and its superclasses in the map,
// as long as there is not yet an entry with the same name (overriding mechanism)
void GetProperties( wxPropertyInfoMap &map ) const;
private:
const wxChar *m_className;
int m_objectSize;
wxObjectConstructorFn m_objectConstructor;
// class info object live in a linked list:
// pointers to its head and the next element in it
static wxClassInfo *sm_first;
wxClassInfo *m_next;
static wxHashTable *sm_classTable;
wxPropertyInfoFn m_firstPropertyFn;
wxHandlerInfoFn m_firstHandlerFn;
protected:
void EnsureInfosInited() const
{
if ( !m_firstInited)
{
if ( m_firstPropertyFn != NULL)
m_firstProperty = (*m_firstPropertyFn)();
if ( m_firstHandlerFn != NULL)
m_firstHandler = (*m_firstHandlerFn)();
m_firstInited = true;
}
}
mutable wxPropertyInfo* m_firstProperty;
mutable wxHandlerInfo* m_firstHandler;
private:
mutable bool m_firstInited;
const wxClassInfo** m_parents;
const wxChar* m_unitName;
wxObjectAllocatorAndCreator* m_constructor;
const wxChar ** m_constructorProperties;
const int m_constructorPropertiesCount;
wxVariantToObjectPtrConverter m_variantOfPtrToObjectConverter;
wxVariantToObjectConverter m_variantToObjectConverter;
wxObjectToVariantConverter m_objectToVariantConverter;
wxObjectStreamingCallback m_streamingCallback;
const wxPropertyAccessor *FindAccessor (const wxChar *propertyName) const;
protected:
// registers the class
void Register();
void Unregister();
wxDECLARE_NO_COPY_CLASS(wxClassInfo);
};
WXDLLIMPEXP_BASE wxObject *wxCreateDynamicObject(const wxString& name);
// ----------------------------------------------------------------------------
// wxDynamicClassInfo
// ----------------------------------------------------------------------------
// this object leads to having a pure runtime-instantiation
class WXDLLIMPEXP_BASE wxDynamicClassInfo : public wxClassInfo
{
friend class WXDLLIMPEXP_BASE wxDynamicObject;
public:
wxDynamicClassInfo( const wxChar *_UnitName, const wxChar *_ClassName,
const wxClassInfo* superClass );
virtual ~wxDynamicClassInfo();
// constructs a wxDynamicObject with an instance
virtual wxObject *AllocateObject() const;
// Call the Create method for a class
virtual bool Create (wxObject *object, int ParamCount, wxAny *Params) const;
// get number of parameters for constructor
virtual int GetCreateParamCount() const;
// get i-th constructor parameter
virtual const wxChar* GetCreateParamName(int i) const;
// Runtime access to objects by property name, and variant data
virtual void SetProperty (wxObject *object, const wxChar *PropertyName,
const wxAny &Value) const;
virtual wxAny GetProperty (wxObject *object, const wxChar *PropertyName) const;
// adds a property to this class at runtime
void AddProperty( const wxChar *propertyName, const wxTypeInfo* typeInfo );
// removes an existing runtime-property
void RemoveProperty( const wxChar *propertyName );
// renames an existing runtime-property
void RenameProperty( const wxChar *oldPropertyName, const wxChar *newPropertyName );
// as a handler to this class at runtime
void AddHandler( const wxChar *handlerName, wxObjectEventFunction address,
const wxClassInfo* eventClassInfo );
// removes an existing runtime-handler
void RemoveHandler( const wxChar *handlerName );
// renames an existing runtime-handler
void RenameHandler( const wxChar *oldHandlerName, const wxChar *newHandlerName );
private:
struct wxDynamicClassInfoInternal;
wxDynamicClassInfoInternal* m_data;
};
// ----------------------------------------------------------------------------
// wxDECLARE class macros
// ----------------------------------------------------------------------------
#define _DECLARE_DYNAMIC_CLASS(name) \
public: \
static wxClassInfo ms_classInfo; \
static const wxClassInfo* ms_classParents[]; \
static wxPropertyInfo* GetPropertiesStatic(); \
static wxHandlerInfo* GetHandlersStatic(); \
static wxClassInfo *GetClassInfoStatic() \
{ return &name::ms_classInfo; } \
virtual wxClassInfo *GetClassInfo() const \
{ return &name::ms_classInfo; }
#define wxDECLARE_DYNAMIC_CLASS(name) \
static wxObjectAllocatorAndCreator* ms_constructor; \
static const wxChar * ms_constructorProperties[]; \
static const int ms_constructorPropertiesCount; \
_DECLARE_DYNAMIC_CLASS(name)
#define wxDECLARE_DYNAMIC_CLASS_NO_ASSIGN(name) \
wxDECLARE_NO_ASSIGN_CLASS(name); \
wxDECLARE_DYNAMIC_CLASS(name)
#define wxDECLARE_DYNAMIC_CLASS_NO_COPY(name) \
wxDECLARE_NO_COPY_CLASS(name); \
wxDECLARE_DYNAMIC_CLASS(name)
#define wxDECLARE_CLASS(name) \
wxDECLARE_DYNAMIC_CLASS(name)
#define wxDECLARE_ABSTRACT_CLASS(name) _DECLARE_DYNAMIC_CLASS(name)
#define wxCLASSINFO(name) (&name::ms_classInfo)
#endif // wxUSE_EXTENDED_RTTI
#endif // _WX_XTIH__
| h |
rticonnextdds-usecases | data/projects/rticonnextdds-usecases/VehicleTracking/ExampleCode/thirdparty/wxWidgets-3.1.2/Linux/include/wx/effects.h | /////////////////////////////////////////////////////////////////////////////
// Name: wx/effects.h
// Purpose: wxEffects class
// Draws 3D effects.
// Author: Julian Smart et al
// Modified by:
// Created: 25/4/2000
// Copyright: (c) Julian Smart
// Licence: wxWindows licence
/////////////////////////////////////////////////////////////////////////////
#ifndef _WX_EFFECTS_H_
#define _WX_EFFECTS_H_
// this class is deprecated and will be removed in the next wx version
//
// please use wxRenderer::DrawBorder() instead of DrawSunkenEdge(); there is no
// replacement for TileBitmap() but it doesn't seem to be very useful anyhow
#if WXWIN_COMPATIBILITY_2_8
/*
* wxEffects: various 3D effects
*/
#include "wx/object.h"
#include "wx/colour.h"
#include "wx/gdicmn.h"
#include "wx/dc.h"
class WXDLLIMPEXP_CORE wxEffectsImpl: public wxObject
{
public:
// Assume system colours
wxEffectsImpl() ;
// Going from lightest to darkest
wxEffectsImpl(const wxColour& highlightColour, const wxColour& lightShadow,
const wxColour& faceColour, const wxColour& mediumShadow,
const wxColour& darkShadow) ;
// Accessors
wxColour GetHighlightColour() const { return m_highlightColour; }
wxColour GetLightShadow() const { return m_lightShadow; }
wxColour GetFaceColour() const { return m_faceColour; }
wxColour GetMediumShadow() const { return m_mediumShadow; }
wxColour GetDarkShadow() const { return m_darkShadow; }
void SetHighlightColour(const wxColour& c) { m_highlightColour = c; }
void SetLightShadow(const wxColour& c) { m_lightShadow = c; }
void SetFaceColour(const wxColour& c) { m_faceColour = c; }
void SetMediumShadow(const wxColour& c) { m_mediumShadow = c; }
void SetDarkShadow(const wxColour& c) { m_darkShadow = c; }
void Set(const wxColour& highlightColour, const wxColour& lightShadow,
const wxColour& faceColour, const wxColour& mediumShadow,
const wxColour& darkShadow)
{
SetHighlightColour(highlightColour);
SetLightShadow(lightShadow);
SetFaceColour(faceColour);
SetMediumShadow(mediumShadow);
SetDarkShadow(darkShadow);
}
// Draw a sunken edge
void DrawSunkenEdge(wxDC& dc, const wxRect& rect, int borderSize = 1);
// Tile a bitmap
bool TileBitmap(const wxRect& rect, wxDC& dc, const wxBitmap& bitmap);
protected:
wxColour m_highlightColour; // Usually white
wxColour m_lightShadow; // Usually light grey
wxColour m_faceColour; // Usually grey
wxColour m_mediumShadow; // Usually dark grey
wxColour m_darkShadow; // Usually black
wxDECLARE_CLASS(wxEffectsImpl);
};
// current versions of g++ don't generate deprecation warnings for classes
// declared deprecated, so define wxEffects as a typedef instead: this does
// generate warnings with both g++ and VC (which also has no troubles with
// directly deprecating the classes...)
//
// note that this g++ bug (16370) is supposed to be fixed in g++ 4.3.0
typedef wxEffectsImpl wxDEPRECATED(wxEffects);
#endif // WXWIN_COMPATIBILITY_2_8
#endif // _WX_EFFECTS_H_
| h |
rticonnextdds-usecases | data/projects/rticonnextdds-usecases/VehicleTracking/ExampleCode/thirdparty/wxWidgets-3.1.2/Linux/include/wx/recguard.h | ///////////////////////////////////////////////////////////////////////////////
// Name: wx/recguard.h
// Purpose: declaration and implementation of wxRecursionGuard class
// Author: Vadim Zeitlin
// Modified by:
// Created: 14.08.2003
// Copyright: (c) 2003 Vadim Zeitlin <[email protected]>
// Licence: wxWindows licence
///////////////////////////////////////////////////////////////////////////////
#ifndef _WX_RECGUARD_H_
#define _WX_RECGUARD_H_
#include "wx/defs.h"
// ----------------------------------------------------------------------------
// wxRecursionGuardFlag is used with wxRecursionGuard
// ----------------------------------------------------------------------------
typedef int wxRecursionGuardFlag;
// ----------------------------------------------------------------------------
// wxRecursionGuard is the simplest way to protect a function from reentrancy
// ----------------------------------------------------------------------------
class WXDLLIMPEXP_BASE wxRecursionGuard
{
public:
wxRecursionGuard(wxRecursionGuardFlag& flag)
: m_flag(flag)
{
m_isInside = flag++ != 0;
}
~wxRecursionGuard()
{
wxASSERT_MSG( m_flag > 0, wxT("unbalanced wxRecursionGuards!?") );
m_flag--;
}
bool IsInside() const { return m_isInside; }
private:
wxRecursionGuardFlag& m_flag;
// true if the flag had been already set when we were created
bool m_isInside;
};
#endif // _WX_RECGUARD_H_
| h |
rticonnextdds-usecases | data/projects/rticonnextdds-usecases/VehicleTracking/ExampleCode/thirdparty/wxWidgets-3.1.2/Linux/include/wx/itemid.h | ///////////////////////////////////////////////////////////////////////////////
// Name: wx/itemid.h
// Purpose: wxItemId class declaration.
// Author: Vadim Zeitlin
// Created: 2011-08-17
// Copyright: (c) 2011 Vadim Zeitlin <[email protected]>
// Licence: wxWindows licence
///////////////////////////////////////////////////////////////////////////////
#ifndef _WX_ITEMID_H_
#define _WX_ITEMID_H_
// ----------------------------------------------------------------------------
// wxItemId: an opaque item identifier used with wx{Tree,TreeList,DataView}Ctrl.
// ----------------------------------------------------------------------------
// The template argument T is typically a pointer to some opaque type. While
// wxTreeItemId and wxDataViewItem use a pointer to void, this is dangerous and
// not recommended for the new item id classes.
template <typename T>
class wxItemId
{
public:
typedef T Type;
// This ctor is implicit which is fine for non-void* types, but if you use
// this class with void* you're strongly advised to make the derived class
// ctor explicit as implicitly converting from any pointer is simply too
// dangerous.
wxItemId(Type item = NULL) : m_pItem(item) { }
// Default copy ctor, assignment operator and dtor are ok.
bool IsOk() const { return m_pItem != NULL; }
Type GetID() const { return m_pItem; }
operator const Type() const { return m_pItem; }
// This is used for implementation purposes only.
Type operator->() const { return m_pItem; }
void Unset() { m_pItem = NULL; }
// This field is public *only* for compatibility with the old wxTreeItemId
// implementation and must not be used in any new code.
//private:
Type m_pItem;
};
template <typename T>
bool operator==(const wxItemId<T>& left, const wxItemId<T>& right)
{
return left.GetID() == right.GetID();
}
template <typename T>
bool operator!=(const wxItemId<T>& left, const wxItemId<T>& right)
{
return !(left == right);
}
#endif // _WX_ITEMID_H_
| h |
rticonnextdds-usecases | data/projects/rticonnextdds-usecases/VehicleTracking/ExampleCode/thirdparty/wxWidgets-3.1.2/Linux/include/wx/grid.h | /////////////////////////////////////////////////////////////////////////////
// Name: wx/grid.h
// Purpose: wxGrid base header
// Author: Julian Smart
// Modified by:
// Created:
// Copyright: (c) Julian Smart
// Licence: wxWindows licence
/////////////////////////////////////////////////////////////////////////////
#ifndef _WX_GRID_H_BASE_
#define _WX_GRID_H_BASE_
#include "wx/generic/grid.h"
// these headers used to be included from the above header but isn't any more,
// still do it from here for compatibility
#include "wx/generic/grideditors.h"
#include "wx/generic/gridctrl.h"
#endif // _WX_GRID_H_BASE_
| h |
rticonnextdds-usecases | data/projects/rticonnextdds-usecases/VehicleTracking/ExampleCode/thirdparty/wxWidgets-3.1.2/Linux/include/wx/colourdata.h | /////////////////////////////////////////////////////////////////////////////
// Name: wx/colourdata.h
// Author: Julian Smart
// Copyright: (c) Julian Smart
// Licence: wxWindows licence
/////////////////////////////////////////////////////////////////////////////
#ifndef _WX_COLOURDATA_H_
#define _WX_COLOURDATA_H_
#include "wx/colour.h"
class WXDLLIMPEXP_CORE wxColourData : public wxObject
{
public:
// number of custom colours we store
enum
{
NUM_CUSTOM = 16
};
wxColourData();
wxColourData(const wxColourData& data);
wxColourData& operator=(const wxColourData& data);
virtual ~wxColourData();
void SetChooseFull(bool flag) { m_chooseFull = flag; }
bool GetChooseFull() const { return m_chooseFull; }
void SetChooseAlpha(bool flag) { m_chooseAlpha = flag; }
bool GetChooseAlpha() const { return m_chooseAlpha; }
void SetColour(const wxColour& colour) { m_dataColour = colour; }
const wxColour& GetColour() const { return m_dataColour; }
wxColour& GetColour() { return m_dataColour; }
// SetCustomColour() modifies colours in an internal array of NUM_CUSTOM
// custom colours;
void SetCustomColour(int i, const wxColour& colour);
wxColour GetCustomColour(int i) const;
// Serialize the object to a string and restore it from it
wxString ToString() const;
bool FromString(const wxString& str);
// public for backwards compatibility only: don't use directly
wxColour m_dataColour;
wxColour m_custColours[NUM_CUSTOM];
bool m_chooseFull;
protected:
bool m_chooseAlpha;
wxDECLARE_DYNAMIC_CLASS(wxColourData);
};
#endif // _WX_COLOURDATA_H_
| h |
rticonnextdds-usecases | data/projects/rticonnextdds-usecases/VehicleTracking/ExampleCode/thirdparty/wxWidgets-3.1.2/Linux/include/wx/stackwalk.h | ///////////////////////////////////////////////////////////////////////////////
// Name: wx/stackwalk.h
// Purpose: wxStackWalker and related classes, common part
// Author: Vadim Zeitlin
// Modified by:
// Created: 2005-01-07
// Copyright: (c) 2004 Vadim Zeitlin <[email protected]>
// Licence: wxWindows licence
///////////////////////////////////////////////////////////////////////////////
#ifndef _WX_STACKWALK_H_
#define _WX_STACKWALK_H_
#include "wx/defs.h"
#if wxUSE_STACKWALKER
#include "wx/string.h"
class WXDLLIMPEXP_FWD_BASE wxStackFrame;
#define wxSTACKWALKER_MAX_DEPTH (200)
// ----------------------------------------------------------------------------
// wxStackFrame: a single stack level
// ----------------------------------------------------------------------------
class WXDLLIMPEXP_BASE wxStackFrameBase
{
private:
// put this inline function here so that it is defined before use
wxStackFrameBase *ConstCast() const
{ return const_cast<wxStackFrameBase *>(this); }
public:
wxStackFrameBase(size_t level, void *address = NULL)
{
m_level = level;
m_line =
m_offset = 0;
m_address = address;
}
// get the level of this frame (deepest/innermost one is 0)
size_t GetLevel() const { return m_level; }
// return the address of this frame
void *GetAddress() const { return m_address; }
// return the unmangled (if possible) name of the function containing this
// frame
wxString GetName() const { ConstCast()->OnGetName(); return m_name; }
// return the instruction pointer offset from the start of the function
size_t GetOffset() const { ConstCast()->OnGetName(); return m_offset; }
// get the module this function belongs to (not always available)
wxString GetModule() const { ConstCast()->OnGetName(); return m_module; }
// return true if we have the filename and line number for this frame
bool HasSourceLocation() const { return !GetFileName().empty(); }
// return the name of the file containing this frame, empty if
// unavailable (typically because debug info is missing)
wxString GetFileName() const
{ ConstCast()->OnGetLocation(); return m_filename; }
// return the line number of this frame, 0 if unavailable
size_t GetLine() const { ConstCast()->OnGetLocation(); return m_line; }
// return the number of parameters of this function (may return 0 if we
// can't retrieve the parameters info even although the function does have
// parameters)
virtual size_t GetParamCount() const { return 0; }
// get the name, type and value (in text form) of the given parameter
//
// any pointer may be NULL
//
// return true if at least some values could be retrieved
virtual bool GetParam(size_t WXUNUSED(n),
wxString * WXUNUSED(type),
wxString * WXUNUSED(name),
wxString * WXUNUSED(value)) const
{
return false;
}
// although this class is not supposed to be used polymorphically, give it
// a virtual dtor to silence compiler warnings
virtual ~wxStackFrameBase() { }
protected:
// hooks for derived classes to initialize some fields on demand
virtual void OnGetName() { }
virtual void OnGetLocation() { }
// fields are protected, not private, so that OnGetXXX() could modify them
// directly
size_t m_level;
wxString m_name,
m_module,
m_filename;
size_t m_line;
void *m_address;
size_t m_offset;
};
// ----------------------------------------------------------------------------
// wxStackWalker: class for enumerating stack frames
// ----------------------------------------------------------------------------
class WXDLLIMPEXP_BASE wxStackWalkerBase
{
public:
// ctor does nothing, use Walk() to walk the stack
wxStackWalkerBase() { }
// dtor does nothing neither but should be virtual
virtual ~wxStackWalkerBase() { }
// enumerate stack frames from the current location, skipping the initial
// number of them (this can be useful when Walk() is called from some known
// location and you don't want to see the first few frames anyhow; also
// notice that Walk() frame itself is not included if skip >= 1)
virtual void Walk(size_t skip = 1, size_t maxDepth = wxSTACKWALKER_MAX_DEPTH) = 0;
#if wxUSE_ON_FATAL_EXCEPTION
// enumerate stack frames from the location of uncaught exception
//
// this version can only be called from wxApp::OnFatalException()
virtual void WalkFromException(size_t maxDepth = wxSTACKWALKER_MAX_DEPTH) = 0;
#endif // wxUSE_ON_FATAL_EXCEPTION
protected:
// this function must be overrided to process the given frame
virtual void OnStackFrame(const wxStackFrame& frame) = 0;
};
#ifdef __WINDOWS__
#include "wx/msw/stackwalk.h"
#elif defined(__UNIX__)
#include "wx/unix/stackwalk.h"
#else
#error "wxStackWalker is not supported, set wxUSE_STACKWALKER to 0"
#endif
#endif // wxUSE_STACKWALKER
#endif // _WX_STACKWALK_H_
| h |
rticonnextdds-usecases | data/projects/rticonnextdds-usecases/VehicleTracking/ExampleCode/thirdparty/wxWidgets-3.1.2/Linux/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/Linux/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/Linux/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/Linux/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/Linux/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/Linux/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/Linux/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/Linux/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/Linux/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/Linux/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/Linux/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/Linux/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/Linux/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/Linux/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/Linux/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/Linux/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/Linux/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/Linux/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/Linux/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/Linux/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/Linux/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/Linux/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/Linux/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/Linux/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/Linux/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/Linux/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/Linux/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/Linux/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/Linux/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/Linux/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/Linux/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/Linux/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 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.