summaryrefslogtreecommitdiffstats
authorDon Pellegrino <don@coffee.donpellegrino.com>2009-12-04 15:00:22 (GMT)
committer Don Pellegrino <don@coffee.donpellegrino.com>2009-12-04 15:00:22 (GMT)
commit6fd1026bde72c666fc40dd5ea0d9dbb4f2c1117c (patch) (unidiff)
treeb0d3149ccad552fca152dbfa8b4d329b8caa49df
parentd9809d43889684a88643740214d24bcddf4cbc62 (diff)
downloadexp005-6fd1026bde72c666fc40dd5ea0d9dbb4f2c1117c.zip
exp005-6fd1026bde72c666fc40dd5ea0d9dbb4f2c1117c.tar.gz
exp005-6fd1026bde72c666fc40dd5ea0d9dbb4f2c1117c.tar.bz2
Removed NP_EXPORT references as it seems to be no longer defined.
-rw-r--r--src/plugin/plugin.c40
1 files changed, 31 insertions, 9 deletions
diff --git a/src/plugin/plugin.c b/src/plugin/plugin.c
index 300e2f3..ac8db93 100644
--- a/src/plugin/plugin.c
+++ b/src/plugin/plugin.c
@@ -1,13 +1,16 @@
1#include "plugin.h"1#include "plugin.h"
2#include "../view/view.h"
23
3#include <stdlib.h>4#include <stdlib.h>
4#include <string.h>5#include <string.h>
5#include <stdio.h>6#include <stdio.h>
7#include <pthread.h>
8#include <GL/glut.h>
69
7/*10/*
8 * This code is based on the Basic Plugin Example from Mozilla on-line11 * This code is based on the Basic Plugin Example from Mozilla on-line
9 * at12 * at
10 * http://mxr.mozilla.org/mozilla-central/source/modules/plugin/sdk/samples/basic/unix/BasicPlugin.c.13 * http://mxr.mozilla.org/mozilla-central/source/modules/plugin/sdk/samples/basic/unix/BasicPlugin.c
11 */14 */
1215
13#define PLUGIN_NAME "Influenza Sequence Mapping Project Visualization Tool"16#define PLUGIN_NAME "Influenza Sequence Mapping Project Visualization Tool"
@@ -22,6 +25,15 @@ typedef struct InstanceData
22 NPWindow window;25 NPWindow window;
23} InstanceData;26} InstanceData;
2427
28static void*
29tool_thread (void *threadid)
30{
31 view ();
32 glutMainLoop ();
33
34 return (void*) 0;
35}
36
25static void37static void
26fillPluginFunctionTable (NPPluginFuncs* pFuncs)38fillPluginFunctionTable (NPPluginFuncs* pFuncs)
27{39{
@@ -44,9 +56,14 @@ fillPluginFunctionTable (NPPluginFuncs* pFuncs)
44 return;56 return;
45}57}
4658
47NP_EXPORT(NPError)59NPError
48NP_Initialize(NPNetscapeFuncs* bFuncs, NPPluginFuncs* pFuncs)60NP_Initialize(NPNetscapeFuncs* bFuncs, NPPluginFuncs* pFuncs)
49{61{
62 int argc = 1;
63 char *argv[] = {"MyApp", NULL};
64 glutInit (&argc, argv);
65 glutInitDisplayMode (GLUT_DOUBLE | GLUT_RGB | GLUT_DEPTH);
66
50 sBrowserFuncs = bFuncs;67 sBrowserFuncs = bFuncs;
5168
52 fillPluginFunctionTable(pFuncs);69 fillPluginFunctionTable(pFuncs);
@@ -54,19 +71,19 @@ NP_Initialize(NPNetscapeFuncs* bFuncs, NPPluginFuncs* pFuncs)
54 return NPERR_NO_ERROR;71 return NPERR_NO_ERROR;
55}72}
5673
57NP_EXPORT(char*)74char*
58NP_GetPluginVersion()75NP_GetPluginVersion()
59{76{
60 return PLUGIN_VERSION;77 return PLUGIN_VERSION;
61}78}
6279
63NP_EXPORT(char*)80char*
64NP_GetMIMEDescription()81NP_GetMIMEDescription()
65{82{
66 return "application/x-flumap::Visualization Tool";83 return "application/x-donpellegrino-flumap::Visualization Tool";
67}84}
6885
69NP_EXPORT(NPError)86NPError
70NP_GetValue(void* future, NPPVariable aVariable, void* aValue)87NP_GetValue(void* future, NPPVariable aVariable, void* aValue)
71{88{
72 switch (aVariable) 89 switch (aVariable)
@@ -85,7 +102,7 @@ NP_GetValue(void* future, NPPVariable aVariable, void* aValue)
85 return NPERR_NO_ERROR;102 return NPERR_NO_ERROR;
86}103}
87104
88NP_EXPORT(NPError)105NPError
89NP_Shutdown()106NP_Shutdown()
90{107{
91 return NPERR_NO_ERROR;108 return NPERR_NO_ERROR;
@@ -111,6 +128,13 @@ NPP_New(NPMIMEType pluginType, NPP instance, uint16_t mode, int16_t argc, char*
111 memset(instanceData, 0, sizeof(InstanceData));128 memset(instanceData, 0, sizeof(InstanceData));
112 instanceData->npp = instance;129 instanceData->npp = instance;
113 instance->pdata = instanceData;130 instance->pdata = instanceData;
131
132 pthread_t threads;
133 static long tid = 0;
134 tid++;
135 pthread_create (&threads, NULL,
136 tool_thread,
137 (void*)tid);
114 138
115 return NPERR_NO_ERROR;139 return NPERR_NO_ERROR;
116}140}
@@ -175,8 +199,6 @@ NPP_HandleEvent(NPP instance, void* event)
175 // if (nativeEvent->type != GraphicsExpose)199 // if (nativeEvent->type != GraphicsExpose)
176 //return 0;200 //return 0;
177201
178 printf ("In NPP_HandleEvent for the plugin.\n");
179
180 return 1;202 return 1;
181}203}
182204

Valid XHTML 1.0 Strict

Copyright © 2009 Don Pellegrino All Rights Reserved.