Merge to XFA: Kill overloaded cast operators in CJS_Value.
[pdfium.git] / fpdfsdk / src / javascript / app.cpp
index e3604b0..45998b0 100644 (file)
@@ -134,7 +134,7 @@ app::~app(void)
        m_aTimer.RemoveAll();
 }
 
-FX_BOOL app::activeDocs(OBJ_PROP_PARAMS)
+FX_BOOL app::activeDocs(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError)
 {
        if (vp.IsGetting())
        {
@@ -192,7 +192,7 @@ FX_BOOL app::activeDocs(OBJ_PROP_PARAMS)
        return FALSE;
 }
 
-FX_BOOL app::calculate(OBJ_PROP_PARAMS)
+FX_BOOL app::calculate(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError)
 {
        if (vp.IsSetting())
        {
@@ -210,17 +210,12 @@ FX_BOOL app::calculate(OBJ_PROP_PARAMS)
                ASSERT(pRuntime != NULL);
 
                CJS_Array aDocs(pRuntime->GetIsolate());
-//             int iNumDocs = pApp->CountDocuments();
-//
-//             for (int iIndex = 0;iIndex < iNumDocs; iIndex++)
-//             {
-                       if (CPDFSDK_Document* pDoc = pApp->GetCurrentDoc())
-                       {
-                               CPDFSDK_InterForm* pInterForm = (CPDFSDK_InterForm*)pDoc->GetInterForm();
-                               ASSERT(pInterForm != NULL);
-                               pInterForm->EnableCalculate((FX_BOOL)m_bCalculate);
-                       }
-//             }
+               if (CPDFSDK_Document* pDoc = pApp->GetCurrentDoc())
+               {
+                       CPDFSDK_InterForm* pInterForm = (CPDFSDK_InterForm*)pDoc->GetInterForm();
+                       ASSERT(pInterForm != NULL);
+                       pInterForm->EnableCalculate((FX_BOOL)m_bCalculate);
+               }
        }
        else
        {
@@ -230,7 +225,7 @@ FX_BOOL app::calculate(OBJ_PROP_PARAMS)
        return TRUE;
 }
 
-FX_BOOL app::formsVersion(OBJ_PROP_PARAMS)
+FX_BOOL app::formsVersion(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError)
 {
        if (vp.IsGetting())
        {
@@ -241,7 +236,7 @@ FX_BOOL app::formsVersion(OBJ_PROP_PARAMS)
        return FALSE;
 }
 
-FX_BOOL app::viewerType(OBJ_PROP_PARAMS)
+FX_BOOL app::viewerType(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError)
 {
        if (vp.IsGetting())
        {
@@ -252,7 +247,7 @@ FX_BOOL app::viewerType(OBJ_PROP_PARAMS)
        return FALSE;
 }
 
-FX_BOOL app::viewerVariation(OBJ_PROP_PARAMS)
+FX_BOOL app::viewerVariation(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError)
 {
        if (vp.IsGetting())
        {
@@ -263,7 +258,7 @@ FX_BOOL app::viewerVariation(OBJ_PROP_PARAMS)
        return FALSE;
 }
 
-FX_BOOL app::viewerVersion(OBJ_PROP_PARAMS)
+FX_BOOL app::viewerVersion(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError)
 {
        if (vp.IsGetting())
        {
@@ -286,7 +281,7 @@ FX_BOOL app::viewerVersion(OBJ_PROP_PARAMS)
        return FALSE;
 }
 
-FX_BOOL app::platform(OBJ_PROP_PARAMS)
+FX_BOOL app::platform(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError)
 {
        if (vp.IsGetting())
        {
@@ -297,7 +292,7 @@ FX_BOOL app::platform(OBJ_PROP_PARAMS)
        return FALSE;
 }
 
-FX_BOOL app::language(OBJ_PROP_PARAMS)
+FX_BOOL app::language(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError)
 {
        if (vp.IsGetting())
        {
@@ -312,7 +307,7 @@ FX_BOOL app::language(OBJ_PROP_PARAMS)
 //comment: need reader support
 //note:
 //CFDF_Document * CPDFDoc_Environment::NewFDF();
-FX_BOOL app::newFDF(OBJ_METHOD_PARAMS)
+FX_BOOL app::newFDF(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError)
 {
        return TRUE;
 }
@@ -321,12 +316,12 @@ FX_BOOL app::newFDF(OBJ_METHOD_PARAMS)
 //note: as defined in js reference, the proto of this function's fourth parmeters, how old an fdf document while do not show it.
 //CFDF_Document * CPDFDoc_Environment::OpenFDF(string strPath,bool bUserConv);
 
-FX_BOOL app::openFDF(OBJ_METHOD_PARAMS)
+FX_BOOL app::openFDF(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError)
 {
        return TRUE;
 }
 
-FX_BOOL app::alert(OBJ_METHOD_PARAMS)
+FX_BOOL app::alert(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError)
 {
        int iSize = params.size();
        if (iSize < 1)
@@ -343,19 +338,19 @@ FX_BOOL app::alert(OBJ_METHOD_PARAMS)
        {
                if (params[0].GetType() == VT_object)
                {
-                       JSObject pObj = params[0];
+                       JSObject pObj = params[0].ToV8Object();
                        {
                                v8::Handle<v8::Value> pValue = JS_GetObjectElement(isolate, pObj, L"cMsg");
-                               swMsg = CJS_Value(isolate,pValue,VT_unknown).operator CFX_WideString();
+                               swMsg = CJS_Value(isolate, pValue, VT_unknown).ToCFXWideString();
 
-                               pValue = JS_GetObjectElement(isolate,pObj,L"cTitle");
-                               swTitle = CJS_Value(isolate, pValue,VT_unknown).operator CFX_WideString();
+                               pValue = JS_GetObjectElement(isolate, pObj, L"cTitle");
+                               swTitle = CJS_Value(isolate, pValue, VT_unknown).ToCFXWideString();
 
-                               pValue = JS_GetObjectElement(isolate,pObj,L"nIcon");
-                               iIcon = (int)CJS_Value(isolate,pValue,VT_unknown);
+                               pValue = JS_GetObjectElement(isolate, pObj, L"nIcon");
+                               iIcon = CJS_Value(isolate, pValue, VT_unknown).ToInt();
 
-                               pValue = JS_GetObjectElement(isolate,pObj,L"nType");
-                               iType = (int)CJS_Value(isolate,pValue,VT_unknown);
+                               pValue = JS_GetObjectElement(isolate, pObj, L"nType");
+                               iType = CJS_Value(isolate, pValue, VT_unknown).ToInt();
                        }
 
                        if (swMsg == L"")
@@ -373,22 +368,12 @@ FX_BOOL app::alert(OBJ_METHOD_PARAMS)
                                        for(int i = 0; i < iLenth; i++)
                                        {
                                                carray.GetElement(i, *pValue);
-                                               swMsg += (*pValue).operator CFX_WideString();
+                                               swMsg += (*pValue).ToCFXWideString();
                                                if (i < iLenth - 1)
                                                        swMsg += L",  ";
                                        }
 
                                        if(pValue) delete pValue;
-//                                     if ((iLenth > 1) && pValue)
-//                                     {
-//                                             delete[]pValue;
-//                                             pValue = NULL;
-//                                     }
-//                                     else if ((iLenth == 1) && pValue)
-//                                     {
-//                                             delete pValue;
-//                                             pValue = NULL;
-//                                     }
                                }
                        }
 
@@ -397,7 +382,7 @@ FX_BOOL app::alert(OBJ_METHOD_PARAMS)
                }
                else if (params[0].GetType() == VT_boolean)
                {
-                       FX_BOOL bGet = (FX_BOOL)params[0];
+                       FX_BOOL bGet = params[0].ToBool();
                        if (bGet)
                                swMsg = L"true";
                        else
@@ -407,7 +392,7 @@ FX_BOOL app::alert(OBJ_METHOD_PARAMS)
                }
                else
                {
-                       swMsg = params[0];
+                       swMsg = params[0].ToCFXWideString();
                        swTitle = JSGetStringFromID((CJS_Context*)cc, IDS_STRING_JSALERT);
                }
        }
@@ -415,7 +400,7 @@ FX_BOOL app::alert(OBJ_METHOD_PARAMS)
        {
                if (params[0].GetType() == VT_boolean)
                {
-                       FX_BOOL bGet = (FX_BOOL)params[0];
+                       FX_BOOL bGet = params[0].ToBool();
                        if (bGet)
                                swMsg = L"true";
                        else
@@ -423,18 +408,18 @@ FX_BOOL app::alert(OBJ_METHOD_PARAMS)
                }
                else
                {
-                       swMsg = params[0];
+                       swMsg = params[0].ToCFXWideString();
                }
                swTitle = JSGetStringFromID((CJS_Context*)cc, IDS_STRING_JSALERT);
 
                for(int i = 1;i<iSize;i++)
                {
                        if (i == 1)
-                               iIcon = int(params[i]);
+                               iIcon = params[i].ToInt();
                        if (i == 2)
-                               iType = int(params[i]);
+                               iType = params[i].ToInt();
                        if (i == 3)
-                               swTitle = params[i];
+                               swTitle = params[i].ToCFXWideString();
                }
        }
 
@@ -451,40 +436,37 @@ FX_BOOL app::alert(OBJ_METHOD_PARAMS)
 }
 
 
-FX_BOOL app::beep(OBJ_METHOD_PARAMS)
+FX_BOOL app::beep(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError)
 {
        if (params.size() == 1)
        {
                CJS_Context* pContext = (CJS_Context*)cc;
                CJS_Runtime* pRuntime = pContext->GetJSRuntime();
                CPDFDoc_Environment * pEnv = pRuntime->GetReaderApp();
-               pEnv->JS_appBeep((int)params[0]);
-
+               pEnv->JS_appBeep(params[0].ToInt());
                return TRUE;
        }
-       else
-       {
-               sError = JSGetStringFromID((CJS_Context*)cc, IDS_STRING_JSPARAMERROR);
-               return FALSE;
-       }
+
+       sError = JSGetStringFromID((CJS_Context*)cc, IDS_STRING_JSPARAMERROR);
+       return FALSE;
 }
 
-FX_BOOL app::findComponent(OBJ_METHOD_PARAMS)
+FX_BOOL app::findComponent(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError)
 {
        return TRUE;
 }
 
-FX_BOOL app::popUpMenuEx(OBJ_METHOD_PARAMS)
+FX_BOOL app::popUpMenuEx(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError)
 {
        return FALSE;
 }
 
-FX_BOOL app::fs(OBJ_PROP_PARAMS)
+FX_BOOL app::fs(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError)
 {
        return FALSE;
 }
 
-FX_BOOL app::setInterval(OBJ_METHOD_PARAMS)
+FX_BOOL app::setInterval(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError)
 {
        if (params.size() > 2 || params.size() == 0)
        {
@@ -497,14 +479,14 @@ FX_BOOL app::setInterval(OBJ_METHOD_PARAMS)
        CJS_Runtime* pRuntime = pContext->GetJSRuntime();
        ASSERT(pRuntime != NULL);
 
-       CFX_WideString script = params.size() > 0 ?  (FX_LPCWSTR)(params[0].operator CFX_WideString()) : L"";
+       CFX_WideString script = params.size() > 0 ?  (FX_LPCWSTR)(params[0].ToCFXWideString()) : L"";
        if (script.IsEmpty())
        {
                sError = JSGetStringFromID((CJS_Context*)cc, IDS_STRING_JSAFNUMBER_KEYSTROKE);
                return TRUE;
        }
 
-       FX_DWORD dwInterval = params.size() > 1 ? (int)params[1] : 1000;
+       FX_DWORD dwInterval = params.size() > 1 ? params[1].ToInt() : 1000;
 
        CPDFDoc_Environment* pApp = pRuntime->GetReaderApp();
        ASSERT(pApp);
@@ -533,7 +515,7 @@ FX_BOOL app::setInterval(OBJ_METHOD_PARAMS)
        return TRUE;
 }
 
-FX_BOOL app::setTimeOut(OBJ_METHOD_PARAMS)
+FX_BOOL app::setTimeOut(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError)
 {
        if (params.size() > 2 || params.size() == 0)
        {
@@ -546,17 +528,18 @@ FX_BOOL app::setTimeOut(OBJ_METHOD_PARAMS)
        CJS_Runtime* pRuntime = pContext->GetJSRuntime();
        ASSERT(pRuntime != NULL);
 
-       CFX_WideString script = params.size() > 0 ?  (FX_LPCWSTR)(params[0].operator CFX_WideString()) : L"";
+       CFX_WideString script = params.size() > 0 ?  (FX_LPCWSTR)(params[0].ToCFXWideString()) : L"";
        if (script.IsEmpty())
        {
                sError = JSGetStringFromID((CJS_Context*)cc, IDS_STRING_JSAFNUMBER_KEYSTROKE);
                return TRUE;
        }
 
-       FX_DWORD dwTimeOut = params.size() > 1 ? (int)params[1] : 1000;
+       FX_DWORD dwTimeOut = params.size() > 1 ? params[1].ToInt() : 1000;
 
        CPDFDoc_Environment* pApp = pRuntime->GetReaderApp();
        ASSERT(pApp);
+
        CJS_Timer* pTimer = new CJS_Timer(this, pApp);
        m_aTimer.Add(pTimer);
 
@@ -564,12 +547,9 @@ FX_BOOL app::setTimeOut(OBJ_METHOD_PARAMS)
        pTimer->SetRuntime(pRuntime);
        pTimer->SetJScript(script);
        pTimer->SetTimeOut(dwTimeOut);
-//     pTimer->SetStartTime(GetTickCount());
-//     pTimer->SetJSTimer(1000);
        pTimer->SetJSTimer(dwTimeOut);
 
        JSFXObject pRetObj = JS_NewFxDynamicObj(*pRuntime, pContext, JS_GetObjDefnID(*pRuntime, L"TimerObj"));
-//     ASSERT(pRetObj != NULL);
 
        CJS_TimerObj* pJS_TimerObj = (CJS_TimerObj*)JS_GetPrivate(pRuntime->GetIsolate(),pRetObj);
        ASSERT(pJS_TimerObj != NULL);
@@ -584,7 +564,7 @@ FX_BOOL app::setTimeOut(OBJ_METHOD_PARAMS)
        return TRUE;
 }
 
-FX_BOOL app::clearTimeOut(OBJ_METHOD_PARAMS)
+FX_BOOL app::clearTimeOut(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError)
 {
        CJS_Context* pContext = (CJS_Context*)cc;
        ASSERT(pContext != NULL);
@@ -599,11 +579,11 @@ FX_BOOL app::clearTimeOut(OBJ_METHOD_PARAMS)
 
        if (params[0].GetType() == VT_fxobject)
        {
-               JSFXObject pObj = (JSFXObject)params[0];
+               JSFXObject pObj = params[0].ToV8Object();
                {
                        if (JS_GetObjDefnID(pObj) == JS_GetObjDefnID(*pRuntime, L"TimerObj"))
                        {
-                               if (CJS_Object* pJSObj = (CJS_Object*)params[0])
+                               if (CJS_Object* pJSObj = params[0].ToCJSObject())
                                {
                                        if (TimerObj* pTimerObj = (TimerObj*)pJSObj->GetEmbedObject())
                                        {
@@ -632,7 +612,7 @@ FX_BOOL app::clearTimeOut(OBJ_METHOD_PARAMS)
        return TRUE;
 }
 
-FX_BOOL app::clearInterval(OBJ_METHOD_PARAMS)
+FX_BOOL app::clearInterval(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError)
 {
        CJS_Context* pContext = (CJS_Context*)cc;
        ASSERT(pContext != NULL);
@@ -647,11 +627,11 @@ FX_BOOL app::clearInterval(OBJ_METHOD_PARAMS)
 
        if (params[0].GetType() == VT_fxobject)
        {
-               JSFXObject pObj = (JSFXObject)params[0];
+               JSFXObject pObj = params[0].ToV8Object();
                {
                        if (JS_GetObjDefnID(pObj) == JS_GetObjDefnID(*pRuntime, L"TimerObj"))
                        {
-                               if (CJS_Object* pJSObj = (CJS_Object*)params[0])
+                               if (CJS_Object* pJSObj = params[0].ToCJSObject())
                                {
                                        if (TimerObj* pTimerObj = (TimerObj*)pJSObj->GetEmbedObject())
                                        {
@@ -680,7 +660,7 @@ FX_BOOL app::clearInterval(OBJ_METHOD_PARAMS)
        return TRUE;
 }
 
-FX_BOOL app::execMenuItem(OBJ_METHOD_PARAMS)
+FX_BOOL app::execMenuItem(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError)
 {
        return FALSE;
 }
@@ -720,23 +700,21 @@ void app::RunJsScript(CJS_Runtime* pRuntime,const CFX_WideString& wsScript)
        }
 }
 
-FX_BOOL app::goBack(OBJ_METHOD_PARAMS)
+FX_BOOL app::goBack(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError)
 {
   // Not supported.
   return TRUE;
 }
 
-FX_BOOL app::goForward(OBJ_METHOD_PARAMS)
+FX_BOOL app::goForward(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError)
 {
   // Not supported.
   return TRUE;
 }
 
-FX_BOOL app::mailMsg(OBJ_METHOD_PARAMS)
+FX_BOOL app::mailMsg(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError)
 {
        CJS_Context* pContext = (CJS_Context*)cc;
-       ASSERT(pContext != NULL);
-
        v8::Isolate* isolate = GetIsolate(cc);
 
        FX_BOOL bUI = TRUE;
@@ -745,42 +723,48 @@ FX_BOOL app::mailMsg(OBJ_METHOD_PARAMS)
        CFX_WideString cBcc = L"";
        CFX_WideString cSubject = L"";
        CFX_WideString cMsg = L"";
-       if(params.size() < 2)
-               return FALSE;
-
-       bUI = params.size()>=1?(int)params[0]:TRUE;
-       cTo = params.size()>=2?(const wchar_t*)(FX_LPCWSTR)params[1].operator CFX_WideString():L"";
-       cCc = params.size()>=3?(const wchar_t*)(FX_LPCWSTR)params[2].operator CFX_WideString():L"";
-       cBcc = params.size()>=4?(const wchar_t*)(FX_LPCWSTR)params[3].operator CFX_WideString():L"";
-       cSubject = params.size()>=5?(const wchar_t*)(FX_LPCWSTR)params[4].operator CFX_WideString():L"";
-       cMsg = params.size()>=6?(const wchar_t*)(FX_LPCWSTR)params[5].operator CFX_WideString():L"";
 
+       if (params.size() < 1)
+               return FALSE;
 
        if (params[0].GetType() == VT_object)
        {
-               JSObject pObj = (JSObject)params[0];
+               JSObject pObj = params[0].ToV8Object();
 
-               v8::Handle<v8::Value> pValue = JS_GetObjectElement(isolate,pObj, L"bUI");
-                       bUI = (int)CJS_Value(isolate,pValue,GET_VALUE_TYPE(pValue));
+               v8::Handle<v8::Value> pValue = JS_GetObjectElement(isolate, pObj, L"bUI");
+               bUI = CJS_Value(isolate, pValue, GET_VALUE_TYPE(pValue)).ToBool();
 
                pValue = JS_GetObjectElement(isolate, pObj, L"cTo");
-                       cTo = CJS_Value(isolate,pValue,GET_VALUE_TYPE(pValue)).operator CFX_WideString();
-
-               pValue = JS_GetObjectElement(isolate,pObj, L"cCc");
-                       cCc = CJS_Value(isolate,pValue,GET_VALUE_TYPE(pValue)).operator CFX_WideString();
-
-               pValue = JS_GetObjectElement(isolate,pObj, L"cBcc");
-                       cBcc = CJS_Value(isolate,pValue,GET_VALUE_TYPE(pValue)).operator CFX_WideString();
-
-               pValue = JS_GetObjectElement(isolate,pObj, L"cSubject");
-                       cSubject = CJS_Value(isolate,pValue,GET_VALUE_TYPE(pValue)).operator CFX_WideString();
-
-               pValue = JS_GetObjectElement(isolate,pObj, L"cMsg");
-                       cMsg = CJS_Value(isolate,pValue,GET_VALUE_TYPE(pValue)).operator CFX_WideString();
+               cTo = CJS_Value(isolate, pValue, GET_VALUE_TYPE(pValue)).ToCFXWideString();
+
+               pValue = JS_GetObjectElement(isolate, pObj, L"cCc");
+               cCc = CJS_Value(isolate, pValue, GET_VALUE_TYPE(pValue)).ToCFXWideString();
+
+               pValue = JS_GetObjectElement(isolate, pObj, L"cBcc");
+               cBcc = CJS_Value(isolate, pValue, GET_VALUE_TYPE(pValue)).ToCFXWideString();
+
+               pValue = JS_GetObjectElement(isolate, pObj, L"cSubject");
+               cSubject = CJS_Value(isolate, pValue, GET_VALUE_TYPE(pValue)).ToCFXWideString();
+
+               pValue = JS_GetObjectElement(isolate, pObj, L"cMsg");
+               cMsg = CJS_Value(isolate, pValue, GET_VALUE_TYPE(pValue)).ToCFXWideString();
+       } else {
+               if (params.size() < 2)
+                       return FALSE;
+
+               bUI = params[0].ToBool();
+               cTo = params[1].ToCFXWideString();
+
+               if (params.size() >= 3)
+                       cCc = params[2].ToCFXWideString();
+               if (params.size() >= 4)
+                       cBcc = params[3].ToCFXWideString();
+               if (params.size() >= 5)
+                       cSubject = params[4].ToCFXWideString();
+               if (params.size() >= 6)
+                       cMsg = params[5].ToCFXWideString();
        }
 
-
-
        CJS_Runtime* pRuntime = pContext->GetJSRuntime();
        ASSERT(pRuntime != NULL);
 
@@ -789,20 +773,18 @@ FX_BOOL app::mailMsg(OBJ_METHOD_PARAMS)
 
        pRuntime->BeginBlock();
        pApp->JS_docmailForm(NULL, 0, bUI, cTo.c_str(), cSubject.c_str(), cCc.c_str(), cBcc.c_str(), cMsg.c_str());
-       ///////////////////////////////////////////////////////////////////////////////////////////////
        pRuntime->EndBlock();
 
-       //return bRet;
        return FALSE;
 }
 
-FX_BOOL app::launchURL(OBJ_METHOD_PARAMS)
+FX_BOOL app::launchURL(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError)
 {
   // Unsafe, not supported.
   return TRUE;
 }
 
-FX_BOOL app::runtimeHighlight(OBJ_PROP_PARAMS)
+FX_BOOL app::runtimeHighlight(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError)
 {
        if (vp.IsSetting())
        {
@@ -816,18 +798,18 @@ FX_BOOL app::runtimeHighlight(OBJ_PROP_PARAMS)
        return TRUE;
 }
 
-FX_BOOL app::fullscreen(OBJ_PROP_PARAMS)
+FX_BOOL app::fullscreen(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError)
 {
        return FALSE;
 }
 
-FX_BOOL app::popUpMenu(OBJ_METHOD_PARAMS)
+FX_BOOL app::popUpMenu(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError)
 {
        return FALSE;
 }
 
 
-FX_BOOL app::browseForDoc(OBJ_METHOD_PARAMS)
+FX_BOOL app::browseForDoc(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError)
 {
   // Unsafe, not supported.
   return TRUE;
@@ -859,17 +841,17 @@ CFX_WideString app::SysPathToPDFPath(const CFX_WideString& sOldPath)
        return sRet;
 }
 
-FX_BOOL app::newDoc(OBJ_METHOD_PARAMS)
+FX_BOOL app::newDoc(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError)
 {
        return FALSE;
 }
 
-FX_BOOL app::openDoc(OBJ_METHOD_PARAMS)
+FX_BOOL app::openDoc(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError)
 {
        return FALSE;
 }
 
-FX_BOOL app::response(OBJ_METHOD_PARAMS)
+FX_BOOL app::response(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError)
 {
        CFX_WideString swQuestion = L"";
        CFX_WideString swLabel = L"";
@@ -882,40 +864,40 @@ FX_BOOL app::response(OBJ_METHOD_PARAMS)
        int iLength = params.size();
        if (iLength > 0 && params[0].GetType() == VT_object)
        {
-               JSObject pObj = (JSObject )params[0];
+               JSObject pObj = params[0].ToV8Object();
                v8::Handle<v8::Value> pValue = JS_GetObjectElement(isolate,pObj,L"cQuestion");
-               swQuestion = CJS_Value(isolate,pValue,GET_VALUE_TYPE(pValue)).operator CFX_WideString();
+               swQuestion = CJS_Value(isolate,pValue,GET_VALUE_TYPE(pValue)).ToCFXWideString();
 
                pValue = JS_GetObjectElement(isolate,pObj,L"cTitle");
-               swTitle = CJS_Value(isolate,pValue,GET_VALUE_TYPE(pValue)).operator CFX_WideString();
+               swTitle = CJS_Value(isolate,pValue,GET_VALUE_TYPE(pValue)).ToCFXWideString();
 
                pValue = JS_GetObjectElement(isolate,pObj,L"cDefault");
-               swDefault = CJS_Value(isolate,pValue,GET_VALUE_TYPE(pValue)).operator CFX_WideString();
+               swDefault = CJS_Value(isolate,pValue,GET_VALUE_TYPE(pValue)).ToCFXWideString();
 
                pValue = JS_GetObjectElement(isolate,pObj,L"cLabel");
-               swLabel = CJS_Value(isolate,pValue,GET_VALUE_TYPE(pValue)).operator CFX_WideString();
+               swLabel = CJS_Value(isolate,pValue,GET_VALUE_TYPE(pValue)).ToCFXWideString();
 
                pValue = JS_GetObjectElement(isolate,pObj,L"bPassword");
-               bPassWord = (bool)CJS_Value(isolate,pValue,GET_VALUE_TYPE(pValue));
+               bPassWord = CJS_Value(isolate,pValue,GET_VALUE_TYPE(pValue)).ToBool();
        }
        else
        {
                switch(iLength)
                {
                case 5:
-                       swLabel = params[4];
+                       swLabel = params[4].ToCFXWideString();
                        // FALLTHROUGH
                case 4:
-                       bPassWord = params[3];
+                       bPassWord = params[3].ToBool();
                        // FALLTHROUGH
                case 3:
-                       swDefault = params[2];
+                       swDefault = params[2].ToCFXWideString();
                        // FALLTHROUGH
                case 2:
-                       swTitle = params[1];
+                       swTitle = params[1].ToCFXWideString();
                        // FALLTHROUGH
                case 1:
-                       swQuestion = params[0];
+                       swQuestion = params[0].ToCFXWideString();
                        // FALLTHROUGH
                default:
                        break;
@@ -949,12 +931,12 @@ FX_BOOL app::response(OBJ_METHOD_PARAMS)
        return TRUE;
 }
 
-FX_BOOL app::media(OBJ_PROP_PARAMS)
+FX_BOOL app::media(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sError)
 {
        return FALSE;
 }
 
-FX_BOOL app::execDialog(OBJ_METHOD_PARAMS)
+FX_BOOL app::execDialog(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Value& vRet, CFX_WideString& sError)
 {
        return TRUE;
 }