Corrections for future OW 1.4. Warning fixes.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@34935 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Włodzimierz Skiba
2005-07-26 09:05:27 +00:00
parent e4592d6028
commit c40158e40b
6 changed files with 106 additions and 92 deletions

View File

@@ -573,7 +573,7 @@ typedef int wxWindowID;
#define except(x) catch(...) #define except(x) catch(...)
#endif /* Metrowerks */ #endif /* Metrowerks */
#if defined(__WATCOMC__) #if defined(__WATCOMC__) && (__WATCOMC__ < 1240)
typedef short mode_t; typedef short mode_t;
#endif #endif
@@ -963,6 +963,9 @@ inline void *wxUIntToPtr(wxUIntPtr p)
#if defined(__PALMOS__) && !defined(HAVE_SSIZE_T) #if defined(__PALMOS__) && !defined(HAVE_SSIZE_T)
#define HAVE_SSIZE_T #define HAVE_SSIZE_T
#endif #endif
#if defined(__WATCOMC__) && __WATCOMC__ > 1230
#define HAVE_SSIZE_T
#endif
#ifndef HAVE_SSIZE_T #ifndef HAVE_SSIZE_T
#if SIZEOF_SIZE_T == 4 #if SIZEOF_SIZE_T == 4
typedef wxInt32 ssize_t; typedef wxInt32 ssize_t;

View File

@@ -51,81 +51,82 @@ public:
class WXDLLEXPORT wxMetafile: public wxGDIObject class WXDLLEXPORT wxMetafile: public wxGDIObject
{ {
DECLARE_DYNAMIC_CLASS(wxMetafile) DECLARE_DYNAMIC_CLASS(wxMetafile)
public: public:
// Copy constructor // Copy constructor
inline wxMetafile(const wxMetafile& metafile) inline wxMetafile(const wxMetafile& metafile)
{ Ref(metafile); } { Ref(metafile); }
wxMetafile(const wxString& file = wxEmptyString); wxMetafile(const wxString& file = wxEmptyString);
~wxMetafile(void); ~wxMetafile(void);
// After this is called, the metafile cannot be used for anything // After this is called, the metafile cannot be used for anything
// since it is now owned by the clipboard. // since it is now owned by the clipboard.
virtual bool SetClipboard(int width = 0, int height = 0); virtual bool SetClipboard(int width = 0, int height = 0);
virtual bool Play(wxDC *dc); virtual bool Play(wxDC *dc);
inline bool Ok(void) const { return (M_METAFILEDATA && (M_METAFILEDATA->m_metafile != 0)); }; inline bool Ok(void) const { return (M_METAFILEDATA && (M_METAFILEDATA->m_metafile != 0)); };
// Implementation // Implementation
inline WXHANDLE GetHMETAFILE(void) { return M_METAFILEDATA->m_metafile; } inline WXHANDLE GetHMETAFILE(void) { return M_METAFILEDATA->m_metafile; }
void SetHMETAFILE(WXHANDLE mf) ; void SetHMETAFILE(WXHANDLE mf) ;
inline int GetWindowsMappingMode(void) { return M_METAFILEDATA->m_windowsMappingMode; } inline int GetWindowsMappingMode(void) { return M_METAFILEDATA->m_windowsMappingMode; }
void SetWindowsMappingMode(int mm); void SetWindowsMappingMode(int mm);
// Operators // Operators
inline wxMetafile& operator = (const wxMetafile& metafile) inline wxMetafile& operator = (const wxMetafile& metafile)
{ if (*this == metafile) return (*this); Ref(metafile); return *this; } { if (*this == metafile) return (*this); Ref(metafile); return *this; }
inline bool operator== (const wxMetafile& metafile) const inline bool operator== (const wxMetafile& metafile) const
{ return m_refData == metafile.m_refData; } { return m_refData == metafile.m_refData; }
inline bool operator!= (const wxMetafile& metafile) const inline bool operator!= (const wxMetafile& metafile) const
{ return m_refData != metafile.m_refData; } { return m_refData != metafile.m_refData; }
protected:
}; };
class WXDLLEXPORT wxMetafileDC: public wxDC class WXDLLEXPORT wxMetafileDC: public wxDC
{ {
DECLARE_DYNAMIC_CLASS(wxMetafileDC) DECLARE_DYNAMIC_CLASS(wxMetafileDC)
public: public:
// Don't supply origin and extent // Don't supply origin and extent
// Supply them to wxMakeMetaFilePlaceable instead. // Supply them to wxMakeMetaFilePlaceable instead.
wxMetafileDC(const wxString& file = wxEmptyString); wxMetafileDC(const wxString& file = wxEmptyString);
// Supply origin and extent (recommended). // Supply origin and extent (recommended).
// Then don't need to supply them to wxMakeMetaFilePlaceable. // Then don't need to supply them to wxMakeMetaFilePlaceable.
wxMetafileDC(const wxString& file, int xext, int yext, int xorg, int yorg); wxMetafileDC(const wxString& file, int xext, int yext, int xorg, int yorg);
~wxMetafileDC(void); ~wxMetafileDC(void);
// Should be called at end of drawing // Should be called at end of drawing
virtual wxMetafile *Close(void); virtual wxMetafile *Close(void);
virtual void SetMapMode(int mode); virtual void SetMapMode(int mode);
virtual void GetTextExtent(const wxString& string, long *x, long *y, virtual void GetTextExtent(const wxString& string, long *x, long *y,
long *descent = NULL, long *externalLeading = NULL, long *descent = NULL, long *externalLeading = NULL,
wxFont *theFont = NULL, bool use16bit = FALSE) const; wxFont *theFont = NULL, bool use16bit = false) const;
// Implementation // Implementation
inline wxMetafile *GetMetaFile(void) const { return m_metaFile; } inline wxMetafile *GetMetaFile(void) const { return m_metaFile; }
inline void SetMetaFile(wxMetafile *mf) { m_metaFile = mf; } inline void SetMetaFile(wxMetafile *mf) { m_metaFile = mf; }
inline int GetWindowsMappingMode(void) const { return m_windowsMappingMode; } inline int GetWindowsMappingMode(void) const { return m_windowsMappingMode; }
inline void SetWindowsMappingMode(int mm) { m_windowsMappingMode = mm; } inline void SetWindowsMappingMode(int mm) { m_windowsMappingMode = mm; }
protected: protected:
int m_windowsMappingMode; int m_windowsMappingMode;
wxMetafile* m_metaFile; wxMetafile* m_metaFile;
private: private:
// function hiding warning supression #ifndef __WATCOMC__
inline virtual void GetTextExtent( const wxString& string // function hiding warning supression
,long* width // still required ??
,long* height inline virtual void GetTextExtent( const wxString& string
,long* descent = NULL ,long* width
,long* externalLeading = NULL ,long* height
,wxFont* theFont = NULL ,long* descent = NULL
) const ,long* externalLeading = NULL
{ GetTextExtent( string, width, height, descent, externalLeading, theFont, FALSE);}; ,wxFont* theFont = NULL
) const
{ GetTextExtent( string, width, height, descent, externalLeading, theFont, false);};
#endif
}; };
/* /*
@@ -140,7 +141,14 @@ private:
bool WXDLLEXPORT wxMakeMetafilePlaceable(const wxString& filename, float scale = 1.0); bool WXDLLEXPORT wxMakeMetafilePlaceable(const wxString& filename, float scale = 1.0);
// Optional origin and extent // Optional origin and extent
bool WXDLLEXPORT wxMakeMetaFilePlaceable(const wxString& filename, int x1, int y1, int x2, int y2, float scale = 1.0, bool useOriginAndExtent = TRUE); bool WXDLLEXPORT wxMakeMetaFilePlaceable( const wxString& filename
,int x1
,int y1
,int x2
,int y2
,float scale = 1.0
,bool useOriginAndExtent = true
);
// ---------------------------------------------------------------------------- // ----------------------------------------------------------------------------
// wxMetafileDataObject is a specialization of wxDataObject for metafile data // wxMetafileDataObject is a specialization of wxDataObject for metafile data
@@ -153,39 +161,40 @@ bool WXDLLEXPORT wxMakeMetaFilePlaceable(const wxString& filename, int x1, int y
class WXDLLEXPORT wxMetafileDataObject : public wxDataObject class WXDLLEXPORT wxMetafileDataObject : public wxDataObject
{ {
public: public:
// ctors // ctors
wxMetafileDataObject() { m_width = 0; m_height = 0; }; wxMetafileDataObject() { m_width = 0; m_height = 0; };
wxMetafileDataObject(const wxMetafile& metafile, int width = 0, int height = 0): wxMetafileDataObject(const wxMetafile& metafile, int width = 0,int height = 0)
m_metafile(metafile), m_width(width), m_height(height) { } :m_metafile(metafile)
,m_width(width)
,m_height(height) { }
void SetMetafile(const wxMetafile& metafile, int w = 0, int h = 0) void SetMetafile(const wxMetafile& metafile, int w = 0, int h = 0)
{ m_metafile = metafile; m_width = w; m_height = h; } { m_metafile = metafile; m_width = w; m_height = h; }
wxMetafile GetMetafile() const { return m_metafile; } wxMetafile GetMetafile() const { return m_metafile; }
int GetWidth() const { return m_width; } int GetWidth() const { return m_width; }
int GetHeight() const { return m_height; } int GetHeight() const { return m_height; }
virtual wxDataFormat GetFormat() const { return wxDF_METAFILE; } virtual wxDataFormat GetFormat() const { return wxDF_METAFILE; }
/* ?? /* ??
// implement base class pure virtuals // implement base class pure virtuals
virtual wxDataFormat GetPreferredFormat() const virtual wxDataFormat GetPreferredFormat() const
{ return (wxDataFormat) wxDataObject::Text; } { return (wxDataFormat) wxDataObject::Text; }
virtual bool IsSupportedFormat(wxDataFormat format) const virtual bool IsSupportedFormat(wxDataFormat format) const
{ return format == wxDataObject::Text || format == wxDataObject::Locale; } { return format == wxDataObject::Text || format == wxDataObject::Locale; }
virtual size_t GetDataSize() const virtual size_t GetDataSize() const
{ return m_strText.Len() + 1; } // +1 for trailing '\0'of course { return m_strText.Len() + 1; } // +1 for trailing '\0'of course
virtual void GetDataHere(void *pBuf) const virtual void GetDataHere(void *pBuf) const
{ memcpy(pBuf, m_strText.c_str(), GetDataSize()); } { memcpy(pBuf, m_strText.c_str(), GetDataSize()); }
*/ */
private: private:
wxMetafile m_metafile; wxMetafile m_metafile;
int m_width; int m_width;
int m_height; int m_height;
}; };
#endif #endif
#endif // wxUSE_METAFILE #endif // wxUSE_METAFILE
#endif #endif
// _WX_METAFIILE_H_ // _WX_METAFIILE_H_

View File

@@ -939,8 +939,6 @@
// 0 for no interprocess comms // 0 for no interprocess comms
#define wxUSE_HELP 1 #define wxUSE_HELP 1
// 0 for no help facility // 0 for no help facility
#define wxUSE_MS_HTML_HELP 1
// 0 for no MS HTML Help
// Use wxHTML-based help controller? // Use wxHTML-based help controller?
#define wxUSE_WXHTML_HELP 0 #define wxUSE_WXHTML_HELP 0

View File

@@ -546,7 +546,7 @@ wxChar *wxExpandPath(wxChar *buf, const wxChar *name)
while ((*d++ = *s) != 0) { while ((*d++ = *s) != 0) {
# ifndef __WXMSW__ # ifndef __WXMSW__
if (*s == wxT('\\')) { if (*s == wxT('\\')) {
if ((*(d - 1) = *++s)) { if ((*(d - 1) = *++s)!=0) {
s++; s++;
continue; continue;
} else } else

View File

@@ -109,7 +109,7 @@ IMPLEMENT_DYNAMIC_CLASS(wxPNGHandler,wxImageHandler)
#if wxUSE_STREAMS #if wxUSE_STREAMS
#ifndef PNGLINKAGEMODE #ifndef PNGLINKAGEMODE
#if defined(__WATCOMC__) && defined(__WXMSW__) #if defined(__WATCOMC__) && ( defined(__WXMSW__) || __WATCOMC__ > 1230 )
// we need an explicit cdecl for Watcom, at least according to // we need an explicit cdecl for Watcom, at least according to
// //
// http://sf.net/tracker/index.php?func=detail&aid=651492&group_id=9863&atid=109863 // http://sf.net/tracker/index.php?func=detail&aid=651492&group_id=9863&atid=109863

View File

@@ -26,6 +26,10 @@
#include "wx/setup.h" #include "wx/setup.h"
#endif #endif
#ifndef WXUNUSED
#define WXUNUSED(x)
#endif
#if defined(__VISAGECPP__) #if defined(__VISAGECPP__)
/* Seems to be needed by Visual Age C++, though I don't see how it manages /* Seems to be needed by Visual Age C++, though I don't see how it manages
to not break on including a C++ header into a plain C source file */ to not break on including a C++ header into a plain C source file */
@@ -225,17 +229,17 @@ void GSocketGUIFunctionsTableNull::OnExit()
{} {}
bool GSocketGUIFunctionsTableNull::CanUseEventLoop() bool GSocketGUIFunctionsTableNull::CanUseEventLoop()
{ return false; } { return false; }
bool GSocketGUIFunctionsTableNull::Init_Socket(GSocket *socket) bool GSocketGUIFunctionsTableNull::Init_Socket(GSocket *WXUNUSED(socket))
{ return true; } { return true; }
void GSocketGUIFunctionsTableNull::Destroy_Socket(GSocket *socket) void GSocketGUIFunctionsTableNull::Destroy_Socket(GSocket *WXUNUSED(socket))
{} {}
void GSocketGUIFunctionsTableNull::Install_Callback(GSocket *socket, GSocketEvent event) void GSocketGUIFunctionsTableNull::Install_Callback(GSocket *WXUNUSED(socket), GSocketEvent WXUNUSED(event))
{} {}
void GSocketGUIFunctionsTableNull::Uninstall_Callback(GSocket *socket, GSocketEvent event) void GSocketGUIFunctionsTableNull::Uninstall_Callback(GSocket *WXUNUSED(socket), GSocketEvent WXUNUSED(event))
{} {}
void GSocketGUIFunctionsTableNull::Enable_Events(GSocket *socket) void GSocketGUIFunctionsTableNull::Enable_Events(GSocket *WXUNUSED(socket))
{} {}
void GSocketGUIFunctionsTableNull::Disable_Events(GSocket *socket) void GSocketGUIFunctionsTableNull::Disable_Events(GSocket *WXUNUSED(socket))
{} {}
/* Global initialisers */ /* Global initialisers */