X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/c058cafa56179e79df02ad370bdeafd725ff2478..66c2bf7b1d9326fb650acfaae22ec50528cfbf7c:/include/wx/power.h diff --git a/include/wx/power.h b/include/wx/power.h index f1a23b9fe2..17e81b6efb 100644 --- a/include/wx/power.h +++ b/include/wx/power.h @@ -4,7 +4,6 @@ // Author: Vadim Zeitlin // Modified by: // Created: 2006-05-27 -// RCS-ID: $Id$ // Copyright: (c) 2006 Vadim Zeitlin // Licence: wxWindows licence /////////////////////////////////////////////////////////////////////////////// @@ -42,13 +41,16 @@ enum wxBatteryState // compiling in the code for handling them which is never going to be invoked // under the other platforms, we define wxHAS_POWER_EVENTS symbol if this event // is available, it should be used to guard all code using wxPowerEvent -#ifdef __WXMSW__ +#ifdef __WINDOWS__ #define wxHAS_POWER_EVENTS class WXDLLIMPEXP_BASE wxPowerEvent : public wxEvent { public: + wxPowerEvent() // just for use by wxRTTI + : m_veto(false) { } + wxPowerEvent(wxEventType evtType) : wxEvent(wxID_NONE, evtType) { m_veto = false; @@ -67,19 +69,18 @@ public: private: bool m_veto; - DECLARE_ABSTRACT_CLASS(wxPowerEvent) + DECLARE_DYNAMIC_CLASS_NO_ASSIGN(wxPowerEvent) }; -extern WXDLLIMPEXP_BASE const wxEventType wxEVT_POWER_SUSPENDING; -extern WXDLLIMPEXP_BASE const wxEventType wxEVT_POWER_SUSPENDED; -extern WXDLLIMPEXP_BASE const wxEventType wxEVT_POWER_SUSPEND_CANCEL; -extern WXDLLIMPEXP_BASE const wxEventType wxEVT_POWER_RESUME; +wxDECLARE_EXPORTED_EVENT( WXDLLIMPEXP_BASE, wxEVT_POWER_SUSPENDING, wxPowerEvent ); +wxDECLARE_EXPORTED_EVENT( WXDLLIMPEXP_BASE, wxEVT_POWER_SUSPENDED, wxPowerEvent ); +wxDECLARE_EXPORTED_EVENT( WXDLLIMPEXP_BASE, wxEVT_POWER_SUSPEND_CANCEL, wxPowerEvent ); +wxDECLARE_EXPORTED_EVENT( WXDLLIMPEXP_BASE, wxEVT_POWER_RESUME, wxPowerEvent ); typedef void (wxEvtHandler::*wxPowerEventFunction)(wxPowerEvent&); #define wxPowerEventHandler(func) \ - (wxObjectEventFunction)(wxEventFunction) \ - wxStaticCastEvent(wxPowerEventFunction, &func) + wxEVENT_HANDLER_CAST(wxPowerEventFunction, func) #define EVT_POWER_SUSPENDING(func) \ wx__DECLARE_EVT0(wxEVT_POWER_SUSPENDING, wxPowerEventHandler(func))