This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* the following macros will create a mechanism to box common cocoa structures so can be easily added to NSArrays etc | |
* | |
* The macros can take multiple arguments allowing you to pass in an existing struct, or the components of the struct | |
* | |
* for example: | |
* NSValue * pointValue1 = @point(3,5); // pass in the two values that make up the point | |
* | |
* NSPoint * myPoint = NSMakePoint(3,5); | |
* NSValue * pointValue2 = @point(myPoint); // pass in a existing point. | |
* |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-(void)MTsetSelectedTabViewItemIndex:(NSUInteger)idx{ | |
if ([[NSThread currentThread] threadDictionary][@"pluginExclusionLock"]){ | |
[swizzledSelf MTsetSelectedTabViewItemIndex:idx]; | |
return; | |
} | |
// grab the pluginExclusionLock | |
[[NSThread currentThread] threadDictionary][@"pluginExclusionLock"] = @YES; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
- (void)MASetPreferencesController:(NSWindowController *)windowController { | |
// minor test to change code here | |
[self MASetPreferencesController:windowController]; | |
if(!windowController) { | |
return; | |
} | |
NSToolbarItem *toolbarItem = [[NSToolbarItem alloc] initWithItemIdentifier:@"gpgmail"]; | |
toolbarItem.label = @"GPGMail"; | |
toolbarItem.image = [NSImage imageNamed:@"GPGMail"]; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#import <Foundation/Foundation.h> | |
#include <sys/param.h> | |
#include <sys/mount.h> | |
// adapted from http://www.cocoabuilder.com/archive/cocoa/203717-looking-for-sample-code-to-read-uuid-from-disk-volume.html | |
int main(int argc, const char * argv[]) { | |
@autoreleasepool { | |
// insert code here... | |
struct statfs stat; |