Back to index

lightning-sunbird  0.9+nobinonly
Public Member Functions | Private Member Functions | Private Attributes
CScripter Class Reference

#include <scripter.h>

Collaboration diagram for CScripter:
Collaboration graph
[legend]

List of all members.

Public Member Functions

 CScripter ()
 ~CScripter ()
void associate (CPluginBase *pPlugin)
void clearScript ()
BOOL getStopAutoExecFlag ()
void setStopAutoExecFlag (BOOL bFlag)
int getCycleRepetitions ()
DWORD getCycleDelay ()
BOOL createScriptFromFile (LPSTR szFileName)
BOOL executeScript ()

Private Member Functions

BOOL executeScriptItem (ScriptItemStruct *psis)

Private Attributes

CPluginBasem_pPlugin
CScriptItemListm_pScript
BOOL m_bStopAutoExecFlag
int m_iCycleRepetitions
DWORD m_dwCycleDelay

Detailed Description

Definition at line 45 of file scripter.h.


Constructor & Destructor Documentation

Definition at line 58 of file scripter.cpp.

{
  if(m_pScript != NULL)
    delete m_pScript;
}

Member Function Documentation

Definition at line 64 of file scripter.cpp.

{
  m_pPlugin = pPlugin;
}

Here is the caller graph for this function:

Definition at line 89 of file scripter.cpp.

{
  if(m_pScript != NULL)
    delete m_pScript;

  m_pScript = new CScriptItemList();
}

Here is the caller graph for this function:

Definition at line 110 of file scripter.cpp.

{
  clearScript();

  if(!XP_IsFile(szFileName))
    return FALSE;

  char sz[16];

  XP_GetPrivateProfileString(SECTION_OPTIONS, KEY_LAST, PROFILE_DEFAULT_STRING, sz, sizeof(sz), szFileName);
  if(strcmp(sz, PROFILE_DEFAULT_STRING) == 0)
    return FALSE;

  int iLast = atoi(sz);

  int iFirst = 1;

  XP_GetPrivateProfileString(SECTION_OPTIONS, KEY_FIRST, PROFILE_DEFAULT_STRING, sz, sizeof(sz), szFileName);
  if(strcmp(sz, PROFILE_DEFAULT_STRING) != 0)
    iFirst = atoi(sz);

  XP_GetPrivateProfileString(SECTION_OPTIONS, KEY_DELAY, PROFILE_DEFAULT_STRING, sz, sizeof(sz), szFileName);
  if(strcmp(sz, PROFILE_DEFAULT_STRING) == 0)
    m_dwCycleDelay = 0L;
  else
    m_dwCycleDelay = atol(sz);

  XP_GetPrivateProfileString(SECTION_OPTIONS, KEY_REPETITIONS, PROFILE_DEFAULT_STRING, sz, sizeof(sz), szFileName);
  if(strcmp(sz, PROFILE_DEFAULT_STRING) == 0)
    m_iCycleRepetitions = 1;
  else
    m_iCycleRepetitions = atoi(sz);

  for(int i = iFirst; i <= iLast; i++)
  {
    char szSection[16];
    wsprintf(szSection, "%i", i);
    ScriptItemStruct * psis = readProfileSectionAndCreateScriptItemStruct(szFileName, szSection);
    if(psis == NULL)
      continue;
    m_pScript->add(psis);
  }
  return TRUE;
}

Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 97 of file scripter.cpp.

{
  if(m_pScript == NULL)
    return FALSE;

  for(ScriptItemListElement * psile = m_pScript->m_pFirst; psile != NULL; psile = psile->pNext)
  {
    executeScriptItem(psile->psis);
  }

  return TRUE;
}

Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 155 of file scripter.cpp.

{
  if(psis == NULL)
    return FALSE;
  if(m_pPlugin == NULL)
    return FALSE;

  DWORD dw1 = psis->arg1.dwArg;
  DWORD dw2 = psis->arg2.dwArg;
  DWORD dw3 = psis->arg3.dwArg;
  DWORD dw4 = psis->arg4.dwArg;
  DWORD dw5 = psis->arg5.dwArg;
  DWORD dw6 = psis->arg6.dwArg;
  DWORD dw7 = psis->arg7.dwArg;

  if(psis->action == action_npn_get_value)
  {
    static DWORD dwValue = 0L;
    m_pPlugin->m_pValue = (void *)&dwValue;
  }

  m_pPlugin->makeNPNCall(psis->action, dw1, dw2, dw3, dw4, dw5, dw6, dw7);

  if(psis->dwDelay >=0)
    XP_Sleep(psis->dwDelay);

  return TRUE;
}

Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 84 of file scripter.cpp.

{
  return m_dwCycleDelay;
}

Here is the caller graph for this function:

Definition at line 79 of file scripter.cpp.

{
  return m_iCycleRepetitions;
}

Here is the caller graph for this function:

Definition at line 69 of file scripter.cpp.

{
  return m_bStopAutoExecFlag;
}

Definition at line 74 of file scripter.cpp.

{
  m_bStopAutoExecFlag = bFlag;
}

Member Data Documentation

Definition at line 50 of file scripter.h.

Definition at line 52 of file scripter.h.

Definition at line 51 of file scripter.h.

Definition at line 48 of file scripter.h.

Definition at line 49 of file scripter.h.


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