1 /* 2 Copyright (C) 2008, Panasonic Russia Ltd. 3 */ 4 /* sane - Scanner Access Now Easy. 5 Panasonic KV-S1020C / KV-S1025C USB scanners. 6 */ 7 8 #ifndef __KVS1025_H 9 #define __KVS1025_H 10 11 /* SANE backend name */ 12 #ifdef BACKEND_NAME 13 #undef BACKEND_NAME 14 #endif 15 16 #define BACKEND_NAME kvs1025 17 18 /* Build version */ 19 #define V_BUILD 5 20 21 /* Paper range supported -- MAX scanner limits */ 22 #define KV_MAX_X_RANGE 216 23 #define KV_MAX_Y_RANGE 2540 24 25 /* Round ULX, ULY, Width and Height to 16 Pixels */ 26 #define KV_PIXEL_ROUND 19200 27 /* (XR * W / 1200) % 16 == 0 i.e. (XR * W) % 19200 == 0 */ 28 29 /* MAX IULs per LINE */ 30 #define KV_PIXEL_MAX 14064 31 /* Max 14064 pixels per line, 1/1200 inch each */ 32 33 #define MM_PER_INCH 25.4 34 #define mmToIlu(mm) (((mm) * 1200) / MM_PER_INCH) 35 #define iluToMm(ilu) (((ilu) * MM_PER_INCH) / 1200) 36 37 /* Vendor defined options */ 38 #define SANE_NAME_DUPLEX "duplex" 39 #define SANE_NAME_PAPER_SIZE "paper-size" 40 #define SANE_NAME_AUTOSEP "autoseparation" 41 #define SANE_NAME_LANDSCAPE "landscape" 42 #define SANE_NAME_INVERSE "inverse" 43 #define SANE_NAME_MIRROR "mirror" 44 #define SANE_NAME_LONGPAPER "longpaper" 45 #define SANE_NAME_LENGTHCTL "length-control" 46 #define SANE_NAME_MANUALFEED "manual-feed" 47 #define SANE_NAME_FEED_TIMEOUT "feed-timeout" 48 #define SANE_NAME_DBLFEED "double-feed" 49 50 #define SANE_TITLE_DUPLEX SANE_I18N("Duplex") 51 #define SANE_TITLE_PAPER_SIZE SANE_I18N("Paper size") 52 #define SANE_TITLE_AUTOSEP SANE_I18N("Automatic separation") 53 #define SANE_TITLE_LANDSCAPE SANE_I18N("Landscape") 54 #define SANE_TITLE_INVERSE SANE_I18N("Inverse Image") 55 #define SANE_TITLE_MIRROR SANE_I18N("Mirror image") 56 #define SANE_TITLE_LONGPAPER SANE_I18N("Long paper mode") 57 #define SANE_TITLE_LENGTHCTL SANE_I18N("Length control mode") 58 #define SANE_TITLE_MANUALFEED SANE_I18N("Manual feed mode") 59 #define SANE_TITLE_FEED_TIMEOUT SANE_I18N("Manual feed timeout") 60 #define SANE_TITLE_DBLFEED SANE_I18N("Double feed detection") 61 62 #define SANE_DESC_DUPLEX \ 63 SANE_I18N("Enable Duplex (Dual-Sided) Scanning") 64 #define SANE_DESC_PAPER_SIZE \ 65 SANE_I18N("Physical size of the paper in the ADF"); 66 #define SANE_DESC_AUTOSEP \ 67 SANE_I18N("Automatic separation") 68 69 #define SIDE_FRONT 0x00 70 #define SIDE_BACK 0x80 71 72 /* Debug levels. 73 * Should be common to all backends. */ 74 75 #define DBG_error0 0 76 #define DBG_error 1 77 #define DBG_sense 2 78 #define DBG_warning 3 79 #define DBG_inquiry 4 80 #define DBG_info 5 81 #define DBG_info2 6 82 #define DBG_proc 7 83 #define DBG_read 8 84 #define DBG_sane_init 10 85 #define DBG_sane_proc 11 86 #define DBG_sane_info 12 87 #define DBG_sane_option 13 88 #define DBG_shortread 101 89 90 /* Prototypes of SANE backend functions, see kvs1025.c */ 91 92 SANE_Status sane_init (SANE_Int * version_code, 93 SANE_Auth_Callback /* __sane_unused__ authorize */ ); 94 95 void sane_exit (void); 96 97 SANE_Status sane_get_devices (const SANE_Device *** device_list, 98 SANE_Bool /*__sane_unused__ local_only*/ ); 99 100 SANE_Status sane_open (SANE_String_Const devicename, SANE_Handle * handle); 101 102 void sane_close (SANE_Handle handle); 103 104 const SANE_Option_Descriptor *sane_get_option_descriptor (SANE_Handle 105 handle, 106 SANE_Int option); 107 108 SANE_Status sane_control_option (SANE_Handle handle, SANE_Int option, 109 SANE_Action action, void *val, 110 SANE_Int * info); 111 SANE_Status sane_get_parameters (SANE_Handle handle, 112 SANE_Parameters * params); 113 114 SANE_Status sane_start (SANE_Handle handle); 115 116 SANE_Status sane_read (SANE_Handle handle, SANE_Byte * buf, 117 SANE_Int max_len, SANE_Int * len); 118 119 void sane_cancel (SANE_Handle handle); 120 121 SANE_Status sane_set_io_mode (SANE_Handle h, SANE_Bool m); 122 123 SANE_Status sane_get_select_fd (SANE_Handle h, SANE_Int * fd); 124 125 SANE_String_Const sane_strstatus (SANE_Status status); 126 127 #endif /* #ifndef __KVS1025_H */ 128