1 | /* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */ |
---|
2 | /* |
---|
3 | * Authors: |
---|
4 | * Chris Lahey <clahey@ximian.com> |
---|
5 | * |
---|
6 | * Copyright (C) 2000 Ximian, Inc. |
---|
7 | * Copyright (C) 1999 The Free Software Foundation |
---|
8 | */ |
---|
9 | |
---|
10 | #ifndef __E_LIST_H__ |
---|
11 | #define __E_LIST_H__ |
---|
12 | |
---|
13 | typedef struct _EList EList; |
---|
14 | typedef struct _EListClass EListClass; |
---|
15 | |
---|
16 | #include <stdio.h> |
---|
17 | #include <time.h> |
---|
18 | #include <gtk/gtkobject.h> |
---|
19 | #include <e-util/e-list-iterator.h> |
---|
20 | |
---|
21 | #define E_TYPE_LIST (e_list_get_type ()) |
---|
22 | #define E_LIST(obj) (GTK_CHECK_CAST ((obj), E_TYPE_LIST, EList)) |
---|
23 | #define E_LIST_CLASS(klass) (GTK_CHECK_CLASS_CAST ((klass), E_TYPE_LIST, EListClass)) |
---|
24 | #define E_IS_LIST(obj) (GTK_CHECK_TYPE ((obj), E_TYPE_LIST)) |
---|
25 | #define E_IS_LIST_CLASS(klass) (GTK_CHECK_CLASS_TYPE ((klass), E_TYPE_LIST)) |
---|
26 | |
---|
27 | typedef void *(*EListCopyFunc) (const void *data, void *closure); |
---|
28 | typedef void (*EListFreeFunc) (void *data, void *closure); |
---|
29 | |
---|
30 | struct _EList { |
---|
31 | GtkObject object; |
---|
32 | GList *list; |
---|
33 | GList *iterators; |
---|
34 | EListCopyFunc copy; |
---|
35 | EListFreeFunc free; |
---|
36 | void *closure; |
---|
37 | }; |
---|
38 | |
---|
39 | struct _EListClass { |
---|
40 | GtkObjectClass parent_class; |
---|
41 | }; |
---|
42 | |
---|
43 | EList *e_list_new (EListCopyFunc copy, |
---|
44 | EListFreeFunc free, |
---|
45 | void *closure); |
---|
46 | EList *e_list_duplicate (EList *list); |
---|
47 | EIterator *e_list_get_iterator (EList *list); |
---|
48 | void e_list_append (EList *list, |
---|
49 | const void *data); |
---|
50 | int e_list_length (EList *list); |
---|
51 | |
---|
52 | /* For iterators to call. */ |
---|
53 | void e_list_remove_link (EList *list, |
---|
54 | GList *link); |
---|
55 | void e_list_remove_iterator (EList *list, |
---|
56 | EIterator *iterator); |
---|
57 | void e_list_invalidate_iterators (EList *list, |
---|
58 | EIterator *skip); |
---|
59 | |
---|
60 | /* Standard Gtk function */ |
---|
61 | GtkType e_list_get_type (void); |
---|
62 | |
---|
63 | #endif /* ! __E_LIST_H__ */ |
---|