├── .gitignore ├── CydiaLauncherModule ├── CydiaLauncher.m ├── Resources │ ├── AppIcon@2x.png │ ├── AppIcon@3x.png │ └── Info.plist ├── control └── Makefile ├── SmileyProvider ├── Resources │ ├── Icon@2x.png │ ├── Icon@3x.png │ ├── Smiley_Happy@2x.png │ ├── Smiley_Happy@3x.png │ ├── Smiley_Sad@2x.png │ ├── Smiley_Sad@3x.png │ ├── Smiley_Neutral@2x.png │ ├── Smiley_Neutral@3x.png │ ├── Info.plist │ └── SmileyPrefs.plist ├── SmileyProviderPrefs │ ├── SMPRootListController.h │ ├── SMPRootListController.m │ ├── Makefile │ ├── layout │ │ └── Library │ │ │ └── PreferenceLoader │ │ │ └── Preferences │ │ │ └── SmileyProviderPrefs.plist │ └── Resources │ │ ├── Info.plist │ │ └── Root.plist ├── ProvidedSmileyModule.h ├── control ├── SmileyProvider.h ├── ProvidedSmileyModuleRootListController.h ├── Makefile ├── ProvidedSmileyModuleRootListController.m ├── CCSModuleProvider.h ├── SmileyProvider.m └── ProvidedSmileyModule.m ├── SmileyModule ├── Resources │ ├── Smiley-Meh@2x.png │ ├── Smiley-Meh@3x.png │ ├── Smiley-Happy@2x.png │ ├── Smiley-Happy@3x.png │ ├── Info.plist │ └── ModulePrefs.plist ├── SmileyModuleRootListController.h ├── SmileyModule.h ├── control ├── SmileyModuleRootListController.m ├── Makefile └── SmileyModule.m └── LICENSE /.gitignore: -------------------------------------------------------------------------------- 1 | .theos/ 2 | .DS_Store 3 | packages/ -------------------------------------------------------------------------------- /CydiaLauncherModule/CydiaLauncher.m: -------------------------------------------------------------------------------- 1 | //NOTE: An empty binary is needed for the module to actually show up 2 | -------------------------------------------------------------------------------- /SmileyProvider/Resources/Icon@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/opa334/CCSupportExamples/HEAD/SmileyProvider/Resources/Icon@2x.png -------------------------------------------------------------------------------- /SmileyProvider/Resources/Icon@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/opa334/CCSupportExamples/HEAD/SmileyProvider/Resources/Icon@3x.png -------------------------------------------------------------------------------- /SmileyModule/Resources/Smiley-Meh@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/opa334/CCSupportExamples/HEAD/SmileyModule/Resources/Smiley-Meh@2x.png -------------------------------------------------------------------------------- /SmileyModule/Resources/Smiley-Meh@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/opa334/CCSupportExamples/HEAD/SmileyModule/Resources/Smiley-Meh@3x.png -------------------------------------------------------------------------------- /CydiaLauncherModule/Resources/AppIcon@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/opa334/CCSupportExamples/HEAD/CydiaLauncherModule/Resources/AppIcon@2x.png -------------------------------------------------------------------------------- /CydiaLauncherModule/Resources/AppIcon@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/opa334/CCSupportExamples/HEAD/CydiaLauncherModule/Resources/AppIcon@3x.png -------------------------------------------------------------------------------- /SmileyModule/Resources/Smiley-Happy@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/opa334/CCSupportExamples/HEAD/SmileyModule/Resources/Smiley-Happy@2x.png -------------------------------------------------------------------------------- /SmileyModule/Resources/Smiley-Happy@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/opa334/CCSupportExamples/HEAD/SmileyModule/Resources/Smiley-Happy@3x.png -------------------------------------------------------------------------------- /SmileyProvider/Resources/Smiley_Happy@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/opa334/CCSupportExamples/HEAD/SmileyProvider/Resources/Smiley_Happy@2x.png -------------------------------------------------------------------------------- /SmileyProvider/Resources/Smiley_Happy@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/opa334/CCSupportExamples/HEAD/SmileyProvider/Resources/Smiley_Happy@3x.png -------------------------------------------------------------------------------- /SmileyProvider/Resources/Smiley_Sad@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/opa334/CCSupportExamples/HEAD/SmileyProvider/Resources/Smiley_Sad@2x.png -------------------------------------------------------------------------------- /SmileyProvider/Resources/Smiley_Sad@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/opa334/CCSupportExamples/HEAD/SmileyProvider/Resources/Smiley_Sad@3x.png -------------------------------------------------------------------------------- /SmileyProvider/Resources/Smiley_Neutral@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/opa334/CCSupportExamples/HEAD/SmileyProvider/Resources/Smiley_Neutral@2x.png -------------------------------------------------------------------------------- /SmileyProvider/Resources/Smiley_Neutral@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/opa334/CCSupportExamples/HEAD/SmileyProvider/Resources/Smiley_Neutral@3x.png -------------------------------------------------------------------------------- /SmileyModule/SmileyModuleRootListController.h: -------------------------------------------------------------------------------- 1 | #import 2 | 3 | @interface SmileyModuleRootListController : PSListController 4 | 5 | @end 6 | -------------------------------------------------------------------------------- /SmileyProvider/SmileyProviderPrefs/SMPRootListController.h: -------------------------------------------------------------------------------- 1 | #import 2 | 3 | @interface SMPRootListController : PSListController 4 | 5 | @end 6 | -------------------------------------------------------------------------------- /SmileyModule/SmileyModule.h: -------------------------------------------------------------------------------- 1 | #import 2 | 3 | @interface SmileyModule : CCUIToggleModule 4 | { 5 | BOOL _selected; 6 | } 7 | 8 | @end 9 | -------------------------------------------------------------------------------- /SmileyProvider/ProvidedSmileyModule.h: -------------------------------------------------------------------------------- 1 | #import 2 | 3 | @interface ProvidedSmileyModule : CCUIToggleModule 4 | { 5 | BOOL _selected; 6 | } 7 | @property (nonatomic, retain) NSString* settingsIdentifier; 8 | 9 | @end 10 | -------------------------------------------------------------------------------- /SmileyProvider/control: -------------------------------------------------------------------------------- 1 | Package: com.opa334.smileyprovider 2 | Name: SmileyProvider 3 | Depends: mobilesubstrate 4 | Version: 1.0 5 | Architecture: iphoneos-arm 6 | Description: An awesome Control Center module! 7 | Maintainer: opa334 8 | Author: opa334 9 | Section: Control Center (Modules) 10 | -------------------------------------------------------------------------------- /SmileyModule/control: -------------------------------------------------------------------------------- 1 | Package: com.opa334.smileymodule 2 | Name: Smiley Module 3 | Depends: mobilesubstrate, com.opa334.ccsupport 4 | Version: 1.0 5 | Architecture: iphoneos-arm 6 | Description: An awesome Control Center module! 7 | Maintainer: opa334 8 | Author: opa334 9 | Section: Control Center (Modules) 10 | -------------------------------------------------------------------------------- /SmileyProvider/SmileyProvider.h: -------------------------------------------------------------------------------- 1 | #import 2 | #import "CCSModuleProvider.h" 3 | #import "ProvidedSmileyModule.h" 4 | 5 | @interface SmileyProvider : NSObject 6 | { 7 | NSMutableDictionary* _moduleInstancesByIdentifier; 8 | } 9 | 10 | 11 | @end 12 | -------------------------------------------------------------------------------- /CydiaLauncherModule/control: -------------------------------------------------------------------------------- 1 | Package: com.opa334.cydialaunchermodule 2 | Name: CydiaLauncher 3 | Depends: mobilesubstrate, com.opa334.ccsupport 4 | Version: 1.0 5 | Architecture: iphoneos-arm 6 | Description: An awesome Cydia Launcher! 7 | Maintainer: opa334 8 | Author: opa334 9 | Section: Control Center (Modules) 10 | -------------------------------------------------------------------------------- /SmileyProvider/ProvidedSmileyModuleRootListController.h: -------------------------------------------------------------------------------- 1 | #import 2 | #import 3 | 4 | @interface ProvidedSmileyModuleRootListController : PSListController 5 | @property (nonatomic, retain) NSString* settingsIdentifier; 6 | @property (nonatomic, retain) NSString* displayName; 7 | @end 8 | -------------------------------------------------------------------------------- /SmileyModule/SmileyModuleRootListController.m: -------------------------------------------------------------------------------- 1 | #include "SmileyModuleRootListController.h" 2 | 3 | @implementation SmileyModuleRootListController 4 | 5 | - (NSArray *)specifiers 6 | { 7 | if(!_specifiers) 8 | { 9 | _specifiers = [self loadSpecifiersFromPlistName:@"ModulePrefs" target:self]; 10 | } 11 | 12 | return _specifiers; 13 | } 14 | 15 | @end 16 | -------------------------------------------------------------------------------- /SmileyProvider/SmileyProviderPrefs/SMPRootListController.m: -------------------------------------------------------------------------------- 1 | #include "SMPRootListController.h" 2 | 3 | @implementation SMPRootListController 4 | 5 | - (NSArray *)specifiers { 6 | if (!_specifiers) { 7 | _specifiers = [self loadSpecifiersFromPlistName:@"Root" target:self]; 8 | } 9 | 10 | return _specifiers; 11 | } 12 | 13 | - (void)closeKeyboard 14 | { 15 | [self.view endEditing:YES]; 16 | } 17 | 18 | @end 19 | -------------------------------------------------------------------------------- /SmileyProvider/SmileyProviderPrefs/Makefile: -------------------------------------------------------------------------------- 1 | TARGET := iphone:clang:13.7:7.0 2 | 3 | include $(THEOS)/makefiles/common.mk 4 | 5 | BUNDLE_NAME = SmileyProviderPrefs 6 | 7 | SmileyProviderPrefs_FILES = SMPRootListController.m 8 | SmileyProviderPrefs_FRAMEWORKS = UIKit 9 | SmileyProviderPrefs_PRIVATE_FRAMEWORKS = Preferences 10 | SmileyProviderPrefs_INSTALL_PATH = /Library/PreferenceBundles 11 | SmileyProviderPrefs_CFLAGS = -fobjc-arc 12 | 13 | include $(THEOS_MAKE_PATH)/bundle.mk 14 | -------------------------------------------------------------------------------- /CydiaLauncherModule/Makefile: -------------------------------------------------------------------------------- 1 | TARGET := iphone:clang:13.0:11.0 2 | INSTALL_TARGET_PROCESSES = SpringBoard 3 | 4 | include $(THEOS)/makefiles/common.mk 5 | 6 | BUNDLE_NAME = CydiaLauncherModule 7 | CydiaLauncherModule_FILES = CydiaLauncherModule.m 8 | CydiaLauncherModule_BUNDLE_EXTENSION = bundle 9 | CydiaLauncherModule_PRIVATE_FRAMEWORKS = ControlCenterUIKit 10 | CydiaLauncherModule_INSTALL_PATH = /Library/ControlCenter/Bundles/ 11 | 12 | after-install:: 13 | install.exec "killall -9 SpringBoard" 14 | 15 | include $(THEOS_MAKE_PATH)/bundle.mk 16 | -------------------------------------------------------------------------------- /SmileyModule/Makefile: -------------------------------------------------------------------------------- 1 | TARGET := iphone:clang:13.0:11.0 2 | INSTALL_TARGET_PROCESSES = SpringBoard 3 | 4 | include $(THEOS)/makefiles/common.mk 5 | 6 | BUNDLE_NAME = SmileyModule 7 | SmileyModule_BUNDLE_EXTENSION = bundle 8 | SmileyModule_FILES = SmileyModule.m SmileyModuleRootListController.m 9 | SmileyModule_PRIVATE_FRAMEWORKS = ControlCenterUIKit Preferences 10 | SmileyModule_CFLAGS = -fobjc-arc 11 | SmileyModule_INSTALL_PATH = /Library/ControlCenter/Bundles/ 12 | 13 | after-install:: 14 | install.exec "killall -9 SpringBoard" 15 | 16 | include $(THEOS_MAKE_PATH)/bundle.mk 17 | include $(THEOS_MAKE_PATH)/aggregate.mk 18 | -------------------------------------------------------------------------------- /SmileyProvider/Makefile: -------------------------------------------------------------------------------- 1 | TARGET := iphone:clang:13.7:11.0 2 | INSTALL_TARGET_PROCESSES = SpringBoard 3 | 4 | include $(THEOS)/makefiles/common.mk 5 | 6 | BUNDLE_NAME = SmileyProvider 7 | SmileyProvider_BUNDLE_EXTENSION = bundle 8 | SmileyProvider_FILES = SmileyProvider.m ProvidedSmileyModule.m ProvidedSmileyModuleRootListController.m 9 | SmileyProvider_PRIVATE_FRAMEWORKS = ControlCenterUIKit Preferences 10 | SmileyProvider_INSTALL_PATH = /Library/ControlCenter/CCSupport_Providers 11 | SmileyProvider_CFLAGS = -fobjc-arc 12 | 13 | include $(THEOS_MAKE_PATH)/bundle.mk 14 | SUBPROJECTS += SmileyProviderPrefs 15 | include $(THEOS_MAKE_PATH)/aggregate.mk 16 | -------------------------------------------------------------------------------- /SmileyProvider/SmileyProviderPrefs/layout/Library/PreferenceLoader/Preferences/SmileyProviderPrefs.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | entry 6 | 7 | bundle 8 | SmileyProviderPrefs 9 | cell 10 | PSLinkCell 11 | detail 12 | SMPRootListController 13 | icon 14 | icon.png 15 | isController 16 | 17 | label 18 | Smiley Provider 19 | 20 | 21 | 22 | -------------------------------------------------------------------------------- /SmileyProvider/ProvidedSmileyModuleRootListController.m: -------------------------------------------------------------------------------- 1 | #include "ProvidedSmileyModuleRootListController.h" 2 | 3 | @implementation ProvidedSmileyModuleRootListController 4 | 5 | - (NSArray *)specifiers 6 | { 7 | if(!_specifiers) 8 | { 9 | _specifiers = [self loadSpecifiersFromPlistName:@"SmileyPrefs" target:self]; 10 | 11 | if(self.settingsIdentifier) 12 | { 13 | for(PSSpecifier* specifier in _specifiers) 14 | { 15 | [specifier setProperty:self.settingsIdentifier forKey:@"defaults"]; 16 | } 17 | } 18 | } 19 | 20 | [(UINavigationItem *)self.navigationItem setTitle:self.displayName]; 21 | 22 | return _specifiers; 23 | } 24 | 25 | - (NSArray*)smileyTitles 26 | { 27 | return @[@":(", @":|", @":)"]; 28 | } 29 | 30 | - (NSArray*)smileyValues 31 | { 32 | return @[@-1, @0, @1]; 33 | } 34 | 35 | @end 36 | -------------------------------------------------------------------------------- /SmileyProvider/SmileyProviderPrefs/Resources/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | English 7 | CFBundleExecutable 8 | SmileyProviderPrefs 9 | CFBundleIdentifier 10 | com.opa334.smileyproviderprefs 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundlePackageType 14 | BNDL 15 | CFBundleShortVersionString 16 | 1.0.0 17 | CFBundleSignature 18 | ???? 19 | CFBundleVersion 20 | 1.0 21 | NSPrincipalClass 22 | SMPRootListController 23 | 24 | 25 | -------------------------------------------------------------------------------- /SmileyProvider/CCSModuleProvider.h: -------------------------------------------------------------------------------- 1 | @protocol CCSModuleProvider 2 | @required 3 | - (NSUInteger)numberOfProvidedModules; 4 | - (NSString*)identifierForModuleAtIndex:(NSUInteger)index; 5 | 6 | - (id)moduleInstanceForModuleIdentifier:(NSString*)identifier; 7 | - (NSString*)displayNameForModuleIdentifier:(NSString*)identifier; 8 | @optional 9 | - (NSSet*)supportedDeviceFamiliesForModuleWithIdentifier:(NSString*)identifier; 10 | - (NSSet*)requiredDeviceCapabilitiesForModuleWithIdentifier:(NSString*)identifier; 11 | - (NSString*)associatedBundleIdentifierForModuleWithIdentifier:(NSString*)identifier; 12 | - (NSString*)associatedBundleMinimumVersionForModuleWithIdentifier:(NSString*)identifier; 13 | - (NSUInteger)visibilityPreferenceForModuleWithIdentifier:(NSString*)identifier; 14 | - (UIImage*)settingsIconForModuleIdentifier:(NSString*)identifier; 15 | - (BOOL)providesListControllerForModuleIdentifier:(NSString*)identifier; 16 | - (id)listControllerForModuleIdentifier:(NSString*)identifier; 17 | @end -------------------------------------------------------------------------------- /SmileyProvider/SmileyProviderPrefs/Resources/Root.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | items 6 | 7 | 8 | cell 9 | PSGroupCell 10 | 11 | 12 | PostNotification 13 | com.opa334.ccsupport/ReloadProviders 14 | cell 15 | PSEditTextCell 16 | default 17 | 1 18 | defaults 19 | com.opa334.smileyprovider 20 | key 21 | ModuleNumber 22 | label 23 | Number of Modules 24 | 25 | 26 | cell 27 | PSButtonCell 28 | label 29 | Save 30 | action 31 | closeKeyboard 32 | 33 | 34 | title 35 | Smiley Provider 36 | 37 | 38 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2018 opa334 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /SmileyProvider/Resources/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleName 6 | SmileyProvider 7 | CFBundleExecutable 8 | SmileyProvider 9 | CFBundleIdentifier 10 | com.opa334.smileyprovider 11 | CFBundleDevelopmentRegion 12 | English 13 | CFBundleInfoDictionaryVersion 14 | 6.0 15 | CFBundlePackageType 16 | BNDL 17 | CFBundleShortVersionString 18 | 1.0 19 | CFBundleVersion 20 | 1 21 | MinimumOSVersion 22 | 7.0 23 | UIDeviceFamily 24 | 25 | 1 26 | 2 27 | 28 | NSPrincipalClass 29 | SmileyProvider 30 | CFBundleSupportedPlatforms 31 | 32 | iPhoneOS 33 | 34 | 35 | 36 | -------------------------------------------------------------------------------- /CydiaLauncherModule/Resources/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleName 6 | CydiaLauncherModule 7 | CFBundleDisplayName 8 | Cydia Launcher 9 | CFBundleExecutable 10 | CydiaLauncherModule 11 | CFBundleIdentifier 12 | com.opa334.cydialaunchermodule 13 | CFBundleDevelopmentRegion 14 | English 15 | CFBundleInfoDictionaryVersion 16 | 6.0 17 | CFBundlePackageType 18 | BNDL 19 | CFBundleShortVersionString 20 | 1.0 21 | CFBundleVersion 22 | 1 23 | MinimumOSVersion 24 | 7.0 25 | UIDeviceFamily 26 | 27 | 1 28 | 2 29 | 30 | NSPrincipalClass 31 | CCUIAppLauncherModule 32 | CCAssociatedBundleIdentifier 33 | com.saurik.Cydia 34 | CFBundleSupportedPlatforms 35 | 36 | iPhoneOS 37 | 38 | 39 | 40 | -------------------------------------------------------------------------------- /SmileyModule/Resources/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleName 6 | SmileyModule 7 | CFBundleDisplayName 8 | Smiley Module 9 | CFBundleExecutable 10 | SmileyModule 11 | CFBundleIdentifier 12 | com.opa334.smileymodule 13 | CFBundleDevelopmentRegion 14 | English 15 | CFBundleInfoDictionaryVersion 16 | 6.0 17 | CFBundlePackageType 18 | BNDL 19 | CFBundleShortVersionString 20 | 1.0 21 | CFBundleVersion 22 | 1 23 | MinimumOSVersion 24 | 7.0 25 | UIDeviceFamily 26 | 27 | 1 28 | 2 29 | 30 | NSPrincipalClass 31 | SmileyModule 32 | CFBundleSupportedPlatforms 33 | 34 | iPhoneOS 35 | 36 | CCSGetModuleSizeAtRuntime 37 | 38 | CCSModuleSize 39 | 40 | Portrait 41 | 42 | Height 43 | 1 44 | Width 45 | 2 46 | 47 | Landscape 48 | 49 | Height 50 | 2 51 | Width 52 | 1 53 | 54 | 55 | CCSPreferencesRootListController 56 | SmileyModuleRootListController 57 | 58 | 59 | -------------------------------------------------------------------------------- /SmileyModule/SmileyModule.m: -------------------------------------------------------------------------------- 1 | #import "SmileyModule.h" 2 | 3 | #import 4 | 5 | @implementation SmileyModule 6 | 7 | - (CCUILayoutSize)moduleSizeForOrientation:(int)orientation 8 | { 9 | CCUILayoutSize size; 10 | NSNumber *width, *height; 11 | 12 | if(orientation == 0) 13 | { 14 | width = [[[NSUserDefaults standardUserDefaults] persistentDomainForName:@"com.opa334.smileymoduleprefs"] objectForKey:@"PortraitWidth"]; 15 | height = [[[NSUserDefaults standardUserDefaults] persistentDomainForName:@"com.opa334.smileymoduleprefs"] objectForKey:@"PortraitHeight"]; 16 | } 17 | else 18 | { 19 | width = [[[NSUserDefaults standardUserDefaults] persistentDomainForName:@"com.opa334.smileymoduleprefs"] objectForKey:@"LandscapeWidth"]; 20 | height = [[[NSUserDefaults standardUserDefaults] persistentDomainForName:@"com.opa334.smileymoduleprefs"] objectForKey:@"LandscapeHeight"]; 21 | } 22 | 23 | if(height) 24 | { 25 | size.height = [height unsignedLongLongValue]; 26 | } 27 | else 28 | { 29 | //Default value 30 | size.height = 1; 31 | } 32 | 33 | if(width) 34 | { 35 | size.width = [width unsignedLongLongValue]; 36 | } 37 | else 38 | { 39 | //Default value 40 | size.width = 1; 41 | } 42 | 43 | return size; 44 | } 45 | 46 | //Return the icon of your module here 47 | - (UIImage *)iconGlyph 48 | { 49 | return [UIImage imageNamed:@"Smiley-Meh" inBundle:[NSBundle bundleForClass:[self class]] compatibleWithTraitCollection:nil]; 50 | } 51 | 52 | - (UIImage *)selectedIconGlyph 53 | { 54 | return [UIImage imageNamed:@"Smiley-Happy" inBundle:[NSBundle bundleForClass:[self class]] compatibleWithTraitCollection:nil]; 55 | } 56 | 57 | //Return the color selection color of your module here 58 | - (UIColor *)selectedColor 59 | { 60 | return [UIColor redColor]; 61 | } 62 | 63 | - (BOOL)isSelected 64 | { 65 | return _selected; 66 | } 67 | 68 | - (void)setSelected:(BOOL)selected 69 | { 70 | _selected = selected; 71 | 72 | [super refreshState]; 73 | } 74 | 75 | @end 76 | -------------------------------------------------------------------------------- /SmileyProvider/SmileyProvider.m: -------------------------------------------------------------------------------- 1 | #import "SmileyProvider.h" 2 | #import "ProvidedSmileyModuleRootListController.h" 3 | 4 | @implementation SmileyProvider 5 | 6 | - (instancetype)init 7 | { 8 | self = [super init]; 9 | _moduleInstancesByIdentifier = [NSMutableDictionary new]; 10 | return self; 11 | } 12 | 13 | - (NSUInteger)numberOfProvidedModules 14 | { 15 | NSUInteger value = 1; 16 | 17 | NSString* numberOfProvidedModules = [[[NSUserDefaults standardUserDefaults] persistentDomainForName:@"com.opa334.smileyprovider"] objectForKey:@"ModuleNumber"]; 18 | if(numberOfProvidedModules) 19 | { 20 | value = (NSUInteger)numberOfProvidedModules.integerValue; 21 | } 22 | 23 | return value; 24 | } 25 | 26 | - (NSString*)identifierForModuleAtIndex:(NSUInteger)index 27 | { 28 | NSString* identifier = [NSString stringWithFormat:@"com.opa334.providedsmileymodule.%lu", (unsigned long)index]; 29 | return identifier; 30 | } 31 | 32 | - (id)moduleInstanceForModuleIdentifier:(NSString*)identifier 33 | { 34 | ProvidedSmileyModule* module = [[ProvidedSmileyModule alloc] init]; 35 | module.settingsIdentifier = identifier; 36 | return module; 37 | } 38 | 39 | - (NSString*)displayNameForModuleIdentifier:(NSString*)identifier 40 | { 41 | NSString* numString = [identifier stringByReplacingOccurrencesOfString:@"com.opa334.providedsmileymodule." withString:@""]; 42 | NSString* displayName = [NSString stringWithFormat:@"Provided Smiley Module %i", [numString intValue]+1]; 43 | return displayName; 44 | } 45 | 46 | - (BOOL)providesListControllerForModuleIdentifier:(NSString*)identifier 47 | { 48 | return YES; 49 | } 50 | 51 | - (id)listControllerForModuleIdentifier:(NSString*)identifier 52 | { 53 | ProvidedSmileyModuleRootListController* moduleListController = [[ProvidedSmileyModuleRootListController alloc] init]; 54 | moduleListController.settingsIdentifier = identifier; 55 | moduleListController.displayName = [self displayNameForModuleIdentifier:identifier]; 56 | return moduleListController; 57 | } 58 | 59 | - (UIImage*)settingsIconForModuleIdentifier:(NSString*)identifier 60 | { 61 | return [UIImage imageNamed:@"Icon" inBundle:[NSBundle bundleForClass:[self class]] compatibleWithTraitCollection:nil]; 62 | } 63 | 64 | @end 65 | 66 | void reloadSmileysNotificationReceived(CFNotificationCenterRef center, void *observer, CFStringRef name, const void *object, CFDictionaryRef userInfo) 67 | { 68 | [[NSNotificationCenter defaultCenter] postNotificationName:@"smileyprovider/ReloadSmileys" object:nil]; 69 | } 70 | 71 | __attribute__((constructor)) 72 | static void init(void) 73 | { 74 | CFNotificationCenterAddObserver(CFNotificationCenterGetDarwinNotifyCenter(), NULL, reloadSmileysNotificationReceived, CFSTR("com.opa334.smileyprovider/ReloadSmileys"), NULL, CFNotificationSuspensionBehaviorDeliverImmediately); 75 | } 76 | 77 | -------------------------------------------------------------------------------- /SmileyProvider/ProvidedSmileyModule.m: -------------------------------------------------------------------------------- 1 | #import "ProvidedSmileyModule.h" 2 | 3 | #import 4 | #import 5 | 6 | @implementation ProvidedSmileyModule 7 | 8 | - (instancetype)init 9 | { 10 | self = [super init]; 11 | 12 | //calling reconfigureView reloads the icons 13 | [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(reconfigureView) name:@"smileyprovider/ReloadSmileys" object:nil]; 14 | 15 | return self; 16 | } 17 | 18 | - (CCUILayoutSize)moduleSizeForOrientation:(int)orientation 19 | { 20 | CCUILayoutSize size; 21 | NSNumber *width, *height; 22 | 23 | if(orientation == 0) 24 | { 25 | width = [[[NSUserDefaults standardUserDefaults] persistentDomainForName:self.settingsIdentifier] objectForKey:@"PortraitWidth"]; 26 | height = [[[NSUserDefaults standardUserDefaults] persistentDomainForName:self.settingsIdentifier] objectForKey:@"PortraitHeight"]; 27 | } 28 | else 29 | { 30 | width = [[[NSUserDefaults standardUserDefaults] persistentDomainForName:self.settingsIdentifier] objectForKey:@"LandscapeWidth"]; 31 | height = [[[NSUserDefaults standardUserDefaults] persistentDomainForName:self.settingsIdentifier] objectForKey:@"LandscapeHeight"]; 32 | } 33 | 34 | if(height) 35 | { 36 | size.height = [height unsignedLongLongValue]; 37 | } 38 | else 39 | { 40 | //Default value 41 | size.height = 1; 42 | } 43 | 44 | if(width) 45 | { 46 | size.width = [width unsignedLongLongValue]; 47 | } 48 | else 49 | { 50 | //Default value 51 | size.width = 1; 52 | } 53 | 54 | return size; 55 | } 56 | 57 | - (NSInteger)inactiveSmiley 58 | { 59 | NSInteger value = 0; 60 | 61 | NSNumber* prefNum = [[[NSUserDefaults standardUserDefaults] persistentDomainForName:self.settingsIdentifier] objectForKey:@"inactiveSmiley"]; 62 | if(prefNum) 63 | { 64 | value = [prefNum integerValue]; 65 | } 66 | 67 | return value; 68 | } 69 | 70 | - (NSInteger)activeSmiley 71 | { 72 | NSInteger value = 1; 73 | 74 | NSNumber* prefNum = [[[NSUserDefaults standardUserDefaults] persistentDomainForName:self.settingsIdentifier] objectForKey:@"activeSmiley"]; 75 | if(prefNum) 76 | { 77 | value = [prefNum integerValue]; 78 | } 79 | 80 | return value; 81 | } 82 | 83 | - (UIImage *)iconForSmiley:(NSInteger)smiley 84 | { 85 | NSString* imageName; 86 | 87 | if(smiley < 0) 88 | { 89 | imageName = @"Smiley_Sad"; 90 | } 91 | else if(smiley > 0) 92 | { 93 | imageName = @"Smiley_Happy"; 94 | } 95 | else 96 | { 97 | imageName = @"Smiley_Neutral"; 98 | } 99 | 100 | NSLog(@"iconForSmiley:%li = %@", (long)smiley, imageName); 101 | 102 | return [UIImage imageNamed:imageName inBundle:[NSBundle bundleForClass:[self class]] compatibleWithTraitCollection:nil]; 103 | } 104 | 105 | //Return the icon of your module here 106 | - (UIImage *)iconGlyph 107 | { 108 | return [self iconForSmiley:[self inactiveSmiley]]; 109 | } 110 | 111 | - (UIImage *)selectedIconGlyph 112 | { 113 | return [self iconForSmiley:[self activeSmiley]]; 114 | } 115 | 116 | //Return the color selection color of your module here 117 | - (UIColor *)selectedColor 118 | { 119 | return [UIColor redColor]; 120 | } 121 | 122 | - (BOOL)isSelected 123 | { 124 | return _selected; 125 | } 126 | 127 | - (void)setSelected:(BOOL)selected 128 | { 129 | _selected = selected; 130 | 131 | [super refreshState]; 132 | } 133 | 134 | @end 135 | -------------------------------------------------------------------------------- /SmileyModule/Resources/ModulePrefs.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | items 6 | 7 | 8 | cell 9 | PSGroupCell 10 | 11 | 12 | cell 13 | PSStaticTextCell 14 | label 15 | Portrait Height 16 | 17 | 18 | cell 19 | PSSliderCell 20 | defaults 21 | com.opa334.smileymoduleprefs 22 | default 23 | 1 24 | min 25 | 1 26 | max 27 | 4 28 | isSegmented 29 | 30 | segmentCount 31 | 3 32 | showValue 33 | 34 | key 35 | PortraitHeight 36 | PostNotification 37 | com.opa334.ccsupport/ReloadSizes 38 | 39 | 40 | cell 41 | PSGroupCell 42 | 43 | 44 | cell 45 | PSStaticTextCell 46 | label 47 | Portrait Width 48 | 49 | 50 | cell 51 | PSSliderCell 52 | defaults 53 | com.opa334.smileymoduleprefs 54 | default 55 | 1 56 | min 57 | 1 58 | max 59 | 4 60 | isSegmented 61 | 62 | segmentCount 63 | 3 64 | showValue 65 | 66 | key 67 | PortraitWidth 68 | PostNotification 69 | com.opa334.ccsupport/ReloadSizes 70 | 71 | 72 | cell 73 | PSGroupCell 74 | 75 | 76 | cell 77 | PSStaticTextCell 78 | label 79 | Landscape Height 80 | 81 | 82 | cell 83 | PSSliderCell 84 | defaults 85 | com.opa334.smileymoduleprefs 86 | default 87 | 1 88 | min 89 | 1 90 | max 91 | 4 92 | isSegmented 93 | 94 | segmentCount 95 | 3 96 | showValue 97 | 98 | key 99 | LandscapeHeight 100 | PostNotification 101 | com.opa334.ccsupport/ReloadSizes 102 | 103 | 104 | cell 105 | PSGroupCell 106 | 107 | 108 | cell 109 | PSStaticTextCell 110 | label 111 | Landscape Width 112 | 113 | 114 | cell 115 | PSSliderCell 116 | defaults 117 | com.opa334.smileymoduleprefs 118 | default 119 | 1 120 | min 121 | 1 122 | max 123 | 4 124 | isSegmented 125 | 126 | segmentCount 127 | 3 128 | showValue 129 | 130 | key 131 | LandscapeWidth 132 | PostNotification 133 | com.opa334.ccsupport/ReloadSizes 134 | 135 | 136 | title 137 | Smiley Module 138 | 139 | 140 | -------------------------------------------------------------------------------- /SmileyProvider/Resources/SmileyPrefs.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | items 6 | 7 | 8 | cell 9 | PSGroupCell 10 | label 11 | Inactive Smiley 12 | 13 | 14 | PostNotification 15 | com.opa334.smileyprovider/ReloadSmileys 16 | cell 17 | PSSegmentCell 18 | default 19 | 0 20 | defaults 21 | com.opa334.safariplusprefs 22 | key 23 | inactiveSmiley 24 | titlesDataSource 25 | smileyTitles 26 | valuesDataSource 27 | smileyValues 28 | 29 | 30 | cell 31 | PSGroupCell 32 | label 33 | Active Smiley 34 | 35 | 36 | PostNotification 37 | com.opa334.smileyprovider/ReloadSmileys 38 | cell 39 | PSSegmentCell 40 | default 41 | 1 42 | defaults 43 | com.opa334.safariplusprefs 44 | key 45 | activeSmiley 46 | titlesDataSource 47 | smileyTitles 48 | valuesDataSource 49 | smileyValues 50 | 51 | 52 | cell 53 | PSGroupCell 54 | label 55 | Size 56 | 57 | 58 | cell 59 | PSStaticTextCell 60 | label 61 | Portrait Height 62 | 63 | 64 | cell 65 | PSSliderCell 66 | default 67 | 1 68 | min 69 | 1 70 | max 71 | 4 72 | isSegmented 73 | 74 | segmentCount 75 | 3 76 | showValue 77 | 78 | key 79 | PortraitHeight 80 | PostNotification 81 | com.opa334.ccsupport/ReloadSizes 82 | 83 | 84 | cell 85 | PSGroupCell 86 | 87 | 88 | cell 89 | PSStaticTextCell 90 | label 91 | Portrait Width 92 | 93 | 94 | cell 95 | PSSliderCell 96 | default 97 | 1 98 | min 99 | 1 100 | max 101 | 4 102 | isSegmented 103 | 104 | segmentCount 105 | 3 106 | showValue 107 | 108 | key 109 | PortraitWidth 110 | PostNotification 111 | com.opa334.ccsupport/ReloadSizes 112 | 113 | 114 | cell 115 | PSGroupCell 116 | 117 | 118 | cell 119 | PSStaticTextCell 120 | label 121 | Landscape Height 122 | 123 | 124 | cell 125 | PSSliderCell 126 | default 127 | 1 128 | min 129 | 1 130 | max 131 | 4 132 | isSegmented 133 | 134 | segmentCount 135 | 3 136 | showValue 137 | 138 | key 139 | LandscapeHeight 140 | PostNotification 141 | com.opa334.ccsupport/ReloadSizes 142 | 143 | 144 | cell 145 | PSGroupCell 146 | 147 | 148 | cell 149 | PSStaticTextCell 150 | label 151 | Landscape Width 152 | 153 | 154 | cell 155 | PSSliderCell 156 | default 157 | 1 158 | min 159 | 1 160 | max 161 | 4 162 | isSegmented 163 | 164 | segmentCount 165 | 3 166 | showValue 167 | 168 | key 169 | LandscapeWidth 170 | PostNotification 171 | com.opa334.ccsupport/ReloadSizes 172 | 173 | 174 | 175 | 176 | --------------------------------------------------------------------------------