ReactOS 0.4.16-dev-1067-ge98bba2
txthost.c File Reference
#include "editor.h"
#include "ole2.h"
#include "richole.h"
#include "imm.h"
#include "textserv.h"
#include "wine/debug.h"
#include "editstr.h"
#include "rtf.h"
#include "undocuser.h"
#include "riched20.h"
Include dependency graph for txthost.c:

Go to the source code of this file.

Classes

struct  host
 

Macros

#define COBJMACROS
 

Functions

 WINE_DEFAULT_DEBUG_CHANNEL (richedit)
 
static void host_init_props (struct host *host)
 
struct hosthost_create (HWND hwnd, CREATESTRUCTW *cs, BOOL emulate_10)
 
static struct hostimpl_from_ITextHost (ITextHost2 *iface)
 
static HRESULT WINAPI ITextHostImpl_QueryInterface (ITextHost2 *iface, REFIID iid, void **obj)
 
static ULONG WINAPI ITextHostImpl_AddRef (ITextHost2 *iface)
 
static ULONG WINAPI ITextHostImpl_Release (ITextHost2 *iface)
 
DECLSPEC_HIDDEN HDC __thiscall ITextHostImpl_TxGetDC (ITextHost2 *iface)
 
DECLSPEC_HIDDEN INT __thiscall ITextHostImpl_TxReleaseDC (ITextHost2 *iface, HDC hdc)
 
DECLSPEC_HIDDEN BOOL __thiscall ITextHostImpl_TxShowScrollBar (ITextHost2 *iface, INT bar, BOOL show)
 
DECLSPEC_HIDDEN BOOL __thiscall ITextHostImpl_TxEnableScrollBar (ITextHost2 *iface, INT bar, INT arrows)
 
DECLSPEC_HIDDEN BOOL __thiscall ITextHostImpl_TxSetScrollRange (ITextHost2 *iface, INT bar, LONG min_pos, INT max_pos, BOOL redraw)
 
DECLSPEC_HIDDEN BOOL __thiscall ITextHostImpl_TxSetScrollPos (ITextHost2 *iface, INT bar, INT pos, BOOL redraw)
 
DECLSPEC_HIDDEN void __thiscall ITextHostImpl_TxInvalidateRect (ITextHost2 *iface, const RECT *rect, BOOL mode)
 
DECLSPEC_HIDDEN void __thiscall ITextHostImpl_TxViewChange (ITextHost2 *iface, BOOL update)
 
DECLSPEC_HIDDEN BOOL __thiscall ITextHostImpl_TxCreateCaret (ITextHost2 *iface, HBITMAP bitmap, INT width, INT height)
 
DECLSPEC_HIDDEN BOOL __thiscall ITextHostImpl_TxShowCaret (ITextHost2 *iface, BOOL show)
 
DECLSPEC_HIDDEN BOOL __thiscall ITextHostImpl_TxSetCaretPos (ITextHost2 *iface, INT x, INT y)
 
DECLSPEC_HIDDEN BOOL __thiscall ITextHostImpl_TxSetTimer (ITextHost2 *iface, UINT id, UINT timeout)
 
DECLSPEC_HIDDEN void __thiscall ITextHostImpl_TxKillTimer (ITextHost2 *iface, UINT id)
 
DECLSPEC_HIDDEN void __thiscall ITextHostImpl_TxScrollWindowEx (ITextHost2 *iface, INT dx, INT dy, const RECT *scroll, const RECT *clip, HRGN update_rgn, RECT *update_rect, UINT flags)
 
DECLSPEC_HIDDEN void __thiscall ITextHostImpl_TxSetCapture (ITextHost2 *iface, BOOL capture)
 
DECLSPEC_HIDDEN void __thiscall ITextHostImpl_TxSetFocus (ITextHost2 *iface)
 
DECLSPEC_HIDDEN void __thiscall ITextHostImpl_TxSetCursor (ITextHost2 *iface, HCURSOR cursor, BOOL text)
 
DECLSPEC_HIDDEN BOOL __thiscall ITextHostImpl_TxScreenToClient (ITextHost2 *iface, POINT *pt)
 
DECLSPEC_HIDDEN BOOL __thiscall ITextHostImpl_TxClientToScreen (ITextHost2 *iface, POINT *pt)
 
DECLSPEC_HIDDEN HRESULT __thiscall ITextHostImpl_TxActivate (ITextHost2 *iface, LONG *old_state)
 
DECLSPEC_HIDDEN HRESULT __thiscall ITextHostImpl_TxDeactivate (ITextHost2 *iface, LONG new_state)
 
DECLSPEC_HIDDEN HRESULT __thiscall ITextHostImpl_TxGetClientRect (ITextHost2 *iface, RECT *rect)
 
DECLSPEC_HIDDEN HRESULT __thiscall ITextHostImpl_TxGetViewInset (ITextHost2 *iface, RECT *rect)
 
DECLSPEC_HIDDEN HRESULT __thiscall ITextHostImpl_TxGetCharFormat (ITextHost2 *iface, const CHARFORMATW **ppCF)
 
DECLSPEC_HIDDEN HRESULT __thiscall ITextHostImpl_TxGetParaFormat (ITextHost2 *iface, const PARAFORMAT **fmt)
 
DECLSPEC_HIDDEN COLORREF __thiscall ITextHostImpl_TxGetSysColor (ITextHost2 *iface, int index)
 
DECLSPEC_HIDDEN HRESULT __thiscall ITextHostImpl_TxGetBackStyle (ITextHost2 *iface, TXTBACKSTYLE *style)
 
DECLSPEC_HIDDEN HRESULT __thiscall ITextHostImpl_TxGetMaxLength (ITextHost2 *iface, DWORD *length)
 
DECLSPEC_HIDDEN HRESULT __thiscall ITextHostImpl_TxGetScrollBars (ITextHost2 *iface, DWORD *scrollbars)
 
DECLSPEC_HIDDEN HRESULT __thiscall ITextHostImpl_TxGetPasswordChar (ITextHost2 *iface, WCHAR *c)
 
DECLSPEC_HIDDEN HRESULT __thiscall ITextHostImpl_TxGetAcceleratorPos (ITextHost2 *iface, LONG *pos)
 
DECLSPEC_HIDDEN HRESULT __thiscall ITextHostImpl_TxGetExtent (ITextHost2 *iface, SIZEL *extent)
 
DECLSPEC_HIDDEN HRESULT __thiscall ITextHostImpl_OnTxCharFormatChange (ITextHost2 *iface, const CHARFORMATW *pcf)
 
DECLSPEC_HIDDEN HRESULT __thiscall ITextHostImpl_OnTxParaFormatChange (ITextHost2 *iface, const PARAFORMAT *ppf)
 
DECLSPEC_HIDDEN HRESULT __thiscall ITextHostImpl_TxGetPropertyBits (ITextHost2 *iface, DWORD mask, DWORD *bits)
 
DECLSPEC_HIDDEN HRESULT __thiscall ITextHostImpl_TxNotify (ITextHost2 *iface, DWORD iNotify, void *pv)
 
DECLSPEC_HIDDEN HIMC __thiscall ITextHostImpl_TxImmGetContext (ITextHost2 *iface)
 
DECLSPEC_HIDDEN void __thiscall ITextHostImpl_TxImmReleaseContext (ITextHost2 *iface, HIMC context)
 
DECLSPEC_HIDDEN HRESULT __thiscall ITextHostImpl_TxGetSelectionBarWidth (ITextHost2 *iface, LONG *width)
 
DECLSPEC_HIDDEN BOOL __thiscall ITextHostImpl_TxIsDoubleClickPending (ITextHost2 *iface)
 
DECLSPEC_HIDDEN HRESULT __thiscall ITextHostImpl_TxGetWindow (ITextHost2 *iface, HWND *hwnd)
 
DECLSPEC_HIDDEN HRESULT __thiscall ITextHostImpl_TxSetForegroundWindow (ITextHost2 *iface)
 
DECLSPEC_HIDDEN HPALETTE __thiscall ITextHostImpl_TxGetPalette (ITextHost2 *iface)
 
DECLSPEC_HIDDEN HRESULT __thiscall ITextHostImpl_TxGetEastAsianFlags (ITextHost2 *iface, LONG *flags)
 
DECLSPEC_HIDDEN HCURSOR __thiscall ITextHostImpl_TxSetCursor2 (ITextHost2 *iface, HCURSOR cursor, BOOL text)
 
DECLSPEC_HIDDEN void __thiscall ITextHostImpl_TxFreeTextServicesNotification (ITextHost2 *iface)
 
DECLSPEC_HIDDEN HRESULT __thiscall ITextHostImpl_TxGetEditStyle (ITextHost2 *iface, DWORD item, DWORD *data)
 
DECLSPEC_HIDDEN HRESULT __thiscall ITextHostImpl_TxGetWindowStyles (ITextHost2 *iface, DWORD *style, DWORD *ex_style)
 
DECLSPEC_HIDDEN HRESULT __thiscall ITextHostImpl_TxShowDropCaret (ITextHost2 *iface, BOOL show, HDC hdc, const RECT *rect)
 
DECLSPEC_HIDDEN HRESULT __thiscall ITextHostImpl_TxDestroyCaret (ITextHost2 *iface)
 
DECLSPEC_HIDDEN HRESULT __thiscall ITextHostImpl_TxGetHorzExtent (ITextHost2 *iface, LONG *horz_extent)
 
static const charget_msg_name (UINT msg)
 
static BOOL create_windowed_editor (HWND hwnd, CREATESTRUCTW *create, BOOL emulate_10)
 
static HRESULT get_lineA (ITextServices *text_srv, WPARAM wparam, LPARAM lparam, LRESULT *res)
 
static HRESULT get_text_rangeA (struct host *host, TEXTRANGEA *rangeA, LRESULT *res)
 
static HRESULT set_options (struct host *host, DWORD op, DWORD value, LRESULT *res)
 
static BOOL handle_dialog_enter (struct host *host)
 
static LRESULT send_msg_filter (struct host *host, UINT msg, WPARAM *wparam, LPARAM *lparam)
 
static LRESULT RichEditWndProc_common (HWND hwnd, UINT msg, WPARAM wparam, LPARAM lparam, BOOL unicode)
 
static LRESULT WINAPI RichEditWndProcW (HWND hwnd, UINT msg, WPARAM wparam, LPARAM lparam)
 
static LRESULT WINAPI RichEditWndProcA (HWND hwnd, UINT msg, WPARAM wparam, LPARAM lparam)
 
LRESULT WINAPI RichEditANSIWndProc (HWND hwnd, UINT msg, WPARAM wparam, LPARAM lparam)
 
LRESULT WINAPI RichEdit10ANSIWndProc (HWND hwnd, UINT msg, WPARAM wparam, LPARAM lparam)
 
static LRESULT WINAPI REComboWndProc (HWND hwnd, UINT msg, WPARAM wparam, LPARAM lparam)
 
static LRESULT WINAPI REListWndProc (HWND hwnd, UINT msg, WPARAM wparam, LPARAM lparam)
 
LRESULT WINAPI REExtendedRegisterClass (void)
 
static BOOL register_classes (HINSTANCE instance)
 
BOOL WINAPI DllMain (HINSTANCE instance, DWORD reason, void *reserved)
 

Variables

static const ITextHost2Vtbl textHostVtbl
 
static BOOL listbox_registered
 
static BOOL combobox_registered
 
static const char *const edit_messages []
 
static const char *const richedit_messages []
 

Macro Definition Documentation

◆ COBJMACROS

#define COBJMACROS

Definition at line 21 of file txthost.c.

Function Documentation

◆ create_windowed_editor()

static BOOL create_windowed_editor ( HWND  hwnd,
CREATESTRUCTW create,
BOOL  emulate_10 
)
static

Definition at line 870 of file txthost.c.

871{
872 struct host *host = host_create( hwnd, create, emulate_10 );
873 IUnknown *unk;
874 HRESULT hr;
875
876 if (!host) return FALSE;
877
878 hr = create_text_services( NULL, (ITextHost *)&host->ITextHost_iface, &unk, emulate_10 );
879 if (FAILED( hr ))
880 {
881 ITextHost2_Release( &host->ITextHost_iface );
882 return FALSE;
883 }
884 IUnknown_QueryInterface( unk, &IID_ITextServices, (void **)&host->text_srv );
885 IUnknown_Release( unk );
886
888
889 return TRUE;
890}
#define NULL
Definition: types.h:112
#define TRUE
Definition: types.h:120
#define FALSE
Definition: types.h:117
HRESULT create_text_services(IUnknown *outer, ITextHost *text_host, IUnknown **unk, BOOL emulate_10) DECLSPEC_HIDDEN
Definition: txtsrv.c:577
#define FAILED(hr)
Definition: intsafe.h:51
static const struct access_res create[16]
Definition: package.c:7505
__int3264 LONG_PTR
Definition: mstsclib_h.h:276
HRESULT hr
Definition: shlfolder.c:183
Definition: txthost.c:37
ITextHost2 ITextHost_iface
Definition: txthost.c:38
unsigned int emulate_10
Definition: txthost.c:42
ITextServices * text_srv
Definition: txthost.c:40
EXTERN_C const IID IID_ITextServices
Definition: textserv.h:36
struct host * host_create(HWND hwnd, CREATESTRUCTW *cs, BOOL emulate_10)
Definition: txthost.c:96
_In_ LONG _In_ HWND hwnd
Definition: winddi.h:4023
#define SetWindowLongPtrW
Definition: winuser.h:5366

Referenced by RichEdit10ANSIWndProc(), and RichEditWndProc_common().

◆ DllMain()

BOOL WINAPI DllMain ( HINSTANCE  instance,
DWORD  reason,
void reserved 
)

Definition at line 1654 of file txthost.c.

1655{
1656 switch (reason)
1657 {
1658 case DLL_PROCESS_ATTACH:
1661 me_heap = HeapCreate( 0, 0x10000, 0 );
1662 if (!register_classes( instance )) return FALSE;
1663 LookupInit();
1664 break;
1665
1666 case DLL_PROCESS_DETACH:
1667 if (reserved) break;
1671 UnregisterClassA( "RichEdit50A", 0 );
1672 if (listbox_registered) UnregisterClassW( L"REListBox20W", 0 );
1673 if (combobox_registered) UnregisterClassW( L"REComboBox20W", 0 );
1674 LookupCleanup();
1677 break;
1678 }
1679 return TRUE;
1680}
void release_typelib(void)
Definition: apps.c:159
static HINSTANCE instance
Definition: main.c:40
static WCHAR reason[MAX_STRING_RESOURCE_LEN]
Definition: object.c:1904
#define DLL_PROCESS_ATTACH
Definition: compat.h:131
#define DLL_PROCESS_DETACH
Definition: compat.h:130
BOOL WINAPI DisableThreadLibraryCalls(IN HMODULE hLibModule)
Definition: loader.c:85
HANDLE me_heap
Definition: editor.c:257
HINSTANCE dll_instance
Definition: editor.c:255
void LookupCleanup(void)
Definition: reader.c:2210
void LookupInit(void)
Definition: reader.c:2191
r reserved
Definition: btrfs.c:3006
HANDLE WINAPI HeapCreate(DWORD flOptions, SIZE_T dwInitialSize, SIZE_T dwMaximumSize)
Definition: heapmem.c:45
BOOL WINAPI HeapDestroy(HANDLE hHeap)
Definition: heapmem.c:85
static BOOL register_classes(void)
Definition: edit.c:2629
#define L(x)
Definition: ntvdm.h:50
static const WCHAR RICHEDIT_CLASS20W[]
Definition: richedit.h:50
#define RICHEDIT_CLASS20A
Definition: richedit.h:43
static const WCHAR MSFTEDIT_CLASS[]
Definition: richedit.h:40
static BOOL listbox_registered
Definition: txthost.c:60
static BOOL combobox_registered
Definition: txthost.c:61
BOOL WINAPI UnregisterClassA(_In_ LPCSTR, HINSTANCE)
BOOL WINAPI UnregisterClassW(_In_ LPCWSTR, HINSTANCE)

◆ get_lineA()

static HRESULT get_lineA ( ITextServices *  text_srv,
WPARAM  wparam,
LPARAM  lparam,
LRESULT res 
)
static

Definition at line 892 of file txthost.c.

893{
895 WORD sizeA;
896 HRESULT hr;
897 WCHAR *buf;
898
899 *res = 0;
900 sizeA = *(WORD *)lparam;
901 *(WORD *)lparam = 0;
902 if (!sizeA) return S_OK;
903 buf = heap_alloc( len * sizeof(WCHAR) );
904 if (!buf) return E_OUTOFMEMORY;
905 *(WORD *)buf = len;
907 if (hr == S_OK && len)
908 {
909 len = WideCharToMultiByte( CP_ACP, 0, buf, len, (char *)lparam, sizeA, NULL, NULL );
910 if (!len && GetLastError() == ERROR_INSUFFICIENT_BUFFER) len = sizeA;
911 if (len < sizeA) ((char *)lparam)[len] = '\0';
912 *res = len;
913 }
914 heap_free( buf );
915 return hr;
916}
@ lparam
Definition: SystemMenu.c:31
@ wparam
Definition: SystemMenu.c:30
static void * heap_alloc(size_t len)
Definition: appwiz.h:66
static BOOL heap_free(void *mem)
Definition: appwiz.h:76
#define ERROR_INSUFFICIENT_BUFFER
Definition: dderror.h:10
#define E_OUTOFMEMORY
Definition: ddrawi.h:100
#define CP_ACP
Definition: compat.h:109
#define WideCharToMultiByte
Definition: compat.h:111
#define ITextServices_TxSendMessage(This, a, b, c, d)
Definition: editor.h:408
unsigned short WORD
Definition: ntddk_ex.h:93
GLuint res
Definition: glext.h:9613
GLenum GLuint GLenum GLsizei const GLchar * buf
Definition: glext.h:7751
GLenum GLsizei len
Definition: glext.h:6722
#define USHRT_MAX
Definition: limits.h:38
#define S_OK
Definition: intsafe.h:52
DWORD WINAPI GetLastError(void)
Definition: except.c:1042
LONG_PTR LPARAM
Definition: windef.h:208
LONG_PTR LRESULT
Definition: windef.h:209
#define EM_GETLINE
Definition: winuser.h:2002
__wchar_t WCHAR
Definition: xmlstorage.h:180

Referenced by RichEditWndProc_common().

◆ get_msg_name()

static const char * get_msg_name ( UINT  msg)
static

Definition at line 861 of file txthost.c.

862{
863 if (msg >= EM_GETSEL && msg <= EM_CHARFROMPOS)
864 return edit_messages[msg - EM_GETSEL];
867 return "";
868}
#define msg(x)
Definition: auth_time.c:54
#define EM_GETIMEMODEBIAS
Definition: richedit.h:152
#define EM_CANPASTE
Definition: richedit.h:83
#define EM_CHARFROMPOS
Definition: richedit.h:78
static const char *const richedit_messages[]
Definition: txthost.c:837
static const char *const edit_messages[]
Definition: txthost.c:822
#define EM_GETSEL
Definition: winuser.h:2008

Referenced by REComboWndProc(), REListWndProc(), and RichEditWndProc_common().

◆ get_text_rangeA()

static HRESULT get_text_rangeA ( struct host host,
TEXTRANGEA rangeA,
LRESULT res 
)
static

Definition at line 918 of file txthost.c.

919{
921 HRESULT hr;
922 unsigned int count;
923 LRESULT len;
924
925 *res = 0;
926 if (rangeA->chrg.cpMin < 0) return S_OK;
928 range.chrg = rangeA->chrg;
929 if ((range.chrg.cpMin == 0 && range.chrg.cpMax == -1) || range.chrg.cpMax > len)
930 range.chrg.cpMax = len;
931 if (range.chrg.cpMin >= range.chrg.cpMax) return S_OK;
932 count = range.chrg.cpMax - range.chrg.cpMin + 1;
933 range.lpstrText = heap_alloc( count * sizeof(WCHAR) );
934 if (!range.lpstrText) return E_OUTOFMEMORY;
936 if (hr == S_OK && len)
937 {
938 if (!host->emulate_10) count = INT_MAX;
939 len = WideCharToMultiByte( CP_ACP, 0, range.lpstrText, -1, rangeA->lpstrText, count, NULL, NULL );
940 if (!host->emulate_10) *res = len - 1;
941 else
942 {
943 *res = count - 1;
944 rangeA->lpstrText[*res] = '\0';
945 }
946 }
947 heap_free( range.lpstrText );
948 return hr;
949}
GLuint GLuint GLsizei count
Definition: gl.h:1545
GLenum GLint * range
Definition: glext.h:7539
#define INT_MAX
Definition: intsafe.h:150
#define EM_GETTEXTRANGE
Definition: richedit.h:108
LONG cpMax
Definition: richedit.h:501
LONG cpMin
Definition: richedit.h:500
CHARRANGE chrg
Definition: richedit.h:508
LPSTR lpstrText
Definition: richedit.h:509
#define WM_GETTEXTLENGTH
Definition: winuser.h:1630

Referenced by RichEditWndProc_common().

◆ handle_dialog_enter()

static BOOL handle_dialog_enter ( struct host host)
static

Definition at line 1038 of file txthost.c.

1039{
1040 BOOL ctrl_is_down = GetKeyState( VK_CONTROL ) & 0x8000;
1041
1042 if (ctrl_is_down) return TRUE;
1043
1044 if (host->want_return) return FALSE;
1045
1046 if (host->parent)
1047 {
1048 DWORD id = SendMessageW( host->parent, DM_GETDEFID, 0, 0 );
1049 if (HIWORD( id ) == DC_HASDEFID)
1050 {
1051 HWND ctrl = GetDlgItem( host->parent, LOWORD( id ));
1052 if (ctrl)
1053 {
1056 }
1057 }
1058 }
1059 return TRUE;
1060}
unsigned int BOOL
Definition: ntddk_ex.h:94
unsigned long DWORD
Definition: ntddk_ex.h:95
#define ctrl
Definition: input.c:1756
#define LOWORD(l)
Definition: pedump.c:82
HWND parent
Definition: txthost.c:41
unsigned int want_return
Definition: txthost.c:44
#define HIWORD(l)
Definition: typedefs.h:247
UINT_PTR WPARAM
Definition: windef.h:207
BOOL WINAPI PostMessageW(_In_opt_ HWND, _In_ UINT, _In_ WPARAM, _In_ LPARAM)
#define VK_CONTROL
Definition: winuser.h:2214
#define DC_HASDEFID
Definition: winuser.h:2620
HWND WINAPI GetDlgItem(_In_opt_ HWND, _In_ int)
#define WM_NEXTDLGCTL
Definition: winuser.h:1654
#define VK_RETURN
Definition: winuser.h:2212
#define WM_KEYDOWN
Definition: winuser.h:1726
#define DM_GETDEFID
Definition: winuser.h:2109
LRESULT WINAPI SendMessageW(_In_ HWND, _In_ UINT, _In_ WPARAM, _In_ LPARAM)
SHORT WINAPI GetKeyState(_In_ int)

Referenced by RichEditWndProc_common().

◆ host_create()

struct host * host_create ( HWND  hwnd,
CREATESTRUCTW cs,
BOOL  emulate_10 
)

Definition at line 96 of file txthost.c.

97{
98 struct host *texthost;
99
100 texthost = CoTaskMemAlloc(sizeof(*texthost));
101 if (!texthost) return NULL;
102
103 texthost->ITextHost_iface.lpVtbl = &textHostVtbl;
104 texthost->ref = 1;
105 texthost->text_srv = NULL;
106 texthost->window = hwnd;
107 texthost->parent = cs->hwndParent;
108 texthost->emulate_10 = emulate_10;
109 texthost->dialog_mode = 0;
110 memset( &texthost->para_fmt, 0, sizeof(texthost->para_fmt) );
111 texthost->para_fmt.cbSize = sizeof(texthost->para_fmt);
112 texthost->para_fmt.dwMask = PFM_ALIGNMENT;
113 texthost->para_fmt.wAlignment = PFA_LEFT;
114 if (cs->style & ES_RIGHT)
115 texthost->para_fmt.wAlignment = PFA_RIGHT;
116 if (cs->style & ES_CENTER)
117 texthost->para_fmt.wAlignment = PFA_CENTER;
118 host_init_props( texthost );
119 texthost->event_mask = 0;
120 texthost->use_set_rect = 0;
121 SetRectEmpty( &texthost->set_rect );
122 GetClientRect( hwnd, &texthost->client_rect );
123 texthost->use_back_colour = 0;
124 texthost->password_char = (texthost->props & TXTBIT_USEPASSWORD) ? '*' : 0;
125 texthost->defer_release = 0;
126 texthost->notify_level = 0;
127
128 return texthost;
129}
#define cs
Definition: i386-dis.c:442
LPVOID WINAPI CoTaskMemAlloc(SIZE_T size)
Definition: ifs.c:426
#define ES_CENTER
Definition: pedump.c:665
#define ES_RIGHT
Definition: pedump.c:666
#define PFA_RIGHT
Definition: richedit.h:922
#define PFA_CENTER
Definition: richedit.h:923
#define PFA_LEFT
Definition: richedit.h:921
#define PFM_ALIGNMENT
Definition: richedit.h:841
#define memset(x, y, z)
Definition: compat.h:39
WORD wAlignment
Definition: richedit.h:673
DWORD dwMask
Definition: richedit.h:667
UINT cbSize
Definition: richedit.h:666
HWND window
Definition: txthost.c:41
DWORD event_mask
Definition: txthost.c:51
RECT client_rect
Definition: txthost.c:52
unsigned int notify_level
Definition: txthost.c:55
LONG ref
Definition: txthost.c:39
unsigned int defer_release
Definition: txthost.c:49
PARAFORMAT2 para_fmt
Definition: txthost.c:50
unsigned int dialog_mode
Definition: txthost.c:43
unsigned int use_set_rect
Definition: txthost.c:47
RECT set_rect
Definition: txthost.c:52
unsigned int use_back_colour
Definition: txthost.c:48
DWORD props
Definition: txthost.c:51
WCHAR password_char
Definition: txthost.c:54
#define TXTBIT_USEPASSWORD
Definition: textserv.h:189
static const ITextHost2Vtbl textHostVtbl
Definition: txthost.c:58
static void host_init_props(struct host *host)
Definition: txthost.c:63
BOOL WINAPI GetClientRect(_In_ HWND, _Out_ LPRECT)
BOOL WINAPI SetRectEmpty(_Out_ LPRECT)

Referenced by create_windowed_editor().

◆ host_init_props()

static void host_init_props ( struct host host)
static

Definition at line 63 of file txthost.c.

64{
66
68
69 /* text services assumes the scrollbars are originally not shown, so hide them.
70 However with ES_DISABLENOSCROLL it'll immediately show them, so don't bother */
72
77
86
88
91
94}
Arabic default style
Definition: afstyles.h:94
if(dx< 0)
Definition: linetemp.h:194
#define ES_PASSWORD
Definition: pedump.c:670
#define ES_READONLY
Definition: pedump.c:675
#define ES_AUTOVSCROLL
Definition: pedump.c:671
#define ES_WANTRETURN
Definition: pedump.c:676
#define ES_NOHIDESEL
Definition: pedump.c:673
#define WS_VSCROLL
Definition: pedump.c:627
#define ES_AUTOHSCROLL
Definition: pedump.c:672
#define WS_HSCROLL
Definition: pedump.c:628
#define ES_MULTILINE
Definition: pedump.c:667
#define ES_NOOLEDRAGDROP
Definition: richedit.h:223
#define ES_DISABLENOSCROLL
Definition: richedit.h:224
#define ES_SAVESEL
Definition: richedit.h:226
#define ES_SELECTIONBAR
Definition: richedit.h:230
#define ES_VERTICAL
Definition: richedit.h:229
unsigned int sel_bar
Definition: txthost.c:45
DWORD scrollbars
Definition: txthost.c:51
unsigned int client_edge
Definition: txthost.c:46
#define TXTBIT_WORDWRAP
Definition: textserv.h:195
#define TXTBIT_MULTILINE
Definition: textserv.h:186
#define TXTBIT_VERTICAL
Definition: textserv.h:193
#define TXTBIT_ALLOWBEEP
Definition: textserv.h:196
#define TXTBIT_SAVESELECTION
Definition: textserv.h:191
#define TXTBIT_READONLY
Definition: textserv.h:187
#define TXTBIT_RICHTEXT
Definition: textserv.h:185
#define TXTBIT_HIDESELECTION
Definition: textserv.h:190
#define TXTBIT_DISABLEDRAG
Definition: textserv.h:197
LONG WINAPI GetWindowLongW(_In_ HWND, _In_ int)
#define SB_BOTH
Definition: winuser.h:555
#define WS_EX_CLIENTEDGE
Definition: winuser.h:384
BOOL WINAPI ShowScrollBar(_In_ HWND, _In_ int, _In_ BOOL)
#define GWL_STYLE
Definition: winuser.h:863
#define GWL_EXSTYLE
Definition: winuser.h:862

Referenced by host_create().

◆ impl_from_ITextHost()

◆ ITextHostImpl_AddRef()

static ULONG WINAPI ITextHostImpl_AddRef ( ITextHost2 *  iface)
static

Definition at line 151 of file txthost.c.

152{
153 struct host *host = impl_from_ITextHost( iface );
155 return ref;
156}
#define InterlockedIncrement
Definition: armddk.h:53
Definition: send.c:48
static struct host * impl_from_ITextHost(ITextHost2 *iface)
Definition: txthost.c:131
uint32_t ULONG
Definition: typedefs.h:59

◆ ITextHostImpl_OnTxCharFormatChange()

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

Definition at line 450 of file txthost.c.

451{
452 return S_OK;
453}

◆ ITextHostImpl_OnTxParaFormatChange()

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

Definition at line 456 of file txthost.c.

457{
458 return S_OK;
459}

◆ ITextHostImpl_QueryInterface()

static HRESULT WINAPI ITextHostImpl_QueryInterface ( ITextHost2 *  iface,
REFIID  iid,
void **  obj 
)
static

Definition at line 136 of file txthost.c.

137{
138 struct host *host = impl_from_ITextHost( iface );
139
140 if (IsEqualIID( iid, &IID_IUnknown ) || IsEqualIID( iid, &IID_ITextHost ) || IsEqualIID( iid, &IID_ITextHost2 ))
141 {
143 ITextHost_AddRef( (ITextHost *)*obj );
144 return S_OK;
145 }
146
147 FIXME( "Unknown interface: %s\n", debugstr_guid( iid ) );
148 return E_NOINTERFACE;
149}
#define FIXME(fmt,...)
Definition: precomp.h:53
const GUID IID_IUnknown
#define debugstr_guid
Definition: kernel32.h:35
#define IsEqualIID(riid1, riid2)
Definition: guiddef.h:95
EXTERN_C const IID IID_ITextHost
Definition: textserv.h:37
EXTERN_C const IID IID_ITextHost2
Definition: textserv.h:38
#define E_NOINTERFACE
Definition: winerror.h:2364

◆ ITextHostImpl_Release()

static ULONG WINAPI ITextHostImpl_Release ( ITextHost2 *  iface)
static

Definition at line 158 of file txthost.c.

159{
160 struct host *host = impl_from_ITextHost( iface );
162
163 if (!ref)
164 {
165 SetWindowLongPtrW( host->window, 0, 0 );
166 ITextServices_Release( host->text_srv );
168 }
169 return ref;
170}
#define InterlockedDecrement
Definition: armddk.h:52
VOID WINAPI CoTaskMemFree(LPVOID ptr)
Definition: ifs.c:442

◆ ITextHostImpl_TxActivate()

DECLSPEC_HIDDEN HRESULT __thiscall ITextHostImpl_TxActivate ( ITextHost2 *  iface,
LONG old_state 
)

Definition at line 344 of file txthost.c.

345{
346 struct host *host = impl_from_ITextHost( iface );
347 *old_state = HandleToLong( SetActiveWindow( host->window ) );
348 return *old_state ? S_OK : E_FAIL;
349}
#define HandleToLong(h)
Definition: basetsd.h:80
#define E_FAIL
Definition: ddrawi.h:102
HWND WINAPI SetActiveWindow(_In_ HWND)

◆ ITextHostImpl_TxClientToScreen()

DECLSPEC_HIDDEN BOOL __thiscall ITextHostImpl_TxClientToScreen ( ITextHost2 *  iface,
POINT pt 
)

Definition at line 337 of file txthost.c.

338{
339 struct host *host = impl_from_ITextHost( iface );
340 return ClientToScreen( host->window, pt );
341}
#define pt(x, y)
Definition: drawing.c:79
BOOL WINAPI ClientToScreen(_In_ HWND, _Inout_ LPPOINT)

◆ ITextHostImpl_TxCreateCaret()

DECLSPEC_HIDDEN BOOL __thiscall ITextHostImpl_TxCreateCaret ( ITextHost2 *  iface,
HBITMAP  bitmap,
INT  width,
INT  height 
)

Definition at line 265 of file txthost.c.

266{
267 struct host *host = impl_from_ITextHost( iface );
269}
GLint GLint GLsizei GLsizei height
Definition: gl.h:1546
GLint GLint GLsizei width
Definition: gl.h:1546
Definition: uimain.c:89
BOOL WINAPI CreateCaret(_In_ HWND, _In_opt_ HBITMAP, _In_ int, _In_ int)

◆ ITextHostImpl_TxDeactivate()

DECLSPEC_HIDDEN HRESULT __thiscall ITextHostImpl_TxDeactivate ( ITextHost2 *  iface,
LONG  new_state 
)

Definition at line 352 of file txthost.c.

353{
354 HWND ret = SetActiveWindow( LongToHandle( new_state ) );
355 return ret ? S_OK : E_FAIL;
356}
#define LongToHandle(h)
Definition: basetsd.h:82
int ret

◆ ITextHostImpl_TxDestroyCaret()

DECLSPEC_HIDDEN HRESULT __thiscall ITextHostImpl_TxDestroyCaret ( ITextHost2 *  iface)

Definition at line 613 of file txthost.c.

614{
615 return E_NOTIMPL;
616}
#define E_NOTIMPL
Definition: ddrawi.h:99

◆ ITextHostImpl_TxEnableScrollBar()

DECLSPEC_HIDDEN BOOL __thiscall ITextHostImpl_TxEnableScrollBar ( ITextHost2 *  iface,
INT  bar,
INT  arrows 
)

Definition at line 194 of file txthost.c.

195{
196 struct host *host = impl_from_ITextHost( iface );
197 return EnableScrollBar( host->window, bar, arrows );
198}
void bar()
Definition: ehthrow.cxx:142
BOOL WINAPI EnableScrollBar(_In_ HWND, _In_ UINT, _In_ UINT)

◆ ITextHostImpl_TxFreeTextServicesNotification()

DECLSPEC_HIDDEN void __thiscall ITextHostImpl_TxFreeTextServicesNotification ( ITextHost2 *  iface)

Definition at line 589 of file txthost.c.

590{
591 return;
592}

◆ ITextHostImpl_TxGetAcceleratorPos()

DECLSPEC_HIDDEN HRESULT __thiscall ITextHostImpl_TxGetAcceleratorPos ( ITextHost2 *  iface,
LONG pos 
)

Definition at line 437 of file txthost.c.

438{
439 *pos = -1;
440 return S_OK;
441}

◆ ITextHostImpl_TxGetBackStyle()

DECLSPEC_HIDDEN HRESULT __thiscall ITextHostImpl_TxGetBackStyle ( ITextHost2 *  iface,
TXTBACKSTYLE style 
)

Definition at line 405 of file txthost.c.

406{
408 return S_OK;
409}
@ TXTBACK_OPAQUE
Definition: textserv.h:165

◆ ITextHostImpl_TxGetCharFormat()

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

Definition at line 382 of file txthost.c.

383{
384 return E_NOTIMPL;
385}

◆ ITextHostImpl_TxGetClientRect()

DECLSPEC_HIDDEN HRESULT __thiscall ITextHostImpl_TxGetClientRect ( ITextHost2 *  iface,
RECT rect 
)

Definition at line 359 of file txthost.c.

360{
361 struct host *host = impl_from_ITextHost( iface );
362
363 if (!host->use_set_rect)
364 {
366 if (host->client_edge) rect->top += 1;
367 InflateRect( rect, -1, 0 );
368 }
369 else *rect = host->set_rect;
370
371 return S_OK;
372}
& rect
Definition: startmenu.cpp:1413
BOOL WINAPI InflateRect(_Inout_ LPRECT, _In_ int, _In_ int)

◆ ITextHostImpl_TxGetDC()

DECLSPEC_HIDDEN HDC __thiscall ITextHostImpl_TxGetDC ( ITextHost2 *  iface)

Definition at line 173 of file txthost.c.

174{
175 struct host *host = impl_from_ITextHost( iface );
176 return GetDC( host->window );
177}
HDC WINAPI GetDC(_In_opt_ HWND)

◆ ITextHostImpl_TxGetEastAsianFlags()

DECLSPEC_HIDDEN HRESULT __thiscall ITextHostImpl_TxGetEastAsianFlags ( ITextHost2 *  iface,
LONG flags 
)

Definition at line 577 of file txthost.c.

578{
579 return E_NOTIMPL;
580}

◆ ITextHostImpl_TxGetEditStyle()

DECLSPEC_HIDDEN HRESULT __thiscall ITextHostImpl_TxGetEditStyle ( ITextHost2 *  iface,
DWORD  item,
DWORD data 
)

Definition at line 595 of file txthost.c.

596{
597 return E_NOTIMPL;
598}

◆ ITextHostImpl_TxGetExtent()

DECLSPEC_HIDDEN HRESULT __thiscall ITextHostImpl_TxGetExtent ( ITextHost2 *  iface,
SIZEL extent 
)

Definition at line 444 of file txthost.c.

445{
446 return E_NOTIMPL;
447}

◆ ITextHostImpl_TxGetHorzExtent()

DECLSPEC_HIDDEN HRESULT __thiscall ITextHostImpl_TxGetHorzExtent ( ITextHost2 *  iface,
LONG horz_extent 
)

Definition at line 619 of file txthost.c.

620{
621 return E_NOTIMPL;
622}

◆ ITextHostImpl_TxGetMaxLength()

DECLSPEC_HIDDEN HRESULT __thiscall ITextHostImpl_TxGetMaxLength ( ITextHost2 *  iface,
DWORD length 
)

Definition at line 412 of file txthost.c.

413{
414 *length = INFINITE;
415 return S_OK;
416}
#define INFINITE
Definition: serial.h:102
GLuint GLsizei GLsizei * length
Definition: glext.h:6040

◆ ITextHostImpl_TxGetPalette()

DECLSPEC_HIDDEN HPALETTE __thiscall ITextHostImpl_TxGetPalette ( ITextHost2 *  iface)

Definition at line 571 of file txthost.c.

572{
573 return NULL;
574}

◆ ITextHostImpl_TxGetParaFormat()

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

Definition at line 388 of file txthost.c.

389{
390 struct host *host = impl_from_ITextHost( iface );
391 *fmt = (const PARAFORMAT *)&host->para_fmt;
392 return S_OK;
393}
Definition: dsound.c:943

◆ ITextHostImpl_TxGetPasswordChar()

DECLSPEC_HIDDEN HRESULT __thiscall ITextHostImpl_TxGetPasswordChar ( ITextHost2 *  iface,
WCHAR c 
)

Definition at line 428 of file txthost.c.

429{
430 struct host *host = impl_from_ITextHost( iface );
431
432 *c = host->password_char;
433 return *c ? S_OK : S_FALSE;
434}
const GLubyte * c
Definition: glext.h:8905
#define S_FALSE
Definition: winerror.h:2357

◆ ITextHostImpl_TxGetPropertyBits()

DECLSPEC_HIDDEN HRESULT __thiscall ITextHostImpl_TxGetPropertyBits ( ITextHost2 *  iface,
DWORD  mask,
DWORD bits 
)

Definition at line 462 of file txthost.c.

463{
464 struct host *host = impl_from_ITextHost( iface );
465
466 *bits = host->props & mask;
467 return S_OK;
468}
GLenum GLint GLuint mask
Definition: glext.h:6028
GLenum GLint GLenum GLsizei GLsizei GLsizei GLint GLsizei const GLvoid * bits
Definition: glext.h:10929

◆ ITextHostImpl_TxGetScrollBars()

DECLSPEC_HIDDEN HRESULT __thiscall ITextHostImpl_TxGetScrollBars ( ITextHost2 *  iface,
DWORD scrollbars 
)

Definition at line 419 of file txthost.c.

420{
421 struct host *host = impl_from_ITextHost( iface );
422
424 return S_OK;
425}

◆ ITextHostImpl_TxGetSelectionBarWidth()

DECLSPEC_HIDDEN HRESULT __thiscall ITextHostImpl_TxGetSelectionBarWidth ( ITextHost2 *  iface,
LONG width 
)

Definition at line 542 of file txthost.c.

543{
544 struct host *host = impl_from_ITextHost( iface );
545
546 *width = host->sel_bar ? 225 : 0; /* in HIMETRIC */
547 return S_OK;
548}

◆ ITextHostImpl_TxGetSysColor()

DECLSPEC_HIDDEN COLORREF __thiscall ITextHostImpl_TxGetSysColor ( ITextHost2 *  iface,
int  index 
)

Definition at line 396 of file txthost.c.

397{
398 struct host *host = impl_from_ITextHost( iface );
399
401 return GetSysColor( index );
402}
GLuint index
Definition: glext.h:6031
COLORREF back_colour
Definition: txthost.c:53
DWORD WINAPI GetSysColor(_In_ int)
#define COLOR_WINDOW
Definition: winuser.h:929

◆ ITextHostImpl_TxGetViewInset()

DECLSPEC_HIDDEN HRESULT __thiscall ITextHostImpl_TxGetViewInset ( ITextHost2 *  iface,
RECT rect 
)

Definition at line 375 of file txthost.c.

376{
378 return S_OK;
379}

◆ ITextHostImpl_TxGetWindow()

DECLSPEC_HIDDEN HRESULT __thiscall ITextHostImpl_TxGetWindow ( ITextHost2 *  iface,
HWND hwnd 
)

Definition at line 557 of file txthost.c.

558{
559 struct host *host = impl_from_ITextHost( iface );
560 *hwnd = host->window;
561 return S_OK;
562}

◆ ITextHostImpl_TxGetWindowStyles()

DECLSPEC_HIDDEN HRESULT __thiscall ITextHostImpl_TxGetWindowStyles ( ITextHost2 *  iface,
DWORD style,
DWORD ex_style 
)

Definition at line 601 of file txthost.c.

602{
603 return E_NOTIMPL;
604}

◆ ITextHostImpl_TxImmGetContext()

DECLSPEC_HIDDEN HIMC __thiscall ITextHostImpl_TxImmGetContext ( ITextHost2 *  iface)

Definition at line 528 of file txthost.c.

529{
530 struct host *host = impl_from_ITextHost( iface );
531 return ImmGetContext( host->window );
532}
HIMC WINAPI ImmGetContext(HWND hWnd)
Definition: imm.c:1045

◆ ITextHostImpl_TxImmReleaseContext()

DECLSPEC_HIDDEN void __thiscall ITextHostImpl_TxImmReleaseContext ( ITextHost2 *  iface,
HIMC  context 
)

Definition at line 535 of file txthost.c.

536{
537 struct host *host = impl_from_ITextHost( iface );
539}
BOOL WINAPI ImmReleaseContext(HWND hWnd, HIMC hIMC)
Definition: imm.c:1086
Definition: http.c:7252

◆ ITextHostImpl_TxInvalidateRect()

DECLSPEC_HIDDEN void __thiscall ITextHostImpl_TxInvalidateRect ( ITextHost2 *  iface,
const RECT rect,
BOOL  mode 
)

Definition at line 251 of file txthost.c.

252{
253 struct host *host = impl_from_ITextHost( iface );
255}
GLenum mode
Definition: glext.h:6217
BOOL WINAPI InvalidateRect(_In_opt_ HWND, _In_opt_ LPCRECT, _In_ BOOL)

◆ ITextHostImpl_TxIsDoubleClickPending()

DECLSPEC_HIDDEN BOOL __thiscall ITextHostImpl_TxIsDoubleClickPending ( ITextHost2 *  iface)

Definition at line 551 of file txthost.c.

552{
553 return FALSE;
554}

◆ ITextHostImpl_TxKillTimer()

DECLSPEC_HIDDEN void __thiscall ITextHostImpl_TxKillTimer ( ITextHost2 *  iface,
UINT  id 
)

Definition at line 293 of file txthost.c.

294{
295 struct host *host = impl_from_ITextHost( iface );
296 KillTimer( host->window, id );
297}
BOOL WINAPI KillTimer(_In_opt_ HWND, _In_ UINT_PTR)

◆ ITextHostImpl_TxNotify()

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

Definition at line 471 of file txthost.c.

472{
473 struct host *host = impl_from_ITextHost( iface );
474 UINT id;
475
476 if (!host->parent) return S_OK;
477
479
480 switch (iNotify)
481 {
482 case EN_DROPFILES:
483 case EN_LINK:
484 case EN_OLEOPFAILED:
485 case EN_PROTECTED:
486 case EN_REQUESTRESIZE:
487 case EN_SAVECLIPBOARD:
488 case EN_SELCHANGE:
489 case EN_STOPNOUNDO:
490 {
491 /* FIXME: Verify this assumption that pv starts with NMHDR. */
492 NMHDR *info = pv;
493 if (!info)
494 return E_FAIL;
495
496 info->hwndFrom = host->window;
497 info->idFrom = id;
498 info->code = iNotify;
500 break;
501 }
502
503 case EN_UPDATE:
504 /* Only sent when the window is visible. */
505 if (!IsWindowVisible( host->window ))
506 break;
507 /* Fall through */
508 case EN_CHANGE:
509 case EN_ERRSPACE:
510 case EN_HSCROLL:
511 case EN_KILLFOCUS:
512 case EN_MAXTEXT:
513 case EN_SETFOCUS:
514 case EN_VSCROLL:
516 break;
517
518 case EN_MSGFILTER:
519 FIXME("EN_MSGFILTER is documented as not being sent to TxNotify\n");
520 /* fall through */
521 default:
522 return E_FAIL;
523 }
524 return S_OK;
525}
GLuint id
Definition: glext.h:5910
unsigned int UINT
Definition: ndis.h:50
#define EN_PROTECTED
Definition: richedit.h:195
#define EN_SELCHANGE
Definition: richedit.h:193
#define EN_REQUESTRESIZE
Definition: richedit.h:192
#define EN_STOPNOUNDO
Definition: richedit.h:197
#define EN_DROPFILES
Definition: richedit.h:194
#define EN_MSGFILTER
Definition: richedit.h:191
#define EN_LINK
Definition: richedit.h:202
#define WM_NOTIFY
Definition: richedit.h:61
#define EN_SAVECLIPBOARD
Definition: richedit.h:199
#define EN_OLEOPFAILED
Definition: richedit.h:200
#define MAKEWPARAM(l, h)
Definition: winuser.h:4020
#define EN_KILLFOCUS
Definition: winuser.h:2036
#define EN_SETFOCUS
Definition: winuser.h:2038
#define EN_UPDATE
Definition: winuser.h:2039
#define WM_COMMAND
Definition: winuser.h:1751
#define EN_MAXTEXT
Definition: winuser.h:2037
#define EN_HSCROLL
Definition: winuser.h:2035
#define EN_VSCROLL
Definition: winuser.h:2040
#define GWLP_ID
Definition: winuser.h:871
#define EN_ERRSPACE
Definition: winuser.h:2034
BOOL WINAPI IsWindowVisible(_In_ HWND)
#define EN_CHANGE
Definition: winuser.h:2033

◆ ITextHostImpl_TxReleaseDC()

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

Definition at line 180 of file txthost.c.

181{
182 struct host *host = impl_from_ITextHost( iface );
183 return ReleaseDC( host->window, hdc );
184}
HDC hdc
Definition: main.c:9
int WINAPI ReleaseDC(_In_opt_ HWND, _In_ HDC)

◆ ITextHostImpl_TxScreenToClient()

DECLSPEC_HIDDEN BOOL __thiscall ITextHostImpl_TxScreenToClient ( ITextHost2 *  iface,
POINT pt 
)

Definition at line 330 of file txthost.c.

331{
332 struct host *host = impl_from_ITextHost( iface );
333 return ScreenToClient( host->window, pt );
334}
BOOL WINAPI ScreenToClient(_In_ HWND, _Inout_ LPPOINT)

◆ ITextHostImpl_TxScrollWindowEx()

DECLSPEC_HIDDEN void __thiscall ITextHostImpl_TxScrollWindowEx ( ITextHost2 *  iface,
INT  dx,
INT  dy,
const RECT scroll,
const RECT clip,
HRGN  update_rgn,
RECT update_rect,
UINT  flags 
)

Definition at line 300 of file txthost.c.

303{
304 struct host *host = impl_from_ITextHost( iface );
305 ScrollWindowEx( host->window, dx, dy, scroll, clip, update_rgn, update_rect, flags );
306}
GLbitfield flags
Definition: glext.h:7161
GLint dy
Definition: linetemp.h:97
GLint dx
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)

◆ ITextHostImpl_TxSetCapture()

DECLSPEC_HIDDEN void __thiscall ITextHostImpl_TxSetCapture ( ITextHost2 *  iface,
BOOL  capture 
)

Definition at line 309 of file txthost.c.

310{
311 struct host *host = impl_from_ITextHost( iface );
312 if (capture) SetCapture( host->window );
313 else ReleaseCapture();
314}
HWND WINAPI SetCapture(_In_ HWND hWnd)
BOOL WINAPI ReleaseCapture(void)
Definition: message.c:2890

◆ ITextHostImpl_TxSetCaretPos()

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

Definition at line 280 of file txthost.c.

281{
282 return SetCaretPos(x, y);
283}
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 ( ITextHost2 *  iface,
HCURSOR  cursor,
BOOL  text 
)

Definition at line 324 of file txthost.c.

325{
326 SetCursor( cursor );
327}
const char cursor[]
Definition: icontest.c:13
HCURSOR WINAPI SetCursor(_In_opt_ HCURSOR)

◆ ITextHostImpl_TxSetCursor2()

DECLSPEC_HIDDEN HCURSOR __thiscall ITextHostImpl_TxSetCursor2 ( ITextHost2 *  iface,
HCURSOR  cursor,
BOOL  text 
)

Definition at line 583 of file txthost.c.

584{
585 return NULL;
586}

◆ ITextHostImpl_TxSetFocus()

DECLSPEC_HIDDEN void __thiscall ITextHostImpl_TxSetFocus ( ITextHost2 *  iface)

Definition at line 317 of file txthost.c.

318{
319 struct host *host = impl_from_ITextHost( iface );
320 SetFocus( host->window );
321}
HWND WINAPI SetFocus(_In_opt_ HWND)

◆ ITextHostImpl_TxSetForegroundWindow()

DECLSPEC_HIDDEN HRESULT __thiscall ITextHostImpl_TxSetForegroundWindow ( ITextHost2 *  iface)

Definition at line 565 of file txthost.c.

566{
567 return E_NOTIMPL;
568}

◆ ITextHostImpl_TxSetScrollPos()

DECLSPEC_HIDDEN BOOL __thiscall ITextHostImpl_TxSetScrollPos ( ITextHost2 *  iface,
INT  bar,
INT  pos,
BOOL  redraw 
)

Definition at line 226 of file txthost.c.

227{
228 struct host *host = impl_from_ITextHost( iface );
231 BOOL show = TRUE, shown = style & mask;
232
233 if (bar != SB_HORZ && bar != SB_VERT)
234 {
235 FIXME( "Unexpected bar %d\n", bar );
236 return FALSE;
237 }
238
239 /* If the application has adjusted the scrollbar's visibility it is reset */
241 {
244 }
245
246 if (!show ^ !shown) ShowScrollBar( host->window, bar, show );
247 return SetScrollPos( host->window, bar, pos, redraw ) != 0;
248}
#define ITextServices_TxGetHScroll(This, a, b, c, d, e)
Definition: editor.h:410
#define ITextServices_TxGetVScroll(This, a, b, c, d, e)
Definition: editor.h:411
void redraw(int x, int y, int cx, int cy)
Definition: qtewin.cpp:1248
#define SB_VERT
Definition: winuser.h:553
int WINAPI SetScrollPos(_In_ HWND, _In_ int, _In_ int, _In_ BOOL)
#define SB_HORZ
Definition: winuser.h:552

◆ ITextHostImpl_TxSetScrollRange()

DECLSPEC_HIDDEN BOOL __thiscall ITextHostImpl_TxSetScrollRange ( ITextHost2 *  iface,
INT  bar,
LONG  min_pos,
INT  max_pos,
BOOL  redraw 
)

Definition at line 201 of file txthost.c.

202{
203 struct host *host = impl_from_ITextHost( iface );
204 SCROLLINFO info = { .cbSize = sizeof(info), .fMask = SIF_PAGE | SIF_RANGE };
205
206 if (bar != SB_HORZ && bar != SB_VERT)
207 {
208 FIXME( "Unexpected bar %d\n", bar );
209 return FALSE;
210 }
211
213
214 if (host->text_srv) /* This can be called during text services creation */
215 {
218 }
219
220 info.nMin = min_pos;
221 info.nMax = max_pos;
222 return SetScrollInfo( host->window, bar, &info, redraw );
223}
long LONG
Definition: pedump.c:60
#define SIF_RANGE
Definition: winuser.h:1246
#define SIF_PAGE
Definition: winuser.h:1244
#define SIF_DISABLENOSCROLL
Definition: winuser.h:1247
int WINAPI SetScrollInfo(_In_ HWND, _In_ int, _In_ LPCSCROLLINFO, _In_ BOOL)

◆ ITextHostImpl_TxSetTimer()

DECLSPEC_HIDDEN BOOL __thiscall ITextHostImpl_TxSetTimer ( ITextHost2 *  iface,
UINT  id,
UINT  timeout 
)

Definition at line 286 of file txthost.c.

287{
288 struct host *host = impl_from_ITextHost( iface );
289 return SetTimer( host->window, id, timeout, NULL ) != 0;
290}
Definition: dhcpd.h:245
UINT_PTR WINAPI SetTimer(_In_opt_ HWND, _In_ UINT_PTR, _In_ UINT, _In_opt_ TIMERPROC)

◆ ITextHostImpl_TxShowCaret()

DECLSPEC_HIDDEN BOOL __thiscall ITextHostImpl_TxShowCaret ( ITextHost2 *  iface,
BOOL  show 
)

Definition at line 272 of file txthost.c.

273{
274 struct host *host = impl_from_ITextHost( iface );
275 if (show) return ShowCaret( host->window );
276 else return HideCaret( host->window );
277}
BOOL WINAPI ShowCaret(_In_opt_ HWND)
BOOL WINAPI HideCaret(_In_opt_ HWND)

◆ ITextHostImpl_TxShowDropCaret()

DECLSPEC_HIDDEN HRESULT __thiscall ITextHostImpl_TxShowDropCaret ( ITextHost2 *  iface,
BOOL  show,
HDC  hdc,
const RECT rect 
)

Definition at line 607 of file txthost.c.

608{
609 return E_NOTIMPL;
610}

◆ ITextHostImpl_TxShowScrollBar()

DECLSPEC_HIDDEN BOOL __thiscall ITextHostImpl_TxShowScrollBar ( ITextHost2 *  iface,
INT  bar,
BOOL  show 
)

Definition at line 187 of file txthost.c.

188{
189 struct host *host = impl_from_ITextHost( iface );
190 return ShowScrollBar( host->window, bar, show );
191}

◆ ITextHostImpl_TxViewChange()

DECLSPEC_HIDDEN void __thiscall ITextHostImpl_TxViewChange ( ITextHost2 *  iface,
BOOL  update 
)

Definition at line 258 of file txthost.c.

259{
260 struct host *host = impl_from_ITextHost( iface );
261 if (update) UpdateWindow( host->window );
262}
BOOL WINAPI UpdateWindow(_In_ HWND)

◆ REComboWndProc()

static LRESULT WINAPI REComboWndProc ( HWND  hwnd,
UINT  msg,
WPARAM  wparam,
LPARAM  lparam 
)
static

Definition at line 1547 of file txthost.c.

1548{
1549 /* FIXME: Not implemented */
1550 TRACE( "hwnd %p msg %04x (%s) %08lx %08lx\n",
1552 return DefWindowProcW( hwnd, msg, wparam, lparam );
1553}
#define TRACE(s)
Definition: solgame.cpp:4
static const char * get_msg_name(UINT msg)
Definition: txthost.c:861
LRESULT WINAPI DefWindowProcW(_In_ HWND, _In_ UINT, _In_ WPARAM, _In_ LPARAM)

Referenced by REExtendedRegisterClass().

◆ REExtendedRegisterClass()

LRESULT WINAPI REExtendedRegisterClass ( void  )

Definition at line 1569 of file txthost.c.

1570{
1571 WNDCLASSW wc;
1572 UINT result;
1573
1574 FIXME( "semi stub\n" );
1575 wc.cbClsExtra = 0;
1576 wc.cbWndExtra = 4;
1577 wc.hInstance = NULL;
1578 wc.hIcon = NULL;
1579 wc.hCursor = NULL;
1580 wc.hbrBackground = (HBRUSH)(COLOR_WINDOW + 1);
1581 wc.lpszMenuName = NULL;
1582
1583 if (!listbox_registered)
1584 {
1587 wc.lpszClassName = L"REListBox20W";
1589 }
1590
1592 {
1595 wc.lpszClassName = L"REComboBox20W";
1597 }
1598
1599 result = 0;
1600 if (listbox_registered) result += 1;
1601 if (combobox_registered) result += 2;
1602
1603 return result;
1604}
GLuint64EXT * result
Definition: glext.h:11304
LPCWSTR lpszClassName
Definition: winuser.h:3196
LPCWSTR lpszMenuName
Definition: winuser.h:3195
HBRUSH hbrBackground
Definition: winuser.h:3194
HICON hIcon
Definition: winuser.h:3192
HINSTANCE hInstance
Definition: winuser.h:3191
int cbClsExtra
Definition: winuser.h:3189
UINT style
Definition: winuser.h:3187
WNDPROC lpfnWndProc
Definition: winuser.h:3188
int cbWndExtra
Definition: winuser.h:3190
HCURSOR hCursor
Definition: winuser.h:3193
static LRESULT WINAPI REComboWndProc(HWND hwnd, UINT msg, WPARAM wparam, LPARAM lparam)
Definition: txthost.c:1547
static LRESULT WINAPI REListWndProc(HWND hwnd, UINT msg, WPARAM wparam, LPARAM lparam)
Definition: txthost.c:1555
#define CS_VREDRAW
Definition: winuser.h:666
#define CS_HREDRAW
Definition: winuser.h:661
ATOM WINAPI RegisterClassW(_In_ CONST WNDCLASSW *)
#define CS_DBLCLKS
Definition: winuser.h:659
#define CS_GLOBALCLASS
Definition: winuser.h:660
#define CS_PARENTDC
Definition: winuser.h:664

◆ register_classes()

static BOOL register_classes ( HINSTANCE  instance)
static

Definition at line 1606 of file txthost.c.

1607{
1608 WNDCLASSW wcW;
1609 WNDCLASSA wcA;
1610
1613 wcW.cbClsExtra = 0;
1614 wcW.cbWndExtra = sizeof(struct host *);
1615 wcW.hInstance = NULL; /* hInstance would register DLL-local class */
1616 wcW.hIcon = NULL;
1619 wcW.lpszMenuName = NULL;
1620
1621 if (!(GetVersion() & 0x80000000))
1622 {
1624 if (!RegisterClassW( &wcW )) return FALSE;
1626 if (!RegisterClassW( &wcW )) return FALSE;
1627 }
1628 else
1629 {
1630 /* WNDCLASSA/W have the same layout */
1631 wcW.lpszClassName = (LPCWSTR)"RichEdit20W";
1632 if (!RegisterClassA( (WNDCLASSA *)&wcW )) return FALSE;
1633 wcW.lpszClassName = (LPCWSTR)"RichEdit50W";
1634 if (!RegisterClassA( (WNDCLASSA *)&wcW )) return FALSE;
1635 }
1636
1639 wcA.cbClsExtra = 0;
1640 wcA.cbWndExtra = sizeof(struct host *);
1641 wcA.hInstance = NULL; /* hInstance would register DLL-local class */
1642 wcA.hIcon = NULL;
1645 wcA.lpszMenuName = NULL;
1647 if (!RegisterClassA( &wcA )) return FALSE;
1648 wcA.lpszClassName = "RichEdit50A";
1649 if (!RegisterClassA( &wcA )) return FALSE;
1650
1651 return TRUE;
1652}
DWORD WINAPI GetVersion()
Definition: redirtest.c:5
HBRUSH hbrBackground
Definition: winuser.h:3181
HICON hIcon
Definition: winuser.h:3179
HINSTANCE hInstance
Definition: winuser.h:3178
HCURSOR hCursor
Definition: winuser.h:3180
int cbWndExtra
Definition: winuser.h:3177
UINT style
Definition: winuser.h:3174
LPCSTR lpszMenuName
Definition: winuser.h:3182
LPCSTR lpszClassName
Definition: winuser.h:3183
WNDPROC lpfnWndProc
Definition: winuser.h:3175
int cbClsExtra
Definition: winuser.h:3176
static LRESULT WINAPI RichEditWndProcA(HWND hwnd, UINT msg, WPARAM wparam, LPARAM lparam)
Definition: txthost.c:1519
static LRESULT WINAPI RichEditWndProcW(HWND hwnd, UINT msg, WPARAM wparam, LPARAM lparam)
Definition: txthost.c:1508
HGDIOBJ WINAPI GetStockObject(_In_ int)
#define NULL_BRUSH
Definition: wingdi.h:901
HCURSOR WINAPI LoadCursorW(_In_opt_ HINSTANCE, _In_ LPCWSTR)
Definition: cursoricon.c:2442
ATOM WINAPI RegisterClassA(_In_ CONST WNDCLASSA *)
#define IDC_IBEAM
Definition: winuser.h:696
WCHAR * LPWSTR
Definition: xmlstorage.h:184
const WCHAR * LPCWSTR
Definition: xmlstorage.h:185

◆ REListWndProc()

static LRESULT WINAPI REListWndProc ( HWND  hwnd,
UINT  msg,
WPARAM  wparam,
LPARAM  lparam 
)
static

Definition at line 1555 of file txthost.c.

1556{
1557 /* FIXME: Not implemented */
1558 TRACE( "hwnd %p msg %04x (%s) %08lx %08lx\n",
1560 return DefWindowProcW( hwnd, msg, wparam, lparam );
1561}

Referenced by REExtendedRegisterClass().

◆ RichEdit10ANSIWndProc()

LRESULT WINAPI RichEdit10ANSIWndProc ( HWND  hwnd,
UINT  msg,
WPARAM  wparam,
LPARAM  lparam 
)

Definition at line 1535 of file txthost.c.

1536{
1537 if (msg == WM_NCCREATE && !GetWindowLongPtrW( hwnd, 0 ))
1538 {
1540
1541 TRACE( "WM_NCCREATE: hwnd %p style 0x%08x\n", hwnd, pcs->style );
1542 return create_windowed_editor( hwnd, pcs, TRUE );
1543 }
1545}
static BOOL create_windowed_editor(HWND hwnd, CREATESTRUCTW *create, BOOL emulate_10)
Definition: txthost.c:870
LRESULT WINAPI RichEditANSIWndProc(HWND hwnd, UINT msg, WPARAM wparam, LPARAM lparam)
Definition: txthost.c:1527
#define GetWindowLongPtrW
Definition: winuser.h:4840
#define WM_NCCREATE
Definition: winuser.h:1694

Referenced by RICHED32_Register().

◆ RichEditANSIWndProc()

LRESULT WINAPI RichEditANSIWndProc ( HWND  hwnd,
UINT  msg,
WPARAM  wparam,
LPARAM  lparam 
)

Definition at line 1527 of file txthost.c.

1528{
1529 return RichEditWndProcA( hwnd, msg, wparam, lparam );
1530}

Referenced by RichEdit10ANSIWndProc().

◆ RichEditWndProc_common()

static LRESULT RichEditWndProc_common ( HWND  hwnd,
UINT  msg,
WPARAM  wparam,
LPARAM  lparam,
BOOL  unicode 
)
static

Definition at line 1082 of file txthost.c.

1084{
1085 struct host *host;
1086 HRESULT hr = S_OK;
1087 LRESULT res = 0;
1088
1089 TRACE( "enter hwnd %p msg %04x (%s) %lx %lx, unicode %d\n",
1090 hwnd, msg, get_msg_name(msg), wparam, lparam, unicode );
1091
1092 host = (struct host *)GetWindowLongPtrW( hwnd, 0 );
1093 if (!host)
1094 {
1095 if (msg == WM_NCCREATE)
1096 {
1098
1099 TRACE( "WM_NCCREATE: hwnd %p style 0x%08x\n", hwnd, pcs->style );
1100 return create_windowed_editor( hwnd, pcs, FALSE );
1101 }
1102 else return DefWindowProcW( hwnd, msg, wparam, lparam );
1103 }
1104
1105 if ((((host->event_mask & ENM_KEYEVENTS) && msg >= WM_KEYFIRST && msg <= WM_KEYLAST) ||
1108 {
1109 host->notify_level++;
1111 if (!--host->notify_level && host->defer_release)
1112 {
1113 TRACE( "exit (filtered deferred release) hwnd %p msg %04x (%s) %lx %lx -> 0\n",
1115 ITextHost2_Release( &host->ITextHost_iface );
1116 return 0;
1117 }
1118
1119 if (res)
1120 {
1121 TRACE( "exit (filtered %lu) hwnd %p msg %04x (%s) %lx %lx -> 0\n",
1123 return 0;
1124 }
1125 }
1126
1127 switch (msg)
1128 {
1129 case WM_CHAR:
1130 {
1131 WCHAR wc = wparam;
1132
1133 if (!unicode) MultiByteToWideChar( CP_ACP, 0, (char *)&wparam, 1, &wc, 1 );
1134 if (wparam == '\r' && host->dialog_mode && host->emulate_10 && handle_dialog_enter( host )) break;
1136 break;
1137 }
1138
1139 case WM_CREATE:
1140 {
1142 CREATESTRUCTA *createA = (CREATESTRUCTA *)lparam;
1143 void *text;
1144 WCHAR *textW = NULL;
1145 LONG codepage = unicode ? CP_UNICODE : CP_ACP;
1146 int len;
1147
1149
1150 if (lparam)
1151 {
1152 text = unicode ? (void *)createW->lpszName : (void *)createA->lpszName;
1154 }
1157 break;
1158 }
1159 case WM_DESTROY:
1160 if (!host->notify_level) ITextHost2_Release( &host->ITextHost_iface );
1161 else host->defer_release = 1;
1162 return 0;
1163
1164 case WM_ERASEBKGND:
1165 {
1166 HDC hdc = (HDC)wparam;
1167 RECT rc;
1168 HBRUSH brush;
1169
1170 if (GetUpdateRect( hwnd, &rc, TRUE ))
1171 {
1173 FillRect( hdc, &rc, brush );
1174 DeleteObject( brush );
1175 }
1176 return 1;
1177 }
1178 case EM_FINDTEXT:
1179 {
1181 FINDTEXTW new_params;
1182 int len;
1183
1184 if (!unicode)
1185 {
1186 new_params.chrg = params->chrg;
1187 new_params.lpstrText = ME_ToUnicode( CP_ACP, (char *)params->lpstrText, &len );
1188 params = &new_params;
1189 }
1191 if (!unicode) ME_EndToUnicode( CP_ACP, (WCHAR *)new_params.lpstrText );
1192 break;
1193 }
1194 case EM_FINDTEXTEX:
1195 {
1196 FINDTEXTEXA *paramsA = (FINDTEXTEXA *)lparam;
1198 FINDTEXTEXW new_params;
1199 int len;
1200
1201 if (!unicode)
1202 {
1203 new_params.chrg = params->chrg;
1204 new_params.lpstrText = ME_ToUnicode( CP_ACP, (char *)params->lpstrText, &len );
1205 params = &new_params;
1206 }
1208 if (!unicode)
1209 {
1210 ME_EndToUnicode( CP_ACP, (WCHAR *)new_params.lpstrText );
1211 paramsA->chrgText = params->chrgText;
1212 }
1213 break;
1214 }
1215 case WM_GETDLGCODE:
1216 if (lparam) host->dialog_mode = TRUE;
1217
1221 break;
1222
1223 case EM_GETLINE:
1225 else hr = get_lineA( host->text_srv, wparam, lparam, &res );
1226 break;
1227
1228 case EM_GETPASSWORDCHAR:
1230 break;
1231
1232 case EM_GETRECT:
1234 break;
1235
1236 case EM_GETSELTEXT:
1237 {
1239
1241 else
1242 {
1244 range.lpstrText = (char *)lparam;
1245 range.lpstrText[0] = '\0';
1246 hr = get_text_rangeA( host, &range, &res );
1247 }
1248 break;
1249 }
1250 case EM_GETOPTIONS:
1260 break;
1261
1262 case WM_GETTEXT:
1263 {
1265
1266 params.cb = wparam * (unicode ? sizeof(WCHAR) : sizeof(CHAR));
1267 params.flags = GT_USECRLF;
1268 params.codepage = unicode ? CP_UNICODE : CP_ACP;
1269 params.lpDefaultChar = NULL;
1270 params.lpUsedDefChar = NULL;
1272 break;
1273 }
1274 case WM_GETTEXTLENGTH:
1275 {
1277
1279 params.codepage = unicode ? CP_UNICODE : CP_ACP;
1281 break;
1282 }
1283 case EM_GETTEXTRANGE:
1285 else hr = get_text_rangeA( host, (TEXTRANGEA *)lparam, &res );
1286 break;
1287
1288 case WM_KEYDOWN:
1289 switch (LOWORD( wparam ))
1290 {
1291 case VK_ESCAPE:
1292 if (host->dialog_mode && host->parent)
1293 PostMessageW( host->parent, WM_CLOSE, 0, 0 );
1294 break;
1295 case VK_TAB:
1296 if (host->dialog_mode && host->parent)
1298 break;
1299 case VK_RETURN:
1300 if (host->dialog_mode && !host->emulate_10 && handle_dialog_enter( host )) break;
1301 /* fall through */
1302 default:
1304 }
1305 break;
1306
1307 case WM_PAINT:
1308 case WM_PRINTCLIENT:
1309 {
1310 HDC hdc;
1311 RECT rc, client, update;
1312 PAINTSTRUCT ps;
1314
1316
1317 if (msg == WM_PAINT)
1318 {
1319 hdc = BeginPaint( hwnd, &ps );
1320 update = ps.rcPaint;
1321 }
1322 else
1323 {
1324 hdc = (HDC)wparam;
1325 update = client;
1326 }
1327
1328 brush = SelectObject( hdc, brush );
1329
1330 /* Erase area outside of the formatting rectangle */
1331 if (update.top < client.top)
1332 {
1333 rc = update;
1334 rc.bottom = client.top;
1335 PatBlt( hdc, rc.left, rc.top, rc.right - rc.left, rc.bottom - rc.top, PATCOPY );
1336 update.top = client.top;
1337 }
1338 if (update.bottom > client.bottom)
1339 {
1340 rc = update;
1341 rc.top = client.bottom;
1342 PatBlt( hdc, rc.left, rc.top, rc.right - rc.left, rc.bottom - rc.top, PATCOPY );
1343 update.bottom = client.bottom;
1344 }
1345 if (update.left < client.left)
1346 {
1347 rc = update;
1348 rc.right = client.left;
1349 PatBlt( hdc, rc.left, rc.top, rc.right - rc.left, rc.bottom - rc.top, PATCOPY );
1350 update.left = client.left;
1351 }
1352 if (update.right > client.right)
1353 {
1354 rc = update;
1355 rc.left = client.right;
1356 PatBlt( hdc, rc.left, rc.top, rc.right - rc.left, rc.bottom - rc.top, PATCOPY );
1357 update.right = client.right;
1358 }
1359
1360 ITextServices_TxDraw( host->text_srv, DVASPECT_CONTENT, 0, NULL, NULL, hdc, NULL, NULL, NULL,
1361 &update, NULL, 0, TXTVIEW_ACTIVE );
1362 DeleteObject( SelectObject( hdc, brush ) );
1363 if (msg == WM_PAINT) EndPaint( hwnd, &ps );
1364 return 0;
1365 }
1366 case EM_REPLACESEL:
1367 {
1368 int len;
1369 LONG codepage = unicode ? CP_UNICODE : CP_ACP;
1370 WCHAR *text = ME_ToUnicode( codepage, (void *)lparam, &len );
1371
1374 res = len;
1375 break;
1376 }
1377 case EM_SETBKGNDCOLOR:
1382 break;
1383
1384 case WM_SETCURSOR:
1385 {
1386 POINT pos;
1387 RECT rect;
1388
1389 if (hwnd != (HWND)wparam) break;
1390 GetCursorPos( &pos );
1391 ScreenToClient( hwnd, &pos );
1393 if (PtInRect( &rect, pos ))
1394 ITextServices_OnTxSetCursor( host->text_srv, DVASPECT_CONTENT, 0, NULL, NULL, NULL, NULL, NULL, pos.x, pos.y );
1396 break;
1397 }
1398 case EM_SETEVENTMASK:
1401 break;
1402
1403 case EM_SETOPTIONS:
1405 break;
1406
1407 case EM_SETPASSWORDCHAR:
1408 if (wparam == host->password_char) break;
1411 else host->props &= ~TXTBIT_USEPASSWORD;
1413 break;
1414
1415 case EM_SETREADONLY:
1416 {
1418 DWORD mask = wparam ? ECO_READONLY : ~ECO_READONLY;
1419
1421 return 1;
1422 }
1423 case EM_SETRECT:
1424 case EM_SETRECTNP:
1425 {
1426 RECT *rc = (RECT *)lparam;
1427
1428 if (!rc) host->use_set_rect = 0;
1429 else
1430 {
1431 if (wparam >= 2) break;
1432 host->set_rect = *rc;
1433 if (host->client_edge)
1434 {
1435 InflateRect( &host->set_rect, 1, 0 );
1436 host->set_rect.top -= 1;
1437 }
1439 host->use_set_rect = 1;
1440 }
1442 break;
1443 }
1444 case WM_SETTEXT:
1445 {
1446 char *textA = (char *)lparam;
1447 WCHAR *text = (WCHAR *)lparam;
1448 int len;
1449
1450 if (!unicode && textA && strncmp( textA, "{\\rtf", 5 ) && strncmp( textA, "{\\urtf", 6 ))
1453 if (text != (WCHAR *)lparam) ME_EndToUnicode( CP_ACP, text );
1454 break;
1455 }
1456 case EM_SHOWSCROLLBAR:
1457 {
1458 DWORD mask = 0, new;
1459
1460 if (wparam == SB_HORZ) mask = WS_HSCROLL;
1461 else if (wparam == SB_VERT) mask = WS_VSCROLL;
1462 else if (wparam == SB_BOTH) mask = WS_HSCROLL | WS_VSCROLL;
1463
1464 if (mask)
1465 {
1466 new = lparam ? mask : 0;
1467 if ((host->scrollbars & mask) != new)
1468 {
1469 host->scrollbars &= ~mask;
1470 host->scrollbars |= new;
1472 }
1473 }
1474
1475 res = 0;
1476 break;
1477 }
1479 {
1480 RECT client;
1481 WINDOWPOS *winpos = (WINDOWPOS *)lparam;
1482
1483 hr = S_FALSE; /* call defwndproc */
1484 if (winpos->flags & SWP_NOCLIENTSIZE) break;
1486 if (host->use_set_rect)
1487 {
1490 }
1493 break;
1494 }
1495 default:
1497 }
1498
1499 if (hr == S_FALSE)
1501
1502 TRACE( "exit hwnd %p msg %04x (%s) %lx %lx, unicode %d -> %lu\n",
1503 hwnd, msg, get_msg_name(msg), wparam, lparam, unicode, res );
1504
1505 return res;
1506}
int strncmp(const char *String1, const char *String2, ACPI_SIZE Count)
Definition: utclib.c:534
#define SWP_NOCLIENTSIZE
Definition: msg.h:31
UINT op
Definition: effect.c:236
#define MultiByteToWideChar
Definition: compat.h:110
static const WCHAR createW[]
Definition: object.c:35
const WCHAR * text
Definition: package.c:1794
#define CP_UNICODE
Definition: stg_prop.c:74
#define ITextServices_TxSetText(This, a)
Definition: editor.h:419
#define ITextServices_TxDraw(This, a, b, c, d, e, f, g, h, i, j, k, l)
Definition: editor.h:409
#define ITextHost_TxGetSysColor(This, a)
Definition: editor.h:358
void ME_EndToUnicode(LONG codepage, LPVOID psz) DECLSPEC_HIDDEN
Definition: string.c:248
#define ITextServices_OnTxInPlaceActivate(This, a)
Definition: editor.h:414
#define ITextHost_TxGetClientRect(This, a)
Definition: editor.h:354
#define ITextHost_TxGetPasswordChar(This, a)
Definition: editor.h:362
#define ITextHost_TxSetCursor(This, a, b)
Definition: editor.h:349
#define ITextServices_OnTxPropertyBitsChange(This, a, b)
Definition: editor.h:424
LPWSTR ME_ToUnicode(LONG codepage, LPVOID psz, INT *len) DECLSPEC_HIDDEN
Definition: string.c:226
#define ITextServices_OnTxSetCursor(This, a, b, c, d, e, f, g, h, i)
Definition: editor.h:412
pKey DeleteObject()
GLenum const GLfloat * params
Definition: glext.h:5645
static const char textA[]
Definition: registrar.c:40
static HDC
Definition: imagelist.c:88
static const WCHAR textW[]
Definition: itemdlg.c:1559
#define ECO_NOHIDESEL
Definition: richedit.h:459
#define ECO_WANTRETURN
Definition: richedit.h:461
#define GTL_CLOSE
Definition: richedit.h:1057
#define EM_GETSELTEXT
Definition: richedit.h:95
#define ECO_AUTOWORDSELECTION
Definition: richedit.h:456
#define EM_SETEVENTMASK
Definition: richedit.h:102
#define EM_SETOPTIONS
Definition: richedit.h:110
#define ECO_VERTICAL
Definition: richedit.h:464
#define ECO_SAVESEL
Definition: richedit.h:462
#define EM_SETBKGNDCOLOR
Definition: richedit.h:100
#define GTL_NUMCHARS
Definition: richedit.h:1058
#define EM_SHOWSCROLLBAR
Definition: richedit.h:130
#define ENM_KEYEVENTS
Definition: richedit.h:475
#define EM_GETOPTIONS
Definition: richedit.h:111
#define ECO_AUTOHSCROLL
Definition: richedit.h:458
#define WM_PRINTCLIENT
Definition: richedit.h:70
#define EM_FINDTEXTW
Definition: richedit.h:147
#define EM_FINDTEXT
Definition: richedit.h:89
#define ECO_READONLY
Definition: richedit.h:460
#define ECOOP_OR
Definition: richedit.h:451
#define EM_GETTEXTLENGTHEX
Definition: richedit.h:129
#define GT_USECRLF
Definition: richedit.h:1037
#define ECO_AUTOVSCROLL
Definition: richedit.h:457
#define ENM_SCROLLEVENTS
Definition: richedit.h:471
#define EM_GETTEXTEX
Definition: richedit.h:128
#define EM_FINDTEXTEXW
Definition: richedit.h:148
#define EM_EXGETSEL
Definition: richedit.h:85
#define EM_FINDTEXTEX
Definition: richedit.h:112
#define ENM_MOUSEEVENTS
Definition: richedit.h:476
#define GTL_USECRLF
Definition: richedit.h:1055
#define ECO_SELECTIONBAR
Definition: richedit.h:463
#define ECOOP_AND
Definition: richedit.h:452
static FILE * client
Definition: client.c:41
UINT flags
Definition: winuser.h:3605
CHARRANGE chrg
Definition: richedit.h:586
LPCWSTR lpstrText
Definition: richedit.h:587
CHARRANGE chrgText
Definition: richedit.h:595
CHARRANGE chrg
Definition: richedit.h:599
LPCWSTR lpstrText
Definition: richedit.h:600
LPCSTR lpszName
Definition: winuser.h:2960
LONG right
Definition: windef.h:308
LONG bottom
Definition: windef.h:309
LONG top
Definition: windef.h:307
LONG left
Definition: windef.h:306
#define TXTBIT_AUTOWORDSEL
Definition: textserv.h:192
#define TXTBIT_CLIENTRECTCHANGE
Definition: textserv.h:205
#define TXTBIT_SCROLLBARCHANGE
Definition: textserv.h:201
@ TXTVIEW_ACTIVE
Definition: textserv.h:181
static HRESULT get_lineA(ITextServices *text_srv, WPARAM wparam, LPARAM lparam, LRESULT *res)
Definition: txthost.c:892
static HRESULT set_options(struct host *host, DWORD op, DWORD value, LRESULT *res)
Definition: txthost.c:951
static LRESULT send_msg_filter(struct host *host, UINT msg, WPARAM *wparam, LPARAM *lparam)
Definition: txthost.c:1062
static BOOL handle_dialog_enter(struct host *host)
Definition: txthost.c:1038
static HRESULT get_text_rangeA(struct host *host, TEXTRANGEA *rangeA, LRESULT *res)
Definition: txthost.c:918
int codepage
Definition: win_iconv.c:156
HGDIOBJ WINAPI SelectObject(_In_ HDC, _In_ HGDIOBJ)
Definition: dc.c:1546
#define PATCOPY
Definition: wingdi.h:335
BOOL WINAPI PatBlt(_In_ HDC, _In_ int, _In_ int, _In_ int, _In_ int, _In_ DWORD)
int WINAPI FillRect(HDC, LPCRECT, HBRUSH)
HBRUSH WINAPI CreateSolidBrush(_In_ COLORREF)
#define WM_PAINT
Definition: winuser.h:1631
#define EM_SETREADONLY
Definition: winuser.h:2026
#define WM_ERASEBKGND
Definition: winuser.h:1636
#define EM_GETRECT
Definition: winuser.h:2007
#define WM_CLOSE
Definition: winuser.h:1632
#define VK_TAB
Definition: winuser.h:2210
#define WM_MOUSEFIRST
Definition: winuser.h:1785
#define WM_HSCROLL
Definition: winuser.h:1754
#define WM_MOUSELAST
Definition: winuser.h:1812
#define EM_GETPASSWORDCHAR
Definition: winuser.h:2006
#define WM_VSCROLL
Definition: winuser.h:1755
#define WM_CREATE
Definition: winuser.h:1619
#define DLGC_WANTCHARS
Definition: winuser.h:2629
#define DLGC_WANTTAB
Definition: winuser.h:2622
#define EM_SETPASSWORDCHAR
Definition: winuser.h:2025
#define EM_REPLACESEL
Definition: winuser.h:2017
#define IDC_ARROW
Definition: winuser.h:695
#define WM_KEYFIRST
Definition: winuser.h:1725
BOOL WINAPI GetCursorPos(_Out_ LPPOINT)
Definition: cursoricon.c:3032
#define EM_SETRECT
Definition: winuser.h:2027
#define WM_GETTEXT
Definition: winuser.h:1629
BOOL WINAPI PtInRect(_In_ LPCRECT, _In_ POINT)
#define WM_SETTEXT
Definition: winuser.h:1628
#define EM_SETRECTNP
Definition: winuser.h:2028
BOOL WINAPI EndPaint(_In_ HWND, _In_ const PAINTSTRUCT *)
#define DLGC_WANTARROWS
Definition: winuser.h:2621
BOOL WINAPI IntersectRect(_Out_ LPRECT, _In_ LPCRECT, _In_ LPCRECT)
#define WM_CHAR
Definition: winuser.h:1728
#define WM_SETCURSOR
Definition: winuser.h:1647
#define VK_SHIFT
Definition: winuser.h:2213
#define DLGC_WANTMESSAGE
Definition: winuser.h:2624
#define WM_DESTROY
Definition: winuser.h:1620
#define MAKEINTRESOURCEW(i)
Definition: winuser.h:582
HDC WINAPI BeginPaint(_In_ HWND, _Out_ LPPAINTSTRUCT)
BOOL WINAPI GetUpdateRect(_In_ HWND, _Out_opt_ LPRECT, _In_ BOOL)
#define WM_KEYLAST
Definition: winuser.h:1739
#define VK_ESCAPE
Definition: winuser.h:2225
#define WM_WINDOWPOSCHANGED
Definition: winuser.h:1673
#define DLGC_HASSETSEL
Definition: winuser.h:2625
#define WM_GETDLGCODE
Definition: winuser.h:1700
char CHAR
Definition: xmlstorage.h:175

Referenced by RichEditWndProcA(), and RichEditWndProcW().

◆ RichEditWndProcA()

static LRESULT WINAPI RichEditWndProcA ( HWND  hwnd,
UINT  msg,
WPARAM  wparam,
LPARAM  lparam 
)
static

Definition at line 1519 of file txthost.c.

1520{
1522}
static LRESULT RichEditWndProc_common(HWND hwnd, UINT msg, WPARAM wparam, LPARAM lparam, BOOL unicode)
Definition: txthost.c:1082

Referenced by register_classes(), and RichEditANSIWndProc().

◆ RichEditWndProcW()

static LRESULT WINAPI RichEditWndProcW ( HWND  hwnd,
UINT  msg,
WPARAM  wparam,
LPARAM  lparam 
)
static

Definition at line 1508 of file txthost.c.

1509{
1510 BOOL unicode = TRUE;
1511
1512 /* Under Win9x RichEdit20W returns ANSI strings, see the tests. */
1513 if (msg == WM_GETTEXT && (GetVersion() & 0x80000000))
1514 unicode = FALSE;
1515
1516 return RichEditWndProc_common( hwnd, msg, wparam, lparam, unicode );
1517}

Referenced by register_classes().

◆ send_msg_filter()

static LRESULT send_msg_filter ( struct host host,
UINT  msg,
WPARAM wparam,
LPARAM lparam 
)
static

Definition at line 1062 of file txthost.c.

1063{
1064 MSGFILTER msgf;
1065 LRESULT res;
1066
1067 if (!host->parent) return 0;
1068 msgf.nmhdr.hwndFrom = host->window;
1070 msgf.nmhdr.code = EN_MSGFILTER;
1071 msgf.msg = msg;
1072 msgf.wParam = *wparam;
1073 msgf.lParam = *lparam;
1074 if ((res = SendMessageW( host->parent, WM_NOTIFY, msgf.nmhdr.idFrom, (LPARAM)&msgf )))
1075 return res;
1076 *wparam = msgf.wParam;
1077 *lparam = msgf.lParam;
1078
1079 return 0;
1080}
LPARAM lParam
Definition: richedit.h:643
NMHDR nmhdr
Definition: richedit.h:640
UINT msg
Definition: richedit.h:641
WPARAM wParam
Definition: richedit.h:642
UINT_PTR idFrom
Definition: winuser.h:3169
UINT code
Definition: winuser.h:3170
HWND hwndFrom
Definition: winuser.h:3168

Referenced by RichEditWndProc_common().

◆ set_options()

static HRESULT set_options ( struct host host,
DWORD  op,
DWORD  value,
LRESULT res 
)
static

Definition at line 951 of file txthost.c.

952{
953 DWORD style, old_options, new_options, change, props_mask = 0;
956
957 new_options = old_options = SendMessageW( host->window, EM_GETOPTIONS, 0, 0 );
958
959 switch (op)
960 {
961 case ECOOP_SET:
962 new_options = value;
963 break;
964 case ECOOP_OR:
965 new_options |= value;
966 break;
967 case ECOOP_AND:
968 new_options &= value;
969 break;
970 case ECOOP_XOR:
971 new_options ^= value;
972 }
973 new_options &= mask;
974
975 change = (new_options ^ old_options);
976
977 if (change & ECO_AUTOWORDSELECTION)
978 {
980 props_mask |= TXTBIT_AUTOWORDSEL;
981 }
982 if (change & ECO_AUTOVSCROLL)
983 {
985 props_mask |= TXTBIT_SCROLLBARCHANGE;
986 }
987 if (change & ECO_AUTOHSCROLL)
988 {
990 props_mask |= TXTBIT_SCROLLBARCHANGE;
991 }
992 if (change & ECO_NOHIDESEL)
993 {
995 props_mask |= TXTBIT_HIDESELECTION;
996 }
997 if (change & ECO_READONLY)
998 {
1000 props_mask |= TXTBIT_READONLY;
1001 }
1002 if (change & ECO_SAVESEL)
1003 {
1005 props_mask |= TXTBIT_SAVESELECTION;
1006 }
1007 if (change & ECO_SELECTIONBAR)
1008 {
1009 host->sel_bar ^= 1;
1010 props_mask |= TXTBIT_SELBARCHANGE;
1011 if (host->use_set_rect)
1012 {
1015 props_mask |= TXTBIT_CLIENTRECTCHANGE;
1016 }
1017 }
1018 if (change & ECO_VERTICAL)
1019 {
1021 props_mask |= TXTBIT_VERTICAL;
1022 }
1023 if (change & ECO_WANTRETURN) host->want_return ^= 1;
1024
1025 if (props_mask)
1026 ITextServices_OnTxPropertyBitsChange( host->text_srv, props_mask, host->props & props_mask );
1027
1028 *res = new_options;
1029
1030 mask &= ~ECO_AUTOWORDSELECTION; /* doesn't correspond to a window style */
1032 style = (style & ~mask) | (*res & mask);
1034 return S_OK;
1035}
#define SELECTIONBAR_WIDTH
Definition: editstr.h:99
#define ECOOP_XOR
Definition: richedit.h:453
#define ECOOP_SET
Definition: richedit.h:450
#define TXTBIT_SELBARCHANGE
Definition: textserv.h:194
Definition: pdh_main.c:96
LONG WINAPI SetWindowLongW(_In_ HWND, _In_ int, _In_ LONG)

Referenced by RichEditWndProc_common().

◆ WINE_DEFAULT_DEBUG_CHANNEL()

WINE_DEFAULT_DEBUG_CHANNEL ( richedit  )

Variable Documentation

◆ combobox_registered

BOOL combobox_registered
static

Definition at line 61 of file txthost.c.

Referenced by DllMain(), and REExtendedRegisterClass().

◆ edit_messages

const char* const edit_messages[]
static
Initial value:
=
{
"EM_GETSEL", "EM_SETSEL", "EM_GETRECT", "EM_SETRECT",
"EM_SETRECTNP", "EM_SCROLL", "EM_LINESCROLL", "EM_SCROLLCARET",
"EM_GETMODIFY", "EM_SETMODIFY", "EM_GETLINECOUNT", "EM_LINEINDEX",
"EM_SETHANDLE", "EM_GETHANDLE", "EM_GETTHUMB", "EM_UNKNOWN_BF",
"EM_UNKNOWN_C0", "EM_LINELENGTH", "EM_REPLACESEL", "EM_UNKNOWN_C3",
"EM_GETLINE", "EM_LIMITTEXT", "EM_CANUNDO", "EM_UNDO",
"EM_FMTLINES", "EM_LINEFROMCHAR", "EM_UNKNOWN_CA", "EM_SETTABSTOPS",
"EM_SETPASSWORDCHAR", "EM_EMPTYUNDOBUFFER", "EM_GETFIRSTVISIBLELINE", "EM_SETREADONLY",
"EM_SETWORDBREAKPROC", "EM_GETWORDBREAKPROC", "EM_GETPASSWORDCHAR", "EM_SETMARGINS",
"EM_GETMARGINS", "EM_GETLIMITTEXT", "EM_POSFROMCHAR", "EM_CHARFROMPOS",
"EM_SETIMESTATUS", "EM_GETIMESTATUS"
}

Definition at line 822 of file txthost.c.

Referenced by get_msg_name().

◆ listbox_registered

BOOL listbox_registered
static

Definition at line 60 of file txthost.c.

Referenced by DllMain(), and REExtendedRegisterClass().

◆ richedit_messages

const char* const richedit_messages[]
static
Initial value:
=
{
"EM_CANPASTE", "EM_DISPLAYBAND", "EM_EXGETSEL", "EM_EXLIMITTEXT",
"EM_EXLINEFROMCHAR", "EM_EXSETSEL", "EM_FINDTEXT", "EM_FORMATRANGE",
"EM_GETCHARFORMAT", "EM_GETEVENTMASK", "EM_GETOLEINTERFACE", "EM_GETPARAFORMAT",
"EM_GETSELTEXT", "EM_HIDESELECTION", "EM_PASTESPECIAL", "EM_REQUESTRESIZE",
"EM_SELECTIONTYPE", "EM_SETBKGNDCOLOR", "EM_SETCHARFORMAT", "EM_SETEVENTMASK",
"EM_SETOLECALLBACK", "EM_SETPARAFORMAT", "EM_SETTARGETDEVICE", "EM_STREAMIN",
"EM_STREAMOUT", "EM_GETTEXTRANGE", "EM_FINDWORDBREAK", "EM_SETOPTIONS",
"EM_GETOPTIONS", "EM_FINDTEXTEX", "EM_GETWORDBREAKPROCEX", "EM_SETWORDBREAKPROCEX",
"EM_SETUNDOLIMIT", "EM_UNKNOWN_USER_83", "EM_REDO", "EM_CANREDO",
"EM_GETUNDONAME", "EM_GETREDONAME", "EM_STOPGROUPTYPING", "EM_SETTEXTMODE",
"EM_GETTEXTMODE", "EM_AUTOURLDETECT", "EM_GETAUTOURLDETECT", "EM_SETPALETTE",
"EM_GETTEXTEX", "EM_GETTEXTLENGTHEX", "EM_SHOWSCROLLBAR", "EM_SETTEXTEX",
"EM_UNKNOWN_USER_98", "EM_UNKNOWN_USER_99", "EM_SETPUNCTUATION", "EM_GETPUNCTUATION",
"EM_SETWORDWRAPMODE", "EM_GETWORDWRAPMODE", "EM_SETIMECOLOR", "EM_GETIMECOLOR",
"EM_SETIMEOPTIONS", "EM_GETIMEOPTIONS", "EM_CONVPOSITION", "EM_UNKNOWN_USER_109",
"EM_UNKNOWN_USER_110", "EM_UNKNOWN_USER_111", "EM_UNKNOWN_USER_112", "EM_UNKNOWN_USER_113",
"EM_UNKNOWN_USER_114", "EM_UNKNOWN_USER_115", "EM_UNKNOWN_USER_116", "EM_UNKNOWN_USER_117",
"EM_UNKNOWN_USER_118", "EM_UNKNOWN_USER_119", "EM_SETLANGOPTIONS", "EM_GETLANGOPTIONS",
"EM_GETIMECOMPMODE", "EM_FINDTEXTW", "EM_FINDTEXTEXW", "EM_RECONVERSION",
"EM_SETIMEMODEBIAS", "EM_GETIMEMODEBIAS"
}

Definition at line 837 of file txthost.c.

Referenced by get_msg_name().

◆ textHostVtbl

static const ITextHost2Vtbl textHostVtbl
static

Definition at line 58 of file txthost.c.

Referenced by host_create().