Public Member Functions | Static Public Member Functions | Protected Member Functions | Properties | Events

GtkZBar.Scanner Class Reference

Bar code scanner widget. More...

List of all members.

Public Member Functions

void Open (string device)
 Open a video device.
void Close ()
void ResetLastItemScanned ()
 Resets the last item scanned.

Static Public Member Functions

static IDictionary< string,
string > 
ListVideoSources ()
 List potential video sources on the system.

Protected Member Functions

override bool OnExposeEvent (Gdk.EventExpose ev)
override void OnSizeAllocated (Gdk.Rectangle allocation)
override void OnSizeRequested (ref Gtk.Requisition requisition)

Properties

bool Mute [get, set]
bool Flip [get, set]
bool Rotate [get, set]

Events

EventHandler Stopped
 Occurs if an error occured during runtime and the video device stopped.
EventHandler< ErrorEventArgsError
 Occurs if an error happens and user should be informed about this.
EventHandler< BarScannedArgsBarScanned
 Occurs whenever a bar code have been successfully scanned.

Detailed Description

Bar code scanner widget.

This widget uses a thread to pull the video device, so it is important to destroy it correctly.

Definition at line 23 of file Scanner.cs.


Member Function Documentation

static IDictionary<string, string> GtkZBar.Scanner.ListVideoSources (  )  [static]

List potential video sources on the system.

Make the image smaller, default 1

If the camera is facing down media will look the same on screen

This just adds a default device without checking it's existance on Windows. On Linux this list all /dev/video* devices, and attempts to get their name using /lib/udev/v4l_id, watch the kernel source (link available in source comments) to that this remains compatible.

Alternately, define UDEV_RULES and the "/dev/v4l/by-id/" symlinks will be used to find the names. Note this presumably depends on Ubuntu 9.10 udev rules. Thus the other approach is preffered.

Note that on Linux this might be solve a lot better using HAL over dbus, however, last I checked HAL is being replaced by DeviceKit which isn't done yet, so unless the APIs are expected to remain stable HAL is a waste of time.

Returns:
A IDictionary of Name and device

Definition at line 454 of file Scanner.cs.

void GtkZBar.Scanner.Open ( string  device  ) 

Open a video device.

Parameters:
device Video device to open

Definition at line 58 of file Scanner.cs.

void GtkZBar.Scanner.ResetLastItemScanned (  ) 

Resets the last item scanned.

This method may only be called from UI-thread.

Definition at line 282 of file Scanner.cs.


Property Documentation

bool GtkZBar.Scanner.Flip [get, set]

Flip the image vertically, default false

Our studies have shown that it is a lot easier to scan bar codes when the webcam is facing you if the image is flipped.

Definition at line 416 of file Scanner.cs.

bool GtkZBar.Scanner.Mute [get, set]

Mute

Definition at line 407 of file Scanner.cs.

bool GtkZBar.Scanner.Rotate [get, set]

Rotate the image my 180 degrees, default false

If the camera is facing down media will look the same on screen

Definition at line 424 of file Scanner.cs.


Event Documentation

EventHandler<BarScannedArgs> GtkZBar.Scanner.BarScanned

Occurs whenever a bar code have been successfully scanned.

Usually hardware related issues, as this is stuff the user must handle.

Definition at line 270 of file Scanner.cs.

EventHandler<ErrorEventArgs> GtkZBar.Scanner.Error

Occurs if an error happens and user should be informed about this.

Definition at line 264 of file Scanner.cs.

EventHandler GtkZBar.Scanner.Stopped

Occurs if an error occured during runtime and the video device stopped.

Definition at line 259 of file Scanner.cs.


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