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
86a9f20a
Commit
86a9f20a
authored
Mar 09, 2011
by
Erich Hoover
Committed by
Alexandre Julliard
Mar 10, 2011
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
user32: Fix GetCursorFrameInfo when passed the proper number of steps.
parent
477702c8
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
22 additions
and
7 deletions
+22
-7
cursoricon.c
dlls/user32/cursoricon.c
+22
-7
cursoricon.c
dlls/user32/tests/cursoricon.c
+0
-0
No files found.
dlls/user32/cursoricon.c
View file @
86a9f20a
...
...
@@ -101,6 +101,7 @@ struct cursoricon_object
UINT
height
;
POINT
hotspot
;
UINT
num_frames
;
/* number of frames in the icon/cursor */
UINT
num_steps
;
/* number of sequence steps in the icon/cursor */
UINT
delay
;
/* delay between frames (in jiffies) */
struct
cursoricon_frame
frames
[
1
];
/* icon frame information */
};
...
...
@@ -112,6 +113,7 @@ static HICON alloc_icon_handle( UINT num_frames )
if
(
!
obj
)
return
0
;
obj
->
delay
=
0
;
obj
->
num_steps
=
num_frames
;
/* changed later for some animated cursors */
obj
->
num_frames
=
num_frames
;
return
alloc_user_handle
(
&
obj
->
obj
,
USER_ICON
);
}
...
...
@@ -1027,6 +1029,13 @@ static HCURSOR CURSORICON_CreateIconFromANI( const LPBYTE bits, DWORD bits_size,
info
=
get_icon_ptr
(
cursor
);
info
->
is_icon
=
FALSE
;
if
(
header
.
num_steps
>
header
.
num_frames
)
{
FIXME
(
"More steps than frames and sequence-based cursors not yet supported.
\n
"
);
info
->
num_steps
=
header
.
num_frames
;
}
else
info
->
num_steps
=
header
.
num_steps
;
/* The .ANI stores the display rate in jiffies (1/60s) */
info
->
delay
=
header
.
display_rate
;
...
...
@@ -1085,6 +1094,7 @@ static HCURSOR CURSORICON_CreateIconFromANI( const LPBYTE bits, DWORD bits_size,
if
(
info
->
frames
[
i
].
alpha
)
DeleteObject
(
info
->
frames
[
i
].
alpha
);
}
info
->
num_frames
=
1
;
info
->
num_steps
=
1
;
info
->
delay
=
0
;
}
info
->
width
=
header
.
width
;
...
...
@@ -1700,28 +1710,33 @@ HICON WINAPI LoadIconA(HINSTANCE hInstance, LPCSTR name)
/**********************************************************************
* GetCursorFrameInfo (USER32.@)
*/
HCURSOR
WINAPI
GetCursorFrameInfo
(
HCURSOR
hCursor
,
DWORD
unk1
,
DWORD
rate_index_num
,
DWORD
*
rate_jiffies
,
DWORD
*
is_static
)
HCURSOR
WINAPI
GetCursorFrameInfo
(
HCURSOR
hCursor
,
DWORD
unk1
,
DWORD
istep
,
DWORD
*
rate_jiffies
,
DWORD
*
num_steps
)
{
struct
cursoricon_object
*
ptr
;
HCURSOR
ret
=
0
;
if
(
rate_jiffies
==
NULL
||
is_static
==
NULL
)
return
0
;
if
(
rate_jiffies
==
NULL
||
num_steps
==
NULL
)
return
0
;
if
(
!
(
ptr
=
get_icon_ptr
(
hCursor
)))
return
0
;
FIXME
(
"semi-stub! %p => %d %d %p %p
\n
"
,
hCursor
,
unk1
,
rate_index_num
,
rate_jiffies
,
is_static
);
FIXME
(
"semi-stub! %p => %d %d %p %p
\n
"
,
hCursor
,
unk1
,
istep
,
rate_jiffies
,
num_steps
);
if
(
ptr
->
num_frames
==
1
||
rate_index_num
==
0
)
/* Important Note: Sequences are not currently supported, so this implementation
* will not properly handle all cases. */
if
(
istep
<
ptr
->
num_steps
||
ptr
->
num_frames
==
1
)
{
ret
=
hCursor
;
if
(
ptr
->
num_frames
==
1
)
{
*
rate_jiffies
=
0
;
*
is_static
=
1
;
*
num_steps
=
1
;
}
else
{
*
is_static
=
~
0
;
if
(
ptr
->
num_steps
==
1
)
*
num_steps
=
~
0
;
else
*
num_steps
=
ptr
->
num_steps
;
*
rate_jiffies
=
ptr
->
delay
;
}
}
...
...
@@ -1983,7 +1998,7 @@ BOOL WINAPI DrawIconEx( HDC hdc, INT x0, INT y0, HICON hIcon,
hdc
,
x0
,
y0
,
hIcon
,
cxWidth
,
cyWidth
,
istep
,
hbr
,
flags
);
if
(
!
(
ptr
=
get_icon_ptr
(
hIcon
)))
return
FALSE
;
if
(
istep
>=
ptr
->
num_
frame
s
)
if
(
istep
>=
ptr
->
num_
step
s
)
{
TRACE_
(
icon
)(
"Stepped past end of animated frames=%d
\n
"
,
istep
);
release_icon_ptr
(
hIcon
,
ptr
);
...
...
dlls/user32/tests/cursoricon.c
View file @
86a9f20a
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