Changeset 364


Ignore:
Timestamp:
May 10, 2012, 11:42:02 PM (13 years ago)
Author:
dmik
Message:

icedtea-web: Export OS/2 plugin entry points.

Location:
trunk/icedtea-web
Files:
1 added
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/icedtea-web/plugin/icedteanp/IcedTeaNPPlugin.cc

    r357 r364  
    10941094  msg = g_strdup_printf (FAILURE_MESSAGE, appletviewer_executable);
    10951095  WinMessageBox (HWND_DESKTOP, HWND_DESKTOP,
    1096                  msg, "Error", 0, MB_ERROR | MB_OK);
     1096                 msg, "Error", 0, MB_ERROR | MB_OK | MB_MOVEABLE);
    10971097  g_free(msg);
    10981098#else
     
    20002000}
    20012001
     2002static NPError
     2003plugin_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
    20022047// FACTORY FUNCTIONS
    20032048
     
    20122057// this workaround avoids any duplicate calls.
    20132058NPError
    2014 NP_Initialize (NPNetscapeFuncs* browserTable, NPPluginFuncs* pluginTable)
     2059#if defined(_WIN32) || defined (__OS2__)
     2060OSCALL NP_Initialize (NPNetscapeFuncs* browserTable)
     2061#else
     2062OSCALL NP_Initialize (NPNetscapeFuncs* browserTable, NPPluginFuncs* pluginTable)
     2063#endif
    20152064{
    20162065  PLUGIN_DEBUG ("NP_Initialize\n");
    20172066
     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
    20182075  if ((browserTable == NULL) || (pluginTable == NULL))
    20192076  {
     
    20222079    return NPERR_INVALID_FUNCTABLE_ERROR;
    20232080  }
     2081#endif
    20242082
    20252083  // Ensure that the major version of the plugin API that the browser
     
    20312089
    20322090      return NPERR_INCOMPATIBLE_VERSION_ERROR;
    2033     }
    2034 
    2035   // Ensure that the plugin function table we've received is large
    2036   // 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;
    20422091    }
    20432092
     
    20982147#endif
    20992148
    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;
    21282154#endif
    21292155
     
    21422168      return NPERR_OUT_OF_MEMORY_ERROR;
    21432169    }
    2144   NPError np_error = NPERR_NO_ERROR;
    21452170  gchar* filename = NULL;
    21462171
     
    22802305}
    22812306
     2307#if defined(_WIN32) || defined (__OS2__)
     2308NPError
     2309OSCALL 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
    22822324// Returns a string describing the MIME type that this plugin
    22832325// handles.
    22842326const char*
    2285 NP_GetMIMEDescription ()
     2327OSCALL NP_GetMIMEDescription ()
    22862328{
    22872329  PLUGIN_DEBUG ("NP_GetMIMEDescription\n");
     
    22952337// calls this function to obtain information about the plugin.
    22962338NPError
    2297 NP_GetValue (void* future, NPPVariable variable, void* value)
     2339OSCALL NP_GetValue (void* future, NPPVariable variable, void* value)
    22982340{
    22992341  PLUGIN_DEBUG ("NP_GetValue\n");
     
    23282370// destroyed.
    23292371NPError
    2330 NP_Shutdown (void)
     2372OSCALL NP_Shutdown (void)
    23312373{
    23322374  PLUGIN_DEBUG ("NP_Shutdown\n");
  • trunk/icedtea-web/plugin/icedteanp/Makefile.kmk

    r363 r364  
    3636    IcedTeaPluginRequestProcessor.cc \
    3737    IcedTeaPluginUtils.cc \
    38     $(PATH_ROOT)/extra/OS.cc
     38    $(PATH_ROOT)/extra/OS.cc \
     39    $(PATH_ROOT)/plugin_os2.def
    3940
    4041PLUGIN_RC           = $(npicedt_0_OUTDIR)/plugin_os2.rc
Note: See TracChangeset for help on using the changeset viewer.