Author: fejj
Date: 2007-12-11 17:46:09 -0500 (Tue, 11 Dec 2007)
New Revision: 91134
Modified:
trunk/moon/plugin/plugin-entry.cpp
trunk/moon/plugin/plugin-glue.cpp
trunk/moon/plugin/plugin.h
Log:
code cleanup
Modified: trunk/moon/plugin/plugin-entry.cpp
===================================================================
--- trunk/moon/plugin/plugin-entry.cpp 2007-12-11 22:31:42 UTC (rev 91133)
+++ trunk/moon/plugin/plugin-entry.cpp 2007-12-11 22:46:09 UTC (rev 91134)
@@ -28,7 +28,8 @@
/*** Wrapper functions
********************************************************/
-void NPN_Version (int* plugin_major, int* plugin_minor, int* netscape_major,
int* netscape_minor)
+void
+NPN_Version (int *plugin_major, int *plugin_minor, int *netscape_major, int
*netscape_minor)
{
*plugin_major = NP_VERSION_MAJOR;
*plugin_minor = NP_VERSION_MINOR;
@@ -49,49 +50,49 @@
}
NPError
-NPN_GetURL (NPP instance, const char* url, const char* window)
+NPN_GetURL (NPP instance, const char *url, const char *window)
{
return CallNPN_GetURLProc (MozillaFuncs.geturl, instance, url, window);
}
NPError
-NPN_GetURLNotify (NPP instance, const char* url,
- const char* window, void* notifyData)
+NPN_GetURLNotify (NPP instance, const char *url,
+ const char *window, void *notifyData)
{
return CallNPN_GetURLNotifyProc (MozillaFuncs.geturlnotify, instance,
- url, window, notifyData);
+ url, window, notifyData);
}
NPError
-NPN_PostURL (NPP instance, const char* url, const char* window,
- uint32 len, const char* buf, NPBool file)
+NPN_PostURL (NPP instance, const char *url, const char *window,
+ uint32_t len, const char *buf, NPBool file)
{
return CallNPN_PostURLProc (MozillaFuncs.posturl, instance, url,
window, len, buf, file);
}
NPError
-NPN_PostURLNotify (NPP instance, const char* url, const char* window,
- uint32 len, const char* buf, NPBool file, void*
notifyData)
+NPN_PostURLNotify (NPP instance, const char *url, const char *window,
+ uint32_t len, const char *buf, NPBool file, void *notifyData)
{
return CallNPN_PostURLNotifyProc (MozillaFuncs.posturlnotify, instance,
url,
- window, len, buf, file, notifyData);
+ window, len, buf, file, notifyData);
}
NPError
-NPN_RequestRead (NPStream* stream, NPByteRange* rangeList)
+NPN_RequestRead (NPStream *stream, NPByteRange *rangeList)
{
return CallNPN_RequestReadProc (MozillaFuncs.requestread, stream,
rangeList);
}
NPError
-NPN_NewStream (NPP instance, NPMIMEType type, const char *window, NPStream**
stream_ptr)
+NPN_NewStream (NPP instance, NPMIMEType type, const char *window, NPStream
**stream_ptr)
{
return CallNPN_NewStreamProc (MozillaFuncs.newstream, instance,
- type, window, stream_ptr);
+ type, window, stream_ptr);
}
-int32
-NPN_Write (NPP instance, NPStream* stream, int32 len, void* buffer)
+int32_t
+NPN_Write (NPP instance, NPStream *stream, int32_t len, void *buffer)
{
return CallNPN_WriteProc (MozillaFuncs.write, instance, stream, len,
buffer);
}
@@ -108,26 +109,26 @@
CallNPN_StatusProc (MozillaFuncs.status, instance, message);
}
-const char*
+const char *
NPN_UserAgent (NPP instance)
{
return CallNPN_UserAgentProc (MozillaFuncs.uagent, instance);
}
void *
-NPN_MemAlloc (uint32 size)
+NPN_MemAlloc (uint32_t size)
{
return CallNPN_MemAllocProc (MozillaFuncs.memalloc, size);
}
void
-NPN_MemFree (void* ptr)
+NPN_MemFree (void *ptr)
{
CallNPN_MemFreeProc (MozillaFuncs.memfree, ptr);
}
-uint32
-NPN_MemFlush (uint32 size)
+uint32_t
+NPN_MemFlush (uint32_t size)
{
return CallNPN_MemFlushProc (MozillaFuncs.memflush, size);
}
@@ -168,7 +169,7 @@
NPN_GetStringIdentifiers (const NPUTF8 **names, int32_t nameCount,
NPIdentifier *identifiers)
{
CallNPN_GetStringIdentifiersProc (MozillaFuncs.getstringidentifiers,
- names, nameCount, identifiers);
+ names, nameCount, identifiers);
}
NPIdentifier
@@ -213,62 +214,63 @@
return CallNPN_ReleaseObjectProc (MozillaFuncs.releaseobject, obj);
}
-bool NPN_Invoke (NPP npp, NPObject* obj, NPIdentifier methodName,
- const NPVariant *args, uint32_t argCount, NPVariant *result)
+bool
+NPN_Invoke (NPP npp, NPObject *obj, NPIdentifier methodName,
+ const NPVariant *args, uint32_t argCount, NPVariant *result)
{
return CallNPN_InvokeProc (MozillaFuncs.invoke, npp, obj, methodName,
args, argCount, result);
}
bool
-NPN_InvokeDefault (NPP npp, NPObject* obj, const NPVariant *args,
- uint32_t argCount, NPVariant *result)
+NPN_InvokeDefault (NPP npp, NPObject *obj, const NPVariant *args,
+ uint32_t argCount, NPVariant *result)
{
return CallNPN_InvokeDefaultProc (MozillaFuncs.invokeDefault, npp, obj,
args, argCount, result);
}
bool
-NPN_Evaluate (NPP npp, NPObject* obj, NPString *script, NPVariant *result)
+NPN_Evaluate (NPP npp, NPObject *obj, NPString *script, NPVariant *result)
{
return CallNPN_EvaluateProc (MozillaFuncs.evaluate, npp, obj, script,
result);
}
bool
-NPN_GetProperty (NPP npp, NPObject* obj, NPIdentifier propertyName, NPVariant
*result)
+NPN_GetProperty (NPP npp, NPObject *obj, NPIdentifier propertyName, NPVariant
*result)
{
return CallNPN_GetPropertyProc (MozillaFuncs.getproperty, npp, obj,
propertyName, result);
}
bool
-NPN_SetProperty (NPP npp, NPObject* obj, NPIdentifier propertyName,
- const NPVariant *value)
+NPN_SetProperty (NPP npp, NPObject *obj, NPIdentifier propertyName, const
NPVariant *value)
{
return CallNPN_SetPropertyProc (MozillaFuncs.setproperty, npp, obj,
propertyName, value);
}
bool
-NPN_RemoveProperty (NPP npp, NPObject* obj, NPIdentifier propertyName)
+NPN_RemoveProperty (NPP npp, NPObject *obj, NPIdentifier propertyName)
{
return CallNPN_RemovePropertyProc (MozillaFuncs.removeproperty, npp,
obj, propertyName);
}
bool
-NPN_HasProperty (NPP npp, NPObject* obj, NPIdentifier propertyName)
+NPN_HasProperty (NPP npp, NPObject *obj, NPIdentifier propertyName)
{
return CallNPN_HasPropertyProc (MozillaFuncs.hasproperty, npp, obj,
propertyName);
}
bool
-NPN_HasMethod (NPP npp, NPObject* obj, NPIdentifier methodName)
+NPN_HasMethod (NPP npp, NPObject *obj, NPIdentifier methodName)
{
return CallNPN_HasMethodProc (MozillaFuncs.hasmethod, npp, obj,
methodName);
}
-void NPN_ReleaseVariantValue(NPVariant *variant)
+void
+NPN_ReleaseVariantValue (NPVariant *variant)
{
CallNPN_ReleaseVariantValueProc (MozillaFuncs.releasevariantvalue,
variant);
}
-void NPN_SetException(NPObject* obj, const NPUTF8 *message)
+void NPN_SetException (NPObject *obj, const NPUTF8 *message)
{
CallNPN_SetExceptionProc (MozillaFuncs.setexception, obj, message);
}
@@ -289,7 +291,7 @@
/*** These functions are located automagically by mozilla
*********************/
-char*
+char *
LOADER_RENAMED_SYM(NP_GetMIMEDescription) (void)
{
return NPP_GetMIMEDescription ();
@@ -326,16 +328,16 @@
// XEmbed ?
err = CallNPN_GetValueProc (mozilla_funcs->getvalue, NULL,
-
NPNVSupportsXEmbedBool,
- (void
*)&supportsXEmbed);
+ NPNVSupportsXEmbedBool,
+ (void *) &supportsXEmbed);
if (err != NPERR_NO_ERROR || supportsXEmbed != PR_TRUE)
return NPERR_INCOMPATIBLE_VERSION_ERROR;
// GTK+ ?
err = CallNPN_GetValueProc (mozilla_funcs->getvalue, NULL,
- NPNVToolkit,
- (void
*)&toolkit);
+ NPNVToolkit,
+ (void *) &toolkit);
if (err != NPERR_NO_ERROR || toolkit != NPNVGtk2)
return NPERR_INCOMPATIBLE_VERSION_ERROR;
Modified: trunk/moon/plugin/plugin-glue.cpp
===================================================================
--- trunk/moon/plugin/plugin-glue.cpp 2007-12-11 22:31:42 UTC (rev 91133)
+++ trunk/moon/plugin/plugin-glue.cpp 2007-12-11 22:46:09 UTC (rev 91134)
@@ -16,7 +16,7 @@
#include "moon-mono.h"
NPError
-NPP_New (NPMIMEType pluginType, NPP instance, uint16 mode, int16 argc, char*
argn[], char* argv[], NPSavedData* saved)
+NPP_New (NPMIMEType pluginType, NPP instance, uint16_t mode, int16_t argc,
char *argn[], char *argv[], NPSavedData *saved)
{
if (!instance)
return NPERR_INVALID_INSTANCE_ERROR;
@@ -32,7 +32,7 @@
}
NPError
-NPP_Destroy (NPP instance, NPSavedData** save)
+NPP_Destroy (NPP instance, NPSavedData **save)
{
if (instance == NULL)
return NPERR_INVALID_INSTANCE_ERROR;
@@ -47,7 +47,7 @@
}
NPError
-NPP_SetWindow (NPP instance, NPWindow* window)
+NPP_SetWindow (NPP instance, NPWindow *window)
{
if (instance == NULL)
return NPERR_INVALID_INSTANCE_ERROR;
@@ -57,7 +57,7 @@
}
NPError
-NPP_NewStream (NPP instance, NPMIMEType type, NPStream* stream, NPBool
seekable, uint16* stype)
+NPP_NewStream (NPP instance, NPMIMEType type, NPStream *stream, NPBool
seekable, uint16_t *stype)
{
if (instance == NULL)
return NPERR_INVALID_INSTANCE_ERROR;
@@ -67,7 +67,7 @@
}
NPError
-NPP_DestroyStream (NPP instance, NPStream* stream, NPError reason)
+NPP_DestroyStream (NPP instance, NPStream *stream, NPError reason)
{
if (instance == NULL)
return NPERR_INVALID_INSTANCE_ERROR;
@@ -77,7 +77,7 @@
}
void
-NPP_StreamAsFile (NPP instance, NPStream* stream, const char* fname)
+NPP_StreamAsFile (NPP instance, NPStream *stream, const char *fname)
{
if (instance == NULL)
return;
@@ -86,8 +86,8 @@
plugin->StreamAsFile (stream, fname);
}
-int32
-NPP_WriteReady (NPP instance, NPStream* stream)
+int32_t
+NPP_WriteReady (NPP instance, NPStream *stream)
{
if (instance == NULL)
return NPERR_INVALID_INSTANCE_ERROR;
@@ -96,8 +96,8 @@
return plugin->WriteReady (stream);
}
-int32
-NPP_Write (NPP instance, NPStream* stream, int32 offset, int32 len, void*
buffer)
+int32_t
+NPP_Write (NPP instance, NPStream *stream, int32_t offset, int32_t len, void
*buffer)
{
if (instance == NULL)
return NPERR_INVALID_INSTANCE_ERROR;
@@ -107,7 +107,7 @@
}
void
-NPP_Print (NPP instance, NPPrint* platformPrint)
+NPP_Print (NPP instance, NPPrint *platformPrint)
{
if (instance == NULL)
return;
@@ -117,7 +117,7 @@
}
void
-NPP_URLNotify (NPP instance, const char* url, NPReason reason, void*
notifyData)
+NPP_URLNotify (NPP instance, const char *url, NPReason reason, void
*notifyData)
{
if (instance == NULL)
return;
@@ -127,8 +127,8 @@
}
-int16
-NPP_HandleEvent (NPP instance, void* event)
+int16_t
+NPP_HandleEvent (NPP instance, void *event)
{
if (instance == NULL)
return NPERR_INVALID_INSTANCE_ERROR;
Modified: trunk/moon/plugin/plugin.h
===================================================================
--- trunk/moon/plugin/plugin.h 2007-12-11 22:31:42 UTC (rev 91133)
+++ trunk/moon/plugin/plugin.h 2007-12-11 22:46:09 UTC (rev 91134)
@@ -19,15 +19,15 @@
class PluginXamlLoader;
class PluginInstance;
-typedef void plugin_unload_callback (PluginInstance* plugin);
+typedef void plugin_unload_callback (PluginInstance *plugin);
class PluginInstance
{
private:
- uint16 mode; // NP_EMBED, NP_FULL, or NP_BACKGROUND
+ uint16_t mode; // NP_EMBED, NP_FULL, or NP_BACKGROUND
NPWindow *window; // Mozilla window object
NPP instance; // Mozilla instance object
- NPObject* rootobject; // Mozilla jscript object wrapper
+ NPObject *rootobject; // Mozilla jscript object wrapper
bool xembed_supported; // XEmbed Extension supported
GHashTable *wrapped_objects; // wrapped object cache
@@ -45,11 +45,12 @@
//
// The XAML loader, contains a handle to a MonoObject *
//
- PluginXamlLoader* xaml_loader;
+ PluginXamlLoader *xaml_loader;
+
//
// A (managed) callback to call when the plugin is unloaded.
//
- plugin_unload_callback* plugin_unload;
+ plugin_unload_callback *plugin_unload;
// The name of the file that we are missing, and we requested to be
loaded
char *vm_missing_file;
@@ -62,37 +63,38 @@
void SetPageURL ();
public:
- PluginInstance (NPP instance, uint16 mode);
+ PluginInstance (NPP instance, uint16_t mode);
~PluginInstance ();
- void SetUnloadCallback (plugin_unload_callback* puc);
- void Initialize (int argc, char* const argn[], char* const argv[]);
+
+ void SetUnloadCallback (plugin_unload_callback *puc);
+ void Initialize (int argc, char *const argn[], char *const argv[]);
void Finalize ();
// Mozilla plugin related methods
NPError GetValue (NPPVariable variable, void *result);
NPError SetValue (NPNVariable variable, void *value);
- NPError SetWindow (NPWindow* window);
- NPError NewStream (NPMIMEType type, NPStream* stream, NPBool seekable,
uint16* stype);
- NPError DestroyStream (NPStream* stream, NPError reason);
- void StreamAsFile (NPStream* stream, const char* fname);
- int32 WriteReady (NPStream* stream);
- int32 Write (NPStream* stream, int32 offset, int32 len, void* buffer);
- void UrlNotify (const char* url, NPReason reason, void* notifyData);
- void Print (NPPrint* platformPrint);
- int16 EventHandle (void* event);
+ NPError SetWindow (NPWindow *window);
+ NPError NewStream (NPMIMEType type, NPStream *stream, NPBool seekable,
uint16_t *stype);
+ NPError DestroyStream (NPStream *stream, NPError reason);
+ void StreamAsFile (NPStream *stream, const char *fname);
+ int32_t WriteReady (NPStream *stream);
+ int32_t Write (NPStream *stream, int32_t offset, int32_t len, void
*buffer);
+ void UrlNotify (const char *url, NPReason reason, void *notifyData);
+ void Print (NPPrint *platformPrint);
+ int16 EventHandle (void *event);
bool JsRunOnload ();
void ReportException (char *msg, char *details, char **stack_trace, int
num_frames);
- void *LoadUrl (char *url, gint32 *length);
+ void *LoadUrl (char *url, int32_t *length);
void AddWrappedObject (EventObject *obj, NPObject *wrapper);
void RemoveWrappedObject (EventObject *obj);
- NPObject* LookupWrappedObject (EventObject *obj);
+ NPObject *LookupWrappedObject (EventObject *obj);
void Properties ();
NPP getNPP () { return instance; }
- static Downloader* CreateDownloader (PluginInstance* instance)
+ static Downloader *CreateDownloader (PluginInstance *instance)
{
if (instance) {
return instance->surface->CreateDownloader ();
@@ -124,8 +126,8 @@
MoonlightScriptControlObject *getRootObject ();
NPP getInstance ();
- int32 getActualHeight ();
- int32 getActualWidth ();
+ int32_t getActualHeight ();
+ int32_t getActualWidth ();
void getBrowserInformation (char **name, char **version,
char **platform, char **userAgent,
@@ -161,17 +163,17 @@
};
StreamNotify () : type (NONE), pdata (NULL) {};
- StreamNotify (void* data) : type (NONE), pdata (data) {};
+ StreamNotify (void *data) : type (NONE), pdata (data) {};
StreamNotify (StreamNotifyFlags type) : type (type), pdata (NULL) {};
- StreamNotify (StreamNotifyFlags type, void* data) : type (type), pdata
(data) {};
- StreamNotify (StreamNotifyFlags type, DependencyObject* dob) : type
(type), pdata (dob)
+ StreamNotify (StreamNotifyFlags type, void *data) : type (type), pdata
(data) {};
+ StreamNotify (StreamNotifyFlags type, DependencyObject *dob) : type
(type), pdata (dob)
{
base_ref (dob);
}
~StreamNotify ()
{
if (type == DOWNLOADER)
- base_unref ((DependencyObject*) pdata);
+ base_unref ((DependencyObject *) pdata);
}
StreamNotifyFlags type;
@@ -180,42 +182,42 @@
class PluginXamlLoader : public XamlLoader
{
- private:
- PluginXamlLoader (const char* filename, const char* str,
PluginInstance* plugin, Surface* surface);
- bool InitializeLoader ();
- PluginInstance* plugin;
- bool initialized;
- bool xaml_is_managed;
-
+private:
+ PluginXamlLoader (const char *filename, const char *str, PluginInstance
*plugin, Surface *surface);
+ bool InitializeLoader ();
+ PluginInstance *plugin;
+ bool initialized;
+ bool xaml_is_managed;
+
#if INCLUDE_MONO_RUNTIME
- gpointer managed_loader;
+ gpointer managed_loader;
#endif
- public:
- virtual ~PluginXamlLoader ();
- const char* TryLoad (int *error);
-
- static PluginXamlLoader* FromFilename (const char* filename,
PluginInstance* plugin, Surface* surface)
- {
- return new PluginXamlLoader (filename, NULL, plugin,
surface);
- }
- static PluginXamlLoader* FromStr (const char* str,
PluginInstance* plugin, Surface* surface)
- {
- return new PluginXamlLoader (NULL, str, plugin,
surface);
- }
-
- bool IsManaged () { return xaml_is_managed; }
- virtual bool HookupEvent (void* target, const char* name, const
char* value);
- virtual bool LoadVM ();
+public:
+ virtual ~PluginXamlLoader ();
+ const char *TryLoad (int *error);
+
+ static PluginXamlLoader *FromFilename (const char *filename,
PluginInstance *plugin, Surface *surface)
+ {
+ return new PluginXamlLoader (filename, NULL, plugin, surface);
+ }
+ static PluginXamlLoader *FromStr (const char *str, PluginInstance
*plugin, Surface *surface)
+ {
+ return new PluginXamlLoader (NULL, str, plugin, surface);
+ }
+
+ bool IsManaged () { return xaml_is_managed; }
+ virtual bool HookupEvent (void *target, const char *name, const char
*value);
+ virtual bool LoadVM ();
};
G_BEGIN_DECLS
-int32 plugin_instance_get_actual_width (PluginInstance *instance);
-int32 plugin_instance_get_actual_height (PluginInstance *instance);
+int32_t plugin_instance_get_actual_width (PluginInstance *instance);
+int32_t plugin_instance_get_actual_height (PluginInstance *instance);
Surface *plugin_instance_get_surface (PluginInstance *instance);
-char* plugin_instance_get_init_params (PluginInstance *instance);
+char *plugin_instance_get_init_params (PluginInstance *instance);
void plugin_instance_get_browser_information (PluginInstance *instance,
char **name, char **version,
@@ -223,15 +225,16 @@
bool *cookieEnabled);
void plugin_instance_get_browser_runtime_settings (bool *debug, bool
*html_access,
- bool *httpnet_access,
bool *script_access);
+ bool *httpnet_access, bool
*script_access);
void plugin_instance_report_exception (PluginInstance *instance, char *msg,
char *details, char **stack_trace, int num_frames);
-void *plugin_instance_load_url (PluginInstance *instance, char *url, gint32
*length);
+void *plugin_instance_load_url (PluginInstance *instance, char *url, int32_t
*length);
void plugin_html_timer_timeout_stop (PluginInstance *instance, uint32_t
source_id);
uint32_t plugin_html_timer_timeout_add (PluginInstance *instance, int32_t
interval, GSourceFunc callback, gpointer data);
-void plugin_set_unload_callback (PluginInstance* instance,
plugin_unload_callback* puc);
-PluginXamlLoader* plugin_xaml_loader_from_str (const char* str,
PluginInstance* plugin, Surface* surface);
+void plugin_set_unload_callback (PluginInstance *instance,
plugin_unload_callback *puc);
+PluginXamlLoader *plugin_xaml_loader_from_str (const char *str, PluginInstance
*plugin, Surface *surface);
+
G_END_DECLS
#endif /* MOON_PLUGIN */
_______________________________________________
Mono-patches maillist - [email protected]
http://lists.ximian.com/mailman/listinfo/mono-patches