Bug 133662 -- update Tester plugin, not part of the build
git-svn-id: svn://10.0.0.236/trunk@117774 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
@@ -166,6 +166,9 @@ LPSTR FormatNPPVariable(NPPVariable var)
|
||||
case NPPVpluginWindowSize:
|
||||
wsprintf(szVar, "NPPVpluginWindowSize");
|
||||
break;
|
||||
case NPPVpluginKeepLibraryInMemory:
|
||||
wsprintf(szVar, "NPPVpluginKeepLibraryInMemory");
|
||||
break;
|
||||
default:
|
||||
wsprintf(szVar, "Unlisted variable");
|
||||
break;
|
||||
@@ -434,14 +437,17 @@ LogItemStruct * makeLogItemStruct(NPAPI_Action action,
|
||||
memcpy(plis->arg3.pData, (LPVOID)dw3, plis->arg3.iLength);
|
||||
break;
|
||||
case action_npn_set_value:
|
||||
if(((NPPVariable)dw2 == NPPVpluginNameString) || ((NPPVariable)dw2 == NPPVpluginDescriptionString))
|
||||
if(((NPPVariable)dw2 == NPPVpluginNameString) ||
|
||||
((NPPVariable)dw2 == NPPVpluginDescriptionString))
|
||||
{
|
||||
makeAbbreviatedString(szBuf, sizeof(szBuf), dw3, strlen((char *)dw3), iWrap);
|
||||
plis->arg3.iLength = strlen(szBuf) + 1;
|
||||
plis->arg3.pData = new char[plis->arg3.iLength];
|
||||
memcpy(plis->arg3.pData, (LPVOID)&szBuf[0], plis->arg3.iLength);
|
||||
}
|
||||
else if(((NPPVariable)dw2 == NPPVpluginWindowBool) || ((NPPVariable)dw2 == NPPVpluginTransparentBool))
|
||||
else if(((NPPVariable)dw2 == NPPVpluginWindowBool) ||
|
||||
((NPPVariable)dw2 == NPPVpluginTransparentBool) ||
|
||||
((NPPVariable)dw2 == NPPVpluginKeepLibraryInMemory))
|
||||
{
|
||||
plis->arg3.iLength = sizeof(NPBool);
|
||||
plis->arg3.pData = new char[plis->arg3.iLength];
|
||||
@@ -735,12 +741,15 @@ int formatLogItem(LogItemStruct * plis, LPSTR szOutput, LPSTR szEndOfItem, BOOL
|
||||
case action_npn_set_value:
|
||||
wsprintf(szRet, "Returns: %s%s", FormatNPAPIError((int)plis->dwReturnValue),szEOL);
|
||||
|
||||
if(((NPPVariable)dw2 == NPPVpluginNameString) || ((NPPVariable)dw2 == NPPVpluginDescriptionString))
|
||||
if(((NPPVariable)dw2 == NPPVpluginNameString) ||
|
||||
((NPPVariable)dw2 == NPPVpluginDescriptionString))
|
||||
{
|
||||
FormatPCHARArgument(sz3, sizeof(sz3), &plis->arg3);
|
||||
wsprintf(szString, "NPN_SetValue(%#08lx, %s, %s)%s%s", dw1,FormatNPPVariable((NPPVariable)dw2),sz3,szEOL,szRet);
|
||||
}
|
||||
else if(((NPPVariable)dw2 == NPPVpluginWindowBool) || ((NPPVariable)dw2 == NPPVpluginTransparentBool))
|
||||
else if(((NPPVariable)dw2 == NPPVpluginWindowBool) ||
|
||||
((NPPVariable)dw2 == NPPVpluginTransparentBool) ||
|
||||
((NPPVariable)dw2 == NPPVpluginKeepLibraryInMemory))
|
||||
{
|
||||
FormatPBOOLArgument(sz3, sizeof(sz3), &plis->arg3);
|
||||
wsprintf(szString, "NPN_SetValue(%#08lx, %s, %s)%s%s",
|
||||
|
||||
@@ -359,7 +359,15 @@ DWORD CPluginBase::makeNPNCall(NPAPI_Action action, DWORD dw1, DWORD dw2, DWORD
|
||||
dw1 = (DWORD)m_pNPInstance;
|
||||
if(dw3 == DEFAULT_DWARG_VALUE)
|
||||
dw3 = (DWORD)m_pValue;
|
||||
dwRet = (DWORD)NPN_SetValue((NPP)dw1, (NPPVariable)dw2, (void *)dw3);
|
||||
|
||||
// note that Mozilla expects boolean values not as a pointer to BOOL
|
||||
// but rather as simply null and not null, let's convert
|
||||
if((dw2 == NPPVpluginWindowBool) ||
|
||||
(dw2 == NPPVpluginTransparentBool) ||
|
||||
(dw2 == NPPVpluginKeepLibraryInMemory)) {
|
||||
dwRet = (DWORD)NPN_SetValue((NPP)dw1, (NPPVariable)dw2, (void *)(*(BOOL *)dw3));
|
||||
} else
|
||||
dwRet = (DWORD)NPN_SetValue((NPP)dw1, (NPPVariable)dw2, (void *)dw3);
|
||||
break;
|
||||
case action_npn_invalidate_rect:
|
||||
if(dw1 == DEFAULT_DWARG_VALUE)
|
||||
|
||||
@@ -215,6 +215,7 @@ ScriptItemStruct * makeScriptItemStruct(NPAPI_Action action, DWORD dw1, DWORD dw
|
||||
break;
|
||||
case NPPVpluginWindowBool:
|
||||
case NPPVpluginTransparentBool:
|
||||
case NPPVpluginKeepLibraryInMemory:
|
||||
dwTNVFlags = convertStringToBOOL1(&dw3);
|
||||
makeDataEntry(&psis->arg3, dw3, (dwTNVFlags & fTNV1) ? 0 : sizeof(NPBool));
|
||||
break;
|
||||
|
||||
@@ -274,6 +274,8 @@ static NPPVariable convertStringToNPPVariable(LPSTR szString)
|
||||
return NPPVpluginWindowBool;
|
||||
else if(strcmpi(ENTRY_NPPVPLUGINTRANSPARENTBOOL, szString) == 0)
|
||||
return NPPVpluginTransparentBool;
|
||||
else if(strcmpi(ENTRY_NPPVPLUGINKEEPLIBRARYINMEMORY, szString) == 0)
|
||||
return NPPVpluginKeepLibraryInMemory;
|
||||
else if(strcmpi(ENTRY_NPPVPLUGINWINDOWSIZE, szString) == 0)
|
||||
return NPPVpluginWindowSize;
|
||||
else
|
||||
|
||||
@@ -81,6 +81,7 @@ ScriptItemStruct * readProfileSectionAndCreateScriptItemStruct(LPSTR szFileName,
|
||||
#define ENTRY_NPPVPLUGINWINDOWBOOL "NPPVpluginWindowBool"
|
||||
#define ENTRY_NPPVPLUGINTRANSPARENTBOOL "NPPVpluginTransparentBool"
|
||||
#define ENTRY_NPPVPLUGINWINDOWSIZE "NPPVpluginWindowSize"
|
||||
#define ENTRY_NPPVPLUGINKEEPLIBRARYINMEMORY "NPPVpluginKeepLibraryInMemory"
|
||||
|
||||
// NPNVariable
|
||||
#define ENTRY_NPNVXDISPLAY "NPNVxDisplay"
|
||||
|
||||
@@ -137,8 +137,9 @@ static void onCommand(HWND hWnd, int id, HWND hWndCtl, UINT codeNotify)
|
||||
{
|
||||
iIndex = ComboBox_GetCurSel(GetDlgItem(hWnd, IDC_COMBO_ARG2));
|
||||
ComboBox_GetLBText(GetDlgItem(hWnd, IDC_COMBO_ARG2), iIndex, szString);
|
||||
if( (strcmp(szString, "NPPVpluginWindowBool") == 0)
|
||||
|| (strcmp(szString, "NPPVpluginTransparentBool") == 0))
|
||||
if((strcmp(szString, "NPPVpluginWindowBool") == 0) ||
|
||||
(strcmp(szString, "NPPVpluginTransparentBool") == 0) ||
|
||||
(strcmp(szString, "NPPVpluginKeepLibraryInMemory") == 0))
|
||||
{
|
||||
HWND hWndCombo = GetDlgItem(hWnd, IDC_COMBO_ARG3);
|
||||
ComboBox_ResetContent(hWndCombo);
|
||||
|
||||
@@ -395,6 +395,7 @@ void updateUI(HWND hWnd)
|
||||
ComboBox_AddString(hWndCombo, "NPPVpluginWindowBool");
|
||||
ComboBox_AddString(hWndCombo, "NPPVpluginTransparentBool");
|
||||
ComboBox_AddString(hWndCombo, "NPPVpluginWindowSize");
|
||||
ComboBox_AddString(hWndCombo, "NPPVpluginKeepLibraryInMemory");
|
||||
ComboBox_SetCurSel(hWndCombo, 0);
|
||||
ShowWindow(GetDlgItem(hWnd, IDC_BUTTON_PASTE), SW_HIDE);
|
||||
}
|
||||
@@ -664,6 +665,14 @@ void onGo(HWND hWnd)
|
||||
npsize.height = GetDlgItemInt(hWnd, IDC_EDIT_ARG4, &bTranslated, TRUE);
|
||||
pPlugin->m_pValue = (void *)&npsize;
|
||||
}
|
||||
else if(strcmp(sz1, "NPPVpluginKeepLibraryInMemory") == 0)
|
||||
{
|
||||
variable = NPPVpluginKeepLibraryInMemory;
|
||||
index = ComboBox_GetCurSel(GetDlgItem(hWnd, IDC_COMBO_ARG3));
|
||||
ComboBox_GetLBText(GetDlgItem(hWnd, IDC_COMBO_ARG3), index, szStringValue);
|
||||
bBoolValue = (strcmp(szStringValue, "TRUE") == 0) ? TRUE : FALSE;
|
||||
pPlugin->m_pValue = (void *)&bBoolValue;
|
||||
}
|
||||
pPlugin->makeNPNCall(action_npn_set_value, DEFAULT_DWARG_VALUE, (DWORD)variable, DEFAULT_DWARG_VALUE);
|
||||
}
|
||||
else if(strcmp(szString, STRING_NPN_INVALIDATERECT) == 0)
|
||||
|
||||
Reference in New Issue
Block a user