Glade User Interface Designer Reference Manual | ||||
---|---|---|---|---|
Top | Description | Object Hierarchy | Implemented Interfaces | Properties | Signals |
GladeProject; enum GladeProjectFormat; GladeProject * glade_project_new (void
); GladeProjectFormat glade_project_get_format (GladeProject *project
); void glade_project_set_format (GladeProject *project
,GladeProjectFormat format
); gboolean glade_project_load_from_file (GladeProject *project
,const gchar *path
); GladeProject * glade_project_load (const gchar *path
); gboolean glade_project_save (GladeProject *project
,const gchar *path
,GError **error
); const gchar * glade_project_get_path (GladeProject *project
); gchar * glade_project_get_name (GladeProject *project
); void glade_project_undo (GladeProject *project
); void glade_project_redo (GladeProject *project
); GladeCommand * glade_project_next_undo_item (GladeProject *project
); GladeCommand * glade_project_next_redo_item (GladeProject *project
); void glade_project_push_undo (GladeProject *project
,GladeCommand *cmd
); GtkWidget * glade_project_undo_items (GladeProject *project
); GtkWidget * glade_project_redo_items (GladeProject *project
); void glade_project_reset_path (GladeProject *project
); gboolean glade_project_get_readonly (GladeProject *project
); const GList * glade_project_get_objects (GladeProject *project
); void glade_project_add_object (GladeProject *project
,GladeProject *old_project
,GObject *object
); void glade_project_remove_object (GladeProject *project
,GObject *object
); gboolean glade_project_has_object (GladeProject *project
,GObject *object
); GladeWidget * glade_project_get_widget_by_name (GladeProject *project
,GladeWidget *ancestor
,const gchar *name
); gchar * glade_project_new_widget_name (GladeProject *project
,GladeWidget *widget
,const gchar *base_name
); gboolean glade_project_is_selected (GladeProject *project
,GObject *object
); void glade_project_selection_set (GladeProject *project
,GObject *object
,gboolean emit_signal
); void glade_project_selection_add (GladeProject *project
,GObject *object
,gboolean emit_signal
); void glade_project_selection_remove (GladeProject *project
,GObject *object
,gboolean emit_signal
); void glade_project_selection_clear (GladeProject *project
,gboolean emit_signal
); void glade_project_selection_changed (GladeProject *project
); GList * glade_project_selection_get (GladeProject *project
); gboolean glade_project_get_has_selection (GladeProject *project
); gchar * glade_project_resource_fullpath (GladeProject *project
,const gchar *resource
); gboolean glade_project_is_loading (GladeProject *project
); time_t glade_project_get_file_mtime (GladeProject *project
); gboolean glade_project_get_modified (GladeProject *project
);
"format" gint : Read "has-selection" gboolean : Read "modified" gboolean : Read "path" gchar* : Read "previewable" gboolean : Read "read-only" gboolean : Read
"add-widget" :Run Last
"changed" :Run First
"close" :Run Last
"convert-finished" :Run First
"load-progress" :Run First
"parse-began" :Run First
"parse-finished" :Run First
"remove-widget" :Run Last
"selection-changed" :Run Last
"targets-changed" :Run First
"widget-name-changed" :Run Last
This object owns all project objects and is responsable for loading and saving the glade document, you can monitor the project state via this object and its signals.
typedef enum { GLADE_PROJECT_FORMAT_LIBGLADE, GLADE_PROJECT_FORMAT_GTKBUILDER } GladeProjectFormat;
GladeProject * glade_project_new (void
);
Creates a new GladeProject.
Returns : |
a new GladeProject |
void glade_project_set_format (GladeProject *project
,GladeProjectFormat format
);
Sets project
format to format
, used internally to set the actual format
state; note that conversions should be done through the glade-command api.
|
a GladeProject |
|
the GladeProjectFormat |
gboolean glade_project_load_from_file (GladeProject *project
,const gchar *path
);
GladeProject * glade_project_load (const gchar *path
);
Opens a project at the given path.
Returns : |
a new GladeProject for the opened project on success, NULL on
failure
|
gboolean glade_project_save (GladeProject *project
,const gchar *path
,GError **error
);
Saves project
to the given path.
|
a GladeProject |
|
location to save glade file |
|
an error from the G_FILE_ERROR domain. |
Returns : |
TRUE on success, FALSE on failure
|
void glade_project_undo (GladeProject *project
);
Redoes a GladeCommand in this project.
|
a GladeProject |
GladeCommand * glade_project_next_undo_item (GladeProject *project
);
Gets the next undo item on project
's command stack.
|
a GladeProject |
Returns : |
the GladeCommand |
GladeCommand * glade_project_next_redo_item (GladeProject *project
);
Gets the next redo item on project
's command stack.
|
a GladeProject |
Returns : |
the GladeCommand |
void glade_project_push_undo (GladeProject *project
,GladeCommand *cmd
);
Pushes a newly created GladeCommand onto projects
stack.
|
a GladeProject |
|
the GladeCommand |
GtkWidget * glade_project_undo_items (GladeProject *project
);
Creates a menu of the undo items in the project stack
|
A GladeProject |
Returns : |
A newly created menu |
GtkWidget * glade_project_redo_items (GladeProject *project
);
Creates a menu of the undo items in the project stack
|
A GladeProject |
Returns : |
A newly created menu |
gboolean glade_project_get_readonly (GladeProject *project
);
Gets whether the project is read only or not
|
a GladeProject |
Returns : |
TRUE if project is read only |
void glade_project_add_object (GladeProject *project
,GladeProject *old_project
,GObject *object
);
Adds an object to the project.
|
the GladeProject the widget is added to |
|
the GladeProject the widget was previously in
(or NULL for the clipboard)
|
|
the GObject to add |
void glade_project_remove_object (GladeProject *project
,GObject *object
);
Removes object
from project
.
Note that when removing the GObject from the project we don't change ->project in the associated GladeWidget; this way UNDO can work.
|
a GladeProject |
|
the GObject to remove |
gboolean glade_project_has_object (GladeProject *project
,GObject *object
);
|
the GladeProject the widget is added to |
|
the GObject to search |
Returns : |
whether this object is in this project. |
GladeWidget * glade_project_get_widget_by_name (GladeProject *project
,GladeWidget *ancestor
,const gchar *name
);
Searches under ancestor
in project
looking for a GladeWidget named name
.
|
a GladeProject |
|
The toplevel project object to search under |
|
The user visible name of the widget we are looking for |
Returns : |
a pointer to the widget, NULL if the widget does not exist
|
gchar * glade_project_new_widget_name (GladeProject *project
,GladeWidget *widget
,const gchar *base_name
);
Creates a new name for a widget that doesn't collide with any of the names
already in project
. This name will start with base_name
.
|
a GladeProject |
|
the GladeWidget intended to recieve a new name |
|
base name of the widget to create |
Returns : |
a string containing the new name, NULL if there is not enough
memory for this string
|
gboolean glade_project_is_selected (GladeProject *project
,GObject *object
);
|
a GladeProject |
|
a GObject |
Returns : |
whether object is in project selection
|
void glade_project_selection_set (GladeProject *project
,GObject *object
,gboolean emit_signal
);
Set the selection in project
to object
If emit_signal
is TRUE
, calls glade_project_selection_changed()
.
|
a GladeProject |
|
a GObject in project
|
|
whether or not to emit a signal indicating a selection change |
void glade_project_selection_add (GladeProject *project
,GObject *object
,gboolean emit_signal
);
Adds object
to the selection chain of project
If emit_signal
is TRUE
, calls glade_project_selection_changed()
.
|
a GladeProject |
|
a GObject in project
|
|
whether or not to emit a signal indicating a selection change |
void glade_project_selection_remove (GladeProject *project
,GObject *object
,gboolean emit_signal
);
Removes object
from the selection chain of project
If emit_signal
is TRUE
, calls glade_project_selection_changed()
.
|
a GladeProject |
|
a GObject in project
|
|
whether or not to emit a signal indicating a selection change |
void glade_project_selection_clear (GladeProject *project
,gboolean emit_signal
);
Clears project
's selection chain
If emit_signal
is TRUE
, calls glade_project_selection_changed()
.
|
a GladeProject |
|
whether or not to emit a signal indication a selection change |
void glade_project_selection_changed (GladeProject *project
);
Causes project
to emit a "selection_changed" signal.
|
a GladeProject |
GList * glade_project_selection_get (GladeProject *project
);
|
a GladeProject |
Returns : |
a GList containing the GtkWidget items currently selected in
project
|
gboolean glade_project_get_has_selection (GladeProject *project
);
|
a GladeProject |
Returns : |
whether project currently has a selection
|
gchar * glade_project_resource_fullpath (GladeProject *project
,const gchar *resource
);
Project resource strings may be relative or fullpaths, but glade always expects a copy in the glade file directory, this function is used to make a local path to the file.
|
The GladeProject. |
|
The resource basename |
Returns : |
A newly allocated string holding the local path the the project resource. |
gboolean glade_project_is_loading (GladeProject *project
);
|
A GladeProject |
Returns : |
Whether the project is being loaded or not |
gboolean glade_project_get_modified (GladeProject *project
);
Get's whether the project has been modified since it was last saved.
|
a GladeProject |
Returns : |
TRUE if the project has been modified since it was last saved |
"format"
property "format" gint : Read
The project file format.
Allowed values: [0,1]
Default value: 1
"has-selection"
property "has-selection" gboolean : Read
Whether project has a selection.
Default value: FALSE
"modified"
property "modified" gboolean : Read
Whether project has been modified since it was last saved.
Default value: FALSE
"previewable"
property "previewable" gboolean : Read
Wether the project can be previewed.
Default value: FALSE
"add-widget"
signalvoid user_function (GladeProject *gladeproject,
GladeWidget *arg1,
gpointer user_data) : Run Last
Emitted when a widget is added to a project.
|
the GladeProject which received the signal. |
|
the GladeWidget that was added to gladeproject .
|
|
user data set when the signal handler was connected. |
"changed"
signalvoid user_function (GladeProject *gladeproject,
GladeCommand *arg1,
gboolean arg2,
gpointer user_data) : Run First
Emitted when a gladeproject
's state changes via a GladeCommand.
|
the GladeProject which received the signal. |
|
the GladeCommand that was executed |
|
whether the command was executed or undone. |
|
user data set when the signal handler was connected. |
"close"
signalvoid user_function (GladeProject *gladeproject,
gpointer user_data) : Run Last
Emitted when a project is closing (a good time to clean up any associated resources).
|
the GladeProject which received the signal. |
|
user data set when the signal handler was connected. |
"convert-finished"
signalvoid user_function (GladeProject *gladeproject,
gpointer user_data) : Run First
Emitted when gladeproject
format conversion has finished.
NOTE: Some properties are internally handled differently when the project is in a said format, this signal is fired after the new format is in effect to allow the backend access to both before and after.
|
the GladeProject which received the signal. |
|
user data set when the signal handler was connected. |
"load-progress"
signalvoid user_function (GladeProject *gladeproject,
gint objects_total,
gint objects_loaded,
gpointer user_data) : Run First
Emitted while project
is loading.
|
the GladeProject which received the signal. |
|
the total amount of objects to load |
|
the current amount of loaded objects |
|
user data set when the signal handler was connected. |
"parse-began"
signalvoid user_function (GladeProject *gladeproject,
gpointer user_data) : Run First
Emitted when gladeproject
parsing starts.
|
the GladeProject which received the signal. |
|
user data set when the signal handler was connected. |
"parse-finished"
signalvoid user_function (GladeProject *gladeproject,
gpointer user_data) : Run First
Emitted when gladeproject
parsing has finished.
|
the GladeProject which received the signal. |
|
user data set when the signal handler was connected. |
"remove-widget"
signalvoid user_function (GladeProject *gladeproject,
GladeWidget *arg1,
gpointer user_data) : Run Last
Emitted when a widget is removed from a project.
|
the GladeProject which received the signal. |
|
the GladeWidget that was removed from gladeproject .
|
|
user data set when the signal handler was connected. |
"selection-changed"
signalvoid user_function (GladeProject *gladeproject,
gpointer user_data) : Run Last
Emitted when gladeproject
selection list changes.
|
the GladeProject which received the signal. |
|
user data set when the signal handler was connected. |
"targets-changed"
signalvoid user_function (GladeProject *gladeproject,
gpointer user_data) : Run First
Emitted when gladeproject
target versions change.
|
the GladeProject which received the signal. |
|
user data set when the signal handler was connected. |
"widget-name-changed"
signalvoid user_function (GladeProject *gladeproject,
GladeWidget *arg1,
gpointer user_data) : Run Last
Emitted when gwidget
's name changes.
|
the GladeProject which received the signal. |
|
the GladeWidget who's name changed. |
|
user data set when the signal handler was connected. |