1 /* sane - Scanner Access Now Easy. 2 3 Copyright (C) 2002-2006 Henning Meier-Geinitz <henning@meier-geinitz.de> 4 5 This file is part of the SANE package. 6 7 This program is free software; you can redistribute it and/or 8 modify it under the terms of the GNU General Public License as 9 published by the Free Software Foundation; either version 2 of the 10 License, or (at your option) any later version. 11 12 This program is distributed in the hope that it will be useful, but 13 WITHOUT ANY WARRANTY; without even the implied warranty of 14 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 15 General Public License for more details. 16 17 You should have received a copy of the GNU General Public License 18 along with this program. If not, see <https://www.gnu.org/licenses/>. 19 20 As a special exception, the authors of SANE give permission for 21 additional uses of the libraries contained in this release of SANE. 22 23 The exception is that, if you link a SANE library with other files 24 to produce an executable, this does not by itself cause the 25 resulting executable to be covered by the GNU General Public 26 License. Your use of that executable is in no way restricted on 27 account of linking the SANE library code into it. 28 29 This exception does not, however, invalidate any other reasons why 30 the executable file might be covered by the GNU General Public 31 License. 32 33 If you submit changes to SANE to the maintainers to be included in 34 a subsequent release, you agree by submitting the changes that 35 those changes may be distributed with this exception intact. 36 37 If you write modifications of your own for SANE, it is your choice 38 whether to permit this exception to apply to your modifications. 39 If you do not wish that, delete this exception notice. 40 41 This backend is for testing frontends. 42 */ 43 44 #ifndef test_h 45 #define test_h 46 47 48 typedef enum 49 { 50 param_none = 0, 51 param_bool, 52 param_int, 53 param_fixed, 54 param_string 55 } 56 parameter_type; 57 58 typedef enum 59 { 60 opt_num_opts = 0, 61 opt_mode_group, 62 opt_mode, 63 opt_depth, 64 opt_hand_scanner, 65 opt_three_pass, /* 5 */ 66 opt_three_pass_order, 67 opt_resolution, 68 opt_scan_source, 69 opt_special_group, 70 opt_test_picture, 71 opt_invert_endianess, 72 opt_read_limit, 73 opt_read_limit_size, 74 opt_read_delay, 75 opt_read_delay_duration, 76 opt_read_status_code, 77 opt_ppl_loss, 78 opt_fuzzy_parameters, 79 opt_non_blocking, 80 opt_select_fd, 81 opt_enable_test_options, 82 opt_print_options, 83 opt_geometry_group, 84 opt_tl_x, 85 opt_tl_y, 86 opt_br_x, 87 opt_br_y, 88 opt_bool_group, 89 opt_bool_soft_select_soft_detect, 90 opt_bool_hard_select_soft_detect, 91 opt_bool_hard_select, 92 opt_bool_soft_detect, 93 opt_bool_soft_select_soft_detect_emulated, 94 opt_bool_soft_select_soft_detect_auto, 95 opt_int_group, 96 opt_int, 97 opt_int_constraint_range, 98 opt_int_constraint_word_list, 99 opt_int_array, 100 opt_int_array_constraint_range, 101 opt_int_array_constraint_word_list, 102 opt_int_inexact, 103 opt_gamma_red, 104 opt_gamma_green, 105 opt_gamma_blue, 106 opt_gamma_all, 107 opt_fixed_group, 108 opt_fixed, 109 opt_fixed_constraint_range, 110 opt_fixed_constraint_word_list, 111 opt_string_group, 112 opt_string, 113 opt_string_constraint_string_list, 114 opt_string_constraint_long_string_list, 115 opt_button_group, 116 opt_button, 117 /* must come last: */ 118 num_options 119 } 120 test_opts; 121 122 123 typedef struct Test_Device 124 { 125 struct Test_Device *next; 126 SANE_Device sane; 127 SANE_Option_Descriptor opt[num_options]; 128 Option_Value val[num_options]; 129 SANE_Bool loaded[num_options]; 130 SANE_Parameters params; 131 SANE_String name; 132 SANE_Pid reader_pid; 133 SANE_Int reader_fds; 134 SANE_Int pipe; 135 FILE *pipe_handle; 136 SANE_Word pass; 137 SANE_Word bytes_per_line; 138 SANE_Word pixels_per_line; 139 SANE_Word lines; 140 size_t bytes_total; 141 SANE_Bool open; 142 SANE_Bool scanning; 143 SANE_Bool cancelled; 144 SANE_Bool eof; 145 SANE_Bool options_initialized; 146 SANE_Int number_of_scans; 147 } 148 Test_Device; 149 150 #endif /* test_h */ 151