2012-08-20 21:34:54 +02:00
|
|
|
/*
|
|
|
|
|
* FanControl
|
|
|
|
|
*
|
2012-08-21 00:05:39 +02:00
|
|
|
* Copyright (c) 2006-2012 Hendrik Holtmann
|
2013-12-21 09:26:27 -05:00
|
|
|
* Portions Copyright (c) 2013 Michael Wilber
|
|
|
|
|
*
|
2012-08-20 21:34:54 +02:00
|
|
|
* FanControl.h - MacBook(Pro) FanControl application
|
|
|
|
|
*
|
|
|
|
|
* This program is free software; you can redistribute it and/or modify
|
|
|
|
|
* it under the terms of the GNU General Public License as published by
|
|
|
|
|
* the Free Software Foundation; either version 2 of the License, or
|
|
|
|
|
* (at your option) any later version.
|
|
|
|
|
*
|
|
|
|
|
* This program is distributed in the hope that it will be useful,
|
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
|
* GNU General Public License for more details.
|
|
|
|
|
*
|
|
|
|
|
* You should have received a copy of the GNU General Public License
|
|
|
|
|
* along with this program; if not, write to the Free Software
|
|
|
|
|
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
#import <Cocoa/Cocoa.h>
|
|
|
|
|
#import "NSFileManager+DirectoryLocations.h"
|
2018-08-12 00:53:25 +02:00
|
|
|
#import "smc.h"
|
|
|
|
|
#import "smcWrapper.h"
|
|
|
|
|
#import "MachineDefaults.h"
|
2012-08-20 21:34:54 +02:00
|
|
|
|
2018-08-12 00:53:25 +02:00
|
|
|
#import "Power.h"
|
2012-08-20 21:34:54 +02:00
|
|
|
#include <mach/mach_port.h>
|
|
|
|
|
#include <mach/mach_interface.h>
|
|
|
|
|
#include <mach/mach_init.h>
|
|
|
|
|
|
|
|
|
|
#include <IOKit/pwr_mgt/IOPMLib.h>
|
|
|
|
|
#include <IOKit/IOMessage.h>
|
2016-10-16 18:28:42 +02:00
|
|
|
#import "Constants.h"
|
2012-08-20 21:34:54 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
#define kMenuBarHeight 22
|
|
|
|
|
|
2013-12-21 09:26:27 -05:00
|
|
|
|
2013-12-25 09:47:10 -05:00
|
|
|
@interface FanControl : NSObject <NSMenuDelegate>
|
2012-08-20 21:34:54 +02:00
|
|
|
|
|
|
|
|
{
|
|
|
|
|
IBOutlet id currentSpeed;
|
|
|
|
|
IBOutlet id currentSpeed1;
|
|
|
|
|
|
|
|
|
|
IBOutlet id slider1;
|
|
|
|
|
IBOutlet id slider2;
|
|
|
|
|
|
|
|
|
|
IBOutlet id field1;
|
|
|
|
|
IBOutlet id field2;
|
|
|
|
|
|
|
|
|
|
IBOutlet id mainwindow;
|
|
|
|
|
|
|
|
|
|
IBOutlet id tabview;
|
|
|
|
|
|
|
|
|
|
IBOutlet id applybutton;
|
|
|
|
|
|
|
|
|
|
IBOutlet id programinfo;
|
|
|
|
|
|
|
|
|
|
IBOutlet id copyright;
|
|
|
|
|
|
|
|
|
|
IBOutlet id syncslider;
|
|
|
|
|
|
|
|
|
|
IBOutlet id TemperatureController;
|
|
|
|
|
|
|
|
|
|
IBOutlet id levelIndicator;
|
|
|
|
|
|
|
|
|
|
IBOutlet id newfavoritewindow;
|
|
|
|
|
|
|
|
|
|
IBOutlet id newfavorite_title;
|
|
|
|
|
|
|
|
|
|
IBOutlet id autochange;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
IBOutlet NSMenu *theMenu;
|
|
|
|
|
|
|
|
|
|
IBOutlet id faqWindow;
|
|
|
|
|
|
|
|
|
|
IBOutlet id faqText;
|
|
|
|
|
|
|
|
|
|
IBOutlet id sliderCell;
|
|
|
|
|
|
|
|
|
|
IBOutlet id sync;
|
|
|
|
|
|
|
|
|
|
IBOutlet id colorSelector;
|
|
|
|
|
|
|
|
|
|
NSStatusItem *statusItem;
|
|
|
|
|
|
|
|
|
|
NSMutableArray* s_menus;
|
|
|
|
|
|
|
|
|
|
NSTimer *_readTimer;
|
|
|
|
|
|
|
|
|
|
Power *pw;
|
|
|
|
|
|
|
|
|
|
IBOutlet id FavoritesController;
|
|
|
|
|
IBOutlet id FanController;
|
|
|
|
|
IBOutlet id DefaultsController;
|
|
|
|
|
|
|
|
|
|
MachineDefaults *mdefaults;
|
|
|
|
|
|
|
|
|
|
NSDictionary *undo_dic;
|
|
|
|
|
|
|
|
|
|
NSImage *menu_image;
|
|
|
|
|
NSImage *menu_image_alt;
|
|
|
|
|
}
|
2014-10-20 17:30:59 +02:00
|
|
|
|
2014-10-21 17:57:58 +02:00
|
|
|
@property (nonatomic, strong ) NSMutableDictionary *machineDefaultsDict;
|
|
|
|
|
|
2012-08-20 21:34:54 +02:00
|
|
|
|
|
|
|
|
-(void)terminate:(id)sender;
|
|
|
|
|
|
|
|
|
|
- (IBAction)paypal:(id)sender;
|
|
|
|
|
- (IBAction)visitHomepage:(id)sender;
|
|
|
|
|
|
|
|
|
|
- (IBAction)closePreferences:(id)sender;
|
|
|
|
|
- (IBAction)savePreferences:(id)sender;
|
|
|
|
|
- (IBAction)updateCheck:(id)sender;
|
2014-10-30 16:51:29 +01:00
|
|
|
- (IBAction)resetSettings:(id)sender;
|
2012-08-20 21:34:54 +02:00
|
|
|
|
|
|
|
|
- (void)init_statusitem;
|
|
|
|
|
|
|
|
|
|
//new ones, check old later
|
|
|
|
|
- (IBAction)loginItem:(id)sender;
|
|
|
|
|
- (IBAction)add_favorite:(id)sender;
|
|
|
|
|
- (IBAction)close_favorite:(id)sender;
|
|
|
|
|
- (IBAction)save_favorite:(id)sender;
|
|
|
|
|
- (IBAction)delete_favorite:(id)sender;
|
|
|
|
|
- (IBAction)syncSliders:(id)sender;
|
|
|
|
|
- (void)apply_quickselect:(id)sender;
|
|
|
|
|
- (void)apply_settings:(id)sender controllerindex:(int)cIndex;
|
|
|
|
|
+ (void)setRights;
|
|
|
|
|
- (void) syncBinder:(Boolean)bind;
|
|
|
|
|
- (IBAction) changeMenu:(id)sender;
|
|
|
|
|
- (IBAction)menuSelect:(id)sender;
|
2013-12-25 09:47:10 -05:00
|
|
|
- (void)menuNeedsUpdate:(NSMenu*)menu;
|
2012-08-20 21:34:54 +02:00
|
|
|
@end
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@interface NSNumber (NumberAdditions)
|
2014-10-21 17:57:58 +02:00
|
|
|
@property (NS_NONATOMIC_IOSONLY, readonly, copy) NSString *tohex;
|
|
|
|
|
@property (NS_NONATOMIC_IOSONLY, readonly, copy) NSNumber *celsius_fahrenheit;
|
2012-08-20 21:34:54 +02:00
|
|
|
|
|
|
|
|
@end
|
|
|
|
|
|