Initial import
authormaritus <lucas.pawlik@gmail.com>
Tue, 22 Aug 2006 13:12:25 +0000 (13:12 +0000)
committermaritus <lucas.pawlik@gmail.com>
Tue, 22 Aug 2006 13:12:25 +0000 (13:12 +0000)
git-svn-id: file:///svnroot/mdictionary/trunk@1 5bde0345-f819-0410-ac75-e5045f9217cc

29 files changed:
README [new file with mode: 0644]
dbus/COPYING [new file with mode: 0644]
dbus/Doxyfile [new file with mode: 0644]
dbus/Makefile [new file with mode: 0644]
dbus/src/ws_dbus.c [new file with mode: 0644]
engine/COPYING [new file with mode: 0644]
engine/doxyconf [new file with mode: 0644]
engine/include/dictionary_engine.h [new file with mode: 0644]
engine/include/engine_xdxf.h [new file with mode: 0644]
engine/makefile [new file with mode: 0644]
engine/src/engine_xdxf.c [new file with mode: 0644]
gui/makefile [new file with mode: 0644]
gui/src/ikona.png [new file with mode: 0644]
gui/src/ws_gui.c [new file with mode: 0644]
gui/src/ws_gui_callbacks.c [new file with mode: 0644]
gui/src/ws_gui_layout.c [new file with mode: 0644]
include/dictionary_engine.h [new file with mode: 0644]
include/engine_xdxf.h [new file with mode: 0644]
include/ws_dbus.h [new file with mode: 0644]
include/ws_gui.h [new file with mode: 0644]
include/ws_gui_callbacks.h [new file with mode: 0644]
include/ws_gui_layout.h [new file with mode: 0644]
include/ws_manager.h [new file with mode: 0644]
makefile [new file with mode: 0644]
manager/COPYING [new file with mode: 0644]
manager/Doxyfile [new file with mode: 0644]
manager/makefile [new file with mode: 0644]
manager/src/test_mng.c [new file with mode: 0644]
manager/src/ws_manager.c [new file with mode: 0644]

diff --git a/README b/README
new file mode 100644 (file)
index 0000000..e06bbe9
--- /dev/null
+++ b/README
@@ -0,0 +1,28 @@
+WhiteStork Multilingual Dictionary ver. 0.1.0 ALPHA
+
+What is WhiteStork Multilingual Dictionary
+------------------------------------------
+WhiteStork is a multilingual dictionary enabling its users to use many dictionary formats. Our final goal is to use many search engines so that different file formats could be used. They will be in a form of dynamically loadable modules. For now however, we have limited the project to one engine for the XDXF format. The application consists of four modules: 
+
+- GUI - written using GTK+ Hildon, commercial License
+- Engine - XDXF format parser, GPL license
+- Manager - thread management and GUI starting, GPL license
+- D-BUS wrapper - communication between GUI and Manager, LGPL license. 
+
+Compilation
+-----------
+
+In order to compile this application go to the WhiteStork/trunk directory and run the following command:
+
+make clean && make
+
+Should there be any problems, please contact one of our developers.
+
+Running
+-------
+
+After the compilation is successful run the following command:
+
+make run
+
+If an error dialog pops up, saying that: "There is no dictionary available", this means you have to download a dictionary. In order to do that go to: http://xdxf.revdanica.com/down/. Place the dict.xdxf file in WhiteStork/trunk folder. When switching to a different dictionary, please remove the dict.cache file.
\ No newline at end of file
diff --git a/dbus/COPYING b/dbus/COPYING
new file mode 100644 (file)
index 0000000..5ab7695
--- /dev/null
@@ -0,0 +1,504 @@
+                 GNU LESSER GENERAL PUBLIC LICENSE
+                      Version 2.1, February 1999
+
+ Copyright (C) 1991, 1999 Free Software Foundation, Inc.
+ 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
+ Everyone is permitted to copy and distribute verbatim copies
+ of this license document, but changing it is not allowed.
+
+[This is the first released version of the Lesser GPL.  It also counts
+ as the successor of the GNU Library Public License, version 2, hence
+ the version number 2.1.]
+
+                           Preamble
+
+  The licenses for most software are designed to take away your
+freedom to share and change it.  By contrast, the GNU General Public
+Licenses are intended to guarantee your freedom to share and change
+free software--to make sure the software is free for all its users.
+
+  This license, the Lesser General Public License, applies to some
+specially designated software packages--typically libraries--of the
+Free Software Foundation and other authors who decide to use it.  You
+can use it too, but we suggest you first think carefully about whether
+this license or the ordinary General Public License is the better
+strategy to use in any particular case, based on the explanations below.
+
+  When we speak of free software, we are referring to freedom of use,
+not price.  Our General Public Licenses are designed to make sure that
+you have the freedom to distribute copies of free software (and charge
+for this service if you wish); that you receive source code or can get
+it if you want it; that you can change the software and use pieces of
+it in new free programs; and that you are informed that you can do
+these things.
+
+  To protect your rights, we need to make restrictions that forbid
+distributors to deny you these rights or to ask you to surrender these
+rights.  These restrictions translate to certain responsibilities for
+you if you distribute copies of the library or if you modify it.
+
+  For example, if you distribute copies of the library, whether gratis
+or for a fee, you must give the recipients all the rights that we gave
+you.  You must make sure that they, too, receive or can get the source
+code.  If you link other code with the library, you must provide
+complete object files to the recipients, so that they can relink them
+with the library after making changes to the library and recompiling
+it.  And you must show them these terms so they know their rights.
+
+  We protect your rights with a two-step method: (1) we copyright the
+library, and (2) we offer you this license, which gives you legal
+permission to copy, distribute and/or modify the library.
+
+  To protect each distributor, we want to make it very clear that
+there is no warranty for the free library.  Also, if the library is
+modified by someone else and passed on, the recipients should know
+that what they have is not the original version, so that the original
+author's reputation will not be affected by problems that might be
+introduced by others.
+\f
+  Finally, software patents pose a constant threat to the existence of
+any free program.  We wish to make sure that a company cannot
+effectively restrict the users of a free program by obtaining a
+restrictive license from a patent holder.  Therefore, we insist that
+any patent license obtained for a version of the library must be
+consistent with the full freedom of use specified in this license.
+
+  Most GNU software, including some libraries, is covered by the
+ordinary GNU General Public License.  This license, the GNU Lesser
+General Public License, applies to certain designated libraries, and
+is quite different from the ordinary General Public License.  We use
+this license for certain libraries in order to permit linking those
+libraries into non-free programs.
+
+  When a program is linked with a library, whether statically or using
+a shared library, the combination of the two is legally speaking a
+combined work, a derivative of the original library.  The ordinary
+General Public License therefore permits such linking only if the
+entire combination fits its criteria of freedom.  The Lesser General
+Public License permits more lax criteria for linking other code with
+the library.
+
+  We call this license the "Lesser" General Public License because it
+does Less to protect the user's freedom than the ordinary General
+Public License.  It also provides other free software developers Less
+of an advantage over competing non-free programs.  These disadvantages
+are the reason we use the ordinary General Public License for many
+libraries.  However, the Lesser license provides advantages in certain
+special circumstances.
+
+  For example, on rare occasions, there may be a special need to
+encourage the widest possible use of a certain library, so that it becomes
+a de-facto standard.  To achieve this, non-free programs must be
+allowed to use the library.  A more frequent case is that a free
+library does the same job as widely used non-free libraries.  In this
+case, there is little to gain by limiting the free library to free
+software only, so we use the Lesser General Public License.
+
+  In other cases, permission to use a particular library in non-free
+programs enables a greater number of people to use a large body of
+free software.  For example, permission to use the GNU C Library in
+non-free programs enables many more people to use the whole GNU
+operating system, as well as its variant, the GNU/Linux operating
+system.
+
+  Although the Lesser General Public License is Less protective of the
+users' freedom, it does ensure that the user of a program that is
+linked with the Library has the freedom and the wherewithal to run
+that program using a modified version of the Library.
+
+  The precise terms and conditions for copying, distribution and
+modification follow.  Pay close attention to the difference between a
+"work based on the library" and a "work that uses the library".  The
+former contains code derived from the library, whereas the latter must
+be combined with the library in order to run.
+\f
+                 GNU LESSER GENERAL PUBLIC LICENSE
+   TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
+
+  0. This License Agreement applies to any software library or other
+program which contains a notice placed by the copyright holder or
+other authorized party saying it may be distributed under the terms of
+this Lesser General Public License (also called "this License").
+Each licensee is addressed as "you".
+
+  A "library" means a collection of software functions and/or data
+prepared so as to be conveniently linked with application programs
+(which use some of those functions and data) to form executables.
+
+  The "Library", below, refers to any such software library or work
+which has been distributed under these terms.  A "work based on the
+Library" means either the Library or any derivative work under
+copyright law: that is to say, a work containing the Library or a
+portion of it, either verbatim or with modifications and/or translated
+straightforwardly into another language.  (Hereinafter, translation is
+included without limitation in the term "modification".)
+
+  "Source code" for a work means the preferred form of the work for
+making modifications to it.  For a library, complete source code means
+all the source code for all modules it contains, plus any associated
+interface definition files, plus the scripts used to control compilation
+and installation of the library.
+
+  Activities other than copying, distribution and modification are not
+covered by this License; they are outside its scope.  The act of
+running a program using the Library is not restricted, and output from
+such a program is covered only if its contents constitute a work based
+on the Library (independent of the use of the Library in a tool for
+writing it).  Whether that is true depends on what the Library does
+and what the program that uses the Library does.
+  
+  1. You may copy and distribute verbatim copies of the Library's
+complete source code as you receive it, in any medium, provided that
+you conspicuously and appropriately publish on each copy an
+appropriate copyright notice and disclaimer of warranty; keep intact
+all the notices that refer to this License and to the absence of any
+warranty; and distribute a copy of this License along with the
+Library.
+
+  You may charge a fee for the physical act of transferring a copy,
+and you may at your option offer warranty protection in exchange for a
+fee.
+\f
+  2. You may modify your copy or copies of the Library or any portion
+of it, thus forming a work based on the Library, and copy and
+distribute such modifications or work under the terms of Section 1
+above, provided that you also meet all of these conditions:
+
+    a) The modified work must itself be a software library.
+
+    b) You must cause the files modified to carry prominent notices
+    stating that you changed the files and the date of any change.
+
+    c) You must cause the whole of the work to be licensed at no
+    charge to all third parties under the terms of this License.
+
+    d) If a facility in the modified Library refers to a function or a
+    table of data to be supplied by an application program that uses
+    the facility, other than as an argument passed when the facility
+    is invoked, then you must make a good faith effort to ensure that,
+    in the event an application does not supply such function or
+    table, the facility still operates, and performs whatever part of
+    its purpose remains meaningful.
+
+    (For example, a function in a library to compute square roots has
+    a purpose that is entirely well-defined independent of the
+    application.  Therefore, Subsection 2d requires that any
+    application-supplied function or table used by this function must
+    be optional: if the application does not supply it, the square
+    root function must still compute square roots.)
+
+These requirements apply to the modified work as a whole.  If
+identifiable sections of that work are not derived from the Library,
+and can be reasonably considered independent and separate works in
+themselves, then this License, and its terms, do not apply to those
+sections when you distribute them as separate works.  But when you
+distribute the same sections as part of a whole which is a work based
+on the Library, the distribution of the whole must be on the terms of
+this License, whose permissions for other licensees extend to the
+entire whole, and thus to each and every part regardless of who wrote
+it.
+
+Thus, it is not the intent of this section to claim rights or contest
+your rights to work written entirely by you; rather, the intent is to
+exercise the right to control the distribution of derivative or
+collective works based on the Library.
+
+In addition, mere aggregation of another work not based on the Library
+with the Library (or with a work based on the Library) on a volume of
+a storage or distribution medium does not bring the other work under
+the scope of this License.
+
+  3. You may opt to apply the terms of the ordinary GNU General Public
+License instead of this License to a given copy of the Library.  To do
+this, you must alter all the notices that refer to this License, so
+that they refer to the ordinary GNU General Public License, version 2,
+instead of to this License.  (If a newer version than version 2 of the
+ordinary GNU General Public License has appeared, then you can specify
+that version instead if you wish.)  Do not make any other change in
+these notices.
+\f
+  Once this change is made in a given copy, it is irreversible for
+that copy, so the ordinary GNU General Public License applies to all
+subsequent copies and derivative works made from that copy.
+
+  This option is useful when you wish to copy part of the code of
+the Library into a program that is not a library.
+
+  4. You may copy and distribute the Library (or a portion or
+derivative of it, under Section 2) in object code or executable form
+under the terms of Sections 1 and 2 above provided that you accompany
+it with the complete corresponding machine-readable source code, which
+must be distributed under the terms of Sections 1 and 2 above on a
+medium customarily used for software interchange.
+
+  If distribution of object code is made by offering access to copy
+from a designated place, then offering equivalent access to copy the
+source code from the same place satisfies the requirement to
+distribute the source code, even though third parties are not
+compelled to copy the source along with the object code.
+
+  5. A program that contains no derivative of any portion of the
+Library, but is designed to work with the Library by being compiled or
+linked with it, is called a "work that uses the Library".  Such a
+work, in isolation, is not a derivative work of the Library, and
+therefore falls outside the scope of this License.
+
+  However, linking a "work that uses the Library" with the Library
+creates an executable that is a derivative of the Library (because it
+contains portions of the Library), rather than a "work that uses the
+library".  The executable is therefore covered by this License.
+Section 6 states terms for distribution of such executables.
+
+  When a "work that uses the Library" uses material from a header file
+that is part of the Library, the object code for the work may be a
+derivative work of the Library even though the source code is not.
+Whether this is true is especially significant if the work can be
+linked without the Library, or if the work is itself a library.  The
+threshold for this to be true is not precisely defined by law.
+
+  If such an object file uses only numerical parameters, data
+structure layouts and accessors, and small macros and small inline
+functions (ten lines or less in length), then the use of the object
+file is unrestricted, regardless of whether it is legally a derivative
+work.  (Executables containing this object code plus portions of the
+Library will still fall under Section 6.)
+
+  Otherwise, if the work is a derivative of the Library, you may
+distribute the object code for the work under the terms of Section 6.
+Any executables containing that work also fall under Section 6,
+whether or not they are linked directly with the Library itself.
+\f
+  6. As an exception to the Sections above, you may also combine or
+link a "work that uses the Library" with the Library to produce a
+work containing portions of the Library, and distribute that work
+under terms of your choice, provided that the terms permit
+modification of the work for the customer's own use and reverse
+engineering for debugging such modifications.
+
+  You must give prominent notice with each copy of the work that the
+Library is used in it and that the Library and its use are covered by
+this License.  You must supply a copy of this License.  If the work
+during execution displays copyright notices, you must include the
+copyright notice for the Library among them, as well as a reference
+directing the user to the copy of this License.  Also, you must do one
+of these things:
+
+    a) Accompany the work with the complete corresponding
+    machine-readable source code for the Library including whatever
+    changes were used in the work (which must be distributed under
+    Sections 1 and 2 above); and, if the work is an executable linked
+    with the Library, with the complete machine-readable "work that
+    uses the Library", as object code and/or source code, so that the
+    user can modify the Library and then relink to produce a modified
+    executable containing the modified Library.  (It is understood
+    that the user who changes the contents of definitions files in the
+    Library will not necessarily be able to recompile the application
+    to use the modified definitions.)
+
+    b) Use a suitable shared library mechanism for linking with the
+    Library.  A suitable mechanism is one that (1) uses at run time a
+    copy of the library already present on the user's computer system,
+    rather than copying library functions into the executable, and (2)
+    will operate properly with a modified version of the library, if
+    the user installs one, as long as the modified version is
+    interface-compatible with the version that the work was made with.
+
+    c) Accompany the work with a written offer, valid for at
+    least three years, to give the same user the materials
+    specified in Subsection 6a, above, for a charge no more
+    than the cost of performing this distribution.
+
+    d) If distribution of the work is made by offering access to copy
+    from a designated place, offer equivalent access to copy the above
+    specified materials from the same place.
+
+    e) Verify that the user has already received a copy of these
+    materials or that you have already sent this user a copy.
+
+  For an executable, the required form of the "work that uses the
+Library" must include any data and utility programs needed for
+reproducing the executable from it.  However, as a special exception,
+the materials to be distributed need not include anything that is
+normally distributed (in either source or binary form) with the major
+components (compiler, kernel, and so on) of the operating system on
+which the executable runs, unless that component itself accompanies
+the executable.
+
+  It may happen that this requirement contradicts the license
+restrictions of other proprietary libraries that do not normally
+accompany the operating system.  Such a contradiction means you cannot
+use both them and the Library together in an executable that you
+distribute.
+\f
+  7. You may place library facilities that are a work based on the
+Library side-by-side in a single library together with other library
+facilities not covered by this License, and distribute such a combined
+library, provided that the separate distribution of the work based on
+the Library and of the other library facilities is otherwise
+permitted, and provided that you do these two things:
+
+    a) Accompany the combined library with a copy of the same work
+    based on the Library, uncombined with any other library
+    facilities.  This must be distributed under the terms of the
+    Sections above.
+
+    b) Give prominent notice with the combined library of the fact
+    that part of it is a work based on the Library, and explaining
+    where to find the accompanying uncombined form of the same work.
+
+  8. You may not copy, modify, sublicense, link with, or distribute
+the Library except as expressly provided under this License.  Any
+attempt otherwise to copy, modify, sublicense, link with, or
+distribute the Library is void, and will automatically terminate your
+rights under this License.  However, parties who have received copies,
+or rights, from you under this License will not have their licenses
+terminated so long as such parties remain in full compliance.
+
+  9. You are not required to accept this License, since you have not
+signed it.  However, nothing else grants you permission to modify or
+distribute the Library or its derivative works.  These actions are
+prohibited by law if you do not accept this License.  Therefore, by
+modifying or distributing the Library (or any work based on the
+Library), you indicate your acceptance of this License to do so, and
+all its terms and conditions for copying, distributing or modifying
+the Library or works based on it.
+
+  10. Each time you redistribute the Library (or any work based on the
+Library), the recipient automatically receives a license from the
+original licensor to copy, distribute, link with or modify the Library
+subject to these terms and conditions.  You may not impose any further
+restrictions on the recipients' exercise of the rights granted herein.
+You are not responsible for enforcing compliance by third parties with
+this License.
+\f
+  11. If, as a consequence of a court judgment or allegation of patent
+infringement or for any other reason (not limited to patent issues),
+conditions are imposed on you (whether by court order, agreement or
+otherwise) that contradict the conditions of this License, they do not
+excuse you from the conditions of this License.  If you cannot
+distribute so as to satisfy simultaneously your obligations under this
+License and any other pertinent obligations, then as a consequence you
+may not distribute the Library at all.  For example, if a patent
+license would not permit royalty-free redistribution of the Library by
+all those who receive copies directly or indirectly through you, then
+the only way you could satisfy both it and this License would be to
+refrain entirely from distribution of the Library.
+
+If any portion of this section is held invalid or unenforceable under any
+particular circumstance, the balance of the section is intended to apply,
+and the section as a whole is intended to apply in other circumstances.
+
+It is not the purpose of this section to induce you to infringe any
+patents or other property right claims or to contest validity of any
+such claims; this section has the sole purpose of protecting the
+integrity of the free software distribution system which is
+implemented by public license practices.  Many people have made
+generous contributions to the wide range of software distributed
+through that system in reliance on consistent application of that
+system; it is up to the author/donor to decide if he or she is willing
+to distribute software through any other system and a licensee cannot
+impose that choice.
+
+This section is intended to make thoroughly clear what is believed to
+be a consequence of the rest of this License.
+
+  12. If the distribution and/or use of the Library is restricted in
+certain countries either by patents or by copyrighted interfaces, the
+original copyright holder who places the Library under this License may add
+an explicit geographical distribution limitation excluding those countries,
+so that distribution is permitted only in or among countries not thus
+excluded.  In such case, this License incorporates the limitation as if
+written in the body of this License.
+
+  13. The Free Software Foundation may publish revised and/or new
+versions of the Lesser General Public License from time to time.
+Such new versions will be similar in spirit to the present version,
+but may differ in detail to address new problems or concerns.
+
+Each version is given a distinguishing version number.  If the Library
+specifies a version number of this License which applies to it and
+"any later version", you have the option of following the terms and
+conditions either of that version or of any later version published by
+the Free Software Foundation.  If the Library does not specify a
+license version number, you may choose any version ever published by
+the Free Software Foundation.
+\f
+  14. If you wish to incorporate parts of the Library into other free
+programs whose distribution conditions are incompatible with these,
+write to the author to ask for permission.  For software which is
+copyrighted by the Free Software Foundation, write to the Free
+Software Foundation; we sometimes make exceptions for this.  Our
+decision will be guided by the two goals of preserving the free status
+of all derivatives of our free software and of promoting the sharing
+and reuse of software generally.
+
+                           NO WARRANTY
+
+  15. BECAUSE THE LIBRARY IS LICENSED FREE OF CHARGE, THERE IS NO
+WARRANTY FOR THE LIBRARY, TO THE EXTENT PERMITTED BY APPLICABLE LAW.
+EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR
+OTHER PARTIES PROVIDE THE LIBRARY "AS IS" WITHOUT WARRANTY OF ANY
+KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE
+IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+PURPOSE.  THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE
+LIBRARY IS WITH YOU.  SHOULD THE LIBRARY PROVE DEFECTIVE, YOU ASSUME
+THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
+
+  16. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN
+WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY
+AND/OR REDISTRIBUTE THE LIBRARY AS PERMITTED ABOVE, BE LIABLE TO YOU
+FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR
+CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE
+LIBRARY (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING
+RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A
+FAILURE OF THE LIBRARY TO OPERATE WITH ANY OTHER SOFTWARE), EVEN IF
+SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH
+DAMAGES.
+
+                    END OF TERMS AND CONDITIONS
+\f
+           How to Apply These Terms to Your New Libraries
+
+  If you develop a new library, and you want it to be of the greatest
+possible use to the public, we recommend making it free software that
+everyone can redistribute and change.  You can do so by permitting
+redistribution under these terms (or, alternatively, under the terms of the
+ordinary General Public License).
+
+  To apply these terms, attach the following notices to the library.  It is
+safest to attach them to the start of each source file to most effectively
+convey the exclusion of warranty; and each file should have at least the
+"copyright" line and a pointer to where the full notice is found.
+
+    <one line to give the library's name and a brief idea of what it does.>
+    Copyright (C) <year>  <name of author>
+
+    This library is free software; you can redistribute it and/or
+    modify it under the terms of the GNU Lesser General Public
+    License as published by the Free Software Foundation; either
+    version 2.1 of the License, or (at your option) any later version.
+
+    This library is distributed in the hope that it will be useful,
+    but WITHOUT ANY WARRANTY; without even the implied warranty of
+    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+    Lesser General Public License for more details.
+
+    You should have received a copy of the GNU Lesser General Public
+    License along with this library; if not, write to the Free Software
+    Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
+
+Also add information on how to contact you by electronic and paper mail.
+
+You should also get your employer (if you work as a programmer) or your
+school, if any, to sign a "copyright disclaimer" for the library, if
+necessary.  Here is a sample; alter the names:
+
+  Yoyodyne, Inc., hereby disclaims all copyright interest in the
+  library `Frob' (a library for tweaking knobs) written by James Random Hacker.
+
+  <signature of Ty Coon>, 1 April 1990
+  Ty Coon, President of Vice
+
+That's all there is to it!
+
+
diff --git a/dbus/Doxyfile b/dbus/Doxyfile
new file mode 100644 (file)
index 0000000..fc998bf
--- /dev/null
@@ -0,0 +1,1237 @@
+# Doxyfile 1.4.6
+# This file describes the settings to be used by the documentation system
+# doxygen (www.doxygen.org) for a project
+#
+# All text after a hash (#) is considered a comment and will be ignored
+# The format is:
+#       TAG = value [value, ...]
+# For lists items can also be appended using:
+#       TAG += value [value, ...]
+# Values that contain spaces should be placed between quotes (" ")
+#---------------------------------------------------------------------------
+# Project related configuration options
+#---------------------------------------------------------------------------
+# The PROJECT_NAME tag is a single word (or a sequence of words surrounded 
+# by quotes) that should identify the project.
+PROJECT_NAME           = White Stork DBus Wrapper Module
+# The PROJECT_NUMBER tag can be used to enter a project or revision number. 
+# This could be handy for archiving the generated documentation or 
+# if some version control system is used.
+PROJECT_NUMBER         = 0.1
+# The OUTPUT_DIRECTORY tag is used to specify the (relative or absolute) 
+# base path where the generated documentation will be put. 
+# If a relative path is entered, it will be relative to the location 
+# where doxygen was started. If left blank the current directory will be used.
+OUTPUT_DIRECTORY       = doc/
+# If the CREATE_SUBDIRS tag is set to YES, then doxygen will create 
+# 4096 sub-directories (in 2 levels) under the output directory of each output 
+# format and will distribute the generated files over these directories. 
+# Enabling this option can be useful when feeding doxygen a huge amount of 
+# source files, where putting all generated files in the same directory would 
+# otherwise cause performance problems for the file system.
+CREATE_SUBDIRS         = NO
+# The OUTPUT_LANGUAGE tag is used to specify the language in which all 
+# documentation generated by doxygen is written. Doxygen will use this 
+# information to generate all constant output in the proper language. 
+# The default language is English, other supported languages are: 
+# Brazilian, Catalan, Chinese, Chinese-Traditional, Croatian, Czech, Danish, 
+# Dutch, Finnish, French, German, Greek, Hungarian, Italian, Japanese, 
+# Japanese-en (Japanese with English messages), Korean, Korean-en, Norwegian, 
+# Polish, Portuguese, Romanian, Russian, Serbian, Slovak, Slovene, Spanish, 
+# Swedish, and Ukrainian.
+OUTPUT_LANGUAGE        = English
+# This tag can be used to specify the encoding used in the generated output. 
+# The encoding is not always determined by the language that is chosen, 
+# but also whether or not the output is meant for Windows or non-Windows users. 
+# In case there is a difference, setting the USE_WINDOWS_ENCODING tag to YES 
+# forces the Windows encoding (this is the default for the Windows binary), 
+# whereas setting the tag to NO uses a Unix-style encoding (the default for 
+# all platforms other than Windows).
+USE_WINDOWS_ENCODING   = NO
+# If the BRIEF_MEMBER_DESC tag is set to YES (the default) Doxygen will 
+# include brief member descriptions after the members that are listed in 
+# the file and class documentation (similar to JavaDoc). 
+# Set to NO to disable this.
+BRIEF_MEMBER_DESC      = YES
+# If the REPEAT_BRIEF tag is set to YES (the default) Doxygen will prepend 
+# the brief description of a member or function before the detailed description. 
+# Note: if both HIDE_UNDOC_MEMBERS and BRIEF_MEMBER_DESC are set to NO, the 
+# brief descriptions will be completely suppressed.
+REPEAT_BRIEF           = YES
+# This tag implements a quasi-intelligent brief description abbreviator 
+# that is used to form the text in various listings. Each string 
+# in this list, if found as the leading text of the brief description, will be 
+# stripped from the text and the result after processing the whole list, is 
+# used as the annotated text. Otherwise, the brief description is used as-is. 
+# If left blank, the following values are used ("$name" is automatically 
+# replaced with the name of the entity): "The $name class" "The $name widget" 
+# "The $name file" "is" "provides" "specifies" "contains" 
+# "represents" "a" "an" "the"
+ABBREVIATE_BRIEF       = 
+# If the ALWAYS_DETAILED_SEC and REPEAT_BRIEF tags are both set to YES then 
+# Doxygen will generate a detailed section even if there is only a brief 
+# description.
+ALWAYS_DETAILED_SEC    = NO
+# If the INLINE_INHERITED_MEMB tag is set to YES, doxygen will show all 
+# inherited members of a class in the documentation of that class as if those 
+# members were ordinary class members. Constructors, destructors and assignment 
+# operators of the base classes will not be shown.
+INLINE_INHERITED_MEMB  = NO
+# If the FULL_PATH_NAMES tag is set to YES then Doxygen will prepend the full 
+# path before files name in the file list and in the header files. If set 
+# to NO the shortest path that makes the file name unique will be used.
+FULL_PATH_NAMES        = NO
+# If the FULL_PATH_NAMES tag is set to YES then the STRIP_FROM_PATH tag 
+# can be used to strip a user-defined part of the path. Stripping is 
+# only done if one of the specified strings matches the left-hand part of 
+# the path. The tag can be used to show relative paths in the file list. 
+# If left blank the directory from which doxygen is run is used as the 
+# path to strip.
+STRIP_FROM_PATH        = 
+# The STRIP_FROM_INC_PATH tag can be used to strip a user-defined part of 
+# the path mentioned in the documentation of a class, which tells 
+# the reader which header file to include in order to use a class. 
+# If left blank only the name of the header file containing the class 
+# definition is used. Otherwise one should specify the include paths that 
+# are normally passed to the compiler using the -I flag.
+STRIP_FROM_INC_PATH    = 
+# If the SHORT_NAMES tag is set to YES, doxygen will generate much shorter 
+# (but less readable) file names. This can be useful is your file systems 
+# doesn't support long names like on DOS, Mac, or CD-ROM.
+SHORT_NAMES            = NO
+# If the JAVADOC_AUTOBRIEF tag is set to YES then Doxygen 
+# will interpret the first line (until the first dot) of a JavaDoc-style 
+# comment as the brief description. If set to NO, the JavaDoc 
+# comments will behave just like the Qt-style comments (thus requiring an 
+# explicit @brief command for a brief description.
+JAVADOC_AUTOBRIEF      = NO
+# The MULTILINE_CPP_IS_BRIEF tag can be set to YES to make Doxygen 
+# treat a multi-line C++ special comment block (i.e. a block of //! or /// 
+# comments) as a brief description. This used to be the default behaviour. 
+# The new default is to treat a multi-line C++ comment block as a detailed 
+# description. Set this tag to YES if you prefer the old behaviour instead.
+MULTILINE_CPP_IS_BRIEF = NO
+# If the DETAILS_AT_TOP tag is set to YES then Doxygen 
+# will output the detailed description near the top, like JavaDoc.
+# If set to NO, the detailed description appears after the member 
+# documentation.
+DETAILS_AT_TOP         = NO
+# If the INHERIT_DOCS tag is set to YES (the default) then an undocumented 
+# member inherits the documentation from any documented member that it 
+# re-implements.
+INHERIT_DOCS           = YES
+# If the SEPARATE_MEMBER_PAGES tag is set to YES, then doxygen will produce 
+# a new page for each member. If set to NO, the documentation of a member will 
+# be part of the file/class/namespace that contains it.
+SEPARATE_MEMBER_PAGES  = NO
+# The TAB_SIZE tag can be used to set the number of spaces in a tab. 
+# Doxygen uses this value to replace tabs by spaces in code fragments.
+TAB_SIZE               = 8
+# This tag can be used to specify a number of aliases that acts 
+# as commands in the documentation. An alias has the form "name=value". 
+# For example adding "sideeffect=\par Side Effects:\n" will allow you to 
+# put the command \sideeffect (or @sideeffect) in the documentation, which 
+# will result in a user-defined paragraph with heading "Side Effects:". 
+# You can put \n's in the value part of an alias to insert newlines.
+ALIASES                = 
+# Set the OPTIMIZE_OUTPUT_FOR_C tag to YES if your project consists of C 
+# sources only. Doxygen will then generate output that is more tailored for C. 
+# For instance, some of the names that are used will be different. The list 
+# of all members will be omitted, etc.
+OPTIMIZE_OUTPUT_FOR_C  = YES
+# Set the OPTIMIZE_OUTPUT_JAVA tag to YES if your project consists of Java 
+# sources only. Doxygen will then generate output that is more tailored for Java. 
+# For instance, namespaces will be presented as packages, qualified scopes 
+# will look different, etc.
+OPTIMIZE_OUTPUT_JAVA   = NO
+# If you use STL classes (i.e. std::string, std::vector, etc.) but do not want to 
+# include (a tag file for) the STL sources as input, then you should 
+# set this tag to YES in order to let doxygen match functions declarations and 
+# definitions whose arguments contain STL classes (e.g. func(std::string); v.s. 
+# func(std::string) {}). This also make the inheritance and collaboration 
+# diagrams that involve STL classes more complete and accurate.
+BUILTIN_STL_SUPPORT    = NO
+# If member grouping is used in the documentation and the DISTRIBUTE_GROUP_DOC 
+# tag is set to YES, then doxygen will reuse the documentation of the first 
+# member in the group (if any) for the other members of the group. By default 
+# all members of a group must be documented explicitly.
+DISTRIBUTE_GROUP_DOC   = NO
+# Set the SUBGROUPING tag to YES (the default) to allow class member groups of 
+# the same type (for instance a group of public functions) to be put as a 
+# subgroup of that type (e.g. under the Public Functions section). Set it to 
+# NO to prevent subgrouping. Alternatively, this can be done per class using 
+# the \nosubgrouping command.
+SUBGROUPING            = YES
+#---------------------------------------------------------------------------
+# Build related configuration options
+#---------------------------------------------------------------------------
+# If the EXTRACT_ALL tag is set to YES doxygen will assume all entities in 
+# documentation are documented, even if no documentation was available. 
+# Private class members and static file members will be hidden unless 
+# the EXTRACT_PRIVATE and EXTRACT_STATIC tags are set to YES
+EXTRACT_ALL            = YES
+# If the EXTRACT_PRIVATE tag is set to YES all private members of a class 
+# will be included in the documentation.
+EXTRACT_PRIVATE        = YES
+# If the EXTRACT_STATIC tag is set to YES all static members of a file 
+# will be included in the documentation.
+EXTRACT_STATIC         = YES
+# If the EXTRACT_LOCAL_CLASSES tag is set to YES classes (and structs) 
+# defined locally in source files will be included in the documentation. 
+# If set to NO only classes defined in header files are included.
+EXTRACT_LOCAL_CLASSES  = YES
+# This flag is only useful for Objective-C code. When set to YES local 
+# methods, which are defined in the implementation section but not in 
+# the interface are included in the documentation. 
+# If set to NO (the default) only methods in the interface are included.
+EXTRACT_LOCAL_METHODS  = NO
+# If the HIDE_UNDOC_MEMBERS tag is set to YES, Doxygen will hide all 
+# undocumented members of documented classes, files or namespaces. 
+# If set to NO (the default) these members will be included in the 
+# various overviews, but no documentation section is generated. 
+# This option has no effect if EXTRACT_ALL is enabled.
+HIDE_UNDOC_MEMBERS     = NO
+# If the HIDE_UNDOC_CLASSES tag is set to YES, Doxygen will hide all 
+# undocumented classes that are normally visible in the class hierarchy. 
+# If set to NO (the default) these classes will be included in the various 
+# overviews. This option has no effect if EXTRACT_ALL is enabled.
+HIDE_UNDOC_CLASSES     = NO
+# If the HIDE_FRIEND_COMPOUNDS tag is set to YES, Doxygen will hide all 
+# friend (class|struct|union) declarations. 
+# If set to NO (the default) these declarations will be included in the 
+# documentation.
+HIDE_FRIEND_COMPOUNDS  = NO
+# If the HIDE_IN_BODY_DOCS tag is set to YES, Doxygen will hide any 
+# documentation blocks found inside the body of a function. 
+# If set to NO (the default) these blocks will be appended to the 
+# function's detailed documentation block.
+HIDE_IN_BODY_DOCS      = NO
+# The INTERNAL_DOCS tag determines if documentation 
+# that is typed after a \internal command is included. If the tag is set 
+# to NO (the default) then the documentation will be excluded. 
+# Set it to YES to include the internal documentation.
+INTERNAL_DOCS          = NO
+# If the CASE_SENSE_NAMES tag is set to NO then Doxygen will only generate 
+# file names in lower-case letters. If set to YES upper-case letters are also 
+# allowed. This is useful if you have classes or files whose names only differ 
+# in case and if your file system supports case sensitive file names. Windows 
+# and Mac users are advised to set this option to NO.
+CASE_SENSE_NAMES       = YES
+# If the HIDE_SCOPE_NAMES tag is set to NO (the default) then Doxygen 
+# will show members with their full class and namespace scopes in the 
+# documentation. If set to YES the scope will be hidden.
+HIDE_SCOPE_NAMES       = NO
+# If the SHOW_INCLUDE_FILES tag is set to YES (the default) then Doxygen 
+# will put a list of the files that are included by a file in the documentation 
+# of that file.
+SHOW_INCLUDE_FILES     = YES
+# If the INLINE_INFO tag is set to YES (the default) then a tag [inline] 
+# is inserted in the documentation for inline members.
+INLINE_INFO            = YES
+# If the SORT_MEMBER_DOCS tag is set to YES (the default) then doxygen 
+# will sort the (detailed) documentation of file and class members 
+# alphabetically by member name. If set to NO the members will appear in 
+# declaration order.
+SORT_MEMBER_DOCS       = YES
+# If the SORT_BRIEF_DOCS tag is set to YES then doxygen will sort the 
+# brief documentation of file, namespace and class members alphabetically 
+# by member name. If set to NO (the default) the members will appear in 
+# declaration order.
+SORT_BRIEF_DOCS        = NO
+# If the SORT_BY_SCOPE_NAME tag is set to YES, the class list will be 
+# sorted by fully-qualified names, including namespaces. If set to 
+# NO (the default), the class list will be sorted only by class name, 
+# not including the namespace part. 
+# Note: This option is not very useful if HIDE_SCOPE_NAMES is set to YES.
+# Note: This option applies only to the class list, not to the 
+# alphabetical list.
+SORT_BY_SCOPE_NAME     = NO
+# The GENERATE_TODOLIST tag can be used to enable (YES) or 
+# disable (NO) the todo list. This list is created by putting \todo 
+# commands in the documentation.
+GENERATE_TODOLIST      = YES
+# The GENERATE_TESTLIST tag can be used to enable (YES) or 
+# disable (NO) the test list. This list is created by putting \test 
+# commands in the documentation.
+GENERATE_TESTLIST      = YES
+# The GENERATE_BUGLIST tag can be used to enable (YES) or 
+# disable (NO) the bug list. This list is created by putting \bug 
+# commands in the documentation.
+GENERATE_BUGLIST       = YES
+# The GENERATE_DEPRECATEDLIST tag can be used to enable (YES) or 
+# disable (NO) the deprecated list. This list is created by putting 
+# \deprecated commands in the documentation.
+GENERATE_DEPRECATEDLIST= YES
+# The ENABLED_SECTIONS tag can be used to enable conditional 
+# documentation sections, marked by \if sectionname ... \endif.
+ENABLED_SECTIONS       = 
+# The MAX_INITIALIZER_LINES tag determines the maximum number of lines 
+# the initial value of a variable or define consists of for it to appear in 
+# the documentation. If the initializer consists of more lines than specified 
+# here it will be hidden. Use a value of 0 to hide initializers completely. 
+# The appearance of the initializer of individual variables and defines in the 
+# documentation can be controlled using \showinitializer or \hideinitializer 
+# command in the documentation regardless of this setting.
+MAX_INITIALIZER_LINES  = 30
+# Set the SHOW_USED_FILES tag to NO to disable the list of files generated 
+# at the bottom of the documentation of classes and structs. If set to YES the 
+# list will mention the files that were used to generate the documentation.
+SHOW_USED_FILES        = YES
+# If the sources in your project are distributed over multiple directories 
+# then setting the SHOW_DIRECTORIES tag to YES will show the directory hierarchy 
+# in the documentation. The default is NO.
+SHOW_DIRECTORIES       = NO
+# The FILE_VERSION_FILTER tag can be used to specify a program or script that 
+# doxygen should invoke to get the current version for each file (typically from the 
+# version control system). Doxygen will invoke the program by executing (via 
+# popen()) the command <command> <input-file>, where <command> is the value of 
+# the FILE_VERSION_FILTER tag, and <input-file> is the name of an input file 
+# provided by doxygen. Whatever the program writes to standard output 
+# is used as the file version. See the manual for examples.
+FILE_VERSION_FILTER    = 
+#---------------------------------------------------------------------------
+# configuration options related to warning and progress messages
+#---------------------------------------------------------------------------
+# The QUIET tag can be used to turn on/off the messages that are generated 
+# by doxygen. Possible values are YES and NO. If left blank NO is used.
+QUIET                  = NO
+# The WARNINGS tag can be used to turn on/off the warning messages that are 
+# generated by doxygen. Possible values are YES and NO. If left blank 
+# NO is used.
+WARNINGS               = YES
+# If WARN_IF_UNDOCUMENTED is set to YES, then doxygen will generate warnings 
+# for undocumented members. If EXTRACT_ALL is set to YES then this flag will 
+# automatically be disabled.
+WARN_IF_UNDOCUMENTED   = YES
+# If WARN_IF_DOC_ERROR is set to YES, doxygen will generate warnings for 
+# potential errors in the documentation, such as not documenting some 
+# parameters in a documented function, or documenting parameters that 
+# don't exist or using markup commands wrongly.
+WARN_IF_DOC_ERROR      = YES
+# This WARN_NO_PARAMDOC option can be abled to get warnings for 
+# functions that are documented, but have no documentation for their parameters 
+# or return value. If set to NO (the default) doxygen will only warn about 
+# wrong or incomplete parameter documentation, but not about the absence of 
+# documentation.
+WARN_NO_PARAMDOC       = NO
+# The WARN_FORMAT tag determines the format of the warning messages that 
+# doxygen can produce. The string should contain the $file, $line, and $text 
+# tags, which will be replaced by the file and line number from which the 
+# warning originated and the warning text. Optionally the format may contain 
+# $version, which will be replaced by the version of the file (if it could 
+# be obtained via FILE_VERSION_FILTER)
+WARN_FORMAT            = "$file:$line: $text"
+# The WARN_LOGFILE tag can be used to specify a file to which warning 
+# and error messages should be written. If left blank the output is written 
+# to stderr.
+WARN_LOGFILE           = 
+#---------------------------------------------------------------------------
+# configuration options related to the input files
+#---------------------------------------------------------------------------
+# The INPUT tag can be used to specify the files and/or directories that contain 
+# documented source files. You may enter file names like "myfile.cpp" or 
+# directories like "/usr/src/myproject". Separate the files or directories 
+# with spaces.
+INPUT                  = src/ws_dbus.c ../include/ws_dbus.h
+# If the value of the INPUT tag contains directories, you can use the 
+# FILE_PATTERNS tag to specify one or more wildcard pattern (like *.cpp 
+# and *.h) to filter out the source-files in the directories. If left 
+# blank the following patterns are tested: 
+# *.c *.cc *.cxx *.cpp *.c++ *.java *.ii *.ixx *.ipp *.i++ *.inl *.h *.hh *.hxx 
+# *.hpp *.h++ *.idl *.odl *.cs *.php *.php3 *.inc *.m *.mm *.py
+FILE_PATTERNS          = 
+# The RECURSIVE tag can be used to turn specify whether or not subdirectories 
+# should be searched for input files as well. Possible values are YES and NO. 
+# If left blank NO is used.
+RECURSIVE              = YES
+# The EXCLUDE tag can be used to specify files and/or directories that should 
+# excluded from the INPUT source files. This way you can easily exclude a 
+# subdirectory from a directory tree whose root is specified with the INPUT tag.
+EXCLUDE                = 
+# The EXCLUDE_SYMLINKS tag can be used select whether or not files or 
+# directories that are symbolic links (a Unix filesystem feature) are excluded 
+# from the input.
+EXCLUDE_SYMLINKS       = NO
+# If the value of the INPUT tag contains directories, you can use the 
+# EXCLUDE_PATTERNS tag to specify one or more wildcard patterns to exclude 
+# certain files from those directories. Note that the wildcards are matched 
+# against the file with absolute path, so to exclude all test directories 
+# for example use the pattern */test/*
+EXCLUDE_PATTERNS       = 
+# The EXAMPLE_PATH tag can be used to specify one or more files or 
+# directories that contain example code fragments that are included (see 
+# the \include command).
+EXAMPLE_PATH           = 
+# If the value of the EXAMPLE_PATH tag contains directories, you can use the 
+# EXAMPLE_PATTERNS tag to specify one or more wildcard pattern (like *.cpp 
+# and *.h) to filter out the source-files in the directories. If left 
+# blank all files are included.
+EXAMPLE_PATTERNS       = 
+# If the EXAMPLE_RECURSIVE tag is set to YES then subdirectories will be 
+# searched for input files to be used with the \include or \dontinclude 
+# commands irrespective of the value of the RECURSIVE tag. 
+# Possible values are YES and NO. If left blank NO is used.
+EXAMPLE_RECURSIVE      = NO
+# The IMAGE_PATH tag can be used to specify one or more files or 
+# directories that contain image that are included in the documentation (see 
+# the \image command).
+IMAGE_PATH             = 
+# The INPUT_FILTER tag can be used to specify a program that doxygen should 
+# invoke to filter for each input file. Doxygen will invoke the filter program 
+# by executing (via popen()) the command <filter> <input-file>, where <filter> 
+# is the value of the INPUT_FILTER tag, and <input-file> is the name of an 
+# input file. Doxygen will then use the output that the filter program writes 
+# to standard output.  If FILTER_PATTERNS is specified, this tag will be 
+# ignored.
+INPUT_FILTER           = 
+# The FILTER_PATTERNS tag can be used to specify filters on a per file pattern 
+# basis.  Doxygen will compare the file name with each pattern and apply the 
+# filter if there is a match.  The filters are a list of the form: 
+# pattern=filter (like *.cpp=my_cpp_filter). See INPUT_FILTER for further 
+# info on how filters are used. If FILTER_PATTERNS is empty, INPUT_FILTER 
+# is applied to all files.
+FILTER_PATTERNS        = 
+# If the FILTER_SOURCE_FILES tag is set to YES, the input filter (if set using 
+# INPUT_FILTER) will be used to filter the input files when producing source 
+# files to browse (i.e. when SOURCE_BROWSER is set to YES).
+FILTER_SOURCE_FILES    = NO
+#---------------------------------------------------------------------------
+# configuration options related to source browsing
+#---------------------------------------------------------------------------
+# If the SOURCE_BROWSER tag is set to YES then a list of source files will 
+# be generated. Documented entities will be cross-referenced with these sources. 
+# Note: To get rid of all source code in the generated output, make sure also 
+# VERBATIM_HEADERS is set to NO.
+SOURCE_BROWSER         = YES
+# Setting the INLINE_SOURCES tag to YES will include the body 
+# of functions and classes directly in the documentation.
+INLINE_SOURCES         = NO
+# Setting the STRIP_CODE_COMMENTS tag to YES (the default) will instruct 
+# doxygen to hide any special comment blocks from generated source code 
+# fragments. Normal C and C++ comments will always remain visible.
+STRIP_CODE_COMMENTS    = YES
+# If the REFERENCED_BY_RELATION tag is set to YES (the default) 
+# then for each documented function all documented 
+# functions referencing it will be listed.
+REFERENCED_BY_RELATION = YES
+# If the REFERENCES_RELATION tag is set to YES (the default) 
+# then for each documented function all documented entities 
+# called/used by that function will be listed.
+REFERENCES_RELATION    = YES
+# If the USE_HTAGS tag is set to YES then the references to source code 
+# will point to the HTML generated by the htags(1) tool instead of doxygen 
+# built-in source browser. The htags tool is part of GNU's global source 
+# tagging system (see http://www.gnu.org/software/global/global.html). You 
+# will need version 4.8.6 or higher.
+USE_HTAGS              = NO
+# If the VERBATIM_HEADERS tag is set to YES (the default) then Doxygen 
+# will generate a verbatim copy of the header file for each class for 
+# which an include is specified. Set to NO to disable this.
+VERBATIM_HEADERS       = YES
+#---------------------------------------------------------------------------
+# configuration options related to the alphabetical class index
+#---------------------------------------------------------------------------
+# If the ALPHABETICAL_INDEX tag is set to YES, an alphabetical index 
+# of all compounds will be generated. Enable this if the project 
+# contains a lot of classes, structs, unions or interfaces.
+ALPHABETICAL_INDEX     = No
+# If the alphabetical index is enabled (see ALPHABETICAL_INDEX) then 
+# the COLS_IN_ALPHA_INDEX tag can be used to specify the number of columns 
+# in which this list will be split (can be a number in the range [1..20])
+COLS_IN_ALPHA_INDEX    = 5
+# In case all classes in a project start with a common prefix, all 
+# classes will be put under the same header in the alphabetical index. 
+# The IGNORE_PREFIX tag can be used to specify one or more prefixes that 
+# should be ignored while generating the index headers.
+IGNORE_PREFIX          = 
+#---------------------------------------------------------------------------
+# configuration options related to the HTML output
+#---------------------------------------------------------------------------
+# If the GENERATE_HTML tag is set to YES (the default) Doxygen will 
+# generate HTML output.
+GENERATE_HTML          = YES
+# The HTML_OUTPUT tag is used to specify where the HTML docs will be put. 
+# If a relative path is entered the value of OUTPUT_DIRECTORY will be 
+# put in front of it. If left blank `html' will be used as the default path.
+HTML_OUTPUT            = html
+# The HTML_FILE_EXTENSION tag can be used to specify the file extension for 
+# each generated HTML page (for example: .htm,.php,.asp). If it is left blank 
+# doxygen will generate files with .html extension.
+HTML_FILE_EXTENSION    = .html
+# The HTML_HEADER tag can be used to specify a personal HTML header for 
+# each generated HTML page. If it is left blank doxygen will generate a 
+# standard header.
+HTML_HEADER            = 
+# The HTML_FOOTER tag can be used to specify a personal HTML footer for 
+# each generated HTML page. If it is left blank doxygen will generate a 
+# standard footer.
+HTML_FOOTER            = 
+# The HTML_STYLESHEET tag can be used to specify a user-defined cascading 
+# style sheet that is used by each HTML page. It can be used to 
+# fine-tune the look of the HTML output. If the tag is left blank doxygen 
+# will generate a default style sheet. Note that doxygen will try to copy 
+# the style sheet file to the HTML output directory, so don't put your own 
+# stylesheet in the HTML output directory as well, or it will be erased!
+HTML_STYLESHEET        = 
+# If the HTML_ALIGN_MEMBERS tag is set to YES, the members of classes, 
+# files or namespaces will be aligned in HTML using tables. If set to 
+# NO a bullet list will be used.
+HTML_ALIGN_MEMBERS     = YES
+# If the GENERATE_HTMLHELP tag is set to YES, additional index files 
+# will be generated that can be used as input for tools like the 
+# Microsoft HTML help workshop to generate a compressed HTML help file (.chm) 
+# of the generated HTML documentation.
+GENERATE_HTMLHELP      = NO
+# If the GENERATE_HTMLHELP tag is set to YES, the CHM_FILE tag can 
+# be used to specify the file name of the resulting .chm file. You 
+# can add a path in front of the file if the result should not be 
+# written to the html output directory.
+CHM_FILE               = 
+# If the GENERATE_HTMLHELP tag is set to YES, the HHC_LOCATION tag can 
+# be used to specify the location (absolute path including file name) of 
+# the HTML help compiler (hhc.exe). If non-empty doxygen will try to run 
+# the HTML help compiler on the generated index.hhp.
+HHC_LOCATION           = 
+# If the GENERATE_HTMLHELP tag is set to YES, the GENERATE_CHI flag 
+# controls if a separate .chi index file is generated (YES) or that 
+# it should be included in the master .chm file (NO).
+GENERATE_CHI           = NO
+# If the GENERATE_HTMLHELP tag is set to YES, the BINARY_TOC flag 
+# controls whether a binary table of contents is generated (YES) or a 
+# normal table of contents (NO) in the .chm file.
+BINARY_TOC             = NO
+# The TOC_EXPAND flag can be set to YES to add extra items for group members 
+# to the contents of the HTML help documentation and to the tree view.
+TOC_EXPAND             = NO
+# The DISABLE_INDEX tag can be used to turn on/off the condensed index at 
+# top of each HTML page. The value NO (the default) enables the index and 
+# the value YES disables it.
+DISABLE_INDEX          = NO
+# This tag can be used to set the number of enum values (range [1..20]) 
+# that doxygen will group on one line in the generated HTML documentation.
+ENUM_VALUES_PER_LINE   = 1
+# If the GENERATE_TREEVIEW tag is set to YES, a side panel will be
+# generated containing a tree-like index structure (just like the one that 
+# is generated for HTML Help). For this to work a browser that supports 
+# JavaScript, DHTML, CSS and frames is required (for instance Mozilla 1.0+, 
+# Netscape 6.0+, Internet explorer 5.0+, or Konqueror). Windows users are 
+# probably better off using the HTML help feature.
+GENERATE_TREEVIEW      = YES
+# If the treeview is enabled (see GENERATE_TREEVIEW) then this tag can be 
+# used to set the initial width (in pixels) of the frame in which the tree 
+# is shown.
+TREEVIEW_WIDTH         = 250
+#---------------------------------------------------------------------------
+# configuration options related to the LaTeX output
+#---------------------------------------------------------------------------
+# If the GENERATE_LATEX tag is set to YES (the default) Doxygen will 
+# generate Latex output.
+GENERATE_LATEX         = YES
+# The LATEX_OUTPUT tag is used to specify where the LaTeX docs will be put. 
+# If a relative path is entered the value of OUTPUT_DIRECTORY will be 
+# put in front of it. If left blank `latex' will be used as the default path.
+LATEX_OUTPUT           = latex
+# The LATEX_CMD_NAME tag can be used to specify the LaTeX command name to be 
+# invoked. If left blank `latex' will be used as the default command name.
+LATEX_CMD_NAME         = latex
+# The MAKEINDEX_CMD_NAME tag can be used to specify the command name to 
+# generate index for LaTeX. If left blank `makeindex' will be used as the 
+# default command name.
+MAKEINDEX_CMD_NAME     = makeindex
+# If the COMPACT_LATEX tag is set to YES Doxygen generates more compact 
+# LaTeX documents. This may be useful for small projects and may help to 
+# save some trees in general.
+COMPACT_LATEX          = NO
+# The PAPER_TYPE tag can be used to set the paper type that is used 
+# by the printer. Possible values are: a4, a4wide, letter, legal and 
+# executive. If left blank a4wide will be used.
+PAPER_TYPE             = a4wide
+# The EXTRA_PACKAGES tag can be to specify one or more names of LaTeX 
+# packages that should be included in the LaTeX output.
+EXTRA_PACKAGES         = 
+# The LATEX_HEADER tag can be used to specify a personal LaTeX header for 
+# the generated latex document. The header should contain everything until 
+# the first chapter. If it is left blank doxygen will generate a 
+# standard header. Notice: only use this tag if you know what you are doing!
+LATEX_HEADER           = 
+# If the PDF_HYPERLINKS tag is set to YES, the LaTeX that is generated 
+# is prepared for conversion to pdf (using ps2pdf). The pdf file will 
+# contain links (just like the HTML output) instead of page references 
+# This makes the output suitable for online browsing using a pdf viewer.
+PDF_HYPERLINKS         = NO
+# If the USE_PDFLATEX tag is set to YES, pdflatex will be used instead of 
+# plain latex in the generated Makefile. Set this option to YES to get a 
+# higher quality PDF documentation.
+USE_PDFLATEX           = NO
+# If the LATEX_BATCHMODE tag is set to YES, doxygen will add the \\batchmode. 
+# command to the generated LaTeX files. This will instruct LaTeX to keep 
+# running if errors occur, instead of asking the user for help. 
+# This option is also used when generating formulas in HTML.
+LATEX_BATCHMODE        = NO
+# If LATEX_HIDE_INDICES is set to YES then doxygen will not 
+# include the index chapters (such as File Index, Compound Index, etc.) 
+# in the output.
+LATEX_HIDE_INDICES     = NO
+#---------------------------------------------------------------------------
+# configuration options related to the RTF output
+#---------------------------------------------------------------------------
+# If the GENERATE_RTF tag is set to YES Doxygen will generate RTF output 
+# The RTF output is optimized for Word 97 and may not look very pretty with 
+# other RTF readers or editors.
+GENERATE_RTF           = NO
+# The RTF_OUTPUT tag is used to specify where the RTF docs will be put. 
+# If a relative path is entered the value of OUTPUT_DIRECTORY will be 
+# put in front of it. If left blank `rtf' will be used as the default path.
+RTF_OUTPUT             = rtf
+# If the COMPACT_RTF tag is set to YES Doxygen generates more compact 
+# RTF documents. This may be useful for small projects and may help to 
+# save some trees in general.
+COMPACT_RTF            = NO
+# If the RTF_HYPERLINKS tag is set to YES, the RTF that is generated 
+# will contain hyperlink fields. The RTF file will 
+# contain links (just like the HTML output) instead of page references. 
+# This makes the output suitable for online browsing using WORD or other 
+# programs which support those fields. 
+# Note: wordpad (write) and others do not support links.
+RTF_HYPERLINKS         = NO
+# Load stylesheet definitions from file. Syntax is similar to doxygen's 
+# config file, i.e. a series of assignments. You only have to provide 
+# replacements, missing definitions are set to their default value.
+RTF_STYLESHEET_FILE    = 
+# Set optional variables used in the generation of an rtf document. 
+# Syntax is similar to doxygen's config file.
+RTF_EXTENSIONS_FILE    = 
+#---------------------------------------------------------------------------
+# configuration options related to the man page output
+#---------------------------------------------------------------------------
+# If the GENERATE_MAN tag is set to YES (the default) Doxygen will 
+# generate man pages
+GENERATE_MAN           = NO
+# The MAN_OUTPUT tag is used to specify where the man pages will be put. 
+# If a relative path is entered the value of OUTPUT_DIRECTORY will be 
+# put in front of it. If left blank `man' will be used as the default path.
+MAN_OUTPUT             = man
+# The MAN_EXTENSION tag determines the extension that is added to 
+# the generated man pages (default is the subroutine's section .3)
+MAN_EXTENSION          = .3
+# If the MAN_LINKS tag is set to YES and Doxygen generates man output, 
+# then it will generate one additional man file for each entity 
+# documented in the real man page(s). These additional files 
+# only source the real man page, but without them the man command 
+# would be unable to find the correct page. The default is NO.
+MAN_LINKS              = NO
+#---------------------------------------------------------------------------
+# configuration options related to the XML output
+#---------------------------------------------------------------------------
+# If the GENERATE_XML tag is set to YES Doxygen will 
+# generate an XML file that captures the structure of 
+# the code including all documentation.
+GENERATE_XML           = NO
+# The XML_OUTPUT tag is used to specify where the XML pages will be put. 
+# If a relative path is entered the value of OUTPUT_DIRECTORY will be 
+# put in front of it. If left blank `xml' will be used as the default path.
+XML_OUTPUT             = xml
+# The XML_SCHEMA tag can be used to specify an XML schema, 
+# which can be used by a validating XML parser to check the 
+# syntax of the XML files.
+XML_SCHEMA             = 
+# The XML_DTD tag can be used to specify an XML DTD, 
+# which can be used by a validating XML parser to check the 
+# syntax of the XML files.
+XML_DTD                = 
+# If the XML_PROGRAMLISTING tag is set to YES Doxygen will 
+# dump the program listings (including syntax highlighting 
+# and cross-referencing information) to the XML output. Note that 
+# enabling this will significantly increase the size of the XML output.
+XML_PROGRAMLISTING     = YES
+#---------------------------------------------------------------------------
+# configuration options for the AutoGen Definitions output
+#---------------------------------------------------------------------------
+# If the GENERATE_AUTOGEN_DEF tag is set to YES Doxygen will 
+# generate an AutoGen Definitions (see autogen.sf.net) file 
+# that captures the structure of the code including all 
+# documentation. Note that this feature is still experimental 
+# and incomplete at the moment.
+GENERATE_AUTOGEN_DEF   = NO
+#---------------------------------------------------------------------------
+# configuration options related to the Perl module output
+#---------------------------------------------------------------------------
+# If the GENERATE_PERLMOD tag is set to YES Doxygen will 
+# generate a Perl module file that captures the structure of 
+# the code including all documentation. Note that this 
+# feature is still experimental and incomplete at the 
+# moment.
+GENERATE_PERLMOD       = NO
+# If the PERLMOD_LATEX tag is set to YES Doxygen will generate 
+# the necessary Makefile rules, Perl scripts and LaTeX code to be able 
+# to generate PDF and DVI output from the Perl module output.
+PERLMOD_LATEX          = NO
+# If the PERLMOD_PRETTY tag is set to YES the Perl module output will be 
+# nicely formatted so it can be parsed by a human reader.  This is useful 
+# if you want to understand what is going on.  On the other hand, if this 
+# tag is set to NO the size of the Perl module output will be much smaller 
+# and Perl will parse it just the same.
+PERLMOD_PRETTY         = YES
+# The names of the make variables in the generated doxyrules.make file 
+# are prefixed with the string contained in PERLMOD_MAKEVAR_PREFIX. 
+# This is useful so different doxyrules.make files included by the same 
+# Makefile don't overwrite each other's variables.
+PERLMOD_MAKEVAR_PREFIX = 
+#---------------------------------------------------------------------------
+# Configuration options related to the preprocessor   
+#---------------------------------------------------------------------------
+# If the ENABLE_PREPROCESSING tag is set to YES (the default) Doxygen will 
+# evaluate all C-preprocessor directives found in the sources and include 
+# files.
+ENABLE_PREPROCESSING   = YES
+# If the MACRO_EXPANSION tag is set to YES Doxygen will expand all macro 
+# names in the source code. If set to NO (the default) only conditional 
+# compilation will be performed. Macro expansion can be done in a controlled 
+# way by setting EXPAND_ONLY_PREDEF to YES.
+MACRO_EXPANSION        = NO
+# If the EXPAND_ONLY_PREDEF and MACRO_EXPANSION tags are both set to YES 
+# then the macro expansion is limited to the macros specified with the 
+# PREDEFINED and EXPAND_AS_DEFINED tags.
+EXPAND_ONLY_PREDEF     = NO
+# If the SEARCH_INCLUDES tag is set to YES (the default) the includes files 
+# in the INCLUDE_PATH (see below) will be search if a #include is found.
+SEARCH_INCLUDES        = YES
+# The INCLUDE_PATH tag can be used to specify one or more directories that 
+# contain include files that are not input files but should be processed by 
+# the preprocessor.
+INCLUDE_PATH           = 
+# You can use the INCLUDE_FILE_PATTERNS tag to specify one or more wildcard 
+# patterns (like *.h and *.hpp) to filter out the header-files in the 
+# directories. If left blank, the patterns specified with FILE_PATTERNS will 
+# be used.
+INCLUDE_FILE_PATTERNS  = 
+# The PREDEFINED tag can be used to specify one or more macro names that 
+# are defined before the preprocessor is started (similar to the -D option of 
+# gcc). The argument of the tag is a list of macros of the form: name 
+# or name=definition (no spaces). If the definition and the = are 
+# omitted =1 is assumed. To prevent a macro definition from being 
+# undefined via #undef or recursively expanded use the := operator 
+# instead of the = operator.
+PREDEFINED             = 
+# If the MACRO_EXPANSION and EXPAND_ONLY_PREDEF tags are set to YES then 
+# this tag can be used to specify a list of macro names that should be expanded. 
+# The macro definition that is found in the sources will be used. 
+# Use the PREDEFINED tag if you want to use a different macro definition.
+EXPAND_AS_DEFINED      = 
+# If the SKIP_FUNCTION_MACROS tag is set to YES (the default) then 
+# doxygen's preprocessor will remove all function-like macros that are alone 
+# on a line, have an all uppercase name, and do not end with a semicolon. Such 
+# function macros are typically used for boiler-plate code, and will confuse 
+# the parser if not removed.
+SKIP_FUNCTION_MACROS   = YES
+#---------------------------------------------------------------------------
+# Configuration::additions related to external references   
+#---------------------------------------------------------------------------
+# The TAGFILES option can be used to specify one or more tagfiles. 
+# Optionally an initial location of the external documentation 
+# can be added for each tagfile. The format of a tag file without 
+# this location is as follows: 
+#   TAGFILES = file1 file2 ... 
+# Adding location for the tag files is done as follows: 
+#   TAGFILES = file1=loc1 "file2 = loc2" ... 
+# where "loc1" and "loc2" can be relative or absolute paths or 
+# URLs. If a location is present for each tag, the installdox tool 
+# does not have to be run to correct the links.
+# Note that each tag file must have a unique name
+# (where the name does NOT include the path)
+# If a tag file is not located in the directory in which doxygen 
+# is run, you must also specify the path to the tagfile here.
+TAGFILES               = 
+# When a file name is specified after GENERATE_TAGFILE, doxygen will create 
+# a tag file that is based on the input files it reads.
+GENERATE_TAGFILE       = 
+# If the ALLEXTERNALS tag is set to YES all external classes will be listed 
+# in the class index. If set to NO only the inherited external classes 
+# will be listed.
+ALLEXTERNALS           = NO
+# If the EXTERNAL_GROUPS tag is set to YES all external groups will be listed 
+# in the modules index. If set to NO, only the current project's groups will 
+# be listed.
+EXTERNAL_GROUPS        = YES
+# The PERL_PATH should be the absolute path and name of the perl script 
+# interpreter (i.e. the result of `which perl').
+PERL_PATH              = /usr/bin/perl
+#---------------------------------------------------------------------------
+# Configuration options related to the dot tool   
+#---------------------------------------------------------------------------
+# If the CLASS_DIAGRAMS tag is set to YES (the default) Doxygen will 
+# generate a inheritance diagram (in HTML, RTF and LaTeX) for classes with base 
+# or super classes. Setting the tag to NO turns the diagrams off. Note that 
+# this option is superseded by the HAVE_DOT option below. This is only a 
+# fallback. It is recommended to install and use dot, since it yields more 
+# powerful graphs.
+CLASS_DIAGRAMS         = YES
+# If set to YES, the inheritance and collaboration graphs will hide 
+# inheritance and usage relations if the target is undocumented 
+# or is not a class.
+HIDE_UNDOC_RELATIONS   = YES
+# If you set the HAVE_DOT tag to YES then doxygen will assume the dot tool is 
+# available from the path. This tool is part of Graphviz, a graph visualization 
+# toolkit from AT&T and Lucent Bell Labs. The other options in this section 
+# have no effect if this option is set to NO (the default)
+HAVE_DOT               = NO
+# If the CLASS_GRAPH and HAVE_DOT tags are set to YES then doxygen 
+# will generate a graph for each documented class showing the direct and 
+# indirect inheritance relations. Setting this tag to YES will force the 
+# the CLASS_DIAGRAMS tag to NO.
+CLASS_GRAPH            = YES
+# If the COLLABORATION_GRAPH and HAVE_DOT tags are set to YES then doxygen 
+# will generate a graph for each documented class showing the direct and 
+# indirect implementation dependencies (inheritance, containment, and 
+# class references variables) of the class with other documented classes.
+COLLABORATION_GRAPH    = YES
+# If the GROUP_GRAPHS and HAVE_DOT tags are set to YES then doxygen 
+# will generate a graph for groups, showing the direct groups dependencies
+GROUP_GRAPHS           = YES
+# If the UML_LOOK tag is set to YES doxygen will generate inheritance and 
+# collaboration diagrams in a style similar to the OMG's Unified Modeling 
+# Language.
+UML_LOOK               = NO
+# If set to YES, the inheritance and collaboration graphs will show the 
+# relations between templates and their instances.
+TEMPLATE_RELATIONS     = NO
+# If the ENABLE_PREPROCESSING, SEARCH_INCLUDES, INCLUDE_GRAPH, and HAVE_DOT 
+# tags are set to YES then doxygen will generate a graph for each documented 
+# file showing the direct and indirect include dependencies of the file with 
+# other documented files.
+INCLUDE_GRAPH          = YES
+# If the ENABLE_PREPROCESSING, SEARCH_INCLUDES, INCLUDED_BY_GRAPH, and 
+# HAVE_DOT tags are set to YES then doxygen will generate a graph for each 
+# documented header file showing the documented files that directly or 
+# indirectly include this file.
+INCLUDED_BY_GRAPH      = YES
+# If the CALL_GRAPH and HAVE_DOT tags are set to YES then doxygen will 
+# generate a call dependency graph for every global function or class method. 
+# Note that enabling this option will significantly increase the time of a run. 
+# So in most cases it will be better to enable call graphs for selected 
+# functions only using the \callgraph command.
+CALL_GRAPH             = NO
+# If the GRAPHICAL_HIERARCHY and HAVE_DOT tags are set to YES then doxygen 
+# will graphical hierarchy of all classes instead of a textual one.
+GRAPHICAL_HIERARCHY    = YES
+# If the DIRECTORY_GRAPH, SHOW_DIRECTORIES and HAVE_DOT tags are set to YES 
+# then doxygen will show the dependencies a directory has on other directories 
+# in a graphical way. The dependency relations are determined by the #include
+# relations between the files in the directories.
+DIRECTORY_GRAPH        = YES
+# The DOT_IMAGE_FORMAT tag can be used to set the image format of the images 
+# generated by dot. Possible values are png, jpg, or gif
+# If left blank png will be used.
+DOT_IMAGE_FORMAT       = png
+# The tag DOT_PATH can be used to specify the path where the dot tool can be 
+# found. If left blank, it is assumed the dot tool can be found in the path.
+DOT_PATH               = 
+# The DOTFILE_DIRS tag can be used to specify one or more directories that 
+# contain dot files that are included in the documentation (see the 
+# \dotfile command).
+DOTFILE_DIRS           = 
+# The MAX_DOT_GRAPH_WIDTH tag can be used to set the maximum allowed width 
+# (in pixels) of the graphs generated by dot. If a graph becomes larger than 
+# this value, doxygen will try to truncate the graph, so that it fits within 
+# the specified constraint. Beware that most browsers cannot cope with very 
+# large images.
+MAX_DOT_GRAPH_WIDTH    = 1024
+# The MAX_DOT_GRAPH_HEIGHT tag can be used to set the maximum allows height 
+# (in pixels) of the graphs generated by dot. If a graph becomes larger than 
+# this value, doxygen will try to truncate the graph, so that it fits within 
+# the specified constraint. Beware that most browsers cannot cope with very 
+# large images.
+MAX_DOT_GRAPH_HEIGHT   = 1024
+# The MAX_DOT_GRAPH_DEPTH tag can be used to set the maximum depth of the 
+# graphs generated by dot. A depth value of 3 means that only nodes reachable 
+# from the root by following a path via at most 3 edges will be shown. Nodes 
+# that lay further from the root node will be omitted. Note that setting this 
+# option to 1 or 2 may greatly reduce the computation time needed for large 
+# code bases. Also note that a graph may be further truncated if the graph's 
+# image dimensions are not sufficient to fit the graph (see MAX_DOT_GRAPH_WIDTH 
+# and MAX_DOT_GRAPH_HEIGHT). If 0 is used for the depth value (the default), 
+# the graph is not depth-constrained.
+MAX_DOT_GRAPH_DEPTH    = 0
+# Set the DOT_TRANSPARENT tag to YES to generate images with a transparent 
+# background. This is disabled by default, which results in a white background. 
+# Warning: Depending on the platform used, enabling this option may lead to 
+# badly anti-aliased labels on the edges of a graph (i.e. they become hard to 
+# read).
+DOT_TRANSPARENT        = NO
+# Set the DOT_MULTI_TARGETS tag to YES allow dot to generate multiple output 
+# files in one run (i.e. multiple -o and -T options on the command line). This 
+# makes dot run faster, but since only newer versions of dot (>1.8.10) 
+# support this, this feature is disabled by default.
+DOT_MULTI_TARGETS      = NO
+# If the GENERATE_LEGEND tag is set to YES (the default) Doxygen will 
+# generate a legend page explaining the meaning of the various boxes and 
+# arrows in the dot generated graphs.
+GENERATE_LEGEND        = YES
+# If the DOT_CLEANUP tag is set to YES (the default) Doxygen will 
+# remove the intermediate dot files that are used to generate 
+# the various graphs.
+DOT_CLEANUP            = YES
+#---------------------------------------------------------------------------
+# Configuration::additions related to the search engine   
+#---------------------------------------------------------------------------
+# The SEARCHENGINE tag specifies whether or not a search engine should be 
+# used. If set to NO the values of all tags below this one will be ignored.
+SEARCHENGINE           = NO
\ No newline at end of file
diff --git a/dbus/Makefile b/dbus/Makefile
new file mode 100644 (file)
index 0000000..f502c05
--- /dev/null
@@ -0,0 +1,20 @@
+CC=gcc
+LIBS=`pkg-config --libs glib-2.0 libosso`
+CFLAGS=`pkg-config --cflags glib-2.0 libosso`
+DEBUG = -g -Wall
+BINARY = bin
+INCLUDE = ../include
+SOURCE = src
+DOCS = doc
+
+all:           ${BINARY}/ws_dbus.o 
+                       @cp ${BINARY}/* ../bin
+
+docs:          
+               doxygen Doxyfile
+
+${BINARY}/ws_dbus.o:
+                       @${CC} ${DEBUG} -c ${SOURCE}/ws_dbus.c -o ${BINARY}/ws_dbus.o ${CFLAGS} -I${INCLUDE}
+clean:
+                       -rm -rf ${BINARY}/*
+                       -rm -rf ${DOCS}/*
diff --git a/dbus/src/ws_dbus.c b/dbus/src/ws_dbus.c
new file mode 100644 (file)
index 0000000..280c93b
--- /dev/null
@@ -0,0 +1,615 @@
+/*
+This library is free software; you can redistribute it and/or
+modify it under the terms of the GNU Lesser General Public
+License as published by the Free Software Foundation;
+version 2.1 of the License.
+
+This library is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+Lesser General Public License for more details.
+
+You should have received a copy of the GNU Lesser General Public
+License along with this library; if not, write to the Free Software
+Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+
+Copyright 2006 ComArch S.A.
+*/
+
+#include "../include/ws_dbus.h"
+
+struct _WSDBusCBData
+{
+       GQuark id;
+       gpointer handler;
+       gpointer user_data;
+};
+
+typedef struct _WSDBusCBData WSDBusCBData;
+
+static void ws_dbus_fill_message (DBusMessage *msg, void *data) 
+{
+
+       guint i;
+       gchar *buffer;
+       GArray *temp;
+
+       temp = (GArray *) data;
+
+//     printf ("DBUS: Data to send: %p, length: %d\n", temp, temp->len);
+
+       for (i=0;((i<temp->len) && (i<250));++i)
+       {
+               buffer = g_array_index (temp, gchar *, i);
+//             printf ("DBUS: Added string nr %d: %s\n", i, buffer);
+               dbus_message_append_args (msg, 
+                               DBUS_TYPE_STRING, &buffer,
+                               DBUS_TYPE_INVALID);
+       };
+
+//     buffer = strdup (">>>FIND MORE<<<");
+
+//     if (i == 250) dbus_message_append_args (msg,
+//                             DBUS_TYPE_STRING, &buffer,
+//                             DBUS_TYPE_INVALID);
+
+       printf ("DBUS: Added %d words\n", i);
+
+};
+
+static gint ws_dbus_cb_handler (const gchar * interface, const gchar * method, GArray * arguments, gpointer data, osso_rpc_t * retval)
+
+{
+       WSDBusCBData cb_data;
+       GArray *dbus_cb_data;
+       GQuark temp;
+       guint i;
+       ws_dbus_cb cb;
+       dbus_cb_data = (GArray *) data;
+       gpointer tmp;
+       retval = NULL;
+
+//     printf ("DBUS: Interface:  %s\n", interface);
+       printf ("DBUS: Method:  %s\n", method);
+
+       temp = g_quark_try_string (method);
+
+       if (temp != 0) 
+
+       {
+
+               cb_data = g_array_index (dbus_cb_data, WSDBusCBData, temp-1);
+       
+               if (cb_data.id == temp) 
+               {
+                       cb = (ws_dbus_cb) cb_data.handler;
+                       tmp = cb_data.user_data;
+               }
+
+               else 
+
+               {
+//             printf ("The signal's name GQuark doesn't match the callback id, switching to iterational callback lookup\n");
+
+                       for (i=0; i < dbus_cb_data->len; ++i) 
+       
+                       {
+                               cb_data = g_array_index (dbus_cb_data, WSDBusCBData, i);
+                               if (cb_data.id == temp) 
+                               {
+                                       cb = (ws_dbus_cb) cb_data.handler;
+                                       tmp = cb_data.user_data;
+                               };
+                       };
+               };
+       }
+       
+       else 
+
+       {
+               printf ("Error in function %s, couldn't find the signal %s\n", __FUNCTION__, method);
+               return OSSO_ERROR;
+       };
+
+       if (cb != NULL) 
+       {
+               printf ("\nDBUS: Running callback for %s\n", method);
+               cb (NULL, arguments, tmp); 
+               retval = DBUS_TYPE_INVALID;
+               return OSSO_OK;
+       }
+       else
+       {
+               printf ("DBUS: No callback defined for this function\n");
+               return OSSO_ERROR;
+       };
+
+};
+
+
+static void ws_dbus_libosso_errors (osso_return_t result)
+{
+       switch (result) 
+       {
+               case OSSO_OK: 
+                       printf ("All OK\n");
+                       break;
+                       
+               case OSSO_ERROR: 
+                       printf ("Ordinary Error\n");
+                       break;
+
+               case OSSO_INVALID: 
+                       printf ("At least one parameter is invalid\n");
+                       break;
+
+               case OSSO_RPC_ERROR: 
+                       printf ("Osso RPC method returned an error\n");
+                       break;
+
+               case OSSO_ERROR_NAME: 
+                       printf ("Error Name\n");
+                       break;
+
+               case OSSO_ERROR_NO_STATE: 
+                       printf ("No state file found to read\n");
+                       break;
+
+               case OSSO_ERROR_STATE_SIZE: 
+                       printf ("The size of the given structure is different from the saved size\n");
+                       break;
+
+       };
+};
+
+WSDBusData * ws_dbus_create (gchar *name, gchar *version)
+
+{
+       gchar *cb_table[] = {"find_word", "find_translation", "return_words", "return_translations", "signal"};
+       guint i;
+
+       WSDBusData *temp;
+       WSDBusCBData temp_cb_data;
+       GQuark temp_quark;
+
+       temp = (gpointer) g_try_malloc (sizeof (WSDBusData));
+
+       printf ("\nDBUS: ");
+
+       if (temp == NULL)
+       {
+               printf ("Error in function %s - cannot allocate memory\n", __FUNCTION__);
+               g_assert_not_reached();
+       }
+
+       else printf ("Memory allocation successful\n");
+
+       temp->name = g_strconcat (name, NULL);
+       temp->version = g_strconcat (version, NULL);
+
+       temp->cb_data = g_array_new (TRUE, TRUE, sizeof (WSDBusCBData));
+       
+       for (i = 0; i < 5; i++)
+       {
+               temp_quark = g_quark_try_string (cb_table[i]);
+
+               if (temp_quark != 0)
+               {
+                       printf ("DBUS: \"%s\" - signal has already been registered - %d\n", cb_table[i], g_quark_from_string(cb_table[i]));                     
+               }
+
+               else
+               {
+                       temp_quark = g_quark_from_string (cb_table[i]);
+                       printf ("DBUS: Assigning signal \"%s\" an id %d\n", cb_table [i], temp_quark);
+                       temp_cb_data.id = temp_quark;
+                       temp_cb_data.handler = NULL;
+                       temp_cb_data.user_data = NULL;
+                       g_array_append_val (temp->cb_data, temp_cb_data);
+               };
+
+       };
+
+       printf ("DBUS: Signals were successfully added\n");
+
+       return temp;
+};
+
+WSDBusStatus ws_dbus_config (WSDBusData * ws_dbus_data, WSDBusConfig field, gchar *value)
+
+{
+       if (ws_dbus_data == NULL) 
+       {
+               printf ("\nDBUS: Error in function %s - ws_dbus_data is NULL\n", __FUNCTION__);
+       };
+
+       switch (field) 
+       {
+               case WS_DBUS_CONFIG_SERVICE :
+                       ws_dbus_data->service = g_strconcat (value, NULL);
+                       break;
+               case WS_DBUS_CONFIG_OBJECT :
+                       ws_dbus_data->object = g_strconcat (value, NULL);
+                       break;
+               case WS_DBUS_CONFIG_IFACE :
+                       ws_dbus_data->iface = g_strconcat (value, NULL);
+                       break;
+               case WS_DBUS_CONFIG_REMOTE_SERVICE :
+                       ws_dbus_data->remote_service = g_strconcat (value, NULL);
+                       break;
+               case WS_DBUS_CONFIG_REMOTE_OBJECT :
+                       ws_dbus_data->remote_object = g_strconcat (value, NULL);
+                       break;
+               case WS_DBUS_CONFIG_REMOTE_IFACE :
+                       ws_dbus_data->remote_iface = g_strconcat (value, NULL);
+                       break;
+       };
+       
+       return WS_DBUS_STATUS_OK;
+};
+
+WSDBusStatus ws_dbus_connect (WSDBusData * ws_dbus_data)
+
+{
+       osso_return_t result;
+
+       ws_dbus_data->context = osso_initialize (ws_dbus_data->name, ws_dbus_data->version, FALSE, NULL);
+       osso_rpc_set_timeout (ws_dbus_data->context, 100);
+
+       result = osso_rpc_set_cb_f(ws_dbus_data->context, 
+                               ws_dbus_data->service, 
+                               ws_dbus_data->object, 
+                               ws_dbus_data->iface,
+                               ws_dbus_cb_handler, 
+                               ws_dbus_data->cb_data); 
+
+       if (result == OSSO_OK) return WS_DBUS_STATUS_OK;
+       else return WS_DBUS_STATUS_ERROR;
+};
+
+void ws_dbus_destroy (WSDBusData * ws_dbus_data)
+
+{
+       if (ws_dbus_data == NULL) 
+       {
+               printf ("\nDBUS: Error in function %s - cannot free osso_context\n", __FUNCTION__);
+               g_free (ws_dbus_data);
+               g_assert_not_reached();
+       };
+       
+       printf ("\nDBUS deinitialization by %s:\n----------------------------------\n", ws_dbus_data->service);
+       osso_deinitialize (ws_dbus_data->context);
+       printf ("| Deinitializing osso context    |\n");
+       if (ws_dbus_data->cb_data != NULL) 
+               {
+               g_array_free (ws_dbus_data->cb_data, TRUE);
+               printf ("| Freeing callback pointers list |\n");
+               };
+
+       g_free (ws_dbus_data);
+       printf ("| Freeing WSDBusData structure   |\n----------------------------------\n");
+};
+
+
+WSDBusStatus ws_dbus_set_cb (WSDBusData * ws_dbus_data, gchar * detailed_signal, gpointer c_func, gpointer user_data)
+
+{
+       WSDBusCBData cb_data;
+       GQuark temp;
+       guint i;
+
+       temp = g_quark_try_string  (detailed_signal);
+
+       if (temp == 0) 
+       {
+               printf ("DBUS: \"%s\" - signal not defined or invalid signal name\n", detailed_signal);
+               return WS_DBUS_STATUS_ERROR;
+       }
+
+       else
+       {
+               for (i = 0; i < ws_dbus_data->cb_data->len; ++i)
+
+               {
+
+                       cb_data = g_array_index (ws_dbus_data->cb_data, WSDBusCBData, i);
+                       if (cb_data.id == temp)
+       
+                       {
+                               cb_data.handler = c_func;
+                               cb_data.user_data = user_data;
+                               g_array_insert_val (ws_dbus_data->cb_data, i, cb_data);
+                               g_array_remove_index (ws_dbus_data->cb_data, i+1);
+                       };
+
+               };
+       
+       };
+
+       return WS_DBUS_STATUS_OK;
+};
+
+WSDBusStatus ws_dbus_notify (WSDBusData * ws_dbus_data, WSDBusNotify ws_dbus_info)
+
+{
+       osso_return_t result;
+       osso_rpc_t *retval;
+
+       retval = g_try_malloc (sizeof (osso_rpc_t));
+
+       if (retval == NULL) 
+       {
+               printf ("DBUS: Error in function %s: Couldn't allocate memory for message's return value\n", __FUNCTION__);
+       };
+
+       result = osso_rpc_run (ws_dbus_data->context, 
+                               ws_dbus_data->remote_service, 
+                               ws_dbus_data->remote_object, 
+                               ws_dbus_data->remote_iface, 
+                               "signal", 
+                               retval,
+                               DBUS_TYPE_INT32,
+                               ws_dbus_info,
+                               DBUS_TYPE_INVALID);
+
+       
+       printf ("\nDBUS: %s: ", __FUNCTION__);
+       ws_dbus_libosso_errors (result);
+
+       if (result != OSSO_OK)
+       {
+               printf ("Error message: %s\n", retval->value.s);
+               if (strcmp (retval->value.s, "No reply within specified time") != 0) 
+               {
+                       osso_rpc_free_val (retval);
+                       g_free (retval);
+                       return WS_DBUS_STATUS_ERROR;
+               };
+       };
+
+       osso_rpc_free_val (retval);
+       g_free (retval);
+       return WS_DBUS_STATUS_OK;
+};
+
+WSDBusStatus ws_dbus_client_find_word (WSDBusData * ws_dbus_data, gchar * word)
+
+{
+       osso_return_t result;
+       osso_rpc_t *retval;
+
+       retval = g_try_malloc (sizeof (osso_rpc_t));
+
+       if (retval == NULL) 
+       {
+               printf ("DBUS: Error in function %s: Couldn't allocate memory for message's return value\n", __FUNCTION__);
+       };
+
+       result = osso_rpc_run (ws_dbus_data->context, 
+                               ws_dbus_data->remote_service, 
+                               ws_dbus_data->remote_object, 
+                               ws_dbus_data->remote_iface, 
+                               "find_word", 
+//                             NULL,
+                               retval,
+                               DBUS_TYPE_STRING,
+                               word,
+                               DBUS_TYPE_INVALID);
+
+       printf ("\nDBUS: %s: ", __FUNCTION__);
+
+       ws_dbus_libosso_errors (result);
+
+       if (result != OSSO_OK)
+       {
+               printf ("Error message: %s\n", retval->value.s);
+               osso_rpc_free_val (retval);
+               g_free (retval);
+               return WS_DBUS_STATUS_ERROR;
+       };
+
+       osso_rpc_free_val (retval);
+       g_free (retval);
+       return WS_DBUS_STATUS_OK;
+};
+
+WSDBusStatus ws_dbus_client_find_translation (WSDBusData * ws_dbus_data, gchar * word)
+
+{
+       osso_return_t result;
+       osso_rpc_t *retval;
+
+       retval = g_try_malloc (sizeof (osso_rpc_t));
+
+       if (retval == NULL) 
+       {
+               printf ("DBUS: Error in function %s: Couldn't allocate memory for message's return value\n",  __FUNCTION__);
+       };
+
+       result = osso_rpc_run (ws_dbus_data->context, 
+                               ws_dbus_data->remote_service, 
+                               ws_dbus_data->remote_object, 
+                               ws_dbus_data->remote_iface, 
+                               "find_translation", 
+//                             NULL,
+                               retval,
+                               DBUS_TYPE_STRING,
+                               word,
+                               DBUS_TYPE_INVALID);
+
+       printf ("\nDBUS: %s: ", __FUNCTION__);
+
+       ws_dbus_libosso_errors (result);
+
+       if (result != OSSO_OK)
+       {
+               printf ("Error message: %s\n", retval->value.s);
+               osso_rpc_free_val (retval);
+               g_free (retval);
+               return WS_DBUS_STATUS_ERROR;
+       };
+
+       osso_rpc_free_val (retval);
+       g_free (retval);
+       return WS_DBUS_STATUS_OK;
+};
+
+WSDBusStatus ws_dbus_server_return_words  (WSDBusData * ws_dbus_data, GArray * words)
+
+{
+       osso_return_t result;
+       osso_rpc_t *retval;
+
+       retval = g_try_malloc (sizeof (osso_rpc_t));
+
+       if (retval == NULL) 
+       {
+               printf ("DBUS: Error in function %s: Couldn't allocate memory for message's return value\n", __FUNCTION__);
+       };
+
+       result = osso_rpc_run_with_argfill (ws_dbus_data->context, 
+                               ws_dbus_data->remote_service, 
+                               ws_dbus_data->remote_object, 
+                               ws_dbus_data->remote_iface, 
+                               "return_words",
+//                             NULL,
+                               retval,
+                               ws_dbus_fill_message,
+                               words);
+
+       printf ("\nDBUS: %s: ", __FUNCTION__);
+
+       ws_dbus_libosso_errors (result);
+
+       if (result != OSSO_OK)
+       {
+               printf ("Error message: %s\n", retval->value.s);
+               osso_rpc_free_val (retval);
+               g_free (retval);
+               return WS_DBUS_STATUS_ERROR;
+       };
+
+       osso_rpc_free_val (retval);
+       g_free (retval);
+       return WS_DBUS_STATUS_OK;
+};
+
+WSDBusStatus ws_dbus_server_return_words_last  (WSDBusData * ws_dbus_data, GArray * words)
+
+{
+       osso_return_t result;
+       osso_rpc_t *retval;
+
+       retval = g_try_malloc (sizeof (osso_rpc_t));
+
+       if (retval == NULL) 
+       {
+               printf ("DBUS: Error in function %s: Couldn't allocate memory for message's return value\n",  __FUNCTION__);
+       };
+
+       result = osso_rpc_run_with_argfill (ws_dbus_data->context, 
+                               ws_dbus_data->remote_service, 
+                               ws_dbus_data->remote_object, 
+                               ws_dbus_data->remote_iface, 
+                               "return_words", 
+                               retval,
+                               ws_dbus_fill_message,
+                               words);
+       
+       printf ("\nDBUS: %s: ", __FUNCTION__);
+
+       ws_dbus_libosso_errors (result);
+
+       if (result != OSSO_OK)
+       {
+               printf ("Error message: %s\n", retval->value.s);
+               osso_rpc_free_val (retval);
+               g_free (retval);
+               return WS_DBUS_STATUS_ERROR;
+       };
+
+       osso_rpc_free_val (retval);
+       g_free (retval);
+       return WS_DBUS_STATUS_OK;
+};
+
+WSDBusStatus ws_dbus_server_return_translations (WSDBusData * ws_dbus_data, gchar * translation)
+
+{
+       osso_return_t result;
+       osso_rpc_t *retval;
+
+       retval = g_try_malloc (sizeof (osso_rpc_t));
+
+       if (retval == NULL) 
+       {
+               printf ("DBUS: Error in function %s: Couldn't allocate memory for message's return value\n",  __FUNCTION__);
+       };
+
+       result = osso_rpc_run (ws_dbus_data->context, 
+                               ws_dbus_data->remote_service, 
+                               ws_dbus_data->remote_object, 
+                               ws_dbus_data->remote_iface, 
+                               "return_translations", 
+//                             NULL,
+                               retval,
+                               DBUS_TYPE_STRING,
+                               translation,
+                               DBUS_TYPE_INVALID);
+
+       printf ("\nDBUS: %s: ", __FUNCTION__);
+
+       ws_dbus_libosso_errors (result);
+
+       if (result != OSSO_OK)
+       {
+               printf ("Error message: %s\n", retval->value.s);
+               osso_rpc_free_val (retval);
+               g_free (retval);
+               return WS_DBUS_STATUS_ERROR;
+       };
+
+       osso_rpc_free_val (retval);
+       g_free (retval);
+       return WS_DBUS_STATUS_OK;
+};
+
+WSDBusStatus ws_dbus_server_return_translations_last (WSDBusData * ws_dbus_data, gchar * translation)
+
+{
+       osso_return_t result;
+       osso_rpc_t *retval;
+
+       retval = g_try_malloc (sizeof (osso_rpc_t));
+
+       if (retval == NULL) 
+       {
+               printf ("DBUS: Error in function %s: Couldn't allocate memory for message's return value\n",  __FUNCTION__);
+       };
+
+       result = osso_rpc_run (ws_dbus_data->context, 
+                               ws_dbus_data->remote_service, 
+                               ws_dbus_data->remote_object, 
+                               ws_dbus_data->remote_iface, 
+                               "return_translations", 
+                               retval,
+                               DBUS_TYPE_STRING,
+                               translation,
+                               DBUS_TYPE_INVALID);
+       
+       printf ("\nDBUS: %s: ", __FUNCTION__);
+
+       ws_dbus_libosso_errors (result);
+
+       if (result != OSSO_OK)
+       {
+               printf ("Error message: %s\n", retval->value.s);
+               osso_rpc_free_val (retval);
+               g_free (retval);
+               return WS_DBUS_STATUS_ERROR;
+       };
+
+       osso_rpc_free_val (retval);
+       g_free (retval);
+       return WS_DBUS_STATUS_OK;
+};
diff --git a/engine/COPYING b/engine/COPYING
new file mode 100644 (file)
index 0000000..fb6319b
--- /dev/null
@@ -0,0 +1,339 @@
+    GNU GENERAL PUBLIC LICENSE
+                      Version 2, June 1991
+
+ Copyright (C) 1989, 1991 Free Software Foundation, Inc.,
+ 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ Everyone is permitted to copy and distribute verbatim copies
+ of this license document, but changing it is not allowed.
+
+                           Preamble
+
+  The licenses for most software are designed to take away your
+freedom to share and change it.  By contrast, the GNU General Public
+License is intended to guarantee your freedom to share and change free
+software--to make sure the software is free for all its users.  This
+General Public License applies to most of the Free Software
+Foundation's software and to any other program whose authors commit to
+using it.  (Some other Free Software Foundation software is covered by
+the GNU Lesser General Public License instead.)  You can apply it to
+your programs, too.
+
+  When we speak of free software, we are referring to freedom, not
+price.  Our General Public Licenses are designed to make sure that you
+have the freedom to distribute copies of free software (and charge for
+this service if you wish), that you receive source code or can get it
+if you want it, that you can change the software or use pieces of it
+in new free programs; and that you know you can do these things.
+
+  To protect your rights, we need to make restrictions that forbid
+anyone to deny you these rights or to ask you to surrender the rights.
+These restrictions translate to certain responsibilities for you if you
+distribute copies of the software, or if you modify it.
+
+  For example, if you distribute copies of such a program, whether
+gratis or for a fee, you must give the recipients all the rights that
+you have.  You must make sure that they, too, receive or can get the
+source code.  And you must show them these terms so they know their
+rights.
+
+  We protect your rights with two steps: (1) copyright the software, and
+(2) offer you this license which gives you legal permission to copy,
+distribute and/or modify the software.
+
+  Also, for each author's protection and ours, we want to make certain
+that everyone understands that there is no warranty for this free
+software.  If the software is modified by someone else and passed on, we
+want its recipients to know that what they have is not the original, so
+that any problems introduced by others will not reflect on the original
+authors' reputations.
+
+  Finally, any free program is threatened constantly by software
+patents.  We wish to avoid the danger that redistributors of a free
+program will individually obtain patent licenses, in effect making the
+program proprietary.  To prevent this, we have made it clear that any
+patent must be licensed for everyone's free use or not licensed at all.
+
+  The precise terms and conditions for copying, distribution and
+modification follow.
+
+                   GNU GENERAL PUBLIC LICENSE
+   TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
+
+  0. This License applies to any program or other work which contains
+a notice placed by the copyright holder saying it may be distributed
+under the terms of this General Public License.  The "Program", below,
+refers to any such program or work, and a "work based on the Program"
+means either the Program or any derivative work under copyright law:
+that is to say, a work containing the Program or a portion of it,
+either verbatim or with modifications and/or translated into another
+language.  (Hereinafter, translation is included without limitation in
+the term "modification".)  Each licensee is addressed as "you".
+
+Activities other than copying, distribution and modification are not
+covered by this License; they are outside its scope.  The act of
+running the Program is not restricted, and the output from the Program
+is covered only if its contents constitute a work based on the
+Program (independent of having been made by running the Program).
+Whether that is true depends on what the Program does.
+
+  1. You may copy and distribute verbatim copies of the Program's
+source code as you receive it, in any medium, provided that you
+conspicuously and appropriately publish on each copy an appropriate
+copyright notice and disclaimer of warranty; keep intact all the
+notices that refer to this License and to the absence of any warranty;
+and give any other recipients of the Program a copy of this License
+along with the Program.
+
+You may charge a fee for the physical act of transferring a copy, and
+you may at your option offer warranty protection in exchange for a fee.
+
+  2. You may modify your copy or copies of the Program or any portion
+of it, thus forming a work based on the Program, and copy and
+distribute such modifications or work under the terms of Section 1
+above, provided that you also meet all of these conditions:
+
+    a) You must cause the modified files to carry prominent notices
+    stating that you changed the files and the date of any change.
+
+    b) You must cause any work that you distribute or publish, that in
+    whole or in part contains or is derived from the Program or any
+    part thereof, to be licensed as a whole at no charge to all third
+    parties under the terms of this License.
+
+    c) If the modified program normally reads commands interactively
+    when run, you must cause it, when started running for such
+    interactive use in the most ordinary way, to print or display an
+    announcement including an appropriate copyright notice and a
+    notice that there is no warranty (or else, saying that you provide
+    a warranty) and that users may redistribute the program under
+    these conditions, and telling the user how to view a copy of this
+    License.  (Exception: if the Program itself is interactive but
+    does not normally print such an announcement, your work based on
+    the Program is not required to print an announcement.)
+
+These requirements apply to the modified work as a whole.  If
+identifiable sections of that work are not derived from the Program,
+and can be reasonably considered independent and separate works in
+themselves, then this License, and its terms, do not apply to those
+sections when you distribute them as separate works.  But when you
+distribute the same sections as part of a whole which is a work based
+on the Program, the distribution of the whole must be on the terms of
+this License, whose permissions for other licensees extend to the
+entire whole, and thus to each and every part regardless of who wrote it.
+
+Thus, it is not the intent of this section to claim rights or contest
+your rights to work written entirely by you; rather, the intent is to
+exercise the right to control the distribution of derivative or
+collective works based on the Program.
+
+In addition, mere aggregation of another work not based on the Program
+with the Program (or with a work based on the Program) on a volume of
+a storage or distribution medium does not bring the other work under
+the scope of this License.
+
+  3. You may copy and distribute the Program (or a work based on it,
+under Section 2) in object code or executable form under the terms of
+Sections 1 and 2 above provided that you also do one of the following:
+
+    a) Accompany it with the complete corresponding machine-readable
+    source code, which must be distributed under the terms of Sections
+    1 and 2 above on a medium customarily used for software interchange; or,
+
+    b) Accompany it with a written offer, valid for at least three
+    years, to give any third party, for a charge no more than your
+    cost of physically performing source distribution, a complete
+    machine-readable copy of the corresponding source code, to be
+    distributed under the terms of Sections 1 and 2 above on a medium
+    customarily used for software interchange; or,
+
+    c) Accompany it with the information you received as to the offer
+    to distribute corresponding source code.  (This alternative is
+    allowed only for noncommercial distribution and only if you
+    received the program in object code or executable form with such
+    an offer, in accord with Subsection b above.)
+
+The source code for a work means the preferred form of the work for
+making modifications to it.  For an executable work, complete source
+code means all the source code for all modules it contains, plus any
+associated interface definition files, plus the scripts used to
+control compilation and installation of the executable.  However, as a
+special exception, the source code distributed need not include
+anything that is normally distributed (in either source or binary
+form) with the major components (compiler, kernel, and so on) of the
+operating system on which the executable runs, unless that component
+itself accompanies the executable.
+
+If distribution of executable or object code is made by offering
+access to copy from a designated place, then offering equivalent
+access to copy the source code from the same place counts as
+distribution of the source code, even though third parties are not
+compelled to copy the source along with the object code.
+
+  4. You may not copy, modify, sublicense, or distribute the Program
+except as expressly provided under this License.  Any attempt
+otherwise to copy, modify, sublicense or distribute the Program is
+void, and will automatically terminate your rights under this License.
+However, parties who have received copies, or rights, from you under
+this License will not have their licenses terminated so long as such
+parties remain in full compliance.
+
+  5. You are not required to accept this License, since you have not
+signed it.  However, nothing else grants you permission to modify or
+distribute the Program or its derivative works.  These actions are
+prohibited by law if you do not accept this License.  Therefore, by
+modifying or distributing the Program (or any work based on the
+Program), you indicate your acceptance of this License to do so, and
+all its terms and conditions for copying, distributing or modifying
+the Program or works based on it.
+
+  6. Each time you redistribute the Program (or any work based on the
+Program), the recipient automatically receives a license from the
+original licensor to copy, distribute or modify the Program subject to
+these terms and conditions.  You may not impose any further
+restrictions on the recipients' exercise of the rights granted herein.
+You are not responsible for enforcing compliance by third parties to
+this License.
+
+  7. If, as a consequence of a court judgment or allegation of patent
+infringement or for any other reason (not limited to patent issues),
+conditions are imposed on you (whether by court order, agreement or
+otherwise) that contradict the conditions of this License, they do not
+excuse you from the conditions of this License.  If you cannot
+distribute so as to satisfy simultaneously your obligations under this
+License and any other pertinent obligations, then as a consequence you
+may not distribute the Program at all.  For example, if a patent
+license would not permit royalty-free redistribution of the Program by
+all those who receive copies directly or indirectly through you, then
+the only way you could satisfy both it and this License would be to
+refrain entirely from distribution of the Program.
+
+If any portion of this section is held invalid or unenforceable under
+any particular circumstance, the balance of the section is intended to
+apply and the section as a whole is intended to apply in other
+circumstances.
+
+It is not the purpose of this section to induce you to infringe any
+patents or other property right claims or to contest validity of any
+such claims; this section has the sole purpose of protecting the
+integrity of the free software distribution system, which is
+implemented by public license practices.  Many people have made
+generous contributions to the wide range of software distributed
+through that system in reliance on consistent application of that
+system; it is up to the author/donor to decide if he or she is willing
+to distribute software through any other system and a licensee cannot
+impose that choice.
+
+This section is intended to make thoroughly clear what is believed to
+be a consequence of the rest of this License.
+
+  8. If the distribution and/or use of the Program is restricted in
+certain countries either by patents or by copyrighted interfaces, the
+original copyright holder who places the Program under this License
+may add an explicit geographical distribution limitation excluding
+those countries, so that distribution is permitted only in or among
+countries not thus excluded.  In such case, this License incorporates
+the limitation as if written in the body of this License.
+
+  9. The Free Software Foundation may publish revised and/or new versions
+of the General Public License from time to time.  Such new versions will
+be similar in spirit to the present version, but may differ in detail to
+address new problems or concerns.
+
+Each version is given a distinguishing version number.  If the Program
+specifies a version number of this License which applies to it and "any
+later version", you have the option of following the terms and conditions
+either of that version or of any later version published by the Free
+Software Foundation.  If the Program does not specify a version number of
+this License, you may choose any version ever published by the Free Software
+Foundation.
+
+  10. If you wish to incorporate parts of the Program into other free
+programs whose distribution conditions are different, write to the author
+to ask for permission.  For software which is copyrighted by the Free
+Software Foundation, write to the Free Software Foundation; we sometimes
+make exceptions for this.  Our decision will be guided by the two goals
+of preserving the free status of all derivatives of our free software and
+of promoting the sharing and reuse of software generally.
+
+                           NO WARRANTY
+
+  11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY
+FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW.  EXCEPT WHEN
+OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES
+PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED
+OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
+MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.  THE ENTIRE RISK AS
+TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU.  SHOULD THE
+PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING,
+REPAIR OR CORRECTION.
+
+  12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
+WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR
+REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES,
+INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING
+OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED
+TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY
+YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER
+PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE
+POSSIBILITY OF SUCH DAMAGES.
+
+                    END OF TERMS AND CONDITIONS
+
+           How to Apply These Terms to Your New Programs
+
+  If you develop a new program, and you want it to be of the greatest
+possible use to the public, the best way to achieve this is to make it
+free software which everyone can redistribute and change under these terms.
+
+  To do so, attach the following notices to the program.  It is safest
+to attach them to the start of each source file to most effectively
+convey the exclusion of warranty; and each file should have at least
+the "copyright" line and a pointer to where the full notice is found.
+
+    <one line to give the program's name and a brief idea of what it does.>
+    Copyright (C) <year>  <name of author>
+
+    This program is free software; you can redistribute it and/or modify
+    it under the terms of the GNU General Public License as published by
+    the Free Software Foundation; either version 2 of the License, or
+    (at your option) any later version.
+
+    This program is distributed in the hope that it will be useful,
+    but WITHOUT ANY WARRANTY; without even the implied warranty of
+    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+    GNU General Public License for more details.
+
+    You should have received a copy of the GNU General Public License along
+    with this program; if not, write to the Free Software Foundation, Inc.,
+    51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+
+Also add information on how to contact you by electronic and paper mail.
+
+If the program is interactive, make it output a short notice like this
+when it starts in an interactive mode:
+
+    Gnomovision version 69, Copyright (C) year name of author
+    Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
+    This is free software, and you are welcome to redistribute it
+    under certain conditions; type `show c' for details.
+
+The hypothetical commands `show w' and `show c' should show the appropriate
+parts of the General Public License.  Of course, the commands you use may
+be called something other than `show w' and `show c'; they could even be
+mouse-clicks or menu items--whatever suits your program.
+
+You should also get your employer (if you work as a programmer) or your
+school, if any, to sign a "copyright disclaimer" for the program, if
+necessary.  Here is a sample; alter the names:
+
+  Yoyodyne, Inc., hereby disclaims all copyright interest in the program
+  `Gnomovision' (which makes passes at compilers) written by James Hacker.
+
+  <signature of Ty Coon>, 1 April 1989
+  Ty Coon, President of Vice
+
+This General Public License does not permit incorporating your program into
+proprietary programs.  If your program is a subroutine library, you may
+consider it more useful to permit linking proprietary applications with the
+library.  If this is what you want to do, use the GNU Lesser General
+Public License instead of this License.
\ No newline at end of file
diff --git a/engine/doxyconf b/engine/doxyconf
new file mode 100644 (file)
index 0000000..4bed7d8
--- /dev/null
@@ -0,0 +1,221 @@
+# Doxyfile 1.4.2
+
+#---------------------------------------------------------------------------
+# Project related configuration options
+#---------------------------------------------------------------------------
+PROJECT_NAME           = "Dictionary Enigne"
+PROJECT_NUMBER         = 0.1
+OUTPUT_DIRECTORY       = doc/
+CREATE_SUBDIRS         = NO
+OUTPUT_LANGUAGE        = English
+USE_WINDOWS_ENCODING   = NO
+BRIEF_MEMBER_DESC      = YES
+REPEAT_BRIEF           = YES
+ABBREVIATE_BRIEF       = 
+ALWAYS_DETAILED_SEC    = NO
+INLINE_INHERITED_MEMB  = NO
+FULL_PATH_NAMES        = YES
+STRIP_FROM_PATH        = 
+STRIP_FROM_INC_PATH    = 
+SHORT_NAMES            = NO
+JAVADOC_AUTOBRIEF      = NO
+MULTILINE_CPP_IS_BRIEF = NO
+DETAILS_AT_TOP         = NO
+INHERIT_DOCS           = YES
+DISTRIBUTE_GROUP_DOC   = NO
+SEPARATE_MEMBER_PAGES  = NO
+TAB_SIZE               = 8
+ALIASES                = 
+OPTIMIZE_OUTPUT_FOR_C  = YES
+OPTIMIZE_OUTPUT_JAVA   = NO
+SUBGROUPING            = YES
+#---------------------------------------------------------------------------
+# Build related configuration options
+#---------------------------------------------------------------------------
+EXTRACT_ALL            = YES
+EXTRACT_PRIVATE        = YES
+EXTRACT_STATIC         = YES
+EXTRACT_LOCAL_CLASSES  = YES
+EXTRACT_LOCAL_METHODS  = NO
+HIDE_UNDOC_MEMBERS     = NO
+HIDE_UNDOC_CLASSES     = NO
+HIDE_FRIEND_COMPOUNDS  = NO
+HIDE_IN_BODY_DOCS      = NO
+INTERNAL_DOCS          = NO
+CASE_SENSE_NAMES       = YES
+HIDE_SCOPE_NAMES       = NO
+SHOW_INCLUDE_FILES     = YES
+INLINE_INFO            = YES
+SORT_MEMBER_DOCS       = YES
+SORT_BRIEF_DOCS        = NO
+SORT_BY_SCOPE_NAME     = NO
+GENERATE_TODOLIST      = YES
+GENERATE_TESTLIST      = YES
+GENERATE_BUGLIST       = YES
+GENERATE_DEPRECATEDLIST= YES
+ENABLED_SECTIONS       = 
+MAX_INITIALIZER_LINES  = 30
+SHOW_USED_FILES        = YES
+SHOW_DIRECTORIES       = NO
+FILE_VERSION_FILTER    = 
+#---------------------------------------------------------------------------
+# configuration options related to warning and progress messages
+#---------------------------------------------------------------------------
+QUIET                  = NO
+WARNINGS               = YES
+WARN_IF_UNDOCUMENTED   = YES
+WARN_IF_DOC_ERROR      = YES
+WARN_NO_PARAMDOC       = NO
+WARN_FORMAT            = "$file:$line: $text"
+WARN_LOGFILE           = 
+#---------------------------------------------------------------------------
+# configuration options related to the input files
+#---------------------------------------------------------------------------
+INPUT                  = /scratchbox/users/stranger/home/stranger/whitestork/testing/doc_engin
+FILE_PATTERNS          = 
+RECURSIVE              = YES
+EXCLUDE                = src/test.c src/engine_xdxf.c include/engine_xdxf.h
+EXCLUDE_SYMLINKS       = NO
+EXCLUDE_PATTERNS       = 
+EXAMPLE_PATH           = 
+EXAMPLE_PATTERNS       = 
+EXAMPLE_RECURSIVE      = NO
+IMAGE_PATH             = 
+INPUT_FILTER           = 
+FILTER_PATTERNS        = 
+FILTER_SOURCE_FILES    = NO
+#---------------------------------------------------------------------------
+# configuration options related to source browsing
+#---------------------------------------------------------------------------
+SOURCE_BROWSER         = YES
+INLINE_SOURCES         = NO
+STRIP_CODE_COMMENTS    = YES
+REFERENCED_BY_RELATION = YES
+REFERENCES_RELATION    = YES
+VERBATIM_HEADERS       = YES
+#---------------------------------------------------------------------------
+# configuration options related to the alphabetical class index
+#---------------------------------------------------------------------------
+ALPHABETICAL_INDEX     = NO
+COLS_IN_ALPHA_INDEX    = 5
+IGNORE_PREFIX          = 
+#---------------------------------------------------------------------------
+# configuration options related to the HTML output
+#---------------------------------------------------------------------------
+GENERATE_HTML          = YES
+HTML_OUTPUT            = html
+HTML_FILE_EXTENSION    = .html
+HTML_HEADER            = 
+HTML_FOOTER            = 
+HTML_STYLESHEET        = 
+HTML_ALIGN_MEMBERS     = YES
+GENERATE_HTMLHELP      = NO
+CHM_FILE               = 
+HHC_LOCATION           = 
+GENERATE_CHI           = NO
+BINARY_TOC             = NO
+TOC_EXPAND             = NO
+DISABLE_INDEX          = NO
+ENUM_VALUES_PER_LINE   = 4
+GENERATE_TREEVIEW      = NO
+TREEVIEW_WIDTH         = 250
+#---------------------------------------------------------------------------
+# configuration options related to the LaTeX output
+#---------------------------------------------------------------------------
+GENERATE_LATEX         = YES
+LATEX_OUTPUT           = latex
+LATEX_CMD_NAME         = latex
+MAKEINDEX_CMD_NAME     = makeindex
+COMPACT_LATEX          = NO
+PAPER_TYPE             = a4wide
+EXTRA_PACKAGES         = 
+LATEX_HEADER           = 
+PDF_HYPERLINKS         = NO
+USE_PDFLATEX           = NO
+LATEX_BATCHMODE        = NO
+LATEX_HIDE_INDICES     = NO
+#---------------------------------------------------------------------------
+# configuration options related to the RTF output
+#---------------------------------------------------------------------------
+GENERATE_RTF           = NO
+RTF_OUTPUT             = rtf
+COMPACT_RTF            = NO
+RTF_HYPERLINKS         = NO
+RTF_STYLESHEET_FILE    = 
+RTF_EXTENSIONS_FILE    = 
+#---------------------------------------------------------------------------
+# configuration options related to the man page output
+#---------------------------------------------------------------------------
+GENERATE_MAN           = NO
+MAN_OUTPUT             = man
+MAN_EXTENSION          = .3
+MAN_LINKS              = NO
+#---------------------------------------------------------------------------
+# configuration options related to the XML output
+#---------------------------------------------------------------------------
+GENERATE_XML           = NO
+XML_OUTPUT             = xml
+XML_SCHEMA             = 
+XML_DTD                = 
+XML_PROGRAMLISTING     = YES
+#---------------------------------------------------------------------------
+# configuration options for the AutoGen Definitions output
+#---------------------------------------------------------------------------
+GENERATE_AUTOGEN_DEF   = NO
+#---------------------------------------------------------------------------
+# configuration options related to the Perl module output
+#---------------------------------------------------------------------------
+GENERATE_PERLMOD       = NO
+PERLMOD_LATEX          = NO
+PERLMOD_PRETTY         = YES
+PERLMOD_MAKEVAR_PREFIX = 
+#---------------------------------------------------------------------------
+# Configuration options related to the preprocessor   
+#---------------------------------------------------------------------------
+ENABLE_PREPROCESSING   = YES
+MACRO_EXPANSION        = NO
+EXPAND_ONLY_PREDEF     = NO
+SEARCH_INCLUDES        = YES
+INCLUDE_PATH           = 
+INCLUDE_FILE_PATTERNS  = 
+PREDEFINED             = 
+EXPAND_AS_DEFINED      = 
+SKIP_FUNCTION_MACROS   = YES
+#---------------------------------------------------------------------------
+# Configuration::additions related to external references   
+#---------------------------------------------------------------------------
+TAGFILES               = 
+GENERATE_TAGFILE       = 
+ALLEXTERNALS           = NO
+EXTERNAL_GROUPS        = YES
+PERL_PATH              = /usr/bin/perl
+#---------------------------------------------------------------------------
+# Configuration options related to the dot tool   
+#---------------------------------------------------------------------------
+CLASS_DIAGRAMS         = YES
+HIDE_UNDOC_RELATIONS   = YES
+HAVE_DOT               = NO
+CLASS_GRAPH            = YES
+COLLABORATION_GRAPH    = YES
+GROUP_GRAPHS           = YES
+UML_LOOK               = NO
+TEMPLATE_RELATIONS     = NO
+INCLUDE_GRAPH          = YES
+INCLUDED_BY_GRAPH      = YES
+CALL_GRAPH             = NO
+GRAPHICAL_HIERARCHY    = YES
+DIRECTORY_GRAPH        = YES
+DOT_IMAGE_FORMAT       = png
+DOT_PATH               = 
+DOTFILE_DIRS           = 
+MAX_DOT_GRAPH_WIDTH    = 1024
+MAX_DOT_GRAPH_HEIGHT   = 1024
+MAX_DOT_GRAPH_DEPTH    = 0
+DOT_TRANSPARENT        = NO
+DOT_MULTI_TARGETS      = NO
+GENERATE_LEGEND        = YES
+DOT_CLEANUP            = YES
+#---------------------------------------------------------------------------
+# Configuration::additions related to the search engine   
+#---------------------------------------------------------------------------
+SEARCHENGINE           = NO
diff --git a/engine/include/dictionary_engine.h b/engine/include/dictionary_engine.h
new file mode 100644 (file)
index 0000000..b53763b
--- /dev/null
@@ -0,0 +1,578 @@
+/************************************************************************************************
+This file is part of WhiteStork.
+
+WhiteStork is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2 of the License, or
+(at your option) any later version.
+
+WhiteStork is distributed in the hope that it will be useful, 
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+GNU General Public License for more details.
+
+You should have received a copy of the GNU General Public License 
+along with WhiteStork; if not, write to the Free Software
+Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+
+Copyright 2006 ComArch S.A.
+************************************************************************************************/
+#ifndef        _DICTIONARY_ENGINE_BASE
+#define        _DICTIONARY_ENGINE_BASE
+
+#ifdef __cplusplus
+extern "C" {   // to make it possible to use this header in C++ programms
+#endif
+
+//______________________________________________________________________________________________________
+// ******************************************************************************************************
+//********************************************************************************************* HEADERS:
+#include <glib.h>
+
+
+//______________________________________________________________________________________________________
+// ******************************************************************************************************
+//************************************************************************************ GLOBAL MACROS:
+/** \brief Checks if module is peaceable with concrete location.
+*
+* If user of engine module want to know if concrete module can handle concrete location, he can call <i>dict_eng_module_check()</i>
+*and check the result of this function.
+ * @param module :: <b>EngineModule</b> - module engine which will be testing
+ * @param location :: <b>gchar*</b> - location on wich engine will be testing
+ * @return <i><b>gboolean</b></i> :: tells if location <i>location</i> can be handled by module <i>module</i>
+ */
+#define dict_eng_module_check(module,location)                 ( (module).engine_check( (location) ) )
+
+
+/** \brief Get short description of engine module.
+ *
+ * If there is need to present to the user of end programm some information about enigne he is using, we can call dict_eng_module_get_description() and
+ * print/show the result of this call.
+ * @param module :: <b>EngineModule</b> - module engine which description we want
+ * @return <i><b>gchar*</b></i> :: there is string, decribing module engine <i>module</i>, in this pointer. User should NOT free this pointer as it points to static table of chars
+ */
+#define dict_eng_module_get_description(module)        ( (module).engine_description() )
+
+
+/** \brief Get version of engine module.
+ *
+ * Sometimes it could be useful to get know what version of engine module we are using. We can call this function to retrieve these informations from module.
+ * Note that version information could be also placed in description of module, but here user will get only string representing version, what could be needed in some situation
+ * (e.g.: if end-user will have two the same module, then programm has to decide which should be used, or ask user).
+ * @param module :: <b>EngineModule</b> - module engine which implementation version we want
+ * @return <i><b>gchar*</b></i> :: pointer to string representing module <i>module</i>version. User should NOT free this pointer as it points to static table of chars
+ */
+#define dict_eng_module_get_version(module)            ( (module).engine_version() )
+
+
+/** \brief Get format on which working engnine module.
+ *
+ * If we want to know on what dictionary format works current engine module, we can call this function. As a result we will retrieve string telling us what format-based is 
+ * concrete engine module (e.g. XDXF, WordNet etc.).
+ * @param module :: <b>EngineModule</b> - engine module which dictionary format we want to get
+ * @return <i><b>gchar*</b></i> :: string representing format of dictionary on which module <i>module</i> can works. User should NOT free this pointer as it points 
+ * to static table of chars
+ */
+#define dict_eng_module_get_format(module)                     ( (module).engine_version() )
+
+
+/** \brief Open concrete dictionary.
+*
+* This functions opens location (this could mean: filename, URL, any other way to specify concrete localization of dictionary database). To be more sure that this function will be sucefull,
+* user can call before dict_eng_module_check() to check if this module can handle dictionary under passed location. But this do not warrant that calling dict_eng_module_create() will not
+* fail. User should check the result of function to be sure that everything was ok.
+ * @param module :: <b>EngineModule</b> - engine module which should be used to open location <i>location</i>
+ * @param location :: <b>gchar*</b> - location of dictionary database (file, directory, URL etc.)
+ * @param flags :: <b>EngineOptimizationFlag</b> - flags defines how program shoud automaticlly use optimization methods for opened dictionary
+ * @return <i><b>Engine*</b></i> :: pointer to new enigne structure; After use, if this structure will not be needed anymore, user should call dict_eng_destroy() to free memory
+ * \sa EngineOptimizationFlag :|: dict_eng_module_check() :|: EngineModule :|: Engine
+*/
+#define dict_eng_module_create(module,location,flags)          ( (module).engine_create(  (location), (flags) ) )
+
+
+//______________________________________________________________________________________________________
+// ******************************************************************************************************
+//********************************************************************** CONCRETE DICTIONARY MACROS:
+/** \brief Activate optimization mechanizms for concrete engine.
+ *
+ * Every engine could have some optimization methods. By calling this function we enabled this option. For the user of engine it is not important what kind
+ * of optimization is used in current engine, how does it work etc. It should be opaque for engine's users.
+ *  
+ * @param engine :: <b>Engine*</b> - pointer to engine which should optimized
+ * @return <i><b>void</b></i> :: nothing. This function only take a chance to make engine working faster, but it is not said that every step will be succesful.
+ * But even if not - engine has to work properly.
+ * \sa dict_eng_module_create() :|: dict_eng_is_optimized() :|: Engine
+ */
+#define dict_eng_optimize(engine)                                                      ( ( engine )->engine_optimize( engine ) )
+
+
+/** \brief Checks if current engine has activated optimization.
+ *
+ * User can call this function to get know if concrete engine has enabled optimization. Optimization can be activated by calling dict_eng_optimize() or passing
+ * ENGINE_CREATE or ENGINE_REFRESH flags to dict_eng_module_create() while opening concrete dictionary. 
+ *  
+ * @param engine :: <b>Engine*</b> - pointer to engine which should checked if is optimized now
+ * @return <i><b>gboolean</b></i> :: nothing. This function only take a chance to make engine working faster, but it is not said that every step will be succesful
+ * \sa dict_eng_optimize() :|: Engine :|: EngineOptimizationFlag
+ */
+#define dict_eng_is_optimized( engine )                                                ( ( engine )->engine_is_optimized( engine ) )
+
+
+/** \brief To get know from what location was created current dictionary.
+ *
+ * If user of engine want to get know from what locatione exactly was created concrete engine, he could call this function. It returns string,
+ * most likely the same as the one passed earlier to dict_eng_module_create() function as a <i>location</i> argument.
+ *  
+ * @param engine :: <b>Engine*</b> - dictionary from which we want to get location 
+ * @return <i><b>gchar*</b></i> :: pointer to chars, from which concrete dictionary was created
+ * \sa dict_eng_module_create()
+ */
+#define dict_eng_get_location(engine)                                                  ( (engine)->engine_location( engine ) )
+
+
+/** \brief Tells if last operation was sucesfull.
+ *
+ * If user want to be sure that everything was ok, during last operation (it has finished with success), he has to check if dict_eng_get_last_state() is equal to
+ * ENGINE_NO_ERROR. If not, he can also find the reason why operation failed.
+ * @param engine :: <b>Engine*</b> - dictionary which last operation's returned code we want to get
+ * @return <i><b>EngineStatus</b></i> :: finish code of last operation
+ * \sa EngineStatus :|: dict_eng_state_message()
+ */
+#define dict_eng_get_last_state(engine)                                                ( (engine)->engine_error( engine ) )
+
+
+/** \brief Translate pure state code to meaningfull message.
+ *
+ * If there was a error during engine was working, we can present to the user the reason for this error in meaningfull form.
+ * @param error :: <b>EngineState</b> - code which we want to translate
+ * @return <i><b>gchar*</b></i> :: message describing concrete error code
+ * \sa EngineStatus :|: dict_eng_state_message()
+ */
+#define dict_eng_state_message(error)                                  ( (engine)->engine_error_message( error ) )
+
+
+/** \brief Destroy gently and completly current dictionary.
+ *
+ * When user do not need anymore concrete dictionary, he must destroy it to free memory allocated by this dictionary. It will close avery opened file descriptor,
+ * free any additional memory block allocated while engine was working etc. User are not allowed to call free() on dictionary without calling before dict_eng_destroy().
+ *  
+ * @param engine :: <b>Engine*</b> - pointer to dictionary which is not needed anymore
+ * @return <i><b>void</b></i> :: nothing. This function should work properly, and free any resources which arelady are in use by current dictionary.
+ * \sa dict_eng_module_create() :|: Engine
+ */
+#define dict_eng_destroy(engine)                                                       ( (engine)->engine_close(engine) )
+
+
+/** \brief Start searching for words list.
+ *
+ * This function starts searching for words list. User should set before callback for ENGINE_WORD_LIST_SIGNAL, to be able to retrieve words list, because this
+ * function do not return any value.
+ *  
+ * @param engine :: <b>Engine*</b> - pointer to dictionary in which we are looking for words matching to pattern
+ * @param pattern :: <b>gchar*</b> - string representing pattern to which returned word should be matching
+ * @return <i><b>void</b></i> :: nothing. Result of searching can be retrieved by callback for signal ENGINE_WORD_LIST_SIGNAL
+ * \sa dict_eng_search_word_translation() :|: dict_eng_search_word_translation_extended() :|: dict_eng_set_callback() :|: ENGINE_WORD_LIST_SIGNAL
+ */
+#define dict_eng_search_word_list(engine,pattern)                      ( (engine)->engine_search_word_list((engine), (pattern)) )
+
+
+/** \brief Start searching for word translation in dictionary.
+ *
+ * Start searching for translation of word. To be able to retrieve translation user should use callback for ENGINE_WORD_TRANSLATION_SIGNAL signal.
+ *  
+ * @param engine :: <b>Engine*</b> - dictionary in which we want find word's translation
+ * @param word :: <b>gchar*</b> - string representing word which translation we are looking for
+ * @return <i><b>void</b></i> :: nothing. Result of searching can be retrieved by callback for signal ENGINE_WORD_TRANSLATION_SIGNAL
+ * \sa dict_eng_search_word_list() :|: dict_eng_search_word_translation_extended() :|: dict_eng_set_callback() :|: ENGINE_WORD_TRANSLATION_SIGNAL
+ */
+#define dict_eng_search_word_translation(engine,word)          ( (engine)->engine_search_word_translation((engine), (word)) )
+
+
+/** \brief Start searching for extended word translation in dictionary.
+ *
+ * Start searching for extended  translation of word. To be able to retrieve translation user should use callback for ENGINE_WORD_TRANSLATION_SIGNAL signal. Extended means
+ * that retrieved translation's string could be some more than plain text (e.g. HTML, Image, etc.). User of engine should know what kind of data will retrieve ofter calling this method.
+ * \todo This option are in projecting phase. In the future callback for ENGINE_WORD_TRANSLATION_SIGNAL should take parameter <i>gpointer</i> than <i>gchar*</i> to make possible
+ * for user of engine to retrieve data different than gchar*. There shold be also some additional function letting know user what kind of data he will retrieve.
+ *  
+ * @param engine :: <b>Engine*</b> - dictionary in which we want find word's translation
+ * @param word :: <b>gchar*</b> - string representing word which translation we are looking for
+ * @return <i><b>void</b></i> :: nothing. Result of searching can be retrieved by callback for signal ENGINE_WORD_TRANSLATION_SIGNAL
+ * \sa dict_eng_search_word_list() :|: dict_eng_search_word_translation() :|: dict_eng_set_callback() :|: ENGINE_WORD_TRANSLATION_SIGNAL
+ */
+#define dict_eng_search_word_translation_extended(engine,word)         ( (engine)->engine_search_word_translation_extended((engine), (pattern)) )
+
+
+/** \brief Setting any callback for current dictionary.
+ *
+ * As long as functions which search for words list or translation do not return any value, user has to set callback which will be called after searching end. This make easy
+ * calling these functions from other proccess, threads etc. This function sets callbacks for every signal.
+ *  
+ * @param engine :: <b>Engine*</b> - dictionary for which we want set some callback
+ * @param signal :: <b>gchar*</b> - string representing for what signal we want to set callback
+ * @param c_handler :: <b>gpointer</b> - pointer to function which will be called after signal <i>signal</i> will occured
+ * @param data :: <b>gpointer</b> - pointer to user data, which will be always passed to callback <i>c_handler</i> for signal <i>signal</i>as a last argument
+ * @return <i><b>gpointer</b></i> :: pointer to previous callback; if this callbacks was not set yet, it returns NULL
+ * \sa cb_word_list :|: cb_word_translation :|:  ENGINE_WORD_LIST_SIGNAL :|: ENGINE_WORD_TRANSLATION_SIGNAL
+ */
+#define dict_eng_set_callback(engine,signal,c_handler,data)            ( (engine)->engine_set_callback((engine),(signal),(c_handler),(data)) )
+
+//______________________________________________________________________________________________________
+// ******************************************************************************************************
+//******************************************************************* SIGNALS DEFINITION FOR CALLBACKS:
+/** \brief Signal description's definition for callback called when word list was found.
+ *
+ * ENGINE_WORD_LIST_SIGNAL defines name for signal passed to dict_eng_set_callback() function as a 
+ * signal parameter. Function set to handle this signal should be called from dict_eng_search_word_list() only
+ * and have cb_word_list type.
+ * <b>NOTE:</b> programmers must not use value of ENGINE_WORD_LIST_SIGNAL directly!
+ * \sa cb_word_list :|: dict_eng_set_callback() :|: dict_eng_search_word_list() :|: ENGINE_WORD_TRANSLATION_SIGNAL
+ */
+#define ENGINE_WORD_LIST_SIGNAL        "on_word_list_found"
+
+
+/** \brief Signal description's definition for callback called when word translation was found.
+ *
+ * ENGINE_WORD_TRANSLATION_SIGNAL defines name for signal passed to dict_eng_set_callback() function as a 
+ * signal parameter. Function set to handle this signal should be called from dict_eng_search_word_translation() and  dict_eng_search_word_translation_extended() only
+ * and have cb_word_translation.
+ * <b>NOTE:</b> programmers must not use value of ENGINE_WORD_LIST_SIGNAL directly!
+ * \sa cb_word_translation :|: dict_eng_set_callback() :|: dict_eng_search_word_translation() :|: ENGINE_WORD_LIST_SIGNAL
+ */
+#define ENGINE_WORD_TRANSLATION_SIGNAL "on_word_translation_found"
+
+
+
+//______________________________________________________________________________________________________
+// ******************************************************************************************************
+//************************************************************************** DEFINITIONS OF ENUMS TYPES:
+/** \brief Codes of flags used to auto optimizing dictionary file (passes to dict_eng_module_create() function as a parameter flags).
+ * 
+ * - Enum type for flags used as a flags parameter for dict_eng_module_create() function.
+ */
+typedef enum
+{
+       ENGINE_CREATE = 0,              ///< :: flags says thatoptimization (any methods of optimalization) should be enabled. If optimization methods needs to make some files and these files exists, enigne will just use it (do not refresh).
+       ENGINE_NO,                              ///< :: flags says that for this particular dictionary programm should disabled optimization.
+       ENGINE_REFRESH          ///< :: the same flags as ENGINE_CREATE, but tells dict_eng_module_create() function that even if file (or any resources) for optimizatione methods exists, they should be recreated/refreshed.
+} 
+EngineOptimizationFlag;
+
+/** \brief Codes of possible errors which can occured while engine is working.
+* 
+* - Enum type for errors' codes. One of this code is always in last error variable (variable 'last error' is invisible for programmers - 
+* they should use function engine_error() and optionally engine_error_message() to get know what kind of error occured).
+*/
+typedef enum
+{
+       ENGINE_NO_ERROR = 0,            ///< :: there was no error - last action successed
+       ENGINE_WRONG_FILE,              ///< :: file, which engine tried to read, has wrong format or it is corrupted.
+       ENGINE_COULDNT_READ,            ///< :: user do not have permission to read/open file, which engine tried to open/read.
+       ENGINE_NO_FILE,                 ///< :: file, on which engine tried to operate, do not exist
+       ENGINE_OUT_OF_MEMORY    ///< :: while engine was working, "Out Of Memory" error occured
+}
+EngineStatus;
+
+
+//______________________________________________________________________________________________________
+// ******************************************************************************************************
+//********************************************************************* DEFINITIONS OF CALLBACK'S TYPES:
+/** \brief Type of callback functions for retrieving word list.
+ * 
+ * Function which is set by dict_eng_set_callback() to signal ENGINE_WORD_LIST_SIGNAL should be exactly this type.
+ * @param list :: <b>GArray*</b> - there will be all found words in this array
+ * @param pattern :: <b>gchar*</b> - pattern to which we have been looking for word lists
+ * @param error :: <b>EngineStatus</b> - error code; if everything was ok it is ENGINE_NO_ERROR
+ * @param user_data :: <b>gpointer</b> - data set by user to be passing to each callback for ENGINE_WORD_LIST_SIGNAL signal
+ */
+typedef void (*cb_word_list)(GArray* list, gchar* pattern, gpointer user_data, EngineStatus error);
+
+
+/** \brief Type of callback functions for retrieving word's translation.
+ * 
+ * Function which is set by dict_eng_set_callback() to signal ENGINE_WORD_TRANSLATION_SIGNAL should be exactly this type.
+ * @param translation :: <b>gchar*</b> - translation of word <i>word</i>
+ * @param word :: <b>gchar*</b> - word which translation we already retrieved
+ * @param error :: <b>EngineStatus</b> - error code; if everything was ok it is ENGINE_NO_ERROR
+ * @param user_data :: <b>gpointer</b> - data set by user to be passing to each callback for ENGINE_WORD_TRANSLATION_SIGNAL signal
+ */
+typedef void (*cb_word_translation)(gchar* translation, gchar* word, gpointer user_data, EngineStatus error);
+
+
+
+
+
+//______________________________________________________________________________________________________
+// ******************************************************************************************************
+//*************************************************************** DEFINITIONS OF BASIC FUNCTIONS TYPES:
+// /** \brief Predeclaration for structure Engine.
+typedef struct _Engine Engine;
+
+/** \brief Type of function getting some chars from engin.
+ *
+ * Function of this type should be used for functions which intention is to get some string from concrete dictionary.
+ * @param engine :: <i>Engine*</i> - pointer to engine on which this functions has to work
+ * @return <i><b>gchar*</b></i> :: chars which represents some information depends on concrete functions (e.g engine path etc.)
+ */
+typedef gchar*   (*getting_char)(Engine* engine);
+
+
+/** \brief Type of function getting boolean statement from engine.
+ *
+ * Function of this type should be used for functions which intention is to get boolean statement 
+ * from concrete dictionary (e.g. to get know if engine has cach file - is cashed). 
+ * @param engine :: <i>Engine*</i> - pointer to engine on which this functions has to work
+ * @return <i><b>gboolean</b></i> :: gboolean statement which gives programmers some information about state of dictionary/engine
+*/
+typedef gboolean (*getting_bool)(Engine* engine);
+
+/** \brief Type of function which hasn't got to return any value (only perform some actions).
+ *
+ * Function of this type should be used for functions which intention is only to do something 
+ * on concrete dictionary (e.g. to make cache file, delete etc.).
+ * @param engine :: <i>Engine*</i> - pointer to engine on which this functions has to work
+ * @return nothing. Functions of this type should only perform some action - there is no result
+ */
+typedef void     (*doing_only)(Engine* engine);
+
+/** \brief Type of function which can find words list from dictionary.
+* 
+* Function of this type should be used as a function for searching words list matching to pattern.
+* @param engine :: <i>Engine*</i> - pointer to engine on which this functions has to work
+* @param pattern :: <i>gchar*</i> - pointer to chars which describes pattern for searching words
+* @return nothing. This function do not return anything - result should be retrievwe by callbacks 
+*/
+typedef void    (*searching_word_list)(Engine* engine, gchar* pattern);        
+
+/** \brief Type of function which can find word's translation from dictionary.
+ * 
+ * Functions of this type should be used as a function for searching word translation in concrete dictionary.
+ * @param engine :: <i>Engine*</i> - pointer to engine on which this functions has to work
+ * @param word :: <i>gchar*</i> - pointer to chars which tells what word's translation we are looking for
+ * @return nothing. This function do not return anything - result should be retrievwe by callback
+ */
+typedef void    (*searching_word_translation)(Engine* engine, gchar* word);
+
+/** \brief Type of function which can <i>translate</i> error code to descriptive message.
+ * 
+ * Functions of this type should be used as <i>translator</i> from error code to meaningful message.
+ * @param error :: <i>EngineStatus</i> - error to which we want get description
+ * @return <i><b>gchar*</b></i> :: chars which describes us what kind of error occured (e.g. "Dictionary file has wrong file format or it is corrupted.")
+ */
+typedef gchar*  (*error_to_message)(EngineStatus error);
+
+/** \brief Type of function which should be used to set new callback for some event.
+ * 
+ * Functions of this type should be used as a <i>setter</i> for new callback functions
+ * @param engine :: <i>Engine*</i> - pointer to engine on which this functions has to work
+ * @param signal  :: <i>gchars*</i> - pointer to chars which tell us what kind of event should new_functions handle (e.g. "word_list_found", "translation_found" etc.)
+ * @param c_handler :: <i>gpointer</i> - new callback function
+ * @param user_data :: <i>gpointer</i> - pointer do structure, which should be passed as a last argument when calling new mounted callback
+ * @return <i><b>gpointer</b></i> :: gpointer to previous callback. If NULL there could be some error so programmers should check by engine_error() function if there was some 
+ * (if NULL and engine_error() return ENGINE_NO_ERROR that means that this callback was unused before).
+ * \sa ENGINE_WORD_LIST_SIGNAL :|: ENGINE_WORD_TRANSLATION_SIGNAL :|: dict_eng_set_callback() :|: cb_word_list :|: cb_word_translation
+*/
+typedef gpointer (*setting_callbacks)(Engine* engine, gchar* signal, gpointer c_handler, gpointer user_data);
+
+
+/** \brief Type of function which can get some int value from dictionary.
+ * 
+ * Functions of this type should be used if programmer want to get some int value from dictionary.
+ * @param enigne :: <i>Engine*</i> - pointer to engine on which this functions has to work
+ * @return <i><b>gint</b></i> :: int value which user wanted to get from dictionary
+ */
+typedef gint (*getting_int)(Engine* engine);
+
+
+//______________________________________________________________________________________________________
+// ******************************************************************************************************
+//********************************************************* DEFINITIONS OF ADDITIONAL FUNCTIONS TYPES:
+/** \brief Additional functions type: Type of function which should be used to check if this module could handle some location (e.g filename, URI, etc.).
+ * 
+ * Functions of this type should be used to check if dictionary in location could be handled by this engine.
+ * @param location :: <i>gchar*</i> - chars which describe location of dictionary to check
+ * @return <i><b>gboolean</i></b> :: statement telling us if this module could or could not handle dictionary under location.
+ */
+typedef gboolean (*checking_compatibiliti)(gchar* location);
+
+
+/** \brief Additional functions type: Type of function which should be used to get some chars from concrete module/engine (NOT DICTIONARY!).
+ * 
+ * Functions of this type should be used to get some descriptions from engine/module. 
+ * Information retrievs by this kind of functions are global for module (e.g: description of handles fromat, description of module etc.).
+ * @return <i><b>gchar*</i></b> :: chars which we wanted
+ */
+typedef gchar*  (*getting_chars_engine)(void);
+
+/** \brief Additional functions type: Type of function which should be used to open (create) new dictionary from location.
+ * 
+ * Functions of this type should be used to opening dictionary. 
+ * @param location :: <i>gchar*</i> - chars which describe where is the dictionary which we want to open
+ * @param flags :: <i>EngineOptimizationFlag</i> - flags to initialize/use optimization methods for opening dictionary.
+ * @return <i><b>gpointer</i></b> ::pointer to opened Engine. If NULL there was some error - programmers should check error type by calling engine_error() function.
+ */
+typedef Engine*         (*creating_engine)(gchar* location, EngineOptimizationFlag flags);
+
+
+/** \brief General dictionary structure.
+*  
+* This structure contains every data which are needed to make dictionary working. Data of dictionary are 
+* invisible for user of finnal module. User can operate on dictionary with functions to which there are pointers
+* in this structure also. engine_data is for module programmer use only. Programmer of module can put there any
+* data he want. He should not give end user any information about engine_data structure.
+*/
+struct _Engine
+{
+       /** \brief Getting location of dictionary.
+       *
+       * User can use this function if want to get location of concrete dictionary.
+       * \sa getting_char
+       **/
+       getting_char                    engine_location;
+
+       /** \brief Getting information if this dictionary is cached.
+       *
+       * User can use this function if want to know is dictionary cached actually.
+       * \sa getting_bool
+        **/
+       getting_bool                    engine_is_optimized;
+
+       /** \brief Making cache file for dictionary.
+       *
+       * User can use this function if want to make cache file for concrete dictionary.
+       * \sa doing_only
+       **/
+       doing_only                      engine_optimize;
+
+       /** \brief Searching word list.
+       *
+       * User call this function to start searching for word list.
+       * \sa searching_word_list
+       **/
+       searching_word_list             engine_search_word_list;
+
+       /** \brief Searching word's translation.
+       *
+       * User call this function to start searching for word's translation.
+       * \sa searching_word_translation
+       **/
+       searching_word_translation      engine_search_word_translation;
+
+       /** \brief Searching word's translation (preformatted HTML).
+       *
+       * User call this function to start searching for word's translation. It differs from engine_search_word_translation
+        * that it returns preformatted string (HTML format).
+       * \sa searching_word_translation
+       **/
+       searching_word_translation      engine_search_word_translation_extended;        
+
+       /** \brief Close dictionary.
+       *
+       * User call this if work with dictionary is finished and there is no need to keep this further working.
+       * \sa doing_only
+       **/
+       doing_only                      engine_close;
+
+       /** \brief Functions return laste error which occured in dictionary.
+       *
+       * Programmer should use this function after each action to check if there was not any errors.
+       * \sa getting_int
+       **/
+       getting_int                     engine_error;
+
+       /** \brief <i>Tranlsate</i> error code to meaningful message.
+       *
+       * Programmer can call this function if want to get meaningful message describes concrete error code
+       * \sa error_to_message
+       **/
+       error_to_message                        engine_error_message;
+
+       /** \brief Function to setting any callback for this dictionary.
+       * 
+       * This function can be used to set some callback function for concrete dictionary. Programmer
+       * should always set callback "word_list_found" and "word_translation_found". Developers of 
+       * new modules should also define for what kind of event end user will be able to set callback.
+       */
+       setting_callbacks               engine_set_callback;
+
+       /** \brief Module's private data area. Used only by module programmer.
+       * 
+        * Here module programmer should keep their own data (e.g. some data for searching optimalization etc.).
+       * Programmer whose only using module, should not use engine_data at all.
+       */
+       gpointer engine_data;
+};
+
+/** \brief Structure that has, as a members, pointers to helpfull functions for programmer.
+*
+* There are pointers to some functions in this structure. Programmer whom using module could use it to
+* get some useful informationa about module (e.g: format handled by module, it's version etc.). The most important
+* functions are: \n
+* engine_check() - to check if this module can handle concrete location \n
+* engine_open() - to open location
+*/
+typedef struct  {
+       
+       /** \brief Function to check compatibility beetwen module and location.
+       *       
+       * Helps programmer to check if this concrete module was designed to work with dictionary under location passed as a argument to this function 
+       * \sa checking_compatibiliti
+       */
+       checking_compatibiliti          engine_check;      
+
+       /** \brief Function to get some short description of module/engine.
+         *     
+        *  This function returns short description of module, to make possible displaying for end user what kind of module he is useing.
+        * \sa getting_chars_engine
+        */     
+       getting_chars_engine            engine_description;
+
+       /** \brief Function to get module's format.
+       *       
+       *  This function returns format of dictionary which this module can handle.
+       * \sa getting_chars_engine
+       */
+       getting_chars_engine            engine_format;
+
+       /** \brief Function to get version of module.
+       *       
+       *  This functions return version of this module/engine.
+       * \sa getting_chars_engine
+       */
+       getting_chars_engine            engine_version;
+
+       /** \brief Function to open/create new dictionary.
+       *       
+       *  This functions allow programmer to open/create module from concrete location.
+       * \sa creating_engine
+       */
+       creating_engine                         engine_create;
+} 
+EngineModule;
+
+
+/** \brief Additional functions type: type of functions wich helps load others function from module.
+ * 
+ * There should be in each module exactly one function of this type named: engine_global_functions. This function
+ * makes easier to load dynamically module. For doing this then you need only to mapped only this one function
+ * and the rest will be avaiable for you from returned structure EngineModule.
+ * @return  <i><b>EngineModule</b></i> :: structure EngineModule from which you can call next functions
+ * \sa engine_global_functions()
+ */
+typedef EngineModule (*getting_additional)(void);
+
+/** \brief Function that helps programmer to load basic functions from engine's module. 
+ *
+ * This function helps programmers to dynamically load module to their programms. Only this function needed to be
+ * mapped from *.so file. Rest of function are in returned structure EngineModule. User of module could mapped himslef
+ * others functions from concrete modules, but it is not recommended as far as developers of module could, in fact, give different
+ * names for functions. In structure EngineModule names will be always the same. NOTE for module developer: this function should be always defined in your
+ * code, to help next programmers whose will be using yours module in theirs own programms.
+ * @return <i><b>EngineModule</b></i> :: Structure EngineModule which members are functions for basic operations for this module
+ */
+extern EngineModule engine_global_functions(void);
+
+#ifdef __cplusplus
+}                                      
+#endif                         // END OF:      extern "C" {
+#endif                         // END OF:      _DICTIONARY_ENGINE_BASE
diff --git a/engine/include/engine_xdxf.h b/engine/include/engine_xdxf.h
new file mode 100644 (file)
index 0000000..3130760
--- /dev/null
@@ -0,0 +1,95 @@
+/************************************************************************************************
+This file is part of WhiteStork.
+
+WhiteStork is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2 of the License, or
+(at your option) any later version.
+
+WhiteStork is distributed in the hope that it will be useful, 
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+GNU General Public License for more details.
+
+You should have received a copy of the GNU General Public License 
+along with WhiteStork; if not, write to the Free Software
+Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+
+Copyright 2006 ComArch S.A.
+************************************************************************************************/
+#ifndef _DICTIONARY_ENGINE_XDXF
+#define _DICTIONARY_ENGINE_XDXF
+
+#include <stdio.h>
+#include <expat.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <sys/time.h>
+#include <fcntl.h>     
+#include <unistd.h>   
+
+
+#include "dictionary_engine.h"
+
+#define DIC_ENG_VERSION "0.1a"
+#define DIC_ENG_FORMAT  "XDXF"
+
+#define _BUFFER_CHECK_SIZE 1024
+#define _BUFFER_CACHEING_SIZE 1024
+#define _BUFFER_INDEX_SIZE 16*1024
+
+struct _XDXFCheckingData {
+       int deep;
+       gboolean good;  
+};
+typedef struct _XDXFCheckingData XDXFCheckingData;
+
+struct _XDXFChacheData {
+       gchar* buffer;
+       long last_start;
+       long last_stop; 
+       long last_length;
+       int output_file;
+       XML_Parser p;
+       int state;
+};
+typedef struct _XDXFChacheData XDXFChacheData;
+
+
+struct _XDXFData {
+       gchar*          location;
+       int             xdxf;
+       int             cache;
+
+       gpointer word_list;
+       gpointer translation;
+
+       EngineStatus    error;
+       cb_word_list            callback_on_word_list;
+       cb_word_translation     callback_on_word_translation;
+};
+typedef struct _XDXFData XDXFData;
+
+
+// helpfull functions
+gdouble time_info(struct timeval *y, gchar* message);
+
+// declarations of functions
+gboolean       check_compatibilit_xdxf(gchar* location);
+gchar*                 get_engine_descritpion();
+gchar*                 get_engine_format();
+gchar*                 get_engine_version();
+
+gchar*         get_location(Engine* engine);
+gboolean       is_cached(Engine* engine);
+void           do_cache(Engine* engine);
+void           search_word_list(Engine* engine, gchar* pattern);
+void           search_word_translation(Engine* engine, gchar* word);
+void           search_word_translationHTML(Engine* engine, gchar* word);
+gchar*         error_message(EngineStatus error);
+gpointer       set_callbacks(Engine* engine, gchar* event, gpointer new_funtions, gpointer user_data);
+void           close_engine(Engine* engine);
+Engine*        create_engine(gchar* location, EngineOptimizationFlag auto_cache);
+EngineModule   engine_global_functions();
+
+#endif
diff --git a/engine/makefile b/engine/makefile
new file mode 100644 (file)
index 0000000..ce47ebc
--- /dev/null
@@ -0,0 +1,41 @@
+COMPILER = gcc
+DEBUG = -Wall
+LIBS = `pkg-config --libs glib-2.0 gmodule-2.0 ` -lexpat
+FLAGS = `pkg-config --cflags glib-2.0 gmodule-2.0`
+SOURCES = src
+INCLUDE = include
+BINARIES = bin
+EXECUTABLE = ${SOURCES}/test_engin
+
+${EXECUTABLE}: ${BINARIES}/engine_xdxf.o ${INCLUDE}/dictionary_engine.h                        
+               @echo -e -n   "| Linking engine-xdxf to dynamic library...                                          |\n"
+               @gcc -shared -fPIC ${FLAGS} ${LIBS} ${BINARIES}/engine_xdxf.o -o ${SOURCES}/engine_xdxf.so
+               @echo -e -n   "| Building engine_xdxf module done...                                                |\n"
+               @echo -e -n   "+------------------------------------------------------------------------------------+\n\n"
+               @cp ${SOURCES}/engine_xdxf.so ../bin
+
+
+${BINARIES}/engine_xdxf.o: ${SOURCES}/engine_xdxf.c ${INCLUDE}/engine_xdxf.h
+               @echo -e -n "\n+---------------- ENGINE XDXF -------------------------------------------------------+\n"
+               @echo -e -n   "| Compiling engine_xdxf module => engine_xdxf.o ...                                  |\n"
+               @gcc ${FLAGS} -c -fPIC ${SOURCES}/engine_xdxf.c -o ${BINARIES}/engine_xdxf.o
+
+test: test.o
+               @echo "Linking test program..."
+               @gcc ${LIBS} ${DEBUG} -o ${SOURCES}/test ${BINARIES}/test.o
+               @echo -e "Building test program finished.\n"
+test.o:
+               @echo "Compiling test program..."
+               @gcc ${FLAGS} ${DEBUG} -c -o ${BINARIES}/test.o ${SOURCES}/test.c
+
+check:
+               @echo "Running test program:"
+               @${SOURCES}/test
+
+clean :
+               @rm -f ${BINARIES}/*
+               @rm -f ${SOURCES}/test
+               @rm -f ${SOURCES}/*~
+               @rm -f *~
+               @rm -f ${INCLUDE}/*~
+               @rm -f ${SOURCES}/engine_xdxf.so
\ No newline at end of file
diff --git a/engine/src/engine_xdxf.c b/engine/src/engine_xdxf.c
new file mode 100644 (file)
index 0000000..8daff5c
--- /dev/null
@@ -0,0 +1,611 @@
+/************************************************************************************************
+This file is part of WhiteStork.
+
+WhiteStork is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2 of the License, or
+(at your option) any later version.
+
+WhiteStork is distributed in the hope that it will be useful, 
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+GNU General Public License for more details.
+
+You should have received a copy of the GNU General Public License 
+along with WhiteStork; if not, write to the Free Software
+Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+
+Copyright 2006 ComArch S.A.
+************************************************************************************************/
+#include "../include/engine_xdxf.h"
+
+//**************************************************** DONE
+gdouble time_info(struct timeval *y, gchar* message)
+{
+       struct timeval result;
+       struct timeval x;
+       gettimeofday(&x,NULL);
+       if (x.tv_usec < y->tv_usec) {
+               int nsec = (y->tv_usec - x.tv_usec) / 1000000 + 1;
+               y->tv_usec -= 1000000 * nsec;
+               y->tv_sec += nsec;
+       }
+       if (x.tv_usec - y->tv_usec > 1000000) {
+               int nsec = (y->tv_usec - x.tv_usec) / 1000000;
+               y->tv_usec += 1000000 * nsec;
+               y->tv_sec -= nsec;
+       }
+       
+       result.tv_sec = x.tv_sec - y->tv_sec;
+       result.tv_usec = x.tv_usec - y->tv_usec;
+       
+
+       double ta = (((double)(result.tv_usec)) / 1e6) + ((double)(result.tv_sec));
+       g_printf("+   XDXF(fun=%s): function %s () was working for: %g [s] or %ld [us].\n",__FUNCTION__,message,ta,((long)(result.tv_sec*1e6)+(result.tv_usec)));
+       return ta;
+}
+
+
+static void checking_expat_start(void *data, const char *el, const char **attr) 
+{
+       XDXFCheckingData* loc_data = (XDXFCheckingData*)data;
+       static int count = 0;
+       count++;
+       
+       if((count == 1) && (g_ascii_strcasecmp(el,"xdxf")!=0))
+       {
+               g_printf("+   XDXF(fun=%s): CHECK: first element: %s\n",__FUNCTION__,el);
+               loc_data->good = FALSE;
+       }
+       loc_data->deep++;
+}
+
+static void checking_expat_end(void *data, const char *el) 
+{
+       XDXFCheckingData* loc_data = (XDXFCheckingData*)data;
+       loc_data->deep--;
+}
+
+
+
+
+
+static void cacheing_expat_start(void *data, const char *el, const char **attr) {
+       XDXFChacheData* loc_data = (XDXFChacheData*)data;
+       if(el[0] == 'a' && el[1]=='r' && el[2]=='\0') 
+       {
+               loc_data->last_start = XML_GetCurrentByteIndex(loc_data->p);
+       }
+       else if(el[0] == 'k' && el[1]=='\0') 
+       {
+               loc_data->state = 1;
+       }
+       else 
+       {
+               loc_data->state = 0;
+       }       
+}
+
+static void cacheing_expat_end(void *data, const char *el) {
+       XDXFChacheData* loc_data = (XDXFChacheData*)data;
+       loc_data->last_stop = XML_GetCurrentByteIndex(loc_data->p);
+       
+       static int record_length;
+       static int start;
+       static int length;
+       static int buffer_length;
+
+       if(el[0] == 'k' && el[1]=='\0' && loc_data->state==1)
+       { 
+               loc_data->state = 2;
+       }     
+       else if(el[0] == 'a' && el[1]=='r' && el[2]=='\0' && loc_data->state==2)
+       {
+               buffer_length = strlen(loc_data->buffer);
+               record_length = sizeof(int)*3 + buffer_length;
+               start = loc_data->last_start;
+               length = loc_data->last_stop + 5 - loc_data->last_start;
+               
+               write(loc_data->output_file,&record_length,sizeof(int));
+               write(loc_data->output_file,loc_data->buffer,buffer_length);
+               write(loc_data->output_file,&start,sizeof(int));
+               write(loc_data->output_file,&length,sizeof(int));
+               //g_printf("-------> loc_data File pointer is: %d\n",(int)(loc_data->output_file));
+
+               loc_data->buffer[0] = '\0'; //"clear" buffer
+               loc_data->state = 0;
+       }
+}
+
+static void cacheing_expat_text(void *data, const XML_Char *txt, int len) {
+       XDXFChacheData* loc_data = (XDXFChacheData*)data;
+       static int len0;
+       if(loc_data->state==1) {
+               len0 = strlen(loc_data->buffer);
+               memcpy(&(loc_data->buffer[len0]),(char*)txt,len);
+               len0 += len;
+               loc_data->buffer[len0] = '\0';      
+       }
+}
+
+int get_max_length(gchar* a, gint dlugosc) {
+       gchar* b = a;
+       gint len = 0;
+       gint n = 0;
+       
+       memcpy(&n,b,sizeof(int));
+       while(len + n <= dlugosc-4) {
+               len = len + n;
+               b = b+n;
+               memcpy(&n,b,sizeof(int));
+       }
+       return len;
+}
+
+
+
+
+
+
+
+
+
+
+
+
+//***************************************************** DONE
+gboolean check_compatibilit_xdxf(gchar* location) 
+{      
+       struct timeval t0;
+       gettimeofday(&t0,NULL);
+       g_printf("+   XDXF: function \'%s()\' called.\n",__FUNCTION__);
+       gboolean good = FALSE;
+       gchar* loc = g_strconcat(location,NULL);
+       gchar* file_path = NULL;
+       gchar* file_name = "dict.xdxf";
+       gchar* full_name = NULL;
+       XML_Parser p;
+       XDXFCheckingData data;
+               data.deep = 0;
+               data.good = TRUE;
+
+
+       int file = 0;
+       while(TRUE) {   // we can break loop in every moment, and ther is possible to do something after that (with return there is no such option)             
+               g_strstrip(loc);        // clearnig location string
+       
+               if((loc == NULL) || (g_file_test(loc,G_FILE_TEST_EXISTS) == FALSE)) // location is not specified or it it is not a file/dictionary
+               {
+                       g_free(loc);
+                       return FALSE;
+               };
+               
+               if(g_file_test(loc,G_FILE_TEST_IS_REGULAR) == TRUE) // getting file path and file name (programmer could pass path or full filename to dictionary)
+               {
+                       if(g_str_has_suffix (loc,"/dict.xdxf") == FALSE)
+                       {
+                               g_free(loc);
+                               return FALSE;
+                       }
+                       file_path =  g_strndup(loc,strlen(loc)-10);
+               }
+               else if(g_file_test(loc,G_FILE_TEST_IS_DIR) == TRUE)
+               {
+                       if(g_str_has_suffix(loc,"/") == TRUE)
+                       {
+                               file_path = g_strconcat(loc,NULL);
+                       }
+                       else
+                       {
+                               file_path = g_strconcat(loc,"/",NULL);
+                       }
+               }
+               g_printf("+   XDXF(fun=%s): File path is: %s\n",__FUNCTION__,file_path);
+               g_printf("+   XDXF(fun=%s): File name is: %s\n",__FUNCTION__,file_name);
+               
+               full_name = g_strconcat(file_path,"/",file_name,NULL); // checking if file is in correct format, is possible to open it etc.
+               file =  open(full_name,O_RDONLY);
+               if(file == -1) 
+               {
+                       g_printf("+   XDXF(fun=%s): System could not read a file!",__FUNCTION__);
+                       break;
+               }
+               struct stat file_details;
+               fstat(file,&file_details);      
+               glong size = (long)(file_details.st_size);
+
+               g_printf("+   XDXF(fun=%s): Dictionary size is : %.2f kB [%d bytes = %0.2f MB].\n",__FUNCTION__,((float)size)/1024.0,(int)size,((float)size)/1024.0/1024.0);
+               p = XML_ParserCreate(NULL);
+               XML_SetUserData(p,(void*)&data);
+               XML_SetElementHandler(p, checking_expat_start, checking_expat_end);
+               gint len = 0;
+               gchar buffer[_BUFFER_CHECK_SIZE];
+               while(TRUE) {
+                       len = (gint)read(file, (void*)buffer, _BUFFER_CHECK_SIZE);
+                       XML_Parse(p,buffer,len,len<_BUFFER_CHECK_SIZE);        
+                       if(len < _BUFFER_CHECK_SIZE) break;
+               };              
+               if(data.deep != 0)
+               {
+                       break;
+               }
+               
+               good = TRUE;
+
+       
+               break;
+       }
+       
+       
+
+       if(loc != NULL)         g_free(loc);
+       if(file_path != NULL)   g_free(file_path);
+       if(full_name != NULL)   g_free(full_name);
+       if(file > 0)            close(file);
+       time_info(&t0,"check_compatibilit_xdxf");
+       return good;
+}
+
+
+
+//******************************************** DONE
+gchar*
+get_engine_descritpion() 
+{
+       g_printf("+   XDXF: function \'%s()\' called.\n",__FUNCTION__);
+       gchar* result =  g_strconcat(   "This module operates on ",
+                                       get_engine_format(),
+                                       " dictionaries. Version: ",
+                                       get_engine_version(),
+                                       ".",NULL);
+       return result;
+}
+
+//******************************************** DONE
+gchar*
+get_engine_format() 
+{
+       g_printf("+   XDXF: function \'%s()\' called.\n",__FUNCTION__);
+       gchar* result = DIC_ENG_FORMAT;
+       return result;
+}
+
+//******************************************** DONE
+gchar*
+get_engine_version() 
+{
+       g_printf("+   XDXF: function \'%s()\' called.\n",__FUNCTION__);
+       gchar* result = DIC_ENG_VERSION;
+       return result;
+}
+
+//******************************************** DONE
+gchar*
+get_location(Engine* engine)
+{
+       g_printf("+   XDXF: function \'%s()\' called.\n",__FUNCTION__);
+       XDXFData* data = (XDXFData*)(engine->engine_data);
+
+       gchar* result = g_strndup(data->location,g_strlen(data->location));
+       return result;
+}
+
+//******************************************** DONE
+gboolean
+is_cached(Engine* engine) 
+{
+       g_printf("+   XDXF: function \'%s()\' called.\n",__FUNCTION__);
+       XDXFData* data = (XDXFData*)(engine->engine_data);
+       if(data->cache < 1) 
+       {
+               return FALSE;
+       }
+       return TRUE;
+}
+
+//********************************************* DONE
+void
+do_cache(Engine* engine)
+{
+       struct timeval t0;
+       gettimeofday(&t0,NULL);
+       g_printf("+   XDXF: function \'%s()\' called.\n",__FUNCTION__);
+       XDXFData* data = (XDXFData*)(engine->engine_data);
+       XML_Parser p;
+
+       gchar* file_path = g_strconcat(data->location,"/dict.xdxf",NULL);
+       if((data->xdxf = open(file_path,O_RDONLY)) == -1) {
+               printf("+   XDXF(fun=%s): Error: in call open(dict.xdxf) function.\n",__FUNCTION__);
+       }
+       
+       g_free(file_path);
+       file_path = g_strconcat(data->location,"/dict.cache",NULL);
+       if((data->cache = open(file_path,O_WRONLY | O_CREAT | O_TRUNC,0666)) == -1) {
+               printf("+   XDXF(fun=%s): Error: in second call open(dict.cache) function. Code %d\n",__FUNCTION__,data->cache);
+       }
+       g_free(file_path);
+       
+       XDXFChacheData *c_data = (XDXFChacheData*)g_try_malloc(sizeof(XDXFChacheData));
+       c_data->output_file = data->cache;
+       c_data->buffer = (gchar*)g_try_malloc(_BUFFER_CACHEING_SIZE* sizeof(gchar));
+       c_data->buffer[0] = '\0';
+       c_data->last_stop = 0;
+       c_data->last_start = 0;
+       c_data->last_length = 0;
+
+       gchar b[_BUFFER_CACHEING_SIZE+1];
+       c_data->p = XML_ParserCreate(NULL);                         
+   
+       struct stat   file_details;
+       fstat(data->xdxf,&file_details);
+       long size = (long)(file_details.st_size);
+       printf("\n+   XDXF(fun=%s): Dictionary size is : %.2f kB [%d bytes = %0.2f MB].\n",__FUNCTION__,((float)size)/1024.0,(int)size,((float)size)/1024.0/1024.0);     
+
+       XML_SetUserData(c_data->p,(void*)c_data);
+       XML_SetElementHandler(c_data->p, cacheing_expat_start, cacheing_expat_end);
+       XML_SetCharacterDataHandler(c_data->p,cacheing_expat_text);
+
+
+       int len = _BUFFER_CACHEING_SIZE;   
+
+       while(TRUE) {
+               len = (int)read(data->xdxf, (void*)b, _BUFFER_CACHEING_SIZE);
+               XML_Parse(c_data->p,b,len,len<_BUFFER_CACHEING_SIZE);   
+               //g_printf("Rozmiar zczytany=%d natomaist docelowy=%d\n",len,_BUFFER_CACHEING_SIZE);     
+               if(len < _BUFFER_CACHEING_SIZE) break;
+       };
+
+
+       fsync(data->xdxf); 
+       fsync(data->cache);
+       
+       XML_ParserFree(c_data->p);
+       close(data->xdxf);
+       close(data->cache);
+       
+       g_free(c_data->buffer);
+       g_free(c_data);
+       time_info(&t0,"do_cache");
+}
+
+
+
+
+void
+search_word_list(Engine* engine, gchar* pattern)
+{
+       struct timeval t0;
+       gettimeofday(&t0,NULL);
+       g_printf("+   XDXF: function \'%s()\' called.\n",__FUNCTION__);
+       XDXFData* data = (XDXFData*)(engine->engine_data);
+       
+       gchar state = 0;
+       gchar buffer[_BUFFER_INDEX_SIZE]; 
+       gint len = _BUFFER_INDEX_SIZE;
+       gint max_len;
+       gint already = 0;   
+       gint record_length = 0;
+       gint start = 0;
+       gint length = 0;
+       gchar *buf;
+       glong wczytano = 0;
+       gchar* path = g_strconcat(data->location,"/dict.cache",NULL);
+       int file = open(path,O_RDONLY);
+
+       struct stat   file_details;
+       fstat(file,&file_details);
+       long size = (long)(file_details.st_size);
+
+       GArray* result = g_array_new(TRUE,FALSE,sizeof(gchar*));
+       while(TRUE) {
+               len = (int)read(file, (void*)buffer, _BUFFER_INDEX_SIZE);               
+               max_len = get_max_length(buffer,len);
+               wczytano = wczytano + max_len;
+               buf = buffer;
+               already = 0;
+               while(already < max_len) {
+                       memcpy(&record_length,buf,sizeof(int));
+                       //printf("po wpisaniu: %d\n",record_length);
+                       if ((record_length - 3*sizeof(int) >= strlen(pattern)) && 
+                       (g_ascii_strncasecmp( buf+sizeof(int), pattern, strlen(pattern)) == 0))
+                       {
+                               memcpy(&start,buf+record_length-2*sizeof(int),sizeof(int));
+                               memcpy(&length,buf+record_length-sizeof(int),sizeof(int));
+                               //printf("\nWord \'%s\' found at position %d, and has length=%d.\n",argv[1],start,length);              
+                               gchar* new = g_strndup(buf+sizeof(int),record_length - 3*sizeof(int));
+                               g_array_append_val (result, new);
+                       }
+                       already += record_length;
+                       buf = buf + record_length;
+               } 
+               if((len < _BUFFER_INDEX_SIZE) || (wczytano > size-3)) {
+                       break;
+               }
+               lseek(file,max_len - _BUFFER_INDEX_SIZE,SEEK_CUR);
+       };
+       
+       //int i = 0;
+       //while(g_array_index(result, gchar*, i) != NULL) 
+       //{
+       //      g_printf("Znalezione slowo: %s\n",g_array_index(result, gchar*, i++));
+       //}
+       g_printf("\n+   XDXF(fun=%s): before calling callbacks for WORD_LIST\n==========================================================:\n",__FUNCTION__);
+       data->callback_on_word_list(result,pattern,data->word_list,ENGINE_NO_ERROR);
+       g_printf("\n===========================================================|\n+   XDXF(fun=%s): after calling callbacks for WORD_LIST\n",__FUNCTION__);
+
+       fsync(file);            // to make sure that nothing is in the 'built-in' buffer
+       close(file);
+
+       time_info(&t0,"search_word_list");      
+}
+
+void
+search_word_translation(Engine* engine, gchar* word)
+{
+       g_printf("+   XDXF: function \'%s()\' called.\n",__FUNCTION__);
+       struct timeval t0;
+       gettimeofday(&t0,NULL);
+       XDXFData* data = (XDXFData*)(engine->engine_data);
+       
+       gchar state = 0;
+       gchar buffer[_BUFFER_INDEX_SIZE]; 
+       gint len = _BUFFER_INDEX_SIZE;
+       gint max_len;
+       gint already = 0;   
+       gint record_length = 0;
+       gint start = 0;
+       gint length = 0;
+       gchar *buf;
+       glong wczytano = 0;
+       gchar* path = g_strconcat(data->location,"/dict.cache",NULL);
+       int file = open(path,O_RDONLY);
+       gboolean further = TRUE;
+       struct stat   file_details;
+       fstat(file,&file_details);
+       long size = (long)(file_details.st_size);
+
+       GArray* result = g_array_new(TRUE,FALSE,sizeof(gchar*));
+       gchar* new = NULL;
+       while(further) {
+               len = (int)read(file, (void*)buffer, _BUFFER_INDEX_SIZE);               
+               max_len = get_max_length(buffer,len);
+               wczytano = wczytano + max_len;
+               buf = buffer;
+               already = 0;
+               while(already < max_len) {
+                       memcpy(&record_length,buf,sizeof(int));
+                       //printf("po wpisaniu: %d\n",record_length);
+                       if ((record_length - 3*sizeof(int) == strlen(word)) && 
+                                                 (g_ascii_strncasecmp( buf+sizeof(int), word, strlen(word)) == 0))
+                       {
+                               memcpy(&start,buf+record_length-2*sizeof(int),sizeof(int));
+                               memcpy(&length,buf+record_length-sizeof(int),sizeof(int));
+                               //printf("\nWord \'%s\' found at position %d, and has length=%d.\n",argv[1],start,length);              
+                               gchar* source_path = g_strconcat(data->location,"/dict.xdxf",NULL);
+                               int source = open(source_path,O_RDONLY);
+                               lseek(source,start,SEEK_SET);
+                               new =  g_strnfill(length+1,'\0');
+                               read(source,(void*)new,length);
+                               further = FALSE;
+                               break;
+                       }
+                       already += record_length;
+                       buf = buf + record_length;
+               } 
+               if((len < _BUFFER_INDEX_SIZE) || (wczytano > size-3)) {
+                       break;
+               }
+               lseek(file,max_len - _BUFFER_INDEX_SIZE,SEEK_CUR);
+       };
+
+       fsync(file);            // to make sure that nothing is in the 'built-in' buffer
+       close(file);
+
+       time_info(&t0,"search_word_translation");
+       
+       data->callback_on_word_translation(new,word,data->translation,ENGINE_NO_ERROR);
+}
+
+void
+search_word_translationHTML(Engine* engine, gchar* word)
+{
+       g_printf("+   XDXF: function \'%s()\' called.\n",__FUNCTION__);
+}
+
+gchar*  
+error_message(EngineStatus error) 
+{
+       g_printf("+   XDXF: function \'%s()\' called.\n",__FUNCTION__);
+       return "Error";
+}
+
+gpointer 
+set_callbacks(Engine* engine, gchar* signal, gpointer c_handler, gpointer user_data)
+{
+       g_printf("+   XDXF: function \'%s()\' called.\n",__FUNCTION__);
+       XDXFData* data = (XDXFData*)(engine->engine_data);
+       if(g_ascii_strcasecmp(signal,ENGINE_WORD_LIST_SIGNAL)==0) {
+               gpointer old = (gpointer)(data->callback_on_word_list);
+               data->callback_on_word_list = (cb_word_list)(c_handler);
+               data->word_list = user_data;
+               g_printf("+   XDXF(fun=%s): Callback for signal %s set.\n",__FUNCTION__,ENGINE_WORD_LIST_SIGNAL);
+       }
+       else if(g_ascii_strcasecmp(signal,ENGINE_WORD_TRANSLATION_SIGNAL)==0) {
+               gpointer old = (gpointer)(data->callback_on_word_translation);
+               data->callback_on_word_translation = (cb_word_translation)(c_handler);
+               data->translation = user_data;
+               g_printf("+   XDXF(fun=%s): Callback for signal %s set.\n",__FUNCTION__,ENGINE_WORD_TRANSLATION_SIGNAL);
+       };
+       return NULL;
+}
+
+//******************************************************** DONE
+void 
+close_engine(Engine* engine)
+{
+       g_printf("+   XDXF: function \'%s()\' called.\n",__FUNCTION__);
+       XDXFData* data = (XDXFData*)(engine->engine_data);      
+       close(data->xdxf);
+       close(data->cache);
+       g_free(data->location);
+       g_free(engine->engine_data);
+}
+
+//******************************************************** DONE
+int engine_error(Engine* engine) {
+       g_printf("+   XDXF: function \'%s()\' called.\n",__FUNCTION__);
+       XDXFData* data = (XDXFData*)(engine->engine_data);
+       return (int)(data->error);
+}
+
+//******************************************************** DONE
+Engine* 
+create_engine( gchar* location,
+               EngineOptimizationFlag auto_cache)
+{
+       struct timeval t0;
+       gettimeofday(&t0,NULL);
+       g_printf("+   XDXF: function \'%s()\' called.\n",__FUNCTION__);
+       Engine *result = g_try_malloc(sizeof(Engine));
+
+       result->engine_location = get_location;
+       result->engine_is_optimized = is_cached;
+       result->engine_optimize = do_cache;
+       result->engine_search_word_list = search_word_list;
+       result->engine_search_word_translation = search_word_translation;
+       result->engine_search_word_translation_extended = search_word_translationHTML;
+       result->engine_set_callback = set_callbacks;
+       result->engine_close = close_engine;    
+
+       result->engine_error_message = error_message;
+       result->engine_error = engine_error;
+
+       result->engine_data = NULL;
+       XDXFData* data = (XDXFData*)g_try_malloc(sizeof(XDXFData));     
+       data->location = g_strconcat(location,NULL);
+       data->xdxf = (int)open(data->location,O_RDONLY);
+       //g_printf("XDXF file status after creating: %d\n",data->xdxf);
+       close(data->xdxf);
+       data->cache = 0;
+       data->error = ENGINE_NO_ERROR;
+       result->engine_data = data;
+
+       time_info(&t0,"create_engine");
+       return result;
+}
+
+
+// ********************************************************* DONE
+EngineModule
+engine_global_functions()
+{
+       g_printf("+   XDXF: function \'%s()\' called.\n",__FUNCTION__);
+       EngineModule    result; 
+       result.engine_check       = check_compatibilit_xdxf;
+       result.engine_description = get_engine_descritpion;
+       result.engine_format      = get_engine_format;
+       result.engine_version     = get_engine_version;
+       result.engine_create      = create_engine;
+       return result;
+}
+
diff --git a/gui/makefile b/gui/makefile
new file mode 100644 (file)
index 0000000..cbf101e
--- /dev/null
@@ -0,0 +1,45 @@
+CC = gcc
+DEBUG = -g -Wall
+EXECUTABLE = gui
+CFLAGS = `pkg-config --cflags gtk+-2.0 libgtkhtml-3.8 hildon-libs glib-2.0 libosso`
+LIBS = `pkg-config --libs gtk+-2.0 libgtkhtml-3.8 hildon-libs glib-2.0 libosso` 
+
+SOURCES = src
+INCLUDE = ../include
+BINARIES = ../bin
+
+${EXECUTABLE}: ${BINARIES}/ws_gui.o ${BINARIES}/ws_gui_callbacks.o ${BINARIES}/ws_gui_layout.o ${BINARIES}/ws_dbus.o
+               @${CC} ${DEBUG}   -o ${BINARIES}/${EXECUTABLE} ${BINARIES}/ws_gui.o ${BINARIES}/ws_gui_callbacks.o ${BINARIES}/ws_gui_layout.o ${BINARIES}/ws_dbus.o ${LIBS} ${CFLAGS}
+
+${BINARIES}/ws_gui.o: ${SOURCES}/ws_gui.c ${INCLUDE}/ws_gui.h ${INCLUDE}/ws_gui_callbacks.h ${INCLUDE}/ws_gui_layout.h ${INCLUDE}/ws_dbus.h
+               @${CC} ${DEBUG} -c ${SOURCES}/ws_gui.c -o ${BINARIES}/ws_gui.o ${CFLAGS}
+
+${BINARIES}/ws_gui_callbacks.o: ${SOURCES}/ws_gui_callbacks.c ${INCLUDE}/ws_gui_callbacks.h ${INCLUDE}/ws_gui.h ${INCLUDE}/ws_dbus.h
+               @${CC} ${DEBUG} -c ${SOURCES}/ws_gui_callbacks.c -o ${BINARIES}/ws_gui_callbacks.o ${CFLAGS}
+
+${BINARIES}/ws_gui_layout.o: ${SOURCES}/ws_gui_layout.c ${INCLUDE}/ws_gui_layout.h ${INCLUDE}/ws_gui.h ${INCLUDE}/ws_dbus.h
+               @${CC} ${DEBUG} -c ${SOURCES}/ws_gui_layout.c -o ${BINARIES}/ws_gui_layout.o ${CFLAGS}
+
+${BINARIES}/ws_dbus.o:
+               cd ../dbus && make
+
+
+
+dyn:
+               ${BINARIES}/wsl_gui.o ${BINARIES}/wsl_gui_callbacks.o ${BINARIES}/wsl_gui_layout.o 
+               ${CC} ${DEBUG} -shared -fPIC -o ${EXECUTABLE}.so ${BINARIES}/wsl_gui.o ${BINARIES}/wsl_gui_callbacks.o ${BINARIES}/wsl_gui_layout.o dbus/ws_dbus.o ${LIBS} ${CFLAGS}
+
+${BINARIES}/wsl_gui.o: ${SOURCES}/ws_gui.c ${INCLUDE}/ws_gui.h ${INCLUDE}/ws_gui_callbacks.h ${INCLUDE}/ws_gui_layout.h ${INCLUDE}/ws_dbus.h
+               ${CC} ${DEBUG} -fPIC -c ${SOURCES}/ws_gui.c -o ${BINARIES}/wsl_gui.o ${CFLAGS}
+
+${BINARIES}/wsl_gui_callbacks.o: ${SOURCES}/ws_gui_callbacks.c ${INCLUDE}/ws_gui_callbacks.h ${INCLUDE}/ws_gui.h ${INCLUDE}/ws_dbus.h
+               ${CC} ${DEBUG} -fPIC -c ${SOURCES}/ws_gui_callbacks.c -o ${BINARIES}/wsl_gui_callbacks.o ${CFLAGS}
+
+${BINARIES}/wsl_gui_layout.o: ${SOURCES}/ws_gui_layout.c ${INCLUDE}/ws_gui_layout.h ${INCLUDE}/ws_gui.h ${INCLUDE}/ws_dbus.h
+               ${CC} ${DEBUG} -fPIC -c ${SOURCES}/ws_gui_layout.c -o ${BINARIES}/wsl_gui_layout.o ${CFLAGS}
+
+
+clean:
+       rm -f ${BINARIES}/*.o
+       rm -f ${EXECUTABLE}
+       @echo "done"
diff --git a/gui/src/ikona.png b/gui/src/ikona.png
new file mode 100644 (file)
index 0000000..6af3061
Binary files /dev/null and b/gui/src/ikona.png differ
diff --git a/gui/src/ws_gui.c b/gui/src/ws_gui.c
new file mode 100644 (file)
index 0000000..6859034
--- /dev/null
@@ -0,0 +1,62 @@
+/*****************
+* Copyright 2006, ComArch S.A
+* All rights reserved
+*****************/
+
+#include "../../include/ws_gui.h"
+#include "../../include/ws_gui_callbacks.h"
+#include "../../include/ws_gui_layout.h"
+/*#include "../dbus/ws_dbus.h"*/
+
+//int ws_gui_init(int argc, char *argv[])
+int main(int argc, char *argv[])
+{      
+       gtk_init(&argc, &argv);
+       
+       WSGuiApp *ws_gui_app;
+       ws_gui_app = (WSGuiApp*)g_malloc(sizeof(WSGuiApp));     
+       
+       ws_gui_app->ws_gui_w_list = (struct WSGuiList*)g_malloc(sizeof(struct WSGuiList));
+       ws_gui_app->ws_gui_menu = (struct WSGuiMenu*)g_malloc(sizeof(struct WSGuiMenu));
+       
+       ws_gui_create_window(ws_gui_app);
+       ws_gui_read_adjustment(ws_gui_app);
+
+       /*do dbusa*/    
+       ws_gui_app->dbus_data = ws_dbus_create ("WhiteStorkGui", "v1.0");
+
+       ws_dbus_config (ws_gui_app->dbus_data, WS_DBUS_CONFIG_SERVICE, "org.maemo.WhiteStorkGui");
+       ws_dbus_config (ws_gui_app->dbus_data, WS_DBUS_CONFIG_OBJECT, "/org/maemo/WhiteStorkGui");
+       ws_dbus_config (ws_gui_app->dbus_data, WS_DBUS_CONFIG_IFACE, "org.maemo.WhiteStorkGui");
+       ws_dbus_config (ws_gui_app->dbus_data, WS_DBUS_CONFIG_REMOTE_SERVICE, "org.maemo.WhiteStorkManager");
+       ws_dbus_config (ws_gui_app->dbus_data, WS_DBUS_CONFIG_REMOTE_OBJECT, "/org/maemo/WhiteStorkManager");
+       ws_dbus_config (ws_gui_app->dbus_data, WS_DBUS_CONFIG_REMOTE_IFACE, "org.maemo.WhiteStorkManager");
+       
+       ws_dbus_connect (ws_gui_app->dbus_data);
+       
+       ws_dbus_set_cb (ws_gui_app->dbus_data, "return_words", ws_gui_dbus_return_words, ws_gui_app);
+
+       ws_dbus_set_cb (ws_gui_app->dbus_data, "return_translations", ws_gui_dbus_return_translation, ws_gui_app);
+
+       ws_dbus_set_cb (ws_gui_app->dbus_data, "signal", ws_gui_signal_hander, ws_gui_app);
+
+       /*g_signal_connect(GTK_OBJECT(ws_gui_app->ws_gui_w_list->ws_gui_list), "selection-changed", G_CALLBACK(ws_gui_list_item_selection), ws_gui_app);*/
+       
+       g_signal_connect(GTK_OBJECT(ws_gui_app->ws_gui_w_list->ws_gui_list), "select-child", G_CALLBACK(ws_gui_list_item_select), ws_gui_app);
+       
+       g_signal_connect(G_OBJECT(ws_gui_app->ws_gui_html), "button-press-event", G_CALLBACK(ws_gui_button_press_event), ws_gui_app);
+
+       g_signal_connect(G_OBJECT(ws_gui_app->ws_gui_hildon_window), "key-press-event", G_CALLBACK(hildon_key_press_listener), ws_gui_app);
+       
+       g_signal_connect(G_OBJECT(ws_gui_app->ws_gui_vadj), "value-changed", G_CALLBACK(ws_gui_adjustment_changed), ws_gui_app);
+       g_signal_connect(G_OBJECT(ws_gui_app->ws_gui_hadj), "value-changed", G_CALLBACK(ws_gui_adjustment_changed), ws_gui_app);
+
+       g_signal_connect(G_OBJECT(ws_gui_app->ws_gui_hildon_window), "delete-event", G_CALLBACK(ws_gui_on_exit), ws_gui_app);
+
+       gtk_main();
+       
+       ws_gui_free_memory(ws_gui_app);
+       
+       return 0;
+}
+
diff --git a/gui/src/ws_gui_callbacks.c b/gui/src/ws_gui_callbacks.c
new file mode 100644 (file)
index 0000000..16919cc
--- /dev/null
@@ -0,0 +1,657 @@
+/*****************
+* Copyright 2006, ComArch S.A
+* All rights reserved
+*****************/
+
+#include "../../include/ws_gui_callbacks.h"
+#include "../../include/ws_gui.h"
+#include "../../include/ws_gui_layout.h"
+#include "../../include/ws_dbus.h"
+
+/** \brief show how much time did take a callback of another function
+ *
+ */
+static double timer(gboolean start, gchar* message)
+{
+       static GArray* stack = NULL;
+       static gboolean first_run = TRUE;
+       static struct timeval actual_time;
+       static struct timeval last_time;
+       static struct timeval result;
+       static double seconds = 0.0;
+       if(first_run)   
+       {
+               first_run = FALSE;
+               //g_debug("XDXF->%s() - TOP OF THE STACK!\n",__FUNCTION__);
+               stack = g_array_new(TRUE, TRUE, sizeof(struct timeval));
+       };      
+
+       if (start)      // things to do on the beggining of function's work
+       {
+               g_debug("XDXF->%s() start counting time for function '%s()'.\n",__FUNCTION__,message);
+               g_array_prepend_val(stack, actual_time);
+               gettimeofday(&g_array_index(stack, struct timeval, 0),NULL);
+               return -1.0;
+       }
+       else {          // we just want to end some timer - print some information about working time;
+               gettimeofday(&actual_time,NULL);
+               last_time = g_array_index(stack, struct timeval, 0);
+               g_array_remove_index(stack, 0);
+
+               if (actual_time.tv_usec < last_time.tv_usec) {
+                       int nsec = (last_time.tv_usec - actual_time.tv_usec) / 1000000 + 1;
+                       last_time.tv_usec -= 1000000 * nsec;
+                       last_time.tv_sec += nsec;
+               }
+               if (actual_time.tv_usec - last_time.tv_usec > 1000000) {
+                       int nsec = (last_time.tv_usec - actual_time.tv_usec) / 1000000;
+                       last_time.tv_usec += 1000000 * nsec;
+                       last_time.tv_sec -= nsec;
+               }
+               result.tv_sec = actual_time.tv_sec - last_time.tv_sec;
+               result.tv_usec = actual_time.tv_usec - last_time.tv_usec;
+               seconds = (((double)(result.tv_usec)) / 1e6) + ((double)(result.tv_sec));
+
+               g_debug("XDXF->%s() function \'%s()\' was working for: %g [s] or %ld [us].\n",__FUNCTION__,message,seconds,((long)(result.tv_sec*1e6)+(result.tv_usec)));
+               if(stack->len == 0)     // stack is empty so we delete everything
+               {
+                       g_array_free(stack, TRUE);
+                       first_run = TRUE;
+               }
+               return seconds;
+       }
+       return -2.0;
+}
+
+
+
+
+
+/*dbus*/
+/**  this function handles signals from dbus; it is called when there are any messages from other modules
+ *
+ * @param error - error message recived from DBUS
+ * @param words - array with recived data structure
+ * @param user_data - pointer to data structure
+ * @return
+ */
+void ws_gui_signal_hander (GError *error, GArray *words, gpointer user_data)
+{
+       WSGuiApp* ws_gui_app=(WSGuiApp*)user_data;
+       osso_rpc_t osss_data;
+       osss_data = g_array_index (words, osso_rpc_t, 0);
+       switch(osss_data.value.i)
+       {
+               case WS_DBUS_ERROR_ENGINE_NOT_FOUND:
+               {
+               ws_gui_app->ws_message_dialog = gtk_message_dialog_new (GTK_WINDOW(ws_gui_app->ws_gui_hildon_window),
+                                  GTK_DIALOG_DESTROY_WITH_PARENT,
+                                  GTK_MESSAGE_ERROR,
+                                  GTK_BUTTONS_OK,
+                                  "An error occured");
+               gtk_widget_show_all(ws_gui_app->ws_message_dialog);
+
+               g_signal_connect_swapped (GTK_OBJECT (ws_gui_app->ws_message_dialog), "response", G_CALLBACK (gtk_main_quit), ws_gui_app);
+               //g_log(G_LOG_DOMAIN, G_LOG_LEVEL_INFO, ".::GUI::. Engine not found");
+               break;
+               }
+
+               case WS_DBUS_ERROR_FILE_NOT_FOUND:
+               {
+               ws_gui_app->ws_message_dialog = gtk_message_dialog_new (GTK_WINDOW(ws_gui_app->ws_gui_hildon_window),
+                                  GTK_DIALOG_DESTROY_WITH_PARENT,
+                                  GTK_MESSAGE_ERROR,
+                                  GTK_BUTTONS_OK,
+                                  "There is no dictionary file available");
+               
+               gtk_widget_show_all(ws_gui_app->ws_message_dialog);
+               //g_log(G_LOG_DOMAIN, G_LOG_LEVEL_INFO, ".::GUI::. File not found");
+               g_signal_connect_swapped (GTK_OBJECT (ws_gui_app->ws_message_dialog), "response", G_CALLBACK (gtk_main_quit), ws_gui_app);
+               break;
+               }       
+       }
+}
+
+/** this function handles signal from dbus and transfer recived (found in a dictionary) words to the words list
+ *
+ * @param error - error message recived from DBUS
+ * @param words - array with recived data structure
+ * @param user_data - pointer to data structure
+ * @return
+ */
+void ws_gui_dbus_return_words (GError *error, GArray *words, gpointer user_data)
+{
+       timer(TIMER_START, (gchar*)__FUNCTION__);
+       guint i;
+       osso_rpc_t data;
+
+       WSGuiApp* ws_gui_app=(WSGuiApp*)user_data;
+       
+       GArray *tmp;
+       tmp = g_array_new(TRUE, TRUE, sizeof(gchar*));
+       gchar *tmp_word;
+
+       for (i=0;i<words->len;++i)
+       {
+               data = g_array_index (words, osso_rpc_t, i);
+               //printf ("dane: %s\n", data.value.s);
+               tmp_word = g_strconcat(data.value.s,NULL);
+               g_array_append_val(tmp, tmp_word);
+               
+       }
+       
+       
+       gtk_widget_destroy(GTK_WIDGET(ws_gui_app->ws_gui_banner));
+       ws_gui_app->ws_gui_banner_flag = FALSE;
+       gtk_widget_set_sensitive(GTK_WIDGET(ws_gui_app->ws_gui_toobar_button_stop), FALSE);
+       gtk_widget_set_sensitive(GTK_WIDGET(ws_gui_app->ws_gui_menu->ws_gui_menu_stop), FALSE);
+       ws_gui_fill_the_list(tmp, ws_gui_app);
+       
+       if (tmp->len == 0)
+       {
+               gtk_infoprint(GTK_WINDOW(ws_gui_app->ws_gui_hildon_window), "No words found" );
+       }
+       timer(TIMER_STOP, (gchar*)__FUNCTION__);
+}
+
+/** this function handles signal from dbus and send recived data to the translation area
+ *
+ * @param error - error message recived from DBUS
+ * @param words - array with recived data structure
+ * @param user_data - pointer to data structure
+ * @return
+ */
+void ws_gui_dbus_return_translation (GError *error, GArray *words, gpointer user_data)
+{
+       timer(TIMER_START, (gchar*)__FUNCTION__);       
+       WSGuiApp* ws_gui_app=(WSGuiApp*)user_data;
+       g_printf("\n\n .::GUI::. User data in dbus_return_translation: %p\n\n", ws_gui_app);
+       
+       osso_rpc_t data;
+       
+       {
+               data = g_array_index (words, osso_rpc_t, 0);
+               ws_gui_fill_html(data.value.s, ws_gui_app);
+       }
+       
+timer(TIMER_STOP, (gchar*)__FUNCTION__);
+}
+
+/**
+* this function allows to free allocated memory
+*
+* @param user_data - pointer to data structure
+*/
+void ws_gui_free_memory(gpointer user_data)
+{
+       WSGuiApp* ws_gui_app=(WSGuiApp*)user_data;
+       g_array_free(ws_gui_app->ws_gui_history, TRUE);
+       g_free(ws_gui_app->ws_gui_w_list);
+       g_free(ws_gui_app->ws_gui_menu);
+       g_free(ws_gui_app);
+}
+
+/** this function handle press signals (keyboard)
+ * 
+ * @param widget
+ * @param keyevent
+ * @param user_data - ponter to data structure
+ * @return TRUE to stop other handlers from being invoked for the event. FALSE to propagate the event further.
+ */
+gboolean hildon_key_press_listener (GtkWidget * widget, GdkEventKey * keyevent, gpointer user_data)
+{
+WSGuiApp* ws_gui_app=(WSGuiApp*)user_data;
+// g_printf("\nKey code: Enter=%d, passede=%d", GDK_Return,(keyevent->keyval));
+switch ((guint)(keyevent->keyval)) {
+       case GDK_Up: //up
+       {
+       gtk_container_set_focus_vadjustment(GTK_CONTAINER(ws_gui_app->ws_gui_scrolledwindow_left), gtk_scrolled_window_get_vadjustment(GTK_SCROLLED_WINDOW(ws_gui_app->ws_gui_scrolledwindow_left)));
+       ws_gui_app->v_new_value = gtk_adjustment_get_value(GTK_ADJUSTMENT(ws_gui_app->ws_gui_vadj)) - ws_gui_app->v_delta;
+       if (ws_gui_app->v_new_value > ws_gui_app->ws_gui_vadj->lower) 
+       {
+       gtk_adjustment_set_value(GTK_ADJUSTMENT(ws_gui_app->ws_gui_vadj), ws_gui_app->v_new_value);
+       }
+       break;
+       }
+       
+       case GDK_Down: //down
+       {
+       gtk_container_set_focus_vadjustment(GTK_CONTAINER(ws_gui_app->ws_gui_scrolledwindow_left), gtk_scrolled_window_get_vadjustment(GTK_SCROLLED_WINDOW(ws_gui_app->ws_gui_scrolledwindow_left)));
+       ws_gui_app->v_new_value = gtk_adjustment_get_value(GTK_ADJUSTMENT(ws_gui_app->ws_gui_vadj)) + ws_gui_app->v_delta;
+       if (ws_gui_app->v_new_value < (ws_gui_app->ws_gui_vadj->upper - ws_gui_app->ws_gui_vadj->page_size)) 
+       {
+       gtk_adjustment_set_value(GTK_ADJUSTMENT(ws_gui_app->ws_gui_vadj), ws_gui_app->v_new_value);
+       }
+       break;
+       }
+       
+       case GDK_Left: //left
+       {
+       gtk_container_set_focus_hadjustment(GTK_CONTAINER(ws_gui_app->ws_gui_scrolledwindow_left), gtk_scrolled_window_get_hadjustment(GTK_SCROLLED_WINDOW(ws_gui_app->ws_gui_scrolledwindow_left)));
+       ws_gui_app->h_new_value = gtk_adjustment_get_value(GTK_ADJUSTMENT(ws_gui_app->ws_gui_hadj)) - ws_gui_app->h_delta;
+       if (ws_gui_app->h_new_value > ws_gui_app->ws_gui_hadj->lower) 
+       {
+       gtk_adjustment_set_value(GTK_ADJUSTMENT(ws_gui_app->ws_gui_hadj), ws_gui_app->h_new_value);
+       }
+       }
+       break;
+       
+       case GDK_Right: //right
+       {
+       gtk_container_set_focus_hadjustment(GTK_CONTAINER(ws_gui_app->ws_gui_scrolledwindow_left), gtk_scrolled_window_get_hadjustment(GTK_SCROLLED_WINDOW(ws_gui_app->ws_gui_scrolledwindow_left)));
+       ws_gui_app->h_new_value = gtk_adjustment_get_value(GTK_ADJUSTMENT(ws_gui_app->ws_gui_hadj)) + ws_gui_app->h_delta;
+       if (ws_gui_app->h_new_value < (ws_gui_app->ws_gui_hadj->upper - ws_gui_app->ws_gui_hadj->page_size)) 
+       {
+       gtk_adjustment_set_value(GTK_ADJUSTMENT(ws_gui_app->ws_gui_hadj), ws_gui_app->h_new_value);
+       }
+       }
+       break;
+       
+       case GDK_Return: /*start search*/
+       g_log(G_LOG_DOMAIN, G_LOG_LEVEL_INFO, ".::GUI::. Return");
+       ws_gui_search(NULL, ws_gui_app);
+       break;
+       
+       case GDK_F6: //FULL SCREEN
+       ws_gui_full_screen(NULL, ws_gui_app);
+       break;
+       
+       case GDK_F7: //zoom in, f7
+       ws_gui_html_zoom_in(NULL, ws_gui_app);
+       break;
+       
+       case GDK_F8://zoom out, f8
+       ws_gui_html_zoom_out(NULL, ws_gui_app);
+       break;
+       
+       case GDK_Escape: //escape
+       ws_gui_search_stop(NULL, ws_gui_app);
+       break;
+
+       case GDK_BackSpace: //backspace
+       return FALSE;
+       break;
+
+       default:
+       return FALSE;
+       break;
+    }
+       return TRUE;
+}
+/** this function handles button press event; contex menu is created 
+ *
+ * @param widget - the object which received the signal
+ * @param event        
+ * @param user_data - user data set when the signal handler was connected
+ * @return TRUE to stop other handlers from being invoked for the event. FALSE to propagate the event further.
+ */
+gboolean ws_gui_button_press_event(GtkWidget *widget, GdkEventButton *event, gpointer user_data)
+{
+       WSGuiApp* ws_gui_app=(WSGuiApp*)user_data;
+       
+       g_return_val_if_fail (widget != NULL, FALSE);
+       g_return_val_if_fail (event != NULL, FALSE);
+       
+       if (event->type == GDK_BUTTON_PRESS && event->button == 3) 
+               {
+                       ws_gui_create_popup_menu(widget, event, ws_gui_app);
+                       return TRUE;
+               }       
+       return FALSE;
+}
+
+/** this function allow to hide words list using menu item from application menu
+ *
+ * @param checkmenuitem - the object which received the signal
+ * @param user_data - user data set when the signal handler was connected
+ * @return
+ */
+void ws_gui_words_list_hide_from_menu(GtkCheckMenuItem *checkmenuitem, gpointer user_data)
+{
+       WSGuiApp* ws_gui_app = (WSGuiApp *)user_data;
+       if (gtk_check_menu_item_get_active(GTK_CHECK_MENU_ITEM(ws_gui_app->ws_gui_menu->ws_gui_menu_hide_list)))
+       {
+               gtk_widget_hide(ws_gui_app->ws_gui_scrolledwindow_left);
+               gtk_toggle_tool_button_set_active(GTK_TOGGLE_TOOL_BUTTON(ws_gui_app->ws_gui_toobar_button_hide), TRUE);
+               gtk_check_menu_item_set_active(GTK_CHECK_MENU_ITEM(ws_gui_app->ws_gui_menu->ws_gui_menu_hide_list), TRUE);
+       }
+       else 
+       {
+               gtk_widget_show(ws_gui_app->ws_gui_scrolledwindow_left);
+               gtk_toggle_tool_button_set_active(GTK_TOGGLE_TOOL_BUTTON(ws_gui_app->ws_gui_toobar_button_hide), FALSE);
+               gtk_check_menu_item_set_active(GTK_CHECK_MENU_ITEM(ws_gui_app->ws_gui_menu->ws_gui_menu_hide_list), FALSE);
+       }
+}
+
+/** this function allow to hide words list using toggle button placed in the find toolbar
+ *
+ * @param toolbar - the object which received the signal
+ * @param user_data - user data set when the signal handler was connected
+ * @return
+ */
+void ws_gui_words_list_hide(GtkToggleButton *togglebutton, gpointer user_data)
+{
+       WSGuiApp* ws_gui_app = (WSGuiApp *)user_data;
+       if (gtk_toggle_tool_button_get_active(GTK_TOGGLE_TOOL_BUTTON(ws_gui_app->ws_gui_toobar_button_hide)))
+       {
+               gtk_widget_hide(ws_gui_app->ws_gui_scrolledwindow_left);
+               gtk_toggle_tool_button_set_active(GTK_TOGGLE_TOOL_BUTTON(ws_gui_app->ws_gui_toobar_button_hide), TRUE);
+               gtk_check_menu_item_set_active(GTK_CHECK_MENU_ITEM(ws_gui_app->ws_gui_menu->ws_gui_menu_hide_list), TRUE);
+       }
+       else 
+       {
+               gtk_widget_show(ws_gui_app->ws_gui_scrolledwindow_left);
+               gtk_toggle_tool_button_set_active(GTK_TOGGLE_TOOL_BUTTON(ws_gui_app->ws_gui_toobar_button_hide), FALSE);
+               gtk_check_menu_item_set_active(GTK_CHECK_MENU_ITEM(ws_gui_app->ws_gui_menu->ws_gui_menu_hide_list), FALSE);
+       }
+}
+
+/** add word to the history
+ *
+ * @param new_word - word which is going to be append to the history array
+ * @param user_data - user data set when the signal handler was connected
+ * @return
+ */
+void ws_gui_history_add(char *new_word, gpointer user_data)
+{
+       guint i;
+       WSGuiApp* ws_gui_app = (WSGuiApp *)user_data;
+       gchar *tmp_word;
+       
+       i = ws_gui_app->ws_gui_history_cur_pos + 1;
+       gchar *tmp = g_array_index(ws_gui_app->ws_gui_history, gchar*, i);
+       
+       while (tmp != NULL) 
+       {
+               g_array_remove_index(ws_gui_app->ws_gui_history, i);
+               tmp = g_array_index(ws_gui_app->ws_gui_history, gchar*, i);
+       }
+
+       i = 0;
+       ws_gui_app->ws_gui_history_cur_pos ++;
+       
+       tmp_word = g_strdup(new_word);
+       g_array_append_val(ws_gui_app->ws_gui_history, tmp_word);
+       if(ws_gui_app->ws_gui_history->len > HISTORY_LEN)
+       {
+               g_array_remove_index(ws_gui_app->ws_gui_history, 0);
+               ws_gui_app->ws_gui_history_cur_pos--;
+       }
+       
+       i = 0;
+       tmp = g_array_index(ws_gui_app->ws_gui_history, gchar*, i);
+
+       ws_gui_check_history(ws_gui_app);       
+}
+
+/** display previously choosen word (previous from the history array) if avaible, sets current position in the history array
+ *
+ *
+ */
+void ws_gui_history_back(GtkButton *button, gpointer user_data) 
+{
+       WSGuiApp* ws_gui_app = (WSGuiApp *)user_data;
+       
+       if (ws_gui_app->ws_gui_history_cur_pos > 0) {
+                       ws_gui_app->ws_gui_history_cur_pos = ws_gui_app->ws_gui_history_cur_pos - 1;
+                       ws_dbus_client_find_translation(ws_gui_app->dbus_data, (g_array_index(ws_gui_app->ws_gui_history, gchar*, ws_gui_app->ws_gui_history_cur_pos)));
+       }
+       else 
+       {
+       gtk_infoprint(GTK_WINDOW(ws_gui_app->ws_gui_hildon_window), "no words in the history" );
+       gtk_widget_set_sensitive (GTK_WIDGET(ws_gui_app->ws_gui_toobar_button_back), FALSE);
+       gtk_widget_set_sensitive (GTK_WIDGET(ws_gui_app->ws_gui_menu->ws_gui_menu_find_prev), FALSE);
+       }
+
+       ws_gui_check_history(ws_gui_app);
+       
+}
+
+void ws_gui_history_next(GtkButton *button, gpointer user_data) 
+{
+       WSGuiApp* ws_gui_app = (WSGuiApp *)user_data;
+       
+       gchar *tmp = g_array_index(ws_gui_app->ws_gui_history, gchar*, ws_gui_app->ws_gui_history_cur_pos+1);
+       
+       if ((ws_gui_app->ws_gui_history_cur_pos < HISTORY_LEN-1) && (tmp != NULL)) 
+       {
+               ws_gui_app->ws_gui_history_cur_pos = ws_gui_app->ws_gui_history_cur_pos + 1;
+               ws_dbus_client_find_translation(ws_gui_app->dbus_data, (g_array_index(ws_gui_app->ws_gui_history, gchar*, ws_gui_app->ws_gui_history_cur_pos)));
+       }
+       else 
+       {
+       gtk_infoprint(GTK_WINDOW(ws_gui_app->ws_gui_hildon_window), "end of history" );
+       gtk_widget_set_sensitive (GTK_WIDGET(ws_gui_app->ws_gui_toobar_button_forward), FALSE);
+       gtk_widget_set_sensitive (GTK_WIDGET(ws_gui_app->ws_gui_menu->ws_gui_menu_find_next), FALSE);
+       }
+
+       ws_gui_check_history(ws_gui_app);
+}
+
+void ws_gui_check_history(gpointer user_data) 
+{
+       WSGuiApp* ws_gui_app = (WSGuiApp *)user_data;
+       
+       gchar *tmp = g_array_index(ws_gui_app->ws_gui_history, gchar*, ws_gui_app->ws_gui_history_cur_pos+1);
+       
+       if ((ws_gui_app->ws_gui_history_cur_pos+1 < HISTORY_LEN) && (tmp != NULL))
+       {       
+               gtk_widget_set_sensitive (GTK_WIDGET(ws_gui_app->ws_gui_toobar_button_forward), TRUE);
+               gtk_widget_set_sensitive (GTK_WIDGET(ws_gui_app->ws_gui_menu->ws_gui_menu_find_next), TRUE);
+       }
+       else 
+       {
+               gtk_widget_set_sensitive (GTK_WIDGET(ws_gui_app->ws_gui_toobar_button_forward), FALSE);
+               gtk_widget_set_sensitive (GTK_WIDGET(ws_gui_app->ws_gui_menu->ws_gui_menu_find_next), FALSE);
+       }
+       
+       tmp = g_array_index(ws_gui_app->ws_gui_history, gchar*, ws_gui_app->ws_gui_history_cur_pos-1);
+       if ((ws_gui_app->ws_gui_history_cur_pos > 0) && (tmp != NULL))
+       {
+               gtk_widget_set_sensitive (GTK_WIDGET(ws_gui_app->ws_gui_toobar_button_back), TRUE);
+               gtk_widget_set_sensitive (GTK_WIDGET(ws_gui_app->ws_gui_menu->ws_gui_menu_find_prev), TRUE);
+       }
+       else
+       {
+               gtk_widget_set_sensitive (GTK_WIDGET(ws_gui_app->ws_gui_toobar_button_back), FALSE);
+               gtk_widget_set_sensitive (GTK_WIDGET(ws_gui_app->ws_gui_menu->ws_gui_menu_find_prev), FALSE);
+       }
+}
+
+void ws_gui_list_item_select(GtkList *list, GtkWidget *child, gpointer user_data) 
+{
+       WSGuiApp* ws_gui_app = (WSGuiApp*)user_data;
+       ws_gui_app->ws_gui_w_list->ws_gui_dlist=GTK_LIST(ws_gui_app->ws_gui_w_list->ws_gui_list)->selection;
+
+               while (ws_gui_app->ws_gui_w_list->ws_gui_dlist) 
+               {
+               ws_gui_app->ws_gui_w_list->ws_gui_list_item_object=GTK_OBJECT((ws_gui_app->ws_gui_w_list->ws_gui_dlist)->data);
+               ws_gui_app->ws_gui_w_list->ws_gui_list_item_data_string=gtk_object_get_data((ws_gui_app->ws_gui_w_list->ws_gui_list_item_object), "Words list");
+               
+               ws_dbus_client_find_translation(ws_gui_app->dbus_data, ws_gui_app->ws_gui_w_list->ws_gui_list_item_data_string);
+               
+               ws_gui_history_add(ws_gui_app->ws_gui_w_list->ws_gui_list_item_data_string, ws_gui_app);
+               ws_gui_app->ws_gui_w_list->ws_gui_dlist=(ws_gui_app->ws_gui_w_list->ws_gui_dlist)->next;
+               break;
+               }
+}
+
+void ws_gui_fill_the_list(GArray *words_list, gpointer user_data)
+{
+       WSGuiApp* ws_gui_app=(WSGuiApp*)user_data;
+       gtk_list_clear_items(GTK_LIST(ws_gui_app->ws_gui_w_list->ws_gui_list), 0, -1);
+       
+       //g_printf("\n\nData pointer: %d\n", (int)ws_gui_app);
+       guint i = 0;
+       
+       gchar *tmp = g_strdup(g_array_index(words_list, gchar*, i));
+       
+       
+       while (tmp != NULL)
+       {
+       
+               ws_gui_app->ws_gui_w_list->ws_gui_list_label=gtk_label_new(tmp);
+               ws_gui_app->ws_gui_w_list->ws_gui_list_item=gtk_list_item_new();
+               /*gtk_label_set_justify(GTK_LABEL(ws_gui_app->ws_gui_w_list->ws_gui_list_label), GTK_JUSTIFY_LEFT);*/
+               gtk_misc_set_alignment (GTK_MISC (ws_gui_app->ws_gui_w_list->ws_gui_list_label), 0, .5);
+               gtk_container_add(GTK_CONTAINER(ws_gui_app->ws_gui_w_list->ws_gui_list_item), ws_gui_app->ws_gui_w_list->ws_gui_list_label);
+               gtk_container_add(GTK_CONTAINER(ws_gui_app->ws_gui_w_list->ws_gui_list), ws_gui_app->ws_gui_w_list->ws_gui_list_item);
+               gtk_label_get(GTK_LABEL(ws_gui_app->ws_gui_w_list->ws_gui_list_label), &tmp);
+               gtk_object_set_data(GTK_OBJECT(ws_gui_app->ws_gui_w_list->ws_gui_list_item), "Words list", tmp);
+               i=i+1;
+               tmp = g_strdup(g_array_index(words_list, gchar*, i));
+
+       }
+       gtk_widget_show_all(GTK_WIDGET(ws_gui_app->ws_gui_w_list->ws_gui_list));
+
+}
+
+void ws_gui_full_screen(GtkMenuItem *menuitem, gpointer user_data)
+{
+
+       WSGuiApp* ws_gui_app = (WSGuiApp*)user_data;
+       if (ws_gui_app->ws_gui_full_screen_flag == FALSE) {
+       
+       gtk_window_fullscreen(GTK_WINDOW(ws_gui_app->ws_gui_hildon_window));
+       gtk_check_menu_item_set_active(GTK_CHECK_MENU_ITEM(ws_gui_app->ws_gui_menu->ws_gui_menu_full_screen), TRUE);
+       ws_gui_app->ws_gui_full_screen_flag = TRUE;
+       }
+       else 
+       {
+       gtk_window_unfullscreen(GTK_WINDOW(ws_gui_app->ws_gui_hildon_window));
+       gtk_check_menu_item_set_active(GTK_CHECK_MENU_ITEM(ws_gui_app->ws_gui_menu->ws_gui_menu_full_screen), FALSE);
+       ws_gui_app->ws_gui_full_screen_flag = FALSE;
+       }
+}
+
+void ws_gui_html_select_all(GtkMenuItem *menuitem, gpointer user_data) 
+{
+       WSGuiApp* ws_gui_app = (WSGuiApp*)user_data;
+       gtk_html_select_all(GTK_HTML(ws_gui_app->ws_gui_html));
+}
+
+void ws_gui_html_copy(GtkMenuItem *menuitem, gpointer user_data) 
+{
+       WSGuiApp* ws_gui_app = (WSGuiApp*)user_data;
+       gtk_html_copy(GTK_HTML(ws_gui_app->ws_gui_html));
+       
+}
+
+void ws_gui_html_zoom_in(GtkMenuItem *menuitem, gpointer user_data)
+{
+       WSGuiApp* ws_gui_app = (WSGuiApp*)user_data;
+       gtk_html_zoom_in(GTK_HTML(ws_gui_app->ws_gui_html));
+}
+
+void ws_gui_html_zoom_out(GtkMenuItem *menuitem, gpointer user_data)
+{
+       WSGuiApp* ws_gui_app = (WSGuiApp*)user_data;
+       gtk_html_zoom_out(GTK_HTML(ws_gui_app->ws_gui_html));
+}
+
+
+void ws_gui_search(GtkWidget * widget, gpointer user_data) 
+{
+       WSGuiApp* ws_gui_app = (WSGuiApp*)user_data;
+       gchar* ws_gui_text = NULL;
+       gchar *empty = " ";
+       
+       if (ws_gui_app->ws_gui_banner_flag == TRUE) {
+       ws_gui_app->ws_gui_banner_flag = FALSE;
+       }
+       
+       g_object_get(G_OBJECT(ws_gui_app->ws_gui_hildon_find_toolbar), "prefix", &ws_gui_text, NULL);
+       
+       if (strlen(ws_gui_text) != 0) 
+       {
+               ws_gui_app->ws_gui_banner = hildon_banner_show_animation(GTK_WIDGET(ws_gui_app->ws_gui_hildon_window), NULL, "searching ..." );
+
+               gtk_widget_set_sensitive(GTK_WIDGET(ws_gui_app->ws_gui_toobar_button_stop),TRUE);
+               gtk_widget_set_sensitive(GTK_WIDGET(ws_gui_app->ws_gui_menu->ws_gui_menu_stop), TRUE);
+
+               ws_gui_app->ws_gui_banner_flag = TRUE;
+               ws_gui_fill_html(empty, ws_gui_app);
+               ws_dbus_client_find_word (ws_gui_app->dbus_data, ws_gui_text);
+       }
+       
+       else gtk_infoprint(GTK_WINDOW(ws_gui_app->ws_gui_hildon_window), "No word typed.");
+                       
+       
+}
+
+void ws_gui_search_stop(GtkButton *button, gpointer user_data) 
+{
+       WSGuiApp* ws_gui_app = (WSGuiApp *)user_data;   
+       if (ws_gui_app->ws_gui_banner_flag == TRUE) 
+       {
+       gtk_widget_destroy(GTK_WIDGET(ws_gui_app->ws_gui_banner));
+       ws_gui_app->ws_gui_banner_flag = FALSE;
+       ws_dbus_notify(ws_gui_app->dbus_data, WS_DBUS_INFO_STOP_SEARCH);
+       gtk_infoprint(GTK_WINDOW(ws_gui_app->ws_gui_hildon_window), "Search has been aborted" );
+       }
+       
+}
+
+void ws_gui_on_exit (GtkWidget *widget, GdkEvent *event, gpointer user_data) 
+{
+       WSGuiApp* ws_gui_app = (WSGuiApp *)user_data;   
+       ws_dbus_notify(ws_gui_app->dbus_data, WS_DBUS_INFO_TERMINATE);
+       printf ("\nClosing WhiteStork Dictionary ... \n\n");
+       ws_dbus_destroy (ws_gui_app->dbus_data);
+       gtk_main_quit();
+       exit (0);
+}
+
+void ws_gui_menu_quit(GtkMenuItem *menuitem, gpointer user_data)
+{
+       WSGuiApp* ws_gui_app = (WSGuiApp *)user_data;   
+       ws_dbus_notify(ws_gui_app->dbus_data, WS_DBUS_INFO_TERMINATE);
+       printf ("\nClosing WhiteStork Dictionary ... \n\n");
+       ws_dbus_destroy (ws_gui_app->dbus_data);
+       gtk_main_quit();
+       exit (0);
+}
+
+void ws_gui_fill_html(char *html_context, gpointer user_data) 
+{
+       WSGuiApp* ws_gui_app = (WSGuiApp*)user_data;
+       gtk_html_set_editable (GTK_HTML(ws_gui_app->ws_gui_html), FALSE);
+       gtk_html_load_from_string (GTK_HTML(ws_gui_app->ws_gui_html), html_context, -1);
+       gtk_html_set_editable (GTK_HTML(ws_gui_app->ws_gui_html), TRUE);
+       gtk_adjustment_set_value(GTK_ADJUSTMENT(ws_gui_app->ws_gui_vadj), ws_gui_app->prev_vadj);
+       gtk_adjustment_set_value(GTK_ADJUSTMENT(ws_gui_app->ws_gui_hadj), ws_gui_app->prev_hadj);
+}
+
+void ws_gui_read_adjustment(gpointer user_data)
+{
+       WSGuiApp* ws_gui_app=(WSGuiApp*)user_data;
+       
+       ws_gui_app->ws_gui_hadj = gtk_scrolled_window_get_hadjustment(GTK_SCROLLED_WINDOW(ws_gui_app->ws_gui_scrolledwindow_left));
+
+       ws_gui_app->h_delta = (ws_gui_app->ws_gui_hadj->upper - ws_gui_app->ws_gui_hadj->lower)/SCROLL_STEP_H;
+       
+       ws_gui_app->ws_gui_vadj = gtk_scrolled_window_get_vadjustment(GTK_SCROLLED_WINDOW(ws_gui_app->ws_gui_scrolledwindow_left));
+
+       ws_gui_app->v_delta = (ws_gui_app->ws_gui_vadj->upper - ws_gui_app->ws_gui_vadj->lower)/SCROLL_STEP_V;
+       ws_gui_app->v_new_value = gtk_adjustment_get_value(GTK_ADJUSTMENT(ws_gui_app->ws_gui_vadj)) + ws_gui_app->v_delta;
+       
+       /*gtk_adjustment_set_value(GTK_ADJUSTMENT(ws_gui_app->ws_gui_hadj), ws_gui_app->v_new_value);*/
+       
+       gtk_container_set_focus_vadjustment(GTK_CONTAINER(ws_gui_app->ws_gui_scrolledwindow_left), gtk_scrolled_window_get_vadjustment(GTK_SCROLLED_WINDOW(ws_gui_app->ws_gui_scrolledwindow_left)));
+       
+       
+}
+
+void ws_gui_adjustment_changed (GtkAdjustment *adjustment, gpointer user_data)
+{
+       WSGuiApp* ws_gui_app=(WSGuiApp*)user_data;
+       gdouble vval = gtk_adjustment_get_value(GTK_ADJUSTMENT(ws_gui_app->ws_gui_vadj));
+       //g_log(G_LOG_DOMAIN, G_LOG_LEVEL_INFO, "v_adjustment changed: %f", vval);
+       ws_gui_app->prev_vadj = ws_gui_app->cur_vadj;
+       ws_gui_app->cur_vadj = vval;
+       //gdouble hval = gtk_adjustment_get_value(ws_gui_app->ws_gui_hadj);
+       //g_log(G_LOG_DOMAIN, G_LOG_LEVEL_INFO, "h_adjustment changed: %f", hval);
+       ws_gui_app->prev_hadj = 0;
+       //g_log(G_LOG_DOMAIN, G_LOG_LEVEL_INFO, "v_adjustment changed: %f", ws_gui_app->ws_gui_hadj->value);
+       
+}
diff --git a/gui/src/ws_gui_layout.c b/gui/src/ws_gui_layout.c
new file mode 100644 (file)
index 0000000..ae9403e
--- /dev/null
@@ -0,0 +1,244 @@
+/*****************
+* Copyright 2006, ComArch S.A
+* All rights reserved
+*****************/
+
+#include "../../include/ws_gui_layout.h"
+#include "../../include/ws_gui.h"
+#include "../../include/ws_gui_callbacks.h"
+#include "../../include/ws_dbus.h"
+
+
+
+void ws_gui_create_window(gpointer user_data) 
+{
+       WSGuiApp* ws_gui_app=(WSGuiApp*)user_data;
+       ws_gui_app->ws_gui_w_list->ws_gui_list_item_data_string = "<font size=+2><center>Welcome to<br><b>WhiteStork</b><br>Dictionary.</font></center>";
+
+       ws_gui_app->ws_gui_banner_flag = FALSE;
+       ws_gui_app->ws_gui_full_screen_flag = FALSE;    
+
+       
+       ws_gui_app->ws_gui_history = g_array_new(TRUE, TRUE, sizeof(gchar*));
+       ws_gui_app->ws_gui_history_cur_pos = -1;
+       ws_gui_app->ws_gui_hildon_program = HILDON_PROGRAM(hildon_program_get_instance());
+       g_set_application_name("WhiteStork");
+       //hildon_program_set_can_hibernate (ws_gui_app->ws_gui_hildon_program, FALSE);
+  
+       ws_gui_app->ws_gui_hildon_window = HILDON_WINDOW(hildon_window_new());
+       hildon_program_add_window(ws_gui_app->ws_gui_hildon_program, ws_gui_app->ws_gui_hildon_window);
+       
+       /*GdkPixbuf *pixbuf;
+       pixbuf = gdk_pixbuf_new_from_file ("gui/src/ikona.png", NULL);
+       gtk_window_set_icon (GTK_WINDOW(ws_gui_app->ws_gui_hildon_window), pixbuf);
+       gdk_pixbuf_unref (pixbuf);*/
+       hildon_icon_sizes_init();
+       if (gtk_window_set_default_icon_from_file("gui/src/ikona.png", NULL) == TRUE)
+       {
+       g_printf("\n\n.::GUI::. Icon loaded");
+       }
+       else 
+       {
+       g_printf("\n\n.::GUI::. Icon failed");
+       }
+       
+
+       
+       ws_gui_create_main_menu(ws_gui_app);
+       ws_gui_create_find_toolbar(ws_gui_app);
+       ws_gui_app->ws_gui_hpane = gtk_hpaned_new();
+       ws_gui_app->ws_gui_scrolledwindow_left = gtk_scrolled_window_new (NULL, NULL);
+       gtk_scrolled_window_set_policy (GTK_SCROLLED_WINDOW (ws_gui_app->ws_gui_scrolledwindow_left), GTK_POLICY_AUTOMATIC, GTK_POLICY_AUTOMATIC);
+       gtk_widget_set_size_request (ws_gui_app->ws_gui_scrolledwindow_left, 200, 100);
+       gtk_scrolled_window_set_placement(GTK_SCROLLED_WINDOW(ws_gui_app->ws_gui_scrolledwindow_left), GTK_CORNER_TOP_LEFT);
+       ws_gui_app->ws_gui_scrolledwindow_right = gtk_scrolled_window_new (NULL, NULL);
+       gtk_scrolled_window_set_policy (GTK_SCROLLED_WINDOW (ws_gui_app->ws_gui_scrolledwindow_right), GTK_POLICY_NEVER, GTK_POLICY_AUTOMATIC);
+       /*gtk_widget_set_size_request (ws_gui_scrolledwindow_right, 200, 400);*/
+       
+       ws_gui_app->ws_gui_w_list->ws_gui_list = gtk_list_new();
+
+
+       gtk_scrolled_window_add_with_viewport(GTK_SCROLLED_WINDOW(ws_gui_app->ws_gui_scrolledwindow_left), ws_gui_app->ws_gui_w_list->ws_gui_list);
+       ws_gui_app->ws_gui_html = gtk_html_new_from_string(ws_gui_app->ws_gui_w_list->ws_gui_list_item_data_string, strlen(ws_gui_app->ws_gui_w_list->ws_gui_list_item_data_string));
+       
+       //ws_gui_app->ws_gui_html = gtk_html_new ();
+       //ws_gui_fill_html(ws_gui_app->ws_gui_w_list->ws_gui_list_item_data_string, ws_gui_app);
+       
+       gtk_scrolled_window_add_with_viewport(GTK_SCROLLED_WINDOW(ws_gui_app->ws_gui_scrolledwindow_right), ws_gui_app->ws_gui_html);
+       gtk_paned_add1(GTK_PANED(ws_gui_app->ws_gui_hpane), ws_gui_app->ws_gui_scrolledwindow_left);
+       gtk_paned_add2(GTK_PANED(ws_gui_app->ws_gui_hpane), ws_gui_app->ws_gui_scrolledwindow_right);
+
+       gtk_html_set_editable(GTK_HTML(ws_gui_app->ws_gui_html), TRUE); /* editable */
+       gtk_html_allow_selection(GTK_HTML(ws_gui_app->ws_gui_html), TRUE);
+       
+       gtk_container_add(GTK_CONTAINER(ws_gui_app->ws_gui_hildon_window), ws_gui_app->ws_gui_hpane);
+       gtk_widget_show_all(GTK_WIDGET(ws_gui_app->ws_gui_hildon_window));
+       
+}
+
+void ws_gui_create_find_toolbar(gpointer user_data) 
+{
+       WSGuiApp* ws_gui_app = (WSGuiApp*)user_data;    
+
+       GtkToolItem *space;
+       ws_gui_app->ws_gui_hildon_find_toolbar = HILDON_FIND_TOOLBAR(hildon_find_toolbar_new("Find word: "));
+    
+       ws_gui_app->ws_gui_toobar_button_hide = gtk_toggle_tool_button_new_from_stock(GTK_STOCK_GOTO_FIRST);
+       ws_gui_app->ws_gui_toobar_button_back = gtk_tool_button_new_from_stock(GTK_STOCK_GO_BACK);
+       ws_gui_app->ws_gui_toobar_button_forward = gtk_tool_button_new_from_stock(GTK_STOCK_GO_FORWARD);
+       ws_gui_app->ws_gui_toobar_button_stop = gtk_tool_button_new_from_stock(GTK_STOCK_STOP);
+       space = gtk_separator_tool_item_new(); 
+    
+       ws_gui_app->ws_gui_toobar_button_close = gtk_toolbar_get_nth_item(GTK_TOOLBAR(ws_gui_app->ws_gui_hildon_find_toolbar), 4);
+       gtk_tool_item_set_visible_horizontal(ws_gui_app->ws_gui_toobar_button_close, FALSE);
+       
+       gtk_toolbar_insert(GTK_TOOLBAR(ws_gui_app->ws_gui_hildon_find_toolbar), ws_gui_app->ws_gui_toobar_button_hide, 0);
+       gtk_toolbar_insert(GTK_TOOLBAR(ws_gui_app->ws_gui_hildon_find_toolbar), ws_gui_app->ws_gui_toobar_button_back, -1);
+       gtk_toolbar_insert(GTK_TOOLBAR(ws_gui_app->ws_gui_hildon_find_toolbar), ws_gui_app->ws_gui_toobar_button_forward, -1);
+       gtk_toolbar_insert(GTK_TOOLBAR(ws_gui_app->ws_gui_hildon_find_toolbar), space, -1);
+       gtk_toolbar_insert(GTK_TOOLBAR(ws_gui_app->ws_gui_hildon_find_toolbar), ws_gui_app->ws_gui_toobar_button_stop, -1);
+    
+       g_signal_connect(G_OBJECT(ws_gui_app->ws_gui_hildon_find_toolbar), "search", G_CALLBACK(ws_gui_search), ws_gui_app);
+       
+       g_signal_connect(G_OBJECT(ws_gui_app->ws_gui_toobar_button_hide), "toggled", G_CALLBACK(ws_gui_words_list_hide), ws_gui_app);
+       g_signal_connect(G_OBJECT(ws_gui_app->ws_gui_toobar_button_back), "clicked", G_CALLBACK(ws_gui_history_back), ws_gui_app);
+       g_signal_connect(G_OBJECT(ws_gui_app->ws_gui_toobar_button_forward), "clicked", G_CALLBACK(ws_gui_history_next), ws_gui_app);
+       g_signal_connect(G_OBJECT(ws_gui_app->ws_gui_toobar_button_stop), "clicked", G_CALLBACK(ws_gui_search_stop), ws_gui_app);
+
+       gtk_widget_set_sensitive (GTK_WIDGET(ws_gui_app->ws_gui_toobar_button_back), FALSE);
+       gtk_widget_set_sensitive (GTK_WIDGET(ws_gui_app->ws_gui_toobar_button_forward), FALSE);
+       gtk_widget_set_sensitive (GTK_WIDGET(ws_gui_app->ws_gui_toobar_button_stop), FALSE);
+       
+
+       hildon_window_add_toolbar(ws_gui_app->ws_gui_hildon_window, GTK_TOOLBAR(ws_gui_app->ws_gui_hildon_find_toolbar));
+}
+
+void ws_gui_create_main_menu (gpointer user_data) 
+{
+       WSGuiApp* ws_gui_app=(WSGuiApp*)user_data;
+
+       ws_gui_app->ws_gui_menu->ws_gui_submenu_1 = gtk_menu_new();
+       ws_gui_app->ws_gui_menu->ws_gui_submenu_2 = gtk_menu_new();
+       ws_gui_app->ws_gui_menu->ws_gui_submenu_3 = gtk_menu_new();
+       ws_gui_app->ws_gui_menu->ws_gui_main_menu = gtk_menu_new();
+       ws_gui_app->ws_gui_menu->ws_gui_menu_edit = gtk_menu_item_new_with_label("Edit");
+       ws_gui_app->ws_gui_menu->ws_gui_menu_view = gtk_menu_item_new_with_label("View");
+       ws_gui_app->ws_gui_menu->ws_gui_menu_search = gtk_menu_item_new_with_label("Search");
+       ws_gui_app->ws_gui_menu->ws_gui_menu_close = gtk_menu_item_new_with_label("Close");
+       ws_gui_app->ws_gui_menu->ws_gui_separator = gtk_separator_menu_item_new();
+
+        ws_gui_app->ws_gui_menu->ws_gui_menu_copy = gtk_menu_item_new_with_label("Copy");
+        ws_gui_app->ws_gui_menu->ws_gui_menu_select_all = gtk_menu_item_new_with_label("Select All");
+        gtk_menu_append(ws_gui_app->ws_gui_menu->ws_gui_submenu_1, ws_gui_app->ws_gui_menu->ws_gui_menu_copy);
+        gtk_menu_append(ws_gui_app->ws_gui_menu->ws_gui_submenu_1, ws_gui_app->ws_gui_menu->ws_gui_menu_select_all);
+       
+        ws_gui_app->ws_gui_menu->ws_gui_menu_hide_list = gtk_check_menu_item_new_with_label("Hide words list");
+        ws_gui_app->ws_gui_menu->ws_gui_menu_zoom_in = gtk_menu_item_new_with_label("Zoom in");
+        ws_gui_app->ws_gui_menu->ws_gui_menu_zoom_out = gtk_menu_item_new_with_label("Zoom out");
+        ws_gui_app->ws_gui_menu->ws_gui_menu_full_screen = gtk_check_menu_item_new_with_label("Full screen");
+        gtk_menu_append(ws_gui_app->ws_gui_menu->ws_gui_submenu_2, ws_gui_app->ws_gui_menu->ws_gui_menu_hide_list);
+       gtk_menu_append(ws_gui_app->ws_gui_menu->ws_gui_submenu_2, ws_gui_app->ws_gui_menu->ws_gui_menu_zoom_in);
+       gtk_menu_append(ws_gui_app->ws_gui_menu->ws_gui_submenu_2, ws_gui_app->ws_gui_menu->ws_gui_menu_zoom_out);
+        gtk_menu_append(ws_gui_app->ws_gui_menu->ws_gui_submenu_2, ws_gui_app->ws_gui_menu->ws_gui_menu_full_screen);
+
+        ws_gui_app->ws_gui_menu->ws_gui_menu_find_word = gtk_menu_item_new_with_label("Find word");
+        ws_gui_app->ws_gui_menu->ws_gui_menu_find_next = gtk_menu_item_new_with_label("Find next");
+        ws_gui_app->ws_gui_menu->ws_gui_menu_find_prev = gtk_menu_item_new_with_label("Find previous");
+        ws_gui_app->ws_gui_menu->ws_gui_menu_stop = gtk_menu_item_new_with_label("Stop");
+        gtk_menu_append(ws_gui_app->ws_gui_menu->ws_gui_submenu_3, ws_gui_app->ws_gui_menu->ws_gui_menu_find_word);
+        gtk_menu_append(ws_gui_app->ws_gui_menu->ws_gui_submenu_3, ws_gui_app->ws_gui_menu->ws_gui_menu_find_next);
+        gtk_menu_append(ws_gui_app->ws_gui_menu->ws_gui_submenu_3, ws_gui_app->ws_gui_menu->ws_gui_menu_find_prev);
+        gtk_menu_append(ws_gui_app->ws_gui_menu->ws_gui_submenu_3, ws_gui_app->ws_gui_menu->ws_gui_menu_stop);
+        gtk_menu_append(ws_gui_app->ws_gui_menu->ws_gui_main_menu, ws_gui_app->ws_gui_menu->ws_gui_menu_edit);
+        gtk_menu_item_set_submenu(GTK_MENU_ITEM(ws_gui_app->ws_gui_menu->ws_gui_menu_edit), ws_gui_app->ws_gui_menu->ws_gui_submenu_1);
+        gtk_menu_append(ws_gui_app->ws_gui_menu->ws_gui_main_menu, ws_gui_app->ws_gui_menu->ws_gui_menu_view);
+        gtk_menu_item_set_submenu(GTK_MENU_ITEM(ws_gui_app->ws_gui_menu->ws_gui_menu_view), ws_gui_app->ws_gui_menu->ws_gui_submenu_2);
+        gtk_menu_append(ws_gui_app->ws_gui_menu->ws_gui_main_menu, ws_gui_app->ws_gui_menu->ws_gui_menu_search);
+        gtk_menu_item_set_submenu(GTK_MENU_ITEM(ws_gui_app->ws_gui_menu->ws_gui_menu_search), ws_gui_app->ws_gui_menu->ws_gui_submenu_3);
+       gtk_menu_append(ws_gui_app->ws_gui_menu->ws_gui_main_menu, ws_gui_app->ws_gui_menu->ws_gui_separator);
+       gtk_menu_append(ws_gui_app->ws_gui_menu->ws_gui_main_menu, ws_gui_app->ws_gui_menu->ws_gui_menu_close);
+
+    /* podpinamy sygnaly:*/
+
+       g_signal_connect(G_OBJECT(ws_gui_app->ws_gui_menu->ws_gui_menu_copy), "activate", GTK_SIGNAL_FUNC(ws_gui_html_copy), ws_gui_app); g_signal_connect(G_OBJECT(ws_gui_app->ws_gui_menu->ws_gui_menu_select_all), "activate", GTK_SIGNAL_FUNC(ws_gui_html_select_all), ws_gui_app);
+       g_signal_connect(G_OBJECT(ws_gui_app->ws_gui_menu->ws_gui_menu_hide_list), "activate", GTK_SIGNAL_FUNC(ws_gui_words_list_hide_from_menu), ws_gui_app);
+       g_signal_connect(G_OBJECT(ws_gui_app->ws_gui_menu->ws_gui_menu_zoom_in), "activate", G_CALLBACK(ws_gui_html_zoom_in), ws_gui_app);
+       g_signal_connect(G_OBJECT(ws_gui_app->ws_gui_menu->ws_gui_menu_zoom_out), "activate", G_CALLBACK(ws_gui_html_zoom_out), ws_gui_app);
+       g_signal_connect(G_OBJECT(ws_gui_app->ws_gui_menu->ws_gui_menu_full_screen), "activate", GTK_SIGNAL_FUNC(ws_gui_full_screen), ws_gui_app);
+       g_signal_connect(G_OBJECT(ws_gui_app->ws_gui_menu->ws_gui_menu_find_word), "activate", GTK_SIGNAL_FUNC(ws_gui_search), ws_gui_app);
+       g_signal_connect(G_OBJECT(ws_gui_app->ws_gui_menu->ws_gui_menu_find_next), "activate", GTK_SIGNAL_FUNC(ws_gui_history_next), ws_gui_app);
+       g_signal_connect(G_OBJECT(ws_gui_app->ws_gui_menu->ws_gui_menu_find_prev), "activate", GTK_SIGNAL_FUNC(ws_gui_history_back), ws_gui_app);
+       g_signal_connect(G_OBJECT(ws_gui_app->ws_gui_menu->ws_gui_menu_stop), "activate", GTK_SIGNAL_FUNC(ws_gui_search_stop), ws_gui_app);
+       g_signal_connect(G_OBJECT(ws_gui_app->ws_gui_menu->ws_gui_menu_close), "activate", G_CALLBACK(ws_gui_menu_quit), ws_gui_app);
+   
+       hildon_window_set_menu(HILDON_WINDOW(ws_gui_app->ws_gui_hildon_window), GTK_MENU(ws_gui_app->ws_gui_menu->ws_gui_main_menu));
+
+       
+       gtk_widget_set_sensitive(GTK_WIDGET(ws_gui_app->ws_gui_menu->ws_gui_menu_stop), FALSE);
+       gtk_widget_set_sensitive(GTK_WIDGET(ws_gui_app->ws_gui_menu->ws_gui_menu_find_next), FALSE);
+       gtk_widget_set_sensitive(GTK_WIDGET(ws_gui_app->ws_gui_menu->ws_gui_menu_find_prev), FALSE);
+
+
+       gtk_widget_show_all(ws_gui_app->ws_gui_menu->ws_gui_main_menu);
+}
+
+void ws_gui_create_popup_menu (GtkWidget *widget, GdkEventButton *event, gpointer user_data) 
+{
+       WSGuiApp* ws_gui_app=(WSGuiApp*)user_data;
+
+       /*g_printf("\n w ws_gui_create_popup_menu: pointer %p, (int): %d", ws_gui_app, (int)(ws_gui_app));*/
+
+       int button, event_time;
+
+       ws_gui_app->ws_gui_menu->ws_gui_popup_menu = gtk_menu_new();
+       ws_gui_app->ws_gui_menu->ws_gui_popup_submenu = gtk_menu_new();
+       ws_gui_app->ws_gui_menu->ws_gui_separator = gtk_separator_menu_item_new();
+
+       ws_gui_app->ws_gui_menu->ws_gui_popup_copy = gtk_menu_item_new_with_label("Copy");
+       gtk_menu_append((ws_gui_app->ws_gui_menu->ws_gui_popup_submenu), ws_gui_app->ws_gui_menu->ws_gui_popup_copy);
+       
+       ws_gui_app->ws_gui_menu->ws_gui_popup_select_all = gtk_menu_item_new_with_label("Select All");
+       gtk_menu_append((ws_gui_app->ws_gui_menu->ws_gui_popup_submenu), ws_gui_app->ws_gui_menu->ws_gui_popup_select_all);
+       /*g_printf("Wskaznim na funkcje: %d\n",(int)ws_gui_html_select_all);*/
+       /*ws_gui_html_select_all(NULL, ws_gui_app);*/
+       gtk_widget_show_all(ws_gui_app->ws_gui_menu->ws_gui_popup_submenu);
+       
+       ws_gui_app->ws_gui_menu->ws_gui_popup_edit = gtk_menu_item_new_with_label ("Edit");
+       gtk_menu_append ((ws_gui_app->ws_gui_menu->ws_gui_popup_menu), ws_gui_app->ws_gui_menu->ws_gui_popup_edit);
+
+       gtk_menu_append ((ws_gui_app->ws_gui_menu->ws_gui_popup_menu), ws_gui_app->ws_gui_menu->ws_gui_separator);
+
+       ws_gui_app->ws_gui_menu->ws_gui_popup_zoom_in = gtk_menu_item_new_with_label ("Zoom in");
+       gtk_menu_append ((ws_gui_app->ws_gui_menu->ws_gui_popup_menu), ws_gui_app->ws_gui_menu->ws_gui_popup_zoom_in);
+
+       ws_gui_app->ws_gui_menu->ws_gui_popup_zoom_out = gtk_menu_item_new_with_label ("Zoom out");
+       gtk_menu_append ((ws_gui_app->ws_gui_menu->ws_gui_popup_menu), ws_gui_app->ws_gui_menu->ws_gui_popup_zoom_out);
+
+       gtk_widget_show_all(ws_gui_app->ws_gui_menu->ws_gui_popup_menu);
+       gtk_menu_item_set_submenu(GTK_MENU_ITEM(ws_gui_app->ws_gui_menu->ws_gui_popup_edit), ws_gui_app->ws_gui_menu->ws_gui_popup_submenu);
+
+       if (event) 
+       {
+               button = event->button;
+               event_time = event->time;
+       }
+       else 
+       {
+               button = 0;
+               event_time = gtk_get_current_event_time();
+       }
+
+       
+       gtk_menu_popup (GTK_MENU(ws_gui_app->ws_gui_menu->ws_gui_popup_menu), NULL, NULL, NULL, NULL, button, event_time);      
+       g_signal_connect(G_OBJECT(ws_gui_app->ws_gui_menu->ws_gui_popup_copy), "activate", G_CALLBACK(ws_gui_html_copy), ws_gui_app);
+       g_signal_connect(G_OBJECT(ws_gui_app->ws_gui_menu->ws_gui_popup_select_all), "activate", G_CALLBACK(ws_gui_html_select_all), ws_gui_app);
+       g_signal_connect(G_OBJECT(ws_gui_app->ws_gui_menu->ws_gui_popup_zoom_in), "activate", G_CALLBACK(ws_gui_html_zoom_in), ws_gui_app);
+       g_signal_connect(G_OBJECT(ws_gui_app->ws_gui_menu->ws_gui_popup_zoom_out), "activate", G_CALLBACK(ws_gui_html_zoom_out), ws_gui_app);
+}
+
diff --git a/include/dictionary_engine.h b/include/dictionary_engine.h
new file mode 100644 (file)
index 0000000..99d04e1
--- /dev/null
@@ -0,0 +1,569 @@
+/****************************************************************
+This program is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; version 2 of the License.
+
+This program is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+GNU General Public License for more details.
+****************************************************************/
+#ifndef        _DICTIONARY_ENGINE_BASE
+#define        _DICTIONARY_ENGINE_BASE
+
+#ifdef __cplusplus
+extern "C" {   // to make it possible to use this header in C++ programms
+#endif
+
+//______________________________________________________________________________________________________
+// ******************************************************************************************************
+//********************************************************************************************* HEADERS:
+#include <glib.h>
+
+
+//______________________________________________________________________________________________________
+// ******************************************************************************************************
+//************************************************************************************ GLOBAL MACROS:
+/** \brief Checks if module is peaceable with concrete location.
+*
+* If user of engine module want to know if concrete module can handle concrete location, he can call <i>dict_eng_module_check()</i>
+*and check the result of this function.
+ * @param module :: <b>EngineModule</b> - module engine which will be testing
+ * @param location :: <b>gchar*</b> - location on wich engine will be testing
+ * @return <i><b>gboolean</b></i> :: tells if location <i>location</i> can be handled by module <i>module</i>
+ */
+#define dict_eng_module_check(module,location)                 ( (module).engine_check( (location) ) )
+
+
+/** \brief Get short description of engine module.
+ *
+ * If there is need to present to the user of end programm some information about enigne he is using, we can call dict_eng_module_get_description() and
+ * print/show the result of this call.
+ * @param module :: <b>EngineModule</b> - module engine which description we want
+ * @return <i><b>gchar*</b></i> :: there is string, decribing module engine <i>module</i>, in this pointer. User should NOT free this pointer as it points to static table of chars
+ */
+#define dict_eng_module_get_description(module)        ( (module).engine_description() )
+
+
+/** \brief Get version of engine module.
+ *
+ * Sometimes it could be useful to get know what version of engine module we are using. We can call this function to retrieve these informations from module.
+ * Note that version information could be also placed in description of module, but here user will get only string representing version, what could be needed in some situation
+ * (e.g.: if end-user will have two the same module, then programm has to decide which should be used, or ask user).
+ * @param module :: <b>EngineModule</b> - module engine which implementation version we want
+ * @return <i><b>gchar*</b></i> :: pointer to string representing module <i>module</i>version. User should NOT free this pointer as it points to static table of chars
+ */
+#define dict_eng_module_get_version(module)            ( (module).engine_version() )
+
+
+/** \brief Get format on which working engnine module.
+ *
+ * If we want to know on what dictionary format works current engine module, we can call this function. As a result we will retrieve string telling us what format-based is 
+ * concrete engine module (e.g. XDXF, WordNet etc.).
+ * @param module :: <b>EngineModule</b> - engine module which dictionary format we want to get
+ * @return <i><b>gchar*</b></i> :: string representing format of dictionary on which module <i>module</i> can works. User should NOT free this pointer as it points 
+ * to static table of chars
+ */
+#define dict_eng_module_get_format(module)                     ( (module).engine_version() )
+
+
+/** \brief Open concrete dictionary.
+*
+* This functions opens location (this could mean: filename, URL, any other way to specify concrete localization of dictionary database). To be more sure that this function will be sucefull,
+* user can call before dict_eng_module_check() to check if this module can handle dictionary under passed location. But this do not warrant that calling dict_eng_module_create() will not
+* fail. User should check the result of function to be sure that everything was ok.
+ * @param module :: <b>EngineModule</b> - engine module which should be used to open location <i>location</i>
+ * @param location :: <b>gchar*</b> - location of dictionary database (file, directory, URL etc.)
+ * @param flags :: <b>EngineOptimizationFlag</b> - flags defines how program shoud automaticlly use optimization methods for opened dictionary
+ * @return <i><b>Engine*</b></i> :: pointer to new enigne structure; After use, if this structure will not be needed anymore, user should call dict_eng_destroy() to free memory
+ * \sa EngineOptimizationFlag :|: dict_eng_module_check() :|: EngineModule :|: Engine
+*/
+#define dict_eng_module_create(module,location,flags)          ( (module).engine_create(  (location), (flags) ) )
+
+
+//______________________________________________________________________________________________________
+// ******************************************************************************************************
+//********************************************************************** CONCRETE DICTIONARY MACROS:
+/** \brief Activate optimization mechanizms for concrete engine.
+ *
+ * Every engine could have some optimization methods. By calling this function we enabled this option. For the user of engine it is not important what kind
+ * of optimization is used in current engine, how does it work etc. It should be opaque for engine's users.
+ *  
+ * @param engine :: <b>Engine*</b> - pointer to engine which should optimized
+ * @return <i><b>void</b></i> :: nothing. This function only take a chance to make engine working faster, but it is not said that every step will be succesful.
+ * But even if not - engine has to work properly.
+ * \sa dict_eng_module_create() :|: dict_eng_is_optimized() :|: Engine
+ */
+#define dict_eng_optimize(engine)                                                      ( ( engine )->engine_optimize( engine ) )
+
+
+/** \brief Checks if current engine has activated optimization.
+ *
+ * User can call this function to get know if concrete engine has enabled optimization. Optimization can be activated by calling dict_eng_optimize() or passing
+ * ENGINE_CREATE or ENGINE_REFRESH flags to dict_eng_module_create() while opening concrete dictionary. 
+ *  
+ * @param engine :: <b>Engine*</b> - pointer to engine which should checked if is optimized now
+ * @return <i><b>gboolean</b></i> :: nothing. This function only take a chance to make engine working faster, but it is not said that every step will be succesful
+ * \sa dict_eng_optimize() :|: Engine :|: EngineOptimizationFlag
+ */
+#define dict_eng_is_optimized( engine )                                                ( ( engine )->engine_is_optimized( engine ) )
+
+
+/** \brief To get know from what location was created current dictionary.
+ *
+ * If user of engine want to get know from what locatione exactly was created concrete engine, he could call this function. It returns string,
+ * most likely the same as the one passed earlier to dict_eng_module_create() function as a <i>location</i> argument.
+ *  
+ * @param engine :: <b>Engine*</b> - dictionary from which we want to get location 
+ * @return <i><b>gchar*</b></i> :: pointer to chars, from which concrete dictionary was created
+ * \sa dict_eng_module_create()
+ */
+#define dict_eng_get_location(engine)                                                  ( (engine)->engine_location( engine ) )
+
+
+/** \brief Tells if last operation was sucesfull.
+ *
+ * If user want to be sure that everything was ok, during last operation (it has finished with success), he has to check if dict_eng_get_last_state() is equal to
+ * ENGINE_NO_ERROR. If not, he can also find the reason why operation failed.
+ * @param engine :: <b>Engine*</b> - dictionary which last operation's returned code we want to get
+ * @return <i><b>EngineStatus</b></i> :: finish code of last operation
+ * \sa EngineStatus :|: dict_eng_state_message()
+ */
+#define dict_eng_get_last_state(engine)                                                ( (engine)->engine_error( engine ) )
+
+
+/** \brief Translate pure state code to meaningfull message.
+ *
+ * If there was a error during engine was working, we can present to the user the reason for this error in meaningfull form.
+ * @param error :: <b>EngineState</b> - code which we want to translate
+ * @return <i><b>gchar*</b></i> :: message describing concrete error code
+ * \sa EngineStatus :|: dict_eng_state_message()
+ */
+#define dict_eng_state_message(error)                                  ( (engine)->engine_error_message( error ) )
+
+
+/** \brief Destroy gently and completly current dictionary.
+ *
+ * When user do not need anymore concrete dictionary, he must destroy it to free memory allocated by this dictionary. It will close avery opened file descriptor,
+ * free any additional memory block allocated while engine was working etc. User are not allowed to call free() on dictionary without calling before dict_eng_destroy().
+ *  
+ * @param engine :: <b>Engine*</b> - pointer to dictionary which is not needed anymore
+ * @return <i><b>void</b></i> :: nothing. This function should work properly, and free any resources which arelady are in use by current dictionary.
+ * \sa dict_eng_module_create() :|: Engine
+ */
+#define dict_eng_destroy(engine)                                                       ( (engine)->engine_close(engine) )
+
+
+/** \brief Start searching for words list.
+ *
+ * This function starts searching for words list. User should set before callback for ENGINE_WORD_LIST_SIGNAL, to be able to retrieve words list, because this
+ * function do not return any value.
+ *  
+ * @param engine :: <b>Engine*</b> - pointer to dictionary in which we are looking for words matching to pattern
+ * @param pattern :: <b>gchar*</b> - string representing pattern to which returned word should be matching
+ * @return <i><b>void</b></i> :: nothing. Result of searching can be retrieved by callback for signal ENGINE_WORD_LIST_SIGNAL
+ * \sa dict_eng_search_word_translation() :|: dict_eng_search_word_translation_extended() :|: dict_eng_set_callback() :|: ENGINE_WORD_LIST_SIGNAL
+ */
+#define dict_eng_search_word_list(engine,pattern)                      ( (engine)->engine_search_word_list((engine), (pattern)) )
+
+
+/** \brief Start searching for word translation in dictionary.
+ *
+ * Start searching for translation of word. To be able to retrieve translation user should use callback for ENGINE_WORD_TRANSLATION_SIGNAL signal.
+ *  
+ * @param engine :: <b>Engine*</b> - dictionary in which we want find word's translation
+ * @param word :: <b>gchar*</b> - string representing word which translation we are looking for
+ * @return <i><b>void</b></i> :: nothing. Result of searching can be retrieved by callback for signal ENGINE_WORD_TRANSLATION_SIGNAL
+ * \sa dict_eng_search_word_list() :|: dict_eng_search_word_translation_extended() :|: dict_eng_set_callback() :|: ENGINE_WORD_TRANSLATION_SIGNAL
+ */
+#define dict_eng_search_word_translation(engine,word)          ( (engine)->engine_search_word_translation((engine), (word)) )
+
+
+/** \brief Start searching for extended word translation in dictionary.
+ *
+ * Start searching for extended  translation of word. To be able to retrieve translation user should use callback for ENGINE_WORD_TRANSLATION_SIGNAL signal. Extended means
+ * that retrieved translation's string could be some more than plain text (e.g. HTML, Image, etc.). User of engine should know what kind of data will retrieve ofter calling this method.
+ * \todo This option are in projecting phase. In the future callback for ENGINE_WORD_TRANSLATION_SIGNAL should take parameter <i>gpointer</i> than <i>gchar*</i> to make possible
+ * for user of engine to retrieve data different than gchar*. There shold be also some additional function letting know user what kind of data he will retrieve.
+ *  
+ * @param engine :: <b>Engine*</b> - dictionary in which we want find word's translation
+ * @param word :: <b>gchar*</b> - string representing word which translation we are looking for
+ * @return <i><b>void</b></i> :: nothing. Result of searching can be retrieved by callback for signal ENGINE_WORD_TRANSLATION_SIGNAL
+ * \sa dict_eng_search_word_list() :|: dict_eng_search_word_translation() :|: dict_eng_set_callback() :|: ENGINE_WORD_TRANSLATION_SIGNAL
+ */
+#define dict_eng_search_word_translation_extended(engine,word)         ( (engine)->engine_search_word_translation_extended((engine), (pattern)) )
+
+
+/** \brief Setting any callback for current dictionary.
+ *
+ * As long as functions which search for words list or translation do not return any value, user has to set callback which will be called after searching end. This make easy
+ * calling these functions from other proccess, threads etc. This function sets callbacks for every signal.
+ *  
+ * @param engine :: <b>Engine*</b> - dictionary for which we want set some callback
+ * @param signal :: <b>gchar*</b> - string representing for what signal we want to set callback
+ * @param c_handler :: <b>gpointer</b> - pointer to function which will be called after signal <i>signal</i> will occured
+ * @param data :: <b>gpointer</b> - pointer to user data, which will be always passed to callback <i>c_handler</i> for signal <i>signal</i>as a last argument
+ * @return <i><b>gpointer</b></i> :: pointer to previous callback; if this callbacks was not set yet, it returns NULL
+ * \sa cb_word_list :|: cb_word_translation :|:  ENGINE_WORD_LIST_SIGNAL :|: ENGINE_WORD_TRANSLATION_SIGNAL
+ */
+#define dict_eng_set_callback(engine,signal,c_handler,data)            ( (engine)->engine_set_callback((engine),(signal),(c_handler),(data)) )
+
+//______________________________________________________________________________________________________
+// ******************************************************************************************************
+//******************************************************************* SIGNALS DEFINITION FOR CALLBACKS:
+/** \brief Signal description's definition for callback called when word list was found.
+ *
+ * ENGINE_WORD_LIST_SIGNAL defines name for signal passed to dict_eng_set_callback() function as a 
+ * signal parameter. Function set to handle this signal should be called from dict_eng_search_word_list() only
+ * and have cb_word_list type.
+ * <b>NOTE:</b> programmers must not use value of ENGINE_WORD_LIST_SIGNAL directly!
+ * \sa cb_word_list :|: dict_eng_set_callback() :|: dict_eng_search_word_list() :|: ENGINE_WORD_TRANSLATION_SIGNAL
+ */
+#define ENGINE_WORD_LIST_SIGNAL        "on_word_list_found"
+
+
+/** \brief Signal description's definition for callback called when word translation was found.
+ *
+ * ENGINE_WORD_TRANSLATION_SIGNAL defines name for signal passed to dict_eng_set_callback() function as a 
+ * signal parameter. Function set to handle this signal should be called from dict_eng_search_word_translation() and  dict_eng_search_word_translation_extended() only
+ * and have cb_word_translation.
+ * <b>NOTE:</b> programmers must not use value of ENGINE_WORD_LIST_SIGNAL directly!
+ * \sa cb_word_translation :|: dict_eng_set_callback() :|: dict_eng_search_word_translation() :|: ENGINE_WORD_LIST_SIGNAL
+ */
+#define ENGINE_WORD_TRANSLATION_SIGNAL "on_word_translation_found"
+
+
+
+//______________________________________________________________________________________________________
+// ******************************************************************************************************
+//************************************************************************** DEFINITIONS OF ENUMS TYPES:
+/** \brief Codes of flags used to auto optimizing dictionary file (passes to dict_eng_module_create() function as a parameter flags).
+ * 
+ * - Enum type for flags used as a flags parameter for dict_eng_module_create() function.
+ */
+typedef enum
+{
+       ENGINE_CREATE = 0,              ///< :: flags says thatoptimization (any methods of optimalization) should be enabled. If optimization methods needs to make some files and these files exists, enigne will just use it (do not refresh).
+       ENGINE_NO,                              ///< :: flags says that for this particular dictionary programm should disabled optimization.
+       ENGINE_REFRESH          ///< :: the same flags as ENGINE_CREATE, but tells dict_eng_module_create() function that even if file (or any resources) for optimizatione methods exists, they should be recreated/refreshed.
+} 
+EngineOptimizationFlag;
+
+/** \brief Codes of possible errors which can occured while engine is working.
+* 
+* - Enum type for errors' codes. One of this code is always in last error variable (variable 'last error' is invisible for programmers - 
+* they should use function engine_error() and optionally engine_error_message() to get know what kind of error occured).
+*/
+typedef enum
+{
+       ENGINE_NO_ERROR = 0,            ///< :: there was no error - last action successed
+       ENGINE_WRONG_FILE,              ///< :: file, which engine tried to read, has wrong format or it is corrupted.
+       ENGINE_COULDNT_READ,            ///< :: user do not have permission to read/open file, which engine tried to open/read.
+       ENGINE_NO_FILE,                 ///< :: file, on which engine tried to operate, do not exist
+       ENGINE_OUT_OF_MEMORY    ///< :: while engine was working, "Out Of Memory" error occured
+}
+EngineStatus;
+
+
+//______________________________________________________________________________________________________
+// ******************************************************************************************************
+//********************************************************************* DEFINITIONS OF CALLBACK'S TYPES:
+/** \brief Type of callback functions for retrieving word list.
+ * 
+ * Function which is set by dict_eng_set_callback() to signal ENGINE_WORD_LIST_SIGNAL should be exactly this type.
+ * @param list :: <b>GArray*</b> - there will be all found words in this array
+ * @param pattern :: <b>gchar*</b> - pattern to which we have been looking for word lists
+ * @param error :: <b>EngineStatus</b> - error code; if everything was ok it is ENGINE_NO_ERROR
+ * @param user_data :: <b>gpointer</b> - data set by user to be passing to each callback for ENGINE_WORD_LIST_SIGNAL signal
+ */
+typedef void (*cb_word_list)(GArray* list, gchar* pattern, gpointer user_data, EngineStatus error);
+
+
+/** \brief Type of callback functions for retrieving word's translation.
+ * 
+ * Function which is set by dict_eng_set_callback() to signal ENGINE_WORD_TRANSLATION_SIGNAL should be exactly this type.
+ * @param translation :: <b>gchar*</b> - translation of word <i>word</i>
+ * @param word :: <b>gchar*</b> - word which translation we already retrieved
+ * @param error :: <b>EngineStatus</b> - error code; if everything was ok it is ENGINE_NO_ERROR
+ * @param user_data :: <b>gpointer</b> - data set by user to be passing to each callback for ENGINE_WORD_TRANSLATION_SIGNAL signal
+ */
+typedef void (*cb_word_translation)(gchar* translation, gchar* word, gpointer user_data, EngineStatus error);
+
+
+
+
+
+//______________________________________________________________________________________________________
+// ******************************************************************************************************
+//*************************************************************** DEFINITIONS OF BASIC FUNCTIONS TYPES:
+// /** \brief Predeclaration for structure Engine.
+typedef struct _Engine Engine;
+
+/** \brief Type of function getting some chars from engin.
+ *
+ * Function of this type should be used for functions which intention is to get some string from concrete dictionary.
+ * @param engine :: <i>Engine*</i> - pointer to engine on which this functions has to work
+ * @return <i><b>gchar*</b></i> :: chars which represents some information depends on concrete functions (e.g engine path etc.)
+ */
+typedef gchar*   (*getting_char)(Engine* engine);
+
+
+/** \brief Type of function getting boolean statement from engine.
+ *
+ * Function of this type should be used for functions which intention is to get boolean statement 
+ * from concrete dictionary (e.g. to get know if engine has cach file - is cashed). 
+ * @param engine :: <i>Engine*</i> - pointer to engine on which this functions has to work
+ * @return <i><b>gboolean</b></i> :: gboolean statement which gives programmers some information about state of dictionary/engine
+*/
+typedef gboolean (*getting_bool)(Engine* engine);
+
+/** \brief Type of function which hasn't got to return any value (only perform some actions).
+ *
+ * Function of this type should be used for functions which intention is only to do something 
+ * on concrete dictionary (e.g. to make cache file, delete etc.).
+ * @param engine :: <i>Engine*</i> - pointer to engine on which this functions has to work
+ * @return nothing. Functions of this type should only perform some action - there is no result
+ */
+typedef void     (*doing_only)(Engine* engine);
+
+/** \brief Type of function which can find words list from dictionary.
+* 
+* Function of this type should be used as a function for searching words list matching to pattern.
+* @param engine :: <i>Engine*</i> - pointer to engine on which this functions has to work
+* @param pattern :: <i>gchar*</i> - pointer to chars which describes pattern for searching words
+* @return nothing. This function do not return anything - result should be retrievwe by callbacks 
+*/
+typedef void    (*searching_word_list)(Engine* engine, gchar* pattern);        
+
+/** \brief Type of function which can find word's translation from dictionary.
+ * 
+ * Functions of this type should be used as a function for searching word translation in concrete dictionary.
+ * @param engine :: <i>Engine*</i> - pointer to engine on which this functions has to work
+ * @param word :: <i>gchar*</i> - pointer to chars which tells what word's translation we are looking for
+ * @return nothing. This function do not return anything - result should be retrievwe by callback
+ */
+typedef void    (*searching_word_translation)(Engine* engine, gchar* word);
+
+/** \brief Type of function which can <i>translate</i> error code to descriptive message.
+ * 
+ * Functions of this type should be used as <i>translator</i> from error code to meaningful message.
+ * @param error :: <i>EngineStatus</i> - error to which we want get description
+ * @return <i><b>gchar*</b></i> :: chars which describes us what kind of error occured (e.g. "Dictionary file has wrong file format or it is corrupted.")
+ */
+typedef gchar*  (*error_to_message)(EngineStatus error);
+
+/** \brief Type of function which should be used to set new callback for some event.
+ * 
+ * Functions of this type should be used as a <i>setter</i> for new callback functions
+ * @param engine :: <i>Engine*</i> - pointer to engine on which this functions has to work
+ * @param signal  :: <i>gchars*</i> - pointer to chars which tell us what kind of event should new_functions handle (e.g. "word_list_found", "translation_found" etc.)
+ * @param c_handler :: <i>gpointer</i> - new callback function
+ * @param user_data :: <i>gpointer</i> - pointer do structure, which should be passed as a last argument when calling new mounted callback
+ * @return <i><b>gpointer</b></i> :: gpointer to previous callback. If NULL there could be some error so programmers should check by engine_error() function if there was some 
+ * (if NULL and engine_error() return ENGINE_NO_ERROR that means that this callback was unused before).
+ * \sa ENGINE_WORD_LIST_SIGNAL :|: ENGINE_WORD_TRANSLATION_SIGNAL :|: dict_eng_set_callback() :|: cb_word_list :|: cb_word_translation
+*/
+typedef gpointer (*setting_callbacks)(Engine* engine, gchar* signal, gpointer c_handler, gpointer user_data);
+
+
+/** \brief Type of function which can get some int value from dictionary.
+ * 
+ * Functions of this type should be used if programmer want to get some int value from dictionary.
+ * @param enigne :: <i>Engine*</i> - pointer to engine on which this functions has to work
+ * @return <i><b>gint</b></i> :: int value which user wanted to get from dictionary
+ */
+typedef gint (*getting_int)(Engine* engine);
+
+
+//______________________________________________________________________________________________________
+// ******************************************************************************************************
+//********************************************************* DEFINITIONS OF ADDITIONAL FUNCTIONS TYPES:
+/** \brief Additional functions type: Type of function which should be used to check if this module could handle some location (e.g filename, URI, etc.).
+ * 
+ * Functions of this type should be used to check if dictionary in location could be handled by this engine.
+ * @param location :: <i>gchar*</i> - chars which describe location of dictionary to check
+ * @return <i><b>gboolean</i></b> :: statement telling us if this module could or could not handle dictionary under location.
+ */
+typedef gboolean (*checking_compatibiliti)(gchar* location);
+
+
+/** \brief Additional functions type: Type of function which should be used to get some chars from concrete module/engine (NOT DICTIONARY!).
+ * 
+ * Functions of this type should be used to get some descriptions from engine/module. 
+ * Information retrievs by this kind of functions are global for module (e.g: description of handles fromat, description of module etc.).
+ * @return <i><b>gchar*</i></b> :: chars which we wanted
+ */
+typedef gchar*  (*getting_chars_engine)(void);
+
+/** \brief Additional functions type: Type of function which should be used to open (create) new dictionary from location.
+ * 
+ * Functions of this type should be used to opening dictionary. 
+ * @param location :: <i>gchar*</i> - chars which describe where is the dictionary which we want to open
+ * @param flags :: <i>EngineOptimizationFlag</i> - flags to initialize/use optimization methods for opening dictionary.
+ * @return <i><b>gpointer</i></b> ::pointer to opened Engine. If NULL there was some error - programmers should check error type by calling engine_error() function.
+ */
+typedef Engine*         (*creating_engine)(gchar* location, EngineOptimizationFlag flags);
+
+
+/** \brief General dictionary structure.
+*  
+* This structure contains every data which are needed to make dictionary working. Data of dictionary are 
+* invisible for user of finnal module. User can operate on dictionary with functions to which there are pointers
+* in this structure also. engine_data is for module programmer use only. Programmer of module can put there any
+* data he want. He should not give end user any information about engine_data structure.
+*/
+struct _Engine
+{
+       /** \brief Getting location of dictionary.
+       *
+       * User can use this function if want to get location of concrete dictionary.
+       * \sa getting_char
+       **/
+       getting_char                    engine_location;
+
+       /** \brief Getting information if this dictionary is cached.
+       *
+       * User can use this function if want to know is dictionary cached actually.
+       * \sa getting_bool
+        **/
+       getting_bool                    engine_is_optimized;
+
+       /** \brief Making cache file for dictionary.
+       *
+       * User can use this function if want to make cache file for concrete dictionary.
+       * \sa doing_only
+       **/
+       doing_only                      engine_optimize;
+
+       /** \brief Searching word list.
+       *
+       * User call this function to start searching for word list.
+       * \sa searching_word_list
+       **/
+       searching_word_list             engine_search_word_list;
+
+       /** \brief Searching word's translation.
+       *
+       * User call this function to start searching for word's translation.
+       * \sa searching_word_translation
+       **/
+       searching_word_translation      engine_search_word_translation;
+
+       /** \brief Searching word's translation (preformatted HTML).
+       *
+       * User call this function to start searching for word's translation. It differs from engine_search_word_translation
+        * that it returns preformatted string (HTML format).
+       * \sa searching_word_translation
+       **/
+       searching_word_translation      engine_search_word_translation_extended;        
+
+       /** \brief Close dictionary.
+       *
+       * User call this if work with dictionary is finished and there is no need to keep this further working.
+       * \sa doing_only
+       **/
+       doing_only                      engine_close;
+
+       /** \brief Functions return laste error which occured in dictionary.
+       *
+       * Programmer should use this function after each action to check if there was not any errors.
+       * \sa getting_int
+       **/
+       getting_int                     engine_error;
+
+       /** \brief <i>Tranlsate</i> error code to meaningful message.
+       *
+       * Programmer can call this function if want to get meaningful message describes concrete error code
+       * \sa error_to_message
+       **/
+       error_to_message                        engine_error_message;
+
+       /** \brief Function to setting any callback for this dictionary.
+       * 
+       * This function can be used to set some callback function for concrete dictionary. Programmer
+       * should always set callback "word_list_found" and "word_translation_found". Developers of 
+       * new modules should also define for what kind of event end user will be able to set callback.
+       */
+       setting_callbacks               engine_set_callback;
+
+       /** \brief Module's private data area. Used only by module programmer.
+       * 
+        * Here module programmer should keep their own data (e.g. some data for searching optimalization etc.).
+       * Programmer whose only using module, should not use engine_data at all.
+       */
+       gpointer engine_data;
+};
+
+/** \brief Structure that has, as a members, pointers to helpfull functions for programmer.
+*
+* There are pointers to some functions in this structure. Programmer whom using module could use it to
+* get some useful informationa about module (e.g: format handled by module, it's version etc.). The most important
+* functions are: \n
+* engine_check() - to check if this module can handle concrete location \n
+* engine_open() - to open location
+*/
+typedef struct  {
+       
+       /** \brief Function to check compatibility beetwen module and location.
+       *       
+       * Helps programmer to check if this concrete module was designed to work with dictionary under location passed as a argument to this function 
+       * \sa checking_compatibiliti
+       */
+       checking_compatibiliti          engine_check;      
+
+       /** \brief Function to get some short description of module/engine.
+         *     
+        *  This function returns short description of module, to make possible displaying for end user what kind of module he is useing.
+        * \sa getting_chars_engine
+        */     
+       getting_chars_engine            engine_description;
+
+       /** \brief Function to get module's format.
+       *       
+       *  This function returns format of dictionary which this module can handle.
+       * \sa getting_chars_engine
+       */
+       getting_chars_engine            engine_format;
+
+       /** \brief Function to get version of module.
+       *       
+       *  This functions return version of this module/engine.
+       * \sa getting_chars_engine
+       */
+       getting_chars_engine            engine_version;
+
+       /** \brief Function to open/create new dictionary.
+       *       
+       *  This functions allow programmer to open/create module from concrete location.
+       * \sa creating_engine
+       */
+       creating_engine                         engine_create;
+} 
+EngineModule;
+
+
+/** \brief Additional functions type: type of functions wich helps load others function from module.
+ * 
+ * There should be in each module exactly one function of this type named: engine_global_functions. This function
+ * makes easier to load dynamically module. For doing this then you need only to mapped only this one function
+ * and the rest will be avaiable for you from returned structure EngineModule.
+ * @return  <i><b>EngineModule</b></i> :: structure EngineModule from which you can call next functions
+ * \sa engine_global_functions()
+ */
+typedef EngineModule (*getting_additional)(void);
+
+/** \brief Function that helps programmer to load basic functions from engine's module. 
+ *
+ * This function helps programmers to dynamically load module to their programms. Only this function needed to be
+ * mapped from *.so file. Rest of function are in returned structure EngineModule. User of module could mapped himslef
+ * others functions from concrete modules, but it is not recommended as far as developers of module could, in fact, give different
+ * names for functions. In structure EngineModule names will be always the same. NOTE for module developer: this function should be always defined in your
+ * code, to help next programmers whose will be using yours module in theirs own programms.
+ * @return <i><b>EngineModule</b></i> :: Structure EngineModule which members are functions for basic operations for this module
+ */
+extern EngineModule engine_global_functions(void);
+
+#ifdef __cplusplus
+}                                      
+#endif                         // END OF:      extern "C" {
+#endif                         // END OF:      _DICTIONARY_ENGINE_BASE
diff --git a/include/engine_xdxf.h b/include/engine_xdxf.h
new file mode 100644 (file)
index 0000000..28db41e
--- /dev/null
@@ -0,0 +1,76 @@
+#ifndef _DICTIONARY_ENGINE_XDXF
+#define _DICTIONARY_ENGINE_XDXF
+
+#include <stdio.h>
+#include <expat.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <sys/time.h>
+#include <fcntl.h>     
+#include <unistd.h>   
+
+
+#include "dictionary_engine.h"
+
+#define DIC_ENG_VERSION "0.1a"
+#define DIC_ENG_FORMAT  "XDXF"
+
+#define _BUFFER_CHECK_SIZE 1024
+#define _BUFFER_CACHEING_SIZE 1024
+#define _BUFFER_INDEX_SIZE 16*1024
+
+struct _XDXFCheckingData {
+       int deep;
+       gboolean good;  
+};
+typedef struct _XDXFCheckingData XDXFCheckingData;
+
+struct _XDXFChacheData {
+       gchar* buffer;
+       long last_start;
+       long last_stop; 
+       long last_length;
+       int output_file;
+       XML_Parser p;
+       int state;
+};
+typedef struct _XDXFChacheData XDXFChacheData;
+
+
+struct _XDXFData {
+       gchar*          location;
+       int             xdxf;
+       int             cache;
+
+       gpointer word_list;
+       gpointer translation;
+
+       EngineStatus    error;
+       cb_word_list            callback_on_word_list;
+       cb_word_translation     callback_on_word_translation;
+};
+typedef struct _XDXFData XDXFData;
+
+
+// helpfull functions
+gdouble time_info(struct timeval *y, gchar* message);
+
+// declarations of functions
+gboolean       check_compatibilit_xdxf(gchar* location);
+gchar*                 get_engine_descritpion();
+gchar*                 get_engine_format();
+gchar*                 get_engine_version();
+
+gchar*         get_location(Engine* engine);
+gboolean       is_cached(Engine* engine);
+void           do_cache(Engine* engine);
+void           search_word_list(Engine* engine, gchar* pattern);
+void           search_word_translation(Engine* engine, gchar* word);
+void           search_word_translationHTML(Engine* engine, gchar* word);
+gchar*         error_message(EngineStatus error);
+gpointer       set_callbacks(Engine* engine, gchar* event, gpointer new_funtions, gpointer user_data);
+void           close_engine(Engine* engine);
+Engine*        create_engine(gchar* location, EngineOptimizationFlag auto_cache);
+EngineModule   engine_global_functions();
+
+#endif
diff --git a/include/ws_dbus.h b/include/ws_dbus.h
new file mode 100644 (file)
index 0000000..ab43fe7
--- /dev/null
@@ -0,0 +1,274 @@
+/*
+This library is free software; you can redistribute it and/or
+modify it under the terms of the GNU Lesser General Public
+License as published by the Free Software Foundation;
+version 2.1 of the License.
+
+This library is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+Lesser General Public License for more details.
+
+You should have received a copy of the GNU Lesser General Public
+License along with this library; if not, write to the Free Software
+Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+
+Copyright 2006 ComArch S.A.
+*/
+
+#ifndef _WS_DBUS
+#define _WS_DBUS
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#include <libosso.h>
+#include <string.h>
+#include <dbus-1.0/dbus/dbus-protocol.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <glib-2.0/glib.h>
+
+/**\brief Callback function definition
+*
+*@param error - pointer to a GError structure. Currently not used
+*@param words - GArray of osso_rpc_t structures containing sent data
+*@param user_data - data passed by user while setting the callback function with ::ws_dbus_set_cb
+*\sa ws_dbus_set_cb
+*/
+typedef void (* ws_dbus_cb) (GError *error, GArray *words, gpointer user_data); 
+
+/**\brief This structure contains data vital for DBUS communication.
+*
+* These are for example both the local and remote addresses of the applications which are supposed to communicate. In this case they are the <I>GUI</I> and the <I>MANAGER</I>
+* The fields shouldn't be modified directly. It should be done by ws_dbus_config function
+*\sa ws_dbus_config
+*/
+struct _WSDBusData 
+{
+       osso_context_t * context; ///<a pointer needed by osso_initiallize
+
+       gchar *service; ///<owner service path
+       gchar *object; ///<owner object path
+       gchar *iface; ///<owner interface path
+
+       gchar *remote_service; ///<remote service path
+       gchar *remote_object; ///<remote object path
+       gchar *remote_iface; ///<remote interface path
+
+       gchar *name; ///<Program name
+       gchar *version; ///<Program version
+
+       GArray *cb_data;
+};
+
+/**
+*\brief Informs whether the transmission succeeded or not
+*/
+typedef enum 
+{
+       WS_DBUS_STATUS_OK = 0, ///<Transmission succeeded
+       WS_DBUS_STATUS_ERROR ///<Transmission error
+} WSDBusStatus;
+
+/**\brief Specifies the possible kinds of event notifications that can be sent via DBus
+*/
+typedef enum 
+{
+       WS_DBUS_INFO_TERMINATE = 1, ///<GUI signal - terminate the application
+       WS_DBUS_INFO_STOP_SEARCH, ///<GUI signal - stop the current search
+       WS_DBUS_INFO_SEARCH_FINISHED, ///<Manager signal - informs the GUI, that there will be no more results returned
+       WS_DBUS_ERROR_INVALID_FILE_FORMAT, ///<Parser error - dictionary file has invalid format
+       WS_DBUS_ERROR_FILE_NOT_FOUND, ///<Parser error - dictionary file not found
+       WS_DBUS_ERROR_NO_PERMISSION, ///<Parser error - no permission to read the dictionary file
+       WS_DBUS_ERROR_UNKNOWN, ///<Parser error - unknown error
+       WS_DBUS_ERROR_OUT_OF_MEMORY, ///<Either the UI or the manager is out of memory
+       WS_DBUS_ERROR_ENGINE_NOT_FOUND ///<Manager error - dictionary engine module, couldn't be located
+} WSDBusNotify;
+
+
+/**
+*\brief This structure is used for specifying the field of WSDBusData structure one would like to modify.
+*
+*It is used in the ws_dbus_config function. Its main purpose is to clarify D-BUS configuration.
+*/
+typedef enum 
+{
+       WS_DBUS_CONFIG_SERVICE = 1,
+       WS_DBUS_CONFIG_OBJECT,
+       WS_DBUS_CONFIG_IFACE,
+       WS_DBUS_CONFIG_REMOTE_SERVICE,
+       WS_DBUS_CONFIG_REMOTE_OBJECT,
+       WS_DBUS_CONFIG_REMOTE_IFACE
+} WSDBusConfig;
+
+typedef struct _WSDBusData WSDBusData;
+
+
+/**\brief First function to be called in every program using this wrapper library
+*
+*This function is used for allocating memory for the WSDBusData structure and setting some basic parameters. 
+*@param name - name of the application
+*@param version - app's version
+*@return pointer to WSDBusData structure\n
+*\sa ::WSDBusData
+*/
+WSDBusData * ws_dbus_create (gchar *name, gchar *version);
+
+/**\brief This function is used for setting dbus service/client parameters.
+*
+*These include the addresses of both remote and local apps communicating
+*@param ws_dbus_data - pointer to a structure uniquely identifying the application for DBus. The possible values of 
+*this parameter are listed here: ::WSDBusConfig
+*@param field - the name of the variable, this function is supposed to set. 
+*@param value - the value of the variable
+*@return WS_STATUS_OK - on success \n
+*WS_STATUS_ERROR - on error
+*\sa ::WSDBusConfig
+*/
+WSDBusStatus ws_dbus_config (WSDBusData * ws_dbus_data, WSDBusConfig field, gchar *value);
+
+/**
+*\brief Initialize D-BUS communication.
+*
+*It should be the called after <B>ws_dbus_create</B> and after setting all D-BUS parameters with the <B>ws_dbus_config</B> function. 
+*The structure it returns is necessary to call out every function implemented in this wrapper library.
+*@param ws_dbus_data - it's a structure containing the unique paths to objects and interfaces to be registered in the DBus session daemon
+*@return WS_STATUS_OK - on success \n
+*WS_STATUS_ERROR - on error
+*\sa ::WSDBusConfig, ws_dbus_create, ws_dbus_config
+*/
+WSDBusStatus ws_dbus_connect (WSDBusData * ws_dbus_data);
+
+/**\brief Function deinitializing D-BUS wrapper library
+*
+*Before the program exits, all memory allocated by D-BUS should be freed.
+@param ws_dbus_data - pointer to a structure uniquely identifying the application for DBus
+*@return WS_STATUS_OK - on success \n
+*WS_STATUS_ERROR - on error
+*/
+
+void ws_dbus_destroy (WSDBusData * ws_dbus_data);
+
+/**\brief This function is used for setting a callback function for some predefined signals. 
+*
+*Some of the signals should be used only by the <I>GUI</I>, others by the <I>MANAGER</I>.
+*
+*@param ws_dbus_data - pointer to a structure uniquely identifying the application for D-BUS
+*@param detailed_signal - string containing the signal name which will trigger the function passed in 
+*the c_func parameter.
+*@param c_func - is a pointer to the signal handling function.
+*@param        user_data - is the data passed directly to the signal handling function
+*      
+*The predefined signal values for the GUI part are:
+*
+*      - <I>"return_words"</I> - used for receiving a list of words found by the <I>MANAGER</I>
+*      - <I>"return_translations"</I> - used for receiving a list of translations found by the <I>MANAGER</I>
+*      - <I>"signal"</I> - used for handling signals from the <I>MANAGER</I>. In this case they are mainly error signals.
+*
+*The predefined signal values for the MANAGER part are:
+*
+*      - <I>"find_word"</I> - used for receiving the word a user is looking for
+*      - <I>"find_translation"</I> - used for receiving the word a user needs to translate
+*      - <I>"signal"</I> - used for handling signals from the <I>GUI</I>. In this case they are termination and stop search signals.
+*
+*@return WS_STATUS_OK - on success \n
+*WS_STATUS_ERROR - on error
+*\sa ::WSDBusConfig \n
+*#ws_dbus_cb
+*/
+
+WSDBusStatus ws_dbus_set_cb (WSDBusData * ws_dbus_data, gchar * detailed_signal, gpointer c_func, gpointer user_data);
+
+/**\brief Send signal to the remote application
+*
+*A purpose of this function is to send signals between both ends.
+*@param ws_dbus_data - pointer to a structure uniquely identifying the application for D-BUS
+*@param ws_dbus_info - the command or information to send to the other side.
+*\sa #WSDBusNotify
+*/
+
+WSDBusStatus ws_dbus_notify (WSDBusData * ws_dbus_data, WSDBusNotify ws_dbus_info);
+
+/**\brief Find a word in the dictionary
+*
+*This is run by <I>GUI</I>. This function is used for finding a word, the user is searching for. It should be 
+*called after the user enters a word in the text field and presses the search button.
+*
+*@param ws_dbus_data - pointer to a structure uniquely identifying the application for DBus
+*@param word - the word, user is looking for
+*@return WS_STATUS_OK - on success \n
+*WS_STATUS_ERROR - on error
+*/
+
+WSDBusStatus ws_dbus_client_find_word (WSDBusData * ws_dbus_data, gchar * word);
+
+/**\brief Find translation of a word
+*
+*This is run by <I>GUI</I>. When a user selects a word from the words list, this function is called in order 
+*to find the translation of the selected word. 
+*
+*@param ws_dbus_data - pointer to a structure uniquely identifying the application for DBus
+*@param word - a word, for which the user wishes to find the translation
+*@return WS_STATUS_OK - on success \n
+*WS_STATUS_ERROR - on error
+*/
+
+WSDBusStatus ws_dbus_client_find_translation (WSDBusData * ws_dbus_data, gchar * word);
+
+/**\brief Return a list of words
+*
+*Transmits a list of words found by the parsing engine/engines
+*
+*@param ws_dbus_data - pointer to a structure uniquely identifying the application for DBus
+*@param words - a GArray of words, the engine thread returned
+*@return WS_STATUS_OK - on success \n
+*WS_STATUS_ERROR - on error
+*/
+
+WSDBusStatus ws_dbus_server_return_words  (WSDBusData * ws_dbus_data, GArray * words);
+
+/**
+*This function is used for returning the list of words the parsing thread has 
+*found. It should be run after the last thread finishes the search, because it also 
+*signalizes the GUI that the search has finished.
+*
+*@param ws_dbus_data - pointer to a structure uniquely identifying the application for DBus
+*@param words - a GArray of words, the engine thread returned
+*@return WS_STATUS_OK - on success \n
+*WS_STATUS_ERROR - on error
+*/
+
+// WSDBusStatus ws_dbus_server_return_words_last  (WSDBusData * ws_dbus_data, GArray * words);
+
+/**\brief Return a translation of a given word
+*
+*This is run by the <I>MANAGER</I>. It returns a translation of a previously sent word
+*
+*@param ws_dbus_data - pointer to a structure uniquely identifying the application for DBus
+*@param translation - a string containing the word's translation
+*@return WS_STATUS_OK - on success \n
+*WS_STATUS_ERROR - on error
+*/
+
+WSDBusStatus ws_dbus_server_return_translations (WSDBusData * ws_dbus_data, gchar * translation);
+
+/**
+*This function is used for returning the list of translations the parsing thread       
+*finds. It should be ran after the *last thread finishes the search, because it also   
+*signalizes the GUI that the search has finished.
+*
+*@param ws_dbus_data - pointer to a structure uniquely identifying the application for DBus
+*@param translation - a string containing the word's translation
+*@return WS_STATUS_OK - on success \n
+*WS_STATUS_ERROR - on error
+*/
+
+// WSDBusStatus ws_dbus_server_return_translations_last (WSDBusData * ws_dbus_data, gchar * translation);
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif
diff --git a/include/ws_gui.h b/include/ws_gui.h
new file mode 100644 (file)
index 0000000..4faf8fa
--- /dev/null
@@ -0,0 +1,139 @@
+/*****************
+* Copyright 2006, ComArch S.A
+* All rights reserved
+*****************/
+
+#ifndef _WS_GUI
+#define _WS_GUI 
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+
+#include <hildon-widgets/hildon-program.h>
+#include <hildon-widgets/hildon-window.h>
+#include <hildon-widgets/hildon-banner.h>
+#include <hildon-widgets/hildon-find-toolbar.h>
+#include <gdk/gdkkeysyms.h>
+
+#include <hildon-widgets/gtk-infoprint.h>
+#include <gdk/gdkkeysyms.h>
+#include <gtk/gtk.h>
+#include <gtkhtml/gtkhtml.h>
+#include <glib.h>
+#include <glib/gprintf.h>
+#include <string.h>
+#include <stdlib.h>
+
+#include "ws_dbus.h"
+
+#define HISTORY_LEN 5
+#define SCROLL_STEP_H 50
+#define SCROLL_STEP_V 20
+
+
+typedef struct WSGuiAppData WSGuiApp;
+
+
+
+/** \brief do czego ta struktura
+ *
+ * opis d³uzszy
+ */
+struct WSGuiMenu {
+       /* file ws_gui_menu*/
+       GtkWidget *ws_gui_main_menu; ///< 
+       GtkWidget *ws_gui_menu_edit;
+               GtkWidget *ws_gui_menu_copy;
+               GtkWidget *ws_gui_menu_select_all;
+       GtkWidget *ws_gui_menu_view;
+               GtkWidget *ws_gui_menu_hide_list;
+               GtkWidget *ws_gui_menu_zoom_in;
+               GtkWidget *ws_gui_menu_zoom_out;
+               GtkWidget *ws_gui_menu_full_screen;
+       GtkWidget *ws_gui_menu_search;
+               GtkWidget *ws_gui_menu_find_word;
+               GtkWidget *ws_gui_menu_find_prev;
+               GtkWidget *ws_gui_menu_find_next;
+               GtkWidget *ws_gui_menu_stop;
+       GtkWidget *ws_gui_menu_close;
+
+       GtkWidget *ws_gui_submenu_1;
+       GtkWidget *ws_gui_submenu_2;
+       GtkWidget *ws_gui_submenu_3;
+       GtkWidget *ws_gui_separator;
+
+       /* ws_gui_menu popup*/
+       GtkWidget *ws_gui_popup_menu; 
+       GtkWidget *ws_gui_popup_edit;
+       GtkWidget *ws_gui_popup_submenu;
+       GtkWidget *ws_gui_popup_copy;
+       GtkWidget *ws_gui_popup_select_all;
+       GtkWidget *ws_gui_popup_zoom_in;
+       GtkWidget *ws_gui_popup_zoom_out;
+};
+
+struct WSGuiList {
+       GtkWidget       *ws_gui_list;
+       GtkWidget       *ws_gui_list_item;
+       GtkWidget       *ws_gui_list_label;
+       gchar           *ws_gui_string;
+       gchar ws_gui_buffer[10];
+       
+       GtkObject       *ws_gui_list_item_object;
+        gchar           *ws_gui_list_item_data_string;
+       GList           *ws_gui_dlist;
+
+};
+
+struct WSGuiAppData {
+       HildonProgram *ws_gui_hildon_program;
+       HildonWindow *ws_gui_hildon_window;
+       GtkWidget *ws_gui_scrolledwindow_right;
+       GtkWidget *ws_gui_html;
+       GtkWidget *ws_gui_hpane;
+       HildonFindToolbar *ws_gui_hildon_find_toolbar;
+       GtkToolItem *ws_gui_toobar_button_close;
+       GtkToolItem *ws_gui_toobar_button_back;
+       GtkToolItem *ws_gui_toobar_button_forward;
+       GtkToolItem *ws_gui_toobar_button_stop;
+       GtkWidget *ws_gui_banner;
+       GtkToolItem *ws_gui_toobar_button_hide;
+       GtkWidget *ws_gui_scrolledwindow_left;
+       gchar *ws_gui_html_source;
+       GtkClipboard *ws_gui_clipboard; 
+
+       GdkAtom *ws_gui_atom;
+
+       GtkAdjustment* ws_gui_vadj;
+       GtkAdjustment* ws_gui_hadj;
+       gdouble v_delta;
+       gdouble v_new_value;
+       gdouble h_delta;
+       gdouble h_new_value;
+       gdouble cur_vadj;
+       gdouble prev_vadj;
+       gdouble cur_hadj;
+       gdouble prev_hadj;
+
+       GArray *ws_gui_history;
+       GArray *ws_gui_history_content;
+       gint ws_gui_history_cur_pos;
+       struct WSGuiMenu *ws_gui_menu;
+       struct WSGuiList *ws_gui_w_list;
+       
+       gboolean ws_gui_banner_flag;
+       gboolean ws_gui_full_screen_flag;
+
+       WSDBusData *dbus_data;
+
+       GtkWidget* ws_message_dialog;
+
+};
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif
diff --git a/include/ws_gui_callbacks.h b/include/ws_gui_callbacks.h
new file mode 100644 (file)
index 0000000..ced134b
--- /dev/null
@@ -0,0 +1,164 @@
+/*****************
+* Copyright 2006, ComArch S.A
+* All rights reserved
+*****************/
+
+#ifndef _WS_GUI_CALLBACKS
+#define _WS_GUI_CALLBACKS 
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+
+#include "ws_gui.h"
+
+
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <sys/time.h>
+#include <fcntl.h>     
+#include <unistd.h>   
+
+#define TIMER_START TRUE
+#define TIMER_STOP  FALSE
+
+
+/*do dbusa*/
+/** \brief handle dbus signals
+ *
+ */
+void ws_gui_signal_hander (GError *error, GArray *words, gpointer user_data);
+
+/** \brief handle dbus signal and transfer words to the words list
+ *
+ */
+void ws_gui_dbus_return_words (GError *error, GArray *words, gpointer user_data);
+
+/** \brief handle dbus signal and convert message into readable text (translation of the word)
+ *
+ */
+void ws_gui_dbus_return_translation (GError *error, GArray *words, gpointer user_data);
+
+
+/**  \brief is used to free memory, which was allocated
+*
+*/
+void ws_gui_free_memory(gpointer user_data);
+
+/**  \brief handle keys press signals (hardware keys in device)
+*
+*/
+gboolean hildon_key_press_listener (GtkWidget * widget, GdkEventKey * keyevent, gpointer user_data);
+
+/**  \brief handle button press signal.
+*
+*/
+gboolean ws_gui_button_press_event(GtkWidget *widget, GdkEventButton *event, gpointer user_data);
+
+/**  \brief allow to hide words list from menu
+*
+*/
+void ws_gui_words_list_hide_from_menu(GtkCheckMenuItem *checkmenuitem, gpointer user_data);
+
+/**  \brief allow to hide words list from toolbar
+*
+*/
+void ws_gui_words_list_hide(GtkToggleButton *togglebutton, gpointer user_data);
+
+/**  \brief add word to the words history
+*
+*/
+void ws_gui_history_add(char *new_word, gpointer user_data);
+
+/**  \brief display translation of word stored in the history (previous, if available)
+*
+*/
+void ws_gui_history_back(GtkButton *button, gpointer user_data);
+
+/**  \brief display translation of word stored in the history (forward, if available)
+*
+*/
+void ws_gui_history_next(GtkButton *button, gpointer user_data);
+
+/** \brief check history and disable buttons or uncheck checkbuttons (depends on history availablity)
+ *
+ */
+void ws_gui_check_history(gpointer user_data);
+
+
+/**  \brief fill words list with words recived from the engine
+*
+*/
+void ws_gui_fill_the_list(GArray *words_list, gpointer user_data);
+
+/** \brief handle selected item from the words list and send a query for a translation
+ *
+ */
+void ws_gui_list_item_select(GtkList *list, GtkWidget *child, gpointer user_data);
+
+/**  \brief switch view between full screen and normal mode 
+*
+*/
+void ws_gui_full_screen(GtkMenuItem *menuitem, gpointer user_data);
+
+/**  \brief allows to select whole text in translation (html) area
+*
+*/
+void ws_gui_html_select_all(GtkMenuItem *menuitem, gpointer user_data);
+
+/**  \brief allows to copy text from translation (html) area into clipboard
+*
+*/
+void ws_gui_html_copy(GtkMenuItem *menuitem, gpointer user_data);
+
+/**  \brief magnify translation (html) area
+*
+*/
+void ws_gui_html_zoom_in(GtkMenuItem *menuitem, gpointer user_data);
+
+/**  \brief zoom out translation (html) area.
+*
+*/
+void ws_gui_html_zoom_out(GtkMenuItem *menuitem, gpointer user_data);
+
+/**  \brief start search (sends typed word to the engine)
+*
+*/
+void ws_gui_search(GtkWidget * widget, gpointer user_data);
+
+/**  \brief  abort search
+*
+*/
+void ws_gui_search_stop(GtkButton *button, gpointer user_data);
+
+/**  \brief used when user closes the application
+*
+*/
+void ws_gui_on_exit (GtkWidget *widget, GdkEvent *event, gpointer user_data);
+
+/**  \brief used when user closes the application from menu
+*
+*/
+void ws_gui_menu_quit(GtkMenuItem *menuitem, gpointer user_data);
+
+/**  \brief sets content of translation (html) area
+*
+*/
+void ws_gui_fill_html(char *html_context, gpointer user_data);
+
+/** \brief read current adjustment value
+ *
+ */
+void ws_gui_read_adjustment(gpointer user_data);
+
+/** \brief set         appropriate value of adjustment
+ *
+ */
+void ws_gui_adjustment_changed (GtkAdjustment *adjustment, gpointer user_data);
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif
diff --git a/include/ws_gui_layout.h b/include/ws_gui_layout.h
new file mode 100644 (file)
index 0000000..248d66b
--- /dev/null
@@ -0,0 +1,44 @@
+/*****************
+* Copyright 2006, ComArch S.A
+* All rights reserved
+*****************/
+
+#ifndef _WS_GUI_LAYOUT
+#define _WS_GUI_LAYOUT
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#include "ws_gui.h"
+#include "ws_gui_callbacks.h"
+
+/**
+* \brief create main window (all widgets)
+*
+*/
+void ws_gui_create_window(gpointer user_data);
+
+/**
+* \brief create find toolbar
+*
+*/
+void ws_gui_create_find_toolbar(gpointer user_data);
+
+/**
+* \brief create application menu
+*
+*/
+void ws_gui_create_main_menu (gpointer user_data);
+
+/**
+* \brief create popup menu
+*
+*/
+void ws_gui_create_popup_menu (GtkWidget *widget, GdkEventButton *event, gpointer user_data);
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif
diff --git a/include/ws_manager.h b/include/ws_manager.h
new file mode 100644 (file)
index 0000000..d00416f
--- /dev/null
@@ -0,0 +1,148 @@
+/************************************************************************************************
+This file is part of WhiteStork.
+
+WhiteStork is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2 of the License, or
+(at your option) any later version.
+
+WhiteStork is distributed in the hope that it will be useful, 
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+GNU General Public License for more details.
+
+You should have received a copy of the GNU General Public License 
+along with WhiteStork; if not, write to the Free Software
+Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+
+Copyright 2006 ComArch S.A.
+************************************************************************************************/
+#ifndef _WS_MANAGER
+#define _WS_MANAGER
+
+#include <stdio.h>
+#include <stdlib.h>
+#include <unistd.h>
+#include <pthread.h>
+#include <gmodule.h>
+#include <glib.h>
+#include <glib/gstdio.h>
+#include "dictionary_engine.h"
+#include "ws_dbus.h"
+
+struct _WSMngSearchData
+{
+       GArray *dict; ///< pointer to GArray structure which stores pointers to fuction used to service dictionaries 
+       GArray *modules; ///< pointer to GArray structure which stores pointers to fuction used to service modules loading
+       gchar *word; ///< word which will be used to search a dictionaries
+       //pthread_mutex_t a_mutex ///< mutex used to  synchronize threads
+       pthread_t p_thread; ///< a thread in which we serching 
+       WSDBusData *dbus_data; ///< a DBUS data
+       GMainLoop *loop; ///pointer to main loop
+       GModule *library; ///library used to load modules
+};
+
+typedef struct _WSMngSearchData WSMngSearchData;
+/** 
+* \brief Function is used to initialize D-BUS
+*
+*@param data structure stores variables which are need to comunicate by D-BUS.
+*/
+void ws_mng_init_dbus (WSMngSearchData *data);
+/**
+* \brief Function used to initialize user interface
+*
+* In this function new process is spawned and in this process user interfece is started.
+*/
+void ws_mng_init_gui ();
+
+/**
+* \brief Function used to initialize manager
+*
+* Fuction loads from modules pointers to functions used to service searching in dictionaries and stores them in WSMngSearchData structure
+*@param data pointer to structure WSMngSearchData which stores variables needed to service manager
+*/
+void ws_mng_init (WSMngSearchData *data);
+
+/**
+* \brief Function is used for set active configuration of dictionaries chosen by user.
+*
+* When changes in GConf configuration occurs function clean structure which store pointers to functions used to service searching in dictionaries and fills it again. The dictionaries are omitted when it they are not selected by user.
+*@param data pointer to a structure holding pointers to functions used to service searching in dictionaries
+*/
+void ws_mng_set_active_dict (WSMngSearchData *data);
+
+
+/**
+* \brief Called when find word event occurs 
+*
+* @param word word to search
+* @param error error messages
+* @param user_data user data passed to function
+*/
+void ws_mng_on_search_word (GError *error, GArray *word, gpointer user_data);
+
+/**
+* \brief Function used to run search for word engine in threads
+* 
+* @param data required data for searach word
+* @return gpointer return value 
+*/
+gpointer ws_mng_search_word (gpointer data);
+
+/**
+* \brief Called when find translation event occurs
+*
+* @param word word to search
+* @param error error messages
+* @param user_data user data passed to function
+*/
+void ws_mng_on_search_translation (GError *error, GArray *word, gpointer user_data);
+
+/**
+* \brief Function used to run search for transaltion of word engine in threads
+* 
+* @param data required data for search translation
+* @return gpointer return value 
+*/
+gpointer ws_mng_search_translation (gpointer data);
+
+/**
+* \brief Used to return results of found word from threads 
+*
+* @param list word list found in dictionaries
+* @param pattern a word which is being search for in dictionaries
+* @param user_data data passed to function
+* @param error engine status information
+*/
+void ws_mng_on_found_word (GArray* list, gchar* pattern, gpointer user_data, EngineStatus error);
+
+/**
+* \brief Used to return results of transaltion from threads
+*
+* @param translation translation of word found in dictionaries
+* @param pattern a word which is being serch for in dictionaries
+* @param user_data data passed to function
+* @param error engine status information
+*/
+
+void ws_mng_on_found_translation (gchar* translation, gchar* pattern, gpointer user_data, EngineStatus error);
+
+/**
+* \brief Function used to close dictionaries and modules
+*
+* @param data structure holds pointers to data which need to be freed from memory
+*/
+void ws_mng_close (WSMngSearchData *data);
+
+/**
+* \brief Function used for handling signals sent by user interface
+*
+* @param error error messages
+* @param signal type of signal
+* @param user_data data passed to function 
+*/
+void ws_mng_signal_handling (GError *error, GArray *signal, gpointer user_data);
+
+#endif
+
diff --git a/makefile b/makefile
new file mode 100644 (file)
index 0000000..6adb5d9
--- /dev/null
+++ b/makefile
@@ -0,0 +1,40 @@
+CC = gcc
+DEBUG = -Wall -g
+LIBS = `pkg-config --libs glib-2.0 gmodule-2.0 libosso` -lpthread
+FLAGS = `pkg-config --cflags glib-2.0 gmodule-2.0 libosso`
+SOURCE = src
+BINARY = bin
+INCLUDE = include
+EXECUTABLE = ${BINARY}/WhiteStork
+
+all: ${BINARY}/engine_xdxf.so ${BINARY}/ws_dbus.o ${BINARY}/gui ${BINARY}/test_manager
+               @echo -e "\n.::======================= Success!! ===================::.\n\n"
+       
+${BINARY}/test_manager:
+               @echo -e "\n.::================ Compiling Manager ... ==============::."
+               @cd manager && make
+#              @${CC} -c ${SOURCE}/ws_manager.c ${FLAGS} ${DEBUG} -o ${BINARY}/ws_manager.o
+               @echo -e "\n.::============ Manager Compilation Finished. ==========::.\n\n"
+${BINARY}/ws_dbus.o:
+               @echo -e "\n.::================= Compiling D-BUS ... ===============::."
+               @cd dbus && make
+               @echo -e "\n.::============= D-BUS Compilation Finished. ===========::.\n\n"
+${BINARY}/gui:
+               @echo -e "\n.::==================  Compiling GUI ...  ==============::."
+               @cd gui && make
+               @echo -e "\n.::=============== GUI Compilation Finished. ============::.\n\n"
+${BINARY}/engine_xdxf.so:
+               @echo -e "\n.::================= Compiling Engine ... ==============::."
+               @cd engine && make
+               @echo -e "\n.::============ Engine Compilation Finished. ==========::.\n\n"
+clean:
+               @echo -e "\n.::==================== cleaning ... ==================::."
+               @-rm ${BINARY}/*
+               @cd gui && make clean
+               @cd dbus && make clean
+               @cd engine && make clean
+               @cd manager && make clean
+               @echo -e "\n.::================= cleaning finished ================::.\n\n"
+run:
+               run-standalone.sh ./${EXECUTABLE}
+               
\ No newline at end of file
diff --git a/manager/COPYING b/manager/COPYING
new file mode 100644 (file)
index 0000000..fb6319b
--- /dev/null
@@ -0,0 +1,339 @@
+    GNU GENERAL PUBLIC LICENSE
+                      Version 2, June 1991
+
+ Copyright (C) 1989, 1991 Free Software Foundation, Inc.,
+ 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ Everyone is permitted to copy and distribute verbatim copies
+ of this license document, but changing it is not allowed.
+
+                           Preamble
+
+  The licenses for most software are designed to take away your
+freedom to share and change it.  By contrast, the GNU General Public
+License is intended to guarantee your freedom to share and change free
+software--to make sure the software is free for all its users.  This
+General Public License applies to most of the Free Software
+Foundation's software and to any other program whose authors commit to
+using it.  (Some other Free Software Foundation software is covered by
+the GNU Lesser General Public License instead.)  You can apply it to
+your programs, too.
+
+  When we speak of free software, we are referring to freedom, not
+price.  Our General Public Licenses are designed to make sure that you
+have the freedom to distribute copies of free software (and charge for
+this service if you wish), that you receive source code or can get it
+if you want it, that you can change the software or use pieces of it
+in new free programs; and that you know you can do these things.
+
+  To protect your rights, we need to make restrictions that forbid
+anyone to deny you these rights or to ask you to surrender the rights.
+These restrictions translate to certain responsibilities for you if you
+distribute copies of the software, or if you modify it.
+
+  For example, if you distribute copies of such a program, whether
+gratis or for a fee, you must give the recipients all the rights that
+you have.  You must make sure that they, too, receive or can get the
+source code.  And you must show them these terms so they know their
+rights.
+
+  We protect your rights with two steps: (1) copyright the software, and
+(2) offer you this license which gives you legal permission to copy,
+distribute and/or modify the software.
+
+  Also, for each author's protection and ours, we want to make certain
+that everyone understands that there is no warranty for this free
+software.  If the software is modified by someone else and passed on, we
+want its recipients to know that what they have is not the original, so
+that any problems introduced by others will not reflect on the original
+authors' reputations.
+
+  Finally, any free program is threatened constantly by software
+patents.  We wish to avoid the danger that redistributors of a free
+program will individually obtain patent licenses, in effect making the
+program proprietary.  To prevent this, we have made it clear that any
+patent must be licensed for everyone's free use or not licensed at all.
+
+  The precise terms and conditions for copying, distribution and
+modification follow.
+
+                   GNU GENERAL PUBLIC LICENSE
+   TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
+
+  0. This License applies to any program or other work which contains
+a notice placed by the copyright holder saying it may be distributed
+under the terms of this General Public License.  The "Program", below,
+refers to any such program or work, and a "work based on the Program"
+means either the Program or any derivative work under copyright law:
+that is to say, a work containing the Program or a portion of it,
+either verbatim or with modifications and/or translated into another
+language.  (Hereinafter, translation is included without limitation in
+the term "modification".)  Each licensee is addressed as "you".
+
+Activities other than copying, distribution and modification are not
+covered by this License; they are outside its scope.  The act of
+running the Program is not restricted, and the output from the Program
+is covered only if its contents constitute a work based on the
+Program (independent of having been made by running the Program).
+Whether that is true depends on what the Program does.
+
+  1. You may copy and distribute verbatim copies of the Program's
+source code as you receive it, in any medium, provided that you
+conspicuously and appropriately publish on each copy an appropriate
+copyright notice and disclaimer of warranty; keep intact all the
+notices that refer to this License and to the absence of any warranty;
+and give any other recipients of the Program a copy of this License
+along with the Program.
+
+You may charge a fee for the physical act of transferring a copy, and
+you may at your option offer warranty protection in exchange for a fee.
+
+  2. You may modify your copy or copies of the Program or any portion
+of it, thus forming a work based on the Program, and copy and
+distribute such modifications or work under the terms of Section 1
+above, provided that you also meet all of these conditions:
+
+    a) You must cause the modified files to carry prominent notices
+    stating that you changed the files and the date of any change.
+
+    b) You must cause any work that you distribute or publish, that in
+    whole or in part contains or is derived from the Program or any
+    part thereof, to be licensed as a whole at no charge to all third
+    parties under the terms of this License.
+
+    c) If the modified program normally reads commands interactively
+    when run, you must cause it, when started running for such
+    interactive use in the most ordinary way, to print or display an
+    announcement including an appropriate copyright notice and a
+    notice that there is no warranty (or else, saying that you provide
+    a warranty) and that users may redistribute the program under
+    these conditions, and telling the user how to view a copy of this
+    License.  (Exception: if the Program itself is interactive but
+    does not normally print such an announcement, your work based on
+    the Program is not required to print an announcement.)
+
+These requirements apply to the modified work as a whole.  If
+identifiable sections of that work are not derived from the Program,
+and can be reasonably considered independent and separate works in
+themselves, then this License, and its terms, do not apply to those
+sections when you distribute them as separate works.  But when you
+distribute the same sections as part of a whole which is a work based
+on the Program, the distribution of the whole must be on the terms of
+this License, whose permissions for other licensees extend to the
+entire whole, and thus to each and every part regardless of who wrote it.
+
+Thus, it is not the intent of this section to claim rights or contest
+your rights to work written entirely by you; rather, the intent is to
+exercise the right to control the distribution of derivative or
+collective works based on the Program.
+
+In addition, mere aggregation of another work not based on the Program
+with the Program (or with a work based on the Program) on a volume of
+a storage or distribution medium does not bring the other work under
+the scope of this License.
+
+  3. You may copy and distribute the Program (or a work based on it,
+under Section 2) in object code or executable form under the terms of
+Sections 1 and 2 above provided that you also do one of the following:
+
+    a) Accompany it with the complete corresponding machine-readable
+    source code, which must be distributed under the terms of Sections
+    1 and 2 above on a medium customarily used for software interchange; or,
+
+    b) Accompany it with a written offer, valid for at least three
+    years, to give any third party, for a charge no more than your
+    cost of physically performing source distribution, a complete
+    machine-readable copy of the corresponding source code, to be
+    distributed under the terms of Sections 1 and 2 above on a medium
+    customarily used for software interchange; or,
+
+    c) Accompany it with the information you received as to the offer
+    to distribute corresponding source code.  (This alternative is
+    allowed only for noncommercial distribution and only if you
+    received the program in object code or executable form with such
+    an offer, in accord with Subsection b above.)
+
+The source code for a work means the preferred form of the work for
+making modifications to it.  For an executable work, complete source
+code means all the source code for all modules it contains, plus any
+associated interface definition files, plus the scripts used to
+control compilation and installation of the executable.  However, as a
+special exception, the source code distributed need not include
+anything that is normally distributed (in either source or binary
+form) with the major components (compiler, kernel, and so on) of the
+operating system on which the executable runs, unless that component
+itself accompanies the executable.
+
+If distribution of executable or object code is made by offering
+access to copy from a designated place, then offering equivalent
+access to copy the source code from the same place counts as
+distribution of the source code, even though third parties are not
+compelled to copy the source along with the object code.
+
+  4. You may not copy, modify, sublicense, or distribute the Program
+except as expressly provided under this License.  Any attempt
+otherwise to copy, modify, sublicense or distribute the Program is
+void, and will automatically terminate your rights under this License.
+However, parties who have received copies, or rights, from you under
+this License will not have their licenses terminated so long as such
+parties remain in full compliance.
+
+  5. You are not required to accept this License, since you have not
+signed it.  However, nothing else grants you permission to modify or
+distribute the Program or its derivative works.  These actions are
+prohibited by law if you do not accept this License.  Therefore, by
+modifying or distributing the Program (or any work based on the
+Program), you indicate your acceptance of this License to do so, and
+all its terms and conditions for copying, distributing or modifying
+the Program or works based on it.
+
+  6. Each time you redistribute the Program (or any work based on the
+Program), the recipient automatically receives a license from the
+original licensor to copy, distribute or modify the Program subject to
+these terms and conditions.  You may not impose any further
+restrictions on the recipients' exercise of the rights granted herein.
+You are not responsible for enforcing compliance by third parties to
+this License.
+
+  7. If, as a consequence of a court judgment or allegation of patent
+infringement or for any other reason (not limited to patent issues),
+conditions are imposed on you (whether by court order, agreement or
+otherwise) that contradict the conditions of this License, they do not
+excuse you from the conditions of this License.  If you cannot
+distribute so as to satisfy simultaneously your obligations under this
+License and any other pertinent obligations, then as a consequence you
+may not distribute the Program at all.  For example, if a patent
+license would not permit royalty-free redistribution of the Program by
+all those who receive copies directly or indirectly through you, then
+the only way you could satisfy both it and this License would be to
+refrain entirely from distribution of the Program.
+
+If any portion of this section is held invalid or unenforceable under
+any particular circumstance, the balance of the section is intended to
+apply and the section as a whole is intended to apply in other
+circumstances.
+
+It is not the purpose of this section to induce you to infringe any
+patents or other property right claims or to contest validity of any
+such claims; this section has the sole purpose of protecting the
+integrity of the free software distribution system, which is
+implemented by public license practices.  Many people have made
+generous contributions to the wide range of software distributed
+through that system in reliance on consistent application of that
+system; it is up to the author/donor to decide if he or she is willing
+to distribute software through any other system and a licensee cannot
+impose that choice.
+
+This section is intended to make thoroughly clear what is believed to
+be a consequence of the rest of this License.
+
+  8. If the distribution and/or use of the Program is restricted in
+certain countries either by patents or by copyrighted interfaces, the
+original copyright holder who places the Program under this License
+may add an explicit geographical distribution limitation excluding
+those countries, so that distribution is permitted only in or among
+countries not thus excluded.  In such case, this License incorporates
+the limitation as if written in the body of this License.
+
+  9. The Free Software Foundation may publish revised and/or new versions
+of the General Public License from time to time.  Such new versions will
+be similar in spirit to the present version, but may differ in detail to
+address new problems or concerns.
+
+Each version is given a distinguishing version number.  If the Program
+specifies a version number of this License which applies to it and "any
+later version", you have the option of following the terms and conditions
+either of that version or of any later version published by the Free
+Software Foundation.  If the Program does not specify a version number of
+this License, you may choose any version ever published by the Free Software
+Foundation.
+
+  10. If you wish to incorporate parts of the Program into other free
+programs whose distribution conditions are different, write to the author
+to ask for permission.  For software which is copyrighted by the Free
+Software Foundation, write to the Free Software Foundation; we sometimes
+make exceptions for this.  Our decision will be guided by the two goals
+of preserving the free status of all derivatives of our free software and
+of promoting the sharing and reuse of software generally.
+
+                           NO WARRANTY
+
+  11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY
+FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW.  EXCEPT WHEN
+OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES
+PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED
+OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
+MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.  THE ENTIRE RISK AS
+TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU.  SHOULD THE
+PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING,
+REPAIR OR CORRECTION.
+
+  12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
+WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR
+REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES,
+INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING
+OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED
+TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY
+YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER
+PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE
+POSSIBILITY OF SUCH DAMAGES.
+
+                    END OF TERMS AND CONDITIONS
+
+           How to Apply These Terms to Your New Programs
+
+  If you develop a new program, and you want it to be of the greatest
+possible use to the public, the best way to achieve this is to make it
+free software which everyone can redistribute and change under these terms.
+
+  To do so, attach the following notices to the program.  It is safest
+to attach them to the start of each source file to most effectively
+convey the exclusion of warranty; and each file should have at least
+the "copyright" line and a pointer to where the full notice is found.
+
+    <one line to give the program's name and a brief idea of what it does.>
+    Copyright (C) <year>  <name of author>
+
+    This program is free software; you can redistribute it and/or modify
+    it under the terms of the GNU General Public License as published by
+    the Free Software Foundation; either version 2 of the License, or
+    (at your option) any later version.
+
+    This program is distributed in the hope that it will be useful,
+    but WITHOUT ANY WARRANTY; without even the implied warranty of
+    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+    GNU General Public License for more details.
+
+    You should have received a copy of the GNU General Public License along
+    with this program; if not, write to the Free Software Foundation, Inc.,
+    51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+
+Also add information on how to contact you by electronic and paper mail.
+
+If the program is interactive, make it output a short notice like this
+when it starts in an interactive mode:
+
+    Gnomovision version 69, Copyright (C) year name of author
+    Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
+    This is free software, and you are welcome to redistribute it
+    under certain conditions; type `show c' for details.
+
+The hypothetical commands `show w' and `show c' should show the appropriate
+parts of the General Public License.  Of course, the commands you use may
+be called something other than `show w' and `show c'; they could even be
+mouse-clicks or menu items--whatever suits your program.
+
+You should also get your employer (if you work as a programmer) or your
+school, if any, to sign a "copyright disclaimer" for the program, if
+necessary.  Here is a sample; alter the names:
+
+  Yoyodyne, Inc., hereby disclaims all copyright interest in the program
+  `Gnomovision' (which makes passes at compilers) written by James Hacker.
+
+  <signature of Ty Coon>, 1 April 1989
+  Ty Coon, President of Vice
+
+This General Public License does not permit incorporating your program into
+proprietary programs.  If your program is a subroutine library, you may
+consider it more useful to permit linking proprietary applications with the
+library.  If this is what you want to do, use the GNU Lesser General
+Public License instead of this License.
\ No newline at end of file
diff --git a/manager/Doxyfile b/manager/Doxyfile
new file mode 100644 (file)
index 0000000..2bb2b19
--- /dev/null
@@ -0,0 +1,1237 @@
+# Doxyfile 1.4.6
+# This file describes the settings to be used by the documentation system
+# doxygen (www.doxygen.org) for a project
+#
+# All text after a hash (#) is considered a comment and will be ignored
+# The format is:
+#       TAG = value [value, ...]
+# For lists items can also be appended using:
+#       TAG += value [value, ...]
+# Values that contain spaces should be placed between quotes (" ")
+#---------------------------------------------------------------------------
+# Project related configuration options
+#---------------------------------------------------------------------------
+# The PROJECT_NAME tag is a single word (or a sequence of words surrounded 
+# by quotes) that should identify the project.
+PROJECT_NAME           = White Stork Manager  Module
+# The PROJECT_NUMBER tag can be used to enter a project or revision number. 
+# This could be handy for archiving the generated documentation or 
+# if some version control system is used.
+PROJECT_NUMBER         = 0.1
+# The OUTPUT_DIRECTORY tag is used to specify the (relative or absolute) 
+# base path where the generated documentation will be put. 
+# If a relative path is entered, it will be relative to the location 
+# where doxygen was started. If left blank the current directory will be used.
+OUTPUT_DIRECTORY       = doc/
+# If the CREATE_SUBDIRS tag is set to YES, then doxygen will create 
+# 4096 sub-directories (in 2 levels) under the output directory of each output 
+# format and will distribute the generated files over these directories. 
+# Enabling this option can be useful when feeding doxygen a huge amount of 
+# source files, where putting all generated files in the same directory would 
+# otherwise cause performance problems for the file system.
+CREATE_SUBDIRS         = NO
+# The OUTPUT_LANGUAGE tag is used to specify the language in which all 
+# documentation generated by doxygen is written. Doxygen will use this 
+# information to generate all constant output in the proper language. 
+# The default language is English, other supported languages are: 
+# Brazilian, Catalan, Chinese, Chinese-Traditional, Croatian, Czech, Danish, 
+# Dutch, Finnish, French, German, Greek, Hungarian, Italian, Japanese, 
+# Japanese-en (Japanese with English messages), Korean, Korean-en, Norwegian, 
+# Polish, Portuguese, Romanian, Russian, Serbian, Slovak, Slovene, Spanish, 
+# Swedish, and Ukrainian.
+OUTPUT_LANGUAGE        = English
+# This tag can be used to specify the encoding used in the generated output. 
+# The encoding is not always determined by the language that is chosen, 
+# but also whether or not the output is meant for Windows or non-Windows users. 
+# In case there is a difference, setting the USE_WINDOWS_ENCODING tag to YES 
+# forces the Windows encoding (this is the default for the Windows binary), 
+# whereas setting the tag to NO uses a Unix-style encoding (the default for 
+# all platforms other than Windows).
+USE_WINDOWS_ENCODING   = NO
+# If the BRIEF_MEMBER_DESC tag is set to YES (the default) Doxygen will 
+# include brief member descriptions after the members that are listed in 
+# the file and class documentation (similar to JavaDoc). 
+# Set to NO to disable this.
+BRIEF_MEMBER_DESC      = YES
+# If the REPEAT_BRIEF tag is set to YES (the default) Doxygen will prepend 
+# the brief description of a member or function before the detailed description. 
+# Note: if both HIDE_UNDOC_MEMBERS and BRIEF_MEMBER_DESC are set to NO, the 
+# brief descriptions will be completely suppressed.
+REPEAT_BRIEF           = YES
+# This tag implements a quasi-intelligent brief description abbreviator 
+# that is used to form the text in various listings. Each string 
+# in this list, if found as the leading text of the brief description, will be 
+# stripped from the text and the result after processing the whole list, is 
+# used as the annotated text. Otherwise, the brief description is used as-is. 
+# If left blank, the following values are used ("$name" is automatically 
+# replaced with the name of the entity): "The $name class" "The $name widget" 
+# "The $name file" "is" "provides" "specifies" "contains" 
+# "represents" "a" "an" "the"
+ABBREVIATE_BRIEF       = 
+# If the ALWAYS_DETAILED_SEC and REPEAT_BRIEF tags are both set to YES then 
+# Doxygen will generate a detailed section even if there is only a brief 
+# description.
+ALWAYS_DETAILED_SEC    = NO
+# If the INLINE_INHERITED_MEMB tag is set to YES, doxygen will show all 
+# inherited members of a class in the documentation of that class as if those 
+# members were ordinary class members. Constructors, destructors and assignment 
+# operators of the base classes will not be shown.
+INLINE_INHERITED_MEMB  = NO
+# If the FULL_PATH_NAMES tag is set to YES then Doxygen will prepend the full 
+# path before files name in the file list and in the header files. If set 
+# to NO the shortest path that makes the file name unique will be used.
+FULL_PATH_NAMES        = NO
+# If the FULL_PATH_NAMES tag is set to YES then the STRIP_FROM_PATH tag 
+# can be used to strip a user-defined part of the path. Stripping is 
+# only done if one of the specified strings matches the left-hand part of 
+# the path. The tag can be used to show relative paths in the file list. 
+# If left blank the directory from which doxygen is run is used as the 
+# path to strip.
+STRIP_FROM_PATH        = 
+# The STRIP_FROM_INC_PATH tag can be used to strip a user-defined part of 
+# the path mentioned in the documentation of a class, which tells 
+# the reader which header file to include in order to use a class. 
+# If left blank only the name of the header file containing the class 
+# definition is used. Otherwise one should specify the include paths that 
+# are normally passed to the compiler using the -I flag.
+STRIP_FROM_INC_PATH    = 
+# If the SHORT_NAMES tag is set to YES, doxygen will generate much shorter 
+# (but less readable) file names. This can be useful is your file systems 
+# doesn't support long names like on DOS, Mac, or CD-ROM.
+SHORT_NAMES            = NO
+# If the JAVADOC_AUTOBRIEF tag is set to YES then Doxygen 
+# will interpret the first line (until the first dot) of a JavaDoc-style 
+# comment as the brief description. If set to NO, the JavaDoc 
+# comments will behave just like the Qt-style comments (thus requiring an 
+# explicit @brief command for a brief description.
+JAVADOC_AUTOBRIEF      = NO
+# The MULTILINE_CPP_IS_BRIEF tag can be set to YES to make Doxygen 
+# treat a multi-line C++ special comment block (i.e. a block of //! or /// 
+# comments) as a brief description. This used to be the default behaviour. 
+# The new default is to treat a multi-line C++ comment block as a detailed 
+# description. Set this tag to YES if you prefer the old behaviour instead.
+MULTILINE_CPP_IS_BRIEF = NO
+# If the DETAILS_AT_TOP tag is set to YES then Doxygen 
+# will output the detailed description near the top, like JavaDoc.
+# If set to NO, the detailed description appears after the member 
+# documentation.
+DETAILS_AT_TOP         = NO
+# If the INHERIT_DOCS tag is set to YES (the default) then an undocumented 
+# member inherits the documentation from any documented member that it 
+# re-implements.
+INHERIT_DOCS           = YES
+# If the SEPARATE_MEMBER_PAGES tag is set to YES, then doxygen will produce 
+# a new page for each member. If set to NO, the documentation of a member will 
+# be part of the file/class/namespace that contains it.
+SEPARATE_MEMBER_PAGES  = NO
+# The TAB_SIZE tag can be used to set the number of spaces in a tab. 
+# Doxygen uses this value to replace tabs by spaces in code fragments.
+TAB_SIZE               = 8
+# This tag can be used to specify a number of aliases that acts 
+# as commands in the documentation. An alias has the form "name=value". 
+# For example adding "sideeffect=\par Side Effects:\n" will allow you to 
+# put the command \sideeffect (or @sideeffect) in the documentation, which 
+# will result in a user-defined paragraph with heading "Side Effects:". 
+# You can put \n's in the value part of an alias to insert newlines.
+ALIASES                = 
+# Set the OPTIMIZE_OUTPUT_FOR_C tag to YES if your project consists of C 
+# sources only. Doxygen will then generate output that is more tailored for C. 
+# For instance, some of the names that are used will be different. The list 
+# of all members will be omitted, etc.
+OPTIMIZE_OUTPUT_FOR_C  = YES
+# Set the OPTIMIZE_OUTPUT_JAVA tag to YES if your project consists of Java 
+# sources only. Doxygen will then generate output that is more tailored for Java. 
+# For instance, namespaces will be presented as packages, qualified scopes 
+# will look different, etc.
+OPTIMIZE_OUTPUT_JAVA   = NO
+# If you use STL classes (i.e. std::string, std::vector, etc.) but do not want to 
+# include (a tag file for) the STL sources as input, then you should 
+# set this tag to YES in order to let doxygen match functions declarations and 
+# definitions whose arguments contain STL classes (e.g. func(std::string); v.s. 
+# func(std::string) {}). This also make the inheritance and collaboration 
+# diagrams that involve STL classes more complete and accurate.
+BUILTIN_STL_SUPPORT    = NO
+# If member grouping is used in the documentation and the DISTRIBUTE_GROUP_DOC 
+# tag is set to YES, then doxygen will reuse the documentation of the first 
+# member in the group (if any) for the other members of the group. By default 
+# all members of a group must be documented explicitly.
+DISTRIBUTE_GROUP_DOC   = NO
+# Set the SUBGROUPING tag to YES (the default) to allow class member groups of 
+# the same type (for instance a group of public functions) to be put as a 
+# subgroup of that type (e.g. under the Public Functions section). Set it to 
+# NO to prevent subgrouping. Alternatively, this can be done per class using 
+# the \nosubgrouping command.
+SUBGROUPING            = YES
+#---------------------------------------------------------------------------
+# Build related configuration options
+#---------------------------------------------------------------------------
+# If the EXTRACT_ALL tag is set to YES doxygen will assume all entities in 
+# documentation are documented, even if no documentation was available. 
+# Private class members and static file members will be hidden unless 
+# the EXTRACT_PRIVATE and EXTRACT_STATIC tags are set to YES
+EXTRACT_ALL            = YES
+# If the EXTRACT_PRIVATE tag is set to YES all private members of a class 
+# will be included in the documentation.
+EXTRACT_PRIVATE        = YES
+# If the EXTRACT_STATIC tag is set to YES all static members of a file 
+# will be included in the documentation.
+EXTRACT_STATIC         = YES
+# If the EXTRACT_LOCAL_CLASSES tag is set to YES classes (and structs) 
+# defined locally in source files will be included in the documentation. 
+# If set to NO only classes defined in header files are included.
+EXTRACT_LOCAL_CLASSES  = YES
+# This flag is only useful for Objective-C code. When set to YES local 
+# methods, which are defined in the implementation section but not in 
+# the interface are included in the documentation. 
+# If set to NO (the default) only methods in the interface are included.
+EXTRACT_LOCAL_METHODS  = NO
+# If the HIDE_UNDOC_MEMBERS tag is set to YES, Doxygen will hide all 
+# undocumented members of documented classes, files or namespaces. 
+# If set to NO (the default) these members will be included in the 
+# various overviews, but no documentation section is generated. 
+# This option has no effect if EXTRACT_ALL is enabled.
+HIDE_UNDOC_MEMBERS     = NO
+# If the HIDE_UNDOC_CLASSES tag is set to YES, Doxygen will hide all 
+# undocumented classes that are normally visible in the class hierarchy. 
+# If set to NO (the default) these classes will be included in the various 
+# overviews. This option has no effect if EXTRACT_ALL is enabled.
+HIDE_UNDOC_CLASSES     = NO
+# If the HIDE_FRIEND_COMPOUNDS tag is set to YES, Doxygen will hide all 
+# friend (class|struct|union) declarations. 
+# If set to NO (the default) these declarations will be included in the 
+# documentation.
+HIDE_FRIEND_COMPOUNDS  = NO
+# If the HIDE_IN_BODY_DOCS tag is set to YES, Doxygen will hide any 
+# documentation blocks found inside the body of a function. 
+# If set to NO (the default) these blocks will be appended to the 
+# function's detailed documentation block.
+HIDE_IN_BODY_DOCS      = NO
+# The INTERNAL_DOCS tag determines if documentation 
+# that is typed after a \internal command is included. If the tag is set 
+# to NO (the default) then the documentation will be excluded. 
+# Set it to YES to include the internal documentation.
+INTERNAL_DOCS          = NO
+# If the CASE_SENSE_NAMES tag is set to NO then Doxygen will only generate 
+# file names in lower-case letters. If set to YES upper-case letters are also 
+# allowed. This is useful if you have classes or files whose names only differ 
+# in case and if your file system supports case sensitive file names. Windows 
+# and Mac users are advised to set this option to NO.
+CASE_SENSE_NAMES       = YES
+# If the HIDE_SCOPE_NAMES tag is set to NO (the default) then Doxygen 
+# will show members with their full class and namespace scopes in the 
+# documentation. If set to YES the scope will be hidden.
+HIDE_SCOPE_NAMES       = NO
+# If the SHOW_INCLUDE_FILES tag is set to YES (the default) then Doxygen 
+# will put a list of the files that are included by a file in the documentation 
+# of that file.
+SHOW_INCLUDE_FILES     = YES
+# If the INLINE_INFO tag is set to YES (the default) then a tag [inline] 
+# is inserted in the documentation for inline members.
+INLINE_INFO            = YES
+# If the SORT_MEMBER_DOCS tag is set to YES (the default) then doxygen 
+# will sort the (detailed) documentation of file and class members 
+# alphabetically by member name. If set to NO the members will appear in 
+# declaration order.
+SORT_MEMBER_DOCS       = YES
+# If the SORT_BRIEF_DOCS tag is set to YES then doxygen will sort the 
+# brief documentation of file, namespace and class members alphabetically 
+# by member name. If set to NO (the default) the members will appear in 
+# declaration order.
+SORT_BRIEF_DOCS        = NO
+# If the SORT_BY_SCOPE_NAME tag is set to YES, the class list will be 
+# sorted by fully-qualified names, including namespaces. If set to 
+# NO (the default), the class list will be sorted only by class name, 
+# not including the namespace part. 
+# Note: This option is not very useful if HIDE_SCOPE_NAMES is set to YES.
+# Note: This option applies only to the class list, not to the 
+# alphabetical list.
+SORT_BY_SCOPE_NAME     = NO
+# The GENERATE_TODOLIST tag can be used to enable (YES) or 
+# disable (NO) the todo list. This list is created by putting \todo 
+# commands in the documentation.
+GENERATE_TODOLIST      = YES
+# The GENERATE_TESTLIST tag can be used to enable (YES) or 
+# disable (NO) the test list. This list is created by putting \test 
+# commands in the documentation.
+GENERATE_TESTLIST      = YES
+# The GENERATE_BUGLIST tag can be used to enable (YES) or 
+# disable (NO) the bug list. This list is created by putting \bug 
+# commands in the documentation.
+GENERATE_BUGLIST       = YES
+# The GENERATE_DEPRECATEDLIST tag can be used to enable (YES) or 
+# disable (NO) the deprecated list. This list is created by putting 
+# \deprecated commands in the documentation.
+GENERATE_DEPRECATEDLIST= YES
+# The ENABLED_SECTIONS tag can be used to enable conditional 
+# documentation sections, marked by \if sectionname ... \endif.
+ENABLED_SECTIONS       = 
+# The MAX_INITIALIZER_LINES tag determines the maximum number of lines 
+# the initial value of a variable or define consists of for it to appear in 
+# the documentation. If the initializer consists of more lines than specified 
+# here it will be hidden. Use a value of 0 to hide initializers completely. 
+# The appearance of the initializer of individual variables and defines in the 
+# documentation can be controlled using \showinitializer or \hideinitializer 
+# command in the documentation regardless of this setting.
+MAX_INITIALIZER_LINES  = 30
+# Set the SHOW_USED_FILES tag to NO to disable the list of files generated 
+# at the bottom of the documentation of classes and structs. If set to YES the 
+# list will mention the files that were used to generate the documentation.
+SHOW_USED_FILES        = YES
+# If the sources in your project are distributed over multiple directories 
+# then setting the SHOW_DIRECTORIES tag to YES will show the directory hierarchy 
+# in the documentation. The default is NO.
+SHOW_DIRECTORIES       = NO
+# The FILE_VERSION_FILTER tag can be used to specify a program or script that 
+# doxygen should invoke to get the current version for each file (typically from the 
+# version control system). Doxygen will invoke the program by executing (via 
+# popen()) the command <command> <input-file>, where <command> is the value of 
+# the FILE_VERSION_FILTER tag, and <input-file> is the name of an input file 
+# provided by doxygen. Whatever the program writes to standard output 
+# is used as the file version. See the manual for examples.
+FILE_VERSION_FILTER    = 
+#---------------------------------------------------------------------------
+# configuration options related to warning and progress messages
+#---------------------------------------------------------------------------
+# The QUIET tag can be used to turn on/off the messages that are generated 
+# by doxygen. Possible values are YES and NO. If left blank NO is used.
+QUIET                  = NO
+# The WARNINGS tag can be used to turn on/off the warning messages that are 
+# generated by doxygen. Possible values are YES and NO. If left blank 
+# NO is used.
+WARNINGS               = YES
+# If WARN_IF_UNDOCUMENTED is set to YES, then doxygen will generate warnings 
+# for undocumented members. If EXTRACT_ALL is set to YES then this flag will 
+# automatically be disabled.
+WARN_IF_UNDOCUMENTED   = YES
+# If WARN_IF_DOC_ERROR is set to YES, doxygen will generate warnings for 
+# potential errors in the documentation, such as not documenting some 
+# parameters in a documented function, or documenting parameters that 
+# don't exist or using markup commands wrongly.
+WARN_IF_DOC_ERROR      = YES
+# This WARN_NO_PARAMDOC option can be abled to get warnings for 
+# functions that are documented, but have no documentation for their parameters 
+# or return value. If set to NO (the default) doxygen will only warn about 
+# wrong or incomplete parameter documentation, but not about the absence of 
+# documentation.
+WARN_NO_PARAMDOC       = NO
+# The WARN_FORMAT tag determines the format of the warning messages that 
+# doxygen can produce. The string should contain the $file, $line, and $text 
+# tags, which will be replaced by the file and line number from which the 
+# warning originated and the warning text. Optionally the format may contain 
+# $version, which will be replaced by the version of the file (if it could 
+# be obtained via FILE_VERSION_FILTER)
+WARN_FORMAT            = "$file:$line: $text"
+# The WARN_LOGFILE tag can be used to specify a file to which warning 
+# and error messages should be written. If left blank the output is written 
+# to stderr.
+WARN_LOGFILE           = 
+#---------------------------------------------------------------------------
+# configuration options related to the input files
+#---------------------------------------------------------------------------
+# The INPUT tag can be used to specify the files and/or directories that contain 
+# documented source files. You may enter file names like "myfile.cpp" or 
+# directories like "/usr/src/myproject". Separate the files or directories 
+# with spaces.
+INPUT                  = src/ws_manager.c ../include/ws_manager.h
+# If the value of the INPUT tag contains directories, you can use the 
+# FILE_PATTERNS tag to specify one or more wildcard pattern (like *.cpp 
+# and *.h) to filter out the source-files in the directories. If left 
+# blank the following patterns are tested: 
+# *.c *.cc *.cxx *.cpp *.c++ *.java *.ii *.ixx *.ipp *.i++ *.inl *.h *.hh *.hxx 
+# *.hpp *.h++ *.idl *.odl *.cs *.php *.php3 *.inc *.m *.mm *.py
+FILE_PATTERNS          = 
+# The RECURSIVE tag can be used to turn specify whether or not subdirectories 
+# should be searched for input files as well. Possible values are YES and NO. 
+# If left blank NO is used.
+RECURSIVE              = YES
+# The EXCLUDE tag can be used to specify files and/or directories that should 
+# excluded from the INPUT source files. This way you can easily exclude a 
+# subdirectory from a directory tree whose root is specified with the INPUT tag.
+EXCLUDE                = 
+# The EXCLUDE_SYMLINKS tag can be used select whether or not files or 
+# directories that are symbolic links (a Unix filesystem feature) are excluded 
+# from the input.
+EXCLUDE_SYMLINKS       = NO
+# If the value of the INPUT tag contains directories, you can use the 
+# EXCLUDE_PATTERNS tag to specify one or more wildcard patterns to exclude 
+# certain files from those directories. Note that the wildcards are matched 
+# against the file with absolute path, so to exclude all test directories 
+# for example use the pattern */test/*
+EXCLUDE_PATTERNS       = 
+# The EXAMPLE_PATH tag can be used to specify one or more files or 
+# directories that contain example code fragments that are included (see 
+# the \include command).
+EXAMPLE_PATH           = 
+# If the value of the EXAMPLE_PATH tag contains directories, you can use the 
+# EXAMPLE_PATTERNS tag to specify one or more wildcard pattern (like *.cpp 
+# and *.h) to filter out the source-files in the directories. If left 
+# blank all files are included.
+EXAMPLE_PATTERNS       = 
+# If the EXAMPLE_RECURSIVE tag is set to YES then subdirectories will be 
+# searched for input files to be used with the \include or \dontinclude 
+# commands irrespective of the value of the RECURSIVE tag. 
+# Possible values are YES and NO. If left blank NO is used.
+EXAMPLE_RECURSIVE      = NO
+# The IMAGE_PATH tag can be used to specify one or more files or 
+# directories that contain image that are included in the documentation (see 
+# the \image command).
+IMAGE_PATH             = 
+# The INPUT_FILTER tag can be used to specify a program that doxygen should 
+# invoke to filter for each input file. Doxygen will invoke the filter program 
+# by executing (via popen()) the command <filter> <input-file>, where <filter> 
+# is the value of the INPUT_FILTER tag, and <input-file> is the name of an 
+# input file. Doxygen will then use the output that the filter program writes 
+# to standard output.  If FILTER_PATTERNS is specified, this tag will be 
+# ignored.
+INPUT_FILTER           = 
+# The FILTER_PATTERNS tag can be used to specify filters on a per file pattern 
+# basis.  Doxygen will compare the file name with each pattern and apply the 
+# filter if there is a match.  The filters are a list of the form: 
+# pattern=filter (like *.cpp=my_cpp_filter). See INPUT_FILTER for further 
+# info on how filters are used. If FILTER_PATTERNS is empty, INPUT_FILTER 
+# is applied to all files.
+FILTER_PATTERNS        = 
+# If the FILTER_SOURCE_FILES tag is set to YES, the input filter (if set using 
+# INPUT_FILTER) will be used to filter the input files when producing source 
+# files to browse (i.e. when SOURCE_BROWSER is set to YES).
+FILTER_SOURCE_FILES    = NO
+#---------------------------------------------------------------------------
+# configuration options related to source browsing
+#---------------------------------------------------------------------------
+# If the SOURCE_BROWSER tag is set to YES then a list of source files will 
+# be generated. Documented entities will be cross-referenced with these sources. 
+# Note: To get rid of all source code in the generated output, make sure also 
+# VERBATIM_HEADERS is set to NO.
+SOURCE_BROWSER         = YES
+# Setting the INLINE_SOURCES tag to YES will include the body 
+# of functions and classes directly in the documentation.
+INLINE_SOURCES         = NO
+# Setting the STRIP_CODE_COMMENTS tag to YES (the default) will instruct 
+# doxygen to hide any special comment blocks from generated source code 
+# fragments. Normal C and C++ comments will always remain visible.
+STRIP_CODE_COMMENTS    = YES
+# If the REFERENCED_BY_RELATION tag is set to YES (the default) 
+# then for each documented function all documented 
+# functions referencing it will be listed.
+REFERENCED_BY_RELATION = YES
+# If the REFERENCES_RELATION tag is set to YES (the default) 
+# then for each documented function all documented entities 
+# called/used by that function will be listed.
+REFERENCES_RELATION    = YES
+# If the USE_HTAGS tag is set to YES then the references to source code 
+# will point to the HTML generated by the htags(1) tool instead of doxygen 
+# built-in source browser. The htags tool is part of GNU's global source 
+# tagging system (see http://www.gnu.org/software/global/global.html). You 
+# will need version 4.8.6 or higher.
+USE_HTAGS              = NO
+# If the VERBATIM_HEADERS tag is set to YES (the default) then Doxygen 
+# will generate a verbatim copy of the header file for each class for 
+# which an include is specified. Set to NO to disable this.
+VERBATIM_HEADERS       = YES
+#---------------------------------------------------------------------------
+# configuration options related to the alphabetical class index
+#---------------------------------------------------------------------------
+# If the ALPHABETICAL_INDEX tag is set to YES, an alphabetical index 
+# of all compounds will be generated. Enable this if the project 
+# contains a lot of classes, structs, unions or interfaces.
+ALPHABETICAL_INDEX     = No
+# If the alphabetical index is enabled (see ALPHABETICAL_INDEX) then 
+# the COLS_IN_ALPHA_INDEX tag can be used to specify the number of columns 
+# in which this list will be split (can be a number in the range [1..20])
+COLS_IN_ALPHA_INDEX    = 5
+# In case all classes in a project start with a common prefix, all 
+# classes will be put under the same header in the alphabetical index. 
+# The IGNORE_PREFIX tag can be used to specify one or more prefixes that 
+# should be ignored while generating the index headers.
+IGNORE_PREFIX          = 
+#---------------------------------------------------------------------------
+# configuration options related to the HTML output
+#---------------------------------------------------------------------------
+# If the GENERATE_HTML tag is set to YES (the default) Doxygen will 
+# generate HTML output.
+GENERATE_HTML          = YES
+# The HTML_OUTPUT tag is used to specify where the HTML docs will be put. 
+# If a relative path is entered the value of OUTPUT_DIRECTORY will be 
+# put in front of it. If left blank `html' will be used as the default path.
+HTML_OUTPUT            = html
+# The HTML_FILE_EXTENSION tag can be used to specify the file extension for 
+# each generated HTML page (for example: .htm,.php,.asp). If it is left blank 
+# doxygen will generate files with .html extension.
+HTML_FILE_EXTENSION    = .html
+# The HTML_HEADER tag can be used to specify a personal HTML header for 
+# each generated HTML page. If it is left blank doxygen will generate a 
+# standard header.
+HTML_HEADER            = 
+# The HTML_FOOTER tag can be used to specify a personal HTML footer for 
+# each generated HTML page. If it is left blank doxygen will generate a 
+# standard footer.
+HTML_FOOTER            = 
+# The HTML_STYLESHEET tag can be used to specify a user-defined cascading 
+# style sheet that is used by each HTML page. It can be used to 
+# fine-tune the look of the HTML output. If the tag is left blank doxygen 
+# will generate a default style sheet. Note that doxygen will try to copy 
+# the style sheet file to the HTML output directory, so don't put your own 
+# stylesheet in the HTML output directory as well, or it will be erased!
+HTML_STYLESHEET        = 
+# If the HTML_ALIGN_MEMBERS tag is set to YES, the members of classes, 
+# files or namespaces will be aligned in HTML using tables. If set to 
+# NO a bullet list will be used.
+HTML_ALIGN_MEMBERS     = YES
+# If the GENERATE_HTMLHELP tag is set to YES, additional index files 
+# will be generated that can be used as input for tools like the 
+# Microsoft HTML help workshop to generate a compressed HTML help file (.chm) 
+# of the generated HTML documentation.
+GENERATE_HTMLHELP      = NO
+# If the GENERATE_HTMLHELP tag is set to YES, the CHM_FILE tag can 
+# be used to specify the file name of the resulting .chm file. You 
+# can add a path in front of the file if the result should not be 
+# written to the html output directory.
+CHM_FILE               = 
+# If the GENERATE_HTMLHELP tag is set to YES, the HHC_LOCATION tag can 
+# be used to specify the location (absolute path including file name) of 
+# the HTML help compiler (hhc.exe). If non-empty doxygen will try to run 
+# the HTML help compiler on the generated index.hhp.
+HHC_LOCATION           = 
+# If the GENERATE_HTMLHELP tag is set to YES, the GENERATE_CHI flag 
+# controls if a separate .chi index file is generated (YES) or that 
+# it should be included in the master .chm file (NO).
+GENERATE_CHI           = NO
+# If the GENERATE_HTMLHELP tag is set to YES, the BINARY_TOC flag 
+# controls whether a binary table of contents is generated (YES) or a 
+# normal table of contents (NO) in the .chm file.
+BINARY_TOC             = NO
+# The TOC_EXPAND flag can be set to YES to add extra items for group members 
+# to the contents of the HTML help documentation and to the tree view.
+TOC_EXPAND             = NO
+# The DISABLE_INDEX tag can be used to turn on/off the condensed index at 
+# top of each HTML page. The value NO (the default) enables the index and 
+# the value YES disables it.
+DISABLE_INDEX          = NO
+# This tag can be used to set the number of enum values (range [1..20]) 
+# that doxygen will group on one line in the generated HTML documentation.
+ENUM_VALUES_PER_LINE   = 1
+# If the GENERATE_TREEVIEW tag is set to YES, a side panel will be
+# generated containing a tree-like index structure (just like the one that 
+# is generated for HTML Help). For this to work a browser that supports 
+# JavaScript, DHTML, CSS and frames is required (for instance Mozilla 1.0+, 
+# Netscape 6.0+, Internet explorer 5.0+, or Konqueror). Windows users are 
+# probably better off using the HTML help feature.
+GENERATE_TREEVIEW      = YES
+# If the treeview is enabled (see GENERATE_TREEVIEW) then this tag can be 
+# used to set the initial width (in pixels) of the frame in which the tree 
+# is shown.
+TREEVIEW_WIDTH         = 250
+#---------------------------------------------------------------------------
+# configuration options related to the LaTeX output
+#---------------------------------------------------------------------------
+# If the GENERATE_LATEX tag is set to YES (the default) Doxygen will 
+# generate Latex output.
+GENERATE_LATEX         = YES
+# The LATEX_OUTPUT tag is used to specify where the LaTeX docs will be put. 
+# If a relative path is entered the value of OUTPUT_DIRECTORY will be 
+# put in front of it. If left blank `latex' will be used as the default path.
+LATEX_OUTPUT           = latex
+# The LATEX_CMD_NAME tag can be used to specify the LaTeX command name to be 
+# invoked. If left blank `latex' will be used as the default command name.
+LATEX_CMD_NAME         = latex
+# The MAKEINDEX_CMD_NAME tag can be used to specify the command name to 
+# generate index for LaTeX. If left blank `makeindex' will be used as the 
+# default command name.
+MAKEINDEX_CMD_NAME     = makeindex
+# If the COMPACT_LATEX tag is set to YES Doxygen generates more compact 
+# LaTeX documents. This may be useful for small projects and may help to 
+# save some trees in general.
+COMPACT_LATEX          = NO
+# The PAPER_TYPE tag can be used to set the paper type that is used 
+# by the printer. Possible values are: a4, a4wide, letter, legal and 
+# executive. If left blank a4wide will be used.
+PAPER_TYPE             = a4wide
+# The EXTRA_PACKAGES tag can be to specify one or more names of LaTeX 
+# packages that should be included in the LaTeX output.
+EXTRA_PACKAGES         = 
+# The LATEX_HEADER tag can be used to specify a personal LaTeX header for 
+# the generated latex document. The header should contain everything until 
+# the first chapter. If it is left blank doxygen will generate a 
+# standard header. Notice: only use this tag if you know what you are doing!
+LATEX_HEADER           = 
+# If the PDF_HYPERLINKS tag is set to YES, the LaTeX that is generated 
+# is prepared for conversion to pdf (using ps2pdf). The pdf file will 
+# contain links (just like the HTML output) instead of page references 
+# This makes the output suitable for online browsing using a pdf viewer.
+PDF_HYPERLINKS         = NO
+# If the USE_PDFLATEX tag is set to YES, pdflatex will be used instead of 
+# plain latex in the generated Makefile. Set this option to YES to get a 
+# higher quality PDF documentation.
+USE_PDFLATEX           = NO
+# If the LATEX_BATCHMODE tag is set to YES, doxygen will add the \\batchmode. 
+# command to the generated LaTeX files. This will instruct LaTeX to keep 
+# running if errors occur, instead of asking the user for help. 
+# This option is also used when generating formulas in HTML.
+LATEX_BATCHMODE        = NO
+# If LATEX_HIDE_INDICES is set to YES then doxygen will not 
+# include the index chapters (such as File Index, Compound Index, etc.) 
+# in the output.
+LATEX_HIDE_INDICES     = NO
+#---------------------------------------------------------------------------
+# configuration options related to the RTF output
+#---------------------------------------------------------------------------
+# If the GENERATE_RTF tag is set to YES Doxygen will generate RTF output 
+# The RTF output is optimized for Word 97 and may not look very pretty with 
+# other RTF readers or editors.
+GENERATE_RTF           = NO
+# The RTF_OUTPUT tag is used to specify where the RTF docs will be put. 
+# If a relative path is entered the value of OUTPUT_DIRECTORY will be 
+# put in front of it. If left blank `rtf' will be used as the default path.
+RTF_OUTPUT             = rtf
+# If the COMPACT_RTF tag is set to YES Doxygen generates more compact 
+# RTF documents. This may be useful for small projects and may help to 
+# save some trees in general.
+COMPACT_RTF            = NO
+# If the RTF_HYPERLINKS tag is set to YES, the RTF that is generated 
+# will contain hyperlink fields. The RTF file will 
+# contain links (just like the HTML output) instead of page references. 
+# This makes the output suitable for online browsing using WORD or other 
+# programs which support those fields. 
+# Note: wordpad (write) and others do not support links.
+RTF_HYPERLINKS         = NO
+# Load stylesheet definitions from file. Syntax is similar to doxygen's 
+# config file, i.e. a series of assignments. You only have to provide 
+# replacements, missing definitions are set to their default value.
+RTF_STYLESHEET_FILE    = 
+# Set optional variables used in the generation of an rtf document. 
+# Syntax is similar to doxygen's config file.
+RTF_EXTENSIONS_FILE    = 
+#---------------------------------------------------------------------------
+# configuration options related to the man page output
+#---------------------------------------------------------------------------
+# If the GENERATE_MAN tag is set to YES (the default) Doxygen will 
+# generate man pages
+GENERATE_MAN           = NO
+# The MAN_OUTPUT tag is used to specify where the man pages will be put. 
+# If a relative path is entered the value of OUTPUT_DIRECTORY will be 
+# put in front of it. If left blank `man' will be used as the default path.
+MAN_OUTPUT             = man
+# The MAN_EXTENSION tag determines the extension that is added to 
+# the generated man pages (default is the subroutine's section .3)
+MAN_EXTENSION          = .3
+# If the MAN_LINKS tag is set to YES and Doxygen generates man output, 
+# then it will generate one additional man file for each entity 
+# documented in the real man page(s). These additional files 
+# only source the real man page, but without them the man command 
+# would be unable to find the correct page. The default is NO.
+MAN_LINKS              = NO
+#---------------------------------------------------------------------------
+# configuration options related to the XML output
+#---------------------------------------------------------------------------
+# If the GENERATE_XML tag is set to YES Doxygen will 
+# generate an XML file that captures the structure of 
+# the code including all documentation.
+GENERATE_XML           = NO
+# The XML_OUTPUT tag is used to specify where the XML pages will be put. 
+# If a relative path is entered the value of OUTPUT_DIRECTORY will be 
+# put in front of it. If left blank `xml' will be used as the default path.
+XML_OUTPUT             = xml
+# The XML_SCHEMA tag can be used to specify an XML schema, 
+# which can be used by a validating XML parser to check the 
+# syntax of the XML files.
+XML_SCHEMA             = 
+# The XML_DTD tag can be used to specify an XML DTD, 
+# which can be used by a validating XML parser to check the 
+# syntax of the XML files.
+XML_DTD                = 
+# If the XML_PROGRAMLISTING tag is set to YES Doxygen will 
+# dump the program listings (including syntax highlighting 
+# and cross-referencing information) to the XML output. Note that 
+# enabling this will significantly increase the size of the XML output.
+XML_PROGRAMLISTING     = YES
+#---------------------------------------------------------------------------
+# configuration options for the AutoGen Definitions output
+#---------------------------------------------------------------------------
+# If the GENERATE_AUTOGEN_DEF tag is set to YES Doxygen will 
+# generate an AutoGen Definitions (see autogen.sf.net) file 
+# that captures the structure of the code including all 
+# documentation. Note that this feature is still experimental 
+# and incomplete at the moment.
+GENERATE_AUTOGEN_DEF   = NO
+#---------------------------------------------------------------------------
+# configuration options related to the Perl module output
+#---------------------------------------------------------------------------
+# If the GENERATE_PERLMOD tag is set to YES Doxygen will 
+# generate a Perl module file that captures the structure of 
+# the code including all documentation. Note that this 
+# feature is still experimental and incomplete at the 
+# moment.
+GENERATE_PERLMOD       = NO
+# If the PERLMOD_LATEX tag is set to YES Doxygen will generate 
+# the necessary Makefile rules, Perl scripts and LaTeX code to be able 
+# to generate PDF and DVI output from the Perl module output.
+PERLMOD_LATEX          = NO
+# If the PERLMOD_PRETTY tag is set to YES the Perl module output will be 
+# nicely formatted so it can be parsed by a human reader.  This is useful 
+# if you want to understand what is going on.  On the other hand, if this 
+# tag is set to NO the size of the Perl module output will be much smaller 
+# and Perl will parse it just the same.
+PERLMOD_PRETTY         = YES
+# The names of the make variables in the generated doxyrules.make file 
+# are prefixed with the string contained in PERLMOD_MAKEVAR_PREFIX. 
+# This is useful so different doxyrules.make files included by the same 
+# Makefile don't overwrite each other's variables.
+PERLMOD_MAKEVAR_PREFIX = 
+#---------------------------------------------------------------------------
+# Configuration options related to the preprocessor   
+#---------------------------------------------------------------------------
+# If the ENABLE_PREPROCESSING tag is set to YES (the default) Doxygen will 
+# evaluate all C-preprocessor directives found in the sources and include 
+# files.
+ENABLE_PREPROCESSING   = YES
+# If the MACRO_EXPANSION tag is set to YES Doxygen will expand all macro 
+# names in the source code. If set to NO (the default) only conditional 
+# compilation will be performed. Macro expansion can be done in a controlled 
+# way by setting EXPAND_ONLY_PREDEF to YES.
+MACRO_EXPANSION        = NO
+# If the EXPAND_ONLY_PREDEF and MACRO_EXPANSION tags are both set to YES 
+# then the macro expansion is limited to the macros specified with the 
+# PREDEFINED and EXPAND_AS_DEFINED tags.
+EXPAND_ONLY_PREDEF     = NO
+# If the SEARCH_INCLUDES tag is set to YES (the default) the includes files 
+# in the INCLUDE_PATH (see below) will be search if a #include is found.
+SEARCH_INCLUDES        = YES
+# The INCLUDE_PATH tag can be used to specify one or more directories that 
+# contain include files that are not input files but should be processed by 
+# the preprocessor.
+INCLUDE_PATH           = 
+# You can use the INCLUDE_FILE_PATTERNS tag to specify one or more wildcard 
+# patterns (like *.h and *.hpp) to filter out the header-files in the 
+# directories. If left blank, the patterns specified with FILE_PATTERNS will 
+# be used.
+INCLUDE_FILE_PATTERNS  = 
+# The PREDEFINED tag can be used to specify one or more macro names that 
+# are defined before the preprocessor is started (similar to the -D option of 
+# gcc). The argument of the tag is a list of macros of the form: name 
+# or name=definition (no spaces). If the definition and the = are 
+# omitted =1 is assumed. To prevent a macro definition from being 
+# undefined via #undef or recursively expanded use the := operator 
+# instead of the = operator.
+PREDEFINED             = 
+# If the MACRO_EXPANSION and EXPAND_ONLY_PREDEF tags are set to YES then 
+# this tag can be used to specify a list of macro names that should be expanded. 
+# The macro definition that is found in the sources will be used. 
+# Use the PREDEFINED tag if you want to use a different macro definition.
+EXPAND_AS_DEFINED      = 
+# If the SKIP_FUNCTION_MACROS tag is set to YES (the default) then 
+# doxygen's preprocessor will remove all function-like macros that are alone 
+# on a line, have an all uppercase name, and do not end with a semicolon. Such 
+# function macros are typically used for boiler-plate code, and will confuse 
+# the parser if not removed.
+SKIP_FUNCTION_MACROS   = YES
+#---------------------------------------------------------------------------
+# Configuration::additions related to external references   
+#---------------------------------------------------------------------------
+# The TAGFILES option can be used to specify one or more tagfiles. 
+# Optionally an initial location of the external documentation 
+# can be added for each tagfile. The format of a tag file without 
+# this location is as follows: 
+#   TAGFILES = file1 file2 ... 
+# Adding location for the tag files is done as follows: 
+#   TAGFILES = file1=loc1 "file2 = loc2" ... 
+# where "loc1" and "loc2" can be relative or absolute paths or 
+# URLs. If a location is present for each tag, the installdox tool 
+# does not have to be run to correct the links.
+# Note that each tag file must have a unique name
+# (where the name does NOT include the path)
+# If a tag file is not located in the directory in which doxygen 
+# is run, you must also specify the path to the tagfile here.
+TAGFILES               = 
+# When a file name is specified after GENERATE_TAGFILE, doxygen will create 
+# a tag file that is based on the input files it reads.
+GENERATE_TAGFILE       = 
+# If the ALLEXTERNALS tag is set to YES all external classes will be listed 
+# in the class index. If set to NO only the inherited external classes 
+# will be listed.
+ALLEXTERNALS           = NO
+# If the EXTERNAL_GROUPS tag is set to YES all external groups will be listed 
+# in the modules index. If set to NO, only the current project's groups will 
+# be listed.
+EXTERNAL_GROUPS        = YES
+# The PERL_PATH should be the absolute path and name of the perl script 
+# interpreter (i.e. the result of `which perl').
+PERL_PATH              = /usr/bin/perl
+#---------------------------------------------------------------------------
+# Configuration options related to the dot tool   
+#---------------------------------------------------------------------------
+# If the CLASS_DIAGRAMS tag is set to YES (the default) Doxygen will 
+# generate a inheritance diagram (in HTML, RTF and LaTeX) for classes with base 
+# or super classes. Setting the tag to NO turns the diagrams off. Note that 
+# this option is superseded by the HAVE_DOT option below. This is only a 
+# fallback. It is recommended to install and use dot, since it yields more 
+# powerful graphs.
+CLASS_DIAGRAMS         = YES
+# If set to YES, the inheritance and collaboration graphs will hide 
+# inheritance and usage relations if the target is undocumented 
+# or is not a class.
+HIDE_UNDOC_RELATIONS   = YES
+# If you set the HAVE_DOT tag to YES then doxygen will assume the dot tool is 
+# available from the path. This tool is part of Graphviz, a graph visualization 
+# toolkit from AT&T and Lucent Bell Labs. The other options in this section 
+# have no effect if this option is set to NO (the default)
+HAVE_DOT               = NO
+# If the CLASS_GRAPH and HAVE_DOT tags are set to YES then doxygen 
+# will generate a graph for each documented class showing the direct and 
+# indirect inheritance relations. Setting this tag to YES will force the 
+# the CLASS_DIAGRAMS tag to NO.
+CLASS_GRAPH            = YES
+# If the COLLABORATION_GRAPH and HAVE_DOT tags are set to YES then doxygen 
+# will generate a graph for each documented class showing the direct and 
+# indirect implementation dependencies (inheritance, containment, and 
+# class references variables) of the class with other documented classes.
+COLLABORATION_GRAPH    = YES
+# If the GROUP_GRAPHS and HAVE_DOT tags are set to YES then doxygen 
+# will generate a graph for groups, showing the direct groups dependencies
+GROUP_GRAPHS           = YES
+# If the UML_LOOK tag is set to YES doxygen will generate inheritance and 
+# collaboration diagrams in a style similar to the OMG's Unified Modeling 
+# Language.
+UML_LOOK               = NO
+# If set to YES, the inheritance and collaboration graphs will show the 
+# relations between templates and their instances.
+TEMPLATE_RELATIONS     = NO
+# If the ENABLE_PREPROCESSING, SEARCH_INCLUDES, INCLUDE_GRAPH, and HAVE_DOT 
+# tags are set to YES then doxygen will generate a graph for each documented 
+# file showing the direct and indirect include dependencies of the file with 
+# other documented files.
+INCLUDE_GRAPH          = YES
+# If the ENABLE_PREPROCESSING, SEARCH_INCLUDES, INCLUDED_BY_GRAPH, and 
+# HAVE_DOT tags are set to YES then doxygen will generate a graph for each 
+# documented header file showing the documented files that directly or 
+# indirectly include this file.
+INCLUDED_BY_GRAPH      = YES
+# If the CALL_GRAPH and HAVE_DOT tags are set to YES then doxygen will 
+# generate a call dependency graph for every global function or class method. 
+# Note that enabling this option will significantly increase the time of a run. 
+# So in most cases it will be better to enable call graphs for selected 
+# functions only using the \callgraph command.
+CALL_GRAPH             = NO
+# If the GRAPHICAL_HIERARCHY and HAVE_DOT tags are set to YES then doxygen 
+# will graphical hierarchy of all classes instead of a textual one.
+GRAPHICAL_HIERARCHY    = YES
+# If the DIRECTORY_GRAPH, SHOW_DIRECTORIES and HAVE_DOT tags are set to YES 
+# then doxygen will show the dependencies a directory has on other directories 
+# in a graphical way. The dependency relations are determined by the #include
+# relations between the files in the directories.
+DIRECTORY_GRAPH        = YES
+# The DOT_IMAGE_FORMAT tag can be used to set the image format of the images 
+# generated by dot. Possible values are png, jpg, or gif
+# If left blank png will be used.
+DOT_IMAGE_FORMAT       = png
+# The tag DOT_PATH can be used to specify the path where the dot tool can be 
+# found. If left blank, it is assumed the dot tool can be found in the path.
+DOT_PATH               = 
+# The DOTFILE_DIRS tag can be used to specify one or more directories that 
+# contain dot files that are included in the documentation (see the 
+# \dotfile command).
+DOTFILE_DIRS           = 
+# The MAX_DOT_GRAPH_WIDTH tag can be used to set the maximum allowed width 
+# (in pixels) of the graphs generated by dot. If a graph becomes larger than 
+# this value, doxygen will try to truncate the graph, so that it fits within 
+# the specified constraint. Beware that most browsers cannot cope with very 
+# large images.
+MAX_DOT_GRAPH_WIDTH    = 1024
+# The MAX_DOT_GRAPH_HEIGHT tag can be used to set the maximum allows height 
+# (in pixels) of the graphs generated by dot. If a graph becomes larger than 
+# this value, doxygen will try to truncate the graph, so that it fits within 
+# the specified constraint. Beware that most browsers cannot cope with very 
+# large images.
+MAX_DOT_GRAPH_HEIGHT   = 1024
+# The MAX_DOT_GRAPH_DEPTH tag can be used to set the maximum depth of the 
+# graphs generated by dot. A depth value of 3 means that only nodes reachable 
+# from the root by following a path via at most 3 edges will be shown. Nodes 
+# that lay further from the root node will be omitted. Note that setting this 
+# option to 1 or 2 may greatly reduce the computation time needed for large 
+# code bases. Also note that a graph may be further truncated if the graph's 
+# image dimensions are not sufficient to fit the graph (see MAX_DOT_GRAPH_WIDTH 
+# and MAX_DOT_GRAPH_HEIGHT). If 0 is used for the depth value (the default), 
+# the graph is not depth-constrained.
+MAX_DOT_GRAPH_DEPTH    = 0
+# Set the DOT_TRANSPARENT tag to YES to generate images with a transparent 
+# background. This is disabled by default, which results in a white background. 
+# Warning: Depending on the platform used, enabling this option may lead to 
+# badly anti-aliased labels on the edges of a graph (i.e. they become hard to 
+# read).
+DOT_TRANSPARENT        = NO
+# Set the DOT_MULTI_TARGETS tag to YES allow dot to generate multiple output 
+# files in one run (i.e. multiple -o and -T options on the command line). This 
+# makes dot run faster, but since only newer versions of dot (>1.8.10) 
+# support this, this feature is disabled by default.
+DOT_MULTI_TARGETS      = NO
+# If the GENERATE_LEGEND tag is set to YES (the default) Doxygen will 
+# generate a legend page explaining the meaning of the various boxes and 
+# arrows in the dot generated graphs.
+GENERATE_LEGEND        = YES
+# If the DOT_CLEANUP tag is set to YES (the default) Doxygen will 
+# remove the intermediate dot files that are used to generate 
+# the various graphs.
+DOT_CLEANUP            = YES
+#---------------------------------------------------------------------------
+# Configuration::additions related to the search engine   
+#---------------------------------------------------------------------------
+# The SEARCHENGINE tag specifies whether or not a search engine should be 
+# used. If set to NO the values of all tags below this one will be ignored.
+SEARCHENGINE           = NO
\ No newline at end of file
diff --git a/manager/makefile b/manager/makefile
new file mode 100644 (file)
index 0000000..ec41489
--- /dev/null
@@ -0,0 +1,24 @@
+CC = gcc
+DEBUG = -Wall -g
+LIBS = `pkg-config --libs glib-2.0 gmodule-2.0 libosso` -lpthread
+FLAGS = `pkg-config --cflags glib-2.0 gmodule-2.0 libosso`
+SOURCE = src
+BINARY = ../bin
+INCLUDE = ../include
+EXECUTABLE = ${BINARY}/WhiteStork
+
+all: ${BINARY}/ws_manager.o ${BINARY}/test_mng.o ${BINARY}/ws_dbus.o ${BINARY}/gui
+               @${CC} ${BINARY}/ws_manager.o ${BINARY}/test_mng.o ${BINARY}/ws_dbus.o ${LIBS} ${FLAGS} ${DEBUG} -o ${EXECUTABLE}
+${BINARY}/test_mng.o:
+               @${CC} -c ${SOURCE}/test_mng.c ${FLAGS} ${DEBUG} -o ${BINARY}/test_mng.o
+${BINARY}/ws_manager.o: 
+               @${CC} -c ${SOURCE}/ws_manager.c ${FLAGS} ${DEBUG} -o ${BINARY}/ws_manager.o
+${BINARY}/ws_dbus.o:
+               @cd ../dbus && make
+${BINARY}/gui:
+               cd ../gui && make
+clean:
+               rm -f ${BINARY}/*.o ${EXECUTABLE}
+run:
+               run-standalone.sh ./${EXECUTABLE}
+               
\ No newline at end of file
diff --git a/manager/src/test_mng.c b/manager/src/test_mng.c
new file mode 100644 (file)
index 0000000..483b96b
--- /dev/null
@@ -0,0 +1,43 @@
+/************************************************************************************************
+This file is part of WhiteStork.
+
+WhiteStork is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2 of the License, or
+(at your option) any later version.
+
+WhiteStork is distributed in the hope that it will be useful, 
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+GNU General Public License for more details.
+
+You should have received a copy of the GNU General Public License 
+along with WhiteStork; if not, write to the Free Software
+Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+
+Copyright 2006 ComArch S.A.
+************************************************************************************************/
+#include "../../include/ws_manager.h"
+#include <glib.h>
+#include <stdlib.h>
+int main ()
+{
+       WSMngSearchData *search_data = (WSMngSearchData *)g_try_malloc(sizeof (WSMngSearchData));
+       
+       ws_mng_init_gui(search_data);
+       ws_mng_init_dbus (search_data);
+       ws_mng_init (search_data);
+       
+       
+       
+       search_data->loop = g_main_loop_new (NULL, FALSE);
+       
+       g_main_loop_run (search_data->loop);
+       
+       ws_mng_close (search_data);
+       
+       g_free(search_data);
+       
+       return 0;
+}
+
diff --git a/manager/src/ws_manager.c b/manager/src/ws_manager.c
new file mode 100644 (file)
index 0000000..637095d
--- /dev/null
@@ -0,0 +1,300 @@
+/************************************************************************************************
+This file is part of WhiteStork.
+
+WhiteStork is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2 of the License, or
+(at your option) any later version.
+
+WhiteStork is distributed in the hope that it will be useful, 
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+GNU General Public License for more details.
+
+You should have received a copy of the GNU General Public License 
+along with WhiteStork; if not, write to the Free Software
+Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+
+Copyright 2006 ComArch S.A.
+************************************************************************************************/
+#include "../../include/ws_manager.h"
+
+void ws_mng_on_search_word (GError *error, GArray *word, gpointer user_data)
+{
+       WSMngSearchData *data = (WSMngSearchData *) user_data;
+       osso_rpc_t *osso_data;
+       
+       osso_data = &g_array_index (word, osso_rpc_t, 0); //get the word 
+       data->word = g_strdup(osso_data->value.s); 
+       
+       pthread_create (&data->p_thread, 
+                       NULL, 
+                       ws_mng_search_word, 
+                       data);   //create thread
+}
+
+gpointer ws_mng_search_word (gpointer data)
+{
+       WSMngSearchData *search = (WSMngSearchData *) data;
+       gint i = 0;
+       pthread_setcancelstate(PTHREAD_CANCEL_ENABLE, NULL); // set cancel type for thread
+       pthread_setcanceltype(PTHREAD_CANCEL_DEFERRED, NULL);// set cancel type for thread
+       
+       for (i=0; i<search->dict->len; i++)
+       {
+               dict_eng_search_word_list(g_array_index (search->dict, Engine *, i), search->word); //search for word in dictionaries
+       }
+       
+       return NULL;
+}
+
+/**
+* \brief Function used to compare string. Used in sorting GArray object
+*
+*@param a first argument to compere
+*@param b second argument to compere
+*@return result of compare <0 if the second is greater than first 0 if the strings are the same >0 if the first string is greater than second  
+*/
+static gint ws_mng_compare_strings (gconstpointer a, gconstpointer b)
+{
+       gchar** str1 = (gchar**)(a);
+       gchar** str2 = (gchar**)(b);
+       
+       return  g_utf8_collate(str1[0], str2[0]); 
+}
+
+
+void ws_mng_on_found_word (GArray* list, gchar* pattern, gpointer user_data, EngineStatus error)
+{
+       WSMngSearchData *data = (WSMngSearchData *) user_data;
+       
+       g_array_sort (list, ws_mng_compare_strings); //sort list of words
+       ws_dbus_server_return_words(data->dbus_data, list); //send words via dbus to gui
+}
+
+
+
+void ws_mng_on_search_translation (GError *error, GArray *word, gpointer user_data)
+{
+       WSMngSearchData *data = (WSMngSearchData *) user_data;
+       osso_rpc_t *osso_data;
+       
+       osso_data = &g_array_index (word, osso_rpc_t, 0); //get the word
+       data->word = g_strdup(osso_data->value.s);  
+       pthread_create (&data->p_thread, 
+                       NULL, 
+                       (gpointer) ws_mng_search_translation, 
+                       (gpointer) data); //create thread
+}
+
+
+gpointer ws_mng_search_translation (gpointer data)
+{
+       
+       WSMngSearchData *search = (WSMngSearchData *) data;
+       gint i = 0;
+       pthread_setcancelstate(PTHREAD_CANCEL_ENABLE, NULL); // set cancel type for thread
+       pthread_setcanceltype(PTHREAD_CANCEL_DEFERRED, NULL);// set cancel type for thread
+       
+       for (i=0; i<search->dict->len; i++)
+       {
+               dict_eng_search_word_translation(g_array_index (search->dict, Engine*, 0),
+                                                search->word); //search for translation
+       }
+       return NULL;
+}
+
+
+void ws_mng_on_found_translation (gchar* translation, gchar* pattern, gpointer user_data, EngineStatus error)
+{
+       WSMngSearchData *data = (WSMngSearchData *) user_data;
+       ws_dbus_server_return_translations(data->dbus_data, translation); //return translation via dbus to gui
+}
+
+
+void ws_mng_init_dbus (WSMngSearchData *data)
+{
+       data->dbus_data = ws_dbus_create ("WhiteStorkManager", "v1.0"); 
+       
+       ws_dbus_config(data->dbus_data, 
+                       WS_DBUS_CONFIG_SERVICE,
+                       "org.maemo.WhiteStorkManager");
+       ws_dbus_config(data->dbus_data, 
+                       WS_DBUS_CONFIG_OBJECT, 
+                       "/org/maemo/WhiteStorkManager");
+       ws_dbus_config(data->dbus_data, 
+                       WS_DBUS_CONFIG_IFACE, 
+                       "org.maemo.WhiteStorkManager");
+       ws_dbus_config(data->dbus_data, 
+                       WS_DBUS_CONFIG_REMOTE_SERVICE, 
+                       "org.maemo.WhiteStorkGui");
+       ws_dbus_config(data->dbus_data, 
+                       WS_DBUS_CONFIG_REMOTE_OBJECT, 
+                       "/org/maemo/WhiteStorkGui");
+       ws_dbus_config(data->dbus_data, 
+                       WS_DBUS_CONFIG_REMOTE_IFACE, 
+                       "org.maemo.WhiteStorkGui");
+       
+       ws_dbus_connect(data->dbus_data);
+       
+       ws_dbus_set_cb(data->dbus_data, 
+                       "find_word", 
+                       ws_mng_on_search_word,
+                       data);// setting callback for find word signal
+       ws_dbus_set_cb(data->dbus_data,
+                       "find_translation",
+                       ws_mng_on_search_translation,
+                       data); //setting callback for find translation signal
+       ws_dbus_set_cb(data->dbus_data,
+                       "signal",
+                       ws_mng_signal_handling,
+                       data); //setting callback for close program signal
+}
+
+
+void ws_mng_init_gui ()
+{
+       int pid = fork ();
+       
+       gchar* current_directory = g_get_current_dir(); //get the current directory
+       gchar* library_to_path = g_strconcat(current_directory, "/bin/gui", NULL); //set path to gui binary file
+       
+       switch (pid)
+       {
+               case -1:
+                       g_printf("Error ! Can not spwan user interface process");
+                       exit(0);
+               break;
+               
+               case 0:
+                       execl(library_to_path,0); //run the gui program
+               break;
+               
+               default:
+               break;
+       }
+       
+       g_free(current_directory);
+       g_free(library_to_path);
+}
+
+void ws_mng_init (WSMngSearchData *data)
+{
+       
+//     GArray *dictionary = g_array_new(TRUE, TRUE, sizeof(Engine *)); //Garray for dictionaries
+//     GArray *dict_modules = g_array_new(TRUE, TRUE, sizeof(EngineModule));// Garray for modules
+       
+       data->dict = g_array_new(TRUE, TRUE, sizeof(Engine *));
+       data->modules = g_array_new(TRUE, TRUE, sizeof(EngineModule));
+       
+       gchar *current_directory = g_get_current_dir(); // get the current directory
+       gchar *library_to_path = g_strconcat(current_directory, "/bin/engine_xdxf.so", NULL); //set path to engine module
+       
+       data->library = g_module_open(library_to_path, G_MODULE_BIND_LAZY); //load the engine function
+       getting_additional get_functions;
+       
+       g_module_symbol(data->library, "engine_global_functions", (gpointer)&get_functions);
+       
+       if (get_functions == NULL) //check if function was load
+       {
+               g_printf("Loading module function failed\n");
+               while (ws_dbus_notify(data->dbus_data, WS_DBUS_ERROR_ENGINE_NOT_FOUND) == WS_DBUS_STATUS_ERROR) // wait until communication with gui is establish
+               {
+                       sleep(2);
+               }
+               g_free(current_directory);
+               g_free(library_to_path);        
+               ws_mng_close(data);
+               exit(0); //exit program
+       }
+       
+       EngineModule module = get_functions();
+       //data->module = module;
+       Engine* xdxf;
+       
+       if (dict_eng_module_check (module, current_directory) == TRUE)
+       {
+               xdxf = dict_eng_module_create(module, current_directory, ENGINE_CREATE); //create engine module 
+               
+//             g_array_append_val (dict_modules, module);//adding newly created module to Garray for modules
+//             g_array_append_val (dictionary, xdxf);//adding newly created engine to Garray for dictionaries
+               g_array_append_val (data->modules, module);//adding newly created module to Garray 
+               g_array_append_val (data->dict, xdxf);//adding newly created engine to Garray 
+//             data->dict = dictionary; //
+//             data->modules = dict_modules;//
+               
+               if (g_file_test("dict.cache", G_FILE_TEST_EXISTS) == FALSE)//check if the cache file is created
+               {
+                       g_printf("Dictionary has no cache!\nCreating cache file\n");
+                       dict_eng_optimize(xdxf); //make cache for dictionary    
+               }
+               
+               dict_eng_set_callback(xdxf, 
+                                     ENGINE_WORD_LIST_SIGNAL,
+                                     ws_mng_on_found_word,
+                                     data);//set callback for return words list function
+               dict_eng_set_callback(xdxf,
+                                     ENGINE_WORD_TRANSLATION_SIGNAL, ws_mng_on_found_translation,
+                                     data);//set callback for return translation       
+       }
+       else
+       {
+               g_printf("Dictionary file not found");
+               while (ws_dbus_notify(data->dbus_data, WS_DBUS_ERROR_FILE_NOT_FOUND) == WS_DBUS_STATUS_ERROR)// wait until communication with gui is establish
+               {
+                       sleep(2);
+               }
+               g_free(current_directory);
+               g_free(library_to_path);
+               ws_mng_close(data);
+               //dict_eng_destroy(xdxf);
+               exit(0);
+       }
+       g_free(current_directory);
+       g_free(library_to_path);
+}
+
+void ws_mng_signal_handling (GError *error, GArray *signal, gpointer user_data)
+{
+       //printf("---->%s", __FUNCTION__);
+       osso_rpc_t osss_data;
+       osss_data = g_array_index (signal, osso_rpc_t, 0);// get the signal kind
+       WSMngSearchData *data = (WSMngSearchData *) user_data;
+       switch(osss_data.value.i)
+       {
+               case WS_DBUS_INFO_TERMINATE:
+                       g_printf("\nTerminating program\n");
+                       g_main_loop_quit (data->loop);
+               break;
+               
+               case WS_DBUS_INFO_STOP_SEARCH:
+                       pthread_cancel(data->p_thread);
+               break;
+               
+               default:
+
+               break;
+       }
+}
+
+void ws_mng_close (WSMngSearchData *data)
+{
+       int i = 0;
+       //dict_eng_destroy(g_array_index (data->dict, Engine*,0));
+       ws_dbus_destroy (data->dbus_data); // deinitialization of dbus
+       
+       for (i = 0; i < data->dict->len; i++) 
+       {
+               g_free(g_array_index(data->dict, Engine*, i)); //free memory taken by engine
+       }
+       
+       g_array_free(data->modules, TRUE); //deallocates memory taken by Garray modules
+       g_array_free(data->dict, TRUE);//deallocates memory taken by Garray dict
+       
+       g_free(data->loop); 
+       g_free(data->word);
+       if (data->library != NULL)
+       {
+               g_module_close (data->library); //close library
+       }
+}