Commit 2788fd46 authored by Gustavo Girldez's avatar Gustavo Girldez Committed by Gustavo Giráldez

Port to Gnome 2 platform of the source root files and the gdl/ directory.

2001-12-21  Gustavo Girldez  <gustavo.giraldez@gmx.net>

	* Port to Gnome 2 platform of the source root files and the gdl/
	directory.

	* gdl-1.0.pc.in
	gdl/libgdlmarshal.list: New files

	* gdlConf.sh.in
	gdl.m4: Removed files

	* autogen.sh: Changed to use gnome2 macros.

	* configure.in: gettext renamed to gdl-1. Disabled build of
	scintilla-control and symbol-browser-control.
	Version bumped to 0.3.0

	* gdl/Makefile.am: Generate glib enums and marshals.  Library
	renamed to libgdl-1.  Headers are installed in
	$(includedir)/libgdl-1.0/gdl.  IDL files are installed in
	$(datadir)/idl/libgdl-1.0

	* gdl/gdl-server-manager.[ch]: Removed files

	* Changes to GdlDock: Type system changed to GType.  Replaced old
	Gtk arg system with new GObject property system.  Gtk signal
	system changed to GObject signal system.  Removed draw virtuals,
	made expose-event handlers work correctly.  Fixed a couple of
	object reference bugs (sink tablabels and bound items, unbind
	items when destroying the dock).

	* gdl/gdl-dock.c: libxml2 API changes.

	* gdl/gdl-dock-notebook.c: Fixed forall virtual.  Moved internal
	GtkNotebook creation to gdl_dock_notebook_init function (it was in
	gdl_dock_notebook_new)

	* gdl/gdl-dock-tablabel.c: Tablabel handle doesn't have a shadow
	anymore, so it's more flat
parent a7c40266
......@@ -29,4 +29,6 @@ gdlConf.sh
*.tar.gz
xml-i18n-*
gdl.spec
gdl-1.0.pc
intltool-*
*.tags
2001-12-21 Gustavo Girldez <gustavo.giraldez@gmx.net>
* Port to Gnome 2 platform of the source root files and the gdl/
directory.
* gdl-1.0.pc.in
gdl/libgdlmarshal.list: New files
* gdlConf.sh.in
gdl.m4: Removed files
* autogen.sh: Changed to use gnome2 macros.
* configure.in: gettext renamed to gdl-1. Disabled build of
scintilla-control and symbol-browser-control.
Version bumped to 0.3.0
* gdl/Makefile.am: Generate glib enums and marshals. Library
renamed to libgdl-1. Headers are installed in
$(includedir)/libgdl-1.0/gdl. IDL files are installed in
$(datadir)/idl/libgdl-1.0
* gdl/gdl-server-manager.[ch]: Removed files
* Changes to GdlDock: Type system changed to GType. Replaced old
Gtk arg system with new GObject property system. Gtk signal
system changed to GObject signal system. Removed draw virtuals,
made expose-event handlers work correctly. Fixed a couple of
object reference bugs (sink tablabels and bound items, unbind
items when destroying the dock).
* gdl/gdl-dock.c: libxml2 API changes.
* gdl/gdl-dock-notebook.c: Fixed forall virtual. Moved internal
GtkNotebook creation to gdl_dock_notebook_init function (it was in
gdl_dock_notebook_new)
* gdl/gdl-dock-tablabel.c: Tablabel handle doesn't have a shadow
anymore, so it's more flat
2001-12-20 Naba Kumar <kh_naba@yahoo.com>
* .cvsignore
......
SUBDIRS = idl gdl scintilla-control symbol-browser-control po intl
SUBDIRS = idl gdl po
# SUBDIRS = idl gdl scintilla-control symbol-browser-control po intl
m4datadir = $(datadir)/aclocal
m4data_DATA = gdl.m4
EXTRA_DIST = \
MAINTAINERS \
AUTHORS \
gdl.spec.in \
intltool-extract.in \
intltool-merge.in \
intltool-update.in
confexecdir = $(libdir)
confexec_DATA = gdlConf.sh
pkgconfigdir = $(libdir)/pkgconfig
pkgconfig_DATA = gdl-1.0.pc
gdlConf.sh: $(top_srcdir)/gdlConf.sh.in Makefile
sed -e 's?\@GDL_LIBDIR\@?$(GDL_LIBDIR)?g' \
-e 's?\@GDL_INCLUDEDIR\@?$(GDL_INCLUDEDIR)?g' \
-e 's?\@VERSION\@?$(VERSION)?g' \
-e 's?\@GDL_LIBS\@?$(GDL_LIBS)?g' \
< $(top_srcdir)/gdlConf.sh.in > gdlConf.tmp \
&& mv gdlConf.tmp gdlConf.sh
CLEANFILES = gdl-1.0.pc
EXTRA_DIST = \
gdl.m4 \
gdlConf.sh.in \
MAINTAINERS \
AUTHORS \
gdl.spec.in \
gdl.spec \
xml-i18n-extract.in \
xml-i18n-merge.in \
xml-i18n-update.in
CLEANFILES = gdlConf.sh
......@@ -6,7 +6,8 @@
#undef HAVE_LIBSM
#undef PACKAGE
#undef VERSION
#undef GETTEXT_PACKAGE
#undef GNOME_EXPLICIT_TRANSLATION_DOMAIN
#undef clock_t
#undef fpos_t
#undef L_tmpnam
......
......@@ -6,4 +6,17 @@ test -z "$srcdir" && srcdir=.
PKG_NAME="GDL"
. $srcdir/macros/autogen.sh
(test -f $srcdir/configure.in \
&& test -f $srcdir/README \
&& test -d $srcdir/gdl) || {
echo -n "**Error**: Directory "\`$srcdir\'" does not look like the"
echo " top-level $PKG_NAME directory"
exit 1
}
which gnome-autogen.sh || {
echo "You need to install gnome-common from the GNOME CVS"
exit 1
}
USE_GNOME2_MACROS=1 . gnome-autogen.sh
AC_INIT(gdlConf.sh.in)
AM_PROG_XML_I18N_TOOLS
dnl ==========================================================================
dnl
dnl If you add a version number here, you *must* add an AC_SUBST line for
......@@ -8,33 +5,40 @@ dnl it too, or it will never make it into the spec file!
dnl
dnl ==========================================================================
GLIB_REQUIRED=1.2.0
GTK_REQUIRED=1.2.0
GNOME_LIBS_REQUIRED=1.2.9
BONOBO_REQUIRED=1.0.7
OAF_REQUIRED=0.6.5
GNOME_VFS_REQUIRED=1.0
LIBXML_REQUIRED=1.8.15
GAL_REQUIRED=0.8.0
GDL_MAJOR_VERSION=0
GDL_MINOR_VERSION=3
GDL_MICRO_VERSION=0
GDL_VERSION=$GDL_MAJOR_VERSION.$GDL_MINOR_VERSION.$GDL_MICRO_VERSION
VERSION=$GDL_VERSION
AC_SUBST(GLIB_REQUIRED)
AC_SUBST(GTK_REQUIRED)
AC_SUBST(GNOME_LIBS_REQUIRED)
AC_SUBST(BONOBO_REQUIRED)
AC_SUBST(OAF_REQUIRED)
AC_SUBST(GNOME_VFS_REQUIRED)
AC_SUBST(LIBXML_REQUIRED)
AC_SUBST(GAL_REQUIRED)
AC_INIT(gdl, $VERSION, http://bugzilla.gnome.org/enter_bug.cgi?product=gdl)
AM_CONFIG_HEADER(config.h)
AC_CONFIG_SRCDIR(gdl/gdl.h)
dnl ==========================================================================
AM_INIT_AUTOMAKE(gdl, $VERSION)
AM_CONFIG_HEADER(config.h)
AM_INIT_AUTOMAKE(gdl,0.1.0)
AC_SUBST(GDL_MAJOR_VERSION)
AC_SUBST(GDL_MINOR_VERSION)
AC_SUBST(GDL_MICRO_VERSION)
AC_SUBST(GDL_VERSION)
AC_SUBST(VERSION)
AC_PROG_INTLTOOL
AM_ACLOCAL_INCLUDE(macros)
GTK_REQUIRED=1.3.9
GNOME_REQUIRED=1.96.0
BONOBOUI_REQUIRED=1.108.1
XML_REQUIRED=2.2.8
AC_SUBST(GTK_REQUIRED)
AC_SUBST(GNOME_REQUIRED)
AC_SUBST(XML_REQUIRED)
AM_MAINTAINER_MODE
AC_ISC_POSIX
AC_PROG_CC
dnl =====================================================================
dnl ======== Ctags stuffs below =========================================
......@@ -59,7 +63,6 @@ AC_DEFUN(CHECK_HEADER_DEFINE,
AC_ISC_POSIX
AC_PROG_CC
AC_PROG_RANLIB
AM_PROG_CC_STDC
AC_HEADER_STDC
......@@ -232,154 +235,66 @@ fi
dnl ========== ctags stuffs ends =======================================
dnl =====================================================================
dnl
dnl GDL_CHECK_LIB is defined in gdl.m4. However, we can't use that yet.
dnl So we have a copy here. If you modify this, see if you should modify
dnl the one in gdl.m4 too.
dnl
AC_DEFUN(CHECK_LIB, [
dispname="$1"
pkgname="$2"
minvers="$3"
maxvers="$4"
AC_MSG_CHECKING(for $dispname)
if gnome-config --libs $pkgname > /dev/null 2>&1; then
pkgvers=`gnome-config --modversion $pkgname | sed -e 's/^[[^0-9]]*//'`
else
pkgvers=not
fi
AC_MSG_RESULT($pkgvers found)
pkgvers=`echo $pkgvers | awk -F. '{ print $[]1 * 1000000 + $[]2 * 10000 + $[]3 * 100 + $[]4;}'`
cmpminvers=`echo $minvers | awk -F. '{ print $[]1 * 1000000 + $[]2 * 10000 + $[]3 * 100 + $[]4;}'`
cmpmaxvers=`echo $maxvers | awk -F. '{ print $[]1 * 1000000 + $[]2 * 10000 + $[]3 * 100 + $[]4;}'`
ok=yes
if test "$pkgvers" -lt $cmpminvers; then
ok=no
elif test -n "$maxvers" -a "$pkgvers" -ge $cmpmaxvers; then
ok=no
fi
if test $ok = no; then
case $maxvers in
"")
dispvers="$minvers or higher"
;;
$minvers)
dispvers="$minvers (exactly)"
;;
*)
dispvers="$minvers or higher, but less than $maxvers,"
;;
esac
AC_MSG_ERROR([
""
"You need $dispname $dispvers to build GDL"
"If you think you already have this installed, consult the README."])
fi
tmp_bsnom=`echo $pkgname | tr a-z A-Z`
eval $tmp_bsnom'_CFLAGS'=\"`gnome-config --cflags $pkgname`\"
eval $tmp_bsnom'_LIBS'=\"`gnome-config --libs $pkgname`\"
])
dnl libtool versioning
dnl gdl-0.1.0 = 0
dnl increment if any interfaces have been added; set to 0
dnl if any interfaces have been removed. removal has
dnl precedence over adding, so set to 0 if both happened.
dnl AKA Major
GDL_AGE=0
dnl gdl-0.1.0 = 1
dnl increment any time the source changes; set to
dnl 0 if you increment CURRENT
dnl AKA Minor
GDL_REVISION=1
dnl gdl-0.1.0 = 1
dnl increment if the interface has additions, changes, removals.
dnl AKA Micro
GAL_CURRENT=1
AC_SUBST(GDL_CURRENT)
AC_SUBST(GDL_REVISION)
AC_SUBST(GDL_AGE)
AC_ISC_POSIX
AC_PROG_CC
AC_PROG_CXX
AC_PROG_YACC
AM_PROG_LEX
AC_STDC_HEADERS
AC_ARG_PROGRAM
AM_PROG_LIBTOOL
AM_SANITY_CHECK
AC_SUBST(CFLAGS)
AC_SUBST(CPPFLAGS)
AC_SUBST(LDFLAGS)
GNOME_INIT()
GNOME_COMPILE_WARNINGS
GNOME_X_CHECKS
GNOME_PLATFORM_GNOME_2(yes)
GNOME_COMPILE_WARNINGS(error)
dnl ***************
dnl GNOME Libraries
dnl ***************
CHECK_LIB(glib, glib, $GLIB_REQUIRED)
CHECK_LIB(gnome-libs, gnome, $GNOME_LIBS_REQUIRED)
CHECK_LIB(Bonobo, bonobo, $BONOBO_REQUIRED)
CHECK_LIB(Bonobo X, bonobox, $BONOBO_REQUIRED)
CHECK_LIB(OAF, oaf, $OAF_REQUIRED)
CHECK_LIB(GNOME-VFS, vfs, $GNOME_VFS_REQUIRED)
CHECK_LIB(libxml, xml, $LIBXML_REQUIRED)
CHECK_LIB(gal, gal, $GAL_REQUIRED)
IDL_CFLAGS=`gnome-config --cflags idl`
AC_SUBST(GLIB_CFLAGS)
AC_SUBST(BONOBO_CFLAGS)
AC_SUBST(BONOBO_LIBS)
AC_SUBST(BONOBOX_CFLAGS)
AC_SUBST(BONOBOX_LIBS)
AC_SUBST(OAF_CFLAGS)
AC_SUBST(VFS_CFLAGS)
AC_SUBST(VFS_LIBS)
AC_SUBST(IDL_CFLAGS)
PKG_CHECK_MODULES(XML, libxml-2.0 >= $XML_REQUIRED)
AC_SUBST(XML_CFLAGS)
AC_SUBST(XML_LIBS)
AC_SUBST(GAL_LIBS)
GNOME_IDL_DIR="`$GNOME_CONFIG --datadir`/idl"
PKG_CHECK_MODULES(GDL_DEPENDENCIES,
gtk+-2.0 >= $GTK_REQUIRED
libgnome-2.0 >= $GNOME_REQUIRED
libbonoboui-2.0 >= $BONOBOUI_REQUIRED)
AC_SUBST(GDL_DEPENDENCIES_CFLAGS)
AC_SUBST(GDL_DEPENDENCIES_LIBS)
# orbit-idl
ORBIT_IDL="`$PKG_CONFIG --variable=orbit_idl ORBit-2.0`"
AC_SUBST(ORBIT_IDL)
# idl directories
LIBBONOBO_IDL_DIR="`$PKG_CONFIG --variable=idldir libbonobo-2.0`"
AC_SUBST(LIBBONOBO_IDL_DIR)
BONOBO_ACTIVATION_IDL_DIR="`$PKG_CONFIG --variable=idldir bonobo-activation-2.0`"
AC_SUBST(BONOBO_ACTIVATION_IDL_DIR)
# marshal and enum generators
GLIB_GENMARSHAL="`$PKG_CONFIG --variable=glib_genmarshal glib-2.0`"
AC_SUBST(GLIB_GENMARSHAL)
GLIB_MKENUMS="`$PKG_CONFIG --variable=glib_mkenums glib-2.0`"
AC_SUBST(GLIB_MKENUMS)
AM_GNOME_GETTEXT
ALL_LINGUAS="da el it ru sv"
GETTEXT_PACKAGE=gdl-1
AC_SUBST(GETTEXT_PACKAGE)
AC_DEFINE_UNQUOTED(GETTEXT_PACKAGE,"$GETTEXT_PACKAGE")
AC_DEFINE_UNQUOTED(GNOME_EXPLICIT_TRANSLATION_DOMAIN, "$GETTEXT_PACKAGE")
AM_GLIB_GNU_GETTEXT
# AM_GNOME2_GETTEXT above substs $DATADIRNAME
# this is the directory where the *.{mo,gmo} files are installed
gnomelocaledir='${prefix}/${DATADIRNAME}/locale'
AC_SUBST(gnomelocaledir)
GDL_LIBDIR='-L${libdir}'
GDL_INCLUDEDIR=" -I${includedir} `$GNOME_CONFIG --cflags gnomeui ` $UNICODE_LIBS"
GDL_LIBS="-lgdl `$GNOME_CONFIG --libs bonobox`"
AC_SUBST(GDL_LIBDIR)
AC_SUBST(GDL_INCLUDEDIR)
AC_SUBST(GDL_LIBS)
AC_OUTPUT([
Makefile
gdl/Makefile
idl/Makefile
scintilla-control/Makefile
scintilla-control/scintilla/Makefile
symbol-browser-control/Makefile
symbol-browser-control/tagmanager/Makefile
symbol-browser-control/tagmanager/include/Makefile
intl/Makefile
po/Makefile.in
stamp.h
gdl.spec
],[sed -e "/POTFILES =/r po/POTFILES" po/Makefile.in > po/Makefile])
gdl-1.0.pc
])
prefix=@prefix@
exec_prefix=@exec_prefix@
libdir=@libdir@
includedir=@includedir@/libgdl-1.0
idldir=@datadir@/idl/libgdl-1.0
Name: gdl
Description: Gnome DevTool Libraries
Version: @VERSION@
Requires: libbonoboui-2.0 libgnome-2.0 gtk+-2.0 libxml-2.0
Libs: -L${libdir} -lgdl-1
Cflags: -I${includedir}
dnl This was taken from evolution's configure.in and modified a bit.
AC_DEFUN(GDL_CHECK_LIB, [
dispname="$1"
pkgname="$2"
minvers="$3"
maxvers="$4"
AC_MSG_CHECKING(for $dispname)
if gnome-config --libs $pkgname > /dev/null 2>&1; then
pkgvers=`gnome-config --modversion $pkgname | sed -e 's/^[[^0-9]]*//'`
else
pkgvers=not
fi
AC_MSG_RESULT($pkgvers found)
pkgvers=`echo $pkgvers | awk -F. '{ print $[]1 * 1000000 + $[]2 * 10000 + $[]3 * 100 + $[]4;}'`
cmpminvers=`echo $minvers | awk -F. '{ print $[]1 * 1000000 + $[]2 * 10000 + $[]3 * 100 + $[]4;}'`
cmpmaxvers=`echo $maxvers | awk -F. '{ print $[]1 * 1000000 + $[]2 * 10000 + $[]3 * 100 + $[]4;}'`
ok=yes
if test "$pkgvers" -lt $cmpminvers; then
ok=no
elif test -n "$maxvers" -a "$pkgvers" -ge $cmpmaxvers; then
ok=no
fi
if test $ok = no; then
case $maxvers in
"")
dispvers="$minvers or higher"
;;
$minvers)
dispvers="$minvers (exactly)"
;;
*)
dispvers="$minvers or higher, but less than $maxvers,"
;;
esac
AC_MSG_ERROR([
""
"You need $dispname $dispvers to build GDL"
"If you think you already have this installed, consult the README."])
fi
tmp_bsnom=`echo $pkgname | tr a-z A-Z`
eval $tmp_bsnom'_CFLAGS'=\"`gnome-config --cflags $pkgname`\"
eval $tmp_bsnom'_LIBS'=\"`gnome-config --libs $pkgname`\"
])
\ No newline at end of file
......@@ -8,4 +8,7 @@ GDL-stubs.c
GDL-skels.c
GDL-common.c
GDL.h
test-dock
\ No newline at end of file
test-dock
libgdlmarshal.c
libgdlmarshal.h
libgdltypebuiltins.*
INCLUDES = \
-DGNOMELOCALEDIR=\""$(datadir)/locales"\" \
-I$(includedir) $(GNOME_INCLUDEDIR) $(BONOBO_CFLAGS) $(GNOME_CFLAGS) \
$(XML_CFLAGS) $(BONOBOX_CFLAGS)
-DGNOMELOCALEDIR=\""$(datadir)/locales"\" \
-DG_DISABLE_DEPRECATED \
-DGTK_DISABLE_DEPRECATED \
-I$(includedir) -I$(top_srcdir) \
$(WARN_CFLAGS) \
$(GDL_DEPENDENCIES_CFLAGS) $(XML_CFLAGS)
lib_LTLIBRARIES = libgdl.la
lib_LTLIBRARIES = libgdl-1.la
CORBA_GENERATED_HEADER_FILES = GDL.h
......@@ -16,41 +19,48 @@ CORBA_GENERATED = \
BUILT_SOURCES=$(CORBA_GENERATED)
idl_dir = $(top_srcdir)/idl
IDL_FLAGS = -D__GDL_COMPILATION -I $(idl_dir) -I $(datadir)/idl $(IDL_CFLAGS)
IDL_FLAGS = -D__GDL_COMPILATION -I $(idl_dir) -I $(datadir)/idl \
-I $(LIBBONOBO_IDL_DIR) \
-I $(BONOBO_ACTIVATION_IDL_DIR)
$(CORBA_GENERATED) : $(idl_dir)/GDL.idl \
$(idl_dir)/editor-buffer.idl \
$(idl_dir)/editor-gutter.idl \
$(idl_dir)/symbol-browser.idl
$(CORBA_GENERATED): $(idl_dir)/GDL.idl \
$(idl_dir)/editor-buffer.idl \
$(idl_dir)/editor-gutter.idl \
$(idl_dir)/symbol-browser.idl
$(ORBIT_IDL) $(IDL_FLAGS) $(idl_dir)/GDL.idl
libgdl_la_SOURCES = \
CLEANFILES = $(CORBA_GENERATED) \
libgdltypebuiltins.c \
libgdltypebuiltins.h \
libgdlmarshal.c \
libgdlmarshal.h
libgdl_1_la_SOURCES = \
$(CORBA_GENERATED) \
gdl-server-manager.c \
gdl-dock.c \
gdl-dock-item.c \
gdl-dock-notebook.c \
gdl-dock-paned.c \
gdl-dock-tablabel.c \
gdl-file-selector-util.c
gdl-file-selector-util.c \
libgdltypebuiltins.c \
libgdlmarshal.c
$(libgdl_1_la_OBJECTS): \
libgdltypebuiltins.h \
libgdlmarshal.h
libgdl_la_LIBADD = \
$(BONOBO_LIBS) \
$(BONOBOX_LIBS) \
$(GNOME_LIBS) \
$(GNOMEUI_LIBS) \
libgdl_1_la_LIBADD = \
$(GDL_DEPENDENCIES_LIBS) \
$(XML_LIBS)
noinst_PROGRAMS=test-dock
test_dock_sources=test-dock.c
test_dock_LDADD=libgdl.la $(XML_LIBS)
test_dock_LDADD=libgdl-1.la $(XML_LIBS)
libgdlincludedir = $(includedir)/gdl
libgdlinclude_HEADERS = \
$(CORBA_GENERATED_HEADER_FILES) \
libgdl_headers = \
gdl.h \
gdl-server-manager.h \
gdl-tools.h \
gdl-dock.h \
gdl-dock-item.h \
......@@ -58,3 +68,57 @@ libgdlinclude_HEADERS = \
gdl-dock-paned.h \
gdl-dock-tablabel.h \
gdl-file-selector-util.h
libgdlincludedir = $(includedir)/libgdl-1.0/gdl
libgdlinclude_HEADERS = \
$(CORBA_GENERATED_HEADER_FILES) \
$(libgdl_headers) \
libgdltypebuiltins.h
# enumerations code generation
libgdltypebuiltins.c: Makefile.am $(libgdl_headers)
@GLIB_MKENUMS@ \
--fhead "#include <glib-object.h>\n" \
--fhead "#include \"libgdltypebuiltins.h\"\n\n" \
--fprod "\n/* enumerations from \"@filename@\" */" \
--vhead "static const G@Type@Value _@enum_name@_values[] = {" \
--vprod " { @VALUENAME@, \"@VALUENAME@\", \"@valuenick@\" }," \
--vtail " { 0, NULL, NULL }\n};\n\n" \
--vtail "GType\n@enum_name@_get_type (void)\n{\n" \
--vtail " static GType type = 0;\n\n" \
--vtail " if (!type)\n" \
--vtail " type = g_@type@_register_static (\"@EnumName@\", _@enum_name@_values);\n\n" \
--vtail " return type;\n}\n\n" \
$(libgdl_headers) > xgen-gtbec \
&& cp xgen-gtbec $(@F) \
&& rm -f xgen-gtbec
libgdltypebuiltins.h: Makefile.am $(libgdl_headers)
@GLIB_MKENUMS@ \
--fhead "#ifndef __LIBGDLTYPEBUILTINS_H__\n" \
--fhead "#define __LIBGDLTYPEBUILTINS_H__ 1\n\n" \
--fhead "#include <gdl/gdl.h>\n\n" \
--fhead "G_BEGIN_DECLS\n\n" \
--ftail "G_END_DECLS\n\n" \
--ftail "#endif /* __LIBGDLTYPEBUILTINS_H__ */\n" \
--fprod "\n/* --- @filename@ --- */" \
--eprod "#define GDL_TYPE_@ENUMSHORT@ @enum_name@_get_type()\n" \
--eprod "GType @enum_name@_get_type (void);\n" \
$(libgdl_headers) > xgen-gth \
&& cp xgen-gth $(@F) \
&& rm -f xgen-gth
libgdlmarshal.h: Makefile.am libgdlmarshal.list
@GLIB_GENMARSHAL@ \
--prefix=gdl_marshal libgdlmarshal.list --header > xgen-gmc \
&& cp xgen-gmc $(@F) \
&& rm -f xgen-gmc
libgdlmarshal.c: Makefile.am libgdlmarshal.h
echo "#include \"libgdlmarshal.h\"" > xgen-gmc \
&& @GLIB_GENMARSHAL@ \
--prefix=gdl_marshal libgdlmarshal.list --body >> xgen-gmc \
&& cp xgen-gmc $(@F) \
&& rm -f xgen-gmc
This diff is collapsed.
......@@ -4,7 +4,7 @@
#define __GDL_DOCK_ITEM_H__
#include <gtk/gtk.h>
#include <gnome-xml/tree.h>
#include <libxml/tree.h>
#define GDL_TYPE_DOCK_ITEM (gdl_dock_item_get_type ())
......@@ -12,6 +12,8 @@
#define GDL_DOCK_ITEM_CLASS(klass) (GTK_CHECK_CLASS_CAST ((klass), GDL_TYPE_DOCK_ITEM, GdlDockItemClass))
#define GDL_IS_DOCK_ITEM(obj) (GTK_CHECK_TYPE ((obj), GDL_TYPE_DOCK_ITEM))
#define GDL_IS_DOCK_ITEM_CLASS(klass) (GTK_CHECK_CLASS_TYPE ((klass), GDL_TYPE_DOCK_ITEM))
#define GDL_DOCK_ITEM_GET_CLASS(obj) (GTK_CHECK_GET_CLASS ((obj), GTK_TYPE_DOCK_ITEM, GdlDockItemClass))
#define GDL_DOCK_ITEM_IS_FLOATING(item) ((item)->is_floating)
#define GDL_DOCK_ITEM_IS_SHOWN(item) (GTK_WIDGET (item)->parent != NULL)
......@@ -20,9 +22,9 @@
#define GDL_DOCK_ITEM_CHECK_BOND(item,d) ((item)->dock == GTK_WIDGET (d))
#define GDL_DOCK_ITEM_CHECK_AND_BIND(item,other) G_STMT_START { \
if (!GDL_DOCK_ITEM_IS_BOUND (item)) \
gdl_dock_bind_item (GDL_DOCK (GDL_DOCK_ITEM (other)->dock), item); \
#define GDL_DOCK_ITEM_CHECK_AND_BIND(item,other) G_STMT_START { \
if (!GDL_DOCK_ITEM_IS_BOUND (item)) \
gdl_dock_bind_item (GDL_DOCK (GDL_DOCK_ITEM (other)->dock), item); \
g_return_if_fail (item->dock == GDL_DOCK_ITEM (other)->dock); } G_STMT_END
#define GDL_DOCK_ITEM_GET_PARENT(item,p) G_STMT_START { \
......@@ -138,7 +140,7 @@ GtkWidget *gdl_dock_item_new (const gchar *name,
const gchar *long_name,
GdlDockItemBehavior behavior);
GtkType gdl_dock_item_get_type (void);
GType gdl_dock_item_get_type (void);
void gdl_dock_item_dock_to (GdlDockItem *item,
GdlDockItem *target,
......
......@@ -11,6 +11,7 @@
static void gdl_dock_notebook_class_init (GdlDockNotebookClass *klass);
static void gdl_dock_notebook_init (GdlDockNotebook *notebook);
static void gdl_dock_notebook_destroy (GtkObject *object);
static void gdl_dock_notebook_add (GtkContainer *container,
GtkWidget *widget);
static void gdl_dock_notebook_remove (GtkContainer *container,
......@@ -40,6 +41,11 @@ static gchar *gdl_dock_notebook_get_pos_hint (GdlDockItem *item,
GdlDockItem *caller,
GdlDockPlacement *position);
static void gdl_dock_notebook_switch_page (GtkNotebook *nb,
GtkNotebookPage *page,
gint page_num,
gpointer data);
/* Class variables and definitions */
static GdlDockItemClass *parent_class = NULL;
......@@ -60,7 +66,9 @@ gdl_dock_notebook_class_init (GdlDockNotebookClass *klass)
container_class = (GtkContainerClass *) klass;
item_class = (GdlDockItemClass *) klass;
parent_class = gtk_type_class (gdl_dock_item_get_type ());
parent_class = g_type_class_peek_parent (klass);
object_class->destroy = gdl_dock_notebook_destroy;
container_class->add = gdl_dock_notebook_add;
container_class->remove = gdl_dock_notebook_remove;
......@@ -76,7 +84,28 @@ gdl_dock_notebook_class_init (GdlDockNotebookClass *klass)
static void
gdl_dock_notebook_init (GdlDockNotebook *notebook)
{
notebook->notebook = NULL;
GtkBin *bin;
bin = GTK_BIN (notebook);
/* create the container notebook */
bin->child = notebook->notebook = gtk_notebook_new ();
gtk_widget_set_parent (notebook->notebook, GTK_WIDGET (notebook));
gtk_notebook_set_scrollable (GTK_NOTEBOOK (notebook->notebook), TRUE);
g_signal_connect (notebook->notebook, "switch_page",
G_CALLBACK (gdl_dock_notebook_switch_page), notebook);
gtk_widget_show (notebook->notebook);
}
static void
gdl_dock_notebook_destroy (GtkObject *object)
{
GdlDockNotebook *notebook = GDL_DOCK_NOTEBOOK (object);
if (notebook->notebook) {
gtk_widget_unparent (notebook->notebook);
notebook->notebook = NULL;
};
}
static void
......@@ -155,7 +184,14 @@ gdl_dock_notebook_forall (GtkContainer *container,
notebook = GDL_DOCK_NOTEBOOK (container);
(*callback) (notebook->notebook, callback_data);
if (notebook->notebook) {
if (include_internals)
(*callback) (notebook->notebook, callback_data);
else {
gtk_container_foreach (GTK_CONTAINER (notebook->notebook),
callback, callback_data);
};
};
}
static void
......@@ -171,7 +207,7 @@ gdl_dock_notebook_auto_reduce (GdlDockItem *item)
parent = GTK_WIDGET (item)->parent;
nb = GDL_DOCK_NOTEBOOK (item);
children = gtk_container_children (GTK_CONTAINER (nb->notebook));
children = gtk_container_get_children (GTK_CONTAINER (nb->notebook));
/* Check if only one item remains in the notebook. */
if (g_list_length (children) <= 1) {
child = gtk_notebook_get_nth_page (
......@@ -210,13 +246,16 @@ gdl_dock_notebook_switch_page (GtkNotebook *nb,
/* deactivate old tablabel */
if (nb->cur_page) {
tablabel = nb->cur_page->tab_label;
tablabel = gtk_notebook_get_tab_label (
nb, gtk_notebook_get_nth_page (
nb, gtk_notebook_get_current_page (nb)));
if (tablabel && GDL_IS_DOCK_TABLABEL (tablabel))
gdl_dock_tablabel_deactivate (GDL_DOCK_TABLABEL (tablabel));
};
/* activate new label */
tablabel = page->tab_label;
tablabel = gtk_notebook_get_tab_label (
nb, gtk_notebook_get_nth_page (nb, page_num));
if (tablabel && GDL_IS_DOCK_TABLABEL (tablabel))
gdl_dock_tablabel_activate (GDL_DOCK_TABLABEL (tablabel));
}
......@@ -304,7 +343,7 @@ gdl_dock_notebook_get_pos_hint (GdlDockItem *item,
g_return_val_if_fail (item != NULL, NULL);
notebook = GDL_DOCK_NOTEBOOK (item);
l = pages = gtk_container_children (GTK_CONTAINER (notebook->notebook));
l = pages = gtk_container_get_children (GTK_CONTAINER (notebook->notebook));
if (caller) {
gboolean caller_found = FALSE;
......@@ -351,43 +390,36 @@ GtkWidget *
gdl_dock_notebook_new (void)
{
GdlDockNotebook *notebook;
GtkBin *bin;
notebook = GDL_DOCK_NOTEBOOK
(gtk_type_new (gdl_dock_notebook_get_type ()));
bin = GTK_BIN (notebook);
/* create the container notebook */
bin->child = notebook->notebook = gtk_notebook_new ();
gtk_widget_set_parent (notebook->notebook, GTK_WIDGET (notebook));
gtk_notebook_set_scrollable (GTK_NOTEBOOK (notebook->notebook), TRUE);
gtk_signal_connect (GTK_OBJECT (notebook->notebook), "switch_page",
(GtkSignalFunc) gdl_dock_notebook_switch_page,
(gpointer) notebook);
gtk_widget_show (notebook->notebook);
notebook = GDL_DOCK_NOTEBOOK (g_object_new (GDL_TYPE_DOCK_NOTEBOOK, NULL));