Added version attribute to nsI4xScriptablePlugin.idl.
git-svn-id: svn://10.0.0.236/trunk@102647 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
@@ -26,4 +26,6 @@
|
||||
interface nsI4xScriptablePlugin : nsISupports {
|
||||
void showVersion();
|
||||
void clear();
|
||||
|
||||
readonly attribute string version;
|
||||
};
|
||||
|
||||
@@ -111,3 +111,10 @@ NS_IMETHODIMP nsScriptablePeer::Clear()
|
||||
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP nsScriptablePeer::GetVersion(char * *aVersion)
|
||||
{
|
||||
if (mPlugin)
|
||||
mPlugin->getVersion(aVersion);
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
@@ -81,8 +81,7 @@ protected:
|
||||
|
||||
public:
|
||||
// native methods callable from JavaScript
|
||||
NS_IMETHOD ShowVersion();
|
||||
NS_IMETHOD Clear();
|
||||
NS_DECL_NSI4XSCRIPTABLEPLUGIN
|
||||
|
||||
protected:
|
||||
CPlugin* mPlugin;
|
||||
|
||||
@@ -116,6 +116,15 @@ void CPlugin::clear()
|
||||
#endif
|
||||
}
|
||||
|
||||
void CPlugin::getVersion(char* *aVersion)
|
||||
{
|
||||
const char *ua = NPN_UserAgent(m_pNPInstance);
|
||||
char*& version = *aVersion;
|
||||
version = (char*)NPN_MemAlloc(1 + strlen(ua));
|
||||
if (version)
|
||||
strcpy(version, ua);
|
||||
}
|
||||
|
||||
// ==============================
|
||||
// ! Scriptability related code !
|
||||
// ==============================
|
||||
|
||||
@@ -52,6 +52,7 @@ public:
|
||||
|
||||
void showVersion();
|
||||
void clear();
|
||||
void getVersion(char* *aVersion);
|
||||
|
||||
nsI4xScriptablePlugin* getScriptablePeer();
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user