1 /* xsane -- a graphical (X11, gtk) scanner-oriented SANE frontend 2 3 xsane-preferences.h 4 5 Oliver Rauch <Oliver.Rauch@rauch-domain.de> 6 Copyright (C) 1998-2007 Oliver Rauch 7 This file is part of the XSANE package. 8 9 This program is free software; you can redistribute it and/or modify 10 it under the terms of the GNU General Public License as published by 11 the Free Software Foundation; either version 2 of the License, or 12 (at your option) any later version. 13 14 This program is distributed in the hope that it will be useful, 15 but WITHOUT ANY WARRANTY; without even the implied warranty of 16 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 17 GNU General Public License for more details. 18 19 You should have received a copy of the GNU General Public License 20 along with this program; if not, write to the Free Software 21 Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ 22 23 /* ---------------------------------------------------------------------------------------------------------------------- */ 24 25 #ifndef xsane_preferences_h 26 #define xsane_preferences_h 27 28 /* ---------------------------------------------------------------------------------------------------------------------- */ 29 30 #include <sane/sane.h> 31 #include <gtk/gtk.h> 32 33 /* ---------------------------------------------------------------------------------------------------------------------- */ 34 35 typedef struct 36 { 37 char *name; /* user defined printer name */ 38 char *command; /* printercommand */ 39 char *copy_number_option; /* option to define number of copies */ 40 int lineart_resolution; /* printer resolution for lineart mode */ 41 int grayscale_resolution; /* printer resolution for grayscale mode */ 42 int color_resolution; /* printer resolution for color mode */ 43 double width; /* printer width of printable area in mm */ 44 double height; /* printer height of printable area in mm */ 45 double leftoffset; /* printer left offset in mm */ 46 double bottomoffset; /* printer bottom offset in mm */ 47 double gamma; /* printer gamma */ 48 double gamma_red; /* printer gamma red */ 49 double gamma_green; /* printer gamma green */ 50 double gamma_blue; /* printer gamma blue */ 51 char *icm_profile; /* printer ICM profile */ 52 int ps_flatedecoded; /* flatedecode (zlib compression), ps level 3 */ 53 int embed_csa; /* CSA = scanner ICM profile for postscript files */ 54 int embed_crd; /* CRD = printer ICM profile for postscript files */ 55 int cms_bpc; /* bpc */ 56 } 57 Preferences_printer_t; 58 59 /* ---------------------------------------------------------------------------------------------------------------------- */ 60 61 typedef struct 62 { 63 char *name; 64 double xoffset; 65 double yoffset; 66 double width; 67 double height; 68 } Preferences_preset_area_t; 69 70 /* ---------------------------------------------------------------------------------------------------------------------- */ 71 72 typedef struct 73 { 74 gchar *name; 75 double shadow_gray; 76 double shadow_red; 77 double shadow_green; 78 double shadow_blue; 79 double highlight_gray; 80 double highlight_red; 81 double highlight_green; 82 double highlight_blue; 83 double gamma_gray; 84 double gamma_red; 85 double gamma_green; 86 double gamma_blue; 87 int negative; 88 } Preferences_medium_t; 89 90 /* ---------------------------------------------------------------------------------------------------------------------- */ 91 92 typedef struct 93 { 94 char *xsane_version_str; /* xsane-version string */ 95 int xsane_mode; /* xsane_mode */ 96 char *tmp_path; /* path to temporary directory */ 97 char *working_directory; /* directory where xsane saves images etc */ 98 char *filename; /* default filename */ 99 char *filetype; /* default filetype */ 100 int cms_function; /* cms function (embed/srgb/working cs) */ 101 int cms_intent; /* cms rendering intent */ 102 int cms_bpc; /* cms black point compensation */ 103 int image_umask; /* image umask (permisson mask) */ 104 int directory_umask; /* directory umask (permisson mask) */ 105 106 char *fax_project; /* fax project */ 107 char *fax_command; /* faxcommand */ 108 char *fax_receiver_option; /* fax receiver option */ 109 char *fax_postscript_option; /* fax postscript option */ 110 char *fax_normal_option; /* fax normal mode option */ 111 char *fax_fine_option; /* fax fine mode option */ 112 char *fax_viewer; /* fax viewer */ 113 double fax_width; /* width of fax paper in mm */ 114 double fax_height; /* height of fax paper in mm */ 115 double fax_leftoffset; /* left offset of fax paper in mm */ 116 double fax_bottomoffset; /* bottom offset of fax paper in mm */ 117 int fax_fine_mode; /* use fine or normal mode */ 118 int fax_ps_flatedecoded; /* use postscript level 3 zlib compression */ 119 120 #ifdef XSANE_ACTIVATE_EMAIL 121 char *email_from; /* email address of sender */ 122 char *email_reply_to; /* email address for replied emails */ 123 char *email_smtp_server; /* ip address or domain name of smtp server */ 124 int email_smtp_port; /* port to connect to smtp sever */ 125 int email_authentication; /* type for email authentication */ 126 char *email_auth_user; /* user name for email authorization */ 127 char *email_auth_pass; /* password for email authorization */ 128 char *email_pop3_server; /* ip address or domain name of pop3 server */ 129 int email_pop3_port; /* port to connect to pop3 server */ 130 char *email_project; /* mail project */ 131 char *email_filetype; /* mail filetype */ 132 #endif 133 char *multipage_project; /* multipage project */ 134 char *multipage_filetype; /* multipage filetype */ 135 136 char *ocr_command; /* ocrcommand */ 137 char *ocr_inputfile_option; /* option for input file */ 138 char *ocr_outputfile_option; /* option for output file */ 139 int ocr_use_gui_pipe; /* use progress pipe */ 140 char *ocr_gui_outfd_option; /* option for progress pipe filedeskriptor */ 141 char *ocr_progress_keyword; /* keyword for progress value in gui pipe */ 142 143 char *browser; /* doc viewer for helpfiles */ 144 145 double jpeg_quality; /* quality when saving image as jpeg */ 146 double png_compression; /* compression when saving image as pnm */ 147 double tiff_zip_compression; /* compression rate for tiff zip (deflate) */ 148 int tiff_compression16_nr; /* compression type nr when saving 16i bit image as tiff */ 149 int tiff_compression8_nr; /* compression type nr when saving 8 bit image as tiff */ 150 int tiff_compression1_nr; /* compression type nr when saving 1 bit image as tiff */ 151 int save_devprefs_at_exit; /* save device preferences at exit */ 152 int overwrite_warning; /* warn if file exists */ 153 int skip_existing_numbers; /* skip used filenames when automatically increase counter */ 154 int save_ps_flatedecoded; /* use zlib to for postscript compression (flatedecode) */ 155 int save_pdf_flatedecoded; /* use zlib to for pdf compression (flatedecode) */ 156 int save_pnm16_as_ascii; /* selection if pnm 16 bit is saved as ascii or binary file */ 157 int reduce_16bit_to_8bit; /* reduce images with 16 bits/color to 8 bits/color */ 158 int filename_counter_step; /* filename_counter += filename_counter_step; */ 159 int filename_counter_len; /* minimum length of filename_counter */ 160 int adf_pages_max; /* maximum pages to scan in adf mode */ 161 162 int show_range_mode; /* how to show a range */ 163 int tooltips_enabled; /* should tooltips be disabled? */ 164 int show_histogram; /* show histogram ? */ 165 int show_gamma; /* show gamma curve ? */ 166 int show_batch_scan; /* show batch scan dialog ? */ 167 int show_standard_options; /* show standard options ? */ 168 int show_advanced_options; /* show advanced options ? */ 169 int show_resolution_list; /* show resolution list instead of slider ? */ 170 double length_unit; /* 1.0==mm, 10.0==cm, 25.4==inches, etc. */ 171 int main_window_fixed; /* fixed (1) or scrolled (0) main window */ 172 int preview_own_cmap; /* install colormap for preview */ 173 double preview_oversampling; /* resolution faktor for previews */ 174 double preview_gamma; /* gamma value for previews */ 175 double preview_gamma_red; /* red gamma value for previews */ 176 double preview_gamma_green; /* green gamma value for previews */ 177 double preview_gamma_blue; /* blue gamma value for previews */ 178 int disable_gimp_preview_gamma; /* fixed (1) or scrolled (0) main window */ 179 int preview_gamma_input_bits; /* handle preview gamma and histogram with # bits */ 180 int preview_pipette_range; /* dimension of a square that is used to pick pipette color */ 181 double xsane_gamma; 182 double xsane_gamma_red; 183 double xsane_gamma_green; 184 double xsane_gamma_blue; 185 double xsane_brightness; 186 double xsane_brightness_red; 187 double xsane_brightness_green; 188 double xsane_brightness_blue; 189 double xsane_contrast; 190 double xsane_contrast_red; 191 double xsane_contrast_green; 192 double xsane_contrast_blue; 193 194 int xsane_rgb_default; 195 int xsane_negative; 196 int auto_enhance_gamma; /* change gamma value with automatic color correction */ 197 int preselect_scan_area; /* automatic selection of scan area after preview scan */ 198 int auto_correct_colors; /* automatic color correction after preview scan */ 199 int gtk_update_policy; 200 int medium_nr; 201 202 char *display_icm_profile; 203 char *custom_proofing_icm_profile; 204 char *working_color_space_icm_profile; 205 206 int paper_orientation; /* image position on printer and page orientation */ 207 int printernr; /* number of printers */ 208 int printerdefinitions; 209 Preferences_printer_t **printer; 210 int preset_area_definitions; 211 Preferences_preset_area_t **preset_area; 212 int medium_definitions; 213 Preferences_medium_t **medium; 214 } 215 Preferences; 216 217 extern Preferences preferences; 218 219 extern void preferences_save (int fd); 220 extern void preferences_restore (int fd); 221 222 extern void preferences_save_media (int fd); 223 extern void preferences_restore_media (int fd); 224 225 #endif /* preferences_h */ 226