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

Implementation of the SOUI window container. More...

#include <SWndContainerImpl.h>

Inheritance diagram for SwndContainerImpl:
ISwndContainer ITimelineHandler SHostWnd SDropDownWnd SMenuEx

Public Member Functions

 SwndContainerImpl ()
 Constructor.
 
IDropTarget * GetDropTarget ()
 Retrieves the drop target.
 
SFocusManagerGetFocusManager ()
 Retrieves the focus manager.
 
void SetRoot (SWindow *pRoot)
 Sets the root window of the container.
 
virtual LRESULT DoFrameEvent (UINT uMsg, WPARAM wParam, LPARAM lParam)
 Processes frame events.
 
void OnNextFrame () OVERRIDE
 Called when the next frame is ready.
 
- Public Member Functions inherited from ISwndContainer
BOOL RegisterTimelineHandler (ITimelineHandler *pHandler) PURE
 Registers an animation frame handler.
 
BOOL UnregisterTimelineHandler (ITimelineHandler *pHandler) PURE
 Unregisters an animation frame handler.
 
BOOL RegisterDragDrop (SWND swnd, IDropTarget *pDropTarget) PURE
 Registers an IDropTarget with a Swnd.
 
BOOL UnregisterDragDrop (SWND swnd) PURE
 Unregisters an IDropTarget from a Swnd.
 
BOOL OnFireEvent (IEvtArgs *evt) PURE
 Fires an event.
 
IMessageLoopGetMsgLoop () PURE
 Retrieves the current message loop.
 
IScriptModule * GetScriptModule () PURE
 Retrieves the script module.
 
HWND GetHostHwnd () PURE
 Retrieves the handle to the host window.
 
BOOL IsTranslucent () SCONST PURE
 Checks if the host window is translucent.
 
BOOL IsSendWheel2Hover () SCONST PURE
 Checks if mouseWheel messages are sent to the hover window.
 
int GetScale () SCONST PURE
 Retrieves the current DPI scale factor.
 
LPCWSTR GetTranslatorContext () SCONST PURE
 Retrieves the translation context.
 
void GetContainerRect (RECT *ret) SCONST PURE
 Retrieves the container's display rectangle.
 
void UpdateRegion (IRegionS *rgn) PURE
 Updates the specified region of the memory bitmap.
 
void OnRedraw (LPCRECT rc, BOOL bClip) PURE
 Requests a redraw of the specified area.
 
SWND OnGetSwndCapture () SCONST PURE
 Retrieves the Swnd object that has captured the mouse.
 
SWND OnSetSwndCapture (SWND swnd) PURE
 Sets the Swnd object to capture the mouse.
 
BOOL OnReleaseSwndCapture () PURE
 Releases the mouse capture from the Swnd object.
 
SWND GetHover () SCONST PURE
 Retrieves the Swnd object that is hovered over.
 
SWND GetFocus () SCONST PURE
 Retrieves the Swnd object that has focus.
 
void OnSetSwndFocus (SWND swnd) PURE
 Sets the focus to the specified Swnd object.
 
BOOL UpdateWindow (BOOL bForce=TRUE) PURE
 Requests an immediate update of the window.
 
void UpdateTooltip () PURE
 Requests an update of the tooltip.
 
void SetToolTip (LPCRECT rc, UINT tipAlign, LPCTSTR pszTip) PURE
 Displays a tooltip at the specified position.
 
void FrameToHost (RECT *rc) SCONST PURE
 Converts the rectangle coordinates of the current frame to the final host coordinates.
 
IAcceleratorMgrGetAcceleratorMgr () PURE
 Retrieves the accelerator manager.
 
BOOL RegisterTrackMouseEvent (SWND swnd) PURE
 Registers a Swnd as a TrackMouseEvent window.
 
BOOL UnregisterTrackMouseEvent (SWND swnd) PURE
 Unregisters a Swnd as a TrackMouseEvent window.
 
void MarkWndTreeZorderDirty () PURE
 Marks the window tree's z-order as dirty.
 
void BuildWndTreeZorder () PURE
 Rebuilds the window tree's z-order.
 
void EnableIME (BOOL bEnable) PURE
 Enables or disables the input method editor (IME).
 
void OnUpdateCursor () PURE
 Updates the cursor.
 
BOOL RegisterVideoCanvas (SWND swnd) PURE
 Registers a VideoCanvas window.
 
BOOL UnregisterVideoCanvas (SWND swnd) PURE
 Unregisters a VideoCanvas window.
 
void EnableHostPrivateUiDef (BOOL bEnable) PURE
 Enables or disables the host's private UI definitions.
 
BOOL PostTask (IRunnable *runable, BOOL bAsync=TRUE) PURE
 Posts a task to the message queue.
 
int RemoveTasksForObject (void *pObj) PURE
 Removes all tasks associated with an object.
 
- Public Member Functions inherited from ITimelineHandler
void OnNextFrame () PURE
 下一个动画帧处理接口
 

Protected Member Functions

BOOL RegisterDragDrop (SWND swnd, IDropTarget *pDropTarget) OVERRIDE
 Registers a drop target for a window.
 
BOOL UnregisterDragDrop (SWND swnd) OVERRIDE
 Unregisters a drop target for a window.
 
BOOL OnReleaseSwndCapture () OVERRIDE
 Releases the window capture.
 
SWND OnSetSwndCapture (SWND swnd) OVERRIDE
 Sets the window capture.
 
void OnSetSwndFocus (SWND swnd) OVERRIDE
 Sets the window focus.
 
void FrameToHost (RECT *rc) SCONST OVERRIDE
 Transforms a rectangle from frame coordinates to host coordinates.
 
SWND OnGetSwndCapture () SCONST OVERRIDE
 Retrieves the window handle that has capture.
 
SWND GetFocus () SCONST OVERRIDE
 Retrieves the window handle that has focus.
 
SWND GetHover () SCONST OVERRIDE
 Retrieves the window handle that is hovered.
 
IAcceleratorMgrGetAcceleratorMgr ()
 Retrieves the accelerator manager.
 
BOOL RegisterTimelineHandler (ITimelineHandler *pHandler) OVERRIDE
 Registers a timeline handler.
 
BOOL UnregisterTimelineHandler (ITimelineHandler *pHandler) OVERRIDE
 Unregisters a timeline handler.
 
BOOL RegisterTrackMouseEvent (SWND swnd) OVERRIDE
 Registers a window for tracking mouse events.
 
BOOL UnregisterTrackMouseEvent (SWND swnd) OVERRIDE
 Unregisters a window for tracking mouse events.
 
void MarkWndTreeZorderDirty () OVERRIDE
 Marks the window tree's z-order as dirty.
 
void BuildWndTreeZorder () OVERRIDE
 Rebuilds the window tree's z-order.
 
BOOL RegisterVideoCanvas (SWND swnd) OVERRIDE
 Registers a window as a video canvas.
 
BOOL UnregisterVideoCanvas (SWND swnd) OVERRIDE
 Unregisters a window as a video canvas.
 
void OnFrameMouseMove (UINT uFlag, CPoint pt)
 Handles mouse move events within the frame.
 
void OnFrameMouseLeave ()
 Handles mouse leave events within the frame.
 
BOOL OnFrameSetCursor (const CPoint &pt)
 Sets the cursor based on the mouse position.
 
void OnFrameMouseEvent (UINT uMsg, WPARAM wParam, LPARAM lParam)
 Handles mouse events within the frame.
 
void OnFrameMouseWheel (UINT uMsg, WPARAM wParam, LPARAM lParam)
 Handles mouse wheel events within the frame.
 
LRESULT OnFrameKeyEvent (UINT uMsg, WPARAM wParam, LPARAM lParam)
 Handles key events within the frame.
 
void OnFrameKeyDown (UINT nChar, UINT nRepCnt, UINT nFlags)
 Handles key down events within the frame.
 
void OnActivate (UINT nState)
 Handles window activation events.
 
void OnActivateApp (BOOL bActive, DWORD dwThreadID)
 Handles application activation events.
 
void _BuildWndTreeZorder (IWindow *pWnd, UINT &iOrder)
 Recursively builds the z-order of the window tree.
 

Protected Attributes

SWindowm_pRoot
 
SWND m_hCapture
 
SWND m_hHover
 
BOOL m_bNcHover
 
SFocusManager m_focusMgr
 
SDropTargetDispatcher m_dropTarget
 
BOOL m_bZorderDirty
 
SList< SWND > m_lstTrackMouseEvtWnd
 
SList< SWND > m_lstVideoCanvas
 
SAutoRefPtr< ICaret > m_caret
 
STimerlineHandlerMgr m_timelineHandlerMgr
 

Detailed Description

Implementation of the SOUI window container.

This class implements the ISwndContainer and ITimelineHandler interfaces to manage a container of SOUI windows. It handles drag-and-drop operations, focus management, mouse and keyboard events, and timeline handling.

Definition at line 32 of file SWndContainerImpl.h.

Constructor & Destructor Documentation

◆ SwndContainerImpl()

SwndContainerImpl::SwndContainerImpl ( )

Constructor.

Definition at line 13 of file SwndContainerImpl.cpp.

Member Function Documentation

◆ _BuildWndTreeZorder()

void SwndContainerImpl::_BuildWndTreeZorder ( IWindow * pWnd,
UINT & iOrder )
protected

Recursively builds the z-order of the window tree.

Parameters
pWndPointer to the window.
iOrderCurrent z-order index.

Definition at line 471 of file SwndContainerImpl.cpp.

◆ BuildWndTreeZorder()

void SwndContainerImpl::BuildWndTreeZorder ( )
protected

Rebuilds the window tree's z-order.

Definition at line 461 of file SwndContainerImpl.cpp.

◆ DoFrameEvent()

LRESULT SwndContainerImpl::DoFrameEvent ( UINT uMsg,
WPARAM wParam,
LPARAM lParam )
virtual

Processes frame events.

Parameters
uMsgMessage identifier.
wParamAdditional message-specific information.
lParamAdditional message-specific information.
Returns
Result of the message processing.

Definition at line 29 of file SwndContainerImpl.cpp.

◆ FrameToHost()

void SwndContainerImpl::FrameToHost ( RECT * rc)
inlineprotected

Transforms a rectangle from frame coordinates to host coordinates.

Parameters
rcRectangle to transform.

Definition at line 114 of file SWndContainerImpl.h.

◆ GetAcceleratorMgr()

IAcceleratorMgr * SwndContainerImpl::GetAcceleratorMgr ( )
inlineprotected

Retrieves the accelerator manager.

Returns
Pointer to the accelerator manager.

Definition at line 140 of file SWndContainerImpl.h.

◆ GetDropTarget()

IDropTarget * SwndContainerImpl::GetDropTarget ( )
inline

Retrieves the drop target.

Returns
Pointer to the drop target.

Definition at line 45 of file SWndContainerImpl.h.

◆ GetFocus()

SWND SwndContainerImpl::GetFocus ( )
protected

Retrieves the window handle that has focus.

Returns
Window handle with focus.

Definition at line 135 of file SwndContainerImpl.cpp.

◆ GetFocusManager()

SFocusManager * SwndContainerImpl::GetFocusManager ( )
inline

Retrieves the focus manager.

Returns
Pointer to the focus manager.

Definition at line 54 of file SWndContainerImpl.h.

◆ GetHover()

SWND SwndContainerImpl::GetHover ( )
protected

Retrieves the window handle that is hovered.

Returns
Window handle that is hovered.

Definition at line 140 of file SwndContainerImpl.cpp.

◆ MarkWndTreeZorderDirty()

void SwndContainerImpl::MarkWndTreeZorderDirty ( )
protected

Marks the window tree's z-order as dirty.

Definition at line 456 of file SwndContainerImpl.cpp.

◆ OnActivate()

void SwndContainerImpl::OnActivate ( UINT nState)
protected

Handles window activation events.

Parameters
nStateActivation state.

Definition at line 422 of file SwndContainerImpl.cpp.

◆ OnActivateApp()

void SwndContainerImpl::OnActivateApp ( BOOL bActive,
DWORD dwThreadID )
protected

Handles application activation events.

Parameters
bActiveTRUE if the application is being activated, FALSE if deactivated.
dwThreadIDThread identifier of the application.

Definition at line 434 of file SwndContainerImpl.cpp.

◆ OnFrameKeyDown()

void SwndContainerImpl::OnFrameKeyDown ( UINT nChar,
UINT nRepCnt,
UINT nFlags )
protected

Handles key down events within the frame.

Parameters
nCharVirtual-key code of the key.
nRepCntRepeat count of the key.
nFlagsFlags indicating the state of the key.

Definition at line 394 of file SwndContainerImpl.cpp.

◆ OnFrameKeyEvent()

LRESULT SwndContainerImpl::OnFrameKeyEvent ( UINT uMsg,
WPARAM wParam,
LPARAM lParam )
protected

Handles key events within the frame.

Parameters
uMsgMessage identifier.
wParamAdditional message-specific information.
lParamAdditional message-specific information.
Returns
Result of the message processing.

Definition at line 368 of file SwndContainerImpl.cpp.

◆ OnFrameMouseEvent()

void SwndContainerImpl::OnFrameMouseEvent ( UINT uMsg,
WPARAM wParam,
LPARAM lParam )
protected

Handles mouse events within the frame.

Parameters
uMsgMessage identifier.
wParamAdditional message-specific information.
lParamAdditional message-specific information.

Definition at line 304 of file SwndContainerImpl.cpp.

◆ OnFrameMouseLeave()

void SwndContainerImpl::OnFrameMouseLeave ( )
protected

Handles mouse leave events within the frame.

Definition at line 252 of file SwndContainerImpl.cpp.

◆ OnFrameMouseMove()

void SwndContainerImpl::OnFrameMouseMove ( UINT uFlag,
CPoint pt )
protected

Handles mouse move events within the frame.

Parameters
uFlagFlags indicating the state of the mouse buttons.
ptCurrent mouse position.

Definition at line 145 of file SwndContainerImpl.cpp.

◆ OnFrameMouseWheel()

void SwndContainerImpl::OnFrameMouseWheel ( UINT uMsg,
WPARAM wParam,
LPARAM lParam )
protected

Handles mouse wheel events within the frame.

Parameters
uMsgMessage identifier.
wParamAdditional message-specific information.
lParamAdditional message-specific information.

Definition at line 339 of file SwndContainerImpl.cpp.

◆ OnFrameSetCursor()

BOOL SwndContainerImpl::OnFrameSetCursor ( const CPoint & pt)
protected

Sets the cursor based on the mouse position.

Parameters
ptCurrent mouse position.
Returns
TRUE if the cursor is set, FALSE otherwise.

Definition at line 290 of file SwndContainerImpl.cpp.

◆ OnGetSwndCapture()

SWND SwndContainerImpl::OnGetSwndCapture ( )
protected

Retrieves the window handle that has capture.

Returns
Window handle with capture.

Definition at line 130 of file SwndContainerImpl.cpp.

◆ OnNextFrame()

void SwndContainerImpl::OnNextFrame ( )

Called when the next frame is ready.

Definition at line 492 of file SwndContainerImpl.cpp.

◆ OnReleaseSwndCapture()

BOOL SwndContainerImpl::OnReleaseSwndCapture ( )
protected

Releases the window capture.

Returns
TRUE if the capture is released, FALSE otherwise.

Definition at line 95 of file SwndContainerImpl.cpp.

◆ OnSetSwndCapture()

SWND SwndContainerImpl::OnSetSwndCapture ( SWND swnd)
protected

Sets the window capture.

Parameters
swndWindow handle.
Returns
Previous window handle that had capture.

Definition at line 106 of file SwndContainerImpl.cpp.

◆ OnSetSwndFocus()

void SwndContainerImpl::OnSetSwndFocus ( SWND swnd)
protected

Sets the window focus.

Parameters
swndWindow handle.

Definition at line 121 of file SwndContainerImpl.cpp.

◆ RegisterDragDrop()

BOOL SwndContainerImpl::RegisterDragDrop ( SWND swnd,
IDropTarget * pDropTarget )
protected

Registers a drop target for a window.

Parameters
swndWindow handle.
pDropTargetPointer to the drop target.
Returns
TRUE if registration is successful, FALSE otherwise.

Definition at line 412 of file SwndContainerImpl.cpp.

◆ RegisterTimelineHandler()

BOOL SwndContainerImpl::RegisterTimelineHandler ( ITimelineHandler * pHandler)
protected

Registers a timeline handler.

Parameters
pHandlerPointer to the timeline handler.
Returns
TRUE if registration is successful, FALSE otherwise.

Definition at line 482 of file SwndContainerImpl.cpp.

◆ RegisterTrackMouseEvent()

BOOL SwndContainerImpl::RegisterTrackMouseEvent ( SWND swnd)
protected

Registers a window for tracking mouse events.

Parameters
swndWindow handle.
Returns
TRUE if registration is successful, FALSE otherwise.

Definition at line 439 of file SwndContainerImpl.cpp.

◆ RegisterVideoCanvas()

BOOL SwndContainerImpl::RegisterVideoCanvas ( SWND swnd)
protected

Registers a window as a video canvas.

Parameters
swndWindow handle.
Returns
TRUE if registration is successful, FALSE otherwise.

Definition at line 499 of file SwndContainerImpl.cpp.

◆ SetRoot()

void SwndContainerImpl::SetRoot ( SWindow * pRoot)

Sets the root window of the container.

Parameters
pRootPointer to the root window.

Definition at line 22 of file SwndContainerImpl.cpp.

◆ UnregisterDragDrop()

BOOL SwndContainerImpl::UnregisterDragDrop ( SWND swnd)
protected

Unregisters a drop target for a window.

Parameters
swndWindow handle.
Returns
TRUE if unregistration is successful, FALSE otherwise.

Definition at line 417 of file SwndContainerImpl.cpp.

◆ UnregisterTimelineHandler()

BOOL SwndContainerImpl::UnregisterTimelineHandler ( ITimelineHandler * pHandler)
protected

Unregisters a timeline handler.

Parameters
pHandlerPointer to the timeline handler.
Returns
TRUE if unregistration is successful, FALSE otherwise.

Definition at line 487 of file SwndContainerImpl.cpp.

◆ UnregisterTrackMouseEvent()

BOOL SwndContainerImpl::UnregisterTrackMouseEvent ( SWND swnd)
protected

Unregisters a window for tracking mouse events.

Parameters
swndWindow handle.
Returns
TRUE if unregistration is successful, FALSE otherwise.

Definition at line 447 of file SwndContainerImpl.cpp.

◆ UnregisterVideoCanvas()

BOOL SwndContainerImpl::UnregisterVideoCanvas ( SWND swnd)
protected

Unregisters a window as a video canvas.

Parameters
swndWindow handle.
Returns
TRUE if unregistration is successful, FALSE otherwise.

Definition at line 508 of file SwndContainerImpl.cpp.

Member Data Documentation

◆ m_bNcHover

BOOL SwndContainerImpl::m_bNcHover
protected

Non-client area hover flag

Definition at line 281 of file SWndContainerImpl.h.

◆ m_bZorderDirty

BOOL SwndContainerImpl::m_bZorderDirty
protected

Z-order dirty flag

Definition at line 284 of file SWndContainerImpl.h.

◆ m_caret

SAutoRefPtr<ICaret> SwndContainerImpl::m_caret
protected

Caret

Definition at line 287 of file SWndContainerImpl.h.

◆ m_dropTarget

SDropTargetDispatcher SwndContainerImpl::m_dropTarget
protected

Drop target dispatcher

Definition at line 283 of file SWndContainerImpl.h.

◆ m_focusMgr

SFocusManager SwndContainerImpl::m_focusMgr
protected

Focus manager

Definition at line 282 of file SWndContainerImpl.h.

◆ m_hCapture

SWND SwndContainerImpl::m_hCapture
protected

Window handle with capture

Definition at line 279 of file SWndContainerImpl.h.

◆ m_hHover

SWND SwndContainerImpl::m_hHover
protected

Window handle that is hovered

Definition at line 280 of file SWndContainerImpl.h.

◆ m_lstTrackMouseEvtWnd

SList<SWND> SwndContainerImpl::m_lstTrackMouseEvtWnd
protected

List of windows tracking mouse events

Definition at line 285 of file SWndContainerImpl.h.

◆ m_lstVideoCanvas

SList<SWND> SwndContainerImpl::m_lstVideoCanvas
protected

List of video canvas windows

Definition at line 286 of file SWndContainerImpl.h.

◆ m_pRoot

SWindow* SwndContainerImpl::m_pRoot
protected

Root window of the container

Definition at line 278 of file SWndContainerImpl.h.

◆ m_timelineHandlerMgr

STimerlineHandlerMgr SwndContainerImpl::m_timelineHandlerMgr
protected

Timeline handler manager

Definition at line 288 of file SWndContainerImpl.h.


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