├── EAThemeSample.xcodeproj
├── xcuserdata
│ └── Eiwodetianna.xcuserdatad
│ │ ├── xcdebugger
│ │ └── Breakpoints_v2.xcbkptlist
│ │ └── xcschemes
│ │ ├── xcschememanagement.plist
│ │ └── EAThemeSample.xcscheme
├── project.xcworkspace
│ ├── contents.xcworkspacedata
│ └── xcuserdata
│ │ └── Eiwodetianna.xcuserdatad
│ │ └── UserInterfaceState.xcuserstate
└── project.pbxproj
├── EAThemeSample
├── Demo
│ ├── Base
│ │ ├── BaseViewController.h
│ │ ├── BaseNavigationController.h
│ │ ├── BaseViewController.m
│ │ └── BaseNavigationController.m
│ ├── Home
│ │ ├── HomeViewController.h
│ │ ├── DetailViewController.h
│ │ ├── HomeViewController.m
│ │ └── DetailViewController.m
│ ├── Settings
│ │ ├── SettingViewController.h
│ │ ├── ThemesSettingViewController.h
│ │ ├── SettingViewController.m
│ │ └── ThemesSettingViewController.m
│ └── resource
│ │ └── EAThemeDemo.html
├── AppDelegate.h
├── main.m
├── Assets.xcassets
│ └── AppIcon.appiconset
│ │ └── Contents.json
├── Info.plist
├── Base.lproj
│ ├── LaunchScreen.storyboard
│ └── Main.storyboard
└── AppDelegate.m
├── EATheme
├── Handle
│ ├── UIView+EATheme.h
│ ├── EAThemeManager.h
│ ├── EAThemeManager.m
│ ├── UIView+EATheme.m
│ └── EA_metamacros.h
├── EATheme.h
└── EAThemesConfiguration.h
├── EATheme.podspec
├── LICENSE.TXT
└── README.md
/EAThemeSample.xcodeproj/xcuserdata/Eiwodetianna.xcuserdatad/xcdebugger/Breakpoints_v2.xcbkptlist:
--------------------------------------------------------------------------------
1 |
2 |
5 |
6 |
--------------------------------------------------------------------------------
/EAThemeSample.xcodeproj/project.xcworkspace/contents.xcworkspacedata:
--------------------------------------------------------------------------------
1 |
2 |
4 |
6 |
7 |
8 |
--------------------------------------------------------------------------------
/EAThemeSample.xcodeproj/project.xcworkspace/xcuserdata/Eiwodetianna.xcuserdatad/UserInterfaceState.xcuserstate:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/JinXinLiang/EAThemeSample/HEAD/EAThemeSample.xcodeproj/project.xcworkspace/xcuserdata/Eiwodetianna.xcuserdatad/UserInterfaceState.xcuserstate
--------------------------------------------------------------------------------
/EAThemeSample/Demo/Base/BaseViewController.h:
--------------------------------------------------------------------------------
1 | //
2 | // BaseViewController.h
3 | // EAThemeSample
4 | //
5 | // Created by Eiwodetianna on 16/5/17.
6 | // Copyright © 2016年 Eiwodetianna. All rights reserved.
7 | //
8 |
9 | #import
10 |
11 | @interface BaseViewController : UIViewController
12 |
13 | @end
14 |
--------------------------------------------------------------------------------
/EAThemeSample/Demo/Home/HomeViewController.h:
--------------------------------------------------------------------------------
1 | //
2 | // HomeViewController.h
3 | // EAThemeSample
4 | //
5 | // Created by Eiwodetianna on 16/5/17.
6 | // Copyright © 2016年 Eiwodetianna. All rights reserved.
7 | //
8 |
9 | #import "BaseViewController.h"
10 |
11 | @interface HomeViewController : BaseViewController
12 |
13 | @end
14 |
--------------------------------------------------------------------------------
/EAThemeSample/Demo/Home/DetailViewController.h:
--------------------------------------------------------------------------------
1 | //
2 | // DetailViewController.h
3 | // EAThemeSample
4 | //
5 | // Created by Eiwodetianna on 16/5/17.
6 | // Copyright © 2016年 Eiwodetianna. All rights reserved.
7 | //
8 |
9 | #import "BaseViewController.h"
10 |
11 | @interface DetailViewController : BaseViewController
12 |
13 | @end
14 |
--------------------------------------------------------------------------------
/EAThemeSample/Demo/Settings/SettingViewController.h:
--------------------------------------------------------------------------------
1 | //
2 | // SettingViewController.h
3 | // EAThemeSample
4 | //
5 | // Created by Eiwodetianna on 16/5/18.
6 | // Copyright © 2016年 Eiwodetianna. All rights reserved.
7 | //
8 |
9 | #import "BaseViewController.h"
10 |
11 | @interface SettingViewController : BaseViewController
12 |
13 | @end
14 |
--------------------------------------------------------------------------------
/EAThemeSample/Demo/Base/BaseNavigationController.h:
--------------------------------------------------------------------------------
1 | //
2 | // BaseNavigationController.h
3 | // EAThemeSample
4 | //
5 | // Created by Eiwodetianna on 16/5/17.
6 | // Copyright © 2016年 Eiwodetianna. All rights reserved.
7 | //
8 |
9 | #import
10 |
11 | @interface BaseNavigationController : UINavigationController
12 |
13 | @end
14 |
--------------------------------------------------------------------------------
/EAThemeSample/Demo/Settings/ThemesSettingViewController.h:
--------------------------------------------------------------------------------
1 | //
2 | // SettingViewController.h
3 | // EAThemeSample
4 | //
5 | // Created by Eiwodetianna on 16/5/17.
6 | // Copyright © 2016年 Eiwodetianna. All rights reserved.
7 | //
8 |
9 | #import "BaseViewController.h"
10 |
11 | @interface ThemesSettingViewController : BaseViewController
12 |
13 | @end
14 |
--------------------------------------------------------------------------------
/EAThemeSample/AppDelegate.h:
--------------------------------------------------------------------------------
1 | //
2 | // AppDelegate.h
3 | // EAThemeSample
4 | //
5 | // Created by Eiwodetianna on 16/5/17.
6 | // Copyright © 2016年 Eiwodetianna. All rights reserved.
7 | //
8 |
9 | #import
10 |
11 | @interface AppDelegate : UIResponder
12 |
13 | @property (strong, nonatomic) UIWindow *window;
14 |
15 |
16 | @end
17 |
18 |
--------------------------------------------------------------------------------
/EAThemeSample/main.m:
--------------------------------------------------------------------------------
1 | //
2 | // main.m
3 | // EAThemeSample
4 | //
5 | // Created by Eiwodetianna on 16/5/17.
6 | // Copyright © 2016年 Eiwodetianna. All rights reserved.
7 | //
8 |
9 | #import
10 | #import "AppDelegate.h"
11 |
12 | int main(int argc, char * argv[]) {
13 | @autoreleasepool {
14 | return UIApplicationMain(argc, argv, nil, NSStringFromClass([AppDelegate class]));
15 | }
16 | }
17 |
--------------------------------------------------------------------------------
/EAThemeSample.xcodeproj/xcuserdata/Eiwodetianna.xcuserdatad/xcschemes/xcschememanagement.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | SchemeUserState
6 |
7 | EAThemeSample.xcscheme
8 |
9 | orderHint
10 | 0
11 |
12 |
13 | SuppressBuildableAutocreation
14 |
15 | 73C1C8BB1CEB0F1D00425D5F
16 |
17 | primary
18 |
19 |
20 |
21 |
22 |
23 |
--------------------------------------------------------------------------------
/EATheme/Handle/UIView+EATheme.h:
--------------------------------------------------------------------------------
1 | //
2 | // UIView+EATheme.h
3 | // EAThemeSample
4 | //
5 | // Created by Eiwodetianna on 16/5/17.
6 | // Copyright © 2016年 Eiwodetianna. All rights reserved.
7 | //
8 |
9 | #import
10 |
11 | /**
12 | * 主题切换时的回调方法
13 | *
14 | * @param currentView
15 | * 当前设置主题的view
16 | * @param currentThemeIdentifier
17 | * 当前主题的标示
18 | */
19 |
20 | typedef void(^THEME_CONTENTS)(UIView *currentView, NSString *currentThemeIdentifier);
21 |
22 |
23 | @interface UIView (EATheme)
24 |
25 |
26 | /**
27 | * 设置主题切换时的回调方法
28 | */
29 | - (void)ea_setThemeContents:(THEME_CONTENTS)themeContents;
30 |
31 | @end
32 |
--------------------------------------------------------------------------------
/EAThemeSample/Assets.xcassets/AppIcon.appiconset/Contents.json:
--------------------------------------------------------------------------------
1 | {
2 | "images" : [
3 | {
4 | "idiom" : "iphone",
5 | "size" : "29x29",
6 | "scale" : "2x"
7 | },
8 | {
9 | "idiom" : "iphone",
10 | "size" : "29x29",
11 | "scale" : "3x"
12 | },
13 | {
14 | "idiom" : "iphone",
15 | "size" : "40x40",
16 | "scale" : "2x"
17 | },
18 | {
19 | "idiom" : "iphone",
20 | "size" : "40x40",
21 | "scale" : "3x"
22 | },
23 | {
24 | "idiom" : "iphone",
25 | "size" : "60x60",
26 | "scale" : "2x"
27 | },
28 | {
29 | "idiom" : "iphone",
30 | "size" : "60x60",
31 | "scale" : "3x"
32 | }
33 | ],
34 | "info" : {
35 | "version" : 1,
36 | "author" : "xcode"
37 | }
38 | }
--------------------------------------------------------------------------------
/EATheme/EATheme.h:
--------------------------------------------------------------------------------
1 | //
2 | // EATheme.h
3 | // EAThemeSample
4 | //
5 | // Created by Eiwodetianna on 16/5/17.
6 | // Copyright © 2016年 Eiwodetianna. All rights reserved.
7 | //
8 |
9 | #ifndef EATheme_h
10 | #define EATheme_h
11 |
12 |
13 | // 你可以使用下面的宏定义避免在使用block产生的循环引用问题
14 |
15 | #define ea_weakify(...) \
16 | ea_keywordify \
17 | ea_metamacro_foreach_cxt(ea_weakify_,, __weak, __VA_ARGS__)
18 |
19 | #define ea_strongify(...) \
20 | ea_keywordify \
21 | _Pragma("clang diagnostic push") \
22 | _Pragma("clang diagnostic ignored \"-Wshadow\"") \
23 | ea_metamacro_foreach(ea_strongify_,, __VA_ARGS__) \
24 | _Pragma("clang diagnostic pop")
25 |
26 | #import "UIView+EATheme.h"
27 | #import "EAThemeManager.h"
28 | #import "EA_metamacros.h"
29 | #import "EAThemesConfiguration.h"
30 |
31 |
32 | #endif /* EATheme_h */
33 |
--------------------------------------------------------------------------------
/EATheme/Handle/EAThemeManager.h:
--------------------------------------------------------------------------------
1 | //
2 | // EAThemeManager.h
3 | // EAThemeSample
4 | //
5 | // Created by Eiwodetianna on 16/5/17.
6 | // Copyright © 2016年 Eiwodetianna. All rights reserved.
7 | //
8 |
9 | #import
10 |
11 | /**
12 | * 主题改变的监听事件
13 | */
14 | FOUNDATION_EXPORT NSString *const kEAChangeThemeNotification;
15 |
16 |
17 | @interface EAThemeManager : NSObject
18 |
19 | // 设置正常状态下的主题标示(ps:必须设置)
20 | @property (nonatomic, copy) NSString *normalThemeIdentifier;
21 |
22 | // 获取当前程序采用的主题的标示
23 | @property (nonatomic,readonly,copy) NSString *currentThemeIdentifier;
24 |
25 |
26 | + (EAThemeManager *)shareManager;
27 |
28 | /**
29 | * 展示某个主题
30 | *
31 | * @param identifier 需要展示的主题的标示
32 | */
33 | - (void)displayThemeContentsWithThemeIdentifier:(NSString *)identifier;
34 |
35 |
36 |
37 | @end
38 |
--------------------------------------------------------------------------------
/EATheme/EAThemesConfiguration.h:
--------------------------------------------------------------------------------
1 | //
2 | // EAThemesConfiguration.h
3 | // EAThemeSample
4 | //
5 | // Created by Eiwodetianna on 16/5/18.
6 | // Copyright © 2016年 Eiwodetianna. All rights reserved.
7 | //
8 | /**
9 | * You can customize every theme's identifier here, so when you write code that uses the theme's identifier easier
10 | * 你可以在这里自定义你每一个主题的标示,使你在编写代码时使用主题标示更加方便
11 | */
12 |
13 |
14 | #ifndef EAThemesConfiguration_h
15 | #define EAThemesConfiguration_h
16 |
17 |
18 | /**
19 | * Customize every theme's identifier here
20 | */
21 |
22 | // 范例:下方设置了5种主题的标示
23 | static NSString *const EAThemeNormal = @"EAThemeNormal";
24 | static NSString *const EAThemeBlack = @"EAThemeBlack";
25 | static NSString *const EAThemeRed = @"EAThemeRed";
26 | static NSString *const EAThemeOrange = @"EAThemeOrange";
27 | static NSString *const EAThemeBlue = @"EAThemeBlue";
28 |
29 |
30 |
31 |
32 | #endif /* EAThemesConfiguration_h */
33 |
--------------------------------------------------------------------------------
/EATheme.podspec:
--------------------------------------------------------------------------------
1 | #
2 | # Be sure to run `pod spec lint EATheme.podspec' to ensure this is a
3 | # valid spec and to remove all comments including this before submitting the spec.
4 | #
5 | # To learn more about Podspec attributes see http://docs.cocoapods.org/specification.html
6 | # To see working Podspecs in the CocoaPods repo see https://github.com/CocoaPods/Specs/
7 | #
8 |
9 | Pod::Spec.new do |s|
10 |
11 | s.name = "EATheme"
12 | s.version = "1.1.3"
13 | s.summary = "Change your application’s theme!"
14 | s.homepage = "https://github.com/JinXinLiang/EAThemeSample"
15 | s.license = 'MIT'
16 | s.author = { "Eiwodetianna" => "jinxinliang1993@gmail.com" }
17 | s.platform = :ios, "6.0"
18 | s.source = { :git => "https://github.com/JinXinLiang/EAThemeSample.git", :tag => s.version }
19 | s.source_files = "EATheme", "EATheme/**/*.{h,m}"
20 | s.requires_arc = true
21 |
22 | end
23 |
--------------------------------------------------------------------------------
/LICENSE.TXT:
--------------------------------------------------------------------------------
1 |
2 | Copyright (c) 2015 jinxinliang
3 |
4 | Permission is hereby granted, free of charge, to any person obtaining a copy
5 | of this software and associated documentation files (the "Software"), to deal
6 | in the Software without restriction, including without limitation the rights
7 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
8 | copies of the Software, and to permit persons to whom the Software is
9 | furnished to do so, subject to the following conditions:
10 |
11 | The above copyright notice and this permission notice shall be included in all
12 | copies or substantial portions of the Software.
13 |
14 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
15 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
16 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
17 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
18 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
19 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
20 | SOFTWARE.
21 |
--------------------------------------------------------------------------------
/EAThemeSample/Demo/Base/BaseViewController.m:
--------------------------------------------------------------------------------
1 | //
2 | // BaseViewController.m
3 | // EAThemeSample
4 | //
5 | // Created by Eiwodetianna on 16/5/17.
6 | // Copyright © 2016年 Eiwodetianna. All rights reserved.
7 | //
8 |
9 | #import "BaseViewController.h"
10 | #import "EATheme.h"
11 |
12 | @interface BaseViewController ()
13 |
14 | @end
15 |
16 | @implementation BaseViewController
17 |
18 | - (void)viewDidLoad {
19 | [super viewDidLoad];
20 | // Do any additional setup after loading the view.
21 | self.navigationController.navigationBar.translucent = NO;
22 | self.automaticallyAdjustsScrollViewInsets = NO;
23 | @ea_weakify(self);
24 | [self.view ea_setThemeContents:^(UIView *currentView, NSString *currentThemeIdentifier) {
25 | @ea_strongify(self);
26 | currentView.backgroundColor = self.tabBarController.tabBar.barTintColor;
27 | }];
28 | }
29 |
30 | - (void)didReceiveMemoryWarning {
31 | [super didReceiveMemoryWarning];
32 | // Dispose of any resources that can be recreated.
33 | }
34 |
35 | /*
36 | #pragma mark - Navigation
37 |
38 | // In a storyboard-based application, you will often want to do a little preparation before navigation
39 | - (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
40 | // Get the new view controller using [segue destinationViewController].
41 | // Pass the selected object to the new view controller.
42 | }
43 | */
44 |
45 | @end
46 |
--------------------------------------------------------------------------------
/EAThemeSample/Info.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | NSAppTransportSecurity
6 |
7 | NSAllowsArbitraryLoads
8 |
9 |
10 | CFBundleDevelopmentRegion
11 | en
12 | CFBundleExecutable
13 | $(EXECUTABLE_NAME)
14 | CFBundleIdentifier
15 | $(PRODUCT_BUNDLE_IDENTIFIER)
16 | CFBundleInfoDictionaryVersion
17 | 6.0
18 | CFBundleName
19 | $(PRODUCT_NAME)
20 | CFBundlePackageType
21 | APPL
22 | CFBundleShortVersionString
23 | 1.0
24 | CFBundleSignature
25 | ????
26 | CFBundleVersion
27 | 1
28 | LSRequiresIPhoneOS
29 |
30 | UILaunchStoryboardName
31 | LaunchScreen
32 | UIMainStoryboardFile
33 | Main
34 | UIRequiredDeviceCapabilities
35 |
36 | armv7
37 |
38 | UISupportedInterfaceOrientations
39 |
40 | UIInterfaceOrientationPortrait
41 | UIInterfaceOrientationLandscapeLeft
42 | UIInterfaceOrientationLandscapeRight
43 |
44 |
45 |
46 |
--------------------------------------------------------------------------------
/EAThemeSample/Demo/Settings/SettingViewController.m:
--------------------------------------------------------------------------------
1 | //
2 | // SettingViewController.m
3 | // EAThemeSample
4 | //
5 | // Created by Eiwodetianna on 16/5/18.
6 | // Copyright © 2016年 Eiwodetianna. All rights reserved.
7 | //
8 |
9 | #import "SettingViewController.h"
10 | #import "EATheme.h"
11 |
12 | @interface SettingViewController ()
13 | @property (weak, nonatomic) IBOutlet UIButton *themesSettingButton;
14 |
15 | @end
16 |
17 | @implementation SettingViewController
18 |
19 | - (void)viewDidLoad {
20 | [super viewDidLoad];
21 | // Do any additional setup after loading the view.
22 | [self.themesSettingButton ea_setThemeContents:^(UIView *currentView, NSString *currentThemeIdentifier) {
23 | UIButton *button = (UIButton *)currentView;
24 | UIColor *titleColor = [currentThemeIdentifier isEqualToString:EAThemeNormal] ? [UIColor blackColor] : [UIColor whiteColor];
25 | [button setTitleColor:titleColor forState:UIControlStateNormal];
26 | }];
27 |
28 | }
29 |
30 | - (void)didReceiveMemoryWarning {
31 | [super didReceiveMemoryWarning];
32 | // Dispose of any resources that can be recreated.
33 |
34 | }
35 |
36 | /*
37 | #pragma mark - Navigation
38 |
39 | // In a storyboard-based application, you will often want to do a little preparation before navigation
40 | - (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
41 | // Get the new view controller using [segue destinationViewController].
42 | // Pass the selected object to the new view controller.
43 | }
44 | */
45 |
46 | @end
47 |
--------------------------------------------------------------------------------
/EAThemeSample/Demo/Base/BaseNavigationController.m:
--------------------------------------------------------------------------------
1 | //
2 | // BaseNavigationController.m
3 | // EAThemeSample
4 | //
5 | // Created by Eiwodetianna on 16/5/17.
6 | // Copyright © 2016年 Eiwodetianna. All rights reserved.
7 | //
8 |
9 | #import "BaseNavigationController.h"
10 | #import "EATheme.h"
11 |
12 | @interface BaseNavigationController ()
13 |
14 | @end
15 |
16 | @implementation BaseNavigationController
17 |
18 | - (void)viewDidLoad {
19 | [super viewDidLoad];
20 | // Do any additional setup after loading the view.
21 |
22 | NSDictionary *barColorDic = @{EAThemeNormal : [UIColor whiteColor], EAThemeBlack : [UIColor blackColor], EAThemeRed : [UIColor redColor], EAThemeOrange : [UIColor orangeColor], EAThemeBlue : [UIColor blueColor]};
23 |
24 | [self.navigationBar ea_setThemeContents:^(UIView *currentView, NSString *currentThemeIdentifier) {
25 | UINavigationBar *bar = (UINavigationBar *)currentView;
26 | bar.barStyle = [currentThemeIdentifier isEqualToString:EAThemeNormal] ? UIBarStyleDefault : UIBarStyleBlack;
27 | bar.barTintColor = barColorDic[currentThemeIdentifier];
28 | }];
29 |
30 | }
31 |
32 | - (void)didReceiveMemoryWarning {
33 | [super didReceiveMemoryWarning];
34 | // Dispose of any resources that can be recreated.
35 | }
36 |
37 | /*
38 | #pragma mark - Navigation
39 |
40 | // In a storyboard-based application, you will often want to do a little preparation before navigation
41 | - (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
42 | // Get the new view controller using [segue destinationViewController].
43 | // Pass the selected object to the new view controller.
44 | }
45 | */
46 |
47 | @end
48 |
--------------------------------------------------------------------------------
/EAThemeSample/Base.lproj/LaunchScreen.storyboard:
--------------------------------------------------------------------------------
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 |
--------------------------------------------------------------------------------
/EAThemeSample/Demo/Home/HomeViewController.m:
--------------------------------------------------------------------------------
1 | //
2 | // HomeViewController.m
3 | // EAThemeSample
4 | //
5 | // Created by Eiwodetianna on 16/5/17.
6 | // Copyright © 2016年 Eiwodetianna. All rights reserved.
7 | //
8 |
9 | #import "HomeViewController.h"
10 | #import "EATheme.h"
11 |
12 | @interface HomeViewController ()
13 | @property (weak, nonatomic) IBOutlet UIButton *button;
14 |
15 | @end
16 |
17 | @implementation HomeViewController
18 |
19 | - (void)dealloc {
20 | NSLog(@"dealloc");
21 | [[NSNotificationCenter defaultCenter] removeObserver:self name:kEAChangeThemeNotification object:nil];
22 | }
23 |
24 | - (void)viewDidLoad {
25 | [super viewDidLoad];
26 | // Do any additional setup after loading the view.
27 |
28 | [self.button ea_setThemeContents:^(UIView *currentView, NSString *currentThemeIdentifier) {
29 | UIButton *button = (UIButton *)currentView;
30 | UIColor *titleColor = [currentThemeIdentifier isEqualToString:EAThemeNormal] ? [UIColor blackColor] : [UIColor whiteColor];
31 | [button setTitleColor:titleColor forState:UIControlStateNormal];
32 | }];
33 |
34 |
35 | [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(themeDidDisplay) name:kEAChangeThemeNotification object:nil];
36 |
37 |
38 | }
39 |
40 | - (void)themeDidDisplay {
41 | NSLog(@"current theme is %@!", [EAThemeManager shareManager].currentThemeIdentifier);
42 | }
43 |
44 | - (void)didReceiveMemoryWarning {
45 | [super didReceiveMemoryWarning];
46 | // Dispose of any resources that can be recreated.
47 | }
48 |
49 | /*
50 | #pragma mark - Navigation
51 |
52 | // In a storyboard-based application, you will often want to do a little preparation before navigation
53 | - (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
54 | // Get the new view controller using [segue destinationViewController].
55 | // Pass the selected object to the new view controller.
56 | }
57 | */
58 |
59 | @end
60 |
--------------------------------------------------------------------------------
/EATheme/Handle/EAThemeManager.m:
--------------------------------------------------------------------------------
1 | //
2 | // EAThemeManager.m
3 | // EAThemeSample
4 | //
5 | // Created by Eiwodetianna on 16/5/17.
6 | // Copyright © 2016年 Eiwodetianna. All rights reserved.
7 | //
8 |
9 | #import "EAThemeManager.h"
10 | #import "UIView+EATheme.h"
11 |
12 |
13 | NSString *const kEAChangeThemeNotification = @"EAChangeThemeNotification";
14 |
15 | NSString *const EATheme = @"EATheme";
16 |
17 | @interface EAThemeManager ()
18 |
19 | @property(nonatomic,readwrite,copy)NSString *currentThemeIdentifier;
20 |
21 | @end
22 |
23 | @implementation EAThemeManager
24 |
25 | + (EAThemeManager *)shareManager {
26 | static EAThemeManager *manager = nil;
27 | static dispatch_once_t onceToken;
28 | dispatch_once(&onceToken, ^{
29 | manager = [[EAThemeManager alloc] init];
30 | manager.currentThemeIdentifier = nil;
31 | });
32 | return manager;
33 | }
34 |
35 | - (void)setNormalThemeIdentifier:(NSString *)normalThemeIdentifier {
36 | if (![_normalThemeIdentifier isEqualToString:normalThemeIdentifier]) {
37 |
38 | if (!self.currentThemeIdentifier) {
39 |
40 | [self displayThemeContentsWithThemeIdentifier:normalThemeIdentifier];
41 | }
42 | _normalThemeIdentifier = normalThemeIdentifier;
43 | }
44 | }
45 |
46 | - (void)displayThemeContentsWithThemeIdentifier:(NSString *)identifier {
47 | if (identifier && ![identifier isEqualToString:self.currentThemeIdentifier]) {
48 |
49 | [self p_saveSettingWithThemeIdentifier:identifier];
50 | [[NSNotificationCenter defaultCenter] postNotificationName:kEAChangeThemeNotification object:nil];
51 | }
52 | }
53 |
54 | - (void)p_saveSettingWithThemeIdentifier:(NSString *)identifier {
55 | [[NSUserDefaults standardUserDefaults] setObject:identifier forKey:EATheme];
56 | [[NSUserDefaults standardUserDefaults] synchronize];
57 | }
58 |
59 | - (NSString *)currentThemeIdentifier {
60 | return [[NSUserDefaults standardUserDefaults] objectForKey:EATheme];
61 | }
62 |
63 | @end
64 |
--------------------------------------------------------------------------------
/EATheme/Handle/UIView+EATheme.m:
--------------------------------------------------------------------------------
1 | //
2 | // UIView+EATheme.m
3 | // EAThemeSample
4 | //
5 | // Created by Eiwodetianna on 16/5/17.
6 | // Copyright © 2016年 Eiwodetianna. All rights reserved.
7 | //
8 |
9 | #import "UIView+EATheme.h"
10 | #import "EAThemeManager.h"
11 | #import
12 |
13 | static void *EAViewThemesKey = "EAViewThemesKey";
14 |
15 | @interface UIView ()
16 |
17 | @property (nonatomic, copy) THEME_CONTENTS themeContents;
18 |
19 | @end
20 |
21 | @implementation UIView (EATheme)
22 |
23 | - (void)ea_dealloc {
24 |
25 | [[NSNotificationCenter defaultCenter] removeObserver:self name:kEAChangeThemeNotification object:nil];
26 |
27 | [self ea_dealloc];
28 |
29 | }
30 |
31 | + (void)load {
32 |
33 | static dispatch_once_t onceToken;
34 | dispatch_once(&onceToken, ^{
35 |
36 | Method deallocMethod = class_getInstanceMethod([self class], NSSelectorFromString(@"dealloc"));
37 | Method ea_deallocMethod = class_getInstanceMethod([self class], @selector(ea_dealloc));
38 | method_exchangeImplementations(deallocMethod, ea_deallocMethod);
39 |
40 |
41 | });
42 |
43 | }
44 |
45 | - (void)setThemeContents:(THEME_CONTENTS)themeContents {
46 | objc_setAssociatedObject(self, EAViewThemesKey, themeContents, OBJC_ASSOCIATION_COPY);
47 | }
48 |
49 | - (THEME_CONTENTS)themeContents {
50 |
51 | return objc_getAssociatedObject(self, EAViewThemesKey);
52 | }
53 |
54 |
55 |
56 | - (void)ea_setThemeContents:(THEME_CONTENTS)themeContents {
57 |
58 |
59 | if (themeContents) {
60 |
61 | self.themeContents = themeContents;
62 | [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(p_changeTheme) name:kEAChangeThemeNotification object:nil];
63 | [self p_changeTheme];
64 |
65 | }
66 |
67 |
68 | }
69 |
70 | - (void)p_changeTheme {
71 | NSString *contentThemeIdentifier = [[EAThemeManager shareManager] currentThemeIdentifier];
72 |
73 | if (contentThemeIdentifier) {
74 |
75 | if (self.themeContents) {
76 | self.themeContents(self, contentThemeIdentifier);
77 | }
78 | }
79 |
80 | }
81 |
82 | @end
83 |
--------------------------------------------------------------------------------
/EAThemeSample/Demo/Home/DetailViewController.m:
--------------------------------------------------------------------------------
1 | //
2 | // DetailViewController.m
3 | // EAThemeSample
4 | //
5 | // Created by Eiwodetianna on 16/5/17.
6 | // Copyright © 2016年 Eiwodetianna. All rights reserved.
7 | //
8 |
9 | #import "DetailViewController.h"
10 | #import
11 | #import "EATheme.h"
12 |
13 | @interface DetailViewController ()
14 | <
15 | WKNavigationDelegate
16 | >
17 |
18 | @property (nonatomic, strong) WKWebView *webView;
19 |
20 | @end
21 |
22 | @implementation DetailViewController
23 |
24 | - (void)dealloc {
25 | NSLog(@"detail dealloc");
26 | }
27 |
28 | - (void)viewDidLoad {
29 | [super viewDidLoad];
30 | // Do any additional setup after loading the view.
31 |
32 | self.webView = [[WKWebView alloc] initWithFrame:self.view.bounds];
33 | [self.view addSubview:_webView];
34 | [self.webView loadHTMLString:[NSString stringWithContentsOfFile:[[NSBundle mainBundle] pathForResource:@"EAThemeDemo" ofType:@"html"] encoding:NSUTF8StringEncoding error:nil] baseURL:nil];
35 | self.webView.navigationDelegate = self;
36 | self.webView.backgroundColor = [UIColor clearColor];
37 |
38 |
39 | }
40 |
41 | - (void)webView:(WKWebView *)webView didFinishNavigation:(WKNavigation *)navigation {
42 | @ea_weakify(webView);
43 | [webView ea_setThemeContents:^(UIView *currentView, NSString *currentThemeIdentifier) {
44 |
45 | @ea_strongify(webView);
46 | NSString *hexBackgroundString = [currentThemeIdentifier isEqualToString:EAThemeBlack] ? @"#777" : @"#ffffff";
47 | NSString *hexTitleString = [currentThemeIdentifier isEqualToString:EAThemeBlack] ? @"#ffffff" : @"#777";
48 | NSString *jsString = [NSString stringWithFormat:@"document.body.style.background = \"%@\";document.body.style.webkitTextFillColor= \"%@\";", hexBackgroundString, hexTitleString];
49 | [webView evaluateJavaScript:jsString completionHandler:nil];
50 |
51 | }];
52 | }
53 |
54 |
55 |
56 | - (void)didReceiveMemoryWarning {
57 | [super didReceiveMemoryWarning];
58 | // Dispose of any resources that can be recreated.
59 | }
60 |
61 | /*
62 | #pragma mark - Navigation
63 |
64 | // In a storyboard-based application, you will often want to do a little preparation before navigation
65 | - (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
66 | // Get the new view controller using [segue destinationViewController].
67 | // Pass the selected object to the new view controller.
68 | }
69 | */
70 |
71 | @end
72 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | # EATheme/主题切换/夜间模式
2 |
3 | **安装方式(两种)**
4 |
5 | (1)使用CocoaPods的安装方式,在Podfile中对应的target使用:
6 |
7 | pod 'EATheme', '~> 1.1.3'
8 |
9 | (2)直接导入类库的方式,移步GitHub,点击[EAThemeSample](https://github.com/JinXinLiang/EAThemeSample)下载,将demo中的EATheme文件夹直接引入到你的工程。
10 | **在项目中引入主头文件**
11 |
12 | #import "EATheme.h"
13 | **在EAThemesConfiguration.h中自定义主题的常量字符串作为应用程序每种主题的identifier,范例:**
14 |
15 | // 这里设置了5种主题的标识
16 | static NSString *const EAThemeNormal = @"EAThemeNormal";
17 | static NSString *const EAThemeBlack = @"EAThemeBlack";
18 | static NSString *const EAThemeRed = @"EAThemeRed";
19 | static NSString *const EAThemeOrange = @"EAThemeOrange";
20 | static NSString *const EAThemeBlue = @"EAThemeBlue";
21 |
22 | **-application: didFinishLaunchingWithOptions:方法中配置应用程序默认主题,即正常状态下的主题:**
23 |
24 | // 必须配置正常状态下的主题标识
25 | [EAThemeManager shareManager].normalThemeIdentifier = EAThemeNormal;
26 |
27 | **在需要设置夜间模式的控件调用UIView类目中的设置方法,在Block回调中根据主题的identifier设置该视图的对应状态:**
28 |
29 | UITabBarController *rootViewController = (UITabBarController *)self.window.rootViewController;
30 |
31 | NSDictionary *tabBarColorDic = @{EAThemeNormal : [UIColor whiteColor], EAThemeBlack : [UIColor blackColor], EAThemeRed : [UIColor redColor], EAThemeOrange : [UIColor orangeColor], EAThemeBlue : [UIColor blueColor]};
32 |
33 | [rootViewController.tabBar ea_setThemeContents:^(UIView *currentView, NSString *currentThemeIdentifier) {
34 | UITabBar *bar = (UITabBar *)currentView;
35 | bar.barTintColor = tabBarColorDic[currentThemeIdentifier];
36 | }];
37 |
38 |
39 | **可通过EAThemeManager单例的currentThemeIdentifier属性随时获取当前的主题标识:**
40 |
41 | [[EAThemeManager shareManager] currentThemeIdentifier];
42 |
43 | **通过主题标识启动某个主题:**
44 |
45 | // 开启黑色主题
46 | [[EAThemeManager shareManager] displayThemeContentsWithThemeIdentifier:EAThemeBlack];
47 |
48 | **可使用通知中心自定义监听改变主题事件:**
49 |
50 | FOUNDATION_EXPORT NSString *const kEAChangeThemeNotification;
51 |
52 | 案例:
53 |
54 | - (void)viewDidLoad {
55 | [super viewDidLoad];
56 | // Do any additional setup after loading the view.
57 |
58 | [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(themeDidDisplay) name:kEAChangeThemeNotification object:nil];
59 |
60 | }
61 |
62 | - (void)themeDidDisplay {
63 | NSLog(@"current theme is %@!", [EAThemeManager shareManager].currentThemeIdentifier);
64 | }
65 |
66 | **注:Block内存问题:**
67 | 在封装时已尽量让使用者避免内存的问题,如果只是对当前的view设置背景颜色,可以直接使用Block回调中的参数currentView,不会产生内存问题,更复杂的情况,EATheme已借引ReactiveCocoa中的内存管理的宏,方便大家使用(个人觉得这个宏真心好用)例如:
68 |
69 | @ea_weakify(self);
70 | [self.tableView ea_setThemeContents:^(UIView *currentView, NSString *currentThemeIdentifier) {
71 | @ea_strongify(self);
72 | currentView.backgroundColor = self.view.backgroundColor;
73 | }];
74 | **最后,如果在使用中遇到了问题,欢迎大家在Issues里提问。**
--------------------------------------------------------------------------------
/EAThemeSample/Demo/Settings/ThemesSettingViewController.m:
--------------------------------------------------------------------------------
1 | //
2 | // SettingViewController.m
3 | // EAThemeSample
4 | //
5 | // Created by Eiwodetianna on 16/5/17.
6 | // Copyright © 2016年 Eiwodetianna. All rights reserved.
7 | //
8 |
9 | #import "ThemesSettingViewController.h"
10 | #import "EATheme.h"
11 |
12 | @interface ThemesSettingViewController ()
13 | <
14 | UITableViewDataSource,
15 | UITableViewDelegate
16 | >
17 |
18 | @property (weak, nonatomic) IBOutlet UITableView *tableView;
19 | @property (nonatomic, strong) NSArray *themeTitleArray;
20 |
21 | @end
22 |
23 | @implementation ThemesSettingViewController
24 |
25 | - (void)viewDidLoad {
26 | [super viewDidLoad];
27 | // Do any additional setup after loading the view.
28 | self.themeTitleArray = @[EAThemeNormal, EAThemeBlack, EAThemeRed, EAThemeOrange, EAThemeBlue];
29 |
30 | @ea_weakify(self);
31 | [self.tableView ea_setThemeContents:^(UIView *currentView, NSString *currentThemeIdentifier) {
32 | @ea_strongify(self);
33 | currentView.backgroundColor = self.view.backgroundColor;
34 | }];
35 | }
36 |
37 | #pragma mark - UITableViewDataSource
38 |
39 | - (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section
40 | {
41 | return _themeTitleArray.count;
42 | }
43 |
44 | - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
45 | {
46 | UITableViewCell *themeTitleCell = [tableView dequeueReusableCellWithIdentifier:@"cell" forIndexPath:indexPath];
47 | themeTitleCell.textLabel.text = _themeTitleArray[indexPath.row];
48 |
49 |
50 | @ea_weakify(tableView);
51 | [themeTitleCell ea_setThemeContents:^(UIView *currentView, NSString *currentThemeIdentifier) {
52 | @ea_strongify(tableView);
53 | UITableViewCell *cell = (UITableViewCell *)currentView;
54 | cell.backgroundColor = tableView.backgroundColor;
55 | cell.contentView.backgroundColor = tableView.backgroundColor;
56 | cell.textLabel.textColor = [currentThemeIdentifier isEqualToString:EAThemeNormal] ? [UIColor blackColor] : [UIColor whiteColor];
57 | }];
58 |
59 | return themeTitleCell;
60 | }
61 |
62 | - (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath {
63 | [[EAThemeManager shareManager] displayThemeContentsWithThemeIdentifier:_themeTitleArray[indexPath.row]];
64 | }
65 |
66 | - (void)didReceiveMemoryWarning {
67 | [super didReceiveMemoryWarning];
68 | // Dispose of any resources that can be recreated.
69 | }
70 |
71 | /*
72 | #pragma mark - Navigation
73 |
74 | // In a storyboard-based application, you will often want to do a little preparation before navigation
75 | - (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
76 | // Get the new view controller using [segue destinationViewController].
77 | // Pass the selected object to the new view controller.
78 | }
79 | */
80 |
81 | @end
82 |
--------------------------------------------------------------------------------
/EAThemeSample/AppDelegate.m:
--------------------------------------------------------------------------------
1 | //
2 | // AppDelegate.m
3 | // EAThemeSample
4 | //
5 | // Created by Eiwodetianna on 16/5/17.
6 | // Copyright © 2016年 Eiwodetianna. All rights reserved.
7 | //
8 |
9 | #import "AppDelegate.h"
10 | #import "EATheme.h"
11 |
12 | @interface AppDelegate ()
13 |
14 |
15 | @end
16 |
17 | @implementation AppDelegate
18 |
19 |
20 | - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {
21 | // Override point for customization after application launch.
22 | [self.window makeKeyAndVisible];
23 |
24 | // 必须配置正常状态下的主题标示
25 | [EAThemeManager shareManager].normalThemeIdentifier = EAThemeNormal;
26 |
27 | UITabBarController *rootViewController = (UITabBarController *)self.window.rootViewController;
28 |
29 | NSDictionary *tabBarColorDic = @{EAThemeNormal : [UIColor whiteColor], EAThemeBlack : [UIColor blackColor], EAThemeRed : [UIColor redColor], EAThemeOrange : [UIColor orangeColor], EAThemeBlue : [UIColor blueColor]};
30 |
31 | [rootViewController.tabBar ea_setThemeContents:^(UIView *currentView, NSString *currentThemeIdentifier) {
32 | UITabBar *bar = (UITabBar *)currentView;
33 | bar.barTintColor = tabBarColorDic[currentThemeIdentifier];
34 | }];
35 |
36 | return YES;
37 | }
38 |
39 | - (void)applicationWillResignActive:(UIApplication *)application {
40 | // Sent when the application is about to move from active to inactive state. This can occur for certain types of temporary interruptions (such as an incoming phone call or SMS message) or when the user quits the application and it begins the transition to the background state.
41 | // Use this method to pause ongoing tasks, disable timers, and throttle down OpenGL ES frame rates. Games should use this method to pause the game.
42 | }
43 |
44 | - (void)applicationDidEnterBackground:(UIApplication *)application {
45 | // Use this method to release shared resources, save user data, invalidate timers, and store enough application state information to restore your application to its current state in case it is terminated later.
46 | // If your application supports background execution, this method is called instead of applicationWillTerminate: when the user quits.
47 | }
48 |
49 | - (void)applicationWillEnterForeground:(UIApplication *)application {
50 | // Called as part of the transition from the background to the inactive state; here you can undo many of the changes made on entering the background.
51 | }
52 |
53 | - (void)applicationDidBecomeActive:(UIApplication *)application {
54 | // Restart any tasks that were paused (or not yet started) while the application was inactive. If the application was previously in the background, optionally refresh the user interface.
55 | }
56 |
57 | - (void)applicationWillTerminate:(UIApplication *)application {
58 | // Called when the application is about to terminate. Save data if appropriate. See also applicationDidEnterBackground:.
59 | }
60 |
61 | @end
62 |
--------------------------------------------------------------------------------
/EAThemeSample/Demo/resource/EAThemeDemo.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
155 | Welcome to EATheme Demo
156 |
157 |
158 |
159 | Welcome to EATheme Demo
160 |
161 |
--------------------------------------------------------------------------------
/EAThemeSample.xcodeproj/xcuserdata/Eiwodetianna.xcuserdatad/xcschemes/EAThemeSample.xcscheme:
--------------------------------------------------------------------------------
1 |
2 |
5 |
8 |
9 |
15 |
21 |
22 |
23 |
24 |
25 |
30 |
31 |
32 |
33 |
39 |
40 |
41 |
42 |
43 |
44 |
54 |
56 |
62 |
63 |
64 |
65 |
66 |
67 |
73 |
75 |
81 |
82 |
83 |
84 |
86 |
87 |
90 |
91 |
92 |
--------------------------------------------------------------------------------
/EAThemeSample/Base.lproj/Main.storyboard:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
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 |
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 |
136 |
137 |
138 |
139 |
140 |
141 |
142 |
143 |
144 |
145 |
146 |
147 |
148 |
149 |
150 |
151 |
152 |
153 |
154 |
155 |
156 |
157 |
158 |
159 |
160 |
161 |
162 |
163 |
164 |
165 |
166 |
167 |
168 |
169 |
170 |
171 |
172 |
173 |
174 |
175 |
176 |
177 |
178 |
179 |
180 |
181 |
182 |
183 |
184 |
185 |
186 |
187 |
188 |
189 |
190 |
191 |
192 |
193 |
194 |
195 |
196 |
197 |
198 |
199 |
200 |
201 |
202 |
203 |
204 |
205 |
206 |
207 |
208 |
209 |
210 |
211 |
--------------------------------------------------------------------------------
/EAThemeSample.xcodeproj/project.pbxproj:
--------------------------------------------------------------------------------
1 | // !$*UTF8*$!
2 | {
3 | archiveVersion = 1;
4 | classes = {
5 | };
6 | objectVersion = 46;
7 | objects = {
8 |
9 | /* Begin PBXBuildFile section */
10 | 73C1C8C11CEB0F1D00425D5F /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 73C1C8C01CEB0F1D00425D5F /* main.m */; };
11 | 73C1C8C41CEB0F1D00425D5F /* AppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = 73C1C8C31CEB0F1D00425D5F /* AppDelegate.m */; };
12 | 73C1C8CA1CEB0F1D00425D5F /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 73C1C8C81CEB0F1D00425D5F /* Main.storyboard */; };
13 | 73C1C8CC1CEB0F1D00425D5F /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 73C1C8CB1CEB0F1D00425D5F /* Assets.xcassets */; };
14 | 73C1C8CF1CEB0F1D00425D5F /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 73C1C8CD1CEB0F1D00425D5F /* LaunchScreen.storyboard */; };
15 | 73C1C9371CEC4CBE00425D5F /* BaseNavigationController.m in Sources */ = {isa = PBXBuildFile; fileRef = 73C1C9281CEC4CBE00425D5F /* BaseNavigationController.m */; };
16 | 73C1C9381CEC4CBE00425D5F /* BaseViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 73C1C92A1CEC4CBE00425D5F /* BaseViewController.m */; };
17 | 73C1C9391CEC4CBE00425D5F /* DetailViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 73C1C92D1CEC4CBE00425D5F /* DetailViewController.m */; };
18 | 73C1C93A1CEC4CBE00425D5F /* HomeViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 73C1C92F1CEC4CBE00425D5F /* HomeViewController.m */; };
19 | 73C1C93B1CEC4CBE00425D5F /* EAThemeDemo.html in Resources */ = {isa = PBXBuildFile; fileRef = 73C1C9311CEC4CBE00425D5F /* EAThemeDemo.html */; };
20 | 73C1C93C1CEC4CBE00425D5F /* SettingViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 73C1C9341CEC4CBE00425D5F /* SettingViewController.m */; };
21 | 73C1C93D1CEC4CBE00425D5F /* ThemesSettingViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 73C1C9361CEC4CBE00425D5F /* ThemesSettingViewController.m */; };
22 | 73C1C95D1CEC74CC00425D5F /* EAThemeManager.m in Sources */ = {isa = PBXBuildFile; fileRef = 73C1C95A1CEC74CC00425D5F /* EAThemeManager.m */; };
23 | 73C1C95E1CEC74CC00425D5F /* UIView+EATheme.m in Sources */ = {isa = PBXBuildFile; fileRef = 73C1C95C1CEC74CC00425D5F /* UIView+EATheme.m */; };
24 | /* End PBXBuildFile section */
25 |
26 | /* Begin PBXFileReference section */
27 | 73C1C8BC1CEB0F1D00425D5F /* EAThemeSample.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = EAThemeSample.app; sourceTree = BUILT_PRODUCTS_DIR; };
28 | 73C1C8C01CEB0F1D00425D5F /* main.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = main.m; sourceTree = ""; };
29 | 73C1C8C21CEB0F1D00425D5F /* AppDelegate.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = AppDelegate.h; sourceTree = ""; };
30 | 73C1C8C31CEB0F1D00425D5F /* AppDelegate.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = AppDelegate.m; sourceTree = ""; };
31 | 73C1C8C91CEB0F1D00425D5F /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = ""; };
32 | 73C1C8CB1CEB0F1D00425D5F /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = ""; };
33 | 73C1C8CE1CEB0F1D00425D5F /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/LaunchScreen.storyboard; sourceTree = ""; };
34 | 73C1C8D01CEB0F1D00425D5F /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; };
35 | 73C1C9271CEC4CBE00425D5F /* BaseNavigationController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = BaseNavigationController.h; sourceTree = ""; };
36 | 73C1C9281CEC4CBE00425D5F /* BaseNavigationController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = BaseNavigationController.m; sourceTree = ""; };
37 | 73C1C9291CEC4CBE00425D5F /* BaseViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = BaseViewController.h; sourceTree = ""; };
38 | 73C1C92A1CEC4CBE00425D5F /* BaseViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = BaseViewController.m; sourceTree = ""; };
39 | 73C1C92C1CEC4CBE00425D5F /* DetailViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DetailViewController.h; sourceTree = ""; };
40 | 73C1C92D1CEC4CBE00425D5F /* DetailViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = DetailViewController.m; sourceTree = ""; };
41 | 73C1C92E1CEC4CBE00425D5F /* HomeViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = HomeViewController.h; sourceTree = ""; };
42 | 73C1C92F1CEC4CBE00425D5F /* HomeViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = HomeViewController.m; sourceTree = ""; };
43 | 73C1C9311CEC4CBE00425D5F /* EAThemeDemo.html */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.html; path = EAThemeDemo.html; sourceTree = ""; };
44 | 73C1C9331CEC4CBE00425D5F /* SettingViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SettingViewController.h; sourceTree = ""; };
45 | 73C1C9341CEC4CBE00425D5F /* SettingViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = SettingViewController.m; sourceTree = ""; };
46 | 73C1C9351CEC4CBE00425D5F /* ThemesSettingViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ThemesSettingViewController.h; sourceTree = ""; };
47 | 73C1C9361CEC4CBE00425D5F /* ThemesSettingViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ThemesSettingViewController.m; sourceTree = ""; };
48 | 73C1C9551CEC74CC00425D5F /* EATheme.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = EATheme.h; sourceTree = ""; };
49 | 73C1C9561CEC74CC00425D5F /* EAThemesConfiguration.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = EAThemesConfiguration.h; sourceTree = ""; };
50 | 73C1C9581CEC74CC00425D5F /* EA_metamacros.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = EA_metamacros.h; sourceTree = ""; };
51 | 73C1C9591CEC74CC00425D5F /* EAThemeManager.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = EAThemeManager.h; sourceTree = ""; };
52 | 73C1C95A1CEC74CC00425D5F /* EAThemeManager.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = EAThemeManager.m; sourceTree = ""; };
53 | 73C1C95B1CEC74CC00425D5F /* UIView+EATheme.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "UIView+EATheme.h"; sourceTree = ""; };
54 | 73C1C95C1CEC74CC00425D5F /* UIView+EATheme.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "UIView+EATheme.m"; sourceTree = ""; };
55 | /* End PBXFileReference section */
56 |
57 | /* Begin PBXFrameworksBuildPhase section */
58 | 73C1C8B91CEB0F1D00425D5F /* Frameworks */ = {
59 | isa = PBXFrameworksBuildPhase;
60 | buildActionMask = 2147483647;
61 | files = (
62 | );
63 | runOnlyForDeploymentPostprocessing = 0;
64 | };
65 | /* End PBXFrameworksBuildPhase section */
66 |
67 | /* Begin PBXGroup section */
68 | 73C1C8B31CEB0F1D00425D5F = {
69 | isa = PBXGroup;
70 | children = (
71 | 73C1C9541CEC74CC00425D5F /* EATheme */,
72 | 73C1C8BE1CEB0F1D00425D5F /* EAThemeSample */,
73 | 73C1C8BD1CEB0F1D00425D5F /* Products */,
74 | );
75 | sourceTree = "";
76 | };
77 | 73C1C8BD1CEB0F1D00425D5F /* Products */ = {
78 | isa = PBXGroup;
79 | children = (
80 | 73C1C8BC1CEB0F1D00425D5F /* EAThemeSample.app */,
81 | );
82 | name = Products;
83 | sourceTree = "";
84 | };
85 | 73C1C8BE1CEB0F1D00425D5F /* EAThemeSample */ = {
86 | isa = PBXGroup;
87 | children = (
88 | 73C1C9251CEC4CBE00425D5F /* Demo */,
89 | 73C1C8C21CEB0F1D00425D5F /* AppDelegate.h */,
90 | 73C1C8C31CEB0F1D00425D5F /* AppDelegate.m */,
91 | 73C1C8C81CEB0F1D00425D5F /* Main.storyboard */,
92 | 73C1C8CB1CEB0F1D00425D5F /* Assets.xcassets */,
93 | 73C1C8CD1CEB0F1D00425D5F /* LaunchScreen.storyboard */,
94 | 73C1C8D01CEB0F1D00425D5F /* Info.plist */,
95 | 73C1C8BF1CEB0F1D00425D5F /* Supporting Files */,
96 | );
97 | path = EAThemeSample;
98 | sourceTree = "";
99 | };
100 | 73C1C8BF1CEB0F1D00425D5F /* Supporting Files */ = {
101 | isa = PBXGroup;
102 | children = (
103 | 73C1C8C01CEB0F1D00425D5F /* main.m */,
104 | );
105 | name = "Supporting Files";
106 | sourceTree = "";
107 | };
108 | 73C1C9251CEC4CBE00425D5F /* Demo */ = {
109 | isa = PBXGroup;
110 | children = (
111 | 73C1C9261CEC4CBE00425D5F /* Base */,
112 | 73C1C92B1CEC4CBE00425D5F /* Home */,
113 | 73C1C9301CEC4CBE00425D5F /* resource */,
114 | 73C1C9321CEC4CBE00425D5F /* Settings */,
115 | );
116 | path = Demo;
117 | sourceTree = "";
118 | };
119 | 73C1C9261CEC4CBE00425D5F /* Base */ = {
120 | isa = PBXGroup;
121 | children = (
122 | 73C1C9271CEC4CBE00425D5F /* BaseNavigationController.h */,
123 | 73C1C9281CEC4CBE00425D5F /* BaseNavigationController.m */,
124 | 73C1C9291CEC4CBE00425D5F /* BaseViewController.h */,
125 | 73C1C92A1CEC4CBE00425D5F /* BaseViewController.m */,
126 | );
127 | path = Base;
128 | sourceTree = "";
129 | };
130 | 73C1C92B1CEC4CBE00425D5F /* Home */ = {
131 | isa = PBXGroup;
132 | children = (
133 | 73C1C92C1CEC4CBE00425D5F /* DetailViewController.h */,
134 | 73C1C92D1CEC4CBE00425D5F /* DetailViewController.m */,
135 | 73C1C92E1CEC4CBE00425D5F /* HomeViewController.h */,
136 | 73C1C92F1CEC4CBE00425D5F /* HomeViewController.m */,
137 | );
138 | path = Home;
139 | sourceTree = "";
140 | };
141 | 73C1C9301CEC4CBE00425D5F /* resource */ = {
142 | isa = PBXGroup;
143 | children = (
144 | 73C1C9311CEC4CBE00425D5F /* EAThemeDemo.html */,
145 | );
146 | path = resource;
147 | sourceTree = "";
148 | };
149 | 73C1C9321CEC4CBE00425D5F /* Settings */ = {
150 | isa = PBXGroup;
151 | children = (
152 | 73C1C9331CEC4CBE00425D5F /* SettingViewController.h */,
153 | 73C1C9341CEC4CBE00425D5F /* SettingViewController.m */,
154 | 73C1C9351CEC4CBE00425D5F /* ThemesSettingViewController.h */,
155 | 73C1C9361CEC4CBE00425D5F /* ThemesSettingViewController.m */,
156 | );
157 | path = Settings;
158 | sourceTree = "";
159 | };
160 | 73C1C9541CEC74CC00425D5F /* EATheme */ = {
161 | isa = PBXGroup;
162 | children = (
163 | 73C1C9551CEC74CC00425D5F /* EATheme.h */,
164 | 73C1C9561CEC74CC00425D5F /* EAThemesConfiguration.h */,
165 | 73C1C9571CEC74CC00425D5F /* Handle */,
166 | );
167 | path = EATheme;
168 | sourceTree = "";
169 | };
170 | 73C1C9571CEC74CC00425D5F /* Handle */ = {
171 | isa = PBXGroup;
172 | children = (
173 | 73C1C9581CEC74CC00425D5F /* EA_metamacros.h */,
174 | 73C1C9591CEC74CC00425D5F /* EAThemeManager.h */,
175 | 73C1C95A1CEC74CC00425D5F /* EAThemeManager.m */,
176 | 73C1C95B1CEC74CC00425D5F /* UIView+EATheme.h */,
177 | 73C1C95C1CEC74CC00425D5F /* UIView+EATheme.m */,
178 | );
179 | path = Handle;
180 | sourceTree = "";
181 | };
182 | /* End PBXGroup section */
183 |
184 | /* Begin PBXNativeTarget section */
185 | 73C1C8BB1CEB0F1D00425D5F /* EAThemeSample */ = {
186 | isa = PBXNativeTarget;
187 | buildConfigurationList = 73C1C8D31CEB0F1D00425D5F /* Build configuration list for PBXNativeTarget "EAThemeSample" */;
188 | buildPhases = (
189 | 73C1C8B81CEB0F1D00425D5F /* Sources */,
190 | 73C1C8B91CEB0F1D00425D5F /* Frameworks */,
191 | 73C1C8BA1CEB0F1D00425D5F /* Resources */,
192 | );
193 | buildRules = (
194 | );
195 | dependencies = (
196 | );
197 | name = EAThemeSample;
198 | productName = EAThemeSample;
199 | productReference = 73C1C8BC1CEB0F1D00425D5F /* EAThemeSample.app */;
200 | productType = "com.apple.product-type.application";
201 | };
202 | /* End PBXNativeTarget section */
203 |
204 | /* Begin PBXProject section */
205 | 73C1C8B41CEB0F1D00425D5F /* Project object */ = {
206 | isa = PBXProject;
207 | attributes = {
208 | LastUpgradeCheck = 0720;
209 | ORGANIZATIONNAME = Eiwodetianna;
210 | TargetAttributes = {
211 | 73C1C8BB1CEB0F1D00425D5F = {
212 | CreatedOnToolsVersion = 7.2;
213 | };
214 | };
215 | };
216 | buildConfigurationList = 73C1C8B71CEB0F1D00425D5F /* Build configuration list for PBXProject "EAThemeSample" */;
217 | compatibilityVersion = "Xcode 3.2";
218 | developmentRegion = English;
219 | hasScannedForEncodings = 0;
220 | knownRegions = (
221 | en,
222 | Base,
223 | );
224 | mainGroup = 73C1C8B31CEB0F1D00425D5F;
225 | productRefGroup = 73C1C8BD1CEB0F1D00425D5F /* Products */;
226 | projectDirPath = "";
227 | projectRoot = "";
228 | targets = (
229 | 73C1C8BB1CEB0F1D00425D5F /* EAThemeSample */,
230 | );
231 | };
232 | /* End PBXProject section */
233 |
234 | /* Begin PBXResourcesBuildPhase section */
235 | 73C1C8BA1CEB0F1D00425D5F /* Resources */ = {
236 | isa = PBXResourcesBuildPhase;
237 | buildActionMask = 2147483647;
238 | files = (
239 | 73C1C8CF1CEB0F1D00425D5F /* LaunchScreen.storyboard in Resources */,
240 | 73C1C93B1CEC4CBE00425D5F /* EAThemeDemo.html in Resources */,
241 | 73C1C8CC1CEB0F1D00425D5F /* Assets.xcassets in Resources */,
242 | 73C1C8CA1CEB0F1D00425D5F /* Main.storyboard in Resources */,
243 | );
244 | runOnlyForDeploymentPostprocessing = 0;
245 | };
246 | /* End PBXResourcesBuildPhase section */
247 |
248 | /* Begin PBXSourcesBuildPhase section */
249 | 73C1C8B81CEB0F1D00425D5F /* Sources */ = {
250 | isa = PBXSourcesBuildPhase;
251 | buildActionMask = 2147483647;
252 | files = (
253 | 73C1C9371CEC4CBE00425D5F /* BaseNavigationController.m in Sources */,
254 | 73C1C9391CEC4CBE00425D5F /* DetailViewController.m in Sources */,
255 | 73C1C95E1CEC74CC00425D5F /* UIView+EATheme.m in Sources */,
256 | 73C1C8C41CEB0F1D00425D5F /* AppDelegate.m in Sources */,
257 | 73C1C93A1CEC4CBE00425D5F /* HomeViewController.m in Sources */,
258 | 73C1C8C11CEB0F1D00425D5F /* main.m in Sources */,
259 | 73C1C9381CEC4CBE00425D5F /* BaseViewController.m in Sources */,
260 | 73C1C93D1CEC4CBE00425D5F /* ThemesSettingViewController.m in Sources */,
261 | 73C1C95D1CEC74CC00425D5F /* EAThemeManager.m in Sources */,
262 | 73C1C93C1CEC4CBE00425D5F /* SettingViewController.m in Sources */,
263 | );
264 | runOnlyForDeploymentPostprocessing = 0;
265 | };
266 | /* End PBXSourcesBuildPhase section */
267 |
268 | /* Begin PBXVariantGroup section */
269 | 73C1C8C81CEB0F1D00425D5F /* Main.storyboard */ = {
270 | isa = PBXVariantGroup;
271 | children = (
272 | 73C1C8C91CEB0F1D00425D5F /* Base */,
273 | );
274 | name = Main.storyboard;
275 | sourceTree = "";
276 | };
277 | 73C1C8CD1CEB0F1D00425D5F /* LaunchScreen.storyboard */ = {
278 | isa = PBXVariantGroup;
279 | children = (
280 | 73C1C8CE1CEB0F1D00425D5F /* Base */,
281 | );
282 | name = LaunchScreen.storyboard;
283 | sourceTree = "";
284 | };
285 | /* End PBXVariantGroup section */
286 |
287 | /* Begin XCBuildConfiguration section */
288 | 73C1C8D11CEB0F1D00425D5F /* Debug */ = {
289 | isa = XCBuildConfiguration;
290 | buildSettings = {
291 | ALWAYS_SEARCH_USER_PATHS = NO;
292 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x";
293 | CLANG_CXX_LIBRARY = "libc++";
294 | CLANG_ENABLE_MODULES = YES;
295 | CLANG_ENABLE_OBJC_ARC = YES;
296 | CLANG_WARN_BOOL_CONVERSION = YES;
297 | CLANG_WARN_CONSTANT_CONVERSION = YES;
298 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
299 | CLANG_WARN_EMPTY_BODY = YES;
300 | CLANG_WARN_ENUM_CONVERSION = YES;
301 | CLANG_WARN_INT_CONVERSION = YES;
302 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
303 | CLANG_WARN_UNREACHABLE_CODE = YES;
304 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
305 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
306 | COPY_PHASE_STRIP = NO;
307 | DEBUG_INFORMATION_FORMAT = dwarf;
308 | ENABLE_STRICT_OBJC_MSGSEND = YES;
309 | ENABLE_TESTABILITY = YES;
310 | GCC_C_LANGUAGE_STANDARD = gnu99;
311 | GCC_DYNAMIC_NO_PIC = NO;
312 | GCC_NO_COMMON_BLOCKS = YES;
313 | GCC_OPTIMIZATION_LEVEL = 0;
314 | GCC_PREPROCESSOR_DEFINITIONS = (
315 | "DEBUG=1",
316 | "$(inherited)",
317 | );
318 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
319 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
320 | GCC_WARN_UNDECLARED_SELECTOR = YES;
321 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
322 | GCC_WARN_UNUSED_FUNCTION = YES;
323 | GCC_WARN_UNUSED_VARIABLE = YES;
324 | IPHONEOS_DEPLOYMENT_TARGET = 9.2;
325 | MTL_ENABLE_DEBUG_INFO = YES;
326 | ONLY_ACTIVE_ARCH = YES;
327 | SDKROOT = iphoneos;
328 | };
329 | name = Debug;
330 | };
331 | 73C1C8D21CEB0F1D00425D5F /* Release */ = {
332 | isa = XCBuildConfiguration;
333 | buildSettings = {
334 | ALWAYS_SEARCH_USER_PATHS = NO;
335 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x";
336 | CLANG_CXX_LIBRARY = "libc++";
337 | CLANG_ENABLE_MODULES = YES;
338 | CLANG_ENABLE_OBJC_ARC = YES;
339 | CLANG_WARN_BOOL_CONVERSION = YES;
340 | CLANG_WARN_CONSTANT_CONVERSION = YES;
341 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
342 | CLANG_WARN_EMPTY_BODY = YES;
343 | CLANG_WARN_ENUM_CONVERSION = YES;
344 | CLANG_WARN_INT_CONVERSION = YES;
345 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
346 | CLANG_WARN_UNREACHABLE_CODE = YES;
347 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
348 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
349 | COPY_PHASE_STRIP = NO;
350 | DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
351 | ENABLE_NS_ASSERTIONS = NO;
352 | ENABLE_STRICT_OBJC_MSGSEND = YES;
353 | GCC_C_LANGUAGE_STANDARD = gnu99;
354 | GCC_NO_COMMON_BLOCKS = YES;
355 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
356 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
357 | GCC_WARN_UNDECLARED_SELECTOR = YES;
358 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
359 | GCC_WARN_UNUSED_FUNCTION = YES;
360 | GCC_WARN_UNUSED_VARIABLE = YES;
361 | IPHONEOS_DEPLOYMENT_TARGET = 9.2;
362 | MTL_ENABLE_DEBUG_INFO = NO;
363 | SDKROOT = iphoneos;
364 | VALIDATE_PRODUCT = YES;
365 | };
366 | name = Release;
367 | };
368 | 73C1C8D41CEB0F1D00425D5F /* Debug */ = {
369 | isa = XCBuildConfiguration;
370 | buildSettings = {
371 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
372 | INFOPLIST_FILE = EAThemeSample/Info.plist;
373 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
374 | PRODUCT_BUNDLE_IDENTIFIER = com.Eiwodetianna.EAThemeSample;
375 | PRODUCT_NAME = "$(TARGET_NAME)";
376 | };
377 | name = Debug;
378 | };
379 | 73C1C8D51CEB0F1D00425D5F /* Release */ = {
380 | isa = XCBuildConfiguration;
381 | buildSettings = {
382 | ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
383 | INFOPLIST_FILE = EAThemeSample/Info.plist;
384 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
385 | PRODUCT_BUNDLE_IDENTIFIER = com.Eiwodetianna.EAThemeSample;
386 | PRODUCT_NAME = "$(TARGET_NAME)";
387 | };
388 | name = Release;
389 | };
390 | /* End XCBuildConfiguration section */
391 |
392 | /* Begin XCConfigurationList section */
393 | 73C1C8B71CEB0F1D00425D5F /* Build configuration list for PBXProject "EAThemeSample" */ = {
394 | isa = XCConfigurationList;
395 | buildConfigurations = (
396 | 73C1C8D11CEB0F1D00425D5F /* Debug */,
397 | 73C1C8D21CEB0F1D00425D5F /* Release */,
398 | );
399 | defaultConfigurationIsVisible = 0;
400 | defaultConfigurationName = Release;
401 | };
402 | 73C1C8D31CEB0F1D00425D5F /* Build configuration list for PBXNativeTarget "EAThemeSample" */ = {
403 | isa = XCConfigurationList;
404 | buildConfigurations = (
405 | 73C1C8D41CEB0F1D00425D5F /* Debug */,
406 | 73C1C8D51CEB0F1D00425D5F /* Release */,
407 | );
408 | defaultConfigurationIsVisible = 0;
409 | defaultConfigurationName = Release;
410 | };
411 | /* End XCConfigurationList section */
412 | };
413 | rootObject = 73C1C8B41CEB0F1D00425D5F /* Project object */;
414 | }
415 |
--------------------------------------------------------------------------------
/EATheme/Handle/EA_metamacros.h:
--------------------------------------------------------------------------------
1 | //
2 | //
3 | /**
4 | * This file's code reference to ReactiveCocoa
5 | * Macros for metaprogramming
6 | * ExtendedC
7 | *
8 | * Copyright (C) 2012 Justin Spahr-Summers
9 | * Released under the MIT license
10 | */
11 | //
12 |
13 | #ifndef EA_metamacros_h
14 | #define EA_metamacros_h
15 |
16 |
17 | /**
18 | * Executes one or more expressions (which may have a void type, such as a call
19 | * to a function that returns no value) and always returns true.
20 | */
21 | #define ea_metamacro_exprify(...) \
22 | ((__VA_ARGS__), true)
23 |
24 | /**
25 | * Returns a string representation of VALUE after full macro expansion.
26 | */
27 | #define ea_metamacro_stringify(VALUE) \
28 | ea_metamacro_stringify_(VALUE)
29 |
30 | /**
31 | * Returns A and B concatenated after full macro expansion.
32 | */
33 | #define ea_metamacro_concat(A, B) \
34 | ea_metamacro_concat_(A, B)
35 |
36 | /**
37 | * Returns the Nth variadic argument (starting from zero). At least
38 | * N + 1 variadic arguments must be given. N must be between zero and twenty,
39 | * inclusive.
40 | */
41 | #define ea_metamacro_at(N, ...) \
42 | ea_metamacro_concat(ea_metamacro_at, N)(__VA_ARGS__)
43 |
44 | /**
45 | * Returns the number of arguments (up to twenty) provided to the macro. At
46 | * least one argument must be provided.
47 | *
48 | * Inspired by P99: http://p99.gforge.inria.fr
49 | */
50 | #define ea_metamacro_argcount(...) \
51 | ea_metamacro_at(20, __VA_ARGS__, 20, 19, 18, 17, 16, 15, 14, 13, 12, 11, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1)
52 |
53 | /**
54 | * Identical to #ea_metamacro_foreach_cxt, except that no CONTEXT argument is
55 | * given. Only the index and current argument will thus be passed to MACRO.
56 | */
57 | #define ea_metamacro_foreach(MACRO, SEP, ...) \
58 | ea_metamacro_foreach_cxt(ea_metamacro_foreach_iter, SEP, MACRO, __VA_ARGS__)
59 |
60 | /**
61 | * For each consecutive variadic argument (up to twenty), MACRO is passed the
62 | * zero-based index of the current argument, CONTEXT, and then the argument
63 | * itself. The results of adjoining invocations of MACRO are then separated by
64 | * SEP.
65 | *
66 | * Inspired by P99: http://p99.gforge.inria.fr
67 | */
68 | #define ea_metamacro_foreach_cxt(MACRO, SEP, CONTEXT, ...) \
69 | ea_metamacro_concat(ea_metamacro_foreach_cxt, ea_metamacro_argcount(__VA_ARGS__))(MACRO, SEP, CONTEXT, __VA_ARGS__)
70 |
71 | /**
72 | * Identical to #ea_metamacro_foreach_cxt. This can be used when the former would
73 | * fail due to recursive macro expansion.
74 | */
75 | #define ea_metamacro_foreach_cxt_recursive(MACRO, SEP, CONTEXT, ...) \
76 | ea_metamacro_concat(ea_metamacro_foreach_cxt_recursive, ea_metamacro_argcount(__VA_ARGS__))(MACRO, SEP, CONTEXT, __VA_ARGS__)
77 |
78 | /**
79 | * In consecutive order, appends each variadic argument (up to twenty) onto
80 | * BASE. The resulting concatenations are then separated by SEP.
81 | *
82 | * This is primarily useful to manipulate a list of macro invocations into instead
83 | * invoking a different, possibly related macro.
84 | */
85 | #define ea_metamacro_foreach_concat(BASE, SEP, ...) \
86 | ea_metamacro_foreach_cxt(ea_metamacro_foreach_concat_iter, SEP, BASE, __VA_ARGS__)
87 |
88 | /**
89 | * Iterates COUNT times, each time invoking MACRO with the current index
90 | * (starting at zero) and CONTEXT. The results of adjoining invocations of MACRO
91 | * are then separated by SEP.
92 | *
93 | * COUNT must be an integer between zero and twenty, inclusive.
94 | */
95 | #define ea_metamacro_for_cxt(COUNT, MACRO, SEP, CONTEXT) \
96 | ea_metamacro_concat(ea_metamacro_for_cxt, COUNT)(MACRO, SEP, CONTEXT)
97 |
98 | /**
99 | * Returns the first argument given. At least one argument must be provided.
100 | *
101 | * This is useful when implementing a variadic macro, where you may have only
102 | * one variadic argument, but no way to retrieve it (for example, because \c ...
103 | * always needs to match at least one argument).
104 | *
105 | * @code
106 |
107 | #define varmacro(...) \
108 | ea_metamacro_head(__VA_ARGS__)
109 |
110 | * @endcode
111 | */
112 | #define ea_metamacro_head(...) \
113 | ea_metamacro_head_(__VA_ARGS__, 0)
114 |
115 | /**
116 | * Returns every argument except the first. At least two arguments must be
117 | * provided.
118 | */
119 | #define ea_metamacro_tail(...) \
120 | ea_metamacro_tail_(__VA_ARGS__)
121 |
122 | /**
123 | * Returns the first N (up to twenty) variadic arguments as a new argument list.
124 | * At least N variadic arguments must be provided.
125 | */
126 | #define ea_metamacro_take(N, ...) \
127 | ea_metamacro_concat(ea_metamacro_take, N)(__VA_ARGS__)
128 |
129 | /**
130 | * Removes the first N (up to twenty) variadic arguments from the given argument
131 | * list. At least N variadic arguments must be provided.
132 | */
133 | #define ea_metamacro_drop(N, ...) \
134 | ea_metamacro_concat(ea_metamacro_drop, N)(__VA_ARGS__)
135 |
136 | /**
137 | * Decrements VAL, which must be a number between zero and twenty, inclusive.
138 | *
139 | * This is primarily useful when dealing with indexes and counts in
140 | * metaprogramming.
141 | */
142 | #define ea_metamacro_dec(VAL) \
143 | ea_metamacro_at(VAL, -1, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19)
144 |
145 | /**
146 | * Increments VAL, which must be a number between zero and twenty, inclusive.
147 | *
148 | * This is primarily useful when dealing with indexes and counts in
149 | * metaprogramming.
150 | */
151 | #define ea_metamacro_inc(VAL) \
152 | ea_metamacro_at(VAL, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21)
153 |
154 | /**
155 | * If A is equal to B, the next argument list is expanded; otherwise, the
156 | * argument list after that is expanded. A and B must be numbers between zero
157 | * and twenty, inclusive. Additionally, B must be greater than or equal to A.
158 | *
159 | * @code
160 |
161 | // expands to true
162 | ea_metamacro_if_eq(0, 0)(true)(false)
163 |
164 | // expands to false
165 | ea_metamacro_if_eq(0, 1)(true)(false)
166 |
167 | * @endcode
168 | *
169 | * This is primarily useful when dealing with indexes and counts in
170 | * metaprogramming.
171 | */
172 | #define ea_metamacro_if_eq(A, B) \
173 | ea_metamacro_concat(ea_metamacro_if_eq, A)(B)
174 |
175 | /**
176 | * Identical to #ea_metamacro_if_eq. This can be used when the former would fail
177 | * due to recursive macro expansion.
178 | */
179 | #define ea_metamacro_if_eq_recursive(A, B) \
180 | ea_metamacro_concat(ea_metamacro_if_eq_recursive, A)(B)
181 |
182 | /**
183 | * Returns 1 if N is an even number, or 0 otherwise. N must be between zero and
184 | * twenty, inclusive.
185 | *
186 | * For the purposes of this test, zero is considered even.
187 | */
188 | #define ea_metamacro_is_even(N) \
189 | ea_metamacro_at(N, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1)
190 |
191 | /**
192 | * Returns the logical NOT of B, which must be the number zero or one.
193 | */
194 | #define ea_metamacro_not(B) \
195 | ea_metamacro_at(B, 1, 0)
196 |
197 | // IMPLEMENTATION DETAILS FOLLOW!
198 | // Do not write code that depends on anything below this line.
199 | #define ea_metamacro_stringify_(VALUE) # VALUE
200 | #define ea_metamacro_concat_(A, B) A ## B
201 | #define ea_metamacro_foreach_iter(INDEX, MACRO, ARG) MACRO(INDEX, ARG)
202 | #define ea_metamacro_head_(FIRST, ...) FIRST
203 | #define ea_metamacro_tail_(FIRST, ...) __VA_ARGS__
204 | #define ea_metamacro_consume_(...)
205 | #define ea_metamacro_expand_(...) __VA_ARGS__
206 |
207 | // implemented from scratch so that ea_metamacro_concat() doesn't end up nesting
208 | #define ea_metamacro_foreach_concat_iter(INDEX, BASE, ARG) ea_metamacro_foreach_concat_iter_(BASE, ARG)
209 | #define ea_metamacro_foreach_concat_iter_(BASE, ARG) BASE ## ARG
210 |
211 | // ea_metamacro_at expansions
212 | #define ea_metamacro_at0(...) ea_metamacro_head(__VA_ARGS__)
213 | #define ea_metamacro_at1(_0, ...) ea_metamacro_head(__VA_ARGS__)
214 | #define ea_metamacro_at2(_0, _1, ...) ea_metamacro_head(__VA_ARGS__)
215 | #define ea_metamacro_at3(_0, _1, _2, ...) ea_metamacro_head(__VA_ARGS__)
216 | #define ea_metamacro_at4(_0, _1, _2, _3, ...) ea_metamacro_head(__VA_ARGS__)
217 | #define ea_metamacro_at5(_0, _1, _2, _3, _4, ...) ea_metamacro_head(__VA_ARGS__)
218 | #define ea_metamacro_at6(_0, _1, _2, _3, _4, _5, ...) ea_metamacro_head(__VA_ARGS__)
219 | #define ea_metamacro_at7(_0, _1, _2, _3, _4, _5, _6, ...) ea_metamacro_head(__VA_ARGS__)
220 | #define ea_metamacro_at8(_0, _1, _2, _3, _4, _5, _6, _7, ...) ea_metamacro_head(__VA_ARGS__)
221 | #define ea_metamacro_at9(_0, _1, _2, _3, _4, _5, _6, _7, _8, ...) ea_metamacro_head(__VA_ARGS__)
222 | #define ea_metamacro_at10(_0, _1, _2, _3, _4, _5, _6, _7, _8, _9, ...) ea_metamacro_head(__VA_ARGS__)
223 | #define ea_metamacro_at11(_0, _1, _2, _3, _4, _5, _6, _7, _8, _9, _10, ...) ea_metamacro_head(__VA_ARGS__)
224 | #define ea_metamacro_at12(_0, _1, _2, _3, _4, _5, _6, _7, _8, _9, _10, _11, ...) ea_metamacro_head(__VA_ARGS__)
225 | #define ea_metamacro_at13(_0, _1, _2, _3, _4, _5, _6, _7, _8, _9, _10, _11, _12, ...) ea_metamacro_head(__VA_ARGS__)
226 | #define ea_metamacro_at14(_0, _1, _2, _3, _4, _5, _6, _7, _8, _9, _10, _11, _12, _13, ...) ea_metamacro_head(__VA_ARGS__)
227 | #define ea_metamacro_at15(_0, _1, _2, _3, _4, _5, _6, _7, _8, _9, _10, _11, _12, _13, _14, ...) ea_metamacro_head(__VA_ARGS__)
228 | #define ea_metamacro_at16(_0, _1, _2, _3, _4, _5, _6, _7, _8, _9, _10, _11, _12, _13, _14, _15, ...) ea_metamacro_head(__VA_ARGS__)
229 | #define ea_metamacro_at17(_0, _1, _2, _3, _4, _5, _6, _7, _8, _9, _10, _11, _12, _13, _14, _15, _16, ...) ea_metamacro_head(__VA_ARGS__)
230 | #define ea_metamacro_at18(_0, _1, _2, _3, _4, _5, _6, _7, _8, _9, _10, _11, _12, _13, _14, _15, _16, _17, ...) ea_metamacro_head(__VA_ARGS__)
231 | #define ea_metamacro_at19(_0, _1, _2, _3, _4, _5, _6, _7, _8, _9, _10, _11, _12, _13, _14, _15, _16, _17, _18, ...) ea_metamacro_head(__VA_ARGS__)
232 | #define ea_metamacro_at20(_0, _1, _2, _3, _4, _5, _6, _7, _8, _9, _10, _11, _12, _13, _14, _15, _16, _17, _18, _19, ...) ea_metamacro_head(__VA_ARGS__)
233 |
234 | // ea_metamacro_foreach_cxt expansions
235 | #define ea_metamacro_foreach_cxt0(MACRO, SEP, CONTEXT)
236 | #define ea_metamacro_foreach_cxt1(MACRO, SEP, CONTEXT, _0) MACRO(0, CONTEXT, _0)
237 |
238 | #define ea_metamacro_foreach_cxt2(MACRO, SEP, CONTEXT, _0, _1) \
239 | ea_metamacro_foreach_cxt1(MACRO, SEP, CONTEXT, _0) \
240 | SEP \
241 | MACRO(1, CONTEXT, _1)
242 |
243 | #define ea_metamacro_foreach_cxt3(MACRO, SEP, CONTEXT, _0, _1, _2) \
244 | ea_metamacro_foreach_cxt2(MACRO, SEP, CONTEXT, _0, _1) \
245 | SEP \
246 | MACRO(2, CONTEXT, _2)
247 |
248 | #define ea_metamacro_foreach_cxt4(MACRO, SEP, CONTEXT, _0, _1, _2, _3) \
249 | ea_metamacro_foreach_cxt3(MACRO, SEP, CONTEXT, _0, _1, _2) \
250 | SEP \
251 | MACRO(3, CONTEXT, _3)
252 |
253 | #define ea_metamacro_foreach_cxt5(MACRO, SEP, CONTEXT, _0, _1, _2, _3, _4) \
254 | ea_metamacro_foreach_cxt4(MACRO, SEP, CONTEXT, _0, _1, _2, _3) \
255 | SEP \
256 | MACRO(4, CONTEXT, _4)
257 |
258 | #define ea_metamacro_foreach_cxt6(MACRO, SEP, CONTEXT, _0, _1, _2, _3, _4, _5) \
259 | ea_metamacro_foreach_cxt5(MACRO, SEP, CONTEXT, _0, _1, _2, _3, _4) \
260 | SEP \
261 | MACRO(5, CONTEXT, _5)
262 |
263 | #define ea_metamacro_foreach_cxt7(MACRO, SEP, CONTEXT, _0, _1, _2, _3, _4, _5, _6) \
264 | ea_metamacro_foreach_cxt6(MACRO, SEP, CONTEXT, _0, _1, _2, _3, _4, _5) \
265 | SEP \
266 | MACRO(6, CONTEXT, _6)
267 |
268 | #define ea_metamacro_foreach_cxt8(MACRO, SEP, CONTEXT, _0, _1, _2, _3, _4, _5, _6, _7) \
269 | ea_metamacro_foreach_cxt7(MACRO, SEP, CONTEXT, _0, _1, _2, _3, _4, _5, _6) \
270 | SEP \
271 | MACRO(7, CONTEXT, _7)
272 |
273 | #define ea_metamacro_foreach_cxt9(MACRO, SEP, CONTEXT, _0, _1, _2, _3, _4, _5, _6, _7, _8) \
274 | ea_metamacro_foreach_cxt8(MACRO, SEP, CONTEXT, _0, _1, _2, _3, _4, _5, _6, _7) \
275 | SEP \
276 | MACRO(8, CONTEXT, _8)
277 |
278 | #define ea_metamacro_foreach_cxt10(MACRO, SEP, CONTEXT, _0, _1, _2, _3, _4, _5, _6, _7, _8, _9) \
279 | ea_metamacro_foreach_cxt9(MACRO, SEP, CONTEXT, _0, _1, _2, _3, _4, _5, _6, _7, _8) \
280 | SEP \
281 | MACRO(9, CONTEXT, _9)
282 |
283 | #define ea_metamacro_foreach_cxt11(MACRO, SEP, CONTEXT, _0, _1, _2, _3, _4, _5, _6, _7, _8, _9, _10) \
284 | ea_metamacro_foreach_cxt10(MACRO, SEP, CONTEXT, _0, _1, _2, _3, _4, _5, _6, _7, _8, _9) \
285 | SEP \
286 | MACRO(10, CONTEXT, _10)
287 |
288 | #define ea_metamacro_foreach_cxt12(MACRO, SEP, CONTEXT, _0, _1, _2, _3, _4, _5, _6, _7, _8, _9, _10, _11) \
289 | ea_metamacro_foreach_cxt11(MACRO, SEP, CONTEXT, _0, _1, _2, _3, _4, _5, _6, _7, _8, _9, _10) \
290 | SEP \
291 | MACRO(11, CONTEXT, _11)
292 |
293 | #define ea_metamacro_foreach_cxt13(MACRO, SEP, CONTEXT, _0, _1, _2, _3, _4, _5, _6, _7, _8, _9, _10, _11, _12) \
294 | ea_metamacro_foreach_cxt12(MACRO, SEP, CONTEXT, _0, _1, _2, _3, _4, _5, _6, _7, _8, _9, _10, _11) \
295 | SEP \
296 | MACRO(12, CONTEXT, _12)
297 |
298 | #define ea_metamacro_foreach_cxt14(MACRO, SEP, CONTEXT, _0, _1, _2, _3, _4, _5, _6, _7, _8, _9, _10, _11, _12, _13) \
299 | ea_metamacro_foreach_cxt13(MACRO, SEP, CONTEXT, _0, _1, _2, _3, _4, _5, _6, _7, _8, _9, _10, _11, _12) \
300 | SEP \
301 | MACRO(13, CONTEXT, _13)
302 |
303 | #define ea_metamacro_foreach_cxt15(MACRO, SEP, CONTEXT, _0, _1, _2, _3, _4, _5, _6, _7, _8, _9, _10, _11, _12, _13, _14) \
304 | ea_metamacro_foreach_cxt14(MACRO, SEP, CONTEXT, _0, _1, _2, _3, _4, _5, _6, _7, _8, _9, _10, _11, _12, _13) \
305 | SEP \
306 | MACRO(14, CONTEXT, _14)
307 |
308 | #define ea_metamacro_foreach_cxt16(MACRO, SEP, CONTEXT, _0, _1, _2, _3, _4, _5, _6, _7, _8, _9, _10, _11, _12, _13, _14, _15) \
309 | ea_metamacro_foreach_cxt15(MACRO, SEP, CONTEXT, _0, _1, _2, _3, _4, _5, _6, _7, _8, _9, _10, _11, _12, _13, _14) \
310 | SEP \
311 | MACRO(15, CONTEXT, _15)
312 |
313 | #define ea_metamacro_foreach_cxt17(MACRO, SEP, CONTEXT, _0, _1, _2, _3, _4, _5, _6, _7, _8, _9, _10, _11, _12, _13, _14, _15, _16) \
314 | ea_metamacro_foreach_cxt16(MACRO, SEP, CONTEXT, _0, _1, _2, _3, _4, _5, _6, _7, _8, _9, _10, _11, _12, _13, _14, _15) \
315 | SEP \
316 | MACRO(16, CONTEXT, _16)
317 |
318 | #define ea_metamacro_foreach_cxt18(MACRO, SEP, CONTEXT, _0, _1, _2, _3, _4, _5, _6, _7, _8, _9, _10, _11, _12, _13, _14, _15, _16, _17) \
319 | ea_metamacro_foreach_cxt17(MACRO, SEP, CONTEXT, _0, _1, _2, _3, _4, _5, _6, _7, _8, _9, _10, _11, _12, _13, _14, _15, _16) \
320 | SEP \
321 | MACRO(17, CONTEXT, _17)
322 |
323 | #define ea_metamacro_foreach_cxt19(MACRO, SEP, CONTEXT, _0, _1, _2, _3, _4, _5, _6, _7, _8, _9, _10, _11, _12, _13, _14, _15, _16, _17, _18) \
324 | ea_metamacro_foreach_cxt18(MACRO, SEP, CONTEXT, _0, _1, _2, _3, _4, _5, _6, _7, _8, _9, _10, _11, _12, _13, _14, _15, _16, _17) \
325 | SEP \
326 | MACRO(18, CONTEXT, _18)
327 |
328 | #define ea_metamacro_foreach_cxt20(MACRO, SEP, CONTEXT, _0, _1, _2, _3, _4, _5, _6, _7, _8, _9, _10, _11, _12, _13, _14, _15, _16, _17, _18, _19) \
329 | ea_metamacro_foreach_cxt19(MACRO, SEP, CONTEXT, _0, _1, _2, _3, _4, _5, _6, _7, _8, _9, _10, _11, _12, _13, _14, _15, _16, _17, _18) \
330 | SEP \
331 | MACRO(19, CONTEXT, _19)
332 |
333 | // ea_metamacro_foreach_cxt_recursive expansions
334 | #define ea_metamacro_foreach_cxt_recursive0(MACRO, SEP, CONTEXT)
335 | #define ea_metamacro_foreach_cxt_recursive1(MACRO, SEP, CONTEXT, _0) MACRO(0, CONTEXT, _0)
336 |
337 | #define ea_metamacro_foreach_cxt_recursive2(MACRO, SEP, CONTEXT, _0, _1) \
338 | ea_metamacro_foreach_cxt_recursive1(MACRO, SEP, CONTEXT, _0) \
339 | SEP \
340 | MACRO(1, CONTEXT, _1)
341 |
342 | #define ea_metamacro_foreach_cxt_recursive3(MACRO, SEP, CONTEXT, _0, _1, _2) \
343 | ea_metamacro_foreach_cxt_recursive2(MACRO, SEP, CONTEXT, _0, _1) \
344 | SEP \
345 | MACRO(2, CONTEXT, _2)
346 |
347 | #define ea_metamacro_foreach_cxt_recursive4(MACRO, SEP, CONTEXT, _0, _1, _2, _3) \
348 | ea_metamacro_foreach_cxt_recursive3(MACRO, SEP, CONTEXT, _0, _1, _2) \
349 | SEP \
350 | MACRO(3, CONTEXT, _3)
351 |
352 | #define ea_metamacro_foreach_cxt_recursive5(MACRO, SEP, CONTEXT, _0, _1, _2, _3, _4) \
353 | ea_metamacro_foreach_cxt_recursive4(MACRO, SEP, CONTEXT, _0, _1, _2, _3) \
354 | SEP \
355 | MACRO(4, CONTEXT, _4)
356 |
357 | #define ea_metamacro_foreach_cxt_recursive6(MACRO, SEP, CONTEXT, _0, _1, _2, _3, _4, _5) \
358 | ea_metamacro_foreach_cxt_recursive5(MACRO, SEP, CONTEXT, _0, _1, _2, _3, _4) \
359 | SEP \
360 | MACRO(5, CONTEXT, _5)
361 |
362 | #define ea_metamacro_foreach_cxt_recursive7(MACRO, SEP, CONTEXT, _0, _1, _2, _3, _4, _5, _6) \
363 | ea_metamacro_foreach_cxt_recursive6(MACRO, SEP, CONTEXT, _0, _1, _2, _3, _4, _5) \
364 | SEP \
365 | MACRO(6, CONTEXT, _6)
366 |
367 | #define ea_metamacro_foreach_cxt_recursive8(MACRO, SEP, CONTEXT, _0, _1, _2, _3, _4, _5, _6, _7) \
368 | ea_metamacro_foreach_cxt_recursive7(MACRO, SEP, CONTEXT, _0, _1, _2, _3, _4, _5, _6) \
369 | SEP \
370 | MACRO(7, CONTEXT, _7)
371 |
372 | #define ea_metamacro_foreach_cxt_recursive9(MACRO, SEP, CONTEXT, _0, _1, _2, _3, _4, _5, _6, _7, _8) \
373 | ea_metamacro_foreach_cxt_recursive8(MACRO, SEP, CONTEXT, _0, _1, _2, _3, _4, _5, _6, _7) \
374 | SEP \
375 | MACRO(8, CONTEXT, _8)
376 |
377 | #define ea_metamacro_foreach_cxt_recursive10(MACRO, SEP, CONTEXT, _0, _1, _2, _3, _4, _5, _6, _7, _8, _9) \
378 | ea_metamacro_foreach_cxt_recursive9(MACRO, SEP, CONTEXT, _0, _1, _2, _3, _4, _5, _6, _7, _8) \
379 | SEP \
380 | MACRO(9, CONTEXT, _9)
381 |
382 | #define ea_metamacro_foreach_cxt_recursive11(MACRO, SEP, CONTEXT, _0, _1, _2, _3, _4, _5, _6, _7, _8, _9, _10) \
383 | ea_metamacro_foreach_cxt_recursive10(MACRO, SEP, CONTEXT, _0, _1, _2, _3, _4, _5, _6, _7, _8, _9) \
384 | SEP \
385 | MACRO(10, CONTEXT, _10)
386 |
387 | #define ea_metamacro_foreach_cxt_recursive12(MACRO, SEP, CONTEXT, _0, _1, _2, _3, _4, _5, _6, _7, _8, _9, _10, _11) \
388 | ea_metamacro_foreach_cxt_recursive11(MACRO, SEP, CONTEXT, _0, _1, _2, _3, _4, _5, _6, _7, _8, _9, _10) \
389 | SEP \
390 | MACRO(11, CONTEXT, _11)
391 |
392 | #define ea_metamacro_foreach_cxt_recursive13(MACRO, SEP, CONTEXT, _0, _1, _2, _3, _4, _5, _6, _7, _8, _9, _10, _11, _12) \
393 | ea_metamacro_foreach_cxt_recursive12(MACRO, SEP, CONTEXT, _0, _1, _2, _3, _4, _5, _6, _7, _8, _9, _10, _11) \
394 | SEP \
395 | MACRO(12, CONTEXT, _12)
396 |
397 | #define ea_metamacro_foreach_cxt_recursive14(MACRO, SEP, CONTEXT, _0, _1, _2, _3, _4, _5, _6, _7, _8, _9, _10, _11, _12, _13) \
398 | ea_metamacro_foreach_cxt_recursive13(MACRO, SEP, CONTEXT, _0, _1, _2, _3, _4, _5, _6, _7, _8, _9, _10, _11, _12) \
399 | SEP \
400 | MACRO(13, CONTEXT, _13)
401 |
402 | #define ea_metamacro_foreach_cxt_recursive15(MACRO, SEP, CONTEXT, _0, _1, _2, _3, _4, _5, _6, _7, _8, _9, _10, _11, _12, _13, _14) \
403 | ea_metamacro_foreach_cxt_recursive14(MACRO, SEP, CONTEXT, _0, _1, _2, _3, _4, _5, _6, _7, _8, _9, _10, _11, _12, _13) \
404 | SEP \
405 | MACRO(14, CONTEXT, _14)
406 |
407 | #define ea_metamacro_foreach_cxt_recursive16(MACRO, SEP, CONTEXT, _0, _1, _2, _3, _4, _5, _6, _7, _8, _9, _10, _11, _12, _13, _14, _15) \
408 | ea_metamacro_foreach_cxt_recursive15(MACRO, SEP, CONTEXT, _0, _1, _2, _3, _4, _5, _6, _7, _8, _9, _10, _11, _12, _13, _14) \
409 | SEP \
410 | MACRO(15, CONTEXT, _15)
411 |
412 | #define ea_metamacro_foreach_cxt_recursive17(MACRO, SEP, CONTEXT, _0, _1, _2, _3, _4, _5, _6, _7, _8, _9, _10, _11, _12, _13, _14, _15, _16) \
413 | ea_metamacro_foreach_cxt_recursive16(MACRO, SEP, CONTEXT, _0, _1, _2, _3, _4, _5, _6, _7, _8, _9, _10, _11, _12, _13, _14, _15) \
414 | SEP \
415 | MACRO(16, CONTEXT, _16)
416 |
417 | #define ea_metamacro_foreach_cxt_recursive18(MACRO, SEP, CONTEXT, _0, _1, _2, _3, _4, _5, _6, _7, _8, _9, _10, _11, _12, _13, _14, _15, _16, _17) \
418 | ea_metamacro_foreach_cxt_recursive17(MACRO, SEP, CONTEXT, _0, _1, _2, _3, _4, _5, _6, _7, _8, _9, _10, _11, _12, _13, _14, _15, _16) \
419 | SEP \
420 | MACRO(17, CONTEXT, _17)
421 |
422 | #define ea_metamacro_foreach_cxt_recursive19(MACRO, SEP, CONTEXT, _0, _1, _2, _3, _4, _5, _6, _7, _8, _9, _10, _11, _12, _13, _14, _15, _16, _17, _18) \
423 | ea_metamacro_foreach_cxt_recursive18(MACRO, SEP, CONTEXT, _0, _1, _2, _3, _4, _5, _6, _7, _8, _9, _10, _11, _12, _13, _14, _15, _16, _17) \
424 | SEP \
425 | MACRO(18, CONTEXT, _18)
426 |
427 | #define ea_metamacro_foreach_cxt_recursive20(MACRO, SEP, CONTEXT, _0, _1, _2, _3, _4, _5, _6, _7, _8, _9, _10, _11, _12, _13, _14, _15, _16, _17, _18, _19) \
428 | ea_metamacro_foreach_cxt_recursive19(MACRO, SEP, CONTEXT, _0, _1, _2, _3, _4, _5, _6, _7, _8, _9, _10, _11, _12, _13, _14, _15, _16, _17, _18) \
429 | SEP \
430 | MACRO(19, CONTEXT, _19)
431 |
432 | // ea_metamacro_for_cxt expansions
433 | #define ea_metamacro_for_cxt0(MACRO, SEP, CONTEXT)
434 | #define ea_metamacro_for_cxt1(MACRO, SEP, CONTEXT) MACRO(0, CONTEXT)
435 |
436 | #define ea_metamacro_for_cxt2(MACRO, SEP, CONTEXT) \
437 | ea_metamacro_for_cxt1(MACRO, SEP, CONTEXT) \
438 | SEP \
439 | MACRO(1, CONTEXT)
440 |
441 | #define ea_metamacro_for_cxt3(MACRO, SEP, CONTEXT) \
442 | ea_metamacro_for_cxt2(MACRO, SEP, CONTEXT) \
443 | SEP \
444 | MACRO(2, CONTEXT)
445 |
446 | #define ea_metamacro_for_cxt4(MACRO, SEP, CONTEXT) \
447 | ea_metamacro_for_cxt3(MACRO, SEP, CONTEXT) \
448 | SEP \
449 | MACRO(3, CONTEXT)
450 |
451 | #define ea_metamacro_for_cxt5(MACRO, SEP, CONTEXT) \
452 | ea_metamacro_for_cxt4(MACRO, SEP, CONTEXT) \
453 | SEP \
454 | MACRO(4, CONTEXT)
455 |
456 | #define ea_metamacro_for_cxt6(MACRO, SEP, CONTEXT) \
457 | ea_metamacro_for_cxt5(MACRO, SEP, CONTEXT) \
458 | SEP \
459 | MACRO(5, CONTEXT)
460 |
461 | #define ea_metamacro_for_cxt7(MACRO, SEP, CONTEXT) \
462 | ea_metamacro_for_cxt6(MACRO, SEP, CONTEXT) \
463 | SEP \
464 | MACRO(6, CONTEXT)
465 |
466 | #define ea_metamacro_for_cxt8(MACRO, SEP, CONTEXT) \
467 | ea_metamacro_for_cxt7(MACRO, SEP, CONTEXT) \
468 | SEP \
469 | MACRO(7, CONTEXT)
470 |
471 | #define ea_metamacro_for_cxt9(MACRO, SEP, CONTEXT) \
472 | ea_metamacro_for_cxt8(MACRO, SEP, CONTEXT) \
473 | SEP \
474 | MACRO(8, CONTEXT)
475 |
476 | #define ea_metamacro_for_cxt10(MACRO, SEP, CONTEXT) \
477 | ea_metamacro_for_cxt9(MACRO, SEP, CONTEXT) \
478 | SEP \
479 | MACRO(9, CONTEXT)
480 |
481 | #define ea_metamacro_for_cxt11(MACRO, SEP, CONTEXT) \
482 | ea_metamacro_for_cxt10(MACRO, SEP, CONTEXT) \
483 | SEP \
484 | MACRO(10, CONTEXT)
485 |
486 | #define ea_metamacro_for_cxt12(MACRO, SEP, CONTEXT) \
487 | ea_metamacro_for_cxt11(MACRO, SEP, CONTEXT) \
488 | SEP \
489 | MACRO(11, CONTEXT)
490 |
491 | #define ea_metamacro_for_cxt13(MACRO, SEP, CONTEXT) \
492 | ea_metamacro_for_cxt12(MACRO, SEP, CONTEXT) \
493 | SEP \
494 | MACRO(12, CONTEXT)
495 |
496 | #define ea_metamacro_for_cxt14(MACRO, SEP, CONTEXT) \
497 | ea_metamacro_for_cxt13(MACRO, SEP, CONTEXT) \
498 | SEP \
499 | MACRO(13, CONTEXT)
500 |
501 | #define ea_metamacro_for_cxt15(MACRO, SEP, CONTEXT) \
502 | ea_metamacro_for_cxt14(MACRO, SEP, CONTEXT) \
503 | SEP \
504 | MACRO(14, CONTEXT)
505 |
506 | #define ea_metamacro_for_cxt16(MACRO, SEP, CONTEXT) \
507 | ea_metamacro_for_cxt15(MACRO, SEP, CONTEXT) \
508 | SEP \
509 | MACRO(15, CONTEXT)
510 |
511 | #define ea_metamacro_for_cxt17(MACRO, SEP, CONTEXT) \
512 | ea_metamacro_for_cxt16(MACRO, SEP, CONTEXT) \
513 | SEP \
514 | MACRO(16, CONTEXT)
515 |
516 | #define ea_metamacro_for_cxt18(MACRO, SEP, CONTEXT) \
517 | ea_metamacro_for_cxt17(MACRO, SEP, CONTEXT) \
518 | SEP \
519 | MACRO(17, CONTEXT)
520 |
521 | #define ea_metamacro_for_cxt19(MACRO, SEP, CONTEXT) \
522 | ea_metamacro_for_cxt18(MACRO, SEP, CONTEXT) \
523 | SEP \
524 | MACRO(18, CONTEXT)
525 |
526 | #define ea_metamacro_for_cxt20(MACRO, SEP, CONTEXT) \
527 | ea_metamacro_for_cxt19(MACRO, SEP, CONTEXT) \
528 | SEP \
529 | MACRO(19, CONTEXT)
530 |
531 | // ea_metamacro_if_eq expansions
532 | #define ea_metamacro_if_eq0(VALUE) \
533 | ea_metamacro_concat(ea_metamacro_if_eq0_, VALUE)
534 |
535 | #define ea_metamacro_if_eq0_0(...) __VA_ARGS__ ea_metamacro_consume_
536 | #define ea_metamacro_if_eq0_1(...) ea_metamacro_expand_
537 | #define ea_metamacro_if_eq0_2(...) ea_metamacro_expand_
538 | #define ea_metamacro_if_eq0_3(...) ea_metamacro_expand_
539 | #define ea_metamacro_if_eq0_4(...) ea_metamacro_expand_
540 | #define ea_metamacro_if_eq0_5(...) ea_metamacro_expand_
541 | #define ea_metamacro_if_eq0_6(...) ea_metamacro_expand_
542 | #define ea_metamacro_if_eq0_7(...) ea_metamacro_expand_
543 | #define ea_metamacro_if_eq0_8(...) ea_metamacro_expand_
544 | #define ea_metamacro_if_eq0_9(...) ea_metamacro_expand_
545 | #define ea_metamacro_if_eq0_10(...) ea_metamacro_expand_
546 | #define ea_metamacro_if_eq0_11(...) ea_metamacro_expand_
547 | #define ea_metamacro_if_eq0_12(...) ea_metamacro_expand_
548 | #define ea_metamacro_if_eq0_13(...) ea_metamacro_expand_
549 | #define ea_metamacro_if_eq0_14(...) ea_metamacro_expand_
550 | #define ea_metamacro_if_eq0_15(...) ea_metamacro_expand_
551 | #define ea_metamacro_if_eq0_16(...) ea_metamacro_expand_
552 | #define ea_metamacro_if_eq0_17(...) ea_metamacro_expand_
553 | #define ea_metamacro_if_eq0_18(...) ea_metamacro_expand_
554 | #define ea_metamacro_if_eq0_19(...) ea_metamacro_expand_
555 | #define ea_metamacro_if_eq0_20(...) ea_metamacro_expand_
556 |
557 | #define ea_metamacro_if_eq1(VALUE) ea_metamacro_if_eq0(ea_metamacro_dec(VALUE))
558 | #define ea_metamacro_if_eq2(VALUE) ea_metamacro_if_eq1(ea_metamacro_dec(VALUE))
559 | #define ea_metamacro_if_eq3(VALUE) ea_metamacro_if_eq2(ea_metamacro_dec(VALUE))
560 | #define ea_metamacro_if_eq4(VALUE) ea_metamacro_if_eq3(ea_metamacro_dec(VALUE))
561 | #define ea_metamacro_if_eq5(VALUE) ea_metamacro_if_eq4(ea_metamacro_dec(VALUE))
562 | #define ea_metamacro_if_eq6(VALUE) ea_metamacro_if_eq5(ea_metamacro_dec(VALUE))
563 | #define ea_metamacro_if_eq7(VALUE) ea_metamacro_if_eq6(ea_metamacro_dec(VALUE))
564 | #define ea_metamacro_if_eq8(VALUE) ea_metamacro_if_eq7(ea_metamacro_dec(VALUE))
565 | #define ea_metamacro_if_eq9(VALUE) ea_metamacro_if_eq8(ea_metamacro_dec(VALUE))
566 | #define ea_metamacro_if_eq10(VALUE) ea_metamacro_if_eq9(ea_metamacro_dec(VALUE))
567 | #define ea_metamacro_if_eq11(VALUE) ea_metamacro_if_eq10(ea_metamacro_dec(VALUE))
568 | #define ea_metamacro_if_eq12(VALUE) ea_metamacro_if_eq11(ea_metamacro_dec(VALUE))
569 | #define ea_metamacro_if_eq13(VALUE) ea_metamacro_if_eq12(ea_metamacro_dec(VALUE))
570 | #define ea_metamacro_if_eq14(VALUE) ea_metamacro_if_eq13(ea_metamacro_dec(VALUE))
571 | #define ea_metamacro_if_eq15(VALUE) ea_metamacro_if_eq14(ea_metamacro_dec(VALUE))
572 | #define ea_metamacro_if_eq16(VALUE) ea_metamacro_if_eq15(ea_metamacro_dec(VALUE))
573 | #define ea_metamacro_if_eq17(VALUE) ea_metamacro_if_eq16(ea_metamacro_dec(VALUE))
574 | #define ea_metamacro_if_eq18(VALUE) ea_metamacro_if_eq17(ea_metamacro_dec(VALUE))
575 | #define ea_metamacro_if_eq19(VALUE) ea_metamacro_if_eq18(ea_metamacro_dec(VALUE))
576 | #define ea_metamacro_if_eq20(VALUE) ea_metamacro_if_eq19(ea_metamacro_dec(VALUE))
577 |
578 | // ea_metamacro_if_eq_recursive expansions
579 | #define ea_metamacro_if_eq_recursive0(VALUE) \
580 | ea_metamacro_concat(ea_metamacro_if_eq_recursive0_, VALUE)
581 |
582 | #define ea_metamacro_if_eq_recursive0_0(...) __VA_ARGS__ ea_metamacro_consume_
583 | #define ea_metamacro_if_eq_recursive0_1(...) ea_metamacro_expand_
584 | #define ea_metamacro_if_eq_recursive0_2(...) ea_metamacro_expand_
585 | #define ea_metamacro_if_eq_recursive0_3(...) ea_metamacro_expand_
586 | #define ea_metamacro_if_eq_recursive0_4(...) ea_metamacro_expand_
587 | #define ea_metamacro_if_eq_recursive0_5(...) ea_metamacro_expand_
588 | #define ea_metamacro_if_eq_recursive0_6(...) ea_metamacro_expand_
589 | #define ea_metamacro_if_eq_recursive0_7(...) ea_metamacro_expand_
590 | #define ea_metamacro_if_eq_recursive0_8(...) ea_metamacro_expand_
591 | #define ea_metamacro_if_eq_recursive0_9(...) ea_metamacro_expand_
592 | #define ea_metamacro_if_eq_recursive0_10(...) ea_metamacro_expand_
593 | #define ea_metamacro_if_eq_recursive0_11(...) ea_metamacro_expand_
594 | #define ea_metamacro_if_eq_recursive0_12(...) ea_metamacro_expand_
595 | #define ea_metamacro_if_eq_recursive0_13(...) ea_metamacro_expand_
596 | #define ea_metamacro_if_eq_recursive0_14(...) ea_metamacro_expand_
597 | #define ea_metamacro_if_eq_recursive0_15(...) ea_metamacro_expand_
598 | #define ea_metamacro_if_eq_recursive0_16(...) ea_metamacro_expand_
599 | #define ea_metamacro_if_eq_recursive0_17(...) ea_metamacro_expand_
600 | #define ea_metamacro_if_eq_recursive0_18(...) ea_metamacro_expand_
601 | #define ea_metamacro_if_eq_recursive0_19(...) ea_metamacro_expand_
602 | #define ea_metamacro_if_eq_recursive0_20(...) ea_metamacro_expand_
603 |
604 | #define ea_metamacro_if_eq_recursive1(VALUE) ea_metamacro_if_eq_recursive0(ea_metamacro_dec(VALUE))
605 | #define ea_metamacro_if_eq_recursive2(VALUE) ea_metamacro_if_eq_recursive1(ea_metamacro_dec(VALUE))
606 | #define ea_metamacro_if_eq_recursive3(VALUE) ea_metamacro_if_eq_recursive2(ea_metamacro_dec(VALUE))
607 | #define ea_metamacro_if_eq_recursive4(VALUE) ea_metamacro_if_eq_recursive3(ea_metamacro_dec(VALUE))
608 | #define ea_metamacro_if_eq_recursive5(VALUE) ea_metamacro_if_eq_recursive4(ea_metamacro_dec(VALUE))
609 | #define ea_metamacro_if_eq_recursive6(VALUE) ea_metamacro_if_eq_recursive5(ea_metamacro_dec(VALUE))
610 | #define ea_metamacro_if_eq_recursive7(VALUE) ea_metamacro_if_eq_recursive6(ea_metamacro_dec(VALUE))
611 | #define ea_metamacro_if_eq_recursive8(VALUE) ea_metamacro_if_eq_recursive7(ea_metamacro_dec(VALUE))
612 | #define ea_metamacro_if_eq_recursive9(VALUE) ea_metamacro_if_eq_recursive8(ea_metamacro_dec(VALUE))
613 | #define ea_metamacro_if_eq_recursive10(VALUE) ea_metamacro_if_eq_recursive9(ea_metamacro_dec(VALUE))
614 | #define ea_metamacro_if_eq_recursive11(VALUE) ea_metamacro_if_eq_recursive10(ea_metamacro_dec(VALUE))
615 | #define ea_metamacro_if_eq_recursive12(VALUE) ea_metamacro_if_eq_recursive11(ea_metamacro_dec(VALUE))
616 | #define ea_metamacro_if_eq_recursive13(VALUE) ea_metamacro_if_eq_recursive12(ea_metamacro_dec(VALUE))
617 | #define ea_metamacro_if_eq_recursive14(VALUE) ea_metamacro_if_eq_recursive13(ea_metamacro_dec(VALUE))
618 | #define ea_metamacro_if_eq_recursive15(VALUE) ea_metamacro_if_eq_recursive14(ea_metamacro_dec(VALUE))
619 | #define ea_metamacro_if_eq_recursive16(VALUE) ea_metamacro_if_eq_recursive15(ea_metamacro_dec(VALUE))
620 | #define ea_metamacro_if_eq_recursive17(VALUE) ea_metamacro_if_eq_recursive16(ea_metamacro_dec(VALUE))
621 | #define ea_metamacro_if_eq_recursive18(VALUE) ea_metamacro_if_eq_recursive17(ea_metamacro_dec(VALUE))
622 | #define ea_metamacro_if_eq_recursive19(VALUE) ea_metamacro_if_eq_recursive18(ea_metamacro_dec(VALUE))
623 | #define ea_metamacro_if_eq_recursive20(VALUE) ea_metamacro_if_eq_recursive19(ea_metamacro_dec(VALUE))
624 |
625 | // ea_metamacro_take expansions
626 | #define ea_metamacro_take0(...)
627 | #define ea_metamacro_take1(...) ea_metamacro_head(__VA_ARGS__)
628 | #define ea_metamacro_take2(...) ea_metamacro_head(__VA_ARGS__), ea_metamacro_take1(ea_metamacro_tail(__VA_ARGS__))
629 | #define ea_metamacro_take3(...) ea_metamacro_head(__VA_ARGS__), ea_metamacro_take2(ea_metamacro_tail(__VA_ARGS__))
630 | #define ea_metamacro_take4(...) ea_metamacro_head(__VA_ARGS__), ea_metamacro_take3(ea_metamacro_tail(__VA_ARGS__))
631 | #define ea_metamacro_take5(...) ea_metamacro_head(__VA_ARGS__), ea_metamacro_take4(ea_metamacro_tail(__VA_ARGS__))
632 | #define ea_metamacro_take6(...) ea_metamacro_head(__VA_ARGS__), ea_metamacro_take5(ea_metamacro_tail(__VA_ARGS__))
633 | #define ea_metamacro_take7(...) ea_metamacro_head(__VA_ARGS__), ea_metamacro_take6(ea_metamacro_tail(__VA_ARGS__))
634 | #define ea_metamacro_take8(...) ea_metamacro_head(__VA_ARGS__), ea_metamacro_take7(ea_metamacro_tail(__VA_ARGS__))
635 | #define ea_metamacro_take9(...) ea_metamacro_head(__VA_ARGS__), ea_metamacro_take8(ea_metamacro_tail(__VA_ARGS__))
636 | #define ea_metamacro_take10(...) ea_metamacro_head(__VA_ARGS__), ea_metamacro_take9(ea_metamacro_tail(__VA_ARGS__))
637 | #define ea_metamacro_take11(...) ea_metamacro_head(__VA_ARGS__), ea_metamacro_take10(ea_metamacro_tail(__VA_ARGS__))
638 | #define ea_metamacro_take12(...) ea_metamacro_head(__VA_ARGS__), ea_metamacro_take11(ea_metamacro_tail(__VA_ARGS__))
639 | #define ea_metamacro_take13(...) ea_metamacro_head(__VA_ARGS__), ea_metamacro_take12(ea_metamacro_tail(__VA_ARGS__))
640 | #define ea_metamacro_take14(...) ea_metamacro_head(__VA_ARGS__), ea_metamacro_take13(ea_metamacro_tail(__VA_ARGS__))
641 | #define ea_metamacro_take15(...) ea_metamacro_head(__VA_ARGS__), ea_metamacro_take14(ea_metamacro_tail(__VA_ARGS__))
642 | #define ea_metamacro_take16(...) ea_metamacro_head(__VA_ARGS__), ea_metamacro_take15(ea_metamacro_tail(__VA_ARGS__))
643 | #define ea_metamacro_take17(...) ea_metamacro_head(__VA_ARGS__), ea_metamacro_take16(ea_metamacro_tail(__VA_ARGS__))
644 | #define ea_metamacro_take18(...) ea_metamacro_head(__VA_ARGS__), ea_metamacro_take17(ea_metamacro_tail(__VA_ARGS__))
645 | #define ea_metamacro_take19(...) ea_metamacro_head(__VA_ARGS__), ea_metamacro_take18(ea_metamacro_tail(__VA_ARGS__))
646 | #define ea_metamacro_take20(...) ea_metamacro_head(__VA_ARGS__), ea_metamacro_take19(ea_metamacro_tail(__VA_ARGS__))
647 |
648 | // ea_metamacro_drop expansions
649 | #define ea_metamacro_drop0(...) __VA_ARGS__
650 | #define ea_metamacro_drop1(...) ea_metamacro_tail(__VA_ARGS__)
651 | #define ea_metamacro_drop2(...) ea_metamacro_drop1(ea_metamacro_tail(__VA_ARGS__))
652 | #define ea_metamacro_drop3(...) ea_metamacro_drop2(ea_metamacro_tail(__VA_ARGS__))
653 | #define ea_metamacro_drop4(...) ea_metamacro_drop3(ea_metamacro_tail(__VA_ARGS__))
654 | #define ea_metamacro_drop5(...) ea_metamacro_drop4(ea_metamacro_tail(__VA_ARGS__))
655 | #define ea_metamacro_drop6(...) ea_metamacro_drop5(ea_metamacro_tail(__VA_ARGS__))
656 | #define ea_metamacro_drop7(...) ea_metamacro_drop6(ea_metamacro_tail(__VA_ARGS__))
657 | #define ea_metamacro_drop8(...) ea_metamacro_drop7(ea_metamacro_tail(__VA_ARGS__))
658 | #define ea_metamacro_drop9(...) ea_metamacro_drop8(ea_metamacro_tail(__VA_ARGS__))
659 | #define ea_metamacro_drop10(...) ea_metamacro_drop9(ea_metamacro_tail(__VA_ARGS__))
660 | #define ea_metamacro_drop11(...) ea_metamacro_drop10(ea_metamacro_tail(__VA_ARGS__))
661 | #define ea_metamacro_drop12(...) ea_metamacro_drop11(ea_metamacro_tail(__VA_ARGS__))
662 | #define ea_metamacro_drop13(...) ea_metamacro_drop12(ea_metamacro_tail(__VA_ARGS__))
663 | #define ea_metamacro_drop14(...) ea_metamacro_drop13(ea_metamacro_tail(__VA_ARGS__))
664 | #define ea_metamacro_drop15(...) ea_metamacro_drop14(ea_metamacro_tail(__VA_ARGS__))
665 | #define ea_metamacro_drop16(...) ea_metamacro_drop15(ea_metamacro_tail(__VA_ARGS__))
666 | #define ea_metamacro_drop17(...) ea_metamacro_drop16(ea_metamacro_tail(__VA_ARGS__))
667 | #define ea_metamacro_drop18(...) ea_metamacro_drop17(ea_metamacro_tail(__VA_ARGS__))
668 | #define ea_metamacro_drop19(...) ea_metamacro_drop18(ea_metamacro_tail(__VA_ARGS__))
669 | #define ea_metamacro_drop20(...) ea_metamacro_drop19(ea_metamacro_tail(__VA_ARGS__))
670 |
671 |
672 |
673 | #if DEBUG
674 | #define ea_keywordify autoreleasepool {}
675 | #else
676 | #define ea_keywordify try {} @catch (...) {}
677 | #endif
678 |
679 | #define ea_strongify_(INDEX, VAR) \
680 | __strong __typeof__(VAR) VAR = ea_metamacro_concat(VAR, _weak_);
681 |
682 | #define ea_weakify_(INDEX, CONTEXT, VAR) \
683 | CONTEXT __typeof__(VAR) ea_metamacro_concat(VAR, _weak_) = (VAR);
684 |
685 |
686 |
687 | #endif /* EA_ea_metamacros_h */
688 |
--------------------------------------------------------------------------------