From 702a43e7f876b0763e32777f5f622fe0fde4e34d Mon Sep 17 00:00:00 2001 From: "spider%netscape.com" Date: Thu, 6 Aug 1998 01:23:37 +0000 Subject: [PATCH] WIP: Menubar and Popup's git-svn-id: svn://10.0.0.236/trunk@7414 18797224-902f-48f8-a5cc-f745e15eee43 --- mozilla/shell/Makefile | 2 +- mozilla/shell/inc/Makefile | 29 ++++++++++++++++++ mozilla/shell/inc/makefile.win | 30 +++++++++++++++++++ mozilla/shell/inc/nsMenuBar.h | 48 ++++++++++++++++++++++++++++++ mozilla/shell/inc/nsMenuItem.h | 48 ++++++++++++++++++++++++++++++ mozilla/shell/makefile.win | 2 +- mozilla/shell/public/Makefile | 2 ++ mozilla/shell/public/makefile.win | 2 ++ mozilla/shell/public/nsIMenuBar.h | 44 +++++++++++++++++++++++++++ mozilla/shell/public/nsIMenuItem.h | 44 +++++++++++++++++++++++++++ mozilla/shell/src/Makefile | 4 +++ mozilla/shell/src/makefile.win | 4 +++ mozilla/shell/src/nsMenuBar.cpp | 37 +++++++++++++++++++++++ mozilla/shell/src/nsMenuItem.cpp | 37 +++++++++++++++++++++++ 14 files changed, 331 insertions(+), 2 deletions(-) create mode 100644 mozilla/shell/inc/Makefile create mode 100644 mozilla/shell/inc/makefile.win create mode 100644 mozilla/shell/inc/nsMenuBar.h create mode 100644 mozilla/shell/inc/nsMenuItem.h create mode 100644 mozilla/shell/public/nsIMenuBar.h create mode 100644 mozilla/shell/public/nsIMenuItem.h create mode 100644 mozilla/shell/src/nsMenuBar.cpp create mode 100644 mozilla/shell/src/nsMenuItem.cpp diff --git a/mozilla/shell/Makefile b/mozilla/shell/Makefile index def05c31f80..28a7bde906e 100644 --- a/mozilla/shell/Makefile +++ b/mozilla/shell/Makefile @@ -17,7 +17,7 @@ DEPTH = .. -DIRS = public src tests +DIRS = public inc src tests include $(DEPTH)/config/config.mk diff --git a/mozilla/shell/inc/Makefile b/mozilla/shell/inc/Makefile new file mode 100644 index 00000000000..a7e4a0bf661 --- /dev/null +++ b/mozilla/shell/inc/Makefile @@ -0,0 +1,29 @@ +#!gmake +# +# 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. + +DEPTH = ../.. + +MODULE = shell + +EXPORTS = \ + nsMenuBar.h \ + nsMenuItem.h \ + $(NULL) + +include $(DEPTH)/config/config.mk + +include $(DEPTH)/config/rules.mk diff --git a/mozilla/shell/inc/makefile.win b/mozilla/shell/inc/makefile.win new file mode 100644 index 00000000000..523b42da317 --- /dev/null +++ b/mozilla/shell/inc/makefile.win @@ -0,0 +1,30 @@ +#!nmake +# +# 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. + +DEPTH=..\.. + +IGNORE_MANIFEST=1 + +MODULE=shell + +EXPORTS = \ + nsMenuBar.h \ + nsMenuItem.h \ + $(NULL) + +include <$(DEPTH)\config\rules.mak> + diff --git a/mozilla/shell/inc/nsMenuBar.h b/mozilla/shell/inc/nsMenuBar.h new file mode 100644 index 00000000000..55db343c086 --- /dev/null +++ b/mozilla/shell/inc/nsMenuBar.h @@ -0,0 +1,48 @@ +/* -*- 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 "nsIMenuBar.h" + + +class nsMenuBar : public nsIMenuBar +{ + +public: + + /** + * Constructor and Destructor + */ + + nsMenuBar(); + ~nsMenuBar(); + + /** + * ISupports Interface + */ + NS_DECL_ISUPPORTS + + /** + * Initialize Method + * @result The result of the initialization, NS_OK if no errors + */ + NS_IMETHOD Init(); + + +}; + + diff --git a/mozilla/shell/inc/nsMenuItem.h b/mozilla/shell/inc/nsMenuItem.h new file mode 100644 index 00000000000..764ca34a259 --- /dev/null +++ b/mozilla/shell/inc/nsMenuItem.h @@ -0,0 +1,48 @@ +/* -*- 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 "nsIMenuItem.h" + + +class nsMenuItem : public nsIMenuItem +{ + +public: + + /** + * Constructor and Destructor + */ + + nsMenuItem(); + ~nsMenuItem(); + + /** + * ISupports Interface + */ + NS_DECL_ISUPPORTS + + /** + * Initialize Method + * @result The result of the initialization, NS_OK if no errors + */ + NS_IMETHOD Init(); + + +}; + + diff --git a/mozilla/shell/makefile.win b/mozilla/shell/makefile.win index 9b672228e7d..8e69535cc95 100644 --- a/mozilla/shell/makefile.win +++ b/mozilla/shell/makefile.win @@ -18,6 +18,6 @@ DEPTH=.. IGNORE_MANIFEST=1 -DIRS=public src tests +DIRS=public inc src tests include <$(DEPTH)\config\rules.mak> diff --git a/mozilla/shell/public/Makefile b/mozilla/shell/public/Makefile index 218650c1d49..87ab3cd508f 100644 --- a/mozilla/shell/public/Makefile +++ b/mozilla/shell/public/Makefile @@ -22,6 +22,8 @@ MODULE = shell EXPORTS = \ nsIApplicationShell.h \ nsIShellInstance.h \ + nsIMenuBar.h \ + nsIMenuItem.h \ nsshell.h \ $(NULL) diff --git a/mozilla/shell/public/makefile.win b/mozilla/shell/public/makefile.win index 74233a77a89..1ddf07bfa5a 100644 --- a/mozilla/shell/public/makefile.win +++ b/mozilla/shell/public/makefile.win @@ -24,6 +24,8 @@ MODULE=shell EXPORTS = \ nsIApplicationShell.h \ nsIShellInstance.h \ + nsIMenuBar.h \ + nsIMenuItem.h \ nsshell.h \ $(NULL) diff --git a/mozilla/shell/public/nsIMenuBar.h b/mozilla/shell/public/nsIMenuBar.h new file mode 100644 index 00000000000..ec6c467da49 --- /dev/null +++ b/mozilla/shell/public/nsIMenuBar.h @@ -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. + */ + +#ifndef nsIMenuBar_h___ +#define nsIMenuBar_h___ + +#include "nsISupports.h" + +// 52fb95f0-2cbe-11d2-9246-00805f8a7ab6 +#define NS_IMENUBAR_IID \ + { 0x52fb95f0, 0x2cbe, 0x11d2, \ + {0x92, 0x46, 0x00, 0x80, 0x5f, 0x8a, 0x7a, 0xb6} } + +class nsIMenuBar : public nsISupports +{ + +public: + + /** + * Initialize the MenuBar + * @result The result of the initialization, NS_Ok if no errors + */ + NS_IMETHOD Init() = 0; + + +}; + +#endif /* nsIMenuBar_h___ */ + diff --git a/mozilla/shell/public/nsIMenuItem.h b/mozilla/shell/public/nsIMenuItem.h new file mode 100644 index 00000000000..7dbb04201a7 --- /dev/null +++ b/mozilla/shell/public/nsIMenuItem.h @@ -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. + */ + +#ifndef nsIMenuItem_h___ +#define nsIMenuItem_h___ + +#include "nsISupports.h" + +// 8a400b00-2cbe-11d2-9246-00805f8a7ab6 +#define NS_IMENUITEM_IID \ + { 0x8a400b00, 0x2cbe, 0x11d2, \ + {0x92, 0x46, 0x00, 0x80, 0x5f, 0x8a, 0x7a, 0xb6} } + +class nsIMenuItem : public nsISupports +{ + +public: + + /** + * Initialize the MenuBar + * @result The result of the initialization, NS_Ok if no errors + */ + NS_IMETHOD Init() = 0; + + +}; + +#endif /* nsIMenuItem_h___ */ + diff --git a/mozilla/shell/src/Makefile b/mozilla/shell/src/Makefile index 63b527db6cc..e476efd3460 100644 --- a/mozilla/shell/src/Makefile +++ b/mozilla/shell/src/Makefile @@ -60,11 +60,15 @@ EXPORTS = \ CPPSRCS= \ nsApplicationManager.cpp \ nsShellInstance.cpp \ + nsMenuItem.cpp \ + nsMenuBar.cpp \ $(NULL) CPP_OBJS= \ ./$(OBJDIR)/nsApplicationManager.o \ ./$(OBJDIR)/nsShellInstance.o \ + ./$(OBJDIR)/nsMenuItem.o \ + ./$(OBJDIR)/nsMenuBar.o \ $(NULL) diff --git a/mozilla/shell/src/makefile.win b/mozilla/shell/src/makefile.win index 5095206c796..811df53001f 100644 --- a/mozilla/shell/src/makefile.win +++ b/mozilla/shell/src/makefile.win @@ -30,11 +30,15 @@ EXPORTS = \ CPPSRCS= \ nsApplicationManager.cpp \ nsShellInstance.cpp \ + nsMenuBar.cpp \ + nsMenuItem.cpp \ $(NULL) CPP_OBJS= \ .\$(OBJDIR)\nsApplicationManager.obj \ .\$(OBJDIR)\nsShellInstance.obj \ + .\$(OBJDIR)\nsMenuBar.obj \ + .\$(OBJDIR)\nsMenuItem.obj \ $(NULL) LINCS=-I$(PUBLIC)\xpcom -I$(PUBLIC)\raptor \ diff --git a/mozilla/shell/src/nsMenuBar.cpp b/mozilla/shell/src/nsMenuBar.cpp new file mode 100644 index 00000000000..7175491df99 --- /dev/null +++ b/mozilla/shell/src/nsMenuBar.cpp @@ -0,0 +1,37 @@ +/* -*- 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 "nscore.h" +#include "nsMenuBar.h" + +nsMenuBar::nsMenuBar() +{ +} + +nsMenuBar::~nsMenuBar() +{ +} + +NS_DEFINE_IID(kIMenuBarIID, NS_IMENUBAR_IID); +NS_IMPL_ISUPPORTS(nsMenuBar,kIMenuBarIID); + +nsresult nsMenuBar::Init() +{ + return NS_OK; +} + diff --git a/mozilla/shell/src/nsMenuItem.cpp b/mozilla/shell/src/nsMenuItem.cpp new file mode 100644 index 00000000000..89379a546dd --- /dev/null +++ b/mozilla/shell/src/nsMenuItem.cpp @@ -0,0 +1,37 @@ +/* -*- 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 "nscore.h" +#include "nsMenuItem.h" + +nsMenuItem::nsMenuItem() +{ +} + +nsMenuItem::~nsMenuItem() +{ +} + +NS_DEFINE_IID(kIMenuItemIID, NS_IMENUITEM_IID); +NS_IMPL_ISUPPORTS(nsMenuItem,kIMenuItemIID); + +nsresult nsMenuItem::Init() +{ + return NS_OK; +} +