Lines Matching refs:option
12 License, or (at your option) any later version.
657 sane_get_option_descriptor (SANE_Handle handle, SANE_Int option)
663 DBG (4, "sane_get_option_descriptor: handle=%p, option = %d\n",
664 (void *) handle, option);
665 if (option < 0 || option >= num_options)
667 DBG (3, "sane_get_option_descriptor: option < 0 || "
668 "option > num_options\n");
672 return &chndl->opt[option];
676 sane_control_option (SANE_Handle handle, SANE_Int option, SANE_Action action,
686 (void *) handle, option, action, (void *) value, (void *) info);
688 if (option < 0 || option >= num_options)
690 DBG (1, "sane_control_option: option < 0 || option > num_options\n");
694 if (!SANE_OPTION_IS_ACTIVE (chndl->opt[option].cap))
696 DBG (1, "sane_control_option: option is inactive\n");
700 if (chndl->opt[option].type == SANE_TYPE_GROUP)
702 DBG (1, "sane_control_option: option is a group\n");
709 if (!SANE_OPTION_IS_SETTABLE (chndl->opt[option].cap))
711 DBG (1, "sane_control_option: option is not setable\n");
714 status = sanei_constrain_value (&chndl->opt[option], value, &myinfo);
721 switch (option)
727 if (chndl->val[option].w == *(SANE_Fixed *) value)
729 DBG (4, "sane_control_option: option %d (%s) not changed\n",
730 option, chndl->opt[option].name);
733 chndl->val[option].w = *(SANE_Fixed *) value;
735 DBG (4, "sane_control_option: set option %d (%s) to %.0f %s\n",
736 option, chndl->opt[option].name,
738 chndl->opt[option].unit == SANE_UNIT_MM ? "mm" : "dpi");
741 if (chndl->val[option].w == *(SANE_Bool *) value)
743 DBG (4, "sane_control_option: option %d (%s) not changed\n",
744 option, chndl->opt[option].name);
747 chndl->val[option].w = *(SANE_Bool *) value;
748 DBG (4, "sane_control_option: set option %d (%s) to %s\n",
749 option, chndl->opt[option].name,
754 if (chndl->val[option].w == *(SANE_Int *) value)
756 DBG (4, "sane_control_option: option %d (%s) not changed\n",
757 option, chndl->opt[option].name);
760 chndl->val[option].w = *(SANE_Int *) value;
763 DBG (4, "sane_control_option: set option %d (%s) to %d\n",
764 option, chndl->opt[option].name, *(SANE_Int *) value);
767 if (strcmp (chndl->val[option].s, value) == 0)
769 DBG (4, "sane_control_option: option %d (%s) not changed\n",
770 option, chndl->opt[option].name);
773 strcpy (chndl->val[option].s, (SANE_String) value);
775 if (strcmp (chndl->val[option].s, SANE_VALUE_SCAN_MODE_LINEART) ==
781 if (strcmp (chndl->val[option].s, SANE_VALUE_SCAN_MODE_COLOR) == 0)
786 if (strcmp (chndl->val[option].s, SANE_VALUE_SCAN_MODE_GRAY) == 0)
795 DBG (4, "sane_control_option: set option %d (%s) to %s\n",
796 option, chndl->opt[option].name, (SANE_String) value);
799 DBG (1, "sane_control_option: trying to set unexpected option\n");
805 switch (option)
809 DBG (4, "sane_control_option: get option 0, value = %d\n",
817 *(SANE_Fixed *) value = chndl->val[option].w;
819 "sane_control_option: get option %d (%s), value=%.1f %s\n",
820 option, chndl->opt[option].name,
822 chndl->opt[option].unit == SANE_UNIT_MM ? "mm" :
823 (chndl->opt[option].unit == SANE_UNIT_DPI ? "dpi" : ""));
827 *(SANE_Bool *) value = chndl->val[option].w;
829 "sane_control_option: get option %d (%s), value=%s\n",
830 option, chndl->opt[option].name,
834 strcpy (value, chndl->val[option].s);
835 DBG (4, "sane_control_option: get option %d (%s), value=`%s'\n",
836 option, chndl->opt[option].name, (SANE_String) value);
840 *(SANE_Int *) value = chndl->val[option].w;
841 DBG (4, "sane_control_option: get option %d (%s), value=%d\n",
842 option, chndl->opt[option].name, *(SANE_Int *) value);
845 DBG (1, "sane_control_option: trying to get unexpected option\n");