wxMGL revitalised with OpenWatcom.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@36043 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Włodzimierz Skiba
2005-10-31 17:14:55 +00:00
parent b8af111fa5
commit 127eab18f8
16 changed files with 497 additions and 483 deletions

View File

@@ -171,7 +171,7 @@
// Default is 1 // Default is 1
// //
// Recommended setting: 1 for win32 else 0 // Recommended setting: 1 for win32 else 0
#if defined(__WIN32__) #if defined(__WIN32__) || defined(__WATCOMC__)
#define wxUSE_WCHAR_T 1 #define wxUSE_WCHAR_T 1
#else #else
#define wxUSE_WCHAR_T 0 #define wxUSE_WCHAR_T 0

View File

@@ -1,5 +1,5 @@
///////////////////////////////////////////////////////////////////////////// /////////////////////////////////////////////////////////////////////////////
// Name: common/appcmn.cpp // Name: src/common/appcmn.cpp
// Purpose: wxAppConsole and wxAppBase methods common to all platforms // Purpose: wxAppConsole and wxAppBase methods common to all platforms
// Author: Vadim Zeitlin // Author: Vadim Zeitlin
// Modified by: // Modified by:
@@ -605,4 +605,3 @@ GSocketGUIFunctionsTable* wxGUIAppTraitsBase::GetSocketGUIFunctionsTable()
} }
#endif #endif

View File

@@ -287,7 +287,7 @@ wxString wxFileConfig::GetGlobalDir()
#elif defined(__DOS__) #elif defined(__DOS__)
// There's no such thing as global cfg dir in MS-DOS, let's return // There's no such thing as global cfg dir in MS-DOS, let's return
// current directory (FIXME_MGL?) // current directory (FIXME_MGL?)
return wxT(".\\"); strDir = wxT(".\\");
#elif defined(__WXWINCE__) #elif defined(__WXWINCE__)
strDir = wxT("\\Windows\\"); strDir = wxT("\\Windows\\");
#else // Windows #else // Windows

View File

@@ -267,7 +267,9 @@ size_t wxGetAvailableDrives(wxArrayString &paths, wxArrayString &names, wxArrayI
bool wxIsDriveAvailable(const wxString& dirName) bool wxIsDriveAvailable(const wxString& dirName)
{ {
// FIXME_MGL - this method leads to hang up under Watcom for some reason // FIXME_MGL - this method leads to hang up under Watcom for some reason
#ifndef __WATCOMC__ #ifdef __WATCOMC__
wxUnusedVar(dirName);
#else
if ( dirName.Len() == 3 && dirName[1u] == wxT(':') ) if ( dirName.Len() == 3 && dirName[1u] == wxT(':') )
{ {
wxString dirNameLower(dirName.Lower()); wxString dirNameLower(dirName.Lower());

View File

@@ -1,5 +1,5 @@
///////////////////////////////////////////////////////////////////////////// /////////////////////////////////////////////////////////////////////////////
// Name: bitmap.cpp // Name: src/mgl/bitmap.cpp
// Author: Vaclav Slavik // Author: Vaclav Slavik
// RCS-ID: $Id$ // RCS-ID: $Id$
// Copyright: (c) 2001-2002 SciTech Software, Inc. (www.scitechsoft.com) // Copyright: (c) 2001-2002 SciTech Software, Inc. (www.scitechsoft.com)
@@ -60,9 +60,9 @@ static wxColour wxQuantizeColour(const wxColour& clr, const wxBitmap& bmp)
if ( pf->redAdjust == 0 && pf->greenAdjust == 0 && pf->blueAdjust == 0 ) if ( pf->redAdjust == 0 && pf->greenAdjust == 0 && pf->blueAdjust == 0 )
return clr; return clr;
else else
return wxColour((clr.Red() >> pf->redAdjust) << pf->redAdjust, return wxColour((unsigned char)((clr.Red() >> pf->redAdjust) << pf->redAdjust),
(clr.Green() >> pf->greenAdjust) << pf->greenAdjust, (unsigned char)((clr.Green() >> pf->greenAdjust) << pf->greenAdjust),
(clr.Blue() >> pf->blueAdjust) << pf->blueAdjust); (unsigned char)((clr.Blue() >> pf->blueAdjust) << pf->blueAdjust));
} }
@@ -109,9 +109,10 @@ bool wxMask::Create(const wxBitmap& bitmap, const wxColour& colour)
wxColour clr(wxQuantizeColour(colour, bitmap)); wxColour clr(wxQuantizeColour(colour, bitmap));
wxImage imgSrc(bitmap.ConvertToImage()); wxImage imgSrc(bitmap.ConvertToImage());
imgSrc.SetMask(FALSE); imgSrc.SetMask(false);
wxImage image(imgSrc.ConvertToMono(clr.Red(), clr.Green(), clr.Blue())); wxImage image(imgSrc.ConvertToMono(clr.Red(), clr.Green(), clr.Blue()));
if ( !image.Ok() ) return FALSE; if ( !image.Ok() )
return false;
m_bitmap = new wxBitmap(image, 1); m_bitmap = new wxBitmap(image, 1);
@@ -123,7 +124,7 @@ bool wxMask::Create(const wxBitmap& bitmap, int paletteIndex)
unsigned char r,g,b; unsigned char r,g,b;
wxPalette *pal = bitmap.GetPalette(); wxPalette *pal = bitmap.GetPalette();
wxCHECK_MSG( pal, FALSE, wxT("Cannot create mask from bitmap without palette") ); wxCHECK_MSG( pal, false, wxT("Cannot create mask from bitmap without palette") );
pal->GetRGB(paletteIndex, &r, &g, &b); pal->GetRGB(paletteIndex, &r, &g, &b);
@@ -135,11 +136,11 @@ bool wxMask::Create(const wxBitmap& bitmap)
delete m_bitmap; delete m_bitmap;
m_bitmap = NULL; m_bitmap = NULL;
wxCHECK_MSG( bitmap.Ok(), FALSE, wxT("Invalid bitmap") ); wxCHECK_MSG( bitmap.Ok(), false, wxT("Invalid bitmap") );
wxCHECK_MSG( bitmap.GetDepth() == 1, FALSE, wxT("Cannot create mask from colour bitmap") ); wxCHECK_MSG( bitmap.GetDepth() == 1, false, wxT("Cannot create mask from colour bitmap") );
m_bitmap = new wxBitmap(bitmap); m_bitmap = new wxBitmap(bitmap);
return TRUE; return true;
} }
@@ -204,9 +205,10 @@ bool wxBitmap::Create(int width, int height, int depth)
{ {
UnRef(); UnRef();
wxCHECK_MSG( (width > 0) && (height > 0), FALSE, wxT("invalid bitmap size") ) wxCHECK_MSG( (width > 0) && (height > 0), false, wxT("invalid bitmap size") )
pixel_format_t pf_dummy, *pf; pixel_format_t pf_dummy;
pixel_format_t *pf;
int mglDepth = depth; int mglDepth = depth;
switch ( depth ) switch ( depth )
@@ -236,8 +238,7 @@ bool wxBitmap::Create(int width, int height, int depth)
break; break;
default: default:
wxASSERT_MSG( 0, wxT("invalid bitmap depth") ); wxASSERT_MSG( 0, wxT("invalid bitmap depth") );
return FALSE; return false;
break;
} }
m_refData = new wxBitmapRefData(); m_refData = new wxBitmapRefData();
@@ -266,15 +267,15 @@ bool wxBitmap::Create(int width, int height, int depth)
bool wxBitmap::CreateFromXpm(const char **bits) bool wxBitmap::CreateFromXpm(const char **bits)
{ {
wxCHECK_MSG( bits != NULL, FALSE, wxT("invalid bitmap data") ) wxCHECK_MSG( bits != NULL, false, wxT("invalid bitmap data") )
wxXPMDecoder decoder; wxXPMDecoder decoder;
wxImage img = decoder.ReadData(bits); wxImage img = decoder.ReadData(bits);
wxCHECK_MSG( img.Ok(), FALSE, wxT("invalid bitmap data") ) wxCHECK_MSG( img.Ok(), false, wxT("invalid bitmap data") )
*this = wxBitmap(img); *this = wxBitmap(img);
return TRUE; return true;
} }
wxBitmap::wxBitmap(const wxImage& image, int depth) wxBitmap::wxBitmap(const wxImage& image, int depth)
@@ -305,7 +306,7 @@ wxBitmap::wxBitmap(const wxImage& image, int depth)
wxImage mask_image = image.ConvertToMono(image.GetMaskRed(), wxImage mask_image = image.ConvertToMono(image.GetMaskRed(),
image.GetMaskGreen(), image.GetMaskGreen(),
image.GetMaskBlue()); image.GetMaskBlue());
mask_image.SetMask(FALSE); mask_image.SetMask(false);
wxBitmap mask_bmp(mask_image, 1); wxBitmap mask_bmp(mask_image, 1);
SetMask(new wxMask(mask_bmp)); SetMask(new wxMask(mask_bmp));
} }
@@ -337,17 +338,17 @@ wxImage wxBitmap::ConvertToImage() const
// bg colour set to black and fg colour to <16,16,16> // bg colour set to black and fg colour to <16,16,16>
image.SetMaskColour(16, 16, 16); image.SetMaskColour(16, 16, 16);
image.SetMask(TRUE); image.SetMask(true);
wxDC tmpDC; wxDC tmpDC;
tmpDC.SetMGLDC(&idc, FALSE); tmpDC.SetMGLDC(&idc, false);
tmpDC.SetBackground(wxBrush(wxColour(16,16,16), wxSOLID)); tmpDC.SetBackground(wxBrush(wxColour(16,16,16), wxSOLID));
tmpDC.Clear(); tmpDC.Clear();
tmpDC.DrawBitmap(*this, 0, 0, TRUE); tmpDC.DrawBitmap(*this, 0, 0, true);
} }
else else
{ {
image.SetMask(FALSE); image.SetMask(false);
idc.putBitmap(0, 0, M_BMPDATA->m_bitmap, MGL_REPLACE_MODE); idc.putBitmap(0, 0, M_BMPDATA->m_bitmap, MGL_REPLACE_MODE);
} }
@@ -440,7 +441,7 @@ bool wxBitmap::CopyFromIcon(const wxIcon& icon)
{ {
wxBitmap *bmp = (wxBitmap*)(&icon); wxBitmap *bmp = (wxBitmap*)(&icon);
*this = *bmp; *this = *bmp;
return TRUE; return true;
} }
wxBitmap wxBitmap::GetSubBitmap(const wxRect& rect) const wxBitmap wxBitmap::GetSubBitmap(const wxRect& rect) const
@@ -538,7 +539,7 @@ bool wxBitmap::LoadFile(const wxString &name, wxBitmapType type)
if ( !wxFileExists(name) ) if ( !wxFileExists(name) )
{ {
wxLogError(_("File %s does not exist."), name.c_str()); wxLogError(_("File %s does not exist."), name.c_str());
return FALSE; return false;
} }
} }
@@ -550,12 +551,12 @@ bool wxBitmap::LoadFile(const wxString &name, wxBitmapType type)
if ( !image.LoadFile(name, type) || !image.Ok() ) if ( !image.LoadFile(name, type) || !image.Ok() )
{ {
wxLogError("no bitmap handler for type %d defined.", type); wxLogError("no bitmap handler for type %d defined.", type);
return FALSE; return false;
} }
else else
{ {
*this = wxBitmap(image); *this = wxBitmap(image);
return TRUE; return true;
} }
} }
@@ -566,7 +567,7 @@ bool wxBitmap::LoadFile(const wxString &name, wxBitmapType type)
bool wxBitmap::SaveFile(const wxString& filename, wxBitmapType type, const wxPalette *palette) const bool wxBitmap::SaveFile(const wxString& filename, wxBitmapType type, const wxPalette *palette) const
{ {
wxCHECK_MSG( Ok(), FALSE, wxT("invalid bitmap") ); wxCHECK_MSG( Ok(), false, wxT("invalid bitmap") );
wxBitmapHandler *handler = FindHandler(type); wxBitmapHandler *handler = FindHandler(type);
@@ -581,7 +582,7 @@ bool wxBitmap::SaveFile(const wxString& filename, wxBitmapType type, const wxPal
else else
{ {
wxLogError("no bitmap handler for type %d defined.", type); wxLogError("no bitmap handler for type %d defined.", type);
return FALSE; return false;
} }
} }
@@ -650,9 +651,13 @@ public:
wxMGLBitmapHandler(wxBitmapType type, wxMGLBitmapHandler(wxBitmapType type,
const wxString& extension, const wxString& name); const wxString& extension, const wxString& name);
virtual bool Create(wxBitmap *bitmap, void *data, long flags, virtual bool Create(wxBitmap *WXUNUSED(bitmap),
int width, int height, int depth = 1) void *WXUNUSED(data),
{ return FALSE; } long WXUNUSED(flags),
int WXUNUSED(width),
int WXUNUSED(height),
int WXUNUSED(depth) = 1)
{ return false; }
virtual bool LoadFile(wxBitmap *bitmap, const wxString& name, long flags, virtual bool LoadFile(wxBitmap *bitmap, const wxString& name, long flags,
int desiredWidth, int desiredHeight); int desiredWidth, int desiredHeight);
@@ -698,45 +703,45 @@ bool wxMGLBitmapHandler::LoadFile(wxBitmap *bitmap, const wxString& name,
case wxBITMAP_TYPE_BMP: case wxBITMAP_TYPE_BMP:
case wxBITMAP_TYPE_BMP_RESOURCE: case wxBITMAP_TYPE_BMP_RESOURCE:
if ( !MGL_getBitmapSize(fullname.mb_str(), &width, &height, &bpp, &pf) ) if ( !MGL_getBitmapSize(fullname.mb_str(), &width, &height, &bpp, &pf) )
return FALSE; return false;
bitmap->Create(width, height, -1); bitmap->Create(width, height, -1);
if ( !bitmap->Ok() ) return FALSE; if ( !bitmap->Ok() ) return false;
dc.SelectObject(*bitmap); dc.SelectObject(*bitmap);
if ( !dc.GetMGLDC()->loadBitmapIntoDC(fullname.mb_str(), 0, 0, TRUE) ) if ( !dc.GetMGLDC()->loadBitmapIntoDC(fullname.mb_str(), 0, 0, TRUE) )
return FALSE; return false;
break; break;
case wxBITMAP_TYPE_JPEG: case wxBITMAP_TYPE_JPEG:
case wxBITMAP_TYPE_JPEG_RESOURCE: case wxBITMAP_TYPE_JPEG_RESOURCE:
if ( !MGL_getJPEGSize(fullname.mb_str(), &width, &height, &bpp, &pf) ) if ( !MGL_getJPEGSize(fullname.mb_str(), &width, &height, &bpp, &pf) )
return FALSE; return false;
bitmap->Create(width, height, -1); bitmap->Create(width, height, -1);
if ( !bitmap->Ok() ) return FALSE; if ( !bitmap->Ok() ) return false;
dc.SelectObject(*bitmap); dc.SelectObject(*bitmap);
if ( !dc.GetMGLDC()->loadJPEGIntoDC(fullname.mb_str(), 0, 0, TRUE) ) if ( !dc.GetMGLDC()->loadJPEGIntoDC(fullname.mb_str(), 0, 0, TRUE) )
return FALSE; return false;
break; break;
case wxBITMAP_TYPE_PNG: case wxBITMAP_TYPE_PNG:
case wxBITMAP_TYPE_PNG_RESOURCE: case wxBITMAP_TYPE_PNG_RESOURCE:
if ( !MGL_getPNGSize(fullname.mb_str(), &width, &height, &bpp, &pf) ) if ( !MGL_getPNGSize(fullname.mb_str(), &width, &height, &bpp, &pf) )
return FALSE; return false;
bitmap->Create(width, height, -1); bitmap->Create(width, height, -1);
if ( !bitmap->Ok() ) return FALSE; if ( !bitmap->Ok() ) return false;
dc.SelectObject(*bitmap); dc.SelectObject(*bitmap);
if ( !dc.GetMGLDC()->loadPNGIntoDC(fullname.mb_str(), 0, 0, TRUE) ) if ( !dc.GetMGLDC()->loadPNGIntoDC(fullname.mb_str(), 0, 0, TRUE) )
return FALSE; return false;
break; break;
case wxBITMAP_TYPE_PCX: case wxBITMAP_TYPE_PCX:
case wxBITMAP_TYPE_PCX_RESOURCE: case wxBITMAP_TYPE_PCX_RESOURCE:
if ( !MGL_getPCXSize(fullname.mb_str(), &width, &height, &bpp) ) if ( !MGL_getPCXSize(fullname.mb_str(), &width, &height, &bpp) )
return FALSE; return false;
bitmap->Create(width, height, -1); bitmap->Create(width, height, -1);
if ( !bitmap->Ok() ) return FALSE; if ( !bitmap->Ok() ) return false;
dc.SelectObject(*bitmap); dc.SelectObject(*bitmap);
if ( !dc.GetMGLDC()->loadPCXIntoDC(fullname.mb_str(), 0, 0, TRUE) ) if ( !dc.GetMGLDC()->loadPCXIntoDC(fullname.mb_str(), 0, 0, TRUE) )
return FALSE; return false;
break; break;
default: default:
@@ -744,7 +749,7 @@ bool wxMGLBitmapHandler::LoadFile(wxBitmap *bitmap, const wxString& name,
break; break;
} }
return TRUE; return true;
} }
bool wxMGLBitmapHandler::SaveFile(const wxBitmap *bitmap, const wxString& name, bool wxMGLBitmapHandler::SaveFile(const wxBitmap *bitmap, const wxString& name,
@@ -761,21 +766,16 @@ bool wxMGLBitmapHandler::SaveFile(const wxBitmap *bitmap, const wxString& name,
switch (type) switch (type)
{ {
case wxBITMAP_TYPE_BMP: case wxBITMAP_TYPE_BMP:
return tdc->saveBitmapFromDC(name.mb_str(), 0, 0, w, h); return (bool)tdc->saveBitmapFromDC(name.mb_str(), 0, 0, w, h);
break;
case wxBITMAP_TYPE_JPEG: case wxBITMAP_TYPE_JPEG:
return tdc->saveJPEGFromDC(name.mb_str(), 0, 0, w, h, 75); return (bool)tdc->saveJPEGFromDC(name.mb_str(), 0, 0, w, h, 75);
break;
case wxBITMAP_TYPE_PNG: case wxBITMAP_TYPE_PNG:
return tdc->savePNGFromDC(name.mb_str(), 0, 0, w, h); return (bool)tdc->savePNGFromDC(name.mb_str(), 0, 0, w, h);
break;
case wxBITMAP_TYPE_PCX: case wxBITMAP_TYPE_PCX:
return tdc->savePCXFromDC(name.mb_str(), 0, 0, w, h); return (bool)tdc->savePCXFromDC(name.mb_str(), 0, 0, w, h);
break;
default:
return FALSE;
break;
} }
return false;
} }
@@ -807,7 +807,7 @@ bool wxPNGBitmapHandler::LoadFile(wxBitmap *bitmap, const wxString& name,
fullname = name; fullname = name;
if ( !MGL_getPNGSize(fullname.mb_str(), &width, &height, &bpp, &pf) ) if ( !MGL_getPNGSize(fullname.mb_str(), &width, &height, &bpp, &pf) )
return FALSE; return false;
if ( bpp != 32 ) if ( bpp != 32 )
{ {
@@ -820,10 +820,10 @@ bool wxPNGBitmapHandler::LoadFile(wxBitmap *bitmap, const wxString& name,
bitmap_t *bmp = MGL_loadPNG(fullname.mb_str(), TRUE); bitmap_t *bmp = MGL_loadPNG(fullname.mb_str(), TRUE);
if ( bmp == NULL ) return FALSE; if ( bmp == NULL ) return false;
bitmap->Create(bmp->width, bmp->height, -1); bitmap->Create(bmp->width, bmp->height, -1);
if ( !bitmap->Ok() ) return FALSE; if ( !bitmap->Ok() ) return false;
// convert bmp to display's depth and write it to *bitmap: // convert bmp to display's depth and write it to *bitmap:
wxMemoryDC dc; wxMemoryDC dc;
@@ -857,7 +857,7 @@ bool wxPNGBitmapHandler::LoadFile(wxBitmap *bitmap, const wxString& name,
MGL_unloadBitmap(bmp); MGL_unloadBitmap(bmp);
return TRUE; return true;
} }
@@ -869,9 +869,13 @@ class wxICOBitmapHandler: public wxBitmapHandler
wxICOBitmapHandler(wxBitmapType type, wxICOBitmapHandler(wxBitmapType type,
const wxString& extension, const wxString& name); const wxString& extension, const wxString& name);
virtual bool Create(wxBitmap *bitmap, void *data, long flags, virtual bool Create(wxBitmap *WXUNUSED(bitmap),
int width, int height, int depth = 1) void *WXUNUSED(data),
{ return FALSE; } long WXUNUSED(flags),
int WXUNUSED(width),
int WXUNUSED(height),
int WXUNUSED(depth) = 1)
{ return false; }
virtual bool LoadFile(wxBitmap *bitmap, const wxString& name, long flags, virtual bool LoadFile(wxBitmap *bitmap, const wxString& name, long flags,
int desiredWidth, int desiredHeight); int desiredWidth, int desiredHeight);
@@ -902,7 +906,7 @@ bool wxICOBitmapHandler::LoadFile(wxBitmap *bitmap, const wxString& name,
else else
icon = MGL_loadIcon(name.mb_str(), TRUE); icon = MGL_loadIcon(name.mb_str(), TRUE);
if ( icon == NULL ) return FALSE; if ( icon == NULL ) return false;
bitmap->Create(icon->xorMask.width, icon->xorMask.height); bitmap->Create(icon->xorMask.width, icon->xorMask.height);
@@ -927,13 +931,15 @@ bool wxICOBitmapHandler::LoadFile(wxBitmap *bitmap, const wxString& name,
MGL_unloadIcon(icon); MGL_unloadIcon(icon);
return TRUE; return true;
} }
bool wxICOBitmapHandler::SaveFile(const wxBitmap *bitmap, const wxString& name, bool wxICOBitmapHandler::SaveFile(const wxBitmap *WXUNUSED(bitmap),
int type, const wxPalette * WXUNUSED(palette)) const wxString& WXUNUSED(name),
int WXUNUSED(type),
const wxPalette * WXUNUSED(palette))
{ {
return FALSE; return false;
} }

View File

@@ -59,7 +59,7 @@ void wxBitmapToPixPattern(const wxBitmap& bitmap,
mask->p[y] = 0; mask->p[y] = 0;
for (x = 0; x < 8; x++) for (x = 0; x < 8; x++)
if ( dc->getPixelFast(x, y) != 0 ) if ( dc->getPixelFast(x, y) != 0 )
mask->p[y] |= 1 << (7 - x); mask->p[y] = (uchar)(mask->p[y] | (1 << (7 - x)));
} }
dc->endPixel(); dc->endPixel();
} }

View File

@@ -1,5 +1,5 @@
///////////////////////////////////////////////////////////////////////////// /////////////////////////////////////////////////////////////////////////////
// Name: cursor.cpp // Name: src/mgl/cursor.cpp
// Purpose: // Purpose:
// Author: Vaclav Slavik // Author: Vaclav Slavik
// Id: $Id$ // Id: $Id$
@@ -109,7 +109,6 @@ wxCursor::wxCursor(int cursorId)
case wxCURSOR_NONE: case wxCURSOR_NONE:
*this = wxNullCursor; *this = wxNullCursor;
return; return;
break;
default: default:
wxFAIL_MSG(wxT("unsupported cursor type")); wxFAIL_MSG(wxT("unsupported cursor type"));
@@ -150,7 +149,7 @@ wxCursor::wxCursor(const char WXUNUSED(bits)[],
wxCursor::wxCursor(const wxString& cursor_file, wxCursor::wxCursor(const wxString& cursor_file,
long flags, long flags,
int hotSpotX, int hotSpotY) int WXUNUSED(hotSpotX), int WXUNUSED(hotSpotY))
{ {
if ( flags == wxBITMAP_TYPE_CUR || flags == wxBITMAP_TYPE_CUR_RESOURCE ) if ( flags == wxBITMAP_TYPE_CUR || flags == wxBITMAP_TYPE_CUR_RESOURCE )
{ {
@@ -285,7 +284,7 @@ bool wxIsBusy()
class wxCursorModule : public wxModule class wxCursorModule : public wxModule
{ {
public: public:
virtual bool OnInit() { return TRUE; } virtual bool OnInit() { return true; }
virtual void OnExit() virtual void OnExit()
{ {

View File

@@ -1,5 +1,5 @@
///////////////////////////////////////////////////////////////////////////// /////////////////////////////////////////////////////////////////////////////
// Name: mgl/data.cpp // Name: src/mgl/data.cpp
// Purpose: wxMGL-specific global data // Purpose: wxMGL-specific global data
// Author: Robert Roebling // Author: Robert Roebling
// Id: $Id$ // Id: $Id$
@@ -7,6 +7,13 @@
// Licence: wxWindows licence // Licence: wxWindows licence
///////////////////////////////////////////////////////////////////////////// /////////////////////////////////////////////////////////////////////////////
// For compilers that support precompilation, includes "wx.h".
#include "wx/wxprec.h"
#ifdef __BORLANDC__
#pragma hdrstop
#endif
#include "wx/defs.h" #include "wx/defs.h"
#include "wx/cursor.h" #include "wx/cursor.h"
@@ -15,15 +22,14 @@
wxCursor g_globalCursor; wxCursor g_globalCursor;
/* Don't allow event propagation during drag */ /* Don't allow event propagation during drag */
bool g_blockEventsOnDrag = FALSE; bool g_blockEventsOnDrag = false;
/* Don't allow mouse event propagation during scroll */ /* Don't allow mouse event propagation during scroll */
bool g_blockEventsOnScroll = FALSE; bool g_blockEventsOnScroll = false;
/* Don't allow window closing if there are open dialogs */ /* Don't allow window closing if there are open dialogs */
int g_openDialogs = 0; int g_openDialogs = 0;
/* TRUE when the message queue is empty. this gets set to /* true when the message queue is empty. this gets set to
FALSE by all event callbacks before anything else is done */ false by all event callbacks before anything else is done */
bool g_isIdle = FALSE; bool g_isIdle = false;

View File

@@ -1,5 +1,5 @@
///////////////////////////////////////////////////////////////////////////// /////////////////////////////////////////////////////////////////////////////
// Name: dc.cpp // Name: src/mgl/dc.cpp
// Purpose: wxDC class // Purpose: wxDC class
// Author: Vaclav Slavik // Author: Vaclav Slavik
// Created: 2001/03/09 // Created: 2001/03/09
@@ -137,10 +137,10 @@ IMPLEMENT_ABSTRACT_CLASS(wxDC, wxDCBase)
// Default constructor // Default constructor
wxDC::wxDC() wxDC::wxDC()
{ {
m_isMemDC = FALSE; m_isMemDC = false;
m_MGLDC = NULL; m_MGLDC = NULL;
m_OwnsMGLDC = FALSE; m_OwnsMGLDC = false;
m_ok = FALSE; // must call SetMGLDevCtx() before using it m_ok = false; // must call SetMGLDevCtx() before using it
m_mm_to_pix_x = (double)wxGetDisplaySize().GetWidth() / m_mm_to_pix_x = (double)wxGetDisplaySize().GetWidth() /
(double)wxGetDisplaySizeMM().GetWidth(); (double)wxGetDisplaySizeMM().GetWidth();
@@ -152,8 +152,8 @@ wxDC::wxDC()
m_brush = *wxWHITE_BRUSH; m_brush = *wxWHITE_BRUSH;
m_penOfsX = m_penOfsY = 0; m_penOfsX = m_penOfsY = 0;
m_penSelected = m_brushSelected = FALSE; m_penSelected = m_brushSelected = false;
m_downloadedPatterns[0] = m_downloadedPatterns[1] = FALSE; m_downloadedPatterns[0] = m_downloadedPatterns[1] = false;
m_mglFont = NULL; m_mglFont = NULL;
} }
@@ -171,7 +171,7 @@ void wxDC::SetMGLDC(MGLDevCtx *mgldc, bool OwnsMGLDC)
delete m_MGLDC; delete m_MGLDC;
m_MGLDC = mgldc; m_MGLDC = mgldc;
m_OwnsMGLDC = OwnsMGLDC; m_OwnsMGLDC = OwnsMGLDC;
m_ok = TRUE; m_ok = true;
if ( !m_globalClippingRegion.IsNull() ) if ( !m_globalClippingRegion.IsNull() )
SetClippingRegion(m_globalClippingRegion); SetClippingRegion(m_globalClippingRegion);
@@ -216,7 +216,7 @@ void wxDC::DoSetClippingRegion(wxCoord cx, wxCoord cy, wxCoord cw, wxCoord ch)
m_MGLDC->setClipRegion(m_currentClippingRegion.GetMGLRegion()); m_MGLDC->setClipRegion(m_currentClippingRegion.GetMGLRegion());
m_clipping = TRUE; m_clipping = true;
DO_SET_CLIPPING_BOX(m_currentClippingRegion) DO_SET_CLIPPING_BOX(m_currentClippingRegion)
} }
@@ -256,7 +256,7 @@ void wxDC::DoSetClippingRegionAsRegion(const wxRegion& region)
m_MGLDC->setClipRegion(m_currentClippingRegion.GetMGLRegion()); m_MGLDC->setClipRegion(m_currentClippingRegion.GetMGLRegion());
m_clipping = TRUE; m_clipping = true;
DO_SET_CLIPPING_BOX(m_currentClippingRegion) DO_SET_CLIPPING_BOX(m_currentClippingRegion)
} }
@@ -268,7 +268,7 @@ void wxDC::DestroyClippingRegion()
{ {
m_MGLDC->setClipRegion(m_globalClippingRegion.GetMGLRegion()); m_MGLDC->setClipRegion(m_globalClippingRegion.GetMGLRegion());
m_currentClippingRegion = m_globalClippingRegion; m_currentClippingRegion = m_globalClippingRegion;
m_clipping = TRUE; m_clipping = true;
} }
else else
{ {
@@ -284,12 +284,12 @@ void wxDC::DestroyClippingRegion()
bool wxDC::CanDrawBitmap() const bool wxDC::CanDrawBitmap() const
{ {
return TRUE; return true;
} }
bool wxDC::CanGetTextExtent() const bool wxDC::CanGetTextExtent() const
{ {
return TRUE; return true;
} }
int wxDC::GetDepth() const int wxDC::GetDepth() const
@@ -329,13 +329,13 @@ bool wxDC::DoFloodFill(wxCoord x, wxCoord y,
bool wxDC::DoGetPixel(wxCoord x, wxCoord y, wxColour *col) const bool wxDC::DoGetPixel(wxCoord x, wxCoord y, wxColour *col) const
{ {
wxCHECK_MSG( col, FALSE, _T("NULL colour parameter in wxDC::GetPixel")); wxCHECK_MSG( col, false, _T("NULL colour parameter in wxDC::GetPixel"));
uchar r, g, b; uchar r, g, b;
m_MGLDC->unpackColorFast(m_MGLDC->getPixel(XLOG2DEV(x), YLOG2DEV(y)), m_MGLDC->unpackColorFast(m_MGLDC->getPixel(XLOG2DEV(x), YLOG2DEV(y)),
r, g, b); r, g, b);
col->Set(r, g, b); col->Set(r, g, b);
return TRUE; return true;
} }
void wxDC::DoCrossHair(wxCoord x, wxCoord y) void wxDC::DoCrossHair(wxCoord x, wxCoord y)
@@ -452,7 +452,7 @@ void wxDC::DoDrawPoint(wxCoord x, wxCoord y)
} }
} }
void wxDC::DoDrawPolygon(int n, wxPoint points[], wxCoord xoffset, wxCoord yoffset,int fillStyle) void wxDC::DoDrawPolygon(int n, wxPoint points[], wxCoord xoffset, wxCoord yoffset,int WXUNUSED(fillStyle))
{ {
wxCHECK_RET( Ok(), wxT("invalid dc") ); wxCHECK_RET( Ok(), wxT("invalid dc") );
@@ -710,7 +710,7 @@ bool wxDC::SelectMGLFont()
bool antialiased = (GetDepth() > 8); bool antialiased = (GetDepth() > 8);
m_mglFont = m_font.GetMGLfont_t(scale, antialiased); m_mglFont = m_font.GetMGLfont_t(scale, antialiased);
wxCHECK_MSG( m_mglFont, FALSE, wxT("invalid font") ); wxCHECK_MSG( m_mglFont, false, wxT("invalid font") );
m_MGLDC->useFont(m_mglFont); m_MGLDC->useFont(m_mglFont);
wxLogTrace("mgl_font", "useFont(%p)", m_mglFont); wxLogTrace("mgl_font", "useFont(%p)", m_mglFont);
@@ -731,7 +731,7 @@ bool wxDC::SelectMGLFont()
m_MGLDC->setTextEncoding(nativeEnc.mglEncoding); m_MGLDC->setTextEncoding(nativeEnc.mglEncoding);
#endif #endif
} }
return TRUE; return true;
} }
void wxDC::DrawAnyText(const wxString& text, wxCoord x, wxCoord y) void wxDC::DrawAnyText(const wxString& text, wxCoord x, wxCoord y)
@@ -795,7 +795,7 @@ void wxDC::DrawAnyText(const wxString& text, wxCoord x, wxCoord y)
m_MGLDC->line(x1, y1, x2, y2); m_MGLDC->line(x1, y1, x2, y2);
} }
m_penSelected = m_brushSelected = FALSE; m_penSelected = m_brushSelected = false;
} }
void wxDC::DoDrawRotatedText(const wxString& text, void wxDC::DoDrawRotatedText(const wxString& text,
@@ -937,7 +937,7 @@ void wxDC::SelectMGLFatPen(int style, int flag)
if ( !m_downloadedPatterns[slot] ) if ( !m_downloadedPatterns[slot] )
{ {
m_MGLDC->setPenBitmapPattern(slot, pattern); m_MGLDC->setPenBitmapPattern(slot, pattern);
m_downloadedPatterns[slot] = TRUE; m_downloadedPatterns[slot] = true;
} }
m_MGLDC->usePenBitmapPattern(slot); m_MGLDC->usePenBitmapPattern(slot);
} }
@@ -954,7 +954,7 @@ void wxDC::SelectMGLFatPen(int style, int flag)
case 8: case 8:
for (y = 0; y < 8; y++) for (y = 0; y < 8; y++)
for (x = 0; x < 8; x++) for (x = 0; x < 8; x++)
pix.b8.p[x][y] = m_MGLDC->packColorFast( pix.b8.p[x][y] = (uchar)m_MGLDC->packColorFast(
pixPattern->p[x][y][0], pixPattern->p[x][y][0],
pixPattern->p[x][y][1], pixPattern->p[x][y][1],
pixPattern->p[x][y][2]); pixPattern->p[x][y][2]);
@@ -963,7 +963,7 @@ void wxDC::SelectMGLFatPen(int style, int flag)
case 16: case 16:
for (y = 0; y < 8; y++) for (y = 0; y < 8; y++)
for (x = 0; x < 8; x++) for (x = 0; x < 8; x++)
pix.b16.p[x][y] = m_MGLDC->packColorFast( pix.b16.p[x][y] = (M_uint16)m_MGLDC->packColorFast(
pixPattern->p[x][y][0], pixPattern->p[x][y][0],
pixPattern->p[x][y][1], pixPattern->p[x][y][1],
pixPattern->p[x][y][2]); pixPattern->p[x][y][2]);
@@ -987,7 +987,7 @@ void wxDC::SelectMGLFatPen(int style, int flag)
break; break;
} }
m_MGLDC->setPenPixmapPattern(slot, &pix); m_MGLDC->setPenPixmapPattern(slot, &pix);
m_downloadedPatterns[slot] = TRUE; m_downloadedPatterns[slot] = true;
} }
m_MGLDC->usePenPixmapPattern(slot); m_MGLDC->usePenPixmapPattern(slot);
} }
@@ -1039,8 +1039,8 @@ void wxDC::SelectPen()
SelectMGLFatPen(wxSOLID, wxMGL_SELECT_FROM_PEN); SelectMGLFatPen(wxSOLID, wxMGL_SELECT_FROM_PEN);
break; break;
} }
m_penSelected = TRUE; m_penSelected = true;
m_brushSelected = FALSE; m_brushSelected = false;
} }
void wxDC::SelectBrush() void wxDC::SelectBrush()
@@ -1063,8 +1063,8 @@ void wxDC::SelectBrush()
m_MGLDC->setColorRGB(fg.Red(), fg.Green(), fg.Blue()); m_MGLDC->setColorRGB(fg.Red(), fg.Green(), fg.Blue());
m_MGLDC->setBackColor(m_MGLDC->packColorFast(bg.Red(), bg.Green(), bg.Blue())); m_MGLDC->setBackColor(m_MGLDC->packColorFast(bg.Red(), bg.Green(), bg.Blue()));
m_penSelected = FALSE; m_penSelected = false;
m_brushSelected = TRUE; m_brushSelected = true;
SelectMGLFatPen(m_brush.GetStyle(), wxMGL_SELECT_FROM_BRUSH); SelectMGLFatPen(m_brush.GetStyle(), wxMGL_SELECT_FROM_BRUSH);
} }
@@ -1074,8 +1074,8 @@ void wxDC::SetPen(const wxPen& pen)
if ( !pen.Ok() ) return; if ( !pen.Ok() ) return;
if ( m_pen == pen ) return; if ( m_pen == pen ) return;
m_pen = pen; m_pen = pen;
m_penSelected = FALSE; m_penSelected = false;
m_downloadedPatterns[0] = FALSE; m_downloadedPatterns[0] = false;
} }
void wxDC::SetBrush(const wxBrush& brush) void wxDC::SetBrush(const wxBrush& brush)
@@ -1083,8 +1083,8 @@ void wxDC::SetBrush(const wxBrush& brush)
if ( !brush.Ok() ) return; if ( !brush.Ok() ) return;
if ( m_brush == brush ) return; if ( m_brush == brush ) return;
m_brush = brush; m_brush = brush;
m_brushSelected = FALSE; m_brushSelected = false;
m_downloadedPatterns[1] = FALSE; m_downloadedPatterns[1] = false;
} }
void wxDC::SetPalette(const wxPalette& palette) void wxDC::SetPalette(const wxPalette& palette)
@@ -1179,10 +1179,10 @@ int wxDC::LogicalFunctionToMGLRop(int logFunc) const
return (int)rop; return (int)rop;
} }
bool wxDC::StartDoc(const wxString& message) bool wxDC::StartDoc(const wxString& WXUNUSED(message))
{ {
// We might be previewing, so return TRUE to let it continue. // We might be previewing, so return true to let it continue.
return TRUE; return true;
} }
void wxDC::EndDoc() void wxDC::EndDoc()
@@ -1264,7 +1264,7 @@ void wxDC::ComputeScaleAndOrigin()
m_mglFont = NULL; m_mglFont = NULL;
// make sure m_penOfs{X,Y} will be reevaluated before drawing: // make sure m_penOfs{X,Y} will be reevaluated before drawing:
if ( newY != m_scaleY || newX != m_scaleX ) if ( newY != m_scaleY || newX != m_scaleX )
m_penSelected = FALSE; m_penSelected = false;
m_scaleX = newX, m_scaleY = newY; m_scaleX = newX, m_scaleY = newY;
} }
@@ -1409,8 +1409,8 @@ bool wxDC::DoBlit(wxCoord xdest, wxCoord ydest,
int rop, bool useMask, int rop, bool useMask,
wxCoord xsrcMask, wxCoord ysrcMask) wxCoord xsrcMask, wxCoord ysrcMask)
{ {
wxCHECK_MSG( Ok(), FALSE, wxT("invalid dc") ); wxCHECK_MSG( Ok(), false, wxT("invalid dc") );
wxCHECK_MSG( source, FALSE, wxT("invalid source dc") ); wxCHECK_MSG( source, false, wxT("invalid source dc") );
// transform the source DC coords to the device ones // transform the source DC coords to the device ones
xsrc = source->LogicalToDeviceX(xsrc); xsrc = source->LogicalToDeviceX(xsrc);
@@ -1450,7 +1450,7 @@ bool wxDC::DoBlit(wxCoord xdest, wxCoord ydest,
xx, yy, LogicalFunctionToMGLRop(rop)); xx, yy, LogicalFunctionToMGLRop(rop));
} }
return TRUE; return true;
} }
void wxDC::DoDrawBitmap(const wxBitmap &bmp, wxCoord x, wxCoord y, bool useMask) void wxDC::DoDrawBitmap(const wxBitmap &bmp, wxCoord x, wxCoord y, bool useMask)
@@ -1467,7 +1467,7 @@ void wxDC::DoDrawBitmap(const wxBitmap &bmp, wxCoord x, wxCoord y, bool useMask)
void wxDC::DoDrawIcon(const wxIcon& icon, wxCoord x, wxCoord y) void wxDC::DoDrawIcon(const wxIcon& icon, wxCoord x, wxCoord y)
{ {
// VZ: egcs 1.0.3 refuses to compile this without cast, no idea why // VZ: egcs 1.0.3 refuses to compile this without cast, no idea why
DoDrawBitmap((const wxBitmap&)icon, x, y, (bool)TRUE); DoDrawBitmap((const wxBitmap&)icon, x, y, true);
} }
@@ -1553,7 +1553,7 @@ void wxDC::DoDrawSubBitmap(const wxBitmap &bmp,
{ {
temp = new MGLMemoryDC(dw, dh, GetDepth(), NULL); temp = new MGLMemoryDC(dw, dh, GetDepth(), NULL);
wxDC tempdc; wxDC tempdc;
tempdc.SetMGLDC(temp, FALSE); tempdc.SetMGLDC(temp, false);
tempdc.SetPalette(m_palette); tempdc.SetPalette(m_palette);
} }
else else

View File

@@ -1,5 +1,5 @@
/////////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////////
// Name: mgl/evtloop.cpp // Name: src/mgl/evtloop.cpp
// Purpose: implements wxEventLoop for MGL // Purpose: implements wxEventLoop for MGL
// Author: Vaclav Slavik // Author: Vaclav Slavik
// RCS-ID: $Id$ // RCS-ID: $Id$
@@ -39,13 +39,13 @@ public:
wxEventLoopImpl() wxEventLoopImpl()
{ {
SetExitCode(0); SetExitCode(0);
SetKeepLooping(TRUE); SetKeepLooping(true);
} }
// process an event // process an event
void Dispatch(); void Dispatch();
// generate an idle event, return TRUE if more idle time requested // generate an idle event, return true if more idle time requested
bool SendIdleEvent(); bool SendIdleEvent();
// set/get the exit code // set/get the exit code
@@ -59,7 +59,7 @@ private:
// the exit code of the event loop // the exit code of the event loop
int m_exitcode; int m_exitcode;
// FALSE if the loop should end // false if the loop should end
bool m_keepLooping; bool m_keepLooping;
}; };
@@ -154,7 +154,7 @@ void wxEventLoop::Exit(int rc)
wxCHECK_RET( IsRunning(), _T("can't call Exit() if not running") ); wxCHECK_RET( IsRunning(), _T("can't call Exit() if not running") );
m_impl->SetExitCode(rc); m_impl->SetExitCode(rc);
m_impl->SetKeepLooping(FALSE); m_impl->SetKeepLooping(false);
// Send a dummy event so that the app won't block in EVT_halt if there // Send a dummy event so that the app won't block in EVT_halt if there
// are no user-generated events in the queue: // are no user-generated events in the queue:
@@ -173,12 +173,12 @@ bool wxEventLoop::Pending() const
// is there an event in the queue? // is there an event in the queue?
event_t evt; event_t evt;
return EVT_peekNext(&evt, EVT_EVERYEVT); return (bool)(EVT_peekNext(&evt, EVT_EVERYEVT));
} }
bool wxEventLoop::Dispatch() bool wxEventLoop::Dispatch()
{ {
wxCHECK_MSG( IsRunning(), FALSE, _T("can't call Dispatch() if not running") ); wxCHECK_MSG( IsRunning(), false, _T("can't call Dispatch() if not running") );
m_impl->Dispatch(); m_impl->Dispatch();
return m_impl->GetKeepLooping(); return m_impl->GetKeepLooping();

View File

@@ -1,5 +1,5 @@
///////////////////////////////////////////////////////////////////////////// /////////////////////////////////////////////////////////////////////////////
// Name: mgl/fontutil.cpp // Name: src/mgl/fontutil.cpp
// Purpose: Font helper functions for MGL // Purpose: Font helper functions for MGL
// Author: Vaclav Slavik // Author: Vaclav Slavik
// Created: 2001/04/29 // Created: 2001/04/29
@@ -45,20 +45,20 @@ bool wxNativeEncodingInfo::FromString(const wxString& s)
wxString encid = tokenizer.GetNextToken(); wxString encid = tokenizer.GetNextToken();
long enc; long enc;
if ( !encid.ToLong(&enc) ) if ( !encid.ToLong(&enc) )
return FALSE; return false;
encoding = (wxFontEncoding)enc; encoding = (wxFontEncoding)enc;
// ok even if empty // ok even if empty
facename = tokenizer.GetNextToken(); facename = tokenizer.GetNextToken();
return TRUE; return true;
} }
wxString wxNativeEncodingInfo::ToString() const wxString wxNativeEncodingInfo::ToString() const
{ {
wxString s; wxString s;
s << (long)encoding; s << (long)encoding;
if ( !!facename ) if ( !facename.empty() )
{ {
s << _T(';') << facename; s << _T(';') << facename;
} }
@@ -73,7 +73,7 @@ wxString wxNativeEncodingInfo::ToString() const
bool wxGetNativeFontEncoding(wxFontEncoding encoding, bool wxGetNativeFontEncoding(wxFontEncoding encoding,
wxNativeEncodingInfo *info) wxNativeEncodingInfo *info)
{ {
wxCHECK_MSG( info, FALSE, _T("bad pointer in wxGetNativeFontEncoding") ); wxCHECK_MSG( info, false, _T("bad pointer in wxGetNativeFontEncoding") );
if ( encoding == wxFONTENCODING_DEFAULT ) if ( encoding == wxFONTENCODING_DEFAULT )
{ {
@@ -122,29 +122,29 @@ bool wxGetNativeFontEncoding(wxFontEncoding encoding,
default: default:
// encoding not known to MGL // encoding not known to MGL
return FALSE; return false;
} }
info->encoding = encoding; info->encoding = encoding;
return TRUE; return true;
} }
bool wxTestFontEncoding(const wxNativeEncodingInfo& info) bool wxTestFontEncoding(const wxNativeEncodingInfo& info)
{ {
if ( !info.facename ) if ( !info.facename )
return TRUE; return true;
wxMGLFontFamily *family = wxTheFontsManager->GetFamily(info.facename); wxMGLFontFamily *family = wxTheFontsManager->GetFamily(info.facename);
if ( !family ) if ( !family )
return FALSE; return false;
if ( family->GetInfo()->fontLibType == MGL_BITMAPFONT_LIB ) if ( family->GetInfo()->fontLibType == MGL_BITMAPFONT_LIB )
return (info.mglEncoding == MGL_ENCODING_ASCII || return (info.mglEncoding == MGL_ENCODING_ASCII ||
info.mglEncoding == MGL_ENCODING_ISO8859_1 || info.mglEncoding == MGL_ENCODING_ISO8859_1 ||
info.mglEncoding == MGL_ENCODING_ISO8859_15 || info.mglEncoding == MGL_ENCODING_ISO8859_15 ||
info.mglEncoding == MGL_ENCODING_CP1252); info.mglEncoding == MGL_ENCODING_CP1252);
else else
return TRUE; return true;
} }
@@ -192,7 +192,7 @@ wxMGLFontLibrary::wxMGLFontLibrary(const wxString& filename, int type,
m_fontLib = NULL; m_fontLib = NULL;
m_instances = new wxMGLFontInstanceList; m_instances = new wxMGLFontInstanceList;
m_instances->DeleteContents(TRUE); m_instances->DeleteContents(true);
} }
wxMGLFontLibrary::~wxMGLFontLibrary() wxMGLFontLibrary::~wxMGLFontLibrary()
@@ -232,8 +232,6 @@ wxMGLFontInstance *wxMGLFontLibrary::GetFontInstance(wxFont *font,
wxASSERT_MSG(m_refs > 0 && m_fontLib, wxT("font library not loaded!")); wxASSERT_MSG(m_refs > 0 && m_fontLib, wxT("font library not loaded!"));
wxString facename; wxString facename;
bool slant;
bool antialiased;
float pt = (float)font->GetPointSize() * scale; float pt = (float)font->GetPointSize() * scale;
if ( gs_antialiasingThreshold == -1 ) if ( gs_antialiasingThreshold == -1 )
@@ -250,16 +248,16 @@ wxMGLFontInstance *wxMGLFontLibrary::GetFontInstance(wxFont *font,
// Small characters don't look good when antialiased with the algorithm // Small characters don't look good when antialiased with the algorithm
// that FreeType uses (mere 2x2 supersampling), so lets disable it AA // that FreeType uses (mere 2x2 supersampling), so lets disable it AA
// completely for small fonts. // completely for small fonts.
if ( pt <= gs_antialiasingThreshold ) bool antialiased = false;
antialiased = FALSE; if (( pt > gs_antialiasingThreshold ) &&
else ( m_fontLib->fontLibType != MGL_BITMAPFONT_LIB ) )
antialiased = (m_fontLib->fontLibType == MGL_BITMAPFONT_LIB) ? FALSE : aa; antialiased = aa;
slant = (((m_type & wxFONTFACE_ITALIC) == 0) && bool slant = (((m_type & wxFONTFACE_ITALIC) == 0) &&
(font->GetStyle() == wxSLANT || font->GetStyle() == wxITALIC)); (font->GetStyle() == wxSLANT || font->GetStyle() == wxITALIC));
// FIXME_MGL -- MGL does not yet support slant, although the API is there // FIXME_MGL -- MGL does not yet support slant, although the API is there
slant = FALSE; slant = false;
wxLogTrace("mgl_font", "requested instance of '%s' slant=%i pt=%0.1f aa=%i", wxLogTrace("mgl_font", "requested instance of '%s' slant=%i pt=%0.1f aa=%i",
m_fileName.mb_str(), slant, pt, antialiased); m_fileName.mb_str(), slant, pt, antialiased);
@@ -341,7 +339,7 @@ wxMGLFontLibrary *wxFontsManager::GetFontLibrary(wxFont *font)
int type; int type;
wxString facename = font->GetFaceName(); wxString facename = font->GetFaceName();
if ( !facename.IsEmpty() ) if ( !facename.empty() )
family = GetFamily(facename); family = GetFamily(facename);
else else
family = NULL; family = NULL;
@@ -419,9 +417,9 @@ static ibool MGLAPI enum_callback(const font_info_t *info, void *cookie)
wxFontsManager::wxFontsManager() wxFontsManager::wxFontsManager()
{ {
m_hash = new wxHashTable(wxKEY_STRING); m_hash = new wxHashTable(wxKEY_STRING);
m_hash->DeleteContents(FALSE); m_hash->DeleteContents(false);
m_list = new wxMGLFontFamilyList; m_list = new wxMGLFontFamilyList;
m_list->DeleteContents(TRUE); m_list->DeleteContents(true);
MGL_enumerateFonts(enum_callback, (void*)this); MGL_enumerateFonts(enum_callback, (void*)this);
} }

View File

@@ -1,5 +1,5 @@
///////////////////////////////////////////////////////////////////////////// /////////////////////////////////////////////////////////////////////////////
// Name: region.cpp // Name: src/mgl/region.cpp
// Purpose: Region handling for wxWidgets/MGL // Purpose: Region handling for wxWidgets/MGL
// Author: Vaclav Slavik // Author: Vaclav Slavik
// RCS-ID: $Id$ // RCS-ID: $Id$
@@ -151,8 +151,10 @@ wxRect wxRegion::GetBox() const
// Is region empty? // Is region empty?
bool wxRegion::Empty() const bool wxRegion::Empty() const
{ {
if (!m_refData) return TRUE; if (!m_refData)
return M_REGION.isEmpty(); return true;
return (bool)(M_REGION.isEmpty());
} }
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
@@ -163,7 +165,7 @@ bool wxRegion::Offset(wxCoord x, wxCoord y)
{ {
AllocExclusive(); AllocExclusive();
M_REGION.offset(x, y); M_REGION.offset(x, y);
return TRUE; return true;
} }
// Union rectangle or region with this. // Union rectangle or region with this.
@@ -171,14 +173,14 @@ bool wxRegion::Union(wxCoord x, wxCoord y, wxCoord width, wxCoord height)
{ {
AllocExclusive(); AllocExclusive();
M_REGION += MGLRect(x, y, x + width, y + height); M_REGION += MGLRect(x, y, x + width, y + height);
return TRUE; return true;
} }
bool wxRegion::Union(const wxRegion& region) bool wxRegion::Union(const wxRegion& region)
{ {
AllocExclusive(); AllocExclusive();
M_REGION += M_REGION_OF(region); M_REGION += M_REGION_OF(region);
return TRUE; return true;
} }
// Intersect rectangle or region with this. // Intersect rectangle or region with this.
@@ -186,14 +188,14 @@ bool wxRegion::Intersect(wxCoord x, wxCoord y, wxCoord width, wxCoord height)
{ {
AllocExclusive(); AllocExclusive();
M_REGION &= MGLRect(x, y, x + width, y + height); M_REGION &= MGLRect(x, y, x + width, y + height);
return TRUE; return true;
} }
bool wxRegion::Intersect(const wxRegion& region) bool wxRegion::Intersect(const wxRegion& region)
{ {
AllocExclusive(); AllocExclusive();
M_REGION &= M_REGION_OF(region); M_REGION &= M_REGION_OF(region);
return TRUE; return true;
} }
// Subtract rectangle or region from this: // Subtract rectangle or region from this:
@@ -202,14 +204,14 @@ bool wxRegion::Subtract(wxCoord x, wxCoord y, wxCoord width, wxCoord height)
{ {
AllocExclusive(); AllocExclusive();
M_REGION -= MGLRect(x, y, x + width, y + height); M_REGION -= MGLRect(x, y, x + width, y + height);
return TRUE; return true;
} }
bool wxRegion::Subtract(const wxRegion& region) bool wxRegion::Subtract(const wxRegion& region)
{ {
AllocExclusive(); AllocExclusive();
M_REGION -= M_REGION_OF(region); M_REGION -= M_REGION_OF(region);
return TRUE; return true;
} }
// XOR: the union of two combined regions except for any overlapping areas. // XOR: the union of two combined regions except for any overlapping areas.
@@ -220,7 +222,7 @@ bool wxRegion::Xor(wxCoord x, wxCoord y, wxCoord width, wxCoord height)
MGLRegion rg1 = M_REGION + rect, MGLRegion rg1 = M_REGION + rect,
rg2 = M_REGION & rect; rg2 = M_REGION & rect;
M_REGION = rg1 - rg2; M_REGION = rg1 - rg2;
return TRUE; return true;
} }
bool wxRegion::Xor(const wxRegion& region) bool wxRegion::Xor(const wxRegion& region)
@@ -229,7 +231,7 @@ bool wxRegion::Xor(const wxRegion& region)
MGLRegion rg1 = M_REGION + M_REGION_OF(region), MGLRegion rg1 = M_REGION + M_REGION_OF(region),
rg2 = M_REGION & M_REGION_OF(region); rg2 = M_REGION & M_REGION_OF(region);
M_REGION = rg1 - rg2; M_REGION = rg1 - rg2;
return TRUE; return true;
} }
@@ -296,7 +298,7 @@ public:
virtual bool OnInit() virtual bool OnInit()
{ {
gs_mutexIterator = new wxMutex(); gs_mutexIterator = new wxMutex();
return TRUE; return true;
} }
virtual void OnExit() virtual void OnExit()
{ {
@@ -313,7 +315,7 @@ IMPLEMENT_DYNAMIC_CLASS(wxMglRegionModule, wxModule)
*/ */
wxRegionIterator::wxRegionIterator() : m_currentNode(NULL) wxRegionIterator::wxRegionIterator() : m_currentNode(NULL)
{ {
m_rects.DeleteContents(TRUE); m_rects.DeleteContents(true);
} }
wxRegionIterator::~wxRegionIterator() wxRegionIterator::~wxRegionIterator()
@@ -325,7 +327,7 @@ wxRegionIterator::~wxRegionIterator()
*/ */
wxRegionIterator::wxRegionIterator(const wxRegion& region) wxRegionIterator::wxRegionIterator(const wxRegion& region)
{ {
m_rects.DeleteContents(TRUE); m_rects.DeleteContents(true);
Reset(region); Reset(region);
} }
@@ -350,7 +352,7 @@ void wxRegionIterator::Reset(const wxRegion& region)
if (!region.Empty()) if (!region.Empty())
{ {
#if wxUSE_THREADS #if wxUSE_THREADS
wxMutexLocker(*gs_mutexIterator); wxMutexLocker lock(*gs_mutexIterator);
#endif #endif
gs_rectList = &m_rects; gs_rectList = &m_rects;
M_REGION_OF(region).traverse(wxMGL_region_callback); M_REGION_OF(region).traverse(wxMGL_region_callback);

View File

@@ -1,5 +1,5 @@
///////////////////////////////////////////////////////////////////////////// /////////////////////////////////////////////////////////////////////////////
// Name: settings.h // Name: src/mgl/settings.cpp
// Author: Vaclav Slavik, Robert Roebling // Author: Vaclav Slavik, Robert Roebling
// Id: $Id$ // Id: $Id$
// Copyright: (c) 2001-2002 SciTech Software, Inc. (www.scitechsoft.com) // Copyright: (c) 2001-2002 SciTech Software, Inc. (www.scitechsoft.com)
@@ -28,7 +28,7 @@ static wxFont *gs_fontDefault = NULL;
class wxSystemSettingsModule : public wxModule class wxSystemSettingsModule : public wxModule
{ {
public: public:
virtual bool OnInit() { return TRUE; } virtual bool OnInit() { return true; }
virtual void OnExit() virtual void OnExit()
{ {
delete gs_fontDefault; delete gs_fontDefault;
@@ -65,12 +65,12 @@ wxFont wxSystemSettingsNative::GetFont(wxSystemFont index)
case wxSYS_DEFAULT_GUI_FONT: case wxSYS_DEFAULT_GUI_FONT:
{ {
if ( !gs_fontDefault ) if ( !gs_fontDefault )
gs_fontDefault = new wxFont(10, wxSWISS, wxNORMAL, wxNORMAL, FALSE, "Arial"); gs_fontDefault = new wxFont(10, wxSWISS, wxNORMAL, wxNORMAL, false, "Arial");
return *gs_fontDefault; return *gs_fontDefault;
} }
default:
return wxNullFont;
} }
return wxNullFont;
} }
int wxSystemSettingsNative::GetMetric(wxSystemMetric index, wxWindow* WXUNUSED(win)) int wxSystemSettingsNative::GetMetric(wxSystemMetric index, wxWindow* WXUNUSED(win))
@@ -88,10 +88,9 @@ int wxSystemSettingsNative::GetMetric(wxSystemMetric index, wxWindow* WXUNUSED(w
case wxSYS_VSCROLL_X: case wxSYS_VSCROLL_X:
case wxSYS_HSCROLL_Y: case wxSYS_HSCROLL_Y:
return 15; return 15;
break;
default:
return -1; // unsupported metric
} }
return -1; // unsupported metric
} }
bool wxSystemSettingsNative::HasFeature(wxSystemFeature index) bool wxSystemSettingsNative::HasFeature(wxSystemFeature index)
@@ -99,10 +98,10 @@ bool wxSystemSettingsNative::HasFeature(wxSystemFeature index)
switch (index) switch (index)
{ {
case wxSYS_CAN_ICONIZE_FRAME: case wxSYS_CAN_ICONIZE_FRAME:
return FALSE; break; return false;
case wxSYS_CAN_DRAW_FRAME_DECORATIONS: case wxSYS_CAN_DRAW_FRAME_DECORATIONS:
return FALSE; break; return false;
default:
return FALSE;
} }
return false;
} }

View File

@@ -167,13 +167,13 @@ static ibool MGLAPI wxWindowMouseHandler(window_t *wnd, event_t *e)
event.SetTimestamp(e->when); event.SetTimestamp(e->when);
event.m_x = where.x - orig.x; event.m_x = where.x - orig.x;
event.m_y = where.y - orig.y; event.m_y = where.y - orig.y;
event.m_shiftDown = e->modifiers & EVT_SHIFTKEY; event.m_shiftDown = ( e->modifiers & EVT_SHIFTKEY ) == EVT_SHIFTKEY;
event.m_controlDown = e->modifiers & EVT_CTRLSTATE; event.m_controlDown = ( e->modifiers & EVT_CTRLSTATE ) == EVT_CTRLSTATE;
event.m_altDown = e->modifiers & EVT_LEFTALT; event.m_altDown = ( e->modifiers & EVT_LEFTALT ) == EVT_LEFTALT;
event.m_metaDown = e->modifiers & EVT_RIGHTALT; event.m_metaDown = ( e->modifiers & EVT_RIGHTALT ) == EVT_RIGHTALT;
event.m_leftDown = e->modifiers & EVT_LEFTBUT; event.m_leftDown = ( e->modifiers & EVT_LEFTBUT ) == EVT_LEFTBUT;
event.m_middleDown = e->modifiers & EVT_MIDDLEBUT; event.m_middleDown = ( e->modifiers & EVT_MIDDLEBUT ) == EVT_MIDDLEBUT;
event.m_rightDown = e->modifiers & EVT_RIGHTBUT; event.m_rightDown = ( e->modifiers & EVT_RIGHTBUT ) == EVT_RIGHTBUT;
switch (e->what) switch (e->what)
{ {
@@ -435,10 +435,10 @@ static bool wxHandleSpecialKeys(wxKeyEvent& event)
) )
{ {
wxCaptureScreenshot(event.m_altDown/*only active wnd?*/); wxCaptureScreenshot(event.m_altDown/*only active wnd?*/);
return TRUE; return true;
} }
return FALSE; return false;
} }
static ibool MGLAPI wxWindowKeybHandler(window_t *wnd, event_t *e) static ibool MGLAPI wxWindowKeybHandler(window_t *wnd, event_t *e)
@@ -454,14 +454,14 @@ static ibool MGLAPI wxWindowKeybHandler(window_t *wnd, event_t *e)
wxKeyEvent event; wxKeyEvent event;
event.SetEventObject(win); event.SetEventObject(win);
event.SetTimestamp(e->when); event.SetTimestamp(e->when);
event.m_keyCode = wxScanToKeyCode(e, TRUE); event.m_keyCode = wxScanToKeyCode(e, true);
event.m_scanCode = 0; // not used by wx at all event.m_scanCode = 0; // not used by wx at all
event.m_x = where.x; event.m_x = where.x;
event.m_y = where.y; event.m_y = where.y;
event.m_shiftDown = e->modifiers & EVT_SHIFTKEY; event.m_shiftDown = ( e->modifiers & EVT_SHIFTKEY ) == EVT_SHIFTKEY;
event.m_controlDown = e->modifiers & EVT_CTRLSTATE; event.m_controlDown = ( e->modifiers & EVT_CTRLSTATE ) == EVT_CTRLSTATE;
event.m_altDown = e->modifiers & EVT_LEFTALT; event.m_altDown = ( e->modifiers & EVT_LEFTALT ) == EVT_LEFTALT;
event.m_metaDown = e->modifiers & EVT_RIGHTALT; event.m_metaDown = ( e->modifiers & EVT_RIGHTALT ) == EVT_RIGHTALT;
if ( e->what == EVT_KEYUP ) if ( e->what == EVT_KEYUP )
{ {
@@ -481,7 +481,7 @@ static ibool MGLAPI wxWindowKeybHandler(window_t *wnd, event_t *e)
// wxMSW doesn't send char events with Alt pressed // wxMSW doesn't send char events with Alt pressed
// Only send wxEVT_CHAR event if not processed yet. Thus, ALT-x // Only send wxEVT_CHAR event if not processed yet. Thus, ALT-x
// will only be sent if it is not in an accelerator table: // will only be sent if it is not in an accelerator table:
event2.m_keyCode = wxScanToKeyCode(e, FALSE); event2.m_keyCode = wxScanToKeyCode(e, false);
if ( !ret && event2.m_keyCode != 0 ) if ( !ret && event2.m_keyCode != 0 )
{ {
event2.SetEventType(wxEVT_CHAR); event2.SetEventType(wxEVT_CHAR);
@@ -544,8 +544,8 @@ void wxWindowMGL::Init()
// mgl specific: // mgl specific:
m_wnd = NULL; m_wnd = NULL;
m_isShown = TRUE; m_isShown = true;
m_frozen = FALSE; m_frozen = false;
m_paintMGLDC = NULL; m_paintMGLDC = NULL;
m_eraseBackground = -1; m_eraseBackground = -1;
} }
@@ -555,7 +555,7 @@ wxWindowMGL::~wxWindowMGL()
{ {
SendDestroyEvent(); SendDestroyEvent();
m_isBeingDeleted = TRUE; m_isBeingDeleted = true;
if ( gs_mouseCapture == this ) if ( gs_mouseCapture == this )
ReleaseMouse(); ReleaseMouse();
@@ -597,7 +597,7 @@ bool wxWindowMGL::Create(wxWindow *parent,
const wxString& name) const wxString& name)
{ {
if ( !CreateBase(parent, id, pos, size, style, wxDefaultValidator, name) ) if ( !CreateBase(parent, id, pos, size, style, wxDefaultValidator, name) )
return FALSE; return false;
if ( parent ) if ( parent )
parent->AddChild(this); parent->AddChild(this);
@@ -627,7 +627,7 @@ bool wxWindowMGL::Create(wxWindow *parent,
{ {
mgl_style |= MGL_WM_ALWAYS_ON_TOP; mgl_style |= MGL_WM_ALWAYS_ON_TOP;
// it is created hidden as other top level windows // it is created hidden as other top level windows
m_isShown = FALSE; m_isShown = false;
wnd_parent = NULL; wnd_parent = NULL;
} }
@@ -638,7 +638,7 @@ bool wxWindowMGL::Create(wxWindow *parent,
SetMGLwindow_t(wnd); SetMGLwindow_t(wnd);
return TRUE; return true;
} }
void wxWindowMGL::SetMGLwindow_t(struct window_t *wnd) void wxWindowMGL::SetMGLwindow_t(struct window_t *wnd)
@@ -649,7 +649,7 @@ void wxWindowMGL::SetMGLwindow_t(struct window_t *wnd)
m_wnd = wnd; m_wnd = wnd;
if ( !m_wnd ) return; if ( !m_wnd ) return;
m_isShown = m_wnd->visible; m_isShown = (bool)m_wnd->visible;
MGL_wmSetWindowUserData(m_wnd, (void*) this); MGL_wmSetWindowUserData(m_wnd, (void*) this);
MGL_wmSetWindowPainter(m_wnd, wxWindowPainter); MGL_wmSetWindowPainter(m_wnd, wxWindowPainter);
@@ -688,13 +688,13 @@ void wxWindowMGL::SetFocus()
{ {
if ( gs_activeFrame ) if ( gs_activeFrame )
{ {
wxActivateEvent event(wxEVT_ACTIVATE, FALSE, gs_activeFrame->GetId()); wxActivateEvent event(wxEVT_ACTIVATE, false, gs_activeFrame->GetId());
event.SetEventObject(gs_activeFrame); event.SetEventObject(gs_activeFrame);
gs_activeFrame->GetEventHandler()->ProcessEvent(event); gs_activeFrame->GetEventHandler()->ProcessEvent(event);
} }
gs_activeFrame = active; gs_activeFrame = active;
wxActivateEvent event(wxEVT_ACTIVATE, TRUE, gs_activeFrame->GetId()); wxActivateEvent event(wxEVT_ACTIVATE, true, gs_activeFrame->GetId());
event.SetEventObject(gs_activeFrame); event.SetEventObject(gs_activeFrame);
gs_activeFrame->GetEventHandler()->ProcessEvent(event); gs_activeFrame->GetEventHandler()->ProcessEvent(event);
} }
@@ -746,7 +746,7 @@ wxWindow *wxWindowBase::DoFindFocus()
bool wxWindowMGL::Show(bool show) bool wxWindowMGL::Show(bool show)
{ {
if ( !wxWindowBase::Show(show) ) if ( !wxWindowBase::Show(show) )
return FALSE; return false;
MGL_wmShowWindow(m_wnd, show); MGL_wmShowWindow(m_wnd, show);
@@ -769,7 +769,7 @@ bool wxWindowMGL::Show(bool show)
} }
} }
return TRUE; return true;
} }
// Raise the window to the top of the Z order // Raise the window to the top of the Z order
@@ -811,7 +811,7 @@ bool wxWindowMGL::SetCursor(const wxCursor& cursor)
if ( !wxWindowBase::SetCursor(cursor) ) if ( !wxWindowBase::SetCursor(cursor) )
{ {
// no change // no change
return FALSE; return false;
} }
if ( m_cursor.Ok() ) if ( m_cursor.Ok() )
@@ -819,7 +819,7 @@ bool wxWindowMGL::SetCursor(const wxCursor& cursor)
else else
MGL_wmSetWindowCursor(m_wnd, *wxSTANDARD_CURSOR->GetMGLCursor()); MGL_wmSetWindowCursor(m_wnd, *wxSTANDARD_CURSOR->GetMGLCursor());
return TRUE; return true;
} }
void wxWindowMGL::WarpPointer(int x, int y) void wxWindowMGL::WarpPointer(int x, int y)
@@ -844,11 +844,11 @@ void wxWindowMGL::WarpPointer(int x, int y)
bool wxWindowMGL::Reparent(wxWindowBase *parent) bool wxWindowMGL::Reparent(wxWindowBase *parent)
{ {
if ( !wxWindowBase::Reparent(parent) ) if ( !wxWindowBase::Reparent(parent) )
return FALSE; return false;
MGL_wmReparentWindow(m_wnd, parent->GetHandle()); MGL_wmReparentWindow(m_wnd, parent->GetHandle());
return TRUE; return true;
} }
@@ -874,7 +874,7 @@ void wxWindowMGL::SetDropTarget(wxDropTarget *pDropTarget)
// old style file-manager drag&drop support: we retain the old-style // old style file-manager drag&drop support: we retain the old-style
// DragAcceptFiles in parallel with SetDropTarget. // DragAcceptFiles in parallel with SetDropTarget.
void wxWindowMGL::DragAcceptFiles(bool accept) void wxWindowMGL::DragAcceptFiles(bool WXUNUSED(accept))
{ {
#if 0 // FIXME_MGL #if 0 // FIXME_MGL
HWND hWnd = GetHwnd(); HWND hWnd = GetHwnd();
@@ -1043,7 +1043,8 @@ void wxWindowMGL::DoSetSize(int x, int y, int width, int height, int sizeFlags)
{ {
DoMoveWindow(x, y, width, height); DoMoveWindow(x, y, width, height);
wxSizeEvent event(wxSize(width, height), GetId()); wxSize newSize(width, height);
wxSizeEvent event(newSize, GetId());
event.SetEventObject(this); event.SetEventObject(this);
GetEventHandler()->ProcessEvent(event); GetEventHandler()->ProcessEvent(event);
} }
@@ -1123,13 +1124,13 @@ void wxWindowMGL::Update()
void wxWindowMGL::Freeze() void wxWindowMGL::Freeze()
{ {
m_frozen = TRUE; m_frozen = true;
m_refreshAfterThaw = FALSE; m_refreshAfterThaw = false;
} }
void wxWindowMGL::Thaw() void wxWindowMGL::Thaw()
{ {
m_frozen = FALSE; m_frozen = false;
if ( m_refreshAfterThaw ) if ( m_refreshAfterThaw )
Refresh(); Refresh();
} }
@@ -1139,7 +1140,7 @@ void wxWindowMGL::HandlePaint(MGLDevCtx *dc)
if ( m_frozen ) if ( m_frozen )
{ {
// Don't paint anything if the window is frozen. // Don't paint anything if the window is frozen.
m_refreshAfterThaw = TRUE; m_refreshAfterThaw = true;
return; return;
} }

View File

@@ -1,7 +1,7 @@
///////////////////////////////////////////////////////////////////////////// /////////////////////////////////////////////////////////////////////////////
// Name: src/palmos/dir.cpp // Name: src/msdos/dir.cpp
// Purpose: wxDir implementation for PalmOS // Purpose: wxDir implementation for DOS
// Author: William Osborne - minimal working wxPalmOS port // Author: derived from wxPalmOS code
// Modified by: // Modified by:
// Created: 10.13.04 // Created: 10.13.04
// RCS-ID: $Id$ // RCS-ID: $Id$
@@ -63,7 +63,7 @@
// ---------------------------------------------------------------------------- // ----------------------------------------------------------------------------
/* static */ /* static */
bool wxDir::Exists(const wxString& dir) bool wxDir::Exists(const wxString& WXUNUSED(dir))
{ {
return false; return false;
} }
@@ -72,11 +72,11 @@ bool wxDir::Exists(const wxString& dir)
// wxDir construction/destruction // wxDir construction/destruction
// ---------------------------------------------------------------------------- // ----------------------------------------------------------------------------
wxDir::wxDir(const wxString& dirname) wxDir::wxDir(const wxString& WXUNUSED(dirname))
{ {
} }
bool wxDir::Open(const wxString& dirname) bool wxDir::Open(const wxString& WXUNUSED(dirname))
{ {
return false; return false;
} }
@@ -88,9 +88,7 @@ bool wxDir::IsOpened() const
wxString wxDir::GetName() const wxString wxDir::GetName() const
{ {
wxString name; return wxEmptyString;
return name;
} }
wxDir::~wxDir() wxDir::~wxDir()
@@ -101,15 +99,14 @@ wxDir::~wxDir()
// wxDir enumerating // wxDir enumerating
// ---------------------------------------------------------------------------- // ----------------------------------------------------------------------------
bool wxDir::GetFirst(wxString *filename, bool wxDir::GetFirst(wxString *WXUNUSED(filename),
const wxString& filespec, const wxString& WXUNUSED(filespec),
int flags) const int WXUNUSED(flags)) const
{ {
return false; return false;
} }
bool wxDir::GetNext(wxString *filename) const bool wxDir::GetNext(wxString *WXUNUSED(filename)) const
{ {
return false; return false;
} }

View File

@@ -1,5 +1,5 @@
///////////////////////////////////////////////////////////////////////////// /////////////////////////////////////////////////////////////////////////////
// Name: mac/mimetype.cpp // Name: src/msdos/mimetype.cpp
// Purpose: classes and functions to manage MIME types // Purpose: classes and functions to manage MIME types
// Author: Vadim Zeitlin // Author: Vadim Zeitlin
// Modified by: // Modified by:
@@ -43,25 +43,28 @@
// in case we're compiling in non-GUI mode // in case we're compiling in non-GUI mode
class WXDLLEXPORT wxIcon; class WXDLLEXPORT wxIcon;
bool wxFileTypeImpl::SetCommand(const wxString& cmd, const wxString& verb, bool overwriteprompt) bool wxFileTypeImpl::SetCommand(const wxString& WXUNUSED(cmd),
const wxString& WXUNUSED(verb),
bool WXUNUSED(overwriteprompt))
{ {
return FALSE; return false;
} }
bool wxFileTypeImpl::SetDefaultIcon(const wxString& strIcon, int index) bool wxFileTypeImpl::SetDefaultIcon(const wxString& WXUNUSED(strIcon),
int WXUNUSED(index))
{ {
return FALSE; return false;
} }
bool wxFileTypeImpl::GetCommand(wxString *command, const char *verb) const bool wxFileTypeImpl::GetCommand(wxString *WXUNUSED(command),
const char *WXUNUSED(verb)) const
{ {
return FALSE; return false;
} }
// @@ this function is half implemented bool wxFileTypeImpl::GetExtensions(wxArrayString& WXUNUSED(extensions))
bool wxFileTypeImpl::GetExtensions(wxArrayString& extensions)
{ {
return FALSE; return false;
} }
bool wxFileTypeImpl::GetMimeType(wxString *mimeType) const bool wxFileTypeImpl::GetMimeType(wxString *mimeType) const
@@ -69,10 +72,10 @@ bool wxFileTypeImpl::GetMimeType(wxString *mimeType) const
if ( m_strFileType.Length() > 0 ) if ( m_strFileType.Length() > 0 )
{ {
*mimeType = m_strFileType ; *mimeType = m_strFileType ;
return TRUE ; return true ;
} }
else else
return FALSE; return false;
} }
bool wxFileTypeImpl::GetMimeTypes(wxArrayString& mimeTypes) const bool wxFileTypeImpl::GetMimeTypes(wxArrayString& mimeTypes) const
@@ -83,33 +86,35 @@ bool wxFileTypeImpl::GetMimeTypes(wxArrayString& mimeTypes) const
{ {
mimeTypes.Clear(); mimeTypes.Clear();
mimeTypes.Add(s); mimeTypes.Add(s);
return TRUE; return true;
} }
else else
return FALSE; return false;
} }
bool wxFileTypeImpl::GetIcon(wxIconLocation *WXUNUSED(icon)) const bool wxFileTypeImpl::GetIcon(wxIconLocation *WXUNUSED(icon)) const
{ {
// no such file type or no value or incorrect icon entry // no such file type or no value or incorrect icon entry
return FALSE; return false;
} }
bool wxFileTypeImpl::GetDescription(wxString *desc) const bool wxFileTypeImpl::GetDescription(wxString *WXUNUSED(desc)) const
{ {
return FALSE; return false;
} }
size_t size_t
wxFileTypeImpl::GetAllCommands(wxArrayString * verbs, wxArrayString * commands, wxFileTypeImpl::GetAllCommands(wxArrayString * WXUNUSED(verbs),
const wxFileType::MessageParameters& params) const wxArrayString * WXUNUSED(commands),
const wxFileType::MessageParameters& WXUNUSED(params)) const
{ {
wxFAIL_MSG( _T("wxFileTypeImpl::GetAllCommands() not yet implemented") ); wxFAIL_MSG( _T("wxFileTypeImpl::GetAllCommands() not yet implemented") );
return 0; return 0;
} }
void void
wxMimeTypesManagerImpl::Initialize(int mailcapStyles, const wxString& extraDir) wxMimeTypesManagerImpl::Initialize(int WXUNUSED(mailcapStyles),
const wxString& WXUNUSED(extraDir))
{ {
wxFAIL_MSG( _T("wxMimeTypesManagerImpl::Initialize() not yet implemented") ); wxFAIL_MSG( _T("wxMimeTypesManagerImpl::Initialize() not yet implemented") );
} }
@@ -196,12 +201,12 @@ wxMimeTypesManagerImpl::GetFileTypeFromExtension(const wxString& e)
// MIME type -> extension -> file type // MIME type -> extension -> file type
wxFileType * wxFileType *
wxMimeTypesManagerImpl::GetFileTypeFromMimeType(const wxString& mimeType) wxMimeTypesManagerImpl::GetFileTypeFromMimeType(const wxString& WXUNUSED(mimeType))
{ {
return NULL; return NULL;
} }
size_t wxMimeTypesManagerImpl::EnumAllFileTypes(wxArrayString& mimetypes) size_t wxMimeTypesManagerImpl::EnumAllFileTypes(wxArrayString& WXUNUSED(mimetypes))
{ {
// VZ: don't know anything about this for Mac // VZ: don't know anything about this for Mac
wxFAIL_MSG( _T("wxMimeTypesManagerImpl::EnumAllFileTypes() not yet implemented") ); wxFAIL_MSG( _T("wxMimeTypesManagerImpl::EnumAllFileTypes() not yet implemented") );
@@ -210,7 +215,7 @@ size_t wxMimeTypesManagerImpl::EnumAllFileTypes(wxArrayString& mimetypes)
} }
wxFileType * wxFileType *
wxMimeTypesManagerImpl::Associate(const wxFileTypeInfo& ftInfo) wxMimeTypesManagerImpl::Associate(const wxFileTypeInfo& WXUNUSED(ftInfo))
{ {
wxFAIL_MSG( _T("wxMimeTypesManagerImpl::Associate() not yet implemented") ); wxFAIL_MSG( _T("wxMimeTypesManagerImpl::Associate() not yet implemented") );
@@ -218,9 +223,9 @@ wxMimeTypesManagerImpl::Associate(const wxFileTypeInfo& ftInfo)
} }
bool bool
wxMimeTypesManagerImpl::Unassociate(wxFileType *ft) wxMimeTypesManagerImpl::Unassociate(wxFileType *WXUNUSED(ft))
{ {
return FALSE; return false;
} }
#endif // wxUSE_MIMETYPE #endif // wxUSE_MIMETYPE