summaryrefslogtreecommitdiff
path: root/libmenu/entry-directories.h
blob: c1d159a7da6d4086f7f520ffb9b246ab7a731448 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
/*
 * Copyright (C) 2002 - 2004 Red Hat, Inc.
 *
 * This library is free software; you can redistribute it and/or
 * modify it under the terms of the GNU Lesser General Public
 * License as published by the Free Software Foundation; either
 * version 2 of the License, or (at your option) any later version.
 *
 * This library is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
 * Lesser General Public License for more details.
 *
 * You should have received a copy of the GNU Lesser General Public
 * License along with this library; if not, write to the
 * Free Software Foundation, Inc., 51 Franklin St, Fifth Floor,
 * Boston, MA 02110-1301, USA.
 */

#ifndef __ENTRY_DIRECTORIES_H__
#define __ENTRY_DIRECTORIES_H__

#include <glib.h>
#include "desktop-entries.h"

G_BEGIN_DECLS

typedef struct EntryDirectory EntryDirectory;

typedef void (*EntryDirectoryChangedFunc) (EntryDirectory* ed, gpointer user_data);

EntryDirectory* entry_directory_new(DesktopEntryType entry_type, const char* path);
EntryDirectory* entry_directory_new_legacy(DesktopEntryType entry_type, const char* path, const char* legacy_prefix);

EntryDirectory* entry_directory_ref(EntryDirectory* ed);
void entry_directory_unref(EntryDirectory* ed);

void entry_directory_get_flat_contents(EntryDirectory* ed, DesktopEntrySet* desktop_entries, DesktopEntrySet* directory_entries, GSList** subdirs);


typedef struct EntryDirectoryList EntryDirectoryList;

EntryDirectoryList* entry_directory_list_new(void);
EntryDirectoryList* entry_directory_list_ref(EntryDirectoryList* list);
void entry_directory_list_unref(EntryDirectoryList* list);

int  entry_directory_list_get_length(EntryDirectoryList* list);
gboolean _entry_directory_list_compare(const EntryDirectoryList* a, const EntryDirectoryList* b);

void entry_directory_list_prepend(EntryDirectoryList* list, EntryDirectory* ed);
void entry_directory_list_append_list(EntryDirectoryList* list, EntryDirectoryList* to_append);

void entry_directory_list_add_monitors(EntryDirectoryList* list, EntryDirectoryChangedFunc callback, gpointer user_data);
void entry_directory_list_remove_monitors(EntryDirectoryList* list, EntryDirectoryChangedFunc callback, gpointer user_data);

DesktopEntry* entry_directory_list_get_directory (EntryDirectoryList* list, const char* relative_path);

DesktopEntrySet* _entry_directory_list_get_all_desktops(EntryDirectoryList* list);
void _entry_directory_list_empty_desktop_cache(void);

G_END_DECLS

#endif /* __ENTRY_DIRECTORIES_H__ */