51 for (list = mapping_list->list; list; list = list->next) {
54 if (mapping->
data == data)
76 for (list = mapping_list->list; list; list = list->next) {
79 if (!func (mapping->
data, data))
97 g_return_val_if_fail (mapping_list != NULL, NULL);
99 return (
EvMapping *)g_list_nth_data (mapping_list->list, n);
119 g_return_val_if_fail (mapping_list != NULL, NULL);
121 for (list = mapping_list->list; list; list = list->next) {
124 if ((x >= mapping->
area.
x1) &&
125 (y >= mapping->
area.
y1) &&
126 (x <= mapping->area.x2) &&
127 (y <= mapping->area.y2)) {
152 return mapping->
data;
166 return mapping_list ? mapping_list->list : NULL;
180 mapping_list->list = g_list_remove (mapping_list->list, mapping);
181 mapping_list->data_destroy_func (mapping->
data);
188 return mapping_list->page;
194 g_return_val_if_fail (mapping_list != NULL, 0);
196 return g_list_length (mapping_list->list);
210 GDestroyNotify data_destroy_func)
214 g_return_val_if_fail (data_destroy_func != NULL, NULL);
217 mapping_list->page = page;
218 mapping_list->list = list;
219 mapping_list->data_destroy_func = data_destroy_func;
220 mapping_list->ref_count = 1;
228 g_return_val_if_fail (mapping_list != NULL, NULL);
229 g_return_val_if_fail (mapping_list->ref_count > 0, mapping_list);
231 g_atomic_int_add (&mapping_list->ref_count, 1);
238 GDestroyNotify destroy_func)
240 destroy_func (mapping->
data);
247 g_return_if_fail (mapping_list != NULL);
248 g_return_if_fail (mapping_list->ref_count > 0);
250 if (g_atomic_int_add (&mapping_list->ref_count, -1) - 1 == 0) {
251 g_list_foreach (mapping_list->list,
253 mapping_list->data_destroy_func);
254 g_list_free (mapping_list->list);