![]() |
![]() |
![]() |
Goffice Reference Manual | ![]() |
---|---|---|---|---|
Top | Description | Object Hierarchy | Properties | Signals |
GogEditorPage; GogEditor; GogEditor * gog_editor_new (void); void gog_editor_free (GogEditor *editor); void gog_editor_add_page (GogEditor *editor, gpointer widget, char const *label); void gog_editor_set_store_page (GogEditor *editor, unsigned *store_page); void gog_editor_register_widget (GogEditor *editor, GtkWidget *widget); GtkWidget * gog_editor_get_registered_widget (GogEditor *editor, char const *name); GtkWidget * gog_editor_get_notebook (GogEditor *editor); enum GogObjectNamingConv; GogObjectRole; GogObject; #define GOG_OBJECT_TYPE #define GOG_OBJECT (o) #define IS_GOG_OBJECT (o) #define GOG_OBJECT_CLASS (k) #define IS_GOG_OBJECT_CLASS (k) #define GOG_OBJECT_GET_CLASS (o) #define GOG_PARAM_FORCE_SAVE #define GOG_PARAM_POSITION GType gog_object_get_type (void); void (*GogDataDuplicator) (GogDataset const *src, GogDataset *dst); GogObject * gog_object_dup (GogObject const *src, GogObject *new_parent, GogDataDuplicator datadup); GogObject * gog_object_get_parent (GogObject const *obj); GogObject * gog_object_get_parent_typed (GogObject const *obj, GType t); GogGraph * gog_object_get_graph (GogObject const *obj); GogTheme * gog_object_get_theme (GogObject const *obj); unsigned gog_object_get_id (GogObject const *obj); char const * gog_object_get_name (GogObject const *obj); void gog_object_set_name (GogObject *obj, char *name, GError **err); GSList * gog_object_get_children (GogObject const *obj, GogObjectRole const *filter); GogObject * gog_object_get_child_by_role (GogObject const *obj, GogObjectRole const *role); GogObject * gog_object_get_child_by_name (GogObject const *obj, char const *name); gpointer gog_object_get_editor (GogObject *obj, GogDataAllocator *dalloc, GOCmdContext *cc); GogView * gog_object_new_view (GogObject const *obj, GogView *parent); gboolean gog_object_is_deletable (GogObject const *obj); GSList * gog_object_possible_additions (GogObject const *parent); GogObject * gog_object_add_by_role (GogObject *parent, GogObjectRole const *role, GogObject *child); GogObject * gog_object_add_by_name (GogObject *parent, char const *role, GogObject *child); void gog_object_can_reorder (GogObject const *obj, gboolean *inc_ok, gboolean *dec_ok); GogObject * gog_object_reorder (GogObject const *obj, gboolean inc, gboolean goto_max); #define gog_object_is_visible (obj) void gog_object_set_invisible (GogObject *obj, gboolean invisible); GogObjectPosition gog_object_get_position_flags (GogObject const *obj, GogObjectPosition mask); gboolean gog_object_set_position_flags (GogObject *obj, GogObjectPosition flags, GogObjectPosition mask); gboolean gog_object_is_default_position_flags (GogObject const *obj, char const *name); void gog_object_get_manual_position (GogObject *obj, GogViewAllocation *pos); void gog_object_set_manual_position (GogObject *obj, GogViewAllocation const *pos); GogViewAllocation gog_object_get_manual_allocation (GogObject *gobj, GogViewAllocation const *parent_allocation, GogViewRequisition const *requisition); GogObjectRole const * gog_object_find_role_by_name (GogObject const *obj, char const *role); void gog_object_update (GogObject *obj); gboolean gog_object_request_update (GogObject *obj); void gog_object_emit_changed (GogObject *obj, gboolean size); gboolean gog_object_clear_parent (GogObject *obj); gboolean gog_object_set_parent (GogObject *child, GogObject *parent, GogObjectRole const *role, unsigned int id); void gog_object_register_roles (GogObjectClass *klass, GogObjectRole const *roles, unsigned int n_roles); void gog_object_request_editor_update (GogObject *obj); void gog_object_document_changed (GogObject *obj, GODoc *doc); void gog_object_write_xml_sax (GogObject const *obj, GsfXMLOut *output); GogObject * gog_object_new_from_xml (GogObject *parent, xmlNode *node); void (*GogObjectSaxHandler) (GogObject *obj, gpointer user_data); void gog_object_sax_push_parser (GsfXMLIn *xin, xmlChar const **attrs, GogObjectSaxHandler handler, gpointer user_data); GogObject * gog_xml_read_state_get_obj (GsfXMLIn *xin);
"alignment" gchar* : Read / Write "anchor" gchar* : Read / Write "compass" gchar* : Read / Write "id" guint : Read / Write "invisible" gboolean : Read / Write "is-position-manual" gboolean : Read / Write "position" gchar* : Read / Write
"changed" : Run Last "child-added" : Run Last "child-name-changed" : Run Last "child-removed" : Run Last "children-reordered" : Run Last "name-changed" : Run Last "update-editor" : Run Last
typedef struct { char const *label; /* label for notebook page */ gpointer widget; /* GtkWidget* */ } GogEditorPage;
typedef struct { unsigned *store_page; /* pointer to a place for storing last edited page */ GSList *pages; /* GogEditorPage */ GData *registered_widgets; } GogEditor;
GogEditor * gog_editor_new (void);
Returns : |
a new GogEditor object, which is used to store a collection of
property edition widgets (pages). The returned object must be freed
using gog_editor_free .
|
void gog_editor_free (GogEditor *editor);
Frees a GogEditor object.
|
a GogEditor |
void gog_editor_add_page (GogEditor *editor, gpointer widget, char const *label);
Adds a page to editor
.
|
a GogEditor |
|
property edition widget |
|
a label identifying the widget |
void gog_editor_set_store_page (GogEditor *editor, unsigned *store_page);
Sets a placeholder for storing the last active editor page.
|
a GogEditor |
|
placeholder for the last selected page |
void gog_editor_register_widget (GogEditor *editor, GtkWidget *widget);
Registers a widget that then can be retrieved later using
gog_editor_get_registered_widget
. The main use of this function is to
provide the ability to extend a page.
|
a GogEditor |
|
a GtkWidget |
GtkWidget * gog_editor_get_registered_widget (GogEditor *editor, char const *name);
|
a GogEditor |
|
the name of the registered widget |
Returns : |
a widget previously registered using gog_editor_register_widget .
|
GtkWidget * gog_editor_get_notebook (GogEditor *editor);
|
a GogEditor |
Returns : |
a GtkNotebook from the widget collection stored in editor .
|
typedef enum { GOG_OBJECT_NAME_BY_ROLE = 1, GOG_OBJECT_NAME_BY_TYPE = 2, GOG_OBJECT_NAME_MANUALLY = 3 } GogObjectNamingConv;
typedef struct { char const *id; /* for persistence */ char const *is_a_typename; unsigned priority; guint32 allowable_positions; GogObjectPosition default_position; GogObjectNamingConv naming_conv; gboolean (*can_add) (GogObject const *parent); gboolean (*can_remove) (GogObject const *child); GogObject *(*allocate) (GogObject *parent); void (*post_add) (GogObject *parent, GogObject *child); void (*pre_remove) (GogObject *parent, GogObject *child); void (*post_remove) (GogObject *parent, GogObject *child); union { /* allow people to tack some useful tidbits on the end */ int i; float f; gpointer p; } user; } GogObjectRole;
#define GOG_OBJECT(o) (G_TYPE_CHECK_INSTANCE_CAST ((o), GOG_OBJECT_TYPE, GogObject))
|
#define GOG_OBJECT_CLASS(k) (G_TYPE_CHECK_CLASS_CAST ((k), GOG_OBJECT_TYPE, GogObjectClass))
|
#define IS_GOG_OBJECT_CLASS(k) (G_TYPE_CHECK_CLASS_TYPE ((k), GOG_OBJECT_TYPE))
|
#define GOG_OBJECT_GET_CLASS(o) (G_TYPE_INSTANCE_GET_CLASS ((o), GOG_OBJECT_TYPE, GogObjectClass))
|
#define GOG_PARAM_FORCE_SAVE (1 << (G_PARAM_USER_SHIFT+1)) /* even if the value == default */
#define GOG_PARAM_POSITION (1 << (G_PARAM_USER_SHIFT+2)) /* position parameters */
void (*GogDataDuplicator) (GogDataset const *src, GogDataset *dst);
|
|
|
GogObject * gog_object_dup (GogObject const *src, GogObject *new_parent, GogDataDuplicator datadup);
Create a deep copy of obj
using new_parent
as its parent.
GogObject * gog_object_get_parent (GogObject const *obj);
|
a GogObject |
Returns : |
obj 's parent, potentially NULL if it has not been added to a
heirarchy yet. does not change ref-count in any way.
|
GogObject * gog_object_get_parent_typed (GogObject const *obj, GType t);
|
a GogObject |
|
a GType |
Returns : |
obj 's parent of type type , potentially NULL if it has not been
added to a hierarchy yet or none of the parents are of type type .
|
GogGraph * gog_object_get_graph (GogObject const *obj);
|
const * GogObject |
Returns : |
the parent graph. |
char const * gog_object_get_name (GogObject const *obj);
No need to free the result
|
a GogObject |
Returns : |
a name. |
void gog_object_set_name (GogObject *obj, char *name, GError **err);
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
== NULL
|
GogObject |
|
The new name for obj
|
|
GError |
GSList * gog_object_get_children (GogObject const *obj, GogObjectRole const *filter);
|
a GogObject |
|
an optional GogObjectRole to use as a filter |
Returns : |
A list of obj 's Children. Caller must free the list, but not the
children.
|
GogObject * gog_object_get_child_by_role (GogObject const *obj, GogObjectRole const *role);
A convenience routine to find a unique child with role
.
|
a GogObject |
|
a GogObjectRole to use as a filter |
Returns : |
NULL and spews an error if there is more than one.
|
GogObject * gog_object_get_child_by_name (GogObject const *obj, char const *name);
A convenience routine to find a unique child with role == name
|
a GogObject |
|
a char to use as a role name filter |
Returns : |
NULL and spews an error if there is more than one.
|
gpointer gog_object_get_editor (GogObject *obj, GogDataAllocator *dalloc, GOCmdContext *cc);
Builds an object property editor, by calling GogObject::populate_editor virtual functions.
|
a GogObject |
|
a GogDataAllocator |
|
a GOCmdContext |
Returns : |
a GtkNotebook widget |
GogView * gog_object_new_view (GogObject const *obj, GogView *parent);
Creates a new GogView associated to obj
, and sets its parent to parent
.
gboolean gog_object_is_deletable (GogObject const *obj);
|
a GogObject |
Returns : |
TRUE if obj can be deleted.
|
GSList * gog_object_possible_additions (GogObject const *parent);
|
a GogObject |
Returns : |
a list of GogObjectRoles that could be added. The resulting list needs to be freed |
GogObject * gog_object_add_by_role (GogObject *parent, GogObjectRole const *role, GogObject *child);
Absorb a ref to child
if it is non-NULL.
|
GogObject |
|
GogObjectRole |
|
GogObject |
Returns : |
child or a newly created object with role . Callers do _not_ own
the reference.
|
GogObject * gog_object_add_by_name (GogObject *parent, char const *role, GogObject *child);
void gog_object_can_reorder (GogObject const *obj, gboolean *inc_ok, gboolean *dec_ok);
If obj
can move forward or backward in its parents child list
|
GogObject |
|
optionally NULL pointer for result.
|
|
optionally NULL pointer for result.
|
GogObject * gog_object_reorder (GogObject const *obj, gboolean inc, gboolean goto_max);
|
GogObject |
|
|
|
|
Returns : |
the object just before obj in the new ordering.
|
void gog_object_set_invisible (GogObject *obj, gboolean invisible);
|
GogObject |
|
GogObjectPosition gog_object_get_position_flags (GogObject const *obj, GogObjectPosition mask);
|
GogObject |
|
GogObjectPosition |
Returns : |
obj 's position flags, masked by mask .
|
gboolean gog_object_set_position_flags (GogObject *obj, GogObjectPosition flags, GogObjectPosition mask);
Attempts to set the position flags of obj
to flags
.
|
GogObject |
|
GogObjectPosition |
|
GogObjectPosition |
Returns : |
TRUE the new flags are permitted. |
gboolean gog_object_is_default_position_flags (GogObject const *obj, char const *name);
|
|
|
|
Returns : |
void gog_object_get_manual_position (GogObject *obj, GogViewAllocation *pos);
FIXME
|
GogObject |
|
GogViewAllocation |
void gog_object_set_manual_position (GogObject *obj, GogViewAllocation const *pos);
set manual position of given object, in points.
|
GogObject |
|
GogViewAllocation |
GogViewAllocation gog_object_get_manual_allocation (GogObject *gobj, GogViewAllocation const *parent_allocation, GogViewRequisition const *requisition);
|
GogObject |
|
GogViewAllocation |
|
GogViewRequisition |
Returns : |
manual allocation of a GogObject given its parent allocation and its size request. |
GogObjectRole const * gog_object_find_role_by_name (GogObject const *obj, char const *role);
|
|
|
|
Returns : |
void gog_object_emit_changed (GogObject *obj, gboolean size);
|
|
|
gboolean gog_object_clear_parent (GogObject *obj);
Does _not_ unref the child, which in effect adds a ref by freeing up the ref previously associated with the parent.
|
GogObject |
Returns : |
TRUE on success.
|
gboolean gog_object_set_parent (GogObject *child, GogObject *parent, GogObjectRole const *role, unsigned int id);
Absorbs a ref to child
void gog_object_register_roles (GogObjectClass *klass, GogObjectRole const *roles, unsigned int n_roles);
|
GogObjectClass |
|
GogObjectRole |
|
number of roles |
void gog_object_request_editor_update (GogObject *obj);
Emits a update-editor signal. This signal should be used by object editors in order to refresh their states.
|
GogObject |
void gog_object_document_changed (GogObject *obj, GODoc *doc);
|
|
|
void gog_object_write_xml_sax (GogObject const *obj, GsfXMLOut *output);
|
|
|
GogObject * gog_object_new_from_xml (GogObject *parent, xmlNode *node);
|
|
|
|
Returns : |
void (*GogObjectSaxHandler) (GogObject *obj, gpointer user_data);
|
|
|
void gog_object_sax_push_parser (GsfXMLIn *xin, xmlChar const **attrs, GogObjectSaxHandler handler, gpointer user_data);
|
|
|
|
|
|
|
"anchor"
property"anchor" gchar* : Read / Write
Anchor for manual position.
Default value: "top-left"
"compass"
property"compass" gchar* : Read / Write
Compass auto position flags.
Default value: "top"
"id"
property"id" guint : Read / Write
Object numerical ID.
Allowed values: <= G_MAXINT
Default value: 0
"invisible"
property"invisible" gboolean : Read / Write
Should the object be hidden.
Default value: FALSE
"is-position-manual"
property"is-position-manual" gboolean : Read / Write
Is position manual.
Default value: FALSE
"changed"
signalvoid user_function (GogObject *gogobject, gboolean arg1, gpointer user_data) : Run Last
@: @:
"child-added"
signalvoid user_function (GogObject *gogobject, GObject *arg1, gpointer user_data) : Run Last
@: @:
"child-name-changed"
signalvoid user_function (GogObject *gogobject, GObject *arg1, gpointer user_data) : Run Last
@: @:
"child-removed"
signalvoid user_function (GogObject *gogobject, GObject *arg1, gpointer user_data) : Run Last
@: @:
"children-reordered"
signalvoid user_function (GogObject *gogobject, gpointer user_data) : Run Last
@:
"name-changed"
signalvoid user_function (GogObject *gogobject, gpointer user_data) : Run Last
@:
"update-editor"
signalvoid user_function (GogObject *gogobject, gpointer user_data) : Run Last
@: