-
Notifications
You must be signed in to change notification settings - Fork 12
/
Copy pathSMFCommonTools.h
123 lines (110 loc) · 3.3 KB
/
SMFCommonTools.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
//
// SMFCommonTools.h
// SMFramework
//
// Created by Thomas Cool on 11/4/10.
// Copyright 2010 tomcool.org. All rights reserved.
//
#import "Backrow/AppleTV.h"
typedef enum _popupPosition{
kSMFPopupCenterLeft =0,
kSMFPopupTopLeft =1,
kSMFPopupBottomLeft =2,
kSMFPopupCenterFarLeft =4,
kSMFPopupTopFarLeft =5,
kSMFPopupBottomFarLeft =6
} PopupPosition;
/**
*A Compilation of methods to use for popups and other stuff
*/
@interface SMFCommonTools : NSObject {
}
///---
///@name getting the shared object
///---
/**
*@return the shared objectec
*/
+(SMFCommonTools *)sharedInstance;
///---
///@name Popups
///---
/**
*@return an SMFPopupInfo object to show using showPopup
*@param array an NSArray with 1-3 NSStrings inside (can be nil)
*@param image a BRImage (cannot be nil)
*@note Important: image must not be nil
*@see showPopup:
*/
+(id)popupControlWithLines:(NSArray *)array andImage:(BRImage *)image;
/**
*@returns a SMFPopupInfo to show using showPopup
*@param dict a NSDictionary with keys `@"Image"` (BRImage) and `@"Lines"` (NSArray of NSStrings)
*@see showPopup:
*/
+(id)popupControlWithDictionary:(NSDictionary *)dict;
/**
*Displays a popup using the BRPopupManager
*@param popup a popup created using popupControlwithLines:andImage: or popupControlWithDictionary:
*Calls `[SMFCommonTools showPopup:popup withTimeout:8 withPosition:6 withSize:CGSizeMake(0.9,0.15)];`
*@see showPopup:withTimeout:withPosition:withSize:
*
*/
+(void)showPopup:(id)popup;
/**
*Displays a popup using the BRPopupManager
*adds more customizability to the +(void)showPopup: method
*
*@param popup a popup created using popupControlwithLines:andImage:
*@param timeout display duration in seconds (integer)
*@param position a position integer
*@param size CGSize confusing
*
*/
+(void)showPopup:(id)popup withTimeout:(int)timeout withPosition:(PopupPosition)position withSize:(CGSize)size;
/**
* Displays a popup using the BRPopupManager
* adds more customizability to the +(void)showPopup: method
*@param popup a popup created using popupControlwithLines:andImage:
*@param timeout display duration in seconds
*@param position a position integer (see showPopup:withTimeout:withPosition:withSize:)
*@param width a relative width
*@param height a relative height
*@see showPopup:withTimeout:withPosition:withSize:
*/
+(void)showPopup:(id)popup withTimeout:(int)timeout withPosition:(PopupPosition)position withWidth:(float)width withHeight:(float)height;
///---
///@name Processes
///---
/**
* Runs a task with popen parsing the output
*@param call the call to be passed. eg: @"/usr/bin/screencapture -s 10"
* @return the output text from the call seperated into lines into an array
*/
-(NSArray *)returnForProcess:(NSString *)call;
/*
* checks if seatbelt is enabled
* @return: 0 if it's disabled
* 1 if it's enabled
* -1 if the status cannot be determined
*/
-(int)syscallSeatbeltEnabled;
/*
* disables seatbelt
* @return: return from the system call
*/
-(int)disableSeatbelt;
/*
* enables seatbelt
* @return: return from the system call
*/
-(int)enableSeatbelt;
/*
* method put in place to test stuff
*/
-(void)test;
/*
* A simple way to restart lowtide for people to lazy to remember the proper BRCall (me)
*/
-(void)restartLowtide;
@end