TWIN32 compatibility added; wxMotif uses wxGTK's wxPostScriptDC;

wxByte replaces byte (can conflict with windows.h)


git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@1428 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Julian Smart
1999-01-19 18:23:02 +00:00
parent 0d2a2b601b
commit 57c208c575
68 changed files with 575 additions and 244 deletions

View File

@@ -63,6 +63,8 @@ setup/shared/sharedSysV
misc/afm/*.afm misc/afm/*.afm
src/gtk/dcps.cpp
src/motif/*.cpp src/motif/*.cpp
src/motif/*.c src/motif/*.c
src/motif/*.h src/motif/*.h

View File

@@ -19,6 +19,8 @@ src/makeg95.env
src/makesl.env src/makesl.env
src/makeprog.sl src/makeprog.sl
src/ntwxwin.mak src/ntwxwin.mak
src/maketwin.env
src/makeprog.twn
src/makefile.bcc src/makefile.bcc
src/makefile.dos src/makefile.dos
src/makefile.nt src/makefile.nt

View File

@@ -43,6 +43,8 @@ High Priority
- Use wxImage to load other formats into wxBitmaps, such as PNG, BMP. - Use wxImage to load other formats into wxBitmaps, such as PNG, BMP.
- Printing dialogs need some tidying.
Low Priority Low Priority
------------ ------------
@@ -59,8 +61,6 @@ Low Priority
when implemented as extra bitmap handlers, the code won't be linked when implemented as extra bitmap handlers, the code won't be linked
unless needed. Update: see if wxImage can handle these formats. unless needed. Update: see if wxImage can handle these formats.
- Print/preview framework in print.cpp (see wxGTK).
- Enhance event handling such that you override e.g. left-click - Enhance event handling such that you override e.g. left-click
and unless you call the base OnMouseEvent, the click won't be and unless you call the base OnMouseEvent, the click won't be
sent to the button. Required for Dialog Editor. sent to the button. Required for Dialog Editor.

View File

@@ -230,6 +230,18 @@ References:
http://agnes.dida.physik.uni-essen.de/~janjaap/mingw32/index.html http://agnes.dida.physik.uni-essen.de/~janjaap/mingw32/index.html
- See also http://web.ukonline.co.uk/julian.smart/wxwin/gnuwin32.htm - See also http://web.ukonline.co.uk/julian.smart/wxwin/gnuwin32.htm
TWIN32 and gcc on Linux
-----------------------
The wxWindows 2 for Windows port may be compiled using
the TWIN32 emulator package from www.willows.com. However,
TWIN32 is by no means finished so this should be taken as
something to think about for the future, rather than
a tool for writing products with.
Use makefile.twn in much the same way as makefile.g95, as
described above. Not all sample makefiles are supplied yet.
Notes Notes
----- -----

View File

@@ -79,6 +79,10 @@
#define __WIN95__ #define __WIN95__
#endif #endif
#if defined(TWIN32) && !defined(__TWIN32__)
#define __TWIN32__
#endif
#endif // wxMSW #endif // wxMSW
// Make sure the environment is set correctly // Make sure the environment is set correctly
@@ -134,9 +138,12 @@
#endif #endif
#if ( defined(_MSC_VER) && (_MSC_VER <= 800) ) || defined(__GNUWIN32__) || (defined(__BORLANDC__) && defined(__WIN16__)) || defined(__SC__) || defined(__SALFORDC__) #if ( defined(_MSC_VER) && (_MSC_VER <= 800) ) || defined(__GNUWIN32__) || (defined(__BORLANDC__) && defined(__WIN16__)) || defined(__SC__) || defined(__SALFORDC__)
#define byte unsigned char // Not a good idea, because later system files (e.g. windows.h)
// may try to define it. Use wxByte instead.
// #define byte unsigned char
#endif #endif
typedef unsigned char wxByte;
typedef short int WXTYPE; typedef short int WXTYPE;
typedef int wxWindowID; typedef int wxWindowID;
@@ -212,6 +219,10 @@ class WXDLLEXPORT wxEvent;
// Error codes // Error codes
// ---------------------------------------------------------------------------- // ----------------------------------------------------------------------------
#ifdef ERR_PARAM
#undef ERR_PARAM
#endif
/// Standard error codes /// Standard error codes
enum ErrCode enum ErrCode
{ {

View File

@@ -16,10 +16,6 @@
#pragma interface "wave.h" #pragma interface "wave.h"
#endif #endif
#ifndef byte
#define byte unsigned char
#endif
#include "wx/object.h" #include "wx/object.h"
#ifndef AUDIODEV #ifndef AUDIODEV
@@ -31,14 +27,14 @@ class wxWave : public wxObject
public: public:
wxWave(); wxWave();
wxWave(const wxString& fileName, bool isResource = FALSE); wxWave(const wxString& fileName, bool isResource = FALSE);
wxWave(int size, const byte* data); wxWave(int size, const wxByte* data);
~wxWave(); ~wxWave();
public: public:
// Create from resource or file // Create from resource or file
bool Create(const wxString& fileName, bool isResource = FALSE); bool Create(const wxString& fileName, bool isResource = FALSE);
// Create from data // Create from data
bool Create(int size, const byte* data); bool Create(int size, const wxByte* data);
bool IsOk() const { return (m_waveData ? TRUE : FALSE); }; bool IsOk() const { return (m_waveData ? TRUE : FALSE); };
bool Play(bool async = TRUE, bool looped = FALSE); bool Play(bool async = TRUE, bool looped = FALSE);
@@ -47,7 +43,7 @@ protected:
bool Free(); bool Free();
private: private:
byte* m_waveData; wxByte* m_waveData;
int m_waveLength; int m_waveLength;
bool m_isResource; bool m_isResource;

View File

@@ -16,10 +16,6 @@
#pragma interface "wave.h" #pragma interface "wave.h"
#endif #endif
#ifndef byte
#define byte unsigned char
#endif
#include "wx/object.h" #include "wx/object.h"
#ifndef AUDIODEV #ifndef AUDIODEV
@@ -31,14 +27,14 @@ class wxWave : public wxObject
public: public:
wxWave(); wxWave();
wxWave(const wxString& fileName, bool isResource = FALSE); wxWave(const wxString& fileName, bool isResource = FALSE);
wxWave(int size, const byte* data); wxWave(int size, const wxByte* data);
~wxWave(); ~wxWave();
public: public:
// Create from resource or file // Create from resource or file
bool Create(const wxString& fileName, bool isResource = FALSE); bool Create(const wxString& fileName, bool isResource = FALSE);
// Create from data // Create from data
bool Create(int size, const byte* data); bool Create(int size, const wxByte* data);
bool IsOk() const { return (m_waveData ? TRUE : FALSE); }; bool IsOk() const { return (m_waveData ? TRUE : FALSE); };
bool Play(bool async = TRUE, bool looped = FALSE); bool Play(bool async = TRUE, bool looped = FALSE);
@@ -47,7 +43,7 @@ protected:
bool Free(); bool Free();
private: private:
byte* m_waveData; wxByte* m_waveData;
int m_waveLength; int m_waveLength;
bool m_isResource; bool m_isResource;

View File

@@ -162,10 +162,10 @@ public:
inline wxPalette *GetColourMap(void) const { return GetPalette(); } inline wxPalette *GetColourMap(void) const { return GetPalette(); }
void SetColourMap(wxPalette *cmap) { SetPalette(*cmap); }; void SetColourMap(wxPalette *cmap) { SetPalette(*cmap); };
#endif #endif
inline wxPalette* GetPalette(void) const { return (M_BITMAPDATA ? (& M_BITMAPDATA->m_bitmapPalette) : NULL); } inline wxPalette* GetPalette(void) const { return (M_BITMAPDATA ? (& M_BITMAPDATA->m_bitmapPalette) : (wxPalette*) NULL); }
void SetPalette(const wxPalette& palette); void SetPalette(const wxPalette& palette);
inline wxMask *GetMask(void) const { return (M_BITMAPDATA ? M_BITMAPDATA->m_bitmapMask : NULL); } inline wxMask *GetMask(void) const { return (M_BITMAPDATA ? M_BITMAPDATA->m_bitmapMask : (wxMask*) NULL); }
void SetMask(wxMask *mask) ; void SetMask(wxMask *mask) ;
inline wxBitmap& operator = (const wxBitmap& bitmap) { if (*this == bitmap) return (*this); Ref(bitmap); return *this; } inline wxBitmap& operator = (const wxBitmap& bitmap) { if (*this == bitmap) return (*this); Ref(bitmap); return *this; }
@@ -192,7 +192,7 @@ public:
void SetHBITMAP(WXHBITMAP bmp); void SetHBITMAP(WXHBITMAP bmp);
inline WXHBITMAP GetHBITMAP(void) const { return (M_BITMAPDATA ? M_BITMAPDATA->m_hBitmap : 0); } inline WXHBITMAP GetHBITMAP(void) const { return (M_BITMAPDATA ? M_BITMAPDATA->m_hBitmap : 0); }
inline void SetSelectedInto(wxDC *dc) { if (M_BITMAPDATA) M_BITMAPDATA->m_selectedInto = dc; } inline void SetSelectedInto(wxDC *dc) { if (M_BITMAPDATA) M_BITMAPDATA->m_selectedInto = dc; }
inline wxDC *GetSelectedInto(void) const { return (M_BITMAPDATA ? M_BITMAPDATA->m_selectedInto : NULL); } inline wxDC *GetSelectedInto(void) const { return (M_BITMAPDATA ? M_BITMAPDATA->m_selectedInto : (wxDC*) NULL); }
bool FreeResource(bool force = FALSE); bool FreeResource(bool force = FALSE);
// Creates a bitmap that matches the device context's depth, from // Creates a bitmap that matches the device context's depth, from

View File

@@ -79,10 +79,10 @@ public:
inline int GetJoin() const { return (M_PENDATA ? M_PENDATA->m_join : 0); }; inline int GetJoin() const { return (M_PENDATA ? M_PENDATA->m_join : 0); };
inline int GetCap() const { return (M_PENDATA ? M_PENDATA->m_cap : 0); }; inline int GetCap() const { return (M_PENDATA ? M_PENDATA->m_cap : 0); };
inline int GetDashes(wxDash **ptr) const { inline int GetDashes(wxDash **ptr) const {
*ptr = (M_PENDATA ? M_PENDATA->m_dash : NULL); return (M_PENDATA ? M_PENDATA->m_nbDash : 0); *ptr = (M_PENDATA ? M_PENDATA->m_dash : (wxDash*) NULL); return (M_PENDATA ? M_PENDATA->m_nbDash : 0);
} }
inline wxBitmap *GetStipple() const { return (M_PENDATA ? (& M_PENDATA->m_stipple) : NULL); }; inline wxBitmap *GetStipple() const { return (M_PENDATA ? (& M_PENDATA->m_stipple) : (wxBitmap*) NULL); };
// Internal // Internal
bool RealizeResource(); bool RealizeResource();

View File

@@ -182,11 +182,15 @@ inline bool wxStyleHasBorder(long style)
#endif #endif
#if defined(__WIN95__) && defined(__WXDEBUG__) && wxUSE_DBWIN32 #if defined(__WIN95__) && defined(__WXDEBUG__) && wxUSE_DBWIN32
#ifndef __TWIN32__
#ifdef OutputDebugString #ifdef OutputDebugString
#undef OutputDebugString #undef OutputDebugString
#endif #endif
#define OutputDebugString OutputDebugStringW95 #define OutputDebugString OutputDebugStringW95
#endif
extern void OutputDebugStringW95(const char*, ...); extern void OutputDebugStringW95(const char*, ...);
#endif #endif

View File

@@ -268,6 +268,19 @@
#define wxUSE_OWNER_DRAWN 0 #define wxUSE_OWNER_DRAWN 0
#endif #endif
#ifdef __TWIN32__
#undef wxUSE_THREADS
#define wxUSE_THREADS 0
#undef wxUSE_DBWIN32
#define wxUSE_DBWIN32 0
#undef wxUSE_ODBC
#define wxUSE_ODBC 0
#endif
// Minimal setup e.g. for compiling small utilities // Minimal setup e.g. for compiling small utilities
#define MINIMAL_WXWINDOWS_SETUP 0 #define MINIMAL_WXWINDOWS_SETUP 0

View File

@@ -44,9 +44,9 @@ class WXDLLEXPORT wxToolBar95: public wxToolBarBase
const wxString& name = wxToolBarNameStr); const wxString& name = wxToolBarNameStr);
// Call default behaviour // Call default behaviour
void OnPaint(wxPaintEvent& event) { Default() ; } void OnPaint(wxPaintEvent& WXUNUSED(event)) { Default() ; }
void OnSize(wxSizeEvent& event) { Default() ; } void OnSize(wxSizeEvent& WXUNUSED(event)) { Default() ; }
void OnKillFocus(wxFocusEvent& event) { Default() ; } void OnKillFocus(wxFocusEvent& WXUNUSED(event)) { Default() ; }
void OnMouseEvent(wxMouseEvent& event); void OnMouseEvent(wxMouseEvent& event);
// Handle wxToolBar95 events // Handle wxToolBar95 events

View File

@@ -23,14 +23,14 @@ class WXDLLEXPORT wxWave : public wxObject
public: public:
wxWave(); wxWave();
wxWave(const wxString& fileName, bool isResource = FALSE); wxWave(const wxString& fileName, bool isResource = FALSE);
wxWave(int size, const byte* data); wxWave(int size, const wxByte* data);
~wxWave(); ~wxWave();
public: public:
// Create from resource or file // Create from resource or file
bool Create(const wxString& fileName, bool isResource = FALSE); bool Create(const wxString& fileName, bool isResource = FALSE);
// Create from data // Create from data
bool Create(int size, const byte* data); bool Create(int size, const wxByte* data);
bool IsOk() const { return (m_waveData ? TRUE : FALSE); }; bool IsOk() const { return (m_waveData ? TRUE : FALSE); };
bool Play(bool async = TRUE, bool looped = FALSE) const; bool Play(bool async = TRUE, bool looped = FALSE) const;
@@ -39,7 +39,7 @@ protected:
bool Free(); bool Free();
private: private:
byte* m_waveData; wxByte* m_waveData;
int m_waveLength; int m_waveLength;
bool m_isResource; bool m_isResource;
}; };

View File

@@ -462,7 +462,7 @@ public:
// Does this window want to accept keyboard focus? // Does this window want to accept keyboard focus?
virtual bool AcceptsFocus() const; virtual bool AcceptsFocus() const;
virtual void PrepareDC( wxDC &dc ) {}; virtual void PrepareDC( wxDC& WXUNUSED(dc) ) {};
public: public:
//////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////
//// IMPLEMENTATION //// IMPLEMENTATION
@@ -765,7 +765,7 @@ inline int wxWindow::GetId() const { return m_windowId; }
inline void wxWindow::SetId(int id) { m_windowId = id; } inline void wxWindow::SetId(int id) { m_windowId = id; }
inline wxWindow *wxWindow::GetParent() const { return m_windowParent; } inline wxWindow *wxWindow::GetParent() const { return m_windowParent; }
inline void wxWindow::SetParent(wxWindow *p) { m_windowParent = p; } inline void wxWindow::SetParent(wxWindow *p) { m_windowParent = p; }
inline wxWindow *wxWindow::GetGrandParent() const { return (m_windowParent ? m_windowParent->m_windowParent : NULL); } inline wxWindow *wxWindow::GetGrandParent() const { return (m_windowParent ? m_windowParent->m_windowParent : (wxWindow*) NULL); }
inline wxList& wxWindow::GetChildren() const { return (wxList&) *m_children; } inline wxList& wxWindow::GetChildren() const { return (wxList&) *m_children; }
inline wxFont& wxWindow::GetFont() const { return (wxFont&) m_windowFont; } inline wxFont& wxWindow::GetFont() const { return (wxFont&) m_windowFont; }
inline wxString wxWindow::GetName() const { return m_windowName; } inline wxString wxWindow::GetName() const { return m_windowName; }

View File

@@ -29,7 +29,7 @@
// //
// //
#if defined( __GNUWIN32__ ) || defined(__MWERKS__) #if (defined( __GNUWIN32__ ) && !defined(__TWIN32__)) || defined(__MWERKS__)
#include <wx/msw/gnuwin32/winresrc.h> #include <wx/msw/gnuwin32/winresrc.h>
#else #else
#include <windows.h> #include <windows.h>

View File

@@ -43,7 +43,7 @@ public:
# endif # endif
#endif #endif
#ifdef __WXGTK__ #if defined(__WXGTK__) || defined(__WXMOTIF__)
// wxGTK has its own wxPostscriptDC // wxGTK has its own wxPostscriptDC

View File

@@ -59,6 +59,10 @@
#undef FindResource #undef FindResource
#endif #endif
#ifdef LoadAccelerators
#undef LoadAccelerators
#endif
#else #else
// always include this file (under Unix it's generated by configure) // always include this file (under Unix it's generated by configure)
#include "wx/setup.h" #include "wx/setup.h"

View File

@@ -31,7 +31,7 @@ $(OBJDIR)/minimal.$(OBJSUFF): minimal.$(SRCSUFF)
$(CC) -c $(CPPFLAGS) -o $@ minimal.$(SRCSUFF) $(CC) -c $(CPPFLAGS) -o $@ minimal.$(SRCSUFF)
$(OBJDIR)/minimal_resources.o: minimal.rc $(OBJDIR)/minimal_resources.o: minimal.rc
$(RESCOMP) -i minimal.rc -o $(OBJDIR)/minimal_resources.o $(RESFLAGS) $(RESCOMP) $(RCINPUTSWITCH) minimal.rc $(RCOUTPUTSWITCH) $(OBJDIR)/minimal_resources.o $(RESFLAGS)
clean: clean:
rm -f $(OBJECTS) minimal$(GUISUFFIX).exe core *.rsc *.res rm -f $(OBJECTS) minimal$(GUISUFFIX).exe core *.rsc *.res

View File

@@ -319,7 +319,7 @@ void MyFrame::Draw(wxDC& dc)
dc.DrawLine(0, 0, 200, 200); dc.DrawLine(0, 0, 200, 200);
dc.DrawLine(200, 0, 0, 200); dc.DrawLine(200, 0, 0, 200);
wxIcon my_icon( wxICON(mondrian) ); wxIcon my_icon = wxICON(mondrian) ;
dc.DrawIcon( my_icon, 100, 100); dc.DrawIcon( my_icon, 100, 100);
} }

View File

@@ -64,7 +64,10 @@
#endif #endif
#ifdef __GNUWIN32__ #ifdef __GNUWIN32__
#ifndef __TWIN32__
#include <sys/unistd.h> #include <sys/unistd.h>
#endif
#define stricmp strcasecmp #define stricmp strcasecmp
#endif #endif

View File

@@ -3,7 +3,7 @@
#ifdef _MSC_VER #ifdef _MSC_VER
#include <io.h> #include <io.h>
#endif #endif
#ifdef __GNUWIN32__ #if defined(__GNUWIN32__) && !defined(__TWIN32__)
#include <sys/unistd.h> #include <sys/unistd.h>
#endif #endif

View File

@@ -131,7 +131,7 @@ IMPLEMENT_DYNAMIC_CLASS(wxPrintSetupData, wxObject)
IMPLEMENT_DYNAMIC_CLASS(wxPrintPaperType, wxObject) IMPLEMENT_DYNAMIC_CLASS(wxPrintPaperType, wxObject)
#endif #endif
#ifndef __WXGTK__ #if !defined(__WXGTK__) && !defined(__WXMOTIF__)
// these should move into wxPostscriptDC: // these should move into wxPostscriptDC:
double UnderlinePosition = 0.0F; double UnderlinePosition = 0.0F;

View File

@@ -9,10 +9,12 @@
// Licence: wxWindows license // Licence: wxWindows license
///////////////////////////////////////////////////////////////////////////// /////////////////////////////////////////////////////////////////////////////
#ifndef __WXMOTIF__
#ifdef __GNUG__ #ifdef __GNUG__
#pragma implementation #pragma implementation
#pragma interface #pragma interface
#endif #endif
#endif
#include "wx/defs.h" #include "wx/defs.h"
@@ -28,8 +30,12 @@
#include "wx/image.h" #include "wx/image.h"
#include "wx/log.h" #include "wx/log.h"
#include <math.h>
#ifdef __WXGTK__
#include "gdk/gdk.h" #include "gdk/gdk.h"
#include "gtk/gtk.h" #include "gtk/gtk.h"
#endif
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
// start and end of document/page // start and end of document/page
@@ -784,7 +790,8 @@ void wxPostScriptDC::SetFont (const wxFont& font)
if (!font.Ok()) return; if (!font.Ok()) return;
m_font = font; m_font = font;
#ifdef __WXGTK__
char *name = wxTheFontNameDirectory->GetPostScriptName( m_font.GetFamily(), char *name = wxTheFontNameDirectory->GetPostScriptName( m_font.GetFamily(),
m_font.GetWeight(), m_font.GetWeight(),
m_font.GetStyle() ); m_font.GetStyle() );
@@ -794,6 +801,84 @@ void wxPostScriptDC::SetFont (const wxFont& font)
<< "/" << name << " findfont\n" << "/" << name << " findfont\n"
<< YLOG2DEVREL(font.GetPointSize()) << YLOG2DEVREL(font.GetPointSize())
<< " scalefont setfont\n"; << " scalefont setfont\n";
#else
char buf[100];
const char *name;
const char *style = "";
int Style = m_font.GetStyle ();
int Weight = m_font.GetWeight ();
switch (m_font.GetFamily ())
{
case wxTELETYPE:
case wxMODERN:
name = "/Courier";
break;
case wxSWISS:
name = "/Helvetica";
break;
case wxROMAN:
// name = "/Times-Roman";
name = "/Times"; // Altered by EDZ
break;
case wxSCRIPT:
name = "/Zapf-Chancery-MediumItalic";
Style = wxNORMAL;
Weight = wxNORMAL;
break;
default:
case wxDEFAULT: // Sans Serif Font
name = "/LucidaSans";
}
if (Style == wxNORMAL && (Weight == wxNORMAL || Weight == wxLIGHT))
{
if (m_font.GetFamily () == wxROMAN)
style = "-Roman";
else
style = "";
}
else if (Style == wxNORMAL && Weight == wxBOLD)
style = "-Bold";
else if (Style == wxITALIC && (Weight == wxNORMAL || Weight == wxLIGHT))
{
if (m_font.GetFamily () == wxROMAN)
style = "-Italic";
else
style = "-Oblique";
}
else if (Style == wxITALIC && Weight == wxBOLD)
{
if (m_font.GetFamily () == wxROMAN)
style = "-BoldItalic";
else
style = "-BoldOblique";
}
else if (Style == wxSLANT && (Weight == wxNORMAL || Weight == wxLIGHT))
{
if (m_font.GetFamily () == wxROMAN)
style = "-Italic";
else
style = "-Oblique";
}
else if (Style == wxSLANT && Weight == wxBOLD)
{
if (m_font.GetFamily () == wxROMAN)
style = "-BoldItalic";
else
style = "-BoldOblique";
}
else
style = "";
strcpy (buf, name);
strcat (buf, style);
*m_pstream << buf << " findfont\n";
// *m_pstream << (m_font.GetPointSize() * m_scaleFactor) << " scalefont setfont\n";
// No scale factor in this implementation?
*m_pstream << (m_font.GetPointSize()) << " scalefont setfont\n";
#endif
} }
void wxPostScriptDC::SetPen( const wxPen& pen ) void wxPostScriptDC::SetPen( const wxPen& pen )

View File

@@ -48,7 +48,7 @@ wxWave::wxWave(const wxString& sFileName, bool isResource)
Create(sFileName, isResource); Create(sFileName, isResource);
} }
wxWave::wxWave(int size, const byte* data) wxWave::wxWave(int size, const wxByte* data)
: m_waveLength(0), m_isResource(FALSE), m_waveData(NULL) : m_waveLength(0), m_isResource(FALSE), m_waveData(NULL)
{ {
Create(size, data); Create(size, data);
@@ -80,7 +80,7 @@ bool wxWave::Create(const wxString& fileName, bool isResource)
m_waveLength = (int) fileWave.Length(); m_waveLength = (int) fileWave.Length();
m_waveData = new byte[m_waveLength]; m_waveData = new wxByte[m_waveLength];
if (!m_waveData) if (!m_waveData)
{ {
return FALSE; return FALSE;
@@ -92,12 +92,12 @@ bool wxWave::Create(const wxString& fileName, bool isResource)
} }
} }
bool wxWave::Create(int size, const byte* data) bool wxWave::Create(int size, const wxByte* data)
{ {
Free(); Free();
m_isResource = FALSE; m_isResource = FALSE;
m_waveLength=size; m_waveLength=size;
m_waveData = new byte[size]; m_waveData = new wxByte[size];
if (!m_waveData) if (!m_waveData)
{ {
return FALSE; return FALSE;

View File

@@ -9,10 +9,12 @@
// Licence: wxWindows license // Licence: wxWindows license
///////////////////////////////////////////////////////////////////////////// /////////////////////////////////////////////////////////////////////////////
#ifndef __WXMOTIF__
#ifdef __GNUG__ #ifdef __GNUG__
#pragma implementation #pragma implementation
#pragma interface #pragma interface
#endif #endif
#endif
#include "wx/defs.h" #include "wx/defs.h"
@@ -28,8 +30,12 @@
#include "wx/image.h" #include "wx/image.h"
#include "wx/log.h" #include "wx/log.h"
#include <math.h>
#ifdef __WXGTK__
#include "gdk/gdk.h" #include "gdk/gdk.h"
#include "gtk/gtk.h" #include "gtk/gtk.h"
#endif
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
// start and end of document/page // start and end of document/page
@@ -784,7 +790,8 @@ void wxPostScriptDC::SetFont (const wxFont& font)
if (!font.Ok()) return; if (!font.Ok()) return;
m_font = font; m_font = font;
#ifdef __WXGTK__
char *name = wxTheFontNameDirectory->GetPostScriptName( m_font.GetFamily(), char *name = wxTheFontNameDirectory->GetPostScriptName( m_font.GetFamily(),
m_font.GetWeight(), m_font.GetWeight(),
m_font.GetStyle() ); m_font.GetStyle() );
@@ -794,6 +801,84 @@ void wxPostScriptDC::SetFont (const wxFont& font)
<< "/" << name << " findfont\n" << "/" << name << " findfont\n"
<< YLOG2DEVREL(font.GetPointSize()) << YLOG2DEVREL(font.GetPointSize())
<< " scalefont setfont\n"; << " scalefont setfont\n";
#else
char buf[100];
const char *name;
const char *style = "";
int Style = m_font.GetStyle ();
int Weight = m_font.GetWeight ();
switch (m_font.GetFamily ())
{
case wxTELETYPE:
case wxMODERN:
name = "/Courier";
break;
case wxSWISS:
name = "/Helvetica";
break;
case wxROMAN:
// name = "/Times-Roman";
name = "/Times"; // Altered by EDZ
break;
case wxSCRIPT:
name = "/Zapf-Chancery-MediumItalic";
Style = wxNORMAL;
Weight = wxNORMAL;
break;
default:
case wxDEFAULT: // Sans Serif Font
name = "/LucidaSans";
}
if (Style == wxNORMAL && (Weight == wxNORMAL || Weight == wxLIGHT))
{
if (m_font.GetFamily () == wxROMAN)
style = "-Roman";
else
style = "";
}
else if (Style == wxNORMAL && Weight == wxBOLD)
style = "-Bold";
else if (Style == wxITALIC && (Weight == wxNORMAL || Weight == wxLIGHT))
{
if (m_font.GetFamily () == wxROMAN)
style = "-Italic";
else
style = "-Oblique";
}
else if (Style == wxITALIC && Weight == wxBOLD)
{
if (m_font.GetFamily () == wxROMAN)
style = "-BoldItalic";
else
style = "-BoldOblique";
}
else if (Style == wxSLANT && (Weight == wxNORMAL || Weight == wxLIGHT))
{
if (m_font.GetFamily () == wxROMAN)
style = "-Italic";
else
style = "-Oblique";
}
else if (Style == wxSLANT && Weight == wxBOLD)
{
if (m_font.GetFamily () == wxROMAN)
style = "-BoldItalic";
else
style = "-BoldOblique";
}
else
style = "";
strcpy (buf, name);
strcat (buf, style);
*m_pstream << buf << " findfont\n";
// *m_pstream << (m_font.GetPointSize() * m_scaleFactor) << " scalefont setfont\n";
// No scale factor in this implementation?
*m_pstream << (m_font.GetPointSize()) << " scalefont setfont\n";
#endif
} }
void wxPostScriptDC::SetPen( const wxPen& pen ) void wxPostScriptDC::SetPen( const wxPen& pen )

View File

@@ -48,7 +48,7 @@ wxWave::wxWave(const wxString& sFileName, bool isResource)
Create(sFileName, isResource); Create(sFileName, isResource);
} }
wxWave::wxWave(int size, const byte* data) wxWave::wxWave(int size, const wxByte* data)
: m_waveLength(0), m_isResource(FALSE), m_waveData(NULL) : m_waveLength(0), m_isResource(FALSE), m_waveData(NULL)
{ {
Create(size, data); Create(size, data);
@@ -80,7 +80,7 @@ bool wxWave::Create(const wxString& fileName, bool isResource)
m_waveLength = (int) fileWave.Length(); m_waveLength = (int) fileWave.Length();
m_waveData = new byte[m_waveLength]; m_waveData = new wxByte[m_waveLength];
if (!m_waveData) if (!m_waveData)
{ {
return FALSE; return FALSE;
@@ -92,12 +92,12 @@ bool wxWave::Create(const wxString& fileName, bool isResource)
} }
} }
bool wxWave::Create(int size, const byte* data) bool wxWave::Create(int size, const wxByte* data)
{ {
Free(); Free();
m_isResource = FALSE; m_isResource = FALSE;
m_waveLength=size; m_waveLength=size;
m_waveData = new byte[size]; m_waveData = new wxByte[size];
if (!m_waveData) if (!m_waveData)
{ {
return FALSE; return FALSE;

View File

@@ -36,16 +36,20 @@ CCLEX=gcc
MAKE=make MAKE=make
# LEX # LEX
LEX=flex.exe -t -L LEX=flex -t -L
# YACC. byacc or bison # YACC. yacc or bison
# YACC=byacc.exe # YACC=yacc
YACC=bison.exe YACC=bison
# Resource compiler # Settings for Cyginw/Mingw32
RESCOMP=windres.exe RESCOMP=windres.exe
RCINPUTSWITCH=-i
RCOUTPUTSWITCH=-o
RCINCSWITCH=--include-dir
RCDEFSWITCH=--define
RESFLAGS=--include-dir $(WXDIR)/include --define __WIN32__ --define __WIN95__ --define __GNUWIN32__ RESFLAGS=$(RCINCSWITCH) $(WXDIR)/include $(RCDEFSWITCH) __WIN32__ $(RCDEFSWITCH) __WIN95__ $(RCDEFSWITCH) __GNUWIN32__
########################## Compiler flags ############################# ########################## Compiler flags #############################
@@ -103,7 +107,7 @@ RANLIB = ranlib
#COMPLIBS=-lgcc #COMPLIBS=-lgcc
# Compiler or system-specific include paths # Compiler or system-specific include paths
COMPPATHS= COMPPATHS=-I$(TWINDIR)/include -DTWIN32 -D__TWIN32__
########################## Directories ############################### ########################## Directories ###############################
@@ -136,7 +140,8 @@ OBJDIR = objects$(GUISUFFIX)
# You shouldn't need to change these... # You shouldn't need to change these...
CPPFLAGS = $(XINCLUDE) $(INC) $(OPTIONS) $(GUI) $(DEBUGFLAGS) $(WARN) $(OPT) CPPFLAGS = $(XINCLUDE) $(INC) $(OPTIONS) $(GUI) $(DEBUGFLAGS) $(WARN) $(OPT)
CFLAGS = $(XINCLUDE) $(INC) $(OPTIONS) $(GUI) $(DEBUGFLAGS) $(WARN) $(OPT) CFLAGS = $(XINCLUDE) $(INC) $(OPTIONS) $(GUI) $(DEBUGFLAGS) $(WARN) $(OPT)
LDFLAGS = -Wl,--subsystem,windows -mwindows -L$(WXDIR)/lib WINDOWSLDFLAGS=-Wl,--subsystem,windows -mwindows
LDFLAGS = $(WINDOWSLDFLAGS) -L$(WXDIR)/lib
.SUFFIXES: .rc .$(RESSUFF) .$(RSCSUFF) .cpp .c .SUFFIXES: .rc .$(RESSUFF) .$(RSCSUFF) .cpp .c

View File

@@ -91,6 +91,7 @@ LIB_CPP_SRC=\
dc.cpp \ dc.cpp \
dcclient.cpp \ dcclient.cpp \
dcmemory.cpp \ dcmemory.cpp \
dcps.cpp \
dcscreen.cpp \ dcscreen.cpp \
dialog.cpp \ dialog.cpp \
dnd.cpp \ dnd.cpp \

View File

@@ -63,7 +63,7 @@ wxAcceleratorRefData::~wxAcceleratorRefData()
if (m_hAccel) if (m_hAccel)
{ {
// This function not available in WIN16 // This function not available in WIN16
#ifndef __WIN16__ #if !defined(__WIN16__) && !defined(__TWIN32__)
DestroyAcceleratorTable((HACCEL) m_hAccel); DestroyAcceleratorTable((HACCEL) m_hAccel);
#endif #endif
} }
@@ -85,7 +85,7 @@ wxAcceleratorTable::wxAcceleratorTable(const wxString& resource)
m_refData = new wxAcceleratorRefData; m_refData = new wxAcceleratorRefData;
HACCEL hAccel = HACCEL hAccel =
#ifdef __WIN32__ #if defined(__WIN32__) && !defined(__TWIN32__)
#ifdef UNICODE #ifdef UNICODE
::LoadAcceleratorsW(wxGetInstance(), (const char *)resource); ::LoadAcceleratorsW(wxGetInstance(), (const char *)resource);
#else #else
@@ -104,7 +104,7 @@ extern int wxCharCodeWXToMSW(int id, bool *isVirtual);
wxAcceleratorTable::wxAcceleratorTable(int n, const wxAcceleratorEntry entries[]) wxAcceleratorTable::wxAcceleratorTable(int n, const wxAcceleratorEntry entries[])
{ {
// Not available in WIN16 // Not available in WIN16
#ifndef __WIN16__ #if !defined(__WIN16__) && !defined(__TWIN32__)
m_refData = new wxAcceleratorRefData; m_refData = new wxAcceleratorRefData;
ACCEL* arr = new ACCEL[n]; ACCEL* arr = new ACCEL[n];

View File

@@ -68,7 +68,7 @@
#include <string.h> #include <string.h>
#include <ctype.h> #include <ctype.h>
#if defined(__WIN95__) && !defined(__GNUWIN32__) #if (defined(__WIN95__) && !defined(__GNUWIN32__)) || defined(__TWIN32__)
#include <commctrl.h> #include <commctrl.h>
#endif #endif
@@ -116,15 +116,15 @@ char wxMDIChildFrameClassName[] = "wxMDIChildFrameClass";
char wxPanelClassName[] = "wxPanelClass"; char wxPanelClassName[] = "wxPanelClass";
char wxCanvasClassName[] = "wxCanvasClass"; char wxCanvasClassName[] = "wxCanvasClass";
HICON wxSTD_FRAME_ICON = NULL; HICON wxSTD_FRAME_ICON = (HICON) NULL;
HICON wxSTD_MDICHILDFRAME_ICON = NULL; HICON wxSTD_MDICHILDFRAME_ICON = (HICON) NULL;
HICON wxSTD_MDIPARENTFRAME_ICON = NULL; HICON wxSTD_MDIPARENTFRAME_ICON = (HICON) NULL;
HICON wxDEFAULT_FRAME_ICON = NULL; HICON wxDEFAULT_FRAME_ICON = (HICON) NULL;
HICON wxDEFAULT_MDICHILDFRAME_ICON = NULL; HICON wxDEFAULT_MDICHILDFRAME_ICON = (HICON) NULL;
HICON wxDEFAULT_MDIPARENTFRAME_ICON = NULL; HICON wxDEFAULT_MDIPARENTFRAME_ICON = (HICON) NULL;
HBRUSH wxDisableButtonBrush = 0; HBRUSH wxDisableButtonBrush = (HBRUSH) 0;
LRESULT APIENTRY wxWndProc(HWND, UINT, WPARAM, LPARAM); LRESULT APIENTRY wxWndProc(HWND, UINT, WPARAM, LPARAM);
@@ -140,8 +140,14 @@ LRESULT APIENTRY wxWndProc(HWND, UINT, WPARAM, LPARAM);
long wxApp::sm_lastMessageTime = 0; long wxApp::sm_lastMessageTime = 0;
#ifdef __WIN95__ #if defined(__WIN95__) && !defined(__TWIN32__)
static HINSTANCE gs_hRichEdit = NULL; #define wxUSE_RICHEDIT 1
#else
#define wxUSE_RICHEDIT 0
#endif
#if wxUSE_RICHEDIT
static HINSTANCE gs_hRichEdit = (HINSTANCE) NULL;
#endif #endif
//// Initialize //// Initialize
@@ -183,12 +189,16 @@ bool wxApp::Initialize()
#if defined(__WIN95__) #if defined(__WIN95__)
InitCommonControls(); InitCommonControls();
#if wxUSE_RICHEDIT
gs_hRichEdit = LoadLibrary("RICHED32.DLL"); gs_hRichEdit = LoadLibrary("RICHED32.DLL");
if (gs_hRichEdit == NULL) if (gs_hRichEdit == (HINSTANCE) NULL)
{ {
wxMessageBox("Could not initialise Rich Edit DLL"); wxMessageBox("Could not initialise Rich Edit DLL");
} }
#endif
#endif #endif
int iMsg = 96; int iMsg = 96;
@@ -275,8 +285,8 @@ bool wxApp::RegisterWindowClasses()
wndclass.cbClsExtra = 0; wndclass.cbClsExtra = 0;
wndclass.cbWndExtra = sizeof( DWORD ); // was 4 wndclass.cbWndExtra = sizeof( DWORD ); // was 4
wndclass.hInstance = wxhInstance; wndclass.hInstance = wxhInstance;
wndclass.hIcon = NULL; // wxSTD_FRAME_ICON; wndclass.hIcon = (HICON) NULL; // wxSTD_FRAME_ICON;
wndclass.hCursor = LoadCursor( NULL, IDC_ARROW ); wndclass.hCursor = LoadCursor( (HINSTANCE) NULL, IDC_ARROW );
wndclass.hbrBackground = (HBRUSH)(COLOR_APPWORKSPACE+1) ; wndclass.hbrBackground = (HBRUSH)(COLOR_APPWORKSPACE+1) ;
// wndclass.hbrBackground = GetStockObject( WHITE_BRUSH ); // wndclass.hbrBackground = GetStockObject( WHITE_BRUSH );
wndclass.lpszMenuName = NULL; wndclass.lpszMenuName = NULL;
@@ -299,10 +309,10 @@ bool wxApp::RegisterWindowClasses()
wndclass1.cbClsExtra = 0; wndclass1.cbClsExtra = 0;
wndclass1.cbWndExtra = sizeof( DWORD ); // was 4 wndclass1.cbWndExtra = sizeof( DWORD ); // was 4
wndclass1.hInstance = wxhInstance; wndclass1.hInstance = wxhInstance;
wndclass1.hIcon = NULL; // wxSTD_MDIPARENTFRAME_ICON; wndclass1.hIcon = (HICON) NULL; // wxSTD_MDIPARENTFRAME_ICON;
wndclass1.hCursor = LoadCursor( NULL, IDC_ARROW ); wndclass1.hCursor = LoadCursor( (HINSTANCE) NULL, IDC_ARROW );
// wndclass1.hbrBackground = (HBRUSH)(COLOR_APPWORKSPACE+1) ; // wndclass1.hbrBackground = (HBRUSH)(COLOR_APPWORKSPACE+1) ;
wndclass1.hbrBackground = NULL; wndclass1.hbrBackground = (HBRUSH) NULL;
wndclass1.lpszMenuName = NULL; wndclass1.lpszMenuName = NULL;
wndclass1.lpszClassName = wxMDIFrameClassName; wndclass1.lpszClassName = wxMDIFrameClassName;
@@ -321,8 +331,8 @@ bool wxApp::RegisterWindowClasses()
wndclass4.cbClsExtra = 0; wndclass4.cbClsExtra = 0;
wndclass4.cbWndExtra = sizeof( DWORD ); // was 4 wndclass4.cbWndExtra = sizeof( DWORD ); // was 4
wndclass4.hInstance = wxhInstance; wndclass4.hInstance = wxhInstance;
wndclass4.hIcon = NULL; // wxSTD_MDICHILDFRAME_ICON; wndclass4.hIcon = (HICON) NULL; // wxSTD_MDICHILDFRAME_ICON;
wndclass4.hCursor = LoadCursor( NULL, IDC_ARROW ); wndclass4.hCursor = LoadCursor( (HINSTANCE) NULL, IDC_ARROW );
// TODO: perhaps this should be NULL so that Windows doesn't // TODO: perhaps this should be NULL so that Windows doesn't
// paint the background itself (would OnEraseBackground duplicate // paint the background itself (would OnEraseBackground duplicate
// this?) // this?)
@@ -348,8 +358,8 @@ bool wxApp::RegisterWindowClasses()
wndclass2.cbClsExtra = 0; wndclass2.cbClsExtra = 0;
wndclass2.cbWndExtra = sizeof( DWORD ); // was 4 wndclass2.cbWndExtra = sizeof( DWORD ); // was 4
wndclass2.hInstance = wxhInstance; wndclass2.hInstance = wxhInstance;
wndclass2.hIcon = NULL; wndclass2.hIcon = (HICON) NULL;
wndclass2.hCursor = NULL; wndclass2.hCursor = (HCURSOR) NULL;
// wndclass2.hbrBackground = (HBRUSH)(COLOR_BTNFACE+1) ; // wndclass2.hbrBackground = (HBRUSH)(COLOR_BTNFACE+1) ;
wndclass2.hbrBackground = (HBRUSH) GetStockObject( LTGRAY_BRUSH ); wndclass2.hbrBackground = (HBRUSH) GetStockObject( LTGRAY_BRUSH );
wndclass2.lpszMenuName = NULL; wndclass2.lpszMenuName = NULL;
@@ -373,10 +383,10 @@ bool wxApp::RegisterWindowClasses()
wndclass3.cbClsExtra = 0; wndclass3.cbClsExtra = 0;
wndclass3.cbWndExtra = sizeof( DWORD ); // was 4 wndclass3.cbWndExtra = sizeof( DWORD ); // was 4
wndclass3.hInstance = wxhInstance; wndclass3.hInstance = wxhInstance;
wndclass3.hIcon = NULL; wndclass3.hIcon = (HICON) NULL;
wndclass3.hCursor = NULL; wndclass3.hCursor = (HCURSOR) NULL;
// wndclass3.hbrBackground = (HBRUSH)(COLOR_WINDOW+1) ; // wndclass3.hbrBackground = (HBRUSH)(COLOR_WINDOW+1) ;
wndclass3.hbrBackground = NULL; wndclass3.hbrBackground = (HBRUSH) NULL;
wndclass3.lpszMenuName = NULL; wndclass3.lpszMenuName = NULL;
wndclass3.lpszClassName = wxCanvasClassName; wndclass3.lpszClassName = wxCanvasClassName;
if (!RegisterClass( &wndclass3)) if (!RegisterClass( &wndclass3))
@@ -500,10 +510,14 @@ void wxApp::CleanUp()
wxSetKeyboardHook(FALSE); wxSetKeyboardHook(FALSE);
#ifdef __WIN95__ #ifdef __WIN95__
if (gs_hRichEdit != NULL)
#if wxUSE_RICHEDIT
if (gs_hRichEdit != (HINSTANCE) NULL)
FreeLibrary(gs_hRichEdit); FreeLibrary(gs_hRichEdit);
#endif #endif
#endif
#if wxUSE_PENWINDOWS #if wxUSE_PENWINDOWS
wxCleanUpPenWin(); wxCleanUpPenWin();
#endif #endif
@@ -922,7 +936,7 @@ bool wxApp::ProcessMessage(WXMSG *Msg)
// Try translations first; find the youngest window with // Try translations first; find the youngest window with
// a translation table. // a translation table.
for (hWnd = msg->hwnd; hWnd != NULL; hWnd = ::GetParent(hWnd)) for (hWnd = msg->hwnd; hWnd != (HWND) NULL; hWnd = ::GetParent(hWnd))
{ {
wxWindow *wnd = wxFindWinFromHandle((WXHWND) hWnd); wxWindow *wnd = wxFindWinFromHandle((WXHWND) hWnd);
if (wnd) if (wnd)
@@ -933,7 +947,7 @@ bool wxApp::ProcessMessage(WXMSG *Msg)
} }
// Anyone for a non-translation message? Try youngest descendants first. // Anyone for a non-translation message? Try youngest descendants first.
for (hWnd = msg->hwnd; hWnd != NULL; hWnd = ::GetParent(hWnd)) for (hWnd = msg->hwnd; hWnd != (HWND) NULL; hWnd = ::GetParent(hWnd))
{ {
wxWindow *wnd = wxFindWinFromHandle((WXHWND) hWnd); wxWindow *wnd = wxFindWinFromHandle((WXHWND) hWnd);
if (wnd) if (wnd)
@@ -1033,7 +1047,7 @@ void wxApp::DeletePendingObjects()
} }
} }
void wxApp::OnEndSession(wxCloseEvent& event) void wxApp::OnEndSession(wxCloseEvent& WXUNUSED(event))
{ {
if (GetTopWindow()) if (GetTopWindow())
GetTopWindow()->Close(TRUE); GetTopWindow()->Close(TRUE);
@@ -1136,6 +1150,6 @@ HINSTANCE wxGetInstance()
// For some reason, with MSVC++ 1.5, WinMain isn't linked in properly // For some reason, with MSVC++ 1.5, WinMain isn't linked in properly
// if in a separate file. So include it here to ensure it's linked. // if in a separate file. So include it here to ensure it's linked.
#if (defined(_MSC_VER) && !defined(__WIN32__)) || defined(__GNUWIN32__) #if (defined(_MSC_VER) && !defined(__WIN32__)) || (defined(__GNUWIN32__) && !defined(__TWIN32__))
#include "main.cpp" #include "main.cpp"
#endif #endif

View File

@@ -91,7 +91,7 @@ wxBitmap::~wxBitmap(void)
wxTheBitmapList->DeleteObject(this); wxTheBitmapList->DeleteObject(this);
} }
bool wxBitmap::FreeResource(bool force) bool wxBitmap::FreeResource(bool WXUNUSED(force))
{ {
if ( !M_BITMAPDATA ) if ( !M_BITMAPDATA )
return FALSE; return FALSE;
@@ -187,9 +187,9 @@ bool wxBitmap::Create(int w, int h, int d)
} }
else else
{ {
HDC dc = GetDC(NULL); HDC dc = GetDC((HWND) NULL);
M_BITMAPDATA->m_hBitmap = (WXHBITMAP) CreateCompatibleBitmap(dc, w, h); M_BITMAPDATA->m_hBitmap = (WXHBITMAP) CreateCompatibleBitmap(dc, w, h);
ReleaseDC(NULL, dc); ReleaseDC((HWND) NULL, dc);
M_BITMAPDATA->m_depth = wxDisplayDepth(); M_BITMAPDATA->m_depth = wxDisplayDepth();
} }
if (M_BITMAPDATA->m_hBitmap) if (M_BITMAPDATA->m_hBitmap)
@@ -385,9 +385,9 @@ wxBitmap wxBitmap::GetBitmapForDC(wxDC& dc) const
{ {
wxMemoryDC memDC; wxMemoryDC memDC;
wxBitmap tmpBitmap(this->GetWidth(), this->GetHeight(), dc.GetDepth()); wxBitmap tmpBitmap(this->GetWidth(), this->GetHeight(), dc.GetDepth());
HPALETTE hPal = NULL; HPALETTE hPal = (HPALETTE) NULL;
LPBITMAPINFO lpDib; LPBITMAPINFO lpDib;
void *lpBits = NULL; void *lpBits = (void*) NULL;
/* /*
wxASSERT( this->GetPalette() && this->GetPalette()->Ok() && (this->GetPalette()->GetHPALETTE() != 0) ); wxASSERT( this->GetPalette() && this->GetPalette()->Ok() && (this->GetPalette()->GetHPALETTE() != 0) );
@@ -577,18 +577,18 @@ bool wxMask::Create(const wxBitmap& bitmap, const wxColour& colour)
IMPLEMENT_DYNAMIC_CLASS(wxBitmapHandler, wxObject) IMPLEMENT_DYNAMIC_CLASS(wxBitmapHandler, wxObject)
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))
{ {
return FALSE; return FALSE;
} }
bool wxBitmapHandler::LoadFile(wxBitmap *bitmap, const wxString& name, long type, bool wxBitmapHandler::LoadFile(wxBitmap *WXUNUSED(bitmap), const wxString& WXUNUSED(name), long WXUNUSED(type),
int desiredWidth, int desiredHeight) int WXUNUSED(desiredWidth), int WXUNUSED(desiredHeight))
{ {
return FALSE; return FALSE;
} }
bool wxBitmapHandler::SaveFile(wxBitmap *bitmap, const wxString& name, int type, const wxPalette *palette) bool wxBitmapHandler::SaveFile(wxBitmap *WXUNUSED(bitmap), const wxString& WXUNUSED(name), int WXUNUSED(type), const wxPalette *WXUNUSED(palette))
{ {
return FALSE; return FALSE;
} }
@@ -613,8 +613,8 @@ public:
}; };
IMPLEMENT_DYNAMIC_CLASS(wxBMPResourceHandler, wxBitmapHandler) IMPLEMENT_DYNAMIC_CLASS(wxBMPResourceHandler, wxBitmapHandler)
bool wxBMPResourceHandler::LoadFile(wxBitmap *bitmap, const wxString& name, long flags, bool wxBMPResourceHandler::LoadFile(wxBitmap *bitmap, const wxString& name, long WXUNUSED(flags),
int desiredWidth, int desiredHeight) int WXUNUSED(desiredWidth), int WXUNUSED(desiredHeight))
{ {
// TODO: load colourmap. // TODO: load colourmap.
M_BITMAPHANDLERDATA->m_hBitmap = (WXHBITMAP) ::LoadBitmap(wxGetInstance(), name); M_BITMAPHANDLERDATA->m_hBitmap = (WXHBITMAP) ::LoadBitmap(wxGetInstance(), name);
@@ -652,8 +652,8 @@ public:
}; };
IMPLEMENT_DYNAMIC_CLASS(wxBMPFileHandler, wxBitmapHandler) IMPLEMENT_DYNAMIC_CLASS(wxBMPFileHandler, wxBitmapHandler)
bool wxBMPFileHandler::LoadFile(wxBitmap *bitmap, const wxString& name, long flags, bool wxBMPFileHandler::LoadFile(wxBitmap *bitmap, const wxString& name, long WXUNUSED(flags),
int desiredWidth, int desiredHeight) int WXUNUSED(desiredWidth), int WXUNUSED(desiredHeight))
{ {
#if wxUSE_IMAGE_LOADING_IN_MSW #if wxUSE_IMAGE_LOADING_IN_MSW
wxPalette *palette = NULL; wxPalette *palette = NULL;
@@ -677,7 +677,7 @@ bool wxBMPFileHandler::LoadFile(wxBitmap *bitmap, const wxString& name, long fla
#endif #endif
} }
bool wxBMPFileHandler::SaveFile(wxBitmap *bitmap, const wxString& name, int type, const wxPalette *pal) bool wxBMPFileHandler::SaveFile(wxBitmap *bitmap, const wxString& name, int WXUNUSED(type), const wxPalette *pal)
{ {
#if wxUSE_IMAGE_LOADING_IN_MSW #if wxUSE_IMAGE_LOADING_IN_MSW
wxPalette *actualPalette = (wxPalette *)pal; wxPalette *actualPalette = (wxPalette *)pal;

View File

@@ -168,7 +168,7 @@ WXHANDLE wxBrush::GetResourceHandle(void)
return (WXHANDLE) M_BRUSHDATA->m_hBrush; return (WXHANDLE) M_BRUSHDATA->m_hBrush;
} }
bool wxBrush::FreeResource(bool force) bool wxBrush::FreeResource(bool WXUNUSED(force))
{ {
if (M_BRUSHDATA && (M_BRUSHDATA->m_hBrush != 0)) if (M_BRUSHDATA && (M_BRUSHDATA->m_hBrush != 0))
{ {

View File

@@ -100,8 +100,8 @@ bool wxSetClipboardData(wxDataFormat dataFormat, wxObject *obj, int width, int h
{ {
wxBitmap *wxBM = (wxBitmap *)obj; wxBitmap *wxBM = (wxBitmap *)obj;
HDC hdcMem = CreateCompatibleDC(NULL); HDC hdcMem = CreateCompatibleDC((HDC) NULL);
HDC hdcSrc = CreateCompatibleDC(NULL); HDC hdcSrc = CreateCompatibleDC((HDC) NULL);
HBITMAP old = (HBITMAP) ::SelectObject(hdcSrc, (HBITMAP) wxBM->GetHBITMAP()); HBITMAP old = (HBITMAP) ::SelectObject(hdcSrc, (HBITMAP) wxBM->GetHBITMAP());
HBITMAP hBitmap = CreateCompatibleBitmap(hdcSrc, HBITMAP hBitmap = CreateCompatibleBitmap(hdcSrc,
wxBM->GetWidth(), wxBM->GetHeight()); wxBM->GetWidth(), wxBM->GetHeight());
@@ -133,7 +133,7 @@ bool wxSetClipboardData(wxDataFormat dataFormat, wxObject *obj, int width, int h
{ {
#if wxUSE_IMAGE_LOADING_IN_MSW #if wxUSE_IMAGE_LOADING_IN_MSW
HBITMAP hBitmap=(HBITMAP) ((wxBitmap *)obj)->GetHBITMAP(); HBITMAP hBitmap=(HBITMAP) ((wxBitmap *)obj)->GetHBITMAP();
HANDLE hDIB=BitmapToDIB(hBitmap,NULL); // NULL==uses system palette HANDLE hDIB=BitmapToDIB(hBitmap,(HPALETTE) NULL); // NULL==uses system palette
bool success = (::SetClipboardData(CF_DIB,hDIB) != 0); bool success = (::SetClipboardData(CF_DIB,hDIB) != 0);
#else #else
bool success=FALSE; bool success=FALSE;
@@ -220,8 +220,8 @@ wxObject *wxGetClipboardData(wxDataFormat dataFormat, long *len)
if (!hBitmap) if (!hBitmap)
return NULL; return NULL;
HDC hdcMem = CreateCompatibleDC(NULL); HDC hdcMem = CreateCompatibleDC((HDC) NULL);
HDC hdcSrc = CreateCompatibleDC(NULL); HDC hdcSrc = CreateCompatibleDC((HDC) NULL);
HBITMAP old = (HBITMAP) ::SelectObject(hdcSrc, hBitmap); HBITMAP old = (HBITMAP) ::SelectObject(hdcSrc, hBitmap);
GetObject(hBitmap, sizeof(BITMAP), (LPSTR)&bm); GetObject(hBitmap, sizeof(BITMAP), (LPSTR)&bm);
@@ -343,6 +343,7 @@ wxClipboard::~wxClipboard()
void wxClipboard::Clear() void wxClipboard::Clear()
{ {
#if wxUSE_DRAG_AND_DROP
wxNode* node = m_data.First(); wxNode* node = m_data.First();
while (node) while (node)
{ {
@@ -351,6 +352,7 @@ void wxClipboard::Clear()
node = node->Next(); node = node->Next();
} }
m_data.Clear(); m_data.Clear();
#endif
} }
bool wxClipboard::Open() bool wxClipboard::Open()

View File

@@ -89,7 +89,7 @@ int wxColourDialog::ShowModal(void)
custColours[i] = RGB(m_colourData.custColours[i].Red(), m_colourData.custColours[i].Green(), m_colourData.custColours[i].Blue()); custColours[i] = RGB(m_colourData.custColours[i].Red(), m_colourData.custColours[i].Green(), m_colourData.custColours[i].Blue());
chooseColorStruct.lStructSize = sizeof(CHOOSECOLOR); chooseColorStruct.lStructSize = sizeof(CHOOSECOLOR);
chooseColorStruct.hwndOwner = (HWND) (m_dialogParent ? (HWND) m_dialogParent->GetHWND() : NULL); chooseColorStruct.hwndOwner = (HWND) (m_dialogParent ? (HWND) m_dialogParent->GetHWND() : (HWND) NULL);
chooseColorStruct.rgbResult = RGB(m_colourData.dataColour.Red(), m_colourData.dataColour.Green(), m_colourData.dataColour.Blue()); chooseColorStruct.rgbResult = RGB(m_colourData.dataColour.Red(), m_colourData.dataColour.Green(), m_colourData.dataColour.Blue());
chooseColorStruct.lpCustColors = custColours; chooseColorStruct.lpCustColors = custColours;

View File

@@ -30,7 +30,7 @@
#include "wx/msw/private.h" #include "wx/msw/private.h"
#if defined(__WIN95__) && !defined(__GNUWIN32__) #if (defined(__WIN95__) && !defined(__GNUWIN32__)) || defined(__TWIN32__)
#include <commctrl.h> #include <commctrl.h>
#endif #endif

View File

@@ -19,9 +19,11 @@
#include <io.h> #include <io.h>
#include <windows.h> #include <windows.h>
#ifndef __TWIN32__
#ifdef __GNUWIN32__ #ifdef __GNUWIN32__
#include "wx/msw/gnuwin32/extra.h" #include "wx/msw/gnuwin32/extra.h"
#endif #endif
#endif
#include "wx/msw/curicop.h" #include "wx/msw/curicop.h"
#include "wx/msw/curico.h" #include "wx/msw/curico.h"
@@ -39,9 +41,9 @@ HICON ReadIconFile( char *szFileName, HINSTANCE hInst, int *W, int *H)
{ HICON hIcon; { HICON hIcon;
HANDLE hDIB; HANDLE hDIB;
if( (hDIB = ReadIcon(szFileName, W, H)) == NULL) if( (hDIB = ReadIcon(szFileName, W, H)) == (HANDLE) NULL)
// read the icon DIB from file // read the icon DIB from file
return NULL; return (HICON) NULL;
hIcon = MakeIcon( hDIB, hInst); // create an icon from DIB hIcon = MakeIcon( hDIB, hInst); // create an icon from DIB
GlobalFree( hDIB); GlobalFree( hDIB);
return hIcon; return hIcon;
@@ -62,9 +64,9 @@ HICON CursorToIcon( char *szFileName, HINSTANCE hInst, int *W, int *H)
{ HANDLE hDIB; // Handle to DIB memory { HANDLE hDIB; // Handle to DIB memory
HICON hIcon; // Handle to Icon HICON hIcon; // Handle to Icon
if( (hDIB = ReadCur( szFileName, NULL, W, H)) == NULL) if( (hDIB = ReadCur( szFileName, NULL, W, H)) == (HANDLE) NULL)
// Read cursor DIB // Read cursor DIB
return NULL; return (HICON) NULL;
hIcon = MakeIcon( hDIB, hInst); // make icon from cursor DIB hIcon = MakeIcon( hDIB, hInst); // make icon from cursor DIB
GlobalFree( hDIB); GlobalFree( hDIB);
return hIcon; return hIcon;
@@ -98,11 +100,10 @@ HANDLE ReadIcon( char *szFileName, int *W, int *H)
++nDirEntries; ++nDirEntries;
if((cbHead != sizeof( ICONFILEHEADER)) || (cbRes != sizeof( ICONFILERES))) if((cbHead != sizeof( ICONFILEHEADER)) || (cbRes != sizeof( ICONFILERES)))
return NULL; return (HANDLE) NULL;
// Verify that it's an .ICON file // Verify that it's an .ICON file
if( iconFileHead.wResourceType != 1) if( iconFileHead.wResourceType != 1)
return NULL; return (HANDLE) NULL;
// inserted by P.S. // inserted by P.S.
while( (nDirEntries < iconFileHead.wResourceCount) && while( (nDirEntries < iconFileHead.wResourceCount) &&
@@ -110,7 +111,7 @@ HANDLE ReadIcon( char *szFileName, int *W, int *H)
{ {
cbRes = _lread( hFile, (LPSTR )&iconFileRes, sizeof( ICONFILERES)); cbRes = _lread( hFile, (LPSTR )&iconFileRes, sizeof( ICONFILERES));
if(cbRes != sizeof( ICONFILERES)) if(cbRes != sizeof( ICONFILERES))
return NULL; return (HANDLE) NULL;
else else
++nDirEntries; ++nDirEntries;
} }
@@ -122,8 +123,9 @@ HANDLE ReadIcon( char *szFileName, int *W, int *H)
// Allocate and lock memory to read in the DIB // Allocate and lock memory to read in the DIB
hDIB = GlobalAlloc(GHND, iconFileRes.dwDIBSize); hDIB = GlobalAlloc(GHND, iconFileRes.dwDIBSize);
if(hDIB == NULL) if(hDIB == (HANDLE) NULL)
return NULL; return (HANDLE) NULL;
#ifdef __WINDOWS_386__ #ifdef __WINDOWS_386__
lpDIB = (LPBITMAPINFO)MK_FP32(GlobalLock(hDIB)); lpDIB = (LPBITMAPINFO)MK_FP32(GlobalLock(hDIB));
#else #else
@@ -143,7 +145,7 @@ HANDLE ReadIcon( char *szFileName, int *W, int *H)
if( (DWORD )cbBits != iconFileRes.dwDIBSize) if( (DWORD )cbBits != iconFileRes.dwDIBSize)
{ {
GlobalFree( hDIB); GlobalFree( hDIB);
return NULL; return (HANDLE) NULL;
} }
return hDIB; return hDIB;
} }
@@ -219,13 +221,13 @@ HICON MakeIcon( HANDLE hDIB, HINSTANCE hInst)
dwBmpSize = (DWORD )(bmpXor.bmWidthBytes * bmpXor.bmHeight * bmpXor.bmPlanes); dwBmpSize = (DWORD )(bmpXor.bmWidthBytes * bmpXor.bmHeight * bmpXor.bmPlanes);
hXorDDB = GlobalAlloc( GHND, dwBmpSize); hXorDDB = GlobalAlloc( GHND, dwBmpSize);
if(hXorDDB == NULL) if(hXorDDB == (HANDLE) NULL)
{ {
// clean up before quitting // clean up before quitting
DeleteObject( hbmXor); DeleteObject( hbmXor);
DeleteDC( hDC); DeleteDC( hDC);
GlobalUnlock( hDIB); GlobalUnlock( hDIB);
return NULL; return (HICON) NULL;
} }
#ifdef __WINDOWS_386__ #ifdef __WINDOWS_386__
@@ -277,8 +279,8 @@ HCURSOR ReadCursorFile( char *szFileName, HINSTANCE hInst, int *W, int *H,
POINT ptHotSpot; POINT ptHotSpot;
// read cur DIB from file // read cur DIB from file
if( (hDIB = ReadCur( szFileName, (LPPOINT )&ptHotSpot, W, H)) == NULL) if( (hDIB = ReadCur( szFileName, (LPPOINT )&ptHotSpot, W, H)) == (HANDLE) NULL)
return NULL; return (HCURSOR) NULL;
hCursor = MakeCursor( hDIB, (LPPOINT )&ptHotSpot, hInst);//create cur from DIB hCursor = MakeCursor( hDIB, (LPPOINT )&ptHotSpot, hInst);//create cur from DIB
if(XHot != 0) if(XHot != 0)
*XHot = ptHotSpot.x; *XHot = ptHotSpot.x;
@@ -305,9 +307,9 @@ HCURSOR IconToCursor( char *szFileName, HINSTANCE hInst, int XHot, int YHot,
HANDLE hDIB; HANDLE hDIB;
POINT ptHotSpot; POINT ptHotSpot;
if( (hDIB = ReadIcon( szFileName, W, H)) == NULL) if( (hDIB = ReadIcon( szFileName, W, H)) == (HANDLE) NULL)
//read icon file to get icon DIB //read icon file to get icon DIB
return NULL; return (HCURSOR) NULL;
// Set the hot spot of the cursor // Set the hot spot of the cursor
ptHotSpot.x = XHot; ptHotSpot.x = XHot;
ptHotSpot.y = YHot; ptHotSpot.y = YHot;
@@ -345,11 +347,11 @@ HANDLE ReadCur( char *szFileName, LPPOINT lpptHotSpot, int *W, int *H)
++nDirEntries; ++nDirEntries;
if((cbHead != sizeof( CURFILEHEADER)) || (cbRes != sizeof( CURFILERES))) if((cbHead != sizeof( CURFILEHEADER)) || (cbRes != sizeof( CURFILERES)))
return NULL; return (HANDLE) NULL;
// Verify that it's an .CUR file // Verify that it's an .CUR file
if ((curFileRes.bReserved1 != 0) || (curFileHead.wResourceType != 2)) if ((curFileRes.bReserved1 != 0) || (curFileHead.wResourceType != 2))
return NULL; return (HANDLE) NULL;
// following added by P.S. // following added by P.S.
while( (nDirEntries < curFileHead.wResourceCount) && while( (nDirEntries < curFileHead.wResourceCount) &&
@@ -357,7 +359,7 @@ HANDLE ReadCur( char *szFileName, LPPOINT lpptHotSpot, int *W, int *H)
{ {
cbRes = _lread( hFile, (LPSTR )&curFileRes, sizeof( CURFILERES)); cbRes = _lread( hFile, (LPSTR )&curFileRes, sizeof( CURFILERES));
if(cbRes != sizeof( CURFILERES)) if(cbRes != sizeof( CURFILERES))
return NULL; return (HANDLE) NULL;
else else
++nDirEntries; ++nDirEntries;
} }
@@ -369,8 +371,8 @@ HANDLE ReadCur( char *szFileName, LPPOINT lpptHotSpot, int *W, int *H)
// Allocate & lock memory to read in the DIB // Allocate & lock memory to read in the DIB
hDIB = GlobalAlloc(GHND, curFileRes.dwDIBSize); hDIB = GlobalAlloc(GHND, curFileRes.dwDIBSize);
if(hDIB == NULL) if(hDIB == (HANDLE) NULL)
return NULL; return (HANDLE) NULL;
#ifdef __WINDOWS_386__ #ifdef __WINDOWS_386__
lpDIB = (LPBITMAPINFO )MK_FP32(GlobalLock(hDIB)); lpDIB = (LPBITMAPINFO )MK_FP32(GlobalLock(hDIB));
@@ -390,9 +392,9 @@ HANDLE ReadCur( char *szFileName, LPPOINT lpptHotSpot, int *W, int *H)
{ {
GlobalUnlock( hDIB); GlobalUnlock( hDIB);
GlobalFree( hDIB); GlobalFree( hDIB);
return NULL; return (HANDLE) NULL;
} }
if(lpptHotSpot != NULL) // If it is necessary to know the hot spot if(lpptHotSpot != (LPPOINT) NULL) // If it is necessary to know the hot spot
{ {
lpptHotSpot->x = (int )curFileRes.wXHotspot; lpptHotSpot->x = (int )curFileRes.wXHotspot;
lpptHotSpot->y = (int )curFileRes.wYHotspot; lpptHotSpot->y = (int )curFileRes.wYHotspot;
@@ -433,13 +435,13 @@ HBITMAP ColorDDBToMonoDDB ( HBITMAP hbm)
dwLen = bi.biSize + PaletteSize((LPSTR)&bi); dwLen = bi.biSize + PaletteSize((LPSTR)&bi);
hdc = GetDC( NULL); hdc = GetDC( (HWND) NULL);
hdib = GlobalAlloc( GHND, dwLen); hdib = GlobalAlloc( GHND, dwLen);
if (hdib == NULL) if (hdib == (HANDLE) NULL)
{ {
ReleaseDC( NULL, hdc); ReleaseDC( (HWND) NULL, hdc);
return NULL; return (HBITMAP) NULL;
} }
#ifdef __WINDOWS_386__ #ifdef __WINDOWS_386__
@@ -469,8 +471,8 @@ HBITMAP ColorDDBToMonoDDB ( HBITMAP hbm)
else else
{ {
GlobalFree( hdib); GlobalFree( hdib);
ReleaseDC( NULL, hdc); ReleaseDC( (HWND) NULL, hdc);
return NULL; return (HBITMAP) NULL;
} }
// Call GetDIBits with a NON-NULL lpBits parameter, to actually // Call GetDIBits with a NON-NULL lpBits parameter, to actually
@@ -487,9 +489,9 @@ HBITMAP ColorDDBToMonoDDB ( HBITMAP hbm)
(LPBITMAPINFO)lpbi, DIB_RGB_COLORS) == 0) (LPBITMAPINFO)lpbi, DIB_RGB_COLORS) == 0)
{ {
GlobalUnlock( hdib); GlobalUnlock( hdib);
hdib = NULL; hdib = (HANDLE) NULL;
ReleaseDC( NULL, hdc); ReleaseDC( (HWND) NULL, hdc);
return NULL; return (HBITMAP) NULL;
} }
// Finally, create a monochrome DDB, and put the DIB into // Finally, create a monochrome DDB, and put the DIB into
@@ -503,7 +505,7 @@ HBITMAP ColorDDBToMonoDDB ( HBITMAP hbm)
GlobalUnlock( hdib); GlobalUnlock( hdib);
GlobalFree( hdib); GlobalFree( hdib);
ReleaseDC(NULL, hdc); ReleaseDC((HWND) NULL, hdc);
return hbmMono; return hbmMono;
} }
@@ -581,12 +583,12 @@ HCURSOR MakeCursor( HANDLE hDIB, LPPOINT lpptHotSpot, HINSTANCE hInst)
dwBmpSize = (DWORD )(bmpXor.bmWidthBytes * bmpXor.bmHeight * bmpXor.bmPlanes); dwBmpSize = (DWORD )(bmpXor.bmWidthBytes * bmpXor.bmHeight * bmpXor.bmPlanes);
hXorDDB = GlobalAlloc( GHND, dwBmpSize); hXorDDB = GlobalAlloc( GHND, dwBmpSize);
if(hXorDDB == NULL) if(hXorDDB == (HANDLE) NULL)
{ // clean up before quitting { // clean up before quitting
DeleteObject( hbmXor); DeleteObject( hbmXor);
DeleteDC( hDC); DeleteDC( hDC);
GlobalUnlock( hDIB); GlobalUnlock( hDIB);
return NULL; return (HCURSOR) NULL;
} }
#ifdef __WINDOWS_386__ #ifdef __WINDOWS_386__
lpXorDDB = (LPSTR)MK_FP32(GlobalLock( hXorDDB)); lpXorDDB = (LPSTR)MK_FP32(GlobalLock( hXorDDB));
@@ -766,7 +768,7 @@ HCURSOR MakeCursorFromBitmap(HINSTANCE hInst, HBITMAP hBitmap, POINT *pPoint)
NPSTR andBits; NPSTR andBits;
NPSTR xorBits; NPSTR xorBits;
hDC = GetDC(NULL); hDC = GetDC((HWND) NULL);
hDCColor = CreateCompatibleDC(hDC); hDCColor = CreateCompatibleDC(hDC);
hDCMono = CreateCompatibleDC(hDC); hDCMono = CreateCompatibleDC(hDC);
hAndBmp = CreateCompatibleBitmap(hDCMono, 32, 32); hAndBmp = CreateCompatibleBitmap(hDCMono, 32, 32);
@@ -843,7 +845,7 @@ HICON MakeIconFromBitmap(HINSTANCE hInst, HBITMAP hBitmap)
NPSTR andBits; NPSTR andBits;
NPSTR xorBits; NPSTR xorBits;
hDC = GetDC(NULL); hDC = GetDC((HWND) NULL);
hDCColor = CreateCompatibleDC(hDC); hDCColor = CreateCompatibleDC(hDC);
hDCMono = CreateCompatibleDC(hDC); hDCMono = CreateCompatibleDC(hDC);
hAndBmp = CreateCompatibleBitmap(hDCMono, 32, 32); hAndBmp = CreateCompatibleBitmap(hDCMono, 32, 32);
@@ -882,7 +884,7 @@ HICON MakeIconFromBitmap(HINSTANCE hInst, HBITMAP hBitmap)
DeleteDC(hDCMono); DeleteDC(hDCMono);
DeleteObject(hAndBmp); DeleteObject(hAndBmp);
DeleteObject(hXorBmp); DeleteObject(hXorBmp);
ReleaseDC(NULL, hDC); ReleaseDC((HWND) NULL, hDC);
#ifndef __WIN32__ #ifndef __WIN32__
LocalUnlock(LocalHandle((WORD) andBits)); LocalUnlock(LocalHandle((WORD) andBits));
LocalUnlock(LocalHandle((WORD) xorBits)); LocalUnlock(LocalHandle((WORD) xorBits));

View File

@@ -125,29 +125,29 @@ wxCursor::wxCursor(int cursor_type)
switch (cursor_type) switch (cursor_type)
{ {
case wxCURSOR_WAIT: case wxCURSOR_WAIT:
M_CURSORDATA->m_hCursor = (WXHCURSOR) LoadCursor(NULL, IDC_WAIT); M_CURSORDATA->m_hCursor = (WXHCURSOR) LoadCursor((HINSTANCE) NULL, IDC_WAIT);
break; break;
case wxCURSOR_IBEAM: case wxCURSOR_IBEAM:
M_CURSORDATA->m_hCursor = (WXHCURSOR) LoadCursor(NULL, IDC_IBEAM); M_CURSORDATA->m_hCursor = (WXHCURSOR) LoadCursor((HINSTANCE) NULL, IDC_IBEAM);
break; break;
case wxCURSOR_CROSS: case wxCURSOR_CROSS:
M_CURSORDATA->m_hCursor = (WXHCURSOR) LoadCursor(NULL, IDC_CROSS); M_CURSORDATA->m_hCursor = (WXHCURSOR) LoadCursor((HINSTANCE) NULL, IDC_CROSS);
break; break;
case wxCURSOR_SIZENWSE: case wxCURSOR_SIZENWSE:
M_CURSORDATA->m_hCursor = (WXHCURSOR) LoadCursor(NULL, IDC_SIZENWSE); M_CURSORDATA->m_hCursor = (WXHCURSOR) LoadCursor((HINSTANCE) NULL, IDC_SIZENWSE);
break; break;
case wxCURSOR_SIZENESW: case wxCURSOR_SIZENESW:
M_CURSORDATA->m_hCursor = (WXHCURSOR) LoadCursor(NULL, IDC_SIZENESW); M_CURSORDATA->m_hCursor = (WXHCURSOR) LoadCursor((HINSTANCE) NULL, IDC_SIZENESW);
break; break;
case wxCURSOR_SIZEWE: case wxCURSOR_SIZEWE:
M_CURSORDATA->m_hCursor = (WXHCURSOR) LoadCursor(NULL, IDC_SIZEWE); M_CURSORDATA->m_hCursor = (WXHCURSOR) LoadCursor((HINSTANCE) NULL, IDC_SIZEWE);
break; break;
case wxCURSOR_SIZENS: case wxCURSOR_SIZENS:
M_CURSORDATA->m_hCursor = (WXHCURSOR) LoadCursor(NULL, IDC_SIZENS); M_CURSORDATA->m_hCursor = (WXHCURSOR) LoadCursor((HINSTANCE) NULL, IDC_SIZENS);
break; break;
case wxCURSOR_CHAR: case wxCURSOR_CHAR:
{ {
M_CURSORDATA->m_hCursor = (WXHCURSOR) LoadCursor(NULL, IDC_ARROW); M_CURSORDATA->m_hCursor = (WXHCURSOR) LoadCursor((HINSTANCE) NULL, IDC_ARROW);
break; break;
} }
case wxCURSOR_HAND: case wxCURSOR_HAND:
@@ -177,17 +177,17 @@ wxCursor::wxCursor(int cursor_type)
} }
case wxCURSOR_LEFT_BUTTON: case wxCURSOR_LEFT_BUTTON:
{ {
M_CURSORDATA->m_hCursor = (WXHCURSOR) LoadCursor(NULL, IDC_ARROW); M_CURSORDATA->m_hCursor = (WXHCURSOR) LoadCursor((HINSTANCE) NULL, IDC_ARROW);
break; break;
} }
case wxCURSOR_RIGHT_BUTTON: case wxCURSOR_RIGHT_BUTTON:
{ {
M_CURSORDATA->m_hCursor = (WXHCURSOR) LoadCursor(NULL, IDC_ARROW); M_CURSORDATA->m_hCursor = (WXHCURSOR) LoadCursor((HINSTANCE) NULL, IDC_ARROW);
break; break;
} }
case wxCURSOR_MIDDLE_BUTTON: case wxCURSOR_MIDDLE_BUTTON:
{ {
M_CURSORDATA->m_hCursor = (WXHCURSOR) LoadCursor(NULL, IDC_ARROW); M_CURSORDATA->m_hCursor = (WXHCURSOR) LoadCursor((HINSTANCE) NULL, IDC_ARROW);
break; break;
} }
case wxCURSOR_SIZING: case wxCURSOR_SIZING:
@@ -232,7 +232,7 @@ wxCursor::wxCursor(int cursor_type)
} }
default: default:
case wxCURSOR_ARROW: case wxCURSOR_ARROW:
M_CURSORDATA->m_hCursor = (WXHCURSOR) LoadCursor(NULL, IDC_ARROW); M_CURSORDATA->m_hCursor = (WXHCURSOR) LoadCursor((HINSTANCE) NULL, IDC_ARROW);
break; break;
} }
} }
@@ -242,7 +242,7 @@ wxCursor::~wxCursor(void)
// FreeResource(TRUE); // FreeResource(TRUE);
} }
bool wxCursor::FreeResource(bool force) bool wxCursor::FreeResource(bool WXUNUSED(force))
{ {
if (M_CURSORDATA && M_CURSORDATA->m_hCursor && M_CURSORDATA->m_destroyCursor) if (M_CURSORDATA && M_CURSORDATA->m_hCursor && M_CURSORDATA->m_destroyCursor)
{ {

View File

@@ -255,7 +255,7 @@ void wxDC::SetPalette(const wxPalette& palette)
m_oldPalette = 0; m_oldPalette = 0;
} }
m_palette = m_palette; m_palette = palette;
if (!m_palette.Ok()) if (!m_palette.Ok())
{ {
@@ -380,7 +380,7 @@ void wxDC::DrawArc(long x1,long y1,long x2,long y2, long xc, long yc)
double radius = (double)sqrt(dx*dx+dy*dy) ;; double radius = (double)sqrt(dx*dx+dy*dy) ;;
if (x1==x2 && x2==y2) if (x1==x2 && x2==y2)
{ {
DrawEllipse(xc,yc,(double)(radius*2.0),(double)(radius*2)) ; DrawEllipse(xc,yc,(long)(radius*2.0),(long)(radius*2.0)) ;
return ; return ;
} }
@@ -605,7 +605,7 @@ void wxDC::DrawEllipticArc(long x,long y,long w,long h,double sa,double ea)
void wxDC::DrawIcon(const wxIcon& icon, long x, long y) void wxDC::DrawIcon(const wxIcon& icon, long x, long y)
{ {
#if defined(__WIN32__) && !defined(__SC__) #if defined(__WIN32__) && !defined(__SC__) && !defined(__TWIN32__)
::DrawIconEx((HDC) m_hDC, XLOG2DEV(x), YLOG2DEV(y), (HICON) icon.GetHICON(), ::DrawIconEx((HDC) m_hDC, XLOG2DEV(x), YLOG2DEV(y), (HICON) icon.GetHICON(),
icon.GetWidth(), icon.GetHeight(), 0, 0, DI_NORMAL); icon.GetWidth(), icon.GetHeight(), 0, 0, DI_NORMAL);
#else #else
@@ -677,7 +677,7 @@ void wxDC::SetFont(const wxFont& the_font)
if (m_font.Ok() && m_font.GetResourceHandle()) if (m_font.Ok() && m_font.GetResourceHandle())
{ {
HFONT f = (HFONT) ::SelectObject((HDC) m_hDC, (HFONT) m_font.GetResourceHandle()); HFONT f = (HFONT) ::SelectObject((HDC) m_hDC, (HFONT) m_font.GetResourceHandle());
if (f == NULL) if (f == (HFONT) NULL)
{ {
wxDebugMsg("::SelectObject failed in wxDC::SetFont."); wxDebugMsg("::SelectObject failed in wxDC::SetFont.");
} }
@@ -894,10 +894,14 @@ bool wxDC::StartDoc(const wxString& message)
#else #else
#ifdef UNICODE #ifdef UNICODE
::StartDocW((HDC) m_hDC, &docinfo); ::StartDocW((HDC) m_hDC, &docinfo);
#else
#ifdef __TWIN32__
::StartDoc((HDC) m_hDC, &docinfo);
#else #else
::StartDocA((HDC) m_hDC, &docinfo); ::StartDocA((HDC) m_hDC, &docinfo);
#endif #endif
#endif #endif
#endif
#ifndef __WIN16__ #ifndef __WIN16__
if (ret <= 0) if (ret <= 0)
@@ -1680,7 +1684,7 @@ static bool wx_spline_add_point(double x, double y)
static void wx_spline_draw_point_array(wxDC *dc) static void wx_spline_draw_point_array(wxDC *dc)
{ {
dc->DrawLines(&wx_spline_point_list, (double)0.0, (double)0.0); dc->DrawLines(&wx_spline_point_list, 0, 0);
wxNode *node = wx_spline_point_list.First(); wxNode *node = wx_spline_point_list.First();
while (node) while (node)
{ {

View File

@@ -39,7 +39,7 @@ IMPLEMENT_DYNAMIC_CLASS(wxMemoryDC, wxDC)
wxMemoryDC::wxMemoryDC(void) wxMemoryDC::wxMemoryDC(void)
{ {
m_hDC = (WXHDC) ::CreateCompatibleDC(NULL); m_hDC = (WXHDC) ::CreateCompatibleDC((HDC) NULL);
m_ok = (m_hDC != 0); m_ok = (m_hDC != 0);
m_bOwnsDC = TRUE; m_bOwnsDC = TRUE;

View File

@@ -65,7 +65,7 @@ wxPrinterDC::wxPrinterDC(const wxString& driver_name, const wxString& device_nam
PRINTDLG pd; PRINTDLG pd;
pd.lStructSize = sizeof( PRINTDLG ); pd.lStructSize = sizeof( PRINTDLG );
pd.hwndOwner=NULL; pd.hwndOwner=(HWND) NULL;
pd.hDevMode=(HANDLE)NULL; pd.hDevMode=(HANDLE)NULL;
pd.hDevNames=(HANDLE)NULL; pd.hDevNames=(HANDLE)NULL;
pd.Flags=PD_RETURNDC | PD_NOSELECTION | PD_NOPAGENUMS; pd.Flags=PD_RETURNDC | PD_NOSELECTION | PD_NOPAGENUMS;

View File

@@ -34,14 +34,14 @@ IMPLEMENT_DYNAMIC_CLASS(wxScreenDC, wxWindowDC)
// Create a DC representing the whole screen // Create a DC representing the whole screen
wxScreenDC::wxScreenDC(void) wxScreenDC::wxScreenDC(void)
{ {
m_hDC = (WXHDC) ::GetDC(NULL); m_hDC = (WXHDC) ::GetDC((HWND) NULL);
m_hDCCount ++; m_hDCCount ++;
} }
wxScreenDC::~wxScreenDC(void) wxScreenDC::~wxScreenDC(void)
{ {
SelectOldObjects(m_hDC); SelectOldObjects(m_hDC);
::ReleaseDC(NULL, (HDC) m_hDC); ::ReleaseDC((HWND) NULL, (HDC) m_hDC);
m_hDC = 0; m_hDC = 0;
m_hDCCount --; m_hDCCount --;
} }

View File

@@ -34,9 +34,11 @@
#include "wx/msw/private.h" #include "wx/msw/private.h"
#include "wx/dde.h" #include "wx/dde.h"
#ifndef __TWIN32__
#ifdef __GNUWIN32__ #ifdef __GNUWIN32__
#include "wx/msw/gnuwin32/extra.h" #include "wx/msw/gnuwin32/extra.h"
#endif #endif
#endif
#include <windows.h> #include <windows.h>
#include <ddeml.h> #include <ddeml.h>
@@ -197,7 +199,7 @@ bool wxDDEServer::Create(const wxString& server_name)
m_serviceName = server_name; m_serviceName = server_name;
HSZ serviceName = DdeCreateStringHandle(DDEIdInst, (char*) (const char *)server_name, CP_WINANSI); HSZ serviceName = DdeCreateStringHandle(DDEIdInst, (char*) (const char *)server_name, CP_WINANSI);
if (DdeNameService(DDEIdInst, serviceName, NULL, DNS_REGISTER) == 0) if (DdeNameService(DDEIdInst, serviceName, (HSZ) NULL, DNS_REGISTER) == 0)
{ {
DDEPrintError(); DDEPrintError();
return FALSE; return FALSE;
@@ -309,8 +311,8 @@ wxConnectionBase *wxDDEClient::MakeConnection(const wxString& /* host */, const
HSZ topic_atom = DdeCreateStringHandle(DDEIdInst, (char*) (const char *)topic, CP_WINANSI); HSZ topic_atom = DdeCreateStringHandle(DDEIdInst, (char*) (const char *)topic, CP_WINANSI);
HCONV hConv = DdeConnect(DDEIdInst, serviceName, topic_atom, (PCONVCONTEXT)NULL); HCONV hConv = DdeConnect(DDEIdInst, serviceName, topic_atom, (PCONVCONTEXT)NULL);
if (hConv == NULL) if (hConv == (HCONV) NULL)
return NULL; return (wxConnectionBase*) NULL;
else else
{ {
wxDDEConnection *connection = (wxDDEConnection*) OnMakeConnection(); wxDDEConnection *connection = (wxDDEConnection*) OnMakeConnection();
@@ -322,7 +324,7 @@ wxConnectionBase *wxDDEClient::MakeConnection(const wxString& /* host */, const
m_connections.Append(connection); m_connections.Append(connection);
return connection; return connection;
} }
else return NULL; else return (wxConnectionBase*) NULL;
} }
} }
@@ -778,7 +780,7 @@ void DDEPrintError(void)
err = "Unrecognised error type."; err = "Unrecognised error type.";
break; break;
} }
MessageBox(NULL, (LPCSTR)err, "DDE Error", MB_OK | MB_ICONINFORMATION); MessageBox((HWND) NULL, (LPCSTR)err, "DDE Error", MB_OK | MB_ICONINFORMATION);
} }
#endif #endif

View File

@@ -48,9 +48,11 @@
#include "wx/msw/dib.h" #include "wx/msw/dib.h"
#ifndef __TWIN32__
#ifdef __GNUWIN32__ #ifdef __GNUWIN32__
#include "wx/msw/gnuwin32/extra.h" #include "wx/msw/gnuwin32/extra.h"
#endif #endif
#endif
#ifndef SEEK_CUR #ifndef SEEK_CUR
/* flags for _lseek */ /* flags for _lseek */
@@ -259,7 +261,7 @@ HANDLE DibFromBitmap(HBITMAP hbm, DWORD biStyle, WORD biBits, HPALETTE hpal)
dwLen = bi.biSize + PaletteSize(&bi); dwLen = bi.biSize + PaletteSize(&bi);
hdc = GetDC(NULL); hdc = GetDC((HWND) NULL);
hpal = SelectPalette(hdc, hpal, FALSE); hpal = SelectPalette(hdc, hpal, FALSE);
RealizePalette(hdc); RealizePalette(hdc);
@@ -327,7 +329,7 @@ HANDLE DibFromBitmap(HBITMAP hbm, DWORD biStyle, WORD biBits, HPALETTE hpal)
GlobalUnlock(hdib); GlobalUnlock(hdib);
hdib = NULL; hdib = NULL;
SelectPalette(hdc, hpal, FALSE); SelectPalette(hdc, hpal, FALSE);
ReleaseDC(NULL, hdc); ReleaseDC((HWND) NULL, hdc);
return NULL; return NULL;
} }

View File

@@ -29,7 +29,7 @@
#include "wx/msw/gauge95.h" #include "wx/msw/gauge95.h"
#include "wx/msw/private.h" #include "wx/msw/private.h"
#if defined(__WIN95__) && !defined(__GNUWIN32__) #if (defined(__WIN95__) && !defined(__GNUWIN32__)) || defined(__TWIN32__)
#include <commctrl.h> #include <commctrl.h>
#endif #endif

View File

@@ -35,7 +35,7 @@
#include "wx/msw/imaglist.h" #include "wx/msw/imaglist.h"
#include "wx/msw/private.h" #include "wx/msw/private.h"
#ifndef __GNUWIN32__ #if (defined(__WIN95__) && !defined(__GNUWIN32__)) || defined(__TWIN32__)
#include <commctrl.h> #include <commctrl.h>
#endif #endif
@@ -104,9 +104,14 @@ int wxImageList::Add(const wxBitmap& bitmap, const wxBitmap& mask)
// 'bitmap'. // 'bitmap'.
int wxImageList::Add(const wxBitmap& bitmap, const wxColour& maskColour) int wxImageList::Add(const wxBitmap& bitmap, const wxColour& maskColour)
{ {
#ifdef __TWIN32__
wxFAIL_MSG("ImageList_AddMasked not implemented in TWIN32");
return -1;
#else
HBITMAP hBitmap1 = (HBITMAP) bitmap.GetHBITMAP(); HBITMAP hBitmap1 = (HBITMAP) bitmap.GetHBITMAP();
COLORREF colorRef = PALETTERGB(maskColour.Red(), maskColour.Green(), maskColour.Blue()); COLORREF colorRef = PALETTERGB(maskColour.Red(), maskColour.Green(), maskColour.Blue());
return ImageList_AddMasked((HIMAGELIST) GetHIMAGELIST(), hBitmap1, colorRef); return ImageList_AddMasked((HIMAGELIST) GetHIMAGELIST(), hBitmap1, colorRef);
#endif
} }
// Adds a bitmap and mask from an icon. // Adds a bitmap and mask from an icon.
@@ -121,11 +126,16 @@ int wxImageList::Add(const wxIcon& icon)
// 'bitmap' and 'mask'. // 'bitmap' and 'mask'.
bool wxImageList::Replace(int index, const wxBitmap& bitmap, const wxBitmap& mask) bool wxImageList::Replace(int index, const wxBitmap& bitmap, const wxBitmap& mask)
{ {
#ifdef __TWIN32__
wxFAIL_MSG("ImageList_Replace not implemented in TWIN32");
return FALSE;
#else
HBITMAP hBitmap1 = (HBITMAP) bitmap.GetHBITMAP(); HBITMAP hBitmap1 = (HBITMAP) bitmap.GetHBITMAP();
HBITMAP hBitmap2 = 0; HBITMAP hBitmap2 = 0;
if ( mask.Ok() ) if ( mask.Ok() )
hBitmap2 = (HBITMAP) mask.GetHBITMAP(); hBitmap2 = (HBITMAP) mask.GetHBITMAP();
return (ImageList_Replace((HIMAGELIST) GetHIMAGELIST(), index, hBitmap1, hBitmap2) != 0); return (ImageList_Replace((HIMAGELIST) GetHIMAGELIST(), index, hBitmap1, hBitmap2) != 0);
#endif
} }
/* Not supported by Win95 /* Not supported by Win95
@@ -150,7 +160,12 @@ bool wxImageList::Replace(int index, const wxIcon& icon)
// Removes the image at the given index. // Removes the image at the given index.
bool wxImageList::Remove(int index) bool wxImageList::Remove(int index)
{ {
#ifdef __TWIN32__
wxFAIL_MSG("ImageList_Replace not implemented in TWIN32");
return FALSE;
#else
return (ImageList_Remove((HIMAGELIST) GetHIMAGELIST(), index) != 0); return (ImageList_Remove((HIMAGELIST) GetHIMAGELIST(), index) != 0);
#endif
} }
// Remove all images // Remove all images
@@ -171,6 +186,10 @@ bool wxImageList::RemoveAll(void)
bool wxImageList::Draw(int index, wxDC& dc, int x, int y, bool wxImageList::Draw(int index, wxDC& dc, int x, int y,
int flags, bool solidBackground) int flags, bool solidBackground)
{ {
#ifdef __TWIN32__
wxFAIL_MSG("ImageList_Replace not implemented in TWIN32");
return FALSE;
#else
HDC hDC = (HDC) dc.GetHDC(); HDC hDC = (HDC) dc.GetHDC();
if ( !hDC ) if ( !hDC )
return FALSE; return FALSE;
@@ -204,6 +223,7 @@ bool wxImageList::Draw(int index, wxDC& dc, int x, int y,
return (ImageList_Draw((HIMAGELIST) GetHIMAGELIST(), index, hDC, return (ImageList_Draw((HIMAGELIST) GetHIMAGELIST(), index, hDC,
x, y, style) != 0); x, y, style) != 0);
#endif
} }
#endif #endif

View File

@@ -30,12 +30,14 @@
typedef UINT MMRESULT; typedef UINT MMRESULT;
#endif #endif
#ifndef __TWIN32__
#ifdef __GNUWIN32__ #ifdef __GNUWIN32__
#include <wx/msw/gnuwin32/extra.h> #include <wx/msw/gnuwin32/extra.h>
#endif #endif
#endif
// Why doesn't BC++ have joyGetPosEx? // Why doesn't BC++ have joyGetPosEx?
#if !defined(__WIN32__) || defined(__BORLANDC__) #if !defined(__WIN32__) || defined(__BORLANDC__) || defined(__TWIN32__)
#define NO_JOYGETPOSEX #define NO_JOYGETPOSEX
#endif #endif
@@ -299,7 +301,7 @@ int wxJoystick::GetNumberButtons(void) const
int wxJoystick::GetNumberAxes(void) const int wxJoystick::GetNumberAxes(void) const
{ {
#ifdef __WIN32__ #if defined(__WIN32__) && !defined(__TWIN32__)
JOYCAPS joyCaps; JOYCAPS joyCaps;
if (joyGetDevCaps(m_joystick, & joyCaps, sizeof(JOYCAPS)) != JOYERR_NOERROR) if (joyGetDevCaps(m_joystick, & joyCaps, sizeof(JOYCAPS)) != JOYERR_NOERROR)
return 0; return 0;
@@ -312,7 +314,7 @@ int wxJoystick::GetNumberAxes(void) const
int wxJoystick::GetMaxButtons(void) const int wxJoystick::GetMaxButtons(void) const
{ {
#ifdef __WIN32__ #if defined(__WIN32__) && !defined(__TWIN32__)
JOYCAPS joyCaps; JOYCAPS joyCaps;
if (joyGetDevCaps(m_joystick, & joyCaps, sizeof(JOYCAPS)) != JOYERR_NOERROR) if (joyGetDevCaps(m_joystick, & joyCaps, sizeof(JOYCAPS)) != JOYERR_NOERROR)
return 0; return 0;
@@ -325,7 +327,7 @@ int wxJoystick::GetMaxButtons(void) const
int wxJoystick::GetMaxAxes(void) const int wxJoystick::GetMaxAxes(void) const
{ {
#ifdef __WIN32__ #if defined(__WIN32__) && !defined(__TWIN32__)
JOYCAPS joyCaps; JOYCAPS joyCaps;
if (joyGetDevCaps(m_joystick, & joyCaps, sizeof(JOYCAPS)) != JOYERR_NOERROR) if (joyGetDevCaps(m_joystick, & joyCaps, sizeof(JOYCAPS)) != JOYERR_NOERROR)
return 0; return 0;
@@ -356,7 +358,7 @@ int wxJoystick::GetPollingMax(void) const
int wxJoystick::GetRudderMin(void) const int wxJoystick::GetRudderMin(void) const
{ {
#ifdef __WIN32__ #if defined(__WIN32__) && !defined(__TWIN32__)
JOYCAPS joyCaps; JOYCAPS joyCaps;
if (joyGetDevCaps(m_joystick, & joyCaps, sizeof(JOYCAPS)) != JOYERR_NOERROR) if (joyGetDevCaps(m_joystick, & joyCaps, sizeof(JOYCAPS)) != JOYERR_NOERROR)
return 0; return 0;
@@ -369,7 +371,7 @@ int wxJoystick::GetRudderMin(void) const
int wxJoystick::GetRudderMax(void) const int wxJoystick::GetRudderMax(void) const
{ {
#ifdef __WIN32__ #if defined(__WIN32__) && !defined(__TWIN32__)
JOYCAPS joyCaps; JOYCAPS joyCaps;
if (joyGetDevCaps(m_joystick, & joyCaps, sizeof(JOYCAPS)) != JOYERR_NOERROR) if (joyGetDevCaps(m_joystick, & joyCaps, sizeof(JOYCAPS)) != JOYERR_NOERROR)
return 0; return 0;
@@ -382,7 +384,7 @@ int wxJoystick::GetRudderMax(void) const
int wxJoystick::GetUMin(void) const int wxJoystick::GetUMin(void) const
{ {
#ifdef __WIN32__ #if defined(__WIN32__) && !defined(__TWIN32__)
JOYCAPS joyCaps; JOYCAPS joyCaps;
if (joyGetDevCaps(m_joystick, & joyCaps, sizeof(JOYCAPS)) != JOYERR_NOERROR) if (joyGetDevCaps(m_joystick, & joyCaps, sizeof(JOYCAPS)) != JOYERR_NOERROR)
return 0; return 0;
@@ -395,7 +397,7 @@ int wxJoystick::GetUMin(void) const
int wxJoystick::GetUMax(void) const int wxJoystick::GetUMax(void) const
{ {
#ifdef __WIN32__ #if defined(__WIN32__) && !defined(__TWIN32__)
JOYCAPS joyCaps; JOYCAPS joyCaps;
if (joyGetDevCaps(m_joystick, & joyCaps, sizeof(JOYCAPS)) != JOYERR_NOERROR) if (joyGetDevCaps(m_joystick, & joyCaps, sizeof(JOYCAPS)) != JOYERR_NOERROR)
return 0; return 0;
@@ -408,7 +410,7 @@ int wxJoystick::GetUMax(void) const
int wxJoystick::GetVMin(void) const int wxJoystick::GetVMin(void) const
{ {
#ifdef __WIN32__ #if defined(__WIN32__) && !defined(__TWIN32__)
JOYCAPS joyCaps; JOYCAPS joyCaps;
if (joyGetDevCaps(m_joystick, & joyCaps, sizeof(JOYCAPS)) != JOYERR_NOERROR) if (joyGetDevCaps(m_joystick, & joyCaps, sizeof(JOYCAPS)) != JOYERR_NOERROR)
return 0; return 0;
@@ -421,7 +423,7 @@ int wxJoystick::GetVMin(void) const
int wxJoystick::GetVMax(void) const int wxJoystick::GetVMax(void) const
{ {
#ifdef __WIN32__ #if defined(__WIN32__) && !defined(__TWIN32__)
JOYCAPS joyCaps; JOYCAPS joyCaps;
if (joyGetDevCaps(m_joystick, & joyCaps, sizeof(JOYCAPS)) != JOYERR_NOERROR) if (joyGetDevCaps(m_joystick, & joyCaps, sizeof(JOYCAPS)) != JOYERR_NOERROR)
return 0; return 0;
@@ -435,7 +437,7 @@ int wxJoystick::GetVMax(void) const
bool wxJoystick::HasRudder(void) const bool wxJoystick::HasRudder(void) const
{ {
#ifdef __WIN32__ #if defined(__WIN32__) && !defined(__TWIN32__)
JOYCAPS joyCaps; JOYCAPS joyCaps;
if (joyGetDevCaps(m_joystick, & joyCaps, sizeof(JOYCAPS)) != JOYERR_NOERROR) if (joyGetDevCaps(m_joystick, & joyCaps, sizeof(JOYCAPS)) != JOYERR_NOERROR)
return FALSE; return FALSE;
@@ -448,7 +450,7 @@ bool wxJoystick::HasRudder(void) const
bool wxJoystick::HasZ(void) const bool wxJoystick::HasZ(void) const
{ {
#ifdef __WIN32__ #if defined(__WIN32__) && !defined(__TWIN32__)
JOYCAPS joyCaps; JOYCAPS joyCaps;
if (joyGetDevCaps(m_joystick, & joyCaps, sizeof(JOYCAPS)) != JOYERR_NOERROR) if (joyGetDevCaps(m_joystick, & joyCaps, sizeof(JOYCAPS)) != JOYERR_NOERROR)
return FALSE; return FALSE;
@@ -461,7 +463,7 @@ bool wxJoystick::HasZ(void) const
bool wxJoystick::HasU(void) const bool wxJoystick::HasU(void) const
{ {
#ifdef __WIN32__ #if defined(__WIN32__) && !defined(__TWIN32__)
JOYCAPS joyCaps; JOYCAPS joyCaps;
if (joyGetDevCaps(m_joystick, & joyCaps, sizeof(JOYCAPS)) != JOYERR_NOERROR) if (joyGetDevCaps(m_joystick, & joyCaps, sizeof(JOYCAPS)) != JOYERR_NOERROR)
return FALSE; return FALSE;
@@ -474,7 +476,7 @@ bool wxJoystick::HasU(void) const
bool wxJoystick::HasV(void) const bool wxJoystick::HasV(void) const
{ {
#ifdef __WIN32__ #if defined(__WIN32__) && !defined(__TWIN32__)
JOYCAPS joyCaps; JOYCAPS joyCaps;
if (joyGetDevCaps(m_joystick, & joyCaps, sizeof(JOYCAPS)) != JOYERR_NOERROR) if (joyGetDevCaps(m_joystick, & joyCaps, sizeof(JOYCAPS)) != JOYERR_NOERROR)
return FALSE; return FALSE;
@@ -487,7 +489,7 @@ bool wxJoystick::HasV(void) const
bool wxJoystick::HasPOV(void) const bool wxJoystick::HasPOV(void) const
{ {
#ifdef __WIN32__ #if defined(__WIN32__) && !defined(__TWIN32__)
JOYCAPS joyCaps; JOYCAPS joyCaps;
if (joyGetDevCaps(m_joystick, & joyCaps, sizeof(JOYCAPS)) != JOYERR_NOERROR) if (joyGetDevCaps(m_joystick, & joyCaps, sizeof(JOYCAPS)) != JOYERR_NOERROR)
return FALSE; return FALSE;
@@ -500,7 +502,7 @@ bool wxJoystick::HasPOV(void) const
bool wxJoystick::HasPOV4Dir(void) const bool wxJoystick::HasPOV4Dir(void) const
{ {
#ifdef __WIN32__ #if defined(__WIN32__) && !defined(__TWIN32__)
JOYCAPS joyCaps; JOYCAPS joyCaps;
if (joyGetDevCaps(m_joystick, & joyCaps, sizeof(JOYCAPS)) != JOYERR_NOERROR) if (joyGetDevCaps(m_joystick, & joyCaps, sizeof(JOYCAPS)) != JOYERR_NOERROR)
return FALSE; return FALSE;
@@ -513,7 +515,7 @@ bool wxJoystick::HasPOV4Dir(void) const
bool wxJoystick::HasPOVCTS(void) const bool wxJoystick::HasPOVCTS(void) const
{ {
#ifdef __WIN32__ #if defined(__WIN32__) && !defined(__TWIN32__)
JOYCAPS joyCaps; JOYCAPS joyCaps;
if (joyGetDevCaps(m_joystick, & joyCaps, sizeof(JOYCAPS)) != JOYERR_NOERROR) if (joyGetDevCaps(m_joystick, & joyCaps, sizeof(JOYCAPS)) != JOYERR_NOERROR)
return FALSE; return FALSE;

View File

@@ -33,9 +33,11 @@
#include <windows.h> #include <windows.h>
#include <windowsx.h> #include <windowsx.h>
#ifndef __TWIN32__
#ifdef __GNUWIN32__ #ifdef __GNUWIN32__
#include <wx/msw/gnuwin32/extra.h> #include <wx/msw/gnuwin32/extra.h>
#endif #endif
#endif
#ifdef GetCharWidth #ifdef GetCharWidth
#undef GetCharWidth #undef GetCharWidth

View File

@@ -31,13 +31,15 @@
#include "wx/msw/private.h" #include "wx/msw/private.h"
#ifndef __GNUWIN32__ #if (defined(__WIN95__) && !defined(__GNUWIN32__)) || defined(__TWIN32__)
#include <commctrl.h> #include <commctrl.h>
#endif #endif
#ifndef __TWIN32__
#ifdef __GNUWIN32__ #ifdef __GNUWIN32__
#include "wx/msw/gnuwin32/extra.h" #include "wx/msw/gnuwin32/extra.h"
#endif #endif
#endif
static void wxConvertToMSWListItem(const wxListCtrl *ctrl, wxListItem& info, LV_ITEM& tvItem); static void wxConvertToMSWListItem(const wxListCtrl *ctrl, wxListItem& info, LV_ITEM& tvItem);
static void wxConvertFromMSWListItem(const wxListCtrl *ctrl, wxListItem& info, LV_ITEM& tvItem, HWND getFullInfo = 0); static void wxConvertFromMSWListItem(const wxListCtrl *ctrl, wxListItem& info, LV_ITEM& tvItem, HWND getFullInfo = 0);

View File

@@ -40,15 +40,25 @@
#if !defined(_WINDLL) #if !defined(_WINDLL)
#ifdef __TWIN32__
extern "C"
BOOL PASCAL WinMain(HANDLE hInstance, HANDLE hPrevInstance, LPSTR lpCmdLine, int nCmdShow)
#else
#ifdef __WATCOMC__ #ifdef __WATCOMC__
int PASCAL int PASCAL
#else #else
int APIENTRY int APIENTRY
#endif #endif
WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR m_lpCmdLine, int nCmdShow ) WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine, int nCmdShow )
#endif
// __TWIN32__
{ {
return wxEntry((WXHINSTANCE) hInstance, (WXHINSTANCE) hPrevInstance, m_lpCmdLine, nCmdShow); return wxEntry((WXHINSTANCE) hInstance, (WXHINSTANCE) hPrevInstance, lpCmdLine, nCmdShow);
} }
#endif #endif

View File

@@ -293,11 +293,16 @@ $(COMMDIR)/lex_yy.c: $(COMMDIR)/lexer.l
# Replace yacc with bison if you run into compilation # Replace yacc with bison if you run into compilation
# problems with y_tab.c. # problems with y_tab.c.
$(COMMDIR)/y_tab.c: $(COMMDIR)/parser.y $(COMMDIR)/y_tab.c: $(COMMDIR)/parser.y
$(YACC) -o $(COMMDIR)/y_tab.c $(COMMDIR)/parser.y $(YACC) -o $(COMMDIR)/y_tab.c $(COMMDIR)/parser.y
# mv y.tab.c $(COMMDIR)/y_tab.c # If you use e.g. gcc on Unix, uncomment these lines
# and comment out the above.
#$(COMMDIR)/y_tab.c: $(COMMDIR)/parser.y
# $(YACC) $(COMMDIR)/parser.y
# mv y.tab.c $(COMMDIR)/y_tab.c
# Extra targets # Extra targets
rcparser: rcparser:

View File

@@ -32,9 +32,11 @@
#include "wx/minifram.h" #include "wx/minifram.h"
#include "wx/msw/private.h" #include "wx/msw/private.h"
#ifndef __TWIN32__
#ifdef __GNUWIN32__ #ifdef __GNUWIN32__
#include "wx/msw/gnuwin32/extra.h" #include "wx/msw/gnuwin32/extra.h"
#endif #endif
#endif
#if !USE_SHARED_LIBRARY #if !USE_SHARED_LIBRARY
IMPLEMENT_DYNAMIC_CLASS(wxMiniFrame, wxFrame) IMPLEMENT_DYNAMIC_CLASS(wxMiniFrame, wxFrame)

View File

@@ -58,7 +58,7 @@ bool wxWindow::LoadNativeDialog(wxWindow* parent, wxWindowID& id)
if (hWndNext) if (hWndNext)
child = CreateWindowFromHWND(this, (WXHWND) hWndNext); child = CreateWindowFromHWND(this, (WXHWND) hWndNext);
while (hWndNext != NULL) while (hWndNext != (HWND) NULL)
{ {
hWndNext = ::GetWindow(hWndNext, GW_HWNDNEXT); hWndNext = ::GetWindow(hWndNext, GW_HWNDNEXT);
if (hWndNext) if (hWndNext)
@@ -139,9 +139,13 @@ wxWindow* wxWindow::CreateWindowFromHWND(wxWindow* parent, WXHWND hWnd)
#else #else
#ifdef UNICODE #ifdef UNICODE
GetClassNameW((HWND) hWnd, buf, 256); GetClassNameW((HWND) hWnd, buf, 256);
#else
#ifdef __TWIN32__
GetClassName((HWND) hWnd, buf, 256);
#else #else
GetClassNameA((HWND) hWnd, buf, 256); GetClassNameA((HWND) hWnd, buf, 256);
#endif #endif
#endif
#endif #endif
wxString str(buf); wxString str(buf);
@@ -224,7 +228,7 @@ wxWindow* wxWindow::CreateWindowFromHWND(wxWindow* parent, WXHWND hWnd)
{ {
win = new wxScrollBar; win = new wxScrollBar;
} }
#if defined(__WIN95__) #if defined(__WIN95__) && !defined(__TWIN32__)
else if (str == "MSCTLS_UPDOWN32") else if (str == "MSCTLS_UPDOWN32")
{ {
win = new wxSpinButton; win = new wxSpinButton;

View File

@@ -40,9 +40,13 @@
#include <windowsx.h> // for SetWindowFont #include <windowsx.h> // for SetWindowFont
#ifndef __TWIN32__
#ifdef __GNUWIN32__ #ifdef __GNUWIN32__
#include "wx/msw/gnuwin32/extra.h" #include "wx/msw/gnuwin32/extra.h"
#else //!GnuWin32 #endif
#endif
#if !defined(__GNUWIN32__) || defined(__TWIN32__)
#include <commctrl.h> #include <commctrl.h>
#endif #endif

View File

@@ -89,7 +89,7 @@ bool wxOwnerDrawn::OnMeasureItem(size_t *pwidth, size_t *pheight)
// Win32 GDI functions and not wxWindows ones. Might help to whoever decides to // Win32 GDI functions and not wxWindows ones. Might help to whoever decides to
// port this code to X. (VZ) // port this code to X. (VZ)
#if defined(__WIN32__) && !defined(__SC__) #if defined(__WIN32__) && !defined(__SC__) && !defined(__TWIN32__)
#define O_DRAW_NATIVE_API // comments below explain why I use it #define O_DRAW_NATIVE_API // comments below explain why I use it
#endif #endif

View File

@@ -314,7 +314,7 @@ bool wxRegKey::GetKeyInfo(ulong *pnSubKeys,
ulong *pnMaxValueLen) const ulong *pnMaxValueLen) const
#endif #endif
{ {
#ifdef __WIN32__ #if defined(__WIN32__) && !defined(__TWIN32__)
m_dwLastError = ::RegQueryInfoKey m_dwLastError = ::RegQueryInfoKey
( (
(HKEY) m_hKey, (HKEY) m_hKey,
@@ -474,7 +474,7 @@ bool wxRegKey::DeleteValue(const char *szValue)
if ( !Open() ) if ( !Open() )
return FALSE; return FALSE;
#ifdef __WIN32__ #if defined(__WIN32__) && !defined(__TWIN32__)
m_dwLastError = RegDeleteValue((HKEY) m_hKey, (char*) (const char*) szValue); m_dwLastError = RegDeleteValue((HKEY) m_hKey, (char*) (const char*) szValue);
if ( m_dwLastError != ERROR_SUCCESS ) { if ( m_dwLastError != ERROR_SUCCESS ) {
wxLogSysError(m_dwLastError, _("can't delete value '%s' from key '%s'"), wxLogSysError(m_dwLastError, _("can't delete value '%s' from key '%s'"),
@@ -568,6 +568,10 @@ wxRegKey::ValueType wxRegKey::GetValueType(const char *szValue)
#ifdef __WIN32__ #ifdef __WIN32__
bool wxRegKey::SetValue(const char *szValue, long lValue) bool wxRegKey::SetValue(const char *szValue, long lValue)
{ {
#ifdef __TWIN32__
wxFAIL_MSG("RegSetValueEx not implemented by TWIN32");
return FALSE;
#else
if ( CONST_CAST Open() ) { if ( CONST_CAST Open() ) {
m_dwLastError = RegSetValueEx((HKEY) m_hKey, szValue, (DWORD) RESERVED, REG_DWORD, m_dwLastError = RegSetValueEx((HKEY) m_hKey, szValue, (DWORD) RESERVED, REG_DWORD,
(RegString)&lValue, sizeof(lValue)); (RegString)&lValue, sizeof(lValue));
@@ -578,6 +582,7 @@ bool wxRegKey::SetValue(const char *szValue, long lValue)
wxLogSysError(m_dwLastError, _("can't set value of '%s'"), wxLogSysError(m_dwLastError, _("can't set value of '%s'"),
GetFullName(this, szValue)); GetFullName(this, szValue));
return FALSE; return FALSE;
#endif
} }
bool wxRegKey::QueryValue(const char *szValue, long *plValue) const bool wxRegKey::QueryValue(const char *szValue, long *plValue) const
@@ -646,7 +651,7 @@ bool wxRegKey::QueryValue(const char *szValue, wxString& strValue) const
bool wxRegKey::SetValue(const char *szValue, const wxString& strValue) bool wxRegKey::SetValue(const char *szValue, const wxString& strValue)
{ {
if ( CONST_CAST Open() ) { if ( CONST_CAST Open() ) {
#ifdef __WIN32__ #if defined( __WIN32__) && !defined(__TWIN32__)
m_dwLastError = RegSetValueEx((HKEY) m_hKey, szValue, (DWORD) RESERVED, REG_SZ, m_dwLastError = RegSetValueEx((HKEY) m_hKey, szValue, (DWORD) RESERVED, REG_SZ,
(RegString)strValue.c_str(), (RegString)strValue.c_str(),
strValue.Len() + 1); strValue.Len() + 1);
@@ -697,7 +702,7 @@ bool wxRegKey::GetNextValue(wxString& strValueName, long& lIndex) const
if ( lIndex == -1 ) if ( lIndex == -1 )
return FALSE; return FALSE;
#ifdef __WIN32__ #if defined( __WIN32__) && !defined(__TWIN32__)
char szValueName[1024]; // @@ use RegQueryInfoKey... char szValueName[1024]; // @@ use RegQueryInfoKey...
DWORD dwValueLen = WXSIZEOF(szValueName); DWORD dwValueLen = WXSIZEOF(szValueName);

View File

@@ -49,7 +49,7 @@ wxColour wxSystemSettings::GetSystemColour(int index)
wxFont wxSystemSettings::GetSystemFont(int index) wxFont wxSystemSettings::GetSystemFont(int index)
{ {
HFONT hFont = (HFONT) ::GetStockObject(index); HFONT hFont = (HFONT) ::GetStockObject(index);
if ( hFont != NULL ) if ( hFont != (HFONT) NULL )
{ {
LOGFONT lf; LOGFONT lf;
if ( ::GetObject(hFont, sizeof(LOGFONT), &lf) != 0 ) if ( ::GetObject(hFont, sizeof(LOGFONT), &lf) != 0 )

View File

@@ -31,7 +31,7 @@
#include "wx/msw/slider95.h" #include "wx/msw/slider95.h"
#include "wx/msw/private.h" #include "wx/msw/private.h"
#if defined(__WIN95__) && !defined(__GNUWIN32__) #if (defined(__WIN95__) && !defined(__GNUWIN32__)) || defined(__TWIN32__)
#include <commctrl.h> #include <commctrl.h>
#endif #endif

View File

@@ -24,12 +24,15 @@
#include "wx/wx.h" #include "wx/wx.h"
#endif #endif
#if defined(__WIN95__) // Can't resolve reference to CreateUpDownControl in
// TWIN32, but could probably use normal CreateWindow instead.
#if defined(__WIN95__) && !defined(__TWIN32__)
#include "wx/spinbutt.h" #include "wx/spinbutt.h"
#include "wx/msw/private.h" #include "wx/msw/private.h"
#ifndef __GNUWIN32__ #if !defined(__GNUWIN32__) || defined(__TWIN32__)
#include <commctrl.h> #include <commctrl.h>
#endif #endif

View File

@@ -36,7 +36,7 @@
#include <windows.h> #include <windows.h>
#include <windowsx.h> #include <windowsx.h>
#if !defined(__GNUWIN32__) #if !defined(__GNUWIN32__) || defined(__TWIN32__)
#include <commctrl.h> #include <commctrl.h>
#endif #endif

View File

@@ -32,13 +32,15 @@
#include <windows.h> #include <windows.h>
#ifndef __GNUWIN32__ #if (defined(__WIN95__) && !defined(__GNUWIN32__)) || defined(__TWIN32__)
#include <commctrl.h> #include <commctrl.h>
#endif #endif
#ifndef __TWIN32__
#ifdef __GNUWIN32__ #ifdef __GNUWIN32__
#include "wx/msw/gnuwin32/extra.h" #include "wx/msw/gnuwin32/extra.h"
#endif #endif
#endif
#include "wx/msw/dib.h" #include "wx/msw/dib.h"
#include "wx/msw/tabctrl.h" #include "wx/msw/tabctrl.h"

View File

@@ -28,16 +28,18 @@
#include "wx/utils.h" #include "wx/utils.h"
#endif #endif
#ifdef __WIN95__ #if defined(__WIN95__) && !defined(__TWIN32__)
#include <windows.h> #include <windows.h>
#include <string.h> #include <string.h>
#include <wx/msw/taskbar.h> #include <wx/msw/taskbar.h>
#include <wx/msw/private.h> #include <wx/msw/private.h>
#ifndef __TWIN32__
#ifdef __GNUWIN32__ #ifdef __GNUWIN32__
#include <wx/msw/gnuwin32/extra.h> #include <wx/msw/gnuwin32/extra.h>
#endif #endif
#endif
#ifdef __SALFORDC__ #ifdef __SALFORDC__
#include <shellapi.h> #include <shellapi.h>

View File

@@ -32,13 +32,15 @@
#include <windows.h> #include <windows.h>
#ifndef __GNUWIN32__ #if (defined(__WIN95__) && !defined(__GNUWIN32__)) || defined(__TWIN32__)
#include <commctrl.h> #include <commctrl.h>
#endif #endif
#ifndef __TWIN32__
#ifdef __GNUWIN32__ #ifdef __GNUWIN32__
#include "wx/msw/gnuwin32/extra.h" #include "wx/msw/gnuwin32/extra.h"
#endif #endif
#endif
#include "wx/msw/dib.h" #include "wx/msw/dib.h"
#include "wx/tbar95.h" #include "wx/tbar95.h"

View File

@@ -66,7 +66,13 @@
#include <string.h> #include <string.h>
#if defined(__WIN95__) && !defined(__GNUWIN32__) #if defined(__WIN95__) && !defined(__TWIN32__)
#define wxUSE_RICHEDIT 1
#else
#define wxUSE_RICHEDIT 0
#endif
#if wxUSE_RICHEDIT && !defined(__GNUWIN32__)
#include <richedit.h> #include <richedit.h>
#endif #endif
@@ -152,7 +158,7 @@ bool wxTextCtrl::Create(wxWindow *parent, wxWindowID id,
msStyle |= ES_PASSWORD; msStyle |= ES_PASSWORD;
char *windowClass = "EDIT"; char *windowClass = "EDIT";
#if defined(__WIN95__) #if wxUSE_RICHEDIT
if ( m_windowStyle & wxTE_MULTILINE ) if ( m_windowStyle & wxTE_MULTILINE )
{ {
msStyle |= ES_AUTOVSCROLL; msStyle |= ES_AUTOVSCROLL;
@@ -168,7 +174,7 @@ bool wxTextCtrl::Create(wxWindow *parent, wxWindowID id,
// If we're in Win95, and we want a simple 2D border, // If we're in Win95, and we want a simple 2D border,
// then make it an EDIT control instead. // then make it an EDIT control instead.
#if defined(__WIN95__) #if wxUSE_RICHEDIT
if (m_windowStyle & wxSIMPLE_BORDER) if (m_windowStyle & wxSIMPLE_BORDER)
{ {
windowClass = "EDIT"; windowClass = "EDIT";
@@ -196,7 +202,7 @@ bool wxTextCtrl::Create(wxWindow *parent, wxWindowID id,
} }
#endif #endif
#if defined(__WIN95__) #if wxUSE_RICHEDIT
if (m_isRich) if (m_isRich)
{ {
// Have to enable events // Have to enable events
@@ -244,9 +250,13 @@ void wxTextCtrl::AdoptAttributesFromHWND(void)
#else #else
#ifdef UNICODE #ifdef UNICODE
GetClassNameW((HWND) hWnd, buf, 256); GetClassNameW((HWND) hWnd, buf, 256);
#else
#ifdef __TWIN32__
GetClassName((HWND) hWnd, buf, 256);
#else #else
GetClassNameA((HWND) hWnd, buf, 256); GetClassNameA((HWND) hWnd, buf, 256);
#endif #endif
#endif
#endif #endif
wxString str(buf); wxString str(buf);
@@ -394,7 +404,7 @@ void wxTextCtrl::SetInsertionPoint(long pos)
{ {
HWND hWnd = (HWND) GetHWND(); HWND hWnd = (HWND) GetHWND();
#ifdef __WIN32__ #ifdef __WIN32__
#if defined(__WIN95__) #if wxUSE_RICHEDIT
if ( m_isRich) if ( m_isRich)
{ {
CHARRANGE range; CHARRANGE range;
@@ -424,7 +434,7 @@ void wxTextCtrl::SetInsertionPointEnd(void)
long wxTextCtrl::GetInsertionPoint(void) const long wxTextCtrl::GetInsertionPoint(void) const
{ {
#if defined(__WIN95__) #if wxUSE_RICHEDIT
if (m_isRich) if (m_isRich)
{ {
CHARRANGE range; CHARRANGE range;
@@ -1099,7 +1109,7 @@ bool wxTextCtrl::MSWCommand(WXUINT param, WXWORD WXUNUSED(id))
// For Rich Edit controls. Do we need it? // For Rich Edit controls. Do we need it?
#if 0 #if 0
#if defined(__WIN95__) #if wxUSE_RICHEDIT
bool wxTextCtrl::MSWNotify(WXWPARAM wParam, WXLPARAM lParam) bool wxTextCtrl::MSWNotify(WXWPARAM wParam, WXLPARAM lParam)
{ {
wxCommandEvent event(0, m_windowId); wxCommandEvent event(0, m_windowId);

View File

@@ -40,7 +40,7 @@
#include "wx/msw/private.h" #include "wx/msw/private.h"
#ifndef __GNUWIN32__ #if (defined(__WIN95__) && !defined(__GNUWIN32__)) || defined(__TWIN32__)
#include <commctrl.h> #include <commctrl.h>
#endif #endif

View File

@@ -29,6 +29,7 @@
#include "wx/msw/private.h" #include "wx/msw/private.h"
#include "wx/timer.h" #include "wx/timer.h"
#include "wx/intl.h"
#include <windows.h> #include <windows.h>
@@ -42,7 +43,7 @@
#endif #endif
#endif //GNUWIN32 #endif //GNUWIN32
#ifdef __GNUWIN32__ #if defined(__GNUWIN32__) && !defined(__TWIN32__)
#include <sys/unistd.h> #include <sys/unistd.h>
#include <sys/stat.h> #include <sys/stat.h>
#endif //GNUWIN32 #endif //GNUWIN32
@@ -135,7 +136,7 @@ static const char eUSERNAME[] = "UserName";
// Get full hostname (eg. DoDo.BSn-Germany.crg.de) // Get full hostname (eg. DoDo.BSn-Germany.crg.de)
bool wxGetHostName(char *buf, int maxSize) bool wxGetHostName(char *buf, int maxSize)
{ {
#ifdef __WIN32__ #if defined(__WIN32__) && !defined(__TWIN32__)
DWORD nSize = maxSize; DWORD nSize = maxSize;
return (::GetComputerName(buf, &nSize) != 0); return (::GetComputerName(buf, &nSize) != 0);
#else #else
@@ -154,7 +155,7 @@ bool wxGetHostName(char *buf, int maxSize)
// Get user ID e.g. jacs // Get user ID e.g. jacs
bool wxGetUserId(char *buf, int maxSize) bool wxGetUserId(char *buf, int maxSize)
{ {
#if defined(__WIN32__) && !defined(__win32s__) #if defined(__WIN32__) && !defined(__win32s__) && !defined(__TWIN32__)
// VZ: why should it be so complicated?? // VZ: why should it be so complicated??
#if 0 #if 0
@@ -288,7 +289,7 @@ wxShell(const wxString& command)
// Get free memory in bytes, or -1 if cannot determine amount (e.g. on UNIX) // Get free memory in bytes, or -1 if cannot determine amount (e.g. on UNIX)
long wxGetFreeMemory(void) long wxGetFreeMemory(void)
{ {
#if defined(__WIN32__) && !defined(__BORLANDC__) #if defined(__WIN32__) && !defined(__BORLANDC__) && !defined(__TWIN32__)
MEMORYSTATUS memStatus; MEMORYSTATUS memStatus;
memStatus.dwLength = sizeof(MEMORYSTATUS); memStatus.dwLength = sizeof(MEMORYSTATUS);
GlobalMemoryStatus(&memStatus); GlobalMemoryStatus(&memStatus);
@@ -567,7 +568,7 @@ const char* wxGetHomeDir(wxString *pstr)
{ {
wxString& strDir = *pstr; wxString& strDir = *pstr;
#ifdef __UNIX__ #if defined(__UNIX__) && !defined(__TWIN32__)
const char *szHome = getenv("HOME"); const char *szHome = getenv("HOME");
if ( szHome == NULL ) { if ( szHome == NULL ) {
// we're homeless... // we're homeless...
@@ -677,7 +678,7 @@ bool wxCheckForInterrupt(wxWindow *wnd)
char *wxLoadUserResource(const wxString& resourceName, const wxString& resourceType) char *wxLoadUserResource(const wxString& resourceName, const wxString& resourceType)
{ {
char *s = NULL; char *s = NULL;
#ifndef __WIN32__ #if !defined(__WIN32__) || defined(__TWIN32__)
HRSRC hResource = ::FindResource(wxGetInstance(), WXSTRINGCAST resourceName, WXSTRINGCAST resourceType); HRSRC hResource = ::FindResource(wxGetInstance(), WXSTRINGCAST resourceName, WXSTRINGCAST resourceType);
#else #else
#ifdef UNICODE #ifdef UNICODE
@@ -721,34 +722,34 @@ void wxGetMousePosition( int* x, int* y )
// Return TRUE if we have a colour display // Return TRUE if we have a colour display
bool wxColourDisplay(void) bool wxColourDisplay(void)
{ {
HDC dc = ::GetDC(NULL); HDC dc = ::GetDC((HWND) NULL);
bool flag; bool flag;
int noCols = GetDeviceCaps(dc, NUMCOLORS); int noCols = GetDeviceCaps(dc, NUMCOLORS);
if ((noCols == -1) || (noCols > 2)) if ((noCols == -1) || (noCols > 2))
flag = TRUE; flag = TRUE;
else else
flag = FALSE; flag = FALSE;
ReleaseDC(NULL, dc); ReleaseDC((HWND) NULL, dc);
return flag; return flag;
} }
// Returns depth of screen // Returns depth of screen
int wxDisplayDepth(void) int wxDisplayDepth(void)
{ {
HDC dc = ::GetDC(NULL); HDC dc = ::GetDC((HWND) NULL);
int planes = GetDeviceCaps(dc, PLANES); int planes = GetDeviceCaps(dc, PLANES);
int bitsPerPixel = GetDeviceCaps(dc, BITSPIXEL); int bitsPerPixel = GetDeviceCaps(dc, BITSPIXEL);
int depth = planes*bitsPerPixel; int depth = planes*bitsPerPixel;
ReleaseDC(NULL, dc); ReleaseDC((HWND) NULL, dc);
return depth; return depth;
} }
// Get size of display // Get size of display
void wxDisplaySize(int *width, int *height) void wxDisplaySize(int *width, int *height)
{ {
HDC dc = ::GetDC(NULL); HDC dc = ::GetDC((HWND) NULL);
*width = GetDeviceCaps(dc, HORZRES); *height = GetDeviceCaps(dc, VERTRES); *width = GetDeviceCaps(dc, HORZRES); *height = GetDeviceCaps(dc, VERTRES);
ReleaseDC(NULL, dc); ReleaseDC((HWND) NULL, dc);
} }
bool wxDirExists(const wxString& dir) bool wxDirExists(const wxString& dir)
@@ -982,7 +983,7 @@ To download dbwin32, see e.g.:
http://ftp.digital.com/pub/micro/NT/WinSite/programr/dbwin32.zip http://ftp.digital.com/pub/micro/NT/WinSite/programr/dbwin32.zip
*/ */
#if !defined(__MWERKS__) && !defined(__SALFORDC__) #if !defined(__MWERKS__) && !defined(__SALFORDC__) && !defined(__TWIN32__)
#include <process.h> #include <process.h>
#endif #endif
@@ -1009,8 +1010,12 @@ void OutputDebugStringW95(const char* lpOutputString, ...)
*/ */
#ifdef _UNICODE #ifdef _UNICODE
::OutputDebugStringW(achBuffer); ::OutputDebugStringW(achBuffer);
#else
#ifdef __TWIN32__
::OutputDebugString(achBuffer);
#else #else
::OutputDebugStringA(achBuffer); ::OutputDebugStringA(achBuffer);
#endif
#endif #endif
/* bail if it's not Win95 */ /* bail if it's not Win95 */

View File

@@ -41,9 +41,11 @@
#endif #endif
#ifdef __GNUWIN32__ #ifdef __GNUWIN32__
#ifndef __TWIN32__
#include <sys/unistd.h> #include <sys/unistd.h>
#include <sys/stat.h> #include <sys/stat.h>
#endif #endif
#endif
#ifdef __WIN32__ #ifdef __WIN32__
#include <io.h> #include <io.h>
@@ -111,7 +113,7 @@ long wxExecute(const wxString& command, bool sync, wxProcess *handler)
if (command == "") if (command == "")
return 0; return 0;
#ifdef __WIN32__ #if defined(__WIN32__) && !defined(__TWIN32__)
char * cl; char * cl;
char * argp; char * argp;
int clen; int clen;

View File

@@ -35,9 +35,11 @@
#include <mmsystem.h> #include <mmsystem.h>
#endif #endif
#ifndef __TWIN32__
#ifdef __GNUWIN32__ #ifdef __GNUWIN32__
#include "wx/msw/gnuwin32/extra.h" #include "wx/msw/gnuwin32/extra.h"
#endif #endif
#endif
wxWave::wxWave() wxWave::wxWave()
: m_waveData(NULL), m_waveLength(0), m_isResource(FALSE) : m_waveData(NULL), m_waveLength(0), m_isResource(FALSE)
@@ -50,7 +52,7 @@ wxWave::wxWave(const wxString& sFileName, bool isResource)
Create(sFileName, isResource); Create(sFileName, isResource);
} }
wxWave::wxWave(int size, const byte* data) wxWave::wxWave(int size, const wxByte* data)
: m_waveData(NULL), m_waveLength(0), m_isResource(FALSE) : m_waveData(NULL), m_waveLength(0), m_isResource(FALSE)
{ {
Create(size, data); Create(size, data);
@@ -70,7 +72,7 @@ bool wxWave::Create(const wxString& fileName, bool isResource)
m_isResource = TRUE; m_isResource = TRUE;
HRSRC hresInfo; HRSRC hresInfo;
#ifdef __WIN32__ #if defined(__WIN32__) && !defined(__TWIN32__)
hresInfo = ::FindResourceA((HMODULE) wxhInstance, fileName, "WAVE"); hresInfo = ::FindResourceA((HMODULE) wxhInstance, fileName, "WAVE");
#else #else
hresInfo = ::FindResource((HMODULE) wxhInstance, fileName, "WAVE"); hresInfo = ::FindResource((HMODULE) wxhInstance, fileName, "WAVE");
@@ -82,7 +84,7 @@ bool wxWave::Create(const wxString& fileName, bool isResource)
if (waveData) if (waveData)
{ {
m_waveData= (byte*)::LockResource(waveData); m_waveData= (wxByte*)::LockResource(waveData);
m_waveLength = (int) ::SizeofResource((HMODULE) wxhInstance, hresInfo); m_waveLength = (int) ::SizeofResource((HMODULE) wxhInstance, hresInfo);
} }
@@ -98,7 +100,7 @@ bool wxWave::Create(const wxString& fileName, bool isResource)
m_waveLength = (int) fileWave.Length(); m_waveLength = (int) fileWave.Length();
m_waveData = (byte*)::GlobalLock(::GlobalAlloc(GMEM_MOVEABLE | GMEM_SHARE, m_waveLength)); m_waveData = (wxByte*)::GlobalLock(::GlobalAlloc(GMEM_MOVEABLE | GMEM_SHARE, m_waveLength));
if (!m_waveData) if (!m_waveData)
return FALSE; return FALSE;
@@ -108,12 +110,12 @@ bool wxWave::Create(const wxString& fileName, bool isResource)
} }
} }
bool wxWave::Create(int size, const byte* data) bool wxWave::Create(int size, const wxByte* data)
{ {
Free(); Free();
m_isResource = FALSE; m_isResource = FALSE;
m_waveLength=size; m_waveLength=size;
m_waveData = (byte*)::GlobalLock(::GlobalAlloc(GMEM_MOVEABLE | GMEM_SHARE, m_waveLength)); m_waveData = (wxByte*)::GlobalLock(::GlobalAlloc(GMEM_MOVEABLE | GMEM_SHARE, m_waveLength));
if (!m_waveData) if (!m_waveData)
return FALSE; return FALSE;

View File

@@ -61,9 +61,11 @@
#include <windowsx.h> #include <windowsx.h>
#endif #endif
#ifndef __TWIN32__
#ifdef __GNUWIN32__ #ifdef __GNUWIN32__
#include <wx/msw/gnuwin32/extra.h> #include <wx/msw/gnuwin32/extra.h>
#endif #endif
#endif
#ifdef GetCharWidth #ifdef GetCharWidth
#undef GetCharWidth #undef GetCharWidth
@@ -1420,7 +1422,7 @@ void wxAssociateWinWithHandle(HWND hWnd, wxWindow *win)
{ {
// adding NULL hWnd is (first) surely a result of an error and // adding NULL hWnd is (first) surely a result of an error and
// (secondly) breaks menu command processing // (secondly) breaks menu command processing
wxCHECK_RET( hWnd != NULL, "attempt to add a NULL hWnd to window list" ); wxCHECK_RET( hWnd != (HWND) NULL, "attempt to add a NULL hWnd to window list" );
if ( !wxWinHandleList->Find((long)hWnd) ) if ( !wxWinHandleList->Find((long)hWnd) )
wxWinHandleList->Append((long)hWnd, win); wxWinHandleList->Append((long)hWnd, win);
@@ -2963,7 +2965,7 @@ void wxSetKeyboardHook(bool doIt)
{ {
wxTheKeyboardHookProc = MakeProcInstance((FARPROC) wxKeyboardHook, wxGetInstance()); wxTheKeyboardHookProc = MakeProcInstance((FARPROC) wxKeyboardHook, wxGetInstance());
wxTheKeyboardHook = SetWindowsHookEx(WH_KEYBOARD, (HOOKPROC) wxTheKeyboardHookProc, wxGetInstance(), wxTheKeyboardHook = SetWindowsHookEx(WH_KEYBOARD, (HOOKPROC) wxTheKeyboardHookProc, wxGetInstance(),
#ifdef __WIN32__ #if defined(__WIN32__) && !defined(__TWIN32__)
GetCurrentThreadId()); GetCurrentThreadId());
// (DWORD)GetCurrentProcess()); // This is another possibility. Which is right? // (DWORD)GetCurrentProcess()); // This is another possibility. Which is right?
#else #else