-
Notifications
You must be signed in to change notification settings - Fork 2
/
IPSController.h
executable file
·112 lines (90 loc) · 3.61 KB
/
IPSController.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
/*
Copyright (c) 2007, Marketcircle Inc.
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.,
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*/
#import <Cocoa/Cocoa.h>
#import <Quartz/Quartz.h>
#import <WebKit/WebKit.h>
#import "Neptune.h"
/*----------------------------------------------------------------------
| NPT_HttpHomePageRequestHandler
+---------------------------------------------------------------------*/
class NPT_HttpHomePageRequestHandler : public NPT_HttpStaticRequestHandler
{
public:
// constructors
NPT_HttpHomePageRequestHandler(const char* document) :
NPT_HttpStaticRequestHandler(document) {}
// public methods
void SetDocument(const char* document) {
NPT_AutoLock lock(m_Lock);
m_Buffer.SetData((const NPT_Byte*)document, NPT_StringLength(document));
}
// NPT_HttpRequetsHandler methods
virtual NPT_Result SetupResponse(NPT_HttpRequest& request,
const NPT_HttpRequestContext& context,
NPT_HttpResponse& response) {
NPT_AutoLock lock(m_Lock);
return NPT_HttpStaticRequestHandler::SetupResponse(request, context, response);
}
private:
NPT_Mutex m_Lock;
};
@class IPSWindow, IPSAnimationWindow;
@interface IPSController : NSObject {
IBOutlet IPSAnimationWindow* rotationWindow;
IBOutlet QCView* rotationView;
IBOutlet IPSWindow* phoneWindow;
IBOutlet WebView* webView;
IBOutlet NSWindow* aboutPanel;
IBOutlet NSPanel* agentPanel;
IBOutlet NSObjectController* webViewController;
IBOutlet NSTextField* customUserAgentField;
IBOutlet NSMenuItem* webKitMenuItem;
IBOutlet NSMenuItem* iPhoneMenuItem;
IBOutlet NSMenuItem* customMenuItem;
IBOutlet NSMenuItem* pluginsMenuItem;
NSNetServiceBrowser* browser;
NSMutableArray* services;
NSMutableDictionary* devices;
NSNetService* serviceBeingResolved;
NPT_HttpServer* server;
NPT_HttpHomePageRequestHandler* homePageHandler;
BOOL isRotating;
}
- (IBAction)toggleUserAgents:(id)sender;
- (IBAction)toggleAboutPanel: (id)sender;
- (IBAction)toggleCustomAgentPanel: (id)sender;
- (IBAction)togglePluginsEnabled:(id)sender;
- (IBAction)restoreDefaults: (id)sender;
- (IBAction)marketcircleWebsite: (id)sender;
- (IBAction)mciPhoneyWebsite: (id)sender;
- (IBAction)sfiPhoneyWebsite: (id)sender;
- (IBAction)plutinosoftWebsite: (id)sender;
- (IBAction)pltDemoGodWebsite: (id)sender;
- (IBAction)pltScreenSplitrWebsite: (id)sender;
#pragma mark -
#pragma mark Bonjour
- (NSString*)getHomepageHtml;
- (void)deviceArrived:(NSNetService*)service withUrl:(NSString*)url;
- (void)deviceLeft:(NSNetService*)service;
- (void)reload:(BOOL)force;
#pragma mark -
#pragma mark Rotation Animation
- (void)resetIsRotatingFlag;
- (BOOL)canToggleRotation;
- (void)configureRotationWindow;
- (IBAction)doToggleRotation:(id)sender;
- (IBAction)doRotateToLandscape:(id)sender;
- (IBAction)doRotateToPortrait:(id)sender;
@end