mirror of
https://github.com/KevinMidboe/linguist.git
synced 2025-12-08 04:18:48 +00:00
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 - 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
This commit is contained in:
committed by
Colin Seymour
parent
8da6ddf9d9
commit
60f748d47b
57
samples/Logos/NCHax.x
Normal file
57
samples/Logos/NCHax.x
Normal file
@@ -0,0 +1,57 @@
|
||||
#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;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user