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
bc7c5218
Commit
bc7c5218
authored
Sep 20, 2007
by
Mikolaj Zalewski
Committed by
Alexandre Julliard
Sep 21, 2007
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
wintab32: Store the context internally as Unicode, implement WTOpenW and WTGetW.
parent
29a63472
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
30 additions
and
16 deletions
+30
-16
context.c
dlls/wintab32/context.c
+29
-15
wintab_internal.h
dlls/wintab32/wintab_internal.h
+1
-1
No files found.
dlls/wintab32/context.c
View file @
bc7c5218
...
...
@@ -46,6 +46,14 @@ static BOOL gLoaded;
static
LPOPENCONTEXT
gOpenContexts
;
static
HCTX
gTopContext
=
(
HCTX
)
0xc00
;
static
void
LOGCONTEXTAtoW
(
const
LOGCONTEXTA
*
in
,
LOGCONTEXTW
*
out
)
{
MultiByteToWideChar
(
CP_ACP
,
0
,
in
->
lcName
,
-
1
,
out
->
lcName
,
LCNAMELEN
);
out
->
lcName
[
LCNAMELEN
-
1
]
=
0
;
/* we use the fact that the fields after lcName are the same in LOGCONTEXTA and W */
memcpy
(
&
out
->
lcOptions
,
&
in
->
lcOptions
,
sizeof
(
LOGCONTEXTA
)
-
FIELD_OFFSET
(
LOGCONTEXTA
,
lcOptions
));
}
static
void
LOGCONTEXTWtoA
(
const
LOGCONTEXTW
*
in
,
LOGCONTEXTA
*
out
)
{
WideCharToMultiByte
(
CP_ACP
,
0
,
in
->
lcName
,
LCNAMELEN
,
out
->
lcName
,
LCNAMELEN
,
NULL
,
NULL
);
...
...
@@ -114,7 +122,7 @@ static inline void DUMPPACKET(WTPACKET packet)
packet
.
pkRotation
.
roRoll
,
packet
.
pkRotation
.
roYaw
);
}
static
inline
void
DUMPCONTEXT
(
LOGCONTEXT
A
lc
)
static
inline
void
DUMPCONTEXT
(
LOGCONTEXT
W
lc
)
{
CHAR
mmsg
[
4000
];
CHAR
bits
[
100
];
...
...
@@ -122,7 +130,7 @@ static inline void DUMPCONTEXT(LOGCONTEXTA lc)
CHAR
bits2
[
100
];
sprintf
(
mmsg
,
"%s, %x, %x, %x, %x, %x, %x, %x%s, %x%s, %x%s, %x, %x, %i, %i, %i, %i ,%i, %i, %i, %i, %i,%i, %i, %i, %i, %i, %i, %i, %i, %i, %i, %i %i %i"
,
debugstr_a
(
lc
.
lcName
),
lc
.
lcOptions
,
lc
.
lcStatus
,
lc
.
lcLocks
,
lc
.
lcMsgBase
,
wine_dbgstr_w
(
lc
.
lcName
),
lc
.
lcOptions
,
lc
.
lcStatus
,
lc
.
lcLocks
,
lc
.
lcMsgBase
,
lc
.
lcDevice
,
lc
.
lcPktRate
,
(
UINT
)
lc
.
lcPktData
,
DUMPBITS
(
lc
.
lcPktData
,
bits
),
(
UINT
)
lc
.
lcPktMode
,
DUMPBITS
(
lc
.
lcPktMode
,
bits1
),
(
UINT
)
lc
.
lcMoveMask
,
DUMPBITS
(
lc
.
lcMoveMask
,
bits2
),
(
INT
)
lc
.
lcBtnDnMask
,
(
INT
)
lc
.
lcBtnUpMask
,
...
...
@@ -452,9 +460,9 @@ UINT WINAPI WTInfoW(UINT wCategory, UINT nIndex, LPVOID lpOutput)
}
/***********************************************************************
* WTOpen
A (WINTAB32.
21)
* WTOpen
W (WINTAB32.20
21)
*/
HCTX
WINAPI
WTOpen
A
(
HWND
hWnd
,
LPLOGCONTEXTA
lpLogCtx
,
BOOL
fEnable
)
HCTX
WINAPI
WTOpen
W
(
HWND
hWnd
,
LPLOGCONTEXTW
lpLogCtx
,
BOOL
fEnable
)
{
LPOPENCONTEXT
newcontext
;
...
...
@@ -462,7 +470,7 @@ HCTX WINAPI WTOpenA(HWND hWnd, LPLOGCONTEXTA lpLogCtx, BOOL fEnable)
DUMPCONTEXT
(
*
lpLogCtx
);
newcontext
=
HeapAlloc
(
GetProcessHeap
(),
0
,
sizeof
(
OPENCONTEXT
));
memcpy
(
&
(
newcontext
->
context
),
lpLogCtx
,
sizeof
(
LOGCONTEXT
A
));
memcpy
(
&
(
newcontext
->
context
),
lpLogCtx
,
sizeof
(
LOGCONTEXT
W
));
newcontext
->
hwndOwner
=
hWnd
;
newcontext
->
enabled
=
fEnable
;
newcontext
->
ActiveCursor
=
-
1
;
...
...
@@ -491,15 +499,14 @@ HCTX WINAPI WTOpenA(HWND hWnd, LPLOGCONTEXTA lpLogCtx, BOOL fEnable)
}
/***********************************************************************
* WTOpen
W (WINTAB32.10
21)
* WTOpen
A (WINTAB32.
21)
*/
HCTX
WINAPI
WTOpen
W
(
HWND
hWnd
,
LPLOGCONTEXTW
lpLogCtx
,
BOOL
fEnable
)
HCTX
WINAPI
WTOpen
A
(
HWND
hWnd
,
LPLOGCONTEXTA
lpLogCtx
,
BOOL
fEnable
)
{
FIXME
(
"(%p, %p, %u): stub
\n
"
,
hWnd
,
lpLogCtx
,
fEnable
);
SetLastError
(
ERROR_CALL_NOT_IMPLEMENTED
);
LOGCONTEXTW
logCtxW
;
return
NULL
;
LOGCONTEXTAtoW
(
lpLogCtx
,
&
logCtxW
);
return
WTOpenW
(
hWnd
,
&
logCtxW
,
fEnable
);
}
/***********************************************************************
...
...
@@ -686,7 +693,7 @@ BOOL WINAPI WTGetA(HCTX hCtx, LPLOGCONTEXTA lpLogCtx)
EnterCriticalSection
(
&
csTablet
);
context
=
TABLET_FindOpenContext
(
hCtx
);
memmove
(
lpLogCtx
,
&
context
->
context
,
sizeof
(
LOGCONTEXTA
)
);
LOGCONTEXTWtoA
(
&
context
->
context
,
lpLogCtx
);
LeaveCriticalSection
(
&
csTablet
);
return
TRUE
;
...
...
@@ -697,11 +704,18 @@ BOOL WINAPI WTGetA(HCTX hCtx, LPLOGCONTEXTA lpLogCtx)
*/
BOOL
WINAPI
WTGetW
(
HCTX
hCtx
,
LPLOGCONTEXTW
lpLogCtx
)
{
FIXME
(
"(%p, %p): stub
\n
"
,
hCtx
,
lpLogCtx
)
;
LPOPENCONTEXT
context
;
SetLastError
(
ERROR_CALL_NOT_IMPLEMENTED
);
TRACE
(
"(%p, %p)
\n
"
,
hCtx
,
lpLogCtx
);
return
FALSE
;
if
(
!
hCtx
)
return
0
;
EnterCriticalSection
(
&
csTablet
);
context
=
TABLET_FindOpenContext
(
hCtx
);
memmove
(
lpLogCtx
,
&
context
->
context
,
sizeof
(
LOGCONTEXTW
));
LeaveCriticalSection
(
&
csTablet
);
return
TRUE
;
}
/***********************************************************************
...
...
dlls/wintab32/wintab_internal.h
View file @
bc7c5218
...
...
@@ -136,7 +136,7 @@ typedef struct tagWTPACKET {
typedef
struct
tagOPENCONTEXT
{
HCTX
handle
;
LOGCONTEXT
A
context
;
LOGCONTEXT
W
context
;
HWND
hwndOwner
;
BOOL
enabled
;
INT
ActiveCursor
;
...
...
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