Move Transform Tool into Normal Tool
authorNikita Kitaev <nikitakit@gmail.com>
Sat, 5 Dec 2009 04:28:58 +0000 (20:28 -0800)
committerNikita Kitaev <nikitakit@gmail.com>
Sat, 5 Dec 2009 04:28:58 +0000 (20:28 -0800)
Since the default tool cannot have tool options, a null tool is
initialized when a new document is first opened

15 files changed:
synfig-studio/images/Makefile.am
synfig-studio/images/null_icon.sif [new file with mode: 0644]
synfig-studio/images/transform_icon.sif [deleted file]
synfig-studio/src/gtkmm/Makefile.am
synfig-studio/src/gtkmm/app.cpp
synfig-studio/src/gtkmm/canvasview.cpp
synfig-studio/src/gtkmm/dialog_tooloptions.cpp
synfig-studio/src/gtkmm/iconcontroller.cpp
synfig-studio/src/gtkmm/state_normal.cpp
synfig-studio/src/gtkmm/state_normal.h
synfig-studio/src/gtkmm/state_null.cpp [new file with mode: 0644]
synfig-studio/src/gtkmm/state_null.h [new file with mode: 0644]
synfig-studio/src/gtkmm/state_transform.cpp [deleted file]
synfig-studio/src/gtkmm/state_transform.h [deleted file]
synfig-studio/src/gtkmm/toolbox.cpp

index 1c99b78..412cfe1 100644 (file)
@@ -41,6 +41,7 @@ EXTRA_DIST = \
        mirror_icon.sif \
        navigator_icon.sif \
        normal_icon.sif \
+       null_icon.sif \
        pastecanvas_icon.sif \
        polygon_icon.sif \
        real_icon.sif \
@@ -109,7 +110,6 @@ IMAGES = \
        keyframe_icon.$(EXT) \
        reset_colors_icon.$(EXT) \
        swap_colors_icon.$(EXT) \
-       transform_icon.$(EXT) \
        smooth_move_icon.$(EXT) \
        width_icon.$(EXT) \
        rectangle_icon.$(EXT) \
@@ -118,6 +118,7 @@ IMAGES = \
        sketch_icon.$(EXT) \
        fill_icon.$(EXT) \
        normal_icon.$(EXT) \
+       null_icon.$(EXT) \
        select_all_child_layers_icon.$(EXT) \
        sif_icon.$(EXT) \
        synfig_icon.$(EXT) \
diff --git a/synfig-studio/images/null_icon.sif b/synfig-studio/images/null_icon.sif
new file mode 100644 (file)
index 0000000..079b1d2
--- /dev/null
@@ -0,0 +1,65 @@
+<?xml version="1.0"?>
+<canvas version="0.1" width="128" height="128" xres="2952.755900" yres="2952.755900" view-box="-2.000000 2.000000 2.000000 -2.000000" antialias="1" fps="30.000" begin-time="0f" end-time="0f" bgcolor="0.500000 0.500000 0.500000 1.000000">
+  <name>Untitled0</name>
+  <layer type="PasteCanvas" active="true" version="0.1">
+    <param name="z_depth">
+      <real value="0.0000000000"/>
+    </param>
+    <param name="amount">
+      <real value="1.0000000000"/>
+    </param>
+    <param name="blend_method">
+      <integer value="0"/>
+    </param>
+    <param name="origin">
+      <vector>
+        <x>0.0000000000</x>
+        <y>0.0500000007</y>
+      </vector>
+    </param>
+    <param name="canvas" use="logo.sif#"/>
+    <param name="zoom">
+      <real value="0.2750000000"/>
+    </param>
+    <param name="time_offset">
+      <time value="0f"/>
+    </param>
+  </layer>
+  <layer type="shade" active="true" version="0.2">
+    <param name="z_depth">
+      <real value="0.0000000000"/>
+    </param>
+    <param name="amount">
+      <real value="0.7500000000"/>
+    </param>
+    <param name="blend_method">
+      <integer value="12"/>
+    </param>
+    <param name="color">
+      <color>
+        <r>0.000000</r>
+        <g>0.000000</g>
+        <b>0.000000</b>
+        <a>1.000000</a>
+      </color>
+    </param>
+    <param name="offset">
+      <vector>
+        <x>0.1000000015</x>
+        <y>-0.1000000015</y>
+      </vector>
+    </param>
+    <param name="size">
+      <vector>
+        <x>0.2000000030</x>
+        <y>0.2000000030</y>
+      </vector>
+    </param>
+    <param name="type">
+      <integer value="1"/>
+    </param>
+    <param name="invert">
+      <bool value="false"/>
+    </param>
+  </layer>
+</canvas>
diff --git a/synfig-studio/images/transform_icon.sif b/synfig-studio/images/transform_icon.sif
deleted file mode 100644 (file)
index 7fab72e..0000000
+++ /dev/null
@@ -1,2393 +0,0 @@
-<?xml version="1.0"?>
-<canvas version="0.1" width="200" height="200" xres="2834.645752" yres="2834.645752" view-box="-3.245196 3.245196 3.245196 -3.245196" antialias="1" fps="24.000" begin-time="0f" end-time="0f" bgcolor="0.500000 0.500000 0.500000 1.000000">
-  <name>Synfig Studio Rotate Icon</name>
-  <desc>Placed in the Public Domain in 2007 by Chris Norman (pixelgeek)</desc>
-  <meta name="grid_show" content="0"/>
-  <meta name="grid_size" content="0.259616 0.259616"/>
-  <meta name="grid_snap" content="0"/>
-  <meta name="guide_show" content="1"/>
-  <meta name="guide_snap" content="0"/>
-  <meta name="onion_skin" content="0"/>
-  <layer type="PasteCanvas" active="true" version="0.1" desc="Upper rectangle shadow">
-    <param name="z_depth">
-      <real value="0.0000000000"/>
-    </param>
-    <param name="amount">
-      <real value="1.0000000000"/>
-    </param>
-    <param name="blend_method">
-      <integer value="0"/>
-    </param>
-    <param name="origin">
-      <vector>
-        <x>0.0000000000</x>
-        <y>0.0000000000</y>
-      </vector>
-    </param>
-    <param name="canvas">
-      <canvas>
-        <layer type="radial_gradient" active="true" version="0.1">
-          <param name="z_depth">
-            <real value="0.0000000000"/>
-          </param>
-          <param name="amount">
-            <real value="1.0000000000"/>
-          </param>
-          <param name="blend_method">
-            <integer value="0"/>
-          </param>
-          <param name="gradient">
-            <gradient>
-              <color pos="0.000000">
-                <r>0.300000</r>
-                <g>0.300000</g>
-                <b>0.300000</b>
-                <a>1.000000</a>
-              </color>
-              <color pos="1.000000">
-                <r>1.000000</r>
-                <g>1.000000</g>
-                <b>1.000000</b>
-                <a>0.000000</a>
-              </color>
-            </gradient>
-          </param>
-          <param name="center">
-            <vector>
-              <x>0.0000000000</x>
-              <y>0.0000000000</y>
-            </vector>
-          </param>
-          <param name="radius">
-            <real value="2.4078271871"/>
-          </param>
-          <param name="loop">
-            <bool value="false"/>
-          </param>
-          <param name="zigzag">
-            <bool value="false"/>
-          </param>
-        </layer>
-        <layer type="warp" active="true" version="0.1">
-          <param name="src_tl">
-            <vector>
-              <x>-2.5961599350</x>
-              <y>2.5961599350</y>
-            </vector>
-          </param>
-          <param name="src_br">
-            <vector>
-              <x>2.6703450680</x>
-              <y>-2.1673052311</y>
-            </vector>
-          </param>
-          <param name="dest_tl">
-            <vector>
-              <x>-3.2451999187</x>
-              <y>0.8112999797</y>
-            </vector>
-          </param>
-          <param name="dest_tr">
-            <vector>
-              <x>1.7848598957</x>
-              <y>0.8112999797</y>
-            </vector>
-          </param>
-          <param name="dest_br">
-            <vector>
-              <x>2.2716398239</x>
-              <y>-0.3245199919</y>
-            </vector>
-          </param>
-          <param name="dest_bl">
-            <vector>
-              <x>-2.9206800461</x>
-              <y>-0.3245199919</y>
-            </vector>
-          </param>
-          <param name="clip">
-            <bool value="true"/>
-          </param>
-          <param name="horizon">
-            <real value="2.0000000000"/>
-          </param>
-        </layer>
-      </canvas>
-    </param>
-    <param name="zoom">
-      <real value="0.0000000000"/>
-    </param>
-    <param name="time_offset">
-      <time value="0s"/>
-    </param>
-    <param name="children_lock">
-      <bool value="false"/>
-    </param>
-  </layer>
-  <layer type="PasteCanvas" active="true" version="0.1" desc="Lower rectangle shadow">
-    <param name="z_depth">
-      <real value="0.0000000000"/>
-    </param>
-    <param name="amount">
-      <real value="1.0000000000"/>
-    </param>
-    <param name="blend_method">
-      <integer value="0"/>
-    </param>
-    <param name="origin">
-      <vector>
-        <x>0.0000000000</x>
-        <y>0.0000000000</y>
-      </vector>
-    </param>
-    <param name="canvas">
-      <canvas>
-        <layer type="radial_gradient" active="true" version="0.1">
-          <param name="z_depth">
-            <real value="0.0000000000"/>
-          </param>
-          <param name="amount">
-            <real value="1.0000000000"/>
-          </param>
-          <param name="blend_method">
-            <integer value="0"/>
-          </param>
-          <param name="gradient">
-            <gradient>
-              <color pos="0.000000">
-                <r>0.300000</r>
-                <g>0.300000</g>
-                <b>0.300000</b>
-                <a>1.000000</a>
-              </color>
-              <color pos="1.000000">
-                <r>1.000000</r>
-                <g>1.000000</g>
-                <b>1.000000</b>
-                <a>0.000000</a>
-              </color>
-            </gradient>
-          </param>
-          <param name="center">
-            <vector>
-              <x>0.0000000000</x>
-              <y>0.0000000000</y>
-            </vector>
-          </param>
-          <param name="radius">
-            <real value="2.4078271871"/>
-          </param>
-          <param name="loop">
-            <bool value="false"/>
-          </param>
-          <param name="zigzag">
-            <bool value="false"/>
-          </param>
-        </layer>
-        <layer type="warp" active="true" version="0.1">
-          <param name="src_tl">
-            <vector>
-              <x>-2.5961599350</x>
-              <y>2.5961599350</y>
-            </vector>
-          </param>
-          <param name="src_br">
-            <vector>
-              <x>2.6703450680</x>
-              <y>-2.1673052311</y>
-            </vector>
-          </param>
-          <param name="dest_tl">
-            <vector>
-              <x>-2.2716398239</x>
-              <y>-1.4603400230</y>
-            </vector>
-          </param>
-          <param name="dest_tr">
-            <vector>
-              <x>2.7584199905</x>
-              <y>-1.4603400230</y>
-            </vector>
-          </param>
-          <param name="dest_br">
-            <vector>
-              <x>3.2451999187</x>
-              <y>-2.5961599350</y>
-            </vector>
-          </param>
-          <param name="dest_bl">
-            <vector>
-              <x>-1.9471199512</x>
-              <y>-2.5961599350</y>
-            </vector>
-          </param>
-          <param name="clip">
-            <bool value="true"/>
-          </param>
-          <param name="horizon">
-            <real value="2.0000000000"/>
-          </param>
-        </layer>
-      </canvas>
-    </param>
-    <param name="zoom">
-      <real value="0.0000000000"/>
-    </param>
-    <param name="time_offset">
-      <time value="0s"/>
-    </param>
-    <param name="children_lock">
-      <bool value="false"/>
-    </param>
-  </layer>
-  <layer type="PasteCanvas" active="true" version="0.1" desc="Upper Rectangle with gradient">
-    <param name="z_depth">
-      <real value="0.0000000000"/>
-    </param>
-    <param name="amount">
-      <real value="1.0000000000"/>
-    </param>
-    <param name="blend_method">
-      <integer value="0"/>
-    </param>
-    <param name="origin">
-      <vector>
-        <x>0.4867799878</x>
-        <y>0.0000000000</y>
-      </vector>
-    </param>
-    <param name="canvas">
-      <canvas>
-        <layer type="rectangle" active="true" version="0.2" desc="Blue Rectangle">
-          <param name="z_depth">
-            <real value="0.0000000000"/>
-          </param>
-          <param name="amount">
-            <real value="1.0000000000"/>
-          </param>
-          <param name="blend_method">
-            <integer value="0"/>
-          </param>
-          <param name="color">
-            <color>
-              <r>0.011238</r>
-              <g>0.065656</g>
-              <b>0.247059</b>
-              <a>1.000000</a>
-            </color>
-          </param>
-          <param name="point1">
-            <vector>
-              <x>-3.3425526619</x>
-              <y>0.0000000000</y>
-            </vector>
-          </param>
-          <param name="point2">
-            <vector>
-              <x>0.5516827703</x>
-              <y>3.1153881550</y>
-            </vector>
-          </param>
-          <param name="expand">
-            <real value="0.0000000000"/>
-          </param>
-          <param name="invert">
-            <bool value="false"/>
-          </param>
-        </layer>
-        <layer type="rectangle" active="true" version="0.2" desc="White Rectangle">
-          <param name="z_depth">
-            <real value="0.0000000000"/>
-          </param>
-          <param name="amount">
-            <real value="1.0000000000"/>
-          </param>
-          <param name="blend_method">
-            <integer value="0"/>
-          </param>
-          <param name="color">
-            <color>
-              <r>1.000000</r>
-              <g>1.000000</g>
-              <b>1.000000</b>
-              <a>1.000000</a>
-            </color>
-          </param>
-          <param name="point1">
-            <vector>
-              <x>-3.0829367638</x>
-              <y>0.2596156895</y>
-            </vector>
-          </param>
-          <param name="point2">
-            <vector>
-              <x>0.2920670807</x>
-              <y>2.8557724953</y>
-            </vector>
-          </param>
-          <param name="expand">
-            <real value="0.0000000000"/>
-          </param>
-          <param name="invert">
-            <bool value="false"/>
-          </param>
-        </layer>
-        <layer type="PasteCanvas" active="true" version="0.1" desc="Rectangle gradient">
-          <param name="z_depth">
-            <real value="0.0000000000"/>
-          </param>
-          <param name="amount">
-            <real value="1.0000000000"/>
-          </param>
-          <param name="blend_method">
-            <integer value="0"/>
-          </param>
-          <param name="origin">
-            <vector>
-              <x>-1.7848598957</x>
-              <y>1.9471199512</y>
-            </vector>
-          </param>
-          <param name="canvas">
-            <canvas width="480" height="270" view-box="-4.000000 2.250000 4.000000 -2.250000" antialias="2">
-              <layer type="rectangle" active="true" version="0.2" desc="White Rectangle">
-                <param name="z_depth">
-                  <real value="0.0000000000"/>
-                </param>
-                <param name="amount">
-                  <real value="1.0000000000"/>
-                </param>
-                <param name="blend_method">
-                  <integer value="0"/>
-                </param>
-                <param name="color">
-                  <color>
-                    <r>1.000000</r>
-                    <g>1.000000</g>
-                    <b>1.000000</b>
-                    <a>1.000000</a>
-                  </color>
-                </param>
-                <param name="point1">
-                  <vector>
-                    <x>-1.0384613276</x>
-                    <y>-1.4278886318</y>
-                  </vector>
-                </param>
-                <param name="point2">
-                  <vector>
-                    <x>1.8173112869</x>
-                    <y>0.6490369439</y>
-                  </vector>
-                </param>
-                <param name="expand">
-                  <real value="0.0000000000"/>
-                </param>
-                <param name="invert">
-                  <bool value="false"/>
-                </param>
-              </layer>
-              <layer type="linear_gradient" active="true" version="0.0" desc="Gradient">
-                <param name="z_depth">
-                  <real value="0.0000000000"/>
-                </param>
-                <param name="amount">
-                  <real value="1.0000000000"/>
-                </param>
-                <param name="blend_method">
-                  <integer value="13"/>
-                </param>
-                <param name="p1">
-                  <vector>
-                    <x>-1.7848600149</x>
-                    <y>1.9471199512</y>
-                  </vector>
-                </param>
-                <param name="p2">
-                  <vector>
-                    <x>2.9206800461</x>
-                    <y>-4.0564999580</y>
-                  </vector>
-                </param>
-                <param name="gradient">
-                  <gradient>
-                    <color pos="0.000000">
-                      <r>0.028991</r>
-                      <g>0.133209</g>
-                      <b>0.374624</b>
-                      <a>1.000000</a>
-                    </color>
-                    <color pos="1.000000">
-                      <r>1.000000</r>
-                      <g>1.000000</g>
-                      <b>1.000000</b>
-                      <a>1.000000</a>
-                    </color>
-                  </gradient>
-                </param>
-                <param name="loop">
-                  <bool value="false"/>
-                </param>
-                <param name="zigzag">
-                  <bool value="false"/>
-                </param>
-              </layer>
-            </canvas>
-          </param>
-          <param name="zoom">
-            <real value="0.0000000000"/>
-          </param>
-          <param name="time_offset">
-            <time value="0s"/>
-          </param>
-          <param name="children_lock">
-            <bool value="false"/>
-          </param>
-        </layer>
-      </canvas>
-    </param>
-    <param name="zoom">
-      <real value="0.0000000000"/>
-    </param>
-    <param name="time_offset">
-      <time value="0s"/>
-    </param>
-    <param name="children_lock">
-      <bool value="false"/>
-    </param>
-  </layer>
-  <layer type="PasteCanvas" active="true" version="0.1" desc="Lower Rectangle with gradient">
-    <param name="z_depth">
-      <real value="0.0000000000"/>
-    </param>
-    <param name="amount">
-      <real value="1.0000000000"/>
-    </param>
-    <param name="blend_method">
-      <integer value="0"/>
-    </param>
-    <param name="origin">
-      <vector>
-        <x>0.0000000000</x>
-        <y>0.0000000000</y>
-      </vector>
-    </param>
-    <param name="canvas">
-      <canvas>
-        <layer type="rectangle" active="true" version="0.2" desc="Blue Rectangle">
-          <param name="z_depth">
-            <real value="0.0000000000"/>
-          </param>
-          <param name="amount">
-            <real value="1.0000000000"/>
-          </param>
-          <param name="blend_method">
-            <integer value="0"/>
-          </param>
-          <param name="color">
-            <color>
-              <r>0.011238</r>
-              <g>0.065656</g>
-              <b>0.247059</b>
-              <a>1.000000</a>
-            </color>
-          </param>
-          <param name="point1">
-            <vector>
-              <x>-1.1146180630</x>
-              <y>-2.0209679604</y>
-            </vector>
-          </param>
-          <param name="point2">
-            <vector>
-              <x>2.5569021702</x>
-              <y>0.9162484407</y>
-            </vector>
-          </param>
-          <param name="expand">
-            <real value="0.0000000000"/>
-          </param>
-          <param name="invert">
-            <bool value="false"/>
-          </param>
-        </layer>
-        <layer type="rectangle" active="true" version="0.2" desc="White Rectangle">
-          <param name="z_depth">
-            <real value="0.0000000000"/>
-          </param>
-          <param name="amount">
-            <real value="1.0000000000"/>
-          </param>
-          <param name="blend_method">
-            <integer value="0"/>
-          </param>
-          <param name="color">
-            <color>
-              <r>1.000000</r>
-              <g>1.000000</g>
-              <b>1.000000</b>
-              <a>1.000000</a>
-            </color>
-          </param>
-          <param name="point1">
-            <vector>
-              <x>-0.8734864593</x>
-              <y>-1.7986452579</y>
-            </vector>
-          </param>
-          <param name="point2">
-            <vector>
-              <x>2.3052372932</x>
-              <y>0.6841450930</y>
-            </vector>
-          </param>
-          <param name="expand">
-            <real value="0.0000000000"/>
-          </param>
-          <param name="invert">
-            <bool value="false"/>
-          </param>
-        </layer>
-        <layer type="PasteCanvas" active="true" version="0.1" desc="Rectangle gradient">
-          <param name="z_depth">
-            <real value="0.0000000000"/>
-          </param>
-          <param name="amount">
-            <real value="1.0000000000"/>
-          </param>
-          <param name="blend_method">
-            <integer value="0"/>
-          </param>
-          <param name="origin">
-            <vector>
-              <x>0.1622599959</x>
-              <y>-0.3245199919</y>
-            </vector>
-          </param>
-          <param name="canvas">
-            <canvas>
-              <layer type="rectangle" active="true" version="0.2" desc="White Rectangle">
-                <param name="z_depth">
-                  <real value="0.0000000000"/>
-                </param>
-                <param name="amount">
-                  <real value="1.0000000000"/>
-                </param>
-                <param name="blend_method">
-                  <integer value="0"/>
-                </param>
-                <param name="color">
-                  <color>
-                    <r>1.000000</r>
-                    <g>1.000000</g>
-                    <b>1.000000</b>
-                    <a>1.000000</a>
-                  </color>
-                </param>
-                <param name="point1">
-                  <vector>
-                    <x>-0.8288472295</x>
-                    <y>-1.2672259808</y>
-                  </vector>
-                </param>
-                <param name="point2">
-                  <vector>
-                    <x>1.9548872709</x>
-                    <y>0.7829568982</y>
-                  </vector>
-                </param>
-                <param name="expand">
-                  <real value="0.0000000000"/>
-                </param>
-                <param name="invert">
-                  <bool value="false"/>
-                </param>
-              </layer>
-              <layer type="linear_gradient" active="true" version="0.0" desc="Gradient">
-                <param name="z_depth">
-                  <real value="0.0000000000"/>
-                </param>
-                <param name="amount">
-                  <real value="1.0000000000"/>
-                </param>
-                <param name="blend_method">
-                  <integer value="13"/>
-                </param>
-                <param name="p1">
-                  <vector>
-                    <x>2.0723481178</x>
-                    <y>-2.8204009533</y>
-                  </vector>
-                </param>
-                <param name="p2">
-                  <vector>
-                    <x>-2.8938808441</x>
-                    <y>3.8485348225</y>
-                  </vector>
-                </param>
-                <param name="gradient">
-                  <gradient>
-                    <color pos="0.000000">
-                      <r>0.028991</r>
-                      <g>0.133209</g>
-                      <b>0.374624</b>
-                      <a>1.000000</a>
-                    </color>
-                    <color pos="1.000000">
-                      <r>1.000000</r>
-                      <g>1.000000</g>
-                      <b>1.000000</b>
-                      <a>1.000000</a>
-                    </color>
-                  </gradient>
-                </param>
-                <param name="loop">
-                  <bool value="false"/>
-                </param>
-                <param name="zigzag">
-                  <bool value="false"/>
-                </param>
-              </layer>
-            </canvas>
-          </param>
-          <param name="zoom">
-            <real value="0.0000000000"/>
-          </param>
-          <param name="time_offset">
-            <time value="0s"/>
-          </param>
-          <param name="children_lock">
-            <bool value="false"/>
-          </param>
-        </layer>
-        <layer type="rotate" active="true" version="0.1">
-          <param name="origin">
-            <vector>
-              <x>0.9735599756</x>
-              <y>-0.1622599959</y>
-            </vector>
-          </param>
-          <param name="amount">
-            <angle value="-45.000000"/>
-          </param>
-        </layer>
-      </canvas>
-    </param>
-    <param name="zoom">
-      <real value="0.0000000000"/>
-    </param>
-    <param name="time_offset">
-      <time value="0s"/>
-    </param>
-    <param name="children_lock">
-      <bool value="false"/>
-    </param>
-  </layer>
-  <layer type="PasteCanvas" active="true" version="0.1" desc="Lower arrow">
-    <param name="z_depth">
-      <real value="0.0000000000"/>
-    </param>
-    <param name="amount">
-      <real value="1.0000000000"/>
-    </param>
-    <param name="blend_method">
-      <integer value="0"/>
-    </param>
-    <param name="origin">
-      <vector>
-        <x>0.0000000000</x>
-        <y>0.0000000000</y>
-      </vector>
-    </param>
-    <param name="canvas">
-      <canvas>
-        <layer type="region" active="true" version="0.1" desc="Arrow Region">
-          <param name="z_depth">
-            <real value="0.0000000000"/>
-          </param>
-          <param name="amount">
-            <real value="1.0000000000"/>
-          </param>
-          <param name="blend_method">
-            <integer value="0"/>
-          </param>
-          <param name="color">
-            <color>
-              <r>1.000000</r>
-              <g>1.000000</g>
-              <b>1.000000</b>
-              <a>1.000000</a>
-            </color>
-          </param>
-          <param name="offset">
-            <vector guid="05993A4BCC99F10B8F4D74AE5D68DD79">
-              <x>-4.0240430832</x>
-              <y>-2.9855804443</y>
-            </vector>
-          </param>
-          <param name="invert">
-            <bool value="false"/>
-          </param>
-          <param name="antialias">
-            <bool value="true"/>
-          </param>
-          <param name="feather">
-            <real value="0.0000000000"/>
-          </param>
-          <param name="blurtype">
-            <integer value="1"/>
-          </param>
-          <param name="bline">
-            <bline type="bline_point" loop="true" guid="E831D3707F7936CAE7D73D2C5B5CA16E">
-              <entry>
-                <composite type="bline_point">
-                  <c1>
-                    <vector>
-                      <x>2.7908737659</x>
-                      <y>0.8437545300</y>
-                    </vector>
-                  </c1>
-                  <c2>
-                    <real value="1.0000000000"/>
-                  </c2>
-                  <c3>
-                    <real value="0.5000000000"/>
-                  </c3>
-                  <c4>
-                    <bool value="true"/>
-                  </c4>
-                  <c5>
-                    <radial_composite type="vector">
-                      <c0>
-                        <real value="0.7788470627"/>
-                      </c0>
-                      <c1>
-                        <angle value="-90.000000"/>
-                      </c1>
-                    </radial_composite>
-                  </c5>
-                  <c6>
-                    <radial_composite type="vector">
-                      <c0>
-                        <real value="2.7259647195"/>
-                      </c0>
-                      <c1>
-                        <angle value="180.000000"/>
-                      </c1>
-                    </radial_composite>
-                  </c6>
-                </composite>
-              </entry>
-              <entry>
-                <composite type="bline_point">
-                  <c1>
-                    <vector>
-                      <x>1.7524110079</x>
-                      <y>1.4927937984</y>
-                    </vector>
-                  </c1>
-                  <c2>
-                    <real value="1.0000000000"/>
-                  </c2>
-                  <c3>
-                    <real value="0.5000000000"/>
-                  </c3>
-                  <c4>
-                    <bool value="true"/>
-                  </c4>
-                  <c5>
-                    <radial_composite type="vector">
-                      <c0>
-                        <real value="1.1682705941"/>
-                      </c0>
-                      <c1>
-                        <angle value="90.000000"/>
-                      </c1>
-                    </radial_composite>
-                  </c5>
-                  <c6>
-                    <radial_composite type="vector">
-                      <c0>
-                        <real value="0.7788470627"/>
-                      </c0>
-                      <c1>
-                        <angle value="90.000000"/>
-                      </c1>
-                    </radial_composite>
-                  </c6>
-                </composite>
-              </entry>
-              <entry>
-                <composite type="bline_point">
-                  <c1>
-                    <vector>
-                      <x>1.7524110079</x>
-                      <y>1.8822172880</y>
-                    </vector>
-                  </c1>
-                  <c2>
-                    <real value="1.0000000000"/>
-                  </c2>
-                  <c3>
-                    <real value="0.5000000000"/>
-                  </c3>
-                  <c4>
-                    <bool value="true"/>
-                  </c4>
-                  <c5>
-                    <radial_composite type="vector">
-                      <c0>
-                        <real value="0.3894235314"/>
-                      </c0>
-                      <c1>
-                        <angle value="90.000000"/>
-                      </c1>
-                    </radial_composite>
-                  </c5>
-                  <c6>
-                    <radial_composite type="vector">
-                      <c0>
-                        <real value="0.7788470627"/>
-                      </c0>
-                      <c1>
-                        <angle value="180.000000"/>
-                      </c1>
-                    </radial_composite>
-                  </c6>
-                </composite>
-              </entry>
-              <entry>
-                <composite type="bline_point">
-                  <c1>
-                    <vector>
-                      <x>1.1033717394</x>
-                      <y>1.8822172880</y>
-                    </vector>
-                  </c1>
-                  <c2>
-                    <real value="1.0000000000"/>
-                  </c2>
-                  <c3>
-                    <real value="0.5000000000"/>
-                  </c3>
-                  <c4>
-                    <bool value="true"/>
-                  </c4>
-                  <c5>
-                    <radial_composite type="vector">
-                      <c0>
-                        <real value="0.7788470627"/>
-                      </c0>
-                      <c1>
-                        <angle value="-180.000000"/>
-                      </c1>
-                    </radial_composite>
-                  </c5>
-                  <c6>
-                    <radial_composite type="vector">
-                      <c0>
-                        <real value="1.1014560791"/>
-                      </c0>
-                      <c1>
-                        <angle value="45.000000"/>
-                      </c1>
-                    </radial_composite>
-                  </c6>
-                </composite>
-              </entry>
-              <entry>
-                <composite type="bline_point">
-                  <c1>
-                    <vector>
-                      <x>1.9471199512</x>
-                      <y>2.7584199905</y>
-                    </vector>
-                  </c1>
-                  <c2>
-                    <real value="1.0000000000"/>
-                  </c2>
-                  <c3>
-                    <real value="0.5000000000"/>
-                  </c3>
-                  <c4>
-                    <bool value="true"/>
-                  </c4>
-                  <c5>
-                    <radial_composite type="vector">
-                      <c0>
-                        <real value="1.9975694309"/>
-                      </c0>
-                      <c1>
-                        <angle value="46.975098"/>
-                      </c1>
-                    </radial_composite>
-                  </c5>
-                  <c6>
-                    <radial_composite type="vector">
-                      <c0>
-                        <real value="1.4473043330"/>
-                      </c0>
-                      <c1>
-                        <angle value="-47.726048"/>
-                      </c1>
-                    </radial_composite>
-                  </c6>
-                </composite>
-              </entry>
-              <entry>
-                <composite type="bline_point">
-                  <c1>
-                    <vector>
-                      <x>2.7908737659</x>
-                      <y>1.8822172880</y>
-                    </vector>
-                  </c1>
-                  <c2>
-                    <real value="1.0000000000"/>
-                  </c2>
-                  <c3>
-                    <real value="0.5000000000"/>
-                  </c3>
-                  <c4>
-                    <bool value="true"/>
-                  </c4>
-                  <c5>
-                    <radial_composite type="vector">
-                      <c0>
-                        <real value="1.6521841187"/>
-                      </c0>
-                      <c1>
-                        <angle value="-45.000000"/>
-                      </c1>
-                    </radial_composite>
-                  </c5>
-                  <c6>
-                    <radial_composite type="vector">
-                      <c0>
-                        <real value="1.7645753250"/>
-                      </c0>
-                      <c1>
-                        <angle value="180.000000"/>
-                      </c1>
-                    </radial_composite>
-                  </c6>
-                </composite>
-              </entry>
-              <entry>
-                <composite type="bline_point">
-                  <c1>
-                    <vector>
-                      <x>2.1418344975</x>
-                      <y>1.8822172880</y>
-                    </vector>
-                  </c1>
-                  <c2>
-                    <real value="1.0000000000"/>
-                  </c2>
-                  <c3>
-                    <real value="0.5000000000"/>
-                  </c3>
-                  <c4>
-                    <bool value="true"/>
-                  </c4>
-                  <c5>
-                    <radial_composite type="vector">
-                      <c0>
-                        <real value="0.3894235314"/>
-                      </c0>
-                      <c1>
-                        <angle value="-180.000000"/>
-                      </c1>
-                    </radial_composite>
-                  </c5>
-                  <c6>
-                    <radial_composite type="vector">
-                      <c0>
-                        <real value="0.3894235314"/>
-                      </c0>
-                      <c1>
-                        <angle value="-90.000000"/>
-                      </c1>
-                    </radial_composite>
-                  </c6>
-                </composite>
-              </entry>
-              <entry>
-                <composite type="bline_point">
-                  <c1>
-                    <vector>
-                      <x>2.1418344975</x>
-                      <y>1.6226016283</y>
-                    </vector>
-                  </c1>
-                  <c2>
-                    <real value="1.0000000000"/>
-                  </c2>
-                  <c3>
-                    <real value="0.5000000000"/>
-                  </c3>
-                  <c4>
-                    <bool value="true"/>
-                  </c4>
-                  <c5>
-                    <radial_composite type="vector">
-                      <c0>
-                        <real value="0.3894235314"/>
-                      </c0>
-                      <c1>
-                        <angle value="-90.000000"/>
-                      </c1>
-                    </radial_composite>
-                  </c5>
-                  <c6>
-                    <radial_composite type="vector">
-                      <c0>
-                        <real value="1.1682705941"/>
-                      </c0>
-                      <c1>
-                        <angle value="-90.000000"/>
-                      </c1>
-                    </radial_composite>
-                  </c6>
-                </composite>
-              </entry>
-              <entry>
-                <composite type="bline_point">
-                  <c1>
-                    <vector>
-                      <x>2.7908737659</x>
-                      <y>1.2331780195</y>
-                    </vector>
-                  </c1>
-                  <c2>
-                    <real value="1.0000000000"/>
-                  </c2>
-                  <c3>
-                    <real value="0.5000000000"/>
-                  </c3>
-                  <c4>
-                    <bool value="true"/>
-                  </c4>
-                  <c5>
-                    <radial_composite type="vector">
-                      <c0>
-                        <real value="1.9471176568"/>
-                      </c0>
-                      <c1>
-                        <angle value="0.000000"/>
-                      </c1>
-                    </radial_composite>
-                  </c5>
-                  <c6>
-                    <radial_composite type="vector">
-                      <c0>
-                        <real value="0.7788470627"/>
-                      </c0>
-                      <c1>
-                        <angle value="-90.000000"/>
-                      </c1>
-                    </radial_composite>
-                  </c6>
-                </composite>
-              </entry>
-            </bline>
-          </param>
-        </layer>
-        <layer type="shade" active="true" version="0.2">
-          <param name="z_depth">
-            <real value="0.0000000000"/>
-          </param>
-          <param name="amount">
-            <real value="1.0000000000"/>
-          </param>
-          <param name="blend_method">
-            <integer value="12"/>
-          </param>
-          <param name="color">
-            <color>
-              <r>0.303279</r>
-              <g>0.295082</g>
-              <b>0.303279</b>
-              <a>0.333333</a>
-            </color>
-          </param>
-          <param name="offset">
-            <vector>
-              <x>-0.1894220859</x>
-              <y>-0.1675494760</y>
-            </vector>
-          </param>
-          <param name="size">
-            <vector>
-              <x>0.1000007167</x>
-              <y>0.1000007167</y>
-            </vector>
-          </param>
-          <param name="type">
-            <integer value="1"/>
-          </param>
-          <param name="invert">
-            <bool value="false"/>
-          </param>
-        </layer>
-        <layer type="outline" active="true" version="0.2" desc="Arrow Outline">
-          <param name="z_depth">
-            <real value="0.0000000000"/>
-          </param>
-          <param name="amount">
-            <real value="1.0000000000"/>
-          </param>
-          <param name="blend_method">
-            <integer value="0"/>
-          </param>
-          <param name="color">
-            <color>
-              <r>0.011238</r>
-              <g>0.065656</g>
-              <b>0.247059</b>
-              <a>1.000000</a>
-            </color>
-          </param>
-          <param name="offset">
-            <vector guid="05993A4BCC99F10B8F4D74AE5D68DD79">
-              <x>-4.0240430832</x>
-              <y>-2.9855804443</y>
-            </vector>
-          </param>
-          <param name="invert">
-            <bool value="false"/>
-          </param>
-          <param name="antialias">
-            <bool value="true"/>
-          </param>
-          <param name="feather">
-            <real value="0.0000000000"/>
-          </param>
-          <param name="blurtype">
-            <integer value="1"/>
-          </param>
-          <param name="bline">
-            <bline type="bline_point" loop="true" guid="E831D3707F7936CAE7D73D2C5B5CA16E">
-              <entry>
-                <composite type="bline_point">
-                  <c1>
-                    <vector>
-                      <x>2.7908737659</x>
-                      <y>0.8437545300</y>
-                    </vector>
-                  </c1>
-                  <c2>
-                    <real value="1.0000000000"/>
-                  </c2>
-                  <c3>
-                    <real value="0.5000000000"/>
-                  </c3>
-                  <c4>
-                    <bool value="true"/>
-                  </c4>
-                  <c5>
-                    <radial_composite type="vector">
-                      <c0>
-                        <real value="0.7788470627"/>
-                      </c0>
-                      <c1>
-                        <angle value="-90.000000"/>
-                      </c1>
-                    </radial_composite>
-                  </c5>
-                  <c6>
-                    <radial_composite type="vector">
-                      <c0>
-                        <real value="2.7259647195"/>
-                      </c0>
-                      <c1>
-                        <angle value="180.000000"/>
-                      </c1>
-                    </radial_composite>
-                  </c6>
-                </composite>
-              </entry>
-              <entry>
-                <composite type="bline_point">
-                  <c1>
-                    <vector>
-                      <x>1.7524110079</x>
-                      <y>1.4927937984</y>
-                    </vector>
-                  </c1>
-                  <c2>
-                    <real value="1.0000000000"/>
-                  </c2>
-                  <c3>
-                    <real value="0.5000000000"/>
-                  </c3>
-                  <c4>
-                    <bool value="true"/>
-                  </c4>
-                  <c5>
-                    <radial_composite type="vector">
-                      <c0>
-                        <real value="1.1682705941"/>
-                      </c0>
-                      <c1>
-                        <angle value="90.000000"/>
-                      </c1>
-                    </radial_composite>
-                  </c5>
-                  <c6>
-                    <radial_composite type="vector">
-                      <c0>
-                        <real value="0.7788470627"/>
-                      </c0>
-                      <c1>
-                        <angle value="90.000000"/>
-                      </c1>
-                    </radial_composite>
-                  </c6>
-                </composite>
-              </entry>
-              <entry>
-                <composite type="bline_point">
-                  <c1>
-                    <vector>
-                      <x>1.7524110079</x>
-                      <y>1.8822172880</y>
-                    </vector>
-                  </c1>
-                  <c2>
-                    <real value="1.0000000000"/>
-                  </c2>
-                  <c3>
-                    <real value="0.5000000000"/>
-                  </c3>
-                  <c4>
-                    <bool value="true"/>
-                  </c4>
-                  <c5>
-                    <radial_composite type="vector">
-                      <c0>
-                        <real value="0.3894235314"/>
-                      </c0>
-                      <c1>
-                        <angle value="90.000000"/>
-                      </c1>
-                    </radial_composite>
-                  </c5>
-                  <c6>
-                    <radial_composite type="vector">
-                      <c0>
-                        <real value="0.7788470627"/>
-                      </c0>
-                      <c1>
-                        <angle value="180.000000"/>
-                      </c1>
-                    </radial_composite>
-                  </c6>
-                </composite>
-              </entry>
-              <entry>
-                <composite type="bline_point">
-                  <c1>
-                    <vector>
-                      <x>1.1033717394</x>
-                      <y>1.8822172880</y>
-                    </vector>
-                  </c1>
-                  <c2>
-                    <real value="1.0000000000"/>
-                  </c2>
-                  <c3>
-                    <real value="0.5000000000"/>
-                  </c3>
-                  <c4>
-                    <bool value="true"/>
-                  </c4>
-                  <c5>
-                    <radial_composite type="vector">
-                      <c0>
-                        <real value="0.7788470627"/>
-                      </c0>
-                      <c1>
-                        <angle value="-180.000000"/>
-                      </c1>
-                    </radial_composite>
-                  </c5>
-                  <c6>
-                    <radial_composite type="vector">
-                      <c0>
-                        <real value="1.1014560791"/>
-                      </c0>
-                      <c1>
-                        <angle value="45.000000"/>
-                      </c1>
-                    </radial_composite>
-                  </c6>
-                </composite>
-              </entry>
-              <entry>
-                <composite type="bline_point">
-                  <c1>
-                    <vector>
-                      <x>1.9471199512</x>
-                      <y>2.7584199905</y>
-                    </vector>
-                  </c1>
-                  <c2>
-                    <real value="1.0000000000"/>
-                  </c2>
-                  <c3>
-                    <real value="0.5000000000"/>
-                  </c3>
-                  <c4>
-                    <bool value="true"/>
-                  </c4>
-                  <c5>
-                    <radial_composite type="vector">
-                      <c0>
-                        <real value="1.9975694309"/>
-                      </c0>
-                      <c1>
-                        <angle value="46.975098"/>
-                      </c1>
-                    </radial_composite>
-                  </c5>
-                  <c6>
-                    <radial_composite type="vector">
-                      <c0>
-                        <real value="1.4473043330"/>
-                      </c0>
-                      <c1>
-                        <angle value="-47.726048"/>
-                      </c1>
-                    </radial_composite>
-                  </c6>
-                </composite>
-              </entry>
-              <entry>
-                <composite type="bline_point">
-                  <c1>
-                    <vector>
-                      <x>2.7908737659</x>
-                      <y>1.8822172880</y>
-                    </vector>
-                  </c1>
-                  <c2>
-                    <real value="1.0000000000"/>
-                  </c2>
-                  <c3>
-                    <real value="0.5000000000"/>
-                  </c3>
-                  <c4>
-                    <bool value="true"/>
-                  </c4>
-                  <c5>
-                    <radial_composite type="vector">
-                      <c0>
-                        <real value="1.6521841187"/>
-                      </c0>
-                      <c1>
-                        <angle value="-45.000000"/>
-                      </c1>
-                    </radial_composite>
-                  </c5>
-                  <c6>
-                    <radial_composite type="vector">
-                      <c0>
-                        <real value="1.7645753250"/>
-                      </c0>
-                      <c1>
-                        <angle value="180.000000"/>
-                      </c1>
-                    </radial_composite>
-                  </c6>
-                </composite>
-              </entry>
-              <entry>
-                <composite type="bline_point">
-                  <c1>
-                    <vector>
-                      <x>2.1418344975</x>
-                      <y>1.8822172880</y>
-                    </vector>
-                  </c1>
-                  <c2>
-                    <real value="1.0000000000"/>
-                  </c2>
-                  <c3>
-                    <real value="0.5000000000"/>
-                  </c3>
-                  <c4>
-                    <bool value="true"/>
-                  </c4>
-                  <c5>
-                    <radial_composite type="vector">
-                      <c0>
-                        <real value="0.3894235314"/>
-                      </c0>
-                      <c1>
-                        <angle value="-180.000000"/>
-                      </c1>
-                    </radial_composite>
-                  </c5>
-                  <c6>
-                    <radial_composite type="vector">
-                      <c0>
-                        <real value="0.3894235314"/>
-                      </c0>
-                      <c1>
-                        <angle value="-90.000000"/>
-                      </c1>
-                    </radial_composite>
-                  </c6>
-                </composite>
-              </entry>
-              <entry>
-                <composite type="bline_point">
-                  <c1>
-                    <vector>
-                      <x>2.1418344975</x>
-                      <y>1.6226016283</y>
-                    </vector>
-                  </c1>
-                  <c2>
-                    <real value="1.0000000000"/>
-                  </c2>
-                  <c3>
-                    <real value="0.5000000000"/>
-                  </c3>
-                  <c4>
-                    <bool value="true"/>
-                  </c4>
-                  <c5>
-                    <radial_composite type="vector">
-                      <c0>
-                        <real value="0.3894235314"/>
-                      </c0>
-                      <c1>
-                        <angle value="-90.000000"/>
-                      </c1>
-                    </radial_composite>
-                  </c5>
-                  <c6>
-                    <radial_composite type="vector">
-                      <c0>
-                        <real value="1.1682705941"/>
-                      </c0>
-                      <c1>
-                        <angle value="-90.000000"/>
-                      </c1>
-                    </radial_composite>
-                  </c6>
-                </composite>
-              </entry>
-              <entry>
-                <composite type="bline_point">
-                  <c1>
-                    <vector>
-                      <x>2.7908737659</x>
-                      <y>1.2331780195</y>
-                    </vector>
-                  </c1>
-                  <c2>
-                    <real value="1.0000000000"/>
-                  </c2>
-                  <c3>
-                    <real value="0.5000000000"/>
-                  </c3>
-                  <c4>
-                    <bool value="true"/>
-                  </c4>
-                  <c5>
-                    <radial_composite type="vector">
-                      <c0>
-                        <real value="1.9471176568"/>
-                      </c0>
-                      <c1>
-                        <angle value="0.000000"/>
-                      </c1>
-                    </radial_composite>
-                  </c5>
-                  <c6>
-                    <radial_composite type="vector">
-                      <c0>
-                        <real value="0.7788470627"/>
-                      </c0>
-                      <c1>
-                        <angle value="-90.000000"/>
-                      </c1>
-                    </radial_composite>
-                  </c6>
-                </composite>
-              </entry>
-            </bline>
-          </param>
-          <param name="width">
-            <real value="0.1947117657"/>
-          </param>
-          <param name="expand">
-            <real value="0.0000000000"/>
-          </param>
-          <param name="sharp_cusps">
-            <bool value="true"/>
-          </param>
-          <param name="round_tip[0]">
-            <bool value="true"/>
-          </param>
-          <param name="round_tip[1]">
-            <bool value="true"/>
-          </param>
-          <param name="loopyness">
-            <real value="1.0000000000"/>
-          </param>
-          <param name="homogeneous_width">
-            <bool value="true"/>
-          </param>
-        </layer>
-      </canvas>
-    </param>
-    <param name="zoom">
-      <real value="0.0000000000"/>
-    </param>
-    <param name="time_offset">
-      <time value="0s"/>
-    </param>
-    <param name="children_lock">
-      <bool value="false"/>
-    </param>
-  </layer>
-  <layer type="PasteCanvas" active="true" version="0.1" desc="Upper Arrow">
-    <param name="z_depth">
-      <real value="0.0000000000"/>
-    </param>
-    <param name="amount">
-      <real value="1.0000000000"/>
-    </param>
-    <param name="blend_method">
-      <integer value="0"/>
-    </param>
-    <param name="origin">
-      <vector>
-        <x>0.0000000000</x>
-        <y>0.0000000000</y>
-      </vector>
-    </param>
-    <param name="canvas">
-      <canvas>
-        <layer type="region" active="true" version="0.1" desc="Arrow Region">
-          <param name="z_depth">
-            <real value="0.0000000000"/>
-          </param>
-          <param name="amount">
-            <real value="1.0000000000"/>
-          </param>
-          <param name="blend_method">
-            <integer value="0"/>
-          </param>
-          <param name="color">
-            <color>
-              <r>1.000000</r>
-              <g>1.000000</g>
-              <b>1.000000</b>
-              <a>1.000000</a>
-            </color>
-          </param>
-          <param name="offset">
-            <vector guid="80F6181CA1918EAE33C34EC82856397B">
-              <x>0.1622599959</x>
-              <y>-0.3245199919</y>
-            </vector>
-          </param>
-          <param name="invert">
-            <bool value="false"/>
-          </param>
-          <param name="antialias">
-            <bool value="true"/>
-          </param>
-          <param name="feather">
-            <real value="0.0000000000"/>
-          </param>
-          <param name="blurtype">
-            <integer value="1"/>
-          </param>
-          <param name="bline">
-            <bline type="bline_point" loop="true" guid="E3A6EF8C8CDADE2362FFDE8ABF503B65">
-              <entry>
-                <composite type="bline_point">
-                  <c1>
-                    <vector>
-                      <x>1.1358199120</x>
-                      <y>2.9206800461</y>
-                    </vector>
-                  </c1>
-                  <c2>
-                    <real value="1.0000000000"/>
-                  </c2>
-                  <c3>
-                    <real value="0.5000000000"/>
-                  </c3>
-                  <c4>
-                    <bool value="true"/>
-                  </c4>
-                  <c5>
-                    <radial_composite type="vector">
-                      <c0>
-                        <real value="1.4603399634"/>
-                      </c0>
-                      <c1>
-                        <angle value="90.000000"/>
-                      </c1>
-                    </radial_composite>
-                  </c5>
-                  <c6>
-                    <radial_composite type="vector">
-                      <c0>
-                        <real value="2.7259603095"/>
-                      </c0>
-                      <c1>
-                        <angle value="-0.000200"/>
-                      </c1>
-                    </radial_composite>
-                  </c6>
-                </composite>
-              </entry>
-              <entry>
-                <composite type="bline_point">
-                  <c1>
-                    <vector>
-                      <x>2.1742811203</x>
-                      <y>2.4014453888</y>
-                    </vector>
-                  </c1>
-                  <c2>
-                    <real value="1.0000000000"/>
-                  </c2>
-                  <c3>
-                    <real value="0.5000000000"/>
-                  </c3>
-                  <c4>
-                    <bool value="true"/>
-                  </c4>
-                  <c5>
-                    <radial_composite type="vector">
-                      <c0>
-                        <real value="1.5576941254"/>
-                      </c0>
-                      <c1>
-                        <angle value="-90.000000"/>
-                      </c1>
-                    </radial_composite>
-                  </c5>
-                  <c6>
-                    <radial_composite type="vector">
-                      <c0>
-                        <real value="0.9735599756"/>
-                      </c0>
-                      <c1>
-                        <angle value="-90.000000"/>
-                      </c1>
-                    </radial_composite>
-                  </c6>
-                </composite>
-              </entry>
-              <entry>
-                <composite type="bline_point">
-                  <c1>
-                    <vector>
-                      <x>2.1742811203</x>
-                      <y>1.8822140694</y>
-                    </vector>
-                  </c1>
-                  <c2>
-                    <real value="1.0000000000"/>
-                  </c2>
-                  <c3>
-                    <real value="0.5000000000"/>
-                  </c3>
-                  <c4>
-                    <bool value="true"/>
-                  </c4>
-                  <c5>
-                    <radial_composite type="vector">
-                      <c0>
-                        <real value="0.3894235314"/>
-                      </c0>
-                      <c1>
-                        <angle value="-90.000000"/>
-                      </c1>
-                    </radial_composite>
-                  </c5>
-                  <c6>
-                    <radial_composite type="vector">
-                      <c0>
-                        <real value="0.3894235314"/>
-                      </c0>
-                      <c1>
-                        <angle value="0.000000"/>
-                      </c1>
-                    </radial_composite>
-                  </c6>
-                </composite>
-              </entry>
-              <entry>
-                <composite type="bline_point">
-                  <c1>
-                    <vector>
-                      <x>2.8233203888</x>
-                      <y>1.8822140694</y>
-                    </vector>
-                  </c1>
-                  <c2>
-                    <real value="1.0000000000"/>
-                  </c2>
-                  <c3>
-                    <real value="0.5000000000"/>
-                  </c3>
-                  <c4>
-                    <bool value="true"/>
-                  </c4>
-                  <c5>
-                    <radial_composite type="vector">
-                      <c0>
-                        <real value="0.3894235314"/>
-                      </c0>
-                      <c1>
-                        <angle value="0.000000"/>
-                      </c1>
-                    </radial_composite>
-                  </c5>
-                  <c6>
-                    <radial_composite type="vector">
-                      <c0>
-                        <real value="1.6521841187"/>
-                      </c0>
-                      <c1>
-                        <angle value="-135.000000"/>
-                      </c1>
-                    </radial_composite>
-                  </c6>
-                </composite>
-              </entry>
-              <entry>
-                <composite type="bline_point">
-                  <c1>
-                    <vector>
-                      <x>1.9795694351</x>
-                      <y>1.1033670902</y>
-                    </vector>
-                  </c1>
-                  <c2>
-                    <real value="1.0000000000"/>
-                  </c2>
-                  <c3>
-                    <real value="0.5000000000"/>
-                  </c3>
-                  <c4>
-                    <bool value="true"/>
-                  </c4>
-                  <c5>
-                    <radial_composite type="vector">
-                      <c0>
-                        <real value="1.5207475048"/>
-                      </c0>
-                      <c1>
-                        <angle value="-140.194427"/>
-                      </c1>
-                    </radial_composite>
-                  </c5>
-                  <c6>
-                    <radial_composite type="vector">
-                      <c0>
-                        <real value="1.1014560791"/>
-                      </c0>
-                      <c1>
-                        <angle value="135.000000"/>
-                      </c1>
-                    </radial_composite>
-                  </c6>
-                </composite>
-              </entry>
-              <entry>
-                <composite type="bline_point">
-                  <c1>
-                    <vector>
-                      <x>1.1358184814</x>
-                      <y>1.8822140694</y>
-                    </vector>
-                  </c1>
-                  <c2>
-                    <real value="1.0000000000"/>
-                  </c2>
-                  <c3>
-                    <real value="0.5000000000"/>
-                  </c3>
-                  <c4>
-                    <bool value="true"/>
-                  </c4>
-                  <c5>
-                    <radial_composite type="vector">
-                      <c0>
-                        <real value="1.1014560791"/>
-                      </c0>
-                      <c1>
-                        <angle value="135.000000"/>
-                      </c1>
-                    </radial_composite>
-                  </c5>
-                  <c6>
-                    <radial_composite type="vector">
-                      <c0>
-                        <real value="0.7788470627"/>
-                      </c0>
-                      <c1>
-                        <angle value="0.000000"/>
-                      </c1>
-                    </radial_composite>
-                  </c6>
-                </composite>
-              </entry>
-              <entry>
-                <composite type="bline_point">
-                  <c1>
-                    <vector>
-                      <x>1.7848576307</x>
-                      <y>1.8822140694</y>
-                    </vector>
-                  </c1>
-                  <c2>
-                    <real value="1.0000000000"/>
-                  </c2>
-                  <c3>
-                    <real value="0.5000000000"/>
-                  </c3>
-                  <c4>
-                    <bool value="true"/>
-                  </c4>
-                  <c5>
-                    <radial_composite type="vector">
-                      <c0>
-                        <real value="0.3894235314"/>
-                      </c0>
-                      <c1>
-                        <angle value="0.000000"/>
-                      </c1>
-                    </radial_composite>
-                  </c5>
-                  <c6>
-                    <radial_composite type="vector">
-                      <c0>
-                        <real value="0.1947060299"/>
-                      </c0>
-                      <c1>
-                        <angle value="90.001968"/>
-                      </c1>
-                    </radial_composite>
-                  </c6>
-                </composite>
-              </entry>
-              <entry>
-                <composite type="bline_point">
-                  <c1>
-                    <vector>
-                      <x>1.7848598957</x>
-                      <y>2.2716398239</y>
-                    </vector>
-                  </c1>
-                  <c2>
-                    <real value="1.0000000000"/>
-                  </c2>
-                  <c3>
-                    <real value="0.5000000000"/>
-                  </c3>
-                  <c4>
-                    <bool value="true"/>
-                  </c4>
-                  <c5>
-                    <radial_composite type="vector">
-                      <c0>
-                        <real value="0.3894300570"/>
-                      </c0>
-                      <c1>
-                        <angle value="89.999016"/>
-                      </c1>
-                    </radial_composite>
-                  </c5>
-                  <c6>
-                    <radial_composite type="vector">
-                      <c0>
-                        <real value="0.9735599756"/>
-                      </c0>
-                      <c1>
-                        <angle value="90.000000"/>
-                      </c1>
-                    </radial_composite>
-                  </c6>
-                </composite>
-              </entry>
-              <entry>
-                <composite type="bline_point">
-                  <c1>
-                    <vector>
-                      <x>1.1358184814</x>
-                      <y>2.5312533379</y>
-                    </vector>
-                  </c1>
-                  <c2>
-                    <real value="1.0000000000"/>
-                  </c2>
-                  <c3>
-                    <real value="0.5000000000"/>
-                  </c3>
-                  <c4>
-                    <bool value="true"/>
-                  </c4>
-                  <c5>
-                    <radial_composite type="vector">
-                      <c0>
-                        <real value="1.9471199512"/>
-                      </c0>
-                      <c1>
-                        <angle value="-180.000000"/>
-                      </c1>
-                    </radial_composite>
-                  </c5>
-                  <c6>
-                    <radial_composite type="vector">
-                      <c0>
-                        <real value="0.4867799878"/>
-                      </c0>
-                      <c1>
-                        <angle value="90.000000"/>
-                      </c1>
-                    </radial_composite>
-                  </c6>
-                </composite>
-              </entry>
-            </bline>
-          </param>
-        </layer>
-        <layer type="outline" active="true" version="0.2" desc="Arrow Outline">
-          <param name="z_depth">
-            <real value="0.0000000000"/>
-          </param>
-          <param name="amount">
-            <real value="1.0000000000"/>
-          </param>
-          <param name="blend_method">
-            <integer value="0"/>
-          </param>
-          <param name="color">
-            <color>
-              <r>0.011238</r>
-              <g>0.065656</g>
-              <b>0.247404</b>
-              <a>1.000000</a>
-            </color>
-          </param>
-          <param name="offset">
-            <vector guid="80F6181CA1918EAE33C34EC82856397B">
-              <x>0.1622599959</x>
-              <y>-0.3245199919</y>
-            </vector>
-          </param>
-          <param name="invert">
-            <bool value="false"/>
-          </param>
-          <param name="antialias">
-            <bool value="true"/>
-          </param>
-          <param name="feather">
-            <real value="0.0000000000"/>
-          </param>
-          <param name="blurtype">
-            <integer value="1"/>
-          </param>
-          <param name="bline">
-            <bline type="bline_point" loop="true" guid="E3A6EF8C8CDADE2362FFDE8ABF503B65">
-              <entry>
-                <composite type="bline_point">
-                  <c1>
-                    <vector>
-                      <x>1.1358199120</x>
-                      <y>2.9206800461</y>
-                    </vector>
-                  </c1>
-                  <c2>
-                    <real value="1.0000000000"/>
-                  </c2>
-                  <c3>
-                    <real value="0.5000000000"/>
-                  </c3>
-                  <c4>
-                    <bool value="true"/>
-                  </c4>
-                  <c5>
-                    <radial_composite type="vector">
-                      <c0>
-                        <real value="1.4603399634"/>
-                      </c0>
-                      <c1>
-                        <angle value="90.000000"/>
-                      </c1>
-                    </radial_composite>
-                  </c5>
-                  <c6>
-                    <radial_composite type="vector">
-                      <c0>
-                        <real value="2.7259603095"/>
-                      </c0>
-                      <c1>
-                        <angle value="-0.000200"/>
-                      </c1>
-                    </radial_composite>
-                  </c6>
-                </composite>
-              </entry>
-              <entry>
-                <composite type="bline_point">
-                  <c1>
-                    <vector>
-                      <x>2.1742811203</x>
-                      <y>2.4014453888</y>
-                    </vector>
-                  </c1>
-                  <c2>
-                    <real value="1.0000000000"/>
-                  </c2>
-                  <c3>
-                    <real value="0.5000000000"/>
-                  </c3>
-                  <c4>
-                    <bool value="true"/>
-                  </c4>
-                  <c5>
-                    <radial_composite type="vector">
-                      <c0>
-                        <real value="1.5576941254"/>
-                      </c0>
-                      <c1>
-                        <angle value="-90.000000"/>
-                      </c1>
-                    </radial_composite>
-                  </c5>
-                  <c6>
-                    <radial_composite type="vector">
-                      <c0>
-                        <real value="0.9735599756"/>
-                      </c0>
-                      <c1>
-                        <angle value="-90.000000"/>
-                      </c1>
-                    </radial_composite>
-                  </c6>
-                </composite>
-              </entry>
-              <entry>
-                <composite type="bline_point">
-                  <c1>
-                    <vector>
-                      <x>2.1742811203</x>
-                      <y>1.8822140694</y>
-                    </vector>
-                  </c1>
-                  <c2>
-                    <real value="1.0000000000"/>
-                  </c2>
-                  <c3>
-                    <real value="0.5000000000"/>
-                  </c3>
-                  <c4>
-                    <bool value="true"/>
-                  </c4>
-                  <c5>
-                    <radial_composite type="vector">
-                      <c0>
-                        <real value="0.3894235314"/>
-                      </c0>
-                      <c1>
-                        <angle value="-90.000000"/>
-                      </c1>
-                    </radial_composite>
-                  </c5>
-                  <c6>
-                    <radial_composite type="vector">
-                      <c0>
-                        <real value="0.3894235314"/>
-                      </c0>
-                      <c1>
-                        <angle value="0.000000"/>
-                      </c1>
-                    </radial_composite>
-                  </c6>
-                </composite>
-              </entry>
-              <entry>
-                <composite type="bline_point">
-                  <c1>
-                    <vector>
-                      <x>2.8233203888</x>
-                      <y>1.8822140694</y>
-                    </vector>
-                  </c1>
-                  <c2>
-                    <real value="1.0000000000"/>
-                  </c2>
-                  <c3>
-                    <real value="0.5000000000"/>
-                  </c3>
-                  <c4>
-                    <bool value="true"/>
-                  </c4>
-                  <c5>
-                    <radial_composite type="vector">
-                      <c0>
-                        <real value="0.3894235314"/>
-                      </c0>
-                      <c1>
-                        <angle value="0.000000"/>
-                      </c1>
-                    </radial_composite>
-                  </c5>
-                  <c6>
-                    <radial_composite type="vector">
-                      <c0>
-                        <real value="1.6521841187"/>
-                      </c0>
-                      <c1>
-                        <angle value="-135.000000"/>
-                      </c1>
-                    </radial_composite>
-                  </c6>
-                </composite>
-              </entry>
-              <entry>
-                <composite type="bline_point">
-                  <c1>
-                    <vector>
-                      <x>1.9795694351</x>
-                      <y>1.1033670902</y>
-                    </vector>
-                  </c1>
-                  <c2>
-                    <real value="1.0000000000"/>
-                  </c2>
-                  <c3>
-                    <real value="0.5000000000"/>
-                  </c3>
-                  <c4>
-                    <bool value="true"/>
-                  </c4>
-                  <c5>
-                    <radial_composite type="vector">
-                      <c0>
-                        <real value="1.5207475048"/>
-                      </c0>
-                      <c1>
-                        <angle value="-140.194427"/>
-                      </c1>
-                    </radial_composite>
-                  </c5>
-                  <c6>
-                    <radial_composite type="vector">
-                      <c0>
-                        <real value="1.1014560791"/>
-                      </c0>
-                      <c1>
-                        <angle value="135.000000"/>
-                      </c1>
-                    </radial_composite>
-                  </c6>
-                </composite>
-              </entry>
-              <entry>
-                <composite type="bline_point">
-                  <c1>
-                    <vector>
-                      <x>1.1358184814</x>
-                      <y>1.8822140694</y>
-                    </vector>
-                  </c1>
-                  <c2>
-                    <real value="1.0000000000"/>
-                  </c2>
-                  <c3>
-                    <real value="0.5000000000"/>
-                  </c3>
-                  <c4>
-                    <bool value="true"/>
-                  </c4>
-                  <c5>
-                    <radial_composite type="vector">
-                      <c0>
-                        <real value="1.1014560791"/>
-                      </c0>
-                      <c1>
-                        <angle value="135.000000"/>
-                      </c1>
-                    </radial_composite>
-                  </c5>
-                  <c6>
-                    <radial_composite type="vector">
-                      <c0>
-                        <real value="0.7788470627"/>
-                      </c0>
-                      <c1>
-                        <angle value="0.000000"/>
-                      </c1>
-                    </radial_composite>
-                  </c6>
-                </composite>
-              </entry>
-              <entry>
-                <composite type="bline_point">
-                  <c1>
-                    <vector>
-                      <x>1.7848576307</x>
-                      <y>1.8822140694</y>
-                    </vector>
-                  </c1>
-                  <c2>
-                    <real value="1.0000000000"/>
-                  </c2>
-                  <c3>
-                    <real value="0.5000000000"/>
-                  </c3>
-                  <c4>
-                    <bool value="true"/>
-                  </c4>
-                  <c5>
-                    <radial_composite type="vector">
-                      <c0>
-                        <real value="0.3894235314"/>
-                      </c0>
-                      <c1>
-                        <angle value="0.000000"/>
-                      </c1>
-                    </radial_composite>
-                  </c5>
-                  <c6>
-                    <radial_composite type="vector">
-                      <c0>
-                        <real value="0.1947060299"/>
-                      </c0>
-                      <c1>
-                        <angle value="90.001968"/>
-                      </c1>
-                    </radial_composite>
-                  </c6>
-                </composite>
-              </entry>
-              <entry>
-                <composite type="bline_point">
-                  <c1>
-                    <vector>
-                      <x>1.7848598957</x>
-                      <y>2.2716398239</y>
-                    </vector>
-                  </c1>
-                  <c2>
-                    <real value="1.0000000000"/>
-                  </c2>
-                  <c3>
-                    <real value="0.5000000000"/>
-                  </c3>
-                  <c4>
-                    <bool value="true"/>
-                  </c4>
-                  <c5>
-                    <radial_composite type="vector">
-                      <c0>
-                        <real value="0.3894300570"/>
-                      </c0>
-                      <c1>
-                        <angle value="89.999016"/>
-                      </c1>
-                    </radial_composite>
-                  </c5>
-                  <c6>
-                    <radial_composite type="vector">
-                      <c0>
-                        <real value="0.9735599756"/>
-                      </c0>
-                      <c1>
-                        <angle value="90.000000"/>
-                      </c1>
-                    </radial_composite>
-                  </c6>
-                </composite>
-              </entry>
-              <entry>
-                <composite type="bline_point">
-                  <c1>
-                    <vector>
-                      <x>1.1358184814</x>
-                      <y>2.5312533379</y>
-                    </vector>
-                  </c1>
-                  <c2>
-                    <real value="1.0000000000"/>
-                  </c2>
-                  <c3>
-                    <real value="0.5000000000"/>
-                  </c3>
-                  <c4>
-                    <bool value="true"/>
-                  </c4>
-                  <c5>
-                    <radial_composite type="vector">
-                      <c0>
-                        <real value="1.9471199512"/>
-                      </c0>
-                      <c1>
-                        <angle value="-180.000000"/>
-                      </c1>
-                    </radial_composite>
-                  </c5>
-                  <c6>
-                    <radial_composite type="vector">
-                      <c0>
-                        <real value="0.4867799878"/>
-                      </c0>
-                      <c1>
-                        <angle value="90.000000"/>
-                      </c1>
-                    </radial_composite>
-                  </c6>
-                </composite>
-              </entry>
-            </bline>
-          </param>
-          <param name="width">
-            <real value="0.1947117657"/>
-          </param>
-          <param name="expand">
-            <real value="0.0000000000"/>
-          </param>
-          <param name="sharp_cusps">
-            <bool value="true"/>
-          </param>
-          <param name="round_tip[0]">
-            <bool value="true"/>
-          </param>
-          <param name="round_tip[1]">
-            <bool value="true"/>
-          </param>
-          <param name="loopyness">
-            <real value="1.0000000000"/>
-          </param>
-          <param name="homogeneous_width">
-            <bool value="true"/>
-          </param>
-        </layer>
-      </canvas>
-    </param>
-    <param name="zoom">
-      <real value="0.0000000000"/>
-    </param>
-    <param name="time_offset">
-      <time value="0s"/>
-    </param>
-    <param name="children_lock">
-      <bool value="false"/>
-    </param>
-  </layer>
-</canvas>
index bd52099..f7fd175 100644 (file)
@@ -170,6 +170,7 @@ STATE_HH = \
        state_fill.h \
        state_gradient.h \
        state_normal.h \
+       state_null.h \
        state_polygon.h \
        state_rectangle.h \
        state_sketch.h \
@@ -177,7 +178,6 @@ STATE_HH = \
        state_star.h \
        state_stroke.h \
        state_text.h \
-       state_transform.h \
        state_width.h \
        state_zoom.h
 
@@ -189,6 +189,7 @@ STATE_CC = \
        state_fill.cpp \
        state_gradient.cpp \
        state_normal.cpp \
+       state_null.cpp \
        state_polygon.cpp \
        state_rectangle.cpp \
        state_sketch.cpp \
@@ -196,7 +197,6 @@ STATE_CC = \
        state_star.cpp \
        state_stroke.cpp \
        state_text.cpp \
-       state_transform.cpp \
        state_width.cpp \
        state_zoom.cpp
 
index 2485f81..4076a41 100644 (file)
@@ -92,7 +92,6 @@
 #include "state_star.h"
 #include "state_text.h"
 #include "state_width.h"
-#include "state_transform.h"
 #include "state_zoom.h"
 
 #include "devicetracker.h"
@@ -1293,7 +1292,6 @@ App::App(int *argc, char ***argv):
 
                /* editing tools */
                state_manager->add_state(&state_normal);
-               state_manager->add_state(&state_transform);
                state_manager->add_state(&state_smooth_move);
                studio_init_cb.task(_("Init ModMirror...")); module_list_.push_back(new ModMirror()); module_list_.back()->start();
                if(!getenv("SYNFIG_DISABLE_WIDTH"  )) state_manager->add_state(&state_width); // Enabled since 0.61.09
index 95fe556..e66b491 100644 (file)
@@ -82,6 +82,7 @@
 #include "dialog_color.h"
 #include "eventkey.h"
 
+#include "state_null.h"
 #include "state_polygon.h"
 #include "state_bline.h"
 #include "state_normal.h"
@@ -719,7 +720,7 @@ CanvasView::CanvasView(etl::loose_handle<Instance> instance,etl::handle<synfigap
        toggling_snap_grid=false;
        toggling_onion_skin=false;
 
-       smach_.set_default_state(&state_normal);
+       smach_.set_default_state(&state_null);
 
        disp_audio = new Widget_Sound();
 
index a96c817..3809a61 100644 (file)
@@ -53,7 +53,7 @@ using namespace studio;
 /* === M E T H O D S ======================================================= */
 
 Dialog_ToolOptions::Dialog_ToolOptions():
-       Dockable("tool_options",_("Tool Options"),Gtk::StockID("synfig-normal")),
+       Dockable("tool_options",_("Tool Options"),Gtk::StockID("synfig-null")),
        empty_label(_("This tool has no options"))
 {
        //scrolled_.add(sub_vbox_);
@@ -80,7 +80,7 @@ Dialog_ToolOptions::clear()
        set_widget(empty_label);
        empty_label.show();
 
-       set_stock_id(Gtk::StockID("synfig-normal"));
+       set_stock_id(Gtk::StockID("synfig-null"));
 }
 
 void
index 9d62cb6..fbf9115 100644 (file)
@@ -219,6 +219,7 @@ IconController::IconController(const synfig::String& /*basepath*/)
        INIT_STOCK_ICON_CLONE(cvs_revert,"gtk-revert",_("CVS Revert"));
 
        // Tools
+       INIT_STOCK_ICON(null,"null_icon."IMAGE_EXT,_("Null Tool"));
        INIT_STOCK_ICON(normal,"normal_icon."IMAGE_EXT,_("Normal Tool"));
        INIT_STOCK_ICON(transform,"transform_icon."IMAGE_EXT,_("Transform Tool"));
        INIT_STOCK_ICON(polygon,"polyline_icon."IMAGE_EXT,_("Polygon Tool"));
index a264423..36b9f8b 100644 (file)
@@ -6,7 +6,7 @@
 **
 **     \legal
 **     Copyright (c) 2002-2005 Robert B. Quattlebaum Jr., Adrian Bentley
-**     Copyright (c) 2007, 2008 Chris Moore
+**  Copyright (c) 2008 Chris Moore
 **
 **     This package is free software; you can redistribute it and/or
 **     modify it under the terms of the GNU General Public License as
 #      include <config.h>
 #endif
 
+#include <gtkmm/dialog.h>
+#include <gtkmm/entry.h>
+
+#include <synfig/valuenode_animated.h>
+#include <synfig/valuenode_composite.h>
+#include <synfig/valuenode_const.h>
+#include <synfig/valuenode_dynamiclist.h>
+#include <synfigapp/action_system.h>
+
 #include "state_normal.h"
+#include "canvasview.h"
 #include "workarea.h"
+#include "app.h"
+
+#include <synfigapp/action.h>
 #include "event_mouse.h"
 #include "event_layerclick.h"
 #include "toolbox.h"
 #include "dialog_tooloptions.h"
-#include <gtkmm/dialog.h>
-#include "widget_waypointmodel.h"
-#include <synfig/valuenode_animated.h>
-#include <synfig/valuenode_composite.h>
-#include <synfig/valuenode_const.h>
-#include "canvasview.h"
-#include "general.h"
+#include <gtkmm/optionmenu.h>
+#include "duck.h"
+#include <synfig/angle.h>
+#include <synfigapp/main.h>
 
+#include "general.h"
 #endif
 
 /* === U S I N G =========================================================== */
@@ -55,49 +66,106 @@ using namespace studio;
 
 /* === M A C R O S ========================================================= */
 
+#ifndef EPSILON
+#define EPSILON        0.0000001
+#endif
+
+/* === G L O B A L S ======================================================= */
+
+StateNormal studio::state_normal;
+
 /* === C L A S S E S & S T R U C T S ======================================= */
 
+class DuckDrag_Combo : public DuckDrag_Base
+{
+       synfig::Vector last_move;
+       synfig::Vector drag_offset;
+       synfig::Vector center;
+       synfig::Vector snap;
+
+       synfig::Angle original_angle;
+       synfig::Real original_mag;
+
+       std::vector<synfig::Vector> last_;
+       std::vector<synfig::Vector> positions;
+
+
+       bool bad_drag;
+       bool move_only;
+
+public:
+       etl::handle<CanvasView> canvas_view_;
+       bool scale;
+       bool rotate;
+       bool constrain;  
+       DuckDrag_Combo();
+       void begin_duck_drag(Duckmatic* duckmatic, const synfig::Vector& begin);
+       bool end_duck_drag(Duckmatic* duckmatic);
+       void duck_drag(Duckmatic* duckmatic, const synfig::Vector& vector);
+
+       etl::handle<synfigapp::CanvasInterface> get_canvas_interface()const{return canvas_view_->canvas_interface();}
+};
+
+
 class studio::StateNormal_Context : public sigc::trackable
 {
-       CanvasView *canvas_view;
+       etl::handle<CanvasView> canvas_view_;
+
+       synfigapp::Settings& settings;
+
+       sigc::connection keypress_connect;
+       sigc::connection keyrelease_connect;
+
+       etl::handle<DuckDrag_Combo> duck_dragger_;
+
+       Gtk::Table options_table;
 
-       CanvasView* get_canvas_view() { return canvas_view; }
-       Canvas::Handle get_canvas() { return canvas_view->get_canvas(); }
-       WorkArea* get_work_area() { return canvas_view->get_work_area(); }
-       etl::handle<synfigapp::CanvasInterface> get_canvas_interface() { return canvas_view->canvas_interface(); }
+       Gtk::CheckButton checkbutton_rotate;
+       Gtk::CheckButton checkbutton_scale;
+       Gtk::CheckButton checkbutton_constrain;
 
 public:
-       StateNormal_Context(CanvasView *canvas_view);
-       ~StateNormal_Context();
 
-       Smach::event_result event_stop_handler(const Smach::event& x);
+       bool get_rotate_flag()const { return checkbutton_rotate.get_active(); }
+       void set_rotate_flag(bool x) { checkbutton_rotate.set_active(x); refresh_rotate_flag(); }
+       void refresh_rotate_flag() { if(duck_dragger_)duck_dragger_->rotate=get_rotate_flag(); }
 
-       Smach::event_result event_refresh_handler(const Smach::event& x);
+       bool get_scale_flag()const { return checkbutton_scale.get_active(); }
+       void set_scale_flag(bool x) { checkbutton_scale.set_active(x); refresh_scale_flag(); }
+       void refresh_scale_flag() { if(duck_dragger_)duck_dragger_->scale=get_scale_flag(); }
 
-       Smach::event_result event_refresh_ducks_handler(const Smach::event& x);
+       bool get_constrain_flag()const { return checkbutton_constrain.get_active(); }
+       void set_constrain_flag(bool x) { checkbutton_constrain.set_active(x); refresh_constrain_flag(); }
+       void refresh_constrain_flag() { if(duck_dragger_)duck_dragger_->constrain=get_constrain_flag(); }
 
+       Smach::event_result event_stop_handler(const Smach::event& x);
+       Smach::event_result event_refresh_handler(const Smach::event& x);
+       Smach::event_result event_refresh_ducks_handler(const Smach::event& x);
        Smach::event_result event_undo_handler(const Smach::event& x);
-
        Smach::event_result event_redo_handler(const Smach::event& x);
-
        Smach::event_result event_mouse_button_down_handler(const Smach::event& x);
-
        Smach::event_result event_multiple_ducks_clicked_handler(const Smach::event& x);
-
        Smach::event_result event_refresh_tool_options(const Smach::event& x);
-
        Smach::event_result event_layer_click(const Smach::event& x);
 
-       void edit_several_waypoints(std::list<synfigapp::ValueDesc> value_desc_list);
-
        void refresh_tool_options();
-}; // END of class StateNormal_Context
 
-/* === G L O B A L S ======================================================= */
+       StateNormal_Context(CanvasView* canvas_view);
 
-StateNormal studio::state_normal;
+       ~StateNormal_Context();
+
+       const etl::handle<CanvasView>& get_canvas_view()const{return canvas_view_;}
+       etl::handle<synfigapp::CanvasInterface> get_canvas_interface()const{return canvas_view_->canvas_interface();}
+       synfig::Canvas::Handle get_canvas()const{return canvas_view_->get_canvas();}
+       WorkArea * get_work_area()const{return canvas_view_->get_work_area();}
 
-/* === P R O C E D U R E S ================================================= */
+       void load_settings();
+       void save_settings();
+
+       bool key_pressed(GdkEventKey *event);
+       bool key_released(GdkEventKey *event);
+
+};     // END of class StateNormal_Context
 
 /* === M E T H O D S ======================================================= */
 
@@ -119,24 +187,150 @@ StateNormal::~StateNormal()
 {
 }
 
-StateNormal_Context::StateNormal_Context(CanvasView *canvas_view):
-       canvas_view(canvas_view)
+void
+StateNormal_Context::load_settings()
 {
-       // synfig::info("Entered Normal State");
+       String value;
+
+       if(settings.get_value("normal.rotate",value) && value=="1")
+               set_rotate_flag(true);
+       else
+               set_rotate_flag(false);
+
+       if(settings.get_value("normal.scale",value) && value=="1")
+               set_scale_flag(true);
+       else
+               set_scale_flag(false);
+
+       if(settings.get_value("normal.constrain",value) && value=="1")
+               set_constrain_flag(true);
+       else
+               set_constrain_flag(false);
+
 }
 
-StateNormal_Context::~StateNormal_Context()
+void
+StateNormal_Context::save_settings()
 {
-       // synfig::info("Left Normal State");
+       settings.set_value("normal.rotate",get_rotate_flag()?"1":"0");
+       settings.set_value("normal.scale",get_scale_flag()?"1":"0");
+       settings.set_value("normal.constrain",get_constrain_flag()?"1":"0");
+}
+
+StateNormal_Context::StateNormal_Context(CanvasView* canvas_view):
+       canvas_view_(canvas_view),
+       settings(synfigapp::Main::get_selected_input_device()->settings()),
+       duck_dragger_(new DuckDrag_Combo()),
+       checkbutton_rotate(_("Rotate (Ctrl)")),
+       checkbutton_scale(_("Scale (Alt)")),
+       checkbutton_constrain(_("Constrain (Shift)"))
+{
+       duck_dragger_->canvas_view_=get_canvas_view();
+
+       // Set up the tool options dialog
+       options_table.attach(*manage(new Gtk::Label(_("Normal Tool"))), 0, 2, 0, 1, Gtk::EXPAND|Gtk::FILL, Gtk::EXPAND|Gtk::FILL, 0, 0);
+       options_table.attach(checkbutton_rotate,                                                        0, 2, 1, 2, Gtk::EXPAND|Gtk::FILL, Gtk::EXPAND|Gtk::FILL, 0, 0);
+       options_table.attach(checkbutton_scale,                                                 0, 2, 2, 3, Gtk::EXPAND|Gtk::FILL, Gtk::EXPAND|Gtk::FILL, 0, 0);
+       options_table.attach(checkbutton_constrain,                                                     0, 2, 3, 4, Gtk::EXPAND|Gtk::FILL, Gtk::EXPAND|Gtk::FILL, 0, 0);
+
+       checkbutton_rotate.signal_toggled().connect(sigc::mem_fun(*this,&StateNormal_Context::refresh_rotate_flag));
+       checkbutton_scale.signal_toggled().connect(sigc::mem_fun(*this,&StateNormal_Context::refresh_scale_flag));
+       checkbutton_constrain.signal_toggled().connect(sigc::mem_fun(*this,&StateNormal_Context::refresh_constrain_flag));
+
+
+       options_table.show_all();
+       refresh_tool_options();
+       //App::dialog_tool_options->set_widget(options_table);
+       App::dialog_tool_options->present();
+
+       get_work_area()->set_allow_layer_clicks(true);
+       get_work_area()->set_duck_dragger(duck_dragger_);
+
+       keypress_connect=get_work_area()->signal_key_press_event().connect(sigc::mem_fun(*this,&StateNormal_Context::key_pressed),false);
+       keyrelease_connect=get_work_area()->signal_key_release_event().connect(sigc::mem_fun(*this,&StateNormal_Context::key_released),false);
+
+//     get_canvas_view()->work_area->set_cursor(Gdk::CROSSHAIR);
+       get_canvas_view()->work_area->reset_cursor();
+
+       App::toolbox->refresh();
+
+       load_settings();
+       refresh_scale_flag();
+}
+
+bool
+StateNormal_Context::key_pressed(GdkEventKey *event)
+{
+       switch(event->keyval)
+       {
+               case GDK_Control_L:
+               case GDK_Control_R:
+                       set_rotate_flag(true);
+                       break;
+               case GDK_Alt_L:
+               case GDK_Alt_R:
+                       set_scale_flag(true);
+                       break;
+               case GDK_Shift_L:
+               case GDK_Shift_R:
+                       set_constrain_flag(true);
+                       break;
+               default:
+                       break;
+       }
+       return false; //Pass on the event to other handlers, just in case
+}
+
+bool
+StateNormal_Context::key_released(GdkEventKey *event)
+{
+       switch(event->keyval)
+       {
+               case GDK_Control_L:
+               case GDK_Control_R:
+                       set_rotate_flag(false);
+                       break;
+               case GDK_Alt_L:
+               case GDK_Alt_R:
+                       set_scale_flag(false);
+                       break;
+               case GDK_Shift_L:
+               case GDK_Shift_R:
+                       set_constrain_flag(false);
+                       break;
+               default:
+                       break;
+       }
+       return false; //Pass on the event to other handlers
 }
 
 void
 StateNormal_Context::refresh_tool_options()
 {
        App::dialog_tool_options->clear();
+       App::dialog_tool_options->set_widget(options_table);
+       App::dialog_tool_options->set_local_name(_("Normal Tool"));
        App::dialog_tool_options->set_name("normal");
 }
 
+
+
+StateNormal_Context::~StateNormal_Context()
+{
+       save_settings();
+
+       get_work_area()->clear_duck_dragger();
+       get_canvas_view()->work_area->reset_cursor();
+
+       keypress_connect.disconnect();
+       keyrelease_connect.disconnect();
+
+       App::dialog_tool_options->clear();
+
+       App::toolbox->refresh();
+}
+
+
 Smach::event_result
 StateNormal_Context::event_refresh_tool_options(const Smach::event& /*x*/)
 {
@@ -148,7 +342,7 @@ Smach::event_result
 StateNormal_Context::event_stop_handler(const Smach::event& /*x*/)
 {
        // synfig::info("STATE NORMAL: Received Stop Event");
-       canvas_view->stop();
+       canvas_view_->stop();
        return Smach::RESULT_ACCEPT;
 }
 
@@ -156,8 +350,8 @@ Smach::event_result
 StateNormal_Context::event_refresh_handler(const Smach::event& /*x*/)
 {
        // synfig::info("STATE NORMAL: Received Refresh Event");
-       canvas_view->rebuild_tables();
-       canvas_view->work_area->queue_render_preview();
+       canvas_view_->rebuild_tables();
+       canvas_view_->work_area->queue_render_preview();
        return Smach::RESULT_ACCEPT;
 }
 
@@ -165,7 +359,7 @@ Smach::event_result
 StateNormal_Context::event_refresh_ducks_handler(const Smach::event& /*x*/)
 {
        // synfig::info("STATE NORMAL: Received Refresh Ducks");
-       canvas_view->queue_rebuild_ducks();
+       canvas_view_->queue_rebuild_ducks();
        return Smach::RESULT_ACCEPT;
 }
 
@@ -173,7 +367,7 @@ Smach::event_result
 StateNormal_Context::event_undo_handler(const Smach::event& /*x*/)
 {
        // synfig::info("STATE NORMAL: Received Undo Event");
-       canvas_view->get_instance()->undo();
+       canvas_view_->get_instance()->undo();
        return Smach::RESULT_ACCEPT;
 }
 
@@ -181,7 +375,7 @@ Smach::event_result
 StateNormal_Context::event_redo_handler(const Smach::event& /*x*/)
 {
        // synfig::info("STATE NORMAL: Received Redo Event");
-       canvas_view->get_instance()->redo();
+       canvas_view_->get_instance()->redo();
        return Smach::RESULT_ACCEPT;
 }
 
@@ -195,7 +389,7 @@ StateNormal_Context::event_mouse_button_down_handler(const Smach::event& x)
        switch(event.button)
        {
        case BUTTON_RIGHT:
-               canvas_view->popup_main_menu();
+               canvas_view_->popup_main_menu();
                return Smach::RESULT_ACCEPT;
        default:
                return Smach::RESULT_OK;
@@ -220,26 +414,26 @@ StateNormal_Context::event_layer_click(const Smach::event& x)
        {
        case BUTTON_LEFT:
                if(!(event.modifier&Gdk::CONTROL_MASK))
-                       canvas_view->get_selection_manager()->clear_selected_layers();
+                       canvas_view_->get_selection_manager()->clear_selected_layers();
                if(event.layer)
                {
-                       std::list<Layer::Handle> layer_list(canvas_view->get_selection_manager()->get_selected_layers());
+                       std::list<Layer::Handle> layer_list(canvas_view_->get_selection_manager()->get_selected_layers());
                        std::set<Layer::Handle> layers(layer_list.begin(),layer_list.end());
                        if(layers.count(event.layer))
                        {
                                layers.erase(event.layer);
                                layer_list=std::list<Layer::Handle>(layers.begin(),layers.end());
-                               canvas_view->get_selection_manager()->clear_selected_layers();
-                               canvas_view->get_selection_manager()->set_selected_layers(layer_list);
+                               canvas_view_->get_selection_manager()->clear_selected_layers();
+                               canvas_view_->get_selection_manager()->set_selected_layers(layer_list);
                        }
                        else
                        {
-                               canvas_view->get_selection_manager()->set_selected_layer(event.layer);
+                               canvas_view_->get_selection_manager()->set_selected_layer(event.layer);
                        }
                }
                return Smach::RESULT_ACCEPT;
        case BUTTON_RIGHT:
-               canvas_view->popup_layer_menu(event.layer);
+               canvas_view_->popup_layer_menu(event.layer);
                return Smach::RESULT_ACCEPT;
        default:
                return Smach::RESULT_OK;
@@ -399,13 +593,13 @@ StateNormal_Context::event_multiple_ducks_clicked_handler(const Smach::event& /*
        Gtk::Menu *menu=manage(new Gtk::Menu());
        menu->signal_hide().connect(sigc::bind(sigc::ptr_fun(&delete_widget), menu));
 
-       canvas_view->get_instance()->make_param_menu(menu,canvas_view->get_canvas(),value_desc_list);
+       canvas_view_->get_instance()->make_param_menu(menu,canvas_view_->get_canvas(),value_desc_list);
 
        /*
        synfigapp::Action::ParamList param_list;
        param_list=get_canvas_interface()->generate_param_list(value_desc_list);
 
-       canvas_view->add_actions_to_menu(menu, param_list,synfigapp::Action::CATEGORY_VALUEDESC|synfigapp::Action::CATEGORY_VALUENODE);
+       canvas_view_->add_actions_to_menu(menu, param_list,synfigapp::Action::CATEGORY_VALUEDESC|synfigapp::Action::CATEGORY_VALUENODE);
 
        menu->items().push_back(Gtk::Menu_Helpers::MenuElem(_("Edit Waypoints"),
                sigc::bind(
@@ -421,3 +615,202 @@ StateNormal_Context::event_multiple_ducks_clicked_handler(const Smach::event& /*
 
        return Smach::RESULT_ACCEPT;
 }
+
+DuckDrag_Combo::DuckDrag_Combo():
+       scale(false),
+       rotate(false),
+       constrain(false) // Lock aspect for scale; smooth move for translate
+{
+}
+
+void
+DuckDrag_Combo::begin_duck_drag(Duckmatic* duckmatic, const synfig::Vector& offset)
+{
+       last_move=Vector(1,1);
+
+       const DuckList selected_ducks(duckmatic->get_selected_ducks());
+       DuckList::const_iterator iter;
+
+       bad_drag=false;
+
+               drag_offset=duckmatic->find_duck(offset)->get_trans_point();
+
+               //snap=drag_offset-duckmatic->snap_point_to_grid(drag_offset);
+               //snap=offset-drag_offset_;
+               snap=Vector(0,0);
+
+       // Calculate center
+       Point vmin(100000000,100000000);
+       Point vmax(-100000000,-100000000);
+       //std::set<etl::handle<Duck> >::iterator iter;
+       positions.clear();
+       int i;
+       for(i=0,iter=selected_ducks.begin();iter!=selected_ducks.end();++iter,i++)
+       {
+               Point p((*iter)->get_trans_point());
+               vmin[0]=min(vmin[0],p[0]);
+               vmin[1]=min(vmin[1],p[1]);
+               vmax[0]=max(vmax[0],p[0]);
+               vmax[1]=max(vmax[1],p[1]);
+               positions.push_back(p);
+       }
+       center=(vmin+vmax)*0.5;
+       if((vmin-vmax).mag()<=EPSILON)
+               move_only=true;
+       else
+               move_only=false;
+
+
+       synfig::Vector vect(offset-center);
+       original_angle=Angle::tan(vect[1],vect[0]);
+       original_mag=vect.mag();
+}
+
+
+void
+DuckDrag_Combo::duck_drag(Duckmatic* duckmatic, const synfig::Vector& vector)
+{
+       if (!duckmatic) return;
+
+       if(bad_drag)
+               return;
+
+       //std::set<etl::handle<Duck> >::iterator iter;
+       synfig::Vector vect;
+       if (move_only || (!scale && !rotate))
+               vect= duckmatic->snap_point_to_grid(vector)-drag_offset+snap;
+       else
+               vect= duckmatic->snap_point_to_grid(vector)-center+snap;
+
+       last_move=vect;
+
+       const DuckList selected_ducks(duckmatic->get_selected_ducks());
+       DuckList::const_iterator iter;
+
+       Time time(duckmatic->get_time());
+
+       int i;
+       if( move_only || (!scale && !rotate) )
+       {
+               for(i=0,iter=selected_ducks.begin();iter!=selected_ducks.end();++iter,i++)
+               {
+                       if((*iter)->get_type()==Duck::TYPE_VERTEX || (*iter)->get_type()==Duck::TYPE_POSITION)
+                               (*iter)->set_trans_point(positions[i]+vect, time);
+               }
+               for(i=0,iter=selected_ducks.begin();iter!=selected_ducks.end();++iter,i++)
+               {
+                       if((*iter)->get_type()!=Duck::TYPE_VERTEX&&(*iter)->get_type()!=Duck::TYPE_POSITION)
+                               (*iter)->set_trans_point(positions[i]+vect, time);
+               }
+               DuckList duck_list(duckmatic->get_duck_list());
+               for (iter=duck_list.begin(); iter!=duck_list.end(); ++iter)
+               {
+                       if ((*iter)->get_type() == Duck::TYPE_TANGENT || (*iter)->get_type() == Duck::TYPE_WIDTH)
+                       {
+                               (*iter)->update(time);
+                       }
+               }
+               return;
+       }
+
+       if (rotate)
+       {
+               Angle::tan angle(vect[1],vect[0]);
+               angle=original_angle-angle;
+               Real mag(vect.mag()/original_mag);
+               Real sine(Angle::sin(angle).get());
+               Real cosine(Angle::cos(angle).get());
+
+               for(i=0,iter=selected_ducks.begin();iter!=selected_ducks.end();++iter,i++)
+               {
+                       if((*iter)->get_type()!=Duck::TYPE_VERTEX&&(*iter)->get_type()!=Duck::TYPE_POSITION)continue;
+
+                       Vector x(positions[i]-center),p;
+
+                       p[0]=cosine*x[0]+sine*x[1];
+                       p[1]=-sine*x[0]+cosine*x[1];
+                       if(scale)p*=mag;
+                       p+=center;
+                       (*iter)->set_trans_point(p, time);
+               }
+               for(i=0,iter=selected_ducks.begin();iter!=selected_ducks.end();++iter,i++)
+               {
+                       if(!((*iter)->get_type()!=Duck::TYPE_VERTEX&&(*iter)->get_type()!=Duck::TYPE_POSITION))continue;
+
+                       Vector x(positions[i]-center),p;
+
+                       p[0]=cosine*x[0]+sine*x[1];
+                       p[1]=-sine*x[0]+cosine*x[1];
+                       if(scale)p*=mag;
+                       p+=center;
+                       (*iter)->set_trans_point(p, time);
+               }
+       } else if (scale)
+       {
+               if(!constrain)
+               {
+                       if(abs(drag_offset[0]-center[0])>EPSILON)
+                               vect[0]/=drag_offset[0]-center[0];
+                       else
+                               vect[0]=1;
+                       if(abs(drag_offset[1]-center[1])>EPSILON)
+                               vect[1]/=drag_offset[1]-center[1];
+                       else
+                               vect[1]=1;
+                       }
+               else
+               {
+                       //vect[0]=vect[1]=vect.mag()*0.707106781;
+                       Real amount(vect.mag()/(drag_offset-center).mag());
+                       vect[0]=vect[1]=amount;
+               }
+
+               if(vect[0]<EPSILON && vect[0]>-EPSILON)
+                       vect[0]=1;
+               if(vect[1]<EPSILON && vect[1]>-EPSILON)
+                       vect[1]=1;
+
+               for(i=0,iter=selected_ducks.begin();iter!=selected_ducks.end();++iter,i++)
+               {
+                       if(((*iter)->get_type()!=Duck::TYPE_VERTEX&&(*iter)->get_type()!=Duck::TYPE_POSITION))continue;
+
+                       Vector p(positions[i]-center);
+
+                       p[0]*=vect[0];
+                       p[1]*=vect[1];
+                       p+=center;
+                       (*iter)->set_trans_point(p, time);
+               }
+               for(i=0,iter=selected_ducks.begin();iter!=selected_ducks.end();++iter,i++)
+               {
+                       if(!((*iter)->get_type()!=Duck::TYPE_VERTEX&&(*iter)->get_type()!=Duck::TYPE_POSITION))continue;
+
+                       Vector p(positions[i]-center);
+
+                       p[0]*=vect[0];
+                       p[1]*=vect[1];
+                       p+=center;
+                       (*iter)->set_trans_point(p, time);
+               }
+       }
+       last_move=vect;
+}
+
+bool
+DuckDrag_Combo::end_duck_drag(Duckmatic* duckmatic)
+{
+       if(bad_drag)return false;
+
+       //synfigapp::Action::PassiveGrouper group(get_canvas_interface()->get_instance().get(),_("Rotate Ducks"));
+
+       if((last_move-Vector(1,1)).mag()>0.0001)
+       {
+               duckmatic->signal_edited_selected_ducks();
+               return true;
+       }
+       else
+       {
+               duckmatic->signal_user_click_selected_ducks(0);
+               return false;
+       }
+}
index 418dae0..5afacb6 100644 (file)
@@ -22,8 +22,8 @@
 
 /* === S T A R T =========================================================== */
 
-#ifndef __SYNFIG_STATE_NORMAL_H
-#define __SYNFIG_STATE_NORMAL_H
+#ifndef __SYNFIG_STUDIO_STATE_NORMAL_H
+#define __SYNFIG_STUDIO_STATE_NORMAL_H
 
 /* === H E A D E R S ======================================================= */
 
diff --git a/synfig-studio/src/gtkmm/state_null.cpp b/synfig-studio/src/gtkmm/state_null.cpp
new file mode 100644 (file)
index 0000000..98ad87e
--- /dev/null
@@ -0,0 +1,129 @@
+/* === S Y N F I G ========================================================= */
+/*!    \file state_null.cpp
+**     \brief Null State File
+**
+**     $Id$
+**
+**     \legal
+**     Copyright (c) 2002-2005 Robert B. Quattlebaum Jr., Adrian Bentley
+**     Copyright (c) 2007, 2008 Chris Moore
+**
+**     This package is free software; you can redistribute it and/or
+**     modify it under the terms of the GNU General Public License as
+**     published by the Free Software Foundation; either version 2 of
+**     the License, or (at your option) any later version.
+**
+**     This package 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
+**     General Public License for more details.
+**     \endlegal
+*/
+/* ========================================================================= */
+
+/* === H E A D E R S ======================================================= */
+
+#ifdef USING_PCH
+#      include "pch.h"
+#else
+#ifdef HAVE_CONFIG_H
+#      include <config.h>
+#endif
+
+#include "state_null.h"
+#include "workarea.h"
+#include "event_mouse.h"
+#include "event_layerclick.h"
+#include "toolbox.h"
+#include "dialog_tooloptions.h"
+#include <gtkmm/dialog.h>
+#include "widget_waypointmodel.h"
+#include <synfig/valuenode_animated.h>
+#include <synfig/valuenode_composite.h>
+#include <synfig/valuenode_const.h>
+#include "canvasview.h"
+#include "general.h"
+
+#endif
+
+/* === U S I N G =========================================================== */
+
+using namespace std;
+using namespace etl;
+using namespace synfig;
+using namespace studio;
+
+/* === M A C R O S ========================================================= */
+
+/* === G L O B A L S ======================================================= */
+
+StateNull studio::state_null;
+
+/* === C L A S S E S & S T R U C T S ======================================= */
+
+class studio::StateNull_Context : public sigc::trackable
+{
+       CanvasView *canvas_view;
+
+       CanvasView* get_canvas_view() { return canvas_view; }
+       Canvas::Handle get_canvas() { return canvas_view->get_canvas(); }
+       WorkArea* get_work_area() { return canvas_view->get_work_area(); }
+       etl::handle<synfigapp::CanvasInterface> get_canvas_interface() { return canvas_view->canvas_interface(); }
+
+       Gtk::Table options_table;
+
+public:
+       StateNull_Context(CanvasView *canvas_view);
+       ~StateNull_Context();
+
+       Smach::event_result event_refresh_tool_options(const Smach::event& x);
+
+       void refresh_tool_options();
+}; // END of class StateNull_Context
+
+/* === P R O C E D U R E S ================================================= */
+
+/* === M E T H O D S ======================================================= */
+
+StateNull::StateNull():
+       Smach::state<StateNull_Context>("null")
+{
+       insert(event_def(EVENT_REFRESH_TOOL_OPTIONS,&StateNull_Context::event_refresh_tool_options));
+}
+
+StateNull::~StateNull()
+{
+}
+
+StateNull_Context::StateNull_Context(CanvasView *canvas_view):
+       canvas_view(canvas_view)
+{
+       // Synfig Studio's default state is initialized in the canvas view constructor
+       // As a result, it cannot reference canvas view or workarea when created
+       // Other states need to reference the workarea,
+       //    so a null state was created to be the default
+
+       options_table.attach(*manage(new Gtk::Label(_("Welcome to Synfig Studio"))),    0, 2,  0,  1, Gtk::EXPAND|Gtk::FILL, Gtk::EXPAND|Gtk::FILL, 0, 0);
+       options_table.show_all();
+       refresh_tool_options();
+}
+
+StateNull_Context::~StateNull_Context()
+{
+}
+
+void
+StateNull_Context::refresh_tool_options()
+{
+       App::dialog_tool_options->clear();
+       App::dialog_tool_options->set_widget(options_table);
+       App::dialog_tool_options->set_local_name(_("Welcome to Synfig Studio"));
+       App::dialog_tool_options->set_name("null");
+}
+
+Smach::event_result
+StateNull_Context::event_refresh_tool_options(const Smach::event& /*x*/)
+{
+       refresh_tool_options();
+       return Smach::RESULT_ACCEPT;
+}
diff --git a/synfig-studio/src/gtkmm/state_null.h b/synfig-studio/src/gtkmm/state_null.h
new file mode 100644 (file)
index 0000000..7297655
--- /dev/null
@@ -0,0 +1,56 @@
+/* === S Y N F I G ========================================================= */
+/*!    \file state_null.h
+**     \brief Null State Header
+**
+**     $Id$
+**
+**     \legal
+**     Copyright (c) 2002-2005 Robert B. Quattlebaum Jr., Adrian Bentley
+**
+**     This package is free software; you can redistribute it and/or
+**     modify it under the terms of the GNU General Public License as
+**     published by the Free Software Foundation; either version 2 of
+**     the License, or (at your option) any later version.
+**
+**     This package 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
+**     General Public License for more details.
+**     \endlegal
+*/
+/* ========================================================================= */
+
+/* === S T A R T =========================================================== */
+
+#ifndef __SYNFIG_STATE_NULL_H
+#define __SYNFIG_STATE_NULL_H
+
+/* === H E A D E R S ======================================================= */
+
+#include "smach.h"
+
+
+/* === M A C R O S ========================================================= */
+
+/* === T Y P E D E F S ===================================================== */
+
+/* === C L A S S E S & S T R U C T S ======================================= */
+
+namespace studio {
+
+class StateNull_Context;
+
+class StateNull : public Smach::state<StateNull_Context>
+{
+public:
+       StateNull();
+       ~StateNull();
+}; // END of class StateNull
+
+extern StateNull state_null;
+
+}; // END of namespace studio
+
+/* === E N D =============================================================== */
+
+#endif
diff --git a/synfig-studio/src/gtkmm/state_transform.cpp b/synfig-studio/src/gtkmm/state_transform.cpp
deleted file mode 100644 (file)
index dee963e..0000000
+++ /dev/null
@@ -1,816 +0,0 @@
-/* === S Y N F I G ========================================================= */
-/*!    \file state_transform.cpp
-**     \brief Template File
-**
-**     $Id$
-**
-**     \legal
-**     Copyright (c) 2002-2005 Robert B. Quattlebaum Jr., Adrian Bentley
-**  Copyright (c) 2008 Chris Moore
-**
-**     This package is free software; you can redistribute it and/or
-**     modify it under the terms of the GNU General Public License as
-**     published by the Free Software Foundation; either version 2 of
-**     the License, or (at your option) any later version.
-**
-**     This package 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
-**     General Public License for more details.
-**     \endlegal
-*/
-/* ========================================================================= */
-
-/* === H E A D E R S ======================================================= */
-
-#ifdef USING_PCH
-#      include "pch.h"
-#else
-#ifdef HAVE_CONFIG_H
-#      include <config.h>
-#endif
-
-#include <gtkmm/dialog.h>
-#include <gtkmm/entry.h>
-
-#include <synfig/valuenode_animated.h>
-#include <synfig/valuenode_composite.h>
-#include <synfig/valuenode_const.h>
-#include <synfig/valuenode_dynamiclist.h>
-#include <synfigapp/action_system.h>
-
-#include "state_transform.h"
-#include "canvasview.h"
-#include "workarea.h"
-#include "app.h"
-
-#include <synfigapp/action.h>
-#include "event_mouse.h"
-#include "event_layerclick.h"
-#include "toolbox.h"
-#include "dialog_tooloptions.h"
-#include <gtkmm/optionmenu.h>
-#include "duck.h"
-#include <synfig/angle.h>
-#include <synfigapp/main.h>
-
-#include "general.h"
-#endif
-
-/* === U S I N G =========================================================== */
-
-using namespace std;
-using namespace etl;
-using namespace synfig;
-using namespace studio;
-
-/* === M A C R O S ========================================================= */
-
-#ifndef EPSILON
-#define EPSILON        0.0000001
-#endif
-
-/* === G L O B A L S ======================================================= */
-
-StateTransform studio::state_transform;
-
-/* === C L A S S E S & S T R U C T S ======================================= */
-
-class DuckDrag_Combo : public DuckDrag_Base
-{
-       synfig::Vector last_move;
-       synfig::Vector drag_offset;
-       synfig::Vector center;
-       synfig::Vector snap;
-
-       synfig::Angle original_angle;
-       synfig::Real original_mag;
-
-       std::vector<synfig::Vector> last_;
-       std::vector<synfig::Vector> positions;
-
-
-       bool bad_drag;
-       bool move_only;
-
-public:
-       etl::handle<CanvasView> canvas_view_;
-       bool scale;
-       bool rotate;
-       bool constrain;  
-       DuckDrag_Combo();
-       void begin_duck_drag(Duckmatic* duckmatic, const synfig::Vector& begin);
-       bool end_duck_drag(Duckmatic* duckmatic);
-       void duck_drag(Duckmatic* duckmatic, const synfig::Vector& vector);
-
-       etl::handle<synfigapp::CanvasInterface> get_canvas_interface()const{return canvas_view_->canvas_interface();}
-};
-
-
-class studio::StateTransform_Context : public sigc::trackable
-{
-       etl::handle<CanvasView> canvas_view_;
-
-       synfigapp::Settings& settings;
-
-       sigc::connection keypress_connect;
-       sigc::connection keyrelease_connect;
-
-       etl::handle<DuckDrag_Combo> duck_dragger_;
-
-       Gtk::Table options_table;
-
-       Gtk::CheckButton checkbutton_rotate;
-       Gtk::CheckButton checkbutton_scale;
-       Gtk::CheckButton checkbutton_constrain;
-
-public:
-
-       bool get_rotate_flag()const { return checkbutton_rotate.get_active(); }
-       void set_rotate_flag(bool x) { checkbutton_rotate.set_active(x); refresh_rotate_flag(); }
-       void refresh_rotate_flag() { if(duck_dragger_)duck_dragger_->rotate=get_rotate_flag(); }
-
-       bool get_scale_flag()const { return checkbutton_scale.get_active(); }
-       void set_scale_flag(bool x) { checkbutton_scale.set_active(x); refresh_scale_flag(); }
-       void refresh_scale_flag() { if(duck_dragger_)duck_dragger_->scale=get_scale_flag(); }
-
-       bool get_constrain_flag()const { return checkbutton_constrain.get_active(); }
-       void set_constrain_flag(bool x) { checkbutton_constrain.set_active(x); refresh_constrain_flag(); }
-       void refresh_constrain_flag() { if(duck_dragger_)duck_dragger_->constrain=get_constrain_flag(); }
-
-       Smach::event_result event_stop_handler(const Smach::event& x);
-       Smach::event_result event_refresh_handler(const Smach::event& x);
-       Smach::event_result event_refresh_ducks_handler(const Smach::event& x);
-       Smach::event_result event_undo_handler(const Smach::event& x);
-       Smach::event_result event_redo_handler(const Smach::event& x);
-       Smach::event_result event_mouse_button_down_handler(const Smach::event& x);
-       Smach::event_result event_multiple_ducks_clicked_handler(const Smach::event& x);
-       Smach::event_result event_refresh_tool_options(const Smach::event& x);
-       Smach::event_result event_layer_click(const Smach::event& x);
-
-       void refresh_tool_options();
-
-       StateTransform_Context(CanvasView* canvas_view);
-
-       ~StateTransform_Context();
-
-       const etl::handle<CanvasView>& get_canvas_view()const{return canvas_view_;}
-       etl::handle<synfigapp::CanvasInterface> get_canvas_interface()const{return canvas_view_->canvas_interface();}
-       synfig::Canvas::Handle get_canvas()const{return canvas_view_->get_canvas();}
-       WorkArea * get_work_area()const{return canvas_view_->get_work_area();}
-
-       void load_settings();
-       void save_settings();
-
-       bool key_pressed(GdkEventKey *event);
-       bool key_released(GdkEventKey *event);
-
-};     // END of class StateTransform_Context
-
-/* === M E T H O D S ======================================================= */
-
-StateTransform::StateTransform():
-       Smach::state<StateTransform_Context>("transform")
-{
-       insert(event_def(EVENT_STOP,&StateTransform_Context::event_stop_handler));
-       insert(event_def(EVENT_REFRESH,&StateTransform_Context::event_refresh_handler));
-       insert(event_def(EVENT_REFRESH_DUCKS,&StateTransform_Context::event_refresh_ducks_handler));
-       insert(event_def(EVENT_UNDO,&StateTransform_Context::event_undo_handler));
-       insert(event_def(EVENT_REDO,&StateTransform_Context::event_redo_handler));
-       insert(event_def(EVENT_WORKAREA_MOUSE_BUTTON_DOWN,&StateTransform_Context::event_mouse_button_down_handler));
-       insert(event_def(EVENT_WORKAREA_MULTIPLE_DUCKS_CLICKED,&StateTransform_Context::event_multiple_ducks_clicked_handler));
-       insert(event_def(EVENT_REFRESH_TOOL_OPTIONS,&StateTransform_Context::event_refresh_tool_options));
-       insert(event_def(EVENT_WORKAREA_LAYER_CLICKED,&StateTransform_Context::event_layer_click));
-}
-
-StateTransform::~StateTransform()
-{
-}
-
-void
-StateTransform_Context::load_settings()
-{
-       String value;
-
-       if(settings.get_value("transform.rotate",value) && value=="1")
-               set_rotate_flag(true);
-       else
-               set_rotate_flag(false);
-
-       if(settings.get_value("transform.scale",value) && value=="1")
-               set_scale_flag(true);
-       else
-               set_scale_flag(false);
-
-       if(settings.get_value("transform.constrain",value) && value=="1")
-               set_constrain_flag(true);
-       else
-               set_constrain_flag(false);
-
-}
-
-void
-StateTransform_Context::save_settings()
-{
-       settings.set_value("transform.rotate",get_rotate_flag()?"1":"0");
-       settings.set_value("transform.scale",get_scale_flag()?"1":"0");
-       settings.set_value("transform.constrain",get_constrain_flag()?"1":"0");
-}
-
-StateTransform_Context::StateTransform_Context(CanvasView* canvas_view):
-       canvas_view_(canvas_view),
-       settings(synfigapp::Main::get_selected_input_device()->settings()),
-       duck_dragger_(new DuckDrag_Combo()),
-       checkbutton_rotate(_("Rotate (Ctrl)")),
-       checkbutton_scale(_("Scale (Alt)")),
-       checkbutton_constrain(_("Constrain (Shift)"))
-{
-       duck_dragger_->canvas_view_=get_canvas_view();
-
-       // Set up the tool options dialog
-       options_table.attach(*manage(new Gtk::Label(_("Transform Tool"))),      0, 2, 0, 1, Gtk::EXPAND|Gtk::FILL, Gtk::EXPAND|Gtk::FILL, 0, 0);
-       options_table.attach(checkbutton_rotate,                                                        0, 2, 1, 2, Gtk::EXPAND|Gtk::FILL, Gtk::EXPAND|Gtk::FILL, 0, 0);
-       options_table.attach(checkbutton_scale,                                                 0, 2, 2, 3, Gtk::EXPAND|Gtk::FILL, Gtk::EXPAND|Gtk::FILL, 0, 0);
-       options_table.attach(checkbutton_constrain,                                                     0, 2, 3, 4, Gtk::EXPAND|Gtk::FILL, Gtk::EXPAND|Gtk::FILL, 0, 0);
-
-       checkbutton_rotate.signal_toggled().connect(sigc::mem_fun(*this,&StateTransform_Context::refresh_rotate_flag));
-       checkbutton_scale.signal_toggled().connect(sigc::mem_fun(*this,&StateTransform_Context::refresh_scale_flag));
-       checkbutton_constrain.signal_toggled().connect(sigc::mem_fun(*this,&StateTransform_Context::refresh_constrain_flag));
-
-
-       options_table.show_all();
-       refresh_tool_options();
-       //App::dialog_tool_options->set_widget(options_table);
-       App::dialog_tool_options->present();
-
-       get_work_area()->set_allow_layer_clicks(true);
-       get_work_area()->set_duck_dragger(duck_dragger_);
-
-       keypress_connect=get_work_area()->signal_key_press_event().connect(sigc::mem_fun(*this,&StateTransform_Context::key_pressed),false);
-       keyrelease_connect=get_work_area()->signal_key_release_event().connect(sigc::mem_fun(*this,&StateTransform_Context::key_released),false);
-
-//     get_canvas_view()->work_area->set_cursor(Gdk::CROSSHAIR);
-       get_canvas_view()->work_area->reset_cursor();
-
-       App::toolbox->refresh();
-
-       load_settings();
-       refresh_scale_flag();
-}
-
-bool
-StateTransform_Context::key_pressed(GdkEventKey *event)
-{
-       switch(event->keyval)
-       {
-               case GDK_Control_L:
-               case GDK_Control_R:
-                       set_rotate_flag(true);
-                       break;
-               case GDK_Alt_L:
-               case GDK_Alt_R:
-                       set_scale_flag(true);
-                       break;
-               case GDK_Shift_L:
-               case GDK_Shift_R:
-                       set_constrain_flag(true);
-                       break;
-               default:
-                       break;
-       }
-       return false; //Pass on the event to other handlers, just in case
-}
-
-bool
-StateTransform_Context::key_released(GdkEventKey *event)
-{
-       switch(event->keyval)
-       {
-               case GDK_Control_L:
-               case GDK_Control_R:
-                       set_rotate_flag(false);
-                       break;
-               case GDK_Alt_L:
-               case GDK_Alt_R:
-                       set_scale_flag(false);
-                       break;
-               case GDK_Shift_L:
-               case GDK_Shift_R:
-                       set_constrain_flag(false);
-                       break;
-               default:
-                       break;
-       }
-       return false; //Pass on the event to other handlers
-}
-
-void
-StateTransform_Context::refresh_tool_options()
-{
-       App::dialog_tool_options->clear();
-       App::dialog_tool_options->set_widget(options_table);
-       App::dialog_tool_options->set_local_name(_("Transform Tool"));
-       App::dialog_tool_options->set_name("transform");
-}
-
-
-
-StateTransform_Context::~StateTransform_Context()
-{
-       save_settings();
-
-       get_work_area()->clear_duck_dragger();
-       get_canvas_view()->work_area->reset_cursor();
-
-       keypress_connect.disconnect();
-       keyrelease_connect.disconnect();
-
-       App::dialog_tool_options->clear();
-
-       App::toolbox->refresh();
-}
-
-
-Smach::event_result
-StateTransform_Context::event_refresh_tool_options(const Smach::event& /*x*/)
-{
-       refresh_tool_options();
-       return Smach::RESULT_ACCEPT;
-}
-
-Smach::event_result
-StateTransform_Context::event_stop_handler(const Smach::event& /*x*/)
-{
-       // synfig::info("STATE TRANSFORM: Received Stop Event");
-       canvas_view_->stop();
-       return Smach::RESULT_ACCEPT;
-}
-
-Smach::event_result
-StateTransform_Context::event_refresh_handler(const Smach::event& /*x*/)
-{
-       // synfig::info("STATE TRANSFORM: Received Refresh Event");
-       canvas_view_->rebuild_tables();
-       canvas_view_->work_area->queue_render_preview();
-       return Smach::RESULT_ACCEPT;
-}
-
-Smach::event_result
-StateTransform_Context::event_refresh_ducks_handler(const Smach::event& /*x*/)
-{
-       // synfig::info("STATE TRANSFORM: Received Refresh Ducks");
-       canvas_view_->queue_rebuild_ducks();
-       return Smach::RESULT_ACCEPT;
-}
-
-Smach::event_result
-StateTransform_Context::event_undo_handler(const Smach::event& /*x*/)
-{
-       // synfig::info("STATE TRANSFORM: Received Undo Event");
-       canvas_view_->get_instance()->undo();
-       return Smach::RESULT_ACCEPT;
-}
-
-Smach::event_result
-StateTransform_Context::event_redo_handler(const Smach::event& /*x*/)
-{
-       // synfig::info("STATE TRANSFORM: Received Redo Event");
-       canvas_view_->get_instance()->redo();
-       return Smach::RESULT_ACCEPT;
-}
-
-Smach::event_result
-StateTransform_Context::event_mouse_button_down_handler(const Smach::event& x)
-{
-       // synfig::info("STATE TRANSFORM: Received mouse button down Event");
-
-       const EventMouse& event(*reinterpret_cast<const EventMouse*>(&x));
-
-       switch(event.button)
-       {
-       case BUTTON_RIGHT:
-               canvas_view_->popup_main_menu();
-               return Smach::RESULT_ACCEPT;
-       default:
-               return Smach::RESULT_OK;
-       }
-}
-
-Smach::event_result
-StateTransform_Context::event_layer_click(const Smach::event& x)
-{
-       const EventLayerClick& event(*reinterpret_cast<const EventLayerClick*>(&x));
-
-       if(event.layer)
-       {
-               // synfig::info("STATE TRANSFORM: Received layer click Event, \"%s\"",event.layer->get_name().c_str());
-       }
-       else
-       {
-               // synfig::info("STATE TRANSFORM: Received layer click Event with an empty layer.");
-       }
-
-       switch(event.button)
-       {
-       case BUTTON_LEFT:
-               if(!(event.modifier&Gdk::CONTROL_MASK))
-                       canvas_view_->get_selection_manager()->clear_selected_layers();
-               if(event.layer)
-               {
-                       std::list<Layer::Handle> layer_list(canvas_view_->get_selection_manager()->get_selected_layers());
-                       std::set<Layer::Handle> layers(layer_list.begin(),layer_list.end());
-                       if(layers.count(event.layer))
-                       {
-                               layers.erase(event.layer);
-                               layer_list=std::list<Layer::Handle>(layers.begin(),layers.end());
-                               canvas_view_->get_selection_manager()->clear_selected_layers();
-                               canvas_view_->get_selection_manager()->set_selected_layers(layer_list);
-                       }
-                       else
-                       {
-                               canvas_view_->get_selection_manager()->set_selected_layer(event.layer);
-                       }
-               }
-               return Smach::RESULT_ACCEPT;
-       case BUTTON_RIGHT:
-               canvas_view_->popup_layer_menu(event.layer);
-               return Smach::RESULT_ACCEPT;
-       default:
-               return Smach::RESULT_OK;
-       }
-}
-
-/*
-void
-StateTransform_Context::edit_several_waypoints(std::list<synfigapp::ValueDesc> value_desc_list)
-{
-       Gtk::Dialog dialog(
-               "Edit Multiple Waypoints",              // Title
-               true,           // Modal
-               true            // use_separator
-       );
-
-       Widget_WaypointModel widget_waypoint_model;
-       widget_waypoint_model.show();
-
-       dialog.get_vbox()->pack_start(widget_waypoint_model);
-
-
-       dialog.add_button(Gtk::StockID("gtk-apply"),1);
-       dialog.add_button(Gtk::StockID("gtk-cancel"),0);
-       dialog.show();
-
-       if(dialog.run()==0)
-               return;
-       synfigapp::Action::PassiveGrouper group(get_canvas_interface()->get_instance().get(),_("Set Waypoints"));
-
-       std::list<synfigapp::ValueDesc>::iterator iter;
-       for(iter=value_desc_list.begin();iter!=value_desc_list.end();++iter)
-       {
-               synfigapp::ValueDesc value_desc(*iter);
-
-               if(!value_desc.is_valid())
-                       continue;
-
-               ValueNode_Animated::Handle value_node;
-
-               // If this value isn't a ValueNode_Animated, but
-               // it is somewhat constant, then go ahead and convert
-               // it to a ValueNode_Animated.
-               if(!value_desc.is_value_node() || ValueNode_Const::Handle::cast_dynamic(value_desc.get_value_node()))
-               {
-                       ValueBase value;
-                       if(value_desc.is_value_node())
-                               value=ValueNode_Const::Handle::cast_dynamic(value_desc.get_value_node())->get_value();
-                       else
-                               value=value_desc.get_value();
-
-                       value_node=ValueNode_Animated::create(value,get_canvas()->get_time());
-
-                       synfigapp::Action::Handle action;
-
-                       if(!value_desc.is_value_node())
-                       {
-                               action=synfigapp::Action::create("ValueDescConnect");
-                               action->set_param("dest",value_desc);
-                               action->set_param("src",ValueNode::Handle(value_node));
-                       }
-                       else
-                       {
-                               action=synfigapp::Action::create("ValueNodeReplace");
-                               action->set_param("dest",value_desc.get_value_node());
-                               action->set_param("src",ValueNode::Handle(value_node));
-                       }
-
-                       action->set_param("canvas",get_canvas());
-                       action->set_param("canvas_interface",get_canvas_interface());
-
-
-                       if(!get_canvas_interface()->get_instance()->perform_action(action))
-                       {
-                               get_canvas_view()->get_ui_interface()->error(_("Unable to convert to animated waypoint"));
-                               group.cancel();
-                               return;
-                       }
-               }
-               else
-               {
-                       if(value_desc.is_value_node())
-                               value_node=ValueNode_Animated::Handle::cast_dynamic(value_desc.get_value_node());
-               }
-
-
-               if(value_node)
-               {
-
-                       synfigapp::Action::Handle action(synfigapp::Action::create("WaypointSetSmart"));
-
-                       if(!action)
-                       {
-                               get_canvas_view()->get_ui_interface()->error(_("Unable to find WaypointSetSmart action"));
-                               group.cancel();
-                               return;
-                       }
-
-
-                       action->set_param("canvas",get_canvas());
-                       action->set_param("canvas_interface",get_canvas_interface());
-                       action->set_param("value_node",ValueNode::Handle(value_node));
-                       action->set_param("time",get_canvas()->get_time());
-                       action->set_param("model",widget_waypoint_model.get_waypoint_model());
-
-                       if(!get_canvas_interface()->get_instance()->perform_action(action))
-                       {
-                               get_canvas_view()->get_ui_interface()->error(_("Unable to set a specific waypoint"));
-                               group.cancel();
-                               return;
-                       }
-               }
-               else
-               {
-                       //get_canvas_view()->get_ui_interface()->error(_("Unable to animate a specific valuedesc"));
-                       //group.cancel();
-                       //return;
-               }
-
-       }
-}
-*/
-
-Smach::event_result
-StateTransform_Context::event_multiple_ducks_clicked_handler(const Smach::event& /*x*/)
-{
-       // synfig::info("STATE TRANSFORM: Received multiple duck click event");
-
-       //const EventMouse& event(*reinterpret_cast<const EventMouse*>(&x));
-
-       std::list<synfigapp::ValueDesc> value_desc_list;
-
-       // Create a list of value_descs associated with selection
-       const DuckList selected_ducks(get_work_area()->get_selected_ducks());
-       DuckList::const_iterator iter;
-       for(iter=selected_ducks.begin();iter!=selected_ducks.end();++iter)
-       {
-               synfigapp::ValueDesc value_desc((*iter)->get_value_desc());
-
-               if(!value_desc.is_valid())
-                       continue;
-
-               if(value_desc.get_value_type()==ValueBase::TYPE_BLINEPOINT && value_desc.is_value_node() && ValueNode_Composite::Handle::cast_dynamic(value_desc.get_value_node()))
-               {
-                       value_desc_list.push_back(
-                               synfigapp::ValueDesc(
-                                       ValueNode_Composite::Handle::cast_dynamic(value_desc.get_value_node())
-                                       ,ValueNode_Composite::Handle::cast_dynamic(value_desc.get_value_node())
-                                                               ->get_link_index_from_name("point")
-                               )
-                       );
-               }
-               else
-                       value_desc_list.push_back(value_desc);
-       }
-
-       Gtk::Menu *menu=manage(new Gtk::Menu());
-       menu->signal_hide().connect(sigc::bind(sigc::ptr_fun(&delete_widget), menu));
-
-       canvas_view_->get_instance()->make_param_menu(menu,canvas_view_->get_canvas(),value_desc_list);
-
-       /*
-       synfigapp::Action::ParamList param_list;
-       param_list=get_canvas_interface()->generate_param_list(value_desc_list);
-
-       canvas_view_->add_actions_to_menu(menu, param_list,synfigapp::Action::CATEGORY_VALUEDESC|synfigapp::Action::CATEGORY_VALUENODE);
-
-       menu->items().push_back(Gtk::Menu_Helpers::MenuElem(_("Edit Waypoints"),
-               sigc::bind(
-                       sigc::mem_fun(
-                               *this,
-                               &studio::StateTransform_Context::edit_several_waypoints
-                       ),
-                       value_desc_list
-               )
-       ));
-       */
-       menu->popup(3,gtk_get_current_event_time());
-
-       return Smach::RESULT_ACCEPT;
-}
-
-DuckDrag_Combo::DuckDrag_Combo():
-       scale(false),
-       rotate(false),
-       constrain(false) // Lock aspect for scale; smooth move for translate
-{
-}
-
-void
-DuckDrag_Combo::begin_duck_drag(Duckmatic* duckmatic, const synfig::Vector& offset)
-{
-       last_move=Vector(1,1);
-
-       const DuckList selected_ducks(duckmatic->get_selected_ducks());
-       DuckList::const_iterator iter;
-
-       bad_drag=false;
-
-               drag_offset=duckmatic->find_duck(offset)->get_trans_point();
-
-               //snap=drag_offset-duckmatic->snap_point_to_grid(drag_offset);
-               //snap=offset-drag_offset_;
-               snap=Vector(0,0);
-
-       // Calculate center
-       Point vmin(100000000,100000000);
-       Point vmax(-100000000,-100000000);
-       //std::set<etl::handle<Duck> >::iterator iter;
-       positions.clear();
-       int i;
-       for(i=0,iter=selected_ducks.begin();iter!=selected_ducks.end();++iter,i++)
-       {
-               Point p((*iter)->get_trans_point());
-               vmin[0]=min(vmin[0],p[0]);
-               vmin[1]=min(vmin[1],p[1]);
-               vmax[0]=max(vmax[0],p[0]);
-               vmax[1]=max(vmax[1],p[1]);
-               positions.push_back(p);
-       }
-       center=(vmin+vmax)*0.5;
-       if((vmin-vmax).mag()<=EPSILON)
-               move_only=true;
-       else
-               move_only=false;
-
-
-       synfig::Vector vect(offset-center);
-       original_angle=Angle::tan(vect[1],vect[0]);
-       original_mag=vect.mag();
-}
-
-
-void
-DuckDrag_Combo::duck_drag(Duckmatic* duckmatic, const synfig::Vector& vector)
-{
-       if (!duckmatic) return;
-
-       if(bad_drag)
-               return;
-
-       //std::set<etl::handle<Duck> >::iterator iter;
-       synfig::Vector vect;
-       if (move_only || (!scale && !rotate))
-               vect= duckmatic->snap_point_to_grid(vector)-drag_offset+snap;
-       else
-               vect= duckmatic->snap_point_to_grid(vector)-center+snap;
-
-       last_move=vect;
-
-       const DuckList selected_ducks(duckmatic->get_selected_ducks());
-       DuckList::const_iterator iter;
-
-       Time time(duckmatic->get_time());
-
-       int i;
-       if( move_only || (!scale && !rotate) )
-       {
-               for(i=0,iter=selected_ducks.begin();iter!=selected_ducks.end();++iter,i++)
-               {
-                       if((*iter)->get_type()==Duck::TYPE_VERTEX || (*iter)->get_type()==Duck::TYPE_POSITION)
-                               (*iter)->set_trans_point(positions[i]+vect, time);
-               }
-               for(i=0,iter=selected_ducks.begin();iter!=selected_ducks.end();++iter,i++)
-               {
-                       if((*iter)->get_type()!=Duck::TYPE_VERTEX&&(*iter)->get_type()!=Duck::TYPE_POSITION)
-                               (*iter)->set_trans_point(positions[i]+vect, time);
-               }
-               DuckList duck_list(duckmatic->get_duck_list());
-               for (iter=duck_list.begin(); iter!=duck_list.end(); ++iter)
-               {
-                       if ((*iter)->get_type() == Duck::TYPE_TANGENT || (*iter)->get_type() == Duck::TYPE_WIDTH)
-                       {
-                               (*iter)->update(time);
-                       }
-               }
-               return;
-       }
-
-       if (rotate)
-       {
-               Angle::tan angle(vect[1],vect[0]);
-               angle=original_angle-angle;
-               Real mag(vect.mag()/original_mag);
-               Real sine(Angle::sin(angle).get());
-               Real cosine(Angle::cos(angle).get());
-
-               for(i=0,iter=selected_ducks.begin();iter!=selected_ducks.end();++iter,i++)
-               {
-                       if((*iter)->get_type()!=Duck::TYPE_VERTEX&&(*iter)->get_type()!=Duck::TYPE_POSITION)continue;
-
-                       Vector x(positions[i]-center),p;
-
-                       p[0]=cosine*x[0]+sine*x[1];
-                       p[1]=-sine*x[0]+cosine*x[1];
-                       if(scale)p*=mag;
-                       p+=center;
-                       (*iter)->set_trans_point(p, time);
-               }
-               for(i=0,iter=selected_ducks.begin();iter!=selected_ducks.end();++iter,i++)
-               {
-                       if(!((*iter)->get_type()!=Duck::TYPE_VERTEX&&(*iter)->get_type()!=Duck::TYPE_POSITION))continue;
-
-                       Vector x(positions[i]-center),p;
-
-                       p[0]=cosine*x[0]+sine*x[1];
-                       p[1]=-sine*x[0]+cosine*x[1];
-                       if(scale)p*=mag;
-                       p+=center;
-                       (*iter)->set_trans_point(p, time);
-               }
-       } else if (scale)
-       {
-               if(!constrain)
-               {
-                       if(abs(drag_offset[0]-center[0])>EPSILON)
-                               vect[0]/=drag_offset[0]-center[0];
-                       else
-                               vect[0]=1;
-                       if(abs(drag_offset[1]-center[1])>EPSILON)
-                               vect[1]/=drag_offset[1]-center[1];
-                       else
-                               vect[1]=1;
-                       }
-               else
-               {
-                       //vect[0]=vect[1]=vect.mag()*0.707106781;
-                       Real amount(vect.mag()/(drag_offset-center).mag());
-                       vect[0]=vect[1]=amount;
-               }
-
-               if(vect[0]<EPSILON && vect[0]>-EPSILON)
-                       vect[0]=1;
-               if(vect[1]<EPSILON && vect[1]>-EPSILON)
-                       vect[1]=1;
-
-               for(i=0,iter=selected_ducks.begin();iter!=selected_ducks.end();++iter,i++)
-               {
-                       if(((*iter)->get_type()!=Duck::TYPE_VERTEX&&(*iter)->get_type()!=Duck::TYPE_POSITION))continue;
-
-                       Vector p(positions[i]-center);
-
-                       p[0]*=vect[0];
-                       p[1]*=vect[1];
-                       p+=center;
-                       (*iter)->set_trans_point(p, time);
-               }
-               for(i=0,iter=selected_ducks.begin();iter!=selected_ducks.end();++iter,i++)
-               {
-                       if(!((*iter)->get_type()!=Duck::TYPE_VERTEX&&(*iter)->get_type()!=Duck::TYPE_POSITION))continue;
-
-                       Vector p(positions[i]-center);
-
-                       p[0]*=vect[0];
-                       p[1]*=vect[1];
-                       p+=center;
-                       (*iter)->set_trans_point(p, time);
-               }
-       }
-       last_move=vect;
-}
-
-bool
-DuckDrag_Combo::end_duck_drag(Duckmatic* duckmatic)
-{
-       if(bad_drag)return false;
-
-       //synfigapp::Action::PassiveGrouper group(get_canvas_interface()->get_instance().get(),_("Rotate Ducks"));
-
-       if((last_move-Vector(1,1)).mag()>0.0001)
-       {
-               duckmatic->signal_edited_selected_ducks();
-               return true;
-       }
-       else
-       {
-               duckmatic->signal_user_click_selected_ducks(0);
-               return false;
-       }
-}
diff --git a/synfig-studio/src/gtkmm/state_transform.h b/synfig-studio/src/gtkmm/state_transform.h
deleted file mode 100644 (file)
index 827b202..0000000
+++ /dev/null
@@ -1,56 +0,0 @@
-/* === S Y N F I G ========================================================= */
-/*!    \file state_transform.h
-**     \brief Template Header
-**
-**     $Id$
-**
-**     \legal
-**     Copyright (c) 2002-2005 Robert B. Quattlebaum Jr., Adrian Bentley
-**
-**     This package is free software; you can redistribute it and/or
-**     modify it under the terms of the GNU General Public License as
-**     published by the Free Software Foundation; either version 2 of
-**     the License, or (at your option) any later version.
-**
-**     This package 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
-**     General Public License for more details.
-**     \endlegal
-*/
-/* ========================================================================= */
-
-/* === S T A R T =========================================================== */
-
-#ifndef __SYNFIG_STUDIO_STATE_TRANSFORM_H
-#define __SYNFIG_STUDIO_STATE_TRANSFORM_H
-
-/* === H E A D E R S ======================================================= */
-
-#include "smach.h"
-
-
-/* === M A C R O S ========================================================= */
-
-/* === T Y P E D E F S ===================================================== */
-
-/* === C L A S S E S & S T R U C T S ======================================= */
-
-namespace studio {
-
-class StateTransform_Context;
-
-class StateTransform : public Smach::state<StateTransform_Context>
-{
-public:
-       StateTransform();
-       ~StateTransform();
-}; // END of class StateTransform
-
-extern StateTransform state_transform;
-
-}; // END of namespace studio
-
-/* === E N D =============================================================== */
-
-#endif
index 55c43ae..81d911e 100644 (file)
@@ -474,16 +474,7 @@ Toolbox::change_state_(const Smach::state_base *state)
        {
                etl::handle<studio::CanvasView> canvas_view(studio::App::get_selected_canvas_view());
                if(canvas_view)
-               {
-                       if(state->get_name()==String("normal"))
-                       {
-                               canvas_view->get_smach().egress();
-                       }
-                       else
-                       {
                                canvas_view->get_smach().enter(state);
-                       }
-               }
                else
                        refresh();
        }