From 7ccaf178ccd797e22f2ff0f6ff8da7d869b54468 Mon Sep 17 00:00:00 2001 From: "rods%netscape.com" Date: Thu, 15 Oct 1998 21:30:32 +0000 Subject: [PATCH] Moved the cross-platform widgets into their own directory. Moved the platform specific factories into the new "build" directory. The "build" directory now links the spwidgets and the platforms specific widgets together. --- widget/src/Makefile | 3 +- widget/src/build/Makefile | 56 +++++++++++++++++++ widget/src/build/dlldeps.cpp | 29 ++++++++++ .../nsMotifWidgetFactory.cpp} | 11 ++-- .../src/{motif => build}/nsWidgetSupport.cpp | 0 widget/src/motif/Makefile | 24 ++------ widget/src/motif/nsAppShell.cpp | 7 ++- widget/src/motif/nsAppShell.h | 3 + widget/src/motif/nsWindow.cpp | 20 ++++++- widget/src/motif/nsXtEventHandler.cpp | 2 - widget/src/{windows => xpwidgets}/Makefile | 31 +++++++++- widget/src/{ => xpwidgets}/nsBaseWidget.cpp | 0 widget/src/{ => xpwidgets}/nsBaseWidget.h | 0 widget/src/{ => xpwidgets}/nsImageButton.cpp | 11 +++- widget/src/{ => xpwidgets}/nsImageButton.h | 0 widget/src/{ => xpwidgets}/nsMenuButton.cpp | 0 widget/src/{ => xpwidgets}/nsMenuButton.h | 0 widget/src/{ => xpwidgets}/nsToolbar.cpp | 0 widget/src/{ => xpwidgets}/nsToolbar.h | 0 .../{ => xpwidgets}/nsToolbarItemHolder.cpp | 0 .../src/{ => xpwidgets}/nsToolbarItemHolder.h | 0 .../src/{ => xpwidgets}/nsToolbarManager.cpp | 6 +- widget/src/{ => xpwidgets}/nsToolbarManager.h | 0 23 files changed, 166 insertions(+), 37 deletions(-) create mode 100644 widget/src/build/Makefile create mode 100644 widget/src/build/dlldeps.cpp rename widget/src/{motif/nsWidgetFactory.cpp => build/nsMotifWidgetFactory.cpp} (98%) rename widget/src/{motif => build}/nsWidgetSupport.cpp (100%) rename widget/src/{windows => xpwidgets}/Makefile (56%) rename widget/src/{ => xpwidgets}/nsBaseWidget.cpp (100%) rename widget/src/{ => xpwidgets}/nsBaseWidget.h (100%) rename widget/src/{ => xpwidgets}/nsImageButton.cpp (98%) rename widget/src/{ => xpwidgets}/nsImageButton.h (100%) rename widget/src/{ => xpwidgets}/nsMenuButton.cpp (100%) rename widget/src/{ => xpwidgets}/nsMenuButton.h (100%) rename widget/src/{ => xpwidgets}/nsToolbar.cpp (100%) rename widget/src/{ => xpwidgets}/nsToolbar.h (100%) rename widget/src/{ => xpwidgets}/nsToolbarItemHolder.cpp (100%) rename widget/src/{ => xpwidgets}/nsToolbarItemHolder.h (100%) rename widget/src/{ => xpwidgets}/nsToolbarManager.cpp (99%) rename widget/src/{ => xpwidgets}/nsToolbarManager.h (100%) diff --git a/widget/src/Makefile b/widget/src/Makefile index fbd33e639ed7..d4e684873527 100644 --- a/widget/src/Makefile +++ b/widget/src/Makefile @@ -20,7 +20,7 @@ DEPTH=../.. ifeq ($(OS_TARGET),Rhapsody) DIRS = rhapsody else -DIRS = motif +DIRS = xpwidgets motif build endif include $(DEPTH)/config/config.mk @@ -28,3 +28,4 @@ include $(DEPTH)/config/config.mk TARGET = $(LIBRARY) include $(DEPTH)/config/rules.mk + diff --git a/widget/src/build/Makefile b/widget/src/build/Makefile new file mode 100644 index 000000000000..55bd75a24178 --- /dev/null +++ b/widget/src/build/Makefile @@ -0,0 +1,56 @@ +#!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 = ../../.. + +include $(DEPTH)/config/config.mk + +LIBRARY_NAME = widgetunix + +MODULE=raptor + +REQUIRES=util img xpcom raptor netlib + +INCLUDES+= -I../xpwidgets -I../motif -I. + +CPPSRCS=dlldeps.cpp nsWidgetSupport.cpp nsMotifWidgetFactory.cpp + +ifeq ($(OS_ARCH),IRIX) +LD = $(CCC) +LD_ALL = -all +LD_NONE = -none +endif + +EXTRA_DSO_LDOPTS+=\ + $(DIST)/lib/libraptorwidgetunix_s.a \ + $(DIST)/lib/libraptorbasewidget_s.a \ + $(DIST)/bin/libxpcom.so \ + $(DIST)/bin/libraptorbase.so \ + $(DIST)/bin/libreg.so \ + $(LIBNSPR)\ + $(DIST)/lib/libplc21.a + +# This should really be done properly in 'config' +ifeq ($(OS_ARCH),Linux) +EXTRA_DSO_LDOPTS+=\ + -L/usr/X11R6/lib -lX11 -lm +else +EXTRA_DSO_LDOPTS+= -lXm -lXt -lX11 -lm +endif + +include $(DEPTH)/config/rules.mk + diff --git a/widget/src/build/dlldeps.cpp b/widget/src/build/dlldeps.cpp new file mode 100644 index 000000000000..95f2b88222df --- /dev/null +++ b/widget/src/build/dlldeps.cpp @@ -0,0 +1,29 @@ +/* -*- 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. + */ + +// Force references to all of the symbols that we want exported from +// the dll that are located in the .lib files we link with + +#include "Xm/Xm.h" + +XtAppContext gAppContext; + +void XXXNeverCalled() +{ + gAppContext = NULL; +} diff --git a/widget/src/motif/nsWidgetFactory.cpp b/widget/src/build/nsMotifWidgetFactory.cpp similarity index 98% rename from widget/src/motif/nsWidgetFactory.cpp rename to widget/src/build/nsMotifWidgetFactory.cpp index 7104bc50b80e..f39eee8757d4 100644 --- a/widget/src/motif/nsWidgetFactory.cpp +++ b/widget/src/build/nsMotifWidgetFactory.cpp @@ -41,13 +41,13 @@ #include "nsMenu.h" #include "nsMenuItem.h" #include "nsPopUpMenu.h" -/* XXX Not checked in yet + #include "nsImageButton.h" #include "nsMenuButton.h" #include "nsToolbar.h" #include "nsToolbarManager.h" #include "nsToolbarItemHolder.h" -*/ + static NS_DEFINE_IID(kCWindow, NS_WINDOW_CID); @@ -80,13 +80,12 @@ static NS_DEFINE_IID(kCMenuBar, NS_MENUBAR_CID); static NS_DEFINE_IID(kCMenu, NS_MENU_CID); static NS_DEFINE_IID(kCMenuItem, NS_MENUITEM_CID); static NS_DEFINE_IID(kCPopUpMenu, NS_POPUPMENU_CID); -/* XXX Not checked in yet + static NS_DEFINE_IID(kCImageButton, NS_IMAGEBUTTON_CID); static NS_DEFINE_IID(kCToolBar, NS_TOOLBAR_CID); static NS_DEFINE_IID(kCToolBarManager, NS_TOOLBARMANAGER_CID); static NS_DEFINE_IID(kCToolBarItemHolder, NS_TOOLBARITEMHOLDER_CID); static NS_DEFINE_IID(kCMenuButton, NS_MENUBUTTON_CID); -*/ static NS_DEFINE_IID(kISupportsIID, NS_ISUPPORTS_IID); static NS_DEFINE_IID(kIFactoryIID, NS_IFACTORY_IID); @@ -216,8 +215,8 @@ nsresult nsWidgetFactory::CreateInstance(nsISupports *aOuter, else if (mClassID.Equals(kCMenuItem)) { inst = (nsISupports*)new nsMenuItem(); } - /* XXX Not checked in yet inst = (nsISupports*)(nsWindow*)new nsImageButton(); else if (mClassID.Equals(kCImageButton)) { + inst = (nsISupports*)(nsWindow*)new nsImageButton(); } else if (mClassID.Equals(kCMenuButton)) { inst = (nsISupports*)(nsWindow*)new nsMenuButton(); @@ -231,7 +230,7 @@ nsresult nsWidgetFactory::CreateInstance(nsISupports *aOuter, else if (mClassID.Equals(kCToolBarItemHolder)) { inst = (nsISupports*)(nsIToolbarItemHolder *) new nsToolbarItemHolder(); } - */ + else if (mClassID.Equals(kCPopUpMenu)) { inst = (nsISupports*)new nsPopUpMenu(); } diff --git a/widget/src/motif/nsWidgetSupport.cpp b/widget/src/build/nsWidgetSupport.cpp similarity index 100% rename from widget/src/motif/nsWidgetSupport.cpp rename to widget/src/build/nsWidgetSupport.cpp diff --git a/widget/src/motif/Makefile b/widget/src/motif/Makefile index a2432086af09..c00788126271 100644 --- a/widget/src/motif/Makefile +++ b/widget/src/motif/Makefile @@ -20,7 +20,7 @@ DEPTH = ../../.. include $(DEPTH)/config/config.mk -LIBRARY_NAME = widgetunix +LIBRARY_NAME = raptorwidgetunix_s MODULE=raptor @@ -28,27 +28,13 @@ REQUIRES=util img xpcom raptor netlib DEFINES = -D_IMPL_NS_WIDGET -EXTRA_DSO_LDOPTS+=\ - $(DIST)/bin/libxpcom.so \ - $(DIST)/bin/libraptorbase.so \ - $(DIST)/bin/libreg.so \ - $(LIBNSPR)\ - $(DIST)/lib/libplc21.a - -# This should really be done properly in 'config' -ifeq ($(OS_ARCH),Linux) -EXTRA_DSO_LDOPTS+=\ - -L/usr/X11R6/lib -lX11 -lm -else -EXTRA_DSO_LDOPTS+= -lXm -lXt -lX11 -lm -endif +INCLUDES+= -I../xpwidgets -I../motif -I. CPPSRCS= \ nsMenuBar.cpp \ nsMenu.cpp \ nsMenuItem.cpp \ nsPopUpMenu.cpp \ - nsWidgetSupport.cpp \ nsComboBox.cpp \ nsTextHelper.cpp \ nsTextAreaWidget.cpp \ @@ -64,14 +50,12 @@ CPPSRCS= \ nsToolkit.cpp \ nsLabel.cpp \ nsDialog.cpp \ - nsWidgetFactory.cpp \ nsWindow.cpp \ nsXtEventHandler.cpp \ nsXtManageWidget.cpp CPP_OBJS= \ ./$(OBJDIR)/nsPopUpMenu.o \ - ./$(OBJDIR)/nsWidgetSupport.o \ ./$(OBJDIR)/nsComboBox.o \ ./$(OBJDIR)/nsFileWidget.o \ ./$(OBJDIR)/nsTextHelper.o \ @@ -89,15 +73,15 @@ CPP_OBJS= \ ./$(OBJDIR)/nsToolkit.o \ ./$(OBJDIR)/nsLabel.o \ ./$(OBJDIR)/nsDialog.o \ - ./$(OBJDIR)/nsWidgetFactory.o \ ./$(OBJDIR)/nsWindow.o \ ./$(OBJDIR)/nsXtEventHandler.o \ $(NULL) -include $(DEPTH)/config/config.mk TARGETS = $(LIBRARY) +MKSHLIB := + include $(DEPTH)/config/rules.mk diff --git a/widget/src/motif/nsAppShell.cpp b/widget/src/motif/nsAppShell.cpp index 414f27504c3c..4f63b2cde89b 100644 --- a/widget/src/motif/nsAppShell.cpp +++ b/widget/src/motif/nsAppShell.cpp @@ -20,7 +20,10 @@ #include "nsIAppShell.h" #include -XtAppContext gAppContext; +extern XtAppContext gAppContext; + +//XtAppContext nsAppShell::gAppContext = NULL; + //------------------------------------------------------------------------- // @@ -34,6 +37,7 @@ NS_IMPL_ISUPPORTS(nsAppShell,kIAppShellIID); NS_METHOD nsAppShell::SetDispatchListener(nsDispatchListener* aDispatchListener) { mDispatchListener = aDispatchListener; + return NS_OK; } @@ -48,6 +52,7 @@ NS_METHOD nsAppShell::Create(int* argc, char ** argv) XtSetLanguageProc(NULL, NULL, NULL); mTopLevel = XtVaAppInitialize(&mAppContext, "nsAppShell", NULL, 0, argc, argv, NULL, NULL); + // XXX This is BAD -- needs to be fixed gAppContext = mAppContext; return NS_OK; } diff --git a/widget/src/motif/nsAppShell.h b/widget/src/motif/nsAppShell.h index 13baea234c21..7f0ad6fd3b26 100644 --- a/widget/src/motif/nsAppShell.h +++ b/widget/src/motif/nsAppShell.h @@ -46,6 +46,9 @@ class nsAppShell : public nsIAppShell NS_IMETHOD Exit(); NS_IMETHOD SetDispatchListener(nsDispatchListener* aDispatchListener); virtual void* GetNativeData(PRUint32 aDataType); + + // Public global + //static XtAppContext gAppContext; }; #endif // nsAppShell_h__ diff --git a/widget/src/motif/nsWindow.cpp b/widget/src/motif/nsWindow.cpp index 9d8524c3921e..82954398538f 100644 --- a/widget/src/motif/nsWindow.cpp +++ b/widget/src/motif/nsWindow.cpp @@ -27,6 +27,7 @@ #include "nsGfxCIID.h" #include "nsXtEventHandler.h" +#include "nsAppShell.h" #include "X11/Xlib.h" #include "Xm/Xm.h" @@ -48,12 +49,12 @@ Widget gFirstTopLevelWindow = 0; //XXX: REMOVE Kludge should not be needed. -extern XtAppContext gAppContext; static NS_DEFINE_IID(kIWidgetIID, NS_IWIDGET_IID); NS_IMPL_ADDREF(nsWindow) NS_IMPL_RELEASE(nsWindow) +extern XtAppContext gAppContext; //------------------------------------------------------------------------- // @@ -261,6 +262,7 @@ void nsWindow::CreateMainWindow(nsNativeWidget aNativeParent, // save the event callback function mEventCallback = aHandleEventFunction; +printf("************* CreateMainWindow 0x%x\n", mEventCallback); InitDeviceContext(aContext, (Widget) aAppShell->GetNativeData(NS_NATIVE_SHELL)); @@ -337,6 +339,7 @@ void nsWindow::CreateChildWindow(nsNativeWidget aNativeParent, // save the event callback function mEventCallback = aHandleEventFunction; +printf("************* CreateChildWindow 0x%x\n", mEventCallback); InitDeviceContext(aContext, (Widget)aNativeParent); @@ -684,6 +687,7 @@ NS_METHOD nsWindow::Resize(PRUint32 aX, PRUint32 aY, PRUint32 aWidth, PRUint32 a mBounds.height = aHeight; XtVaSetValues(mWidget, XmNx, aX, XmNy, GetYCoord(aY), XmNwidth, aWidth, XmNheight, aHeight, nsnull); +printf("After nsWindow::Resize\n"); return NS_OK; } @@ -726,7 +730,12 @@ NS_METHOD nsWindow::SetFocus(void) //------------------------------------------------------------------------- void nsWindow::SetBounds(const nsRect &aRect) { - Resize(mBounds.x, mBounds.y, mBounds.width, mBounds.height, PR_TRUE); + mBounds.x = aRect.x; + mBounds.y = aRect.y; + mBounds.width = aRect.width; + mBounds.height = aRect.height; +printf("SetBounds\n"); + //Resize(mBounds.x, mBounds.y, mBounds.width, mBounds.height, PR_TRUE); } //------------------------------------------------------------------------- @@ -1231,7 +1240,9 @@ NS_IMETHODIMP nsWindow::DispatchEvent(nsGUIEvent* event, nsEventStatus & aStatus aStatus = nsEventStatus_eIgnore; if (nsnull != mEventCallback) { +printf("Before Dispatch 0x%x\n", mEventCallback); aStatus = (*mEventCallback)(event); +printf("After Dispatch\n"); } // Dispatch to event listener if event was not consumed @@ -1514,15 +1525,18 @@ void nsWindow_Refresh_Callback(XtPointer call_data) widgetWindow->SetBounds(bounds); widgetWindow->OnResize(event); - +printf("nsWindow_ResetResize_Callback 1\n"); nsPaintEvent pevent; pevent.message = NS_PAINT; pevent.widget = widgetWindow; pevent.time = 0; pevent.rect = (nsRect *)&bounds; +printf("nsWindow_ResetResize_Callback 2\n"); widgetWindow->OnPaint(pevent); +printf("nsWindow_ResetResize_Callback 3 0x%x\n", gAppContext); XtAppAddTimeOut(gAppContext, 50, (XtTimerCallbackProc)nsWindow_ResetResize_Callback, widgetWindow); +printf("nsWindow_ResetResize_Callback 4\n"); } // diff --git a/widget/src/motif/nsXtEventHandler.cpp b/widget/src/motif/nsXtEventHandler.cpp index a2976d4eb016..4e4d4ab2c402 100644 --- a/widget/src/motif/nsXtEventHandler.cpp +++ b/widget/src/motif/nsXtEventHandler.cpp @@ -32,8 +32,6 @@ #define DBG 0 -extern XtAppContext gAppContext; - struct nsKeyConverter { int vkCode; // Platform independent key code XID keysym; // X keysym key code diff --git a/widget/src/windows/Makefile b/widget/src/xpwidgets/Makefile similarity index 56% rename from widget/src/windows/Makefile rename to widget/src/xpwidgets/Makefile index f516bfbbe18e..5688d69cac30 100644 --- a/widget/src/windows/Makefile +++ b/widget/src/xpwidgets/Makefile @@ -15,9 +15,38 @@ # Copyright (C) 1998 Netscape Communications Corporation. All Rights # Reserved. +DEPTH = ../../.. -include manifest.mn include $(DEPTH)/config/config.mk +LIBRARY_NAME = raptorbasewidget_s + +#LCFLAGS=-D_IMPL_NS_WIDGET + +ifeq ($(OS_TARGET),Rhapsody) +INCLUDES += -I$(PUBLIC)/xpcom -I$(PUBLIC)/raptor -I../rhapsody +else +INCLUDES += -I../public -I$(PUBLIC)/xpcom -I$(PUBLIC)/raptor -I../motif -I. +endif + + +CPPSRCS=nsBaseWidget.cpp \ + nsMenuButton.cpp \ + nsToolbarItemHolder.cpp \ + nsToolbarManager.cpp \ + nsImageButton.cpp \ + nsToolbar.cpp \ + $(NULL) + +MODULE=raptor + +REQUIRES=util img xpcom raptor netlib + +TARGETS = $(LIBRARY) + + +MKSHLIB := + include $(DEPTH)/config/rules.mk + diff --git a/widget/src/nsBaseWidget.cpp b/widget/src/xpwidgets/nsBaseWidget.cpp similarity index 100% rename from widget/src/nsBaseWidget.cpp rename to widget/src/xpwidgets/nsBaseWidget.cpp diff --git a/widget/src/nsBaseWidget.h b/widget/src/xpwidgets/nsBaseWidget.h similarity index 100% rename from widget/src/nsBaseWidget.h rename to widget/src/xpwidgets/nsBaseWidget.h diff --git a/widget/src/nsImageButton.cpp b/widget/src/xpwidgets/nsImageButton.cpp similarity index 98% rename from widget/src/nsImageButton.cpp rename to widget/src/xpwidgets/nsImageButton.cpp index 925fa9e4e452..a21d274999bb 100644 --- a/widget/src/nsImageButton.cpp +++ b/widget/src/xpwidgets/nsImageButton.cpp @@ -50,10 +50,12 @@ const PRInt32 kAlignJustText = 0; const PRInt32 kAlignJustImage = 1; const PRInt32 kAlignBoth = 2; + //--------------------------------------------------------------- static nsEventStatus PR_CALLBACK HandleImageButtonEvent(nsGUIEvent *aEvent) { +printf("HandleImageButtonEvent\n"); nsEventStatus result = nsEventStatus_eIgnore; nsIImageButton * button; if (NS_OK == aEvent->widget->QueryInterface(kCIImageButtonIID,(void**)&button)) { @@ -139,8 +141,9 @@ NS_METHOD nsImageButton::Create(nsIWidget *aParent, nsIToolkit *aToolkit, nsWidgetInitData *aInitData) { + printf("nsImageButton::Create 0x%x 0x%x\n", aHandleEventFunction, HandleImageButtonEvent); return ChildWindow::Create(aParent, aRect, - nsnull != aHandleEventFunction ? aHandleEventFunction:HandleImageButtonEvent, + nsnull != aHandleEventFunction ? aHandleEventFunction: HandleImageButtonEvent, aContext, aAppShell, aToolkit, aInitData); } @@ -558,14 +561,18 @@ nsEventStatus nsImageButton::HandleEvent(nsGUIEvent *aEvent) rect.y = ((nsPaintEvent *)aEvent)->rect->y; rect.width = ((nsPaintEvent *)aEvent)->rect->width; rect.height = ((nsPaintEvent *)aEvent)->rect->height; - +printf("---> 1\n"); aEvent->widget->GetBounds(rect); rect.x = 0; rect.y = 0; +printf("---> 1 %x\n", ctx); ds = ctx->CreateDrawingSurface(&rect); +printf("---> 1\n"); if (ds == nsnull) { +printf("---> 1\n"); return nsEventStatus_eConsumeNoDefault; } +printf("---> 1\n"); ctx->SelectOffScreenDrawingSurface(ds); es = OnPaint((*((nsPaintEvent*)aEvent)->renderingContext),(*((nsPaintEvent*)aEvent)->rect)); diff --git a/widget/src/nsImageButton.h b/widget/src/xpwidgets/nsImageButton.h similarity index 100% rename from widget/src/nsImageButton.h rename to widget/src/xpwidgets/nsImageButton.h diff --git a/widget/src/nsMenuButton.cpp b/widget/src/xpwidgets/nsMenuButton.cpp similarity index 100% rename from widget/src/nsMenuButton.cpp rename to widget/src/xpwidgets/nsMenuButton.cpp diff --git a/widget/src/nsMenuButton.h b/widget/src/xpwidgets/nsMenuButton.h similarity index 100% rename from widget/src/nsMenuButton.h rename to widget/src/xpwidgets/nsMenuButton.h diff --git a/widget/src/nsToolbar.cpp b/widget/src/xpwidgets/nsToolbar.cpp similarity index 100% rename from widget/src/nsToolbar.cpp rename to widget/src/xpwidgets/nsToolbar.cpp diff --git a/widget/src/nsToolbar.h b/widget/src/xpwidgets/nsToolbar.h similarity index 100% rename from widget/src/nsToolbar.h rename to widget/src/xpwidgets/nsToolbar.h diff --git a/widget/src/nsToolbarItemHolder.cpp b/widget/src/xpwidgets/nsToolbarItemHolder.cpp similarity index 100% rename from widget/src/nsToolbarItemHolder.cpp rename to widget/src/xpwidgets/nsToolbarItemHolder.cpp diff --git a/widget/src/nsToolbarItemHolder.h b/widget/src/xpwidgets/nsToolbarItemHolder.h similarity index 100% rename from widget/src/nsToolbarItemHolder.h rename to widget/src/xpwidgets/nsToolbarItemHolder.h diff --git a/widget/src/nsToolbarManager.cpp b/widget/src/xpwidgets/nsToolbarManager.cpp similarity index 99% rename from widget/src/nsToolbarManager.cpp rename to widget/src/xpwidgets/nsToolbarManager.cpp index a7450384bcdd..0bce6cbbba28 100644 --- a/widget/src/nsToolbarManager.cpp +++ b/widget/src/xpwidgets/nsToolbarManager.cpp @@ -195,6 +195,7 @@ NS_METHOD nsToolbarManager::AddTabToManager(nsIToolbar * aToolbar, nsIWidget * widget; if (NS_OK == tab->QueryInterface(kIWidgetIID,(void**)&widget)) { +printf("Adding tab to Toolbar\n"); widget->Create(parent, rt, NULL, NULL); widget->Show(PR_TRUE); @@ -263,6 +264,7 @@ NS_METHOD nsToolbarManager::AddTabToToolbar(nsIToolbar * aToolbar) // and it can be put into the generic ToolbarItemHolder nsIWidget * widget; if (NS_OK == tab->QueryInterface(kIWidgetIID,(void**)&widget)) { +printf("Adding tab to Toolbar\n"); widget->Create(parent, rt, NULL, NULL); widget->Show(PR_TRUE); widget->SetClientData((void *)parent); @@ -295,13 +297,15 @@ NS_METHOD nsToolbarManager::AddTabToToolbar(nsIToolbar * aToolbar) //-------------------------------------------------------------------- NS_METHOD nsToolbarManager::AddToolbar(nsIToolbar* aToolbar) { +printf("In AddTabToToolbar\n"); mToolbars[mNumToolbars] = aToolbar; mNumToolbars++; // XXX should check here to make sure it isn't already added aToolbar->SetToolbarManager(this); - +printf("Before AddTabToToolbar\n"); AddTabToToolbar(aToolbar); +printf("After AddTabToToolbar\n"); NS_ADDREF(aToolbar); return NS_OK; diff --git a/widget/src/nsToolbarManager.h b/widget/src/xpwidgets/nsToolbarManager.h similarity index 100% rename from widget/src/nsToolbarManager.h rename to widget/src/xpwidgets/nsToolbarManager.h