Add toolbar to bible plugin with show now, insert into playlist
[kworship.git] / include / repeatMacros.h
blob12be31b6b546c1c08b1b108685784e84e906d1c7
1 /***************************************************************************
2 * This file is part of KWorship. *
3 * Copyright 2008 James Hogan <james@albanarts.com> *
4 * *
5 * KWorship is free software: you can redistribute it and/or modify *
6 * it under the terms of the GNU General Public License as published by *
7 * the Free Software Foundation, either version 2 of the License, or *
8 * (at your option) any later version. *
9 * *
10 * KWorship is distributed in the hope that it will be useful, *
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of *
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
13 * GNU General Public License for more details. *
14 * *
15 * You should have received a copy of the GNU General Public License *
16 * along with KWorship. If not, write to the Free Software Foundation, *
17 * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. *
18 ***************************************************************************/
20 #ifndef _repeatMacros_h_
21 #define _repeatMacros_h_
23 #define MACRO_COMMA ,
24 #define MACRO_NOTHING
26 // Top level
28 #define REPEAT_0(X, SEP)
29 #define REPEAT_1(X, SEP) X(0)
30 #define REPEAT_2(X, SEP) X(0) SEP X(1)
31 #define REPEAT_3(X, SEP) X(0) SEP X(1) SEP X(2)
32 #define REPEAT_4(X, SEP) X(0) SEP X(1) SEP X(2) SEP X(3)
33 #define REPEAT_5(X, SEP) X(0) SEP X(1) SEP X(2) SEP X(3) SEP X(4)
34 #define REPEAT_6(X, SEP) X(0) SEP X(1) SEP X(2) SEP X(3) SEP X(4) SEP X(5)
35 #define REPEAT_7(X, SEP) X(0) SEP X(1) SEP X(2) SEP X(3) SEP X(4) SEP X(5) SEP X(6)
36 #define REPEAT_8(X, SEP) X(0) SEP X(1) SEP X(2) SEP X(3) SEP X(4) SEP X(5) SEP X(6) SEP X(7)
38 #define REPEAT(X,N) REPEAT_##N(X, MACRO_NOTHING)
39 #define REPEAT_LIST(X,N) REPEAT_##N(X, MACRO_COMMA)
41 // First level
43 #define REPEATA_0(X, B, SEP)
44 #define REPEATA_1(X, B, SEP) X(B, 0)
45 #define REPEATA_2(X, B, SEP) X(B, 0) SEP X(B, 1)
46 #define REPEATA_3(X, B, SEP) X(B, 0) SEP X(B, 1) SEP X(B, 2)
47 #define REPEATA_4(X, B, SEP) X(B, 0) SEP X(B, 1) SEP X(B, 2) SEP X(B, 3)
48 #define REPEATA_5(X, B, SEP) X(B, 0) SEP X(B, 1) SEP X(B, 2) SEP X(B, 3) SEP X(B, 4)
49 #define REPEATA_6(X, B, SEP) X(B, 0) SEP X(B, 1) SEP X(B, 2) SEP X(B, 3) SEP X(B, 4) SEP X(B, 5)
50 #define REPEATA_7(X, B, SEP) X(B, 0) SEP X(B, 1) SEP X(B, 2) SEP X(B, 3) SEP X(B, 4) SEP X(B, 5) SEP X(B, 6)
51 #define REPEATA_8(X, B, SEP) X(B, 0) SEP X(B, 1) SEP X(B, 2) SEP X(B, 3) SEP X(B, 4) SEP X(B, 5) SEP X(B, 6) SEP X(B, 7)
53 #define REPEATA(X,B,N) REPEATA_##N(X, B, MACRO_NOTHING)
54 #define REPEATA_LIST(X,B,N) REPEATA_##N(X, B, MACRO_COMMA)
56 // Second level
58 #define REPEATB_0(X, B, C, SEP)
59 #define REPEATB_1(X, B, C, SEP) X(B, C, 0)
60 #define REPEATB_2(X, B, C, SEP) X(B, C, 0) SEP X(B, C, 1)
61 #define REPEATB_3(X, B, C, SEP) X(B, C, 0) SEP X(B, C, 1) SEP X(B, C, 2)
62 #define REPEATB_4(X, B, C, SEP) X(B, C, 0) SEP X(B, C, 1) SEP X(B, C, 2) SEP X(B, C, 3)
63 #define REPEATB_5(X, B, C, SEP) X(B, C, 0) SEP X(B, C, 1) SEP X(B, C, 2) SEP X(B, C, 3) SEP X(B, C, 4)
64 #define REPEATB_6(X, B, C, SEP) X(B, C, 0) SEP X(B, C, 1) SEP X(B, C, 2) SEP X(B, C, 3) SEP X(B, C, 4) SEP X(B, C, 5)
65 #define REPEATB_7(X, B, C, SEP) X(B, C, 0) SEP X(B, C, 1) SEP X(B, C, 2) SEP X(B, C, 3) SEP X(B, C, 4) SEP X(B, C, 5) SEP X(B, C, 6)
66 #define REPEATB_8(X, B, C, SEP) X(B, C, 0) SEP X(B, C, 1) SEP X(B, C, 2) SEP X(B, C, 3) SEP X(B, C, 4) SEP X(B, C, 5) SEP X(B, C, 6) SEP X(B, C, 7)
68 #define REPEATB(X,B,C,N) REPEATB_##N(X, B, C, MACRO_NOTHING)
69 #define REPEATB_LIST(X,B,C,N) REPEATB_##N(X, B, C, MACRO_COMMA)
71 #endif // _repeatMacros_h_