Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-winehq
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-winehq
Commits
c6ea6cae
Commit
c6ea6cae
authored
Mar 14, 2005
by
Phil Krylov
Committed by
Alexandre Julliard
Mar 14, 2005
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Initial implementation of EM_STREAMOUT and RTF writer.
parent
e3d8bf9d
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
63 additions
and
12 deletions
+63
-12
Makefile.in
dlls/riched20/Makefile.in
+2
-1
editor.c
dlls/riched20/editor.c
+35
-11
editor.h
dlls/riched20/editor.h
+4
-0
editstr.h
dlls/riched20/editstr.h
+22
-0
writer.c
dlls/riched20/writer.c
+0
-0
No files found.
dlls/riched20/Makefile.in
View file @
c6ea6cae
...
...
@@ -20,7 +20,8 @@ C_SRCS = \
string.c
\
style.c
\
undo.c
\
wrap.c
wrap.c
\
writer.c
@MAKE_DLL_RULES@
...
...
dlls/riched20/editor.c
View file @
c6ea6cae
...
...
@@ -461,6 +461,37 @@ static LRESULT ME_StreamIn(ME_TextEditor *editor, DWORD format, EDITSTREAM *stre
return
0
;
}
ME_DisplayItem
*
ME_FindItemAtOffset
(
ME_TextEditor
*
editor
,
ME_DIType
nItemType
,
int
nOffset
,
int
*
nItemOffset
)
{
ME_DisplayItem
*
item
=
ME_FindItemFwd
(
editor
->
pBuffer
->
pFirst
,
diParagraph
);
while
(
item
&&
item
->
member
.
para
.
next_para
->
member
.
para
.
nCharOfs
<=
nOffset
)
item
=
ME_FindItemFwd
(
item
,
diParagraph
);
if
(
!
item
)
return
item
;
nOffset
-=
item
->
member
.
para
.
nCharOfs
;
if
(
nItemType
==
diParagraph
)
{
if
(
nItemOffset
)
*
nItemOffset
=
nOffset
;
return
item
;
}
do
{
item
=
ME_FindItemFwd
(
item
,
diRun
);
}
while
(
item
&&
(
item
->
member
.
run
.
nCharOfs
+
ME_StrLen
(
item
->
member
.
run
.
strText
)
<=
nOffset
));
if
(
item
)
{
nOffset
-=
item
->
member
.
run
.
nCharOfs
;
if
(
nItemOffset
)
*
nItemOffset
=
nOffset
;
}
return
item
;
}
ME_TextEditor
*
ME_MakeEditor
(
HWND
hWnd
)
{
ME_TextEditor
*
ed
=
ALLOC_OBJ
(
ME_TextEditor
);
HDC
hDC
;
...
...
@@ -586,7 +617,6 @@ LRESULT WINAPI RichEditANSIWndProc(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lP
UNSUPPORTED_MSG
(
EM_SETUNDOLIMIT
)
UNSUPPORTED_MSG
(
EM_SETWORDBREAKPROC
)
UNSUPPORTED_MSG
(
EM_SETWORDBREAKPROCEX
)
UNSUPPORTED_MSG
(
EM_STREAMOUT
)
UNSUPPORTED_MSG
(
WM_SETFONT
)
UNSUPPORTED_MSG
(
WM_PASTE
)
UNSUPPORTED_MSG
(
WM_STYLECHANGING
)
...
...
@@ -597,6 +627,8 @@ LRESULT WINAPI RichEditANSIWndProc(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lP
case
EM_STREAMIN
:
return
ME_StreamIn
(
editor
,
wParam
,
(
EDITSTREAM
*
)
lParam
);
case
EM_STREAMOUT
:
return
ME_StreamOut
(
editor
,
wParam
,
(
EDITSTREAM
*
)
lParam
);
case
WM_GETDLGCODE
:
{
UINT
code
=
DLGC_WANTCHARS
|
DLGC_WANTARROWS
;
...
...
@@ -999,26 +1031,18 @@ int ME_CountParagraphsBetween(ME_TextEditor *editor, int from, int to)
return
i
;
}
int
ME_GetTextW
(
ME_TextEditor
*
editor
,
WCHAR
*
buffer
,
int
nStart
,
int
nChars
,
int
bCRLF
)
{
ME_DisplayItem
*
item
=
ME_FindItem
Fwd
(
editor
->
pBuffer
->
pFirst
,
diParagraph
);
ME_DisplayItem
*
item
=
ME_FindItem
AtOffset
(
editor
,
diRun
,
nStart
,
&
nStart
);
int
nWritten
=
0
;
while
(
item
&&
item
->
member
.
para
.
next_para
->
member
.
para
.
nCharOfs
<=
nStart
)
item
=
ME_FindItemFwd
(
item
,
diParagraph
);
if
(
!
item
)
{
*
buffer
=
L'\0'
;
return
0
;
}
nStart
-=
item
->
member
.
para
.
nCharOfs
;
do
{
item
=
ME_FindItemFwd
(
item
,
diRun
);
}
while
(
item
&&
(
item
->
member
.
run
.
nCharOfs
+
ME_StrLen
(
item
->
member
.
run
.
strText
)
<=
nStart
));
assert
(
item
);
nStart
-=
item
->
member
.
run
.
nCharOfs
;
if
(
nStart
)
{
int
nLen
=
ME_StrLen
(
item
->
member
.
run
.
strText
)
-
nStart
;
...
...
dlls/riched20/editor.h
View file @
c6ea6cae
...
...
@@ -206,7 +206,11 @@ void ME_Undo(ME_TextEditor *editor);
void
ME_Redo
(
ME_TextEditor
*
editor
);
void
ME_EmptyUndoStack
(
ME_TextEditor
*
editor
);
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
);
extern
int
me_debug
;
extern
HANDLE
me_heap
;
extern
void
DoWrap
(
ME_TextEditor
*
editor
);
/* writer.c */
LRESULT
ME_StreamOut
(
ME_TextEditor
*
editor
,
DWORD
dwFormat
,
EDITSTREAM
*
stream
);
dlls/riched20/editstr.h
View file @
c6ea6cae
...
...
@@ -192,6 +192,27 @@ typedef enum {
umAddBackToUndo
}
ME_UndoMode
;
typedef
struct
tagME_FontTableItem
{
BYTE
bCharSet
;
WCHAR
*
szFaceName
;
}
ME_FontTableItem
;
#define STREAMOUT_BUFFER_SIZE 4096
#define STREAMOUT_FONTTBL_SIZE 8192
#define STREAMOUT_COLORTBL_SIZE 1024
typedef
struct
tagME_OutStream
{
EDITSTREAM
*
stream
;
char
buffer
[
STREAMOUT_BUFFER_SIZE
];
UINT
pos
,
written
;
UINT
nCodePage
;
UINT
nFontTblLen
;
ME_FontTableItem
fonttbl
[
STREAMOUT_FONTTBL_SIZE
];
UINT
nColorTblLen
;
COLORREF
colortbl
[
STREAMOUT_COLORTBL_SIZE
];
UINT
nDefaultFont
;
}
ME_OutStream
;
typedef
struct
tagME_FontCacheItem
{
LOGFONTW
lfSpecs
;
...
...
@@ -224,6 +245,7 @@ typedef struct tagME_TextEditor
int
nParagraphs
;
int
nLastSelStart
,
nLastSelEnd
;
ME_FontCacheItem
pFontCache
[
HFONT_CACHE_SIZE
];
ME_OutStream
*
pStream
;
}
ME_TextEditor
;
typedef
struct
tagME_Context
...
...
dlls/riched20/writer.c
0 → 100644
View file @
c6ea6cae
This diff is collapsed.
Click to expand it.
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