[glide] Start moving inspector in to window



commit 8c4b10084ce0cb0e16546ef94ad65b10d067f668
Author: Robert Carr <racarr Valentine localdomain>
Date:   Thu May 6 02:45:40 2010 -0400

    Start moving inspector in to window

 data/ui/glide-window.ui                |   33 +++++------
 libglide/Makefile.am                   |    2 +
 libglide/glide-inspector-window-priv.h |   34 +++++++++++
 libglide/glide-inspector-window.c      |   99 ++++++++++++++++++++++++++++++++
 libglide/glide-inspector-window.h      |   60 +++++++++++++++++++
 libglide/glide-window-private.h        |    1 +
 libglide/glide-window.c                |   12 ++--
 7 files changed, 217 insertions(+), 24 deletions(-)
---
diff --git a/data/ui/glide-window.ui b/data/ui/glide-window.ui
index 1bc60cc..fe08c0a 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"/>
@@ -242,8 +242,8 @@
             <child>
               <object class="GtkToolButton" id="new-toolbutton">
                 <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="label" translatable="yes">New File</property>
                 <property name="use_underline">True</property>
               </object>
@@ -255,8 +255,8 @@
             <child>
               <object class="GtkToolButton" id="open-toolbutton">
                 <property name="visible">True</property>
-                <property name="related_action">open-action</property>
                 <property name="use_action_appearance">True</property>
+                <property name="related_action">open-action</property>
                 <property name="label" translatable="yes">Open File</property>
                 <property name="use_underline">True</property>
               </object>
@@ -268,8 +268,8 @@
             <child>
               <object class="GtkToolButton" id="save-toolbutton">
                 <property name="visible">True</property>
-                <property name="related_action">save-action</property>
                 <property name="use_action_appearance">True</property>
+                <property name="related_action">save-action</property>
                 <property name="label" translatable="yes">Save File</property>
                 <property name="use_underline">True</property>
               </object>
@@ -290,8 +290,8 @@
             <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>
@@ -303,8 +303,8 @@
             <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>
@@ -326,8 +326,8 @@
               <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>
@@ -340,8 +340,8 @@
               <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>
@@ -362,8 +362,8 @@
             <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>
@@ -384,8 +384,8 @@
             <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>
@@ -436,9 +436,6 @@
                 <property name="position">1</property>
               </packing>
             </child>
-            <child>
-              <placeholder/>
-            </child>
           </object>
           <packing>
             <property name="position">2</property>
diff --git a/libglide/Makefile.am b/libglide/Makefile.am
index 0086410..85c166f 100644
--- a/libglide/Makefile.am
+++ b/libglide/Makefile.am
@@ -51,6 +51,7 @@ glideheaders_HEADERS = \
 	glide-actor.h \
 	glide-manipulator.h \
 	glide-window.h \
+	glide-inspector-window.h \
 	glide.h \
 	$(glide_VALABUILTHEADERS)
 
@@ -82,6 +83,7 @@ libglide_la_SOURCES = \
 	glide-inspector-slide.c \
 	glide-inspector-image.c \
 	glide-inspector-text.c \
+	glide-inspector-window.c \
 	glide.c \
 	$(glide_VALABUILTSOURCES)
 
diff --git a/libglide/glide-inspector-window-priv.h b/libglide/glide-inspector-window-priv.h
new file mode 100644
index 0000000..8f210a6
--- /dev/null
+++ b/libglide/glide-inspector-window-priv.h
@@ -0,0 +1,34 @@
+/*
+ * glide-inspector-window-priv.h
+ * Copyright (C) Robert Carr 2010 <racarr gnome org>
+ * 
+ * Glide 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 3 of the License, or
+ * (at your option) any later version.
+ * 
+ * Glide 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.
+ * 
+ * You should have received a copy of the GNU General Public License along
+ * with this program.  If not, see <http://www.gnu.org/licenses/>.
+ */
+
+
+#ifndef __GLIDE_INSPECTOR_WINDOW_PRIVATE_H__
+#define __GLIDE_INSPECTOR_WINDOW_PRIVATE_H__
+
+#include "glide-inspector-window.h"
+
+G_BEGIN_DECLS
+
+struct _GlideInspectorWindowPrivate
+{
+  GtkWidget *inspector;
+};
+
+G_END_DECLS
+
+#endif
diff --git a/libglide/glide-inspector-window.c b/libglide/glide-inspector-window.c
new file mode 100644
index 0000000..2fccd39
--- /dev/null
+++ b/libglide/glide-inspector-window.c
@@ -0,0 +1,99 @@
+/*
+ * glide-inspector-window.c
+ * Copyright (C) Robert Carr 2010 <racarr gnome org>
+ * 
+ * Glide 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 3 of the License, or
+ * (at your option) any later version.
+ * 
+ * Glide 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.
+ * 
+ * You should have received a copy of the GNU General Public License along
+ * with this program.  If not, see <http://www.gnu.org/licenses/>.
+ */
+
+#include "glide-inspector-notebook.h"
+#include "glide-inspector-window.h"
+#include "glide-inspector-window-priv.h"
+
+#define GLIDE_INSPECTOR_WINDOW_GET_PRIVATE(object)(G_TYPE_INSTANCE_GET_PRIVATE ((object), GLIDE_TYPE_INSPECTOR_WINDOW, GlideInspectorWindowPrivate))
+
+G_DEFINE_TYPE(GlideInspectorWindow, glide_inspector_window, GTK_TYPE_WINDOW);
+
+enum {
+  PROP_O,
+  PROP_INSPECTOR
+};
+
+static void
+glide_inspector_window_get_property (GObject *object,
+				     guint prop_id,
+				     GValue *value,
+				     GParamSpec *pspec)
+{
+  GlideInspectorWindow *w = GLIDE_INSPECTOR_WINDOW (object);
+  
+  switch (prop_id)
+    {
+    case PROP_INSPECTOR:
+      g_value_set_object (value, w->priv->inspector);
+      break;
+    default:
+      G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
+      break;
+    }
+}
+
+static void
+glide_inspector_window_finalize (GObject *object)
+{
+}
+
+static void
+glide_inspector_window_init (GlideInspectorWindow *window)
+{
+  window->priv = GLIDE_INSPECTOR_WINDOW_GET_PRIVATE (window);
+  window->priv->inspector = glide_inspector_notebook_new ();
+  
+  gtk_container_add (GTK_CONTAINER (window), window->priv->inspector);
+  
+  gtk_widget_show_all (GTK_WIDGET (window));
+}
+ 
+static void
+glide_inspector_window_class_init (GlideInspectorWindowClass *klass)
+{
+  GObjectClass *object_class = G_OBJECT_CLASS (klass);
+  
+  object_class->finalize = glide_inspector_window_finalize;
+
+  object_class->get_property = glide_inspector_window_get_property;
+  
+  g_object_class_install_property (object_class,
+				   PROP_INSPECTOR,
+				   g_param_spec_object ("inspector",
+							"Inspector",
+							"The inspector notebook object we contain",
+							GLIDE_TYPE_INSPECTOR_NOTEBOOK,
+							G_PARAM_READABLE | G_PARAM_STATIC_STRINGS));
+  
+  g_type_class_add_private (object_class, sizeof(GlideInspectorWindowPrivate));
+}
+ 
+GtkWidget *
+glide_inspector_window_new ()
+{
+  return (GtkWidget *)g_object_new (GLIDE_TYPE_INSPECTOR_WINDOW, NULL);
+}
+
+GtkWidget *
+glide_inspector_window_get_inspector (GlideInspectorWindow *w)
+{
+  return w->priv->inspector;
+}
+
+
diff --git a/libglide/glide-inspector-window.h b/libglide/glide-inspector-window.h
new file mode 100644
index 0000000..c9f2f49
--- /dev/null
+++ b/libglide/glide-inspector-window.h
@@ -0,0 +1,60 @@
+/*
+ * glide-inspector-window.h
+ * Copyright (C) Robert Carr 2010 <racarr gnome org>
+ * 
+ * Glide 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 3 of the License, or
+ * (at your option) any later version.
+ * 
+ * Glide 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.
+ * 
+ * You should have received a copy of the GNU General Public License along
+ * with this program.  If not, see <http://www.gnu.org/licenses/>.
+ */
+
+#ifndef __GLIDE_INSPECTOR_WINDOW_H__
+#define __GLIDE_INSPECTOR_WINDOW_H__
+
+#include <gtk/gtk.h>
+
+G_BEGIN_DECLS
+
+#define GLIDE_TYPE_INSPECTOR_WINDOW              (glide_inspector_window_get_type())
+#define GLIDE_INSPECTOR_WINDOW(obj)              (G_TYPE_CHECK_INSTANCE_CAST((obj), GLIDE_TYPE_INSPECTOR_WINDOW, GlideInspectorWindow))
+#define GLIDE_INSPECTOR_WINDOW_CLASS(klass)      (G_TYPE_CHECK_CLASS_CAST((klass), GLIDE_TYPE_INSPECTOR_WINDOW, GlideInspectorWindowClass))
+#define GLIDE_IS_INSPECTOR_WINDOW(obj)           (G_TYPE_CHECK_INSTANCE_TYPE((obj), GLIDE_TYPE_INSPECTOR_WINDOW))
+#define GLIDE_IS_INSPECTOR_WINDOW_CLASS(klass)   (G_TYPE_CHECK_CLASS_TYPE ((klass), GLIDE_TYPE_INSPECTOR_WINDOW))
+#define GLIDE_INSPECTOR_WINDOW_GET_CLASS(obj)    (G_TYPE_INSTANCE_GET_CLASS((obj), GLIDE_TYPE_INSPECTOR_WINDOW, GlideInspectorWindowClass))
+
+typedef struct _GlideInspectorWindowPrivate GlideInspectorWindowPrivate;
+
+
+typedef struct _GlideInspectorWindow GlideInspectorWindow;
+
+struct _GlideInspectorWindow
+{
+  GtkWindow window;
+  
+  GlideInspectorWindowPrivate *priv;
+};
+
+typedef struct _GlideInspectorWindowClass GlideInspectorWindowClass;
+
+struct _GlideInspectorWindowClass
+{
+  GtkWindowClass parent_class;
+};
+
+GType glide_inspector_window_get_type (void) G_GNUC_CONST;
+GtkWidget *glide_inspector_window_new (void);
+
+GtkWidget *glide_inspector_window_get_inspector (GlideInspectorWindow *window);
+
+
+G_END_DECLS
+
+#endif
diff --git a/libglide/glide-window-private.h b/libglide/glide-window-private.h
index 179e36a..5479380 100644
--- a/libglide/glide-window-private.h
+++ b/libglide/glide-window-private.h
@@ -47,6 +47,7 @@ struct _GlideWindowPrivate
   
   GtkWidget *slide_box;
   GtkWidget *inspector_notebook;
+  GtkWidget *inspector_window;
 };
 
 G_END_DECLS
diff --git a/libglide/glide-window.c b/libglide/glide-window.c
index f495539..f3d01ec 100644
--- a/libglide/glide-window.c
+++ b/libglide/glide-window.c
@@ -45,6 +45,7 @@
 #include "glide-slide-box.h"
 
 #include "glide-inspector-notebook.h"
+#include "glide-inspector-window.h"
 
 #define GLIDE_WINDOW_UI_OBJECT(w, obj) (gtk_builder_get_object (w->priv->builder, obj))
 
@@ -646,10 +647,10 @@ glide_window_inspector_action_activate (GtkAction *a,
 {
   GlideWindow *w = (GlideWindow *)user_data;
   
-  if (GTK_WIDGET_VISIBLE (w->priv->inspector_notebook))
-    gtk_widget_hide (w->priv->inspector_notebook);
+  if (GTK_WIDGET_VISIBLE (w->priv->inspector_window))
+    gtk_widget_hide (w->priv->inspector_window);
   else
-    gtk_widget_show (w->priv->inspector_notebook);
+    gtk_widget_show (w->priv->inspector_window);
 }
 
 
@@ -1165,9 +1166,8 @@ glide_window_load_ui (GlideWindow *w)
   gtk_container_add (GTK_CONTAINER (GLIDE_WINDOW_UI_OBJECT (w, "slide-pane-viewport")), w->priv->slide_box);
   gtk_widget_show (w->priv->slide_box);
   
-  w->priv->inspector_notebook = glide_inspector_notebook_new ();
-  gtk_container_add (GTK_CONTAINER (GLIDE_WINDOW_UI_OBJECT (w, "middle-hbox")), w->priv->inspector_notebook);
-  gtk_widget_show (w->priv->inspector_notebook);
+  w->priv->inspector_window = glide_inspector_window_new ();
+  w->priv->inspector_notebook = glide_inspector_window_get_inspector (GLIDE_INSPECTOR_WINDOW (w->priv->inspector_window));
 }
 
 void



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