ZBar.Gtk

g Atk.ImplementorIface Atk.ImplementorIface Gtk.Widget Gtk.Widget Atk.ImplementorIface->Gtk.Widget GObject.GInterface GObject.GInterface GObject.GInterface->Atk.ImplementorIface Gtk.Buildable Gtk.Buildable GObject.GInterface->Gtk.Buildable GObject.InitiallyUnowned GObject.InitiallyUnowned GObject.InitiallyUnowned->Gtk.Widget GObject.Object GObject.Object GObject.Object->GObject.InitiallyUnowned Gtk.Buildable->Gtk.Widget ZBar.Gtk ZBar.Gtk Gtk.Widget->ZBar.Gtk

Subclasses:

None

Methods

Inherited:

Gtk.Widget (278), GObject.Object (37), Gtk.Buildable (10)

Structs:

Gtk.WidgetClass (12), GObject.ObjectClass (5)

class

image_from_pixbuf (image, pixbuf)

class

new ()

get_video_device ()

get_video_enabled ()

get_video_opened ()

request_video_size (width, height)

scan_image (image)

set_video_device (video_device)

set_video_enabled (video_enabled)

Virtual Methods

Inherited:

Gtk.Widget (82), GObject.Object (7), Gtk.Buildable (10)

do_decoded_text (text)

do_scan_image (image)

Properties

Inherited:

Gtk.Widget (39)

Name

Type

Flags

Short Description

video-device

str

r/w

the platform specific name of the video device

video-enabled

bool

r/w

controls streaming from the video device

video-opened

bool

r

current opened state of the video device

Style Properties

Inherited:

Gtk.Widget (17)

Signals

Inherited:

Gtk.Widget (69), GObject.Object (1)

Name

Short Description

decoded

emitted when a barcode is decoded from an image.

decoded-text

emitted when a barcode is decoded from an image.

Fields

Inherited:

Gtk.Widget (69), GObject.Object (1)

Name

Type

Access

Description

widget

Gtk.Widget

r

Class Details

class ZBar.Gtk(**kwargs)
Bases:

Gtk.Widget

Abstract:

No

Structure:

ZBar.GtkClass

classmethod image_from_pixbuf(image, pixbuf)
Parameters:
Returns:

True if successful or False if the conversion could not be performed for some reason

Return type:

bool

utility function to populate a zbar_image_t from a GdkPixbuf.Pixbuf.

classmethod new()
Returns:

a new ZBar.Gtk widget instance

Return type:

Gtk.Widget

create a new barcode reader widget instance. initially has no associated video device or image.

get_video_device()
Returns:

the current video device or None if no device is opened

Return type:

str

retrieve the currently opened video device.

get_video_enabled()
Returns:

true if video scanning is currently enabled, false otherwise

Return type:

bool

retrieve the current video enabled state.

get_video_opened()
Returns:

true if video device is currently opened, false otherwise

Return type:

bool

retrieve the current video opened state.

request_video_size(width, height)
Parameters:
  • width (int) – width in pixels

  • height (int) – height in pixels

set video camera resolution. note this call must be made before video is initialized

scan_image(image)
Parameters:

image (GdkPixbuf.Pixbuf) – the GdkPixbuf.Pixbuf used to store the image

set_video_device(video_device)
Parameters:

video_device (str or None) – the platform specific name of the device to open. use None to close a currently opened device.

open a new video device. note since opening a device may take some time, this call will return immediately and the device will be opened asynchronously

set_video_enabled(video_enabled)
Parameters:

video_enabled (bool) – true to enable video scanning, false to disable

enable/disable video scanning. has no effect unless a video device is opened

do_decoded_text(text) virtual
Parameters:

text (str) –

do_scan_image(image) virtual
Parameters:

image (GdkPixbuf.Pixbuf) – the GdkPixbuf.Pixbuf used to store the image

Signal Details

ZBar.Gtk.signals.decoded(gtk, symbol_type, data)
Signal Name:

decoded

Flags:

RUN_CLEANUP

Parameters:
  • gtk (ZBar.Gtk) – The object which received the signal

  • symbol_type (int) – the type of symbol decoded (a zbar_symbol_type_t)

  • data (str) – the data decoded from the symbol

emitted when a barcode is decoded from an image. the symbol type and contained data are provided as separate parameters

ZBar.Gtk.signals.decoded_text(gtk, text)
Signal Name:

decoded-text

Flags:

RUN_CLEANUP

Parameters:
  • gtk (ZBar.Gtk) – The object which received the signal

  • text (str) – the decoded data prefixed by the string name of the symbol type (separated by a colon)

emitted when a barcode is decoded from an image. the symbol type name is prefixed to the data, separated by a colon

Property Details

ZBar.Gtk.props.video_device
Name:

video-device

Type:

str

Default Value:

None

Flags:

READABLE, WRITABLE

the platform specific name of the video device

ZBar.Gtk.props.video_enabled
Name:

video-enabled

Type:

bool

Default Value:

False

Flags:

READABLE, WRITABLE

controls streaming from the video device

ZBar.Gtk.props.video_opened
Name:

video-opened

Type:

bool

Default Value:

False

Flags:

READABLE

current opened state of the video device