ReactOS 0.4.16-dev-1946-g52006dd
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)
 
HDC __thiscall ITextHostImpl_TxGetDC (ITextHost2 *iface)
 
INT __thiscall ITextHostImpl_TxReleaseDC (ITextHost2 *iface, HDC hdc)
 
BOOL __thiscall ITextHostImpl_TxShowScrollBar (ITextHost2 *iface, INT bar, BOOL show)
 
BOOL __thiscall ITextHostImpl_TxEnableScrollBar (ITextHost2 *iface, INT bar, INT arrows)
 
BOOL __thiscall ITextHostImpl_TxSetScrollRange (ITextHost2 *iface, INT bar, LONG min_pos, INT max_pos, BOOL redraw)
 
BOOL __thiscall ITextHostImpl_TxSetScrollPos (ITextHost2 *iface, INT bar, INT pos, BOOL redraw)
 
void __thiscall ITextHostImpl_TxInvalidateRect (ITextHost2 *iface, const RECT *rect, BOOL mode)
 
void __thiscall ITextHostImpl_TxViewChange (ITextHost2 *iface, BOOL update)
 
BOOL __thiscall ITextHostImpl_TxCreateCaret (ITextHost2 *iface, HBITMAP bitmap, INT width, INT height)
 
BOOL __thiscall ITextHostImpl_TxShowCaret (ITextHost2 *iface, BOOL show)
 
BOOL __thiscall ITextHostImpl_TxSetCaretPos (ITextHost2 *iface, INT x, INT y)
 
BOOL __thiscall ITextHostImpl_TxSetTimer (ITextHost2 *iface, UINT id, UINT timeout)
 
void __thiscall ITextHostImpl_TxKillTimer (ITextHost2 *iface, UINT id)
 
void __thiscall ITextHostImpl_TxScrollWindowEx (ITextHost2 *iface, INT dx, INT dy, const RECT *scroll, const RECT *clip, HRGN update_rgn, RECT *update_rect, UINT flags)
 
void __thiscall ITextHostImpl_TxSetCapture (ITextHost2 *iface, BOOL capture)
 
void __thiscall ITextHostImpl_TxSetFocus (ITextHost2 *iface)
 
void __thiscall ITextHostImpl_TxSetCursor (ITextHost2 *iface, HCURSOR cursor, BOOL text)
 
BOOL __thiscall ITextHostImpl_TxScreenToClient (ITextHost2 *iface, POINT *pt)
 
BOOL __thiscall ITextHostImpl_TxClientToScreen (ITextHost2 *iface, POINT *pt)
 
HRESULT __thiscall ITextHostImpl_TxActivate (ITextHost2 *iface, LONG *old_state)
 
HRESULT __thiscall ITextHostImpl_TxDeactivate (ITextHost2 *iface, LONG new_state)
 
HRESULT __thiscall ITextHostImpl_TxGetClientRect (ITextHost2 *iface, RECT *rect)
 
HRESULT __thiscall ITextHostImpl_TxGetViewInset (ITextHost2 *iface, RECT *rect)
 
HRESULT __thiscall ITextHostImpl_TxGetCharFormat (ITextHost2 *iface, const CHARFORMATW **ppCF)
 
HRESULT __thiscall ITextHostImpl_TxGetParaFormat (ITextHost2 *iface, const PARAFORMAT **fmt)
 
COLORREF __thiscall ITextHostImpl_TxGetSysColor (ITextHost2 *iface, int index)
 
HRESULT __thiscall ITextHostImpl_TxGetBackStyle (ITextHost2 *iface, TXTBACKSTYLE *style)
 
HRESULT __thiscall ITextHostImpl_TxGetMaxLength (ITextHost2 *iface, DWORD *length)
 
HRESULT __thiscall ITextHostImpl_TxGetScrollBars (ITextHost2 *iface, DWORD *scrollbars)
 
HRESULT __thiscall ITextHostImpl_TxGetPasswordChar (ITextHost2 *iface, WCHAR *c)
 
HRESULT __thiscall ITextHostImpl_TxGetAcceleratorPos (ITextHost2 *iface, LONG *pos)
 
HRESULT __thiscall ITextHostImpl_TxGetExtent (ITextHost2 *iface, SIZEL *extent)
 
HRESULT __thiscall ITextHostImpl_OnTxCharFormatChange (ITextHost2 *iface, const CHARFORMATW *pcf)
 
HRESULT __thiscall ITextHostImpl_OnTxParaFormatChange (ITextHost2 *iface, const PARAFORMAT *ppf)
 
HRESULT __thiscall ITextHostImpl_TxGetPropertyBits (ITextHost2 *iface, DWORD mask, DWORD *bits)
 
HRESULT __thiscall ITextHostImpl_TxNotify (ITextHost2 *iface, DWORD iNotify, void *pv)
 
HIMC __thiscall ITextHostImpl_TxImmGetContext (ITextHost2 *iface)
 
void __thiscall ITextHostImpl_TxImmReleaseContext (ITextHost2 *iface, HIMC context)
 
HRESULT __thiscall ITextHostImpl_TxGetSelectionBarWidth (ITextHost2 *iface, LONG *width)
 
BOOL __thiscall ITextHostImpl_TxIsDoubleClickPending (ITextHost2 *iface)
 
HRESULT __thiscall ITextHostImpl_TxGetWindow (ITextHost2 *iface, HWND *hwnd)
 
HRESULT __thiscall ITextHostImpl_TxSetForegroundWindow (ITextHost2 *iface)
 
HPALETTE __thiscall ITextHostImpl_TxGetPalette (ITextHost2 *iface)
 
HRESULT __thiscall ITextHostImpl_TxGetEastAsianFlags (ITextHost2 *iface, LONG *flags)
 
HCURSOR __thiscall ITextHostImpl_TxSetCursor2 (ITextHost2 *iface, HCURSOR cursor, BOOL text)
 
void __thiscall ITextHostImpl_TxFreeTextServicesNotification (ITextHost2 *iface)
 
HRESULT __thiscall ITextHostImpl_TxGetEditStyle (ITextHost2 *iface, DWORD item, DWORD *data)
 
HRESULT __thiscall ITextHostImpl_TxGetWindowStyles (ITextHost2 *iface, DWORD *style, DWORD *ex_style)
 
HRESULT __thiscall ITextHostImpl_TxShowDropCaret (ITextHost2 *iface, BOOL show, HDC hdc, const RECT *rect)
 
HRESULT __thiscall ITextHostImpl_TxDestroyCaret (ITextHost2 *iface)
 
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)
Definition: txtsrv.c:579
#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:5457

Referenced by RichEdit10ANSIWndProc(), and RichEditWndProc_common().

◆ DllMain()

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

Definition at line 1664 of file txthost.c.

1665{
1666 switch (reason)
1667 {
1668 case DLL_PROCESS_ATTACH:
1671 if (!register_classes( instance )) return FALSE;
1672 LookupInit();
1673 break;
1674
1675 case DLL_PROCESS_DETACH:
1676 if (reserved) break;
1680 UnregisterClassA( "RichEdit50A", 0 );
1681 if (listbox_registered) UnregisterClassW( L"REListBox20W", 0 );
1682 if (combobox_registered) UnregisterClassW( L"REComboBox20W", 0 );
1683 LookupCleanup();
1685 break;
1686 }
1687 return TRUE;
1688}
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
HINSTANCE dll_instance
Definition: editor.c:253
void LookupCleanup(void)
Definition: reader.c:2190
void LookupInit(void)
Definition: reader.c:2174
#define L(x)
Definition: resources.c:13
r reserved
Definition: btrfs.c:3006
static BOOL register_classes(void)
Definition: edit.c:2629
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 = malloc( 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 free( buf );
915 return hr;
916}
@ lparam
Definition: SystemMenu.c:31
@ wparam
Definition: SystemMenu.c:30
#define ERROR_INSUFFICIENT_BUFFER
Definition: dderror.h:10
#define E_OUTOFMEMORY
Definition: ddrawi.h:100
#define free
Definition: debug_ros.c:5
#define malloc
Definition: debug_ros.c:4
#define CP_ACP
Definition: compat.h:109
#define WideCharToMultiByte
Definition: compat.h:111
#define ITextServices_TxSendMessage(This, a, b, c, d)
Definition: editor.h:414
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
LONG_PTR LPARAM
Definition: minwindef.h:175
LONG_PTR LRESULT
Definition: minwindef.h:176
DWORD WINAPI GetLastError(void)
Definition: except.c:1042
#define EM_GETLINE
Definition: winuser.h:2020
__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:2026

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 = malloc( 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 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:1647

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
UINT_PTR WPARAM
Definition: minwindef.h:174
#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
BOOL WINAPI PostMessageW(_In_opt_ HWND, _In_ UINT, _In_ WPARAM, _In_ LPARAM)
#define VK_CONTROL
Definition: winuser.h:2239
#define DC_HASDEFID
Definition: winuser.h:2651
HWND WINAPI GetDlgItem(_In_opt_ HWND, _In_ int)
#define WM_NEXTDLGCTL
Definition: winuser.h:1671
#define VK_RETURN
Definition: winuser.h:2237
#define WM_KEYDOWN
Definition: winuser.h:1743
#define DM_GETDEFID
Definition: winuser.h:2134
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 = malloc( 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
#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()

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()

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:3479

◆ 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 );
167 free( host );
168 }
169 return ref;
170}
#define InterlockedDecrement
Definition: armddk.h:52

◆ ITextHostImpl_TxActivate()

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:74
#define E_FAIL
Definition: ddrawi.h:102
HWND WINAPI SetActiveWindow(_In_ HWND)

◆ ITextHostImpl_TxClientToScreen()

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()

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()

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:76
return ret
Definition: mutex.c:146

◆ ITextHostImpl_TxDestroyCaret()

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()

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()

void __thiscall ITextHostImpl_TxFreeTextServicesNotification ( ITextHost2 *  iface)

Definition at line 589 of file txthost.c.

590{
591 return;
592}

◆ ITextHostImpl_TxGetAcceleratorPos()

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()

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()

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()

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()

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()

HRESULT __thiscall ITextHostImpl_TxGetEastAsianFlags ( ITextHost2 *  iface,
LONG flags 
)

Definition at line 577 of file txthost.c.

578{
579 return E_NOTIMPL;
580}

◆ ITextHostImpl_TxGetEditStyle()

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()

HRESULT __thiscall ITextHostImpl_TxGetExtent ( ITextHost2 *  iface,
SIZEL extent 
)

Definition at line 444 of file txthost.c.

445{
446 return E_NOTIMPL;
447}

◆ ITextHostImpl_TxGetHorzExtent()

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()

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()

HPALETTE __thiscall ITextHostImpl_TxGetPalette ( ITextHost2 *  iface)

Definition at line 571 of file txthost.c.

572{
573 return NULL;
574}

◆ ITextHostImpl_TxGetParaFormat()

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()

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:3451

◆ ITextHostImpl_TxGetPropertyBits()

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()

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()

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()

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()

HRESULT __thiscall ITextHostImpl_TxGetViewInset ( ITextHost2 *  iface,
RECT rect 
)

Definition at line 375 of file txthost.c.

376{
378 return S_OK;
379}

◆ ITextHostImpl_TxGetWindow()

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()

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()

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(_In_ HWND hWnd)
Definition: imm.c:1065

◆ ITextHostImpl_TxImmReleaseContext()

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(_In_ HWND hWnd, _In_ HIMC hIMC)
Definition: imm.c:1109
Definition: http.c:7252

◆ ITextHostImpl_TxInvalidateRect()

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()

BOOL __thiscall ITextHostImpl_TxIsDoubleClickPending ( ITextHost2 *  iface)

Definition at line 551 of file txthost.c.

552{
553 return FALSE;
554}

◆ ITextHostImpl_TxKillTimer()

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()

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:4111
#define EN_KILLFOCUS
Definition: winuser.h:2054
#define EN_SETFOCUS
Definition: winuser.h:2056
#define EN_UPDATE
Definition: winuser.h:2057
#define WM_COMMAND
Definition: winuser.h:1768
#define EN_MAXTEXT
Definition: winuser.h:2055
#define EN_HSCROLL
Definition: winuser.h:2053
#define EN_VSCROLL
Definition: winuser.h:2058
#define GWLP_ID
Definition: winuser.h:871
#define EN_ERRSPACE
Definition: winuser.h:2052
BOOL WINAPI IsWindowVisible(_In_ HWND)
#define EN_CHANGE
Definition: winuser.h:2051

◆ ITextHostImpl_TxReleaseDC()

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()

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()

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()

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()

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()

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()

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()

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()

HRESULT __thiscall ITextHostImpl_TxSetForegroundWindow ( ITextHost2 *  iface)

Definition at line 565 of file txthost.c.

566{
567 return E_NOTIMPL;
568}

◆ ITextHostImpl_TxSetScrollPos()

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:416
#define ITextServices_TxGetVScroll(This, a, b, c, d, e)
Definition: editor.h:417
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()

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()

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:248
UINT_PTR WINAPI SetTimer(_In_opt_ HWND, _In_ UINT_PTR, _In_ UINT, _In_opt_ TIMERPROC)

◆ ITextHostImpl_TxShowCaret()

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()

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()

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()

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 1557 of file txthost.c.

1558{
1559 /* FIXME: Not implemented */
1560 TRACE( "hwnd %p msg %04x (%s) %08Ix %08Ix\n",
1562 return DefWindowProcW( hwnd, msg, wparam, lparam );
1563}
#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 1579 of file txthost.c.

1580{
1581 WNDCLASSW wc;
1582 UINT result;
1583
1584 FIXME( "semi stub\n" );
1585 wc.cbClsExtra = 0;
1586 wc.cbWndExtra = 4;
1587 wc.hInstance = NULL;
1588 wc.hIcon = NULL;
1589 wc.hCursor = NULL;
1590 wc.hbrBackground = (HBRUSH)(COLOR_WINDOW + 1);
1591 wc.lpszMenuName = NULL;
1592
1593 if (!listbox_registered)
1594 {
1597 wc.lpszClassName = L"REListBox20W";
1599 }
1600
1602 {
1605 wc.lpszClassName = L"REComboBox20W";
1607 }
1608
1609 result = 0;
1610 if (listbox_registered) result += 1;
1611 if (combobox_registered) result += 2;
1612
1613 return result;
1614}
GLuint64EXT * result
Definition: glext.h:11304
LPCWSTR lpszClassName
Definition: winuser.h:3287
LPCWSTR lpszMenuName
Definition: winuser.h:3286
HBRUSH hbrBackground
Definition: winuser.h:3285
HICON hIcon
Definition: winuser.h:3283
HINSTANCE hInstance
Definition: winuser.h:3282
int cbClsExtra
Definition: winuser.h:3280
UINT style
Definition: winuser.h:3278
WNDPROC lpfnWndProc
Definition: winuser.h:3279
int cbWndExtra
Definition: winuser.h:3281
HCURSOR hCursor
Definition: winuser.h:3284
static LRESULT WINAPI REComboWndProc(HWND hwnd, UINT msg, WPARAM wparam, LPARAM lparam)
Definition: txthost.c:1557
static LRESULT WINAPI REListWndProc(HWND hwnd, UINT msg, WPARAM wparam, LPARAM lparam)
Definition: txthost.c:1565
#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 1616 of file txthost.c.

1617{
1618 WNDCLASSW wcW;
1619 WNDCLASSA wcA;
1620
1623 wcW.cbClsExtra = 0;
1624 wcW.cbWndExtra = sizeof(struct host *);
1625 wcW.hInstance = NULL; /* hInstance would register DLL-local class */
1626 wcW.hIcon = NULL;
1629 wcW.lpszMenuName = NULL;
1630
1631 if (!(GetVersion() & 0x80000000))
1632 {
1634 if (!RegisterClassW( &wcW )) return FALSE;
1636 if (!RegisterClassW( &wcW )) return FALSE;
1637 }
1638 else
1639 {
1640 /* WNDCLASSA/W have the same layout */
1641 wcW.lpszClassName = (LPCWSTR)"RichEdit20W";
1642 if (!RegisterClassA( (WNDCLASSA *)&wcW )) return FALSE;
1643 wcW.lpszClassName = (LPCWSTR)"RichEdit50W";
1644 if (!RegisterClassA( (WNDCLASSA *)&wcW )) return FALSE;
1645 }
1646
1649 wcA.cbClsExtra = 0;
1650 wcA.cbWndExtra = sizeof(struct host *);
1651 wcA.hInstance = NULL; /* hInstance would register DLL-local class */
1652 wcA.hIcon = NULL;
1655 wcA.lpszMenuName = NULL;
1657 if (!RegisterClassA( &wcA )) return FALSE;
1658 wcA.lpszClassName = "RichEdit50A";
1659 if (!RegisterClassA( &wcA )) return FALSE;
1660
1661 return TRUE;
1662}
DWORD WINAPI GetVersion(void)
Definition: version.c:1458
HBRUSH hbrBackground
Definition: winuser.h:3272
HICON hIcon
Definition: winuser.h:3270
HINSTANCE hInstance
Definition: winuser.h:3269
HCURSOR hCursor
Definition: winuser.h:3271
int cbWndExtra
Definition: winuser.h:3268
UINT style
Definition: winuser.h:3265
LPCSTR lpszMenuName
Definition: winuser.h:3273
LPCSTR lpszClassName
Definition: winuser.h:3274
WNDPROC lpfnWndProc
Definition: winuser.h:3266
int cbClsExtra
Definition: winuser.h:3267
static LRESULT WINAPI RichEditWndProcA(HWND hwnd, UINT msg, WPARAM wparam, LPARAM lparam)
Definition: txthost.c:1529
static LRESULT WINAPI RichEditWndProcW(HWND hwnd, UINT msg, WPARAM wparam, LPARAM lparam)
Definition: txthost.c:1518
HGDIOBJ WINAPI GetStockObject(_In_ int)
#define NULL_BRUSH
Definition: wingdi.h:901
HCURSOR WINAPI LoadCursorW(_In_opt_ HINSTANCE, _In_ LPCWSTR)
Definition: cursoricon.c:2457
ATOM WINAPI RegisterClassA(_In_ CONST WNDCLASSA *)
#define IDC_IBEAM
Definition: winuser.h:696
const WCHAR * LPCWSTR
Definition: xmlstorage.h:185
WCHAR * LPWSTR
Definition: xmlstorage.h:184

◆ REListWndProc()

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

Definition at line 1565 of file txthost.c.

1566{
1567 /* FIXME: Not implemented */
1568 TRACE( "hwnd %p msg %04x (%s) %08Ix %08Ix\n",
1570 return DefWindowProcW( hwnd, msg, wparam, lparam );
1571}

Referenced by REExtendedRegisterClass().

◆ RichEdit10ANSIWndProc()

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

Definition at line 1545 of file txthost.c.

1546{
1547 if (msg == WM_NCCREATE && !GetWindowLongPtrW( hwnd, 0 ))
1548 {
1550
1551 TRACE( "WM_NCCREATE: hwnd %p style 0x%08lx\n", hwnd, pcs->style );
1552 return create_windowed_editor( hwnd, pcs, TRUE );
1553 }
1555}
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:1537
#define GetWindowLongPtrW
Definition: winuser.h:4931
#define WM_NCCREATE
Definition: winuser.h:1711

Referenced by RICHED32_Register().

◆ RichEditANSIWndProc()

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

Definition at line 1537 of file txthost.c.

1538{
1539 return RichEditWndProcA( hwnd, msg, wparam, lparam );
1540}

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) %Ix %Ix, 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%08lx\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) %Ix %Ix -> 0\n",
1115 ITextHost2_Release( &host->ITextHost_iface );
1116 return 0;
1117 }
1118
1119 if (res)
1120 {
1121 TRACE( "exit (filtered %Iu) hwnd %p msg %04x (%s) %Ix %Ix -> 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 LRESULT evmask;
1148
1150
1151 if (lparam)
1152 {
1153 text = unicode ? (void *)createW->lpszName : (void *)createA->lpszName;
1155 }
1161 break;
1162 }
1163 case WM_DESTROY:
1164 if (!host->notify_level) ITextHost2_Release( &host->ITextHost_iface );
1165 else host->defer_release = 1;
1166 return 0;
1167
1168 case WM_ERASEBKGND:
1169 {
1170 HDC hdc = (HDC)wparam;
1171 RECT rc;
1172 HBRUSH brush;
1173
1174 if (GetUpdateRect( hwnd, &rc, TRUE ))
1175 {
1177 FillRect( hdc, &rc, brush );
1178 DeleteObject( brush );
1179 }
1180 return 1;
1181 }
1182 case EM_FINDTEXT:
1183 {
1185 FINDTEXTW new_params;
1186 int len;
1187
1188 if (!unicode)
1189 {
1190 new_params.chrg = params->chrg;
1191 new_params.lpstrText = ME_ToUnicode( CP_ACP, (char *)params->lpstrText, &len );
1192 params = &new_params;
1193 }
1195 if (!unicode) ME_EndToUnicode( CP_ACP, (WCHAR *)new_params.lpstrText );
1196 break;
1197 }
1198 case EM_FINDTEXTEX:
1199 {
1200 FINDTEXTEXA *paramsA = (FINDTEXTEXA *)lparam;
1202 FINDTEXTEXW new_params;
1203 int len;
1204
1205 if (!unicode)
1206 {
1207 new_params.chrg = params->chrg;
1208 new_params.lpstrText = ME_ToUnicode( CP_ACP, (char *)params->lpstrText, &len );
1209 params = &new_params;
1210 }
1212 if (!unicode)
1213 {
1214 ME_EndToUnicode( CP_ACP, (WCHAR *)new_params.lpstrText );
1215 paramsA->chrgText = params->chrgText;
1216 }
1217 break;
1218 }
1219 case WM_GETDLGCODE:
1220 if (lparam) host->dialog_mode = TRUE;
1221
1225 break;
1226
1227 case EM_GETLINE:
1229 else hr = get_lineA( host->text_srv, wparam, lparam, &res );
1230 break;
1231
1232 case EM_GETPASSWORDCHAR:
1234 break;
1235
1236 case EM_GETRECT:
1238 break;
1239
1240 case EM_GETSELTEXT:
1241 {
1243
1245 else
1246 {
1248 range.lpstrText = (char *)lparam;
1249 range.lpstrText[0] = '\0';
1250 hr = get_text_rangeA( host, &range, &res );
1251 }
1252 break;
1253 }
1254 case EM_GETOPTIONS:
1264 break;
1265
1266 case WM_GETTEXT:
1267 {
1269
1270 params.cb = wparam * (unicode ? sizeof(WCHAR) : sizeof(CHAR));
1271 params.flags = GT_USECRLF;
1272 params.codepage = unicode ? CP_UNICODE : CP_ACP;
1273 params.lpDefaultChar = NULL;
1274 params.lpUsedDefChar = NULL;
1276 break;
1277 }
1278 case WM_GETTEXTLENGTH:
1279 {
1281
1283 params.codepage = unicode ? CP_UNICODE : CP_ACP;
1285 break;
1286 }
1287 case EM_GETTEXTRANGE:
1289 else hr = get_text_rangeA( host, (TEXTRANGEA *)lparam, &res );
1290 break;
1291
1292 case WM_KEYDOWN:
1293 switch (LOWORD( wparam ))
1294 {
1295 case VK_ESCAPE:
1296 if (host->dialog_mode && host->parent)
1297 PostMessageW( host->parent, WM_CLOSE, 0, 0 );
1298 break;
1299 case VK_TAB:
1300 if (host->dialog_mode && host->parent)
1302 break;
1303 case VK_RETURN:
1304 if (host->dialog_mode && !host->emulate_10 && handle_dialog_enter( host )) break;
1305 /* fall through */
1306 default:
1308 }
1309 break;
1310
1311 case WM_PAINT:
1312 case WM_PRINTCLIENT:
1313 {
1314 HDC hdc;
1315 RECT rc, client, update;
1316 PAINTSTRUCT ps;
1317 HBRUSH brush, old_brush;
1318 LONG view_id;
1319
1321
1322 if (msg == WM_PAINT)
1323 {
1324 /* TODO retrieve if the text document is frozen */
1325 hdc = BeginPaint( hwnd, &ps );
1326 update = ps.rcPaint;
1327 view_id = TXTVIEW_ACTIVE;
1328 }
1329 else
1330 {
1331 hdc = (HDC)wparam;
1332 update = client;
1333 view_id = TXTVIEW_INACTIVE;
1334 }
1335
1337 old_brush = SelectObject( hdc, brush );
1338
1339 /* Erase area outside of the formatting rectangle */
1340 if (update.top < client.top)
1341 {
1342 rc = update;
1343 rc.bottom = client.top;
1344 PatBlt( hdc, rc.left, rc.top, rc.right - rc.left, rc.bottom - rc.top, PATCOPY );
1345 update.top = client.top;
1346 }
1347 if (update.bottom > client.bottom)
1348 {
1349 rc = update;
1350 rc.top = client.bottom;
1351 PatBlt( hdc, rc.left, rc.top, rc.right - rc.left, rc.bottom - rc.top, PATCOPY );
1352 update.bottom = client.bottom;
1353 }
1354 if (update.left < client.left)
1355 {
1356 rc = update;
1357 rc.right = client.left;
1358 PatBlt( hdc, rc.left, rc.top, rc.right - rc.left, rc.bottom - rc.top, PATCOPY );
1359 update.left = client.left;
1360 }
1361 if (update.right > client.right)
1362 {
1363 rc = update;
1364 rc.left = client.right;
1365 PatBlt( hdc, rc.left, rc.top, rc.right - rc.left, rc.bottom - rc.top, PATCOPY );
1366 update.right = client.right;
1367 }
1368
1369 ITextServices_TxDraw( host->text_srv, DVASPECT_CONTENT, 0, NULL, NULL, hdc, NULL, NULL, NULL,
1370 &update, NULL, 0, view_id );
1371 SelectObject( hdc, old_brush );
1372 DeleteObject( brush );
1373 if (msg == WM_PAINT) EndPaint( hwnd, &ps );
1374 return 0;
1375 }
1376 case EM_REPLACESEL:
1377 {
1378 int len;
1379 LONG codepage = unicode ? CP_UNICODE : CP_ACP;
1380 WCHAR *text = ME_ToUnicode( codepage, (void *)lparam, &len );
1381
1384 res = len;
1385 break;
1386 }
1387 case EM_SETBKGNDCOLOR:
1392 break;
1393
1394 case WM_SETCURSOR:
1395 {
1396 POINT pos;
1397 RECT rect;
1398
1399 if (hwnd != (HWND)wparam) break;
1400 GetCursorPos( &pos );
1401 ScreenToClient( hwnd, &pos );
1403 if (PtInRect( &rect, pos ))
1404 ITextServices_OnTxSetCursor( host->text_srv, DVASPECT_CONTENT, 0, NULL, NULL, NULL, NULL, NULL, pos.x, pos.y );
1406 break;
1407 }
1408 case EM_SETEVENTMASK:
1411 break;
1412
1413 case EM_SETOPTIONS:
1415 break;
1416
1417 case EM_SETPASSWORDCHAR:
1418 if (wparam == host->password_char) break;
1421 else host->props &= ~TXTBIT_USEPASSWORD;
1423 break;
1424
1425 case EM_SETREADONLY:
1426 {
1428 DWORD mask = wparam ? ECO_READONLY : ~ECO_READONLY;
1429
1431 return 1;
1432 }
1433 case EM_SETRECT:
1434 case EM_SETRECTNP:
1435 {
1436 RECT *rc = (RECT *)lparam;
1437
1438 if (!rc) host->use_set_rect = 0;
1439 else
1440 {
1441 if (wparam >= 2) break;
1442 host->set_rect = *rc;
1443 if (host->client_edge)
1444 {
1445 InflateRect( &host->set_rect, 1, 0 );
1446 host->set_rect.top -= 1;
1447 }
1449 host->use_set_rect = 1;
1450 }
1452 break;
1453 }
1454 case WM_SETTEXT:
1455 {
1456 char *textA = (char *)lparam;
1457 WCHAR *text = (WCHAR *)lparam;
1458 int len;
1459
1460 if (!unicode && textA && strncmp( textA, "{\\rtf", 5 ) && strncmp( textA, "{\\urtf", 6 ))
1463 if (text != (WCHAR *)lparam) ME_EndToUnicode( CP_ACP, text );
1464 break;
1465 }
1466 case EM_SHOWSCROLLBAR:
1467 {
1468 DWORD mask = 0, new;
1469
1470 if (wparam == SB_HORZ) mask = WS_HSCROLL;
1471 else if (wparam == SB_VERT) mask = WS_VSCROLL;
1472 else if (wparam == SB_BOTH) mask = WS_HSCROLL | WS_VSCROLL;
1473
1474 if (mask)
1475 {
1476 new = lparam ? mask : 0;
1477 if ((host->scrollbars & mask) != new)
1478 {
1479 host->scrollbars &= ~mask;
1480 host->scrollbars |= new;
1482 }
1483 }
1484
1485 res = 0;
1486 break;
1487 }
1489 {
1490 RECT client;
1491 WINDOWPOS *winpos = (WINDOWPOS *)lparam;
1492
1493 hr = S_FALSE; /* call defwndproc */
1494 if (winpos->flags & SWP_NOCLIENTSIZE) break;
1496 if (host->use_set_rect)
1497 {
1500 }
1503 break;
1504 }
1505 default:
1507 }
1508
1509 if (hr == S_FALSE)
1511
1512 TRACE( "exit hwnd %p msg %04x (%s) %Ix %Ix, unicode %d -> %Iu\n",
1513 hwnd, msg, get_msg_name(msg), wparam, lparam, unicode, res );
1514
1515 return res;
1516}
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:425
#define ITextServices_TxDraw(This, a, b, c, d, e, f, g, h, i, j, k, l)
Definition: editor.h:415
void ME_EndToUnicode(LONG codepage, LPVOID psz)
Definition: string.c:248
#define ITextHost_TxGetSysColor(This, a)
Definition: editor.h:357
#define ITextServices_OnTxInPlaceActivate(This, a)
Definition: editor.h:420
#define ITextHost_TxGetClientRect(This, a)
Definition: editor.h:353
#define ITextHost_TxGetPasswordChar(This, a)
Definition: editor.h:361
#define ITextHost_TxSetCursor(This, a, b)
Definition: editor.h:348
#define ITextServices_OnTxPropertyBitsChange(This, a, b)
Definition: editor.h:430
LPWSTR ME_ToUnicode(LONG codepage, LPVOID psz, INT *len)
Definition: string.c:226
#define ITextServices_OnTxSetCursor(This, a, b, c, d, e, f, g, h, i)
Definition: editor.h:418
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 ENM_CHANGE
Definition: richedit.h:468
#define ECO_NOHIDESEL
Definition: richedit.h:459
#define ECO_WANTRETURN
Definition: richedit.h:461
#define GTL_CLOSE
Definition: richedit.h:1057
#define EM_GETEVENTMASK
Definition: richedit.h:92
#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:37
UINT flags
Definition: winuser.h:3696
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:3051
Definition: windef.h:99
LONG right
Definition: windef.h:102
LONG bottom
Definition: windef.h:103
LONG top
Definition: windef.h:101
LONG left
Definition: windef.h:100
#define TXTBIT_AUTOWORDSEL
Definition: textserv.h:192
#define TXTBIT_CLIENTRECTCHANGE
Definition: textserv.h:205
#define TXTBIT_SCROLLBARCHANGE
Definition: textserv.h:201
@ TXTVIEW_INACTIVE
Definition: textserv.h:182
@ 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:1648
#define EM_SETREADONLY
Definition: winuser.h:2044
#define WM_ERASEBKGND
Definition: winuser.h:1653
#define EM_GETRECT
Definition: winuser.h:2025
#define WM_CLOSE
Definition: winuser.h:1649
#define VK_TAB
Definition: winuser.h:2235
#define WM_MOUSEFIRST
Definition: winuser.h:1802
#define WM_HSCROLL
Definition: winuser.h:1771
#define WM_MOUSELAST
Definition: winuser.h:1829
#define EM_GETPASSWORDCHAR
Definition: winuser.h:2024
#define WM_VSCROLL
Definition: winuser.h:1772
#define WM_CREATE
Definition: winuser.h:1636
#define DLGC_WANTCHARS
Definition: winuser.h:2660
#define DLGC_WANTTAB
Definition: winuser.h:2653
#define EM_SETPASSWORDCHAR
Definition: winuser.h:2043
#define EM_REPLACESEL
Definition: winuser.h:2035
#define IDC_ARROW
Definition: winuser.h:695
#define WM_KEYFIRST
Definition: winuser.h:1742
BOOL WINAPI GetCursorPos(_Out_ LPPOINT)
Definition: cursoricon.c:3047
#define EM_SETRECT
Definition: winuser.h:2045
#define WM_GETTEXT
Definition: winuser.h:1646
BOOL WINAPI PtInRect(_In_ LPCRECT, _In_ POINT)
#define WM_SETTEXT
Definition: winuser.h:1645
#define EM_SETRECTNP
Definition: winuser.h:2046
BOOL WINAPI EndPaint(_In_ HWND, _In_ const PAINTSTRUCT *)
#define DLGC_WANTARROWS
Definition: winuser.h:2652
BOOL WINAPI IntersectRect(_Out_ LPRECT, _In_ LPCRECT, _In_ LPCRECT)
#define WM_CHAR
Definition: winuser.h:1745
#define WM_SETCURSOR
Definition: winuser.h:1664
#define VK_SHIFT
Definition: winuser.h:2238
#define DLGC_WANTMESSAGE
Definition: winuser.h:2655
#define WM_DESTROY
Definition: winuser.h:1637
#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:1756
#define VK_ESCAPE
Definition: winuser.h:2250
#define WM_WINDOWPOSCHANGED
Definition: winuser.h:1690
#define DLGC_HASSETSEL
Definition: winuser.h:2656
#define WM_GETDLGCODE
Definition: winuser.h:1717
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 1529 of file txthost.c.

1530{
1532}
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 1518 of file txthost.c.

1519{
1520 BOOL unicode = TRUE;
1521
1522 /* Under Win9x RichEdit20W returns ANSI strings, see the tests. */
1523 if (msg == WM_GETTEXT && (GetVersion() & 0x80000000))
1524 unicode = FALSE;
1525
1526 return RichEditWndProc_common( hwnd, msg, wparam, lparam, unicode );
1527}

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:3260
UINT code
Definition: winuser.h:3261
HWND hwndFrom
Definition: winuser.h:3259

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:98
#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().