Changeset 364
- Timestamp:
- May 10, 2012, 11:42:02 PM (13 years ago)
- Location:
- trunk/icedtea-web
- Files:
-
- 1 added
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/icedtea-web/plugin/icedteanp/IcedTeaNPPlugin.cc
r357 r364 1094 1094 msg = g_strdup_printf (FAILURE_MESSAGE, appletviewer_executable); 1095 1095 WinMessageBox (HWND_DESKTOP, HWND_DESKTOP, 1096 msg, "Error", 0, MB_ERROR | MB_OK );1096 msg, "Error", 0, MB_ERROR | MB_OK | MB_MOVEABLE); 1097 1097 g_free(msg); 1098 1098 #else … … 2000 2000 } 2001 2001 2002 static NPError 2003 plugin_get_entry_points (NPPluginFuncs* pluginTable) 2004 { 2005 // Ensure that the plugin function table we've received is large 2006 // enough to store the number of functions that we may provide. 2007 if (pluginTable->size < sizeof (NPPluginFuncs)) 2008 { 2009 PLUGIN_ERROR ("Invalid plugin function table."); 2010 2011 return NPERR_INVALID_FUNCTABLE_ERROR; 2012 } 2013 2014 // Return to the browser the plugin functions that we implement. 2015 pluginTable->version = (NP_VERSION_MAJOR << 8) + NP_VERSION_MINOR; 2016 pluginTable->size = sizeof (NPPluginFuncs); 2017 2018 #if MOZILLA_VERSION_COLLAPSED < 1090100 2019 pluginTable->newp = NewNPP_NewProc (ITNP_New); 2020 pluginTable->destroy = NewNPP_DestroyProc (ITNP_Destroy); 2021 pluginTable->setwindow = NewNPP_SetWindowProc (ITNP_SetWindow); 2022 pluginTable->newstream = NewNPP_NewStreamProc (ITNP_NewStream); 2023 pluginTable->destroystream = NewNPP_DestroyStreamProc (ITNP_DestroyStream); 2024 pluginTable->asfile = NewNPP_StreamAsFileProc (ITNP_StreamAsFile); 2025 pluginTable->writeready = NewNPP_WriteReadyProc (ITNP_WriteReady); 2026 pluginTable->write = NewNPP_WriteProc (ITNP_Write); 2027 pluginTable->print = NewNPP_PrintProc (ITNP_Print); 2028 pluginTable->urlnotify = NewNPP_URLNotifyProc (ITNP_URLNotify); 2029 pluginTable->getvalue = NewNPP_GetValueProc (ITNP_GetValue); 2030 #else 2031 pluginTable->newp = NPP_NewProcPtr (ITNP_New); 2032 pluginTable->destroy = NPP_DestroyProcPtr (ITNP_Destroy); 2033 pluginTable->setwindow = NPP_SetWindowProcPtr (ITNP_SetWindow); 2034 pluginTable->newstream = NPP_NewStreamProcPtr (ITNP_NewStream); 2035 pluginTable->destroystream = NPP_DestroyStreamProcPtr (ITNP_DestroyStream); 2036 pluginTable->asfile = NPP_StreamAsFileProcPtr (ITNP_StreamAsFile); 2037 pluginTable->writeready = NPP_WriteReadyProcPtr (ITNP_WriteReady); 2038 pluginTable->write = NPP_WriteProcPtr (ITNP_Write); 2039 pluginTable->print = NPP_PrintProcPtr (ITNP_Print); 2040 pluginTable->urlnotify = NPP_URLNotifyProcPtr (ITNP_URLNotify); 2041 pluginTable->getvalue = NPP_GetValueProcPtr (ITNP_GetValue); 2042 #endif 2043 2044 return NPERR_NO_ERROR; 2045 } 2046 2002 2047 // FACTORY FUNCTIONS 2003 2048 … … 2012 2057 // this workaround avoids any duplicate calls. 2013 2058 NPError 2014 NP_Initialize (NPNetscapeFuncs* browserTable, NPPluginFuncs* pluginTable) 2059 #if defined(_WIN32) || defined (__OS2__) 2060 OSCALL NP_Initialize (NPNetscapeFuncs* browserTable) 2061 #else 2062 OSCALL NP_Initialize (NPNetscapeFuncs* browserTable, NPPluginFuncs* pluginTable) 2063 #endif 2015 2064 { 2016 2065 PLUGIN_DEBUG ("NP_Initialize\n"); 2017 2066 2067 #if defined(_WIN32) || defined (__OS2__) 2068 if (browserTable == NULL) 2069 { 2070 PLUGIN_ERROR ("Browser function table is NULL."); 2071 2072 return NPERR_INVALID_FUNCTABLE_ERROR; 2073 } 2074 #else 2018 2075 if ((browserTable == NULL) || (pluginTable == NULL)) 2019 2076 { … … 2022 2079 return NPERR_INVALID_FUNCTABLE_ERROR; 2023 2080 } 2081 #endif 2024 2082 2025 2083 // Ensure that the major version of the plugin API that the browser … … 2031 2089 2032 2090 return NPERR_INCOMPATIBLE_VERSION_ERROR; 2033 }2034 2035 // Ensure that the plugin function table we've received is large2036 // enough to store the number of functions that we may provide.2037 if (pluginTable->size < sizeof (NPPluginFuncs))2038 {2039 PLUGIN_ERROR ("Invalid plugin function table.");2040 2041 return NPERR_INVALID_FUNCTABLE_ERROR;2042 2091 } 2043 2092 … … 2098 2147 #endif 2099 2148 2100 // Return to the browser the plugin functions that we implement. 2101 pluginTable->version = (NP_VERSION_MAJOR << 8) + NP_VERSION_MINOR; 2102 pluginTable->size = sizeof (NPPluginFuncs); 2103 2104 #if MOZILLA_VERSION_COLLAPSED < 1090100 2105 pluginTable->newp = NewNPP_NewProc (ITNP_New); 2106 pluginTable->destroy = NewNPP_DestroyProc (ITNP_Destroy); 2107 pluginTable->setwindow = NewNPP_SetWindowProc (ITNP_SetWindow); 2108 pluginTable->newstream = NewNPP_NewStreamProc (ITNP_NewStream); 2109 pluginTable->destroystream = NewNPP_DestroyStreamProc (ITNP_DestroyStream); 2110 pluginTable->asfile = NewNPP_StreamAsFileProc (ITNP_StreamAsFile); 2111 pluginTable->writeready = NewNPP_WriteReadyProc (ITNP_WriteReady); 2112 pluginTable->write = NewNPP_WriteProc (ITNP_Write); 2113 pluginTable->print = NewNPP_PrintProc (ITNP_Print); 2114 pluginTable->urlnotify = NewNPP_URLNotifyProc (ITNP_URLNotify); 2115 pluginTable->getvalue = NewNPP_GetValueProc (ITNP_GetValue); 2116 #else 2117 pluginTable->newp = NPP_NewProcPtr (ITNP_New); 2118 pluginTable->destroy = NPP_DestroyProcPtr (ITNP_Destroy); 2119 pluginTable->setwindow = NPP_SetWindowProcPtr (ITNP_SetWindow); 2120 pluginTable->newstream = NPP_NewStreamProcPtr (ITNP_NewStream); 2121 pluginTable->destroystream = NPP_DestroyStreamProcPtr (ITNP_DestroyStream); 2122 pluginTable->asfile = NPP_StreamAsFileProcPtr (ITNP_StreamAsFile); 2123 pluginTable->writeready = NPP_WriteReadyProcPtr (ITNP_WriteReady); 2124 pluginTable->write = NPP_WriteProcPtr (ITNP_Write); 2125 pluginTable->print = NPP_PrintProcPtr (ITNP_Print); 2126 pluginTable->urlnotify = NPP_URLNotifyProcPtr (ITNP_URLNotify); 2127 pluginTable->getvalue = NPP_GetValueProcPtr (ITNP_GetValue); 2149 NPError np_error = NPERR_NO_ERROR; 2150 #if !defined(_WIN32) && !defined (__OS2__) 2151 np_error = plugin_get_entry_points (pluginTable); 2152 if (np_error != NPERR_NO_ERROR) 2153 return np_error; 2128 2154 #endif 2129 2155 … … 2142 2168 return NPERR_OUT_OF_MEMORY_ERROR; 2143 2169 } 2144 NPError np_error = NPERR_NO_ERROR;2145 2170 gchar* filename = NULL; 2146 2171 … … 2280 2305 } 2281 2306 2307 #if defined(_WIN32) || defined (__OS2__) 2308 NPError 2309 OSCALL NP_GetEntryPoints (NPPluginFuncs* pluginTable) 2310 { 2311 PLUGIN_DEBUG ("NP_GetEntryPoints\n"); 2312 2313 if (pluginTable == NULL) 2314 { 2315 PLUGIN_ERROR ("Plugin function table is NULL."); 2316 2317 return NPERR_INVALID_FUNCTABLE_ERROR; 2318 } 2319 2320 return plugin_get_entry_points (pluginTable); 2321 } 2322 #endif 2323 2282 2324 // Returns a string describing the MIME type that this plugin 2283 2325 // handles. 2284 2326 const char* 2285 NP_GetMIMEDescription ()2327 OSCALL NP_GetMIMEDescription () 2286 2328 { 2287 2329 PLUGIN_DEBUG ("NP_GetMIMEDescription\n"); … … 2295 2337 // calls this function to obtain information about the plugin. 2296 2338 NPError 2297 NP_GetValue (void* future, NPPVariable variable, void* value)2339 OSCALL NP_GetValue (void* future, NPPVariable variable, void* value) 2298 2340 { 2299 2341 PLUGIN_DEBUG ("NP_GetValue\n"); … … 2328 2370 // destroyed. 2329 2371 NPError 2330 NP_Shutdown (void)2372 OSCALL NP_Shutdown (void) 2331 2373 { 2332 2374 PLUGIN_DEBUG ("NP_Shutdown\n"); -
trunk/icedtea-web/plugin/icedteanp/Makefile.kmk
r363 r364 36 36 IcedTeaPluginRequestProcessor.cc \ 37 37 IcedTeaPluginUtils.cc \ 38 $(PATH_ROOT)/extra/OS.cc 38 $(PATH_ROOT)/extra/OS.cc \ 39 $(PATH_ROOT)/plugin_os2.def 39 40 40 41 PLUGIN_RC = $(npicedt_0_OUTDIR)/plugin_os2.rc
Note:
See TracChangeset
for help on using the changeset viewer.