[glide] More inspector



commit a86571b763e1725da7d6184772ddad6da0429241
Author: Robert Carr <racarr Valentine localdomain>
Date:   Sun May 2 01:13:31 2010 -0400

    More inspector

 src/Makefile.am                     |    6 +
 src/glide-inspector-actor.c         |    7 +-
 src/glide-inspector-animation.c     |    1 +
 src/glide-inspector-image-priv.h    |   34 +++++++
 src/glide-inspector-image.c         |  175 +++++++++++++++++++++++++++++++++++
 src/glide-inspector-image.h         |   61 ++++++++++++
 src/glide-inspector-notebook-priv.h |    3 +
 src/glide-inspector-notebook.c      |   12 +++
 src/glide-inspector-slide-priv.h    |   34 +++++++
 src/glide-inspector-slide.c         |  144 ++++++++++++++++++++++++++++
 src/glide-inspector-slide.h         |   61 ++++++++++++
 src/glide-inspector-text-priv.h     |   34 +++++++
 src/glide-inspector-text.c          |  144 ++++++++++++++++++++++++++++
 src/glide-inspector-text.h          |   61 ++++++++++++
 14 files changed, 776 insertions(+), 1 deletions(-)
---
diff --git a/src/Makefile.am b/src/Makefile.am
index 9412978..4d5f53a 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -81,6 +81,12 @@ glide_SOURCES = \
 	glide-inspector-animation.h \
 	glide-inspector-actor.c \
 	glide-inspector-actor.h \
+	glide-inspector-slide.c \
+	glide-inspector-slide.h \
+	glide-inspector-image.c \
+	glide-inspector-image.h \	
+	glide-inspector-text.c \
+	glide-inspector-text.h \
 	$(glide_VALABUILTSOURCES)
 
 
diff --git a/src/glide-inspector-actor.c b/src/glide-inspector-actor.c
index 3288a2c..139d385 100644
--- a/src/glide-inspector-actor.c
+++ b/src/glide-inspector-actor.c
@@ -249,6 +249,8 @@ glide_inspector_actor_make_geometry_controls (GlideInspectorActor *ins)
   GtkWidget *vbox = gtk_vbox_new (FALSE, 0);
   GtkWidget *hbox1, *hbox2;
   
+  gtk_alignment_set_padding (GTK_ALIGNMENT (ret), 2, 0, 0, 0);
+  
   hbox1 = gtk_hbox_new (TRUE, 10);
   hbox2 = gtk_hbox_new (TRUE, 10);
   
@@ -291,9 +293,11 @@ glide_inspector_actor_make_name_box (GlideInspectorActor *ins)
 {
   GtkWidget *ret = gtk_hbox_new (FALSE, 5);
   GtkWidget *name_label = gtk_label_new (NULL);
-  GtkWidget *align = gtk_alignment_new (0, 0, 0.9, 1);
+  GtkWidget *align = gtk_alignment_new (1, 0, 0.5, 1);
   
   ins->priv->name_entry = gtk_entry_new ();
+  glide_gtk_util_set_widget_font_small (ins->priv->name_entry);
+  
   gtk_label_set_markup (GTK_LABEL (name_label), "<b>Name:</b>");
   gtk_container_add (GTK_CONTAINER (align), ins->priv->name_entry);
   
@@ -366,6 +370,7 @@ glide_inspector_actor_init (GlideInspectorActor *inspector)
   glide_inspector_actor_setup_ui (inspector);
 
   gtk_alignment_set (GTK_ALIGNMENT (inspector), .5, 0, 0.8, 1.0);
+  gtk_alignment_set_padding (GTK_ALIGNMENT (inspector), 5, 0, 0, 0);
 }
 
 static void
diff --git a/src/glide-inspector-animation.c b/src/glide-inspector-animation.c
index 9cf03ef..48c9a90 100644
--- a/src/glide-inspector-animation.c
+++ b/src/glide-inspector-animation.c
@@ -373,6 +373,7 @@ glide_inspector_animation_init (GlideInspectorAnimation *inspector)
   gtk_widget_set_sensitive (GTK_WIDGET (inspector), FALSE);
 
   gtk_alignment_set (GTK_ALIGNMENT (inspector), .5, 0, 0.8, 1.0);
+  gtk_alignment_set_padding (GTK_ALIGNMENT (inspector), 5, 0, 0, 0);
 }
 
 static void
diff --git a/src/glide-inspector-image-priv.h b/src/glide-inspector-image-priv.h
new file mode 100644
index 0000000..efce123
--- /dev/null
+++ b/src/glide-inspector-image-priv.h
@@ -0,0 +1,34 @@
+/*
+ * glide-inspector-image-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_IMAGE_PRIVATE_H__
+#define __GLIDE_INSPECTOR_IMAGE_PRIVATE_H__
+
+#include "glide-inspector-image.h"
+
+G_BEGIN_DECLS
+
+struct _GlideInspectorImagePrivate
+{
+  GlideActor *actor;
+};
+
+G_END_DECLS
+
+#endif
diff --git a/src/glide-inspector-image.c b/src/glide-inspector-image.c
new file mode 100644
index 0000000..c43fd4c
--- /dev/null
+++ b/src/glide-inspector-image.c
@@ -0,0 +1,175 @@
+/*
+ * glide-inspector-image.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-image.h"
+#include "glide-inspector-image-priv.h"
+
+#include "glide-image.h"
+
+#include "glide-undo-manager.h"
+
+#include "glide-gtk-util.h"
+
+#include <string.h>
+#include <math.h>
+
+#define GLIDE_INSPECTOR_IMAGE_GET_PRIVATE(object)(G_TYPE_INSTANCE_GET_PRIVATE ((object), GLIDE_TYPE_INSPECTOR_IMAGE, GlideInspectorImagePrivate))
+
+G_DEFINE_TYPE(GlideInspectorImage, glide_inspector_image, GTK_TYPE_ALIGNMENT);
+
+enum {
+  PROP_0,
+  PROP_ACTOR
+};
+
+static void
+glide_inspector_image_finalize (GObject *object)
+{
+  
+}
+
+static void
+glide_inspector_image_get_property (GObject *object,
+			      guint prop_id,
+			      GValue *value,
+			      GParamSpec *pspec)
+{
+  GlideInspectorImage *inspector = GLIDE_INSPECTOR_IMAGE (object);
+  
+  switch (prop_id)
+    {
+    case PROP_ACTOR:
+      g_value_set_object (value, inspector->priv->actor);
+      break;
+    default:
+      G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
+      break;
+    }
+}
+
+static void
+glide_inspector_image_set_property (GObject *object,
+			      guint prop_id,
+			      const GValue *value,
+			      GParamSpec *pspec)
+{
+  GlideInspectorImage *inspector = GLIDE_INSPECTOR_IMAGE (object);
+  
+  switch (prop_id)
+    {
+    case PROP_ACTOR:
+      glide_inspector_image_set_actor (inspector, g_value_get_object (value));
+      break;
+    default:
+      G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
+      break;
+    }
+}
+
+static GtkWidget*
+glide_inspector_image_make_file_box (GlideInspectorImage *ins)
+{
+  GtkWidget *ret = gtk_hbox_new (FALSE, 0);
+  GtkWidget *label = gtk_label_new (NULL);
+  GtkWidget *align = gtk_alignment_new (1, 0, 0.6, 1);
+  GtkWidget *button = gtk_file_chooser_button_new ("Select image", GTK_FILE_CHOOSER_ACTION_OPEN);
+  
+  gtk_label_set_markup (GTK_LABEL (label), "<b>Image:</b>");
+  
+  gtk_container_add (GTK_CONTAINER (align), button);
+  
+  gtk_box_pack_start (GTK_BOX(ret), label, FALSE, FALSE, 0);
+  gtk_box_pack_start (GTK_BOX(ret), align, TRUE, TRUE, 0);
+
+  return ret;
+}
+
+static void
+glide_inspector_image_setup_ui (GlideInspectorImage *ins)
+{
+  GtkWidget *vbox = gtk_vbox_new (FALSE, 0);
+  GtkWidget *file_box = glide_inspector_image_make_file_box (ins);
+  
+  gtk_box_pack_start (GTK_BOX (vbox), file_box, FALSE, FALSE, 0);
+  
+  gtk_container_add (GTK_CONTAINER (ins), vbox);
+}
+
+static void
+glide_inspector_image_init (GlideInspectorImage *inspector)
+{
+  inspector->priv = GLIDE_INSPECTOR_IMAGE_GET_PRIVATE (inspector);
+  
+  gtk_widget_set_sensitive (GTK_WIDGET (inspector), FALSE);
+  
+  glide_inspector_image_setup_ui (inspector);
+
+  gtk_alignment_set (GTK_ALIGNMENT (inspector), .5, 0, 0.8, 1.0);
+  gtk_alignment_set_padding (GTK_ALIGNMENT (inspector), 5, 0, 0, 0);
+}
+
+static void
+glide_inspector_image_class_init (GlideInspectorImageClass *klass)
+{
+  GObjectClass *object_class = G_OBJECT_CLASS (klass);
+
+  object_class->finalize = glide_inspector_image_finalize;
+  object_class->get_property = glide_inspector_image_get_property;
+  object_class->set_property = glide_inspector_image_set_property;
+  
+  g_object_class_install_property (object_class,
+				   PROP_ACTOR,
+				   g_param_spec_object ("actor",
+							"Actor",
+							"The actor we are inspecting",
+							GLIDE_TYPE_ACTOR,
+							G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS));
+
+  g_type_class_add_private (object_class, sizeof(GlideInspectorImagePrivate));
+}
+
+GtkWidget *
+glide_inspector_image_new ()
+{
+  return (GtkWidget *)g_object_new (GLIDE_TYPE_INSPECTOR_IMAGE, NULL);
+}
+
+
+GlideActor *
+glide_inspector_image_get_actor (GlideInspectorImage *inspector)
+{
+  return inspector->priv->actor;
+}
+
+void
+glide_inspector_image_set_actor (GlideInspectorImage *inspector,
+				 GlideActor *actor)
+{
+  inspector->priv->actor = actor;
+  
+  if (!GLIDE_IS_IMAGE (actor))
+    {
+      gtk_widget_set_sensitive (GTK_WIDGET (inspector), FALSE);
+    }
+  else
+    {
+      gtk_widget_set_sensitive (GTK_WIDGET (inspector), TRUE);
+    }
+  
+  g_object_notify (G_OBJECT (inspector), "actor");
+}
diff --git a/src/glide-inspector-image.h b/src/glide-inspector-image.h
new file mode 100644
index 0000000..4dd7fe8
--- /dev/null
+++ b/src/glide-inspector-image.h
@@ -0,0 +1,61 @@
+/*
+ * glide-inspector-image.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_IMAGE_H__
+#define __GLIDE_INSPECTOR_IMAGE_H__
+
+#include <gtk/gtk.h>
+#include "glide-actor.h"
+
+G_BEGIN_DECLS
+
+#define GLIDE_TYPE_INSPECTOR_IMAGE              (glide_inspector_image_get_type())
+#define GLIDE_INSPECTOR_IMAGE(obj)              (G_TYPE_CHECK_INSTANCE_CAST((obj), GLIDE_TYPE_INSPECTOR_IMAGE, GlideInspectorImage))
+#define GLIDE_INSPECTOR_IMAGE_CLASS(klass)      (G_TYPE_CHECK_CLASS_CAST((klass), GLIDE_TYPE_INSPECTOR_IMAGE, GlideInspectorImageClass))
+#define GLIDE_IS_INSPECTOR_IMAGE(obj)           (G_TYPE_CHECK_INSTANCE_TYPE((obj), GLIDE_TYPE_INSPECTOR_IMAGE))
+#define GLIDE_IS_INSPECTOR_IMAGE_CLASS(klass)   (G_TYPE_CHECK_CLASS_TYPE ((klass), GLIDE_TYPE_INSPECTOR_IMAGE))
+#define GLIDE_INSPECTOR_IMAGE_GET_CLASS(obj)    (G_TYPE_INSTANCE_GET_CLASS((obj), GLIDE_TYPE_INSPECTOR_IMAGE, GlideInspectorImageClass))
+
+typedef struct _GlideInspectorImagePrivate GlideInspectorImagePrivate;
+
+
+typedef struct _GlideInspectorImage GlideInspectorImage;
+
+struct _GlideInspectorImage
+{
+  GtkAlignment alignment;
+  
+  GlideInspectorImagePrivate *priv;
+};
+
+typedef struct _GlideInspectorImageClass GlideInspectorImageClass;
+
+struct _GlideInspectorImageClass
+{
+  GtkAlignmentClass parent_class;
+};
+
+GType glide_inspector_image_get_type (void) G_GNUC_CONST;
+GtkWidget *glide_inspector_image_new (void);
+
+GlideActor *glide_inspector_image_get_actor (GlideInspectorImage *inspector);
+void glide_inspector_image_set_actor (GlideInspectorImage *inspector, GlideActor *actor);
+
+G_END_DECLS
+
+#endif
diff --git a/src/glide-inspector-notebook-priv.h b/src/glide-inspector-notebook-priv.h
index 546cfd0..8684510 100644
--- a/src/glide-inspector-notebook-priv.h
+++ b/src/glide-inspector-notebook-priv.h
@@ -30,6 +30,9 @@ struct _GlideInspectorNotebookPrivate
   
   GtkWidget *inspector_animation;
   GtkWidget *inspector_actor;
+  GtkWidget *inspector_slide;
+  GtkWidget *inspector_text;
+  GtkWidget *inspector_image;
   
   gulong selection_changed_id;
 };
diff --git a/src/glide-inspector-notebook.c b/src/glide-inspector-notebook.c
index c8eee35..fb98e59 100644
--- a/src/glide-inspector-notebook.c
+++ b/src/glide-inspector-notebook.c
@@ -21,6 +21,9 @@
 
 #include "glide-inspector-animation.h"
 #include "glide-inspector-actor.h"
+#include "glide-inspector-slide.h"
+#include "glide-inspector-image.h"
+#include "glide-inspector-text.h"
 
 #define GLIDE_INSPECTOR_NOTEBOOK_GET_PRIVATE(object)(G_TYPE_INSTANCE_GET_PRIVATE ((object), GLIDE_TYPE_INSPECTOR_NOTEBOOK, GlideInspectorNotebookPrivate))
 
@@ -98,12 +101,21 @@ glide_inspector_notebook_add_pages (GlideInspectorNotebook *inspector)
   GtkNotebook *notebook = GTK_NOTEBOOK (inspector);
   GtkWidget *animation_image = gtk_image_new_from_stock (GTK_STOCK_MEDIA_NEXT, GTK_ICON_SIZE_MENU);
   GtkWidget *actor_image = gtk_image_new_from_stock (GTK_STOCK_PROPERTIES, GTK_ICON_SIZE_MENU);
+  GtkWidget *slide_image = gtk_image_new_from_stock (GTK_STOCK_MISSING_IMAGE, GTK_ICON_SIZE_MENU);
+  GtkWidget *image_image = gtk_image_new_from_icon_name ("image-x-generic", GTK_ICON_SIZE_MENU);
+  GtkWidget *text_image = gtk_image_new_from_icon_name ("font-x-generic", GTK_ICON_SIZE_MENU);
 
   inspector->priv->inspector_animation= glide_inspector_animation_new ();
   inspector->priv->inspector_actor = glide_inspector_actor_new ();
+  inspector->priv->inspector_slide = glide_inspector_slide_new ();
+  inspector->priv->inspector_image = glide_inspector_image_new ();
+  inspector->priv->inspector_text = glide_inspector_text_new ();
   
   gtk_notebook_append_page (notebook, inspector->priv->inspector_animation, animation_image);
   gtk_notebook_append_page (notebook, inspector->priv->inspector_actor, actor_image);
+  gtk_notebook_append_page (notebook, inspector->priv->inspector_slide, slide_image);
+  gtk_notebook_append_page (notebook, inspector->priv->inspector_text, text_image);
+  gtk_notebook_append_page (notebook, inspector->priv->inspector_image, image_image);
 }
 
 static void
diff --git a/src/glide-inspector-slide-priv.h b/src/glide-inspector-slide-priv.h
new file mode 100644
index 0000000..21d3900
--- /dev/null
+++ b/src/glide-inspector-slide-priv.h
@@ -0,0 +1,34 @@
+/*
+ * glide-inspector-slide-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_SLIDE_PRIVATE_H__
+#define __GLIDE_INSPECTOR_SLIDE_PRIVATE_H__
+
+#include "glide-inspector-slide.h"
+
+G_BEGIN_DECLS
+
+struct _GlideInspectorSlidePrivate
+{
+  GlideActor *actor;
+};
+
+G_END_DECLS
+
+#endif
diff --git a/src/glide-inspector-slide.c b/src/glide-inspector-slide.c
new file mode 100644
index 0000000..1ac44b6
--- /dev/null
+++ b/src/glide-inspector-slide.c
@@ -0,0 +1,144 @@
+/*
+ * glide-inspector-slide.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-slide.h"
+#include "glide-inspector-slide-priv.h"
+
+#include "glide-slide.h"
+
+#include "glide-undo-manager.h"
+
+#include "glide-gtk-util.h"
+
+#include <string.h>
+#include <math.h>
+
+#define GLIDE_INSPECTOR_SLIDE_GET_PRIVATE(object)(G_TYPE_INSTANCE_GET_PRIVATE ((object), GLIDE_TYPE_INSPECTOR_SLIDE, GlideInspectorSlidePrivate))
+
+G_DEFINE_TYPE(GlideInspectorSlide, glide_inspector_slide, GTK_TYPE_ALIGNMENT);
+
+enum {
+  PROP_0,
+  PROP_ACTOR
+};
+
+static void
+glide_inspector_slide_finalize (GObject *object)
+{
+  
+}
+
+static void
+glide_inspector_slide_get_property (GObject *object,
+			      guint prop_id,
+			      GValue *value,
+			      GParamSpec *pspec)
+{
+  GlideInspectorSlide *inspector = GLIDE_INSPECTOR_SLIDE (object);
+  
+  switch (prop_id)
+    {
+    case PROP_ACTOR:
+      g_value_set_object (value, inspector->priv->actor);
+      break;
+    default:
+      G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
+      break;
+    }
+}
+
+static void
+glide_inspector_slide_set_property (GObject *object,
+			      guint prop_id,
+			      const GValue *value,
+			      GParamSpec *pspec)
+{
+  GlideInspectorSlide *inspector = GLIDE_INSPECTOR_SLIDE (object);
+  
+  switch (prop_id)
+    {
+    case PROP_ACTOR:
+      glide_inspector_slide_set_actor (inspector, g_value_get_object (value));
+      break;
+    default:
+      G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
+      break;
+    }
+}
+
+static void
+glide_inspector_slide_init (GlideInspectorSlide *inspector)
+{
+  inspector->priv = GLIDE_INSPECTOR_SLIDE_GET_PRIVATE (inspector);
+  
+  gtk_widget_set_sensitive (GTK_WIDGET (inspector), FALSE);
+
+  gtk_alignment_set (GTK_ALIGNMENT (inspector), .5, 0, 0.8, 1.0);
+  gtk_alignment_set_padding (GTK_ALIGNMENT (inspector), 5, 0, 0, 0);
+}
+
+static void
+glide_inspector_slide_class_init (GlideInspectorSlideClass *klass)
+{
+  GObjectClass *object_class = G_OBJECT_CLASS (klass);
+
+  object_class->finalize = glide_inspector_slide_finalize;
+  object_class->get_property = glide_inspector_slide_get_property;
+  object_class->set_property = glide_inspector_slide_set_property;
+  
+  g_object_class_install_property (object_class,
+				   PROP_ACTOR,
+				   g_param_spec_object ("actor",
+							"Actor",
+							"The actor we are inspecting",
+							GLIDE_TYPE_ACTOR,
+							G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS));
+
+  g_type_class_add_private (object_class, sizeof(GlideInspectorSlidePrivate));
+}
+
+GtkWidget *
+glide_inspector_slide_new ()
+{
+  return (GtkWidget *)g_object_new (GLIDE_TYPE_INSPECTOR_SLIDE, NULL);
+}
+
+
+GlideActor *
+glide_inspector_slide_get_actor (GlideInspectorSlide *inspector)
+{
+  return inspector->priv->actor;
+}
+
+void
+glide_inspector_slide_set_actor (GlideInspectorSlide *inspector,
+				 GlideActor *actor)
+{
+  inspector->priv->actor = actor;
+  
+  if (!GLIDE_IS_SLIDE (actor))
+    {
+      gtk_widget_set_sensitive (GTK_WIDGET (inspector), FALSE);
+    }
+  else
+    {
+      gtk_widget_set_sensitive (GTK_WIDGET (inspector), TRUE);
+    }
+  
+  g_object_notify (G_OBJECT (inspector), "actor");
+}
diff --git a/src/glide-inspector-slide.h b/src/glide-inspector-slide.h
new file mode 100644
index 0000000..31e75e3
--- /dev/null
+++ b/src/glide-inspector-slide.h
@@ -0,0 +1,61 @@
+/*
+ * glide-inspector-slide.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_SLIDE_H__
+#define __GLIDE_INSPECTOR_SLIDE_H__
+
+#include <gtk/gtk.h>
+#include "glide-actor.h"
+
+G_BEGIN_DECLS
+
+#define GLIDE_TYPE_INSPECTOR_SLIDE              (glide_inspector_slide_get_type())
+#define GLIDE_INSPECTOR_SLIDE(obj)              (G_TYPE_CHECK_INSTANCE_CAST((obj), GLIDE_TYPE_INSPECTOR_SLIDE, GlideInspectorSlide))
+#define GLIDE_INSPECTOR_SLIDE_CLASS(klass)      (G_TYPE_CHECK_CLASS_CAST((klass), GLIDE_TYPE_INSPECTOR_SLIDE, GlideInspectorSlideClass))
+#define GLIDE_IS_INSPECTOR_SLIDE(obj)           (G_TYPE_CHECK_INSTANCE_TYPE((obj), GLIDE_TYPE_INSPECTOR_SLIDE))
+#define GLIDE_IS_INSPECTOR_SLIDE_CLASS(klass)   (G_TYPE_CHECK_CLASS_TYPE ((klass), GLIDE_TYPE_INSPECTOR_SLIDE))
+#define GLIDE_INSPECTOR_SLIDE_GET_CLASS(obj)    (G_TYPE_INSTANCE_GET_CLASS((obj), GLIDE_TYPE_INSPECTOR_SLIDE, GlideInspectorSlideClass))
+
+typedef struct _GlideInspectorSlidePrivate GlideInspectorSlidePrivate;
+
+
+typedef struct _GlideInspectorSlide GlideInspectorSlide;
+
+struct _GlideInspectorSlide
+{
+  GtkAlignment alignment;
+  
+  GlideInspectorSlidePrivate *priv;
+};
+
+typedef struct _GlideInspectorSlideClass GlideInspectorSlideClass;
+
+struct _GlideInspectorSlideClass
+{
+  GtkAlignmentClass parent_class;
+};
+
+GType glide_inspector_slide_get_type (void) G_GNUC_CONST;
+GtkWidget *glide_inspector_slide_new (void);
+
+GlideActor *glide_inspector_slide_get_actor (GlideInspectorSlide *inspector);
+void glide_inspector_slide_set_actor (GlideInspectorSlide *inspector, GlideActor *actor);
+
+G_END_DECLS
+
+#endif
diff --git a/src/glide-inspector-text-priv.h b/src/glide-inspector-text-priv.h
new file mode 100644
index 0000000..fbdd164
--- /dev/null
+++ b/src/glide-inspector-text-priv.h
@@ -0,0 +1,34 @@
+/*
+ * glide-inspector-text-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_TEXT_PRIVATE_H__
+#define __GLIDE_INSPECTOR_TEXT_PRIVATE_H__
+
+#include "glide-inspector-text.h"
+
+G_BEGIN_DECLS
+
+struct _GlideInspectorTextPrivate
+{
+  GlideActor *actor;
+};
+
+G_END_DECLS
+
+#endif
diff --git a/src/glide-inspector-text.c b/src/glide-inspector-text.c
new file mode 100644
index 0000000..ffc4368
--- /dev/null
+++ b/src/glide-inspector-text.c
@@ -0,0 +1,144 @@
+/*
+ * glide-inspector-text.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-text.h"
+#include "glide-inspector-text-priv.h"
+
+#include "glide-text.h"
+
+#include "glide-undo-manager.h"
+
+#include "glide-gtk-util.h"
+
+#include <string.h>
+#include <math.h>
+
+#define GLIDE_INSPECTOR_TEXT_GET_PRIVATE(object)(G_TYPE_INSTANCE_GET_PRIVATE ((object), GLIDE_TYPE_INSPECTOR_TEXT, GlideInspectorTextPrivate))
+
+G_DEFINE_TYPE(GlideInspectorText, glide_inspector_text, GTK_TYPE_ALIGNMENT);
+
+enum {
+  PROP_0,
+  PROP_ACTOR
+};
+
+static void
+glide_inspector_text_finalize (GObject *object)
+{
+  
+}
+
+static void
+glide_inspector_text_get_property (GObject *object,
+			      guint prop_id,
+			      GValue *value,
+			      GParamSpec *pspec)
+{
+  GlideInspectorText *inspector = GLIDE_INSPECTOR_TEXT (object);
+  
+  switch (prop_id)
+    {
+    case PROP_ACTOR:
+      g_value_set_object (value, inspector->priv->actor);
+      break;
+    default:
+      G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
+      break;
+    }
+}
+
+static void
+glide_inspector_text_set_property (GObject *object,
+			      guint prop_id,
+			      const GValue *value,
+			      GParamSpec *pspec)
+{
+  GlideInspectorText *inspector = GLIDE_INSPECTOR_TEXT (object);
+  
+  switch (prop_id)
+    {
+    case PROP_ACTOR:
+      glide_inspector_text_set_actor (inspector, g_value_get_object (value));
+      break;
+    default:
+      G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
+      break;
+    }
+}
+
+static void
+glide_inspector_text_init (GlideInspectorText *inspector)
+{
+  inspector->priv = GLIDE_INSPECTOR_TEXT_GET_PRIVATE (inspector);
+  
+  gtk_widget_set_sensitive (GTK_WIDGET (inspector), FALSE);
+
+  gtk_alignment_set (GTK_ALIGNMENT (inspector), .5, 0, 0.8, 1.0);
+  gtk_alignment_set_padding (GTK_ALIGNMENT (inspector), 5, 0, 0, 0);
+}
+
+static void
+glide_inspector_text_class_init (GlideInspectorTextClass *klass)
+{
+  GObjectClass *object_class = G_OBJECT_CLASS (klass);
+
+  object_class->finalize = glide_inspector_text_finalize;
+  object_class->get_property = glide_inspector_text_get_property;
+  object_class->set_property = glide_inspector_text_set_property;
+  
+  g_object_class_install_property (object_class,
+				   PROP_ACTOR,
+				   g_param_spec_object ("actor",
+							"Actor",
+							"The actor we are inspecting",
+							GLIDE_TYPE_ACTOR,
+							G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS));
+
+  g_type_class_add_private (object_class, sizeof(GlideInspectorTextPrivate));
+}
+
+GtkWidget *
+glide_inspector_text_new ()
+{
+  return (GtkWidget *)g_object_new (GLIDE_TYPE_INSPECTOR_TEXT, NULL);
+}
+
+
+GlideActor *
+glide_inspector_text_get_actor (GlideInspectorText *inspector)
+{
+  return inspector->priv->actor;
+}
+
+void
+glide_inspector_text_set_actor (GlideInspectorText *inspector,
+				 GlideActor *actor)
+{
+  inspector->priv->actor = actor;
+  
+  if (!GLIDE_IS_TEXT (actor))
+    {
+      gtk_widget_set_sensitive (GTK_WIDGET (inspector), FALSE);
+    }
+  else
+    {
+      gtk_widget_set_sensitive (GTK_WIDGET (inspector), TRUE);
+    }
+  
+  g_object_notify (G_OBJECT (inspector), "actor");
+}
diff --git a/src/glide-inspector-text.h b/src/glide-inspector-text.h
new file mode 100644
index 0000000..ff752d6
--- /dev/null
+++ b/src/glide-inspector-text.h
@@ -0,0 +1,61 @@
+/*
+ * glide-inspector-text.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_TEXT_H__
+#define __GLIDE_INSPECTOR_TEXT_H__
+
+#include <gtk/gtk.h>
+#include "glide-actor.h"
+
+G_BEGIN_DECLS
+
+#define GLIDE_TYPE_INSPECTOR_TEXT              (glide_inspector_text_get_type())
+#define GLIDE_INSPECTOR_TEXT(obj)              (G_TYPE_CHECK_INSTANCE_CAST((obj), GLIDE_TYPE_INSPECTOR_TEXT, GlideInspectorText))
+#define GLIDE_INSPECTOR_TEXT_CLASS(klass)      (G_TYPE_CHECK_CLASS_CAST((klass), GLIDE_TYPE_INSPECTOR_TEXT, GlideInspectorTextClass))
+#define GLIDE_IS_INSPECTOR_TEXT(obj)           (G_TYPE_CHECK_INSTANCE_TYPE((obj), GLIDE_TYPE_INSPECTOR_TEXT))
+#define GLIDE_IS_INSPECTOR_TEXT_CLASS(klass)   (G_TYPE_CHECK_CLASS_TYPE ((klass), GLIDE_TYPE_INSPECTOR_TEXT))
+#define GLIDE_INSPECTOR_TEXT_GET_CLASS(obj)    (G_TYPE_INSTANCE_GET_CLASS((obj), GLIDE_TYPE_INSPECTOR_TEXT, GlideInspectorTextClass))
+
+typedef struct _GlideInspectorTextPrivate GlideInspectorTextPrivate;
+
+
+typedef struct _GlideInspectorText GlideInspectorText;
+
+struct _GlideInspectorText
+{
+  GtkAlignment alignment;
+  
+  GlideInspectorTextPrivate *priv;
+};
+
+typedef struct _GlideInspectorTextClass GlideInspectorTextClass;
+
+struct _GlideInspectorTextClass
+{
+  GtkAlignmentClass parent_class;
+};
+
+GType glide_inspector_text_get_type (void) G_GNUC_CONST;
+GtkWidget *glide_inspector_text_new (void);
+
+GlideActor *glide_inspector_text_get_actor (GlideInspectorText *inspector);
+void glide_inspector_text_set_actor (GlideInspectorText *inspector, GlideActor *actor);
+
+G_END_DECLS
+
+#endif



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