[glide] Start adding an actor inspector



commit eaad3ee23a5a85f92916dcb7a6b1b39ae1ebcb93
Author: Robert Carr <racarr Valentine localdomain>
Date:   Sat May 1 21:54:39 2010 -0400

    Start adding an actor inspector

 src/Makefile.am                     |    2 +
 src/glide-inspector-actor-priv.h    |   34 +++++++++
 src/glide-inspector-actor.c         |  127 +++++++++++++++++++++++++++++++++++
 src/glide-inspector-actor.h         |   61 +++++++++++++++++
 src/glide-inspector-notebook-priv.h |    1 +
 src/glide-inspector-notebook.c      |    5 ++
 6 files changed, 230 insertions(+), 0 deletions(-)
---
diff --git a/src/Makefile.am b/src/Makefile.am
index b948bc6..9412978 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -79,6 +79,8 @@ glide_SOURCES = \
 	glide-inspector-notebook.h \
 	glide-inspector-animation.c \
 	glide-inspector-animation.h \
+	glide-inspector-actor.c \
+	glide-inspector-actor.h \
 	$(glide_VALABUILTSOURCES)
 
 
diff --git a/src/glide-inspector-actor-priv.h b/src/glide-inspector-actor-priv.h
new file mode 100644
index 0000000..6fd7747
--- /dev/null
+++ b/src/glide-inspector-actor-priv.h
@@ -0,0 +1,34 @@
+/*
+ * glide-inspector-actor-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_ACTOR_PRIVATE_H__
+#define __GLIDE_INSPECTOR_ACTOR_PRIVATE_H__
+
+#include "glide-inspector-actor.h"
+
+G_BEGIN_DECLS
+
+struct _GlideInspectorActorPrivate
+{
+  GlideActor *actor;
+};
+
+G_END_DECLS
+
+#endif
diff --git a/src/glide-inspector-actor.c b/src/glide-inspector-actor.c
new file mode 100644
index 0000000..315ba57
--- /dev/null
+++ b/src/glide-inspector-actor.c
@@ -0,0 +1,127 @@
+/*
+ * glide-inspector-actor.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-actor.h"
+#include "glide-inspector-actor-priv.h"
+
+#include <string.h>
+
+#define GLIDE_INSPECTOR_ACTOR_GET_PRIVATE(object)(G_TYPE_INSTANCE_GET_PRIVATE ((object), GLIDE_TYPE_INSPECTOR_ACTOR, GlideInspectorActorPrivate))
+
+G_DEFINE_TYPE(GlideInspectorActor, glide_inspector_actor, GTK_TYPE_ALIGNMENT);
+
+enum {
+  PROP_0,
+  PROP_ACTOR
+};
+
+static void
+glide_inspector_actor_finalize (GObject *object)
+{
+  
+}
+
+static void
+glide_inspector_actor_get_property (GObject *object,
+			      guint prop_id,
+			      GValue *value,
+			      GParamSpec *pspec)
+{
+  GlideInspectorActor *inspector = GLIDE_INSPECTOR_ACTOR (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_actor_set_property (GObject *object,
+			      guint prop_id,
+			      const GValue *value,
+			      GParamSpec *pspec)
+{
+  GlideInspectorActor *inspector = GLIDE_INSPECTOR_ACTOR (object);
+  
+  switch (prop_id)
+    {
+    case PROP_ACTOR:
+      glide_inspector_actor_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_actor_init (GlideInspectorActor *inspector)
+{
+  inspector->priv = GLIDE_INSPECTOR_ACTOR_GET_PRIVATE (inspector);
+  
+  gtk_widget_set_sensitive (GTK_WIDGET (inspector), FALSE);
+
+  gtk_alignment_set (GTK_ALIGNMENT (inspector), .5, 0, 0.8, 1.0);
+}
+
+static void
+glide_inspector_actor_class_init (GlideInspectorActorClass *klass)
+{
+  GObjectClass *object_class = G_OBJECT_CLASS (klass);
+
+  object_class->finalize = glide_inspector_actor_finalize;
+  object_class->get_property = glide_inspector_actor_get_property;
+  object_class->set_property = glide_inspector_actor_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(GlideInspectorActorPrivate));
+}
+
+GtkWidget *
+glide_inspector_actor_new ()
+{
+  return (GtkWidget *)g_object_new (GLIDE_TYPE_INSPECTOR_ACTOR, NULL);
+}
+
+
+GlideActor *
+glide_inspector_actor_get_actor (GlideInspectorActor *inspector)
+{
+  return inspector->priv->actor;
+}
+
+void
+glide_inspector_actor_set_actor (GlideInspectorActor *inspector,
+				   GlideActor *actor)
+{
+  inspector->priv->actor = actor;
+  
+  g_object_notify (G_OBJECT (inspector), "actor");
+}
diff --git a/src/glide-inspector-actor.h b/src/glide-inspector-actor.h
new file mode 100644
index 0000000..a3d0af2
--- /dev/null
+++ b/src/glide-inspector-actor.h
@@ -0,0 +1,61 @@
+/*
+ * glide-inspector-actor.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_ACTOR_H__
+#define __GLIDE_INSPECTOR_ACTOR_H__
+
+#include <gtk/gtk.h>
+#include "glide-actor.h"
+
+G_BEGIN_DECLS
+
+#define GLIDE_TYPE_INSPECTOR_ACTOR              (glide_inspector_actor_get_type())
+#define GLIDE_INSPECTOR_ACTOR(obj)              (G_TYPE_CHECK_INSTANCE_CAST((obj), GLIDE_TYPE_INSPECTOR_ACTOR, GlideInspectorActor))
+#define GLIDE_INSPECTOR_ACTOR_CLASS(klass)      (G_TYPE_CHECK_CLASS_CAST((klass), GLIDE_TYPE_INSPECTOR_ACTOR, GlideInspectorActorClass))
+#define GLIDE_IS_INSPECTOR_ACTOR(obj)           (G_TYPE_CHECK_INSTANCE_TYPE((obj), GLIDE_TYPE_INSPECTOR_ACTOR))
+#define GLIDE_IS_INSPECTOR_ACTOR_CLASS(klass)   (G_TYPE_CHECK_CLASS_TYPE ((klass), GLIDE_TYPE_INSPECTOR_ACTOR))
+#define GLIDE_INSPECTOR_ACTOR_GET_CLASS(obj)    (G_TYPE_INSTANCE_GET_CLASS((obj), GLIDE_TYPE_INSPECTOR_ACTOR, GlideInspectorActorClass))
+
+typedef struct _GlideInspectorActorPrivate GlideInspectorActorPrivate;
+
+
+typedef struct _GlideInspectorActor GlideInspectorActor;
+
+struct _GlideInspectorActor
+{
+  GtkAlignment alignment;
+  
+  GlideInspectorActorPrivate *priv;
+};
+
+typedef struct _GlideInspectorActorClass GlideInspectorActorClass;
+
+struct _GlideInspectorActorClass
+{
+  GtkAlignmentClass parent_class;
+};
+
+GType glide_inspector_actor_get_type (void) G_GNUC_CONST;
+GtkWidget *glide_inspector_actor_new (void);
+
+GlideActor *glide_inspector_actor_get_actor (GlideInspectorActor *inspector);
+void glide_inspector_actor_set_actor (GlideInspectorActor *inspector, GlideActor *actor);
+
+G_END_DECLS
+
+#endif
diff --git a/src/glide-inspector-notebook-priv.h b/src/glide-inspector-notebook-priv.h
index 145b5fc..546cfd0 100644
--- a/src/glide-inspector-notebook-priv.h
+++ b/src/glide-inspector-notebook-priv.h
@@ -29,6 +29,7 @@ struct _GlideInspectorNotebookPrivate
   GlideStageManager *manager;
   
   GtkWidget *inspector_animation;
+  GtkWidget *inspector_actor;
   
   gulong selection_changed_id;
 };
diff --git a/src/glide-inspector-notebook.c b/src/glide-inspector-notebook.c
index 9d74669..fd84164 100644
--- a/src/glide-inspector-notebook.c
+++ b/src/glide-inspector-notebook.c
@@ -20,6 +20,7 @@
 #include "glide-inspector-notebook-priv.h"
 
 #include "glide-inspector-animation.h"
+#include "glide-inspector-actor.h"
 
 #define GLIDE_INSPECTOR_NOTEBOOK_GET_PRIVATE(object)(G_TYPE_INSTANCE_GET_PRIVATE ((object), GLIDE_TYPE_INSPECTOR_NOTEBOOK, GlideInspectorNotebookPrivate))
 
@@ -92,9 +93,13 @@ 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);
 
   inspector->priv->inspector_animation= glide_inspector_animation_new ();
+  inspector->priv->inspector_actor = glide_inspector_actor_new ();
+  
   gtk_notebook_append_page (notebook, inspector->priv->inspector_animation, animation_image);
+  gtk_notebook_append_page (notebook, inspector->priv->inspector_actor, actor_image);
 }
 
 static void



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