Blender  V2.93
SEQ_iterator.h
Go to the documentation of this file.
1 /*
2  * This program is free software; you can redistribute it and/or
3  * modify it under the terms of the GNU General Public License
4  * as published by the Free Software Foundation; either version 2
5  * of the License, or (at your option) any later version.
6  *
7  * This program is distributed in the hope that it will be useful,
8  * but WITHOUT ANY WARRANTY; without even the implied warranty of
9  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
10  * GNU General Public License for more details.
11  *
12  * You should have received a copy of the GNU General Public License
13  * along with this program; if not, write to the Free Software Foundation,
14  * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
15  *
16  * The Original Code is Copyright (C) 2004 Blender Foundation.
17  * All rights reserved.
18  */
19 
20 #pragma once
21 
26 #ifdef __cplusplus
27 extern "C" {
28 #endif
29 
30 struct Editing;
31 struct Sequence;
32 
33 typedef struct SeqIterator {
34  struct Sequence **array;
35  int tot, cur;
36 
37  struct Sequence *seq;
38  int valid;
40 
41 #define SEQ_ALL_BEGIN(ed, _seq) \
42  { \
43  SeqIterator iter_macro; \
44  for (SEQ_iterator_begin(ed, &iter_macro, false); iter_macro.valid; \
45  SEQ_iterator_next(&iter_macro)) { \
46  _seq = iter_macro.seq;
47 
48 #define SEQ_ALL_END \
49  } \
50  SEQ_iterator_end(&iter_macro); \
51  } \
52  ((void)0)
53 
54 void SEQ_iterator_begin(struct Editing *ed, SeqIterator *iter, const bool use_current_sequences);
55 void SEQ_iterator_next(SeqIterator *iter);
56 void SEQ_iterator_end(SeqIterator *iter);
58  int (*apply_fn)(struct Sequence *seq, void *),
59  void *arg);
61  int (*apply_fn)(struct Sequence *, void *),
62  void *arg);
63 
64 #ifdef __cplusplus
65 }
66 #endif
void SEQ_iterator_begin(struct Editing *ed, SeqIterator *iter, const bool use_current_sequences)
Definition: iterator.c:111
void SEQ_iterator_end(SeqIterator *iter)
Definition: iterator.c:133
struct SeqIterator SeqIterator
void SEQ_iterator_next(SeqIterator *iter)
Definition: iterator.c:123
int SEQ_iterator_recursive_apply(struct Sequence *seq, int(*apply_fn)(struct Sequence *, void *), void *arg)
int SEQ_iterator_seqbase_recursive_apply(struct ListBase *seqbase, int(*apply_fn)(struct Sequence *seq, void *), void *arg)
struct Sequence ** array
Definition: SEQ_iterator.h:34
struct Sequence * seq
Definition: SEQ_iterator.h:37
ListBase seqbase