📄 classwgui_1_1capplication.html
字号:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"><html><head><meta http-equiv="Content-Type" content="text/html;charset=iso-8859-1"><title>wGui::CApplication class Reference</title><link href="doxygen.css" rel="stylesheet" type="text/css"></head><body><!-- Generated by Doxygen 1.2.18 --><center><a class="qindex" href="index.html">Main Page</a> <a class="qindex" href="hierarchy.html">Class Hierarchy</a> <a class="qindex" href="classes.html">Alphabetical List</a> <a class="qindex" href="annotated.html">Data Structures</a> <a class="qindex" href="files.html">File List</a> <a class="qindex" href="functions.html">Data Fields</a> </center><hr><h1>wGui::CApplication Class Reference</h1>A class for encapsulating an application. <a href="#_details">More...</a><p><code>#include <<a class="el" href="wg__application_8h-source.html">wg_application.h</a>></code><p><p>Inheritance diagram for wGui::CApplication:<p><center><img src="classwGui_1_1CApplication.png" usemap="#wGui::CApplication_map" border="0" alt=""></center><map name="wGui::CApplication_map"><area href="classwGui_1_1CMessageClient.html" alt="wGui::CMessageClient" shape="rect" coords="0,0,138,24"></map><h2>Public Methods</h2><ul><li><a class="el" href="classwGui_1_1CApplication.html#a0">CApplication</a> (int argc, char **argv, std::string sFontFileName="Vera.ttf", bool bHandleExceptionsInternally=true)<li><a name="a1" doxytag="wGui::CApplication::~CApplication"></a>virtual <a class="el" href="classwGui_1_1CApplication.html#a1">~CApplication</a> (void)<dl class="el"><dd><font size=-1><em>Standard destructor.<br><br></em></font></dl><li><a name="a2" doxytag="wGui::CApplication::GetDefaultFontFileName"></a>virtual const std::string & <a class="el" href="classwGui_1_1CApplication.html#a2">GetDefaultFontFileName</a> (void) const<dl class="el"><dd><font size=-1><em><dl compact><dt><b>Returns: </b></dt><dd>The default font</dl><br><br></em></font></dl><li><a name="a3" doxytag="wGui::CApplication::ExitCode"></a>virtual int <a class="el" href="classwGui_1_1CApplication.html#a3">ExitCode</a> (void) const<dl class="el"><dd><font size=-1><em><dl compact><dt><b>Returns: </b></dt><dd>The exit code of the app</dl><br><br></em></font></dl><li><a name="a4" doxytag="wGui::CApplication::IsRunning"></a>virtual bool <a class="el" href="classwGui_1_1CApplication.html#a4">IsRunning</a> (void) const<dl class="el"><dd><font size=-1><em><dl compact><dt><b>Returns: </b></dt><dd>true while the application is in it's message loop</dl><br><br></em></font></dl><li><a name="a5" doxytag="wGui::CApplication::HandleExceptions"></a>virtual bool <a class="el" href="classwGui_1_1CApplication.html#a5">HandleExceptions</a> (void) const<dl class="el"><dd><font size=-1><em><dl compact><dt><b>Returns: </b></dt><dd>true if wGui should handle it's own exceptions</dl><br><br></em></font></dl><li>virtual void <a class="el" href="classwGui_1_1CApplication.html#a6">SetKeyFocus</a> (<a class="el" href="classwGui_1_1CWindow.html">CWindow</a> *pWindow)<li><a name="a7" doxytag="wGui::CApplication::GetKeyFocus"></a>virtual <a class="el" href="classwGui_1_1CWindow.html">CWindow</a> * <a class="el" href="classwGui_1_1CApplication.html#a7">GetKeyFocus</a> (void) const<dl class="el"><dd><font size=-1><em><dl compact><dt><b>Returns: </b></dt><dd>A pointer to the window with keyboard focus</dl><br><br></em></font></dl><li>virtual void <a class="el" href="classwGui_1_1CApplication.html#a8">SetMouseFocus</a> (<a class="el" href="classwGui_1_1CWindow.html">CWindow</a> *pWindow)<li><a name="a9" doxytag="wGui::CApplication::GetMouseFocus"></a>virtual <a class="el" href="classwGui_1_1CWindow.html">CWindow</a> * <a class="el" href="classwGui_1_1CApplication.html#a9">GetMouseFocus</a> (void) const<dl class="el"><dd><font size=-1><em><dl compact><dt><b>Returns: </b></dt><dd>A pointer to the window with mouse focus ( grab )</dl><br><br></em></font></dl><li>virtual void <a class="el" href="classwGui_1_1CApplication.html#a10">Init</a> (void)<li><a name="a11" doxytag="wGui::CApplication::Exec"></a>virtual void <a class="el" href="classwGui_1_1CApplication.html#a11">Exec</a> (void)<dl class="el"><dd><font size=-1><em>The primary message loop.<br><br></em></font></dl><li>virtual void <a class="el" href="classwGui_1_1CApplication.html#a12">ApplicationExit</a> (int iExitCode=EXIT_SUCCESS)<li>virtual <a class="el" href="classwGui_1_1CFontEngine.html">CFontEngine</a> * <a class="el" href="classwGui_1_1CApplication.html#a13">GetFontEngine</a> (std::string sFontFileName, unsigned char iFontSize=12)<li>virtual void <a class="el" href="classwGui_1_1CApplication.html#a14">SetDefaultFontEngine</a> (<a class="el" href="classwGui_1_1CFontEngine.html">CFontEngine</a> *pFontEngine)<li><a name="a15" doxytag="wGui::CApplication::GetDefaultFontEngine"></a>virtual <a class="el" href="classwGui_1_1CFontEngine.html">CFontEngine</a> * <a class="el" href="classwGui_1_1CApplication.html#a15">GetDefaultFontEngine</a> (void) const<dl class="el"><dd><font size=-1><em><dl compact><dt><b>Returns: </b></dt><dd>A pointer to the default font engine</dl><br><br></em></font></dl><li>virtual void <a class="el" href="classwGui_1_1CApplication.html#a16">EnableResourcePool</a> (bool bEnable)<li>virtual bool <a class="el" href="classwGui_1_1CApplication.html#a17">AddToResourcePool</a> (<a class="el" href="classwGui_1_1CResourceHandle.html">CResourceHandle</a> &ResourceHandle)<li>virtual void <a class="el" href="classwGui_1_1CApplication.html#a18">SetMouseCursor</a> (<a class="el" href="classwGui_1_1CCursorResourceHandle.html">CCursorResourceHandle</a> *pCursorResourceHandle=0)<li>virtual const <a class="el" href="classwGui_1_1CConfigStore.html">CConfigStore</a> & <a class="el" href="classwGui_1_1CApplication.html#a19">GetGlobalConfig</a> (void)<li>virtual bool <a class="el" href="classwGui_1_1CApplication.html#a20">HandleMessage</a> (<a class="el" href="classwGui_1_1CMessage.html">CMessage</a> *pMessage)</ul><h2>Static Public Methods</h2><ul><li><a name="d0" doxytag="wGui::CApplication::Instance"></a>CApplication * <a class="el" href="classwGui_1_1CApplication.html#d0">Instance</a> (void)<dl class="el"><dd><font size=-1><em><dl compact><dt><b>Returns: </b></dt><dd>A pointer to the one instance of the Application</dl><br><br></em></font></dl></ul><h2>Protected Methods</h2><ul><li>virtual void <a class="el" href="classwGui_1_1CApplication.html#b0">HandleSDLEvent</a> (SDL_Event event)</ul><h2>Protected Attributes</h2><ul><li><a name="n0" doxytag="wGui::CApplication::m_argc"></a>int <a class="el" href="classwGui_1_1CApplication.html#n0">m_argc</a><dl class="el"><dd><font size=-1><em>The argument count from the command line.<br><br></em></font></dl><li><a name="n1" doxytag="wGui::CApplication::m_argv"></a>char ** <a class="el" href="classwGui_1_1CApplication.html#n1">m_argv</a><dl class="el"><dd><font size=-1><em>The argument array from the command line.<br><br></em></font></dl><li><a name="n2" doxytag="wGui::CApplication::m_sFontFileName"></a>std::string <a class="el" href="classwGui_1_1CApplication.html#n2">m_sFontFileName</a><dl class="el"><dd><font size=-1><em>The font to use for all controls.<br><br></em></font></dl><li><a name="n3" doxytag="wGui::CApplication::m_iExitCode"></a>int <a class="el" href="classwGui_1_1CApplication.html#n3">m_iExitCode</a><dl class="el"><dd><font size=-1><em>The exit code to be returned when the app exits.<br><br></em></font></dl><li><a name="n4" doxytag="wGui::CApplication::m_bRunning"></a>bool <a class="el" href="classwGui_1_1CApplication.html#n4">m_bRunning</a><dl class="el"><dd><font size=-1><em>Indicates if the app is currently spinning in the message loop.<br><br></em></font></dl><li><a name="n5" doxytag="wGui::CApplication::m_bInited"></a>bool <a class="el" href="classwGui_1_1CApplication.html#n5">m_bInited</a><dl class="el"><dd><font size=-1><em>true if <a class="el" href="classwGui_1_1CApplication.html#a10">Init()</a> has been called<br><br></em></font></dl><li><a name="n6" doxytag="wGui::CApplication::m_pKeyFocusWindow"></a><a class="el" href="classwGui_1_1CWindow.html">CWindow</a> * <a class="el" href="classwGui_1_1CApplication.html#n6">m_pKeyFocusWindow</a><dl class="el"><dd><font size=-1><em>A pointer to the window with keyboard focus.<br><br></em></font></dl><li><a name="n7" doxytag="wGui::CApplication::m_pMouseFocusWindow"></a><a class="el" href="classwGui_1_1CWindow.html">CWindow</a> * <a class="el" href="classwGui_1_1CApplication.html#n7">m_pMouseFocusWindow</a><dl class="el"><dd><font size=-1><em>A pointer to the window with mouse focus.<br><br></em></font></dl><li><a name="n8" doxytag="wGui::CApplication::m_FontEngines"></a>t_FontEngineMap <a class="el" href="classwGui_1_1CApplication.html#n8">m_FontEngines</a><dl class="el"><dd><font size=-1><em>A map of font engine pointers.<br><br></em></font></dl><li><a name="n9" doxytag="wGui::CApplication::m_pDefaultFontEngine"></a><a class="el" href="classwGui_1_1CFontEngine.html">CFontEngine</a> * <a class="el" href="classwGui_1_1CApplication.html#n9">m_pDefaultFontEngine</a><dl class="el"><dd><font size=-1><em>A pointer to the default font engine.<br><br></em></font></dl><li><a name="n10" doxytag="wGui::CApplication::m_bHandleExceptionsInternally"></a>bool <a class="el" href="classwGui_1_1CApplication.html#n10">m_bHandleExceptionsInternally</a><dl class="el"><dd><font size=-1><em>If true, wGui will handle most exceptions itself.<br><br></em></font></dl><li><a name="n11" doxytag="wGui::CApplication::m_bResourcePoolEnabled"></a>bool <a class="el" href="classwGui_1_1CApplication.html#n11">m_bResourcePoolEnabled</a><dl class="el"><dd><font size=-1><em>If true, wGui provided resources will be added to the resource pool as they are created, defaults to true.<br><br></em></font></dl><li><a name="n12" doxytag="wGui::CApplication::m_ResourceHandlePool"></a>std::list< <a class="el" href="classwGui_1_1CResourceHandle.html">CResourceHandle</a> > <a class="el" href="classwGui_1_1CApplication.html#n12">m_ResourceHandlePool</a><dl class="el"><dd><font size=-1><em>The resource handle pool which keeps commonly used resources alive.<br><br></em></font></dl><li><a name="n13" doxytag="wGui::CApplication::m_pCurrentCursorResourceHandle"></a>std::auto_ptr< <a class="el" href="classwGui_1_1CCursorResourceHandle.html">CCursorResourceHandle</a> > <a class="el" href="classwGui_1_1CApplication.html#n13">m_pCurrentCursorResourceHandle</a><dl class="el"><dd><font size=-1><em>An autopointer to the handle for the current mouse cursor.<br><br></em></font></dl><li><a name="n14" doxytag="wGui::CApplication::m_pSystemDefaultCursor"></a>SDL_Cursor * <a class="el" href="classwGui_1_1CApplication.html#n14">m_pSystemDefaultCursor</a><dl class="el"><dd><font size=-1><em>A pointer to the default system cursor.<br><br></em></font></dl><li><a name="n15" doxytag="wGui::CApplication::m_GlobalConfig"></a><a class="el" href="classwGui_1_1CConfigStore.html">CConfigStore</a> <a class="el" href="classwGui_1_1CApplication.html#n15">m_GlobalConfig</a><dl class="el"><dd><font size=-1><em>A <a class="el" href="classwGui_1_1CConfigStore.html">CConfigStore</a> object that has the Global configuration.<br><br></em></font></dl></ul><h2>Static Protected Attributes</h2><ul><li><a name="q0" doxytag="wGui::CApplication::m_pInstance"></a>CApplication * <a class="el" href="classwGui_1_1CApplication.html#q0">m_pInstance</a> = 0<dl class="el"><dd><font size=-1><em>A pointer to the one valid instance of the application.<br><br></em></font></dl></ul><hr><a name="_details"></a><h2>Detailed Description</h2>A class for encapsulating an application.<p><a class="el" href="classwGui_1_1CApplication.html">CApplication</a> is a singleton (only one instance of it should ever exist) This handles all global level stuff like initializing SDL and creating a MessageServer <a class="el" href="classwGui_1_1CApplication.html">CApplication</a> also takes care of turning SDL events into wGui messages <p><p>Definition at line <a class="el" href="wg__application_8h-source.html#l00051">51</a> of file <a class="el" href="wg__application_8h-source.html">wg_application.h</a>.<hr><h2>Constructor & Destructor Documentation</h2><a name="a0" doxytag="wGui::CApplication::CApplication"></a><p><table width="100%" cellpadding="2" cellspacing="0" border="0"> <tr> <td class="md"> <table cellpadding="0" cellspacing="0" border="0"> <tr> <td class="md" nowrap valign="top"> wGui::CApplication::CApplication </td> <td class="md" valign="top">( </td> <td class="md" nowrap valign="top">int </td> <td class="mdname" nowrap> <em>argc</em>, </td> </tr> <tr> <td></td> <td></td> <td class="md" nowrap>char ** </td> <td class="mdname" nowrap> <em>argv</em>, </td> </tr> <tr> <td></td> <td></td> <td class="md" nowrap>std::string </td> <td class="mdname" nowrap> <em>sFontFileName</em> = "Vera.ttf", </td> </tr> <tr> <td></td> <td></td> <td class="md" nowrap>bool </td> <td class="mdname" nowrap> <em>bHandleExceptionsInternally</em> = true</td> </tr> <tr> <td></td> <td class="md">) </td> <td class="md" colspan="2"></td> </tr> </table> </td> </tr></table><table cellspacing=5 cellpadding=0 border=0> <tr> <td> </td> <td><p>Standard constructor <dl compact><dt><b>Parameters: </b></dt><dd><table border=0 cellspacing=2 cellpadding=0><tr><td valign=top><em>argc</em> </td><td>The argument count from the command line </td></tr><tr><td valign=top><em>argv</em> </td><td>The argument array from the command line </td></tr><tr><td valign=top><em>sFontFileName</em> </td><td>The font to use for controls, defaults to Arial </td></tr><tr><td valign=top><em>bHandleExceptionsInternally</em> </td><td>If this is true, wGui will handle most exceptions itself, if false, all exceptions will be returned to the user (defaults to true) </td></tr></table></dl><p>Definition at line <a class="el" href="wg__application_8cpp-source.html#l00087">87</a> of file <a class="el" href="wg__application_8cpp-source.html">wg_application.cpp</a>.<p>References <a class="el" href="wg__application_8cpp-source.html#l00038">m_pInstance</a>, and <a class="el" href="wg__application_8h-source.html#l00182">m_pSystemDefaultCursor</a>. </td> </tr></table><hr><h2>Member Function Documentation</h2><a name="a17" doxytag="wGui::CApplication::AddToResourcePool"></a><p><table width="100%" cellpadding="2" cellspacing="0" border="0"> <tr> <td class="md"> <table cellpadding="0" cellspacing="0" border="0"> <tr> <td class="md" nowrap valign="top"> bool wGui::CApplication::AddToResourcePool </td> <td class="md" valign="top">( </td> <td class="md" nowrap valign="top"><a class="el" href="classwGui_1_1CResourceHandle.html">CResourceHandle</a> & </td> <td class="mdname1" valign="top" nowrap> <em>ResourceHandle</em> </td> <td class="md" valign="top">) </td> <td class="md" nowrap><code> [virtual]</code></td> </tr> </table> </td> </tr></table><table cellspacing=5 cellpadding=0 border=0> <tr> <td> </td> <td><p>Adds a resource handle to the resource pool if the pool is enabled Once a resource is added, the only way to remove it, is to disabled the resource pool (via <a class="el" href="classwGui_1_1CApplication.html#a16">EnableResourcePool()</a> ) which will empty the pool of all resources <dl compact><dt><b>Parameters: </b></dt><dd><table border=0 cellspacing=2 cellpadding=0><tr><td valign=top><em>ResourceHandle</em> </td><td>The resource handle to copy into the pool </td></tr></table></dl><dl compact><dt><b>Returns: </b></dt><dd>false if the resource pool is disabled </dl><p>Definition at line <a class="el" href="wg__application_8cpp-source.html#l00364">364</a> of file <a class="el" href="wg__application_8cpp-source.html">wg_application.cpp</a>.
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -