Top | ![]() |
![]() |
![]() |
![]() |
ExoToolbarsModelExoToolbarsModel — The toolbars backend used by ExoToolbarsView |
gchar* | get-item-data | Run First |
gchar* | get-item-id | Run First |
gchar* | get-item-type | Run First |
void | item-added | Run Last |
void | item-removed | Run Last |
void | toolbar-added | Run Last |
void | toolbar-changed | Run Last |
void | toolbar-removed | Run Last |
The ExoToolbarsModel class includes the basic functionality to manage editable toolbars.
ExoToolbarsModel *
exo_toolbars_model_new (void
);
Creates a new ExoToolbarsModel with a reference count of one.
You need to call exo_toolbars_model_set_actions()
first, after
you created an ExoToolbarsModel to set the list of actions,
that should be available from the toolbars.
void exo_toolbars_model_set_actions (ExoToolbarsModel *model
,gchar **actions
,guint n_actions
);
Specifies the list of valid actions for model
. model
will only
manage actions that are specified in this list. This function
should be called right after you created model
.
model |
An ExoToolbarsModel. |
|
actions |
A string array with action names. |
|
n_actions |
The number of strings in |
gchar **
exo_toolbars_model_get_actions (ExoToolbarsModel *model
);
Returns the list of valid actions for model
.
gboolean exo_toolbars_model_load_from_file (ExoToolbarsModel *model
,const gchar *filename
,GError **error
);
Parses a file containing a toolbars UI definition and merges it with
the current contents of model
.
model |
An ExoToolbarsModel. |
|
filename |
The name of the file to parse. |
|
error |
Return location for an error or |
gboolean exo_toolbars_model_save_to_file (ExoToolbarsModel *model
,const gchar *filename
,GError **error
);
Stores the UI definition of the contents of model
to the file
specified by filename
.
model |
An ExoToolbarsModel. |
|
filename |
The name of the file to save to. |
|
error |
The return location for an error or |
ExoToolbarsModelFlags exo_toolbars_model_get_flags (ExoToolbarsModel *model
,gint toolbar_position
);
Returns the ExoToolbarsModelFlags associated with the
toolbar at toolbar_position
.
void exo_toolbars_model_set_flags (ExoToolbarsModel *model
,ExoToolbarsModelFlags flags
,gint toolbar_position
);
Changes the ExoToolbarsModelFlags associated with the
toolbar at toolbar_position
to the value of flags
.
model |
An ExoToolbarsModel. |
|
flags |
The new flags for |
|
toolbar_position |
The index of a toolbar in |
GtkToolbarStyle exo_toolbars_model_get_style (ExoToolbarsModel *model
,gint toolbar_position
);
Returns the overridden GtkToolbarStyle for the toolbar
at toolbar_position
. Should only be used if
EXO_TOOLBARS_MODEL_OVERRIDE_STYLE
is set for the
toolbar.
void exo_toolbars_model_set_style (ExoToolbarsModel *model
,GtkToolbarStyle style
,gint toolbar_position
);
Sets the style to use for a particular toolbar in model
. You can
undo the effect of this function by calling
exo_toolbars_model_unset_style()
.
void exo_toolbars_model_unset_style (ExoToolbarsModel *model
,gint toolbar_position
);
Undoes the effect of exo_toolbars_model_unset_style()
and resets
the style of the specified toolbar to the system default.
gchar * exo_toolbars_model_get_item_type (ExoToolbarsModel *model
,GdkAtom dnd_type
);
FIXME.
gchar * exo_toolbars_model_get_item_id (ExoToolbarsModel *model
,const gchar *type
,const gchar *name
);
FIXME.
gchar * exo_toolbars_model_get_item_data (ExoToolbarsModel *model
,const gchar *type
,const gchar *id
);
FIXME.
gboolean exo_toolbars_model_add_item (ExoToolbarsModel *model
,gint toolbar_position
,gint item_position
,const gchar *id
,const gchar *type
);
Adds a new toolbar item with the specified type
and id
to model
,
where id
has to be a valid action name for model
, that was previously
set with exo_toolbars_model_set_actions()
.
model |
An ExoToolbarsModel. |
|
toolbar_position |
The index of toolbar in |
|
item_position |
The position in the specified toolbar or -1. |
|
id |
The identifier of the new item. |
|
type |
The type of the new item. |
void exo_toolbars_model_add_separator (ExoToolbarsModel *model
,gint toolbar_position
,gint item_position
);
Adds a new separator item to the specified toolbar in model
. If
you specify -1 for item_position
, the separator will be appended
to the toolbar, else it will be inserted at the specified item_position
.
model |
An ExoToolbarsModel. |
|
toolbar_position |
The index of a toolbar in |
|
item_position |
The position in the specified toolbar or -1. |
gint exo_toolbars_model_add_toolbar (ExoToolbarsModel *model
,gint toolbar_position
,const gchar *name
);
Adds a new toolbar to model
. If you specify -1 for toolbar_position
,
the toolbar will be appended to model
; else the toolbar will be
inserted at the specified position. Emits the ::toolbar-added
signal.
model |
An ExoToolbarsModel. |
|
toolbar_position |
Where to insert the new toolbar in |
|
name |
The name of the new toolbar. |
void exo_toolbars_model_move_item (ExoToolbarsModel *model
,gint toolbar_position
,gint item_position
,gint new_toolbar_position
,gint new_item_position
);
Moves an item to another position. The move operation is done by first removing the specified item and afterwards readding the item at the new position. Therefore, this functions emits the ::item-removed and ::item-added signals.
model |
An ExoToolbarsModel. |
|
toolbar_position |
Old toolbar index. |
|
item_position |
Old item index. |
|
new_toolbar_position |
New toolbar index. |
|
new_item_position |
New item index. |
void exo_toolbars_model_remove_item (ExoToolbarsModel *model
,gint toolbar_position
,gint item_position
);
Removes the toolbar item at item_position
from the toolbar
toolbar_position
in model
and emits the ::item-removed
signal.
model |
An ExoToolbarsModel. |
|
toolbar_position |
A toolbar index. |
|
item_position |
The index of the item to remove. |
void exo_toolbars_model_remove_toolbar (ExoToolbarsModel *model
,gint toolbar_position
);
Removes the specified toolbar from model
and emits
the ::toolbar-removed signal.
gint exo_toolbars_model_n_items (ExoToolbarsModel *model
,gint toolbar_position
);
Returns the number of items in the specified toolbar.
void exo_toolbars_model_item_nth (ExoToolbarsModel *model
,gint toolbar_position
,gint item_position
,gboolean *is_separator
,const gchar **id
,const gchar **type
);
Queries the properites of the toolbar item at item_position
in toolbar
toolbar_position
.
model |
An ExoToolbarsModel. |
|
toolbar_position |
The index of a toolbar in |
|
item_position |
The index of an item in the specified toolbar. |
|
is_separator |
Return location for the separator setting or |
|
id |
Return location for the item id or |
|
type |
Return location for the item type or |
gint
exo_toolbars_model_n_toolbars (ExoToolbarsModel *model
);
Returns the number of toolbars currently
managed by model
.
const gchar * exo_toolbars_model_toolbar_nth (ExoToolbarsModel *model
,gint toolbar_position
);
Returns the name of the toolbar at toolbar_position
in
model
.
struct ExoToolbarsModel;
The ExoToolbarsModel struct contains only private fields and should not be directly accessed.
Flags available for ExoToolbarsModel.
Not possible to remove items from the model. |
||
Only accept new item, dragging items around is disabled. |
||
If set, the ExoToolbarsModel
accepts a custom GtkToolbarStyle. See
|
“get-item-data”
signalgchar* user_function (ExoToolbarsModel *exotoolbarsmodel, gchar *arg1, gchar *arg2, gpointer user_data)
This signal is emitted whenever the exo_toolbars_model_get_item_data()
method is called.
Flags: Run First
“get-item-id”
signalgchar* user_function (ExoToolbarsModel *exotoolbarsmodel, gchar *arg1, gchar *arg2, gpointer user_data)
This signal is emitted whenever the exo_toolbars_model_get_item_id()
method is called.
Flags: Run First
“get-item-type”
signalgchar* user_function (ExoToolbarsModel *exotoolbarsmodel, gpointer arg1, gpointer user_data)
This signal is emitted whenever the exo_toolbars_model_get_item_type()
method is called.
Flags: Run First
“item-added”
signalvoid user_function (ExoToolbarsModel *model, gint toolbar_position, gint item_position, gpointer user_data)
This signal is emitted whenever a new item is added to a toolbar
managed by model
.
model |
The ExoToolbarsModel to which an item was added. |
|
toolbar_position |
The index of the toolbar in |
|
item_position |
The index of the new item in the specified toolbar. |
|
user_data |
user data set when the signal handler was connected. |
Flags: Run Last
“item-removed”
signalvoid user_function (ExoToolbarsModel *model, gint toolbar_position, gint item_position, gpointer user_data)
This signal is emitted whenever an item is removed from a toolbar
managed by model
.
model |
The ExoToolbarsModel from which an item was removed. |
|
toolbar_position |
The index of the toolbar in |
|
item_position |
The index of the item in the specified toolbar. |
|
user_data |
user data set when the signal handler was connected. |
Flags: Run Last
“toolbar-added”
signalvoid user_function (ExoToolbarsModel *model, gint toolbar_position, gpointer user_data)
This signal is emitted whenever a new toolbar is added to model
.
model |
The ExoToolbarsModel to which a new toolbar was added. |
|
toolbar_position |
The index of the new toolbar in |
|
user_data |
user data set when the signal handler was connected. |
Flags: Run Last
“toolbar-changed”
signalvoid user_function (ExoToolbarsModel *model, gint toolbar_position, gpointer user_data)
This signal is emitted whenever the flags or the style of a toolbar
change, which is managed by model
. All views connected to model
should then update their internal state of the specified toolbar.
model |
The ExoToolbarsModel that manages the changed toolbar. |
|
toolbar_position |
The index of the changed toolbar in |
|
user_data |
user data set when the signal handler was connected. |
Flags: Run Last
“toolbar-removed”
signalvoid user_function (ExoToolbarsModel *model, gint toolbar_position, gpointer user_data)
This signal is emitted whenever a toolbar is removed from model
.
model |
The ExoToolbarsModel |
|
toolbar_position |
The index of the toolbar in |
|
user_data |
user data set when the signal handler was connected. |
Flags: Run Last