зеркало из https://github.com/mozilla/pjs.git
Bug 421857 - Remove CocoaEmbed test app; r=joshmoz sr=roc
This commit is contained in:
Родитель
0f7bad88af
Коммит
b895c6d287
Разница между файлами не показана из-за своего большого размера
Загрузить разницу
|
@ -1,58 +0,0 @@
|
|||
# ***** BEGIN LICENSE BLOCK *****
|
||||
# Version: Mozilla-sample-code 1.0
|
||||
#
|
||||
# Copyright (c) 2002 Netscape Communications Corporation and
|
||||
# other contributors
|
||||
#
|
||||
# Permission is hereby granted, free of charge, to any person obtaining a
|
||||
# copy of this Mozilla sample software and associated documentation files
|
||||
# (the "Software"), to deal in the Software without restriction, including
|
||||
# without limitation the rights to use, copy, modify, merge, publish,
|
||||
# distribute, sublicense, and/or sell copies of the Software, and to permit
|
||||
# persons to whom the Software is furnished to do so, subject to the
|
||||
# following conditions:
|
||||
#
|
||||
# The above copyright notice and this permission notice shall be included
|
||||
# in all copies or substantial portions of the Software.
|
||||
#
|
||||
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
|
||||
# OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
|
||||
# THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
|
||||
# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
|
||||
# DEALINGS IN THE SOFTWARE.
|
||||
#
|
||||
# Contributor(s):
|
||||
# Conrad Carlen <ccarlen@netscape.com>
|
||||
#
|
||||
# ***** END LICENSE BLOCK *****
|
||||
|
||||
DEPTH = ../../../
|
||||
topsrcdir = @top_srcdir@
|
||||
srcdir = @srcdir@
|
||||
VPATH = @srcdir@
|
||||
|
||||
include $(DEPTH)/config/autoconf.mk
|
||||
|
||||
ifdef MOZ_DEBUG
|
||||
BUILDSTYLE = Development
|
||||
else
|
||||
BUILDSTYLE = Deployment
|
||||
endif
|
||||
|
||||
include $(topsrcdir)/config/rules.mk
|
||||
|
||||
ABS_topsrcdir := $(shell cd $(topsrcdir); pwd)
|
||||
ifneq ($(ABS_topsrcdir),$(MOZ_BUILD_ROOT))
|
||||
export::
|
||||
rsync -a --exclude .DS_Store --exclude "CVS/" $(srcdir)/CocoaEmbed.pbproj .
|
||||
ln -fs $(srcdir)/src
|
||||
ln -fs $(srcdir)/res
|
||||
endif
|
||||
|
||||
libs::
|
||||
pbxbuild -buildstyle $(BUILDSTYLE) build
|
||||
|
||||
clean clobber::
|
||||
rm -rf build
|
Двоичные данные
embedding/tests/cocoaEmbed/res/English.lproj/InfoPlist.strings
Двоичные данные
embedding/tests/cocoaEmbed/res/English.lproj/InfoPlist.strings
Двоичный файл не отображается.
|
@ -1,13 +0,0 @@
|
|||
{
|
||||
IBClasses = (
|
||||
{CLASS = FirstResponder; LANGUAGE = ObjC; SUPERCLASS = NSObject; },
|
||||
{
|
||||
ACTIONS = {load = id; };
|
||||
CLASS = MyBrowserView;
|
||||
LANGUAGE = ObjC;
|
||||
OUTLETS = {progress = id; progressSuper = id; status = id; urlbar = id; };
|
||||
SUPERCLASS = NSView;
|
||||
}
|
||||
);
|
||||
IBVersion = 1;
|
||||
}
|
|
@ -1,22 +0,0 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
|
||||
<plist version="1.0">
|
||||
<dict>
|
||||
<key>IBDocumentLocation</key>
|
||||
<string>546 55 356 240 0 0 1152 848 </string>
|
||||
<key>IBEditorPositions</key>
|
||||
<dict>
|
||||
<key>29</key>
|
||||
<string>69 252 302 44 0 0 1152 848 </string>
|
||||
</dict>
|
||||
<key>IBFramework Version</key>
|
||||
<string>291.0</string>
|
||||
<key>IBOpenObjects</key>
|
||||
<array>
|
||||
<integer>21</integer>
|
||||
<integer>29</integer>
|
||||
</array>
|
||||
<key>IBSystem Version</key>
|
||||
<string>6I32</string>
|
||||
</dict>
|
||||
</plist>
|
Двоичные данные
embedding/tests/cocoaEmbed/res/English.lproj/MainMenu.nib/objects.nib
сгенерированный
Двоичные данные
embedding/tests/cocoaEmbed/res/English.lproj/MainMenu.nib/objects.nib
сгенерированный
Двоичный файл не отображается.
|
@ -1,41 +0,0 @@
|
|||
#import <Cocoa/Cocoa.h>
|
||||
#import "CHBrowserView.h"
|
||||
|
||||
@interface MyBrowserView : NSView <CHBrowserListener, CHBrowserContainer>
|
||||
{
|
||||
IBOutlet id urlbar;
|
||||
IBOutlet id status;
|
||||
IBOutlet id progress;
|
||||
IBOutlet id progressSuper;
|
||||
CHBrowserView* browserView;
|
||||
NSString* defaultStatus;
|
||||
NSString* loadingStatus;
|
||||
}
|
||||
- (IBAction)load:(id)sender;
|
||||
- (void)awakeFromNib;
|
||||
- (void)setFrame:(NSRect)frameRect;
|
||||
|
||||
// CHBrowserListener messages
|
||||
- (void)onLoadingStarted;
|
||||
- (void)onLoadingCompleted:(BOOL)succeeded;
|
||||
- (void)onProgressChange:(int)currentBytes outOf:(int)maxBytes;
|
||||
- (void)onLocationChange:(NSString*)url;
|
||||
- (void)onStatusChange:(NSString*)aMessage;
|
||||
- (void)onSecurityStateChange:(unsigned long)newState;
|
||||
// Called when a context menu should be shown.
|
||||
- (void)onShowContextMenu:(int)flags domEvent:(nsIDOMEvent*)aEvent domNode:(nsIDOMNode*)aNode;
|
||||
// Called when a tooltip should be shown or hidden
|
||||
- (void)onShowTooltip:(NSPoint)where withText:(NSString*)text;
|
||||
- (void)onHideTooltip;
|
||||
|
||||
// CHBrowserContainer messages
|
||||
- (void)setStatus:(NSString *)statusString ofType:(NSStatusType)type;
|
||||
- (NSString *)title;
|
||||
- (void)setTitle:(NSString *)title;
|
||||
- (void)sizeBrowserTo:(NSSize)dimensions;
|
||||
- (CHBrowserView*)createBrowserWindow:(unsigned int)mask;
|
||||
- (NSMenu*)contextMenu;
|
||||
- (NSWindow*)nativeWindow;
|
||||
- (BOOL)shouldAcceptDragFromSource:(id)dragSource;
|
||||
|
||||
@end
|
|
@ -1,198 +0,0 @@
|
|||
#import "MyBrowserView.h"
|
||||
|
||||
#define DOCUMENT_DONE_STRING @"Document: Done"
|
||||
#define LOADING_STRING @"Loading..."
|
||||
|
||||
@implementation MyBrowserView
|
||||
|
||||
- (IBAction)load:(id)sender
|
||||
{
|
||||
NSString* str = [urlbar stringValue];
|
||||
[browserView loadURI:str referrer:nil flags:NSLoadFlagsNone];
|
||||
}
|
||||
|
||||
- (void)awakeFromNib
|
||||
{
|
||||
NSRect bounds = [self bounds];
|
||||
browserView = [[CHBrowserView alloc] initWithFrame:bounds];
|
||||
[self addSubview:browserView];
|
||||
[browserView setContainer:self];
|
||||
[browserView addListener:self];
|
||||
|
||||
defaultStatus = NULL;
|
||||
loadingStatus = DOCUMENT_DONE_STRING;
|
||||
[status setStringValue:loadingStatus];
|
||||
|
||||
[progress retain];
|
||||
[progress removeFromSuperview];
|
||||
}
|
||||
|
||||
- (void)setFrame:(NSRect)frameRect
|
||||
{
|
||||
[super setFrame:frameRect];
|
||||
NSRect bounds = [self bounds];
|
||||
[browserView setFrame:bounds];
|
||||
}
|
||||
|
||||
- (void)onLoadingStarted
|
||||
{
|
||||
if (defaultStatus) {
|
||||
[defaultStatus release];
|
||||
defaultStatus = NULL;
|
||||
}
|
||||
|
||||
[progressSuper addSubview:progress];
|
||||
[progress release];
|
||||
[progress setIndeterminate:YES];
|
||||
[progress startAnimation:self];
|
||||
|
||||
loadingStatus = LOADING_STRING;
|
||||
[status setStringValue:loadingStatus];
|
||||
|
||||
#ifdef DEBUG_vidur
|
||||
printf("Starting to load\n");
|
||||
#endif
|
||||
}
|
||||
|
||||
- (void)onLoadingCompleted:(BOOL)succeeded
|
||||
{
|
||||
[progress setIndeterminate:YES];
|
||||
[progress stopAnimation:self];
|
||||
[progress retain];
|
||||
[progress removeFromSuperview];
|
||||
|
||||
loadingStatus = DOCUMENT_DONE_STRING;
|
||||
if (defaultStatus) {
|
||||
[status setStringValue:defaultStatus];
|
||||
}
|
||||
else {
|
||||
[status setStringValue:loadingStatus];
|
||||
}
|
||||
|
||||
[browserView setActive:YES];
|
||||
#ifdef DEBUG_vidur
|
||||
printf("Loading completed\n");
|
||||
#endif
|
||||
}
|
||||
|
||||
- (void)onProgressChange:(int)currentBytes outOf:(int)maxBytes
|
||||
{
|
||||
if (maxBytes > 0) {
|
||||
BOOL isIndeterminate = [progress isIndeterminate];
|
||||
if (isIndeterminate) {
|
||||
[progress setIndeterminate:NO];
|
||||
}
|
||||
double val = ((double)currentBytes / (double)maxBytes) * 100.0;
|
||||
[progress setDoubleValue:val];
|
||||
#ifdef DEBUG_vidur
|
||||
printf("Progress notification: %f%%\n", val);
|
||||
#endif
|
||||
}
|
||||
}
|
||||
|
||||
- (void)onLocationChange:(NSString*)url
|
||||
{
|
||||
[urlbar setStringValue:url];
|
||||
|
||||
#ifdef DEBUG_vidur
|
||||
const char* str = [spec cString];
|
||||
printf("Location changed to: %s\n", str);
|
||||
#endif
|
||||
}
|
||||
|
||||
- (void)setStatus:(NSString *)statusString ofType:(NSStatusType)type
|
||||
{
|
||||
if (type == NSStatusTypeScriptDefault) {
|
||||
if (defaultStatus) {
|
||||
[defaultStatus release];
|
||||
}
|
||||
defaultStatus = statusString;
|
||||
if (defaultStatus) {
|
||||
[defaultStatus retain];
|
||||
}
|
||||
}
|
||||
else if (!statusString) {
|
||||
if (defaultStatus) {
|
||||
[status setStringValue:defaultStatus];
|
||||
}
|
||||
else {
|
||||
[status setStringValue:loadingStatus];
|
||||
}
|
||||
}
|
||||
else {
|
||||
[status setStringValue:statusString];
|
||||
}
|
||||
}
|
||||
|
||||
- (void)onStatusChange:(NSString*)aMessage
|
||||
{
|
||||
NSLog(@"Status is %@", aMessage);
|
||||
}
|
||||
|
||||
- (void)onSecurityStateChange:(unsigned long)newState
|
||||
{
|
||||
}
|
||||
|
||||
- (void)onShowContextMenu:(int)flags domEvent:(nsIDOMEvent*)aEvent domNode:(nsIDOMNode*)aNode
|
||||
{
|
||||
NSLog(@"Showing context menu");
|
||||
}
|
||||
|
||||
- (void)onShowTooltip:(NSPoint)where withText:(NSString*)text
|
||||
{
|
||||
NSLog(@"Showing tooltip %@", text);
|
||||
}
|
||||
|
||||
- (void)onHideTooltip
|
||||
{
|
||||
}
|
||||
|
||||
- (NSString *)title
|
||||
{
|
||||
NSWindow* window = [self window];
|
||||
NSString* str = [window title];
|
||||
return str;
|
||||
}
|
||||
|
||||
- (void)setTitle:(NSString *)title
|
||||
{
|
||||
NSWindow* window = [self window];
|
||||
[window setTitle:title];
|
||||
}
|
||||
|
||||
- (void)sizeBrowserTo:(NSSize)dimensions
|
||||
{
|
||||
NSRect bounds = [self bounds];
|
||||
float dx = dimensions.width - bounds.size.width;
|
||||
float dy = dimensions.height - bounds.size.height;
|
||||
|
||||
NSWindow* window = [self window];
|
||||
NSRect frame = [window frame];
|
||||
frame.size.width += dx;
|
||||
frame.size.height += dy;
|
||||
|
||||
[window setFrame:frame display:YES];
|
||||
}
|
||||
|
||||
- (CHBrowserView*)createBrowserWindow:(unsigned int)mask
|
||||
{
|
||||
// XXX not implemented
|
||||
return NULL;
|
||||
}
|
||||
|
||||
- (NSMenu*)contextMenu
|
||||
{
|
||||
return nil;
|
||||
}
|
||||
|
||||
- (NSWindow*)nativeWindow
|
||||
{
|
||||
return [self window];
|
||||
}
|
||||
|
||||
- (BOOL)shouldAcceptDragFromSource:(id)dragSource
|
||||
{
|
||||
return NO;
|
||||
}
|
||||
|
||||
@end
|
|
@ -1,6 +0,0 @@
|
|||
#import <Cocoa/Cocoa.h>
|
||||
|
||||
int main(int argc, const char *argv[])
|
||||
{
|
||||
return NSApplicationMain(argc, argv);
|
||||
}
|
Загрузка…
Ссылка в новой задаче