Example #1
0
static void
panel_addto_prepend_alias (GSList         **parent_list,
			   MateMenuTreeAlias  *alias,
			   const char      *filename)
{
	MateMenuTreeItem *aliased_item;

	aliased_item = matemenu_tree_alias_get_item (alias);

	switch (matemenu_tree_item_get_type (aliased_item)) {
	case MATEMENU_TREE_ITEM_DIRECTORY:
		panel_addto_prepend_directory (parent_list,
					       MATEMENU_TREE_DIRECTORY (aliased_item),
					       filename);
		break;

	case MATEMENU_TREE_ITEM_ENTRY:
		panel_addto_prepend_entry (parent_list,
					   MATEMENU_TREE_ENTRY (aliased_item),
					   filename);
		break;

	default:
		break;
	}

	matemenu_tree_item_unref (aliased_item);
}
Example #2
0
static void
create_menuitem_from_alias (GtkWidget      *menu,
			    MateMenuTreeAlias *alias)
{
	MateMenuTreeItem *aliased_item;

	aliased_item = matemenu_tree_alias_get_item (alias);

	switch (matemenu_tree_item_get_type (aliased_item)) {
	case MATEMENU_TREE_ITEM_DIRECTORY:
		create_submenu (menu,
				MATEMENU_TREE_DIRECTORY (aliased_item),
				matemenu_tree_alias_get_directory (alias));
		break;

	case MATEMENU_TREE_ITEM_ENTRY:
		create_menuitem (menu,
				 MATEMENU_TREE_ENTRY (aliased_item),
				 matemenu_tree_alias_get_directory (alias));
		break;

	default:
		break;
	}

	matemenu_tree_item_unref (aliased_item);
}
Example #3
0
static void
add_drawers_from_alias (MateMenuTreeAlias *alias,
			const char     *toplevel_id)
{
	MateMenuTreeItem *aliased_item;

	aliased_item = matemenu_tree_alias_get_item (alias);

	switch (matemenu_tree_item_get_type (aliased_item)) {
	case MATEMENU_TREE_ITEM_DIRECTORY:
		add_drawers_from_dir (MATEMENU_TREE_DIRECTORY (aliased_item),
				      G_MAXINT/2,
				      toplevel_id);
		break;

	case MATEMENU_TREE_ITEM_ENTRY:
		panel_launcher_create_with_id (toplevel_id,
					       G_MAXINT/2,
					       matemenu_tree_entry_get_desktop_file_path (MATEMENU_TREE_ENTRY (aliased_item)));
		break;

	default:
		break;
	}

	matemenu_tree_item_unref (aliased_item);
}
Example #4
0
static GSList *
get_all_applications_from_alias (MateMenuTreeAlias *alias,
				 GSList         *list)
{
	MateMenuTreeItem *aliased_item;

	aliased_item = matemenu_tree_alias_get_item (alias);

	switch (matemenu_tree_item_get_type (aliased_item)) {
	case MATEMENU_TREE_ITEM_ENTRY:
		list = g_slist_append (list, matemenu_tree_item_ref (aliased_item));
		break;

	case MATEMENU_TREE_ITEM_DIRECTORY:
		list = get_all_applications_from_dir (MATEMENU_TREE_DIRECTORY (aliased_item),
						      list);
		break;

	default:
		break;
	}

	matemenu_tree_item_unref (aliased_item);

	return list;
}