1 /* sane - Scanner Access Now Easy. 2 Copyright (C) 1997 Gordon Matzigkeit 3 This file is part of the SANE package. 4 5 This program is free software; you can redistribute it and/or 6 modify it under the terms of the GNU General Public License as 7 published by the Free Software Foundation; either version 2 of the 8 License, or (at your option) any later version. 9 10 This program is distributed in the hope that it will be useful, but 11 WITHOUT ANY WARRANTY; without even the implied warranty of 12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 13 General Public License for more details. 14 15 You should have received a copy of the GNU General Public License 16 along with this program. If not, see <https://www.gnu.org/licenses/>. 17 18 As a special exception, the authors of SANE give permission for 19 additional uses of the libraries contained in this release of SANE. 20 21 The exception is that, if you link a SANE library with other files 22 to produce an executable, this does not by itself cause the 23 resulting executable to be covered by the GNU General Public 24 License. Your use of that executable is in no way restricted on 25 account of linking the SANE library code into it. 26 27 This exception does not, however, invalidate any other reasons why 28 the executable file might be covered by the GNU General Public 29 License. 30 31 If you submit changes to SANE to the maintainers to be included in 32 a subsequent release, you agree by submitting the changes that 33 those changes may be distributed with this exception intact. 34 35 If you write modifications of your own for SANE, it is your choice 36 whether to permit this exception to apply to your modifications. 37 If you do not wish that, delete this exception notice. */ 38 #ifndef _PINT_H 39 #define _PINT_H 40 41 #include <sys/types.h> 42 43 /* FIXME - in the PINT sources, this is set to ifdef __NetBSD__ */ 44 #include <sys/ioctl.h> 45 46 #ifdef HAVE_SYS_SCANIO_H 47 #include <sys/scanio.h> 48 #endif 49 50 typedef enum 51 { 52 OPT_NUM_OPTS = 0, 53 54 OPT_MODE_GROUP, 55 OPT_MODE, 56 /* FIXME: eventually need to have both X and Y resolution. */ 57 OPT_RESOLUTION, 58 59 OPT_GEOMETRY_GROUP, 60 OPT_TL_X, /* top-left x */ 61 OPT_TL_Y, /* top-left y */ 62 OPT_BR_X, /* bottom-right x */ 63 OPT_BR_Y, /* bottom-right y */ 64 65 OPT_ENHANCEMENT_GROUP, 66 OPT_BRIGHTNESS, 67 OPT_CONTRAST, 68 69 /* must come last: */ 70 NUM_OPTIONS 71 } 72 PINT_Option; 73 74 typedef struct PINT_Device 75 { 76 struct PINT_Device *next; 77 SANE_Device sane; 78 SANE_Range dpi_range; 79 SANE_Range x_range; 80 SANE_Range y_range; 81 struct scan_io scanio; /* Scanner hardware state. */ 82 } 83 PINT_Device; 84 85 typedef struct PINT_Scanner 86 { 87 /* all the state needed to define a scan request: */ 88 struct PINT_Scanner *next; 89 90 SANE_Option_Descriptor opt[NUM_OPTIONS]; 91 Option_Value val[NUM_OPTIONS]; 92 93 int scanning; 94 SANE_Parameters params; 95 96 int fd; /* Device file descriptor */ 97 98 /* scanner dependent/low-level state: */ 99 PINT_Device *hw; 100 } 101 PINT_Scanner; 102 103 #endif /* _PINT_H */ 104