Commit 5e8ee554 authored by Michael Natterer's avatar Michael Natterer Committed by Michael Natterer

This implements the rest of the unit system (unitrc loading and saving and

1999-03-16  Michael Natterer  <mitschel@cs.tu-berlin.de>

        This implements the rest of the unit system (unitrc loading and
        saving and full PDB interface)

        * Makefile.am
        * gimp.1
        * user_install
        * user_install.bat
        * unitrc: new file (default unit database) and some documentation

        * app/Makefile.am
        * app/gimpunit.c
        * app/gimpunit_cmds.h
        * app/unitrc.h: new files enabling the unit database and PDB
        access to the unit system

        * app/app_procs.c: parse and save unitrc
        * app/gimprc.[ch]: enable unit parsing. New function
        init_parse_buffers() to enable unitrc to be loaded before gimprc

        * app/gimage_cmds.[ch]: new PDB procedures which set/return an
        image's unit

        * app/install.c: mention unitrc installation

        * app/xcf.c: new xcf property for user defined units. An image's
        unit is saved as either an integer ID (built in units) or as
        a full unit definition without any ID

        * libgimp/Makefile.am: moved gimpunit.o from libgimpi.a to
        libgimp.a

        * libgimp/gimp.h
        * libgimp/gimpimage.c: get/set an image's unit with PDB calls

        * libgimp/gimpunit.h: this file is now the header for both
        app/gimpunit.c and libgimp/gimpunit.c

        * libgimp/gimpunit.c: does the unit calls as PDB calls now

        * libgimp/gimpunitmenu.[ch]: enable user unit functionality and a
        unit selection dialog

        * libgimp/gimpsizeentry.c: disble hilighting on focus_in_event and
        minor bugfixes

        * plug-ins/tiff/tiff.c: set image unit to "mm" if tiff unit is
        "cm", save "cm" if image unit is metric
parent 76605080
1999-03-16 Michael Natterer <mitschel@cs.tu-berlin.de>
This implements the rest of the unit system (unitrc loading and
saving and full PDB interface)
* Makefile.am
* gimp.1
* user_install
* user_install.bat
* unitrc: new file (default unit database) and some documentation
* app/Makefile.am
* app/gimpunit.c
* app/gimpunit_cmds.h
* app/unitrc.h: new files enabling the unit database and PDB
access to the unit system
* app/app_procs.c: parse and save unitrc
* app/gimprc.[ch]: enable unit parsing. New function
init_parse_buffers() to enable unitrc to be loaded before gimprc
* app/gimage_cmds.[ch]: new PDB procedures which set/return an
image's unit
* app/install.c: mention unitrc installation
* app/xcf.c: new xcf property for user defined units. An image's
unit is saved as either an integer ID (built in units) or as
a full unit definition without any ID
* libgimp/Makefile.am: moved gimpunit.o from libgimpi.a to
libgimp.a
* libgimp/gimp.h
* libgimp/gimpimage.c: get/set an image's unit with PDB calls
* libgimp/gimpunit.h: this file is now the header for both
app/gimpunit.c and libgimp/gimpunit.c
* libgimp/gimpunit.c: does the unit calls as PDB calls now
* libgimp/gimpunitmenu.[ch]: enable user unit functionality and a
unit selection dialog
* libgimp/gimpsizeentry.c: disble hilighting on focus_in_event and
minor bugfixes
* plug-ins/tiff/tiff.c: set image unit to "mm" if tiff unit is
"cm", save "cm" if image unit is metric
Mon Mar 15 14:40:29 1999 Raph Levien <raph@gimp.org>
* plug-ins/sharpen/sharpen.c: Fixed the algorithm so that it
......
......@@ -34,6 +34,7 @@ EXTRA_DIST = \
MAINTAINERS \
TODO \
gtkrc \
unitrc \
gimp_logo.ppm \
gimp_splash.ppm \
gimp1_1_splash.ppm \
......@@ -54,6 +55,7 @@ gimpdata_DATA = \
gimprc_user \
gimprc.5 \
gtkrc \
unitrc \
gimp_logo.ppm \
gimp_splash.ppm \
gimp1_1_splash.ppm \
......
......@@ -199,6 +199,7 @@ gimp_SOURCES = \
gimphistogram.c \
gimphistogram.h \
gimphistogramP.h \
gimpunit.c \
global_edit.c \
global_edit.h \
gradient.c \
......@@ -349,6 +350,8 @@ gimp_SOURCES = \
undo.h \
undo_cmds.c \
undo_cmds.h \
unit_cmds.h \
unitrc.h \
wilber.h \
vector2d.c \
vector2d.h \
......
......@@ -77,6 +77,7 @@
#include "tips_dialog.h"
#include "tools.h"
#include "undo.h"
#include "unitrc.h"
#include "xcf.h"
#include "errors.h"
#include "docindex.h"
......@@ -507,6 +508,8 @@ app_init (void)
procedural_db_register (&quit_proc);
RESET_BAR();
init_parse_buffers ();
parse_unitrc (); /* this needs to be done before gimprc loading */
parse_gimprc (); /* parse the local GIMP configuration file */
if (always_restore_session)
......@@ -631,6 +634,7 @@ app_exit_finish (void)
error_console_free ();
menus_quit ();
tile_swap_exit ();
save_unitrc ();
/* Things to do only if there is an interface */
if (no_interface == FALSE)
......
This diff is collapsed.
/* The GIMP -- an image manipulation program
* Copyright (C) 1995 Spencer Kimball and Peter Mattis
*
* 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.
*/
#ifndef __UNITRC_H__
#define __UNITRC_H__
void parse_unitrc (void);
void save_unitrc (void);
#endif /* __UNITRC_H__ */
......@@ -202,6 +202,18 @@ install_help (InstallCallback callback)
_("\t\tPaths to search for brushes, palettes, gradients\n"), -1);
gtk_text_insert (GTK_TEXT (text), font, NULL, NULL,
_("\t\tpatterns, plug-ins and modules are also configured here.\n"), -1);
gtk_text_insert (GTK_TEXT (text), font_emphasis, NULL, NULL,
_("unitrc\n"), -1);
gtk_text_insert (GTK_TEXT (text), font, NULL, NULL,
_("\t\tThe unitrc is used to store your user units database.\n"), -1);
gtk_text_insert (GTK_TEXT (text), font, NULL, NULL,
_("\t\tYou can define additional units and use them just\n"), -1);
gtk_text_insert (GTK_TEXT (text), font, NULL, NULL,
_("\t\tlike you use the built-in units inches, millimeters,\n"), -1);
gtk_text_insert (GTK_TEXT (text), font, NULL, NULL,
_("\t\tpoints and picas. This file is overwritten each time\n"), -1);
gtk_text_insert (GTK_TEXT (text), font, NULL, NULL,
_("\t\tyou quit the GIMP.\n"), -1);
gtk_text_insert (GTK_TEXT (text), font_emphasis, NULL, NULL,
_("pluginrc\n"), -1);
gtk_text_insert (GTK_TEXT (text), font, NULL, NULL,
......
......@@ -3061,6 +3061,149 @@ ProcRecord gimage_set_resolution_proc =
/***************************/
/* GIMAGE_GET_UNIT */
static Argument *
gimage_get_unit_invoker (Argument *args)
{
GImage *gimage;
GUnit unit;
Argument *return_args;
unit = UNIT_PIXEL; /* pixel is not a valid image unit */
success = TRUE;
if (success)
{
int_value = args[0].value.pdb_int;
if ((gimage = gimage_get_ID (int_value))) {
unit = gimage->unit;
} else {
success = FALSE;
}
}
return_args= procedural_db_return_args(&gimage_get_unit_proc, success);
if (success)
{
return_args[1].value.pdb_int = unit;
}
return return_args;
}
/* The procedure definition */
ProcArg gimage_get_unit_args[] =
{
{ PDB_IMAGE,
"image",
"the image"
}
};
ProcArg gimage_get_unit_out_args[] =
{
{ PDB_INT32,
"unit",
"the unit ID of the image's display unit",
}
};
ProcRecord gimage_get_unit_proc =
{
"gimp_image_get_unit",
"Returns the unit of the image",
"This procedure returns the unit ID of the image's unit. This value is independent of any of the layers in this image. A return value of 0 means the image was invalid. See the gimp_unit_* procedure definitions for the valid range of unit IDs and a description of the unit system.",
"Michael Natterer",
"Michael Natterer",
"1999",
PDB_INTERNAL,
/* Input arguments */
1,
gimage_get_unit_args,
/* Output arguments */
1,
gimage_get_unit_out_args,
/* Exec method */
{ { gimage_get_unit_invoker } },
};
/***************************/
/* GIMAGE_SET_UNIT */
static Argument *
gimage_set_unit_invoker (Argument *args)
{
GImage *gimage;
Argument *return_args;
GUnit unit;
success = TRUE;
if (success)
{
int_value = args[0].value.pdb_int;
if (!(gimage = gimage_get_ID (int_value)))
success = FALSE;
}
if (success)
{
unit = args[1].value.pdb_int;
if ((unit < UNIT_INCH) || (unit >= gimp_unit_get_number_of_units ()))
success = FALSE;
else
gimage->unit = unit;
}
return_args= procedural_db_return_args(&gimage_set_unit_proc, success);
return return_args;
}
/* The procedure definition */
ProcArg gimage_set_unit_args[] =
{
{ PDB_IMAGE,
"image",
"the image"
},
{ PDB_INT32,
"unit",
"unit ID of the image's new unit",
}
};
ProcRecord gimage_set_unit_proc =
{
"gimp_image_set_unit",
"Sets the unit of the image",
"This procedure sets the image's unit by it's unit ID. This value is independent of any of the layers in this image. No scaling or resizing is performed. See the gimp_unit_* procedure definitions for the valid range of unit IDs and a description of the unit system.",
"Michael Natterer",
"Michael Natterer",
"1999",
PDB_INTERNAL,
/* Input arguments */
2,
gimage_set_unit_args,
/* Output arguments */
0,
NULL,
/* Exec method */
{ { gimage_set_unit_invoker } },
};
/******************/
/* GIMAGE_WIDTH */
......@@ -5072,5 +5215,3 @@ gimp_image_get_channel_by_tattoo_invoker (Argument *args)
return return_args;
}
......@@ -62,6 +62,8 @@ extern ProcRecord gimage_get_filename_proc;
extern ProcRecord gimage_set_filename_proc;
extern ProcRecord gimage_get_resolution_proc;
extern ProcRecord gimage_set_resolution_proc;
extern ProcRecord gimage_get_unit_proc;
extern ProcRecord gimage_set_unit_proc;
extern ProcRecord gimage_width_proc;
extern ProcRecord gimage_height_proc;
extern ProcRecord gimage_get_cmap_proc;
......
......@@ -64,12 +64,13 @@ typedef enum {
TT_IMAGETYPE,
TT_XCOLORCUBE,
TT_XPREVSIZE,
TT_XRULERUNIT,
TT_XUNIT,
TT_XPLUGIN,
TT_XPLUGINDEF,
TT_XMENUPATH,
TT_XDEVICE,
TT_XSESSIONINFO
TT_XSESSIONINFO,
TT_XUNITINFO
} TokenType;
typedef struct _ParseFunc ParseFunc;
......@@ -165,6 +166,7 @@ static int parse_plug_in_def (gpointer val1p, gpointer val2p);
static int parse_device (gpointer val1p, gpointer val2p);
static int parse_menu_path (gpointer val1p, gpointer val2p);
static int parse_session_info (gpointer val1p, gpointer val2p);
static int parse_unit_info (gpointer val1p, gpointer val2p);
static int parse_proc_def (PlugInProcDef **proc_def);
static int parse_proc_arg (ProcArg *arg);
......@@ -242,7 +244,7 @@ static ParseFunc funcs[] =
{ "dont-show-rulers", TT_BOOLEAN, NULL, &show_rulers },
{ "show-statusbar", TT_BOOLEAN, &show_statusbar, NULL },
{ "dont-show-statusbar", TT_BOOLEAN, NULL, &show_statusbar },
{ "default-units", TT_XRULERUNIT, &default_units, NULL },
{ "default-units", TT_XUNIT, &default_units, NULL },
{ "auto-save", TT_BOOLEAN, &auto_save, NULL },
{ "dont-auto-save", TT_BOOLEAN, NULL, &auto_save },
{ "cubic-interpolation", TT_BOOLEAN, &cubic_interpolation, NULL },
......@@ -262,12 +264,13 @@ static ParseFunc funcs[] =
{ "default-image-type", TT_IMAGETYPE, &default_type, NULL },
{ "default-xresolution", TT_FLOAT, &default_xresolution, NULL },
{ "default-yresolution", TT_FLOAT, &default_yresolution, NULL },
{ "default-resolution-units", TT_XRULERUNIT, &default_resolution_units, NULL },
{ "default-resolution-units", TT_XUNIT, &default_resolution_units, NULL },
{ "plug-in", TT_XPLUGIN, NULL, NULL },
{ "plug-in-def", TT_XPLUGINDEF, NULL, NULL },
{ "menu-path", TT_XMENUPATH, NULL, NULL },
{ "device", TT_XDEVICE, NULL, NULL },
{ "session-info", TT_XSESSIONINFO, NULL, NULL},
{ "session-info", TT_XSESSIONINFO, NULL, NULL },
{ "unit-info", TT_XUNITINFO, NULL, NULL },
{ "monitor-xresolution", TT_FLOAT, &monitor_xres, NULL },
{ "monitor-yresolution", TT_FLOAT, &monitor_yres, NULL },
{ "num-processors", TT_INT, &num_processors, NULL },
......@@ -308,16 +311,20 @@ gimp_system_rc_file ()
}
void
parse_gimprc ()
init_parse_buffers ()
{
char libfilename[MAXPATHLEN];
char filename[MAXPATHLEN];
char *gimp_dir;
parse_info.buffer = g_new (char, 4096);
parse_info.tokenbuf = parse_info.buffer + 2048;
parse_info.buffer_size = 2048;
parse_info.tokenbuf_size = 2048;
}
void
parse_gimprc ()
{
char libfilename[MAXPATHLEN];
char filename[MAXPATHLEN];
char *gimp_dir;
gimp_dir = gimp_directory ();
add_gimp_directory_token (gimp_dir);
......@@ -598,7 +605,7 @@ parse_statement ()
return parse_color_cube (funcs[i].val1p, funcs[i].val2p);
case TT_XPREVSIZE:
return parse_preview_size (funcs[i].val1p, funcs[i].val2p);
case TT_XRULERUNIT:
case TT_XUNIT:
return parse_units (funcs[i].val1p, funcs[i].val2p);
case TT_XPLUGIN:
return parse_plug_in (funcs[i].val1p, funcs[i].val2p);
......@@ -610,6 +617,8 @@ parse_statement ()
return parse_device (funcs[i].val1p, funcs[i].val2p);
case TT_XSESSIONINFO:
return parse_session_info (funcs[i].val1p, funcs[i].val2p);
case TT_XUNITINFO:
return parse_unit_info (funcs[i].val1p, funcs[i].val2p);
}
return parse_unknown (token_sym);
......@@ -1879,6 +1888,128 @@ parse_session_info (gpointer val1p,
return OK;
}
static int
parse_unit_info (gpointer val1p,
gpointer val2p)
{
int token;
GUnit unit;
gchar *identifier = NULL;
float factor = 1.0;
int digits = 2.0;
gchar *symbol = NULL;
gchar *abbreviation = NULL;
gchar *singular = NULL;
gchar *plural = NULL;
token = peek_next_token ();
if (!token || (token != TOKEN_STRING))
return ERROR;
token = get_next_token ();
identifier = g_strdup (token_str);
/* Parse options for unit info */
while ( peek_next_token () == TOKEN_LEFT_PAREN )
{
token = get_next_token ();
token = peek_next_token ();
if (!token || (token != TOKEN_SYMBOL))
goto parse_unit_info_error_label;
token = get_next_token ();
if (!strcmp ("factor", token_sym))
{
token = peek_next_token ();
if (!token || (token != TOKEN_NUMBER))
goto parse_unit_info_error_label;
token = get_next_token ();
factor = token_num;
}
else if (!strcmp ("digits", token_sym))
{
token = peek_next_token ();
if (!token || (token != TOKEN_NUMBER))
goto parse_unit_info_error_label;
token = get_next_token ();
digits = token_int;
}
else if (!strcmp ("symbol", token_sym))
{
token = peek_next_token ();
if (!token || (token != TOKEN_STRING))
goto parse_unit_info_error_label;
token = get_next_token ();
symbol = g_strdup (token_str);
}
else if (!strcmp ("abbreviation", token_sym))
{
token = peek_next_token ();
if (!token || (token != TOKEN_STRING))
goto parse_unit_info_error_label;
token = get_next_token ();
abbreviation = g_strdup (token_str);
}
else if (!strcmp ("singular", token_sym))
{
token = peek_next_token ();
if (!token || (token != TOKEN_STRING))
goto parse_unit_info_error_label;
token = get_next_token ();
singular = g_strdup (token_str);
}
else if (!strcmp ("plural", token_sym))
{
token = peek_next_token ();
if (!token || (token != TOKEN_STRING))
goto parse_unit_info_error_label;
token = get_next_token ();
plural = g_strdup (token_str);
}
else
goto parse_unit_info_error_label;
token = peek_next_token ();
if (!token || (token != TOKEN_RIGHT_PAREN))
goto parse_unit_info_error_label;
token = get_next_token ();
}
if (!token || (token != TOKEN_RIGHT_PAREN))
goto parse_unit_info_error_label;
token = get_next_token ();
unit = gimp_unit_new (identifier, factor, digits,
symbol, abbreviation, singular, plural);
/* make the unit definition persistent */
gimp_unit_set_deletion_flag (unit, FALSE);
g_free (identifier);
g_free (symbol);
g_free (abbreviation);
g_free (singular);
g_free (plural);
return OK;
parse_unit_info_error_label:
if (identifier)
g_free (identifier);
if (symbol)
g_free (symbol);
if (abbreviation)
g_free (abbreviation);
if (singular)
g_free (singular);
if (plural)
g_free (plural);
return ERROR;
}
static int
parse_unknown (char *token_sym)
{
......@@ -1963,13 +2094,14 @@ value_to_str (char *name)
return color_cube_to_str (funcs[i].val1p, funcs[i].val2p);
case TT_XPREVSIZE:
return preview_size_to_str (funcs[i].val1p, funcs[i].val2p);
case TT_XRULERUNIT:
case TT_XUNIT:
return units_to_str (funcs[i].val1p, funcs[i].val2p);
case TT_XPLUGIN:
case TT_XPLUGINDEF:
case TT_XMENUPATH:
case TT_XDEVICE:
case TT_XSESSIONINFO:
case TT_XUNITINFO:
return NULL;
}
return NULL;
......
......@@ -77,6 +77,9 @@ extern char * image_title_format;
/* function prototypes */
void init_parse_buffers (); /* this has to be called before any file
* is parsed
*/
void parse_gimprc (void);
void parse_gimprc_file (char *filename);
void save_gimprc (GList **updated_options, GList **conflicting_options);
......
This diff is collapsed.
/* The GIMP -- an image manipulation program
* Copyright (C) 1995 Spencer Kimball and Peter Mattis
*
* 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.
*/
#ifndef __GIMP_UNIT_CMDS_H__
#define __GIMP_UNIT_CMDS_H__
#include "procedural_db.h"
extern ProcRecord gimp_unit_get_number_of_units_proc;
extern ProcRecord gimp_unit_new_proc;
extern ProcRecord gimp_unit_get_deletion_flag_proc;
extern ProcRecord gimp_unit_set_deletion_flag_proc;
extern ProcRecord gimp_unit_get_identifier_proc;
extern ProcRecord gimp_unit_get_factor_proc;
extern ProcRecord gimp_unit_get_digits_proc;
extern ProcRecord gimp_unit_get_symbol_proc;
extern ProcRecord gimp_unit_get_abbreviation_proc;
extern ProcRecord gimp_unit_get_singular_proc;
extern ProcRecord gimp_unit_get_plural_proc;
#endif /* __GIMP_UNIT_CMDS_H__ */
......@@ -202,6 +202,18 @@ install_help (InstallCallback callback)
_("\t\tPaths to search for brushes, palettes, gradients\n"), -1);
gtk_text_insert (GTK_TEXT (text), font, NULL, NULL,
_("\t\tpatterns, plug-ins and modules are also configured here.\n"), -1);
gtk_text_insert (GTK_TEXT (text), font_emphasis, NULL, NULL,
_("unitrc\n"), -1);
gtk_text_insert (GTK_TEXT (text), font, NULL, NULL,
_("\t\tThe unitrc is used to store your user units database.\n"), -1);
gtk_text_insert (GTK_TEXT (text), font, NULL, NULL,
_("\t\tYou can define additional units and use them just\n"), -1);
gtk_text_insert (GTK_TEXT (text), font, NULL, NULL,
_("\t\tlike you use the built-in units inches, millimeters,\n"), -1);
gtk_text_insert (GTK_TEXT (text), font, NULL, NULL,
_("\t\tpoints and picas. This file is overwritten each time\n"), -1);
gtk_text_insert (GTK_TEXT (text), font, NULL, NULL,
_("\t\tyou quit the GIMP.\n"), -1);
gtk_text_insert (GTK_TEXT (text), font_emphasis, NULL, NULL,
_("pluginrc\n"), -1);
gtk_text_insert (GTK_TEXT (text), font, NULL, NULL,
......
......@@ -202,6 +202,18 @@ install_help (InstallCallback callback)
_("\t\tPaths to search for brushes, palettes, gradients\n"), -1);
gtk_text_insert (GTK_TEXT (text), font, NULL, NULL,
_("\t\tpatterns, plug-ins and modules are also configured here.\n"), -1);
gtk_text_insert (GTK_TEXT (text), font_emphasis, NULL, NULL,
_("unitrc\n"), -1);
gtk_text_insert (GTK_TEXT (text), font, NULL, NULL,
_("\t\tThe unitrc is used to store your user units database.\n"), -1);
gtk_text_insert (GTK_TEXT (text), font, NULL, NULL,
_("\t\tYou can define additional units and use them just\n"), -1);
gtk_text_insert (GTK_TEXT (text), font, NULL, NULL,
_("\t\tlike you use the built-in units inches, millimeters,\n"), -1);
gtk_text_insert (GTK_TEXT (text), font, NULL, NULL,
_("\t\tpoints and picas. This file is overwritten each time\n"), -1);
gtk_text_insert (GTK_TEXT (text), font, NULL, NULL,
_("\t\tyou quit the GIMP.\n"), -1);
gtk_text_insert (GTK_TEXT (text), font_emphasis, NULL, NULL,
_("pluginrc\n"), -1);
gtk_text_insert (GTK_TEXT (text), font, NULL, NULL,
......
......@@ -50,6 +50,7 @@
#include "gimage_cmds.h"
#include "gimage_mask_cmds.h"
#include "gimprc.h"
#include "gimpunit_cmds.h"
#include "gradient.h"
#include "histogram_tool.h"
#include "hue_saturation.h"
......@@ -179,6 +180,8 @@ internal_procs_init ()
procedural_db_register (&gimage_set_filename_proc); pcount++;
procedural_db_register (&gimage_get_resolution_proc); pcount++;
procedural_db_register (&gimage_set_resolution_proc); pcount++;
procedural_db_register (&gimage_get_unit_proc); pcount++;
procedural_db_register (&gimage_set_unit_proc); pcount++;
procedural_db_register (&gimage_width_proc); pcount++;
procedural_db_register (&gimage_height_proc); pcount++;
procedural_db_register (&gimage_get_cmap_proc); pcount++;
......@@ -420,6 +423,19 @@ internal_procs_init ()
app_init_update_status(NULL, _("Procedural database"),
pcount/total_pcount);
/* Unit Procedures */
procedural_db_register (&gimp_unit_get_number_of_units_proc); pcount++;
procedural_db_register (&gimp_unit_new_proc); pcount++;
procedural_db_register (&gimp_unit_get_deletion_flag_proc); pcount++;
procedural_db_register (&gimp_unit_set_deletion_flag_proc); pcount++;
procedural_db_register (&gimp_unit_get_identifier_proc); pcount++;
procedural_db_register (&gimp_unit_get_factor_proc); pcount++;
procedural_db_register (&gimp_unit_get_digits_proc); pcount++;
procedural_db_register (&gimp_unit_get_symbol_proc); pcount++;
procedural_db_register (&gimp_unit_get_abbreviation_proc); pcount++;
procedural_db_register (&gimp_unit_get_singular_proc); pcount++;
procedural_db_register (&gimp_unit_get_plural_proc); pcount++;
/* Procedural Database */
procedural_db_register (&procedural_db_dump_proc); pcount++;
procedural_db_register (&procedural_db_query_proc); pcount++;
......
/* The GIMP -- an image manipulation program
* Copyright (C) 1995 Spencer Kimball and Peter Mattis
*
* 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.
*/
#ifndef __UNITRC_H__
#define __UNITRC_H__
void parse_unitrc (void);
void save_unitrc (void);
#endif /* __UNITRC_H__ */
......@@ -202,6 +202,18 @@ install_help (InstallCallback callback)
_("\t\tPaths to search for brushes, palettes, gradients\n"), -1);
gtk_text_insert (GTK_TEXT (text), font, NULL, NULL,
_("\t\tpatterns, plug-ins and modules are also configured here.\n"), -1);
gtk_text_insert (GTK_TEXT (text), font_emphasis, NULL, NULL,
_("unitrc\n"), -1);
gtk_text_insert (GTK_TEXT (text), font, NULL, NULL,
_("\t\tThe unitrc is used to store your user units database.\n"), -1);
gtk_text_insert (GTK_TEXT (text), font, NULL, NULL,
_("\t\tYou can define additional units and use them just\n"), -1);
gtk_text_insert (GTK_TEXT (text), font, NULL, NULL,
_("\t\tlike you use the built-in units inches, millimeters,\n"), -1);
gtk_text_insert (GTK_TEXT (text), font, NULL, NULL,
_("\t\tpoints and picas. This file is overwritten each time\n"), -1);
gtk_text_insert (GTK_TEXT (text), font, NULL, NULL,
_("\t\tyou quit the GIMP.\n"), -1);
gtk_text_insert (GTK_TEXT (text), font_emphasis, NULL, NULL,
_("pluginrc\n"), -1);
gtk_text_insert (GTK_TEXT (text), font, NULL, NULL,
......
......@@ -69,7 +69,8 @@ typedef enum