Back to index

lightning-sunbird  0.9+nobinonly
Functions | Variables
plugin.cpp File Reference
#include <windows.h>
#include <windowsx.h>
#include "plugin.h"

Go to the source code of this file.

Functions

NPError NS_PluginInitialize ()
void NS_PluginShutdown ()
nsPluginInstanceBaseNS_NewPluginInstance (nsPluginCreateData *aCreateDataStruct)
void NS_DestroyPluginInstance (nsPluginInstanceBase *aPlugin)
static LRESULT CALLBACK PluginWinProc (HWND, UINT, WPARAM, LPARAM)

Variables

static WNDPROC lpOldProc = NULL

Function Documentation

Definition at line 70 of file plugin.cpp.

{
  if(aPlugin)
    delete (nsPluginInstance *)aPlugin;
}

Definition at line 61 of file plugin.cpp.

{
  if(!aCreateDataStruct)
    return NULL;

  nsPluginInstance * plugin = new nsPluginInstance(aCreateDataStruct->instance);
  return plugin;
}

Definition at line 48 of file plugin.cpp.

{
  return NPERR_NO_ERROR;
}

Definition at line 53 of file plugin.cpp.

{
}
static LRESULT CALLBACK PluginWinProc ( HWND  hWnd,
UINT  msg,
WPARAM  wParam,
LPARAM  lParam 
) [static]

Definition at line 133 of file plugin.cpp.

{
  switch (msg) {
    case WM_PAINT:
      {
        // draw a frame and display the string
        PAINTSTRUCT ps;
        HDC hdc = BeginPaint(hWnd, &ps);
        RECT rc;
        GetClientRect(hWnd, &rc);
        FrameRect(hdc, &rc, GetStockBrush(BLACK_BRUSH));

        // get our plugin instance object and ask it for the version string
        nsPluginInstance *plugin = (nsPluginInstance *)GetWindowLong(hWnd, GWL_USERDATA);
        if (plugin) {
          const char * string = plugin->getVersion();
          DrawText(hdc, string, strlen(string), &rc, DT_SINGLELINE | DT_CENTER | DT_VCENTER);
        }
        else {
          char string[] = "Error occured";
          DrawText(hdc, string, strlen(string), &rc, DT_SINGLELINE | DT_CENTER | DT_VCENTER);
        }

        EndPaint(hWnd, &ps);
      }
      break;
    default:
      break;
  }

  return DefWindowProc(hWnd, msg, wParam, lParam);
}

Here is the call graph for this function:

Here is the caller graph for this function:


Variable Documentation

WNDPROC lpOldProc = NULL [static]

Definition at line 92 of file plugin.cpp.