tabble-0.45/ 0000755 0001750 0001750 00000000000 13726332614 007703 5 0000000 0000000 tabble-0.45/depcomp 0000755 0001750 0001750 00000056016 13042165456 011207 0000000 0000000 #! /bin/sh
# depcomp - compile a program generating dependencies as side-effects
scriptversion=2013-05-30.07; # UTC
# Copyright (C) 1999-2014 Free Software Foundation, Inc.
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2, or (at your option)
# any later version.
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
# You should have received a copy of the GNU General Public License
# along with this program. If not, see .
# As a special exception to the GNU General Public License, if you
# distribute this file as part of a program that contains a
# configuration script generated by Autoconf, you may include it under
# the same distribution terms that you use for the rest of that program.
# Originally written by Alexandre Oliva .
case $1 in
'')
echo "$0: No command. Try '$0 --help' for more information." 1>&2
exit 1;
;;
-h | --h*)
cat <<\EOF
Usage: depcomp [--help] [--version] PROGRAM [ARGS]
Run PROGRAMS ARGS to compile a file, generating dependencies
as side-effects.
Environment variables:
depmode Dependency tracking mode.
source Source file read by 'PROGRAMS ARGS'.
object Object file output by 'PROGRAMS ARGS'.
DEPDIR directory where to store dependencies.
depfile Dependency file to output.
tmpdepfile Temporary file to use when outputting dependencies.
libtool Whether libtool is used (yes/no).
Report bugs to .
EOF
exit $?
;;
-v | --v*)
echo "depcomp $scriptversion"
exit $?
;;
esac
# Get the directory component of the given path, and save it in the
# global variables '$dir'. Note that this directory component will
# be either empty or ending with a '/' character. This is deliberate.
set_dir_from ()
{
case $1 in
*/*) dir=`echo "$1" | sed -e 's|/[^/]*$|/|'`;;
*) dir=;;
esac
}
# Get the suffix-stripped basename of the given path, and save it the
# global variable '$base'.
set_base_from ()
{
base=`echo "$1" | sed -e 's|^.*/||' -e 's/\.[^.]*$//'`
}
# If no dependency file was actually created by the compiler invocation,
# we still have to create a dummy depfile, to avoid errors with the
# Makefile "include basename.Plo" scheme.
make_dummy_depfile ()
{
echo "#dummy" > "$depfile"
}
# Factor out some common post-processing of the generated depfile.
# Requires the auxiliary global variable '$tmpdepfile' to be set.
aix_post_process_depfile ()
{
# If the compiler actually managed to produce a dependency file,
# post-process it.
if test -f "$tmpdepfile"; then
# Each line is of the form 'foo.o: dependency.h'.
# Do two passes, one to just change these to
# $object: dependency.h
# and one to simply output
# dependency.h:
# which is needed to avoid the deleted-header problem.
{ sed -e "s,^.*\.[$lower]*:,$object:," < "$tmpdepfile"
sed -e "s,^.*\.[$lower]*:[$tab ]*,," -e 's,$,:,' < "$tmpdepfile"
} > "$depfile"
rm -f "$tmpdepfile"
else
make_dummy_depfile
fi
}
# A tabulation character.
tab=' '
# A newline character.
nl='
'
# Character ranges might be problematic outside the C locale.
# These definitions help.
upper=ABCDEFGHIJKLMNOPQRSTUVWXYZ
lower=abcdefghijklmnopqrstuvwxyz
digits=0123456789
alpha=${upper}${lower}
if test -z "$depmode" || test -z "$source" || test -z "$object"; then
echo "depcomp: Variables source, object and depmode must be set" 1>&2
exit 1
fi
# Dependencies for sub/bar.o or sub/bar.obj go into sub/.deps/bar.Po.
depfile=${depfile-`echo "$object" |
sed 's|[^\\/]*$|'${DEPDIR-.deps}'/&|;s|\.\([^.]*\)$|.P\1|;s|Pobj$|Po|'`}
tmpdepfile=${tmpdepfile-`echo "$depfile" | sed 's/\.\([^.]*\)$/.T\1/'`}
rm -f "$tmpdepfile"
# Avoid interferences from the environment.
gccflag= dashmflag=
# Some modes work just like other modes, but use different flags. We
# parameterize here, but still list the modes in the big case below,
# to make depend.m4 easier to write. Note that we *cannot* use a case
# here, because this file can only contain one case statement.
if test "$depmode" = hp; then
# HP compiler uses -M and no extra arg.
gccflag=-M
depmode=gcc
fi
if test "$depmode" = dashXmstdout; then
# This is just like dashmstdout with a different argument.
dashmflag=-xM
depmode=dashmstdout
fi
cygpath_u="cygpath -u -f -"
if test "$depmode" = msvcmsys; then
# This is just like msvisualcpp but w/o cygpath translation.
# Just convert the backslash-escaped backslashes to single forward
# slashes to satisfy depend.m4
cygpath_u='sed s,\\\\,/,g'
depmode=msvisualcpp
fi
if test "$depmode" = msvc7msys; then
# This is just like msvc7 but w/o cygpath translation.
# Just convert the backslash-escaped backslashes to single forward
# slashes to satisfy depend.m4
cygpath_u='sed s,\\\\,/,g'
depmode=msvc7
fi
if test "$depmode" = xlc; then
# IBM C/C++ Compilers xlc/xlC can output gcc-like dependency information.
gccflag=-qmakedep=gcc,-MF
depmode=gcc
fi
case "$depmode" in
gcc3)
## gcc 3 implements dependency tracking that does exactly what
## we want. Yay! Note: for some reason libtool 1.4 doesn't like
## it if -MD -MP comes after the -MF stuff. Hmm.
## Unfortunately, FreeBSD c89 acceptance of flags depends upon
## the command line argument order; so add the flags where they
## appear in depend2.am. Note that the slowdown incurred here
## affects only configure: in makefiles, %FASTDEP% shortcuts this.
for arg
do
case $arg in
-c) set fnord "$@" -MT "$object" -MD -MP -MF "$tmpdepfile" "$arg" ;;
*) set fnord "$@" "$arg" ;;
esac
shift # fnord
shift # $arg
done
"$@"
stat=$?
if test $stat -ne 0; then
rm -f "$tmpdepfile"
exit $stat
fi
mv "$tmpdepfile" "$depfile"
;;
gcc)
## Note that this doesn't just cater to obsosete pre-3.x GCC compilers.
## but also to in-use compilers like IMB xlc/xlC and the HP C compiler.
## (see the conditional assignment to $gccflag above).
## There are various ways to get dependency output from gcc. Here's
## why we pick this rather obscure method:
## - Don't want to use -MD because we'd like the dependencies to end
## up in a subdir. Having to rename by hand is ugly.
## (We might end up doing this anyway to support other compilers.)
## - The DEPENDENCIES_OUTPUT environment variable makes gcc act like
## -MM, not -M (despite what the docs say). Also, it might not be
## supported by the other compilers which use the 'gcc' depmode.
## - Using -M directly means running the compiler twice (even worse
## than renaming).
if test -z "$gccflag"; then
gccflag=-MD,
fi
"$@" -Wp,"$gccflag$tmpdepfile"
stat=$?
if test $stat -ne 0; then
rm -f "$tmpdepfile"
exit $stat
fi
rm -f "$depfile"
echo "$object : \\" > "$depfile"
# The second -e expression handles DOS-style file names with drive
# letters.
sed -e 's/^[^:]*: / /' \
-e 's/^['$alpha']:\/[^:]*: / /' < "$tmpdepfile" >> "$depfile"
## This next piece of magic avoids the "deleted header file" problem.
## The problem is that when a header file which appears in a .P file
## is deleted, the dependency causes make to die (because there is
## typically no way to rebuild the header). We avoid this by adding
## dummy dependencies for each header file. Too bad gcc doesn't do
## this for us directly.
## Some versions of gcc put a space before the ':'. On the theory
## that the space means something, we add a space to the output as
## well. hp depmode also adds that space, but also prefixes the VPATH
## to the object. Take care to not repeat it in the output.
## Some versions of the HPUX 10.20 sed can't process this invocation
## correctly. Breaking it into two sed invocations is a workaround.
tr ' ' "$nl" < "$tmpdepfile" \
| sed -e 's/^\\$//' -e '/^$/d' -e "s|.*$object$||" -e '/:$/d' \
| sed -e 's/$/ :/' >> "$depfile"
rm -f "$tmpdepfile"
;;
hp)
# This case exists only to let depend.m4 do its work. It works by
# looking at the text of this script. This case will never be run,
# since it is checked for above.
exit 1
;;
sgi)
if test "$libtool" = yes; then
"$@" "-Wp,-MDupdate,$tmpdepfile"
else
"$@" -MDupdate "$tmpdepfile"
fi
stat=$?
if test $stat -ne 0; then
rm -f "$tmpdepfile"
exit $stat
fi
rm -f "$depfile"
if test -f "$tmpdepfile"; then # yes, the sourcefile depend on other files
echo "$object : \\" > "$depfile"
# Clip off the initial element (the dependent). Don't try to be
# clever and replace this with sed code, as IRIX sed won't handle
# lines with more than a fixed number of characters (4096 in
# IRIX 6.2 sed, 8192 in IRIX 6.5). We also remove comment lines;
# the IRIX cc adds comments like '#:fec' to the end of the
# dependency line.
tr ' ' "$nl" < "$tmpdepfile" \
| sed -e 's/^.*\.o://' -e 's/#.*$//' -e '/^$/ d' \
| tr "$nl" ' ' >> "$depfile"
echo >> "$depfile"
# The second pass generates a dummy entry for each header file.
tr ' ' "$nl" < "$tmpdepfile" \
| sed -e 's/^.*\.o://' -e 's/#.*$//' -e '/^$/ d' -e 's/$/:/' \
>> "$depfile"
else
make_dummy_depfile
fi
rm -f "$tmpdepfile"
;;
xlc)
# This case exists only to let depend.m4 do its work. It works by
# looking at the text of this script. This case will never be run,
# since it is checked for above.
exit 1
;;
aix)
# The C for AIX Compiler uses -M and outputs the dependencies
# in a .u file. In older versions, this file always lives in the
# current directory. Also, the AIX compiler puts '$object:' at the
# start of each line; $object doesn't have directory information.
# Version 6 uses the directory in both cases.
set_dir_from "$object"
set_base_from "$object"
if test "$libtool" = yes; then
tmpdepfile1=$dir$base.u
tmpdepfile2=$base.u
tmpdepfile3=$dir.libs/$base.u
"$@" -Wc,-M
else
tmpdepfile1=$dir$base.u
tmpdepfile2=$dir$base.u
tmpdepfile3=$dir$base.u
"$@" -M
fi
stat=$?
if test $stat -ne 0; then
rm -f "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3"
exit $stat
fi
for tmpdepfile in "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3"
do
test -f "$tmpdepfile" && break
done
aix_post_process_depfile
;;
tcc)
# tcc (Tiny C Compiler) understand '-MD -MF file' since version 0.9.26
# FIXME: That version still under development at the moment of writing.
# Make that this statement remains true also for stable, released
# versions.
# It will wrap lines (doesn't matter whether long or short) with a
# trailing '\', as in:
#
# foo.o : \
# foo.c \
# foo.h \
#
# It will put a trailing '\' even on the last line, and will use leading
# spaces rather than leading tabs (at least since its commit 0394caf7
# "Emit spaces for -MD").
"$@" -MD -MF "$tmpdepfile"
stat=$?
if test $stat -ne 0; then
rm -f "$tmpdepfile"
exit $stat
fi
rm -f "$depfile"
# Each non-empty line is of the form 'foo.o : \' or ' dep.h \'.
# We have to change lines of the first kind to '$object: \'.
sed -e "s|.*:|$object :|" < "$tmpdepfile" > "$depfile"
# And for each line of the second kind, we have to emit a 'dep.h:'
# dummy dependency, to avoid the deleted-header problem.
sed -n -e 's|^ *\(.*\) *\\$|\1:|p' < "$tmpdepfile" >> "$depfile"
rm -f "$tmpdepfile"
;;
## The order of this option in the case statement is important, since the
## shell code in configure will try each of these formats in the order
## listed in this file. A plain '-MD' option would be understood by many
## compilers, so we must ensure this comes after the gcc and icc options.
pgcc)
# Portland's C compiler understands '-MD'.
# Will always output deps to 'file.d' where file is the root name of the
# source file under compilation, even if file resides in a subdirectory.
# The object file name does not affect the name of the '.d' file.
# pgcc 10.2 will output
# foo.o: sub/foo.c sub/foo.h
# and will wrap long lines using '\' :
# foo.o: sub/foo.c ... \
# sub/foo.h ... \
# ...
set_dir_from "$object"
# Use the source, not the object, to determine the base name, since
# that's sadly what pgcc will do too.
set_base_from "$source"
tmpdepfile=$base.d
# For projects that build the same source file twice into different object
# files, the pgcc approach of using the *source* file root name can cause
# problems in parallel builds. Use a locking strategy to avoid stomping on
# the same $tmpdepfile.
lockdir=$base.d-lock
trap "
echo '$0: caught signal, cleaning up...' >&2
rmdir '$lockdir'
exit 1
" 1 2 13 15
numtries=100
i=$numtries
while test $i -gt 0; do
# mkdir is a portable test-and-set.
if mkdir "$lockdir" 2>/dev/null; then
# This process acquired the lock.
"$@" -MD
stat=$?
# Release the lock.
rmdir "$lockdir"
break
else
# If the lock is being held by a different process, wait
# until the winning process is done or we timeout.
while test -d "$lockdir" && test $i -gt 0; do
sleep 1
i=`expr $i - 1`
done
fi
i=`expr $i - 1`
done
trap - 1 2 13 15
if test $i -le 0; then
echo "$0: failed to acquire lock after $numtries attempts" >&2
echo "$0: check lockdir '$lockdir'" >&2
exit 1
fi
if test $stat -ne 0; then
rm -f "$tmpdepfile"
exit $stat
fi
rm -f "$depfile"
# Each line is of the form `foo.o: dependent.h',
# or `foo.o: dep1.h dep2.h \', or ` dep3.h dep4.h \'.
# Do two passes, one to just change these to
# `$object: dependent.h' and one to simply `dependent.h:'.
sed "s,^[^:]*:,$object :," < "$tmpdepfile" > "$depfile"
# Some versions of the HPUX 10.20 sed can't process this invocation
# correctly. Breaking it into two sed invocations is a workaround.
sed 's,^[^:]*: \(.*\)$,\1,;s/^\\$//;/^$/d;/:$/d' < "$tmpdepfile" \
| sed -e 's/$/ :/' >> "$depfile"
rm -f "$tmpdepfile"
;;
hp2)
# The "hp" stanza above does not work with aCC (C++) and HP's ia64
# compilers, which have integrated preprocessors. The correct option
# to use with these is +Maked; it writes dependencies to a file named
# 'foo.d', which lands next to the object file, wherever that
# happens to be.
# Much of this is similar to the tru64 case; see comments there.
set_dir_from "$object"
set_base_from "$object"
if test "$libtool" = yes; then
tmpdepfile1=$dir$base.d
tmpdepfile2=$dir.libs/$base.d
"$@" -Wc,+Maked
else
tmpdepfile1=$dir$base.d
tmpdepfile2=$dir$base.d
"$@" +Maked
fi
stat=$?
if test $stat -ne 0; then
rm -f "$tmpdepfile1" "$tmpdepfile2"
exit $stat
fi
for tmpdepfile in "$tmpdepfile1" "$tmpdepfile2"
do
test -f "$tmpdepfile" && break
done
if test -f "$tmpdepfile"; then
sed -e "s,^.*\.[$lower]*:,$object:," "$tmpdepfile" > "$depfile"
# Add 'dependent.h:' lines.
sed -ne '2,${
s/^ *//
s/ \\*$//
s/$/:/
p
}' "$tmpdepfile" >> "$depfile"
else
make_dummy_depfile
fi
rm -f "$tmpdepfile" "$tmpdepfile2"
;;
tru64)
# The Tru64 compiler uses -MD to generate dependencies as a side
# effect. 'cc -MD -o foo.o ...' puts the dependencies into 'foo.o.d'.
# At least on Alpha/Redhat 6.1, Compaq CCC V6.2-504 seems to put
# dependencies in 'foo.d' instead, so we check for that too.
# Subdirectories are respected.
set_dir_from "$object"
set_base_from "$object"
if test "$libtool" = yes; then
# Libtool generates 2 separate objects for the 2 libraries. These
# two compilations output dependencies in $dir.libs/$base.o.d and
# in $dir$base.o.d. We have to check for both files, because
# one of the two compilations can be disabled. We should prefer
# $dir$base.o.d over $dir.libs/$base.o.d because the latter is
# automatically cleaned when .libs/ is deleted, while ignoring
# the former would cause a distcleancheck panic.
tmpdepfile1=$dir$base.o.d # libtool 1.5
tmpdepfile2=$dir.libs/$base.o.d # Likewise.
tmpdepfile3=$dir.libs/$base.d # Compaq CCC V6.2-504
"$@" -Wc,-MD
else
tmpdepfile1=$dir$base.d
tmpdepfile2=$dir$base.d
tmpdepfile3=$dir$base.d
"$@" -MD
fi
stat=$?
if test $stat -ne 0; then
rm -f "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3"
exit $stat
fi
for tmpdepfile in "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3"
do
test -f "$tmpdepfile" && break
done
# Same post-processing that is required for AIX mode.
aix_post_process_depfile
;;
msvc7)
if test "$libtool" = yes; then
showIncludes=-Wc,-showIncludes
else
showIncludes=-showIncludes
fi
"$@" $showIncludes > "$tmpdepfile"
stat=$?
grep -v '^Note: including file: ' "$tmpdepfile"
if test $stat -ne 0; then
rm -f "$tmpdepfile"
exit $stat
fi
rm -f "$depfile"
echo "$object : \\" > "$depfile"
# The first sed program below extracts the file names and escapes
# backslashes for cygpath. The second sed program outputs the file
# name when reading, but also accumulates all include files in the
# hold buffer in order to output them again at the end. This only
# works with sed implementations that can handle large buffers.
sed < "$tmpdepfile" -n '
/^Note: including file: *\(.*\)/ {
s//\1/
s/\\/\\\\/g
p
}' | $cygpath_u | sort -u | sed -n '
s/ /\\ /g
s/\(.*\)/'"$tab"'\1 \\/p
s/.\(.*\) \\/\1:/
H
$ {
s/.*/'"$tab"'/
G
p
}' >> "$depfile"
echo >> "$depfile" # make sure the fragment doesn't end with a backslash
rm -f "$tmpdepfile"
;;
msvc7msys)
# This case exists only to let depend.m4 do its work. It works by
# looking at the text of this script. This case will never be run,
# since it is checked for above.
exit 1
;;
#nosideeffect)
# This comment above is used by automake to tell side-effect
# dependency tracking mechanisms from slower ones.
dashmstdout)
# Important note: in order to support this mode, a compiler *must*
# always write the preprocessed file to stdout, regardless of -o.
"$@" || exit $?
# Remove the call to Libtool.
if test "$libtool" = yes; then
while test "X$1" != 'X--mode=compile'; do
shift
done
shift
fi
# Remove '-o $object'.
IFS=" "
for arg
do
case $arg in
-o)
shift
;;
$object)
shift
;;
*)
set fnord "$@" "$arg"
shift # fnord
shift # $arg
;;
esac
done
test -z "$dashmflag" && dashmflag=-M
# Require at least two characters before searching for ':'
# in the target name. This is to cope with DOS-style filenames:
# a dependency such as 'c:/foo/bar' could be seen as target 'c' otherwise.
"$@" $dashmflag |
sed "s|^[$tab ]*[^:$tab ][^:][^:]*:[$tab ]*|$object: |" > "$tmpdepfile"
rm -f "$depfile"
cat < "$tmpdepfile" > "$depfile"
# Some versions of the HPUX 10.20 sed can't process this sed invocation
# correctly. Breaking it into two sed invocations is a workaround.
tr ' ' "$nl" < "$tmpdepfile" \
| sed -e 's/^\\$//' -e '/^$/d' -e '/:$/d' \
| sed -e 's/$/ :/' >> "$depfile"
rm -f "$tmpdepfile"
;;
dashXmstdout)
# This case only exists to satisfy depend.m4. It is never actually
# run, as this mode is specially recognized in the preamble.
exit 1
;;
makedepend)
"$@" || exit $?
# Remove any Libtool call
if test "$libtool" = yes; then
while test "X$1" != 'X--mode=compile'; do
shift
done
shift
fi
# X makedepend
shift
cleared=no eat=no
for arg
do
case $cleared in
no)
set ""; shift
cleared=yes ;;
esac
if test $eat = yes; then
eat=no
continue
fi
case "$arg" in
-D*|-I*)
set fnord "$@" "$arg"; shift ;;
# Strip any option that makedepend may not understand. Remove
# the object too, otherwise makedepend will parse it as a source file.
-arch)
eat=yes ;;
-*|$object)
;;
*)
set fnord "$@" "$arg"; shift ;;
esac
done
obj_suffix=`echo "$object" | sed 's/^.*\././'`
touch "$tmpdepfile"
${MAKEDEPEND-makedepend} -o"$obj_suffix" -f"$tmpdepfile" "$@"
rm -f "$depfile"
# makedepend may prepend the VPATH from the source file name to the object.
# No need to regex-escape $object, excess matching of '.' is harmless.
sed "s|^.*\($object *:\)|\1|" "$tmpdepfile" > "$depfile"
# Some versions of the HPUX 10.20 sed can't process the last invocation
# correctly. Breaking it into two sed invocations is a workaround.
sed '1,2d' "$tmpdepfile" \
| tr ' ' "$nl" \
| sed -e 's/^\\$//' -e '/^$/d' -e '/:$/d' \
| sed -e 's/$/ :/' >> "$depfile"
rm -f "$tmpdepfile" "$tmpdepfile".bak
;;
cpp)
# Important note: in order to support this mode, a compiler *must*
# always write the preprocessed file to stdout.
"$@" || exit $?
# Remove the call to Libtool.
if test "$libtool" = yes; then
while test "X$1" != 'X--mode=compile'; do
shift
done
shift
fi
# Remove '-o $object'.
IFS=" "
for arg
do
case $arg in
-o)
shift
;;
$object)
shift
;;
*)
set fnord "$@" "$arg"
shift # fnord
shift # $arg
;;
esac
done
"$@" -E \
| sed -n -e '/^# [0-9][0-9]* "\([^"]*\)".*/ s:: \1 \\:p' \
-e '/^#line [0-9][0-9]* "\([^"]*\)".*/ s:: \1 \\:p' \
| sed '$ s: \\$::' > "$tmpdepfile"
rm -f "$depfile"
echo "$object : \\" > "$depfile"
cat < "$tmpdepfile" >> "$depfile"
sed < "$tmpdepfile" '/^$/d;s/^ //;s/ \\$//;s/$/ :/' >> "$depfile"
rm -f "$tmpdepfile"
;;
msvisualcpp)
# Important note: in order to support this mode, a compiler *must*
# always write the preprocessed file to stdout.
"$@" || exit $?
# Remove the call to Libtool.
if test "$libtool" = yes; then
while test "X$1" != 'X--mode=compile'; do
shift
done
shift
fi
IFS=" "
for arg
do
case "$arg" in
-o)
shift
;;
$object)
shift
;;
"-Gm"|"/Gm"|"-Gi"|"/Gi"|"-ZI"|"/ZI")
set fnord "$@"
shift
shift
;;
*)
set fnord "$@" "$arg"
shift
shift
;;
esac
done
"$@" -E 2>/dev/null |
sed -n '/^#line [0-9][0-9]* "\([^"]*\)"/ s::\1:p' | $cygpath_u | sort -u > "$tmpdepfile"
rm -f "$depfile"
echo "$object : \\" > "$depfile"
sed < "$tmpdepfile" -n -e 's% %\\ %g' -e '/^\(.*\)$/ s::'"$tab"'\1 \\:p' >> "$depfile"
echo "$tab" >> "$depfile"
sed < "$tmpdepfile" -n -e 's% %\\ %g' -e '/^\(.*\)$/ s::\1\::p' >> "$depfile"
rm -f "$tmpdepfile"
;;
msvcmsys)
# This case exists only to let depend.m4 do its work. It works by
# looking at the text of this script. This case will never be run,
# since it is checked for above.
exit 1
;;
none)
exec "$@"
;;
*)
echo "Unknown depmode $depmode" 1>&2
exit 1
;;
esac
exit 0
# Local Variables:
# mode: shell-script
# sh-indentation: 2
# eval: (add-hook 'write-file-hooks 'time-stamp)
# time-stamp-start: "scriptversion="
# time-stamp-format: "%:y-%02m-%02d.%02H"
# time-stamp-time-zone: "UTC"
# time-stamp-end: "; # UTC"
# End:
tabble-0.45/src/ 0000755 0001750 0001750 00000000000 13726332614 010472 5 0000000 0000000 tabble-0.45/src/icons.c 0000644 0001750 0001750 00000002376 13724075636 011707 0000000 0000000
#include
#include
#include "world.h"
GtkWidget* any_scale_icon (const gchar *filename, gint width, gint height)
{
GdkPixbuf *pixbuf, *scaled;
GtkWidget *result;
GError *error = NULL;
float max_x, max_y, icon_x, icon_y, max_ratio, icon_ratio, new_x, new_y;
pixbuf = gdk_pixbuf_new_from_file (filename, &error);
if (error != NULL)
return NULL;
icon_x = gdk_pixbuf_get_width (pixbuf);
icon_y = gdk_pixbuf_get_height (pixbuf);
max_x = width;
max_y = height;
if ((max_x <= 0) || (max_y <=0) || ((icon_x == max_x) && (icon_y == max_y)))
{
result = gtk_image_new_from_pixbuf (pixbuf);
g_object_unref (pixbuf) ;
return result;
}
max_ratio = max_y / max_x;
icon_ratio = icon_y / icon_x;
if (max_ratio >= icon_ratio)
{
new_x = max_x;
new_y = max_y * icon_ratio / max_ratio;
}
else
{
new_x = max_x * max_ratio / icon_ratio;
new_y = max_y;
}
scaled = gdk_pixbuf_scale_simple (pixbuf, (gint) new_x, (gint) new_y,
GDK_INTERP_BILINEAR);
result = gtk_image_new_from_pixbuf (scaled);
g_object_unref (pixbuf);
g_object_unref (scaled);
return result;
}
GtkWidget* scaled_icon (const gchar *filename)
{
return any_scale_icon (filename, icon_width, icon_height);
}
tabble-0.45/src/signals.c 0000644 0001750 0001750 00000001313 11337160643 012211 0000000 0000000
#include
#include
#include "world.h"
#include "load_lists.h"
#include "choices.h"
const int SIGWORLD = 50;
static world_info *info = NULL;
void wake (int code)
{
if (info && code == SIGWORLD)
{
gtk_widget_show_all (GTK_WIDGET (info->main_window));
if (info->world_revert_to_first)
info->last_tab = 0;
gtk_notebook_set_current_page (GTK_NOTEBOOK (info->tabs), info->last_tab);
show_edit_buttons (info, FALSE);
set_window (info);
/* the following line doesn't always work? Give suggestions! */
gtk_window_set_focus (GTK_WINDOW (info->main_window), NULL);
}
}
void signal_init (world_info *pointer)
{
info = pointer;
signal (SIGWORLD, wake);
}
tabble-0.45/src/save_lists.c 0000644 0001750 0001750 00000012673 11336422471 012737 0000000 0000000
#include
#include
#include "world.h"
#include "edits.h"
#include "read_line.h"
#include "add_stuff.h"
typedef struct
{
FILE *file;
GString *error;
} save_struct;
void save_line (save_struct *context, const gchar *text)
{
size_t actual, count;
if (text_here (context->error))
return;
actual = strlen (text);
if (actual <= 0)
return;
count = fwrite (text, 1, strlen (text), context->file);
if (count != actual)
g_string_assign (context->error, "Could not write all of buffer");
}
void save_value (save_struct *context, const gchar *key, const GString *value)
{
GString *line;
if (!text_here (value))
return;
line = g_string_new (NULL);
g_string_sprintf (line, "%s: %s\n", key, value->str);
save_line (context, line->str);
g_string_free (line, TRUE);
}
gchar* bool_text (gboolean value)
{
if (value)
return "true";
else
return "false";
}
const gchar* save_run (world_info *info, gboolean new_grid)
{
tab_struct *tab;
cell_struct *cell;
item_struct *item;
save_struct context;
gint x, y, t, new_x, new_y;
GString *line, *icon_save_dir;
if (!text_here (info->conf_file))
return "No save file";
context.file = fopen (info->conf_file->str, "w");
if (!context.file)
return "No write permission";
context.error = g_string_new (NULL);
line = g_string_new (NULL);
icon_save_dir = g_string_new ("");
g_string_sprintf (line, "window name: %s\n", info->window_name->str);
save_line (&context, line->str);
g_string_sprintf (line, "options: %s\n", bool_text (info->options_enabled));
save_line (&context, line->str);
g_string_sprintf (line, "on top: %s\n", bool_text (info->world_on_top));
save_line (&context, line->str);
g_string_sprintf (line, "sticky: %s\n", bool_text (info->world_sticky));
save_line (&context, line->str);
g_string_sprintf (line, "revert: %s\n",
bool_text (info->world_revert_to_first));
save_line (&context, line->str);
g_string_sprintf (line, "start x: %d\n", info->start_x);
save_line (&context, line->str);
g_string_sprintf (line, "start y: %d\n", info->start_y);
save_line (&context, line->str);
g_string_sprintf (line, "start w: %d\n", info->start_w);
save_line (&context, line->str);
g_string_sprintf (line, "start h: %d\n", info->start_h);
save_line (&context, line->str);
if (new_grid)
{
g_string_sprintf (line, "x icons: %d\n", info->x_icons_new);
save_line (&context, line->str);
g_string_sprintf (line, "y icons: %d\n", info->y_icons_new);
save_line (&context, line->str);
}
else
{
g_string_sprintf (line, "x icons: %d\n", info->x_icons);
save_line (&context, line->str);
g_string_sprintf (line, "y icons: %d\n", info->y_icons);
save_line (&context, line->str);
}
save_line (&context, "\n");
for (t = 0; t < info->tab_count; t++)
{
new_x = new_y = 0;
tab = (tab_struct*) g_list_nth (info->tab_list, t)->data;
g_string_sprintf (line, "tab: %s\n\n", tab->tab_name->str);
save_line (&context, line->str);
for (y = 0; y < info->y_icons; y++)
{
for (x = 0; x < info->x_icons; x++)
{
cell = get_grid (info, t, x, y);
if (cell->filled)
{
item = cell->item;
save_value (&context, "name", item->name);
if (text_here (item->dir))
save_value (&context, "dir", item->dir);
if (text_here (item->cmd))
save_value (&context, "cmd", item->cmd);
if (text_here (item->icon))
{
if (strcmp (find_parent_dir (item->icon->str), icon_save_dir->str))
{
g_string_assign (icon_save_dir,
find_parent_dir (item->icon->str));
save_value (&context, "icon dir", icon_save_dir);
}
save_value (&context, "icon",
g_string_new (find_filename (item->icon->str)));
}
if (new_grid)
{
g_string_sprintf (line, "x pos: %d\n", new_x);
save_line (&context, line->str);
g_string_sprintf (line, "y pos: %d\n", new_y);
save_line (&context, line->str);
new_x++;
if (new_x >= info->x_icons_new)
{
new_x = 0;
new_y++;
}
}
else
{
g_string_sprintf (line, "x pos: %d\n", item->x_pos);
save_line (&context, line->str);
g_string_sprintf (line, "y pos: %d\n", item->y_pos);
save_line (&context, line->str);
}
save_line (&context, "\n");
}
if (text_here (context.error))
break;
}
if (text_here (context.error))
break;
}
if (text_here (context.error))
break;
}
fclose (context.file);
if (text_here (context.error))
return context.error->str;
else
return NULL;
}
void save_all (world_info *info)
{
GString *message;
const gchar *error;
error = save_run (info, FALSE);
if (error)
{
message = g_string_new (NULL);
g_string_sprintf (message, "This error occured during save:\n\n%s", error);
show_notice (message->str, info->main_window);
}
}
void save_all_compressed (world_info *info)
{
GString *message;
const gchar *error;
error = save_run (info, TRUE);
if (error)
{
message = g_string_new (NULL);
g_string_sprintf (message, "This error occured during save:\n\n%s", error);
show_notice (message->str, info->main_window);
}
}
tabble-0.45/src/load_lists.c 0000644 0001750 0001750 00000022741 11336422342 012712 0000000 0000000
#include
#include
#include
#include
#include "world.h"
#include "read_line.h"
#include "add_stuff.h"
#ifdef HAVE_CONFIG_H
#include
#endif
enum parse_mode {pm_settings, pm_programs};
gint my_atoi (const gchar *text)
{
gint number;
if (strcmp (text, "0") == 0)
return 0;
number = atoi (text);
if (number == 0)
g_print ("not an integer: %s\n", text);
return number;
}
void reset_item (item_struct *item)
{
g_string_assign (item->name, "");
g_string_assign (item->dir, "");
g_string_assign (item->cmd, "");
g_string_assign (item->icon, "");
item->x_pos = item->y_pos = -1;
}
void maybe_item_entry (world_info *info, item_struct *item, gint this_tab)
{
GString *icon_path;
if (!text_here (item->name))
return;
if (text_here (info->icon_dir) && text_here (item->icon)
&& (item->icon->str [0] != '/') && (item->icon->str [0] != '.'))
{
icon_path = g_string_new (NULL);
g_string_sprintf (icon_path, "%s/%s", info->icon_dir->str, item->icon->str);
g_string_assign (item->icon, icon_path->str);
free_g_string (icon_path);
}
add_item (info, item, this_tab);
reset_item (item);
}
const gchar* find_conf (world_info *info)
{
const gchar *text;
info->conf_file = g_string_new (NULL);
info->pwd_dir = g_string_new (NULL);
text = getenv ("PWD");
if ((text) && (strcmp (text, "") != 0))
g_string_assign (info->pwd_dir, text);
text = cmdline_option (info, "-c");
if (text)
{
if (strcmp (text, "") == 0)
return "-c option with no filename";
g_string_assign (info->conf_file, text);
if (!file_readable (text))
return "specified file not readable";
else
return NULL;
}
text = getenv ("HOME");
if ((text) && (strcmp (text, "") != 0))
{
g_string_sprintf (info->conf_file, "%s/.tabble", text);
if (file_readable (info->conf_file->str))
return NULL;
else
return "choosing home directory for configuration";
}
g_string_assign (info->conf_file, "example-conf");
if (file_readable (info->conf_file->str))
return NULL;
else
return "can't find any configuration";
}
gboolean keyword_valid (const gchar *text)
{
if (strcmp (text, "tab") == 0) return TRUE;
if (strcmp (text, "name") == 0) return TRUE;
if (strcmp (text, "dir") == 0) return TRUE;
if (strcmp (text, "cmd") == 0) return TRUE;
if (strcmp (text, "icon") == 0) return TRUE;
if (strcmp (text, "x pos") == 0) return TRUE;
if (strcmp (text, "y pos") == 0) return TRUE;
if (strcmp (text, "icon dir") == 0) return TRUE;
if (strcmp (text, "options") == 0) return TRUE;
if (strcmp (text, "on top") == 0) return TRUE;
if (strcmp (text, "sticky") == 0) return TRUE;
if (strcmp (text, "revert") == 0) return TRUE;
if (strcmp (text, "start x") == 0) return TRUE;
if (strcmp (text, "start y") == 0) return TRUE;
if (strcmp (text, "start w") == 0) return TRUE;
if (strcmp (text, "start h") == 0) return TRUE;
if (strcmp (text, "x icons") == 0) return TRUE;
if (strcmp (text, "y icons") == 0) return TRUE;
if (strcmp (text, "window name") == 0) return TRUE;
return FALSE;
}
gboolean keyword_test (const gchar *left, const gchar* keyword)
{
if (!keyword_valid (keyword))
{
g_print ("internal error: unknown keyword %s\n", keyword);
return FALSE;
}
if (strcmp (left, keyword) == 0)
return TRUE;
else
return FALSE;
}
gboolean true (const gchar *text)
{
if (strcmp (text, "true") == 0) return TRUE;
if (strcmp (text, "false") == 0) return FALSE;
g_print ("not true or false: %s\n", text);
return FALSE;
}
void read_settings (world_info *info, const gchar *left, const gchar *right)
{
if (keyword_test (left, "options") && !true (right))
info->options_enabled = FALSE;
else
if (keyword_test (left, "on top") && true (right))
info->world_on_top = TRUE;
else
if (keyword_test (left, "sticky") && true (right))
info->world_sticky = TRUE;
else
if (keyword_test (left, "revert") && true (right))
info->world_revert_to_first = TRUE;
else
if (keyword_test (left, "start x"))
info->start_x = my_atoi (right);
else
if (keyword_test (left, "start y"))
info->start_y = my_atoi (right);
else
if (keyword_test (left, "start w"))
info->start_w = my_atoi (right);
else
if (keyword_test (left, "start h"))
info->start_h = my_atoi (right);
else
if (keyword_test (left, "x icons"))
info->x_icons = my_atoi (right);
else
if (keyword_test (left, "y icons"))
info->y_icons = my_atoi (right);
else
if (keyword_test (left, "window name"))
g_string_assign (info->window_name, right);
}
void read_programs (world_info *info, const gchar *left, const gchar *right,
item_struct *item, gint *this_tab)
{
if (keyword_test (left, "tab"))
{
maybe_item_entry (info, item, *this_tab);
*this_tab = add_tab (info, right);
}
else
if (keyword_test (left, "name"))
{
maybe_item_entry (info, item, *this_tab);
g_string_assign (item->name, right);
}
else
if (keyword_test (left, "cmd"))
g_string_assign (item->cmd, right);
else
if (keyword_test (left, "dir"))
g_string_assign (item->dir, right);
else
if (keyword_test (left, "x pos"))
item->x_pos = my_atoi (right);
else
if (keyword_test (left, "y pos"))
item->y_pos = my_atoi (right);
else
if (keyword_test (left, "icon"))
g_string_assign (item->icon, right);
else
if (keyword_test (left, "icon dir"))
g_string_assign (info->icon_dir, right);
}
void parse_config (world_info *info, gint parse_setting)
{
readline *context;
const gchar *filename;
gchar *left, *right;
GString *line, *error_text;
gint count = 0, index = 0, this_tab = -1;
gboolean errors_present = FALSE;
item_struct item;
filename = info->conf_file->str;
if (!filename)
{
if (parse_setting == pm_settings)
g_print ("%s: can't load settings\n", PACKAGE);
return;
}
line = g_string_new (NULL);
error_text = g_string_new (NULL);
context = read_start (filename, 256);
if (parse_setting == pm_programs)
zero_item (&item);
for (;;)
{
if (text_here (error_text))
{
if (errors_present == FALSE)
{
g_print ("%s: errors in %s\n", PACKAGE, filename);
errors_present = TRUE;
}
g_print ("line %d: %s\n", count, error_text->str);
g_string_assign (error_text, "");
}
count++;
if (!read_next (context, &line))
{
if (parse_setting == pm_programs)
maybe_item_entry (info, &item, this_tab);
return;
}
if (!text_here (line))
continue;
if ((line->str)[0] == '#')
continue;
index = char_find (line->str, ':');
if (index < 0)
{
if (parse_setting == pm_settings)
g_string_assign (error_text, "no : divider");
continue;
}
if ((line->len < 3) || (index < 1))
{
if (parse_setting == pm_settings)
g_string_assign (error_text, "line too short");
continue;
}
(line->str) [index] = '\0';
left = line->str;
right = line->str + index + 1; /* yeah a bit iffy */
while (*right == ' ')
right++; /* same */
if (strcmp (left, "") == 0)
{
if (parse_setting == pm_settings)
g_string_assign (error_text, "no keyword");
continue;
}
if (!keyword_valid (left))
{
if (parse_setting == pm_settings)
g_string_sprintf (error_text, "unknown keyword: %s", left);
continue;
}
if (strcmp (right, "") == 0)
{
if (parse_setting == pm_settings)
g_string_assign (error_text, "no value");
continue;
}
if (parse_setting == pm_settings)
read_settings (info, left, right);
else
if (parse_setting == pm_programs)
read_programs (info, left, right, &item, &this_tab);
}
}
void set_window (world_info *info)
{
gtk_window_set_keep_above (GTK_WINDOW (info->main_window),
info->world_on_top);
if (info->world_sticky)
gtk_window_stick (GTK_WINDOW (info->main_window));
else
gtk_window_unstick (GTK_WINDOW (info->main_window));
if ((info->start_x >=0) && (info->start_y >= 0))
gtk_window_move (GTK_WINDOW (info->main_window),
info->start_x, info->start_y);
if ((info->start_w >=0) && (info->start_h >= 0))
gtk_window_resize (GTK_WINDOW (info->main_window),
info->start_w, info->start_h);
}
void reset_world_info (world_info *info)
{
info->tab_list = NULL;
info->tab_count = 0;
info->button_spacing = 2;
info->icon_x_spacing = 10;
info->icon_y_spacing = 5;
info->frame_spacing = 5;
info->x_icons = 4;
info->y_icons = 2;
info->max_line = 10;
info->icon_dir = g_string_new (default_icon_dir);
info->cmd_dir = g_string_new (default_cmd_dir);
info->world_on_top = FALSE;
info->world_sticky = FALSE;
info->world_revert_to_first = FALSE;
info->start_x = info->start_y = -1;
info->start_w = info->start_h = -1;
info->blanks_shown = FALSE;
info->current_cell = info->selected_cell = NULL;
info->run_again = FALSE;
info->options_enabled = TRUE;
info->pressed_cell = info->entered_cell = NULL;
info->window_name = g_string_new (default_window_name);
}
void load_settings (world_info *info)
{
const gchar *error;
error = find_conf (info);
if (error)
{
g_print ("error loading configuration: %s\n", error);
set_window (info);
}
else
{
parse_config (info, pm_settings);
set_window (info);
parse_config (info, pm_programs);
}
info->x_icons_new = info->x_icons;
info->y_icons_new = info->y_icons;
if (info->tab_count == 0)
add_tab (info, "Applications");
}
tabble-0.45/src/tabble.c 0000644 0001750 0001750 00000001313 11336423731 012001 0000000 0000000
#include
#include "world.h"
#include "choices.h"
#include "load_lists.h"
#include "signals.h"
int main (int argc, char *argv[])
{
GtkWidget *main_window;
world_info *info;
gboolean run_again;
gtk_init (&argc, &argv);
while (TRUE)
{
main_window = gtk_window_new (GTK_WINDOW_TOPLEVEL);
info = g_malloc0 (sizeof (world_info));
info->argc = argc;
info->argv = argv;
info->main_window = main_window;
reset_world_info (info);
choices (info);
gtk_window_set_title (GTK_WINDOW (main_window), info->window_name->str);
gtk_main();
signal_init (NULL);
run_again = info->run_again;
g_free (info);
if (run_again == FALSE)
return 0;
}
}
tabble-0.45/src/read_line.c 0000644 0001750 0001750 00000006604 13724075731 012510 0000000 0000000
#include
#include
#include
#include "read_line.h"
gboolean text_here (const GString *text)
{
if ((text == NULL) || (strcmp (text->str, "") == 0))
return 0;
else
return 1;
}
void free_g_string (GString *text)
{
if (text_here (text))
g_string_free (text, TRUE);
}
const gchar* find_parent_dir (const gchar *source)
{
GString *dest;
gint index;
dest = g_string_new ("/");
index = strlen (source);
if (index <= 1)
return dest->str;
index--;
for (;;)
{
if (source [index] != '/')
break;
index--;
}
for (;;)
{
if (source [index] == '/')
{
dest = g_string_new_len (source, index);
return dest->str;
}
index--;
if (index <= 0)
return dest->str;
}
}
const gchar* find_parent_dir_slash (const gchar *source)
{
GString *result;
const gchar *parent;
parent = find_parent_dir (source);
if (strlen (parent) <= 1)
return parent;
result = g_string_new (NULL);
g_string_sprintf (result, "%s/", parent);
return result->str;
}
const gchar* find_filename (const gchar *source)
{
gint index;
index = strlen (source);
while (index > 0)
{
if (source [index] == '/')
return g_string_new (source + index + 1)->str;
index--;
}
return g_string_new (source)->str;
}
int char_find (const gchar* text, char sought)
{
int index = 0;
gchar letter;
for (;;)
{
letter = text [index]; /* yeah a bit dangerous */
if (letter == '\0')
return -1;
if (letter == sought)
return index;
index++;
}
}
readline* read_start (const gchar* filename, gint max_length)
{
readline* context;
context = g_malloc0 (sizeof (readline));
context->filename = g_string_new (filename);
context->pos = 0;
context->max_length = max_length;
context->file = fopen (filename, "r");
if (!context->file)
{
g_print ("Can't read %s (exists?)\n", filename);
return NULL;
}
context->buffer = g_malloc0 (max_length + 4);
context->pos = 0;
return context;
}
gboolean read_next (readline *context, GString **destination)
{
gint count, index;
if (context->pos < 0)
return FALSE;
fseek (context->file, context->pos, SEEK_SET);
count = fread (context->buffer, 1, context->max_length, context->file);
if (count <= 0)
{
g_free (context->buffer);
fclose (context->file);
context->pos = -1;
return FALSE;
}
context->buffer [context->max_length + 1] = '\0';
index = char_find (context->buffer, '\n');
if (index < 0)
{
g_print ("Line too long\n");
g_free (context->buffer);
fclose (context->file);
context->pos = -1;
return FALSE;
}
context->buffer [index] = '\0';
g_string_assign (*destination, context->buffer);
context->pos += index + 1;
return TRUE;
}
gboolean file_readable (const gchar *filename)
{
FILE *file;
file = fopen (filename, "r");
if (file)
{
fclose (file);
return TRUE;
}
else
return FALSE;
}
const gchar* cmdline_option (world_info *info, const gchar *option)
{
gint count, found;
gchar **argv = info->argv;
static const gchar empty[] = "";
found = -1;
for (count = 0; count < info->argc; count++)
if (strcmp (argv [count], option) == 0)
{
found = count;
break;
}
if (found < 0)
return NULL;
if (found < info->argc - 1)
return argv [found + 1];
return empty;
}
tabble-0.45/src/options.c 0000644 0001750 0001750 00000047430 11330501610 012240 0000000 0000000
#include
#include
#include
#include "world.h"
#include "add_stuff.h"
#include "edits.h"
#include "load_lists.h"
#include "save_lists.h"
#include "icon.h"
#ifdef HAVE_CONFIG_H
#include
#endif
void cancel (GtkWidget *widget, GtkWidget *widget_to_close)
{
gtk_widget_destroy (widget_to_close);
}
void accept_new_tab (GtkWidget *widget, world_info *info)
{
const gchar *text;
text = gtk_entry_get_text (GTK_ENTRY (info->options_field_1));
if ((text == NULL) || (strcmp (text, "") == 0))
return;
add_tab (info, text);
gtk_widget_destroy (info->options_dialog);
gtk_notebook_set_current_page (GTK_NOTEBOOK (info->tabs), -1);
save_all (info);
}
void new_tab (GtkWidget *widget, world_info *info)
{
GtkWidget *label, *button;
gtk_widget_destroy (info->options_dialog);
info->options_dialog = gtk_dialog_new_with_buttons ("New Tab",
GTK_WINDOW (info->main_window), GTK_DIALOG_NO_SEPARATOR, NULL);
gtk_window_set_transient_for (GTK_WINDOW (info->options_dialog),
GTK_WINDOW (info->main_window));
gtk_window_set_modal (GTK_WINDOW (info->options_dialog), TRUE);
gtk_container_set_border_width (GTK_CONTAINER (info->options_dialog),
info->frame_spacing);
info->options_table = gtk_table_new (3, 5, FALSE);
gtk_container_add (GTK_CONTAINER (GTK_DIALOG (info->options_dialog)->vbox),
info->options_table);
gtk_table_set_row_spacings (GTK_TABLE (info->options_table),
info->frame_spacing);
gtk_table_set_col_spacings (GTK_TABLE (info->options_table),
info->frame_spacing);
label = gtk_label_new ("New tab name:");
gtk_misc_set_alignment (GTK_MISC (label), 0.0, 0.5);
gtk_table_attach_defaults (GTK_TABLE (info->options_table), label,
0, 1, 0, 1);
info->options_field_1 = gtk_entry_new();
gtk_table_attach_defaults (GTK_TABLE (info->options_table),
info->options_field_1, 2, 3, 0, 1);
button = gtk_button_new_with_label ("OK");
g_signal_connect (G_OBJECT (button), "clicked",
G_CALLBACK (accept_new_tab), info);
gtk_table_attach_defaults (GTK_TABLE (info->options_table), button,
4, 5, 0, 1);
button = gtk_button_new_with_label ("Cancel");
g_signal_connect (G_OBJECT (button), "clicked", G_CALLBACK (cancel),
info->options_dialog);
gtk_table_attach_defaults (GTK_TABLE (info->options_table), button,
4, 5, 2, 3);
gtk_widget_show_all (info->options_dialog);
}
void accept_mod_tab (GtkWidget *widget, world_info *info)
{
GtkWidget *table, *label;
const gchar *text;
gint tab_number;
tab_struct *tab;
tab_number = gtk_notebook_get_current_page (GTK_NOTEBOOK (info->tabs));
text = gtk_entry_get_text (GTK_ENTRY (info->options_field_1));
if ((text == NULL) || (strcmp (text, "") == 0))
del_tab (info, tab_number);
else
{
table = gtk_notebook_get_nth_page (GTK_NOTEBOOK (info->tabs), tab_number);
label = gtk_notebook_get_tab_label (GTK_NOTEBOOK (info->tabs), table);
gtk_label_set_text (GTK_LABEL (label), text);
tab = (tab_struct*) g_list_nth (info->tab_list, tab_number)->data;
g_string_assign (tab->tab_name, text);
}
gtk_widget_destroy (info->options_dialog);
save_all (info);
}
void mod_tab (GtkWidget *widget, world_info *info)
{
GtkWidget *label, *button;
tab_struct *tab;
gint tab_number;
gtk_widget_destroy (info->options_dialog);
info->options_dialog = gtk_dialog_new_with_buttons ("Modify Tab",
GTK_WINDOW (info->main_window), GTK_DIALOG_NO_SEPARATOR, NULL);
gtk_window_set_transient_for (GTK_WINDOW (info->options_dialog),
GTK_WINDOW (info->main_window));
gtk_window_set_modal (GTK_WINDOW (info->options_dialog), TRUE);
gtk_container_set_border_width (GTK_CONTAINER (info->options_dialog),
info->frame_spacing);
info->options_table = gtk_table_new (4, 5, FALSE);
gtk_container_add (GTK_CONTAINER (GTK_DIALOG (info->options_dialog)->vbox),
info->options_table);
gtk_table_set_row_spacings (GTK_TABLE (info->options_table), info->frame_spacing);
gtk_table_set_col_spacings (GTK_TABLE (info->options_table), info->frame_spacing);
label = gtk_label_new ("New name:");
gtk_misc_set_alignment (GTK_MISC (label), 0.0, 0.5);
gtk_table_attach_defaults (GTK_TABLE (info->options_table), label,
0, 1, 0, 1);
info->options_field_1 = gtk_entry_new();
tab_number = gtk_notebook_get_current_page (GTK_NOTEBOOK (info->tabs));
tab = (tab_struct*) g_list_nth (info->tab_list, tab_number)->data;
gtk_entry_set_text (GTK_ENTRY (info->options_field_1), tab->tab_name->str);
gtk_table_attach_defaults (GTK_TABLE (info->options_table),
info->options_field_1, 2, 3, 0, 1);
button = gtk_button_new_with_label ("OK");
g_signal_connect (G_OBJECT (button), "clicked",
G_CALLBACK (accept_mod_tab), info);
gtk_table_attach_defaults (GTK_TABLE (info->options_table), button,
4, 5, 0, 1);
button = gtk_button_new_with_label ("Cancel");
g_signal_connect (G_OBJECT (button), "clicked", G_CALLBACK (cancel),
info->options_dialog);
gtk_table_attach_defaults (GTK_TABLE (info->options_table), button,
4, 5, 1, 2);
label = gtk_label_new ("Remove name to delete tab.");
gtk_table_attach_defaults (GTK_TABLE (info->options_table), label,
0, 3, 2, 3);
gtk_misc_set_alignment (GTK_MISC (label), 0.0, 0.5);
gtk_widget_show_all (info->options_dialog);
}
void delete_stuff (GtkWidget *widget, world_info *info)
{
GString *message;
gtk_widget_destroy (info->options_dialog);
message = g_string_new (NULL);
g_string_sprintf (message,
"All delete features are not coded, but you may\n"
"close and edit the text configuration file.\n"
"Tabble is currently using this location:\n\n%s\n\n"
"(Path may be relative to current working directory.)",
info->conf_file->str);
show_notice (message->str, info->main_window);
}
void dimensions_accept (GtkWidget *widget, world_info *info)
{
gint x, y, t;
x = atoi (gtk_entry_get_text (GTK_ENTRY (info->options_field_1)));
y = atoi (gtk_entry_get_text (GTK_ENTRY (info->options_field_2)));
if (x <=0 || y <= 0)
{
gtk_widget_destroy (info->options_dialog);
return;
}
info->x_icons_new = x;
info->y_icons_new = y;
save_all_compressed (info);
for (t = info->tab_count - 1; t >= 0; t--)
del_tab (info, t);
info->run_again = TRUE;
gtk_widget_destroy (info->options_dialog);
gtk_widget_destroy (info->main_window);
}
void dimensions (GtkWidget *widget, world_info *info)
{
GtkWidget *label, *button;
GString *string;
gtk_widget_destroy (info->options_dialog);
info->options_dialog = gtk_dialog_new_with_buttons ("Dimensions",
GTK_WINDOW (info->main_window), GTK_DIALOG_NO_SEPARATOR, NULL);
gtk_window_set_transient_for (GTK_WINDOW (info->options_dialog),
GTK_WINDOW (info->main_window));
gtk_window_set_modal (GTK_WINDOW (info->options_dialog), TRUE);
gtk_container_set_border_width (GTK_CONTAINER (info->options_dialog),
info->frame_spacing);
info->options_table = gtk_table_new (4, 3, FALSE);
gtk_container_add (GTK_CONTAINER (GTK_DIALOG (info->options_dialog)
->vbox), info->options_table);
gtk_table_set_row_spacings (GTK_TABLE (info->options_table),
info->frame_spacing);
gtk_table_set_col_spacings (GTK_TABLE (info->options_table),
info->frame_spacing);
label = gtk_label_new ("X across:");
gtk_misc_set_alignment (GTK_MISC (label), 0.0, 0.5);
gtk_table_attach_defaults (GTK_TABLE (info->options_table), label,
0, 1, 0, 1);
label = gtk_label_new ("Y down:");
gtk_misc_set_alignment (GTK_MISC (label), 0.0, 0.5);
gtk_table_attach_defaults (GTK_TABLE (info->options_table), label,
0, 1, 1, 2);
string = g_string_new (NULL);
info->options_field_1 = gtk_entry_new();
g_string_sprintf (string, "%d", info->x_icons);
gtk_entry_set_text (GTK_ENTRY (info->options_field_1), string->str);
gtk_table_attach (GTK_TABLE (info->options_table), info->options_field_1,
1, 2, 0, 1, GTK_SHRINK, GTK_SHRINK, 0, 0);
info->options_field_2 = gtk_entry_new();
g_string_sprintf (string, "%d", info->y_icons);
gtk_entry_set_text (GTK_ENTRY (info->options_field_2), string->str);
gtk_table_attach (GTK_TABLE (info->options_table), info->options_field_2,
1, 2, 1, 2, GTK_SHRINK, GTK_SHRINK, 0, 0);
button = gtk_button_new_with_label ("OK");
gtk_table_attach (GTK_TABLE (info->options_table), button, 2, 3, 0, 1,
GTK_FILL, GTK_SHRINK, 0, 0);
g_signal_connect (G_OBJECT (button), "clicked",
G_CALLBACK (dimensions_accept), info);
button = gtk_button_new_with_label ("Cancel");
gtk_table_attach (GTK_TABLE (info->options_table), button, 2, 3, 1, 2,
GTK_FILL, GTK_SHRINK, 0, 0);
g_signal_connect (G_OBJECT (button), "clicked", G_CALLBACK (cancel),
info->options_dialog);
label = gtk_label_new ("NB: clicking OK will compress your\n"
"programs linearily.");
gtk_misc_set_alignment (GTK_MISC (label), 0.0, 0.5);
gtk_table_attach_defaults (GTK_TABLE (info->options_table), label,
0, 3, 2, 3);
gtk_widget_show_all (info->options_dialog);
}
void position_custom (GtkWidget *widget, world_info *info)
{
gtk_widget_destroy (info->options_dialog);
gtk_window_get_position (GTK_WINDOW (info->main_window),
&info->start_x, &info->start_y);
gtk_window_get_size (GTK_WINDOW (info->main_window),
&info->start_w, &info->start_h);
save_all (info);
}
void position_window_manager (GtkWidget *widget, world_info *info)
{
gtk_widget_destroy (info->options_dialog);
info->start_x = info->start_y = -1;
info->start_w = info->start_h = -1;
save_all (info);
}
void position_options (GtkWidget *widget, world_info *info)
{
GtkWidget *button;
gtk_widget_destroy (info->options_dialog);
info->options_dialog = gtk_dialog_new_with_buttons ("Window Position",
GTK_WINDOW (info->main_window), GTK_DIALOG_NO_SEPARATOR, NULL);
gtk_window_set_transient_for (GTK_WINDOW (info->options_dialog),
GTK_WINDOW (info->main_window));
gtk_window_set_modal (GTK_WINDOW (info->options_dialog), TRUE);
gtk_container_set_border_width (GTK_CONTAINER (info->options_dialog),
info->frame_spacing);
info->options_table = gtk_table_new (3, 2, FALSE);
gtk_container_add (GTK_CONTAINER (GTK_DIALOG (info->options_dialog)->vbox),
info->options_table);
gtk_table_set_row_spacings (GTK_TABLE (info->options_table),
info->frame_spacing);
gtk_table_set_col_spacings (GTK_TABLE (info->options_table),
info->frame_spacing);
button = gtk_button_new_with_label ("Save current screen position");
g_signal_connect (G_OBJECT (button), "clicked",
G_CALLBACK (position_custom), info);
gtk_table_attach_defaults (GTK_TABLE (info->options_table), button,
0, 1, 0, 1);
button = gtk_button_new_with_label ("Window manager decided");
g_signal_connect (G_OBJECT (button), "clicked",
G_CALLBACK (position_window_manager), info);
gtk_table_attach_defaults (GTK_TABLE (info->options_table), button,
0, 1, 1, 2);
button = gtk_button_new_with_label ("Cancel");
g_signal_connect (G_OBJECT (button), "clicked", G_CALLBACK (cancel),
info->options_dialog);
gtk_table_attach_defaults (GTK_TABLE (info->options_table), button,
1, 2, 2, 3);
gtk_widget_show_all (info->options_dialog);
}
void accept_ontop_sticky (GtkWidget *widget, world_info *info)
{
info->world_on_top =
gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (info->options_check_1));
info->world_sticky =
gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (info->options_check_2));
info->world_revert_to_first =
gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (info->options_check_3));
gtk_widget_destroy (info->options_dialog);
set_window (info);
save_all (info);
}
void behaviour (GtkWidget *widget, world_info *info)
{
GtkWidget *button;
gtk_widget_destroy (info->options_dialog);
info->options_dialog = gtk_dialog_new_with_buttons ("Tabble Behaviour",
GTK_WINDOW (info->main_window), GTK_DIALOG_NO_SEPARATOR, NULL);
gtk_window_set_transient_for (GTK_WINDOW (info->options_dialog),
GTK_WINDOW (info->main_window));
gtk_window_set_modal (GTK_WINDOW (info->options_dialog), TRUE);
gtk_container_set_border_width (GTK_CONTAINER (info->options_dialog),
info->frame_spacing);
info->options_table = gtk_table_new (3, 3, FALSE);
gtk_container_add (GTK_CONTAINER (GTK_DIALOG (info->options_dialog)
->vbox), info->options_table);
gtk_table_set_row_spacings (GTK_TABLE (info->options_table),
info->frame_spacing);
gtk_table_set_col_spacings (GTK_TABLE (info->options_table),
info->frame_spacing);
info->options_check_1 = gtk_check_button_new_with_label ("Stay on top");
gtk_table_attach_defaults (GTK_TABLE (info->options_table),
info->options_check_1, 0, 1, 0, 1);
gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (info->options_check_1),
info->world_on_top);
info->options_check_2 = gtk_check_button_new_with_label ("All desktops");
gtk_table_attach_defaults (GTK_TABLE (info->options_table),
info->options_check_2, 0, 1, 1, 2);
gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (info->options_check_2),
info->world_sticky);
info->options_check_3 = gtk_check_button_new_with_label ("Revert to first");
gtk_table_attach_defaults (GTK_TABLE (info->options_table),
info->options_check_3, 0, 1, 2, 3);
gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (info->options_check_3),
info->world_revert_to_first);
button = gtk_button_new_with_label ("OK");
g_signal_connect (G_OBJECT (button), "clicked",
G_CALLBACK (accept_ontop_sticky), info);
gtk_table_attach_defaults (GTK_TABLE (info->options_table), button,
2, 3, 0, 1);
button = gtk_button_new_with_label ("Cancel");
g_signal_connect (G_OBJECT (button), "clicked", G_CALLBACK (cancel),
info->options_dialog);
gtk_table_attach_defaults (GTK_TABLE (info->options_table), button,
2, 3, 2, 3);
gtk_widget_show_all (info->options_dialog);
}
void help (GtkWidget *widget, world_info *info)
{
GtkWidget *dialog, *table, *label, *field, *button;
gtk_widget_destroy (info->options_dialog);
dialog = gtk_dialog_new_with_buttons ("Help",
GTK_WINDOW (info->main_window), GTK_DIALOG_NO_SEPARATOR, NULL);
gtk_window_set_transient_for (GTK_WINDOW (dialog),
GTK_WINDOW (info->main_window));
gtk_window_set_modal (GTK_WINDOW (dialog), TRUE);
gtk_container_set_border_width (GTK_CONTAINER (dialog),
info->frame_spacing);
table = gtk_table_new (5, 4, FALSE);
gtk_container_add (GTK_CONTAINER (GTK_DIALOG (dialog)->vbox), table);
gtk_table_set_row_spacings (GTK_TABLE (table), info->frame_spacing);
gtk_table_set_col_spacings (GTK_TABLE (table), info->frame_spacing);
label = gtk_label_new ("\nBecause of size constraints this is basic tabble\n"
"help, for more please visit:\n");
gtk_table_attach_defaults (GTK_TABLE (table), label, 0, 3, 0, 1);
gtk_misc_set_alignment (GTK_MISC (label), 0.0, 0.5);
field = gtk_entry_new();
gtk_entry_set_text (GTK_ENTRY (field),
"http://www.rillion.net/tabble/help.html");
gtk_entry_set_editable (GTK_ENTRY (field), FALSE);
gtk_table_attach_defaults (GTK_TABLE (table), field, 0, 3, 1, 2);
label = gtk_label_new
(
"\nThe buttons of programs appear on their names\n"
"with mouse over. When visible a button may be\n"
"left clicked to be launched, right clicked to be\n"
"edited and middle clicked to be launched with\n"
"auto-hide.\n\n"
"To make the buttons of empty cells visible press\n"
"shift. Programs may also be copied around with\n"
"a right click."
);
gtk_table_attach_defaults (GTK_TABLE (table), label, 0, 3, 2, 3);
gtk_misc_set_alignment (GTK_MISC (label), 0.0, 0.5);
button = gtk_button_new_with_label ("OK");
g_signal_connect (G_OBJECT (button), "clicked", G_CALLBACK (dismiss_notice),
dialog);
gtk_table_attach (GTK_TABLE (table), button, 3, 4, 3, 4,
GTK_SHRINK, GTK_SHRINK, 0, 0);
gtk_widget_show_all (dialog);
}
void about (GtkWidget *widget, world_info *info)
{
GtkWidget *dialog, *table, *icon, *label, *field, *button;
GdkPixbuf *pix_buf;
GString *string;
gtk_widget_destroy (info->options_dialog);
dialog = gtk_dialog_new_with_buttons ("About",
GTK_WINDOW (info->main_window), GTK_DIALOG_NO_SEPARATOR, NULL);
gtk_window_set_transient_for (GTK_WINDOW (dialog),
GTK_WINDOW (info->main_window));
gtk_window_set_modal (GTK_WINDOW (dialog), TRUE);
gtk_container_set_border_width (GTK_CONTAINER (dialog),
info->frame_spacing);
table = gtk_table_new (6, 5, FALSE);
gtk_container_add (GTK_CONTAINER (GTK_DIALOG (dialog)->vbox), table);
gtk_table_set_row_spacings (GTK_TABLE (table), info->frame_spacing);
gtk_table_set_col_spacings (GTK_TABLE (table), info->frame_spacing);
pix_buf = gdk_pixbuf_new_from_xpm_data (tabble_icon());
if (pix_buf)
{
icon = gtk_image_new_from_pixbuf (pix_buf);
if (icon)
{
gtk_table_attach (GTK_TABLE (table), icon,
0, 1, 2, 3, GTK_SHRINK, GTK_SHRINK, info->frame_spacing, 0);
}
}
string = g_string_new (NULL);
g_string_sprintf (string, "%s %s\n\n"
"Distributed under the GPL2 this program is copyright\n"
"2005, 2006, 2010 Graeme Sheppard.\n\n"
"Homepage:\n", PACKAGE, VERSION);
label = gtk_label_new (string->str);
gtk_table_attach_defaults (GTK_TABLE (table), label, 2, 3, 2, 3);
gtk_misc_set_alignment (GTK_MISC (label), 0.0, 0.5);
field = gtk_entry_new();
gtk_entry_set_text (GTK_ENTRY (field), "http://www.rillion.net/tabble/");
gtk_entry_set_editable (GTK_ENTRY (field), FALSE);
gtk_table_attach_defaults (GTK_TABLE (table), field, 2, 3, 3, 4);
button = gtk_button_new_with_label ("OK");
g_signal_connect (G_OBJECT (button), "clicked", G_CALLBACK (dismiss_notice),
dialog);
gtk_table_attach (GTK_TABLE (table), button, 4, 5, 5, 6,
GTK_SHRINK, GTK_SHRINK, 0, 0);
gtk_widget_show_all (dialog);
}
void add (world_info *info, gint row, gchar *button_text, gchar *label_text,
GCallback function)
{
GtkWidget *button, *label;
button = gtk_button_new_with_label (button_text);
gtk_table_attach_defaults (GTK_TABLE (info->options_table), button,
0, 1, row, row + 1);
g_signal_connect (G_OBJECT (button), "clicked", G_CALLBACK (function), info);
label = gtk_label_new (label_text);
gtk_table_attach_defaults (GTK_TABLE (info->options_table), label,
2, 3, row, row + 1);
gtk_misc_set_alignment (GTK_MISC (label), 0.0, 0.5);
}
void options_dialog (world_info *info)
{
GtkWidget *button;
info->options_dialog = gtk_dialog_new_with_buttons ("Options",
GTK_WINDOW (info->main_window), GTK_DIALOG_NO_SEPARATOR, NULL);
gtk_window_set_transient_for (GTK_WINDOW (info->options_dialog),
GTK_WINDOW (info->main_window));
gtk_window_set_modal (GTK_WINDOW (info->options_dialog), TRUE);
gtk_container_set_border_width (GTK_CONTAINER (info->options_dialog),
info->frame_spacing);
info->options_table = gtk_table_new (10, 4, FALSE);
gtk_container_add (GTK_CONTAINER (GTK_DIALOG (info->options_dialog)->vbox),
info->options_table);
gtk_table_set_row_spacings (GTK_TABLE (info->options_table),
info->frame_spacing);
gtk_table_set_col_spacings (GTK_TABLE (info->options_table),
info->frame_spacing * 2);
add (info, 0, "Help", "Quick tips",
G_CALLBACK (help));
add (info, 1, "New Tab", "Create a new, empty tab",
G_CALLBACK (new_tab));
add (info, 2, "Modify tab", "Rename or delete current tab",
G_CALLBACK (mod_tab));
add (info, 3, "Delete", "How to remove other objects",
G_CALLBACK (delete_stuff));
add (info, 4, "Dimensions", "Set rows and columns",
G_CALLBACK (dimensions));
add (info, 5, "Position", "Screen position",
G_CALLBACK (position_options));
add (info, 6, "Behaviour", "On top, sticky, unhide options",
G_CALLBACK (behaviour));
add (info, 7, "About", "",
G_CALLBACK (about));
button = gtk_button_new_with_label ("Cancel");
g_signal_connect (G_OBJECT (button), "clicked", G_CALLBACK (cancel),
info->options_dialog);
gtk_table_attach_defaults (GTK_TABLE (info->options_table), button,
3, 4, 9, 10);
gtk_widget_show_all (info->options_dialog);
}
tabble-0.45/src/icon.c 0000644 0001750 0001750 00000040532 10435540707 011510 0000000 0000000
#include
#include
#include "world.h"
/* XPM */
static const char * tabble_xpm[] = {
"48 48 571 2",
" c None",
". c #000000",
"+ c #010105",
"@ c #060617",
"# c #0B0B2B",
"$ c #050615",
"% c #040410",
"& c #0B0C2D",
"* c #141652",
"= c #242791",
"- c #3337CC",
"; c #1C1D6E",
"> c #020208",
", c #010206",
"' c #090A24",
") c #121348",
"! c #202280",
"~ c #2E32B9",
"{ c #3A3FE9",
"] c #3E43F8",
"^ c #2B2EAB",
"/ c #090A25",
"( c #050616",
"_ c #101141",
": c #1C1F72",
"< c #292CA4",
"[ c #363AD7",
"} c #383CDF",
"| c #010102",
"1 c #020209",
"2 c #0D0E33",
"3 c #191B65",
"4 c #262998",
"5 c #3136C6",
"6 c #3C40EE",
"7 c #3D42F4",
"8 c #1B1D6B",
"9 c #02030A",
"0 c #07081E",
"a c #161758",
"b c #24268F",
"c c #2F33BD",
"d c #383DE1",
"e c #393DE3",
"f c #393EE6",
"g c #3D42F6",
"h c #393EE5",
"i c #2C2FB0",
"j c #1C1F73",
"k c #0B0C2E",
"l c #010106",
"m c #02020A",
"n c #0F103D",
"o c #1F227E",
"p c #2E32BA",
"q c #383CE1",
"r c #3B40EC",
"s c #3033BF",
"t c #2E31B7",
"u c #3B40ED",
"v c #3135C6",
"w c #212486",
"x c #13154D",
"y c #0A0B28",
"z c #03030B",
"A c #080921",
"B c #1A1C69",
"C c #3539D3",
"D c #3A3FE8",
"E c #282BA1",
"F c #181960",
"G c #191C67",
"H c #3438CF",
"I c #3D42F5",
"J c #383DE3",
"K c #151756",
"L c #0A0B29",
"M c #050513",
"N c #010103",
"O c #0F0F10",
"P c #1B1B1E",
"Q c #040404",
"R c #03030C",
"S c #13154C",
"T c #272A9B",
"U c #3439D2",
"V c #3A3EE7",
"W c #3135C4",
"X c #1D2077",
"Y c #0A0B2A",
"Z c #191B67",
"` c #292DA8",
" . c #373CDD",
".. c #3C41F1",
"+. c #3D41F2",
"@. c #3034C0",
"#. c #0B0C2C",
"$. c #020206",
"%. c #050506",
"&. c #212124",
"*. c #4C4C52",
"=. c #6E6E78",
"-. c #6B6B74",
";. c #0E0E0F",
">. c #090A28",
",. c #1F2280",
"'. c #3D42F3",
"). c #282CA4",
"!. c #0F1140",
"~. c #0F113F",
"{. c #212485",
"]. c #3539D6",
"^. c #0E0F39",
"/. c #03040F",
"(. c #020207",
"_. c #000001",
":. c #010101",
"<. c #0D0D0E",
"[. c #3C3C41",
"}. c #686871",
"|. c #80808B",
"1. c #83838F",
"2. c #868692",
"3. c #2D2D31",
"4. c #03030A",
"5. c #07081D",
"6. c #181A61",
"7. c #2D31B7",
"8. c #3E43F7",
"9. c #3438D1",
"0. c #2C30B1",
"a. c #3034C2",
"b. c #3C40EF",
"c. c #3C41F0",
"d. c #292CA6",
"e. c #141550",
"f. c #04040F",
"g. c #2C2C31",
"h. c #5E5E66",
"i. c #848490",
"j. c #878793",
"k. c #5A5A63",
"l. c #030304",
"m. c #03030D",
"n. c #111245",
"o. c #252896",
"p. c #3034BE",
"q. c #3B40EE",
"r. c #383DE0",
"s. c #020200",
"t. c #0A0A03",
"u. c #0F0F04",
"v. c #050501",
"w. c #434349",
"x. c #767680",
"y. c #050505",
"z. c #3135C5",
"A. c #24278F",
"B. c #1B1A07",
"C. c #37350E",
"D. c #6D6A1B",
"E. c #7F7B1F",
"F. c #28270A",
"G. c #222224",
"H. c #7F7F8A",
"I. c #7B7B86",
"J. c #70707A",
"K. c #55555C",
"L. c #2F2F33",
"M. c #0C0C2F",
"N. c #2D31B6",
"O. c #393DE4",
"P. c #3236C8",
"Q. c #282BA0",
"R. c #181A60",
"S. c #080920",
"T. c #131305",
"U. c #32310C",
"V. c #5A5816",
"W. c #9C9827",
"X. c #D9D336",
"Y. c #F8F13E",
"Z. c #E3DD39",
"`. c #545215",
" + c #040401",
".+ c #030303",
"++ c #6D6D77",
"@+ c #7F7F8B",
"#+ c #5B5B63",
"$+ c #3B3B40",
"%+ c #18181A",
"&+ c #212384",
"*+ c #3C41F2",
"=+ c #3438D0",
"-+ c #2A2EAB",
";+ c #1C1E71",
">+ c #0E0F38",
",+ c #030301",
"'+ c #484612",
")+ c #868221",
"!+ c #C2BD31",
"~+ c #F3EC3E",
"{+ c #E9E349",
"]+ c #D8D355",
"^+ c #DBD653",
"/+ c #F1EB42",
"(+ c #8B8722",
"_+ c #151405",
":+ c #3F3F45",
"<+ c #73737E",
"[+ c #5F5F67",
"}+ c #44444A",
"|+ c #252528",
"1+ c #0A0A0B",
"2+ c #131315",
"3+ c #252529",
"4+ c #131316",
"5+ c #141651",
"6+ c #2F33BE",
"7+ c #2D30B2",
"8+ c #202281",
"9+ c #13154E",
"0+ c #06071B",
"a+ c #1D1D07",
"b+ c #201F08",
"c+ c #9D9927",
"d+ c #EDE740",
"e+ c #DCD753",
"f+ c #C9C561",
"g+ c #BDB969",
"h+ c #BAB76C",
"i+ c #CDC95E",
"j+ c #F0E944",
"k+ c #C5C031",
"l+ c #2D2B0B",
"m+ c #141416",
"n+ c #121214",
"o+ c #0C0C0D",
"p+ c #232326",
"q+ c #3D3D43",
"r+ c #595961",
"s+ c #72727C",
"t+ c #07071B",
"u+ c #0A0A02",
"v+ c #3C3A0F",
"w+ c #706D1C",
"x+ c #A39E29",
"y+ c #837F21",
"z+ c #1F1E08",
"A+ c #605D18",
"B+ c #D7D247",
"C+ c #BCB96A",
"D+ c #C1BE67",
"E+ c #D3CE5A",
"F+ c #E6E04B",
"G+ c #EBE43E",
"H+ c #C9C432",
"I+ c #8E8A23",
"J+ c #36363B",
"K+ c #525259",
"L+ c #6B6B75",
"M+ c #82828E",
"N+ c #686872",
"O+ c #09090A",
"P+ c #252409",
"Q+ c #5E5C17",
"R+ c #9B9727",
"S+ c #C3BE31",
"T+ c #E5DF39",
"U+ c #D1CC34",
"V+ c #444211",
"W+ c #191806",
"X+ c #CCC73C",
"Y+ c #E1DB4F",
"Z+ c #EEE843",
"`+ c #DED838",
" @ c #A5A129",
".@ c #6C691B",
"+@ c #3E3C0F",
"@@ c #1A1A06",
"#@ c #101011",
"$@ c #2E2E33",
"%@ c #4D4D54",
"&@ c #666670",
"*@ c #7A7A85",
"=@ c #858591",
"-@ c #27272A",
";@ c #080802",
">@ c #424010",
",@ c #898522",
"'@ c #BBB62F",
")@ c #DBD537",
"!@ c #F3EC3F",
"~@ c #DED951",
"{@ c #C0BD67",
"]@ c #CAC660",
"^@ c #EEE73E",
"/@ c #75711D",
"(@ c #0C0B03",
"_@ c #989426",
":@ c #BAB52E",
"<@ c #7A771E",
"[@ c #403E10",
"}@ c #232209",
"|@ c #040405",
"1@ c #212123",
"2@ c #65656E",
"3@ c #75757F",
"4@ c #828B8C",
"5@ c #729876",
"6@ c #6B9E6C",
"7@ c #838A8E",
"8@ c #82828D",
"9@ c #4C4C53",
"0@ c #0C0C03",
"a@ c #9A9626",
"b@ c #ECE63B",
"c@ c #EBE646",
"d@ c #CCC85F",
"e@ c #AEAB76",
"f@ c #AFAD74",
"g@ c #C6C263",
"h@ c #E2DC4E",
"i@ c #F7F03F",
"j@ c #ACA72B",
"k@ c #212008",
"l@ c #100F04",
"m@ c #1C1C1F",
"n@ c #4E4E56",
"o@ c #71717B",
"p@ c #868891",
"q@ c #7B9082",
"r@ c #64A462",
"s@ c #4EB644",
"t@ c #42C034",
"u@ c #42C033",
"v@ c #7D8F84",
"w@ c #696972",
"x@ c #121213",
"y@ c #79761E",
"z@ c #E8E13A",
"A@ c #CCC85E",
"B@ c #BBB86A",
"C@ c #D8D255",
"D@ c #EBE547",
"E@ c #F2EB43",
"F@ c #E9E23B",
"G@ c #B2AD2C",
"H@ c #585516",
"I@ c #010100",
"J@ c #070708",
"K@ c #28282C",
"L@ c #53535B",
"M@ c #7B9083",
"N@ c #53B14B",
"O@ c #41C132",
"P@ c #3CC52B",
"Q@ c #38C926",
"R@ c #37CA24",
"S@ c #67A266",
"T@ c #868892",
"U@ c #787883",
"V@ c #313135",
"W@ c #3D3B0F",
"X@ c #D2CC34",
"Y@ c #F4ED41",
"Z@ c #F3ED41",
"`@ c #F4ED3F",
" # c #D6CF35",
".# c #817E20",
"+# c #34320D",
"@# c #0D0C03",
"## c #151517",
"$# c #6E6E77",
"%# c #80808C",
" c #868693",
"*# c #7B9182",
"=# c #47BC3A",
"-# c #4DB742",
";# c #858990",
"># c #A7A229",
",# c #E5DE39",
"'# c #9C9726",
")# c #423F10",
"!# c #020202",
"~# c #0E0E10",
"{# c #333338",
"]# c #62626B",
"^# c #868694",
"/# c #848497",
"(# c #7C7DA1",
"_# c #686BBC",
":# c #4F53DF",
"<# c #6466C3",
"[# c #858596",
"}# c #818C8B",
"|# c #5BAB56",
"1# c #7A9182",
"2# c #6A6A74",
"3# c #28260A",
"4# c #151505",
"5# c #262629",
"6# c #505058",
"7# c #878794",
"8# c #81829B",
"9# c #7172B1",
"0# c #5A5CD1",
"a# c #454AEE",
"b# c #4C50E4",
"c# c #868792",
"d# c #6F9B71",
"e# c #3BC729",
"f# c #38C925",
"g# c #3CC62B",
"h# c #40C231",
"i# c #6E9B71",
"j# c #39393E",
"k# c #101012",
"l# c #202023",
"m# c #424248",
"n# c #696973",
"o# c #8C828F",
"p# c #927B89",
"q# c #6A6CBA",
"r# c #7375AD",
"s# c #799280",
"t# c #42C133",
"u# c #4CB742",
"v# c #61A65E",
"w# c #78937E",
"x# c #878792",
"y# c #56565E",
"z# c #0B0B0C",
"A# c #0D0D0F",
"B# c #7B7B85",
"C# c #898491",
"D# c #937A88",
"E# c #A06C7C",
"F# c #B65367",
"G# c #CB3C55",
"H# c #8F7E8C",
"I# c #7677AA",
"J# c #4549EE",
"K# c #5B5ECF",
"L# c #68A167",
"M# c #5BAC55",
"N# c #6F9A73",
"O# c #6C6C75",
"P# c #222225",
"Q# c #9D6F7F",
"R# c #B2586C",
"S# c #CA3D55",
"T# c #E4203E",
"U# c #F50E2E",
"V# c #F80B2C",
"W# c #AC5E71",
"X# c #7E7EA0",
"Y# c #5659D6",
"Z# c #3B3B41",
"`# c #73737D",
" $ c #967685",
".$ c #CB3B54",
"+$ c #F01333",
"@$ c #D1354F",
"#$ c #676ABE",
"$$ c #4045F4",
"%$ c #4A4FE6",
"&$ c #575AD5",
"*$ c #6769BF",
"=$ c #7C7C87",
"-$ c #66666F",
";$ c #4E4E55",
">$ c #81818D",
",$ c #57575F",
"'$ c #111113",
")$ c #937987",
"!$ c #CC3A53",
"~$ c #EB1837",
"{$ c #7576AB",
"]$ c #5155DC",
"^$ c #5457D9",
"/$ c #7173B0",
"($ c #7E7F9F",
"_$ c #868794",
":$ c #787882",
"<$ c #3F3F44",
"[$ c #444449",
"}$ c #242427",
"|$ c #1F1F22",
"1$ c #8A8491",
"2$ c #B45569",
"3$ c #F41030",
"4$ c #82829A",
"5$ c #7778A9",
"6$ c #7B7BA4",
"7$ c #505057",
"8$ c #494950",
"9$ c #3E3E43",
"0$ c #4B4B51",
"a$ c #060607",
"b$ c #A16A7B",
"c$ c #DF2643",
"d$ c #E91A39",
"e$ c #A06B7B",
"f$ c #7D7D88",
"g$ c #404046",
"h$ c #5D5D65",
"i$ c #8F7D8B",
"j$ c #F11232",
"k$ c #D92C48",
"l$ c #B85065",
"m$ c #9E6D7E",
"n$ c #927A89",
"o$ c #72727D",
"p$ c #171719",
"q$ c #888692",
"r$ c #9A7281",
"s$ c #9E6D7D",
"t$ c #797984",
"u$ c #54545B",
"v$ c #29292C",
"w$ c #2E2E32",
"x$ c #777782",
"y$ c #4E4E54",
"z$ c #5F5F68",
"A$ c #56565F",
"B$ c #29292D",
"C$ c #2C2C30",
"D$ c #606069",
"E$ c #35353A",
"F$ c #616169",
"G$ c #83838E",
"H$ c #84848F",
"I$ c #676771",
"J$ c #3D3D42",
"K$ c #303034",
"L$ c #5C5C64",
"M$ c #6D6D76",
"N$ c #18181B",
"O$ c #585860",
"P$ c #49494F",
"Q$ c #868691",
"R$ c #53535A",
"S$ c #515159",
"T$ c #2C2C2F",
"U$ c #4B4B52",
"V$ c #5D5D66",
"W$ c #7E7E89",
"X$ c #333337",
"Y$ c #323237",
"Z$ c #4A4A51",
"`$ c #797983",
" % c #61616A",
".% c #414147",
"+% c #1E1E21",
"@% c #6A6A73",
"#% c #5E5E67",
"$% c #46464D",
"%% c #3A3A3F",
"&% c #5A5A62",
"*% c #4F4F56",
"=% c #343439",
"-% c #19191C",
";% c #313136",
">% c #1A1A1C",
",% c #64646D",
"'% c #060606",
")% c #46464C",
"!% c #6C6C76",
"~% c #2A2A2E",
"{% c #161618",
" ",
" . . . . ",
" . + @ # $ . ",
" . . % & * = - ; > ",
" . . , ' ) ! ~ { ] ] ^ / . ",
" . . . ( _ : < [ ] ] ] ] ] } ) | ",
" . . 1 2 3 4 5 6 ] ] ] ] ] ] ] 7 8 9 ",
" . . . 0 a b c d e f g ] ] ] ] ] h i j k l . ",
" . . . m n o p [ { q r s t u ] ] 7 v w x y z . . . ",
" . . . . A B i C { D E F G H D h I J E K L M N . . O P Q . ",
" . . . R S T U V 7 W X Y Z ` ...+.@.: #.$ $.. . %.&.*.=.-.;.. ",
" . . . . >.,.- r '...).!.~.{.].r '.} b ^./.(._.. :.<.[.}.|.1.2.2.3.:. ",
" . . N 4.5.6.7.I ] 8.9.0.7 c a.b.c.h d.e.f.. . . . %.g.h.i.j.j.j.j.j.j.k.l.. ",
" . . m.n.o.d ] ] ] ] ] .p.q.6 r.s X / . . s.t.u.v.. w.1.j.j.j.j.j.j.j.1.x.y.. ",
" . x q ] ] ] ] ] ] ] '.} z.A.) z . . v.B.C.D.E.F.. G.H.j.j.j.j.i.I.J.K.L.Q . ",
" . M.N.] ] ] ] 8.O.P.Q.R.S._.. . T.U.V.W.X.Y.Z.`. +.+++j.2.@+J.#+$+%+.+. . _.. ",
" f.&+*+] b.=+-+;+>+4.. . . ,+'+)+!+~+{+]+^+/+(+_+. :+<+[+}+|+1+. . .+2+3+4+. ",
" . 5+6+7+8+9+0+. . +a+b+v. +c+d+e+f+g+h+i+j+k+l+. m+3.n+. . . o+p+q+r+s+w.. ",
" . t+_ & > . . u+v+w+x+y+z+. A+B+C+D+E+F+G+H+I+b+. . . . %.P J+K+L+M+j.2.N+O+. ",
" . . . . P+Q+R+S+T+Y.U+V+. W+X+Y+Z+`+ @.@+@@@ +. . #@$@%@&@*@=@j.j.j.j.*@-@. ",
" . ;@>@,@'@)@!@~@{@]@^@/@(@. _@:@<@[@}@u+. . |@1@}+2@3@M+j.j.4@5@6@7@j.8@9@. . ",
" . 0@a@b@c@d@e@f@g@h@i@j@P+. k@P+l@. . . n+m@n@o@H.j.j.p@q@r@s@t@u@v@j.2.w@x@. ",
" s.y@z@A@B@C@D@E@F@G@H@u.. I@. . J@K@L@s+*@1.j.j.j.M@N@O@P@Q@R@R@S@T@j.U@V@. ",
" . W@X@Y@Z@`@ #.#+#@#v.I@. . ##}+$#%#i.j.j.j.j.j.*#=#R@R@R@R@R@-#;#j.i.K+. . ",
" . I@>#,#'#)#. . . !#%.~#{#]#2.j.j.^#/#(#_#:#<#[#j.}#|#R@R@R@R@R@R@1#j.j.2#m@. ",
" . 3#4#I@. :.J@O 5#6#I.j.j.j.7#8#9#0#a#] ] b#8#j.c#d#e#R@R@f#g#h#i#j.j.I.j#:. ",
" . . . y.k#l#m#n#M+j.j.o#p#j.[#q#8.] ] ] ] ] r#j.j.s#-#e#t#u#v#w#x#j.j.j.y#z#. ",
" . . A#J+#+B#j.j.C#D#E#F#G#H#j.I#J#] ] ] ] ] K#j.j.4@L#M#N#4@j.j.j.j.j.j.O#P#. ",
" . P#8@j.j.o#Q#R#S#T#U#V#W#j.X#Y#] ] ] ] ] b#[#j.j.x#c#j.j.j.j.2.I.j.j.H.Z#l. ",
" . z#`#j.j. $.$+$V#V#V#V#@$j./##$$$] $$%$&$*$/#j.j.j.j.j.j.=$-$;$%@>$j.j.,$'$. ",
" . . %@j.j.)$!$V#V#V#V#V#~$ $j.{$]$^$<#/$($_$j.j.j.j.j.:$y#:+<$[$,$>$j.j.s+}$. ",
" . |$j.j.1$2$+$V#V#V#V#3$F#j.4$5$6$/#j.j.j.j.j.j.j.j.J.7$7$8$9$0$j.j.j.1.9$a$ ",
" . J@++j.j.b$c$V#V#V#d$G#e$j.j.j.j.j.j.j.j.j.j.j.j.j.>$f$g$j#%@L+j.j.j.j.h$2+. ",
" !#w.j.j.i$S#j$k$l$m$n$C#j.j.j.j.j.j.j.j.s+j.j.j.j.j.j.J.o$H.j.j.j.j.j.U@|$. ",
" . p$8@j.q$r$s$p#o#j.j.=@%#j.j.j.j.t$u$v$w$t$j.j.j.j.j.j.j.j.j.j.j.x$y$P#%.. ",
" . z#z$j.j.q$q$j.j.i.A$B$C$%#j.j.D$p+E$F$@+2.j.j.j.j.j.j.j.j.G$[+V@O %.:.. ",
" |@J+2.j.j.H$I$J$n+K$L$%#j.j.j.|.i.j.j.j.j.j.j.j.j.i.|.M$<$n+. . . . ",
" . N$3@j.j.F$E$}+-$O$j#P$1.Q$j.j.j.j.j.j.j.j.i.f$o@6#5#Q . . . ",
" . <.R$j.j.H$G$S$T$K$U$V$D$I.j.j.j.j.j.2.W$s+L$E$O . . . ",
" Q X$>$j.j.2.O$R$R$:+Y$Z$`$j.j.j.M+<+ %.%+%y.. . . ",
" . P @%j.M+#%$%%%$+&%x$j.j.=@`$2@U$C$<.. . . ",
" . z#%@j.%#*%7$L+x#j.j.|.@%7$=%-%l.. . ",
" !#;%=$j.H$2.j.2.s+,$[.&.1+. . . ",
" . >%,%j.j.W$]#.%|+x@.+. . ",
" '%)%!%U$~%p$J@. . ",
" . ;.{%z#!#. ",
" . . . . ",
" "};
static const char * blank_xpm[] = {
"48 48 1 1",
" c None",
" ",
" ",
" ",
" ",
" ",
" ",
" ",
" ",
" ",
" ",
" ",
" ",
" ",
" ",
" ",
" ",
" ",
" ",
" ",
" ",
" ",
" ",
" ",
" ",
" ",
" ",
" ",
" ",
" ",
" ",
" ",
" ",
" ",
" ",
" ",
" ",
" ",
" ",
" ",
" ",
" ",
" ",
" ",
" ",
" ",
" ",
" ",
" "};
const char** tabble_icon()
{
return tabble_xpm;
}
const char** blank_icon()
{
return blank_xpm;
}
tabble-0.45/src/edits.c 0000644 0001750 0001750 00000020445 10435540707 011671 0000000 0000000
#include
#include
#include
#include "world.h"
#include "read_line.h"
#include "add_stuff.h"
#include "icons.h"
#include "load_lists.h"
#include "save_lists.h"
#ifdef HAVE_CONFIG_H
#include
#endif
void dismiss_notice (GtkWidget *widget, GtkWidget *dialog)
{
gtk_widget_destroy (dialog);
}
void show_notice (const gchar* text, GtkWidget *parent)
{
GtkWidget *dialog, *table, *label, *button;
GString *string;
string = g_string_new (NULL);
g_string_sprintf (string, "%s message", PACKAGE);
dialog = gtk_dialog_new_with_buttons (string->str,
GTK_WINDOW (parent), GTK_DIALOG_NO_SEPARATOR, NULL);
if (parent)
gtk_window_set_transient_for (GTK_WINDOW (dialog), GTK_WINDOW (parent));
gtk_window_set_modal (GTK_WINDOW (dialog), TRUE);
gtk_container_set_border_width (GTK_CONTAINER (dialog), 5);
table = gtk_table_new (2, 3, FALSE);
gtk_container_add (GTK_CONTAINER (GTK_DIALOG (dialog)->vbox), table);
label = gtk_label_new (text);
gtk_table_attach (GTK_TABLE (table), label, 0, 3, 0, 1,
GTK_SHRINK, GTK_SHRINK, 0, 5);
button = gtk_button_new_with_label ("OK");
g_signal_connect (G_OBJECT (button), "clicked", G_CALLBACK (dismiss_notice),
dialog);
gtk_table_attach (GTK_TABLE (table), button, 1, 2, 2, 3,
GTK_SHRINK, GTK_SHRINK, 0, 5);
gtk_widget_show_all (dialog);
}
void cancel_browse (GtkWidget *widget, world_info *info)
{
gtk_widget_destroy (info->browse_widget);
}
void cancel_edits (GtkWidget *widget, world_info *info)
{
gtk_widget_destroy (info->edits_dialog);
}
void accept_location (GtkWidget *widget, world_info *info)
{
GString *string;
const gchar *text, *dir, *dir_slash, *cmd;
gint diff, offset;
text = gtk_file_selection_get_filename (GTK_FILE_SELECTION (
info->browse_widget));
dir = find_parent_dir (text);
dir_slash = find_parent_dir_slash (text);
if (info->browse_target == bt_cmd)
{
g_string_assign (info->cmd_dir, dir_slash);
diff = strlen (text) - strlen (dir_slash);
if (diff > 0 && diff < strlen (text))
{
gtk_entry_set_text (GTK_ENTRY (info->dir_field), dir);
string = g_string_new (NULL);
offset = strlen (text) - diff;
cmd = &text [offset];
g_string_sprintf (string, "./%s", cmd);
gtk_entry_set_text (GTK_ENTRY (info->cmd_field), string->str);
}
else
{
gtk_entry_set_text (GTK_ENTRY (info->dir_field), "");
gtk_entry_set_text (GTK_ENTRY (info->cmd_field), text);
}
}
else
if (info->browse_target == bt_icon)
{
gtk_entry_set_text (GTK_ENTRY (info->icon_field), text);
g_string_assign (info->icon_dir, find_parent_dir_slash (text));
if (info->icon_image)
gtk_widget_destroy (info->icon_image);
info->icon_image = scaled_icon (text);
if (info->icon_image)
{
gtk_table_attach (GTK_TABLE (info->edits_table), info->icon_image,
2, 3, 4, 5, GTK_SHRINK, GTK_SHRINK, info->icon_x_spacing,
info->icon_y_spacing);
gtk_widget_show (info->icon_image);
}
}
else
g_print ("(debug) world: unknown browse target\n");
gtk_widget_destroy (info->browse_widget);
}
void browse_for_file (world_info *info)
{
GString *dir_name;
if (info->browse_target == bt_cmd)
{
info->browse_widget = gtk_file_selection_new ("Program Location");
gtk_file_selection_set_filename (GTK_FILE_SELECTION (info->browse_widget),
info->cmd_dir->str);
}
else
if (info->browse_target == bt_icon)
{
info->browse_widget = gtk_file_selection_new ("Icon Location");
dir_name = g_string_new (NULL);
g_string_sprintf (dir_name, "%s/", info->icon_dir->str);
gtk_file_selection_set_filename (GTK_FILE_SELECTION (info->browse_widget),
dir_name->str);
}
else
{
g_print ("(debug) world: unknown browse target\n");
return;
}
gtk_window_set_transient_for (GTK_WINDOW (info->browse_widget),
GTK_WINDOW (info->edits_dialog));
gtk_window_set_modal (GTK_WINDOW (info->browse_widget), TRUE);
g_signal_connect (G_OBJECT (info->browse_widget), "destroy",
G_CALLBACK (cancel_browse), info);
g_signal_connect (G_OBJECT (
GTK_FILE_SELECTION (info->browse_widget)->ok_button),
"clicked", G_CALLBACK (accept_location), info);
g_signal_connect (G_OBJECT (
GTK_FILE_SELECTION (info->browse_widget)->cancel_button),
"clicked", G_CALLBACK (cancel_browse), info);
gtk_widget_show (info->browse_widget);
}
void browse_for_cmd (GtkWidget *widget, world_info *info)
{
info->browse_target = bt_cmd;
browse_for_file (info);
}
void browse_for_icon (GtkWidget *widget, world_info *info)
{
info->browse_target = bt_icon;
browse_for_file (info);
}
void save_clicked (GtkWidget *widget, world_info *info)
{
cell_struct *cell;
item_struct *item;
GString *new_name;
cell = info->current_cell;
item = cell->item;
new_name = g_string_new (gtk_entry_get_text (GTK_ENTRY (info->name_field)));
if (!text_here (new_name))
{
gtk_widget_destroy (info->edits_dialog);
return;
}
hide_cell_visibles (cell);
g_string_assign (item->name,
gtk_entry_get_text (GTK_ENTRY (info->name_field)));
g_string_assign (item->dir,
gtk_entry_get_text (GTK_ENTRY (info->dir_field)));
g_string_assign (item->cmd,
gtk_entry_get_text (GTK_ENTRY (info->cmd_field)));
g_string_assign (item->icon,
gtk_entry_get_text (GTK_ENTRY (info->icon_field)));
pinup_item (cell);
gtk_widget_destroy (info->edits_dialog);
save_all (info);
}
void new_text_field (world_info *info, gint row, const gchar *text_label,
GtkWidget **field, const gchar *initial)
{
GtkWidget *label;
label = gtk_label_new (text_label);
gtk_misc_set_alignment (GTK_MISC (label), 0.0, 0.5);
gtk_table_attach_defaults (GTK_TABLE (info->edits_table), label, 0, 1,
row, row + 1);
*field = gtk_entry_new();
gtk_entry_set_text (GTK_ENTRY (*field), initial);
gtk_table_attach_defaults (GTK_TABLE (info->edits_table), *field, 2, 3,
row, row + 1);
}
void edits_dialog (cell_struct *cell)
{
GtkWidget *button;
world_info *info;
item_struct *item;
info = (world_info*) cell->info;
info->current_cell = cell;
item = cell->item;
info->edits_dialog = gtk_dialog_new_with_buttons ("Edit",
GTK_WINDOW (info->main_window), GTK_DIALOG_NO_SEPARATOR, NULL);
gtk_window_set_transient_for (GTK_WINDOW (info->edits_dialog),
GTK_WINDOW (info->main_window));
gtk_window_set_modal (GTK_WINDOW (info->edits_dialog), TRUE);
gtk_container_set_border_width (GTK_CONTAINER (info->edits_dialog),
info->button_spacing);
info->edits_table = gtk_table_new (6, 4, FALSE);
gtk_container_add (GTK_CONTAINER (GTK_DIALOG (info->edits_dialog)->vbox),
info->edits_table);
gtk_table_set_row_spacings (GTK_TABLE (info->edits_table),
info->button_spacing);
gtk_table_set_col_spacings (GTK_TABLE (info->edits_table),
info->button_spacing);
new_text_field (info, 0, "Name:", &info->name_field, item->name->str);
new_text_field (info, 1, "Dir:", &info->dir_field, item->dir->str);
new_text_field (info, 2, "Command:", &info->cmd_field, item->cmd->str);
new_text_field (info, 3, "Icon:", &info->icon_field, item->icon->str);
button = gtk_button_new_with_label ("OK");
g_signal_connect (G_OBJECT (button), "clicked", G_CALLBACK (save_clicked),
info);
gtk_table_attach (GTK_TABLE (info->edits_table), button, 3, 4, 0, 1,
GTK_FILL, GTK_SHRINK, 0, 0);
button = gtk_button_new_with_label ("Browse");
g_signal_connect (G_OBJECT (button), "clicked", G_CALLBACK (browse_for_cmd),
info);
gtk_table_attach (GTK_TABLE (info->edits_table), button, 3, 4, 1, 3,
GTK_FILL, GTK_SHRINK, 0, 0);
button = gtk_button_new_with_label ("Browse");
g_signal_connect (G_OBJECT (button), "clicked", G_CALLBACK (browse_for_icon),
info);
gtk_table_attach (GTK_TABLE (info->edits_table), button, 3, 4, 3, 4,
GTK_FILL, GTK_SHRINK, 0, 0);
info->icon_image = gtk_image_new_from_file (item->icon->str);
gtk_table_attach (GTK_TABLE (info->edits_table), info->icon_image,
2, 3, 4, 5, GTK_SHRINK, GTK_SHRINK,
info->icon_x_spacing, info->icon_y_spacing);
button = gtk_button_new_with_label ("Cancel");
g_signal_connect (G_OBJECT (button), "clicked", G_CALLBACK (cancel_edits),
info);
gtk_table_attach_defaults (GTK_TABLE (info->edits_table), button,
3, 4, 5, 6);
gtk_widget_show_all (info->edits_dialog);
}
tabble-0.45/src/choices.c 0000644 0001750 0001750 00000017741 12331070256 012175 0000000 0000000
#include
#include
#include
#include
#include
#include
#include "world.h"
#include "load_lists.h"
#include "add_stuff.h"
#include "edits.h"
#include "options.h"
#include "signals.h"
#include "icon.h"
#include "save_lists.h"
#include "read_line.h"
void world_hide (GtkWidget *widget, world_info *info)
{
info->last_tab = gtk_notebook_get_current_page (GTK_NOTEBOOK (info->tabs));
gtk_widget_hide_all (GTK_WIDGET (info->main_window));
}
void show_edit_buttons (world_info *info, gboolean show_buttons)
{
cell_struct *cell;
gint t, x, y;
for (t = 0; t < info->tab_count; t++)
for (y = 0; y < info->y_icons; y++)
for (x = 0; x < info->x_icons; x++)
{
cell = get_grid (info, t, x, y);
if (cell->filled == FALSE)
{
if (show_buttons)
push_blank_cell (info, t, x, y);
else
show_empty_cell (info, t, x, y);
}
else
{
if (cell->button)
{
if (show_buttons)
gtk_button_set_relief (GTK_BUTTON (cell->button), GTK_RELIEF_NORMAL);
else
gtk_button_set_relief (GTK_BUTTON (cell->button), GTK_RELIEF_NONE);
}
}
}
info->blanks_shown = show_buttons;
}
gboolean key_event (GtkWidget *widget, GdkEventKey *event, world_info *info)
{
gboolean key = FALSE;
if ((event->keyval == GDK_Escape) && (event->type == GDK_KEY_RELEASE))
{
world_hide (widget, info);
return FALSE;
}
if ((event->keyval == GDK_Shift_L) || (event->keyval == GDK_Shift_R))
key = TRUE;
if (!key)
return FALSE;
key = event->type == GDK_KEY_PRESS ? TRUE : FALSE;
if (key == info->blanks_shown)
return FALSE;
show_edit_buttons (info, key);
return FALSE;
}
void options (GtkWidget *widget, world_info *info)
{
show_edit_buttons (info, FALSE);
options_dialog (info);
}
void my_chdir (const gchar *dir)
{
if (dir && (strcmp (dir, "") != 0))
{
if (chdir (dir))
g_print ("invalid directory: %s\n", dir);
}
}
int run_the_program (cell_struct *cell)
{
world_info *info;
GString *string;
int sys_result;
info = (world_info*) cell->info;
my_chdir (cell->item->dir->str);
string = g_string_new (NULL);
g_string_sprintf (string, "%s &", cell->item->cmd->str);
sys_result = system (string->str);
my_chdir (info->pwd_dir->str);
if (cell->icon_button)
gtk_button_set_relief (GTK_BUTTON (cell->icon_button), GTK_RELIEF_NONE);
return sys_result;
}
void popup_edits (GtkWidget *widget, cell_struct *cell)
{
show_edit_buttons ((world_info*) cell->info, FALSE);
edits_dialog (cell);
}
void popup_select (GtkWidget *widget, cell_struct *cell)
{
world_info *info;
info = (world_info*) cell->info;
show_edit_buttons (info, FALSE);
info->selected_cell = cell;
}
void popup_copy (GtkWidget *widget, cell_struct *cell)
{
world_info *info;
info = (world_info*) cell->info;
show_edit_buttons ((world_info*) cell->info, FALSE);
copy_item (info->selected_cell->item, cell->item);
pinup_item (cell);
save_all (info);
}
void popup_delete (GtkWidget *widget, cell_struct *cell)
{
world_info *info;
info = (world_info*) cell->info;
g_string_assign (cell->item->name, "");
g_string_assign (cell->item->cmd, "");
g_string_assign (cell->item->icon, "");
cell->filled = FALSE;
show_edit_buttons (info, FALSE);
info->selected_cell = NULL;
save_all (info);
}
void right_click_button (GdkEventButton *event, cell_struct *cell)
{
GtkWidget *menu, *menuitem;
world_info *info;
info = (world_info*) cell->info;
show_edit_buttons (info, FALSE);
menu = gtk_menu_new();
menuitem = gtk_menu_item_new_with_label ("Edit");
g_signal_connect (menuitem, "activate", G_CALLBACK (popup_edits), cell);
gtk_menu_shell_append (GTK_MENU_SHELL (menu), menuitem);
if (cell->filled)
{
menuitem = gtk_menu_item_new_with_label ("Copy this source");
g_signal_connect (menuitem, "activate", G_CALLBACK (popup_select), cell);
gtk_menu_shell_append (GTK_MENU_SHELL (menu), menuitem);
}
if (info->selected_cell && cell != info->selected_cell)
{
menuitem = gtk_menu_item_new_with_label ("Copy here");
g_signal_connect (menuitem, "activate", G_CALLBACK (popup_copy), cell);
gtk_menu_shell_append (GTK_MENU_SHELL (menu), menuitem);
}
if (cell->filled)
{
menuitem = gtk_menu_item_new_with_label ("Delete");
g_signal_connect (menuitem, "activate", G_CALLBACK (popup_delete), cell);
gtk_menu_shell_append (GTK_MENU_SHELL (menu), menuitem);
}
gtk_widget_show_all (menu);
gtk_menu_popup (GTK_MENU (menu), NULL, NULL, NULL, NULL,
(event != NULL) ? event->button : 0,
gdk_event_get_time ((GdkEvent*) event));
}
gboolean click_enter (GtkWidget *widget, GdkEventButton *event,
cell_struct *cell)
{
world_info *info;
info = (world_info*) cell->info;
info->entered_cell = cell;
return FALSE;
}
gboolean click_leave (GtkWidget *widget, GdkEventButton *event,
cell_struct *cell)
{
world_info *info;
info = (world_info*) cell->info;
info->entered_cell = NULL;
return FALSE;
}
gboolean click_press (GtkWidget *widget, GdkEventButton *event,
cell_struct *cell)
{
world_info *info;
info = (world_info*) cell->info;
if (event->button > 3)
return TRUE;
if (!info->options_enabled && event->button == 3)
return TRUE;
if (!cell->filled && event->button != 3)
return TRUE;
info->pressed_cell = info->entered_cell = cell;
gtk_button_pressed (GTK_BUTTON (cell->button));
return FALSE;
}
gboolean click_release (GtkWidget *widget, GdkEventButton *event,
cell_struct *cell)
{
world_info *info;
info = (world_info*) cell->info;
if (info->pressed_cell && (info->pressed_cell = info->entered_cell))
{
gtk_button_released (GTK_BUTTON (info->pressed_cell->button));
switch (event->button)
{
case 1:
if (cell->filled)
run_the_program (cell);
break;
case 2:
if (cell->filled)
{
world_hide (NULL, info);
run_the_program (cell);
}
break;
case 3:
right_click_button (event, cell);
break;
}
}
info->pressed_cell = info->entered_cell = NULL;
return FALSE;
}
gboolean key_activate (GtkWidget *widget, cell_struct *cell)
{
world_info *info;
info = (world_info*) cell->info;
world_hide (NULL, info);
run_the_program (cell);
return FALSE;
}
void choices (world_info *info)
{
GtkWidget *vbox, *hbox, *button;
g_signal_connect (G_OBJECT (info->main_window), "destroy",
G_CALLBACK (gtk_main_quit), info);
gtk_container_set_border_width (GTK_CONTAINER (info->main_window),
info->frame_spacing);
gtk_window_set_default_icon (gdk_pixbuf_new_from_xpm_data (tabble_icon()));
vbox = gtk_vbox_new (FALSE, 0);
gtk_container_add (GTK_CONTAINER (info->main_window), vbox);
info->tabs = gtk_notebook_new();
gtk_notebook_set_tab_pos (GTK_NOTEBOOK (info->tabs), GTK_POS_TOP);
gtk_notebook_set_scrollable (GTK_NOTEBOOK (info->tabs), TRUE);
load_settings (info);
gtk_box_pack_start (GTK_BOX (vbox), info->tabs, FALSE, FALSE, 0);
hbox = gtk_hbox_new (FALSE, 0);
gtk_box_pack_start (GTK_BOX (vbox), hbox, FALSE, FALSE, info->frame_spacing);
if (info->options_enabled)
{
button = gtk_button_new_with_label (" Options ");
gtk_box_pack_start (GTK_BOX (hbox), button, FALSE, FALSE, 0);
g_signal_connect (G_OBJECT (button), "clicked",
G_CALLBACK (options), info);
}
button = gtk_button_new_with_label (" Hide ");
gtk_box_pack_end (GTK_BOX (hbox), button, FALSE, FALSE, 0);
g_signal_connect (G_OBJECT (button), "clicked",
G_CALLBACK (world_hide), info);
signal_init (info);
if (info->options_enabled)
{
g_signal_connect (G_OBJECT (info->main_window), "key-press-event",
G_CALLBACK (key_event), info);
g_signal_connect (G_OBJECT (info->main_window), "key-release-event",
G_CALLBACK (key_event), info);
}
gtk_widget_show_all (info->main_window);
show_edit_buttons (info, FALSE);
}
tabble-0.45/src/add_stuff.c 0000644 0001750 0001750 00000026424 13724075277 012534 0000000 0000000
#include
#include
#include "world.h"
#include "choices.h"
#include "read_line.h"
#include "icon.h"
#include "icons.h"
static const gchar blank_spaces[] = " "; /* for a blank button */
const gchar* fragment (world_info *info, const gchar *text)
{
gchar *output;
gint max_line, size, index, base, last_space;
output = g_string_new (text)->str;
max_line = info->max_line;
size = strlen (text);
base = 0;
last_space = -1;
for (index = 0; index < size; index++)
{
if (output [index] == ' ')
{
if (index - base > max_line)
{
if (last_space > base)
{
output [last_space] = '\n';
base = last_space;
}
else
{
output [index] = '\n';
base = index;
}
}
last_space = index;
}
}
return output;
}
void zero_item (item_struct *item)
{
item->name = g_string_new (NULL);
item->dir = g_string_new (NULL);
item->cmd = g_string_new (NULL);
item->icon = g_string_new (NULL);
item->x_pos = item->y_pos = -1;
}
void free_item (item_struct *item)
{
g_string_free (item->name, TRUE);
g_string_free (item->dir, TRUE);
g_string_free (item->cmd, TRUE);
g_string_free (item->icon, TRUE);
}
void copy_item (const item_struct *src, item_struct *dest)
{
g_string_assign (dest->name, src->name->str);
g_string_assign (dest->dir, src->dir->str);
g_string_assign (dest->cmd, src->cmd->str);
g_string_assign (dest->icon, src->icon->str);
}
cell_struct* get_grid (world_info *info, gint tab_number, gint x, gint y)
{
tab_struct *tab;
cell_struct *cells;
tab = (tab_struct*) g_list_nth (info->tab_list, tab_number)->data;
cells = (cell_struct*) tab->cell_array;
return &cells [y * info->x_icons + x];
}
void setup_cell (world_info *info, gint tab_number, gint x, gint y)
{
item_struct *item;
cell_struct *cell;
cell = get_grid (info, tab_number, x, y);
cell->info = (struct world_info*) info;
cell->tab_pos = tab_number;
cell->filled = FALSE;
cell->icon_image = cell->button = cell->label = NULL;
item = g_malloc0 (sizeof (item_struct));
item->name = g_string_new (NULL);
item->dir = g_string_new (NULL);
item->cmd = g_string_new (NULL);
item->icon = g_string_new (NULL);
item->x_pos = x;
item->y_pos = y;
cell->item = item;
}
void connect_cell (cell_struct *cell)
{
g_signal_connect (G_OBJECT (cell->button), "activate",
G_CALLBACK (key_activate), cell);
g_signal_connect (G_OBJECT (cell->button), "button-press-event",
G_CALLBACK (click_press), cell);
g_signal_connect (G_OBJECT (cell->button), "button-release-event",
G_CALLBACK (click_release), cell);
g_signal_connect (G_OBJECT (cell->button), "enter-notify-event",
G_CALLBACK (click_enter), cell);
g_signal_connect (G_OBJECT (cell->button), "leave-notify-event",
G_CALLBACK (click_leave), cell);
if (cell->icon_button)
{
g_signal_connect (G_OBJECT (cell->icon_button), "activate",
G_CALLBACK (key_activate), cell);
g_signal_connect (G_OBJECT (cell->icon_button), "button-press-event",
G_CALLBACK (click_press), cell);
g_signal_connect (G_OBJECT (cell->icon_button), "button-release-event",
G_CALLBACK (click_release), cell);
g_signal_connect (G_OBJECT (cell->icon_button), "enter-notify-event",
G_CALLBACK (click_enter), cell);
g_signal_connect (G_OBJECT (cell->icon_button), "leave-notify-event",
G_CALLBACK (click_leave), cell);
}
}
void hide_cell_visibles (cell_struct *cell)
{
if (cell->icon_image)
gtk_widget_destroy (cell->icon_image);
if (cell->button)
gtk_widget_destroy (cell->button);
if (cell->icon_button)
gtk_widget_destroy (cell->icon_button);
if (cell->label)
gtk_widget_destroy (cell->label);
cell->icon_image = cell->button = cell->icon_button = cell->label = NULL;
}
void show_empty_cell (world_info *info, gint tab_number, gint x, gint y)
{
GdkPixbuf *pix_buf;
tab_struct *tab;
cell_struct *cell;
tab = (tab_struct*) g_list_nth (info->tab_list, tab_number)->data;
cell = get_grid (info, tab_number, x, y);
hide_cell_visibles (cell);
pix_buf = gdk_pixbuf_new_from_xpm_data (blank_icon());
if (pix_buf)
{
cell->icon_image = gtk_image_new_from_pixbuf (pix_buf);
if (cell->icon_image)
{
gtk_table_attach (GTK_TABLE (tab->box_widget), cell->icon_image,
x, x+1, y*3, y*3+1, GTK_FILL, GTK_FILL,
0, 0);
gtk_widget_show (cell->icon_image);
}
g_object_unref (pix_buf);
}
cell->button = gtk_button_new_with_label (blank_spaces);
gtk_table_attach (GTK_TABLE (tab->box_widget), cell->button,
x, x+1, y*3+1, y*3+2, GTK_SHRINK, GTK_SHRINK,
0, 0);
gtk_widget_hide (cell->button); /* yes a hide */
/* if the above is made show, widget sizes become correct */
}
void push_blank_cell (world_info *info, gint tab_number, gint x, gint y)
{
GdkPixbuf *pix_buf;
cell_struct *cell;
tab_struct *tab;
tab = (tab_struct*) g_list_nth (info->tab_list, tab_number)->data;
cell = get_grid (info, tab_number, x, y);
hide_cell_visibles (cell);
pix_buf = gdk_pixbuf_new_from_xpm_data (blank_icon());
if (pix_buf)
{
cell->icon_image = gtk_image_new_from_pixbuf (pix_buf);
if (cell->icon_image)
{
gtk_table_attach (GTK_TABLE (tab->box_widget), cell->icon_image,
x, x+1, y*3, y*3+1, GTK_FILL, GTK_FILL,
0, 0);
gtk_widget_show (cell->icon_image);
}
g_object_unref (pix_buf);
}
cell->button = gtk_button_new_with_label (blank_spaces);
gtk_table_attach (GTK_TABLE (tab->box_widget), cell->button,
x, x+1, y*3+1, y*3+2, GTK_SHRINK, GTK_SHRINK,
0, 0);
gtk_widget_show (cell->button);
cell->icon_image = NULL;
connect_cell (cell);
}
cell_struct* first_blank (world_info *info, gint tab_number)
{
cell_struct *cell;
gint x, y;
for (y = 0; y < info->y_icons; y++)
for (x = 0; x < info->x_icons; x++)
{
cell = get_grid (info, tab_number, x, y);
if (!cell->filled)
return cell;
}
return NULL;
}
gint add_tab (world_info *info, const gchar *name)
{
GtkWidget *label, *table;
tab_struct *tab;
gint tab_number, x, y;
label = gtk_label_new (name);
gtk_widget_show (label);
table = gtk_table_new (info->y_icons * 3, info->x_icons, FALSE);
gtk_widget_show (table);
gtk_container_set_border_width (GTK_CONTAINER (table), info->frame_spacing);
gtk_table_set_row_spacings (GTK_TABLE (table), info->icon_y_spacing);
gtk_table_set_col_spacings (GTK_TABLE (table), info->icon_x_spacing);
gtk_notebook_append_page (GTK_NOTEBOOK (info->tabs), table, label);
tab_number = info->tab_count++; /* note order */
tab = g_malloc0 (sizeof (tab_struct));
tab->tab_name = g_string_new (name);
tab->box_widget = table;
info->tab_list = g_list_append (info->tab_list, tab);
tab->cell_array = g_malloc0
(sizeof (cell_struct) * info->x_icons * info->y_icons);
for (y = 0; y < info->y_icons; y++)
{
for (x = 0; x < info->x_icons; x++)
{
setup_cell (info, tab_number, x, y);
show_empty_cell (info, tab_number, x, y);
label = gtk_label_new (" ");
gtk_table_attach_defaults (GTK_TABLE (table), label,
x, x+1, y*3+2, y*3+3);
gtk_widget_show (label);
}
}
return tab_number;
}
void del_tab (world_info *info, gint tab_number)
{
cell_struct *cell;
tab_struct *tab;
gint x, y;
for (y = 0; y < info->y_icons; y++)
for (x = 0; x < info->x_icons; x++)
{
cell = get_grid (info, tab_number, x, y);
hide_cell_visibles (cell);
free_item (cell->item);
}
gtk_notebook_remove_page (GTK_NOTEBOOK (info->tabs), tab_number);
tab = (tab_struct*) g_list_nth (info->tab_list, tab_number)->data;
g_string_free (tab->tab_name, TRUE);
g_free (tab->cell_array);
g_free (tab);
info->tab_list = g_list_remove (info->tab_list,
(tab_struct*) g_list_nth (info->tab_list, tab_number)->data);
info->tab_count--;
if (info->tab_count > 0)
{
if (tab_number >= info->tab_count)
tab_number = info->tab_count - 1;
gtk_notebook_set_current_page (GTK_NOTEBOOK (info->tabs), tab_number);
}
}
void pinup_item (cell_struct *cell)
{
GtkWidget *label;
GdkPixbuf *pix_buf;
GString *icon_file;
world_info *info;
item_struct *item;
tab_struct *tab;
gint x, y;
info = (world_info*) cell->info;
item = cell->item;
hide_cell_visibles (cell);
tab = (tab_struct*) g_list_nth (info->tab_list, cell->tab_pos)->data;
icon_file = g_string_new (NULL);
x = item->x_pos;
y = item->y_pos * 3;
if (!text_here (item->icon))
g_string_assign (icon_file, "");
else
{
if ((item->icon->str [0] == '/') || (item->icon->str [0] == '.'))
g_string_assign (icon_file, item->icon->str);
else
g_string_sprintf (icon_file, "%s/%s", info->icon_dir->str,
item->icon->str);
}
cell->icon_image = scaled_icon (icon_file->str);
if (!cell->icon_image)
{
pix_buf = gdk_pixbuf_new_from_xpm_data (blank_icon());
cell->icon_image = gtk_image_new_from_pixbuf (pix_buf);
cell->icon_button = NULL;
gtk_table_attach (GTK_TABLE (tab->box_widget), cell->icon_image,
x, x+1, y, y+1, GTK_SHRINK, GTK_SHRINK, 0, 0);
gtk_widget_show (cell->icon_image);
}
else
{
cell->icon_button = gtk_button_new();
gtk_container_add (GTK_CONTAINER (cell->icon_button), cell->icon_image);
gtk_button_set_relief (GTK_BUTTON (cell->icon_button), GTK_RELIEF_NONE);
gtk_table_attach (GTK_TABLE (tab->box_widget), cell->icon_button,
x, x+1, y, y+1, GTK_SHRINK, GTK_SHRINK, 0, 0);
gtk_widget_show (cell->icon_image);
gtk_widget_show (cell->icon_button);
}
cell->button = gtk_button_new();
if (text_here (item->name))
label = gtk_label_new (fragment (info, item->name->str));
else
label = gtk_label_new ("");
gtk_label_set_justify (GTK_LABEL (label), GTK_JUSTIFY_CENTER);
gtk_container_add (GTK_CONTAINER (cell->button), label);
gtk_button_set_relief (GTK_BUTTON (cell->button), GTK_RELIEF_NONE);
connect_cell (cell);
gtk_table_attach (GTK_TABLE (tab->box_widget), cell->button,
x, x+1, y+1, y+2, GTK_SHRINK, GTK_SHRINK, 0, 0);
gtk_widget_show (label);
gtk_widget_show (cell->button);
cell->filled = TRUE;
}
void add_item (world_info *info, const item_struct *source, gint tab_number)
{
cell_struct *cell = NULL;
item_struct *item;
gboolean guess;
guess = FALSE;
if (source->x_pos < 0 || source->y_pos < 0)
{
g_print ("error: no x y doing %s\n", source->name->str);
guess = TRUE;
}
if (source->x_pos >= info->x_icons || source->y_pos >= info->y_icons)
{
g_print ("error: grid location out of range doing %s\n", source->name->str);
guess = TRUE;
}
if (guess == FALSE)
{
cell = get_grid (info, tab_number, source->x_pos, source->y_pos);
if (cell->filled)
{
g_print ("error: space already exists doing %s\n", source->name->str);
guess = TRUE;
}
}
if (guess == TRUE)
{
cell = first_blank (info, tab_number);
if (cell == NULL)
{
g_print ("error: ran out of table spacing doing %s\n", source->name->str);
return;
}
}
item = cell->item;
g_string_assign (item->name, source->name->str);
g_string_assign (item->dir, source->dir->str);
g_string_assign (item->cmd, source->cmd->str);
g_string_assign (item->icon, source->icon->str);
cell->filled = TRUE;
pinup_item (cell);
}
tabble-0.45/src/Makefile.in 0000644 0001750 0001750 00000044143 13726332523 012464 0000000 0000000 # Makefile.in generated by automake 1.15 from Makefile.am.
# @configure_input@
# Copyright (C) 1994-2014 Free Software Foundation, Inc.
# This Makefile.in is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
# with or without modifications, as long as this notice is preserved.
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
# PARTICULAR PURPOSE.
@SET_MAKE@
VPATH = @srcdir@
am__is_gnu_make = { \
if test -z '$(MAKELEVEL)'; then \
false; \
elif test -n '$(MAKE_HOST)'; then \
true; \
elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \
true; \
else \
false; \
fi; \
}
am__make_running_with_option = \
case $${target_option-} in \
?) ;; \
*) echo "am__make_running_with_option: internal error: invalid" \
"target option '$${target_option-}' specified" >&2; \
exit 1;; \
esac; \
has_opt=no; \
sane_makeflags=$$MAKEFLAGS; \
if $(am__is_gnu_make); then \
sane_makeflags=$$MFLAGS; \
else \
case $$MAKEFLAGS in \
*\\[\ \ ]*) \
bs=\\; \
sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \
| sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \
esac; \
fi; \
skip_next=no; \
strip_trailopt () \
{ \
flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \
}; \
for flg in $$sane_makeflags; do \
test $$skip_next = yes && { skip_next=no; continue; }; \
case $$flg in \
*=*|--*) continue;; \
-*I) strip_trailopt 'I'; skip_next=yes;; \
-*I?*) strip_trailopt 'I';; \
-*O) strip_trailopt 'O'; skip_next=yes;; \
-*O?*) strip_trailopt 'O';; \
-*l) strip_trailopt 'l'; skip_next=yes;; \
-*l?*) strip_trailopt 'l';; \
-[dEDm]) skip_next=yes;; \
-[JT]) skip_next=yes;; \
esac; \
case $$flg in \
*$$target_option*) has_opt=yes; break;; \
esac; \
done; \
test $$has_opt = yes
am__make_dryrun = (target_option=n; $(am__make_running_with_option))
am__make_keepgoing = (target_option=k; $(am__make_running_with_option))
pkgdatadir = $(datadir)/@PACKAGE@
pkgincludedir = $(includedir)/@PACKAGE@
pkglibdir = $(libdir)/@PACKAGE@
pkglibexecdir = $(libexecdir)/@PACKAGE@
am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
install_sh_DATA = $(install_sh) -c -m 644
install_sh_PROGRAM = $(install_sh) -c
install_sh_SCRIPT = $(install_sh) -c
INSTALL_HEADER = $(INSTALL_DATA)
transform = $(program_transform_name)
NORMAL_INSTALL = :
PRE_INSTALL = :
POST_INSTALL = :
NORMAL_UNINSTALL = :
PRE_UNINSTALL = :
POST_UNINSTALL = :
bin_PROGRAMS = tabble$(EXEEXT)
subdir = src
ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
am__aclocal_m4_deps = $(top_srcdir)/configure.ac
am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
$(ACLOCAL_M4)
DIST_COMMON = $(srcdir)/Makefile.am $(noinst_HEADERS) \
$(am__DIST_COMMON)
mkinstalldirs = $(install_sh) -d
CONFIG_HEADER = $(top_builddir)/config.h
CONFIG_CLEAN_FILES =
CONFIG_CLEAN_VPATH_FILES =
am__installdirs = "$(DESTDIR)$(bindir)"
PROGRAMS = $(bin_PROGRAMS)
am_tabble_OBJECTS = add_stuff.$(OBJEXT) choices.$(OBJEXT) \
edits.$(OBJEXT) icon.$(OBJEXT) options.$(OBJEXT) \
read_line.$(OBJEXT) tabble.$(OBJEXT) load_lists.$(OBJEXT) \
save_lists.$(OBJEXT) signals.$(OBJEXT) icons.$(OBJEXT)
tabble_OBJECTS = $(am_tabble_OBJECTS)
tabble_LDADD = $(LDADD)
AM_V_P = $(am__v_P_@AM_V@)
am__v_P_ = $(am__v_P_@AM_DEFAULT_V@)
am__v_P_0 = false
am__v_P_1 = :
AM_V_GEN = $(am__v_GEN_@AM_V@)
am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@)
am__v_GEN_0 = @echo " GEN " $@;
am__v_GEN_1 =
AM_V_at = $(am__v_at_@AM_V@)
am__v_at_ = $(am__v_at_@AM_DEFAULT_V@)
am__v_at_0 = @
am__v_at_1 =
DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir)
depcomp = $(SHELL) $(top_srcdir)/depcomp
am__depfiles_maybe = depfiles
am__mv = mv -f
COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \
$(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
AM_V_CC = $(am__v_CC_@AM_V@)
am__v_CC_ = $(am__v_CC_@AM_DEFAULT_V@)
am__v_CC_0 = @echo " CC " $@;
am__v_CC_1 =
CCLD = $(CC)
LINK = $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@
AM_V_CCLD = $(am__v_CCLD_@AM_V@)
am__v_CCLD_ = $(am__v_CCLD_@AM_DEFAULT_V@)
am__v_CCLD_0 = @echo " CCLD " $@;
am__v_CCLD_1 =
SOURCES = $(tabble_SOURCES)
DIST_SOURCES = $(tabble_SOURCES)
am__can_run_installinfo = \
case $$AM_UPDATE_INFO_DIR in \
n|no|NO) false;; \
*) (install-info --version) >/dev/null 2>&1;; \
esac
HEADERS = $(noinst_HEADERS)
am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP)
# Read a list of newline-separated strings from the standard input,
# and print each of them once, without duplicates. Input order is
# *not* preserved.
am__uniquify_input = $(AWK) '\
BEGIN { nonempty = 0; } \
{ items[$$0] = 1; nonempty = 1; } \
END { if (nonempty) { for (i in items) print i; }; } \
'
# Make sure the list of sources is unique. This is necessary because,
# e.g., the same source file might be shared among _SOURCES variables
# for different programs/libraries.
am__define_uniq_tagged_files = \
list='$(am__tagged_files)'; \
unique=`for i in $$list; do \
if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
done | $(am__uniquify_input)`
ETAGS = etags
CTAGS = ctags
am__DIST_COMMON = $(srcdir)/Makefile.in $(top_srcdir)/depcomp
DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
ACLOCAL = @ACLOCAL@
AMTAR = @AMTAR@
AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@
AUTOCONF = @AUTOCONF@
AUTOHEADER = @AUTOHEADER@
AUTOMAKE = @AUTOMAKE@
AWK = @AWK@
CC = @CC@
CCDEPMODE = @CCDEPMODE@
CFLAGS = @CFLAGS@
CPP = @CPP@
CPPFLAGS = @CPPFLAGS@
CYGPATH_W = @CYGPATH_W@
DEFS = @DEFS@
DEPDIR = @DEPDIR@
ECHO_C = @ECHO_C@
ECHO_N = @ECHO_N@
ECHO_T = @ECHO_T@
EGREP = @EGREP@
EXEEXT = @EXEEXT@
GREP = @GREP@
GTK_CFLAGS = @GTK_CFLAGS@
GTK_LIBS = @GTK_LIBS@
INSTALL = @INSTALL@
INSTALL_DATA = @INSTALL_DATA@
INSTALL_PROGRAM = @INSTALL_PROGRAM@
INSTALL_SCRIPT = @INSTALL_SCRIPT@
INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
LDFLAGS = @LDFLAGS@
LIBOBJS = @LIBOBJS@
LIBS = `pkg-config --libs gtk+-2.0`
LTLIBOBJS = @LTLIBOBJS@
MAKEINFO = @MAKEINFO@
MKDIR_P = @MKDIR_P@
OBJEXT = @OBJEXT@
PACKAGE = @PACKAGE@
PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
PACKAGE_NAME = @PACKAGE_NAME@
PACKAGE_STRING = @PACKAGE_STRING@
PACKAGE_TARNAME = @PACKAGE_TARNAME@
PACKAGE_URL = @PACKAGE_URL@
PACKAGE_VERSION = @PACKAGE_VERSION@
PATH_SEPARATOR = @PATH_SEPARATOR@
PKG_CONFIG = @PKG_CONFIG@
PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@
PKG_CONFIG_PATH = @PKG_CONFIG_PATH@
SET_MAKE = @SET_MAKE@
SHELL = @SHELL@
STRIP = @STRIP@
VERSION = @VERSION@
abs_builddir = @abs_builddir@
abs_srcdir = @abs_srcdir@
abs_top_builddir = @abs_top_builddir@
abs_top_srcdir = @abs_top_srcdir@
ac_ct_CC = @ac_ct_CC@
am__include = @am__include@
am__leading_dot = @am__leading_dot@
am__quote = @am__quote@
am__tar = @am__tar@
am__untar = @am__untar@
bindir = @bindir@
build_alias = @build_alias@
builddir = @builddir@
datadir = @datadir@
datarootdir = @datarootdir@
docdir = @docdir@
dvidir = @dvidir@
exec_prefix = @exec_prefix@
host_alias = @host_alias@
htmldir = @htmldir@
includedir = @includedir@
infodir = @infodir@
install_sh = @install_sh@
libdir = @libdir@
libexecdir = @libexecdir@
localedir = @localedir@
localstatedir = @localstatedir@
mandir = @mandir@
mkdir_p = @mkdir_p@
oldincludedir = @oldincludedir@
pdfdir = @pdfdir@
prefix = @prefix@
program_transform_name = @program_transform_name@
psdir = @psdir@
runstatedir = @runstatedir@
sbindir = @sbindir@
sharedstatedir = @sharedstatedir@
srcdir = @srcdir@
sysconfdir = @sysconfdir@
target_alias = @target_alias@
top_build_prefix = @top_build_prefix@
top_builddir = @top_builddir@
top_srcdir = @top_srcdir@
AM_CPPFLAGS = $(GTK_CFLAGS)
AM_CFLAGS = -O2 `pkg-config --cflags gtk+-2.0`
tabble_SOURCES = add_stuff.c choices.c edits.c icon.c options.c read_line.c \
tabble.c load_lists.c save_lists.c signals.c icons.c
noinst_HEADERS = add_stuff.h choices.h edits.h icon.h options.h read_line.h \
world.h load_lists.h save_lists.h signals.h icons.h
all: all-am
.SUFFIXES:
.SUFFIXES: .c .o .obj
$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps)
@for dep in $?; do \
case '$(am__configure_deps)' in \
*$$dep*) \
( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \
&& { if test -f $@; then exit 0; else break; fi; }; \
exit 1;; \
esac; \
done; \
echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu src/Makefile'; \
$(am__cd) $(top_srcdir) && \
$(AUTOMAKE) --gnu src/Makefile
Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
@case '$?' in \
*config.status*) \
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
*) \
echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
esac;
$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
$(top_srcdir)/configure: $(am__configure_deps)
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
$(ACLOCAL_M4): $(am__aclocal_m4_deps)
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
$(am__aclocal_m4_deps):
install-binPROGRAMS: $(bin_PROGRAMS)
@$(NORMAL_INSTALL)
@list='$(bin_PROGRAMS)'; test -n "$(bindir)" || list=; \
if test -n "$$list"; then \
echo " $(MKDIR_P) '$(DESTDIR)$(bindir)'"; \
$(MKDIR_P) "$(DESTDIR)$(bindir)" || exit 1; \
fi; \
for p in $$list; do echo "$$p $$p"; done | \
sed 's/$(EXEEXT)$$//' | \
while read p p1; do if test -f $$p \
; then echo "$$p"; echo "$$p"; else :; fi; \
done | \
sed -e 'p;s,.*/,,;n;h' \
-e 's|.*|.|' \
-e 'p;x;s,.*/,,;s/$(EXEEXT)$$//;$(transform);s/$$/$(EXEEXT)/' | \
sed 'N;N;N;s,\n, ,g' | \
$(AWK) 'BEGIN { files["."] = ""; dirs["."] = 1 } \
{ d=$$3; if (dirs[d] != 1) { print "d", d; dirs[d] = 1 } \
if ($$2 == $$4) files[d] = files[d] " " $$1; \
else { print "f", $$3 "/" $$4, $$1; } } \
END { for (d in files) print "f", d, files[d] }' | \
while read type dir files; do \
if test "$$dir" = .; then dir=; else dir=/$$dir; fi; \
test -z "$$files" || { \
echo " $(INSTALL_PROGRAM_ENV) $(INSTALL_PROGRAM) $$files '$(DESTDIR)$(bindir)$$dir'"; \
$(INSTALL_PROGRAM_ENV) $(INSTALL_PROGRAM) $$files "$(DESTDIR)$(bindir)$$dir" || exit $$?; \
} \
; done
uninstall-binPROGRAMS:
@$(NORMAL_UNINSTALL)
@list='$(bin_PROGRAMS)'; test -n "$(bindir)" || list=; \
files=`for p in $$list; do echo "$$p"; done | \
sed -e 'h;s,^.*/,,;s/$(EXEEXT)$$//;$(transform)' \
-e 's/$$/$(EXEEXT)/' \
`; \
test -n "$$list" || exit 0; \
echo " ( cd '$(DESTDIR)$(bindir)' && rm -f" $$files ")"; \
cd "$(DESTDIR)$(bindir)" && rm -f $$files
clean-binPROGRAMS:
-test -z "$(bin_PROGRAMS)" || rm -f $(bin_PROGRAMS)
tabble$(EXEEXT): $(tabble_OBJECTS) $(tabble_DEPENDENCIES) $(EXTRA_tabble_DEPENDENCIES)
@rm -f tabble$(EXEEXT)
$(AM_V_CCLD)$(LINK) $(tabble_OBJECTS) $(tabble_LDADD) $(LIBS)
mostlyclean-compile:
-rm -f *.$(OBJEXT)
distclean-compile:
-rm -f *.tab.c
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/add_stuff.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/choices.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/edits.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/icon.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/icons.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/load_lists.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/options.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/read_line.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/save_lists.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/signals.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/tabble.Po@am__quote@
.c.o:
@am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ $<
.c.obj:
@am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'`
@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ `$(CYGPATH_W) '$<'`
ID: $(am__tagged_files)
$(am__define_uniq_tagged_files); mkid -fID $$unique
tags: tags-am
TAGS: tags
tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files)
set x; \
here=`pwd`; \
$(am__define_uniq_tagged_files); \
shift; \
if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \
test -n "$$unique" || unique=$$empty_fix; \
if test $$# -gt 0; then \
$(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
"$$@" $$unique; \
else \
$(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
$$unique; \
fi; \
fi
ctags: ctags-am
CTAGS: ctags
ctags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files)
$(am__define_uniq_tagged_files); \
test -z "$(CTAGS_ARGS)$$unique" \
|| $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
$$unique
GTAGS:
here=`$(am__cd) $(top_builddir) && pwd` \
&& $(am__cd) $(top_srcdir) \
&& gtags -i $(GTAGS_ARGS) "$$here"
cscopelist: cscopelist-am
cscopelist-am: $(am__tagged_files)
list='$(am__tagged_files)'; \
case "$(srcdir)" in \
[\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \
*) sdir=$(subdir)/$(srcdir) ;; \
esac; \
for i in $$list; do \
if test -f "$$i"; then \
echo "$(subdir)/$$i"; \
else \
echo "$$sdir/$$i"; \
fi; \
done >> $(top_builddir)/cscope.files
distclean-tags:
-rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
distdir: $(DISTFILES)
@srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
list='$(DISTFILES)'; \
dist_files=`for file in $$list; do echo $$file; done | \
sed -e "s|^$$srcdirstrip/||;t" \
-e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \
case $$dist_files in \
*/*) $(MKDIR_P) `echo "$$dist_files" | \
sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \
sort -u` ;; \
esac; \
for file in $$dist_files; do \
if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
if test -d $$d/$$file; then \
dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \
if test -d "$(distdir)/$$file"; then \
find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
fi; \
if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \
find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
fi; \
cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \
else \
test -f "$(distdir)/$$file" \
|| cp -p $$d/$$file "$(distdir)/$$file" \
|| exit 1; \
fi; \
done
check-am: all-am
check: check-am
all-am: Makefile $(PROGRAMS) $(HEADERS)
installdirs:
for dir in "$(DESTDIR)$(bindir)"; do \
test -z "$$dir" || $(MKDIR_P) "$$dir"; \
done
install: install-am
install-exec: install-exec-am
install-data: install-data-am
uninstall: uninstall-am
install-am: all-am
@$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
installcheck: installcheck-am
install-strip:
if test -z '$(STRIP)'; then \
$(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
install; \
else \
$(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
"INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \
fi
mostlyclean-generic:
clean-generic:
distclean-generic:
-test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
-test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES)
maintainer-clean-generic:
@echo "This command is intended for maintainers to use"
@echo "it deletes files that may require special tools to rebuild."
clean: clean-am
clean-am: clean-binPROGRAMS clean-generic mostlyclean-am
distclean: distclean-am
-rm -rf ./$(DEPDIR)
-rm -f Makefile
distclean-am: clean-am distclean-compile distclean-generic \
distclean-tags
dvi: dvi-am
dvi-am:
html: html-am
html-am:
info: info-am
info-am:
install-data-am:
install-dvi: install-dvi-am
install-dvi-am:
install-exec-am: install-binPROGRAMS
install-html: install-html-am
install-html-am:
install-info: install-info-am
install-info-am:
install-man:
install-pdf: install-pdf-am
install-pdf-am:
install-ps: install-ps-am
install-ps-am:
installcheck-am:
maintainer-clean: maintainer-clean-am
-rm -rf ./$(DEPDIR)
-rm -f Makefile
maintainer-clean-am: distclean-am maintainer-clean-generic
mostlyclean: mostlyclean-am
mostlyclean-am: mostlyclean-compile mostlyclean-generic
pdf: pdf-am
pdf-am:
ps: ps-am
ps-am:
uninstall-am: uninstall-binPROGRAMS
.MAKE: install-am install-strip
.PHONY: CTAGS GTAGS TAGS all all-am check check-am clean \
clean-binPROGRAMS clean-generic cscopelist-am ctags ctags-am \
distclean distclean-compile distclean-generic distclean-tags \
distdir dvi dvi-am html html-am info info-am install \
install-am install-binPROGRAMS install-data install-data-am \
install-dvi install-dvi-am install-exec install-exec-am \
install-html install-html-am install-info install-info-am \
install-man install-pdf install-pdf-am install-ps \
install-ps-am install-strip installcheck installcheck-am \
installdirs maintainer-clean maintainer-clean-generic \
mostlyclean mostlyclean-compile mostlyclean-generic pdf pdf-am \
ps ps-am tags tags-am uninstall uninstall-am \
uninstall-binPROGRAMS
.PRECIOUS: Makefile
# Tell versions [3.59,3.63) of GNU make to not export all variables.
# Otherwise a system limit (for SysV at least) may be exceeded.
.NOEXPORT:
tabble-0.45/src/icons.h 0000644 0001750 0001750 00000000111 10435540707 011665 0000000 0000000
#include
GtkWidget* scaled_icon (const gchar *filename);
tabble-0.45/src/signals.h 0000644 0001750 0001750 00000000076 10435540707 012224 0000000 0000000
#include "world.h"
void signal_init (world_info *pointer);
tabble-0.45/src/save_lists.h 0000644 0001750 0001750 00000000161 10435540707 012733 0000000 0000000
#include "world.h"
void save_all (const world_info *info);
void save_all_compressed (const world_info *info);
tabble-0.45/src/load_lists.h 0000644 0001750 0001750 00000000265 10435540707 012721 0000000 0000000
#include "world.h"
void zero_item_entry (item_struct *item);
void reset_world_info (world_info *info);
void set_window (world_info *info);
void load_settings (world_info *info);
tabble-0.45/src/world.h 0000644 0001750 0001750 00000003061 11336421776 011715 0000000 0000000
#ifndef WORLD
#define WORLD
#include
static const gchar default_window_name[] = "tabble";
static const gchar default_icon_dir[] = ".";
static const gchar default_cmd_dir[] = ".";
static const gint icon_width = 48;
static const gint icon_height = 48;
enum browse_targets {bt_cmd, bt_icon};
typedef struct
{
GString *name, *dir, *cmd, *icon;
gint x_pos, y_pos;
} item_struct;
typedef struct
{
struct world_info *info;
item_struct *item;
gint tab_pos;
gboolean filled;
GtkWidget *icon_image, *icon_button, *button, *label;
} cell_struct;
typedef struct
{
GString *tab_name;
GtkWidget *box_widget;
cell_struct *cell_array;
} tab_struct;
typedef struct
{
GtkWidget *main_window, *tabs;
GtkWidget *edits_dialog, *edits_table, *browse_widget;
GtkWidget *name_field, *dir_field, *cmd_field, *icon_field, *icon_image;
GtkWidget *options_dialog, *options_table;
GtkWidget *options_field_1, *options_field_2;
GtkWidget *options_check_1, *options_check_2, *options_check_3;
GList *tab_list;
gint tab_count, last_tab;
gboolean run_again, blanks_shown;
gint argc;
gchar **argv;
GString *conf_file, *icon_dir, *cmd_dir, *pwd_dir, *window_name;
gint max_line;
gint button_spacing, icon_x_spacing, icon_y_spacing, frame_spacing;
gint x_icons, y_icons, x_icons_new, y_icons_new;
gboolean world_on_top, world_sticky, world_revert_to_first, options_enabled;
gint start_x, start_y, start_w, start_h;
cell_struct *current_cell, *selected_cell, *pressed_cell, *entered_cell;
int browse_target;
} world_info;
#endif
tabble-0.45/src/read_line.h 0000644 0001750 0001750 00000001273 10435540707 012506 0000000 0000000
#include
#include
#include "world.h"
typedef struct
{
GString *filename;
gint pos, max_length;
gchar *buffer;
FILE *file;
} readline;
gboolean text_here (const GString *text);
void free_g_string (GString *text);
int char_find (const gchar* text, char sought);
const gchar* find_parent_dir (const gchar *source);
const gchar* find_parent_dir_slash (const gchar *source);
const gchar* find_filename (const gchar *source);
gboolean file_readable (const gchar *filename);
readline* read_start (const gchar *filename, gint max_length);
gboolean read_next (readline *context, GString **destination);
const gchar* cmdline_option (world_info *info, const gchar *option);
tabble-0.45/src/options.h 0000644 0001750 0001750 00000000100 10435540707 012243 0000000 0000000
#include "world.h"
void options_dialog (world_info *info);
tabble-0.45/src/icon.h 0000644 0001750 0001750 00000000071 10435540707 011507 0000000 0000000
const char** tabble_icon();
const char** blank_icon();
tabble-0.45/src/edits.h 0000644 0001750 0001750 00000000264 10435540707 011673 0000000 0000000
#include "world.h"
void dismiss_notice (GtkWidget *widget, GtkWidget *dialog);
void show_notice (const gchar* text, GtkWidget *parent);
void edits_dialog (cell_struct *cell);
tabble-0.45/src/choices.h 0000644 0001750 0001750 00000000777 12331063122 012175 0000000 0000000
#include
#include "world.h"
void show_edit_buttons (world_info *info, gboolean show_buttons);
gboolean click_leave (GtkWidget *w, GdkEventButton *ev, cell_struct *c);
gboolean click_enter (GtkWidget *w, GdkEventButton *ev, cell_struct *c);
gboolean click_press (GtkWidget *w, GdkEventButton *ev, cell_struct *c);
gboolean click_release (GtkWidget *w, GdkEventButton *ev, cell_struct *c);
gboolean key_activate (GtkWidget *w, GdkEventButton *ev, cell_struct *c);
void choices (world_info *info);
tabble-0.45/src/add_stuff.h 0000644 0001750 0001750 00000001305 13724075474 012527 0000000 0000000
#include "world.h"
gint add_tab (world_info *info, const gchar* name);
void del_tab (world_info *info, gint tab_number);
void hide_cell_visibles (cell_struct *cell);
void zero_item (item_struct *item);
void free_item (item_struct *item);
void copy_item (const item_struct *src, item_struct *dest);
void pinup_item (cell_struct *cell);
void add_item (world_info *info, const item_struct *source, gint tab_number);
cell_struct* get_grid (world_info *info, gint tab_number, gint x, gint y);
void free_cell (world_info *info, gint tab_number, gint x, gint y);
void push_blank_cell (world_info *info, gint tab_number, gint x, gint y);
void show_empty_cell (world_info *info, gint tab_number, gint x, gint y);
tabble-0.45/src/Makefile.am 0000644 0001750 0001750 00000000622 13726332522 012444 0000000 0000000 bin_PROGRAMS = tabble
AM_CPPFLAGS = $(GTK_CFLAGS)
AM_CFLAGS = -O2 `pkg-config --cflags gtk+-2.0`
LIBS = `pkg-config --libs gtk+-2.0`
tabble_SOURCES = add_stuff.c choices.c edits.c icon.c options.c read_line.c \
tabble.c load_lists.c save_lists.c signals.c icons.c
noinst_HEADERS = add_stuff.h choices.h edits.h icon.h options.h read_line.h \
world.h load_lists.h save_lists.h signals.h icons.h
tabble-0.45/LICENSE 0000644 0001750 0001750 00000000121 13726332522 010620 0000000 0000000 Tabble Copyright (C) 2005, 2006, 2010 Graeme Sheppard.
See COPYING for licence.
tabble-0.45/BUGS 0000644 0001750 0001750 00000000545 13726332522 010310 0000000 0000000 Tabble Bugs
There is only one apparent bug and it is just visual. Pressing shift can
make the tabble window grow, and then only the icons recede when shift is
lifted. Having a least one program in each row (on one tab) helps reduce
this side effect.
The workaround is described in add_stuff.c, function show_empty_cell.
A worse solution than the problem.
tabble-0.45/tabble.png 0000644 0001750 0001750 00000010026 13726332522 011557 0000000 0000000 ‰PNG
IHDR 0 0 Wù‡ bKGD ÿ ÿ ÿ ½§“ pHYs šœ tIMEÕ
04_X tEXtComment Created with The GIMPïd%n zIDAThÞÍšYl\×}Æw›ýξpî%Q+eY»#ïYÜÄq7]òÐ¢Š¦OEöµËK-Š
Ú ´Èb$AÔ±SÇväHŽÉ)Qâ"’CrHÎ~gßîÛ^Ñ–eSrb'9À<Þû}翜ïÿJüz—8^à3ÖÏiÀä7|©@?ðð¯@ÂýU ûƒ