Commit 593a69c0 authored by Luis Rodrigo Gallardo Cruz's avatar Luis Rodrigo Gallardo Cruz Committed by Luis Rodrigo Gallardo Cruz

Imported Upstream version 0.18.cvs20060518

File added
John Harper <>
rep-gtk is heavily based on guile-gtk, by Marius Vollmer and others
Please report bugs to the mailing list <>
(or alternatively, to my sourceforge account <>,
but mailing list messages often get quicker responses)
This diff is collapsed.
This diff is collapsed.
Please send all patches to the rep-gtk mailing list:
When possible, please make patches in unified diff format (i.e. `diff -u').
- John Harper <>
Basic Installation
These are generic installation instructions.
The `configure' shell script attempts to guess correct values for
various system-dependent variables used during compilation. It uses
those values to create a `Makefile' in each directory of the package.
It may also create one or more `.h' files containing system-dependent
definitions. Finally, it creates a shell script `config.status' that
you can run in the future to recreate the current configuration, a file
`config.cache' that saves the results of its tests to speed up
reconfiguring, and a file `config.log' containing compiler output
(useful mainly for debugging `configure').
If you need to do unusual things to compile the package, please try
to figure out how `configure' could check whether to do them, and mail
diffs or instructions to the address given in the `README' so they can
be considered for the next release. If at some point `config.cache'
contains results you don't want to keep, you may remove or edit it.
The file `' is used to create `configure' by a program
called `autoconf'. You only need `' if you want to change
it or regenerate `configure' using a newer version of `autoconf'.
The simplest way to compile this package is:
1. `cd' to the directory containing the package's source code and type
`./configure' to configure the package for your system. If you're
using `csh' on an old version of System V, you might need to type
`sh ./configure' instead to prevent `csh' from trying to execute
`configure' itself.
Running `configure' takes a while. While running, it prints some
messages telling which features it is checking for.
2. Type `make' to compile the package.
3. Optionally, type `make check' to run any self-tests that come with
the package.
4. Type `make install' to install the programs and any data files and
5. You can remove the program binaries and object files from the
source code directory by typing `make clean'. To also remove the
files that `configure' created (so you can compile the package for
a different kind of computer), type `make distclean'. There is
also a `make maintainer-clean' target, but that is intended mainly
for the package's developers. If you use it, you may have to get
all sorts of other programs in order to regenerate files that came
with the distribution.
Compilers and Options
Some systems require unusual options for compilation or linking that
the `configure' script does not know about. You can give `configure'
initial values for variables by setting them in the environment. Using
a Bourne-compatible shell, you can do that on the command line like
CC=c89 CFLAGS=-O2 LIBS=-lposix ./configure
Or on systems that have the `env' program, you can do it like this:
env CPPFLAGS=-I/usr/local/include LDFLAGS=-s ./configure
Compiling For Multiple Architectures
You can compile the package for more than one kind of computer at the
same time, by placing the object files for each architecture in their
own directory. To do this, you must use a version of `make' that
supports the `VPATH' variable, such as GNU `make'. `cd' to the
directory where you want the object files and executables to go and run
the `configure' script. `configure' automatically checks for the
source code in the directory that `configure' is in and in `..'.
If you have to use a `make' that does not supports the `VPATH'
variable, you have to compile the package for one architecture at a time
in the source code directory. After you have installed the package for
one architecture, use `make distclean' before reconfiguring for another
Installation Names
By default, `make install' will install the package's files in
`/usr/local/bin', `/usr/local/man', etc. You can specify an
installation prefix other than `/usr/local' by giving `configure' the
option `--prefix=PATH'.
You can specify separate installation prefixes for
architecture-specific files and architecture-independent files. If you
give `configure' the option `--exec-prefix=PATH', the package will use
PATH as the prefix for installing programs and libraries.
Documentation and other data files will still use the regular prefix.
In addition, if you use an unusual directory layout you can give
options like `--bindir=PATH' to specify different values for particular
kinds of files. Run `configure --help' for a list of the directories
you can set and what kinds of files go in them.
If the package supports it, you can cause programs to be installed
with an extra prefix or suffix on their names by giving `configure' the
option `--program-prefix=PREFIX' or `--program-suffix=SUFFIX'.
Optional Features
Some packages pay attention to `--enable-FEATURE' options to
`configure', where FEATURE indicates an optional part of the package.
They may also pay attention to `--with-PACKAGE' options, where PACKAGE
is something like `gnu-as' or `x' (for the X Window System). The
`README' should mention any `--enable-' and `--with-' options that the
package recognizes.
For packages that use the X Window System, `configure' can usually
find the X include and library files automatically, but if it doesn't,
you can use the `configure' options `--x-includes=DIR' and
`--x-libraries=DIR' to specify their locations.
Specifying the System Type
There may be some features `configure' can not figure out
automatically, but needs to determine by the type of host the package
will run on. Usually `configure' can figure that out, but if it prints
a message saying it can not guess the host type, give it the
`--host=TYPE' option. TYPE can either be a short name for the system
type, such as `sun4', or a canonical name with three fields:
See the file `config.sub' for the possible values of each field. If
`config.sub' isn't included in this package, then this package doesn't
need to know the host type.
If you are building compiler tools for cross-compiling, you can also
use the `--target=TYPE' option to select the type of system they will
produce code for and the `--build=TYPE' option to select the type of
system on which you are compiling the package.
Sharing Defaults
If you want to set default values for `configure' scripts to share,
you can create a site shell script called `' that gives
default values for variables like `CC', `cache_file', and `prefix'.
`configure' looks for `PREFIX/share/' if it exists, then
`PREFIX/etc/' if it exists. Or, you can set the
`CONFIG_SITE' environment variable to the location of the site script.
A warning: not all `configure' scripts look for a site script.
Operation Controls
`configure' recognizes the following options to control how it
Use and save the results of the tests in FILE instead of
`./config.cache'. Set FILE to `/dev/null' to disable caching, for
debugging `configure'.
Print a summary of the options to `configure', and exit.
Do not print messages saying which checks are being made.
Look for the package's source code in directory DIR. Usually
`configure' can determine that directory automatically.
Print the version of Autoconf used to generate the `configure'
script, and exit.
`configure' also accepts some other, not widely useful, options.
# -- input for rep-gtk Makefile
# Copyright (C) 1998 John Harper <>
# $Id:,v 1.29 2002/02/13 07:50:27 jsh Exp $
SGTK_SRCS = rep-types.c
SRCS = rep-gtk.c gtk-support.c gtk-compat.c glib-glue.c gdk-glue.c gtk-glue.c gdk-pixbuf-glue.c
OBJS = $(SRCS:.c=.lo)
LIBGLADE_SRCS = libglade-support.c libglade-glue.c
LIBGLADE_OBJS = libglade-support.lo libglade-glue.lo
GNOME_LIBGLADE_OBJS = libglade-gnome-support.lo libglade-glue.lo
GNOMELIB_SRCS = gnomelib-support.c gnomelib-glue.c
GNOMEUI_SRCS = gnomeui-support.c gnomeui-glue.c
GNOME_CANVAS_SRCS = gnome-canvas-support.c gnome-canvas-glue.c
OUT_DESTS = $(foreach x, $(OUT), gui/$(x))
include $(repexecdir)/
.PHONY: clean realclean install
all : build_dirs $(OUT)
gtk-2/ : $(SGTK_OBJS)
gtk-2/ : $(OBJS)
$(rep_DL_LD) $(CPPFLAGS) $(CFLAGS) -o $@ $^ $(LDFLAGS) $(REP_GTK_LIBS)
gtk-2/ : $(LIBGLADE_OBJS)
gtk-2/ : $(GNOMELIB_OBJS)
gtk-2/ : $(GNOMEUI_OBJS)
%-glue.c : %.defs
rep -f build-gtk-batch $< $@ : build-gtk.jl
rep compiler -f compile-batch $<
libglade-gnome-support.lo : libglade-support.c
$(rep_LIBTOOL) --mode=compile $(CC) -c $(CPPFLAGS) $(CFLAGS) \
install : all installdirs
set -e; for f in $(OUT); do \
$(rep_DL_INSTALL) $$f $(DESTDIR)$(installdir)/gui/gtk-2; \
set -e; for f in $(OUT_DESTS); do \
case $$f in \
gui/gtk-2/|gui/gtk-2/ \
printf "\nrep_requires='gui.gtk-2.types'\n" >>$(DESTDIR)$(installdir)/$$f ;; \
gui/gkt-2/|gui/gtk-2/|gui/gtk-2/ \
printf "\nrep_requires='gui.gtk-2.gtk'\n" >>$(DESTDIR)$(installdir)/$$f ;; \
gui/gtk-2/gnome-canvas*.la) \
printf "\nrep_requires='gui.gtk-2.gnome-ui'\n" >>$(DESTDIR)$(installdir)/$$f ;; \
esac; \
for f in $(OUT_DESTS); do \
printf "\nrep_open_globally=yes\n" >>$(DESTDIR)$(installdir)/$$f; \
$(rep_INSTALL_ALIASES) -c . $(DESTDIR)$(installdir)
installdirs : $(top_srcdir)/mkinstalldirs
$(SHELL) $(top_srcdir)/mkinstalldirs $(DESTDIR)$(installdir)/gui/gtk-2
uninstall :
$(rep_DL_UNINSTALL) $(DESTDIR)$(installdir)/$(OUT)
clean :
rm -f *-glue.c *~ core *.jlc *.o *.lo *.la
rm -rf gtk-2
realclean : clean
rm -f Makefile config.cache config.log config.status config.h
rm -f rep-gtk.spec
cvsclean : realclean
rm -f aclocal.m4 configure
build_dirs : gtk-2
gtk-2 :
mkdir gtk-2
# hand-needed dependences
gtk-glue.c : gtk.defs gtktext.defs
-*- text -*-
This is rep-gtk 0.0, a binding of GTK+/GNOME/libglade for the rep Lisp
system. It is based on Marius Vollmer's guile-gtk binding (initially
version 0.15, updated to 0.17), with a new glue-code generator.
For more details see:
Browse the CVS history at:
Basically, `./configure ; make ; make install'. If you're building from
the CVS repository, execute `aclocal ; autoconf' first.
It requires Gtk+ version 2.
WARNING: The libglade and GNOME bindings are currently untested and
probably broken since the port to Gtk2, use at your own risk.
Import the module gui.gtk-2.gtk to load the library, then call
functions as in guile-gtk. The only difference is that Lisp conventions
are used for booleans, i.e. nil for #f, and non-nil for #t.
See the included *.defs files for the details of how the library maps
to lisp functions.
From the libglade README file:
This library allows you to load glade interface files in a program
at runtime. It doesn't require GLADE to be used, but GLADE is by
far the easiest way to create the interface files.
So you can now use GLADE with rep! Here's an example from the
examples/test-libglade script:
(require 'gui.gtk-2.libglade)
(let ((xml (or (glade-xml-new (car command-line-args))
(error "something bad happened"))))
(glade-xml-signal-autoconnect xml)
The glade-xml-new function takes a filename, and creates a widget
hierarchy. glade-xml-signal-autoconnect connects all signal handlers to
the lisp functions named in the GLADE file. You can also use the
glade-xml-signal-connect function to connect individually named
handlers. (see libglade.defs for the complete function list)
There's also now reasonably complete bindings of gnome and gnomeui.
These extra modules will get built and installed:
gui.gtk-2.gnome-lib Non-UI GNOME functions, doesn't require GTK
gui.gtk-2.gnome-ui GNOME UI widgets and utilities
gui.gtk-2.gnome-canvas GNOME Canvas widgets and utilities
see the .defs files for the gruesome details about what goes in what.
The dependence tree is something like:
types -+- gtk -+- libglade
\ \
\ gnome-ui -+- gnome-canvas
gui.gtk-2.types provides conversions for the basic C types (and GLIB's
GList and GSList types).
When `gui.gtk-2.gnome-ui' is loaded the gnome-init function is called
automatically. If the special variables `*gnome-app-id*' and
`*gnome-app-version*' are bound to strings, then these values will be
used, otherwise something will be fabricated.
However, if using `gui.gtk-2.gnome-lib' without `gui.gtk-2.gnome-ui',
you should call `gnomelib-init' manually.
It's still too easy to crash the Lisp interpreter through invalid use
of GTK..
rep-gtk HEAD now requires glib-2, gtk-2, etc..
It's currently in a pre-alpha state
Checkout the gtk-1-branch to get the gtk-1 version
All the modules have been moved into the gui.gtk-2 hierarchy, so
programs wanting to move from gtk-1 to gtk-2 will need to change
These notes describe the format of the .defs files
(import "DEFS-FILE")
(include "DEFS-FILE")
(define-enum ENUM-TYPEDEF-NAME
(define-flags FLAGS-TYPEDEF-NAME
(define-boxed BOXED-TYPEDEF-NAME
ATTR ...)
where each ATTR is one of:
(copy C-COPY-FUN)
(free C-FREE-FUN)
(size "C sizeof expression")
(fields FIELD ...)
each OPTION may be `(setter t)' denoting that the field
is settable. Also `(getter FUNCTION-NAME)' defining a custom
method of retrieving the value
ATTR ...)
where each ATTR is one of:
(fields FIELD ...) [as above]
(define-func C-FUNC-NAME
(ARG ...)
where each ARG is (TYPE NAME-SYM [ARG-OPTIONS...)
and each OPTION may be one of:
(protection ARG) ; gc protect callback for life of ARG
(protection t) ; gc protect callback always
(protection *result*) ; gc protect for life of RETURN-VALUE
(undeferred t) ; no scm interrupt protection?
(rest-arg t) ; last arg is &rest
and each ARG-OPTION may be one of:
(= "default expression")
(null-ok) ; allow nil
and each RET-OPTION may be one of:
(copy nil) ; unimplemented?
(options OPTION ...)
where each OPTION can be:
(includes "#include expression")
(init-func "name of C function")
(other-inits "name of C function" ... )
(extra-init-code "code string")
(provide FEATURE)
the `provide' option generates the rep dl stub required to provide
FEATURE and call the init-func when loaded
GTK fundamental types seem to include:
invalid, none, char, bool, int, uint, long, ulong, float,
string, enum, flags, boxed, foreign, callback, args, pointer,
signal, c-callback, object
The guile-gtk .defs files seem to add the following:
static_string, full_callback, file-descriptor, list, slist,
double, SCM, cvec, cvecr, fvec, ret, tvec
a static string returned from a function
a callback function used by the _full function variants (i.e.
an integer file descriptor
a double-precision float
a scheme object
(list TYPE [MODE]):
a glib GList* (doubly-linked)
(slist TYPE [MODE]):
a glib GSList* (singly-linked)
(cvec TYPE [MODE]):
a counted-vector, stored in sgtk_cvec struct, in gtk_ function calls,
it expands ``, cvec.len''
(cvecr TYPE [MODE]):
similar to cvec but expands ``cvec.len,''
(fvec TYPE LEN [MODE]):
similar to cvec but fixed length
(ret TYPE):
similar to fvec but length is always one. used to mimic the C ``&foo''
idiom of returning multiple values
(tvec TYPE [MODE]):
zero-terminated vector
[ in the above, MODE is one of `in', `out' or `inout'. Defaults to `in' ]
This diff is collapsed.
-*- indented-text -*-
* fix the signal_connect_object stuff in libglade-support.c
* support the `define-struct' and `define-ptype' defs
* add/fix support for implementing new GObject classes in lisp
# generated automatically by aclocal 1.9.6 -*- Autoconf -*-
# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004,
# 2005 Free Software Foundation, Inc.
# This file 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
# pkg.m4 - Macros to locate and utilise pkg-config. -*- Autoconf -*-
# Copyright © 2004 Scott James Remnant <>.
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
# This program is distributed in the hope that it will be useful, but
# WITHOUT ANY WARRANTY; without even the implied warranty of
# General Public License for more details.
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
# As a special exception to the GNU General Public License, if you
# distribute this file as part of a program that contains a
# configuration script generated by Autoconf, you may include it under
# the same distribution terms that you use for the rest of that program.
# ----------------------------------
AC_ARG_VAR([PKG_CONFIG], [path to pkg-config utility])dnl
if test "x$ac_cv_env_PKG_CONFIG_set" != "xset"; then
AC_PATH_TOOL([PKG_CONFIG], [pkg-config])
if test -n "$PKG_CONFIG"; then
_pkg_min_version=m4_default([$1], [0.9.0])
AC_MSG_CHECKING([pkg-config is at least version $_pkg_min_version])
if $PKG_CONFIG --atleast-pkgconfig-version $_pkg_min_version; then
# Check to see whether a particular set of modules exists. Similar
# to PKG_CHECK_MODULES(), but does not set variables or print errors.
# Similar to PKG_CHECK_MODULES, make sure that the first instance of
# this or PKG_CHECK_MODULES is called, or make sure to call
# --------------------------------------------------------------
if test -n "$PKG_CONFIG" && \
AC_RUN_LOG([$PKG_CONFIG --exists --print-errors "$1"]); then
m4_ifval([$2], [$2], [:])
m4_ifvaln([$3], [else
# ---------------------------------------------
[if test -n "$PKG_CONFIG"; then
if test -n "$$1"; then
[pkg_cv_[]$1=`$PKG_CONFIG --[]$2 "$3" 2>/dev/null`],
# -----------------------------
if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then
# Note that if there is a possibility the first call to
# PKG_CHECK_MODULES might not happen, you should be sure to include an
# explicit call to PKG_PROG_PKG_CONFIG in your
# --------------------------------------------------------------
AC_ARG_VAR([$1][_CFLAGS], [C compiler flags for $1, overriding pkg-config])dnl
AC_ARG_VAR([$1][_LIBS], [linker flags for $1, overriding pkg-config])dnl
_PKG_CONFIG([$1][_CFLAGS], [cflags], [$2])
_PKG_CONFIG([$1][_LIBS], [libs], [$2])
m4_define([_PKG_TEXT], [Alternatively, you may set the environment variables $1[]_CFLAGS
and $1[]_LIBS to avoid the need to call pkg-config.
See the pkg-config man page for more details.])
if test $pkg_failed = yes; then
if test $_pkg_short_errors_supported = yes; then
$1[]_PKG_ERRORS=`$PKG_CONFIG --short-errors --errors-to-stdout --print-errors "$2"`