Upgrade WX to r74856, mainly to support @2x.

This commit is contained in:
comex
2013-09-22 18:44:55 -04:00
parent 0bdef3932f
commit 66ed9a1804
1935 changed files with 45373 additions and 22739 deletions

View File

@ -4,7 +4,6 @@
// Author: Julian Smart
// Modified by:
// Created: 31/7/98
// RCS-ID: $Id: accel.h 52834 2008-03-26 15:06:00Z FM $
// Copyright: (c) Julian Smart
// Licence: wxWindows licence
/////////////////////////////////////////////////////////////////////////////

View File

@ -3,7 +3,6 @@
// Purpose: wxAnyButton class
// Author: Julian Smart
// Created: 1997-02-01 (extracted from button.h)
// RCS-ID: $Id: anybutton.h 67931 2011-06-14 13:00:42Z VZ $
// Copyright: (c) Julian Smart
// Licence: wxWindows licence
/////////////////////////////////////////////////////////////////////////////

View File

@ -4,7 +4,6 @@
// Author: Julian Smart
// Modified by:
// Created: 01/02/97
// RCS-ID: $Id: app.h 67254 2011-03-20 00:14:35Z DS $
// Copyright: (c) Julian Smart
// Licence: wxWindows licence
/////////////////////////////////////////////////////////////////////////////
@ -126,81 +125,5 @@ inline int wxApp::GetShell32Version()
#endif // __WXWINCE__
// ----------------------------------------------------------------------------
// MSW-specific wxEntry() overload and wxIMPLEMENT_WXWIN_MAIN definition
// ----------------------------------------------------------------------------
// we need HINSTANCE declaration to define WinMain()
#include "wx/msw/wrapwin.h"
#ifndef SW_SHOWNORMAL
#define SW_SHOWNORMAL 1
#endif
// WinMain() is always ANSI, even in Unicode build, under normal Windows
// but is always Unicode under CE
#ifdef __WXWINCE__
typedef wchar_t *wxCmdLineArgType;
#else
typedef char *wxCmdLineArgType;
#endif
// wxMSW-only overloads of wxEntry() and wxEntryStart() which take the
// parameters passed to WinMain() instead of those passed to main()
extern WXDLLIMPEXP_CORE bool
wxEntryStart(HINSTANCE hInstance,
HINSTANCE hPrevInstance = NULL,
wxCmdLineArgType pCmdLine = NULL,
int nCmdShow = SW_SHOWNORMAL);
extern WXDLLIMPEXP_CORE int
wxEntry(HINSTANCE hInstance,
HINSTANCE hPrevInstance = NULL,
wxCmdLineArgType pCmdLine = NULL,
int nCmdShow = SW_SHOWNORMAL);
#if defined(__BORLANDC__) && wxUSE_UNICODE
// Borland C++ has the following nonstandard behaviour: when the -WU
// command line flag is used, the linker expects to find wWinMain instead
// of WinMain. This flag causes the compiler to define _UNICODE and
// UNICODE symbols and there's no way to detect its use, so we have to
// define both WinMain and wWinMain so that wxIMPLEMENT_WXWIN_MAIN works
// for both code compiled with and without -WU.
// See http://sourceforge.net/tracker/?func=detail&atid=309863&aid=1935997&group_id=9863
// for more details.
#define wxIMPLEMENT_WXWIN_MAIN_BORLAND_NONSTANDARD \
extern "C" int WINAPI wWinMain(HINSTANCE hInstance, \
HINSTANCE hPrevInstance, \
wchar_t * WXUNUSED(lpCmdLine), \
int nCmdShow) \
{ \
wxDISABLE_DEBUG_SUPPORT(); \
\
/* NB: wxEntry expects lpCmdLine argument to be char*, not */ \
/* wchar_t*, but fortunately it's not used anywhere */ \
/* and we can simply pass NULL in: */ \
return wxEntry(hInstance, hPrevInstance, NULL, nCmdShow); \
}
#else
#define wxIMPLEMENT_WXWIN_MAIN_BORLAND_NONSTANDARD
#endif // defined(__BORLANDC__) && wxUSE_UNICODE
#define wxIMPLEMENT_WXWIN_MAIN \
extern "C" int WINAPI WinMain(HINSTANCE hInstance, \
HINSTANCE hPrevInstance, \
wxCmdLineArgType WXUNUSED(lpCmdLine), \
int nCmdShow) \
{ \
wxDISABLE_DEBUG_SUPPORT(); \
\
/* NB: We pass NULL in place of lpCmdLine to behave the same as */ \
/* Borland-specific wWinMain() above. If it becomes needed */ \
/* to pass lpCmdLine to wxEntry() here, you'll have to fix */ \
/* wWinMain() above too. */ \
return wxEntry(hInstance, hPrevInstance, NULL, nCmdShow); \
} \
wxIMPLEMENT_WXWIN_MAIN_BORLAND_NONSTANDARD
#endif // _WX_APP_H_

View File

@ -4,7 +4,6 @@
// Author: Vadim Zeitlin
// Modified by:
// Created: 22.06.2003
// RCS-ID: $Id: apptbase.h 67288 2011-03-22 17:15:56Z VZ $
// Copyright: (c) 2003 Vadim Zeitlin <vadim@wxwidgets.org>
// Licence: wxWindows licence
///////////////////////////////////////////////////////////////////////////////

View File

@ -4,7 +4,6 @@
// Author: Vadim Zeitlin
// Modified by:
// Created: 21.06.2003
// RCS-ID: $Id: apptrait.h 67288 2011-03-22 17:15:56Z VZ $
// Copyright: (c) 2003 Vadim Zeitlin <vadim@wxwidgets.org>
// Licence: wxWindows licence
///////////////////////////////////////////////////////////////////////////////
@ -37,6 +36,8 @@ public:
#if wxUSE_GUI
#if defined(__WXMSW__)
class WXDLLIMPEXP_CORE wxGUIAppTraits : public wxGUIAppTraitsBase
{
public:
@ -58,6 +59,38 @@ public:
#endif // !__WXWINCE__
};
#elif defined(__WXGTK__)
class WXDLLIMPEXP_CORE wxGUIAppTraits : public wxGUIAppTraitsBase
{
public:
virtual wxEventLoopBase *CreateEventLoop();
virtual void *BeforeChildWaitLoop() { return NULL; }
virtual void AfterChildWaitLoop(void *WXUNUSED(data)) { }
#if wxUSE_TIMER
virtual wxTimerImpl *CreateTimerImpl(wxTimer *timer);
#endif
#if wxUSE_THREADS && defined(__WXGTK20__)
virtual void MutexGuiEnter();
virtual void MutexGuiLeave();
#endif
#if wxUSE_THREADS
virtual bool DoMessageFromThreadWait() { return true; }
virtual WXDWORD WaitForThread(WXHANDLE hThread, int WXUNUSED(flags))
{ return DoSimpleWaitForThread(hThread); }
#endif // wxUSE_THREADS
virtual wxPortId GetToolkitVersion(int *majVer = NULL, int *minVer = NULL) const;
#ifndef __WXWINCE__
virtual bool CanUseStderr() { return false; }
virtual bool WriteToStderr(const wxString& WXUNUSED(text)) { return false; }
#endif // !__WXWINCE__
};
#endif
#endif // wxUSE_GUI
#endif // _WX_MSW_APPTRAIT_H_

View File

@ -4,7 +4,6 @@
// Author: Julian Smart
// Modified by:
// Created: 01/02/97
// RCS-ID: $Id: bitmap.h 66086 2010-11-10 13:51:51Z VZ $
// Copyright: (c) Julian Smart
// Licence: wxWindows licence
/////////////////////////////////////////////////////////////////////////////
@ -13,6 +12,7 @@
#define _WX_BITMAP_H_
#include "wx/msw/gdiimage.h"
#include "wx/math.h"
#include "wx/palette.h"
class WXDLLIMPEXP_FWD_CORE wxBitmap;
@ -43,7 +43,8 @@ enum wxBitmapTransparency
// NOTE: for wxMSW we don't use the wxBitmapBase base class declared in bitmap.h!
// ----------------------------------------------------------------------------
class WXDLLIMPEXP_CORE wxBitmap : public wxGDIImage
class WXDLLIMPEXP_CORE wxBitmap : public wxGDIImage,
public wxBitmapHelpers
{
public:
// default ctor creates an invalid bitmap, you must Create() it later
@ -143,6 +144,9 @@ public:
virtual bool Create(int width, int height, const wxDC& dc);
virtual bool Create(const void* data, wxBitmapType type, int width, int height, int depth = 1);
virtual bool CreateScaled(int w, int h, int d, double logicalScale)
{ return Create(wxRound(w*logicalScale), wxRound(h*logicalScale), d); }
virtual bool LoadFile(const wxString& name, wxBitmapType type = wxBITMAP_DEFAULT_TYPE);
virtual bool SaveFile(const wxString& name, wxBitmapType type, const wxPalette *cmap = NULL) const;
@ -159,7 +163,6 @@ public:
#endif // wxUSE_PALETTE
wxMask *GetMask() const;
wxBitmap GetMaskBitmap() const;
void SetMask(wxMask *mask);
// these functions are internal and shouldn't be used, they risk to
@ -167,6 +170,13 @@ public:
bool HasAlpha() const;
void UseAlpha();
// support for scaled bitmaps
virtual double GetScaleFactor() const { return 1.0; }
virtual double GetScaledWidth() const { return GetWidth() / GetScaleFactor(); }
virtual double GetScaledHeight() const { return GetHeight() / GetScaleFactor(); }
virtual wxSize GetScaledSize() const
{ return wxSize(wxRound(GetScaledWidth()), wxRound(GetScaledHeight())); }
// implementation only from now on
// -------------------------------
@ -237,6 +247,8 @@ public:
bool Create(const wxBitmap& bitmap, int paletteIndex);
bool Create(const wxBitmap& bitmap);
wxBitmap GetBitmap() const;
// Implementation
WXHBITMAP GetMaskBitmap() const { return m_maskBitmap; }
void SetMaskBitmap(WXHBITMAP bmp) { m_maskBitmap = bmp; }

View File

@ -4,7 +4,6 @@
// Author: Julian Smart
// Modified by:
// Created: 01/02/97
// RCS-ID: $Id: bmpbuttn.h 67931 2011-06-14 13:00:42Z VZ $
// Copyright: (c) Julian Smart
// Licence: wxWindows licence
/////////////////////////////////////////////////////////////////////////////

View File

@ -3,7 +3,6 @@
// Purpose: wxBitmapComboBox
// Author: Jaakko Salli
// Created: 2008-04-06
// RCS-ID: $Id: bmpcbox.h 65091 2010-07-25 07:39:17Z JMS $
// Copyright: (c) 2008 Jaakko Salli
// Licence: wxWindows licence
/////////////////////////////////////////////////////////////////////////////

View File

@ -4,7 +4,6 @@
// Author: Julian Smart
// Modified by:
// Created: 01/02/97
// RCS-ID: $Id: brush.h 54273 2008-06-17 17:28:26Z VZ $
// Copyright: (c) Julian Smart
// Licence: wxWindows licence
/////////////////////////////////////////////////////////////////////////////

View File

@ -4,7 +4,6 @@
// Author: Julian Smart
// Modified by:
// Created: 01/02/97
// RCS-ID: $Id: button.h 69984 2011-12-11 17:03:56Z VZ $
// Copyright: (c) Julian Smart
// Licence: wxWindows licence
/////////////////////////////////////////////////////////////////////////////

View File

@ -2,7 +2,6 @@
// Name: wx/msw/calctrl.h
// Purpose: wxCalendarCtrl control implementation for MSW
// Author: Vadim Zeitlin
// RCS-ID: $Id: calctrl.h 58757 2009-02-08 11:45:59Z VZ $
// Copyright: (C) 2008 Vadim Zeitlin <vadim@wxwidgets.org>
// Licence: wxWindows licence
/////////////////////////////////////////////////////////////////////////////

View File

@ -4,7 +4,6 @@
// Author: Vadim Zeitlin
// Modified by:
// Created: 23.05.99
// RCS-ID: $Id: caret.h 67254 2011-03-20 00:14:35Z DS $
// Copyright: (c) wxWidgets team
// Licence: wxWindows licence
///////////////////////////////////////////////////////////////////////////////

View File

@ -4,7 +4,6 @@
// Author: Julian Smart
// Modified by:
// Created: 01/02/97
// RCS-ID: $Id: checkbox.h 54008 2008-06-07 01:54:44Z VZ $
// Copyright: (c) Julian Smart
// Licence: wxWindows licence
/////////////////////////////////////////////////////////////////////////////
@ -52,15 +51,18 @@ public:
// returns true if the platform should explicitly apply a theme border
virtual bool CanApplyThemeBorder() const { return false; }
// make the checkbox owner drawn or reset it to normal style
void MSWMakeOwnerDrawn(bool ownerDrawn);
// implementation only from now on
virtual WXDWORD MSWGetStyle(long flags, WXDWORD *exstyle = NULL) const;
protected:
virtual wxSize DoGetBestSize() const;
virtual wxSize DoGetBestClientSize() const;
virtual void DoSet3StateValue(wxCheckBoxState value);
virtual wxCheckBoxState DoGet3StateValue() const;
// make the checkbox owner drawn or reset it to normal style
void MakeOwnerDrawn(bool ownerDrawn);
// return true if this checkbox is owner drawn
bool IsOwnerDrawn() const;

View File

@ -4,7 +4,6 @@
// Author: Vadim Zeitlin
// Modified by:
// Created: 16.11.97
// RCS-ID: $Id: checklst.h 63226 2010-01-23 13:22:00Z VZ $
// Copyright: (c) 1998 Vadim Zeitlin <zeitlin@dptmaths.ens-cachan.fr>
// Licence: wxWindows licence
///////////////////////////////////////////////////////////////////////////////
@ -73,7 +72,7 @@ protected:
// send an "item checked" event
void SendEvent(unsigned int uiIndex)
{
wxCommandEvent event(wxEVT_COMMAND_CHECKLISTBOX_TOGGLED, GetId());
wxCommandEvent event(wxEVT_CHECKLISTBOX, GetId());
event.SetInt(uiIndex);
event.SetEventObject(this);
event.SetString(GetString(uiIndex));

View File

@ -4,7 +4,6 @@
* Author: Julian Smart
* Modified by:
* Created: 01/02/97
* RCS-ID: $Id: chkconf.h 69845 2011-11-27 19:52:13Z VZ $
* Copyright: (c) Julian Smart
* Licence: wxWindows licence
*/
@ -155,12 +154,6 @@
# define wxUSE_STACKWALKER 0
#endif /* compiler doesn't support SEH */
/* wxUSE_DEBUG_NEW_ALWAYS doesn't work with CodeWarrior */
#if defined(__MWERKS__)
# undef wxUSE_DEBUG_NEW_ALWAYS
# define wxUSE_DEBUG_NEW_ALWAYS 0
#endif
#if defined(__GNUWIN32__)
/* These don't work as expected for mingw32 and cygwin32 */
# undef wxUSE_MEMORY_TRACING

View File

@ -4,7 +4,6 @@
// Author: Julian Smart
// Modified by: Vadim Zeitlin to derive from wxChoiceBase
// Created: 01/02/97
// RCS-ID: $Id: choice.h 62960 2009-12-21 15:20:37Z JMS $
// Copyright: (c) Julian Smart
// Licence: wxWindows licence
/////////////////////////////////////////////////////////////////////////////
@ -12,6 +11,8 @@
#ifndef _WX_CHOICE_H_
#define _WX_CHOICE_H_
struct tagCOMBOBOXINFO;
// ----------------------------------------------------------------------------
// Choice item
// ----------------------------------------------------------------------------
@ -66,6 +67,8 @@ public:
const wxValidator& validator = wxDefaultValidator,
const wxString& name = wxChoiceNameStr);
virtual bool Show(bool show = true);
virtual void SetLabel(const wxString& label);
virtual unsigned int GetCount() const;
@ -102,7 +105,8 @@ protected:
// common part of all ctors
void Init()
{
m_lastAcceptedSelection = wxID_NONE;
m_lastAcceptedSelection =
m_pendingSelection = wxID_NONE;
m_heightOwn = wxDefaultCoord;
}
@ -123,6 +127,10 @@ protected:
virtual void DoSetSize(int x, int y,
int width, int height,
int sizeFlags = wxSIZE_AUTO);
virtual wxSize DoGetSizeFromTextSize(int xlen, int ylen = -1) const;
// Show or hide the popup part of the control.
void MSWDoPopupOrDismiss(bool show);
// update the height of the drop down list to fit the number of items we
// have (without changing the visible height)
@ -131,6 +139,10 @@ protected:
// set the height of the visible part of the control to m_heightOwn
void MSWUpdateVisibleHeight();
// Call GetComboBoxInfo() and return false if it's not supported by this
// system. Notice that the caller must initialize info.cbSize.
bool MSWGetComboBoxInfo(tagCOMBOBOXINFO* info) const;
// create and initialize the control
bool CreateAndInit(wxWindow *parent, wxWindowID id,
const wxPoint& pos,
@ -150,10 +162,13 @@ protected:
virtual void MSWEndDeferWindowPos();
#endif // wxUSE_DEFERRED_SIZING
// last "completed" selection, i.e. not the transient one while the user is
// browsing the popup list: this is only used when != wxID_NONE which is
// the case while the drop down is opened
int m_lastAcceptedSelection;
// These variables are only used while the drop down is opened.
//
// The first one contains the item that had been originally selected before
// the drop down was opened and the second one the item we should select
// when the drop down is closed again.
int m_lastAcceptedSelection,
m_pendingSelection;
// the height of the control itself if it was set explicitly or
// wxDefaultCoord if it hadn't

View File

@ -4,7 +4,6 @@
// Author: Julian Smart
// Modified by:
// Created: 01/02/97
// RCS-ID: $Id: clipbrd.h 61485 2009-07-20 23:54:08Z VZ $
// Copyright: (c) Julian Smart
// Licence: wxWindows licence
/////////////////////////////////////////////////////////////////////////////

View File

@ -4,7 +4,6 @@
// Author: Julian Smart
// Modified by:
// Created: 01/02/97
// RCS-ID: $Id: colordlg.h 66615 2011-01-07 05:26:57Z PC $
// Copyright: (c) Julian Smart
// Licence: wxWindows licence
/////////////////////////////////////////////////////////////////////////////

View File

@ -4,7 +4,6 @@
// Author: Julian Smart
// Modified by:
// Created: 01/02/97
// RCS-ID: $Id: colour.h 52834 2008-03-26 15:06:00Z FM $
// Copyright: (c) Julian Smart
// Licence: wxWindows licence
/////////////////////////////////////////////////////////////////////////////

View File

@ -4,7 +4,6 @@
// Author: Jaakko Salli
// Modified by:
// Created: Apr-30-2006
// RCS-ID: $Id: combo.h 67276 2011-03-22 09:56:40Z JMS $
// Copyright: (c) Jaakko Salli
// Licence: wxWindows licence
/////////////////////////////////////////////////////////////////////////////

View File

@ -4,7 +4,6 @@
// Author: Julian Smart
// Modified by:
// Created: 01/02/97
// RCS-ID: $Id: combobox.h 68808 2011-08-21 12:06:16Z VZ $
// Copyright: (c) Julian Smart
// Licence: wxWindows licence
/////////////////////////////////////////////////////////////////////////////
@ -92,6 +91,7 @@ public:
virtual void SetSelection(long from, long to)
{ wxTextEntry::SetSelection(from, to); }
virtual int GetSelection() const { return wxChoice::GetSelection(); }
virtual bool ContainsHWND(WXHWND hWnd) const;
virtual void GetSelection(long *from, long *to) const;
virtual bool IsEditable() const;
@ -130,7 +130,8 @@ protected:
#if wxUSE_TOOLTIPS
virtual void DoSetToolTip(wxToolTip *tip);
#endif
void MSWDoPopupOrDismiss(bool show);
virtual wxSize DoGetSizeFromTextSize(int xlen, int ylen = -1) const;
// this is the implementation of GetEditHWND() which can also be used when
// we don't have the edit control, it simply returns NULL then

View File

@ -3,7 +3,6 @@
// Purpose: wxCommandLinkButton class
// Author: Rickard Westerlund
// Created: 2010-06-11
// RCS-ID: $Id: commandlinkbutton.h 65327 2010-08-17 14:48:50Z VZ $
// Copyright: (c) 2010 wxWidgets team
// Licence: wxWindows licence
/////////////////////////////////////////////////////////////////////////////

View File

@ -4,7 +4,6 @@
// Author: Julian Smart
// Modified by:
// Created: 01/02/97
// RCS-ID: $Id: control.h 62151 2009-09-26 16:43:06Z VZ $
// Copyright: (c) Julian Smart
// Licence: wxWindows licence
/////////////////////////////////////////////////////////////////////////////

View File

@ -4,7 +4,6 @@
// Author: Vadim Zeitlin
// Modified by:
// Created: 13.07.2003
// RCS-ID: $Id: crashrpt.h 53816 2008-05-29 13:28:05Z VZ $
// Copyright: (c) 2003 Vadim Zeitlin <vadim@wxwidgets.org>
// Licence: wxWindows licence
///////////////////////////////////////////////////////////////////////////////

View File

@ -3,7 +3,6 @@
// Purpose: common functionality of wxItemContainer-derived controls
// Author: Vadim Zeitlin
// Created: 2007-07-25
// RCS-ID: $Id: ctrlsub.h 58757 2009-02-08 11:45:59Z VZ $
// Copyright: (c) 2007 Vadim Zeitlin <vadim@wxwindows.org>
// Licence: wxWindows licence
///////////////////////////////////////////////////////////////////////////////

View File

@ -4,7 +4,6 @@
// Author: Julian Smart
// Modified by:
// Created: 01/02/97
// RCS-ID: $Id: cursor.h 55884 2008-09-25 17:56:07Z FM $
// Copyright: (c) Julian Smart
// Licence: wxWindows licence
/////////////////////////////////////////////////////////////////////////////

View File

@ -3,7 +3,6 @@
// Purpose: wxMSW implementation of wxCustomBackgroundWindow
// Author: Vadim Zeitlin
// Created: 2011-10-10
// RCS-ID: $Id: custombgwin.h 69378 2011-10-11 17:07:43Z VZ $
// Copyright: (c) 2011 Vadim Zeitlin <vadim@wxwidgets.org>
// Licence: wxWindows licence
///////////////////////////////////////////////////////////////////////////////

View File

@ -4,7 +4,6 @@
// Author: Vadim Zeitlin
// Modified by:
// Created: 2005-01-09
// RCS-ID: $Id: datectrl.h 69222 2011-09-29 13:43:02Z VZ $
// Copyright: (c) 2005 Vadim Zeitlin <vadim@wxwindows.org>
// Licence: wxWindows licence
///////////////////////////////////////////////////////////////////////////////

View File

@ -3,7 +3,6 @@
// Purpose: wxDateTimePickerCtrl for Windows.
// Author: Vadim Zeitlin
// Created: 2011-09-22 (extracted from wx/msw/datectrl.h).
// RCS-ID: $Id: datetimectrl.h 69489 2011-10-20 16:45:48Z VZ $
// Copyright: (c) 2005-2011 Vadim Zeitlin <vadim@wxwindows.org>
// Licence: wxWindows licence
///////////////////////////////////////////////////////////////////////////////

View File

@ -4,7 +4,6 @@
// Author: Julian Smart
// Modified by:
// Created: 01/02/97
// RCS-ID: $Id: dc.h 67588 2011-04-23 16:03:10Z VZ $
// Copyright: (c) Julian Smart
// Licence: wxWindows licence
/////////////////////////////////////////////////////////////////////////////
@ -126,6 +125,8 @@ public:
m_clipX2 = 0;
}
void* GetHandle() const { return (void*)GetHDC(); }
const wxBitmap& GetSelectedBitmap() const { return m_selectedBitmap; }
wxBitmap& GetSelectedBitmap() { return m_selectedBitmap; }
@ -247,12 +248,12 @@ public:
virtual void DoGetSizeMM(int* width, int* height) const;
virtual void DoDrawLines(int n, wxPoint points[],
virtual void DoDrawLines(int n, const wxPoint points[],
wxCoord xoffset, wxCoord yoffset);
virtual void DoDrawPolygon(int n, wxPoint points[],
virtual void DoDrawPolygon(int n, const wxPoint points[],
wxCoord xoffset, wxCoord yoffset,
wxPolygonFillMode fillStyle = wxODDEVEN_RULE);
virtual void DoDrawPolyPolygon(int n, int count[], wxPoint points[],
virtual void DoDrawPolyPolygon(int n, const int count[], const wxPoint points[],
wxCoord xoffset, wxCoord yoffset,
wxPolygonFillMode fillStyle = wxODDEVEN_RULE);
virtual wxBitmap DoGetAsBitmap(const wxRect *subrect) const

View File

@ -4,7 +4,6 @@
// Author: Julian Smart
// Modified by:
// Created: 01/02/97
// RCS-ID: $Id: dcclient.h 67254 2011-03-20 00:14:35Z DS $
// Copyright: (c) Julian Smart
// Licence: wxWindows licence
/////////////////////////////////////////////////////////////////////////////
@ -19,16 +18,8 @@
#include "wx/dc.h"
#include "wx/msw/dc.h"
#include "wx/dcclient.h"
#include "wx/dynarray.h"
// ----------------------------------------------------------------------------
// array types
// ----------------------------------------------------------------------------
// this one if used by wxPaintDC only
struct WXDLLIMPEXP_FWD_CORE wxPaintDCInfo;
WX_DECLARE_EXPORTED_OBJARRAY(wxPaintDCInfo, wxArrayDCInfo);
class wxPaintDCInfo;
// ----------------------------------------------------------------------------
// DC classes
@ -86,11 +77,13 @@ public:
// find the entry for this DC in the cache (keyed by the window)
static WXHDC FindDCInCache(wxWindow* win);
protected:
static wxArrayDCInfo ms_cache;
// This must be called by the code handling WM_PAINT to remove the DC
// cached for this window for the duration of this message processing.
static void EndPaint(wxWindow *win);
// find the entry for this DC in the cache (keyed by the window)
wxPaintDCInfo *FindInCache(size_t *index = NULL) const;
protected:
// Find the DC for this window in the cache, return NULL if not found.
static wxPaintDCInfo *FindInCache(wxWindow* win);
DECLARE_CLASS(wxPaintDCImpl)
wxDECLARE_NO_COPY_CLASS(wxPaintDCImpl);

View File

@ -4,7 +4,6 @@
// Author: Julian Smart
// Modified by:
// Created: 01/02/97
// RCS-ID: $Id: dcmemory.h 61724 2009-08-21 10:41:26Z VZ $
// Copyright: (c) Julian Smart
// Licence: wxWindows licence
/////////////////////////////////////////////////////////////////////////////

View File

@ -4,7 +4,6 @@
// Author: Julian Smart
// Modified by:
// Created: 01/02/97
// RCS-ID: $Id: dcprint.h 58757 2009-02-08 11:45:59Z VZ $
// Copyright: (c) Julian Smart
// Licence: wxWindows licence
/////////////////////////////////////////////////////////////////////////////

View File

@ -4,7 +4,6 @@
// Author: Julian Smart
// Modified by:
// Created: 01/02/97
// RCS-ID: $Id: dcscreen.h 58757 2009-02-08 11:45:59Z VZ $
// Copyright: (c) Julian Smart
// Licence: wxWindows licence
/////////////////////////////////////////////////////////////////////////////

View File

@ -4,7 +4,6 @@
// Author: Julian Smart
// Modified by:
// Created: 01/02/97
// RCS-ID: $Id: dde.h 67254 2011-03-20 00:14:35Z DS $
// Copyright: (c) Julian Smart
// Licence: wxWindows licence
/////////////////////////////////////////////////////////////////////////////

View File

@ -4,7 +4,6 @@
// Author: Vadim Zeitlin
// Modified by:
// Created: 2005-01-08 (extracted from msw/crashrpt.cpp)
// RCS-ID: $Id: debughlp.h 69845 2011-11-27 19:52:13Z VZ $
// Copyright: (c) 2003-2005 Vadim Zeitlin <vadim@wxwindows.org>
// Licence: wxWindows licence
///////////////////////////////////////////////////////////////////////////////
@ -20,18 +19,21 @@
#endif // __WXWINCE__
#include "wx/msw/private.h"
// we need to determine whether we have the declarations for the function in
// debughlp.dll version 5.81 (at least) and we check for DBHLPAPI to test this
//
// reasons:
// - VC6 version of imagehlp.h doesn't define it
// - VC7 one does
// - testing for compiler version doesn't work as you can install and use
// the new SDK headers with VC6
//
// in any case, the user may override by defining wxUSE_DBGHELP himself
// All known versions of imagehlp.h define API_VERSION_NUMBER but it's not
// documented, so deal with the possibility that it's not defined just in case.
#ifndef API_VERSION_NUMBER
#define API_VERSION_NUMBER 0
#endif
// wxUSE_DBGHELP is a bit special as it is not defined in wx/setup.h and we try
// to auto-detect whether we should be using debug help API or not ourselves
// below. However if the auto-detection fails, you can always predefine it as 0
// to avoid even trying.
#ifndef wxUSE_DBGHELP
#ifdef DBHLPAPI
// The version of imagehlp.h from VC6 (7) is too old and is missing some
// required symbols while the version from VC7 (9) is good enough. As we
// don't know anything about version 8, don't use it unless we can test it.
#if API_VERSION_NUMBER >= 9
#define wxUSE_DBGHELP 1
#else
#define wxUSE_DBGHELP 0

View File

@ -4,7 +4,6 @@
// Author: Julian Smart
// Modified by:
// Created: 01/02/97
// RCS-ID: $Id: dialog.h 70511 2012-02-05 14:18:22Z VZ $
// Copyright: (c) Julian Smart
// Licence: wxWindows licence
/////////////////////////////////////////////////////////////////////////////

View File

@ -4,7 +4,6 @@
// Author: Vadim Zeitlin
// Modified by:
// Created: 03.03.03 (replaces the old file with the same name)
// RCS-ID: $Id: dib.h 65959 2010-10-30 23:50:50Z VZ $
// Copyright: (c) 1997-2003 wxWidgets team
// Licence: wxWindows licence
/////////////////////////////////////////////////////////////////////////////
@ -12,13 +11,16 @@
#ifndef _WX_MSW_DIB_H_
#define _WX_MSW_DIB_H_
class WXDLLIMPEXP_FWD_CORE wxBitmap;
class WXDLLIMPEXP_FWD_CORE wxPalette;
#include "wx/msw/private.h"
#if wxUSE_WXDIB
#ifdef __WXMSW__
#include "wx/bitmap.h"
#endif // __WXMSW__
// ----------------------------------------------------------------------------
// wxDIB: represents a DIB section
// ----------------------------------------------------------------------------
@ -37,9 +39,11 @@ public:
wxDIB(int width, int height, int depth)
{ Init(); (void)Create(width, height, depth); }
#ifdef __WXMSW__
// create a DIB from the DDB
wxDIB(const wxBitmap& bmp)
{ Init(); (void)Create(bmp); }
#endif // __WXMSW__
// create a DIB from the Windows DDB
wxDIB(HBITMAP hbmp)
@ -53,7 +57,9 @@ public:
// same as the corresponding ctors but with return value
bool Create(int width, int height, int depth);
#ifdef __WXMSW__
bool Create(const wxBitmap& bmp) { return Create(GetHbitmapOf(bmp)); }
#endif
bool Create(HBITMAP hbmp);
bool Load(const wxString& filename);

View File

@ -4,7 +4,6 @@
// Author: Julian Smart
// Modified by:
// Created: 01/02/97
// RCS-ID: $Id: dirdlg.h 52834 2008-03-26 15:06:00Z FM $
// Copyright: (c) Julian Smart
// Licence: wxWindows licence
/////////////////////////////////////////////////////////////////////////////
@ -28,6 +27,11 @@ public:
virtual int ShowModal();
private:
// The real implementations of ShowModal(), used for Windows versions
// before and since Vista.
int ShowSHBrowseForFolder(WXHWND owner);
int ShowIFileDialog(WXHWND owner);
DECLARE_DYNAMIC_CLASS_NO_COPY(wxDirDialog)
};

View File

@ -5,7 +5,6 @@
// Author: Julian Smart
// Modified by:
// Created: 08/04/99
// RCS-ID: $Id: dragimag.h 70584 2012-02-15 00:35:25Z VZ $
// Copyright: (c) Julian Smart
// Licence: wxWindows licence
/////////////////////////////////////////////////////////////////////////////

View File

@ -4,7 +4,6 @@
// Author: Vadim Zeitlin
// Modified by:
// Created: 13.01.00
// RCS-ID: $Id: enhmeta.h 68317 2011-07-21 13:49:59Z VZ $
// Copyright: (c) 2000 Vadim Zeitlin <zeitlin@dptmaths.ens-cachan.fr>
// Licence: wxWindows licence
///////////////////////////////////////////////////////////////////////////////

View File

@ -1,10 +1,9 @@
///////////////////////////////////////////////////////////////////////////////
// Name: wx/msw/evtloop.h
// Purpose: wxEventLoop class for MSW
// Purpose: wxEventLoop class for wxMSW port
// Author: Vadim Zeitlin
// Modified by:
// Created: 2004-07-31
// RCS-ID: $Id: evtloop.h 59161 2009-02-26 14:15:20Z VZ $
// Copyright: (c) 2003-2004 Vadim Zeitlin <vadim@wxwindows.org>
// Licence: wxWindows licence
///////////////////////////////////////////////////////////////////////////////
@ -12,36 +11,15 @@
#ifndef _WX_MSW_EVTLOOP_H_
#define _WX_MSW_EVTLOOP_H_
#if wxUSE_GUI
#include "wx/dynarray.h"
#include "wx/msw/wrapwin.h"
#include "wx/window.h"
#endif
#include "wx/msw/evtloopconsole.h" // for wxMSWEventLoopBase
// ----------------------------------------------------------------------------
// wxEventLoop
// ----------------------------------------------------------------------------
class WXDLLIMPEXP_BASE wxMSWEventLoopBase : public wxEventLoopManual
{
public:
wxMSWEventLoopBase();
// implement base class pure virtuals
virtual bool Pending() const;
protected:
// get the next message from queue and return true or return false if we
// got WM_QUIT or an error occurred
bool GetNextMessage(WXMSG *msg);
// same as above but with a timeout and return value can be -1 meaning that
// time out expired in addition to
int GetNextMessageTimeout(WXMSG *msg, unsigned long timeout);
};
#if wxUSE_GUI
WX_DECLARE_EXPORTED_OBJARRAY(MSG, wxMSGArray);
class WXDLLIMPEXP_CORE wxGUIEventLoop : public wxMSWEventLoopBase
@ -93,27 +71,4 @@ private:
static wxWindowMSW *ms_winCritical;
};
#else // !wxUSE_GUI
#if wxUSE_CONSOLE_EVENTLOOP
class WXDLLIMPEXP_BASE wxConsoleEventLoop : public wxMSWEventLoopBase
{
public:
wxConsoleEventLoop() { }
// override/implement base class virtuals
virtual bool Dispatch();
virtual int DispatchTimeout(unsigned long timeout);
virtual void WakeUp();
virtual bool YieldFor(long WXUNUSED(eventsToProcess)) { return true; }
// MSW-specific function to process a single message
virtual void ProcessMessage(WXMSG *msg);
};
#endif // wxUSE_CONSOLE_EVENTLOOP
#endif // wxUSE_GUI/!wxUSE_GUI
#endif // _WX_MSW_EVTLOOP_H_

View File

@ -0,0 +1,51 @@
///////////////////////////////////////////////////////////////////////////////
// Name: wx/msw/evtloopconsole.h
// Purpose: wxConsoleEventLoop class for Windows
// Author: Vadim Zeitlin
// Modified by:
// Created: 2004-07-31
// Copyright: (c) 2003-2004 Vadim Zeitlin <vadim@wxwindows.org>
// Licence: wxWindows licence
///////////////////////////////////////////////////////////////////////////////
#ifndef _WX_MSW_EVTLOOPCONSOLE_H_
#define _WX_MSW_EVTLOOPCONSOLE_H_
class WXDLLIMPEXP_BASE wxMSWEventLoopBase : public wxEventLoopManual
{
public:
wxMSWEventLoopBase();
// implement base class pure virtuals
virtual bool Pending() const;
protected:
// get the next message from queue and return true or return false if we
// got WM_QUIT or an error occurred
bool GetNextMessage(WXMSG *msg);
// same as above but with a timeout and return value can be -1 meaning that
// time out expired in addition to
int GetNextMessageTimeout(WXMSG *msg, unsigned long timeout);
};
#if wxUSE_CONSOLE_EVENTLOOP
class WXDLLIMPEXP_BASE wxConsoleEventLoop : public wxMSWEventLoopBase
{
public:
wxConsoleEventLoop() { }
// override/implement base class virtuals
virtual bool Dispatch();
virtual int DispatchTimeout(unsigned long timeout);
virtual void WakeUp();
virtual bool YieldFor(long WXUNUSED(eventsToProcess)) { return true; }
// Windows-specific function to process a single message
virtual void ProcessMessage(WXMSG *msg);
};
#endif // wxUSE_CONSOLE_EVENTLOOP
#endif // _WX_MSW_EVTLOOPCONSOLE_H_

View File

@ -4,7 +4,6 @@
// Author: Markus Greither
// Modified by: 31.07.01: VZ: integrated into wxWidgets
// Created: 23/03/2001
// RCS-ID: $Id: fdrepdlg.h 58757 2009-02-08 11:45:59Z VZ $
// Copyright: (c) Markus Greither
// Licence: wxWindows licence
/////////////////////////////////////////////////////////////////////////////

View File

@ -4,7 +4,6 @@
// Author: Julian Smart
// Modified by:
// Created: 01/02/97
// RCS-ID: $Id: filedlg.h 62722 2009-11-26 16:17:00Z VZ $
// Copyright: (c) Julian Smart
// Licence: wxWindows licence
/////////////////////////////////////////////////////////////////////////////
@ -44,6 +43,9 @@ public:
// called from the hook procedure on CDN_INITDONE reception
virtual void MSWOnInitDone(WXHWND hDlg);
// called from the hook procedure on CDN_SELCHANGE.
void MSWOnSelChange(WXHWND hDlg);
protected:
#if !(defined(__SMARTPHONE__) && defined(__WXWINCE__))

View File

@ -4,7 +4,6 @@
// Author: Julian Smart
// Modified by:
// Created: 01/02/97
// RCS-ID: $Id: font.h 70446 2012-01-23 11:28:28Z VZ $
// Copyright: (c) Julian Smart
// Licence: wxWindows licence
/////////////////////////////////////////////////////////////////////////////
@ -24,6 +23,8 @@ public:
// ctors and such
wxFont() { }
wxFont(const wxFontInfo& info);
#if FUTURE_WXWIN_COMPATIBILITY_3_0
wxFont(int size,
int family,
@ -91,12 +92,6 @@ public:
Create(info, hFont);
}
wxFont(int pointSize,
wxFontFamily family,
int flags = wxFONTFLAG_DEFAULT,
const wxString& face = wxEmptyString,
wxFontEncoding encoding = wxFONTENCODING_DEFAULT);
wxFont(const wxString& fontDesc);

View File

@ -4,7 +4,6 @@
// Author: Julian Smart
// Modified by:
// Created: 01/02/97
// RCS-ID: $Id: fontdlg.h 52834 2008-03-26 15:06:00Z FM $
// Copyright: (c) Julian Smart
// Licence: wxWindows licence
/////////////////////////////////////////////////////////////////////////////

View File

@ -4,7 +4,6 @@
// Author: Julian Smart
// Modified by:
// Created: 01/02/97
// RCS-ID: $Id: frame.h 70511 2012-02-05 14:18:22Z VZ $
// Copyright: (c) Julian Smart
// Licence: wxWindows licence
/////////////////////////////////////////////////////////////////////////////
@ -77,7 +76,6 @@ public:
// event handlers
bool HandleSize(int x, int y, WXUINT flag);
bool HandleCommand(WXWORD id, WXWORD cmd, WXHWND control);
bool HandleMenuSelect(WXWORD nItem, WXWORD nFlags, WXHMENU hMenu);
// tooltip management
#if wxUSE_TOOLTIPS
@ -105,6 +103,9 @@ public:
// get the currently active menu: this is the same as the frame menu for
// normal frames but is overridden by wxMDIParentFrame
virtual WXHMENU MSWGetActiveMenu() const { return m_hMenu; }
// Look up the menu in the menu bar.
virtual wxMenu* MSWFindMenuFromHMENU(WXHMENU hMenu);
#endif // wxUSE_MENUS
protected:
@ -131,18 +132,6 @@ protected:
// wxMDIChildFrame
bool MSWDoTranslateMessage(wxFrame *frame, WXMSG *msg);
#if wxUSE_MENUS
// handle WM_EXITMENULOOP message for Win95 only
bool HandleExitMenuLoop(WXWORD isPopup);
// handle WM_(UN)INITMENUPOPUP message to generate wxEVT_MENU_OPEN/CLOSE
bool HandleMenuPopup(wxEventType evtType, WXHMENU hMenu);
// Command part of HandleMenuPopup() and HandleExitMenuLoop().
bool DoSendMenuOpenCloseEvent(wxEventType evtType, wxMenu* menu, bool popup);
#endif // wxUSE_MENUS
virtual bool IsMDIChild() const { return false; }
// get default (wxWidgets) icon for the frame

View File

@ -3,7 +3,6 @@
// Purpose: wxMSWFileSystemWatcher
// Author: Bartosz Bekier
// Created: 2009-05-26
// RCS-ID: $Id: fswatcher.h 67693 2011-05-03 23:31:39Z VZ $
// Copyright: (c) 2009 Bartosz Bekier <bartosz.bekier@gmail.com>
// Licence: wxWindows licence
/////////////////////////////////////////////////////////////////////////////

View File

@ -4,7 +4,6 @@
// Author: Julian Smart
// Modified by:
// Created: 01/02/97
// RCS-ID: $Id: gauge.h 67280 2011-03-22 14:17:38Z DS $
// Copyright: (c) Julian Smart
// Licence: wxWindows licence
/////////////////////////////////////////////////////////////////////////////

View File

@ -4,7 +4,6 @@
Author: Vadim Zeitlin
Modified by:
Created:
RCS-ID: $Id: gccpriv.h 36155 2005-11-10 16:16:05Z ABX $
Copyright: (c) Vadim Zeitlin
Licence: wxWindows Licence
*/
@ -74,15 +73,6 @@
#define __CYGWIN10__
#endif
/* Check for Mingw runtime version: */
#if defined(__MINGW32_MAJOR_VERSION) && defined(__MINGW32_MINOR_VERSION)
#define wxCHECK_MINGW32_VERSION( major, minor ) \
( ( ( __MINGW32_MAJOR_VERSION > (major) ) \
|| ( __MINGW32_MAJOR_VERSION == (major) && __MINGW32_MINOR_VERSION >= (minor) ) ) )
#else
#define wxCHECK_MINGW32_VERSION( major, minor ) (0)
#endif
/* Mingw runtime 1.0-20010604 has some missing _tXXXX functions,
so let's define them ourselves: */
#if defined(__GNUWIN32__) && wxCHECK_W32API_VERSION( 1, 0 ) \

View File

@ -5,7 +5,6 @@
// Author: Vadim Zeitlin
// Modified by:
// Created: 20.11.99
// RCS-ID: $Id: gdiimage.h 66374 2010-12-14 18:43:49Z VZ $
// Copyright: (c) 1999 Vadim Zeitlin <zeitlin@dptmaths.ens-cachan.fr>
// Licence: wxWindows licence
///////////////////////////////////////////////////////////////////////////////

View File

@ -2,7 +2,6 @@
* Name: wx/msw/genrcdefs.h
* Purpose: Emit preprocessor symbols into rcdefs.h for resource compiler
* Author: Mike Wetherell
* RCS-ID: $Id: genrcdefs.h 46936 2007-06-25 14:04:34Z VS $
* Copyright: (c) 2005 Mike Wetherell
* Licence: wxWindows licence
*/
@ -13,7 +12,11 @@ EMIT(#ifndef _WX_RCDEFS_H)
EMIT(#define _WX_RCDEFS_H)
#ifdef _MSC_FULL_VER
EMIT(#define WX_MSC_FULL_VER _MSC_FULL_VER)
#if _MSC_FULL_VER < 140040130
EMIT(#define wxUSE_RC_MANIFEST 1)
#endif
#else
EMIT(#define wxUSE_RC_MANIFEST 1)
#endif
#ifdef _M_AMD64

View File

@ -4,7 +4,6 @@
// Author: Julian Smart
// Modified by:
// Created: 04/01/98
// RCS-ID: $Id: glcanvas.h 54202 2008-06-14 01:44:13Z VZ $
// Copyright: (c) Julian Smart
// Licence: wxWindows licence
/////////////////////////////////////////////////////////////////////////////

View File

@ -3,7 +3,6 @@
// Purpose: wxMSW native wxHeaderCtrl
// Author: Vadim Zeitlin
// Created: 2008-12-01
// RCS-ID: $Id: headerctrl.h 58757 2009-02-08 11:45:59Z VZ $
// Copyright: (c) 2008 Vadim Zeitlin <vadim@wxwidgets.org>
// Licence: wxWindows licence
///////////////////////////////////////////////////////////////////////////////
@ -46,7 +45,14 @@ public:
virtual ~wxHeaderCtrl();
protected:
// override wxWindow methods which must be implemented by a new control
virtual wxSize DoGetBestSize() const;
virtual void DoSetSize(int x, int y,
int width, int height,
int sizeFlags = wxSIZE_AUTO);
private:
// implement base class pure virtuals
virtual void DoSetCount(unsigned int count);
@ -58,12 +64,6 @@ private:
virtual void DoSetColumnsOrder(const wxArrayInt& order);
virtual wxArrayInt DoGetColumnsOrder() const;
// override wxWindow methods which must be implemented by a new control
virtual wxSize DoGetBestSize() const;
virtual void DoSetSize(int x, int y,
int width, int height,
int sizeFlags = wxSIZE_AUTO);
// override MSW-specific methods needed for new control
virtual WXDWORD MSWGetStyle(long style, WXDWORD *exstyle) const;
virtual bool MSWOnNotify(int idCtrl, WXLPARAM lParam, WXLPARAM *result);
@ -126,6 +126,9 @@ private:
// the offset of the window used to emulate scrolling it
int m_scrollOffset;
// actual column we are dragging or -1 if not dragging anything
int m_colBeingDragged;
wxDECLARE_NO_COPY_CLASS(wxHeaderCtrl);
};

View File

@ -4,7 +4,6 @@
// Author: Mattia Barbon
// Modified by:
// Created: 02/04/2001
// RCS-ID: $Id: helpbest.h 58757 2009-02-08 11:45:59Z VZ $
// Copyright: (c) Mattia Barbon
// Licence: wxWindows licence
/////////////////////////////////////////////////////////////////////////////

View File

@ -4,7 +4,6 @@
// Author: Julian Smart
// Modified by:
// Created: 16/04/2000
// RCS-ID: $Id: helpchm.h 67880 2011-06-07 14:28:55Z VZ $
// Copyright: (c) Julian Smart
// Licence: wxWindows licence
/////////////////////////////////////////////////////////////////////////////
@ -63,7 +62,7 @@ protected:
// the first 2 HtmlHelp() parameters
bool CallHtmlHelp(unsigned cmd, WXWPARAM param)
{
return CallHtmlHelp(GetParentWindow(), GetValidFilename().wx_str(),
return CallHtmlHelp(GetParentWindow(), GetValidFilename().t_str(),
cmd, param);
}

View File

@ -4,7 +4,6 @@
// Author: Julian Smart
// Modified by:
// Created: 04/01/98
// RCS-ID: $Id: helpwin.h 67882 2011-06-07 16:48:36Z VZ $
// Copyright: (c) Julian Smart
// Licence: wxWindows licence
/////////////////////////////////////////////////////////////////////////////

View File

@ -3,7 +3,6 @@
// Purpose: Hyperlink control
// Author: Rickard Westerlund
// Created: 2010-08-04
// RCS-ID: $Id: hyperlink.h 65334 2010-08-17 16:55:32Z VZ $
// Copyright: (c) 2010 wxWidgets team
// Licence: wxWindows licence
/////////////////////////////////////////////////////////////////////////////

View File

@ -4,7 +4,6 @@
// Author: Julian Smart
// Modified by:
// Created: 01/02/97
// RCS-ID: $Id: icon.h 56644 2008-11-02 02:39:52Z VZ $
// Copyright: (c) Julian Smart
// Licence: wxWindows licence
/////////////////////////////////////////////////////////////////////////////
@ -65,6 +64,8 @@ public:
wxBitmapType type = wxICON_DEFAULT_TYPE,
int desiredWidth = -1, int desiredHeight = -1);
bool CreateFromHICON(WXHICON icon);
// implementation only from now on
wxIconRefData *GetIconData() const { return (wxIconRefData *)m_refData; }

View File

@ -4,7 +4,6 @@
// Author: Julian Smart
// Modified by:
// Created: 01/02/97
// RCS-ID: $Id: imaglist.h 59036 2009-02-19 20:26:00Z RR $
// Copyright: (c) Julian Smart
// Licence: wxWindows licence
/////////////////////////////////////////////////////////////////////////////

View File

@ -4,7 +4,6 @@
// Author: Vadim Zeitlin
// Modified by:
// Created: 27.07.98
// RCS-ID: $Id: iniconf.h 64943 2010-07-13 13:29:58Z VZ $
// Copyright: (c) 1998 Vadim Zeitlin <zeitlin@dptmaths.ens-cachan.fr>
// Licence: wxWindows licence
///////////////////////////////////////////////////////////////////////////////

View File

@ -0,0 +1,90 @@
/////////////////////////////////////////////////////////////////////////////
// Name: wx/msw/init.h
// Purpose: Windows-specific wxEntry() overload
// Author: Julian Smart
// Modified by:
// Created: 01/02/97
// Copyright: (c) Julian Smart
// Licence: wxWindows licence
/////////////////////////////////////////////////////////////////////////////
#ifndef _WX_MSW_INIT_H_
#define _WX_MSW_INIT_H_
// ----------------------------------------------------------------------------
// Windows-specific wxEntry() overload and wxIMPLEMENT_WXWIN_MAIN definition
// ----------------------------------------------------------------------------
// we need HINSTANCE declaration to define WinMain()
#include "wx/msw/wrapwin.h"
#ifndef SW_SHOWNORMAL
#define SW_SHOWNORMAL 1
#endif
// WinMain() is always ANSI, even in Unicode build, under normal Windows
// but is always Unicode under CE
#ifdef __WXWINCE__
typedef wchar_t *wxCmdLineArgType;
#else
typedef char *wxCmdLineArgType;
#endif
// Windows-only overloads of wxEntry() and wxEntryStart() which take the
// parameters passed to WinMain() instead of those passed to main()
extern WXDLLIMPEXP_CORE bool
wxEntryStart(HINSTANCE hInstance,
HINSTANCE hPrevInstance = NULL,
wxCmdLineArgType pCmdLine = NULL,
int nCmdShow = SW_SHOWNORMAL);
extern WXDLLIMPEXP_CORE int
wxEntry(HINSTANCE hInstance,
HINSTANCE hPrevInstance = NULL,
wxCmdLineArgType pCmdLine = NULL,
int nCmdShow = SW_SHOWNORMAL);
#if defined(__BORLANDC__) && wxUSE_UNICODE
// Borland C++ has the following nonstandard behaviour: when the -WU
// command line flag is used, the linker expects to find wWinMain instead
// of WinMain. This flag causes the compiler to define _UNICODE and
// UNICODE symbols and there's no way to detect its use, so we have to
// define both WinMain and wWinMain so that wxIMPLEMENT_WXWIN_MAIN works
// for both code compiled with and without -WU.
// See http://sourceforge.net/tracker/?func=detail&atid=309863&aid=1935997&group_id=9863
// for more details.
#define wxIMPLEMENT_WXWIN_MAIN_BORLAND_NONSTANDARD \
extern "C" int WINAPI wWinMain(HINSTANCE hInstance, \
HINSTANCE hPrevInstance, \
wchar_t * WXUNUSED(lpCmdLine), \
int nCmdShow) \
{ \
wxDISABLE_DEBUG_SUPPORT(); \
\
/* NB: wxEntry expects lpCmdLine argument to be char*, not */ \
/* wchar_t*, but fortunately it's not used anywhere */ \
/* and we can simply pass NULL in: */ \
return wxEntry(hInstance, hPrevInstance, NULL, nCmdShow); \
}
#else
#define wxIMPLEMENT_WXWIN_MAIN_BORLAND_NONSTANDARD
#endif // defined(__BORLANDC__) && wxUSE_UNICODE
#define wxIMPLEMENT_WXWIN_MAIN \
extern "C" int WINAPI WinMain(HINSTANCE hInstance, \
HINSTANCE hPrevInstance, \
wxCmdLineArgType WXUNUSED(lpCmdLine), \
int nCmdShow) \
{ \
wxDISABLE_DEBUG_SUPPORT(); \
\
/* NB: We pass NULL in place of lpCmdLine to behave the same as */ \
/* Borland-specific wWinMain() above. If it becomes needed */ \
/* to pass lpCmdLine to wxEntry() here, you'll have to fix */ \
/* wWinMain() above too. */ \
return wxEntry(hInstance, hPrevInstance, NULL, nCmdShow); \
} \
wxIMPLEMENT_WXWIN_MAIN_BORLAND_NONSTANDARD
#endif // _WX_MSW_INIT_H_

View File

@ -4,7 +4,6 @@
// Author: Julian Smart
// Modified by:
// Created: 01/02/97
// RCS-ID: $Id: joystick.h 67254 2011-03-20 00:14:35Z DS $
// Copyright: (c) Julian Smart
// Licence: wxWindows licence
/////////////////////////////////////////////////////////////////////////////

View File

@ -3,7 +3,6 @@
* Purpose: Pragmas for linking libs conditionally
* Author: Michael Wetherell
* Modified by:
* RCS-ID: $Id: libraries.h 37045 2006-01-21 22:50:46Z MW $
* Copyright: (c) 2005 Michael Wetherell
* Licence: wxWindows licence
*/

View File

@ -4,7 +4,6 @@
// Author: Julian Smart
// Modified by:
// Created: 01/02/97
// RCS-ID: $Id: listbox.h 64548 2010-06-10 10:40:21Z VZ $
// Copyright: (c) Julian Smart
// Licence: wxWindows licence
/////////////////////////////////////////////////////////////////////////////
@ -151,8 +150,6 @@ public:
virtual void OnInternalIdle();
virtual WXLRESULT MSWWindowProc(WXUINT nMsg, WXWPARAM wParam, WXLPARAM lParam);
protected:
virtual wxSize DoGetBestClientSize() const;
@ -194,10 +191,6 @@ private:
// i.e. if we need to call SetHorizontalExtent() from OnInternalIdle()
bool m_updateHorizontalExtent;
// flag set to true when we get a keyboard event and reset to false when we
// get a mouse one: this is used to find the correct item for the selection
// event
bool m_selectedByKeyboard;
DECLARE_DYNAMIC_CLASS_NO_COPY(wxListBox)
};

View File

@ -4,7 +4,6 @@
// Author: Julian Smart
// Modified by: Agron Selimaj
// Created: 01/02/97
// RCS-ID: $Id: listctrl.h 70282 2012-01-07 15:09:43Z VZ $
// Copyright: (c) Julian Smart
// Licence: wxWindows licence
/////////////////////////////////////////////////////////////////////////////
@ -384,6 +383,14 @@ protected:
// common part of all ctors
void Init();
// Implement constrained best size calculation.
virtual int DoGetBestClientHeight(int width) const
{ return MSWGetBestViewRect(width, -1).y; }
virtual int DoGetBestClientWidth(int height) const
{ return MSWGetBestViewRect(-1, height).x; }
wxSize MSWGetBestViewRect(int x, int y) const;
// Implement base class pure virtual methods.
long DoInsertColumn(long col, const wxListItem& info);
@ -431,9 +438,6 @@ protected:
// return the icon for the given item and column.
virtual int OnGetItemColumnImage(long item, long column) const;
// return the attribute for the item (may return NULL if none)
virtual wxListItemAttr *OnGetItemAttr(long item) const;
// return the attribute for the given item and column (may return NULL if none)
virtual wxListItemAttr *OnGetItemColumnAttr(long item, long WXUNUSED(column)) const
{

View File

@ -4,7 +4,6 @@
// Author: Julian Smart
// Modified by: 2008-10-31 Vadim Zeitlin: derive from the base classes
// Created: 01/02/97
// RCS-ID: $Id: mdi.h 61986 2009-09-21 08:44:42Z VZ $
// Copyright: (c) 1997 Julian Smart
// (c) 2008 Vadim Zeitlin
// Licence: wxWindows licence
@ -110,9 +109,6 @@ public:
#endif // wxUSE_MENUS
protected:
// override to pass menu/toolbar events to the active child first
virtual bool TryBefore(wxEvent& event);
#if wxUSE_MENUS_NATIVE
virtual void InternalSetMenuBar();
#endif // wxUSE_MENUS_NATIVE

View File

@ -4,7 +4,6 @@
// Author: Julian Smart
// Modified by: Vadim Zeitlin (wxMenuItem is now in separate file)
// Created: 01/02/97
// RCS-ID: $Id: menu.h 70350 2012-01-15 13:41:17Z VZ $
// Copyright: (c) Julian Smart
// Licence: wxWindows licence
/////////////////////////////////////////////////////////////////////////////

View File

@ -4,7 +4,6 @@
// Author: Vadim Zeitlin
// Modified by:
// Created: 11.11.97
// RCS-ID: $Id: menuitem.h 70801 2012-03-04 00:29:55Z VZ $
// Copyright: (c) 1998 Vadim Zeitlin <zeitlin@dptmaths.ens-cachan.fr>
// Licence: wxWindows licence
///////////////////////////////////////////////////////////////////////////////

View File

@ -4,7 +4,6 @@
// Author: Julian Smart
// Modified by: VZ 07.01.00: implemented wxMetaFileDataObject
// Created: 01/02/97
// RCS-ID: $Id: metafile.h 58757 2009-02-08 11:45:59Z VZ $
// Copyright: (c) Julian Smart
// Licence: wxWindows licence
/////////////////////////////////////////////////////////////////////////////

View File

@ -4,7 +4,6 @@
// Purpose: Extra implementation for MicroWindows
// Author: Julian Smart
// Created: 2001-05-31
// RCS-ID: $Id: microwin.h 67254 2011-03-20 00:14:35Z DS $
// Copyright: (c) Julian Smart
// Licence: wxWindows licence
/////////////////////////////////////////////////////////////////////////////

View File

@ -4,7 +4,6 @@
// Author: Vadim Zeitlin
// Modified by:
// Created: 23.09.98
// RCS-ID: $Id: mimetype.h 54434 2008-06-30 11:58:41Z RR $
// Copyright: (c) 1998 Vadim Zeitlin <zeitlin@dptmaths.ens-cachan.fr>
// Licence: wxWindows licence (part of wxExtra library)
/////////////////////////////////////////////////////////////////////////////

View File

@ -4,7 +4,6 @@
// Author: Julian Smart
// Modified by:
// Created: 01/02/97
// RCS-ID: $Id: minifram.h 52834 2008-03-26 15:06:00Z FM $
// Copyright: (c) Julian Smart
// Licence: wxWindows licence
/////////////////////////////////////////////////////////////////////////////

View File

@ -3,7 +3,6 @@
// Purpose: Declarations for parts of the Win32 SDK that are missing in
// the versions that come with some compilers
// Created: 2002/04/23
// RCS-ID: $Id: missing.h 69844 2011-11-27 19:50:53Z VZ $
// Copyright: (c) 2002 Mattia Barbon
// Licence: wxWindows licence
/////////////////////////////////////////////////////////////////////////////
@ -77,12 +76,18 @@
#ifndef WM_MOUSEWHEEL
#define WM_MOUSEWHEEL 0x020A
#endif
#ifndef WM_MOUSEHWHEEL
#define WM_MOUSEHWHEEL 0x020E
#endif
#ifndef WHEEL_DELTA
#define WHEEL_DELTA 120
#endif
#ifndef SPI_GETWHEELSCROLLLINES
#define SPI_GETWHEELSCROLLLINES 104
#endif
#ifndef SPI_GETWHEELSCROLLCHARS
#define SPI_GETWHEELSCROLLCHARS 108
#endif
#endif // wxUSE_MOUSEWHEEL
// Needed by window.cpp
@ -648,6 +653,10 @@ typedef struct
#define INET_E_CODE_INSTALL_SUPPRESSED 0x800C0400L
#endif
#ifndef MUI_LANGUAGE_NAME
#define MUI_LANGUAGE_NAME 0x8
#endif
//We need to check if we are using MinGW or mingw-w64 as their
//definitions are different

View File

@ -4,7 +4,6 @@
// Author: Julian Smart
// Modified by:
// Created: 01/02/97
// RCS-ID: $Id: msgdlg.h 66237 2010-11-22 12:49:07Z VZ $
// Copyright: (c) Julian Smart
// Licence: wxWindows licence
/////////////////////////////////////////////////////////////////////////////
@ -27,6 +26,8 @@ public:
virtual int ShowModal();
virtual long GetEffectiveIcon() const;
// implementation-specific
// return the font used for the text in the message box

View File

@ -5,7 +5,6 @@
// Modified by: Vadim Zeitlin to move out various functions to other files
// to fix header inter-dependencies
// Created: 2002/02/17
// RCS-ID: $Id: mslu.h 42462 2006-10-26 19:06:51Z VZ $
// Copyright: (c) 2002 Vaclav Slavik
// Licence: wxWindows licence
/////////////////////////////////////////////////////////////////////////////

View File

@ -5,7 +5,6 @@
// Author: Vadim Zeitlin
// Modified by:
// Created: 31.01.1999
// RCS-ID: $Id: msvcrt.h 59725 2009-03-22 12:53:48Z VZ $
// Copyright: (c) Vadim Zeitlin
// Licence: wxWindows licence
/////////////////////////////////////////////////////////////////////////////

View File

@ -3,7 +3,6 @@
// Purpose: wxNonOwnedWindow declaration for wxMSW.
// Author: Vadim Zeitlin
// Created: 2011-10-09
// RCS-ID: $Id: nonownedwnd.h 69462 2011-10-18 21:56:52Z VZ $
// Copyright: (c) 2011 Vadim Zeitlin <vadim@wxwidgets.org>
// Licence: wxWindows licence
///////////////////////////////////////////////////////////////////////////////

View File

@ -3,7 +3,6 @@
// Purpose: MSW/GTK compatible notebook (a.k.a. property sheet)
// Author: Robert Roebling
// Modified by: Vadim Zeitlin for Windows version
// RCS-ID: $Id: notebook.h 69793 2011-11-22 13:18:45Z VZ $
// Copyright: (c) Julian Smart
// Licence: wxWindows licence
/////////////////////////////////////////////////////////////////////////////

View File

@ -3,7 +3,6 @@
// Purpose: implementation of wxNotificationMessage for Windows
// Author: Vadim Zeitlin
// Created: 2007-12-01
// RCS-ID: $Id: notifmsg.h 58757 2009-02-08 11:45:59Z VZ $
// Copyright: (c) 2007 Vadim Zeitlin <vadim@wxwindows.org>
// Licence: wxWindows licence
///////////////////////////////////////////////////////////////////////////////
@ -23,8 +22,9 @@ public:
wxNotificationMessage() { Init(); }
wxNotificationMessage(const wxString& title,
const wxString& message = wxString(),
wxWindow *parent = NULL)
: wxNotificationMessageBase(title, message, parent)
wxWindow *parent = NULL,
int flags = wxICON_INFORMATION)
: wxNotificationMessageBase(title, message, parent, flags)
{
Init();
}

View File

@ -4,7 +4,6 @@
// Author: Julian Smart
// Modified by:
// Created: 2003-02-12
// RCS-ID: $Id: access.h 67254 2011-03-20 00:14:35Z DS $
// Copyright: (c) 2003 Julian Smart
// Licence: wxWindows licence
///////////////////////////////////////////////////////////////////////////////

View File

@ -4,7 +4,6 @@
// Author: Ryan Norton <wxprojects@comcast.net>
// Modified by:
// Created: 8/18/05
// RCS-ID: $Id: activex.h 70361 2012-01-15 19:05:34Z SJL $
// Copyright: (c) Ryan Norton
// Licence: wxWindows licence
///////////////////////////////////////////////////////////////////////////////

View File

@ -4,7 +4,6 @@
// Author: Julian Smart
// Modified by:
// Created: 11/6/98
// RCS-ID: $Id: automtn.h 67254 2011-03-20 00:14:35Z DS $
// Copyright: (c) 1998, Julian Smart
// Licence: wxWindows licence
/////////////////////////////////////////////////////////////////////////////
@ -21,6 +20,7 @@
typedef void WXIDISPATCH;
typedef unsigned short* WXBSTR;
typedef unsigned long WXLCID;
#ifdef GetObject
#undef GetObject
@ -106,9 +106,21 @@ public:
bool GetObject(wxAutomationObject& obj, const wxString& property, int noArgs = 0, wxVariant args[] = NULL) const;
bool GetObject(wxAutomationObject& obj, const wxString& property, int noArgs, const wxVariant **args) const;
public:
// Returns the locale identifier used in automation calls. The default is
// LOCALE_SYSTEM_DEFAULT. Objects obtained by GetObject() inherit the
// locale identifier from the one that created them.
WXLCID GetLCID() const;
// Sets the locale identifier to be used in automation calls performed by
// this object. The default is LOCALE_SYSTEM_DEFAULT.
void SetLCID(WXLCID lcid);
public: // public for compatibility only, don't use m_dispatchPtr directly.
WXIDISPATCH* m_dispatchPtr;
private:
WXLCID m_lcid;
wxDECLARE_NO_COPY_CLASS(wxAutomationObject);
};

View File

@ -4,7 +4,6 @@
// Author: Vadim Zeitlin
// Modified by:
// Created: 19.10.99 (extracted from msw/ole/dataobj.h)
// RCS-ID: $Id: dataform.h 67254 2011-03-20 00:14:35Z DS $
// Copyright: (c) 1998 Vadim Zeitlin <zeitlin@dptmaths.ens-cachan.fr>
// Licence: wxWindows licence
///////////////////////////////////////////////////////////////////////////////

View File

@ -4,7 +4,6 @@
// Author: Vadim Zeitlin
// Modified by:
// Created: 10.05.98
// RCS-ID: $Id: dataobj.h 67254 2011-03-20 00:14:35Z DS $
// Copyright: (c) 1998 Vadim Zeitlin <zeitlin@dptmaths.ens-cachan.fr>
// Licence: wxWindows licence
///////////////////////////////////////////////////////////////////////////////

View File

@ -5,7 +5,6 @@
// Author: Vadim Zeitlin
// Modified by:
// Created: 21.10.99
// RCS-ID: $Id: dataobj2.h 58757 2009-02-08 11:45:59Z VZ $
// Copyright: (c) 1999 Vadim Zeitlin <zeitlin@dptmaths.ens-cachan.fr>
// Licence: wxWindows licence
///////////////////////////////////////////////////////////////////////////////

View File

@ -4,7 +4,6 @@
// Author: Vadim Zeitlin
// Modified by:
// Created: 06.03.98
// RCS-ID: $Id: dropsrc.h 67254 2011-03-20 00:14:35Z DS $
// Copyright: (c) 1998 Vadim Zeitlin <zeitlin@dptmaths.ens-cachan.fr>
// Licence: wxWindows licence
///////////////////////////////////////////////////////////////////////////////

View File

@ -4,7 +4,6 @@
// Author: Vadim Zeitlin
// Modified by:
// Created: 06.03.98
// RCS-ID: $Id: droptgt.h 67254 2011-03-20 00:14:35Z DS $
// Copyright: (c) 1998 Vadim Zeitlin <zeitlin@dptmaths.ens-cachan.fr>
// Licence: wxWindows licence
///////////////////////////////////////////////////////////////////////////////
@ -19,6 +18,7 @@
// ----------------------------------------------------------------------------
class wxIDropTarget;
struct wxIDropTargetHelper;
struct IDataObject;
// ----------------------------------------------------------------------------
@ -60,12 +60,26 @@ public:
// GetData() when it's called from inside OnData()
void MSWSetDataSource(IDataObject *pIDataSource);
// These functions take care of all things necessary to support native drag
// images.
//
// {Init,End}DragImageSupport() are called during Register/Revoke,
// UpdateDragImageOnXXX() functions are called on the corresponding drop
// target events.
void MSWInitDragImageSupport();
void MSWEndDragImageSupport();
void MSWUpdateDragImageOnData(wxCoord x, wxCoord y, wxDragResult res);
void MSWUpdateDragImageOnDragOver(wxCoord x, wxCoord y, wxDragResult res);
void MSWUpdateDragImageOnEnter(wxCoord x, wxCoord y, wxDragResult res);
void MSWUpdateDragImageOnLeave();
private:
// helper used by IsAcceptedData() and GetData()
wxDataFormat MSWGetSupportedFormat(IDataObject *pIDataSource) const;
wxIDropTarget *m_pIDropTarget; // the pointer to our COM interface
IDataObject *m_pIDataSource; // the pointer to the source data object
wxIDropTarget *m_pIDropTarget; // the pointer to our COM interface
IDataObject *m_pIDataSource; // the pointer to the source data object
wxIDropTargetHelper *m_dropTargetHelper; // the drop target helper
wxDECLARE_NO_COPY_CLASS(wxDropTarget);
};

View File

@ -4,7 +4,6 @@
// Author: Vadim Zeitlin
// Modified by:
// Created: 19.02.1998
// RCS-ID: $Id: oleutils.h 70162 2011-12-29 11:26:05Z SN $
// Copyright: (c) 1998 Vadim Zeitlin <zeitlin@dptmaths.ens-cachan.fr>
// Licence: wxWindows licence
///////////////////////////////////////////////////////////////////////////////
@ -50,7 +49,7 @@ inline bool wxOleInitialize()
// needs non-default mode.
if ( hr != RPC_E_CHANGED_MODE && FAILED(hr) )
{
wxLogError(_("Cannot initialize OLE"));
wxLogError(wxGetTranslation("Cannot initialize OLE"));
return false;
}
@ -192,7 +191,7 @@ private:
// VZ: I don't know it's not done for compilers other than VC++ but I leave it
// as is. Please note, though, that tracing OLE interface calls may be
// incredibly useful when debugging OLE programs.
#if defined(__WXDEBUG__) && ( ( defined(__VISUALC__) && (__VISUALC__ >= 1000) ) || defined(__MWERKS__) )
#if defined(__WXDEBUG__) && (( defined(__VISUALC__) && (__VISUALC__ >= 1000) ))
// ----------------------------------------------------------------------------
// All OLE specific log functions have DebugTrace level (as LogTrace)
// ----------------------------------------------------------------------------
@ -237,6 +236,87 @@ private:
// Convert variants
class WXDLLIMPEXP_FWD_BASE wxVariant;
// wrapper for CURRENCY type used in VARIANT (VARIANT.vt == VT_CY)
class WXDLLIMPEXP_CORE wxVariantDataCurrency : public wxVariantData
{
public:
wxVariantDataCurrency() { VarCyFromR8(0.0, &m_value); }
wxVariantDataCurrency(CURRENCY value) { m_value = value; }
CURRENCY GetValue() const { return m_value; }
void SetValue(CURRENCY value) { m_value = value; }
virtual bool Eq(wxVariantData& data) const;
#if wxUSE_STD_IOSTREAM
virtual bool Write(wxSTD ostream& str) const;
#endif
virtual bool Write(wxString& str) const;
wxVariantData* Clone() const { return new wxVariantDataCurrency(m_value); }
virtual wxString GetType() const { return wxS("currency"); }
DECLARE_WXANY_CONVERSION()
private:
CURRENCY m_value;
};
// wrapper for SCODE type used in VARIANT (VARIANT.vt == VT_ERROR)
class WXDLLIMPEXP_CORE wxVariantDataErrorCode : public wxVariantData
{
public:
wxVariantDataErrorCode(SCODE value = S_OK) { m_value = value; }
SCODE GetValue() const { return m_value; }
void SetValue(SCODE value) { m_value = value; }
virtual bool Eq(wxVariantData& data) const;
#if wxUSE_STD_IOSTREAM
virtual bool Write(wxSTD ostream& str) const;
#endif
virtual bool Write(wxString& str) const;
wxVariantData* Clone() const { return new wxVariantDataErrorCode(m_value); }
virtual wxString GetType() const { return wxS("errorcode"); }
DECLARE_WXANY_CONVERSION()
private:
SCODE m_value;
};
// wrapper for SAFEARRAY, used for passing multidimensional arrays in wxVariant
class WXDLLIMPEXP_CORE wxVariantDataSafeArray : public wxVariantData
{
public:
wxEXPLICIT wxVariantDataSafeArray(SAFEARRAY* value = NULL)
{
m_value = value;
}
SAFEARRAY* GetValue() const { return m_value; }
void SetValue(SAFEARRAY* value) { m_value = value; }
virtual bool Eq(wxVariantData& data) const;
#if wxUSE_STD_IOSTREAM
virtual bool Write(wxSTD ostream& str) const;
#endif
virtual bool Write(wxString& str) const;
wxVariantData* Clone() const { return new wxVariantDataSafeArray(m_value); }
virtual wxString GetType() const { return wxS("safearray"); }
DECLARE_WXANY_CONVERSION()
private:
SAFEARRAY* m_value;
};
WXDLLIMPEXP_CORE bool wxConvertVariantToOle(const wxVariant& variant, VARIANTARG& oleVariant);
WXDLLIMPEXP_CORE bool wxConvertOleToVariant(const VARIANTARG& oleVariant, wxVariant& variant);
#endif // wxUSE_VARIANT

View File

@ -0,0 +1,394 @@
///////////////////////////////////////////////////////////////////////////////
// Name: msw/ole/safearray.h
// Purpose: Helpers for working with OLE SAFEARRAYs.
// Author: PB
// Created: 2012-09-23
// Copyright: (c) 2012 wxWidgets development team
// Licence: wxWindows licence
///////////////////////////////////////////////////////////////////////////////
#ifndef _MSW_OLE_SAFEARRAY_H_
#define _MSW_OLE_SAFEARRAY_H_
#include "wx/msw/ole/oleutils.h"
#if wxUSE_OLE && wxUSE_VARIANT
/*
wxSafeArray is wxWidgets wrapper for working with MS Windows SAFEARRAYs.
It also has convenience functions for converting between SAFEARRAY
and wxVariant with list type or wxArrayString.
*/
// The base class with type-independent methods. It exists solely in order to
// reduce the template bloat.
class WXDLLIMPEXP_CORE wxSafeArrayBase
{
public:
// If owns a SAFEARRAY, it's unlocked and destroyed.
virtual ~wxSafeArrayBase() { Destroy(); }
// Unlocks and destroys the owned SAFEARRAY.
void Destroy();
// Unlocks the owned SAFEARRAY, returns it and gives up its ownership.
SAFEARRAY* Detach();
// Returns true if has a valid SAFEARRAY.
bool HasArray() const { return m_array != NULL; }
// Returns the number of dimensions.
size_t GetDim() const;
// Returns lower bound for dimension dim in bound. Dimensions start at 1.
bool GetLBound(size_t dim, long& bound) const;
// Returns upper bound for dimension dim in bound. Dimensions start at 1.
bool GetUBound(size_t dim, long& bound) const;
// Returns element count for dimension dim. Dimensions start at 1.
size_t GetCount(size_t dim) const;
protected:
// Default constructor, protected so the class can't be used on its own,
// it's only used as a base class of wxSafeArray<>.
wxSafeArrayBase()
{
m_array = NULL;
}
bool Lock();
bool Unlock();
SAFEARRAY* m_array;
};
// wxSafeArrayConvertor<> must be specialized for the type in order to allow
// using it with wxSafeArray<>.
//
// We specialize it below for the standard types.
template <VARTYPE varType>
struct wxSafeArrayConvertor {};
/**
Macro for specializing wxSafeArrayConvertor for simple types.
The template parameters are:
- externType: basic C data type, e.g. wxFloat64 or wxInt32
- varType: corresponding VARIANT type constant, e.g. VT_R8 or VT_I4.
*/
#define wxSPECIALIZE_WXSAFEARRAY_CONVERTOR_SIMPLE(externType, varType) \
template <> \
struct wxSafeArrayConvertor<varType> \
{ \
typedef externType externT; \
typedef externT internT; \
static bool ToArray(const externT& from, internT& to) \
{ \
to = from; \
return true; \
} \
static bool FromArray(const internT& from, externT& to) \
{ \
to = from; \
return true; \
} \
}
wxSPECIALIZE_WXSAFEARRAY_CONVERTOR_SIMPLE(wxInt16, VT_I2);
wxSPECIALIZE_WXSAFEARRAY_CONVERTOR_SIMPLE(wxInt32, VT_I4);
wxSPECIALIZE_WXSAFEARRAY_CONVERTOR_SIMPLE(wxFloat32, VT_R4);
wxSPECIALIZE_WXSAFEARRAY_CONVERTOR_SIMPLE(wxFloat64, VT_R8);
// Specialization for VT_BSTR using wxString.
template <>
struct wxSafeArrayConvertor<VT_BSTR>
{
typedef wxString externT;
typedef BSTR internT;
static bool ToArray(const wxString& from, BSTR& to)
{
BSTR bstr = wxConvertStringToOle(from);
if ( !bstr && !from.empty() )
{
// BSTR can be NULL for empty strings but if the string was
// not empty, it means we failed to allocate memory for it.
return false;
}
to = bstr;
return true;
}
static bool FromArray(const BSTR from, wxString& to)
{
to = wxConvertStringFromOle(from);
return true;
}
};
// Specialization for VT_VARIANT using wxVariant.
template <>
struct wxSafeArrayConvertor<VT_VARIANT>
{
typedef wxVariant externT;
typedef VARIANT internT;
static bool ToArray(const wxVariant& from, VARIANT& to)
{
return wxConvertVariantToOle(from, to);
}
static bool FromArray(const VARIANT& from, wxVariant& to)
{
return wxConvertOleToVariant(from, to);
}
};
template <VARTYPE varType>
class wxSafeArray : public wxSafeArrayBase
{
public:
typedef wxSafeArrayConvertor<varType> Convertor;
typedef typename Convertor::internT internT;
typedef typename Convertor::externT externT;
// Default constructor.
wxSafeArray()
{
m_array = NULL;
}
// Creates and locks a zero-based one-dimensional SAFEARRAY with the given
// number of elements.
bool Create(size_t count)
{
SAFEARRAYBOUND bound;
bound.lLbound = 0;
bound.cElements = count;
return Create(&bound, 1);
}
// Creates and locks a SAFEARRAY. See SafeArrayCreate() in MSDN
// documentation for more information.
bool Create(SAFEARRAYBOUND* bound, size_t dimensions)
{
wxCHECK_MSG( !m_array, false, wxS("Can't be created twice") );
m_array = SafeArrayCreate(varType, dimensions, bound);
if ( !m_array )
return false;
return Lock();
}
/**
Creates a 0-based one-dimensional SAFEARRAY from wxVariant with the
list type.
Can be called only for wxSafeArray<VT_VARIANT>.
*/
bool CreateFromListVariant(const wxVariant& variant)
{
wxCHECK(varType == VT_VARIANT, false);
wxCHECK(variant.GetType() == wxS("list"), false);
if ( !Create(variant.GetCount()) )
return false;
VARIANT* data = static_cast<VARIANT*>(m_array->pvData);
for ( size_t i = 0; i < variant.GetCount(); i++)
{
if ( !Convertor::ToArray(variant[i], data[i]) )
return false;
}
return true;
}
/**
Creates a 0-based one-dimensional SAFEARRAY from wxArrayString.
Can be called only for wxSafeArray<VT_BSTR>.
*/
bool CreateFromArrayString(const wxArrayString& strings)
{
wxCHECK(varType == VT_BSTR, false);
if ( !Create(strings.size()) )
return false;
BSTR* data = static_cast<BSTR*>(m_array->pvData);
for ( size_t i = 0; i < strings.size(); i++ )
{
if ( !Convertor::ToArray(strings[i], data[i]) )
return false;
}
return true;
}
/**
Attaches and locks an existing SAFEARRAY.
The array must have the same VARTYPE as this wxSafeArray was
instantiated with.
*/
bool Attach(SAFEARRAY* array)
{
wxCHECK_MSG(!m_array && array, false,
wxS("Can only attach a valid array to an uninitialized one") );
VARTYPE vt;
HRESULT hr = SafeArrayGetVartype(array, &vt);
if ( FAILED(hr) )
{
wxLogApiError(wxS("SafeArrayGetVarType()"), hr);
return false;
}
wxCHECK_MSG(vt == varType, false,
wxS("Attaching array of invalid type"));
m_array = array;
return Lock();
}
/**
Indices have the same row-column order as rgIndices in
SafeArrayPutElement(), i.e. they follow BASIC rules, NOT C ones.
*/
bool SetElement(long* indices, const externT& element)
{
wxCHECK_MSG( m_array, false, wxS("Uninitialized array") );
wxCHECK_MSG( indices, false, wxS("Invalid index") );
internT* data;
if ( FAILED( SafeArrayPtrOfIndex(m_array, indices, (void**)&data) ) )
return false;
return Convertor::ToArray(element, *data);
}
/**
Indices have the same row-column order as rgIndices in
SafeArrayPutElement(), i.e. they follow BASIC rules, NOT C ones.
*/
bool GetElement(long* indices, externT& element) const
{
wxCHECK_MSG( m_array, false, wxS("Uninitialized array") );
wxCHECK_MSG( indices, false, wxS("Invalid index") );
internT* data;
if ( FAILED( SafeArrayPtrOfIndex(m_array, indices, (void**)&data) ) )
return false;
return Convertor::FromArray(*data, element);
}
/**
Converts the array to a wxVariant with the list type, regardless of the
underlying SAFEARRAY type.
If the array is multidimensional, it is flattened using the alghoritm
originally employed in wxConvertOleToVariant().
*/
bool ConvertToVariant(wxVariant& variant) const
{
wxCHECK_MSG( m_array, false, wxS("Uninitialized array") );
size_t dims = m_array->cDims;
size_t count = 1;
for ( size_t i = 0; i < dims; i++ )
count *= m_array->rgsabound[i].cElements;
const internT* data = static_cast<const internT*>(m_array->pvData);
externT element;
variant.ClearList();
for ( size_t i1 = 0; i1 < count; i1++ )
{
if ( !Convertor::FromArray(data[i1], element) )
{
variant.ClearList();
return false;
}
variant.Append(element);
}
return true;
}
/**
Converts an array to an ArrayString.
Can be called only for wxSafeArray<VT_BSTR>. If the array is
multidimensional, it is flattened using the alghoritm originally
employed in wxConvertOleToVariant().
*/
bool ConvertToArrayString(wxArrayString& strings) const
{
wxCHECK_MSG( m_array, false, wxS("Uninitialized array") );
wxCHECK(varType == VT_BSTR, false);
size_t dims = m_array->cDims;
size_t count = 1;
for ( size_t i = 0; i < dims; i++ )
count *= m_array->rgsabound[i].cElements;
const BSTR* data = static_cast<const BSTR*>(m_array->pvData);
wxString element;
strings.clear();
strings.reserve(count);
for ( size_t i1 = 0; i1 < count; i1++ )
{
if ( !Convertor::FromArray(data[i1], element) )
{
strings.clear();
return false;
}
strings.push_back(element);
}
return true;
}
static bool ConvertToVariant(SAFEARRAY* psa, wxVariant& variant)
{
wxSafeArray<varType> sa;
bool result = false;
if ( sa.Attach(psa) )
result = sa.ConvertToVariant(variant);
if ( sa.HasArray() )
sa.Detach();
return result;
}
static bool ConvertToArrayString(SAFEARRAY* psa, wxArrayString& strings)
{
wxSafeArray<varType> sa;
bool result = false;
if ( sa.Attach(psa) )
result = sa.ConvertToArrayString(strings);
if ( sa.HasArray() )
sa.Detach();
return result;
}
wxDECLARE_NO_COPY_TEMPLATE_CLASS(wxSafeArray, varType);
};
#endif // wxUSE_OLE && wxUSE_VARIANT
#endif // _MSW_OLE_SAFEARRAY_H_

View File

@ -4,7 +4,6 @@
// Author: Vadim Zeitlin
// Modified by:
// Created: 11.07.97
// RCS-ID: $Id: uuid.h 67254 2011-03-20 00:14:35Z DS $
// Copyright: (c) 1998 Vadim Zeitlin <zeitlin@dptmaths.ens-cachan.fr>
// Licence: wxWindows licence
//

View File

@ -4,7 +4,6 @@
// Author: Marcin Malich
// Modified by:
// Created: 2009-09-22
// RCS-ID: $Id: ownerdrw.h 63220 2010-01-23 13:21:12Z VZ $
// Copyright: (c) 2009 Marcin Malich <me@malcom.pl>
// Licence: wxWindows licence
///////////////////////////////////////////////////////////////////////////////

View File

@ -4,7 +4,6 @@
// Author: Julian Smart
// Modified by:
// Created: 01/02/97
// RCS-ID: $Id: palette.h 70040 2011-12-17 23:52:47Z VZ $
// Copyright: (c) Julian Smart
// Licence: wxWindows licence
/////////////////////////////////////////////////////////////////////////////

View File

@ -3,7 +3,6 @@
// Purpose: wxMSW-specific wxPanel class.
// Author: Vadim Zeitlin
// Created: 2011-03-18
// RCS-ID: $Id: panel.h 70098 2011-12-23 05:59:59Z PC $
// Copyright: (c) 2011 Vadim Zeitlin <vadim@wxwidgets.org>
// Licence: wxWindows licence
///////////////////////////////////////////////////////////////////////////////

View File

@ -4,7 +4,6 @@
// Author: Julian Smart
// Modified by: Vadim Zeitlin: fixed operator=(), ==(), !=()
// Created: 01/02/97
// RCS-ID: $Id: pen.h 54273 2008-06-17 17:28:26Z VZ $
// Copyright: (c) Julian Smart
// Licence: wxWindows licence
/////////////////////////////////////////////////////////////////////////////

View File

@ -4,7 +4,6 @@
// Author: Vadim Zeitlin
// Modified by:
// Created: 06.01.01
// RCS-ID: $Id: popupwin.h 52834 2008-03-26 15:06:00Z FM $
// Copyright: (c) 2001 Vadim Zeitlin <zeitlin@dptmaths.ens-cachan.fr>
// Licence: wxWindows licence
///////////////////////////////////////////////////////////////////////////////
@ -26,6 +25,7 @@ public:
bool Create(wxWindow *parent, int flags = wxBORDER_NONE);
virtual void SetFocus();
virtual bool Show(bool show = true);
// return the style to be used for the popup windows

View File

@ -4,7 +4,6 @@
// Author: Julian Smart
// Modified by:
// Created: 01/02/97
// RCS-ID: $Id: printdlg.h 70636 2012-02-20 21:55:55Z VZ $
// Copyright: (c) Julian Smart
// Licence: wxWindows licence
/////////////////////////////////////////////////////////////////////////////

View File

@ -4,7 +4,6 @@
// Author: Julian Smart
// Modified by:
// Created: 01/02/97
// RCS-ID: $Id: printwin.h 67254 2011-03-20 00:14:35Z DS $
// Copyright: (c) Julian Smart
// Licence: wxWindows licence
/////////////////////////////////////////////////////////////////////////////

View File

@ -6,7 +6,6 @@
// Author: Julian Smart
// Modified by:
// Created: 01/02/97
// RCS-ID: $Id: private.h 69758 2011-11-14 12:51:53Z VZ $
// Copyright: (c) Julian Smart
// Licence: wxWindows licence
/////////////////////////////////////////////////////////////////////////////
@ -169,9 +168,9 @@ extern LONG APIENTRY _EXPORT
// This one is a macro so that it can be tested with #ifdef, it will be
// undefined if it cannot be implemented for a given compiler.
// Vc++, bcc, dmc, ow, mingw, codewarrior (and rsxnt) have _get_osfhandle.
// Cygwin has get_osfhandle. Others are currently unknown, e.g. Salford,
// Intel, Visual Age.
// Vc++, bcc, dmc, ow, mingw akk have _get_osfhandle() and Cygwin has
// get_osfhandle. Others are currently unknown, e.g. Salford, Intel, Visual
// Age.
#if defined(__WXWINCE__)
#define wxGetOSFHandle(fd) ((HANDLE)fd)
#define wxOpenOSFHandle(h, flags) ((int)wxPtrToUInt(h))
@ -181,8 +180,7 @@ extern LONG APIENTRY _EXPORT
|| defined(__BORLANDC__) \
|| defined(__DMC__) \
|| defined(__WATCOMC__) \
|| defined(__MINGW32__) \
|| (defined(__MWERKS__) && defined(__MSL__))
|| defined(__MINGW32__)
#define wxGetOSFHandle(fd) ((HANDLE)_get_osfhandle(fd))
#define wxOpenOSFHandle(h, flags) (_open_osfhandle(wxPtrToUInt(h), flags))
#define wx_fdopen _fdopen
@ -219,6 +217,21 @@ struct WinStruct : public T
};
// Macros for converting wxString to the type expected by API functions.
//
// Normally it is enough to just use wxString::t_str() which is implicitly
// convertible to LPCTSTR, but in some cases an explicit conversion is required.
//
// In such cases wxMSW_CONV_LPCTSTR() should be used. But if an API function
// takes a non-const pointer, wxMSW_CONV_LPTSTR() which casts away the
// constness (but doesn't make it possible to really modify the returned
// pointer, of course) should be used. And if a string is passed as LPARAM, use
// wxMSW_CONV_LPARAM() which does the required ugly reinterpret_cast<> too.
#define wxMSW_CONV_LPCTSTR(s) static_cast<const wxChar *>((s).t_str())
#define wxMSW_CONV_LPTSTR(s) const_cast<wxChar *>(wxMSW_CONV_LPCTSTR(s))
#define wxMSW_CONV_LPARAM(s) reinterpret_cast<LPARAM>(wxMSW_CONV_LPCTSTR(s))
#if wxUSE_GUI
#include "wx/gdicmn.h"
@ -418,8 +431,9 @@ private:
class WindowHDC
{
public:
WindowHDC() : m_hwnd(NULL), m_hdc(NULL) { }
WindowHDC(HWND hwnd) { m_hdc = ::GetDC(m_hwnd = hwnd); }
~WindowHDC() { ::ReleaseDC(m_hwnd, m_hdc); }
~WindowHDC() { if ( m_hwnd && m_hdc ) { ::ReleaseDC(m_hwnd, m_hdc); } }
operator HDC() const { return m_hdc; }
@ -781,7 +795,7 @@ public:
{
if ( IsRegistered() )
{
if ( !::UnregisterClass(m_clsname.wx_str(), wxGetInstance()) )
if ( !::UnregisterClass(m_clsname.t_str(), wxGetInstance()) )
{
wxLogLastError(wxT("UnregisterClass"));
}
@ -917,7 +931,7 @@ enum wxWinVersion
WXDLLIMPEXP_BASE wxWinVersion wxGetWinVersion();
#if wxUSE_GUI
#if wxUSE_GUI && defined(__WXMSW__)
// cursor stuff
extern HCURSOR wxGetCurrentBusyCursor(); // from msw/utils.cpp
@ -1054,6 +1068,6 @@ inline void *wxSetWindowUserData(HWND hwnd, void *data)
#endif // __WIN64__/__WIN32__
#endif // wxUSE_GUI
#endif // wxUSE_GUI && __WXMSW__
#endif // _WX_PRIVATE_H_

Some files were not shown because too many files have changed in this diff Show More