tools/e16menuedit2 -> e16menuedit.

SVN revision: 35618
This commit is contained in:
Kim Woelders 2008-08-23 08:09:04 +00:00
parent f9f44861bf
commit 614ce8bd72
62 changed files with 5897 additions and 0 deletions

17
.cvsignore Normal file
View File

@ -0,0 +1,17 @@
Makefile
Makefile.in
aclocal.m4
autom4te.cache
config.*
configure
intl
libtool
ltmain.sh
m4
stamp-h1
e16menuedit2-*.tar.gz
intltool-*
mkinstalldirs
stamp-h*
.tm_project.cache
e16menuedit2.pws

1
AUTHORS Normal file
View File

@ -0,0 +1 @@
Andreas Volz <linux@brachttal.net> <av>

20
COPYING Normal file
View File

@ -0,0 +1,20 @@
Copyright (C) 2004 Andreas Volz and various contributors
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 of the Software, its documentation and marketing & publicity
materials, and acknowledgment shall be given in the documentation, materials
and software packages that this Software was used.
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 AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

0
ChangeLog Normal file
View File

182
INSTALL Normal file
View File

@ -0,0 +1,182 @@
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, a file
`config.cache' that saves the results of its tests to speed up
reconfiguring, and a file `config.log' containing compiler output
(useful mainly for debugging `configure').
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 at some point `config.cache'
contains results you don't want to keep, you may remove or edit it.
The file `configure.in' is used to create `configure' by a program
called `autoconf'. You only need `configure.in' 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. You can give `configure'
initial values for variables by setting them in the environment. Using
a Bourne-compatible shell, you can do that on the command line like
this:
CC=c89 CFLAGS=-O2 LIBS=-lposix ./configure
Or on systems that have the `env' program, you can do it like this:
env CPPFLAGS=-I/usr/local/include LDFLAGS=-s ./configure
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 supports 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' can not figure out
automatically, but needs to determine by the type of host the package
will run on. Usually `configure' can figure that out, but if it prints
a message saying it can not guess the host type, give it the
`--host=TYPE' option. TYPE can either be a short name for the system
type, such as `sun4', or a canonical name with three fields:
CPU-COMPANY-SYSTEM
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 host type.
If you are building compiler tools for cross-compiling, you can also
use the `--target=TYPE' option to select the type of system they will
produce code for and the `--build=TYPE' option to select the type of
system on which you are compiling the package.
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.
Operation Controls
==================
`configure' recognizes the following options to control how it
operates.
`--cache-file=FILE'
Use and save the results of the tests in FILE instead of
`./config.cache'. Set FILE to `/dev/null' to disable caching, for
debugging `configure'.
`--help'
Print a summary of the options to `configure', and exit.
`--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.
`--version'
Print the version of Autoconf used to generate the `configure'
script, and exit.
`configure' also accepts some other, not widely useful, options.

31
Makefile.am Normal file
View File

@ -0,0 +1,31 @@
## Process this file with automake to produce Makefile.in
SUBDIRS = src po pixmaps help
e16menuedit2docdir = ${prefix}/${packagedocdir}
e16menuedit2doc_DATA = \
README\
COPYING\
AUTHORS\
ChangeLog\
INSTALL\
NEWS\
TODO
GLADE_FILES = e16menuedit2.glade
e16menuedit2datadir = ${prefix}/${packagedatadir}/glade
e16menuedit2data_DATA = \
$(GLADE_FILES)
INTLTOOL_DIST = intltool-extract.in \
intltool-merge.in \
intltool-update.in
EXTRA_DIST = $(INTLTOOL_DIST) \
$(GLADE_FILES) \
xmldocs.make \
omf.make \
e16menuedit2.spec

0
NEWS Normal file
View File

17
README Normal file
View File

@ -0,0 +1,17 @@
Configuration
-------------
e16menuedit2 autodetects your currently active E16 session and
uses the environment variable $ECONFDIR to read from your E16
config directory. If you use E16.7.x or earlier this variable isn't
set and e16menuedit2 read your config from ~/.enlightenment. In E16.8
and later $ECONFDIR is set to ~/.e16.
You could also edit your config files from another E16 version if you
redefine $ECONFDIR:
ECONFDIR="/home/user/.e16" e16menuedit2
If you've some old menu directories in your E16 config directory
you could use -m parameter (see: e16menuedit2 --help) to force
the new menu structure.

8
TODO Normal file
View File

@ -0,0 +1,8 @@
BUGS:
- compressed svg?
- size columns with mouse
FEATURES:
- Gnome2 panel and desktop Drag&Drop support
- KDE Drag&Drop support?
- better info dialog (auto inserted version number)

154
autogen.sh Executable file
View File

@ -0,0 +1,154 @@
#!/bin/sh
# Run this to generate all the initial makefiles, etc.
srcdir=`dirname $0`
test -z "$srcdir" && srcdir=.
CONFIGURE=configure.in
XMLTO_LANG="C"
DIE=0
(test -f $srcdir/$CONFIGURE) || {
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 >/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 >/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_GLIB_GNU_GETTEXT" $srcdir/$CONFIGURE >/dev/null) && {
(grep "sed.*POTFILES" $srcdir/$CONFIGURE) > /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
}
(which xmlto) < /dev/null > /dev/null 2>&1 || {
echo
echo "**Error**: You must have \`xmlto' installed."
echo "You can get it from: http://cyberelk.net/tim/xmlto/"
DIE=1
NO_XMLTO=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 -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 >/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 >/dev/null; then
echo "Running intltoolize..."
intltoolize --copy --force --automake
fi
# if grep "^AM_PROG_XML_I18N_TOOLS" $CONFIGURE >/dev/null; then
# echo "Running xml-i18n-toolize..."
# xml-i18n-toolize --copy --force --automake
# fi
test -n "$NO_XMLTO" || {
echo "creating help for lang $XMLTO_LANG"
for xlang in $XMLTO_LANG
do
xmlto -o help/$xlang html-nochunks help/$xlang/e16menuedit2.xml
done
}
echo "Running aclocal $aclocalinclude ..."
aclocal $aclocalinclude
if grep "^AM_CONFIG_HEADER" $CONFIGURE >/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

137
configure.in Normal file
View File

@ -0,0 +1,137 @@
dnl Process this file with autoconf to produce a configure script.
AC_INIT(configure.in)
AM_INIT_AUTOMAKE(e16menuedit2, 0.0.3)
AM_CONFIG_HEADER(config.h)
AM_MAINTAINER_MODE
AC_ISC_POSIX
AC_PROG_CC
AM_PROG_CC_STDC
AC_HEADER_STDC
dnl Option to enable debug
AC_MSG_CHECKING(whether to enable debugging)
AC_ARG_ENABLE(debug,
[ --enable-debug=[no/yes] enables debug build (default=no)],,
enable_debug=no)
if [ ! test "x$enable_debug" != "xyes"]; then
AC_DEFINE(DEBUG, , [Define to enable debug build])
CFLAGS="$CFLAGS -g"
AC_MSG_RESULT(yes)
else
AC_MSG_RESULT(no)
fi
pkg_modules="gtk+-2.0 >= 2.4.0 libglade-2.0 >= 2.3.6 gmodule-2.0 >= 0.17.2"
PKG_CHECK_MODULES(PACKAGE, [$pkg_modules])
AC_SUBST(PACKAGE_CFLAGS)
AC_SUBST(PACKAGE_LIBS)
AC_CHECK_LIB(popt,
poptGetContext,
LIBS="${PACKAGE_LIBS} -lpopt",
echo "*** You need to get libpopt ***";exit
)
AC_PROG_INTLTOOL([0.23])
GETTEXT_PACKAGE=e16menuedit2
AC_SUBST(GETTEXT_PACKAGE)
AC_DEFINE_UNQUOTED(GETTEXT_PACKAGE,"$GETTEXT_PACKAGE", [Gettext package.])
dnl Add the languages which your application supports here.
ALL_LINGUAS="de en ko tr fr"
AM_GLIB_GNU_GETTEXT
AC_PATH_PROG(SCROLLKEEPER,scrollkeeper-config,no)
AM_CONDITIONAL(SK, "$SCROLLKEEPER" 2&>/dev/null != no)
AC_SUBST(SK)
AC_PATH_PROG(YELP,yelp,no)
dnl Set PACKAGE_LOCALE_DIR in config.h.
if test "x${prefix}" = "xNONE"; then
AC_DEFINE_UNQUOTED(PACKAGE_LOCALE_DIR, "${ac_default_prefix}/${DATADIRNAME}/locale","")
else
AC_DEFINE_UNQUOTED(PACKAGE_LOCALE_DIR, "${prefix}/${DATADIRNAME}/locale","")
fi
dnl Set PACKAGE SOURCE DIR in config.h.
packagesrcdir=`cd $srcdir && pwd`
dnl Set PACKAGE PREFIX
if test "x${prefix}" = "xNONE"; then
packageprefix=${ac_default_prefix}
else
packageprefix=${prefix}
fi
dnl Set PACKAGE DATA & DOC DIR
systemdatadir=share
packagedatadir=share/${PACKAGE}-${VERSION}
packagedocdir=doc/${PACKAGE}-${VERSION}
dnl Set PACKAGE DIRS in config.h.
packagepixmapsdir=${systemdatadir}/pixmaps/${PACKAGE}-${VERSION}
systempixmapsdir=${systemdatadir}/pixmaps
dnl Set help dirs
yelphelpdir=${systemdatadir}/gnome/help/${PACKAGE}-${VERSION}
AC_SUBST(packagedatadir)
AC_SUBST(yelphelpdir)
AC_SUBST(packagedocdir)
AC_SUBST(packageprefix)
dnl Subst PACKAGE_DATA_DIR.
NO_PREFIX_PACKAGE_DATA_DIR="${packagedatadir}"
AC_SUBST(NO_PREFIX_PACKAGE_DATA_DIR)
PACKAGE_DATA_DIR="${packageprefix}/${packagedatadir}"
AC_SUBST(PACKAGE_DATA_DIR)
dnl Subst SYSTEM_DATA_DIR.
NO_PREFIX_SYSTEM_DATA_DIR="${systemdatadir}"
AC_SUBST(NO_PREFIX_SYSTEM_DATA_DIR)
SYSTEM_DATA_DIR="${packageprefix}/${systemdatadir}"
AC_SUBST(SYSTEM_DATA_DIR)
dnl Subst PACKAGE_DOC_DIR.
NO_PREFIX_PACKAGE_DOC_DIR="${packagedocdir}"
AC_SUBST(NO_PREFIX_PACKAGE_DOC_DIR)
PACKAGE_DOC_DIR="${packageprefix}/${packagedocdir}"
AC_SUBST(PACKAGE_DOC_DIR)
dnl Subst PACKAGE_PIXMAPS_DIR.
NO_PREFIX_PACKAGE_PIXMAPS_DIR="${packagepixmapsdir}"
AC_SUBST(NO_PREFIX_PACKAGE_PIXMAPS_DIR)
PACKAGE_PIXMAPS_DIR="${packageprefix}/${packagepixmapsdir}"
AC_SUBST(PACKAGE_PIXMAPS_DIR)
dnl Subst SYSTEM_PIXMAPS_DIR.
NO_PREFIX_SYSTEM_PIXMAPS_DIR="${systempixmapsdir}"
AC_SUBST(NO_PREFIX_SYSTEM_PIXMAPS_DIR)
SYSTEM_PIXMAPS_DIR="${packageprefix}/${systempixmapsdir}"
AC_SUBST(SYSTEM_PIXMAPS_DIR)
AC_DEFINE_UNQUOTED(PACKAGE_DATA_DIR, "${packageprefix}/${packagedatadir}","")
AC_DEFINE_UNQUOTED(SYSTEM_DATA_DIR, "${packageprefix}/${systemdatadir}","")
AC_DEFINE_UNQUOTED(PACKAGE_DOC_DIR, "${packageprefix}/${packagedocdir}","")
AC_DEFINE_UNQUOTED(PACKAGE_PIXMAPS_DIR, "${packageprefix}/${packagepixmapsdir}","")
AC_DEFINE_UNQUOTED(SYSTEM_PIXMAPS_DIR, "${packageprefix}/${systempixmapsdir}","")
AC_DEFINE_UNQUOTED(PACKAGE_SOURCE_DIR, "${packagesrcdir}","")
AC_DEFINE_UNQUOTED(SCROLLKEEPER, "${SCROLLKEEPER}","")
AC_DEFINE_UNQUOTED(YELP, "${YELP}","")
AC_DEFINE_UNQUOTED(YELP_HELP_DIR, "${packageprefix}/${yelphelpdir}","")
AC_OUTPUT([
Makefile
e16menuedit2.spec
src/Makefile
pixmaps/Makefile
po/Makefile.in
help/Makefile
help/C/Makefile
help/C/figures/Makefile
])

794
e16menuedit2.glade Normal file
View File

@ -0,0 +1,794 @@
<?xml version="1.0" standalone="no"?> <!--*- mode: xml -*-->
<!DOCTYPE glade-interface SYSTEM "http://glade.gnome.org/glade-2.0.dtd">
<glade-interface>
<widget class="GtkWindow" id="main_window">
<property name="visible">True</property>
<property name="title" translatable="yes">E16 Menu Editor</property>
<property name="type">GTK_WINDOW_TOPLEVEL</property>
<property name="window_position">GTK_WIN_POS_NONE</property>
<property name="modal">False</property>
<property name="resizable">True</property>
<property name="destroy_with_parent">False</property>
<property name="decorated">True</property>
<property name="skip_taskbar_hint">False</property>
<property name="skip_pager_hint">False</property>
<property name="type_hint">GDK_WINDOW_TYPE_HINT_NORMAL</property>
<property name="gravity">GDK_GRAVITY_NORTH_WEST</property>
<signal name="destroy" handler="gtk_main_quit" last_modification_time="Sat, 05 Jun 2004 13:04:55 GMT"/>
<child>
<widget class="GtkVBox" id="vbox1">
<property name="visible">True</property>
<property name="homogeneous">False</property>
<property name="spacing">0</property>
<child>
<widget class="GtkHandleBox" id="handlebox2">
<property name="visible">True</property>
<property name="shadow_type">GTK_SHADOW_OUT</property>
<property name="handle_position">GTK_POS_LEFT</property>
<property name="snap_edge">GTK_POS_TOP</property>
<child>
<widget class="GtkMenuBar" id="menubar1">
<property name="visible">True</property>
<child>
<widget class="GtkMenuItem" id="menu_file">
<property name="visible">True</property>
<property name="label" translatable="yes">_File</property>
<property name="use_underline">True</property>
<child>
<widget class="GtkMenu" id="menu_file_menu">
<child>
<widget class="GtkImageMenuItem" id="menu_save">
<property name="visible">True</property>
<property name="label">gtk-save</property>
<property name="use_stock">True</property>
</widget>
</child>
<child>
<widget class="GtkImageMenuItem" id="menu_properties">
<property name="visible">True</property>
<property name="label">gtk-preferences</property>
<property name="use_stock">True</property>
<signal name="activate" handler="on_menu_properties_activate" last_modification_time="Sat, 28 Aug 2004 14:22:42 GMT"/>
</widget>
</child>
<child>
<widget class="GtkSeparatorMenuItem" id="trennlinie1">
<property name="visible">True</property>
</widget>
</child>
<child>
<widget class="GtkImageMenuItem" id="menu_quit">
<property name="visible">True</property>
<property name="label">gtk-quit</property>
<property name="use_stock">True</property>
<signal name="activate" handler="gtk_main_quit" last_modification_time="Fri, 30 Jul 2004 14:08:04 GMT"/>
</widget>
</child>
</widget>
</child>
</widget>
</child>
<child>
<widget class="GtkMenuItem" id="menu_edit">
<property name="visible">True</property>
<property name="label" translatable="yes">_Edit</property>
<property name="use_underline">True</property>
<child>
<widget class="GtkMenu" id="menu_edit_menu">
<child>
<widget class="GtkImageMenuItem" id="menu_new">
<property name="visible">True</property>
<property name="label" translatable="yes">_New Entry</property>
<property name="use_underline">True</property>
<accelerator key="N" modifiers="GDK_CONTROL_MASK" signal="activate"/>
<child internal-child="image">
<widget class="GtkImage" id="image160">
<property name="visible">True</property>
<property name="stock">gtk-new</property>
<property name="icon_size">1</property>
<property name="xalign">0.5</property>
<property name="yalign">0.5</property>
<property name="xpad">0</property>
<property name="ypad">0</property>
</widget>
</child>
</widget>
</child>
<child>
<widget class="GtkImageMenuItem" id="menu_delete">
<property name="visible">True</property>
<property name="label" translatable="yes">_Delete Entry</property>
<property name="use_underline">True</property>
<child internal-child="image">
<widget class="GtkImage" id="image161">
<property name="visible">True</property>
<property name="stock">gtk-delete</property>
<property name="icon_size">1</property>
<property name="xalign">0.5</property>
<property name="yalign">0.5</property>
<property name="xpad">0</property>
<property name="ypad">0</property>
</widget>
</child>
</widget>
</child>
<child>
<widget class="GtkImageMenuItem" id="menu_icon">
<property name="visible">True</property>
<property name="label" translatable="yes">Choose _Icon</property>
<property name="use_underline">True</property>
<accelerator key="I" modifiers="GDK_CONTROL_MASK" signal="activate"/>
<child internal-child="image">
<widget class="GtkImage" id="image162">
<property name="visible">True</property>
<property name="stock">gtk-select-color</property>
<property name="icon_size">1</property>
<property name="xalign">0.5</property>
<property name="yalign">0.5</property>
<property name="xpad">0</property>
<property name="ypad">0</property>
</widget>
</child>
</widget>
</child>
</widget>
</child>
</widget>
</child>
<child>
<widget class="GtkMenuItem" id="menu_help">
<property name="visible">True</property>
<property name="label" translatable="yes">_Help</property>
<property name="use_underline">True</property>
<child>
<widget class="GtkMenu" id="menu_help_menu">
<child>
<widget class="GtkImageMenuItem" id="menu_contents">
<property name="visible">True</property>
<property name="label" translatable="yes">_Contents</property>
<property name="use_underline">True</property>
<signal name="activate" handler="on_menu_contents_activate" last_modification_time="Fri, 13 Aug 2004 14:54:53 GMT"/>
<accelerator key="F1" modifiers="0" signal="activate"/>
<child internal-child="image">
<widget class="GtkImage" id="image163">
<property name="visible">True</property>
<property name="stock">gtk-help</property>
<property name="icon_size">1</property>
<property name="xalign">0.5</property>
<property name="yalign">0.5</property>
<property name="xpad">0</property>
<property name="ypad">0</property>
</widget>
</child>
</widget>
</child>
<child>
<widget class="GtkSeparatorMenuItem" id="strip2">
<property name="visible">True</property>
</widget>
</child>
<child>
<widget class="GtkImageMenuItem" id="menu_info">
<property name="visible">True</property>
<property name="label">gtk-dialog-info</property>
<property name="use_stock">True</property>
<signal name="activate" handler="on_menu_info_activate" last_modification_time="Thu, 29 Jul 2004 21:34:31 GMT"/>
</widget>
</child>
</widget>
</child>
</widget>
</child>
</widget>
</child>
</widget>
<packing>
<property name="padding">0</property>
<property name="expand">False</property>
<property name="fill">False</property>
</packing>
</child>
<child>
<widget class="GtkHandleBox" id="handlebox3">
<property name="visible">True</property>
<property name="shadow_type">GTK_SHADOW_OUT</property>
<property name="handle_position">GTK_POS_LEFT</property>
<property name="snap_edge">GTK_POS_TOP</property>
<child>
<widget class="GtkToolbar" id="toolbar1">
<property name="visible">True</property>
<property name="orientation">GTK_ORIENTATION_HORIZONTAL</property>
<property name="toolbar_style">GTK_TOOLBAR_ICONS</property>
<property name="tooltips">True</property>
<property name="show_arrow">True</property>
<child>
<widget class="GtkToolButton" id="toolbutton_save">
<property name="visible">True</property>
<property name="stock_id">gtk-save</property>
<property name="visible_horizontal">True</property>
<property name="visible_vertical">True</property>
<property name="is_important">False</property>
</widget>
<packing>
<property name="expand">False</property>
<property name="homogeneous">True</property>
</packing>
</child>
<child>
<widget class="GtkSeparatorToolItem" id="separatortoolitem1">
<property name="visible">True</property>
<property name="draw">True</property>
<property name="visible_horizontal">True</property>
<property name="visible_vertical">True</property>
</widget>
<packing>
<property name="expand">False</property>
<property name="homogeneous">False</property>
</packing>
</child>
<child>
<widget class="GtkToolButton" id="toolbutton_new">
<property name="visible">True</property>
<property name="label" translatable="yes">New Entry</property>
<property name="use_underline">True</property>
<property name="stock_id">gtk-new</property>
<property name="visible_horizontal">True</property>
<property name="visible_vertical">True</property>
<property name="is_important">False</property>
</widget>
<packing>
<property name="expand">False</property>
<property name="homogeneous">True</property>
</packing>
</child>
<child>
<widget class="GtkToolButton" id="toolbutton_del">
<property name="width_request">0</property>
<property name="height_request">0</property>
<property name="visible">True</property>
<property name="label" translatable="yes">Delete Entry</property>
<property name="use_underline">True</property>
<property name="stock_id">gtk-delete</property>
<property name="visible_horizontal">True</property>
<property name="visible_vertical">True</property>
<property name="is_important">False</property>
</widget>
<packing>
<property name="expand">False</property>
<property name="homogeneous">True</property>
</packing>
</child>
<child>
<widget class="GtkToolButton" id="toolbutton_icon">
<property name="visible">True</property>
<property name="label" translatable="yes">Choose Icon</property>
<property name="use_underline">True</property>
<property name="stock_id">gtk-select-color</property>
<property name="visible_horizontal">True</property>
<property name="visible_vertical">True</property>
<property name="is_important">False</property>
</widget>
<packing>
<property name="expand">False</property>
<property name="homogeneous">True</property>
</packing>
</child>
<child>
<widget class="GtkSeparatorToolItem" id="separatortoolitem2">
<property name="visible">True</property>
<property name="draw">True</property>
<property name="visible_horizontal">True</property>
<property name="visible_vertical">True</property>
</widget>
<packing>
<property name="expand">False</property>
<property name="homogeneous">False</property>
</packing>
</child>
<child>
<widget class="GtkToolButton" id="toolbutton_quit">
<property name="visible">True</property>
<property name="stock_id">gtk-quit</property>
<property name="visible_horizontal">True</property>
<property name="visible_vertical">True</property>
<property name="is_important">False</property>
<signal name="clicked" handler="gtk_main_quit" last_modification_time="Thu, 29 Jul 2004 21:51:16 GMT"/>
</widget>
<packing>
<property name="expand">False</property>
<property name="homogeneous">True</property>
</packing>
</child>
</widget>
</child>
</widget>
<packing>
<property name="padding">0</property>
<property name="expand">False</property>
<property name="fill">False</property>
</packing>
</child>
<child>
<widget class="GtkScrolledWindow" id="scrolledwindow2">
<property name="width_request">700</property>
<property name="height_request">400</property>
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="hscrollbar_policy">GTK_POLICY_AUTOMATIC</property>
<property name="vscrollbar_policy">GTK_POLICY_AUTOMATIC</property>
<property name="shadow_type">GTK_SHADOW_NONE</property>
<property name="window_placement">GTK_CORNER_TOP_LEFT</property>
<child>
<widget class="GtkTreeView" id="treeview_menu">
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="headers_visible">True</property>
<property name="rules_hint">True</property>
<property name="reorderable">False</property>
<property name="enable_search">True</property>
<signal name="button_press_event" handler="on_treeview_menu_button_press_event" object="treeview_menu" last_modification_time="Sun, 01 Aug 2004 11:08:32 GMT"/>
</widget>
</child>
</widget>
<packing>
<property name="padding">0</property>
<property name="expand">True</property>
<property name="fill">True</property>
</packing>
</child>
<child>
<widget class="GtkStatusbar" id="main_statusbar">
<property name="visible">True</property>
<property name="has_resize_grip">True</property>
</widget>
<packing>
<property name="padding">0</property>
<property name="expand">False</property>
<property name="fill">False</property>
</packing>
</child>
</widget>
</child>
</widget>
<widget class="GtkWindow" id="info_window">
<property name="visible">True</property>
<property name="title" translatable="yes">Info about E16 Menu Editor</property>
<property name="type">GTK_WINDOW_TOPLEVEL</property>
<property name="window_position">GTK_WIN_POS_NONE</property>
<property name="modal">False</property>
<property name="resizable">True</property>
<property name="destroy_with_parent">False</property>
<property name="decorated">True</property>
<property name="skip_taskbar_hint">False</property>
<property name="skip_pager_hint">False</property>
<property name="type_hint">GDK_WINDOW_TYPE_HINT_NORMAL</property>
<property name="gravity">GDK_GRAVITY_NORTH_WEST</property>
<child>
<widget class="GtkVBox" id="vbox2">
<property name="visible">True</property>
<property name="homogeneous">False</property>
<property name="spacing">0</property>
<child>
<widget class="GtkVBox" id="vbox3">
<property name="visible">True</property>
<property name="homogeneous">False</property>
<property name="spacing">0</property>
<child>
<widget class="GtkNotebook" id="notebook1">
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="show_tabs">True</property>
<property name="show_border">True</property>
<property name="tab_pos">GTK_POS_TOP</property>
<property name="scrollable">False</property>
<property name="enable_popup">False</property>
<child>
<widget class="GtkFixed" id="fixed2">
<property name="visible">True</property>
<child>
<widget class="GtkImage" id="logo_image">
<property name="width_request">64</property>
<property name="height_request">56</property>
<property name="visible">True</property>
<property name="xalign">0.5</property>
<property name="yalign">0.5</property>
<property name="xpad">0</property>
<property name="ypad">0</property>
</widget>
<packing>
<property name="x">168</property>
<property name="y">16</property>
</packing>
</child>
<child>
<widget class="GtkLabel" id="label10">
<property name="width_request">344</property>
<property name="height_request">88</property>
<property name="visible">True</property>
<property name="label" translatable="yes">&lt;span font_desc=&quot;Sans 22&quot;&gt;E16 Menu Editor II&lt;/span&gt;
e16menuedit2 v0.0.3</property>
<property name="use_underline">False</property>
<property name="use_markup">True</property>
<property name="justify">GTK_JUSTIFY_CENTER</property>
<property name="wrap">False</property>
<property name="selectable">False</property>
<property name="xalign">0.5</property>
<property name="yalign">0.5</property>
<property name="xpad">0</property>
<property name="ypad">0</property>
</widget>
<packing>
<property name="x">24</property>
<property name="y">64</property>
</packing>
</child>
</widget>
<packing>
<property name="tab_expand">False</property>
<property name="tab_fill">True</property>
</packing>
</child>
<child>
<widget class="GtkLabel" id="label6">
<property name="visible">True</property>
<property name="label" translatable="yes">Info</property>
<property name="use_underline">False</property>
<property name="use_markup">False</property>
<property name="justify">GTK_JUSTIFY_LEFT</property>
<property name="wrap">False</property>
<property name="selectable">False</property>
<property name="xalign">0.5</property>
<property name="yalign">0.5</property>
<property name="xpad">0</property>
<property name="ypad">0</property>
</widget>
<packing>
<property name="type">tab</property>
</packing>
</child>
</widget>
<packing>
<property name="padding">0</property>
<property name="expand">True</property>
<property name="fill">True</property>
</packing>
</child>
<child>
<widget class="GtkFixed" id="fixed1">
<property name="visible">True</property>
<child>
<widget class="GtkButton" id="button2">
<property name="width_request">120</property>
<property name="height_request">32</property>
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="label">gtk-close</property>
<property name="use_stock">True</property>
<property name="relief">GTK_RELIEF_NORMAL</property>
<property name="focus_on_click">True</property>
<signal name="clicked" handler="gtk_widget_destroy" object="info_window" last_modification_time="Fri, 30 Jul 2004 16:48:59 GMT"/>
</widget>
<packing>
<property name="x">272</property>
<property name="y">8</property>
</packing>
</child>
</widget>
<packing>
<property name="padding">0</property>
<property name="expand">True</property>
<property name="fill">True</property>
</packing>
</child>
</widget>
<packing>
<property name="padding">0</property>
<property name="expand">True</property>
<property name="fill">True</property>
</packing>
</child>
</widget>
</child>
</widget>
<widget class="GtkMenu" id="pop_menu1">
<signal name="unmap_event" handler="on_pop_menu1_destroy_event" last_modification_time="Sun, 01 Aug 2004 11:44:04 GMT"/>
<child>
<widget class="GtkImageMenuItem" id="pop1_new">
<property name="visible">True</property>
<property name="label" translatable="yes">New Entry</property>
<property name="use_underline">True</property>
<child internal-child="image">
<widget class="GtkImage" id="image35">
<property name="visible">True</property>
<property name="stock">gtk-new</property>
<property name="icon_size">1</property>
<property name="xalign">0.5</property>
<property name="yalign">0.5</property>
<property name="xpad">0</property>
<property name="ypad">0</property>
</widget>
</child>
</widget>
</child>
<child>
<widget class="GtkImageMenuItem" id="pop1_icon">
<property name="visible">True</property>
<property name="label" translatable="yes">Choose Icon</property>
<property name="use_underline">True</property>
<child internal-child="image">
<widget class="GtkImage" id="image36">
<property name="visible">True</property>
<property name="stock">gtk-select-color</property>
<property name="icon_size">1</property>
<property name="xalign">0.5</property>
<property name="yalign">0.5</property>
<property name="xpad">0</property>
<property name="ypad">0</property>
</widget>
</child>
</widget>
</child>
<child>
<widget class="GtkImageMenuItem" id="pop1_delete">
<property name="visible">True</property>
<property name="label" translatable="yes">Delete Entry</property>
<property name="use_underline">True</property>
<child internal-child="image">
<widget class="GtkImage" id="image37">
<property name="visible">True</property>
<property name="stock">gtk-delete</property>
<property name="icon_size">1</property>
<property name="xalign">0.5</property>
<property name="yalign">0.5</property>
<property name="xpad">0</property>
<property name="ypad">0</property>
</widget>
</child>
</widget>
</child>
</widget>
<widget class="GtkWindow" id="properties_window">
<property name="visible">True</property>
<property name="title" translatable="yes">Properties</property>
<property name="type">GTK_WINDOW_TOPLEVEL</property>
<property name="window_position">GTK_WIN_POS_NONE</property>
<property name="modal">False</property>
<property name="resizable">True</property>
<property name="destroy_with_parent">False</property>
<property name="decorated">True</property>
<property name="skip_taskbar_hint">False</property>
<property name="skip_pager_hint">False</property>
<property name="type_hint">GDK_WINDOW_TYPE_HINT_NORMAL</property>
<property name="gravity">GDK_GRAVITY_NORTH_WEST</property>
<child>
<widget class="GtkVBox" id="vbox1">
<property name="visible">True</property>
<property name="homogeneous">False</property>
<property name="spacing">0</property>
<child>
<widget class="GtkFrame" id="frame1">
<property name="visible">True</property>
<property name="label_xalign">0</property>
<property name="label_yalign">0.5</property>
<property name="shadow_type">GTK_SHADOW_ETCHED_IN</property>
<child>
<widget class="GtkAlignment" id="alignment2">
<property name="visible">True</property>
<property name="xalign">0.5</property>
<property name="yalign">0.5</property>
<property name="xscale">1</property>
<property name="yscale">1</property>
<property name="top_padding">0</property>
<property name="bottom_padding">0</property>
<property name="left_padding">12</property>
<property name="right_padding">0</property>
<child>
<widget class="GtkHBox" id="hbox2">
<property name="border_width">20</property>
<property name="visible">True</property>
<property name="homogeneous">False</property>
<property name="spacing">0</property>
<child>
<widget class="GtkLabel" id="label12">
<property name="visible">True</property>
<property name="label" translatable="yes">Fallback Help-Browser:</property>
<property name="use_underline">False</property>
<property name="use_markup">False</property>
<property name="justify">GTK_JUSTIFY_LEFT</property>
<property name="wrap">False</property>
<property name="selectable">False</property>
<property name="xalign">0.5</property>
<property name="yalign">0.5</property>
<property name="xpad">10</property>
<property name="ypad">0</property>
</widget>
<packing>
<property name="padding">0</property>
<property name="expand">False</property>
<property name="fill">False</property>
</packing>
</child>
<child>
<widget class="GtkComboBoxEntry" id="comboboxentry1">
<property name="visible">True</property>
<property name="items" translatable="yes">mozilla
firefox
epiphany
konqueror</property>
</widget>
<packing>
<property name="padding">0</property>
<property name="expand">True</property>
<property name="fill">True</property>
</packing>
</child>
</widget>
</child>
</widget>
</child>
<child>
<widget class="GtkLabel" id="label11">
<property name="visible">True</property>
<property name="label" translatable="yes">&lt;b&gt;Properties:&lt;/b&gt;</property>
<property name="use_underline">False</property>
<property name="use_markup">True</property>
<property name="justify">GTK_JUSTIFY_LEFT</property>
<property name="wrap">False</property>
<property name="selectable">False</property>
<property name="xalign">0.5</property>
<property name="yalign">0.5</property>
<property name="xpad">0</property>
<property name="ypad">0</property>
</widget>
<packing>
<property name="type">label_item</property>
</packing>
</child>
</widget>
<packing>
<property name="padding">0</property>
<property name="expand">True</property>
<property name="fill">True</property>
</packing>
</child>
<child>
<widget class="GtkHBox" id="hbox1">
<property name="visible">True</property>
<property name="homogeneous">True</property>
<property name="spacing">0</property>
<child>
<widget class="GtkButton" id="properties_help">
<property name="border_width">10</property>
<property name="can_focus">True</property>
<property name="label">gtk-help</property>
<property name="use_stock">True</property>
<property name="relief">GTK_RELIEF_NORMAL</property>
<property name="focus_on_click">True</property>
</widget>
<packing>
<property name="padding">0</property>
<property name="expand">False</property>
<property name="fill">True</property>
</packing>
</child>
<child>
<widget class="GtkAlignment" id="alignment1">
<property name="visible">True</property>
<property name="xalign">0.5</property>
<property name="yalign">0.5</property>
<property name="xscale">1</property>
<property name="yscale">1</property>
<property name="top_padding">0</property>
<property name="bottom_padding">0</property>
<property name="left_padding">0</property>
<property name="right_padding">0</property>
<child>
<placeholder/>
</child>
</widget>
<packing>
<property name="padding">0</property>
<property name="expand">True</property>
<property name="fill">True</property>
</packing>
</child>
<child>
<placeholder/>
</child>
<child>
<widget class="GtkButton" id="properties_close">
<property name="border_width">10</property>
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="label">gtk-close</property>
<property name="use_stock">True</property>
<property name="relief">GTK_RELIEF_NORMAL</property>
<property name="focus_on_click">True</property>
<signal name="clicked" handler="on_properties_close_clicked" last_modification_time="Wed, 06 Oct 2004 14:48:43 GMT"/>
</widget>
<packing>
<property name="padding">0</property>
<property name="expand">False</property>
<property name="fill">True</property>
</packing>
</child>
</widget>
<packing>
<property name="padding">0</property>
<property name="expand">False</property>
<property name="fill">True</property>
</packing>
</child>
</widget>
</child>
</widget>
</glade-interface>

11
e16menuedit2.gladep Normal file
View File

@ -0,0 +1,11 @@
<?xml version="1.0" standalone="no"?> <!--*- mode: xml -*-->
<!DOCTYPE glade-project SYSTEM "http://glade.gnome.org/glade-project-2.0.dtd">
<glade-project>
<name>e16menuedit2</name>
<program_name>e16menuedit2</program_name>
<gnome_support>FALSE</gnome_support>
<output_main_file>FALSE</output_main_file>
<output_support_files>FALSE</output_support_files>
<output_build_files>FALSE</output_build_files>
</glade-project>

126
e16menuedit2.prj Normal file
View File

@ -0,0 +1,126 @@
# Anjuta Version 1.2.2
Compatibility Level: 1
<PROJECT_DESCRIPTION_START>
<PROJECT_DESCRIPTION_END>
<CONFIG_PROGS_START>
<CONFIG_PROGS_END>
<CONFIG_LIBS_START>
<CONFIG_LIBS_END>
<CONFIG_HEADERS_START>
<CONFIG_HEADERS_END>
<CONFIG_CHARACTERISTICS_START>
<CONFIG_CHARACTERISTICS_END>
<CONFIG_LIB_FUNCS_START>
<CONFIG_LIB_FUNCS_END>
<CONFIG_ADDITIONAL_START>
<CONFIG_ADDITIONAL_END>
<CONFIG_FILES_START>
<CONFIG_FILES_END>
<MAKEFILE_AM_START>
<MAKEFILE_AM_END>
props.file.type=project
anjuta.version=1.2.2
anjuta.compatibility.level=1
project.name=e16menuedit2
project.type=GTK 2.0
project.target.type=EXECUTABLE
project.version=0.2
project.author=Andreas Volz
project.source.target=e16menuedit2
project.has.gettext=1
project.gui.command=
project.programming.language=C
project.excluded.modules=intl
project.config.extra.modules.before=
project.config.extra.modules.after=
project.config.blocked=0
project.config.disable.overwriting=1 1 1 1 1 1 1 1 1
project.menu.entry=e16menuedit2 Version 0.2
project.menu.group=Applications
project.menu.comment=e16menuedit2 Version 0.2
project.menu.icon=
project.menu.need.terminal=0
project.configure.options=
anjuta.program.arguments=
preferences.build.option.jobs=0
preferences.build.option.silent=0
preferences.build.option.autosave=0
preferences.anjuta.make.options=-k
preferences.make=make
preferences.build.option.keep.going=1
preferences.build.option.warn.undef=0
preferences.autoformat.custom.style=-s2
preferences.indent.opening=1
preferences.autoformat.disable=0
preferences.indent.automatic=1
preferences.use.tabs=1
preferences.indent.size=2
preferences.tabsize=8
preferences.indent.closing=1
module.include.name=include
module.include.type=
module.include.files=
module.source.name=src
module.source.type=
module.source.files=\
callbacks.c\
callbacks.h\
e16menuedit2.c\
e16menuedit2.h\
file.c\
file.h\
nls.h\
icon_chooser.c\
icon_chooser.h\
e16menu.c\
e16menu.h\
treeview.c\
treeview.h\
libglade_support.c\
libglade_support.h\
regex_func.c\
regex_func.h
module.pixmap.name=pixmaps
module.pixmap.type=
module.pixmap.files=\
e16menuedit2-icon.png
module.data.name=data
module.data.type=
module.data.files=
module.help.name=help
module.help.type=
module.help.files=
module.doc.name=doc
module.doc.type=
module.doc.files=
module.po.files=
compiler.options.supports=
compiler.options.include.paths=
compiler.options.library.paths=
compiler.options.libraries=
compiler.options.libraries.selected=
compiler.options.defines=
compiler.options.defines.selected=
compiler.options.warning.buttons=0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0
compiler.options.optimize.buttons=1 0 0 0
compiler.options.other.buttons=1 0
compiler.options.other.c.flags=
compiler.options.other.l.flags=
compiler.options.other.l.libs=
project.src.paths=

62
e16menuedit2.spec.in Normal file
View File

@ -0,0 +1,62 @@
Name: e16menuedit2
Summary: e16menuedit2
Version: @VERSION@
Release: 1
License: BSD
Group: System Environment/Libraries
URL: http://www.enlightenment.org/
Source0: http://prdownloads.sourceforge.net/enlightenment/%{name}-%{version}.tar.gz
Buildroot: %{_tmppath}/%{name}-%{version}-%{release}-root
BuildRequires: perl
Requires: gtk2 >= 2.4.0, gtk2-devel >= 2.4.0, libglade2 >= 2.3.6, gmodule-2.0 >= 0.17.2, pkgconfig
%description
gtk menu editor for Enlightenment 0.16 by Andreas Volz.
%prep
%setup -q
%build
./configure --prefix=%{_prefix} --bindir=%{_bindir} --libdir=%{_libdir} --includedir=%{_includedir}
make
%install
rm -fr %{buildroot}
make install DESTDIR=%{buildroot}
%clean
rm -fr %{buildroot}
%undefine __check_files
%post
/sbin/ldconfig
%postun
/sbin/ldconfig
%files
%defattr(-,root,root)
%{_bindir}/e16menuedit2*
/usr/share/locale/de/LC_MESSAGES/e16menuedit2.mo
/usr/share/locale/en/LC_MESSAGES/e16menuedit2.mo
/usr/share/locale/ko/LC_MESSAGES/e16menuedit2.mo
/usr/share/locale/tr/LC_MESSAGES/e16menuedit2.mo
/usr/share/pixmaps/e16menuedit2-icon.png
/usr/share/gnome/help/e16menuedit2-@VERSION@*
/usr/share/omf/e16menuedit2-@VERSION@/e16menuedit2-C.omf
/usr/share/e16menuedit2-@VERSION@/glade/e16menuedit2.glade
/usr/share/e16menuedit2-@VERSION@*
%doc AUTHORS
%doc COPYING
%doc README
%doc ChangeLog
%doc INSTALL
%doc NEWS
%doc TODO
%changelog
* Sa Aug 20 2005 Andreas Volz <linux@brachttal.net>
- generate spec with configure
* Mon Nov 1 2004 Didier F.B Casse <didier@microtronyx.com>
-Initial RPM Release

2
help/.cvsignore Normal file
View File

@ -0,0 +1,2 @@
Makefile
Makefile.in

6
help/C/.cvsignore Normal file
View File

@ -0,0 +1,6 @@
Makefile
Makefile.in
e16menuedit2-C.omf.out
e16menuedit2.html
omf_timestamp

16
help/C/Makefile.am Normal file
View File

@ -0,0 +1,16 @@
figdir = figures
SUBDIRS = ${figdir}
docname = e16menuedit2
lang = C
omffile = e16menuedit2-C.omf
entities = legal.xml
include $(top_srcdir)/xmldocs.make
dist-hook: app-dist-hook
e16menuedit2docdir = ${prefix}/${yelphelpdir}/${lang}
e16menuedit2doc_DATA = \
e16menuedit2.html

28
help/C/e16menuedit2-C.omf Normal file
View File

@ -0,0 +1,28 @@
<?xml version="1.0" standalone="no"?>
<omf>
<resource>
<creator>
linux@brachttal.net (Andreas Volz)
</creator>
<title>
E16 Menu Editor II - Users Guide
</title>
<date>
2004-08-13
</date>
<version identifier="0.0.2" date="Januar 2005" description="Second Release"/>
<subject category="GNOME|Utilities"/>
<description>
an Enlightenment 0.16.x menu editor
</description>
<type>
manual
</type>
<format mime="text/xml" dtd="-//OASIS//DTD DocBook XML V4.1.2//EN"/>
<identifier url=""/>
<language code="C"/>
<relation seriesid=""/>
<rights type="BSD" license.version=""
license="" holder="Andreas Volz"/>
</resource>
</omf>

182
help/C/e16menuedit2.xml Normal file
View File

@ -0,0 +1,182 @@
<?xml version="1.0"?>
<!DOCTYPE article PUBLIC "-//OASIS//DTD DocBook XML V4.1.2//EN"
"http://www.oasis-open.org/docbook/xml/4.1.2/docbookx.dtd" [
<!ENTITY legal SYSTEM "legal.xml">
<!ENTITY appversion "0.0.3">
<!ENTITY manrevision "1">
<!ENTITY date "August 2005">
<!ENTITY app "E16 Menu Editor 2">
<!-- Information about the entities
The legal.xml file contains legal information, there is no need to edit the file.
Use the appversion entity to specify the version of the application.
Use the manrevision entity to specify the revision number of this manual.
Use the date entity to specify the release date of this manual.
Use the app entity to specify the name of the application. -->
]>
<article id="index" lang="en">
<articleinfo>
<title>&app; Manual v&manrevision;</title>
<copyright>
<year>2004</year>
<holder>Andreas Volz</holder>
</copyright>
<publisher>
<publishername>Enlightenment Project</publishername>
</publisher>
&legal;
<authorgroup>
<author>
<firstname>Andreas</firstname> <surname>Volz</surname>
<affiliation>
<orgname>Enlightenment Project</orgname>
<address>
<email>linux@brachttal.net</email>
</address>
</affiliation>
</author>
</authorgroup>
<revhistory>
<revision>
<revnumber>&app; Manual v1</revnumber>
<date>2004</date>
<revdescription>
<para role="author">Andreas Volz
<email>linux@brachttal.net</email>
</para>
</revdescription>
</revision>
</revhistory>
<releaseinfo>This manual describes version &appversion; of &app;.
</releaseinfo>
<legalnotice>
<title>Feedback</title>
<para>To report a bug or make a suggestion regarding the &app; application or
this manual, follow the directions in the
<ulink url="http://xcomputerman.com/bugs/login_page.php"
type="help">Enlightenment BugTracker</ulink>.
</para>
</legalnotice>
</articleinfo>
<sect1 id="intro">
<title>Introduction</title>
<para>In this user guide is explained how to use the functions
in &app; v&appversion;. The main functions <emphasis>save</emphasis>,
<emphasis>New Enty</emphasis>,
<emphasis>Choose Icon</emphasis>, <emphasis>Delete Entry</emphasis> and
<emphasis>Quit</emphasis> are available though the menu- and toolbar.
</para>
<figure id="mainwindow-fig">
<title>&app; Window</title>
<screenshot>
<mediaobject>
<imageobject>
<imagedata
fileref="figures/e16menuedit2-main.png" format="PNG"/>
</imageobject>
</mediaobject>
</screenshot>
</figure>
</sect1>
<sect1 id="edit">
<title>Edit Entries</title>
<para>To edit an entry select first the row you like. Then select the
cell you like to edit with a second click on Description cell or
Parameters cell. The Description cell is shown in the E16 menu and
Parameters cell is the command to be executed if the entry is no submenu.
Otherwise the Parameters cell it's the submenus position and name.
</para>
<figure id="edit-fig">
<title>&app; cell edit function</title>
<screenshot>
<mediaobject>
<imageobject>
<imagedata
fileref="figures/e16menuedit2-edit.png" format="PNG"/>
</imageobject>
</mediaobject>
</screenshot>
</figure>
<para>The Icon cell couldn't edited directly like the description or parameters.
Select Choose Icon in menu- or toolbar to open a new dialog to choose an icon.
If you select an image the is a litlle preview for it. If you don't like the
real image size or the limit of 64x64 pixels, there is a combo box to
change the image size on the fly before inserting it into menu. A yet existing
menu image could be removed with the <emphasis>Clear-Button</emphasis>. No
files are really deleted if you press this button.
</para>
<figure id="icon-fig">
<title>&app; icon chooser dialog</title>
<screenshot>
<mediaobject>
<imageobject>
<imagedata
fileref="figures/e16menuedit2-icon.png" format="PNG"/>
</imageobject>
</mediaobject>
</screenshot>
</figure>
</sect1>
<sect1 id="move">
<title>Move Entries</title>
<para>The entries could be moved in the menu tree with the mouse. Drag an
entry (or submenu) with the left mouse button and drop the entry at it's
new position. But see the difference between moving an entry and creating
a submenu. As you can see on the image there should be a line between the
two entries where you insert the draged entry.
</para>
<figure id="move-fig">
<title>&app; row move function</title>
<screenshot>
<mediaobject>
<imageobject>
<imagedata
fileref="figures/e16menuedit2-move.png" format="PNG"/>
</imageobject>
</mediaobject>
</screenshot>
</figure>
</sect1>
<sect1 id="submenu">
<title>Create submenus</title>
<para>Creating new submenus could be done with drag and drop. Simply create at least
two new entries and then drag one over the other entry. But other that if moving
an entry there's a small dotted line around the entry where the new submenu should
be created.
</para>
<figure id="submenu-fig">
<title>&app; submenu create function</title>
<screenshot>
<mediaobject>
<imageobject>
<imagedata
fileref="figures/e16menuedit2-submenu.png" format="PNG"/>
</imageobject>
</mediaobject>
</screenshot>
</figure>
<para>After dropping the entry the new submenu is created. Now you can give an subdir
and filename where the submenu is saved. This directory is relative to ~/.enlightenment.
&app; creates this directory, so you should't care about this.
</para>
<figure id="submenu2-fig">
<title>&app; submenu name</title>
<screenshot>
<mediaobject>
<imageobject>
<imagedata
fileref="figures/e16menuedit2-submenu2.png" format="PNG"/>
</imageobject>
</mediaobject>
</screenshot>
</figure>
</sect1>
</article>

View File

@ -0,0 +1,2 @@
Makefile
Makefile.in

View File

@ -0,0 +1,13 @@
lang = C
figdir = figures
e16menuedit2figuresdir = ${prefix}/${yelphelpdir}/${lang}/${figdir}
e16menuedit2figures_DATA = \
e16menuedit2-edit.png \
e16menuedit2-main.png \
e16menuedit2-submenu2.png \
e16menuedit2-icon.png \
e16menuedit2-move.png \
e16menuedit2-submenu.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 14 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 101 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 35 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 16 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 21 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 21 KiB

34
help/C/legal.xml Normal file
View File

@ -0,0 +1,34 @@
<legalnotice id="legalnotice">
<para>
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:
</para>
<para>
<orderedlist>
<listitem>
<para>
The above copyright notice and this permission notice shall be included in
all copies of the Software, its documentation and marketing &#038; publicity
materials, and acknowledgment shall be given in the documentation, materials
and software packages that this Software was used.
</para>
</listitem>
<listitem>
<para>
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 AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
</para>
</listitem>
</orderedlist>
</para>
</legalnotice>

1
help/Makefile.am Normal file
View File

@ -0,0 +1 @@
SUBDIRS = C

69
omf.make Normal file
View File

@ -0,0 +1,69 @@
#
# 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@-${VERSION}
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)
if SK
-for file in $(omffile); do \
scrollkeeper-preinstall $(docdir)/$(docname).xml $(srcdir)/$$file $$file.out; \
done; \
touch omf_timestamp
endif
install-data-hook-omf:
if SK
$(mkinstalldirs) $(DESTDIR)$(omf_dest_dir)
for file in $(omffile); do \
$(INSTALL_DATA) $$file.out $(DESTDIR)$(omf_dest_dir)/$$file; \
done
-scrollkeeper-update -p $(scrollkeeper_localstate_dir) -o $(DESTDIR)$(omf_dest_dir)
endif
uninstall-local-omf:
if SK
-for file in $(srcdir)/*.omf; do \
basefile=`basename $$file`; \
rm -f $(omf_dest_dir)/$$basefile; \
done
-rmdir $(omf_dest_dir)
-scrollkeeper-update -p $(scrollkeeper_localstate_dir)
endif
clean-local-omf:
if SK
-for file in $(omffile); do \
rm -f $$file.out; \
done
endif

2
pixmaps/.cvsignore Normal file
View File

@ -0,0 +1,2 @@
Makefile
Makefile.in

14
pixmaps/Makefile.am Normal file
View File

@ -0,0 +1,14 @@
## Process this file with automake to produce Makefile.in
# application icon
e16menuedit2_appicondir = $(datadir)/pixmaps
e16menuedit2_appicon_DATA =\
e16menuedit2-icon.png
# other images
e16menuedit2_pixmapsdir = $(datadir)/pixmaps
e16menuedit2_pixmaps_DATA =
EXTRA_DIST = $(e16menuedit2_pixmaps_DATA) \
$(e16menuedit2_appicon_DATA)

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.1 KiB

6
po/.cvsignore Normal file
View File

@ -0,0 +1,6 @@
Makefile
Makefile.in
Makefile.in.in
POTFILES
e16menuedit2.pot
*.gmo

15
po/ChangeLog Normal file
View File

@ -0,0 +1,15 @@
2004-11-06 gettextize <bug-gnu-gettext@gnu.org>
* Makefile.in.in: Upgrade to gettext-0.12.1.
* boldquot.sed: New file, from gettext-0.12.1.
* en@boldquot.header: New file, from gettext-0.12.1.
* en@quot.header: New file, from gettext-0.12.1.
* insert-header.sin: New file, from gettext-0.12.1.
* quot.sed: New file, from gettext-0.12.1.
* remove-potcdate.sin: New file, from gettext-0.12.1.
* Rules-quot: New file, from gettext-0.12.1.
2004-08-03 gettextize <bug-gnu-gettext@gnu.org>
* Makefile.in.in: Upgrade to gettext-0.12.1.

22
po/POTFILES.in Normal file
View File

@ -0,0 +1,22 @@
# List of source files containing translatable strings.
## Created by Anjuta - will be overwritten
## If you don't want it to overwrite it,
## Please disable it in the Anjuta project configuration
# Source files
src/callbacks.c
src/callbacks.h
src/e16menuedit2.c
src/e16menuedit2.h
src/file.c
src/file.h
src/nls.h
src/icon_chooser.c
src/icon_chooser.h
src/e16menu.c
src/e16menu.h
src/treeview.c
src/treeview.h
e16menuedit2.glade

148
po/de.po Normal file
View File

@ -0,0 +1,148 @@
#
# Copyright (C) 2004
# This file is distributed under the same license as the e16menuedit2 package.
# Andreas Volz <linux@brachttal.net>, 2004.
#
#, fuzzy
msgid ""
msgstr ""
"Project-Id-Version: e16menuedit2\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2005-08-20 11:46+0200\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: Andreas Volz <linux@brachttal.net>\n"
"Language-Team: German <linux@brachttal.net>\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=iso-8859-15\n"
"Content-Transfer-Encoding: 8bit\n"
#: src/callbacks.c:53
msgid "Save"
msgstr "Speichern"
#: src/callbacks.c:60 src/treeview.c:149 e16menuedit2.glade.h:11
msgid "New Entry"
msgstr "Neuer Eintrag"
#: src/callbacks.c:67 e16menuedit2.glade.h:4
msgid "Choose Icon"
msgstr "Wähle Symbol"
#: src/callbacks.c:74 e16menuedit2.glade.h:6
msgid "Delete Entry"
msgstr "Lösche Eintrag"
#: src/callbacks.c:81
msgid "Quit"
msgstr "Beenden"
#: src/callbacks.c:310
msgid "No help file found!"
msgstr "Kein Hilfedatei gefunden!"
#: src/callbacks.c:314
msgid "No help application found"
msgstr "Kein Programm zum Anzeigen der Hilfe gefunden"
#: src/e16menuedit2.c:118
msgid "Menu successfully loaded!"
msgstr "Menü erfolgreich geladen!"
#: src/icon_chooser.c:66
msgid "Select Icon..."
msgstr "Wähle Symbol..."
#: src/icon_chooser.c:102
msgid "Icon size:"
msgstr "Symbolgröße:"
#: src/treeview.c:57
msgid "Description"
msgstr "Beschreibung"
#: src/treeview.c:64
msgid "Icon"
msgstr "Symbol"
#: src/treeview.c:86
msgid "Parameters"
msgstr "Parameter"
#: src/treeview.c:203
msgid "Menu saved!"
msgstr "Menü gespeichert!"
#: src/treeview.c:222
msgid "Submenu must have a name! -> menu not saved!"
msgstr "Untermenü muss einen Namen haben -> Menü nicht gespeichert!"
#: src/treeview.c:226
msgid "Unknown error occurred while checking menu -> menu not saved!"
msgstr ""
"Unbekannter Fehler beim kontrollieren des Menüs -> Menü nicht gespeichert!"
#: e16menuedit2.glade.h:1
msgid "<b>Properties:</b>"
msgstr "<b>Eigenschaften:</b>"
#: e16menuedit2.glade.h:2
msgid ""
"<span font_desc=\"Sans 22\">E16 Menu Editor II</span>\n"
"e16menuedit2 v0.0.3"
msgstr ""
#: e16menuedit2.glade.h:5
msgid "Choose _Icon"
msgstr "Wähle _Symbol"
#: e16menuedit2.glade.h:7
msgid "E16 Menu Editor"
msgstr "E16 Menü Editor"
#: e16menuedit2.glade.h:8
msgid "Fallback Help-Browser:"
msgstr "Hilfe Navigator (Fallback):"
#: e16menuedit2.glade.h:9
msgid "Info"
msgstr "Info"
#: e16menuedit2.glade.h:10
msgid "Info about E16 Menu Editor"
msgstr "Informationen über E16 Menü Editor"
#: e16menuedit2.glade.h:12
msgid "Properties"
msgstr "Parameter"
#: e16menuedit2.glade.h:13
msgid "_Contents"
msgstr "_Inhalt"
#: e16menuedit2.glade.h:14
msgid "_Delete Entry"
msgstr "_Lösche Eintrag"
#: e16menuedit2.glade.h:15
msgid "_Edit"
msgstr "_Bearbeiten"
#: e16menuedit2.glade.h:16
msgid "_File"
msgstr "_Datei"
#: e16menuedit2.glade.h:17
msgid "_Help"
msgstr "_Hilfe"
#: e16menuedit2.glade.h:18
msgid "_New Entry"
msgstr "_Neuer Eintrag"
#: e16menuedit2.glade.h:19
msgid ""
"mozilla\n"
"firefox\n"
"epiphany\n"
"konqueror"
msgstr ""

147
po/en.po Normal file
View File

@ -0,0 +1,147 @@
# SOME DESCRIPTIVE TITLE.
# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER
# This file is distributed under the same license as the e16menuedit2 package.
# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
#
#, fuzzy
msgid ""
msgstr ""
"Project-Id-Version: e16menuedit2\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2005-08-20 11:46+0200\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: Andreas Volz <linux@brachttal.net>\n"
"Language-Team: English <linux@brachttal.net>\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=iso-8859-1\n"
"Content-Transfer-Encoding: 8bit\n"
#: src/callbacks.c:53
msgid "Save"
msgstr ""
#: src/callbacks.c:60 src/treeview.c:149 e16menuedit2.glade.h:11
msgid "New Entry"
msgstr ""
#: src/callbacks.c:67 e16menuedit2.glade.h:4
msgid "Choose Icon"
msgstr ""
#: src/callbacks.c:74 e16menuedit2.glade.h:6
msgid "Delete Entry"
msgstr ""
#: src/callbacks.c:81
msgid "Quit"
msgstr ""
#: src/callbacks.c:310
msgid "No help file found!"
msgstr ""
#: src/callbacks.c:314
msgid "No help application found"
msgstr ""
#: src/e16menuedit2.c:118
msgid "Menu successfully loaded!"
msgstr ""
#: src/icon_chooser.c:66
msgid "Select Icon..."
msgstr ""
#: src/icon_chooser.c:102
msgid "Icon size:"
msgstr ""
#: src/treeview.c:57
msgid "Description"
msgstr ""
#: src/treeview.c:64
msgid "Icon"
msgstr ""
#: src/treeview.c:86
msgid "Parameters"
msgstr ""
#: src/treeview.c:203
msgid "Menu saved!"
msgstr ""
#: src/treeview.c:222
msgid "Submenu must have a name! -> menu not saved!"
msgstr ""
#: src/treeview.c:226
msgid "Unknown error occurred while checking menu -> menu not saved!"
msgstr ""
#: e16menuedit2.glade.h:1
msgid "<b>Properties:</b>"
msgstr ""
#: e16menuedit2.glade.h:2
msgid ""
"<span font_desc=\"Sans 22\">E16 Menu Editor II</span>\n"
"e16menuedit2 v0.0.3"
msgstr ""
#: e16menuedit2.glade.h:5
msgid "Choose _Icon"
msgstr ""
#: e16menuedit2.glade.h:7
msgid "E16 Menu Editor"
msgstr ""
#: e16menuedit2.glade.h:8
msgid "Fallback Help-Browser:"
msgstr ""
#: e16menuedit2.glade.h:9
msgid "Info"
msgstr ""
#: e16menuedit2.glade.h:10
msgid "Info about E16 Menu Editor"
msgstr ""
#: e16menuedit2.glade.h:12
msgid "Properties"
msgstr ""
#: e16menuedit2.glade.h:13
msgid "_Contents"
msgstr ""
#: e16menuedit2.glade.h:14
msgid "_Delete Entry"
msgstr ""
#: e16menuedit2.glade.h:15
msgid "_Edit"
msgstr ""
#: e16menuedit2.glade.h:16
msgid "_File"
msgstr ""
#: e16menuedit2.glade.h:17
msgid "_Help"
msgstr ""
#: e16menuedit2.glade.h:18
msgid "_New Entry"
msgstr ""
#: e16menuedit2.glade.h:19
msgid ""
"mozilla\n"
"firefox\n"
"epiphany\n"
"konqueror"
msgstr ""

149
po/fr.po Normal file
View File

@ -0,0 +1,149 @@
# SOME DESCRIPTIVE TITLE.
# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER
# This file is distributed under the same license as the e16menuedit2 package.
# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
#
#, fuzzy
msgid ""
msgstr ""
"Project-Id-Version: e16menuedit2\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2005-08-20 11:46+0200\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: Capdevielle Marc <yalp@free.fr>\n"
"Language-Team: Français\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=iso-8859-1\n"
"Content-Transfer-Encoding: 8bit\n"
#: src/callbacks.c:53
msgid "Save"
msgstr "Enregistrer"
#: src/callbacks.c:60 src/treeview.c:149 e16menuedit2.glade.h:11
msgid "New Entry"
msgstr "Nouvelle entrée"
#: src/callbacks.c:67 e16menuedit2.glade.h:4
msgid "Choose Icon"
msgstr "Choisissez une icône"
#: src/callbacks.c:74 e16menuedit2.glade.h:6
msgid "Delete Entry"
msgstr "Suppression de l'entrée"
#: src/callbacks.c:81
msgid "Quit"
msgstr "Quitter"
#: src/callbacks.c:310
msgid "No help file found!"
msgstr "Fichier d'aide introuvable !"
#: src/callbacks.c:314
msgid "No help application found"
msgstr "Application d'aide introuvable !"
#: src/e16menuedit2.c:118
msgid "Menu successfully loaded!"
msgstr "Menu chargé avec succès !"
#: src/icon_chooser.c:66
msgid "Select Icon..."
msgstr "Sélectionnez une icône..."
#: src/icon_chooser.c:102
msgid "Icon size:"
msgstr "Taille de l'icône"
#: src/treeview.c:57
msgid "Description"
msgstr "Description"
#: src/treeview.c:64
msgid "Icon"
msgstr "Icône"
#: src/treeview.c:86
msgid "Parameters"
msgstr "Paramètres"
#: src/treeview.c:203
msgid "Menu saved!"
msgstr "Menu sauvegardé !"
#: src/treeview.c:222
msgid "Submenu must have a name! -> menu not saved!"
msgstr "Le sous-menu doit avoir un nom -> le menu n'a pas été enregistré !"
#: src/treeview.c:226
msgid "Unknown error occurred while checking menu -> menu not saved!"
msgstr ""
"Une erreur est survenue lors de la vérification du menu -> le menu n'a pas "
"été enregistré !"
#: e16menuedit2.glade.h:1
msgid "<b>Properties:</b>"
msgstr "<b>Propriétés</b>"
#: e16menuedit2.glade.h:2
msgid ""
"<span font_desc=\"Sans 22\">E16 Menu Editor II</span>\n"
"e16menuedit2 v0.0.3"
msgstr ""
#: e16menuedit2.glade.h:5
msgid "Choose _Icon"
msgstr "Choissiez une _Icône"
#: e16menuedit2.glade.h:7
msgid "E16 Menu Editor"
msgstr "Éditeur de menu E16"
#: e16menuedit2.glade.h:8
msgid "Fallback Help-Browser:"
msgstr "Navigateur d'aide par défaut :"
#: e16menuedit2.glade.h:9
msgid "Info"
msgstr "À propos"
#: e16menuedit2.glade.h:10
msgid "Info about E16 Menu Editor"
msgstr "À propos de l'éditeur de menu E16"
#: e16menuedit2.glade.h:12
msgid "Properties"
msgstr "Propriétés"
#: e16menuedit2.glade.h:13
msgid "_Contents"
msgstr "_Contenus"
#: e16menuedit2.glade.h:14
msgid "_Delete Entry"
msgstr "_Suppression de l'entrée"
#: e16menuedit2.glade.h:15
msgid "_Edit"
msgstr "Édition"
#: e16menuedit2.glade.h:16
msgid "_File"
msgstr "_Fichier"
#: e16menuedit2.glade.h:17
msgid "_Help"
msgstr "_Aide"
#: e16menuedit2.glade.h:18
msgid "_New Entry"
msgstr "_Nouvelle entrée"
#: e16menuedit2.glade.h:19
msgid ""
"mozilla\n"
"firefox\n"
"epiphany\n"
"konqueror"
msgstr ""

156
po/ko.po Normal file
View File

@ -0,0 +1,156 @@
# E1616MENUEDIT2 Translation.
# This file is put in the public domain.
# Kim SeungBaeck/Michael Kim <lavnrose@e.sarang.net>, 2004.
#
msgid ""
msgstr ""
"Project-Id-Version: e16menuedit2\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2005-08-20 11:46+0200\n"
"PO-Revision-Date: 2004-08-08 11:05 +0900\n"
"Last-Translator: Michael Kim <lavnrose@e.sarang.net>\n"
"Language-Team: Korean Translation Team <translation-team-ko@lists."
"sourceforge.net>\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
#: src/callbacks.c:53
msgid "Save"
msgstr "저장"
#: src/callbacks.c:60 src/treeview.c:149 e16menuedit2.glade.h:11
msgid "New Entry"
msgstr "새 항목"
#: src/callbacks.c:67 e16menuedit2.glade.h:4
msgid "Choose Icon"
msgstr "아이콘 선택"
#: src/callbacks.c:74 e16menuedit2.glade.h:6
msgid "Delete Entry"
msgstr "항목 삭제"
#: src/callbacks.c:81
msgid "Quit"
msgstr "종료"
#: src/callbacks.c:310
msgid "No help file found!"
msgstr ""
#: src/callbacks.c:314
msgid "No help application found"
msgstr ""
#: src/e16menuedit2.c:118
msgid "Menu successfully loaded!"
msgstr ""
#: src/icon_chooser.c:66
msgid "Select Icon..."
msgstr "아이콘 선택..."
#: src/icon_chooser.c:102
msgid "Icon size:"
msgstr "아이콘 크기:"
#: src/treeview.c:57
msgid "Description"
msgstr "요약"
#: src/treeview.c:64
msgid "Icon"
msgstr "아이콘"
#: src/treeview.c:86
msgid "Parameters"
msgstr "인수"
#: src/treeview.c:203
msgid "Menu saved!"
msgstr ""
#: src/treeview.c:222
msgid "Submenu must have a name! -> menu not saved!"
msgstr ""
#: src/treeview.c:226
msgid "Unknown error occurred while checking menu -> menu not saved!"
msgstr ""
#: e16menuedit2.glade.h:1
msgid "<b>Properties:</b>"
msgstr ""
#: e16menuedit2.glade.h:2
#, fuzzy
msgid ""
"<span font_desc=\"Sans 22\">E16 Menu Editor II</span>\n"
"e16menuedit2 v0.0.3"
msgstr ""
"<span font_desc=\"Gulim 22\">E16 메뉴 편집기 II</span>\n"
"e16menuedit2 v0.2"
#: e16menuedit2.glade.h:5
#, fuzzy
msgid "Choose _Icon"
msgstr "아이콘 선택"
#: e16menuedit2.glade.h:7
msgid "E16 Menu Editor"
msgstr "E16 메뉴 편집기"
#: e16menuedit2.glade.h:8
msgid "Fallback Help-Browser:"
msgstr ""
#: e16menuedit2.glade.h:9
msgid "Info"
msgstr "정보"
#: e16menuedit2.glade.h:10
msgid "Info about E16 Menu Editor"
msgstr "E16 메뉴 편집기에 대한 정보"
#: e16menuedit2.glade.h:12
#, fuzzy
msgid "Properties"
msgstr "인수"
#: e16menuedit2.glade.h:13
msgid "_Contents"
msgstr ""
#: e16menuedit2.glade.h:14
#, fuzzy
msgid "_Delete Entry"
msgstr "항목 삭제"
#: e16menuedit2.glade.h:15
#, fuzzy
msgid "_Edit"
msgstr "편집"
#: e16menuedit2.glade.h:16
#, fuzzy
msgid "_File"
msgstr "화일"
#: e16menuedit2.glade.h:17
#, fuzzy
msgid "_Help"
msgstr "도움말"
#: e16menuedit2.glade.h:18
#, fuzzy
msgid "_New Entry"
msgstr "새 항목"
#: e16menuedit2.glade.h:19
msgid ""
"mozilla\n"
"firefox\n"
"epiphany\n"
"konqueror"
msgstr ""

154
po/tr.po Normal file
View File

@ -0,0 +1,154 @@
#
# Copyright (C) 2004 Onur Küçük <onur@delipenguen.net>
# This file is distributed under the same license as the e16menuedit2 package.
# Onur Küçük <onur@delipenguen.net>, 2004.
#
#, fuzzy
msgid ""
msgstr ""
"Project-Id-Version: e16menuedit2\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2005-08-20 11:46+0200\n"
"PO-Revision-Date: 2004-10-27 20:51+0200\n"
"Last-Translator: Onur Küçük <onur@delipenguen.net>\n"
"Language-Team: Turkish <onur@delipenguen.net>\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=iso-8859-9\n"
"Content-Transfer-Encoding: 8bit\n"
#: src/callbacks.c:53
msgid "Save"
msgstr "Kaydet"
#: src/callbacks.c:60 src/treeview.c:149 e16menuedit2.glade.h:11
msgid "New Entry"
msgstr "Yeni Girdi"
#: src/callbacks.c:67 e16menuedit2.glade.h:4
msgid "Choose Icon"
msgstr "Simge Seç"
#: src/callbacks.c:74 e16menuedit2.glade.h:6
msgid "Delete Entry"
msgstr "Girdi Sil"
#: src/callbacks.c:81
msgid "Quit"
msgstr "Çýkýþ"
#: src/callbacks.c:310
msgid "No help file found!"
msgstr ""
#: src/callbacks.c:314
msgid "No help application found"
msgstr ""
#: src/e16menuedit2.c:118
msgid "Menu successfully loaded!"
msgstr "Menü baþarýyla yüklendi!"
#: src/icon_chooser.c:66
msgid "Select Icon..."
msgstr "Simge Seç..."
#: src/icon_chooser.c:102
msgid "Icon size:"
msgstr "Simge boyutu:"
#: src/treeview.c:57
msgid "Description"
msgstr "Açýklama"
#: src/treeview.c:64
msgid "Icon"
msgstr "Simge"
#: src/treeview.c:86
msgid "Parameters"
msgstr "Parametreler"
#: src/treeview.c:203
msgid "Menu saved!"
msgstr "Menü kaydedildi!"
#: src/treeview.c:222
msgid "Submenu must have a name! -> menu not saved!"
msgstr "Altmenünün bir ismi olmalý! -> menü kaydedilmedi!"
#: src/treeview.c:226
msgid "Unknown error occurred while checking menu -> menu not saved!"
msgstr "Menü incelenirken bilinmeyen bir hata oluþtu -> menü kaydedilmedi!"
#: e16menuedit2.glade.h:1
msgid "<b>Properties:</b>"
msgstr "<b>Özellikler:</b>"
#: e16menuedit2.glade.h:2
#, fuzzy
msgid ""
"<span font_desc=\"Sans 22\">E16 Menu Editor II</span>\n"
"e16menuedit2 v0.0.3"
msgstr ""
"<span font_desc=\"Sans 22\">E16 Menü Düzenleyici II</span>\n"
"e16menuedit2 v0.0.1"
#: e16menuedit2.glade.h:5
msgid "Choose _Icon"
msgstr "_Simge Seç"
#: e16menuedit2.glade.h:7
msgid "E16 Menu Editor"
msgstr "E16 Menü Düzenleyici"
#: e16menuedit2.glade.h:8
msgid "Fallback Help-Browser:"
msgstr "Yardým-Tarayýcýsý"
#: e16menuedit2.glade.h:9
msgid "Info"
msgstr "Bilgi"
#: e16menuedit2.glade.h:10
msgid "Info about E16 Menu Editor"
msgstr "E16 Menü Düzenleyici hakkýnda bilgi"
#: e16menuedit2.glade.h:12
msgid "Properties"
msgstr "Özellikler"
#: e16menuedit2.glade.h:13
msgid "_Contents"
msgstr "Ýçe_rik"
#: e16menuedit2.glade.h:14
msgid "_Delete Entry"
msgstr "Girdi _Sil"
#: e16menuedit2.glade.h:15
msgid "_Edit"
msgstr "Dü_zenle"
#: e16menuedit2.glade.h:16
msgid "_File"
msgstr "_Dosya"
#: e16menuedit2.glade.h:17
msgid "_Help"
msgstr "_Yardým"
#: e16menuedit2.glade.h:18
msgid "_New Entry"
msgstr "_Yeni Girdi"
#: e16menuedit2.glade.h:19
msgid ""
"mozilla\n"
"firefox\n"
"epiphany\n"
"konqueror"
msgstr ""
"mozilla\n"
"firefox\n"
"epiphany\n"
"konqueror"

5
src/.cvsignore Normal file
View File

@ -0,0 +1,5 @@
.deps
.libs
Makefile
Makefile.in
e16menuedit2

27
src/Makefile.am Normal file
View File

@ -0,0 +1,27 @@
## Process this file with automake to produce Makefile.in
INCLUDES = \
@PACKAGE_CFLAGS@
bin_PROGRAMS = e16menuedit2
e16menuedit2_SOURCES = \
callbacks.c\
callbacks.h\
e16menuedit2.c\
e16menuedit2.h\
file.c\
file.h\
nls.h\
icon_chooser.c\
icon_chooser.h\
e16menu.c\
e16menu.h\
treeview.c\
treeview.h\
libglade_support.c\
libglade_support.h\
regex_func.c\
regex_func.h
e16menuedit2_LDADD = @PACKAGE_LIBS@ $(INTLLIBS)

413
src/callbacks.c Normal file
View File

@ -0,0 +1,413 @@
/* Copyright (C) 2004 Andreas Volz and various contributors
*
* Permission is hereby granted, free of charge, to any person ob-
* taining a copy of this software and associated documentation
* files (the "Software"), to deal in the Software without restric-
* tion, including without limitation the rights to use, copy, modi-
* fy, merge, publish, distribute, sublicense, and/or sell copies of
* the Software, and to permit persons to whom the Software is fur-
* nished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be
* included in all copies of the Software, its documentation and
* marketing & publicity materials, and acknowledgment shall be giv-
* en in the documentation, materials and software packages that
* this Software was used.
*
* 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 NONIN-
* FRINGEMENT. IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY
* CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CON-
* TRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
* WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*
* File: callbacks.c
* Created by: Andreas Volz <linux@brachttal.net>
*
*/
#include <string.h>
#include <unistd.h>
#include <sys/types.h>
#include "callbacks.h"
#include "e16menuedit2.h"
#include "file.h"
#include "icon_chooser.h"
#include "e16menu.h"
#include "treeview.h"
extern struct global_variables gv;
void bind_toolbar_callbacks (GtkWidget *treeview_menu)
{
GtkWidget *toolbar1;
GtkWidget *toolitem1;
toolbar1 = lookup_libglade_widget ("main_window", "toolbar1");
/* bind callbacks */
toolitem1 = lookup_libglade_widget ("main_window", "toolbutton_save");
gtk_tool_item_set_tooltip (GTK_TOOL_ITEM (toolitem1),
GTK_TOOLBAR (toolbar1)->tooltips,
_("Save"), "");
g_signal_connect (toolitem1, "clicked",
G_CALLBACK (on_toolbutton_save_clicked), treeview_menu);
toolitem1 = lookup_libglade_widget ("main_window", "toolbutton_new");
gtk_tool_item_set_tooltip (GTK_TOOL_ITEM (toolitem1),
GTK_TOOLBAR (toolbar1)->tooltips,
_("New Entry"), "");
g_signal_connect (toolitem1, "clicked",
G_CALLBACK (on_toolbutton_new_clicked), treeview_menu);
toolitem1 = lookup_libglade_widget ("main_window", "toolbutton_icon");
gtk_tool_item_set_tooltip (GTK_TOOL_ITEM (toolitem1),
GTK_TOOLBAR (toolbar1)->tooltips,
_("Choose Icon"), "");
g_signal_connect (toolitem1, "clicked",
G_CALLBACK (on_toolbutton_icon_clicked), treeview_menu);
toolitem1 = lookup_libglade_widget ("main_window", "toolbutton_del");
gtk_tool_item_set_tooltip (GTK_TOOL_ITEM (toolitem1),
GTK_TOOLBAR (toolbar1)->tooltips,
_("Delete Entry"), "");
g_signal_connect (toolitem1, "clicked",
G_CALLBACK (on_toolbutton_del_clicked), treeview_menu);
toolitem1 = lookup_libglade_widget ("main_window", "toolbutton_quit");
gtk_tool_item_set_tooltip (GTK_TOOL_ITEM (toolitem1),
GTK_TOOLBAR (toolbar1)->tooltips,
_("Quit"), "");
}
void bind_menubar_callbacks (GtkWidget *treeview_menu)
{
GtkWidget *menuitem;
menuitem = lookup_libglade_widget ("main_window", "menu_save");
g_signal_connect (menuitem, "activate",
G_CALLBACK (on_menu_save_activate), treeview_menu);
menuitem = lookup_libglade_widget ("main_window", "menu_new");
g_signal_connect (menuitem, "activate",
G_CALLBACK (on_menu_new_activate), treeview_menu);
menuitem = lookup_libglade_widget ("main_window", "menu_icon");
g_signal_connect (menuitem, "activate",
G_CALLBACK (on_menu_icon_activate), treeview_menu);
menuitem = lookup_libglade_widget ("main_window", "menu_delete");
g_signal_connect (menuitem, "activate",
G_CALLBACK (on_menu_delete_activate), treeview_menu);
}
void on_descrenderer_edited (GtkCellRendererText *celltext,
const gchar *string_path,
const gchar *new_text,
gpointer data)
{
GtkTreeModel *model = GTK_TREE_MODEL(data);
GtkTreeIter iter;
gchar *desc = NULL;
gtk_tree_model_get_iter_from_string (model, &iter, string_path);
gtk_tree_model_get (model, &iter, COL_DESCRIPTION, &desc, -1);
gtk_tree_store_set (GTK_TREE_STORE (model), &iter,
COL_DESCRIPTION, new_text,
-1);
g_free (desc);
}
void on_paramsrenderer_edited (GtkCellRendererText *celltext,
const gchar *string_path,
const gchar *new_text,
gpointer data)
{
GtkTreeModel *model = GTK_TREE_MODEL(data);
GtkTreeIter iter;
gchar *params = NULL;
gtk_tree_model_get_iter_from_string (model, &iter, string_path);
gtk_tree_model_get (model, &iter, COL_PARAMS, &params, -1);
gtk_tree_store_set (GTK_TREE_STORE (model), &iter,
COL_PARAMS, new_text,
-1);
g_free (params);
}
void on_iconcolumn_clicked (GtkTreeViewColumn *treeviewcolumn,
gpointer user_data)
{
}
void on_menu_save_activate (GtkMenuItem *menuitem,
gpointer user_data)
{
GtkWidget *treeview_menu;
treeview_menu = (GtkWidget*) user_data;
save_table_to_menu (treeview_menu);
}
void on_menu_info_activate (GtkMenuItem *menuitem,
gpointer user_data)
{
GtkWidget *info_window;
GtkWidget *logo_image;
GladeXML *info_xml;
char *pixmap_file;
info_xml = glade_xml_new (gv.glade_file,
"info_window", NULL);
register_libglade_parent (info_xml, "info_window");
glade_xml_signal_autoconnect (info_xml);
info_window = lookup_libglade_widget ("info_window", "info_window");
logo_image = lookup_libglade_widget ("info_window", "logo_image");
pixmap_file = searchPixmapFile ("e16menuedit2-icon.png");
gtk_image_set_from_file (GTK_IMAGE (logo_image),
pixmap_file);
gtk_window_set_icon_from_file (GTK_WINDOW (info_window),
pixmap_file,
NULL);
g_free (pixmap_file);
}
void on_toolbutton_save_clicked (GtkToolButton *toolbutton,
gpointer user_data)
{
GtkWidget *treeview_menu;
treeview_menu = (GtkWidget*) user_data;
save_table_to_menu (treeview_menu);
}
void on_toolbutton_new_clicked (GtkToolButton *toolbutton,
gpointer user_data)
{
GtkWidget *treeview_menu;
treeview_menu = (GtkWidget*) user_data;
new_table_row (treeview_menu);
}
void on_toolbutton_icon_clicked (GtkToolButton *toolbutton,
gpointer user_data)
{
open_icon_chooser ((GtkWidget *) user_data);
}
void on_toolbutton_del_clicked (GtkToolButton *toolbutton,
gpointer user_data)
{
GtkWidget *treeview_menu;
treeview_menu = (GtkWidget*) user_data;
delete_table_row (treeview_menu);
}
void on_menu_new_activate (GtkMenuItem *menuitem,
gpointer user_data)
{
GtkWidget *treeview_menu;
treeview_menu = (GtkWidget*) user_data;
new_table_row (treeview_menu);
}
void on_menu_icon_activate (GtkMenuItem *menuitem,
gpointer user_data)
{
open_icon_chooser ((GtkWidget *) user_data);
}
void on_menu_delete_activate (GtkMenuItem *menuitem,
gpointer user_data)
{
GtkWidget *treeview_menu;
treeview_menu = (GtkWidget*) user_data;
delete_table_row (treeview_menu);
}
gboolean
on_treeview_menu_button_press_event (GtkWidget *widget,
GdkEventButton *event,
gpointer user_data)
{
/* Currently deactivated until GtkTreeView Drag&Drop button
* problem is fixed */
/*GtkWidget *pop_menu1;
GladeXML *pop_menu1_xml;
GtkTreeView *treeview_menu;
pop_menu1_xml = glade_xml_new (PACKAGE_SOURCE_DIR"/e16menuedit2.glade",
"pop_menu1", NULL);
register_libglade_parent (pop_menu1_xml, "pop_menu1");
glade_xml_signal_autoconnect (pop_menu1_xml);
treeview_menu = (GtkTreeView *) user_data;
pop_menu1 = lookup_libglade_widget ("pop_menu1", "pop_menu1");
if (event->button == 3)
{
//deactivate_dragndrop (treeview_menu);
gtk_menu_popup (GTK_MENU (pop_menu1),
NULL,
NULL,
NULL,
NULL, // data
event->button,
event->time);
}
*/
return FALSE;
}
gboolean
on_pop_menu1_destroy_event (GtkWidget *widget,
GdkEvent *event,
gpointer user_data)
{
/*GtkWidget *treeview_menu;
treeview_menu = lookup_libglade_widget ("main_window", "treeview_menu");*/
//activate_dragndrop (GTK_TREE_VIEW (treeview_menu));
return FALSE;
}
void on_menu_contents_activate (GtkMenuItem *menuitem,
gpointer user_data)
{
int help_error;
help_error = run_help ("yelp", YELP_HELP_DIR, PACKAGE".xml");
if (help_error)
{
g_print ("running browser: %s\n", gv.browser);
help_error = run_help (gv.browser, YELP_HELP_DIR, PACKAGE".html");
if (help_error == 1)
{
print_statusbar (_("No help file found!"));
}
else if (help_error == 2)
{
print_statusbar (_("No help application found"));
}
}
}
void
on_menu_properties_activate (GtkMenuItem *menuitem,
gpointer user_data)
{
GtkWidget *properties_window;
GladeXML *properties_xml;
GtkWidget *comboboxentry1;
FILE *fz_properties;
gchar *filename_properties;
char key[KEY_LENGTH];
char value[VALUE_LENGTH];
GtkTreeModel* treemodel;
char *pixmap_file;
properties_xml = glade_xml_new (gv.glade_file, "properties_window", NULL);
register_libglade_parent (properties_xml, "properties_window");
glade_xml_signal_autoconnect (properties_xml);
properties_window = lookup_libglade_widget ("properties_window", "properties_window");
comboboxentry1 = lookup_libglade_widget ("properties_window", "comboboxentry1");
gtk_combo_box_set_active (GTK_COMBO_BOX (comboboxentry1), 0);
pixmap_file = searchPixmapFile ("e16menuedit2-icon.png");
gtk_window_set_icon_from_file (GTK_WINDOW (properties_window),
pixmap_file, NULL);
g_free (pixmap_file);
filename_properties = g_strdup_printf ("%s/%s/properties",
homedir (getuid ()), APP_HOME);
fz_properties = fopen (filename_properties, "r");
if (fz_properties != NULL)
{
fscanf (fz_properties, "%s = %s", key, value);
treemodel = gtk_combo_box_get_model (GTK_COMBO_BOX (comboboxentry1));
gtk_tree_model_foreach (GTK_TREE_MODEL(treemodel), browser_func,
(gpointer) value);
fclose (fz_properties);
}
g_free (filename_properties);
}
void
on_properties_close_clicked (GtkButton *button,
gpointer user_data)
{
FILE *fz_properties;
gchar *filename_properties;
G_CONST_RETURN gchar *value;
GtkWidget *comboboxentry1;
GtkTreeIter iter;
gboolean valid;
GtkTreeModel* treemodel;
GtkWidget *properties_window;
filename_properties = g_strdup_printf ("%s/%s/properties",
homedir (getuid ()), APP_HOME);
fz_properties = fopen (filename_properties, "w");
if (fz_properties != NULL)
{
comboboxentry1 = lookup_libglade_widget ("properties_window", "comboboxentry1");
valid = gtk_combo_box_get_active_iter (GTK_COMBO_BOX (comboboxentry1), &iter);
if (valid)
{
treemodel = gtk_combo_box_get_model (GTK_COMBO_BOX (comboboxentry1));
gtk_tree_model_get (treemodel, &iter,
0, &value,
-1);
g_free (gv.browser);
gv.browser = g_malloc (strlen (value)+1);
strncpy (gv.browser, value, strlen (value)+1);
fprintf (fz_properties, "%s = %s\n", "browser", value);
}
fclose (fz_properties);
}
properties_window = lookup_libglade_widget ("properties_window", "properties_window");
gtk_widget_destroy (GTK_WIDGET (properties_window));
g_free (filename_properties);
}

116
src/callbacks.h Normal file
View File

@ -0,0 +1,116 @@
/* Copyright (C) 2004 Andreas Volz and various contributors
*
* Permission is hereby granted, free of charge, to any person ob-
* taining a copy of this software and associated documentation
* files (the "Software"), to deal in the Software without restric-
* tion, including without limitation the rights to use, copy, modi-
* fy, merge, publish, distribute, sublicense, and/or sell copies of
* the Software, and to permit persons to whom the Software is fur-
* nished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be
* included in all copies of the Software, its documentation and
* marketing & publicity materials, and acknowledgment shall be giv-
* en in the documentation, materials and software packages that
* this Software was used.
*
* 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 NONIN-
* FRINGEMENT. IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY
* CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CON-
* TRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
* WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*
* File: callbacks.h
* Created by: Andreas Volz <linux@brachttal.net>
*
*/
#ifndef _CALLBACKS_H
#define _CALLBACKS_H
#ifdef HAVE_CONFIG_H
# include <config.h>
#endif
#include <gtk/gtk.h>
#include <glade/glade.h>
#include "libglade_support.h"
#define ICON_SIZE_AUTO_STRING "auto (64x64 limit)"
#define ICON_SIZE1_STRING "64x64"
#define ICON_SIZE2_STRING "48x48"
#define ICON_SIZE3_STRING "36x36"
#define ICON_SIZE4_STRING "32x32"
#define ICON_SIZE5_STRING "24x24"
#define ICON_SIZE6_STRING "22x22"
#define ICON_SIZE7_STRING "16x16"
#define ICON_SIZE_AUTO 64
#define ICON_SIZE1 64
#define ICON_SIZE2 48
#define ICON_SIZE3 36
#define ICON_SIZE4 32
#define ICON_SIZE5 24
#define ICON_SIZE6 22
#define ICON_SIZE7 16
/* defines for parser */
#define KEY_LENGTH 50
#define VALUE_LENGTH 100
void bind_toolbar_callbacks (GtkWidget *treeview_menu);
void bind_menubar_callbacks (GtkWidget *treeview_menu);
void on_menu_save_activate (GtkMenuItem *menuitem,
gpointer user_data);
void on_descrenderer_edited (GtkCellRendererText *celltext,
const gchar *string_path,
const gchar *new_text,
gpointer data);
void on_paramsrenderer_edited (GtkCellRendererText *celltext,
const gchar *string_path,
const gchar *new_text,
gpointer data);
void on_iconcolumn_clicked (GtkTreeViewColumn *treeviewcolumn,
gpointer user_data);
void on_menu_info_activate (GtkMenuItem *menuitem,
gpointer user_data);
void on_toolbutton_save_clicked (GtkToolButton *toolbutton,
gpointer user_data);
void on_toolbutton_new_clicked (GtkToolButton *toolbutton,
gpointer user_data);
void on_toolbutton_icon_clicked (GtkToolButton *toolbutton,
gpointer user_data);
void on_toolbutton_del_clicked (GtkToolButton *toolbutton,
gpointer user_data);
void on_menu_new_activate (GtkMenuItem *menuitem,
gpointer user_data);
void on_menu_icon_activate (GtkMenuItem *menuitem,
gpointer user_data);
void on_menu_delete_activate (GtkMenuItem *menuitem,
gpointer user_data);
gboolean
on_treeview_menu_button_press_event (GtkWidget *widget,
GdkEventButton *event,
gpointer user_data);
gboolean
on_pop_menu1_destroy_event (GtkWidget *widget,
GdkEvent *event,
gpointer user_data);
void on_menu_contents_activate (GtkMenuItem *menuitem,
gpointer user_data);
void
on_menu_properties_activate (GtkMenuItem *menuitem,
gpointer user_data);
void
on_properties_close_clicked (GtkButton *button,
gpointer user_data);
#endif /* _CALLBACKS_H */

411
src/e16menu.c Normal file
View File

@ -0,0 +1,411 @@
/* Copyright (C) 2004 Andreas Volz and various contributors
*
* Permission is hereby granted, free of charge, to any person ob-
* taining a copy of this software and associated documentation
* files (the "Software"), to deal in the Software without restric-
* tion, including without limitation the rights to use, copy, modi-
* fy, merge, publish, distribute, sublicense, and/or sell copies of
* the Software, and to permit persons to whom the Software is fur-
* nished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be
* included in all copies of the Software, its documentation and
* marketing & publicity materials, and acknowledgment shall be giv-
* en in the documentation, materials and software packages that
* this Software was used.
*
* 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 NONIN-
* FRINGEMENT. IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY
* CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CON-
* TRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
* WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*
* File: e16menu.h
* Created by: Andreas Volz <linux@brachttal.net>
*
*/
#include <stdio.h>
#include "e16menu.h"
#include "file.h"
#include "e16menuedit2.h"
#include "treeview.h"
extern struct global_variables gv;
GtkTreeModel *load_menus_from_disk (void)
{
FILE *menufile;
char buf[1024];
char first = 1;
char s[4096];
GtkTreeStore *store;
GtkTreeIter iter, sub_iter;
store = gtk_tree_store_new (TREE_COLUMNS_SIZE,
G_TYPE_STRING,
GDK_TYPE_PIXBUF,
G_TYPE_STRING,
G_TYPE_STRING);
if (gv.emenu == EMENU_AUTODETECT)
{
struct stat stat_buf;
gboolean epath_missing = TRUE;
sprintf (buf, "%s/file.menu", gv.epath);
epath_missing = stat (buf, &stat_buf);
if (epath_missing)
{
sprintf (buf, "%s/menus/file.menu", gv.epath);
}
}
else if (gv.emenu == EMENU_MENUS)
{
sprintf (buf, "%s/menus/file.menu", gv.epath);
}
else
{
g_critical ("unknown menu definition!\n");
exit (1);
}
menufile = fopen (buf, "r");
if (!menufile)
{
g_critical ("hmm. looks like you have some \"issues\" as you don't have "
"a %s file.\n", buf);
exit(1);
}
#ifdef DEBUG
g_print ("Loading menu: %s\n", buf);
#endif /* DEBUG */
while (fgets (s, 4096, menufile))
{
s[strlen (s) - 1] = 0;
if ((s[0] && s[0] != '#'))
{
if (first)
{
gchar **data;
menu_regex (s, &data);
data[3] = to_utf8 (buf);
gtk_tree_store_append (store, &iter, NULL);
gtk_tree_store_set (store, &iter,
COL_DESCRIPTION, data[0],
COL_ICON, gdk_pixbuf_new_from_file (data[1], NULL),
COL_ICONNAME, data[1],
COL_PARAMS, data[3],
-1);
g_free (data[0]);
g_free (data[1]);
g_free (data[2]);
g_free (data[3]);
g_free (data);
first = 0;
}
else
{
gchar **data;
menu_regex (s, &data);
gtk_tree_store_append (store, &sub_iter, &iter);
gtk_tree_store_set (store, &sub_iter,
COL_DESCRIPTION, data[0],
COL_ICON, gdk_pixbuf_new_from_file (data[1], NULL),
COL_ICONNAME, data[1],
COL_PARAMS, data[3],
-1);
if (!strcasecmp (data[2], "menu"))
load_sub_menu_from_disk (data[3], store, &sub_iter);
g_free (data[0]);
g_free (data[1]);
g_free (data[2]);
g_free (data[3]);
g_free (data);
}
}
}
fclose (menufile);
return GTK_TREE_MODEL (store);
}
/* load submenu from disk */
void load_sub_menu_from_disk (char *file_to_load, GtkTreeStore *store,
GtkTreeIter *iter)
{
FILE *menufile;
char buf[1024];
char first = 1;
char s[4096];
GtkTreeIter sub_iter;
if (!file_to_load)
return;
if (file_to_load[0] != '/')
sprintf (buf, "%s/%s", gv.epath, file_to_load);
else
sprintf (buf, "%s", file_to_load);
menufile = fopen (buf, "r");
#ifdef DEBUG
g_print ("Loading submenu: %s\n", buf);
#endif /* DEBUG */
if (!menufile)
return;
while (fgets (s, 4096, menufile))
{
s[strlen (s) - 1] = 0;
if ((s[0] && s[0] != '#'))
{
if (first)
first = 0;
else
{
gchar **data;
menu_regex (s, &data);
gtk_tree_store_append (store, &sub_iter, iter);
gtk_tree_store_set (store, &sub_iter,
COL_DESCRIPTION, data[0],
COL_ICON, gdk_pixbuf_new_from_file (data[1], NULL),
COL_ICONNAME, data[1],
COL_PARAMS, data[3],
-1);
if (!strcasecmp (data[2], "menu"))
load_sub_menu_from_disk (data[3], store, &sub_iter);
g_free (data[0]);
g_free (data[1]);
g_free (data[2]);
g_free (data[3]);
g_free (data);
}
}
}
fclose (menufile);
return;
}
#define WRITE_FILE /* undef this for debugging without writing menus */
gboolean table_save_func (GtkTreeModel *model, GtkTreePath *path,
GtkTreeIter *iter, gpointer user_data)
{
gchar *description, *icon, *params;
gchar *tree_path_str;
gboolean has_child;
gint depth;
gchar *realfile;
gchar *dirname;
FILE *menu_ptr, *menu_ptr2;
gchar buffer[128];
gtk_tree_model_get (model, iter,
COL_DESCRIPTION, &description,
COL_ICONNAME, &icon,
COL_PARAMS, &params,
-1);
tree_path_str = gtk_tree_path_to_string(path);
has_child = gtk_tree_model_iter_has_child (model, iter);
depth = gtk_tree_path_get_depth (path) - 1;
if (depth + 1 >= MAX_RECURSION)
{
g_print ("maximum menu recursion reached! -> %d\n", MAX_RECURSION);
return TRUE;
}
if (!g_path_is_absolute (params))
{
/* Tarnation! A relative path */
//realfile = g_strjoin ("/", gv.epath, params, NULL);
realfile = g_strdup_printf ("%s/%s", gv.epath, params);
//g_print ("FILE: %s,%s,%s\n", gv.epath, params, realfile);
}
else
{
realfile = g_strdup (params);
}
menu_file[depth] = g_strdup (realfile);
#ifdef WRITE_FILE
/* create recursiv new menu subdirectory */
dirname = g_path_get_dirname (realfile);
mkdir_with_parent (dirname, 0755);
g_free (dirname);
#endif /* WRITE_FILE */
if (depth > 0)
{
#ifdef WRITE_FILE
menu_ptr = fopen (menu_file[depth-1], "a+");
#endif /* WRITE_FILE */
if (menu_ptr == NULL)
{
printf ("Couldn't save menu to: %s\n", menu_file[depth-1]);
}
if (has_child)
{
#ifdef WRITE_FILE
menu_ptr2 = fopen (menu_file[depth], "w");
if (menu_ptr2 == NULL)
{
printf ("Couldn't save menu to: %s\n", menu_file[depth]);
}
#endif /* WRITE_FILE */
sprintf (buffer, "\"%s\"\n", description);
#ifdef WRITE_FILE
fprintf (menu_ptr2, "%s", from_utf8 (buffer));
fclose (menu_ptr2);
#else
g_print ("write header to: \"%s\"\n", menu_file[depth]);
#endif /* !WRITE_FILE */
sprintf (buffer, "\"%s\"\t%s\tmenu\t\"%s\"\n",
description[0] == '\0' ? "NULL" : description,
icon[0] == '\0' ? "NULL" : icon,
params[0] == '\0' ? "" : params);
#ifdef WRITE_FILE
fprintf (menu_ptr, "%s", from_utf8 (buffer));
#else
g_print ("write menu to: \"%s\"\n", menu_file[depth-1]);
#endif /* WRITE_FILE */
}
else
{
sprintf (buffer, "\"%s\"\t%s\texec\t\"%s\"\n",
description[0] == '\0' ? "NULL" : description,
icon[0] == '\0' ? "NULL" : icon,
params[0] == '\0' ? "" : params);
#ifdef WRITE_FILE
fprintf (menu_ptr, "%s", from_utf8 (buffer));
#else
g_print ("write exec to: \"%s\"\n", menu_file[depth-1]);
#endif /*WRITE_FILE */
}
#ifdef WRITE_FILE
fclose (menu_ptr);
#endif /*WRITE_FILE */
}
else
{
#ifdef WRITE_FILE
menu_ptr2 = fopen (menu_file[depth], "w");
if (menu_ptr2 == NULL)
{
printf ("Couldn't save menu to: %s\n", menu_file[depth]);
}
#endif /*WRITE_FILE */
sprintf (buffer, "\"%s\"\n", description);
#ifdef WRITE_FILE
fprintf (menu_ptr2, "%s", from_utf8 (buffer));
fclose (menu_ptr2);
#else
g_print ("write first header to: \"%s\"\n", menu_file[depth]);
#endif /* WRITE_FILE */
}
#ifndef WRITE_FILE
g_print ("%s | ", tree_path_str);
g_print ("%s %s %s\n", description, icon, params);
#endif /* !WRITE_FILE */
/* end of filelist to free it later */
menu_file[depth+1] = NULL;
g_free (tree_path_str);
g_free (realfile);
g_free (description);
g_free (icon);
g_free (params);
return FALSE;
}
gboolean table_check_func (GtkTreeModel *model, GtkTreePath *path,
GtkTreeIter *iter, gpointer user_data)
{
gchar *description, *icon, *params;
gchar *tree_path_str;
gboolean has_child;
gint depth;
gchar buffer[128];
gtk_tree_model_get (model, iter,
COL_DESCRIPTION, &description,
COL_ICONNAME, &icon,
COL_PARAMS, &params,
-1);
tree_path_str = gtk_tree_path_to_string(path);
has_child = gtk_tree_model_iter_has_child (model, iter);
depth = gtk_tree_path_get_depth (path) - 1;
gv.app_errno = 0;
strcpy (gv.app_errno_str, "");
if (depth + 1 >= MAX_RECURSION)
{
g_print ("maximum menu recursion reached! -> %d\n", MAX_RECURSION);
return TRUE;
}
if (depth > 0)
{
if (has_child)
{
/* some checks for submenus */
if (!strcmp (params, ""))
{
gv.app_errno = AE_EMPTY_SUBMENU;
strncpy (gv.app_errno_str, tree_path_str, APP_ERRNO_STR_LEN);
return TRUE;
}
}
else
{
/* some checks for entries */
}
}
else
{
/* check for root node */
}
g_free(tree_path_str);
g_free(description);
g_free(icon);
g_free(params);
return FALSE;
}

50
src/e16menu.h Normal file
View File

@ -0,0 +1,50 @@
/* Copyright (C) 2004 Andreas Volz and various contributors
*
* Permission is hereby granted, free of charge, to any person ob-
* taining a copy of this software and associated documentation
* files (the "Software"), to deal in the Software without restric-
* tion, including without limitation the rights to use, copy, modi-
* fy, merge, publish, distribute, sublicense, and/or sell copies of
* the Software, and to permit persons to whom the Software is fur-
* nished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be
* included in all copies of the Software, its documentation and
* marketing & publicity materials, and acknowledgment shall be giv-
* en in the documentation, materials and software packages that
* this Software was used.
*
* 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 NONIN-
* FRINGEMENT. IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY
* CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CON-
* TRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
* WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*
* File: e16menu.h
* Created by: Andreas Volz <linux@brachttal.net>
*
*/
#ifndef _E16MENU_H
#define _E16MENU_H
#include <gtk/gtk.h>
#ifdef HAVE_CONFIG_H
#include <config.h>
#endif
#define MAX_RECURSION 128
GtkTreeModel *load_menus_from_disk (void);
void load_sub_menu_from_disk (char *file_to_load, GtkTreeStore *store,
GtkTreeIter *iter);
gboolean table_save_func (GtkTreeModel *model, GtkTreePath *path,
GtkTreeIter *iter, gpointer user_data);
gboolean table_check_func (GtkTreeModel *model, GtkTreePath *path,
GtkTreeIter *iter, gpointer user_data);
gchar *menu_file[MAX_RECURSION];
#endif /* _E16MENU_H */

265
src/e16menuedit2.c Normal file
View File

@ -0,0 +1,265 @@
/* Copyright (C) 2004 Andreas Volz and various contributors
*
* Permission is hereby granted, free of charge, to any person ob-
* taining a copy of this software and associated documentation
* files (the "Software"), to deal in the Software without restric-
* tion, including without limitation the rights to use, copy, modi-
* fy, merge, publish, distribute, sublicense, and/or sell copies of
* the Software, and to permit persons to whom the Software is fur-
* nished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be
* included in all copies of the Software, its documentation and
* marketing & publicity materials, and acknowledgment shall be giv-
* en in the documentation, materials and software packages that
* this Software was used.
*
* 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 NONIN-
* FRINGEMENT. IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY
* CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CON-
* TRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
* WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*
* File: e16menuedit2.c
* Created by: Andreas Volz <linux@brachttal.net>
*
*/
#include <unistd.h>
#include <sys/types.h>
#include <string.h>
#include <stdarg.h>
#include "callbacks.h"
#include "e16menuedit2.h"
#include "file.h"
#include "e16menu.h"
#include "treeview.h"
struct global_variables gv;
int main (int argc, char *argv[])
{
GladeXML *main_xml;
GtkWidget *main_window;
GtkWidget *treeview_menu;
GtkWidget *main_statusbar;
char app_dir[PATH_MAX];
char package[] = "librsvg-2.0";
char librsvg_version[] = "2.7.1";
char *version;
int i;
char *pixmap_file;
FILE *fz_properties;
gchar *filename_properties;
char key[KEY_LENGTH];
char value[VALUE_LENGTH];
#ifdef ENABLE_NLS
bindtextdomain (GETTEXT_PACKAGE, PACKAGE_LOCALE_DIR);
bind_textdomain_codeset (GETTEXT_PACKAGE, "UTF-8");
textdomain (PACKAGE);
#endif
/* compile some regex patterns */
compile_regex ();
/* set log level for app exit */
g_log_set_always_fatal (G_LOG_LEVEL_ERROR);
parse_options (argc, argv);
gtk_init (&argc, &argv);
for (i = 0; i < MAX_RECURSION; i++)
{
menu_file[i] = NULL;
}
gv.glade_file = searchGladeFile ("e16menuedit2.glade");
main_xml = glade_xml_new (gv.glade_file, "main_window", NULL);
register_libglade_parent (main_xml, "main_window");
glade_xml_signal_autoconnect (main_xml);
main_window = lookup_libglade_widget ("main_window", "main_window");
pixmap_file = searchPixmapFile ("e16menuedit2-icon.png");
gtk_window_set_icon_from_file (GTK_WINDOW (main_window),
pixmap_file, NULL);
g_free (pixmap_file);
treeview_menu = lookup_libglade_widget ("main_window", "treeview_menu");
create_tree_model (treeview_menu);
/* bind callbacks manual. Is Glade too stupid for it? */
bind_toolbar_callbacks (treeview_menu);
bind_menubar_callbacks (treeview_menu);
/* create initial directories */
sprintf (app_dir, "%s/%s/%s", homedir (getuid ()), APP_HOME, ICON_DIR);
mkdir_with_parent (app_dir, 0755);
/* get librsvg version and check if good enough */
version = pkg_config_version (package);
if (version)
{
gv.librsvg_cmp = version_cmp (version, librsvg_version);
g_free (version);
}
else
{
gv.librsvg_cmp = NOT_INSTALLED;
}
print_statusbar (_("Menu successfully loaded!"));
/* read some properties */
filename_properties = g_strdup_printf ("%s/%s/properties",
homedir (getuid ()), APP_HOME);
fz_properties = fopen (filename_properties, "r");
if (fz_properties != NULL)
{
fscanf (fz_properties, "%s = %s", key, value);
g_free (gv.browser);
gv.browser = g_malloc (strlen (value)+1);
strncpy (gv.browser, value, strlen (value)+1);
fclose (fz_properties);
}
g_free (filename_properties);
gtk_main ();
free (gv.epath);
g_free (gv.glade_file);
return 0;
}
void print_statusbar (const gchar *format, ...)
{
const int statusbar_len = 100;
va_list ap;
gchar str[statusbar_len];
GtkWidget *main_statusbar;
va_start (ap, format);
g_vsnprintf (str, statusbar_len, format, ap);
main_statusbar = lookup_libglade_widget ("main_window", "main_statusbar");
gtk_statusbar_push (GTK_STATUSBAR (main_statusbar),
0,
str);
}
void dbg_printf (const gchar *format, ...)
{
va_list ap;
va_start (ap, format);
printf ("(%s, %d): ", __FILE__, __LINE__);
g_vprintf(format, ap);
}
gboolean browser_func (GtkTreeModel *model, GtkTreePath *path,
GtkTreeIter *iter, gpointer user_data)
{
gchar *value;
gchar *tree_path_str;
GtkWidget *comboboxentry1;
comboboxentry1 = lookup_libglade_widget ("properties_window", "comboboxentry1");
gtk_tree_model_get (model, iter, 0, &value, -1);
tree_path_str = gtk_tree_path_to_string(path);
if (!strcmp (value, (char*) user_data))
{
gtk_combo_box_set_active (GTK_COMBO_BOX (comboboxentry1),
atoi (tree_path_str));
g_free (gv.browser);
gv.browser = g_malloc (strlen (value)+1);
strncpy (gv.browser, value, strlen (value)+1);
g_free(tree_path_str);
return TRUE;
}
g_free(tree_path_str);
return FALSE;
}
void parse_options (int argc, char **argv)
{
poptContext context;
int option;
gv.epath = NULL;
struct stat buf;
gboolean epath_missing = TRUE;
char *tmp;
gv.emenu = EMENU_AUTODETECT;
struct poptOption options[] =
{
{"menus", 'm', POPT_ARG_NONE, NULL, ARG_MENUS,
"Force search of file.menu in 'menus' subdirecory of enlightenment "
"configuration direcory. If not given e16menuedit2 try to auto detect it.",
NULL},
{"version", 'v', POPT_ARG_NONE, NULL, ARG_VERSION, "show version", NULL},
POPT_AUTOHELP {NULL, '\0', 0, NULL, 0}
};
/* get E path */
tmp = getenv ("ECONFDIR");
gv.epath = g_strdup_printf (tmp);
if (!gv.epath)
{
gv.epath = g_strdup_printf ("%s/%s", homedir (getuid ()),
ENLIGHTENMENT_PATH);
}
epath_missing = stat (gv.epath, &buf);
if (epath_missing)
{
g_critical ("The direcory %s seems not to be a E16 conf path!\n", gv.epath);
}
context = poptGetContext ("popt1", argc, (const char **) argv, options, 0);
/* start option handling */
while ((option = poptGetNextOpt (context)) > 0)
{
switch (option)
{
case ARG_MENUS:
gv.emenu = EMENU_MENUS;
break;
case ARG_VERSION:
show_version ();
exit (0);
break;
}
}
}
void show_version ()
{
g_print ("Package name: ");
g_print ("%s %s\n", PACKAGE, VERSION);
g_print ("Build information: ");
g_print ("%s %s\n", __DATE__, __TIME__);
}

96
src/e16menuedit2.h Normal file
View File

@ -0,0 +1,96 @@
/* Copyright (C) 2004 Andreas Volz and various contributors
*
* Permission is hereby granted, free of charge, to any person ob-
* taining a copy of this software and associated documentation
* files (the "Software"), to deal in the Software without restric-
* tion, including without limitation the rights to use, copy, modi-
* fy, merge, publish, distribute, sublicense, and/or sell copies of
* the Software, and to permit persons to whom the Software is fur-
* nished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be
* included in all copies of the Software, its documentation and
* marketing & publicity materials, and acknowledgment shall be giv-
* en in the documentation, materials and software packages that
* this Software was used.
*
* 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 NONIN-
* FRINGEMENT. IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY
* CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CON-
* TRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
* WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*
* File: e16menuedit2.h
* Created by: Andreas Volz <linux@brachttal.net>
*
*/
#ifndef _E16MENUEDIT_H
#define _E16MENUEDIT_H
#include <gtk/gtk.h>
#include <glade/glade.h>
#ifdef HAVE_CONFIG_H
#include <config.h>
#endif
#include <popt.h>
#include "nls.h"
#include "libglade_support.h"
#include "regex_func.h"
#define to_utf8(String) g_locale_to_utf8(String,-1,0,0,0)
#define from_utf8(String) g_locale_from_utf8(String,-1,0,0,0)
#define APP_ERRNO_STR_LEN 1024
#define APP_HOME ".e16menuedit2"
#define ICON_DIR "icons"
#define DEBUG_OUTPUT printf ("(%s, %d): ", __FILE__, __LINE__);
#define ENLIGHTENMENT_PATH ".enlightenment"
#define E16_PATH ".e16"
#define NOT_INSTALLED -1
void print_statusbar (const gchar *format, ...);
gboolean browser_func (GtkTreeModel *model, GtkTreePath *path,
GtkTreeIter *iter, gpointer user_data);
void parse_options (int argc, char **argv);
void show_version ();
struct global_variables
{
int app_errno;
char app_errno_str[APP_ERRNO_STR_LEN];
int librsvg_cmp;
char *browser;
char *glade_file;
char *epath;
int emenu;
regex_t re_mark;
regex_t re_char;
regex_t re_space;
char *pattern_mark;
char *pattern_char;
char *pattern_space;
};
/* app_errno codes */
enum
{
AE_NO_ERROR = 0,
AE_EMPTY_SUBMENU
};
enum
{
ARG_MENUS = 1,
ARG_VERSION
};
enum
{
EMENU_AUTODETECT,
EMENU_MENUS
};
#endif /* _E16MENUEDIT_H */

528
src/file.c Normal file
View File

@ -0,0 +1,528 @@
/* Copyright (C) 2004 Andreas Volz and various contributors
*
* Permission is hereby granted, free of charge, to any person ob-
* taining a copy of this software and associated documentation
* files (the "Software"), to deal in the Software without restric-
* tion, including without limitation the rights to use, copy, modi-
* fy, merge, publish, distribute, sublicense, and/or sell copies of
* the Software, and to permit persons to whom the Software is fur-
* nished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be
* included in all copies of the Software, its documentation and
* marketing & publicity materials, and acknowledgment shall be giv-
* en in the documentation, materials and software packages that
* this Software was used.
*
* 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 NONIN-
* FRINGEMENT. IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY
* CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CON-
* TRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
* WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*
* File: file.c
* Created by: Andreas Volz <linux@brachttal.net>
*
*/
#include "file.h"
extern struct global_variables gv;
char *homedir (int uid)
{
char *s;
static int usr_uid = -1;
static char *usr_s = NULL;
struct passwd *pwd;
if (usr_uid < 0)
usr_uid = getuid ();
if ((uid == usr_uid) && (usr_s))
{
return (g_strdup (usr_s));
}
pwd = getpwuid (uid);
if (pwd)
{
s = g_strdup (pwd->pw_dir);
if (uid == usr_uid)
usr_s = g_strdup (s);
return (s);
}
return (g_strdup
((getenv ("TMPDIR") == NULL) ? "/tmp" : getenv ("TMPDIR")));
}
void compile_regex ()
{
int status;
char err_buf[ERR_BUF_SIZE];
char pattern_mark[] = "\"([^\"]*)\"[[:space:]]*";
char pattern_char[] = "([^[[:space:]]*)[[:space:]]*";
char pattern_space[] = "[[:space:]]*(.*)";
status = regcomp (&gv.re_mark, pattern_mark, REG_EXTENDED);
if (status != 0)
{
regerror (status, &gv.re_mark, err_buf, (size_t) ERR_BUF_SIZE);
printf ("regex compile: %s\n", err_buf);
}
status = regcomp (&gv.re_char, pattern_char, REG_EXTENDED);
if (status != 0)
{
regerror (status, &gv.re_mark, err_buf, (size_t) ERR_BUF_SIZE);
printf ("regex compile: %s\n", err_buf);
}
status = regcomp (&gv.re_space, pattern_space, REG_EXTENDED);
if (status != 0)
{
regerror (status, &gv.re_mark, err_buf, (size_t) ERR_BUF_SIZE);
printf ("regex compile: %s\n", err_buf);
}
gv.pattern_mark = strdup (pattern_mark);
gv.pattern_char = strdup (pattern_char);
gv.pattern_space = strdup (pattern_space);
}
int menu_regex (char *line, gchar ***data_ptr)
{
struct substrings *ss = NULL;
int numsub = 0;
int maxsub = 1;
int status;
char err_buf[ERR_BUF_SIZE];
char **data;
int i, n;
data = malloc (4 * sizeof (*data));
*data_ptr = data;
line = strdup (line);
/* cut spaces */
if (line[0] == ' ')
{
status = regex_sub2 (&gv.re_space, line, gv.pattern_space,
&ss, maxsub, &numsub);
if (numsub >= 1)
{
free (line);
line = strdup (ss[1].match);
}
for (i = 0; i < numsub; i++)
{
free (ss[i].match);
free (ss[i].start);
free (ss[i].end);
}
free (ss);
}
/* parse data array */
for (n = 0; n < 4; n++)
{
data[n] = strdup ("");
if (line[0] == '\"')
{
status = regex_sub2 (&gv.re_mark, line, gv.pattern_mark,
&ss, maxsub, &numsub);
if (status != 0)
{
regerror (status, &gv.re_mark, err_buf, (size_t) ERR_BUF_SIZE);
printf ("regex exec: %s\n", err_buf);
}
if (numsub >= 1)
{
free (line);
line = strdup (ss[0].end);
free (data[n]);
data[n] = to_utf8 (ss[1].match);
}
for (i = 0; i < numsub; i++)
{
free (ss[i].match);
free (ss[i].start);
free (ss[i].end);
}
free (ss);
}
else if (line[0] != ' ')
{
status = regex_sub2 (&gv.re_char, line, gv.pattern_char,
&ss, maxsub, &numsub);
if (status != 0)
{
regerror (status, &gv.re_char, err_buf, (size_t) ERR_BUF_SIZE);
printf ("regex exec: %s\n", err_buf);
}
if (numsub >= 1)
{
free (line);
line = strdup (ss[0].end);
free (data[n]);
data[n] = to_utf8 (ss[1].match);
}
for (i = 0; i < numsub; i++)
{
free (ss[i].match);
free (ss[i].start);
free (ss[i].end);
}
free (ss);
}
}
return 0;
}
int mkdir_with_parent (const char *pathname, mode_t mode)
{
int err;
int i;
char *left;
char *tok;
char *pathname_copy = strdup (pathname);
i = 0;
do
{
tok = strtok_left (pathname_copy, "/", i);
if (!tok)
break;
left = strsplit (pathname_copy, NULL,
strlen (pathname_copy) - strlen (tok));
err = mkdir (left, mode);
i++;
}
while (tok != NULL);
free (pathname_copy);
return err;
}
char *strsplit (char *s, char **right, int count)
{
char *s_org = strdup (s);
if (count < strlen (s))
{
if (right)
strcpy (*right, s + count);
s_org[count]='\0';
}
return s_org;
}
char *strtok_left (char *s, const char *delim, unsigned int number)
{
int i;
char *pos = s;
char *s_new;
if (number == 0)
return s;
if (strcmp (s + strlen (s) - strlen (delim), delim))
{
s_new = malloc (strlen (s) + strlen (delim) + 1);
strcpy (s_new, s);
strcat (s_new, delim);
}
else
{
s_new = s;
}
for (i = 0; pos != NULL; i++)
{
pos = strstr (s_new, delim);
if (pos)
{
s_new = pos + (1 * strlen (delim));
if (i == number - 1)
{
pos = '\0';
return s_new;
}
}
}
return NULL;
}
/* if ver1 < ver2 -> return -1
* if ver1 > ver2 -> return 1
* if ver1 == ver2 -> return 0
*/
int version_cmp (char *ver1, char *ver2)
{
char *ver1_token;
char *ver2_token;
char *ver1_ptr = malloc (strlen (ver1)+1);
char *ver2_ptr = malloc (strlen (ver2)+1);
ver1_token = strtok_r (ver1, ".", &ver1_ptr);
ver2_token = strtok_r (ver2, ".", &ver2_ptr);
while ((ver1_token != NULL) || (ver2_token != NULL))
{
int ver1_i;
int ver2_i;
if (ver1_token == NULL)
ver1_i = 0;
else
ver1_i = atoi (ver1_token);
if (ver2_token == NULL)
ver2_i = 0;
else
ver2_i = atoi (ver2_token);
if (ver1_i < ver2_i)
return -1;
else if (ver1_i > ver2_i)
return 1;
ver1_token = strtok_r (NULL, ".", &ver1_ptr);
ver2_token = strtok_r (NULL, ".", &ver2_ptr);
}
return 0;
}
/* returns a version number of a pkg-config package
* the return char* could be freed after use
*/
char *pkg_config_version (char *package)
{
gboolean spawn;
const int buf_len = 128;
gchar buf[buf_len];
gchar *argv_child[4];
gint stdout_child;
gint stderr_child;
int ret_val;
argv_child[0] = g_strdup ("pkg-config");
argv_child[1] = g_strdup ("--modversion");
argv_child[2] = package;
argv_child[3] = NULL;
spawn = g_spawn_async_with_pipes (NULL, argv_child, NULL,
G_SPAWN_SEARCH_PATH, NULL,
NULL, NULL, NULL,
&stdout_child, &stderr_child, NULL);
g_free (argv_child[0]);
g_free (argv_child[1]);
ret_val = read (stdout_child, buf, buf_len);
if (ret_val == 0)
return 0;
else
return strdup (buf);
}
/* returns a version number of a pkg-config package
* the return char* could be freed after use
*/
char *e16_version ()
{
gboolean spawn;
const int buf_len = 1024;
gchar buf[buf_len];
gchar *argv_child[4];
gint stdout_child;
gint stderr_child;
int ret_val;
gchar buf2[buf_len];
argv_child[0] = g_strdup ("eesh");
argv_child[1] = g_strdup ("-ewait");
argv_child[2] = g_strdup ("ver");;
argv_child[3] = NULL;
spawn = g_spawn_async_with_pipes (NULL, argv_child, NULL,
G_SPAWN_SEARCH_PATH, NULL,
NULL, NULL, NULL,
&stdout_child, &stderr_child, NULL);
g_free (argv_child[0]);
g_free (argv_child[1]);
ret_val = read (stdout_child, buf, buf_len);
sscanf (buf, "Enlightenment-Version: enlightenment-%s\n", buf2);
if (ret_val == 0)
return 0;
else
return strdup (buf2);
}
char *get_fallback_locale (char *locale)
{
char *locale_dup;
char *pos = NULL;
locale_dup = strdup (locale);
pos = strrchr (locale_dup, '@');
if (pos)
{
strcpy (pos, "\0");
}
else
{
pos = strrchr (locale_dup, '_');
if (pos)
{
strcpy (pos, "\0");
}
else
{
pos = locale_dup;
strcpy (pos, "C");
}
}
return locale_dup;
}
int run_help (char *help_app, char *help_dir, char *help_file)
{
gboolean spawn;
gchar *argv_child[3];
gchar *params;
char *locale = NULL;
gboolean locale_failed = FALSE;
char *locale_fallback = NULL;
char *locale_tmp;
gboolean help_missing = TRUE;
struct stat buf;
/* Is there a better way to get the users current language? */
locale = setlocale (LC_MESSAGES, NULL);
/* If no locale is available use 'C' and free it later */
if (!locale)
{
locale_failed = TRUE;
locale = g_strdup_printf ("C");
}
params = g_strdup_printf ("%s/%s/%s", help_dir,
locale, help_file);
#ifdef DEBUG
DEBUG_OUTPUT printf ("%s\n", params);
#endif /* DEBUG */
help_missing = stat (params, &buf);
/* locale fallback 1 */
if (help_missing)
{
locale_fallback = get_fallback_locale (locale);
g_free (params);
params = g_strdup_printf ("%s/%s/%s", help_dir,
locale_fallback, help_file);
#ifdef DEBUG
DEBUG_OUTPUT printf ("Try help fallback1: %s\n", params);
#endif /* DEBUG */
help_missing = stat (params, &buf);
/* locale fallback 2 */
if (help_missing)
{
locale_tmp = strdup (locale_fallback);
g_free (locale_fallback);
locale_fallback = get_fallback_locale (locale_tmp);
g_free (locale_tmp);
g_free (params);
params = g_strdup_printf ("%s/%s/%s", help_dir,
locale_fallback, help_file);
#ifdef DEBUG
DEBUG_OUTPUT printf ("Try help fallback2: %s\n", params);
#endif /* DEBUG */
help_missing = stat (params, &buf);
/* locale fallback 3 */
if (help_missing)
{
locale_tmp = strdup (locale_fallback);
g_free (locale_fallback);
locale_fallback = get_fallback_locale (locale_tmp);
g_free (locale_tmp);
g_free (params);
params = g_strdup_printf ("%s/%s/%s", help_dir,
locale_fallback, help_file);
g_free (locale_fallback);
#ifdef DEBUG
DEBUG_OUTPUT printf ("Try help fallback4: %s\n", params);
#endif /* DEBUG */
help_missing = stat (params, &buf);
}
else
{
g_free (locale_fallback);
}
}
}
if (help_missing)
{
/* no help files found */
return 1;
}
else
{
argv_child[0] = help_app;
argv_child[1] = params;
argv_child[2] = NULL;
#ifdef DEBUG
DEBUG_OUTPUT printf ("Try exec help: %s %s\n", help_app, params);
#endif /* DEBUG */
spawn = g_spawn_async (NULL, argv_child, NULL,
G_SPAWN_SEARCH_PATH, NULL,
NULL, NULL, NULL);
if (!spawn)
{
/* no help application found */
return 2;
}
g_free (params);
}
if (locale_failed)
g_free (locale);
return 0;
}

68
src/file.h Normal file
View File

@ -0,0 +1,68 @@
/* Copyright (C) 2004 Andreas Volz and various contributors
*
* Permission is hereby granted, free of charge, to any person ob-
* taining a copy of this software and associated documentation
* files (the "Software"), to deal in the Software without restric-
* tion, including without limitation the rights to use, copy, modi-
* fy, merge, publish, distribute, sublicense, and/or sell copies of
* the Software, and to permit persons to whom the Software is fur-
* nished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be
* included in all copies of the Software, its documentation and
* marketing & publicity materials, and acknowledgment shall be giv-
* en in the documentation, materials and software packages that
* this Software was used.
*
* 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 NONIN-
* FRINGEMENT. IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY
* CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CON-
* TRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
* WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*
* File: file.h
* Created by: Andreas Volz <linux@brachttal.net>
*
*/
#ifndef _FILE_H
#define _FILE_H
#ifdef HAVE_CONFIG_H
# include <config.h>
#endif
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
#include <string.h>
#include <ctype.h>
#include <pwd.h>
#include <sys/types.h>
#include <glib.h>
#include <sys/stat.h>
#include <sys/types.h>
#include <locale.h>
#include <langinfo.h>
#include "e16menuedit2.h"
#include "regex_func.h"
#define ERR_BUF_SIZE 1024
char *field (char *s, int field);
void fword (char *s, int num, char *wd);
char *homedir (int uid);
int mkdir_with_parent (const char *pathname, mode_t mode);
char *strtok_left (char *s, const char *delim, unsigned int number);
char *strsplit (char *s, char **right, int count);
int version_cmp (char *ver1, char *ver2);
char *pkg_config_version (char *package);
char *e16_version ();
char *get_fallback_locale (char *locale);
int run_help (char *help_app, char* help_dir, char *help_file);
void compile_regex ();
int menu_regex (char *line, gchar ***data_ptr);
#endif /* _FILE_H */

337
src/icon_chooser.c Normal file
View File

@ -0,0 +1,337 @@
/* Copyright (C) 2004 Andreas Volz and various contributors
*
* Permission is hereby granted, free of charge, to any person ob-
* taining a copy of this software and associated documentation
* files (the "Software"), to deal in the Software without restric-
* tion, including without limitation the rights to use, copy, modi-
* fy, merge, publish, distribute, sublicense, and/or sell copies of
* the Software, and to permit persons to whom the Software is fur-
* nished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be
* included in all copies of the Software, its documentation and
* marketing & publicity materials, and acknowledgment shall be giv-
* en in the documentation, materials and software packages that
* this Software was used.
*
* 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 NONIN-
* FRINGEMENT. IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY
* CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CON-
* TRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
* WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*
* File: icon_chooser.c
* Created by: Andreas Volz <linux@brachttal.net>
*
*/
#ifdef HAVE_CONFIG_H
# include <config.h>
#endif
#include "icon_chooser.h"
#include "e16menuedit2.h"
#include "callbacks.h"
#include "file.h"
#include "treeview.h"
extern struct global_variables gv;
void open_icon_chooser (GtkWidget *treeview_menu)
{
GtkWidget *main_window;
GtkWidget *dialog;
GtkWidget *filechooser;
GtkWidget *preview;
/*GtkWidget *treeview_menu;*/
GtkTreeModel *model;
GtkTreeSelection *select;
GdkPixbuf *icon_pixbuf;
GtkTreeIter iter;
GtkWidget *resize_combo;
GtkWidget *resize_hbox;
GtkWidget *dialog_vbox;
GtkWidget *resize_label;
GList *glist = NULL;
gint dialog_response;
main_window = gtk_widget_get_toplevel (GTK_WIDGET(treeview_menu));
/*treeview_menu = (GtkWidget*) user_data;*/
preview = gtk_image_new ();
filechooser = gtk_file_chooser_widget_new (GTK_FILE_CHOOSER_ACTION_OPEN);
gtk_widget_set_size_request (filechooser, 600, 400);
dialog = gtk_dialog_new ();
gtk_window_set_title (GTK_WINDOW (dialog), _("Select Icon..."));
dialog_vbox = GTK_DIALOG(dialog)->vbox;
gtk_dialog_add_button (GTK_DIALOG(dialog),
GTK_STOCK_CLEAR, GTK_RESPONSE_REJECT);
gtk_dialog_add_button (GTK_DIALOG(dialog),
GTK_STOCK_CANCEL, GTK_RESPONSE_CANCEL);
gtk_dialog_add_button (GTK_DIALOG(dialog),
GTK_STOCK_OPEN, GTK_RESPONSE_ACCEPT);
gtk_window_set_modal (GTK_WINDOW (dialog), TRUE);
gtk_window_resize (GTK_WINDOW (dialog), 700, 500);
gtk_dialog_set_has_separator (GTK_DIALOG(dialog), TRUE);
gtk_box_set_homogeneous (GTK_BOX (dialog_vbox), FALSE);
gtk_container_add (GTK_CONTAINER (dialog_vbox),
filechooser);
gtk_file_chooser_set_preview_widget (GTK_FILE_CHOOSER (filechooser),
preview);
gtk_file_chooser_set_current_folder (GTK_FILE_CHOOSER (filechooser),
"/usr/share/pixmaps");
gtk_file_chooser_set_preview_widget_active (GTK_FILE_CHOOSER (filechooser),
TRUE);
g_signal_connect (filechooser, "update-preview",
G_CALLBACK (update_preview_cb), preview);
/* combo box */
resize_hbox = gtk_hbox_new (FALSE, 0);
dialog_vbox = gtk_vbox_new (FALSE, 0);
gtk_container_add (GTK_CONTAINER (GTK_DIALOG(dialog)->vbox),
resize_hbox);
resize_combo = gtk_combo_new ();
resize_label = gtk_label_new (_("Icon size:"));
glist = g_list_append (glist, ICON_SIZE_AUTO_STRING);
glist = g_list_append (glist, ICON_SIZE1_STRING);
glist = g_list_append (glist, ICON_SIZE2_STRING);
glist = g_list_append (glist, ICON_SIZE3_STRING);
glist = g_list_append (glist, ICON_SIZE4_STRING);
glist = g_list_append (glist, ICON_SIZE5_STRING);
glist = g_list_append (glist, ICON_SIZE6_STRING);
glist = g_list_append (glist, ICON_SIZE7_STRING);
gtk_combo_set_popdown_strings (GTK_COMBO (resize_combo), glist);
gtk_entry_set_text (GTK_ENTRY (GTK_COMBO (resize_combo)->entry),
"auto (64x64 limit)");
gtk_box_pack_start (GTK_BOX (resize_hbox), resize_label, FALSE, FALSE, 0);
gtk_box_pack_start (GTK_BOX (resize_hbox), resize_combo, FALSE, FALSE, 0);
gtk_widget_show_all (dialog);
dialog_response = gtk_dialog_run (GTK_DIALOG (dialog));
switch (dialog_response)
{
/* select new icon */
case GTK_RESPONSE_ACCEPT:
{
gchar *filename;
filename = gtk_file_chooser_get_filename (GTK_FILE_CHOOSER (filechooser));
model = gtk_tree_view_get_model (GTK_TREE_VIEW (treeview_menu));
select = gtk_tree_view_get_selection (GTK_TREE_VIEW (treeview_menu));
if (gtk_tree_selection_get_selected (select, &model, &iter)
&& filename != NULL)
{
const gchar *entry_select;
gint width, height;
gint width_new, height_new;
gchar filename_resized[PATH_MAX];
gchar *right;
entry_select = gtk_entry_get_text (GTK_ENTRY (GTK_COMBO (
resize_combo)->entry));
/* check for broken librsvg function
* perhaps better handling next stable librsvg release
*/
right = g_malloc (3);
strsplit (filename, &right, g_utf8_strlen (filename, -1) - 3);
if ((strcmp (right, "svg")) || (gv.librsvg_cmp >= 0))
{
gdk_pixbuf_get_file_info (filename,
&width,
&height);
}
else
{
width = ICON_SIZE_AUTO+1;
height = ICON_SIZE_AUTO+1;
}
g_free (right);
if (width <= 0)
width = 1;
if (height <= 0)
height = 1;
if (!strcmp (entry_select, ICON_SIZE_AUTO_STRING))
{
if ((width > ICON_SIZE_AUTO) || (height > ICON_SIZE_AUTO))
{
width_new = ICON_SIZE_AUTO;
height_new = ICON_SIZE_AUTO;
}
else
{
width_new = width;
height_new = height;
}
}
else if (!strcmp (entry_select, ICON_SIZE1_STRING))
{
width_new = ICON_SIZE1;
height_new = ICON_SIZE1;
}
else if (!strcmp (entry_select, ICON_SIZE2_STRING))
{
width_new = ICON_SIZE2;
height_new = ICON_SIZE2;
}
else if (!strcmp (entry_select, ICON_SIZE3_STRING))
{
width_new = ICON_SIZE3;
height_new = ICON_SIZE3;
}
else if (!strcmp (entry_select, ICON_SIZE4_STRING))
{
width_new = ICON_SIZE4;
height_new = ICON_SIZE4;
}
else if (!strcmp (entry_select, ICON_SIZE5_STRING))
{
width_new = ICON_SIZE5;
height_new = ICON_SIZE5;
}
else if (!strcmp (entry_select, ICON_SIZE6_STRING))
{
width_new = ICON_SIZE6;
height_new = ICON_SIZE6;
}
else if (!strcmp (entry_select, ICON_SIZE7_STRING))
{
width_new = ICON_SIZE7;
height_new = ICON_SIZE7;
}
if ((width == width_new) && (height == height_new))
{
icon_pixbuf = gdk_pixbuf_new_from_file (filename, NULL);
}
else
{
icon_pixbuf = gdk_pixbuf_new_from_file_at_size (filename,
width_new,
height_new,
NULL);
sprintf (filename_resized, "%s/%s/%s/%s_%dx%d.png", homedir (getuid ()),
APP_HOME, ICON_DIR, g_path_get_basename (filename),
width_new, height_new);
g_free (filename);
filename = strdup (filename_resized);
/*printf ("%s\n", filename);*/
gdk_pixbuf_save (icon_pixbuf, filename, "png", NULL, NULL);
}
if (icon_pixbuf != NULL)
{
gtk_tree_store_set (GTK_TREE_STORE (model), &iter,
COL_ICON, icon_pixbuf,
COL_ICONNAME, filename,
-1);
}
}
g_free (filename);
break;
}
/* delete current icon */
case GTK_RESPONSE_REJECT:
{
model = gtk_tree_view_get_model (GTK_TREE_VIEW (treeview_menu));
select = gtk_tree_view_get_selection (GTK_TREE_VIEW (treeview_menu));
if (gtk_tree_selection_get_selected (select, &model, &iter))
{
gtk_tree_model_get (model, &iter,
COL_ICON, &icon_pixbuf,
-1);
if (icon_pixbuf != NULL)
{
g_object_unref (icon_pixbuf);
}
gtk_tree_store_set (GTK_TREE_STORE (model), &iter,
COL_ICON, NULL,
COL_ICONNAME, "",
-1);
}
break;
}
}
gtk_widget_destroy (dialog);
}
void update_preview_cb (GtkFileChooser *file_chooser, gpointer data)
{
GtkWidget *preview;
char *filename;
GdkPixbuf *pixbuf;
gboolean have_preview;
gint width, height;
preview = GTK_WIDGET (data);
filename = gtk_file_chooser_get_preview_filename (file_chooser);
if (filename != NULL)
{
gchar *right;
/* check for broken librsvg function
* perhaps better handling next stable librsvg release
*/
right = g_malloc (3);
strsplit (filename, &right, g_utf8_strlen (filename, -1) - 3);
if ((strcmp (right, "svg")) || (gv.librsvg_cmp >= 0))
{
gdk_pixbuf_get_file_info (filename, &width, &height);
}
else
{
width = ICON_SIZE_AUTO;
height = ICON_SIZE_AUTO;
}
g_free (right);
if ((width > ICON_SIZE_AUTO) || (height > ICON_SIZE_AUTO))
{
width = ICON_SIZE_AUTO;
height = ICON_SIZE_AUTO;
}
if (width <= 0)
width = 1;
if (height <= 0)
height = 1;
pixbuf = gdk_pixbuf_new_from_file_at_size (filename, width, height, NULL);
have_preview = (pixbuf != NULL);
g_free (filename);
gtk_image_set_from_pixbuf (GTK_IMAGE (preview), pixbuf);
if (pixbuf)
gdk_pixbuf_unref (pixbuf);
gtk_file_chooser_set_preview_widget_active (file_chooser, have_preview);
}
}

38
src/icon_chooser.h Normal file
View File

@ -0,0 +1,38 @@
/* Copyright (C) 2004 Andreas Volz and various contributors
*
* Permission is hereby granted, free of charge, to any person ob-
* taining a copy of this software and associated documentation
* files (the "Software"), to deal in the Software without restric-
* tion, including without limitation the rights to use, copy, modi-
* fy, merge, publish, distribute, sublicense, and/or sell copies of
* the Software, and to permit persons to whom the Software is fur-
* nished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be
* included in all copies of the Software, its documentation and
* marketing & publicity materials, and acknowledgment shall be giv-
* en in the documentation, materials and software packages that
* this Software was used.
*
* 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 NONIN-
* FRINGEMENT. IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY
* CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CON-
* TRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
* WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*
* File: icon_chooser.h
* Created by: Andreas Volz <linux@brachttal.net>
*
*/
#ifndef _ICON_CHOOSER_H
#define _ICON_CHOOSER_H
#include <gtk/gtk.h>
void open_icon_chooser (GtkWidget *treeview_menu);
void update_preview_cb (GtkFileChooser *file_chooser, gpointer data);
#endif /* _ICON_CHOOSER_H */

120
src/libglade_support.c Normal file
View File

@ -0,0 +1,120 @@
/* Copyright (C) 2004 Andreas Volz and various contributors
*
* Permission is hereby granted, free of charge, to any person ob-
* taining a copy of this software and associated documentation
* files (the "Software"), to deal in the Software without restric-
* tion, including without limitation the rights to use, copy, modi-
* fy, merge, publish, distribute, sublicense, and/or sell copies of
* the Software, and to permit persons to whom the Software is fur-
* nished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be
* included in all copies of the Software, its documentation and
* marketing & publicity materials, and acknowledgment shall be giv-
* en in the documentation, materials and software packages that
* this Software was used.
*
* 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 NONIN-
* FRINGEMENT. IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY
* CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CON-
* TRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
* WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*
* File: treeview.c
* Created by: Andreas Volz <linux@brachttal.net>
*
*/
#include <string.h>
#include "libglade_support.h"
static GHashTable *glade_hash;
void register_libglade_parent (GladeXML *glade_xml, const char *parent_name)
{
static gboolean init = FALSE;
if (!init)
{
glade_hash = g_hash_table_new_full (g_str_hash, g_str_equal,
g_free, NULL);
init = TRUE;
}
g_hash_table_replace (glade_hash,
strdup (parent_name),
glade_xml);
}
GtkWidget *lookup_libglade_widget (const char *parent_name,
const char *widget_name)
{
GladeXML *glade_xml;
GtkWidget *found_widget;
gpointer lookup;
lookup = g_hash_table_lookup (glade_hash,
parent_name);
glade_xml = (GladeXML *) lookup;
found_widget = glade_xml_get_widget (glade_xml, widget_name);
return found_widget;
}
char* searchGladeFile (char *glade_file)
{
gboolean glade_found;
struct stat buf;
gchar *glade_path;
glade_path = g_strdup_printf ("%s", glade_file);
glade_found = !(stat (glade_path, &buf));
if (!glade_found)
{
g_free (glade_path);
glade_path = g_strdup_printf ("%s/%s", "..", glade_file);
glade_found = !(stat (glade_path, &buf));
if (!glade_found)
{
g_free (glade_path);
glade_path = g_strdup_printf ("%s/%s/%s", PACKAGE_DATA_DIR, "glade",
glade_file);
}
}
return glade_path;
}
char* searchPixmapFile (char *pixmap_file)
{
gboolean pixmap_found;
struct stat buf;
gchar *pixmap_path;
pixmap_path = g_strdup_printf ("%s/%s", "pixmaps", pixmap_file);
pixmap_found = !(stat (pixmap_path, &buf));
if (!pixmap_found)
{
g_free (pixmap_path);
pixmap_path = g_strdup_printf ("%s/%s", "../pixmaps", pixmap_file);
pixmap_found = !(stat (pixmap_path, &buf));
if (!pixmap_found)
{
g_free (pixmap_path);
pixmap_path = g_strdup_printf ("%s/%s", SYSTEM_PIXMAPS_DIR, pixmap_file);
}
}
return pixmap_path;
}

47
src/libglade_support.h Normal file
View File

@ -0,0 +1,47 @@
/* Copyright (C) 2004 Andreas Volz and various contributors
*
* Permission is hereby granted, free of charge, to any person ob-
* taining a copy of this software and associated documentation
* files (the "Software"), to deal in the Software without restric-
* tion, including without limitation the rights to use, copy, modi-
* fy, merge, publish, distribute, sublicense, and/or sell copies of
* the Software, and to permit persons to whom the Software is fur-
* nished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be
* included in all copies of the Software, its documentation and
* marketing & publicity materials, and acknowledgment shall be giv-
* en in the documentation, materials and software packages that
* this Software was used.
*
* 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 NONIN-
* FRINGEMENT. IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY
* CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CON-
* TRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
* WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*
* File: treeview.h
* Created by: Andreas Volz <linux@brachttal.net>
*
*/
#ifndef _LIBGLADE_SUPPORT_H
#define _LIBGLADE_SUPPORT_H
#ifdef HAVE_CONFIG_H
#include <config.h>
#endif
#include <gtk/gtk.h>
#include <glade/glade.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <unistd.h>
void register_libglade_parent (GladeXML *glade_xml, const char *parent_name);
GtkWidget *lookup_libglade_widget (const char *parent_name, const char *widget_name);
char* searchGladeFile (char *glade_file);
char* searchPixmapFile (char *pixmap_file);
#endif /* _LIBGLADE_SUPPORT_H */

47
src/nls.h Normal file
View File

@ -0,0 +1,47 @@
/* Copyright (C) 2004 Andreas Volz and various contributors
*
* Permission is hereby granted, free of charge, to any person ob-
* taining a copy of this software and associated documentation
* files (the "Software"), to deal in the Software without restric-
* tion, including without limitation the rights to use, copy, modi-
* fy, merge, publish, distribute, sublicense, and/or sell copies of
* the Software, and to permit persons to whom the Software is fur-
* nished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be
* included in all copies of the Software, its documentation and
* marketing & publicity materials, and acknowledgment shall be giv-
* en in the documentation, materials and software packages that
* this Software was used.
*
* 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 NONIN-
* FRINGEMENT. IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY
* CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CON-
* TRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
* WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*
* File: nls.h
* Created by: Andreas Volz <linux@brachttal.net>
*
*/
#ifndef _NLS_H
#define _NLS_H
#ifdef ENABLE_NLS
#include <libintl.h>
#define _(String) gettext(String)
#define N_(String) (String)
#else /* don't support NLS */
#define _(String) (String)
#define N_(String) (String)
#endif
#endif /* _NLS_H */

157
src/regex_func.c Normal file
View File

@ -0,0 +1,157 @@
/* Copyright (C) 2004 Andreas Volz and various contributors
*
* Permission is hereby granted, free of charge, to any person ob-
* taining a copy of this software and associated documentation
* files (the "Software"), to deal in the Software without restric-
* tion, including without limitation the rights to use, copy, modi-
* fy, merge, publish, distribute, sublicense, and/or sell copies of
* the Software, and to permit persons to whom the Software is fur-
* nished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be
* included in all copies of the Software, its documentation and
* marketing & publicity materials, and acknowledgment shall be giv-
* en in the documentation, materials and software packages that
* this Software was used.
*
* 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 NONIN-
* FRINGEMENT. IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY
* CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CON-
* TRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
* WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*
* File: regex_func.c
* Created by: Andreas Volz <linux@brachttal.net>
*
*/
#include "regex_func.h"
/*
* Match string against the extended regular expression
* in pattern, treating errors as no match.
*
* return 0 for match, 1 for no match
*/
/* --> TODO: error handling regerror()! */
int regex_match (const char *string, char *pattern)
{
int status;
regex_t re;
status = regcomp (&re, pattern, REG_EXTENDED | REG_NOSUB);
if (status != 0)
{
return status;
}
status = regex_match2 (&re, string, pattern);
regfree (&re);
return status;
}
int regex_match2 (regex_t *re, const char *string, char *pattern)
{
int status;
status = regexec (re, string, (size_t) 0, NULL, 0);
return status;
}
int regex_sub (const char *string, char *pattern, struct substrings **ss_ptr,
int maxsub, int *numsub)
{
regex_t re;
int status;
char err_buf[1024];
status = regcomp (&re, pattern, REG_EXTENDED);
if (status != 0)
{
regerror (status, &re, err_buf, (size_t) 1024);
printf ("regex compile: %s\n", err_buf);
return status;
}
status = regex_sub2 (&re, string, pattern, ss_ptr, maxsub, numsub);
if (status != 0)
{
regerror (status, &re, err_buf, (size_t) 1024);
printf ("regex exec: %s\n", err_buf);
}
regfree (&re);
return status;
}
int regex_sub2 (regex_t *re, const char *string, char *pattern,
struct substrings **ss_ptr, int maxsub, int *numsub)
{
int status, i;
regmatch_t *submatch;
struct substrings *ss = NULL;
int string_len = strlen (string);
maxsub = maxsub + 1;
submatch = malloc (maxsub * sizeof (*submatch));
status = regexec (re, string, (size_t) maxsub, submatch, 0);
if (status == REG_NOMATCH)
{
free (submatch);
return status;
}
ss = malloc (maxsub * sizeof (*ss));
*ss_ptr = ss;
for (i = 0; i < maxsub ; i++)
{
if (submatch[i].rm_so == submatch[i].rm_eo && submatch[i].rm_eo == -1)
{
break;
}
ss[i].match = malloc (submatch[i].rm_eo - submatch[i].rm_so + 1);
strncpy (ss[i].match, string + submatch[i].rm_so,
submatch[i].rm_eo - submatch[i].rm_so);
if (ss[i].match[submatch[i].rm_eo - submatch[i].rm_so] != '\0')
{
ss[i].match[submatch[i].rm_eo - submatch[i].rm_so] = '\0';
}
ss[i].start = malloc (submatch[i].rm_so + 1);
strncpy (ss[i].start, string, submatch[i].rm_so);
if (ss[i].start[submatch[i].rm_so] != '\0')
{
ss[i].start[submatch[i].rm_so] = '\0';
}
ss[i].end = malloc (string_len - submatch[i].rm_eo + 1);
strncpy (ss[i].end, string + submatch[i].rm_eo,
string_len - submatch[i].rm_eo);
if (ss[i].end[string_len - submatch[i].rm_eo] != '\0')
{
ss[i].end[string_len - submatch[i].rm_eo] = '\0';
}
*numsub = i + 1;
}
free (submatch);
return status;
}

54
src/regex_func.h Normal file
View File

@ -0,0 +1,54 @@
/* Copyright (C) 2004 Andreas Volz and various contributors
*
* Permission is hereby granted, free of charge, to any person ob-
* taining a copy of this software and associated documentation
* files (the "Software"), to deal in the Software without restric-
* tion, including without limitation the rights to use, copy, modi-
* fy, merge, publish, distribute, sublicense, and/or sell copies of
* the Software, and to permit persons to whom the Software is fur-
* nished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be
* included in all copies of the Software, its documentation and
* marketing & publicity materials, and acknowledgment shall be giv-
* en in the documentation, materials and software packages that
* this Software was used.
*
* 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 NONIN-
* FRINGEMENT. IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY
* CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CON-
* TRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
* WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*
* File: regex_func.h
* Created by: Andreas Volz <linux@brachttal.net>
*
*/
#ifndef _REGEX_FUNC_H
#define _REGEX_FUNC_H
#include <stdlib.h>
#include <regex.h>
#include <stdio.h>
#include <string.h>
struct substrings
{
char *match;
char *start;
char *end;
};
int regex_match (const char *string, char *pattern);
int regex_match2 (regex_t *re, const char *string, char *pattern);
int regex_sub (const char *string, char *pattern, struct substrings **ss_ptr,
int maxsub, int *numsub);
int regex_sub2 (regex_t *re, const char *string, char *pattern,
struct substrings **ss_ptr, int maxsub, int *numsub);
#endif /* _REGEX_FUNC_H */

229
src/treeview.c Normal file
View File

@ -0,0 +1,229 @@
/* Copyright (C) 2004 Andreas Volz and various contributors
*
* Permission is hereby granted, free of charge, to any person ob-
* taining a copy of this software and associated documentation
* files (the "Software"), to deal in the Software without restric-
* tion, including without limitation the rights to use, copy, modi-
* fy, merge, publish, distribute, sublicense, and/or sell copies of
* the Software, and to permit persons to whom the Software is fur-
* nished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be
* included in all copies of the Software, its documentation and
* marketing & publicity materials, and acknowledgment shall be giv-
* en in the documentation, materials and software packages that
* this Software was used.
*
* 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 NONIN-
* FRINGEMENT. IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY
* CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CON-
* TRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
* WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*
* File: treeview.c
* Created by: Andreas Volz <linux@brachttal.net>
*
*/
#include <string.h>
#include "treeview.h"
#include "e16menu.h"
#include "callbacks.h"
#include "nls.h"
#include "e16menuedit2.h"
extern struct global_variables gv;
static GtkTargetEntry row_targets[] =
{
{ "GTK_TREE_MODEL_ROW", GTK_TARGET_SAME_APP,
TARGET_GTK_TREE_MODEL_ROW }
};
void create_tree_model (GtkWidget *treeview_menu)
{
GtkCellRenderer *renderer_desc, *renderer_icon;
GtkCellRenderer *renderer_iconname, *renderer_params;
GtkTreeViewColumn *iconname_column, *icon_column;
GtkTreeModel *model;
renderer_desc = gtk_cell_renderer_text_new ();
g_object_set (renderer_desc, "editable", TRUE, NULL);
gtk_tree_view_insert_column_with_attributes (
GTK_TREE_VIEW (treeview_menu),
-1,
_("Description"),
renderer_desc,
"text", COL_DESCRIPTION,
NULL);
renderer_icon = gtk_cell_renderer_pixbuf_new ();
icon_column = gtk_tree_view_column_new_with_attributes (
_("Icon"),
renderer_icon,
"pixbuf", COL_ICON,
NULL);
gtk_tree_view_insert_column (GTK_TREE_VIEW (treeview_menu),
icon_column, -1);
renderer_iconname = gtk_cell_renderer_text_new ();
iconname_column = gtk_tree_view_column_new_with_attributes (
"Icon Name",
renderer_iconname,
"text", COL_ICONNAME,
NULL);
g_object_set (iconname_column, "visible", FALSE, NULL);
gtk_tree_view_insert_column (GTK_TREE_VIEW (treeview_menu),
iconname_column, -1);
renderer_params = gtk_cell_renderer_text_new ();
g_object_set (renderer_params, "editable", TRUE, NULL);
gtk_tree_view_insert_column_with_attributes (GTK_TREE_VIEW (treeview_menu),
-1,
_("Parameters"),
renderer_params,
"text", COL_PARAMS,
NULL);
model = load_menus_from_disk ();
/* connect signals to edit cell */
g_signal_connect (renderer_desc, "edited",
G_CALLBACK (on_descrenderer_edited), model);
g_signal_connect (renderer_params, "edited",
G_CALLBACK (on_paramsrenderer_edited), model);
//g_signal_connect (icon_column, "clicked",
// G_CALLBACK (on_iconcolumn_clicked), model);
gtk_tree_view_set_model (GTK_TREE_VIEW (treeview_menu), model);
gtk_tree_view_expand_to_path (GTK_TREE_VIEW (treeview_menu),
gtk_tree_path_new_from_string ("0"));
activate_dragndrop (GTK_TREE_VIEW (treeview_menu));
g_object_unref (model); /* destroy model automatically with view */
return;
}
void deactivate_dragndrop (GtkTreeView *treeview_menu)
{
gtk_tree_view_unset_rows_drag_source (GTK_TREE_VIEW (treeview_menu));
gtk_tree_view_unset_rows_drag_dest (GTK_TREE_VIEW (treeview_menu));
}
void activate_dragndrop (GtkTreeView *treeview_menu)
{
gtk_tree_view_enable_model_drag_source (GTK_TREE_VIEW (treeview_menu),
GDK_BUTTON1_MASK,
row_targets,
G_N_ELEMENTS (row_targets),
GDK_ACTION_MOVE | GDK_ACTION_COPY);
gtk_tree_view_enable_model_drag_dest (GTK_TREE_VIEW (treeview_menu),
row_targets,
G_N_ELEMENTS (row_targets),
GDK_ACTION_MOVE | GDK_ACTION_COPY);
}
void new_table_row (GtkWidget *treeview_menu)
{
GtkTreeModel *model;
GtkTreeSelection *select;
GtkTreeIter sibling;
GtkTreeIter new_iter;
GtkTreeIter root_iter;
gchar *empty_desc, *empty_icon;
gchar *tree_string;
model = gtk_tree_view_get_model (GTK_TREE_VIEW (treeview_menu));
select = gtk_tree_view_get_selection (GTK_TREE_VIEW (treeview_menu));
if (gtk_tree_selection_get_selected (select, &model, &sibling))
{
empty_desc = g_strdup (_("New Entry"));
empty_icon = g_strdup ("");
tree_string = gtk_tree_model_get_string_from_iter (
GTK_TREE_MODEL(model), &sibling);
if (!strcmp (tree_string, "0"))
{
gtk_tree_model_get_iter_first (GTK_TREE_MODEL(model), &root_iter);
gtk_tree_store_append (GTK_TREE_STORE (model), &new_iter, &root_iter);
}
else
{
gtk_tree_store_insert_after (GTK_TREE_STORE (model),
&new_iter,
NULL,
&sibling);
}
gtk_tree_store_set (GTK_TREE_STORE (model), &new_iter,
COL_DESCRIPTION, empty_desc,
COL_ICONNAME, empty_icon,
-1);
g_free (empty_desc);
g_free (empty_icon);
}
}
void delete_table_row (GtkWidget *treeview_menu)
{
GtkTreeIter iter;
GtkTreeModel *model;
GtkTreeSelection *select;
model = gtk_tree_view_get_model (GTK_TREE_VIEW (treeview_menu));
select = gtk_tree_view_get_selection (GTK_TREE_VIEW (treeview_menu));
if (gtk_tree_selection_get_selected (select, &model, &iter))
{
gtk_tree_store_remove (GTK_TREE_STORE (model), &iter);
}
}
void save_table_to_menu (GtkWidget *treeview_menu)
{
GtkTreeModel *model;
int i = 0;
model = gtk_tree_view_get_model (GTK_TREE_VIEW (treeview_menu));
gtk_tree_model_foreach (GTK_TREE_MODEL(model), table_check_func, NULL);
if (gv.app_errno == AE_NO_ERROR)
{
gtk_tree_model_foreach (GTK_TREE_MODEL(model), table_save_func, NULL);
print_statusbar (_("Menu saved!"));
/* free allocated menu files */
while (menu_file[i] != NULL)
{
g_free (menu_file[i]);
i++;
}
}
else
{
if (gv.app_errno == AE_EMPTY_SUBMENU)
{
gtk_tree_view_set_cursor (GTK_TREE_VIEW (treeview_menu),
gtk_tree_path_new_from_string (gv.app_errno_str),
gtk_tree_view_get_column (
GTK_TREE_VIEW (treeview_menu),
COL_PARAMS),
TRUE);
print_statusbar (_("Submenu must have a name! -> menu not saved!"));
}
else
{
print_statusbar (_("Unknown error occurred while checking menu -> menu not saved!"));
}
}
}

59
src/treeview.h Normal file
View File

@ -0,0 +1,59 @@
/* Copyright (C) 2004 Andreas Volz and various contributors
*
* Permission is hereby granted, free of charge, to any person ob-
* taining a copy of this software and associated documentation
* files (the "Software"), to deal in the Software without restric-
* tion, including without limitation the rights to use, copy, modi-
* fy, merge, publish, distribute, sublicense, and/or sell copies of
* the Software, and to permit persons to whom the Software is fur-
* nished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be
* included in all copies of the Software, its documentation and
* marketing & publicity materials, and acknowledgment shall be giv-
* en in the documentation, materials and software packages that
* this Software was used.
*
* 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 NONIN-
* FRINGEMENT. IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY
* CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CON-
* TRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
* WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*
* File: treeview.h
* Created by: Andreas Volz <linux@brachttal.net>
*
*/
#ifndef _TREEVIEW_H
#define _TREEVIEW_H
#include <gtk/gtk.h>
#ifdef HAVE_CONFIG_H
#include <config.h>
#endif
void create_tree_model (GtkWidget *treeview_menu);
void new_table_row (GtkWidget *treeview_menu);
void delete_table_row (GtkWidget *treeview_menu);
void save_table_to_menu (GtkWidget *treeview_menu);
void activate_dragndrop (GtkTreeView *treeview_menu);
void deactivate_dragndrop (GtkTreeView *treeview_menu);
enum tree_columns
{
COL_DESCRIPTION,
COL_ICON,
COL_ICONNAME,
COL_PARAMS,
TREE_COLUMNS_SIZE
};
enum
{
TARGET_GTK_TREE_MODEL_ROW
};
#endif /* _TREEVIEW_H */

104
xmldocs.make Normal file
View File

@ -0,0 +1,104 @@
#
# 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)-${VERSION}/$(lang)
# ********** You should not have to edit below this line **********
xml_files = $(entities) $(docname).xml
EXTRA_DIST = $(xml_files) $(omffile) e16menuedit2.html
CLEANFILES = omf_timestamp
include $(top_srcdir)/omf.make
all: omf
$(docname).xml: $(entities)
if SK
-ourdir=`pwd`; \
cd $(srcdir); \
cp $(entities) $$ourdir
endif
app-dist-hook:
if SK
if test "$(figdir)"; then \
$(mkinstalldirs) $(DESTDIR)$(distdir)/$(figdir); \
for file in $(srcdir)/$(figdir)/*.png; do \
basefile=`echo $$file | sed -e 's,^.*/,,'`; \
$(INSTALL_DATA) $$file $(DESTDIR)$(distdir)/$(figdir)/$$basefile; \
done \
fi
endif
install-data-local: omf
if SK
$(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
endif
install-data-hook: install-data-hook-omf
uninstall-local: uninstall-local-doc uninstall-local-omf
uninstall-local-doc:
if SK
-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)
endif
clean-local: clean-local-omf