~ubuntu-branches/ubuntu/karmic/photoprint/karmic

« back to all changes in this revision

Viewing changes to print.h

  • Committer: Bazaar Package Importer
  • Author(s): Milan Zamazal
  • Date: 2007-05-01 16:32:13 UTC
  • mto: This revision was merged to the branch mainline in revision 3.
  • Revision ID: james.westby@ubuntu.com-20070501163213-k0gaendx7grjlmk5
Tags: upstream-0.3.5
ImportĀ upstreamĀ versionĀ 0.3.5

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
/*
2
 
 * print.cpp - encapsulates printing via GIMP-Print/GutenPrint
3
 
 *
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.
7
 
 *
8
 
 */
9
 
 
10
 
#ifndef PRINT_H
11
 
#define PRINT_H
12
 
 
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>
19
 
 
20
 
#include "gprintersettings.h"
21
 
 
22
 
 
23
 
class ImageSource; // Forward Declaration
24
 
 
25
 
class GPrinter : public PageExtent, public GPrinterSettings
26
 
{
27
 
        public:
28
 
        GPrinter(PrintOutput &output,ConfigFile *inf,const char *section);
29
 
        ~GPrinter();
30
 
        void Print(ImageSource *source,int xpos,int ypos);
31
 
        void Help();
32
 
        void SetProgress(Progress *p);
33
 
        void GetImageableArea();
34
 
 
35
 
        private:
36
 
        stp_image_status_t GetRow(int row,unsigned char *data);
37
 
 
38
 
        void get_dimensions();
39
 
        void custom_get_dimensions();
40
 
        void print_dimensions();
41
 
 
42
 
        ImageSource *source;
43
 
        Consumer *consumer;
44
 
        
45
 
        int xpos,ypos;
46
 
 
47
 
        int ptwidth, ptheight;
48
 
        int pixelwidth, pixelheight;
49
 
 
50
 
        int paperleft;
51
 
        int papertop;
52
 
        
53
 
        int firstrow;
54
 
        int firstpixel;
55
 
 
56
 
        int leftbleed;
57
 
        int rightbleed;
58
 
        int topbleed;
59
 
        int bottombleed;
60
 
 
61
 
        const stp_printer_t *the_printer;
62
 
 
63
 
        Progress *progress;
64
 
 
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);
75
 
};
76
 
 
77
 
 
78
 
#endif
 
1
/*
 
2
 * print.cpp - encapsulates printing via GIMP-Print/GutenPrint
 
3
 *
 
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.
 
7
 *
 
8
 */
 
9
 
 
10
#ifndef PRINT_H
 
11
#define PRINT_H
 
12
 
 
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>
 
19
 
 
20
#include "gprintersettings.h"
 
21
 
 
22
 
 
23
class ImageSource; // Forward Declaration
 
24
 
 
25
class GPrinter : public GPrinterSettings
 
26
{
 
27
        public:
 
28
        GPrinter(PrintOutput &output,ConfigFile *inf,const char *section);
 
29
        ~GPrinter();
 
30
        void Print(ImageSource *source,int xpos,int ypos);
 
31
        void Help();
 
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);
 
37
        private:
 
38
        stp_image_status_t GetRow(int row,unsigned char *data);
 
39
 
 
40
        void get_dimensions();
 
41
        void custom_get_dimensions();
 
42
        void print_dimensions();
 
43
 
 
44
        ImageSource *source;
 
45
        Consumer *consumer;
 
46
        
 
47
        int xpos,ypos;
 
48
 
 
49
        int ptwidth, ptheight;
 
50
        int pixelwidth, pixelheight;
 
51
 
 
52
        int paperleft;
 
53
        int papertop;
 
54
        
 
55
        int firstrow;
 
56
        int firstpixel;
 
57
 
 
58
        int leftbleed;
 
59
        int rightbleed;
 
60
        int topbleed;
 
61
        int bottombleed;
 
62
        
 
63
        int minwidth;
 
64
        int maxwidth;
 
65
        int minheight;
 
66
        int maxheight;
 
67
 
 
68
        const stp_printer_t *the_printer;
 
69
 
 
70
        Progress *progress;
 
71
 
 
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);
 
82
};
 
83
 
 
84
 
 
85
#endif