Import r67258 of the wxWidgets trunk, which I expect will before

long become wxWidgets 2.9.2, which in turn is expected to be the
last 2.9 release before the 3.0 stable release.

Since the full wxWidgets distribution is rather large, I have
imported only the parts that we use, on a subdirectory basis:

art
include/wx/*.*
include/wx/aui
include/wx/cocoa
include/wx/generic
include/wx/gtk
include/wx/meta
include/wx/msw
include/wx/osx
include/wx/persist
include/wx/private
include/wx/protocol
include/wx/unix
src/aui
src/common
src/generic
src/gtk
src/msw
src/osx
src/unix


git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@7380 8ced0084-cf51-0410-be5f-012b33b47a6e
This commit is contained in:
Soren Jorvang
2011-03-20 18:05:19 +00:00
parent 205637ccc3
commit d14efe561b
1945 changed files with 694474 additions and 0 deletions

View File

@ -0,0 +1,76 @@
///////////////////////////////////////////////////////////////////////////////
// Name: wx/msw/private/button.h
// Purpose: helper functions used with native BUTTON control
// Author: Vadim Zeitlin
// Created: 2008-06-07
// RCS-ID: $Id: button.h 67254 2011-03-20 00:14:35Z DS $
// Copyright: (c) 2008 Vadim Zeitlin <vadim@wxwidgets.org>
// Licence: wxWindows licence
///////////////////////////////////////////////////////////////////////////////
#ifndef _WX_MSW_PRIVATE_BUTTON_H_
#define _WX_MSW_PRIVATE_BUTTON_H_
// define some standard button constants which may be missing in the headers
#ifndef BS_PUSHLIKE
#define BS_PUSHLIKE 0x00001000L
#endif
#ifndef BST_UNCHECKED
#define BST_UNCHECKED 0x0000
#endif
#ifndef BST_CHECKED
#define BST_CHECKED 0x0001
#endif
#ifndef BST_INDETERMINATE
#define BST_INDETERMINATE 0x0002
#endif
namespace wxMSWButton
{
// returns BS_MULTILINE if the label contains new lines or 0 otherwise
inline int GetMultilineStyle(const wxString& label)
{
return label.find(wxT('\n')) == wxString::npos ? 0 : BS_MULTILINE;
}
// update the style of the specified HWND to include or exclude BS_MULTILINE
// depending on whether the label contains the new lines
void UpdateMultilineStyle(HWND hwnd, const wxString& label);
// flags for ComputeBestSize() and GetFittingSize()
enum
{
Size_AuthNeeded = 1
};
// NB: All the functions below are implemented in src/msw/button.cpp
// Compute the button size (as if wxBU_EXACTFIT were specified, i.e. without
// adjusting it to be of default size if it's smaller) for the given label size
WXDLLIMPEXP_CORE wxSize
GetFittingSize(wxWindow *win, const wxSize& sizeLabel, int flags = 0);
// Compute the button size (as if wxBU_EXACTFIT were specified) by computing
// its label size and then calling GetFittingSize().
wxSize ComputeBestFittingSize(wxControl *btn, int flags = 0);
// Increase the size passed as parameter to be at least the standard button
// size if the control doesn't have wxBU_EXACTFIT style and also cache it as
// the best size and return its value -- this is used in DoGetBestSize()
// implementation.
wxSize IncreaseToStdSizeAndCache(wxControl *btn, const wxSize& size);
// helper of wxToggleButton::DoGetBestSize()
inline wxSize ComputeBestSize(wxControl *btn, int flags = 0)
{
return IncreaseToStdSizeAndCache(btn, ComputeBestFittingSize(btn, flags));
}
} // namespace wxMSWButton
#endif // _WX_MSW_PRIVATE_BUTTON_H_

View File

@ -0,0 +1,31 @@
///////////////////////////////////////////////////////////////////////////////
// Name: wx/msw/private/datecontrols.h
// Purpose: implementation helpers for wxDatePickerCtrl and wxCalendarCtrl
// Author: Vadim Zeitlin
// Created: 2008-04-04
// RCS-ID: $Id: datecontrols.h 67254 2011-03-20 00:14:35Z DS $
// Copyright: (c) 2008 Vadim Zeitlin <vadim@wxwidgets.org>
// Licence: wxWindows licence
///////////////////////////////////////////////////////////////////////////////
#ifndef _MSW_PRIVATE_DATECONTROLS_H_
#define _MSW_PRIVATE_DATECONTROLS_H_
#include "wx/datetime.h"
#include "wx/msw/wrapwin.h"
// namespace for the helper functions related to the date controls
namespace wxMSWDateControls
{
// do the one time only initialization of date classes of comctl32.dll, return
// true if ok or log an error and return false if we failed (this can only
// happen with a very old version of common controls DLL, i.e. before 4.70)
extern bool CheckInitialization();
} // namespace wxMSWDateControls
#endif // _MSW_PRIVATE_DATECONTROLS_H_

View File

@ -0,0 +1,148 @@
///////////////////////////////////////////////////////////////////////////////
// Name: wx/msw/private/dc.h
// Purpose: private wxMSW helpers for working with HDCs
// Author: Vadim Zeitlin
// Created: 2009-06-16 (extracted from src/msw/dc.cpp)
// RCS-ID: $Id: dc.h 67254 2011-03-20 00:14:35Z DS $
// Copyright: (c) 2009 Vadim Zeitlin <vadim@wxwidgets.org>
// Licence: wxWindows licence
///////////////////////////////////////////////////////////////////////////////
#ifndef _MSW_PRIVATE_DC_H_
#define _MSW_PRIVATE_DC_H_
#include "wx/msw/dc.h"
#include "wx/msw/wrapwin.h"
namespace wxMSWImpl
{
// various classes to change some DC property temporarily
// text background and foreground colours
class wxTextColoursChanger
{
public:
wxTextColoursChanger(HDC hdc, const wxMSWDCImpl& dc)
: m_hdc(hdc)
{
Change(dc.GetTextForeground(), dc.GetTextBackground());
}
wxTextColoursChanger(HDC hdc, const wxColour& colFg, const wxColour& colBg)
: m_hdc(hdc)
{
Change(colFg, colBg);
}
wxTextColoursChanger(HDC hdc, COLORREF colFg, COLORREF colBg)
: m_hdc(hdc)
{
Change(colFg, colBg);
}
~wxTextColoursChanger()
{
if ( m_oldColFg != CLR_INVALID )
::SetTextColor(m_hdc, m_oldColFg);
if ( m_oldColBg != CLR_INVALID )
::SetBkColor(m_hdc, m_oldColBg);
}
protected:
// this ctor doesn't change mode immediately, call Change() later to do it
// only if needed
wxTextColoursChanger(HDC hdc)
: m_hdc(hdc)
{
m_oldColFg =
m_oldColBg = CLR_INVALID;
}
void Change(const wxColour& colFg, const wxColour& colBg)
{
Change(colFg.IsOk() ? colFg.GetPixel() : CLR_INVALID,
colBg.IsOk() ? colBg.GetPixel() : CLR_INVALID);
}
void Change(COLORREF colFg, COLORREF colBg)
{
if ( colFg != CLR_INVALID )
{
m_oldColFg = ::SetTextColor(m_hdc, colFg);
if ( m_oldColFg == CLR_INVALID )
{
wxLogLastError(wxT("SetTextColor"));
}
}
else
{
m_oldColFg = CLR_INVALID;
}
if ( colBg != CLR_INVALID )
{
m_oldColBg = ::SetBkColor(m_hdc, colBg);
if ( m_oldColBg == CLR_INVALID )
{
wxLogLastError(wxT("SetBkColor"));
}
}
else
{
m_oldColBg = CLR_INVALID;
}
}
private:
const HDC m_hdc;
COLORREF m_oldColFg,
m_oldColBg;
wxDECLARE_NO_COPY_CLASS(wxTextColoursChanger);
};
// background mode
class wxBkModeChanger
{
public:
// set background mode to opaque if mode != wxBRUSHSTYLE_TRANSPARENT
wxBkModeChanger(HDC hdc, int mode)
: m_hdc(hdc)
{
Change(mode);
}
~wxBkModeChanger()
{
if ( m_oldMode )
::SetBkMode(m_hdc, m_oldMode);
}
protected:
// this ctor doesn't change mode immediately, call Change() later to do it
// only if needed
wxBkModeChanger(HDC hdc) : m_hdc(hdc) { m_oldMode = 0; }
void Change(int mode)
{
m_oldMode = ::SetBkMode(m_hdc, mode == wxBRUSHSTYLE_TRANSPARENT
? TRANSPARENT
: OPAQUE);
if ( !m_oldMode )
{
wxLogLastError(wxT("SetBkMode"));
}
}
private:
const HDC m_hdc;
int m_oldMode;
wxDECLARE_NO_COPY_CLASS(wxBkModeChanger);
};
} // namespace wxMSWImpl
#endif // _MSW_PRIVATE_DC_H_

View File

@ -0,0 +1,255 @@
/////////////////////////////////////////////////////////////////////////////
// Name: wx/msw/private/fswatcher.h
// Purpose: File system watcher impl classes
// Author: Bartosz Bekier
// Created: 2009-05-26
// RCS-ID: $Id: fswatcher.h 62678 2009-11-18 09:56:52Z VZ $
// Copyright: (c) 2009 Bartosz Bekier <bartosz.bekier@gmail.com>
// Licence: wxWindows licence
/////////////////////////////////////////////////////////////////////////////
#ifndef WX_MSW_PRIVATE_FSWATCHER_H_
#define WX_MSW_PRIVATE_FSWATCHER_H_
#include "wx/filename.h"
#include "wx/vector.h"
#include "wx/msw/private.h"
// ============================================================================
// wxFSWatcherEntry implementation & helper declarations
// ============================================================================
class wxFSWatcherImplMSW;
class wxFSWatchEntryMSW : public wxFSWatchInfo
{
public:
enum
{
BUFFER_SIZE = 4096 // TODO parametrize
};
wxFSWatchEntryMSW(const wxFSWatchInfo& winfo) :
wxFSWatchInfo(winfo)
{
// get handle for this path
m_handle = OpenDir(m_path);
m_overlapped = (OVERLAPPED*)calloc(1, sizeof(OVERLAPPED));
wxZeroMemory(m_buffer);
}
virtual ~wxFSWatchEntryMSW()
{
wxLogTrace(wxTRACE_FSWATCHER, "Deleting entry '%s'", m_path);
if (m_handle != INVALID_HANDLE_VALUE)
{
if (!CloseHandle(m_handle))
{
wxLogSysError(_("Unable to close the handle for '%s'"),
m_path);
}
}
delete m_overlapped;
}
bool IsOk() const
{
return m_handle != INVALID_HANDLE_VALUE;
}
HANDLE GetHandle() const
{
return m_handle;
}
void* GetBuffer()
{
return m_buffer;
}
OVERLAPPED* GetOverlapped() const
{
return m_overlapped;
}
private:
// opens dir with all flags, attributes etc. necessary to be later
// asynchronous watched with ReadDirectoryChangesW
static HANDLE OpenDir(const wxString& path)
{
HANDLE handle = CreateFile(path.t_str(),
FILE_LIST_DIRECTORY,
FILE_SHARE_READ |
FILE_SHARE_WRITE |
FILE_SHARE_DELETE,
NULL,
OPEN_EXISTING,
FILE_FLAG_BACKUP_SEMANTICS |
FILE_FLAG_OVERLAPPED,
NULL);
if (handle == INVALID_HANDLE_VALUE)
{
wxLogSysError(_("Failed to open directory \"%s\" for monitoring."),
path);
}
return handle;
}
HANDLE m_handle; // handle to opened directory
char m_buffer[BUFFER_SIZE]; // buffer for fs events
OVERLAPPED* m_overlapped;
wxDECLARE_NO_COPY_CLASS(wxFSWatchEntryMSW);
};
// ============================================================================
// wxFSWatcherImplMSW helper classes implementations
// ============================================================================
class wxIOCPService
{
public:
wxIOCPService() :
m_iocp(INVALID_HANDLE_VALUE)
{
Init();
}
~wxIOCPService()
{
if (m_iocp != INVALID_HANDLE_VALUE)
{
if (!CloseHandle(m_iocp))
{
wxLogSysError(_("Unable to close I/O completion port handle"));
}
}
m_watches.clear();
}
// associates a wxFSWatchEntryMSW with completion port
bool Add(wxSharedPtr<wxFSWatchEntryMSW> watch)
{
wxCHECK_MSG( m_iocp != INVALID_HANDLE_VALUE, false, "IOCP not init" );
wxCHECK_MSG( watch->IsOk(), false, "Invalid watch" );
// associate with IOCP
HANDLE ret = CreateIoCompletionPort(watch->GetHandle(), m_iocp,
(ULONG_PTR)watch.get(), 0);
if (ret == NULL)
{
wxLogSysError(_("Unable to associate handle with "
"I/O completion port"));
return false;
}
else if (ret != m_iocp)
{
wxFAIL_MSG(_("Unexpectedly new I/O completion port was created"));
return false;
}
// add to watch map
wxFSWatchEntries::value_type val(watch->GetPath(), watch);
return m_watches.insert(val).second;
}
// post completion packet
bool PostEmptyStatus()
{
wxCHECK_MSG( m_iocp != INVALID_HANDLE_VALUE, false, "IOCP not init" );
int ret = PostQueuedCompletionStatus(m_iocp, 0, 0, NULL);
if (!ret)
{
wxLogSysError(_("Unable to post completion status"));
}
return ret != 0;
}
// Wait for completion status to arrive.
// This function can block forever in it's wait for completion status.
// Use PostEmptyStatus() to wake it up (and end the worker thread)
bool GetStatus(unsigned long* count, wxFSWatchEntryMSW** watch,
OVERLAPPED** overlapped)
{
wxCHECK_MSG( m_iocp != INVALID_HANDLE_VALUE, false, "IOCP not init" );
wxCHECK_MSG( count != NULL, false, "Null out parameter 'count'");
wxCHECK_MSG( watch != NULL, false, "Null out parameter 'watch'");
wxCHECK_MSG( overlapped != NULL, false,
"Null out parameter 'overlapped'");
int ret = GetQueuedCompletionStatus(m_iocp, count, (ULONG_PTR *)watch,
overlapped, INFINITE);
if (!ret)
{
wxLogSysError(_("Unable to dequeue completion packet"));
}
return ret != 0;
}
protected:
bool Init()
{
m_iocp = CreateIoCompletionPort(INVALID_HANDLE_VALUE, NULL, 0, 0);
if (m_iocp == NULL)
{
wxLogSysError(_("Unable to create I/O completion port"));
}
return m_iocp != NULL;
}
HANDLE m_iocp;
wxFSWatchEntries m_watches;
};
class wxIOCPThread : public wxThread
{
public:
wxIOCPThread(wxFSWatcherImplMSW* service, wxIOCPService* iocp);
// finishes this thread
bool Finish();
protected:
// structure to hold information needed to process one native event
// this is just a dummy holder, so it doesn't take ownership of it's data
struct wxEventProcessingData
{
wxEventProcessingData(const FILE_NOTIFY_INFORMATION* ne,
const wxFSWatchEntryMSW* watch) :
nativeEvent(ne), watch(watch)
{}
const FILE_NOTIFY_INFORMATION* nativeEvent;
const wxFSWatchEntryMSW* watch;
};
virtual ExitCode Entry();
// wait for events to occur, read them and send to interested parties
// returns false it empty status was read, which means we whould exit
// true otherwise
bool ReadEvents();
void ProcessNativeEvents(wxVector<wxEventProcessingData>& events);
void SendEvent(wxFileSystemWatcherEvent& evt);
static int Native2WatcherFlags(int flags);
static wxString FileNotifyInformationToString(
const FILE_NOTIFY_INFORMATION& e);
static wxFileName GetEventPath(const wxFSWatchEntryMSW& watch,
const FILE_NOTIFY_INFORMATION& e);
wxFSWatcherImplMSW* m_service;
wxIOCPService* m_iocp;
};
#endif /* WX_MSW_PRIVATE_FSWATCHER_H_ */

View File

@ -0,0 +1,42 @@
///////////////////////////////////////////////////////////////////////////////
// Name: wx/msw/private/keyboard.h
// Purpose: Helper keyboard-related functions.
// Author: Vadim Zeitlin
// Created: 2010-09-09
// RCS-ID: $Id: keyboard.h 65590 2010-09-22 13:31:41Z VZ $
// Copyright: (c) 2010 Vadim Zeitlin <vadim@wxwidgets.org>
// Licence: wxWindows licence
///////////////////////////////////////////////////////////////////////////////
#ifndef _WX_MSW_PRIVATE_KEYBOARD_H_
#define _WX_MSW_PRIVATE_KEYBOARD_H_
#include "wx/defs.h"
namespace wxMSWKeyboard
{
// ----------------------------------------------------------------------------
// Functions for translating between MSW virtual keys codes and wx key codes
//
// These functions are currently implemented in src/msw/window.cpp.
// ----------------------------------------------------------------------------
// Translate MSW virtual key code to wx key code. lParam is used to distinguish
// between numpad and extended version of the keys, extended is assumed by
// default if lParam == 0.
//
// Returns WXK_NONE if translation couldn't be done at all (this happens e.g.
// for dead keys and in this case uc will be WXK_NONE too) or if the key
// corresponds to a non-Latin-1 character in which case uc is filled with its
// Unicode value.
WXDLLIMPEXP_CORE int VKToWX(WXWORD vk, WXLPARAM lParam = 0, wchar_t *uc = NULL);
// Translate wxKeyCode enum element (passed as int for compatibility reasons)
// to MSW virtual key code. isExtended is set to true if the key corresponds to
// a non-numpad version of a key that exists both on numpad and outside it.
WXDLLIMPEXP_CORE WXWORD WXToVK(int id, bool *isExtended = NULL);
} // namespace wxMSWKeyboard
#endif // _WX_MSW_PRIVATE_KEYBOARD_H_

View File

@ -0,0 +1,49 @@
///////////////////////////////////////////////////////////////////////////////
// Name: wx/msw/private/metrics.h
// Purpose: various helper functions to retrieve system metrics
// Author: Vadim Zeitlin
// Created: 2008-09-05
// RCS-ID: $Id: metrics.h 61508 2009-07-23 20:30:22Z VZ $
// Copyright: (c) 2008 Vadim Zeitlin <vadim@wxwidgets.org>
// Licence: wxWindows licence
///////////////////////////////////////////////////////////////////////////////
#ifndef _WX_MSW_PRIVATE_METRICS_H_
#define _WX_MSW_PRIVATE_METRICS_H_
namespace wxMSWImpl
{
// return NONCLIENTMETRICS as retrieved by SystemParametersInfo()
//
// currently this is not cached as the values may change when system settings
// do and we don't react to this to invalidate the cache but it could be done
// in the future
//
// MT-safety: this function is only meant to be called from the main thread
inline const NONCLIENTMETRICS& GetNonClientMetrics()
{
static WinStruct<NONCLIENTMETRICS> nm;
if ( !::SystemParametersInfo(SPI_GETNONCLIENTMETRICS, 0, &nm, 0) )
{
#if WINVER >= 0x0600
// a new field has been added to NONCLIENTMETRICS under Vista, so
// the call to SystemParametersInfo() fails if we use the struct
// size incorporating this new value on an older system -- retry
// without it
nm.cbSize -= sizeof(int);
if ( !::SystemParametersInfo(SPI_GETNONCLIENTMETRICS, 0, &nm, 0) )
#endif // WINVER >= 0x0600
{
// maybe we should initialize the struct with some defaults?
wxLogLastError(wxT("SystemParametersInfo(SPI_GETNONCLIENTMETRICS)"));
}
}
return nm;
}
} // namespace wxMSWImpl
#endif // _WX_MSW_PRIVATE_METRICS_H_

View File

@ -0,0 +1,91 @@
///////////////////////////////////////////////////////////////////////////////
// Name: wx/msw/private/msgdlg.h
// Purpose: helper functions used with native message dialog
// Author: Rickard Westerlund
// Created: 2010-07-12
// RCS-ID: $Id: msgdlg.h 65348 2010-08-18 22:48:28Z VZ $
// Copyright: (c) 2010 wxWidgets team
// Licence: wxWindows licence
///////////////////////////////////////////////////////////////////////////////
#ifndef _WX_MSW_PRIVATE_MSGDLG_H_
#define _WX_MSW_PRIVATE_MSGDLG_H_
#include "wx/msw/wrapcctl.h"
#include "wx/scopedarray.h"
// Macro to help identify if task dialogs are available: we rely on
// TD_WARNING_ICON being defined in the headers for this as this symbol is used
// by the task dialogs only. Also notice that task dialogs are available for
// Unicode applications only.
#if defined(TD_WARNING_ICON) && wxUSE_UNICODE
#define wxHAS_MSW_TASKDIALOG
#endif
// Provides methods for creating a task dialog.
namespace wxMSWMessageDialog
{
#ifdef wxHAS_MSW_TASKDIALOG
class wxMSWTaskDialogConfig
{
public:
wxMSWTaskDialogConfig()
: buttons(new TASKDIALOG_BUTTON[3]),
parent(NULL),
iconId(0),
style(0),
useCustomLabels(false)
{ }
// initializes the object from a message dialog.
wxMSWTaskDialogConfig(const wxMessageDialogBase& dlg);
wxScopedArray<TASKDIALOG_BUTTON> buttons;
wxWindow *parent;
wxString caption;
wxString message;
wxString extendedMessage;
long iconId;
long style;
bool useCustomLabels;
wxString btnYesLabel;
wxString btnNoLabel;
wxString btnOKLabel;
wxString btnCancelLabel;
// Will create a task dialog with it's paremeters for it's creation
// stored in the provided TASKDIALOGCONFIG parameter.
// NOTE: The wxMSWTaskDialogConfig object needs to remain accessible
// during the subsequent call to TaskDialogIndirect().
void MSWCommonTaskDialogInit(TASKDIALOGCONFIG &tdc);
// Used by MSWCommonTaskDialogInit() to add a regular button or a
// button with a custom label if used.
void AddTaskDialogButton(TASKDIALOGCONFIG &tdc,
int btnCustomId,
int btnCommonId,
const wxString& customLabel);
}; // class wxMSWTaskDialogConfig
typedef HRESULT (WINAPI *TaskDialogIndirect_t)(const TASKDIALOGCONFIG *,
int *, int *, BOOL *);
// Return the pointer to TaskDialogIndirect(). This should only be called
// if HasNativeTaskDialog() returned true and is normally guaranteed to
// succeed in this case.
TaskDialogIndirect_t GetTaskDialogIndirectFunc();
#endif // wxHAS_MSW_TASKDIALOG
// Check if the task dialog is available: this simply checks the OS version
// as we know that it's only present in Vista and later.
bool HasNativeTaskDialog();
// Translates standard MSW button IDs like IDCANCEL into an equivalent
// wx constant such as wxCANCEL.
int MSWTranslateReturnCode(int msAns);
}; // namespace wxMSWMessageDialog
#endif // _WX_MSW_PRIVATE_MSGDLG_H_

View File

@ -0,0 +1,67 @@
/////////////////////////////////////////////////////////////////////////////
// Name: wx/msw/private/gsockmsw.h
// Purpose: MSW-specific socket implementation
// Authors: Guilhem Lavaux, Guillermo Rodriguez Garcia, Vadim Zeitlin
// Created: April 1997
// Copyright: (C) 1999-1997, Guilhem Lavaux
// (C) 1999-2000, Guillermo Rodriguez Garcia
// (C) 2008 Vadim Zeitlin
// RCS_ID: $Id: sockmsw.h 67254 2011-03-20 00:14:35Z DS $
// Licence: wxWindows licence
/////////////////////////////////////////////////////////////////////////////
#ifndef _WX_MSW_GSOCKMSW_H_
#define _WX_MSW_GSOCKMSW_H_
#include "wx/msw/wrapwin.h"
#if defined(__CYGWIN__)
//CYGWIN gives annoying warning about runtime stuff if we don't do this
# define USE_SYS_TYPES_FD_SET
# include <sys/types.h>
#endif
#if defined(__WXWINCE__) || defined(__CYGWIN__)
#include <winsock.h>
#endif
// ----------------------------------------------------------------------------
// MSW-specific socket implementation
// ----------------------------------------------------------------------------
class wxSocketImplMSW : public wxSocketImpl
{
public:
wxSocketImplMSW(wxSocketBase& wxsocket);
virtual ~wxSocketImplMSW();
virtual wxSocketError GetLastError() const;
virtual void ReenableEvents(wxSocketEventFlags WXUNUSED(flags))
{
// notifications are never disabled in this implementation, there is no
// need for this as WSAAsyncSelect() only sends notification once when
// the new data becomes available anyhow, so there is no need to do
// anything here
}
private:
virtual void DoClose();
virtual void UnblockAndRegisterWithEventLoop()
{
// no need to make the socket non-blocking, Install_Callback() will do
// it
wxSocketManager::Get()->Install_Callback(this);
}
int m_msgnumber;
friend class wxSocketMSWManager;
wxDECLARE_NO_COPY_CLASS(wxSocketImplMSW);
};
#endif /* _WX_MSW_GSOCKMSW_H_ */

View File

@ -0,0 +1,37 @@
/////////////////////////////////////////////////////////////////////////////
// Name: wx/msw/private/timer.h
// Purpose: wxTimer class
// Author: Julian Smart
// Created: 01/02/97
// RCS-ID: $Id: timer.h 63486 2010-02-15 17:34:21Z RD $
// Copyright: (c) Julian Smart
// Licence: wxWindows licence
/////////////////////////////////////////////////////////////////////////////
#ifndef _WX_MSW_PRIVATE_TIMER_H_
#define _WX_MSW_PRIVATE_TIMER_H_
#if wxUSE_TIMER
#include "wx/private/timer.h"
#include "wx/msw/wrapwin.h" // for WPARAM
class WXDLLIMPEXP_BASE wxMSWTimerImpl : public wxTimerImpl
{
public:
wxMSWTimerImpl(wxTimer *timer) : wxTimerImpl(timer) { m_id = 0; };
virtual bool Start(int milliseconds = -1, bool oneShot = false);
virtual void Stop();
virtual bool IsRunning() const { return m_id != 0; }
protected:
// this must be 64 bit under Win64 as WPARAM (storing timer ids) is 64 bit
// there and so the ids may possibly not fit in 32 bits
WPARAM m_id;
};
#endif // wxUSE_TIMER
#endif // _WX_TIMERH_