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
479dc1d8
Commit
479dc1d8
authored
Mar 21, 2018
by
Nikolay Sivov
Committed by
Alexandre Julliard
Mar 21, 2018
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
shell32: Add support for SHIL_EXTRALARGE list.
Signed-off-by:
Nikolay Sivov
<
nsivov@codeweavers.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
0075b05a
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
31 additions
and
30 deletions
+31
-30
iconcache.c
dlls/shell32/iconcache.c
+30
-29
shelllink.c
dlls/shell32/tests/shelllink.c
+1
-1
No files found.
dlls/shell32/iconcache.c
View file @
479dc1d8
...
...
@@ -61,7 +61,7 @@ typedef struct
static
HDPA
sic_hdpa
;
static
INIT_ONCE
sic_init_once
=
INIT_ONCE_STATIC_INIT
;
static
HIMAGELIST
shell_imagelists
[
SHIL_
SMALL
+
1
];
static
HIMAGELIST
shell_imagelists
[
SHIL_
EXTRALARGE
+
1
];
static
CRITICAL_SECTION
SHELL32_SicCS
;
static
CRITICAL_SECTION_DEBUG
critsect_debug
=
...
...
@@ -347,7 +347,7 @@ static INT SIC_IconAppend (const WCHAR *sourcefile, INT src_index, HICON *hicons
static
BOOL
get_imagelist_icon_size
(
int
list
,
SIZE
*
size
)
{
if
(
list
<
SHIL_LARGE
||
list
>
SHIL_SMALL
)
return
FALSE
;
if
(
list
<
0
||
list
>=
ARRAY_SIZE
(
shell_imagelists
)
)
return
FALSE
;
return
ImageList_GetIconSize
(
shell_imagelists
[
list
],
&
size
->
cx
,
&
size
->
cy
);
}
...
...
@@ -360,7 +360,7 @@ static BOOL get_imagelist_icon_size(int list, SIZE *size)
*/
static
INT
SIC_LoadIcon
(
const
WCHAR
*
sourcefile
,
INT
index
,
DWORD
flags
)
{
HICON
hicons
[
SHIL_SMALL
+
1
]
=
{
0
};
HICON
hicons
[
ARRAY_SIZE
(
shell_imagelists
)
]
=
{
0
};
HICON
hshortcuts
[
ARRAY_SIZE
(
hicons
)]
=
{
0
};
unsigned
int
i
;
SIZE
size
;
...
...
@@ -431,59 +431,61 @@ static int get_shell_icon_size(void)
*/
static
BOOL
WINAPI
SIC_Initialize
(
INIT_ONCE
*
once
,
void
*
param
,
void
**
context
)
{
HICON
hicons
[
SHIL_SMALL
+
1
];
int
cx_small
,
cy_small
;
int
cx_large
,
cy_large
;
HICON
hicons
[
ARRAY_SIZE
(
shell_imagelists
)
];
SIZE
sizes
[
ARRAY_SIZE
(
shell_imagelists
)]
;
BOOL
failed
=
FALSE
;
unsigned
int
i
;
if
(
!
IsProcessDPIAware
())
{
cx_large
=
cy_large
=
get_shell_icon_size
();
cx_small
=
GetSystemMetrics
(
SM_CXSMICON
);
cy_small
=
GetSystemMetrics
(
SM_CYSMICON
);
sizes
[
SHIL_LARGE
].
cx
=
sizes
[
SHIL_LARGE
].
cy
=
get_shell_icon_size
();
sizes
[
SHIL_SMALL
].
cx
=
GetSystemMetrics
(
SM_CXSMICON
);
sizes
[
SHIL_SMALL
].
cy
=
GetSystemMetrics
(
SM_CYSMICON
);
}
else
{
cx_large
=
GetSystemMetrics
(
SM_CXICON
);
cy_large
=
GetSystemMetrics
(
SM_CYICON
);
cx_small
=
cx_large
/
2
;
cy_small
=
cy_large
/
2
;
sizes
[
SHIL_LARGE
].
cx
=
GetSystemMetrics
(
SM_CXICON
);
sizes
[
SHIL_LARGE
].
cy
=
GetSystemMetrics
(
SM_CYICON
);
sizes
[
SHIL_SMALL
].
cx
=
sizes
[
SHIL_LARGE
].
cx
/
2
;
sizes
[
SHIL_SMALL
].
cy
=
sizes
[
SHIL_LARGE
].
cy
/
2
;
}
TRACE
(
"large %dx%d small %dx%d
\n
"
,
cx_large
,
cy_large
,
cx_small
,
cx_small
);
sizes
[
SHIL_EXTRALARGE
].
cx
=
(
GetSystemMetrics
(
SM_CXICON
)
*
3
)
/
2
;
sizes
[
SHIL_EXTRALARGE
].
cy
=
(
GetSystemMetrics
(
SM_CYICON
)
*
3
)
/
2
;
sic_hdpa
=
DPA_Create
(
16
);
TRACE
(
"large %dx%d small %dx%d
\n
"
,
sizes
[
SHIL_LARGE
].
cx
,
sizes
[
SHIL_LARGE
].
cy
,
sizes
[
SHIL_SMALL
].
cx
,
sizes
[
SHIL_SMALL
].
cy
);
sic_hdpa
=
DPA_Create
(
16
);
if
(
!
sic_hdpa
)
{
return
(
FALSE
);
}
shell_imagelists
[
SHIL_SMALL
]
=
ImageList_Create
(
cx_small
,
cy_small
,
ILC_COLOR32
|
ILC_MASK
,
0
,
0x20
);
shell_imagelists
[
SHIL_LARGE
]
=
ImageList_Create
(
cx_large
,
cy_large
,
ILC_COLOR32
|
ILC_MASK
,
0
,
0x20
);
for
(
i
=
0
;
i
<
ARRAY_SIZE
(
shell_imagelists
);
i
++
)
{
shell_imagelists
[
i
]
=
ImageList_Create
(
sizes
[
i
].
cx
,
sizes
[
i
].
cy
,
ILC_COLOR32
|
ILC_MASK
,
0
,
0x20
);
ImageList_SetBkColor
(
shell_imagelists
[
i
],
CLR_NONE
);
/* Load the document icon, which is used as the default if an icon isn't found. */
hicons
[
SHIL_SMALL
]
=
LoadImageA
(
shell32_hInstance
,
MAKEINTRESOURCEA
(
IDI_SHELL_DOCUMENT
),
IMAGE_ICON
,
cx_small
,
cy_small
,
LR_SHARED
);
hicons
[
SHIL_LARGE
]
=
LoadImageA
(
shell32_hInstance
,
MAKEINTRESOURCEA
(
IDI_SHELL_DOCUMENT
),
IMAGE_ICON
,
cx_large
,
cy_large
,
LR_SHARED
);
if
(
!
(
hicons
[
i
]
=
LoadImageA
(
shell32_hInstance
,
MAKEINTRESOURCEA
(
IDI_SHELL_DOCUMENT
),
IMAGE_ICON
,
sizes
[
i
].
cx
,
sizes
[
i
].
cy
,
LR_SHARED
)))
{
failed
=
TRUE
;
}
}
if
(
!
hicons
[
SHIL_SMALL
]
||
!
hicons
[
SHIL_LARGE
]
)
if
(
failed
)
{
FIXME
(
"Failed to load IDI_SHELL_DOCUMENT icon!
\n
"
);
return
FALSE
;
}
SIC_IconAppend
(
swShell32Name
,
IDI_SHELL_DOCUMENT
-
1
,
hicons
,
0
);
SIC_IconAppend
(
swShell32Name
,
-
IDI_SHELL_DOCUMENT
,
hicons
,
0
);
SIC_IconAppend
(
swShell32Name
,
IDI_SHELL_DOCUMENT
-
1
,
hicons
,
0
);
SIC_IconAppend
(
swShell32Name
,
-
IDI_SHELL_DOCUMENT
,
hicons
,
0
);
TRACE
(
"small list=%p, large list=%p
\n
"
,
shell_imagelists
[
SHIL_SMALL
],
shell_imagelists
[
SHIL_LARGE
]);
return
TRUE
;
}
/*************************************************************************
* SIC_Destroy
*
...
...
@@ -1035,8 +1037,7 @@ HRESULT WINAPI SHGetStockIconInfo(SHSTOCKICONID id, UINT flags, SHSTOCKICONINFO
*/
HRESULT
WINAPI
SHGetImageList
(
int
iImageList
,
REFIID
riid
,
void
**
ppv
)
{
/* Wine currently only maintains large and small image lists */
if
((
iImageList
!=
SHIL_LARGE
)
&&
(
iImageList
!=
SHIL_SMALL
)
&&
(
iImageList
!=
SHIL_SYSSMALL
))
if
(
iImageList
<
0
||
iImageList
>
SHIL_SYSSMALL
)
{
FIXME
(
"Unsupported image list %i requested
\n
"
,
iImageList
);
return
E_FAIL
;
...
...
dlls/shell32/tests/shelllink.c
View file @
479dc1d8
...
...
@@ -1417,7 +1417,7 @@ static void test_SHGetImageList(void)
for
(
i
=
0
;
i
<=
SHIL_LAST
;
i
++
)
{
hr
=
SHGetImageList
(
i
,
&
IID_IImageList
,
(
void
**
)
&
list
);
todo_wine_if
(
i
==
SHIL_
EXTRALARGE
||
i
==
SHIL_
JUMBO
)
todo_wine_if
(
i
==
SHIL_JUMBO
)
ok
(
hr
==
S_OK
||
broken
(
i
==
SHIL_JUMBO
&&
hr
==
E_INVALIDARG
),
/* XP and 2003 */
"%d: got %08x
\n
"
,
i
,
hr
);
...
...
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