Files
linguist/samples/Logos/NCHax.x
Dylan Simon 60f748d47b Add .x as XDR/RPCGEN (#3472)
* 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 - MIT
cf31f4e466/llvm-gcc-R3/gcc/testsuite/objc/execute/string1.x - GPL2
f6415578fa/perapp-plugin/Tweak.x - GPL3
d1b3e83888/NCHax.x - Apache

* Add disambiguate heuristics for .x

* Add RPC to vendor/README.md
2018-01-25 09:15:09 +00:00

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;
}
}