gdip-pixbuf-loader r28 - in trunk: . src



Author: doml
Date: Thu Feb 21 23:50:28 2008
New Revision: 28
URL: http://svn.gnome.org/viewvc/gdip-pixbuf-loader?rev=28&view=rev

Log:
2008-02-21  Dom Lachowicz <domlachowicz gmail com>

	* src/io-gdip-utils.c (io_gdip_init): Make this idempotent
	* src/io-gdip.c: Function that fills the GdkPixbufIO vtable. To be used across
	various GDI+-based plugins

Modified:
   trunk/ChangeLog
   trunk/src/io-gdip-utils.c
   trunk/src/io-gdip.c

Modified: trunk/src/io-gdip-utils.c
==============================================================================
--- trunk/src/io-gdip-utils.c	(original)
+++ trunk/src/io-gdip-utils.c	Thu Feb 21 23:50:28 2008
@@ -61,12 +61,10 @@
   ULONG_PTR gdiplusToken = 0;
   static HINSTANCE gdipluslib = NULL;
 
-  input.GdiplusVersion = 1;
-  input.DebugEventCallback = NULL;
-  input.SuppressBackgroundThread = input.SuppressExternalCodecs = FALSE;
-
   if (!gdipluslib)
     gdipluslib = LoadLibrary ("gdiplus.dll");
+  else
+    return TRUE; /* io_gdip_init() is idempotent */
 
   if (!gdipluslib)
     return FALSE;
@@ -104,6 +102,10 @@
   TRY_LOOKUP (GetImageEncodersSize);
 
 #undef LOOKUP
+
+  input.GdiplusVersion = 1;
+  input.DebugEventCallback = NULL;
+  input.SuppressBackgroundThread = input.SuppressExternalCodecs = FALSE;
   
   return (GdiplusStartup (&gdiplusToken, &input, NULL) == 0 ? TRUE : FALSE);
 }

Modified: trunk/src/io-gdip.c
==============================================================================
--- trunk/src/io-gdip.c	(original)
+++ trunk/src/io-gdip.c	Thu Feb 21 23:50:28 2008
@@ -307,14 +307,21 @@
 }
 #endif
 
+/* meant to be shared across various GDI+ plugins, since we'll need multiple plugins to support saving to multiple formats */
 void
-fill_vtable (GdkPixbufModule *module)
+gdip_fill_vtable (GdkPixbufModule *module)
 {
   io_gdip_init ();
 
   module->begin_load     = gdk_pixbuf__gdip_image_begin_load;
   module->stop_load      = gdk_pixbuf__gdip_image_stop_load;
   module->load_increment = gdk_pixbuf__gdip_image_load_increment;
+}
+
+void
+fill_vtable (GdkPixbufModule *module)
+{
+  gdip_fill_vtable(module);
 
 #ifdef GDIP_TEST_SAVING
   module->save_to_callback = gdk_pixbuf__gdip_image_save_PNG_to_callback;



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