1 <!DOCTYPE html PUBLIC
"-//W3C//DTD XHTML 1.0 Transitional//EN"
2 "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
5 <link rel=
"stylesheet" media=
"screen" type=
"text/css" href=
"./style.css" />
6 <link rel=
"stylesheet" media=
"screen" type=
"text/css" href=
"./design.css" />
7 <link rel=
"stylesheet" media=
"print" type=
"text/css" href=
"./print.css" />
9 <meta http-equiv=
"Content-Type" content=
"text/html; charset=utf-8" />
13 <h1 class=
"sectionedit1" id=
"geda_library_v3_specification">gEDA Library v3 Specification
</h1>
17 <!-- EDIT1 SECTION "gEDA Library v3 Specification" [1-45] -->
18 <h2 class=
"sectionedit2" id=
"rationale">Rationale
</h2>
22 The current version (
2.x) of the libgeda shared library has a number of defects:
25 <li class=
"level1"><div class=
"li"> Poor separation between public interface and internals, which leads to…
</div>
27 <li class=
"level1"><div class=
"li"> Frequent changes to the
<abbr title=
"Application Programming Interface">API
</abbr></div>
29 <li class=
"level1"><div class=
"li"> <abbr title=
"Application Programming Interface">API
</abbr> contains large amounts of code specific to application internals
</div>
34 This page is an attempt to itemise in detail what is required of libgeda, and what the interface to it should look like. This will enable:
37 <li class=
"level1"><div class=
"li"> More rigorous testing of library functions
</div>
39 <li class=
"level1"><div class=
"li"> Creation of language bindings for libgeda
</div>
41 <li class=
"level1"><div class=
"li"> Easier development of other applications for manipulating schematics
</div>
46 <!-- EDIT2 SECTION "Rationale" [46-643] -->
47 <h2 class=
"sectionedit3" id=
"requirements">Requirements
</h2>
51 <!-- EDIT3 SECTION "Requirements" [644-669] -->
52 <h3 class=
"sectionedit4" id=
"core">Core
</h3>
55 <li class=
"level1"><div class=
"li"> Define data structures for representing schematics
</div>
57 <li class=
"level1"><div class=
"li"> Provide methods for creating and manipulating schematics
</div>
59 <li class=
"level1"><div class=
"li"> Provide methods for reading and storing schematics into files and data streams
</div>
61 <li class=
"level1"><div class=
"li"> Provide access to detailed data on errors and exceptions
</div>
63 <li class=
"level1"><div class=
"li"> Provide a simple interface for configuring libgeda
's behaviour
</div>
68 <!-- EDIT4 SECTION "Core" [670-1013] -->
69 <h3 class=
"sectionedit5" id=
"secondary">Secondary
</h3>
72 <li class=
"level1"><div class=
"li"> Make no assumptions about applications which will use the library
</div>
74 <li class=
"level1"><div class=
"li"> Make no assumptions about the compiler or architecture on which the library is being used
</div>
76 <li class=
"level1"><div class=
"li"> Fully reentrant for thread safety
</div>
78 <li class=
"level1"><div class=
"li"> Minimise number of dependency libraries
</div>
80 <li class=
"level1"><div class=
"li"> Detect and gracefully handle multiple instances accessing the same schematic file
</div>
85 <!-- EDIT5 SECTION "Secondary" [1014-1367] -->
86 <h2 class=
"sectionedit6" id=
"coordinate_system">Coordinate System
</h2>
90 Because libgeda should “make no assumptions about applications which will use the library,” libgeda should use only “world” coordinates throughout (the same coordinate system as used in the files). See the
<a href=
"geda-file_format_spec.html" class=
"wikilink1" title=
"geda-file_format_spec.html">file format specification
</a>.
94 <!-- EDIT6 SECTION "Coordinate System" [1368-1659] -->
95 <h2 class=
"sectionedit7" id=
"configuration">Configuration
</h2>
99 Currently, libgeda relies on an embedded Scheme interpreter (
<a href=
"http://www.gnu.org/software/guile/" class=
"urlextern" title=
"http://www.gnu.org/software/guile/" rel=
"nofollow">Guile
</a>) for configuring settings such as library search paths. This has a number of pros and cons:
106 <li class=
"level1"><div class=
"li"> All applications which access libgeda can automatically use the same settings
</div>
108 <li class=
"level1"><div class=
"li"> Arbitrary Scheme code can be used in the configuration process
</div>
116 <li class=
"level1"><div class=
"li"> Large
& complex dependency
</div>
118 <li class=
"level1"><div class=
"li"> Doesn
't integrate nicely into applications which use e.g. the GNOME or KDE configuration mechanisms
</div>
120 <li class=
"level1"><div class=
"li"> Substantially complicates the creation of graphical user interfaces for configuring library settings
</div>
122 <li class=
"level1"><div class=
"li"> Problems with Guile backward-compatibility in the past
</div>
127 It might, therefore, make more sense to provide a complete
<abbr title=
"Application Programming Interface">API
</abbr> for configuring libgeda, and rely on the application to handle the storage and loading of the configuration.
131 <!-- EDIT7 SECTION "Configuration" [1660-2523] -->
132 <h2 class=
"sectionedit8" id=
"dependencies">Dependencies
</h2>
136 <!-- EDIT8 SECTION "Dependencies" [2524-2549] -->
137 <h3 class=
"sectionedit9" id=
"glib">glib
</h3>
141 <a href=
"http://developer.gnome.org/doc/API/glib/" class=
"urlextern" title=
"http://developer.gnome.org/doc/API/glib/" rel=
"nofollow">glib
</a> provides a very large number of useful features that would make writing and maintaining libgeda easier. These include:
144 <li class=
"level1"><div class=
"li"> Portable definitions of basic types (although
<code>intptr.h
</code> does this too, and would probably be preferable)
</div>
146 <li class=
"level1"><div class=
"li"> Doubly- and singly-linked lists, and many other data structures
</div>
148 <li class=
"level1"><div class=
"li"> Plugin loading, memory allocation, threading, IO abstraction, …
</div>
153 Not having to reinvent the wheel – and letting a much larger project be responsible for optimising and maintaining these features – would make the libgeda code smaller and easier to understand and maintain. libgeda already uses glib to a certain extent, but using it more extensively in future versions of libgeda does not immediately seem to be a bad idea.
157 <!-- EDIT9 SECTION "glib" [2550-3350] -->
158 <h3 class=
"sectionedit10" id=
"gobject">gobject
</h3>
162 <a href=
"http://developer.gnome.org/doc/API/2.0/gobject/" class=
"urlextern" title=
"http://developer.gnome.org/doc/API/2.0/gobject/" rel=
"nofollow">gobject
</a> is an object-oriented programming system in C. It is used extensively in the GTK+ user interface toolkit. In addition to class-like structures, it provides a signalling system that allows objects to emit, listen for and respond to events. It is designed to be compatible with the object systems of other languages, and this is one of the chief reasons that so many bindings of GTK+ are available (Python, Perl, .NET, Java, C++, etc).
166 gobject is often considered to be heavyweight, requiring lots of boilerplate code in order to use it effectively. Its use in libgeda has historically been opposed, though its use in future versions may ease creation of bindings for libgeda in more directly object-oriented languages such as Python, Java or C++.
170 GObject is currently used in libgeda for the GedaList class which wrapps a GList, and provides a notification signal when
<abbr title=
"Application Programming Interface">API
</abbr> is used to modify the list.
174 <!-- EDIT10 SECTION "gobject" [3351-4335] -->
175 <h2 class=
"sectionedit11" id=
"references">References
</h2>
178 <li class=
"level1"><div class=
"li"> <a href=
"http://www.unet.univie.ac.at/aix/aixprggd/genprogc/writing_reentrant_thread_safe_code.htm" class=
"urlextern" title=
"http://www.unet.univie.ac.at/aix/aixprggd/genprogc/writing_reentrant_thread_safe_code.htm" rel=
"nofollow">Writing Reentrant and Thread-Safe Code
</a></div>
183 <!-- EDIT11 SECTION "References" [4336-] --></body>