Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-cw
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
wine
wine-cw
Commits
6c4dda00
Commit
6c4dda00
authored
Jan 20, 2009
by
Dylan Smith
Committed by
Alexandre Julliard
Jan 21, 2009
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
richedit: Implemented ITextHost for windowed richedit controls.
parent
7e388190
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
104 additions
and
64 deletions
+104
-64
Makefile.in
dlls/riched20/Makefile.in
+1
-0
editor.c
dlls/riched20/editor.c
+47
-24
editor.h
dlls/riched20/editor.h
+49
-0
editstr.h
dlls/riched20/editstr.h
+7
-0
txthost.c
dlls/riched20/txthost.c
+0
-0
textserv.h
include/textserv.h
+0
-40
No files found.
dlls/riched20/Makefile.in
View file @
6c4dda00
...
...
@@ -21,6 +21,7 @@ C_SRCS = \
string.c
\
style.c
\
table.c
\
txthost.c
\
txtsrv.c
\
undo.c
\
wrap.c
\
...
...
dlls/riched20/editor.c
View file @
6c4dda00
...
...
@@ -2657,17 +2657,26 @@ static BOOL ME_ShowContextMenu(ME_TextEditor *editor, int x, int y)
return
TRUE
;
}
static
ME_TextEditor
*
ME_MakeEditor
(
HWND
hWnd
,
BOOL
bEmulateVersion10
)
ME_TextEditor
*
ME_MakeEditor
(
ITextHost
*
texthost
,
BOOL
bEmulateVersion10
)
{
ME_TextEditor
*
ed
=
ALLOC_OBJ
(
ME_TextEditor
);
int
i
;
ed
->
hWnd
=
hWnd
;
DWORD
props
;
LONG
selbarwidth
;
ed
->
hWnd
=
NULL
;
ed
->
texthost
=
texthost
;
ed
->
bEmulateVersion10
=
bEmulateVersion10
;
ed
->
styleFlags
=
GetWindowLongW
(
hWnd
,
GWL_STYLE
);
if
(
ed
->
styleFlags
&
WS_VSCROLL
)
ed
->
styleFlags
|=
ES_AUTOVSCROLL
;
if
(
!
ed
->
bEmulateVersion10
&&
(
ed
->
styleFlags
&
WS_HSCROLL
))
ed
->
styleFlags
|=
ES_AUTOHSCROLL
;
ITextHost_TxGetPropertyBits
(
texthost
,
(
TXTBIT_RICHTEXT
|
TXTBIT_MULTILINE
|
TXTBIT_READONLY
|
TXTBIT_USEPASSWORD
|
TXTBIT_HIDESELECTION
|
TXTBIT_SAVESELECTION
|
TXTBIT_AUTOWORDSEL
|
TXTBIT_VERTICAL
|
TXTBIT_WORDWRAP
|
TXTBIT_DISABLEDRAG
),
&
props
);
ITextHost_TxGetScrollBars
(
texthost
,
&
ed
->
styleFlags
);
ed
->
styleFlags
&=
(
WS_VSCROLL
|
WS_HSCROLL
|
ES_AUTOVSCROLL
|
ES_AUTOHSCROLL
|
ES_DISABLENOSCROLL
);
ed
->
pBuffer
=
ME_MakeText
();
ed
->
nZoomNumerator
=
ed
->
nZoomDenominator
=
0
;
ME_MakeFirstParagraph
(
ed
);
...
...
@@ -2702,12 +2711,13 @@ static ME_TextEditor *ME_MakeEditor(HWND hWnd, BOOL bEmulateVersion10)
ed
->
nParagraphs
=
1
;
ed
->
nLastSelStart
=
ed
->
nLastSelEnd
=
0
;
ed
->
pLastSelStartPara
=
ed
->
pLastSelEndPara
=
ME_FindItemFwd
(
ed
->
pBuffer
->
pFirst
,
diParagraph
);
ed
->
bWordWrap
=
!
(
ed
->
styleFlags
&
ES_AUTOHSCROLL
)
;
ed
->
bWordWrap
=
(
props
&
TXTBIT_WORDWRAP
)
!=
0
;
ed
->
bHideSelection
=
FALSE
;
ed
->
nInvalidOfs
=
-
1
;
ed
->
pfnWordBreak
=
NULL
;
ed
->
lpOleCallback
=
NULL
;
ed
->
mode
=
TM_RICHTEXT
|
TM_MULTILEVELUNDO
|
TM_MULTICODEPAGE
;
ed
->
mode
|=
(
props
&
TXTBIT_RICHTEXT
)
?
TM_RICHTEXT
:
TM_PLAINTEXT
;
ed
->
AutoURLDetect_bEnable
=
FALSE
;
ed
->
bHaveFocus
=
FALSE
;
ed
->
bMouseCaptured
=
FALSE
;
...
...
@@ -2719,17 +2729,30 @@ static ME_TextEditor *ME_MakeEditor(HWND hWnd, BOOL bEmulateVersion10)
}
ME_CheckCharOffsets
(
ed
);
if
(
ed
->
styleFlags
&
ES_SELECTIONBAR
)
ed
->
selofs
=
SELECTIONBAR_WIDTH
;
else
ed
->
selofs
=
0
;
ed
->
bDefaultFormatRect
=
TRUE
;
ITextHost_TxGetSelectionBarWidth
(
ed
->
texthost
,
&
selbarwidth
);
/* FIXME: Convert selbarwidth from HIMETRIC to pixels */
ed
->
selofs
=
selbarwidth
?
SELECTIONBAR_WIDTH
:
0
;
ed
->
nSelectionType
=
stPosition
;
if
(
ed
->
styleFlags
&
ES_PASSWORD
)
ed
->
cPasswordMask
=
'*'
;
else
ed
->
cPasswordMask
=
0
;
ed
->
cPasswordMask
=
0
;
if
(
props
&
TXTBIT_USEPASSWORD
)
ITextHost_TxGetPasswordChar
(
texthost
,
&
ed
->
cPasswordMask
);
if
(
props
&
TXTBIT_AUTOWORDSEL
)
ed
->
styleFlags
|=
ECO_AUTOWORDSELECTION
;
if
(
props
&
TXTBIT_MULTILINE
)
ed
->
styleFlags
|=
ES_MULTILINE
;
if
(
props
&
TXTBIT_READONLY
)
ed
->
styleFlags
|=
ES_READONLY
;
if
(
!
(
props
&
TXTBIT_HIDESELECTION
))
ed
->
styleFlags
|=
ES_NOHIDESEL
;
if
(
props
&
TXTBIT_SAVESELECTION
)
ed
->
styleFlags
|=
ES_SAVESEL
;
if
(
props
&
TXTBIT_VERTICAL
)
ed
->
styleFlags
|=
ES_VERTICAL
;
if
(
props
&
TXTBIT_DISABLEDRAG
)
ed
->
styleFlags
|=
ES_NOOLEDRAGDROP
;
ed
->
notified_cr
.
cpMin
=
ed
->
notified_cr
.
cpMax
=
0
;
...
...
@@ -2774,7 +2797,7 @@ static void ME_DestroyEditor(ME_TextEditor *editor)
DeleteObject
(
editor
->
hbrBackground
);
if
(
editor
->
lpOleCallback
)
IUnknown_Release
(
editor
->
lpOleCallback
);
SetWindowLongPtrW
(
editor
->
hWnd
,
0
,
0
);
IUnknown_Release
(
editor
->
texthost
);
OleUninitialize
();
FREE_OBJ
(
editor
->
pBuffer
);
...
...
@@ -4425,10 +4448,11 @@ static LRESULT RichEditWndProc_common(HWND hWnd, UINT msg, WPARAM wParam,
if
(
msg
==
WM_NCCREATE
)
{
CREATESTRUCTW
*
pcs
=
(
CREATESTRUCTW
*
)
lParam
;
ITextHost
*
texthost
;
TRACE
(
"WM_NCCREATE: hWnd %p style 0x%08x
\n
"
,
hWnd
,
pcs
->
style
);
editor
=
ME_MakeEditor
(
hWnd
,
FALSE
);
SetWindowLongPtrW
(
hWnd
,
0
,
(
LONG_PTR
)
editor
);
return
TRUE
;
texthost
=
ME_CreateTextHost
(
hWnd
,
FALSE
);
return
texthost
!=
NULL
;
}
else
if
(
msg
!=
WM_NCDESTROY
)
{
...
...
@@ -4479,13 +4503,12 @@ LRESULT WINAPI RichEdit10ANSIWndProc(HWND hWnd, UINT msg, WPARAM wParam, LPARAM
{
if
(
msg
==
WM_NCCREATE
&&
!
GetWindowLongPtrW
(
hWnd
,
0
))
{
ME_TextEditor
*
editor
;
ITextHost
*
texthost
;
CREATESTRUCTW
*
pcs
=
(
CREATESTRUCTW
*
)
lParam
;
TRACE
(
"WM_NCCREATE: hWnd %p style 0x%08x
\n
"
,
hWnd
,
pcs
->
style
);
editor
=
ME_MakeEditor
(
hWnd
,
TRUE
);
SetWindowLongPtrW
(
hWnd
,
0
,
(
LONG_PTR
)
editor
);
return
TRUE
;
texthost
=
ME_CreateTextHost
(
hWnd
,
TRUE
);
return
texthost
!=
NULL
;
}
return
RichEditANSIWndProc
(
hWnd
,
msg
,
wParam
,
lParam
);
}
...
...
dlls/riched20/editor.h
View file @
6c4dda00
...
...
@@ -261,6 +261,7 @@ void ME_CopyReObject(REOBJECT* dst, const REOBJECT* src);
void
ME_DeleteReObject
(
REOBJECT
*
reo
);
/* editor.c */
ME_TextEditor
*
ME_MakeEditor
(
ITextHost
*
texthost
,
BOOL
bEmulateVersion10
);
void
ME_SendOldNotify
(
ME_TextEditor
*
editor
,
int
nCode
);
int
ME_GetTextW
(
ME_TextEditor
*
editor
,
WCHAR
*
buffer
,
int
nStart
,
int
nChars
,
BOOL
bCRLF
);
ME_DisplayItem
*
ME_FindItemAtOffset
(
ME_TextEditor
*
editor
,
ME_DIType
nItemType
,
int
nOffset
,
int
*
nItemOffset
);
...
...
@@ -289,6 +290,54 @@ void ME_MoveCursorFromTableRowStartParagraph(ME_TextEditor *editor);
struct
RTFTable
*
ME_MakeTableDef
(
ME_TextEditor
*
editor
);
void
ME_InitTableDef
(
ME_TextEditor
*
editor
,
struct
RTFTable
*
tableDef
);
/* txthost.c */
ITextHost
*
ME_CreateTextHost
(
HWND
hwnd
,
BOOL
bEmulateVersion10
);
#ifdef __i386__
/* Use wrappers to perform thiscall on i386 */
#define TXTHOST_VTABLE(This) (&itextHostStdcallVtbl)
#else
/* __i386__ */
#define TXTHOST_VTABLE(This) (This)->lpVtbl
#endif
/* __i386__ */
/*** ITextHost methods ***/
#define ITextHost_TxGetDC(This) TXTHOST_VTABLE(This)->TxGetDC(This)
#define ITextHost_TxReleaseDC(This,a) TXTHOST_VTABLE(This)->TxReleaseDC(This,a)
#define ITextHost_TxShowScrollBar(This,a,b) TXTHOST_VTABLE(This)->TxShowScrollBar(This,a,b)
#define ITextHost_TxEnableScrollBar(This,a,b) TXTHOST_VTABLE(This)->TxEnableScrollBar(This,a,b)
#define ITextHost_TxSetScrollRange(This,a,b,c,d) TXTHOST_VTABLE(This)->TxSetScrollRange(This,a,b,c,d)
#define ITextHost_TxSetScrollPos(This,a,b,c) TXTHOST_VTABLE(This)->TxSetScrollPos(This,a,b,c)
#define ITextHost_TxInvalidateRect(This,a,b) TXTHOST_VTABLE(This)->TxInvalidateRect(This,a,b)
#define ITextHost_TxViewChange(This,a) TXTHOST_VTABLE(This)->TxViewChange(This,a)
#define ITextHost_TxCreateCaret(This,a,b,c) TXTHOST_VTABLE(This)->TxCreateCaret(This,a,b,c)
#define ITextHost_TxShowCaret(This,a) TXTHOST_VTABLE(This)->TxShowCaret(This,a)
#define ITextHost_TxSetCaretPos(This,a,b) TXTHOST_VTABLE(This)->TxSetCaretPos(This,a,b)
#define ITextHost_TxSetTimer(This,a,b) TXTHOST_VTABLE(This)->TxSetTimer(This,a,b)
#define ITextHost_TxKillTimer(This,a) TXTHOST_VTABLE(This)->TxKillTimer(This,a)
#define ITextHost_TxScrollWindowEx(This,a,b,c,d,e,f,g) TXTHOST_VTABLE(This)->TxScrollWindowEx(This,a,b,c,d,e,f,g)
#define ITextHost_TxSetCapture(This,a) TXTHOST_VTABLE(This)->TxSetCapture(This,a)
#define ITextHost_TxSetFocus(This) TXTHOST_VTABLE(This)->TxSetFocus(This)
#define ITextHost_TxSetCursor(This,a,b) TXTHOST_VTABLE(This)->TxSetCursor(This,a,b)
#define ITextHost_TxScreenToClient(This,a) TXTHOST_VTABLE(This)->TxScreenToClient(This,a)
#define ITextHost_TxClientToScreen(This,a) TXTHOST_VTABLE(This)->TxClientToScreen(This,a)
#define ITextHost_TxActivate(This,a) TXTHOST_VTABLE(This)->TxActivate(This,a)
#define ITextHost_TxDeactivate(This,a) TXTHOST_VTABLE(This)->TxDeactivate(This,a)
#define ITextHost_TxGetClientRect(This,a) TXTHOST_VTABLE(This)->TxGetClientRect(This,a)
#define ITextHost_TxGetViewInset(This,a) TXTHOST_VTABLE(This)->TxGetViewInset(This,a)
#define ITextHost_TxGetCharFormat(This,a) TXTHOST_VTABLE(This)->TxGetCharFormat(This,a)
#define ITextHost_TxGetParaFormat(This,a) TXTHOST_VTABLE(This)->TxGetParaFormat(This,a)
#define ITextHost_TxGetSysColor(This,a) TXTHOST_VTABLE(This)->TxGetSysColor(This,a)
#define ITextHost_TxGetBackStyle(This,a) TXTHOST_VTABLE(This)->TxGetBackStyle(This,a)
#define ITextHost_TxGetMaxLength(This,a) TXTHOST_VTABLE(This)->TxGetMaxLength(This,a)
#define ITextHost_TxGetScrollBars(This,a) TXTHOST_VTABLE(This)->TxGetScrollBars(This,a)
#define ITextHost_TxGetPasswordChar(This,a) TXTHOST_VTABLE(This)->TxGetPasswordChar(This,a)
#define ITextHost_TxGetAcceleratorPos(This,a) TXTHOST_VTABLE(This)->TxGetAcceleratorPos(This,a)
#define ITextHost_TxGetExtent(This,a) TXTHOST_VTABLE(This)->TxGetExtent(This,a)
#define ITextHost_OnTxCharFormatChange(This,a) TXTHOST_VTABLE(This)->OnTxCharFormatChange(This,a)
#define ITextHost_OnTxParaFormatChange(This,a) TXTHOST_VTABLE(This)->OnTxParaFormatChange(This,a)
#define ITextHost_TxGetPropertyBits(This,a,b) TXTHOST_VTABLE(This)->TxGetPropertyBits(This,a,b)
#define ITextHost_TxNotify(This,a,b) TXTHOST_VTABLE(This)->TxNotify(This,a,b)
#define ITextHost_TxImmGetContext(This) TXTHOST_VTABLE(This)->TxImmGetContext(This)
#define ITextHost_TxImmReleaseContext(This,a) TXTHOST_VTABLE(This)->TxImmReleaseContext(This,a)
#define ITextHost_TxGetSelectionBarWidth(This,a) TXTHOST_VTABLE(This)->TxGetSelectionBarWidth(This,a)
/* undo.c */
ME_UndoItem
*
ME_AddUndoItem
(
ME_TextEditor
*
editor
,
ME_DIType
type
,
const
ME_DisplayItem
*
pdi
);
void
ME_CommitUndo
(
ME_TextEditor
*
editor
);
...
...
dlls/riched20/editstr.h
View file @
6c4dda00
...
...
@@ -44,9 +44,15 @@
#include <commctrl.h>
#include <ole2.h>
#include <richole.h>
#include "imm.h"
#include <textserv.h>
#include "wine/debug.h"
#ifdef __i386__
extern
struct
ITextHostVtbl
itextHostStdcallVtbl
;
#endif
/* __i386__ */
typedef
struct
tagME_String
{
WCHAR
*
szData
;
...
...
@@ -327,6 +333,7 @@ typedef struct tagME_FontCacheItem
typedef
struct
tagME_TextEditor
{
HWND
hWnd
;
ITextHost
*
texthost
;
BOOL
bEmulateVersion10
;
ME_TextBuffer
*
pBuffer
;
ME_Cursor
*
pCursors
;
...
...
dlls/riched20/txthost.c
0 → 100644
View file @
6c4dda00
This diff is collapsed.
Click to expand it.
include/textserv.h
View file @
6c4dda00
...
...
@@ -357,46 +357,6 @@ DECLARE_INTERFACE_(ITextHost,IUnknown)
#define ITextHost_QueryInterface(p,a,b) (p)->lpVtbl->QueryInterface(p,a,b)
#define ITextHost_AddRef(p) (p)->lpVtbl->AddRef(p)
#define ITextHost_Release(p) (p)->lpVtbl->Release(p)
/*** ITextHost methods ***/
#define ITextHost_TxGetDC(p) (p)->lpVtbl->TxGetDC(p)
#define ITextHost_TxReleaseDC(p,a) (p)->lpVtbl->TxReleaseDC(p,a)
#define ITextHost_TxShowScrollBar(p,a,b) (p)->lpVtbl->TxShowScrollBar(p,a,b)
#define ITextHost_TxEnableScrollBar(p,a,b) (p)->lpVtbl->TxEnableScrollBar(p,a,b)
#define ITextHost_TxSetScrollRange(p,a,b,c,d) (p)->lpVtbl->TxSetScrollRange(p,a,b,c,d)
#define ITextHost_TxSetScrollPos(p,a,b,c) (p)->lpVtbl->TxSetScrollPos(p,a,b,c)
#define ITextHost_TxInvalidateRect(p,a,b) (p)->lpVtbl->TxInvalidateRect(p,a,b)
#define ITextHost_TxViewChange(p,a) (p)->lpVtbl->TxViewChange(p,a)
#define ITextHost_TxCreateCaret(p,a,b,c) (p)->lpVtbl->TxCreateCaret(p,a,b,c)
#define ITextHost_TxShowCaret(p,a) (p)->lpVtbl->TxShowCaret(p,a)
#define ITextHost_TxSetCarentPos(p,a,b) (p)->lpVtbl->TxSetCarentPos(p,a,b)
#define ITextHost_TxSetTimer(p,a,b) (p)->lpVtbl->TxSetTimer(p,a,b)
#define ITextHost_TxKillTimer(p,a) (p)->lpVtbl->TxKillTimer(p,a)
#define ITextHost_TxScrollWindowEx(p,a,b,c,d,e,f,g) (p)->lpVtbl->TxScrollWindowEx(p,a,b,c,d,e,f,g)
#define ITextHost_TxSetCapture(p,a) (p)->lpVtbl->TxSetCapture(p,a)
#define ITextHost_TxSetFocus(p) (p)->lpVtbl->TxSetFocus(p)
#define ITextHost_TxSetCursor(p,a,b) (p)->lpVtbl->TxSetCursor(p,a,b)
#define ITextHost_TxScreenToClient(p,a) (p)->lpVtbl->TxScreenToClient(p,a)
#define ITextHost_TxClientToScreen(p,a) (p)->lpVtbl->TxClientToScreen(p,a)
#define ITextHost_TxActivate(p,a) (p)->lpVtbl->TxActivate(p,a)
#define ITextHost_TxDeactivate(p,a) (p)->lpVtbl->TxDeactivate(p,a)
#define ITextHost_TxGetClientRect(p,a) (p)->lpVtbl->TxGetClientRect(p,a)
#define ITextHost_TxGetViewInset(p,a) (p)->lpVtbl->TxGetViewInset(p,a)
#define ITextHost_TxGetCharFormat(p,a) (p)->lpVtbl->TxGetCharFormat(p,a)
#define ITextHost_TxGetParaFormat(p,a) (p)->lpVtbl->TxGetParaFormat(p,a)
#define ITextHost_TxGetSysColor(p,a) (p)->lpVtbl->TxGetSysColor(p,a)
#define ITextHost_TxGetBackStyle(p,a) (p)->lpVtbl->TxGetBackStyle(p,a)
#define ITextHost_TxGetMaxLength(p,a) (p)->lpVtbl->TxGetMaxLength(p,a)
#define ITextHost_TxGetScrollBars(p,a) (p)->lpVtbl->TxGetScrollBars(p,a)
#define ITextHost_TxGetPasswordChar(p,a) (p)->lpVtbl->TxGetPasswordChar(p,a)
#define ITextHost_TxGetAcceleratorPos(p,a) (p)->lpVtbl->TxGetAcceleratorPos(p,a)
#define ITextHost_TxGetExtent(p,a) (p)->lpVtbl->TxGetExtent(p,a)
#define ITextHost_OnTxCharFormatChange(p,a) (p)->lpVtbl->OnTxCharFormatChange(p,a)
#define ITextHost_OnTxParaFormatChange(p,a) (p)->lpVtbl->OnTxParaFormatChange(p,a)
#define ITextHost_TxGetPropertyBits(p,a,b) (p)->lpVtbl->TxGetPropertyBits(p,a,b)
#define ITextHost_TxNotify(p,a,b) (p)->lpVtbl->TxNotify(p,a,b)
#define ITextHost_TxImmGetContext(p) (p)->lpVtbl->TxImmGetContext(p)
#define ITextHost_TxImmReleaseContext(p,a) (p)->lpVtbl->TxImmReleaseContext(p,a)
#define ITextHost_TxGetSelectionBarWidth(p,a) (p)->lpVtbl->TxGetSelectionBarWidth(p,a)
#endif
#undef INTERFACE
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment