3
‰å<_Â: ã @ sì d dl Z d dlZddlmZ ddlmZmZmZmZm Z m
Z
mZmZm
Z
mZmZmZmZmZmZmZmZmZmZmZmZmZmZmZ ejZejZejZej Z ej!Z!ej"Z"ej#Z#ej$Z$e j%d
krÈe&Z'e(Z)ne*Z'e+Z)G dd„ de,ƒZ-dd „ Z.dS )é Né )Ú_gi)Ú TYPE_NONEÚTYPE_INTERFACEÚ TYPE_CHARÚ
TYPE_UCHARÚTYPE_BOOLEANÚTYPE_INTÚ TYPE_UINTÚ TYPE_LONGÚ
TYPE_ULONGÚ
TYPE_INT64ÚTYPE_UINT64Ú TYPE_ENUMÚ
TYPE_FLAGSÚ
TYPE_FLOATÚTYPE_DOUBLEÚTYPE_STRINGÚTYPE_POINTERÚ
TYPE_BOXEDÚ
TYPE_PARAMÚTYPE_OBJECTÚ
TYPE_PYOBJECTÚ
TYPE_GTYPEÚ TYPE_STRVÚTYPE_VARIANTé c @ sN e Zd ZdZeeeeee e
eee
eeiZedededee ee eeeeed/iZeeeeed1ed3eeeeeeeeiZedededededede
dededi Z G d d
„ d
e!ƒZ"dddddde#j$ddf dd
„Z%dd„ Z&dd„ Z'dd„ Z(dd„ Z)dd„ Z*dd„ Z+dd„ Z,dd„ Z-dd„ Z.d d!„ Z/d"d#„ Z0d$d%„ Z1d&d'„ Z2d(d)„ Z3d*d+„ Z4d,d-„ Z5dS )4ÚPropertyaÄ Creates a new Property which when used in conjunction with
GObject subclass will create a Python property accessor for the
GObject ParamSpec.
:param callable getter:
getter to get the value of the property
:param callable setter:
setter to set the value of the property
:param type type:
type of property
:param default:
default value, must match the property type.
:param str nick:
short description
:param str blurb:
long description
:param GObject.ParamFlags flags:
parameter flags
:keyword minimum:
minimum allowed value (int, float, long only)
:keyword maximum:
maximum allowed value (int, float, long only)
.. code-block:: python
class MyObject(GObject.Object):
prop = GObject.Property(type=str)
obj = MyObject()
obj.prop = 'value'
obj.prop # now is 'value'
The API is similar to the builtin :py:func:`property`:
.. code-block:: python
class AnotherObject(GObject.Object):
value = 0
@GObject.Property
def prop(self):
'Read only property.'
return 1
@GObject.Property(type=int)
def propInt(self):
'Read-write integer property.'
return self.value
@propInt.setter
def propInt(self, value):
self.value = value
r é é? r é@ Ú g c @ s e Zd Zdd„ ZdS )zProperty.__metaclass__c C s dS )Nz