[gnome-photos/wip/foo: 4/10] base-item: Read the bounding box when loading, and make it available



commit 34cecdb1863028c508112aad783f22b27c77838f
Author: Debarshi Ray <debarshir gnome org>
Date:   Mon Mar 25 23:33:54 2013 +0100

    base-item: Read the bounding box when loading, and make it available
    
    We will need this when printing.

 src/photos-base-item.c |    9 +++++++++
 src/photos-base-item.h |    2 ++
 2 files changed, 11 insertions(+), 0 deletions(-)
---
diff --git a/src/photos-base-item.c b/src/photos-base-item.c
index bc792bd..597a2aa 100644
--- a/src/photos-base-item.c
+++ b/src/photos-base-item.c
@@ -43,6 +43,7 @@ struct _PhotosBaseItemPrivate
   GdkPixbuf *pristine_icon;
   GeglNode *graph;
   GeglNode *node;
+  GeglRectangle bbox;
   GMutex mutex;
   TrackerSparqlCursor *cursor;
   gboolean collection;
@@ -218,6 +219,7 @@ photos_base_item_default_load (PhotosBaseItem *self, GCancellable *cancellable,
     }
 
   gegl_node_process (priv->node);
+  priv->bbox = gegl_node_get_bounding_box (priv->node);
   ret_val = g_object_ref (priv->node);
 
  out:
@@ -761,6 +763,13 @@ photos_base_item_get_author (PhotosBaseItem *self)
 }
 
 
+GeglRectangle
+photos_base_item_get_bbox (PhotosBaseItem *self)
+{
+  return self->priv->bbox;
+}
+
+
 gint64
 photos_base_item_get_date_created (PhotosBaseItem *self)
 {
diff --git a/src/photos-base-item.h b/src/photos-base-item.h
index ad2a3b3..5e563a3 100644
--- a/src/photos-base-item.h
+++ b/src/photos-base-item.h
@@ -84,6 +84,8 @@ void                photos_base_item_destroy            (PhotosBaseItem *self);
 
 const gchar        *photos_base_item_get_author         (PhotosBaseItem *self);
 
+GeglRectangle       photos_base_item_get_bbox           (PhotosBaseItem *self);
+
 gint64              photos_base_item_get_date_created   (PhotosBaseItem *self);
 
 const gchar        *photos_base_item_get_default_app_name (PhotosBaseItem *self);


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