Formatting fixes for the new unix npapi sample plugin. b=486423

This commit is contained in:
Josh Aas 2009-05-07 00:22:13 -04:00
parent b5e64e22ce
commit f2b2e422e2

View File

@ -57,7 +57,8 @@ typedef struct InstanceData {
NPWindow window;
} InstanceData;
static void fillPluginFunctionTable(NPPluginFuncs* pFuncs)
static void
fillPluginFunctionTable(NPPluginFuncs* pFuncs)
{
pFuncs->version = 11;
pFuncs->size = sizeof(*pFuncs);
@ -76,7 +77,9 @@ static void fillPluginFunctionTable(NPPluginFuncs* pFuncs)
pFuncs->setvalue = NPP_SetValue;
}
static void drawWindow(InstanceData* instanceData, GdkDrawable* gdkWindow) {
static void
drawWindow(InstanceData* instanceData, GdkDrawable* gdkWindow)
{
NPWindow window = instanceData->window;
int x = window.x;
int y = window.y;
@ -118,7 +121,8 @@ static void drawWindow(InstanceData* instanceData, GdkDrawable* gdkWindow) {
g_object_unref(gdkContext);
}
NP_EXPORT(NPError) NP_Initialize(NPNetscapeFuncs* bFuncs, NPPluginFuncs* pFuncs)
NP_EXPORT(NPError)
NP_Initialize(NPNetscapeFuncs* bFuncs, NPPluginFuncs* pFuncs)
{
sBrowserFuncs = bFuncs;
@ -127,17 +131,20 @@ NP_EXPORT(NPError) NP_Initialize(NPNetscapeFuncs* bFuncs, NPPluginFuncs* pFuncs)
return NPERR_NO_ERROR;
}
NP_EXPORT(char*) NP_GetPluginVersion()
NP_EXPORT(char*)
NP_GetPluginVersion()
{
return PLUGIN_VERSION;
}
NP_EXPORT(char*) NP_GetMIMEDescription()
NP_EXPORT(char*)
NP_GetMIMEDescription()
{
return "application/basic-plugin:bsc:Basic plugin";
}
NP_EXPORT(NPError) NP_GetValue(void* future, NPPVariable aVariable, void* aValue) {
NP_EXPORT(NPError)
NP_GetValue(void* future, NPPVariable aVariable, void* aValue) {
switch (aVariable) {
case NPPVpluginNameString:
*((char**)aValue) = PLUGIN_NAME;
@ -152,12 +159,14 @@ NP_EXPORT(NPError) NP_GetValue(void* future, NPPVariable aVariable, void* aValue
return NPERR_NO_ERROR;
}
NP_EXPORT(NPError) NP_Shutdown()
NP_EXPORT(NPError)
NP_Shutdown()
{
return NPERR_NO_ERROR;
}
NPError NPP_New(NPMIMEType pluginType, NPP instance, uint16_t mode, int16_t argc, char* argn[], char* argv[], NPSavedData* saved) {
NPError
NPP_New(NPMIMEType pluginType, NPP instance, uint16_t mode, int16_t argc, char* argn[], char* argv[], NPSavedData* saved) {
// Make sure we can render this plugin
NPBool browserSupportsWindowless = false;
sBrowserFuncs->getvalue(instance, NPNVSupportsWindowless, &browserSupportsWindowless);
@ -179,43 +188,52 @@ NPError NPP_New(NPMIMEType pluginType, NPP instance, uint16_t mode, int16_t argc
return NPERR_NO_ERROR;
}
NPError NPP_Destroy(NPP instance, NPSavedData** save) {
NPError
NPP_Destroy(NPP instance, NPSavedData** save) {
InstanceData* instanceData = (InstanceData*)(instance->pdata);
free(instanceData);
return NPERR_NO_ERROR;
}
NPError NPP_SetWindow(NPP instance, NPWindow* window) {
NPError
NPP_SetWindow(NPP instance, NPWindow* window) {
InstanceData* instanceData = (InstanceData*)(instance->pdata);
instanceData->window = *window;
return NPERR_NO_ERROR;
}
NPError NPP_NewStream(NPP instance, NPMIMEType type, NPStream* stream, NPBool seekable, uint16_t* stype) {
NPError
NPP_NewStream(NPP instance, NPMIMEType type, NPStream* stream, NPBool seekable, uint16_t* stype) {
return NPERR_GENERIC_ERROR;
}
NPError NPP_DestroyStream(NPP instance, NPStream* stream, NPReason reason) {
NPError
NPP_DestroyStream(NPP instance, NPStream* stream, NPReason reason) {
return NPERR_GENERIC_ERROR;
}
int32_t NPP_WriteReady(NPP instance, NPStream* stream) {
int32_t
NPP_WriteReady(NPP instance, NPStream* stream) {
return 0;
}
int32_t NPP_Write(NPP instance, NPStream* stream, int32_t offset, int32_t len, void* buffer) {
int32_t
NPP_Write(NPP instance, NPStream* stream, int32_t offset, int32_t len, void* buffer) {
return 0;
}
void NPP_StreamAsFile(NPP instance, NPStream* stream, const char* fname) {
void
NPP_StreamAsFile(NPP instance, NPStream* stream, const char* fname) {
}
void NPP_Print(NPP instance, NPPrint* platformPrint) {
void
NPP_Print(NPP instance, NPPrint* platformPrint) {
}
int16_t NPP_HandleEvent(NPP instance, void* event) {
int16_t
NPP_HandleEvent(NPP instance, void* event) {
InstanceData *instanceData = (InstanceData*)(instance->pdata);
XEvent *nativeEvent = (XEvent*)event;
@ -233,15 +251,18 @@ int16_t NPP_HandleEvent(NPP instance, void* event) {
return 1;
}
void NPP_URLNotify(NPP instance, const char* URL, NPReason reason, void* notifyData) {
void
NPP_URLNotify(NPP instance, const char* URL, NPReason reason, void* notifyData) {
}
NPError NPP_GetValue(NPP instance, NPPVariable variable, void *value) {
NPError
NPP_GetValue(NPP instance, NPPVariable variable, void *value) {
return NPERR_GENERIC_ERROR;
}
NPError NPP_SetValue(NPP instance, NPNVariable variable, void *value) {
NPError
NPP_SetValue(NPP instance, NPNVariable variable, void *value) {
return NPERR_GENERIC_ERROR;
}