зеркало из https://github.com/mozilla/gecko-dev.git
Begin hooking up the view manager
This commit is contained in:
Родитель
64ea2e0c0f
Коммит
f2041cdd7c
|
@ -91,7 +91,6 @@ private:
|
|||
nsICalendarWidget * mCalendarWidget;
|
||||
nsIXPFCCanvas * mRootCanvas;
|
||||
nsICalToolkit * mToolkit;
|
||||
nsIViewManager* mViewManager;
|
||||
|
||||
};
|
||||
|
||||
|
|
|
@ -77,7 +77,6 @@ nsCalendarContainer::nsCalendarContainer()
|
|||
mRootCanvas = nsnull;
|
||||
mToolkit = nsnull;
|
||||
mToolbarManager = nsnull;
|
||||
mViewManager = nsnull;
|
||||
}
|
||||
|
||||
NS_IMPL_QUERY_INTERFACE(nsCalendarContainer, kICalContainerIID)
|
||||
|
@ -86,7 +85,6 @@ NS_IMPL_RELEASE(nsCalendarContainer)
|
|||
|
||||
nsCalendarContainer::~nsCalendarContainer()
|
||||
{
|
||||
NS_IF_RELEASE(mViewManager);
|
||||
NS_IF_RELEASE(mMenuManager);
|
||||
NS_IF_RELEASE(mCalendarWidget);
|
||||
NS_IF_RELEASE(mRootCanvas);
|
||||
|
@ -136,20 +134,23 @@ nsresult nsCalendarContainer::Init(nsIWidget * aParent,
|
|||
/*
|
||||
* Create the view manager
|
||||
*/
|
||||
#if 0
|
||||
|
||||
nsIViewManager * viewManager;
|
||||
|
||||
res = nsRepository::CreateInstance(kViewManagerCID,
|
||||
nsnull,
|
||||
kIViewManagerIID,
|
||||
(void **)&mViewManager);
|
||||
(void **)&viewManager);
|
||||
|
||||
|
||||
if (NS_OK != res)
|
||||
return res ;
|
||||
|
||||
mViewManager->Init(aParent->GetDeviceContext());
|
||||
viewManager->Init(aParent->GetDeviceContext());
|
||||
|
||||
mViewManager->SetFrameRate(25);
|
||||
#endif
|
||||
viewManager->SetFrameRate(25);
|
||||
|
||||
gXPFCToolkit->GetCanvasManager()->SetViewManager(viewManager);
|
||||
|
||||
gXPFCToolkit->GetCanvasManager()->SetWebViewerContainer((nsIWebViewerContainer *) this);
|
||||
|
||||
|
@ -174,49 +175,18 @@ nsresult nsCalendarContainer::Init(nsIWidget * aParent,
|
|||
kCXPFCCanvasCID,
|
||||
(void **)&mRootCanvas);
|
||||
|
||||
if (NS_OK == res)
|
||||
{
|
||||
|
||||
mRootCanvas->Init();
|
||||
}
|
||||
|
||||
mRootCanvas->Init(aParent, aBounds,(((nsCalendarShell *)aCalendarShell)->mShellInstance->GetShellEventCallback()));
|
||||
mRootCanvas->Init();
|
||||
gXPFCToolkit->GetCanvasManager()->SetRootCanvas(mRootCanvas);
|
||||
|
||||
mRootCanvas->Init(aParent,
|
||||
aBounds,
|
||||
(((nsCalendarShell *)aCalendarShell)->mShellInstance->GetShellEventCallback()));
|
||||
widget_parent = mRootCanvas->GetWidget();
|
||||
|
||||
mRootCanvas->SetVisibility(PR_FALSE);
|
||||
((nsBoxLayout *)(mRootCanvas->GetLayout()))->SetLayoutAlignment(eLayoutAlignment_vertical);
|
||||
gXPFCToolkit->GetCanvasManager()->SetRootCanvas(mRootCanvas);
|
||||
|
||||
|
||||
#if 0
|
||||
nsIView * view = nsnull ;
|
||||
|
||||
res = nsRepository::CreateInstance(kViewCID,
|
||||
nsnull,
|
||||
kIViewIID,
|
||||
(void **)&(view));
|
||||
|
||||
if (res != NS_OK)
|
||||
return res;
|
||||
|
||||
static NS_DEFINE_IID(kCWidgetCID, NS_CHILD_CID);
|
||||
|
||||
view->Init(mViewManager,
|
||||
aBounds,
|
||||
nsnull,
|
||||
nsnull,//&kCWidgetCID,
|
||||
nsnull,
|
||||
aParent->GetNativeData(NS_NATIVE_WIDGET));
|
||||
|
||||
mViewManager->SetRootView(view);
|
||||
|
||||
mViewManager->SetWindowDimensions(aBounds.width, aBounds.height);
|
||||
|
||||
//view->GetWidget(widget_parent);
|
||||
|
||||
gXPFCToolkit->GetCanvasManager()->Register(mRootCanvas,view);
|
||||
#endif
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -31,6 +31,7 @@
|
|||
#include "nsIView.h"
|
||||
#include "nsIViewObserver.h"
|
||||
#include "nsIWebViewerContainer.h"
|
||||
#include "nsIViewManager.h"
|
||||
|
||||
class nsXPFCCanvasManager : public nsIXPFCCanvasManager,
|
||||
public nsIViewObserver
|
||||
|
@ -81,6 +82,9 @@ public:
|
|||
NS_IMETHOD_(nsIWebViewerContainer *) GetWebViewerContainer() ;
|
||||
NS_IMETHOD SetWebViewerContainer(nsIWebViewerContainer * aWebViewerContainer) ;
|
||||
|
||||
NS_IMETHOD_(nsIViewManager *) GetViewManager() ;
|
||||
NS_IMETHOD SetViewManager(nsIViewManager * aViewManager) ;
|
||||
|
||||
protected:
|
||||
~nsXPFCCanvasManager();
|
||||
|
||||
|
@ -97,7 +101,7 @@ private:
|
|||
nsIXPFCCanvas * mMouseOverCanvas ;
|
||||
nsIXPFCCanvas * mPressedCanvas ;
|
||||
nsIWebViewerContainer * mWebViewerContainer;
|
||||
|
||||
nsIViewManager * mViewManager;
|
||||
};
|
||||
|
||||
#endif /* nsXPFCCanvasManager_h___ */
|
||||
|
|
|
@ -25,6 +25,7 @@ class nsIXPFCCanvas;
|
|||
class nsIView;
|
||||
class nsIWidget;
|
||||
class nsIWebViewerContainer;
|
||||
class nsIViewManager;
|
||||
|
||||
// IID for the nsIXPFCCanvasManager interface
|
||||
#define NS_IXPFC_CANVAS_MANAGER_IID \
|
||||
|
@ -130,6 +131,9 @@ public:
|
|||
NS_IMETHOD_(nsIWebViewerContainer *) GetWebViewerContainer() = 0;
|
||||
NS_IMETHOD SetWebViewerContainer(nsIWebViewerContainer * aWebViewerContainer) = 0;
|
||||
|
||||
NS_IMETHOD_(nsIViewManager *) GetViewManager() = 0;
|
||||
NS_IMETHOD SetViewManager(nsIViewManager * aViewManager) = 0;
|
||||
|
||||
|
||||
};
|
||||
|
||||
|
|
|
@ -66,6 +66,7 @@ nsXPFCCanvasManager :: nsXPFCCanvasManager()
|
|||
mFocusedCanvas = nsnull;
|
||||
mMouseOverCanvas = nsnull;
|
||||
mPressedCanvas = nsnull;
|
||||
mViewManager = nsnull;
|
||||
}
|
||||
|
||||
nsXPFCCanvasManager :: ~nsXPFCCanvasManager()
|
||||
|
@ -413,3 +414,14 @@ nsIWebViewerContainer * nsXPFCCanvasManager::GetWebViewerContainer()
|
|||
return(mWebViewerContainer);
|
||||
}
|
||||
|
||||
nsresult nsXPFCCanvasManager::SetViewManager(nsIViewManager * aViewManager)
|
||||
{
|
||||
mViewManager = aViewManager;
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
nsIViewManager * nsXPFCCanvasManager::GetViewManager()
|
||||
{
|
||||
return(mViewManager);
|
||||
}
|
||||
|
||||
|
|
|
@ -24,6 +24,7 @@
|
|||
#include "nsIApplicationShell.h"
|
||||
#include "nsIXPFCObserverManager.h"
|
||||
#include "nsIXPFCCanvasManager.h"
|
||||
#include "nsIViewManager.h"
|
||||
|
||||
CLASS_EXPORT_XPFC nsXPFCToolkit : public nsIXPFCToolkit
|
||||
{
|
||||
|
@ -46,6 +47,8 @@ public:
|
|||
NS_IMETHOD SetApplicationShell(nsIApplicationShell * aApplicationShell) ;
|
||||
NS_IMETHOD_(nsIApplicationShell *) GetApplicationShell() ;
|
||||
|
||||
NS_IMETHOD_(nsIViewManager *) GetViewManager() ;
|
||||
|
||||
protected:
|
||||
~nsXPFCToolkit();
|
||||
|
||||
|
|
|
@ -26,6 +26,7 @@
|
|||
|
||||
|
||||
class nsIApplicationShell;
|
||||
class nsIViewManager;
|
||||
|
||||
//d666a630-32e1-11d2-9248-00805f8a7ab6
|
||||
#define NS_IXPFC_TOOLKIT_IID \
|
||||
|
@ -46,6 +47,7 @@ public:
|
|||
NS_IMETHOD_(nsIXPFCCanvasManager *) GetCanvasManager() = 0;
|
||||
|
||||
NS_IMETHOD GetRootCanvas(nsIXPFCCanvas ** aCanvas) = 0;
|
||||
NS_IMETHOD_(nsIViewManager *) GetViewManager() = 0;
|
||||
NS_IMETHOD_(EVENT_CALLBACK) GetShellEventCallback() = 0;
|
||||
|
||||
NS_IMETHOD SetApplicationShell(nsIApplicationShell * aApplicationShell) = 0;
|
||||
|
|
|
@ -33,7 +33,7 @@ nsXPFCToolkit :: nsXPFCToolkit()
|
|||
if (gXPFCToolkit == nsnull)
|
||||
gXPFCToolkit = (nsXPFCToolkit *)this;
|
||||
|
||||
mApplicationShell = nsnull;
|
||||
mApplicationShell = nsnull;
|
||||
mObserverManager = nsnull;
|
||||
mCanvasManager = nsnull;
|
||||
|
||||
|
@ -111,6 +111,11 @@ nsresult nsXPFCToolkit::GetRootCanvas(nsIXPFCCanvas ** aCanvas)
|
|||
return (mCanvasManager->GetRootCanvas(aCanvas));
|
||||
}
|
||||
|
||||
nsIViewManager * nsXPFCToolkit::GetViewManager()
|
||||
{
|
||||
return (mCanvasManager->GetViewManager());
|
||||
}
|
||||
|
||||
EVENT_CALLBACK nsXPFCToolkit::GetShellEventCallback()
|
||||
{
|
||||
return ((EVENT_CALLBACK)HandleEventApplication);
|
||||
|
|
Загрузка…
Ссылка в новой задаче