2
* print.cpp - encapsulates printing via GIMP-Print/GutenPrint
4
* Copyright (c) 2004 by Alastair M. Robinson
5
* Distributed under the terms of the GNU General Public License -
6
* see the file named "COPYING" for more details.
13
#include "support/configdb.h"
14
#include "support/pageextent.h"
15
#include "support/consumer.h"
16
#include "printoutput.h"
17
#include "support/progress.h"
18
#include <gutenprint/gutenprint.h>
20
#include "gprintersettings.h"
23
class ImageSource; // Forward Declaration
25
class GPrinter : public PageExtent, public GPrinterSettings
28
GPrinter(PrintOutput &output,ConfigFile *inf,const char *section);
30
void Print(ImageSource *source,int xpos,int ypos);
32
void SetProgress(Progress *p);
33
void GetImageableArea();
36
stp_image_status_t GetRow(int row,unsigned char *data);
38
void get_dimensions();
39
void custom_get_dimensions();
40
void print_dimensions();
47
int ptwidth, ptheight;
48
int pixelwidth, pixelheight;
61
const stp_printer_t *the_printer;
65
/* Static members and stubs */
66
static stp_image_t stpImage;
67
static bool writeerror;
68
static void writefunc(void *file, const char *buf, size_t bytes);
69
static void Image_init(stp_image_t *img);
70
static stp_image_status_t GetRowStub(stp_image_t *img, unsigned char *data,
71
size_t byte_limit, int row);
72
static int Image_width(stp_image_t *img);
73
static int Image_height(stp_image_t *img);
74
static const char *Image_get_appname(struct stp_image *image);
2
* print.cpp - encapsulates printing via GIMP-Print/GutenPrint
4
* Copyright (c) 2004 by Alastair M. Robinson
5
* Distributed under the terms of the GNU General Public License -
6
* see the file named "COPYING" for more details.
13
#include "support/configdb.h"
14
#include "support/pageextent.h"
15
#include "support/consumer.h"
16
#include "printoutput.h"
17
#include "support/progress.h"
18
#include <gutenprint/gutenprint.h>
20
#include "gprintersettings.h"
23
class ImageSource; // Forward Declaration
25
class GPrinter : public GPrinterSettings
28
GPrinter(PrintOutput &output,ConfigFile *inf,const char *section);
30
void Print(ImageSource *source,int xpos,int ypos);
32
void SetProgress(Progress *p);
33
void GetImageableArea();
34
void GetSizeLimits(int &minw,int &maxw,int &minh,int &maxh);
35
void SetCustomWidth(int w);
36
void SetCustomHeight(int h);
38
stp_image_status_t GetRow(int row,unsigned char *data);
40
void get_dimensions();
41
void custom_get_dimensions();
42
void print_dimensions();
49
int ptwidth, ptheight;
50
int pixelwidth, pixelheight;
68
const stp_printer_t *the_printer;
72
/* Static members and stubs */
73
static stp_image_t stpImage;
74
static bool writeerror;
75
static void writefunc(void *file, const char *buf, size_t bytes);
76
static void Image_init(stp_image_t *img);
77
static stp_image_status_t GetRowStub(stp_image_t *img, unsigned char *data,
78
size_t byte_limit, int row);
79
static int Image_width(stp_image_t *img);
80
static int Image_height(stp_image_t *img);
81
static const char *Image_get_appname(struct stp_image *image);