X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/355debca0650f70aa8ed4803b2ebc45541e03d9f..438959cca892a7651634cc3a7aad4819ac49b23c:/include/wx/power.h?ds=sidebyside diff --git a/include/wx/power.h b/include/wx/power.h index e70fb6c215..e55cd60bcc 100644 --- a/include/wx/power.h +++ b/include/wx/power.h @@ -1,5 +1,5 @@ /////////////////////////////////////////////////////////////////////////////// -// Name: wx/include/wx/power.h +// Name: wx/power.h // Purpose: functions and classes for system power management // Author: Vadim Zeitlin // Modified by: @@ -42,13 +42,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; @@ -66,20 +69,19 @@ public: private: bool m_veto; + + DECLARE_DYNAMIC_CLASS_NO_ASSIGN(wxPowerEvent) }; -BEGIN_DECLARE_EVENT_TYPES() - DECLARE_EVENT_TYPE(wxEVT_POWER_SUSPENDING, 406) - DECLARE_EVENT_TYPE(wxEVT_POWER_SUSPENDED, 407) - DECLARE_EVENT_TYPE(wxEVT_POWER_SUSPEND_CANCEL, 408) - DECLARE_EVENT_TYPE(wxEVT_POWER_RESUME, 444) -END_DECLARE_EVENT_TYPES() +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)) @@ -105,4 +107,3 @@ WXDLLIMPEXP_BASE wxPowerType wxGetPowerType(); WXDLLIMPEXP_BASE wxBatteryState wxGetBatteryState(); #endif // _WX_POWER_H_ -