ReactOS  0.4.15-dev-3453-gff89651
txthost.c File Reference
#include "editor.h"
#include "ole2.h"
#include "richole.h"
#include "imm.h"
#include "textserv.h"
#include "wine/asm.h"
#include "wine/debug.h"
#include "editstr.h"
Include dependency graph for txthost.c:

Go to the source code of this file.

Classes

struct  ITextHostImpl
 

Macros

#define COBJMACROS
 

Typedefs

typedef struct ITextHostImpl ITextHostImpl
 

Functions

 WINE_DEFAULT_DEBUG_CHANNEL (richedit)
 
ITextHost * ME_CreateTextHost (HWND hwnd, CREATESTRUCTW *cs, BOOL bEmulateVersion10)
 
static ITextHostImplimpl_from_ITextHost (ITextHost *iface)
 
static HRESULT WINAPI ITextHostImpl_QueryInterface (ITextHost *iface, REFIID riid, void **ppvObject)
 
static ULONG WINAPI ITextHostImpl_AddRef (ITextHost *iface)
 
static ULONG WINAPI ITextHostImpl_Release (ITextHost *iface)
 
DECLSPEC_HIDDEN HDC __thiscall ITextHostImpl_TxGetDC (ITextHost *iface)
 
DECLSPEC_HIDDEN INT __thiscall ITextHostImpl_TxReleaseDC (ITextHost *iface, HDC hdc)
 
DECLSPEC_HIDDEN BOOL __thiscall ITextHostImpl_TxShowScrollBar (ITextHost *iface, INT fnBar, BOOL fShow)
 
DECLSPEC_HIDDEN BOOL __thiscall ITextHostImpl_TxEnableScrollBar (ITextHost *iface, INT fuSBFlags, INT fuArrowflags)
 
DECLSPEC_HIDDEN BOOL __thiscall ITextHostImpl_TxSetScrollRange (ITextHost *iface, INT fnBar, LONG nMinPos, INT nMaxPos, BOOL fRedraw)
 
DECLSPEC_HIDDEN BOOL __thiscall ITextHostImpl_TxSetScrollPos (ITextHost *iface, INT fnBar, INT nPos, BOOL fRedraw)
 
DECLSPEC_HIDDEN void __thiscall ITextHostImpl_TxInvalidateRect (ITextHost *iface, LPCRECT prc, BOOL fMode)
 
DECLSPEC_HIDDEN void __thiscall ITextHostImpl_TxViewChange (ITextHost *iface, BOOL fUpdate)
 
DECLSPEC_HIDDEN BOOL __thiscall ITextHostImpl_TxCreateCaret (ITextHost *iface, HBITMAP hbmp, INT xWidth, INT yHeight)
 
DECLSPEC_HIDDEN BOOL __thiscall ITextHostImpl_TxShowCaret (ITextHost *iface, BOOL fShow)
 
DECLSPEC_HIDDEN BOOL __thiscall ITextHostImpl_TxSetCaretPos (ITextHost *iface, INT x, INT y)
 
DECLSPEC_HIDDEN BOOL __thiscall ITextHostImpl_TxSetTimer (ITextHost *iface, UINT idTimer, UINT uTimeout)
 
DECLSPEC_HIDDEN void __thiscall ITextHostImpl_TxKillTimer (ITextHost *iface, UINT idTimer)
 
DECLSPEC_HIDDEN void __thiscall ITextHostImpl_TxScrollWindowEx (ITextHost *iface, INT dx, INT dy, LPCRECT lprcScroll, LPCRECT lprcClip, HRGN hRgnUpdate, LPRECT lprcUpdate, UINT fuScroll)
 
DECLSPEC_HIDDEN void __thiscall ITextHostImpl_TxSetCapture (ITextHost *iface, BOOL fCapture)
 
DECLSPEC_HIDDEN void __thiscall ITextHostImpl_TxSetFocus (ITextHost *iface)
 
DECLSPEC_HIDDEN void __thiscall ITextHostImpl_TxSetCursor (ITextHost *iface, HCURSOR hcur, BOOL fText)
 
DECLSPEC_HIDDEN BOOL __thiscall ITextHostImpl_TxScreenToClient (ITextHost *iface, LPPOINT lppt)
 
DECLSPEC_HIDDEN BOOL __thiscall ITextHostImpl_TxClientToScreen (ITextHost *iface, LPPOINT lppt)
 
DECLSPEC_HIDDEN HRESULT __thiscall ITextHostImpl_TxActivate (ITextHost *iface, LONG *plOldState)
 
DECLSPEC_HIDDEN HRESULT __thiscall ITextHostImpl_TxDeactivate (ITextHost *iface, LONG lNewState)
 
DECLSPEC_HIDDEN HRESULT __thiscall ITextHostImpl_TxGetClientRect (ITextHost *iface, LPRECT prc)
 
DECLSPEC_HIDDEN HRESULT __thiscall ITextHostImpl_TxGetViewInset (ITextHost *iface, LPRECT prc)
 
DECLSPEC_HIDDEN HRESULT __thiscall ITextHostImpl_TxGetCharFormat (ITextHost *iface, const CHARFORMATW **ppCF)
 
DECLSPEC_HIDDEN HRESULT __thiscall ITextHostImpl_TxGetParaFormat (ITextHost *iface, const PARAFORMAT **fmt)
 
DECLSPEC_HIDDEN COLORREF __thiscall ITextHostImpl_TxGetSysColor (ITextHost *iface, int nIndex)
 
DECLSPEC_HIDDEN HRESULT __thiscall ITextHostImpl_TxGetBackStyle (ITextHost *iface, TXTBACKSTYLE *pStyle)
 
DECLSPEC_HIDDEN HRESULT __thiscall ITextHostImpl_TxGetMaxLength (ITextHost *iface, DWORD *pLength)
 
DECLSPEC_HIDDEN HRESULT __thiscall ITextHostImpl_TxGetScrollBars (ITextHost *iface, DWORD *pdwScrollBar)
 
DECLSPEC_HIDDEN HRESULT __thiscall ITextHostImpl_TxGetPasswordChar (ITextHost *iface, WCHAR *pch)
 
DECLSPEC_HIDDEN HRESULT __thiscall ITextHostImpl_TxGetAcceleratorPos (ITextHost *iface, LONG *pch)
 
DECLSPEC_HIDDEN HRESULT __thiscall ITextHostImpl_TxGetExtent (ITextHost *iface, LPSIZEL lpExtent)
 
DECLSPEC_HIDDEN HRESULT __thiscall ITextHostImpl_OnTxCharFormatChange (ITextHost *iface, const CHARFORMATW *pcf)
 
DECLSPEC_HIDDEN HRESULT __thiscall ITextHostImpl_OnTxParaFormatChange (ITextHost *iface, const PARAFORMAT *ppf)
 
DECLSPEC_HIDDEN HRESULT __thiscall ITextHostImpl_TxGetPropertyBits (ITextHost *iface, DWORD dwMask, DWORD *pdwBits)
 
DECLSPEC_HIDDEN HRESULT __thiscall ITextHostImpl_TxNotify (ITextHost *iface, DWORD iNotify, void *pv)
 
DECLSPEC_HIDDEN HIMC __thiscall ITextHostImpl_TxImmGetContext (ITextHost *iface)
 
DECLSPEC_HIDDEN void __thiscall ITextHostImpl_TxImmReleaseContext (ITextHost *iface, HIMC himc)
 
DECLSPEC_HIDDEN HRESULT __thiscall ITextHostImpl_TxGetSelectionBarWidth (ITextHost *iface, LONG *lSelBarWidth)
 

Variables

static const ITextHostVtbl textHostVtbl
 

Macro Definition Documentation

◆ COBJMACROS

#define COBJMACROS

Definition at line 21 of file txthost.c.

Typedef Documentation

◆ ITextHostImpl

Function Documentation

◆ impl_from_ITextHost()

◆ ITextHostImpl_AddRef()

static ULONG WINAPI ITextHostImpl_AddRef ( ITextHost *  iface)
static

Definition at line 86 of file txthost.c.

87 {
90  return ref;
91 }
Definition: send.c:48
GLenum GLint ref
Definition: glext.h:6028
static ITextHostImpl * impl_from_ITextHost(ITextHost *iface)
Definition: txthost.c:67
#define InterlockedIncrement
Definition: armddk.h:53
unsigned int ULONG
Definition: retypes.h:1

◆ ITextHostImpl_OnTxCharFormatChange()

DECLSPEC_HIDDEN HRESULT __thiscall ITextHostImpl_OnTxCharFormatChange ( ITextHost *  iface,
const CHARFORMATW pcf 
)

Definition at line 328 of file txthost.c.

329 {
330  return S_OK;
331 }
#define S_OK
Definition: intsafe.h:52

◆ ITextHostImpl_OnTxParaFormatChange()

DECLSPEC_HIDDEN HRESULT __thiscall ITextHostImpl_OnTxParaFormatChange ( ITextHost *  iface,
const PARAFORMAT ppf 
)

Definition at line 333 of file txthost.c.

334 {
335  return S_OK;
336 }
#define S_OK
Definition: intsafe.h:52

◆ ITextHostImpl_QueryInterface()

static HRESULT WINAPI ITextHostImpl_QueryInterface ( ITextHost *  iface,
REFIID  riid,
void **  ppvObject 
)
static

Definition at line 72 of file txthost.c.

73 {
75 
76  if (IsEqualIID(riid, &IID_IUnknown) || IsEqualIID(riid, &IID_ITextHost)) {
77  *ppvObject = &This->ITextHost_iface;
78  ITextHost_AddRef((ITextHost *)*ppvObject);
79  return S_OK;
80  }
81 
82  FIXME("Unknown interface: %s\n", debugstr_guid(riid));
83  return E_NOINTERFACE;
84 }
#define E_NOINTERFACE
Definition: winerror.h:2364
REFIID riid
Definition: precomp.h:44
#define FIXME(fmt,...)
Definition: debug.h:111
#define debugstr_guid
Definition: kernel32.h:35
const GUID IID_IUnknown
static ITextHostImpl * impl_from_ITextHost(ITextHost *iface)
Definition: txthost.c:67
REFIID LPVOID * ppvObject
Definition: precomp.h:44
#define S_OK
Definition: intsafe.h:52
#define IsEqualIID(riid1, riid2)
Definition: guiddef.h:95

◆ ITextHostImpl_Release()

static ULONG WINAPI ITextHostImpl_Release ( ITextHost *  iface)
static

Definition at line 93 of file txthost.c.

94 {
97 
98  if (!ref)
99  {
100  SetWindowLongPtrW(This->hWnd, 0, 0);
102  }
103  return ref;
104 }
VOID WINAPI CoTaskMemFree(LPVOID ptr)
Definition: ifs.c:442
Definition: send.c:48
GLenum GLint ref
Definition: glext.h:6028
static ITextHostImpl * impl_from_ITextHost(ITextHost *iface)
Definition: txthost.c:67
#define InterlockedDecrement
Definition: armddk.h:52
unsigned int ULONG
Definition: retypes.h:1
#define SetWindowLongPtrW
Definition: winuser.h:5326

◆ ITextHostImpl_TxActivate()

DECLSPEC_HIDDEN HRESULT __thiscall ITextHostImpl_TxActivate ( ITextHost *  iface,
LONG plOldState 
)

Definition at line 230 of file txthost.c.

231 {
233  *plOldState = HandleToLong(SetActiveWindow(This->hWnd));
234  return (*plOldState ? S_OK : E_FAIL);
235 }
#define E_FAIL
Definition: ddrawi.h:102
HWND WINAPI SetActiveWindow(_In_ HWND)
static ITextHostImpl * impl_from_ITextHost(ITextHost *iface)
Definition: txthost.c:67
#define S_OK
Definition: intsafe.h:52
#define HandleToLong(h)
Definition: basetsd.h:80

◆ ITextHostImpl_TxClientToScreen()

DECLSPEC_HIDDEN BOOL __thiscall ITextHostImpl_TxClientToScreen ( ITextHost *  iface,
LPPOINT  lppt 
)

Definition at line 224 of file txthost.c.

225 {
227  return ClientToScreen(This->hWnd, lppt);
228 }
BOOL WINAPI ClientToScreen(_In_ HWND, _Inout_ LPPOINT)
static ITextHostImpl * impl_from_ITextHost(ITextHost *iface)
Definition: txthost.c:67

◆ ITextHostImpl_TxCreateCaret()

DECLSPEC_HIDDEN BOOL __thiscall ITextHostImpl_TxCreateCaret ( ITextHost *  iface,
HBITMAP  hbmp,
INT  xWidth,
INT  yHeight 
)

Definition at line 156 of file txthost.c.

157 {
159  return CreateCaret(This->hWnd, hbmp, xWidth, yHeight);
160 }
BOOL WINAPI CreateCaret(_In_ HWND, _In_opt_ HBITMAP, _In_ int, _In_ int)
HBITMAP hbmp
static ITextHostImpl * impl_from_ITextHost(ITextHost *iface)
Definition: txthost.c:67

◆ ITextHostImpl_TxDeactivate()

DECLSPEC_HIDDEN HRESULT __thiscall ITextHostImpl_TxDeactivate ( ITextHost *  iface,
LONG  lNewState 
)

Definition at line 237 of file txthost.c.

238 {
239  HWND ret = SetActiveWindow(LongToHandle(lNewState));
240  return (ret ? S_OK : E_FAIL);
241 }
#define E_FAIL
Definition: ddrawi.h:102
HWND WINAPI SetActiveWindow(_In_ HWND)
int ret
#define LongToHandle(h)
Definition: basetsd.h:82
#define S_OK
Definition: intsafe.h:52

◆ ITextHostImpl_TxEnableScrollBar()

DECLSPEC_HIDDEN BOOL __thiscall ITextHostImpl_TxEnableScrollBar ( ITextHost *  iface,
INT  fuSBFlags,
INT  fuArrowflags 
)

Definition at line 124 of file txthost.c.

125 {
127  return EnableScrollBar(This->hWnd, fuSBFlags, fuArrowflags);
128 }
static ITextHostImpl * impl_from_ITextHost(ITextHost *iface)
Definition: txthost.c:67
BOOL WINAPI EnableScrollBar(_In_ HWND, _In_ UINT, _In_ UINT)

◆ ITextHostImpl_TxGetAcceleratorPos()

DECLSPEC_HIDDEN HRESULT __thiscall ITextHostImpl_TxGetAcceleratorPos ( ITextHost *  iface,
LONG pch 
)

Definition at line 317 of file txthost.c.

318 {
319  *pch = -1;
320  return S_OK;
321 }
#define pch(ap)
Definition: match.c:418
#define S_OK
Definition: intsafe.h:52

◆ ITextHostImpl_TxGetBackStyle()

DECLSPEC_HIDDEN HRESULT __thiscall ITextHostImpl_TxGetBackStyle ( ITextHost *  iface,
TXTBACKSTYLE pStyle 
)

Definition at line 276 of file txthost.c.

277 {
278  *pStyle = TXTBACK_OPAQUE;
279  return S_OK;
280 }
#define S_OK
Definition: intsafe.h:52

◆ ITextHostImpl_TxGetCharFormat()

DECLSPEC_HIDDEN HRESULT __thiscall ITextHostImpl_TxGetCharFormat ( ITextHost *  iface,
const CHARFORMATW **  ppCF 
)

Definition at line 259 of file txthost.c.

260 {
261  return E_NOTIMPL;
262 }
#define E_NOTIMPL
Definition: ddrawi.h:99

◆ ITextHostImpl_TxGetClientRect()

DECLSPEC_HIDDEN HRESULT __thiscall ITextHostImpl_TxGetClientRect ( ITextHost *  iface,
LPRECT  prc 
)

Definition at line 243 of file txthost.c.

244 {
246  int ret = GetClientRect(This->hWnd, prc);
247  return (ret ? S_OK : E_FAIL);
248 }
#define E_FAIL
Definition: ddrawi.h:102
static ITextHostImpl * impl_from_ITextHost(ITextHost *iface)
Definition: txthost.c:67
int ret
BOOL WINAPI GetClientRect(_In_ HWND, _Out_ LPRECT)
#define S_OK
Definition: intsafe.h:52
_Out_ LPRECT prc
Definition: ntgdi.h:1658

◆ ITextHostImpl_TxGetDC()

DECLSPEC_HIDDEN HDC __thiscall ITextHostImpl_TxGetDC ( ITextHost *  iface)

Definition at line 106 of file txthost.c.

107 {
109  return GetDC(This->hWnd);
110 }
HDC WINAPI GetDC(_In_opt_ HWND)
static ITextHostImpl * impl_from_ITextHost(ITextHost *iface)
Definition: txthost.c:67

◆ ITextHostImpl_TxGetExtent()

DECLSPEC_HIDDEN HRESULT __thiscall ITextHostImpl_TxGetExtent ( ITextHost *  iface,
LPSIZEL  lpExtent 
)

Definition at line 323 of file txthost.c.

324 {
325  return E_NOTIMPL;
326 }
#define E_NOTIMPL
Definition: ddrawi.h:99

◆ ITextHostImpl_TxGetMaxLength()

DECLSPEC_HIDDEN HRESULT __thiscall ITextHostImpl_TxGetMaxLength ( ITextHost *  iface,
DWORD pLength 
)

Definition at line 282 of file txthost.c.

283 {
284  *pLength = INFINITE;
285  return S_OK;
286 }
#define S_OK
Definition: intsafe.h:52
#define INFINITE
Definition: serial.h:102

◆ ITextHostImpl_TxGetParaFormat()

DECLSPEC_HIDDEN HRESULT __thiscall ITextHostImpl_TxGetParaFormat ( ITextHost *  iface,
const PARAFORMAT **  fmt 
)

Definition at line 264 of file txthost.c.

265 {
267  *fmt = (const PARAFORMAT *)&This->para_fmt;
268  return S_OK;
269 }
static ITextHostImpl * impl_from_ITextHost(ITextHost *iface)
Definition: txthost.c:67
#define S_OK
Definition: intsafe.h:52
Definition: dsound.c:943

◆ ITextHostImpl_TxGetPasswordChar()

DECLSPEC_HIDDEN HRESULT __thiscall ITextHostImpl_TxGetPasswordChar ( ITextHost *  iface,
WCHAR pch 
)

Definition at line 311 of file txthost.c.

312 {
313  *pch = '*';
314  return S_OK;
315 }
#define pch(ap)
Definition: match.c:418
#define S_OK
Definition: intsafe.h:52

◆ ITextHostImpl_TxGetPropertyBits()

DECLSPEC_HIDDEN HRESULT __thiscall ITextHostImpl_TxGetPropertyBits ( ITextHost *  iface,
DWORD  dwMask,
DWORD pdwBits 
)

Definition at line 338 of file txthost.c.

339 {
341  ME_TextEditor *editor = (ME_TextEditor *)GetWindowLongPtrW(This->hWnd, 0);
342  DWORD style;
343  DWORD dwBits = 0;
344 
345  if (editor)
346  {
347  style = editor->styleFlags;
348  if (editor->mode & TM_RICHTEXT)
349  dwBits |= TXTBIT_RICHTEXT;
350  if (editor->bWordWrap)
351  dwBits |= TXTBIT_WORDWRAP;
353  dwBits |= TXTBIT_AUTOWORDSEL;
354  } else {
355  DWORD dwScrollBar;
356 
358  ITextHostImpl_TxGetScrollBars(iface, &dwScrollBar);
359 
361  if (!(dwScrollBar & ES_AUTOHSCROLL))
362  dwBits |= TXTBIT_WORDWRAP;
363  }
364 
365  /* Bits that correspond to window styles. */
366  if (style & ES_MULTILINE)
367  dwBits |= TXTBIT_MULTILINE;
368  if (style & ES_READONLY)
369  dwBits |= TXTBIT_READONLY;
370  if (style & ES_PASSWORD)
371  dwBits |= TXTBIT_USEPASSWORD;
372  if (!(style & ES_NOHIDESEL))
373  dwBits |= TXTBIT_HIDESELECTION;
374  if (style & ES_SAVESEL)
375  dwBits |= TXTBIT_SAVESELECTION;
376  if (style & ES_VERTICAL)
377  dwBits |= TXTBIT_VERTICAL;
378  if (style & ES_NOOLEDRAGDROP)
379  dwBits |= TXTBIT_DISABLEDRAG;
380 
381  dwBits |= TXTBIT_ALLOWBEEP;
382 
383  /* The following bits are always FALSE because they are probably only
384  * needed for ITextServices_OnTxPropertyBitsChange:
385  * TXTBIT_VIEWINSETCHANGE
386  * TXTBIT_BACKSTYLECHANGE
387  * TXTBIT_MAXLENGTHCHANGE
388  * TXTBIT_CHARFORMATCHANGE
389  * TXTBIT_PARAFORMATCHANGE
390  * TXTBIT_SHOWACCELERATOR
391  * TXTBIT_EXTENTCHANGE
392  * TXTBIT_SELBARCHANGE
393  * TXTBIT_SCROLLBARCHANGE
394  * TXTBIT_CLIENTRECTCHANGE
395  *
396  * Documented by MSDN as not supported:
397  * TXTBIT_USECURRENTBKG
398  */
399 
400  *pdwBits = dwBits & dwMask;
401  return S_OK;
402 }
#define ES_VERTICAL
Definition: richedit.h:229
DWORD styleFlags
Definition: editstr.h:388
#define ES_MULTILINE
Definition: pedump.c:667
#define ECO_AUTOWORDSELECTION
Definition: richedit.h:456
#define ES_READONLY
Definition: pedump.c:675
#define GetWindowLongPtrW
Definition: winuser.h:4809
DECLSPEC_HIDDEN HRESULT __thiscall ITextHostImpl_TxGetScrollBars(ITextHost *iface, DWORD *pdwScrollBar)
Definition: txthost.c:288
#define ES_PASSWORD
Definition: pedump.c:670
LONG WINAPI GetWindowLongW(_In_ HWND, _In_ int)
#define TXTBIT_USEPASSWORD
Definition: textserv.h:190
#define TXTBIT_AUTOWORDSEL
Definition: textserv.h:193
#define TXTBIT_SAVESELECTION
Definition: textserv.h:192
#define TXTBIT_HIDESELECTION
Definition: textserv.h:191
#define TXTBIT_WORDWRAP
Definition: textserv.h:196
unsigned long DWORD
Definition: ntddk_ex.h:95
#define TXTBIT_READONLY
Definition: textserv.h:188
static ITextHostImpl * impl_from_ITextHost(ITextHost *iface)
Definition: txthost.c:67
#define ES_NOHIDESEL
Definition: pedump.c:673
#define TXTBIT_MULTILINE
Definition: textserv.h:187
#define ES_SAVESEL
Definition: richedit.h:226
#define TXTBIT_RICHTEXT
Definition: textserv.h:186
#define TM_RICHTEXT
Definition: richedit.h:1029
#define GWL_STYLE
Definition: winuser.h:846
#define S_OK
Definition: intsafe.h:52
#define TXTBIT_ALLOWBEEP
Definition: textserv.h:197
Arabic default style
Definition: afstyles.h:93
#define TXTBIT_VERTICAL
Definition: textserv.h:194
#define ES_AUTOHSCROLL
Definition: pedump.c:672
#define ES_NOOLEDRAGDROP
Definition: richedit.h:223
#define TXTBIT_DISABLEDRAG
Definition: textserv.h:198

◆ ITextHostImpl_TxGetScrollBars()

DECLSPEC_HIDDEN HRESULT __thiscall ITextHostImpl_TxGetScrollBars ( ITextHost *  iface,
DWORD pdwScrollBar 
)

Definition at line 288 of file txthost.c.

289 {
291  ME_TextEditor *editor = (ME_TextEditor*)GetWindowLongPtrW(This->hWnd, 0);
292  const DWORD mask = WS_VSCROLL|
293  WS_HSCROLL|
297  if (editor)
298  {
299  *pdwScrollBar = editor->styleFlags & mask;
300  } else {
302  if (style & WS_VSCROLL)
304  if (!This->bEmulateVersion10 && (style & WS_HSCROLL))
306  *pdwScrollBar = style & mask;
307  }
308  return S_OK;
309 }
DWORD styleFlags
Definition: editstr.h:388
#define GetWindowLongPtrW
Definition: winuser.h:4809
GLenum GLint GLuint mask
Definition: glext.h:6028
LONG WINAPI GetWindowLongW(_In_ HWND, _In_ int)
#define ES_AUTOVSCROLL
Definition: pedump.c:671
unsigned long DWORD
Definition: ntddk_ex.h:95
static ITextHostImpl * impl_from_ITextHost(ITextHost *iface)
Definition: txthost.c:67
#define WS_HSCROLL
Definition: pedump.c:628
#define ES_DISABLENOSCROLL
Definition: richedit.h:224
#define GWL_STYLE
Definition: winuser.h:846
#define S_OK
Definition: intsafe.h:52
#define WS_VSCROLL
Definition: pedump.c:627
Arabic default style
Definition: afstyles.h:93
#define ES_AUTOHSCROLL
Definition: pedump.c:672

Referenced by ITextHostImpl_TxGetPropertyBits().

◆ ITextHostImpl_TxGetSelectionBarWidth()

DECLSPEC_HIDDEN HRESULT __thiscall ITextHostImpl_TxGetSelectionBarWidth ( ITextHost *  iface,
LONG lSelBarWidth 
)

Definition at line 474 of file txthost.c.

475 {
477  ME_TextEditor *editor = (ME_TextEditor *)GetWindowLongPtrW(This->hWnd, 0);
478 
479  DWORD style = editor ? editor->styleFlags
480  : GetWindowLongW(This->hWnd, GWL_STYLE);
481  *lSelBarWidth = (style & ES_SELECTIONBAR) ? 225 : 0; /* in HIMETRIC */
482  return S_OK;
483 }
DWORD styleFlags
Definition: editstr.h:388
#define GetWindowLongPtrW
Definition: winuser.h:4809
LONG WINAPI GetWindowLongW(_In_ HWND, _In_ int)
#define ES_SELECTIONBAR
Definition: richedit.h:230
unsigned long DWORD
Definition: ntddk_ex.h:95
static ITextHostImpl * impl_from_ITextHost(ITextHost *iface)
Definition: txthost.c:67
#define GWL_STYLE
Definition: winuser.h:846
#define S_OK
Definition: intsafe.h:52
Arabic default style
Definition: afstyles.h:93

◆ ITextHostImpl_TxGetSysColor()

DECLSPEC_HIDDEN COLORREF __thiscall ITextHostImpl_TxGetSysColor ( ITextHost *  iface,
int  nIndex 
)

Definition at line 271 of file txthost.c.

272 {
273  return GetSysColor(nIndex);
274 }
DWORD WINAPI GetSysColor(_In_ int)

◆ ITextHostImpl_TxGetViewInset()

DECLSPEC_HIDDEN HRESULT __thiscall ITextHostImpl_TxGetViewInset ( ITextHost *  iface,
LPRECT  prc 
)

Definition at line 250 of file txthost.c.

251 {
252  prc->top = 0;
253  prc->left = 0;
254  prc->bottom = 0;
255  prc->right = 0;
256  return S_OK;
257 }
LONG top
Definition: windef.h:307
LONG left
Definition: windef.h:306
LONG right
Definition: windef.h:308
#define S_OK
Definition: intsafe.h:52
LONG bottom
Definition: windef.h:309
_Out_ LPRECT prc
Definition: ntgdi.h:1658

◆ ITextHostImpl_TxImmGetContext()

DECLSPEC_HIDDEN HIMC __thiscall ITextHostImpl_TxImmGetContext ( ITextHost *  iface)

Definition at line 462 of file txthost.c.

463 {
465  return ImmGetContext(This->hWnd);
466 }
HIMC WINAPI ImmGetContext(HWND hWnd)
Definition: imm.c:1008
static ITextHostImpl * impl_from_ITextHost(ITextHost *iface)
Definition: txthost.c:67

◆ ITextHostImpl_TxImmReleaseContext()

DECLSPEC_HIDDEN void __thiscall ITextHostImpl_TxImmReleaseContext ( ITextHost *  iface,
HIMC  himc 
)

Definition at line 468 of file txthost.c.

469 {
471  ImmReleaseContext(This->hWnd, himc);
472 }
static ITextHostImpl * impl_from_ITextHost(ITextHost *iface)
Definition: txthost.c:67
BOOL WINAPI ImmReleaseContext(HWND hWnd, HIMC hIMC)
Definition: imm.c:1057

◆ ITextHostImpl_TxInvalidateRect()

DECLSPEC_HIDDEN void __thiscall ITextHostImpl_TxInvalidateRect ( ITextHost *  iface,
LPCRECT  prc,
BOOL  fMode 
)

Definition at line 143 of file txthost.c.

144 {
146  InvalidateRect(This->hWnd, prc, fMode);
147 }
BOOL WINAPI InvalidateRect(_In_opt_ HWND, _In_opt_ LPCRECT, _In_ BOOL)
static ITextHostImpl * impl_from_ITextHost(ITextHost *iface)
Definition: txthost.c:67
_Out_ LPRECT prc
Definition: ntgdi.h:1658

◆ ITextHostImpl_TxKillTimer()

DECLSPEC_HIDDEN void __thiscall ITextHostImpl_TxKillTimer ( ITextHost *  iface,
UINT  idTimer 
)

Definition at line 183 of file txthost.c.

184 {
186  KillTimer(This->hWnd, idTimer);
187 }
static ITextHostImpl * impl_from_ITextHost(ITextHost *iface)
Definition: txthost.c:67
BOOL WINAPI KillTimer(_In_opt_ HWND, _In_ UINT_PTR)

◆ ITextHostImpl_TxNotify()

DECLSPEC_HIDDEN HRESULT __thiscall ITextHostImpl_TxNotify ( ITextHost *  iface,
DWORD  iNotify,
void pv 
)

Definition at line 404 of file txthost.c.

405 {
407  ME_TextEditor *editor = (ME_TextEditor*)GetWindowLongPtrW(This->hWnd, 0);
408  HWND hwnd = This->hWnd;
409  UINT id;
410 
411  if (!editor || !editor->hwndParent) return S_OK;
412 
413  id = GetWindowLongW(hwnd, GWLP_ID);
414 
415  switch (iNotify)
416  {
417  case EN_DROPFILES:
418  case EN_LINK:
419  case EN_OLEOPFAILED:
420  case EN_PROTECTED:
421  case EN_REQUESTRESIZE:
422  case EN_SAVECLIPBOARD:
423  case EN_SELCHANGE:
424  case EN_STOPNOUNDO:
425  {
426  /* FIXME: Verify this assumption that pv starts with NMHDR. */
427  NMHDR *info = pv;
428  if (!info)
429  return E_FAIL;
430 
431  info->hwndFrom = hwnd;
432  info->idFrom = id;
433  info->code = iNotify;
434  SendMessageW(editor->hwndParent, WM_NOTIFY, id, (LPARAM)info);
435  break;
436  }
437 
438  case EN_UPDATE:
439  /* Only sent when the window is visible. */
440  if (!IsWindowVisible(hwnd))
441  break;
442  /* Fall through */
443  case EN_CHANGE:
444  case EN_ERRSPACE:
445  case EN_HSCROLL:
446  case EN_KILLFOCUS:
447  case EN_MAXTEXT:
448  case EN_SETFOCUS:
449  case EN_VSCROLL:
450  SendMessageW(editor->hwndParent, WM_COMMAND, MAKEWPARAM(id, iNotify), (LPARAM)hwnd);
451  break;
452 
453  case EN_MSGFILTER:
454  FIXME("EN_MSGFILTER is documented as not being sent to TxNotify\n");
455  /* fall through */
456  default:
457  return E_FAIL;
458  }
459  return S_OK;
460 }
const DOCKBAR PVOID HWND HWND * hwnd
Definition: tooldock.h:22
#define EN_MAXTEXT
Definition: winuser.h:2013
#define MAKEWPARAM(l, h)
Definition: winuser.h:3989
#define EN_SELCHANGE
Definition: richedit.h:193
#define EN_PROTECTED
Definition: richedit.h:195
#define GetWindowLongPtrW
Definition: winuser.h:4809
#define E_FAIL
Definition: ddrawi.h:102
#define EN_SAVECLIPBOARD
Definition: richedit.h:199
#define EN_KILLFOCUS
Definition: winuser.h:2012
#define EN_SETFOCUS
Definition: winuser.h:2014
#define FIXME(fmt,...)
Definition: debug.h:111
LONG WINAPI GetWindowLongW(_In_ HWND, _In_ int)
#define EN_ERRSPACE
Definition: winuser.h:2010
LONG_PTR LPARAM
Definition: windef.h:208
#define EN_MSGFILTER
Definition: richedit.h:191
#define EN_DROPFILES
Definition: richedit.h:194
static ITextHostImpl * impl_from_ITextHost(ITextHost *iface)
Definition: txthost.c:67
#define EN_OLEOPFAILED
Definition: richedit.h:200
#define WM_COMMAND
Definition: winuser.h:1727
#define EN_HSCROLL
Definition: winuser.h:2011
#define EN_VSCROLL
Definition: winuser.h:2016
#define S_OK
Definition: intsafe.h:52
#define EN_LINK
Definition: richedit.h:202
LRESULT WINAPI SendMessageW(_In_ HWND, _In_ UINT, _In_ WPARAM, _In_ LPARAM)
unsigned int UINT
Definition: ndis.h:50
GLenum GLuint id
Definition: glext.h:5579
BOOL WINAPI IsWindowVisible(_In_ HWND)
#define EN_UPDATE
Definition: winuser.h:2015
#define EN_STOPNOUNDO
Definition: richedit.h:197
#define EN_REQUESTRESIZE
Definition: richedit.h:192
#define GWLP_ID
Definition: winuser.h:854
#define WM_NOTIFY
Definition: richedit.h:61
#define EN_CHANGE
Definition: winuser.h:2009

◆ ITextHostImpl_TxReleaseDC()

DECLSPEC_HIDDEN INT __thiscall ITextHostImpl_TxReleaseDC ( ITextHost *  iface,
HDC  hdc 
)

Definition at line 112 of file txthost.c.

113 {
115  return ReleaseDC(This->hWnd, hdc);
116 }
int WINAPI ReleaseDC(_In_opt_ HWND, _In_ HDC)
static ITextHostImpl * impl_from_ITextHost(ITextHost *iface)
Definition: txthost.c:67
HDC hdc
Definition: main.c:9

◆ ITextHostImpl_TxScreenToClient()

DECLSPEC_HIDDEN BOOL __thiscall ITextHostImpl_TxScreenToClient ( ITextHost *  iface,
LPPOINT  lppt 
)

Definition at line 218 of file txthost.c.

219 {
221  return ScreenToClient(This->hWnd, lppt);
222 }
static ITextHostImpl * impl_from_ITextHost(ITextHost *iface)
Definition: txthost.c:67
BOOL WINAPI ScreenToClient(_In_ HWND, _Inout_ LPPOINT)

◆ ITextHostImpl_TxScrollWindowEx()

DECLSPEC_HIDDEN void __thiscall ITextHostImpl_TxScrollWindowEx ( ITextHost *  iface,
INT  dx,
INT  dy,
LPCRECT  lprcScroll,
LPCRECT  lprcClip,
HRGN  hRgnUpdate,
LPRECT  lprcUpdate,
UINT  fuScroll 
)

Definition at line 189 of file txthost.c.

192 {
194  ScrollWindowEx(This->hWnd, dx, dy, lprcScroll, lprcClip,
195  hRgnUpdate, lprcUpdate, fuScroll);
196 }
GLint dy
Definition: linetemp.h:97
int WINAPI ScrollWindowEx(_In_ HWND, _In_ int, _In_ int, _In_opt_ LPCRECT, _In_opt_ LPCRECT, _In_opt_ HRGN, _Out_opt_ LPRECT, _In_ UINT)
static ITextHostImpl * impl_from_ITextHost(ITextHost *iface)
Definition: txthost.c:67
GLint dx
Definition: linetemp.h:97

◆ ITextHostImpl_TxSetCapture()

DECLSPEC_HIDDEN void __thiscall ITextHostImpl_TxSetCapture ( ITextHost *  iface,
BOOL  fCapture 
)

Definition at line 198 of file txthost.c.

199 {
201  if (fCapture)
202  SetCapture(This->hWnd);
203  else
204  ReleaseCapture();
205 }
static ITextHostImpl * impl_from_ITextHost(ITextHost *iface)
Definition: txthost.c:67
HWND WINAPI SetCapture(_In_ HWND hWnd)
BOOL WINAPI ReleaseCapture(void)
Definition: message.c:2889

◆ ITextHostImpl_TxSetCaretPos()

DECLSPEC_HIDDEN BOOL __thiscall ITextHostImpl_TxSetCaretPos ( ITextHost *  iface,
INT  x,
INT  y 
)

Definition at line 171 of file txthost.c.

173 {
174  return SetCaretPos(x, y);
175 }
GLint GLint GLint GLint GLint x
Definition: gl.h:1548
GLint GLint GLint GLint GLint GLint y
Definition: gl.h:1548
BOOL WINAPI SetCaretPos(_In_ int, _In_ int)

◆ ITextHostImpl_TxSetCursor()

DECLSPEC_HIDDEN void __thiscall ITextHostImpl_TxSetCursor ( ITextHost *  iface,
HCURSOR  hcur,
BOOL  fText 
)

Definition at line 213 of file txthost.c.

214 {
215  SetCursor(hcur);
216 }
HCURSOR WINAPI SetCursor(_In_opt_ HCURSOR)

◆ ITextHostImpl_TxSetFocus()

DECLSPEC_HIDDEN void __thiscall ITextHostImpl_TxSetFocus ( ITextHost *  iface)

Definition at line 207 of file txthost.c.

208 {
210  SetFocus(This->hWnd);
211 }
HWND WINAPI SetFocus(_In_opt_ HWND)
static ITextHostImpl * impl_from_ITextHost(ITextHost *iface)
Definition: txthost.c:67

◆ ITextHostImpl_TxSetScrollPos()

DECLSPEC_HIDDEN BOOL __thiscall ITextHostImpl_TxSetScrollPos ( ITextHost *  iface,
INT  fnBar,
INT  nPos,
BOOL  fRedraw 
)

Definition at line 137 of file txthost.c.

138 {
140  return SetScrollPos(This->hWnd, fnBar, nPos, fRedraw) != 0;
141 }
static ITextHostImpl * impl_from_ITextHost(ITextHost *iface)
Definition: txthost.c:67
int WINAPI SetScrollPos(_In_ HWND, _In_ int, _In_ int, _In_ BOOL)

◆ ITextHostImpl_TxSetScrollRange()

DECLSPEC_HIDDEN BOOL __thiscall ITextHostImpl_TxSetScrollRange ( ITextHost *  iface,
INT  fnBar,
LONG  nMinPos,
INT  nMaxPos,
BOOL  fRedraw 
)

Definition at line 130 of file txthost.c.

132 {
134  return SetScrollRange(This->hWnd, fnBar, nMinPos, nMaxPos, fRedraw);
135 }
static ITextHostImpl * impl_from_ITextHost(ITextHost *iface)
Definition: txthost.c:67
BOOL WINAPI SetScrollRange(_In_ HWND, _In_ int, _In_ int, _In_ int, _In_ BOOL)

◆ ITextHostImpl_TxSetTimer()

DECLSPEC_HIDDEN BOOL __thiscall ITextHostImpl_TxSetTimer ( ITextHost *  iface,
UINT  idTimer,
UINT  uTimeout 
)

Definition at line 177 of file txthost.c.

178 {
180  return SetTimer(This->hWnd, idTimer, uTimeout, NULL) != 0;
181 }
UINT_PTR WINAPI SetTimer(_In_opt_ HWND, _In_ UINT_PTR, _In_ UINT, _In_opt_ TIMERPROC)
static ITextHostImpl * impl_from_ITextHost(ITextHost *iface)
Definition: txthost.c:67
#define NULL
Definition: types.h:112

◆ ITextHostImpl_TxShowCaret()

DECLSPEC_HIDDEN BOOL __thiscall ITextHostImpl_TxShowCaret ( ITextHost *  iface,
BOOL  fShow 
)

Definition at line 162 of file txthost.c.

163 {
165  if (fShow)
166  return ShowCaret(This->hWnd);
167  else
168  return HideCaret(This->hWnd);
169 }
BOOL WINAPI HideCaret(_In_opt_ HWND)
static ITextHostImpl * impl_from_ITextHost(ITextHost *iface)
Definition: txthost.c:67
BOOL WINAPI ShowCaret(_In_opt_ HWND)

◆ ITextHostImpl_TxShowScrollBar()

DECLSPEC_HIDDEN BOOL __thiscall ITextHostImpl_TxShowScrollBar ( ITextHost *  iface,
INT  fnBar,
BOOL  fShow 
)

Definition at line 118 of file txthost.c.

119 {
121  return ShowScrollBar(This->hWnd, fnBar, fShow);
122 }
BOOL WINAPI ShowScrollBar(_In_ HWND, _In_ int, _In_ BOOL)
static ITextHostImpl * impl_from_ITextHost(ITextHost *iface)
Definition: txthost.c:67

◆ ITextHostImpl_TxViewChange()

DECLSPEC_HIDDEN void __thiscall ITextHostImpl_TxViewChange ( ITextHost *  iface,
BOOL  fUpdate 
)

Definition at line 149 of file txthost.c.

150 {
152  if (fUpdate)
153  UpdateWindow(This->hWnd);
154 }
BOOL WINAPI UpdateWindow(_In_ HWND)
static ITextHostImpl * impl_from_ITextHost(ITextHost *iface)
Definition: txthost.c:67

◆ ME_CreateTextHost()

ITextHost* ME_CreateTextHost ( HWND  hwnd,
CREATESTRUCTW cs,
BOOL  bEmulateVersion10 
)

Definition at line 44 of file txthost.c.

45 {
46  ITextHostImpl *texthost;
47 
48  texthost = CoTaskMemAlloc(sizeof(*texthost));
49  if (!texthost) return NULL;
50 
51  texthost->ITextHost_iface.lpVtbl = &textHostVtbl;
52  texthost->ref = 1;
53  texthost->hWnd = hwnd;
54  texthost->bEmulateVersion10 = bEmulateVersion10;
55  memset( &texthost->para_fmt, 0, sizeof(texthost->para_fmt) );
56  texthost->para_fmt.cbSize = sizeof(texthost->para_fmt);
57  texthost->para_fmt.dwMask = PFM_ALIGNMENT;
58  texthost->para_fmt.wAlignment = PFA_LEFT;
59  if (cs->style & ES_RIGHT)
60  texthost->para_fmt.wAlignment = PFA_RIGHT;
61  if (cs->style & ES_CENTER)
62  texthost->para_fmt.wAlignment = PFA_CENTER;
63 
64  return &texthost->ITextHost_iface;
65 }
#define PFA_RIGHT
Definition: richedit.h:922
#define ES_CENTER
Definition: pedump.c:665
const DOCKBAR PVOID HWND HWND * hwnd
Definition: tooldock.h:22
WORD wAlignment
Definition: richedit.h:673
#define PFM_ALIGNMENT
Definition: richedit.h:841
uint32_t cs
Definition: isohybrid.c:75
#define ES_RIGHT
Definition: pedump.c:666
LONG ref
Definition: txthost.c:36
HWND hWnd
Definition: txthost.c:37
DWORD dwMask
Definition: richedit.h:667
#define PFA_CENTER
Definition: richedit.h:923
ITextHost ITextHost_iface
Definition: txthost.c:35
PARAFORMAT2 para_fmt
Definition: txthost.c:39
BOOL bEmulateVersion10
Definition: txthost.c:38
static const ITextHostVtbl textHostVtbl
Definition: txthost.c:42
#define NULL
Definition: types.h:112
#define PFA_LEFT
Definition: richedit.h:921
UINT cbSize
Definition: richedit.h:666
#define memset(x, y, z)
Definition: compat.h:39
LPVOID WINAPI CoTaskMemAlloc(SIZE_T size)
Definition: ifs.c:426

Referenced by create_windowed_editor().

◆ WINE_DEFAULT_DEBUG_CHANNEL()

WINE_DEFAULT_DEBUG_CHANNEL ( richedit  )

Variable Documentation

◆ textHostVtbl

static const ITextHostVtbl textHostVtbl
static

Definition at line 42 of file txthost.c.

Referenced by ME_CreateTextHost().