Re: Getting nsWindow from chrome

2005-07-20 Thread slu

Boris Zbarsky wrote:

steve lu wrote:


but the problem remains the same.
If I want to re-use the nsWindow implementation by doing

nsMyWidget: nsWindow

and register my class thru component register as a new Widget.
And insert my widget by doing rootwidget->AddChild(myWidget);



You'd need to compile all of widget into your library, then  Still 
not sure it would work, of course.


Also, please do NOT cc my email on posts to this newsgroup.

-Boris


Sorry hit reply and it went directly to you instead of the newsgroup. :)

Guess I will have to use the approach similar to canvas then.
Seems to be a way that has been proven to work.

Steve
___
mozilla-embedding mailing list
mozilla-embedding@mozilla.org
http://mail.mozilla.org/listinfo/mozilla-embedding


Re: Getting nsWindow from chrome

2005-07-20 Thread Boris Zbarsky

steve lu wrote:

but the problem remains the same.
If I want to re-use the nsWindow implementation by doing

nsMyWidget: nsWindow

and register my class thru component register as a new Widget.
And insert my widget by doing rootwidget->AddChild(myWidget);


You'd need to compile all of widget into your library, then  Still not sure 
it would work, of course.


Also, please do NOT cc my email on posts to this newsgroup.

-Boris
___
mozilla-embedding mailing list
mozilla-embedding@mozilla.org
http://mail.mozilla.org/listinfo/mozilla-embedding


Re: Getting nsWindow from chrome

2005-07-20 Thread steve lu

Sorry, I label it incorretly...

but the problem remains the same.
If I want to re-use the nsWindow implementation by doing

nsMyWidget: nsWindow

and register my class thru component register as a new Widget.
And insert my widget by doing rootwidget->AddChild(myWidget);

Could I then access its rendering context and draw or repaint in it
without flickering? And all the GetNextSibling(), PlaceBehind() APIs 
works as if myWidget is part

of the mozilla rendering?

Thanks,
Steve
Sorry for hijacking the thread... but I think this is somehow relevant.



___
mozilla-embedding mailing list
mozilla-embedding@mozilla.org
http://mail.mozilla.org/listinfo/mozilla-embedding


Re: Getting nsWindow from chrome

2005-07-20 Thread Boris Zbarsky

slu wrote:

IMO, the nsWindow interface


It's not an interface.  It's a concrete class.  The interface is nsIWidget.

-Boris
___
mozilla-embedding mailing list
mozilla-embedding@mozilla.org
http://mail.mozilla.org/listinfo/mozilla-embedding


Re: Getting nsWindow from chrome

2005-07-20 Thread slu

Hi,

IMO, the nsWindow interface is being hidden for security reason.
Note that nsWindow.h is not in the mozilla/dist/ directory.

The only way to redraw is when the region is part of
your own widget.  And to create your own widget, do a
search on "custom widget" in the xpfe mailing list.

(I've tried to compile and include nsWindow and BaseWidget libs
independent of mozilla and it did not seem to work.)

Steve
just my 2 cents.



Neeraj Tewari, Noida wrote:

Thanks for your help but GetMainWidget return the parent widget of
chrome window and not chrome widget pointer.
I tried following code but that seems to be very complex ..

nsCOMPtr webBrowser;
nsCOMPtr webNavigation;
nsCOMPtr docshell;
nsCOMPtr presContext;
nsCOMPtr contentWin;
nsCOMPtr doc;
			nsCOMPtr ContentViewer; 
			nsIView *view = nsnull;

if (chrome)
{

BroPtr->chrome->GetWebBrowser(getter_AddRefs(webBrowser));

webBrowser->GetContentDOMWindow(getter_AddRefs(contentWin));
webNavigation =
do_QueryInterface(webBrowser);
docshell = do_GetInterface(webBrowser);

docshell->GetContentViewer(getter_AddRefs(ContentViewer));
if(ContentViewer)
{
nsCOMPtr
DocViewer(do_QueryInterface(ContentViewer));

if (DocViewer) 
	

DocViewer->GetDocument(getter_AddRefs(doc));
docshell->GetPresContext
(getter_AddRefs(presContext));
if(presContext)

presContext->GetViewManager()->GetRootView (view);
view->GetWidget();
}

   }

Neeraj

-Original Message-
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] Behalf Of Niky Williams
Sent: Wednesday, July 20, 2005 1:44 AM
To: mozilla-embedding@mozilla.org
Subject: Re: Getting nsWindow from chrome


It looks like the documentation typedefs the nsWindow as an
nsBaseWidget.
So maybe you can try something like this:

//--

---
nsIWebBrowser *piwbWebBrowser = nsnull;
nsIBaseWindow *pibwBaseWindow = nsnull;
nsWindow *pWindow = nsnull;

chrome->GetWebBrowser (&piwbWebBrowser);
piwbWebBrowser->QueryInterface (NS_GET_IID (nsIBaseWindow), (void**)
&pibwBaseWindow);
piwbWebBrowser->Release ();
piwbWebBrowser = nsnull;
pibwBaseWindow->GetMainWidget (&pWindow);
piwbBaseWindow->Release ();
piwbBaseWindow = nsnull;

//Do your GUI stuff here

pWindow->Release ();
pWindow = nsnull;
//--

---

That should work for up to at least GetMainWidget(), but I'm not sure
about
actually getting an nsWindow object from that.  I hope that helps.  If I
find anything else I'll reply again.

Niky Williams


"Neeraj Tewari, Noida" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]


Hi ,
Can anyone help me to get nsWindow pointer from


chrome(nsIWebBrowserChrome) pointer.As i want to redraw the chrome


region in some situation.

thanks in advance
Neeraj





___
mozilla-embedding mailing list
mozilla-embedding@mozilla.org
http://mail.mozilla.org/listinfo/mozilla-embedding




___
mozilla-embedding mailing list
mozilla-embedding@mozilla.org
http://mail.mozilla.org/listinfo/mozilla-embedding