Back to index

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

List of all members.

Public Member Functions

 nsPluginNativeWindowOS2 ()
 nsPluginNativeWindowOS2 implementation
virtual ~nsPluginNativeWindowOS2 ()
virtual nsresult CallSetWindow (nsCOMPtr< nsIPluginInstance > &aPluginInstance)
PFNWP GetWindowProc ()
nsresult GetEventService (nsCOMPtr< nsIEventQueueService > &aEventService)
PluginWindowEventGetPluginWindowEvent (HWND aWnd, ULONG aMsg, MPARAM mp1, MPARAM mp2)
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

PFNWP mPluginWinProc
nsCOMPtr< nsIEventQueueServicemEventService
PluginWindowEvent mPluginWindowEvent

Detailed Description

Definition at line 124 of file nsPluginNativeWindowOS2.cpp.


Constructor & Destructor Documentation

nsPluginNativeWindowOS2 implementation

Definition at line 231 of file nsPluginNativeWindowOS2.cpp.

Here is the call graph for this function:

Definition at line 245 of file nsPluginNativeWindowOS2.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 340 of file nsPluginNativeWindowOS2.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
  if (!aPluginInstance)
    UndoSubclassAndAssociateWindow();

  nsPluginNativeWindow::CallSetWindow(aPluginInstance);

  if (aPluginInstance)
    SubclassAndAssociateWindow();

  return NS_OK;
}

Here is the call graph for this function:

Definition at line 304 of file nsPluginNativeWindowOS2.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;
  }
PluginWindowEvent * nsPluginNativeWindowOS2::GetPluginWindowEvent ( HWND  aWnd,
ULONG  aMsg,
MPARAM  mp1,
MPARAM  mp2 
)

Definition at line 316 of file nsPluginNativeWindowOS2.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, aMp1, aMp2);
  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 258 of file nsPluginNativeWindowOS2.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 355 of file nsPluginNativeWindowOS2.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
  PFNWP currentWndProc = (PFNWP)::WinQueryWindowPtr(hWnd, QWP_PFNWP);
  if (PluginWndProc == currentWndProc)
    return NS_OK;

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

  nsPluginNativeWindowOS2 * win = (nsPluginNativeWindowOS2 *)::WinQueryProperty(hWnd, NS_PLUGIN_WINDOW_PROPERTY_ASSOCIATION);
  NS_ASSERTION(!win || (win == this), "plugin window already has property and this is not us");
  
  if (!::WinSetProperty(hWnd, NS_PLUGIN_WINDOW_PROPERTY_ASSOCIATION, (PVOID)this, 0))
    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 382 of file nsPluginNativeWindowOS2.cpp.

{
  // release plugin instance
  SetPluginInstance(nsnull);

  // remove window property
  HWND hWnd = (HWND)window;
  if (WinIsWindow(/*HAB*/0, hWnd))
    ::WinRemoveProperty(hWnd, NS_PLUGIN_WINDOW_PROPERTY_ASSOCIATION);

  // restore the original win proc
  // but only do this if this were us last time
  if (mPluginWinProc) {
    PFNWP currentWndProc = (PFNWP)::WinQueryWindowPtr(hWnd, QWP_PFNWP);
    if (currentWndProc == PluginWndProc)
      WinSubclassWindow(hWnd, 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 143 of file nsPluginNativeWindowOS2.cpp.

Definition at line 102 of file nsPIPluginHost.idl.

Definition at line 147 of file nsPluginNativeWindowOS2.cpp.

Definition at line 144 of file nsPluginNativeWindowOS2.cpp.

Definition at line 142 of file nsPluginNativeWindowOS2.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: