GOffice.GraphObject¶
| Subclasses: | GOffice.Graph3DBox,GOffice.GraphPlot,GOffice.GraphStyledObject | 
|---|
Methods¶
| Inherited: | GObject.Object (37) | 
|---|---|
| Structs: | GObject.ObjectClass (5) | 
Virtual Methods¶
| Inherited: | GObject.Object (7) | 
|---|
| do_changed(size) | |
| do_child_added(child) | |
| do_child_name_changed(child) | |
| do_child_removed(child) | |
| do_children_reordered() | |
| do_document_changed(doc) | |
| do_extra_signal1() | |
| do_extra_signal2() | |
| do_get_manual_size_mode() | |
| do_name_changed() | |
| do_parent_changed(was_set) | |
| do_populate_editor(editor, dalloc, cc) | |
| do_possible_additions_changed() | |
| do_reserved1() | |
| do_reserved2() | |
| do_type_name() | |
| do_update() | |
| do_update_editor() | 
Properties¶
| Name | Type | Flags | Short Description | 
|---|---|---|---|
| alignment | str | r/w | Alignment flag | 
| anchor | str | r/w | Anchor for manual position | 
| compass | str | r/w | Compass auto position flags | 
| id | int | r/w | Object numerical ID | 
| invisible | bool | r/w | Should the object be hidden | 
| is-position-manual | bool | r/w | Is position manual | 
| manual-size | str | r/w | Whether the height or width are manually set | 
| position | str | r/w | Position and size of object, in percentage of parent size | 
Signals¶
| Inherited: | GObject.Object (1) | 
|---|
| Name | Short Description | 
|---|---|
| changed | |
| child-added | The ::child-addedsignal is emitted AFTER the child has been added and AFTER the parent-changed signal has been called for it. | 
| child-name-changed | |
| child-removed | The ::child-removedsignal is emitted BEFORE the child has been added and BEFORE the parent-changed signal has been called for it. | 
| children-reordered | |
| name-changed | |
| update-editor | 
Fields¶
| Inherited: | GObject.Object (1) | 
|---|
| Name | Type | Access | Description | 
|---|---|---|---|
| auto_name | str | r | |
| base | GObject.Object | r | |
| being_updated | int | r | |
| children | [ object] | r | |
| explicitly_typed_role | int | r | |
| id | int | r | |
| invisible | int | r | |
| manual_position | GOffice.GraphViewAllocation | r | |
| needs_update | int | r | |
| parent | GOffice.GraphObject | r | |
| position | GOffice.GraphObjectPosition | r | |
| role | GOffice.GraphObjectRole | r | |
| user_name | str | r | 
Class Details¶
- 
class GOffice.GraphObject(**kwargs)¶
- Bases: - GObject.Object- Abstract: - Yes - Structure: - GOffice.GraphObjectClass- 
classmethod new_from_input(input, user_unserialize)¶
- Parameters: - Return type: 
 - 
classmethod register_roles(klass, roles, n_roles)¶
- Parameters: - klass (GOffice.GraphObjectClass) –GOffice.GraphObjectClass
- roles (GOffice.GraphObjectRole) –GOffice.GraphObjectRole
- n_roles (int) – number of roles
 
- klass (
 - 
classmethod sax_push_parser(xin, attrs, handler, user_unserialize, *user_data)¶
- Parameters: - xin (Gsf.XMLIn) –Gsf.XMLIn
- attrs (libxml2.Char) – XML attributes
- handler (GOffice.GraphObjectSaxHandler) – callback
- user_unserialize (objectorNone) – user data forGOffice.Datareading
- user_data (objectorNone) – user data for handler
 - Unserializes a - GOffice.GraphObjectusing handler when done.
- xin (
 - 
classmethod set_arg(name, val, obj)¶
- Parameters: - name (str) –
- val (str) –
- obj (GOffice.GraphObject) –
 
- name (
 - 
add_by_name(role, child)¶
- Parameters: - role (str) –
- child (GOffice.GraphObjectorNone) – optionally nullGOffice.GraphObject
 - Returns: - a newly created child of self in role. If child is provided, it is assumed to be an unaffiliated object that will be assigned in role. On failure return - None.- Return type: 
- role (
 - 
add_by_role(role, child)¶
- Parameters: - role (GOffice.GraphObjectRole) –GOffice.GraphObjectRole
- child (GOffice.GraphObjectorNone) –GOffice.GraphObject
 - Returns: - child or a newly created object with role. - Return type: - Absorb a ref to child if it is non- - None.
- role (
 - 
can_reorder(inc_ok, dec_ok)¶
- Parameters: - If self can move forward or backward in its parents child list 
 - 
clear_parent()¶
- Returns: - Trueon success.- Return type: - bool- Does _not_ unref the child, which in effect adds a ref by freeing up the ref previously associated with the parent. 
 - 
document_changed(doc)¶
- Parameters: - doc ( - GOffice.Doc) –
 - 
dup(new_parent, datadup)¶
- Parameters: - new_parent (GOffice.GraphObject) –GOffice.GraphObjectthe parent tree for the object (can beNone)
- datadup (GOffice.GraphDataDuplicator) – a function to duplicate the data (a default one is used ifNone)
 - Returns: - the duplicated object - Return type: - Create a deep copy of obj using new_parent as its parent. 
- new_parent (
 - 
find_role_by_name(role)¶
- Parameters: - role ( - str) –- Return type: - GOffice.GraphObjectRole
 - 
get_child_by_name(name)¶
- Parameters: - name ( - str) – a- strto use as a role name filter- Returns: - Noneand spews an error if there is more than one.- Return type: - GOffice.GraphObject- A convenience routine to find a unique child with role == name 
 - 
get_child_by_role(role)¶
- Parameters: - role ( - GOffice.GraphObjectRole) – a- GOffice.GraphObjectRoleto use as a filter- Returns: - Noneand spews an error if there is more than one.- Return type: - GOffice.GraphObject- A convenience routine to find a unique child with role. 
 - 
get_children(filter)¶
- Parameters: - filter ( - GOffice.GraphObjectRole) – an optional- GOffice.GraphObjectRoleto use as a filter- Returns: - list of self’s Children. Caller must free the list, but not the children. - Return type: - [ - GOffice.GraphObject]
 - 
get_editor(dalloc, cc)¶
- Parameters: - dalloc (GOffice.GraphDataAllocator) – aGOffice.GraphDataAllocator
- cc (GOffice.CmdContext) – aGOffice.CmdContext
 - Returns: - a - Gtk.Notebookwidget- Return type: - Builds an object property editor, by calling GogObject::populate_editor virtual functions. 
- dalloc (
 - 
get_graph()¶
- Returns: - the parent graph. - Return type: - GOffice.GraphGraph
 - 
get_manual_allocation(parent_allocation, requisition)¶
- Parameters: - parent_allocation (GOffice.GraphViewAllocation) –GOffice.GraphViewAllocation
- requisition (GOffice.GraphViewRequisition) –GOffice.GraphViewRequisition
 - Returns: - manual allocation of a - GOffice.GraphObjectgiven its parent allocation and its size request.- Return type: 
- parent_allocation (
 - 
get_manual_position(pos)¶
- Parameters: - pos ( - GOffice.GraphViewAllocation) –- GOffice.GraphViewAllocation- FIXME 
 - 
get_manual_size_mode()¶
- Return type: - GOffice.GraphManualSizeMode
 - 
get_parent()¶
- Returns: - self’s parent, potentially - Noneif it has not been added to a heirarchy yet. does not change ref-- GOffice.countin any way.- Return type: - GOffice.GraphObject
 - 
get_parent_typed(t)¶
- Parameters: - t ( - GObject.GType) – a- GObject.GType- Returns: - self’s parent of type type, potentially - Noneif it has not been added to a hierarchy yet or none of the parents are of type type.- Return type: - GOffice.GraphObject
 - 
get_position_flags(mask)¶
- Parameters: - mask ( - GOffice.GraphObjectPosition) –- GOffice.GraphObjectPosition- Returns: - self’s position flags, masked by mask. - Return type: - GOffice.GraphObjectPosition
 - 
get_theme()¶
- Returns: - the parent graph theme. - Return type: - GOffice.GraphTheme
 - 
new_view(parent)¶
- Parameters: - parent ( - GOffice.GraphView) – parent view- Returns: - a new - GOffice.GraphView- Return type: - GOffice.GraphView- Creates a new - GOffice.GraphViewassociated to self, and sets its parent to parent.
 - 
possible_additions()¶
- Returns: - a list of GogObjectRoles that could be added. The resulting list needs to be freed - Return type: - [ - GOffice.GraphObjectRole]
 - 
reorder(inc, goto_max)¶
- Parameters: - Returns: - the object just before self in the new ordering. - Return type: 
 - 
request_editor_update()¶
- Emits a update-editor signal. This signal should be used by object editors in order to refresh their states. 
 - 
set_manual_position(pos)¶
- Parameters: - pos ( - GOffice.GraphViewAllocation) –- GOffice.GraphViewAllocation- set manual position of given object, in points. 
 - 
set_name(name)¶
- Parameters: - name ( - str) – The new name for self- Raises: - GLib.Error- Assign the new name and signals that it has changed. NOTE : it _absorbs_ name rather than copying it, and generates a new name if name == - None
 - 
set_parent(parent, role, id)¶
- Parameters: - parent (GOffice.GraphObject) –GOffice.GraphObject.
- role (GOffice.GraphObjectRole) – a static string that can be sent to parent::add
- id (int) – optionallyNone.
 - Returns: - Trueon success- Return type: - Absorbs a ref to self 
- parent (
 - 
set_position_flags(flags, mask)¶
- Parameters: - Returns: - Truethe new flags are permitted.- Return type: - Attempts to set the position flags of self to flags. 
 - 
update()¶
 - 
write_xml_sax(output, user)¶
- Parameters: - output (Gsf.XMLOut) –
- user (objectorNone) –
 
- output (
 - 
do_child_added(child) virtual¶
- Parameters: - child ( - GOffice.GraphObject) –
 - 
do_child_name_changed(child) virtual¶
- Parameters: - child ( - GOffice.GraphObject) –
 - 
do_child_removed(child) virtual¶
- Parameters: - child ( - GOffice.GraphObject) –
 - 
do_children_reordered() virtual¶
 - 
do_document_changed(doc) virtual¶
- Parameters: - doc ( - GOffice.Doc) –
 - 
do_extra_signal1() virtual¶
 - 
do_extra_signal2() virtual¶
 - 
do_get_manual_size_mode() virtual¶
- Return type: - GOffice.GraphManualSizeMode
 - 
do_name_changed() virtual¶
 - 
do_populate_editor(editor, dalloc, cc) virtual¶
- Parameters: - editor (GOffice.Editor) –
- dalloc (GOffice.GraphDataAllocator) –
- cc (GOffice.CmdContext) –
 
- editor (
 - 
do_possible_additions_changed() virtual¶
 - 
do_reserved1() virtual¶
 - 
do_reserved2() virtual¶
 - 
do_update() virtual¶
 - 
do_update_editor() virtual¶
 
- 
classmethod 
Signal Details¶
- 
GOffice.GraphObject.signals.changed(graph_object, object)¶
- Signal Name: - changed- Flags: - Parameters: - graph_object (GOffice.GraphObject) – The object which received the signal
- object (bool) –
 
- graph_object (
- 
GOffice.GraphObject.signals.child_added(graph_object, child)¶
- Signal Name: - child-added- Flags: - Parameters: - graph_object (GOffice.GraphObject) – The object which received the signal
- child (GObject.Object) – The newGOffice.GraphObjectwhose parent is object
 - The - ::child-addedsignal is emitted AFTER the child has been added and AFTER the parent-changed signal has been called for it.
- graph_object (
- 
GOffice.GraphObject.signals.child_name_changed(graph_object, object)¶
- Signal Name: - child-name-changed- Flags: - Parameters: - graph_object (GOffice.GraphObject) – The object which received the signal
- object (GObject.Object) –
 
- graph_object (
- 
GOffice.GraphObject.signals.child_removed(graph_object, child)¶
- Signal Name: - child-removed- Flags: - Parameters: - graph_object (GOffice.GraphObject) – The object which received the signal
- child (GObject.Object) – The newGOffice.GraphObjectwhose parent is object
 - The - ::child-removedsignal is emitted BEFORE the child has been added and BEFORE the parent-changed signal has been called for it.
- graph_object (
- 
GOffice.GraphObject.signals.children_reordered(graph_object)¶
- Signal Name: - children-reordered- Flags: - RUN_LAST- Parameters: - graph_object ( - GOffice.GraphObject) – The object which received the signal
- 
GOffice.GraphObject.signals.name_changed(graph_object)¶
- Signal Name: - name-changed- Flags: - RUN_LAST- Parameters: - graph_object ( - GOffice.GraphObject) – The object which received the signal
- 
GOffice.GraphObject.signals.update_editor(graph_object)¶
- Signal Name: - update-editor- Flags: - RUN_LAST- Parameters: - graph_object ( - GOffice.GraphObject) – The object which received the signal
Property Details¶
- 
GOffice.GraphObject.props.alignment¶
- Name: - alignment- Type: - str- Default Value: - 'fill'- Flags: - READABLE,- WRITABLE- Alignment flag 
- 
GOffice.GraphObject.props.anchor¶
- Name: - anchor- Type: - str- Default Value: - 'top-left'- Flags: - READABLE,- WRITABLE- Anchor for manual position 
- 
GOffice.GraphObject.props.compass¶
- Name: - compass- Type: - str- Default Value: - 'top'- Flags: - READABLE,- WRITABLE- Compass auto position flags 
- 
GOffice.GraphObject.props.id¶
- Name: - id- Type: - int- Default Value: - 0- Flags: - READABLE,- WRITABLE- Object numerical ID 
- 
GOffice.GraphObject.props.invisible¶
- Name: - invisible- Type: - bool- Default Value: - False- Flags: - READABLE,- WRITABLE- Should the object be hidden 
- 
GOffice.GraphObject.props.is_position_manual¶
- Name: - is-position-manual- Type: - bool- Default Value: - False- Flags: - READABLE,- WRITABLE- Is position manual