next up previous contents index
次へ: Option Value Constraints 上へ: Option Descriptor Type 戻る: Option Value Size   目次   索引

Option Capabilities

Member cap describes what capabilities the option posseses. This is a bitset that is formed as the inclusive logical OR of the capabilities described in Table 4.5. The SANE API provides the following to macros to test certain features of a given capability bitset:

SANE_OPTION_IS_ACTIVE(cap):
This macro returns SANE_TRUE if and only if the option with the capability set cap is currently active.

SANE_OPTION_IS_SETTABLE(cap):
This macro returns SANE_TRUE if and only if the option with the capability set cap is software settable.


表 4.5: Option Capabilities
Symbol Code Description
SANE_CAP_SOFT_SELECT 1 The option value can be set by a call to sane_control_option().
SANE_CAP_HARD_SELECT 2 The option value can be set by user-intervention (e.g., by flipping a switch). The user-interface should prompt the user to execute the appropriate action to set such an option. This capability is mutually exclusive with SANE_CAP_SOFT_SELECT (either one of them can be set, but not both simultaneously).
SANE_CAP_SOFT_DETECT 4 The option value can be detected by software. If SANE_CAP_SOFT_SELECT is set, this capability must be set. If SANE_CAP_HARD_SELECT is set, this capability may or may not be set. If this capability is set but neither SANE_CAP_SOFT_SELECT nor SANE_CAP_HARD_SELECT are, then there is no way to control the option. That is, the option provides read-out of the current value only.
SANE_CAP_EMULATED 8 If set, this capability indicates that an option is not directly supported by the device and is instead emulated in the backend. A sophisticated frontend may elect to use its own (presumably better) emulation in lieu of an emulated option.
SANE_CAP_AUTOMATIC 16 If set, this capability indicates that the backend (or the device) is capable to picking a reasonable option value automatically. For such options, it is possible to select automatic operation by calling sane_control_option() with an action value of SANE_ACTION_SET_AUTO.
SANE_CAP_INACTIVE 32 If set, this capability indicates that the option is not currently active (e.g., because it's meaningful only if another option is set to some other value).
SANE_CAP_ADVANCED 64 If set, this capability indicates that the option should be considered an ``advanced user option.'' A frontend typically displays such options in a less conspicuous way than regular options (e.g., a command line interface may list such options last or a graphical interface may make them available in a seperate ``advanced settings'' dialog).



next up previous contents index
次へ: Option Value Constraints 上へ: Option Descriptor Type 戻る: Option Value Size   目次   索引
MATSUBAYASHI 'Shaolin' Kohji 平成14年10月29日