Module gtkimageview
[frames] | no frames]

Module gtkimageview

This is the API reference for PyGtkImageView which is a set of Python bindings for the GTK+ widget GtkImageView.

The latest releases of both these bindings and GtkImageView itself can always be found at http://trac.bjourne.webfactional.com.

PyGtkImageView contains a simple but full-featured image viewer widget similar to the image viewer panes in gThumb or Eye of GNOME. The main class in the module is ImageView.

Documentation

This API documentation can be found in the ./docs directory. HTML and PDF documentation is generated by the bash script makedocs.sh. To build the documentation, you need to have the following tools installed:

Then just run the script:

$ ./makedocs.sh

The source for the documentation is found in the ./docs/gtkimageview.py file.

Keep in mind that this documentation is not built from the library source. This is because while epydoc does support generating documentation from extension modules, the result is generally very poor (GTK+ and PyGTK is partially to blame for that).

Epydoc has no support for extracting documentation for signals, which is why signals are here documented as methods prefixed with sig_*. For example, the description for the signal "pixbuf-changed" is found in the method description ImageView.sig_pixbuf_changed.

The examples should make it clear how these signals are supposed to be used.

For that reason, epydoc cannot automatically discern which GTK+ classes GtkImageView's classes subclass. Instead, see the class descriptions for inheritance information.

Release history

Major changes between version of PyGtkImageView. For a complete history, also see the Release history document in GtkImageView.

Major changes in 1.2.0

Major changes in 1.1.0

Major changes in 1.0.0

None! First release. :)


Author: Björn Lindqvist

Requires: Python 2.2+, GtkImageView, PyGTK

Version: 1.2.0

License: LGPL

Copyright: © 2007-2009 Björn Lindqvist

To Do:
Classes
  PixbufDrawOpts
Container class which holds options for how the pixbuf should be drawn.
  PixbufDrawCache
Cache that ensures fast redraws by storing the last draw operation.
  IImageTool
IImageTool is an interface that defines how ImageView interacts with objects that acts as tools.
  ImageToolDragger
ImageToolDragger is the default image tool for ImageView.
  ImageToolSelector
ImageToolSelector is a tool for selecting areas of an image.
  ImageNav
ImageNav is a popup window that shows a downscaled preview of the pixbuf that ImageView is showing.
  ImageScrollWin
Provides a widget similar in appearance to gtk.ScrollableWindow that is more suitable for displaying ImageView's.
  ImageView
ImageView is a full-featured general purpose image viewer widget for GTK.
  AnimView
AnimView subclasses ImageView.
Functions
 
library_version()
Returns a string with the format "major.minor.micro" which denotes the runtime version of GtkImageView being used.
 
zooms_get_zoom_in(zoom)
Returns the zoom factor that is one step larger than the supplied zoom factor.
 
zooms_get_zoom_out(zoom)
Returns the zoom factor that is one step smaller than the supplied zoom factor.
 
zooms_get_min_zoom()
Returns the minimum allowed zoom factor.
 
zooms_get_max_zoom()
Returns the maximum allowed zoom factor.
 
zooms_clamp_zoom(zoom)
Returns the zoom factor clamped to the minimum and maximum allowed value.
Variables
  TRANSP_COLOR = 1
  TRANSP_GRID = 2
  TRANSP_BACKGROUND = 3
  DRAW_METHOD_SCALE = 0
  DRAW_METHOD_CONTAINS = 1
  DRAW_METHOD_SCROLL = 2
Function Details

library_version()

 

Returns a string with the format "major.minor.micro" which denotes the runtime version of GtkImageView being used. Note that this is the version of the underlying C library, to retrieve the version of the Python bindings use gtkimageview.__version__.

>>> gtkimageview.library_version()
'1.5.0'

zooms_get_zoom_in(zoom)

 
Returns the zoom factor that is one step larger than the supplied zoom factor.
Parameters:
  • zoom - a zoom factor
Returns:
a zoom factor that is one step larger than the supplied one

zooms_get_zoom_out(zoom)

 
Returns the zoom factor that is one step smaller than the supplied zoom factor.
Parameters:
  • zoom - a zoom factor
Returns:
a zoom factor that is one step smaller than the supplied one

zooms_get_min_zoom()

 
Returns the minimum allowed zoom factor.
Returns:
the minimal zoom factor

zooms_get_max_zoom()

 
Returns the maximum allowed zoom factor.
Returns:
the maximal zoom factor

zooms_clamp_zoom(zoom)

 
Returns the zoom factor clamped to the minimum and maximum allowed value.
Parameters:
  • zoom - a zoom factor
Returns:
the zoom factor clamped to the interval [min, max]