More history sidebar panel work.

This commit is contained in:
ben%netscape.com 2002-04-29 12:39:27 +00:00
Родитель 2883fb134e
Коммит 9c035bd57a
38 изменённых файлов: 648 добавлений и 238 удалений

16
camino/BrowserWindow.nib/classes.nib сгенерированный
Просмотреть файл

@ -34,7 +34,6 @@
stop = id;
toggleSidebar = id;
viewOnlyThisImage = id;
viewSource = id;
};
CLASS = BrowserWindowController;
LANGUAGE = ObjC;
@ -44,6 +43,7 @@
mAddBookmarkSheetWindow = id;
mAddBookmarkTitleField = id;
mCachedBMDS = id;
mHistoryDataSource = id;
mImageLinkMenu = id;
mImageMenu = id;
mInputMenu = id;
@ -75,7 +75,18 @@
{CLASS = CHBookmarksToolbar; LANGUAGE = ObjC; SUPERCLASS = NSView; },
{CLASS = CHExtendedOutlineView; LANGUAGE = ObjC; SUPERCLASS = NSOutlineView; },
{CLASS = CHExtendedTabView; LANGUAGE = ObjC; SUPERCLASS = NSTabView; },
{
CLASS = CHHistoryDataSource;
LANGUAGE = ObjC;
SUPERCLASS = CHRDFOutlineViewDataSource;
},
{CLASS = CHLocationBar; LANGUAGE = ObjC; SUPERCLASS = NSView; },
{
CLASS = CHRDFOutlineViewDataSource;
LANGUAGE = ObjC;
OUTLETS = {mOutlineView = id; };
SUPERCLASS = NSObject;
},
{CLASS = ExtendedOutlineView; LANGUAGE = ObjC; SUPERCLASS = NSOutlineView; },
{CLASS = FirstResponder; LANGUAGE = ObjC; SUPERCLASS = NSObject; },
{CLASS = LocationBar; LANGUAGE = ObjC; SUPERCLASS = NSView; },
@ -98,7 +109,8 @@
urlbar = id;
};
SUPERCLASS = NSView;
}
},
{CLASS = RDFOutlineViewItem; LANGUAGE = ObjC; SUPERCLASS = NSObject; }
);
IBVersion = 1;
}

21
camino/BrowserWindow.nib/info.nib сгенерированный
Просмотреть файл

@ -3,29 +3,31 @@
<plist version="0.9">
<dict>
<key>IBDocumentLocation</key>
<string>7 130 480 309 0 0 1152 746 </string>
<string>97 226 480 309 0 0 1280 1002 </string>
<key>IBEditorPositions</key>
<dict>
<key>124</key>
<string>431 537 170 180 0 0 1152 746 </string>
<key>160</key>
<string>478 70 195 666 0 0 1152 746 </string>
<string>572 326 195 666 0 0 1280 1002 </string>
<key>28</key>
<string>478 279 195 457 0 0 1152 746 </string>
<string>572 439 195 457 0 0 1280 1002 </string>
<key>297</key>
<string>70 110 198 210 0 0 1152 746 </string>
<string>70 110 187 210 0 0 1152 746 </string>
<key>314</key>
<string>271 139 198 180 0 0 1152 746 </string>
<string>271 139 168 180 0 0 1152 746 </string>
<key>336</key>
<string>458 90 200 162 0 0 1152 746 </string>
<key>343</key>
<string>499 330 200 252 0 0 1152 746 </string>
<key>365</key>
<string>22 500 93 162 0 0 1152 746 </string>
<key>463</key>
<string>7 444 200 252 0 0 1152 746 </string>
<key>475</key>
<string>516 447 120 142 0 0 1152 746 </string>
<string>609 597 120 142 0 0 1280 1002 </string>
<key>56</key>
<string>404 484 343 68 0 0 1152 746 </string>
<string>498 634 343 68 0 0 1280 1002 </string>
</dict>
<key>IBFramework Version</key>
<string>248.0</string>
@ -45,12 +47,9 @@
</array>
<key>IBOpenObjects</key>
<array>
<integer>475</integer>
<integer>297</integer>
<integer>160</integer>
<integer>56</integer>
</array>
<key>IBSystem Version</key>
<string>5Q125</string>
<string>5L21</string>
</dict>
</plist>

Двоичные данные
camino/BrowserWindow.nib/objects.nib сгенерированный

Двоичный файл не отображается.

Просмотреть файл

@ -58,6 +58,7 @@ class nsIDOMNode;
IBOutlet id mSidebarBrowserView;
IBOutlet id mSidebarBookmarksDataSource;
IBOutlet id mHistoryDataSource;
IBOutlet CHBookmarksToolbar* mPersonalToolbar;

Просмотреть файл

@ -203,6 +203,8 @@ static NSString *PrintToolbarItemIdentifier = @"Print Toolbar Item";
- (void)drawerWillOpen: (NSNotification*)aNotification
{
[mSidebarBookmarksDataSource ensureBookmarks];
[mHistoryDataSource ensureDataSourceLoaded];
// Force the window to shrink and move if necessary in order to accommodate the sidebar.
NSRect screenFrame = [[[self window] screen] visibleFrame];

Просмотреть файл

@ -37,7 +37,7 @@
* ***** END LICENSE BLOCK ***** */
#import <Foundation/Foundation.h>
#include <Appkit/Appkit.h>
#import <Appkit/Appkit.h>
class nsIRDFDataSource;
class nsIRDFContainer;
@ -46,17 +46,17 @@ class nsIRDFResource;
class nsIRDFService;
@interface CHRDFOutlineViewDataSource : NSObject {
nsIRDFDataSource* mDataSource;
nsIRDFContainer* mContainer;
nsIRDFContainerUtils* mContainerUtils;
nsIRDFResource* mRootResource;
nsIRDFService* mRDFService;
nsIRDFDataSource* mDataSource;
nsIRDFContainer* mContainer;
nsIRDFContainerUtils* mContainerUtils;
nsIRDFResource* mRootResource;
nsIRDFService* mRDFService;
IBOutlet id mOutlineView;
}
// Initialization Methods
- (id) initWithDataSource: (nsIRDFDataSource*) aDataSource rootResource: (nsIRDFResource*) aRootResource;
- (void) ensureDataSourceLoaded;
- (nsIRDFDataSource*) dataSource;
- (nsIRDFResource*) rootResource;

Просмотреть файл

@ -44,6 +44,7 @@
#include "nsIRDFResource.h"
#include "nsIRDFContainer.h"
#include "nsIRDFContainerUtils.h"
#include "nsRDFCID.h"
#include "nsComponentManagerUtils.h"
#include "nsIServiceManagerUtils.h"
@ -51,36 +52,23 @@
#include "nsXPIDLString.h"
#include "nsString.h"
@implementation CHRDFOutlineViewDataSource
- (id) init
- (void) ensureDataSourceLoaded
{
if ((self = [super init])) {
nsCOMPtr<nsIRDFContainer> ctr(do_CreateInstance("@mozilla.org/rdf/container;1"));
NS_ADDREF(mContainer = ctr);
nsCOMPtr<nsIRDFContainer> ctr = do_CreateInstance("@mozilla.org/rdf/container;1");
NS_ADDREF(mContainer = ctr);
nsCOMPtr<nsIRDFContainerUtils> ctrUtils(do_GetService("@mozilla.org/rdf/container-utils;1"));
NS_ADDREF(mContainerUtils = ctrUtils);
nsCOMPtr<nsIRDFContainerUtils> ctrUtils = do_GetService("@mozilla.org/rdf/container-utils;1");
NS_ADDREF(mContainerUtils = ctrUtils);
nsCOMPtr<nsIRDFService> rdfService(do_GetService("@mozilla.org/rdf/rdf-service;1"));
NS_ADDREF(mRDFService = rdfService);
nsCOMPtr<nsIRDFService> rdfService = do_GetService("@mozilla.org/rdf/rdf-service;1");
NS_ADDREF(mRDFService = rdfService);
mDataSource = nsnull;
mRootResource = nsnull;
}
return self;
}
- (id) initWithDataSource: (nsIRDFDataSource*) aDataSource rootResource: (nsIRDFResource*) aRootResource
{
NS_ASSERTION(aDataSource != nsnull, "Trying to initWithDataSource without a data source!");
if (!aDataSource)
return nil;
NS_ADDREF(mDataSource = aDataSource);
NS_IF_ADDREF(mRootResource = aRootResource);
return [self init];
mDataSource = nsnull;
mRootResource = nsnull;
}
- (void) dealloc
@ -127,15 +115,35 @@
return NO;
}
// XXX write me
- (BOOL)outlineView: (NSOutlineView*) aOutlineView isItemExpandable: (id) aItem
- (BOOL) outlineView: (NSOutlineView*) aOutlineView isItemExpandable: (id) aItem
{
return NO;
NSLog(@"outlineView:%@isItemExpandable:%@", aOutlineView, aItem);
if (!mDataSource)
return NO;
if (!aItem)
return YES; // The root is always open
nsCOMPtr<nsIRDFResource> itemResource = [aItem resource];
PRBool isSeq = PR_FALSE;
mContainerUtils->IsSeq(mDataSource, itemResource, &isSeq);
if (isSeq)
return YES;
nsCOMPtr<nsIRDFResource> childProperty;
mRDFService->GetResource("http://home.netscape.com/NC-rdf#child", getter_AddRefs(childProperty));
nsCOMPtr<nsIRDFNode> childNode;
mDataSource->GetTarget(itemResource, childProperty, PR_TRUE, getter_AddRefs(childNode));
return childNode != nsnull;
}
- (id) outlineView: (NSOutlineView*) aOutlineView child: (int) aIndex
ofItem: (id) aItem
{
NSLog(@"outlineView:%@child:%dofItem:%@", aOutlineView, aIndex, aItem);
if (!mDataSource)
return nil;
@ -157,18 +165,40 @@
- (int) outlineView: (NSOutlineView*) aOutlineView numberOfChildrenOfItem: (id) aItem;
{
NSLog(@"outlineView:%@numberOfChildrenOfItem:%@", aOutlineView, aItem);
if (!mDataSource)
return nil;
nsCOMPtr<nsIRDFResource> resource = !aItem ? mRootResource : [aItem resource];
nsresult rv = mContainer->Init(mDataSource, resource);
NS_ASSERTION(NS_SUCCEEDED(rv), "Not a container!");
if (NS_FAILED(rv))
return 0;
// XXX just assume NC:child is the only containment arc for now
nsCOMPtr<nsIRDFResource> childProperty;
mRDFService->GetResource("http://home.netscape.com/NC-rdf#child", getter_AddRefs(childProperty));
PRInt32 count;
mContainer->GetCount(&count);
nsCOMPtr<nsISimpleEnumerator> childNodes;
mDataSource->GetTargets(resource, childProperty, PR_TRUE, getter_AddRefs(childNodes));
PRBool hasMore = PR_FALSE;
childNodes->HasMoreElements(&hasMore);
PRInt32 count = 0;
while (hasMore) {
nsCOMPtr<nsISupports> supp;
childNodes->GetNext(getter_AddRefs(supp));
++count;
childNodes->HasMoreElements(&hasMore);
}
if (!count) {
nsresult rv = mContainer->Init(mDataSource, resource);
if (NS_FAILED(rv))
return 0;
mContainer->GetCount(&count);
}
return count;
}
@ -176,6 +206,7 @@
- (id) outlineView: (NSOutlineView*) aOutlineView objectValueForTableColumn: (NSTableColumn*) aTableColumn
byItem: (id) aItem
{
NSLog(@"outlineView:%@objectValueForTableColumn:%@byItem:%@", aOutlineView, aTableColumn, aItem);
if (!mDataSource || !aItem)
return nil;

Просмотреть файл

@ -24,6 +24,8 @@
F59E9F3F0237E43401A967DF,
F52D5CD0027A887001A80166,
F52D5CD4027A88C601A80166,
F52F87CD027D75C301A80165,
F52F87CE027D75C301A80165,
);
isa = PBXGroup;
name = Classes;
@ -400,6 +402,8 @@
F52D5CD1027A887001A80166,
F52D5CD5027A88C601A80166,
F52D5CD9027D3D5001A80166,
F52F87CF027D75C301A80165,
F52F87D0027D75C301A80165,
);
isa = PBXHeadersBuildPhase;
name = Headers;
@ -492,6 +496,8 @@
F52D5CD2027A887001A80166,
F52D5CD6027A88C601A80166,
F52D5CDA027D3D5001A80166,
F52F87D1027D75C301A80165,
F52F87D2027D75C301A80165,
);
isa = PBXSourcesBuildPhase;
name = Sources;
@ -896,6 +902,8 @@
F5137A1102676B9101026D05,
F52D5CCF027A887001A80166,
F52D5CD3027A88C601A80166,
F52F87CB027D75C301A80165,
F52F87CC027D75C301A80165,
);
isa = PBXGroup;
name = Headers;
@ -1482,6 +1490,50 @@
settings = {
};
};
F52F87CB027D75C301A80165 = {
isa = PBXFileReference;
path = CHHistoryDataSource.h;
refType = 4;
};
F52F87CC027D75C301A80165 = {
isa = PBXFileReference;
path = CHRDFOutlineViewDataSource.h;
refType = 4;
};
F52F87CD027D75C301A80165 = {
isa = PBXFileReference;
path = CHHistoryDataSource.mm;
refType = 4;
};
F52F87CE027D75C301A80165 = {
isa = PBXFileReference;
path = CHRDFOutlineViewDataSource.mm;
refType = 4;
};
F52F87CF027D75C301A80165 = {
fileRef = F52F87CB027D75C301A80165;
isa = PBXBuildFile;
settings = {
};
};
F52F87D0027D75C301A80165 = {
fileRef = F52F87CC027D75C301A80165;
isa = PBXBuildFile;
settings = {
};
};
F52F87D1027D75C301A80165 = {
fileRef = F52F87CD027D75C301A80165;
isa = PBXBuildFile;
settings = {
};
};
F52F87D2027D75C301A80165 = {
fileRef = F52F87CE027D75C301A80165;
isa = PBXBuildFile;
settings = {
};
};
F538DFAE023B36A7010001CA = {
children = (
F538DFAF023B3739010001CA,

16
camino/English.lproj/BrowserWindow.nib/classes.nib сгенерированный
Просмотреть файл

@ -34,7 +34,6 @@
stop = id;
toggleSidebar = id;
viewOnlyThisImage = id;
viewSource = id;
};
CLASS = BrowserWindowController;
LANGUAGE = ObjC;
@ -44,6 +43,7 @@
mAddBookmarkSheetWindow = id;
mAddBookmarkTitleField = id;
mCachedBMDS = id;
mHistoryDataSource = id;
mImageLinkMenu = id;
mImageMenu = id;
mInputMenu = id;
@ -75,7 +75,18 @@
{CLASS = CHBookmarksToolbar; LANGUAGE = ObjC; SUPERCLASS = NSView; },
{CLASS = CHExtendedOutlineView; LANGUAGE = ObjC; SUPERCLASS = NSOutlineView; },
{CLASS = CHExtendedTabView; LANGUAGE = ObjC; SUPERCLASS = NSTabView; },
{
CLASS = CHHistoryDataSource;
LANGUAGE = ObjC;
SUPERCLASS = CHRDFOutlineViewDataSource;
},
{CLASS = CHLocationBar; LANGUAGE = ObjC; SUPERCLASS = NSView; },
{
CLASS = CHRDFOutlineViewDataSource;
LANGUAGE = ObjC;
OUTLETS = {mOutlineView = id; };
SUPERCLASS = NSObject;
},
{CLASS = ExtendedOutlineView; LANGUAGE = ObjC; SUPERCLASS = NSOutlineView; },
{CLASS = FirstResponder; LANGUAGE = ObjC; SUPERCLASS = NSObject; },
{CLASS = LocationBar; LANGUAGE = ObjC; SUPERCLASS = NSView; },
@ -98,7 +109,8 @@
urlbar = id;
};
SUPERCLASS = NSView;
}
},
{CLASS = RDFOutlineViewItem; LANGUAGE = ObjC; SUPERCLASS = NSObject; }
);
IBVersion = 1;
}

21
camino/English.lproj/BrowserWindow.nib/info.nib сгенерированный
Просмотреть файл

@ -3,29 +3,31 @@
<plist version="0.9">
<dict>
<key>IBDocumentLocation</key>
<string>7 130 480 309 0 0 1152 746 </string>
<string>97 226 480 309 0 0 1280 1002 </string>
<key>IBEditorPositions</key>
<dict>
<key>124</key>
<string>431 537 170 180 0 0 1152 746 </string>
<key>160</key>
<string>478 70 195 666 0 0 1152 746 </string>
<string>572 326 195 666 0 0 1280 1002 </string>
<key>28</key>
<string>478 279 195 457 0 0 1152 746 </string>
<string>572 439 195 457 0 0 1280 1002 </string>
<key>297</key>
<string>70 110 198 210 0 0 1152 746 </string>
<string>70 110 187 210 0 0 1152 746 </string>
<key>314</key>
<string>271 139 198 180 0 0 1152 746 </string>
<string>271 139 168 180 0 0 1152 746 </string>
<key>336</key>
<string>458 90 200 162 0 0 1152 746 </string>
<key>343</key>
<string>499 330 200 252 0 0 1152 746 </string>
<key>365</key>
<string>22 500 93 162 0 0 1152 746 </string>
<key>463</key>
<string>7 444 200 252 0 0 1152 746 </string>
<key>475</key>
<string>516 447 120 142 0 0 1152 746 </string>
<string>609 597 120 142 0 0 1280 1002 </string>
<key>56</key>
<string>404 484 343 68 0 0 1152 746 </string>
<string>498 634 343 68 0 0 1280 1002 </string>
</dict>
<key>IBFramework Version</key>
<string>248.0</string>
@ -45,12 +47,9 @@
</array>
<key>IBOpenObjects</key>
<array>
<integer>475</integer>
<integer>297</integer>
<integer>160</integer>
<integer>56</integer>
</array>
<key>IBSystem Version</key>
<string>5Q125</string>
<string>5L21</string>
</dict>
</plist>

Двоичные данные
camino/English.lproj/BrowserWindow.nib/objects.nib сгенерированный

Двоичный файл не отображается.

Просмотреть файл

@ -24,6 +24,8 @@
F59E9F3F0237E43401A967DF,
F52D5CD0027A887001A80166,
F52D5CD4027A88C601A80166,
F52F87CD027D75C301A80165,
F52F87CE027D75C301A80165,
);
isa = PBXGroup;
name = Classes;
@ -400,6 +402,8 @@
F52D5CD1027A887001A80166,
F52D5CD5027A88C601A80166,
F52D5CD9027D3D5001A80166,
F52F87CF027D75C301A80165,
F52F87D0027D75C301A80165,
);
isa = PBXHeadersBuildPhase;
name = Headers;
@ -492,6 +496,8 @@
F52D5CD2027A887001A80166,
F52D5CD6027A88C601A80166,
F52D5CDA027D3D5001A80166,
F52F87D1027D75C301A80165,
F52F87D2027D75C301A80165,
);
isa = PBXSourcesBuildPhase;
name = Sources;
@ -896,6 +902,8 @@
F5137A1102676B9101026D05,
F52D5CCF027A887001A80166,
F52D5CD3027A88C601A80166,
F52F87CB027D75C301A80165,
F52F87CC027D75C301A80165,
);
isa = PBXGroup;
name = Headers;
@ -1482,6 +1490,50 @@
settings = {
};
};
F52F87CB027D75C301A80165 = {
isa = PBXFileReference;
path = CHHistoryDataSource.h;
refType = 4;
};
F52F87CC027D75C301A80165 = {
isa = PBXFileReference;
path = CHRDFOutlineViewDataSource.h;
refType = 4;
};
F52F87CD027D75C301A80165 = {
isa = PBXFileReference;
path = CHHistoryDataSource.mm;
refType = 4;
};
F52F87CE027D75C301A80165 = {
isa = PBXFileReference;
path = CHRDFOutlineViewDataSource.mm;
refType = 4;
};
F52F87CF027D75C301A80165 = {
fileRef = F52F87CB027D75C301A80165;
isa = PBXBuildFile;
settings = {
};
};
F52F87D0027D75C301A80165 = {
fileRef = F52F87CC027D75C301A80165;
isa = PBXBuildFile;
settings = {
};
};
F52F87D1027D75C301A80165 = {
fileRef = F52F87CD027D75C301A80165;
isa = PBXBuildFile;
settings = {
};
};
F52F87D2027D75C301A80165 = {
fileRef = F52F87CE027D75C301A80165;
isa = PBXBuildFile;
settings = {
};
};
F538DFAE023B36A7010001CA = {
children = (
F538DFAF023B3739010001CA,

Просмотреть файл

@ -34,7 +34,6 @@
stop = id;
toggleSidebar = id;
viewOnlyThisImage = id;
viewSource = id;
};
CLASS = BrowserWindowController;
LANGUAGE = ObjC;
@ -44,6 +43,7 @@
mAddBookmarkSheetWindow = id;
mAddBookmarkTitleField = id;
mCachedBMDS = id;
mHistoryDataSource = id;
mImageLinkMenu = id;
mImageMenu = id;
mInputMenu = id;
@ -75,7 +75,18 @@
{CLASS = CHBookmarksToolbar; LANGUAGE = ObjC; SUPERCLASS = NSView; },
{CLASS = CHExtendedOutlineView; LANGUAGE = ObjC; SUPERCLASS = NSOutlineView; },
{CLASS = CHExtendedTabView; LANGUAGE = ObjC; SUPERCLASS = NSTabView; },
{
CLASS = CHHistoryDataSource;
LANGUAGE = ObjC;
SUPERCLASS = CHRDFOutlineViewDataSource;
},
{CLASS = CHLocationBar; LANGUAGE = ObjC; SUPERCLASS = NSView; },
{
CLASS = CHRDFOutlineViewDataSource;
LANGUAGE = ObjC;
OUTLETS = {mOutlineView = id; };
SUPERCLASS = NSObject;
},
{CLASS = ExtendedOutlineView; LANGUAGE = ObjC; SUPERCLASS = NSOutlineView; },
{CLASS = FirstResponder; LANGUAGE = ObjC; SUPERCLASS = NSObject; },
{CLASS = LocationBar; LANGUAGE = ObjC; SUPERCLASS = NSView; },
@ -98,7 +109,8 @@
urlbar = id;
};
SUPERCLASS = NSView;
}
},
{CLASS = RDFOutlineViewItem; LANGUAGE = ObjC; SUPERCLASS = NSObject; }
);
IBVersion = 1;
}

Просмотреть файл

@ -3,29 +3,31 @@
<plist version="0.9">
<dict>
<key>IBDocumentLocation</key>
<string>7 130 480 309 0 0 1152 746 </string>
<string>97 226 480 309 0 0 1280 1002 </string>
<key>IBEditorPositions</key>
<dict>
<key>124</key>
<string>431 537 170 180 0 0 1152 746 </string>
<key>160</key>
<string>478 70 195 666 0 0 1152 746 </string>
<string>572 326 195 666 0 0 1280 1002 </string>
<key>28</key>
<string>478 279 195 457 0 0 1152 746 </string>
<string>572 439 195 457 0 0 1280 1002 </string>
<key>297</key>
<string>70 110 198 210 0 0 1152 746 </string>
<string>70 110 187 210 0 0 1152 746 </string>
<key>314</key>
<string>271 139 198 180 0 0 1152 746 </string>
<string>271 139 168 180 0 0 1152 746 </string>
<key>336</key>
<string>458 90 200 162 0 0 1152 746 </string>
<key>343</key>
<string>499 330 200 252 0 0 1152 746 </string>
<key>365</key>
<string>22 500 93 162 0 0 1152 746 </string>
<key>463</key>
<string>7 444 200 252 0 0 1152 746 </string>
<key>475</key>
<string>516 447 120 142 0 0 1152 746 </string>
<string>609 597 120 142 0 0 1280 1002 </string>
<key>56</key>
<string>404 484 343 68 0 0 1152 746 </string>
<string>498 634 343 68 0 0 1280 1002 </string>
</dict>
<key>IBFramework Version</key>
<string>248.0</string>
@ -45,12 +47,9 @@
</array>
<key>IBOpenObjects</key>
<array>
<integer>475</integer>
<integer>297</integer>
<integer>160</integer>
<integer>56</integer>
</array>
<key>IBSystem Version</key>
<string>5Q125</string>
<string>5L21</string>
</dict>
</plist>

Двоичные данные
camino/resources/localized/English.lproj/BrowserWindow.nib/objects.nib сгенерированный

Двоичный файл не отображается.

Просмотреть файл

@ -58,6 +58,7 @@ class nsIDOMNode;
IBOutlet id mSidebarBrowserView;
IBOutlet id mSidebarBookmarksDataSource;
IBOutlet id mHistoryDataSource;
IBOutlet CHBookmarksToolbar* mPersonalToolbar;

Просмотреть файл

@ -203,6 +203,8 @@ static NSString *PrintToolbarItemIdentifier = @"Print Toolbar Item";
- (void)drawerWillOpen: (NSNotification*)aNotification
{
[mSidebarBookmarksDataSource ensureBookmarks];
[mHistoryDataSource ensureDataSourceLoaded];
// Force the window to shrink and move if necessary in order to accommodate the sidebar.
NSRect screenFrame = [[[self window] screen] visibleFrame];

Просмотреть файл

@ -37,7 +37,7 @@
* ***** END LICENSE BLOCK ***** */
#import <Foundation/Foundation.h>
#include <Appkit/Appkit.h>
#import <Appkit/Appkit.h>
class nsIRDFDataSource;
class nsIRDFContainer;
@ -46,17 +46,17 @@ class nsIRDFResource;
class nsIRDFService;
@interface CHRDFOutlineViewDataSource : NSObject {
nsIRDFDataSource* mDataSource;
nsIRDFContainer* mContainer;
nsIRDFContainerUtils* mContainerUtils;
nsIRDFResource* mRootResource;
nsIRDFService* mRDFService;
nsIRDFDataSource* mDataSource;
nsIRDFContainer* mContainer;
nsIRDFContainerUtils* mContainerUtils;
nsIRDFResource* mRootResource;
nsIRDFService* mRDFService;
IBOutlet id mOutlineView;
}
// Initialization Methods
- (id) initWithDataSource: (nsIRDFDataSource*) aDataSource rootResource: (nsIRDFResource*) aRootResource;
- (void) ensureDataSourceLoaded;
- (nsIRDFDataSource*) dataSource;
- (nsIRDFResource*) rootResource;

Просмотреть файл

@ -44,6 +44,7 @@
#include "nsIRDFResource.h"
#include "nsIRDFContainer.h"
#include "nsIRDFContainerUtils.h"
#include "nsRDFCID.h"
#include "nsComponentManagerUtils.h"
#include "nsIServiceManagerUtils.h"
@ -51,36 +52,23 @@
#include "nsXPIDLString.h"
#include "nsString.h"
@implementation CHRDFOutlineViewDataSource
- (id) init
- (void) ensureDataSourceLoaded
{
if ((self = [super init])) {
nsCOMPtr<nsIRDFContainer> ctr(do_CreateInstance("@mozilla.org/rdf/container;1"));
NS_ADDREF(mContainer = ctr);
nsCOMPtr<nsIRDFContainer> ctr = do_CreateInstance("@mozilla.org/rdf/container;1");
NS_ADDREF(mContainer = ctr);
nsCOMPtr<nsIRDFContainerUtils> ctrUtils(do_GetService("@mozilla.org/rdf/container-utils;1"));
NS_ADDREF(mContainerUtils = ctrUtils);
nsCOMPtr<nsIRDFContainerUtils> ctrUtils = do_GetService("@mozilla.org/rdf/container-utils;1");
NS_ADDREF(mContainerUtils = ctrUtils);
nsCOMPtr<nsIRDFService> rdfService(do_GetService("@mozilla.org/rdf/rdf-service;1"));
NS_ADDREF(mRDFService = rdfService);
nsCOMPtr<nsIRDFService> rdfService = do_GetService("@mozilla.org/rdf/rdf-service;1");
NS_ADDREF(mRDFService = rdfService);
mDataSource = nsnull;
mRootResource = nsnull;
}
return self;
}
- (id) initWithDataSource: (nsIRDFDataSource*) aDataSource rootResource: (nsIRDFResource*) aRootResource
{
NS_ASSERTION(aDataSource != nsnull, "Trying to initWithDataSource without a data source!");
if (!aDataSource)
return nil;
NS_ADDREF(mDataSource = aDataSource);
NS_IF_ADDREF(mRootResource = aRootResource);
return [self init];
mDataSource = nsnull;
mRootResource = nsnull;
}
- (void) dealloc
@ -127,15 +115,35 @@
return NO;
}
// XXX write me
- (BOOL)outlineView: (NSOutlineView*) aOutlineView isItemExpandable: (id) aItem
- (BOOL) outlineView: (NSOutlineView*) aOutlineView isItemExpandable: (id) aItem
{
return NO;
NSLog(@"outlineView:%@isItemExpandable:%@", aOutlineView, aItem);
if (!mDataSource)
return NO;
if (!aItem)
return YES; // The root is always open
nsCOMPtr<nsIRDFResource> itemResource = [aItem resource];
PRBool isSeq = PR_FALSE;
mContainerUtils->IsSeq(mDataSource, itemResource, &isSeq);
if (isSeq)
return YES;
nsCOMPtr<nsIRDFResource> childProperty;
mRDFService->GetResource("http://home.netscape.com/NC-rdf#child", getter_AddRefs(childProperty));
nsCOMPtr<nsIRDFNode> childNode;
mDataSource->GetTarget(itemResource, childProperty, PR_TRUE, getter_AddRefs(childNode));
return childNode != nsnull;
}
- (id) outlineView: (NSOutlineView*) aOutlineView child: (int) aIndex
ofItem: (id) aItem
{
NSLog(@"outlineView:%@child:%dofItem:%@", aOutlineView, aIndex, aItem);
if (!mDataSource)
return nil;
@ -157,18 +165,40 @@
- (int) outlineView: (NSOutlineView*) aOutlineView numberOfChildrenOfItem: (id) aItem;
{
NSLog(@"outlineView:%@numberOfChildrenOfItem:%@", aOutlineView, aItem);
if (!mDataSource)
return nil;
nsCOMPtr<nsIRDFResource> resource = !aItem ? mRootResource : [aItem resource];
nsresult rv = mContainer->Init(mDataSource, resource);
NS_ASSERTION(NS_SUCCEEDED(rv), "Not a container!");
if (NS_FAILED(rv))
return 0;
// XXX just assume NC:child is the only containment arc for now
nsCOMPtr<nsIRDFResource> childProperty;
mRDFService->GetResource("http://home.netscape.com/NC-rdf#child", getter_AddRefs(childProperty));
PRInt32 count;
mContainer->GetCount(&count);
nsCOMPtr<nsISimpleEnumerator> childNodes;
mDataSource->GetTargets(resource, childProperty, PR_TRUE, getter_AddRefs(childNodes));
PRBool hasMore = PR_FALSE;
childNodes->HasMoreElements(&hasMore);
PRInt32 count = 0;
while (hasMore) {
nsCOMPtr<nsISupports> supp;
childNodes->GetNext(getter_AddRefs(supp));
++count;
childNodes->HasMoreElements(&hasMore);
}
if (!count) {
nsresult rv = mContainer->Init(mDataSource, resource);
if (NS_FAILED(rv))
return 0;
mContainer->GetCount(&count);
}
return count;
}
@ -176,6 +206,7 @@
- (id) outlineView: (NSOutlineView*) aOutlineView objectValueForTableColumn: (NSTableColumn*) aTableColumn
byItem: (id) aItem
{
NSLog(@"outlineView:%@objectValueForTableColumn:%@byItem:%@", aOutlineView, aTableColumn, aItem);
if (!mDataSource || !aItem)
return nil;

16
chimera/BrowserWindow.nib/classes.nib сгенерированный
Просмотреть файл

@ -34,7 +34,6 @@
stop = id;
toggleSidebar = id;
viewOnlyThisImage = id;
viewSource = id;
};
CLASS = BrowserWindowController;
LANGUAGE = ObjC;
@ -44,6 +43,7 @@
mAddBookmarkSheetWindow = id;
mAddBookmarkTitleField = id;
mCachedBMDS = id;
mHistoryDataSource = id;
mImageLinkMenu = id;
mImageMenu = id;
mInputMenu = id;
@ -75,7 +75,18 @@
{CLASS = CHBookmarksToolbar; LANGUAGE = ObjC; SUPERCLASS = NSView; },
{CLASS = CHExtendedOutlineView; LANGUAGE = ObjC; SUPERCLASS = NSOutlineView; },
{CLASS = CHExtendedTabView; LANGUAGE = ObjC; SUPERCLASS = NSTabView; },
{
CLASS = CHHistoryDataSource;
LANGUAGE = ObjC;
SUPERCLASS = CHRDFOutlineViewDataSource;
},
{CLASS = CHLocationBar; LANGUAGE = ObjC; SUPERCLASS = NSView; },
{
CLASS = CHRDFOutlineViewDataSource;
LANGUAGE = ObjC;
OUTLETS = {mOutlineView = id; };
SUPERCLASS = NSObject;
},
{CLASS = ExtendedOutlineView; LANGUAGE = ObjC; SUPERCLASS = NSOutlineView; },
{CLASS = FirstResponder; LANGUAGE = ObjC; SUPERCLASS = NSObject; },
{CLASS = LocationBar; LANGUAGE = ObjC; SUPERCLASS = NSView; },
@ -98,7 +109,8 @@
urlbar = id;
};
SUPERCLASS = NSView;
}
},
{CLASS = RDFOutlineViewItem; LANGUAGE = ObjC; SUPERCLASS = NSObject; }
);
IBVersion = 1;
}

21
chimera/BrowserWindow.nib/info.nib сгенерированный
Просмотреть файл

@ -3,29 +3,31 @@
<plist version="0.9">
<dict>
<key>IBDocumentLocation</key>
<string>7 130 480 309 0 0 1152 746 </string>
<string>97 226 480 309 0 0 1280 1002 </string>
<key>IBEditorPositions</key>
<dict>
<key>124</key>
<string>431 537 170 180 0 0 1152 746 </string>
<key>160</key>
<string>478 70 195 666 0 0 1152 746 </string>
<string>572 326 195 666 0 0 1280 1002 </string>
<key>28</key>
<string>478 279 195 457 0 0 1152 746 </string>
<string>572 439 195 457 0 0 1280 1002 </string>
<key>297</key>
<string>70 110 198 210 0 0 1152 746 </string>
<string>70 110 187 210 0 0 1152 746 </string>
<key>314</key>
<string>271 139 198 180 0 0 1152 746 </string>
<string>271 139 168 180 0 0 1152 746 </string>
<key>336</key>
<string>458 90 200 162 0 0 1152 746 </string>
<key>343</key>
<string>499 330 200 252 0 0 1152 746 </string>
<key>365</key>
<string>22 500 93 162 0 0 1152 746 </string>
<key>463</key>
<string>7 444 200 252 0 0 1152 746 </string>
<key>475</key>
<string>516 447 120 142 0 0 1152 746 </string>
<string>609 597 120 142 0 0 1280 1002 </string>
<key>56</key>
<string>404 484 343 68 0 0 1152 746 </string>
<string>498 634 343 68 0 0 1280 1002 </string>
</dict>
<key>IBFramework Version</key>
<string>248.0</string>
@ -45,12 +47,9 @@
</array>
<key>IBOpenObjects</key>
<array>
<integer>475</integer>
<integer>297</integer>
<integer>160</integer>
<integer>56</integer>
</array>
<key>IBSystem Version</key>
<string>5Q125</string>
<string>5L21</string>
</dict>
</plist>

Двоичные данные
chimera/BrowserWindow.nib/objects.nib сгенерированный

Двоичный файл не отображается.

Просмотреть файл

@ -58,6 +58,7 @@ class nsIDOMNode;
IBOutlet id mSidebarBrowserView;
IBOutlet id mSidebarBookmarksDataSource;
IBOutlet id mHistoryDataSource;
IBOutlet CHBookmarksToolbar* mPersonalToolbar;

Просмотреть файл

@ -203,6 +203,8 @@ static NSString *PrintToolbarItemIdentifier = @"Print Toolbar Item";
- (void)drawerWillOpen: (NSNotification*)aNotification
{
[mSidebarBookmarksDataSource ensureBookmarks];
[mHistoryDataSource ensureDataSourceLoaded];
// Force the window to shrink and move if necessary in order to accommodate the sidebar.
NSRect screenFrame = [[[self window] screen] visibleFrame];

Просмотреть файл

@ -37,7 +37,7 @@
* ***** END LICENSE BLOCK ***** */
#import <Foundation/Foundation.h>
#include <Appkit/Appkit.h>
#import <Appkit/Appkit.h>
class nsIRDFDataSource;
class nsIRDFContainer;
@ -46,17 +46,17 @@ class nsIRDFResource;
class nsIRDFService;
@interface CHRDFOutlineViewDataSource : NSObject {
nsIRDFDataSource* mDataSource;
nsIRDFContainer* mContainer;
nsIRDFContainerUtils* mContainerUtils;
nsIRDFResource* mRootResource;
nsIRDFService* mRDFService;
nsIRDFDataSource* mDataSource;
nsIRDFContainer* mContainer;
nsIRDFContainerUtils* mContainerUtils;
nsIRDFResource* mRootResource;
nsIRDFService* mRDFService;
IBOutlet id mOutlineView;
}
// Initialization Methods
- (id) initWithDataSource: (nsIRDFDataSource*) aDataSource rootResource: (nsIRDFResource*) aRootResource;
- (void) ensureDataSourceLoaded;
- (nsIRDFDataSource*) dataSource;
- (nsIRDFResource*) rootResource;

Просмотреть файл

@ -44,6 +44,7 @@
#include "nsIRDFResource.h"
#include "nsIRDFContainer.h"
#include "nsIRDFContainerUtils.h"
#include "nsRDFCID.h"
#include "nsComponentManagerUtils.h"
#include "nsIServiceManagerUtils.h"
@ -51,36 +52,23 @@
#include "nsXPIDLString.h"
#include "nsString.h"
@implementation CHRDFOutlineViewDataSource
- (id) init
- (void) ensureDataSourceLoaded
{
if ((self = [super init])) {
nsCOMPtr<nsIRDFContainer> ctr(do_CreateInstance("@mozilla.org/rdf/container;1"));
NS_ADDREF(mContainer = ctr);
nsCOMPtr<nsIRDFContainer> ctr = do_CreateInstance("@mozilla.org/rdf/container;1");
NS_ADDREF(mContainer = ctr);
nsCOMPtr<nsIRDFContainerUtils> ctrUtils(do_GetService("@mozilla.org/rdf/container-utils;1"));
NS_ADDREF(mContainerUtils = ctrUtils);
nsCOMPtr<nsIRDFContainerUtils> ctrUtils = do_GetService("@mozilla.org/rdf/container-utils;1");
NS_ADDREF(mContainerUtils = ctrUtils);
nsCOMPtr<nsIRDFService> rdfService(do_GetService("@mozilla.org/rdf/rdf-service;1"));
NS_ADDREF(mRDFService = rdfService);
nsCOMPtr<nsIRDFService> rdfService = do_GetService("@mozilla.org/rdf/rdf-service;1");
NS_ADDREF(mRDFService = rdfService);
mDataSource = nsnull;
mRootResource = nsnull;
}
return self;
}
- (id) initWithDataSource: (nsIRDFDataSource*) aDataSource rootResource: (nsIRDFResource*) aRootResource
{
NS_ASSERTION(aDataSource != nsnull, "Trying to initWithDataSource without a data source!");
if (!aDataSource)
return nil;
NS_ADDREF(mDataSource = aDataSource);
NS_IF_ADDREF(mRootResource = aRootResource);
return [self init];
mDataSource = nsnull;
mRootResource = nsnull;
}
- (void) dealloc
@ -127,15 +115,35 @@
return NO;
}
// XXX write me
- (BOOL)outlineView: (NSOutlineView*) aOutlineView isItemExpandable: (id) aItem
- (BOOL) outlineView: (NSOutlineView*) aOutlineView isItemExpandable: (id) aItem
{
return NO;
NSLog(@"outlineView:%@isItemExpandable:%@", aOutlineView, aItem);
if (!mDataSource)
return NO;
if (!aItem)
return YES; // The root is always open
nsCOMPtr<nsIRDFResource> itemResource = [aItem resource];
PRBool isSeq = PR_FALSE;
mContainerUtils->IsSeq(mDataSource, itemResource, &isSeq);
if (isSeq)
return YES;
nsCOMPtr<nsIRDFResource> childProperty;
mRDFService->GetResource("http://home.netscape.com/NC-rdf#child", getter_AddRefs(childProperty));
nsCOMPtr<nsIRDFNode> childNode;
mDataSource->GetTarget(itemResource, childProperty, PR_TRUE, getter_AddRefs(childNode));
return childNode != nsnull;
}
- (id) outlineView: (NSOutlineView*) aOutlineView child: (int) aIndex
ofItem: (id) aItem
{
NSLog(@"outlineView:%@child:%dofItem:%@", aOutlineView, aIndex, aItem);
if (!mDataSource)
return nil;
@ -157,18 +165,40 @@
- (int) outlineView: (NSOutlineView*) aOutlineView numberOfChildrenOfItem: (id) aItem;
{
NSLog(@"outlineView:%@numberOfChildrenOfItem:%@", aOutlineView, aItem);
if (!mDataSource)
return nil;
nsCOMPtr<nsIRDFResource> resource = !aItem ? mRootResource : [aItem resource];
nsresult rv = mContainer->Init(mDataSource, resource);
NS_ASSERTION(NS_SUCCEEDED(rv), "Not a container!");
if (NS_FAILED(rv))
return 0;
// XXX just assume NC:child is the only containment arc for now
nsCOMPtr<nsIRDFResource> childProperty;
mRDFService->GetResource("http://home.netscape.com/NC-rdf#child", getter_AddRefs(childProperty));
PRInt32 count;
mContainer->GetCount(&count);
nsCOMPtr<nsISimpleEnumerator> childNodes;
mDataSource->GetTargets(resource, childProperty, PR_TRUE, getter_AddRefs(childNodes));
PRBool hasMore = PR_FALSE;
childNodes->HasMoreElements(&hasMore);
PRInt32 count = 0;
while (hasMore) {
nsCOMPtr<nsISupports> supp;
childNodes->GetNext(getter_AddRefs(supp));
++count;
childNodes->HasMoreElements(&hasMore);
}
if (!count) {
nsresult rv = mContainer->Init(mDataSource, resource);
if (NS_FAILED(rv))
return 0;
mContainer->GetCount(&count);
}
return count;
}
@ -176,6 +206,7 @@
- (id) outlineView: (NSOutlineView*) aOutlineView objectValueForTableColumn: (NSTableColumn*) aTableColumn
byItem: (id) aItem
{
NSLog(@"outlineView:%@objectValueForTableColumn:%@byItem:%@", aOutlineView, aTableColumn, aItem);
if (!mDataSource || !aItem)
return nil;

Просмотреть файл

@ -24,6 +24,8 @@
F59E9F3F0237E43401A967DF,
F52D5CD0027A887001A80166,
F52D5CD4027A88C601A80166,
F52F87CD027D75C301A80165,
F52F87CE027D75C301A80165,
);
isa = PBXGroup;
name = Classes;
@ -400,6 +402,8 @@
F52D5CD1027A887001A80166,
F52D5CD5027A88C601A80166,
F52D5CD9027D3D5001A80166,
F52F87CF027D75C301A80165,
F52F87D0027D75C301A80165,
);
isa = PBXHeadersBuildPhase;
name = Headers;
@ -492,6 +496,8 @@
F52D5CD2027A887001A80166,
F52D5CD6027A88C601A80166,
F52D5CDA027D3D5001A80166,
F52F87D1027D75C301A80165,
F52F87D2027D75C301A80165,
);
isa = PBXSourcesBuildPhase;
name = Sources;
@ -896,6 +902,8 @@
F5137A1102676B9101026D05,
F52D5CCF027A887001A80166,
F52D5CD3027A88C601A80166,
F52F87CB027D75C301A80165,
F52F87CC027D75C301A80165,
);
isa = PBXGroup;
name = Headers;
@ -1482,6 +1490,50 @@
settings = {
};
};
F52F87CB027D75C301A80165 = {
isa = PBXFileReference;
path = CHHistoryDataSource.h;
refType = 4;
};
F52F87CC027D75C301A80165 = {
isa = PBXFileReference;
path = CHRDFOutlineViewDataSource.h;
refType = 4;
};
F52F87CD027D75C301A80165 = {
isa = PBXFileReference;
path = CHHistoryDataSource.mm;
refType = 4;
};
F52F87CE027D75C301A80165 = {
isa = PBXFileReference;
path = CHRDFOutlineViewDataSource.mm;
refType = 4;
};
F52F87CF027D75C301A80165 = {
fileRef = F52F87CB027D75C301A80165;
isa = PBXBuildFile;
settings = {
};
};
F52F87D0027D75C301A80165 = {
fileRef = F52F87CC027D75C301A80165;
isa = PBXBuildFile;
settings = {
};
};
F52F87D1027D75C301A80165 = {
fileRef = F52F87CD027D75C301A80165;
isa = PBXBuildFile;
settings = {
};
};
F52F87D2027D75C301A80165 = {
fileRef = F52F87CE027D75C301A80165;
isa = PBXBuildFile;
settings = {
};
};
F538DFAE023B36A7010001CA = {
children = (
F538DFAF023B3739010001CA,

16
chimera/English.lproj/BrowserWindow.nib/classes.nib сгенерированный
Просмотреть файл

@ -34,7 +34,6 @@
stop = id;
toggleSidebar = id;
viewOnlyThisImage = id;
viewSource = id;
};
CLASS = BrowserWindowController;
LANGUAGE = ObjC;
@ -44,6 +43,7 @@
mAddBookmarkSheetWindow = id;
mAddBookmarkTitleField = id;
mCachedBMDS = id;
mHistoryDataSource = id;
mImageLinkMenu = id;
mImageMenu = id;
mInputMenu = id;
@ -75,7 +75,18 @@
{CLASS = CHBookmarksToolbar; LANGUAGE = ObjC; SUPERCLASS = NSView; },
{CLASS = CHExtendedOutlineView; LANGUAGE = ObjC; SUPERCLASS = NSOutlineView; },
{CLASS = CHExtendedTabView; LANGUAGE = ObjC; SUPERCLASS = NSTabView; },
{
CLASS = CHHistoryDataSource;
LANGUAGE = ObjC;
SUPERCLASS = CHRDFOutlineViewDataSource;
},
{CLASS = CHLocationBar; LANGUAGE = ObjC; SUPERCLASS = NSView; },
{
CLASS = CHRDFOutlineViewDataSource;
LANGUAGE = ObjC;
OUTLETS = {mOutlineView = id; };
SUPERCLASS = NSObject;
},
{CLASS = ExtendedOutlineView; LANGUAGE = ObjC; SUPERCLASS = NSOutlineView; },
{CLASS = FirstResponder; LANGUAGE = ObjC; SUPERCLASS = NSObject; },
{CLASS = LocationBar; LANGUAGE = ObjC; SUPERCLASS = NSView; },
@ -98,7 +109,8 @@
urlbar = id;
};
SUPERCLASS = NSView;
}
},
{CLASS = RDFOutlineViewItem; LANGUAGE = ObjC; SUPERCLASS = NSObject; }
);
IBVersion = 1;
}

21
chimera/English.lproj/BrowserWindow.nib/info.nib сгенерированный
Просмотреть файл

@ -3,29 +3,31 @@
<plist version="0.9">
<dict>
<key>IBDocumentLocation</key>
<string>7 130 480 309 0 0 1152 746 </string>
<string>97 226 480 309 0 0 1280 1002 </string>
<key>IBEditorPositions</key>
<dict>
<key>124</key>
<string>431 537 170 180 0 0 1152 746 </string>
<key>160</key>
<string>478 70 195 666 0 0 1152 746 </string>
<string>572 326 195 666 0 0 1280 1002 </string>
<key>28</key>
<string>478 279 195 457 0 0 1152 746 </string>
<string>572 439 195 457 0 0 1280 1002 </string>
<key>297</key>
<string>70 110 198 210 0 0 1152 746 </string>
<string>70 110 187 210 0 0 1152 746 </string>
<key>314</key>
<string>271 139 198 180 0 0 1152 746 </string>
<string>271 139 168 180 0 0 1152 746 </string>
<key>336</key>
<string>458 90 200 162 0 0 1152 746 </string>
<key>343</key>
<string>499 330 200 252 0 0 1152 746 </string>
<key>365</key>
<string>22 500 93 162 0 0 1152 746 </string>
<key>463</key>
<string>7 444 200 252 0 0 1152 746 </string>
<key>475</key>
<string>516 447 120 142 0 0 1152 746 </string>
<string>609 597 120 142 0 0 1280 1002 </string>
<key>56</key>
<string>404 484 343 68 0 0 1152 746 </string>
<string>498 634 343 68 0 0 1280 1002 </string>
</dict>
<key>IBFramework Version</key>
<string>248.0</string>
@ -45,12 +47,9 @@
</array>
<key>IBOpenObjects</key>
<array>
<integer>475</integer>
<integer>297</integer>
<integer>160</integer>
<integer>56</integer>
</array>
<key>IBSystem Version</key>
<string>5Q125</string>
<string>5L21</string>
</dict>
</plist>

Двоичные данные
chimera/English.lproj/BrowserWindow.nib/objects.nib сгенерированный

Двоичный файл не отображается.

Просмотреть файл

@ -24,6 +24,8 @@
F59E9F3F0237E43401A967DF,
F52D5CD0027A887001A80166,
F52D5CD4027A88C601A80166,
F52F87CD027D75C301A80165,
F52F87CE027D75C301A80165,
);
isa = PBXGroup;
name = Classes;
@ -400,6 +402,8 @@
F52D5CD1027A887001A80166,
F52D5CD5027A88C601A80166,
F52D5CD9027D3D5001A80166,
F52F87CF027D75C301A80165,
F52F87D0027D75C301A80165,
);
isa = PBXHeadersBuildPhase;
name = Headers;
@ -492,6 +496,8 @@
F52D5CD2027A887001A80166,
F52D5CD6027A88C601A80166,
F52D5CDA027D3D5001A80166,
F52F87D1027D75C301A80165,
F52F87D2027D75C301A80165,
);
isa = PBXSourcesBuildPhase;
name = Sources;
@ -896,6 +902,8 @@
F5137A1102676B9101026D05,
F52D5CCF027A887001A80166,
F52D5CD3027A88C601A80166,
F52F87CB027D75C301A80165,
F52F87CC027D75C301A80165,
);
isa = PBXGroup;
name = Headers;
@ -1482,6 +1490,50 @@
settings = {
};
};
F52F87CB027D75C301A80165 = {
isa = PBXFileReference;
path = CHHistoryDataSource.h;
refType = 4;
};
F52F87CC027D75C301A80165 = {
isa = PBXFileReference;
path = CHRDFOutlineViewDataSource.h;
refType = 4;
};
F52F87CD027D75C301A80165 = {
isa = PBXFileReference;
path = CHHistoryDataSource.mm;
refType = 4;
};
F52F87CE027D75C301A80165 = {
isa = PBXFileReference;
path = CHRDFOutlineViewDataSource.mm;
refType = 4;
};
F52F87CF027D75C301A80165 = {
fileRef = F52F87CB027D75C301A80165;
isa = PBXBuildFile;
settings = {
};
};
F52F87D0027D75C301A80165 = {
fileRef = F52F87CC027D75C301A80165;
isa = PBXBuildFile;
settings = {
};
};
F52F87D1027D75C301A80165 = {
fileRef = F52F87CD027D75C301A80165;
isa = PBXBuildFile;
settings = {
};
};
F52F87D2027D75C301A80165 = {
fileRef = F52F87CE027D75C301A80165;
isa = PBXBuildFile;
settings = {
};
};
F538DFAE023B36A7010001CA = {
children = (
F538DFAF023B3739010001CA,

Просмотреть файл

@ -34,7 +34,6 @@
stop = id;
toggleSidebar = id;
viewOnlyThisImage = id;
viewSource = id;
};
CLASS = BrowserWindowController;
LANGUAGE = ObjC;
@ -44,6 +43,7 @@
mAddBookmarkSheetWindow = id;
mAddBookmarkTitleField = id;
mCachedBMDS = id;
mHistoryDataSource = id;
mImageLinkMenu = id;
mImageMenu = id;
mInputMenu = id;
@ -75,7 +75,18 @@
{CLASS = CHBookmarksToolbar; LANGUAGE = ObjC; SUPERCLASS = NSView; },
{CLASS = CHExtendedOutlineView; LANGUAGE = ObjC; SUPERCLASS = NSOutlineView; },
{CLASS = CHExtendedTabView; LANGUAGE = ObjC; SUPERCLASS = NSTabView; },
{
CLASS = CHHistoryDataSource;
LANGUAGE = ObjC;
SUPERCLASS = CHRDFOutlineViewDataSource;
},
{CLASS = CHLocationBar; LANGUAGE = ObjC; SUPERCLASS = NSView; },
{
CLASS = CHRDFOutlineViewDataSource;
LANGUAGE = ObjC;
OUTLETS = {mOutlineView = id; };
SUPERCLASS = NSObject;
},
{CLASS = ExtendedOutlineView; LANGUAGE = ObjC; SUPERCLASS = NSOutlineView; },
{CLASS = FirstResponder; LANGUAGE = ObjC; SUPERCLASS = NSObject; },
{CLASS = LocationBar; LANGUAGE = ObjC; SUPERCLASS = NSView; },
@ -98,7 +109,8 @@
urlbar = id;
};
SUPERCLASS = NSView;
}
},
{CLASS = RDFOutlineViewItem; LANGUAGE = ObjC; SUPERCLASS = NSObject; }
);
IBVersion = 1;
}

Просмотреть файл

@ -3,29 +3,31 @@
<plist version="0.9">
<dict>
<key>IBDocumentLocation</key>
<string>7 130 480 309 0 0 1152 746 </string>
<string>97 226 480 309 0 0 1280 1002 </string>
<key>IBEditorPositions</key>
<dict>
<key>124</key>
<string>431 537 170 180 0 0 1152 746 </string>
<key>160</key>
<string>478 70 195 666 0 0 1152 746 </string>
<string>572 326 195 666 0 0 1280 1002 </string>
<key>28</key>
<string>478 279 195 457 0 0 1152 746 </string>
<string>572 439 195 457 0 0 1280 1002 </string>
<key>297</key>
<string>70 110 198 210 0 0 1152 746 </string>
<string>70 110 187 210 0 0 1152 746 </string>
<key>314</key>
<string>271 139 198 180 0 0 1152 746 </string>
<string>271 139 168 180 0 0 1152 746 </string>
<key>336</key>
<string>458 90 200 162 0 0 1152 746 </string>
<key>343</key>
<string>499 330 200 252 0 0 1152 746 </string>
<key>365</key>
<string>22 500 93 162 0 0 1152 746 </string>
<key>463</key>
<string>7 444 200 252 0 0 1152 746 </string>
<key>475</key>
<string>516 447 120 142 0 0 1152 746 </string>
<string>609 597 120 142 0 0 1280 1002 </string>
<key>56</key>
<string>404 484 343 68 0 0 1152 746 </string>
<string>498 634 343 68 0 0 1280 1002 </string>
</dict>
<key>IBFramework Version</key>
<string>248.0</string>
@ -45,12 +47,9 @@
</array>
<key>IBOpenObjects</key>
<array>
<integer>475</integer>
<integer>297</integer>
<integer>160</integer>
<integer>56</integer>
</array>
<key>IBSystem Version</key>
<string>5Q125</string>
<string>5L21</string>
</dict>
</plist>

Двоичные данные
chimera/resources/localized/English.lproj/BrowserWindow.nib/objects.nib сгенерированный

Двоичный файл не отображается.

Просмотреть файл

@ -58,6 +58,7 @@ class nsIDOMNode;
IBOutlet id mSidebarBrowserView;
IBOutlet id mSidebarBookmarksDataSource;
IBOutlet id mHistoryDataSource;
IBOutlet CHBookmarksToolbar* mPersonalToolbar;

Просмотреть файл

@ -203,6 +203,8 @@ static NSString *PrintToolbarItemIdentifier = @"Print Toolbar Item";
- (void)drawerWillOpen: (NSNotification*)aNotification
{
[mSidebarBookmarksDataSource ensureBookmarks];
[mHistoryDataSource ensureDataSourceLoaded];
// Force the window to shrink and move if necessary in order to accommodate the sidebar.
NSRect screenFrame = [[[self window] screen] visibleFrame];

Просмотреть файл

@ -37,7 +37,7 @@
* ***** END LICENSE BLOCK ***** */
#import <Foundation/Foundation.h>
#include <Appkit/Appkit.h>
#import <Appkit/Appkit.h>
class nsIRDFDataSource;
class nsIRDFContainer;
@ -46,17 +46,17 @@ class nsIRDFResource;
class nsIRDFService;
@interface CHRDFOutlineViewDataSource : NSObject {
nsIRDFDataSource* mDataSource;
nsIRDFContainer* mContainer;
nsIRDFContainerUtils* mContainerUtils;
nsIRDFResource* mRootResource;
nsIRDFService* mRDFService;
nsIRDFDataSource* mDataSource;
nsIRDFContainer* mContainer;
nsIRDFContainerUtils* mContainerUtils;
nsIRDFResource* mRootResource;
nsIRDFService* mRDFService;
IBOutlet id mOutlineView;
}
// Initialization Methods
- (id) initWithDataSource: (nsIRDFDataSource*) aDataSource rootResource: (nsIRDFResource*) aRootResource;
- (void) ensureDataSourceLoaded;
- (nsIRDFDataSource*) dataSource;
- (nsIRDFResource*) rootResource;

Просмотреть файл

@ -44,6 +44,7 @@
#include "nsIRDFResource.h"
#include "nsIRDFContainer.h"
#include "nsIRDFContainerUtils.h"
#include "nsRDFCID.h"
#include "nsComponentManagerUtils.h"
#include "nsIServiceManagerUtils.h"
@ -51,36 +52,23 @@
#include "nsXPIDLString.h"
#include "nsString.h"
@implementation CHRDFOutlineViewDataSource
- (id) init
- (void) ensureDataSourceLoaded
{
if ((self = [super init])) {
nsCOMPtr<nsIRDFContainer> ctr(do_CreateInstance("@mozilla.org/rdf/container;1"));
NS_ADDREF(mContainer = ctr);
nsCOMPtr<nsIRDFContainer> ctr = do_CreateInstance("@mozilla.org/rdf/container;1");
NS_ADDREF(mContainer = ctr);
nsCOMPtr<nsIRDFContainerUtils> ctrUtils(do_GetService("@mozilla.org/rdf/container-utils;1"));
NS_ADDREF(mContainerUtils = ctrUtils);
nsCOMPtr<nsIRDFContainerUtils> ctrUtils = do_GetService("@mozilla.org/rdf/container-utils;1");
NS_ADDREF(mContainerUtils = ctrUtils);
nsCOMPtr<nsIRDFService> rdfService(do_GetService("@mozilla.org/rdf/rdf-service;1"));
NS_ADDREF(mRDFService = rdfService);
nsCOMPtr<nsIRDFService> rdfService = do_GetService("@mozilla.org/rdf/rdf-service;1");
NS_ADDREF(mRDFService = rdfService);
mDataSource = nsnull;
mRootResource = nsnull;
}
return self;
}
- (id) initWithDataSource: (nsIRDFDataSource*) aDataSource rootResource: (nsIRDFResource*) aRootResource
{
NS_ASSERTION(aDataSource != nsnull, "Trying to initWithDataSource without a data source!");
if (!aDataSource)
return nil;
NS_ADDREF(mDataSource = aDataSource);
NS_IF_ADDREF(mRootResource = aRootResource);
return [self init];
mDataSource = nsnull;
mRootResource = nsnull;
}
- (void) dealloc
@ -127,15 +115,35 @@
return NO;
}
// XXX write me
- (BOOL)outlineView: (NSOutlineView*) aOutlineView isItemExpandable: (id) aItem
- (BOOL) outlineView: (NSOutlineView*) aOutlineView isItemExpandable: (id) aItem
{
return NO;
NSLog(@"outlineView:%@isItemExpandable:%@", aOutlineView, aItem);
if (!mDataSource)
return NO;
if (!aItem)
return YES; // The root is always open
nsCOMPtr<nsIRDFResource> itemResource = [aItem resource];
PRBool isSeq = PR_FALSE;
mContainerUtils->IsSeq(mDataSource, itemResource, &isSeq);
if (isSeq)
return YES;
nsCOMPtr<nsIRDFResource> childProperty;
mRDFService->GetResource("http://home.netscape.com/NC-rdf#child", getter_AddRefs(childProperty));
nsCOMPtr<nsIRDFNode> childNode;
mDataSource->GetTarget(itemResource, childProperty, PR_TRUE, getter_AddRefs(childNode));
return childNode != nsnull;
}
- (id) outlineView: (NSOutlineView*) aOutlineView child: (int) aIndex
ofItem: (id) aItem
{
NSLog(@"outlineView:%@child:%dofItem:%@", aOutlineView, aIndex, aItem);
if (!mDataSource)
return nil;
@ -157,18 +165,40 @@
- (int) outlineView: (NSOutlineView*) aOutlineView numberOfChildrenOfItem: (id) aItem;
{
NSLog(@"outlineView:%@numberOfChildrenOfItem:%@", aOutlineView, aItem);
if (!mDataSource)
return nil;
nsCOMPtr<nsIRDFResource> resource = !aItem ? mRootResource : [aItem resource];
nsresult rv = mContainer->Init(mDataSource, resource);
NS_ASSERTION(NS_SUCCEEDED(rv), "Not a container!");
if (NS_FAILED(rv))
return 0;
// XXX just assume NC:child is the only containment arc for now
nsCOMPtr<nsIRDFResource> childProperty;
mRDFService->GetResource("http://home.netscape.com/NC-rdf#child", getter_AddRefs(childProperty));
PRInt32 count;
mContainer->GetCount(&count);
nsCOMPtr<nsISimpleEnumerator> childNodes;
mDataSource->GetTargets(resource, childProperty, PR_TRUE, getter_AddRefs(childNodes));
PRBool hasMore = PR_FALSE;
childNodes->HasMoreElements(&hasMore);
PRInt32 count = 0;
while (hasMore) {
nsCOMPtr<nsISupports> supp;
childNodes->GetNext(getter_AddRefs(supp));
++count;
childNodes->HasMoreElements(&hasMore);
}
if (!count) {
nsresult rv = mContainer->Init(mDataSource, resource);
if (NS_FAILED(rv))
return 0;
mContainer->GetCount(&count);
}
return count;
}
@ -176,6 +206,7 @@
- (id) outlineView: (NSOutlineView*) aOutlineView objectValueForTableColumn: (NSTableColumn*) aTableColumn
byItem: (id) aItem
{
NSLog(@"outlineView:%@objectValueForTableColumn:%@byItem:%@", aOutlineView, aTableColumn, aItem);
if (!mDataSource || !aItem)
return nil;