Top |
gboolean | ensure-standard | Read / Write / Construct |
GStrv | forbidden-emblems | Read / Write / Construct |
gpointer | mapped-files | Read / Write / Construct |
gboolean | modified | Read / Write / Construct |
gboolean | reveal-changes | Read / Write / Construct |
#define | GNUI_TYPE_EMBLEM_PICKER |
enum | GnuiEmblemState |
enum | GnuiEmblemPickerSaveFlags |
enum | GnuiEmblemPickerSaveResult |
GnuiEmblemPicker |
GnuiEmblemPicker implements GtkAccessible, GtkBuildable and GtkConstraintTarget.
The GnuiEmblemPicker
widget allows interactively to manipulate the emblem
metadata of one or more files, providing support for inconsistent states.
gboolean (*GnuiEmblemPickerForeachFunc) (GnuiEmblemPicker *self
,const gchar *emblem_name
,GnuiEmblemState saved_state
,GnuiEmblemState current_state
,const GList *inconsistent_group
,gpointer user_data
);
A callback function type for gnui_emblem_picker_foreach()
self |
The emblem picker. |
[auto][not nullable] |
emblem_name |
The emblem's name. |
[auto][not nullable] |
saved_state |
The last saved state of the emblem. |
[auto] |
current_state |
The current state of the emblem. |
[auto] |
inconsistent_group |
The inconsistent
group of |
[auto][transfer none][nullable] |
user_data |
The custom data provided by the user. |
[auto][nullable][closure] |
gboolean (*GnuiEmblemPickerForeachSavedFileFunc) (GFile *location
,const gchar * const *added_emblems
,const gchar * const *removed_emblems
,GnuiEmblemPickerSaveResult result
,const GError *error
,gpointer user_data
);
A callback function type for each saved file
location |
The file for which the function is being called. |
[auto][not nullable] |
added_emblems |
The emblems added to
the file, or |
[auto][transfer none][nullable] |
removed_emblems |
The emblems removed
from the file, or |
[auto][transfer none][nullable] |
result |
The result of the save operation. |
[auto] |
error |
The error. |
[auto][transfer none][nullable] |
user_data |
The custom data provided by the user. |
[auto][nullable][closure] |
GtkWidget * gnui_emblem_picker_new (GList * const file_selection
,const gboolean enforce_xdg
,const gchar * const * const forbidden_emblems
);
Create a new emblem picker widget
For the list of XDG standard emblems, please refer to Icon Naming Specification, Table 6. Standard Emblem Icons.
file_selection |
A |
[transfer none][nullable] |
enforce_xdg |
If |
|
forbidden_emblems |
The emblems to exclude. |
[transfer none][nullable] |
gboolean gnui_emblem_picker_save (GnuiEmblemPicker * const self
,const GnuiEmblemPickerForeachSavedFileFunc for_each_file
,const GnuiEmblemPickerSaveFlags flags
,GCancellable * const cancellable
,GError ** const error
,const gpointer for_each_data
);
Save the emblems currently selected into the files' metadata
self |
The emblem picker. |
[not nullable] |
for_each_file |
A function to call for each saved file
according to the conditions expressed by the |
[nullable] |
flags |
Save options flags |
|
cancellable |
A |
[nullable] |
error |
A |
[nullable] |
for_each_data |
The custom data to pass to |
[nullable] |
void
gnui_emblem_picker_refresh_states (GnuiEmblemPicker * const self
);
Refresh the emblem picker's indicator glyphs
This function is useless unless you have just invoked
with
gnui_emblem_picker_save()
GNUI_EMBLEM_PICKER_SAVE_FLAG_DONT_REFRESH
.
gboolean gnui_emblem_picker_toggle_emblem (GnuiEmblemPicker * const self
,const gchar * const emblem_name
);
Toggle/untoggle an emblem picker's emblem
This function behaves exactly like toggling/untoggling an emblem via user input.
gboolean gnui_emblem_picker_set_emblem_state (GnuiEmblemPicker * const self
,const gchar * const emblem_name
,const GnuiEmblemState state
,const gboolean add_if_missing
);
Toggle/untoggle an emblem picker's emblem
When add_if_missing
is set to false this function behaves exactly like
toggling/untoggling an emblem via user input.
const GList *
gnui_emblem_picker_peek_mapped_files (GnuiEmblemPicker * const self
);
Get the const
list of the files mapped by an emblem picker
[get-property mapped-files]
GList *
gnui_emblem_picker_get_mapped_files (GnuiEmblemPicker * const self
);
Get the list of the files mapped by an emblem picker
void gnui_emblem_picker_set_mapped_files (GnuiEmblemPicker * const self
,const GList * const file_selection
);
Set the list of the files mapped by an emblem picker
Changing the emblem picker's files is similar to starting a new session (i.e. creating a new emblem picker). The current emblem selection will be lost.
[set-property mapped-files]
const gchar * const *
gnui_emblem_picker_peek_forbidden_emblems
(GnuiEmblemPicker * const self
);
Get the const
array of strings of the emblems that must not be displayed
in the emblem picker
[get-property forbidden-emblems]
gchar **
gnui_emblem_picker_get_forbidden_emblems
(GnuiEmblemPicker * const self
);
Get the emblems that must not be displayed in the emblem picker
A newly allocated array of strings containing
the names of the emblems that must not be displayed in the
emblem picker (free the returned array with
). g_strfreev()
[transfer full]
void gnui_emblem_picker_set_forbidden_emblems (GnuiEmblemPicker * const self
,const gchar * const * const forbidden_emblems
);
Set the emblems that must not be displayed in the emblem picker
[set-property forbidden-emblems]
gboolean
gnui_emblem_picker_get_ensure_standard
(GnuiEmblemPicker * const self
);
Get whether XDG standard emblems must always be displayed, even if the current icon theme does not support them
For the list of XDG standard emblems, please refer to Icon Naming Specification, Table 6. Standard Emblem Icons.
[get-property ensure-standard]
void gnui_emblem_picker_set_ensure_standard (GnuiEmblemPicker * const self
,gboolean ensure_standard
);
Set whether XDG standard emblems must always be displayed, even if the current icon theme does not support them
For the list of XDG standard emblems, please refer to Icon Naming Specification, Table 6. Standard Emblem Icons.
[set-property ensure-standard]
gboolean
gnui_emblem_picker_get_modified (GnuiEmblemPicker * const self
);
Get whether the emblem selection has been modified by the user
[get-property modified]
void gnui_emblem_picker_set_modified (GnuiEmblemPicker * const self
,gboolean modified
);
Set whether the emblem selection has been modified by the user
[set-property modified]
gboolean
gnui_emblem_picker_get_reveal_changes (GnuiEmblemPicker * const self
);
Get whether an indicator glyph must be displayed for each emblem whose selection state has changed since last save
[get-property reveal-changes]
void gnui_emblem_picker_set_reveal_changes (GnuiEmblemPicker * const self
,const gboolean reveal_changes
);
Set whether an indicator glyph must be displayed for each emblem whose selection state has changed since last save
[set-property reveal-changes]
void gnui_emblem_picker_foreach (GnuiEmblemPicker * const self
,const GnuiEmblemPickerForeachFunc foreach_func
,const gpointer user_data
);
Call a custom function for each emblem displayed by the emblem picker
void
gnui_emblem_picker_undo_all_selections
(GnuiEmblemPicker * const self
);
Bring an emblem picker selection state back to the last saved state
void gnui_emblem_picker_set_all_selections (GnuiEmblemPicker * const self
,const gboolean selected
);
Set the selection state of all the emblems of an emblem picker
void (*GnuiEmblemPickerSignalHandlerEmblemSelected) (GnuiEmblemPicker *self
,const gchar *emblem_name
,GnuiEmblemState saved_state
,GnuiEmblemState current_state
,const GList *inconsistent_group
,gpointer user_data
);
A handler function type for the “emblem-selected” signal
self |
The emblem picker. |
[auto][not nullable] |
emblem_name |
The emblem name. |
[auto][transfer none][not nullable] |
saved_state |
(auto) The last saved state of the emblem |
|
current_state |
(auto) The current state of the emblem |
|
inconsistent_group |
The
inconsistent group of |
[auto][transfer none][nullable] |
user_data |
The custom data passed to the signal. |
[auto][nullable][closure] |
void (*GnuiEmblemPickerSignalHandlerModifiedChanged) (GnuiEmblemPicker *self
,gboolean modified
,gpointer user_data
);
A handler function type for the “modified-changed” signal
#define GNUI_TYPE_EMBLEM_PICKER (gnui_emblem_picker_get_type())
The GType
of GnuiEmblemPicker
Possible options for gnui_emblem_picker_save()
No flags |
||
Re-write the files' metadata even if there are no changes |
||
Stop the save operations as soon as a file cannot be saved (without it the save operations will continue until the end) |
||
Do not refresh the state indicators (useful if this is a last save before destroying the emblem picker widget) |
||
Erase the information about the emblem's original inconsistency if this is not saved as inconsistent |
||
Invoke the user-given callback on errors |
||
Invoke the user-given callback when the file was successfully updated with the new emblems |
||
Invoke the user-given callback when no actions were performed on the file |
||
Always invoke the user-given callback, no matter what the save result is |
||
Convenience identifier in which all flags are set |
“ensure-standard”
property“ensure-standard” gboolean
Whether to ensure XDG emblems, even when not supported by the current theme.
Owner: GnuiEmblemPicker
Flags: Read / Write / Construct
Default value: FALSE
“forbidden-emblems”
property“forbidden-emblems” GStrv
Array of strings containing the names of the emblems to ignore.
[transfer none]
Owner: GnuiEmblemPicker
Flags: Read / Write / Construct
“mapped-files”
property“mapped-files” gpointer
GList of GFile objects to map.
[transfer none]
Owner: GnuiEmblemPicker
Flags: Read / Write / Construct
“modified”
property“modified” gboolean
Whether the emblems have changed since last save.
Owner: GnuiEmblemPicker
Flags: Read / Write / Construct
Default value: FALSE
“reveal-changes”
property“reveal-changes” gboolean
Whether changes since last save must be visible.
Owner: GnuiEmblemPicker
Flags: Read / Write / Construct
Default value: FALSE
“emblem-selected”
signalvoid user_function (GnuiEmblemPicker *self, char *emblem_name, int saved_state, int current_state, gpointer inconsistent_group, gpointer user_data)
Signal emitted when an emblem is selected/unselected
GnuiEmblemPickerSignalHandlerEmblemSelected is the function type of reference for this signal, which takes parameters' constness into account.
self |
The emblem picker that emitted the signal. |
[auto][non-nullable] |
emblem_name |
The emblem name (do not free or modify it). |
[auto][transfer none][non-nullable] |
saved_state |
The last saved state of the emblem. |
[auto] |
current_state |
The current state of the emblem. |
[auto] |
inconsistent_group |
The
inconsistent group of files that can have the
emblem assigned independently from the other
files or |
[auto][transfer none][nullable] |
user_data |
user data set when the signal handler was connected. |
Flags: Run First
“modified-changed”
signalvoid user_function (GnuiEmblemPicker *self, gboolean modified, gpointer user_data)
Signal emitted when the “modified” property changes
GnuiEmblemPickerSignalHandlerModifiedChanged is the function type of reference for this signal, which takes parameters' constness into account.
self |
The emblem picker that emitted the signal. |
[auto][non-nullable] |
modified |
The new value of the “modified” property. |
[auto] |
user_data |
user data set when the signal handler was connected. |
Flags: Run First