• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /*
2  *   Common HP-PCL definitions for CUPS.
3  *
4  *   Copyright 2007-2011 by Apple Inc.
5  *   Copyright 1993-2005 by Easy Software Products, All Rights Reserved.
6  *
7  *   These coded instructions, statements, and computer programs are the
8  *   property of Apple Inc. and are protected by Federal copyright
9  *   law.  Distribution and use rights are outlined in the file "COPYING"
10  *   which should have been included with this file.
11  */
12 
13 /*
14  * Include necessary headers...
15  */
16 
17 #include <string.h>
18 #include <ctype.h>
19 #include "pcl.h"
20 
21 
22 /*
23  * Functions/macros...
24  */
25 
26 #define pcl_reset()\
27 	printf("\033E")
28 #define pcl_set_copies(copies)\
29 	printf("\033&l%dX", (copies))
30 #define pcl_set_pcl_mode(m)\
31 	printf("\033%%%dA", (m))
32 #define pcl_set_hpgl_mode(m)\
33 	printf("\033%%%dB", (m))
34 #define pcl_set_negative_motion()\
35         printf("\033&a1N")
36 #define pcl_set_media_source(source)\
37 	printf("\033&l%dH", source)
38 #define pcl_set_media_type(type)\
39 	printf("\033&l%dM", type)
40 #define pcl_set_duplex(duplex,landscape)\
41 	if (duplex) printf("\033&l%dS", (duplex) + (landscape))
42 #define pcl_set_simple_black()\
43 	printf("\033*r-1U")
44 #define pcl_set_simple_color()\
45 	printf("\033*r3U")
46 #define pcl_set_simple_cmy()\
47 	printf("\033*r-3U")
48 #define pcl_set_simple_kcmy()\
49 	printf("\033*r-4U")
50 #define pcl_set_simple_resolution(r)\
51 	printf("\033*t%dR", (r))
52 
53 #define pjl_escape()\
54 	printf("\033%%-12345X@PJL\r\n")
55 #define pjl_set_job(job_id,user,title)\
56 	printf("@PJL JOB NAME = \"%s\" DISPLAY = \"%d %s %s\"\r\n", \
57 	       (title), (job_id), (user), (title))
58 #define pjl_enter_language(lang)\
59 	printf("@PJL ENTER LANGUAGE=%s\r\n", (lang))
60 
61 extern void	pcl_set_media_size(ppd_file_t *ppd, float width, float length);
62 extern void	pjl_write(const char *format,
63 		          const char *value, int job_id,
64                 	  const char *user, const char *title,
65 			  int num_options, cups_option_t *options);
66 
67