mirror of
https://github.com/mozilla/gecko-dev.git
synced 2025-11-09 21:00:42 +02:00
Adding the menu bar frame.
This commit is contained in:
parent
d3e75f8262
commit
124721301b
6 changed files with 115 additions and 2 deletions
|
|
@ -130,6 +130,10 @@ NS_NewMenuPopupFrame ( nsIFrame** aNewFrame );
|
||||||
|
|
||||||
nsresult
|
nsresult
|
||||||
NS_NewMenuFrame ( nsIFrame** aNewFrame );
|
NS_NewMenuFrame ( nsIFrame** aNewFrame );
|
||||||
|
|
||||||
|
nsresult
|
||||||
|
NS_NewMenuBarFrame ( nsIFrame** aNewFrame );
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
//static NS_DEFINE_IID(kIStyleRuleIID, NS_ISTYLE_RULE_IID);
|
//static NS_DEFINE_IID(kIStyleRuleIID, NS_ISTYLE_RULE_IID);
|
||||||
|
|
@ -3035,7 +3039,7 @@ nsCSSFrameConstructor::ConstructXULFrame(nsIPresContext* aPresContext,
|
||||||
else if (aTag == nsXULAtoms::xpmenubar) {
|
else if (aTag == nsXULAtoms::xpmenubar) {
|
||||||
// XXX Will be a derived class toolbar frame.
|
// XXX Will be a derived class toolbar frame.
|
||||||
processChildren = PR_TRUE;
|
processChildren = PR_TRUE;
|
||||||
rv = NS_NewToolbarFrame(&newFrame);
|
rv = NS_NewMenuBarFrame(&newFrame);
|
||||||
}
|
}
|
||||||
else if (aTag == nsXULAtoms::xpmenubutton) {
|
else if (aTag == nsXULAtoms::xpmenubutton) {
|
||||||
// XXX Will be a derived class titledbutton frame
|
// XXX Will be a derived class titledbutton frame
|
||||||
|
|
|
||||||
|
|
@ -130,6 +130,10 @@ NS_NewMenuPopupFrame ( nsIFrame** aNewFrame );
|
||||||
|
|
||||||
nsresult
|
nsresult
|
||||||
NS_NewMenuFrame ( nsIFrame** aNewFrame );
|
NS_NewMenuFrame ( nsIFrame** aNewFrame );
|
||||||
|
|
||||||
|
nsresult
|
||||||
|
NS_NewMenuBarFrame ( nsIFrame** aNewFrame );
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
//static NS_DEFINE_IID(kIStyleRuleIID, NS_ISTYLE_RULE_IID);
|
//static NS_DEFINE_IID(kIStyleRuleIID, NS_ISTYLE_RULE_IID);
|
||||||
|
|
@ -3035,7 +3039,7 @@ nsCSSFrameConstructor::ConstructXULFrame(nsIPresContext* aPresContext,
|
||||||
else if (aTag == nsXULAtoms::xpmenubar) {
|
else if (aTag == nsXULAtoms::xpmenubar) {
|
||||||
// XXX Will be a derived class toolbar frame.
|
// XXX Will be a derived class toolbar frame.
|
||||||
processChildren = PR_TRUE;
|
processChildren = PR_TRUE;
|
||||||
rv = NS_NewToolbarFrame(&newFrame);
|
rv = NS_NewMenuBarFrame(&newFrame);
|
||||||
}
|
}
|
||||||
else if (aTag == nsXULAtoms::xpmenubutton) {
|
else if (aTag == nsXULAtoms::xpmenubutton) {
|
||||||
// XXX Will be a derived class titledbutton frame
|
// XXX Will be a derived class titledbutton frame
|
||||||
|
|
|
||||||
|
|
@ -60,6 +60,7 @@ CPPSRCS = \
|
||||||
nsToolbarItemFrame.cpp \
|
nsToolbarItemFrame.cpp \
|
||||||
nsMenuPopupFrame.cpp \
|
nsMenuPopupFrame.cpp \
|
||||||
nsMenuFrame.cpp \
|
nsMenuFrame.cpp \
|
||||||
|
nsMenuBarFrame.cpp \
|
||||||
$(NULL)
|
$(NULL)
|
||||||
|
|
||||||
include $(topsrcdir)/config/config.mk
|
include $(topsrcdir)/config/config.mk
|
||||||
|
|
|
||||||
|
|
@ -48,6 +48,7 @@ CPPSRCS= \
|
||||||
nsFontPickerFrame.cpp \
|
nsFontPickerFrame.cpp \
|
||||||
nsMenuPopupFrame.cpp \
|
nsMenuPopupFrame.cpp \
|
||||||
nsMenuFrame.cpp \
|
nsMenuFrame.cpp \
|
||||||
|
nsMenuBarFrame.cpp \
|
||||||
$(NULL)
|
$(NULL)
|
||||||
|
|
||||||
CPP_OBJS= \
|
CPP_OBJS= \
|
||||||
|
|
@ -75,6 +76,7 @@ CPP_OBJS= \
|
||||||
.\$(OBJDIR)\nsFontPickerFrame.obj \
|
.\$(OBJDIR)\nsFontPickerFrame.obj \
|
||||||
.\$(OBJDIR)\nsMenuPopupFrame.obj \
|
.\$(OBJDIR)\nsMenuPopupFrame.obj \
|
||||||
.\$(OBJDIR)\nsMenuFrame.obj \
|
.\$(OBJDIR)\nsMenuFrame.obj \
|
||||||
|
.\$(OBJDIR)\nsMenuBarFrame.obj \
|
||||||
$(NULL)
|
$(NULL)
|
||||||
|
|
||||||
EXPORTS = \
|
EXPORTS = \
|
||||||
|
|
|
||||||
58
layout/xul/base/src/nsMenuBarFrame.cpp
Normal file
58
layout/xul/base/src/nsMenuBarFrame.cpp
Normal file
|
|
@ -0,0 +1,58 @@
|
||||||
|
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*-
|
||||||
|
*
|
||||||
|
* The contents of this file are subject to the Netscape Public License
|
||||||
|
* Version 1.0 (the "NPL"); you may not use this file except in
|
||||||
|
* compliance with the NPL. You may obtain a copy of the NPL at
|
||||||
|
* http://www.mozilla.org/NPL/
|
||||||
|
*
|
||||||
|
* Software distributed under the NPL is distributed on an "AS IS" basis,
|
||||||
|
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL
|
||||||
|
* for the specific language governing rights and limitations under the
|
||||||
|
* NPL.
|
||||||
|
*
|
||||||
|
* The Initial Developer of this code under the NPL is Netscape
|
||||||
|
* Communications Corporation. Portions created by Netscape are
|
||||||
|
* Copyright (C) 1998 Netscape Communications Corporation. All Rights
|
||||||
|
* Reserved.
|
||||||
|
*/
|
||||||
|
|
||||||
|
|
||||||
|
#include "nsMenuBarFrame.h"
|
||||||
|
|
||||||
|
#include "nsIContent.h"
|
||||||
|
#include "prtypes.h"
|
||||||
|
#include "nsIAtom.h"
|
||||||
|
#include "nsIPresContext.h"
|
||||||
|
#include "nsIStyleContext.h"
|
||||||
|
#include "nsCSSRendering.h"
|
||||||
|
#include "nsINameSpaceManager.h"
|
||||||
|
|
||||||
|
|
||||||
|
//
|
||||||
|
// NS_NewMenuBarFrame
|
||||||
|
//
|
||||||
|
// Wrapper for creating a new menu Bar container
|
||||||
|
//
|
||||||
|
nsresult
|
||||||
|
NS_NewMenuBarFrame(nsIFrame** aNewFrame)
|
||||||
|
{
|
||||||
|
NS_PRECONDITION(aNewFrame, "null OUT ptr");
|
||||||
|
if (nsnull == aNewFrame) {
|
||||||
|
return NS_ERROR_NULL_POINTER;
|
||||||
|
}
|
||||||
|
nsMenuBarFrame* it = new nsMenuBarFrame;
|
||||||
|
if ( !it )
|
||||||
|
return NS_ERROR_OUT_OF_MEMORY;
|
||||||
|
*aNewFrame = it;
|
||||||
|
return NS_OK;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
//
|
||||||
|
// nsMenuBarFrame cntr
|
||||||
|
//
|
||||||
|
nsMenuBarFrame::nsMenuBarFrame()
|
||||||
|
{
|
||||||
|
|
||||||
|
} // cntr
|
||||||
|
|
||||||
44
layout/xul/base/src/nsMenuBarFrame.h
Normal file
44
layout/xul/base/src/nsMenuBarFrame.h
Normal file
|
|
@ -0,0 +1,44 @@
|
||||||
|
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*-
|
||||||
|
*
|
||||||
|
* The contents of this file are subject to the Netscape Public License
|
||||||
|
* Version 1.0 (the "NPL"); you may not use this file except in
|
||||||
|
* compliance with the NPL. You may obtain a copy of the NPL at
|
||||||
|
* http://www.mozilla.org/NPL/
|
||||||
|
*
|
||||||
|
* Software distributed under the NPL is distributed on an "AS IS" basis,
|
||||||
|
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL
|
||||||
|
* for the specific language governing rights and limitations under the
|
||||||
|
* NPL.
|
||||||
|
*
|
||||||
|
* The Initial Developer of this code under the NPL is Netscape
|
||||||
|
* Communications Corporation. Portions created by Netscape are
|
||||||
|
* Copyright (C) 1998 Netscape Communications Corporation. All Rights
|
||||||
|
* Reserved.
|
||||||
|
*/
|
||||||
|
|
||||||
|
//
|
||||||
|
// nsMenuBarFrame
|
||||||
|
//
|
||||||
|
|
||||||
|
#ifndef nsMenuBarFrame_h__
|
||||||
|
#define nsMenuBarFrame_h__
|
||||||
|
|
||||||
|
#include "prtypes.h"
|
||||||
|
#include "nsIAtom.h"
|
||||||
|
#include "nsCOMPtr.h"
|
||||||
|
|
||||||
|
#include "nsToolbarFrame.h"
|
||||||
|
|
||||||
|
nsresult NS_NewMenuBarFrame(nsIFrame** aResult) ;
|
||||||
|
|
||||||
|
|
||||||
|
class nsMenuBarFrame : public nsToolbarFrame
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
nsMenuBarFrame();
|
||||||
|
|
||||||
|
protected:
|
||||||
|
|
||||||
|
}; // class nsMenuBarFrame
|
||||||
|
|
||||||
|
#endif
|
||||||
Loading…
Reference in a new issue