dia r4280 - in trunk: . lib objects/Database objects/FS objects/Misc objects/chronogram plug-ins/wmf plug-ins/xslt



Author: hans
Date: Sun Feb 15 16:27:37 2009
New Revision: 4280
URL: http://svn.gnome.org/viewvc/dia?rev=4280&view=rev

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

	* app/disp_callbacks.c : allow obj->ops->get_object_menu() return NULL
	  objects/standard/outline.c : use it for outline_get_object_menu



Modified:
   trunk/ChangeLog
   trunk/lib/diagdkrenderer.c
   trunk/lib/diarenderer.c
   trunk/lib/object.c
   trunk/lib/object_defaults.c
   trunk/lib/sheet.c
   trunk/objects/Database/table_dialog.c
   trunk/objects/FS/flow.c
   trunk/objects/Misc/measure.c
   trunk/objects/chronogram/chronoline_event.c
   trunk/plug-ins/wmf/wmf.cpp
   trunk/plug-ins/xslt/xslt.c

Modified: trunk/lib/diagdkrenderer.c
==============================================================================
--- trunk/lib/diagdkrenderer.c	(original)
+++ trunk/lib/diagdkrenderer.c	Sun Feb 15 16:27:37 2009
@@ -685,7 +685,7 @@
     int width_pixels = dia_transform_length(renderer->transform,
 					    text_line_get_width(text_line));
     gdk_gc_set_foreground(renderer->gc, &gdkcolor);
-    gdk_gc_set_dashes(renderer->gc, 0, "\1\2", 2);
+    gdk_gc_set_dashes(renderer->gc, 0, (guint8*)"\1\2", 2);
     dia_transform_coords(renderer->transform, start_pos.x, start_pos.y, &x, &y);
     gdk_draw_line(renderer->pixmap, renderer->gc, x, y, x + width_pixels, y);
     return;

Modified: trunk/lib/diarenderer.c
==============================================================================
--- trunk/lib/diarenderer.c	(original)
+++ trunk/lib/diarenderer.c	Sun Feb 15 16:27:37 2009
@@ -141,13 +141,13 @@
                                     Arrow *start_arrow,
                                     Arrow *end_arrow);
 static void draw_arc_with_arrows  (DiaRenderer *renderer, 
-                                  const Point *start, 
-				  const Point *end,
-                                  const Point *midpoint,
+                                  Point *start, 
+				  Point *end,
+                                  Point *midpoint,
                                   real line_width,
-                                  const Color *color,
-                                  const Arrow *start_arrow,
-                                  const Arrow *end_arrow);
+                                  Color *color,
+                                  Arrow *start_arrow,
+                                  Arrow *end_arrow);
 static void draw_polyline_with_arrows (DiaRenderer *renderer, 
                                        Point *points, int num_points,
                                        real line_width,
@@ -1237,13 +1237,13 @@
 
 static void
 draw_arc_with_arrows (DiaRenderer *renderer, 
-                      const Point *startpoint, 
-                      const Point *endpoint,
-                      const Point *midpoint,
+                      Point *startpoint, 
+                      Point *endpoint,
+                      Point *midpoint,
                       real line_width,
-                      const Color *color,
-                      const Arrow *start_arrow,
-                      const Arrow *end_arrow)
+                      Color *color,
+                      Arrow *start_arrow,
+                      Arrow *end_arrow)
 {
   Point new_startpoint = *startpoint;
   Point new_endpoint = *endpoint;

Modified: trunk/lib/object.c
==============================================================================
--- trunk/lib/object.c	(original)
+++ trunk/lib/object.c	Sun Feb 15 16:27:37 2009
@@ -129,7 +129,7 @@
 static guint
 pointer_hash(gpointer some_pointer)
 {
-  return (guint) some_pointer;
+  return GPOINTER_TO_UINT(some_pointer);
 }
 
 

Modified: trunk/lib/object_defaults.c
==============================================================================
--- trunk/lib/object_defaults.c	(original)
+++ trunk/lib/object_defaults.c	Sun Feb 15 16:27:37 2009
@@ -360,8 +360,9 @@
   xmlSetProp(obj_node, (const xmlChar *)"id", (xmlChar *)buffer);
 
   /* if it looks like intdata store it as well */
-  if ((int)obj->type->default_user_data > 0 && (int)obj->type->default_user_data < 0xFF) {
-    g_snprintf(buffer, 30, "%d", (int)obj->type->default_user_data);
+  if (   GPOINTER_TO_INT(obj->type->default_user_data) > 0 
+      && GPOINTER_TO_INT(obj->type->default_user_data) < 0xFF) {
+    g_snprintf(buffer, 30, "%d", GPOINTER_TO_INT(obj->type->default_user_data));
     xmlSetProp(obj_node, (const xmlChar *)"intdata", (xmlChar *)buffer);
   }
 

Modified: trunk/lib/sheet.c
==============================================================================
--- trunk/lib/sheet.c	(original)
+++ trunk/lib/sheet.c	Sun Feb 15 16:27:37 2009
@@ -428,7 +428,7 @@
     xmlFree(objdesc); objdesc = NULL;
 
     sheet_obj->pixmap = NULL;
-    sheet_obj->user_data = (void *)intdata; /* XXX modify user_data type ? */
+    sheet_obj->user_data = GINT_TO_POINTER(intdata); /* XXX modify user_data type ? */
     sheet_obj->user_data_type = has_intdata ? USER_DATA_IS_INTDATA /* sure,   */
                                             : USER_DATA_IS_OTHER;  /* why not */
     sheet_obj->pixmap_file = iconname; 

Modified: trunk/objects/Database/table_dialog.c
==============================================================================
--- trunk/objects/Database/table_dialog.c	(original)
+++ trunk/objects/Database/table_dialog.c	Sun Feb 15 16:27:37 2009
@@ -323,7 +323,7 @@
   TableState * old_state;
   GList * lst;
 
-  g_print ("apply (o: 0x%08x) (c: 0x%08x)\n", (guint) obj, (guint) change);
+  g_print ("apply (o: 0x%08x) (c: 0x%08x)\n", GPOINTER_TO_UINT(obj), GPOINTER_TO_UINT(change));
 
   /* first the get the current state for later use */
   old_state = table_state_new (change->obj);

Modified: trunk/objects/FS/flow.c
==============================================================================
--- trunk/objects/FS/flow.c	(original)
+++ trunk/objects/FS/flow.c	Sun Feb 15 16:27:37 2009
@@ -615,7 +615,7 @@
 {
   ObjectChange *change;
 
-  change = type_create_change((Flow *)obj, (int)data);
+  change = type_create_change((Flow *)obj, GPOINTER_TO_INT(data));
   change->apply(change, obj);
 
   return change;

Modified: trunk/objects/Misc/measure.c
==============================================================================
--- trunk/objects/Misc/measure.c	(original)
+++ trunk/objects/Misc/measure.c	Sun Feb 15 16:27:37 2009
@@ -109,7 +109,7 @@
   (MoveHandleFunc)      measure_move_handle,
   (GetPropertiesFunc)   object_create_props_dialog,
   (ApplyPropertiesDialogFunc) object_apply_props_from_dialog,
-  (ObjectMenuFunc)      NULL, /* measure_get_object_menu, */
+  (ObjectMenuFunc)      measure_get_object_menu,
   (DescribePropsFunc)   measure_describe_props,
   (GetPropsFunc)        measure_get_props,
   (SetPropsFunc)        measure_set_props,
@@ -324,6 +324,13 @@
   measure_update_data(measure);
   return NULL;
 }
+static DiaMenu *
+measure_get_object_menu(Measure *measure,
+                        Point *clickedpoint)
+{
+  return NULL;
+}
+
 static ObjectChange* 
 measure_move (Measure *measure, Point *to)
 {

Modified: trunk/objects/chronogram/chronoline_event.c
==============================================================================
--- trunk/objects/chronogram/chronoline_event.c	(original)
+++ trunk/objects/chronogram/chronoline_event.c	Sun Feb 15 16:27:37 2009
@@ -228,7 +228,8 @@
 inline static int 
 __forward_checksum_r(int chk, real value) 
 {
-  return __forward_checksum_i(chk,*((int *)(&value)));
+  int ival = (int)value;
+  return __forward_checksum_i(chk,ival);
 }
 
 static int

Modified: trunk/plug-ins/wmf/wmf.cpp
==============================================================================
--- trunk/plug-ins/wmf/wmf.cpp	(original)
+++ trunk/plug-ins/wmf/wmf.cpp	Sun Feb 15 16:27:37 2009
@@ -1300,13 +1300,13 @@
 	renderer->yoff = - data->extents.top;
 	renderer->scale = scale;
     } else {
-        int  ppc = W32::GetDeviceCaps (renderer->hPrintDC, PHYSICALWIDTH) 
-	            / ( data->paper.lmargin + data->paper.width + data->paper.rmargin);
+        int  ppc = (int)(W32::GetDeviceCaps (renderer->hPrintDC, PHYSICALWIDTH) 
+	            / ( data->paper.lmargin + data->paper.width + data->paper.rmargin));
 	/* respect margins */
-	renderer->margins.left   = ppc * data->paper.lmargin - W32::GetDeviceCaps (renderer->hPrintDC, PHYSICALOFFSETX);
-	renderer->margins.top    = ppc * data->paper.tmargin - W32::GetDeviceCaps (renderer->hPrintDC, PHYSICALOFFSETY);
-	renderer->margins.right  = W32::GetDeviceCaps (renderer->hPrintDC, PHYSICALWIDTH) - ppc * data->paper.rmargin;
-	renderer->margins.bottom = W32::GetDeviceCaps (renderer->hPrintDC, PHYSICALHEIGHT) - ppc * data->paper.bmargin;
+	renderer->margins.left   = (int)(ppc * data->paper.lmargin - W32::GetDeviceCaps (renderer->hPrintDC, PHYSICALOFFSETX));
+	renderer->margins.top    = (int)(ppc * data->paper.tmargin - W32::GetDeviceCaps (renderer->hPrintDC, PHYSICALOFFSETY));
+	renderer->margins.right  = (int)(W32::GetDeviceCaps (renderer->hPrintDC, PHYSICALWIDTH) - ppc * data->paper.rmargin);
+	renderer->margins.bottom = (int)(W32::GetDeviceCaps (renderer->hPrintDC, PHYSICALHEIGHT) - ppc * data->paper.bmargin);
 
 	renderer->xoff = - data->extents.left;
 	renderer->yoff = - data->extents.top;

Modified: trunk/plug-ins/xslt/xslt.c
==============================================================================
--- trunk/plug-ins/xslt/xslt.c	(original)
+++ trunk/plug-ins/xslt/xslt.c	Sun Feb 15 16:27:37 2009
@@ -182,8 +182,8 @@
 	to = g_malloc(sizeof(toxsl_t));	
 	to->next = NULL;
 	
-	to->name = xmlGetProp(cur, (const xmlChar *) "name");
-	to->xsl = xmlGetProp(cur, (const xmlChar *) "stylesheet");
+	to->name = (gchar *)xmlGetProp(cur, (const xmlChar *) "name");
+	to->xsl = (gchar *)xmlGetProp(cur, (const xmlChar *) "stylesheet");
 	
 	if (!(to->name && to->xsl)) {
 	    g_warning ("Name and stylesheet attributes are required for the implementation element %s in XSLT plugin configuration file", cur->name);
@@ -245,12 +245,12 @@
 
     while (cur) {
 	if (xmlIsBlankNode(cur) || xmlNodeIsText(cur)) { cur = cur->next; continue; }
-	else if (!xmlStrcmp(cur->name, "language")) {
-	    fromxsl_t *new_from = g_malloc(sizeof(fromxsl_t));
+	else if (!xmlStrcmp(cur->name, (const xmlChar *)"language")) {
+	    fromxsl_t *new_from = g_new(fromxsl_t,1);
 	    new_from->next = NULL;
 
-	    new_from->name = xmlGetProp(cur, (const xmlChar *) "name");
-	    new_from->xsl = xmlGetProp(cur, (const xmlChar *) "stylesheet");
+	    new_from->name = (gchar *)xmlGetProp(cur, (const xmlChar *) "name");
+	    new_from->xsl = (gchar *)xmlGetProp(cur, (const xmlChar *) "stylesheet");
 	    
 	    if (!(new_from->name && new_from->xsl)) {
 		g_warning ("'name' and 'stylesheet' attributes are required for the language element %s in XSLT plugin configuration file", cur->name);



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