2007-02-03 05:05:30 -08:00
|
|
|
#include <Efreet.h>
|
|
|
|
#include <stdio.h>
|
2010-01-04 18:15:41 -08:00
|
|
|
#include <limits.h>
|
2008-05-06 19:16:50 -07:00
|
|
|
#include "ef_test.h"
|
2007-02-03 05:05:30 -08:00
|
|
|
|
|
|
|
static void dump(Efreet_Menu *menu, const char *path);
|
|
|
|
|
|
|
|
int
|
2008-05-06 19:16:50 -07:00
|
|
|
main(int argc __UNUSED__, char **argv __UNUSED__)
|
2007-02-03 05:05:30 -08:00
|
|
|
{
|
|
|
|
Efreet_Menu *menu;
|
|
|
|
|
|
|
|
if (!efreet_init())
|
|
|
|
{
|
|
|
|
fprintf(stderr, "Failed to init Efreet\n");
|
|
|
|
return 1;
|
|
|
|
}
|
|
|
|
|
|
|
|
menu = efreet_menu_get();
|
|
|
|
if (!menu)
|
|
|
|
{
|
|
|
|
fprintf(stderr, "Failed to read menu\n");
|
|
|
|
return 1;
|
|
|
|
}
|
|
|
|
|
|
|
|
dump(menu, "");
|
|
|
|
|
|
|
|
efreet_menu_free(menu);
|
|
|
|
efreet_shutdown();
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
|
|
|
dump(Efreet_Menu *menu, const char *path)
|
|
|
|
{
|
|
|
|
Efreet_Menu *entry;
|
* estickies,
* etk,
* PROTO/exalt,
* E-MODULES-EXTRA/diskio,
* E-MODULES-EXTRA/drawer,
* E-MODULES-EXTRA/penguins,
* E-MODULES-EXTRA/slideshow,
* E-MODULES-EXTRA/mail,
* E-MODULES-EXTRA/forecasts,
* E-MODULES-EXTRA/iiirk,
* E-MODULES-EXTRA/places,
* e,
* ewl,
* ecore,
* elitaire,
* entrance,
* e_dbus,
* efreet: Here we go, move from Ecore_List to Eina_List.
NOTE: This patch is huge, I did test it a lot, and I hope nothing is
broken. But if you think something change after this commit, please
contact me ASAP.
SVN revision: 39200
2009-02-25 03:03:47 -08:00
|
|
|
Eina_List *l;
|
2007-02-03 05:05:30 -08:00
|
|
|
|
|
|
|
if (!menu || !menu->entries) return;
|
|
|
|
|
* estickies,
* etk,
* PROTO/exalt,
* E-MODULES-EXTRA/diskio,
* E-MODULES-EXTRA/drawer,
* E-MODULES-EXTRA/penguins,
* E-MODULES-EXTRA/slideshow,
* E-MODULES-EXTRA/mail,
* E-MODULES-EXTRA/forecasts,
* E-MODULES-EXTRA/iiirk,
* E-MODULES-EXTRA/places,
* e,
* ewl,
* ecore,
* elitaire,
* entrance,
* e_dbus,
* efreet: Here we go, move from Ecore_List to Eina_List.
NOTE: This patch is huge, I did test it a lot, and I hope nothing is
broken. But if you think something change after this commit, please
contact me ASAP.
SVN revision: 39200
2009-02-25 03:03:47 -08:00
|
|
|
EINA_LIST_FOREACH(menu->entries, l, entry)
|
2007-02-03 05:05:30 -08:00
|
|
|
{
|
|
|
|
if (entry->type == EFREET_MENU_ENTRY_DESKTOP)
|
|
|
|
{
|
|
|
|
if (!path || !*path) path = "/";
|
2007-09-06 09:15:10 -07:00
|
|
|
printf("%s\t%s\t%s\n", path, entry->id,
|
2007-02-03 05:05:30 -08:00
|
|
|
entry->desktop->orig_path);
|
|
|
|
}
|
|
|
|
else if (entry->type == EFREET_MENU_ENTRY_MENU)
|
|
|
|
{
|
|
|
|
char new_path[PATH_MAX];
|
|
|
|
|
2009-12-23 12:55:23 -08:00
|
|
|
snprintf(new_path, sizeof(new_path), "%s%s/", path, entry->name);
|
2007-02-03 05:05:30 -08:00
|
|
|
dump(entry, new_path);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|