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
5ddfc36c
Commit
5ddfc36c
authored
Apr 17, 2013
by
Huw Davies
Committed by
Alexandre Julliard
Apr 17, 2013
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
riched20: Add a visual vs logical order flag to the character to position mapping routines.
parent
b4f8cf8e
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
18 additions
and
18 deletions
+18
-18
caret.c
dlls/riched20/caret.c
+3
-3
editor.c
dlls/riched20/editor.c
+1
-1
editor.h
dlls/riched20/editor.h
+4
-4
paint.c
dlls/riched20/paint.c
+3
-3
run.c
dlls/riched20/run.c
+6
-6
wrap.c
dlls/riched20/wrap.c
+1
-1
No files found.
dlls/riched20/caret.c
View file @
5ddfc36c
...
...
@@ -237,7 +237,7 @@ ME_GetCursorCoordinates(ME_TextEditor *editor, ME_Cursor *pCursor,
assert
(
run
->
type
==
diRun
);
}
}
run_x
=
ME_PointFromCharContext
(
&
c
,
&
run
->
member
.
run
,
pCursor
->
nOffset
);
run_x
=
ME_PointFromCharContext
(
&
c
,
&
run
->
member
.
run
,
pCursor
->
nOffset
,
TRUE
);
*
height
=
pSizeRun
->
member
.
run
.
nAscent
+
pSizeRun
->
member
.
run
.
nDescent
;
*
x
=
c
.
rcView
.
left
+
run
->
member
.
run
.
pt
.
x
+
run_x
-
editor
->
horz_si
.
nPos
;
...
...
@@ -887,7 +887,7 @@ static BOOL ME_FindRunInRow(ME_TextEditor *editor, ME_DisplayItem *pRow,
if
(
x
>=
run_x
&&
x
<
run_x
+
width
)
{
cursor
->
nOffset
=
ME_CharFromPoint
(
editor
,
x
-
run_x
,
&
pNext
->
member
.
run
,
TRUE
);
cursor
->
nOffset
=
ME_CharFromPoint
(
editor
,
x
-
run_x
,
&
pNext
->
member
.
run
,
TRUE
,
TRUE
);
cursor
->
pRun
=
pNext
;
cursor
->
pPara
=
ME_GetParagraph
(
cursor
->
pRun
);
return
exact
;
...
...
@@ -1182,7 +1182,7 @@ static int ME_GetXForArrow(ME_TextEditor *editor, ME_Cursor *pCursor)
}
else
{
x
=
pRun
->
member
.
run
.
pt
.
x
;
x
+=
ME_PointFromChar
(
editor
,
&
pRun
->
member
.
run
,
pCursor
->
nOffset
);
x
+=
ME_PointFromChar
(
editor
,
&
pRun
->
member
.
run
,
pCursor
->
nOffset
,
TRUE
);
}
editor
->
nUDArrowX
=
x
;
}
...
...
dlls/riched20/editor.c
View file @
5ddfc36c
...
...
@@ -3936,7 +3936,7 @@ LRESULT ME_HandleMessage(ME_TextEditor *editor, UINT msg, WPARAM wParam,
ME_RunOfsFromCharOfs
(
editor
,
nCharOfs
,
&
pPara
,
&
pRun
,
&
nOffset
);
assert
(
pRun
->
type
==
diRun
);
pt
.
y
=
pRun
->
member
.
run
.
pt
.
y
;
pt
.
x
=
pRun
->
member
.
run
.
pt
.
x
+
ME_PointFromChar
(
editor
,
&
pRun
->
member
.
run
,
nOffset
);
pt
.
x
=
pRun
->
member
.
run
.
pt
.
x
+
ME_PointFromChar
(
editor
,
&
pRun
->
member
.
run
,
nOffset
,
TRUE
);
pt
.
y
+=
pPara
->
member
.
para
.
pt
.
y
+
editor
->
rcFormat
.
top
;
pt
.
x
+=
editor
->
rcFormat
.
left
;
...
...
dlls/riched20/editor.h
View file @
5ddfc36c
...
...
@@ -140,10 +140,10 @@ ME_DisplayItem *ME_InsertRunAtCursor(ME_TextEditor *editor, ME_Cursor *cursor,
void
ME_CheckCharOffsets
(
ME_TextEditor
*
editor
)
DECLSPEC_HIDDEN
;
void
ME_PropagateCharOffset
(
ME_DisplayItem
*
p
,
int
shift
)
DECLSPEC_HIDDEN
;
/* this one accounts for 1/2 char tolerance */
int
ME_CharFromPointContext
(
ME_Context
*
c
,
int
cx
,
ME_Run
*
run
,
BOOL
closest
)
DECLSPEC_HIDDEN
;
int
ME_CharFromPoint
(
ME_TextEditor
*
editor
,
int
cx
,
ME_Run
*
run
,
BOOL
closest
)
DECLSPEC_HIDDEN
;
int
ME_PointFromCharContext
(
ME_Context
*
c
,
ME_Run
*
pRun
,
int
nOffset
)
DECLSPEC_HIDDEN
;
int
ME_PointFromChar
(
ME_TextEditor
*
editor
,
ME_Run
*
pRun
,
int
nOffset
)
DECLSPEC_HIDDEN
;
int
ME_CharFromPointContext
(
ME_Context
*
c
,
int
cx
,
ME_Run
*
run
,
BOOL
closest
,
BOOL
visual_order
)
DECLSPEC_HIDDEN
;
int
ME_CharFromPoint
(
ME_TextEditor
*
editor
,
int
cx
,
ME_Run
*
run
,
BOOL
closest
,
BOOL
visual_order
)
DECLSPEC_HIDDEN
;
int
ME_PointFromCharContext
(
ME_Context
*
c
,
ME_Run
*
pRun
,
int
nOffset
,
BOOL
visual_order
)
DECLSPEC_HIDDEN
;
int
ME_PointFromChar
(
ME_TextEditor
*
editor
,
ME_Run
*
pRun
,
int
nOffset
,
BOOL
visual_order
)
DECLSPEC_HIDDEN
;
int
ME_CanJoinRuns
(
const
ME_Run
*
run1
,
const
ME_Run
*
run2
)
DECLSPEC_HIDDEN
;
void
ME_JoinRuns
(
ME_TextEditor
*
editor
,
ME_DisplayItem
*
p
)
DECLSPEC_HIDDEN
;
ME_DisplayItem
*
ME_SplitRunSimple
(
ME_TextEditor
*
editor
,
ME_Cursor
*
cursor
)
DECLSPEC_HIDDEN
;
...
...
dlls/riched20/paint.c
View file @
5ddfc36c
...
...
@@ -306,9 +306,9 @@ static void get_selection_rect( ME_Context *c, ME_Run *run, int from, int to, in
{
from
=
max
(
0
,
from
);
to
=
min
(
run
->
len
,
to
);
r
->
left
=
ME_PointFromCharContext
(
c
,
run
,
from
);
r
->
left
=
ME_PointFromCharContext
(
c
,
run
,
from
,
TRUE
);
r
->
top
=
0
;
r
->
right
=
ME_PointFromCharContext
(
c
,
run
,
to
);
r
->
right
=
ME_PointFromCharContext
(
c
,
run
,
to
,
TRUE
);
r
->
bottom
=
cy
;
return
;
}
...
...
@@ -1235,7 +1235,7 @@ void ME_EnsureVisible(ME_TextEditor *editor, ME_Cursor *pCursor)
if
(
editor
->
styleFlags
&
ES_AUTOHSCROLL
)
{
x
=
pRun
->
pt
.
x
+
ME_PointFromChar
(
editor
,
pRun
,
pCursor
->
nOffset
);
x
=
pRun
->
pt
.
x
+
ME_PointFromChar
(
editor
,
pRun
,
pCursor
->
nOffset
,
TRUE
);
if
(
x
>
editor
->
horz_si
.
nPos
+
editor
->
sizeWindow
.
cx
)
x
=
x
+
1
-
editor
->
sizeWindow
.
cx
;
else
if
(
x
>
editor
->
horz_si
.
nPos
)
...
...
dlls/riched20/run.c
View file @
5ddfc36c
...
...
@@ -415,7 +415,7 @@ void ME_UpdateRunFlags(ME_TextEditor *editor, ME_Run *run)
* closest = FALSE cx = 0..7 return 0, cx = 8..15 return 1
* closest = TRUE cx = 0..3 return 0, cx = 4..11 return 1.
*/
int
ME_CharFromPointContext
(
ME_Context
*
c
,
int
cx
,
ME_Run
*
run
,
BOOL
closest
)
int
ME_CharFromPointContext
(
ME_Context
*
c
,
int
cx
,
ME_Run
*
run
,
BOOL
closest
,
BOOL
visual_order
)
{
ME_String
*
mask_text
=
NULL
;
WCHAR
*
str
;
...
...
@@ -464,13 +464,13 @@ int ME_CharFromPointContext(ME_Context *c, int cx, ME_Run *run, BOOL closest)
return
fit
;
}
int
ME_CharFromPoint
(
ME_TextEditor
*
editor
,
int
cx
,
ME_Run
*
run
,
BOOL
closest
)
int
ME_CharFromPoint
(
ME_TextEditor
*
editor
,
int
cx
,
ME_Run
*
run
,
BOOL
closest
,
BOOL
visual_order
)
{
ME_Context
c
;
int
ret
;
ME_InitContext
(
&
c
,
editor
,
ITextHost_TxGetDC
(
editor
->
texthost
)
);
ret
=
ME_CharFromPointContext
(
&
c
,
cx
,
run
,
closest
);
ret
=
ME_CharFromPointContext
(
&
c
,
cx
,
run
,
closest
,
visual_order
);
ME_DestroyContext
(
&
c
);
return
ret
;
}
...
...
@@ -499,7 +499,7 @@ static void ME_GetTextExtent(ME_Context *c, LPCWSTR szText, int nChars, ME_Style
* Returns a run-relative pixel position given a run-relative character
* position (character offset)
*/
int
ME_PointFromCharContext
(
ME_Context
*
c
,
ME_Run
*
pRun
,
int
nOffset
)
int
ME_PointFromCharContext
(
ME_Context
*
c
,
ME_Run
*
pRun
,
int
nOffset
,
BOOL
visual_order
)
{
SIZE
size
;
ME_String
*
mask_text
=
NULL
;
...
...
@@ -532,13 +532,13 @@ int ME_PointFromCharContext(ME_Context *c, ME_Run *pRun, int nOffset)
*
* Calls ME_PointFromCharContext after first creating a context.
*/
int
ME_PointFromChar
(
ME_TextEditor
*
editor
,
ME_Run
*
pRun
,
int
nOffset
)
int
ME_PointFromChar
(
ME_TextEditor
*
editor
,
ME_Run
*
pRun
,
int
nOffset
,
BOOL
visual_order
)
{
ME_Context
c
;
int
ret
;
ME_InitContext
(
&
c
,
editor
,
ITextHost_TxGetDC
(
editor
->
texthost
));
ret
=
ME_PointFromCharContext
(
&
c
,
pRun
,
nOffset
);
ret
=
ME_PointFromCharContext
(
&
c
,
pRun
,
nOffset
,
visual_order
);
ME_DestroyContext
(
&
c
);
return
ret
;
...
...
dlls/riched20/wrap.c
View file @
5ddfc36c
...
...
@@ -107,7 +107,7 @@ static ME_DisplayItem *split_run_extents(ME_WrapContext *wc, ME_DisplayItem *ite
static
int
find_split_point
(
ME_Context
*
c
,
int
cx
,
ME_Run
*
run
)
{
if
(
!
run
->
len
||
cx
<=
0
)
return
0
;
return
ME_CharFromPointContext
(
c
,
cx
,
run
,
FALSE
);
return
ME_CharFromPointContext
(
c
,
cx
,
run
,
FALSE
,
FALSE
);
}
static
ME_DisplayItem
*
ME_MakeRow
(
int
height
,
int
baseline
,
int
width
)
...
...
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