Re: Custom lines external properties



At 05.07.2012 11:29, Julien SIEBERT wrote:
[...]

I was wondering if there is any way to add external properties to
custom lines the same way it is possible to add external properties to
custom shapes (via<ext_attributes>  in the .line file) ?

It is not. And before you start to extend custom_lines please be aware of a fundamental design flaw of the ext_attributes. I manifests itself by this compile time warning:

custom_object.c(385) : warning C4133: 'function' : incompatible types - from 'PropDescription *' to 'Property *'

I tried - in a naive way - to directly add<ext_attributes>  in my line
files, but after looking at custom and custom lines C code I am just
asking what are the difficulties to add such a feature ?

Custom Shapes and Custom Lines have - from my understanding - slightly different use cases.

"The custom shape module allows you to create new shapes for Dia
without writing any C code.  Instead, you just have to write a simple
XML file describing the shape.  This opens up the job of creating new
shapes for dia to non programmers as well." [1]

"[The custom lines module] allows users to define "line shapes" with preconfigured settings for start/end arrow, line style, thickness, color, etc. using simple XML." [2]

The main difference from my point of view is that the custom lines module (only) is used to preconfigure some objects already there; while the custom shape module allows to create new objects from scratch.

Some of the open questions for the custom line module are kind of open for years [3] - and I'd say this is not due implementation difficulties but due to difficulties in requirements elicitation. For your new feature I still need to understand what you want to achieve with it.

The difficulties of implementation almost entirely depend on the requirements ;-) If you want to avoid writing code, which is difficult to be included with Dia, let's talk about the design first. I've already rewritten the custom_lines plug-in once to make it portable and adhere to Dia design principles. [4], [5]

HTH,
        Hans

[1] http://git.gnome.org/browse/dia/tree/doc/custom-shapes
[2] https://mail.gnome.org/archives/dia-list/2007-October/msg00053.html
[3] http://mail.gnome.org/archives/dia-list/2008-March/msg00008.html
[4] http://git.gnome.org/browse/dia/log/objects/custom_lines
[5] http://git.gnome.org/browse/dia/commit/objects/custom_lines?id=e69eb45ecae71272426d51af89065e80c7ff6f52

-------- Hans "at" Breuer "dot" Org -----------
Tell me what you need, and I'll tell you how to
get along without it.                -- Dilbert



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