Package kiwi :: Module utils
[frames | no frames]

Module kiwi.utils

GObject utilities and addons
Classes
PropertyMeta Metaclass that takes into account properties and signals of baseclasses, even if they're not GObject subclasses.
PropertyObject I am an object which maps GObject properties to attributes To be able to use me, you must also inherit from a gobject.GObject subclass.

Function Summary
  gproperty(name, ptype, default, nick, blurb, flags, **kwargs)
Add a GObject property to the current object.
  gsignal(name, *args, **kwargs)
Add a GObject signal to the current object.
  list_properties(gtype, parent)
Return a list of all properties for GType gtype, excluding properties in parent classes
  type_register(gtype)
Register the type, but only if it's not already registered

Variable Summary
bool HAVE_2_6 = False

Function Details

gproperty(name, ptype, default=None, nick='', blurb='', flags=3, **kwargs)

Add a GObject property to the current object.
Parameters:
name - name of property
           (type=string)
ptype - type of property
           (type=type)
default - default value
nick - short description
blurb - long description
flags - parameter flags, one of:
  • PARAM_READABLE
  • PARAM_READWRITE
  • PARAM_WRITABLE
  • PARAM_CONSTRUCT
  • PARAM_CONSTRUCT_ONLY
  • PARAM_LAX_VALIDATION
Optional, only for int, float, long types:
Keyword Parameters:
minimum - minimum allowed value
maximum - maximum allowed value

gsignal(name, *args, **kwargs)

Add a GObject signal to the current object. It current supports the following types:
  • str, int, float, long, object, enum
Parameters:
name - name of the signal
           (type=string)
args - types for signal parameters, if the first one is a string 'override', the signal will be overridden and must therefor exists in the parent GObject.
Keyword Parameters:
flags - One of the following:
  • gobject.SIGNAL_RUN_FIRST
  • gobject.SIGNAL_RUN_LAST
  • gobject.SIGNAL_RUN_CLEANUP
  • gobject.SIGNAL_NO_RECURSE
  • gobject.SIGNAL_DETAILED
  • gobject.SIGNAL_ACTION
  • gobject.SIGNAL_NO_HOOKS
retval - return value in signal callback

list_properties(gtype, parent=True)

Return a list of all properties for GType gtype, excluding properties in parent classes

type_register(gtype)

Register the type, but only if it's not already registered
Parameters:
gtype - the class to register

Variable Details

HAVE_2_6

Type:
bool
Value:
False                                                                  

Generated by Epydoc 2.1 on Thu Oct 19 03:18:13 2006 http://epydoc.sf.net