Lines Matching defs:lexmark_device
114 static SANE_Status init_options (Lexmark_Device * lexmark_device);
344 Lexmark_Device *lexmark_device;
350 for (lexmark_device = first_lexmark_device; lexmark_device;
351 lexmark_device = lexmark_device->next)
354 if (strcmp (lexmark_device->sane.name, devname) == 0)
356 lexmark_device->missing = SANE_FALSE;
361 lexmark_device = (Lexmark_Device *) malloc (sizeof (Lexmark_Device));
362 if (lexmark_device == NULL)
405 if (sanei_lexmark_low_assign_model (lexmark_device,
420 status = sanei_lexmark_low_open_device (lexmark_device);
421 sanei_usb_close (lexmark_device->devnum);
424 sanei_lexmark_low_init (lexmark_device);
427 lexmark_device->x_dpi = 75;
428 lexmark_device->y_dpi = 75;
431 lexmark_device->read_buffer = NULL;
434 lexmark_device->threshold = 0x80;
436 lexmark_device->shading_coeff = NULL;
439 lexmark_device->missing = SANE_FALSE;
442 lexmark_device->next = first_lexmark_device;
443 first_lexmark_device = lexmark_device;
557 Lexmark_Device *lexmark_device, *next_lexmark_device;
564 for (lexmark_device = first_lexmark_device; lexmark_device;
565 lexmark_device = next_lexmark_device)
567 next_lexmark_device = lexmark_device->next;
568 sanei_lexmark_low_destroy (lexmark_device);
569 free (lexmark_device);
584 Lexmark_Device *lexmark_device;
604 lexmark_device = first_lexmark_device;
605 while (lexmark_device != NULL)
607 if (lexmark_device->missing == SANE_FALSE)
609 sane_device_list[index] = &(lexmark_device->sane);
612 lexmark_device = lexmark_device->next;
632 Lexmark_Device *lexmark_device;
652 for (lexmark_device = first_lexmark_device; lexmark_device;
653 lexmark_device = lexmark_device->next)
656 lexmark_device->sane.name);
659 || strcmp (devicename, lexmark_device->sane.name) == 0)
663 *handle = lexmark_device;
665 if (!lexmark_device)
671 status = init_options (lexmark_device);
675 status = sanei_lexmark_low_open_device (lexmark_device);
684 Lexmark_Device *lexmark_device;
691 for (lexmark_device = first_lexmark_device; lexmark_device;
692 lexmark_device = lexmark_device->next)
694 if (lexmark_device == handle)
698 if (!lexmark_device)
701 sanei_lexmark_low_close_device (lexmark_device);
709 Lexmark_Device *lexmark_device;
721 for (lexmark_device = first_lexmark_device; lexmark_device;
722 lexmark_device = lexmark_device->next)
724 if (lexmark_device == handle)
728 if (!lexmark_device)
731 if (lexmark_device->opt[option].name)
734 lexmark_device->opt[option].name);
737 return &(lexmark_device->opt[option]);
743 calc_parameters (Lexmark_Device * lexmark_device)
745 if (strcmp (lexmark_device->val[OPT_MODE].s,
748 lexmark_device->opt[OPT_THRESHOLD].cap &= ~SANE_CAP_INACTIVE;
752 lexmark_device->opt[OPT_THRESHOLD].cap |= SANE_CAP_INACTIVE;
756 if (lexmark_device->val[OPT_MANUAL_GAIN].w == SANE_TRUE)
758 if (strcmp (lexmark_device->val[OPT_MODE].s, SANE_VALUE_SCAN_MODE_COLOR)
761 lexmark_device->opt[OPT_GRAY_GAIN].cap &= ~SANE_CAP_INACTIVE;
762 lexmark_device->opt[OPT_RED_GAIN].cap |= SANE_CAP_INACTIVE;
763 lexmark_device->opt[OPT_GREEN_GAIN].cap |= SANE_CAP_INACTIVE;
764 lexmark_device->opt[OPT_BLUE_GAIN].cap |= SANE_CAP_INACTIVE;
768 lexmark_device->opt[OPT_GRAY_GAIN].cap |= SANE_CAP_INACTIVE;
769 lexmark_device->opt[OPT_RED_GAIN].cap &= ~SANE_CAP_INACTIVE;
770 lexmark_device->opt[OPT_GREEN_GAIN].cap &= ~SANE_CAP_INACTIVE;
771 lexmark_device->opt[OPT_BLUE_GAIN].cap &= ~SANE_CAP_INACTIVE;
776 lexmark_device->opt[OPT_GRAY_GAIN].cap |= SANE_CAP_INACTIVE;
777 lexmark_device->opt[OPT_RED_GAIN].cap |= SANE_CAP_INACTIVE;
778 lexmark_device->opt[OPT_GREEN_GAIN].cap |= SANE_CAP_INACTIVE;
779 lexmark_device->opt[OPT_BLUE_GAIN].cap |= SANE_CAP_INACTIVE;
787 Lexmark_Device *lexmark_device;
797 for (lexmark_device = first_lexmark_device; lexmark_device;
798 lexmark_device = lexmark_device->next)
800 if (lexmark_device == handle)
804 if (!lexmark_device)
816 if (lexmark_device->opt[option].type == SANE_TYPE_GROUP)
823 if (!SANE_OPTION_IS_SETTABLE (lexmark_device->opt[option].cap))
825 if (!(lexmark_device->opt[option].cap & SANE_CAP_AUTOMATIC))
831 if (!SANE_OPTION_IS_SETTABLE (lexmark_device->opt[option].cap))
835 if (lexmark_device->opt[option].type == SANE_TYPE_BOOL)
844 if (lexmark_device->opt[option].constraint_type ==
848 sanei_constrain_value (&(lexmark_device->opt[option]), value,
861 lexmark_device->val[option].w = *(SANE_Int *) value;
869 lexmark_device->opt[option].name);
870 lexmark_device->val[option].w = *(SANE_Word *) value;
871 if (lexmark_device->val[OPT_TL_X].w >
872 lexmark_device->val[OPT_BR_X].w)
874 w = lexmark_device->val[OPT_TL_X].w;
875 lexmark_device->val[OPT_TL_X].w =
876 lexmark_device->val[OPT_BR_X].w;
877 lexmark_device->val[OPT_BR_X].w = w;
881 if (lexmark_device->val[OPT_TL_Y].w >
882 lexmark_device->val[OPT_BR_Y].w)
884 w = lexmark_device->val[OPT_TL_Y].w;
885 lexmark_device->val[OPT_TL_Y].w =
886 lexmark_device->val[OPT_BR_Y].w;
887 lexmark_device->val[OPT_BR_Y].w = w;
893 lexmark_device->val[option].w = *(SANE_Fixed *) value;
894 lexmark_device->threshold =
895 (0xFF * lexmark_device->val[option].w) / 100;
898 lexmark_device->val[option].w = *(SANE_Int *) value;
901 lexmark_device->y_dpi = lexmark_device->val[OPT_RESOLUTION].w;
902 lexmark_device->val[OPT_RESOLUTION].w = 75;
906 lexmark_device->val[OPT_RESOLUTION].w = lexmark_device->y_dpi;
918 lexmark_device->val[option].w = *(SANE_Word *) value;
922 strcpy (lexmark_device->val[option].s, value);
923 calc_parameters (lexmark_device);
930 if (w == lexmark_device->val[OPT_MANUAL_GAIN].w)
933 lexmark_device->val[OPT_MANUAL_GAIN].w = w;
934 calc_parameters (lexmark_device);
961 *(SANE_Word *) value = lexmark_device->val[option].w;
963 lexmark_device->opt[option].name);
966 *(SANE_Fixed *) value = lexmark_device->val[option].w;
970 strcpy (value, lexmark_device->val[option].s);
989 Lexmark_Device *lexmark_device;
1000 for (lexmark_device = first_lexmark_device; lexmark_device;
1001 lexmark_device = lexmark_device->next)
1003 if (lexmark_device == handle)
1007 if (!lexmark_device)
1010 yres = lexmark_device->val[OPT_RESOLUTION].w;
1021 if (strcmp (lexmark_device->val[OPT_MODE].s, SANE_VALUE_SCAN_MODE_COLOR)
1030 lexmark_device->val[OPT_BR_X].w - lexmark_device->val[OPT_TL_X].w;
1032 lexmark_device->val[OPT_BR_Y].w - lexmark_device->val[OPT_TL_Y].w;
1034 lexmark_device->val[OPT_TL_X].w, lexmark_device->val[OPT_TL_Y].w,
1035 lexmark_device->val[OPT_BR_X].w, lexmark_device->val[OPT_BR_Y].w);
1041 if (strcmp (lexmark_device->val[OPT_MODE].s, SANE_VALUE_SCAN_MODE_LINEART)
1047 device_params = &(lexmark_device->params);
1062 lexmark_device->data_size =
1076 lexmark_device->data_size);
1110 Lexmark_Device *lexmark_device;
1120 for (lexmark_device = first_lexmark_device; lexmark_device;
1121 lexmark_device = lexmark_device->next)
1123 if (lexmark_device == handle)
1129 if ((lexmark_device->params.lines == 0) ||
1130 (lexmark_device->params.pixels_per_line == 0) ||
1131 (lexmark_device->params.bytes_per_line == 0))
1140 lexmark_device->device_cancelled = SANE_FALSE;
1141 lexmark_device->data_ctr = 0;
1142 lexmark_device->eof = SANE_FALSE;
1147 lexmark_device->cancel_ctr = 0;
1150 if (sanei_lexmark_low_search_home_fwd (lexmark_device))
1158 sanei_lexmark_low_move_fwd (0x01a8, lexmark_device,
1159 lexmark_device->shadow_regs);
1162 sanei_lexmark_low_search_home_bwd (lexmark_device);
1165 resolution = lexmark_device->val[OPT_RESOLUTION].w;
1172 sanei_lexmark_low_set_scan_regs (lexmark_device, resolution, 0, SANE_FALSE);
1173 status = sanei_lexmark_low_calibration (lexmark_device);
1186 offset = sanei_lexmark_low_find_start_line (lexmark_device);
1192 sanei_lexmark_low_set_scan_regs (lexmark_device,
1193 lexmark_device->val[OPT_RESOLUTION].w,
1196 if (sanei_lexmark_low_start_scan (lexmark_device) == SANE_STATUS_GOOD)
1203 lexmark_device->device_cancelled = SANE_TRUE;
1213 Lexmark_Device *lexmark_device;
1225 for (lexmark_device = first_lexmark_device; lexmark_device;
1226 lexmark_device = lexmark_device->next)
1228 if (lexmark_device == handle)
1232 if (lexmark_device->device_cancelled)
1236 sanei_lexmark_low_search_home_bwd (lexmark_device);
1248 if (lexmark_device->eof)
1258 lexmark_device);
1266 lexmark_device->data_ctr += bytes_read;
1275 Lexmark_Device *lexmark_device;
1283 for (lexmark_device = first_lexmark_device; lexmark_device;
1284 lexmark_device = lexmark_device->next)
1286 if (lexmark_device == handle)
1291 if (++lexmark_device->cancel_ctr > 1)
1295 lexmark_device->device_cancelled = SANE_TRUE;
1303 Lexmark_Device *lexmark_device;
1311 for (lexmark_device = first_lexmark_device; lexmark_device;
1312 lexmark_device = lexmark_device->next)
1314 if (lexmark_device == handle)
1327 Lexmark_Device *lexmark_device;
1335 for (lexmark_device = first_lexmark_device; lexmark_device;
1336 lexmark_device = lexmark_device->next)
1338 if (lexmark_device == handle)