Top |
enum | MenuCacheType |
enum | MenuCacheShowFlag |
enum | MenuCacheItemFlag |
typedef | MenuCacheNotifyId |
MenuCache | |
MenuCacheApp | |
MenuCacheDir |
MenuCache *
menu_cache_lookup (const char *menu_name
);
Searches for connection to menu-cached for menu_name
. If there is no
such connection exist then creates new one. Caller can be notified
when cache is (re)loaded by adding callback. Caller should check if
the cache is already loaded trying to retrieve its root.
See also: menu_cache_add_reload_notify()
, menu_cache_item_dup_parent()
.
Since: 0.1.0
MenuCache *
menu_cache_lookup_sync (const char *menu_name
);
Searches for data from menu-cached for menu_name
. If no connection
exists yet then creates new one and retrieves all data.
Since: 0.3.1
MenuCache *
menu_cache_ref (MenuCache *cache
);
Increases reference counter on cache
.
Since: 0.1.0
void
menu_cache_unref (MenuCache *cache
);
Descreases reference counter on cache
. When reference count becomes 0
then resources associated with cache
will be freed.
Since: 0.1.0
gboolean
menu_cache_reload (MenuCache *cache
);
Reloads menu cache from file generated by menu-cached.
Since: 0.1.0
MenuCacheDir *
menu_cache_get_root_dir (MenuCache *cache
);
menu_cache_get_root_dir
has been deprecated since version 0.3.4 and should not be used in newly-written code.
Use menu_cache_dup_root_dir()
instead.
Since: 0.1.0
MenuCacheDir * menu_cache_get_dir_from_path (MenuCache *cache
,const char *path
);
menu_cache_get_dir_from_path
has been deprecated since version 0.3.4 and should not be used in newly-written code.
Use menu_cache_item_from_path()
instead.
Since: 0.1.0
MenuCacheDir *
menu_cache_dup_root_dir (MenuCache *cache
);
Retrieves root directory for cache
. Returned data should be freed
with menu_cache_item_unref()
after usage.
Since: 0.3.4
MenuCacheItem * menu_cache_item_from_path (MenuCache *cache
,const char *path
);
Searches item path
in the cache
. The path
consists of item IDs
separated by slash ('/'). Returned data should be freed with
menu_cache_item_unref()
after usage.
Since: 0.3.4
MenuCacheNotifyId menu_cache_add_reload_notify (MenuCache *cache
,MenuCacheReloadNotify func
,gpointer user_data
);
Adds a func
to list of callbacks that are called each time menu cache
is loaded.
cache |
a menu cache instance |
|
func |
callback to call when menu cache is reloaded |
|
user_data |
user data provided for |
Since: 0.1.0
void menu_cache_remove_reload_notify (MenuCache *cache
,MenuCacheNotifyId notify_id
);
Removes notify_id
from list of callbacks added for cache
by previous
call to menu_cache_add_reload_notify()
.
Since: 0.1.0
guint32 menu_cache_get_desktop_env_flag (MenuCache *cache
,const char *desktop_env
);
Makes bit mask of desktop environment from its name. The desktop_env
may be simple string or colon separated list of compatible session
names according to XDG_CURRENT_DESKTOP freedesktop.org specification.
Since: 0.2.0
MenuCacheItem *
menu_cache_item_ref (MenuCacheItem *item
);
Increases reference counter on item
.
Since: 0.1.0
gboolean
menu_cache_item_unref (MenuCacheItem *item
);
Decreases reference counter on item
. When reference count becomes 0
then resources associated with item
will be freed.
Since: 0.1.0
const char *
menu_cache_item_get_id (MenuCacheItem *item
);
Retrieves ID (short name such as 'application.desktop') of item
.
Returned data are owned by menu cache and should be not freed by caller.
Since: 0.1.0
const char *
menu_cache_item_get_name (MenuCacheItem *item
);
Retrieves display name of item
. Returned data are owned by menu
cache and should be not freed by caller.
Since: 0.1.0
const char *
menu_cache_item_get_comment (MenuCacheItem *item
);
Retrieves comment of item
. The comment can be used to show tooltip
on item
. Returned data are owned by menu cache and should be not
freed by caller.
Since: 0.1.0
const char *
menu_cache_item_get_icon (MenuCacheItem *item
);
Retrieves name of icon of item
. Returned data are owned by menu
cache and should be not freed by caller.
Since: 0.1.0
const char *
menu_cache_item_get_file_basename (MenuCacheItem *item
);
Retrieves basename of item
. This API can return NULL
if item
is a
directory and have no directory desktop entry file. Returned data are
owned by menu cache and should be not freed by caller.
Since: 0.2.0
const char *
menu_cache_item_get_file_dirname (MenuCacheItem *item
);
Retrieves path to directory where item
desktop enrty file is located.
This API can return NULL
if item
is a directory and have no
desktop entry file. Returned data are owned by menu cache and should
be not freed by caller.
Since: 0.2.0
char *
menu_cache_item_get_file_path (MenuCacheItem *item
);
Retrieves path to item
desktop enrty file. This API can return NULL
if item
is a directory and have no desktop entry file. Returned data
should be freed with g_free()
after usage.
Since: 0.2.0
MenuCacheDir *
menu_cache_item_get_parent (MenuCacheItem *item
);
menu_cache_item_get_parent
has been deprecated since version 0.3.4 and should not be used in newly-written code.
Use menu_cache_item_dup_parent()
instead.
Since: 0.1.0
GSList *
menu_cache_dir_get_children (MenuCacheDir *dir
);
menu_cache_dir_get_children
has been deprecated since version 0.4.0 and should not be used in newly-written code.
Use menu_cache_dir_list_children()
instead.
Retrieves list of items contained in dir
. Returned data are owned by
menu cache and should be not freed by caller.
This API is thread unsafe and should be never called from outside of
default main loop.
Since: 0.1.0
MenuCacheDir *
menu_cache_item_dup_parent (MenuCacheItem *item
);
Retrieves parent (directory) for item
. Returned data should be freed
with menu_cache_item_unref()
after usage.
Since: 0.3.4
GSList *
menu_cache_dir_list_children (MenuCacheDir *dir
);
Retrieves list of items contained in dir
. Returned data should be
freed with g_slist_free_full(list, menu_cache_item_unref) after usage.
Since: 0.4.0
MenuCacheItem * menu_cache_find_child_by_id (MenuCacheDir *dir
,const char *id
);
Checks if dir
has a child with given id
. Returned data should be
freed with menu_cache_item_unref()
when no longer needed.
Since: 0.5.0
MenuCacheItem * menu_cache_find_child_by_name (MenuCacheDir *dir
,const char *name
);
Checks if dir
has a child with given name
. Returned data should be
freed with menu_cache_item_unref()
when no longer needed.
Since: 0.5.0
char *
menu_cache_dir_make_path (MenuCacheDir *dir
);
Retrieves path of dir
. The path consists of item IDs separated by
slash ('/'). Returned data should be freed with g_free()
after usage.
Since: 0.1.0
const char *
menu_cache_app_get_generic_name (MenuCacheApp *app
);
Retrieves generic name for app
. Returned data are owned by menu
cache and should not be freed by caller.
Since: 1.0.3
const char *
menu_cache_app_get_exec (MenuCacheApp *app
);
Retrieves execution string for app
. Returned data are owned by menu
cache and should be not freed by caller.
Since: 0.1.0
const char *
menu_cache_app_get_working_dir (MenuCacheApp *app
);
Retrieves working directory for app
. Returned data are owned by menu
cache and should be not freed by caller.
Since: 0.1.0
const char * const *
menu_cache_app_get_categories (MenuCacheApp *app
);
Retrieves list of categories for app
. Returned data are owned by menu
cache and should be not freed by caller.
Since: 1.0.0
guint32
menu_cache_app_get_show_flags (MenuCacheApp *app
);
Retrieves list of desktop environments where app
should be visible.
Since: 0.2.0
gboolean menu_cache_app_get_is_visible (MenuCacheApp *app
,guint32 de_flags
);
Checks if app
should be visible in any of desktop environments
de_flags
.
Since: 0.2.0
gboolean
menu_cache_dir_is_visible (MenuCacheDir *dir
);
Checks if dir
should be visible.
Since: 0.5.0
gboolean
menu_cache_app_get_use_terminal (MenuCacheApp *app
);
Checks if app
should be ran in terminal.
Since: 0.1.0
gboolean
menu_cache_app_get_use_sn (MenuCacheApp *app
);
Checks if app
wants startup notification.
Since: 0.1.0
GSList *
menu_cache_list_all_apps (MenuCache *cache
);
Retrieves full list of applications in menu cache. Returned list should be freed with g_slist_free_full(list, menu_cache_item_unref) after usage.
Since: 0.1.2
GSList * menu_cache_list_all_for_category (MenuCache *cache
,const char *category
);
Retrieves list of applications in menu cache which have category
in
their list of categories. The search is case-sensitive. Returned list
should be freed with g_slist_free_full(list, menu_cache_item_unref)
after usage.
Since: 1.0.0
GSList * menu_cache_list_all_for_keyword (MenuCache *cache
,const char *keyword
);
Retrieves list of applications in menu cache which have a keyword
as either a word or part of word in exec command, name, generic name
or defined keywords. The search is case-insensitive. Returned list
should be freed with g_slist_free_full(list, menu_cache_item_unref)
after usage.
Since: 1.0.0
MenuCacheItem * menu_cache_find_item_by_id (MenuCache *cache
,const char *id
);
Searches if id
already exists within cache
and returns found item.
Returned data should be freed with menu_cache_item_unref()
after usage.
Since: 0.5.0
type of MenuCacheItem.