00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024 #ifndef __LIBMENU_H__
00025 #define __LIBMENU_H__
00026
00027 #include <libxml/xmlreader.h>
00028 #include <gtk/gtk.h>
00029 #include <libintl.h>
00030
00031 G_BEGIN_DECLS
00032
00033
00034 #define DESKTOP_ENTRY_TYPE_FIELD "Type"
00035 #define DESKTOP_ENTRY_ICON_FIELD "Icon"
00036 #define DESKTOP_ENTRY_NAME_FIELD "Name"
00037 #define DESKTOP_ENTRY_COMMENT_FIELD "Comment"
00038 #define DESKTOP_ENTRY_EXEC_FIELD "Exec"
00039 #define DESKTOP_ENTRY_SERVICE_FIELD "X-Osso-Service"
00040 #define DESKTOP_ENTRY_TEXT_DOMAIN_FIELD "X-Text-Domain"
00041
00042 #define SEPARATOR_STRING "SEPARATOR"
00043 #define EXTRAS_MENU_STRING "tana_fi_extras"
00044
00045
00046 #define DEFAULT_APPS_DIR "/usr/share/applications/"
00047 #define ICON_FAVOURITES "qgn_list_gene_favor"
00048 #define ICON_FOLDER "qgn_list_filesys_common_fldr"
00049
00050 #define ICON_DEFAULT_APP "qgn_list_gene_default_app"
00051 #define ICON_SIZE 26
00052
00053 #define ICON_THUMB_SIZE 64
00054
00055 #define EMBLEM_EXPANDER_OPEN "qgn_list_gene_fldr_exp"
00056 #define EMBLEM_EXPANDER_CLOSED "qgn_list_gene_fldr_clp"
00057
00058
00059 #define FAVOURITES_LOGICAL_STRING "tncpa_li_of_favourites"
00060 #define FAVOURITES_NAME dgettext("osso-applet-tasknavigator", FAVOURITES_LOGICAL_STRING)
00061
00062
00063 #define SYSTEMWIDE_MENU_FILE "/etc/xdg/menus/applications.menu"
00064
00065
00066 #define USER_MENU_FILE ".osso/menus/applications.menu"
00067
00068
00069
00070 enum {
00071 TREE_MODEL_NAME = 0,
00072 TREE_MODEL_ICON,
00073 TREE_MODEL_THUMB_ICON,
00074 TREE_MODEL_EMBLEM_EXPANDER_OPEN,
00075 TREE_MODEL_EMBLEM_EXPANDER_CLOSED,
00076 TREE_MODEL_EXEC,
00077 TREE_MODEL_SERVICE,
00078 TREE_MODEL_DESKTOP_ID,
00079 TREE_MODEL_COMMENT,
00080 TREE_MODEL_TEXT_DOMAIN,
00081 TREE_MODEL_COLUMNS
00082 };
00083
00084
00085 enum {
00086 USER_MENU = 0,
00087 SYSTEMWIDE_MENU,
00088 MENU_TYPES
00089 };
00090
00091
00092
00093
00094 GdkPixbuf *get_icon(const char *icon_name, int icon_size);
00095
00096
00097 GdkPixbuf *get_icon_with_fallback(const char *icon_name,
00098 int icon_size,
00099 GdkPixbuf *fallback);
00100
00101
00102
00103 GtkTreeModel *get_menu_contents(void);
00104
00105
00106
00107
00108
00109
00110
00111
00112 void find_first_and_last_root_level_folders( GtkTreeModel *model,
00113 GtkTreePath **first_folder, GtkTreePath **last_folder );
00114
00115
00116
00117
00118
00119
00120
00121 gboolean set_separators( GtkTreeModel *model );
00122
00123
00124 gboolean set_menu_contents( GtkTreeModel *model );
00125
00126 G_END_DECLS
00127
00128 #endif