summaryrefslogtreecommitdiff
path: root/lib/epson-escpr-def.h
blob: 51a9800d78aa5c3c7cf46e6f2fbf3e516b8139bc (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
/*________________________________  epson-escpr-def.h   ________________________________*/

/*       1         2         3         4         5         6         7         8        */
/*34567890123456789012345678901234567890123456789012345678901234567890123456789012345678*/
/*******************************************|********************************************/
/*
 *   Copyright (c) 2009  Seiko Epson Corporation                 All rights reserved.
 *
 *   Copyright protection claimed includes all forms and matters of
 *   copyrightable material and information now allowed by statutory or judicial
 *   law or hereinafter granted, including without limitation, material generated
 *   from the software programs which are displayed on the screen such as icons,
 *   screen display looks, etc.
 *
 */
/*******************************************|********************************************/
/*                                                                                      */
/*                           Epson ESC/PR External Definitions                          */
/*                                                                                      */
/*******************************************|********************************************/
#ifndef __EPSON_ESCPR_DEF_2_H__
#define __EPSON_ESCPR_DEF_2_H__
#ifdef __cplusplus
extern "C" {
#endif

/*------------------------------------  Includes   -------------------------------------*/
/*******************************************|********************************************/
#include "epson-typedefs.h"

/*------------------------------------- Data Types -------------------------------------*/
/*******************************************|********************************************/

/*----------------------------------  Generic Macros   ---------------------------------*/
/*******************************************|********************************************/

/*-----------------------------------  Definitions  ------------------------------------*/
/*******************************************|********************************************/
    /*** Maximum Ink Cartridge Number                                                   */
    /*** -------------------------------------------------------------------------------*/
#define EPS_INK_NUM                 20

    /*** Buffer size for manufacter name and model name                                 */
    /*** -------------------------------------------------------------------------------*/
#define EPS_NAME_BUFFSIZE           64
#define EPS_PRNID_BUFFSIZE          128
#define EPS_ADDR_BUFFSIZE           32

    /*** Communication Mode                                                             */
    /*** -------------------------------------------------------------------------------*/
#define EPS_COMM_UNID			0x00000001  /* Uni-Directional Communication            */
#define EPS_COMM_BID			0x00000002  /* Bi-Directional Communication             */

	/*** print protocol                                                                 */
    /*** -------------------------------------------------------------------------------*/
#define EPS_PROTOCOL_INVALID	0x00000000	/* Invalid                                  */
#define EPS_PROTOCOL_USB		0x00000010  /* USB                                      */
/*#define EPS_PROTOCOL_UPNP		0x00000020     UPnP                                     */
#define EPS_PROTOCOL_LPR		0x00000040  /* LPR                                      */
#define EPS_PROTOCOL_RAW		0x00000080  /* RAW Port                                 */
#define EPS_PROTOCOL_NET        (EPS_PROTOCOL_LPR | EPS_PROTOCOL_RAW)	/* All Network  */
#define EPS_PROTOCOL_ALL        (EPS_PROTOCOL_USB | EPS_PROTOCOL_NET)	/* All          */

#define EPS_COMM_USB_UNID   (EPS_COMM_UNID | EPS_PROTOCOL_USB )  /* USB Uni-Directional Communication  */
#define EPS_COMM_USB_BID    (EPS_COMM_BID  | EPS_PROTOCOL_USB )  /* USB Bi-Directional Communication   */
#define EPS_COMM_LPR_UNID   (EPS_COMM_UNID | EPS_PROTOCOL_LPR )  /* LPR Uni-Directional Communication  */
#define EPS_COMM_LPR_BID    (EPS_COMM_BID  | EPS_PROTOCOL_LPR )  /* LPR Bi-Directional Communication   */
#define EPS_COMM_RAW_UNID   (EPS_COMM_UNID | EPS_PROTOCOL_RAW )  /* RAW Uni-Directional Communication  */
#define EPS_COMM_RAW_BID    (EPS_COMM_BID  | EPS_PROTOCOL_RAW )  /* RAW Bi-Directional Communication   */
#define EPS_COMM_NET_UNID   (EPS_COMM_UNID | EPS_PROTOCOL_NET )  /* Net Uni-Directional Communication  */
#define EPS_COMM_NET_BID    (EPS_COMM_BID  | EPS_PROTOCOL_NET )  /* Net Bi-Directional Communication   */
#define EPS_COMM_ALL_UNID   (EPS_COMM_USB_UNID | EPS_COMM_NET_UNID)  /* USB & Net Uni-Directional Communication */
#define EPS_COMM_ALL_BID    (EPS_COMM_USB_BID  | EPS_COMM_NET_BID)  /* USB & Net Bi-Directional Communication */

	/*** sub protocol                                                                   */
    /*** -------------------------------------------------------------------------------*/
#define EPS_SUBPROTOCOL_PCDEV	0x00001000	/* UPnP PC device                           */

	  /* mask                                                                           */
#define EPS_PRT_MASK_DIRECTION		0x0000000F
#define EPS_PRT_MASK_PROTOCOL		0x00000FF0
#define EPS_PRT_MASK_SUBPROTOCOL	0x0000F000

#define EPS_PRT_DIRECTION(p)		( (p) & EPS_PRT_MASK_DIRECTION )
#define EPS_PRT_PROTOCOL(p)			( (p) & EPS_PRT_MASK_PROTOCOL )
#define EPS_PRT_SUBPROTOCOL(p)		( (p) & EPS_PRT_MASK_SUBPROTOCOL )
#define EPS_PRT_PROTOCOL_EX(p)		( (p) & (EPS_PRT_MASK_PROTOCOL | EPS_PRT_MASK_SUBPROTOCOL) )
#define EPS_IS_BI_PROTOCOL(p)       ( ( (p) & EPS_COMM_BID) == EPS_COMM_BID )


	/*** print language                                                                  */
    /*** -------------------------------------------------------------------------------*/
#define EPS_LANG_UNKNOWN			(0)			
#define EPS_LANG_ESCPR				(1)			/* ESC/P-R */
#define EPS_LANG_ESCPAGE			(2)			/* ESC/Page(Mono) */
#define EPS_LANG_ESCPAGE_COLOR		(3)			/* ESC/Page-Color */

	/*** probe method                                                                   */
    /*** -------------------------------------------------------------------------------*/
#define EPS_PRB_BYID               1		/* probe by ID string                       */
#define EPS_PRB_BYADDR             2		/* probe by IP Address                      */


	/*** Supported functions                                                            */
    /*** -------------------------------------------------------------------------------*/
#define EPS_SPF_RGBPRINT        0x0001      /* bitmap print.                            */
#define EPS_SPF_JPGPRINT        0x0002      /* jpeg print.                              */
/*#define EPS_SPF_PAPERSOURCE     0x0004       Specify the Paper source. epsStatPage() */
               

    /*** Print Page Attribute Values                                                    */
    /*** -------------------------------------------------------------------------------*/
        /*** Media Size                                                                 */
        /*** ---------------------------------------------------------------------------*/
/*** See EPS_MSID_* in epson-escpr-media.h                                              */

        /*** Media Type                                                                 */
        /*** ---------------------------------------------------------------------------*/
/*** See EPS_MTID_* in epson-escpr-media.h                                              */

        /*** Border Mode                                                                */
        /*** ---------------------------------------------------------------------------*/
/*** See EPS_MTID_* in epson-escpr-media.h                                              */

        /*** Print Quality                                                              */
        /*** ---------------------------------------------------------------------------*/
/*** See EPS_MTID_* in epson-escpr-media.h                                              */

        /*** Color Mode                                                                 */
        /*** ---------------------------------------------------------------------------*/
#define EPS_CM_COLOR                0       /* Color                                    */
#define EPS_CM_MONOCHROME           1       /* Monochrome                               */
#define EPS_CM_SEPIA                2       /* Sepia                                    */


        /*** In (input image) Resolution                                                */
        /*** ---------------------------------------------------------------------------*/
#define EPS_IR_360X360              (1 << 0)	/* 360 x 360 dpi                        */
#define EPS_IR_720X720              (1 << 1) 	/* 720 x 720 dpi				        */
#define EPS_IR_150X150              (1 << 2)    /* 150 x 150 dpi                        */
#define EPS_IR_300X300              (1 << 3)    /* 300 x 300 dpi                        */
#define EPS_IR_600X600              (1 << 4)	/* 600 x 600 dpi                        */

        /*** Print Direction                                                            */
        /*** ---------------------------------------------------------------------------*/
#define EPS_PD_BIDIREC              0       /* Bi-direction                             */
#define EPS_PD_UNIDIREC             1       /* Uni-direction                            */

        /*** Color Plane                                                                */
        /*** ---------------------------------------------------------------------------*/
#define EPS_CP_FULLCOLOR            0       /* Full Color                               */
#define EPS_CP_256COLOR             1       /* 256 Color                                */
#define EPS_CP_JPEG                 2       /* Jpeg                                     */
#define EPS_CP_PRINTCMD             3       /* Print command                            */

        /*** Command data type                                                          */
        /*** ---------------------------------------------------------------------------*/
#define EPS_MNT_UNKNOWN              0       /* invalid type                            */
#define EPS_MNT_CUSTOM               1       /* Cusutom data                            */
#define EPS_MNT_CLEANING             2       /* Cleaning command data                   */
#define EPS_MNT_NOZZLE               3       /* NozzleCheck command data                */

		/*** Palette Size                                                               */
        /*** ---------------------------------------------------------------------------*/
/*** Specified in Developer code                                                        */

        /*** Palette Data                                                               */
        /*** ---------------------------------------------------------------------------*/
/*** Specified in Developer code                                                        */

        /*** Brightness (range: -50 <= brightness <= 50)                                */
        /*** ---------------------------------------------------------------------------*/
/*** Specified in Developer code                                                        */

        /*** Contrast   (range: -50 <= contrast   <= 50)                                */
        /*** ---------------------------------------------------------------------------*/
/*** Specified in Developer code                                                        */

        /*** Saturation (range: -50 <= saturation <= 50)                                */
        /*** ---------------------------------------------------------------------------*/
/*** Specified in Developer code                                                        */

        /*** Top Margin                                                                 */
        /*** ---------------------------------------------------------------------------*/
/*** Specified in Developer code                                                        */

        /*** Left Margin                                                                */
        /*** ---------------------------------------------------------------------------*/
/*** Specified in Developer code                                                        */

        /*** Bottom Margin                                                              */
        /*** ---------------------------------------------------------------------------*/
/*** Specified in Developer code                                                        */

        /*** Right Margin                                                               */
        /*** ---------------------------------------------------------------------------*/
/*** Specified in Developer code                                                        */

        /*** CD/DVD Inside Dimameter                                                    */
        /*** ---------------------------------------------------------------------------*/
#define EPS_CDDIM_IN_MIN			18
#define EPS_CDDIM_IN_MAX			46
#define EPS_CDDIM_IN_DEF			43

        /*** CD/DVD Outside Dimameter                                                   */
        /*** ---------------------------------------------------------------------------*/
#define EPS_CDDIM_OUT_MIN			114
#define EPS_CDDIM_OUT_MAX			120
#define EPS_CDDIM_OUT_DEF			116

		/*** APF Automatic Correction                                                   */
        /*** ---------------------------------------------------------------------------*/
#define EPS_APF_ACT_NOTHING         0       /* Nothing                                  */
#define EPS_APF_ACT_STANDARD        1       /* Standard (use Exif)                      */
#define EPS_APF_ACT_PIM             2       /* use PIM                                  */
#define EPS_APF_ACT_PORTRATE        3       /* Portrate                                 */
#define EPS_APF_ACT_VIEW	        4       /* View										*/
#define EPS_APF_ACT_NIGHTVIEW       5       /* Night View                               */

        /*** APF Redeye                                                                 */
        /*** ---------------------------------------------------------------------------*/
#define EPS_APF_RDE_NOTHING         0       /* Nothing                                  */
#define EPS_APF_RDE_CORRECT         1       /* MoreSoft                                 */

        /*** max Jpeg data size                                                         */
        /*** ---------------------------------------------------------------------------*/
#define EPS_JPEG_SIZE_MAX           (1024*1024*3)   /* 3MB                              */
#define EPS_JPEG_PIXEL_MAX          (9600)          
#define EPS_JPEG_CHUNK_SIZE_MAX		(1024*64-1)		/* 0xFFFF max short */
#define EPS_JPEG_SIZE_UNLIMIT       ~(1<<(sizeof(EPS_INT32)*8-1))   /* 2GB              */


    /*** Layout template value                                                          */
    /*** -------------------------------------------------------------------------------*/
#define EPS_POS_HLEFT			(-1)
#define EPS_POS_HRIGHT			(-2)
#define EPS_POS_HCENTER			(-3)
#define EPS_POS_VTOP			(-1)
#define EPS_POS_VBOTTOM			(-2)
#define EPS_POS_VMIDDLE			(-3)


	/*** duplex                                                                         */
    /*** -------------------------------------------------------------------------------*/
#define EPS_DUPLEX_NONE			(0)
#define EPS_DUPLEX_LONG			(1 << 0)
#define EPS_DUPLEX_SHORT		(1 << 1)


	/*** feed direction                                                                 */
    /*** -------------------------------------------------------------------------------*/
#define EPS_FEEDDIR_PORTRAIT	(0)
#define EPS_FEEDDIR_LANDSCAPE	(1)


    /*** Ink Color                                                                      */
    /*** -------------------------------------------------------------------------------*/
enum EPS_COLOR {
    EPS_COLOR_BLACK,
    EPS_COLOR_CYAN,
    EPS_COLOR_MAGENTA,
    EPS_COLOR_YELLOW,
    EPS_COLOR_LIGHTCYAN,
    EPS_COLOR_LIGHTMAGENTA,
    EPS_COLOR_LIGHTYELLOW,
    EPS_COLOR_DARKYELLOW,
    EPS_COLOR_LIGHTBLACK,
    EPS_COLOR_RED,
    EPS_COLOR_VIOLET,
    EPS_COLOR_MATTEBLACK,
	EPS_COLOR_LIGHTLIGHTBLACK,
    EPS_COLOR_PHOTOBLACK,
    EPS_COLOR_CLEAR,
    EPS_COLOR_GRAY,
    EPS_COLOR_UNKNOWN,

	/* add ver5.0*/
    EPS_COLOR_BLACK2,
	EPS_COLOR_ORANGE,
	EPS_COLOR_GREEN,
	EPS_COLOR_WHITE,
	EPS_COLOR_CLEAN
};


/*---------------------------  Data Structure Declarations   ---------------------------*/
/*******************************************|********************************************/

    /*** Basic Rect Object                                                              */
    /*** -------------------------------------------------------------------------------*/
typedef struct _tagEPS_POS_ {
    EPS_INT32   x;
    EPS_INT32   y;
} EPS_POS;

    /*** Printer Infomation                                                             */
    /*** -------------------------------------------------------------------------------*/
typedef struct _tagEPS_PRINTER_ {
	EPS_UINT32			supportFunc;
	EPS_INT8            manufacturerName[EPS_NAME_BUFFSIZE];
	EPS_INT8            modelName[EPS_NAME_BUFFSIZE];         
	EPS_INT8			friendlyName[EPS_NAME_BUFFSIZE];
	EPS_INT8            location[EPS_ADDR_BUFFSIZE];
	EPS_INT8		    printerID[EPS_PRNID_BUFFSIZE];
	/* ver 4.2 */
	EPS_INT32			protocol;			    /* Communication protocol               */
	/* ver 5.0 */
	EPS_UINT32			language;				/* print language */
	EPS_INT8            macAddress[EPS_ADDR_BUFFSIZE];
} EPS_PRINTER;

	
	/*** Job Attributes                                                                 */
    /*** -------------------------------------------------------------------------------*/
typedef struct _tagEPS_JOB_ATTRIB_ {
	EPS_UINT16			version;			/* structure version                        */

	/*** ------------------------------------------------------------------------------ */
	/*** Source Image Attribute                                                         */
    EPS_UINT8           colorPlane;         /* Image color plane                        */
    EPS_UINT16          paletteSize;        /* Palette Size (if present)                */
    EPS_UINT8*          paletteData;        /* Palette Data (if present)                */
    EPS_UINT8           inputResolution;    /* Input Image Resolution                   */

	/*** ------------------------------------------------------------------------------ */
	/*** Output Attribute                                                               */
    EPS_INT32           mediaSizeIdx;       /* Media Size Index (EPS_MSID_*)            */
                                            /* (see epson-escpr-media.h)                */
    EPS_INT32           mediaTypeIdx;       /* Media Type Index (EPS_MTID_*)            */
                                            /* (see epson-escpr-media.h)                */

	EPS_UINT32          printLayout;        /* Print Layout                             */
    EPS_UINT32          printQuality;       /* Print Quality                            */
    EPS_UINT32          paperSource;        /* Paper Source (Lv1 ext)                   */
    EPS_UINT8           printDirection;     /* Printing Direction                       */

    EPS_UINT8           colorMode;          /* Color Mode                               */
    EPS_INT8            brightness;         /* Print Brightness                         */
    EPS_INT8            contrast;           /* Print Contrast                           */
    EPS_INT8            saturation;         /* Print Saturation                         */
    EPS_UINT8           apfAutoCorrect;     /* APF Automatic  (Jpeg only)               */
    EPS_INT8            sharpness;          /* sharpness      (Jpeg only)               */
    EPS_UINT8           redeye;             /* redeye correct (Jpeg only)               */

	/*** Custom border ***/
    EPS_INT16           topMargin;          /* Desired Top    print margin              */
    EPS_INT16           leftMargin;         /* Desired Left   print margin              */
    EPS_INT16           bottomMargin;       /* Desired Bottom print margin              */
    EPS_INT16           rightMargin;        /* Desired Right  print margin              */

	/*** CD/DVD Label ***/
	EPS_UINT8           cdDimIn;            /* CD Diameter Inside                       */
    EPS_UINT8           cdDimOut;           /* CD Diameter Outside                      */

	/* -------------------------------------------------------------------------------- */
	/* Ver 2                                                                            */
	EPS_INT32           cmdType;            /* Print command type                       */

	/* -------------------------------------------------------------------------------- */
	/* Ver 3                                                                            */
	EPS_INT32			duplex;             /* Duplex print                             */
	EPS_INT32           copies;             /* copies count                             */
	EPS_INT32           feedDirection;      /* paper feed direction                     */
} EPS_JOB_ATTRIB;

#define EPS_JOB_ATTRIB_VER_1		1
#define EPS_JOB_ATTRIB_VER_2		2
#define EPS_JOB_ATTRIB_VER_3		3
#define EPS_JOB_ATTRIB_VER_CUR	EPS_JOB_ATTRIB_VER_3


	/*** Page Attributes                                                                */
    /*** -------------------------------------------------------------------------------*/
typedef struct _tagEPS_PAGE_ATTRIB_ {
	EPS_UINT16				version;		/* structure version                        */
} EPS_PAGE_ATTRIB;
#define EPS_PAGE_ATTRIB_VERS_0	0
#define EPS_PAGE_ATTRIB_VER_CUR	EPS_PAGE_ATTRIB_VER_0


	/*** Additional Data                                                                */
    /*** -------------------------------------------------------------------------------*/
#if 0 /* DEL */
typedef struct _tagEPS_QRCODE_ {
	EPS_UINT16			version;		/* structure version                            */	
	EPS_INT8*			source;  		/* source buffer                                */
	EPS_UINT16			srcLength; 		/* source size                                  */
	EPS_INT32			xPos;			/* Left position                                */
	EPS_INT32			yPos;			/* Top position                                 */
	EPS_UINT32			width;  		/* width                                        */
} EPS_QRCODE;
#define EPS_QRCODE_VER_1	1
#define EPS_QRCODE_VER_CUR	EPS_QRCODE_VER_1

#define EPS_ADDDATA_NONE		0x00
#define EPS_ADDDATA_QRCODE		0x01
#endif

	/*** Print Data                                                                     */
    /*** -------------------------------------------------------------------------------*/
typedef union _tagEPS_PRN_DATA_ {
	EPS_UINT16				version;		/* structure version                        */

	struct {
		EPS_UINT16			version;
		const EPS_UINT8*	data;
		EPS_UINT32			heightPixels;
		EPS_UINT32			widthPixels;
	} band;

	struct {
		EPS_UINT16			version;
		const EPS_UINT8*	data;
		EPS_UINT32			dataSize;
	} chunk;
} EPS_PRN_DATA;
#define EPS_PRN_DATA_VER_1	1
#define EPS_PRN_DATA_VER_CUR	EPS_PRN_DATA_VER_1


    /*** Printer Status                                                                 */
    /*** -------------------------------------------------------------------------------*/
typedef struct _tagEPS_STATUS_ {
    EPS_INT32           printerStatus;
    EPS_INT32           errorCode;
	EPS_BOOL			jobContinue;
} EPS_STATUS;

    /*** Ink infomation                                                                 */
    /*** -------------------------------------------------------------------------------*/
typedef struct _tagEPS_INK_INFO_ {
    EPS_INT32           number;
    EPS_INT32           colors[EPS_INK_NUM];
    EPS_INT32           remaining[EPS_INK_NUM];
} EPS_INK_INFO;

	/*** Supported Media Information                                                    */
    /*** -------------------------------------------------------------------------------*/
        /* Media Type and Printing Modes                                                */
        /* (Container for media type information (nested inside EPS_MEDIA_SIZE) )       */
typedef struct _tagEPS_MEDIA_TYPE_V1_ {
    EPS_INT32           mediaTypeID;
    EPS_UINT32          layout;
    EPS_UINT32          quality;
    EPS_UINT32          paperSource;        /* Paper Source                             */
}EPS_MEDIA_TYPE_V1;

typedef struct _tagEPS_MEDIA_TYPE_V2_ {
    EPS_INT32           mediaTypeID;
    EPS_UINT32          layout;
    EPS_UINT32          quality;
    EPS_UINT32          paperSource;        /* Paper Source                             */
    EPS_UINT32          duplex;				/* duplex print support                     */
}EPS_MEDIA_TYPE_V2;
#define EPS_MEDIA_TYPE	EPS_MEDIA_TYPE_V2

        /* Media Size                                                                   */
        /* (Container for media size information (nested inside EPS_CAPABILITIES) )     */
typedef struct _tagEPS_MEDIA_SIZE_ {
    EPS_INT32           mediaSizeID;
    EPS_INT32           numTypes;
    EPS_MEDIA_TYPE*     typeList;
}EPS_MEDIA_SIZE;

        /* Supported Media                                                              */
typedef struct _tagEPS_SUPPORTED_MEDIA_ {
    EPS_INT32           JpegSizeLimit;
    EPS_INT32           numSizes;
    EPS_MEDIA_SIZE*     sizeList;
    EPS_UINT32          resolution;			/* supported input resolution */
}EPS_SUPPORTED_MEDIA;

        /* USB device infomation                                                        */
typedef struct _tagEPS_USB_DEVICE_ {
    EPS_UINT32          vid;		/* vender ID */
    EPS_UINT32          pid;		/* product ID */
    EPS_UINT32          port;		/* port number */
}EPS_USB_DEVICE;


    /*** Probe printer parameter                                                        */
    /*** -------------------------------------------------------------------------------*/
typedef struct tagEPS_PROBE_ {
    EPS_INT32   version;                    /* this version                             */
	EPS_INT32   method;
    EPS_UINT32  timeout;
	union{
		EPS_INT8	identify[EPS_PRNID_BUFFSIZE];
		struct {
			EPS_INT32   protocol;
			EPS_INT8	address[EPS_ADDR_BUFFSIZE];
		} addr;
	} dsc;
}EPS_PROBE;
#define EPS_PROBE_VER_1		1
#define EPS_PROBE_VER_CUR	EPS_PROBE_VER_1

    /* Local time                                                                       */
    /*** -------------------------------------------------------------------------------*/
typedef struct _tagEPS_LOCAL_TIME_ {
    EPS_UINT16          year;
    EPS_UINT8           mon;
    EPS_UINT8           day;
    EPS_UINT8           hour;
    EPS_UINT8           min;
    EPS_UINT8           sec;
}EPS_LOCAL_TIME;


/*--------------------------  External Function Definitions   --------------------------*/
/*******************************************|********************************************/

    /*** Common Function Definitions                                                    */
    /*** -------------------------------------------------------------------------------*/
typedef EPS_INT32   (*EPS_FindCallback  )(EPS_PRINTER                      );
typedef EPS_INT32   (*EPS_StateCallback )(EPS_INT32, EPS_INT32             );
typedef void*       (*EPS_MemAlloc      )(size_t                           );
typedef void        (*EPS_MemFree       )(void*                            );
    /* ESC/P-R Lib ignores sleep function return value, so any sleep function can be used. */
typedef EPS_INT32   (*EPS_Sleep         )(EPS_UINT32                       );
/*typedef void      (*EPS_Sleep         )(EPS_UINT32                       );*/
typedef EPS_UINT32	(*EPS_GetTime       )(void                             );
typedef EPS_UINT32	(*EPS_GetLocalTime  )(EPS_LOCAL_TIME*                  );
typedef EPS_INT32	(*EPS_LockSync      )(void                             );
typedef EPS_INT32	(*EPS_UnlockSync    )(void                             );


    /*** USB Function Definitions                                                       */
    /*** -------------------------------------------------------------------------------*/
typedef EPS_FILEDSC (*EPS_FindFirstPort )(EPS_USB_DEVICE*                               );
typedef EPS_BOOL    (*EPS_FindNextPort  )(EPS_FILEDSC, EPS_USB_DEVICE*                  );
typedef EPS_BOOL    (*EPS_FindClose     )(EPS_FILEDSC                                   );
typedef EPS_FILEDSC (*EPS_OpenPortal    )(const EPS_USB_DEVICE*                         );
typedef EPS_INT32   (*EPS_ClosePortal   )(EPS_FILEDSC                                   );
typedef EPS_INT32   (*EPS_ReadPortal    )(EPS_FILEDSC, EPS_UINT8*, EPS_INT32, EPS_INT32*);
typedef EPS_INT32   (*EPS_WritePortal   )(EPS_FILEDSC, const EPS_UINT8*, EPS_INT32, EPS_INT32*);
typedef EPS_INT32   (*EPS_GetDeviceID   )(EPS_FILEDSC, EPS_INT8*                        );


    /*** Sockets Function Definitions                                                   */
    /*** -------------------------------------------------------------------------------*/
typedef EPS_SOCKET  (*EPS_NetSocket            )(EPS_INT32, EPS_INT32, EPS_INT32        );
typedef EPS_INT32   (*EPS_NetClose             )(EPS_SOCKET                             );
typedef EPS_INT32	(*EPS_NetConnect	       )(EPS_SOCKET, const EPS_INT8*, EPS_UINT16);			
typedef EPS_INT32	(*EPS_NetShutdown          )(EPS_SOCKET, EPS_INT32                  );
typedef EPS_INT32	(*EPS_NetBind	           )(EPS_SOCKET, EPS_UINT16, EPS_UINT16*    );
typedef EPS_INT32	(*EPS_NetListen            )(EPS_SOCKET, EPS_INT32                  );
typedef EPS_INT32	(*EPS_NetAccept            )(EPS_SOCKET, EPS_UINT32, EPS_SOCKET*, 
                                                 EPS_INT8*, EPS_UINT16*                 );
typedef EPS_INT32	(*EPS_NetSend		       )(EPS_SOCKET, const void*, EPS_INT32, EPS_UINT32);
typedef EPS_INT32	(*EPS_NetSendTo	           )(EPS_SOCKET, const void*, EPS_INT32, 
                                                 const EPS_INT8*, EPS_UINT16, EPS_UINT32 );
typedef EPS_INT32	(*EPS_NetReceive	       )(EPS_SOCKET, void*, EPS_INT32, EPS_UINT32);
typedef EPS_INT32	(*EPS_NetReceiveFrom       )(EPS_SOCKET, void*, EPS_INT32,
						                         EPS_INT8*, EPS_UINT16*, EPS_UINT32     );
typedef EPS_INT32	(*EPS_NetGetSockName       )(EPS_SOCKET, EPS_INT8*, EPS_UINT16*     );
typedef EPS_INT32	(*EPS_NetSetMulticastTTL   )(EPS_SOCKET, EPS_INT32                  );
typedef EPS_INT32	(*EPS_NetSetBroadCast      )(EPS_SOCKET                             );


    /*** External Function Definitions                                                  */
    /*** -------------------------------------------------------------------------------*/
typedef struct _tagEPS_CMN_FUNC_ {
    EPS_INT32			version;            /* this version                             */
    EPS_FindCallback    findCallback;       /* Find Notification Callback Function      */
    EPS_StateCallback   stateCallback;      /* unused */
    EPS_MemAlloc        memAlloc;           /* Allocate Memory Function                 */
    EPS_MemFree         memFree;            /* Free Memory Function                     */
    EPS_Sleep           sleep;              /* Sleep Function                           */
    EPS_GetTime         getTime;            /* GetTime Function                         */
	EPS_GetLocalTime    getLocalTime;       /* Get Local Time Function                  */
	EPS_LockSync		lockSync;	    	/* Thread lock Function                     */
	EPS_UnlockSync		unlockSync; 		/* Thread unlock Function                   */
} EPS_CMN_FUNC;

#define EPS_CMNFUNC_VER_1		1
#define EPS_CMNFUNC_VER_CUR		EPS_CMNFUNC_VER_1

    /*** USB External Function Definitions                                              */
    /*** -------------------------------------------------------------------------------*/
typedef struct _tagEPS_USB_FUNC_ {
    EPS_INT32			version;            /* this version                             */
    EPS_OpenPortal      openPortal;         /* Open I/O Function                        */
    EPS_ClosePortal     closePortal;        /* Close I/O Function                       */
    EPS_ReadPortal      readPortal;         /* Read Data Function                       */
    EPS_WritePortal     writePortal;        /* Write Data Function                      */
	EPS_FindFirstPort	findFirst;          /* Find usb device start Function           */
	EPS_FindNextPort	findNext;           /* Find next usb device Function            */
	EPS_FindClose		findClose;          /* Find process end Function                */
} EPS_USB_FUNC;

#define EPS_USBFUNC_VER_1		1
#define EPS_USBFUNC_VER_CUR		EPS_USBFUNC_VER_1

    /*** NET External Function Definitions                                              */
    /*** -------------------------------------------------------------------------------*/
typedef struct _tagEPS_NET_FUNC_ {
    EPS_INT32				version;            /* this version                         */
	EPS_NetSocket           socket;             /* create socket Function               */
	EPS_NetClose            close;              /* close Function                       */
	EPS_NetConnect          connect;            /* connect Function                     */
	EPS_NetShutdown         shutdown;           /* shutdown Function                    */
	EPS_NetBind             bind;               /* bind Function                        */
	EPS_NetListen           listen;             /* listen Function                      */
	EPS_NetAccept           accept;             /* accept Function                      */
	EPS_NetSend             send;               /* send Function                        */
	EPS_NetSendTo           sendTo;             /* sendto Function                      */
	EPS_NetReceive          receive;            /* recv Function                        */
	EPS_NetReceiveFrom      receiveFrom;        /* revcfrom Function                    */
	EPS_NetGetSockName      getsockname;        /* getsockname Function                 */
	EPS_NetSetMulticastTTL  setMulticastTTL;    /* Set Multicast TTL Function           */
	EPS_NetSetBroadCast     setBroadcast;       /* Set enable broadcast Function        */
} EPS_NET_FUNC;
#define EPS_NETFUNC_VER_1		1
#define EPS_NETFUNC_VER_CUR		EPS_USBFUNC_VER_1

#ifdef __cplusplus
}
#endif

#endif  /* def __EPSON_ESCPR_DEF_H__ */

/*________________________________  epson-escpr-def.h   ________________________________*/
  
/*34567890123456789012345678901234567890123456789012345678901234567890123456789012345678*/
/*       1         2         3         4         5         6         7         8        */
/*******************************************|********************************************/
/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%|%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
/***** End of File *** End of File *** End of File *** End of File *** End of File ******/
/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%|%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/