Makefile.am configure.in gimp.1.in gimp.spec.in gimprc.5.in user_install

2000-10-14  Sven Neumann  <sven@gimp.org>

	* Makefile.am
	* configure.in
	* gimp.1.in
	* gimp.spec.in
	* gimprc.5.in
	* user_install
	* user_install.bat
	* app/gimprc.c
	* app/user_install.c
	* libgimp/Makefile.am
	* libgimp/gimpenv.[ch]: applied a modified version of
	gimp-che-20001013-2, a patch from Ben Gertzfield <che@debian.org>
	that moves the system-dependant configuration files (gimprc and
	friends) into $prefix/etc/gimp/1.1.
This commit is contained in:
Sven Neumann 2000-10-14 22:15:11 +00:00 committed by Sven Neumann
parent 485242fa46
commit 9554632046
27 changed files with 315 additions and 85 deletions

View File

@ -1,3 +1,20 @@
2000-10-14 Sven Neumann <sven@gimp.org>
* Makefile.am
* configure.in
* gimp.1.in
* gimp.spec.in
* gimprc.5.in
* user_install
* user_install.bat
* app/gimprc.c
* app/user_install.c
* libgimp/Makefile.am
* libgimp/gimpenv.[ch]: applied a modified version of
gimp-che-20001013-2, a patch from Ben Gertzfield <che@debian.org>
that moves the system-dependant configuration files (gimprc and
friends) into $prefix/etc/gimp/1.1.
2000-10-14 Sven Neumann <sven@gimp.org>
* plug-ins/print/Makefile.am
@ -12,8 +29,8 @@
2000-10-14 Sven Neumann <sven@gimp.org>
* app/user_install.c: applied patch from Ben Gertzfield which fixes
a misuse of "it's", changing it to "its".
* app/user_install.c: applied gimp-che-20001013-2, a patch from Ben
Gertzfield which fixes a misuse of "it's", changing it to "its".
2000-10-14 Daniel Egger <egger@suse.de>

View File

@ -193,12 +193,14 @@ EXTRA_DIST = \
gimp.spec
gimpdata_DATA = \
gimprc \
gimprc_user \
gtkrc \
unitrc \
gimp_logo.ppm \
gimp_splash.ppm \
gimp_splash.ppm
gimpsysconf_DATA = \
gimprc \
gimprc_user \
gtkrc \
unitrc \
ps-menurc
gimpdata_SCRIPTS = user_install

View File

@ -968,13 +968,14 @@ user_install_run (void)
if (executable)
{
#ifdef G_OS_WIN32
char *quoted_data_dir, *quoted_user_dir;
char *quoted_data_dir, *quoted_user_dir, *quoted_sysconf_dir;
/* On Windows, it is common for the GIMP data directory
* to have spaces in it ("c:\Program Files\GIMP"). Put spaces in quotes.
*/
quoted_data_dir = quote_spaces (gimp_data_directory ());
quoted_user_dir = quote_spaces (gimp_directory ());
quoted_sysconf_dir = quote_spaces (gimp_sysconf_directory ())
/* The Microsoft _popen doesn't work in Windows applications, sigh.
* Do the installation by calling system(). The user_install.bat
@ -984,14 +985,15 @@ user_install_run (void)
*/
AllocConsole ();
g_snprintf (buffer, sizeof(buffer), "%s" G_DIR_SEPARATOR_S USER_INSTALL " %s %s",
g_snprintf (buffer, sizeof(buffer), "%s" G_DIR_SEPARATOR_S USER_INSTALL " %s %s %s",
quoted_data_dir, quoted_data_dir,
quoted_user_dir);
quoted_user_dir, quoted_sysconf_dir);
if (system (buffer) == -1)
executable = FALSE;
g_free (quoted_data_dir);
g_free (quoted_user_dir);
g_free (quoted_sysconf_dir);
if (executable)
add_label (GTK_BOX (log_page),
@ -1000,14 +1002,14 @@ user_install_run (void)
"Otherwise, quit and investigate the possible reason..."));
#else
#ifndef __EMX__
g_snprintf (buffer, sizeof(buffer), "%s" G_DIR_SEPARATOR_S USER_INSTALL " %s %s %s",
g_snprintf (buffer, sizeof(buffer), "%s" G_DIR_SEPARATOR_S USER_INSTALL " %s %s %s %s",
gimp_data_directory (),
"2>&1",
gimp_data_directory(), gimp_directory ());
gimp_data_directory(), gimp_directory (), gimp_sysconf_directory());
#else
g_snprintf (buffer, sizeof(buffer), "cmd.exe /c %s" G_DIR_SEPARATOR_S USER_INSTALL " %s %s",
g_snprintf (buffer, sizeof(buffer), "cmd.exe /c %s" G_DIR_SEPARATOR_S USER_INSTALL " %s %s %s",
gimp_data_directory (), gimp_data_directory(),
gimp_directory ());
gimp_directory (), gimp_sysconf_directory());
{
char *s = buffer + 10;
while (*s)

View File

@ -372,7 +372,7 @@ gimp_system_rc_file (void)
if (value != NULL)
return value;
value = g_strconcat (gimp_data_directory (), G_DIR_SEPARATOR_S,
value = g_strconcat (gimp_sysconf_directory (), G_DIR_SEPARATOR_S,
"gimprc", NULL);
return value;
}

View File

@ -968,13 +968,14 @@ user_install_run (void)
if (executable)
{
#ifdef G_OS_WIN32
char *quoted_data_dir, *quoted_user_dir;
char *quoted_data_dir, *quoted_user_dir, *quoted_sysconf_dir;
/* On Windows, it is common for the GIMP data directory
* to have spaces in it ("c:\Program Files\GIMP"). Put spaces in quotes.
*/
quoted_data_dir = quote_spaces (gimp_data_directory ());
quoted_user_dir = quote_spaces (gimp_directory ());
quoted_sysconf_dir = quote_spaces (gimp_sysconf_directory ())
/* The Microsoft _popen doesn't work in Windows applications, sigh.
* Do the installation by calling system(). The user_install.bat
@ -984,14 +985,15 @@ user_install_run (void)
*/
AllocConsole ();
g_snprintf (buffer, sizeof(buffer), "%s" G_DIR_SEPARATOR_S USER_INSTALL " %s %s",
g_snprintf (buffer, sizeof(buffer), "%s" G_DIR_SEPARATOR_S USER_INSTALL " %s %s %s",
quoted_data_dir, quoted_data_dir,
quoted_user_dir);
quoted_user_dir, quoted_sysconf_dir);
if (system (buffer) == -1)
executable = FALSE;
g_free (quoted_data_dir);
g_free (quoted_user_dir);
g_free (quoted_sysconf_dir);
if (executable)
add_label (GTK_BOX (log_page),
@ -1000,14 +1002,14 @@ user_install_run (void)
"Otherwise, quit and investigate the possible reason..."));
#else
#ifndef __EMX__
g_snprintf (buffer, sizeof(buffer), "%s" G_DIR_SEPARATOR_S USER_INSTALL " %s %s %s",
g_snprintf (buffer, sizeof(buffer), "%s" G_DIR_SEPARATOR_S USER_INSTALL " %s %s %s %s",
gimp_data_directory (),
"2>&1",
gimp_data_directory(), gimp_directory ());
gimp_data_directory(), gimp_directory (), gimp_sysconf_directory());
#else
g_snprintf (buffer, sizeof(buffer), "cmd.exe /c %s" G_DIR_SEPARATOR_S USER_INSTALL " %s %s",
g_snprintf (buffer, sizeof(buffer), "cmd.exe /c %s" G_DIR_SEPARATOR_S USER_INSTALL " %s %s %s",
gimp_data_directory (), gimp_data_directory(),
gimp_directory ());
gimp_directory (), gimp_sysconf_directory());
{
char *s = buffer + 10;
while (*s)

View File

@ -968,13 +968,14 @@ user_install_run (void)
if (executable)
{
#ifdef G_OS_WIN32
char *quoted_data_dir, *quoted_user_dir;
char *quoted_data_dir, *quoted_user_dir, *quoted_sysconf_dir;
/* On Windows, it is common for the GIMP data directory
* to have spaces in it ("c:\Program Files\GIMP"). Put spaces in quotes.
*/
quoted_data_dir = quote_spaces (gimp_data_directory ());
quoted_user_dir = quote_spaces (gimp_directory ());
quoted_sysconf_dir = quote_spaces (gimp_sysconf_directory ())
/* The Microsoft _popen doesn't work in Windows applications, sigh.
* Do the installation by calling system(). The user_install.bat
@ -984,14 +985,15 @@ user_install_run (void)
*/
AllocConsole ();
g_snprintf (buffer, sizeof(buffer), "%s" G_DIR_SEPARATOR_S USER_INSTALL " %s %s",
g_snprintf (buffer, sizeof(buffer), "%s" G_DIR_SEPARATOR_S USER_INSTALL " %s %s %s",
quoted_data_dir, quoted_data_dir,
quoted_user_dir);
quoted_user_dir, quoted_sysconf_dir);
if (system (buffer) == -1)
executable = FALSE;
g_free (quoted_data_dir);
g_free (quoted_user_dir);
g_free (quoted_sysconf_dir);
if (executable)
add_label (GTK_BOX (log_page),
@ -1000,14 +1002,14 @@ user_install_run (void)
"Otherwise, quit and investigate the possible reason..."));
#else
#ifndef __EMX__
g_snprintf (buffer, sizeof(buffer), "%s" G_DIR_SEPARATOR_S USER_INSTALL " %s %s %s",
g_snprintf (buffer, sizeof(buffer), "%s" G_DIR_SEPARATOR_S USER_INSTALL " %s %s %s %s",
gimp_data_directory (),
"2>&1",
gimp_data_directory(), gimp_directory ());
gimp_data_directory(), gimp_directory (), gimp_sysconf_directory());
#else
g_snprintf (buffer, sizeof(buffer), "cmd.exe /c %s" G_DIR_SEPARATOR_S USER_INSTALL " %s %s",
g_snprintf (buffer, sizeof(buffer), "cmd.exe /c %s" G_DIR_SEPARATOR_S USER_INSTALL " %s %s %s",
gimp_data_directory (), gimp_data_directory(),
gimp_directory ());
gimp_directory (), gimp_sysconf_directory());
{
char *s = buffer + 10;
while (*s)

View File

@ -77,7 +77,7 @@ AC_ARG_ENABLE(ansi, [ --enable-ansi turn on strict ansi [default=no]]
, enable_ansi=no)
dnl Possibly change default gimpdir from .gimp
gimpdir=.gimp-1.1
gimpdir=.$PACKAGE-$GIMP_MAJOR_VERSION.$GIMP_MINOR_VERSION
AC_ARG_ENABLE(gimpdir, [ --enable-gimpdir=DIR change default gimpdir from .gimp to DIR],
if eval "test x$enable_gimpdir != x"; then
if eval "test x$enable_gimpdir != xyes"; then
@ -481,6 +481,8 @@ fi
gimpdatadir=$datadir/$PACKAGE/$GIMP_MAJOR_VERSION.$GIMP_MINOR_VERSION
gimpplugindir=$libdir/$PACKAGE/$GIMP_MAJOR_VERSION.$GIMP_MINOR_VERSION
gimpsysconfdir=$sysconfdir/$PACKAGE/$GIMP_MAJOR_VERSION.$GIMP_MINOR_VERSION
localedir='${prefix}/${DATADIRNAME}/locale'
brushdata=`ls -1 $srcdir/data/brushes | grep -v Makefile`
@ -708,6 +710,7 @@ AC_SUBST(GLIB_LIBS)
AC_SUBST(gimpdir)
AC_SUBST(gimpdatadir)
AC_SUBST(gimpplugindir)
AC_SUBST(gimpsysconfdir)
AC_SUBST(localedir)
AC_SUBST(brushdata)
AC_SUBST(gradientdata)

View File

@ -13,14 +13,14 @@
echo "mkdir $2"
mkdir $2
echo "cp $1/gimprc_user $2/gimprc"
cp $1/gimprc_user $2/gimprc
echo "cp $3/gimprc_user $2/gimprc"
cp $3/gimprc_user $2/gimprc
echo "cp $1/unitrc $2/unitrc"
cp $1/unitrc $2/unitrc
echo "cp $3/unitrc $2/unitrc"
cp $3/unitrc $2/unitrc
echo "cp $1/gtkrc $2/gtkrc"
cp $1/gtkrc $2/gtkrc
echo "cp $3/gtkrc $2/gtkrc"
cp $3/gtkrc $2/gtkrc
echo "mkdir $2/brushes"
mkdir $2/brushes

View File

@ -1,9 +1,9 @@
@REM This file is executed by the GIMP. Do NOT run this yourself.
@echo off
mkdir %2
copy %1\gimprc_user %2\gimprc
copy %1\unitrc %2\unitrc
copy %1\gtkrc_user %2\gtkrc
copy %3\gimprc_user %2\gimprc
copy %3\unitrc %2\unitrc
copy %3\gtkrc_user %2\gtkrc
mkdir %2\brushes
mkdir %2\generated_brushes
mkdir %2\gradients

View File

@ -1,3 +1,11 @@
2000-10-14 Sven Neumann <sven@gimp.org>
* libgimp/libgimp-decl.txt
* libgimp/libgimp-sections.txt
* libgimp/libgimp.signals
* libgimp/tmpl/gimpenv.sgml
* libgimp/tmpl/gimpchainbutton.sgml: updated
2000-08-25 Sven Neumann <sven@gimp.org>
* libgimp/libgimp-decl.txt

View File

@ -124,7 +124,7 @@ union GimpParamData
gint32 d_unit;
GimpParasite d_parasite;
gint32 d_tattoo;
gint32 d_status;
GimpPDBStatusType d_status;
};
</UNION>
<STRUCT>
@ -338,7 +338,9 @@ struct GimpChainButton
<NAME>GimpChainButtonClass</NAME>
struct GimpChainButtonClass
{
GtkButtonClass parent_class;
GtkTableClass parent_class;
void (* toggled) (GimpChainButton *gcb);
};
</STRUCT>
<FUNCTION>
@ -2053,6 +2055,11 @@ gchar *basename
void
</FUNCTION>
<FUNCTION>
<NAME>gimp_sysconf_directory</NAME>
<RETURNS>gchar *</RETURNS>
void
</FUNCTION>
<FUNCTION>
<NAME>gimp_gtkrc</NAME>
<RETURNS>gchar *</RETURNS>
void
@ -5286,11 +5293,11 @@ GIOChannel *channel,gchar **data,gint count
</MACRO>
<MACRO>
<NAME>GIMP_MICRO_VERSION</NAME>
#define GIMP_MICRO_VERSION (25)
#define GIMP_MICRO_VERSION (27)
</MACRO>
<MACRO>
<NAME>GIMP_VERSION</NAME>
#define GIMP_VERSION "1.1.25"
#define GIMP_VERSION "1.1.27"
</MACRO>
<MACRO>
<NAME>GIMP_CHECK_VERSION</NAME>

View File

@ -319,6 +319,7 @@ gimp_color_display_unregister
gimp_directory
gimp_personal_rc_file
gimp_data_directory
gimp_sysconf_directory
gimp_gtkrc
gimp_path_parse
gimp_path_free

View File

@ -1,3 +1,9 @@
<SIGNAL>
<NAME>GimpChainButton::toggled</NAME>
<RETURNS>void</RETURNS>
GimpChainButton *gimpchainbutton
</SIGNAL>
<SIGNAL>
<NAME>GimpColorButton::color-changed</NAME>
<RETURNS>void</RETURNS>

View File

@ -74,3 +74,10 @@ performs the cast if valid.
@Returns:
<!-- ##### SIGNAL GimpChainButton::toggled ##### -->
<para>
</para>
@gimpchainbutton: the object which received the signal.

View File

@ -40,6 +40,14 @@ configuration files.
@Returns:
<!-- ##### FUNCTION gimp_sysconf_directory ##### -->
<para>
</para>
@Returns:
<!-- ##### FUNCTION gimp_gtkrc ##### -->
<para>

View File

@ -105,19 +105,20 @@ stored in the RESOURCE_MANAGER property.
.SH FILES
Gimp's data files are stored in @gimpdatadir@, where ${prefix}
is set on install, but is typically /usr/local.
Most gimp configuration is read in from the users init file,
is set on install, but is typically /usr/local. Gimp's system-wide
configuration files are stored in @gimpsysconfdir@.
Most gimp configuration is read in from the user's init file,
\fB$HOME\fP/@gimpdir@/gimprc. The system wide equivalent is in
@gimpdatadir@/gimprc. The system wide file is parsed
first and the user gimprc can override the sytem settings.
@gimpdatadir@/gimprc_user is the default gimprc
placed in users home directories the first time gimp is ran.
@sysconfdir@/gimprc. The system wide file is parsed
first and the user gimprc can override the system settings.
@sysconfdir@/gimprc_user is the default gimprc
placed in users' home directories the first time gimp is run.
\fB$HOME\fP/@gimpdir@/gtkrc - users set of gimp-specific GTK
config settings. Options such as widget color and fonts sizes
can be set here.
@gimpdatadir@/gtkrc - sytem wide default set of gimp-specific
@gimpsysconfdir@/gtkrc - sytem wide default set of gimp-specific
GTK config settings.
\fB$HOME\fP/@gimpdir@/ideas - lists all images that have been
@ -125,7 +126,7 @@ opened or saved using Gimp.
\fB$HOME\fP/@gimpdir@/menurc - user's set of keybindings.
@gimpdatadir@/menurc - system wide set of keybindings.
@gimpsysconfdir@/menurc - system wide set of keybindings.
\fB$HOME\fP/@gimpdir@/parasiterc - Description of all available
gimp parasites. This is file is recreated everytime gimp starts up.
@ -136,7 +137,7 @@ not supposed to edit it manually, but of course you
can do. This file will be entirely rewritten every time
you quit the gimp. If this file isn't found, defaults are used.
@gimpdatadir@/unitrc - default user unit database. It
@gimpsysconfdir@/unitrc - default user unit database. It
contains the unit definitions for centimeters, meters, feet, yards,
typographic points and typographic picas and is placed in users home
directories the first time the gimp is ran.

View File

@ -105,19 +105,20 @@ stored in the RESOURCE_MANAGER property.
.SH FILES
Gimp's data files are stored in @gimpdatadir@, where ${prefix}
is set on install, but is typically /usr/local.
Most gimp configuration is read in from the users init file,
is set on install, but is typically /usr/local. Gimp's system-wide
configuration files are stored in @gimpsysconfdir@.
Most gimp configuration is read in from the user's init file,
\fB$HOME\fP/@gimpdir@/gimprc. The system wide equivalent is in
@gimpdatadir@/gimprc. The system wide file is parsed
first and the user gimprc can override the sytem settings.
@gimpdatadir@/gimprc_user is the default gimprc
placed in users home directories the first time gimp is ran.
@sysconfdir@/gimprc. The system wide file is parsed
first and the user gimprc can override the system settings.
@sysconfdir@/gimprc_user is the default gimprc
placed in users' home directories the first time gimp is run.
\fB$HOME\fP/@gimpdir@/gtkrc - users set of gimp-specific GTK
config settings. Options such as widget color and fonts sizes
can be set here.
@gimpdatadir@/gtkrc - sytem wide default set of gimp-specific
@gimpsysconfdir@/gtkrc - sytem wide default set of gimp-specific
GTK config settings.
\fB$HOME\fP/@gimpdir@/ideas - lists all images that have been
@ -125,7 +126,7 @@ opened or saved using Gimp.
\fB$HOME\fP/@gimpdir@/menurc - user's set of keybindings.
@gimpdatadir@/menurc - system wide set of keybindings.
@gimpsysconfdir@/menurc - system wide set of keybindings.
\fB$HOME\fP/@gimpdir@/parasiterc - Description of all available
gimp parasites. This is file is recreated everytime gimp starts up.
@ -136,7 +137,7 @@ not supposed to edit it manually, but of course you
can do. This file will be entirely rewritten every time
you quit the gimp. If this file isn't found, defaults are used.
@gimpdatadir@/unitrc - default user unit database. It
@gimpsysconfdir@/unitrc - default user unit database. It
contains the unit definitions for centimeters, meters, feet, yards,
typographic points and typographic picas and is placed in users home
directories the first time the gimp is ran.

View File

@ -2,6 +2,7 @@
%define microver @GIMP_MICRO_VERSION@
%define ver @VERSION@
%define prefix /usr
%define sysconfdir /etc
Summary: The GNU Image Manipulation Program
Name: gimp
@ -178,13 +179,14 @@ cat gimp-perl gimp-perl-plugin-files > gimp-perl-files
%{prefix}/share/gimp/%{subver}/patterns/
%{prefix}/share/gimp/%{subver}/scripts/
%{prefix}/share/gimp/%{subver}/gimprc
%{prefix}/share/gimp/%{subver}/gimprc_user
%{prefix}/share/gimp/%{subver}/gtkrc
%{prefix}/share/gimp/%{subver}/unitrc
%{sysconfdir}/gimp-%{subver}/gimprc
%{sysconfdir}/gimp-%{subver}/gimprc_user
%{sysconfdir}/gimp-%{subver}/gtkrc
%{sysconfdir}/gimp-%{subver}/unitrc
%{sysconfdir}/gimp-%{subver}/ps-menurc
%{prefix}/share/gimp/%{subver}/gimp_logo.ppm
%{prefix}/share/gimp/%{subver}/gimp_splash.ppm
%{prefix}/share/gimp/%{subver}/ps-menurc
%defattr (0555, bin, bin)
%{prefix}/share/gimp/%{subver}/user_install

View File

@ -31,7 +31,11 @@
.\" Wed Mar 3 13:09:52 MET 1999 Sven Neumann <sven@gimp.org>
.\" * reflect the changes that were made to the resolution stuff
.\"
.TH GIMPRC 5 "23 June 2000" "Version @GIMP_VERSION@" "GIMP Manual Pages"
.\" Thu Oct 12 20:14:36 PDT 2000 Ben Gertzfield <che@debian.org>
.\" * Move gimprc to gimpsysconfdir, make FILES section reflect this
.\" * Removed .gimp-1.1 hard ref, replace with gimpdir
.\"
.TH GIMPRC 5 "14 Oct 2000" "Version @GIMP_VERSION@" "GIMP Manual Pages"
.SH NAME
gimprc \- gimp configuration file
.SH DESCRIPTION
@ -39,7 +43,7 @@ The
.B gimprc
file is a configuation file read by the gimp when it starts up. There
are two of these: one system-wide one stored in
@prefix@/share/gimp/gimprc and a per-user \fB$HOME\fP/@gimpdir@/gimprc
@gimpsysconfdir@/gimprc and a per-user \fB$HOME\fP/@gimpdir@/gimprc
which may override system settings.
Comments are introduced by a hash sign (#), and continue until the
@ -450,10 +454,10 @@ Base for paths to architecture-specific plugins and modules,
.SH FILES
.TP
.I $PREFIX/share/gimp/gimprc
.I @gimpsysconfdir@/gimprc
System-wide configuration file
.TP
.I $HOME/.gimp-1.1/gimprc
.I $HOME/@gimpdir@/gimprc
Per-user configuration file
.SH "SEE ALSO"
.BR gimp (1),

View File

@ -31,7 +31,11 @@
.\" Wed Mar 3 13:09:52 MET 1999 Sven Neumann <sven@gimp.org>
.\" * reflect the changes that were made to the resolution stuff
.\"
.TH GIMPRC 5 "23 June 2000" "Version @GIMP_VERSION@" "GIMP Manual Pages"
.\" Thu Oct 12 20:14:36 PDT 2000 Ben Gertzfield <che@debian.org>
.\" * Move gimprc to gimpsysconfdir, make FILES section reflect this
.\" * Removed .gimp-1.1 hard ref, replace with gimpdir
.\"
.TH GIMPRC 5 "14 Oct 2000" "Version @GIMP_VERSION@" "GIMP Manual Pages"
.SH NAME
gimprc \- gimp configuration file
.SH DESCRIPTION
@ -39,7 +43,7 @@ The
.B gimprc
file is a configuation file read by the gimp when it starts up. There
are two of these: one system-wide one stored in
@prefix@/share/gimp/gimprc and a per-user \fB$HOME\fP/@gimpdir@/gimprc
@gimpsysconfdir@/gimprc and a per-user \fB$HOME\fP/@gimpdir@/gimprc
which may override system settings.
Comments are introduced by a hash sign (#), and continue until the
@ -450,10 +454,10 @@ Base for paths to architecture-specific plugins and modules,
.SH FILES
.TP
.I $PREFIX/share/gimp/gimprc
.I @gimpsysconfdir@/gimprc
System-wide configuration file
.TP
.I $HOME/.gimp-1.1/gimprc
.I $HOME/@gimpdir@/gimprc
Per-user configuration file
.SH "SEE ALSO"
.BR gimp (1),

View File

@ -5,6 +5,7 @@ gimpincludedir = $(includedir)/libgimp
AM_CPPFLAGS = \
-DGIMPDIR=\""$(gimpdir)"\" \
-DDATADIR=\""$(gimpdatadir)"\" \
-DSYSCONFDIR=\""$(gimpsysconfdir)"\" \
-DG_LOG_DOMAIN=\"LibGimp\" \
@GIMP_THREAD_FLAGS@

View File

@ -236,6 +236,81 @@ gimp_data_directory (void)
return gimp_data_dir;
}
/**
* gimp_sysconf_directory:
*
* Returns the top directory for GIMP config files. If the environment
* variable GIMP_SYSCONFDIR exists, that is used. It should be an
* absolute pathname. Otherwise, on Unix the compile-time defined
* directory is used. On Win32, the installation directory as deduced
* from the executable's name is used.
*
* The returned string is allocated just once, and should *NOT* be
* freed with g_free().
*
* Returns: The top directory for GIMP config files. */
gchar*
gimp_sysconf_directory (void)
{
static gchar *gimp_sysconf_dir = NULL;
gchar *env_gimp_sysconf_dir = NULL;
if (gimp_sysconf_dir != NULL)
return gimp_sysconf_dir;
env_gimp_sysconf_dir = g_getenv ("GIMP_SYSCONFDIR");
if (NULL != env_gimp_sysconf_dir)
{
if (!g_path_is_absolute (env_gimp_sysconf_dir))
g_error ("GIMP_SYSCONFDIR environment variable should be an absolute path.");
#ifndef __EMX__
gimp_sysconf_dir = g_strdup (env_gimp_sysconf_dir);
#else
gimp_sysconf_dir = g_strdup (__XOS2RedirRoot(env_gimp_sysconf_dir));
#endif
}
else
{
#ifndef G_OS_WIN32
#ifndef __EMX__
gimp_sysconf_dir = SYSCONFDIR;
#else
gimp_sysconf_dir = g_strdup(__XOS2RedirRoot(SYSCONFDIR));
#endif
#else
/* Figure it out from the executable name */
gchar filename[MAX_PATH];
gchar *sep1, *sep2;
if (GetModuleFileName (NULL, filename, sizeof (filename)) == 0)
g_error ("GetModuleFilename failed\n");
/* If the executable file name is of the format
* <foobar>\bin\gimp.exe of <foobar>\plug-ins\filter.exe, * use
* <foobar>. Otherwise, use the directory where the executable
* is.
*/
sep1 = strrchr (filename, G_DIR_SEPARATOR);
*sep1 = '\0';
sep2 = strrchr (filename, G_DIR_SEPARATOR);
if (sep2 != NULL)
{
if (g_strcasecmp (sep2 + 1, "bin") == 0
|| g_strcasecmp (sep2 + 1, "plug-ins") == 0)
*sep2 = '\0';
}
gimp_sysconf_dir = g_strdup (filename);
#endif
}
return gimp_sysconf_dir;
}
/**
* gimp_gtkrc:
*
@ -255,7 +330,7 @@ gimp_gtkrc (void)
return gimp_gtkrc_filename;
gimp_gtkrc_filename = g_strconcat (gimp_directory (),
gimp_gtkrc_filename = g_strconcat (gimp_sysconf_directory (),
G_DIR_SEPARATOR_S,
"gtkrc",
NULL);

View File

@ -34,6 +34,7 @@ extern "C" {
gchar * gimp_directory (void);
gchar * gimp_personal_rc_file (gchar *basename);
gchar * gimp_data_directory (void);
gchar * gimp_sysconf_directory (void);
gchar * gimp_gtkrc (void);
GList * gimp_path_parse (gchar *path,

View File

@ -236,6 +236,81 @@ gimp_data_directory (void)
return gimp_data_dir;
}
/**
* gimp_sysconf_directory:
*
* Returns the top directory for GIMP config files. If the environment
* variable GIMP_SYSCONFDIR exists, that is used. It should be an
* absolute pathname. Otherwise, on Unix the compile-time defined
* directory is used. On Win32, the installation directory as deduced
* from the executable's name is used.
*
* The returned string is allocated just once, and should *NOT* be
* freed with g_free().
*
* Returns: The top directory for GIMP config files. */
gchar*
gimp_sysconf_directory (void)
{
static gchar *gimp_sysconf_dir = NULL;
gchar *env_gimp_sysconf_dir = NULL;
if (gimp_sysconf_dir != NULL)
return gimp_sysconf_dir;
env_gimp_sysconf_dir = g_getenv ("GIMP_SYSCONFDIR");
if (NULL != env_gimp_sysconf_dir)
{
if (!g_path_is_absolute (env_gimp_sysconf_dir))
g_error ("GIMP_SYSCONFDIR environment variable should be an absolute path.");
#ifndef __EMX__
gimp_sysconf_dir = g_strdup (env_gimp_sysconf_dir);
#else
gimp_sysconf_dir = g_strdup (__XOS2RedirRoot(env_gimp_sysconf_dir));
#endif
}
else
{
#ifndef G_OS_WIN32
#ifndef __EMX__
gimp_sysconf_dir = SYSCONFDIR;
#else
gimp_sysconf_dir = g_strdup(__XOS2RedirRoot(SYSCONFDIR));
#endif
#else
/* Figure it out from the executable name */
gchar filename[MAX_PATH];
gchar *sep1, *sep2;
if (GetModuleFileName (NULL, filename, sizeof (filename)) == 0)
g_error ("GetModuleFilename failed\n");
/* If the executable file name is of the format
* <foobar>\bin\gimp.exe of <foobar>\plug-ins\filter.exe, * use
* <foobar>. Otherwise, use the directory where the executable
* is.
*/
sep1 = strrchr (filename, G_DIR_SEPARATOR);
*sep1 = '\0';
sep2 = strrchr (filename, G_DIR_SEPARATOR);
if (sep2 != NULL)
{
if (g_strcasecmp (sep2 + 1, "bin") == 0
|| g_strcasecmp (sep2 + 1, "plug-ins") == 0)
*sep2 = '\0';
}
gimp_sysconf_dir = g_strdup (filename);
#endif
}
return gimp_sysconf_dir;
}
/**
* gimp_gtkrc:
*
@ -255,7 +330,7 @@ gimp_gtkrc (void)
return gimp_gtkrc_filename;
gimp_gtkrc_filename = g_strconcat (gimp_directory (),
gimp_gtkrc_filename = g_strconcat (gimp_sysconf_directory (),
G_DIR_SEPARATOR_S,
"gtkrc",
NULL);

View File

@ -34,6 +34,7 @@ extern "C" {
gchar * gimp_directory (void);
gchar * gimp_personal_rc_file (gchar *basename);
gchar * gimp_data_directory (void);
gchar * gimp_sysconf_directory (void);
gchar * gimp_gtkrc (void);
GList * gimp_path_parse (gchar *path,

View File

@ -13,14 +13,14 @@
echo "mkdir $2"
mkdir $2
echo "cp $1/gimprc_user $2/gimprc"
cp $1/gimprc_user $2/gimprc
echo "cp $3/gimprc_user $2/gimprc"
cp $3/gimprc_user $2/gimprc
echo "cp $1/unitrc $2/unitrc"
cp $1/unitrc $2/unitrc
echo "cp $3/unitrc $2/unitrc"
cp $3/unitrc $2/unitrc
echo "cp $1/gtkrc $2/gtkrc"
cp $1/gtkrc $2/gtkrc
echo "cp $3/gtkrc $2/gtkrc"
cp $3/gtkrc $2/gtkrc
echo "mkdir $2/brushes"
mkdir $2/brushes

View File

@ -1,9 +1,9 @@
@REM This file is executed by the GIMP. Do NOT run this yourself.
@echo off
mkdir %2
copy %1\gimprc_user %2\gimprc
copy %1\unitrc %2\unitrc
copy %1\gtkrc_user %2\gtkrc
copy %3\gimprc_user %2\gimprc
copy %3\unitrc %2\unitrc
copy %3\gtkrc_user %2\gtkrc
mkdir %2\brushes
mkdir %2\generated_brushes
mkdir %2\gradients