[gnome-photos/wip/foo: 3/8] Add PhotosTrackerCollectionsController



commit 92b45f6f566ec9c41a11d673d01fced22b71bb8c
Author: Debarshi Ray <debarshir gnome org>
Date:   Mon Apr 8 16:40:22 2013 +0200

    Add PhotosTrackerCollectionsController

 src/Makefile.am                             |    2 +
 src/photos-tracker-collections-controller.c |   90 +++++++++++++++++++++++++++
 src/photos-tracker-collections-controller.h |   69 ++++++++++++++++++++
 3 files changed, 161 insertions(+), 0 deletions(-)
---
diff --git a/src/Makefile.am b/src/Makefile.am
index 047bf32..6a16f7d 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -146,6 +146,8 @@ gnome_photos_SOURCES = \
        photos-tracker-change-event.h \
        photos-tracker-change-monitor.c \
        photos-tracker-change-monitor.h \
+       photos-tracker-collections-controller.c \
+       photos-tracker-collections-controller.h \
        photos-tracker-controller.c \
        photos-tracker-controller.h \
        photos-tracker-favorites-controller.c \
diff --git a/src/photos-tracker-collections-controller.c b/src/photos-tracker-collections-controller.c
new file mode 100644
index 0000000..9ad3984
--- /dev/null
+++ b/src/photos-tracker-collections-controller.c
@@ -0,0 +1,90 @@
+/*
+ * 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.
+ */
+
+
+#include "config.h"
+
+#include "photos-offset-collections-controller.h"
+#include "photos-query-builder.h"
+#include "photos-tracker-collections-controller.h"
+
+
+G_DEFINE_TYPE (PhotosTrackerCollectionsController,
+               photos_tracker_collections_controller,
+               PHOTOS_TYPE_TRACKER_CONTROLLER);
+
+
+static PhotosOffsetController *
+photos_tracker_collections_controller_get_offset_controller (void)
+{
+  return photos_offset_collections_controller_new ();
+}
+
+
+static PhotosQuery *
+photos_tracker_collections_controller_get_query (void)
+{
+  return photos_query_builder_global_collections_query ();
+}
+
+
+static GObject *
+photos_tracker_collections_controller_constructor (GType type,
+                                                   guint n_construct_params,
+                                                   GObjectConstructParam *construct_params)
+{
+  static GObject *self = NULL;
+
+  if (self == NULL)
+    {
+      self = G_OBJECT_CLASS (photos_tracker_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_tracker_collections_controller_init (PhotosTrackerCollectionsController *self)
+{
+}
+
+
+static void
+photos_tracker_collections_controller_class_init (PhotosTrackerCollectionsControllerClass *class)
+{
+  GObjectClass *object_class = G_OBJECT_CLASS (class);
+  PhotosTrackerControllerClass *tracker_controller_class = PHOTOS_TRACKER_CONTROLLER_CLASS (class);
+
+  object_class->constructor = photos_tracker_collections_controller_constructor;
+  tracker_controller_class->get_offset_controller = 
photos_tracker_collections_controller_get_offset_controller;
+  tracker_controller_class->get_query = photos_tracker_collections_controller_get_query;
+}
+
+
+PhotosTrackerController *
+photos_tracker_collections_controller_new (void)
+{
+  return g_object_new (PHOTOS_TYPE_TRACKER_COLLECTIONS_CONTROLLER, NULL);
+}
diff --git a/src/photos-tracker-collections-controller.h b/src/photos-tracker-collections-controller.h
new file mode 100644
index 0000000..820fa04
--- /dev/null
+++ b/src/photos-tracker-collections-controller.h
@@ -0,0 +1,69 @@
+/*
+ * 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.
+ */
+
+#ifndef PHOTOS_TRACKER_COLLECTIONS_CONTROLLER_H
+#define PHOTOS_TRACKER_COLLECTIONS_CONTROLLER_H
+
+#include "photos-tracker-controller.h"
+
+G_BEGIN_DECLS
+
+#define PHOTOS_TYPE_TRACKER_COLLECTIONS_CONTROLLER (photos_tracker_collections_controller_get_type ())
+
+#define PHOTOS_TRACKER_COLLECTIONS_CONTROLLER(obj) \
+  (G_TYPE_CHECK_INSTANCE_CAST ((obj), \
+   PHOTOS_TYPE_TRACKER_COLLECTIONS_CONTROLLER, PhotosTrackerCollectionsController))
+
+#define PHOTOS_TRACKER_COLLECTIONS_CONTROLLER_CLASS(klass) \
+  (G_TYPE_CHECK_CLASS_CAST ((klass), \
+   PHOTOS_TYPE_TRACKER_COLLECTIONS_CONTROLLER, PhotosTrackerCollectionsControllerClass))
+
+#define PHOTOS_IS_TRACKER_COLLECTIONS_CONTROLLER(obj) \
+  (G_TYPE_CHECK_INSTANCE_TYPE ((obj), \
+   PHOTOS_TYPE_TRACKER_COLLECTIONS_CONTROLLER))
+
+#define PHOTOS_IS_TRACKER_COLLECTIONS_CONTROLLER_CLASS(klass) \
+  (G_TYPE_CHECK_CLASS_TYPE ((klass), \
+   PHOTOS_TYPE_TRACKER_COLLECTIONS_CONTROLLER))
+
+#define PHOTOS_TRACKER_COLLECTIONS_CONTROLLER_GET_CLASS(obj) \
+  (G_TYPE_INSTANCE_GET_CLASS ((obj), \
+   PHOTOS_TYPE_TRACKER_COLLECTIONS_CONTROLLER, PhotosTrackerCollectionsControllerClass))
+
+typedef struct _PhotosTrackerCollectionsController        PhotosTrackerCollectionsController;
+typedef struct _PhotosTrackerCollectionsControllerClass   PhotosTrackerCollectionsControllerClass;
+
+struct _PhotosTrackerCollectionsController
+{
+  PhotosTrackerController parent_instance;
+};
+
+struct _PhotosTrackerCollectionsControllerClass
+{
+  PhotosTrackerControllerClass parent_class;
+};
+
+GType                     photos_tracker_collections_controller_get_type          (void) G_GNUC_CONST;
+
+PhotosTrackerController  *photos_tracker_collections_controller_new               (void);
+
+G_END_DECLS
+
+#endif /* PHOTOS_TRACKER_COLLECTIONS_CONTROLLER_H */


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