[glide] Begin implementing theme preview actor
- From: Robert Carr <racarr src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [glide] Begin implementing theme preview actor
- Date: Sat, 5 Jun 2010 20:27:38 +0000 (UTC)
commit 10e8df504069fcf0e54b31f32d32f596be930d16
Author: Robert Carr <racarr Valentine localdomain>
Date: Sat Jun 5 16:29:17 2010 -0400
Begin implementing theme preview actor
libglide/Makefile.am | 2 +
libglide/glide-theme-preview-actor-priv.h | 34 ++++++++
libglide/glide-theme-preview-actor.c | 127 +++++++++++++++++++++++++++++
libglide/glide-theme-preview-actor.h | 61 ++++++++++++++
4 files changed, 224 insertions(+), 0 deletions(-)
---
diff --git a/libglide/Makefile.am b/libglide/Makefile.am
index 4de4669..00f5fb8 100644
--- a/libglide/Makefile.am
+++ b/libglide/Makefile.am
@@ -64,6 +64,7 @@ glideheaders_HEADERS = \
glide-theme-manager.h \
glide-theme-chooser.h \
glide-theme-preview-widget.h \
+ glide-theme-preview-actor.h \
$(glide_VALABUILTHEADERS)
glideheadersdir = $(pkgincludedir)
@@ -104,6 +105,7 @@ libglide_la_SOURCES = \
glide-theme-manager.c \
glide-theme-chooser.c \
glide-theme-preview-widget.c \
+ glide-theme-preview-actor.c \
$(glide_VALABUILTSOURCES)
libglide_la_CFLAGS = \
diff --git a/libglide/glide-theme-preview-actor-priv.h b/libglide/glide-theme-preview-actor-priv.h
new file mode 100644
index 0000000..abb186b
--- /dev/null
+++ b/libglide/glide-theme-preview-actor-priv.h
@@ -0,0 +1,34 @@
+/*
+ * glide-theme-preview-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_THEME_PREVIEW_ACTOR_PRIVATE_H__
+#define __GLIDE_THEME_PREVIEW_ACTOR_PRIVATE_H__
+
+#include "glide-theme-preview-actor.h"
+
+G_BEGIN_DECLS
+
+struct _GlideThemePreviewActorPrivate
+{
+ GlideTheme *theme;
+};
+
+G_END_DECLS
+
+#endif
diff --git a/libglide/glide-theme-preview-actor.c b/libglide/glide-theme-preview-actor.c
new file mode 100644
index 0000000..73df7a5
--- /dev/null
+++ b/libglide/glide-theme-preview-actor.c
@@ -0,0 +1,127 @@
+/*
+ * glide-theme-preview-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/>.
+ */
+
+/**
+ * SECTION:glide-theme-preview-actor
+ * @short_description: A actor for rendering theme previews.
+ *
+ */
+
+#include "glide-theme-preview-actor.h"
+#include "glide-theme-preview-actor-priv.h"
+
+#include "glide-theme-manager.h"
+
+#include "glide-debug.h"
+
+#define GLIDE_THEME_PREVIEW_ACTOR_GET_PRIVATE(object)(G_TYPE_INSTANCE_GET_PRIVATE ((object), GLIDE_TYPE_THEME_PREVIEW_ACTOR, GlideThemePreviewActorPrivate))
+
+G_DEFINE_TYPE(GlideThemePreviewActor, glide_theme_preview_actor, CLUTTER_TYPE_ACTOR);
+
+enum {
+ PROP_0,
+ PROP_THEME
+};
+
+static void
+glide_theme_preview_actor_finalize (GObject *object)
+{
+}
+
+static void
+glide_theme_preview_actor_get_property (GObject *object,
+ guint prop_id,
+ GValue *value,
+ GParamSpec *pspec)
+{
+ GlideThemePreviewActor *preview = (GlideThemePreviewActor *)object;
+ switch (prop_id)
+ {
+ case PROP_THEME:
+ g_value_set_object (value, preview->priv->theme);
+ break;
+ default:
+ G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
+ break;
+ }
+}
+
+static void
+glide_theme_preview_actor_set_property (GObject *object,
+ guint prop_id,
+ const GValue *value,
+ GParamSpec *pspec)
+{
+ GlideThemePreviewActor *preview = (GlideThemePreviewActor *)object;
+ switch (prop_id)
+ {
+ case PROP_THEME:
+ glide_theme_preview_actor_set_theme (preview, (GlideTheme *)g_value_get_object (value));
+ break;
+ default:
+ G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
+ break;
+ }
+}
+
+static void
+glide_theme_preview_actor_init (GlideThemePreviewActor *preview)
+{
+ preview->priv = GLIDE_THEME_PREVIEW_ACTOR_GET_PRIVATE (preview);
+}
+
+static void
+glide_theme_preview_actor_class_init (GlideThemePreviewActorClass *klass)
+{
+ GObjectClass *object_class = G_OBJECT_CLASS (klass);
+
+ object_class->finalize = glide_theme_preview_actor_finalize;
+ object_class->get_property = glide_theme_preview_actor_get_property;
+ object_class->set_property = glide_theme_preview_actor_set_property;
+
+ g_object_class_install_property (object_class,
+ PROP_THEME,
+ g_param_spec_object ("theme",
+ "Theme",
+ "The theme we are previewing",
+ GLIDE_TYPE_THEME,
+ G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS));
+
+
+ g_type_class_add_private (object_class, sizeof(GlideThemePreviewActorPrivate));
+}
+
+ClutterActor *
+glide_theme_preview_actor_new ()
+{
+ return (ClutterActor *)g_object_new (GLIDE_TYPE_THEME_PREVIEW_ACTOR, NULL);
+}
+
+void
+glide_theme_preview_actor_set_theme (GlideThemePreviewActor *preview,
+ GlideTheme *theme)
+{
+ preview->priv->theme = theme;
+ g_object_notify (G_OBJECT (preview), "theme");
+}
+
+GlideTheme *
+glide_theme_preview_actor_get_theme (GlideThemePreviewActor *preview)
+{
+ return preview->priv->theme;
+}
diff --git a/libglide/glide-theme-preview-actor.h b/libglide/glide-theme-preview-actor.h
new file mode 100644
index 0000000..a8af6dc
--- /dev/null
+++ b/libglide/glide-theme-preview-actor.h
@@ -0,0 +1,61 @@
+/*
+ * glide-theme-preview-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_THEME_PREVIEW_ACTOR_H__
+#define __GLIDE_THEME_PREVIEW_ACTOR_H__
+
+#include <clutter/clutter.h>
+#include "glide-theme.h"
+
+G_BEGIN_DECLS
+
+#define GLIDE_TYPE_THEME_PREVIEW_ACTOR (glide_theme_preview_actor_get_type())
+#define GLIDE_THEME_PREVIEW_ACTOR(obj) (G_TYPE_CHECK_INSTANCE_CAST((obj), GLIDE_TYPE_THEME_PREVIEW_ACTOR, GlideThemePreviewActor))
+#define GLIDE_THEME_PREVIEW_ACTOR_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST((klass), GLIDE_TYPE_THEME_PREVIEW_ACTOR, GlideThemePreviewActorClass))
+#define GLIDE_IS_THEME_PREVIEW_ACTOR(obj) (G_TYPE_CHECK_INSTANCE_TYPE((obj), GLIDE_TYPE_THEME_PREVIEW_ACTOR))
+#define GLIDE_IS_THEME_PREVIEW_ACTOR_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GLIDE_TYPE_THEME_PREVIEW_ACTOR))
+#define GLIDE_THEME_PREVIEW_ACTOR_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS((obj), GLIDE_TYPE_THEME_PREVIEW_ACTOR, GlideThemePreviewActorClass))
+
+typedef struct _GlideThemePreviewActorPrivate GlideThemePreviewActorPrivate;
+
+
+typedef struct _GlideThemePreviewActor GlideThemePreviewActor;
+
+struct _GlideThemePreviewActor
+{
+ ClutterActor actor;
+
+ GlideThemePreviewActorPrivate *priv;
+};
+
+typedef struct _GlideThemePreviewActorClass GlideThemePreviewActorClass;
+
+struct _GlideThemePreviewActorClass
+{
+ ClutterActorClass parent_class;
+};
+
+GType glide_theme_preview_actor_get_type (void) G_GNUC_CONST;
+ClutterActor *glide_theme_preview_actor_new (void);
+
+void glide_theme_preview_actor_set_theme (GlideThemePreviewActor *preview, GlideTheme *theme);
+GlideTheme *glide_theme_preview_actor_get_theme (GlideThemePreviewActor *preview);
+
+G_END_DECLS
+
+#endif
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]