Added new targets to makefile: deb, deldeb
authormaritus <lucas.pawlik@gmail.com>
Mon, 28 Aug 2006 07:45:29 +0000 (07:45 +0000)
committermaritus <lucas.pawlik@gmail.com>
Mon, 28 Aug 2006 07:45:29 +0000 (07:45 +0000)
git-svn-id: file:///svnroot/mdictionary/trunk@2 5bde0345-f819-0410-ac75-e5045f9217cc

25 files changed:
Makefile [new file with mode: 0644]
README
data/org.maemo.WhiteStorkManager.service [new file with mode: 0644]
data/whitestork.desktop [new file with mode: 0644]
data/whitestork.png [new file with mode: 0644]
dbus/src/ws_dbus.c
dh_make [new file with mode: 0755]
dict.cache [new file with mode: 0644]
dict.xdxf [new file with mode: 0644]
engine/include/dictionary_engine.h
engine/src/engine_xdxf.c
gui/makefile
gui/src/ikona.png [deleted file]
gui/src/whitestork.png [new file with mode: 0644]
gui/src/ws_gui.c
gui/src/ws_gui_callbacks.c
gui/src/ws_gui_layout.c
include/ws_dbus.h
include/ws_gui.h
include/ws_gui_callbacks.h
include/ws_gui_layout.h
makefile [deleted file]
manager/makefile
manager/src/test_mng.c
manager/src/ws_manager.c

diff --git a/Makefile b/Makefile
new file mode 100644 (file)
index 0000000..28c29ab
--- /dev/null
+++ b/Makefile
@@ -0,0 +1,122 @@
+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
+APP = whitestork
+APP_VER = 0.1.1
+EXECUTABLE = ${BINARY}/WhiteStork
+
+CONTENT = \
+"Source: whitestork\nSection: user/tools Tools\nPriority: optional\nMaintainer: ComArch S.A. <contact@comarch.com>\nBuild-Depends: debhelper (>= 4.0.0)\nStandards-Version: 3.6.0\n\
+\nPackage: whitestork \nArchitecture: any \nDepends: \$${shlibs:Depends}, \$${misc:Depends} \nDescription: multilangual dictionary programm for XDXF dictionaries\n\
+ This dictionary is based on XDXF-based format doctionaries.\n \
+ You can download any dictionary on http://xdxf.sourceforge.net and use it \n \
+ with this program to have better and faster search engine with graphics user \n \
+ interface. Program is written and devoleped to run on maemo platform \n \
+ (Nokia 770 device - see: http://www.nokia.com/770). \n \
+ Copyright 2006, ComArch S.A. "
+
+ICON = "\n\nXB-Maemo-Icon-26:\n\
+iVBORw0KGgoAAAANSUhEUgAAABoAAAAZCAAAAAAKtWG8AAAACXBIWXMAAAAnAAAAJwEqCZFP\n\
+AAAAB3RJTUUH1QkMEgEBuF+MPAAAACF0RVh0Q29tbWVudABKUEVHOmdudS1oZWFkLmpwZyAy\n\
+NzZ4MjYxjzmxCgAAAi9JREFUKM9dkd9LU2Ecxp/37HU/nFub02Zty9K0lc5FYWJBUCBeRD+o\n\
+y6j/IoIuoj8hgi6DgqAroSAk+gWSIuZVTU1nuDM3tzl1O3PNc3a29/12cSyoy+/zfD+fm4cR\n\
+QJWdPXgiCgMAECNVF72t4ICZmEmxmn9ooN8FAEV1gnmr/VeCHDKd9USHlIAecAIAfPJmM5l5\n\
+br/NkdS16KAHtFdccndTLuAcBaKmVslxMkoIeUAFdT4hr00IfvUGR8fxjU2dw1VK3AG0z4/V\n\
+qjI59j05R7cUHHLYHVyW01GC+fFhPayFR/p6JlefHLyI5fnrLVzhzfxi+MW7B+N29Wx2mr9f\n\
+y73O19+E3G1MzmZeenxLr7rW3sYHybbz6XLft6ep0PDwOdujtt3Dxer9ASbj+pTdF04mzwRT\n\
+sfOdo5zDf5L7XBcA+BfVES/8P0zn+NbRkA0govzSHBElhDR0SXJ6VYpsk4gYAagXurH9q8sJ\n\
+kXKFChm30XTEAQ4AxUhjVcQkseV68Eu8UzutAAAjwFgo1S+VI6i0VtX0GHnyXre1AVFj29gS\n\
+X4nkuiYqZTH1QRIRkQKABxyK0l4mFt5gXl+hEbOG4wAAGDi2IjpYx2xEW8mdsjIQERGtCVrf\n\
+kCTMjCnTlo8U6yFUQLi+1RA/n92dYZYPjCy2xPy1vcIJRdUHbPu+fYq110w3p6JN7hL+rcC6\n\
+WhiOqMmFXuP/Ci0KuMuZLd2b/5OwvzwAamrlWs+B/es340gXFARK7DMAAAAASUVORK5CYII=\n"
+
+LINKS = "/usr/share/applications/hildon/whitestork.desktop etc/others-menu/extra-applications/0112_whitestork.desktop"
+
+
+all: ${BINARY}/engine_xdxf.so ${BINARY}/ws_dbus.o ${BINARY}/WhiteStork ${BINARY}/WhiteStorkManager
+               @echo -e "\n.::======================= Success!! ===================::.\n\n"
+       
+${BINARY}/WhiteStorkManager:
+               @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}/WhiteStork:
+               @echo -e "\n.::==================  Compiling GUI ...  ==============::."
+               @cd gui && make
+               @echo -e "\n.::=============== GUI Compilation Finished. ============::.\n\n"a
+${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}
+
+deb:
+               @echo -e -n "..:: Makeing debianized source....\n"
+               @echo -e -n "..:: --> Makeing new directory with source...  ../${APP}-${APP_VER}\n"
+               @-rm -f -r -d ../${APP}-${APP_VER}
+               @-rm -f ../*.tar.gz
+               @-rm -f ../*.deb
+               @-rm -f ../dh_make
+               @cp dh_make ../dh_make
+               @mkdir ../${APP}-${APP_VER}
+               @cp -r * ../${APP}-${APP_VER}
+               @echo -e -n "..:: --> Debianizing new source directory ../${APP}-${APP_VER}\n"
+               @cd .. && tar -czf ${APP}-${APP_VER}.tar.gz ./${APP}-${APP_VER}
+               @cd ../${APP}-${APP_VER} && ./dh_make -c gpl -f ../${APP}-${APP_VER}.tar.gz -e contact@comarch.com -m
+               @echo -e -n "..:: --> Set new content for basic debian package files...\n"
+               @echo -e -n "..:: ----> Setting files 'content' to:\n"
+               @echo -e -n ${CONTENT}
+               @echo -e -n ${CONTENT} > ../${APP}-${APP_VER}/debian/control
+               @echo -e -n ${LINKS} > ../${APP}-${APP_VER}/debian/${APP}.links
+               @echo -e -n "..:: --> Makeing debian package...\n"
+               @cd ../${APP}-${APP_VER} && dpkg-buildpackage -tc -rfakeroot
+
+deldeb:
+               @echo -e -n "Deleteing package...\n"            
+               @-rm -f -r -d ../${APP}-${APP_VER}
+               @-rm -f ../${APP}*.tar.gz
+               #@-rm -f ../${APP}*.deb
+               @-rm -f ../${APP}*.dsc
+               @-rm -f ../${APP}*.diff.gz
+               
+install:
+               @echo -e -n "installing Maemo Whitestork Dictionary...\n"
+               @make
+               install -d ${DESTDIR}/usr/share
+               install -d ${DESTDIR}/usr/share/WhiteStork
+               install -d ${DESTDIR}/usr/share/WhiteStork/engines
+               install -d ${DESTDIR}/usr/share/WhiteStork/dict
+               install -d ${DESTDIR}/usr/lib/WhiteStork
+               install -d ${DESTDIR}/usr/include/WhiteStork
+               install -d ${DESTDIR}/usr/share/dbus-1
+               install -d ${DESTDIR}/usr/share/dbus-1/services
+               install -d ${DESTDIR}/usr/share/pixmaps
+               install -d ${DESTDIR}/usr/share/applications/hildon
+               install ${EXECUTABLE}  ${DESTDIR}/usr/bin
+               install ${BINARY}/WhiteStorkManager ${DESTDIR}/usr/bin  
+               install dict.xdxf ${DESTDIR}/usr/share/WhiteStork/dict
+               install dict.cache ${DESTDIR}/usr/share/WhiteStork/dict
+               install ${BINARY}/engine_xdxf.so ${DESTDIR}/usr/lib/WhiteStork
+               install ${INCLUDE}/dictionary_engine.h ${DESTDIR}/usr/include/WhiteStork
+               install data/org.maemo.WhiteStorkManager.service ${DESTDIR}/usr/share/dbus-1/services
+               install data/whitestork.desktop ${DESTDIR}/usr/share/applications/hildon
+               install data/whitestork.png ${DESTDIR}/usr/share/pixmaps
+
diff --git a/README b/README
index e06bbe9..8b70708 100644 (file)
--- a/README
+++ b/README
@@ -1,4 +1,4 @@
-WhiteStork Multilingual Dictionary ver. 0.1.0 ALPHA
+WhiteStork Multilingual Dictionary
 
 What is WhiteStork Multilingual Dictionary
 ------------------------------------------
@@ -25,4 +25,15 @@ 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
+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.
+
+Making a deb package
+--------------------
+
+We have also included an additional target named "deb" to our Makefile. So if you would like to make a debian package from a current release, knock yourself out. Type the following command in the shell:
+
+make deb
+
+Have fun using our application
+
+The WhiteStork Multilingual dictionary developer's
diff --git a/data/org.maemo.WhiteStorkManager.service b/data/org.maemo.WhiteStorkManager.service
new file mode 100644 (file)
index 0000000..92c3155
--- /dev/null
@@ -0,0 +1,4 @@
+# Sample service description file
+[D-BUS Service]
+Name=org.maemo.WhiteStorkManager
+Exec=/usr/bin/WhiteStorkManager
diff --git a/data/whitestork.desktop b/data/whitestork.desktop
new file mode 100644 (file)
index 0000000..eaf2a88
--- /dev/null
@@ -0,0 +1,13 @@
+[Desktop Entry]
+Encoding=UTF-8
+Version=1.0
+Name=WhiteStork Dictionary
+Comment=Multilingual dictionary
+Exec=/usr/bin/WhiteStork
+Icon=whitestork
+Terminal=true
+Type=Application
+X-HildonDesk-ShowInToolbar=true
+X-Osso-Type=application/x-executable
+X-Window-Icon=whitestork
+
diff --git a/data/whitestork.png b/data/whitestork.png
new file mode 100644 (file)
index 0000000..25b21e2
Binary files /dev/null and b/data/whitestork.png differ
index 280c93b..64938fe 100644 (file)
@@ -574,6 +574,48 @@ WSDBusStatus ws_dbus_server_return_translations (WSDBusData * ws_dbus_data, gcha
        return WS_DBUS_STATUS_OK;
 };
 
+WSDBusStatus ws_dbus_send_ptrtodata (WSDBusData * ws_dbus_data, gchar *method, gulong data_address)
+
+{
+       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, 
+                               method, 
+                               retval,
+                               DBUS_TYPE_INT32,
+                               data_address,
+                               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)
 
 {
@@ -613,3 +655,74 @@ WSDBusStatus ws_dbus_server_return_translations_last (WSDBusData * ws_dbus_data,
        g_free (retval);
        return WS_DBUS_STATUS_OK;
 };
+
+gpointer ws_dbus_concat_data (GArray *garray)
+{
+       guint i;
+       gchar temp_len = 0;
+       gulong total_len = 0;
+       gpointer temp = NULL, start;
+       gchar *array;
+
+       for (i=0;i<garray->len;++i)
+       {
+               array = g_array_index (garray, gchar *, i);
+               printf ("DBUS: %s: text added: %s\n", __FUNCTION__, array);
+               temp = start;
+               temp_len = strlen (array);
+               printf ("length: %d\n", temp_len);
+               start = g_malloc (total_len + temp_len + 1);
+               memcpy (start, temp, total_len);
+               if (i > 0) g_free (temp);
+               temp = start + total_len;
+               memcpy (temp, &temp_len, 1);
+               memcpy (temp+1, array, temp_len);
+               total_len = total_len + temp_len + 1;
+       };
+/*
+//     Dodaj 0 na koñcu stringa
+       temp = start;
+       start = g_malloc (total_len + 1);
+       memcpy (start, temp, total_len);
+       g_free (temp);
+       temp = start + total_len;
+       temp_len = 0;
+       memcpy (temp, &temp_len, 1);
+*/
+       
+       return start;
+};
+
+GArray * ws_dbus_split_data (gpointer buffer)
+{
+       gchar *temp;
+       gchar *str;
+       guint len;
+       guint total_len = 0;
+       guint buffer_len;
+       guint i = 0;
+       GArray *garray;
+
+       temp = buffer;
+
+       buffer_len = strlen (buffer);
+
+       printf ("D³ugo¶æ bufora %d\n", strlen (buffer));
+       garray = g_array_new (TRUE, TRUE, sizeof(gchar *));
+       
+       while (temp[0] != 0)
+       {
+//             printf ("DBUS: $s: length = %d\n", __FUNCTION__, temp[0]);
+               len = temp[0];
+               total_len = total_len + len;
+               str = g_malloc (len + 1);
+               memcpy (str, temp+1, len);
+               str[len] = 0;
+               temp = temp + len + 1;
+               printf ("Odebrany tekst: %s, %d\n", str, len);
+               g_array_append_val (garray, str);
+               ++i;
+       };      
+
+       return garray;
+};
diff --git a/dh_make b/dh_make
new file mode 100755 (executable)
index 0000000..cc9a96a
--- /dev/null
+++ b/dh_make
@@ -0,0 +1,608 @@
+#!/scratchbox/tools/bin/perl 
+#
+# dh_make - Script to Debianize a source archive
+#
+use Getopt::Long;
+use Cwd;
+
+#Getopt::Long::Configure ("bundling");  
+#Getopt::Long::Configure ("bundling_override");  
+
+# Some important parameters
+$DHLIB="/scratchbox/devkits/debian/share/debhelper/dh_make";
+$POLICY_VERSION="3.6.0";
+$DH_MAKE_VERSION="0.36";
+%PACKAGE_TYPES = ( 's' => 'Single', 'l' => 'Library', 'm' => 'Multi-Binary',
+                   'k' => 'Kernel Module');
+$DASHLINE="";
+
+$license="";
+$email="";
+$username="";
+$package_name="";
+$cap_package_name="";
+$version="";
+$fullname = "";
+$source_file="";
+$debian_native = 0;
+$package_type="";
+$CHANGELOG="";
+$PRESERVE="";
+$add_missing = 0;
+$custom = "";
+$no_defaults = 0;
+$overlay = "";
+$forced_package_name="";
+
+my $dummy;
+
+sub process_file(@)
+{
+   my ($infile, $outfile) = @_;  
+   my $line;
+
+   if ( $main::overlay eq "" )
+   {
+     if ( $main::add_missing && -f $outfile) {
+       print "File $outfile exists, skipping.\n";
+       return;
+     }
+   }
+
+    open IN, "<$infile" or die "Unable to open template file $infile for reading: $! \n";
+    open OUT, ">$outfile" or die "Unable to open file $outfile for writing: $! \n";
+    while (defined($line = <IN>))
+    {
+      $line =~ s/#PACKAGE#/$main::package_name/g;
+      $line =~ s/#UCPACKAGE#/$main::uc_package_name/g;
+      $line =~ s/#VERSION#/$main::version/g;
+      $line =~ s/#EMAIL#/$main::email/g;
+      $line =~ s/#DATE#/$main::date/g;
+      $line =~ s/#SHORTDATE#/$main::shortdate/g;
+      $line =~ s/#CHANGELOGS#/$main::CHANGELOG/g;
+      $line =~ s/#PRESERVE#/$main::PRESERVE/g;
+         $line =~ s/#CONFIG_STATUS#/$main::CONFIG_STATUS/g;
+      $line =~ s/#CONFIGURE#/$main::CONFIGURE/g;
+         $line =~ s/#CONFIGURE_STAMP#/$main::CONFIGURE_STAMP/g;
+      $line =~ s/#DPKG_ARCH#/$main::DPKG_ARCH/g;
+      $line =~ s/#INSTALL#/$main::INSTALL/g;
+      $line =~ s/#CLEAN#/$main::CLEAN/g;
+      $line =~ s/#USERNAME#/$main::username/g;
+      $line =~ s/#POLICY#/$main::POLICY_VERSION/g;
+      $line =~ s/#DASHLINE#/$main::DASHLINE/g;
+         $line =~ s/#PHONY_CONFIGURE#/$main::PHONY_CONFIGURE/g;
+
+      print OUT $line;
+    }
+    close IN;
+    close OUT;
+}
+
+sub show_version
+{
+  print "dh_make - Script to Debianize a regular source archive, version $main::DH_MAKE_VERSION\n\n";
+  print "Copyright (C) 1998-2004 Craig Small <csmall\@debian.org>\n";
+  print "This is free software; see the source for copying conditions.  There is NO\n";
+  print "warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n";
+}
+sub show_help
+{
+  show_version();
+  print <<EOF
+  Usage: dh_make [options]
+  -c, --copyright <type>    use <type> of license in copyright file
+                            (gpl|lgpl|artistic|bsd)
+  -e, --email <address>     use <address> as the maintainer e-mail address
+  -n, --native              the program is Debian native, don\'t generate .orig
+  -f, --file <file>         specify file to use as the original source archive
+  -s, --single              set package class to single
+  -m, --multi               set package class to multiple binary
+  -l, --library             set package class to library
+  -k, --kmod                set package class to kernel module
+  -a, --addmissing          reprocess package and add missing files
+  -t, --templates <dir>      apply customizing templates in <dir>
+  -d  --defaultless         skip the default debian and package class templates
+  -o, --overlay <dir>       reprocess package using template in <dir>
+  -p, --packagename <name>  force package name to be <name>
+  -h, --help                display this help screen and exit
+  -v, --version             show the version and exit
+
+By Craig Small <csmall\@debian.org>
+Based on deb-make by Christoph Lameter <clameter\@debian.org>.
+Custom template support by Bruce Sass <bsass\@edmc.net>.
+EOF
+}
+
+sub parse_args
+{
+  my ($dohelp,$doversion, $single,$multi,$library );
+  %options = ('copyright' => \$main::license,
+              'email' => \$main::email,
+              'file' => \$main::source_file,
+             'help' => \$dohelp,
+             'version' => \$doversion,
+             'native' => \$main::debian_native,
+             'single' => \$single,
+             'multi' => \$multi,
+             'library' => \$library,
+             'kmod' => \$kmod,
+             'addmissing' => \$main::add_missing,
+             'templates' => \$main::custom,
+             'defaultless' => \$main::no_defaults,
+             'overlay' => \$main::overlay,
+                 'packagename' => \$main::forced_package_name,
+             );
+  if (GetOptions(\%options, "copyright=s", "email=s", "file=s", "templates=s", "overlay=s", "packagename=s", "help", "version", "native", "single", "multi", "library", "kmod", "addmissing", "defaultless") == 0)
+  {
+    show_help();
+    exit;
+  }
+  if ($doversion)
+  {
+    show_version();
+    exit;
+  }
+  if ($dohelp)
+  {
+    show_help();
+    exit;
+  }
+  if ($single)
+  {
+    $main::package_type = 's';
+  }
+  if ($multi)
+  {
+    $main::package_type = 'm';
+  }
+  if ($library)
+  {
+    $main::package_type = 'l';
+  }
+  if ($kmod)
+  {
+    $main::package_type = 'k';
+  }
+  if ($addmissing)
+  {
+    $main::add_missing = 1;
+  }
+  if ($defaultless)
+  {
+    $main::no_defaults = 1;
+  }
+  $main::license = lc $main::license;
+  if ($main::lincense ne "" && grep(!/gpl|lgpl|artistic|bsd/, $main::license)) {
+    print "Copyright type \"$main::license\" is not gpl, lgpl, artistic or bsd\n";
+    exit;
+  }
+
+}
+
+sub get_username
+{
+  my $tmpusername;
+
+  $tmpusername = $ENV{'DEBFULLNAME'};
+  return $tmpusername if ($tmpusername ne "");
+
+  if (-x '/usr/bin/getent')
+  {
+    $tmpusername = `/usr/bin/getent passwd $ENV{LOGNAME}|awk -F: '\{ print \$5; \}' | cut -f1 -d,`;
+  }
+  chomp($tmpusername);
+  return $tmpusername if ($tmpusername ne "");
+
+  $tmpusername =`awk -F: -vUSER=$ENV{LOGNAME} '\$1 == USER \{ print \$5; \}' /etc/passwd | cut -f1 -d,`;
+  chomp($tmpusername);
+  return $tmpusername if ($tmpusername ne "");
+  
+  if (-x '/usr/bin/ypmatch')
+  {
+    $tmpusername=`ypmatch $ENV{LOGNAME} passwd.byname|awk -F: '\{ print \$5; \}' | cut -f1 -d,`;
+  }
+  chomp($tmpusername);
+  return $tmpusername if ($tmpusername ne "");
+
+  if (-x '/usr/bin/ldapsearch')
+  {
+    $tmpusername = [map {/^(?:gecos|cn): (.*)/} `ldapsearch -Q -LLL uid=$ENV{LOGNAME} gecos cn`]->[0];
+  }
+  chomp($tmpusername);
+  return $tmpusername if ($tmpusername ne "");
+
+  return "unknown";
+}
+
+sub get_email() 
+{
+  if ($ENV{DEBEMAIL} )
+  {
+    return $ENV{DEBEMAIL};
+  }
+  if ($ENV{EMAIL} )
+  {
+    return $ENV{EMAIL};
+  }
+  if (-x '/usr/bin/ldapsearch')
+  {
+    my $mail;
+    $mail = [map {/^mail: (.*)/ && $1} `ldapsearch -Q -LLL uid=$ENV{LOGNAME} mail`]->[0];
+      return $mail if $mail;
+  }
+  if ($ENV{LOGNAME} )
+  {
+    my $mailhost;
+    if ( -e '/etc/mailname'){
+      chomp($mailhost = `cat /etc/mailname`);
+    } else {
+      $mailhost='unknown';
+    } 
+    return  ($ENV{LOGNAME} . '@' . $mailhost);
+  }
+}
+
+sub get_package
+{
+  my $pwd = `pwd`;
+
+  if (( ($main::forced_package_name) && 
+        ($pwd =~ /.*\/($main::forced_package_name)-([0-9][0-9a-zA-Z+\.\-]*)$/)
+         ) || (
+        ($pwd =~ /.*\/(.*)-([0-9][0-9a-zA-Z+\.\-]*)$/)
+         ))
+  {
+    if ($main::forced_package_name) {
+         $main::package_name = $main::forced_package_name;
+       } else {
+      $main::package_name = $1;
+       }
+    $main::uc_package_name = uc $main::package_name;
+    $main::version = $2;
+       # Fullname stays as the original dir
+    $main::fullname = $1 . "-"  . $2;
+  } else {
+    my $pwd = cwd();
+       print <<"EOF";
+The directory name must be <package>-<version> for dh_make to work!
+I cannot understand the directory name or you have an invalid directory name!
+
+Your current directory is $pwd, perhaps you could try going to
+directory where the sources are?
+EOF
+    exit 1;
+  }
+  if (! ($main::package_name =~ /^[a-z0-9+.-]+$/)) {
+    print <<"EOF";
+Package name "$main::package_name" is not in a valid format.
+Debian policy manual states:
+  "Package names must only consist of lower case letters, digits (0-9),
+   plus (+) or minus (-) signs, and periods (.)"
+EOF
+    exit 1;
+  }
+}
+
+sub get_date
+{
+  my $tmpdate;
+  if (-x "/scratchbox/devkits/debian/bin/822-date")
+  {
+    $tmpdate = `/scratchbox/devkits/debian/bin/822-date`;
+    chomp($tmpdate);
+    return $tmpdate;
+  } else {
+    die "Unable to find 822-date program in /scratchbox/devkits/debian/bin!\n";
+  }
+}
+
+$username = get_username();
+$email = get_email();
+$date = get_date();
+$shortdate = `date '+%B %e, %Y'`;
+chomp $shortdate;
+parse_args();
+if ( ! $overlay eq "" )
+{
+  #setup for overlay mode
+  $no_defaults = 1;
+  $add_missing = 1;
+  $customer = $overlay;
+}
+get_package();
+
+# Generate a line of dashes, which is as long as '#PACKAGE# for Debian'.
+for ($i=0; $i<length("$main::package_name for Debian"); $i++)
+{
+ $DASHLINE = $DASHLINE . '-';
+}
+
+if ( ! $no_defaults )
+{
+  while ($package_type eq "")
+  {
+    print "\nType of package: single binary, multiple binary, library, or kernel module?\n [s/m/l/k] ";
+    $type = <STDIN>;
+    chomp($type);
+    print "\n";
+    $type = lc($type);
+    $main::package_type = 's' if $type eq 's';
+    $main::package_type = 'm' if $type eq 'm';
+    $main::package_type = 'l' if $type eq 'l';
+    $main::package_type = 'k' if $type eq 'k';
+  }
+}
+
+# Print what we have found
+print "Maintainer name : $username\n";
+print "Email-Address   : $email \n";
+print "Date            : $date\n";
+print "Package Name    : $package_name\n";
+print "Version         : $version\n";
+print "Type of Package : ";
+if (exists $PACKAGE_TYPES{$package_type})
+{
+  print $PACKAGE_TYPES{$package_type};
+} else {
+  print 'unknown';
+}
+if ( $customer ne "" )
+{
+  print "\nCustomer template : $custom";
+}
+if ( $overlay ne "" )
+{
+  print " (overlay)";
+}
+if ( $no_defaults )
+{
+  print "\nDefault debian and package class templates will not be applied.";
+}
+print "\nHit <enter> to confirm: hacked by STRanger, 2006 - you do not have to hit <enter> \n";
+# $dummy = <STDIN>;
+
+if (! $debian_native)
+{
+  if ($source_file)
+  {
+    if (-f $source_file)
+    {
+      system('cp', '-a', "$source_file", "../$package_name\_$version.orig.tar.gz");
+    } else {
+      print "Source archive you specified was not found!\n";
+      exit 1;
+    }
+  } else {
+    if (-d "..$fullname.orig")
+    {
+      print "Skipping copying to $fullname.orig since $fullname.orig exists.\n";
+    } else {
+         if ( -f "../$fullnane.orig.tar.gz")
+         {
+           print "Skipping copying to $fullname.orig since $fullname.org.tar.gz exists.\n";
+         } else {
+        system('cp', '-a', "../$fullname", "../$fullname.orig");
+         }
+    }
+  }
+}
+# Figure out where documentation is
+@DOCS= split / |\n/, `ls -1 N[Ee][Ww][Ss] *[Ff][Aa][Qq]* *.[Tt][Xx][Tt] README* *.README [rR]eadme* *.[rR]eadme [Bb][Uu][Gg][Ss] *[tT][oO][dD][oO]* 2>/dev/null`;
+# What are our info files
+@INFOS= split / |\n/, `find . -regex '.*\\.info\\(-[0-9]+\\)?'`;
+# Figure out where is the first changelog, assign other similar files to docs
+@changelogs= split / |\n/, `ls *[cC][hH][aA][nN][gG][eE][lL][oO][gG]* [cC][hH][aA][nN][gG][eE][sS]* 2>/dev/null`;
+$CHANGELOG = $changelogs[0] if ($#changelogs != -1);
+shift @changelogs;
+@DOCS = (@DOCS,@changelogs);
+# Are there any .orig files in the upstream sources
+@ORIG= split /[ \n]/, `find . -name '\*.orig'`;
+
+foreach $orig (@ORIG)
+{
+  $PRESERVE="$PRESERVE --exclude $orig";
+}
+
+
+# Setup debian/rules
+if (-x "./configure" )
+{
+  $CONFIG_STATUS="config.status";
+  $CONFIGURE_STAMP='';
+  $PHONY_CONFIGURE='';
+  $CONFIGURE="config.status: configure\n".
+             "\tdh_testdir\n".
+                        "\t# Add here commands to configure the package.\n".
+                        "\t".'CFLAGS="$(CFLAGS)" ./configure --host=$(DEB_HOST_GNU_TYPE) --build=$(DEB_BUILD_GNU_TYPE) --prefix=/usr --mandir=\$${prefix}/share/man --infodir=\$${prefix}/share/info'."\n";
+  $DPKG_ARCH="# These are used for cross-compiling and for saving the configure script\n".
+             "# from having to guess our platform (since we know it already)\n".
+                        'DEB_HOST_GNU_TYPE   ?= $(shell dpkg-architecture -qDEB_HOST_GNU_TYPE)'."\n".
+                        'DEB_BUILD_GNU_TYPE  ?= $(shell dpkg-architecture -qDEB_BUILD_GNU_TYPE)'."\n";
+
+
+  # If it is automaked, use DESTDIR insteadof prefix
+  if ( -f 'Makefile.am' ) {
+    # If it is a library then install into tmp
+    if ( $package_type eq "l") {
+      $INSTALL="\$(MAKE) install DESTDIR=\$(CURDIR)/debian/tmp";
+    } else {
+      $INSTALL="\$(MAKE) install DESTDIR=\$(CURDIR)/debian/$package_name";
+    }
+  } else {
+    if ( $package_type eq "l") {
+      $INSTALL="\$(MAKE) install prefix=\$(CURDIR)/debian/tmp/usr";
+    } else {
+      $INSTALL="\$(MAKE) install prefix=\$(CURDIR)/debian/$package_name/usr";
+    }
+  }
+  $CLEAN="\$(MAKE) distclean\n".
+         "ifneq \"\$(wildcard /usr/share/misc/config.sub)\" \"\"\n".
+                "\tcp -f /usr/share/misc/config.sub config.sub\n".
+                "endif\n".
+                "ifneq \"\$(wildcard /usr/share/misc/config.guess)\" \"\"\n".
+                "\tcp -f /usr/share/misc/config.guess config.guess\n".
+                "endif\n";
+} else {
+  if (! -f 'Makefile' && ! -f 'makefile' && ! -f 'GNUmakefile')
+  {
+    print "Currently there is no top level Makefile. This may require additional tuning.\n";
+  }
+  $CONFIGURE_STAMP='configure-stamp';
+  $CONFIG_STATUS='';
+  $CONFIGURE="configure: configure-stamp\n".
+             "configure-stamp:\n". 
+                        "\tdh_testdir\n".
+                        "\t# Add here commands to configure the package.\n\n".
+                        "\ttouch configure-stamp\n";
+  $PHONY_CONFIGURE='configure';
+  $DPKG_ARCH='';
+  if ($package_type eq "l") {
+    $INSTALL="\$(MAKE) install DESTDIR=\$(CURDIR)/debian/tmp";
+  } else {
+    $INSTALL="\$(MAKE) install DESTDIR=\$(CURDIR)/debian/$package_name";
+  }
+  $CLEAN='$(MAKE) clean';
+}
+
+# Customize files
+if ( $add_missing )
+{
+  if ( ! -d 'debian' )
+  {
+    die "--addmissing  or --overlay flag used but cannot find debian subdirectory\n";
+  }
+} else {
+  if ( ! -d 'debian')
+  {
+    mkdir 'debian', 0755 or die "Unable to make debian subdirectory: $! \n";
+  } else {
+    print "You already have a debian/ subdirectory in the source tree.\n";
+    print "dh_make will not try to overwrite anything.\n";
+    exit 1;
+  }
+}
+chdir 'debian' or die "Unable to chdir to debian subdirectory: $! \n";
+
+if ( ! -d $DHLIB )
+{
+die "Unable to find dh_make's template directory: $! \n";
+}
+
+if ( ! $no_defaults )
+{
+  # General Files
+  @filenames= split / |\n/, `(cd $DHLIB/debian && ls)`;
+  foreach $filename (@filenames)
+  {
+    process_file("$DHLIB/debian/$filename", $filename);
+  }
+
+  # Copyright file
+  if ($license eq '') 
+  {
+    process_file("$DHLIB/licenses/blank", copyright);
+  } else {
+    if ( -r "$DHLIB/licenses/$license" )
+    {
+      process_file("$DHLIB/licenses/$license", copyright);
+    } else {
+      die "Unable to find copyright template file $DHLIB/licenses/$license";
+    }
+  }
+
+  # Special Files
+  @filenames = split / |\n/, `(cd $DHLIB/debian$package_type && ls)`;
+  foreach $filename (@filenames)
+  {
+    process_file("$DHLIB/debian$package_type/$filename", $filename);
+  }
+}
+
+# Custom template
+if ( $custom ne "" )
+{
+  if ( -d $custom )
+  {
+    @filenames = split /[\n]/, `(cd $custom && ls)`;
+    foreach $filename (@filenames)
+    {
+      process_file("$custom/$filename", $filename);
+    }
+  } else {
+    print "Unable to find the customization directory, $custom\n";
+  }
+}
+
+
+if ( -f "docs" )
+{
+  print "File docs already exists, skipping.\n";
+} else {
+  open (DOCSFILE,">docs");
+  foreach $doc (@DOCS)
+  {
+    print DOCSFILE "$doc\n";
+  }
+  close (DOCSFILE);
+}
+
+if ( -f "info" )
+{
+  print "File info already exists, skipping.\n";
+} else {
+  if ($#INFOS > -1 )
+  {
+    open (INFOFILE,">info");
+    foreach $info (@INFOS)
+    {
+      $info =~ s/^\.\///;
+      print INFOFILE "$info\n";
+    }
+    close (INFOFILE);
+  }
+}
+
+if ( ! $no_defaults )
+{
+  if ($debian_native)
+  {
+  @filenames= split / |\n/, `(cd $DHLIB/native;ls)`;
+  foreach $filename (@filenames)
+  {
+      process_file("$DHLIB/native/$filename", $filename);
+    }
+  }
+}
+
+@filenames = split / |\n/, `ls package* 2>/dev/null`;
+if ($#filenames != -1)
+{
+  foreach $filename (@filenames)
+  {
+    my $oldname = $filename;
+    $filename =~ s/^package/$package_name/;
+    if ( -f $filename)
+    {
+      print "File $filename already exists, skipping.\n";
+    } else {
+      system('mv', $oldname, $filename);
+    }
+  }
+}
+chmod 0755, 'rules';
+
+if ($CONFIG_STATUS ne "")
+{
+  print "Done. Please edit the files in the debian/ subdirectory now. $package_name\n";
+  print "uses a configure script, so you probably don't have to edit the Makefiles.\n";
+} else {
+  print "Done. Please edit the files in the debian/ subdirectory now. You should also\n";
+  print "check that the $package_name Makefiles install into \$DESTDIR and not in / .\n";
+}
+if ($package_type eq 'l')
+{
+  print "Make sure you change the package name from $package_name"."BROKEN to something\n".
+        "else, such as $package_name"."1 in the debian/control file.\n";
+}
+
+exit 0;
diff --git a/dict.cache b/dict.cache
new file mode 100644 (file)
index 0000000..7b773ce
Binary files /dev/null and b/dict.cache differ
diff --git a/dict.xdxf b/dict.xdxf
new file mode 100644 (file)
index 0000000..42da45e
--- /dev/null
+++ b/dict.xdxf
@@ -0,0 +1,1210 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<!DOCTYPE xdxf SYSTEM "http://xdxf.sourceforge.net/xdxf_lousy.dtd">
+<xdxf lang_from="ENG" lang_to="ENG" format="visual">
+<full_name>Elements database 20001107</full_name>
+<description>00-database-info
+This file was converted from the original database on:
+          Mon Jan 29 05:15:08 2001
+
+
+The original data is available from:
+     http://ucsub.colorado.edu/~kominek/elements/
+
+The original data was distributed with the notice shown below.  No
+additional restrictions are claimed.  Please redistribute this
+changed version under the same conditions and restriction that
+apply to the original version.
+
+   Elements database 20001107
+   This dictionary database was created by Jay F. Kominek
+   &lt;jay.kominek@colorado.edu&gt; (Feel free to send any comments, additions,
+   corrections, money to that address) It was compiled from a variety of
+   sources, and is in my opinion, a work of my own. (The only stuff that
+   was really copied verbatim was the atomic numbers and weights, please,
+   I'd like to see someone try and exert a copyright on the values of atoms.)
+   So, I place this in the public domain, if it somehow breaks, you get to
+   keep both pieces. It'd be nice if you kept the fact that I compiled the
+   information in here, but is not needed.
+   Up to date copies can probably be found on the web at:
+   http://ucsub.colorado.edu/~kominek/elements/
+Source url: http://ucsub.colorado.edu/~kominek/elements/</description>
+<ar><k>actinium</k>
+actinium
+Symbol: Ac
+Atomic number: 89
+Atomic weight: (227)
+Silvery radioactive metallic element, belongs to group 3 of the periodic
+table. The most stable isotope, Ac-227, has a half-life of 217 years.
+Ac-228 (half-life of 6.13 hours) also occurs in nature. There are 22 other
+artificial isotopes, all radioactive and having very short half-lives.
+Chemistry similar to lanthanum. Used as a source of alpha particles.
+Discovered by A. Debierne in 1899.</ar>
+<ar><k>aluminum</k>
+aluminum
+Symbol: Al
+Atomic number: 13
+Atomic weight: 26.9815
+Silvery-white lustrous metallic element of group 3 of the periodic table.
+Highly reactive but protected by a thin transparent layer of the oxide
+which quickly forms in air. There are many alloys of aluminum, as well as
+a good number of industrial uses. Makes up 8.1% of the Earth's crust, by
+weight. Isolated in 1825 by H.C. Oersted.</ar>
+<ar><k>americium</k>
+americium
+Symbol: Am
+Atomic number: 95
+Atomic weight: (243)
+Radioactive metallic transuranic element, belongs to the actinoids. Ten
+known isotopes. Am-243 is the most stable isotope, with a half-life of
+7.95*10^3 years. Discovered by Glenn T. Seaborg and associates in 1945, it
+was obtained by bombarding {uranium}-238 with alpha particles.</ar>
+<ar><k>antimony</k>
+antimony
+Symbol: Sb
+Atomic number: 51
+Atomic weight: 121.75
+Element of group 15. Multiple allotropic forms. The stable form of
+antimony is a blue-white metal. Yellow and black antimony are unstable
+non-metals. Used in flame-proofing, paints, ceramics, enamels, and rubber.
+Attacked by oxidizing acids and halogens. First reported by Tholden in
+1450.</ar>
+<ar><k>argon</k>
+argon
+Symbol: Ar
+Atomic number: 18
+Atomic weight: 39.948
+Monatomic noble gas. Makes up 0.93% of the air. Colourless, odorless. Is
+inert and has no true compounds. Lord Rayleigh and Sir william Ramsey
+identified argon in 1894.</ar>
+<ar><k>arsenic</k>
+arsenic
+Symbol: As
+Atomic number: 33
+Atomic weight: 74.922
+Metalloid element of group 15. There are three allotropes, yellow, black,
+and grey. Reacts with halogens, concentrated oxidizing acids and hot
+alkalis. Albertus Magnus is believed to have been the first to isolate the
+element in 1250.</ar>
+<ar><k>astatine</k>
+astatine
+Symbol: At
+Atomic number: 85
+Atomic weight: (210)
+Radioactive halogen element. Occurs naturally from uranium and thorium
+decay. At least 20 known isotopes. At-210, the most stable, has a
+half-life of 8.3 hours. Synthesized by nuclear bombardment in 1940 by D.R.
+Corson, K.R. MacKenzie and E. Segre at the University of California.</ar>
+<ar><k>barium</k>
+barium
+Symbol: Ba
+Atomic number: 56
+Atomic weight: 137.34
+Silvery-white reactive element, belonging to group 2 of the periodic
+table. Soluble barium compounds are extremely poisonous. Identified in
+1774 by Karl Scheele and extracted in 1808 by Humphry Davy.</ar>
+<ar><k>berkelium</k>
+berkelium
+Symbol: Bk
+Atomic number: 97
+Atomic weight: (247)
+Radioactive metallic transuranic element. Belongs to actinoid series.
+Eight known isotopes, the most common Bk-247, has a half-life of
+1.4*10^3 years. First produced by Glenn T. Seaborg and associates in 1949
+by bombarding americium-241 with alpha particles.</ar>
+<ar><k>beryllium</k>
+beryllium
+Symbol: Be
+Atomic number: 4
+Atomic weight: 9.0122
+Grey metallic element of group 2 of the periodic table. Is toxic and can
+cause severe lung diseases and dermatitis. Shows high covalent character.
+It was isolated independently by F. Wohler and A.A. Bussy in 1828.</ar>
+<ar><k>bismuth</k>
+bismuth
+Symbol: Bi
+Atomic number: 83
+Atomic weight: 208.980
+White crystalline metal with a pink tinge, belongs to group 15. Most
+diamagnetic of all metals and has the lowest thermal conductivity of all
+the elements except mercury. Lead-free bismuth compounds are used in
+cosmetics and medical procedures. Burns in the air and produces a blue
+flame. In 1753, C.G. Junine first demonstrated that it was different from
+lead.</ar>
+<ar><k>bohrium</k>
+bohrium
+Competing name for {unnilseptium}, the 107th element, proposed by the
+IUPAC in response to the discoverers of the element wanting to name it
+{nielsbohrium}.</ar>
+<ar><k>boron</k>
+boron
+Symbol: B
+Atomic number: 5
+Atomic weight: 10.811
+An element of group 13 of the periodic table. There are two allotropes,
+amorphous boron is a brown power, but metallic boron is black. The
+metallic form is hard (9.3 on Mohs' scale) and a bad conductor in room
+temperatures. It is never found free in nature. Boron-10 is used in
+nuclear reactor control rods and shields. It was discovered in 1808 by Sir
+Humphry Davy and by J.L. Gay-Lussac and L.J. Thenard.</ar>
+<ar><k>bromine</k>
+bromine
+Symbol: Br
+Atomic number: 35
+Atomic weight: 79.909
+Halogen element. Red volatile liquid at room temperature. Its reactivity
+is somewhere between chlorine and iodine. Harmful to human tissue in a
+liquid state, the vapour irritates eyes and throat. Discovered in 1826 by
+Antoine Balard.</ar>
+<ar><k>cadmium</k>
+cadmium
+Symbol: Cd
+Atomic number: 48
+Atomic weight: 112.40
+Soft bluish metal belonging to group 12 of the periodic table. Extremely
+toxic even in low concentrations. Chemically similar to zinc, but lends
+itself to more complex compounds. Discovered in 1817 by F. Stromeyer.</ar>
+<ar><k>caesium</k>
+caesium
+Symbol: Cs
+Atomic number: 55
+Atomic weight: 132.90545
+Soft silvery-white metallic element belonging to group 1 of the periodic
+table. One of the three metals which are liquid at room temperature. Cs-133
+is the natural, and only stable, isotope. Fifteen other radioisotopes exist.
+Caesium reacts explosively with cold water, and ice at temperatures above
+157K. Caesium hydroxide is the strongest base known. Caesium is the most
+electropositive, most alkaline and has the least ionization potential of
+all the elements. Known uses include the basis of atomic clocks, catalyst
+for the hydrogenation of some organic compounds, and in photoelectric cells.
+Caesium was discovered by Gustav Kirchoff and Robert Bunsen in Germany in
+1860 spectroscopically. Its identification was based upon the bright blue
+lines in its spectrum. The name comes from the latin word caesius, which
+means sky blue. Caesium should be considered highly toxic. Some of the
+radioisotopes are even more toxic.</ar>
+<ar><k>calcium</k>
+calcium
+Symbol: Ca
+Atomic number: 20
+Atomic weight: 40.08
+Soft grey metallic element belonging to group 2 of the periodic table.
+Used a reducing agent in the extraction of thorium, zirconium and
+uranium. Essential element for living organisms.</ar>
+<ar><k>californium</k>
+californium
+Symbol: Cf
+Atomic number: 98
+Atomic weight: (249)
+Radioactive metallic transuranic element. Belongs to actinoid series.
+Cf-251 has a half life of about 700 years. Nine isotopes are known.
+Cf-252 is an intense {neutron} source, which makes it an intense
+{neutron} source and gives it a use in {neutron} activation analysis
+and a possible use as a radiation source in medicine. First produced
+by Glenn T. Seaborg and associates in 1950.</ar>
+<ar><k>carbon</k>
+carbon
+Symbol: C
+Atomic number: 6
+Atomic weight: 12.01115
+Carbon is a member of group 14 of the periodic table. It has three
+allotropic forms of it, diamonds, graphite and fullerite. Carbon-14
+is commonly used in radioactive dating. Carbon occurs in all organic life
+and is the basis of organic chemistry. Carbon has the interesting chemical
+property of being able to bond with itself, and a wide variety of other
+elements.</ar>
+<ar><k>cerium</k>
+cerium
+Symbol: Ce
+Atomic number: 58
+Atomic weight: 140.12
+Silvery metallic element, belongs to the lanthanoids. Four natural
+isotopes exist, and fifteen radioactive isotopes have been identified.
+Used in some rare-earth alloys. The oxidized form is used in the glass
+industry. Discovered by Martin .H. Klaproth in 1803.</ar>
+<ar><k>chlorine</k>
+chlorine
+Symbol: Cl
+Atomic number: 17
+Atomic weight: 35.453
+Halogen element. Poisonous greenish-yellow gas. Occurs widely in nature as
+sodium chloride in seawater. Reacts directly with many elements and
+compounds, strong oxidizing agent. Discovered by Karl Scheele in 1774.
+Humphrey David confirmed it as an element in 1810.</ar>
+<ar><k>chromium</k>
+chromium
+Symbol: Cr
+Atomic number: 24
+Atomic weight: 51.996
+Hard silvery transition element. Used in decorative electroplating.
+Discovered in 1797 by Vauquelin.</ar>
+<ar><k>cobalt</k>
+cobalt
+Symbol: Co
+Atomic number: 27
+Atomic weight: 58.993
+Light grey transition element. Some meteorites contain small amounts of
+metallic cobalt. Generally alloyed for use. Mammals require small amounts
+of cobalt salts. Cobalt-60, an artificially produced radioactive isotope
+of Cobalt is an important radioactive tracer and cancer-treatment agent.
+Discovered by G. Brandt in 1737.</ar>
+<ar><k>columbium</k>
+columbium
+The original name for {niobium}.</ar>
+<ar><k>copper</k>
+copper
+Symbol: Cu
+Atomic number: 29
+Atomic weight: 63.54
+Red-brown transition element. Known by the Romans as 'cuprum.' Extracted
+and used for thousands of years. Malleable, ductile and an excellent
+conductor of heat and electricity. When in moist conditions, a greenish
+layer forms on the outside.</ar>
+<ar><k>cuprum</k>
+cuprum
+Roman name for {copper}.</ar>
+<ar><k>curium</k>
+curium
+Symbol: Cm
+Atomic number: 96
+Atomic weight: (247)
+Radioactive metallic transuranic element. Belongs to actinoid series.
+Nine known isotopes, Cm-247 has a half-life of 1.64*10^7 years. First
+identified by Glenn T. Seaborg and associates in 1944, first produced by
+L.B. Werner and I. Perlman in 1947 by bombarding americium-241 with
+{neutron}s. Named for Marie Curie.</ar>
+<ar><k>deuterium</k>
+deuterium
+Symbol: D
+Atomic Weight: 2
+A {hydrogen} atom which has but one proton and {neutron}. Deuterium makes up
+about 0.015% of all natural hydrogen. Chemical properties are like that of
+normal {hydrogen}, though somewhat slower.</ar>
+<ar><k>dubnium</k>
+dubnium
+Symbol: Db
+Competing name for {unnilquadium}, the 104th element, proposed by the
+IUPAC.</ar>
+<ar><k>dysprosium</k>
+dysprosium
+Symbol: Dy
+Atomic number: 66
+Atomic weight: 162.50
+Metallic with a bright silvery-white lustre. Dysprosium belongs to the
+lanthanoids. It is relatively stable in air at room temperatures, it will
+however dissolve in mineral acids, evolving hydrogen. It is found in
+from rare-earth minerals. There are seven natural isotopes of dysprosium,
+and eight radioisotopes, Dy-154 being the most stable with a half-life of
+3*10^6 years. Dysprosium is used as a neutron absorber in nuclear fission
+reactions, and in compact disks. It was discovered by Paul Emile Lecoq de
+Boisbaudran in 1886 in France. Its name comes from the Greek word
+dysprositos, which means hard to obtain.</ar>
+<ar><k>einsteinium</k>
+einsteinium
+Symbol: Es
+Atomic number: 99
+Atomic weight: (254)
+Appearance is unknown, however it is most probably metallic and silver
+or gray in color. Radioactive metallic transuranic element belonging to the
+actinoids. Es-254 has the longest half-life of the eleven known isotopes at
+270 days. First identified by Albert Ghiorso and associates in the debris of
+the 1952 hydrogen bomb explosion. In 1961 the first microgram quantities of
+Es-232 were separated. While einsteinium never exists naturally, if a
+sufficient amount was assembled, it would pose a radiation hazard.</ar>
+<ar><k>erbium</k>
+erbium
+Symbol: Er
+Atomic number: 68
+Atomic weight: 167.26
+Soft silvery metallic element which belongs to the lanthanoids. Six
+natural isotopes that are stable. Twelve artificial isotopes are known.
+Used in nuclear technology as a neutron absorber. It is being investigated
+for other possible uses. Discovered by Carl G. Mosander in 1843.</ar>
+<ar><k>europium</k>
+europium
+Symbol: Eu
+Atomic number: 63
+Atomic weight: 151.25
+Soft silvery metallic element belonging to the lanthanoids. Eu-151 and
+Eu-153 are the only two stable isotopes, both of which are {neutron}
+absorbers. Discovered in 1889 by Sir William Crookes.</ar>
+<ar><k>fermium</k>
+fermium
+Symbol: Fm
+Atomic number: 100
+Atomic weight: (253)
+Radioactive metallic transuranic element, belongs to the actinoids. Ten
+known isotopes, most stable is Fm-257 with a half-life of 10 days. First
+identified by Albert Ghiorso and associates in the debris of the first
+hydrogen-bomb explosion in 1952.</ar>
+<ar><k>fluorine</k>
+fluorine
+Symbol: F
+Atomic number: 9
+Atomic weight: 18.9984
+A poisonous pale yellow gaseous element belonging to group 17 of the
+periodic table (The halogens). It is the most chemically reactive and
+electronegative element. It is highly dangerous, causing severe chemical
+burns on contact with flesh. Fluorine was identified by Scheele in 1771
+and first isolated by Moissan in 1886.</ar>
+<ar><k>francium</k>
+francium
+Symbol: Fr
+Atomic number: 87
+Atomic weight: (223)
+Radioactive element, belongs to group 1 of the periodic table. Found in
+uranium and thorium ores. The 22 known isotopes are all radioactive, with
+the most stable being Fr-223. Its existence was confirmed in 1939 by
+Marguerite Perey.</ar>
+<ar><k>gadolinium</k>
+gadolinium
+Symbol: Gd
+Atomic number: 64
+Atomic weight: 157.25
+Soft silvery metallic element belonging to the lanthanoids. Seven natural,
+stable isotopes are known in addition to eleven artificial isotopes.
+Gd-155 and Gd-157 and the best neutron absorbers of all elements.
+Gadolinium compounds are used in electronics. Discovered by J.C.G Marignac
+in 1880.</ar>
+<ar><k>gallium</k>
+gallium
+Symbol: Ga
+Atomic number: 31
+Atomic weight: 69.72
+Soft silvery metallic element, belongs to group 13 of the periodic table.
+The two stable isotopes are Ga-69 and Ga-71. Eight radioactive isotopes
+are known, all having short half-lives. Gallium Arsenide is used as a
+semiconductor. Corrodes most other metals by diffusing into their lattice.
+First identified by Francois Lecoq de Boisbaudran in 1875.</ar>
+<ar><k>germanium</k>
+germanium
+Symbol: Ge
+Atomic number: 32
+Atomic weight: 72.59
+Lustrous hard metalloid element, belongs to group 14 of the periodic
+table. Forms a large number of organometallic compounds. Predicted by
+Mendeleev in 1871, it was actually found in 1886 by Winkler.</ar>
+<ar><k>gold</k>
+gold
+Symbol: Au
+Atomic number: 79
+Atomic weight: 196.96655
+Gold is gold colored. It is the most malleable and ductile metal known.
+There is only one stable isotope of gold, and five radioisotopes of gold,
+Au-195 being the most stable with a half-life of 186 days. Gold is used
+as a monetary standard, in jewelry, dentistry, electronics. Au-198 is used
+in treating cancer and some other medical conditions. Gold has been known
+to exist as far back as 2600 BC. Gold comes from the Anglo-Saxon word gold.
+Its symbol, Au, comes from the Latin word aurum, which means gold. Gold is
+not particularly toxic, however it is known to cause damage to the liver
+and kidneys in some.</ar>
+<ar><k>hafnium</k>
+hafnium
+Symbol: Hf
+Atomic number: 72
+Atomic weight: 178.49
+Silvery lustrous metallic transition element. Used in tungsten alloys in
+filaments and electrodes, also acts as a neutron absorber. First reported
+by Urbain in 1911, existence was finally established in 1923 by D. Coster,
+G.C. de Hevesy in 1923.</ar>
+<ar><k>hahnium</k>
+hahnium
+Symbol: Ha
+Competing name for {unnilpentium}, the 105th element, proposed by the
+American Chemical Society. Also a competing name for {unniloctium}, the
+108th element, proposed by the IUPAC. Both were chosen in honor of German
+researcher, Otto Hahn.</ar>
+<ar><k>hassium</k>
+hassium
+Competing name for {unniloctium}, the 108th element, proposed by its
+German discoverers and supported by the American Chemical Society.</ar>
+<ar><k>helium</k>
+helium
+Symbol: He
+Atomic number: 2
+Atomic weight: 4.0026
+Colourless, odourless gaseous nonmetallic element. Belongs to group 18 of
+the periodic table. Lowest boiling point of all elements and can only be
+solidified under pressure. Chemically inert, no known compounds.
+Discovered in the solar spectrum in 1868 by Lockyer.</ar>
+<ar><k>holmium</k>
+holmium
+Symbol: Ho
+Atomic number: 67
+Atomic weight: 167.26
+Relatively soft and malleable silvery-white metallic element, which is stable
+in dry air at room temperature. It oxidizes in moist air and at high
+temperatures. It belongs to the lanthanoids. A rare-earth metal, it is found
+in the minerals monazite and gadolinite. It possesses unusual magnetic
+properties. One natural isotope, Ho-165 exists, six radioisotopes exist, the
+most stable being Ho-163 with a half-life of 4570 years. Holmium is used in
+some metal alloys, it is also said to stimulate the metabolism. Discovered by
+Per Theodor Cleve and J.L. Soret in Switzerland in 1879. The name homium comes
+from the Greek word Holmia which means Sweden. While all holmium compounds
+should be considered highly toxic, initial evidence seems to indicate that
+they do not pose much danger. The metal's dust however, is a fire hazard.</ar>
+<ar><k>hydrogen</k>
+hydrogen
+Symbol: H
+Atomic number: 1
+Atomic weight: 1.0079
+Colourless, odourless gaseous chemical element. Lightest and most
+abundant element in the universe. Present in water and in all organic
+compounds. Chemically reacts with most elements. Discovered by Henry
+Cavendish in 1776.</ar>
+<ar><k>indium</k>
+indium
+Symbol: In
+Atomic number: 49
+Atomic weight: 114.82
+Soft silvery element belonging to group 13 of the periodic table. The most
+common natural isotope is In-115, which has a half-life of 6*10^4 years.
+Five other radioisotopes exist. Discovered in 1863 by Reich and Richter.</ar>
+<ar><k>iodine</k>
+iodine
+Symbol: I
+Atomic number: 53
+Atomic weight: 126.904
+Dark violet nonmetallic element, belongs to group 17 of the periodic
+table. Insoluble in water. Required as a trace element for living
+organisms. One stable isotope, I-127 exists, in addition to fourteen
+radioactive isotopes. Chemically the least reactive of the halogens, and
+the most electropositive metallic halogen. Discovered in 1812 by Courtois.</ar>
+<ar><k>iridium</k>
+iridium
+Symbol: Ir
+Atomic number: 77
+Atomic weight: 192.217
+Very hard and brittle, silvery metallic transition element. It has a
+yellowish cast to it. Salts of iridium are highly colored. It is the
+most corrosion resistant metal known, not attacked by any acid, but is
+attacked by molten salts. There are two natural isotopes of iridium, and
+4 radioisotopes, the most stable being Ir-192 with a half-life of 73.83
+days. Ir-192 decays into {platinum}, while the other radioisotopes decay
+into {osmium}. Iridium is used in high temperature apparatus, electrical
+contacts, and as a hardening agent for platinum. Discovered in 1803 by
+Smithson Tennant in England. The name comes from the Greek word iris, which
+means rainbow. Iridium metal is generally non-toxic due to its relative
+unreactivity, but iridium compounds should be considered highly toxic.</ar>
+<ar><k>iron</k>
+iron
+Symbol: Fe
+Atomic number: 26
+Atomic weight: 55.847
+Silvery malleable and ductile metallic transition element. Has nine
+isotopes and is the fourth most abundant element in the earth's crust.
+Required by living organisms as a trace element (used in hemoglobin in
+humans.) Quite reactive, oxidizes in moist air, displaces hydrogen from
+dilute acids and combines with nonmetallic elements.</ar>
+<ar><k>IUPAC</k>
+IUPAC
+The International Union of Pure and Applied Chemistry.</ar>
+<ar><k>joliotium</k>
+joliotium
+Symbol: Jl
+Competing name for {unnilpentium}, the 105th element, proposed by the
+IUPAC.</ar>
+<ar><k>krypton</k>
+krypton
+Symbol: Kr
+Atomic number: 36
+Atomic weight: 83.80
+Colorless gaseous element, belongs to the noble gases. Occurs in the air,
+0.0001% by volume. It can be extracted from liquid air by fractional
+distillation. Generally not isolated, but used with other inert gases in
+fluorescent lamps. Five natural isotopes, and five radioactive isotopes.
+Kr-85, the most stable radioactive isotope, has a half-life of 10.76
+years and is produced in fission reactors. Practically inert, though known
+to form compounds with {fluorine}.</ar>
+<ar><k>kurchatovium</k>
+kurchatovium
+Symbol: Ku
+Competing name for {unnilquadium}, the 104th element, proposed by Russian
+scientists.</ar>
+<ar><k>lanthanum</k>
+lanthanum
+Symbol: La
+Atomic number: 57
+Atomic weight: 138.9055
+(From the Greek word lanthanein, to line hidden) Silvery metallic element
+belonging to group 3 of the periodic table and oft considered to be one of
+the lanthanoids. Found in some rare-earth minerals. Twenty-five natural
+isotopes exist. La-139 which is stable, and La-138 which has a half-life
+of 10^10 to 10^15 years. The other twenty-three isotopes are radioactive.
+It resembles the lanthanoids chemically. Lanthanum has a low to moderate
+level of toxicity, and should be handled with care. Discovered in 1839 by
+C.G. Mosander.</ar>
+<ar><k>lawrencium</k>
+lawrencium
+Symbol: Lr
+Atomic number: 103
+Atomic weight: (262)
+Appearance unknown, however it is most likely silvery-white or grey
+and metallic. Lawrencium is a synthetic rare-earth metal. There are
+eight known radioisotopes, the most stable being Lr-262 with a half-life
+of 3.6 hours. Due to the short half-life of lawrencium, and its
+radioactivity, there are no known uses for it. Identified by Albert Ghiorso
+in 1961 at Berkeley. It was produced by bombarding californium with boron
+ions. The name is temporary {IUPAC} nomenclature, the origin of the name
+comes from Ernest O. Lawrence, the inventor of the cyclotron. If sufficient
+amounts of lawrencium were produced, it would pose a radiation hazard.</ar>
+<ar><k>lead</k>
+lead
+Symbol: Pb
+Atomic number: 82
+Atomic weight: 207.19
+Heavy dull grey ductile metallic element, belongs to group 14. Used in
+building construction, lead-place accumulators, bullets and shot, and is
+part of solder, pewter, bearing metals, type metals and fusible alloys.</ar>
+<ar><k>lithium</k>
+lithium
+Symbol: Li
+Atomic number: 3
+Atomic weight: 6.939
+Socket silvery metal. First member of group 1 of the periodic table.
+Lithium salts are used in psychomedicine.</ar>
+<ar><k>lutetium</k>
+lutetium
+Symbol: Lu
+Atomic number: 71
+Atomic weight: 194.967
+Silvery-white rare-earth metal which is relatively stable in air. It
+happens to be the most expensive rare-earth metal. Its found with almost
+all rare-earth metals, but is very difficult to separate from other
+elements. Least abundant of all natural elements. Used in metal alloys,
+and as a catalyst in various processes. There are two natural, stable
+isotopes, and seven radioisotopes, the most stable being Lu-174 with a
+half-life of 3.3 years. The separation of lutetium from {ytterbium} was
+described by Georges Urbain in 1907. It was discovered at approximately
+the same time by Carl Auer von Welsbach. The name comes from the Greek
+word lutetia which means Paris.</ar>
+<ar><k>magnesium</k>
+magnesium
+Symbol: Mg
+Atomic number: 12
+Atomic weight: 24.312
+Silvery metallic element belonging to group 2 of the periodic table
+(alkaline-earth metals). It is essential for living organisms, and is used
+in a number of light alloys. Chemically very reactive, it forms a
+protective oxide coating when exposed to air and burns with an intense
+white flame. It also reacts with sulphur, nitrogen and the halogens. First
+isolated by Bussy in 1828.</ar>
+<ar><k>manganese</k>
+manganese
+Symbol: Mn
+Atomic number: 25
+Atomic weight: 54.938
+Grey brittle metallic transition element. Rather electropositive, combines
+with some non-metals when heated. Discovered in 1774 by Scheele.</ar>
+<ar><k>meitnerium</k>
+meitnerium
+Symbol: Mt
+Atomic number: 109
+Atomic weight: (266)
+Half-life of approximately 5ms. The creation of this element demonstrated
+that fusion techniques could indeed be used to make new, heavy nuclei.
+Made and identified by physicists of the Heavy Ion Research Laboratory,
+Darmstadt, West Germany in 1982. Named in honor of Lise Meitner the
+Austrian physicist.</ar>
+<ar><k>mendelevium</k>
+mendelevium
+Symbol: Md
+Atomic number: 101
+Atomic weight: (256)
+Radioactive metallic transuranic element. Belongs to the actinoid series.
+Only known isotope, Md-256 has a half-life of 1.3 hours. First identified
+by Glenn T. Seaborg, Albert Ghiorso and associates in 1955. Alternative
+name {unnilunium} has been proposed. Named after the 'inventor' of the
+periodic table, Dmitri Mendeleev.</ar>
+<ar><k>mercury</k>
+mercury
+Symbol: Hg
+Atomic number: 80
+Atomic weight: 200.59
+Heavy silvery liquid metallic element, belongs to the zinc group. Used in
+thermometers, barometers and other scientific apparatus. Less reactive
+than zinc and cadmium, does not displace hydrogen from acids. Forms a
+number of complexes and organomercury compounds.</ar>
+<ar><k>molybdenum</k>
+molybdenum
+Symbol: Mo
+Atomic number: 42
+Atomic weight: 95.94
+Silvery-white, hard metallic transition element. It is chemically
+unreactive and is not affected by most acids. It oxidizes at high
+temperatures. There are seven natural isotopes, and four radioisotopes,
+Mo-93 being the most stable with a half-life of 3500 years. Molybdenum
+is used in almost all high-strength steels, it has nuclear applications,
+and is a catalyst in petroleum refining. Discovered in 1778 by Carl
+Welhelm Scheele of Sweden. Impure metal was prepared in 1782 by Peter
+Jacob Hjelm. The name comes from the Greek word molybdos which means lead.
+Trace amounts of molybdenum are required for all known forms of life.
+All molybdenum compounds should be considered highly toxic, and will
+also cause severe birth defects.</ar>
+<ar><k>neodymium</k>
+neodymium
+Symbol: Nd
+Atomic number: 60
+Atomic weight: 144.24
+Soft bright silvery metallic element, belongs to the lanthanoids. Seven natural
+isotopes, Nd-144 being the only radioactive one with a half-life of 10^10
+to 10^15 years. Six artificial radioisotopes have been produced. The
+metal is used in glass works to color class a shade of violet-purple and
+make it dichroic. One of the more reactive rare-earth metals, quickly reacts
+with air. Used in some rare-earth alloys. Neodymium is used to color
+the glass used in welder's glasses. Neodymium is also used in very
+powerful, permanent magnets (Nd2Fe14B). Discovered by Carl F. Auer von
+Welsbach in Austria in 1885 by separating didymium into its elemental
+components {praseodymium} and neodymium. The name comes from the Greek words
+&quot;neos didymos&quot; which means &quot;new twin&quot;. Neodymium should be considered
+highly toxic, however evidence would seem to show that it acts as little
+more than a skin and eye irritant. The dust however, presents a fire and
+explosion hazard.</ar>
+<ar><k>neon</k>
+neon
+Symbol: Ne
+Atomic number: 10
+Atomic weight: 20.183
+Colourless gaseous element of group 18 on the periodic table (noble
+gases). Neon occurs in the atmosphere, and comprises 0.0018% of the volume
+of the atmosphere. It has a distinct reddish glow when used in discharge
+tubes and neon based lamps. It forms almost no chemical compounds. Neon
+was discovered in 1898 by Sir William Ramsey and M.W. Travers.</ar>
+<ar><k>neptunium</k>
+neptunium
+Symbol: Np
+Atomic number: 93
+Atomic weight: (237)
+Radioactive metallic transuranic element, belongs to the actinoids.
+Np-237, the most stable isotope, has a half-life of 2.2*10^6 years and is
+a by product of nuclear reactors. The other known isotopes have mass
+numbers 229 through 236, and 238 through 241. Np-236 has a half-life of
+5*10^3 years. First produced by Edwin M. McMillan and P.H. Abelson in
+1940.</ar>
+<ar><k>neutron</k>
+neutron
+Weight: 1.6749286*10^-27kg
+A neutral hadron that is stable in the atomic nucleus but decays into a
+protron, an electron and an antineutrino with a mean life of 12 minutes
+outside the nucleus. Neutrons exist in all atomic nuclei except normal
+hydrogen. Reported in 1932 by James Chadwick.</ar>
+<ar><k>nickel</k>
+nickel
+Symbol: Ni
+Atomic number: 28
+Atomic weight: 58.71
+Malleable ductile silvery metallic transition element. Discovered by A.F.
+Cronstedt in 1751.</ar>
+<ar><k>nielsbohrium</k>
+nielsbohrium
+Competing name for {unnilseptium}, the 107th element, proposed by its West
+German discoverers and supported by the American Chemical Society. The
+name was chosen in honor of physicist, Niels Bohr.</ar>
+<ar><k>niobium</k>
+niobium
+Symbol: Nb
+Atomic number: 41
+Atomic weight: 92.906
+Soft, ductile grey-blue metallic transition element. Used in special
+steels and in welded joints to increase strength. Combines with halogens
+and oxidizes in air at 200 degrees celsius. Discovered by Charles Hatchett
+in 1801 and isolated by Blomstrand in 1864. Called {columbium} originally.</ar>
+<ar><k>nitrogen</k>
+nitrogen
+Symbol: N
+Atomic number: 7
+Atomic weight: 14.0067
+Colourless, gaseous element which belongs to group 15 of the periodic
+table. Constitutes ~78% of the atmosphere and is an essential part of the
+ecosystem. Nitrogen for industrial purposes is acquired by the fractional
+distillation of liquid air. Chemically inactive, reactive generally only
+at high temperatures or in electrical discharges. It was discovered in
+1772 by D. Rutherford.</ar>
+<ar><k>nobelium</k>
+nobelium
+Symbol: No
+Atomic number: 102
+Atomic weight: (254)
+Radioactive metallic transuranic element, belongs to the actinoids. Seven
+known isotopes exist, the most stable being No-254 with a half-life of 255
+seconds. First identified with certainty by Albert Ghiorso and Glenn T.
+Seaborg in 1966. {Unnilbium} has been proposed as an alternative name.</ar>
+<ar><k>osmium</k>
+osmium
+Symbol: Os
+Atomic number: 76
+Atomic weight: 190.2
+Hard blue-white metallic transition element. Found with platinum and used
+in some alloys with platinum and iridium.</ar>
+<ar><k>oxygen</k>
+oxygen
+Symbol: O
+Atomic number: 8
+Atomic weight: 15.9994
+A colourless, odourless gaseous element belonging to group 16 of the
+periodic table. It is the most abundant element present in the earth's
+crust. It also makes up 20.8% of the Earth's atmosphere. For industrial
+purposes, it is separated from liquid air by fractional distillation. It
+is used in high temperature welding, and in breathing. It commonly comes
+in the form of Oxygen, but is found as Ozone in the upper atmosphere. It
+was discovered by Priestley in 1774.</ar>
+<ar><k>palladium</k>
+palladium
+Symbol: Pd
+Atomic number: 46
+Atomic weight: 106.4
+Soft white ductile transition element. Found with some copper and nickel
+ores. Does not react with oxygen at normal temperatures. Dissolves slowly
+in hydrochloric acid. Discovered in 1803 by W.H. Wollaston.</ar>
+<ar><k>phosphorus</k>
+phosphorus
+Symbol: P
+Atomic number: 15
+Atomic weight: 30.9738
+Non-metallic element belonging to group 15 of the periodic table. Has a
+multiple allotropic forms. Essential element for living organisms. It was
+discovered by Brandt in 1669.</ar>
+<ar><k>platinum</k>
+platinum
+Symbol: Pt
+Atomic number: 78
+Atomic weight: 195.078
+Attractive greyish-white metal. When pure, it is malleable and ductile.
+Does not oxidize in air, insoluble in hydrochloric and nitric acid.
+Corroded by halogens, cyandies, sulphur and alkalis. {Hydrogen} and
+{oxygen} react explosively in the presence of platinum. There are six
+stable isotopes and three radioisotopes, the most stable being Pt-193
+with a half-life of 60 years. Platinum is used in jewelry, laboratory
+equipment, electrical contacts, dentistry, and anti-pollution devices in
+cars. PtCl2(NH3)2 is used to treat some forms of cancer. Platinum-{cobalt}
+alloys have magnetic properties. It is also used in the definition of
+the Standard Hydrogen Electrode. Discovered by Antonio de Ulloa in South
+America in 1735. The name comes from the Spanish word platina which means
+silver. Platinum metal is generally not a health concern due to its
+unreactivity, however platinum compounds should be considered highly
+toxic.</ar>
+<ar><k>plutonium</k>
+plutonium
+Symbol: Pu
+Atomic number: 94
+Atomic weight: (242)
+Dense silvery radioactive metallic transuranic element, belongs to the
+actinoids. Pu-244 is the most stable isotope with a half-life of 7.6*10^7
+years. Thirteen isotopes are known. Pu-239 is the most important, it
+undergoes nuclear fission with slow neutrons and is hence important to
+nuclear weapons and reactors. Plutonium production is monitored down to
+the gram to prevent military misuse. First produced by Gleen T. Seaborg,
+Edwin M. McMillan, J.W. Kennedy and A.C. Wahl in 1940.</ar>
+<ar><k>polonium</k>
+polonium
+Symbol: Po
+Atomic number: 84
+Atomic weight: (210)
+Rare radioactive metallic element, belongs to group 16 of the periodic
+table. Over 30 known isotopes exist, the most of all elements. Po-209 has
+a half-life of 103 years. Possible uses in heating spacecraft. Discovered
+by Marie Curie in 1898 in a sample of pitchblende.</ar>
+<ar><k>potassium</k>
+potassium
+Symbol: K
+Atomic number: 19
+Atomic weight: 39.0983
+Soft silvery metallic element belonging to group 1 of the periodic table
+(alkali metals). Occurs naturally in seawater and a many minerals. Highly
+reactive, chemically, it resembles sodium in its behavior and compounds.
+Discovered by Sir Humphry Davy in 1807.</ar>
+<ar><k>praseodymium</k>
+praseodymium
+Symbol: Pr
+Atomic number: 59
+Atomic weight: 140.907
+Soft silvery metallic element, belongs to the lanthanoids. Only natural
+isotope is Pr-141 which is not radioactive.  Fourteen radioactive isotopes
+have been artificially produced. Used in rare-earth alloys. Discovered in
+1885 by C.A. von Welsbach.</ar>
+<ar><k>promethium</k>
+promethium
+Symbol: Pm
+Atomic number: 61
+Atomic weight: (147)
+Soft silvery metallic element, belongs to the lanthanoids. Pm-147, the
+only natural isotope, is radioactive and has a half-life of 252 years.
+Eighteen radioisotopes have been produced, but all have very short
+half-lives. Found only in nuclear decay waste. Pm-147 is of interest as a
+beta-decay source, however Pm-146 and Pm-148 have to be removed from it
+first, as they generate gamma radiation. Discovered by J.A. Marinsky,
+L.E. Glendenin and C.D. Coryell in 1947.</ar>
+<ar><k>protactinium</k>
+protactinium
+Symbol: Pa
+Atomic number: 91
+Atomic weight: (231)
+Radioactive metallic element, belongs to the actinoids. The most stable
+isotope, Pa-231 has a half-life of 2.43*10^4 years. At least 10 other
+radioactive isotopes are known. No practical applications are known.
+Discovered in 1917 by Lise Meitner and Otto Hahn.</ar>
+<ar><k>radium</k>
+radium
+Symbol: Ra
+Atomic number: 88
+Atomic weight: (226)
+Radioactive metallic transuranic element, belongs to group 2 of the
+periodic table. Most stable isotope, Ra-226 has a half-life of 1602 years,
+which decays into radon. Isolated from pitchblende in 1898 Marie and
+Pierre Curie.</ar>
+<ar><k>radon</k>
+radon
+Symbol: Rn
+Atomic number: 86
+Atomic weight: (222)
+Colorless radioactive gaseous element, belongs to the noble gases. Of the
+twenty known isotopes, the most stable is Rn-222 with a half-life of 3.8 days.
+Formed by the radioactive decay of {Radium}-226. Radon itself decays into
+{polonium}. Used in radiotherapy. As a noble gas, it is effectively inert,
+though radon fluoride has been synthesized. First isolated in 1908 by Ramsey
+and Gray.</ar>
+<ar><k>rhenium</k>
+rhenium
+Symbol: Re
+Atomic number: 75
+Atomic weight: 186.2
+Silvery-white metallic transition element. Obtained as a by-product of
+molybdenum refinement. Rhenium-molybdenum alloys are superconducting.</ar>
+<ar><k>rhodium</k>
+rhodium
+Symbol: Rh
+Atomic number: 45
+Atomic weight: 102.905
+Silvery white metallic transition element. Found with platinum and used in
+some platinum alloys. Not attacked by acids, dissolves only in aqua regia.
+Discovered in 1803 by W.H. Wollaston.</ar>
+<ar><k>rubidium</k>
+rubidium
+Symbol: Rb
+Atomic number: 37
+Atomic weight: 85.47
+Soft silvery metallic element, belongs to group 1 of the periodic table.
+Rb-97, the naturally occurring isotope, is radioactive. It is highly
+reactive, with properties similar to other elements in group 1, like
+igniting spontaneously in air. Discovered spectroscopically in 1861 by W.
+Bunsen and G.R. Kirchoff.</ar>
+<ar><k>ruthenium</k>
+ruthenium
+Symbol: Ru
+Atomic number: 44
+Atomic weight: 101.07
+Hard white metallic transition element. Found with platinum, used as a
+catalyst in some platinum alloys. Dissolves in fused alkalis, and is not
+attacked by acids. Reacts with halogens and oxygen at high temperatures.
+Isolated in 1844 by K.K. Klaus.</ar>
+<ar><k>rutherfordium</k>
+rutherfordium
+Symbol: Rf
+Competing name for {unnilquadium}, the 104th element, proposed by the
+American Chemical Society.</ar>
+<ar><k>samarium</k>
+samarium
+Symbol: Sm
+Atomic number: 62
+Atomic weight: 150.35
+Soft silvery metallic element, belongs to the lanthanoids. Seven natural
+isotopes, Sm-147 is the only radioisotope, and has a half-life of
+2.5*10^11 years. Used for making special alloys needed in the production
+of nuclear reactors. Also used as a neutron absorber. Small quantities of
+samarium oxide is used in special optical glasses. The largest use of the
+element is its ferromagnetic alloy which produces permanent magnets that
+are five times stronger than magnets produced by any other material.
+Discovered by Francois Lecoq de Boisbaudran in 1879.</ar>
+<ar><k>scandium</k>
+scandium
+Symbol: Sc
+Atomic number: 21
+Atomic weight: 44.956
+Rare soft silvery metallic element belonging to group 3 of the periodic
+table. There are ten isotopes, nine of which are radioactive and have
+short half-lives. Predicted in 1869 by Mendeleev, isolated by Nilson in
+1879.</ar>
+<ar><k>seaborgium</k>
+seaborgium
+Name proposed for the 106th element ({unnilhexium}) by the American
+Chemical Society in honor of Gleen T. Seaborg, an American nuclear
+physicist and Nobel prize winner.</ar>
+<ar><k>selenium</k>
+selenium
+Symbol: Se
+Atomic number: 34
+Atomic weight: 78.96
+Metalloid element, belongs to group 16 of the periodic table. Multiple
+allotropic forms exist. Chemically resembles sulphur. Discovered in 1817
+by Jons J. Berzelius.</ar>
+<ar><k>silicon</k>
+silicon
+Symbol: Si
+Atomic number: 14
+Atomic weight: 28.086
+Metalloid element belonging to group 14 of the periodic table. It is the
+second most abundant element in the Earth's crust, making up 25.7% of it
+by weight. Chemically less reactive than carbon. First identified by
+Lavoisier in 1787 and first isolated in 1823 by Berzelius.</ar>
+<ar><k>silver</k>
+silver
+Symbol: Ag
+Atomic number: 47
+Atomic weight: 107.870
+White lustrous soft metallic transition element. Found in both its
+elemental form and in minerals. Used in jewellery, tableware and so on.
+Less reactive than silver, chemically.</ar>
+<ar><k>sodium</k>
+sodium
+Symbol: Na
+Atomic number: 11
+Atomic weight: 22.9898
+Soft silvery reactive element belonging to group 1 of the periodic table
+(alkali metals). It is highly reactive, oxidizing in air and reacting
+violently with water, forcing it to be kept under oil. It was first
+isolated by Humphrey Davy in 1807.</ar>
+<ar><k>strontium</k>
+strontium
+Symbol: Sr
+Atomic number: 38
+Atomic weight: 87.62
+Soft yellowish metallic element, belongs to group 2 of the periodic
+table. Highly reactive chemically. Sr-90 is present in radioactive fallout
+and has a half-life of 28 years. Discovered in 1798 by Klaproth and Hope,
+isolated in 1808 by Humphry Davy.</ar>
+<ar><k>sulphur</k>
+sulphur
+Symbol: S
+Atomic number: 16
+Atomic weight: 32.064
+Yellow, nonmetallic element belonging to group 16 of the periodic table.
+It is an essential element in living organisms, needed in the amino acids
+cysteine and methionine, and hence in many proteins. Absorbed by plants
+from the soil as sulphate ion.</ar>
+<ar><k>tantalum</k>
+tantalum
+Symbol: Ta
+Atomic number: 73
+Atomic weight: 180.948
+Heavy blue-grey metallic transition element. Ta-181 is a stable isotope,
+and Ta-180 is a radioactive isotope, with a half-life in excess of 10^7
+years. Used in surgery as it is unreactive. Forms a passive oxide layer in
+air. Identified in 1802 by Ekeberg and isolated in 1820 by Jons J.
+Berzelius.</ar>
+<ar><k>technetium</k>
+technetium
+Symbol: Tc
+Atomic number: 43
+Atomic weight: (98)
+Radioactive metallic transition element. Can be detected in some stars and
+the fission products of uranium. First made by Perrier and Segre by
+bombarding molybdenum with deutrons, giving them Tc-97. Tc-99 is the most
+stable isotope with a half-life of 2.6*10^6 years. Sixteen isotopes are
+known. Organic technetium compounds are used in bone imaging. Chemical
+properties are intermediate between rhenium and manganese.</ar>
+<ar><k>tellurium</k>
+tellurium
+Symbol: Te
+Atomic number: 52
+Atomic weight: 127.60
+Silvery metalloid element of group 16. Eight natural isotopes, nine
+radioactive isotopes. Used in semiconductors and to a degree in some
+steels. Chemistry is similar to {sulphur}. Discovered in 1782 by Franz
+Miller.</ar>
+<ar><k>terbium</k>
+terbium
+Symbol: Tb
+Atomic number: 65
+Atomic weight: 158.924
+Silvery metallic element belonging to the lanthanoids. Tb-159 is the only
+stable isotope, there are seventeen artificial isotopes. Discovered by
+G.G. Mosander in 1843.</ar>
+<ar><k>thallium</k>
+thallium
+Symbol: Tl
+Atomic number: 81
+Atomic weight: 204.3833
+Pure, unreacted thallium appears silvery-white and exhibits a metallic
+lustre. Upon reacting with air, it begins to turn bluish-grey and looks
+like lead. It is very malleable, and can be cut with a knife. There are
+two stable isotopes, and four radioisotopes, Tl-204 being the most stable
+with a half-life of 3.78 years. Thallium sulphate was used as a rodenticide.
+Thallium sulphine's conductivity changes with exposure to infrared light,
+this gives it a use in infrared detectors. Discovered by Sir William Crookes
+via spectroscopy. Its name comes from the Greek word thallos, which means
+green twig. Thallium and its compounds are toxic and can cause cancer.</ar>
+<ar><k>thorium</k>
+thorium
+Symbol: Th
+Atomic number: 90
+Atomic weight: 232.038
+Grey radioactive metallic element. Belongs to actinoids. Found in monazite sand
+in Brazil, India and the US.  Thorium-232 has a half-life of 1.39x10^10 years.
+Can be used as a nuclear fuel for breeder reactors. Thorium-232 captures slow
+{neutron}s and breeds uranium-233. Discovered by Jons J. Berzelius in
+1829.</ar>
+<ar><k>thulium</k>
+thulium
+Symbol: Tm
+Atomic number: 69
+Atomic weight: 168.934
+Soft grey metallic element that belongs to the lanthanoids. One natural
+isotope exists, Tm-169, and seventeen artificial isotopes have been
+produced. No known uses for the element. Discovered in 1879 by Per Theodor
+Cleve.</ar>
+<ar><k>tin</k>
+tin
+Symbol: Sn
+Atomic number: 50
+Atomic weight: 118.69
+Silvery malleable metallic element belonging to group 14 of the periodic
+table. Twenty-six isotopes are known, five of which are radioactive.
+Chemically reactive. Combines directly with chlorine and oxygen and
+displaces hydrogen from dilute acids.</ar>
+<ar><k>titanium</k>
+titanium
+Symbol: Ti
+Atomic number: 22
+Atomic weight: 47.90
+White metallic transition element. Occurs in numerous minerals. Used in
+strong, light corrosion-resistant alloys. Forms a passive oxide coating
+when exposed to air. First discovered by Gregor in 1789.</ar>
+<ar><k>tungsten</k>
+tungsten
+Symbol: W
+Atomic number: 74
+Atomic weight: 183.85
+White or grey metallic transition element, formerly called {wolfram}.
+Forms a protective oxide in air and can be oxidized at high temperature.
+First isolated by Jose and Fausto de Elhuyer in 1783.</ar>
+<ar><k>unnilbium</k>
+unnilbium
+Symbol: Unb
+Name proposed by the {IUPAC} to settle the dispute over naming the 102nd
+element {nobelium}.</ar>
+<ar><k>unnildecium</k>
+unnildecium
+Symbol: Unn
+Atomic number: 110
+Atomic weight: (272)?
+Half-life of approximately 10ms. Reported in 1994 by German researchers at
+Darmstadt, Germany.</ar>
+<ar><k>unnilhexium</k>
+unnilhexium
+Symbol:
+Atomic number: 106
+Atomic weight: (263)
+Half-life of 0.9 +/- 0.2 s. Discovered by the Joint Institute for Nuclear
+Research at Dubna (U.S.S.R.) in June of 1974. Its existence was confirmed
+by the Lawrence Berkeley Laboratory and Livermore National Laboratory in
+September of 1974.</ar>
+<ar><k>unniloctium</k>
+unniloctium
+Symbol: Uno
+Atomic number: 108
+Atomic weight: (265)
+Radioactive transition metal.</ar>
+<ar><k>unnilpentium</k>
+unnilpentium
+Symbol: Unp
+Atomic number: 105
+Atomic weight: (262)
+Radioactive transactinide element. Half-life of 1.6s. Discovered in 1970
+by Berkeley researchers. So far, seven isotopes have been discovered.</ar>
+<ar><k>unnilquadium</k>
+unnilquadium
+Symbol: Unq
+Atomic number: 104
+Atomic weight: (261)
+Radioactive transactinide element. Expected to have similar chemical
+properties to those displayed by hafnium. Rf-260 was discovered by the
+Joint Nuclear Research Institute at Dubna (U.S.S.R.) in 1964. Researchers
+at Berkeley discovered Unq-257 and Unq-258 in 1964.</ar>
+<ar><k>unnilseptium</k>
+unnilseptium
+Symbol:
+Atomic number: 107
+Atomic weight: (262)
+Radioactive transition metal. Half-life of approximately 1/500 s.
+Discovered by the Joint Institute for Nuclear Research at Dubna (U.S.S.R.)
+in 1976. Confirmed by West German physicists at the Heavy Ion Research
+Laboratory at Darmstadt.</ar>
+<ar><k>unnilunium</k>
+unnilunium
+Symbol: Unu
+Name proposed by the {IUPAC} to settle the dispute over naming the 101st
+element {mendelevium}.</ar>
+<ar><k>uranium</k>
+uranium
+Symbol: U
+Atomic number: 92
+Atomic weight: (231)
+White radioactive metallic element belonging to the actinoids. Three
+natural isotopes, U-238, U-235 and U-234. Uranium-235 is used as the fuel
+for nuclear reactors and weapons. Discovered by Martin H. Klaproth in 1789.</ar>
+<ar><k>vanadium</k>
+vanadium
+Symbol: V
+Atomic number: 23
+Atomic weight: 50.9415
+Soft and ductile, bright white metal. Good resistance to corrosion by
+alkalis, sulphuric and hydrochloric acid. It oxidizes readily about
+933K. There are two naturally occurring isotopes of vanadium, and 5
+radioisotopes, V-49 having the longest half-life at 337 days. Vanadium
+has nuclear applications, the foil is used in cladding titanium to steel,
+and vanadium-gallium tape is used to produce a superconductive magnet.
+Originally discovered by Andres Manuel del Rio of Mexico City in 1801.
+His discovery went unheeded, however, and in 1820, Nils Gabriel Sefstron
+of Sweden rediscovered it. Metallic vanadium was isolated by Henry Enfield
+Roscoe in 1867. The name vanadium comes from {Vanadis}, a goddess of
+Scandinavian mythology. Silvery-white metallic transition element.
+Vanadium is essential to {ascidian}s. Rats and chickens are also known
+to require it. Metal powder is a fire hazard, and vanadium compounds
+should be considered highly toxic. May cause lung cancer if inhaled.</ar>
+<ar><k>wolfram</k>
+wolfram
+Original name for {tungsten}.</ar>
+<ar><k>xenon</k>
+xenon
+Symbol: Xe
+Atomic number: 54
+Atomic weight: 131.30
+Colourless, odourless gas belonging to group 18 on the periodic table (the
+noble gases.) Nine natural isotopes and seven radioactive isotopes are
+known. Xenon was part of the first noble-gas compound synthesized.
+Several others involving Xenon have been found since then. Xenon was
+discovered by Ramsey and Travers in 1898.</ar>
+<ar><k>ytterbium</k>
+ytterbium
+Symbol: Yb
+Atomic number: 70
+Atomic weight: 173.04
+Silvery metallic element of the lanthanoids. Seven natural isotopes and
+ten artificial isotopes are known.  Used in certain steels. Discovered by
+J.D.G. Marignac in 1878.</ar>
+<ar><k>yttrium</k>
+yttrium
+Symbol: Y
+Atomic number: 39
+Atomic weight: 88.905
+Silvery-grey metallic element of group 3 on the periodic table. Found in
+uranium ores. The only natural isotope is Y-89, there are 14 other
+artificial isotopes. Chemically resembles the lanthanoids. Stable in the
+air below 400 degrees, celsius. Discovered in 1828 by Friedrich Wohler.</ar>
+<ar><k>zinc</k>
+zinc
+Symbol: Zn
+Atomic number: 30
+Atomic weight: 65.38
+Blue-white metallic element. Occurs in multiple compounds naturally. Five
+stable isotopes are six radioactive isotopes have been found. Chemically a
+reactive metal, combines with oxygen and other non-metals, reacts with
+dilute acids to release hydrogen.</ar>
+<ar><k>zirconium</k>
+zirconium
+Symbol: Zr
+Atomic number: 40
+Atomic weight: 91.22
+Grey-white metallic transition element. Five natural isotopes and six
+radioactive isotopes are known. Used in nuclear reactors for a {neutron}
+absorber. Discovered in 1789 by Martin Klaproth, isolated in 1824 by
+Berzelius.</ar>
+</xdxf>
index b53763b..41d5dc4 100644 (file)
@@ -305,7 +305,7 @@ typedef void (*cb_word_translation)(gchar* translation, gchar* word, gpointer us
 //______________________________________________________________________________________________________
 // ******************************************************************************************************
 //*************************************************************** DEFINITIONS OF BASIC FUNCTIONS TYPES:
-// /** \brief Predeclaration for structure Engine.
+// brief Predeclaration for structure Engine.
 typedef struct _Engine Engine;
 
 /** \brief Type of function getting some chars from engin.
@@ -391,7 +391,7 @@ typedef gint (*getting_int)(Engine* engine);
  * 
  * 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.
+ * @return <i><b>gboolean</b></i> :: statement telling us if this module could or could not handle dictionary under location.
  */
 typedef gboolean (*checking_compatibiliti)(gchar* location);
 
@@ -400,7 +400,7 @@ typedef gboolean (*checking_compatibiliti)(gchar* location);
  * 
  * 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
+ * @return <i><b>gchar*</b></i> :: chars which we wanted
  */
 typedef gchar*  (*getting_chars_engine)(void);
 
@@ -409,7 +409,7 @@ typedef gchar*       (*getting_chars_engine)(void);
  * 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.
+ * @return <i><b>gpointer</b></i> ::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);
 
@@ -427,7 +427,7 @@ struct _Engine
        *
        * 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.
@@ -441,21 +441,21 @@ struct _Engine
        *
        * 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).
@@ -463,28 +463,28 @@ struct _Engine
        * 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.
@@ -497,7 +497,7 @@ struct _Engine
 
        /** \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.).
+     * 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;
index 8daff5c..37f2d30 100644 (file)
@@ -375,7 +375,9 @@ void
 search_word_list(Engine* engine, gchar* pattern)
 {
        struct timeval t0;
+       struct timeval t01;
        gettimeofday(&t0,NULL);
+       t01 = t0;
        g_printf("+   XDXF: function \'%s()\' called.\n",__FUNCTION__);
        XDXFData* data = (XDXFData*)(engine->engine_data);
        
@@ -424,19 +426,20 @@ search_word_list(Engine* engine, gchar* pattern)
                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++));
-       //}
+       time_info(&t01,"search_word_list - WITHOUT RETURNING!!!!!");    
        g_printf("\n+   XDXF(fun=%s): before calling callbacks for WORD_LIST\n==========================================================:\n",__FUNCTION__);
+       
+       struct timeval t02;
+       gettimeofday(&t02,NULL);
        data->callback_on_word_list(result,pattern,data->word_list,ENGINE_NO_ERROR);
+       time_info(&t02,"search_word_list - ONLY CALLBACKS!!!!!!!!!!");  
+       
        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");      
+       time_info(&t0,"search_word_list - EVERYTHING!!!!!!");   
 }
 
 void
index cbf101e..b2cfb7e 100644 (file)
@@ -1,6 +1,6 @@
 CC = gcc
 DEBUG = -g -Wall
-EXECUTABLE = gui
+EXECUTABLE = WhiteStork
 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` 
 
diff --git a/gui/src/ikona.png b/gui/src/ikona.png
deleted file mode 100644 (file)
index 6af3061..0000000
Binary files a/gui/src/ikona.png and /dev/null differ
diff --git a/gui/src/whitestork.png b/gui/src/whitestork.png
new file mode 100644 (file)
index 0000000..25b21e2
Binary files /dev/null and b/gui/src/whitestork.png differ
index 6859034..150bb75 100644 (file)
@@ -34,22 +34,20 @@ int main(int argc, char *argv[])
        
        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);
+       ws_dbus_notify(ws_gui_app->dbus_data, WS_DBUS_ERROR_UNKNOWN);
+       
+       g_signal_connect (G_OBJECT (ws_gui_app->ws_gui_w_list->ws_gui_selection), "changed", G_CALLBACK (ws_gui_tree_selection_changed), 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);
 
index 16919cc..aabcaf3 100644 (file)
@@ -105,10 +105,25 @@ void ws_gui_signal_hander (GError *error, GArray *words, gpointer user_data)
                                   "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;
                }       
+
+               case WS_DBUS_INFO_CACHING:
+               {
+               ws_gui_app->ws_gui_banner_caching = hildon_banner_show_animation(GTK_WIDGET(ws_gui_app->ws_gui_hildon_window), NULL, "caching ..." );
+               gtk_widget_set_sensitive (GTK_WIDGET(ws_gui_app->ws_gui_hildon_find_toolbar), FALSE);
+               gtk_widget_set_sensitive (GTK_WIDGET(ws_gui_app->ws_gui_menu->ws_gui_menu_search), FALSE);
+               break;
+               }
+               
+               case WS_DBUS_INFO_CACHING_FINISHED:
+               {
+               gtk_widget_destroy(GTK_WIDGET(ws_gui_app->ws_gui_banner_caching));
+               gtk_widget_set_sensitive (GTK_WIDGET(ws_gui_app->ws_gui_hildon_find_toolbar), TRUE);
+               gtk_widget_set_sensitive (GTK_WIDGET(ws_gui_app->ws_gui_menu->ws_gui_menu_search), TRUE);
+               break;
+               }
        }
 }
 
@@ -124,6 +139,7 @@ void ws_gui_dbus_return_words (GError *error, GArray *words, gpointer user_data)
        timer(TIMER_START, (gchar*)__FUNCTION__);
        guint i;
        osso_rpc_t data;
+       //char *data;
 
        WSGuiApp* ws_gui_app=(WSGuiApp*)user_data;
        
@@ -134,18 +150,20 @@ void ws_gui_dbus_return_words (GError *error, GArray *words, gpointer user_data)
        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);
+               //data = g_array_index (words, char *, i);
+               //tmp_word = g_strconcat(data,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);
+       gtk_list_store_clear(ws_gui_app->ws_gui_w_list->ws_gui_store);
+       
+       ws_gui_app->ws_gui_w_list->ws_gui_model = create_and_fill_model(tmp, ws_gui_app);
        
        if (tmp->len == 0)
        {
@@ -174,7 +192,7 @@ void ws_gui_dbus_return_translation (GError *error, GArray *words, gpointer user
                ws_gui_fill_html(data.value.s, ws_gui_app);
        }
        
-timer(TIMER_STOP, (gchar*)__FUNCTION__);
+       timer(TIMER_STOP, (gchar*)__FUNCTION__);
 }
 
 /**
@@ -386,7 +404,9 @@ void ws_gui_history_add(char *new_word, gpointer user_data)
 
 /** display previously choosen word (previous from the history array) if avaible, sets current position in the history array
  *
- *
+ * @param button - button which recived a signal
+ * @param user_data - user data set when the signal handler was connected
+ * @return 
  */
 void ws_gui_history_back(GtkButton *button, gpointer user_data) 
 {
@@ -407,6 +427,12 @@ void ws_gui_history_back(GtkButton *button, gpointer user_data)
        
 }
 
+/** display choosen word, next in the history array (if avaible), sets current position in the history array
+ *
+ * @param button - button which recived a signal
+ * @param user_data - user data set when the signal handler was connected
+ * @return 
+ */
 void ws_gui_history_next(GtkButton *button, gpointer user_data) 
 {
        WSGuiApp* ws_gui_app = (WSGuiApp *)user_data;
@@ -428,6 +454,11 @@ void ws_gui_history_next(GtkButton *button, gpointer user_data)
        ws_gui_check_history(ws_gui_app);
 }
 
+/** check current position in the history array and sets sensitivity of buttons / menu items, depends on availablity of words in the history
+ *
+ * @param user_data - user data set when the signal handler was connected
+ * @return 
+ */
 void ws_gui_check_history(gpointer user_data) 
 {
        WSGuiApp* ws_gui_app = (WSGuiApp *)user_data;
@@ -458,54 +489,84 @@ void ws_gui_check_history(gpointer user_data)
        }
 }
 
-void ws_gui_list_item_select(GtkList *list, GtkWidget *child, gpointer user_data) 
+/** create TreeView Model, which allows to display words list
+ *
+ * @param words_list - array with words(found in a dictionary), recived from DBUS;
+ * @param user_data - user data set when the signal handler was connected
+ * @return 
+ */
+GtkTreeModel * create_and_fill_model (GArray *words_list, 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;
-               }
+       WSGuiApp* ws_gui_app=(WSGuiApp*)user_data;
+       guint i = 0;
+       gchar *tmp = g_strdup(g_array_index(words_list, gchar*, i));
+       gboolean valid;
+       valid =gtk_tree_model_get_iter_first(GTK_TREE_MODEL(ws_gui_app->ws_gui_w_list->ws_gui_store), &ws_gui_app->ws_gui_w_list->ws_gui_iter);
+       
+        /* Append a row and fill in some data */
+       while (tmp != NULL)
+       {
+       gtk_list_store_append (ws_gui_app->ws_gui_w_list->ws_gui_store, &ws_gui_app->ws_gui_w_list->ws_gui_iter);
+       gtk_list_store_set (ws_gui_app->ws_gui_w_list->ws_gui_store,                                                               &ws_gui_app->ws_gui_w_list->ws_gui_iter,                                                                COL_WORD,                                                                                               tmp,                                                                                                    -1);
+       i=i+1;
+       tmp = g_strdup(g_array_index(words_list, gchar*, i));
+       };
+       
+       return GTK_TREE_MODEL(ws_gui_app->ws_gui_w_list->ws_gui_store);
 }
 
-void ws_gui_fill_the_list(GArray *words_list, gpointer user_data)
+/** create TreeView and TreeModel using create_and_fill_model() function; it is necessary to display found words in a words list;
+ *
+ * @param words_list - array with words(found in a dictionary), recived from DBUS;
+ * @param user_data - user data set when the signal handler was connected
+ * @return 
+ */
+GtkWidget * create_view_and_model (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));
+
+       ws_gui_app->ws_gui_w_list->ws_gui_view = gtk_tree_view_new ();
+
+       ws_gui_app->ws_gui_w_list->ws_gui_renderer = gtk_cell_renderer_text_new ();
+       gtk_tree_view_insert_column_with_attributes (GTK_TREE_VIEW (ws_gui_app->ws_gui_w_list->ws_gui_view),                                                 -1,                                                                                                     "Name",                                                                                                 ws_gui_app->ws_gui_w_list->ws_gui_renderer,                                                             "text",                                                                                                 COL_WORD,                                                                                               NULL);
        
+       ws_gui_app->ws_gui_w_list->ws_gui_model = create_and_fill_model (words_list, ws_gui_app);
        
-       while (tmp != NULL)
-       {
+       gtk_tree_view_set_model (GTK_TREE_VIEW (ws_gui_app->ws_gui_w_list->ws_gui_view), ws_gui_app->ws_gui_w_list->ws_gui_model);
        
-               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));
+       g_object_unref (ws_gui_app->ws_gui_w_list->ws_gui_model);
+       return ws_gui_app->ws_gui_w_list->ws_gui_view;
+}
 
-       }
-       gtk_widget_show_all(GTK_WIDGET(ws_gui_app->ws_gui_w_list->ws_gui_list));
+/** handle signal from words list, get selected word and calls 'find translation' function
+ *
+ * @param selection - the object which received the signal
+ * @param user_data - user data set when the signal handler was connected
+ * @return 
+ */
+void ws_gui_tree_selection_changed(GtkTreeSelection *selection, gpointer user_data)
+{
+WSGuiApp* ws_gui_app=(WSGuiApp*)user_data;
+gchar *string;
+if (gtk_tree_selection_get_selected (selection, &ws_gui_app->ws_gui_w_list->ws_gui_model,                                                              &ws_gui_app->ws_gui_w_list->ws_gui_iter))
+        {
+                gtk_tree_model_get (ws_gui_app->ws_gui_w_list->ws_gui_model, &ws_gui_app->ws_gui_w_list->ws_gui_iter, COL_WORD, &string, -1);
+
+               ws_dbus_client_find_translation(ws_gui_app->dbus_data, string);
+               
+               ws_gui_history_add(string, ws_gui_app);
 
+                g_free (string);
+        }
 }
 
+/** switch application between fun screen and normal mode
+ *
+ * @param menuitem - object which recived the signal
+ * @param user_data - user data set when the signal handler was connected 
+ * @return
+ */
 void ws_gui_full_screen(GtkMenuItem *menuitem, gpointer user_data)
 {
 
@@ -524,12 +585,24 @@ void ws_gui_full_screen(GtkMenuItem *menuitem, gpointer user_data)
        }
 }
 
+/** select whole text in the translation (html) area
+ *
+ * @param menuitem - object which recived the signal
+ * @param user_data - user data set when the signal handler was connected 
+ * @return
+ */
 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));
 }
 
+/** copy selected text to the clipoard
+ *
+ * @param menuitem - object which recived the signal
+ * @param user_data - user data set when the signal handler was connected 
+ * @return
+ */
 void ws_gui_html_copy(GtkMenuItem *menuitem, gpointer user_data) 
 {
        WSGuiApp* ws_gui_app = (WSGuiApp*)user_data;
@@ -537,19 +610,36 @@ void ws_gui_html_copy(GtkMenuItem *menuitem, gpointer user_data)
        
 }
 
+/** zoom in text in translation (html) area
+ *
+ * @param menuitem - object which recived the signal
+ * @param user_data - user data set when the signal handler was connected 
+ * @return
+ */
 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));
 }
 
+/** zoom out text in translation (html) area
+ *
+ * @param menuitem - object which recived the signal
+ * @param user_data - user data set when the signal handler was connected 
+ * @return
+ */
 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));
 }
 
-
+/** start searching, send typed word to DBUS and query for words
+ *
+ * @param widget - object which recived the signal
+ * @param user_data - user data set when the signal handler was connected 
+ * @return
+ */
 void ws_gui_search(GtkWidget * widget, gpointer user_data) 
 {
        WSGuiApp* ws_gui_app = (WSGuiApp*)user_data;
@@ -579,6 +669,12 @@ void ws_gui_search(GtkWidget * widget, gpointer user_data)
        
 }
 
+/** stop search process
+ *
+ * @param button - object which recived the signal
+ * @param user_data - user data set when the signal handler was connected 
+ * @return
+ */
 void ws_gui_search_stop(GtkButton *button, gpointer user_data) 
 {
        WSGuiApp* ws_gui_app = (WSGuiApp *)user_data;   
@@ -592,36 +688,59 @@ void ws_gui_search_stop(GtkButton *button, gpointer user_data)
        
 }
 
+/** this function is called just before closing application; it sends signal to DBUS and destroys it; 
+ *
+ * @param widget - object which recived the signal
+ * @param event - 
+ * @param user_data - user data set when the signal handler was connected 
+ * @return
+ */
 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");
+       g_log(G_LOG_DOMAIN, G_LOG_LEVEL_INFO, "\nClosing WhiteStork Dictionary ... \n\n");
        ws_dbus_destroy (ws_gui_app->dbus_data);
        gtk_main_quit();
        exit (0);
 }
 
+/** this function is called just before closing application, from application menu; it sends signal to DBUS and destroys it;
+ *
+ * @param menuitem - object which recived the signal
+ * @param user_data - user data set when the signal handler was connected 
+ * @return
+ */
 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");
+       g_log(G_LOG_DOMAIN, G_LOG_LEVEL_INFO, "\nClosing WhiteStork Dictionary ... \n\n");
        ws_dbus_destroy (ws_gui_app->dbus_data);
        gtk_main_quit();
        exit (0);
 }
 
+/** fill translation area with text (html) recived from DBUS
+ *
+ * @param html_context - text which is going to be displayed; it should be html;
+ * @param user_data - user data set when the function was called
+ * @return
+ */
 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);
+       
 }
 
+/** read adjustment of left scrollwindow, which is necessary to navigate with arrow keys inside words list
+ *
+ * @param user_data - user data set when the signal handler was connected 
+ * @return
+ */
 void ws_gui_read_adjustment(gpointer user_data)
 {
        WSGuiApp* ws_gui_app=(WSGuiApp*)user_data;
@@ -634,24 +753,8 @@ void ws_gui_read_adjustment(gpointer user_data)
 
        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);
-       
-}
index ae9403e..11c015d 100644 (file)
@@ -9,12 +9,18 @@
 #include "../../include/ws_dbus.h"
 
 
-
+/** this function creates main window and it components; moreover there are signal connections;
+ *
+ * @param user_data - data set when the signal handler was connected 
+ */
 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>";
 
+       GArray *array_tmp = g_array_new (TRUE, TRUE, sizeof(gchar*));
+
        ws_gui_app->ws_gui_banner_flag = FALSE;
        ws_gui_app->ws_gui_full_screen_flag = FALSE;    
 
@@ -32,7 +38,7 @@ void ws_gui_create_window(gpointer user_data)
        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();
+       /*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");
@@ -40,12 +46,11 @@ void ws_gui_create_window(gpointer user_data)
        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();
  
@@ -56,18 +61,18 @@ void ws_gui_create_window(gpointer user_data)
  
        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_w_list->ws_gui_list = gtk_list_new();
+       ws_gui_app->ws_gui_w_list->ws_gui_store = gtk_list_store_new (NUM_COLS, G_TYPE_STRING, G_TYPE_UINT);
+       ws_gui_app->ws_gui_w_list->ws_gui_view = create_view_and_model(array_tmp, ws_gui_app);  
+       gtk_widget_show_all(GTK_WIDGET(ws_gui_app->ws_gui_w_list->ws_gui_view));
+       
+       //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);
  
+       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_view);
+
        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);
@@ -76,10 +81,18 @@ void ws_gui_create_window(gpointer user_data)
        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));
+       gtk_widget_show_all(GTK_WIDGET(ws_gui_app->ws_gui_hildon_window));
+       
+       ws_gui_app->ws_gui_w_list->ws_gui_selection = gtk_tree_view_get_selection (GTK_TREE_VIEW (ws_gui_app->ws_gui_w_list->ws_gui_view));
+       
+       gtk_tree_selection_set_mode (ws_gui_app->ws_gui_w_list->ws_gui_selection, GTK_SELECTION_SINGLE);
        
 }
 
+/** this function creates a find toolbar and connects signals to the tollbars components
+ *
+ * @param user_data - set when the signal handler was connected
+ */
 void ws_gui_create_find_toolbar(gpointer user_data) 
 {
        WSGuiApp* ws_gui_app = (WSGuiApp*)user_data;    
@@ -117,6 +130,10 @@ void ws_gui_create_find_toolbar(gpointer user_data)
        hildon_window_add_toolbar(ws_gui_app->ws_gui_hildon_window, GTK_TOOLBAR(ws_gui_app->ws_gui_hildon_find_toolbar));
 }
 
+/** this function creates application menu and its items and connect signals to them
+ *
+ * @param user_data - set when the signal handler was connected
+ */
 void ws_gui_create_main_menu (gpointer user_data) 
 {
        WSGuiApp* ws_gui_app=(WSGuiApp*)user_data;
@@ -164,8 +181,6 @@ void ws_gui_create_main_menu (gpointer user_data)
        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);
@@ -188,12 +203,15 @@ void ws_gui_create_main_menu (gpointer user_data)
        gtk_widget_show_all(ws_gui_app->ws_gui_menu->ws_gui_main_menu);
 }
 
+
+/** this function creates contex popup menu and its items and connect signals to them
+ *
+ * @param user_data - set when the signal handler was connected
+ */
 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();
@@ -205,8 +223,6 @@ void ws_gui_create_popup_menu (GtkWidget *widget, GdkEventButton *event, gpointe
        
        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");
@@ -234,7 +250,6 @@ void ws_gui_create_popup_menu (GtkWidget *widget, GdkEventButton *event, gpointe
                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);
index ab43fe7..b5a7d78 100644 (file)
@@ -79,6 +79,8 @@ 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_INFO_CACHING, ///<Manager signal - informs the GUI, that caching has started
+       WS_DBUS_INFO_CACHING_FINISHED, ///<Manager signal - informs the GUI, that caching has finished
        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
@@ -267,6 +269,40 @@ WSDBusStatus ws_dbus_server_return_translations (WSDBusData * ws_dbus_data, gcha
 
 // WSDBusStatus ws_dbus_server_return_translations_last (WSDBusData * ws_dbus_data, gchar * translation);
 
+/**\brief Sends an address of data to transmit
+*
+*Function used in order to increase the speed of data transmission. For now it's been added just for testing purposes.
+*The goal is to use the main advantage of threads, that is memory sharing. If <I>GUI</I> and <I>MANAGER</I> are in the
+*same memory area, the data pointers also stay in the same memory area.
+*@param ws_dbus_data - pointer to a structure uniquely identifying the application for DBus
+*@param method - name of the method of the remote object to call
+*@param data_address - address of the data
+*@return WS_STATUS_OK - on success \n
+*WS_STATUS_ERROR - on error
+*/
+
+WSDBusStatus ws_dbus_send_ptrtodata (WSDBusData * ws_dbus_data, gchar *method, gulong data_address);
+
+/**\brief Splits the data from buffer generated by ::ws_dbus_concat_data
+*
+*Function used in order to increase the speed of data transmission. For now it's been added just for testing purposes.
+*It ommits the limit of D-BUS message fields in one message.
+*@param buffer - pointer to strings concatenated by ws_dbus_concat_data
+*@return GArray of strings
+*/
+
+GArray * ws_dbus_split_data (gpointer buffer);
+
+/**\brief Concatenates data from a GArray to one long buffer ::ws_dbus_split_data
+*
+*Function used in order to increase the speed of data transmission. For now it's been added just for testing purposes.
+*It ommits the limit of D-BUS message fields in one message.
+*@param garray - a GArray to be concatenated
+*@return pointer to a buffer
+*/
+
+gpointer ws_dbus_concat_data (GArray *garray);
+
 #ifdef __cplusplus
 }
 #endif
index 4faf8fa..44c9869 100644 (file)
@@ -35,101 +35,114 @@ extern "C" {
 
 typedef struct WSGuiAppData WSGuiApp;
 
+enum
+{
+  COL_WORD = 0,
+  NUM_COLS
+};
 
-
-/** \brief do czego ta struktura
+/** \brief struct which contains components of menu
  *
- * opis d³uzszy
+ * here are placed all components of application menu and popup menu
  */
 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;
+       /*application menu*/
+       GtkWidget *ws_gui_main_menu; ///< application submenu
+       GtkWidget *ws_gui_menu_edit; ///< edit submenu(connected with text editing)
+               GtkWidget *ws_gui_menu_copy; ///< menuitem in edit submenu; copy selected text to the clipboard
+               GtkWidget *ws_gui_menu_select_all; ///< menuitem in edit submenu; select whole text in the translation (html) area 
+       GtkWidget *ws_gui_menu_view; ///< view submenu
+               GtkWidget *ws_gui_menu_hide_list; ///< menuitem which allows to hide/show words list
+               GtkWidget *ws_gui_menu_zoom_in; ///< menuitem which allows to zoom in text in the translation area
+               GtkWidget *ws_gui_menu_zoom_out; ///< menuitem which allows to zoom out text in the translation area
+               GtkWidget *ws_gui_menu_full_screen; ///< menuitem which allows to switch between fullscreen and normal mode
+       GtkWidget *ws_gui_menu_search; ///< search submenu (connected with searching)
+               GtkWidget *ws_gui_menu_find_word; ///< menuitem which allows to start searching
+               GtkWidget *ws_gui_menu_find_prev; ///< menuitem which allows to find previous word from the history
+               GtkWidget *ws_gui_menu_find_next; ///< menuitem which allows to find next word in the history 
+               GtkWidget *ws_gui_menu_stop; ///< menuitem which stops search
+       GtkWidget *ws_gui_menu_close; ///< menuitem which closes the application
+
+       GtkWidget *ws_gui_submenu_1; ///< submenu which is necessary to build edit submenu
+       GtkWidget *ws_gui_submenu_2; ///< submenu which is necessary to build view submenu
+       GtkWidget *ws_gui_submenu_3; ///< submenu which is necessary to build search submenu
+       GtkWidget *ws_gui_separator; ///< separator, it is used to provide nice layout
+
+       /*ws_gui_menu popup*/
+       GtkWidget *ws_gui_popup_menu;  ///< popup menu
+       GtkWidget *ws_gui_popup_edit; ///< edit submenu
+       GtkWidget *ws_gui_popup_submenu; ///< submenu (necessary to create edit submenu)
+       GtkWidget *ws_gui_popup_copy; ///< menuitem which allows to copy selected to the clipboard
+       GtkWidget *ws_gui_popup_select_all; ///<menuitem which allows to select whole text in translation area
+       GtkWidget *ws_gui_popup_zoom_in; ///< menuitem which allows to zoom in text in translation area
+       GtkWidget *ws_gui_popup_zoom_out; ///< menuitem which allows to zoom in text in translation area
 };
 
+/** \brief struct which contains components of words list
+ *
+ * here are placed all components of words list (inside left scrollwindow)
+ */
 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];
+       GtkWidget       *ws_gui_list; ///< list which contains words
+       GtkWidget       *ws_gui_list_item; ///< item in words list (each word)
+       GtkWidget       *ws_gui_list_label; ///< label, necessary to place word in words list
        
-       GtkObject       *ws_gui_list_item_object;
-        gchar           *ws_gui_list_item_data_string;
-       GList           *ws_gui_dlist;
+       GtkObject       *ws_gui_list_item_object; ///< object which stores data of selected item (from words list)
+        gchar           *ws_gui_list_item_data_string; ///< variable which stores translation of word (html content)
+       GList           *ws_gui_dlist; ///< variable, which is necessary to get selected item (from words list)
+
+       GtkListStore  *ws_gui_store;
+       GtkTreeIter    ws_gui_iter;
+       GtkCellRenderer     *ws_gui_renderer;
+       GtkTreeModel        *ws_gui_model;
+       GtkWidget           *ws_gui_view;
+       GtkTreeSelection    *ws_gui_selection;
 
 };
 
+/** \brief struct which contains all components of application
+ *
+ * here are placed all components of main window, toolbar, structures responsible for menus and variables responsible for adjustments, words history, banners, message dialogs and everything what user can see and use
+ */
 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;
+       HildonProgram *ws_gui_hildon_program; ///< handle to hildon program
+       HildonWindow *ws_gui_hildon_window; ///< handle to hildon window
+       GtkWidget *ws_gui_html; ///< translation (html) area 
+       GtkWidget *ws_gui_hpane; ///< pane; it allows to divide window into two separate panels
+       HildonFindToolbar *ws_gui_hildon_find_toolbar; ///< find toolbar (placed at the bottom of the window)
+       GtkToolItem *ws_gui_toobar_button_close; ///< close button at the find toolbar
+       GtkToolItem *ws_gui_toobar_button_back; ///< back button at the find toolbar (history navigator)
+       GtkToolItem *ws_gui_toobar_button_forward; ///< next button at the find toolbar (history navigator)
+       GtkToolItem *ws_gui_toobar_button_stop; ///< stop butoon at the find toolbar (allows to stop searching)
+       GtkWidget *ws_gui_banner; ///< banner, displays message that searching is in progress
+       GtkWidget *ws_gui_banner_caching; ///< banner, displays message that caching is in progress
+       GtkToolItem *ws_gui_toobar_button_hide; ///< button hide, allows to hide/show words list with button placed at find toolbar
+       GtkWidget *ws_gui_scrolledwindow_right; ///< right scrolledwindow (placed in right pane), necessary to provide scrollbars)
+       GtkWidget *ws_gui_scrolledwindow_left; ///< scrollwindow (placed in left pane), necessary to provide scrollbars)
+       gchar *ws_gui_html_source; ///< string which contains html content (translation of word)
+
+       GtkAdjustment* ws_gui_vadj; ///< vertical adjustment of left scrolledwindow (necessary to provide navigation (kardware keys) inside words list)
+       GtkAdjustment* ws_gui_hadj; ///< horizontal adjustment of left scrolledwindow (necessary to provide navigation (kardware keys) inside words list)
+       gdouble v_delta; ///< variable used for moving vertical scrollbar in words list
+       gdouble v_new_value; ///< variable used for moving vertical scrollbar in words list
+       gdouble h_delta; ///< variable used for moving horizontal scrollbar in words list
+       gdouble h_new_value; ///< variable used for moving horizontal scrollbar in words list
+       gdouble cur_vadj; ///< current vertical adjustment of vertical scrollbar in words list
+       gdouble prev_vadj; ///< previous vertical adjustment of vertical scrollbar in words list
+       gdouble cur_hadj; ///< current vertical adjustment of horizontal scrollbar in words list
+       gdouble prev_hadj; ///< previous vertical adjustment of horizontal scrollbar in words list
+
+       GArray *ws_gui_history; ///< words history
+       gint ws_gui_history_cur_pos; ///< current position in words history array 
+       struct WSGuiMenu *ws_gui_menu; ///< structure responsible for menus
+       struct WSGuiList *ws_gui_w_list; ///< structure responsible for words list
        
-       gboolean ws_gui_banner_flag;
-       gboolean ws_gui_full_screen_flag;
-
-       WSDBusData *dbus_data;
+       gboolean ws_gui_banner_flag; ///< flag; used for notifing if searching is in progress and banner has to be displaying
+       gboolean ws_gui_full_screen_flag; ///< flag; used for informing if fullscreen mode is active
 
-       GtkWidget* ws_message_dialog;
+       WSDBusData *dbus_data; ///< DBUS declaration
 
+       GtkWidget* ws_message_dialog; ///< message dialogs; used for informing user about errors
 };
 
 #ifdef __cplusplus
index ced134b..713f6f2 100644 (file)
@@ -87,15 +87,9 @@ void ws_gui_history_next(GtkButton *button, gpointer user_data);
 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);
+GtkWidget * create_view_and_model (GArray *words_list, gpointer user_data);
+GtkTreeModel * create_and_fill_model (GArray *words_list, gpointer user_data);
+void ws_gui_tree_selection_changed(GtkTreeSelection *selection, gpointer user_data);
 
 /**  \brief switch view between full screen and normal mode 
 *
@@ -155,7 +149,6 @@ 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
 }
index 248d66b..96904dc 100644 (file)
@@ -14,7 +14,7 @@ extern "C" {
 #include "ws_gui_callbacks.h"
 
 /**
-* \brief create main window (all widgets)
+* \brief create main window
 *
 */
 void ws_gui_create_window(gpointer user_data);
diff --git a/makefile b/makefile
deleted file mode 100644 (file)
index 6adb5d9..0000000
--- a/makefile
+++ /dev/null
@@ -1,40 +0,0 @@
-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
index ec41489..0213d50 100644 (file)
@@ -5,9 +5,9 @@ FLAGS = `pkg-config --cflags glib-2.0 gmodule-2.0 libosso`
 SOURCE = src
 BINARY = ../bin
 INCLUDE = ../include
-EXECUTABLE = ${BINARY}/WhiteStork
+EXECUTABLE = ${BINARY}/WhiteStorkManager
 
-all: ${BINARY}/ws_manager.o ${BINARY}/test_mng.o ${BINARY}/ws_dbus.o ${BINARY}/gui
+all: ${BINARY}/ws_manager.o ${BINARY}/test_mng.o ${BINARY}/ws_dbus.o
                @${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
@@ -15,8 +15,6 @@ ${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:
index 483b96b..ea23795 100644 (file)
@@ -24,12 +24,13 @@ int main ()
 {
        WSMngSearchData *search_data = (WSMngSearchData *)g_try_malloc(sizeof (WSMngSearchData));
        
-       ws_mng_init_gui(search_data);
+//     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);
index 637095d..3c7971b 100644 (file)
@@ -154,11 +154,21 @@ void ws_mng_init_dbus (WSMngSearchData *data)
 
 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
+       gchar* library_to_path = g_strconcat(current_directory, "usr/bin/gui", NULL); //set path to gui binary file
+
+       printf ("GUI current directory: %s\n", current_directory);
+       printf ("GUI library to path: %s\n", library_to_path);
        
+       if (g_file_test(library_to_path, G_FILE_TEST_EXISTS) == FALSE)
+       {
+               g_printf("Can`t find gui file. Terminating program\n");
+               exit(0);
+       }
+       
+       int pid = fork ();
        switch (pid)
        {
                case -1:
@@ -188,9 +198,14 @@ void ws_mng_init (WSMngSearchData *data)
        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
+       
+       //printf ("Module current directory: %s\n", current_directory);
+//     gchar *library_to_path = g_strconcat(current_directory, "/bin/engine_xdxf.so", NULL); //set path to engine module
+       
+       gchar *library_to_path = g_strdup("/usr/lib/WhiteStork/engine_xdxf.so"); //the name of module lo load
        
        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);
@@ -209,9 +224,17 @@ void ws_mng_init (WSMngSearchData *data)
        }
        
        EngineModule module = get_functions();
-       //data->module = module;
        Engine* xdxf;
        
+       while (ws_dbus_notify(data->dbus_data, WS_DBUS_INFO_CACHING) == WS_DBUS_STATUS_ERROR)
+       {
+               sleep(1);       
+       }
+       
+       
+       current_directory = g_strdup("/usr/share/WhiteStork/dict");
+       
+
        if (dict_eng_module_check (module, current_directory) == TRUE)
        {
                xdxf = dict_eng_module_create(module, current_directory, ENGINE_CREATE); //create engine module 
@@ -222,11 +245,11 @@ void ws_mng_init (WSMngSearchData *data)
                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
+               if (g_file_test(g_strconcat(current_directory,"/dict.cache", NULL), 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, 
@@ -250,6 +273,12 @@ void ws_mng_init (WSMngSearchData *data)
                //dict_eng_destroy(xdxf);
                exit(0);
        }
+       
+       while (ws_dbus_notify(data->dbus_data, WS_DBUS_INFO_CACHING_FINISHED) == WS_DBUS_STATUS_ERROR)
+       {
+               sleep(1);
+       }
+       
        g_free(current_directory);
        g_free(library_to_path);
 }