Back to index

lightning-sunbird  0.9+nobinonly
Public Member Functions | Public Attributes | Protected Attributes | Private Member Functions | Private Attributes
nsPluginNativeWindowWin Class Reference
Inheritance diagram for nsPluginNativeWindowWin:
Inheritance graph
[legend]
Collaboration diagram for nsPluginNativeWindowWin:
Collaboration graph
[legend]

List of all members.

Public Member Functions

 nsPluginNativeWindowWin ()
 nsPluginNativeWindowWin implementation
virtual ~nsPluginNativeWindowWin ()
virtual nsresult CallSetWindow (nsCOMPtr< nsIPluginInstance > &aPluginInstance)
WNDPROC GetWindowProc ()
nsIEventQueueServiceGetEventService ()
PluginWindowEventGetPluginWindowEvent (HWND aWnd, UINT aMsg, WPARAM aWParam, LPARAM aLParam)
nsresult GetPluginInstance (nsCOMPtr< nsIPluginInstance > &aPluginInstance)
 !!! CAUTION !!!
nsresult GetPluginInstance (nsCOMPtr< nsIPluginInstance > &aPluginInstance)
 !!! CAUTION !!!
nsresult SetPluginInstance (nsIPluginInstance *aPluginInstance)
nsresult SetPluginInstance (nsIPluginInstance *aPluginInstance)
nsresult GetPluginWidget (nsIWidget **aWidget)
nsresult GetPluginWidget (nsIWidget **aWidget)
nsresult SetPluginWidget (nsIWidget *aWidget)
nsresult SetPluginWidget (nsIWidget *aWidget)

Public Attributes

nsPluginType mPluginType
nsPluginPort * window
PRInt32 x
PRInt32 y
PRUint32 width
PRUint32 height
nsPluginRect clipRect
nsPluginWindowType type

Protected Attributes

nsCOMPtr< nsIPluginInstancemPluginInstance
nsCOMPtr< nsIWidgetmWidget

Private Member Functions

nsresult SubclassAndAssociateWindow ()
nsresult UndoSubclassAndAssociateWindow ()

Private Attributes

WNDPROC mPluginWinProc
nsCOMPtr< nsIEventQueueServicemEventService
PluginWindowEvent mPluginWindowEvent

Detailed Description

Definition at line 124 of file nsPluginNativeWindowWin.cpp.


Constructor & Destructor Documentation

nsPluginNativeWindowWin implementation

Definition at line 368 of file nsPluginNativeWindowWin.cpp.

Here is the call graph for this function:

Definition at line 382 of file nsPluginNativeWindowWin.cpp.

{
  // clear any pending events to avoid dangling pointers
  nsCOMPtr<nsIEventQueueService> eventService(do_GetService(kEventQueueServiceCID));
  if (eventService) {
    nsCOMPtr<nsIEventQueue> eventQueue;  
    eventService->GetThreadEventQueue(PR_GetCurrentThread(), getter_AddRefs(eventQueue));
    if (eventQueue) {
      eventQueue->RevokeEvents(this);
    }
  }
}

Here is the call graph for this function:


Member Function Documentation

Reimplemented from nsPluginNativeWindow.

Definition at line 475 of file nsPluginNativeWindowWin.cpp.

{
  // check the incoming instance, null indicates that window is going away and we are
  // not interested in subclassing business any more, undo and don't subclass

  // WINCE does not subclass windows.  See bug 300011 for the details.
#ifndef WINCE
  if (!aPluginInstance)
    UndoSubclassAndAssociateWindow();
#endif

  nsPluginNativeWindow::CallSetWindow(aPluginInstance);

#ifndef WINCE
  if (aPluginInstance)
    SubclassAndAssociateWindow();
#endif

  return NS_OK;
}

Here is the call graph for this function:

Definition at line 441 of file nsPluginNativeWindowWin.cpp.

Here is the call graph for this function:

Here is the caller graph for this function:

nsresult nsPluginNativeWindow::GetPluginInstance ( nsCOMPtr< nsIPluginInstance > &  aPluginInstance) [inline, inherited]

!!! CAUTION !!!

The base class |nsPluginWindow| is defined as a struct in nsplugindefs.h, thus it does not have a destructor of its own. One should never attempt to delete |nsPluginNativeWindow| object instance (or derivatives) using a pointer of |nsPluginWindow *| type. Should such necessity occur it must be properly casted first.

Definition at line 70 of file nsPluginNativeWindow.h.

                                                                           { 
    aPluginInstance = mPluginInstance;
    return NS_OK;
  }
nsresult nsPluginNativeWindow::GetPluginInstance ( nsCOMPtr< nsIPluginInstance > &  aPluginInstance) [inline, inherited]

!!! CAUTION !!!

The base class |nsPluginWindow| is defined as a struct in nsplugindefs.h, thus it does not have a destructor of its own. One should never attempt to delete |nsPluginNativeWindow| object instance (or derivatives) using a pointer of |nsPluginWindow *| type. Should such necessity occur it must be properly casted first.

Definition at line 70 of file nsPIPluginHost.idl.

Here is the caller graph for this function:

nsresult nsPluginNativeWindow::GetPluginWidget ( nsIWidget **  aWidget) [inline, inherited]

Definition at line 80 of file nsPIPluginHost.idl.

Here is the caller graph for this function:

nsresult nsPluginNativeWindow::GetPluginWidget ( nsIWidget **  aWidget) [inline, inherited]

Definition at line 80 of file nsPluginNativeWindow.h.

                                                {
    NS_IF_ADDREF(*aWidget = mWidget);
    return NS_OK;
  }

Definition at line 451 of file nsPluginNativeWindowWin.cpp.

{
  PluginWindowEvent *event;
  if (mPluginWindowEvent.InUse()) {
    // We have the ability to alloc if needed in case in the future some plugin
    // should post multiple PostMessages. However, this could lead to many
    // alloc's per second which could become a performance issue. If/when this
    // is asserting then this needs to be studied. See bug 169247
    NS_ASSERTION(1, "possible plugin performance issue");
    event = new PluginWindowEvent();
    if (!event)
      return nsnull;

    event->SetIsAlloced(PR_TRUE);
  }
  else {
    event = &mPluginWindowEvent;
  }

  event->Init(aWnd, aMsg, aWParam, aLParam);
  PL_InitEvent(event, (void *)this, &PluginWindowEvent_Handle, PluginWindowEvent_Destroy);
  return event;
}

Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 395 of file nsPluginNativeWindowWin.cpp.

{
  return mPluginWinProc;
}

Here is the caller graph for this function:

nsresult nsPluginNativeWindow::SetPluginInstance ( nsIPluginInstance aPluginInstance) [inline, inherited]

Definition at line 74 of file nsPIPluginHost.idl.

Here is the caller graph for this function:

nsresult nsPluginNativeWindow::SetPluginInstance ( nsIPluginInstance aPluginInstance) [inline, inherited]

Definition at line 74 of file nsPluginNativeWindow.h.

                                                                 { 
    if (mPluginInstance != aPluginInstance)
      mPluginInstance = aPluginInstance;
    return NS_OK;
  }
nsresult nsPluginNativeWindow::SetPluginWidget ( nsIWidget aWidget) [inline, inherited]

Definition at line 84 of file nsPIPluginHost.idl.

Here is the caller graph for this function:

nsresult nsPluginNativeWindow::SetPluginWidget ( nsIWidget aWidget) [inline, inherited]

Definition at line 84 of file nsPluginNativeWindow.h.

                                               { 
    mWidget = aWidget;
    return NS_OK;
  }

Definition at line 498 of file nsPluginNativeWindowWin.cpp.

{
  if (type != nsPluginWindowType_Window)
    return NS_ERROR_FAILURE;

  HWND hWnd = (HWND)window;
  if (!hWnd)
    return NS_ERROR_FAILURE;

  // check if we need to re-subclass
  WNDPROC currentWndProc = (WNDPROC)::GetWindowLong(hWnd, GWL_WNDPROC);
  if (PluginWndProc == currentWndProc)
    return NS_OK;

  mPluginWinProc = SubclassWindow(hWnd, (LONG)PluginWndProc);
  if (!mPluginWinProc)
    return NS_ERROR_FAILURE;

  nsPluginNativeWindowWin * win = (nsPluginNativeWindowWin *)::GetProp(hWnd, NS_PLUGIN_WINDOW_PROPERTY_ASSOCIATION);
  NS_ASSERTION(!win || (win == this), "plugin window already has property and this is not us");
  
  if (!::SetProp(hWnd, NS_PLUGIN_WINDOW_PROPERTY_ASSOCIATION, (HANDLE)this))
    return NS_ERROR_FAILURE;

  return NS_OK;
}

Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 525 of file nsPluginNativeWindowWin.cpp.

{
  // release plugin instance
  SetPluginInstance(nsnull);

  // remove window property
  HWND hWnd = (HWND)window;
  if (IsWindow(hWnd))
    ::RemoveProp(hWnd, NS_PLUGIN_WINDOW_PROPERTY_ASSOCIATION);

  // restore the original win proc
  // but only do this if this were us last time
  if (mPluginWinProc) {
    WNDPROC currentWndProc = (WNDPROC)::GetWindowLong(hWnd, GWL_WNDPROC);
    if (currentWndProc == PluginWndProc)
      SubclassWindow(hWnd, (LONG)mPluginWinProc);
  }

  return NS_OK;
}

Here is the call graph for this function:

Here is the caller graph for this function:


Member Data Documentation

Definition at line 274 of file nsIClassicPluginFactory.idl.

Definition at line 273 of file nsIClassicPluginFactory.idl.

Definition at line 145 of file nsPluginNativeWindowWin.cpp.

Definition at line 102 of file nsPIPluginHost.idl.

Definition at line 149 of file nsPluginNativeWindowWin.cpp.

Definition at line 146 of file nsPluginNativeWindowWin.cpp.

Definition at line 144 of file nsPluginNativeWindowWin.cpp.

Definition at line 103 of file nsPIPluginHost.idl.

Definition at line 279 of file nsIClassicPluginFactory.idl.

Definition at line 272 of file nsIClassicPluginFactory.idl.

nsPluginPort * nsPluginWindow::window [inherited]

Definition at line 267 of file nsIClassicPluginFactory.idl.

Definition at line 270 of file nsIClassicPluginFactory.idl.

Definition at line 271 of file nsIClassicPluginFactory.idl.


The documentation for this class was generated from the following file: