Skip to content

Commit 6de647e

Browse files
committed
Update WINESYNC.txt and use new riched20.h file to keep Wine diffs to a minimum as suggested by Timo.
1 parent 18ee978 commit 6de647e

File tree

6 files changed

+288
-160
lines changed

6 files changed

+288
-160
lines changed

dll/win32/riched20/editor.h

Lines changed: 31 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,7 @@
1818
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
1919
*/
2020

21-
#ifndef RICHED20_EDITOR_H
22-
#define RICHED20_EDITOR_H
21+
#pragma once
2322

2423
#include "editstr.h"
2524

@@ -50,43 +49,6 @@ static inline const char *debugstr_run( const ME_Run *run )
5049
return debugstr_wn( get_text( run, 0 ), run->len );
5150
}
5251

53-
#define CP_UNICODE 1200
54-
55-
/* smart helpers for A<->W conversions, they reserve/free memory and call MultiByte<->WideChar functions */
56-
LPWSTR ME_ToUnicode(LONG codepage, LPVOID psz, INT *len) DECLSPEC_HIDDEN;
57-
void ME_EndToUnicode(LONG codepage, LPVOID psz) DECLSPEC_HIDDEN;
58-
59-
static inline int ME_IsWSpace(WCHAR ch)
60-
{
61-
return ch > '\0' && ch <= ' ';
62-
}
63-
64-
static inline int ME_CharCompare(WCHAR a, WCHAR b, int caseSensitive)
65-
{
66-
return caseSensitive ? (a == b) : (towupper(a) == towupper(b));
67-
}
68-
69-
static inline ME_DisplayItem *row_get_di( ME_Row *row )
70-
{
71-
return (ME_DisplayItem *)((ptrdiff_t)row - offsetof(ME_DisplayItem, member));
72-
}
73-
74-
static inline ME_DisplayItem *run_get_di( ME_Run *run )
75-
{
76-
return (ME_DisplayItem *)((ptrdiff_t)run - offsetof(ME_DisplayItem, member));
77-
}
78-
79-
static inline ME_DisplayItem *para_get_di(ME_Paragraph *para)
80-
{
81-
return (ME_DisplayItem *)((ptrdiff_t)para - offsetof(ME_DisplayItem, member));
82-
}
83-
static inline ME_DisplayItem *cell_get_di(ME_Cell *cell)
84-
{
85-
return (ME_DisplayItem *)((ptrdiff_t)cell - offsetof(ME_DisplayItem, member));
86-
}
87-
88-
#endif
89-
9052
/* style.c */
9153
ME_Style *style_get_insert_style( ME_TextEditor *editor, ME_Cursor *cursor ) DECLSPEC_HIDDEN;
9254
ME_Style *ME_MakeStyle(CHARFORMAT2W *style) DECLSPEC_HIDDEN;
@@ -128,7 +90,21 @@ int ME_CallWordBreakProc(ME_TextEditor *editor, WCHAR *str, INT len, INT start,
12890
void ME_StrDeleteV(ME_String *s, int nVChar, int nChars) DECLSPEC_HIDDEN;
12991
BOOL ME_InsertString(ME_String *s, int ofs, const WCHAR *insert, int len) DECLSPEC_HIDDEN;
13092

93+
#define CP_UNICODE 1200
94+
95+
/* smart helpers for A<->W conversions, they reserve/free memory and call MultiByte<->WideChar functions */
96+
LPWSTR ME_ToUnicode(LONG codepage, LPVOID psz, INT *len) DECLSPEC_HIDDEN;
97+
void ME_EndToUnicode(LONG codepage, LPVOID psz) DECLSPEC_HIDDEN;
98+
99+
static inline int ME_IsWSpace(WCHAR ch)
100+
{
101+
return ch > '\0' && ch <= ' ';
102+
}
131103

104+
static inline int ME_CharCompare(WCHAR a, WCHAR b, int caseSensitive)
105+
{
106+
return caseSensitive ? (a == b) : (towupper(a) == towupper(b));
107+
}
132108

133109
/* note: those two really return the first matching offset (starting from EOS)+1
134110
* in other words, an offset of the first trailing white/black */
@@ -147,7 +123,10 @@ ME_Run *row_next_run( ME_Row *row, ME_Run *run ) DECLSPEC_HIDDEN;
147123
int row_number_from_char_ofs( ME_TextEditor *editor, int ofs ) DECLSPEC_HIDDEN;
148124
ME_Paragraph *row_para( ME_Row *row ) DECLSPEC_HIDDEN;
149125
ME_Row *row_prev_all_paras( ME_Row *row ) DECLSPEC_HIDDEN;
150-
126+
static inline ME_DisplayItem *row_get_di( ME_Row *row )
127+
{
128+
return (ME_DisplayItem *)((ptrdiff_t)row - offsetof(ME_DisplayItem, member));
129+
}
151130

152131
/* run.c */
153132
void cursor_from_char_ofs( ME_TextEditor *editor, int char_ofs, ME_Cursor *cursor ) DECLSPEC_HIDDEN;
@@ -181,7 +160,10 @@ void ME_GetCharFormat(ME_TextEditor *editor, const ME_Cursor *from,
181160
void ME_GetSelectionCharFormat(ME_TextEditor *editor, CHARFORMAT2W *pFmt) DECLSPEC_HIDDEN;
182161
void ME_GetDefaultCharFormat(ME_TextEditor *editor, CHARFORMAT2W *pFmt) DECLSPEC_HIDDEN;
183162
void ME_SetDefaultCharFormat(ME_TextEditor *editor, CHARFORMAT2W *mod) DECLSPEC_HIDDEN;
184-
163+
static inline ME_DisplayItem *run_get_di( ME_Run *run )
164+
{
165+
return (ME_DisplayItem *)((ptrdiff_t)run - offsetof(ME_DisplayItem, member));
166+
}
185167

186168
/* caret.c */
187169
void cursor_coords( ME_TextEditor *editor, ME_Cursor *cursor, int *x, int *y, int *height ) DECLSPEC_HIDDEN;
@@ -252,7 +234,10 @@ ME_Paragraph *para_prev( ME_Paragraph *para ) DECLSPEC_HIDDEN;
252234
ME_Paragraph *para_split( ME_TextEditor *editor, ME_Run *run, ME_Style *style,
253235
const WCHAR *eol_str, int eol_len, int paraFlags ) DECLSPEC_HIDDEN;
254236

255-
237+
static inline ME_DisplayItem *para_get_di(ME_Paragraph *para)
238+
{
239+
return (ME_DisplayItem *)((ptrdiff_t)para - offsetof(ME_DisplayItem, member));
240+
}
256241

257242
/* paint.c */
258243
void editor_draw( ME_TextEditor *editor, HDC hDC, const RECT *update ) DECLSPEC_HIDDEN;
@@ -331,6 +316,10 @@ ME_Cell *table_row_first_cell( ME_Paragraph *para ) DECLSPEC_HIDDEN;
331316
ME_Paragraph *table_row_start( ME_Paragraph *para ) DECLSPEC_HIDDEN;
332317
struct RTFTable *ME_MakeTableDef(ME_TextEditor *editor) DECLSPEC_HIDDEN;
333318
void ME_InitTableDef(ME_TextEditor *editor, struct RTFTable *tableDef) DECLSPEC_HIDDEN;
319+
static inline ME_DisplayItem *cell_get_di(ME_Cell *cell)
320+
{
321+
return (ME_DisplayItem *)((ptrdiff_t)cell - offsetof(ME_DisplayItem, member));
322+
}
334323

335324

336325
/* txthost.c */

dll/win32/riched20/list.c

Lines changed: 0 additions & 45 deletions
Original file line numberDiff line numberDiff line change
@@ -63,51 +63,6 @@ static BOOL ME_DITypesEqual(ME_DIType type, ME_DIType nTypeOrClass)
6363
}
6464
}
6565

66-
/* Modifies run pointer to point to the next run.
67-
* If all_para is FALSE constrain the search to the current para,
68-
* otherwise modify the paragraph pointer if moving into the next paragraph.
69-
*
70-
* Returns TRUE if next run is found, otherwise returns FALSE. */
71-
BOOL ME_NextRun(ME_DisplayItem **para, ME_DisplayItem **run, BOOL all_para)
72-
{
73-
ME_DisplayItem *p = (*run)->next;
74-
while (p->type != diTextEnd)
75-
{
76-
if (p->type == diParagraph) {
77-
if (!all_para) return FALSE;
78-
*para = p;
79-
} else if (p->type == diRun) {
80-
*run = p;
81-
return TRUE;
82-
}
83-
p = p->next;
84-
}
85-
return FALSE;
86-
}
87-
88-
/* Modifies run pointer to point to the previous run.
89-
* If all_para is FALSE constrain the search to the current para,
90-
* otherwise modify the paragraph pointer if moving into the previous paragraph.
91-
*
92-
* Returns TRUE if previous run is found, otherwise returns FALSE. */
93-
BOOL ME_PrevRun(ME_DisplayItem **para, ME_DisplayItem **run, BOOL all_para)
94-
{
95-
ME_DisplayItem *p = (*run)->prev;
96-
while (p->type != diTextStart)
97-
{
98-
if (p->type == diParagraph) {
99-
if (!all_para) return FALSE;
100-
if (para && p->member.para.prev_para->type == diParagraph)
101-
*para = p->member.para.prev_para;
102-
} else if (p->type == diRun) {
103-
*run = p;
104-
return TRUE;
105-
}
106-
p = p->prev;
107-
}
108-
return FALSE;
109-
}
110-
11166
ME_DisplayItem *ME_FindItemBack(ME_DisplayItem *di, ME_DIType nTypeOrClass)
11267
{
11368
if (!di)

dll/win32/riched20/riched20.h

Lines changed: 185 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,185 @@
1+
/*
2+
* RichEdit - functions and interfaces around CreateTextServices for txtsrv.c
3+
*
4+
* Copyright 2005, 2006, Maarten Lankhorst
5+
*
6+
* RichEdit - ITextHost implementation for windowed richedit controls for txthost.c
7+
*
8+
* Copyright 2009 by Dylan Smith
9+
*
10+
* This library is free software; you can redistribute it and/or
11+
* modify it under the terms of the GNU Lesser General Public
12+
* License as published by the Free Software Foundation; either
13+
* version 2.1 of the License, or (at your option) any later version.
14+
*
15+
* This library is distributed in the hope that it will be useful,
16+
* but WITHOUT ANY WARRANTY; without even the implied warranty of
17+
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
18+
* Lesser General Public License for more details.
19+
*
20+
* You should have received a copy of the GNU Lesser General Public
21+
* License along with this library; if not, write to the Free Software
22+
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
23+
*/
24+
25+
26+
/* Forward definitions from txtsrv.c to make MSVC compile in ReactOS. */
27+
28+
DECLSPEC_HIDDEN HRESULT __thiscall fnTextSrv_TxSendMessage( ITextServices *iface, UINT msg, WPARAM wparam,
29+
LPARAM lparam, LRESULT *result );
30+
31+
DECLSPEC_HIDDEN HRESULT __thiscall fnTextSrv_TxDraw( ITextServices *iface, DWORD aspect, LONG index, void *aspect_info,
32+
DVTARGETDEVICE *td, HDC draw, HDC target,
33+
const RECTL *bounds, const RECTL *mf_bounds, RECT *update,
34+
BOOL (CALLBACK *continue_fn)(DWORD), DWORD continue_param,
35+
LONG view_id );
36+
37+
DECLSPEC_HIDDEN HRESULT __thiscall fnTextSrv_TxGetHScroll( ITextServices *iface, LONG *min_pos, LONG *max_pos, LONG *pos,
38+
LONG *page, BOOL *enabled );
39+
40+
DECLSPEC_HIDDEN HRESULT __thiscall fnTextSrv_TxGetVScroll( ITextServices *iface, LONG *min_pos, LONG *max_pos, LONG *pos,
41+
LONG *page, BOOL *enabled );
42+
43+
DECLSPEC_HIDDEN HRESULT __thiscall fnTextSrv_OnTxSetCursor( ITextServices *iface, DWORD aspect, LONG index,
44+
void *aspect_info, DVTARGETDEVICE *td, HDC draw,
45+
HDC target, const RECT *client, INT x, INT y );
46+
47+
DECLSPEC_HIDDEN HRESULT __thiscall fnTextSrv_TxQueryHitPoint(ITextServices *iface, DWORD dwDrawAspect, LONG lindex,
48+
void *pvAspect, DVTARGETDEVICE *ptd, HDC hdcDraw,
49+
HDC hicTargetDev, LPCRECT lprcClient, INT x, INT y,
50+
DWORD *pHitResult);
51+
52+
DECLSPEC_HIDDEN HRESULT __thiscall fnTextSrv_OnTxInPlaceActivate( ITextServices *iface, const RECT *client );
53+
54+
DECLSPEC_HIDDEN HRESULT __thiscall fnTextSrv_OnTxInPlaceDeactivate(ITextServices *iface);
55+
56+
DECLSPEC_HIDDEN HRESULT __thiscall fnTextSrv_OnTxUIActivate(ITextServices *iface);
57+
58+
DECLSPEC_HIDDEN HRESULT __thiscall fnTextSrv_OnTxUIDeactivate(ITextServices *iface);
59+
60+
DECLSPEC_HIDDEN HRESULT __thiscall fnTextSrv_TxGetText( ITextServices *iface, BSTR *text );
61+
62+
DECLSPEC_HIDDEN HRESULT __thiscall fnTextSrv_TxSetText( ITextServices *iface, const WCHAR *text );
63+
64+
DECLSPEC_HIDDEN HRESULT __thiscall fnTextSrv_TxGetCurTargetX(ITextServices *iface, LONG *x);
65+
66+
DECLSPEC_HIDDEN HRESULT __thiscall fnTextSrv_TxGetBaseLinePos(ITextServices *iface, LONG *x);
67+
68+
DECLSPEC_HIDDEN HRESULT __thiscall fnTextSrv_TxGetNaturalSize( ITextServices *iface, DWORD aspect, HDC draw,
69+
HDC target, DVTARGETDEVICE *td, DWORD mode,
70+
const SIZEL *extent, LONG *width, LONG *height );
71+
72+
DECLSPEC_HIDDEN HRESULT __thiscall fnTextSrv_TxGetDropTarget(ITextServices *iface, IDropTarget **ppDropTarget);
73+
74+
DECLSPEC_HIDDEN HRESULT __thiscall fnTextSrv_OnTxPropertyBitsChange( ITextServices *iface, DWORD mask, DWORD bits );
75+
76+
DECLSPEC_HIDDEN HRESULT __thiscall fnTextSrv_TxGetCachedSize(ITextServices *iface, DWORD *pdwWidth, DWORD *pdwHeight);
77+
78+
79+
/* Forward definitions from txthost.c to make MSVC compile in ReactOS. */
80+
81+
82+
DECLSPEC_HIDDEN HDC __thiscall ITextHostImpl_TxGetDC( ITextHost2 *iface );
83+
84+
DECLSPEC_HIDDEN INT __thiscall ITextHostImpl_TxReleaseDC( ITextHost2 *iface, HDC hdc );
85+
86+
DECLSPEC_HIDDEN BOOL __thiscall ITextHostImpl_TxShowScrollBar( ITextHost2 *iface, INT bar, BOOL show );
87+
88+
DECLSPEC_HIDDEN BOOL __thiscall ITextHostImpl_TxEnableScrollBar( ITextHost2 *iface, INT bar, INT arrows );
89+
90+
DECLSPEC_HIDDEN BOOL __thiscall ITextHostImpl_TxSetScrollRange( ITextHost2 *iface, INT bar, LONG min_pos, INT max_pos, BOOL redraw );
91+
92+
DECLSPEC_HIDDEN BOOL __thiscall ITextHostImpl_TxSetScrollPos( ITextHost2 *iface, INT bar, INT pos, BOOL redraw );
93+
94+
DECLSPEC_HIDDEN void __thiscall ITextHostImpl_TxInvalidateRect( ITextHost2 *iface, const RECT *rect, BOOL mode );
95+
96+
DECLSPEC_HIDDEN void __thiscall ITextHostImpl_TxViewChange( ITextHost2 *iface, BOOL update );
97+
98+
DECLSPEC_HIDDEN BOOL __thiscall ITextHostImpl_TxCreateCaret( ITextHost2 *iface, HBITMAP bitmap, INT width, INT height );
99+
100+
DECLSPEC_HIDDEN BOOL __thiscall ITextHostImpl_TxShowCaret( ITextHost2 *iface, BOOL show );
101+
102+
DECLSPEC_HIDDEN BOOL __thiscall ITextHostImpl_TxSetCaretPos( ITextHost2 *iface, INT x, INT y );
103+
104+
DECLSPEC_HIDDEN BOOL __thiscall ITextHostImpl_TxSetTimer( ITextHost2 *iface, UINT id, UINT timeout );
105+
106+
DECLSPEC_HIDDEN void __thiscall ITextHostImpl_TxKillTimer( ITextHost2 *iface, UINT id );
107+
108+
DECLSPEC_HIDDEN void __thiscall ITextHostImpl_TxScrollWindowEx( ITextHost2 *iface, INT dx, INT dy, const RECT *scroll,
109+
const RECT *clip, HRGN update_rgn, RECT *update_rect,
110+
UINT flags );
111+
112+
DECLSPEC_HIDDEN void __thiscall ITextHostImpl_TxSetCapture( ITextHost2 *iface, BOOL capture );
113+
114+
DECLSPEC_HIDDEN void __thiscall ITextHostImpl_TxSetFocus( ITextHost2 *iface );
115+
116+
DECLSPEC_HIDDEN void __thiscall ITextHostImpl_TxSetCursor( ITextHost2 *iface, HCURSOR cursor, BOOL text );
117+
118+
DECLSPEC_HIDDEN BOOL __thiscall ITextHostImpl_TxScreenToClient( ITextHost2 *iface, POINT *pt );
119+
120+
DECLSPEC_HIDDEN BOOL __thiscall ITextHostImpl_TxClientToScreen( ITextHost2 *iface, POINT *pt );
121+
122+
DECLSPEC_HIDDEN HRESULT __thiscall ITextHostImpl_TxActivate( ITextHost2 *iface, LONG *old_state );
123+
124+
DECLSPEC_HIDDEN HRESULT __thiscall ITextHostImpl_TxDeactivate( ITextHost2 *iface, LONG new_state );
125+
126+
DECLSPEC_HIDDEN HRESULT __thiscall ITextHostImpl_TxGetClientRect( ITextHost2 *iface, RECT *rect );
127+
128+
DECLSPEC_HIDDEN HRESULT __thiscall ITextHostImpl_TxGetViewInset( ITextHost2 *iface, RECT *rect );
129+
130+
DECLSPEC_HIDDEN HRESULT __thiscall ITextHostImpl_TxGetCharFormat( ITextHost2 *iface, const CHARFORMATW **ppCF );
131+
132+
DECLSPEC_HIDDEN HRESULT __thiscall ITextHostImpl_TxGetParaFormat( ITextHost2 *iface, const PARAFORMAT **fmt );
133+
134+
DECLSPEC_HIDDEN COLORREF __thiscall ITextHostImpl_TxGetSysColor( ITextHost2 *iface, int index );
135+
136+
DECLSPEC_HIDDEN HRESULT __thiscall ITextHostImpl_TxGetBackStyle( ITextHost2 *iface, TXTBACKSTYLE *style );
137+
138+
DECLSPEC_HIDDEN HRESULT __thiscall ITextHostImpl_TxGetMaxLength( ITextHost2 *iface, DWORD *length );
139+
140+
DECLSPEC_HIDDEN HRESULT __thiscall ITextHostImpl_TxGetScrollBars( ITextHost2 *iface, DWORD *scrollbars );
141+
142+
DECLSPEC_HIDDEN HRESULT __thiscall ITextHostImpl_TxGetPasswordChar( ITextHost2 *iface, WCHAR *c );
143+
144+
DECLSPEC_HIDDEN HRESULT __thiscall ITextHostImpl_TxGetAcceleratorPos( ITextHost2 *iface, LONG *pos );
145+
146+
DECLSPEC_HIDDEN HRESULT __thiscall ITextHostImpl_TxGetExtent( ITextHost2 *iface, SIZEL *extent );
147+
148+
DECLSPEC_HIDDEN HRESULT __thiscall ITextHostImpl_OnTxCharFormatChange( ITextHost2 *iface, const CHARFORMATW *pcf );
149+
150+
DECLSPEC_HIDDEN HRESULT __thiscall ITextHostImpl_OnTxParaFormatChange( ITextHost2 *iface, const PARAFORMAT *ppf );
151+
152+
DECLSPEC_HIDDEN HRESULT __thiscall ITextHostImpl_TxGetPropertyBits( ITextHost2 *iface, DWORD mask, DWORD *bits );
153+
154+
DECLSPEC_HIDDEN HRESULT __thiscall ITextHostImpl_TxNotify( ITextHost2 *iface, DWORD iNotify, void *pv );
155+
156+
DECLSPEC_HIDDEN HIMC __thiscall ITextHostImpl_TxImmGetContext( ITextHost2 *iface );
157+
158+
DECLSPEC_HIDDEN void __thiscall ITextHostImpl_TxImmReleaseContext( ITextHost2 *iface, HIMC context );
159+
160+
DECLSPEC_HIDDEN HRESULT __thiscall ITextHostImpl_TxGetSelectionBarWidth( ITextHost2 *iface, LONG *width );
161+
162+
DECLSPEC_HIDDEN BOOL __thiscall ITextHostImpl_TxIsDoubleClickPending( ITextHost2 *iface );
163+
164+
DECLSPEC_HIDDEN HRESULT __thiscall ITextHostImpl_TxGetWindow( ITextHost2 *iface, HWND *hwnd );
165+
166+
DECLSPEC_HIDDEN HRESULT __thiscall ITextHostImpl_TxSetForegroundWindow( ITextHost2 *iface );
167+
168+
DECLSPEC_HIDDEN HPALETTE __thiscall ITextHostImpl_TxGetPalette( ITextHost2 *iface );
169+
170+
DECLSPEC_HIDDEN HRESULT __thiscall ITextHostImpl_TxGetEastAsianFlags( ITextHost2 *iface, LONG *flags );
171+
172+
DECLSPEC_HIDDEN HCURSOR __thiscall ITextHostImpl_TxSetCursor2( ITextHost2 *iface, HCURSOR cursor, BOOL text );
173+
174+
DECLSPEC_HIDDEN void __thiscall ITextHostImpl_TxFreeTextServicesNotification( ITextHost2 *iface );
175+
176+
DECLSPEC_HIDDEN HRESULT __thiscall ITextHostImpl_TxGetEditStyle( ITextHost2 *iface, DWORD item, DWORD *data );
177+
178+
DECLSPEC_HIDDEN HRESULT __thiscall ITextHostImpl_TxGetWindowStyles( ITextHost2 *iface, DWORD *style, DWORD *ex_style );
179+
180+
DECLSPEC_HIDDEN HRESULT __thiscall ITextHostImpl_TxShowDropCaret( ITextHost2 *iface, BOOL show, HDC hdc, const RECT *rect );
181+
182+
DECLSPEC_HIDDEN HRESULT __thiscall ITextHostImpl_TxDestroyCaret( ITextHost2 *iface );
183+
184+
DECLSPEC_HIDDEN HRESULT __thiscall ITextHostImpl_TxGetHorzExtent( ITextHost2 *iface, LONG *horz_extent );
185+

0 commit comments

Comments
 (0)