[glide] Hook up shape to stuff



commit 78711de08f823b6956ce2b5679662338e357b102
Author: Robert Carr <racarr Valentine localdomain>
Date:   Thu May 6 06:52:23 2010 -0400

    Hook up shape to stuff

 data/ui/glide-window.ui |   54 +++++++++++++++++++++++++++++++++++-----------
 libglide/glide-window.c |   13 +++++++++++
 2 files changed, 54 insertions(+), 13 deletions(-)
---
diff --git a/data/ui/glide-window.ui b/data/ui/glide-window.ui
index 46d0b24..82a9835 100644
--- a/data/ui/glide-window.ui
+++ b/data/ui/glide-window.ui
@@ -22,8 +22,8 @@
                     <child>
                       <object class="GtkImageMenuItem" id="new-menuitem">
                         <property name="visible">True</property>
-                        <property name="related_action">new-action</property>
                         <property name="use_action_appearance">True</property>
+                        <property name="related_action">new-action</property>
                         <property name="use_underline">True</property>
                         <property name="use_stock">True</property>
                         <accelerator key="n" signal="activate" modifiers="GDK_CONTROL_MASK"/>
@@ -62,8 +62,8 @@
                             <child>
                               <object class="GtkImageMenuItem" id="export-pdf-menuitem">
                                 <property name="visible">True</property>
-                                <property name="related_action">pdf-export-action</property>
                                 <property name="use_action_appearance">True</property>
+                                <property name="related_action">pdf-export-action</property>
                                 <property name="use_underline">True</property>
                                 <property name="use_stock">True</property>
                               </object>
@@ -71,8 +71,8 @@
                             <child>
                               <object class="GtkImageMenuItem" id="export-image-menuitem">
                                 <property name="visible">True</property>
-                                <property name="related_action">png-export-action</property>
                                 <property name="use_action_appearance">True</property>
+                                <property name="related_action">png-export-action</property>
                                 <property name="use_underline">True</property>
                                 <property name="use_stock">True</property>
                               </object>
@@ -136,8 +136,8 @@
                     <child>
                       <object class="GtkImageMenuItem" id="undo-menuitem">
                         <property name="visible">True</property>
-                        <property name="related_action">undo-action</property>
                         <property name="use_action_appearance">True</property>
+                        <property name="related_action">undo-action</property>
                         <property name="use_underline">True</property>
                         <property name="use_stock">True</property>
                         <accelerator key="z" signal="activate" modifiers="GDK_CONTROL_MASK"/>
@@ -146,8 +146,8 @@
                     <child>
                       <object class="GtkImageMenuItem" id="redo-menuitem">
                         <property name="visible">True</property>
-                        <property name="related_action">redo-action</property>
                         <property name="use_action_appearance">True</property>
+                        <property name="related_action">redo-action</property>
                         <property name="use_underline">True</property>
                         <property name="use_stock">True</property>
                         <accelerator key="z" signal="activate" modifiers="GDK_SHIFT_MASK | GDK_CONTROL_MASK"/>
@@ -171,8 +171,8 @@
                     <child>
                       <object class="GtkImageMenuItem" id="copy-menuitem">
                         <property name="visible">True</property>
-                        <property name="related_action">copy-action</property>
                         <property name="use_action_appearance">True</property>
+                        <property name="related_action">copy-action</property>
                         <property name="use_underline">True</property>
                         <property name="use_stock">True</property>
                         <accelerator key="c" signal="activate" modifiers="GDK_CONTROL_MASK"/>
@@ -244,25 +244,27 @@
             <child>
               <object class="GtkToolButton" id="present-toolbutton">
                 <property name="visible">True</property>
-                <property name="related_action">present-action</property>
                 <property name="use_action_appearance">True</property>
+                <property name="related_action">present-action</property>
                 <property name="label" translatable="yes">Present</property>
                 <property name="use_underline">True</property>
               </object>
               <packing>
                 <property name="expand">False</property>
+                <property name="homogeneous">True</property>
               </packing>
             </child>
             <child>
               <object class="GtkToolButton" id="insert-slide-toolbutton">
                 <property name="visible">True</property>
-                <property name="related_action">add-slide-action</property>
                 <property name="use_action_appearance">True</property>
+                <property name="related_action">add-slide-action</property>
                 <property name="label" translatable="yes">Insert slide</property>
                 <property name="use_underline">True</property>
               </object>
               <packing>
                 <property name="expand">False</property>
+                <property name="homogeneous">True</property>
               </packing>
             </child>
             <child>
@@ -276,25 +278,27 @@
             <child>
               <object class="GtkToolButton" id="undo-toolbutton">
                 <property name="visible">True</property>
-                <property name="related_action">undo-action</property>
                 <property name="use_action_appearance">True</property>
+                <property name="related_action">undo-action</property>
                 <property name="label" translatable="yes">Undo</property>
                 <property name="use_underline">True</property>
               </object>
               <packing>
                 <property name="expand">False</property>
+                <property name="homogeneous">True</property>
               </packing>
             </child>
             <child>
               <object class="GtkToolButton" id="Redo">
                 <property name="visible">True</property>
-                <property name="related_action">redo-action</property>
                 <property name="use_action_appearance">True</property>
+                <property name="related_action">redo-action</property>
                 <property name="label" translatable="yes">Redo</property>
                 <property name="use_underline">True</property>
               </object>
               <packing>
                 <property name="expand">False</property>
+                <property name="homogeneous">True</property>
               </packing>
             </child>
             <child>
@@ -309,26 +313,41 @@
               <object class="GtkToolButton" id="text-toolbutton">
                 <property name="visible">True</property>
                 <property name="sensitive">False</property>
-                <property name="related_action">new-text-action</property>
                 <property name="use_action_appearance">True</property>
+                <property name="related_action">new-text-action</property>
                 <property name="label" translatable="yes">Text</property>
                 <property name="use_underline">True</property>
               </object>
               <packing>
                 <property name="expand">False</property>
+                <property name="homogeneous">True</property>
               </packing>
             </child>
             <child>
               <object class="GtkToolButton" id="image-toolbutton">
                 <property name="visible">True</property>
                 <property name="sensitive">False</property>
-                <property name="related_action">new-image-action</property>
                 <property name="use_action_appearance">True</property>
+                <property name="related_action">new-image-action</property>
                 <property name="label" translatable="yes">Image</property>
                 <property name="use_underline">True</property>
               </object>
               <packing>
                 <property name="expand">False</property>
+                <property name="homogeneous">True</property>
+              </packing>
+            </child>
+            <child>
+              <object class="GtkToolButton" id="shape-toolbutton">
+                <property name="visible">True</property>
+                <property name="use_action_appearance">True</property>
+                <property name="related_action">new-shape-action</property>
+                <property name="label" translatable="yes">Shape</property>
+                <property name="use_underline">True</property>
+              </object>
+              <packing>
+                <property name="expand">False</property>
+                <property name="homogeneous">True</property>
               </packing>
             </child>
             <child>
@@ -342,13 +361,14 @@
             <child>
               <object class="GtkToolButton" id="inspector-button">
                 <property name="visible">True</property>
-                <property name="related_action">inspector-action</property>
                 <property name="use_action_appearance">True</property>
+                <property name="related_action">inspector-action</property>
                 <property name="label" translatable="yes">Inspector</property>
                 <property name="use_underline">True</property>
               </object>
               <packing>
                 <property name="expand">False</property>
+                <property name="homogeneous">True</property>
               </packing>
             </child>
           </object>
@@ -710,4 +730,12 @@
     <property name="sensitive">False</property>
     <signal name="activate" handler="glide_window_background_action_activate"/>
   </object>
+  <object class="GtkAction" id="new-shape-action">
+    <property name="label">New Shape</property>
+    <property name="short_label">Shape</property>
+    <property name="tooltip">Insert a new shape object</property>
+    <property name="stock_id">gtk-select-color</property>
+    <property name="sensitive">False</property>
+    <signal name="activate" handler="glide_window_new_shape_action_activate"/>
+  </object>
 </interface>
diff --git a/libglide/glide-window.c b/libglide/glide-window.c
index 967a0da..ae95600 100644
--- a/libglide/glide-window.c
+++ b/libglide/glide-window.c
@@ -28,6 +28,7 @@
 
 #include "glide-image.h"
 #include "glide-text.h"
+#include "glide-shape.h"
 
 #include "glide-json-util.h"
 #include "glide-gtk-util.h"
@@ -119,6 +120,7 @@ glide_window_enable_document_actions (GlideWindow *w)
 {
   glide_window_enable_action (w, "new-image-action");
   glide_window_enable_action (w, "new-text-action");
+  glide_window_enable_action (w, "new-shape-action");
   glide_window_enable_action (w, "next-slide-action");
   glide_window_enable_action (w, "prev-slide-action");
   glide_window_enable_action (w, "add-slide-action");
@@ -925,6 +927,17 @@ glide_window_new_image_action_activate (GtkAction *a,
 }
 
 void
+glide_window_new_shape_action_activate (GtkAction *a,
+					gpointer user_data)
+{
+  GlideWindow *w = (GlideWindow *)user_data;
+  ClutterActor *shape = glide_shape_new ();
+
+  glide_stage_manager_add_actor (w->priv->manager, GLIDE_ACTOR (shape));
+  glide_undo_manager_append_insert (w->priv->undo_manager, GLIDE_ACTOR (shape));
+}
+
+void
 glide_window_new_text_action_activate (GtkAction *a,
 				       gpointer user_data)
 {



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