Fix 1302: Cut image to clipboard
[geeqie.git] / doc / create-shortcuts-xml.sh
index 2e9e7db..4ea254b 100755 (executable)
@@ -28,7 +28,7 @@
 ## For separate windows, source code files are searched for the string "hard_coded_window_keys"  
 ## which is an array containing the shortcut key and the menu label.
 ##
-## For the main window the source file ./src/layout-util.c is searched for
+## For the main window the source file ./src/layout-util.cc is searched for
 ## lines which contain shortcut definitions.
 ##
 ## This needs to be run only when the sortcut keys have been changed
@@ -81,10 +81,10 @@ awk_window='BEGIN {
        {FS=","}
        while ($0 !~ /^hard_coded_window_keys/) {getline}
 }
-$0~/\{0, 0/ {exit}
+$0~/{static_cast<GdkModifierType>\(0\), 0/ {exit}
 {
-gsub(/{0/, "", $1);
-gsub(/{GDK_CONTROL_MASK \+ GDK_SHIFT_MASK/, "Ctrl + Shift +", $1);
+gsub(/{static_cast<GdkModifierType>\(0\)/, "", $1);
+gsub(/{static_cast<GdkModifierType>\(GDK_CONTROL_MASK \+ GDK_SHIFT_MASK\)/, "Ctrl + Shift +", $1);
 gsub(/{GDK_CONTROL_MASK/, "Ctrl +", $1);
 gsub(/{GDK_SHIFT_MASK/, "Shift +", $1);
 gsub(/{GDK_MOD1_MASK/, "Alt +", $1);
@@ -97,13 +97,13 @@ gsub(/"/, "", $3);
 {print "<row> <entry> <code>", $1, "<keycap>", $2, "</keycap> </code> </entry> <entry>", $3, "</entry> </row>"}
 '
 
-# This assumes that lines beginning with /^  { "/ are the only ones in layout-util.c containing key shortcuts
+# This assumes that lines beginning with /^  { "/ are the only ones in layout-util.cc containing key shortcuts
 # shellcheck disable=SC2016
 awk_main_window='BEGIN {
        {FS=","}
 }
 $0 ~ /^  { "/ {
-       if ($4 !~ /NULL/) {
+       if ($4 !~ /nullptr/) {
                {
                gsub(/^[[:space:]]+|[[:space:]]+$/,"",$4);
                gsub(/^[[:space:]]+|[[:space:]]+$/,"",$5);
@@ -127,20 +127,20 @@ $0 ~ /^  { "/ {
 }
 '
 
-keys_xml=$(awk "$awk_window" ./src/dupe.c )
+keys_xml=$(awk "$awk_window" ./src/dupe.cc )
 printf '%b\n' "$pre_1_xml $duplicates_xml $pre_2_xml $keys_xml $post_xml" > ./doc/docbook/GuideReferenceDuplicatesShortcuts.xml
 
-keys_xml=$(awk "$awk_window" ./src/search.c )
+keys_xml=$(awk "$awk_window" ./src/search.cc )
 printf '%b\n' "$pre_1_xml $search_xml $pre_2_xml $keys_xml $post_xml" > ./doc/docbook/GuideReferenceSearchShortcuts.xml
 
-keys_xml=$(awk "$awk_window" ./src/pan-view/pan-view.c )
+keys_xml=$(awk "$awk_window" ./src/pan-view/pan-view.cc )
 printf '%b\n' "$pre_1_xml $pan_view_xml $pre_2_xml $keys_xml $post_xml" > ./doc/docbook/GuideReferencePanViewShortcuts.xml
 
-keys_xml=$(awk "$awk_window" ./src/collect-table.c)
+keys_xml=$(awk "$awk_window" ./src/collect-table.cc)
 printf '%b\n' "$pre_1_xml $collections_xml $pre_2_xml $keys_xml $post_xml" > ./doc/docbook/GuideReferenceCollectionsShortcuts.xml
 
-keys_xml=$(awk "$awk_window" ./src/img-view.c)
+keys_xml=$(awk "$awk_window" ./src/img-view.cc)
 printf '%b\n' "$pre_1_xml $image_xml $pre_2_xml $keys_xml $post_xml" > ./doc/docbook/GuideReferenceImageViewShortcuts.xml
 
-keys_xml=$(awk "$awk_main_window" ./src/layout-util.c)
+keys_xml=$(awk "$awk_main_window" ./src/layout-util.cc)
 printf '%b\n' "$pre_1_xml $main_window_xml $pre_2_xml $keys_xml $post_main_window_xml" > ./doc/docbook/GuideReferenceMainWindowShortcuts.xml