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

« back to all changes in this revision

Viewing changes to stp_support/printerqueues.h

  • Committer: Bazaar Package Importer
  • Author(s): Milan Zamazal
  • Date: 2007-05-01 16:32:13 UTC
  • mfrom: (1.1.1 upstream)
  • Revision ID: james.westby@ubuntu.com-20070501163213-ni1933khtg9fdvn5
Tags: 0.3.5-2
Move to unstable.

Show diffs side-by-side

added added

removed removed

Lines of Context:
5
5
        extern "C" {
6
6
#endif
7
7
 
 
8
#define PRINTERQUEUE_CUSTOMCOMMAND "<Use custom print command>"
 
9
#define PRINTERQUEUE_SAVETOFILE "<Save to file>"
 
10
 
8
11
struct pqprivate;
9
12
 
10
13
struct pqinfo
11
14
{
12
15
        void (*Dispose)(struct pqinfo *pq);
13
16
 
14
 
        /* For querying the available printer queues */
 
17
        /***** For querying the available printer queues *****/
15
18
 
16
19
        int (*GetPrinterCount)(struct pqinfo *pq);
17
20
        char *(*GetPrinterName)(struct pqinfo *pq,int index);
18
21
 
19
 
        /* Select a printer queue with this function */
20
 
 
 
22
        /* Get and set the current printer queue... */
 
23
        const char *(*GetPrinterQueue)(struct pqinfo *pq);
21
24
        void (*SetPrinterQueue)(struct pqinfo *pq,const char *queue);
22
25
 
23
26
        /* Returns the gutenprint driver associated with
30
33
 
31
34
        char *(*GetPPD)(struct pqinfo *pq);
32
35
 
33
 
        /* Functions to delineate the beginning and end of pages and jobs. */
 
36
 
 
37
        /***** Output Options *****/
 
38
 
 
39
#ifndef WIN32
 
40
        /* Custom command (Unix only)
 
41
           If a custom command is set, then instead of piping data to the
 
42
           queue's default command, it will be piped to the custom command. */
 
43
 
 
44
        const char *(*GetCustomCommand)(struct pqinfo *pq);
 
45
        void (*SetCustomCommand)(struct pqinfo *pq,const char *cmd);
 
46
#endif
 
47
 
 
48
        /* Saving to a file (Unix and Windows)
 
49
           Redirects the print data to a file.
 
50
           Uses a callback function to get the output filename at print-time.
 
51
       Use like this:
 
52
 
 
53
           Define a function that returns a filename - must return a full path,
 
54
           which will be free()d once the file is open:
 
55
 
 
56
       char *mygetfnfunc(void *userdata)
 
57
           {
 
58
             struct myuserdata *ud=(struct myuserdata *ud)userdata;
 
59
                 [do user interface stuff here]
 
60
             return(filename);
 
61
           }
 
62
           
 
63
           pqinfo->SetGetFilenameCallback(pqinfo,mygetfnfunc,userdata);
 
64
           
 
65
        */
 
66
 
 
67
        void (*SetGetFilenameCallback)(struct pqinfo *pq,char *(*getfilename)(void *userdata),void *userdata);
 
68
        
 
69
        /***** Job Handling *****/
 
70
 
34
71
        int (*InitialiseJob)(struct pqinfo *pq);
35
72
        void (*InitialisePage)(struct pqinfo *pq);
36
73
        void (*EndPage)(struct pqinfo *pq);