soui 5.0.0.1
Soui5 Doc
 
Loading...
Searching...
No Matches
SApplication Class Reference

SOUI Application. More...

#include <SApp.h>

Inheritance diagram for SApplication:
SSingleton< SApplication > TObjRefImpl< IApplication > SResProviderMgr SObjectFactoryMgr SCmnMap< SObjectFactoryPtr, SObjectInfo >

Public Member Functions

 SApplication (IRenderFactory *pRendFactory, HINSTANCE hInst, LPCTSTR pszHostClassName=_T("SOUIHOST"), const ISystemObjectRegister &sysObjRegister=SObjectDefaultRegister(), BOOL bImeApp=FALSE)
 Constructor for SApplication.
 
 ~SApplication (void)
 Destructor for SApplication.
 
IRenderFactoryGetRenderFactory () OVERRIDE
 Get the render factory.
 
BOOL SetRenderFactory (IRenderFactory *renderFac) OVERRIDE
 Set the render factory.
 
HMODULE GetModule () SCONST OVERRIDE
 Get the module handle.
 
UINT LoadSystemNamedResource (IResProvider *pResProvider) OVERRIDE
 Load system named resources.
 
ITranslatorMgrGetTranslator () OVERRIDE
 Get the translator manager.
 
void SetTranslator (ITranslatorMgr *pTrans) OVERRIDE
 Set the translator manager.
 
IToolTipFactoryGetToolTipFactory () OVERRIDE
 Get the tooltip factory.
 
void SetToolTipFactory (IToolTipFactory *pToolTipFac) OVERRIDE
 Set the tooltip factory.
 
BOOL SetMsgLoopFactory (IMsgLoopFactory *pMsgLoopFac) OVERRIDE
 Set the message loop factory.
 
IMsgLoopFactoryGetMsgLoopFactory () OVERRIDE
 Get the message loop factory.
 
void SetLogManager (ILogMgr *pLogMgr) OVERRIDE
 Set the log manager.
 
ILogMgr * GetLogManager () OVERRIDE
 Get the log manager.
 
void SetAttrStorageFactory (IAttrStorageFactory *pAttrStorageFactory) OVERRIDE
 Set the attribute storage factory.
 
IAttrStorageFactory * GetAttrStorageFactory () OVERRIDE
 Get the attribute storage factory.
 
int Run (HWND hMainWnd) OVERRIDE
 Run the application message loop.
 
void Quit (int nCode) OVERRIDE
 Quit the application.
 
HWND GetMainWnd () OVERRIDE
 Get the main window handle.
 
BOOL AddMsgLoop (IMessageLoop *pMsgLoop, BOOL bReplace=FALSE) OVERRIDE
 Add a message loop.
 
BOOL RemoveMsgLoop () OVERRIDE
 Remove the current message loop.
 
IMessageLoopGetMsgLoop (tid_t tid=::GetCurrentThreadId()) SCONST OVERRIDE
 Get the message loop for a specific thread.
 
IResProviderMgr * GetResProviderMgr () OVERRIDE
 Get the resource provider manager.
 
IRealWndHandlerGetRealWndHander () OVERRIDE
 Get the real window handler.
 
void SetRealWndHandler (IRealWndHandler *pRealHandler) OVERRIDE
 Set the real window handler.
 
void SetScriptFactory (IScriptFactory *pScriptModule) OVERRIDE
 Set the script factory.
 
void InitXmlNamedID (const LPCWSTR *pNames, const int *nIds, int nCount) OVERRIDE
 Initialize XML named IDs from arrays.
 
IXmlDocLoadXmlDocment (LPCTSTR strResId) OVERRIDE
 Load an XML document from a resource.
 
IXmlDocLoadXmlDocmentU8 (LPCSTR strResId) OVERRIDE
 Load an XML document from a UTF-8 encoded resource.
 
IAnimation * LoadAnimation (LPCTSTR strResId) OVERRIDE
 Load an animation from a resource.
 
IAnimation * LoadAnimationU8 (LPCSTR strResId) OVERRIDE
 Load an animation from a UTF-8 encoded resource.
 
IBitmapSLoadImage (LPCTSTR strResId) OVERRIDE
 Load an image from a resource.
 
IBitmapSLoadImageU8 (LPCSTR strResId) OVERRIDE
 Load an image from a UTF-8 encoded resource.
 
IValueAnimator * LoadValueAnimator (LPCTSTR strResId) OVERRIDE
 Load a value animator from a resource.
 
IValueAnimator * LoadValueAnimatorU8 (LPCSTR strResId) OVERRIDE
 Load a value animator from a UTF-8 encoded resource.
 
ITranslatorLoadTranslator (LPCTSTR strResId) OVERRIDE
 Load a translator from a resource.
 
ITranslatorLoadTranslatorU8 (LPCSTR strResId) OVERRIDE
 Load a translator from a UTF-8 encoded resource.
 
BOOL InstallTranslator (ITranslator *trModule) OVERRIDE
 Install a translator.
 
BOOL UnnstallTranslator (REFGUID langId) OVERRIDE
 Uninstall a translator by language ID.
 
void EnableNotifyCenter (BOOL bEnable, int interval=20) OVERRIDE
 Enable or disable the notification center.
 
void * GetInnerSingleton (SingletonType nType) OVERRIDE
 Get an inner singleton.
 
IObject * CreateObject (LPCWSTR pszName, SObjectType nType) SCONST OVERRIDE
 Create an object by name and type.
 
void SetCreateObjectCallback (FunCreateObject cbCreateObj) OVERRIDE
 Set the callback for creating objects.
 
BOOL RegisterObjFactory (const IObjectFactory *objFac, BOOL bReplace=FALSE) OVERRIDE
 Register an object factory.
 
BOOL UnregisterObjFactory (const IObjectFactory *objFac) OVERRIDE
 Unregister an object factory.
 
void SetDefaultFontInfo (LPCWSTR pszFontInfo) OVERRIDE
 Set the default font information.
 
BOOL CreateTaskLoop (int nCount, Priority priority, BOOL bAutoStart=TRUE) OVERRIDE
 Create task loops.
 
ITaskLoop * GetTaskLoop (int iTaskLoop=0) OVERRIDE
 Get a task loop by index.
 
void SetCreateTaskLoopCallback (FunCrateTaskLoop cbCreateTaskLoop) OVERRIDE
 Set the callback for creating task loops.
 
HRESULT CreateScriptModule (IScriptModule **ppScriptModule) OVERRIDE
 Create a script module.
 
BOOL SetEditCtxMenuTemplateResId (LPCTSTR resId, IResProvider *pResProvider=NULL) OVERRIDE
 Set the resource ID for the edit context menu template.
 
BOOL SetMessageBoxTemplateResId (LPCTSTR resId, IResProvider *pResProvider=NULL) OVERRIDE
 Set the resource ID for the message box template.
 
void InitXmlNamedID (const SNamedID::NAMEDVALUE *pNamedValue, int nCount, BOOL bSorted)
 Initialize XML named IDs from an array of named values.
 
BOOL LoadXmlDocment (SXmlDoc &xmlDoc, const SStringT &strResId, IResProvider *pResProvider=NULL)
 Load an XML document from a resource.
 
void SetAppDir (const SStringT &strAppDir)
 Set the application directory.
 
SStringT GetAppDir () const
 Get the application directory.
 
template<class T>
BOOL RegisterWindowClass ()
 Register a window class.
 
template<class T>
BOOL UnregisterWindowClass ()
 Unregister a window class.
 
template<class T>
BOOL RegisterSkinClass ()
 Register a skin class.
 
template<class T>
BOOL UnregisterSkinClass ()
 Unregister a skin class.
 
int Str2ID (const SStringW &str)
 Convert a string to an ID.
 
SXmlNode GetMessageBoxTemplate () const
 Get the message box template XML node.
 
SXmlNode GetEditCtxMenuTemplate () const
 Get the edit context menu template XML node.
 
SStringW tr (const SStringW &strSrc, const SStringW &strCtx) const
 Translate a string with context.
 
virtual IWindow * CreateWindowByName (LPCWSTR pszWndClass) const
 Create a window by name.
 
virtual ISkinObjCreateSkinByName (LPCWSTR pszSkinClass) const
 Create a skin by name.
 
virtual IInterpolator * CreateInterpolatorByName (LPCWSTR pszName) const
 Create an interpolator by name.
 
virtual IAnimation * CreateAnimationByName (LPCWSTR pszName) const
 Create an animation by name.
 
virtual IValueAnimator * CreateValueAnimatorByName (LPCWSTR pszName) const
 Create a value animator by name.
 
- Public Member Functions inherited from SSingleton< SApplication >
 SSingleton (void)
 Constructor for SSingleton.
 
virtual ~SSingleton (void)
 Destructor for SSingleton.
 
- Public Member Functions inherited from TObjRefImpl< IApplication >
 TObjRefImpl ()
 Constructor that initializes the reference count to 1.
 
virtual ~TObjRefImpl ()
 Virtual destructor.
 
long AddRef () override
 Increments the reference count.
 
long Release () override
 Decrements the reference count and deletes the object if the count reaches zero.
 
void OnFinalRelease () override
 Deletes the object.
 
- Public Member Functions inherited from SResProviderMgr
 SResProviderMgr (void)
 Constructor.
 
 ~SResProviderMgr (void)
 Destructor.
 
void AddResProvider (IResProvider *pResProvider, LPCTSTR pszUidef=_T("uidef:xml_init")) OVERRIDE
 Adds a resource provider with a specified UI definition.
 
void AddResProviderA (IResProvider *pResProvider, LPCSTR pszUidef="uidef:xml_init") OVERRIDE
 Adds a resource provider with a specified UI definition (ANSI version).
 
void RemoveResProvider (IResProvider *pResProvider) OVERRIDE
 Removes a resource provider.
 
void RemoveAll () OVERRIDE
 Removes all resource providers.
 
IResProviderGetHeadResProvider () SCONST OVERRIDE
 Retrieves the first resource provider in the list.
 
IResProviderGetTailResProvider () SCONST OVERRIDE
 Retrieves the last resource provider in the list.
 
void SetFilePrefix (LPCTSTR pszFilePrefix) OVERRIDE
 Sets the file prefix for resource paths.
 
BOOL HasResource (LPCTSTR pszType, LPCTSTR pszResName) OVERRIDE
 Checks if a resource exists.
 
HICON LoadIcon (LPCTSTR pszResName, int cx=0, int cy=0, BOOL bFromFile=FALSE) OVERRIDE
 Loads an icon resource.
 
HCURSOR LoadCursor (LPCTSTR pszResName, BOOL bFromFile=FALSE) OVERRIDE
 Loads a cursor resource.
 
HBITMAP LoadBitmap (LPCTSTR pszResName, BOOL bFromFile=FALSE) OVERRIDE
 Loads a bitmap resource.
 
IBitmapSLoadImage (LPCTSTR pszType, LPCTSTR pszResName) OVERRIDE
 Loads an image resource as an IBitmapS object.
 
IImgXLoadImgX (LPCTSTR pszType, LPCTSTR pszResName) OVERRIDE
 Loads an image resource as an IImgX object.
 
size_t GetRawBufferSize (LPCTSTR pszType, LPCTSTR pszResName) OVERRIDE
 Retrieves the size of the raw buffer for a resource.
 
BOOL GetRawBuffer (LPCTSTR pszType, LPCTSTR pszResName, LPVOID pBuf, size_t size) OVERRIDE
 Retrieves the raw buffer for a resource.
 
IResProviderGetMatchResProvider (LPCTSTR pszType, LPCTSTR pszResName)
 Finds the resource provider that contains the specified resource type and name.
 
IBitmapSLoadImage2 (const SStringW &strImgID)
 Loads an image using a type:name formatted string.
 
HICON LoadIcon2 (const SStringW &strIconID)
 Loads an icon using a name:size formatted string.
 
BOOL LoadRawBuffer (LPCTSTR pszType, LPCTSTR pszResName, IResProvider *pResProvider, SAutoBuf &buf)
 Loads the raw buffer for a resource using a specified resource provider.
 
- Public Member Functions inherited from SObjectFactoryMgr
 SObjectFactoryMgr (void)
 Constructor for SObjectFactoryMgr.
 
BOOL RegisterFactory (const IObjectFactory *objFactory, BOOL bReplace=false)
 Registers an object factory.
 
BOOL UnregisterFactory (const SObjectInfo &objInfo)
 Unregisters an object factory.
 
void SetSwndDefAttr (IObject *pObject) const
 Sets default attributes for a given object.
 
SObjectInfo BaseObjectInfoFromObjectInfo (const SObjectInfo &objInfo)
 Gets the base object information from a given object information.
 
template<class T>
BOOL TplRegisterFactory ()
 Template method to register a factory for a specific object type.
 
template<class T>
BOOL TplUnregisterFactory ()
 Template method to unregister a factory for a specific object type.
 
- Public Member Functions inherited from SCmnMap< SObjectFactoryPtr, SObjectInfo >
 SCmnMap (void(*funOnKeyRemoved)(const SObjectFactoryPtr &)=NULL)
 Constructor.
 
virtual ~SCmnMap ()
 Destructor.
 
bool HasKey (const SObjectInfo &key) const
 Checks if a key exists in the map.
 
bool GetKeyObject (const SObjectInfo &key, SObjectFactoryPtr &obj) const
 Retrieves an object associated with a key.
 
SObjectFactoryPtr & GetKeyObject (const SObjectInfo &key) const
 Retrieves an object associated with a key.
 
bool AddKeyObject (const SObjectInfo &key, const SObjectFactoryPtr &obj)
 Adds a key-object pair to the map.
 
void SetKeyObject (const SObjectInfo &key, const SObjectFactoryPtr &obj)
 Sets an object for a key, replacing any existing object.
 
bool RemoveKeyObject (const SObjectInfo &key)
 Removes a key-object pair from the map.
 
void RemoveAll ()
 Removes all key-object pairs from the map.
 
size_t GetCount ()
 Gets the number of key-object pairs in the map.
 

Protected Types

typedef SMap< tid_t, SAutoRefPtr< IMessageLoop > > MsgLoopMap
 Map of message loops for different threads.
 
- Protected Types inherited from SResProviderMgr
typedef SMap< SStringT, HCURSOR > CURSORMAP
 

Protected Member Functions

void _CreateSingletons ()
 Creates and initializes all singletons required by the application.
 
void _DestroySingletons ()
 Destroys and cleans up all singletons used by the application.
 
BOOL _LoadXmlDocment (LPCTSTR pszXmlName, LPCTSTR pszType, SXmlDoc &xmlDoc, IResProvider *pResProvider=NULL)
 Loads an XML document from a resource.
 
- Protected Member Functions inherited from SResProviderMgr
LPCTSTR SysCursorName2ID (LPCTSTR pszCursorName)
 Converts a system cursor name to its corresponding ID.
 
BOOL IsFileType (LPCTSTR pszType)
 Checks if the resource type is an external file.
 
- Protected Member Functions inherited from SObjectFactoryMgr
virtual IObject * CreateObject (const SObjectInfo &objInfo) const
 Creates an object based on the given object information.
 
virtual IObject * OnCreateUnknownObject (const SObjectInfo &objInfo) const
 Handles the creation of an unknown object.
 

Protected Attributes

SAutoRefPtr< IRealWndHandlerm_pRealWndHandler
 Pointer to the real window handler.
 
SAutoRefPtr< IScriptFactory > m_pScriptFactory
 Pointer to the script factory.
 
SAutoRefPtr< IRenderFactorym_RenderFactory
 Pointer to the render factory.
 
SAutoRefPtr< ITranslatorMgrm_translator
 Pointer to the translator manager.
 
SAutoRefPtr< IToolTipFactorym_tooltipFactory
 Pointer to the tooltip factory.
 
SAutoRefPtr< IMsgLoopFactorym_msgLoopFactory
 Pointer to the message loop factory.
 
SAutoRefPtr< ILogMgr > m_logManager
 Pointer to the log manager.
 
SAutoRefPtr< IAttrStorageFactory > m_pAttrStroageFactory
 Pointer to the attribute storage factory.
 
SNamedID m_namedID
 Named ID manager.
 
SStringT m_strAppDir
 Application directory path.
 
HMODULE m_hInst
 Module handle.
 
HWND m_hMainWnd
 Handle to the main window.
 
SCriticalSection m_cs
 Critical section for thread-safe operations.
 
MsgLoopMap m_msgLoopMap
 
FunCreateObject m_cbCreateObj
 Callback function for creating objects.
 
FunCrateTaskLoop m_cbCreateTaskLoop
 Callback function for creating task loops.
 
SArray< SAutoRefPtr< ITaskLoop > > m_lstTaskLoop
 List of task loops.
 
void * m_pSingletons [SINGLETON_COUNT]
 Array of singleton pointers.
 
SXmlDoc m_xmlEditCtxMenuTemplate
 XML document for the edit context menu template.
 
SXmlDoc m_xmlMessageBoxTemplate
 XML document for the message box template.
 
- Protected Attributes inherited from TObjRefImpl< IApplication >
LONG m_cRef
 Reference count.
 
- Protected Attributes inherited from SResProviderMgr
SStringT m_strFilePrefix
 
SList< IResProvider * > m_lstResPackage
 
CURSORMAP m_mapCachedCursor
 
SCriticalSection m_cs
 
- Protected Attributes inherited from SCmnMap< SObjectFactoryPtr, SObjectInfo >
void(* m_pFunOnKeyRemoved )(const SObjectFactoryPtr &obj)
 
SMap< SObjectInfo, SObjectFactoryPtr > * m_mapNamedObj
 

Additional Inherited Members

- Static Public Member Functions inherited from SSingleton< SApplication >
static SApplicationgetSingleton (void)
 Gets the singleton instance.
 
static SApplicationgetSingletonPtr (void)
 Gets the pointer to the singleton instance.
 
- Static Protected Member Functions inherited from SObjectFactoryMgr
static void OnFactoryRemoved (const SObjectFactoryPtr &obj)
 Static callback for when a factory is removed.
 
- Static Protected Attributes inherited from SSingleton< SApplication >
static SApplicationms_Singleton
 Static pointer to the singleton instance.
 

Detailed Description

SOUI Application.

Describe SOUI Application

Definition at line 147 of file SApp.h.

Member Typedef Documentation

◆ MsgLoopMap

typedef SMap<tid_t, SAutoRefPtr<IMessageLoop> > SApplication::MsgLoopMap
protected

Map of message loops for different threads.

Definition at line 791 of file SApp.h.

Constructor & Destructor Documentation

◆ SApplication()

SApplication::SApplication ( IRenderFactory * pRendFactory,
HINSTANCE hInst,
LPCTSTR pszHostClassName = _T("SOUIHOST"),
const ISystemObjectRegister & sysObjRegister = SObjectDefaultRegister(),
BOOL bImeApp = FALSE )

Constructor for SApplication.

Parameters
pRendFactoryPointer to the render factory
hInstHandle to the application instance
pszHostClassNameDefault window class name for SOUI windows
sysObjRegisterSystem object register
bImeAppBoolean indicating if the application is an IME application

Definition at line 233 of file SApp.cpp.

◆ ~SApplication()

SApplication::~SApplication ( void )

Destructor for SApplication.

Definition at line 266 of file SApp.cpp.

Member Function Documentation

◆ _CreateSingletons()

void SApplication::_CreateSingletons ( )
protected

Creates and initializes all singletons required by the application.

Definition at line 273 of file SApp.cpp.

◆ _DestroySingletons()

void SApplication::_DestroySingletons ( )
protected

Destroys and cleans up all singletons used by the application.

Definition at line 286 of file SApp.cpp.

◆ _LoadXmlDocment()

BOOL SApplication::_LoadXmlDocment ( LPCTSTR pszXmlName,
LPCTSTR pszType,
SXmlDoc & xmlDoc,
IResProvider * pResProvider = NULL )
protected

Loads an XML document from a resource.

Parameters
pszXmlNameThe name of the XML resource.
pszTypeThe type of the XML resource.
xmlDocThe output XML document object.
pResProviderThe resource provider to use for loading the resource.
Returns
TRUE if the XML document is loaded successfully, FALSE otherwise.

This protected method is used internally to load an XML document from a specified resource. It takes the name and type of the XML resource, an output XML document object, and an optional resource provider. If no resource provider is specified, the default resource provider is used.

Definition at line 354 of file SApp.cpp.

◆ AddMsgLoop()

BOOL SApplication::AddMsgLoop ( IMessageLoop * pMsgLoop,
BOOL bReplace = FALSE )

Add a message loop.

Parameters
pMsgLoopPointer to the message loop to add
bReplaceBoolean indicating if the existing message loop should be replaced
Returns
TRUE if successful, FALSE otherwise

Definition at line 694 of file SApp.cpp.

◆ CreateAnimationByName()

IAnimation * SApplication::CreateAnimationByName ( LPCWSTR pszName) const
virtual

Create an animation by name.

Parameters
pszNameName of the animation
Returns
Pointer to the created animation

Definition at line 654 of file SApp.cpp.

◆ CreateInterpolatorByName()

IInterpolator * SApplication::CreateInterpolatorByName ( LPCWSTR pszName) const
virtual

Create an interpolator by name.

Parameters
pszNameName of the interpolator
Returns
Pointer to the created interpolator

Definition at line 649 of file SApp.cpp.

◆ CreateObject()

IObject * SApplication::CreateObject ( LPCWSTR pszName,
SObjectType nType )

Create an object by name and type.

Parameters
pszNameName of the object
nTypeType of the object
Returns
Pointer to the created object

Definition at line 749 of file SApp.cpp.

◆ CreateScriptModule()

HRESULT SApplication::CreateScriptModule ( IScriptModule ** ppScriptModule)

Create a script module.

Parameters
ppScriptModulePointer to the created script module
Returns
HRESULT indicating success or failure

Definition at line 542 of file SApp.cpp.

◆ CreateSkinByName()

ISkinObj * SApplication::CreateSkinByName ( LPCWSTR pszSkinClass) const
virtual

Create a skin by name.

Parameters
pszSkinClassName of the skin class
Returns
Pointer to the created skin

Definition at line 644 of file SApp.cpp.

◆ CreateTaskLoop()

BOOL SApplication::CreateTaskLoop ( int nCount,
Priority priority,
BOOL bAutoStart = TRUE )

Create task loops.

Parameters
nCountNumber of task loops to create
priorityPriority of the task loops
bAutoStartBoolean indicating if the task loops should start automatically
Returns
TRUE if successful, FALSE otherwise

Definition at line 788 of file SApp.cpp.

◆ CreateValueAnimatorByName()

IValueAnimator * SApplication::CreateValueAnimatorByName ( LPCWSTR pszName) const
virtual

Create a value animator by name.

Parameters
pszNameName of the value animator
Returns
Pointer to the created value animator

Definition at line 659 of file SApp.cpp.

◆ CreateWindowByName()

IWindow * SApplication::CreateWindowByName ( LPCWSTR pszWndClass) const
virtual

Create a window by name.

Parameters
pszWndClassName of the window class
Returns
Pointer to the created window

Definition at line 630 of file SApp.cpp.

◆ EnableNotifyCenter()

void SApplication::EnableNotifyCenter ( BOOL bEnable,
int interval = 20 )

Enable or disable the notification center.

Parameters
bEnableBoolean indicating if the notification center should be enabled
intervalInterval for notifications

Definition at line 732 of file SApp.cpp.

◆ GetAppDir()

SStringT SApplication::GetAppDir ( ) const

Get the application directory.

Returns
Application directory path

Definition at line 674 of file SApp.cpp.

◆ GetAttrStorageFactory()

IAttrStorageFactory * SApplication::GetAttrStorageFactory ( )

Get the attribute storage factory.

Returns
Pointer to the attribute storage factory

Definition at line 684 of file SApp.cpp.

◆ GetEditCtxMenuTemplate()

SXmlNode SApplication::GetEditCtxMenuTemplate ( ) const

Get the edit context menu template XML node.

Returns
XML node for the edit context menu template

Definition at line 823 of file SApp.cpp.

◆ GetInnerSingleton()

void * SApplication::GetInnerSingleton ( SingletonType nType)

Get an inner singleton.

Parameters
nTypeType of the singleton
Returns
Pointer to the singleton

Definition at line 347 of file SApp.cpp.

◆ GetLogManager()

ILogMgr * SApplication::GetLogManager ( )

Get the log manager.

Returns
Pointer to the log manager

Definition at line 669 of file SApp.cpp.

◆ GetMainWnd()

HWND SApplication::GetMainWnd ( )

Get the main window handle.

Returns
Handle to the main window

Definition at line 583 of file SApp.cpp.

◆ GetMessageBoxTemplate()

SXmlNode SApplication::GetMessageBoxTemplate ( ) const

Get the message box template XML node.

Returns
XML node for the message box template

Definition at line 818 of file SApp.cpp.

◆ GetModule()

HMODULE SApplication::GetModule ( )

Get the module handle.

Returns
Module handle

Definition at line 522 of file SApp.cpp.

◆ GetMsgLoop()

IMessageLoop * SApplication::GetMsgLoop ( tid_t tid = ::GetCurrentThreadId())

Get the message loop for a specific thread.

Parameters
tidThread ID
Returns
Pointer to the message loop

Definition at line 718 of file SApp.cpp.

◆ GetMsgLoopFactory()

IMsgLoopFactory * SApplication::GetMsgLoopFactory ( )

Get the message loop factory.

Returns
Pointer to the message loop factory

Definition at line 598 of file SApp.cpp.

◆ GetRealWndHander()

IRealWndHandler * SApplication::GetRealWndHander ( )

Get the real window handler.

Returns
Pointer to the real window handler

Definition at line 568 of file SApp.cpp.

◆ GetRenderFactory()

IRenderFactory * SApplication::GetRenderFactory ( )

Get the render factory.

Returns
Pointer to the render factory

Definition at line 549 of file SApp.cpp.

◆ GetResProviderMgr()

IResProviderMgr * SApplication::GetResProviderMgr ( )

Get the resource provider manager.

Returns
Pointer to the resource provider manager

Definition at line 727 of file SApp.cpp.

◆ GetTaskLoop()

ITaskLoop * SApplication::GetTaskLoop ( int iTaskLoop = 0)

Get a task loop by index.

Parameters
iTaskLoopIndex of the task loop
Returns
Pointer to the task loop

Definition at line 806 of file SApp.cpp.

◆ GetToolTipFactory()

IToolTipFactory * SApplication::GetToolTipFactory ( )

Get the tooltip factory.

Returns
Pointer to the tooltip factory

Definition at line 573 of file SApp.cpp.

◆ GetTranslator()

ITranslatorMgr * SApplication::GetTranslator ( )

Get the translator manager.

Returns
Pointer to the translator manager

Definition at line 532 of file SApp.cpp.

◆ InitXmlNamedID() [1/2]

void SApplication::InitXmlNamedID ( const LPCWSTR * pNames,
const int * nIds,
int nCount )

Initialize XML named IDs from arrays.

Parameters
pNamesArray of names
nIdsArray of IDs
nCountNumber of elements in the arrays

Definition at line 608 of file SApp.cpp.

◆ InitXmlNamedID() [2/2]

void SApplication::InitXmlNamedID ( const SNamedID::NAMEDVALUE * pNamedValue,
int nCount,
BOOL bSorted )

Initialize XML named IDs from an array of named values.

Parameters
pNamedValueArray of named values
nCountNumber of elements in the array
bSortedBoolean indicating if the array is sorted

Definition at line 603 of file SApp.cpp.

◆ InstallTranslator()

BOOL SApplication::InstallTranslator ( ITranslator * trModule)

Install a translator.

Parameters
trModulePointer to the translator module
Returns
TRUE if successful, FALSE otherwise

Definition at line 436 of file SApp.cpp.

◆ LoadAnimation()

IAnimation * SApplication::LoadAnimation ( LPCTSTR strResId)

Load an animation from a resource.

Parameters
strResIdResource ID of the animation
Returns
Pointer to the loaded animation

Definition at line 395 of file SApp.cpp.

◆ LoadAnimationU8()

IAnimation * SApplication::LoadAnimationU8 ( LPCSTR strResId)
inline

Load an animation from a UTF-8 encoded resource.

Parameters
strResIdResource ID of the animation
Returns
Pointer to the loaded animation

Definition at line 365 of file SApp.h.

◆ LoadImage()

IBitmapS * SApplication::LoadImage ( LPCTSTR strResId)
inline

Load an image from a resource.

Parameters
strResIdResource ID of the image
Returns
Pointer to the loaded image

Definition at line 376 of file SApp.h.

◆ LoadImageU8()

IBitmapS * SApplication::LoadImageU8 ( LPCSTR strResId)
inline

Load an image from a UTF-8 encoded resource.

Parameters
strResIdResource ID of the image
Returns
Pointer to the loaded image

Definition at line 387 of file SApp.h.

◆ LoadSystemNamedResource()

UINT SApplication::LoadSystemNamedResource ( IResProvider * pResProvider)

Load system named resources.

Parameters
pResProviderResource provider
Returns
Number of resources loaded

Definition at line 462 of file SApp.cpp.

◆ LoadTranslator()

ITranslator * SApplication::LoadTranslator ( LPCTSTR strResId)

Load a translator from a resource.

Parameters
strResIdResource ID of the translator
Returns
Pointer to the loaded translator

Definition at line 421 of file SApp.cpp.

◆ LoadTranslatorU8()

ITranslator * SApplication::LoadTranslatorU8 ( LPCSTR strResId)
inline

Load a translator from a UTF-8 encoded resource.

Parameters
strResIdResource ID of the translator
Returns
Pointer to the loaded translator

Definition at line 423 of file SApp.h.

◆ LoadValueAnimator()

IValueAnimator * SApplication::LoadValueAnimator ( LPCTSTR strResId)

Load a value animator from a resource.

Parameters
strResIdResource ID of the value animator
Returns
Pointer to the loaded value animator

Definition at line 408 of file SApp.cpp.

◆ LoadValueAnimatorU8()

IValueAnimator * SApplication::LoadValueAnimatorU8 ( LPCSTR strResId)
inline

Load a value animator from a UTF-8 encoded resource.

Parameters
strResIdResource ID of the value animator
Returns
Pointer to the loaded value animator

Definition at line 405 of file SApp.h.

◆ LoadXmlDocment() [1/2]

IXmlDoc * SApplication::LoadXmlDocment ( LPCTSTR strResId)

Load an XML document from a resource.

Parameters
strResIdResource ID of the XML document
Returns
Pointer to the loaded XML document

Definition at line 371 of file SApp.cpp.

◆ LoadXmlDocment() [2/2]

BOOL SApplication::LoadXmlDocment ( SXmlDoc & xmlDoc,
const SStringT & strResId,
IResProvider * pResProvider = NULL )

Load an XML document from a resource.

Parameters
xmlDocOutput XML document object
strResIdResource ID of the XML document
pResProviderResource provider
Returns
TRUE if successful, FALSE otherwise

Definition at line 386 of file SApp.cpp.

◆ LoadXmlDocmentU8()

IXmlDoc * SApplication::LoadXmlDocmentU8 ( LPCSTR strResId)
inline

Load an XML document from a UTF-8 encoded resource.

Parameters
strResIdResource ID of the XML document
Returns
Pointer to the loaded XML document

Definition at line 347 of file SApp.h.

◆ Quit()

void SApplication::Quit ( int nCode)

Quit the application.

Parameters
nCodeExit code

Definition at line 511 of file SApp.cpp.

◆ RegisterObjFactory()

BOOL SApplication::RegisterObjFactory ( const IObjectFactory * objFac,
BOOL bReplace = FALSE )

Register an object factory.

Parameters
objFacPointer to the object factory
bReplaceBoolean indicating if the existing factory should be replaced
Returns
TRUE if successful, FALSE otherwise

Definition at line 768 of file SApp.cpp.

◆ RegisterSkinClass()

template<class T>
BOOL SApplication::RegisterSkinClass ( )
inline

Register a skin class.

Template Parameters
TSkin class type
Returns
TRUE if successful, FALSE otherwise

Definition at line 599 of file SApp.h.

◆ RegisterWindowClass()

template<class T>
BOOL SApplication::RegisterWindowClass ( )
inline

Register a window class.

Template Parameters
TWindow class type
Returns
TRUE if successful, FALSE otherwise

Definition at line 573 of file SApp.h.

◆ RemoveMsgLoop()

BOOL SApplication::RemoveMsgLoop ( )

Remove the current message loop.

Returns
TRUE if successful, FALSE otherwise

Definition at line 706 of file SApp.cpp.

◆ Run()

int SApplication::Run ( HWND hMainWnd)

Run the application message loop.

Parameters
hMainWndHandle to the main window
Returns
Exit code of the application

Definition at line 498 of file SApp.cpp.

◆ SetAppDir()

void SApplication::SetAppDir ( const SStringT & strAppDir)

Set the application directory.

Parameters
strAppDirApplication directory path

Definition at line 679 of file SApp.cpp.

◆ SetAttrStorageFactory()

void SApplication::SetAttrStorageFactory ( IAttrStorageFactory * pAttrStorageFactory)

Set the attribute storage factory.

Parameters
pAttrStorageFactoryPointer to the new attribute storage factory

Definition at line 689 of file SApp.cpp.

◆ SetCreateObjectCallback()

void SApplication::SetCreateObjectCallback ( FunCreateObject cbCreateObj)

Set the callback for creating objects.

Parameters
cbCreateObjCallback function

Definition at line 763 of file SApp.cpp.

◆ SetCreateTaskLoopCallback()

void SApplication::SetCreateTaskLoopCallback ( FunCrateTaskLoop cbCreateTaskLoop)

Set the callback for creating task loops.

Parameters
cbCreateTaskLoopCallback function

Definition at line 783 of file SApp.cpp.

◆ SetDefaultFontInfo()

void SApplication::SetDefaultFontInfo ( LPCWSTR pszFontInfo)

Set the default font information.

Parameters
pszFontInfoFont information string

Definition at line 778 of file SApp.cpp.

◆ SetEditCtxMenuTemplateResId()

BOOL SApplication::SetEditCtxMenuTemplateResId ( LPCTSTR resId,
IResProvider * pResProvider = NULL )

Set the resource ID for the edit context menu template.

Parameters
resIdResource ID of the template
pResProviderResource provider
Returns
TRUE if successful, FALSE otherwise

Definition at line 828 of file SApp.cpp.

◆ SetLogManager()

void SApplication::SetLogManager ( ILogMgr * pLogMgr)

Set the log manager.

Parameters
pLogMgrPointer to the new log manager

Definition at line 664 of file SApp.cpp.

◆ SetMessageBoxTemplateResId()

BOOL SApplication::SetMessageBoxTemplateResId ( LPCTSTR resId,
IResProvider * pResProvider = NULL )

Set the resource ID for the message box template.

Parameters
resIdResource ID of the template
pResProviderResource provider
Returns
TRUE if successful, FALSE otherwise

Definition at line 833 of file SApp.cpp.

◆ SetMsgLoopFactory()

BOOL SApplication::SetMsgLoopFactory ( IMsgLoopFactory * pMsgLoopFac)

Set the message loop factory.

Parameters
pMsgLoopFacPointer to the new message loop factory
Returns
TRUE if successful, FALSE otherwise

Definition at line 588 of file SApp.cpp.

◆ SetRealWndHandler()

void SApplication::SetRealWndHandler ( IRealWndHandler * pRealHandler)

Set the real window handler.

Parameters
pRealHandlerPointer to the new real window handler

Definition at line 563 of file SApp.cpp.

◆ SetRenderFactory()

BOOL SApplication::SetRenderFactory ( IRenderFactory * renderFac)

Set the render factory.

Parameters
renderFacPointer to the new render factory
Returns
TRUE if successful, FALSE otherwise

Definition at line 554 of file SApp.cpp.

◆ SetScriptFactory()

void SApplication::SetScriptFactory ( IScriptFactory * pScriptModule)

Set the script factory.

Parameters
pScriptModulePointer to the new script factory

Definition at line 537 of file SApp.cpp.

◆ SetToolTipFactory()

void SApplication::SetToolTipFactory ( IToolTipFactory * pToolTipFac)

Set the tooltip factory.

Parameters
pToolTipFacPointer to the new tooltip factory

Definition at line 578 of file SApp.cpp.

◆ SetTranslator()

void SApplication::SetTranslator ( ITranslatorMgr * pTrans)

Set the translator manager.

Parameters
pTransPointer to the new translator manager

Definition at line 527 of file SApp.cpp.

◆ Str2ID()

int SApplication::Str2ID ( const SStringW & str)

Convert a string to an ID.

Parameters
strSource string
Returns
ID corresponding to the string

Definition at line 613 of file SApp.cpp.

◆ tr()

SStringW SApplication::tr ( const SStringW & strSrc,
const SStringW & strCtx ) const

Translate a string with context.

Parameters
strSrcSource string
strCtxContext string
Returns
Translated string

Definition at line 618 of file SApp.cpp.

◆ UnnstallTranslator()

BOOL SApplication::UnnstallTranslator ( REFGUID langId)

Uninstall a translator by language ID.

Parameters
langIdLanguage ID
Returns
TRUE if successful, FALSE otherwise

Definition at line 454 of file SApp.cpp.

◆ UnregisterObjFactory()

BOOL SApplication::UnregisterObjFactory ( const IObjectFactory * objFac)

Unregister an object factory.

Parameters
objFacPointer to the object factory
Returns
TRUE if successful, FALSE otherwise

Definition at line 773 of file SApp.cpp.

◆ UnregisterSkinClass()

template<class T>
BOOL SApplication::UnregisterSkinClass ( )
inline

Unregister a skin class.

Template Parameters
TSkin class type
Returns
TRUE if successful, FALSE otherwise

Definition at line 612 of file SApp.h.

◆ UnregisterWindowClass()

template<class T>
BOOL SApplication::UnregisterWindowClass ( )
inline

Unregister a window class.

Template Parameters
TWindow class type
Returns
TRUE if successful, FALSE otherwise

Definition at line 586 of file SApp.h.

Member Data Documentation

◆ m_cbCreateObj

FunCreateObject SApplication::m_cbCreateObj
protected

Callback function for creating objects.

Definition at line 797 of file SApp.h.

◆ m_cbCreateTaskLoop

FunCrateTaskLoop SApplication::m_cbCreateTaskLoop
protected

Callback function for creating task loops.

Definition at line 802 of file SApp.h.

◆ m_cs

SCriticalSection SApplication::m_cs
mutableprotected

Critical section for thread-safe operations.

Definition at line 786 of file SApp.h.

◆ m_hInst

HMODULE SApplication::m_hInst
protected

Module handle.

Definition at line 776 of file SApp.h.

◆ m_hMainWnd

HWND SApplication::m_hMainWnd
protected

Handle to the main window.

Definition at line 781 of file SApp.h.

◆ m_logManager

SAutoRefPtr<ILogMgr> SApplication::m_logManager
protected

Pointer to the log manager.

Definition at line 756 of file SApp.h.

◆ m_lstTaskLoop

SArray<SAutoRefPtr<ITaskLoop> > SApplication::m_lstTaskLoop
protected

List of task loops.

Definition at line 807 of file SApp.h.

◆ m_msgLoopFactory

SAutoRefPtr<IMsgLoopFactory> SApplication::m_msgLoopFactory
protected

Pointer to the message loop factory.

Definition at line 751 of file SApp.h.

◆ m_msgLoopMap

MsgLoopMap SApplication::m_msgLoopMap
protected

Definition at line 792 of file SApp.h.

◆ m_namedID

SNamedID SApplication::m_namedID
protected

Named ID manager.

Definition at line 766 of file SApp.h.

◆ m_pAttrStroageFactory

SAutoRefPtr<IAttrStorageFactory> SApplication::m_pAttrStroageFactory
protected

Pointer to the attribute storage factory.

Definition at line 761 of file SApp.h.

◆ m_pRealWndHandler

SAutoRefPtr<IRealWndHandler> SApplication::m_pRealWndHandler
protected

Pointer to the real window handler.

Definition at line 726 of file SApp.h.

◆ m_pScriptFactory

SAutoRefPtr<IScriptFactory> SApplication::m_pScriptFactory
protected

Pointer to the script factory.

Definition at line 731 of file SApp.h.

◆ m_pSingletons

void* SApplication::m_pSingletons[SINGLETON_COUNT]
protected

Array of singleton pointers.

Definition at line 812 of file SApp.h.

◆ m_RenderFactory

SAutoRefPtr<IRenderFactory> SApplication::m_RenderFactory
protected

Pointer to the render factory.

Definition at line 736 of file SApp.h.

◆ m_strAppDir

SStringT SApplication::m_strAppDir
protected

Application directory path.

Definition at line 771 of file SApp.h.

◆ m_tooltipFactory

SAutoRefPtr<IToolTipFactory> SApplication::m_tooltipFactory
protected

Pointer to the tooltip factory.

Definition at line 746 of file SApp.h.

◆ m_translator

SAutoRefPtr<ITranslatorMgr> SApplication::m_translator
protected

Pointer to the translator manager.

Definition at line 741 of file SApp.h.

◆ m_xmlEditCtxMenuTemplate

SXmlDoc SApplication::m_xmlEditCtxMenuTemplate
protected

XML document for the edit context menu template.

Definition at line 817 of file SApp.h.

◆ m_xmlMessageBoxTemplate

SXmlDoc SApplication::m_xmlMessageBoxTemplate
protected

XML document for the message box template.

Definition at line 822 of file SApp.h.


The documentation for this class was generated from the following files: