mirror of
https://github.com/KevinMidboe/linguist.git
synced 2025-10-29 09:40:21 +00:00
* Add .x as XDR/RPCGEN XDR/RPC language as documented in RFC5531, RFC4506. Samples are from glibc and RFCs. * Add Logos samples https://github.com/JonasGessner/NoCarrier/blob/master/NoCarrier.x - MITcf31f4e466/llvm-gcc-R3/gcc/testsuite/objc/execute/string1.x- GPL2f6415578fa/perapp-plugin/Tweak.x- GPL3d1b3e83888/NCHax.x- Apache * Add disambiguate heuristics for .x * Add RPC to vendor/README.md
58 lines
1.2 KiB
Plaintext
58 lines
1.2 KiB
Plaintext
#import <UIKit/UIKit.h>
|
|
#import <BulletinBoard/BBSectionInfo.h>
|
|
#import <UIKit/UIImage+Private.h>
|
|
#import <version.h>
|
|
|
|
static NSString *const kHBDPWeeAppIdentifier = @"ws.hbang.dailypaperweeapp";
|
|
|
|
#pragma mark - Change section header and icon
|
|
|
|
// courtesy of benno
|
|
|
|
BOOL isDailyPaper = NO;
|
|
|
|
%hook SBBulletinObserverViewController
|
|
|
|
- (void)_addSection:(BBSectionInfo *)section toCategory:(NSInteger)category widget:(id)widget {
|
|
if ([section.sectionID isEqualToString:kHBDPWeeAppIdentifier]) {
|
|
isDailyPaper = YES;
|
|
%orig;
|
|
isDailyPaper = NO;
|
|
} else {
|
|
%orig;
|
|
}
|
|
}
|
|
|
|
%end
|
|
|
|
%hook SBBulletinListSection
|
|
|
|
- (void)setDisplayName:(NSString *)displayName {
|
|
%orig(isDailyPaper ? @"Current Wallpaper" : displayName);
|
|
}
|
|
|
|
- (void)setIconImage:(UIImage *)iconImage {
|
|
%orig(isDailyPaper ? [UIImage imageNamed:@"icon" inBundle:[NSBundle bundleWithPath:@"/Library/PreferenceBundles/DailyPaper.bundle"]] : iconImage);
|
|
}
|
|
|
|
%end
|
|
|
|
#pragma mark - Enable by default
|
|
|
|
%hook SBNotificationCenterDataProviderController
|
|
|
|
- (NSArray *)_copyDefaultEnabledWidgetIDs {
|
|
NSArray *defaultWidgets = %orig;
|
|
return [[defaultWidgets arrayByAddingObject:kHBDPWeeAppIdentifier] copy];
|
|
}
|
|
|
|
%end
|
|
|
|
#pragma mark - Constructor
|
|
|
|
%ctor {
|
|
if (!IS_IOS_OR_NEWER(iOS_8_0)) {
|
|
%init;
|
|
}
|
|
}
|