Re: How to Develop New Features



At 07.09.2012 03:11, Matthew Rubenstein wrote:
        Howdy. I'd like to code some revisions to Dia, but I haven't figured
out how to get started, despite browsing around
https://live.gnome.org/Dia and googling various programming keywords
combined with "dia".

Checking out the code from master [1], building it and reading some of the existing code should be a good starting point.

        I'd like to embed a library that would receive data as graph object
labels are edited, compute against them, and return a value would be
displayed in other graph object labels. Since it's an embedded library
this seems like a plugin project, but I haven't found any documentation
for APIs or otherwise for writing a Dia plugin.

There are a lot of plug-ins doing a multitude of things available with the Dia distribution. Just find one similar to your needs and start reading code. There also is some documentation about Dia concepts with the code. See $(dia)/doc and $(dia)/samples/Self for a start.

        I'd also like to create a set of shapes that all work like the UML
"Large Package" shape: implementing parenting.
I'm in the process of adding this facility to the custom shape mudule, so in the near future this can even be done with custom shapes written in XML.

I'd also like to be able
to toggle a parent between hiding and showing its children. If it works
out I'd like to also click a parent to zoom it to fill the app viewport,
then click a child that's itself a parent to zoom into it, and zoom back
out. I haven't seen any docs for creating a new shape set,
http://dia-installer.de/doc/en/custom-shapes-chapter.html

or how to add these dynamic behaviors to them.

The usual answer to more dynamic shape behaviour is writing objects in C.
See $(dia)/objects for a lot of examples. Toggling visibility of single objects would probably require some modification of the Dia core.

        And I'd like to code the save/load code for a simple file format that
stores objects with these behaviors. That seems like probably an export
filter, but again I've found no docs to confirm it.

There are about two dozen export filters include with Dia. Please look at $(dia)/plug-ins for their implementations.

[1] http://git.gnome.org/browse/dia/

-------- 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]