dia r3889 - in trunk: . bindings lib objects/custom



Author: hans
Date: Sat Mar  1 17:41:55 2008
New Revision: 3889
URL: http://svn.gnome.org/viewvc/dia?rev=3889&view=rev

Log:
2008-03-01  Hans Breuer  <hans breuer org>

	* bindings/* : make it compile again after DiaObject method renaming
	* lib/units.[ch] : gobal variables need to be explicit exported - or
	better avoided
	* objects/custom/custom_object.c objects/custom/shape_info.c : fix
	missing includes and gccisms (c99isms)



Modified:
   trunk/ChangeLog
   trunk/bindings/dia-object.cpp
   trunk/lib/libdia.def
   trunk/lib/units.c
   trunk/lib/units.h
   trunk/objects/custom/custom_object.c
   trunk/objects/custom/shape_info.c

Modified: trunk/bindings/dia-object.cpp
==============================================================================
--- trunk/bindings/dia-object.cpp	(original)
+++ trunk/bindings/dia-object.cpp	Sat Mar  1 17:41:55 2008
@@ -79,6 +79,8 @@
 dia::ObjectType::apply_defaults ()
 {
     assert (self);
+    if (!self->ops->apply_defaults)
+	return;
     self->ops->apply_defaults ();
 }
 
@@ -153,6 +155,8 @@
 dia::Object::get_properties (bool is_default) const
 {
     assert (self);
+    if (!self->ops->get_properties)
+	return 0;
     return self->ops->get_properties (self, is_default);
 }
 //! OPTIONAL: apply the properties changed in the dialog
@@ -160,13 +164,17 @@
 dia::Object::apply_properties (GtkWidget* w)
 {
     assert (self);
-    return self->ops->apply_properties (self, w);
+    if (!self->ops->apply_properties_from_dialog)
+	return NULL;
+    return self->ops->apply_properties_from_dialog (self, w);
 }
 //! OPTIONAL: provide a context menu to change the object states
 DiaMenu* 
 dia::Object::get_object_menu (Point* pos) const
 {
     assert (self);
+    if (!self->ops->get_object_menu)
+	return 0;
     return self->ops->get_object_menu (self, pos);
 }
     

Modified: trunk/lib/libdia.def
==============================================================================
--- trunk/lib/libdia.def	(original)
+++ trunk/lib/libdia.def	Sat Mar  1 17:41:55 2008
@@ -691,3 +691,4 @@
  find_prop_by_name
  dia_object_get_enclosing_box
 
+ calculate_object_edge

Modified: trunk/lib/units.c
==============================================================================
--- trunk/lib/units.c	(original)
+++ trunk/lib/units.c	Sat Mar  1 17:41:55 2008
@@ -2,7 +2,7 @@
 #include "units.h"
 
 /* from gnome-libs/libgnome/gnome-paper.c */
-const DiaUnitDef units[] =
+const DIAVAR DiaUnitDef units[] =
 {
   /* XXX does anyone *really* measure paper size in feet?  meters? */
 

Modified: trunk/lib/units.h
==============================================================================
--- trunk/lib/units.h	(original)
+++ trunk/lib/units.h	Sat Mar  1 17:41:55 2008
@@ -19,6 +19,7 @@
 #define UNITS_H
 
 #include <config.h>
+#include "diavar.h"
 
 typedef enum {
   DIA_UNIT_CENTIMETER,
@@ -39,6 +40,6 @@
   int digits; /** Number of digits after the decimal separator */
 };
 
-extern const DiaUnitDef units[];
+const DIAVAR DiaUnitDef units[];
 
 #endif /* UNITS_H */

Modified: trunk/objects/custom/custom_object.c
==============================================================================
--- trunk/objects/custom/custom_object.c	(original)
+++ trunk/objects/custom/custom_object.c	Sat Mar  1 17:41:55 2008
@@ -50,6 +50,7 @@
 #include "properties.h"
 #include "dia_image.h"
 #include "custom_object.h"
+#include "prefs.h"
 
 #include "pixmaps/custom.xpm"
 
@@ -415,6 +416,10 @@
 transform_subshape_coord(Custom *custom, GraphicElementSubShape* subshape,
                          const Point *p1, Point *out)
 {
+  real scale, width, height, xoffs, yoffs;
+  coord cx, cy;
+  Rectangle orig_bounds, new_bounds;
+
   if (subshape->default_scale == 0.0) {
     ShapeInfo *info = custom->info;
     real svg_width = info->shape_bounds.right - info->shape_bounds.left;
@@ -424,20 +429,20 @@
                                    units[prefs_get_length_unit()].factor;
   }
   
-  real scale = custom->subscale * subshape->default_scale;
+  scale = custom->subscale * subshape->default_scale;
   	      
-  coord cx = 0.0;
-  coord cy = 0.0;
+  cx = 0.0;
+  cy = 0.0;
   
-  real width = 0.0;
-  real height = 0.0;
+  width = 0.0;
+  height = 0.0;
   
-  real xoffs = custom->xoffs;
-  real yoffs = custom->yoffs;
+  xoffs = custom->xoffs;
+  yoffs = custom->yoffs;
   
   /* step 1: calculate boundaries */
-  Rectangle orig_bounds = custom->info->shape_bounds;
-  Rectangle new_bounds;
+  orig_bounds = custom->info->shape_bounds;
+  new_bounds;
   
   /* step 2: undo unkown/funky number magic when flip_h or flip_v is set */
   if(custom->flip_h) custom->xscale = -custom->xscale;

Modified: trunk/objects/custom/shape_info.c
==============================================================================
--- trunk/objects/custom/shape_info.c	(original)
+++ trunk/objects/custom/shape_info.c	Sat Mar  1 17:41:55 2008
@@ -36,6 +36,7 @@
 #include "dia_image.h"
 #include "message.h"
 #include "intl.h"
+#include "prefs.h"
 
 #include "units.h"
 



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