Rename CHExtendedTabView to BrowserTabView (because that's what it is), and add a new subclass of CHIconTabViewItem, BrowserTabViewItem, for browser tabs.

This commit is contained in:
sfraser%netscape.com 2002-08-16 00:58:10 +00:00
parent 69df8c30eb
commit fc61097449
50 changed files with 1472 additions and 106 deletions

View File

@ -19,7 +19,7 @@
#import <Cocoa/Cocoa.h>
@interface CHExtendedTabView : NSTabView
@interface BrowserTabView : NSTabView
{
BOOL autoHides;
int maxNumberOfTabs; // 0 means 'no max'

View File

@ -39,7 +39,7 @@
#import "NSString+Utils.h"
#import "CHExtendedTabView.h"
#import "BrowserTabView.h"
#import "CHIconTabViewItem.h"
#import "BookmarksService.h"
#import "BookmarksDataSource.h"
@ -58,14 +58,14 @@
// : Move tab titles around when dragging.
//////////////////////////
@interface CHExtendedTabView (Private)
@interface BrowserTabView (Private)
- (void)showOrHideTabsAsAppropriate;
- (void)handleDropOnTab:(NSTabViewItem*)overTabViewItem overContent:(BOOL)overContentArea withURL:(NSString*)url;
@end
@implementation CHExtendedTabView
@implementation BrowserTabView
/******************************************/
/*** Initialization ***/

View File

@ -0,0 +1,50 @@
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* ***** BEGIN LICENSE BLOCK *****
* Version: NPL 1.1/GPL 2.0/LGPL 2.1
*
* The contents of this file are subject to the Netscape Public License
* Version 1.1 (the "License"); you may not use this file except in
* compliance with the License. You may obtain a copy of the License at
* http://www.mozilla.org/NPL/
*
* Software distributed under the License is distributed on an "AS IS" basis,
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
* for the specific language governing rights and limitations under the
* License.
*
* The Original Code is mozilla.org code.
*
* The Initial Developer of the Original Code is
* Netscape Communications Corporation.
* Portions created by the Initial Developer are Copyright (C) 2002
* the Initial Developer. All Rights Reserved.
*
* Contributor(s):
* Simon Fraser <sfraser@netscape.com>
*
* Alternatively, the contents of this file may be used under the terms of
* either the GNU General Public License Version 2 or later (the "GPL"), or
* the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
* in which case the provisions of the GPL or the LGPL are applicable instead
* of those above. If you wish to allow use of your version of this file only
* under the terms of either the GPL or the LGPL, and not to allow others to
* use your version of this file under the terms of the NPL, indicate your
* decision by deleting the provisions above and replace them with the notice
* and other provisions required by the GPL or the LGPL. If you do not delete
* the provisions above, a recipient may use your version of this file under
* the terms of any one of the NPL, the GPL or the LGPL.
*
* ***** END LICENSE BLOCK ***** */
#import <Cocoa/Cocoa.h>
#import "CHIconTabViewItem.h"
// a subclass of CHIconTabViewItem that handles dragging of site icons
@interface BrowserTabViewItem : CHIconTabViewItem
{
}
@end

View File

@ -0,0 +1,66 @@
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* ***** BEGIN LICENSE BLOCK *****
* Version: NPL 1.1/GPL 2.0/LGPL 2.1
*
* The contents of this file are subject to the Netscape Public License
* Version 1.1 (the "License"); you may not use this file except in
* compliance with the License. You may obtain a copy of the License at
* http://www.mozilla.org/NPL/
*
* Software distributed under the License is distributed on an "AS IS" basis,
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
* for the specific language governing rights and limitations under the
* License.
*
* The Original Code is mozilla.org code.
*
* The Initial Developer of the Original Code is
* Netscape Communications Corporation.
* Portions created by the Initial Developer are Copyright (C) 2002
* the Initial Developer. All Rights Reserved.
*
* Contributor(s):
* Simon Fraser <sfraser@netscape.com>
*
* Alternatively, the contents of this file may be used under the terms of
* either the GNU General Public License Version 2 or later (the "GPL"), or
* the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
* in which case the provisions of the GPL or the LGPL are applicable instead
* of those above. If you wish to allow use of your version of this file only
* under the terms of either the GPL or the LGPL, and not to allow others to
* use your version of this file under the terms of the NPL, indicate your
* decision by deleting the provisions above and replace them with the notice
* and other provisions required by the GPL or the LGPL. If you do not delete
* the provisions above, a recipient may use your version of this file under
* the terms of any one of the NPL, the GPL or the LGPL.
*
* ***** END LICENSE BLOCK ***** */
#import "BrowserTabViewItem.h"
@implementation BrowserTabViewItem
-(id)initWithIdentifier:(id)identifier withTabIcon:(NSImage *)tabIcon
{
if ( (self = [super initWithIdentifier:identifier withTabIcon:tabIcon]) )
{
}
return self;
}
-(id)initWithIdentifier:(id)identifier
{
return [self initWithIdentifier:identifier withTabIcon:nil];
}
-(void)dealloc
{
[super dealloc];
}
@end

View File

@ -21,6 +21,7 @@
SUPERCLASS = NSObject;
},
{CLASS = BookmarksToolbar; LANGUAGE = ObjC; SUPERCLASS = NSView; },
{CLASS = BrowserTabView; LANGUAGE = ObjC; SUPERCLASS = NSTabView; },
{
CLASS = BrowserWindow;
LANGUAGE = ObjC;
@ -118,7 +119,6 @@
SUPERCLASS = NSView;
},
{CLASS = CHExtendedOutlineView; LANGUAGE = ObjC; SUPERCLASS = NSOutlineView; },
{CLASS = CHExtendedTabView; LANGUAGE = ObjC; SUPERCLASS = NSTabView; },
{
CLASS = CHHistoryDataSource;
LANGUAGE = ObjC;
@ -136,7 +136,6 @@
{CLASS = ExtendedOutlineView; LANGUAGE = ObjC; SUPERCLASS = NSOutlineView; },
{CLASS = FirstResponder; LANGUAGE = ObjC; SUPERCLASS = NSObject; },
{CLASS = LocationBar; LANGUAGE = ObjC; SUPERCLASS = NSView; },
{CLASS = MJExtendedTabView; LANGUAGE = ObjC; SUPERCLASS = NSTabView; },
{CLASS = MainController; LANGUAGE = ObjC; SUPERCLASS = NSObject; },
{
ACTIONS = {load = id; };

View File

@ -3,7 +3,7 @@
<plist version="0.9">
<dict>
<key>IBDocumentLocation</key>
<string>112 15 632 495 0 0 1280 1002 </string>
<string>176 79 632 495 0 0 1280 1002 </string>
<key>IBEditorPositions</key>
<dict>
<key>124</key>

Binary file not shown.

View File

@ -77,12 +77,12 @@ class nsIDOMNode;
@class BookmarksDataSource;
@class CHHistoryDataSource;
@class CHExtendedTabView;
@class BrowserTabView;
@class CHPageProxyIcon;
@interface BrowserWindowController : NSWindowController<CHFind>
{
IBOutlet CHExtendedTabView* mTabBrowser;
IBOutlet BrowserTabView* mTabBrowser;
IBOutlet NSDrawer* mSidebarDrawer;
IBOutlet NSTabView* mSidebarTabView;
IBOutlet NSTabView* mSidebarSourceTabView;

View File

@ -44,7 +44,7 @@
#import "CHPreferenceManager.h"
#import "BookmarksDataSource.h"
#import "CHHistoryDataSource.h"
#import "CHExtendedTabView.h"
#import "BrowserTabView.h"
#import "CHUserDefaults.h"
#import "CHPageProxyIcon.h"

View File

@ -484,6 +484,7 @@
F549ACE80302DEF001026D5D,
F558137E030AEF9C0176F207,
F558137F030AEF9C0176F207,
F5B950BE030C83B601A96654,
);
isa = PBXHeadersBuildPhase;
name = Headers;
@ -610,6 +611,7 @@
F549ACE10302DE6101026D5D,
F5581380030AEF9C0176F207,
F5581381030AEF9C0176F207,
F5B950BF030C83B601A96654,
);
isa = PBXSourcesBuildPhase;
name = Sources;
@ -1341,6 +1343,8 @@
2E2939FF027F33604B000102,
2E748B73029A448D4B000102,
F549ACDE0302DE6001026D5D,
F5B950BD030C83B601A96654,
F5BF71460231B8BC010001CA,
);
isa = PBXGroup;
name = "UI elements";
@ -1538,6 +1542,8 @@
F549ACE70302DEF001026D5D,
F5581379030AEF9B0176F207,
F558137A030AEF9B0176F207,
F5B950BC030C83B601A96654,
F5BF71450231B8BC010001CA,
);
isa = PBXGroup;
name = Headers;
@ -3069,20 +3075,8 @@
};
F5571935022B401B010001CA = {
children = (
F558099D02F22168015DF512,
F558099E02F22168015DF512,
F549ACE40302DEBB01026D5D,
F549ACDF0302DE6001026D5D,
F5BF71450231B8BC010001CA,
F5BF71460231B8BC010001CA,
F5648739023C3857010001CA,
F564873A023C3857010001CA,
F5C3AB810270072A01A80166,
F5C3AB820270072A01A80166,
F541495A02711A8301A80166,
F541495B02711A8301A80166,
F541495E02711B0001A80166,
F541495F02711B0001A80166,
F5B950BA030C833301A96654,
F5B950BB030C833301A96654,
);
isa = PBXGroup;
name = "Categories and Extensions";
@ -5202,6 +5196,67 @@
path = ../string/obsolete/libstring_obsolete_s.a;
refType = 2;
};
F5B950BA030C833301A96654 = {
children = (
F558099D02F22168015DF512,
F549ACE40302DEBB01026D5D,
F5648739023C3857010001CA,
F5C3AB810270072A01A80166,
F541495A02711A8301A80166,
F541495E02711B0001A80166,
);
isa = PBXGroup;
name = Headers;
refType = 4;
};
F5B950BB030C833301A96654 = {
children = (
F558099E02F22168015DF512,
F549ACDF0302DE6001026D5D,
F564873A023C3857010001CA,
F5C3AB820270072A01A80166,
F541495B02711A8301A80166,
F541495F02711B0001A80166,
);
isa = PBXGroup;
name = Source;
path = "";
refType = 4;
};
F5B950BC030C83B601A96654 = {
isa = PBXFileReference;
path = BrowserTabViewItem.h;
refType = 4;
};
F5B950BD030C83B601A96654 = {
isa = PBXFileReference;
path = BrowserTabViewItem.mm;
refType = 4;
};
F5B950BE030C83B601A96654 = {
fileRef = F5B950BC030C83B601A96654;
isa = PBXBuildFile;
settings = {
};
};
F5B950BF030C83B601A96654 = {
fileRef = F5B950BD030C83B601A96654;
isa = PBXBuildFile;
settings = {
};
};
F5B950C0030C83B601A96654 = {
fileRef = F5B950BC030C83B601A96654;
isa = PBXBuildFile;
settings = {
};
};
F5B950C1030C83B601A96654 = {
fileRef = F5B950BD030C83B601A96654;
isa = PBXBuildFile;
settings = {
};
};
F5BAAB1802AC45D301A967F3 = {
isa = PBXApplicationReference;
path = Navigator.app;
@ -5444,6 +5499,7 @@
F549ACE90302DEF001026D5D,
F5581382030AEF9C0176F207,
F5581383030AEF9C0176F207,
F5B950C0030C83B601A96654,
);
isa = PBXHeadersBuildPhase;
name = Headers;
@ -5571,6 +5627,7 @@
F549ACE30302DE6101026D5D,
F5581384030AEF9C0176F207,
F5581385030AEF9C0176F207,
F5B950C1030C83B601A96654,
);
isa = PBXSourcesBuildPhase;
name = Sources;
@ -7212,12 +7269,12 @@
};
F5BF71450231B8BC010001CA = {
isa = PBXFileReference;
path = CHExtendedTabView.h;
path = BrowserTabView.h;
refType = 4;
};
F5BF71460231B8BC010001CA = {
isa = PBXFileReference;
path = CHExtendedTabView.mm;
path = BrowserTabView.mm;
refType = 4;
};
F5BF71510231DC5D010001CA = {

View File

@ -21,6 +21,7 @@
SUPERCLASS = NSObject;
},
{CLASS = BookmarksToolbar; LANGUAGE = ObjC; SUPERCLASS = NSView; },
{CLASS = BrowserTabView; LANGUAGE = ObjC; SUPERCLASS = NSTabView; },
{
CLASS = BrowserWindow;
LANGUAGE = ObjC;
@ -118,7 +119,6 @@
SUPERCLASS = NSView;
},
{CLASS = CHExtendedOutlineView; LANGUAGE = ObjC; SUPERCLASS = NSOutlineView; },
{CLASS = CHExtendedTabView; LANGUAGE = ObjC; SUPERCLASS = NSTabView; },
{
CLASS = CHHistoryDataSource;
LANGUAGE = ObjC;
@ -136,7 +136,6 @@
{CLASS = ExtendedOutlineView; LANGUAGE = ObjC; SUPERCLASS = NSOutlineView; },
{CLASS = FirstResponder; LANGUAGE = ObjC; SUPERCLASS = NSObject; },
{CLASS = LocationBar; LANGUAGE = ObjC; SUPERCLASS = NSView; },
{CLASS = MJExtendedTabView; LANGUAGE = ObjC; SUPERCLASS = NSTabView; },
{CLASS = MainController; LANGUAGE = ObjC; SUPERCLASS = NSObject; },
{
ACTIONS = {load = id; };

View File

@ -3,7 +3,7 @@
<plist version="0.9">
<dict>
<key>IBDocumentLocation</key>
<string>112 15 632 495 0 0 1280 1002 </string>
<string>176 79 632 495 0 0 1280 1002 </string>
<key>IBEditorPositions</key>
<dict>
<key>124</key>

Binary file not shown.

View File

@ -41,7 +41,8 @@
@implementation NSScreen (CHScreenAdditions)
+ (NSScreen*)screenForPoint:(NSPoint)point {
+ (NSScreen*)screenForPoint:(NSPoint)point
{
NSArray* screens = [NSScreen screens];
NSEnumerator* screenEnum = [screens objectEnumerator];
NSScreen* screen;

View File

@ -484,6 +484,7 @@
F549ACE80302DEF001026D5D,
F558137E030AEF9C0176F207,
F558137F030AEF9C0176F207,
F5B950BE030C83B601A96654,
);
isa = PBXHeadersBuildPhase;
name = Headers;
@ -610,6 +611,7 @@
F549ACE10302DE6101026D5D,
F5581380030AEF9C0176F207,
F5581381030AEF9C0176F207,
F5B950BF030C83B601A96654,
);
isa = PBXSourcesBuildPhase;
name = Sources;
@ -1341,6 +1343,8 @@
2E2939FF027F33604B000102,
2E748B73029A448D4B000102,
F549ACDE0302DE6001026D5D,
F5B950BD030C83B601A96654,
F5BF71460231B8BC010001CA,
);
isa = PBXGroup;
name = "UI elements";
@ -1538,6 +1542,8 @@
F549ACE70302DEF001026D5D,
F5581379030AEF9B0176F207,
F558137A030AEF9B0176F207,
F5B950BC030C83B601A96654,
F5BF71450231B8BC010001CA,
);
isa = PBXGroup;
name = Headers;
@ -3069,20 +3075,8 @@
};
F5571935022B401B010001CA = {
children = (
F558099D02F22168015DF512,
F558099E02F22168015DF512,
F549ACE40302DEBB01026D5D,
F549ACDF0302DE6001026D5D,
F5BF71450231B8BC010001CA,
F5BF71460231B8BC010001CA,
F5648739023C3857010001CA,
F564873A023C3857010001CA,
F5C3AB810270072A01A80166,
F5C3AB820270072A01A80166,
F541495A02711A8301A80166,
F541495B02711A8301A80166,
F541495E02711B0001A80166,
F541495F02711B0001A80166,
F5B950BA030C833301A96654,
F5B950BB030C833301A96654,
);
isa = PBXGroup;
name = "Categories and Extensions";
@ -5202,6 +5196,67 @@
path = ../string/obsolete/libstring_obsolete_s.a;
refType = 2;
};
F5B950BA030C833301A96654 = {
children = (
F558099D02F22168015DF512,
F549ACE40302DEBB01026D5D,
F5648739023C3857010001CA,
F5C3AB810270072A01A80166,
F541495A02711A8301A80166,
F541495E02711B0001A80166,
);
isa = PBXGroup;
name = Headers;
refType = 4;
};
F5B950BB030C833301A96654 = {
children = (
F558099E02F22168015DF512,
F549ACDF0302DE6001026D5D,
F564873A023C3857010001CA,
F5C3AB820270072A01A80166,
F541495B02711A8301A80166,
F541495F02711B0001A80166,
);
isa = PBXGroup;
name = Source;
path = "";
refType = 4;
};
F5B950BC030C83B601A96654 = {
isa = PBXFileReference;
path = BrowserTabViewItem.h;
refType = 4;
};
F5B950BD030C83B601A96654 = {
isa = PBXFileReference;
path = BrowserTabViewItem.mm;
refType = 4;
};
F5B950BE030C83B601A96654 = {
fileRef = F5B950BC030C83B601A96654;
isa = PBXBuildFile;
settings = {
};
};
F5B950BF030C83B601A96654 = {
fileRef = F5B950BD030C83B601A96654;
isa = PBXBuildFile;
settings = {
};
};
F5B950C0030C83B601A96654 = {
fileRef = F5B950BC030C83B601A96654;
isa = PBXBuildFile;
settings = {
};
};
F5B950C1030C83B601A96654 = {
fileRef = F5B950BD030C83B601A96654;
isa = PBXBuildFile;
settings = {
};
};
F5BAAB1802AC45D301A967F3 = {
isa = PBXApplicationReference;
path = Navigator.app;
@ -5444,6 +5499,7 @@
F549ACE90302DEF001026D5D,
F5581382030AEF9C0176F207,
F5581383030AEF9C0176F207,
F5B950C0030C83B601A96654,
);
isa = PBXHeadersBuildPhase;
name = Headers;
@ -5571,6 +5627,7 @@
F549ACE30302DE6101026D5D,
F5581384030AEF9C0176F207,
F5581385030AEF9C0176F207,
F5B950C1030C83B601A96654,
);
isa = PBXSourcesBuildPhase;
name = Sources;
@ -7212,12 +7269,12 @@
};
F5BF71450231B8BC010001CA = {
isa = PBXFileReference;
path = CHExtendedTabView.h;
path = BrowserTabView.h;
refType = 4;
};
F5BF71460231B8BC010001CA = {
isa = PBXFileReference;
path = CHExtendedTabView.mm;
path = BrowserTabView.mm;
refType = 4;
};
F5BF71510231DC5D010001CA = {

View File

@ -21,6 +21,7 @@
SUPERCLASS = NSObject;
},
{CLASS = BookmarksToolbar; LANGUAGE = ObjC; SUPERCLASS = NSView; },
{CLASS = BrowserTabView; LANGUAGE = ObjC; SUPERCLASS = NSTabView; },
{
CLASS = BrowserWindow;
LANGUAGE = ObjC;
@ -118,7 +119,6 @@
SUPERCLASS = NSView;
},
{CLASS = CHExtendedOutlineView; LANGUAGE = ObjC; SUPERCLASS = NSOutlineView; },
{CLASS = CHExtendedTabView; LANGUAGE = ObjC; SUPERCLASS = NSTabView; },
{
CLASS = CHHistoryDataSource;
LANGUAGE = ObjC;
@ -136,7 +136,6 @@
{CLASS = ExtendedOutlineView; LANGUAGE = ObjC; SUPERCLASS = NSOutlineView; },
{CLASS = FirstResponder; LANGUAGE = ObjC; SUPERCLASS = NSObject; },
{CLASS = LocationBar; LANGUAGE = ObjC; SUPERCLASS = NSView; },
{CLASS = MJExtendedTabView; LANGUAGE = ObjC; SUPERCLASS = NSTabView; },
{CLASS = MainController; LANGUAGE = ObjC; SUPERCLASS = NSObject; },
{
ACTIONS = {load = id; };

View File

@ -3,7 +3,7 @@
<plist version="0.9">
<dict>
<key>IBDocumentLocation</key>
<string>112 15 632 495 0 0 1280 1002 </string>
<string>176 79 632 495 0 0 1280 1002 </string>
<key>IBEditorPositions</key>
<dict>
<key>124</key>

View File

@ -19,7 +19,7 @@
#import <Cocoa/Cocoa.h>
@interface CHExtendedTabView : NSTabView
@interface BrowserTabView : NSTabView
{
BOOL autoHides;
int maxNumberOfTabs; // 0 means 'no max'

View File

@ -39,7 +39,7 @@
#import "NSString+Utils.h"
#import "CHExtendedTabView.h"
#import "BrowserTabView.h"
#import "CHIconTabViewItem.h"
#import "BookmarksService.h"
#import "BookmarksDataSource.h"
@ -58,14 +58,14 @@
// : Move tab titles around when dragging.
//////////////////////////
@interface CHExtendedTabView (Private)
@interface BrowserTabView (Private)
- (void)showOrHideTabsAsAppropriate;
- (void)handleDropOnTab:(NSTabViewItem*)overTabViewItem overContent:(BOOL)overContentArea withURL:(NSString*)url;
@end
@implementation CHExtendedTabView
@implementation BrowserTabView
/******************************************/
/*** Initialization ***/

View File

@ -0,0 +1,50 @@
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* ***** BEGIN LICENSE BLOCK *****
* Version: NPL 1.1/GPL 2.0/LGPL 2.1
*
* The contents of this file are subject to the Netscape Public License
* Version 1.1 (the "License"); you may not use this file except in
* compliance with the License. You may obtain a copy of the License at
* http://www.mozilla.org/NPL/
*
* Software distributed under the License is distributed on an "AS IS" basis,
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
* for the specific language governing rights and limitations under the
* License.
*
* The Original Code is mozilla.org code.
*
* The Initial Developer of the Original Code is
* Netscape Communications Corporation.
* Portions created by the Initial Developer are Copyright (C) 2002
* the Initial Developer. All Rights Reserved.
*
* Contributor(s):
* Simon Fraser <sfraser@netscape.com>
*
* Alternatively, the contents of this file may be used under the terms of
* either the GNU General Public License Version 2 or later (the "GPL"), or
* the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
* in which case the provisions of the GPL or the LGPL are applicable instead
* of those above. If you wish to allow use of your version of this file only
* under the terms of either the GPL or the LGPL, and not to allow others to
* use your version of this file under the terms of the NPL, indicate your
* decision by deleting the provisions above and replace them with the notice
* and other provisions required by the GPL or the LGPL. If you do not delete
* the provisions above, a recipient may use your version of this file under
* the terms of any one of the NPL, the GPL or the LGPL.
*
* ***** END LICENSE BLOCK ***** */
#import <Cocoa/Cocoa.h>
#import "CHIconTabViewItem.h"
// a subclass of CHIconTabViewItem that handles dragging of site icons
@interface BrowserTabViewItem : CHIconTabViewItem
{
}
@end

View File

@ -0,0 +1,66 @@
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* ***** BEGIN LICENSE BLOCK *****
* Version: NPL 1.1/GPL 2.0/LGPL 2.1
*
* The contents of this file are subject to the Netscape Public License
* Version 1.1 (the "License"); you may not use this file except in
* compliance with the License. You may obtain a copy of the License at
* http://www.mozilla.org/NPL/
*
* Software distributed under the License is distributed on an "AS IS" basis,
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
* for the specific language governing rights and limitations under the
* License.
*
* The Original Code is mozilla.org code.
*
* The Initial Developer of the Original Code is
* Netscape Communications Corporation.
* Portions created by the Initial Developer are Copyright (C) 2002
* the Initial Developer. All Rights Reserved.
*
* Contributor(s):
* Simon Fraser <sfraser@netscape.com>
*
* Alternatively, the contents of this file may be used under the terms of
* either the GNU General Public License Version 2 or later (the "GPL"), or
* the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
* in which case the provisions of the GPL or the LGPL are applicable instead
* of those above. If you wish to allow use of your version of this file only
* under the terms of either the GPL or the LGPL, and not to allow others to
* use your version of this file under the terms of the NPL, indicate your
* decision by deleting the provisions above and replace them with the notice
* and other provisions required by the GPL or the LGPL. If you do not delete
* the provisions above, a recipient may use your version of this file under
* the terms of any one of the NPL, the GPL or the LGPL.
*
* ***** END LICENSE BLOCK ***** */
#import "BrowserTabViewItem.h"
@implementation BrowserTabViewItem
-(id)initWithIdentifier:(id)identifier withTabIcon:(NSImage *)tabIcon
{
if ( (self = [super initWithIdentifier:identifier withTabIcon:tabIcon]) )
{
}
return self;
}
-(id)initWithIdentifier:(id)identifier
{
return [self initWithIdentifier:identifier withTabIcon:nil];
}
-(void)dealloc
{
[super dealloc];
}
@end

View File

@ -77,12 +77,12 @@ class nsIDOMNode;
@class BookmarksDataSource;
@class CHHistoryDataSource;
@class CHExtendedTabView;
@class BrowserTabView;
@class CHPageProxyIcon;
@interface BrowserWindowController : NSWindowController<CHFind>
{
IBOutlet CHExtendedTabView* mTabBrowser;
IBOutlet BrowserTabView* mTabBrowser;
IBOutlet NSDrawer* mSidebarDrawer;
IBOutlet NSTabView* mSidebarTabView;
IBOutlet NSTabView* mSidebarSourceTabView;

View File

@ -44,7 +44,7 @@
#import "CHPreferenceManager.h"
#import "BookmarksDataSource.h"
#import "CHHistoryDataSource.h"
#import "CHExtendedTabView.h"
#import "BrowserTabView.h"
#import "CHUserDefaults.h"
#import "CHPageProxyIcon.h"

View File

@ -41,7 +41,8 @@
@implementation NSScreen (CHScreenAdditions)
+ (NSScreen*)screenForPoint:(NSPoint)point {
+ (NSScreen*)screenForPoint:(NSPoint)point
{
NSArray* screens = [NSScreen screens];
NSEnumerator* screenEnum = [screens objectEnumerator];
NSScreen* screen;

40
chimera/BrowserTabView.h Normal file
View File

@ -0,0 +1,40 @@
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*-
*
* The contents of this file are subject to the Mozilla Public
* License Version 1.1 (the "License"); you may not use this file
* except in compliance with the License. You may obtain a copy of
* the License at http://www.mozilla.org/MPL/
*
* Software distributed under the License is distributed on an "AS
* IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
* implied. See the License for the specific language governing
* rights and limitations under the License.
*
* The Original Code is the Mozilla browser.
*
* The Initial Developer of the Original Code is Matt Judy. Portions
* of code @2002 nibfile.com.
*/
#import <Cocoa/Cocoa.h>
@interface BrowserTabView : NSTabView
{
BOOL autoHides;
int maxNumberOfTabs; // 0 means 'no max'
}
// Behavior: Autohiding overrides the default tab visibility state.
// To switch back to usual tabView behavior, setAutoHides:NO.
// Initial value is read from defaults.
- (BOOL)autoHides;
- (void)setAutoHides:(BOOL)newSetting;
- (int)maxNumberOfTabs;
- (void)setMaxNumberOfTabs:(int)maxTabs;
- (BOOL)canMakeNewTabs;
- (void)addTabForURL:(NSString*)aURL referrer:(NSString*)aReferrer;
@end

298
chimera/BrowserTabView.mm Normal file
View File

@ -0,0 +1,298 @@
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* ***** BEGIN LICENSE BLOCK *****
* Version: NPL 1.1/GPL 2.0/LGPL 2.1
*
* The contents of this file are subject to the Netscape Public License
* Version 1.1 (the "License"); you may not use this file except in
* compliance with the License. You may obtain a copy of the License at
* http://www.mozilla.org/NPL/
*
* Software distributed under the License is distributed on an "AS IS" basis,
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
* for the specific language governing rights and limitations under the
* License.
*
* The Original Code is mozilla.org code.
*
* The Initial Developer of the Original Code is
* Netscape Communications Corporation.
* Portions created by the Initial Developer are Copyright (C) 2002
* the Initial Developer. All Rights Reserved.
*
* Contributor(s):
* Matt Judy <matt@nibfile.com> (Original Author)
* David Haas <haasd@cae.wisc.edu>
*
* Alternatively, the contents of this file may be used under the terms of
* either the GNU General Public License Version 2 or later (the "GPL"), or
* the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
* in which case the provisions of the GPL or the LGPL are applicable instead
* of those above. If you wish to allow use of your version of this file only
* under the terms of either the GPL or the LGPL, and not to allow others to
* use your version of this file under the terms of the NPL, indicate your
* decision by deleting the provisions above and replace them with the notice
* and other provisions required by the GPL or the LGPL. If you do not delete
* the provisions above, a recipient may use your version of this file under
* the terms of any one of the NPL, the GPL or the LGPL.
*
* ***** END LICENSE BLOCK ***** */
#import "NSString+Utils.h"
#import "BrowserTabView.h"
#import "CHIconTabViewItem.h"
#import "BookmarksService.h"
#import "BookmarksDataSource.h"
#include "nsCOMPtr.h"
#include "nsIDOMElement.h"
#include "nsIContent.h"
#include "nsIAtom.h"
#include "nsString.h"
#include "nsCRT.h"
//////////////////////////
// NEEDS IMPLEMENTED : Implement drag tracking for moving tabs around.
// Implementation hints : Track drags ;)
// : Change tab controlTint to indicate drag location?
// : Move tab titles around when dragging.
//////////////////////////
@interface BrowserTabView (Private)
- (void)showOrHideTabsAsAppropriate;
- (void)handleDropOnTab:(NSTabViewItem*)overTabViewItem overContent:(BOOL)overContentArea withURL:(NSString*)url;
@end
@implementation BrowserTabView
/******************************************/
/*** Initialization ***/
/******************************************/
- (id)initWithFrame:(NSRect)frameRect
{
if ( (self = [super initWithFrame:frameRect]) ) {
autoHides = YES;
maxNumberOfTabs = 0; // no max
}
return self;
}
- (void)awakeFromNib
{
[self showOrHideTabsAsAppropriate];
[self registerForDraggedTypes:[NSArray arrayWithObjects:
@"MozURLType", @"MozBookmarkType", NSStringPboardType, NSFilenamesPboardType, nil]];
}
/******************************************/
/*** Overridden Methods ***/
/******************************************/
- (BOOL)isOpaque
{
if ( ([self tabViewType] == NSNoTabsBezelBorder) && (NSAppKitVersionNumber < 633) ) {
return NO;
} else {
return [super isOpaque];
}
}
- (void)addTabViewItem:(NSTabViewItem *)tabViewItem
{
[super addTabViewItem:tabViewItem];
[self showOrHideTabsAsAppropriate];
}
- (void)removeTabViewItem:(NSTabViewItem *)tabViewItem
{
[super removeTabViewItem:tabViewItem];
[self showOrHideTabsAsAppropriate];
}
- (void)insertTabViewItem:(NSTabViewItem *)tabViewItem atIndex:(int)index
{
[super insertTabViewItem:tabViewItem atIndex:index];
[self showOrHideTabsAsAppropriate];
}
/******************************************/
/*** Accessor Methods ***/
/******************************************/
- (BOOL)autoHides
{
return autoHides;
}
- (void)setAutoHides:(BOOL)newSetting
{
autoHides = newSetting;
}
- (int)maxNumberOfTabs
{
return maxNumberOfTabs;
}
- (void)setMaxNumberOfTabs:(int)maxTabs
{
maxNumberOfTabs = maxTabs;
}
- (BOOL)canMakeNewTabs
{
return maxNumberOfTabs == 0 || [self numberOfTabViewItems] < maxNumberOfTabs;
}
/******************************************/
/*** Instance Methods ***/
/******************************************/
// 03-03-2002 mlj: Modifies tab view size and type appropriately... Fragile.
// Only to be used with the 2 types of tab view which we use in Chimera.
- (void)showOrHideTabsAsAppropriate
{
// if ( autoHides == YES ) {
if ( [[self tabViewItems] count] < 2) {
if ( [self tabViewType] != NSNoTabsBezelBorder ) {
[self setFrameSize:NSMakeSize( NSWidth([self frame]), NSHeight([self frame]) + 10 )];
}
[self setTabViewType:NSNoTabsBezelBorder];
} else {
if ( [self tabViewType] != NSTopTabsBezelBorder ) {
[self setFrameSize:NSMakeSize( NSWidth([self frame]), NSHeight([self frame]) - 10 )];
}
[self setTabViewType:NSTopTabsBezelBorder];
}
[self display];
// }
}
- (void)handleDropOnTab:(NSTabViewItem*)overTabViewItem overContent:(BOOL)overContentArea withURL:(NSString*)url
{
if (overTabViewItem) {
[[overTabViewItem view] loadURI: url referrer:nil flags: NSLoadFlagsNone activate:NO];
} else if (overContentArea) {
[[[self selectedTabViewItem] view] loadURI: url referrer:nil flags: NSLoadFlagsNone activate:NO];
} else if ([self canMakeNewTabs]) {
[self addTabForURL:url referrer:nil];
} else {
NSLog(@"Can't make new tab for drop");
}
}
// NSDraggingDestination ///////////
- (unsigned int)draggingEntered:(id <NSDraggingInfo>)sender
{
NSPoint localPoint = [self convertPoint: [sender draggingLocation] fromView: nil];
NSTabViewItem* overTabViewItem = [self tabViewItemAtPoint: localPoint];
BOOL overContentArea = NSPointInRect(localPoint, [self contentRect]);
if (!overTabViewItem && !overContentArea && ![self canMakeNewTabs])
return NSDragOperationNone;
return NSDragOperationGeneric;
}
- (unsigned int)draggingUpdated:(id <NSDraggingInfo>)sender
{
NSPoint localPoint = [self convertPoint: [sender draggingLocation] fromView: nil];
NSTabViewItem* overTabViewItem = [self tabViewItemAtPoint: localPoint];
BOOL overContentArea = NSPointInRect(localPoint, [self contentRect]);
if (!overTabViewItem && !overContentArea && ![self canMakeNewTabs])
return NSDragOperationNone;
return NSDragOperationGeneric;
}
- (BOOL)prepareForDragOperation:(id <NSDraggingInfo>)sender
{
return YES;
}
- (BOOL)performDragOperation:(id <NSDraggingInfo>)sender
{
// determine if we are over a tab or the content area
NSPoint localPoint = [self convertPoint: [sender draggingLocation] fromView: nil];
NSTabViewItem* overTabViewItem = [self tabViewItemAtPoint: localPoint];
BOOL overContentArea = NSPointInRect(localPoint, [self contentRect]);
NSArray* pasteBoardTypes = [[sender draggingPasteboard] types];
if ([pasteBoardTypes containsObject: @"MozBookmarkType"])
{
NSArray* contentIds = [[sender draggingPasteboard] propertyListForType: @"MozBookmarkType"];
if (contentIds) {
// drag type is chimera bookmarks
for (unsigned int i = 0; i < [contentIds count]; ++i) {
BookmarkItem* item = [BookmarksService::gDictionary objectForKey: [contentIds objectAtIndex:i]];
nsCOMPtr<nsIDOMElement> bookmarkElt = do_QueryInterface([item contentNode]);
nsCOMPtr<nsIAtom> tagName;
[item contentNode]->GetTag(*getter_AddRefs(tagName));
nsAutoString href;
bookmarkElt->GetAttribute(NS_LITERAL_STRING("href"), href);
NSString* url = [NSString stringWith_nsAString: href];
nsAutoString group;
bookmarkElt->GetAttribute(NS_LITERAL_STRING("group"), group);
if (!group.IsEmpty()) {
BookmarksService::OpenBookmarkGroup(self, bookmarkElt);
} else {
[self handleDropOnTab:overTabViewItem overContent:overContentArea withURL:url];
}
} // for each item
}
}
else if ([pasteBoardTypes containsObject: @"MozURLType"])
{
// drag type is MozURLType
NSDictionary* data = [[sender draggingPasteboard] propertyListForType: @"MozURLType"];
if (data) {
NSString* urlString = [data objectForKey:@"url"];
[self handleDropOnTab:overTabViewItem overContent:overContentArea withURL:urlString];
}
}
else if ([pasteBoardTypes containsObject: NSStringPboardType])
{
NSString* urlString = [[sender draggingPasteboard] stringForType: NSStringPboardType];
[self handleDropOnTab:overTabViewItem overContent:overContentArea withURL:urlString];
}
else if ([pasteBoardTypes containsObject: NSURLPboardType])
{
NSURL* urlData = [NSURL URLFromPasteboard:[sender draggingPasteboard]];
[self handleDropOnTab:overTabViewItem overContent:overContentArea withURL:[urlData absoluteString]];
}
else if ([pasteBoardTypes containsObject: NSFilenamesPboardType])
{
NSString* urlString = [[sender draggingPasteboard] stringForType: NSFilenamesPboardType];
[self handleDropOnTab:overTabViewItem overContent:overContentArea withURL:urlString];
}
return YES;
}
-(void)addTabForURL:(NSString*)aURL referrer:(NSString*)aReferrer
{
// We need to make a new tab.
CHIconTabViewItem *tabViewItem= [[[CHIconTabViewItem alloc] initWithIdentifier: nil] autorelease];
CHBrowserWrapper *newView = [[[CHBrowserWrapper alloc] initWithTab: tabViewItem andWindow: [self window]] autorelease];
[tabViewItem setLabel: NSLocalizedString(@"UntitledPageTitle", @"")];
[tabViewItem setView: newView];
[self addTabViewItem: tabViewItem];
[[tabViewItem view] loadURI: aURL referrer:aReferrer flags: NSLoadFlagsNone activate:NO];
}
@end

View File

@ -0,0 +1,50 @@
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* ***** BEGIN LICENSE BLOCK *****
* Version: NPL 1.1/GPL 2.0/LGPL 2.1
*
* The contents of this file are subject to the Netscape Public License
* Version 1.1 (the "License"); you may not use this file except in
* compliance with the License. You may obtain a copy of the License at
* http://www.mozilla.org/NPL/
*
* Software distributed under the License is distributed on an "AS IS" basis,
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
* for the specific language governing rights and limitations under the
* License.
*
* The Original Code is mozilla.org code.
*
* The Initial Developer of the Original Code is
* Netscape Communications Corporation.
* Portions created by the Initial Developer are Copyright (C) 2002
* the Initial Developer. All Rights Reserved.
*
* Contributor(s):
* Simon Fraser <sfraser@netscape.com>
*
* Alternatively, the contents of this file may be used under the terms of
* either the GNU General Public License Version 2 or later (the "GPL"), or
* the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
* in which case the provisions of the GPL or the LGPL are applicable instead
* of those above. If you wish to allow use of your version of this file only
* under the terms of either the GPL or the LGPL, and not to allow others to
* use your version of this file under the terms of the NPL, indicate your
* decision by deleting the provisions above and replace them with the notice
* and other provisions required by the GPL or the LGPL. If you do not delete
* the provisions above, a recipient may use your version of this file under
* the terms of any one of the NPL, the GPL or the LGPL.
*
* ***** END LICENSE BLOCK ***** */
#import <Cocoa/Cocoa.h>
#import "CHIconTabViewItem.h"
// a subclass of CHIconTabViewItem that handles dragging of site icons
@interface BrowserTabViewItem : CHIconTabViewItem
{
}
@end

View File

@ -0,0 +1,66 @@
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* ***** BEGIN LICENSE BLOCK *****
* Version: NPL 1.1/GPL 2.0/LGPL 2.1
*
* The contents of this file are subject to the Netscape Public License
* Version 1.1 (the "License"); you may not use this file except in
* compliance with the License. You may obtain a copy of the License at
* http://www.mozilla.org/NPL/
*
* Software distributed under the License is distributed on an "AS IS" basis,
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
* for the specific language governing rights and limitations under the
* License.
*
* The Original Code is mozilla.org code.
*
* The Initial Developer of the Original Code is
* Netscape Communications Corporation.
* Portions created by the Initial Developer are Copyright (C) 2002
* the Initial Developer. All Rights Reserved.
*
* Contributor(s):
* Simon Fraser <sfraser@netscape.com>
*
* Alternatively, the contents of this file may be used under the terms of
* either the GNU General Public License Version 2 or later (the "GPL"), or
* the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
* in which case the provisions of the GPL or the LGPL are applicable instead
* of those above. If you wish to allow use of your version of this file only
* under the terms of either the GPL or the LGPL, and not to allow others to
* use your version of this file under the terms of the NPL, indicate your
* decision by deleting the provisions above and replace them with the notice
* and other provisions required by the GPL or the LGPL. If you do not delete
* the provisions above, a recipient may use your version of this file under
* the terms of any one of the NPL, the GPL or the LGPL.
*
* ***** END LICENSE BLOCK ***** */
#import "BrowserTabViewItem.h"
@implementation BrowserTabViewItem
-(id)initWithIdentifier:(id)identifier withTabIcon:(NSImage *)tabIcon
{
if ( (self = [super initWithIdentifier:identifier withTabIcon:tabIcon]) )
{
}
return self;
}
-(id)initWithIdentifier:(id)identifier
{
return [self initWithIdentifier:identifier withTabIcon:nil];
}
-(void)dealloc
{
[super dealloc];
}
@end

View File

@ -21,6 +21,7 @@
SUPERCLASS = NSObject;
},
{CLASS = BookmarksToolbar; LANGUAGE = ObjC; SUPERCLASS = NSView; },
{CLASS = BrowserTabView; LANGUAGE = ObjC; SUPERCLASS = NSTabView; },
{
CLASS = BrowserWindow;
LANGUAGE = ObjC;
@ -118,7 +119,6 @@
SUPERCLASS = NSView;
},
{CLASS = CHExtendedOutlineView; LANGUAGE = ObjC; SUPERCLASS = NSOutlineView; },
{CLASS = CHExtendedTabView; LANGUAGE = ObjC; SUPERCLASS = NSTabView; },
{
CLASS = CHHistoryDataSource;
LANGUAGE = ObjC;
@ -136,7 +136,6 @@
{CLASS = ExtendedOutlineView; LANGUAGE = ObjC; SUPERCLASS = NSOutlineView; },
{CLASS = FirstResponder; LANGUAGE = ObjC; SUPERCLASS = NSObject; },
{CLASS = LocationBar; LANGUAGE = ObjC; SUPERCLASS = NSView; },
{CLASS = MJExtendedTabView; LANGUAGE = ObjC; SUPERCLASS = NSTabView; },
{CLASS = MainController; LANGUAGE = ObjC; SUPERCLASS = NSObject; },
{
ACTIONS = {load = id; };

View File

@ -3,7 +3,7 @@
<plist version="0.9">
<dict>
<key>IBDocumentLocation</key>
<string>112 15 632 495 0 0 1280 1002 </string>
<string>176 79 632 495 0 0 1280 1002 </string>
<key>IBEditorPositions</key>
<dict>
<key>124</key>

Binary file not shown.

View File

@ -77,12 +77,12 @@ class nsIDOMNode;
@class BookmarksDataSource;
@class CHHistoryDataSource;
@class CHExtendedTabView;
@class BrowserTabView;
@class CHPageProxyIcon;
@interface BrowserWindowController : NSWindowController<CHFind>
{
IBOutlet CHExtendedTabView* mTabBrowser;
IBOutlet BrowserTabView* mTabBrowser;
IBOutlet NSDrawer* mSidebarDrawer;
IBOutlet NSTabView* mSidebarTabView;
IBOutlet NSTabView* mSidebarSourceTabView;

View File

@ -44,7 +44,7 @@
#import "CHPreferenceManager.h"
#import "BookmarksDataSource.h"
#import "CHHistoryDataSource.h"
#import "CHExtendedTabView.h"
#import "BrowserTabView.h"
#import "CHUserDefaults.h"
#import "CHPageProxyIcon.h"

View File

@ -484,6 +484,7 @@
F549ACE80302DEF001026D5D,
F558137E030AEF9C0176F207,
F558137F030AEF9C0176F207,
F5B950BE030C83B601A96654,
);
isa = PBXHeadersBuildPhase;
name = Headers;
@ -610,6 +611,7 @@
F549ACE10302DE6101026D5D,
F5581380030AEF9C0176F207,
F5581381030AEF9C0176F207,
F5B950BF030C83B601A96654,
);
isa = PBXSourcesBuildPhase;
name = Sources;
@ -1341,6 +1343,8 @@
2E2939FF027F33604B000102,
2E748B73029A448D4B000102,
F549ACDE0302DE6001026D5D,
F5B950BD030C83B601A96654,
F5BF71460231B8BC010001CA,
);
isa = PBXGroup;
name = "UI elements";
@ -1538,6 +1542,8 @@
F549ACE70302DEF001026D5D,
F5581379030AEF9B0176F207,
F558137A030AEF9B0176F207,
F5B950BC030C83B601A96654,
F5BF71450231B8BC010001CA,
);
isa = PBXGroup;
name = Headers;
@ -3069,20 +3075,8 @@
};
F5571935022B401B010001CA = {
children = (
F558099D02F22168015DF512,
F558099E02F22168015DF512,
F549ACE40302DEBB01026D5D,
F549ACDF0302DE6001026D5D,
F5BF71450231B8BC010001CA,
F5BF71460231B8BC010001CA,
F5648739023C3857010001CA,
F564873A023C3857010001CA,
F5C3AB810270072A01A80166,
F5C3AB820270072A01A80166,
F541495A02711A8301A80166,
F541495B02711A8301A80166,
F541495E02711B0001A80166,
F541495F02711B0001A80166,
F5B950BA030C833301A96654,
F5B950BB030C833301A96654,
);
isa = PBXGroup;
name = "Categories and Extensions";
@ -5202,6 +5196,67 @@
path = ../string/obsolete/libstring_obsolete_s.a;
refType = 2;
};
F5B950BA030C833301A96654 = {
children = (
F558099D02F22168015DF512,
F549ACE40302DEBB01026D5D,
F5648739023C3857010001CA,
F5C3AB810270072A01A80166,
F541495A02711A8301A80166,
F541495E02711B0001A80166,
);
isa = PBXGroup;
name = Headers;
refType = 4;
};
F5B950BB030C833301A96654 = {
children = (
F558099E02F22168015DF512,
F549ACDF0302DE6001026D5D,
F564873A023C3857010001CA,
F5C3AB820270072A01A80166,
F541495B02711A8301A80166,
F541495F02711B0001A80166,
);
isa = PBXGroup;
name = Source;
path = "";
refType = 4;
};
F5B950BC030C83B601A96654 = {
isa = PBXFileReference;
path = BrowserTabViewItem.h;
refType = 4;
};
F5B950BD030C83B601A96654 = {
isa = PBXFileReference;
path = BrowserTabViewItem.mm;
refType = 4;
};
F5B950BE030C83B601A96654 = {
fileRef = F5B950BC030C83B601A96654;
isa = PBXBuildFile;
settings = {
};
};
F5B950BF030C83B601A96654 = {
fileRef = F5B950BD030C83B601A96654;
isa = PBXBuildFile;
settings = {
};
};
F5B950C0030C83B601A96654 = {
fileRef = F5B950BC030C83B601A96654;
isa = PBXBuildFile;
settings = {
};
};
F5B950C1030C83B601A96654 = {
fileRef = F5B950BD030C83B601A96654;
isa = PBXBuildFile;
settings = {
};
};
F5BAAB1802AC45D301A967F3 = {
isa = PBXApplicationReference;
path = Navigator.app;
@ -5444,6 +5499,7 @@
F549ACE90302DEF001026D5D,
F5581382030AEF9C0176F207,
F5581383030AEF9C0176F207,
F5B950C0030C83B601A96654,
);
isa = PBXHeadersBuildPhase;
name = Headers;
@ -5571,6 +5627,7 @@
F549ACE30302DE6101026D5D,
F5581384030AEF9C0176F207,
F5581385030AEF9C0176F207,
F5B950C1030C83B601A96654,
);
isa = PBXSourcesBuildPhase;
name = Sources;
@ -7212,12 +7269,12 @@
};
F5BF71450231B8BC010001CA = {
isa = PBXFileReference;
path = CHExtendedTabView.h;
path = BrowserTabView.h;
refType = 4;
};
F5BF71460231B8BC010001CA = {
isa = PBXFileReference;
path = CHExtendedTabView.mm;
path = BrowserTabView.mm;
refType = 4;
};
F5BF71510231DC5D010001CA = {

View File

@ -21,6 +21,7 @@
SUPERCLASS = NSObject;
},
{CLASS = BookmarksToolbar; LANGUAGE = ObjC; SUPERCLASS = NSView; },
{CLASS = BrowserTabView; LANGUAGE = ObjC; SUPERCLASS = NSTabView; },
{
CLASS = BrowserWindow;
LANGUAGE = ObjC;
@ -118,7 +119,6 @@
SUPERCLASS = NSView;
},
{CLASS = CHExtendedOutlineView; LANGUAGE = ObjC; SUPERCLASS = NSOutlineView; },
{CLASS = CHExtendedTabView; LANGUAGE = ObjC; SUPERCLASS = NSTabView; },
{
CLASS = CHHistoryDataSource;
LANGUAGE = ObjC;
@ -136,7 +136,6 @@
{CLASS = ExtendedOutlineView; LANGUAGE = ObjC; SUPERCLASS = NSOutlineView; },
{CLASS = FirstResponder; LANGUAGE = ObjC; SUPERCLASS = NSObject; },
{CLASS = LocationBar; LANGUAGE = ObjC; SUPERCLASS = NSView; },
{CLASS = MJExtendedTabView; LANGUAGE = ObjC; SUPERCLASS = NSTabView; },
{CLASS = MainController; LANGUAGE = ObjC; SUPERCLASS = NSObject; },
{
ACTIONS = {load = id; };

View File

@ -3,7 +3,7 @@
<plist version="0.9">
<dict>
<key>IBDocumentLocation</key>
<string>112 15 632 495 0 0 1280 1002 </string>
<string>176 79 632 495 0 0 1280 1002 </string>
<key>IBEditorPositions</key>
<dict>
<key>124</key>

Binary file not shown.

View File

@ -41,7 +41,8 @@
@implementation NSScreen (CHScreenAdditions)
+ (NSScreen*)screenForPoint:(NSPoint)point {
+ (NSScreen*)screenForPoint:(NSPoint)point
{
NSArray* screens = [NSScreen screens];
NSEnumerator* screenEnum = [screens objectEnumerator];
NSScreen* screen;

View File

@ -484,6 +484,7 @@
F549ACE80302DEF001026D5D,
F558137E030AEF9C0176F207,
F558137F030AEF9C0176F207,
F5B950BE030C83B601A96654,
);
isa = PBXHeadersBuildPhase;
name = Headers;
@ -610,6 +611,7 @@
F549ACE10302DE6101026D5D,
F5581380030AEF9C0176F207,
F5581381030AEF9C0176F207,
F5B950BF030C83B601A96654,
);
isa = PBXSourcesBuildPhase;
name = Sources;
@ -1341,6 +1343,8 @@
2E2939FF027F33604B000102,
2E748B73029A448D4B000102,
F549ACDE0302DE6001026D5D,
F5B950BD030C83B601A96654,
F5BF71460231B8BC010001CA,
);
isa = PBXGroup;
name = "UI elements";
@ -1538,6 +1542,8 @@
F549ACE70302DEF001026D5D,
F5581379030AEF9B0176F207,
F558137A030AEF9B0176F207,
F5B950BC030C83B601A96654,
F5BF71450231B8BC010001CA,
);
isa = PBXGroup;
name = Headers;
@ -3069,20 +3075,8 @@
};
F5571935022B401B010001CA = {
children = (
F558099D02F22168015DF512,
F558099E02F22168015DF512,
F549ACE40302DEBB01026D5D,
F549ACDF0302DE6001026D5D,
F5BF71450231B8BC010001CA,
F5BF71460231B8BC010001CA,
F5648739023C3857010001CA,
F564873A023C3857010001CA,
F5C3AB810270072A01A80166,
F5C3AB820270072A01A80166,
F541495A02711A8301A80166,
F541495B02711A8301A80166,
F541495E02711B0001A80166,
F541495F02711B0001A80166,
F5B950BA030C833301A96654,
F5B950BB030C833301A96654,
);
isa = PBXGroup;
name = "Categories and Extensions";
@ -5202,6 +5196,67 @@
path = ../string/obsolete/libstring_obsolete_s.a;
refType = 2;
};
F5B950BA030C833301A96654 = {
children = (
F558099D02F22168015DF512,
F549ACE40302DEBB01026D5D,
F5648739023C3857010001CA,
F5C3AB810270072A01A80166,
F541495A02711A8301A80166,
F541495E02711B0001A80166,
);
isa = PBXGroup;
name = Headers;
refType = 4;
};
F5B950BB030C833301A96654 = {
children = (
F558099E02F22168015DF512,
F549ACDF0302DE6001026D5D,
F564873A023C3857010001CA,
F5C3AB820270072A01A80166,
F541495B02711A8301A80166,
F541495F02711B0001A80166,
);
isa = PBXGroup;
name = Source;
path = "";
refType = 4;
};
F5B950BC030C83B601A96654 = {
isa = PBXFileReference;
path = BrowserTabViewItem.h;
refType = 4;
};
F5B950BD030C83B601A96654 = {
isa = PBXFileReference;
path = BrowserTabViewItem.mm;
refType = 4;
};
F5B950BE030C83B601A96654 = {
fileRef = F5B950BC030C83B601A96654;
isa = PBXBuildFile;
settings = {
};
};
F5B950BF030C83B601A96654 = {
fileRef = F5B950BD030C83B601A96654;
isa = PBXBuildFile;
settings = {
};
};
F5B950C0030C83B601A96654 = {
fileRef = F5B950BC030C83B601A96654;
isa = PBXBuildFile;
settings = {
};
};
F5B950C1030C83B601A96654 = {
fileRef = F5B950BD030C83B601A96654;
isa = PBXBuildFile;
settings = {
};
};
F5BAAB1802AC45D301A967F3 = {
isa = PBXApplicationReference;
path = Navigator.app;
@ -5444,6 +5499,7 @@
F549ACE90302DEF001026D5D,
F5581382030AEF9C0176F207,
F5581383030AEF9C0176F207,
F5B950C0030C83B601A96654,
);
isa = PBXHeadersBuildPhase;
name = Headers;
@ -5571,6 +5627,7 @@
F549ACE30302DE6101026D5D,
F5581384030AEF9C0176F207,
F5581385030AEF9C0176F207,
F5B950C1030C83B601A96654,
);
isa = PBXSourcesBuildPhase;
name = Sources;
@ -7212,12 +7269,12 @@
};
F5BF71450231B8BC010001CA = {
isa = PBXFileReference;
path = CHExtendedTabView.h;
path = BrowserTabView.h;
refType = 4;
};
F5BF71460231B8BC010001CA = {
isa = PBXFileReference;
path = CHExtendedTabView.mm;
path = BrowserTabView.mm;
refType = 4;
};
F5BF71510231DC5D010001CA = {

View File

@ -21,6 +21,7 @@
SUPERCLASS = NSObject;
},
{CLASS = BookmarksToolbar; LANGUAGE = ObjC; SUPERCLASS = NSView; },
{CLASS = BrowserTabView; LANGUAGE = ObjC; SUPERCLASS = NSTabView; },
{
CLASS = BrowserWindow;
LANGUAGE = ObjC;
@ -118,7 +119,6 @@
SUPERCLASS = NSView;
},
{CLASS = CHExtendedOutlineView; LANGUAGE = ObjC; SUPERCLASS = NSOutlineView; },
{CLASS = CHExtendedTabView; LANGUAGE = ObjC; SUPERCLASS = NSTabView; },
{
CLASS = CHHistoryDataSource;
LANGUAGE = ObjC;
@ -136,7 +136,6 @@
{CLASS = ExtendedOutlineView; LANGUAGE = ObjC; SUPERCLASS = NSOutlineView; },
{CLASS = FirstResponder; LANGUAGE = ObjC; SUPERCLASS = NSObject; },
{CLASS = LocationBar; LANGUAGE = ObjC; SUPERCLASS = NSView; },
{CLASS = MJExtendedTabView; LANGUAGE = ObjC; SUPERCLASS = NSTabView; },
{CLASS = MainController; LANGUAGE = ObjC; SUPERCLASS = NSObject; },
{
ACTIONS = {load = id; };

View File

@ -3,7 +3,7 @@
<plist version="0.9">
<dict>
<key>IBDocumentLocation</key>
<string>112 15 632 495 0 0 1280 1002 </string>
<string>176 79 632 495 0 0 1280 1002 </string>
<key>IBEditorPositions</key>
<dict>
<key>124</key>

View File

@ -0,0 +1,40 @@
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*-
*
* The contents of this file are subject to the Mozilla Public
* License Version 1.1 (the "License"); you may not use this file
* except in compliance with the License. You may obtain a copy of
* the License at http://www.mozilla.org/MPL/
*
* Software distributed under the License is distributed on an "AS
* IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
* implied. See the License for the specific language governing
* rights and limitations under the License.
*
* The Original Code is the Mozilla browser.
*
* The Initial Developer of the Original Code is Matt Judy. Portions
* of code @2002 nibfile.com.
*/
#import <Cocoa/Cocoa.h>
@interface BrowserTabView : NSTabView
{
BOOL autoHides;
int maxNumberOfTabs; // 0 means 'no max'
}
// Behavior: Autohiding overrides the default tab visibility state.
// To switch back to usual tabView behavior, setAutoHides:NO.
// Initial value is read from defaults.
- (BOOL)autoHides;
- (void)setAutoHides:(BOOL)newSetting;
- (int)maxNumberOfTabs;
- (void)setMaxNumberOfTabs:(int)maxTabs;
- (BOOL)canMakeNewTabs;
- (void)addTabForURL:(NSString*)aURL referrer:(NSString*)aReferrer;
@end

View File

@ -0,0 +1,298 @@
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* ***** BEGIN LICENSE BLOCK *****
* Version: NPL 1.1/GPL 2.0/LGPL 2.1
*
* The contents of this file are subject to the Netscape Public License
* Version 1.1 (the "License"); you may not use this file except in
* compliance with the License. You may obtain a copy of the License at
* http://www.mozilla.org/NPL/
*
* Software distributed under the License is distributed on an "AS IS" basis,
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
* for the specific language governing rights and limitations under the
* License.
*
* The Original Code is mozilla.org code.
*
* The Initial Developer of the Original Code is
* Netscape Communications Corporation.
* Portions created by the Initial Developer are Copyright (C) 2002
* the Initial Developer. All Rights Reserved.
*
* Contributor(s):
* Matt Judy <matt@nibfile.com> (Original Author)
* David Haas <haasd@cae.wisc.edu>
*
* Alternatively, the contents of this file may be used under the terms of
* either the GNU General Public License Version 2 or later (the "GPL"), or
* the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
* in which case the provisions of the GPL or the LGPL are applicable instead
* of those above. If you wish to allow use of your version of this file only
* under the terms of either the GPL or the LGPL, and not to allow others to
* use your version of this file under the terms of the NPL, indicate your
* decision by deleting the provisions above and replace them with the notice
* and other provisions required by the GPL or the LGPL. If you do not delete
* the provisions above, a recipient may use your version of this file under
* the terms of any one of the NPL, the GPL or the LGPL.
*
* ***** END LICENSE BLOCK ***** */
#import "NSString+Utils.h"
#import "BrowserTabView.h"
#import "CHIconTabViewItem.h"
#import "BookmarksService.h"
#import "BookmarksDataSource.h"
#include "nsCOMPtr.h"
#include "nsIDOMElement.h"
#include "nsIContent.h"
#include "nsIAtom.h"
#include "nsString.h"
#include "nsCRT.h"
//////////////////////////
// NEEDS IMPLEMENTED : Implement drag tracking for moving tabs around.
// Implementation hints : Track drags ;)
// : Change tab controlTint to indicate drag location?
// : Move tab titles around when dragging.
//////////////////////////
@interface BrowserTabView (Private)
- (void)showOrHideTabsAsAppropriate;
- (void)handleDropOnTab:(NSTabViewItem*)overTabViewItem overContent:(BOOL)overContentArea withURL:(NSString*)url;
@end
@implementation BrowserTabView
/******************************************/
/*** Initialization ***/
/******************************************/
- (id)initWithFrame:(NSRect)frameRect
{
if ( (self = [super initWithFrame:frameRect]) ) {
autoHides = YES;
maxNumberOfTabs = 0; // no max
}
return self;
}
- (void)awakeFromNib
{
[self showOrHideTabsAsAppropriate];
[self registerForDraggedTypes:[NSArray arrayWithObjects:
@"MozURLType", @"MozBookmarkType", NSStringPboardType, NSFilenamesPboardType, nil]];
}
/******************************************/
/*** Overridden Methods ***/
/******************************************/
- (BOOL)isOpaque
{
if ( ([self tabViewType] == NSNoTabsBezelBorder) && (NSAppKitVersionNumber < 633) ) {
return NO;
} else {
return [super isOpaque];
}
}
- (void)addTabViewItem:(NSTabViewItem *)tabViewItem
{
[super addTabViewItem:tabViewItem];
[self showOrHideTabsAsAppropriate];
}
- (void)removeTabViewItem:(NSTabViewItem *)tabViewItem
{
[super removeTabViewItem:tabViewItem];
[self showOrHideTabsAsAppropriate];
}
- (void)insertTabViewItem:(NSTabViewItem *)tabViewItem atIndex:(int)index
{
[super insertTabViewItem:tabViewItem atIndex:index];
[self showOrHideTabsAsAppropriate];
}
/******************************************/
/*** Accessor Methods ***/
/******************************************/
- (BOOL)autoHides
{
return autoHides;
}
- (void)setAutoHides:(BOOL)newSetting
{
autoHides = newSetting;
}
- (int)maxNumberOfTabs
{
return maxNumberOfTabs;
}
- (void)setMaxNumberOfTabs:(int)maxTabs
{
maxNumberOfTabs = maxTabs;
}
- (BOOL)canMakeNewTabs
{
return maxNumberOfTabs == 0 || [self numberOfTabViewItems] < maxNumberOfTabs;
}
/******************************************/
/*** Instance Methods ***/
/******************************************/
// 03-03-2002 mlj: Modifies tab view size and type appropriately... Fragile.
// Only to be used with the 2 types of tab view which we use in Chimera.
- (void)showOrHideTabsAsAppropriate
{
// if ( autoHides == YES ) {
if ( [[self tabViewItems] count] < 2) {
if ( [self tabViewType] != NSNoTabsBezelBorder ) {
[self setFrameSize:NSMakeSize( NSWidth([self frame]), NSHeight([self frame]) + 10 )];
}
[self setTabViewType:NSNoTabsBezelBorder];
} else {
if ( [self tabViewType] != NSTopTabsBezelBorder ) {
[self setFrameSize:NSMakeSize( NSWidth([self frame]), NSHeight([self frame]) - 10 )];
}
[self setTabViewType:NSTopTabsBezelBorder];
}
[self display];
// }
}
- (void)handleDropOnTab:(NSTabViewItem*)overTabViewItem overContent:(BOOL)overContentArea withURL:(NSString*)url
{
if (overTabViewItem) {
[[overTabViewItem view] loadURI: url referrer:nil flags: NSLoadFlagsNone activate:NO];
} else if (overContentArea) {
[[[self selectedTabViewItem] view] loadURI: url referrer:nil flags: NSLoadFlagsNone activate:NO];
} else if ([self canMakeNewTabs]) {
[self addTabForURL:url referrer:nil];
} else {
NSLog(@"Can't make new tab for drop");
}
}
// NSDraggingDestination ///////////
- (unsigned int)draggingEntered:(id <NSDraggingInfo>)sender
{
NSPoint localPoint = [self convertPoint: [sender draggingLocation] fromView: nil];
NSTabViewItem* overTabViewItem = [self tabViewItemAtPoint: localPoint];
BOOL overContentArea = NSPointInRect(localPoint, [self contentRect]);
if (!overTabViewItem && !overContentArea && ![self canMakeNewTabs])
return NSDragOperationNone;
return NSDragOperationGeneric;
}
- (unsigned int)draggingUpdated:(id <NSDraggingInfo>)sender
{
NSPoint localPoint = [self convertPoint: [sender draggingLocation] fromView: nil];
NSTabViewItem* overTabViewItem = [self tabViewItemAtPoint: localPoint];
BOOL overContentArea = NSPointInRect(localPoint, [self contentRect]);
if (!overTabViewItem && !overContentArea && ![self canMakeNewTabs])
return NSDragOperationNone;
return NSDragOperationGeneric;
}
- (BOOL)prepareForDragOperation:(id <NSDraggingInfo>)sender
{
return YES;
}
- (BOOL)performDragOperation:(id <NSDraggingInfo>)sender
{
// determine if we are over a tab or the content area
NSPoint localPoint = [self convertPoint: [sender draggingLocation] fromView: nil];
NSTabViewItem* overTabViewItem = [self tabViewItemAtPoint: localPoint];
BOOL overContentArea = NSPointInRect(localPoint, [self contentRect]);
NSArray* pasteBoardTypes = [[sender draggingPasteboard] types];
if ([pasteBoardTypes containsObject: @"MozBookmarkType"])
{
NSArray* contentIds = [[sender draggingPasteboard] propertyListForType: @"MozBookmarkType"];
if (contentIds) {
// drag type is chimera bookmarks
for (unsigned int i = 0; i < [contentIds count]; ++i) {
BookmarkItem* item = [BookmarksService::gDictionary objectForKey: [contentIds objectAtIndex:i]];
nsCOMPtr<nsIDOMElement> bookmarkElt = do_QueryInterface([item contentNode]);
nsCOMPtr<nsIAtom> tagName;
[item contentNode]->GetTag(*getter_AddRefs(tagName));
nsAutoString href;
bookmarkElt->GetAttribute(NS_LITERAL_STRING("href"), href);
NSString* url = [NSString stringWith_nsAString: href];
nsAutoString group;
bookmarkElt->GetAttribute(NS_LITERAL_STRING("group"), group);
if (!group.IsEmpty()) {
BookmarksService::OpenBookmarkGroup(self, bookmarkElt);
} else {
[self handleDropOnTab:overTabViewItem overContent:overContentArea withURL:url];
}
} // for each item
}
}
else if ([pasteBoardTypes containsObject: @"MozURLType"])
{
// drag type is MozURLType
NSDictionary* data = [[sender draggingPasteboard] propertyListForType: @"MozURLType"];
if (data) {
NSString* urlString = [data objectForKey:@"url"];
[self handleDropOnTab:overTabViewItem overContent:overContentArea withURL:urlString];
}
}
else if ([pasteBoardTypes containsObject: NSStringPboardType])
{
NSString* urlString = [[sender draggingPasteboard] stringForType: NSStringPboardType];
[self handleDropOnTab:overTabViewItem overContent:overContentArea withURL:urlString];
}
else if ([pasteBoardTypes containsObject: NSURLPboardType])
{
NSURL* urlData = [NSURL URLFromPasteboard:[sender draggingPasteboard]];
[self handleDropOnTab:overTabViewItem overContent:overContentArea withURL:[urlData absoluteString]];
}
else if ([pasteBoardTypes containsObject: NSFilenamesPboardType])
{
NSString* urlString = [[sender draggingPasteboard] stringForType: NSFilenamesPboardType];
[self handleDropOnTab:overTabViewItem overContent:overContentArea withURL:urlString];
}
return YES;
}
-(void)addTabForURL:(NSString*)aURL referrer:(NSString*)aReferrer
{
// We need to make a new tab.
CHIconTabViewItem *tabViewItem= [[[CHIconTabViewItem alloc] initWithIdentifier: nil] autorelease];
CHBrowserWrapper *newView = [[[CHBrowserWrapper alloc] initWithTab: tabViewItem andWindow: [self window]] autorelease];
[tabViewItem setLabel: NSLocalizedString(@"UntitledPageTitle", @"")];
[tabViewItem setView: newView];
[self addTabViewItem: tabViewItem];
[[tabViewItem view] loadURI: aURL referrer:aReferrer flags: NSLoadFlagsNone activate:NO];
}
@end

View File

@ -0,0 +1,50 @@
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* ***** BEGIN LICENSE BLOCK *****
* Version: NPL 1.1/GPL 2.0/LGPL 2.1
*
* The contents of this file are subject to the Netscape Public License
* Version 1.1 (the "License"); you may not use this file except in
* compliance with the License. You may obtain a copy of the License at
* http://www.mozilla.org/NPL/
*
* Software distributed under the License is distributed on an "AS IS" basis,
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
* for the specific language governing rights and limitations under the
* License.
*
* The Original Code is mozilla.org code.
*
* The Initial Developer of the Original Code is
* Netscape Communications Corporation.
* Portions created by the Initial Developer are Copyright (C) 2002
* the Initial Developer. All Rights Reserved.
*
* Contributor(s):
* Simon Fraser <sfraser@netscape.com>
*
* Alternatively, the contents of this file may be used under the terms of
* either the GNU General Public License Version 2 or later (the "GPL"), or
* the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
* in which case the provisions of the GPL or the LGPL are applicable instead
* of those above. If you wish to allow use of your version of this file only
* under the terms of either the GPL or the LGPL, and not to allow others to
* use your version of this file under the terms of the NPL, indicate your
* decision by deleting the provisions above and replace them with the notice
* and other provisions required by the GPL or the LGPL. If you do not delete
* the provisions above, a recipient may use your version of this file under
* the terms of any one of the NPL, the GPL or the LGPL.
*
* ***** END LICENSE BLOCK ***** */
#import <Cocoa/Cocoa.h>
#import "CHIconTabViewItem.h"
// a subclass of CHIconTabViewItem that handles dragging of site icons
@interface BrowserTabViewItem : CHIconTabViewItem
{
}
@end

View File

@ -0,0 +1,66 @@
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* ***** BEGIN LICENSE BLOCK *****
* Version: NPL 1.1/GPL 2.0/LGPL 2.1
*
* The contents of this file are subject to the Netscape Public License
* Version 1.1 (the "License"); you may not use this file except in
* compliance with the License. You may obtain a copy of the License at
* http://www.mozilla.org/NPL/
*
* Software distributed under the License is distributed on an "AS IS" basis,
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
* for the specific language governing rights and limitations under the
* License.
*
* The Original Code is mozilla.org code.
*
* The Initial Developer of the Original Code is
* Netscape Communications Corporation.
* Portions created by the Initial Developer are Copyright (C) 2002
* the Initial Developer. All Rights Reserved.
*
* Contributor(s):
* Simon Fraser <sfraser@netscape.com>
*
* Alternatively, the contents of this file may be used under the terms of
* either the GNU General Public License Version 2 or later (the "GPL"), or
* the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
* in which case the provisions of the GPL or the LGPL are applicable instead
* of those above. If you wish to allow use of your version of this file only
* under the terms of either the GPL or the LGPL, and not to allow others to
* use your version of this file under the terms of the NPL, indicate your
* decision by deleting the provisions above and replace them with the notice
* and other provisions required by the GPL or the LGPL. If you do not delete
* the provisions above, a recipient may use your version of this file under
* the terms of any one of the NPL, the GPL or the LGPL.
*
* ***** END LICENSE BLOCK ***** */
#import "BrowserTabViewItem.h"
@implementation BrowserTabViewItem
-(id)initWithIdentifier:(id)identifier withTabIcon:(NSImage *)tabIcon
{
if ( (self = [super initWithIdentifier:identifier withTabIcon:tabIcon]) )
{
}
return self;
}
-(id)initWithIdentifier:(id)identifier
{
return [self initWithIdentifier:identifier withTabIcon:nil];
}
-(void)dealloc
{
[super dealloc];
}
@end

View File

@ -77,12 +77,12 @@ class nsIDOMNode;
@class BookmarksDataSource;
@class CHHistoryDataSource;
@class CHExtendedTabView;
@class BrowserTabView;
@class CHPageProxyIcon;
@interface BrowserWindowController : NSWindowController<CHFind>
{
IBOutlet CHExtendedTabView* mTabBrowser;
IBOutlet BrowserTabView* mTabBrowser;
IBOutlet NSDrawer* mSidebarDrawer;
IBOutlet NSTabView* mSidebarTabView;
IBOutlet NSTabView* mSidebarSourceTabView;

View File

@ -44,7 +44,7 @@
#import "CHPreferenceManager.h"
#import "BookmarksDataSource.h"
#import "CHHistoryDataSource.h"
#import "CHExtendedTabView.h"
#import "BrowserTabView.h"
#import "CHUserDefaults.h"
#import "CHPageProxyIcon.h"

View File

@ -41,7 +41,8 @@
@implementation NSScreen (CHScreenAdditions)
+ (NSScreen*)screenForPoint:(NSPoint)point {
+ (NSScreen*)screenForPoint:(NSPoint)point
{
NSArray* screens = [NSScreen screens];
NSEnumerator* screenEnum = [screens objectEnumerator];
NSScreen* screen;