/usr/share/themes/QtCurve/gtk-2.0/map_kde_icons.pl is in gtk2-engines-qtcurve 1.8.18+git20160320-3d8622c-3+deb9u1.
This file is owned by root:root, with mode 0o755.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 | #!/usr/bin/env perl
# Copyright 2007 - 2010 Craig Drummond <craig.p.drummond@gmail.com>
# Copyright 2013 - 2015 Yichao Yu <yyc1992@gmail.com>
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU Lesser General Public License as
# published by the Free Software Foundation; either version 2.1 of the
# License, or (at your option) version 3, or any later version accepted
# by the membership of KDE e.V. (or its successor approved by the
# membership of KDE e.V.), which shall act as a proxy defined in
# Section 6 of version 3 of the license.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
# Lesser General Public License for more details.
#
# You should have received a copy of the GNU Lesser General Public
# License along with this library. If not,
# see <http://www.gnu.org/licenses/>.
# This perl script is called by the QtCurve Gtk2 theme, it is not intended
# to be useful by itself.
#
# Usage perl map_kde_icons.pl <icon map file> <kde prefix> <kde version> <small toolbar size> <toolbar size> <dnd size> <btn size> <menu size> <dialog size> <icon theme name> <icons map file version>
# @iconSizes = (22, 32, 22, 16, 16, 48);
# KDE Uses 32x32 for dialogs, and 16x16 for buttons
@iconSizes = ($ARGV[3], $ARGV[4], $ARGV[5], $ARGV[6], $ARGV[7], $ARGV[8]);
@gtk = ("gtk-small-toolbar", "gtk-large-toolbar", "gtk-dnd", "gtk-button",
"gtk-menu", "gtk-dialog" );
$numSizes = $#iconSizes + 1;
$useCustom = 0;
printf "#%s %s %02X%02X%02X%02X%02X%02X%02X\n", $ARGV[10], $ARGV[9], $ARGV[2], $ARGV[3], $ARGV[4], $ARGV[5], $ARGV[6], $ARGV[7], $ARGV[8];
printf "#This file is created, and used by, QtCurve. Alterations may be overwritten.\n";
print "gtk-icon-sizes=\"gtk-small-toolbar=$ARGV[3],$ARGV[3]:gtk-large-toolbar=$ARGV[4],$ARGV[4]:";
print "gtk-dnd=$ARGV[5],$ARGV[5]:gtk-button=$ARGV[6],$ARGV[6]:gtk-menu=$ARGV[7],$ARGV[7]:gtk-dialog=$ARGV[8],$ARGV[8]\"\n";
#print "gtk-dnd=$ARGV[5],$ARGV[5]:gtk-button=$ARGV[6],$ARGV[6]:gtk-menu=$ARGV[7],$ARGV[7]\"\n";
if ($ARGV[1])
{
$baseDefault=$ARGV[1];
if($ARGV[9] ne "XX")
{
$useCustom=1;
$baseCustom=join("", $baseDefault, "/");
$baseCustom=join("", $baseCustom, "$ARGV[9]");
$baseCustom=join("", $baseCustom, "/");
}
}
if($ARGV[2] == "3")
{
$baseDefault=join("", $baseDefault, "/crystalsvg/");
}
else
{
$baseDefault=join("", $baseDefault, "/oxygen/");
}
open(icons, "$ARGV[0]") || die "Could not open \"$ARGV[0]\"\n";
sub checkSize
{
$fname=join("", $_[0], $_[1], "x", $_[1], "/", $_[2]);
if (open(tst, $fname))
{
close(tst);
$fname;
}
else
{
"";
}
}
sub printSize
{
if($_[0])
{
print "\t\t{ \"$_[1]x$_[1]/$_[2]\", *, *, \"$_[3]\" },\n";
$_[4]--;
}
}
print "\nstyle \"KDE$ARGV[2]-icons\"\n{\n";
while($entry=<icons>)
{
@iconMap=split(/ /, $entry);
for($i=0; $i<$#iconMap; $i++)
{
$iconMap[$i+1]=~s/\n//;
}
if($iconMap[1] == /WHAT/)
{
$got=0;
$use=0;
if($useCustom)
{
for($i=0; $i<$#iconMap && $use == 0; $i++)
{
for($index=0; $index<$numSizes; $index++)
{
$files[$index]=checkSize($baseCustom, $iconSizes[$index], $iconMap[$i+1]);
if($files[$index])
{
$got++;
}
}
if($got)
{
$use=$i+1;
}
}
}
if($got == 0)
{
for($i=0; $i<$#iconMap && $use == 0; $i++)
{
for($index=0; $index<$numSizes; $index++)
{
$files[$index]=checkSize($baseDefault, $iconSizes[$index], $iconMap[$i+1]);
if($files[$index])
{
$got++;
}
}
if($got)
{
$use=$i+1;
}
}
}
if($got)
{
print "\tstock[\"$iconMap[0]\"]={\n";
if($got > 1)
{
for($index=0; $index<$numSizes; $index++)
{
$got=printSize($files[$index], $iconSizes[$index], $iconMap[$use], $gtk[$index], $got);
}
}
$found=0;
for($index=0; $index<$numSizes && !$found; $index++)
{
if($files[$index])
{
print "\t\t{ \"$iconSizes[$index]x$iconSizes[$index]/$iconMap[$use]\" }\n";
$found=1;
}
}
print "\t}\n";
}
#else
#{
# print "#\tstock[\"$iconMap[0]\"]=<No matching KDE icon>\n";
#}
}
}
print "}\nclass \"*\" style \"KDE$ARGV[2]-icons\"\n";
close(icons);
|