ZBar Bar Code Reader Library  version 0.10
zbargtk.c File Reference
Include dependency graph for zbargtk.c:

Macros

#define DEFAULT_HEIGHT
 
#define DEFAULT_WIDTH
 
#define fourcc(a, b, c, d)
 
#define G_PARAM_STATIC_STRINGS
 

Enumerations

enum  {
  DECODED,
  DECODED_TEXT,
  LAST_SIGNAL
}
 
enum  {
  PROP_0,
  PROP_VIDEO_DEVICE,
  PROP_VIDEO_ENABLED,
  PROP_VIDEO_OPENED
}
 

Functions

static void zbar_gtk_class_init (ZBarGtkClass *klass)
 
static void zbar_gtk_dispose (GObject *object)
 
static gboolean zbar_gtk_expose (GtkWidget *widget, GdkEventExpose *event)
 
static void zbar_gtk_get_property (GObject *object, guint prop_id, GValue *value, GParamSpec *pspec)
 
GType zbar_gtk_get_type (void)
 
const char * zbar_gtk_get_video_device (ZBarGtk *self)
 retrieve the currently opened video device. More...
 
gboolean zbar_gtk_get_video_enabled (ZBarGtk *self)
 retrieve the current video enabled state. More...
 
gboolean zbar_gtk_get_video_opened (ZBarGtk *self)
 retrieve the current video opened state. More...
 
gboolean zbar_gtk_image_from_pixbuf (zbar_image_t *zimg, GdkPixbuf *pixbuf)
 utility function to populate a zbar_image_t from a GdkPixbuf. More...
 
static void zbar_gtk_init (ZBarGtk *self)
 
GtkWidget * zbar_gtk_new (void)
 zbar_gtk_new: create a new barcode reader widget instance. More...
 
static GValue * zbar_gtk_new_value (GType type)
 
static void zbar_gtk_private_class_init (ZBarGtkPrivateClass *klass)
 
static void zbar_gtk_private_finalize (GObject *object)
 
static GType zbar_gtk_private_get_type (void)
 
static int zbar_gtk_process_image (ZBarGtk *self, zbar_image_t *image)
 
static voidzbar_gtk_processing_thread (void *arg)
 
static void zbar_gtk_realize (GtkWidget *widget)
 
void zbar_gtk_release_pixbuf (zbar_image_t *img)
 
void zbar_gtk_scan_image (ZBarGtk *self, GdkPixbuf *img)
 zbar_gtk_scan_image: More...
 
static void zbar_gtk_set_property (GObject *object, guint prop_id, const GValue *value, GParamSpec *pspec)
 
void zbar_gtk_set_video_device (ZBarGtk *self, const char *video_device)
 open a new video device. More...
 
void zbar_gtk_set_video_enabled (ZBarGtk *self, gboolean video_enabled)
 enable/disable video scanning. More...
 
static void zbar_gtk_size_allocate (GtkWidget *widget, GtkAllocation *allocation)
 
static void zbar_gtk_size_request (GtkWidget *widget, GtkRequisition *requisition)
 
static void zbar_gtk_unrealize (GtkWidget *widget)
 
static gboolean zbar_gtk_video_open (ZBarGtk *self, const char *video_device)
 

Variables

static gpointer zbar_gtk_parent_class
 
static guint zbar_gtk_signals [LAST_SIGNAL]
 

Macro Definition Documentation

#define DEFAULT_HEIGHT
#define DEFAULT_WIDTH
#define G_PARAM_STATIC_STRINGS

Referenced by zbar_gtk_class_init().

Enumeration Type Documentation

anonymous enum
Enumerator
DECODED 
DECODED_TEXT 
LAST_SIGNAL 
anonymous enum
Enumerator
PROP_0 
PROP_VIDEO_DEVICE 
PROP_VIDEO_ENABLED 
PROP_VIDEO_OPENED 

Function Documentation

static void zbar_gtk_dispose ( GObject *  object)
static

References _ZBarGtkPrivate::queue, _ZBarGtkPrivate::thread, _ZBarGtkPrivate::video_device, ZBAR_GTK, zbar_gtk_new_value(), and ZBAR_GTK_PRIVATE.

Referenced by zbar_gtk_class_init().

Here is the call graph for this function:

Here is the caller graph for this function:

static gboolean zbar_gtk_expose ( GtkWidget *  widget,
GdkEventExpose *  event 
)
static

References _ZBarGtkPrivate::window, ZBAR_GTK, ZBAR_GTK_PRIVATE, and zbar_window_redraw().

Referenced by zbar_gtk_class_init().

Here is the call graph for this function:

Here is the caller graph for this function:

static void zbar_gtk_get_property ( GObject *  object,
guint  prop_id,
GValue *  value,
GParamSpec *  pspec 
)
static
GType zbar_gtk_get_type ( void  )

References test_pygtk::info, zbar_gtk_class_init(), and zbar_gtk_init().

Here is the call graph for this function:

const char* zbar_gtk_get_video_device ( ZBarGtk zbar)

retrieve the currently opened video device.

Returns: the current video device or NULL if no device is opened

References _ZBarGtkPrivate::video_device, and ZBAR_GTK_PRIVATE.

gboolean zbar_gtk_get_video_enabled ( ZBarGtk zbar)

retrieve the current video enabled state.

Returns: true if video scanning is currently enabled, false otherwise

References _ZBarGtkPrivate::video_enabled, and ZBAR_GTK_PRIVATE.

Referenced by status_button_toggled(), video_enabled(), and video_opened().

Here is the caller graph for this function:

gboolean zbar_gtk_get_video_opened ( ZBarGtk zbar)

retrieve the current video opened state.

Returns: true if video device is currently opened, false otherwise

References _ZBarGtkPrivate::video_opened, and ZBAR_GTK_PRIVATE.

Referenced by status_button_toggled(), video_enabled(), and video_opened().

Here is the caller graph for this function:

gboolean zbar_gtk_image_from_pixbuf ( zbar_image_t *  image,
GdkPixbuf *  pixbuf 
)

utility function to populate a zbar_image_t from a GdkPixbuf.

the zbar library image destination to populate : the GdkPixbuf source

Returns: TRUE if successful or FALSE if the conversion could not be performed for some reason

References fourcc, scan_image::height, scan_image::width, zbar_gtk_release_pixbuf(), zbar_image_set_data(), zbar_image_set_format(), zbar_image_set_size(), and zbar_image_set_userdata().

Referenced by zbar_gtk_processing_thread().

Here is the call graph for this function:

Here is the caller graph for this function:

static void zbar_gtk_init ( ZBarGtk self)
static
GtkWidget* zbar_gtk_new ( void  )

zbar_gtk_new: create a new barcode reader widget instance.

initially has no associated video device or image.

Returns: a new ZBarGtk widget instance

References ZBAR_TYPE_GTK.

Referenced by main().

Here is the caller graph for this function:

static GValue* zbar_gtk_new_value ( GType  type)
inlinestatic
static void zbar_gtk_private_class_init ( ZBarGtkPrivateClass klass)
static

References zbar_gtk_private_finalize().

Referenced by zbar_gtk_private_get_type().

Here is the call graph for this function:

Here is the caller graph for this function:

static void zbar_gtk_private_finalize ( GObject *  object)
static
static GType zbar_gtk_private_get_type ( void  )
static

References test_pygtk::info, and zbar_gtk_private_class_init().

Here is the call graph for this function:

static void zbar_gtk_realize ( GtkWidget *  widget)
static

References _ZBarGtkPrivate::window, ZBAR_GTK, ZBAR_GTK_PRIVATE, zbar_window_attach(), and zbar::zbar_window_error_spew().

Referenced by zbar_gtk_class_init().

Here is the call graph for this function:

Here is the caller graph for this function:

void zbar_gtk_release_pixbuf ( zbar_image_t *  img)

References zbar_image_get_userdata(), and zbar_image_set_userdata().

Referenced by zbar_gtk_image_from_pixbuf().

Here is the call graph for this function:

Here is the caller graph for this function:

void zbar_gtk_scan_image ( ZBarGtk zbar,
GdkPixbuf *  image 
)

zbar_gtk_scan_image:

References _ZBarGtkPrivate::queue, zbar_gtk_new_value(), and ZBAR_GTK_PRIVATE.

Referenced by open_button_clicked().

Here is the call graph for this function:

Here is the caller graph for this function:

static void zbar_gtk_set_property ( GObject *  object,
guint  prop_id,
const GValue *  value,
GParamSpec *  pspec 
)
static

References PROP_VIDEO_DEVICE, PROP_VIDEO_ENABLED, ZBAR_GTK, zbar_gtk_set_video_device(), and zbar_gtk_set_video_enabled().

Referenced by zbar_gtk_class_init().

Here is the call graph for this function:

Here is the caller graph for this function:

void zbar_gtk_set_video_device ( ZBarGtk zbar,
const char *  video_device 
)

open a new video device.

: the platform specific name of the device to open. use NULL to close a currently opened device.

Note
since opening a device may take some time, this call will return immediately and the device will be opened asynchronously

References _ZBarGtkPrivate::queue, _ZBarGtkPrivate::video_device, _ZBarGtkPrivate::video_enabled, zbar_gtk_new_value(), and ZBAR_GTK_PRIVATE.

Referenced by video_changed(), and zbar_gtk_set_property().

Here is the call graph for this function:

Here is the caller graph for this function:

void zbar_gtk_set_video_enabled ( ZBarGtk zbar,
gboolean  video_enabled 
)

enable/disable video scanning.

: true to enable video scanning, false to disable

has no effect unless a video device is opened

References _ZBarGtkPrivate::queue, _ZBarGtkPrivate::video_enabled, video_enabled(), zbar_gtk_new_value(), and ZBAR_GTK_PRIVATE.

Referenced by status_button_toggled(), and zbar_gtk_set_property().

Here is the call graph for this function:

Here is the caller graph for this function:

static void zbar_gtk_size_allocate ( GtkWidget *  widget,
GtkAllocation *  allocation 
)
static

References _ZBarGtkPrivate::window, ZBAR_GTK, zbar_gtk_parent_class, ZBAR_GTK_PRIVATE, and zbar_window_resize().

Referenced by zbar_gtk_class_init().

Here is the call graph for this function:

Here is the caller graph for this function:

static void zbar_gtk_size_request ( GtkWidget *  widget,
GtkRequisition *  requisition 
)
static

References _ZBarGtkPrivate::req_height, _ZBarGtkPrivate::req_width, ZBAR_GTK, and ZBAR_GTK_PRIVATE.

Referenced by zbar_gtk_class_init().

Here is the caller graph for this function:

static void zbar_gtk_unrealize ( GtkWidget *  widget)
static

References _ZBarGtkPrivate::queue, _ZBarGtkPrivate::video_enabled, _ZBarGtkPrivate::window, ZBAR_GTK, zbar_gtk_new_value(), ZBAR_GTK_PRIVATE, and zbar_window_attach().

Referenced by zbar_gtk_class_init().

Here is the call graph for this function:

Here is the caller graph for this function:

Variable Documentation

gpointer zbar_gtk_parent_class
static
guint zbar_gtk_signals[LAST_SIGNAL]
static