libgimp/Makefile.am libgimp/gimp.h removed.

2001-01-25  Michael Natterer  <mitch@gimp.org>

	* libgimp/Makefile.am
	* libgimp/gimp.h
	* libgimp/gimpcompat.h: removed.

	The GIMP 1.0 API is not supported any more !!!

	* plug-ins/print/print-image-gimp.c
	* plug-ins/print/print.c
	* plug-ins/print/print_gimp.h: a quick fix for old compat cruft.
	This is temporary and will be replaced by Gimp-Print's development
	version.

	* plug-ins/xjt/xjpeg.c: use GimpRGB.
This commit is contained in:
Michael Natterer 2001-01-25 15:27:56 +00:00 committed by Michael Natterer
parent e8c74bb6e8
commit 0790fdc7f1
8 changed files with 75 additions and 191 deletions

View File

@ -1,3 +1,19 @@
2001-01-25 Michael Natterer <mitch@gimp.org>
* libgimp/Makefile.am
* libgimp/gimp.h
* libgimp/gimpcompat.h: removed.
The GIMP 1.0 API is not supported any more !!!
* plug-ins/print/print-image-gimp.c
* plug-ins/print/print.c
* plug-ins/print/print_gimp.h: a quick fix for old compat cruft.
This is temporary and will be replaced by Gimp-Print's development
version.
* plug-ins/xjt/xjpeg.c: use GimpRGB.
2001-01-25 Sven Neumann <sven@gimp.org>
* app/libgimp_glue.[ch]: cleanup

View File

@ -200,7 +200,6 @@ gimpinclude_HEADERS = \
gimpadaptivesupersample.h \
gimpbilinear.h \
gimpchannel.h \
gimpcompat.h \
gimpdrawable.h \
gimpenums.h \
gimpenv.h \

View File

@ -50,8 +50,6 @@
#include <libgimp/gimp_pdb.h>
#include <libgimp/gimpcompat.h> /* to be removed before 1.2 */
#ifdef G_OS_WIN32
# include <stdlib.h> /* For _-argc and __argv */
# ifdef LIBGIMP_COMPILATION

View File

@ -1,127 +0,0 @@
/* LIBGIMP - The GIMP Library
* Copyright (C) 1995-1997 Peter Mattis and Spencer Kimball
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2 of the License, or (at your option) any later version.
*
* This library 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
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the
* Free Software Foundation, Inc., 59 Temple Place - Suite 330,
* Boston, MA 02111-1307, USA.
*/
#ifndef __GIMPCOMPAT_H__
#define __GIMPCOMPAT_H__
#ifdef __cplusplus
extern "C" {
#endif /* __cplusplus */
/* some compatibility defines for older plug-ins */
#ifdef GIMP_ENABLE_COMPAT_CRUFT
#define gimp_attach_parasite gimp_parasite_attach
#define gimp_detach_parasite gimp_parasite_detach
#define gimp_find_parasite gimp_parasite_find
#define gimp_image_attach_parasite gimp_image_parasite_attach
#define gimp_image_detach_parasite gimp_image_parasite_detach
#define gimp_image_find_parasite gimp_image_parasite_find
#define gimp_drawable_attach_parasite gimp_drawable_parasite_attach
#define gimp_drawable_detach_parasite gimp_drawable_parasite_detach
#define gimp_drawable_find_parasite gimp_drawable_parasite_find
#define gimp_drawable_channel gimp_drawable_is_channel
#define gimp_drawable_gray gimp_drawable_is_gray
#define gimp_drawable_color gimp_drawable_is_rgb
#define gimp_drawable_indexed gimp_drawable_is_indexed
#define gimp_drawable_layer gimp_drawable_is_layer
#define gimp_drawable_layer_mask gimp_drawable_is_layer_mask
#define gimp_image_disable_undo gimp_image_undo_disable
#define gimp_image_enable_undo gimp_image_undo_enable
#define gimp_image_freeze_undo gimp_image_undo_freeze
#define gimp_image_thaw_undo gimp_image_undo_thaw
#define gimp_channel_width gimp_drawable_width
#define gimp_channel_height gimp_drawable_height
#define gimp_channel_get_image_ID gimp_drawable_image
#define gimp_channel_get_layer_ID -1
#define gimp_layer_width gimp_drawable_width
#define gimp_layer_height gimp_drawable_height
#define gimp_layer_bpp gimp_drawable_bpp
#define gimp_layer_type gimp_drawable_type
#define gimp_gradient_get_gradient_data gimp_gradients_get_gradient_data
#define gimp_plugin_help_func gimp_standard_help_func
#define gimp_query_database gimp_procedural_db_query
#define gimp_query_procedure gimp_procedural_db_proc_info
#define gimp_query_images gimp_image_list
#define Parasite GimpParasite
#define PARASITE_PERSISTENT GIMP_PARASITE_PERSISTENT
#define PARASITE_UNDOABLE GIMP_PARASITE_UNDOABLE
#define PARASITE_ATTACH_PARENT GIMP_PARASITE_ATTACH_PARENT
#define PARASITE_PARENT_PERSISTENT GIMP_PARASITE_PARENT_PERSISTENT
#define PARASITE_PARENT_UNDOABLE GIMP_PARASITE_PARENT_UNDOABLE
#define PARASITE_ATTACH_GRANDPARENT GIMP_PARASITE_ATTACH_GRANDPARENT
#define PARASITE_GRANDPARENT_PERSISTENT GIMP_PARASITE_GRANDPARENT_PERSISTENT
#define PARASITE_GRANDPARENT_UNDOABLE GIMP_PARASITE_GRANDPARENT_UNDOABLE
#define parasite_new gimp_parasite_new
#define parasite_free gimp_parasite_free
#define parasite_copy gimp_parasite_copy
#define parasite_compare gimp_parasite_compare
#define parasite_is_type gimp_parasite_is_type
#define parasite_is_persistent gimp_parasite_is_persistent
#define parasite_is_undoable gimp_parasite_is_undoable
#define parasite_has_flag gimp_parasite_has_flag
#define parasite_flags gimp_parasite_flags
#define parasite_name gimp_parasite_name
#define parasite_data gimp_parasite_data
#define parasite_data_size gimp_parasite_data_size
#define PIXPIPE_MAXDIM GIMP_PIXPIPE_MAXDIM
#define PixPipeParams GimpPixPipeParams
#define pixpipeparams_init gimp_pixpipe_params_init
#define pixpipeparams_parse gimp_pixpipe_params_parse
#define pixpipeparams_build gimp_pixpipe_params_build
#define GPlugInInfo GimpPlugInInfo
#define GTile GimpTile
#define GDrawable GimpDrawable
#define GPixelRgn GimpPixelRgn
#define GParamColor GimpParamColor
#define GParamRegion GimpParamRegion
#define GParamData GimpParamData
#define GParamDef GimpParamDef
#define GParam GimpParam
#define CAN_HANDLE_RGB GIMP_EXPORT_CAN_HANDLE_RGB
#define CAN_HANDLE_GRAY GIMP_EXPORT_CAN_HANDLE_GRAY
#define CAN_HANDLE_INDEXED GIMP_EXPORT_CAN_HANDLE_INDEXED
#define CAN_HANDLE_ALPHA GIMP_EXPORT_CAN_HANDLE_ALPHA
#define CAN_HANDLE_LAYERS GIMP_EXPORT_CAN_HANDLE_LAYERS
#define CAN_HANDLE_LAYERS_AS_ANIMATION GIMP_EXPORT_CAN_HANDLE_LAYERS_AS_ANIMATION
#define NEEDS_ALPHA GIMP_EXPORT_NEEDS_ALPHA
#define EXPORT_CANCEL GIMP_EXPORT_CANCEL
#define EXPORT_IGNORE GIMP_EXPORT_IGNORE
#define EXPORT_EXPORT GIMP_EXPORT_EXPORT
#endif /* GIMP_ENABLE_COMPAT_CRUFT */
#ifdef __cplusplus
}
#endif /* __cplusplus */
#endif /* __GIMPCOMPAT_H__ */

View File

@ -58,8 +58,8 @@
/* Concrete type to represent image */
typedef struct
{
GDrawable *drawable;
GPixelRgn rgn;
GimpDrawable *drawable;
GimpPixelRgn rgn;
/*
* Transformations we can impose on the image. The transformations
@ -85,7 +85,7 @@ typedef struct
Image
Image_GDrawable_new(GDrawable *drawable)
Image_GDrawable_new(GimpDrawable *drawable)
{
Gimp_Image_t *i = malloc(sizeof(Gimp_Image_t));
i->drawable = drawable;

View File

@ -54,7 +54,7 @@ static int compare_printers(plist_t *p1, plist_t *p2);
static void get_system_printers(void);
static void query (void);
static void run (char *, int, GParam *, int *, GParam **);
static void run (char *, int, GimpParam *, int *, GimpParam **);
static int do_print_dialog (char *proc_name);
#ifndef GIMP_1_0
@ -72,7 +72,7 @@ static void cleanupfunc(void);
* Globals...
*/
GPlugInInfo PLUG_IN_INFO = /* Plug-in information */
GimpPlugInInfo PLUG_IN_INFO = /* Plug-in information */
{
NULL, /* init_proc */
NULL, /* quit_proc */
@ -177,36 +177,36 @@ cleanupfunc(void)
static void
query (void)
{
static GParamDef args[] =
static GimpParamDef args[] =
{
{ PARAM_INT32, "run_mode", "Interactive, non-interactive" },
{ PARAM_IMAGE, "image", "Input image" },
{ PARAM_DRAWABLE, "drawable", "Input drawable" },
{ PARAM_STRING, "output_to", "Print command or filename (| to pipe to command)" },
{ PARAM_STRING, "driver", "Printer driver short name" },
{ PARAM_STRING, "ppd_file", "PPD file" },
{ PARAM_INT32, "output_type", "Output type (0 = gray, 1 = color)" },
{ PARAM_STRING, "resolution", "Resolution (\"300\", \"720\", etc.)" },
{ PARAM_STRING, "media_size", "Media size (\"Letter\", \"A4\", etc.)" },
{ PARAM_STRING, "media_type", "Media type (\"Plain\", \"Glossy\", etc.)" },
{ PARAM_STRING, "media_source", "Media source (\"Tray1\", \"Manual\", etc.)" },
{ PARAM_FLOAT, "brightness", "Brightness (0-400%)" },
{ PARAM_FLOAT, "scaling", "Output scaling (0-100%, -PPI)" },
{ PARAM_INT32, "orientation", "Output orientation (-1 = auto, 0 = portrait, 1 = landscape)" },
{ PARAM_INT32, "left", "Left offset (points, -1 = centered)" },
{ PARAM_INT32, "top", "Top offset (points, -1 = centered)" },
{ PARAM_FLOAT, "gamma", "Output gamma (0.1 - 3.0)" },
{ PARAM_FLOAT, "contrast", "Contrast" },
{ PARAM_FLOAT, "cyan", "Cyan level" },
{ PARAM_FLOAT, "magenta", "Magenta level" },
{ PARAM_FLOAT, "yellow", "Yellow level" },
{ PARAM_INT32, "linear", "Linear output (0 = normal, 1 = linear)" },
{ PARAM_INT32, "image_type", "Image type (0 = line art, 1 = solid tones, 2 = continuous tone, 3 = monochrome)"},
{ PARAM_FLOAT, "saturation", "Saturation (0-1000%)" },
{ PARAM_FLOAT, "density", "Density (0-200%)" },
{ PARAM_STRING, "ink_type", "Type of ink or cartridge" },
{ PARAM_STRING, "dither_algorithm", "Dither algorithm" },
{ PARAM_INT32, "unit", "Unit 0=Inches 1=Metric" },
{ GIMP_PDB_INT32, "run_mode", "Interactive, non-interactive" },
{ GIMP_PDB_IMAGE, "image", "Input image" },
{ GIMP_PDB_DRAWABLE, "drawable", "Input drawable" },
{ GIMP_PDB_STRING, "output_to", "Print command or filename (| to pipe to command)" },
{ GIMP_PDB_STRING, "driver", "Printer driver short name" },
{ GIMP_PDB_STRING, "ppd_file", "PPD file" },
{ GIMP_PDB_INT32, "output_type", "Output type (0 = gray, 1 = color)" },
{ GIMP_PDB_STRING, "resolution", "Resolution (\"300\", \"720\", etc.)" },
{ GIMP_PDB_STRING, "media_size", "Media size (\"Letter\", \"A4\", etc.)" },
{ GIMP_PDB_STRING, "media_type", "Media type (\"Plain\", \"Glossy\", etc.)" },
{ GIMP_PDB_STRING, "media_source", "Media source (\"Tray1\", \"Manual\", etc.)" },
{ GIMP_PDB_FLOAT, "brightness", "Brightness (0-400%)" },
{ GIMP_PDB_FLOAT, "scaling", "Output scaling (0-100%, -PPI)" },
{ GIMP_PDB_INT32, "orientation", "Output orientation (-1 = auto, 0 = portrait, 1 = landscape)" },
{ GIMP_PDB_INT32, "left", "Left offset (points, -1 = centered)" },
{ GIMP_PDB_INT32, "top", "Top offset (points, -1 = centered)" },
{ GIMP_PDB_FLOAT, "gamma", "Output gamma (0.1 - 3.0)" },
{ GIMP_PDB_FLOAT, "contrast", "Contrast" },
{ GIMP_PDB_FLOAT, "cyan", "Cyan level" },
{ GIMP_PDB_FLOAT, "magenta", "Magenta level" },
{ GIMP_PDB_FLOAT, "yellow", "Yellow level" },
{ GIMP_PDB_INT32, "linear", "Linear output (0 = normal, 1 = linear)" },
{ GIMP_PDB_INT32, "image_type", "Image type (0 = line art, 1 = solid tones, 2 = continuous tone, 3 = monochrome)"},
{ GIMP_PDB_FLOAT, "saturation", "Saturation (0-1000%)" },
{ GIMP_PDB_FLOAT, "density", "Density (0-200%)" },
{ GIMP_PDB_STRING, "ink_type", "Type of ink or cartridge" },
{ GIMP_PDB_STRING, "dither_algorithm", "Dither algorithm" },
{ GIMP_PDB_INT32, "unit", "Unit 0=Inches 1=Metric" },
};
static gint nargs = sizeof(args) / sizeof(args[0]);
@ -301,21 +301,21 @@ volatile int SDEBUG = 1;
static void
run (char *name, /* I - Name of print program. */
int nparams, /* I - Number of parameters passed in */
GParam *param, /* I - Parameter values */
GimpParam *param, /* I - Parameter values */
int *nreturn_vals, /* O - Number of return values */
GParam **return_vals) /* O - Return values */
GimpParam **return_vals) /* O - Return values */
{
GDrawable *drawable; /* Drawable for image */
GRunModeType run_mode; /* Current run mode */
GimpDrawable *drawable; /* Drawable for image */
GimpRunModeType run_mode; /* Current run mode */
FILE *prn; /* Print file/command */
int ncolors; /* Number of colors in colormap */
GParam *values; /* Return values */
GimpParam *values; /* Return values */
#ifdef __EMX__
char *tmpfile; /* temp filename */
#endif
gint32 drawable_ID; /* drawable ID */
#ifndef GIMP_1_0
GimpExportReturnType export = EXPORT_CANCEL; /* return value of gimp_export_image() */
GimpExportReturnType export = GIMP_EXPORT_CANCEL; /* return value of gimp_export_image() */
#endif
int ppid = getpid (), /* PID of plugin */
opid, /* PID of output process */
@ -340,10 +340,10 @@ run (char *name, /* I - Name of print program. */
current_printer = get_printer_by_index (0);
run_mode = (GRunModeType)param[0].data.d_int32;
values = g_new (GParam, 1);
values = g_new (GimpParam, 1);
values[0].type = PARAM_STATUS;
values[0].data.d_status = STATUS_SUCCESS;
values[0].type = GIMP_PDB_STATUS;
values[0].data.d_status = GIMP_PDB_SUCCESS;
*nreturn_vals = 1;
*return_vals = values;
@ -363,14 +363,14 @@ run (char *name, /* I - Name of print program. */
case RUN_WITH_LAST_VALS:
gimp_ui_init ("print", TRUE);
export = gimp_export_image (&image_ID, &drawable_ID, "Print",
(CAN_HANDLE_RGB |
CAN_HANDLE_GRAY |
CAN_HANDLE_INDEXED |
CAN_HANDLE_ALPHA));
if (export == EXPORT_CANCEL)
(GIMP_EXPORT_CAN_HANDLE_RGB |
GIMP_EXPORT_CAN_HANDLE_GRAY |
GIMP_EXPORT_CAN_HANDLE_INDEXED |
GIMP_EXPORT_CAN_HANDLE_ALPHA));
if (export == GIMP_EXPORT_CANCEL)
{
*nreturn_vals = 1;
values[0].data.d_status = STATUS_EXECUTION_ERROR;
values[0].data.d_status = GIMP_PDB_EXECUTION_ERROR;
return;
}
break;
@ -690,7 +690,7 @@ run (char *name, /* I - Name of print program. */
cleanup:
#ifndef GIMP_1_0
if (export == EXPORT_EXPORT)
if (export == GIMP_EXPORT_EXPORT)
gimp_image_delete (image_ID);
#else
; /* MRS: empty statement to suppress compiler warning */

View File

@ -69,6 +69,6 @@
*/
/* How to create an Image wrapping a Gimp drawable */
extern Image Image_GDrawable_new(GDrawable *drawable);
extern Image Image_GDrawable_new(GimpDrawable *drawable);
#endif /* __PRINT_GIMP_H__ */

View File

@ -481,12 +481,9 @@ xjpg_load_channel (char *filename,
int l_tile_height;
int l_scanlines;
int l_idx, l_start, l_end;
guchar l_color[3];
GimpRGB l_color;
l_color[0] = red;
l_color[1] = green;
l_color[2] = blue;
gimp_rgba_set_uchar (&l_color, red, green, blue, 255);
/* We set up the normal JPEG error routines. */
cinfo.err = jpeg_std_error (&jerr.pub);
@ -566,11 +563,12 @@ xjpg_load_channel (char *filename,
if(drawable_id < 0)
{
l_drawable_id = gimp_channel_new (image_id, channel_name,
cinfo.output_width,
cinfo.output_height,
channel_opacity,
l_color);
l_drawable_id = gimp_channel_new (image_id,
channel_name,
cinfo.output_width,
cinfo.output_height,
channel_opacity,
&l_color);
if(l_drawable_id < 0)
{
fprintf(stderr, "XJT: cant create new channel\n");