3 # Convert SVG files to 1x and 2x PNGs. Dump a list of Qt resource
4 # file entries upon successful completion.
6 # Copyright 2014 Gerald Combs <gerald [AT] wireshark.org>
8 # Wireshark - Network traffic analyzer
9 # By Gerald Combs <gerald@wireshark.org>
10 # Copyright 1998 Gerald Combs
12 # SPDX-License-Identifier: GPL-2.0-or-later
14 COMMON_ARGS
="--export-area-page"
16 #SVGCLEANER=$( type -p svgcleaner )
22 out_icon
=x-capture-options-gear
25 out_icon
=x-capture-restart-fin
28 out_icon
=x-capture-stop-red
31 ONE_X_SVG
=${out_icon}.svg
32 TWO_X_SVG
=${out_icon}@
2x.svg
33 if [ ! -f "${TWO_X_SVG}" ] ; then
48 x-capture-filter-bookmark
49 x-capture-filter-bookmark.active
50 x-capture-filter-bookmark.selected
57 x-display-filter-bookmark
58 x-display-filter-bookmark.active
59 x-display-filter-bookmark.selected
62 x-filter-apply.selected
65 x-filter-clear.selected
67 x-filter-dropdown.dark
68 x-filter-dropdown.light
70 x-filter-matching-bookmark
71 x-filter-matching-bookmark.active
72 x-filter-matching-bookmark.selected
77 zoom-original.template
88 for SIZE
in 14x14
16x16
24x14
24x24
; do
93 TWO_X_WIDTH
=$
(( WIDTH
* 2 ))
94 TWO_X_HEIGHT
=$
(( HEIGHT
* 2 ))
95 ONE_X_ARGS
="--export-width=${WIDTH} --export-height=${HEIGHT}"
96 TWO_X_ARGS
="--export-width=${TWO_X_WIDTH} --export-height=${TWO_X_HEIGHT}"
98 echo "Converting $SIZE_DIR"
99 cd $SIZE_DIR ||
exit 1
101 for ICON
in $ICONS ; do
102 echo "Converting $ICON"
104 # XXX This seems to modify the SVG too much. Need to
106 #if [ -n "$SVGCLEANER" ] ; then
107 # mv "$ICON.svg" "$ICON.dirty.svg"
108 # $SVGCLEANER "$ICON.dirty.svg" "$ICON.svg"
109 # rm "$ICON.dirty.svg"
112 set_source_svgs
"$ICON"
114 if [ ! -f "${ONE_X_SVG}" ] ; then
115 >&2 echo "Skipping ${ONE_X_SVG}"
119 ONE_X_PNG
=${ICON}.png
120 TWO_X_PNG
=${ICON}@
2x.png
122 if [ "$ONE_X_SVG" -nt "$ONE_X_PNG" ] ; then
123 # shellcheck disable=SC2086
124 inkscape
$COMMON_ARGS $ONE_X_ARGS \
125 --file="$PWD/$ONE_X_SVG" --export-png="$PWD/$ONE_X_PNG" ||
exit 1
126 QRC_FILES
="${QRC_FILES} ${SIZE_DIR}/${ONE_X_PNG}"
129 if [ "$TWO_X_SVG" -nt "$TWO_X_PNG" ] ; then
130 # shellcheck disable=SC2086
131 inkscape
$COMMON_ARGS $TWO_X_ARGS \
132 --file="$PWD/$TWO_X_SVG" --export-png="$PWD/$TWO_X_PNG" ||
exit 1
133 QRC_FILES
="${QRC_FILES} ${SIZE_DIR}/${TWO_X_PNG}"
142 for QRC_FILE
in $QRC_FILES ; do
143 echo " <file>stock_icons/${QRC_FILE}</file>"
147 # Editor modelines - https://www.wireshark.org/tools/modelines.html
152 # indent-tabs-mode: nil
155 # vi: set shiftwidth=4 tabstop=8 expandtab:
156 # :indentSize=4:tabSize=8:noTabs=true: