2#include "core/SCaret.h"
3#include "animation/SInterpolatorImpl.h"
21 m_AniInterpolator.Attach(CREATEINTERPOLATOR(SAccelerateInterpolator::GetClassName()));
31 ::CreateCaret(
m_pContainer->GetHostHwnd(), hBmp, nWid, nHei);
36 GETRENDERFACTORY->CreateRenderTarget(&pRT, nWid, nHei);
43 HDC hdc = pRT->GetDC(0);
44 HDC hdc2 = CreateCompatibleDC(hdc);
45 SelectObject(hdc2, hBmp);
48 GetObject(hBmp,
sizeof(bm), &bm);
49 StretchBlt(hdc, 0, 0, nWid, nHei, hdc2, 0, 0, bm.bmWidth, bm.bmHeight, SRCCOPY);
51 pRT->ReleaseDC(hdc, NULL);
57 CRect rc(0, 0, nWid, nHei);
131 ::SetCaretPos(rc.left + x, rc.top + y);
Smart pointer class for managing COM-style reference-counted objects.
void Draw(IRenderTarget *pRT) OVERRIDE
Draws the caret.
SAutoRefPtr< IInterpolator > m_AniInterpolator
ISwndContainer * m_pContainer
SCaret(ISwndContainer *pContainer)
Constructor.
void OnNextFrame() OVERRIDE
Handles the next frame in the timeline.
BOOL SetVisible(BOOL bVisible, SWND owner) OVERRIDE
Sets the visibility of the caret.
SAutoRefPtr< IBitmapS > m_bmpCaret
BOOL IsVisible() SCONST OVERRIDE
Checks if the caret is visible.
void Invalidate()
Invalidates the caret area.
BOOL Init(HBITMAP hBmp, int nWid, int nHei) OVERRIDE
Initializes the caret.
RECT GetRect() SCONST OVERRIDE
Gets the rectangle of the caret.
void SetPosition(int x, int y) OVERRIDE
Sets the position of the caret.
Base class for SOUI DUI windows.
void InvalidateRect(LPCRECT lprect) OVERRIDE
Invalidates a specific rectangle area of the window.
static SWindow * GetWindow(SWND swnd)
Retrieves the SWindow pointer from a given handle.
Interface for rendering target objects.
HRESULT DrawBitmap(LPCRECT pRcDest, const IBitmapS *pBitmap, int xSrc, int ySrc, BYTE byAlpha=0xFF) PURE
Draw a bitmap.
SOUI Window Container Interface.