LibInsane: lis_item Struct Reference

| LibInsane 1.0.10 Cross-platform Cross-API Cross-driver Cross-image-scanner Image Scan Library

Loading...
Searching...
No Matches
Data Fields
lis_item Struct Reference

`#include <capi.h>`

## Data Fields
const char * | name
enum lis_item_type | type
enum lis_error(* | get_children )(struct lis_item *self, struct lis_item ***children)
| Get item's children (usually scan sources).
enum lis_error(* | get_options )(struct lis_item *self, struct lis_option_descriptor ***descs)
| Get item's options.
enum lis_error(* | scan_start )(struct lis_item *self, struct lis_scan_session **session)
| Starts a scan session.
void(* | close )(struct lis_item *self)
| Close the access to a scanner.

## Detailed Description

Represents either a device (a scanner, a scanner-printer, etc) or a sub-device (Flatbed of a scanner, Automatic document feeder of a printer, etc).

Similar to a WIAItem in WIA API.

Definition at line 355 of file capi.h.

## Field Documentation

## ◆ close

void(* lis_item::close) (struct lis_item *self)

Close the access to a scanner.

Will free all the child items of this root item and all the option descriptors. No need to call this method on child items (will do nothing). Call it only on the root item.

Will also be done automatically if you call lis_api::cleanup(). (TODO(Jflesch): normalizer)

Definition at line 407 of file capi.h.

## ◆ get_children

enum lis_error(* lis_item::get_children) (struct lis_item *self, struct lis_item ***children)

Get item's children (usually scan sources).

Without workarounds or normalizers:

- Sane: will return an empty list.
- WIA: will return device sources (Flatbed, Automatic Document Feeder, etc).

Warning: When calling this method, previous child items obtained from the same item with this method may be invalidated/freed.

Parameters

  [in] | self | Usually a scanner (see lis_api::get_device()).
  [out] | children | Usually scanner sources. List will be NULL terminated.

Return values

  LIS_OK | children has been set to a valid array of items. See LIS_IS_OK.

Definition at line 357 of file capi.h.

## ◆ get_options

enum lis_error(* lis_item::get_options) (struct lis_item *self, struct lis_option_descriptor ***descs)

Get item's options.

Warning: When calling this method, previous option descriptors obtained from the same item with this method may be invalidated/freed !

Parameters

  [in] | self | Item from which we want the option list.
  [out] | descs | Option list. NULL terminated.

Return values

  LIS_OK | descs has been set.

Definition at line 357 of file capi.h.

## ◆ name

const char* lis_item::name

Item name

Definition at line 356 of file capi.h.

## ◆ scan_start

enum lis_error(* lis_item::scan_start) (struct lis_item *self, struct lis_scan_session **session)

Starts a scan session.

Warning
  This operation may take many seconds.

Parameters

  [in] | self | Item from which to scan.
  [out] | session | Scan session.

Return values

  LIS_OK | Scan of the first page has started.

Definition at line 357 of file capi.h.

## ◆ type

enum lis_item_type lis_item::type

Definition at line 357 of file capi.h.

The documentation for this struct was generated from the following file:

- /build/libinsane/src/libinsane/subprojects/libinsane/include/libinsane/capi.h