mirror: 初始快照

This commit is contained in:
Li_Feiyu committed 2026-10-02 22:51:03 +08:00
commit bf87c99809
1011 files changed
+18247530

No files matched your search

+1
View File
@@ -0,0 +1 @@
Michael Bunk <michael.bunk@gmail.com>
+340
View File
@@ -0,0 +1,340 @@
GNU GENERAL PUBLIC LICENSE
Version 2, June 1991
Copyright (C) 1989, 1991 Free Software Foundation, Inc.
59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
Everyone is permitted to copy and distribute verbatim copies
of this license document, but changing it is not allowed.
Preamble
The licenses for most software are designed to take away your
freedom to share and change it. By contrast, the GNU General Public
License is intended to guarantee your freedom to share and change free
software--to make sure the software is free for all its users. This
General Public License applies to most of the Free Software
Foundation's software and to any other program whose authors commit to
using it. (Some other Free Software Foundation software is covered by
the GNU Library General Public License instead.) You can apply it to
your programs, too.
When we speak of free software, we are referring to freedom, not
price. Our General Public Licenses are designed to make sure that you
have the freedom to distribute copies of free software (and charge for
this service if you wish), that you receive source code or can get it
if you want it, that you can change the software or use pieces of it
in new free programs; and that you know you can do these things.
To protect your rights, we need to make restrictions that forbid
anyone to deny you these rights or to ask you to surrender the rights.
These restrictions translate to certain responsibilities for you if you
distribute copies of the software, or if you modify it.
For example, if you distribute copies of such a program, whether
gratis or for a fee, you must give the recipients all the rights that
you have. You must make sure that they, too, receive or can get the
source code. And you must show them these terms so they know their
rights.
We protect your rights with two steps: (1) copyright the software, and
(2) offer you this license which gives you legal permission to copy,
distribute and/or modify the software.
Also, for each author's protection and ours, we want to make certain
that everyone understands that there is no warranty for this free
software. If the software is modified by someone else and passed on, we
want its recipients to know that what they have is not the original, so
that any problems introduced by others will not reflect on the original
authors' reputations.
Finally, any free program is threatened constantly by software
patents. We wish to avoid the danger that redistributors of a free
program will individually obtain patent licenses, in effect making the
program proprietary. To prevent this, we have made it clear that any
patent must be licensed for everyone's free use or not licensed at all.
The precise terms and conditions for copying, distribution and
modification follow.
GNU GENERAL PUBLIC LICENSE
TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
0. This License applies to any program or other work which contains
a notice placed by the copyright holder saying it may be distributed
under the terms of this General Public License. The "Program", below,
refers to any such program or work, and a "work based on the Program"
means either the Program or any derivative work under copyright law:
that is to say, a work containing the Program or a portion of it,
either verbatim or with modifications and/or translated into another
language. (Hereinafter, translation is included without limitation in
the term "modification".) Each licensee is addressed as "you".
Activities other than copying, distribution and modification are not
covered by this License; they are outside its scope. The act of
running the Program is not restricted, and the output from the Program
is covered only if its contents constitute a work based on the
Program (independent of having been made by running the Program).
Whether that is true depends on what the Program does.
1. You may copy and distribute verbatim copies of the Program's
source code as you receive it, in any medium, provided that you
conspicuously and appropriately publish on each copy an appropriate
copyright notice and disclaimer of warranty; keep intact all the
notices that refer to this License and to the absence of any warranty;
and give any other recipients of the Program a copy of this License
along with the Program.
You may charge a fee for the physical act of transferring a copy, and
you may at your option offer warranty protection in exchange for a fee.
2. You may modify your copy or copies of the Program or any portion
of it, thus forming a work based on the Program, and copy and
distribute such modifications or work under the terms of Section 1
above, provided that you also meet all of these conditions:
a) You must cause the modified files to carry prominent notices
stating that you changed the files and the date of any change.
b) You must cause any work that you distribute or publish, that in
whole or in part contains or is derived from the Program or any
part thereof, to be licensed as a whole at no charge to all third
parties under the terms of this License.
c) If the modified program normally reads commands interactively
when run, you must cause it, when started running for such
interactive use in the most ordinary way, to print or display an
announcement including an appropriate copyright notice and a
notice that there is no warranty (or else, saying that you provide
a warranty) and that users may redistribute the program under
these conditions, and telling the user how to view a copy of this
License. (Exception: if the Program itself is interactive but
does not normally print such an announcement, your work based on
the Program is not required to print an announcement.)
These requirements apply to the modified work as a whole. If
identifiable sections of that work are not derived from the Program,
and can be reasonably considered independent and separate works in
themselves, then this License, and its terms, do not apply to those
sections when you distribute them as separate works. But when you
distribute the same sections as part of a whole which is a work based
on the Program, the distribution of the whole must be on the terms of
this License, whose permissions for other licensees extend to the
entire whole, and thus to each and every part regardless of who wrote it.
Thus, it is not the intent of this section to claim rights or contest
your rights to work written entirely by you; rather, the intent is to
exercise the right to control the distribution of derivative or
collective works based on the Program.
In addition, mere aggregation of another work not based on the Program
with the Program (or with a work based on the Program) on a volume of
a storage or distribution medium does not bring the other work under
the scope of this License.
3. You may copy and distribute the Program (or a work based on it,
under Section 2) in object code or executable form under the terms of
Sections 1 and 2 above provided that you also do one of the following:
a) Accompany it with the complete corresponding machine-readable
source code, which must be distributed under the terms of Sections
1 and 2 above on a medium customarily used for software interchange; or,
b) Accompany it with a written offer, valid for at least three
years, to give any third party, for a charge no more than your
cost of physically performing source distribution, a complete
machine-readable copy of the corresponding source code, to be
distributed under the terms of Sections 1 and 2 above on a medium
customarily used for software interchange; or,
c) Accompany it with the information you received as to the offer
to distribute corresponding source code. (This alternative is
allowed only for noncommercial distribution and only if you
received the program in object code or executable form with such
an offer, in accord with Subsection b above.)
The source code for a work means the preferred form of the work for
making modifications to it. For an executable work, complete source
code means all the source code for all modules it contains, plus any
associated interface definition files, plus the scripts used to
control compilation and installation of the executable. However, as a
special exception, the source code distributed need not include
anything that is normally distributed (in either source or binary
form) with the major components (compiler, kernel, and so on) of the
operating system on which the executable runs, unless that component
itself accompanies the executable.
If distribution of executable or object code is made by offering
access to copy from a designated place, then offering equivalent
access to copy the source code from the same place counts as
distribution of the source code, even though third parties are not
compelled to copy the source along with the object code.
4. You may not copy, modify, sublicense, or distribute the Program
except as expressly provided under this License. Any attempt
otherwise to copy, modify, sublicense or distribute the Program is
void, and will automatically terminate your rights under this License.
However, parties who have received copies, or rights, from you under
this License will not have their licenses terminated so long as such
parties remain in full compliance.
5. You are not required to accept this License, since you have not
signed it. However, nothing else grants you permission to modify or
distribute the Program or its derivative works. These actions are
prohibited by law if you do not accept this License. Therefore, by
modifying or distributing the Program (or any work based on the
Program), you indicate your acceptance of this License to do so, and
all its terms and conditions for copying, distributing or modifying
the Program or works based on it.
6. Each time you redistribute the Program (or any work based on the
Program), the recipient automatically receives a license from the
original licensor to copy, distribute or modify the Program subject to
these terms and conditions. You may not impose any further
restrictions on the recipients' exercise of the rights granted herein.
You are not responsible for enforcing compliance by third parties to
this License.
7. If, as a consequence of a court judgment or allegation of patent
infringement or for any other reason (not limited to patent issues),
conditions are imposed on you (whether by court order, agreement or
otherwise) that contradict the conditions of this License, they do not
excuse you from the conditions of this License. If you cannot
distribute so as to satisfy simultaneously your obligations under this
License and any other pertinent obligations, then as a consequence you
may not distribute the Program at all. For example, if a patent
license would not permit royalty-free redistribution of the Program by
all those who receive copies directly or indirectly through you, then
the only way you could satisfy both it and this License would be to
refrain entirely from distribution of the Program.
If any portion of this section is held invalid or unenforceable under
any particular circumstance, the balance of the section is intended to
apply and the section as a whole is intended to apply in other
circumstances.
It is not the purpose of this section to induce you to infringe any
patents or other property right claims or to contest validity of any
such claims; this section has the sole purpose of protecting the
integrity of the free software distribution system, which is
implemented by public license practices. Many people have made
generous contributions to the wide range of software distributed
through that system in reliance on consistent application of that
system; it is up to the author/donor to decide if he or she is willing
to distribute software through any other system and a licensee cannot
impose that choice.
This section is intended to make thoroughly clear what is believed to
be a consequence of the rest of this License.
8. If the distribution and/or use of the Program is restricted in
certain countries either by patents or by copyrighted interfaces, the
original copyright holder who places the Program under this License
may add an explicit geographical distribution limitation excluding
those countries, so that distribution is permitted only in or among
countries not thus excluded. In such case, this License incorporates
the limitation as if written in the body of this License.
9. The Free Software Foundation may publish revised and/or new versions
of the General Public License from time to time. Such new versions will
be similar in spirit to the present version, but may differ in detail to
address new problems or concerns.
Each version is given a distinguishing version number. If the Program
specifies a version number of this License which applies to it and "any
later version", you have the option of following the terms and conditions
either of that version or of any later version published by the Free
Software Foundation. If the Program does not specify a version number of
this License, you may choose any version ever published by the Free Software
Foundation.
10. If you wish to incorporate parts of the Program into other free
programs whose distribution conditions are different, write to the author
to ask for permission. For software which is copyrighted by the Free
Software Foundation, write to the Free Software Foundation; we sometimes
make exceptions for this. Our decision will be guided by the two goals
of preserving the free status of all derivatives of our free software and
of promoting the sharing and reuse of software generally.
NO WARRANTY
11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY
FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN
OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES
PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED
OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS
TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE
PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING,
REPAIR OR CORRECTION.
12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR
REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES,
INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING
OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED
TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY
YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER
PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE
POSSIBILITY OF SUCH DAMAGES.
END OF TERMS AND CONDITIONS
How to Apply These Terms to Your New Programs
If you develop a new program, and you want it to be of the greatest
possible use to the public, the best way to achieve this is to make it
free software which everyone can redistribute and change under these terms.
To do so, attach the following notices to the program. It is safest
to attach them to the start of each source file to most effectively
convey the exclusion of warranty; and each file should have at least
the "copyright" line and a pointer to where the full notice is found.
<one line to give the program's name and a brief idea of what it does.>
Copyright (C) <year> <name of author>
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
Also add information on how to contact you by electronic and paper mail.
If the program is interactive, make it output a short notice like this
when it starts in an interactive mode:
Gnomovision version 69, Copyright (C) year name of author
Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
This is free software, and you are welcome to redistribute it
under certain conditions; type `show c' for details.
The hypothetical commands `show w' and `show c' should show the appropriate
parts of the General Public License. Of course, the commands you use may
be called something other than `show w' and `show c'; they could even be
mouse-clicks or menu items--whatever suits your program.
You should also get your employer (if you work as a programmer) or your
school, if any, to sign a "copyright disclaimer" for the program, if
necessary. Here is a sample; alter the names:
Yoyodyne, Inc., hereby disclaims all copyright interest in the program
`Gnomovision' (which makes passes at compilers) written by James Hacker.
<signature of Ty Coon>, 1 April 1989
Ty Coon, President of Vice
This General Public License does not permit incorporating your program into
proprietary programs. If your program is a subroutine library, you may
consider it more useful to permit linking proprietary applications with the
library. If this is what you want to do, use the GNU Library General
Public License instead of this License.
+16
View File
@@ -0,0 +1,16 @@
freedict-editor (0.2) unstable; urgency=low
* src/callbacks.c: Fix SourceForge Bug #1757935 - Segmentation fault in
set_view_labels_visible - Thanks to Emanoil Kotsev
-- Michael Bunk <michael.bunk@gmail.com> Sat, 21 Jul 2007 23:55:24 +0200
freedict-editor (0.1) unstable; urgency=low
* Initial Release.
-- Michael M. Bunk <michael.bunk@gmail.com> Fri, 6 Jan 2006 00:30:08 +0100
* Started project.
-- Michael M. Bunk <michael.bunk@gmail.com> 8 Jan 2005
+229
View File
@@ -0,0 +1,229 @@
Copyright (C) 1994, 1995, 1996, 1999, 2000, 2001, 2002 Free Software
Foundation, Inc.
This file is free documentation; the Free Software Foundation gives
unlimited permission to copy, distribute and modify it.
Basic Installation
==================
These are generic installation instructions.
The `configure' shell script attempts to guess correct values for
various system-dependent variables used during compilation. It uses
those values to create a `Makefile' in each directory of the package.
It may also create one or more `.h' files containing system-dependent
definitions. Finally, it creates a shell script `config.status' that
you can run in the future to recreate the current configuration, and a
file `config.log' containing compiler output (useful mainly for
debugging `configure').
It can also use an optional file (typically called `config.cache'
and enabled with `--cache-file=config.cache' or simply `-C') that saves
the results of its tests to speed up reconfiguring. (Caching is
disabled by default to prevent problems with accidental use of stale
cache files.)
If you need to do unusual things to compile the package, please try
to figure out how `configure' could check whether to do them, and mail
diffs or instructions to the address given in the `README' so they can
be considered for the next release. If you are using the cache, and at
some point `config.cache' contains results you don't want to keep, you
may remove or edit it.
The file `configure.ac' (or `configure.in') is used to create
`configure' by a program called `autoconf'. You only need
`configure.ac' if you want to change it or regenerate `configure' using
a newer version of `autoconf'.
The simplest way to compile this package is:
1. `cd' to the directory containing the package's source code and type
`./configure' to configure the package for your system. If you're
using `csh' on an old version of System V, you might need to type
`sh ./configure' instead to prevent `csh' from trying to execute
`configure' itself.
Running `configure' takes awhile. While running, it prints some
messages telling which features it is checking for.
2. Type `make' to compile the package.
3. Optionally, type `make check' to run any self-tests that come with
the package.
4. Type `make install' to install the programs and any data files and
documentation.
5. You can remove the program binaries and object files from the
source code directory by typing `make clean'. To also remove the
files that `configure' created (so you can compile the package for
a different kind of computer), type `make distclean'. There is
also a `make maintainer-clean' target, but that is intended mainly
for the package's developers. If you use it, you may have to get
all sorts of other programs in order to regenerate files that came
with the distribution.
Compilers and Options
=====================
Some systems require unusual options for compilation or linking that
the `configure' script does not know about. Run `./configure --help'
for details on some of the pertinent environment variables.
You can give `configure' initial values for configuration parameters
by setting variables in the command line or in the environment. Here
is an example:
./configure CC=c89 CFLAGS=-O2 LIBS=-lposix
*Note Defining Variables::, for more details.
Compiling For Multiple Architectures
====================================
You can compile the package for more than one kind of computer at the
same time, by placing the object files for each architecture in their
own directory. To do this, you must use a version of `make' that
supports the `VPATH' variable, such as GNU `make'. `cd' to the
directory where you want the object files and executables to go and run
the `configure' script. `configure' automatically checks for the
source code in the directory that `configure' is in and in `..'.
If you have to use a `make' that does not support the `VPATH'
variable, you have to compile the package for one architecture at a
time in the source code directory. After you have installed the
package for one architecture, use `make distclean' before reconfiguring
for another architecture.
Installation Names
==================
By default, `make install' will install the package's files in
`/usr/local/bin', `/usr/local/man', etc. You can specify an
installation prefix other than `/usr/local' by giving `configure' the
option `--prefix=PATH'.
You can specify separate installation prefixes for
architecture-specific files and architecture-independent files. If you
give `configure' the option `--exec-prefix=PATH', the package will use
PATH as the prefix for installing programs and libraries.
Documentation and other data files will still use the regular prefix.
In addition, if you use an unusual directory layout you can give
options like `--bindir=PATH' to specify different values for particular
kinds of files. Run `configure --help' for a list of the directories
you can set and what kinds of files go in them.
If the package supports it, you can cause programs to be installed
with an extra prefix or suffix on their names by giving `configure' the
option `--program-prefix=PREFIX' or `--program-suffix=SUFFIX'.
Optional Features
=================
Some packages pay attention to `--enable-FEATURE' options to
`configure', where FEATURE indicates an optional part of the package.
They may also pay attention to `--with-PACKAGE' options, where PACKAGE
is something like `gnu-as' or `x' (for the X Window System). The
`README' should mention any `--enable-' and `--with-' options that the
package recognizes.
For packages that use the X Window System, `configure' can usually
find the X include and library files automatically, but if it doesn't,
you can use the `configure' options `--x-includes=DIR' and
`--x-libraries=DIR' to specify their locations.
Specifying the System Type
==========================
There may be some features `configure' cannot figure out
automatically, but needs to determine by the type of machine the package
will run on. Usually, assuming the package is built to be run on the
_same_ architectures, `configure' can figure that out, but if it prints
a message saying it cannot guess the machine type, give it the
`--build=TYPE' option. TYPE can either be a short name for the system
type, such as `sun4', or a canonical name which has the form:
CPU-COMPANY-SYSTEM
where SYSTEM can have one of these forms:
OS KERNEL-OS
See the file `config.sub' for the possible values of each field. If
`config.sub' isn't included in this package, then this package doesn't
need to know the machine type.
If you are _building_ compiler tools for cross-compiling, you should
use the `--target=TYPE' option to select the type of system they will
produce code for.
If you want to _use_ a cross compiler, that generates code for a
platform different from the build platform, you should specify the
"host" platform (i.e., that on which the generated programs will
eventually be run) with `--host=TYPE'.
Sharing Defaults
================
If you want to set default values for `configure' scripts to share,
you can create a site shell script called `config.site' that gives
default values for variables like `CC', `cache_file', and `prefix'.
`configure' looks for `PREFIX/share/config.site' if it exists, then
`PREFIX/etc/config.site' if it exists. Or, you can set the
`CONFIG_SITE' environment variable to the location of the site script.
A warning: not all `configure' scripts look for a site script.
Defining Variables
==================
Variables not defined in a site shell script can be set in the
environment passed to `configure'. However, some packages may run
configure again during the build, and the customized values of these
variables may be lost. In order to avoid this problem, you should set
them in the `configure' command line, using `VAR=value'. For example:
./configure CC=/usr/local2/bin/gcc
will cause the specified gcc to be used as the C compiler (unless it is
overridden in the site shell script).
`configure' Invocation
======================
`configure' recognizes the following options to control how it
operates.
`--help'
`-h'
Print a summary of the options to `configure', and exit.
`--version'
`-V'
Print the version of Autoconf used to generate the `configure'
script, and exit.
`--cache-file=FILE'
Enable the cache: use and save the results of the tests in FILE,
traditionally `config.cache'. FILE defaults to `/dev/null' to
disable caching.
`--config-cache'
`-C'
Alias for `--cache-file=config.cache'.
`--quiet'
`--silent'
`-q'
Do not print messages saying which checks are being made. To
suppress all normal output, redirect it to `/dev/null' (any error
messages will still be shown).
`--srcdir=DIR'
Look for the package's source code in directory DIR. Usually
`configure' can determine that directory automatically.
`configure' also accepts some other, not widely useful, options. Run
`configure --help' for more details.
+42
View File
@@ -0,0 +1,42 @@
## Process this file with automake to produce Makefile.in
SUBDIRS = src po data help pixmaps
EXTRA_DIST = \
autogen.sh \
freedict-editor.gladep \
help/C/imipa.c \
help/C/make-ipatable.pl \
help/C/make-ipatable.sh \
help/C/view.sh \
intltool-extract.in \
intltool-merge.in \
intltool-update.in
DISTCLEANFILES = po/stamp-it intltool-extract intltool-merge intltool-update
dist_pkgdata_DATA = freedict-editor.glade
#install-data-local:
# @$(NORMAL_INSTALL)
# if test -d $(srcdir)/pixmaps; then \
# $(mkinstalldirs) $(DESTDIR)$(datadir)/pixmaps/$(PACKAGE); \
# for pixmap in $(srcdir)/pixmaps/*; do \
# if test -f $$pixmap; then \
# $(INSTALL_DATA) $$pixmap $(DESTDIR)$(datadir)/pixmaps/$(PACKAGE); \
# fi \
# done \
# fi
dist-hook:
if test -d pixmaps; then \
mkdir $(distdir)/pixmaps; \
for pixmap in pixmaps/*; do \
if test -f $$pixmap; then \
cp -p $$pixmap $(distdir)/pixmaps; \
fi \
done \
fi
deb:
debuild
View File
Whitespace-only changes.
+67
View File
@@ -0,0 +1,67 @@
TODO
----
scrollkeeper-update in debian/postinst & postrm
> I like the program. The only caveat is that it depends
> too much on gnome. If you can remove this dependence...
I can try to make some Gnome libs optional (thinking of gconf and libgtkhtml presently).
gtksourceview
a GTK widget which extends the standard GTK text widgets implementing syntax
highlighting, automatic indentation, and other typical features of source
editors.
dpkg -l "*gtksource*"
sanity
trimmable spaces
entry with only form child(ren)
typology compliance
put sanity checks into free standing stylesheet/Makefile.common target/tool
automatically add to new/changed entry
editer name/email/timestamp
source reference (to new entry only)
how to encode?
additional optionmenu <form type="">
type classifies form as simple, compound etc.
(phrase, abbreviation, wrong spelling?)
phrase subtype: idiom
XML DBs as Backend(s) inste4ad of file in memory
Apache Xindice: Java, slow
exist: same
pgxml: didn't try yet, postgres is promising
db2: proprietary
create & install a .desktop file to appear in windowmanager menus
integrate mime-info files nicely
headwords as <oref?> in examples
etymology fields
google (api) integration to resolve spelling and idiom frequency questions?
guile / embedded perl support?
list editor in http://www.tei-c.org/Software/
KHASI
-----
Por kha te bang,
por kha te pang,
sat syllang ka pit
ba lah ioh khun rit.
put into teiHeader or front/back matter
common gender type uses article 'i'
use of ï and ñ, n g
check: only allowed chars in headwords (no c!)
everything that starts with
jing should be fem noun
pyn should be verb and have a xr to verb without pyn
-> configurable Xpath expressions for the sanity checks
+160
View File
@@ -0,0 +1,160 @@
#!/bin/sh
# Run this to generate all the initial makefiles, etc.
srcdir=`dirname $0`
test -z "$srcdir" && srcdir=.
DIE=0
if [ -n "$GNOME2_DIR" ]; then
ACLOCAL_FLAGS="-I $GNOME2_DIR/share/aclocal $ACLOCAL_FLAGS"
LD_LIBRARY_PATH="$GNOME2_DIR/lib:$LD_LIBRARY_PATH"
PATH="$GNOME2_DIR/bin:$PATH"
export PATH
export LD_LIBRARY_PATH
fi
(test -f $srcdir/configure.in) || {
echo -n "**Error**: Directory "\`$srcdir\'" does not look like the"
echo " top-level package directory"
exit 1
}
(autoconf --version) < /dev/null > /dev/null 2>&1 || {
echo
echo "**Error**: You must have \`autoconf' installed."
echo "Download the appropriate package for your distribution,"
echo "or get the source tarball at ftp://ftp.gnu.org/pub/gnu/"
DIE=1
}
(grep "^AC_PROG_INTLTOOL" $srcdir/configure.in >/dev/null) && {
(intltoolize --version) < /dev/null > /dev/null 2>&1 || {
echo
echo "**Error**: You must have \`intltool' installed."
echo "You can get it from:"
echo " ftp://ftp.gnome.org/pub/GNOME/"
DIE=1
}
}
(grep "^AM_PROG_XML_I18N_TOOLS" $srcdir/configure.in >/dev/null) && {
(xml-i18n-toolize --version) < /dev/null > /dev/null 2>&1 || {
echo
echo "**Error**: You must have \`xml-i18n-toolize' installed."
echo "You can get it from:"
echo " ftp://ftp.gnome.org/pub/GNOME/"
DIE=1
}
}
(grep "^AM_PROG_LIBTOOL" $srcdir/configure.in >/dev/null) && {
(libtool --version) < /dev/null > /dev/null 2>&1 || {
echo
echo "**Error**: You must have \`libtool' installed."
echo "You can get it from: ftp://ftp.gnu.org/pub/gnu/"
DIE=1
}
}
(grep "^AM_GLIB_GNU_GETTEXT" $srcdir/configure.in >/dev/null) && {
(grep "sed.*POTFILES" $srcdir/configure.in) > /dev/null || \
(glib-gettextize --version) < /dev/null > /dev/null 2>&1 || {
echo
echo "**Error**: You must have \`glib' installed."
echo "You can get it from: ftp://ftp.gtk.org/pub/gtk"
DIE=1
}
}
(automake --version) < /dev/null > /dev/null 2>&1 || {
echo
echo "**Error**: You must have \`automake' installed."
echo "You can get it from: ftp://ftp.gnu.org/pub/gnu/"
DIE=1
NO_AUTOMAKE=yes
}
# if no automake, don't bother testing for aclocal
test -n "$NO_AUTOMAKE" || (aclocal --version) < /dev/null > /dev/null 2>&1 || {
echo
echo "**Error**: Missing \`aclocal'. The version of \`automake'"
echo "installed doesn't appear recent enough."
echo "You can get automake from ftp://ftp.gnu.org/pub/gnu/"
DIE=1
}
if test "$DIE" -eq 1; then
exit 1
fi
if test -z "$*"; then
echo "**Warning**: I am going to run \`configure' with no arguments."
echo "If you wish to pass any to it, please specify them on the"
echo \`$0\'" command line."
echo
fi
case $CC in
xlc )
am_opt=--include-deps;;
esac
for coin in `find $srcdir -path $srcdir/CVS -prune -o -name configure.in -print`
do
dr=`dirname $coin`
if test -f $dr/NO-AUTO-GEN; then
echo skipping $dr -- flagged as no auto-gen
else
echo processing $dr
( cd $dr
aclocalinclude="$ACLOCAL_FLAGS"
if grep "^AM_GLIB_GNU_GETTEXT" configure.in >/dev/null; then
echo "Creating $dr/aclocal.m4 ..."
test -r $dr/aclocal.m4 || touch $dr/aclocal.m4
echo "Running glib-gettextize... Ignore non-fatal messages."
echo "no" | glib-gettextize --force --copy
echo "Making $dr/aclocal.m4 writable ..."
test -r $dr/aclocal.m4 && chmod u+w $dr/aclocal.m4
fi
if grep "^AC_PROG_INTLTOOL" configure.in >/dev/null; then
echo "Running intltoolize..."
intltoolize --copy --force --automake
fi
if grep "^AM_PROG_XML_I18N_TOOLS" configure.in >/dev/null; then
echo "Running xml-i18n-toolize..."
xml-i18n-toolize --copy --force --automake
fi
if grep "^AM_PROG_LIBTOOL" configure.in >/dev/null; then
if test -z "$NO_LIBTOOLIZE" ; then
echo "Running libtoolize..."
libtoolize --force --copy
fi
fi
echo "Running aclocal $aclocalinclude ..."
aclocal $aclocalinclude
if grep "^AM_CONFIG_HEADER" configure.in >/dev/null; then
echo "Running autoheader..."
autoheader
fi
echo "Running automake --gnu $am_opt ..."
automake --add-missing --gnu $am_opt
echo "Running autoconf ..."
autoconf
)
fi
done
conf_flags="--enable-maintainer-mode"
if test x$NOCONFIGURE = x; then
echo Running $srcdir/configure $conf_flags "$@" ...
$srcdir/configure $conf_flags "$@" \
&& echo Now type \`make\' to compile. || exit 1
else
echo Skipping configure process.
fi
+50
View File
@@ -0,0 +1,50 @@
dnl Process this file with autoconf to produce a configure script.
AC_INIT([FreeDict Editor],[0.2],[freedict-beta@lists.sourceforge.net])
AM_INIT_AUTOMAKE([-Wall dist-bzip2 no-dist-gzip])
AC_REVISION($Revision$)
AM_MAINTAINER_MODE
AM_CONFIG_HEADER(config.h)
AC_ISC_POSIX
AC_PROG_CC(colorgcc)
AC_HEADER_STDC
pkg_modules="libgnomeui-2.0 libxml-2.0 libgtkhtml-3.14 libxslt libbonoboui-2.0 gconf-2.0 libglade-2.0"
PKG_CHECK_MODULES(PACKAGE, [$pkg_modules])
AC_SUBST(PACKAGE_CFLAGS)
AC_SUBST(PACKAGE_LIBS)
AC_CHECK_LIB(aspell,new_aspell_config,,[AC_MSG_WARN([Some version of aspell, preferably >=0.50.3 is recommended])])
AC_PROG_INTLTOOL([0.23])
GETTEXT_PACKAGE=freedict-editor
AC_SUBST(GETTEXT_PACKAGE)
AC_DEFINE_UNQUOTED(GETTEXT_PACKAGE,"$GETTEXT_PACKAGE", [A parameter for bindtextdomain () & co])
ALL_LINGUAS="kha de zh fr"
AM_GLIB_GNU_GETTEXT
AC_CHECK_FUNCS([gettimeofday])
AC_CHECK_FUNCS([memset])
AC_CHECK_FUNCS([strchr])
AC_CHECK_FUNCS([strstr])
AC_CHECK_FUNCS([memmove])
AC_CHECK_HEADERS([sys/time.h])
AC_C_CONST
AC_HEADER_TIME
AC_STRUCT_TM
AC_C_INLINE
AC_OUTPUT([
Makefile
src/Makefile
po/Makefile.in
data/Makefile
help/Makefile
help/C/Makefile
pixmaps/Makefile
])
+5
View File
@@ -0,0 +1,5 @@
dist_pkgdata_DATA = entry-template.xml la1-la2.template.tei
mimeinfodir = $(datarootdir)/mime-info
dist_mimeinfo_DATA = freedict.keys freedict.mime
+14
View File
@@ -0,0 +1,14 @@
<entry>
<form>
<orth></orth>
</form>
<gramGrp>
<pos></pos>
<gen></gen>
</gramGrp>
<trans>
<tr></tr>
<gen></gen>
</trans>
</entry>
+9
View File
@@ -0,0 +1,9 @@
application/x-tei-xml
default_application_id=freedict-editor
description=Text Encoding Initiative XML Document
icon_filename=/opt/gnome/share/icons/tei_document.png
default_action_type=application
open=freedict-editor %f
category=Documents/XML
short_list_application_user_removals=
short_list_application_user_additions=freedict-editor
+3
View File
@@ -0,0 +1,3 @@
application/x-tei-xml
ext: tei
description: Text Encoding Initiative XML Document
+92
View File
@@ -0,0 +1,92 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE TEI.2
PUBLIC "-//TEI P4//DTD Main Document Type//EN"
"http://www.tei-c.org/Guidelines/DTD/tei2.dtd" [
<!ENTITY % TEI.dictionaries "INCLUDE">
<!ENTITY % TEI.XML "INCLUDE">
<!ENTITY % TEI.linking "INCLUDE">
<!ATTLIST xptr url CDATA #IMPLIED>
<!ATTLIST xref url CDATA #IMPLIED>
]>
<TEI.2>
<teiHeader>
<fileDesc>
<titleStmt>
<title>Language1-Language2 FreeDict Dictionary</title>
<respStmt>
<resp>Author</resp>
<name>Someone Somewho &lt;her@email.address&gt;</name>
</respStmt>
<respStmt>
<resp>Maintainer</resp>
<name>Someone Else &lt;or@the-same.example.com&gt;</name>
</respStmt>
</titleStmt>
<editionStmt>
<edition>0.1</edition>
</editionStmt>
<extent>less than 1000 headwords</extent>
<publicationStmt>
<publisher>FreeDict</publisher>
<availability>
<p>GNU GENERAL PUBLIC LICENSE</p>
</availability>
<date>200X</date>
<pubPlace>http://freedict.org/</pubPlace>
</publicationStmt>
<seriesStmt>
<title>free dictionaries</title>
</seriesStmt>
<notesStmt>
<note type="status">new dictionary project</note>
<note>Thanks to ...</note>
</notesStmt>
<sourceDesc>
<p>Home: <xptr url="http://www.somewhere.in.cspace/"/></p>
</sourceDesc>
</fileDesc>
<encodingDesc>
<projectDesc>
<p>This dictionary comes to you through nice people making it
available for free and for good. It might be part of the FreeDict project,
http://www.freedict.org / http://freedict.de. This
project aims to make available many translating dictionaries
for free. Your contributions are welcome!</p>
</projectDesc>
</encodingDesc>
<revisionDesc>
<change>
<date>200x-mm-dd</date>
<respStmt><name>Someone</name></respStmt>
<item>Start</item>
</change>
<change>
<date>2005-04-02</date>
<respStmt><name>Peter Gossner / Michael Bunk</name></respStmt>
<item>FreeDict Dictionary TEI XML Template V0.1</item>
</change>
</revisionDesc>
</teiHeader>
<text>
<body>
<!-- Sample Entry -->
<entry>
<form>
<orth>A</orth>
<orth>a</orth>
</form>
<gramGrp>
<pos>n</pos>
<gen>m</gen>
</gramGrp>
<sense>
<def>the first letter of the Language1 Alphabet</def>
</sense>
</entry>
</body>
</text>
</TEI.2>
+13
View File
@@ -0,0 +1,13 @@
freedict-editor (0.2) unstable; urgency=low
* New Release: see ../ChangeLog
* better packaging (proper section set, built using pbuilder, added
forgotten build-dependency scrollkeeper)
-- Michael M. Bunk <michael.bunk@gmail.com> Sat, 28 Jul 2007 13:30:10 +0200
freedict-editor (0.1) unstable; urgency=low
* Initial Release.
-- Michael M. Bunk <michael.bunk@gmail.com> Fri, 6 Jan 2006 00:30:08 +0100
+1
View File
@@ -0,0 +1 @@
4
+26
View File
@@ -0,0 +1,26 @@
Source: freedict-editor
Section: editors
Priority: optional
Maintainer: Michael M. Bunk <michael.bunk@gmail.com>
Build-Depends: debhelper (>= 4.0.0), autotools-dev,
libxslt-dev, libgtkhtml3.14-dev, libglade2-dev, scrollkeeper,
libaspell-dev (>=0.50.3), xmlto
Standards-Version: 3.7.2
Package: freedict-editor
Architecture: any
Depends: ${shlibs:Depends}, ${misc:Depends}
Recommends: yelp, xbase-clients, gv
Suggests: tei
Description: Editor for Text Encoding Initiative XML dictionaries
Entries are made from a subset of the format defined by TEI, Version 4,
Chapter 12 "Print Dictionaries". Supports
* online validation
* XPath to flexibly select entries to be edited
* easy, user friendly Form View to edit entries
* fallback to plain XML editing
* entering pronunciation in IPA characters
* HTML preview of formatted entries
* sanity checks and a spell checker
.
TEI XML is used in the FreeDict project to store bilingual dictionary data.
+26
View File
@@ -0,0 +1,26 @@
This is freedict-editor, written and maintained by Michael M. Bunk <michael.bunk@gmail.com>
on Fri, 6 Jan 2006 00:30:08 +0100.
The original source can always be found at:
http://sourceforge.net/cvs/?group_id=1419
Copyright (C) 2005-2006 Michael Bunk
License:
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this package; if not, write to the Free Software
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
On Debian systems, the complete text of the GNU General
Public License can be found in `/usr/share/common-licenses/GPL'.
+1
View File
@@ -0,0 +1 @@
README
@@ -0,0 +1,22 @@
Document: freedict-editor
Title: Debian freedict-editor Manual
Author: <insert document author here>
Abstract: This manual describes what freedict-editor is
and how it can be used to
manage online manuals on Debian systems.
Section: unknown
Format: debiandoc-sgml
Files: /usr/share/doc/freedict-editor/freedict-editor.sgml.gz
Format: postscript
Files: /usr/share/doc/freedict-editor/freedict-editor.ps.gz
Format: text
Files: /usr/share/doc/freedict-editor/freedict-editor.text.gz
Format: HTML
Index: /usr/share/doc/freedict-editor/html/index.html
Files: /usr/share/doc/freedict-editor/html/*.html
+148
View File
@@ -0,0 +1,148 @@
<?xml version='1.0' encoding='ISO-8859-1'?>
<!DOCTYPE refentry PUBLIC "-//OASIS//DTD DocBook XML V4.2//EN"
"http://www.oasis-open.org/docbook/xml/4.2/docbookx.dtd" [
<!--
Process this file with an XSLT processor: `xsltproc \
-''-nonet /usr/share/sgml/docbook/stylesheet/xsl/nwalsh/\
manpages/docbook.xsl manpage.dbk'. A manual page
<package>.<section> will be generated. You may view the
manual page with: nroff -man <package>.<section> | less'. A
typical entry in a Makefile or Makefile.am is:
DB2MAN=/usr/share/sgml/docbook/stylesheet/xsl/nwalsh/\
manpages/docbook.xsl
XP=xsltproc -''-nonet
manpage.1: manpage.dbk
$(XP) $(DB2MAN) $<
The xsltproc binary is found in the xsltproc package. The
XSL files are in docbook-xsl. Please remember that if you
create the nroff version in one of the debian/rules file
targets (such as build), you will need to include xsltproc
and docbook-xsl in your Build-Depends control field.
-->
<!-- Fill in your name for FIRSTNAME and SURNAME. -->
<!ENTITY dhfirstname "<firstname>FIRSTNAME</firstname>">
<!ENTITY dhsurname "<surname>SURNAME</surname>">
<!-- Please adjust the date whenever revising the manpage. -->
<!ENTITY dhdate "<date>Januar 6, 2006</date>">
<!-- SECTION should be 1-8, maybe w/ subsection other parameters are
allowed: see man(7), man(1). -->
<!ENTITY dhsection "<manvolnum>SECTION</manvolnum>">
<!ENTITY dhemail "<email>michael.bunk@gmail.com</email>">
<!ENTITY dhusername "micha">
<!ENTITY dhucpackage "<refentrytitle>FREEDICT-EDITOR</refentrytitle>">
<!ENTITY dhpackage "freedict-editor">
<!ENTITY debian "<productname>Debian</productname>">
<!ENTITY gnu "<acronym>GNU</acronym>">
<!ENTITY gpl "&gnu; <acronym>GPL</acronym>">
]>
<refentry>
<refentryinfo>
<address>
&dhemail;
</address>
<author>
&dhfirstname;
&dhsurname;
</author>
<copyright>
<year>2003</year>
<holder>&dhusername;</holder>
</copyright>
&dhdate;
</refentryinfo>
<refmeta>
&dhucpackage;
&dhsection;
</refmeta>
<refnamediv>
<refname>&dhpackage;</refname>
<refpurpose>program to do something</refpurpose>
</refnamediv>
<refsynopsisdiv>
<cmdsynopsis>
<command>&dhpackage;</command>
<arg><option>-e <replaceable>this</replaceable></option></arg>
<arg><option>--example <replaceable>that</replaceable></option></arg>
</cmdsynopsis>
</refsynopsisdiv>
<refsect1>
<title>DESCRIPTION</title>
<para>This manual page documents briefly the
<command>&dhpackage;</command> and <command>bar</command>
commands.</para>
<para>This manual page was written for the &debian; distribution
because the original program does not have a manual page.
Instead, it has documentation in the &gnu;
<application>Info</application> format; see below.</para>
<para><command>&dhpackage;</command> is a program that...</para>
</refsect1>
<refsect1>
<title>OPTIONS</title>
<para>These programs follow the usual &gnu; command line syntax,
with long options starting with two dashes (`-'). A summary of
options is included below. For a complete description, see the
<application>Info</application> files.</para>
<variablelist>
<varlistentry>
<term><option>-h</option>
<option>--help</option>
</term>
<listitem>
<para>Show summary of options.</para>
</listitem>
</varlistentry>
<varlistentry>
<term><option>-v</option>
<option>--version</option>
</term>
<listitem>
<para>Show version of program.</para>
</listitem>
</varlistentry>
</variablelist>
</refsect1>
<refsect1>
<title>SEE ALSO</title>
<para>bar (1), baz (1).</para>
<para>The programs are documented fully by <citetitle>The Rise and
Fall of a Fooish Bar</citetitle> available via the
<application>Info</application> system.</para>
</refsect1>
<refsect1>
<title>AUTHOR</title>
<para>This manual page was written by &dhusername; &dhemail; for
the &debian; system (but may be used by others). Permission is
granted to copy, distribute and/or modify this document under
the terms of the &gnu; General Public License, Version 2 any
later version published by the Free Software Foundation.
</para>
<para>
On Debian systems, the complete text of the GNU General Public
License can be found in /usr/share/common-licenses/GPL.
</para>
</refsect1>
</refentry>
+2
View File
@@ -0,0 +1,2 @@
?package(freedict-editor):needs="X11" section="Apps/Text"\
title="FreeDict-Editor" command="/usr/bin/freedict-editor"
+79
View File
@@ -0,0 +1,79 @@
#!/usr/bin/make -f
# -*- makefile -*-
#export DH_VERBOSE=1
# These are used for cross-compiling and for saving the configure script
# from having to guess our platform (since we know it already)
DEB_HOST_GNU_TYPE ?= $(shell dpkg-architecture -qDEB_HOST_GNU_TYPE)
DEB_BUILD_GNU_TYPE ?= $(shell dpkg-architecture -qDEB_BUILD_GNU_TYPE)
CFLAGS = -Wall -g
ifneq (,$(findstring noopt,$(DEB_BUILD_OPTIONS)))
CFLAGS += -O0
else
CFLAGS += -O2
endif
config.status: configure
dh_testdir
CFLAGS="$(CFLAGS) -Wl,-z,defs" ./configure --host=$(DEB_HOST_GNU_TYPE) --build=$(DEB_BUILD_GNU_TYPE) --prefix=/usr --mandir=\$${prefix}/share/man --infodir=\$${prefix}/share/info
build: build-stamp
build-stamp: config.status
dh_testdir
$(MAKE)
#docbook-to-man debian/freedict-editor.sgml > freedict-editor.1
touch build-stamp
clean:
dh_testdir
dh_testroot
rm -f build-stamp
[ ! -f Makefile ] || $(MAKE) distclean
ifneq "$(wildcard /usr/share/misc/config.sub)" ""
rm config.sub
cp -f /usr/share/misc/config.sub config.sub
endif
ifneq "$(wildcard /usr/share/misc/config.guess)" ""
rm config.guess
cp -f /usr/share/misc/config.guess config.guess
endif
dh_clean
install: build
dh_testdir
dh_testroot
dh_clean -k
dh_installdirs
$(MAKE) install DESTDIR=$(CURDIR)/debian/freedict-editor
binary-indep: build install
binary-arch: build install
dh_testdir
dh_testroot
dh_installchangelogs ChangeLog
dh_installdocs
dh_installexamples
dh_installmenu
# dh_installmime
dh_installman
dh_link
dh_strip
dh_compress
dh_fixperms
dh_installdeb
dh_shlibdeps
dh_gencontrol
dh_md5sums
dh_builddeb
binary: binary-indep binary-arch
.PHONY: build clean binary-indep binary-arch binary install
+4
View File
@@ -0,0 +1,4 @@
# See uscan(1)
version=3
# debscripts >= 2.9
http://sf.net/freedict/freedict-editor-(.*)\.tar\.bz2
+472
View File
@@ -0,0 +1,472 @@
#! /bin/sh
# depcomp - compile a program generating dependencies as side-effects
# Copyright 1999, 2000 Free Software Foundation, Inc.
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2, or (at your option)
# any later version.
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
# 02111-1307, USA.
# As a special exception to the GNU General Public License, if you
# distribute this file as part of a program that contains a
# configuration script generated by Autoconf, you may include it under
# the same distribution terms that you use for the rest of that program.
# Originally written by Alexandre Oliva <oliva@dcc.unicamp.br>.
if test -z "$depmode" || test -z "$source" || test -z "$object"; then
echo "depcomp: Variables source, object and depmode must be set" 1>&2
exit 1
fi
# `libtool' can also be set to `yes' or `no'.
if test -z "$depfile"; then
base=`echo "$object" | sed -e 's,^.*/,,' -e 's,\.\([^.]*\)$,.P\1,'`
dir=`echo "$object" | sed 's,/.*$,/,'`
if test "$dir" = "$object"; then
dir=
fi
# FIXME: should be _deps on DOS.
depfile="$dir.deps/$base"
fi
tmpdepfile=${tmpdepfile-`echo "$depfile" | sed 's/\.\([^.]*\)$/.T\1/'`}
rm -f "$tmpdepfile"
# Some modes work just like other modes, but use different flags. We
# parameterize here, but still list the modes in the big case below,
# to make depend.m4 easier to write. Note that we *cannot* use a case
# here, because this file can only contain one case statement.
if test "$depmode" = hp; then
# HP compiler uses -M and no extra arg.
gccflag=-M
depmode=gcc
fi
if test "$depmode" = dashXmstdout; then
# This is just like dashmstdout with a different argument.
dashmflag=-xM
depmode=dashmstdout
fi
case "$depmode" in
gcc3)
## gcc 3 implements dependency tracking that does exactly what
## we want. Yay! Note: for some reason libtool 1.4 doesn't like
## it if -MD -MP comes after the -MF stuff. Hmm.
"$@" -MT "$object" -MD -MP -MF "$tmpdepfile"
stat=$?
if test $stat -eq 0; then :
else
rm -f "$tmpdepfile"
exit $stat
fi
mv "$tmpdepfile" "$depfile"
;;
gcc)
## There are various ways to get dependency output from gcc. Here's
## why we pick this rather obscure method:
## - Don't want to use -MD because we'd like the dependencies to end
## up in a subdir. Having to rename by hand is ugly.
## (We might end up doing this anyway to support other compilers.)
## - The DEPENDENCIES_OUTPUT environment variable makes gcc act like
## -MM, not -M (despite what the docs say).
## - Using -M directly means running the compiler twice (even worse
## than renaming).
if test -z "$gccflag"; then
gccflag=-MD,
fi
"$@" -Wp,"$gccflag$tmpdepfile"
stat=$?
if test $stat -eq 0; then :
else
rm -f "$tmpdepfile"
exit $stat
fi
rm -f "$depfile"
echo "$object : \\" > "$depfile"
alpha=ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz
## The second -e expression handles DOS-style file names with drive letters.
sed -e 's/^[^:]*: / /' \
-e 's/^['$alpha']:\/[^:]*: / /' < "$tmpdepfile" >> "$depfile"
## This next piece of magic avoids the `deleted header file' problem.
## The problem is that when a header file which appears in a .P file
## is deleted, the dependency causes make to die (because there is
## typically no way to rebuild the header). We avoid this by adding
## dummy dependencies for each header file. Too bad gcc doesn't do
## this for us directly.
tr ' ' '
' < "$tmpdepfile" |
## Some versions of gcc put a space before the `:'. On the theory
## that the space means something, we add a space to the output as
## well.
## Some versions of the HPUX 10.20 sed can't process this invocation
## correctly. Breaking it into two sed invocations is a workaround.
sed -e 's/^\\$//' -e '/^$/d' -e '/:$/d' | sed -e 's/$/ :/' >> "$depfile"
rm -f "$tmpdepfile"
;;
hp)
# This case exists only to let depend.m4 do its work. It works by
# looking at the text of this script. This case will never be run,
# since it is checked for above.
exit 1
;;
sgi)
if test "$libtool" = yes; then
"$@" "-Wp,-MDupdate,$tmpdepfile"
else
"$@" -MDupdate "$tmpdepfile"
fi
stat=$?
if test $stat -eq 0; then :
else
rm -f "$tmpdepfile"
exit $stat
fi
rm -f "$depfile"
if test -f "$tmpdepfile"; then # yes, the sourcefile depend on other files
echo "$object : \\" > "$depfile"
# Clip off the initial element (the dependent). Don't try to be
# clever and replace this with sed code, as IRIX sed won't handle
# lines with more than a fixed number of characters (4096 in
# IRIX 6.2 sed, 8192 in IRIX 6.5). We also remove comment lines;
# the IRIX cc adds comments like `#:fec' to the end of the
# dependency line.
tr ' ' '
' < "$tmpdepfile" \
| sed -e 's/^.*\.o://' -e 's/#.*$//' -e '/^$/ d' | \
tr '
' ' ' >> $depfile
echo >> $depfile
# The second pass generates a dummy entry for each header file.
tr ' ' '
' < "$tmpdepfile" \
| sed -e 's/^.*\.o://' -e 's/#.*$//' -e '/^$/ d' -e 's/$/:/' \
>> $depfile
else
# The sourcefile does not contain any dependencies, so just
# store a dummy comment line, to avoid errors with the Makefile
# "include basename.Plo" scheme.
echo "#dummy" > "$depfile"
fi
rm -f "$tmpdepfile"
;;
aix)
# The C for AIX Compiler uses -M and outputs the dependencies
# in a .u file. This file always lives in the current directory.
# Also, the AIX compiler puts `$object:' at the start of each line;
# $object doesn't have directory information.
stripped=`echo "$object" | sed -e 's,^.*/,,' -e 's/\(.*\)\..*$/\1/'`
tmpdepfile="$stripped.u"
outname="$stripped.o"
if test "$libtool" = yes; then
"$@" -Wc,-M
else
"$@" -M
fi
stat=$?
if test $stat -eq 0; then :
else
rm -f "$tmpdepfile"
exit $stat
fi
if test -f "$tmpdepfile"; then
# Each line is of the form `foo.o: dependent.h'.
# Do two passes, one to just change these to
# `$object: dependent.h' and one to simply `dependent.h:'.
sed -e "s,^$outname:,$object :," < "$tmpdepfile" > "$depfile"
sed -e "s,^$outname: \(.*\)$,\1:," < "$tmpdepfile" >> "$depfile"
else
# The sourcefile does not contain any dependencies, so just
# store a dummy comment line, to avoid errors with the Makefile
# "include basename.Plo" scheme.
echo "#dummy" > "$depfile"
fi
rm -f "$tmpdepfile"
;;
icc)
# Intel's C compiler understands `-MD -MF file'. However on
# icc -MD -MF foo.d -c -o sub/foo.o sub/foo.c
# ICC 7.0 will fill foo.d with something like
# foo.o: sub/foo.c
# foo.o: sub/foo.h
# which is wrong. We want:
# sub/foo.o: sub/foo.c
# sub/foo.o: sub/foo.h
# sub/foo.c:
# sub/foo.h:
# ICC 7.1 will output
# foo.o: sub/foo.c sub/foo.h
# and will wrap long lines using \ :
# foo.o: sub/foo.c ... \
# sub/foo.h ... \
# ...
"$@" -MD -MF "$tmpdepfile"
stat=$?
if test $stat -eq 0; then :
else
rm -f "$tmpdepfile"
exit $stat
fi
rm -f "$depfile"
# Each line is of the form `foo.o: dependent.h',
# or `foo.o: dep1.h dep2.h \', or ` dep3.h dep4.h \'.
# Do two passes, one to just change these to
# `$object: dependent.h' and one to simply `dependent.h:'.
sed "s,^[^:]*:,$object :," < "$tmpdepfile" > "$depfile"
# Some versions of the HPUX 10.20 sed can't process this invocation
# correctly. Breaking it into two sed invocations is a workaround.
sed 's,^[^:]*: \(.*\)$,\1,;s/^\\$//;/^$/d;/:$/d' < "$tmpdepfile" |
sed -e 's/$/ :/' >> "$depfile"
rm -f "$tmpdepfile"
;;
tru64)
# The Tru64 compiler uses -MD to generate dependencies as a side
# effect. `cc -MD -o foo.o ...' puts the dependencies into `foo.o.d'.
# At least on Alpha/Redhat 6.1, Compaq CCC V6.2-504 seems to put
# dependencies in `foo.d' instead, so we check for that too.
# Subdirectories are respected.
dir=`echo "$object" | sed -e 's|/[^/]*$|/|'`
test "x$dir" = "x$object" && dir=
base=`echo "$object" | sed -e 's|^.*/||' -e 's/\.o$//' -e 's/\.lo$//'`
if test "$libtool" = yes; then
tmpdepfile1="$dir.libs/$base.lo.d"
tmpdepfile2="$dir.libs/$base.d"
"$@" -Wc,-MD
else
tmpdepfile1="$dir$base.o.d"
tmpdepfile2="$dir$base.d"
"$@" -MD
fi
stat=$?
if test $stat -eq 0; then :
else
rm -f "$tmpdepfile1" "$tmpdepfile2"
exit $stat
fi
if test -f "$tmpdepfile1"; then
tmpdepfile="$tmpdepfile1"
else
tmpdepfile="$tmpdepfile2"
fi
if test -f "$tmpdepfile"; then
sed -e "s,^.*\.[a-z]*:,$object:," < "$tmpdepfile" > "$depfile"
# That's a space and a tab in the [].
sed -e 's,^.*\.[a-z]*:[ ]*,,' -e 's,$,:,' < "$tmpdepfile" >> "$depfile"
else
echo "#dummy" > "$depfile"
fi
rm -f "$tmpdepfile"
;;
#nosideeffect)
# This comment above is used by automake to tell side-effect
# dependency tracking mechanisms from slower ones.
dashmstdout)
# Important note: in order to support this mode, a compiler *must*
# always write the proprocessed file to stdout, regardless of -o.
"$@" || exit $?
# Remove the call to Libtool.
if test "$libtool" = yes; then
while test $1 != '--mode=compile'; do
shift
done
shift
fi
# Remove `-o $object'.
IFS=" "
for arg
do
case $arg in
-o)
shift
;;
$object)
shift
;;
*)
set fnord "$@" "$arg"
shift # fnord
shift # $arg
;;
esac
done
test -z "$dashmflag" && dashmflag=-M
# Require at least two characters before searching for `:'
# in the target name. This is to cope with DOS-style filenames:
# a dependency such as `c:/foo/bar' could be seen as target `c' otherwise.
"$@" $dashmflag |
sed 's:^[ ]*[^: ][^:][^:]*\:[ ]*:'"$object"'\: :' > "$tmpdepfile"
rm -f "$depfile"
cat < "$tmpdepfile" > "$depfile"
tr ' ' '
' < "$tmpdepfile" | \
## Some versions of the HPUX 10.20 sed can't process this invocation
## correctly. Breaking it into two sed invocations is a workaround.
sed -e 's/^\\$//' -e '/^$/d' -e '/:$/d' | sed -e 's/$/ :/' >> "$depfile"
rm -f "$tmpdepfile"
;;
dashXmstdout)
# This case only exists to satisfy depend.m4. It is never actually
# run, as this mode is specially recognized in the preamble.
exit 1
;;
makedepend)
"$@" || exit $?
# Remove any Libtool call
if test "$libtool" = yes; then
while test $1 != '--mode=compile'; do
shift
done
shift
fi
# X makedepend
shift
cleared=no
for arg in "$@"; do
case $cleared in
no)
set ""; shift
cleared=yes ;;
esac
case "$arg" in
-D*|-I*)
set fnord "$@" "$arg"; shift ;;
# Strip any option that makedepend may not understand. Remove
# the object too, otherwise makedepend will parse it as a source file.
-*|$object)
;;
*)
set fnord "$@" "$arg"; shift ;;
esac
done
obj_suffix="`echo $object | sed 's/^.*\././'`"
touch "$tmpdepfile"
${MAKEDEPEND-makedepend} -o"$obj_suffix" -f"$tmpdepfile" "$@"
rm -f "$depfile"
cat < "$tmpdepfile" > "$depfile"
sed '1,2d' "$tmpdepfile" | tr ' ' '
' | \
## Some versions of the HPUX 10.20 sed can't process this invocation
## correctly. Breaking it into two sed invocations is a workaround.
sed -e 's/^\\$//' -e '/^$/d' -e '/:$/d' | sed -e 's/$/ :/' >> "$depfile"
rm -f "$tmpdepfile" "$tmpdepfile".bak
;;
cpp)
# Important note: in order to support this mode, a compiler *must*
# always write the proprocessed file to stdout.
"$@" || exit $?
# Remove the call to Libtool.
if test "$libtool" = yes; then
while test $1 != '--mode=compile'; do
shift
done
shift
fi
# Remove `-o $object'.
IFS=" "
for arg
do
case $arg in
-o)
shift
;;
$object)
shift
;;
*)
set fnord "$@" "$arg"
shift # fnord
shift # $arg
;;
esac
done
"$@" -E |
sed -n '/^# [0-9][0-9]* "\([^"]*\)".*/ s:: \1 \\:p' |
sed '$ s: \\$::' > "$tmpdepfile"
rm -f "$depfile"
echo "$object : \\" > "$depfile"
cat < "$tmpdepfile" >> "$depfile"
sed < "$tmpdepfile" '/^$/d;s/^ //;s/ \\$//;s/$/ :/' >> "$depfile"
rm -f "$tmpdepfile"
;;
msvisualcpp)
# Important note: in order to support this mode, a compiler *must*
# always write the proprocessed file to stdout, regardless of -o,
# because we must use -o when running libtool.
"$@" || exit $?
IFS=" "
for arg
do
case "$arg" in
"-Gm"|"/Gm"|"-Gi"|"/Gi"|"-ZI"|"/ZI")
set fnord "$@"
shift
shift
;;
*)
set fnord "$@" "$arg"
shift
shift
;;
esac
done
"$@" -E |
sed -n '/^#line [0-9][0-9]* "\([^"]*\)"/ s::echo "`cygpath -u \\"\1\\"`":p' | sort | uniq > "$tmpdepfile"
rm -f "$depfile"
echo "$object : \\" > "$depfile"
. "$tmpdepfile" | sed 's% %\\ %g' | sed -n '/^\(.*\)$/ s:: \1 \\:p' >> "$depfile"
echo " " >> "$depfile"
. "$tmpdepfile" | sed 's% %\\ %g' | sed -n '/^\(.*\)$/ s::\1\::p' >> "$depfile"
rm -f "$tmpdepfile"
;;
none)
exec "$@"
;;
*)
echo "Unknown depmode $depmode" 1>&2
exit 1
;;
esac
exit 0
File diff suppressed because it is too large. Load diff
+9
View File
@@ -0,0 +1,9 @@
<?xml version="1.0" standalone="no"?> <!--*- mode: xml -*-->
<!DOCTYPE glade-project SYSTEM "http://glade.gnome.org/glade-project-2.0.dtd">
<glade-project>
<name>FreeDict-Editor</name>
<program_name>freedict-editor</program_name>
<output_build_files>FALSE</output_build_files>
<gnome_help_support>TRUE</gnome_help_support>
</glade-project>
+15
View File
@@ -0,0 +1,15 @@
#figdir = figures
figdir =
docname = freedict-editor
lang = C
omffile = freedict-editor-C.omf
entities = legal.xml ipa-table.xml
include $(top_srcdir)/xmldocs.make
dist-hook: app-dist-hook
# generate HTML version of the docs for the freedict.org website
.PHONY: html
XMLTO_OPTS = -m customise-docbook.xsl
html-local: freedict-editor.xml
xmlto $(XMLTO_OPTS) -o html html freedict-editor.xml
perl -pi -e 's/index\.html#/#/g;' html/index.html
@@ -0,0 +1,53 @@
<?xml version='1.0'?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
version='1.0'
xmlns="http://www.w3.org/TR/xhtml1/transitional"
exclude-result-prefixes="#default">
<!-- Makes <programlisting> (but not <literallayout>) have a shade -->
<xsl:param name="shade.verbatim" select="1"/>
<!-- Images for warnings, notes etc.
<xsl:param name="admon.graphics" select="1"/>
<xsl:param name="toc.max.depth" select="2"/>
<xsl:param name="make.valid.html" select="1"/> -->
<!-- a serifless font is set in the stylesheet
<xsl:param name="html.stylesheet" select="'style.css'"></xsl:param> -->
<!--
Control generation of tables of contents.
The original value for the <book> elements was:
book toc,title,figure,table,example,equation
So we turned of the lists of figures and examples here.
-->
<xsl:param name="generate.toc">
appendix toc,title
article/appendix nop
article toc,title
book toc,title,table,equation
chapter toc,title
part toc,title
preface toc,title
qandadiv toc
qandaset toc
reference toc,title
sect1 toc
sect2 toc
sect3 toc
sect4 toc
sect5 toc
section toc
set toc,title
</xsl:param>
<!-- Depth to which sections should be chunked -->
<xsl:param name="chunk.section.depth" select="0"></xsl:param>
</xsl:stylesheet>
@@ -0,0 +1,30 @@
<?xml version="1.0" encoding="UTF-8"?>
<omf>
<resource>
<creator>
michael.bunk@gmail.com (Michael Bunk)
</creator>
<maintainer>
michael.bunk@gmail.com (Michael Bunk)
</maintainer>
<title>
FreeDict-Editor Manual V0.1
</title>
<date>
2005-03-23
</date>
<version identifier="0.1" date="2005-03-23" description="First Version"/>
<subject category="GNOME|Applications"/>
<description>
User manual for the FreeDict-Editor.
</description>
<type>
user's guide
</type>
<format mime="text/xml" dtd="-//OASIS//DTD DocBook XML V4.1.2//EN"/>
<identifier url="freedict.xml"/>
<language code="C"/>
<relation seriesid="b8082230-5987-4b7f-b26e-f7a219ed8a1b"/>
<rights type="GNU FDL" license.version="1.1" holder="Michael Bunk"/>
</resource>
</omf>
File diff suppressed because it is too large. Load diff
+181
View File
@@ -0,0 +1,181 @@
/* GTK - The GIMP Toolkit
* Copyright (C) 2000 Red Hat Software
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Library General Public
* License as published by the Free Software Foundation; either
* version 2 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Library General Public License for more details.
*
* You should have received a copy of the GNU Library General Public
* License along with this library; if not, write to the
* Free Software Foundation, Inc., 59 Temple Place - Suite 330,
* Boston, MA 02111-1307, USA.
*
* Author: Owen Taylor <otaylor@redhat.com>
*
*/
#include <config.h>
#include <string.h>
#include <gdk/gdkkeysyms.h>
#include "gtk/gtkintl.h"
#include "gtk/gtkimcontextsimple.h"
#include "gtk/gtkimmodule.h"
GType type_ipa = 0;
static void ipa_class_init (GtkIMContextSimpleClass *class);
static void ipa_init (GtkIMContextSimple *im_context);
static void
ipa_register_type (GTypeModule *module)
{
static const GTypeInfo object_info =
{
sizeof (GtkIMContextSimpleClass),
(GBaseInitFunc) NULL,
(GBaseFinalizeFunc) NULL,
(GClassInitFunc) ipa_class_init,
NULL, /* class_finalize */
NULL, /* class_data */
sizeof (GtkIMContextSimple),
0,
(GInstanceInitFunc) ipa_init,
};
type_ipa =
g_type_module_register_type (module,
GTK_TYPE_IM_CONTEXT_SIMPLE,
"GtkIMContextIpa",
&object_info, 0);
}
/* The sequences here match the sequences used in the emacs quail
* mode cryllic-translit; they allow entering all characters
* in iso-8859-5
*/
static guint16 ipa_compose_seqs[] = {
GDK_ampersand, 0, 0, 0, 0, 0x263, /* LATIN SMALL LETTER GAMMA */
GDK_apostrophe, 0, 0, 0, 0, 0x2C8, /* MODIFIER LETTER VERTICAL LINE */
GDK_slash, GDK_apostrophe, 0, 0, 0, 0x2CA, /* MODIFIER LETTER ACUTE ACCENT */
GDK_slash, GDK_slash, 0, 0, 0, 0x02F, /* SOLIDUS */
GDK_slash, GDK_3, 0, 0, 0, 0x25B, /* LATIN SMALL LETTER OPEN E */
GDK_slash, GDK_A, 0, 0, 0, 0x252, /* LATIN LETTER TURNED ALPHA */
GDK_slash, GDK_R, 0, 0, 0, 0x281, /* LATIN LETTER SMALL CAPITAL INVERTED R */
GDK_slash, GDK_a, 0, 0, 0, 0x250, /* LATIN SMALL LETTER TURNED A */
GDK_slash, GDK_c, 0, 0, 0, 0x254, /* LATIN SMALL LETTER OPEN O */
GDK_slash, GDK_e, 0, 0, 0, 0x259, /* LATIN SMALL LETTER SCHWA */
GDK_slash, GDK_h, 0, 0, 0, 0x265, /* LATIN SMALL LETTER TURNED H */
GDK_slash, GDK_m, 0, 0, 0, 0x26F, /* LATIN SMALL LETTER TURNED M */
GDK_slash, GDK_r, 0, 0, 0, 0x279, /* LATIN SMALL LETTER TURNED R */
GDK_slash, GDK_v, 0, 0, 0, 0x28C, /* LATIN SMALL LETTER TURNED V */
GDK_slash, GDK_w, 0, 0, 0, 0x28D, /* LATIN SMALL LETTER TURNED W */
GDK_slash, GDK_y, 0, 0, 0, 0x28E, /* LATIN SMALL LETTER TRUEND Y*/
GDK_3, 0, 0, 0, 0, 0x292, /* LATIN SMALL LETTER EZH */
GDK_colon, 0, 0, 0, 0, 0x2D0, /* MODIFIER LETTER TRIANGULAR COLON */
GDK_A, 0, 0, 0, 0, 0x251, /* LATIN SMALL LETTER ALPHA */
GDK_E, 0, 0, 0, 0, 0x25B, /* LATIN SMALL LETTER OPEN E */
GDK_I, 0, 0, 0, 0, 0x26A, /* LATIN LETTER SMALL CAPITAL I */
GDK_L, 0, 0, 0, 0, 0x29F, /* LATIN LETTER SMALL CAPITAL L */
GDK_M, 0, 0, 0, 0, 0x28D, /* LATIN SMALL LETTER TURNED W */
GDK_O, 0, 0, 0, 0, 0x04F, /* LATIN LETTER SMALL CAPITAL OE */
GDK_O, GDK_E, 0, 0, 0, 0x276, /* LATIN LETTER SMALL CAPITAL OE */
GDK_R, 0, 0, 0, 0, 0x280, /* LATIN LETTER SMALL CAPITAL R */
GDK_U, 0, 0, 0, 0, 0x28A, /* LATIN SMALL LETTER UPSILON */
GDK_Y, 0, 0, 0, 0, 0x28F, /* LATIN LETTER SMALL CAPITAL Y */
GDK_grave, 0, 0, 0, 0, 0x2CC, /* MODIFIER LETTER LOW VERTICAL LINE */
GDK_a, 0, 0, 0, 0, 0x061, /* LATIN SMALL LETTER A */
GDK_a, GDK_e, 0, 0, 0, 0x0E6, /* LATIN SMALL LETTER AE */
GDK_c, 0, 0, 0, 0, 0x063, /* LATIN SMALL LETTER C */
GDK_c, GDK_comma, 0, 0, 0, 0x0E7, /* LATIN SMALL LETTER C WITH CEDILLA */
GDK_d, 0, 0, 0, 0, 0x064, /* LATIN SMALL LETTER E */
GDK_d, GDK_apostrophe, 0, 0, 0, 0x064, /* LATIN SMALL LETTER D */
GDK_d, GDK_h, 0, 0, 0, 0x0F0, /* LATIN SMALL LETTER ETH */
GDK_e, 0, 0, 0, 0, 0x065, /* LATIN SMALL LETTER E */
GDK_e, GDK_minus, 0, 0, 0, 0x25A, /* LATIN SMALL LETTER SCHWA WITH HOOK */
GDK_e, GDK_bar, 0, 0, 0, 0x25A, /* LATIN SMALL LETTER SCHWA WITH HOOK */
GDK_g, 0, 0, 0, 0, 0x067, /* LATIN SMALL LETTER G */
GDK_g, GDK_n, 0, 0, 0, 0x272, /* LATIN SMALL LETTER N WITH LEFT HOOK */
GDK_i, 0, 0, 0, 0, 0x069, /* LATIN SMALL LETTER I */
GDK_i, GDK_minus, 0, 0, 0, 0x268, /* LATIN SMALL LETTER I WITH STROKE */
GDK_n, 0, 0, 0, 0, 0x06e, /* LATIN SMALL LETTER N */
GDK_n, GDK_g, 0, 0, 0, 0x14B, /* LATIN SMALL LETTER ENG */
GDK_o, 0, 0, 0, 0, 0x06f, /* LATIN SMALL LETTER O */
GDK_o, GDK_minus, 0, 0, 0, 0x275, /* LATIN LETTER BARRED O */
GDK_o, GDK_slash, 0, 0, 0, 0x0F8, /* LATIN SMALL LETTER O WITH STROKE */
GDK_o, GDK_e, 0, 0, 0, 0x153, /* LATIN SMALL LIGATURE OE */
GDK_o, GDK_bar, 0, 0, 0, 0x251, /* LATIN SMALL LETTER ALPHA */
GDK_s, 0, 0, 0, 0, 0x073, /* LATIN SMALL LETTER_ESH */
GDK_s, GDK_h, 0, 0, 0, 0x283, /* LATIN SMALL LETTER_ESH */
GDK_t, 0, 0, 0, 0, 0x074, /* LATIN SMALL LETTER T */
GDK_t, GDK_h, 0, 0, 0, 0x3B8, /* GREEK SMALL LETTER THETA */
GDK_u, 0, 0, 0, 0, 0x075, /* LATIN SMALL LETTER U */
GDK_u, GDK_minus, 0, 0, 0, 0x289, /* LATIN LETTER U BAR */
GDK_z, 0, 0, 0, 0, 0x07A, /* LATIN SMALL LETTER Z */
GDK_z, GDK_h, 0, 0, 0, 0x292, /* LATIN SMALL LETTER EZH */
GDK_bar, GDK_o, 0, 0, 0, 0x252, /* LATIN LETTER TURNED ALPHA */
GDK_asciitilde, 0, 0, 0, 0, 0x303, /* COMBINING TILDE */
};
static void
ipa_class_init (GtkIMContextSimpleClass *class)
{
}
static void
ipa_init (GtkIMContextSimple *im_context)
{
gtk_im_context_simple_add_table (im_context,
ipa_compose_seqs,
4,
G_N_ELEMENTS (ipa_compose_seqs) / (4 + 2));
}
static const GtkIMContextInfo ipa_info = {
"ipa", /* ID */
N_("IPA"), /* Human readable name */
GETTEXT_PACKAGE, /* Translation domain */
GTK_LOCALEDIR, /* Dir for bindtextdomain (not strictly needed for "gtk+") */
"" /* Languages for which this module is the default */
};
static const GtkIMContextInfo *info_list[] = {
&ipa_info
};
void
im_module_init (GTypeModule *module)
{
ipa_register_type (module);
}
void
im_module_exit (void)
{
}
void
im_module_list (const GtkIMContextInfo ***contexts,
int *n_contexts)
{
*contexts = info_list;
*n_contexts = G_N_ELEMENTS (info_list);
}
GtkIMContext *
im_module_create (const gchar *context_id)
{
if (strcmp (context_id, "ipa") == 0)
return g_object_new (type_ipa, NULL);
else
return NULL;
}
+60
View File
@@ -0,0 +1,60 @@
<row><entry>GDK_ampersand</entry><entry>&#x263;</entry><entry>LATIN SMALL LETTER GAMMA</entry></row>
<row><entry>GDK_apostrophe</entry><entry>&#x2C8;</entry><entry>MODIFIER LETTER VERTICAL LINE</entry></row>
<row><entry>GDK_slash + GDK_apostrophe</entry><entry>&#x2CA;</entry><entry>MODIFIER LETTER ACUTE ACCENT</entry></row>
<row><entry>GDK_slash + GDK_slash</entry><entry>&#x02F;</entry><entry>SOLIDUS</entry></row>
<row><entry>GDK_slash + GDK_3</entry><entry>&#x25B;</entry><entry>LATIN SMALL LETTER OPEN E</entry></row>
<row><entry>GDK_slash + GDK_A</entry><entry>&#x252;</entry><entry>LATIN LETTER TURNED ALPHA</entry></row>
<row><entry>GDK_slash + GDK_R</entry><entry>&#x281;</entry><entry>LATIN LETTER SMALL CAPITAL INVERTED R</entry></row>
<row><entry>GDK_slash + GDK_a</entry><entry>&#x250;</entry><entry>LATIN SMALL LETTER TURNED A</entry></row>
<row><entry>GDK_slash + GDK_c</entry><entry>&#x254;</entry><entry>LATIN SMALL LETTER OPEN O</entry></row>
<row><entry>GDK_slash + GDK_e</entry><entry>&#x259;</entry><entry>LATIN SMALL LETTER SCHWA</entry></row>
<row><entry>GDK_slash + GDK_h</entry><entry>&#x265;</entry><entry>LATIN SMALL LETTER TURNED H</entry></row>
<row><entry>GDK_slash + GDK_m</entry><entry>&#x26F;</entry><entry>LATIN SMALL LETTER TURNED M</entry></row>
<row><entry>GDK_slash + GDK_r</entry><entry>&#x279;</entry><entry>LATIN SMALL LETTER TURNED R</entry></row>
<row><entry>GDK_slash + GDK_v</entry><entry>&#x28C;</entry><entry>LATIN SMALL LETTER TURNED V</entry></row>
<row><entry>GDK_slash + GDK_w</entry><entry>&#x28D;</entry><entry>LATIN SMALL LETTER TURNED W</entry></row>
<row><entry>GDK_slash + GDK_y</entry><entry>&#x28E;</entry><entry>LATIN SMALL LETTER TRUEND Y</entry></row>
<row><entry>GDK_3</entry><entry>&#x292;</entry><entry>LATIN SMALL LETTER EZH</entry></row>
<row><entry>GDK_colon</entry><entry>&#x2D0;</entry><entry>MODIFIER LETTER TRIANGULAR COLON</entry></row>
<row><entry>GDK_A</entry><entry>&#x251;</entry><entry>LATIN SMALL LETTER ALPHA</entry></row>
<row><entry>GDK_E</entry><entry>&#x25B;</entry><entry>LATIN SMALL LETTER OPEN E</entry></row>
<row><entry>GDK_I</entry><entry>&#x26A;</entry><entry>LATIN LETTER SMALL CAPITAL I</entry></row>
<row><entry>GDK_L</entry><entry>&#x29F;</entry><entry>LATIN LETTER SMALL CAPITAL L</entry></row>
<row><entry>GDK_M</entry><entry>&#x28D;</entry><entry>LATIN SMALL LETTER TURNED W</entry></row>
<row><entry>GDK_O</entry><entry>&#x04F;</entry><entry>LATIN LETTER SMALL CAPITAL OE</entry></row>
<row><entry>GDK_O + GDK_E</entry><entry>&#x276;</entry><entry>LATIN LETTER SMALL CAPITAL OE</entry></row>
<row><entry>GDK_R</entry><entry>&#x280;</entry><entry>LATIN LETTER SMALL CAPITAL R</entry></row>
<row><entry>GDK_U</entry><entry>&#x28A;</entry><entry>LATIN SMALL LETTER UPSILON</entry></row>
<row><entry>GDK_Y</entry><entry>&#x28F;</entry><entry>LATIN LETTER SMALL CAPITAL Y</entry></row>
<row><entry>GDK_grave</entry><entry>&#x2CC;</entry><entry>MODIFIER LETTER LOW VERTICAL LINE</entry></row>
<row><entry>GDK_a</entry><entry>&#x061;</entry><entry>LATIN SMALL LETTER A</entry></row>
<row><entry>GDK_a + GDK_e</entry><entry>&#x0E6;</entry><entry>LATIN SMALL LETTER AE</entry></row>
<row><entry>GDK_c</entry><entry>&#x063;</entry><entry>LATIN SMALL LETTER C</entry></row>
<row><entry>GDK_c + GDK_comma</entry><entry>&#x0E7;</entry><entry>LATIN SMALL LETTER C WITH CEDILLA</entry></row>
<row><entry>GDK_d</entry><entry>&#x064;</entry><entry>LATIN SMALL LETTER E</entry></row>
<row><entry>GDK_d + GDK_apostrophe</entry><entry>&#x064;</entry><entry>LATIN SMALL LETTER D</entry></row>
<row><entry>GDK_d + GDK_h</entry><entry>&#x0F0;</entry><entry>LATIN SMALL LETTER ETH</entry></row>
<row><entry>GDK_e</entry><entry>&#x065;</entry><entry>LATIN SMALL LETTER E</entry></row>
<row><entry>GDK_e + GDK_minus</entry><entry>&#x25A;</entry><entry>LATIN SMALL LETTER SCHWA WITH HOOK</entry></row>
<row><entry>GDK_e + GDK_bar</entry><entry>&#x25A;</entry><entry>LATIN SMALL LETTER SCHWA WITH HOOK</entry></row>
<row><entry>GDK_g</entry><entry>&#x067;</entry><entry>LATIN SMALL LETTER G</entry></row>
<row><entry>GDK_g + GDK_n</entry><entry>&#x272;</entry><entry>LATIN SMALL LETTER N WITH LEFT HOOK</entry></row>
<row><entry>GDK_i</entry><entry>&#x069;</entry><entry>LATIN SMALL LETTER I</entry></row>
<row><entry>GDK_i + GDK_minus</entry><entry>&#x268;</entry><entry>LATIN SMALL LETTER I WITH STROKE</entry></row>
<row><entry>GDK_n</entry><entry>&#x06e;</entry><entry>LATIN SMALL LETTER N</entry></row>
<row><entry>GDK_n + GDK_g</entry><entry>&#x14B;</entry><entry>LATIN SMALL LETTER ENG</entry></row>
<row><entry>GDK_o</entry><entry>&#x06f;</entry><entry>LATIN SMALL LETTER O</entry></row>
<row><entry>GDK_o + GDK_minus</entry><entry>&#x275;</entry><entry>LATIN LETTER BARRED O</entry></row>
<row><entry>GDK_o + GDK_slash</entry><entry>&#x0F8;</entry><entry>LATIN SMALL LETTER O WITH STROKE</entry></row>
<row><entry>GDK_o + GDK_e</entry><entry>&#x153;</entry><entry>LATIN SMALL LIGATURE OE</entry></row>
<row><entry>GDK_o + GDK_bar</entry><entry>&#x251;</entry><entry>LATIN SMALL LETTER ALPHA</entry></row>
<row><entry>GDK_s</entry><entry>&#x073;</entry><entry>LATIN SMALL LETTER_ESH</entry></row>
<row><entry>GDK_s + GDK_h</entry><entry>&#x283;</entry><entry>LATIN SMALL LETTER_ESH</entry></row>
<row><entry>GDK_t</entry><entry>&#x074;</entry><entry>LATIN SMALL LETTER T</entry></row>
<row><entry>GDK_t + GDK_h</entry><entry>&#x3B8;</entry><entry>GREEK SMALL LETTER THETA</entry></row>
<row><entry>GDK_u</entry><entry>&#x075;</entry><entry>LATIN SMALL LETTER U</entry></row>
<row><entry>GDK_u + GDK_minus</entry><entry>&#x289;</entry><entry>LATIN LETTER U BAR</entry></row>
<row><entry>GDK_z</entry><entry>&#x07A;</entry><entry>LATIN SMALL LETTER Z</entry></row>
<row><entry>GDK_z + GDK_h</entry><entry>&#x292;</entry><entry>LATIN SMALL LETTER EZH</entry></row>
<row><entry>GDK_bar + GDK_o</entry><entry>&#x252;</entry><entry>LATIN LETTER TURNED ALPHA</entry></row>
<row><entry>GDK_asciitilde</entry><entry>&#x303;</entry><entry>COMBINING TILDE</entry></row>
+76
View File
@@ -0,0 +1,76 @@
<legalnotice id="legalnotice">
<para>
Permission is granted to copy, distribute and/or modify this
document under the terms of the GNU Free Documentation
License (GFDL), Version 1.1 or any later version published
by the Free Software Foundation with no Invariant Sections,
no Front-Cover Texts, and no Back-Cover Texts. You can find
a copy of the GFDL at this <ulink type="help"
url="ghelp:fdl">link</ulink> or in the file COPYING-DOCS
distributed with this manual.
</para>
<para> This manual is part of a collection of GNOME manuals
distributed under the GFDL. If you want to distribute this
manual separately from the collection, you can do so by
adding a copy of the license to the manual, as described in
section 6 of the license.
</para>
<para>
Many of the names used by companies to distinguish their
products and services are claimed as trademarks. Where those
names appear in any GNOME documentation, and the members of
the GNOME Documentation Project are made aware of those
trademarks, then the names are in capital letters or initial
capital letters.
</para>
<para>
DOCUMENT AND MODIFIED VERSIONS OF THE DOCUMENT ARE PROVIDED
UNDER THE TERMS OF THE GNU FREE DOCUMENTATION LICENSE
WITH THE FURTHER UNDERSTANDING THAT:
<orderedlist>
<listitem>
<para>DOCUMENT IS PROVIDED ON AN "AS IS" BASIS,
WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR
IMPLIED, INCLUDING, WITHOUT LIMITATION, WARRANTIES
THAT THE DOCUMENT OR MODIFIED VERSION OF THE
DOCUMENT IS FREE OF DEFECTS MERCHANTABLE, FIT FOR
A PARTICULAR PURPOSE OR NON-INFRINGING. THE ENTIRE
RISK AS TO THE QUALITY, ACCURACY, AND PERFORMANCE
OF THE DOCUMENT OR MODIFIED VERSION OF THE
DOCUMENT IS WITH YOU. SHOULD ANY DOCUMENT OR
MODIFIED VERSION PROVE DEFECTIVE IN ANY RESPECT,
YOU (NOT THE INITIAL WRITER, AUTHOR OR ANY
CONTRIBUTOR) ASSUME THE COST OF ANY NECESSARY
SERVICING, REPAIR OR CORRECTION. THIS DISCLAIMER
OF WARRANTY CONSTITUTES AN ESSENTIAL PART OF THIS
LICENSE. NO USE OF ANY DOCUMENT OR MODIFIED
VERSION OF THE DOCUMENT IS AUTHORIZED HEREUNDER
EXCEPT UNDER THIS DISCLAIMER; AND
</para>
</listitem>
<listitem>
<para>UNDER NO CIRCUMSTANCES AND UNDER NO LEGAL
THEORY, WHETHER IN TORT (INCLUDING NEGLIGENCE),
CONTRACT, OR OTHERWISE, SHALL THE AUTHOR,
INITIAL WRITER, ANY CONTRIBUTOR, OR ANY
DISTRIBUTOR OF THE DOCUMENT OR MODIFIED VERSION
OF THE DOCUMENT, OR ANY SUPPLIER OF ANY OF SUCH
PARTIES, BE LIABLE TO ANY PERSON FOR ANY
DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR
CONSEQUENTIAL DAMAGES OF ANY CHARACTER
INCLUDING, WITHOUT LIMITATION, DAMAGES FOR LOSS
OF GOODWILL, WORK STOPPAGE, COMPUTER FAILURE OR
MALFUNCTION, OR ANY AND ALL OTHER DAMAGES OR
LOSSES ARISING OUT OF OR RELATING TO USE OF THE
DOCUMENT AND MODIFIED VERSIONS OF THE DOCUMENT,
EVEN IF SUCH PARTY SHALL HAVE BEEN INFORMED OF
THE POSSIBILITY OF SUCH DAMAGES.
</para>
</listitem>
</orderedlist>
</para>
</legalnotice>
+21
View File
@@ -0,0 +1,21 @@
#!/usr/bin/perl
$recognized = 0;
while(<>)
{
# example line in '':
# ' GDK_slash, GDK_3, 0, 0, 0, 0x25B, /* LATIN SMALL LETTER OPEN E */'
if(/^ (GDK_\w+),\s+(0|GDK_\w+),\s+0,\s+0,\s+0,\s+0x([\w]+),\s+\/\* ([\w ]+)\*\/$/)
{
print "\t<row><entry>$1";
print " + $2" if($2 ne "0");
$ucode = $3;
$description = $4;
$description =~ s/ $//;
print "</entry><entry>&#x$ucode;</entry><entry>$description</entry></row>\n";
$recognized++;
next;
}
print STDERR "$.: Unrecognized line '$_'\n";
}
print STDERR "Recognized $recognized lines.\n";
+2
View File
@@ -0,0 +1,2 @@
grep imipa.c -Pe " GDK_.*\*/" | ./make-ipatable.pl > ipa-table.xml
+1
View File
@@ -0,0 +1 @@
yelp ghelp:`pwd`/freedict-editor.xml &
+3
View File
@@ -0,0 +1,3 @@
## Process this file with automake to produce Makefile.in.
SUBDIRS = C
+294
View File
@@ -0,0 +1,294 @@
#!/bin/sh
#
# install - install a program, script, or datafile
#
# This originates from X11R5 (mit/util/scripts/install.sh), which was
# later released in X11R6 (xc/config/util/install.sh) with the
# following copyright and license.
#
# Copyright (C) 1994 X Consortium
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to
# deal in the Software without restriction, including without limitation the
# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
# sell copies of the Software, and to permit persons to whom the Software is
# furnished to do so, subject to the following conditions:
#
# The above copyright notice and this permission notice shall be included in
# all copies or substantial portions of the Software.
#
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
# X CONSORTIUM BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
# AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNEC-
# TION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
#
# Except as contained in this notice, the name of the X Consortium shall not
# be used in advertising or otherwise to promote the sale, use or other deal-
# ings in this Software without prior written authorization from the X Consor-
# tium.
#
#
# FSF changes to this file are in the public domain.
#
# Calling this script install-sh is preferred over install.sh, to prevent
# `make' implicit rules from creating a file called install from it
# when there is no Makefile.
#
# This script is compatible with the BSD install script, but was written
# from scratch. It can only install one file at a time, a restriction
# shared with many OS's install programs.
# set DOITPROG to echo to test this script
# Don't use :- since 4.3BSD and earlier shells don't like it.
doit="${DOITPROG-}"
# put in absolute paths if you don't have them in your path; or use env. vars.
mvprog="${MVPROG-mv}"
cpprog="${CPPROG-cp}"
chmodprog="${CHMODPROG-chmod}"
chownprog="${CHOWNPROG-chown}"
chgrpprog="${CHGRPPROG-chgrp}"
stripprog="${STRIPPROG-strip}"
rmprog="${RMPROG-rm}"
mkdirprog="${MKDIRPROG-mkdir}"
transformbasename=""
transform_arg=""
instcmd="$mvprog"
chmodcmd="$chmodprog 0755"
chowncmd=""
chgrpcmd=""
stripcmd=""
rmcmd="$rmprog -f"
mvcmd="$mvprog"
src=""
dst=""
dir_arg=""
while [ x"$1" != x ]; do
case $1 in
-c) instcmd=$cpprog
shift
continue;;
-d) dir_arg=true
shift
continue;;
-m) chmodcmd="$chmodprog $2"
shift
shift
continue;;
-o) chowncmd="$chownprog $2"
shift
shift
continue;;
-g) chgrpcmd="$chgrpprog $2"
shift
shift
continue;;
-s) stripcmd=$stripprog
shift
continue;;
-t=*) transformarg=`echo $1 | sed 's/-t=//'`
shift
continue;;
-b=*) transformbasename=`echo $1 | sed 's/-b=//'`
shift
continue;;
*) if [ x"$src" = x ]
then
src=$1
else
# this colon is to work around a 386BSD /bin/sh bug
:
dst=$1
fi
shift
continue;;
esac
done
if [ x"$src" = x ]
then
echo "$0: no input file specified" >&2
exit 1
else
:
fi
if [ x"$dir_arg" != x ]; then
dst=$src
src=""
if [ -d "$dst" ]; then
instcmd=:
chmodcmd=""
else
instcmd=$mkdirprog
fi
else
# Waiting for this to be detected by the "$instcmd $src $dsttmp" command
# might cause directories to be created, which would be especially bad
# if $src (and thus $dsttmp) contains '*'.
if [ -f "$src" ] || [ -d "$src" ]
then
:
else
echo "$0: $src does not exist" >&2
exit 1
fi
if [ x"$dst" = x ]
then
echo "$0: no destination specified" >&2
exit 1
else
:
fi
# If destination is a directory, append the input filename; if your system
# does not like double slashes in filenames, you may need to add some logic
if [ -d "$dst" ]
then
dst=$dst/`basename "$src"`
else
:
fi
fi
## this sed command emulates the dirname command
dstdir=`echo "$dst" | sed -e 's,[^/]*$,,;s,/$,,;s,^$,.,'`
# Make sure that the destination directory exists.
# this part is taken from Noah Friedman's mkinstalldirs script
# Skip lots of stat calls in the usual case.
if [ ! -d "$dstdir" ]; then
defaultIFS='
'
IFS="${IFS-$defaultIFS}"
oIFS=$IFS
# Some sh's can't handle IFS=/ for some reason.
IFS='%'
set - `echo "$dstdir" | sed -e 's@/@%@g' -e 's@^%@/@'`
IFS=$oIFS
pathcomp=''
while [ $# -ne 0 ] ; do
pathcomp=$pathcomp$1
shift
if [ ! -d "$pathcomp" ] ;
then
$mkdirprog "$pathcomp"
else
:
fi
pathcomp=$pathcomp/
done
fi
if [ x"$dir_arg" != x ]
then
$doit $instcmd "$dst" &&
if [ x"$chowncmd" != x ]; then $doit $chowncmd "$dst"; else : ; fi &&
if [ x"$chgrpcmd" != x ]; then $doit $chgrpcmd "$dst"; else : ; fi &&
if [ x"$stripcmd" != x ]; then $doit $stripcmd "$dst"; else : ; fi &&
if [ x"$chmodcmd" != x ]; then $doit $chmodcmd "$dst"; else : ; fi
else
# If we're going to rename the final executable, determine the name now.
if [ x"$transformarg" = x ]
then
dstfile=`basename "$dst"`
else
dstfile=`basename "$dst" $transformbasename |
sed $transformarg`$transformbasename
fi
# don't allow the sed command to completely eliminate the filename
if [ x"$dstfile" = x ]
then
dstfile=`basename "$dst"`
else
:
fi
# Make a couple of temp file names in the proper directory.
dsttmp=$dstdir/_inst.$$_
rmtmp=$dstdir/_rm.$$_
# Trap to clean up temp files at exit.
trap 'status=$?; rm -f "$dsttmp" "$rmtmp" && exit $status' 0
trap '(exit $?); exit' 1 2 13 15
# Move or copy the file name to the temp name
$doit $instcmd "$src" "$dsttmp" &&
# and set any options; do chmod last to preserve setuid bits
# If any of these fail, we abort the whole thing. If we want to
# ignore errors from any of these, just make sure not to ignore
# errors from the above "$doit $instcmd $src $dsttmp" command.
if [ x"$chowncmd" != x ]; then $doit $chowncmd "$dsttmp"; else :;fi &&
if [ x"$chgrpcmd" != x ]; then $doit $chgrpcmd "$dsttmp"; else :;fi &&
if [ x"$stripcmd" != x ]; then $doit $stripcmd "$dsttmp"; else :;fi &&
if [ x"$chmodcmd" != x ]; then $doit $chmodcmd "$dsttmp"; else :;fi &&
# Now remove or move aside any old file at destination location. We try this
# two ways since rm can't unlink itself on some systems and the destination
# file might be busy for other reasons. In this case, the final cleanup
# might fail but the new file should still install successfully.
{
if [ -f "$dstdir/$dstfile" ]
then
$doit $rmcmd -f "$dstdir/$dstfile" 2>/dev/null ||
$doit $mvcmd -f "$dstdir/$dstfile" "$rmtmp" 2>/dev/null ||
{
echo "$0: cannot unlink or rename $dstdir/$dstfile" >&2
(exit 1); exit
}
else
:
fi
} &&
# Now rename the file to the real destination.
$doit $mvcmd "$dsttmp" "$dstdir/$dstfile"
fi &&
# The final little trick to "correctly" pass the exit status to the exit trap.
{
(exit 0); exit
}
+336
View File
@@ -0,0 +1,336 @@
#! /bin/sh
# Common stub for a few missing GNU programs while installing.
# Copyright (C) 1996, 1997, 1999, 2000, 2002 Free Software Foundation, Inc.
# Originally by Fran,cois Pinard <pinard@iro.umontreal.ca>, 1996.
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2, or (at your option)
# any later version.
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
# 02111-1307, USA.
# As a special exception to the GNU General Public License, if you
# distribute this file as part of a program that contains a
# configuration script generated by Autoconf, you may include it under
# the same distribution terms that you use for the rest of that program.
if test $# -eq 0; then
echo 1>&2 "Try \`$0 --help' for more information"
exit 1
fi
run=:
# In the cases where this matters, `missing' is being run in the
# srcdir already.
if test -f configure.ac; then
configure_ac=configure.ac
else
configure_ac=configure.in
fi
case "$1" in
--run)
# Try to run requested program, and just exit if it succeeds.
run=
shift
"$@" && exit 0
;;
esac
# If it does not exist, or fails to run (possibly an outdated version),
# try to emulate it.
case "$1" in
-h|--h|--he|--hel|--help)
echo "\
$0 [OPTION]... PROGRAM [ARGUMENT]...
Handle \`PROGRAM [ARGUMENT]...' for when PROGRAM is missing, or return an
error status if there is no known handling for PROGRAM.
Options:
-h, --help display this help and exit
-v, --version output version information and exit
--run try to run the given command, and emulate it if it fails
Supported PROGRAM values:
aclocal touch file \`aclocal.m4'
autoconf touch file \`configure'
autoheader touch file \`config.h.in'
automake touch all \`Makefile.in' files
bison create \`y.tab.[ch]', if possible, from existing .[ch]
flex create \`lex.yy.c', if possible, from existing .c
help2man touch the output file
lex create \`lex.yy.c', if possible, from existing .c
makeinfo touch the output file
tar try tar, gnutar, gtar, then tar without non-portable flags
yacc create \`y.tab.[ch]', if possible, from existing .[ch]"
;;
-v|--v|--ve|--ver|--vers|--versi|--versio|--version)
echo "missing 0.4 - GNU automake"
;;
-*)
echo 1>&2 "$0: Unknown \`$1' option"
echo 1>&2 "Try \`$0 --help' for more information"
exit 1
;;
aclocal*)
if test -z "$run" && ($1 --version) > /dev/null 2>&1; then
# We have it, but it failed.
exit 1
fi
echo 1>&2 "\
WARNING: \`$1' is missing on your system. You should only need it if
you modified \`acinclude.m4' or \`${configure_ac}'. You might want
to install the \`Automake' and \`Perl' packages. Grab them from
any GNU archive site."
touch aclocal.m4
;;
autoconf)
if test -z "$run" && ($1 --version) > /dev/null 2>&1; then
# We have it, but it failed.
exit 1
fi
echo 1>&2 "\
WARNING: \`$1' is missing on your system. You should only need it if
you modified \`${configure_ac}'. You might want to install the
\`Autoconf' and \`GNU m4' packages. Grab them from any GNU
archive site."
touch configure
;;
autoheader)
if test -z "$run" && ($1 --version) > /dev/null 2>&1; then
# We have it, but it failed.
exit 1
fi
echo 1>&2 "\
WARNING: \`$1' is missing on your system. You should only need it if
you modified \`acconfig.h' or \`${configure_ac}'. You might want
to install the \`Autoconf' and \`GNU m4' packages. Grab them
from any GNU archive site."
files=`sed -n 's/^[ ]*A[CM]_CONFIG_HEADER(\([^)]*\)).*/\1/p' ${configure_ac}`
test -z "$files" && files="config.h"
touch_files=
for f in $files; do
case "$f" in
*:*) touch_files="$touch_files "`echo "$f" |
sed -e 's/^[^:]*://' -e 's/:.*//'`;;
*) touch_files="$touch_files $f.in";;
esac
done
touch $touch_files
;;
automake*)
if test -z "$run" && ($1 --version) > /dev/null 2>&1; then
# We have it, but it failed.
exit 1
fi
echo 1>&2 "\
WARNING: \`$1' is missing on your system. You should only need it if
you modified \`Makefile.am', \`acinclude.m4' or \`${configure_ac}'.
You might want to install the \`Automake' and \`Perl' packages.
Grab them from any GNU archive site."
find . -type f -name Makefile.am -print |
sed 's/\.am$/.in/' |
while read f; do touch "$f"; done
;;
autom4te)
if test -z "$run" && ($1 --version) > /dev/null 2>&1; then
# We have it, but it failed.
exit 1
fi
echo 1>&2 "\
WARNING: \`$1' is needed, and you do not seem to have it handy on your
system. You might have modified some files without having the
proper tools for further handling them.
You can get \`$1Help2man' as part of \`Autoconf' from any GNU
archive site."
file=`echo "$*" | sed -n 's/.*--output[ =]*\([^ ]*\).*/\1/p'`
test -z "$file" && file=`echo "$*" | sed -n 's/.*-o[ ]*\([^ ]*\).*/\1/p'`
if test -f "$file"; then
touch $file
else
test -z "$file" || exec >$file
echo "#! /bin/sh"
echo "# Created by GNU Automake missing as a replacement of"
echo "# $ $@"
echo "exit 0"
chmod +x $file
exit 1
fi
;;
bison|yacc)
echo 1>&2 "\
WARNING: \`$1' is missing on your system. You should only need it if
you modified a \`.y' file. You may need the \`Bison' package
in order for those modifications to take effect. You can get
\`Bison' from any GNU archive site."
rm -f y.tab.c y.tab.h
if [ $# -ne 1 ]; then
eval LASTARG="\${$#}"
case "$LASTARG" in
*.y)
SRCFILE=`echo "$LASTARG" | sed 's/y$/c/'`
if [ -f "$SRCFILE" ]; then
cp "$SRCFILE" y.tab.c
fi
SRCFILE=`echo "$LASTARG" | sed 's/y$/h/'`
if [ -f "$SRCFILE" ]; then
cp "$SRCFILE" y.tab.h
fi
;;
esac
fi
if [ ! -f y.tab.h ]; then
echo >y.tab.h
fi
if [ ! -f y.tab.c ]; then
echo 'main() { return 0; }' >y.tab.c
fi
;;
lex|flex)
echo 1>&2 "\
WARNING: \`$1' is missing on your system. You should only need it if
you modified a \`.l' file. You may need the \`Flex' package
in order for those modifications to take effect. You can get
\`Flex' from any GNU archive site."
rm -f lex.yy.c
if [ $# -ne 1 ]; then
eval LASTARG="\${$#}"
case "$LASTARG" in
*.l)
SRCFILE=`echo "$LASTARG" | sed 's/l$/c/'`
if [ -f "$SRCFILE" ]; then
cp "$SRCFILE" lex.yy.c
fi
;;
esac
fi
if [ ! -f lex.yy.c ]; then
echo 'main() { return 0; }' >lex.yy.c
fi
;;
help2man)
if test -z "$run" && ($1 --version) > /dev/null 2>&1; then
# We have it, but it failed.
exit 1
fi
echo 1>&2 "\
WARNING: \`$1' is missing on your system. You should only need it if
you modified a dependency of a manual page. You may need the
\`Help2man' package in order for those modifications to take
effect. You can get \`Help2man' from any GNU archive site."
file=`echo "$*" | sed -n 's/.*-o \([^ ]*\).*/\1/p'`
if test -z "$file"; then
file=`echo "$*" | sed -n 's/.*--output=\([^ ]*\).*/\1/p'`
fi
if [ -f "$file" ]; then
touch $file
else
test -z "$file" || exec >$file
echo ".ab help2man is required to generate this page"
exit 1
fi
;;
makeinfo)
if test -z "$run" && (makeinfo --version) > /dev/null 2>&1; then
# We have makeinfo, but it failed.
exit 1
fi
echo 1>&2 "\
WARNING: \`$1' is missing on your system. You should only need it if
you modified a \`.texi' or \`.texinfo' file, or any other file
indirectly affecting the aspect of the manual. The spurious
call might also be the consequence of using a buggy \`make' (AIX,
DU, IRIX). You might want to install the \`Texinfo' package or
the \`GNU make' package. Grab either from any GNU archive site."
file=`echo "$*" | sed -n 's/.*-o \([^ ]*\).*/\1/p'`
if test -z "$file"; then
file=`echo "$*" | sed 's/.* \([^ ]*\) *$/\1/'`
file=`sed -n '/^@setfilename/ { s/.* \([^ ]*\) *$/\1/; p; q; }' $file`
fi
touch $file
;;
tar)
shift
if test -n "$run"; then
echo 1>&2 "ERROR: \`tar' requires --run"
exit 1
fi
# We have already tried tar in the generic part.
# Look for gnutar/gtar before invocation to avoid ugly error
# messages.
if (gnutar --version > /dev/null 2>&1); then
gnutar "$@" && exit 0
fi
if (gtar --version > /dev/null 2>&1); then
gtar "$@" && exit 0
fi
firstarg="$1"
if shift; then
case "$firstarg" in
*o*)
firstarg=`echo "$firstarg" | sed s/o//`
tar "$firstarg" "$@" && exit 0
;;
esac
case "$firstarg" in
*h*)
firstarg=`echo "$firstarg" | sed s/h//`
tar "$firstarg" "$@" && exit 0
;;
esac
fi
echo 1>&2 "\
WARNING: I can't seem to be able to run \`tar' with the given arguments.
You may want to install GNU tar or Free paxutils, or check the
command line arguments."
exit 1
;;
*)
echo 1>&2 "\
WARNING: \`$1' is needed, and you do not seem to have it handy on your
system. You might have modified some files without having the
proper tools for further handling them. Check the \`README' file,
it often tells you about the needed prerequirements for installing
this package. You may also peek at any GNU archive site, in case
some other package would contain this missing \`$1' program."
exit 1
;;
esac
exit 0
+64
View File
@@ -0,0 +1,64 @@
#
# No modifications of this Makefile should be necessary.
#
# This file contains the build instructions for installing OMF files. It is
# generally called from the makefiles for particular formats of documentation.
#
# Note that you must configure your package with --localstatedir=/var
# so that the scrollkeeper-update command below will update the database
# in the standard scrollkeeper directory.
#
# If it is impossible to configure with --localstatedir=/var, then
# modify the definition of scrollkeeper_localstate_dir so that
# it points to the correct location. Note that you must still use
# $(localstatedir) in this or when people build RPMs it will update
# the real database on their system instead of the one under RPM_BUILD_ROOT.
#
# Note: This make file is not incorporated into xmldocs.make because, in
# general, there will be other documents install besides XML documents
# and the makefiles for these formats should also include this file.
#
# About this file:
# This file was derived from scrollkeeper_example2, a package
# illustrating how to install documentation and OMF files for use with
# ScrollKeeper 0.3.x and 0.4.x. For more information, see:
# http://scrollkeeper.sourceforge.net/
# Version: 0.1.3 (last updated: March 20, 2002)
#
omf_dest_dir=$(datadir)/omf/@PACKAGE@
scrollkeeper_localstate_dir = $(localstatedir)/scrollkeeper
# At some point, it may be wise to change to something like this:
# scrollkeeper_localstate_dir = @SCROLLKEEPER_STATEDIR@
omf: omf_timestamp
omf_timestamp: $(omffile)
-for file in $(omffile); do \
scrollkeeper-preinstall $(docdir)/$(docname).xml $(srcdir)/$$file $$file.out; \
done; \
touch omf_timestamp
install-data-hook-omf:
$(mkinstalldirs) $(DESTDIR)$(omf_dest_dir)
for file in $(omffile); do \
$(INSTALL_DATA) $$file.out $(DESTDIR)$(omf_dest_dir)/$$file; \
done
-if test -w $(scrollkeeper_localstate_dir); then \
scrollkeeper-update -p $(scrollkeeper_localstate_dir) \
-o $(DESTDIR)$(omf_dest_dir); fi
uninstall-local-omf:
-for file in $(srcdir)/*.omf; do \
basefile=`basename $$file`; \
rm -f $(omf_dest_dir)/$$basefile; \
done
-rmdir $(omf_dest_dir)
-if test -w $(scrollkeeper_localstate_dir); then \
scrollkeeper-update -p $(scrollkeeper_localstate_dir); fi
clean-local-omf:
-for file in $(omffile); do \
rm -f $$file.out; \
done
+9
View File
@@ -0,0 +1,9 @@
icondir = $(datadir)/freedict-editor
icon_DATA = freedict.png
logodir = $(datadir)/freedict-editor
logo_DATA = freedict.png
EXTRA_DIST = \
$(icon_DATA) \
$(logo_DATA)
Binary file not shown.

After

Width:  |  Height:  |  Size: 2.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.3 KiB

View File
Whitespace-only changes.
+9
View File
@@ -0,0 +1,9 @@
# List of source files containing translatable strings.
src/main.c
src/callbacks.c
src/utils.c
src/entryedit.c
src/xml.c
src/values.c
freedict-editor.glade
+1
View File
@@ -0,0 +1 @@
help/C/imipa.c
File diff suppressed because it is too large. Load diff
+748
View File
@@ -0,0 +1,748 @@
# French translation for the Freedict-Editor
# Copyright (C) 2009 The Freedict Project
# This file is distributed under the same license as the Freedict-Editor package.
# Denis ARNAUD <denisarnuad@yahoo.fr>, 2009.
#
#
msgid ""
msgstr ""
"Project-Id-Version: Freedict-Editor\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2006-01-30 16:47+0100\n"
"PO-Revision-Date: 2009-11-26 10:19+0100\n"
"Last-Translator: Denis <denisarnuad@yahoo.fr>\n"
"Language-Team: French <fr@li.org>\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
#: src/interface.c:31
msgid "_New"
msgstr "_Nouveau"
#: src/interface.c:31
msgid "New TEI File"
msgstr "Nouveau fichier TEI"
#: src/interface.c:48
msgid "Ne_w Entry"
msgstr "Nou_velle entrée"
#: src/interface.c:49
msgid "Add New Entry"
msgstr "Ajouter une nouvelle entrée"
#: src/interface.c:55
msgid "_Delete Entry"
msgstr "_Enlever cette entrée"
#: src/interface.c:56
msgid "Delete Currently Edited Entry"
msgstr "Enlever l'entrée en cours d'édition"
#: src/interface.c:62
msgid "Sa_ve Entry"
msgstr "En_registrer cette entrée"
#: src/interface.c:63
msgid "Save Changes to Entry"
msgstr "Enregistrer les changements de cette entrée"
#: src/interface.c:69
#: src/interface.c:428
msgid "_Cancel Edit"
msgstr "Ann_uler les modifications"
#: src/interface.c:70
#: src/interface.c:429
msgid "Cancel Edit of Entry"
msgstr "Annuler les modifications de cette entrée"
#: src/interface.c:77
msgid "_Edit TEI Header"
msgstr "Modifi_er l'en-tête TEI"
#: src/interface.c:78
msgid "Edit information about the dictionary"
msgstr "Modifier les informations de ce dictionnaire"
#: src/interface.c:84
msgid "_Spell Check..."
msgstr "_Vérifier l'orthographe..."
#: src/interface.c:91
msgid "S_anity Checks..."
msgstr "Vérific_ations sanitaires..."
#: src/interface.c:92
msgid "Find Entries with missing Information"
msgstr "Chercher les entrées aux informations manquantes"
#: src/interface.c:105
#, fuzzy
msgid "Lock _Dockitems"
msgstr "Vérouiller le _dockitems"
#: src/interface.c:112
msgid "_Labels"
msgstr "É_tiquettes"
#: src/interface.c:113
msgid "Toggle whether Labels are shown before Input fields"
msgstr "Afficher les étiquettes avant ou après les champs de saisie"
#: src/interface.c:119
msgid "_Toolbar"
msgstr "Barre d'ou_tils"
#: src/interface.c:120
msgid "Toggle Display of Toolbar"
msgstr "Afficher/Cacher la barre d'outils"
#: src/interface.c:126
msgid "_HTML Preview"
msgstr "Aperçu _HTML"
#: src/interface.c:127
msgid "Toggle Display of HTML Preview Area"
msgstr "Afficher/Cacher l'aperçu HTML"
#: src/interface.c:133
msgid "_Keyboard Layout"
msgstr "A_gencement du clavier"
#: src/interface.c:134
msgid "Calls xkbprint to display current keyboard layout"
msgstr "Appeler xkbprint pour afficher l'agencement actuel du clavier"
#: src/interface.c:166
#: src/interface.c:199
msgid "_None"
msgstr "Aucu_n"
#: src/interface.c:173
msgid "_Singular"
msgstr "_Singulier"
#: src/interface.c:180
msgid "_Dual"
msgstr "_Duel"
#: src/interface.c:187
msgid "_Plural"
msgstr "_Pluriel"
#: src/interface.c:206
msgid "_Masculine"
msgstr "_Masculin"
#: src/interface.c:213
msgid "_Feminine"
msgstr "_Féminin"
#: src/interface.c:220
msgid "_Neuter"
msgstr "_Neutre"
#: src/interface.c:300
msgid "FreeDict-Editor"
msgstr "Éditeur Freedict"
#: src/interface.c:327
msgid "Se_lect:"
msgstr "Sé_lectionne :"
#: src/interface.c:338
#, c-format
msgid "This string will replace the %s in the XPath-Template."
msgstr "Cette chaine remplacera le %s dans le Xpath-Template."
#: src/interface.c:346
msgid "XPath-Template:"
msgstr "Xpath-Template :"
#: src/interface.c:357
#, c-format
msgid "Enter an XPath expression. It may contain one %s, which will be filled by the contents of the \"Select\" input field."
msgstr "Entrer une expression XPath. Elle doit contenir un %s, qui sera remplacé par le contenu du champ « Sélectionne »."
#: src/interface.c:358
#, c-format
msgid "/TEI.2/text/body/entry[position()>0 and contains(form/orth,'%s')]"
msgstr "/TEI.2/text/body/entry[position()>0 and contains(form/orth,'%s')]"
#: src/interface.c:394
msgid "New Entry"
msgstr "Nouvelle entrée"
#: src/interface.c:395
msgid "Add new Entry"
msgstr "Ajouter une nouvelle entrée"
#: src/interface.c:404
#: src/interface.c:405
msgid "Delete Entry"
msgstr "Enlever l'entrée"
#: src/interface.c:415
msgid "Save Entry"
msgstr "Enregistrer l'entrée"
#: src/interface.c:416
msgid "Save changes to Entry"
msgstr "Enregistrer les modifications de l'entrée"
#: src/interface.c:468
msgid "Entries that match the select expression"
msgstr "Entrées qui correspondent à l'expression sectionnée"
#: src/interface.c:473
msgid "En_tries"
msgstr "En_trées"
#: src/interface.c:494
msgid "XML View"
msgstr "Vue XML"
#: src/interface.c:499
msgid "The XML edit mode is selected of the entry cannot be edited with the formular."
msgstr "Le mode Modification du XML est sélectionné car l'entrée ne peut être modifiée par le formulaire."
#: src/interface.c:501
msgid "_XML"
msgstr "_XML"
#: src/interface.c:522
msgid "_Orthography"
msgstr "_Orthographe"
#: src/interface.c:535
msgid "How the word is written"
msgstr "Comment s'écrit le mot"
#: src/interface.c:537
msgid "_Pronunciation"
msgstr "_Prononciation"
#: src/interface.c:550
msgid "Please enter Unicode encoded characters of the International Phonetic Alphabet"
msgstr "Entrez des caractères Unicode de l'alphabet phonétique international"
#: src/interface.c:558
msgid "Part of _Speech"
msgstr "Natu_re"
#: src/interface.c:566
msgid "Part of Speech"
msgstr "Nature"
#: src/interface.c:574
msgid "_Number"
msgstr "_Nombre"
#: src/interface.c:582
msgid "Number"
msgstr "Nombre"
#: src/interface.c:593
msgid "_Genus"
msgstr "_Genre"
#: src/interface.c:601
msgid "Genus"
msgstr "Genre"
#: src/interface.c:609
msgid "Headword(s)"
msgstr "Mot(s)"
#: src/interface.c:641
msgid "Append new Sense to Entry"
msgstr "Ajouter un nouveau sens à l'entrée"
#: src/interface.c:647
msgid "Remove last Sense from Entry"
msgstr "Enlever le dernier sens de l'entrée"
#: src/interface.c:649
msgid "Sense(s)"
msgstr "Sens"
#: src/interface.c:654
msgid "For_m"
msgstr "For_me"
#. TRANSLATORS: Replace this string with your names, one name per line.
#: src/interface.c:862
msgid "translator_credits"
msgstr "Denis ARNAUD <denisarnuad@yahoo.fr>"
#: src/interface.c:869
msgid "FreeDict Project, freedict.org, 2005"
msgstr "FreeDict Project, freedict.org, 2005"
#: src/interface.c:896
msgid "Select File"
msgstr "Sélectionnez un fichier"
#: src/interface.c:984
msgid "Spell Check"
msgstr "Vérification d'orthographe"
#: src/interface.c:997
msgid "Misspelled Word"
msgstr "Mot mal orthographié"
#: src/interface.c:1011
msgid "A word that was not found in the spelling dictionary"
msgstr "Un mot qui n'a pas été trouvé dans le dictionnnaire de vérification"
#: src/interface.c:1014
msgid "R_eplacement"
msgstr "R_emplacement"
#: src/interface.c:1027
msgid "The misspelled word will be replaced by this when you click on Replace"
msgstr "Ce par quoi sera remplacé le mot quand vous cliquez sur Remplacer "
#: src/interface.c:1030
msgid "_Suggestions"
msgstr "_Suggestions"
#: src/interface.c:1043
msgid "Nodes checked"
msgstr "Entrées vérifiées"
#: src/interface.c:1057
msgid "Double-Click a suggestion to replace the misspelled word with it"
msgstr "Double-cliquer sur une suggestion remplacera le mot par celle-ci"
#: src/interface.c:1075
msgid "_Headword Language"
msgstr "Lang_ue du mot d'entrée"
#: src/interface.c:1081
msgid "_Translation Language"
msgstr "Langue de sor_tie"
#: src/interface.c:1088
msgid "<orth> - Headwords"
msgstr "<orth> - Mots d'entrée"
#: src/interface.c:1092
msgid "<tr> - Translations"
msgstr "<tr> - Traduction"
#: src/interface.c:1097
msgid "<eg><q> - Quotes of Examples"
msgstr "<eg><q> - Citations d'exemples"
#: src/interface.c:1101
msgid "<eg><tr> - Translations of Examples"
msgstr "<eg><tr> - Traduction d'exemples"
#: src/interface.c:1105
msgid "_What to check"
msgstr "_Quoi vérifier"
#: src/interface.c:1116
msgid "Spelling _Dictionary:"
msgstr "_Dictionnaire d'orthographe :"
#: src/interface.c:1124
#, fuzzy
msgid "Acc_ept Run-Together Words"
msgstr "Tolér_er les mots "
#: src/interface.c:1135
msgid "What language to use for checking the words"
msgstr "Quel langue utiliser pour la vérification des mots"
#: src/interface.c:1143
msgid "Aspell _Options"
msgstr "_Options Aspell"
#: src/interface.c:1148
msgid "Replacements made"
msgstr "Remplacements effectués"
#: src/interface.c:1156
msgid "0"
msgstr "0"
#: src/interface.c:1173
msgid "Replace misspelled word with current Replacement"
msgstr "Remplacer le mot mal orthographié par le présent remplaçant"
#: src/interface.c:1187
msgid "_Replace"
msgstr "_Remplacer"
#: src/interface.c:1192
msgid "Replace _All"
msgstr "Tout rempl_acer"
#: src/interface.c:1196
msgid "Replace all occurences of the misspelled word with current Replacement"
msgstr "Remplacer toutes les occurences du mot mal orthographié par ce mot"
#: src/interface.c:1202
msgid "Ignore current occurence of the misspelled word"
msgstr "Ignorer la présente occurence du mot mal orthographié"
#: src/interface.c:1216
msgid "_Ignore"
msgstr "_Ignorer"
#: src/interface.c:1221
msgid "I_gnore All"
msgstr "Tout i_gnorer"
#: src/interface.c:1225
msgid "Ignore all occurences of the misspelled word"
msgstr "Ignorer toutes les occurences du mot mal orthographié"
#: src/interface.c:1231
msgid "Add misspelled word to the personal GNU aspell word list of this language"
msgstr "Ajouter ce mot à mon dictionnaire GNU aspell pour cette langue"
#: src/interface.c:1374
msgid "FreeDict-Editor Preferences"
msgstr "Préférences de l'éditeur Freedict"
#: src/interface.c:1386
msgid "Use Default Value:"
msgstr "Utiliser la valeur par défaut :"
#: src/interface.c:1394
msgid "Use Custom Value"
msgstr "Utiliser la valeur personnalisée"
#: src/interface.c:1402
msgid "label57"
msgstr "label57"
#: src/interface.c:1412
msgid "Select XSLT-Stylesheet"
msgstr "Sélectionner la feuille de style XSLT"
#: src/interface.c:1422
msgid "_XSLT-Stylesheet for HTML Preview"
msgstr "Feuille de style _XSLT pour l'aperçu HTML"
#: src/interface.c:1430
msgid "_General"
msgstr "_Général"
#: src/interface.c:1439
msgid ""
"POS-, Num-, Gen-, XRef-Types\n"
"+\n"
"Descriptions"
msgstr ""
"POS-, Num-, Gen-, XRef-Types\n"
"+\n"
"Descriptions"
#: src/interface.c:1450
msgid "This information is automatically added to every edited entry"
msgstr "Cette information est ajoutée automatiquement à chaque entrée modifiée"
#: src/interface.c:1452
msgid "Use Default Name:"
msgstr "Utiliser le nom par défaut :"
#: src/interface.c:1460
msgid "Use Custom Name:"
msgstr "Utiliser un nom personnalisé :"
#: src/interface.c:1468
msgid "editer_default_name_label"
msgstr "nom_per_défaut_de_l_éditeur"
#: src/interface.c:1485
msgid "Entry _Template"
msgstr "_Trame de saisie pour une entrée"
#: src/interface.c:1493
msgid "Use Custom Value:"
msgstr "Utiliser la valeur personnalisée :"
#: src/interface.c:1501
msgid "Use Default:"
msgstr "Utiliser la valeur par défaut :"
#: src/interface.c:1518
msgid "template_default_label"
msgstr "trame_par_défaut"
#: src/interface.c:1528
msgid "Add _Author/Editor to Edited Entries"
msgstr "Ajouter _Auteur/Modificateur aux entrées modifiées"
#: src/interface.c:1534
msgid "Use Custom Email:"
msgstr "Utiliser une adresse de courriel personnalisée :"
#: src/interface.c:1542
msgid "Use Default Email:"
msgstr "Utiliser l'adresse de courriel par défaut :"
#: src/interface.c:1550
msgid "editer_default_email_label"
msgstr "courriel_de_l_éditeur_par_défaut"
#: src/interface.c:1566
msgid "Add _Source Reference to Edited Entries"
msgstr "Ajouter une référence aux entrées modifiées"
#: src/interface.c:1580
msgid "Source Document that justifies inclusion of an entry. Automatically added to edited entries."
msgstr "Document source qui justifie l'inclusion d'une entrée. Ajouté automatiquement aux entrées modifiées."
#: src/interface.c:1590
msgid "_Entry Editor"
msgstr "Éditeur de l'_entrée"
#: src/interface.c:1599
msgid "_Sanity Checks"
msgstr "Vérifications _sanitaires"
#: src/interface.c:1678
msgid "Check Sanity"
msgstr "Vérifier l'état sanitaire"
#: src/callbacks.c:206
#, c-format
msgid "Failed to load %s!"
msgstr "Erreur pendant le chargement de %s !"
#: src/callbacks.c:289
msgid "File modified. Save?"
msgstr "Le fichier a été modifié. L'enregistrer ?"
#: src/callbacks.c:555
#: src/callbacks.c:563
#, c-format
msgid "Malformed XPath-Template. Only one %%s and many %%%% allowed."
msgstr "XPath-Template mal formé. Ne sont permis qu'un %%s et plusieurs %%%%."
#: src/callbacks.c:584
msgid "No matches."
msgstr "Pas de correspondances."
#: src/callbacks.c:587
#, c-format
msgid "%i matching nodes"
msgstr "%i entrées correspondantes"
#: src/callbacks.c:662
msgid "Edit accepted."
msgstr "Modification acceptée."
#: src/callbacks.c:695
msgid "Edited XML is not well formed! Can't save it!"
msgstr "Le XML modifié est mal formé ! Impossible de l'enregistrer !"
#: src/callbacks.c:709
#: src/callbacks.c:880
msgid "Edited XML is not valid! Won't save it!"
msgstr "La modification du XML n'est pas valide ! Il ne sera pas enregistré !"
#: src/callbacks.c:747
msgid "xmlAddChild(bodyNode, newEntry) failed!"
msgstr "xmlAddChild(bodyNode, newEntry) a échoué !"
#: src/callbacks.c:803
#, c-format
msgid "New entry created and editable. Speed: %2.1f entries/hour"
msgstr "La nouvelle entrée est créée et modifiable. Vitesse : %2.1f entrées/heure"
#: src/callbacks.c:923
msgid "Cannot handle entry with form :("
msgstr "Ne peut atteindre l'entrée par le formulaire :("
#: src/callbacks.c:934
#, c-format
msgid "Saving form contents as XML failed :("
msgstr "L'enregistremnt du contenu du formulaire comme XML a échoué :("
#: src/callbacks.c:1153
#, c-format
msgid "Key was empty. Using default: %s\n"
msgstr "La clef était vide. %s est utilisé par défaut\n"
#: src/callbacks.c:1155
#, c-format
msgid "Using stylesheet filename from gconf: %s\n"
msgstr "Gconf indique d'utiliser la feuille de style : %s\n"
#: src/callbacks.c:1169
#, c-format
msgid "Could not load %s!"
msgstr "Impossible de charger %s !"
#: src/callbacks.c:1178
#, c-format
msgid "Could not load entry stylesheet %s. HTML Preview won't work!"
msgstr "Impossible de charger la feuille de style des entrées %s. L'aperçu HTML ne fonctionnera pas !"
#: src/callbacks.c:1269
msgid "Error converting entry to HTML!"
msgstr "Erreur lors de la conversion de l'entrée en HTML !"
#. save contents of form
#: src/callbacks.c:1308
#, c-format
msgid "Saving form contents as XML failed."
msgstr "L'enregistremnt du contenu du formulire comme XML a échoué."
#: src/callbacks.c:1388
msgid "No Drops accepted while unsaved changes in memory."
msgstr "Les déposers ne sont pas possibles tant que des changements non enregistrés sont en mémoire."
#: src/callbacks.c:1408
#, fuzzy, c-format
msgid ""
"Did not recognize URI in Drop (no \\r\\n"
"): %s\n"
msgstr ""
"L'URI de destination n'a pas été reconnue (Il n'y a pas de\\r\\n"
"): %s\n"
#: src/callbacks.c:1411
#, fuzzy, c-format
msgid "Did not recognize file-URI in Drop: %s\n"
msgstr "L'URI du fichier de destination n'a pas été reconnue : %s\n"
#: src/callbacks.c:1466
msgid "Failed to find 'xkbprint' in path."
msgstr "'kbprint' n'a pas été trouvé à l'emplacement indiqué."
#: src/callbacks.c:1472
msgid "Failed to find 'gv' in path."
msgstr "'gv n'a pas été trouvé à l'emplacement indiqué."
#: src/callbacks.c:1480
#, c-format
msgid "Failed to show keyboard layout with command: %s"
msgstr "Erreur à l'affichage de l'agencement du clavier avec la commande :%s"
#: src/callbacks.c:1483
#, c-format
msgid "Done: %s"
msgstr "Avancée : %s"
#: src/callbacks.c:1931
msgid "Finished Spellcheck."
msgstr "Vérification d'orthographe finie."
#: src/callbacks.c:2029
#, c-format
msgid "%s, size=%s"
msgstr "%s, taille = %s"
#: src/callbacks.c:2060
msgid "This binary of FreeDict-Editor was compiled without aspell support."
msgstr "Ce binaire de l'éditeur Freedict a été compilé sans le support d'Aspell."
#: src/callbacks.c:2100
#, c-format
msgid "There is no use in replacing a misspelled word with itself.\n"
msgstr "Il est inutile de remplacer un mot mal orthographié par lui-même.\n"
#: src/callbacks.c:2514
msgid "Missing Part-of-Speech"
msgstr "Nature manquante"
#: src/callbacks.c:2516
msgid "Nouns without Gender"
msgstr "Noms sans genre"
#: src/callbacks.c:2518
msgid "Notes with Question Marks"
msgstr "Notes avec des mentions Question"
#: src/callbacks.c:2520
msgid "Empty Headwords"
msgstr "Mots vides"
#: src/callbacks.c:2522
msgid "Empty Body"
msgstr "Contenu vide"
#. too slow
#: src/callbacks.c:2526
msgid "Homographs of same Part-of-Speech"
msgstr "Homographe de même nature"
#: src/callbacks.c:2531
msgid "Broken Cross-References"
msgstr "La référence interne est cassée."
#: src/callbacks.c:2536
msgid "Multiple Headwords"
msgstr "Mots d'entrées multiples"
#: src/callbacks.c:2538
msgid "\"to \" before verbs (only useful for English, checks tr)"
msgstr "« to » avant les verbes (seulement utilisé pour l'anglais, vérifiez tr)"
#: src/callbacks.c:2540
msgid "\"to \" before verbs (only useful for English, checks orth)"
msgstr "« to » avant les verbes (seulement utilisé pour l'anglais, vérifiez orth)"
#: src/callbacks.c:2542
msgid "Unbalanced braces"
msgstr "Accolades non refermées"
#: src/callbacks.c:2667
#, c-format
msgid "%1$s (%2$i matches)"
msgstr "%1$s (%2$i correspondances)"
#: src/callbacks.c:2756
msgid "Sanity checks performed."
msgstr "Les vérifications sanitaires ont été faites."
#: src/callbacks.c:2798
msgid "Check Enabled?"
msgstr "La vérification est-elle activée ?"
#: src/callbacks.c:2807
msgid "Check Name"
msgstr "Vérifier le nom"
#: src/callbacks.c:2813
msgid "Matching Entries"
msgstr "Entrées correspondantes"
#: src/support.c:60
#: src/support.c:85
#, c-format
msgid "Couldn't find pixmap file: %s"
msgstr "Impossible de trouver le fichier pixmap :%s"
#: src/utils.c:89
msgid ""
"1. Open a TEI file\n"
"2. Modify the XPath select expression to match\n"
"\tthe entries you desire to edit\n"
"3. Double-click on an entry headword in the list\n"
"\tof matching entries to the right!"
msgstr ""
"1. Ouvrir un fichier TEI\n"
"2. Modifier l'expression de sélection XPath afin que correspondent\n"
"\tles entrées que vous souhaitez modifier\n"
"3. Double-cliquez sur le mot de l'entrée dans la liste à droite\n"
"\tdes entrées correspondantes !"
#: src/utils.c:140
#, c-format
msgid "Saving to %s failed."
msgstr "L'enregistrement vers %s a échoué."
#: src/utils.c:146
msgid "Saved."
msgstr "Enregistré."
File diff suppressed because it is too large. Load diff
File diff suppressed because it is too large. Load diff
File diff suppressed because it is too large. Load diff
+19
View File
@@ -0,0 +1,19 @@
## Process this file with automake to produce Makefile.in
AM_CPPFLAGS = \
-DPACKAGE_DATA_DIR=\""$(datadir)"\" \
-DPACKAGE_LOCALE_DIR=\""$(prefix)/$(DATADIRNAME)/locale"\" \
@PACKAGE_CFLAGS@
bin_PROGRAMS = freedict-editor
freedict_editor_SOURCES = \
main.c \
utils.c utils.h \
xml.c xml.h \
callbacks.c callbacks.h \
entryedit.c entryedit.h \
values.c values.h
freedict_editor_LDADD = @PACKAGE_LIBS@ $(INTLLIBS)
freedict_editor_LDFLAGS = -export-dynamic
File diff suppressed because it is too large. Load diff
+456
View File
@@ -0,0 +1,456 @@
#include <gnome.h>
#include <libxml/parser.h>
#include <libxml/xpath.h>
#include <libxslt/xslt.h>
#include <libxslt/xsltInternals.h>
#include <libxslt/transform.h>
#include <libxslt/xsltutils.h>
void
on_new1_activate (GtkMenuItem *menuitem,
gpointer user_data);
void
on_open1_activate (GtkMenuItem *menuitem,
gpointer user_data);
void
on_save1_activate (GtkMenuItem *menuitem,
gpointer user_data);
void
on_save_as1_activate (GtkMenuItem *menuitem,
gpointer user_data);
void
on_quit1_activate (GtkMenuItem *menuitem,
gpointer user_data);
void
on_cut1_activate (GtkMenuItem *menuitem,
gpointer user_data);
void
on_copy1_activate (GtkMenuItem *menuitem,
gpointer user_data);
void
on_paste1_activate (GtkMenuItem *menuitem,
gpointer user_data);
void
on_clear1_activate (GtkMenuItem *menuitem,
gpointer user_data);
/*
void
on_properties1_activate (GtkMenuItem *menuitem,
gpointer user_data);
*/
void
on_preferences1_activate (GtkMenuItem *menuitem,
gpointer user_data);
void
on_about1_activate (GtkMenuItem *menuitem,
gpointer user_data);
void
on_openbutton_clicked (GtkButton *button,
gpointer user_data);
void
on_fileselection1_close (GtkDialog *dialog,
gpointer user_data);
void
on_quit1_activate (GtkMenuItem *menuitem,
gpointer user_data);
void
on_ok_button1_clicked (GtkButton *button,
gpointer user_data);
void
on_app1_hide (GtkWidget *widget,
gpointer user_data);
void
on_cancel_button1_clicked (GtkButton *button,
gpointer user_data);
void
on_select_entry_changed (GtkEditable *editable,
gpointer user_data);
void
on_treeview1_row_activated (GtkTreeView *treeview,
GtkTreePath *path,
GtkTreeViewColumn *column,
gpointer user_data);
void
on_app1_hide (GtkWidget *widget,
gpointer user_data);
gboolean
on_textview1_focus_out_event (GtkWidget *widget,
GdkEventFocus *event,
gpointer user_data);
gboolean
on_app1_window_state_event (GtkWidget *widget,
GdkEvent *event,
gpointer user_data);
gboolean
on_app1_delete_event (GtkWidget *widget,
GdkEvent *event,
gpointer user_data);
void
on_save_button_clicked (GtkButton *button,
gpointer user_data);
void
on_new_entry_button_clicked (GtkButton *button,
gpointer user_data);
void
on_delete_button_clicked (GtkButton *button,
gpointer user_data);
void
on_app1_show (GtkWidget *widget,
gpointer user_data);
gboolean
on_notebook1_select_page (GtkNotebook *notebook,
gboolean move_focus,
gpointer user_data);
void
on_notebook1_switch_page (GtkNotebook *notebook,
GtkNotebookPage *page,
guint page_num,
gpointer user_data);
void
on_notebook1_change_current_page (GtkNotebook *notebook,
gint offset,
gpointer user_data);
gboolean
on_notebook1_focus_tab (GtkNotebook *notebook,
GtkNotebookTab type,
gpointer user_data);
gboolean
on_vbox4_focus_out_event (GtkWidget *widget,
GdkEventFocus *event,
gpointer user_data);
void
on_sense1_optionmenu_changed (GtkOptionMenu *optionmenu,
gpointer user_data);
void
on_slang1_activate (GtkMenuItem *menuitem,
gpointer user_data);
void
on_formal1_activate (GtkMenuItem *menuitem,
gpointer user_data);
void
on_official1_activate (GtkMenuItem *menuitem,
gpointer user_data);
void
on_botanics1_activate (GtkMenuItem *menuitem,
gpointer user_data);
void
on_science1_activate (GtkMenuItem *menuitem,
gpointer user_data);
void
on_add_sense_button_clicked (GtkButton *button,
gpointer user_data);
void
on_remove_sense_button_clicked (GtkButton *button,
gpointer user_data);
void
on_sense1_tr_add_button_clicked (GtkButton *button,
gpointer user_data);
void
on_sense1_tr_delete_button_clicked (GtkButton *button,
gpointer user_data);
void
on_sense1_xr1_combo_entry_changed (GtkEditable *editable,
gpointer user_data);
void
on_apply_button_clicked (GtkButton *button,
gpointer user_data);
void
on_form_entry_changed (GtkEditable *editable,
gpointer user_data);
void
on_form_optionmenu_changed (GtkOptionMenu *optionmenu,
gpointer user_data);
void
on_form_entry_changed (GtkEditable *editable,
gpointer user_data);
void
on_form_optionmenu_changed (GtkOptionMenu *optionmenu,
gpointer user_data);
void
on_cancel_edit_button_clicked (GtkButton *button,
gpointer user_data);
gboolean
on_treeview1_select_cursor_row (GtkTreeView *treeview,
gboolean start_editing,
gpointer user_data);
void
on_treeview1_cursor_changed (GtkTreeView *treeview,
gpointer user_data);
gboolean
on_treeview1_move_cursor (GtkTreeView *treeview,
GtkMovementStep step,
gint count,
gpointer user_data);
gboolean
on_treeview1_toggle_cursor_row (GtkTreeView *treeview,
gpointer user_data);
void
on_treeview1_set_focus_child (GtkContainer *container,
GtkWidget *widget,
gpointer user_data);
void
on_select_entry_changed (GtkEditable *editable,
gpointer user_data);
void
on_bonobo_experiment1_activate (GtkMenuItem *menuitem,
gpointer user_data);
void
on_app1_drag_data_received (GtkWidget *widget,
GdkDragContext *drag_context,
gint x,
gint y,
GtkSelectionData *data,
guint info,
guint time,
gpointer user_data);
gboolean
on_entry2_focus_in_event (GtkWidget *widget,
GdkEventFocus *event,
gpointer user_data);
gboolean
on_entry2_focus_out_event (GtkWidget *widget,
GdkEventFocus *event,
gpointer user_data);
void
on_spell_check1_activate (GtkMenuItem *menuitem,
gpointer user_data);
void
on_spell_replace_button_clicked (GtkButton *button,
gpointer user_data);
void
on_spell_replace_all_button_clicked (GtkButton *button,
gpointer user_data);
void
on_spell_ignore_button_clicked (GtkButton *button,
gpointer user_data);
void
on_spell_ignore_all_button_clicked (GtkButton *button,
gpointer user_data);
void
on_spell_add_button_clicked (GtkButton *button,
gpointer user_data);
void
on_spell_close_button_clicked (GtkButton *button,
gpointer user_data);
void
on_check_dict_combo_entry_changed (GtkEditable *editable,
gpointer user_data);
void
on_spell_headwords_radiobutton_toggled (GtkToggleButton *togglebutton,
gpointer user_data);
void
on_spell_translations_radiobutton_toggled
(GtkToggleButton *togglebutton,
gpointer user_data);
void
on_suggestions_treeview_row_activated (GtkTreeView *treeview,
GtkTreePath *path,
GtkTreeViewColumn *column,
gpointer user_data);
void
on_suggestions_treeview_cursor_changed (GtkTreeView *treeview,
gpointer user_data);
void
on_new_file_button_clicked (GtkButton *button,
gpointer user_data);
void
on_view_labels_activate (GtkMenuItem *menuitem,
gpointer user_data);
void
on_view_toolbar_activate (GtkMenuItem *menuitem,
gpointer user_data);
void
on_view_html_activate (GtkMenuItem *menuitem,
gpointer user_data);
void
on_propertybox1_apply (GnomePropertyBox *propertybox,
gint page_num,
gpointer user_data);
void
on_propertybox1_help (GnomePropertyBox *propertybox,
gint page_num,
gpointer user_data);
void
on_lock_dockitems1_activate (GtkMenuItem *menuitem,
gpointer user_data);
gboolean
on_propertybox1_close (GnomeDialog *gnomedialog,
gpointer user_data);
void
on_edit_header_activate (GtkMenuItem *menuitem,
gpointer user_data);
void
on_sanity_check_activate (GtkMenuItem *menuitem,
gpointer user_data);
void
on_view_keyboard_layout_activate (GtkMenuItem *menuitem,
gpointer user_data);
void
on_sanity_treeview_row_activated (GtkTreeView *treeview,
GtkTreePath *path,
GtkTreeViewColumn *column,
gpointer user_data);
void
on_sanity_treeview_cursor_changed (GtkTreeView *treeview,
gpointer user_data);
gboolean
on_sanity_treeview_expand_collapse_cursor_row
(GtkTreeView *treeview,
gboolean logical,
gboolean expand,
gboolean open_all,
gpointer user_data);
void
on_sanity_treeview_show (GtkWidget *widget,
gpointer user_data);
void
on_sanity_window_show (GtkWidget *widget,
gpointer user_data);
void
on_sanity_treeview_row_expanded (GtkTreeView *treeview,
GtkTreeIter *iter,
GtkTreePath *path,
gpointer user_data);
void
on_stylesheet_fileentry_changed (GtkEditable *editable,
gpointer user_data);
void
on_editer_entry_changed (GtkEditable *editable,
gpointer user_data);
void
on_source_reference_entry_changed (GtkEditable *editable,
gpointer user_data);
void
on_entry_template_fileentry_changed (GtkEditable *editable,
gpointer user_data);
void
on_gtkeditable_changed (GtkEditable *editable,
gpointer user_data);
void
on_propertybox1_show (GtkWidget *widget,
gpointer user_data);
void
on_add_new_entry1_activate (GtkMenuItem *menuitem,
gpointer user_data);
void
on_delete_entry1_activate (GtkMenuItem *menuitem,
gpointer user_data);
void
on_save_entry1_activate (GtkMenuItem *menuitem,
gpointer user_data);
void
on_cancel_edit1_activate (GtkMenuItem *menuitem,
gpointer user_data);
void
on_stop_find_nodeset_clicked (GtkButton *button,
gpointer user_data);
void
on_accept_runtogether_checkbutton_toggled
(GtkToggleButton *togglebutton,
gpointer user_data);
void
set_view_labels_visible (gboolean visible);
File diff suppressed because it is too large. Load diff
+68
View File
@@ -0,0 +1,68 @@
#include <gnome.h>
#include <libxml/parser.h>
#include "values.h"
typedef struct _Sense_trans Sense_trans;
typedef struct _Sense_xr Sense_xr;
typedef struct _Sense Sense;
struct _Sense_trans
{
// GtkWidgets of this translation equivalent
GtkWidget *hbox, *entry, *pos_optionmenu, *gen_optionmenu;
// XXX needed only during entry parsing -> put into its own struct?
// xmlNodes of this translation equivalent
xmlNodePtr xTr, xPos, xGen;
};
struct _Sense_xr
{
GtkWidget *type_optionmenu, *combo, *combo_entry;
xmlNodePtr xRef, xType;
};
struct _Sense
{
int nr;// zero based
GtkWidget *frame, *table, *label,
*domain_label, *domain_optionmenu,
*register_label, *register_optionmenu,
*tr_label, *tr_vbox,
*tr_hbuttonbox, *tr_add_button, *tr_add_alignment, *tr_add_hbox,
*tr_add_image, *tr_add_label, *tr_delete_button, *tr_delete_alignment,
*tr_delete_hbox, *tr_delete_image, *tr_delete_label,
*def_label, *note_label, *note_entry, *def_entry,
*example_label, *example_entry, *example_tr_entry,
*xr_label, *xr_table,
*xr_hbuttonbox, *xr_add_button, *xr_add_alignment, *xr_add_hbox,
*xr_add_image, *xr_add_label, *xr_delete_button, *xr_delete_alignment,
*xr_hbox, *xr_delete_image, *xr_delete_label;
GArray *trans, *xr;
xmlNodePtr xSense, xDef, xNote, xUsg, xRegister, xEx, xExTr;
};
// global variables
// senses of the currently edited entry in Form view
extern GArray *senses;
extern gboolean form_modified;
GtkWidget *create_menu(GtkOptionMenu *parent, const char *accel_path,
const Values *v);
// used in callbacks.c
Sense_trans *sense_append_trans(const Sense *s);
Sense *senses_append(GArray *senses);
void senses_remove_last(GArray *senses);
// used in callbacks.c
gboolean xml2form(const xmlNodePtr entry, GArray *senses);
xmlNodePtr form2xml(const GArray *senses);
+73
View File
@@ -0,0 +1,73 @@
/** @file
* @brief Contains the main() function
*/
#ifdef HAVE_CONFIG_H
# include <config.h>
#endif
#include <gnome.h>
#include <glade/glade.h>
#include "callbacks.h"
const char *glade_filename;
GladeXML *my_glade_xml;
GtkWidget* app1;
int
main (int argc, char *argv[])
{
// g_thread_supported() should be renamed to g_thread_initialized()
if(!g_thread_supported()) g_thread_init(NULL);
// these functions are provided by libbonobo
bindtextdomain(GETTEXT_PACKAGE, PACKAGE_LOCALE_DIR);
bind_textdomain_codeset(GETTEXT_PACKAGE, "UTF-8");
textdomain(GETTEXT_PACKAGE);
GnomeProgram *app = gnome_program_init (PACKAGE, VERSION, LIBGNOMEUI_MODULE,
argc, argv,
GNOME_PARAM_APP_DATADIR, PACKAGE_DATA_DIR,
LIBGNOMEUI_PARAM_DEFAULT_ICON,
PACKAGE_DATA_DIR "/" PACKAGE "/freedict.png",
NULL);
// set selected_filename with name of file to open on start
poptContext con;
g_object_get(G_OBJECT(app), GNOME_PARAM_POPT_CONTEXT, &con, NULL);
extern char *selected_filename;
selected_filename = (char *) poptGetArg(con);
poptFreeContext(con);
glade_gnome_init();
if(g_file_test(PACKAGE_DATA_DIR "/" PACKAGE "/freedict-editor.glade", G_FILE_TEST_EXISTS))
glade_filename = PACKAGE_DATA_DIR "/" PACKAGE "/freedict-editor.glade";
else if(g_file_test("freedict-editor.glade", G_FILE_TEST_EXISTS))
glade_filename = "freedict-editor.glade";
else if(g_file_test("../freedict-editor.glade", G_FILE_TEST_EXISTS))
glade_filename = "../freedict-editor.glade";
my_glade_xml = glade_xml_new(glade_filename, NULL, NULL);
if(!my_glade_xml) {
fprintf(stderr, _("Failed to load glade interface description. "
"I tried '%s', '%s' and '%s'.\n"),
PACKAGE_DATA_DIR "/" PACKAGE "/freedict-editor.glade",
"freedict-editor.glade",
"../freedict-editor.glade");
return 1;
}
glade_xml_signal_autoconnect(my_glade_xml);
app1 = glade_xml_get_widget(my_glade_xml, "app1");
gtk_widget_show_all(app1);
on_app1_show(NULL, NULL);// XXX this event handler is not called by show_all?
extern void myload(const char *filename);
if(selected_filename) myload(selected_filename);
gtk_main();
return 0;
}
+154
View File
@@ -0,0 +1,154 @@
/** @file
* @brief Utility functions for the Graphical User Inferface
*/
#include "utils.h"
// for PACKAGE_NAME
#include "config.h"
#include <glade/glade.h>
/// GladeXML object of the application to access widgets
extern GladeXML *my_glade_xml;
// for fill_form()
#include "entryedit.h"
// remember to use "%%" in the format string to output a literal '%'
void mystatus(const char *format, ...)
{
va_list args;
gchar buffer[200];
va_start(args, format);
g_vsnprintf(buffer, 200, format, args);
gnome_appbar_set_status(GNOME_APPBAR(glade_xml_get_widget(my_glade_xml, "appbar1")), buffer);
va_end(args);
}
// shows the XML dump of n in textview1
void show_in_textview1(const xmlNodePtr n)
{
xmlBufferPtr buf = xmlBufferCreate();
int ret2 = xmlNodeDump(buf, teidoc, n, 0, 1);
g_assert(ret2 != -1);
// XXX make textview1 global var to save lookups
GtkTextView *textview1 = GTK_TEXT_VIEW(glade_xml_get_widget(my_glade_xml, "textview1"));
GtkTextBuffer* b = gtk_text_view_get_buffer(textview1);
gtk_text_buffer_set_text(b, (char *) xmlBufferContent(buf), -1);
xmlBufferFree(buf);
gtk_text_buffer_set_modified(b, FALSE);
// XXX make sure notebook1 shows page 0 (XML view)
}
void on_file_modified_changed();
void on_form_modified_changed();
// side effect: changes the edit mode (XML or Form)
// maybe we should try form mode only when option "Always try Form mode" enabled
void set_edited_node(const xmlNodePtr n)
{
// XXX nb1 could be a global var inited at startup
GtkWidget *nb1 = glade_xml_get_widget(my_glade_xml, "notebook1");
gtk_widget_set_sensitive(nb1, n!=NULL);
gboolean is_entry = n && !strcmp((char *) n->name, "entry");
gtk_widget_set_sensitive(glade_xml_get_widget(my_glade_xml, "delete_button"), is_entry);
gtk_widget_set_sensitive(glade_xml_get_widget(my_glade_xml, "delete_entry1"), is_entry);
// XXX maybe we should refuse to set a new edited_node when
// the currently edited one is not saved yet (or try to auto-save it)
// this should ease the problem of on_notebook1_switch_page()
// that it has to prevent switching if auto-save fails.
// but then, how to handle the user switching to the other view?
// temporarily set edited_node to NULL so on_notebook1_switch_page()
// doesn't disturb us
edited_node = NULL;
// en-/disable switching to Form View
gtk_widget_set_sensitive(glade_xml_get_widget(my_glade_xml, "form_view_label"), is_entry);
if(n)
{
if(!is_entry || !xml2form(n, senses))
{
show_in_textview1(n);
gtk_notebook_set_current_page(GTK_NOTEBOOK(nb1), 0);
}
else
gtk_notebook_set_current_page(GTK_NOTEBOOK(nb1), 1);
}
else
{
GtkTextView *textview1 = GTK_TEXT_VIEW(glade_xml_get_widget(my_glade_xml, "textview1"));
GtkTextBuffer* b = gtk_text_view_get_buffer(textview1);
// XXX make a wizard out of this?
// should show only "No XML chunk currently edited."
char text[] =
N_("1. Open a TEI file\n"
"2. Modify the XPath select expression to match\n"
"\tthe entries you desire to edit\n"
"3. Double-click on an entry headword in the list\n"
"\tof matching entries to the right!");
gtk_text_buffer_set_text(b, _(text), -1);
GtkTextIter start, end;
gtk_text_buffer_get_iter_at_offset(b, &start, 0);
gtk_text_buffer_get_iter_at_offset(b, &end, sizeof(text));
gtk_text_buffer_apply_tag_by_name(b, "instructions", &start, &end);
}
edited_node = n;
if(form_modified) { form_modified = FALSE; on_form_modified_changed(); }
}
void on_file_modified_changed()
{
gtk_widget_set_sensitive(glade_xml_get_widget(my_glade_xml, "save_button"),
file_modified);
gtk_widget_set_sensitive(glade_xml_get_widget(my_glade_xml, "save1"), file_modified);
gtk_widget_set_sensitive(glade_xml_get_widget(my_glade_xml, "save_as1"), file_modified);
}
void setTeidoc(const xmlDocPtr t)
{
gboolean sensitive = t ? TRUE : FALSE;
file_modified = FALSE;
gtk_widget_set_sensitive(glade_xml_get_widget(my_glade_xml, "save_button"), FALSE);
gtk_widget_set_sensitive(glade_xml_get_widget(my_glade_xml, "save_entry1"), FALSE);
gtk_widget_set_sensitive(glade_xml_get_widget(my_glade_xml, "save1"), FALSE);
gtk_widget_set_sensitive(glade_xml_get_widget(my_glade_xml, "save_as1"), FALSE);
gtk_widget_set_sensitive(glade_xml_get_widget(my_glade_xml, "new_entry_button"), sensitive);
gtk_widget_set_sensitive(glade_xml_get_widget(my_glade_xml, "add_new_entry1"), sensitive);
gtk_widget_set_sensitive(glade_xml_get_widget(my_glade_xml, "select_entry"), sensitive);
gtk_widget_set_sensitive(glade_xml_get_widget(my_glade_xml, "spell_check1"), sensitive);
gtk_widget_set_sensitive(glade_xml_get_widget(my_glade_xml, "new_file_button"), !t);
gtk_widget_set_sensitive(glade_xml_get_widget(my_glade_xml, "new1"), !t);
gtk_window_set_title(GTK_WINDOW(app1),
(t && selected_filename) ? selected_filename : PACKAGE_NAME);
teidoc = t;
set_edited_node(NULL);
}
void mysave(void)
{
g_return_if_fail(teidoc);
int ret = xmlSaveFile(selected_filename, teidoc);
if(ret==-1)
{
mystatus(_("Saving to %s failed."), selected_filename);
}
if(file_modified)
{ file_modified = FALSE; on_file_modified_changed(); }
mystatus(_("Saved."));
}
+17
View File
@@ -0,0 +1,17 @@
#include "callbacks.h"
// global variables
extern GtkWidget* app1;
extern xmlDocPtr teidoc, entry_template_doc;
extern xmlNodePtr edited_node;
extern char *selected_filename;
extern int save_as_mode;
extern gboolean file_modified;
// GUI utility functions
void mystatus(const char *format, ...);
void show_in_textview1(const xmlNodePtr n);
void set_edited_node(const xmlNodePtr n);
void setTeidoc(const xmlDocPtr t);
void on_file_modified_changed();
void mysave(void);
+272
View File
@@ -0,0 +1,272 @@
/** @file
* @brief Implementation of a list of string labels and corresponding string
* values
*
* These lists are to be used as option menu contents and TEI typologies.
*/
#include "values.h"
// these are initialized by on_app1_show() in callbacks.c
Values *pos_values,
*num_values,
*domain_values,
*register_values,
*xr_values,
*gen_values;
/// Frees a GSList, but contrary to g_slist_free() frees the data of the elements first
void my_g_slist_free_all(GSList *g)
{
void my_g_slist_free_list_element(gpointer data, gpointer user_data)
{ g_free(data); }
g_slist_foreach(g, my_g_slist_free_list_element, NULL);
g_slist_free(g);
}
/// Convert a Values array into a GSList
/**
* The labels and values of the elements of the Values array
* are concatenated using TAB characters.
*
* @retval Pointer to a newly allocated GSList
*
*/
GSList *Values2GSList(const Values *values)
{
GSList *g = NULL;
int i = 0;
while(values && values->label && values->value)
{
GSList *g_old = g;
int lenlabel = strlen(values->label);
char *data = (char *) g_malloc(lenlabel+strlen(values->value)+1);
strncpy(data, values->label, lenlabel);
char *data1 = data + lenlabel;
*data1 = '\t';
strcpy(data1+1, values->value);
g = g_slist_prepend(g_old, data);
if(!g)
{
my_g_slist_free_all(g_old);
return NULL;
}
values++;
i++;
}
return g;
}
/// Convert a GSList to a Values array
/**
* The labels and values of the elements of the Values array are made by
* splitting the elements of the GSList at TAB characters.
*
* The caller is responsible for freeing the Values array, as well as all
* its elements' labels and values.
*
* @retval Pointer to a newly allocated Values array
*
*/
Values *GSList2Values(GSList *g)
{
g_return_val_if_fail(g, NULL);
guint l = g_slist_length(g);
Values *v0 = (Values *) g_malloc(sizeof(Values) * (l+1));
g_return_val_if_fail(v0, NULL);
Values *v = v0;
g_printerr(_("GSList2Values: length=%i sizeof(Values)=%i\n"), l, sizeof(Values));
while(g)
{
char *value = index(g->data, '\t');
g_assert(value);
int lenlabel = (guint) value - (guint) g->data;
v->label = g_malloc(lenlabel+1);
strncpy(v->label, g->data, lenlabel);
*(v->label+lenlabel) = 0;
value++;
int lenvalue = strlen(value);
v->value = g_malloc(lenvalue+1);
strncpy(v->value, value, lenvalue+1);
g_printerr(_(" label: '%s' value: '%s'\n"), v->label, v->value);
v++;
g = g->next;
}
v->label = NULL;
v->value = NULL;
return v0;
}
void my_free_values_array(Values **v)
{
g_return_if_fail(v);
if(*v == gen_values) return;
if(*v == xr_values) return;
if(*v == pos_values) return;
if(*v == num_values) return;
if(*v == domain_values) return;
Values *i = *v;
while(i && i->value)
{
g_free(i->label);
g_free(i->value);
i++;
}
g_free(v);
*v = NULL;
}
/// Return the value of the Values array that corresponds to index
/** @retval NULL out of bounds
*/
const gchar *index2value(const Values *values, const int index)
{
g_return_val_if_fail(values, NULL);
int i = 0;
// use 'while' even though we can just index into values[],
// because we don't know the array length
while(values && i<index && values->value) { values++; i++; }
if(values && values->value) return values->value;
return NULL;
}
/// Return the index in the Values array that corresponds to value
/** @retval -1 unknown value
*/
int value2index(const Values *values, const gchar *value)
{
g_return_val_if_fail(values, -1);
if(!value) return 0;
int i = 0;
while(values && values->value)
{
if(!strcmp(value, values->value)) return i;
values++;
i++;
}
return -1;
}
// typology for cross references
const Values xr_values_default[] = {
{ N_("Undetermined"), "" },
{ N_("Antonym"), "ant" },
{ N_("Hypernym"), "hyper" },
{ N_("Hyponym"), "hypo" },
{ N_("Synonym"), "syn" },
{ N_("Derived from"), "der" },
{ NULL }
};
const Values pos_values_default[] = {
{ N_("None"), "" },
{ N_("_Noun"), "n" },
{ N_("Verb"), "v" },
{ N_("Transitive Verb"), "vt" },
{ N_("Intransitive Verb"), "vi" },
{ N_("Transitive and intransitive Verb"), "vti" },
{ N_("Adverb"), "adv" },
{ N_("_Adjective"), "adj" },
{ N_("Conjunction"), "conj" },
{ N_("_Preposition"), "prep" },
{ N_("_Interjection"), "interj" },
{ N_("Pronoun"), "pron" },
{ N_("Article"), "art" },
{ N_("Numeral"), "num" },
{ N_("Imitative"), "imit" },
{ N_("Abbreviation"), "abbr" },
{ N_("Phrase"), "phra" },
{ NULL }
};
const Values gen_values_default[] = {
{ N_("None"), "" },
{ N_("Masculine"), "m" },
{ N_("_Feminine"), "f" },
{ N_("Neuter"), "n" },
{ N_("Common"), "i" },
{ N_("Masc. & Fem."), "mf" },
{ N_("Masc., Fem. & Neut."), "mfn" },
{ NULL }
};
const Values num_values_default[] = {
{ N_("None"), "" },
{ N_("_Singular"), "sg" },
{ N_("Dual"), "du" },
{ N_("Plural"), "pl" },
{ NULL }
};
// TEI 12.3.5.2 Usage Information and Other Labels
// Encoded as <usg type="dom">agr</usg>
// in German: "Sachgebiete"
const Values domain_values_default[] = {
{ N_("_None"), "" },
// taken from fdicts.com
{ N_("_Agriculture"), "agr" },
{ N_("Astronomy"), "astr" },
{ N_("Automobile"), "aut" },
{ N_("_Biology"), "bio" },
{ N_("B_otany"), "bot" },
{ N_("_Chemistry"), "chem" },
{ N_("_Electrotechnics"), "el" },
{ N_("_Finance"), "fin" },
{ N_("_Geography"), "geo" },
{ N_("Geolog_y"), "geol" },
{ N_("Grammar"), "gram" },
{ N_("_History"), "hist" },
{ N_("_Information Technology"), "it" },
{ N_("_Law"), "law" },
{ N_("_Mathematics"), "math" },
{ N_("Me_dicine"), "med" },
{ N_("Military"), "mil" },
{ N_("M_usic"), "mus" },
{ N_("Myth_ology"), "myt" },
{ N_("_Physics"), "phy" },
{ N_("Politics"), "pol" },
{ N_("_Religion"), "rel" },
{ N_("_Sexual"), "sex" },
{ N_("Sport"), "sport" },
{ N_("_Technology"), "tech" },
{ NULL }
};
// Encoded as <usg type="reg">official</usg>
// these are a bit arbitrary
const Values register_values_default[] = {
{ N_("_None"), "" },
// the word is used in official communication
{ N_("_Official"), "official" },
// same as official, maybe a bit less, suggested by TEI 12.3.5.2
{ N_("_Formal"), "formal" },
// the word is used to communicate with small children and by them
{ N_("Ch_ildren Speech"), "chil" },
// the word is used in informal context, like at home
{ N_("_Colloquial"), "col" },
// the word is used by certain groups of society only,
// suggested by TEI 12.3.5.2
{ N_("_Slang"), "slang" },
// ithe word is used by uneducated people
{ N_("_Vulgar"), "vulg" },
// the word should not be used?, suggested by TEI 12.3.5.2
{ N_("_Taboo"), "taboo" },
// the word is used mainly in ironic remarks?,
// suggested by TEI 12.3.5.2
{ N_("_Ironic"), "ironic" },
// the word is used mainly in funny context eg. jokes?,
// suggested by TEI 12.3.5.2
{ N_("_Facetious"), "facetious" },
{ NULL }
};
+31
View File
@@ -0,0 +1,31 @@
#include <gnome.h>
// a type for option menu contents
typedef struct _Values Values;
struct _Values
{
char *label;
char *value;
};
// export these variables, so they can be used in callbacks.c
extern const Values pos_values_default[],
num_values_default[],
domain_values_default[],
register_values_default[],
xr_values_default[],
gen_values_default[];
extern Values *pos_values,
*num_values,
*domain_values,
*register_values,
*xr_values,
*gen_values;
void my_g_slist_free_all(GSList *g);
GSList *Values2GSList(const Values *values);
Values *GSList2Values(GSList *g);
void my_free_values_array(Values **v);
const gchar *index2value(const Values *values, const int index);
int value2index(const Values *values, const gchar *value);
+478
View File
@@ -0,0 +1,478 @@
/** @file
* @brief XML/XPath/XSLT Utility functions
*/
#include "xml.h"
#include <gnome.h>
#include <libxml/xpathInternals.h>
/////////////////////////////////////////////////////////////////////////
// libxslt/XPath extension functions
/////////////////////////////////////////////////////////////////////////
/** This extension function is designed to be used in a sanity test with an
* XPath expression like this:
* "//entry[ fd:unbalanced-braces(.//orth | .//tr | .//note | .//def | .//q) ]"
* Before its use, a namespace prefix like "fd" has to be bound to
* FREEDICT_EDITOR_NAMESPACE.
*/
static void freedict_xpath_extension_unbalanced_braces(
xmlXPathParserContextPtr ctxt, const int nargs)
{
if(nargs != 1)
{
xmlXPathSetArityError(ctxt);
return;
}
xmlNodeSetPtr ns = xmlXPathPopNodeSet(ctxt);
if(xmlXPathCheckError(ctxt) || !ns)
{
xmlXPathFreeNodeSet(ns);
return;
}
// function that does the actual parsing
// returns TRUE if a brace of the string in c does not have
// a corresponding brace
gboolean contains_unbalanced_braces(xmlChar *c)
{
if(!c) return FALSE;
char stack[100];
int stackend = sizeof(stack);
// returns FALSE on stack full
gboolean cub_push(const char b)
{
if(!stackend)
{
g_printerr(G_STRLOC ": Too many open braces");
return FALSE;
}
stack[--stackend] = b;
return TRUE;
}
gchar cub_pop()
{
// stack is empty
if(stackend>=sizeof(stack)) return 'E';
return stack[stackend++];
}
do
{
switch(*c)
{
case '(': if(!cub_push('(')) return TRUE; break;
case '[': if(!cub_push('[')) return TRUE; break;
case '{': if(!cub_push('{')) return TRUE; break;
case ')': if(cub_pop()!='(') return TRUE;break;
case ']': if(cub_pop()!='[') return TRUE;break;
case '}': if(cub_pop()!='{') return TRUE;break;
// all other characters are skipped
}
c++;
}
while(*c);
// braces left open?
if(cub_pop()!='E') return TRUE;
// this string is well formed in regard of braces
return FALSE;
}
int result = FALSE;
int i;
for(i=0; i < xmlXPathNodeSetGetLength(ns); i++)
{
xmlNodePtr n = xmlXPathNodeSetItem(ns, i);
xmlChar* c = xmlNodeGetContent(n);
if(!c) continue;
result = contains_unbalanced_braces(c);
xmlFree(c);
if(result) break;
}
if(ns) xmlXPathFreeNodeSet(ns);
xmlXPathReturnBoolean(ctxt, result);
}
/// Call this on application startup. Or not, since it is presently unused...
void register_freedict_xpath_extension_functions(void)
{
// g_printerr("Registering XPath extension functions in namespace "
// FREEDICT_EDITOR_NAMESPACE "\n");
/*
// The following should result in xmlXPathRegisterNs and
// xmlXPathRegisterFuncNS being called. But since that does not
// happen apparently, we register our extension function
// "manually" in find_node_set()
xsltRegisterExtModuleFunction ((const xmlChar *) "unbalanced-braces",
(const xmlChar *) FREEDICT_XSLT_NAMESPACE,
freedict_xpath_extension_unbalanced_braces);
*/
}
/////////////////////////////////////////////////////////////////////////
// General XML/XPath utility functions
/////////////////////////////////////////////////////////////////////////
xmlDocPtr copy_node_to_doc(const xmlNodePtr node)
{
g_return_val_if_fail(node, NULL);
xmlDocPtr doc = xmlNewDoc((xmlChar *) XML_DEFAULT_VERSION);
xmlNodePtr root = xmlDocCopyNode(node, doc, 1);// copies recursively
xmlDocSetRootElement(doc, root);
g_assert(doc);
return doc;
}
// Th error code XPATH_INVALID_CTXT exists only since libxml2 2.6.0, so
// we define it if we use an earlier version
#if LIBXML_VERSION < 20600
#define XPATH_INVALID_CTXT XPATH_EXPR_ERROR
#endif
// XXX report the fillowing fix
// xmlXPatherror takes an XPath parser context, not a plain XPath context,
// so this macro from the libxml2 source is incorrect, causing gcc to give a
// "warning: passing arg 1 of `xmlXPatherror' from incompatible pointer type"
// (since a parser context has no "doc" member, the macro actually is
// for checking a plain context!)
/*#define CHECK_CONTEXT(ctxt) \
if ((ctxt == NULL) || (ctxt->doc == NULL) || \
(ctxt->doc->children == NULL)) { \
xmlXPatherror(ctxt, __FILE__, __LINE__, XPATH_INVALID_CTXT); \
return(NULL); \
}
*/
// therefore I have extended it with another parameter
#define CHECK_CONTEXT(ctxt, pctxt) \
if ((ctxt == NULL) || (ctxt->doc == NULL) || \
(ctxt->doc->children == NULL)) { \
xmlXPatherror(pctxt, __FILE__, __LINE__, XPATH_INVALID_CTXT); \
return(NULL); \
}
extern GMutex *find_nodeset_pcontext_mutex;
/**
* @arg str the XPath expression
* @arg ctxt the XPath context
* @arg pctxt pointer to a XPath Parser context pointer
*
* Evaluate the XPath expression in the given context. The XPath Parser
* context is saved in pctxt, so that it can be accessed from another thread.
* Especially the error state is interesting, since it can be used to stop a
* never ending evaluation.
*
* Taken from xpath.c in libxml2-2.6.16.
*
* @return the xmlXPathObjectPtr resulting from the evaluation or NULL.
* The caller has to free the object.
*/
xmlXPathObjectPtr
my_xmlXPathEvalExpression(const xmlChar *str, xmlXPathContextPtr ctxt, xmlXPathParserContextPtr *pctxt) {
xmlXPathObjectPtr res, tmp;
int stack = 0;
xmlXPathInit();
// it is nice that gcc gives no warning anymore,
// but the bad thing is that *pctxt normally is still NULL at this point
CHECK_CONTEXT(ctxt,*pctxt)
g_mutex_lock(find_nodeset_pcontext_mutex);
//g_printerr("Allocating parser context\n");
*pctxt = xmlXPathNewParserContext(str, ctxt);
g_mutex_unlock(find_nodeset_pcontext_mutex);
xmlXPathEvalExpr(*pctxt);
if (*(*pctxt)->cur != 0) {
xmlXPatherror(*pctxt, __FILE__, __LINE__, XPATH_EXPR_ERROR);
res = NULL;
} else {
res = valuePop(*pctxt);
}
do {
tmp = valuePop(*pctxt);
if (tmp != NULL) {
xmlXPathFreeObject(tmp);
stack++;
}
} while (tmp != NULL);
if ((stack != 0) && (res != NULL)) {
xmlGenericError(xmlGenericErrorContext,
"xmlXPathEvalExpression: %d object left on the stack\n",
stack);
}
g_mutex_lock(find_nodeset_pcontext_mutex);
xmlXPathFreeParserContext(*pctxt);
*pctxt = NULL;
//g_printerr("Freed parser context\n");
g_mutex_unlock(find_nodeset_pcontext_mutex);
return(res);
}
/// Evaluate an XPath expression
/**
* @arg xpath XPath expression to evaluate
* @doc document over which to evaluate
* @arg pctxt can be NULL
* @return list of matching nodes. The caller will have to free it using xmlXPathFreeNodeSet().
*/
xmlNodeSetPtr find_node_set(const char *xpath, const xmlDocPtr doc, xmlXPathParserContextPtr *pctxt)
{
xmlXPathContextPtr ctxt = xmlXPathNewContext(doc);
if(!ctxt)
{
g_printerr(G_STRLOC ": Failed to allocate XPathContext!\n");
return NULL;
}
if(xmlXPathRegisterNs(ctxt, (xmlChar *) FREEDICT_EDITOR_NAMESPACE_PREFIX, (xmlChar *) FREEDICT_EDITOR_NAMESPACE))
{
g_printerr("Warning: Unable to register XSLT-Namespace prefix \"%s\""
" for URI \"%s\"\n", FREEDICT_EDITOR_NAMESPACE_PREFIX, FREEDICT_EDITOR_NAMESPACE);
}
if(xmlXPathRegisterFuncNS(ctxt, (xmlChar *) "unbalanced-braces",
(xmlChar *) FREEDICT_EDITOR_NAMESPACE, freedict_xpath_extension_unbalanced_braces))
g_printerr("Warning: Unable to register XPath extension function "
"\"unbalanced-braces\" for URI \"%s\"\n", FREEDICT_EDITOR_NAMESPACE);
xmlXPathParserContextPtr pctxt2;
if(!pctxt) pctxt = &pctxt2;
xmlXPathObjectPtr xpobj = my_xmlXPathEvalExpression((xmlChar *) xpath, ctxt, pctxt);
if(!xpobj)
{
g_printerr(G_STRLOC ": No XPathObject!\n");
xmlXPathFreeContext(ctxt);
return NULL;
}
if(!(xpobj->nodesetval))
{
g_printerr(G_STRLOC ": No nodeset!\n");
xmlXPathFreeObject(xpobj);
xmlXPathFreeContext(ctxt);
return NULL;
}
if(!(xpobj->nodesetval->nodeNr))
{
//g_printerr("0 nodes!\n");
xmlXPathFreeObject(xpobj);
xmlXPathFreeContext(ctxt);
return NULL;
}
xmlXPathFreeContext(ctxt);
xmlNodeSetPtr nodes = xmlMalloc(sizeof(xmlNodeSet));
// XXX copying is slow...
memcpy(nodes, xpobj->nodesetval, sizeof(xmlNodeSet));
// I don't understand the naming of this function. According to the
// documentation, it frees xpobj, but not its nodelist, if it
// contained one. So it should be called xmlXPathFreeObjectButNotNodeSetList().
xmlXPathFreeNodeSetList(xpobj);
return nodes;
}
xmlNodePtr find_single_node(const char *xpath, const xmlDocPtr doc)
{
xmlNodeSetPtr nodes = find_node_set(xpath, doc, NULL);
if(!nodes) return NULL;
if(nodes->nodeNr>1)
g_printerr(_("%s: %i matching nodes (only 1 expected). Taking first.\n"),
G_STRLOC, nodes->nodeNr);
xmlNodePtr bodyNode = *(nodes->nodeTab);
xmlXPathFreeNodeSet(nodes);
return bodyNode;
}
/** Checks whether @a n has only allowed attrbutes and attr contents,
* as well as only children of type TEXT
*
* @arg attrs list of allowed attribute names
* @arg attr_contents list of allowed attribute contents
* (if an entry is NULL, any contetn is allowed)
*/
gboolean has_only_text_children_and_allowed_attrs(const xmlNodePtr n,
const char **attrs, const char **attr_contents)
{
g_return_val_if_fail(n, FALSE);
// elements may have only the mentioned attributes
if(n->type==XML_ELEMENT_NODE)
{
//g_debug("checking elem '%s'...", n->name);
// if there are attributes
if(n->properties)
{
g_debug("checking element with attrs... ");
// if there are no attributes allowed
if(!attrs) return FALSE;
g_debug("certain attrs are allowed. ");
// for all attributes of the element
xmlAttr *nattrs = n->properties;
while(nattrs)
{
g_return_val_if_fail(nattrs->name, FALSE);
// check whether attribute is in list of allowed attribute names
gboolean allowed = FALSE;
const char **attr = attrs;
const char **attr_content = attr_contents;
xmlChar *attr_value = xmlNodeGetContent(nattrs->children);
g_debug("element attr '%s': value='%s'", nattrs->name, attr_value);
while(*attr)
{
// if allowed node exists
g_debug("checking allowed attr '%s': attr_content='%s' ", *attr,
*attr_content);
if(!strcmp((char *) nattrs->name, (char *) *attr) &&
(!attr_content ||
!strcmp((char *) attr_value, (char *) *attr_content)))
{ allowed = TRUE; break; }
attr++;
if(attr_content) attr_content++;
}
g_debug("%i ", allowed);
xmlFree(attr_value);
if(!allowed) return FALSE;
nattrs = nattrs->next;
}
}
//g_debug("elem passed allowed attr check.\n");
}
// if we reach here, element has only allowed attributes:
// check that it has only text children
xmlNodePtr n2 = n->children;
while(n2)
{
if(!xmlNodeIsText(n2)) return FALSE;
g_assert(n2->children == NULL);
n2 = n2->next;
}
return TRUE;
}
/// Look for a matching leaf node
/** This function evaluates an XPath expression. The result should be a single
* node with only text children and the attributes listed in @a attrs. If such
* node exists, it is unlinked and returned. If there is no such leaf, no
* unlinking is done and @a can is set to FALSE.
*
* @return The unlinked node. It has to be freed by the caller with xmlFreeNode().
* @retval NULL if no matching leaf node was found
*/
xmlNodePtr unlink_leaf_node_with_attr(const char *xpath,
const char **attrs, const char **attr_contents,
const xmlDocPtr doc, gboolean *can)
{
g_return_val_if_fail(xpath && doc && can, NULL);
xmlNodePtr n = find_single_node(xpath, doc);
if(!n) return NULL;
if(!has_only_text_children_and_allowed_attrs(n, attrs, attr_contents))
{
*can = FALSE;
return NULL;
}
xmlUnlinkNode(n);
return n;
}
xmlNodePtr string2xmlNode(const xmlNodePtr parent, const gchar *before,
const gchar *name, const gchar *content, const gchar *after)
{
g_return_val_if_fail(name, NULL);
xmlNodeAddContent(parent, (xmlChar *) before);
xmlNodePtr newNode = xmlNewChild(parent, NULL,
(xmlChar *) name, (xmlChar *) content);
xmlNodeAddContent(parent, (xmlChar *) after);
return newNode;
}
/// Join orth elements of an entry with commas
/** @arg n entry node
* @arg len size of @a *s in bytes
* @arg s pointer where result will be saved, error string on failure
* @retval TRUE on success
* @retval FALSE on error
*/
gboolean entry_orths_to_string(xmlNodePtr n, int len, char *s)
{
g_return_val_if_fail(n, FALSE);
g_return_val_if_fail(s, FALSE);
g_return_val_if_fail(len>0, FALSE);
xmlDocPtr doc = copy_node_to_doc(n);
// find the orth children of the current entry
xmlNodeSetPtr set = find_node_set("/entry/form/orth", doc, NULL);
if(!set || !set->nodeNr)
{
g_strlcpy(s, _("No nodes (form/orth)!"), len);
if(set) xmlXPathFreeNodeSet(set);
xmlFreeDoc(doc);
return FALSE;
}
// alloc temporary buffer
// if glib offered g_utf8_strlcat(), we would not need
// this buffer
char *e = (char *) g_malloc(len);
e[0] = '\0';
int i;
xmlNodePtr *n2;
for(i=0, n2 = set->nodeTab; *n2 && i<set->nodeNr; n2++, i++)
{
xmlChar* content = xmlNodeGetContent(*n2);
int l = strlen(e);
if(l) g_strlcat(e, ", ", len);
if(!content) g_strlcat(e, "(null)", len);
else g_strlcat(e, (gchar *) content, len);
if(content) xmlFree(content);
}
xmlXPathFreeNodeSet(set);
// copy again, caring for utf8 chars longer than 1 byte
g_utf8_strncpy(s, e, len/2);
g_free(e);
xmlFreeDoc(doc);
return TRUE;
}
+19
View File
@@ -0,0 +1,19 @@
#include <libxml/parser.h>
#include <libxml/xpath.h>
#include <glib.h>
// For XPath extension function(s)
#define FREEDICT_EDITOR_NAMESPACE "http://freedict.org/freedict-editor"
#define FREEDICT_EDITOR_NAMESPACE_PREFIX "fd"
// General XML/XPath utility functions
xmlDocPtr copy_node_to_doc(const xmlNodePtr node);
xmlNodePtr find_single_node(const char *xpath, const xmlDocPtr doc);
xmlNodeSetPtr find_node_set(const char *xpath, const xmlDocPtr doc, xmlXPathParserContextPtr *pctxt);
xmlNodePtr unlink_leaf_node_with_attr(const char *xpath,
const char **attrs, const char **attr_contents,
const xmlDocPtr doc, gboolean *can);
xmlNodePtr string2xmlNode(const xmlNodePtr parent, const char *before,
const char *name, const char *content, const char *after);
gboolean entry_orths_to_string(xmlNodePtr n, int len, char *s);
+95
View File
@@ -0,0 +1,95 @@
#
# No modifications of this Makefile should be necessary.
#
# To use this template:
# 1) Define: figdir, docname, lang, omffile, and entities in
# your Makefile.am file for each document directory,
# although figdir, omffile, and entities may be empty
# 2) Make sure the Makefile in (1) also includes
# "include $(top_srcdir)/xmldocs.make" and
# "dist-hook: app-dist-hook".
# 3) Optionally define 'entities' to hold xml entities which
# you would also like installed
# 4) Figures must go under $(figdir)/ and be in PNG format
# 5) You should only have one document per directory
# 6) Note that the figure directory, $(figdir)/, should not have its
# own Makefile since this Makefile installs those figures.
#
# example Makefile.am:
# figdir = figures
# docname = scrollkeeper-manual
# lang = C
# omffile=scrollkeeper-manual-C.omf
# entities = fdl.xml
# include $(top_srcdir)/xmldocs.make
# dist-hook: app-dist-hook
#
# About this file:
# This file was taken from scrollkeeper_example2, a package illustrating
# how to install documentation and OMF files for use with ScrollKeeper
# 0.3.x and 0.4.x. For more information, see:
# http://scrollkeeper.sourceforge.net/
# Version: 0.1.2 (last updated: March 20, 2002)
#
# ********** Begin of section some packagers may need to modify **********
# This variable (docdir) specifies where the documents should be installed.
# This default value should work for most packages.
docdir = $(datadir)/gnome/help/$(docname)/$(lang)
# ********** You should not have to edit below this line **********
xml_files = $(entities) $(docname).xml
EXTRA_DIST = $(xml_files) $(omffile)
CLEANFILES = omf_timestamp
include $(top_srcdir)/omf.make
all: omf
$(docname).xml: $(entities)
-ourdir=`pwd`; \
cd $(srcdir); \
cp $(entities) $$ourdir
app-dist-hook:
if test "$(figdir)"; then \
$(mkinstalldirs) $(distdir)/$(figdir); \
for file in $(srcdir)/$(figdir)/*.png; do \
basefile=`echo $$file | sed -e 's,^.*/,,'`; \
$(INSTALL_DATA) $$file $(distdir)/$(figdir)/$$basefile; \
done \
fi
install-data-local: omf
$(mkinstalldirs) $(DESTDIR)$(docdir)
for file in $(xml_files); do \
cp $(srcdir)/$$file $(DESTDIR)$(docdir); \
done
if test "$(figdir)"; then \
$(mkinstalldirs) $(DESTDIR)$(docdir)/$(figdir); \
for file in $(srcdir)/$(figdir)/*.png; do \
basefile=`echo $$file | sed -e 's,^.*/,,'`; \
$(INSTALL_DATA) $$file $(DESTDIR)$(docdir)/$(figdir)/$$basefile; \
done \
fi
install-data-hook: install-data-hook-omf
uninstall-local: uninstall-local-doc uninstall-local-omf
uninstall-local-doc:
-if test "$(figdir)"; then \
for file in $(srcdir)/$(figdir)/*.png; do \
basefile=`echo $$file | sed -e 's,^.*/,,'`; \
rm -f $(docdir)/$(figdir)/$$basefile; \
done; \
rmdir $(DESTDIR)$(docdir)/$(figdir); \
fi
-for file in $(xml_files); do \
rm -f $(DESTDIR)$(docdir)/$$file; \
done
-rmdir $(DESTDIR)$(docdir)
clean-local: clean-local-omf