dia r4264 - in trunk: . lib objects/KAOS objects/SISSI objects/custom objects/standard plug-ins/cairo plug-ins/cgm plug-ins/drs plug-ins/dxf plug-ins/hpgl plug-ins/libart plug-ins/metapost plug-ins/pgf plug-ins/postscript plug-ins/pstricks plug-ins/python plug-ins/vdx plug-ins/wmf plug-ins/wpg plug-ins/xfig



Author: hans
Date: Sat Feb  7 10:45:18 2009
New Revision: 4264
URL: http://svn.gnome.org/viewvc/dia?rev=4264&view=rev

Log:
2009-02-07  Hans Breuer  <hans breuer org>

	* lib/diatypes.h : typedef _DiaImage DiaImage, i.e. make DiaImage 
	follow the naming pattern of every other struct in Dia's source ...
	* lib/dia_image.[ch] : ... and also sprinkled const and rename
	dia_image_release to dia_image_unref (too seldom used!)
	* objects/SISSI/sissi.h objects/SISSI/sissi.c objects/KAOS/metabinrel.c
	  objects/standard/image.c objects/custom/shape_info.h
	  lib/diarenderer.[ch] lib/diasvgrenderer.c lib/diagdkrenderer.c
	  plug-ins/python/pydia-render.c plug-ins/python/pydia-image.[ch]
	  plug-ins/dxf/dxf-export.c plug-ins/drs/dia-render-script-renderer.c
	  plug-ins/hpgl/hpgl.c plug-ins/metapost/render_metapost.c
	  plug-ins/cairo/diacairo-renderer.c plug-ins/pgf/render_pgf.c
	  plug-ins/pstricks/render_pstricks.c plug-ins/cgm/cgm.c
	  plug-ins/postscript/diapsrenderer.c plug-ins/wpg/wpg.c
	  plug-ins/libart/dialibartrenderer.c plug-ins/wmf/wmf.cpp
	  plug-ins/xfig/xfig-export.c plug-ins/vdx/vdx-export.c : adapted 
	accordingly in prepartion to fix bug #570850
	* objects/SISSI/sissi.c : don't leak ObjectSISSI::image
	



Modified:
   trunk/ChangeLog
   trunk/lib/dia_image.c
   trunk/lib/dia_image.h
   trunk/lib/diagdkrenderer.c
   trunk/lib/diarenderer.c
   trunk/lib/diarenderer.h
   trunk/lib/diasvgrenderer.c
   trunk/lib/diatypes.h
   trunk/objects/KAOS/metabinrel.c
   trunk/objects/SISSI/sissi.c
   trunk/objects/SISSI/sissi.h
   trunk/objects/custom/shape_info.h
   trunk/objects/standard/image.c
   trunk/plug-ins/cairo/diacairo-renderer.c
   trunk/plug-ins/cgm/cgm.c
   trunk/plug-ins/drs/dia-render-script-renderer.c
   trunk/plug-ins/dxf/dxf-export.c
   trunk/plug-ins/hpgl/hpgl.c
   trunk/plug-ins/libart/dialibartrenderer.c
   trunk/plug-ins/metapost/render_metapost.c
   trunk/plug-ins/pgf/render_pgf.c
   trunk/plug-ins/postscript/diapsrenderer.c
   trunk/plug-ins/pstricks/render_pstricks.c
   trunk/plug-ins/python/pydia-image.c
   trunk/plug-ins/python/pydia-image.h
   trunk/plug-ins/python/pydia-render.c
   trunk/plug-ins/vdx/vdx-export.c
   trunk/plug-ins/wmf/wmf.cpp
   trunk/plug-ins/wpg/wpg.c
   trunk/plug-ins/xfig/xfig-export.c

Modified: trunk/lib/dia_image.c
==============================================================================
--- trunk/lib/dia_image.c	(original)
+++ trunk/lib/dia_image.c	Sat Feb  7 10:45:18 2009
@@ -55,10 +55,10 @@
 /** Get the image to put in place of a image that cannot be read.
  * @returns A statically allocated image.
  */
-DiaImage
+DiaImage *
 dia_image_get_broken(void)
 {
-  static DiaImage broken = NULL;
+  static DiaImage *broken = NULL;
 
   if (broken == NULL) {
     broken = g_new(struct _DiaImage, 1);
@@ -79,10 +79,10 @@
  * @returns An image loaded from file, or NULL if an error occurred.
  *          Error messages will be displayed to the user.
  */
-DiaImage
-dia_image_load(gchar *filename)
+DiaImage *
+dia_image_load(const gchar *filename)
 {
-  DiaImage dia_img;
+  DiaImage *dia_img;
   GdkPixbuf *image;
   GError *error = NULL;
 
@@ -98,7 +98,7 @@
     return NULL;
   }
 
-  dia_img = g_new(struct _DiaImage, 1);
+  dia_img = g_new(DiaImage, 1);
   dia_img->image = image;
   /* We have a leak here, unless we add our own refcount */
   dia_img->filename = g_strdup(filename);
@@ -112,7 +112,7 @@
  * @param image Image that we want a reference to.
  */
 void
-dia_image_add_ref(DiaImage image)
+dia_image_add_ref(DiaImage *image)
 {
   gdk_pixbuf_ref(image->image);
 }
@@ -121,7 +121,7 @@
  * @param image Image to unreference.
  */
 void
-dia_image_release(DiaImage image)
+dia_image_unref(DiaImage *image)
 {
   gdk_pixbuf_unref(image->image);
 }
@@ -135,7 +135,7 @@
  * @param height Height in pixels of rendering in window.
  */
 void 
-dia_image_draw(DiaImage image, GdkWindow *window, GdkGC *gc,
+dia_image_draw(DiaImage *image, GdkWindow *window, GdkGC *gc,
 	       int x, int y, int width, int height)
 {
   GdkPixbuf *scaled;
@@ -179,7 +179,7 @@
  * @returns The natural width of the object in pixels.
  */
 int 
-dia_image_width(DiaImage image)
+dia_image_width(const DiaImage *image)
 {
   return gdk_pixbuf_get_width(image->image);
 }
@@ -189,7 +189,7 @@
  * @returns The natural height of the object in pixels.
  */
 int 
-dia_image_height(DiaImage image)
+dia_image_height(const DiaImage *image)
 {
   return gdk_pixbuf_get_height(image->image);
 }
@@ -199,7 +199,7 @@
  * @returns The rowstride number of the image.
  */
 int
-dia_image_rowstride(DiaImage image)
+dia_image_rowstride(const DiaImage *image)
 {
   return gdk_pixbuf_get_rowstride(image->image);
 }
@@ -208,7 +208,7 @@
  * @returns The pixbuf
  */
 const GdkPixbuf* 
-dia_image_pixbuf (DiaImage image)
+dia_image_pixbuf (const DiaImage *image)
 {
   return image->image;
 }
@@ -219,7 +219,7 @@
  *          This array should be freed after use.
  */
 guint8 *
-dia_image_rgb_data(DiaImage image)
+dia_image_rgb_data(const DiaImage *image)
 {
   int width = dia_image_width(image);
   int height = dia_image_height(image);
@@ -252,7 +252,7 @@
  *          from the image.  This array should be freed after use.
  */
 guint8 *
-dia_image_mask_data(DiaImage image)
+dia_image_mask_data(const DiaImage *image)
 {
   guint8 *pixels;
   guint8 *mask;
@@ -282,7 +282,7 @@
  *          NULL if the image has no alpha channel.
  */
 const guint8 *
-dia_image_rgba_data(DiaImage image)
+dia_image_rgba_data(const DiaImage *image)
 {
   if (gdk_pixbuf_get_has_alpha(image->image)) {
     const guint8 *pixels = gdk_pixbuf_get_pixels(image->image);
@@ -299,7 +299,7 @@
  *          has no filename.  This string should *not* be freed by the caller.
  */
 const char *
-dia_image_filename(DiaImage image)
+dia_image_filename(const DiaImage *image)
 {
   if (!image->filename)
     return "(null)";

Modified: trunk/lib/dia_image.h
==============================================================================
--- trunk/lib/dia_image.h	(original)
+++ trunk/lib/dia_image.h	Sat Feb  7 10:45:18 2009
@@ -27,34 +27,33 @@
 
 void dia_image_init(void);
 
-DiaImage dia_image_get_broken(void);
+DiaImage *dia_image_get_broken(void);
 
-DiaImage dia_image_load(gchar *filename);
-void dia_image_add_ref(DiaImage image);
-void dia_image_release(DiaImage image);
-void dia_image_draw(DiaImage image, GdkWindow *window, GdkGC *gc,
+DiaImage *dia_image_load(const gchar *filename);
+void dia_image_add_ref(DiaImage *image);
+void dia_image_unref(DiaImage *image);
+void dia_image_draw(DiaImage *image, GdkWindow *window, GdkGC *gc,
 		    int x, int y, int width, int height);
 
-int dia_image_width(DiaImage image);
-int dia_image_rowstride(DiaImage image);
-int dia_image_height(DiaImage image);
+int dia_image_width(const DiaImage *image);
+int dia_image_rowstride(const DiaImage *image);
+int dia_image_height(const DiaImage *image);
 /** Returns a copy of the RGB data in this image with any alpha stripped 
  * The returned buffer must be freed after use.
  * The buffer is laid out as dia_image_width*dia_image_rowstride*3 bytes.
  */
-guint8 *dia_image_rgb_data(DiaImage image);
+guint8 *dia_image_rgb_data(const DiaImage *image);
 /** Returns a copy of the alpha data in this image, or NULL if none
  * The returned buffer must be freed after use.
  * The buffer is laid out as dia_image_width*dia_image_height bytes.
  */
-guint8 *dia_image_mask_data(DiaImage image);
+guint8 *dia_image_mask_data(const DiaImage *image);
 /** Returns the RGBA data in this image, or NULL if there's no alpha.
  * Note that this is the raw data, not a copy.
  */
-const guint8 *dia_image_rgba_data(DiaImage image);
-const char *dia_image_filename(DiaImage image);
-const GdkPixbuf* dia_image_pixbuf (DiaImage image);
+const guint8 *dia_image_rgba_data(const DiaImage *image);
+const char *dia_image_filename(const DiaImage *image);
+const GdkPixbuf* dia_image_pixbuf (const DiaImage *image);
 
 #endif /* DIA_IMAGE_H */
 
-

Modified: trunk/lib/diagdkrenderer.c
==============================================================================
--- trunk/lib/diagdkrenderer.c	(original)
+++ trunk/lib/diagdkrenderer.c	Sat Feb  7 10:45:18 2009
@@ -96,7 +96,7 @@
 static void draw_image (DiaRenderer *renderer,
                         Point *point,
                         real width, real height,
-                        DiaImage image);
+                        DiaImage *image);
 
 static void draw_rect (DiaRenderer *renderer,
                        Point *ul_corner, Point *lr_corner,
@@ -795,7 +795,7 @@
 draw_image (DiaRenderer *object,
             Point *point, 
             real width, real height,
-            DiaImage image)
+            DiaImage *image)
 {
   DiaGdkRenderer *renderer = DIA_GDK_RENDERER (object);
   if (renderer->highlight_color != NULL) {

Modified: trunk/lib/diarenderer.c
==============================================================================
--- trunk/lib/diarenderer.c	(original)
+++ trunk/lib/diarenderer.c	Sat Feb  7 10:45:18 2009
@@ -106,7 +106,7 @@
 static void draw_image (DiaRenderer *renderer,
                         Point *point,
                         real width, real height,
-                        DiaImage image);
+                        DiaImage *image);
 static void draw_text  (DiaRenderer *renderer,
                         Text *text);
 static void draw_text_line  (DiaRenderer *renderer,
@@ -456,7 +456,7 @@
 static void 
 draw_image (DiaRenderer *renderer,
             Point *point, real width, real height,
-            DiaImage image)
+            DiaImage *image)
 {
   g_warning ("%s::draw_image not implemented!", 
              G_OBJECT_CLASS_NAME (G_OBJECT_GET_CLASS (renderer)));

Modified: trunk/lib/diarenderer.h
==============================================================================
--- trunk/lib/diarenderer.h	(original)
+++ trunk/lib/diarenderer.h	Sat Feb  7 10:45:18 2009
@@ -155,7 +155,7 @@
   void (*draw_image) (DiaRenderer *renderer,
                       Point *point,
                       real width, real height,
-                      DiaImage image);
+                      DiaImage *image);
 
   /* 
    * Functions which SHOULD be implemented by specific renderer, but

Modified: trunk/lib/diasvgrenderer.c
==============================================================================
--- trunk/lib/diasvgrenderer.c	(original)
+++ trunk/lib/diasvgrenderer.c	Sat Feb  7 10:45:18 2009
@@ -719,7 +719,7 @@
 draw_image(DiaRenderer *self,
 	   Point *point,
 	   real width, real height,
-	   DiaImage image)
+	   DiaImage *image)
 {
   DiaSvgRenderer *renderer = DIA_SVG_RENDERER (self);
   xmlNodePtr node;

Modified: trunk/lib/diatypes.h
==============================================================================
--- trunk/lib/diatypes.h	(original)
+++ trunk/lib/diatypes.h	Sat Feb  7 10:45:18 2009
@@ -57,7 +57,7 @@
 typedef struct _BezierCreateData BezierCreateData;
 
 /* In dia_image.h: */
-typedef struct _DiaImage *DiaImage;
+typedef struct _DiaImage DiaImage;
 
 /* In diagdkrenderer.h: */
 typedef struct _DiaGdkRenderer DiaGdkRenderer;

Modified: trunk/objects/KAOS/metabinrel.c
==============================================================================
--- trunk/objects/KAOS/metabinrel.c	(original)
+++ trunk/objects/KAOS/metabinrel.c	Sat Feb  7 10:45:18 2009
@@ -358,7 +358,6 @@
   Point p1,p2,pm1,pm2;
   Point pa1,pa2;
   Arrow arrow;
-  DiaImage img;
   gchar *annot;
   double k,dx,dy,dxn,dyn,dxp,dyp;
 
@@ -376,9 +375,6 @@
 
   endpoints = &mbr->connection.endpoints[0];
 
-  /* assigning a mid-range bitmap for some metarelations */
-  img=NULL; /* no image */
-
   /* some computations */
   p1 = endpoints[0];     /* could reverse direction here */
   p2 = endpoints[1];

Modified: trunk/objects/SISSI/sissi.c
==============================================================================
--- trunk/objects/SISSI/sissi.c	(original)
+++ trunk/objects/SISSI/sissi.c	Sat Feb  7 10:45:18 2009
@@ -302,8 +302,9 @@
     renderer_ops->set_linejoin(renderer, LINEJOIN_MITER);
   } else {
 /*
-//     DiaImage broken = dia_image_get_broken();
+//     DiaImage *broken = dia_image_get_broken();
 //     renderer_ops->draw_image(renderer, &elem->corner, elem->width, elem->height, broken);
+//     dia_image_unref(broken);
 */
   }
     text_set_position(object_sissi->text,&text_corner);
@@ -484,6 +485,8 @@
   g_free(object_sissi->name);
   if (object_sissi->text)
     text_destroy(object_sissi->text);
+  if (object_sissi->image)
+    dia_image_unref(object_sissi->image);
 
   if (object_sissi->properties_dialog!=NULL)
   	dialog_sissi_destroy(object_sissi->properties_dialog);

Modified: trunk/objects/SISSI/sissi.h
==============================================================================
--- trunk/objects/SISSI/sissi.h	(original)
+++ trunk/objects/SISSI/sissi.h	Sat Feb  7 10:45:18 2009
@@ -102,7 +102,7 @@
   real 			dashlength;
   real 			line_width;
 
-  DiaImage 		image;
+  DiaImage 		*image;
   gchar 		*file;	/* url of file picture */
   real 			border_width;
   Color 		border_color;

Modified: trunk/objects/custom/shape_info.h
==============================================================================
--- trunk/objects/custom/shape_info.h	(original)
+++ trunk/objects/custom/shape_info.h	Sat Feb  7 10:45:18 2009
@@ -105,7 +105,7 @@
   SHAPE_INFO_COMMON;
   Point topleft;
   real width, height;
-  DiaImage image;
+  DiaImage *image;
 };
 
 #define OFFSET_METHOD_PROPORTIONAL 0

Modified: trunk/objects/standard/image.c
==============================================================================
--- trunk/objects/standard/image.c	(original)
+++ trunk/objects/standard/image.c	Sat Feb  7 10:45:18 2009
@@ -58,7 +58,7 @@
   LineStyle line_style;
   real dashlength;
   
-  DiaImage image;
+  DiaImage *image;
   gchar *file;
   gboolean draw_border;
   gboolean keep_aspect;
@@ -191,7 +191,7 @@
   /* handle changing the image. */
   if (strcmp(image->file, old_file) != 0 || image->mtime != mtime) {
     Element *elem = &image->element;
-    DiaImage img = NULL;
+    DiaImage *img = NULL;
 
     img = dia_image_load(image->file);
     if (img)
@@ -370,9 +370,10 @@
     renderer_ops->draw_image(renderer, &elem->corner, elem->width,
 			      elem->height, image->image);
   } else {
-    DiaImage broken = dia_image_get_broken();
+    DiaImage *broken = dia_image_get_broken();
     renderer_ops->draw_image(renderer, &elem->corner, elem->width,
 			      elem->height, broken);
+    dia_image_unref(broken);
   }
 }
 
@@ -476,7 +477,7 @@
     g_free(image->file);
 
   if (image->image != NULL)
-    dia_image_release(image->image);
+    dia_image_unref(image->image);
 
   element_destroy(&image->element);
 }

Modified: trunk/plug-ins/cairo/diacairo-renderer.c
==============================================================================
--- trunk/plug-ins/cairo/diacairo-renderer.c	(original)
+++ trunk/plug-ins/cairo/diacairo-renderer.c	Sat Feb  7 10:45:18 2009
@@ -705,7 +705,7 @@
 draw_image(DiaRenderer *self,
            Point *point,
            real width, real height,
-           DiaImage image)
+           DiaImage *image)
 {
   DiaCairoRenderer *renderer = DIA_CAIRO_RENDERER (self);
   cairo_surface_t *surface;

Modified: trunk/plug-ins/cgm/cgm.c
==============================================================================
--- trunk/plug-ins/cgm/cgm.c	(original)
+++ trunk/plug-ins/cgm/cgm.c	Sat Feb  7 10:45:18 2009
@@ -306,7 +306,7 @@
 static void draw_image(DiaRenderer *self,
 		       Point *point,
 		       real width, real height,
-		       DiaImage image);
+		       DiaImage *image);
 
 static void
 init_attributes( CgmRenderer *renderer )
@@ -1091,7 +1091,7 @@
 draw_image(DiaRenderer *self,
 	   Point *point,
 	   real width, real height,
-	   DiaImage image)
+	   DiaImage *image)
 {
     CgmRenderer *renderer = CGM_RENDERER(self);
     const gint maxlen = 32767 - 6 * REALSIZE - 4 * 2;

Modified: trunk/plug-ins/drs/dia-render-script-renderer.c
==============================================================================
--- trunk/plug-ins/drs/dia-render-script-renderer.c	(original)
+++ trunk/plug-ins/drs/dia-render-script-renderer.c	Sat Feb  7 10:45:18 2009
@@ -653,7 +653,7 @@
 draw_image(DiaRenderer *self,
            Point *point,
            real width, real height,
-           DiaImage image)
+           DiaImage *image)
 {
   DrsRenderer *renderer = DRS_RENDERER (self);
   xmlNodePtr node;

Modified: trunk/plug-ins/dxf/dxf-export.c
==============================================================================
--- trunk/plug-ins/dxf/dxf-export.c	(original)
+++ trunk/plug-ins/dxf/dxf-export.c	Sat Feb  7 10:45:18 2009
@@ -164,7 +164,7 @@
 static void draw_image(DiaRenderer *self,
 		       Point *point,
 		       real width, real height,
-		       DiaImage image);
+		       DiaImage *image);
 
 static void dxf_renderer_class_init (DxfRendererClass *klass);
 
@@ -528,7 +528,7 @@
 draw_image(DiaRenderer *self,
 	   Point *point,
 	   real width, real height,
-	   DiaImage image)
+	   DiaImage *image)
 {
 }
 

Modified: trunk/plug-ins/hpgl/hpgl.c
==============================================================================
--- trunk/plug-ins/hpgl/hpgl.c	(original)
+++ trunk/plug-ins/hpgl/hpgl.c	Sat Feb  7 10:45:18 2009
@@ -607,7 +607,7 @@
 draw_image(DiaRenderer *object,
 	   Point *point,
 	   real width, real height,
-	   DiaImage image)
+	   DiaImage *image)
 {
     DIAG_NOTE(g_message("draw_image %fx%f @%f,%f", 
               width, height, point->x, point->y));

Modified: trunk/plug-ins/libart/dialibartrenderer.c
==============================================================================
--- trunk/plug-ins/libart/dialibartrenderer.c	(original)
+++ trunk/plug-ins/libart/dialibartrenderer.c	Sat Feb  7 10:45:18 2009
@@ -1260,7 +1260,7 @@
 draw_image(DiaRenderer *self,
 	   Point *point,
 	   real width, real height,
-	   DiaImage image)
+	   DiaImage *image)
 {
   DiaLibartRenderer *renderer = DIA_LIBART_RENDERER (self);
 

Modified: trunk/plug-ins/metapost/render_metapost.c
==============================================================================
--- trunk/plug-ins/metapost/render_metapost.c	(original)
+++ trunk/plug-ins/metapost/render_metapost.c	Sat Feb  7 10:45:18 2009
@@ -215,7 +215,7 @@
 static void draw_image(DiaRenderer *self,
 		       Point *point,
 		       real width, real height,
-		       DiaImage image);
+		       DiaImage *image);
 
 /* GObject stuff */
 static void metapost_renderer_class_init (MetapostRendererClass *klass);
@@ -1080,7 +1080,7 @@
 draw_image(DiaRenderer *self,
 	   Point *point,
 	   real width, real height,
-	   DiaImage image)
+	   DiaImage *image)
 {
     /* images have a banding problem */
     int img_width, img_height, img_rowstride;

Modified: trunk/plug-ins/pgf/render_pgf.c
==============================================================================
--- trunk/plug-ins/pgf/render_pgf.c	(original)
+++ trunk/plug-ins/pgf/render_pgf.c	Sat Feb  7 10:45:18 2009
@@ -148,7 +148,7 @@
 static void draw_image(DiaRenderer *self,
 		       Point *point,
 		       real width, real height,
-		       DiaImage image);
+		       DiaImage *image);
   
 static void draw_line_with_arrows(DiaRenderer *renderer, Point *start, Point *end, 
                                   real line_width, Color *line_color,
@@ -1175,7 +1175,7 @@
 draw_image(DiaRenderer *self,
 	   Point *point,
 	   real width, real height,
-	   DiaImage image)
+	   DiaImage *image)
 {
     PgfRenderer *renderer = PGF_RENDERER(self);
 

Modified: trunk/plug-ins/postscript/diapsrenderer.c
==============================================================================
--- trunk/plug-ins/postscript/diapsrenderer.c	(original)
+++ trunk/plug-ins/postscript/diapsrenderer.c	Sat Feb  7 10:45:18 2009
@@ -743,7 +743,7 @@
 draw_image(DiaRenderer *self,
 	   Point *point,
 	   real width, real height,
-	   DiaImage image)
+	   DiaImage *image)
 {
   DiaPsRenderer *renderer = DIA_PS_RENDERER(self);
   int img_width, img_height, img_rowstride;

Modified: trunk/plug-ins/pstricks/render_pstricks.c
==============================================================================
--- trunk/plug-ins/pstricks/render_pstricks.c	(original)
+++ trunk/plug-ins/pstricks/render_pstricks.c	Sat Feb  7 10:45:18 2009
@@ -124,7 +124,7 @@
 static void draw_image(DiaRenderer *self,
 		       Point *point,
 		       real width, real height,
-		       DiaImage image);
+		       DiaImage *image);
 
 static void pstricks_renderer_class_init (PstricksRendererClass *klass);
 
@@ -800,7 +800,7 @@
 draw_image(DiaRenderer *self,
 	   Point *point,
 	   real width, real height,
-	   DiaImage image)
+	   DiaImage *image)
 {
     PstricksRenderer *renderer = PSTRICKS_RENDERER(self);
     int img_width, img_height;

Modified: trunk/plug-ins/python/pydia-image.c
==============================================================================
--- trunk/plug-ins/python/pydia-image.c	(original)
+++ trunk/plug-ins/python/pydia-image.c	Sat Feb  7 10:45:18 2009
@@ -25,7 +25,7 @@
 /*
  * New
  */
-PyObject* PyDiaImage_New (DiaImage image)
+PyObject* PyDiaImage_New (DiaImage *image)
 {
   PyDiaImage *self;
   
@@ -44,7 +44,7 @@
 static void
 PyDiaImage_Dealloc(PyDiaImage *self)
 {
-  dia_image_release (self->image);
+  dia_image_unref (self->image);
   PyObject_DEL(self);
 }
 
@@ -55,7 +55,7 @@
 PyDiaImage_Compare(PyDiaImage *self,
                    PyDiaImage *other)
 {
-  return memcmp(&(self->image), &(other->image), sizeof(DiaImage));
+  return memcmp(&(self->image), &(other->image), sizeof(DiaImage *));
 }
 
 /*
@@ -99,7 +99,7 @@
     }
   }
   else if (!strcmp(attr, "rgb_data")) {
-    char* s = dia_image_rgb_data(self->image);
+    unsigned char* s = dia_image_rgb_data(self->image);
     int len = dia_image_width(self->image) * dia_image_height(self->image) * 3;
     PyObject* py_s = PyString_FromStringAndSize(s, len);
     g_free (s);

Modified: trunk/plug-ins/python/pydia-image.h
==============================================================================
--- trunk/plug-ins/python/pydia-image.h	(original)
+++ trunk/plug-ins/python/pydia-image.h	Sat Feb  7 10:45:18 2009
@@ -6,11 +6,11 @@
 
 typedef struct {
     PyObject_HEAD
-    DiaImage image;
+    DiaImage *image;
 } PyDiaImage;
 
 extern PyTypeObject PyDiaImage_Type;
 
-PyObject* PyDiaImage_New (DiaImage image);
+PyObject* PyDiaImage_New (DiaImage *image);
 
 #endif

Modified: trunk/plug-ins/python/pydia-render.c
==============================================================================
--- trunk/plug-ins/python/pydia-render.c	(original)
+++ trunk/plug-ins/python/pydia-render.c	Sat Feb  7 10:45:18 2009
@@ -682,7 +682,7 @@
 draw_image(DiaRenderer *renderer,
 	   Point *point,
 	   real width, real height,
-	   DiaImage image)
+	   DiaImage *image)
 {
   PyObject *func, *res, *arg, *self = PYDIA_RENDERER (renderer);
 

Modified: trunk/plug-ins/vdx/vdx-export.c
==============================================================================
--- trunk/plug-ins/vdx/vdx-export.c	(original)
+++ trunk/plug-ins/vdx/vdx-export.c	Sat Feb  7 10:45:18 2009
@@ -149,7 +149,7 @@
 static void draw_image(DiaRenderer *self,
 		       Point *point,
 		       real width, real height,
-		       DiaImage image);
+		       DiaImage *image);
 
 static void vdx_renderer_class_init (VDXRendererClass *klass);
 
@@ -1453,7 +1453,7 @@
 static void draw_image(DiaRenderer *self,
 		       Point *point,
 		       real width, real height,
-		       DiaImage image)
+		       DiaImage *image)
 {
     VDXRenderer *renderer = VDX_RENDERER(self);
     Point a, bottom_left;

Modified: trunk/plug-ins/wmf/wmf.cpp
==============================================================================
--- trunk/plug-ins/wmf/wmf.cpp	(original)
+++ trunk/plug-ins/wmf/wmf.cpp	Sat Feb  7 10:45:18 2009
@@ -972,7 +972,7 @@
 draw_image(DiaRenderer *self,
 	   Point *point,
 	   real width, real height,
-	   DiaImage image)
+	   DiaImage *image)
 {
     WmfRenderer *renderer = WMF_RENDERER (self);
 #ifdef SAVE_EMF

Modified: trunk/plug-ins/wpg/wpg.c
==============================================================================
--- trunk/plug-ins/wpg/wpg.c	(original)
+++ trunk/plug-ins/wpg/wpg.c	Sat Feb  7 10:45:18 2009
@@ -862,7 +862,7 @@
 draw_image(DiaRenderer *self,
            Point *point,
            real width, real height,
-           DiaImage image)
+           DiaImage *image)
 {
   WpgRenderer *renderer = WPG_RENDERER (self);
   WPGBitmap2 bmp;

Modified: trunk/plug-ins/xfig/xfig-export.c
==============================================================================
--- trunk/plug-ins/xfig/xfig-export.c	(original)
+++ trunk/plug-ins/xfig/xfig-export.c	Sat Feb  7 10:45:18 2009
@@ -169,7 +169,7 @@
 static void draw_image(DiaRenderer *self,
 		       Point *point,
 		       real width, real height,
-		       DiaImage image);
+		       DiaImage *image);
 static void draw_object(DiaRenderer *self,
 			DiaObject *object);
 
@@ -1100,7 +1100,7 @@
 draw_image(DiaRenderer *self,
            Point *point,
            real width, real height,
-           DiaImage image) 
+           DiaImage *image) 
 {
   XfigRenderer *renderer = XFIG_RENDERER(self);
   gchar d_buf[DTOSTR_BUF_SIZE];



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