user32: Specify cursor hotspots separately for each size.

This is supported in icoutils as of version 0.32.0.

Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
Alexandre Julliard 2017-10-17 16:14:28 +02:00
parent 6d2f4471ed
commit 3dd6046d7c
27 changed files with 345 additions and 114 deletions

View File

@ -50,6 +50,27 @@
inkscape:window-y="-68"
inkscape:window-maximized="0"
inkscape:current-layer="svg2" />
<rect
id="hotspot:64"
height="1"
width="1"
y="0"
x="0"
style="fill:none" />
<rect
id="hotspot:48"
height="1"
width="1"
y="0"
x="0"
style="fill:none" />
<rect
id="hotspot:32"
height="1"
width="1"
y="0"
x="0"
style="fill:none" />
<rect
id="cursor:64-32"
height="64"
@ -71,13 +92,6 @@
y="32"
x="112"
style="fill:none" />
<rect
id="hotspot"
height="1"
width="1"
y="0"
x="0"
style="fill:none" />
<g
style="display:inline;opacity:1"
id="g6054"

Before

Width:  |  Height:  |  Size: 44 KiB

After

Width:  |  Height:  |  Size: 44 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 32 KiB

After

Width:  |  Height:  |  Size: 32 KiB

View File

@ -50,6 +50,27 @@
inkscape:window-y="7"
inkscape:window-maximized="0"
inkscape:current-layer="svg2" />
<rect
id="hotspot:64"
height="1"
width="1"
y="30"
x="30"
style="fill:none" />
<rect
id="hotspot:48"
height="1"
width="1"
y="23"
x="22"
style="fill:none" />
<rect
id="hotspot:32"
height="1"
width="1"
y="15"
x="15"
style="fill:none" />
<rect
id="cursor:64-32"
height="64"
@ -71,13 +92,6 @@
y="32"
x="112"
style="fill:none" />
<rect
id="hotspot"
height="1"
width="1"
y="15"
x="15"
style="fill:none" />
<g
style="display:inline;opacity:1"
transform="matrix(0.52397812,0,0,0.52397812,-1.9634705,-486.38388)"

Before

Width:  |  Height:  |  Size: 8.8 KiB

After

Width:  |  Height:  |  Size: 9.0 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 32 KiB

After

Width:  |  Height:  |  Size: 32 KiB

View File

@ -50,6 +50,27 @@
inkscape:window-y="23"
inkscape:window-maximized="0"
inkscape:current-layer="svg2" />
<rect
id="hotspot:64"
height="1"
width="1"
y="0"
x="15"
style="fill:none" />
<rect
id="hotspot:48"
height="1"
width="1"
y="0"
x="11"
style="fill:none" />
<rect
id="hotspot:32"
height="1"
width="1"
y="0"
x="7"
style="fill:none" />
<rect
id="cursor:64-32"
height="64"
@ -71,13 +92,6 @@
y="32"
x="112"
style="fill:none" />
<rect
id="hotspot"
height="1"
width="1"
y="0"
x="7"
style="fill:none" />
<g
transform="matrix(0.49646702,0,0,0.49659531,-9.4425305,-10.050669)"
id="g2996-3"

Before

Width:  |  Height:  |  Size: 19 KiB

After

Width:  |  Height:  |  Size: 19 KiB

View File

@ -50,6 +50,27 @@
inkscape:window-y="-88"
inkscape:window-maximized="0"
inkscape:current-layer="svg2" />
<rect
id="hotspot:64"
height="1"
width="1"
y="0"
x="0"
style="fill:none" />
<rect
id="hotspot:48"
height="1"
width="1"
y="0"
x="0"
style="fill:none" />
<rect
id="hotspot:32"
height="1"
width="1"
y="0"
x="0"
style="fill:none" />
<rect
id="cursor:64-32"
height="64"
@ -71,13 +92,6 @@
y="32"
x="112"
style="fill:none" />
<rect
id="hotspot"
height="1"
width="1"
y="0"
x="0"
style="fill:none" />
<g
style="display:inline;opacity:1"
id="g6054"

Before

Width:  |  Height:  |  Size: 22 KiB

After

Width:  |  Height:  |  Size: 23 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 32 KiB

After

Width:  |  Height:  |  Size: 32 KiB

View File

@ -50,6 +50,27 @@
inkscape:window-y="28"
inkscape:window-maximized="0"
inkscape:current-layer="svg2" />
<rect
id="hotspot:64"
height="1"
width="1"
y="18"
x="7"
style="fill:none" />
<rect
id="hotspot:48"
height="1"
width="1"
y="13"
x="5"
style="fill:none" />
<rect
id="hotspot:32"
height="1"
width="1"
y="9"
x="3"
style="fill:none" />
<rect
id="cursor:64-32"
height="64"
@ -71,13 +92,6 @@
y="32"
x="112"
style="fill:none" />
<rect
id="hotspot"
height="1"
width="1"
y="9"
x="3"
style="fill:none" />
<g
style="display:inline;opacity:1"
transform="matrix(0.49522582,0,0,0.49522582,-23.104839,-469.24018)"

Before

Width:  |  Height:  |  Size: 8.5 KiB

After

Width:  |  Height:  |  Size: 8.8 KiB

View File

@ -50,6 +50,27 @@
inkscape:window-y="4"
inkscape:window-maximized="0"
inkscape:current-layer="svg2" />
<rect
id="hotspot:64"
height="1"
width="1"
y="16"
x="16"
style="fill:none" />
<rect
id="hotspot:48"
height="1"
width="1"
y="12"
x="12"
style="fill:none" />
<rect
id="hotspot:32"
height="1"
width="1"
y="8"
x="8"
style="fill:none" />
<rect
id="cursor:64-32"
height="64"
@ -71,13 +92,6 @@
y="32"
x="112"
style="fill:none" />
<rect
id="hotspot"
height="1"
width="1"
y="8"
x="8"
style="fill:none" />
<g
style="display:inline;opacity:1"
id="g7513"

Before

Width:  |  Height:  |  Size: 11 KiB

After

Width:  |  Height:  |  Size: 11 KiB

View File

@ -50,6 +50,27 @@
inkscape:window-y="48"
inkscape:window-maximized="0"
inkscape:current-layer="svg2" />
<rect
id="hotspot:64"
height="1"
width="1"
y="0"
x="0"
style="fill:none" />
<rect
id="hotspot:48"
height="1"
width="1"
y="0"
x="0"
style="fill:none" />
<rect
id="hotspot:32"
height="1"
width="1"
y="0"
x="0"
style="fill:none" />
<rect
id="cursor:64-32"
height="64"
@ -71,13 +92,6 @@
y="32"
x="112"
style="fill:none" />
<rect
id="hotspot"
height="1"
width="1"
y="0"
x="0"
style="fill:none" />
<g
style="display:inline;opacity:1"
id="g6054"

Before

Width:  |  Height:  |  Size: 8.4 KiB

After

Width:  |  Height:  |  Size: 8.6 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 32 KiB

After

Width:  |  Height:  |  Size: 32 KiB

View File

@ -50,6 +50,27 @@
inkscape:window-y="4"
inkscape:window-maximized="0"
inkscape:current-layer="svg2" />
<rect
id="hotspot:64"
height="1"
width="1"
y="43"
x="0"
style="fill:none" />
<rect
id="hotspot:48"
height="1"
width="1"
y="32"
x="0"
style="fill:none" />
<rect
id="hotspot:32"
height="1"
width="1"
y="21"
x="0"
style="fill:none" />
<rect
id="cursor:64-32"
height="64"
@ -71,13 +92,6 @@
y="32"
x="112"
style="fill:none" />
<rect
id="hotspot"
height="1"
width="1"
y="21"
x="0"
style="fill:none" />
<g
style="display:inline;opacity:1;stroke-width:12.33332825"
transform="matrix(0.14986395,0.04015593,-0.04015593,0.14986395,45.748216,-191.99561)"

Before

Width:  |  Height:  |  Size: 17 KiB

After

Width:  |  Height:  |  Size: 17 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 32 KiB

After

Width:  |  Height:  |  Size: 32 KiB

View File

@ -50,6 +50,27 @@
inkscape:window-y="-16"
inkscape:window-maximized="0"
inkscape:current-layer="svg2" />
<rect
id="hotspot:64"
height="1"
width="1"
y="19"
x="19"
style="fill:none" />
<rect
id="hotspot:48"
height="1"
width="1"
y="14"
x="14"
style="fill:none" />
<rect
id="hotspot:32"
height="1"
width="1"
y="10"
x="10"
style="fill:none" />
<rect
id="cursor:64-32"
height="64"
@ -71,13 +92,6 @@
y="32"
x="112"
style="fill:none" />
<rect
id="hotspot"
height="1"
width="1"
y="10"
x="10"
style="fill:none" />
<g
id="g9368"
transform="matrix(0.43521339,0,0,0.43527092,-6.3667091,-410.06917)"

Before

Width:  |  Height:  |  Size: 12 KiB

After

Width:  |  Height:  |  Size: 12 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 34 KiB

After

Width:  |  Height:  |  Size: 34 KiB

View File

@ -50,6 +50,27 @@
inkscape:window-y="3"
inkscape:window-maximized="0"
inkscape:current-layer="svg2" />
<rect
id="hotspot:64"
height="1"
width="1"
y="19"
x="19"
style="fill:none" />
<rect
id="hotspot:48"
height="1"
width="1"
y="14"
x="14"
style="fill:none" />
<rect
id="hotspot:32"
height="1"
width="1"
y="10"
x="10"
style="fill:none" />
<rect
id="cursor:64-32"
height="64"
@ -92,13 +113,6 @@
y="32"
x="256"
style="fill:none" />
<rect
id="hotspot"
height="1"
width="1"
y="10"
x="10"
style="fill:none" />
<g
id="g9368"
transform="matrix(0.43521339,0,0,0.43527092,-6.3667091,-410.06917)"

Before

Width:  |  Height:  |  Size: 12 KiB

After

Width:  |  Height:  |  Size: 12 KiB

View File

@ -50,6 +50,27 @@
inkscape:window-y="23"
inkscape:window-maximized="0"
inkscape:current-layer="svg2" />
<rect
id="hotspot:64"
height="1"
width="1"
y="14"
x="14"
style="fill:none" />
<rect
id="hotspot:48"
height="1"
width="1"
y="10"
x="10"
style="fill:none" />
<rect
id="hotspot:32"
height="1"
width="1"
y="7"
x="7"
style="fill:none" />
<rect
id="cursor:64-32"
height="64"
@ -71,13 +92,6 @@
y="32"
x="112"
style="fill:none" />
<rect
id="hotspot"
height="1"
width="1"
y="7"
x="7"
style="fill:none" />
<g
style="display:inline;opacity:1"
inkscape:transform-center-y="1.0996192"

Before

Width:  |  Height:  |  Size: 8.5 KiB

After

Width:  |  Height:  |  Size: 8.8 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 32 KiB

After

Width:  |  Height:  |  Size: 32 KiB

View File

@ -50,6 +50,27 @@
inkscape:window-y="23"
inkscape:window-maximized="0"
inkscape:current-layer="svg2" />
<rect
id="hotspot:64"
height="1"
width="1"
y="18"
x="12"
style="fill:none" />
<rect
id="hotspot:48"
height="1"
width="1"
y="14"
x="9"
style="fill:none" />
<rect
id="hotspot:32"
height="1"
width="1"
y="9"
x="6"
style="fill:none" />
<rect
id="cursor:64-32"
height="64"
@ -71,13 +92,6 @@
y="32"
x="112"
style="fill:none" />
<rect
id="hotspot"
height="1"
width="1"
y="9"
x="6"
style="fill:none" />
<g
style="display:inline;opacity:1"
id="g8894"

Before

Width:  |  Height:  |  Size: 8.2 KiB

After

Width:  |  Height:  |  Size: 8.4 KiB

View File

@ -50,6 +50,27 @@
inkscape:window-y="23"
inkscape:window-maximized="0"
inkscape:current-layer="svg2" />
<rect
id="hotspot:64"
height="1"
width="1"
y="14"
x="14"
style="fill:none" />
<rect
id="hotspot:48"
height="1"
width="1"
y="10"
x="10"
style="fill:none" />
<rect
id="hotspot:32"
height="1"
width="1"
y="7"
x="7"
style="fill:none" />
<rect
id="cursor:64-32"
height="64"
@ -71,13 +92,6 @@
y="32"
x="112"
style="fill:none" />
<rect
id="hotspot"
height="1"
width="1"
y="7"
x="7"
style="fill:none" />
<g
style="display:inline;opacity:1"
id="g8900"

Before

Width:  |  Height:  |  Size: 8.8 KiB

After

Width:  |  Height:  |  Size: 9.1 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 32 KiB

After

Width:  |  Height:  |  Size: 32 KiB

View File

@ -50,6 +50,27 @@
inkscape:window-y="4"
inkscape:window-maximized="0"
inkscape:current-layer="svg2" />
<rect
id="hotspot:64"
height="1"
width="1"
y="12"
x="20"
style="fill:none" />
<rect
id="hotspot:48"
height="1"
width="1"
y="8"
x="15"
style="fill:none" />
<rect
id="hotspot:32"
height="1"
width="1"
y="6"
x="10"
style="fill:none" />
<rect
id="cursor:64-32"
height="64"
@ -71,13 +92,6 @@
y="32"
x="112"
style="fill:none" />
<rect
id="hotspot"
height="1"
width="1"
y="6"
x="10"
style="fill:none" />
<g
style="display:inline;opacity:1"
transform="matrix(0.41976423,0,0,0.41976423,-5.9763671,-402.06047)"

Before

Width:  |  Height:  |  Size: 8.2 KiB

After

Width:  |  Height:  |  Size: 8.4 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 32 KiB

After

Width:  |  Height:  |  Size: 32 KiB

View File

@ -50,6 +50,27 @@
inkscape:window-y="23"
inkscape:window-maximized="0"
inkscape:current-layer="svg2" />
<rect
id="hotspot:64"
height="1"
width="1"
y="0"
x="13"
style="fill:none" />
<rect
id="hotspot:48"
height="1"
width="1"
y="0"
x="10"
style="fill:none" />
<rect
id="hotspot:32"
height="1"
width="1"
y="0"
x="6"
style="fill:none" />
<rect
id="cursor:64-32"
height="64"
@ -71,13 +92,6 @@
y="32"
x="112"
style="fill:none" />
<rect
id="hotspot"
height="1"
width="1"
y="0"
x="6"
style="fill:none" />
<g
style="display:inline;opacity:1"
transform="matrix(0.45710405,0,0,0.45710405,-15.459802,20.963507)"

Before

Width:  |  Height:  |  Size: 7.6 KiB

After

Width:  |  Height:  |  Size: 7.8 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 32 KiB

After

Width:  |  Height:  |  Size: 32 KiB

View File

@ -50,6 +50,27 @@
inkscape:window-y="28"
inkscape:window-maximized="0"
inkscape:current-layer="svg2" />
<rect
id="hotspot:64"
height="1"
width="1"
y="30"
x="30"
style="fill:none" />
<rect
id="hotspot:48"
height="1"
width="1"
y="22"
x="23"
style="fill:none" />
<rect
id="hotspot:32"
height="1"
width="1"
y="15"
x="15"
style="fill:none" />
<rect
id="cursor:64-32"
height="64"
@ -71,13 +92,6 @@
y="32"
x="112"
style="fill:none" />
<rect
id="hotspot"
height="1"
width="1"
y="15"
x="15"
style="fill:none" />
<g
transform="matrix(0.44197283,0,0,0.44197283,-8.0778187,-406.26428)"
id="layer1-9"

Before

Width:  |  Height:  |  Size: 38 KiB

After

Width:  |  Height:  |  Size: 38 KiB

View File

@ -38,6 +38,7 @@ die "Only BMP, ICO and CUR outputs are supported" unless $ext eq "bmp" or $ext e
my $renderedSVGFileName = "$svgFileName.png";
my @pngFiles;
my @hotspot;
# Get the programs from the environment variables
my $convert = $ENV{"CONVERT"} || "convert";
@ -77,9 +78,9 @@ sub svg_element_start
my $width = 0;
my $height = 0;
if ($id eq "hotspot")
if ($id =~ /hotspot:(\d*)/)
{
push @icotool_args, "--hotspot-x=$attr{x}", "--hotspot-y=$attr{y}";
$hotspot[$1] = [ $attr{x}, $attr{y} ];
return;
}
@ -148,6 +149,12 @@ sub svg_element_start
return;
}
if (defined $hotspot[$size])
{
my @coords = @{$hotspot[$size]};
push @icotool_args, "--hotspot-x=$coords[0]", "--hotspot-y=$coords[1]";
}
if ($width >= 128 && $height >= 128)
{
push @icotool_args, "--raw=$pngFileName";