Thu Dec 16 20:15:25 CET 1999 Olof S Kylande <olof@gimp.org>
Fix of KDE/Kwm selection add/sub/inter problem
NOTE: This is a workaround, not a real fix.
Many Thanks to Matthias Ettrich
* app/disp_callbacks.c
Updated unsharp-mask to version 0.10
* plug-ins/unsharp/dialog_f.c
* plug-ins/unsharp/dialog_f.h
* plug-ins/unsharp/dialog_i.c
* plug-ins/unsharp/dialog_i.h
* plug-ins/unsharp/unsharp.c
Updated print plug-in to version 3.0.1
* plug-ins/print/README (new file)
* plug-ins/print/print-escp2.c
* plug-ins/print/print-pcl.c
* plug-ins/print/print-ps.c
* plug-ins/print/print-util.c
* plug-ins/print/print.c
* plug-ins/print/print.h
Updated all files in the help/C/dialogs dir. This is
a first alpha glimpse of the help system. Please give
me feedback of the content. However since it's in alpha
stage it means that there is spell, grammatical, etc errors.
There is may also be pure errors which I hope "you" will
report to either olof@gimp.org or karin@gimp.org. Please
don't report spell, grammatical, etc error at this stage in dev.
If you have any plans to commit to the help system please write
to olof@gimp.org. (This is mandatory not a please ;-).
* help/C/welcome.html
* help/C/dialogs/about.html ..............
229 lines
7.4 KiB
C
229 lines
7.4 KiB
C
/*
|
|
*
|
|
* Print plug-in header file for the GIMP.
|
|
*
|
|
* Copyright 1997-1999 Michael Sweet (mike@easysw.com) and
|
|
* Robert Krawitz (rlk@alum.mit.edu)
|
|
*
|
|
* 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.
|
|
*
|
|
* Revision History:
|
|
*
|
|
* See ChangeLog
|
|
*/
|
|
|
|
/*
|
|
* Include necessary header files...
|
|
*/
|
|
#include "config.h"
|
|
|
|
#include <stdio.h>
|
|
#include <stdlib.h>
|
|
#include <string.h>
|
|
#include <errno.h>
|
|
#ifdef HAVE_UNISTD_H
|
|
#include <unistd.h>
|
|
#endif
|
|
|
|
#include <gtk/gtk.h>
|
|
#include <libgimp/gimp.h>
|
|
|
|
|
|
/*
|
|
* Constants...
|
|
*/
|
|
|
|
|
|
#define PLUG_IN_VERSION "3.0.1 - 05 Dec 1999"
|
|
#define PLUG_IN_NAME "Print"
|
|
#define OUTPUT_GRAY 0 /* Grayscale output */
|
|
#define OUTPUT_COLOR 1 /* Color output */
|
|
|
|
#define ORIENT_AUTO -1 /* Best orientation */
|
|
#define ORIENT_PORTRAIT 0 /* Portrait orientation */
|
|
#define ORIENT_LANDSCAPE 1 /* Landscape orientation */
|
|
|
|
#ifndef MIN
|
|
# define MIN(a,b) ((a) < (b) ? (a) : (b))
|
|
# define MAX(a,b) ((a) > (b) ? (a) : (b))
|
|
#endif /* !MIN */
|
|
|
|
|
|
/*
|
|
* Printer driver control structure. See "print.c" for the actual list...
|
|
*/
|
|
|
|
typedef struct
|
|
{
|
|
unsigned short composite[256];
|
|
unsigned short red[256];
|
|
unsigned short green[256];
|
|
unsigned short blue[256];
|
|
} lut_t;
|
|
|
|
|
|
typedef struct /* Plug-in variables */
|
|
{
|
|
char output_to[255], /* Name of file or command to print to */
|
|
driver[64], /* Name of printer "driver" */
|
|
ppd_file[255]; /* PPD file */
|
|
int output_type; /* Color or grayscale output */
|
|
char resolution[64], /* Resolution */
|
|
media_size[64], /* Media size */
|
|
media_type[64], /* Media type */
|
|
media_source[64]; /* Media source */
|
|
int brightness; /* Output brightness */
|
|
float scaling; /* Scaling, percent of printable area */
|
|
int orientation, /* Orientation - 0 = port., 1 = land.,
|
|
-1 = auto */
|
|
left, /* Offset from lower-lefthand corner, points */
|
|
top; /* ... */
|
|
float gamma; /* Gamma */
|
|
int contrast, /* Output Contrast */
|
|
red, /* Output red level */
|
|
green, /* Output green level */
|
|
blue; /* Output blue level */
|
|
int linear; /* Linear density (mostly for testing!) */
|
|
float saturation; /* Output saturation */
|
|
float density; /* Maximum output density */
|
|
} vars_t;
|
|
|
|
typedef struct /**** Printer List ****/
|
|
{
|
|
int active; /* Do we know about this printer? */
|
|
char name[17]; /* Name of printer */
|
|
vars_t v;
|
|
} plist_t;
|
|
|
|
/*
|
|
* Abstract data type for interfacing with the image creation program
|
|
* (in this case, the Gimp).
|
|
*/
|
|
typedef void *Image;
|
|
|
|
extern void Image_init(Image image);
|
|
extern int Image_bpp(Image image);
|
|
extern int Image_width(Image image);
|
|
extern int Image_height(Image image);
|
|
extern const char *Image_get_pluginname(Image image);
|
|
extern void Image_get_col(Image image, unsigned char *data, int column);
|
|
extern void Image_get_row(Image image, unsigned char *data, int row);
|
|
extern void Image_progress_init(Image image);
|
|
extern void Image_note_progress(Image image, double current, double total);
|
|
|
|
|
|
typedef struct
|
|
{
|
|
char *long_name, /* Long name for UI */
|
|
*driver; /* Short name for printrc file */
|
|
int color, /* TRUE if supports color */
|
|
model; /* Model number */
|
|
float gamma, /* Gamma correction */
|
|
density; /* Ink "density" or black level */
|
|
char **(*parameters)(int model, char *ppd_file, char *name, int *count);
|
|
/* Parameter names */
|
|
void (*media_size)(int model, char *ppd_file, char *media_size,
|
|
int *width, int *length);
|
|
void (*imageable_area)(int model, char *ppd_file, char *media_size,
|
|
int *left, int *right, int *bottom, int *top);
|
|
/* Print function */
|
|
void (*print)(int model, int copies, FILE *prn, Image image,
|
|
unsigned char *cmap, lut_t *lut, vars_t *v);
|
|
} printer_t;
|
|
|
|
typedef void (*convert_t)(unsigned char *in, unsigned short *out, int width,
|
|
int bpp, lut_t *lut, unsigned char *cmap,
|
|
vars_t *vars);
|
|
|
|
|
|
/*
|
|
* Prototypes...
|
|
*/
|
|
|
|
extern void dither_black(unsigned short *, int, int, int, unsigned char *);
|
|
|
|
extern void dither_cmyk(unsigned short *, int, int, int, unsigned char *,
|
|
unsigned char *, unsigned char *,
|
|
unsigned char *, unsigned char *,
|
|
unsigned char *, unsigned char *, int);
|
|
|
|
extern void dither_black4(unsigned short *, int, int, int,
|
|
unsigned char *);
|
|
|
|
extern void dither_cmyk4(unsigned short *, int, int, int, unsigned char *,
|
|
unsigned char *, unsigned char *,
|
|
unsigned char *);
|
|
|
|
extern void gray_to_gray(unsigned char *, unsigned short *, int, int,
|
|
lut_t *, unsigned char *, vars_t *);
|
|
extern void indexed_to_gray(unsigned char *, unsigned short *, int, int,
|
|
lut_t *, unsigned char *, vars_t *);
|
|
extern void indexed_to_rgb(unsigned char *, unsigned short *, int, int,
|
|
lut_t *, unsigned char *, vars_t *);
|
|
extern void rgb_to_gray(unsigned char *, unsigned short *, int, int,
|
|
lut_t *, unsigned char *, vars_t *);
|
|
extern void rgb_to_rgb(unsigned char *, unsigned short *, int, int,
|
|
lut_t *, unsigned char *, vars_t *);
|
|
|
|
extern void compute_lut(lut_t *lut, float print_gamma,
|
|
float app_gamma, vars_t *v);
|
|
|
|
|
|
extern void default_media_size(int model, char *ppd_file, char *media_size,
|
|
int *width, int *length);
|
|
|
|
|
|
extern char **escp2_parameters(int model, char *ppd_file, char *name,
|
|
int *count);
|
|
extern void escp2_imageable_area(int model, char *ppd_file,
|
|
char *media_size, int *left, int *right,
|
|
int *bottom, int *top);
|
|
extern void escp2_print(int model, int copies, FILE *prn,
|
|
Image image, unsigned char *cmap,
|
|
lut_t *lut, vars_t *v);
|
|
|
|
|
|
extern char **pcl_parameters(int model, char *ppd_file, char *name,
|
|
int *count);
|
|
extern void pcl_imageable_area(int model, char *ppd_file, char *media_size,
|
|
int *left, int *right, int *bottom,
|
|
int *top);
|
|
extern void pcl_print(int model, int copies, FILE *prn,
|
|
Image image, unsigned char *cmap,
|
|
lut_t *lut, vars_t *v);
|
|
|
|
|
|
extern char **ps_parameters(int model, char *ppd_file, char *name,
|
|
int *count);
|
|
extern void ps_media_size(int model, char *ppd_file, char *media_size,
|
|
int *width, int *length);
|
|
extern void ps_imageable_area(int model, char *ppd_file, char *media_size,
|
|
int *left, int *right, int *bottom,
|
|
int *top);
|
|
extern void ps_print(int model, int copies, FILE *prn,
|
|
Image image, unsigned char *cmap,
|
|
lut_t *lut, vars_t *v);
|
|
|
|
#ifdef LEFTOVER_8_BIT
|
|
extern void dither_cmyk4(unsigned char *, int, int, int, unsigned char *,
|
|
unsigned char *, unsigned char *,
|
|
unsigned char *);
|
|
extern void dither_black4(unsigned char *, int, int, int, unsigned char *);
|
|
extern void gray_to_gray(unsigned char *, unsigned char *, int, int,
|
|
lut_t *, unsigned char *, float);
|
|
extern void indexed_to_gray(unsigned char *, unsigned char *, int, int,
|
|
lut_t *, unsigned char *, float);
|
|
#endif
|
|
|