Commit d240f623 authored by Michael Natterer's avatar Michael Natterer 😴 Committed by Michael Natterer

new directory app/base/

2001-05-15  Michael Natterer  <mitch@gimp.org>

	* configure.in: new directory app/base/

	* app/Makefile.am
	* app/boundary.[ch]
	* app/brush_scale.[ch]
	* app/gimpchecks.h
	* app/gimplut.[ch]
	* app/pixel_processor.[ch]
	* app/pixel_region.[ch]
	* app/pixel_surround.[ch]
	* app/temp_buf.[ch]
	* app/tile.[ch]
	* app/tile_cache.[ch]
	* app/tile_manager.[ch]
	* app/tile_manager_pvt.h
	* app/tile_pvt.h
	* app/tile_swap.[ch]: moved to base/

	* app/base/Makefile.am
	* app/base/base-types.h
	* app/base/*: new directory for the sub-object pixel maniplation
	and storage stuff. Does not include Gtk+ or anything outside
	base/. Did some cleanup in all files.

	* app/appenums.h
	* app/apptypes.h
	* app/core/gimpimage.h: removed types which are now in
	base/base-types.h.

	* app/base/base-config.[ch]
	* app/gimprc.[ch]: put the config variables for base/ to their own
	file so base/ doesn not have to include gimprc.h (does not yet
	work, i.e. the variables are un-configurable right now)

	* app/main.c: set a log handler for "Gimp-Base".

	* app/paint-funcs/Makefile.am
	* app/paint-funcs/paint-funcs.[ch]: removed the color hash which
	maps RGB to color indices because it's a totally standalone system
	which has nothing to do with the paint-funcs and introduced a
	GimpImage dependency.

	paint-funcs/ should be considered on the same sub-object
	(glib-only) level as base/, only in a different directory.

	* app/core/Makefile.am
	* app/core/gimpimage-colorhash.[ch]: put the color hash here.

	* app/gimage.c: don't invalidate the color hash here...

	* app/core/gimpimage.c: ... but in the colormap_changed() default
	inplementation. Initialize the hash in class_init().

	* tools/pdbgen/Makefile.am: scan app/base/base-types.h for enums.

	* tools/pdbgen/enums.pl: regenerated.

	* app/[lots]
	* app/core/[of]
	* app/gui/[files]
	* app/pdb/[all]
	* app/tools/[over]
	* app/widgets/[the]
	* tools/pdbgen/pdb/[place]: changed #includes accordingly. And use
	base_config->value instead of the stuff from gimprc.h.
parent 9059fd20
2001-05-15 Michael Natterer <mitch@gimp.org>
* configure.in: new directory app/base/
* app/Makefile.am
* app/boundary.[ch]
* app/brush_scale.[ch]
* app/gimpchecks.h
* app/gimplut.[ch]
* app/pixel_processor.[ch]
* app/pixel_region.[ch]
* app/pixel_surround.[ch]
* app/temp_buf.[ch]
* app/tile.[ch]
* app/tile_cache.[ch]
* app/tile_manager.[ch]
* app/tile_manager_pvt.h
* app/tile_pvt.h
* app/tile_swap.[ch]: moved to base/
* app/base/Makefile.am
* app/base/base-types.h
* app/base/*: new directory for the sub-object pixel maniplation
and storage stuff. Does not include Gtk+ or anything outside
base/. Did some cleanup in all files.
* app/appenums.h
* app/apptypes.h
* app/core/gimpimage.h: removed types which are now in
base/base-types.h.
* app/base/base-config.[ch]
* app/gimprc.[ch]: put the config variables for base/ to their own
file so base/ doesn not have to include gimprc.h (does not yet
work, i.e. the variables are un-configurable right now)
* app/main.c: set a log handler for "Gimp-Base".
* app/paint-funcs/Makefile.am
* app/paint-funcs/paint-funcs.[ch]: removed the color hash which
maps RGB to color indices because it's a totally standalone system
which has nothing to do with the paint-funcs and introduced a
GimpImage dependency.
paint-funcs/ should be considered on the same sub-object
(glib-only) level as base/, only in a different directory.
* app/core/Makefile.am
* app/core/gimpimage-colorhash.[ch]: put the color hash here.
* app/gimage.c: don't invalidate the color hash here...
* app/core/gimpimage.c: ... but in the colormap_changed() default
inplementation. Initialize the hash in class_init().
* tools/pdbgen/Makefile.am: scan app/base/base-types.h for enums.
* tools/pdbgen/enums.pl: regenerated.
* app/[lots]
* app/core/[of]
* app/gui/[files]
* app/pdb/[all]
* app/tools/[over]
* app/widgets/[the]
* tools/pdbgen/pdb/[place]: changed #includes accordingly. And use
base_config->value instead of the stuff from gimprc.h.
2001-05-14 Michael Natterer <mitch@gimp.org>
* README.patch_xinput_airbrush
......
## Process this file with automake to produce Makefile.in
SUBDIRS = paint-funcs core pdb tools widgets gui
SUBDIRS = paint-funcs base core pdb tools widgets gui
scriptdata =
......@@ -101,36 +101,6 @@ gimp_SOURCES = \
scan_convert.c \
scan_convert.h \
##
## lowlevel stuff for base/
##
boundary.c \
boundary.h \
brush_scale.c \
brush_scale.h \
gimpcheck.h \
gimplut.c \
gimplut.h \
lut_funcs.c \
lut_funcs.h \
pixel_processor.c \
pixel_processor.h \
pixel_region.c \
pixel_region.h \
pixel_surround.c \
pixel_surround.h \
temp_buf.c \
temp_buf.h \
tile.c \
tile.h \
tile_pvt.h \
tile_cache.c \
tile_cache.h \
tile_manager.c \
tile_manager.h \
tile_manager_pvt.h \
tile_swap.c \
tile_swap.h \
##
## stuff that needs to be sorted into yet undecided subsystems, split up,
## removed or otherwise tortured
##
......@@ -171,6 +141,8 @@ gimp_SOURCES = \
image_new.h \
libgimp_glue.c \
libgimp_glue.h \
lut_funcs.c \
lut_funcs.h \
main.c \
path.c \
path.h \
......@@ -225,6 +197,7 @@ gimp_LDADD = \
gui/libappgui.la \
widgets/libappwidgets.la \
core/libappcore.la \
base/libappbase.la \
$(top_builddir)/libgimpcolor/libgimpcolor-$(LT_RELEASE).la \
$(top_builddir)/libgimpmath/libgimpmath-$(LT_RELEASE).la \
$(top_builddir)/libgimpwidgets/libgimpwidgets-$(LT_RELEASE).la \
......
......@@ -85,6 +85,9 @@
#include "libgimp/gimpprotocol.h"
#include "libgimp/gimpwire.h"
#include "base/tile.h"
#include "base/tile-manager.h"
#include "core/gimpdrawable.h"
#include "core/gimpimage.h"
......@@ -102,8 +105,6 @@
#include "gimpprogress.h"
#include "gimprc.h"
#include "plug_in.h"
#include "tile.h"
#include "tile_manager.h"
#include "libgimp/gimpintl.h"
......
......@@ -46,6 +46,10 @@
#include "core/core-types.h"
#include "tools/tools-types.h"
#include "base/base-config.h"
#include "base/temp-buf.h"
#include "base/tile-swap.h"
#include "paint-funcs/paint-funcs.h"
#include "core/gimpdatafactory.h"
......@@ -75,8 +79,6 @@
#include "plug_in.h"
#include "module_db.h"
#include "temp_buf.h"
#include "tile_swap.h"
#include "undo.h"
#include "unitrc.h"
#include "xcf.h"
......@@ -165,7 +167,7 @@ app_init (void)
g_free (filename);
if (parse_buffers_init ())
if (gimprc_init ())
{
parse_unitrc (); /* this needs to be done before gimprc loading */
parse_gimprc (); /* parse the local GIMP configuration file */
......@@ -243,12 +245,13 @@ app_init (void)
RESET_BAR();
/* Add the swap file */
if (swap_path == NULL)
swap_path = g_get_tmp_dir ();
if (base_config->swap_path == NULL)
base_config->swap_path = g_get_tmp_dir ();
toast_old_temp_files ();
path = g_strdup_printf ("%s" G_DIR_SEPARATOR_S "gimpswap.%lu",
swap_path, (unsigned long) getpid ());
base_config->swap_path,
(unsigned long) getpid ());
tile_swap_add (path, NULL, NULL);
g_free (path);
......@@ -380,7 +383,7 @@ toast_old_temp_files (void)
struct dirent *entry;
GString *filename = g_string_new ("");
dir = opendir (swap_path);
dir = opendir (base_config->swap_path);
if (!dir)
return;
......@@ -405,7 +408,7 @@ toast_old_temp_files (void)
* so no harm trying.
*/
g_string_sprintf (filename, "%s" G_DIR_SEPARATOR_S "%s",
swap_path, entry->d_name);
base_config->swap_path, entry->d_name);
unlink (filename->str);
}
}
......
......@@ -30,41 +30,6 @@ typedef enum
NO_FILL /*< nick=NO_IMAGE_FILL >*/
} GimpFillType;
/* Layer modes */
typedef enum
{
NORMAL_MODE,
DISSOLVE_MODE,
BEHIND_MODE,
MULTIPLY_MODE,
SCREEN_MODE,
OVERLAY_MODE,
DIFFERENCE_MODE,
ADDITION_MODE,
SUBTRACT_MODE,
DARKEN_ONLY_MODE,
LIGHTEN_ONLY_MODE,
HUE_MODE,
SATURATION_MODE,
COLOR_MODE,
VALUE_MODE,
DIVIDE_MODE,
DODGE_MODE,
BURN_MODE,
HARDLIGHT_MODE,
ERASE_MODE, /*< skip >*/
REPLACE_MODE, /*< skip >*/
ANTI_ERASE_MODE /*< skip >*/
} LayerModeEffects;
/* Types of convolutions */
typedef enum
{
NORMAL_CONVOL, /* Negative numbers truncated */
ABSOLUTE_CONVOL, /* Absolute value */
NEGATIVE_CONVOL /* add 127 to values */
} ConvolutionType;
/* Brush application types */
typedef enum
{
......@@ -99,13 +64,6 @@ typedef enum
ONCE_END_COLOR /* paint once, but keep painting with the end color */
} GradientPaintMode;
typedef enum
{
LINEAR_INTERPOLATION,
CUBIC_INTERPOLATION,
NEAREST_NEIGHBOR_INTERPOLATION
} InterpolationType;
typedef enum /*< skip >*/
{
ORIENTATION_UNKNOWN,
......
......@@ -44,9 +44,4 @@ extern MessageHandlerType message_handler;
extern gboolean gimp_busy;
#ifdef G_OS_WIN32
gchar * quote_spaces (gchar *string);
#endif
#endif /* __APPENV_H__ */
......@@ -25,6 +25,8 @@
#include "libgimpcolor/gimpcolortypes.h"
#include "libgimpmath/gimpmathtypes.h"
#include "base/base-types.h"
#include "undo_types.h"
#include "appenums.h"
......@@ -34,8 +36,6 @@
typedef struct _Argument Argument;
typedef struct _BoundSeg BoundSeg;
typedef struct _ColorNotebook ColorNotebook;
typedef struct _GDisplay GDisplay;
......@@ -44,8 +44,6 @@ typedef struct _GimpHistogram GimpHistogram;
typedef struct _GimpImageNewValues GimpImageNewValues;
typedef struct _GimpLut GimpLut;
typedef struct _GimpParasite GimpParasite;
typedef struct _GimpProgress GimpProgress;
......@@ -66,23 +64,11 @@ typedef struct _PlugInProcDef PlugInProcDef;
typedef struct _ParasiteList ParasiteList;
typedef struct _PixelRegionIterator PixelRegionIterator;
typedef struct _PixelRegion PixelRegion;
typedef struct _PixelRegionHolder PixelRegionHolder;
typedef struct _ProcArg ProcArg;
typedef struct _ProcRecord ProcRecord;
typedef guint32 Tattoo;
typedef struct _TempBuf TempBuf;
typedef struct _TempBuf MaskBuf;
typedef struct _Tile Tile;
typedef struct _TileManager TileManager;
typedef struct _ScanConvertPoint ScanConvertPoint;
typedef struct _Selection Selection;
......@@ -99,9 +85,6 @@ typedef GSList PathUndo;
/* functions */
typedef void (* TileValidateProc) (TileManager *tm,
Tile *tile);
typedef void (* ImageMapApplyFunc) (PixelRegion *srcPR,
PixelRegion *destPR,
gpointer data);
......
......@@ -3,6 +3,9 @@
noinst_LTLIBRARIES = libappbase.la
libappbase_la_SOURCES = \
base-types.h \
base-config.c \
base-config.h \
boundary.c \
boundary.h \
brush-scale.c \
......
......@@ -16,13 +16,23 @@
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
#ifndef __TILE_CACHE_H__
#define __TILE_CACHE_H__
#include "config.h"
#include <glib.h>
void tile_cache_insert (Tile *tile);
void tile_cache_flush (Tile *tile);
void tile_cache_set_size (gulong cache_size);
#include "base-types.h"
#include "base-config.h"
#endif /* __TILE_CACHE_H__ */
static GimpBaseConfig static_base_config =
{
NULL,
NULL,
33554432, /* 32 MB */
FALSE,
LINEAR_INTERPOLATION
};
GimpBaseConfig *base_config = &static_base_config;
......@@ -16,23 +16,23 @@
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
#ifndef __BRUSH_SCALE_H__
#define __BRUSH_SCALE_H__
MaskBuf * brush_scale_mask (MaskBuf *brush_mask,
gint dest_width,
gint dest_height);
MaskBuf * brush_scale_pixmap (MaskBuf *pixmap,
gint dest_width,
gint dest_height);
#endif /* __BRUSH_SCALE_H__ */
#ifndef __BASE_CONFIG_H__
#define __BASE_CONFIG_H__
typedef struct _GimpBaseConfig GimpBaseConfig;
struct _GimpBaseConfig
{
gchar *temp_path;
gchar *swap_path;
guint tile_cache_size;
gboolean stingy_memory_use;
InterpolationType interpolation_type;
};
extern GimpBaseConfig *base_config;
#endif /* __BASE_CONFIG_H__ */
/* The GIMP -- an image manipulation program
* Copyright (C) 1995-2001 Spencer Kimball and Peter Mattis
* 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
......@@ -16,13 +16,70 @@
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
#ifndef __GIMP_CHECKS_H__
#define __GIMP_CHECKS_H__
#ifndef __BASE_TYPES_H__
#define __BASE_TYPES_H__
/* Transparency representation */
/* magic constants */
#define MAX_CHANNELS 4
#define GRAY_PIX 0
#define ALPHA_G_PIX 1
#define RED_PIX 0
#define GREEN_PIX 1
#define BLUE_PIX 2
#define ALPHA_PIX 3
#define INDEXED_PIX 0
#define ALPHA_I_PIX 1
/* enums */
/* Layer modes */
typedef enum
{
NORMAL_MODE,
DISSOLVE_MODE,
BEHIND_MODE,
MULTIPLY_MODE,
SCREEN_MODE,
OVERLAY_MODE,
DIFFERENCE_MODE,
ADDITION_MODE,
SUBTRACT_MODE,
DARKEN_ONLY_MODE,
LIGHTEN_ONLY_MODE,
HUE_MODE,
SATURATION_MODE,
COLOR_MODE,
VALUE_MODE,
DIVIDE_MODE,
DODGE_MODE,
BURN_MODE,
HARDLIGHT_MODE,
ERASE_MODE, /*< skip >*/
REPLACE_MODE, /*< skip >*/
ANTI_ERASE_MODE /*< skip >*/
} LayerModeEffects;
/* Types of convolutions */
typedef enum
{
NORMAL_CONVOL, /* Negative numbers truncated */
ABSOLUTE_CONVOL, /* Absolute value */
NEGATIVE_CONVOL /* add 127 to values */
} ConvolutionType;
typedef enum
{
LINEAR_INTERPOLATION,
CUBIC_INTERPOLATION,
NEAREST_NEIGHBOR_INTERPOLATION
} InterpolationType;
/* Transparency representation */
typedef enum /*< skip >*/
{
LIGHT_CHECKS = 0,
GRAY_CHECKS = 1,
......@@ -32,12 +89,37 @@ typedef enum
BLACK_ONLY = 5
} GimpCheckType;
typedef enum
typedef enum /*< skip >*/
{
SMALL_CHECKS = 0,
MEDIUM_CHECKS = 1,
LARGE_CHECKS = 2
} GimpCheckSize;
#endif /* __GIMP_CHECKS_H__ */
/* types */
typedef struct _BoundSeg BoundSeg;
typedef struct _GimpLut GimpLut;
typedef struct _PixelRegionIterator PixelRegionIterator;
typedef struct _PixelRegion PixelRegion;
typedef struct _PixelRegionHolder PixelRegionHolder;
typedef struct _TempBuf TempBuf;
typedef struct _TempBuf MaskBuf;
typedef struct _Tile Tile;
typedef struct _TileManager TileManager;
typedef struct _ScanConvertPoint ScanConvertPoint;
/* functions */
typedef void (* TileValidateProc) (TileManager *tm,
Tile *tile);
#endif /* __BASE_TYPES_H__ */
......@@ -22,13 +22,12 @@
#include <glib.h>
#include "apptypes.h"
#include "base-types.h"
#include "boundary.h"
#include "errors.h"
#include "pixel_region.h"
#include "pixel-region.h"
#include "tile.h"
#include "tile_manager.h"
#include "tile-manager.h"
/* half intensity for mask */
......@@ -237,9 +236,6 @@ make_seg (gint x1,
tmp_segs = (BoundSeg *) g_realloc ((void *) tmp_segs,
sizeof (BoundSeg) * max_segs);
if (!tmp_segs)
gimp_fatal_error ("make_seg(): Unable to reallocate segments array for mask boundary.");
}
tmp_segs[num_segs].x1 = x1;
......@@ -280,9 +276,6 @@ allocate_empty_segs (void)
empty_segs_n = (gint *) g_realloc (empty_segs_n, sizeof (gint) * max_empty_segs);
empty_segs_c = (gint *) g_realloc (empty_segs_c, sizeof (gint) * max_empty_segs);
empty_segs_l = (gint *) g_realloc (empty_segs_l, sizeof (gint) * max_empty_segs);
if (!empty_segs_n || !empty_segs_l || !empty_segs_c)
gimp_fatal_error ("allocate_empty_segs(): Unable to reallocate empty segments array for mask boundary.");
}
}
......
......@@ -38,16 +38,16 @@ struct _BoundSeg
};
BoundSeg * find_mask_boundary (PixelRegion *maskPR,
gint *num_elems,
BoundaryType type,
gint x1,
gint y1,
gint x2,
gint y2);
BoundSeg * sort_boundary (BoundSeg *segs,
gint num_segs,
gint *num_groups);
BoundSeg * find_mask_boundary (PixelRegion *maskPR,
gint *num_elems,
BoundaryType type,
gint x1,
gint y1,
gint x2,
gint y2);
BoundSeg * sort_boundary (BoundSeg *segs,
gint num_segs,
gint *num_groups);
#endif /* __BOUNDARY_H__ */
......@@ -20,10 +20,10 @@
#include <glib.h>
#include "apptypes.h"
#include "base-types.h"
#include "brush_scale.h"
#include "temp_buf.h"
#include "brush-scale.h"
#include "temp-buf.h"
MaskBuf *
......
......@@ -29,10 +29,3 @@ MaskBuf * brush_scale_pixmap (MaskBuf *pixmap,
#endif /* __BRUSH_SCALE_H__ */
......@@ -27,17 +27,17 @@
#include <gtk/gtk.h>
#include "libgimpmath/gimpmath.h"
#include "libgimpwidgets/gimpwidgets.h"
#include "core/core-types.h"
#include "base/pixel-processor.h"
#include "base/pixel-region.h"
#include "core/gimpdrawable.h"
#include "core/gimpimage.h"
#include "gimphistogram.h"
#include "gimprc.h"
#include "pixel_processor.h"
#include "pixel_region.h"
struct _GimpHistogram
......
......@@ -22,25 +22,25 @@
#include <stdio.h>