Resource Provider Manager. More...
#include <SResProviderMgr.h>
Public Member Functions | |
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. | |
IResProvider * | GetHeadResProvider () SCONST OVERRIDE |
Retrieves the first resource provider in the list. | |
IResProvider * | GetTailResProvider () 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. | |
IBitmapS * | LoadImage (LPCTSTR pszType, LPCTSTR pszResName) OVERRIDE |
Loads an image resource as an IBitmapS object. | |
IImgX * | LoadImgX (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. | |
IResProvider * | GetMatchResProvider (LPCTSTR pszType, LPCTSTR pszResName) |
Finds the resource provider that contains the specified resource type and name. | |
IBitmapS * | LoadImage2 (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. | |
Protected Types | |
typedef SMap< SStringT, HCURSOR > | CURSORMAP |
Protected Member Functions | |
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 Attributes | |
SStringT | m_strFilePrefix |
SList< IResProvider * > | m_lstResPackage |
CURSORMAP | m_mapCachedCursor |
SCriticalSection | m_cs |
Resource Provider Manager.
Manages multiple resource providers and provides methods to load and manage resources.
Definition at line 18 of file SResProviderMgr.h.
|
protected |
Definition at line 207 of file SResProviderMgr.h.
SResProviderMgr::SResProviderMgr | ( | void | ) |
Constructor.
Definition at line 11 of file SResProviderMgr.cpp.
SResProviderMgr::~SResProviderMgr | ( | void | ) |
Destructor.
Definition at line 15 of file SResProviderMgr.cpp.
void SResProviderMgr::AddResProvider | ( | IResProvider * | pResProvider, |
LPCTSTR | pszUidef = _T("uidef:xml_init") ) |
Adds a resource provider with a specified UI definition.
pResProvider | Pointer to the resource provider to add. |
pszUidef | UI definition string (default is "uidef:xml_init"). |
Definition at line 63 of file SResProviderMgr.cpp.
void SResProviderMgr::AddResProviderA | ( | IResProvider * | pResProvider, |
LPCSTR | pszUidef = "uidef:xml_init" ) |
Adds a resource provider with a specified UI definition (ANSI version).
pResProvider | Pointer to the resource provider to add. |
pszUidef | UI definition string (default is "uidef:xml_init"). |
Definition at line 74 of file SResProviderMgr.cpp.
IResProvider * SResProviderMgr::GetHeadResProvider | ( | ) |
Retrieves the first resource provider in the list.
Definition at line 99 of file SResProviderMgr.cpp.
IResProvider * SResProviderMgr::GetMatchResProvider | ( | LPCTSTR | pszType, |
LPCTSTR | pszResName ) |
Finds the resource provider that contains the specified resource type and name.
pszType | Type of the resource. |
pszResName | Name of the resource. |
Definition at line 45 of file SResProviderMgr.cpp.
BOOL SResProviderMgr::GetRawBuffer | ( | LPCTSTR | pszType, |
LPCTSTR | pszResName, | ||
LPVOID | pBuf, | ||
size_t | size ) |
Retrieves the raw buffer for a resource.
pszType | Type of the resource. |
pszResName | Name of the resource. |
pBuf | Buffer to store the raw data. |
size | Size of the buffer. |
Definition at line 128 of file SResProviderMgr.cpp.
size_t SResProviderMgr::GetRawBufferSize | ( | LPCTSTR | pszType, |
LPCTSTR | pszResName ) |
Retrieves the size of the raw buffer for a resource.
pszType | Type of the resource. |
pszResName | Name of the resource. |
Definition at line 159 of file SResProviderMgr.cpp.
IResProvider * SResProviderMgr::GetTailResProvider | ( | ) |
Retrieves the last resource provider in the list.
Definition at line 104 of file SResProviderMgr.cpp.
BOOL SResProviderMgr::HasResource | ( | LPCTSTR | pszType, |
LPCTSTR | pszResName ) |
Checks if a resource exists.
pszType | Type of the resource. |
pszResName | Name of the resource. |
Definition at line 375 of file SResProviderMgr.cpp.
|
protected |
Checks if the resource type is an external file.
pszType | Type of the resource. |
Definition at line 416 of file SResProviderMgr.cpp.
HBITMAP SResProviderMgr::LoadBitmap | ( | LPCTSTR | pszResName, |
BOOL | bFromFile = FALSE ) |
Loads a bitmap resource.
pszResName | Name of the bitmap resource. |
bFromFile | TRUE if the resource should be loaded from a file, FALSE otherwise (default is FALSE). |
Definition at line 266 of file SResProviderMgr.cpp.
HCURSOR SResProviderMgr::LoadCursor | ( | LPCTSTR | pszResName, |
BOOL | bFromFile = FALSE ) |
Loads a cursor resource.
pszResName | Name of the cursor resource. |
bFromFile | TRUE if the resource should be loaded from a file, FALSE otherwise (default is FALSE). |
Definition at line 295 of file SResProviderMgr.cpp.
HICON SResProviderMgr::LoadIcon | ( | LPCTSTR | pszResName, |
int | cx = 0, | ||
int | cy = 0, | ||
BOOL | bFromFile = FALSE ) |
Loads an icon resource.
pszResName | Name of the icon resource. |
cx | Desired width of the icon (default is 0). |
cy | Desired height of the icon (default is 0). |
bFromFile | TRUE if the resource should be loaded from a file, FALSE otherwise (default is FALSE). |
Definition at line 347 of file SResProviderMgr.cpp.
HICON SResProviderMgr::LoadIcon2 | ( | const SStringW & | strIconID | ) |
Loads an icon using a name:size formatted string.
strIconID | Name:size formatted string. |
Definition at line 400 of file SResProviderMgr.cpp.
IBitmapS * SResProviderMgr::LoadImage | ( | LPCTSTR | pszType, |
LPCTSTR | pszResName ) |
Loads an image resource as an IBitmapS object.
pszType | Type of the resource. |
pszResName | Name of the resource. |
Definition at line 225 of file SResProviderMgr.cpp.
Loads an image using a type:name formatted string.
strImgID | Type:name formatted string. |
Definition at line 389 of file SResProviderMgr.cpp.
IImgX * SResProviderMgr::LoadImgX | ( | LPCTSTR | pszType, |
LPCTSTR | pszResName ) |
Loads an image resource as an IImgX object.
pszType | Type of the resource. |
pszResName | Name of the resource. |
Definition at line 191 of file SResProviderMgr.cpp.
BOOL SResProviderMgr::LoadRawBuffer | ( | LPCTSTR | pszType, |
LPCTSTR | pszResName, | ||
IResProvider * | pResProvider, | ||
SAutoBuf & | buf ) |
Loads the raw buffer for a resource using a specified resource provider.
pszType | Type of the resource. |
pszResName | Name of the resource. |
pResProvider | Pointer to the resource provider. |
buf | Buffer to store the raw data. |
Definition at line 446 of file SResProviderMgr.cpp.
void SResProviderMgr::RemoveAll | ( | ) |
Removes all resource providers.
Definition at line 20 of file SResProviderMgr.cpp.
void SResProviderMgr::RemoveResProvider | ( | IResProvider * | pResProvider | ) |
Removes a resource provider.
pResProvider | Pointer to the resource provider to remove. |
Definition at line 82 of file SResProviderMgr.cpp.
void SResProviderMgr::SetFilePrefix | ( | LPCTSTR | pszFilePrefix | ) |
Sets the file prefix for resource paths.
pszFilePrefix | File prefix to set. |
Definition at line 438 of file SResProviderMgr.cpp.
|
protected |
Converts a system cursor name to its corresponding ID.
pszCursorName | Name of the system cursor. |
Definition at line 109 of file SResProviderMgr.cpp.
|
protected |
Definition at line 210 of file SResProviderMgr.h.
|
protected |
Definition at line 205 of file SResProviderMgr.h.
|
protected |
Definition at line 208 of file SResProviderMgr.h.
|
protected |
Definition at line 204 of file SResProviderMgr.h.