[gnome-photos] Add a PhotosBaseManager skeleton with only the signals



commit 5b342fd5a93d4f025b6a2e506dc43f3e47a0345c
Author: Debarshi Ray <debarshir gnome org>
Date:   Tue Apr 24 19:01:52 2012 +0200

    Add a PhotosBaseManager skeleton with only the signals

 src/Makefile.am           |    2 +
 src/photos-base-manager.c |  102 +++++++++++++++++++++++++++++++++++++++++++++
 src/photos-base-manager.h |   74 ++++++++++++++++++++++++++++++++
 3 files changed, 178 insertions(+), 0 deletions(-)
---
diff --git a/src/Makefile.am b/src/Makefile.am
index be521be..8cab322 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -13,6 +13,8 @@ gnome_photos_SOURCES = \
 	gd-main-toolbar.h \
 	photos-application.c \
 	photos-application.h \
+	photos-base-manager.c \
+	photos-base-manager.h \
 	photos-main-toolbar.c \
 	photos-main-toolbar.h \
 	photos-main-window.c \
diff --git a/src/photos-base-manager.c b/src/photos-base-manager.c
new file mode 100644
index 0000000..96abb11
--- /dev/null
+++ b/src/photos-base-manager.c
@@ -0,0 +1,102 @@
+/*
+ * Photos - access, organize and share your photos on GNOME
+ * Copyright  2012 Red Hat, Inc.
+ *
+ * This program 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 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program 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, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+ * 02110-1301, USA.
+ */
+
+
+#include "config.h"
+
+#include "photos-base-manager.h"
+
+
+struct _PhotosBaseManagerPrivate
+{
+};
+
+enum
+{
+  ACTIVE_CHANGED,
+  ITEM_ADDED,
+  ITEM_REMOVED,
+  LAST_SIGNAL
+};
+
+static guint signals[LAST_SIGNAL] = { 0 };
+
+
+G_DEFINE_TYPE (PhotosBaseManager, photos_base_manager, G_TYPE_OBJECT);
+
+
+static void
+photos_base_manager_init (PhotosBaseManager *self)
+{
+  PhotosBaseManagerPrivate *priv;
+
+  self->priv = G_TYPE_INSTANCE_GET_PRIVATE (self, PHOTOS_TYPE_BASE_MANAGER, PhotosBaseManagerPrivate);
+  priv = self->priv;
+}
+
+
+static void
+photos_base_manager_class_init (PhotosBaseManagerClass *class)
+{
+  signals[ACTIVE_CHANGED] = g_signal_new ("active-changed",
+                                          G_TYPE_FROM_CLASS (class),
+                                          G_SIGNAL_RUN_LAST,
+                                          G_STRUCT_OFFSET (PhotosBaseManagerClass,
+                                                           active_changed),
+                                          NULL, /*accumulator */
+                                          NULL, /*accu_data */
+                                          g_cclosure_marshal_VOID__OBJECT,
+                                          G_TYPE_NONE,
+                                          1,
+                                          G_TYPE_OBJECT);
+
+  signals[ITEM_ADDED] = g_signal_new ("item-added",
+                                      G_TYPE_FROM_CLASS (class),
+                                      G_SIGNAL_RUN_LAST,
+                                      G_STRUCT_OFFSET (PhotosBaseManagerClass,
+                                                       item_added),
+                                      NULL, /*accumulator */
+                                      NULL, /* accu_data */
+                                      g_cclosure_marshal_VOID__OBJECT,
+                                      G_TYPE_NONE,
+                                      1,
+                                      G_TYPE_OBJECT);
+
+  signals[ITEM_REMOVED] = g_signal_new ("item-removed",
+                                        G_TYPE_FROM_CLASS (class),
+                                        G_SIGNAL_RUN_LAST,
+                                        G_STRUCT_OFFSET (PhotosBaseManagerClass,
+                                                         item_removed),
+                                        NULL, /*accumulator */
+                                        NULL, /*accu_data */
+                                        g_cclosure_marshal_VOID__OBJECT,
+                                        G_TYPE_NONE,
+                                        1,
+                                        G_TYPE_OBJECT);
+
+  g_type_class_add_private (class, sizeof (PhotosBaseManagerPrivate));
+}
+
+
+PhotosBaseManager *
+photos_base_manager_new (void)
+{
+  return g_object_new (PHOTOS_TYPE_BASE_MANAGER, NULL);
+}
diff --git a/src/photos-base-manager.h b/src/photos-base-manager.h
new file mode 100644
index 0000000..76ac5a5
--- /dev/null
+++ b/src/photos-base-manager.h
@@ -0,0 +1,74 @@
+/*
+ * Photos - access, organize and share your photos on GNOME
+ * Copyright  2012 Red Hat, Inc.
+ *
+ * This program 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 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program 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, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+ * 02110-1301, USA.
+ */
+
+#ifndef PHOTOS_BASE_MANAGER_H
+#define PHOTOS_BASE_MANAGER_H
+
+#include <glib-object.h>
+
+G_BEGIN_DECLS
+
+#define PHOTOS_TYPE_BASE_MANAGER (photos_base_manager_get_type ())
+#define PHOTOS_BASE_MANAGER(obj) \
+  (G_TYPE_CHECK_INSTANCE_CAST ((obj), \
+   PHOTOS_TYPE_BASE_MANAGER, PhotosBaseManager))
+
+#define PHOTOS_BASE_MANAGER_CLASS(klass) \
+  (G_TYPE_CHECK_CLASS_CAST ((klass), \
+   PHOTOS_TYPE_BASE_MANAGER, PhotosBaseManagerClass))
+
+#define PHOTOS_IS_BASE_MANAGER(obj) \
+  (G_TYPE_CHECK_INSTANCE_TYPE ((obj), \
+   PHOTOS_TYPE_BASE_MANAGER))
+
+#define PHOTOS_IS_BASE_MANAGER_CLASS(klass) \
+  (G_TYPE_CHECK_CLASS_TYPE ((klass), \
+   PHOTOS_TYPE_BASE_MANAGER))
+
+#define PHOTOS_BASE_MANAGER_GET_CLASS(obj) \
+  (G_TYPE_INSTANCE_GET_CLASS ((obj), \
+   PHOTOS_TYPE_BASE_MANAGER, PhotosBaseManagerClass))
+
+typedef struct _PhotosBaseManager        PhotosBaseManager;
+typedef struct _PhotosBaseManagerClass   PhotosBaseManagerClass;
+typedef struct _PhotosBaseManagerPrivate PhotosBaseManagerPrivate;
+
+struct _PhotosBaseManager
+{
+  GObject parent_instance;
+  PhotosBaseManagerPrivate *priv;
+};
+
+struct _PhotosBaseManagerClass
+{
+  GObjectClass parent_class;
+
+  void (*active_changed) (PhotosBaseManager *self);
+  void (*item_added)     (PhotosBaseManager *self);
+  void (*item_removed)   (PhotosBaseManager *self);
+};
+
+GType               photos_base_manager_get_type           (void) G_GNUC_CONST;
+
+PhotosBaseManager  *photos_base_manager_new                (void);
+
+G_END_DECLS
+
+#endif /* PHOTOS_BASE_MANAGER_H */



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