LibMB 1.12
mbdotdesktop.h
1#ifndef _MBDOTDESKTOP_H_
2#define _MBDOTDESKTOP_H_
3
4#include <stdio.h>
5#include <stdlib.h>
6#include <string.h>
7#include <unistd.h>
8#include <locale.h>
9#include <ctype.h>
10#include <sys/types.h>
11#include <sys/stat.h>
12#include <dirent.h>
13
14#include <libmb/mbconfig.h>
15#include <libmb/mbutil.h>
16
17#ifdef __cplusplus
18extern "C" {
19#endif
20
34
35typedef struct _mbdotdesktopfolderentry
36{
37 unsigned char *name;
38 unsigned char *icon;
39 unsigned char *match;
40
41 struct _mbdotdesktopfolderentry *parent_entry;
42 struct _mbdotdesktopfolderentry *next_entry;
43
44} MBDotDesktopFolderEntry;
45
46
47typedef struct _mbdotdesktopfolders
48{
49 struct _mbdotdesktopfolderentry *entries;
50 int n_entries;
51
52} MBDotDesktopFolders;
53
61mb_dotdesktop_new_from_file(const char *filename);
62
70unsigned char *
72
79char *
81
89char *
91
97void
99
109char*
111 int size_wanted,
112 char* icon_name);
113
114
126MBDotDesktopFolders *mb_dot_desktop_folders_new(const char *vfolder_path);
127
133void mb_dot_desktop_folders_free(MBDotDesktopFolders* folders);
134
139#define mb_dot_desktop_folders_get_cnt(f) (f)->n_entries
140
146#define mb_dot_desktop_folders_enumerate(ddfolders, ddentry) \
147 for ( (ddentry) = (ddfolders)->entries; \
148 (ddentry) != NULL; \
149 (ddentry) = (ddentry)->next_entry ) \
150
155#define mb_dot_desktop_folder_entry_get_name(f) (f)->name
156
161#define mb_dot_desktop_folder_entry_get_icon(f) (f)->icon
162
167#define mb_dot_desktop_folder_entry_get_match(f) (f)->match
168
169#ifdef __cplusplus
170}
171#endif
172
173
177#endif
void mb_dot_desktop_folders_free(MBDotDesktopFolders *folders)
Frees a dotdesktopfolders instance.
MBDotDesktopFolders * mb_dot_desktop_folders_new(const char *vfolder_path)
Parses a 'vfolder style' directory of .directory entrys used for building simple hireachies of ....
char * mb_dotdesktop_get_exec(MBDotDesktop *dd)
Get the Exec key from a MBDotDesktop instance, with the %-escapes expanded.
unsigned char * mb_dotdesktop_get(MBDotDesktop *dd, char *key)
Gets the localised value for a specified key in MBDotDesktop instance.
struct MBDotDesktop MBDotDesktop
Opaque type used for representing a parsed .desktop file.
MBDotDesktop * mb_dotdesktop_new_from_file(const char *filename)
Parses a .desktop file and creates a localised MBDotDesktop instance.
void mb_dotdesktop_free(MBDotDesktop *dd)
Free's a MBDotDesktop instance.
char * mb_dotdesktop_get_filename(MBDotDesktop *dd)
Gets the filename from MBDotDesktop instance.
char * mb_dot_desktop_icon_get_full_path(char *theme_name, int size_wanted, char *icon_name)
Gets the full path for an specified icon.