/[gcjwebplugin]/gcjwebplugin/src/gcjwebplugin.cc
ViewVC logotype

Diff of /gcjwebplugin/src/gcjwebplugin.cc

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.28 by mkoch, Wed Nov 24 08:06:23 2004 UTC revision 1.29 by mkoch, Sun Nov 28 08:12:47 2004 UTC
# Line 64  static NS_DEFINE_IID (kIPluginTagInfo2II Line 64  static NS_DEFINE_IID (kIPluginTagInfo2II
64    
65  static NPNetscapeFuncs browserFunctions;  static NPNetscapeFuncs browserFunctions;
66    
67    static GMutex *mutex_appletviewer_process = NULL;
68  static gint send_message_to_appletviewer (gchar const* value);  static gint send_message_to_appletviewer (gchar const* value);
69  static gint receive_message_from_appletviewer (gchar* string);  static gint receive_message_from_appletviewer (gchar* string);
70  static gboolean callbackViewerRead (GIOChannel* source,  static gboolean callbackViewerRead (GIOChannel* source,
# Line 84  struct GCJPluginData Line 85  struct GCJPluginData
85    char *instance_id;    char *instance_id;
86  };  };
87    
88    static NPError start_appletviewer_process (void);
89    
90  static GIOChannel *output_to_appletviewer = NULL;  static GIOChannel *output_to_appletviewer = NULL;
91  static GIOChannel *input_from_appletviewer = NULL;  static GIOChannel *input_from_appletviewer = NULL;
92    
# Line 125  GCJ_New (NPMIMEType pluginType, NPP inst Line 128  GCJ_New (NPMIMEType pluginType, NPP inst
128    if (!instance)    if (!instance)
129      return NPERR_INVALID_INSTANCE_ERROR;      return NPERR_INVALID_INSTANCE_ERROR;
130    
131      NPError tmp = NPERR_NO_ERROR;
132      
133      g_mutex_lock (mutex_appletviewer_process);
134      if (! output_to_appletviewer) // Start appletviewer process if necessary.
135        tmp = start_appletviewer_process();
136      g_mutex_unlock (mutex_appletviewer_process);
137    
138      if (tmp != NPERR_NO_ERROR)
139        return tmp;
140    
141    GCJPluginData* data = NULL;    GCJPluginData* data = NULL;
142    
143    gcjplugindata_new (&data);    gcjplugindata_new (&data);
# Line 501  NP_Initialize(NPNetscapeFuncs* browserTa Line 514  NP_Initialize(NPNetscapeFuncs* browserTa
514    pluginTable->urlnotify = NewNPP_URLNotifyProc(GCJ_URLNotify);    pluginTable->urlnotify = NewNPP_URLNotifyProc(GCJ_URLNotify);
515    pluginTable->getvalue = NewNPP_GetValueProc(GCJ_GetValue);    pluginTable->getvalue = NewNPP_GetValueProc(GCJ_GetValue);
516    
517      mutex_appletviewer_process = g_mutex_new ();
518      
519      return NPERR_NO_ERROR;
520    }
521    
522    static NPError
523    start_appletviewer_process(void)
524    {
525    
526    // Add install prefix to PATH.    // Add install prefix to PATH.
527    char *searchpath = getenv("PATH");    char *searchpath = getenv("PATH");
528    char *newpath = NULL;    char *newpath = NULL;
# Line 533  NP_Initialize(NPNetscapeFuncs* browserTa Line 555  NP_Initialize(NPNetscapeFuncs* browserTa
555        g_printerr ("GCJ_New: Error: %s\n", strerror (errno));        g_printerr ("GCJ_New: Error: %s\n", strerror (errno));
556        return NPERR_GENERIC_ERROR;        return NPERR_GENERIC_ERROR;
557      }      }
     
558    GError *err = NULL;    GError *err = NULL;
559    gchar *command_line [3] = {    gchar *command_line [3] = {
560      GCJAPPLETVIEWER_EXECUTABLE,      GCJAPPLETVIEWER_EXECUTABLE,

Legend:
Removed from v.1.28  
changed lines
  Added in v.1.29

savannah-hackers-public@gnu.org
ViewVC Help
Powered by ViewVC 1.1.26