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"
20 out_icon=x-capture-options-gear
23 out_icon=x-capture-restart-fin
26 out_icon=x-capture-stop-red
29 ONE_X_SVG=${out_icon}.svg
30 TWO_X_SVG=${out_icon}@2x.svg
31 if [ ! -f ${TWO_X_SVG} ] ; then
46 x-capture-filter-bookmark
47 x-capture-filter-bookmark.active
48 x-capture-filter-bookmark.selected
55 x-display-filter-bookmark
56 x-display-filter-bookmark.active
57 x-display-filter-bookmark.selected
60 x-filter-apply.selected
63 x-filter-clear.selected
65 x-filter-matching-bookmark
66 x-filter-matching-bookmark.active
67 x-filter-matching-bookmark.selected
78 for SIZE in 14x14 16x16 24x14 24x14 ; do
83 TWO_X_WIDTH=`expr $WIDTH \* 2`
84 TWO_X_HEIGHT=`expr $HEIGHT \* 2`
85 ONE_X_ARGS="--export-width=${WIDTH} --export-height=${HEIGHT}"
86 TWO_X_ARGS="--export-width=${TWO_X_WIDTH} --export-height=${TWO_X_HEIGHT}"
88 echo "Converting $SIZE_DIR"
89 cd $SIZE_DIR || exit 1
91 for ICON in $ICONS ; do
94 if [ ! -f ${ONE_X_SVG} ] ; then
95 >&2 echo "Skipping ${ONE_X_SVG}"
100 TWO_X_PNG=${ICON}@2x.png
102 if [ $ONE_X_SVG -nt $ONE_X_PNG ] ; then
103 inkscape $COMMON_ARGS $ONE_X_ARGS \
104 --file="$PWD/$ONE_X_SVG" --export-png="$PWD/$ONE_X_PNG" || exit 1
107 if [ $TWO_X_SVG -nt $TWO_X_PNG ] ; then
108 inkscape $COMMON_ARGS $TWO_X_ARGS \
109 --file="$PWD/$TWO_X_SVG" --export-png="$PWD/$TWO_X_PNG" || exit 1
112 QRC_FILES="${QRC_FILES} ${SIZE_DIR}/${ONE_X_PNG} ${SIZE_DIR}/${TWO_X_PNG}"
119 for QRC_FILE in $QRC_FILES ; do
120 echo " <file>toolbar/${QRC_FILE}</file>"
124 # Editor modelines - https://www.wireshark.org/tools/modelines.html
129 # indent-tabs-mode: nil
132 # vi: set shiftwidth=4 tabstop=8 expandtab:
133 # :indentSize=4:tabSize=8:noTabs=true: