-
Notifications
You must be signed in to change notification settings - Fork 12
/
Copy pathdreaMote_Prefix.pch
executable file
·135 lines (120 loc) · 3.7 KB
/
dreaMote_Prefix.pch
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
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
//
// Prefix header for all source files of the 'Untitled' target in the 'Untitled' project
//
#define TOUCHXMLUSETIDY 0
#ifdef __OBJC__
#import <Foundation/Foundation.h>
#import <UIKit/UIKit.h>
#import "UIViewController+Theming.h"
#endif
#define SafeDestroyButton(button) { \
[(button) removeTarget:nil action:NULL forControlEvents:UIControlEventAllEvents]; \
(button) = (nil); \
}
#define SafeRetainAssign(var, newExpr) { \
id OLD = (var); \
id NEW = (newExpr); \
(var) = [NEW retain]; \
if(OLD) \
[OLD release]; \
}
#define SafeCopyAssign(var, newExpr) { \
id OLD = (var); \
id NEW = (newExpr); \
(var) = [NEW copy]; \
if(OLD) \
[OLD release]; \
}
#define SafeReturn(var) [[var retain] autorelease]
#define UnsetCellAndDelegate(cell) { \
(cell).delegate = (nil); \
(cell) = (nil); \
}
// SDK 3.2+
#ifdef UI_USER_INTERFACE_IDIOM
#define IS_IPAD() (UI_USER_INTERFACE_IDIOM() == UIUserInterfaceIdiomPad)
#else
#define IS_IPAD() (NO)
#endif
#define IS_IPHONE() (!IS_IPAD())
// lite/full
#if defined(BUILD_DREAMOTE_LITE) || defined(BUILD_COOLMOTE)
#define IS_LITE() (1)
#else
#define IS_LITE() (0)
#endif
#define IS_FULL() (!IS_LITE())
// macro to query included features
#define INCLUDE_FEATURE(NAME) (defined(ENABLE_FEATURE_##NAME) && ENABLE_FEATURE_##NAME)
// disable foreign backends for coolmote
#if defined(BUILD_COOLMOTE)
#define ENABLE_FEATURE_Enigma 0
#define ENABLE_FEATURE_Enigma2 0
#define ENABLE_FEATURE_SVDRP 0
#endif
// enable all non-disabled backends
#ifndef ENABLE_FEATURE_Enigma
#define ENABLE_FEATURE_Enigma 1
#endif
#ifndef ENABLE_FEATURE_Enigma2
#define ENABLE_FEATURE_Enigma2 1
#endif
#ifndef ENABLE_FEATURE_Neutrino
#define ENABLE_FEATURE_Neutrino 1
#endif
#ifndef ENABLE_FEATURE_SVDRP
#define ENABLE_FEATURE_SVDRP 1
#endif
// two or more connectors
#define ENABLE_FEATURE_Multiple_Connectors ( \
(ENABLE_FEATURE_Enigma2 && (ENABLE_FEATURE_Enigma || ENABLE_FEATURE_Neutrino || ENABLE_FEATURE_SVDRP)) || \
(ENABLE_FEATURE_Enigma && (ENABLE_FEATURE_Neutrino || ENABLE_FEATURE_SVDRP)) || \
(ENABLE_FEATURE_Neutrino && (ENABLE_FEATURE_SVDRP)) \
)
// disable extra-animation on armv6
#if defined(_ARM_ARCH_7) || TARGET_IPHONE_SIMULATOR
#define ENABLE_FEATURE_Extra_Animation 1
#else
#define ENABLE_FEATURE_Extra_Animation 0
#endif
// branded apps don't get ads (at least for now)
#ifdef BUILD_DREAMOTE_LITE
#define ENABLE_FEATURE_Ads 1
#else
#define ENABLE_FEATURE_Ads 0
#endif
// enable certain exceptions or debug code
#if TARGET_IPHONE_SIMULATOR || defined(DEBUG) || (!defined(NS_BLOCK_ASSERTIONS) && !defined(NDEBUG))
#define IS_DEBUG() (1)
#define _SHKDebugShowLogs
#else
#define IS_DEBUG() (0)
#endif
// re-usable macro to show a temporary "everything fine" hud
// NOTE: you still need to manually include MBProgressHUD.h
#define showCompletedHudWithText(text) { \
UIView *view = self.navigationController.view; \
if(!view) view = self.view; \
if(!view) view = [UIApplication sharedApplication].keyWindow; \
MBProgressHUD *hud = [[MBProgressHUD alloc] initWithView:view]; \
[view addSubview:hud]; \
hud.customView = [[UIImageView alloc] initWithImage:[UIImage imageNamed:@"37x-Checkmark.png"]]; \
hud.mode = MBProgressHUDModeCustomView; \
hud.labelText = (text); \
hud.removeFromSuperViewOnHide = YES; \
[hud show:YES]; \
[hud hide:YES afterDelay:2]; \
}
// in-app-purchase
#if IS_FULL()
#define kServiceEditorPurchase @"de.ritzmo.dreaMote.ServiceEditor"
#define kConsumableBaseFeatureId @"de.ritzmo.dreaMote."
#else
#define kServiceEditorPurchase @"de.ritzmo.dreaMoteLite.ServiceEditor"
#define kAdFreePurchase @"de.ritzmo.dreaMoteLite.AdRemoval"
#endif
#if IS_DEBUG()
#define OWN_SERVER @"http://ritzmo.de/iphone/ssbsk"
#else
#define OWN_SERVER @"http://ritzmo.de/iphone/ssk"
#endif