diff --git a/calendar/modules/shell/src/nsCalendarContainer.cpp b/calendar/modules/shell/src/nsCalendarContainer.cpp index 063e5b30a10a..01137efd2a67 100644 --- a/calendar/modules/shell/src/nsCalendarContainer.cpp +++ b/calendar/modules/shell/src/nsCalendarContainer.cpp @@ -52,6 +52,8 @@ static NS_DEFINE_IID(kIViewIID, NS_IVIEW_IID); static NS_DEFINE_IID(kViewCID, NS_VIEW_CID); static NS_DEFINE_IID(kWidgetCID, NS_CHILD_CID); +static NS_DEFINE_IID(kCCalCanvasCID, NS_CAL_CANVAS_CID); + // hardcode names of dll's #ifdef NS_WIN32 #define CALUI_DLL "calui10.dll" @@ -577,6 +579,7 @@ nsresult nsCalendarContainer::RegisterFactories() nsRepository::RegisterFactory(kCCalComponentCID, CALUI_DLL, PR_FALSE, PR_FALSE); nsRepository::RegisterFactory(kCCalContextControllerCID, CALUI_DLL, PR_FALSE, PR_FALSE); nsRepository::RegisterFactory(kCCalTimebarContextControllerCID, CALUI_DLL, PR_FALSE, PR_FALSE); + nsRepository::RegisterFactory(kCCalCanvasCID, CALUI_DLL, PR_FALSE, PR_FALSE); nsRepository::RegisterFactory(kCCalMonthContextControllerCID, CALUI_DLL, PR_FALSE, PR_FALSE); nsRepository::RegisterFactory(kCCalToolkitCID, CALUI_DLL, PR_FALSE, PR_FALSE); nsRepository::RegisterFactory(kCVectorCID, XPFC_DLL, PR_FALSE, PR_FALSE); diff --git a/calendar/modules/ui/canvas/inc/manifest.mn b/calendar/modules/ui/canvas/inc/manifest.mn index b90c2626c0fe..f05fd14b3c2b 100644 --- a/calendar/modules/ui/canvas/inc/manifest.mn +++ b/calendar/modules/ui/canvas/inc/manifest.mn @@ -23,6 +23,7 @@ PRIVATE_EXPORTS = \ nsCalTimebarTimeHeading.h \ nsCalTimebarScale.h \ nsCalMultiDayViewCanvas.h \ + nsCalCanvas.h \ nsCalDayViewCanvas.h \ events.h \ $(NULL) diff --git a/calendar/modules/ui/canvas/inc/nsCalTimebarCanvas.h b/calendar/modules/ui/canvas/inc/nsCalTimebarCanvas.h index cb8a1d5d7fc6..45270cbc2e27 100644 --- a/calendar/modules/ui/canvas/inc/nsCalTimebarCanvas.h +++ b/calendar/modules/ui/canvas/inc/nsCalTimebarCanvas.h @@ -23,8 +23,9 @@ #include "nsXPFCCanvas.h" #include "nsICalTimeContext.h" +#include "nsCalCanvas.h" -class nsCalTimebarCanvas : public nsXPFCCanvas +class nsCalTimebarCanvas : public nsCalCanvas { public: diff --git a/calendar/modules/ui/canvas/src/manifest.mn b/calendar/modules/ui/canvas/src/manifest.mn index 5fa34caa9f16..4bcc8db5d9d4 100644 --- a/calendar/modules/ui/canvas/src/manifest.mn +++ b/calendar/modules/ui/canvas/src/manifest.mn @@ -29,6 +29,7 @@ CPPSRCS = \ nsCalTimebarScale.cpp \ nsCalMultiDayViewCanvas.cpp \ nsCalDayViewCanvas.cpp \ + nsCalCanvas.cpp \ events.cpp \ $(NULL) diff --git a/calendar/modules/ui/canvas/src/nsCalTimebarCanvas.cpp b/calendar/modules/ui/canvas/src/nsCalTimebarCanvas.cpp index 0462eaf74212..eec258fd53a5 100644 --- a/calendar/modules/ui/canvas/src/nsCalTimebarCanvas.cpp +++ b/calendar/modules/ui/canvas/src/nsCalTimebarCanvas.cpp @@ -24,7 +24,7 @@ static NS_DEFINE_IID(kCalTimebarCanvasCID, NS_CAL_TIMEBARCANVAS_CID); #define LOCAL_INSET 1 -nsCalTimebarCanvas :: nsCalTimebarCanvas(nsISupports* outer) : nsXPFCCanvas(outer) +nsCalTimebarCanvas :: nsCalTimebarCanvas(nsISupports* outer) : nsCalCanvas(outer) { NS_INIT_REFCNT(); mTimeContext = nsnull; @@ -52,7 +52,7 @@ nsresult nsCalTimebarCanvas::QueryInterface(REFNSIID aIID, void** aInstancePtr) AddRef(); return NS_OK; } - return (nsXPFCCanvas::QueryInterface(aIID, aInstancePtr)); + return (nsCalCanvas::QueryInterface(aIID, aInstancePtr)); } NS_IMPL_ADDREF(nsCalTimebarCanvas) @@ -156,7 +156,7 @@ nsEventStatus nsCalTimebarCanvas :: PaintBackground(nsIRenderingContext& aRender */ nsRect rect; - nsXPFCCanvas::PaintBackground(aRenderingContext,aDirtyRect); + nsCalCanvas::PaintBackground(aRenderingContext,aDirtyRect); /* * Now paint the TimeContext over the base canvas background @@ -230,6 +230,6 @@ nsresult nsCalTimebarCanvas::PaintInterval(nsIRenderingContext& aRenderingContex nsresult nsCalTimebarCanvas :: SetParameter(nsString& aKey, nsString& aValue) { - return (nsXPFCCanvas::SetParameter(aKey, aValue)); + return (nsCalCanvas::SetParameter(aKey, aValue)); } diff --git a/calendar/modules/ui/core/inc/nsCalUICIID.h b/calendar/modules/ui/core/inc/nsCalUICIID.h index 93f6500a9d37..f6eb0e233c7d 100644 --- a/calendar/modules/ui/core/inc/nsCalUICIID.h +++ b/calendar/modules/ui/core/inc/nsCalUICIID.h @@ -68,6 +68,11 @@ { 0x6e645390, 0xedba, 0x11d1, \ { 0xbe, 0xc6, 0x00, 0x80, 0x5f, 0x8a, 0x8d, 0xbd } } +//11faca40-4cd5-11d2-924a-00805f8a7ab6 +#define NS_CAL_CANVAS_CID \ +{ 0x11faca40, 0x4cd5, 0x11d2, \ +{ 0x92, 0x4a, 0x00, 0x80, 0x5f, 0x8a, 0x7a, 0xb6 } } + //025d7730-edbc-11d1-bec6-00805f8a8dbd #define NS_CAL_TIMEBARCOMPONENTCANVAS_CID \ { 0x025d7730, 0xedbc, 0x11d1, \ diff --git a/calendar/modules/ui/core/src/nsCalFactory.cpp b/calendar/modules/ui/core/src/nsCalFactory.cpp index 0630377b608f..4605d161b11e 100644 --- a/calendar/modules/ui/core/src/nsCalFactory.cpp +++ b/calendar/modules/ui/core/src/nsCalFactory.cpp @@ -55,6 +55,7 @@ static NS_DEFINE_IID(kICalTimeContext, NS_ICAL_TIME_CONTEXT_IID); static NS_DEFINE_IID(kICalContextController, NS_ICAL_CONTEXT_CONTROLLER_IID); static NS_DEFINE_IID(kCCalTimebarCanvas, NS_CAL_TIMEBARCANVAS_CID); +static NS_DEFINE_IID(kCCalCanvas, NS_CAL_CANVAS_CID); static NS_DEFINE_IID(kCCalStatusCanvas, NS_CAL_STATUSCANVAS_CID); static NS_DEFINE_IID(kCCalCommandCanvas, NS_CAL_COMMANDCANVAS_CID); static NS_DEFINE_IID(kCCalTimebarComponentCanvas, NS_CAL_TIMEBARCOMPONENTCANVAS_CID); @@ -185,6 +186,10 @@ nsresult nsCalFactory::CreateInstance(nsISupports *aOuter, nsXPFCCanvas * canvas = (nsXPFCCanvas *)new nsCalTimebarCanvas(aOuter); canvas->QueryInterface(kISupportsIID,(void **)&inst); } + else if (mClassID.Equals(kCCalCanvas)) { + nsXPFCCanvas * canvas = (nsXPFCCanvas *)new nsCalCanvas(aOuter); + canvas->QueryInterface(kISupportsIID,(void **)&inst); + } else if (mClassID.Equals(kCCalStatusCanvas)) { nsXPFCCanvas * canvas = (nsXPFCCanvas *)new nsCalStatusCanvas(aOuter); canvas->QueryInterface(kISupportsIID,(void **)&inst);