[gnome-photos/wip/rishi/thumbnailer: 11/20] gegl, utils: Move the registration of the built-in GEGL operations



commit 7740e409b94b64f5f080e58584abb0ea6fb651cd
Author: Debarshi Ray <debarshir gnome org>
Date:   Tue Feb 14 11:05:34 2017 +0100

    gegl, utils: Move the registration of the built-in GEGL operations
    
    We will need to register the built-in operations in the thumbnailer
    too. There are too many build dependencies associated with
    photos-utils.[ch] that we can't have in the thumbnailer.

 src/photos-gegl.c  |   29 +++++++++++++++++++++++++++++
 src/photos-gegl.h  |    2 ++
 src/photos-utils.c |   11 ++---------
 3 files changed, 33 insertions(+), 9 deletions(-)
---
diff --git a/src/photos-gegl.c b/src/photos-gegl.c
index cd7e8f9..c370336 100644
--- a/src/photos-gegl.c
+++ b/src/photos-gegl.c
@@ -23,6 +23,14 @@
 
 #include "photos-debug.h"
 #include "photos-gegl.h"
+#include "photos-operation-insta-curve.h"
+#include "photos-operation-insta-filter.h"
+#include "photos-operation-insta-hefe.h"
+#include "photos-operation-insta-hefe-curve.h"
+#include "photos-operation-insta-hefe-vignette.h"
+#include "photos-operation-jpg-guess-sizes.h"
+#include "photos-operation-png-guess-sizes.h"
+#include "photos-operation-saturation.h"
 #include "photos-quarks.h"
 
 
@@ -224,6 +232,27 @@ photos_gegl_get_buffer_from_node (GeglNode *node, const Babl *format)
 }
 
 
+void
+photos_gegl_ensure_builtins (void)
+{
+  static gsize once_init_value = 0;
+
+  if (g_once_init_enter (&once_init_value))
+    {
+      g_type_ensure (PHOTOS_TYPE_OPERATION_INSTA_CURVE);
+      g_type_ensure (PHOTOS_TYPE_OPERATION_INSTA_FILTER);
+      g_type_ensure (PHOTOS_TYPE_OPERATION_INSTA_HEFE);
+      g_type_ensure (PHOTOS_TYPE_OPERATION_INSTA_HEFE_CURVE);
+      g_type_ensure (PHOTOS_TYPE_OPERATION_INSTA_HEFE_VIGNETTE);
+      g_type_ensure (PHOTOS_TYPE_OPERATION_JPG_GUESS_SIZES);
+      g_type_ensure (PHOTOS_TYPE_OPERATION_PNG_GUESS_SIZES);
+      g_type_ensure (PHOTOS_TYPE_OPERATION_SATURATION);
+
+      g_once_init_leave (&once_init_value, 1);
+    }
+}
+
+
 static gboolean
 photos_gegl_processor_process_idle (gpointer user_data)
 {
diff --git a/src/photos-gegl.h b/src/photos-gegl.h
index ea8cebe..787dc56 100644
--- a/src/photos-gegl.h
+++ b/src/photos-gegl.h
@@ -45,6 +45,8 @@ GeglBuffer      *photos_gegl_dup_buffer_from_node         (GeglNode *node, const
 
 GeglBuffer      *photos_gegl_get_buffer_from_node         (GeglNode *node, const Babl *format);
 
+void             photos_gegl_ensure_builtins              (void);
+
 void             photos_gegl_processor_process_async      (GeglProcessor *processor,
                                                            GCancellable *cancellable,
                                                            GAsyncReadyCallback callback,
diff --git a/src/photos-utils.c b/src/photos-utils.c
index 9ed9aac..b47b7a8 100644
--- a/src/photos-utils.c
+++ b/src/photos-utils.c
@@ -40,6 +40,7 @@
 #include "photos-error.h"
 #include "photos-facebook-item.h"
 #include "photos-flickr-item.h"
+#include "photos-gegl.h"
 #include "photos-google-item.h"
 #include "photos-local-item.h"
 #include "photos-media-server-item.h"
@@ -656,6 +657,7 @@ photos_utils_ensure_builtins (void)
   static gsize once_init_value = 0;
 
   photos_utils_ensure_extension_points ();
+  photos_gegl_ensure_builtins ();
 
   if (g_once_init_enter (&once_init_value))
     {
@@ -665,15 +667,6 @@ photos_utils_ensure_builtins (void)
       g_type_ensure (PHOTOS_TYPE_LOCAL_ITEM);
       g_type_ensure (PHOTOS_TYPE_MEDIA_SERVER_ITEM);
 
-      g_type_ensure (PHOTOS_TYPE_OPERATION_INSTA_CURVE);
-      g_type_ensure (PHOTOS_TYPE_OPERATION_INSTA_FILTER);
-      g_type_ensure (PHOTOS_TYPE_OPERATION_INSTA_HEFE);
-      g_type_ensure (PHOTOS_TYPE_OPERATION_INSTA_HEFE_CURVE);
-      g_type_ensure (PHOTOS_TYPE_OPERATION_INSTA_HEFE_VIGNETTE);
-      g_type_ensure (PHOTOS_TYPE_OPERATION_JPG_GUESS_SIZES);
-      g_type_ensure (PHOTOS_TYPE_OPERATION_PNG_GUESS_SIZES);
-      g_type_ensure (PHOTOS_TYPE_OPERATION_SATURATION);
-
       g_type_ensure (PHOTOS_TYPE_SHARE_POINT_EMAIL);
       g_type_ensure (PHOTOS_TYPE_SHARE_POINT_GOOGLE);
 


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