[dia/cairo-port: 53/53] Fix some simple warnings to avoid important warning being missed
- From: Zander <zbrown src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [dia/cairo-port: 53/53] Fix some simple warnings to avoid important warning being missed
- Date: Sat, 11 May 2019 15:36:43 +0000 (UTC)
commit 079712821232fcdd19f593e01a8855d331c8d833
Author: Zander Brown <zbrown gnome org>
Date: Sat May 11 16:34:16 2019 +0100
Fix some simple warnings to avoid important warning being missed
app/display.c | 6 +-
app/gtkhwrapbox.c | 8 +-
app/gtkvwrapbox.c | 8 +-
app/menus.c | 3 +
lib/object.c | 2 +
lib/object.h | 28 +++----
objects/standard/image.c | 2 +-
plug-ins/layout/dia-graph.cpp | 4 +-
plug-ins/layout/layout.cpp | 21 +++--
plug-ins/python/pydia-properties.c | 26 +++---
plug-ins/python/pydia-property.c | 89 ++++++++++----------
plug-ins/wmf/wmf.cpp | 165 +++++++++++++++++++------------------
12 files changed, 186 insertions(+), 176 deletions(-)
---
diff --git a/app/display.c b/app/display.c
index 0439bf5d..909af87a 100644
--- a/app/display.c
+++ b/app/display.c
@@ -405,12 +405,12 @@ void
ddisplay_add_update(DDisplay *ddisp, const Rectangle *rect)
{
Rectangle *r;
- int width, height;
+ // int width, height;
if (!ddisp->renderer)
return; /* can happen at creation time of the diagram */
- width = dia_renderer_get_width_pixels (ddisp->renderer);
- height = dia_renderer_get_height_pixels (ddisp->renderer);
+ // width = dia_renderer_get_width_pixels (ddisp->renderer);
+ // height = dia_renderer_get_height_pixels (ddisp->renderer);
if (!rectangle_intersects(rect, &ddisp->visible))
return;
diff --git a/app/gtkhwrapbox.c b/app/gtkhwrapbox.c
index 30f5a46f..85f0718b 100644
--- a/app/gtkhwrapbox.c
+++ b/app/gtkhwrapbox.c
@@ -75,14 +75,14 @@ gtk_hwrap_box_get_type (void)
static void
gtk_hwrap_box_class_init (GtkHWrapBoxClass *class)
{
- GObjectClass *object_class;
+ // GObjectClass *object_class;
GtkWidgetClass *widget_class;
- GtkContainerClass *container_class;
+ // GtkContainerClass *container_class;
GtkWrapBoxClass *wrap_box_class;
- object_class = G_OBJECT_CLASS (class);
+ // object_class = G_OBJECT_CLASS (class);
widget_class = GTK_WIDGET_CLASS (class);
- container_class = GTK_CONTAINER_CLASS (class);
+ // container_class = GTK_CONTAINER_CLASS (class);
wrap_box_class = GTK_WRAP_BOX_CLASS (class);
parent_class = g_type_class_peek_parent (class);
diff --git a/app/gtkvwrapbox.c b/app/gtkvwrapbox.c
index f648e0d7..d5c0e259 100644
--- a/app/gtkvwrapbox.c
+++ b/app/gtkvwrapbox.c
@@ -75,14 +75,14 @@ gtk_vwrap_box_get_type (void)
static void
gtk_vwrap_box_class_init (GtkVWrapBoxClass *class)
{
- GObjectClass *object_class;
+ // GObjectClass *object_class;
GtkWidgetClass *widget_class;
- GtkContainerClass *container_class;
+ // GtkContainerClass *container_class;
GtkWrapBoxClass *wrap_box_class;
- object_class = G_OBJECT_CLASS (class);
+ // object_class = G_OBJECT_CLASS (class);
widget_class = GTK_WIDGET_CLASS (class);
- container_class = GTK_CONTAINER_CLASS (class);
+ // container_class = GTK_CONTAINER_CLASS (class);
wrap_box_class = GTK_WRAP_BOX_CLASS (class);
parent_class = g_type_class_peek_parent (class);
diff --git a/app/menus.c b/app/menus.c
index de4d7829..487fe823 100644
--- a/app/menus.c
+++ b/app/menus.c
@@ -353,6 +353,8 @@ load_accels(void)
g_free(accelfilename);
}
}
+
+/* FIXME: Apparently unused
static gint
save_accels(gpointer data)
{
@@ -365,6 +367,7 @@ save_accels(gpointer data)
}
return TRUE;
}
+*/
/**
* Synchronized the Object snap property button with the display.
diff --git a/lib/object.c b/lib/object.c
index c0ad00ec..55f4ad83 100644
--- a/lib/object.c
+++ b/lib/object.c
@@ -1259,7 +1259,9 @@ dia_object_type_get_icon (const DiaObjectType *type)
* compatability with 0.97.3 objects */
g_warning ("Object '%s' has an inline icon, this is deprecated",
type->name);
+ G_GNUC_BEGIN_IGNORE_DEPRECATIONS
pixbuf = gdk_pixbuf_new_from_inline (-1, (guint8 *) icon_data, TRUE, NULL);
+ G_GNUC_END_IGNORE_DEPRECATIONS
} else if (type->pixmap_file != NULL) {
GError *error = NULL;
pixbuf = gdk_pixbuf_new_from_file (type->pixmap_file, &error);
diff --git a/lib/object.h b/lib/object.h
index 6af6b055..af65794c 100644
--- a/lib/object.h
+++ b/lib/object.h
@@ -39,7 +39,7 @@ G_BEGIN_DECLS
/** Flags for DiaObject */
typedef enum {
/** Set this if the DiaObject can 'contain' other objects that move with
- * it, a.k.a. be a parent. A parent moves its children along and
+ * it, a.k.a. be a parent. A parent moves its children along and
* constricts its children to live inside its borders.
*/
DIA_OBJECT_CAN_PARENT = 1
@@ -106,7 +106,7 @@ typedef DiaObject* (*CreateFunc) (Point *startpoint,
*
* @param obj_node A node in an XML object to load from.
* @param version The version of the object found in the XML file.
- * @param filename The name of the file we're loading from, for use in
+ * @param filename The name of the file we're loading from, for use in
* error messages.
*
* \public \memberof _DiaObjectType
@@ -225,7 +225,7 @@ typedef void (*SelectFunc) (DiaObject* obj,
* \brief Copy constructor of _DiaObject.
*
* This must be an depth-copy (pointers must be duplicated and so on)
- * as the initial object can be deleted any time.
+ * as the initial object can be deleted any time.
*
* @param obj An object to make a copy of.
* @return A newly allocated object copied from `obj', but without any
@@ -332,7 +332,7 @@ typedef ObjectChange *(*ApplyPropertiesDialogFunc) (DiaObject* obj, GtkWidget *w
* \public \memberof _DiaObject
*/
typedef ObjectChange *(*ApplyPropertiesListFunc) (DiaObject* obj, GPtrArray* props);
-
+
/*!
* \brief Describe the properties that this object supports.
*
@@ -444,7 +444,7 @@ void object_remove_handle(DiaObject *obj, Handle *handle);
void object_add_connectionpoint(DiaObject *obj, ConnectionPoint *conpoint);
void object_remove_connectionpoint(DiaObject *obj,
ConnectionPoint *conpoint);
-void object_add_connectionpoint_at(DiaObject *obj,
+void object_add_connectionpoint_at(DiaObject *obj,
ConnectionPoint *conpoint,
int pos);
void object_connect(DiaObject *obj, Handle *handle,
@@ -458,14 +458,14 @@ void object_registry_foreach(GHFunc func, gpointer user_data);
DiaObjectType *object_get_type(char *name);
gchar *object_get_displayname (DiaObject* obj);
gboolean object_flags_set(DiaObject* obj, gint flags);
-
+
/* These functions can be used as a default implementation for an object which
can be completely described, loaded and saved through standard properties.
*/
DiaObject *object_load_using_properties(const DiaObjectType *type,
ObjectNode obj_node, int version,
DiaContext *ctx);
-void object_save_using_properties(DiaObject *obj, ObjectNode obj_node,
+void object_save_using_properties(DiaObject *obj, ObjectNode obj_node,
DiaContext *ctx);
DiaObject *object_copy_using_properties(DiaObject *obj);
@@ -494,7 +494,7 @@ struct _ObjectOps {
SetPropsFunc set_props;
TextEditFunc edit_text;
-
+
ApplyPropertiesListFunc apply_properties_list;
/*! check for NULL before calling */
TransformFunc transform;
@@ -504,7 +504,7 @@ struct _ObjectOps {
Then an older object will be binary compatible, because all new code
checks if new ops are supported (!= NULL)
*/
- void (*(unused[3]))(DiaObject *obj,...);
+ void (*unused[3])(DiaObject *obj,...);
};
/*!
@@ -524,7 +524,7 @@ struct _DiaObject {
Point position; /*!< often but not necessarily the upper left corner of the object */
/*!
* \brief Rectangle containing the whole object
- *
+ *
* The area that contains all parts of the 'real' object, i.e. the parts
* that would be printed, exported to pixmaps etc. This is also used to
* determine the size of autofit scaling, so it should be as large as
@@ -548,7 +548,7 @@ struct _DiaObject {
Layer *parent_layer; /*!< Back-pointer to the owning layer.
This may only be set by functions internal to
- the layer, and accessed via
+ the layer, and accessed via
dia_object_get_parent_layer() */
DiaObject *parent; /*!< Back-pointer to DiaObject which is parenting this object. Can be NULL */
GList *children; /*!< In case this object is a parent of other object the children are listed here */
@@ -583,7 +583,7 @@ struct _ObjectTypeOps {
Then an older object will be binary compatible, because all new code
checks if new ops are supported (!= NULL)
*/
- void (*(unused[10]))(DiaObject *obj,...);
+ void (*unused[10])(DiaObject *obj,...);
};
/*!
@@ -595,12 +595,12 @@ struct _ObjectTypeOps {
struct _DiaObjectType {
char *name; /*!< The type name should follow a pattern of '\<module\> - \<class\>' like "UML - Class" */
- int version; /*!< DiaObjects must be backward compatible, i.e. support possibly older versions formats */
+ int version; /*!< DiaObjects must be backward compatible, i.e. support possibly older versions formats */
const char **pixmap; /*!< Also put a pixmap in the sheet_object.
This one is used if not in sheet but in toolbar.
Stored in xpm format */
-
+
ObjectTypeOps *ops; /* pointer to the vtable */
char *pixmap_file; /*!< fallback if pixmap is NULL */
diff --git a/objects/standard/image.c b/objects/standard/image.c
index 005ae16e..761ba146 100644
--- a/objects/standard/image.c
+++ b/objects/standard/image.c
@@ -750,7 +750,7 @@ image_load(ObjectNode obj_node, int version, DiaContext *ctx)
DiaObject *obj;
int i;
AttributeNode attr;
- char *diafile_dir;
+ // char *diafile_dir;
image = g_malloc0(sizeof(Image));
elem = &image->element;
diff --git a/plug-ins/layout/dia-graph.cpp b/plug-ins/layout/dia-graph.cpp
index 7542fd19..99cb4f27 100644
--- a/plug-ins/layout/dia-graph.cpp
+++ b/plug-ins/layout/dia-graph.cpp
@@ -119,8 +119,8 @@ DiaGraph::AddEdge (int srcNode, int destNode, double* points, int len)
IGraph::eResult
DiaGraph::Layout (const char *module)
{
- double p1, p2;
- int n;
+ // double p1, p2;
+ // int n;
if (strcmp(module, "Grow") == 0)
return Scale (1.4142, 1.4142) ? SUCCESS : FAILED_ALGORITHM;
diff --git a/plug-ins/layout/layout.cpp b/plug-ins/layout/layout.cpp
index 6b066e4e..e91b2e76 100644
--- a/plug-ins/layout/layout.cpp
+++ b/plug-ins/layout/layout.cpp
@@ -18,7 +18,7 @@
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
-
+
/*!
* \file layout.cpp - plugin for automatic diagram layout
*/
@@ -74,7 +74,7 @@ static int
_obj_get_bends (DiaObject *obj, std::vector<double>& coords)
{
Property *prop = NULL;
-
+
coords.resize(0);
// no need to ask for Standard - Line: start_point, end_point
// we always drop the very first and last point
@@ -91,7 +91,7 @@ _obj_get_bends (DiaObject *obj, std::vector<double>& coords)
} else if ((prop = object_prop_by_name(obj, "bez_points")) != NULL) {
BezPointarrayProperty *ptp = (BezPointarrayProperty *)prop;
int num = ptp->bezpointarray_data->len;
-
+
for (int i = 1; i < num-1; ++i) {
BezPoint *bp = &g_array_index(ptp->bezpointarray_data, BezPoint, i);
@@ -114,7 +114,7 @@ static ObjectChange *
_obj_set_bends (DiaObject *obj, std::vector<double>& coords)
{
Property *prop = NULL;
-
+
if ((prop = object_prop_by_name(obj, "poly_points")) != NULL) {
PointarrayProperty *ptp = (PointarrayProperty *)prop;
int num = ptp->pointarray_data->len;
@@ -226,7 +226,7 @@ layout_callback (DiagramData *data,
nodes = g_list_append (nodes, o);
//FIXME: neither 1 nor num_handles-1 is guaranteed to be the second connection
// it entirely depends on the objects implementation
- else if ( o->num_handles > 1 && o->handles[0]->connected_to
+ else if ( o->num_handles > 1 && o->handles[0]->connected_to
&& (o->handles[1]->connected_to || o->handles[o->num_handles-1]->connected_to))
edges = g_list_append (edges, o);
list = g_list_next(list);
@@ -282,7 +282,7 @@ layout_callback (DiagramData *data,
if (g->GetNodePosition (n, &pt.x, &pt.y)) {
DiaObject *o = (DiaObject *)list->data;
GPtrArray *props = g_ptr_array_new ();
-
+
//FIXME: can't use "obj_pos", it is not read in usual update_data impementations
// "elem_corner" will only work for Element derived classes, but that covers most
// of the cases here ...
@@ -329,10 +329,12 @@ layout_callback1 (DiagramData *data,
{
return layout_callback (data, filename, flags, user_data, dia_graph_create);
}
+
+/* FIXME: Apparently unused?
static ObjectChange *
layout_callback2 (DiagramData *data,
const gchar *filename,
- guint flags, /* further additions */
+ guint flags, / * further additions * /
void *user_data)
{
#ifdef HAVE_OGDF
@@ -341,6 +343,7 @@ layout_callback2 (DiagramData *data,
return NULL;
#endif
}
+*/
#define AN_ENTRY(group, name, func) \
{ \
@@ -350,7 +353,7 @@ layout_callback2 (DiagramData *data,
layout_callback ##func, \
(void*)#name \
}
-
+
static DiaCallbackFilter cb_layout[] = {
#ifdef HAVE_OGDF
AN_ENTRY(Test, NotAvailable, 2),
@@ -375,7 +378,7 @@ static DiaCallbackFilter cb_layout[] = {
AN_ENTRY(Planar, Schnyder, 2),
AN_ENTRY(Energy-based, SpringEmbedderFR, 2),
AN_ENTRY(Energy-based, SpringEmbedderKK, 2),
- //Borked(huge):
+ //Borked(huge):
AN_ENTRY(Energy-based, StressMajorization, 2),
AN_ENTRY(Upward, Sugiyama, 2),
AN_ENTRY(Tree, TreeStraight, 2),
diff --git a/plug-ins/python/pydia-properties.c b/plug-ins/python/pydia-properties.c
index 98edbbc7..3f41d4a2 100644
--- a/plug-ins/python/pydia-properties.c
+++ b/plug-ins/python/pydia-properties.c
@@ -27,17 +27,17 @@
/*
* New
*/
-PyObject*
+PyObject*
PyDiaProperties_New (DiaObject* obj)
{
PyDiaProperties *self;
-
+
self = PyObject_NEW(PyDiaProperties, &PyDiaProperties_Type);
if (!self) return NULL;
-
+
self->object = obj; /* XXX: should be ref counted */
self->nprops = -1;
-
+
return (PyObject *)self;
}
@@ -100,14 +100,14 @@ PyDiaProperties_Get(PyDiaProperties *self, PyObject *args)
if (self->object->ops->get_props != NULL) {
Property *p;
char* name = PyString_AsString(key);
- p = object_prop_by_name (self->object, name);
+ p = object_prop_by_name (self->object, name);
if (p) {
val = PyDiaProperty_New(p); /* makes a copy */
p->ops->free(p);
}
}
-
- if (val == NULL) {
+
+ if (val == NULL) {
val = failobj;
Py_INCREF(val);
}
@@ -133,7 +133,7 @@ PyDiaProperties_HasKey(PyDiaProperties *self, PyObject *args)
name = PyString_AsString(key);
- p = object_prop_by_name (self->object, name);
+ p = object_prop_by_name (self->object, name);
ok = (NULL != p);
if (p)
p->ops->free(p);
@@ -167,7 +167,7 @@ PyDiaProperties_Keys(PyDiaProperties *self, PyObject *args)
return list;
}
-static int
+static Py_ssize_t
PyDiaProperties_Length (PyDiaProperties* self)
{
if (self->nprops < 0) {
@@ -198,10 +198,10 @@ PyDiaProperties_Subscript (PyDiaProperties *self, register PyObject *key)
}
else {
Property *p;
- char *name;
+ char *name;
name = PyString_AsString(key);
- p = object_prop_by_name (self->object, name);
+ p = object_prop_by_name (self->object, name);
if (p) {
v = PyDiaProperty_New(p); /* makes a copy */
@@ -225,10 +225,10 @@ PyDiaProperties_AssSub (PyDiaProperties* self, PyObject *key, PyObject *val)
}
else {
Property *p;
- char *name;
+ char *name;
name = PyString_AsString(key);
- p = object_prop_by_name (self->object, name);
+ p = object_prop_by_name (self->object, name);
/* g_print ("AssSub(key: '%s', type <%s>)\n", name, (p ? p->type : "none")); */
if (p) {
diff --git a/plug-ins/python/pydia-property.c b/plug-ins/python/pydia-property.c
index 5fe4fd92..6f8d98bf 100644
--- a/plug-ins/python/pydia-property.c
+++ b/plug-ins/python/pydia-property.c
@@ -49,10 +49,10 @@
PyObject* PyDiaProperty_New (Property* property)
{
PyDiaProperty *self;
-
+
self = PyObject_NEW(PyDiaProperty, &PyDiaProperty_Type);
if (!self) return NULL;
-
+
self->property = property->ops->copy (property);
return (PyObject *)self;
@@ -98,13 +98,13 @@ PyDiaProperty_Hash(PyObject *self)
typedef PyObject * (*PyDiaPropGetFunc) (Property*);
typedef int (*PyDiaPropSetFunc) (Property*, PyObject *val);
-static PyObject * PyDia_get_Char (CharProperty *prop)
+static PyObject * PyDia_get_Char (CharProperty *prop)
{ return PyInt_FromLong(prop->char_data); }
-static PyObject * PyDia_get_Bool (BoolProperty *prop)
+static PyObject * PyDia_get_Bool (BoolProperty *prop)
{ return PyInt_FromLong(prop->bool_data); }
-static PyObject * PyDia_get_Int (IntProperty *prop)
+static PyObject * PyDia_get_Int (IntProperty *prop)
{ return PyInt_FromLong(prop->int_data); }
-static PyObject * PyDia_get_IntArray (IntarrayProperty *prop)
+static PyObject * PyDia_get_IntArray (IntarrayProperty *prop)
{
PyObject *ret;
int i, num;
@@ -113,14 +113,14 @@ static PyObject * PyDia_get_IntArray (IntarrayProperty *prop)
ret = PyTuple_New (num);
for (i = 0; i < num; i++)
- PyTuple_SetItem(ret, i,
+ PyTuple_SetItem(ret, i,
PyInt_FromLong(g_array_index(prop->intarray_data, gint, i)));
return ret;
}
-static PyObject * PyDia_get_Enum (EnumProperty *prop)
+static PyObject * PyDia_get_Enum (EnumProperty *prop)
{ return PyInt_FromLong(prop->enum_data); }
-static PyObject * PyDia_get_LineStyle (LinestyleProperty *prop)
-{
+static PyObject * PyDia_get_LineStyle (LinestyleProperty *prop)
+{
PyObject *ret;
ret = PyTuple_New (2);
@@ -128,14 +128,14 @@ static PyObject * PyDia_get_LineStyle (LinestyleProperty *prop)
PyTuple_SetItem(ret, 1, PyFloat_FromDouble(prop->dash));
return ret;
}
-static PyObject * PyDia_get_Real (RealProperty *prop)
+static PyObject * PyDia_get_Real (RealProperty *prop)
{ return PyFloat_FromDouble(prop->real_data); }
-static PyObject * PyDia_get_Length (LengthProperty *prop)
+static PyObject * PyDia_get_Length (LengthProperty *prop)
{ return PyFloat_FromDouble(prop->length_data); }
-static PyObject * PyDia_get_Fontsize (FontsizeProperty *prop)
+static PyObject * PyDia_get_Fontsize (FontsizeProperty *prop)
{ return PyFloat_FromDouble(prop->fontsize_data); }
-static PyObject * PyDia_get_String (StringProperty *prop)
-{
+static PyObject * PyDia_get_String (StringProperty *prop)
+{
if (NULL == prop->string_data)
return PyString_FromString("(NULL)");
else if (1 == prop->num_lines)
@@ -143,20 +143,20 @@ static PyObject * PyDia_get_String (StringProperty *prop)
else /* FIXME: MULTISTRING ? */
return PyString_FromString(prop->string_data);
}
-static PyObject * PyDia_get_StringList (StringListProperty *prop)
-{
+static PyObject * PyDia_get_StringList (StringListProperty *prop)
+{
GList *tmp;
PyObject *ret = PyList_New(0);
for (tmp = prop->string_list; tmp; tmp = tmp->next)
PyList_Append(ret, PyString_FromString(tmp->data));
- return ret;
+ return ret;
}
static PyObject * PyDia_get_Text (TextProperty *prop)
{ return PyDiaText_New (prop->text_data, &prop->attr); }
-static PyObject * PyDia_get_Point (PointProperty *prop)
+static PyObject * PyDia_get_Point (PointProperty *prop)
{ return PyDiaPoint_New (&prop->point_data); }
-static PyObject * PyDia_get_PointArray (PointarrayProperty *prop)
+static PyObject * PyDia_get_PointArray (PointarrayProperty *prop)
{
PyObject *ret;
int i, num;
@@ -165,12 +165,12 @@ static PyObject * PyDia_get_PointArray (PointarrayProperty *prop)
ret = PyTuple_New (num);
for (i = 0; i < num; i++)
- PyTuple_SetItem(ret, i,
+ PyTuple_SetItem(ret, i,
PyDiaPoint_New(&g_array_index(prop->pointarray_data,
Point, i)));
return ret;
}
-static PyObject * PyDia_get_BezPoint (BezPointProperty *prop)
+static PyObject * PyDia_get_BezPoint (BezPointProperty *prop)
{ return PyDiaBezPoint_New (&prop->bezpoint_data); }
static PyObject * PyDia_get_BezPointArray (BezPointarrayProperty *prop)
{
@@ -181,7 +181,7 @@ static PyObject * PyDia_get_BezPointArray (BezPointarrayProperty *prop)
ret = PyTuple_New (num);
for (i = 0; i < num; i++)
- PyTuple_SetItem(ret, i,
+ PyTuple_SetItem(ret, i,
PyDiaBezPoint_New(&g_array_index(prop->bezpointarray_data,
BezPoint, i)));
return ret;
@@ -263,7 +263,7 @@ static int
PyDia_set_Arrow (Property *prop, PyObject *val)
{
ArrowProperty *p = (ArrowProperty *)prop;
-
+
if (val->ob_type == &PyDiaArrow_Type) {
p->arrow_data = ((PyDiaArrow *)val)->arrow;
return 0;
@@ -292,7 +292,7 @@ static int
PyDia_set_Matrix (Property *prop, PyObject *val)
{
MatrixProperty *p = (MatrixProperty *)prop;
-
+
if (val->ob_type == &PyDiaMatrix_Type) {
if (!p->matrix)
p->matrix = g_new (DiaMatrix, 1);
@@ -309,8 +309,8 @@ PyDia_set_Color (Property *prop, PyObject *val)
gchar *str = PyString_AsString(val);
PangoColor color;
if (pango_color_parse(&color, str)) {
- p->color_data.red = color.red / 65535.0;
- p->color_data.green = color.green / 65535.0;
+ p->color_data.red = color.red / 65535.0;
+ p->color_data.green = color.green / 65535.0;
p->color_data.blue = color.blue / 65535.0;
p->color_data.alpha = 1.0;
return 0;
@@ -330,8 +330,8 @@ PyDia_set_Color (Property *prop, PyObject *val)
else
f[i] = 0.0;
}
- p->color_data.red = f[0];
- p->color_data.green = f[1];
+ p->color_data.red = f[0];
+ p->color_data.green = f[1];
p->color_data.blue = f[2];
p->color_data.alpha = 1.0;
return 0;
@@ -364,8 +364,8 @@ PyDia_set_Real(Property *prop, PyObject *val)
}
return -1;
}
-/* as of this writing the only difference between Real-, Length- and Fontsize-property
- * is the widget representing them. But that may change so here are the 'type-safe'
+/* as of this writing the only difference between Real-, Length- and Fontsize-property
+ * is the widget representing them. But that may change so here are the 'type-safe'
* accessors.
*/
static int
@@ -419,7 +419,7 @@ PyDia_set_String(Property *prop, PyObject *val)
g_free (p->string_data);
p->string_data = g_strdup (str);
p->num_lines = 1;
- Py_DECREF (uval);
+ Py_DECREF (uval);
return 0;
}
return -1;
@@ -439,7 +439,7 @@ PyDia_set_Text(Property *prop, PyObject *val)
gchar *str = PyString_AsString(uval);
g_free (p->text_data);
p->text_data = g_strdup (str);
- Py_DECREF (uval);
+ Py_DECREF (uval);
return 0;
}
return -1;
@@ -601,7 +601,7 @@ ensure_quarks(void)
}
}
-static PyObject *
+static PyObject *
PyDia_get_Array (ArrayProperty *prop)
{
PyObject *ret;
@@ -703,7 +703,7 @@ PyDia_set_Array (Property *prop, PyObject *val)
if (Py_None == v) {
/* use just the defaults, setters don't need to handle this */
} else {
- g_debug ("Failed to set '%s::%s' from '%s'",
+ g_debug ("Failed to set '%s::%s' from '%s'",
p->common.descr->name, inner->descr->name, v->ob_type->tp_name);
inner->ops->free(inner);
ret = -1;
@@ -730,7 +730,7 @@ _keyvalue_get (gpointer key,
gchar *val = (gchar *)value;
PyObject *dict = (PyObject *)user_data;
PyObject *k, *v;
-
+
k = PyString_FromString(name);
v = PyString_FromString(val);
if (k && v)
@@ -752,18 +752,19 @@ PyDia_set_Dict (Property *prop, PyObject *val)
DictProperty *p = (DictProperty *)prop;
if PyDict_Check(val) {
- int i = 0; /* not to be modified! */
+ Py_ssize_t i = 0; /* not to be modified! */
PyObject *key, *value;
if (!p->dict)
p->dict = g_hash_table_new_full (g_str_hash, g_str_equal, g_free, g_free);
+
while (PyDict_Next(val, &i, &key, &value)) {
/* CHECK semantics: replace or add? */
- g_hash_table_insert (p->dict,
- g_strdup (PyString_AsString (key)),
- g_strdup (PyString_AsString (value)));
+ g_hash_table_insert (p->dict, g_strdup (PyString_AsString (key)),
+ g_strdup (PyString_AsString (value)));
}
+
return 0;
}
return -1;
@@ -779,7 +780,7 @@ PyDia_get_Pixbuf (PixbufProperty *prop)
return Py_None;
}
pb = PyCObject_FromVoidPtrAndDesc (prop->pixbuf, NULL, NULL);
-
+
return pb;
}
static int
@@ -838,9 +839,9 @@ PyDiaProperty_GetAttr(PyDiaProperty *self, gchar *attr)
* Similar to SetAttr but the property is directly applied
* to the DiaObject
*/
-int PyDiaProperty_ApplyToObject (DiaObject *object,
- gchar *key,
- Property *prop,
+int PyDiaProperty_ApplyToObject (DiaObject *object,
+ gchar *key,
+ Property *prop,
PyObject *val)
{
int ret = -1;
diff --git a/plug-ins/wmf/wmf.cpp b/plug-ins/wmf/wmf.cpp
index 9b7866a1..15b24482 100644
--- a/plug-ins/wmf/wmf.cpp
+++ b/plug-ins/wmf/wmf.cpp
@@ -3,7 +3,7 @@
*
* wmf.cpp -- Windows Metafile export plugin for dia
* Copyright (C) 2000, Hans Breuer, <Hans Breuer Org>
- * based on dummy plug-in.
+ * based on dummy plug-in.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -170,7 +170,7 @@ UsePen(WmfRenderer* renderer, Color* colour)
int num_dashes = 0;
int dashlen = renderer->nDashLen;
int dotlen = renderer->nDashLen / 10;
-
+
logbrush.lbStyle = BS_SOLID;
logbrush.lbColor = rgb;
logbrush.lbHatch = 0;
@@ -180,7 +180,7 @@ UsePen(WmfRenderer* renderer, Color* colour)
break;
case PS_DASH :
num_dashes = 2;
- dashes[0] = dashes[1] = dashlen;
+ dashes[0] = dashes[1] = dashlen;
break;
case PS_DASHDOT :
num_dashes = 4;
@@ -207,10 +207,10 @@ UsePen(WmfRenderer* renderer, Color* colour)
renderer->nLineWidth,
&logbrush, num_dashes, num_dashes > 0 ? dashes : 0);
}
- else
+ else
#endif /* G_OS_WIN32 */
{
- renderer->hPen = W32::CreatePen(renderer->fnPenStyle,
+ renderer->hPen = W32::CreatePen(renderer->fnPenStyle,
renderer->nLineWidth,
rgb);
}
@@ -225,7 +225,7 @@ static void
DonePen(WmfRenderer* renderer, W32::HPEN hPen)
{
/* restore the OLD one ... */
- if (hPen)
+ if (hPen)
W32::SelectObject(renderer->hFileDC, hPen);
/* ... before deleting the last active */
if (renderer->hPen)
@@ -246,9 +246,9 @@ my_log(WmfRenderer* renderer, const char* format, ...)
{
gchar *string;
va_list args;
-
+
g_return_if_fail (format != NULL);
-
+
va_start (args, format);
string = g_strdup_vprintf (format, args);
va_end (args);
@@ -258,7 +258,7 @@ my_log(WmfRenderer* renderer, const char* format, ...)
g_free(string);
}
-
+
/*
* renderer interface implementation
*/
@@ -274,7 +274,7 @@ begin_render(DiaRenderer *self, const Rectangle *)
renderer->fnPenStyle = PS_GEOMETRIC;
/* make unfilled the default */
- W32::SelectObject(renderer->hFileDC,
+ W32::SelectObject(renderer->hFileDC,
W32::GetStockObject (HOLLOW_BRUSH) );
}
@@ -283,10 +283,11 @@ end_render(DiaRenderer *self)
{
WmfRenderer *renderer = WMF_RENDERER (self);
W32::HENHMETAFILE hEmf;
+#if !defined DIRECT_WMF && defined G_OS_WIN32 /* the later offers both */
W32::UINT nSize;
W32::BYTE* pData = NULL;
FILE* f;
-
+#endif
DIAG_NOTE(renderer, "end_render\n");
hEmf = W32::CloseEnhMetaFile(renderer->hFileDC);
@@ -315,9 +316,9 @@ end_render(DiaRenderer *self)
/* write file */
if (fwrite(pData,1,nSize,f) != nSize)
dia_context_add_message_with_errno(renderer->ctx, errno, _("Couldn't write file %s\n%s"),
- dia_context_get_filename (renderer->ctx));
+ dia_context_get_filename (renderer->ctx));
fclose(f);
-
+
g_free(pData);
W32::ReleaseDC(NULL, hdc);
@@ -331,7 +332,7 @@ end_render(DiaRenderer *self)
W32::DeleteEnhMetaFile(hEmf);
}
-static gboolean
+static gboolean
is_capable_to (DiaRenderer *renderer, RenderCapability cap)
{
if (RENDER_HOLES == cap)
@@ -385,7 +386,7 @@ draw_object (DiaRenderer *self, DiaObject *object, DiaMatrix *matrix)
static void
set_linewidth(DiaRenderer *self, real linewidth)
-{
+{
WmfRenderer *renderer = WMF_RENDERER (self);
DIAG_NOTE(renderer, "set_linewidth %f\n", linewidth);
@@ -399,7 +400,7 @@ set_linecaps(DiaRenderer *self, LineCaps mode)
WmfRenderer *renderer = WMF_RENDERER (self);
DIAG_NOTE(renderer, "set_linecaps %d\n", mode);
-
+
// all the advanced line rendering is unsupported on win9x
if (!renderer->platform_is_nt)
return;
@@ -477,11 +478,11 @@ set_linestyle(DiaRenderer *self, LineStyle mode, real dash_length)
default:
g_warning("WmfRenderer : Unsupported fill mode specified!\n");
}
-
+
if (renderer->platform_is_nt)
return;
- /* Non-solid linestyles are only displayed if width <= 1.
+ /* Non-solid linestyles are only displayed if width <= 1.
* Better implementation will require custom linestyles
* not available on win9x ...
*/
@@ -524,7 +525,7 @@ set_font(DiaRenderer *self, DiaFont *font, real height)
real font_size = dia_font_get_size (font) * (height / dia_font_get_height (font));
- DIAG_NOTE(renderer, "set_font %s %f\n",
+ DIAG_NOTE(renderer, "set_font %s %f\n",
dia_font_get_family (font), height);
if (renderer->hFont) {
W32::DeleteObject(renderer->hFont);
@@ -534,7 +535,7 @@ set_font(DiaRenderer *self, DiaFont *font, real height)
g_object_unref (renderer->pango_context);
renderer->pango_context = NULL;
}
-
+
if (renderer->use_pango) {
#ifdef __PANGOWIN32_H__ /* with the pangowin32 backend there is a better way */
if (!renderer->pango_context)
@@ -580,34 +581,34 @@ set_font(DiaRenderer *self, DiaFont *font, real height)
# define BYTE unsigned char
# endif
- renderer->hFont = (W32::HFONT)W32::CreateFont(
- - SC (font_size), // logical height of font
- 0, // logical average character width
+ renderer->hFont = (W32::HFONT)W32::CreateFont(
+ - SC (font_size), // logical height of font
+ 0, // logical average character width
0, // angle of escapement
- 0, // base-line orientation angle
+ 0, // base-line orientation angle
dwWeight, // font weight
dwItalic, // italic attribute flag
0, // underline attribute flag
0, // strikeout attribute flag
- DEFAULT_CHARSET, // character set identifier
- OUT_TT_PRECIS, // output precision
+ DEFAULT_CHARSET, // character set identifier
+ OUT_TT_PRECIS, // output precision
CLIP_DEFAULT_PRECIS, // clipping precision
- PROOF_QUALITY, // output quality
+ PROOF_QUALITY, // output quality
DEFAULT_PITCH, // pitch and family
sFace); // pointer to typeface name string
}
}
static void
-draw_line(DiaRenderer *self,
- Point *start, Point *end,
+draw_line(DiaRenderer *self,
+ Point *start, Point *end,
Color *line_colour)
{
WmfRenderer *renderer = WMF_RENDERER (self);
W32::HPEN hPen;
- DIAG_NOTE(renderer, "draw_line %f,%f -> %f, %f\n",
+ DIAG_NOTE(renderer, "draw_line %f,%f -> %f, %f\n",
start->x, start->y, end->x, end->y);
hPen = UsePen(renderer, line_colour);
@@ -619,8 +620,8 @@ draw_line(DiaRenderer *self,
}
static void
-draw_polyline(DiaRenderer *self,
- Point *points, int num_points,
+draw_polyline(DiaRenderer *self,
+ Point *points, int num_points,
Color *line_colour)
{
WmfRenderer *renderer = WMF_RENDERER (self);
@@ -629,7 +630,7 @@ draw_polyline(DiaRenderer *self,
W32::POINT* pts;
int i;
- DIAG_NOTE(renderer, "draw_polyline n:%d %f,%f ...\n",
+ DIAG_NOTE(renderer, "draw_polyline n:%d %f,%f ...\n",
num_points, points->x, points->y);
if (num_points < 2)
@@ -649,8 +650,8 @@ draw_polyline(DiaRenderer *self,
}
static void
-draw_polygon(DiaRenderer *self,
- Point *points, int num_points,
+draw_polygon(DiaRenderer *self,
+ Point *points, int num_points,
Color *fill, Color *stroke)
{
WmfRenderer *renderer = WMF_RENDERER (self);
@@ -658,10 +659,10 @@ draw_polygon(DiaRenderer *self,
W32::HPEN hPen;
W32::POINT* pts;
int i;
- W32::HBRUSH hBrush, hBrOld;
+ W32::HBRUSH hBrush;
W32::COLORREF rgb = fill ? W32COLOR(fill) : 0;
- DIAG_NOTE(renderer, "draw_polygon n:%d %f,%f ...\n",
+ DIAG_NOTE(renderer, "draw_polygon n:%d %f,%f ...\n",
num_points, points->x, points->y);
if (num_points < 2)
@@ -685,7 +686,7 @@ draw_polygon(DiaRenderer *self,
if (stroke)
DonePen(renderer, hPen);
if (fill) {
- W32::SelectObject(renderer->hFileDC,
+ W32::SelectObject(renderer->hFileDC,
W32::GetStockObject(HOLLOW_BRUSH) );
W32::DeleteObject(hBrush);
}
@@ -693,7 +694,7 @@ draw_polygon(DiaRenderer *self,
}
static void
-draw_rect(DiaRenderer *self,
+draw_rect(DiaRenderer *self,
Point *ul_corner, Point *lr_corner,
Color *fill, Color *stroke)
{
@@ -701,7 +702,7 @@ draw_rect(DiaRenderer *self,
W32::HPEN hPen;
- DIAG_NOTE(renderer, "draw_rect %f,%f -> %f,%f\n",
+ DIAG_NOTE(renderer, "draw_rect %f,%f -> %f,%f\n",
ul_corner->x, ul_corner->y, lr_corner->x, lr_corner->y);
if (fill) {
@@ -712,7 +713,7 @@ draw_rect(DiaRenderer *self,
W32::Rectangle (renderer->hFileDC,
SCX(ul_corner->x), SCY(ul_corner->y),
SCX(lr_corner->x), SCY(lr_corner->y));
- W32::SelectObject (renderer->hFileDC,
+ W32::SelectObject (renderer->hFileDC,
W32::GetStockObject (HOLLOW_BRUSH) );
W32::DeleteObject(hBrush);
}
@@ -728,7 +729,7 @@ draw_rect(DiaRenderer *self,
}
static void
-draw_arc(DiaRenderer *self,
+draw_arc(DiaRenderer *self,
Point *center,
real width, real height,
real angle1, real angle2,
@@ -738,7 +739,7 @@ draw_arc(DiaRenderer *self,
W32::HPEN hPen;
W32::POINT ptStart, ptEnd;
- DIAG_NOTE(renderer, "draw_arc %fx%f <%f,<%f @%f,%f\n",
+ DIAG_NOTE(renderer, "draw_arc %fx%f <%f,<%f @%f,%f\n",
width, height, angle1, angle2, center->x, center->y);
hPen = UsePen(renderer, colour);
@@ -759,15 +760,15 @@ draw_arc(DiaRenderer *self,
W32::Arc(renderer->hFileDC,
SCX(center->x - width / 2), /* bbox corners */
SCY(center->y - height / 2),
- SCX(center->x + width / 2),
+ SCX(center->x + width / 2),
SCY(center->y + height / 2),
- ptStart.x, ptStart.y, ptEnd.x, ptEnd.y);
+ ptStart.x, ptStart.y, ptEnd.x, ptEnd.y);
DonePen(renderer, hPen);
}
static void
-fill_arc(DiaRenderer *self,
+fill_arc(DiaRenderer *self,
Point *center,
real width, real height,
real angle1, real angle2,
@@ -779,7 +780,7 @@ fill_arc(DiaRenderer *self,
W32::POINT ptStart, ptEnd;
W32::COLORREF rgb = W32COLOR(colour);
- DIAG_NOTE(renderer, "fill_arc %fx%f <%f,<%f @%f,%f\n",
+ DIAG_NOTE(renderer, "fill_arc %fx%f <%f,<%f @%f,%f\n",
width, height, angle1, angle2, center->x, center->y);
if (angle1 > angle2) {
@@ -802,18 +803,18 @@ fill_arc(DiaRenderer *self,
W32::Pie(renderer->hFileDC,
SCX(center->x - width / 2), /* bbox corners */
SCY(center->y - height / 2),
- SCX(center->x + width / 2),
+ SCX(center->x + width / 2),
SCY(center->y + height / 2),
- ptStart.x, ptStart.y, ptEnd.x, ptEnd.y);
+ ptStart.x, ptStart.y, ptEnd.x, ptEnd.y);
- W32::SelectObject(renderer->hFileDC,
+ W32::SelectObject(renderer->hFileDC,
W32::GetStockObject (HOLLOW_BRUSH) );
W32::DeleteObject(hBrush);
DonePen(renderer, hPen);
}
static void
-draw_ellipse(DiaRenderer *self,
+draw_ellipse(DiaRenderer *self,
Point *center,
real width, real height,
Color *fill, Color *stroke)
@@ -822,7 +823,7 @@ draw_ellipse(DiaRenderer *self,
W32::HPEN hPen;
W32::HGDIOBJ hBrush;
- DIAG_NOTE(renderer, "draw_ellipse %fx%f @ %f,%f\n",
+ DIAG_NOTE(renderer, "draw_ellipse %fx%f @ %f,%f\n",
width, height, center->x, center->y);
if (fill) {
@@ -836,13 +837,13 @@ draw_ellipse(DiaRenderer *self,
W32::Ellipse(renderer->hFileDC,
SCX(center->x - width / 2), /* bbox corners */
SCY(center->y - height / 2),
- SCX(center->x + width / 2),
+ SCX(center->x + width / 2),
SCY(center->y + height / 2));
if (stroke)
DonePen(renderer, hPen);
if (fill) {
- W32::SelectObject(renderer->hFileDC,
+ W32::SelectObject(renderer->hFileDC,
W32::GetStockObject (HOLLOW_BRUSH) );
W32::DeleteObject(hBrush);
}
@@ -862,7 +863,7 @@ _bezier (DiaRenderer *self,
W32::HPEN hPen;
W32::COLORREF rgb = W32COLOR(colour);
- DIAG_NOTE(renderer, "_bezier n:%d %fx%f ...\n",
+ DIAG_NOTE(renderer, "_bezier n:%d %fx%f ...\n",
numpoints, points->p1.x, points->p1.y);
if (fill) {
@@ -873,7 +874,7 @@ _bezier (DiaRenderer *self,
}
W32::BeginPath (renderer->hFileDC);
-
+
for (int i = 0; i < numpoints; ++i) {
switch (points[i].type) {
case BezPoint::BEZ_MOVE_TO :
@@ -899,7 +900,7 @@ _bezier (DiaRenderer *self,
W32::EndPath (renderer->hFileDC);
if (fill) {
W32::FillPath (renderer->hFileDC);
- W32::SelectObject(renderer->hFileDC,
+ W32::SelectObject(renderer->hFileDC,
W32::GetStockObject (HOLLOW_BRUSH) );
W32::DeleteObject(hBrush);
} else {
@@ -910,7 +911,7 @@ _bezier (DiaRenderer *self,
#endif
static void
-draw_bezier(DiaRenderer *self,
+draw_bezier(DiaRenderer *self,
BezPoint *points,
int numpoints,
Color *colour)
@@ -923,7 +924,7 @@ draw_bezier(DiaRenderer *self,
W32::POINT * pts;
int i;
- DIAG_NOTE(renderer, "draw_bezier n:%d %fx%f ...\n",
+ DIAG_NOTE(renderer, "draw_bezier n:%d %fx%f ...\n",
numpoints, points->p1.x, points->p1.y);
pts = g_new(W32::POINT, (numpoints-1) * 3 + 1);
@@ -940,9 +941,9 @@ draw_bezier(DiaRenderer *self,
break;
case _BezPoint::BEZ_LINE_TO:
/* everyhing the same ?*/
- pts[i*3-2].x = pts[i*3-1].x =
+ pts[i*3-2].x = pts[i*3-1].x =
pts[i*3 ].x = SCX(points[i].p1.x);
- pts[i*3-2].y = pts[i*3-1].y =
+ pts[i*3-2].y = pts[i*3-1].y =
pts[i*3 ].y = SCY(points[i].p1.y);
break;
case _BezPoint::BEZ_CURVE_TO:
@@ -974,7 +975,7 @@ draw_bezier(DiaRenderer *self,
#ifndef DIRECT_WMF
/* not defined in compatibility layer */
static void
-draw_beziergon (DiaRenderer *self,
+draw_beziergon (DiaRenderer *self,
BezPoint *points, /* Last point must be same as first point */
int numpoints,
Color *fill,
@@ -998,7 +999,7 @@ draw_string(DiaRenderer *self,
W32::HGDIOBJ hOld;
W32::COLORREF rgb = W32COLOR(colour);
- DIAG_NOTE(renderer, "draw_string %f,%f %s\n",
+ DIAG_NOTE(renderer, "draw_string %f,%f %s\n",
pos->x, pos->y, text);
W32::SetTextColor(renderer->hFileDC, rgb);
@@ -1022,7 +1023,7 @@ draw_string(DiaRenderer *self,
hOld = W32::SelectObject(renderer->hFileDC, renderer->hFont);
{
// one way to go, but see below ...
- char* scp = NULL;
+ char* scp = NULL;
/* convert from utf8 to active codepage */
static char codepage[10];
#ifndef HAVE_LIBEMF
@@ -1064,14 +1065,14 @@ draw_image(DiaRenderer *self,
{
#ifdef DIRECT_WMF
/* not yet supported in compatibility mode */
-#else
+#else
WmfRenderer *renderer = WMF_RENDERER (self);
W32::HBITMAP hBmp;
int iWidth, iHeight;
unsigned char* pData = NULL;
unsigned char* pImg = NULL;
- DIAG_NOTE(renderer, "draw_image %fx%f @%f,%f\n",
+ DIAG_NOTE(renderer, "draw_image %fx%f @%f,%f\n",
width, height, point->x, point->y);
iWidth = dia_image_width(image);
@@ -1104,7 +1105,7 @@ draw_image(DiaRenderer *self,
}
else
{
- hBmp = W32::CreateBitmap (
+ hBmp = W32::CreateBitmap (
dia_image_width(image), dia_image_height(image),
1, 24, pImg);
}
@@ -1128,7 +1129,7 @@ draw_image(DiaRenderer *self,
hBmp = W32::CreateDIBSection (hMemDC, &bmi, DIB_RGB_COLORS,
(void**)&pData, NULL, 0);
/* copy data, always line by line */
- for (int y = 0; y < iHeight; y ++)
+ for (int y = 0; y < iHeight; y ++)
{
int line_offset = dia_image_rowstride(image) * y;
for (int x = 0; x < iWidth*3; x+=3)
@@ -1163,19 +1164,19 @@ draw_image(DiaRenderer *self,
}
static void
-draw_rounded_rect (DiaRenderer *self,
+draw_rounded_rect (DiaRenderer *self,
Point *ul_corner, Point *lr_corner,
Color *fill, Color *stroke, real radius)
{
WmfRenderer *renderer = WMF_RENDERER (self);
- DIAG_NOTE(renderer, "draw_rounded_rect %f,%f -> %f,%f %f\n",
+ DIAG_NOTE(renderer, "draw_rounded_rect %f,%f -> %f,%f %f\n",
ul_corner->x, ul_corner->y, lr_corner->x, lr_corner->y, radius);
if (fill) {
W32::COLORREF rgb = W32COLOR(fill);
W32::HGDIOBJ hBrush = W32::CreateSolidBrush(rgb);
-
+
W32::SelectObject(renderer->hFileDC, hBrush);
W32::RoundRect (renderer->hFileDC,
@@ -1183,7 +1184,7 @@ draw_rounded_rect (DiaRenderer *self,
SCX(lr_corner->x), SCY(lr_corner->y),
SC(radius*2), SC(radius*2));
- W32::SelectObject (renderer->hFileDC,
+ W32::SelectObject (renderer->hFileDC,
W32::GetStockObject (HOLLOW_BRUSH) );
W32::DeleteObject(hBrush);
}
@@ -1224,7 +1225,7 @@ wmf_renderer_get_type (void)
"WmfRenderer",
&object_info, (GTypeFlags)0);
}
-
+
return object_type;
}
@@ -1321,7 +1322,7 @@ export_data(DiagramData *data, DiaContext *ctx,
scale /= 2; // Without this there can be some smallint overflow, dunno why
refDC = W32::GetDC(NULL);
-
+
bbox.right = (int)((data->extents.right - data->extents.left) * scale *
100 * W32::GetDeviceCaps(refDC, HORZSIZE) / W32::GetDeviceCaps(refDC, HORZRES));
bbox.bottom = (int)((data->extents.bottom - data->extents.top) * scale *
@@ -1341,10 +1342,10 @@ export_data(DiagramData *data, DiaContext *ctx,
NULL, // in memory
# endif
&bbox, // pointer to a bounding rectangle
- "Dia\0Diagram\0"); // pointer to an optional description string
+ "Dia\0Diagram\0"); // pointer to an optional description string
#endif
if (file == NULL) {
- dia_context_add_message_with_errno (ctx, errno, _("Can't open output file %s"),
+ dia_context_add_message_with_errno (ctx, errno, _("Can't open output file %s"),
dia_context_get_filename(ctx));
return FALSE;
}
@@ -1357,7 +1358,7 @@ export_data(DiagramData *data, DiaContext *ctx,
if (user_data == (void*)1) {
renderer->target_emf = TRUE;
renderer->hPrintDC = 0;
-#ifdef __PANGOWIN32_H__
+#ifdef __PANGOWIN32_H__
renderer->use_pango = TRUE;
#else
renderer->use_pango = FALSE;
@@ -1383,7 +1384,7 @@ export_data(DiagramData *data, DiaContext *ctx,
renderer->yoff = - data->extents.top;
renderer->scale = scale;
} else {
- int ppc = (int)(W32::GetDeviceCaps (renderer->hPrintDC, PHYSICALWIDTH)
+ int ppc = (int)(W32::GetDeviceCaps (renderer->hPrintDC, PHYSICALWIDTH)
/ ( data->paper.lmargin + data->paper.width + data->paper.rmargin));
/* respect margins */
renderer->margins.left = (int)(ppc * data->paper.lmargin - W32::GetDeviceCaps (renderer->hPrintDC,
PHYSICALOFFSETX));
@@ -1426,19 +1427,19 @@ export_data(DiagramData *data, DiaContext *ctx,
W32::SetBkMode(renderer->hFileDC, TRANSPARENT);
W32::SetMapMode(renderer->hFileDC, MM_TEXT);
#ifndef HAVE_LIBEMF
- W32::IntersectClipRect(renderer->hFileDC,
+ W32::IntersectClipRect(renderer->hFileDC,
bbox.left, bbox.top,
bbox.right, bbox.bottom);
#endif
/* write extents */
- DIAG_NOTE(renderer, "export_data extents %f,%f -> %f,%f\n",
+ DIAG_NOTE(renderer, "export_data extents %f,%f -> %f,%f\n",
extent->left, extent->top, extent->right, extent->bottom);
data_render(data, DIA_RENDERER(renderer), NULL, NULL, NULL);
g_object_unref(renderer);
-
+
W32::ReleaseDC (NULL, refDC);
return TRUE;
@@ -1512,7 +1513,7 @@ dia_plugin_init(PluginInfo *info)
*/
filter_register_export(&wmf_export_filter);
filter_register_export(&emf_export_filter);
-
+
filter_register_callback (&cb_gdi_print);
#elif HAVE_LIBEMF
/* not sure if libEMF really saves EMF ;) */
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]