diff --git a/mozilla/calendar/modules/network/capi/local/src/config.mk b/mozilla/calendar/modules/network/capi/local/src/config.mk index d327ba59616..cdd8d0bb4f6 100644 --- a/mozilla/calendar/modules/network/capi/local/src/config.mk +++ b/mozilla/calendar/modules/network/capi/local/src/config.mk @@ -13,7 +13,7 @@ # are specifed as dependencies within rules.mk. # -CFLAGS +=-D_IMPL_NS_CALENDAR -DLIBJULIAN -DNSPR20 -DNLS_DEFINE_STANDARD_TYPES=1 +CFLAGS +=-D_IMPL_NS_CALENDAR -DNSPR20 -DNLS_DEFINE_STANDARD_TYPES=1 INCLUDES += -I../inc -I$(GDEPTH)/include diff --git a/mozilla/calendar/modules/network/stream/src/config.mk b/mozilla/calendar/modules/network/stream/src/config.mk index 915c5f41267..819d53eb7ef 100644 --- a/mozilla/calendar/modules/network/stream/src/config.mk +++ b/mozilla/calendar/modules/network/stream/src/config.mk @@ -13,7 +13,7 @@ # are specifed as dependencies within rules.mk. # -CFLAGS +=-D_IMPL_NS_CALENDAR -DLIBJULIAN -DNSPR20 +CFLAGS +=-D_IMPL_NS_CALENDAR -DNSPR20 INCLUDES += -I../inc -I$(GDEPTH)/include LIBRARY_NAME = stream diff --git a/mozilla/calendar/modules/parser/calxml/src/config.mk b/mozilla/calendar/modules/parser/calxml/src/config.mk index 085b5fcfac9..f2a1c3ee455 100644 --- a/mozilla/calendar/modules/parser/calxml/src/config.mk +++ b/mozilla/calendar/modules/parser/calxml/src/config.mk @@ -13,7 +13,7 @@ # are specifed as dependencies within rules.mk. # -CFLAGS +=-D_IMPL_NS_CALENDAR -DLIBJULIAN -DNSPR20 +CFLAGS +=-D_IMPL_NS_CALENDAR -DNSPR20 INCLUDES += -I../inc -I$(GDEPTH)/include -I$(GDEPTH)/htmlparser/src LIBRARY_NAME = calxml diff --git a/mozilla/calendar/modules/parser/config.mk b/mozilla/calendar/modules/parser/config.mk index a3c690f4e96..2814471920b 100644 --- a/mozilla/calendar/modules/parser/config.mk +++ b/mozilla/calendar/modules/parser/config.mk @@ -13,7 +13,7 @@ # are specifed as dependencies within rules.mk. # -CFLAGS +=-D_IMPL_NS_CALENDAR +CFLAGS +=-D_IMPL_NS_CALENDAR LD_LIBS += \ raptorbase \ diff --git a/mozilla/calendar/modules/parser/core/src/config.mk b/mozilla/calendar/modules/parser/core/src/config.mk index ce9d648ec09..817ecc45be3 100644 --- a/mozilla/calendar/modules/parser/core/src/config.mk +++ b/mozilla/calendar/modules/parser/core/src/config.mk @@ -13,7 +13,7 @@ # are specifed as dependencies within rules.mk. # -CFLAGS +=-D_IMPL_NS_CALENDAR -DNSPR20 +CFLAGS +=-D_IMPL_NS_CALENDAR -DNSPR20 INCLUDES += -I../inc -I$(GDEPTH)/include LIBRARY_NAME = core diff --git a/mozilla/calendar/modules/shell/inc/nsCalendarContainer.h b/mozilla/calendar/modules/shell/inc/nsCalendarContainer.h index b6e3b1bfa42..80ea1371656 100644 --- a/mozilla/calendar/modules/shell/inc/nsCalendarContainer.h +++ b/mozilla/calendar/modules/shell/inc/nsCalendarContainer.h @@ -29,6 +29,7 @@ #include "nsIStreamListener.h" #include "nsIMenuManager.h" #include "nsICalToolkit.h" +#include "nsIViewManager.h" class nsCalendarContainer : public nsICalendarContainer { @@ -87,6 +88,7 @@ private: nsICalendarWidget * mCalendarWidget; nsIXPFCCanvas * mRootUI; nsICalToolkit * mToolkit; + nsIViewManager* mViewManager; }; diff --git a/mozilla/calendar/modules/shell/src/config.mk b/mozilla/calendar/modules/shell/src/config.mk index a7a67247a99..4f614ff9f04 100644 --- a/mozilla/calendar/modules/shell/src/config.mk +++ b/mozilla/calendar/modules/shell/src/config.mk @@ -13,7 +13,7 @@ # are specifed as dependencies within rules.mk. # -CFLAGS +=-D_IMPL_NS_CALENDAR -DLIBJULIAN -DNSPR20 -I$(GDEPTH)/include +CFLAGS +=-D_IMPL_NS_CALENDAR -DNSPR20 -I$(GDEPTH)/include PROGRAM = trex diff --git a/mozilla/calendar/modules/shell/src/nsCalendarContainer.cpp b/mozilla/calendar/modules/shell/src/nsCalendarContainer.cpp index fdde82f77db..002ea9be068 100644 --- a/mozilla/calendar/modules/shell/src/nsCalendarContainer.cpp +++ b/mozilla/calendar/modules/shell/src/nsCalendarContainer.cpp @@ -28,6 +28,8 @@ #include "nsCalShellCIID.h" #include "nscalcids.h" #include "nsBoxLayout.h" +#include "nsViewsCID.h" +#include "nsIViewManager.h" // XXX: This code should use XML for defining the Root UI. We need to // implement the stream manager first to do this, then lots of @@ -42,6 +44,8 @@ static NS_DEFINE_IID(kCXPFCContentSink, NS_XPFCXMLCONTENTSINK_IID); static NS_DEFINE_IID(kCXPFCCommandServerCID, NS_XPFC_COMMAND_SERVER_CID); static NS_DEFINE_IID(kCXPFCHTMLCanvasCID, NS_XPFC_HTML_CANVAS_CID); +static NS_DEFINE_IID(kViewManagerCID, NS_VIEW_MANAGER_CID); +static NS_DEFINE_IID(kIViewManagerIID, NS_IVIEWMANAGER_IID); // hardcode names of dll's #ifdef NS_WIN32 @@ -65,6 +69,7 @@ nsCalendarContainer::nsCalendarContainer() mRootUI = nsnull; mToolkit = nsnull; mToolbarManager = nsnull; + mViewManager = nsnull; } NS_IMPL_QUERY_INTERFACE(nsCalendarContainer, kICalContainerIID) @@ -73,6 +78,7 @@ NS_IMPL_RELEASE(nsCalendarContainer) nsCalendarContainer::~nsCalendarContainer() { + NS_IF_RELEASE(mViewManager); NS_IF_RELEASE(mMenuManager); NS_IF_RELEASE(mCalendarWidget); NS_IF_RELEASE(mRootUI); @@ -119,6 +125,21 @@ nsresult nsCalendarContainer::Init(nsIWidget * aParent, mMenuManager->Init(); + /* + * Create the view manager + */ + + res = nsRepository::CreateInstance(kViewManagerCID, + nsnull, + kIViewManagerIID, + (void **)&mViewManager); + + + if (NS_OK != res) + return res ; + + mViewManager->Init(aParent->GetDeviceContext()); + /* * Create the Root UI */ diff --git a/mozilla/calendar/modules/test/src/config.mk b/mozilla/calendar/modules/test/src/config.mk index f34a1d8877d..76eac2d43b1 100644 --- a/mozilla/calendar/modules/test/src/config.mk +++ b/mozilla/calendar/modules/test/src/config.mk @@ -13,7 +13,7 @@ # are specifed as dependencies within rules.mk. # -CFLAGS +=-D_IMPL_NS_TREXTEST -DNSPR20 -I$(GDEPTH)/include +CFLAGS +=-D_IMPL_NS_TREXTEST -DNSPR20 -I$(GDEPTH)/include PROGRAM = trextest diff --git a/mozilla/calendar/modules/ui/canvas/src/config.mk b/mozilla/calendar/modules/ui/canvas/src/config.mk index 26268700cd0..4808aa54560 100644 --- a/mozilla/calendar/modules/ui/canvas/src/config.mk +++ b/mozilla/calendar/modules/ui/canvas/src/config.mk @@ -13,7 +13,7 @@ # are specifed as dependencies within rules.mk. # -CFLAGS +=-D_IMPL_NS_CALENDAR -DLIBJULIAN -DNSPR20 +CFLAGS +=-D_IMPL_NS_CALENDAR -DNSPR20 INCLUDES += -I../inc -I$(GDEPTH)/include LIBRARY_NAME = canvas diff --git a/mozilla/calendar/modules/ui/command/src/config.mk b/mozilla/calendar/modules/ui/command/src/config.mk index 7fe05fe34d7..9f912b4e6b5 100644 --- a/mozilla/calendar/modules/ui/command/src/config.mk +++ b/mozilla/calendar/modules/ui/command/src/config.mk @@ -13,7 +13,7 @@ # are specifed as dependencies within rules.mk. # -CFLAGS +=-D_IMPL_NS_CALENDAR -DLIBJULIAN -DNSPR20 +CFLAGS +=-D_IMPL_NS_CALENDAR -DNSPR20 INCLUDES +=-I../inc -I$(GDEPTH)/include LIBRARY_NAME = command diff --git a/mozilla/calendar/modules/ui/component/src/config.mk b/mozilla/calendar/modules/ui/component/src/config.mk index 4af730e26cf..5d06b6a829f 100644 --- a/mozilla/calendar/modules/ui/component/src/config.mk +++ b/mozilla/calendar/modules/ui/component/src/config.mk @@ -13,7 +13,7 @@ # are specifed as dependencies within rules.mk. # -CFLAGS +=-D_IMPL_NS_CALENDAR +CFLAGS +=-D_IMPL_NS_CALENDAR INCLUDES +=-I../inc LIBRARY_NAME = component diff --git a/mozilla/calendar/modules/ui/config.mk b/mozilla/calendar/modules/ui/config.mk index 13a07b92c61..39fd450c5d0 100644 --- a/mozilla/calendar/modules/ui/config.mk +++ b/mozilla/calendar/modules/ui/config.mk @@ -13,7 +13,7 @@ # are specifed as dependencies within rules.mk. # -CFLAGS +=-D_IMPL_NS_CALENDAR +CFLAGS +=-D_IMPL_NS_CALENDAR LD_LIBS += \ raptorbase \ diff --git a/mozilla/calendar/modules/ui/context/src/config.mk b/mozilla/calendar/modules/ui/context/src/config.mk index 59aeb796754..eedecb354da 100644 --- a/mozilla/calendar/modules/ui/context/src/config.mk +++ b/mozilla/calendar/modules/ui/context/src/config.mk @@ -13,7 +13,7 @@ # are specifed as dependencies within rules.mk. # -CFLAGS +=-D_IMPL_NS_CALENDAR -DLIBJULIAN -DNSPR20 +CFLAGS +=-D_IMPL_NS_CALENDAR -DNSPR20 INCLUDES +=-I../inc -I$(GDEPTH)/include LIBRARY_NAME = context diff --git a/mozilla/calendar/modules/ui/controller/src/config.mk b/mozilla/calendar/modules/ui/controller/src/config.mk index 655d789158f..1a67660fdc9 100644 --- a/mozilla/calendar/modules/ui/controller/src/config.mk +++ b/mozilla/calendar/modules/ui/controller/src/config.mk @@ -13,7 +13,7 @@ # are specifed as dependencies within rules.mk. # -CFLAGS +=-D_IMPL_NS_CALENDAR -DLIBJULIAN -DNSPR20 +CFLAGS +=-D_IMPL_NS_CALENDAR -DNSPR20 INCLUDES +=-I../inc -I$(GDEPTH)/include LIBRARY_NAME = controller diff --git a/mozilla/calendar/modules/ui/core/src/config.mk b/mozilla/calendar/modules/ui/core/src/config.mk index ce9d648ec09..817ecc45be3 100644 --- a/mozilla/calendar/modules/ui/core/src/config.mk +++ b/mozilla/calendar/modules/ui/core/src/config.mk @@ -13,7 +13,7 @@ # are specifed as dependencies within rules.mk. # -CFLAGS +=-D_IMPL_NS_CALENDAR -DNSPR20 +CFLAGS +=-D_IMPL_NS_CALENDAR -DNSPR20 INCLUDES += -I../inc -I$(GDEPTH)/include LIBRARY_NAME = core diff --git a/mozilla/calendar/modules/ui/toolkit/src/config.mk b/mozilla/calendar/modules/ui/toolkit/src/config.mk index cc09e05d004..9fa708f52f2 100644 --- a/mozilla/calendar/modules/ui/toolkit/src/config.mk +++ b/mozilla/calendar/modules/ui/toolkit/src/config.mk @@ -13,7 +13,7 @@ # are specifed as dependencies within rules.mk. # -CFLAGS +=-D_IMPL_NS_CALENDAR +CFLAGS +=-D_IMPL_NS_CALENDAR INCLUDES +=-I../inc -I$(GDEPTH)/include LIBRARY_NAME = toolkit diff --git a/mozilla/calendar/modules/util/src/config.mk b/mozilla/calendar/modules/util/src/config.mk index c7c6ade2751..5df12257e56 100644 --- a/mozilla/calendar/modules/util/src/config.mk +++ b/mozilla/calendar/modules/util/src/config.mk @@ -13,7 +13,7 @@ # are specifed as dependencies within rules.mk. # -CFLAGS +=-D_IMPL_NS_CALENDAR -DLIBJULIAN -DNSPR20 +CFLAGS +=-D_IMPL_NS_CALENDAR -DNSPR20 INCLUDES +=-I../inc -I$(GDEPTH)/include LIBRARY_NAME = util diff --git a/mozilla/xpfc/canvas/inc/nsXPFCCanvas.h b/mozilla/xpfc/canvas/inc/nsXPFCCanvas.h index 05ea7d60b60..fd61823a689 100644 --- a/mozilla/xpfc/canvas/inc/nsXPFCCanvas.h +++ b/mozilla/xpfc/canvas/inc/nsXPFCCanvas.h @@ -40,11 +40,14 @@ #include "nsIImageGroup.h" #include "nsIImageObserver.h" #include "nsIImageRequest.h" +#include "nsIView.h" +#include "nsIViewObserver.h" CLASS_EXPORT_XPFC nsXPFCCanvas : public nsIXPFCCanvas, public nsIXPFCObserver, public nsIXMLParserObject, - public nsIImageRequestObserver + public nsIImageRequestObserver, + public nsIViewObserver { public: @@ -225,6 +228,18 @@ public: virtual void NotifyError(nsIImageRequest *aImageRequest, nsImageError aErrorType); + + // nsIViewObserver Interfaces + NS_IMETHOD Paint(nsIView * aView, + nsIRenderingContext& aRenderingContext, + const nsRect& aDirtyRect); + NS_IMETHOD HandleEvent(nsIView * aView, + nsGUIEvent* aEvent, + nsEventStatus& aEventStatus); + NS_IMETHOD Scrolled(nsIView * aView); + NS_IMETHOD ResizeReflow(nsIView * aView, nscoord aWidth, nscoord aHeight); + + #if defined(DEBUG) && defined(XP_PC) NS_IMETHOD DumpCanvas(FILE * f, PRUint32 indent) ; #endif diff --git a/mozilla/xpfc/canvas/src/Makefile b/mozilla/xpfc/canvas/src/Makefile index ea3f7f6ed86..e2dccd0bc5e 100644 --- a/mozilla/xpfc/canvas/src/Makefile +++ b/mozilla/xpfc/canvas/src/Makefile @@ -40,6 +40,7 @@ include config.mk include $(GDEPTH)/gconfig/ruleset.mk include $(GDEPTH)/gconfig/rules.mk + ####################################################################### # (6) Execute "component" rules. (OPTIONAL) # ####################################################################### @@ -50,4 +51,3 @@ include $(GDEPTH)/gconfig/rules.mk # (7) Execute "local" rules. (OPTIONAL). # ####################################################################### - diff --git a/mozilla/xpfc/canvas/src/config.mk b/mozilla/xpfc/canvas/src/config.mk index 315c608a00a..b59de81492f 100644 --- a/mozilla/xpfc/canvas/src/config.mk +++ b/mozilla/xpfc/canvas/src/config.mk @@ -22,3 +22,4 @@ LIBRARY_VERSION = 10 ARCHIVE_ONLY = 1 TARGETS = $(LIBRARY) + diff --git a/mozilla/xpfc/canvas/src/nsXPFCCanvas.cpp b/mozilla/xpfc/canvas/src/nsXPFCCanvas.cpp index d89672d3681..c2a35299168 100644 --- a/mozilla/xpfc/canvas/src/nsXPFCCanvas.cpp +++ b/mozilla/xpfc/canvas/src/nsXPFCCanvas.cpp @@ -39,6 +39,7 @@ #include "nsXPFCMethodInvokerCommand.h" #include "nsXPFCToolkit.h" +#include "nsIViewObserver.h" #include "nsIButton.h" #include "nsITabWidget.h" @@ -142,10 +143,11 @@ nsresult nsXPFCCanvas::AggregatedQueryInterface(const nsIID &aIID, return NS_ERROR_NULL_POINTER; } - static NS_DEFINE_IID(kCXPFCCanvasIID, NS_XPFC_CANVAS_CID); - static NS_DEFINE_IID(kIXPFCCanvasIID, NS_IXPFC_CANVAS_IID); - static NS_DEFINE_IID(kISupportsIID, NS_ISUPPORTS_IID); - static NS_DEFINE_IID(kClassIID, kIXPFCCanvasIID); + static NS_DEFINE_IID(kCXPFCCanvasIID, NS_XPFC_CANVAS_CID); + static NS_DEFINE_IID(kIXPFCCanvasIID, NS_IXPFC_CANVAS_IID); + static NS_DEFINE_IID(kIViewObserverIID, NS_IVIEWOBSERVER_IID); + static NS_DEFINE_IID(kISupportsIID, NS_ISUPPORTS_IID); + static NS_DEFINE_IID(kClassIID, kIXPFCCanvasIID); if (aIID.Equals(kClassIID)) { *aInstancePtr = (void*)((nsIXPFCCanvas*)this); @@ -167,6 +169,11 @@ nsresult nsXPFCCanvas::AggregatedQueryInterface(const nsIID &aIID, AddRef(); return NS_OK; } + if (aIID.Equals(kIViewObserverIID)) { + *aInstancePtr = (void*)((nsIViewObserver*)this); + AddRef(); + return NS_OK; + } if (aIID.Equals(kISupportsIID)) { *aInstancePtr = (void*) ((nsISupports *)&fAggregated); AddRef(); @@ -2009,19 +2016,44 @@ PRBool nsXPFCCanvas::PopState(nsIRenderingContext * aRenderingContext) return (aRenderingContext->PopState()); } -void -nsXPFCCanvas::Notify(nsIImageRequest *aImageRequest, - nsIImage *aImage, - nsImageNotification aNotificationType, - PRInt32 aParam1, PRInt32 aParam2, - void *aParam3) +void nsXPFCCanvas::Notify(nsIImageRequest *aImageRequest, + nsIImage *aImage, + nsImageNotification aNotificationType, + PRInt32 aParam1, PRInt32 aParam2, + void *aParam3) { return ; } -void -nsXPFCCanvas::NotifyError(nsIImageRequest *aImageRequest, - nsImageError aErrorType) +void nsXPFCCanvas::NotifyError(nsIImageRequest *aImageRequest, + nsImageError aErrorType) { return ; } + + + +nsresult nsXPFCCanvas::Paint(nsIView * aView, + nsIRenderingContext& aRenderingContext, + const nsRect& aDirtyRect) +{ + return NS_OK; +} + +nsresult nsXPFCCanvas::HandleEvent(nsIView * aView, + nsGUIEvent* aEvent, + nsEventStatus& aEventStatus) +{ + return NS_OK; +} + +nsresult nsXPFCCanvas::Scrolled(nsIView * aView) +{ + return NS_OK; +} + +nsresult nsXPFCCanvas::ResizeReflow(nsIView * aView, nscoord aWidth, nscoord aHeight) +{ + return NS_OK; +} +