Back to index

lightning-sunbird  0.9+nobinonly
Public Types | Public Member Functions | Static Public Member Functions | Public Attributes | Protected Member Functions | Private Member Functions | Private Attributes | Static Private Attributes
CPlugin Class Reference

#include <plugin.h>

Inheritance diagram for CPlugin:
Inheritance graph
[legend]
Collaboration diagram for CPlugin:
Collaboration graph
[legend]

List of all members.

Public Types

enum  HiliteState { kUnhilited = 0, kHilited = 1 }

Public Member Functions

 CPlugin (NPP pNPInstance)
 ~CPlugin ()
NPBool init (NPWindow *pNPWindow)
void shut ()
NPBool isInitialized ()
int16 handleEvent (void *event)
void showVersion ()
void clear ()
void getVersion (char **aVersion)
nsI4xScriptablePlugingetScriptablePeer ()
void Constructor (NPP instance, NPMIMEType type, uint16 mode, int16 argc, char *argn[], char *argv[])
void Destructor ()
void SetWindow (NPWindow *window)
void Print (NPPrint *printInfo)
Boolean HandleEvent (EventRecord *)
 CPlugin (HMODULE hInst, NPP pNPInstance, SHORT wMode, NPMIMEType pluginType, PSZ szPageURL, PSZ szFileURL, PSZ szFileExtension, BOOL bHidden)
 ~CPlugin ()
BOOL init (HWND hWnd)
void shut ()
HWND getWindow ()
void showGetPluginDialog ()
void getPlugin ()
BOOL readyToRefresh ()
void print (NPPrint *pNPPrint)
void URLNotify (const char *szURL)
NPError newStream (NPMIMEType type, NPStream *stream, NPBool seekable, uint16 *stype)
NPError destroyStream (NPStream *stream, NPError reason)
void onCreate (HWND hWnd)
void onLButtonUp (HWND hWnd, int x, int y, UINT keyFlags)
void onRButtonUp (HWND hWnd, int x, int y, UINT keyFlags)
void onPaint (HWND hWnd)
void resize ()
 CPlugin (HINSTANCE hInst, NPP pNPInstance, WORD wMode, NPMIMEType pluginType, LPSTR szPageURL, LPSTR szFileURL, LPSTR szFileExtension, BOOL bHidden)
 ~CPlugin ()
BOOL init (HWND hWnd)
void shut ()
HWND getWindow ()
void showGetPluginDialog ()
void getPlugin ()
BOOL readyToRefresh ()
void print (NPPrint *pNPPrint)
void URLNotify (const char *szURL)
NPError newStream (NPMIMEType type, NPStream *stream, NPBool seekable, uint16 *stype)
NPError destroyStream (NPStream *stream, NPError reason)
void onCreate (HWND hWnd)
void onLButtonUp (HWND hWnd, int x, int y, UINT keyFlags)
void onRButtonUp (HWND hWnd, int x, int y, UINT keyFlags)
void onPaint (HWND hWnd)
void resize ()
 CPlugin (NPP pNPInstance, USHORT wMode)
 ~CPlugin ()
BOOL initEmbed (DWORD dwInitData)
BOOL initFull (DWORD dwInitData)
void shutEmbed ()
void shutFull ()
BOOL isInitialized ()
void getModulePath (LPSTR szPath, int iSize)
int messageBox (LPSTR szMessage, LPSTR szTitle, UINT uStyle)
void getLogFileName (LPSTR szLogFileName, int iSize)
BOOL initStandAlone ()
void shutStandAlone ()
BOOL isStandAlone ()
void outputToNativeWindow (LPSTR szString)
ULONG makeNPNCall (NPAPI_Action=action_invalid, ULONG dw1=0L, ULONG dw2=0L, ULONG dw3=0L, ULONG dw4=0L, ULONG dw5=0L, ULONG dw6=0L, ULONG dw7=0L)
const HMODULE getInstance ()
const HWND getWindow ()
const HWND getParent ()
BOOL createTester ()
void destroyTester ()
void showGUI (ShowGUI sg)
void restorePreferences ()
void savePreferences ()
void updatePrefs (GUIPrefs prefs, int iValue, char *szValue=NULL)
void onInit (HWND hWnd, HWND hWndManual, HWND hWndAuto)
void onDestroy ()
void onLogToFile (BOOL bLofToFile)
 CPlugin (NPP pNPInstance, WORD wMode)
 ~CPlugin ()
BOOL initEmbed (DWORD dwInitData)
BOOL initFull (DWORD dwInitData)
void shutEmbed ()
void shutFull ()
BOOL isInitialized ()
void getModulePath (LPSTR szPath, int iSize)
int messageBox (LPSTR szMessage, LPSTR szTitle, UINT uStyle)
void getLogFileName (LPSTR szLogFileName, int iSize)
BOOL initStandAlone ()
void shutStandAlone ()
BOOL isStandAlone ()
void outputToNativeWindow (LPSTR szString)
void autoStartScriptIfNeeded ()
DWORD makeNPNCall (NPAPI_Action=action_invalid, DWORD dw1=0L, DWORD dw2=0L, DWORD dw3=0L, DWORD dw4=0L, DWORD dw5=0L, DWORD dw6=0L, DWORD dw7=0L)
const HINSTANCE getInstance ()
const HWND getWindow ()
const HWND getParent ()
BOOL createTester ()
void destroyTester ()
void showGUI (ShowGUI sg)
void restorePreferences ()
void savePreferences ()
void updatePrefs (GUIPrefs prefs, int iValue, char *szValue=NULL)
void onInit (HWND hWnd, HWND hWndManual, HWND hWndAuto)
void onDestroy ()
void onLogToFile (BOOL bLofToFile)
virtual BOOL init (DWORD dwInitData)
const NPP getNPInstance ()
const WORD getMode ()
const NPStreamgetNPStream ()
void onNPP_NewStream (NPP pInstance, LPSTR szMIMEType, NPStream *pStream, NPBool bSeekable, uint16 *puType)
void onNPP_StreamAsFile (NPP pInstance, NPStream *pStream, const char *szFileName)
void onNPP_DestroyStream (NPStream *pStream)

Static Public Member Functions

static NPError Initialize ()
static void Shutdown ()

Public Attributes

char m_String [128]
BOOL m_bHidden
NPMIMEType m_pNPMIMEType
PSZ m_szPageURL
PSZ m_szFileURL
PSZ m_szFileExtension
HWND m_hWndDialog
BOOL m_bOnline
BOOL m_bJava
BOOL m_bJavaScript
BOOL m_bSmartUpdate
LPSTR m_szPageURL
LPSTR m_szFileURL
LPSTR m_szFileExtension
HWND m_hWndLastEditFocus
int m_iWidth
int m_iHeight
ShowGUI m_Pref_ShowGUI
char m_Pref_szLogFile [256]
char m_Pref_szScriptFile [256]
BOOL m_Pref_bToFile
BOOL m_Pref_bToFrame
BOOL m_Pref_bFlushNow
BOOL m_Pref_bRememberLastCall
BOOL m_Pref_bStandAlone
BOOL m_Pref_bAutoStartScript
voidm_pNPNAlloced
voidm_pValue
NPAPI_Action m_firstAction

Protected Member Functions

void Draw (HiliteState hilite)
void DrawString (const unsigned char *text, short width, short height, short centerX, Rect drawRect)
void MouseDown ()
Boolean FocusDraw ()
void RestoreDraw ()
void DetermineURL (int16 argc, char *argn[], char *argv[])
char * MakeDefaultURL (void)
void AddMimeTypeToList (StringPtr cTypeString)
Boolean CheckMimeTypes ()
void AskAndLoadURL ()
void RefreshPluginPage ()
Ptr New (UInt32 size)
void Delete (Ptr ptr)
Boolean IsPluginHidden (int16 argc, char *argn[], char *argv[])

Private Member Functions

BOOL useDefaultURL_P ()
BOOL doSmartUpdate_P ()
PSZ createURLString ()
void getPluginSmart ()
void getPluginRegular ()
BOOL useDefaultURL_P ()
BOOL doSmartUpdate_P ()
LPSTR createURLString ()
void getPluginSmart ()
void getPluginRegular ()

Private Attributes

NPP m_pNPInstance
NPWindowm_Window
NPStreamm_pNPStream
NPBool m_bInitialized
nsI4xScriptablePluginm_pScriptablePeer
NPP fInstance
NPWindowfWindow
uint16 fMode
NPMIMEType fType
char * fPageURL
char * fFileURL
NPBool m_bOffline
NPBool m_bJavaScript
GrafPtr fSavePort
RgnHandle fSaveClip
Rect fRevealedRect
short fSavePortTop
short fSavePortLeft
Boolean fUserInstalledPlugin
Boolean fHiddenPlugin
Boolean fAskedLoadURL
HMODULE m_hInst
SHORT m_wMode
HWND m_hWnd
HWND m_hWndParent
HPOINTER m_hIcon
char * m_szURLString
char * m_szCommandMessage
BOOL m_bWaitingStreamFromPFS
NPStreamm_PFSStream
HINSTANCE m_hInst
WORD m_wMode
HICON m_hIcon
HWND m_hWndManual
HWND m_hWndAuto
BOOL m_bPluginReady
HWND m_hWndStandAloneLogWindow

Static Private Attributes

static CIconHandle sIconHandle = NULL
static CursHandle sHandCursor = NULL
static char * sAltText = NULL
static char * sInstallCommand = NULL
static char * sDefaultPage = NULL
static char * sRefreshText = NULL
static char * sJavaScriptPage = NULL
static FSSpec sDataFileSpec
static Boolean sRunningOnOSX = false

Detailed Description

Definition at line 44 of file plugin.h.


Member Enumeration Documentation

Enumerator:
kUnhilited 
kHilited 

Definition at line 59 of file NullPlugin.cpp.

{ kUnhilited = 0, kHilited = 1 };  

Constructor & Destructor Documentation

CPlugin::CPlugin ( NPP  pNPInstance)

Definition at line 53 of file plugin.cpp.

                                :
  m_pNPInstance(pNPInstance),
  m_pNPStream(NULL),
  m_bInitialized(FALSE),
  m_pScriptablePeer(NULL)
{
#ifdef XP_WIN
  m_hWnd = NULL;
#endif

  const char *ua = NPN_UserAgent(m_pNPInstance);
  strcpy(m_String, ua);
}

Here is the call graph for this function:

Definition at line 67 of file plugin.cpp.

CPlugin::CPlugin ( HMODULE  hInst,
NPP  pNPInstance,
SHORT  wMode,
NPMIMEType  pluginType,
PSZ  szPageURL,
PSZ  szFileURL,
PSZ  szFileExtension,
BOOL  bHidden 
)

Definition at line 80 of file plugin.cpp.

                               :
  m_hInst(hInst),
  m_pNPInstance(pNPInstance),
  m_wMode(wMode),
  m_hWnd(NULL),
  m_hWndParent(NULL),
  m_hIcon(NULL),
  m_szURLString(NULL),
  m_szCommandMessage(NULL),
  m_bWaitingStreamFromPFS(FALSE),
  m_PFSStream(NULL),
  m_bHidden(bHidden),
  m_pNPMIMEType(NULL),
  m_szPageURL(NULL),
  m_szFileURL(NULL),
  m_szFileExtension(NULL),
  m_hWndDialog(NULL),
  m_bOnline(TRUE),
  m_bJava(TRUE),
  m_bJavaScript(TRUE),
  m_bSmartUpdate(TRUE)
{
  dbgOut1("CPlugin::CPlugin()");
  assert(m_hInst != NULL);
  assert(m_pNPInstance != NULL);

  if(pluginType && *pluginType)
  {
    m_pNPMIMEType = (NPMIMEType)new char[strlen((PSZ)pluginType) + 1];
    if(m_pNPMIMEType != NULL)
      strcpy((PSZ)m_pNPMIMEType, pluginType);
  }

  if(szPageURL && *szPageURL)
  {
    m_szPageURL = new char[strlen(szPageURL) + 1];
    if(m_szPageURL != NULL)
      strcpy(m_szPageURL, szPageURL);
  }
  
  if(szFileURL && *szFileURL)
  {
    m_szFileURL = new char[strlen(szFileURL) + 1];
    if(m_szFileURL != NULL)
      strcpy(m_szFileURL, szFileURL);
  }

  if(szFileExtension && *szFileExtension)
  {
    m_szFileExtension = new char[strlen(szFileExtension) + 1];
    if(m_szFileExtension != NULL)
      strcpy(m_szFileExtension, szFileExtension);
  }

  m_hIcon = WinLoadPointer(HWND_DESKTOP, m_hInst, IDI_PLUGICON);

  char szString[1024] = {'\0'};
  WinLoadString((HAB)0, m_hInst, IDS_CLICK_TO_GET, sizeof(szString), szString);
  if(*szString)
  {
    m_szCommandMessage = new char[strlen(szString) + 1];
    if(m_szCommandMessage != NULL)
      strcpy(m_szCommandMessage, szString);
  }
}
CPlugin::CPlugin ( HINSTANCE  hInst,
NPP  pNPInstance,
WORD  wMode,
NPMIMEType  pluginType,
LPSTR  szPageURL,
LPSTR  szFileURL,
LPSTR  szFileExtension,
BOOL  bHidden 
)

Definition at line 96 of file plugin.cpp.

                               :
  m_pNPInstance(pNPInstance),
  m_wMode(wMode),
  m_hInst(hInst),
  m_hWnd(NULL),
  m_hWndParent(NULL),
  m_hWndDialog(NULL),
  m_hIcon(NULL),
  m_pNPMIMEType(NULL),
  m_szPageURL(NULL),
  m_szFileURL(NULL),
  m_szFileExtension(NULL),
  m_bOnline(TRUE),
  m_bJava(TRUE),
  m_bJavaScript(TRUE),
  m_bSmartUpdate(TRUE),
  m_szURLString(NULL),
  m_szCommandMessage(NULL),
  m_bWaitingStreamFromPFS(FALSE),
  m_PFSStream(NULL),
  m_bHidden(bHidden)
{
  dbgOut1("CPlugin::CPlugin()");
  assert(m_hInst != NULL);
  assert(m_pNPInstance != NULL);

  if(pluginType && *pluginType)
  {
    m_pNPMIMEType = (NPMIMEType)new char[lstrlen((LPSTR)pluginType) + 1];
    if(m_pNPMIMEType != NULL)
      lstrcpy((LPSTR)m_pNPMIMEType, pluginType);
  }

  if(szPageURL && *szPageURL)
  {
    m_szPageURL = new char[lstrlen(szPageURL) + 1];
    if(m_szPageURL != NULL)
      lstrcpy(m_szPageURL, szPageURL);
  }
  
  if(szFileURL && *szFileURL)
  {
    m_szFileURL = new char[lstrlen(szFileURL) + 1];
    if(m_szFileURL != NULL)
      lstrcpy(m_szFileURL, szFileURL);
  }

  if(szFileExtension && *szFileExtension)
  {
    m_szFileExtension = new char[lstrlen(szFileExtension) + 1];
    if(m_szFileExtension != NULL)
      lstrcpy(m_szFileExtension, szFileExtension);
  }

  m_hIcon = LoadIcon(m_hInst, MAKEINTRESOURCE(IDI_PLUGICON));

  char szString[1024] = {'\0'};
  LoadString(m_hInst, IDS_CLICK_TO_GET, szString, sizeof(szString));
  if(*szString)
  {
    m_szCommandMessage = new char[lstrlen(szString) + 1];
    if(m_szCommandMessage != NULL)
      lstrcpy(m_szCommandMessage, szString);
  }
}
CPlugin::CPlugin ( NPP  pNPInstance,
USHORT  wMode 
)

Definition at line 60 of file plugin.cpp.

CPlugin::CPlugin ( NPP  pNPInstance,
WORD  wMode 
)

Member Function Documentation

void CPlugin::AddMimeTypeToList ( StringPtr  cTypeString) [protected]

Definition at line 929 of file NullPlugin.cpp.

{
       if (sRunningOnOSX)
       {
              CFStringRef          pluginKey     = CFSTR("DefaultPluginSeenTypes"); // don't release this
              CFStringRef          mimeType      = ::CFStringCreateWithPascalString(kCFAllocatorDefault, cTypeString, kCFStringEncodingASCII);
              CFArrayRef           prefsList     = (CFArrayRef)::CFPreferencesCopyAppValue(pluginKey, kCFPreferencesCurrentApplication);
              Boolean                     foundType     = false;

              if (prefsList == NULL)
              {
                     CFStringRef stringArray[1];
                     stringArray[0] = mimeType;
                     
                     prefsList = ::CFArrayCreate(kCFAllocatorDefault, (const void **)stringArray, 1, &kCFTypeArrayCallBacks);
                     if (prefsList)
                     {
                            ::CFPreferencesSetAppValue(pluginKey, prefsList, kCFPreferencesCurrentApplication);
                            ::CFRelease(prefsList);
                     }
              }
              else
              {
                     if (::CFGetTypeID(prefsList) == ::CFArrayGetTypeID())
                     {
                            // first make sure it's not in the list
                            CFIndex count = ::CFArrayGetCount(prefsList);
                            for (CFIndex i = 0; i < count; i ++)
                            {
                                   CFStringRef item = (CFStringRef)::CFArrayGetValueAtIndex(prefsList, i); // does not retain
                                   if (item &&
                                          (::CFGetTypeID(item) == ::CFStringGetTypeID()) &&
                                          (::CFStringCompareWithOptions(item, mimeType,
                                                        CFRangeMake(0, ::CFStringGetLength(item)), kCFCompareCaseInsensitive) == kCFCompareEqualTo))
                                   {
                                          foundType = true;
                                          break;
                                   }
                            }
                            
                            if (!foundType && !fHiddenPlugin)
                            {
                                   CFMutableArrayRef typesArray = ::CFArrayCreateMutableCopy(kCFAllocatorDefault, 0, (CFArrayRef)prefsList);
                                   if (typesArray)
                                   {
                                          ::CFArrayAppendValue(typesArray, mimeType);
                                          ::CFPreferencesSetAppValue(pluginKey, typesArray, kCFPreferencesCurrentApplication);
                                   }
                            }
                     }
                     ::CFRelease(prefsList);
              }
              ::CFRelease(mimeType);
       }
       else
       {
              Handle hTypeList;
              SInt32 dwCount;
              SInt32 index;
              Str255 oldType;
              SInt16 wResFile;
              Boolean failedToFind = true;

              wResFile = FSpOpenResFile(&CPlugin::sDataFileSpec, fsRdWrPerm);
              if (wResFile != -1) {
                     hTypeList = Get1Resource('STR#', rTypeListStrings);
                     if (hTypeList != NULL) {
                            dwCount = **((short **)hTypeList);
                            
                            // First make sure it's not already in the list.
                            for (index = 1; index <= dwCount; index++) {
                                   GetIndString(oldType, rTypeListStrings, index);

                                   // if the mimetype already exists in our list, or the plugin is NOT hidden,
                                   // don't bring up the dialog box
                                   if (EqualString(cTypeString, oldType, true, true) && !fHiddenPlugin) {
                                          failedToFind = false;
                                          break;                                           // Found a match, so bail out!
                                   }
                            }
                            if (failedToFind) {
                                   // Grow the string list handle
                                   Size itsSize = GetHandleSize(hTypeList);
                                   Size typeSize = cTypeString[0] + 1;
                                   SetHandleSize(hTypeList, itsSize + typeSize);
                            
                                   // Increment the count of strings in the list
                                   (**((short**)hTypeList)) = (short)(++dwCount);   

                                   // Copy the data from our string into the handle
                                   long dwCount = Munger(hTypeList, itsSize, NULL, typeSize, cTypeString, typeSize);

                                   // Mark the resource as changed so it will be written out
                                   if (dwCount > 0) {
                                          ChangedResource(hTypeList);
                                          UpdateResFile(wResFile);
                                   }
                            }
                            ReleaseResource(hTypeList);
                     }
                     FSClose(wResFile);
              }
       }
}

Here is the call graph for this function:

Here is the caller graph for this function:

void CPlugin::AskAndLoadURL ( ) [protected]

Definition at line 1127 of file NullPlugin.cpp.

{
       char   *pTheURL;
       SInt32 dwLen;
       Str255 ourType;

       if (!m_bOffline) {
              // Convert the mime-type C string to a Pascal string.
              dwLen = strlen(fType);
              if (dwLen > 255) {          // don't blow out the Str255
                     dwLen = 255;
              }
              BlockMoveData(fType, &ourType[1], dwLen);
              ourType[0] = dwLen;

              // NOTE: We need to set the cursor because almost always we will have set it to the
              // hand cursor before we get here.
              Cursor qdArrow;
              SetCursor(GetQDGlobalsArrow(&qdArrow));

              // Now that weÕve queried the user about this mime type,
              // add it to our list so we wonÕt bug them again.
              AddMimeTypeToList(ourType);
              
              //
              // If the user clicked "Get the Plug-in", either execute the
              // JavaScript file-installation URL, or ask Netscape to open
              // a new window with the page URL.  The title of the window
              // is arbitrary since it has nothing to do with the actual
              // window title shown to the user (itÕs only used internally).
              //
              NPN_PushPopupsEnabledState(fInstance, true);

              if (fFileURL != NULL) {
                     (void) NPN_GetURL(fInstance, fFileURL, "_current");
              } else if (fPageURL != NULL) {
                     NPN_GetURL(fInstance, fPageURL, "_blank");
              } else {
                     pTheURL = MakeDefaultURL();
                     if (!m_bJavaScript) {
                            NPN_GetURL(fInstance, pTheURL, "_blank");
                     } else {
                            NPN_GetURL(fInstance, pTheURL, NULL);
                     }
                     NPN_MemFree(pTheURL);
              }

              NPN_PopPopupsEnabledState(fInstance);

              fUserInstalledPlugin = true;
              if (FocusDraw()) {
                     Draw(kUnhilited);
                     RestoreDraw();
              }
       }
}

Here is the call graph for this function:

Here is the caller graph for this function:

Reimplemented from CPluginBase.

Definition at line 466 of file plugin.cpp.

{
  if (!m_Pref_bAutoStartScript)
    return;

  CScripter scripter;
  scripter.associate(this);

  char szFileName[_MAX_PATH];
  getModulePath(szFileName, sizeof(szFileName));
  strcat(szFileName, m_Pref_szScriptFile);

  if(scripter.createScriptFromFile(szFileName))
  {
    int iRepetitions = scripter.getCycleRepetitions();
    int iDelay = scripter.getCycleDelay();
    if(iDelay < 0)
      iDelay = 0;

    assert(pLogger != NULL);
    pLogger->resetStartTime();

    for(int i = 0; i < iRepetitions; i++)
    {
      scripter.executeScript();
      if(iDelay != 0)
        XP_Sleep(iDelay);
    }
  }
  else
  {
    MessageBox(NULL, "Script file not found or invalid", "", MB_OK | MB_ICONERROR);
  }
}

Here is the call graph for this function:

Definition at line 1050 of file NullPlugin.cpp.

{
       Boolean failedToFind = true;

       if (sRunningOnOSX)
       {
              CFStringRef          pluginKey = CFSTR("DefaultPluginSeenTypes"); // don't release this
              CFStringRef          mimeType  = ::CFStringCreateWithCString(kCFAllocatorDefault, fType, kCFStringEncodingASCII);
              CFArrayRef           prefsList = (CFArrayRef)::CFPreferencesCopyAppValue(pluginKey, kCFPreferencesCurrentApplication);
              if (prefsList)
              {
                     if (::CFGetTypeID(prefsList) == ::CFArrayGetTypeID())
                     {
                            CFIndex count = ::CFArrayGetCount(prefsList);
                            for (CFIndex i = 0; i < count; i ++)
                            {
                                   CFStringRef item = (CFStringRef)::CFArrayGetValueAtIndex(prefsList, i); // does not retain
                                   if (item &&
                                          (::CFGetTypeID(item) == ::CFStringGetTypeID()) &&
                                          (::CFStringCompareWithOptions(item, mimeType,
                                                        CFRangeMake(0, ::CFStringGetLength(item)), kCFCompareCaseInsensitive) == kCFCompareEqualTo))
                                   {
                                          failedToFind = false;
                                          break;
                                   }
                            }
                     }
                     ::CFRelease(prefsList);
              }
              ::CFRelease(mimeType);
       }
       else
       {
              Handle hTypeList;
              SInt32 index;
              Str255 oldType;
              Str255 ourType;
              SInt16 wResFile;

              wResFile = FSpOpenResFile(&CPlugin::sDataFileSpec, fsRdPerm);
              if (wResFile != -1) {
                     hTypeList = Get1Resource('STR#', rTypeListStrings);
                     if (hTypeList != NULL) {
                            // Convert the mime-type C string to a Pascal string.
                            index = strlen(fType);
                            if (index > 255) {          // don't blow out the Str255
                                   index = 255;
                            }
                            BlockMoveData(fType, &ourType[1], index);
                            ourType[0] = index;

                            short count = **((short **)hTypeList);
                            
                            // Iterate through all the strings in the list.
                            for (index = 1; index <= count; index++) {
                                   GetIndString(oldType, rTypeListStrings, index);

                                   // if the mimetype already exists in our list, or the plugin is NOT hidden,
                                   // don't bring up the dialog box
                                   if (EqualString(ourType, oldType, true, true) && !fHiddenPlugin) {
                                          failedToFind = false;
                                          break;                                           // Found a match, so bail out!
                                   }
                            }
                            ReleaseResource(hTypeList);
                     }
                     FSClose(wResFile);
              }
       }
       return(failedToFind);
}

Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 152 of file plugin.cpp.

{
  strcpy(m_String, "");

#ifdef XP_WIN
  InvalidateRect(m_hWnd, NULL, TRUE);
  UpdateWindow(m_hWnd);
#endif
}
void CPlugin::Constructor ( NPP  instance,
NPMIMEType  type,
uint16  mode,
int16  argc,
char *  argn[],
char *  argv[] 
)

Definition at line 530 of file NullPlugin.cpp.

{
       fWindow = NULL;
       fPageURL = NULL;
       fFileURL = NULL;
       fInstance = instance;
       fMode = mode;    // Mode is NP_EMBED, NP_FULL, or NP_BACKGROUND (see npapi.h)
       fAskedLoadURL = false;
       fUserInstalledPlugin = false;
       
       // Save a copy of our mime type string
       short typeLength = strlen(type);
       fType = (char*)NPN_MemAlloc(typeLength+1);
       if (fType != NULL)
              strcpy(fType, type);
       
       // Make a handy region for use in FocusDraw
       fSaveClip = NewRgn();

       // determine if the plugin is specified as HIDDEN
       if(IsPluginHidden(argc, argn, argv))
              fHiddenPlugin = true;
       else
              fHiddenPlugin = false;

       // Get some information about our environment
       NPN_GetValue(fInstance, NPNVisOfflineBool, (void *)&m_bOffline);
       NPN_GetValue(fInstance, NPNVjavascriptEnabledBool, (void *)&m_bJavaScript);

       // Figure out what URL we will go to
       DetermineURL(argc, argn, argv);
}

Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 309 of file plugin.cpp.

{
  if(m_szURLString != NULL)
  {
    delete [] m_szURLString;
    m_szURLString = NULL;
  }

  // check if there is file URL first
  if(!m_bSmartUpdate && m_szFileURL != NULL)
  {
    m_szURLString = new char[strlen(m_szFileURL) + 1];
    if(m_szURLString == NULL)
      return NULL;
    strcpy(m_szURLString, m_szFileURL);
    return m_szURLString;
  }
  
  // if not get the page URL
  char * szAddress = NULL;
  char *urlToOpen = NULL;
  char contentTypeIsJava = 0;

  if (NULL != m_pNPMIMEType) {
    contentTypeIsJava = (0 == strcmp("application/x-java-vm",
                                 m_pNPMIMEType)) ? 1 : 0;
  }
  
  if(!m_bSmartUpdate && m_szPageURL != NULL && !contentTypeIsJava)
  {
    szAddress = new char[strlen(m_szPageURL) + 1];
    if(szAddress == NULL)
      return NULL;
    strcpy(szAddress, m_szPageURL);

    m_szURLString = new char[strlen(szAddress) + 1 +
                             strlen((PSZ)m_pNPMIMEType) + 1];

    if(m_szURLString == NULL)
      return NULL;

    // Append the MIME type to the URL
    sprintf(m_szURLString, "%s?%s", szAddress, (PSZ)m_pNPMIMEType);
  }
  else // default
  {
    if(!m_bSmartUpdate)
    {
      urlToOpen = szDefaultPluginFinderURL;
      
      if (contentTypeIsJava) {
        urlToOpen = szPageUrlForJVM;
      }

      szAddress = new char[strlen(urlToOpen) + 1];
      if(szAddress == NULL)
        return NULL;
      strcpy(szAddress, urlToOpen);

      m_szURLString = new char[strlen(szAddress) + 10 +
                               strlen((PSZ)m_pNPMIMEType) + 1];

      if(m_szURLString == NULL)
        return NULL;

      // Append the MIME type to the URL
      sprintf(m_szURLString, "%s?mimetype=%s",
              szAddress, (PSZ)m_pNPMIMEType);
    }
    else
    {
      urlToOpen = szPageUrlForJavaScript;

      if (contentTypeIsJava) {
       urlToOpen = szPageUrlForJVM;
      }

      // wsprintf doesn't like null pointers on NT or 98, so
      // change any null string pointers to null strings
      if (!m_szPageURL) {
        m_szPageURL = new char[1];
        m_szPageURL[0] = '\0';
      }

      if (!m_szFileURL) {
        m_szFileURL = new char[1];
        m_szFileURL[0] = '\0';
      }

      m_szURLString = new char[strlen(szPluginFinderCommandBeginning) + strlen(urlToOpen) + 10 + 
                               strlen((PSZ)m_pNPMIMEType) + 13 +
                               strlen((PSZ)m_szPageURL) + 11 + 
                               strlen((PSZ)m_szFileURL) +
                               strlen(szPluginFinderCommandEnd) + 1];
      sprintf(m_szURLString, "%s%s?mimetype=%s&pluginspage=%s&pluginurl=%s%s",
              szPluginFinderCommandBeginning, urlToOpen, 
              (PSZ)m_pNPMIMEType, m_szPageURL, m_szFileURL, szPluginFinderCommandEnd);
    }
  }

  if(szAddress != NULL)
    delete [] szAddress;

  return m_szURLString;
}

Here is the caller graph for this function:

void CPlugin::Delete ( Ptr  ptr) [protected]
NPError CPlugin::destroyStream ( NPStream stream,
NPError  reason 
)
NPError CPlugin::destroyStream ( NPStream stream,
NPError  reason 
)

Definition at line 572 of file plugin.cpp.

{
  if (stream == m_PFSStream)
    m_PFSStream = NULL;

  return NPERR_NO_ERROR;
}

Here is the caller graph for this function:

Definition at line 567 of file NullPlugin.cpp.

Here is the call graph for this function:

Here is the caller graph for this function:

void CPlugin::DetermineURL ( int16  argc,
char *  argn[],
char *  argv[] 
) [protected]

Definition at line 828 of file NullPlugin.cpp.

{
       char*  url;
       SInt32 additionalLength = 0;
       SInt32 i;

       // Appended to the URL will be a "?" and the mime type of this instance.  This lets the server
       // do something intelligent with a CGI script.

       if (fType != NULL)
              additionalLength += (strlen(fType) + 1);         // Add 1 for '?'

       // The page designer can specify a URL where the plugin for this type can be downloaded.  Here
       // we scan the arguments for this attribute and save it away if we
       // find it for later use by LoadPluginURL().
       //
       for (i = 0; i < argc; i++) {
              if ((strcasecmp(argn[i], "PLUGINSPAGE") == 0) || (strcasecmp(argn[i], "CODEBASE") == 0)) {
                     url = argv[i];
                     fPageURL = (char*)NPN_MemAlloc(strlen(url) + 1 + additionalLength);   // Add 1 for '\0'
                     if (fPageURL != NULL) {
                            if (additionalLength > 0) {
                                   sprintf(fPageURL, "%s?%s", url, fType);
                            } else {
                                   strcpy(fPageURL, url);      
                            }
                     }
                     break;
              } else if ((strcasecmp(argn[i], "PLUGINURL") == 0) || (strcasecmp(argn[i], "CLASSID") == 0)) {
                     url = argv[i];
                     if (CPlugin::sInstallCommand != NULL) {
                            // Allocate a new string
                            fFileURL = (char*)NPN_MemAlloc(strlen(CPlugin::sInstallCommand) + 1 + strlen(url)); 
                            if (fFileURL != NULL)
                                   sprintf(fFileURL, CPlugin::sInstallCommand, url);
                     }
                     break;
              }
       }
}

Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 298 of file plugin.cpp.

{
  // due to current JavaScript problems never do it smart for now 5.1.98
  return FALSE;

  if(m_bOnline && m_bJava && m_bJavaScript && m_bSmartUpdate && useDefaultURL_P())
    return TRUE;
  else
    return FALSE;
}

Here is the call graph for this function:

void CPlugin::Draw ( HiliteState  hilite) [protected]

Definition at line 674 of file NullPlugin.cpp.

{
       UInt8         *pTheText;
       SInt32        height = fWindow->height;
       SInt32        width = fWindow->width;
       SInt32        centerX = (width) >> 1;
       SInt32        centerY = (height) >> 1;
       Rect          drawRect;
       RGBColor      black = { 0x0000, 0x0000, 0x0000 };
       RGBColor      white = { 0xFFFF, 0xFFFF, 0xFFFF };
       RGBColor      hiliteColor = { 0x0000, 0x0000, 0x0000 };
       short         transform;

       drawRect.top = 0;
       drawRect.left = 0;
       drawRect.bottom = height;
       drawRect.right = width;

       if (height < 4 && width < 4)
              return;
              
       PenNormal();
       RGBForeColor(&black);
       RGBBackColor(&white);

       Pattern qdWhite;
       FillRect(&drawRect, GetQDGlobalsWhite(&qdWhite));

       if (hilite == kHilited) {
              hiliteColor.red = 0xFFFF;
              transform = ttSelected;
       } else {
              hiliteColor.blue = 0xFFFF;
              transform = ttNone;
       }

       RGBForeColor(&hiliteColor);
       FrameRect(&drawRect);
       
       if (height > 32 && width > 32 && CPlugin::sIconHandle != NULL)
       {
              drawRect.top = centerY - 16;
              drawRect.bottom = centerY + 16;
              drawRect.left = centerX - 16;
              drawRect.right = centerX + 16;
              PlotCIconHandle(&drawRect, atAbsoluteCenter, transform, CPlugin::sIconHandle);
       }

       if (fUserInstalledPlugin) {
              pTheText = (unsigned char*)CPlugin::sRefreshText;
       } else {
              pTheText = (unsigned char*)CPlugin::sAltText;
       }
              DrawString(pTheText, width, height, centerX, drawRect);
}

Here is the call graph for this function:

Here is the caller graph for this function:

void CPlugin::DrawString ( const unsigned char *  text,
short  width,
short  height,
short  centerX,
Rect  drawRect 
) [protected]

Definition at line 1189 of file NullPlugin.cpp.

{
       short length, textHeight, textWidth;
 
       if(text == NULL)
              return;
       
       length = strlen((char*)text);
       TextFont(20);
       TextFace(underline);
       TextMode(srcCopy);
       TextSize(10);
       
       FontInfo fontInfo;
       GetFontInfo(&fontInfo);

       textHeight = fontInfo.ascent + fontInfo.descent + fontInfo.leading;
       textWidth = TextWidth(text, 0, length);
              
       if (width > textWidth && height > textHeight + 32)
       {
              MoveTo(centerX - (textWidth >> 1), drawRect.bottom + textHeight);
              DrawText(text, 0, length);
       }             
}

Here is the caller graph for this function:

Boolean CPlugin::FocusDraw ( ) [protected]

Definition at line 777 of file NullPlugin.cpp.

{
       if (fWindow == NULL)
              return false;
              
       NP_Port* npport = (NP_Port*) fWindow->window;
       CGrafPtr ourPort = npport->port;
       
       if (fWindow->clipRect.left < fWindow->clipRect.right)
       {
              GetPort(&fSavePort);
              SetPort((GrafPtr) ourPort);
              Rect portRect;
              GetPortBounds(ourPort, &portRect);
              fSavePortTop = portRect.top;
              fSavePortLeft = portRect.left;
              GetClip(fSaveClip);
              
              fRevealedRect.top = fWindow->clipRect.top + npport->porty;
              fRevealedRect.left = fWindow->clipRect.left + npport->portx;
              fRevealedRect.bottom = fWindow->clipRect.bottom + npport->porty;
              fRevealedRect.right = fWindow->clipRect.right + npport->portx;
              SetOrigin(npport->portx, npport->porty);
              ClipRect(&fRevealedRect);

              return true;
       }
       else
              return false;
}

Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 279 of file plugin.cpp.

{
  return m_hInst;
}

Here is the caller graph for this function:

void CPlugin::getLogFileName ( LPSTR  szLogFileName,
int  iSize 
) [virtual]

Reimplemented from CPluginBase.

void CPlugin::getLogFileName ( LPSTR  szLogFileName,
int  iSize 
) [virtual]

Reimplemented from CPluginBase.

Definition at line 168 of file plugin.cpp.

{
  if(getMode() == NP_EMBED)
  {
    char sz[256];
    getModulePath(szLogFileName, iSize);
    WinQueryWindowText(WinWindowFromID(m_hWnd, IDC_EDIT_LOG_FILE_NAME), sizeof(sz), sz);
    strcat(szLogFileName, sz);
  }
  else
    CPluginBase::getLogFileName(szLogFileName, iSize);
}

Here is the call graph for this function:

const WORD CPluginBase::getMode ( ) [inherited]

Definition at line 143 of file plugbase.cpp.

{
  return m_wMode;
}

Here is the caller graph for this function:

void CPlugin::getModulePath ( LPSTR  szPath,
int  iSize 
) [virtual]

Implements CPluginBase.

void CPlugin::getModulePath ( LPSTR  szPath,
int  iSize 
) [virtual]

Implements CPluginBase.

Definition at line 163 of file plugin.cpp.

{
  GetModulePath(m_hInst, szPath, iSize);
}

Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 138 of file plugbase.cpp.

{
  return m_pNPInstance;
}

Here is the caller graph for this function:

Definition at line 148 of file plugbase.cpp.

{
  return m_pStream;
}

Here is the caller graph for this function:

Definition at line 289 of file plugin.cpp.

{
  return m_hWndParent;
}

Definition at line 492 of file plugin.cpp.

{
  if(m_szCommandMessage != NULL)
  {
    delete [] m_szCommandMessage;
    m_szCommandMessage = NULL;
  }

  char szString[1024] = {'\0'};
  WinLoadString((HAB)0, m_hInst, IDS_CLICK_WHEN_DONE, sizeof(szString), szString);
  if(*szString)
  {
    m_szCommandMessage = new char[strlen(szString) + 1];
    if(m_szCommandMessage != NULL)
      strcpy(m_szCommandMessage, szString);
  }

  WinInvalidateRect(m_hWnd, NULL, TRUE);
//  UpdateWindow(m_hWnd);

  getPluginRegular();
}

Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 415 of file plugin.cpp.

{
  assert(m_bOnline);

  char * szURL = createURLString();

  assert(szURL != NULL);
  if(szURL == NULL)
    return;

  dbgOut3("CPlugin::getPluginRegular(), %#08x '%s'", m_pNPInstance, szURL);

  NPN_GetURL(m_pNPInstance, szURL, NULL);
  m_bWaitingStreamFromPFS = TRUE;
}

Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 431 of file plugin.cpp.

{
/*
  static char szJSString[2048];

  sprintf(szJSString, 
           szPluginFinderCommandFormatString, 
           szDefaultPluginFinderURL, 
           m_pNPMIMEType, 
           (m_szFileExtension != NULL) ? m_szFileExtension : szDefaultFileExt);

  dbgOut3("%#08x '%s'", m_pNPInstance, szJSString);

  assert(*szJSString);

  NPN_GetURL(m_pNPInstance, szJSString, "smartupdate_plugin_finder");
*/
}

Definition at line 176 of file plugin.cpp.

{
  if (!m_pScriptablePeer) {
    m_pScriptablePeer = new nsScriptablePeer(this);
    if(!m_pScriptablePeer)
      return NULL;

    NS_ADDREF(m_pScriptablePeer);
  }

  // add reference for the caller requesting the object
  NS_ADDREF(m_pScriptablePeer);
  return m_pScriptablePeer;
}

Here is the call graph for this function:

Here is the caller graph for this function:

void CPlugin::getVersion ( char **  aVersion)

Definition at line 162 of file plugin.cpp.

{
  const char *ua = NPN_UserAgent(m_pNPInstance);
  char*& version = *aVersion;
  version = (char*)NPN_MemAlloc(1 + strlen(ua));
  if (version)
    strcpy(version, ua);
}

Here is the call graph for this function:

Definition at line 285 of file plugin.cpp.

{
  return m_hWnd;
}

Here is the caller graph for this function:

Definition at line 118 of file plugin.cpp.

{
#ifdef XP_MAC
    NPEvent* ev = (NPEvent*)event;
    if (m_Window) {
        Rect box = { m_Window->y, m_Window->x,
                     m_Window->y + m_Window->height, m_Window->x + m_Window->width };
        if (ev->what == updateEvt) {
            ::TETextBox(m_String, strlen(m_String), &box, teJustCenter);
        }
    }
#endif
    return 0;
}

Here is the caller graph for this function:

Boolean CPlugin::HandleEvent ( EventRecord *  ev)

Definition at line 618 of file NullPlugin.cpp.

{
       Boolean eventHandled = false;
       
       switch (ev->what)
       {
              case mouseDown:
                     MouseDown();
                     eventHandled = true;
                     break;
                     
              case updateEvt:
                     if (FocusDraw()) {
                            Draw(kUnhilited);
                            RestoreDraw();
                     }
                     eventHandled = true;
                     break;
                     
              case NPEventType_AdjustCursorEvent:
                     if (CPlugin::sHandCursor != NULL)
                            SetCursor(*CPlugin::sHandCursor);
                     if (fUserInstalledPlugin) {
                            if (CPlugin::sRefreshText != NULL)
                                   NPN_Status(fInstance, CPlugin::sRefreshText);                         
                     } else {
                            if (CPlugin::sAltText != NULL)
                                   NPN_Status(fInstance, CPlugin::sAltText);
                     }
                     eventHandled = true;
                     break;
                     
              case nullEvent:
                     //
                     // NOTE: We have to wait until idle time
                     // to ask the user if they want to visit
                     // the URL to avoid reentering XP code.
                     //
                     if (!fAskedLoadURL) {
                            if (CheckMimeTypes())
                                   AskAndLoadURL();
                            fAskedLoadURL = true;
                     }
                     break;
              default:
                     break;
       }
              
       return eventHandled;
}

Here is the call graph for this function:

Here is the caller graph for this function:

NPBool CPlugin::init ( NPWindow pNPWindow)

Definition at line 77 of file plugin.cpp.

{
  if(pNPWindow == NULL)
    return FALSE;

#ifdef XP_WIN
  m_hWnd = (HWND)pNPWindow->window;
  if(m_hWnd == NULL)
    return FALSE;

  // subclass window so we can intercept window messages and
  // do our drawing to it
  lpOldProc = SubclassWindow(m_hWnd, (WNDPROC)PluginWinProc);

  // associate window with our CPlugin object so we can access 
  // it in the window procedure
  SetWindowLong(m_hWnd, GWL_USERDATA, (LONG)this);
#endif

  m_Window = pNPWindow;

  m_bInitialized = TRUE;
  return TRUE;
}

Here is the call graph for this function:

Here is the caller graph for this function:

BOOL CPlugin::init ( HWND  hWnd)

Definition at line 200 of file plugin.cpp.

{
  dbgOut1("CPlugin::init()");

  nsISupports * sm = NULL;
  nsIPref * nsPrefService = NULL;
  PRBool bSendUrls = PR_FALSE; // default to false if problem getting pref

  // note that Mozilla will add reference, so do not forget to release
  NPN_GetValue(NULL, NPNVserviceManager, &sm);

  // do a QI on the service manager we get back to ensure it's the one we are expecting
  if(sm) {
    sm->QueryInterface(NS_GET_IID(nsIServiceManager), (void**)&gServiceManager);
    NS_RELEASE(sm);
  }
  
  if (gServiceManager) {
    // get service using its contract id and use it to allocate the memory
    gServiceManager->GetServiceByContractID(NS_PREF_CONTRACTID, NS_GET_IID(nsIPref), (void **)&nsPrefService);
    if(nsPrefService) {      
      nsPrefService->GetBoolPref("application.use_ns_plugin_finder", &bSendUrls);
      NS_RELEASE(nsPrefService);
    }
  }
  m_bSmartUpdate = bSendUrls;

  if(!m_bHidden)
  {
    assert(WinIsWindow((HAB)0, hWndParent));

    if(WinIsWindow((HAB)0, hWndParent))
      m_hWndParent = hWndParent;

    RECTL rcParent;
    WinQueryWindowRect(m_hWndParent, &rcParent);

    m_hWnd = WinCreateWindow(m_hWndParent,
                             szNullPluginWindowClassName, 
                             "NULL Plugin", 
                             0,
                             0,0, rcParent.xRight, rcParent.yTop,
                             m_hWndParent,
                             HWND_TOP,
                             255,
                             (PVOID)this,
                             0);

    WinSetPresParam(m_hWnd, PP_FONTNAMESIZE, 10, (PVOID)"9.WarpSans");

    assert(m_hWnd != NULL);
    if((m_hWnd == NULL) || (!WinIsWindow((HAB)0, m_hWnd)))
      return FALSE;

//    UpdateWindow(m_hWnd);
    WinShowWindow(m_hWnd, TRUE);
  }

  if(IsNewMimeType((PSZ)m_pNPMIMEType) || m_bHidden)
    showGetPluginDialog();

  return TRUE;
}

Here is the call graph for this function:

BOOL CPlugin::init ( HWND  hWnd)
BOOL CPluginBase::init ( DWORD  dwInitData) [virtual, inherited]

Definition at line 104 of file plugbase.cpp.

{
  if(m_wMode == NP_EMBED)
    return initEmbed(dwInitData);
  else
    return initFull(dwInitData);
}

Here is the call graph for this function:

Here is the caller graph for this function:

BOOL CPlugin::initEmbed ( DWORD  dwInitData) [virtual]

Implements CPluginBase.

BOOL CPlugin::initEmbed ( DWORD  dwInitData) [virtual]

Implements CPluginBase.

Definition at line 183 of file plugin.cpp.

{
  restorePreferences();

  HWND hWndParent = (HWND)dwInitData;

  if(WinIsWindow((HAB)0, hWndParent))
    m_hWndParent = hWndParent;

  WinLoadDlg(m_hWndParent, m_hWndParent, (PFNWP)TesterDlgProc, m_hInst, IDD_DIALOG_TESTER, (PVOID)this);

  m_bPluginReady = (m_hWnd != NULL);

  return m_bPluginReady;
}

Here is the call graph for this function:

BOOL CPlugin::initFull ( DWORD  dwInitData) [virtual]

Reimplemented from CPluginBase.

BOOL CPlugin::initFull ( DWORD  dwInitData) [virtual]

Reimplemented from CPluginBase.

Definition at line 199 of file plugin.cpp.

Definition at line 368 of file NullPlugin.cpp.

{
       Handle string;
       short  saveResFile = CurResFile();

       UseResFile(gResFile);

       long   systemVersion;
       OSErr  err = ::Gestalt(gestaltSystemVersion, &systemVersion);
       sRunningOnOSX = (err == noErr) && (systemVersion >= 0x00001000);

       // Get Resources
       CPlugin::sIconHandle = GetCIcon(rBrokenPluginIcon);
       CPlugin::sHandCursor = GetCursor(rHandCursor);

       // Get "alt text" string
       string = Get1Resource('STR ', rAltTextString);
       if (string && *string)
       {
              short stringLen = (*string)[0];
              CPlugin::sAltText = (char*)NPN_MemAlloc(stringLen +1);
              if (CPlugin::sAltText != NULL)
              {
                     short src = 1;
                     short dest = 0;
                     while (src <= stringLen)
                            CPlugin::sAltText[dest++] = (*string)[src++];
                     CPlugin::sAltText[dest++] = 0;
              }
       }
       ReleaseResource(string);
       
       // Get "refresh text" string
       string = Get1Resource('STR ', rRefreshTextString);
       if (string && *string)
       {
              short stringLen = (*string)[0];
              CPlugin::sRefreshText = (char*)NPN_MemAlloc(stringLen + 1);
              if (CPlugin::sRefreshText != NULL)
              {
                     short src = 1;
                     short dest = 0;
                     while (src <= stringLen)
                            CPlugin::sRefreshText[dest++] = (*string)[src++];
                     CPlugin::sRefreshText[dest++] = 0;
              }
       }
       ReleaseResource(string);
       
       // Get JavaScript install command string
       string = Get1Resource('STR ', rJavaScriptInstallCommand);
       if (string && *string)
       {
              short stringLen = (*string)[0];
              CPlugin::sInstallCommand = (char*)NPN_MemAlloc(stringLen + 1);
              if (CPlugin::sInstallCommand != NULL)
              {
                     short src = 1;
                     short dest = 0;
                     while (src <= stringLen)
                            CPlugin::sInstallCommand[dest++] = (*string)[src++];
                     CPlugin::sInstallCommand[dest++] = 0;
              }
       }
       ReleaseResource(string);

       // Get default plug-in page URL
       string = Get1Resource('STR ', rDefaultPluginURL);
       if (string && *string)
       {
              short stringLen = (*string)[0];
              CPlugin::sDefaultPage = (char*)NPN_MemAlloc(stringLen + 1);
              if (CPlugin::sDefaultPage != NULL)
              {
                     short src = 1;
                     short dest = 0;
                     while (src <= stringLen)
                            CPlugin::sDefaultPage[dest++] = (*string)[src++];
                     CPlugin::sDefaultPage[dest++] = 0;
              }
       }
       ReleaseResource(string);

       // Get javascript plug-in page URL
       string = Get1Resource('STR ', rJavaScriptPageURL);
       if (string && *string)
       {
              short stringLen = (*string)[0];
              CPlugin::sJavaScriptPage = (char*)NPN_MemAlloc(stringLen + 1);
              if (CPlugin::sJavaScriptPage != NULL)
              {
                     short src = 1;
                     short dest = 0;
                     while (src <= stringLen)
                            CPlugin::sJavaScriptPage[dest++] = (*string)[src++];
                     CPlugin::sJavaScriptPage[dest++] = 0;
              }
       }
       ReleaseResource(string);

       UseResFile(saveResFile);

       if (!sRunningOnOSX) // We'll make some CFPreferences the first time we have to on OS X
       {
              ProcessSerialNumber psn;
              ProcessInfoRec       info;
              FSSpec fsTheApp;
              SInt16 wResFile;
              OSErr  wErr;
              
              psn.highLongOfPSN = 0;
              psn.lowLongOfPSN  = kCurrentProcess;

              info.processInfoLength = sizeof(ProcessInfoRec);
              info.processName = nil;
              info.processAppSpec = &fsTheApp;
              wErr = ::GetProcessInformation(&psn, &info);
              if (wErr == noErr) {
                     wErr = FSMakeFSSpec(fsTheApp.vRefNum, fsTheApp.parID, "\p:Plug-ins:Default Plug-in Data", &sDataFileSpec);
                     if (wErr == fnfErr) {
                            FSpCreateResFile(&sDataFileSpec, 'MOSS', 'BINA', smSystemScript);
                            wResFile = FSpOpenResFile(&CPlugin::sDataFileSpec, fsRdWrPerm);
                            if (wResFile != -1) {
                                   // create a STR# with 0 entires (i.e. only a count)
                                   string = NewHandleClear(sizeof(SInt16));
                                   AddResource(string, 'STR#', rTypeListStrings, "\p");
                                   UpdateResFile(wResFile);
                                   ReleaseResource(string);
                            }
                            FSClose(wResFile);
                     }
              }
       }

       return NPERR_NO_ERROR;
}

Here is the call graph for this function:

Here is the caller graph for this function:

Implements CPluginBase.

Implements CPluginBase.

Definition at line 254 of file plugin.cpp.

{
  return FALSE;
}

Implements CPluginBase.

Definition at line 113 of file plugin.cpp.

{
  return m_bInitialized;
}

Here is the caller graph for this function:

Implements CPluginBase.

Implements CPluginBase.

Boolean CPlugin::IsPluginHidden ( int16  argc,
char *  argn[],
char *  argv[] 
) [protected]

Definition at line 1215 of file NullPlugin.cpp.

{
       int i;
       for(i=0; i<argc; i++)
       {
              if(!strcasecmp(argn[i], "HIDDEN"))
                     if(!strcasecmp(argv[i], "TRUE"))
                            return true;
       }
       return false;
}

Here is the call graph for this function:

Here is the caller graph for this function:

BOOL CPlugin::isStandAlone ( ) [virtual]

Implements CPluginBase.

BOOL CPlugin::isStandAlone ( ) [virtual]

Implements CPluginBase.

Definition at line 249 of file plugin.cpp.

{
  return FALSE;
}
char * CPlugin::MakeDefaultURL ( void  ) [protected]

Definition at line 877 of file NullPlugin.cpp.

{
       char   *pDefURL = NULL;
       SInt32 additionalLength = 0;

       // Appended to the URL will be a "?" and the mime type of this instance.  This lets the server
       // do something intelligent with a CGI script.

       if (fType != NULL)
              additionalLength += (strlen(fType) + 1);         // Add 1 for '?'

       if (!m_bJavaScript) {
              if (CPlugin::sDefaultPage != NULL) {
                     pDefURL = (char*)NPN_MemAlloc(strlen(CPlugin::sDefaultPage) + 1 + additionalLength);
                     if (pDefURL != NULL) {
                            if (additionalLength > 0) {
                                   sprintf(pDefURL, "%s?%s", CPlugin::sDefaultPage, fType);
                            } else {
                                   strcpy(pDefURL, CPlugin::sDefaultPage);   
                            }
                     }
              }
       } else {
              if (CPlugin::sJavaScriptPage != NULL) {
                     pDefURL = (char*)NPN_MemAlloc(strlen(szPluginFinderCommandBeginning) +
                                          strlen(CPlugin::sJavaScriptPage) +
                                          additionalLength + strlen(szPluginFinderCommandEnd) + 1);
                     if (pDefURL != NULL) {
                            sprintf(pDefURL, "%s%s%s%s", szPluginFinderCommandBeginning,
                                          CPlugin::sJavaScriptPage, fType, szPluginFinderCommandEnd);
                     }
              }
       }
       return(pDefURL);
}

Here is the call graph for this function:

Here is the caller graph for this function:

DWORD CPlugin::makeNPNCall ( NPAPI_Action  = action_invalid,
DWORD  dw1 = 0L,
DWORD  dw2 = 0L,
DWORD  dw3 = 0L,
DWORD  dw4 = 0L,
DWORD  dw5 = 0L,
DWORD  dw6 = 0L,
DWORD  dw7 = 0L 
) [virtual]

Reimplemented from CPluginBase.

DWORD CPlugin::makeNPNCall ( NPAPI_Action  action = action_invalid,
ULONG  dw1 = 0L,
ULONG  dw2 = 0L,
ULONG  dw3 = 0L,
ULONG  dw4 = 0L,
ULONG  dw5 = 0L,
ULONG  dw6 = 0L,
ULONG  dw7 = 0L 
) [virtual]

Reimplemented from CPluginBase.

Definition at line 312 of file plugin.cpp.

{
  ULONG dwRet = CPluginBase::makeNPNCall(action, dw1, dw2, dw3, dw4, dw5, dw6, dw7);

    // update GUI for Manual mode action
  if((getMode() == NP_EMBED) && (WinIsWindowVisible(m_hWndManual)))
  {
    switch (action)
    {
      case action_npn_new_stream:
      case action_npn_destroy_stream:
      case action_npn_mem_alloc:
      case action_npn_mem_free:
        updateUI(m_hWndManual);
        break;
      default:
        break;
    }
  }

  return dwRet;
}

Here is the call graph for this function:

Here is the caller graph for this function:

int CPlugin::messageBox ( LPSTR  szMessage,
LPSTR  szTitle,
UINT  uStyle 
) [virtual]

Implements CPluginBase.

int CPlugin::messageBox ( LPSTR  szMessage,
LPSTR  szTitle,
UINT  uStyle 
) [virtual]

Implements CPluginBase.

Definition at line 244 of file plugin.cpp.

{
  return WinMessageBox(HWND_DESKTOP, m_hWnd, szMessage, szTitle, 0, uStyle);
}
void CPlugin::MouseDown ( ) [protected]

Definition at line 740 of file NullPlugin.cpp.

{
       if (FocusDraw())     
       {
              Draw(kHilited);
              Boolean inside = true;
  
              // evil CPU-hogging loop on Mac OS X!
              while (StillDown())
              {
                     Point localMouse;
                     GetMouse(&localMouse);
                     Boolean insideNow = ::PtInRect(localMouse, &fRevealedRect);

                     if (insideNow != inside)
                     {
                            Draw(insideNow ? kHilited : kUnhilited);
                            inside = insideNow;
                     }
              }
              
              if (inside) {
                     Draw(kUnhilited);
                     if (!fUserInstalledPlugin)
                            AskAndLoadURL();
                     else
                            RefreshPluginPage();
              }

              RestoreDraw();
       }
}

Here is the call graph for this function:

Here is the caller graph for this function:

Ptr CPlugin::New ( UInt32  size) [protected]
NPError CPlugin::newStream ( NPMIMEType  type,
NPStream stream,
NPBool  seekable,
uint16 stype 
)

Definition at line 554 of file plugin.cpp.

{
  if (!m_bWaitingStreamFromPFS)
    return NPERR_NO_ERROR;

  m_bWaitingStreamFromPFS = FALSE;
  m_PFSStream = stream;

  if (stream) {
    if (type && !strcmp(type, "application/x-xpinstall"))
      NPN_GetURL(m_pNPInstance, stream->url, "_self");
    else
      NPN_GetURL(m_pNPInstance, stream->url, "_blank");
  }

  return NPERR_NO_ERROR;
}

Here is the call graph for this function:

Here is the caller graph for this function:

NPError CPlugin::newStream ( NPMIMEType  type,
NPStream stream,
NPBool  seekable,
uint16 stype 
)

Definition at line 593 of file plugin.cpp.

{
  m_hWnd = hWnd;
}

Definition at line 267 of file plugin.cpp.

{
  m_hWnd = NULL;
}

Here is the caller graph for this function:

void CPlugin::onInit ( HWND  hWnd,
HWND  hWndManual,
HWND  hWndAuto 
)
void CPlugin::onInit ( HWND  hWnd,
HWND  hWndManual,
HWND  hWndAuto 
)

Definition at line 229 of file plugin.cpp.

{
  assert(hWnd != NULL);
  assert(hWndManual != NULL);
  assert(hWndAuto != NULL);

  m_hWnd = hWnd;
  m_hWndManual = hWndManual;
  m_hWndAuto = hWndAuto;

  pLogger->setShowImmediatelyFlag(WinQueryButtonCheckstate(m_hWnd, IDC_CHECK_SHOW_LOG) == BST_CHECKED);
  pLogger->setLogToFrameFlag(WinQueryButtonCheckstate(m_hWnd, IDC_CHECK_LOG_TO_FRAME) == BST_CHECKED);
  pLogger->setLogToFileFlag(WinQueryButtonCheckstate(m_hWnd, IDC_CHECK_LOG_TO_FILE) == BST_CHECKED);
}

Here is the call graph for this function:

void CPlugin::onLButtonUp ( HWND  hWnd,
int  x,
int  y,
UINT  keyFlags 
)
void CPlugin::onLButtonUp ( HWND  hWnd,
int  x,
int  y,
UINT  keyFlags 
)

Definition at line 598 of file plugin.cpp.

{
  if(!readyToRefresh())
    showGetPluginDialog();
  else
    NPN_GetURL(m_pNPInstance, "javascript:navigator.plugins.refresh(true)", "_self");
}

Here is the call graph for this function:

void CPlugin::onLogToFile ( BOOL  bLofToFile)
void CPlugin::onLogToFile ( BOOL  bLofToFile)

Definition at line 272 of file plugin.cpp.

{
  pLogger->setLogToFileFlag(bLogToFile);
  if(!bLogToFile)
    pLogger->closeLogToFile();
}

Here is the call graph for this function:

Here is the caller graph for this function:

void CPluginBase::onNPP_DestroyStream ( NPStream pStream) [inherited]

Definition at line 175 of file plugbase.cpp.

{
  // if this is a stream created by tester, reflect the fact it is destroyed
  if(pStream == m_pStream)
    m_pStream = NULL;

  // if this is a script stream, reflect the fact it is destroyed too, and execute the script
  if(pStream == m_pScriptStream)
  {
    m_pScriptStream = NULL;

    if(!XP_IsFile(m_szScriptCacheFile))
      return;

    CScripter * pScripter = new CScripter();
    pScripter->associate(this);

    if(pScripter->createScriptFromFile(m_szScriptCacheFile))
    {
      char szOutput[128];
      char szExecutingScript[] = "Executing script...";

      strcpy(szOutput, szExecutingScript);
      NPN_Status(m_pNPInstance, szOutput);

      int iRepetitions = pScripter->getCycleRepetitions();
      int iDelay = pScripter->getCycleDelay();
      if(iDelay < 0)
        iDelay = 0;

      assert(pLogger != NULL);
      pLogger->resetStartTime();

      pLogger->setLogToFileFlag(TRUE);
      pLogger->blockDumpToFile(FALSE);

      for(int i = 0; i < iRepetitions; i++)
      {
        wsprintf(szOutput, "%s %i", szExecutingScript, i);
        NPN_Status(m_pNPInstance, szOutput);

        pScripter->executeScript();
        if(iDelay != 0)
          XP_Sleep(iDelay);
      }
    }
    else
      NPN_Status(m_pNPInstance, "Cannot create script...");


    pLogger->setLogToFileFlag(FALSE);

    delete pScripter;

    m_szScriptCacheFile[0] = '\0';

    NPN_Status(m_pNPInstance, "Script execution complete");
  }
}

Here is the call graph for this function:

Here is the caller graph for this function:

void CPluginBase::onNPP_NewStream ( NPP  pInstance,
LPSTR  szMIMEType,
NPStream pStream,
NPBool  bSeekable,
uint16 puType 
) [inherited]

Definition at line 153 of file plugbase.cpp.

Here is the caller graph for this function:

void CPluginBase::onNPP_StreamAsFile ( NPP  pInstance,
NPStream pStream,
const char *  szFileName 
) [inherited]

Definition at line 164 of file plugbase.cpp.

{
  if((m_pScriptStream == NULL) || (pStream != m_pScriptStream) || (szFileName == NULL))
    return;

  strcpy(m_szScriptCacheFile, szFileName);
#ifdef DEBUG
  fprintf(stderr,"CPluginBase::onNPP_StreamAsFile(), Script Cache File \"%s\"", m_szScriptCacheFile);
#endif
}

Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 638 of file plugin.cpp.

{
  RECTL rc;
  HDC hPS;
  int x, y;

  hPS = WinBeginPaint(hWnd, NULLHANDLE, NULL);
  GpiErase(hPS);
  WinQueryWindowRect(hWnd, &rc);

  x = (rc.xRight / 2) - (40 / 2);
  y = (rc.yTop / 2) - ((40) / 2);

  /* Only draw the icon if it fits */
  if(rc.xRight > (40 + 6 + INSET) && rc.yTop > (40 + 6 + INSET) )
  {
    if(m_hIcon != NULL)
      WinDrawPointer(hPS, x, y, m_hIcon, DP_NORMAL);
  }

  POINTL pt[5];

  // white piece
  GpiSetColor(hPS, CLR_WHITE);

  pt[0].x = 1 + INSET;
  pt[0].y = 1 + INSET;
  GpiMove(hPS, &pt[0]);

  pt[0].x = rc.xRight - 2 - INSET;
  pt[0].y = 1 + INSET;
  pt[1].x = rc.xRight - 2 - INSET;
  pt[1].y = rc.yTop -1 - INSET;

  GpiPolyLine(hPS, 2, pt);

  pt[0].x = 2 + INSET;
  pt[0].y = 3 + INSET;
  GpiMove(hPS, &pt[0]);

  pt[0].x = 2 + INSET;
  pt[0].y = rc.yTop - 3 - INSET;
  pt[1].x = rc.xRight - 4 - INSET;
  pt[1].y = rc.yTop - 3 - INSET;

  GpiPolyLine(hPS, 2, pt);

  // pale gray pieces 
  GpiSetColor(hPS, CLR_PALEGRAY);
  pt[0].x = INSET;
  pt[0].y = 1 + INSET;
  GpiMove(hPS, &pt[0]);

  pt[0].x = INSET;
  pt[0].y = rc.yTop - 1 - INSET;
  pt[1].x = rc.xRight - 2 - INSET;
  pt[1].y = rc.yTop - 1 - INSET;

  GpiPolyLine(hPS, 2, pt);

  pt[0].x = rc.xRight - 3 - INSET;
  pt[0].y = rc.yTop - 2 - INSET;
  GpiMove(hPS, &pt[0]);

  pt[0].x = rc.xRight - 3 - INSET;
  pt[0].y = 2 + INSET;
  pt[1].x = 2 + INSET;
  pt[1].y = 2 + INSET;

  GpiPolyLine(hPS, 2, pt);

  // dark gray piece
  GpiSetColor(hPS, CLR_DARKGRAY);

  pt[0].x = 1 + INSET;
  pt[0].y = 2 + INSET;
  GpiMove(hPS, &pt[0]);

  pt[0].x = 1 + INSET;
  pt[0].y = rc.yTop - 2 - INSET;
  pt[1].x = rc.xRight - 4 - INSET;
  pt[1].y = rc.yTop - 2 - INSET;

  GpiPolyLine(hPS, 2, pt);

  // black piece
  GpiSetColor(hPS, CLR_BLACK);

  pt[0].x = rc.xRight - 1 - INSET;
  pt[0].y = rc.yTop - 1 - INSET;
  GpiMove(hPS, &pt[0]);

  pt[0].x = rc.xRight - 1 - INSET;
  pt[0].y = 0 + INSET;
  pt[1].x = 0 + INSET;
  pt[1].y = 0 + INSET;

  GpiPolyLine(hPS, 2, pt);

  /* Offset rectangle by size of highlight(3) + 1 as well as inset */
  /* so that text is not drawn over the border */
  rc.xLeft += 4+INSET;
  rc.xRight -= 4+INSET;
  rc.yTop -= 4+INSET;
  rc.yBottom += 4+INSET;

  DrawCommandMessage(hPS, m_szCommandMessage, &rc);

  WinEndPaint (hPS);
}

Here is the call graph for this function:

void CPlugin::onRButtonUp ( HWND  hWnd,
int  x,
int  y,
UINT  keyFlags 
)
void CPlugin::onRButtonUp ( HWND  hWnd,
int  x,
int  y,
UINT  keyFlags 
)

Definition at line 606 of file plugin.cpp.

{
  if(!readyToRefresh())
    showGetPluginDialog();
  else
    NPN_GetURL(m_pNPInstance, "javascript:navigator.plugins.refresh(true)", "_self");
}

Here is the call graph for this function:

void CPlugin::outputToNativeWindow ( LPSTR  szString) [virtual]

Implements CPluginBase.

void CPlugin::outputToNativeWindow ( LPSTR  szString) [virtual]

Implements CPluginBase.

Definition at line 263 of file plugin.cpp.

{
}
void CPlugin::Print ( NPPrint printInfo)

Definition at line 598 of file NullPlugin.cpp.

{
       NPWindow* printWindow = &(printInfo->print.embedPrint.window);
       
       NPWindow* oldWindow = fWindow;
       fWindow = printWindow;

       if (FocusDraw())
       {
              Draw(kUnhilited);
              RestoreDraw();
       }
       
       fWindow = oldWindow;
}

Here is the call graph for this function:

Here is the caller graph for this function:

void CPlugin::print ( NPPrint pNPPrint)

Definition at line 523 of file plugin.cpp.

{
  dbgOut1("CPlugin::print()");

  if(pNPPrint == NULL)
    return;
}

Here is the caller graph for this function:

void CPlugin::print ( NPPrint pNPPrint)

Definition at line 580 of file plugin.cpp.

{
  char szString[1024] = {'\0'};
  WinLoadString((HAB)0, m_hInst, IDS_CLICK_WHEN_DONE, sizeof(szString), szString);
  if(m_szCommandMessage == NULL)
    return FALSE;

  return (strcmp(m_szCommandMessage, szString) == 0);
}

Here is the caller graph for this function:

Definition at line 1184 of file NullPlugin.cpp.

{
       (void) NPN_GetURL(fInstance, "javascript:navigator.plugins.refresh(true);", "_self");
}

Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 518 of file plugin.cpp.

{
  dbgOut1("CPlugin::resize()");
}

Here is the caller graph for this function:

void CPlugin::RestoreDraw ( ) [protected]

Definition at line 812 of file NullPlugin.cpp.

{
       SetOrigin(fSavePortLeft, fSavePortTop);
       SetClip(fSaveClip);
       SetPort(fSavePort);
}

Here is the caller graph for this function:

Definition at line 82 of file plugin.cpp.

{
  char szFileName[_MAX_PATH];
  GetINIFileName(m_hInst, szFileName, sizeof(szFileName));

  char sz[256];
  XP_GetPrivateProfileString(szSection, KEY_AUTO_MODE, ENTRY_NO, sz, sizeof(sz), szFileName);
  m_Pref_ShowGUI = (stricmp(sz, ENTRY_YES) == 0) ? sg_auto : sg_manual;

  XP_GetPrivateProfileString(szSection, KEY_LOG_FILE, "Test.log", sz, sizeof(sz), szFileName);
  strcpy(m_Pref_szLogFile, sz);

  XP_GetPrivateProfileString(szSection, KEY_SCRIPT_FILE, "Test.pts", sz, sizeof(sz), szFileName);
  strcpy(m_Pref_szScriptFile, sz);

  XP_GetPrivateProfileString(szSection, KEY_TO_FILE, ENTRY_NO, sz, sizeof(sz), szFileName);
  m_Pref_bToFile = (stricmp(sz, ENTRY_YES) == 0) ? TRUE : FALSE;

  XP_GetPrivateProfileString(szSection, KEY_TO_FRAME, ENTRY_YES, sz, sizeof(sz), szFileName);
  m_Pref_bToFrame = (stricmp(sz, ENTRY_YES) == 0) ? TRUE : FALSE;

  XP_GetPrivateProfileString(szSection, KEY_FLUSH_NOW, ENTRY_YES, sz, sizeof(sz), szFileName);
  m_Pref_bFlushNow = (stricmp(sz, ENTRY_YES) == 0) ? TRUE : FALSE;

  XP_GetPrivateProfileString(szSection, KEY_REMEMBER_LAST_API_CALL, ENTRY_YES, sz, sizeof(sz), szFileName);
  m_Pref_bRememberLastCall = (stricmp(sz, ENTRY_YES) == 0) ? TRUE : FALSE;

  XP_GetPrivateProfileString(szSection, KEY_STAND_ALONE, ENTRY_NO, sz, sizeof(sz), szFileName);
  m_Pref_bStandAlone = (stricmp(sz, ENTRY_YES) == 0) ? TRUE : FALSE;
}

Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 585 of file NullPlugin.cpp.

{
       fWindow = window;
}

Here is the caller graph for this function:

Definition at line 450 of file plugin.cpp.

{
  assert(m_pNPMIMEType != NULL);
  if(m_pNPMIMEType == NULL)
    return;

  // Get environment
  BOOL bOffline = FALSE;

  NPN_GetValue(m_pNPInstance, NPNVisOfflineBool, (void *)&bOffline);
  NPN_GetValue(m_pNPInstance, NPNVjavascriptEnabledBool, (void *)&m_bJavaScript);
  //NPN_GetValue(m_pNPInstance, NPNVasdEnabledBool, (void *)&m_bSmartUpdate);

  m_bOnline = !bOffline;

#ifdef OJI
  if(m_bOnline && m_bJavaScript && m_bSmartUpdate && useDefaultURL_P())
  {
    JRIEnv *penv = NPN_GetJavaEnv();
    m_bJava = (penv != NULL);
  }
#else
  m_bJava = FALSE;
#endif
  
  dbgOut1("Environment:");
  dbgOut2("%s", m_bOnline ? "On-line" : "Off-line");
  dbgOut2("Java %s", m_bJava ? "Enabled" : "Disabled");
  dbgOut2("JavaScript %s", m_bJavaScript ? "Enabled" : "Disabled");
  dbgOut2("SmartUpdate %s", m_bSmartUpdate ? "Enabled" : "Disabled");

  if((!m_bSmartUpdate && (m_szPageURL != NULL) || (m_szFileURL != NULL)) || !m_bJavaScript)
  {
    int iRet = WinDlgBox(HWND_DESKTOP, m_hWnd, (PFNWP)GetPluginDialogProc, m_hInst,
                                  IDD_PLUGIN_DOWNLOAD, (PVOID)this);
    if(iRet != IDC_GET_PLUGIN)
      return;
  }
  else
     getPlugin();
}

Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 294 of file plugin.cpp.

{
  switch (sg)
  {
    case sg_manual:
      WinShowWindow(m_hWndManual, TRUE);
      WinShowWindow(m_hWndAuto, FALSE);
      break;
    case sg_auto:
      WinShowWindow(m_hWndManual, FALSE);
      WinShowWindow(m_hWndAuto, TRUE);
      break;
    default:
      assert(0);
      break;
  }
}

Here is the caller graph for this function:

Definition at line 134 of file plugin.cpp.

{
  const char *ua = NPN_UserAgent(m_pNPInstance);
  strcpy(m_String, ua);

#ifdef XP_WIN
  InvalidateRect(m_hWnd, NULL, TRUE);
  UpdateWindow(m_hWnd);
#endif

  if (m_Window) {
    NPRect r = { m_Window->y, m_Window->x,
                 m_Window->y + m_Window->height, m_Window->x + m_Window->width };
    NPN_InvalidateRect(m_pNPInstance, &r);
  }
}

Here is the call graph for this function:

void CPlugin::shut ( ) [virtual]

Reimplemented from CPluginBase.

Definition at line 102 of file plugin.cpp.

{
#ifdef XP_WIN
  // subclass it back
  SubclassWindow(m_hWnd, lpOldProc);
  m_hWnd = NULL;
#endif

  m_bInitialized = FALSE;
}

Here is the call graph for this function:

Here is the caller graph for this function:

void CPlugin::shut ( ) [virtual]

Reimplemented from CPluginBase.

void CPlugin::shut ( ) [virtual]

Reimplemented from CPluginBase.

void CPlugin::Shutdown ( void  ) [static]

Definition at line 509 of file NullPlugin.cpp.

Here is the call graph for this function:

Here is the caller graph for this function:

void CPlugin::shutEmbed ( ) [virtual]

Implements CPluginBase.

void CPlugin::shutEmbed ( ) [virtual]

Implements CPluginBase.

Definition at line 205 of file plugin.cpp.

{
  savePreferences();

  if(m_hWnd != NULL)
  {
    WinDismissDlg(m_hWnd, IDD_DIALOG_TESTER); //WinDestroyWindow(m_hWnd);
    m_hWnd = NULL;
  }

  m_bPluginReady = FALSE;
}

Here is the call graph for this function:

void CPlugin::shutFull ( ) [virtual]

Reimplemented from CPluginBase.

void CPlugin::shutFull ( ) [virtual]

Reimplemented from CPluginBase.

Definition at line 218 of file plugin.cpp.

Implements CPluginBase.

Implements CPluginBase.

Definition at line 259 of file plugin.cpp.

{
}
void CPlugin::updatePrefs ( GUIPrefs  prefs,
int  iValue,
char *  szValue = NULL 
)
void CPlugin::updatePrefs ( GUIPrefs  prefs,
int  iValue,
char *  szValue = NULL 
)

Definition at line 128 of file plugin.cpp.

{
  switch(prefs)
  {
    case gp_mode:
      m_Pref_ShowGUI = (ShowGUI)iValue;
      break;
    case gp_logfile:
      if(szValue && (strlen(szValue) < sizeof(m_Pref_szLogFile)))
        strcpy(m_Pref_szLogFile, szValue);
      break;
    case gp_scriptfile:
      if(szValue && (strlen(szValue) < sizeof(m_Pref_szScriptFile)))
        strcpy(m_Pref_szScriptFile, szValue);
      break;
    case gp_tofile:
      m_Pref_bToFile = (BOOL)iValue;
      break;
    case gp_toframe:
      m_Pref_bToFrame = (BOOL)iValue;
      break;
    case gp_flush:
      m_Pref_bFlushNow = (BOOL)iValue;
      break;
    case gp_rememberlast:
      m_Pref_bRememberLastCall = (BOOL)iValue;
      break;
    case gp_standalone:
      m_Pref_bStandAlone = (BOOL)iValue;
      break;
    default:
      break;
  }
}

Here is the caller graph for this function:

void CPlugin::URLNotify ( const char *  szURL)
void CPlugin::URLNotify ( const char *  szURL)

Definition at line 531 of file plugin.cpp.

{
  dbgOut2("CPlugin::URLNotify(), URL '%s'", szURL);

  NPStream * pStream = NULL;
  char buf[256];

  assert(m_hInst != NULL);
  assert(m_pNPInstance != NULL);
  
  int iSize = WinLoadString((HAB)0, m_hInst, IDS_GOING2HTML, sizeof(buf), buf);

  NPError rc = NPN_NewStream(m_pNPInstance, "text/html", "asd_plugin_finder", &pStream);
  if (rc != NPERR_NO_ERROR)
    return;

  //char buf[] = "<html>\n<body>\n\n<h2 align=center>NPN_NewStream / NPN_Write - This seems to work.</h2>\n\n</body>\n</html>";
  
  NPN_Write(m_pNPInstance, pStream, iSize, buf);

  NPN_DestroyStream(m_pNPInstance, pStream, NPRES_DONE);
}

Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 290 of file plugin.cpp.

{
  if((m_szPageURL == NULL) && (m_szFileURL == NULL))
    return TRUE;
  else
    return FALSE;
}

Here is the caller graph for this function:


Member Data Documentation

Definition at line 121 of file NullPlugin.cpp.

char* CPlugin::fFileURL [private]

Definition at line 110 of file NullPlugin.cpp.

Definition at line 120 of file NullPlugin.cpp.

Definition at line 105 of file NullPlugin.cpp.

Definition at line 107 of file NullPlugin.cpp.

char* CPlugin::fPageURL [private]

Definition at line 109 of file NullPlugin.cpp.

Rect CPlugin::fRevealedRect [private]

Definition at line 116 of file NullPlugin.cpp.

Definition at line 115 of file NullPlugin.cpp.

GrafPtr CPlugin::fSavePort [private]

Definition at line 114 of file NullPlugin.cpp.

short CPlugin::fSavePortLeft [private]

Definition at line 118 of file NullPlugin.cpp.

short CPlugin::fSavePortTop [private]

Definition at line 117 of file NullPlugin.cpp.

Definition at line 108 of file NullPlugin.cpp.

Definition at line 119 of file NullPlugin.cpp.

Definition at line 106 of file NullPlugin.cpp.

Definition at line 59 of file plugin.h.

Definition at line 56 of file plugin.h.

Definition at line 68 of file plugin.h.

Definition at line 69 of file plugin.h.

Definition at line 112 of file NullPlugin.cpp.

Definition at line 111 of file NullPlugin.cpp.

Definition at line 67 of file plugin.h.

Definition at line 73 of file plugin.h.

Definition at line 70 of file plugin.h.

Definition at line 55 of file plugin.h.

Definition at line 72 of file plugbase.h.

HPOINTER CPlugin::m_hIcon [private]

Definition at line 51 of file plugin.h.

HICON CPlugin::m_hIcon [private]

Definition at line 51 of file plugin.h.

Definition at line 46 of file plugin.h.

Definition at line 46 of file plugin.h.

HWND CPlugin::m_hWnd [private]

Definition at line 49 of file plugin.h.

Definition at line 72 of file plugin.h.

Definition at line 64 of file plugin.h.

Definition at line 79 of file plugin.h.

Definition at line 71 of file plugin.h.

Definition at line 50 of file plugin.h.

Definition at line 116 of file plugin.h.

Definition at line 81 of file plugin.h.

Definition at line 80 of file plugin.h.

Definition at line 56 of file plugin.h.

Reimplemented from CPluginBase.

Definition at line 47 of file plugin.h.

Definition at line 60 of file plugin.h.

Definition at line 70 of file plugbase.h.

Definition at line 55 of file plugin.h.

Definition at line 136 of file plugin.h.

Definition at line 89 of file plugin.h.

Definition at line 90 of file plugin.h.

Definition at line 91 of file plugin.h.

Definition at line 87 of file plugin.h.

Definition at line 88 of file plugin.h.

Definition at line 84 of file plugin.h.

Definition at line 85 of file plugin.h.

Definition at line 86 of file plugin.h.

Definition at line 57 of file plugin.h.

Definition at line 71 of file plugbase.h.

char CPlugin::m_String[128]

Definition at line 60 of file plugin.h.

char * CPlugin::m_szCommandMessage [private]

Definition at line 54 of file plugin.h.

Definition at line 63 of file plugin.h.

Definition at line 63 of file plugin.h.

Definition at line 62 of file plugin.h.

Definition at line 62 of file plugin.h.

Definition at line 61 of file plugin.h.

Definition at line 61 of file plugin.h.

char * CPlugin::m_szURLString [private]

Definition at line 52 of file plugin.h.

Definition at line 53 of file plugin.h.

Reimplemented from CPluginBase.

Definition at line 48 of file plugin.h.

SHORT CPlugin::m_wMode [private]

Reimplemented from CPluginBase.

Definition at line 48 of file plugin.h.

char * CPlugin::sAltText = NULL [static, private]

Definition at line 97 of file NullPlugin.cpp.

FSSpec CPlugin::sDataFileSpec [static, private]

Definition at line 102 of file NullPlugin.cpp.

char * CPlugin::sDefaultPage = NULL [static, private]

Definition at line 99 of file NullPlugin.cpp.

CursHandle CPlugin::sHandCursor = NULL [static, private]

Definition at line 96 of file NullPlugin.cpp.

CIconHandle CPlugin::sIconHandle = NULL [static, private]

Definition at line 95 of file NullPlugin.cpp.

char * CPlugin::sInstallCommand = NULL [static, private]

Definition at line 98 of file NullPlugin.cpp.

char * CPlugin::sJavaScriptPage = NULL [static, private]

Definition at line 101 of file NullPlugin.cpp.

char * CPlugin::sRefreshText = NULL [static, private]

Definition at line 100 of file NullPlugin.cpp.

Boolean CPlugin::sRunningOnOSX = false [static, private]

Definition at line 103 of file NullPlugin.cpp.


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