GOffice.GraphObject

g GObject.Object GObject.Object GOffice.GraphObject GOffice.GraphObject GObject.Object->GOffice.GraphObject

Subclasses:

GOffice.Graph3DBox, GOffice.GraphPlot, GOffice.GraphStyledObject

Methods

Inherited:

GObject.Object (37)

Structs:

GObject.ObjectClass (5)

class

new_from_input (input, user_unserialize)

class

register_roles (klass, roles, n_roles)

class

sax_push_parser (xin, attrs, handler, user_unserialize, *user_data)

class

set_arg (name, val, obj)

add_by_name (role, child)

add_by_role (role, child)

can_reorder (inc_ok, dec_ok)

clear_parent ()

document_changed (doc)

dup (new_parent, datadup)

emit_changed (size)

find_role_by_name (role)

get_child_by_name (name)

get_child_by_role (role)

get_children (filter)

get_editor (dalloc, cc)

get_graph ()

get_id ()

get_manual_allocation (parent_allocation, requisition)

get_manual_position (pos)

get_manual_size_mode ()

get_name ()

get_parent ()

get_parent_typed (t)

get_position_flags (mask)

get_theme ()

is_default_position_flags (name)

is_deletable ()

new_view (parent)

possible_additions ()

reorder (inc, goto_max)

request_editor_update ()

request_update ()

set_invisible (invisible)

set_manual_position (pos)

set_name (name)

set_parent (parent, role, id)

set_position_flags (flags, mask)

update ()

write_xml_sax (output, user)

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-added signal 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-removed signal 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:

GOffice.GraphObject

classmethod register_roles(klass, roles, n_roles)
Parameters:
classmethod sax_push_parser(xin, attrs, handler, user_unserialize, *user_data)
Parameters:

Unserializes a GOffice.GraphObject using handler when done.

classmethod set_arg(name, val, obj)
Parameters:
add_by_name(role, child)
Parameters:
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:

GOffice.GraphObject

add_by_role(role, child)
Parameters:
Returns:

child or a newly created object with role.

Return type:

GOffice.GraphObject

Absorb a ref to child if it is non-None.

can_reorder(inc_ok, dec_ok)
Parameters:
  • inc_ok (bool) – optionally None pointer for result.

  • dec_ok (bool) – optionally None pointer for result.

If self can move forward or backward in its parents child list

clear_parent()
Returns:

True on 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:
Returns:

the duplicated object

Return type:

GOffice.GraphObject

Create a deep copy of obj using new_parent as its parent.

emit_changed(size)
Parameters:

size (bool) –

find_role_by_name(role)
Parameters:

role (str) –

Return type:

GOffice.GraphObjectRole

get_child_by_name(name)
Parameters:

name (str) – a str to use as a role name filter

Returns:

None and 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.GraphObjectRole to use as a filter

Returns:

None and 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.GraphObjectRole to 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:
Returns:

a Gtk.Notebook widget

Return type:

object or None

Builds an object property editor, by calling GogObject::populate_editor virtual functions.

get_graph()
Returns:

the parent graph.

Return type:

GOffice.GraphGraph

get_id()
Return type:

int

get_manual_allocation(parent_allocation, requisition)
Parameters:
Returns:

manual allocation of a GOffice.GraphObject given its parent allocation and its size request.

Return type:

GOffice.GraphViewAllocation

get_manual_position(pos)
Parameters:

pos (GOffice.GraphViewAllocation) – GOffice.GraphViewAllocation

FIXME

get_manual_size_mode()
Return type:

GOffice.GraphManualSizeMode

get_name()
Returns:

a name.

Return type:

str

No need to free the result

get_parent()
Returns:

self's parent, potentially None if it has not been added to a heirarchy yet. does not change ref-GOffice.count in 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 None if 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

is_default_position_flags(name)
Parameters:

name (str) –

Return type:

bool

is_deletable()
Returns:

True if self can be deleted.

Return type:

bool

new_view(parent)
Parameters:

parent (GOffice.GraphView) – parent view

Returns:

a new GOffice.GraphView

Return type:

GOffice.GraphView

Creates a new GOffice.GraphView associated 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:

GOffice.GraphObject

request_editor_update()

Emits a update-editor signal. This signal should be used by object editors in order to refresh their states.

request_update()
Return type:

bool

set_invisible(invisible)
Parameters:

invisible (bool) –

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:
Returns:

True on success

Return type:

bool

Absorbs a ref to self

set_position_flags(flags, mask)
Parameters:
Returns:

True the new flags are permitted.

Return type:

bool

Attempts to set the position flags of self to flags.

update()
write_xml_sax(output, user)
Parameters:
do_changed(size) virtual
Parameters:

size (bool) –

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_parent_changed(was_set) virtual
Parameters:

was_set (bool) –

do_populate_editor(editor, dalloc, cc) virtual
Parameters:
do_possible_additions_changed() virtual
do_reserved1() virtual
do_reserved2() virtual
do_type_name() virtual
Return type:

str

do_update() virtual
do_update_editor() virtual

Signal Details

GOffice.GraphObject.signals.changed(graph_object, object)
Signal Name:

changed

Flags:

RUN_LAST

Parameters:
GOffice.GraphObject.signals.child_added(graph_object, child)
Signal Name:

child-added

Flags:

RUN_LAST

Parameters:

The ::child-added signal is emitted AFTER the child has been added and AFTER the parent-changed signal has been called for it.

GOffice.GraphObject.signals.child_name_changed(graph_object, object)
Signal Name:

child-name-changed

Flags:

RUN_LAST

Parameters:
GOffice.GraphObject.signals.child_removed(graph_object, child)
Signal Name:

child-removed

Flags:

RUN_LAST

Parameters:

The ::child-removed signal is emitted BEFORE the child has been added and BEFORE the parent-changed signal has been called for it.

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

GOffice.GraphObject.props.manual_size
Name:

manual-size

Type:

str

Default Value:

'none'

Flags:

READABLE, WRITABLE

Whether the height or width are manually set

GOffice.GraphObject.props.position
Name:

position

Type:

str

Default Value:

'0 0 1 1'

Flags:

READABLE, WRITABLE

Position and size of object, in percentage of parent size