mirror of https://github.com/GNOME/gimp.git
app/config/Makefile.am added the basic infrastructure for a utitily that
2002-11-28 Sven Neumann <sven@gimp.org> * app/config/Makefile.am * app/config/gimpconfig-dump.c: added the basic infrastructure for a utitily that dumps the GimpRc object. * app/config/gimpconfig-serialize.c: dump object blurbs as comments.
This commit is contained in:
parent
4d2cc6452b
commit
0a69e9c58c
|
@ -1,3 +1,11 @@
|
|||
2002-11-28 Sven Neumann <sven@gimp.org>
|
||||
|
||||
* app/config/Makefile.am
|
||||
* app/config/gimpconfig-dump.c: added the basic infrastructure for
|
||||
a utitily that dumps the GimpRc object.
|
||||
|
||||
* app/config/gimpconfig-serialize.c: dump object blurbs as comments.
|
||||
|
||||
2002-11-27 Michael Natterer <mitch@gimp.org>
|
||||
|
||||
* app/paint/gimpairbrush.[ch]
|
||||
|
|
|
@ -3,6 +3,7 @@ Makefile.in
|
|||
.deps
|
||||
.libs
|
||||
*.lo
|
||||
foorc
|
||||
gimpconfig-dump
|
||||
libappconfig.la
|
||||
test-config
|
||||
foorc
|
||||
|
|
|
@ -44,15 +44,7 @@ INCLUDES = \
|
|||
-I$(includedir)
|
||||
|
||||
|
||||
#
|
||||
# test programs, not to be built by default and never installed
|
||||
#
|
||||
|
||||
TESTS = test-config
|
||||
|
||||
EXTRA_PROGRAMS = test-config
|
||||
|
||||
test_config_DEPENDENCIES = \
|
||||
gimpconfig_libs = \
|
||||
libappconfig.a \
|
||||
../base/libappbase.a \
|
||||
../core/libappcore.a \
|
||||
|
@ -61,6 +53,19 @@ test_config_DEPENDENCIES = \
|
|||
$(top_builddir)/libgimpbase/libgimpbase-$(LT_RELEASE).la \
|
||||
$(top_builddir)/libgimpcolor/libgimpcolor-$(LT_RELEASE).la
|
||||
|
||||
test_config_LDADD = \
|
||||
$(GLIB_LIBS) \
|
||||
$(test_config_DEPENDENCIES)
|
||||
|
||||
#
|
||||
# extra programs, not to be built by default and never installed
|
||||
#
|
||||
|
||||
EXTRA_PROGRAMS = gimpconfig-dump test-config
|
||||
|
||||
gimpconfig_dump_SOURCES = gimpconfig-dump.c
|
||||
|
||||
gimpconfig_dump_LDADD = $(GLIB_LIBS) $(gimpconfig_libs)
|
||||
|
||||
TESTS = test-config
|
||||
|
||||
test_config_DEPENDENCIES = $(gimpconfig_dependencies)
|
||||
|
||||
test_config_LDADD = $(GLIB_LIBS) $(gimpconfig_libs)
|
||||
|
|
|
@ -0,0 +1,87 @@
|
|||
/* The GIMP -- an image manipulation program
|
||||
* Copyright (C) 1995 Spencer Kimball and Peter Mattis
|
||||
*
|
||||
* GimpConfig object property dumper.
|
||||
* Copyright (C) 2001-2002 Sven Neumann <sven@gimp.org>
|
||||
*
|
||||
* 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
|
||||
* 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, write to the Free Software
|
||||
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||
*/
|
||||
|
||||
#include "config.h"
|
||||
|
||||
#include "stdlib.h"
|
||||
#include "string.h"
|
||||
|
||||
#include <glib-object.h>
|
||||
|
||||
#include "libgimpbase/gimplimits.h"
|
||||
#include "libgimpbase/gimpbasetypes.h"
|
||||
|
||||
#include "config-types.h"
|
||||
|
||||
#include "gimpconfig.h"
|
||||
#include "gimpconfig-serialize.h"
|
||||
#include "gimprc.h"
|
||||
|
||||
|
||||
int
|
||||
main (int argc,
|
||||
char *argv[])
|
||||
{
|
||||
GObject *rc;
|
||||
|
||||
g_type_init ();
|
||||
|
||||
rc = g_object_new (GIMP_TYPE_RC, NULL);
|
||||
|
||||
g_print ("# Dump of the GIMP default configuration\n");
|
||||
|
||||
gimp_config_serialize_properties (rc, 1, 0);
|
||||
|
||||
g_print ("\n");
|
||||
|
||||
g_object_unref (rc);
|
||||
|
||||
return EXIT_SUCCESS;
|
||||
}
|
||||
|
||||
|
||||
/* some dummy funcs so we can properly link this beast */
|
||||
|
||||
const gchar *
|
||||
gimp_unit_get_identifier (GimpUnit unit)
|
||||
{
|
||||
switch (unit)
|
||||
{
|
||||
case GIMP_UNIT_PIXEL:
|
||||
return "pixels";
|
||||
case GIMP_UNIT_INCH:
|
||||
return "inches";
|
||||
case GIMP_UNIT_MM:
|
||||
return "millimeters";
|
||||
case GIMP_UNIT_POINT:
|
||||
return "points";
|
||||
case GIMP_UNIT_PICA:
|
||||
return "picas";
|
||||
default:
|
||||
return NULL;
|
||||
}
|
||||
}
|
||||
|
||||
gint
|
||||
gimp_unit_get_number_of_units (void)
|
||||
{
|
||||
return GIMP_UNIT_END;
|
||||
}
|
|
@ -60,9 +60,9 @@ static void serialize_unknown_token (const gchar *key,
|
|||
* This function writes all object properties to the file descriptor @fd.
|
||||
**/
|
||||
gboolean
|
||||
gimp_config_serialize_properties (GObject *object,
|
||||
gint fd,
|
||||
gint indent_level)
|
||||
gimp_config_serialize_properties (GObject *object,
|
||||
gint fd,
|
||||
gint indent_level)
|
||||
{
|
||||
GObjectClass *klass;
|
||||
GParamSpec **property_specs;
|
||||
|
@ -84,7 +84,8 @@ gimp_config_serialize_properties (GObject *object,
|
|||
|
||||
for (i = 0; i < n_property_specs; i++)
|
||||
{
|
||||
GParamSpec *prop_spec;
|
||||
GParamSpec *prop_spec;
|
||||
const gchar *blurb;
|
||||
|
||||
prop_spec = property_specs[i];
|
||||
|
||||
|
@ -96,6 +97,9 @@ gimp_config_serialize_properties (GObject *object,
|
|||
else
|
||||
g_string_assign (str, "");
|
||||
|
||||
if ((blurb = g_param_spec_get_blurb (prop_spec)) != NULL)
|
||||
g_string_append_printf (str, "# %s\n", blurb);
|
||||
|
||||
gimp_config_string_indent (str, indent_level);
|
||||
|
||||
g_string_append_printf (str, "(%s ", prop_spec->name);
|
||||
|
|
|
@ -60,9 +60,9 @@ static void serialize_unknown_token (const gchar *key,
|
|||
* This function writes all object properties to the file descriptor @fd.
|
||||
**/
|
||||
gboolean
|
||||
gimp_config_serialize_properties (GObject *object,
|
||||
gint fd,
|
||||
gint indent_level)
|
||||
gimp_config_serialize_properties (GObject *object,
|
||||
gint fd,
|
||||
gint indent_level)
|
||||
{
|
||||
GObjectClass *klass;
|
||||
GParamSpec **property_specs;
|
||||
|
@ -84,7 +84,8 @@ gimp_config_serialize_properties (GObject *object,
|
|||
|
||||
for (i = 0; i < n_property_specs; i++)
|
||||
{
|
||||
GParamSpec *prop_spec;
|
||||
GParamSpec *prop_spec;
|
||||
const gchar *blurb;
|
||||
|
||||
prop_spec = property_specs[i];
|
||||
|
||||
|
@ -96,6 +97,9 @@ gimp_config_serialize_properties (GObject *object,
|
|||
else
|
||||
g_string_assign (str, "");
|
||||
|
||||
if ((blurb = g_param_spec_get_blurb (prop_spec)) != NULL)
|
||||
g_string_append_printf (str, "# %s\n", blurb);
|
||||
|
||||
gimp_config_string_indent (str, indent_level);
|
||||
|
||||
g_string_append_printf (str, "(%s ", prop_spec->name);
|
||||
|
|
Loading…
Reference in New Issue