Re: Custom lines plugin for dia 0.96.1 (including patch+demo line shapes/sheet)

2007/10/19, Lars Clausen <lars raeder dk>:

On Fri, 2007-10-12 at 15:28 +0200, Marcel Toele wrote:
> Hi guys,
> I have written an objects/shapes plugin for dia called custom_lines.
> It is similar to the custom_objects plugin
> and allows users to define "line shapes" with preconfigured settings
> for start/end arrow,
> line style, thickness, color, etc. using simple XML.

I can see the point of doing this, however you have taken a rather
unmaintainable road to do it.  You've copied the standard line objects
from the object/standard directory without any other change than a
different create function.  Which means all you're doing is adding a
different way to create objects, which doesn't have to require a new set
of objects.  You can look in the xfig importer for examples of how to
create standard objects.  That will save everyone from having to
maintain two different copies of the same code -- already now Hans has
changed enough in the bezier that your files are out of date, and we
definitely don't want such a maintenance nightmare down the road.

No problem, I will change that back. I've chosen this road because when I
started the plugin, I wasn't sure how much of the original code was to be
altered to make it work. By copying the code from the basic_objects, It gave
me some room to make any adjustments needed. As it turned out that not
much alterations are needed, I can remove most of that code and fall back on
the basic objects.

You should be aware that, unlike custom shapes, these custom lines can
have their look altered after creation.  Is that intentional?

Is there an easy way to prevent this? I haven't looked at it in detail, but it sounds like a good thing to do; preventing changing the shapes.

Is there any particular reason you haven't allowed simple lines and
arcs?  I can somewhat understand leaving out simple lines, though they
have a thing or two that polyline doesn't, but why no arcs?

I haven't allowed simple lines, because these are easily emulated using bezier or polyline. I must have overlooked arcs :(

For making it easier to check patches, please don't include files that
aren't needed (such as ~ files and files that are cancelled),

 I'll clean up the cancelled files and backups.

and either
avoid reindenting things that you haven't changed or use the -bB options
for diff.

I have noticed that there are already different standards used. Most notably,
some of the code uses "replace tabs by spaces, or space only" while other parts
do use tabs (which must be accidentally, because only a minor portion of the code
has these tabs). The portions that use tabs either use tab-size 8 or tabsize 2.

Anyway, to prevent this, I'll use -bB for the next patch.

I'm sorry, but I cannot apply your patch the way it is now, it's just
too unmaintainable.  I'm open for changing deeper things if that makes
it possible to support this in a simpler way, but copying that much
non-trivial code is not the way to go.

No problem, I'll supply you with a better patch soon.


Dia-list mailing list
Dia-list gnome org
FAQ at
Main page at

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