Fix for 70877, enabling outliner. r=dr, sr=waterson

This commit is contained in:
hyatt%netscape.com 2001-03-06 22:16:42 +00:00
Родитель d49acaf06d
Коммит 92656d6cbe
13 изменённых файлов: 89 добавлений и 7 удалений

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

@ -71,6 +71,7 @@
#include "nsIDocShell.h"
#include "nsIMarkupDocumentViewer.h"
#include "nsITreeFrame.h"
#include "nsIOutlinerBoxObject.h"
#include "nsIScrollableViewProvider.h"
#include "nsIDOMNSDocument.h"
@ -905,16 +906,52 @@ nsEventStateManager::DoWheelScroll(nsIPresContext* aPresContext,
// Special case for tree/list frames - they handle their own scrolling
nsITreeFrame* treeFrame = nsnull;
nsCOMPtr<nsIOutlinerBoxObject> outlinerBoxObject;
nsIFrame* curFrame = aTargetFrame;
while (curFrame) {
if (NS_OK == curFrame->QueryInterface(NS_GET_IID(nsITreeFrame),
(void**) &treeFrame))
break;
outlinerBoxObject = do_QueryInterface(curFrame);
if (outlinerBoxObject)
break;
curFrame->GetParent(&curFrame);
}
if (treeFrame)
return DoTreeScroll(aPresContext, numLines, scrollPage, treeFrame);
if (treeFrame) {
PRInt32 scrollIndex, visibleRows;
treeFrame->GetIndexOfFirstVisibleRow(&scrollIndex);
treeFrame->GetNumberOfVisibleRows(&visibleRows);
if (scrollPage)
scrollIndex += ((numLines > 0) ? visibleRows : -visibleRows);
else
scrollIndex += numLines;
if (scrollIndex < 0)
scrollIndex = 0;
else {
PRInt32 numRows, lastPageTopRow;
treeFrame->GetRowCount(&numRows);
lastPageTopRow = numRows - visibleRows;
if (scrollIndex > lastPageTopRow)
scrollIndex = lastPageTopRow;
}
treeFrame->ScrollToIndex(scrollIndex);
return NS_OK;
}
if (outlinerBoxObject) {
if (scrollPage)
outlinerBoxObject->ScrollByPages((numLines > 0) ? 1 : -1);
else
outlinerBoxObject->ScrollByLines(numLines);
return NS_OK;
}
nsCOMPtr<nsIPresShell> presShell;
aPresContext->GetShell(getter_AddRefs(presShell));

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

@ -169,6 +169,7 @@ static PRBool gNoisyInlineConstruction = PR_FALSE;
#include "nsXULTreeCellFrame.h"
#include "nsMenuFrame.h"
#include "nsPopupSetFrame.h"
#include "nsOutlinerColFrame.h"
//------------------------------------------------------------------
@ -247,6 +248,9 @@ NS_NewMenuBarFrame ( nsIPresShell* aPresShell, nsIFrame** aNewFrame );
nsresult
NS_NewTreeScrollPortFrame ( nsIPresShell* aPresShell, nsIFrame** aNewFrame );
nsresult
NS_NewOutlinerBodyFrame (nsIPresShell* aPresShell, nsIFrame** aNewFrame);
// grid
nsresult
NS_NewGridLayout ( nsIPresShell* aPresShell, nsCOMPtr<nsIBoxLayout>& aNewLayout );
@ -5261,7 +5265,7 @@ nsCSSFrameConstructor::ConstructXULFrame(nsIPresShell* aPresShell,
display->mDisplay == NS_STYLE_DISPLAY_BOX)) ||
aTag == nsXULAtoms::box || aTag == nsXULAtoms::vbox || aTag == nsXULAtoms::hbox || aTag == nsXULAtoms::tabbox ||
aTag == nsXULAtoms::tabpage || aTag == nsXULAtoms::tabcontrol
|| aTag == nsXULAtoms::treecell
|| aTag == nsXULAtoms::treecell || aTag == nsXULAtoms::outliner
) {
processChildren = PR_TRUE;
isReplaced = PR_TRUE;
@ -5404,7 +5408,15 @@ nsCSSFrameConstructor::ConstructXULFrame(nsIPresShell* aPresShell,
isReplaced = PR_TRUE;
rv = NS_NewSpringFrame(aPresShell, &newFrame);
}
else if (aTag == nsXULAtoms::outlinerbody) {
isReplaced = PR_TRUE;
rv = NS_NewOutlinerBodyFrame(aPresShell, &newFrame);
}
else if (aTag == nsXULAtoms::outlinercol) {
isReplaced = PR_TRUE;
processChildren = PR_TRUE;
rv = NS_NewOutlinerColFrame(aPresShell, &newFrame);
}
// TEXT CONSTRUCTION
else if (aTag == nsXULAtoms::text) {
processChildren = PR_TRUE;

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

@ -56,6 +56,7 @@ SHARED_LIBRARY_LIBS = \
$(DIST)/lib/libgkxulcon_s.$(LIB_SUFFIX) \
$(DIST)/lib/libgkxulbase_s.$(LIB_SUFFIX) \
$(DIST)/lib/libgkbase_s.$(LIB_SUFFIX) \
$(DIST)/lib/libgkxuloutliner_s.$(LIB_SUFFIX) \
$(NULL)
ifdef MOZ_PERF_METRICS

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

@ -73,6 +73,7 @@ LLIBS= \
$(DIST)\lib\layouthtmltable_s.lib \
$(DIST)\lib\layoutxulbase_s.lib \
$(DIST)\lib\layoutxulcontent_s.lib \
$(DIST)\lib\raptorxuloutliner_s.lib \
!ifdef MOZ_MATHML
$(DIST)\lib\layoutmathmlbase_s.lib \
$(DIST)\lib\layoutmathmlcontent_s.lib \

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

@ -199,6 +199,10 @@
#define NS_IFRAMEBOXOBJECT_CID \
{ 0x9580e69b, 0x8fd6, 0x414e, { 0x80, 0xcd, 0x3a, 0x18, 0x21, 0x1, 0x76, 0x46 } }
// {3B581FD4-3497-426c-8F61-3658B971CB80}
#define NS_OUTLINERBOXOBJECT_CID \
{ 0x3b581fd4, 0x3497, 0x426c, { 0x8f, 0x61, 0x36, 0x58, 0xb9, 0x71, 0xcb, 0x80 } }
// {8775CA39-4072-4cc0-92D3-A7C2B820089C}
#define NS_AUTOCOPYSERVICE_CID \
{ 0x8775ca39, 0x4072, 0x4cc0, { 0x92, 0xd3, 0xa7, 0xc2, 0xb8, 0x20, 0x8, 0x9c } }

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

@ -85,6 +85,7 @@ static NS_DEFINE_CID(kPopupSetBoxObjectCID, NS_POPUPSETBOXOBJECT_CID);
static NS_DEFINE_CID(kBrowserBoxObjectCID, NS_BROWSERBOXOBJECT_CID);
static NS_DEFINE_CID(kEditorBoxObjectCID, NS_EDITORBOXOBJECT_CID);
static NS_DEFINE_CID(kIFrameBoxObjectCID, NS_IFRAMEBOXOBJECT_CID);
static NS_DEFINE_CID(kOutlinerBoxObjectCID, NS_OUTLINERBOXOBJECT_CID);
static NS_DEFINE_CID(kAutoCopyServiceCID, NS_AUTOCOPYSERVICE_CID);
@ -102,6 +103,7 @@ extern nsresult NS_NewEditorBoxObject(nsIBoxObject** aResult);
extern nsresult NS_NewPopupSetBoxObject(nsIBoxObject** aResult);
extern nsresult NS_NewBrowserBoxObject(nsIBoxObject** aResult);
extern nsresult NS_NewIFrameBoxObject(nsIBoxObject** aResult);
extern nsresult NS_NewOutlinerBoxObject(nsIBoxObject** aResult);
extern nsresult NS_NewAutoCopyService(nsIAutoCopyService** aResult);
@ -291,6 +293,13 @@ nsLayoutFactory::CreateInstance(nsISupports *aOuter,
return res;
}
}
else if (mClassID.Equals(kOutlinerBoxObjectCID)) {
res = NS_NewOutlinerBoxObject((nsIBoxObject**) &inst);
if (NS_FAILED(res)) {
LOG_NEW_FAILURE("NS_NewOutlinerBoxObject", res);
return res;
}
}
else if (mClassID.Equals(kAutoCopyServiceCID)) {
res = NS_NewAutoCopyService((nsIAutoCopyService**) &inst);
if (NS_FAILED(res)) {

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

@ -344,6 +344,7 @@ static Components gComponents[] = {
{ "XUL Editor Box Object", NS_EDITORBOXOBJECT_CID, "@mozilla.org/layout/xul-boxobject-editor;1" },
{ "XUL Iframe Object", NS_IFRAMEBOXOBJECT_CID, "@mozilla.org/layout/xul-boxobject-iframe;1" },
{ "XUL ScrollBox Object", NS_SCROLLBOXOBJECT_CID, "@mozilla.org/layout/xul-boxobject-scrollbox;1" },
{ "XUL Outliner Box Object", NS_OUTLINERBOXOBJECT_CID, "@mozilla.org/layout/xul-boxobject-outliner;1" },
{ "AutoCopy Service", NS_AUTOCOPYSERVICE_CID, "@mozilla.org/autocopy;1" }
};

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

@ -169,6 +169,7 @@ static PRBool gNoisyInlineConstruction = PR_FALSE;
#include "nsXULTreeCellFrame.h"
#include "nsMenuFrame.h"
#include "nsPopupSetFrame.h"
#include "nsOutlinerColFrame.h"
//------------------------------------------------------------------
@ -247,6 +248,9 @@ NS_NewMenuBarFrame ( nsIPresShell* aPresShell, nsIFrame** aNewFrame );
nsresult
NS_NewTreeScrollPortFrame ( nsIPresShell* aPresShell, nsIFrame** aNewFrame );
nsresult
NS_NewOutlinerBodyFrame (nsIPresShell* aPresShell, nsIFrame** aNewFrame);
// grid
nsresult
NS_NewGridLayout ( nsIPresShell* aPresShell, nsCOMPtr<nsIBoxLayout>& aNewLayout );
@ -5261,7 +5265,7 @@ nsCSSFrameConstructor::ConstructXULFrame(nsIPresShell* aPresShell,
display->mDisplay == NS_STYLE_DISPLAY_BOX)) ||
aTag == nsXULAtoms::box || aTag == nsXULAtoms::vbox || aTag == nsXULAtoms::hbox || aTag == nsXULAtoms::tabbox ||
aTag == nsXULAtoms::tabpage || aTag == nsXULAtoms::tabcontrol
|| aTag == nsXULAtoms::treecell
|| aTag == nsXULAtoms::treecell || aTag == nsXULAtoms::outliner
) {
processChildren = PR_TRUE;
isReplaced = PR_TRUE;
@ -5404,7 +5408,15 @@ nsCSSFrameConstructor::ConstructXULFrame(nsIPresShell* aPresShell,
isReplaced = PR_TRUE;
rv = NS_NewSpringFrame(aPresShell, &newFrame);
}
else if (aTag == nsXULAtoms::outlinerbody) {
isReplaced = PR_TRUE;
rv = NS_NewOutlinerBodyFrame(aPresShell, &newFrame);
}
else if (aTag == nsXULAtoms::outlinercol) {
isReplaced = PR_TRUE;
processChildren = PR_TRUE;
rv = NS_NewOutlinerColFrame(aPresShell, &newFrame);
}
// TEXT CONSTRUCTION
else if (aTag == nsXULAtoms::text) {
processChildren = PR_TRUE;

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

@ -24,6 +24,8 @@ topsrcdir = @top_srcdir@
srcdir = @srcdir@
VPATH = @srcdir@
DIRS = outliner
include $(DEPTH)/config/autoconf.mk
MODULE = layout

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

@ -23,6 +23,7 @@ DEPTH=..\..\..\..
LIBRARY_NAME=layoutxulbase_s
MODULE=raptor
DIRS=outliner
DEFINES=-D_IMPL_NS_HTML -DWIN32_LEAN_AND_MEAN

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

@ -40,7 +40,7 @@ CPP_OBJS= \
.\$(OBJDIR)\nsOutlinerSelection.obj \
$(NULL)
EXPORTS = \
EXPORTS = nsOutlinerColFrame.h \
$(NULL)
LINCS=-I$(PUBLIC)\xpcom -I$(PUBLIC)\raptor -I$(PUBLIC)\js \

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

@ -16,6 +16,7 @@
@import url(chrome://global/skin/checkbox.css);
@import url(chrome://global/skin/radio.css);
@import url(chrome://global/skin/tree.css);
@import url(chrome://global/skin/outliner.css);
@import url(chrome://global/skin/splitter.css);
@import url(chrome://global/skin/radio.css);
@import url(chrome://global/skin/menubutton.css);

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

@ -179,6 +179,7 @@ modern.jar:
skin/modern/global/toolbar-menu-arrow-hover.gif (global/toolbar-menu-arrow-hover.gif)
skin/modern/global/toolbar-menu-arrow.gif (global/toolbar-menu-arrow.gif)
skin/modern/global/toolbar.css (global/toolbar.css)
skin/modern/global/outliner.css (global/outliner.css)
skin/modern/global/tree.css (global/tree.css)
skin/modern/global/wizardOverlay.css (global/wizardOverlay.css)
skin/modern/global/loading.gif (global/loading.gif)