From 89844be451e405051e0dc408d19b2421b02798ad Mon Sep 17 00:00:00 2001 From: Sven Neumann Date: Tue, 18 Dec 2001 20:40:50 +0000 Subject: [PATCH] docs/gimptool-1.3.1.in applied patch from Roger Leigh 2001-12-18 Sven Neumann * docs/gimptool-1.3.1.in * gimptool-1.3.in: applied patch from Roger Leigh that makes gimptool respect the DESTDIR environment variable. * app/config/Makefile.am: declare test-config as TESTS so it is build and executed when running 'make check'. * app/config/gimpbaseconfig.c: don't register a GimpConfig interface. * app/config/gimpcoreconfig.c * app/config/gimpdisplayconfig.c * app/config/gimpguiconfig.c: no need to include "gimpconfig.h". * app/config/gimpconfig.[ch]: removed store_unknown parameter from deserialize method. The default implementation will bail out on unknown tokens. * app/config/gimprc.c: override deserialize method so it stores unknown tokens. --- ChangeLog | 21 +++++++++++++++++++++ app/config/Makefile.am | 4 ++++ app/config/gimpbaseconfig.c | 6 ------ app/config/gimpconfig.c | 15 +++++---------- app/config/gimpconfig.h | 6 ++---- app/config/gimpcoreconfig.c | 1 - app/config/gimpdisplayconfig.c | 1 - app/config/gimpguiconfig.c | 1 - app/config/gimprc.c | 21 ++++++++++++++++----- app/config/test-config.c | 4 ++-- docs/gimptool-1.3.1.in | 11 +++++++---- docs/gimptool-2.0.1.in | 11 +++++++---- docs/gimptool.1.in | 11 +++++++---- gimptool-1.3.in | 4 ++-- gimptool-2.0.in | 4 ++-- libgimpconfig/gimpconfig-iface.c | 15 +++++---------- libgimpconfig/gimpconfig-iface.h | 6 ++---- 17 files changed, 82 insertions(+), 60 deletions(-) diff --git a/ChangeLog b/ChangeLog index b4db86f844..86a25087c7 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,24 @@ +2001-12-18 Sven Neumann + + * docs/gimptool-1.3.1.in + * gimptool-1.3.in: applied patch from Roger Leigh + that makes gimptool respect the DESTDIR environment variable. + + * app/config/Makefile.am: declare test-config as TESTS so it is build + and executed when running 'make check'. + + * app/config/gimpbaseconfig.c: don't register a GimpConfig interface. + * app/config/gimpcoreconfig.c + * app/config/gimpdisplayconfig.c + * app/config/gimpguiconfig.c: no need to include "gimpconfig.h". + + * app/config/gimpconfig.[ch]: removed store_unknown parameter from + deserialize method. The default implementation will bail out on + unknown tokens. + + * app/config/gimprc.c: override deserialize method so it stores + unknown tokens. + 2001-12-18 Sven Neumann * app/config/Makefile.am: don't build test-config by default. diff --git a/app/config/Makefile.am b/app/config/Makefile.am index d4809f3480..53d5a3a997 100644 --- a/app/config/Makefile.am +++ b/app/config/Makefile.am @@ -43,9 +43,13 @@ INCLUDES = @STRIP_BEGIN@ \ -I$(includedir) \ @STRIP_END@ + # # test programs, not to be built by default and never installed # + +TESTS = test-config + EXTRA_PROGRAMS = test-config test_config_DEPENDENCIES = @STRIP_BEGIN@ \ diff --git a/app/config/gimpbaseconfig.c b/app/config/gimpbaseconfig.c index c0900f7159..4f4c0c4eb1 100644 --- a/app/config/gimpbaseconfig.c +++ b/app/config/gimpbaseconfig.c @@ -25,7 +25,6 @@ #include "libgimpbase/gimpbase.h" -#include "gimpconfig.h" #include "gimpconfig-params.h" #include "gimpconfig-types.h" @@ -74,15 +73,10 @@ gimp_base_config_get_type (void) 0, /* n_preallocs */ NULL /* instance_init */ }; - static const GInterfaceInfo config_iface_info = { NULL, NULL, NULL }; config_type = g_type_register_static (G_TYPE_OBJECT, "GimpBaseConfig", &config_info, 0); - - g_type_add_interface_static (config_type, - GIMP_TYPE_CONFIG_INTERFACE, - &config_iface_info); } return config_type; diff --git a/app/config/gimpconfig.c b/app/config/gimpconfig.c index 1d57cdac58..64589615bb 100644 --- a/app/config/gimpconfig.c +++ b/app/config/gimpconfig.c @@ -46,8 +46,7 @@ static void gimp_config_iface_init (GimpConfigInterface *gimp_config_iface); static void gimp_config_iface_serialize (GObject *object, gint fd); static gboolean gimp_config_iface_deserialize (GObject *object, - GScanner *scanner, - gboolean store_unknown); + GScanner *scanner); GType @@ -92,12 +91,9 @@ gimp_config_iface_serialize (GObject *object, static gboolean gimp_config_iface_deserialize (GObject *object, - GScanner *scanner, - gboolean store_unknown) + GScanner *scanner) { - return gimp_config_deserialize_properties (object, - scanner, - store_unknown); + return gimp_config_deserialize_properties (object, scanner, FALSE); } gboolean @@ -133,8 +129,7 @@ gimp_config_serialize (GObject *object, gboolean gimp_config_deserialize (GObject *object, - const gchar *filename, - gboolean store_unknown) + const gchar *filename) { GimpConfigInterface *gimp_config_iface; gint fd; @@ -165,7 +160,7 @@ gimp_config_deserialize (GObject *object, g_scanner_input_file (scanner, fd); scanner->input_name = filename; - success = gimp_config_iface->deserialize (object, scanner, store_unknown); + success = gimp_config_iface->deserialize (object, scanner); g_scanner_destroy (scanner); close (fd); diff --git a/app/config/gimpconfig.h b/app/config/gimpconfig.h index 2f1c10314d..c63d582200 100644 --- a/app/config/gimpconfig.h +++ b/app/config/gimpconfig.h @@ -35,8 +35,7 @@ struct _GimpConfigInterface void (* serialize) (GObject *object, gint fd); gboolean (* deserialize) (GObject *object, - GScanner *scanner, - gboolean store_unknown); + GScanner *scanner); }; typedef void (*GimpConfigForeachFunc) (const gchar *key, @@ -49,8 +48,7 @@ GType gimp_config_interface_get_type (void) G_GNUC_CONST; gboolean gimp_config_serialize (GObject *object, const gchar *filename); gboolean gimp_config_deserialize (GObject *object, - const gchar *filename, - gboolean store_unknown); + const gchar *filename); void gimp_config_add_unknown_token (GObject *object, const gchar *key, diff --git a/app/config/gimpcoreconfig.c b/app/config/gimpcoreconfig.c index 13e707b55f..579eef910a 100644 --- a/app/config/gimpcoreconfig.c +++ b/app/config/gimpcoreconfig.c @@ -25,7 +25,6 @@ #include "libgimpbase/gimpbase.h" -#include "gimpconfig.h" #include "gimpconfig-params.h" #include "gimpconfig-types.h" #include "gimpconfig-utils.h" diff --git a/app/config/gimpdisplayconfig.c b/app/config/gimpdisplayconfig.c index 85bafb6884..15d86cc70d 100644 --- a/app/config/gimpdisplayconfig.c +++ b/app/config/gimpdisplayconfig.c @@ -25,7 +25,6 @@ #include "libgimpbase/gimpbase.h" -#include "gimpconfig.h" #include "gimpconfig-params.h" #include "gimpconfig-types.h" #include "gimpconfig-utils.h" diff --git a/app/config/gimpguiconfig.c b/app/config/gimpguiconfig.c index 4479800aa1..14e130a042 100644 --- a/app/config/gimpguiconfig.c +++ b/app/config/gimpguiconfig.c @@ -25,7 +25,6 @@ #include "libgimpbase/gimpbase.h" -#include "gimpconfig.h" #include "gimpconfig-params.h" #include "gimpconfig-types.h" #include "gimpconfig-utils.h" diff --git a/app/config/gimprc.c b/app/config/gimprc.c index b71b83a552..a8f9758dd2 100644 --- a/app/config/gimprc.c +++ b/app/config/gimprc.c @@ -27,13 +27,16 @@ #include "gimpconfig.h" #include "gimpconfig-serialize.h" +#include "gimpconfig-deserialize.h" #include "gimprc.h" -static void gimp_rc_config_iface_init (gpointer iface, - gpointer iface_data); -static void gimp_rc_serialize (GObject *object, - gint fd); +static void gimp_rc_config_iface_init (gpointer iface, + gpointer iface_data); +static void gimp_rc_serialize (GObject *object, + gint fd); +static gboolean gimp_rc_deserialize (GObject *object, + GScanner *scanner); GType @@ -80,7 +83,8 @@ gimp_rc_config_iface_init (gpointer iface, { GimpConfigInterface *config_iface = (GimpConfigInterface *) iface; - config_iface->serialize = gimp_rc_serialize; + config_iface->serialize = gimp_rc_serialize; + config_iface->deserialize = gimp_rc_deserialize; } static void @@ -91,6 +95,13 @@ gimp_rc_serialize (GObject *object, gimp_config_serialize_unknown_tokens (object, fd); } +static gboolean +gimp_rc_deserialize (GObject *object, + GScanner *scanner) +{ + return gimp_config_deserialize_properties (object, scanner, TRUE); +} + GimpRc * gimp_rc_new (void) { diff --git a/app/config/test-config.c b/app/config/test-config.c index 557b075b9a..613ee402b6 100644 --- a/app/config/test-config.c +++ b/app/config/test-config.c @@ -77,7 +77,7 @@ main (int argc, NULL); g_print (" Deserializing from '%s' ...\n", filename); - gimp_config_deserialize (G_OBJECT (gimprc), filename, TRUE); + gimp_config_deserialize (G_OBJECT (gimprc), filename); header = "\n Unknown string tokens:\n"; gimp_config_foreach_unknown_token (G_OBJECT (gimprc), @@ -87,7 +87,7 @@ main (int argc, g_object_unref (G_OBJECT (gimprc)); - g_print ("Done.\n"); + g_print ("Done.\n\n"); return 0; } diff --git a/docs/gimptool-1.3.1.in b/docs/gimptool-1.3.1.in index 435ad7d0d9..221682e527 100644 --- a/docs/gimptool-1.3.1.in +++ b/docs/gimptool-1.3.1.in @@ -184,22 +184,25 @@ and \-\-libs options. This option must be specified before any .SH ENVIRONMENT .PP .TP 8 -.B PKG_CONFIG -to get the location of the pkg-config program used to determine details -about your glib, pango and gtk+ installation. -.TP 8 .B CC to get the name of the desired C compiler. .TP 8 .B CFLAGS to get the preferred flags to pass to the C compiler for plug-in building. .TP 8 +.B DESTDIR +to add a prefix to the install/uninstall path. +.TP 8 .B LDFLAGS to get the prefered flags for passing to the linker. .TP 8 .B LIBS for passing extra libs that may be needed in the build process. For example, LIBS=-lintl . +.TP 8 +.B PKG_CONFIG +to get the location of the pkg-config program used to determine details +about your glib, pango and gtk+ installation. .SH SEE ALSO .BR gimp (1), diff --git a/docs/gimptool-2.0.1.in b/docs/gimptool-2.0.1.in index 435ad7d0d9..221682e527 100644 --- a/docs/gimptool-2.0.1.in +++ b/docs/gimptool-2.0.1.in @@ -184,22 +184,25 @@ and \-\-libs options. This option must be specified before any .SH ENVIRONMENT .PP .TP 8 -.B PKG_CONFIG -to get the location of the pkg-config program used to determine details -about your glib, pango and gtk+ installation. -.TP 8 .B CC to get the name of the desired C compiler. .TP 8 .B CFLAGS to get the preferred flags to pass to the C compiler for plug-in building. .TP 8 +.B DESTDIR +to add a prefix to the install/uninstall path. +.TP 8 .B LDFLAGS to get the prefered flags for passing to the linker. .TP 8 .B LIBS for passing extra libs that may be needed in the build process. For example, LIBS=-lintl . +.TP 8 +.B PKG_CONFIG +to get the location of the pkg-config program used to determine details +about your glib, pango and gtk+ installation. .SH SEE ALSO .BR gimp (1), diff --git a/docs/gimptool.1.in b/docs/gimptool.1.in index 435ad7d0d9..221682e527 100644 --- a/docs/gimptool.1.in +++ b/docs/gimptool.1.in @@ -184,22 +184,25 @@ and \-\-libs options. This option must be specified before any .SH ENVIRONMENT .PP .TP 8 -.B PKG_CONFIG -to get the location of the pkg-config program used to determine details -about your glib, pango and gtk+ installation. -.TP 8 .B CC to get the name of the desired C compiler. .TP 8 .B CFLAGS to get the preferred flags to pass to the C compiler for plug-in building. .TP 8 +.B DESTDIR +to add a prefix to the install/uninstall path. +.TP 8 .B LDFLAGS to get the prefered flags for passing to the linker. .TP 8 .B LIBS for passing extra libs that may be needed in the build process. For example, LIBS=-lintl . +.TP 8 +.B PKG_CONFIG +to get the location of the pkg-config program used to determine details +about your glib, pango and gtk+ installation. .SH SEE ALSO .BR gimp (1), diff --git a/gimptool-1.3.in b/gimptool-1.3.in index 1ca5d27149..737fb239b7 100644 --- a/gimptool-1.3.in +++ b/gimptool-1.3.in @@ -244,7 +244,7 @@ while test $# -gt 0; do shift if test "x$1" != "x"; then if test -f "$install_dir/$1"; then - cmd="rm -f $install_dir/$1" + cmd="rm -f $DESTDIR$install_dir/$1" test $quiet = "yes" || echo $cmd test $donothing = "yes" || exec $cmd else @@ -260,7 +260,7 @@ while test $# -gt 0; do shift if test "x$1" != "x"; then if test -r "$1"; then - cmd="$install_cmd $1 $install_dir/$1" + cmd="$install_cmd $1 $DESTDIR$install_dir/$1" test $quiet = "yes" || echo $cmd test $donothing = "yes" || exec $cmd else diff --git a/gimptool-2.0.in b/gimptool-2.0.in index 1ca5d27149..737fb239b7 100644 --- a/gimptool-2.0.in +++ b/gimptool-2.0.in @@ -244,7 +244,7 @@ while test $# -gt 0; do shift if test "x$1" != "x"; then if test -f "$install_dir/$1"; then - cmd="rm -f $install_dir/$1" + cmd="rm -f $DESTDIR$install_dir/$1" test $quiet = "yes" || echo $cmd test $donothing = "yes" || exec $cmd else @@ -260,7 +260,7 @@ while test $# -gt 0; do shift if test "x$1" != "x"; then if test -r "$1"; then - cmd="$install_cmd $1 $install_dir/$1" + cmd="$install_cmd $1 $DESTDIR$install_dir/$1" test $quiet = "yes" || echo $cmd test $donothing = "yes" || exec $cmd else diff --git a/libgimpconfig/gimpconfig-iface.c b/libgimpconfig/gimpconfig-iface.c index 1d57cdac58..64589615bb 100644 --- a/libgimpconfig/gimpconfig-iface.c +++ b/libgimpconfig/gimpconfig-iface.c @@ -46,8 +46,7 @@ static void gimp_config_iface_init (GimpConfigInterface *gimp_config_iface); static void gimp_config_iface_serialize (GObject *object, gint fd); static gboolean gimp_config_iface_deserialize (GObject *object, - GScanner *scanner, - gboolean store_unknown); + GScanner *scanner); GType @@ -92,12 +91,9 @@ gimp_config_iface_serialize (GObject *object, static gboolean gimp_config_iface_deserialize (GObject *object, - GScanner *scanner, - gboolean store_unknown) + GScanner *scanner) { - return gimp_config_deserialize_properties (object, - scanner, - store_unknown); + return gimp_config_deserialize_properties (object, scanner, FALSE); } gboolean @@ -133,8 +129,7 @@ gimp_config_serialize (GObject *object, gboolean gimp_config_deserialize (GObject *object, - const gchar *filename, - gboolean store_unknown) + const gchar *filename) { GimpConfigInterface *gimp_config_iface; gint fd; @@ -165,7 +160,7 @@ gimp_config_deserialize (GObject *object, g_scanner_input_file (scanner, fd); scanner->input_name = filename; - success = gimp_config_iface->deserialize (object, scanner, store_unknown); + success = gimp_config_iface->deserialize (object, scanner); g_scanner_destroy (scanner); close (fd); diff --git a/libgimpconfig/gimpconfig-iface.h b/libgimpconfig/gimpconfig-iface.h index 2f1c10314d..c63d582200 100644 --- a/libgimpconfig/gimpconfig-iface.h +++ b/libgimpconfig/gimpconfig-iface.h @@ -35,8 +35,7 @@ struct _GimpConfigInterface void (* serialize) (GObject *object, gint fd); gboolean (* deserialize) (GObject *object, - GScanner *scanner, - gboolean store_unknown); + GScanner *scanner); }; typedef void (*GimpConfigForeachFunc) (const gchar *key, @@ -49,8 +48,7 @@ GType gimp_config_interface_get_type (void) G_GNUC_CONST; gboolean gimp_config_serialize (GObject *object, const gchar *filename); gboolean gimp_config_deserialize (GObject *object, - const gchar *filename, - gboolean store_unknown); + const gchar *filename); void gimp_config_add_unknown_token (GObject *object, const gchar *key,