soui 5.0.0.1
Soui5 Doc
 
Loading...
Searching...
No Matches
SWindowMgr.cpp
1#include "souistd.h"
2#include "core/SWindowMgr.h"
3
4SNSBEGIN
5
6//////////////////////////////////////////////////////////////////////////
8 : m_hNextWnd(SWND_INVALID)
9{
10}
11
15
16// Get SWindow pointer from handle
18{
19 if (!swnd)
20 return NULL;
21 SAutoLock lock(getSingleton().m_lockWndMap);
22 SWindow *pRet = NULL;
23 getSingleton().GetKeyObject(swnd, pRet);
24 return pRet;
25}
26
27bool SWindowMgr::IsWindow(SWND swnd)
28{
29 return GetWindow(swnd) != NULL;
30}
31
32// Specify a handle to a SWindow
34{
35 SASSERT(pSwnd);
36 SAutoLock lock(getSingleton().m_lockWndMap);
37 SWND swndNext = ++getSingleton().m_hNextWnd;
38 getSingleton().AddKeyObject(swndNext, pSwnd);
39 return swndNext;
40}
41
42// Destroy SWindow
44{
45 SAutoLock lock(getSingleton().m_lockWndMap);
46 return getSingleton().RemoveKeyObject(swnd);
47}
48
49SNSEND
SOUI系统中的DUI窗口管理模块
Auto-lock class for managing critical sections.
static TClass & getSingleton(void)
Definition SSingleton2.h:59
Base class for SOUI DUI windows.
Definition SWnd.h:286
SWindowMgr()
Constructor.
Definition SWindowMgr.cpp:7
~SWindowMgr()
Destructor.
static SWindow * GetWindow(SWND swnd)
Retrieves the SWindow pointer from a given handle.
static bool IsWindow(SWND swnd)
Checks if a given handle is a valid window handle.
static BOOL DestroyWindow(SWND swnd)
Destroys a window with the specified handle.
static SWND NewWindow(SWindow *pWnd)
Assigns a handle to a new SWindow.