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
a1324584
Commit
a1324584
authored
Feb 22, 2006
by
Kevin Koltzau
Committed by
Alexandre Julliard
Feb 22, 2006
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
riched20: Add IDataObject implementation and use it for cut/copy.
parent
a8b20975
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
27 additions
and
54 deletions
+27
-54
Makefile.in
dlls/riched20/Makefile.in
+1
-0
clipboard.c
dlls/riched20/clipboard.c
+0
-0
editor.c
dlls/riched20/editor.c
+10
-53
editor.h
dlls/riched20/editor.h
+12
-0
editstr.h
dlls/riched20/editstr.h
+4
-1
No files found.
dlls/riched20/Makefile.in
View file @
a1324584
...
...
@@ -9,6 +9,7 @@ EXTRALIBS = $(LIBUNICODE) -luuid
C_SRCS
=
\
caret.c
\
clipboard.c
\
context.c
\
editor.c
\
list.c
\
...
...
dlls/riched20/clipboard.c
0 → 100644
View file @
a1324584
This diff is collapsed.
Click to expand it.
dlls/riched20/editor.c
View file @
a1324584
...
...
@@ -1041,29 +1041,6 @@ typedef struct tagME_GlobalDestStruct
int
nLength
;
}
ME_GlobalDestStruct
;
static
DWORD
CALLBACK
ME_AppendToHGLOBAL
(
DWORD_PTR
dwCookie
,
LPBYTE
lpBuff
,
LONG
cb
,
LONG
*
pcb
)
{
ME_GlobalDestStruct
*
pData
=
(
ME_GlobalDestStruct
*
)
dwCookie
;
int
nMaxSize
;
BYTE
*
pDest
;
nMaxSize
=
GlobalSize
(
pData
->
hData
);
if
(
pData
->
nLength
+
cb
+
1
>=
cb
)
{
/* round up to 2^17 */
int
nNewSize
=
(((
nMaxSize
+
cb
+
1
)
|
0x1FFFF
)
+
1
)
&
0xFFFE0000
;
pData
->
hData
=
GlobalReAlloc
(
pData
->
hData
,
nNewSize
,
0
);
}
pDest
=
(
BYTE
*
)
GlobalLock
(
pData
->
hData
);
memcpy
(
pDest
+
pData
->
nLength
,
lpBuff
,
cb
);
pData
->
nLength
+=
cb
;
pDest
[
pData
->
nLength
]
=
'\0'
;
GlobalUnlock
(
pData
->
hData
);
*
pcb
=
cb
;
return
0
;
}
static
DWORD
CALLBACK
ME_ReadFromHGLOBALUnicode
(
DWORD_PTR
dwCookie
,
LPBYTE
lpBuff
,
LONG
cb
,
LONG
*
pcb
)
{
ME_GlobalDestStruct
*
pData
=
(
ME_GlobalDestStruct
*
)
dwCookie
;
...
...
@@ -1790,38 +1767,18 @@ LRESULT WINAPI RichEditANSIWndProc(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lP
case
WM_CUT
:
case
WM_COPY
:
{
int
from
,
to
,
pars
;
WCHAR
*
data
;
HANDLE
hData
;
EDITSTREAM
es
;
ME_GlobalDestStruct
gds
;
if
(
!
OpenClipboard
(
hWnd
))
return
0
;
EmptyClipboard
();
ME_GetSelection
(
editor
,
&
from
,
&
to
);
pars
=
ME_CountParagraphsBetween
(
editor
,
from
,
to
);
hData
=
GlobalAlloc
(
GMEM_MOVEABLE
,
sizeof
(
WCHAR
)
*
(
to
-
from
+
pars
+
1
));
data
=
(
WCHAR
*
)
GlobalLock
(
hData
);
ME_GetTextW
(
editor
,
data
,
from
,
to
-
from
,
TRUE
);
GlobalUnlock
(
hData
);
if
(
editor
->
mode
&
TM_RICHTEXT
)
{
gds
.
hData
=
GlobalAlloc
(
GMEM_MOVEABLE
,
0
);
gds
.
nLength
=
0
;
es
.
dwCookie
=
(
DWORD
)
&
gds
;
es
.
pfnCallback
=
ME_AppendToHGLOBAL
;
ME_StreamOutRange
(
editor
,
SF_RTF
,
from
,
to
,
&
es
);
GlobalReAlloc
(
gds
.
hData
,
gds
.
nLength
+
1
,
0
);
SetClipboardData
(
RegisterClipboardFormatA
(
"Rich Text Format"
),
gds
.
hData
);
LPDATAOBJECT
dataObj
;
CHARRANGE
range
;
HRESULT
hr
;
ME_GetSelection
(
editor
,
(
int
*
)
&
range
.
cpMin
,
(
int
*
)
&
range
.
cpMax
);
hr
=
ME_GetDataObject
(
editor
,
&
range
,
&
dataObj
);
if
(
SUCCEEDED
(
hr
))
{
hr
=
OleSetClipboard
(
dataObj
);
IDataObject_Release
(
dataObj
);
}
SetClipboardData
(
CF_UNICODETEXT
,
hData
);
CloseClipboard
();
if
(
msg
==
WM_CUT
)
if
(
SUCCEEDED
(
hr
)
&&
msg
==
WM_CUT
)
{
ME_InternalDeleteText
(
editor
,
from
,
to
-
from
);
ME_InternalDeleteText
(
editor
,
range
.
cpMin
,
range
.
cpMax
-
range
.
cpMin
);
ME_CommitUndo
(
editor
);
ME_UpdateRepaint
(
editor
);
}
...
...
dlls/riched20/editor.h
View file @
a1324584
...
...
@@ -28,6 +28,15 @@
#define RUN_IS_HIDDEN(run) ((run)->style->fmt.dwMask & CFM_HIDDEN \
&& (run)->style->fmt.dwEffects & CFE_HIDDEN)
#define InitFormatEtc(fe, cf, med) \
{\
(fe).cfFormat=cf;\
(fe).dwAspect=DVASPECT_CONTENT;\
(fe).ptd=NULL;\
(fe).tymed=med;\
(fe).lindex=-1;\
};
/* style.c */
ME_Style
*
ME_MakeStyle
(
CHARFORMAT2W
*
style
);
void
ME_AddRefStyle
(
ME_Style
*
item
);
...
...
@@ -249,3 +258,6 @@ extern void DoWrap(ME_TextEditor *editor);
/* writer.c */
LRESULT
ME_StreamOutRange
(
ME_TextEditor
*
editor
,
DWORD
dwFormat
,
int
nStart
,
int
nTo
,
EDITSTREAM
*
stream
);
LRESULT
ME_StreamOut
(
ME_TextEditor
*
editor
,
DWORD
dwFormat
,
EDITSTREAM
*
stream
);
/* clipboard.c */
HRESULT
ME_GetDataObject
(
ME_TextEditor
*
editor
,
CHARRANGE
*
lpchrg
,
LPDATAOBJECT
*
lplpdataobj
);
dlls/riched20/editstr.h
View file @
a1324584
...
...
@@ -30,6 +30,10 @@
#include <stdio.h>
#include <stdlib.h>
#define COBJMACROS
#define NONAMELESSUNION
#define NONAMELESSSTRUCT
#include <windef.h>
#include <winbase.h>
#include <winnls.h>
...
...
@@ -38,7 +42,6 @@
#include <winuser.h>
#include <richedit.h>
#include <commctrl.h>
#define COBJMACROS
#include <ole2.h>
#include <richole.h>
...
...
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