[gnome-photos/wip/foo: 2/8] Add PhotosOffsetCollectionsController



commit f14114cb919f369a9e2f20c7f8aa6dee18f2fd64
Author: Debarshi Ray <debarshir gnome org>
Date:   Mon Apr 8 16:06:15 2013 +0200

    Add PhotosOffsetCollectionsController

 src/Makefile.am                            |    2 +
 src/photos-offset-collections-controller.c |   85 ++++++++++++++++++++++++++++
 src/photos-offset-collections-controller.h |   73 ++++++++++++++++++++++++
 3 files changed, 160 insertions(+), 0 deletions(-)
---
diff --git a/src/Makefile.am b/src/Makefile.am
index b939d0d..047bf32 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -94,6 +94,8 @@ gnome_photos_SOURCES = \
        photos-mode-controller.h \
        photos-notification-manager.c \
        photos-notification-manager.h \
+       photos-offset-collections-controller.c \
+       photos-offset-collections-controller.h \
        photos-offset-controller.c \
        photos-offset-controller.h \
        photos-offset-favorites-controller.c \
diff --git a/src/photos-offset-collections-controller.c b/src/photos-offset-collections-controller.c
new file mode 100644
index 0000000..3898a86
--- /dev/null
+++ b/src/photos-offset-collections-controller.c
@@ -0,0 +1,85 @@
+/*
+ * Photos - access, organize and share your photos on GNOME
+ * Copyright © 2013 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.
+ */
+
+/* Based on code from:
+ *   + Documents
+ */
+
+
+#include "config.h"
+
+#include "photos-query-builder.h"
+#include "photos-offset-collections-controller.h"
+
+
+G_DEFINE_TYPE (PhotosOffsetCollectionsController,
+               photos_offset_collections_controller,
+               PHOTOS_TYPE_OFFSET_CONTROLLER);
+
+
+static PhotosQuery *
+photos_offset_collections_controller_get_query (void)
+{
+  return photos_query_builder_count_collections_query ();
+}
+
+
+static GObject *
+photos_offset_collections_controller_constructor (GType type,
+                                                  guint n_construct_params,
+                                                  GObjectConstructParam *construct_params)
+{
+  static GObject *self = NULL;
+
+  if (self == NULL)
+    {
+      self = G_OBJECT_CLASS (photos_offset_collections_controller_parent_class)->constructor (type,
+                                                                                              
n_construct_params,
+                                                                                              
construct_params);
+      g_object_add_weak_pointer (self, (gpointer) &self);
+      return self;
+    }
+
+  return g_object_ref (self);
+}
+
+
+static void
+photos_offset_collections_controller_init (PhotosOffsetCollectionsController *self)
+{
+}
+
+
+static void
+photos_offset_collections_controller_class_init (PhotosOffsetCollectionsControllerClass *class)
+{
+  GObjectClass *object_class = G_OBJECT_CLASS (class);
+  PhotosOffsetControllerClass *offset_controller_class = PHOTOS_OFFSET_CONTROLLER_CLASS (class);
+
+  object_class->constructor = photos_offset_collections_controller_constructor;
+  offset_controller_class->get_query = photos_offset_collections_controller_get_query;
+}
+
+
+PhotosOffsetController *
+photos_offset_collections_controller_new (void)
+{
+  return g_object_new (PHOTOS_TYPE_OFFSET_COLLECTIONS_CONTROLLER, NULL);
+}
diff --git a/src/photos-offset-collections-controller.h b/src/photos-offset-collections-controller.h
new file mode 100644
index 0000000..2616aa3
--- /dev/null
+++ b/src/photos-offset-collections-controller.h
@@ -0,0 +1,73 @@
+/*
+ * Photos - access, organize and share your photos on GNOME
+ * Copyright © 2013 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.
+ */
+
+/* Based on code from:
+ *   + Documents
+ */
+
+#ifndef PHOTOS_OFFSET_COLLECTIONS_CONTROLLER_H
+#define PHOTOS_OFFSET_COLLECTIONS_CONTROLLER_H
+
+#include "photos-offset-controller.h"
+
+G_BEGIN_DECLS
+
+#define PHOTOS_TYPE_OFFSET_COLLECTIONS_CONTROLLER (photos_offset_collections_controller_get_type ())
+
+#define PHOTOS_OFFSET_COLLECTIONS_CONTROLLER(obj) \
+  (G_TYPE_CHECK_INSTANCE_CAST ((obj), \
+   PHOTOS_TYPE_OFFSET_COLLECTIONS_CONTROLLER, PhotosOffsetCollectionsController))
+
+#define PHOTOS_OFFSET_COLLECTIONS_CONTROLLER_CLASS(klass) \
+  (G_TYPE_CHECK_CLASS_CAST ((klass), \
+   PHOTOS_TYPE_OFFSET_COLLECTIONS_CONTROLLER, PhotosOffsetCollectionsControllerClass))
+
+#define PHOTOS_IS_OFFSET_COLLECTIONS_CONTROLLER(obj) \
+  (G_TYPE_CHECK_INSTANCE_TYPE ((obj), \
+   PHOTOS_TYPE_OFFSET_COLLECTIONS_CONTROLLER))
+
+#define PHOTOS_IS_OFFSET_COLLECTIONS_CONTROLLER_CLASS(klass) \
+  (G_TYPE_CHECK_CLASS_TYPE ((klass), \
+   PHOTOS_TYPE_OFFSET_COLLECTIONS_CONTROLLER))
+
+#define PHOTOS_OFFSET_COLLECTIONS_CONTROLLER_GET_CLASS(obj) \
+  (G_TYPE_INSTANCE_GET_CLASS ((obj), \
+   PHOTOS_TYPE_OFFSET_COLLECTIONS_CONTROLLER, PhotosOffsetCollectionsControllerClass))
+
+typedef struct _PhotosOffsetCollectionsController        PhotosOffsetCollectionsController;
+typedef struct _PhotosOffsetCollectionsControllerClass   PhotosOffsetCollectionsControllerClass;
+
+struct _PhotosOffsetCollectionsController
+{
+  PhotosOffsetController parent_instance;
+};
+
+struct _PhotosOffsetCollectionsControllerClass
+{
+  PhotosOffsetControllerClass parent_class;
+};
+
+GType                    photos_offset_collections_controller_get_type          (void) G_GNUC_CONST;
+
+PhotosOffsetController  *photos_offset_collections_controller_new               (void);
+
+G_END_DECLS
+
+#endif /* PHOTOS_OFFSET_COLLECTIONS_CONTROLLER_H */


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