Dia is a program for drawing structured diagrams
Clone or download
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
app s/implm/implem/ as in implement Dec 10, 2018
bindings Correct typos detected by debian lintian Dec 8, 2018
broken-files giving some love to dia_font_new_from_legacy_name() that is making im… Jun 23, 2002
data Bug 741153 - Allow to hide diagram scroll bars Jan 11, 2015
doc fix further "implementation" misspellings Dec 10, 2018
installer [gtk-osx] don't enforce gtk-engine usage Nov 15, 2014
lib Revert "Merge branch 'xdg-base-dir-spec-support' into 'master'" Dec 9, 2018
objects s/implm/implem/ as in implement Dec 10, 2018
plug-ins fix further "implementation" misspellings Dec 10, 2018
po Update Brazilian Portuguese translation Dec 11, 2018
samples Correct typos detected by debian lintian Dec 8, 2018
shapes Fixed Typos in translatable strings (Bug #753209) antialised -> antia… Dec 11, 2015
sheets Fixed Typos in translatable strings (Bug #753209) antialised -> antia… Dec 11, 2015
tests fix further "implementation" misspellings Dec 10, 2018
.cvsignore Mainpoint-related fixes, not fixed conn bug yet. Sep 29, 2005
.gitignore More files to .gitignore when building docs Jun 5, 2011
AUTHORS New files parent.[ch] Jul 13, 2003
COPYING UML fixes, autogaps, security fixes, dia.spec move... Mar 12, 2006
ChangeLog ChangeLog now auto-generated at make-dist-time May 3, 2009
ChangeLog.pre-git s/implm/implem/ as in implement Dec 10, 2018
HACKING Homepage links fix Jul 1, 2004
INSTALL Require gtk-2.16, glib-2.20, pango-1.20 and cairo 1.6 Mar 27, 2011
KNOWN_BUGS Menu overhaul. Feb 27, 2004
MAINTAINERS Updated INSTALL, RELEASE-PROCESS and MAINTAINERS Apr 18, 2009
Makefile.am ChangeLog now auto-generated at make-dist-time May 3, 2009
NEWS Update build to remove libgnome dep Dec 6, 2018
PACKAGE-MAINTAINERS MAINTAINERS now contains current and old maintainers for Dia, while Jan 18, 2006
README doap: update URLs Mar 30, 2014
RELEASE-PROCESS Updated INSTALL, RELEASE-PROCESS and MAINTAINERS Apr 18, 2009
TODO Small fixes. Nov 17, 2003
acinclude.m4 Revert "Updated FSF's address" Jan 31, 2014
autogen.sh replace libtool* with glibtool* on Darvin Dec 8, 2018
config.h.win32 [warningectomy] hide some msvc warnings Jul 21, 2013
configure.ac Update build to remove libgnome dep Dec 6, 2018
dia-make.msc Transport xmlError information via DiaContext Feb 14, 2014
dia.1 Removed cruft Oct 14, 2001
dia.desktop.in.in Fix .desktop file Jul 15, 2010
dia.doap Replace Bugzilla by Gitlab URL in DOAP file Dec 15, 2018
dia.keys.in Move of icons, undo/redo ghosting. Oct 28, 2007
dia.mime include the new files in RPMs. Dec 9, 1999
hardcopies.make Update build to remove libgnome dep Dec 6, 2018
install.win32 minor files for win32 build and a finally fully working wmf plug-in Jan 7, 2001
makefile.msc DiaRenderer: replace fill_polygon() with extended draw_polygon() method Apr 27, 2014
omf.make bug #306737 - installation fails in install-data-hook-omf if omffile Jan 31, 2009
po-checktrans added ro to ALL_LINGUAS Aug 5, 2002
po-checktrans.py Revert "Updated FSF's address" Jan 31, 2014
readme.win32 Remove LDFLAGS overwrite to also work with WinDDK msvc, see readme.win32 Aug 19, 2009
todo.gtk2 Slightly updated todo Sep 19, 2009
xmldocs.make Update build to remove libgnome dep Dec 6, 2018

README

Dia is a program for drawing structured diagrams.

Dia is a GNU program, and is Free Software.  See the COPYING file for
the licence.

Documentation is a bit sparse at the moment.  Some info can be
found in the doc/ directory.

--

I haven't had time to write anything here yet.
Read INSTALL for some brief installation instructions.

Homepage for Dia is at:
 https://wiki.gnome.org/Apps/Dia

Some comments about the source:
-------------------------------

 Everything on the screen 'inherits' from the structure Object 
in lib/object.h. (ps. this is a nice place to start reading the code.).
Inherits in C means (as in gtk) that it begins with a copy of that structure. 
Some base classes exists in lib/, like element.h (for doing 'box-like' 
objects), connection.h (for doing 'line-like' objects), orth_conn.h (for doing 
connections with orthogonal lines, like the uml-stuff) and render_object.h 
(for doing picture-like objects). These base classes are then subclassed in 
the different object in the object-libraries like objects/standard object/UML 
and object/network.

 The objects work by filling out two structures that the main program (app/*) 
uses to handle the objects. The ObjectType structure which consists of some 
info and a pointer to the type-operations (create+load+save). There's one 
ObjectType per object type currently loaded. Then the Object structure, there 
exists a copy of this for each object of the kind on screen (and in 
copy-buffers). This contains some info like: type, bounding_box, position, 
handles (the rectangles you move with the mouse) and connections. It also 
contains a pointer to the object-operations. These are called from the main 
program when if wants the object to do something. All ops take an Object as 
the first argument. This is usually casted to the subtype in the function 
headed (gives all those pita warnings) so that you directly can use the info 
stored in the subclasses. Most ops are quite self-describing, and the code can 
be copy-pasted from an object like the one you're doing. Rendering to 
screen/postscript is done through a 'Renderer' abstraction that can be found 
in lib/render.h.
 
XML based objects:
------------------
You can (from version 0.80) create new objects using a SVG like XML languange.
The file doc/custom-shapes has more information about this.
 
Note on handles and connection points:
--------------------------------------

An object has handles to resize it. A handle can be moved either because
the user dragged it with the mouse, or the handle is attached to another
object, which moved itself. The handles are diplayed as little squares
(red: normal, green: attached to an object, blue: can't be moved).

When the handle of an object is connected to another object, it's always
on special points called connection points, displayed as crosses.

Implementation:
- each object has an array of pointer to ConnectionPoint.
- each object has an array of pointer to Handle.
- each Handle has a pointer to 1 ConnectionPoint (NULL if the handle if
the Handle is not connected).
- each ConnectionPoint has a list of all objects connected to it.

The Object type does not manage the allocation/deallocation of handles and
connection points. When saving a diagram the pointer from the handle to
the connectionpoint is saved as the index of the connectionpoint. So make
sure the order of the connectionpoints is the same when loading the saved
object.

Notes on static analysis
------------------------
Some of the recent changes (log message starting with [scan-build] are suggested
by static source analysis, see http://clang-analyzer.llvm.org/scan-build
To use it just run ./configure and make through the scan-build script, like:

PATH=/mnt/Home/from-svn/llvm/Release/bin:$PATH /mnt/Home/from-svn/llvm/tools/clang/tools/scan-build/scan-build ./configure --prefix=/opt --enable-debug=yes
  and
PATH=/mnt/Home/from-svn/llvm/Release/bin:$PATH /mnt/Home/from-svn/llvm/tools/clang/tools/scan-build/scan-build -v -v make -j3
  view with
PATH=/mnt/Home/from-svn/llvm/Release/bin:$PATH /mnt/Home/from-svn/llvm/tools/clang/tools/scan-view/scan-view

(given an uninstalled checkout of llvm to /mnt/Home/from-svn/llvm)