prototyped edje_part scriptability and outsourced scriptability code to script.c
[mozilla_edje_plugin.git] / src / plugin.h
blob24d2c6d34fdb97350bb498183d37b00d7312a5f9
1 #define TARGET "_blank"
2 #define MIME_TYPES_HANDLED "application/edje:Enlightenment Foundation Libraries (EFL) Edje theme file"
3 #define PLUGIN_NAME "Mozilla Edje Plugin"
4 #define PLUGIN_DESCRIPTION "This Plugin is able to preview Edje files through the evas X11 engines."
6 #include <stdio.h>
7 #include <string.h>
8 #include <pthread.h>
10 #include <npapi.h>
11 #include <npupp.h>
12 #include <npruntime.h>
14 #include <X11/Intrinsic.h>
15 #include <X11/Xlib.h>
17 #include <Ecore.h>
18 #include <Ecore_Config.h>
19 #include <Evas.h>
20 #include <Evas_Engine_Software_X11.h>
21 #include <Evas_Engine_GL_X11.h>
22 #include <Edje.h>
24 typedef struct _PluginInstance
26 uint16 mode;
27 Window window;
28 Display *display;
29 uint32 x, y;
30 uint32 width, height;
31 NPMIMEType type;
32 char *message;
34 NPP instance;
35 char *pluginsPageUrl;
36 char *pluginsFileUrl;
37 NPBool pluginsHidden;
38 Visual* visual;
39 Colormap colormap;
40 unsigned int depth;
42 Atom atom;
43 Evas *evas;
44 char *data;
45 char *group;
46 char *theme;
47 Evas_Object *edj;
48 Evas_Object *skin;
49 XClientMessageEvent msg;
50 pthread_t trigger_id;
51 int done;
53 // config
54 char *config_theme;
55 char *config_engine;
56 int config_fps;
58 // scriptability
59 NPObject *scriptable_object;
61 NPBool exists; /* Does the widget already exist? */
62 int action; /* What action should we take? (GET or REFRESH) */
64 } PluginInstance;
66 void mep_asynccall (void *userData);
67 void mep_configure (PluginInstance *pi);
68 int mep_animator (void *data);
69 void *mep_trigger (void *data);
70 NPObject *mep_getscriptableobject (PluginInstance *pi);
72 void mep_cb_ui_play (void *data, Evas_Object *edj, const char *emission, const char *source);
73 void mep_cb_ui_pause (void *data, Evas_Object *edj, const char *emission, const char *source);
74 void mep_cb_ui_save (void *data, Evas_Object *edj, const char *emission, const char *source);
75 void mep_cb_ui_config (void *data, Evas_Object *edj, const char *emission, const char *source);
76 void mep_cb_all (void *data, Evas_Object *edj, const char *emission, const char *source);
77 void mep_event_handler (Widget xtwidget, void *data, XEvent *xevent, Boolean *b);
80 * scriptability
83 typedef struct _mep_edje_NPObject mep_edje_NPObject;
84 typedef struct _mep_part_NPObject mep_part_NPObject;
86 struct _mep_edje_NPObject {
87 NPClass *_class;
88 uint32_t referenceCount;
89 NPP instance;
92 struct _mep_part_NPObject {
93 NPClass *_class;
94 uint32_t referenceCount;
95 NPP instance;
96 char *part;
99 extern struct NPClass mep_part_class;
100 extern struct NPClass mep_edje_class;