guys,

I have a draft implementation of a panning (grab and drag) component (in C++) working quite fine for almost all tested websites. It's not complicated at all, I'm just working with mouse press/move/release events of a gtkmozembed browser, and scroll/pan it through some nsGlobalWindow methods (e.g. ScrollBy).

However, when I try to pan gmail or any other js-based site for example, the scrollBy method fails because of there is no nsIScrollableView available.

quoted from nsGlobalWindow.cpp, line 3730

NS_IMETHODIMP
nsGlobalWindow::ScrollBy(PRInt32 aXScrollDif, PRInt32 aYScrollDif)
{
 nsresult result;
 nsIScrollableView *view = nsnull;      /// no addref/release for views/
 float p2t, t2p;

 FlushPendingNotifications(Flush_Layout);
 result = GetScrollInfo(&view, &p2t, &t2p);

 *if* (view) {
   nscoord xPos, yPos;
   result = view->GetScrollPosition(xPos, yPos);
   *if* (NS_SUCCEEDED(result)) {
     result = ScrollTo(NSTwipsToIntPixels(xPos, t2p) + aXScrollDif,
                       NSTwipsToIntPixels(yPos, t2p) + aYScrollDif);
      printf ("[DEBUGGING ENGINE] nsGlobalWindow::ScrollBy - we have 'view'\n");
   }
 } *else* printf ("[DEBUGGING ENGINE] there is no view\n");

 *return* result;

(...)

That's really odd once I can scroll same sites up/down (through mouse) via scrollbars without problems. So, my question is: Which other methods I can use to scroll pages like these (and so improve my panning component) ? What methods perform scrolling actions via scrollbars ?

Cheers

--Antonio Gomes
_______________________________________________
dev-tech-layout mailing list
[email protected]
https://lists.mozilla.org/listinfo/dev-tech-layout

Reply via email to