author | Don 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) |
commit | 6fd1026bde72c666fc40dd5ea0d9dbb4f2c1117c (patch) (unidiff) | |
tree | b0d3149ccad552fca152dbfa8b4d329b8caa49df | |
parent | d9809d43889684a88643740214d24bcddf4cbc62 (diff) | |
download | exp005-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.c | 40 |
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" | ||
2 | 3 | ||
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> | ||
6 | 9 | ||
7 | /* | 10 | /* |
8 | * This code is based on the Basic Plugin Example from Mozilla on-line | 11 | * This code is based on the Basic Plugin Example from Mozilla on-line |
9 | * at | 12 | * 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 | */ |
12 | 15 | ||
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; |
24 | 27 | ||
28 | static void* | ||
29 | tool_thread (void *threadid) | ||
30 | { | ||
31 | view (); | ||
32 | glutMainLoop (); | ||
33 | |||
34 | return (void*) 0; | ||
35 | } | ||
36 | |||
25 | static void | 37 | static void |
26 | fillPluginFunctionTable (NPPluginFuncs* pFuncs) | 38 | fillPluginFunctionTable (NPPluginFuncs* pFuncs) |
27 | { | 39 | { |
@@ -44,9 +56,14 @@ fillPluginFunctionTable (NPPluginFuncs* pFuncs) | |||
44 | return; | 56 | return; |
45 | } | 57 | } |
46 | 58 | ||
47 | NP_EXPORT(NPError) | 59 | NPError |
48 | NP_Initialize(NPNetscapeFuncs* bFuncs, NPPluginFuncs* pFuncs) | 60 | NP_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; |
51 | 68 | ||
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 | } |
56 | 73 | ||
57 | NP_EXPORT(char*) | 74 | char* |
58 | NP_GetPluginVersion() | 75 | NP_GetPluginVersion() |
59 | { | 76 | { |
60 | return PLUGIN_VERSION; | 77 | return PLUGIN_VERSION; |
61 | } | 78 | } |
62 | 79 | ||
63 | NP_EXPORT(char*) | 80 | char* |
64 | NP_GetMIMEDescription() | 81 | NP_GetMIMEDescription() |
65 | { | 82 | { |
66 | return "application/x-flumap::Visualization Tool"; | 83 | return "application/x-donpellegrino-flumap::Visualization Tool"; |
67 | } | 84 | } |
68 | 85 | ||
69 | NP_EXPORT(NPError) | 86 | NPError |
70 | NP_GetValue(void* future, NPPVariable aVariable, void* aValue) | 87 | NP_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 | } |
87 | 104 | ||
88 | NP_EXPORT(NPError) | 105 | NPError |
89 | NP_Shutdown() | 106 | NP_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; |
177 | 201 | ||
178 | printf ("In NPP_HandleEvent for the plugin.\n"); | ||
179 | |||
180 | return 1; | 202 | return 1; |
181 | } | 203 | } |
182 | 204 | ||