Simple wxBatteryPower API for the support in wxWinCE, wxPalmOS and any other mobile device with wxWidgets. Minor source cleaning.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@31515 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -36,6 +36,7 @@ All:
|
||||
- The samples\db sample program now includes an optional example of using a BLOB
|
||||
datatype (if BLOB support is enabled and supported by the database)
|
||||
- added wxDynamicLibrary::ListLoaded()
|
||||
- wxGetPowerType() and wxGetBatteryState() addition
|
||||
|
||||
All (GUI):
|
||||
|
||||
|
@@ -96,6 +96,7 @@ the corresponding topic.
|
||||
\helpref{wxFinite}{wxfinite}\\
|
||||
\helpref{wxGetActiveWindow}{wxgetactivewindow}\\
|
||||
\helpref{wxGetApp}{wxgetapp}\\
|
||||
\helpref{wxGetBatteryState}{wxgetbatterystate}\\
|
||||
\helpref{wxGetClipboardData}{wxgetclipboarddata}\\
|
||||
\helpref{wxGetClipboardFormatName}{wxgetclipboardformatname}\\
|
||||
\helpref{wxGetColourFromUser}{wxgetcolourfromuser}\\
|
||||
@@ -123,6 +124,7 @@ the corresponding topic.
|
||||
\helpref{wxGetOsDescription}{wxgetosdescription}\\
|
||||
\helpref{wxGetOsVersion}{wxgetosversion}\\
|
||||
\helpref{wxGetPasswordFromUser}{wxgetpasswordfromuser}\\
|
||||
\helpref{wxGetPowerType}{wxgetpowertype}\\
|
||||
\helpref{wxGetPrinterCommand}{wxgetprintercommand}\\
|
||||
\helpref{wxGetPrinterFile}{wxgetprinterfile}\\
|
||||
\helpref{wxGetPrinterMode}{wxgetprintermode}\\
|
||||
@@ -974,7 +976,7 @@ For example:
|
||||
|
||||
\begin{verbatim}
|
||||
wxString f = wxFindFirstFile("/home/project/*.*");
|
||||
while ( !f.IsEmpty() )
|
||||
while ( !f.empty() )
|
||||
{
|
||||
...
|
||||
f = wxFindNextFile();
|
||||
@@ -2823,6 +2825,21 @@ Gets the currently active window (Windows only).
|
||||
<wx/windows.h>
|
||||
|
||||
|
||||
\membersection{::wxGetBatteryState}\label{wxgetbatterystate}
|
||||
|
||||
\func{wxBatteryState}{wxGetBatteryState}{\void}
|
||||
|
||||
Returns battery state as one of \texttt{wxBATTERY_NORMAL_STATE},
|
||||
\texttt{wxBATTERY_LOW_STATE}, \texttt{wxBATTERY_CRITICAL_STATE},
|
||||
\texttt{wxBATTERY_SHUTDOWN_STATE} or \texttt{wxBATTERY_UNKNOWN_STATE}.
|
||||
\texttt{wxBATTERY_UNKNOWN_STATE} is also the default on platforms where
|
||||
this feature is not implemented.
|
||||
|
||||
\wxheading{Include files}
|
||||
|
||||
<wx/utils.h>
|
||||
|
||||
|
||||
\membersection{::wxGetDisplayName}\label{wxgetdisplayname}
|
||||
|
||||
\func{wxString}{wxGetDisplayName}{\void}
|
||||
@@ -2834,6 +2851,20 @@ Under X only, returns the current display name. See also \helpref{wxSetDisplayNa
|
||||
<wx/utils.h>
|
||||
|
||||
|
||||
\membersection{::wxGetPowerType}\label{wxgetpowertype}
|
||||
|
||||
\func{wxPowerType}{wxGetPowerType}{\void}
|
||||
|
||||
Returns the type of power source as one of \texttt{wxPOWER_SOCKET},
|
||||
\texttt{wxPOWER_BATTERY} or \texttt{wxPOWER_UNKNOWN}.
|
||||
\texttt{wxPOWER_UNKNOWN} is also the default on platforms where this
|
||||
feature is not implemented.
|
||||
|
||||
\wxheading{Include files}
|
||||
|
||||
<wx/utils.h>
|
||||
|
||||
|
||||
\membersection{::wxGetMousePosition}\label{wxgetmouseposition}
|
||||
|
||||
\func{wxPoint}{wxGetMousePosition}{\void}
|
||||
|
@@ -262,6 +262,26 @@ enum wxShutdownFlags
|
||||
// Shutdown or reboot the PC
|
||||
WXDLLIMPEXP_BASE bool wxShutdown(wxShutdownFlags wFlags);
|
||||
|
||||
enum wxPowerType
|
||||
{
|
||||
wxPOWER_SOCKET,
|
||||
wxPOWER_BATTERY,
|
||||
wxPOWER_UNKNOWN
|
||||
};
|
||||
|
||||
WXDLLIMPEXP_BASE wxPowerType wxGetPowerType();
|
||||
|
||||
enum wxBatteryState
|
||||
{
|
||||
wxBATTERY_NORMAL_STATE, // system is fully usable
|
||||
wxBATTERY_LOW_STATE, // start to worry
|
||||
wxBATTERY_CRITICAL_STATE, // save quickly
|
||||
wxBATTERY_SHUTDOWN_STATE, // too late
|
||||
wxBATTERY_UNKNOWN_STATE
|
||||
};
|
||||
|
||||
WXDLLIMPEXP_BASE wxBatteryState wxGetBatteryState();
|
||||
|
||||
// send the given signal to the process (only NONE and KILL are supported under
|
||||
// Windows, all others mean TERM), return 0 if ok and -1 on error
|
||||
//
|
||||
|
@@ -336,6 +336,18 @@ bool wxShutdown(wxShutdownFlags wFlags)
|
||||
return false;
|
||||
}
|
||||
|
||||
wxPowerType wxGetPowerType()
|
||||
{
|
||||
// TODO
|
||||
return wxPOWER_UNKNOWN;
|
||||
}
|
||||
|
||||
wxBatteryState wxGetBatteryState()
|
||||
{
|
||||
// TODO
|
||||
return wxBATTERY_UNKNOWN_STATE;
|
||||
}
|
||||
|
||||
// Get free memory in bytes, or -1 if cannot determine amount (e.g. on UNIX)
|
||||
wxMemorySize wxGetFreeMemory()
|
||||
{
|
||||
|
@@ -190,6 +190,18 @@ bool wxShutdown(wxShutdownFlags wFlags)
|
||||
return false;
|
||||
}
|
||||
|
||||
wxPowerType wxGetPowerType()
|
||||
{
|
||||
// TODO
|
||||
return wxPOWER_UNKNOWN;
|
||||
}
|
||||
|
||||
wxBatteryState wxGetBatteryState()
|
||||
{
|
||||
// TODO
|
||||
return wxBATTERY_UNKNOWN_STATE;
|
||||
}
|
||||
|
||||
// Get free memory in bytes, or -1 if cannot determine amount (e.g. on UNIX)
|
||||
wxMemorySize wxGetFreeMemory()
|
||||
{
|
||||
|
@@ -1007,6 +1007,18 @@ bool wxShutdown(wxShutdownFlags wFlags)
|
||||
#endif // Win32/16
|
||||
}
|
||||
|
||||
wxPowerType wxGetPowerType()
|
||||
{
|
||||
// TODO
|
||||
return wxPOWER_UNKNOWN;
|
||||
}
|
||||
|
||||
wxBatteryState wxGetBatteryState()
|
||||
{
|
||||
// TODO
|
||||
return wxBATTERY_UNKNOWN_STATE;
|
||||
}
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
// misc
|
||||
// ----------------------------------------------------------------------------
|
||||
|
@@ -204,6 +204,18 @@ bool wxShutdown(wxShutdownFlags wFlags)
|
||||
return false;
|
||||
}
|
||||
|
||||
wxPowerType wxGetPowerType()
|
||||
{
|
||||
// TODO
|
||||
return wxPOWER_UNKNOWN;
|
||||
}
|
||||
|
||||
wxBatteryState wxGetBatteryState()
|
||||
{
|
||||
// TODO
|
||||
return wxBATTERY_UNKNOWN_STATE;
|
||||
}
|
||||
|
||||
// Get free memory in bytes, or -1 if cannot determine amount (e.g. on UNIX)
|
||||
wxMemorySize wxGetFreeMemory()
|
||||
{
|
||||
|
@@ -151,6 +151,17 @@ bool wxShutdown(wxShutdownFlags wFlags)
|
||||
return false;
|
||||
}
|
||||
|
||||
wxPowerType wxGetPowerType()
|
||||
{
|
||||
return wxPOWER_BATTERY;
|
||||
}
|
||||
|
||||
wxBatteryState wxGetBatteryState()
|
||||
{
|
||||
// TODO
|
||||
return wxBATTERY_UNKNOWN_STATE;
|
||||
}
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
// misc
|
||||
// ----------------------------------------------------------------------------
|
||||
|
@@ -239,7 +239,7 @@ int wxKill(long pid, wxSignal sig, wxKillError *rc, int flags)
|
||||
|
||||
long wxExecute( const wxString& command, int flags, wxProcess *process )
|
||||
{
|
||||
wxCHECK_MSG( !command.IsEmpty(), 0, wxT("can't exec empty command") );
|
||||
wxCHECK_MSG( !command.empty(), 0, wxT("can't exec empty command") );
|
||||
|
||||
#if wxUSE_THREADS
|
||||
// fork() doesn't mix well with POSIX threads: on many systems the program
|
||||
@@ -372,6 +372,17 @@ bool wxShutdown(wxShutdownFlags wFlags)
|
||||
return system(wxString::Format(_T("init %c"), level).mb_str()) == 0;
|
||||
}
|
||||
|
||||
wxPowerType wxGetPowerType()
|
||||
{
|
||||
// TODO
|
||||
return wxPOWER_UNKNOWN;
|
||||
}
|
||||
|
||||
wxBatteryState wxGetBatteryState()
|
||||
{
|
||||
// TODO
|
||||
return wxBATTERY_UNKNOWN_STATE;
|
||||
}
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
// wxStream classes to support IO redirection in wxExecute
|
||||
@@ -660,9 +671,9 @@ long wxExecute(wxChar **argv,
|
||||
|
||||
const wxChar* wxGetHomeDir( wxString *home )
|
||||
{
|
||||
*home = wxGetUserHome( wxString() );
|
||||
*home = wxGetUserHome( wxEmptyString );
|
||||
wxString tmp;
|
||||
if ( home->IsEmpty() )
|
||||
if ( home->empty() )
|
||||
*home = wxT("/");
|
||||
#ifdef __VMS
|
||||
tmp = *home;
|
||||
|
Reference in New Issue
Block a user