wx/unix/execute.h
wx/unix/mimetype.h
wx/unix/pipe.h
+ wx/unix/private.h
wx/unix/stackwalk.h
wx/unix/stdpaths.h
</set>
CXXFLAGS="$CXXFLAGS -qunique"
fi
-
case "${host}" in
powerpc-*-darwin* )
echo "$as_me:$LINENO: checking if __POWERPC__ is already defined" >&5
INCLUDES="-I\${top_builddir}lib/wx/include/${TOOLCHAIN_FULLNAME} \
-I\${top_srcdir}/include $TOOLKIT_INCLUDE"
-if test "$GXX" = yes ; then
- CWARNINGS="-Wall -Wundef"
- CXXWARNINGS="$CWARNINGS -Wno-ctor-dtor-privacy"
+if test "$GCC" = yes ; then
+ CWARNINGS="-Wall -wd810,869,981,1418,1572,1684"
+elif test "$GCC" = yes ; then
+ CWARNINGS="-Wall -Wundef"
+fi
+
+if test "$INTELCXX" = yes ; then
+ CXXWARNINGS="-Wall -wd279,383,444,869,981,1418,1419"
+elif test "$GXX" = yes ; then
+ CXXWARNINGS="-Wall -Wundef -Wno-ctor-dtor-privacy"
fi
EXTRA_CFLAGS="$WXDEBUG $WXODBCFLAG $PROFILE $OPTIMISE"
CXXFLAGS="$CXXFLAGS -qunique"
fi
-
dnl This case is for PowerPC OS X vs. everything else
case "${host}" in
powerpc-*-darwin* )
-I\${top_srcdir}/include $TOOLKIT_INCLUDE"
dnl C/C++ compiler options used to compile wxWidgets
-if test "$GXX" = yes ; then
- dnl CXXWARNINGS="-Wall -W -Wcast-qual -Werror"
+dnl
+dnl check for icc before gcc as icc is also recognized as gcc
+if test "$GCC" = yes ; then
+ dnl Warnings which can't be easily suppressed in C code are disabled:
+ dnl
+ dnl remark #810: conversion from "x" to "y" may lose significant bits
+ dnl remark #869: parameter "foo" was never referenced
+ dnl remark #1572: floating-point equality and inequality comparisons
+ dnl are unreliable
+ dnl remark #1684: conversion from pointer to same-sized integral type
+ dnl
+ dnl (for others see below)
+ CWARNINGS="-Wall -wd810,869,981,1418,1572,1684"
+elif test "$GCC" = yes ; then
CWARNINGS="-Wall -Wundef"
- CXXWARNINGS="$CWARNINGS -Wno-ctor-dtor-privacy"
+fi
+
+if test "$INTELCXX" = yes ; then
+ dnl Intel compiler gives some warnings which simply can't be worked
+ dnl around or of which we have too many (810, 869) so it's impractical to
+ dnl keep them enabled even if in theory it would be nice and some others
+ dnl (279) are generated for standard macros and so there is nothing we can
+ dnl do about them
+ dnl
+ dnl remark #279: controlling expression is constant
+ dnl remark #383: value copied to temporary, reference to temporary used
+ dnl remark #444: destructor for base class "xxx" is not virtual
+ dnl remark #810: conversion from "x" to "y" may lose significant bits
+ dnl remark #869: parameter "foo" was never referenced
+ dnl remark #981: operands are evaluated in unspecified order
+ dnl remark #1418: external definition with no prior declaration
+ dnl remark #1419: external declaration in primary source file
+ CXXWARNINGS="-Wall -wd279,383,444,869,981,1418,1419"
+elif test "$GXX" = yes ; then
+ dnl CXXWARNINGS="-Wall -W -Wcast-qual -Werror"
+ CXXWARNINGS="-Wall -Wundef -Wno-ctor-dtor-privacy"
fi
EXTRA_CFLAGS="$WXDEBUG $WXODBCFLAG $PROFILE $OPTIMISE"
} \
wxAppInitializer \
wxTheAppInitializer((wxAppInitializerFunction) wxCreateApp); \
+ DECLARE_APP(appname) \
appname& wxGetApp() { return *(appname *)wxTheApp; }
// Same as IMPLEMENT_APP() normally but doesn't include themes support in
// function
#define DECLARE_APP(appname) extern appname& wxGetApp();
+
+// declare the stuff defined by IMPLEMENT_APP() macro, it's not really needed
+// anywhere else but at the very least it suppresses icc warnings about
+// defining extern symbols without prior declaration, and it shouldn't do any
+// harm
+extern wxAppConsole *wxCreateApp();
+extern wxAppInitializer wxTheAppInitializer;
+
#endif // _WX_APP_H_BASE_
// Use this macro to check build options. Adding it to a file in DLL will
// ensure that the DLL checks build options in same way IMPLEMENT_APP() does.
#define WX_CHECK_BUILD_OPTIONS(libName) \
- static bool wxCheckBuildOptions() \
+ static struct wxBuildOptionsChecker \
{ \
- wxAppConsole::CheckBuildOptions(WX_BUILD_OPTIONS_SIGNATURE, \
- libName); \
- return true; \
- } \
- static bool gs_buildOptionsCheck = wxCheckBuildOptions();
+ wxBuildOptionsChecker() \
+ { \
+ wxAppConsole::CheckBuildOptions(WX_BUILD_OPTIONS_SIGNATURE, \
+ libName); \
+ } \
+ } gs_buildOptionsCheck;
#if WXWIN_COMPATIBILITY_2_4
// ctor: you can specify the text here or in SetText(), or override
// GetText()
wxTextDataObject(const wxString& text = wxEmptyString)
- : wxDataObjectSimple(wxUSE_UNICODE?wxDF_UNICODETEXT:wxDF_TEXT),
+ : wxDataObjectSimple(
+#if wxUSE_UNICODE
+ wxDF_UNICODETEXT
+#else
+ wxDF_TEXT
+#endif
+ ),
m_text(text)
{
}
// implement base class pure virtuals
// ----------------------------------
-#if wxUSE_UNICODE && defined(__WXGTK20__)
- virtual size_t GetFormatCount(Direction WXUNUSED(dir) = Get) const { return 2; }
- virtual void GetAllFormats(wxDataFormat *formats,
- wxDataObjectBase::Direction WXUNUSED(dir) = Get) const;
-
- virtual size_t GetDataSize() const { return GetDataSize(GetPreferredFormat()); }
- virtual bool GetDataHere(void *buf) const { return GetDataHere(GetPreferredFormat(), buf); }
- virtual bool SetData(size_t len, const void *buf) { return SetData(GetPreferredFormat(), len, buf); }
-
- size_t GetDataSize(const wxDataFormat& format) const;
- bool GetDataHere(const wxDataFormat& format, void *pBuf) const;
- bool SetData(const wxDataFormat& format, size_t nLen, const void* pBuf);
-#elif wxUSE_UNICODE && defined(__WXMAC__)
+ // some platforms have 2 and not 1 format for text data
+#if wxUSE_UNICODE && (defined(__WXGTK20__) || defined(__WXMAC__))
virtual size_t GetFormatCount(Direction WXUNUSED(dir) = Get) const { return 2; }
virtual void GetAllFormats(wxDataFormat *formats,
wxDataObjectBase::Direction WXUNUSED(dir) = Get) const;
truncate from a larger to smaller type, static_cast<> can't be used for it
as it results in warnings when using some compilers (SGI mipspro for example)
*/
-#define wx_truncate_cast(t, x) ((t)(x))
+#if defined(__INTELC__) && defined(__cplusplus)
+ template <typename T, typename X>
+ inline T wx_truncate_cast_impl(X x)
+ {
+ #pragma warning(push)
+ /* explicit conversion of a 64-bit integral type to a smaller integral type */
+ #pragma warning(disable: 1683)
+
+ return (T)x;
+
+ #pragma warning(pop)
+ }
+
+ #define wx_truncate_cast(t, x) wx_truncate_cast_impl<t>(x)
+#else /* !__INTELC__ */
+ #define wx_truncate_cast(t, x) ((t)(x))
+#endif /* __INTELC__/!__INTELC__ */
/* for consistency with wxStatic/DynamicCast defined in wx/object.h */
#define wxConstCast(obj, className) wx_const_cast(className *, obj)
/*
VC++ 7.1 gives warnings about casts such as below even when they're
explicit with /Wp64 option, suppress them as we really know what we're
- doing here
+ doing here. Same thing with icc with -Wall.
*/
-#ifdef __VISUALC__
- #pragma warning(disable: 4311) /* pointer truncation from '' to '' */
+#if defined(__VISUALC__) || defined(__INTELC__)
+ #pragma warning(push)
+ #ifdef __VISUALC__
+ /* pointer truncation from '' to '' */
+ #pragma warning(disable: 4311)
+ #elif defined(__INTELC__)
+ /* conversion from pointer to same-sized integral type */
+ #pragma warning(disable: 1684)
+ #endif
#endif
return wx_reinterpret_cast(wxUIntPtr, p);
-#ifdef __VISUALC__
- #pragma warning(default: 4311)
+#if defined(__VISUALC__) || defined(__INTELC__)
+ #pragma warning(pop)
#endif
}
inline void *wxUIntToPtr(wxUIntPtr p)
{
-#ifdef __VISUALC__
- #pragma warning(disable: 4312) /* conversion to type of greater size */
+#if defined(__VISUALC__) || defined(__INTELC__)
+ #pragma warning(push)
+ #ifdef __VISUALC__
+ /* conversion to type of greater size */
+ #pragma warning(disable: 4312)
+ #elif defined(__INTELC__)
+ /* invalid type conversion: "wxUIntPtr={unsigned long}" to "void *" */
+ #pragma warning(disable: 171)
+ #endif
#endif
return wx_reinterpret_cast(void *, p);
-#ifdef __VISUALC__
- #pragma warning(default: 4312)
+#if defined(__VISUALC__) || defined(__INTELC__)
+ #pragma warning(pop)
#endif
}
#endif /*__cplusplus*/
// append all element of one array to another one
#define WX_APPEND_ARRAY(array, other) \
{ \
- size_t count = (other).size(); \
- for ( size_t n = 0; n < count; n++ ) \
+ size_t wxAAcnt = (other).size(); \
+ for ( size_t wxAAn = 0; wxAAn < wxAAcnt; wxAAn++ ) \
{ \
- (array).push_back((other)[n]); \
+ (array).push_back((other)[wxAAn]); \
} \
}
// count on it)!
#define WX_CLEAR_ARRAY(array) \
{ \
- size_t count = (array).size(); \
- for ( size_t n = 0; n < count; n++ ) \
+ size_t wxAAcnt = (array).size(); \
+ for ( size_t wxAAn = 0; wxAAn < wxAAcnt; wxAAn++ ) \
{ \
- delete (array)[n]; \
+ delete (array)[wxAAn]; \
} \
\
(array).clear(); \
bool GetValue() const;
// Set the label
- void SetLabel(const wxBitmap& label);
+ virtual void SetLabel(const wxString& label) { wxControl::SetLabel(label); }
+ virtual void SetLabel(const wxBitmap& label);
bool Enable(bool enable = TRUE);
static wxVisualAttributes
bool GetValue() const;
// Set the label
- void SetLabel(const wxBitmap& label);
+ virtual void SetLabel(const wxString& label) { wxControl::SetLabel(label); }
+ virtual void SetLabel(const wxBitmap& label);
bool Enable(bool enable = TRUE);
static wxVisualAttributes
// accessors
// get high part
long GetHi() const
- { return (long)(m_ll >> 32); }
+ { return wx_truncate_cast(long, m_ll >> 32); }
// get low part
unsigned long GetLo() const
- { return (unsigned long)m_ll; }
+ { return wx_truncate_cast(unsigned long, m_ll); }
// get absolute value
wxLongLongNative Abs() const { return wxLongLongNative(*this).Abs(); }
wxASSERT_MSG( (m_ll >= LONG_MIN) && (m_ll <= LONG_MAX),
_T("wxLongLong to long conversion loss of precision") );
- return (long)m_ll;
+ return wx_truncate_cast(long, m_ll);
}
#if wxABI_VERSION >= 20602
// convert to double
- double ToDouble() const { return m_ll; }
+ double ToDouble() const { return wx_truncate_cast(double, m_ll); }
#endif // ABI >= 2.6.2
// don't provide implicit conversion to wxLongLong_t or we will have an
// accessors
// get high part
unsigned long GetHi() const
- { return (unsigned long)(m_ll >> 32); }
+ { return wx_truncate_cast(unsigned long, m_ll >> 32); }
// get low part
unsigned long GetLo() const
- { return (unsigned long)m_ll; }
+ { return wx_truncate_cast(unsigned long, m_ll); }
// convert to native ulong long
wxULongLong_t GetValue() const { return m_ll; }
wxASSERT_MSG( m_ll <= LONG_MAX,
_T("wxULongLong to long conversion loss of precision") );
- return (unsigned long)m_ll;
+ return wx_truncate_cast(unsigned long, m_ll);
}
// operations
#endif /* __cplusplus */
+#if wxUSE_APPLE_IEEE
+#ifdef __cplusplus
+ extern "C" {
+#endif
+ /* functions from common/extended.c */
+ extern wxFloat64 ConvertFromIeeeExtended(const wxInt8 *bytes);
+ extern void ConvertToIeeeExtended(wxFloat64 num, wxInt8 *bytes);
+#ifdef __cplusplus
+ }
+#endif
+#endif /* wxUSE_APPLE_IEEE */
+
+
#endif /* _WX_MATH_H_ */
#define _WX_FONT_H_
#if __WXMOTIF20__ && !__WXLESSTIF__
- #define wxMOTIF_NEW_FONT_HANDLING 0 // safe default, change to 1 to enable
+ #define wxMOTIF_NEW_FONT_HANDLING 1 // safe default, change to 1 to enable
#else
#define wxMOTIF_NEW_FONT_HANDLING 0
#endif
# endif
#endif
+#ifdef __INTEL_COMPILER
+# define __INTELC__
+#endif
+
/*
We get "Large Files (ILP32) not supported in strict ANSI mode." #error
from HP-UX standard headers when compiling with g++ without this:
#define wxPOST_NO_WARNING_SCOPE(name)
#else
#define wxPRE_NO_WARNING_SCOPE(name) do
- #define wxPOST_NO_WARNING_SCOPE(name) while ( 0 )
+ #define wxPOST_NO_WARNING_SCOPE(name) while ( wxFalse )
#endif
#define wxCHECKED_DELETE(ptr) \
--- /dev/null
+///////////////////////////////////////////////////////////////////////////////
+// Name: wx/unix/private.h
+// Purpose: miscellaneous private things for Unix wx ports
+// Author: Vadim Zeitlin
+// Created: 2005-09-25
+// RCS-ID: $Id$
+// Copyright: (c) 2005 Vadim Zeitlin <vadim@wxwindows.org>
+// Licence: wxWindows licence
+///////////////////////////////////////////////////////////////////////////////
+
+#ifndef _WX_UNIX_PRIVATE_H_
+#define _WX_UNIX_PRIVATE_H_
+
+// standard linux headers produce many warnings when used with icc
+#if defined(__INTELC__) && defined(__LINUX__)
+ inline void wxFD_ZERO(fd_set *fds)
+ {
+ #pragma warning(push)
+ #pragma warning(disable:593)
+ FD_ZERO(fds);
+ #pragma warning(pop)
+ }
+
+ inline void wxFD_SET(int fd, fd_set *fds)
+ {
+ #pragma warning(push, 1)
+ #pragma warning(disable:1469)
+ FD_SET(fd, fds);
+ #pragma warning(pop)
+ }
+
+ inline bool wxFD_ISSET(int fd, fd_set *fds)
+ {
+ #pragma warning(push, 1)
+ #pragma warning(disable:1469)
+ return FD_ISSET(fd, fds);
+ #pragma warning(pop)
+ }
+#else // !__INTELC__
+ #define wxFD_ZERO(fds) FD_ZERO(fds)
+ #define wxFD_SET(fd, fds) FD_SET(fd, fds)
+ #define wxFD_ISSET(fd, fds) FD_ISSET(fd, fds)
+#endif // __INTELC__/!__INTELC__
+
+
+#endif // _WX_UNIX_PRIVATE_H_
+
protected:
virtual void OnStackFrame(const wxStackFrame& frame)
{
- m_stackTrace << wxString::Format(_T("[%02d] "), frame.GetLevel());
+ m_stackTrace << wxString::Format
+ (
+ _T("[%02d] "),
+ wx_truncate_cast(int, frame.GetLevel())
+ );
wxString name = frame.GetName();
if ( !name.empty() )
}
else
{
- m_stackTrace << wxString::Format
- (
- _T("0x%08lx"),
- (unsigned long)frame.GetAddress()
- );
+ m_stackTrace << wxString::Format(_T("0x%08p"),
+ frame.GetAddress());
}
if ( frame.HasSourceLocation() )
// wxSimpleHelpProvider
// ----------------------------------------------------------------------------
+#define WINHASH_KEY(w) wxPtrToUInt(w)
+
wxString wxSimpleHelpProvider::GetHelp(const wxWindowBase *window)
{
- wxLongToStringHashMap::iterator it = m_hashWindows.find((long)window);
+ wxLongToStringHashMap::iterator it = m_hashWindows.find(WINHASH_KEY(window));
if ( it == m_hashWindows.end() )
{
void wxSimpleHelpProvider::AddHelp(wxWindowBase *window, const wxString& text)
{
- m_hashWindows.erase((long)window);
- m_hashWindows[(long)window] = text;
+ m_hashWindows.erase(WINHASH_KEY(window));
+ m_hashWindows[WINHASH_KEY(window)] = text;
}
void wxSimpleHelpProvider::AddHelp(wxWindowID id, const wxString& text)
// removes the association
void wxSimpleHelpProvider::RemoveHelp(wxWindowBase* window)
{
- m_hashWindows.erase((long)window);
+ m_hashWindows.erase(WINHASH_KEY(window));
}
bool wxSimpleHelpProvider::ShowHelp(wxWindowBase *window)
// find two strings not occurring in format (this is surely
// not the optimal way of doing it... improvements welcome!)
- wxString fmt = format;
+ wxString fmt2 = format;
wxString replacement = (wxChar)-1;
- while ( fmt.Find(replacement) != wxNOT_FOUND )
+ while ( fmt2.Find(replacement) != wxNOT_FOUND )
{
replacement << (wxChar)-1;
}
wxString replacement2 = (wxChar)-2;
- while ( fmt.Find(replacement) != wxNOT_FOUND )
+ while ( fmt2.Find(replacement) != wxNOT_FOUND )
{
replacement << (wxChar)-2;
}
// replace all occurrences of year with it
- bool wasReplaced = fmt.Replace(strYear, replacement) > 0;
+ bool wasReplaced = fmt2.Replace(strYear, replacement) > 0;
if ( !wasReplaced )
- wasReplaced = fmt.Replace(strYear2, replacement2) > 0;
+ wasReplaced = fmt2.Replace(strYear2, replacement2) > 0;
// use strftime() to format the same date but in supported
// year
#if wxUSE_STREAMS
#include "wx/datstrm.h"
+#include "wx/math.h"
// ---------------------------------------------------------------------------
// wxDataInputStream
return (wxUint8)buf;
}
-// Must be at global scope for VC++ 5
-extern "C" double ConvertFromIeeeExtended(const unsigned char *bytes);
-
double wxDataInputStream::ReadDouble()
{
#if wxUSE_APPLE_IEEE
char buf[10];
m_input->Read(buf, 10);
- return ConvertFromIeeeExtended((unsigned char *)buf);
+ return ConvertFromIeeeExtended((const wxInt8 *)buf);
#else
return 0.0;
#endif
m_output->Write(buf, len);
}
-// Must be at global scope for VC++ 5
-extern "C" void ConvertToIeeeExtended(double num, unsigned char *bytes);
-
void wxDataOutputStream::WriteDouble(double d)
{
char buf[10];
#if wxUSE_APPLE_IEEE
- ConvertToIeeeExtended(d, (unsigned char *)buf);
+ ConvertToIeeeExtended(d, (wxInt8 *)buf);
#else
#if !defined(__VMS__) && !defined(__GNUG__)
# pragma warning "wxDataOutputStream::WriteDouble() not using IeeeExtended - will not work!"
nodeChild->AddChild(new wxXmlNode(wxXML_TEXT_NODE, wxEmptyString, value));
}
+#if wxUSE_CRASHREPORT && defined(__INTEL__)
+
static inline void
HexElement(wxXmlNode *node, const wxChar *name, unsigned long value)
{
TextElement(node, name, wxString::Format(_T("%08lx"), value));
}
+#endif // wxUSE_CRASHREPORT
+
#if wxUSE_STACKWALKER
// ============================================================================
size_t len = 0;
if ( info.GetAddress(&addr, &len) )
{
- HexProperty(nodeModule, _T("address"), (unsigned long)addr);
+ HexProperty(nodeModule, _T("address"), wxPtrToUInt(addr));
HexProperty(nodeModule, _T("size"), len);
}
HexProperty(nodeExc, _T("code"), c.code);
nodeExc->AddProperty(_T("name"), c.GetExceptionString());
- HexProperty(nodeExc, _T("address"), (unsigned long)c.addr);
+ HexProperty(nodeExc, _T("address"), wxPtrToUInt(c.addr));
#ifdef __INTEL__
wxXmlNode *nodeRegs = new wxXmlNode(wxXML_ELEMENT_NODE, _T("registers"));
_WX_DEFINE_BASEARRAY_COMMON(T, name) \
_WX_DEFINE_BASEARRAY_NOCOMMON(T, name)
+#ifdef __INTELC__
+ #pragma warning(push)
+ #pragma warning(disable: 1684)
+ #pragma warning(disable: 1572)
+#endif
+
_WX_DEFINE_BASEARRAY(const void *, wxBaseArrayPtrVoid)
_WX_DEFINE_BASEARRAY(short, wxBaseArrayShort)
_WX_DEFINE_BASEARRAY(int, wxBaseArrayInt)
_WX_DEFINE_BASEARRAY(size_t, wxBaseArraySizeT)
_WX_DEFINE_BASEARRAY(double, wxBaseArrayDouble)
+#ifdef __INTELC__
+ #pragma warning(pop)
+#endif
+
#if wxUSE_STL
#include "wx/arrstr.h"
* and a 64-bit mantissa, with no hidden bit.
****************************************************************/
-wxFloat64 ConvertFromIeeeExtended(wxInt8* bytes)
+wxFloat64 ConvertFromIeeeExtended(const wxInt8 *bytes)
{
wxFloat64 f;
wxInt32 expon;
wxCHECK_MSG( str, false, wxT("invalid parameter") );
wxCHECK_MSG( IsOpened(), false, wxT("can't read from closed file") );
wxCHECK_MSG( Length() >= 0, false, wxT("invalid length") );
- size_t length = (size_t)Length();
+ size_t length = wx_truncate_cast(size_t, Length());
wxCHECK_MSG( (wxFileOffset)length == Length(), false, wxT("huge file not supported") );
clearerr(m_fp);
{
if ( !m_strLocalFile.empty() && !wxIsAbsolutePath(m_strLocalFile) )
{
- wxString strLocal = m_strLocalFile;
+ const wxString strLocalOrig = m_strLocalFile;
m_strLocalFile = GetLocalDir();
- m_strLocalFile << strLocal;
+ m_strLocalFile << strLocalOrig;
}
if ( !m_strGlobalFile.empty() && !wxIsAbsolutePath(m_strGlobalFile) )
{
- wxString strGlobal = m_strGlobalFile;
+ const wxString strGlobalOrig = m_strGlobalFile;
m_strGlobalFile = GetGlobalDir();
- m_strGlobalFile << strGlobal;
+ m_strGlobalFile << strGlobalOrig;
}
}
}
}
else { // a key
- const wxChar *pEnd = pStart;
+ pEnd = pStart;
while ( *pEnd && *pEnd != wxT('=') /* && !wxIsspace(*pEnd)*/ ) {
if ( *pEnd == wxT('\\') ) {
// next character may be space or not - still take it because it's
}
}
#elif defined(__UNIX_LIKE__) || (defined(__DOS__) && defined(__WATCOMC__))
+ wxUnusedVar(dtCreate);
+
if ( !dtAccess && !dtMod )
{
// can't modify the creation time anyhow, don't try
if ( *p == wxT('-') )
p++;
- int value;
+ unsigned int value;
if ( wxSscanf(p, wxT("%u"), &value) == 1 )
{
if ( value >= 1250 )
return false;
// get the file size (assume it is less than 4Gb...)
- wxFileOffset nSize = fileMsg.Length();
- if ( nSize == wxInvalidOffset )
+ wxFileOffset lenFile = fileMsg.Length();
+ if ( lenFile == wxInvalidOffset )
return false;
+ size_t nSize = wx_truncate_cast(size_t, lenFile);
+ wxASSERT_MSG( nSize == lenFile, _T("message catalog bigger than 4GB?") );
+
// read the whole file in memory
m_pData = new size_t8[nSize];
- if ( fileMsg.Read(m_pData, (size_t)nSize) != nSize ) {
+ if ( fileMsg.Read(m_pData, nSize) != nSize ) {
wxDELETEA(m_pData);
return false;
}
{
static unsigned char temp[8];
- temp[0] = (unsigned char)((m_ll >> 56) & 0xFF);
- temp[1] = (unsigned char)((m_ll >> 48) & 0xFF);
- temp[2] = (unsigned char)((m_ll >> 40) & 0xFF);
- temp[3] = (unsigned char)((m_ll >> 32) & 0xFF);
- temp[4] = (unsigned char)((m_ll >> 24) & 0xFF);
- temp[5] = (unsigned char)((m_ll >> 16) & 0xFF);
- temp[6] = (unsigned char)((m_ll >> 8) & 0xFF);
- temp[7] = (unsigned char)((m_ll >> 0) & 0xFF);
+ temp[0] = wx_truncate_cast(unsigned char, ((m_ll >> 56) & 0xFF));
+ temp[1] = wx_truncate_cast(unsigned char, ((m_ll >> 48) & 0xFF));
+ temp[2] = wx_truncate_cast(unsigned char, ((m_ll >> 40) & 0xFF));
+ temp[3] = wx_truncate_cast(unsigned char, ((m_ll >> 32) & 0xFF));
+ temp[4] = wx_truncate_cast(unsigned char, ((m_ll >> 24) & 0xFF));
+ temp[5] = wx_truncate_cast(unsigned char, ((m_ll >> 16) & 0xFF));
+ temp[6] = wx_truncate_cast(unsigned char, ((m_ll >> 8) & 0xFF));
+ temp[7] = wx_truncate_cast(unsigned char, ((m_ll >> 0) & 0xFF));
return temp;
}
{
static unsigned char temp[8];
- temp[0] = (unsigned char)((m_ll >> 56) & 0xFF);
- temp[1] = (unsigned char)((m_ll >> 48) & 0xFF);
- temp[2] = (unsigned char)((m_ll >> 40) & 0xFF);
- temp[3] = (unsigned char)((m_ll >> 32) & 0xFF);
- temp[4] = (unsigned char)((m_ll >> 24) & 0xFF);
- temp[5] = (unsigned char)((m_ll >> 16) & 0xFF);
- temp[6] = (unsigned char)((m_ll >> 8) & 0xFF);
- temp[7] = (unsigned char)((m_ll >> 0) & 0xFF);
+ temp[0] = wx_truncate_cast(unsigned char, ((m_ll >> 56) & 0xFF));
+ temp[1] = wx_truncate_cast(unsigned char, ((m_ll >> 48) & 0xFF));
+ temp[2] = wx_truncate_cast(unsigned char, ((m_ll >> 40) & 0xFF));
+ temp[3] = wx_truncate_cast(unsigned char, ((m_ll >> 32) & 0xFF));
+ temp[4] = wx_truncate_cast(unsigned char, ((m_ll >> 24) & 0xFF));
+ temp[5] = wx_truncate_cast(unsigned char, ((m_ll >> 16) & 0xFF));
+ temp[6] = wx_truncate_cast(unsigned char, ((m_ll >> 8) & 0xFF));
+ temp[7] = wx_truncate_cast(unsigned char, ((m_ll >> 0) & 0xFF));
return temp;
}
wxMemoryInputStream::wxMemoryInputStream(const wxMemoryOutputStream& stream)
{
- ssize_t len = (ssize_t)stream.GetLength();
- if (len == wxInvalidOffset) {
+ const wxFileOffset lenFile = stream.GetLength();
+ if ( lenFile == wxInvalidOffset )
+ {
m_i_streambuf = NULL;
m_lasterror = wxSTREAM_EOF;
return;
}
+
+ const size_t len = wx_truncate_cast(size_t, lenFile);
+ wxASSERT_MSG( len == lenFile, _T("huge files not supported") );
+
m_i_streambuf = new wxStreamBuffer(wxStreamBuffer::read);
m_i_streambuf->SetBufferIO(len); // create buffer
stream.CopyTo(m_i_streambuf->GetBufferStart(), len);
{
if (m_handlerPopup && m_handlerPopup->GetNextHandler())
PopHandlers();
-
+
wxASSERT(!m_handlerFocus || !m_handlerFocus->GetNextHandler());
wxASSERT(!m_handlerPopup || !m_handlerPopup->GetNextHandler());
m_handlerPopup = NULL;
}
if (m_child->HasCapture())
- {
+ {
m_child->ReleaseMouse();
}
m_child = NULL;
#ifdef __WXMSW__
if (!show && m_child && m_child->HasCapture())
- {
+ {
m_child->ReleaseMouse();
}
#endif
-
+
bool ret = wxPopupWindow::Show( show );
#ifdef __WXGTK__
{
m_child->CaptureMouse();
}
- }
+ }
}
}
-#endif
+#endif // __WXMSW__
#if wxUSE_COMBOBOX && defined(__WXUNIVERSAL__)
// dismissing a tooltip shouldn't waste a click, i.e. you
// should be able to dismiss it and press the button with the
// same click, so repost this event to the window beneath us
- wxWindow *win = wxFindWindowAtPoint(event2.GetPosition());
- if ( win )
+ wxWindow *winUnder = wxFindWindowAtPoint(event2.GetPosition());
+ if ( winUnder )
{
// translate the event coords to the ones of the window
// which is going to get the event
- win->ScreenToClient(&event2.m_x, &event2.m_y);
+ winUnder->ScreenToClient(&event2.m_x, &event2.m_y);
- event2.SetEventObject(win);
- wxPostEvent(win, event2);
+ event2.SetEventObject(winUnder);
+ wxPostEvent(winUnder, event2);
}
}
break;
wxString wxIPV4address::IPAddress() const
{
unsigned long raw = GAddress_INET_GetHostAddress(m_address);
- return wxString::Format(
- _T("%u.%u.%u.%u"),
- (unsigned char)((raw>>24) & 0xff),
- (unsigned char)((raw>>16) & 0xff),
- (unsigned char)((raw>>8) & 0xff),
- (unsigned char)(raw & 0xff)
+ return wxString::Format(_T("%lu.%lu.%lu.%lu"),
+ (raw>>24) & 0xff,
+ (raw>>16) & 0xff,
+ (raw>>8) & 0xff,
+ raw & 0xff
);
}
bool wxIPV4address::operator==(const wxIPV4address& addr) const
{
- if(Hostname().Cmp(addr.Hostname().c_str()) == 0 && Service() == addr.Service()) return true;
- return false;
+ return Hostname().Cmp(addr.Hostname().c_str()) == 0 &&
+ Service() == addr.Service();
}
#if wxUSE_IPV6
public:
wxSocketState() : wxObject() {}
- DECLARE_NO_COPY_CLASS(wxSocketState)
+ DECLARE_NO_COPY_CLASS(wxSocketState)
};
// ==========================================================================
{
if ( buf && len + 3 < n )
{
- unsigned char n = *opsz;
+ unsigned char on = *opsz;
*buf++ = L'\\';
- *buf++ = (wchar_t)( L'0' + n / 0100 );
- *buf++ = (wchar_t)( L'0' + (n % 0100) / 010 );
- *buf++ = (wchar_t)( L'0' + n % 010 );
+ *buf++ = (wchar_t)( L'0' + on / 0100 );
+ *buf++ = (wchar_t)( L'0' + (on % 0100) / 010 );
+ *buf++ = (wchar_t)( L'0' + on % 010 );
}
opsz++;
len += 4;
for ( ; *names; ++names )
{
- const wxString name(*names);
+ const wxString nameCS(*names);
// first try charset with explicit bytesex info (e.g. "UCS-4LE"):
- wxString nameXE(name);
+ wxString nameXE(nameCS);
#ifdef WORDS_BIGENDIAN
nameXE += _T("BE");
#else // little endian
if ( m2w == ICONV_T_INVALID )
{
// try charset w/o bytesex info (e.g. "UCS4")
- m2w = iconv_open(name.ToAscii(), cname);
+ m2w = iconv_open(nameCS.ToAscii(), cname);
// and check for bytesex ourselves:
if ( m2w != ICONV_T_INVALID )
{
wxLogLastError(wxT("iconv"));
wxLogError(_("Conversion to charset '%s' doesn't work."),
- name.c_str());
+ nameCS.c_str());
}
else // ok, can convert to this encoding, remember it
{
- ms_wcCharsetName = name;
+ ms_wcCharsetName = nameCS;
ms_wcNeedsSwap = wbuf[0] != (wchar_t)buf[0];
}
}
if (ms_wcNeedsSwap)
{
// convert to native endianness
- for ( unsigned n = 0; n < res; n++ )
- buf[n] = WC_BSWAP(buf[n]);
+ for ( unsigned i = 0; i < res; i++ )
+ buf[n] = WC_BSWAP(buf[i]);
}
// NB: iconv was given only strlen(psz) characters on input, and so
// (doing WC_BSWAP twice on the original buffer won't help, as it
// could be in read-only memory, or be accessed in some other thread)
tmpbuf = (wchar_t *)malloc(inbuf + SIZEOF_WCHAR_T);
- for ( size_t n = 0; n < inlen; n++ )
- tmpbuf[n] = WC_BSWAP(psz[n]);
+ for ( size_t i = 0; i < inlen; i++ )
+ tmpbuf[n] = WC_BSWAP(psz[i]);
tmpbuf[inlen] = L'\0';
psz = tmpbuf;
}
}
if (diff < 0 || diff > last_access)
return wxInvalidOffset;
- size_t int_diff = (size_t)diff;
+ size_t int_diff = wx_truncate_cast(size_t, diff);
wxCHECK_MSG( (wxFileOffset)int_diff == diff, wxInvalidOffset, wxT("huge file not supported") );
SetIntPosition(int_diff);
return diff;
}
else
{
- size_t int_diff = (size_t)diff;
+ size_t int_diff = wx_truncate_cast(size_t, diff);
wxCHECK_MSG( (wxFileOffset)int_diff == diff, wxInvalidOffset, wxT("huge file not supported") );
SetIntPosition(int_diff);
return pos;
size_t wxStreamBase::GetSize() const
{
wxFileOffset length = GetLength();
- return length == wxInvalidOffset ? 0 : (size_t)length;
+ if ( length == wxInvalidOffset )
+ return 0;
+
+ const size_t len = wx_truncate_cast(size_t, length);
+ wxASSERT_MSG( len == length, _T("large files not supported") );
+
+ return len;
}
wxFileOffset wxStreamBase::OnSysSeek(wxFileOffset WXUNUSED(seek), wxSeekMode WXUNUSED(mode))
wxFileOffset wxCountingOutputStream::OnSysSeek(wxFileOffset pos, wxSeekMode mode)
{
- ssize_t new_pos = (ssize_t)pos;
+ ssize_t new_pos = wx_truncate_cast(ssize_t, pos);
switch ( mode )
{
if ( pData->IsEmpty() ) {
nLen += EXTRA_ALLOC;
- wxStringData* pData = (wxStringData*)
- malloc(sizeof(wxStringData) + (nLen + 1)*sizeof(wxChar));
+ pData = (wxStringData *)
+ malloc(sizeof(wxStringData) + (nLen + 1)*sizeof(wxChar));
if ( pData == NULL ) {
// allocation failure handled by caller
void wxTextOutputStream::Write16(wxUint16 i)
{
wxString str;
- str.Printf(wxT("%u"), i);
+ str.Printf(wxT("%u"), (unsigned)i);
WriteString(str);
}
void wxTextOutputStream::Write8(wxUint8 i)
{
wxString str;
- str.Printf(wxT("%u"), i);
+ str.Printf(wxT("%u"), (unsigned)i);
WriteString(str);
}
{
wxASSERT_MSG( IsHex(s[0]) && IsHex(s[1]), wxT("Invalid escape sequence!"));
- return (wxChar)( CharToHex(s[0]) << 4 ) | CharToHex(s[1]);
+ return wx_truncate_cast(wxChar, (CharToHex(s[0]) << 4 ) | CharToHex(s[1]));
}
wxString wxURI::Unescape(const wxString& uri)
WX_DECLARE_LIST(wxAcceleratorEntry, wxAccelList);
#include "wx/listimpl.cpp"
-WX_DEFINE_LIST(wxAccelList);
+WX_DEFINE_LIST(wxAccelList)
// ----------------------------------------------------------------------------
// wxAccelRefData: the data used by wxAcceleratorTable
bool wxDatePickerCtrlGeneric::SetFormat(const wxChar *fmt)
{
+ m_format.clear();
+
wxDateTime dt;
dt.ParseFormat(wxT("2003-10-13"), wxT("%Y-%m-%d"));
- wxString str=dt.Format(fmt);
- wxChar *p=(wxChar*)str.c_str();
-
- m_format=wxEmptyString;
+ wxString str(dt.Format(fmt));
- while (*p)
+ const wxChar *p = str.c_str();
+ while ( *p )
{
int n=wxAtoi(p);
if (n == dt.GetDay())
m_format.Append(*p++);
}
- if (m_txt)
+ if ( m_txt )
{
wxArrayString allowedChars;
for ( wxChar c = _T('0'); c <= _T('9'); c++ )
allowedChars.Add(wxString(c, 1));
- const wxChar *p = m_format.c_str();
- while (*p)
+ const wxChar *p2 = m_format.c_str();
+ while ( *p2 )
{
- if (*p == '%')
- p += 2;
+ if ( *p2 == '%')
+ p2 += 2;
else
- allowedChars.Add(wxString(*p++, 1));
+ allowedChars.Add(wxString(*p2++, 1));
}
#if wxUSE_VALIDATORS
if (data)
m_input->SetValue( data->m_path );
-};
+}
void wxGenericDirDialog::OnTreeKeyDown( wxTreeEvent &WXUNUSED(event) )
{
wxDirItemData *data = (wxDirItemData*)m_dirCtrl->GetTreeCtrl()->GetItemData(m_dirCtrl->GetTreeCtrl()->GetSelection());
if (data)
m_input->SetValue( data->m_path );
-};
+}
void wxGenericDirDialog::OnShowHidden( wxCommandEvent& event )
{
}
return s;
-};
+}
wxString wxFileData::GetEntry( fileListFieldType num ) const
{
if ( height<0 )
return;
m_minAcceptableRowHeight = height;
-};
+}
int wxGrid::GetColMinimalAcceptableWidth() const
{
{
// If not in query mode, resize the window.
// TODO: add wxRect& form to wxWindow::SetSize
- wxSize sz = GetSize();
+ wxSize sz2 = GetSize();
wxPoint pos = GetPosition();
SetSize(thisRect.x, thisRect.y, thisRect.width, thisRect.height);
// Make sure the sash is erased when the window is resized
- if ((pos.x != thisRect.x || pos.y != thisRect.y || sz.x != thisRect.width || sz.y != thisRect.height) &&
+ if ((pos.x != thisRect.x || pos.y != thisRect.y || sz2.x != thisRect.width || sz2.y != thisRect.height) &&
(GetSashVisible(wxSASH_TOP) || GetSashVisible(wxSASH_RIGHT) || GetSashVisible(wxSASH_BOTTOM) || GetSashVisible(wxSASH_LEFT)))
Refresh(true);
WX_DECLARE_LIST(wxListItemData, wxListItemDataList);
#include "wx/listimpl.cpp"
-WX_DEFINE_LIST(wxListItemDataList);
+WX_DEFINE_LIST(wxListItemDataList)
class wxListLineData
{
WX_DECLARE_EXPORTED_OBJARRAY(wxListLineData, wxListLineDataArray);
#include "wx/arrimpl.cpp"
-WX_DEFINE_OBJARRAY(wxListLineDataArray);
+WX_DEFINE_OBJARRAY(wxListLineDataArray)
//-----------------------------------------------------------------------------
// wxListHeaderWindow (internal)
WX_DECLARE_LIST(wxListHeaderData, wxListHeaderDataList);
#include "wx/listimpl.cpp"
-WX_DEFINE_LIST(wxListHeaderDataList);
+WX_DEFINE_LIST(wxListHeaderDataList)
class wxListMainWindow : public wxScrolledWindow
{
void wxGenericPrintSetupDialog::OnPrinter(wxListEvent& event)
{
// Delete check mark
- long item;
- for (item = 0; item < m_printerListCtrl->GetItemCount(); item++)
+ for (long item = 0; item < m_printerListCtrl->GetItemCount(); item++)
m_printerListCtrl->SetItemImage( item, -1 );
m_printerListCtrl->SetItemImage( event.GetIndex(), 0 );
}
else
{
- wxString tmp = wxT("lpr -P");
- wxListItem item;
- item.SetColumn( 1 );
- item.SetMask( wxLIST_MASK_TEXT );
- item.SetId( event.GetIndex() );
- m_printerListCtrl->GetItem( item );
- tmp += item.GetText();
- m_printerCommandText->SetValue( tmp );
+ wxListItem li;
+ li.SetColumn( 1 );
+ li.SetMask( wxLIST_MASK_TEXT );
+ li.SetId( event.GetIndex() );
+ m_printerListCtrl->GetItem( li );
+ m_printerCommandText->SetValue( _T("lpr -P") + li.GetText() );
}
}
#define wxSPLASH_TIMER_ID 9999
-IMPLEMENT_DYNAMIC_CLASS(wxSplashScreen, wxFrame);
+IMPLEMENT_DYNAMIC_CLASS(wxSplashScreen, wxFrame)
BEGIN_EVENT_TABLE(wxSplashScreen, wxFrame)
EVT_TIMER(wxSPLASH_TIMER_ID, wxSplashScreen::OnNotify)
#include <unistd.h>
#endif // HAVE_POLL/!HAVE_POLL
+#include "wx/unix/private.h"
#include "wx/gtk/win_gtk.h"
#include <gtk/gtk.h>
fd_set readfds;
fd_set writefds;
fd_set exceptfds;
- FD_ZERO(&readfds);
- FD_ZERO(&writefds);
- FD_ZERO(&exceptfds);
+ wxFD_ZERO(&readfds);
+ wxFD_ZERO(&writefds);
+ wxFD_ZERO(&exceptfds);
unsigned int i;
for ( i = 0; i < nfds; i++ )
{
- wxASSERT_MSG( ufds[i].fd < FD_SETSIZE, _T("fd out of range") );
+ wxASSERT_MSG( ufds[i].fd < wxFD_SETSIZE, _T("fd out of range") );
if ( ufds[i].events & G_IO_IN )
- FD_SET(ufds[i].fd, &readfds);
+ wxFD_SET(ufds[i].fd, &readfds);
if ( ufds[i].events & G_IO_PRI )
- FD_SET(ufds[i].fd, &exceptfds);
+ wxFD_SET(ufds[i].fd, &exceptfds);
if ( ufds[i].events & G_IO_OUT )
- FD_SET(ufds[i].fd, &writefds);
+ wxFD_SET(ufds[i].fd, &writefds);
if ( ufds[i].fd > fdMax )
fdMax = ufds[i].fd;
{
ufds[i].revents = 0;
- if ( FD_ISSET(ufds[i].fd, &readfds ) )
+ if ( wxFD_ISSET(ufds[i].fd, &readfds ) )
ufds[i].revents |= G_IO_IN;
- if ( FD_ISSET(ufds[i].fd, &exceptfds ) )
+ if ( wxFD_ISSET(ufds[i].fd, &exceptfds ) )
ufds[i].revents |= G_IO_PRI;
- if ( FD_ISSET(ufds[i].fd, &writefds ) )
+ if ( wxFD_ISSET(ufds[i].fd, &writefds ) )
ufds[i].revents |= G_IO_OUT;
}
#endif
}
-void wxBitmap::UngetRawData(wxPixelDataBase& data)
+void wxBitmap::UngetRawData(wxPixelDataBase& WXUNUSED(data))
{
}
{
}
-bool wxBitmapHandler::Create(wxBitmap *bitmap, void *data, long type, int width, int height, int depth)
+bool wxBitmapHandler::Create(wxBitmap * WXUNUSED(bitmap),
+ void * WXUNUSED(data),
+ long WXUNUSED(type),
+ int WXUNUSED(width),
+ int WXUNUSED(height),
+ int WXUNUSED(depth))
{
+ wxFAIL_MSG( _T("not implemented") );
+
return false;
}
-bool wxBitmapHandler::LoadFile(wxBitmap *bitmap, const wxString& name, long flags,
- int desiredWidth, int desiredHeight)
+bool wxBitmapHandler::LoadFile(wxBitmap * WXUNUSED(bitmap),
+ const wxString& WXUNUSED(name),
+ long WXUNUSED(flags),
+ int WXUNUSED(desiredWidth),
+ int WXUNUSED(desiredHeight))
{
+ wxFAIL_MSG( _T("not implemented") );
+
return false;
}
-bool wxBitmapHandler::SaveFile(const wxBitmap *bitmap, const wxString& name, int type, const wxPalette *palette)
+bool wxBitmapHandler::SaveFile(const wxBitmap * WXUNUSED(bitmap),
+ const wxString& WXUNUSED(name),
+ int WXUNUSED(type),
+ const wxPalette * WXUNUSED(palette))
{
+ wxFAIL_MSG( _T("not implemented") );
+
return false;
}
if ( event.GetKeyCode() == WXK_RETURN )
{
// GTK automatically selects an item if its in the list
- wxCommandEvent event(wxEVT_COMMAND_TEXT_ENTER, GetId());
- event.SetString( GetValue() );
- event.SetInt( GetSelection() );
- event.SetEventObject( this );
+ wxCommandEvent eventEnter(wxEVT_COMMAND_TEXT_ENTER, GetId());
+ eventEnter.SetString( GetValue() );
+ eventEnter.SetInt( GetSelection() );
+ eventEnter.SetEventObject( this );
- if (!GetEventHandler()->ProcessEvent( event ))
+ if (!GetEventHandler()->ProcessEvent( eventEnter ))
{
// This will invoke the dialog default action, such
// as the clicking the default button.
gint width,
gint height)
{
- g_return_if_fail (drawable != NULL);
- g_return_if_fail (src != NULL);
- g_return_if_fail (gc != NULL);
+ wxCHECK_RET( drawable, _T("NULL drawable in gdk_wx_draw_bitmap") );
+ wxCHECK_RET( src, _T("NULL src in gdk_wx_draw_bitmap") );
+ wxCHECK_RET( gc, _T("NULL gc in gdk_wx_draw_bitmap") );
#ifdef __WXGTK20__
gint src_width, src_height;
(GInstanceInitFunc) egg_tray_icon_init
};
- our_type = g_type_register_static (GTK_TYPE_PLUG, "EggTrayIcon", &our_info, 0);
+ our_type = g_type_register_static (GTK_TYPE_PLUG, "EggTrayIcon",
+ &our_info, (GTypeFlags)0);
}
return our_type;
{
// not yet, notify it
win->m_hasFocus = TRUE;
-
+
wxChildFocusEvent eventChildFocus(win);
(void)win->GetEventHandler()->ProcessEvent(eventChildFocus);
for (i = 0; i < (int)listbox->GetCount(); i++)
if (i != sel)
gtk_list_unselect_item( GTK_LIST(listbox->m_list), i );
-
+
listbox->m_blockEvent = FALSE;
-
+
return false;
}
#endif // wxUSE_CHECKLISTBOX
// Check or uncheck item with SPACE
- if ((gdk_event->keyval == ' ') && (!ret) &&
+ if ((gdk_event->keyval == ' ') && (!ret) &&
(((listbox->GetWindowStyleFlag() & wxLB_MULTIPLE) != 0) ||
((listbox->GetWindowStyleFlag() & wxLB_EXTENDED) != 0)) )
{
int sel = listbox->GtkGetIndex( widget );
-
+
if (sel != -1)
{
ret = TRUE;
-
+
if (listbox->IsSelected( sel ))
gtk_list_unselect_item( listbox->m_list, sel );
else
gtk_list_select_item( listbox->m_list, sel );
-
+
wxCommandEvent new_event(wxEVT_COMMAND_LISTBOX_SELECTED, listbox->GetId() );
new_event.SetEventObject( listbox );
wxArrayInt aSelections;
listbox->GetEventHandler()->ProcessEvent( new_event );
}
}
-
+
if (ret)
{
gtk_signal_emit_stop_by_name( GTK_OBJECT(widget), "key_press_event" );
{
if (g_isIdle)
wxapp_install_idle_handler();
-
+
GList *child = win->m_list->children;
for (child = win->m_list->children; child != NULL; child = child->next)
gtk_widget_show( GTK_WIDGET(child->data) );
-
+
return false;
}
}
gtk_signal_connect( GTK_OBJECT(m_list), "realize",
GTK_SIGNAL_FUNC(gtk_listbox_realized_callback), (gpointer) this );
-
+
if ( style & wxLB_SORT )
{
// this will change DoAppend() behaviour
if (GTK_WIDGET_REALIZED(m_widget))
{
gtk_widget_show( list_item );
-
+
gtk_widget_realize( list_item );
gtk_widget_realize( GTK_BIN(list_item)->child );
{
gtk_widget_modify_style( GTK_WIDGET( list_item ), style );
GtkBin *bin = GTK_BIN( list_item );
- GtkWidget *label = GTK_WIDGET( bin->child );
- gtk_widget_modify_style( label, style );
+ gtk_widget_modify_style( GTK_WIDGET( bin->child ), style );
gtk_rc_style_unref( style );
}
}
{
return TRUE;
-#if 0
+#if 0
if (m_widget->window == window) return TRUE;
if (GTK_WIDGET(m_list)->window == window) return TRUE;
lbHeight = (cy+4) * wxMin(wxMax(GetCount(), 3), 10);
wxSize best(lbWidth, lbHeight);
- CacheBestSize(best);
+ CacheBestSize(best);
return best;
}
int xScroll = GetScrollPos(wxHORIZONTAL);
if ( xScroll != xScrollOld )
{
- wxScrollWinEvent event(wxEVT_SCROLLWIN_THUMBTRACK, xScroll,
- wxHORIZONTAL);
- event.SetEventObject(this);
- GetEventHandler()->ProcessEvent(event);
+ wxScrollWinEvent eventS(wxEVT_SCROLLWIN_THUMBTRACK, xScroll,
+ wxHORIZONTAL);
+ eventS.SetEventObject(this);
+ GetEventHandler()->ProcessEvent(eventS);
}
int yScroll = GetScrollPos(wxVERTICAL);
if ( yScroll != yScrollOld )
{
- wxScrollWinEvent event(wxEVT_SCROLLWIN_THUMBTRACK, yScroll,
- wxVERTICAL);
- event.SetEventObject(this);
- GetEventHandler()->ProcessEvent(event);
+ wxScrollWinEvent eventS(wxEVT_SCROLLWIN_THUMBTRACK, yScroll,
+ wxVERTICAL);
+ eventS.SetEventObject(this);
+ GetEventHandler()->ProcessEvent(eventS);
}
}
GtkWidget *widget = gtk_button_new();
GtkStyle *def = gtk_rc_get_style( widget );
if ( !def || !def->font_desc )
- def = gtk_widget_get_default_style();
+ def = gtk_widget_get_default_style();
if ( def && def->font_desc )
- {
- wxNativeFontInfo info;
- info.description =
+ {
+ wxNativeFontInfo info;
+ info.description =
pango_font_description_copy(def->font_desc);
- gs_objects.m_fontSystem = wxFont(info);
- }
- else
- {
+ gs_objects.m_fontSystem = wxFont(info);
+ }
+ else
+ {
GtkSettings *settings = gtk_settings_get_default();
gchar *font_name = NULL;
g_object_get ( settings,
- "gtk-font-name",
+ "gtk-font-name",
&font_name,
NULL);
if (!font_name)
else
gs_objects.m_fontSystem = wxFont(wxString::FromAscii(font_name));
g_free (font_name);
- }
+ }
gtk_widget_destroy( widget );
#else
gs_objects.m_fontSystem = wxFont( 12, wxSWISS, wxNORMAL, wxNORMAL );
{
#ifdef __WXGTK20__
bool success = false;
-
+
guchar *data = NULL;
GdkWindow *window = NULL;
if(win && GTK_WIDGET_REALIZED(win->GetHandle()))
if (!gdk_net_wm_supports(gdk_atom_intern("_NET_FRAME_EXTENTS", false)))
return -1;
}
-
+
// Get the frame extents from the windowmanager.
// In most cases the top extent is the titlebar, so we use the bottom extent
// for the heights.
-
+
Atom type;
gint format;
gulong nitems;
-
+
#if GTK_CHECK_VERSION(2,2,0)
if (!gtk_check_version(2,2,0))
{
{
switch (index)
{
- case wxSYS_CAN_ICONIZE_FRAME:
- return FALSE;
- break;
+ case wxSYS_CAN_ICONIZE_FRAME:
+ return FALSE;
+
case wxSYS_CAN_DRAW_FRAME_DECORATIONS:
- return TRUE;
- break;
+ return TRUE;
+
default:
return FALSE;
}
{
wxToolBarToolsList::compatibility_iterator node
= wxToolBarToolsList::compatibility_iterator();
- if ( pos ) node = m_tools.Item(pos - 1);
+ if ( pos )
+ node = m_tools.Item(pos - 1);
while ( node )
{
- wxToolBarTool *tool = (wxToolBarTool *)node->GetData();
- if ( !tool->IsRadio() )
+ wxToolBarTool *toolNext = (wxToolBarTool *)node->GetData();
+ if ( !toolNext->IsRadio() )
break;
- widget = tool->m_item;
+ widget = toolNext->m_item;
node = node->GetPrevious();
}
gboolean include_internals,
GtkCallback callback,
gpointer callback_data);
-
+
static void gtk_pizza_allocate_child (GtkPizza *pizza,
GtkPizzaChild *child);
static void gtk_pizza_adjust_allocations_recurse (GtkWidget *widget,
static GtkContainerClass *pizza_parent_class = NULL;
#endif
+#ifndef __WXGTK20__
static gboolean gravity_works;
+#endif
GtkType
gtk_pizza_get_type ()
if (!pizza_type)
{
-
+
#ifdef __WXGTK20__
static const GTypeInfo pizza_info =
{
16, /* n_preallocs */
(GInstanceInitFunc) gtk_pizza_init,
};
- pizza_type = g_type_register_static (GTK_TYPE_CONTAINER, "GtkPizza", &pizza_info, 0);
+ pizza_type = g_type_register_static (GTK_TYPE_CONTAINER, "GtkPizza", &pizza_info, (GTypeFlags)0);
#else
GtkTypeInfo pizza_info =
{
child->x = x;
child->y = y;
-
+
if (GTK_WIDGET_VISIBLE (widget) && GTK_WIDGET_VISIBLE (pizza))
gtk_widget_queue_resize (widget);
break;
widget->style = gtk_style_attach (widget->style, widget->window);
gtk_style_set_background (widget->style, widget->window, GTK_STATE_NORMAL);
gtk_style_set_background (widget->style, pizza->bin_window, GTK_STATE_NORMAL );
-
+
/*
gdk_window_set_back_pixmap( widget->window, NULL, FALSE );
gdk_window_set_back_pixmap( pizza->bin_window, NULL, FALSE );
/* add filters for intercepting visibility and expose events */
gdk_window_add_filter (widget->window, gtk_pizza_main_filter, pizza);
gdk_window_add_filter (pizza->bin_window, gtk_pizza_filter, pizza);
-#endif
/* we NEED gravity or we'll give up */
gravity_works = gdk_window_set_static_gravities (pizza->bin_window, TRUE);
+#endif // !__WXGTK20__
/* cannot be done before realisation */
children = pizza->children;
#ifdef __WXGTK20__
(* GTK_WIDGET_CLASS (pizza_parent_class)->expose_event) (widget, event);
-
+
return FALSE;
-
+
#else
children = pizza->children;
gtk_widget_event (child->widget, (GdkEvent*) &child_event);
}
}
-
+
return TRUE;
-
+
#endif
}
if (pizza->bin_window)
gdk_window_scroll( pizza->bin_window, -dx, -dy );
-#else
+#else // !__WXGTK20__
GtkWidget *widget;
XEvent xevent;
XID win;
}
}
}
-#endif /* __WXGTK20__ */
+#endif /* __WXGTK20__/!__WXGTK20__ */
}
// hack: we need something to pass to gtk_menu_popup, so we store the time of
// the last click here
+#ifndef __WXGTK20__
static guint32 gs_timeLastClick = 0;
+#endif
extern bool g_mainThreadLocked;
if ( btnCancel )
{
- wxCommandEvent event(wxEVT_COMMAND_BUTTON_CLICKED, wxID_CANCEL);
- event.SetEventObject(btnCancel);
- ret = btnCancel->GetEventHandler()->ProcessEvent(event);
+ wxCommandEvent eventClick(wxEVT_COMMAND_BUTTON_CLICKED, wxID_CANCEL);
+ eventClick.SetEventObject(btnCancel);
+ ret = btnCancel->GetEventHandler()->ProcessEvent(eventClick);
}
}
if ( !g_captureWindow )
win = FindWindowForMouseEvent(win, event.m_x, event.m_y);
+#ifndef __WXGTK20__
gs_timeLastClick = gdk_event->time;
-#ifndef __WXGTK20__
if (event_type == wxEVT_LEFT_DCLICK)
{
// GTK 1.2 crashes when intercepting double
return FALSE;
}
}
-#endif
+#endif // !__WXGTK20__
if (win->GetEventHandler()->ProcessEvent( event ))
{
// the mouse changed window
g_captureWindowHasMouse = hasMouse;
- wxMouseEvent event(g_captureWindowHasMouse ? wxEVT_ENTER_WINDOW
- : wxEVT_LEAVE_WINDOW);
- InitMouseEvent(win, event, gdk_event);
- event.SetEventObject(win);
- win->GetEventHandler()->ProcessEvent(event);
+ wxMouseEvent eventM(g_captureWindowHasMouse ? wxEVT_ENTER_WINDOW
+ : wxEVT_LEAVE_WINDOW);
+ InitMouseEvent(win, eventM, gdk_event);
+ eventM.SetEventObject(win);
+ win->GetEventHandler()->ProcessEvent(eventM);
}
}
else // no capture
#include <unistd.h>
#endif // HAVE_POLL/!HAVE_POLL
+#include "wx/unix/private.h"
#include "wx/gtk/win_gtk.h"
#include <gtk/gtk.h>
fd_set readfds;
fd_set writefds;
fd_set exceptfds;
- FD_ZERO(&readfds);
- FD_ZERO(&writefds);
- FD_ZERO(&exceptfds);
+ wxFD_ZERO(&readfds);
+ wxFD_ZERO(&writefds);
+ wxFD_ZERO(&exceptfds);
unsigned int i;
for ( i = 0; i < nfds; i++ )
{
- wxASSERT_MSG( ufds[i].fd < FD_SETSIZE, _T("fd out of range") );
+ wxASSERT_MSG( ufds[i].fd < wxFD_SETSIZE, _T("fd out of range") );
if ( ufds[i].events & G_IO_IN )
- FD_SET(ufds[i].fd, &readfds);
+ wxFD_SET(ufds[i].fd, &readfds);
if ( ufds[i].events & G_IO_PRI )
- FD_SET(ufds[i].fd, &exceptfds);
+ wxFD_SET(ufds[i].fd, &exceptfds);
if ( ufds[i].events & G_IO_OUT )
- FD_SET(ufds[i].fd, &writefds);
+ wxFD_SET(ufds[i].fd, &writefds);
if ( ufds[i].fd > fdMax )
fdMax = ufds[i].fd;
{
ufds[i].revents = 0;
- if ( FD_ISSET(ufds[i].fd, &readfds ) )
+ if ( wxFD_ISSET(ufds[i].fd, &readfds ) )
ufds[i].revents |= G_IO_IN;
- if ( FD_ISSET(ufds[i].fd, &exceptfds ) )
+ if ( wxFD_ISSET(ufds[i].fd, &exceptfds ) )
ufds[i].revents |= G_IO_PRI;
- if ( FD_ISSET(ufds[i].fd, &writefds ) )
+ if ( wxFD_ISSET(ufds[i].fd, &writefds ) )
ufds[i].revents |= G_IO_OUT;
}
#endif
}
-void wxBitmap::UngetRawData(wxPixelDataBase& data)
+void wxBitmap::UngetRawData(wxPixelDataBase& WXUNUSED(data))
{
}
{
}
-bool wxBitmapHandler::Create(wxBitmap *bitmap, void *data, long type, int width, int height, int depth)
+bool wxBitmapHandler::Create(wxBitmap * WXUNUSED(bitmap),
+ void * WXUNUSED(data),
+ long WXUNUSED(type),
+ int WXUNUSED(width),
+ int WXUNUSED(height),
+ int WXUNUSED(depth))
{
+ wxFAIL_MSG( _T("not implemented") );
+
return false;
}
-bool wxBitmapHandler::LoadFile(wxBitmap *bitmap, const wxString& name, long flags,
- int desiredWidth, int desiredHeight)
+bool wxBitmapHandler::LoadFile(wxBitmap * WXUNUSED(bitmap),
+ const wxString& WXUNUSED(name),
+ long WXUNUSED(flags),
+ int WXUNUSED(desiredWidth),
+ int WXUNUSED(desiredHeight))
{
+ wxFAIL_MSG( _T("not implemented") );
+
return false;
}
-bool wxBitmapHandler::SaveFile(const wxBitmap *bitmap, const wxString& name, int type, const wxPalette *palette)
+bool wxBitmapHandler::SaveFile(const wxBitmap * WXUNUSED(bitmap),
+ const wxString& WXUNUSED(name),
+ int WXUNUSED(type),
+ const wxPalette * WXUNUSED(palette))
{
+ wxFAIL_MSG( _T("not implemented") );
+
return false;
}
if ( event.GetKeyCode() == WXK_RETURN )
{
// GTK automatically selects an item if its in the list
- wxCommandEvent event(wxEVT_COMMAND_TEXT_ENTER, GetId());
- event.SetString( GetValue() );
- event.SetInt( GetSelection() );
- event.SetEventObject( this );
+ wxCommandEvent eventEnter(wxEVT_COMMAND_TEXT_ENTER, GetId());
+ eventEnter.SetString( GetValue() );
+ eventEnter.SetInt( GetSelection() );
+ eventEnter.SetEventObject( this );
- if (!GetEventHandler()->ProcessEvent( event ))
+ if (!GetEventHandler()->ProcessEvent( eventEnter ))
{
// This will invoke the dialog default action, such
// as the clicking the default button.
gint width,
gint height)
{
- g_return_if_fail (drawable != NULL);
- g_return_if_fail (src != NULL);
- g_return_if_fail (gc != NULL);
+ wxCHECK_RET( drawable, _T("NULL drawable in gdk_wx_draw_bitmap") );
+ wxCHECK_RET( src, _T("NULL src in gdk_wx_draw_bitmap") );
+ wxCHECK_RET( gc, _T("NULL gc in gdk_wx_draw_bitmap") );
#ifdef __WXGTK20__
gint src_width, src_height;
(GInstanceInitFunc) egg_tray_icon_init
};
- our_type = g_type_register_static (GTK_TYPE_PLUG, "EggTrayIcon", &our_info, 0);
+ our_type = g_type_register_static (GTK_TYPE_PLUG, "EggTrayIcon",
+ &our_info, (GTypeFlags)0);
}
return our_type;
{
// not yet, notify it
win->m_hasFocus = TRUE;
-
+
wxChildFocusEvent eventChildFocus(win);
(void)win->GetEventHandler()->ProcessEvent(eventChildFocus);
for (i = 0; i < (int)listbox->GetCount(); i++)
if (i != sel)
gtk_list_unselect_item( GTK_LIST(listbox->m_list), i );
-
+
listbox->m_blockEvent = FALSE;
-
+
return false;
}
#endif // wxUSE_CHECKLISTBOX
// Check or uncheck item with SPACE
- if ((gdk_event->keyval == ' ') && (!ret) &&
+ if ((gdk_event->keyval == ' ') && (!ret) &&
(((listbox->GetWindowStyleFlag() & wxLB_MULTIPLE) != 0) ||
((listbox->GetWindowStyleFlag() & wxLB_EXTENDED) != 0)) )
{
int sel = listbox->GtkGetIndex( widget );
-
+
if (sel != -1)
{
ret = TRUE;
-
+
if (listbox->IsSelected( sel ))
gtk_list_unselect_item( listbox->m_list, sel );
else
gtk_list_select_item( listbox->m_list, sel );
-
+
wxCommandEvent new_event(wxEVT_COMMAND_LISTBOX_SELECTED, listbox->GetId() );
new_event.SetEventObject( listbox );
wxArrayInt aSelections;
listbox->GetEventHandler()->ProcessEvent( new_event );
}
}
-
+
if (ret)
{
gtk_signal_emit_stop_by_name( GTK_OBJECT(widget), "key_press_event" );
{
if (g_isIdle)
wxapp_install_idle_handler();
-
+
GList *child = win->m_list->children;
for (child = win->m_list->children; child != NULL; child = child->next)
gtk_widget_show( GTK_WIDGET(child->data) );
-
+
return false;
}
}
gtk_signal_connect( GTK_OBJECT(m_list), "realize",
GTK_SIGNAL_FUNC(gtk_listbox_realized_callback), (gpointer) this );
-
+
if ( style & wxLB_SORT )
{
// this will change DoAppend() behaviour
if (GTK_WIDGET_REALIZED(m_widget))
{
gtk_widget_show( list_item );
-
+
gtk_widget_realize( list_item );
gtk_widget_realize( GTK_BIN(list_item)->child );
{
gtk_widget_modify_style( GTK_WIDGET( list_item ), style );
GtkBin *bin = GTK_BIN( list_item );
- GtkWidget *label = GTK_WIDGET( bin->child );
- gtk_widget_modify_style( label, style );
+ gtk_widget_modify_style( GTK_WIDGET( bin->child ), style );
gtk_rc_style_unref( style );
}
}
{
return TRUE;
-#if 0
+#if 0
if (m_widget->window == window) return TRUE;
if (GTK_WIDGET(m_list)->window == window) return TRUE;
lbHeight = (cy+4) * wxMin(wxMax(GetCount(), 3), 10);
wxSize best(lbWidth, lbHeight);
- CacheBestSize(best);
+ CacheBestSize(best);
return best;
}
int xScroll = GetScrollPos(wxHORIZONTAL);
if ( xScroll != xScrollOld )
{
- wxScrollWinEvent event(wxEVT_SCROLLWIN_THUMBTRACK, xScroll,
- wxHORIZONTAL);
- event.SetEventObject(this);
- GetEventHandler()->ProcessEvent(event);
+ wxScrollWinEvent eventS(wxEVT_SCROLLWIN_THUMBTRACK, xScroll,
+ wxHORIZONTAL);
+ eventS.SetEventObject(this);
+ GetEventHandler()->ProcessEvent(eventS);
}
int yScroll = GetScrollPos(wxVERTICAL);
if ( yScroll != yScrollOld )
{
- wxScrollWinEvent event(wxEVT_SCROLLWIN_THUMBTRACK, yScroll,
- wxVERTICAL);
- event.SetEventObject(this);
- GetEventHandler()->ProcessEvent(event);
+ wxScrollWinEvent eventS(wxEVT_SCROLLWIN_THUMBTRACK, yScroll,
+ wxVERTICAL);
+ eventS.SetEventObject(this);
+ GetEventHandler()->ProcessEvent(eventS);
}
}
GtkWidget *widget = gtk_button_new();
GtkStyle *def = gtk_rc_get_style( widget );
if ( !def || !def->font_desc )
- def = gtk_widget_get_default_style();
+ def = gtk_widget_get_default_style();
if ( def && def->font_desc )
- {
- wxNativeFontInfo info;
- info.description =
+ {
+ wxNativeFontInfo info;
+ info.description =
pango_font_description_copy(def->font_desc);
- gs_objects.m_fontSystem = wxFont(info);
- }
- else
- {
+ gs_objects.m_fontSystem = wxFont(info);
+ }
+ else
+ {
GtkSettings *settings = gtk_settings_get_default();
gchar *font_name = NULL;
g_object_get ( settings,
- "gtk-font-name",
+ "gtk-font-name",
&font_name,
NULL);
if (!font_name)
else
gs_objects.m_fontSystem = wxFont(wxString::FromAscii(font_name));
g_free (font_name);
- }
+ }
gtk_widget_destroy( widget );
#else
gs_objects.m_fontSystem = wxFont( 12, wxSWISS, wxNORMAL, wxNORMAL );
{
#ifdef __WXGTK20__
bool success = false;
-
+
guchar *data = NULL;
GdkWindow *window = NULL;
if(win && GTK_WIDGET_REALIZED(win->GetHandle()))
if (!gdk_net_wm_supports(gdk_atom_intern("_NET_FRAME_EXTENTS", false)))
return -1;
}
-
+
// Get the frame extents from the windowmanager.
// In most cases the top extent is the titlebar, so we use the bottom extent
// for the heights.
-
+
Atom type;
gint format;
gulong nitems;
-
+
#if GTK_CHECK_VERSION(2,2,0)
if (!gtk_check_version(2,2,0))
{
{
switch (index)
{
- case wxSYS_CAN_ICONIZE_FRAME:
- return FALSE;
- break;
+ case wxSYS_CAN_ICONIZE_FRAME:
+ return FALSE;
+
case wxSYS_CAN_DRAW_FRAME_DECORATIONS:
- return TRUE;
- break;
+ return TRUE;
+
default:
return FALSE;
}
{
wxToolBarToolsList::compatibility_iterator node
= wxToolBarToolsList::compatibility_iterator();
- if ( pos ) node = m_tools.Item(pos - 1);
+ if ( pos )
+ node = m_tools.Item(pos - 1);
while ( node )
{
- wxToolBarTool *tool = (wxToolBarTool *)node->GetData();
- if ( !tool->IsRadio() )
+ wxToolBarTool *toolNext = (wxToolBarTool *)node->GetData();
+ if ( !toolNext->IsRadio() )
break;
- widget = tool->m_item;
+ widget = toolNext->m_item;
node = node->GetPrevious();
}
gboolean include_internals,
GtkCallback callback,
gpointer callback_data);
-
+
static void gtk_pizza_allocate_child (GtkPizza *pizza,
GtkPizzaChild *child);
static void gtk_pizza_adjust_allocations_recurse (GtkWidget *widget,
static GtkContainerClass *pizza_parent_class = NULL;
#endif
+#ifndef __WXGTK20__
static gboolean gravity_works;
+#endif
GtkType
gtk_pizza_get_type ()
if (!pizza_type)
{
-
+
#ifdef __WXGTK20__
static const GTypeInfo pizza_info =
{
16, /* n_preallocs */
(GInstanceInitFunc) gtk_pizza_init,
};
- pizza_type = g_type_register_static (GTK_TYPE_CONTAINER, "GtkPizza", &pizza_info, 0);
+ pizza_type = g_type_register_static (GTK_TYPE_CONTAINER, "GtkPizza", &pizza_info, (GTypeFlags)0);
#else
GtkTypeInfo pizza_info =
{
child->x = x;
child->y = y;
-
+
if (GTK_WIDGET_VISIBLE (widget) && GTK_WIDGET_VISIBLE (pizza))
gtk_widget_queue_resize (widget);
break;
widget->style = gtk_style_attach (widget->style, widget->window);
gtk_style_set_background (widget->style, widget->window, GTK_STATE_NORMAL);
gtk_style_set_background (widget->style, pizza->bin_window, GTK_STATE_NORMAL );
-
+
/*
gdk_window_set_back_pixmap( widget->window, NULL, FALSE );
gdk_window_set_back_pixmap( pizza->bin_window, NULL, FALSE );
/* add filters for intercepting visibility and expose events */
gdk_window_add_filter (widget->window, gtk_pizza_main_filter, pizza);
gdk_window_add_filter (pizza->bin_window, gtk_pizza_filter, pizza);
-#endif
/* we NEED gravity or we'll give up */
gravity_works = gdk_window_set_static_gravities (pizza->bin_window, TRUE);
+#endif // !__WXGTK20__
/* cannot be done before realisation */
children = pizza->children;
#ifdef __WXGTK20__
(* GTK_WIDGET_CLASS (pizza_parent_class)->expose_event) (widget, event);
-
+
return FALSE;
-
+
#else
children = pizza->children;
gtk_widget_event (child->widget, (GdkEvent*) &child_event);
}
}
-
+
return TRUE;
-
+
#endif
}
if (pizza->bin_window)
gdk_window_scroll( pizza->bin_window, -dx, -dy );
-#else
+#else // !__WXGTK20__
GtkWidget *widget;
XEvent xevent;
XID win;
}
}
}
-#endif /* __WXGTK20__ */
+#endif /* __WXGTK20__/!__WXGTK20__ */
}
// hack: we need something to pass to gtk_menu_popup, so we store the time of
// the last click here
+#ifndef __WXGTK20__
static guint32 gs_timeLastClick = 0;
+#endif
extern bool g_mainThreadLocked;
if ( btnCancel )
{
- wxCommandEvent event(wxEVT_COMMAND_BUTTON_CLICKED, wxID_CANCEL);
- event.SetEventObject(btnCancel);
- ret = btnCancel->GetEventHandler()->ProcessEvent(event);
+ wxCommandEvent eventClick(wxEVT_COMMAND_BUTTON_CLICKED, wxID_CANCEL);
+ eventClick.SetEventObject(btnCancel);
+ ret = btnCancel->GetEventHandler()->ProcessEvent(eventClick);
}
}
if ( !g_captureWindow )
win = FindWindowForMouseEvent(win, event.m_x, event.m_y);
+#ifndef __WXGTK20__
gs_timeLastClick = gdk_event->time;
-#ifndef __WXGTK20__
if (event_type == wxEVT_LEFT_DCLICK)
{
// GTK 1.2 crashes when intercepting double
return FALSE;
}
}
-#endif
+#endif // !__WXGTK20__
if (win->GetEventHandler()->ProcessEvent( event ))
{
// the mouse changed window
g_captureWindowHasMouse = hasMouse;
- wxMouseEvent event(g_captureWindowHasMouse ? wxEVT_ENTER_WINDOW
- : wxEVT_LEAVE_WINDOW);
- InitMouseEvent(win, event, gdk_event);
- event.SetEventObject(win);
- win->GetEventHandler()->ProcessEvent(event);
+ wxMouseEvent eventM(g_captureWindowHasMouse ? wxEVT_ENTER_WINDOW
+ : wxEVT_LEAVE_WINDOW);
+ InitMouseEvent(win, eventM, gdk_event);
+ eventM.SetEventObject(win);
+ win->GetEventHandler()->ProcessEvent(eventM);
}
}
else // no capture
}
else
{
- int cnt = 0;
+ int cnt2 = 0;
wxHtmlHelpDataItem *parent = m_index[i].parent;
for (int j = i-1; j >= 0; j--)
{
if (m_index[j].book == book && m_index[j].level > 0)
- cnt++;
+ cnt2++;
if (&m_index[j] == parent)
break;
}
- wxASSERT(cnt > 0);
- CacheWriteInt32(f, cnt);
+ wxASSERT(cnt2 > 0);
+ CacheWriteInt32(f, cnt2);
}
}
return true;
return;
}
- wxHtmlCell *cell = m_Cells,
- *line = m_Cells;
wxHtmlCell *nextCell;
long xpos = 0, ypos = m_IndentTop;
int xdelta = 0, ybasicpos = 0, ydiff;
s_width = m_Width - s_indent - ((m_IndentRight < 0) ? (-m_IndentRight * m_Width / 100) : m_IndentRight);
// my own layouting:
+ wxHtmlCell *cell = m_Cells,
+ *line = m_Cells;
while (cell != NULL)
{
switch (m_AlignVer)
};
WX_DECLARE_OBJARRAY(wxHtmlTextPiece, wxHtmlTextPieces);
-WX_DEFINE_OBJARRAY(wxHtmlTextPieces);
+WX_DEFINE_OBJARRAY(wxHtmlTextPieces)
class wxHtmlParserState
{
//-----------------------------------------------------------------------------
WX_DECLARE_OBJARRAY(wxHtmlHistoryItem, wxHtmlHistoryArray);
-WX_DEFINE_OBJARRAY(wxHtmlHistoryArray);
+WX_DEFINE_OBJARRAY(wxHtmlHistoryArray)
WX_DECLARE_LIST(wxHtmlProcessor, wxHtmlProcessorList);
-WX_DEFINE_LIST(wxHtmlProcessorList);
+WX_DEFINE_LIST(wxHtmlProcessorList)
//-----------------------------------------------------------------------------
// wxHtmlWindow
WX_DECLARE_OBJARRAY(int, CoordArray);
#include "wx/arrimpl.cpp" // this is a magic incantation which must be done!
-WX_DEFINE_OBJARRAY(CoordArray);
+WX_DEFINE_OBJARRAY(CoordArray)
// ---------------------------------------------------------------------------
}
if (cel != NULL && tag.HasParam(wxT("HREF")))
{
- wxString tmp = tag.GetParam(wxT("HREF"));
- wxString target = wxEmptyString;
- if (tag.HasParam(wxT("TARGET"))) target = tag.GetParam(wxT("TARGET"));
- cel->SetLink( wxHtmlLinkInfo(tmp, target));
+ wxString target;
+ if (tag.HasParam(wxT("TARGET")))
+ target = tag.GetParam(wxT("TARGET"));
+ cel->SetLink(wxHtmlLinkInfo(tag.GetParam(wxT("HREF")), target));
}
- if (cel != NULL) m_WParser->GetContainer()->InsertCell( cel );
+ if (cel != NULL)
+ m_WParser->GetContainer()->InsertCell( cel );
}
}
#pragma message enable nosimpint
#endif
+#include "wx/unix/private.h"
#include "wx/motif/private.h"
static bool CheckForKeyUp(XEvent* event);
timeout.tv_sec = 0;
timeout.tv_usec = 0;
- FD_ZERO( &in );
- FD_SET( *fd, &in );
+ wxFD_ZERO( &in );
+ wxFD_SET( *fd, &in );
if( select( *fd + 1, &in, NULL, NULL, &timeout ) <= 0 )
break;
timeout.tv_sec = 0;
timeout.tv_usec = 0;
- FD_ZERO( &in );
- FD_SET( idleFds[0], &in );
+ wxFD_ZERO( &in );
+ wxFD_SET( idleFds[0], &in );
if( select( idleFds[0] + 1, &in, NULL, NULL, &timeout ) > 0 )
return;
wxDynamicLibraryDetails *details = new wxDynamicLibraryDetails;
details->m_path = path;
details->m_name = path.AfterLast(_T('/'));
- details->m_address = wx_reinterpret_cast(void *, start);
+ details->m_address = wxUIntToPtr(start);
details->m_length = end - start;
// try to extract the library version from its name
extern GtkWidget *wxGetRootWindow();
#endif
-static int
-cmp_families (const void *a, const void *b)
+extern "C" int wxCMPFUNC_CONV
+wxCompareFamilies (const void *a, const void *b)
{
const char *a_name = pango_font_family_get_name (*(PangoFontFamily **)a);
const char *b_name = pango_font_family_get_name (*(PangoFontFamily **)b);
wxTheApp->GetPangoContext(),
#endif
&families, &n_families );
- qsort (families, n_families, sizeof (PangoFontFamily *), cmp_families);
+ qsort (families, n_families, sizeof (PangoFontFamily *), wxCompareFamilies);
for (int i=0; i<n_families; i++)
{
* -------------------------------------------------------------------------
*/
-/*
- * PLEASE don't put C++ comments here - this is a C source file.
- */
-
#if defined(__WATCOMC__)
#include "wx/wxprec.h"
#include <errno.h>
#ifndef __GSOCKET_STANDALONE__
# include "wx/unix/gsockunx.h"
+# include "wx/unix/private.h"
# include "wx/gsocket.h"
#else
# include "gsockunx.h"
* non-blocking, it just shouldn't be called prior to knowing there is a
* connection _if_ blocking sockets are being used.
* If connect above returns 0, we are already connected and need to make the
- * call to Enable_Events now.
+ * call to Enable_Events now.
*/
-
+
if (m_non_blocking || ret == 0)
{
gs_gui_functions->Enable_Events(this);
if (m_fd == -1)
return (GSOCK_LOST_FLAG & flags);
-
+
/* Do not use a static struct, Linux can garble it */
tv.tv_sec = m_timeout / 1000;
tv.tv_usec = (m_timeout % 1000) * 1000;
- FD_ZERO(&readfds);
- FD_ZERO(&writefds);
- FD_ZERO(&exceptfds);
- FD_SET(m_fd, &readfds);
+ wxFD_ZERO(&readfds);
+ wxFD_ZERO(&writefds);
+ wxFD_ZERO(&exceptfds);
+ wxFD_SET(m_fd, &readfds);
if (flags & GSOCK_OUTPUT_FLAG || flags & GSOCK_CONNECTION_FLAG)
- FD_SET(m_fd, &writefds);
- FD_SET(m_fd, &exceptfds);
+ wxFD_SET(m_fd, &writefds);
+ wxFD_SET(m_fd, &exceptfds);
/* Check 'sticky' CONNECTION flag first */
result |= (GSOCK_CONNECTION_FLAG & m_detected);
}
/* Check for readability */
- if (FD_ISSET(m_fd, &readfds))
+ if (wxFD_ISSET(m_fd, &readfds))
{
char c;
}
/* Check for writability */
- if (FD_ISSET(m_fd, &writefds))
+ if (wxFD_ISSET(m_fd, &writefds))
{
if (m_establishing && !m_server)
{
}
/* Check for exceptions and errors (is this useful in Unices?) */
- if (FD_ISSET(m_fd, &exceptfds))
+ if (wxFD_ISSET(m_fd, &exceptfds))
{
m_establishing = false;
m_detected = GSOCK_LOST_FLAG;
if (!m_non_blocking)
{
- FD_ZERO(&readfds);
- FD_SET(m_fd, &readfds);
+ wxFD_ZERO(&readfds);
+ wxFD_SET(m_fd, &readfds);
ret = select(m_fd + 1, &readfds, NULL, NULL, &tv);
if (ret == 0)
{
if (!m_non_blocking)
{
- FD_ZERO(&writefds);
- FD_SET(m_fd, &writefds);
+ wxFD_ZERO(&writefds);
+ wxFD_SET(m_fd, &writefds);
ret = select(m_fd + 1, NULL, &writefds, NULL, &tv);
if (ret == 0)
{
m_error = GSOCK_TIMEDOUT;
return GSOCK_TIMEDOUT;
}
- if ( ! FD_ISSET(m_fd, &writefds) ) {
+ if ( ! wxFD_ISSET(m_fd, &writefds) ) {
GSocket_Debug(( "GSocket_Output_Timeout is buggy!\n" ));
}
else {
#include "wx/event.h"
#include "wx/window.h"
+#include "wx/unix/private.h"
enum {
wxJS_AXIS_X = 0,
fd_set read_fds;
struct timeval time_out = {0, 0};
- FD_ZERO(&read_fds);
+ wxFD_ZERO(&read_fds);
while (true)
{
if (TestDestroy())
else
time_out.tv_usec = 10 * 1000; // check at least every 10 msec in blocking case
- FD_SET(m_device, &read_fds);
+ wxFD_SET(m_device, &read_fds);
select(m_device+1, &read_fds, NULL, NULL, &time_out);
- if (FD_ISSET(m_device, &read_fds))
+ if (wxFD_ISSET(m_device, &read_fds))
{
memset(&j_evt, 0, sizeof(j_evt));
read(m_device, &j_evt, sizeof(j_evt));
// could adjust the code to ask confirmation if it already exists and
// overwriteprompt is true, but this is currently ignored as *Associate* has
// no overwrite prompt
-bool wxFileTypeImpl::SetCommand(const wxString& cmd, const wxString& verb, bool overwriteprompt /*= true*/)
+bool
+wxFileTypeImpl::SetCommand(const wxString& cmd,
+ const wxString& verb,
+ bool WXUNUSED(overwriteprompt))
{
wxArrayString strExtensions;
wxString strDesc, strIcon;
}
// ignore index on the grouds that we only have one icon in a Unix file
-bool wxFileTypeImpl::SetDefaultIcon(const wxString& strIcon /*= wxEmptyString*/, int /*index = 0*/)
+bool wxFileTypeImpl::SetDefaultIcon(const wxString& strIcon, int WXUNUSED(index))
{
if (strIcon.empty()) return false;
wxArrayString strExtensions;
wxLogTrace(TRACE_THREADS,
_T("Thread %ld Entry() returned %lu."),
- THR_ID(pthread), (unsigned long)pthread->m_exitcode);
+ THR_ID(pthread), wxPtrToUInt(pthread->m_exitcode));
{
wxCriticalSectionLocker lock(thread->m_critsect);
case STATE_PAUSED:
#ifdef HAVE_THREAD_PRIORITY_FUNCTIONS
#if defined(__LINUX__)
-// On Linux, pthread_setschedparam with SCHED_OTHER does not allow
-// a priority other than 0. Instead, we use the BSD setpriority
-// which alllows us to set a 'nice' value between 20 to -20. Only
-// super user can set a value less than zero (more negative yields
-// higher priority). setpriority set the static priority of a process,
-// but this is OK since Linux is configured as a thread per process.
- {
- float fPrio;
- float pSpan;
- int iPrio;
-
- // Map Wx priorites (WXTHREAD_MIN_PRIORITY -
- // WXTHREAD_MAX_PRIORITY) into BSD priorities (20 - -20).
- // Do calculation of values instead of hard coding them
- // to make maintenance easier.
-
- pSpan = ((float)(WXTHREAD_MAX_PRIORITY - WXTHREAD_MIN_PRIORITY)) / 2.0;
-
- // prio starts as ................... // value => (0) >= p <= (n)
-
- fPrio = ((float)prio) - pSpan; // value => (-n) >= p <= (+n)
-
- fPrio = 0.0 - fPrio; // value => (+n) <= p >= (-n)
-
- fPrio = fPrio * (20. / pSpan) + .5; // value => (20) <= p >= (-20)
-
- iPrio = (int)fPrio;
-
- // Clamp prio from 20 - -20;
- iPrio = (iPrio > 20) ? 20 : iPrio;
- iPrio = (iPrio < -20) ? -20 : iPrio;
+ // On Linux, pthread_setschedparam with SCHED_OTHER does not allow
+ // a priority other than 0. Instead, we use the BSD setpriority
+ // which alllows us to set a 'nice' value between 20 to -20. Only
+ // super user can set a value less than zero (more negative yields
+ // higher priority). setpriority set the static priority of a
+ // process, but this is OK since Linux is configured as a thread
+ // per process.
+ //
+ // FIXME this is not true for 2.6!!
- if (setpriority(PRIO_PROCESS, 0, iPrio) == -1)
- {
- wxLogError(_("Failed to set thread priority %d."), prio);
- }
+ // map wx priorites WXTHREAD_MIN_PRIORITY..WXTHREAD_MAX_PRIORITY
+ // to Unix priorities 20..-20
+ if ( setpriority(PRIO_PROCESS, 0, -(2*prio)/5 + 20) == -1 )
+ {
+ wxLogError(_("Failed to set thread priority %d."), prio);
}
#else // __LINUX__
{
if ( m_internal->GetState() != STATE_EXITED &&
m_internal->GetState() != STATE_NEW )
{
- wxLogDebug(_T("The thread %ld is being destroyed although it is still running! The application may crash."), GetId());
+ wxLogDebug(_T("The thread %ld is being destroyed although it is still running! The application may crash."),
+ (long)GetId());
}
m_critsect.Leave();
// headers
// ----------------------------------------------------------------------------
-#include <pwd.h>
-
// for compilers that support precompilation, includes "wx.h".
#include "wx/wxprec.h"
#include "wx/wfstream.h"
#include "wx/unix/execute.h"
+#include "wx/unix/private.h"
+
+#include <pwd.h>
#if wxUSE_STREAMS
const int fd = m_file->fd();
fd_set readfds;
- FD_ZERO(&readfds);
- FD_SET(fd, &readfds);
+
+ wxFD_ZERO(&readfds);
+ wxFD_SET(fd, &readfds);
+
switch ( select(fd + 1, &readfds, NULL, NULL, &tv) )
{
case -1:
// wxExecute: the real worker function
// ----------------------------------------------------------------------------
-#ifdef __VMS
- #pragma message disable codeunreachable
-#endif
-
-long wxExecute(wxChar **argv,
- int flags,
- wxProcess *process)
+long wxExecute(wxChar **argv, int flags, wxProcess *process)
{
// for the sync execution, we return -1 to indicate failure, but for async
// case we return 0 which is never a valid PID
}
execvp (*mb_argv, mb_argv);
-
+
fprintf(stderr, "execvp(");
// CS changed ppc to ppc_ as ppc is not available under mac os CW Mach-O
for ( char **ppc_ = mb_argv; *ppc_; ppc_++ )
return traits->WaitForChild(execData);
}
+#if !defined(__VMS) && !defined(__INTEL_COMPILER)
return ERROR_RETURN_CODE;
-}
-
-#ifdef __VMS
- #pragma message enable codeunreachable
#endif
+}
#undef ERROR_RETURN_CODE
#undef ARGS_CLEANUP
if (name == 0) name = XInternAtom((display), #name, False)
+// X11 Window is an int type, so use the macro to suppress warnings when
+// converting to it
+#define WindowCast(w) (Window)(wxPtrToUInt(w))
+
// Is the window mapped?
static bool IsMapped(Display *display, Window window)
{
}
XChangeProperty( (Display*)display,
- (Window)window,
+ WindowCast(window),
_NET_WM_ICON,
XA_CARDINAL, 32,
PropModeReplace,
else
{
XDeleteProperty( (Display*)display,
- (Window)window,
+ WindowCast(window),
_NET_WM_ICON );
}
-#endif
+#endif // !wxUSE_NANOX
}
// fullscreen is to remove decorations, resize it to cover entire screen
// and set WIN_LAYER_ABOVE_DOCK.
//
-// This doesn't always work, though. Specifically, at least kwin from
+// This doesn't always work, though. Specifically, at least kwin from
// KDE 3 ignores the hint. The only way to make kwin accept our request
// is to emulate the way Qt does it. That is, unmap the window, set
// _NET_WM_WINDOW_TYPE to _KDE_NET_WM_WINDOW_TYPE_OVERRIDE (KDE extension),
// window state which provides cleanest and simplest possible way of
// making a window fullscreen. WM-spec is a de-facto standard adopted
// by GNOME and KDE folks, but _NET_WM_STATE_FULLSCREEN isn't yet widely
-// supported. As of January 2003, only GNOME 2's default WM Metacity
+// supported. As of January 2003, only GNOME 2's default WM Metacity
// implements, KDE will support it from version 3.2. At toolkits level,
// GTK+ >= 2.1.2 uses it as the only method of making windows fullscreen
// (that's why wxGTK will *not* switch to using gtk_window_fullscreen
// unless it has better compatibility with older WMs).
//
-//
+//
// This is what wxWidgets does in wxSetFullScreenStateX11:
// 1) if _NET_WM_STATE_FULLSCREEN is supported, use it
// 2) otherwise try WM-specific hacks (KDE, IceWM)
Window window, int layer)
{
wxX11ErrorsSuspender noerrors(display);
-
+
XEvent xev;
wxMAKE_ATOM( _WIN_LAYER, display );
{
wxMAKE_ATOM(_NET_SUPPORTING_WM_CHECK, display);
wxMAKE_ATOM(_NET_SUPPORTED, display);
-
+
// FIXME: We may want to cache these checks. Note that we can't simply
// remember the results in global variable because the WM may go
// away and be replaced by another one! One possible approach
// is replaced by another one). This is what GTK+ 2 does.
// Let's do it only if it is needed, it requires changes to
// the event loop.
-
+
Atom type;
Window *wins;
Atom *atoms;
int format;
unsigned long after;
unsigned long nwins, natoms;
-
+
// Is the WM ICCCM supporting?
XGetWindowProperty(display, rootWnd,
_NET_SUPPORTING_WM_CHECK, 0, LONG_MAX,
Window window, int operation, Atom state)
{
wxMAKE_ATOM(_NET_WM_STATE, display);
-
+
if ( IsMapped(display, window) )
{
XEvent xev;
xev.xclient.data.l[0] = operation;
xev.xclient.data.l[1] = state;
xev.xclient.data.l[2] = None;
-
+
XSendEvent(display, rootWnd,
False,
SubstructureRedirectMask | SubstructureNotifyMask,
static bool wxKwinRunning(Display *display, Window rootWnd)
{
wxMAKE_ATOM(KWIN_RUNNING, display);
-
+
long *data;
Atom type;
int format;
return retval;
}
-// KDE's kwin is Qt-centric so much than no normal method of fullscreen
+// KDE's kwin is Qt-centric so much than no normal method of fullscreen
// mode will work with it. We have to carefully emulate the Qt way.
static void wxSetKDEFullscreen(Display *display, Window rootWnd,
Window w, bool fullscreen, wxRect *origRect)
// it is necessary to unmap the window, otherwise kwin will ignore us:
XSync(display, False);
-
+
bool wasMapped = IsMapped(display, w);
if (wasMapped)
{
}
XChangeProperty(display, w, _NET_WM_WINDOW_TYPE, XA_ATOM, 32,
- PropModeReplace, (unsigned char *) &data, lng);
+ PropModeReplace, (unsigned char *) &data, lng);
XSync(display, False);
if (wasMapped)
XMapRaised(display, w);
XSync(display, False);
}
-
- wxWMspecSetState(display, rootWnd, w,
+
+ wxWMspecSetState(display, rootWnd, w,
fullscreen ? _NET_WM_STATE_ADD : _NET_WM_STATE_REMOVE,
_NET_WM_STATE_STAYS_ON_TOP);
XSync(display, False);
// NB: like many other WMs, kwin ignores the first request for a window
// position change after the window was mapped. This additional
// move+resize event will ensure that the window is restored in
- // exactly the same position as before it was made fullscreen
- // (because wxTopLevelWindow::ShowFullScreen will call SetSize, thus
+ // exactly the same position as before it was made fullscreen
+ // (because wxTopLevelWindow::ShowFullScreen will call SetSize, thus
// setting the position for the second time).
XMoveResizeWindow(display, w,
origRect->x, origRect->y,
wxX11FullScreenMethod wxGetFullScreenMethodX11(WXDisplay* display,
WXWindow rootWindow)
{
- Window root = (Window)rootWindow;
+ Window root = WindowCast(rootWindow);
Display *disp = (Display*)display;
// if WM supports _NET_WM_STATE_FULLSCREEN from wm-spec 1.2, use it:
_T("detected _NET_WM_STATE_FULLSCREEN support"));
return wxX11_FS_WMSPEC;
}
-
+
// if the user is running KDE's kwin WM, use a legacy hack because
// kwin doesn't understand any other method:
if (wxKwinRunning(disp, root))
wxLogTrace(_T("fullscreen"), _T("detected kwin"));
return wxX11_FS_KDE;
}
-
+
// finally, fall back to ICCCM heuristic method:
wxLogTrace(_T("fullscreen"), _T("unknown WM, using _WIN_LAYER"));
return wxX11_FS_GENERIC;
// NB: please see the comment under "Fullscreen mode:" title above
// for implications of changing this code.
- Window wnd = (Window)window;
- Window root = (Window)rootWindow;
+ Window wnd = WindowCast(window);
+ Window root = WindowCast(rootWindow);
Display *disp = (Display*)display;
if (method == wxX11_FS_AUTODETECT)
case XK_Control_L:
case XK_Control_R:
id = WXK_CONTROL; break;
- case XK_Meta_L:
+ case XK_Meta_L:
case XK_Meta_R:
id = WXK_ALT; break;
case XK_BackSpace:
case WXK_RETURN: keySym = XK_Return; break;
case WXK_SHIFT: keySym = XK_Shift_L; break;
case WXK_CONTROL: keySym = XK_Control_L; break;
- case WXK_ALT: keySym = XK_Meta_L; break;
+ case WXK_ALT: keySym = XK_Meta_L; break;
case WXK_MENU : keySym = XK_Menu; break;
case WXK_PAUSE: keySym = XK_Pause; break;
case WXK_ESCAPE: keySym = XK_Escape; break;
#else
#error Add code to get the DISPLAY for this platform
#endif
-
+
int iKey = wxCharCodeWXToX(key);
int iKeyMask = 0;
Window wDummy1, wDummy2;
KeyCode keyCode = XKeysymToKeycode(pDisplay,iKey);
if (keyCode == NoSymbol)
return false;
-
+
for (int i = 0; i < 8; ++i)
{
if ( map->modifiermap[map->max_keypermod * i] == keyCode)
iKeyMask = 1 << i;
}
}
-
+
XQueryPointer(pDisplay, DefaultRootWindow(pDisplay), &wDummy1, &wDummy2,
&iDummy3, &iDummy4, &iDummy5, &iDummy6, &iMask );
XFreeModifiermap(map);
return (iMask & iKeyMask) != 0;
}
-#endif
+#endif // __WXX11__ || __WXGTK__ || __WXMOTIF__
#include "wx/timer.h"
#include "wx/hash.h"
#include "wx/module.h"
+#include "wx/unix/private.h"
#include "wx/x11/private.h"
#include "X11/Xlib.h"
if (entry->m_fdInput != -1)
{
- FD_SET(entry->m_fdInput, readset);
+ wxFD_SET(entry->m_fdInput, readset);
if (entry->m_fdInput > *highest)
* highest = entry->m_fdInput;
}
if (entry->m_fdOutput != -1)
{
- FD_SET(entry->m_fdOutput, writeset);
+ wxFD_SET(entry->m_fdOutput, writeset);
if (entry->m_fdOutput > *highest)
* highest = entry->m_fdOutput;
}
{
wxSocketTableEntry* entry = (wxSocketTableEntry*) node->GetData();
- if (entry->m_fdInput != -1 && FD_ISSET(entry->m_fdInput, readset))
+ if (entry->m_fdInput != -1 && wxFD_ISSET(entry->m_fdInput, readset))
{
(entry->m_callbackInput) (entry->m_fdInput, entry->m_dataInput);
}
- if (entry->m_fdOutput != -1 && FD_ISSET(entry->m_fdOutput, writeset))
+ if (entry->m_fdOutput != -1 && wxFD_ISSET(entry->m_fdOutput, writeset))
{
(entry->m_callbackOutput) (entry->m_fdOutput, entry->m_dataOutput);
}
fd_set readset;
fd_set writeset;
int highest = fd;
- FD_ZERO(&readset);
- FD_ZERO(&writeset);
+ wxFD_ZERO(&readset);
+ wxFD_ZERO(&writeset);
- FD_SET(fd, &readset);
+ wxFD_SET(fd, &readset);
#if wxUSE_SOCKETS
if (wxTheSocketTable)
else
{
// An X11 event was pending, so get it
- if (FD_ISSET( fd, &readset ))
+ if (wxFD_ISSET( fd, &readset ))
XNextEvent( wxGlobalDisplay(), &event );
#if wxUSE_SOCKETS
#include "wx/xrc/xmlres.h"
#include "wx/arrimpl.cpp"
-WX_DEFINE_OBJARRAY(wxXmlResourceDataRecords);
+WX_DEFINE_OBJARRAY(wxXmlResourceDataRecords)
wxXmlResource *wxXmlResource::ms_instance = NULL;
#include "wx/listimpl.cpp"
WX_DECLARE_LIST(wxXmlSubclassFactory, wxXmlSubclassFactoriesList);
-WX_DEFINE_LIST(wxXmlSubclassFactoriesList);
+WX_DEFINE_LIST(wxXmlSubclassFactoriesList)
wxXmlSubclassFactoriesList *wxXmlResource::ms_subclassFactories = NULL;
setlocale(LC_NUMERIC, prevlocale);
#endif
- return value;
+ return wx_truncate_cast(float, value);
}
#include "wx/arrimpl.cpp"
WX_DECLARE_OBJARRAY(XRCWidgetData,ArrayOfXRCWidgetData);
-WX_DEFINE_OBJARRAY(ArrayOfXRCWidgetData);
+WX_DEFINE_OBJARRAY(ArrayOfXRCWidgetData)
class XRCWndClassData
{
};
};
WX_DECLARE_OBJARRAY(XRCWndClassData,ArrayOfXRCWndClassData);
-WX_DEFINE_OBJARRAY(ArrayOfXRCWndClassData);
+WX_DEFINE_OBJARRAY(ArrayOfXRCWndClassData)
class XmlResApp : public wxAppConsole
wxFFile file(filename, wxT("rb"));
wxFileOffset offset = file.Length();
wxASSERT_MSG( offset >= 0 , wxT("Invalid file length") );
- wxASSERT_MSG( offset == wxFileOffset(size_t(offset)) , wxT("Huge file not supported") );
- size_t lng = (size_t)offset;
+
+ const size_t lng = wx_truncate_cast(size_t, offset);
+ wxASSERT_MSG( lng == offset, wxT("Huge file not supported") );
snum.Printf(_T("%i"), num);
output.Printf(_T("static size_t xml_res_size_") + snum + _T(" = %i;\n"), lng);
wxFFile file(filename, wxT("rb"));
wxFileOffset offset = file.Length();
wxASSERT_MSG( offset >= 0 , wxT("Invalid file length") );
- wxASSERT_MSG( offset == wxFileOffset(size_t(offset)) , wxT("Huge file not supported") );
- size_t lng = (size_t)offset;
+
+ const size_t lng = wx_truncate_cast(size_t, offset);
+ wxASSERT_MSG( offset == lng, wxT("Huge file not supported") );
snum.Printf(_T("%i"), num);
output = _T(" xml_res_file_") + snum + _T(" = '''\\\n");