4 * Implementations of plugin API functions
8 mep_asynccall (void *data
)
10 PluginInstance
*pi
= (PluginInstance
*) data
;
11 ecore_main_loop_iterate ();
14 usleep (1000); // max 100 fps
15 NPN_PluginThreadAsyncCall (pi
->instance
, mep_asynccall
, (void *) pi
);
20 mep_animator (void *data
)
22 PluginInstance
*pi
= (PluginInstance
*) data
;
23 evas_render (pi
->evas
);
24 /* needed for windowless mode
30 NPN_InvalidateRect (pi->instance, &rect);
32 NPN_ForceRedraw (pi->instance);
39 mep_event_handler (Widget xtwidget
, void *data
, XEvent
*xevent
, Boolean
*b
)
41 PluginInstance
*pi
= (PluginInstance
*) data
;
42 Evas
*evas
= pi
->evas
;
45 //printf ("event type: %d\n", ev.type);
50 evas_event_feed_mouse_move(evas
, ev
.xbutton
.x
, ev
.xbutton
.y
, 0, NULL
);
51 evas_event_feed_mouse_down(evas
, ev
.xbutton
.button
, EVAS_BUTTON_NONE
, 0, NULL
);
54 evas_event_feed_mouse_move(evas
, ev
.xbutton
.x
, ev
.xbutton
.y
, 0, NULL
);
55 evas_event_feed_mouse_up(evas
, ev
.xbutton
.button
, EVAS_BUTTON_NONE
, 0, NULL
);
58 evas_event_feed_mouse_move(evas
, ev
.xmotion
.x
, ev
.xmotion
.y
, 0, NULL
);
61 evas_damage_rectangle_add(evas
,
68 evas_output_size_set(evas
,
70 ev
.xconfigure
.height
);
73 evas_object_focus_set (pi
->edj
, 1);
77 evas_object_focus_set (pi
->edj
, 0);
80 case ClientMessage
: // 33
81 if (ev
.xclient
.message_type
== pi
->atom
)
82 ecore_main_loop_iterate ();
90 mep_getscriptableobject (PluginInstance
*pi
)
92 if (!pi
->scriptable_object
)
94 pi
->scriptable_object
= NPN_CreateObject (
99 if (pi
->scriptable_object
)
101 NPN_RetainObject (pi
->scriptable_object
);
104 return pi
->scriptable_object
;
108 mep_cb_ui_play (void *data
, Evas_Object
*edj
, const char *emission
, const char *source
)
110 PluginInstance
*pi
= (PluginInstance
*) data
;
111 if (!edje_object_play_get (pi
->edj
)) // if paused
113 edje_object_play_set (pi
->edj
, 1);
114 //edje_object_animation_set (pi->edj, 1);
119 mep_cb_ui_pause (void *data
, Evas_Object
*edj
, const char *emission
, const char *source
)
121 PluginInstance
*pi
= (PluginInstance
*) data
;
122 if (edje_object_play_get (pi
->edj
)) // if playing
124 edje_object_play_set (pi
->edj
, 0);
125 //edje_object_animation_set (pi->edj, 0);
130 mep_cb_ui_save (void *data
, Evas_Object
*edj
, const char *emission
, const char *source
)
132 PluginInstance
*pi
= (PluginInstance
*) data
;
133 NPN_GetURL (pi
->instance
, pi
->data
, "_parent");
137 mep_cb_ui_config (void *data
, Evas_Object
*edj
, const char *emission
, const char *source
)
139 PluginInstance
*pi
= (PluginInstance
*) data
;
144 mep_cb_all (void *data
, Evas_Object
*edj
, const char *emission
, const char *source
)
146 printf ("edje callback: %s %s\n", emission
, source
);
150 mep_configure (PluginInstance
*pi
)
152 char config_path
[256];
153 sprintf (config_path
, "%s/%s", CONFIGDIR
, "config.edb");
154 ecore_config_file_load (config_path
);
155 pi
->config_theme
= strdup (ecore_config_theme_get ("theme"));
156 pi
->config_engine
= strdup (ecore_config_string_get ("engine"));
157 pi
->config_fps
= ecore_config_int_get ("fps");