[gtk+/wip/matthiasc/help-overlay: 3/3] gtk-demo: Add a GtkShortcutsWindow demo



commit d1cf4946ae1b0ad60173ef4f04b8181192100309
Author: Matthias Clasen <mclasen redhat com>
Date:   Sun Oct 11 16:48:08 2015 -0400

    gtk-demo: Add a GtkShortcutsWindow demo
    
    This is directly copied from gnome-builder, so it shows its
    shortcuts.

 demos/gtk-demo/Makefile.am                        |    1 +
 demos/gtk-demo/demo.gresource.xml                 |    8 +
 demos/gtk-demo/gesture-two-finger-swipe-left.svg  |  173 ++++++++++++
 demos/gtk-demo/gesture-two-finger-swipe-right.svg |  169 ++++++++++++
 demos/gtk-demo/shortcuts.ui                       |  297 +++++++++++++++++++++
 demos/gtk-demo/shortcutswindow.c                  |   44 +++
 6 files changed, 692 insertions(+), 0 deletions(-)
---
diff --git a/demos/gtk-demo/Makefile.am b/demos/gtk-demo/Makefile.am
index fc1cae4..f3fd340 100644
--- a/demos/gtk-demo/Makefile.am
+++ b/demos/gtk-demo/Makefile.am
@@ -56,6 +56,7 @@ demos_base =                                  \
        scale.c                                 \
        search_entry.c                          \
        search_entry2.c                         \
+       shortcutswindow.c                       \
        sidebar.c                               \
        sizegroup.c                             \
        spinbutton.c                            \
diff --git a/demos/gtk-demo/demo.gresource.xml b/demos/gtk-demo/demo.gresource.xml
index a3a3455..aa59a65 100644
--- a/demos/gtk-demo/demo.gresource.xml
+++ b/demos/gtk-demo/demo.gresource.xml
@@ -91,6 +91,9 @@
   <gresource prefix="/stack">
     <file>stack.ui</file>
   </gresource>
+  <gresource prefix="/shortcuts">
+    <file>shortcuts.ui</file>
+  </gresource>
   <gresource prefix="/revealer">
     <file>revealer.ui</file>
   </gresource>
@@ -163,6 +166,7 @@
     <file>scale.c</file>
     <file>search_entry.c</file>
     <file>search_entry2.c</file>
+    <file>shortcutswindow.c</file>
     <file>sizegroup.c</file>
     <file>sidebar.c</file>
     <file>stack.c</file>
@@ -213,4 +217,8 @@
   <gresource prefix="/modelbutton">
     <file>modelbutton.ui</file>
   </gresource>
+  <gresource prefix="/icons">
+    <file>gesture-two-finger-swipe-right.svg</file>
+    <file>gesture-two-finger-swipe-left.svg</file>
+  </gresource>
 </gresources>
diff --git a/demos/gtk-demo/gesture-two-finger-swipe-left.svg 
b/demos/gtk-demo/gesture-two-finger-swipe-left.svg
new file mode 100644
index 0000000..d93af46
--- /dev/null
+++ b/demos/gtk-demo/gesture-two-finger-swipe-left.svg
@@ -0,0 +1,173 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<!-- Created with Inkscape (http://www.inkscape.org/) -->
+
+<svg
+   xmlns:dc="http://purl.org/dc/elements/1.1/";
+   xmlns:cc="http://creativecommons.org/ns#";
+   xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#";
+   xmlns:svg="http://www.w3.org/2000/svg";
+   xmlns="http://www.w3.org/2000/svg";
+   xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd";
+   xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape";
+   width="80"
+   height="54"
+   viewBox="0 0 80.000001 54"
+   id="svg6660"
+   version="1.1"
+   inkscape:version="0.91 r13725"
+   sodipodi:docname="two-finger-swipe-left.svg"
+   inkscape:export-filename="/home/aday/Scratch/two-finger-swipe-left.png"
+   inkscape:export-xdpi="90"
+   inkscape:export-ydpi="90">
+  <defs
+     id="defs6662" />
+  <sodipodi:namedview
+     id="base"
+     pagecolor="#ffffff"
+     bordercolor="#666666"
+     borderopacity="1.0"
+     inkscape:pageopacity="0.0"
+     inkscape:pageshadow="2"
+     inkscape:zoom="1"
+     inkscape:cx="-26.486277"
+     inkscape:cy="27.97415"
+     inkscape:document-units="px"
+     inkscape:current-layer="layer1"
+     showgrid="false"
+     inkscape:showpageshadow="false"
+     units="px"
+     fit-margin-top="0"
+     fit-margin-left="0"
+     fit-margin-right="0"
+     fit-margin-bottom="0"
+     inkscape:window-width="1920"
+     inkscape:window-height="1016"
+     inkscape:window-x="0"
+     inkscape:window-y="27"
+     inkscape:window-maximized="1" />
+  <metadata
+     id="metadata6665">
+    <rdf:RDF>
+      <cc:Work
+         rdf:about="">
+        <dc:format>image/svg+xml</dc:format>
+        <dc:type
+           rdf:resource="http://purl.org/dc/dcmitype/StillImage"; />
+        <dc:title></dc:title>
+      </cc:Work>
+    </rdf:RDF>
+  </metadata>
+  <g
+     inkscape:label="Layer 1"
+     inkscape:groupmode="layer"
+     id="layer1"
+     transform="translate(1077.1429,-651.07582)">
+    <g
+       style="display:inline"
+       transform="translate(-753.14285,209.07579)"
+       id="g6613">
+      <g
+         id="g6615">
+        <rect
+           
style="color:#000000;clip-rule:nonzero;display:inline;overflow:visible;visibility:visible;opacity:1;isolation:auto;mix-blend-mode:normal;color-interpolation:sRGB;color-interpolation-filters:linearRGB;solid-color:#000000;solid-opacity:1;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:#4a90d9;stroke-width:0;stroke-linecap:round;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;marker:none;color-rendering:auto;image-rendering:auto;shape-rendering:auto;text-rendering:auto;enable-background:accumulate"
+           id="rect6617"
+           width="7.99999"
+           height="24.999994"
+           x="-288"
+           y="471"
+           ry="4.1854858"
+           rx="3.999995" />
+        <rect
+           rx="3.999995"
+           ry="4.1854858"
+           y="452.00003"
+           x="-279"
+           height="43.999989"
+           width="7.99999"
+           id="rect6619"
+           
style="color:#000000;clip-rule:nonzero;display:inline;overflow:visible;visibility:visible;opacity:1;isolation:auto;mix-blend-mode:normal;color-interpolation:sRGB;color-interpolation-filters:linearRGB;solid-color:#000000;solid-opacity:1;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:#4a90d9;stroke-width:0;stroke-linecap:round;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;marker:none;color-rendering:auto;image-rendering:auto;shape-rendering:auto;text-rendering:auto;enable-background:accumulate"
 />
+        <rect
+           
style="color:#000000;clip-rule:nonzero;display:inline;overflow:visible;visibility:visible;opacity:1;isolation:auto;mix-blend-mode:normal;color-interpolation:sRGB;color-interpolation-filters:linearRGB;solid-color:#000000;solid-opacity:1;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:#4a90d9;stroke-width:0;stroke-linecap:round;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;marker:none;color-rendering:auto;image-rendering:auto;shape-rendering:auto;text-rendering:auto;enable-background:accumulate"
+           id="rect6621"
+           width="7.99999"
+           height="49.000015"
+           x="-270"
+           y="447"
+           ry="4.1854858"
+           rx="3.999995" />
+        <rect
+           rx="3.999995"
+           ry="4.1854858"
+           y="460"
+           x="-261"
+           height="36.000011"
+           width="7.99999"
+           id="rect6623"
+           
style="color:#000000;clip-rule:nonzero;display:inline;overflow:visible;visibility:visible;opacity:1;isolation:auto;mix-blend-mode:normal;color-interpolation:sRGB;color-interpolation-filters:linearRGB;solid-color:#000000;solid-opacity:1;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:#4a90d9;stroke-width:0;stroke-linecap:round;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;marker:none;color-rendering:auto;image-rendering:auto;shape-rendering:auto;text-rendering:auto;enable-background:accumulate"
 />
+        <rect
+           
style="color:#000000;clip-rule:nonzero;display:inline;overflow:visible;visibility:visible;opacity:1;isolation:auto;mix-blend-mode:normal;color-interpolation:sRGB;color-interpolation-filters:linearRGB;solid-color:#000000;solid-opacity:1;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:#4a90d9;stroke-width:0;stroke-linecap:round;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;marker:none;color-rendering:auto;image-rendering:auto;shape-rendering:auto;text-rendering:auto;enable-background:accumulate"
+           id="rect6625"
+           width="7.99999"
+           height="30.000006"
+           x="-252"
+           y="466"
+           ry="4.1854858"
+           rx="3.999995" />
+        <rect
+           y="483"
+           x="-288"
+           height="12.99999"
+           width="28.999994"
+           id="rect6627"
+           
style="color:#000000;clip-rule:nonzero;display:inline;overflow:visible;visibility:visible;opacity:1;isolation:auto;mix-blend-mode:normal;color-interpolation:sRGB;color-interpolation-filters:linearRGB;solid-color:#000000;solid-opacity:1;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:#4a90d9;stroke-width:0;stroke-linecap:round;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;marker:none;color-rendering:auto;image-rendering:auto;shape-rendering:auto;text-rendering:auto;enable-background:accumulate"
 />
+        <rect
+           rx="3.999995"
+           ry="4.1854858"
+           y="475"
+           x="-279"
+           height="21"
+           width="34.999985"
+           id="rect6629"
+           
style="color:#000000;clip-rule:nonzero;display:inline;overflow:visible;visibility:visible;opacity:1;isolation:auto;mix-blend-mode:normal;color-interpolation:sRGB;color-interpolation-filters:linearRGB;solid-color:#000000;solid-opacity:1;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:#4a90d9;stroke-width:0;stroke-linecap:round;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;marker:none;color-rendering:auto;image-rendering:auto;shape-rendering:auto;text-rendering:auto;enable-background:accumulate"
 />
+        <path
+           
style="color:#000000;display:inline;overflow:visible;visibility:visible;fill:none;stroke:#000000;stroke-width:3;stroke-linecap:round;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;marker:none;enable-background:accumulate"
+           id="path6631"
+           sodipodi:type="arc"
+           sodipodi:cx="-266"
+           sodipodi:cy="451"
+           sodipodi:rx="7.4999938"
+           sodipodi:ry="7.5000024"
+           sodipodi:start="3.4953343"
+           sodipodi:end="1.8407347"
+           d="m -273.03562,448.40192 a 7.4999938,7.5000024 0 0 1 9.43617,-4.50737 7.4999938,7.5000024 0 0 1 
4.76917,9.30661 7.4999938,7.5000024 0 0 1 -9.16976,5.02725"
+           sodipodi:open="true" />
+        <path
+           d="m -268.10552,458.34925 a 7.4999938,7.5000024 0 0 1 -9.38146,4.80209 7.4999938,7.5000024 0 0 1 
-4.92078,-9.31976 7.4999938,7.5000024 0 0 1 9.25653,-5.03869"
+           sodipodi:end="4.9929531"
+           sodipodi:start="0.31864739"
+           sodipodi:ry="7.5000024"
+           sodipodi:rx="7.4999938"
+           sodipodi:cy="455.99963"
+           sodipodi:cx="-275.22797"
+           sodipodi:type="arc"
+           id="path6633"
+           
style="color:#000000;display:inline;overflow:visible;visibility:visible;fill:none;stroke:#000000;stroke-width:3;stroke-linecap:round;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;marker:none;enable-background:accumulate"
+           sodipodi:open="true" />
+        <path
+           
style="color:#000000;display:inline;overflow:visible;visibility:visible;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:6;marker:none;enable-background:accumulate"
+           d="m -314,465 -10,-9.5 10,-9.5 z"
+           id="path6635"
+           inkscape:connector-curvature="0"
+           sodipodi:nodetypes="cccc" />
+        <rect
+           transform="scale(-1,-1)"
+           
style="color:#000000;clip-rule:nonzero;display:inline;overflow:visible;visibility:visible;opacity:1;isolation:auto;mix-blend-mode:normal;color-interpolation:sRGB;color-interpolation-filters:linearRGB;solid-color:#000000;solid-opacity:1;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:#4a90d9;stroke-width:0;stroke-linecap:round;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;marker:none;color-rendering:auto;image-rendering:auto;shape-rendering:auto;text-rendering:auto;enable-background:accumulate"
+           id="rect6637"
+           width="31.999987"
+           height="4.99999"
+           x="283"
+           y="-458" />
+      </g>
+    </g>
+  </g>
+</svg>
diff --git a/demos/gtk-demo/gesture-two-finger-swipe-right.svg 
b/demos/gtk-demo/gesture-two-finger-swipe-right.svg
new file mode 100644
index 0000000..7586568
--- /dev/null
+++ b/demos/gtk-demo/gesture-two-finger-swipe-right.svg
@@ -0,0 +1,169 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<!-- Created with Inkscape (http://www.inkscape.org/) -->
+
+<svg
+   xmlns:dc="http://purl.org/dc/elements/1.1/";
+   xmlns:cc="http://creativecommons.org/ns#";
+   xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#";
+   xmlns:svg="http://www.w3.org/2000/svg";
+   xmlns="http://www.w3.org/2000/svg";
+   xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd";
+   xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape";
+   width="80.000008"
+   height="55.000023"
+   viewBox="0 0 80.000008 55.000024"
+   id="svg6535"
+   version="1.1"
+   inkscape:version="0.91 r13725"
+   sodipodi:docname="two-finger-swipe-right.svg">
+  <defs
+     id="defs6537" />
+  <sodipodi:namedview
+     id="base"
+     pagecolor="#ffffff"
+     bordercolor="#666666"
+     borderopacity="1.0"
+     inkscape:pageopacity="0.0"
+     inkscape:pageshadow="2"
+     inkscape:zoom="2"
+     inkscape:cx="-59.169932"
+     inkscape:cy="48.63391"
+     inkscape:document-units="px"
+     inkscape:current-layer="layer1"
+     showgrid="false"
+     units="px"
+     inkscape:showpageshadow="false"
+     fit-margin-top="0"
+     fit-margin-left="0"
+     fit-margin-right="0"
+     fit-margin-bottom="0"
+     inkscape:window-width="1920"
+     inkscape:window-height="1016"
+     inkscape:window-x="0"
+     inkscape:window-y="27"
+     inkscape:window-maximized="1" />
+  <metadata
+     id="metadata6540">
+    <rdf:RDF>
+      <cc:Work
+         rdf:about="">
+        <dc:format>image/svg+xml</dc:format>
+        <dc:type
+           rdf:resource="http://purl.org/dc/dcmitype/StillImage"; />
+        <dc:title></dc:title>
+      </cc:Work>
+    </rdf:RDF>
+  </metadata>
+  <g
+     inkscape:label="Layer 1"
+     inkscape:groupmode="layer"
+     id="layer1"
+     transform="translate(180,-479.14791)">
+    <g
+       style="display:inline"
+       transform="translate(144,118.14791)"
+       id="g6509">
+      <g
+         id="g6511">
+        <rect
+           rx="3.999995"
+           ry="4.1854858"
+           y="391"
+           x="-324"
+           height="24.999994"
+           width="7.99999"
+           id="rect6513"
+           
style="color:#000000;clip-rule:nonzero;display:inline;overflow:visible;visibility:visible;opacity:1;isolation:auto;mix-blend-mode:normal;color-interpolation:sRGB;color-interpolation-filters:linearRGB;solid-color:#000000;solid-opacity:1;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:#4a90d9;stroke-width:0;stroke-linecap:round;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;marker:none;color-rendering:auto;image-rendering:auto;shape-rendering:auto;text-rendering:auto;enable-background:accumulate"
 />
+        <rect
+           
style="color:#000000;clip-rule:nonzero;display:inline;overflow:visible;visibility:visible;opacity:1;isolation:auto;mix-blend-mode:normal;color-interpolation:sRGB;color-interpolation-filters:linearRGB;solid-color:#000000;solid-opacity:1;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:#4a90d9;stroke-width:0;stroke-linecap:round;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;marker:none;color-rendering:auto;image-rendering:auto;shape-rendering:auto;text-rendering:auto;enable-background:accumulate"
+           id="rect6515"
+           width="7.99999"
+           height="43.999989"
+           x="-315"
+           y="372.00003"
+           ry="4.1854858"
+           rx="3.999995" />
+        <rect
+           rx="3.999995"
+           ry="4.1854858"
+           y="367"
+           x="-306"
+           height="49.000015"
+           width="7.99999"
+           id="rect6517"
+           
style="color:#000000;clip-rule:nonzero;display:inline;overflow:visible;visibility:visible;opacity:1;isolation:auto;mix-blend-mode:normal;color-interpolation:sRGB;color-interpolation-filters:linearRGB;solid-color:#000000;solid-opacity:1;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:#4a90d9;stroke-width:0;stroke-linecap:round;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;marker:none;color-rendering:auto;image-rendering:auto;shape-rendering:auto;text-rendering:auto;enable-background:accumulate"
 />
+        <rect
+           
style="color:#000000;clip-rule:nonzero;display:inline;overflow:visible;visibility:visible;opacity:1;isolation:auto;mix-blend-mode:normal;color-interpolation:sRGB;color-interpolation-filters:linearRGB;solid-color:#000000;solid-opacity:1;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:#4a90d9;stroke-width:0;stroke-linecap:round;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;marker:none;color-rendering:auto;image-rendering:auto;shape-rendering:auto;text-rendering:auto;enable-background:accumulate"
+           id="rect6519"
+           width="7.99999"
+           height="36.000011"
+           x="-297"
+           y="380"
+           ry="4.1854858"
+           rx="3.999995" />
+        <rect
+           rx="3.999995"
+           ry="4.1854858"
+           y="386"
+           x="-288"
+           height="30.000006"
+           width="7.99999"
+           id="rect6521"
+           
style="color:#000000;clip-rule:nonzero;display:inline;overflow:visible;visibility:visible;opacity:1;isolation:auto;mix-blend-mode:normal;color-interpolation:sRGB;color-interpolation-filters:linearRGB;solid-color:#000000;solid-opacity:1;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:#4a90d9;stroke-width:0;stroke-linecap:round;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;marker:none;color-rendering:auto;image-rendering:auto;shape-rendering:auto;text-rendering:auto;enable-background:accumulate"
 />
+        <rect
+           
style="color:#000000;clip-rule:nonzero;display:inline;overflow:visible;visibility:visible;opacity:1;isolation:auto;mix-blend-mode:normal;color-interpolation:sRGB;color-interpolation-filters:linearRGB;solid-color:#000000;solid-opacity:1;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:#4a90d9;stroke-width:0;stroke-linecap:round;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;marker:none;color-rendering:auto;image-rendering:auto;shape-rendering:auto;text-rendering:auto;enable-background:accumulate"
+           id="rect6523"
+           width="28.999994"
+           height="12.99999"
+           x="-324"
+           y="403" />
+        <rect
+           
style="color:#000000;clip-rule:nonzero;display:inline;overflow:visible;visibility:visible;opacity:1;isolation:auto;mix-blend-mode:normal;color-interpolation:sRGB;color-interpolation-filters:linearRGB;solid-color:#000000;solid-opacity:1;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:#4a90d9;stroke-width:0;stroke-linecap:round;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;marker:none;color-rendering:auto;image-rendering:auto;shape-rendering:auto;text-rendering:auto;enable-background:accumulate"
+           id="rect6525"
+           width="34.999985"
+           height="21"
+           x="-315"
+           y="395"
+           ry="4.1854858"
+           rx="3.999995" />
+        <path
+           sodipodi:nodetypes="cccc"
+           inkscape:connector-curvature="0"
+           id="path6527"
+           d="m -254,361 10,9.5 -10,9.5 z"
+           
style="color:#000000;display:inline;overflow:visible;visibility:visible;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:6;marker:none;enable-background:accumulate"
 />
+        <path
+           sodipodi:open="true"
+           d="m -309.03562,368.40192 a 7.4999938,7.5000024 0 0 1 9.43617,-4.50737 7.4999938,7.5000024 0 0 1 
4.76917,9.30661 7.4999938,7.5000024 0 0 1 -9.16976,5.02725"
+           sodipodi:end="1.8407347"
+           sodipodi:start="3.4953343"
+           sodipodi:ry="7.5000024"
+           sodipodi:rx="7.4999938"
+           sodipodi:cy="371"
+           sodipodi:cx="-302"
+           sodipodi:type="arc"
+           id="path6529"
+           
style="color:#000000;display:inline;overflow:visible;visibility:visible;fill:none;stroke:#000000;stroke-width:3;stroke-linecap:round;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;marker:none;enable-background:accumulate"
 />
+        <path
+           sodipodi:open="true"
+           
style="color:#000000;display:inline;overflow:visible;visibility:visible;fill:none;stroke:#000000;stroke-width:3;stroke-linecap:round;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;marker:none;enable-background:accumulate"
+           id="path6531"
+           sodipodi:type="arc"
+           sodipodi:cx="-311.22797"
+           sodipodi:cy="375.99963"
+           sodipodi:rx="7.4999938"
+           sodipodi:ry="7.5000024"
+           sodipodi:start="0.31864739"
+           sodipodi:end="4.9929531"
+           d="m -304.10552,378.34925 a 7.4999938,7.5000024 0 0 1 -9.38146,4.80209 7.4999938,7.5000024 0 0 1 
-4.92078,-9.31976 7.4999938,7.5000024 0 0 1 9.25653,-5.03869" />
+        <rect
+           y="368"
+           x="-295"
+           height="4.99999"
+           width="41.999992"
+           id="rect6533"
+           
style="color:#000000;clip-rule:nonzero;display:inline;overflow:visible;visibility:visible;opacity:1;isolation:auto;mix-blend-mode:normal;color-interpolation:sRGB;color-interpolation-filters:linearRGB;solid-color:#000000;solid-opacity:1;fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:#4a90d9;stroke-width:0;stroke-linecap:round;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;marker:none;color-rendering:auto;image-rendering:auto;shape-rendering:auto;text-rendering:auto;enable-background:accumulate"
 />
+      </g>
+    </g>
+  </g>
+</svg>
diff --git a/demos/gtk-demo/shortcuts.ui b/demos/gtk-demo/shortcuts.ui
new file mode 100644
index 0000000..75538a8
--- /dev/null
+++ b/demos/gtk-demo/shortcuts.ui
@@ -0,0 +1,297 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<interface>
+  <!-- interface-requires gtk+ 3.17 -->
+  <object class="GFileIcon" id="left-swipe-icon">
+    <property name="file">resource:///icons/gesture-two-finger-swipe-left.svg</property>
+  </object>
+  <object class="GFileIcon" id="right-swipe-icon">
+    <property name="file">resource:///icons/gesture-two-finger-swipe-right.svg</property>
+  </object>
+  <object class="GtkShortcutsWindow" id="window1">
+    <views>
+      <view name="editor">
+        <property name="title" translatable="yes">Editor Shortcuts</property>
+        <page>
+          <column>
+            <group>
+              <property name="title" translatable="yes">General</property>
+              <shortcut>
+                <property name="title" translatable="yes">Global Search</property>
+                <property name="accelerator">&lt;ctrl&gt;period</property>
+              </shortcut>
+              <shortcut>
+                <property name="title" translatable="yes">Preferences</property>
+                <property name="accelerator">&lt;ctrl&gt;comma</property>
+              </shortcut>
+              <shortcut>
+                <property name="title" translatable="yes">Command Bar</property>
+                <property name="accelerator">&lt;ctrl&gt;Return</property>
+              </shortcut>
+              <shortcut>
+                <property name="title" translatable="yes">Terminal</property>
+                <property name="accelerator">&lt;ctrl&gt;&lt;shift&gt;t</property>
+              </shortcut>
+              <shortcut>
+                <property name="title" translatable="yes">Keyboard Shortcuts</property>
+                <property name="accelerator">&lt;ctrl&gt;&lt;shift&gt;question</property>
+              </shortcut>
+            </group>
+            <group>
+              <property name="title" translatable="yes">Panels</property>
+              <shortcut>
+                <property name="title" translatable="yes">Toggle left panel</property>
+                <property name="accelerator">F9</property>
+              </shortcut>
+              <shortcut>
+                <property name="title" translatable="yes">Toggle right panel</property>
+                <property name="accelerator">&lt;shift&gt;F9</property>
+              </shortcut>
+              <shortcut>
+                <property name="title" translatable="yes">Toggle bottom panel</property>
+                <property name="accelerator">&lt;ctrl&gt;F9</property>
+              </shortcut>
+            </group>
+            <group>
+              <property name="title" translatable="yes">Touchpad gestures</property>
+              <gesture>
+                <property name="title" translatable="yes">Switch to the next document</property>
+                <property name="subtitle" translatable="yes">Two finger swipe right</property>
+                <property name="gicon">right-swipe-icon</property>
+              </gesture>
+              <gesture>
+                <property name="title" translatable="yes">Switch to the previous document</property>
+                <property name="subtitle" translatable="yes">Two finger swipe left</property>
+                <property name="gicon">left-swipe-icon</property>
+              </gesture>
+            </group>
+          </column>
+          <column>
+            <group>
+              <property name="title" translatable="yes">Files</property>
+              <shortcut>
+                <property name="accelerator">&lt;ctrl&gt;n</property>
+                <property name="title" translatable="yes">Create new document</property>
+              </shortcut>
+              <shortcut>
+                <property name="accelerator">&lt;ctrl&gt;o</property>
+                <property name="title" translatable="yes">Open a document</property>
+              </shortcut>
+              <shortcut>
+                <property name="accelerator">&lt;ctrl&gt;s</property>
+                <property name="title" translatable="yes">Save the document</property>
+              </shortcut>
+              <shortcut>
+                <property name="accelerator">&lt;ctrl&gt;w</property>
+                <property name="title" translatable="yes">Close the document</property>
+              </shortcut>
+              <shortcut>
+                <property name="accelerator">&lt;ctrl&gt;&lt;alt&gt;Page_Down</property>
+                <property name="title" translatable="yes">Switch to the next document</property>
+              </shortcut>
+              <shortcut>
+                <property name="accelerator">&lt;ctrl&gt;&lt;alt&gt;Page_Up</property>
+                <property name="title" translatable="yes">Switch to the previous document</property>
+              </shortcut>
+              <shortcut>
+                <property name="accelerator">&lt;ctrl&gt;k</property>
+                <property name="title" translatable="yes">Show list of open files</property>
+              </shortcut>
+              <shortcut>
+                <property name="accelerator">F4</property>
+                <property name="title" translatable="yes">Switch to source or header</property>
+              </shortcut>
+            </group>
+            <group>
+              <property name="title" translatable="yes">Find and replace</property>
+              <shortcut>
+                <property name="accelerator">&lt;ctrl&gt;f</property>
+                <property name="title" translatable="yes">Find</property>
+              </shortcut>
+              <shortcut>
+                <property name="accelerator">&lt;ctrl&gt;g</property>
+                <property name="title" translatable="yes">Find the next match</property>
+              </shortcut>
+              <shortcut>
+                <property name="accelerator">&lt;ctrl&gt;&lt;shift&gt;g</property>
+                <property name="title" translatable="yes">Find the previous match</property>
+              </shortcut>
+              <!-- not implemented
+              <shortcut>
+                <property name="accelerator">&lt;ctrl&gt;h</property>
+                <property name="title" translatable="yes">Find and replace</property>
+              </shortcut>
+              -->
+              <shortcut>
+                <property name="accelerator">&lt;ctrl&gt;&lt;shift&gt;k</property>
+                <property name="title" translatable="yes">Clear highlight</property>
+              </shortcut>
+              <!-- not implemented
+              <shortcut>
+                <property name="accelerator">&lt;ctrl&gt;l</property>
+                <property name="title" translatable="yes">Go to line</property>
+              </shortcut>
+              -->
+            </group>
+          </column>
+        </page>
+        <page>
+          <column>
+            <group>
+              <property name="title" translatable="yes">Copy and Paste</property>
+              <shortcut>
+                <property name="accelerator">&lt;ctrl&gt;c</property>
+                <property name="title" translatable="yes">Copy selected text to clipboard</property>
+              </shortcut>
+              <shortcut>
+                <property name="accelerator">&lt;ctrl&gt;x</property>
+                <property name="title" translatable="yes">Cut selected text to clipboard</property>
+              </shortcut>
+              <shortcut>
+                <property name="accelerator">&lt;ctrl&gt;v</property>
+                <property name="title" translatable="yes">Paste text from clipboard</property>
+              </shortcut>
+            </group>
+            <group>
+              <property name="title" translatable="yes">Undo and Redo</property>
+              <shortcut>
+                <property name="accelerator">&lt;ctrl&gt;z</property>
+                <property name="title" translatable="yes">Undo previous command</property>
+              </shortcut>
+              <shortcut>
+                <property name="accelerator">&lt;ctrl&gt;&lt;shift&gt;z</property>
+                <property name="title" translatable="yes">Redo previous command</property>
+              </shortcut>
+            </group>
+            <group>
+              <property name="title" translatable="yes">Editing</property>
+              <shortcut>
+                <property name="accelerator">&lt;ctrl&gt;&lt;shift&gt;a</property>
+                <property name="title" translatable="yes">Increment number at cursor</property>
+              </shortcut>
+              <shortcut>
+                <property name="accelerator">&lt;ctrl&gt;&lt;shift&gt;x</property>
+                <property name="title" translatable="yes">Decrement number at cursor</property>
+              </shortcut>
+              <shortcut>
+                <property name="accelerator">&lt;ctrl&gt;j</property>
+                <property name="title" translatable="yes">Join selected lines</property>
+              </shortcut>
+              <shortcut>
+                <property name="accelerator">&lt;ctrl&gt;space</property>
+                <property name="title" translatable="yes">Show completion window</property>
+              </shortcut>
+              <shortcut>
+                <property name="accelerator">Insert</property>
+                <property name="title" translatable="yes">Toggle overwrite</property>
+              </shortcut>
+              <shortcut>
+                <property name="accelerator">&lt;ctrl&gt;&lt;alt&gt;i</property>
+                <property name="title" translatable="yes">Reindent line</property>
+              </shortcut>
+            </group>
+          </column>
+          <column>
+            <group>
+              <property name="title" translatable="yes">Navigation</property>
+              <shortcut>
+                <property name="accelerator">&lt;alt&gt;n</property>
+                <property name="title" translatable="yes">Move to next error in file</property>
+              </shortcut>
+              <shortcut>
+                <property name="accelerator">&lt;alt&gt;p</property>
+                <property name="title" translatable="yes">Move to previous error in file</property>
+              </shortcut>
+              <shortcut>
+                <property name="accelerator">&lt;shift&gt;&lt;alt&gt;Left</property>
+                <property name="title" translatable="yes">Move to previous edit location</property>
+              </shortcut>
+              <shortcut>
+                <property name="accelerator">&lt;shift&gt;&lt;alt&gt;Right</property>
+                <property name="title" translatable="yes">Move to next edit location</property>
+              </shortcut>
+              <shortcut>
+                <property name="accelerator">&lt;alt&gt;period</property>
+                <property name="title" translatable="yes">Jump to definition of symbol</property>
+              </shortcut>
+              <shortcut>
+                <property name="accelerator">&lt;alt&gt;&lt;shift&gt;Up</property>
+                <property name="title" translatable="yes">Move viewport up within the file</property>
+              </shortcut>
+              <shortcut>
+                <property name="accelerator">&lt;alt&gt;&lt;shift&gt;Down</property>
+                <property name="title" translatable="yes">Move viewport down within the file</property>
+              </shortcut>
+              <shortcut>
+                <property name="accelerator">&lt;alt&gt;&lt;shift&gt;End</property>
+                <property name="title" translatable="yes">Move viewport to end of file</property>
+              </shortcut>
+              <shortcut>
+                <property name="accelerator">&lt;alt&gt;&lt;shift&gt;Home</property>
+                <property name="title" translatable="yes">Move viewport to beginning of file</property>
+              </shortcut>
+              <shortcut>
+                <property name="accelerator">&lt;ctrl&gt;percent</property>
+                <property name="title" translatable="yes">Move to matching bracket</property>
+              </shortcut>
+            </group>
+            <group>
+              <property name="title" translatable="yes">Selections</property>
+              <shortcut>
+                <property name="accelerator">&lt;ctrl&gt;a</property>
+                <property name="title" translatable="yes">Select all</property>
+              </shortcut>
+              <shortcut>
+                <property name="accelerator">&lt;ctrl&gt;backslash</property>
+                <property name="title" translatable="yes">Unselect all</property>
+              </shortcut>
+            </group>
+          </column>
+        </page>
+      </view>
+      <view name="terminal">
+        <property name="title" translatable="yes">Terminal Shortcuts</property>
+        <page>
+          <column>
+            <group>
+              <property name="title" translatable="yes">General</property>
+              <shortcut>
+                <property name="title" translatable="yes">Global Search</property>
+                <property name="accelerator">&lt;ctrl&gt;period</property>
+              </shortcut>
+              <shortcut>
+                <property name="title" translatable="yes">Preferences</property>
+                <property name="accelerator">&lt;ctrl&gt;comma</property>
+              </shortcut>
+              <shortcut>
+                <property name="title" translatable="yes">Command Bar</property>
+                <property name="accelerator">&lt;ctrl&gt;Return</property>
+              </shortcut>
+              <shortcut>
+                <property name="title" translatable="yes">Terminal</property>
+                <property name="accelerator">&lt;ctrl&gt;&lt;shift&gt;t</property>
+              </shortcut>
+              <shortcut>
+                <property name="title" translatable="yes">Keyboard Shortcuts</property>
+                <property name="accelerator">&lt;ctrl&gt;&lt;shift&gt;question</property>
+              </shortcut>
+            </group>
+          </column>
+          <column>
+            <group>
+              <property name="title" translatable="yes">Copy and Paste</property>
+              <shortcut>
+                <property name="accelerator">&lt;ctrl&gt;&lt;shift&gt;c</property>
+                <property name="title" translatable="yes">Copy selected text to clipboard</property>
+              </shortcut>
+              <shortcut>
+                <property name="accelerator">&lt;ctrl&gt;&lt;shift&gt;v</property>
+                <property name="title" translatable="yes">Paste text from clipboard</property>
+              </shortcut>
+            </group>
+          </column>
+        </page>
+      </view>
+    </views>
+    <property name="view-name">editor</property>
+  </object>
+</interface>
diff --git a/demos/gtk-demo/shortcutswindow.c b/demos/gtk-demo/shortcutswindow.c
new file mode 100644
index 0000000..1186782
--- /dev/null
+++ b/demos/gtk-demo/shortcutswindow.c
@@ -0,0 +1,44 @@
+/* Shortcuts Window
+ *
+ * GtkShortcutsWindow is a window that provides a help overview
+ * for shortcuts in an application.
+ */
+
+#include <gtk/gtk.h>
+
+GtkWidget *
+do_shortcutswindow (GtkWidget *do_widget)
+{
+  static GtkWidget *window = NULL;
+  static gboolean icons_added = FALSE;
+
+  if (!icons_added)
+    {
+      icons_added = TRUE;
+      gtk_icon_theme_add_resource_path (gtk_icon_theme_get_default (), "/icons");
+    }
+
+  g_type_ensure (G_TYPE_FILE_ICON);
+
+  if (!window)
+    {
+      GtkBuilder *builder;
+
+      builder = gtk_builder_new_from_resource ("/shortcuts/shortcuts.ui");
+      gtk_builder_connect_signals (builder, NULL);
+      window = GTK_WIDGET (gtk_builder_get_object (builder, "window1"));
+      gtk_window_set_screen (GTK_WINDOW (window),
+                             gtk_widget_get_screen (do_widget));
+      g_signal_connect (window, "destroy",
+                        G_CALLBACK (gtk_widget_destroyed), &window);
+
+      g_object_unref (builder);
+    }
+
+  if (!gtk_widget_get_visible (window))
+    gtk_widget_show_all (window);
+  else
+    gtk_widget_destroy (window);
+
+  return window;
+}



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]