LibMB 1.12
Freedesktop Standards utilitys

Micro implementations of Freedesktop.org standards for .desktop files, icon themeing and vfolders. More...

Macros

#define mb_dot_desktop_folders_get_cnt(f)
 Gets a count of .directory entrys ( folders ) in an #MBDotDesktopFolder .
 
#define mb_dot_desktop_folders_enumerate(ddfolders, ddentry)
 Enumerates the MBDotDesktopFolderEntry entrys in a MBDotDesktopFolders struct.
 
#define mb_dot_desktop_folder_entry_get_name(f)
 Gets the name of a MBDotDesktopFolderEntry.
 
#define mb_dot_desktop_folder_entry_get_icon(f)
 Gets the icon filename ( not path ) of a MBDotDesktopFolderEntry.
 
#define mb_dot_desktop_folder_entry_get_match(f)
 Gets the categorie match string of a MBDotDesktopFolderEntry.
 

Typedefs

typedef struct MBDotDesktop MBDotDesktop
 Opaque type used for representing a parsed .desktop file.
 

Functions

MBDotDesktopmb_dotdesktop_new_from_file (const char *filename)
 Parses a .desktop file and creates a localised MBDotDesktop instance.
 
unsigned char * mb_dotdesktop_get (MBDotDesktop *dd, char *key)
 Gets the localised value for a specified key in MBDotDesktop instance.
 
char * mb_dotdesktop_get_filename (MBDotDesktop *dd)
 Gets the filename from MBDotDesktop instance.
 
char * mb_dotdesktop_get_exec (MBDotDesktop *dd)
 Get the Exec key from a MBDotDesktop instance, with the %-escapes expanded.
 
void mb_dotdesktop_free (MBDotDesktop *dd)
 Free's a 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.
 
MBDotDesktopFolders * mb_dot_desktop_folders_new (const char *vfolder_path)
 Parses a 'vfolder style' directory of .directory entrys used for building simple hireachies of .desktop files.
 
void mb_dot_desktop_folders_free (MBDotDesktopFolders *folders)
 Frees a dotdesktopfolders instance.
 

Detailed Description

Micro implementations of Freedesktop.org standards for .desktop files, icon themeing and vfolders.

Function Documentation

◆ mb_dot_desktop_folders_free()

void mb_dot_desktop_folders_free ( MBDotDesktopFolders * folders)

Frees a dotdesktopfolders instance.

Parameters
foldersdotdesktopfolders instance

◆ mb_dot_desktop_folders_new()

MBDotDesktopFolders * mb_dot_desktop_folders_new ( const char * vfolder_path)

Parses a 'vfolder style' directory of .directory entrys used for building simple hireachies of .desktop files.

Expect a directory containing a root.order file, which lists a .directory file per line. Each of these entry in then parsed in the specified order as a MBDotDesktopFolderEntry instance.

Parameters
vfolder_pathpath to .directory files
Returns
A dotdesktopfolders object instance

◆ mb_dot_desktop_icon_get_full_path()

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.

The function allocates memory for the returned data, this should be freed by the caller.

Parameters
theme_namename of theme to get the icon for
size_wantedicon dimention wanted in pixels
icon_namethe filename
Returns
the full path to the found icon, or NULL on fail.

◆ mb_dotdesktop_free()

void mb_dotdesktop_free ( MBDotDesktop * dd)

Free's a MBDotDesktop instance.

Parameters
ddMBDotDesktop instance

◆ mb_dotdesktop_get()

unsigned char * mb_dotdesktop_get ( MBDotDesktop * dd,
char * key )

Gets the localised value for a specified key in MBDotDesktop instance.

Parameters
ddMBDotDesktop instance
keyrequested key.
Returns
values, NULL on fail

◆ mb_dotdesktop_get_exec()

char * mb_dotdesktop_get_exec ( MBDotDesktop * dd)

Get the Exec key from a MBDotDesktop instance, with the %-escapes expanded.

Unlike mb_dotdesktop_get(), this string needs to be free()d.

Parameters
ddMBDotDesktop instance
Returns
file name, NULL on fail

◆ mb_dotdesktop_get_filename()

char * mb_dotdesktop_get_filename ( MBDotDesktop * dd)

Gets the filename from MBDotDesktop instance.

Parameters
ddMBDotDesktop instance
Returns
filename of MBDotDesktop, NULL on fail

◆ mb_dotdesktop_new_from_file()

MBDotDesktop * mb_dotdesktop_new_from_file ( const char * filename)

Parses a .desktop file and creates a localised MBDotDesktop instance.

Parameters
filenamefull path to .desktop file
Returns
MBDotDesktop instance, NULL on fail