Top | ![]() |
![]() |
![]() |
![]() |
void | (*FmFileMenuUpdatePopup) () |
void | fm_file_menu_destroy () |
GtkActionGroup * | fm_file_menu_get_action_group () |
FmPath * | fm_file_menu_get_cwd () |
FmFileInfoList * | fm_file_menu_get_file_info_list () |
GtkMenu * | fm_file_menu_get_menu () |
GtkUIManager * | fm_file_menu_get_ui () |
gboolean | fm_file_menu_is_single_file_type () |
FmFileMenu * | fm_file_menu_new_for_file () |
FmFileMenu * | fm_file_menu_new_for_files () |
void | fm_file_menu_set_folder_func () |
#define | FM_MODULE_gtk_menu_mime_VERSION |
FmFileMenu | |
struct | FmFileMenuMimeAddonInit |
extern FmFileMenuMimeAddonInit | fm_module_init_gtk_menu_mime |
include
: libfm/fm-gtk.h
The FmFileMenu can be used to create context menu on some file(s).
The menu consists of items:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 |
Open <placeholder name='ph1'/> ------------------------ <placeholder name='ph2'/> ------------------------ AddBookmark <placeholder name='SendToCategory'/> ------------------------ Cut Copy Paste Del CopyPath <placeholder name='MoveCategory'/> ------------------------ Rename ------------------------ <placeholder name='ph3'/> ------------------------ Prop |
You can modity the menu replacing placeholders. Note that internally the menu constructor also puts some conditional elements into those placeholders:
ph2: 'OpenWith' list+selector (optionally in submenu 'OpenWithMenu');
SendToCategory: elements of category 'Send To':
'Compress' if there is archiver defined;
'Extract' if this is an archive
MoveCategory: 'Hide' or 'Unhide' if the attribute is changeable.
Element 'AddBookmark' is visible only if menu is created for one directory. Element 'Rename' is hidden if menu is created for more than one file or if that file cannot be renamed. Element 'Paste' is visible only if menu is created for one directory and that directory is writable.
void (*FmFileMenuUpdatePopup) (GtkWindow *window
,GtkUIManager *ui
,GString *xml
,GtkActionGroup *act_grp
,FmFileMenu *menu
,FmFileInfoList *files
,gboolean single_file
);
The callback to update popup menu. It can disable items of menu, add some new, replace actions, etc. depending of the window and files.
void
fm_file_menu_destroy (FmFileMenu *menu
);
Destroys menu object.
Since: 0.1.0
GtkActionGroup *
fm_file_menu_get_action_group (FmFileMenu *menu
);
Retrieves action group for menu
. Returned data are owned by
menu
and should be not freed by caller.
Since: 0.1.0
FmPath *
fm_file_menu_get_cwd (FmFileMenu *menu
);
Retrieves working directory menu
was created for. Returned data are owned
by menu
and should be not freed by caller.
Since: 1.3.0
FmFileInfoList *
fm_file_menu_get_file_info_list (FmFileMenu *menu
);
Retrieves list of files menu
was created for. Returned data are owned
by menu
and should be not freed by caller.
Since: 0.1.0
GtkMenu *
fm_file_menu_get_menu (FmFileMenu *menu
);
Retrieves GtkMenu widget built with GtkUIManager. Returned data are
owned by menu
and should be not freed by caller.
Since: 0.1.0
GtkUIManager *
fm_file_menu_get_ui (FmFileMenu *menu
);
Retrieves UI manager object for menu
. Returned data are owned by
menu
and should be not freed by caller.
Since: 0.1.0
gboolean
fm_file_menu_is_single_file_type (FmFileMenu *menu
);
Checks if menu
was created for files of the same type.
Since: 0.1.0
FmFileMenu * fm_file_menu_new_for_file (GtkWindow *parent
,FmFileInfo *fi
,FmPath *cwd
,gboolean auto_destroy
);
Creates new menu for the file.
parent |
window to place menu over |
|
fi |
target file |
|
cwd |
working directory |
|
auto_destroy |
|
Since: 0.1.0
FmFileMenu * fm_file_menu_new_for_files (GtkWindow *parent
,FmFileInfoList *files
,FmPath *cwd
,gboolean auto_destroy
);
Creates new menu for some files list.
parent |
window to place menu over |
|
files |
target files |
|
cwd |
working directory |
|
auto_destroy |
|
Since: 0.1.0
void fm_file_menu_set_folder_func (FmFileMenu *menu
,FmLaunchFolderFunc func
,gpointer user_data
);
Sets up function to open folders for menu
. Function will be called
if action 'Open' was activated for some folder.
Since: 0.1.0
struct FmFileMenuMimeAddonInit { void (*init)(void); void (*finalize)(void); FmFileMenuUpdatePopup update_file_menu_for_mime_type; };
The init
and finalize
callbacks are called on application start and exit.
The update_file_menu_for_mime_type
callback will be called each time
context menu is created for files that have the same context type.
This structure is used for "gtk_menu_mime" module initialization. The key for module of this type is content type (MIME name) to support. No wildcards are supported.
callback for plugin initialization. |
[allow-none] | |
callback to free resources allocated by |
[allow-none] | |
FmFileMenuUpdatePopup |
callback to update selection context menu. |
[allow-none] |
Since: 1.2.0