summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorzmike <michael.blumenkrantz@gmail.com>2014-10-07 19:14:35 -0400
committerzmike <michael.blumenkrantz@gmail.com>2014-10-07 19:14:35 -0400
commit0b79643465c0a984ea93fb888fe5c853dbc01181 (patch)
tree9905c01cf6fbf75aa67e765d937b41b5ca8f6cb6 /src
parentfc5bf9988eeed8f382f520867d80847f6efa6dd6 (diff)
merge in a version of mpdule: attempt #1
Diffstat (limited to 'src')
-rw-r--r--src/enlightenment/AUTHORS3
-rw-r--r--src/enlightenment/Makefile.mk33
-rw-r--r--src/enlightenment/e-module-empdule.edc32
-rw-r--r--src/enlightenment/e_mod_config.c128
-rw-r--r--src/enlightenment/e_mod_main.c656
-rw-r--r--src/enlightenment/e_mod_main.h41
-rw-r--r--src/enlightenment/empdule.edc885
-rw-r--r--src/enlightenment/images/module_icon.pngbin0 -> 3584 bytes
-rw-r--r--src/enlightenment/images/next.pngbin0 -> 10127 bytes
-rw-r--r--src/enlightenment/images/pause.pngbin0 -> 9475 bytes
-rw-r--r--src/enlightenment/images/play.pngbin0 -> 9800 bytes
-rw-r--r--src/enlightenment/images/prev.pngbin0 -> 10215 bytes
-rw-r--r--src/enlightenment/images/stop.pngbin0 -> 9218 bytes
-rw-r--r--src/enlightenment/module.desktop.in33
14 files changed, 1811 insertions, 0 deletions
diff --git a/src/enlightenment/AUTHORS b/src/enlightenment/AUTHORS
new file mode 100644
index 0000000..bedd340
--- /dev/null
+++ b/src/enlightenment/AUTHORS
@@ -0,0 +1,3 @@
1iamsthitha
2Boris Faure <billiob@gmail.com>
3Mike Blumenkrantz <zmike@enlightenment.org>
diff --git a/src/enlightenment/Makefile.mk b/src/enlightenment/Makefile.mk
new file mode 100644
index 0000000..71fc9c1
--- /dev/null
+++ b/src/enlightenment/Makefile.mk
@@ -0,0 +1,33 @@
1EXTRA_DIST += \
2src/enlightenment/module.desktop.in \
3src/enlightenment/e-module-empdule.edc \
4src/enlightenment/empdule.edc \
5$(wildcard src/enlightenment/images/*.png)
6
7
8if MPDULE
9pkgdir = $(datadir)/$(MODULE_ARCH)
10pkg_LTLIBRARIES = src/enlightenment/module.la
11
12src_enlightenment_module_la_SOURCES = \
13src/enlightenment/e_mod_main.c \
14src/enlightenment/e_mod_main.h \
15src/enlightenment/e_mod_config.c
16
17src_enlightenment_module_la_LIBADD = @E_LIBS@
18src_enlightenment_module_la_LDFLAGS = -module -avoid-version
19
20filesdir = $(datadir)
21files_DATA = \
22src/enlightenment/e-module-empdule.edj
23src/enlightenment/module.desktop
24src/enlightenment/empdule.edj
25
26
27E_EDJE_FLAGS = -v \
28 -id $(top_srcdir)/src/enlightenment/images
29
30src/enlightenment/%.edj: src/enlightenment/%.edc
31 @EDJE_CC@ $(E_EDJE_FLAGS) $< $@
32
33endif
diff --git a/src/enlightenment/e-module-empdule.edc b/src/enlightenment/e-module-empdule.edc
new file mode 100644
index 0000000..6de0ae4
--- /dev/null
+++ b/src/enlightenment/e-module-empdule.edc
@@ -0,0 +1,32 @@
1images {
2 image: "module_icon.png" COMP;
3}
4collections {
5 group {
6 name: "icon";
7 max: 48 48;
8 parts {
9 part {
10 name: "image";
11 type: IMAGE;
12 mouse_events: 0;
13 description {
14 state: "default" 0.00;
15 visible: 1;
16 aspect: 1.00 1.00;
17 rel1 {
18 relative: 0.00 0.00;
19 offset: 0 0;
20 }
21 rel2 {
22 relative: 1.00 1.00;
23 offset: -1 -1;
24 }
25 image {
26 normal: "module_icon.png";
27 }
28 }
29 }
30 }
31 }
32}
diff --git a/src/enlightenment/e_mod_config.c b/src/enlightenment/e_mod_config.c
new file mode 100644
index 0000000..dfd916b
--- /dev/null
+++ b/src/enlightenment/e_mod_config.c
@@ -0,0 +1,128 @@
1#include <e.h>
2#include "e_mod_main.h"
3
4struct _E_Config_Dialog_Data
5{
6 int poll_time;
7 char *hostname;
8 char *port;
9 int show_popup;
10};
11
12/* Protos */
13static void *_create_data (E_Config_Dialog * cfd);
14static void _free_data (E_Config_Dialog * cfd, E_Config_Dialog_Data * cfdata);
15static Evas_Object *_basic_create_widgets (E_Config_Dialog * cfd, Evas * evas,
16 E_Config_Dialog_Data * cfdata);
17static int _basic_apply_data (E_Config_Dialog * cfd,
18 E_Config_Dialog_Data * cfdata);
19
20void
21_config_mpdule_module (Config_Item * ci)
22{
23 E_Config_Dialog *cfd;
24 E_Config_Dialog_View *v;
25 E_Comp *con;
26 char buf[4096];
27
28 v = E_NEW (E_Config_Dialog_View, 1);
29
30 v->create_cfdata = _create_data;
31 v->free_cfdata = _free_data;
32 v->basic.apply_cfdata = _basic_apply_data;
33 v->basic.create_widgets = _basic_create_widgets;
34
35 snprintf (buf, sizeof (buf), "%s/e-module-mpdule.edj",
36 e_module_dir_get (mpdule_config->module));
37 cfd =
38 e_config_dialog_new (NULL, D_ ("MPDule Configuration"), "MPDule",
39 "_e_modules_mpdule_config_dialog", buf, 0, v, ci);
40 mpdule_config->config_dialog = cfd;
41}
42
43static void
44_fill_data (Config_Item * ci, E_Config_Dialog_Data * cfdata)
45{
46 char buf[128];
47
48 cfdata->poll_time = ci->poll_time;
49 cfdata->hostname = strdup (ci->hostname);
50 snprintf (buf, sizeof (buf), "%d", ci->port);
51 cfdata->port = strdup (buf);
52 cfdata->show_popup = ci->show_popup;
53}
54
55static void *
56_create_data (E_Config_Dialog * cfd)
57{
58 E_Config_Dialog_Data *cfdata;
59 Config_Item *ci;
60
61 ci = cfd->data;
62 cfdata = E_NEW (E_Config_Dialog_Data, 1);
63
64 _fill_data (ci, cfdata);
65 return cfdata;
66}
67
68static void
69_free_data (E_Config_Dialog * cfd, E_Config_Dialog_Data * cfdata)
70{
71 if (!mpdule_config)
72 return;
73 mpdule_config->config_dialog = NULL;
74 free (cfdata->hostname);
75 E_FREE (cfdata);
76}
77
78static Evas_Object *
79_basic_create_widgets (E_Config_Dialog * cfd, Evas * evas,
80 E_Config_Dialog_Data * cfdata)
81{
82 Evas_Object *o, *of, *ob, *hostname_entry, *port_entry;
83
84 o = e_widget_list_add (evas, 0, 0);
85
86 of = e_widget_frametable_add (evas, D_ ("Configuration"), 1);
87 ob = e_widget_label_add (evas, D_ ("Poll Time:"));
88 e_widget_frametable_object_append (of, ob, 0, 0, 1, 1, 1, 0, 1, 0);
89 ob =
90 e_widget_slider_add (evas, 1, 0, D_ ("%1.0f seconds"), 1, 60, 1, 0, NULL,
91 &(cfdata->poll_time), 100);
92 e_widget_frametable_object_append (of, ob, 0, 1, 1, 1, 1, 0, 1, 0);
93 ob = e_widget_label_add (evas, D_ ("Hostname:"));
94 e_widget_frametable_object_append (of, ob, 0, 2, 1, 1, 1, 0, 1, 0);
95 hostname_entry =
96 e_widget_entry_add (evas, &cfdata->hostname, NULL, NULL, NULL);
97 e_widget_size_min_set (hostname_entry, 150, 20);
98 e_widget_frametable_object_append (of, hostname_entry, 0, 3, 1, 1, 1, 0, 1,
99 0);
100 ob = e_widget_label_add (evas, D_ ("Port:"));
101 e_widget_frametable_object_append (of, ob, 0, 4, 1, 1, 1, 0, 1, 0);
102 port_entry = e_widget_entry_add (evas, &cfdata->port, NULL, NULL, NULL);
103 e_widget_size_min_set (hostname_entry, 150, 20);
104 e_widget_frametable_object_append (of, port_entry, 0, 5, 1, 1, 1, 0, 1, 0);
105 ob = e_widget_check_add(evas, D_("Show Popup"), &(cfdata->show_popup));
106 e_widget_frametable_object_append(of, ob, 0, 6, 1, 1, 1, 0, 1, 0);
107
108 e_widget_list_object_append (o, of, 1, 1, 0.5);
109
110 return o;
111}
112
113static int
114_basic_apply_data (E_Config_Dialog * cfd, E_Config_Dialog_Data * cfdata)
115{
116 Config_Item *ci;
117
118 ci = cfd->data;
119 ci->poll_time = cfdata->poll_time;
120 if (ci->hostname)
121 eina_stringshare_del (ci->hostname);
122 ci->hostname = eina_stringshare_add (cfdata->hostname);
123 ci->port = atoi (cfdata->port);
124 ci->show_popup = cfdata->show_popup;
125 e_config_save_queue ();
126 _mpdule_config_updated (ci);
127 return 1;
128}
diff --git a/src/enlightenment/e_mod_main.c b/src/enlightenment/e_mod_main.c
new file mode 100644
index 0000000..7956449
--- /dev/null
+++ b/src/enlightenment/e_mod_main.c
@@ -0,0 +1,656 @@
1#include <e.h>
2#include "e_mod_main.h"
3#if TIME_WITH_SYS_TIME
4# include <sys/time.h>
5# include <time.h>
6#else
7# if HAVE_SYS_TIME_H
8# include <sys/time.h>
9# else
10# include <time.h>
11# endif
12#endif
13#include "empdd.h"
14#include "eldbus_empd_empdd.h"
15#include "eldbus_empd_empc.h"
16
17/* Func Proto Requirements for Gadcon */
18static E_Gadcon_Client *_gc_init(E_Gadcon *gc, const char *name,
19 const char *id, const char *style);
20static void _gc_shutdown(E_Gadcon_Client *gcc);
21static void _gc_orient(E_Gadcon_Client *gcc, E_Gadcon_Orient orient);
22static const char *_gc_label(const E_Gadcon_Client_Class *client_class);
23static Evas_Object *_gc_icon(const E_Gadcon_Client_Class *client_class, Evas *evas);
24static const char *_gc_id_new(const E_Gadcon_Client_Class *client_class);
25
26/* Module Protos */
27static void _mpdule_cb_mouse_down(void *data, Evas *e, Evas_Object *obj,
28 void *event_info);
29static void _mpdule_cb_mouse_in(void *data, Evas *e, Evas_Object *obj,
30 void *event_info);
31static void _mpdule_cb_mouse_out(void *data, Evas *e, Evas_Object *obj,
32 void *event_info);
33static void _mpdule_menu_cb_configure(void *data, E_Menu *m,
34 E_Menu_Item *mi);
35static void _mpdule_menu_cb_post(void *data, E_Menu *m);
36static void _mpdule_cb_play(void *data, Evas_Object *obj,
37 const char *emission, const char *source);
38static void _mpdule_cb_stop(void *data, Evas_Object *obj,
39 const char *emission, const char *source);
40static void _mpdule_cb_pause(void *data, Evas_Object *obj,
41 const char *emission, const char *source);
42static void _mpdule_cb_next(void *data, Evas_Object *obj,
43 const char *emission, const char *source);
44static void _mpdule_cb_previous(void *data, Evas_Object *obj,
45 const char *emission, const char *source);
46static Config_Item *_mpdule_config_item_get(const char *id);
47
48static E_Config_DD *conf_edd = NULL;
49static E_Config_DD *conf_item_edd = NULL;
50
51Config *mpdule_config = NULL;
52
53enum
54{
55 MPD_STATE_UNKNOWN = 0,
56 MPD_STATE_STOP = 1,
57 MPD_STATE_PLAY = 2,
58 MPD_STATE_PAUSE = 3,
59};
60
61EAPI E_Module_Api e_modapi =
62{
63 E_MODULE_API_VERSION,
64 "eMPDule"
65};
66
67/* Define the class and gadcon functions this module provides */
68static const E_Gadcon_Client_Class _gc_class = {
69 GADCON_CLIENT_CLASS_VERSION,
70 "empdule", {_gc_init, _gc_shutdown, _gc_orient, _gc_label, _gc_icon,
71 _gc_id_new, NULL, e_gadcon_site_is_not_toolbar},
72 E_GADCON_CLIENT_STYLE_PLAIN
73};
74
75typedef struct _Instance Instance;
76struct _Instance
77{
78 E_Gadcon_Client *gcc;
79 Evas_Object *empdule;
80 Evas_Object *o_popup;
81 Config_Item *ci;
82 E_Gadcon_Popup *popup;
83 Eina_Bool popup_creation_in_progress;
84};
85
86static Eina_List *handlers = NULL;
87static Eldbus_Connection *empd_conn = NULL;
88static Eldbus_Proxy *empd_proxy = NULL;
89
90static Eina_Bool empd_connected = EINA_FALSE;
91static Eina_Stringshare *empd_uri;
92static uint64_t empd_last_modified;
93static unsigned int empd_duration;
94static Eina_Stringshare *empd_artist;
95static Eina_Stringshare *empd_title;
96static Eina_Stringshare *empd_album;
97static int empd_track;
98static Eina_Stringshare *empd_name;
99static Eina_Stringshare *empd_date;
100static Eina_Stringshare *empd_disc;
101static int empd_song_pos;
102static int empd_songid;
103static int empd_state = -1;;
104
105static void _mpdule_connect(Instance *inst);
106static void _mpdule_popup_destroy(Instance *inst);
107
108static void
109_mpdule_status_update(Instance *inst)
110{
111 const char *status = NULL;
112
113 switch (empd_state)
114 {
115 case MPD_STATE_UNKNOWN:
116 status = D_("Unknown");
117 break;
118 case MPD_STATE_STOP:
119 status = D_("Stopped");
120 break;
121 case MPD_STATE_PLAY:
122 status = D_("Playing");
123 break;
124 case MPD_STATE_PAUSE:
125 status = D_("Paused");
126 break;
127 }
128
129 edje_object_part_text_set(inst->empdule, "empdule.status", status);
130 edje_object_part_text_set(inst->o_popup, "empdule.status", status);
131}
132
133static void
134_mpdule_info_update(Instance *inst)
135{
136 char buf[128];
137 Evas_Object *empdule, *o_popup;
138
139 snprintf(buf, sizeof(buf), "%d", empd_track);
140
141#define FILL_IN(_var) \
142 edje_object_part_text_set(inst->empdule, "empdule."#_var, empd_##_var ?: "");
143 edje_object_part_text_set(inst->o_popup, "empdule."#_var, empd_##_var ?: "");
144
145 FILL_IN(artist);
146 FILL_IN(title);
147 FILL_IN(album);
148 FILL_IN(date);
149 FILL_IN(genre);
150 FILL_IN(composer);
151 FILL_IN(uri);
152
153 edje_object_part_text_set(empdule, "empdule.track", buf);
154 edje_object_part_text_set(o_popup, "empdule.track", buf);
155#undef FILL_IN
156}
157
158static void
159_mpdule_popup_create(Instance *inst)
160{
161 if (inst->popup)
162 return;
163
164 if (inst->ci->show_popup)
165 {
166 Evas *evas;
167 Evas_Object *o_popup;
168
169 if (inst->popup_creation_in_progress)
170 return;
171 inst->popup_creation_in_progress = EINA_TRUE;
172
173 inst->popup = e_gadcon_popup_new(inst->gcc, EINA_FALSE);
174 evas = e_comp_get(inst->popup)->evas;
175 o_popup = edje_object_add(evas);
176 if (!e_theme_edje_object_set
177 (o_popup, "base/theme/modules/empdule", "modules/empdule/popup"))
178 {
179 char buf[4096];
180
181 snprintf(buf, sizeof(buf), "%s/empdule.edj",
182 e_module_dir_get(mpdule_config->module));
183 edje_object_file_set(o_popup, buf, "modules/empdule/popup");
184 }
185 edje_object_part_text_set(o_popup, "empdule.artist_label", D_("Artist:"));
186 edje_object_part_text_set(o_popup, "empdule.title_label", D_("Title:"));
187 edje_object_part_text_set(o_popup, "empdule.album_label", D_("Album:"));
188 edje_object_part_text_set(o_popup, "empdule.genre_label", D_("Genre:"));
189 e_gadcon_popup_content_set(inst->popup, o_popup);
190 e_gadcon_popup_show(inst->popup);
191 edje_object_size_min_calc(o_popup, NULL, NULL);
192 inst->o_popup = o_popup;
193 edje_object_signal_callback_add(o_popup, "empdule,play", "",
194 _mpdule_cb_play, inst);
195 edje_object_signal_callback_add(o_popup, "empdule,stop", "",
196 _mpdule_cb_stop, inst);
197 edje_object_signal_callback_add(o_popup, "empdule,pause", "",
198 _mpdule_cb_pause, inst);
199 edje_object_signal_callback_add(o_popup, "empdule,next", "",
200 _mpdule_cb_next, inst);
201 edje_object_signal_callback_add(o_popup, "empdule,previous", "",
202 _mpdule_cb_previous, inst);
203
204#define DISPLAY_INFO(_var) \
205 if (inst->_var) \
206 { \
207 edje_object_part_text_set(o_popup, "empdule."#_var, \
208 inst->_var); \
209 }
210 DISPLAY_INFO(artist);
211 DISPLAY_INFO(title);
212 DISPLAY_INFO(album);
213 DISPLAY_INFO(track);
214 DISPLAY_INFO(date);
215 DISPLAY_INFO(genre);
216 DISPLAY_INFO(composer);
217 //DISPLAY_INFO(time);
218 DISPLAY_INFO(file);
219#undef DISPLAY_INFO
220
221 inst->popup_creation_in_progress = EINA_FALSE;
222 }
223}
224
225static void
226_mpdule_cb_mouse_down(void *data, Evas *e, Evas_Object *obj,
227 void *event_info)
228{
229 Evas_Event_Mouse_Down *ev = event_info;
230 Instance *inst = data;
231
232 if ((ev->button == 3) && (!mpdule_config->menu))
233 {
234 E_Menu *m;
235 E_Menu_Item *mi;
236 int x, y, w, h;
237
238 m = e_menu_new();
239 mi = e_menu_item_new(m);
240 e_menu_item_label_set(mi, D_("Settings"));
241 e_util_menu_item_theme_icon_set(mi, "preferences-system");
242 e_menu_item_callback_set(mi, _mpdule_menu_cb_configure, inst);
243
244 m = e_gadcon_client_util_menu_items_append(inst->gcc, m, 0);
245 e_menu_post_deactivate_callback_set(m, _mpdule_menu_cb_post, inst);
246 mpdule_config->menu = m;
247
248 e_gadcon_canvas_zone_geometry_get(inst->gcc->gadcon, &x, &y, &w, &h);
249 e_menu_activate_mouse(m,
250 e_util_zone_current_get(e_manager_current_get()),
251 x + ev->output.x,
252 y + ev->output.y, 1, 1,
253 E_MENU_POP_DIRECTION_DOWN, ev->timestamp);
254 evas_event_feed_mouse_up(inst->gcc->gadcon->evas, ev->button,
255 EVAS_BUTTON_NONE, ev->timestamp, NULL);
256 }
257 else if (ev->button == 1)
258 {
259 if (inst->popup) _mpdule_popup_destroy(inst);
260 else _mpdule_popup_create(inst);
261 }
262}
263
264static void
265_mpdule_cb_mouse_in(void *data, Evas *e, Evas_Object *obj,
266 void *event_info)
267{
268 Instance *inst = data;
269
270 if ((!inst) || (!inst->ci->show_popup))
271 return;
272 if (!inst->popup)
273 {
274 _mpdule_popup_create(inst);
275 }
276}
277
278static void
279_mpdule_cb_mouse_out(void *data, Evas *e, Evas_Object *obj,
280 void *event_info)
281{
282 Instance *inst = data;
283
284 if ((!inst) || ((!inst->ci->show_popup) && (!inst->popup)))
285 return;
286 if (inst->popup)
287 {
288 _mpdule_popup_destroy(inst);
289 }
290}
291
292static void
293_mpdule_menu_cb_post(void *data, E_Menu *m)
294{
295 if (!mpdule_config->menu)
296 return;
297 e_object_del(E_OBJECT(mpdule_config->menu));
298 mpdule_config->menu = NULL;
299}
300
301static void
302_mpdule_menu_cb_configure(void *data, E_Menu *m, E_Menu_Item *mi)
303{
304 Instance *inst = data;
305 _config_mpdule_module(inst->ci);
306}
307
308void
309_mpdule_config_updated(Config_Item *ci)
310{
311 Eina_List *l;
312 Instance *inst;
313
314 if (!mpdule_config)
315 return;
316
317 EINA_LIST_FOREACH(mpdule_config->instances, l, inst)
318 {
319 if (inst->ci != ci) continue;
320
321 _mpdule_connect(inst);
322 _mpdule_popup_destroy(inst);
323 _mpdule_status_update(inst);
324 break;
325 }
326}
327
328static void
329_mpdule_cb_play()
330{
331 empd_empdd_play_call(empd_proxy);
332}
333
334static void
335_mpdule_cb_previous()
336{
337 empd_empdd_previous_call(empd_proxy);
338}
339
340static void
341_mpdule_cb_next()
342{
343 empd_empdd_next_call(empd_proxy);
344}
345
346static void
347_mpdule_cb_stop()
348{
349 empd_empdd_next_call(empd_proxy);
350}
351
352static void
353_mpdule_cb_pause()
354{
355 empd_empdd_toggle_pause_call(empd_proxy);
356}
357
358static Config_Item *
359_mpdule_config_item_get(const char *id)
360{
361 Config_Item *ci;
362
363 GADCON_CLIENT_CONFIG_GET(Config_Item, mpdule_config->items, _gc_class, id);
364
365 ci = E_NEW(Config_Item, 1);
366 ci->id = eina_stringshare_add(id);
367 ci->port = -1;
368 ci->show_popup = 1;
369
370 mpdule_config->items = eina_list_append(mpdule_config->items, ci);
371 return ci;
372}
373
374static void
375_mpdule_connect(Instance *inst)
376{
377 empd_empdd_connect_call(empd_proxy, inst->ci->hostname, inst->ci->port, NULL); //FIXME password
378}
379
380static void
381empd_isconnected_cb(Eldbus_Proxy *proxy EINA_UNUSED, void *data EINA_UNUSED, Eldbus_Pending *pending EINA_UNUSED, Eldbus_Error_Info *error EINA_UNUSED, Eina_Bool connected, const char *host, unsigned int port)
382{
383 empd_connected = connected;
384 if (connected)
385 empd_empdd_current_song_call(empd_proxy);
386}
387
388static Eina_Bool
389empd_status(void *d EINA_UNUSED, int t EINA_UNUSED, Empd_Empdd_Status_Data *ev)
390{
391 if (empd_state == ev->state) return ECORE_CALLBACK_RENEW;
392
393 empd_state = ev->state;
394 E_LIST_FOREACH(mpdule_config->instances, _mpdule_status_update);
395 return ECORE_CALLBACK_RENEW;
396}
397
398static Eina_Bool
399empd_current_song(void *d EINA_UNUSED, int t EINA_UNUSED, Empd_Empdd_CurrentSong_Data *ev)
400{
401#define COPY(X) \
402 eina_stringshare_replace(&empd_##X, ev->X)
403
404 COPY(artist);
405 COPY(title);
406 COPY(album);
407 COPY(date);
408 COPY(genre);
409 COPY(composer);
410 COPY(uri);
411
412 empd_duration = ev->duration;
413 empd_track = ev->track;
414 empd_song_pos = ev->song_pos;
415
416 E_LIST_FOREACH(mpdule_config->instances, _mpdule_info_update);
417
418 return ECORE_CALLBACK_RENEW;
419}
420
421static Eina_Bool
422empd_connected_event(void *d EINA_UNUSED, int t EINA_UNUSED, Empd_Empdd_Connected_Data *ev)
423{
424 empd_connected = EINA_TRUE;
425 return ECORE_CALLBACK_RENEW;
426}
427
428static Eina_Bool
429empd_disconnected_event(void *d EINA_UNUSED, int t EINA_UNUSED, Empd_Empdd_Disconnected_Data *ev)
430{
431 empd_connected = EINA_FALSE;
432 return ECORE_CALLBACK_RENEW;
433}
434
435EAPI void *
436e_modapi_init(E_Module *m)
437{
438 char buf[4096];
439
440 snprintf(buf, sizeof(buf), "%s/locale", e_module_dir_get(m));
441 bindtextdomain(PACKAGE, buf);
442 bind_textdomain_codeset(PACKAGE, "UTF-8");
443
444 conf_item_edd = E_CONFIG_DD_NEW("MPDule_Config_Item", Config_Item);
445#undef T
446#undef D
447#define T Config_Item
448#define D conf_item_edd
449 E_CONFIG_VAL(D, T, id, STR);
450 E_CONFIG_VAL(D, T, hostname, STR);
451 E_CONFIG_VAL(D, T, port, INT);
452 E_CONFIG_VAL(D, T, show_popup, UCHAR);
453
454 conf_edd = E_CONFIG_DD_NEW("MPDule_Config", Config);
455#undef T
456#undef D
457#define T Config
458#define D conf_edd
459 E_CONFIG_LIST(D, T, items, conf_item_edd);
460
461 mpdule_config = e_config_domain_load("module.empdule", conf_edd);
462 if (!mpdule_config)
463 {
464 Config_Item *ci;
465
466 mpdule_config = E_NEW(Config, 1);
467
468 ci = E_NEW(Config_Item, 1);
469 ci->id = eina_stringshare_add("0");
470 ci->port = -1;
471 ci->show_popup = 1;
472
473 mpdule_config->items = eina_list_append(mpdule_config->items, ci);
474 }
475 mpdule_config->module = m;
476
477 e_gadcon_provider_register(&_gc_class);
478 empd_conn = eldbus_connection_get(ELDBUS_CONNECTION_TYPE_SESSION);
479 empd_proxy = empd_empdd_proxy_get(empd_conn, EMPDD_METHOD_BASE, NULL);
480 empd_empdd_is_connected_call(empd_proxy, _mpdule_cb_connected, NULL);
481 E_LIST_HANDLER_APPEND(handlers, EMPD_EMPDD_CONNECTED_EVENT, empd_connected_event, NULL);
482 E_LIST_HANDLER_APPEND(handlers, EMPD_EMPDD_DISCONNECTED_EVENT, empd_disconnected_event, NULL);
483 E_LIST_HANDLER_APPEND(handlers, EMPD_EMPDD_STATUS_EVENT, empd_status, NULL);
484 E_LIST_HANDLER_APPEND(handlers, EMPD_EMPDD_CURRENT_SONG_EVENT, empd_current_song, NULL);
485 return m;
486}
487
488EAPI int
489e_modapi_shutdown(E_Module *m)
490{
491 Config_Item *ci;
492
493 mpdule_config->module = NULL;
494 e_gadcon_provider_unregister(&_gc_class);
495
496 E_FREE_FUNC(mpdule_config->config_dialog, e_object_del);
497 if (mpdule_config->menu)
498 {
499 e_menu_post_deactivate_callback_set(mpdule_config->menu, NULL, NULL);
500 E_FREE_FUNC(mpdule_config->menu, e_object_del);
501 }
502
503 EINA_LIST_FREE(mpdule_config->items, ci)
504 {
505 eina_stringshare_del(ci->id);
506 free(ci);
507 }
508 empd_empdd_proxy_unref(empd_proxy);
509 eldbus_connection_unref(empd_conn);
510 E_FREE_LIST(handlers, ecore_event_handler_del);
511
512 E_FREE(mpdule_config);
513 E_CONFIG_DD_FREE(conf_item_edd);
514 E_CONFIG_DD_FREE(conf_edd);
515
516 eina_stringshare_replace(&empd_uri, NULL);
517 eina_stringshare_replace(&empd_artist, NULL);
518 eina_stringshare_replace(&empd_title, NULL);
519 eina_stringshare_replace(&empd_album, NULL);
520 eina_stringshare_replace(&empd_name, NULL);
521 eina_stringshare_replace(&empd_date, NULL);
522 eina_stringshare_replace(&empd_disc, NULL);
523 empd_state = -1;
524 return 1;
525}
526
527EAPI int
528e_modapi_save(E_Module *m)
529{
530 e_config_domain_save("module.empdule", conf_edd, mpdule_config);
531 return 1;
532}
533
534static void
535_mpdule_popup_destroy(Instance *inst)
536{
537 if (inst->popup)
538 {
539 E_Gadcon_Popup *popup = inst->popup;
540
541 inst->popup = NULL;
542 inst->o_popup = NULL;
543 e_object_del(E_OBJECT(popup));
544 }
545}
546
547
548static E_Gadcon_Client *
549_gc_init(E_Gadcon *gc, const char *name, const char *id, const char *style)
550{
551 Evas_Object *o;
552 E_Gadcon_Client *gcc;
553 Evas *evas;
554 Instance *inst;
555 char buf[4096];
556
557 inst = E_NEW(Instance, 1);
558
559 inst->ci = _mpdule_config_item_get(id);
560 if (!inst->ci->id)
561 inst->ci->id = eina_stringshare_add(id);
562
563 o = edje_object_add(gc->evas);
564 snprintf(buf, sizeof(buf), "%s/empdule.edj",
565 e_module_dir_get(mpdule_config->module));
566 if (!e_theme_edje_object_set
567 (o, "base/theme/modules/empdule", "modules/empdule/main"))
568 edje_object_file_set(o, buf, "modules/empdule/main");
569 evas_object_show(o);
570
571 gcc = e_gadcon_client_new(gc, name, id, style, o);
572 gcc->data = inst;
573 inst->gcc = gcc;
574 inst->empdule = o;
575
576 evas_object_event_callback_add(o, EVAS_CALLBACK_MOUSE_DOWN,
577 _mpdule_cb_mouse_down, inst);
578 evas_object_event_callback_add(inst->empdule, EVAS_CALLBACK_MOUSE_IN,
579 _mpdule_cb_mouse_in, inst);
580 evas_object_event_callback_add(inst->empdule, EVAS_CALLBACK_MOUSE_OUT,
581 _mpdule_cb_mouse_out, inst);
582 edje_object_signal_callback_add(o, "empdule,play", "", _mpdule_cb_play,
583 inst);
584 edje_object_signal_callback_add(o, "empdule,stop", "", _mpdule_cb_stop,
585 inst);
586 edje_object_signal_callback_add(o, "empdule,pause", "", _mpdule_cb_pause,
587 inst);
588 edje_object_signal_callback_add(o, "empdule,next", "", _mpdule_cb_next,
589 inst);
590 edje_object_signal_callback_add(o, "empdule,previous", "",
591 _mpdule_cb_previous, inst);
592 //_mpdule_connect(inst);
593 if (empd_connected)
594 _mpdule_status_update(inst);
595
596 mpdule_config->instances =
597 eina_list_append(mpdule_config->instances, inst);
598 return gcc;
599}
600
601static void
602_gc_shutdown(E_Gadcon_Client *gcc)
603{
604 Instance *inst;
605
606 inst = gcc->data;
607 mpdule_config->instances =
608 eina_list_remove(mpdule_config->instances, inst);
609
610 evas_object_event_callback_del(inst->empdule, EVAS_CALLBACK_MOUSE_DOWN,
611 _mpdule_cb_mouse_down);
612 evas_object_event_callback_del(inst->empdule, EVAS_CALLBACK_MOUSE_IN,
613 _mpdule_cb_mouse_in);
614 evas_object_event_callback_del(inst->empdule, EVAS_CALLBACK_MOUSE_OUT,
615 _mpdule_cb_mouse_out);
616 _mpdule_popup_destroy(inst);
617 evas_object_del(inst->empdule);
618 gcc->data = NULL;
619}
620
621static void
622_gc_orient(E_Gadcon_Client *gcc, E_Gadcon_Orient orient)
623{
624 Instance *inst;
625 Evas_Coord mw, mh;
626
627 inst = gcc->data;
628 edje_object_size_min_calc(inst->empdule, &mw, &mh);
629 e_gadcon_client_min_size_set(gcc, mw, mh);
630}
631
632static const char *
633_gc_label(const E_Gadcon_Client_Class *client_class)
634{
635 return D_("MPDule");
636}
637
638static Evas_Object *
639_gc_icon(const E_Gadcon_Client_Class *client_class, Evas *evas)
640{
641 Evas_Object *o;
642 char buf[4096];
643
644 o = edje_object_add(evas);
645 snprintf(buf, sizeof(buf), "%s/e-module-empdule.edj",
646 e_module_dir_get(mpdule_config->module));
647 edje_object_file_set(o, buf, "icon");
648 return o;
649}
650
651static const char *
652_gc_id_new(const E_Gadcon_Client_Class *client_class)
653{
654 Config_Item *ci = _mpdule_config_item_get(NULL);
655 return ci->id;
656}
diff --git a/src/enlightenment/e_mod_main.h b/src/enlightenment/e_mod_main.h
new file mode 100644
index 0000000..2a52ed2
--- /dev/null
+++ b/src/enlightenment/e_mod_main.h
@@ -0,0 +1,41 @@
1#ifndef E_MOD_MAIN_H
2#define E_MOD_MAIN_H
3
4#ifdef ENABLE_NLS
5# include <libintl.h>
6# define D_(string) dgettext(PACKAGE, string)
7#else
8# define bindtextdomain(domain,dir)
9# define bind_textdomain_codeset(domain,codeset)
10# define D_(string) (string)
11#endif
12
13#define RESOLUTION_MINUTE 0
14#define RESOLUTION_SECOND 1
15
16typedef struct _Config Config;
17typedef struct _Config_Item Config_Item;
18
19struct _Config
20{
21 E_Module *module;
22 E_Config_Dialog *config_dialog;
23 E_Menu *menu;
24 Eina_List *instances;
25 Eina_List *items;
26};
27
28struct _Config_Item
29{
30 const char *id;
31 double poll_time;
32 const char *hostname;
33 int port;
34 int show_popup;
35};
36
37void _config_mpdule_module (Config_Item * ci);
38void _mpdule_config_updated (Config_Item * ci);
39extern Config *mpdule_config;
40
41#endif
diff --git a/src/enlightenment/empdule.edc b/src/enlightenment/empdule.edc
new file mode 100644
index 0000000..177af1c
--- /dev/null
+++ b/src/enlightenment/empdule.edc
@@ -0,0 +1,885 @@
1color_classes
2{
3}
4
5images
6{
7 image:"next.png" COMP;
8 image:"pause.png" COMP;
9 image:"play.png" COMP;
10 image:"prev.png" COMP;
11 image:"stop.png" COMP;
12}
13
14data
15{
16}
17
18styles
19{
20}
21
22/*
23Available labels:
24empdule.status
25empdule.artist
26empdule.title
27empdule.album
28empdule.track
29empdule.date
30empdule.genre
31empdule.composer
32empdule.time
33empdule.uri
34*/
35collections
36{
37 group
38 {
39 name: "modules/empdule/main";
40 parts
41 {
42 part
43 {
44 name: "base";
45 type: RECT;
46 mouse_events: 0;
47 description
48 {
49 state: "default" 0.00;
50 visible: 1;
51 rel1
52 {
53 relative: 0.00 0.00;
54 offset: 0 0;
55 }
56 rel2
57 {
58 relative: 1.00 1.00;
59 offset: -1 -1;
60 }
61 }
62 }
63 part
64 {
65 name: "item_clip";
66 type: RECT;
67 description
68 {
69 state: "default" 0.00;
70 visible: 1;
71 rel1
72 {
73 relative: 0.00 0.00;
74 offset: 0 0;
75 }
76 rel2
77 {
78 relative: 1.00 1.00;
79 offset: -1 -1;
80 }
81 color: 255 255 255 0;
82 }
83 description
84 {
85 state: "hide" 0.00;
86 visible: 1;
87 rel1
88 {
89 relative: 0.00 -1.00;
90 offset: 0 0;
91 }
92 rel2
93 {
94 relative: 1.00 0.00;
95 offset: -1 -1;
96 }
97 color: 255 255 255 0;
98 }
99 }
100 part
101 {
102 name: "controls_clip";
103 type: RECT;
104 description
105 {
106 state: "default" 0.00;
107 visible: 1;
108 rel1
109 {
110 relative: 0.00 1.00;
111 offset: 0 0;
112 }
113 rel2
114 {
115 relative: 1.00 2.00;
116 offset: -1 -1;
117 }
118 color: 255 255 255 0;
119 }
120 description
121 {
122 state: "show" 0.00;
123 visible: 1;
124 rel1
125 {
126 relative: 0.00 0.00;
127 offset: 0 0;
128 }
129 rel2
130 {
131 relative: 1.00 1.00;
132 offset: -1 -1;
133 }
134 color: 255 255 255 0;
135 }
136 }
137 part
138 {
139 name: "empdule.artist";
140 type: TEXT;
141 effect: OUTLINE_SOFT_SHADOW;
142 clip_to: "base";
143 mouse_events: 0;
144 description
145 {
146 state: "default" 0.00;
147 visible: 1;
148 rel1
149 {
150 relative: 0.00 0.00;
151 offset: 0 4;
152 to: "item_clip";
153 }
154 rel2
155 {
156 relative: 1.00 0.50;
157 offset: -1 -3;
158 to: "item_clip";
159 }
160 color2: 0 0 0 96;
161 color3: 0 0 0 32;
162 text
163 {
164 text: "";
165 text_class: "empdule";
166 font: "Sans:style=Mono";
167 size: 10;
168 min: 1 1;
169 align: 0.50 0.50;
170 }
171 }
172 description
173 {
174 state: "hidden" 0.00;
175 visible: 0;
176 rel1
177 {
178 relative: 0.00 0.00;
179 offset: 0 4;
180 to: "item_clip";
181 }
182 rel2
183 {
184 relative: 1.00 0.50;
185 offset: -1 -3;
186 to: "item_clip";
187 }
188 color2: 0 0 0 96;
189 color3: 0 0 0 32;
190 text
191 {
192 text: "";
193 text_class: "empdule";
194 font: "Sans:style=Mono";
195 size: 10;
196 min: 1 1;
197 align: 0.50 0.50;
198 }
199 }
200 description
201 {
202 state: "visible" 0.00;
203 visible: 1;
204 rel1
205 {
206 relative: 0.00 0.00;
207 offset: 0 4;
208 to: "item_clip";
209 }
210 rel2
211 {
212 relative: 1.00 0.50;
213 offset: -1 -3;
214 to: "item_clip";
215 }
216 color2: 0 0 0 96;
217 color3: 0 0 0 32;
218 text
219 {
220 text: "";
221 text_class: "empdule";
222 font: "Sans:style=Mono";
223 size: 10;
224 min: 1 1;
225 align: 0.50 0.50;
226 }
227 }
228 }
229 part
230 {
231 name: "empdule.title";
232 type: TEXT;
233 effect: OUTLINE_SOFT_SHADOW;
234 clip_to: "base";
235 mouse_events: 0;
236 description
237 {
238 state: "default" 0.00;
239 visible: 1;
240 rel1
241 {
242 relative: 0.00 0.50;
243 offset: 0 4;
244 to: "item_clip";
245 }
246 rel2
247 {
248 relative: 1.00 1.00;
249 offset: -1 -3;
250 to: "item_clip";
251 }
252 color2: 0 0 0 96;
253 color3: 0 0 0 32;
254 text
255 {
256 text: "";
257 text_class: "empdule";
258 font: "Sans:style=Mono";
259 size: 9;
260 min: 1 1;
261 align: 0.50 0.50;
262 }
263 }
264 description
265 {
266 state: "hidden" 0.00;
267 visible: 0;
268 rel1
269 {
270 relative: 0.00 0.50;
271 offset: 0 4;
272 to: "item_clip";
273 }
274 rel2
275 {
276 relative: 1.00 1.00;
277 offset: -1 -3;
278 to: "item_clip";
279 }
280 color2: 0 0 0 96;
281 color3: 0 0 0 32;
282 text
283 {
284 text: "";
285 text_class: "empdule";
286 font: "Sans:style=Mono";
287 size: 9;
288 min: 1 1;
289 align: 0.50 0.50;
290 }
291 }
292 description
293 {
294 state: "visible" 0.00;
295 visible: 1;
296 rel1
297 {
298 relative: 0.00 0.50;
299 offset: 0 4;
300 to: "item_clip";
301 }
302 rel2
303 {
304 relative: 1.00 1.00;
305 offset: -1 -3;
306 to: "item_clip";
307 }
308 color2: 0 0 0 96;
309 color3: 0 0 0 32;
310 text
311 {
312 text: "";
313 text_class: "empdule";
314 font: "Sans:style=Mono";
315 size: 9;
316 min: 1 1;
317 align: 0.50 0.50;
318 }
319 }
320 }
321 part
322 {
323 name: "empdule.previous";
324 type: IMAGE;
325 mouse_events: 1;
326 repeat_events: 1;
327 description
328 {
329 state: "default" 0.0;
330 visible: 1;
331 aspect: 1 1;
332 aspect_preference: BOTH;
333 align: 0.5 0.5;
334 min: 12 12;
335 rel1
336 {
337 relative: 0.0 0.0;
338 to: "controls_clip";
339 }
340 rel2
341 {
342 relative: 0.2 1.0;
343 to: "controls_clip";
344 }
345 image
346 {
347 normal: "prev.png";
348 }
349 }
350 }
351 part
352 {
353 name: "empdule.play";
354 type: IMAGE;
355 mouse_events: 1;
356 repeat_events: 1;
357 description
358 {
359 state: "default" 0.0;
360 visible: 1;
361 aspect: 1 1;
362 aspect_preference: BOTH;
363 align: 0.5 0.5;
364 min: 12 12;
365 rel1
366 {
367 relative: 0.2 0.0;
368 to: "controls_clip";
369 }
370 rel2
371 {
372 relative: 0.4 1.0;
373 to: "controls_clip";
374 }
375 image
376 {
377 normal: "play.png";
378 }
379 }
380 }
381 part
382 {
383 name: "empdule.pause";
384 type: IMAGE;
385 mouse_events: 1;
386 repeat_events: 1;
387 description
388 {
389 state: "default" 0.0;
390 visible: 1;
391 aspect: 1 1;
392 aspect_preference: BOTH;
393 align: 0.5 0.5;
394 min: 12 12;
395 rel1
396 {
397 relative: 0.4 0.0;
398 to: "controls_clip";
399 }
400 rel2
401 {
402 relative: 0.6 1.0;
403 to: "controls_clip";
404 }
405 image
406 {
407 normal: "pause.png";
408 }
409 }
410 }
411 part
412 {
413 name: "empdule.stop";
414 type: IMAGE;
415 mouse_events: 1;
416 repeat_events: 1;
417 description
418 {
419 state: "default" 0.0;
420 visible: 1;
421 aspect: 1 1;
422 aspect_preference: BOTH;
423 align: 0.5 0.5;
424 min: 12 12;
425 rel1
426 {
427 relative: 0.6 0.0;
428 to: "controls_clip";
429 }
430 rel2
431 {
432 relative: 0.8 1.0;
433 to: "controls_clip";
434 }
435 image
436 {
437 normal: "stop.png";
438 }
439 }
440 }
441 part
442 {
443 name: "empdule.next";
444 type: IMAGE;
445 mouse_events: 1;
446 repeat_events: 1;
447 description
448 {
449 state: "default" 0.0;
450 visible: 1;
451 aspect: 1 1;
452 aspect_preference: BOTH;
453 align: 0.5 0.5;
454 min: 12 12;
455 rel1
456 {
457 relative: 0.8 0.0;
458 to: "controls_clip";
459 }
460 rel2
461 {
462 relative: 1.0 1.0;
463 to: "controls_clip";
464 }
465 image
466 {
467 normal: "next.png";
468 }
469 }
470 }
471 part
472 {
473 name: "event_grab";
474 type: RECT;
475 repeat_events: 1;
476 description
477 {
478 state: "default" 0.00;
479 visible: 1;
480 color: 0 0 0 0;
481 rel1
482 {
483 relative: 0.00 0.00;
484 offset: 0 0;
485 }
486 rel2
487 {
488 relative: 1.00 1.00;
489 offset: -1 -1;
490 }
491 }
492 }
493 }
494 programs
495 {
496 program
497 {
498 name: "show_controls";
499 signal: "mouse,in";
500 source: "event_grab";
501 action: STATE_SET "show" 0.0;
502 transition: LINEAR 0.1;
503 target: "controls_clip";
504 }
505 program
506 {
507 name: "show_controls2";
508 signal: "mouse,in";
509 source: "event_grab";
510 action: STATE_SET "hide" 0.0;
511 transition: LINEAR 0.1;
512 target: "item_clip";
513 }
514 program
515 {
516 name: "wait";
517 action: STATE_SET "hide" 0.0;
518 transition: LINEAR 2;
519 target: "item_clip";
520 after: "hide_controls";
521 after: "hide_controls2";
522 }
523 program
524 {
525 name: "hide_controls";
526 signal: "mouse,out";
527 source: "event_grab";
528 action: STATE_SET "default" 0.0;
529 transition: LINEAR 0.1;
530 target: "controls_clip";
531 }
532 program
533 {
534 name: "hide_controls2";
535 signal: "mouse,out";
536 source: "event_grab";
537 action: STATE_SET "default" 0.0;
538 transition: LINEAR 0.1;
539 target: "item_clip";
540 }
541 program
542 {
543 name: "mouse_play";
544 signal: "mouse,clicked,1";
545 source: "empdule.play";
546 action: SIGNAL_EMIT "empdule,play" "";
547 }
548 program
549 {
550 name: "mouse_pause";
551 signal: "mouse,clicked,1";
552 source: "empdule.pause";
553 action: SIGNAL_EMIT "empdule,pause" "";
554 }
555 program
556 {
557 name: "mouse_stop";
558 signal: "mouse,clicked,1";
559 source: "empdule.stop";
560 action: SIGNAL_EMIT "empdule,stop" "";
561 }
562 program
563 {
564 name: "mouse_previous";
565 signal: "mouse,clicked,1";
566 source: "empdule.previous";
567 action: SIGNAL_EMIT "empdule,previous" "";
568 }
569 program
570 {
571 name: "mouse_next";
572 signal: "mouse,clicked,1";
573 source: "empdule.next";
574 action: SIGNAL_EMIT "empdule,next" "";
575 }
576 }
577 }
578 group
579 {
580 name: "modules/empdule/popup";
581 parts
582 {
583 part
584 {
585 name: "base";
586 type: RECT;
587 mouse_events: 0;
588 description
589 {
590 state: "default" 0.00;
591 visible: 1;
592 min: 300 65;
593 color: 255 255 255 255;
594 rel1
595 {
596 relative: 0.00 0.00;
597 offset: 5 5;
598 }
599 rel2
600 {
601 relative: 1.00 1.00;
602 offset: -5 -5;
603 }
604 }
605 }
606 part
607 {
608 name: "empdule.artist_label";
609 type: TEXT;
610 effect: SHADOW;
611 clip_to: "base";
612 description
613 {
614 state: "default" 0.00;
615 visible: 1;
616 align: 0.00 0.50;
617 fixed: 1 1;
618 rel1
619 {
620 relative: 0.00 0.00;
621 offset: 5 0;
622 to: "base";
623 }
624 rel2
625 {
626 relative: 0.00 0.25;
627 to: "base";
628 }
629 text
630 {
631 text: "Artist:";
632 text_class: "empdule";
633 font: "Sans:style=Mono";
634 size: 10;
635 min: 1 1;
636 align: 1.0 0.50;
637 }
638 }
639 }
640 part
641 {
642 name: "empdule.artist";
643 type: TEXT;
644 effect: OUTLINE_SOFT_SHADOW;
645 clip_to: "base";
646 description
647 {
648 state: "default" 0.00;
649 visible: 1;
650 align: 0.00 0.50;
651 fixed: 0 1;
652 rel1
653 {
654 relative: 1.00 0.00;
655 offset: 5 0;
656 to_x: "empdule.artist_label";
657 to_y: "base";
658 }
659 rel2
660 {
661 relative: 1.00 0.25;
662 to: "base";
663 }
664 text
665 {
666 text: "";
667 text_class: "empdule";
668 font: "Sans:style=Bold";
669 size: 10;
670 align: 0.0 0.50;
671 ellipsis: 0.0;
672 }
673 }
674 }
675 part
676 {
677 name: "empdule.title_label";
678 type: TEXT;
679 effect: SHADOW;
680 clip_to: "base";
681 description
682 {
683 state: "default" 0.00;
684 visible: 1;
685 align: 0.00 0.50;
686 fixed: 1 1;
687 rel1
688 {
689 relative: 0.00 0.25;
690 offset: 5 0;
691 to: "base";
692 }
693 rel2
694 {
695 relative: 0.00 0.50;
696 to: "base";
697 }
698 text
699 {
700 text: "Title:";
701 text_class: "empdule";
702 font: "Sans:style=Mono";
703 size: 10;
704 min: 1 1;
705 align: 1.0 0.50;
706 }
707 }
708 }
709 part
710 {
711 name: "empdule.title";
712 type: TEXT;
713 effect: OUTLINE_SOFT_SHADOW;
714 clip_to: "base";
715 description
716 {
717 state: "default" 0.00;
718 visible: 1;
719 align: 0.00 0.50;
720 fixed: 0 1;
721 rel1
722 {
723 relative: 1.00 0.25;
724 offset: 5 0;
725 to_x: "empdule.title_label";
726 to_y: "base";
727 }
728 rel2
729 {
730 relative: 1.00 0.50;
731 to: "base";
732 }
733 text
734 {
735 text: "";
736 text_class: "empdule";
737 font: "Sans:style=Bold";
738 size: 10;
739 align: 0.0 0.50;
740 ellipsis: 0.0;
741 }
742 }
743 }
744 part
745 {
746 name: "empdule.album_label";
747 type: TEXT;
748 effect: SHADOW;
749 clip_to: "base";
750 description
751 {
752 state: "default" 0.00;
753 visible: 1;
754 align: 0.00 0.50;
755 fixed: 1 1;
756 rel1
757 {
758 relative: 0.00 0.50;
759 offset: 5 0;
760 to: "base";
761 }
762 rel2
763 {
764 relative: 0.00 0.75;
765 to: "base";
766 }
767 text
768 {
769 text: "Album:";
770 text_class: "empdule";
771 font: "Sans:style=Mono";
772 size: 10;
773 min: 1 1;
774 align: 1.0 0.50;
775 }
776 }
777 }
778 part
779 {
780 name: "empdule.album";
781 type: TEXT;
782 effect: OUTLINE_SOFT_SHADOW;
783 clip_to: "base";
784 description
785 {
786 state: "default" 0.00;
787 visible: 1;
788 align: 0.00 0.50;
789 fixed: 0 1;
790 rel1
791 {
792 relative: 1.00 0.50;
793 offset: 5 0;
794 to_x: "empdule.album_label";
795 to_y: "base";
796 }
797 rel2
798 {
799 relative: 1.00 0.75;
800 to: "base";
801 }
802 text
803 {
804 text: "";
805 text_class: "empdule";
806 font: "Sans:style=Bold";
807 size: 10;
808 align: 0.0 0.50;
809 ellipsis: 0.0;
810 }
811 }
812 }
813 part
814 {
815 name: "empdule.genre_label";
816 type: TEXT;
817 mouse_events: 0;
818 effect: OUTLINE_SOFT_SHADOW;
819 clip_to: "base";
820 description
821 {
822 state: "default" 0.00;
823 visible: 1;
824 align: 0.00 0.50;
825 fixed: 1 1;
826 rel1
827 {
828 relative: 0.00 0.75;
829 offset: 5 0;
830 to: "base";
831 }
832 rel2
833 {
834 relative: 0.00 1.00;
835 to: "base";
836 }
837 text
838 {
839 text: "Genre:";
840 text_class: "empdule";
841 font: "Sans:style=Mono";
842 size: 10;
843 min: 1 1;
844 align: 1.0 0.50;
845 }
846 }
847 }
848 part
849 {
850 name: "empdule.genre";
851 type: TEXT;
852 effect: SHADOW;
853 clip_to: "base";
854 description
855 {
856 state: "default" 0.00;
857 visible: 1;
858 align: 0.00 0.50;
859 fixed: 0 1;
860 rel1
861 {
862 relative: 1.00 0.75;
863 offset: 5 0;
864 to_x: "empdule.genre_label";
865 to_y: "base";
866 }
867 rel2
868 {
869 relative: 1.00 1.00;
870 to: "base";
871 }
872 text
873 {
874 text: "";
875 text_class: "empdule";
876 font: "Sans:style=Bold";
877 size: 10;
878 align: 0.0 0.50;
879 ellipsis: 0.0;
880 }
881 }
882 }
883 }
884 }
885}
diff --git a/src/enlightenment/images/module_icon.png b/src/enlightenment/images/module_icon.png
new file mode 100644
index 0000000..2cb83e4
--- /dev/null
+++ b/src/enlightenment/images/module_icon.png
Binary files differ
diff --git a/src/enlightenment/images/next.png b/src/enlightenment/images/next.png
new file mode 100644
index 0000000..ef1de3d
--- /dev/null
+++ b/src/enlightenment/images/next.png
Binary files differ
diff --git a/src/enlightenment/images/pause.png b/src/enlightenment/images/pause.png
new file mode 100644
index 0000000..900152e
--- /dev/null
+++ b/src/enlightenment/images/pause.png
Binary files differ
diff --git a/src/enlightenment/images/play.png b/src/enlightenment/images/play.png
new file mode 100644
index 0000000..0ea9929
--- /dev/null
+++ b/src/enlightenment/images/play.png
Binary files differ
diff --git a/src/enlightenment/images/prev.png b/src/enlightenment/images/prev.png
new file mode 100644
index 0000000..8218387
--- /dev/null
+++ b/src/enlightenment/images/prev.png
Binary files differ
diff --git a/src/enlightenment/images/stop.png b/src/enlightenment/images/stop.png
new file mode 100644
index 0000000..027a7c7
--- /dev/null
+++ b/src/enlightenment/images/stop.png
Binary files differ
diff --git a/src/enlightenment/module.desktop.in b/src/enlightenment/module.desktop.in
new file mode 100644
index 0000000..c6e6f28
--- /dev/null
+++ b/src/enlightenment/module.desktop.in
@@ -0,0 +1,33 @@
1[Desktop Entry]
2Encoding=UTF-8
3Type=Link
4Name=MPDule
5Name[ca]=MPDule
6Name[de]=MPDule
7Name[eo]=MPDule
8Name[fi]=MPDule
9Name[fr]=MPDule
10Name[gl]=MPDule
11Name[ja]=MPDule
12Name[ms]=MPDule
13Name[sr]=МПДуле
14Name[tr]=MPDule
15Comment=View what's playing in MPD.
16Comment[ca]=Mostra el que està sonant a MPD
17Comment[cs]=Zobrazí, co hraje v MPD.
18Comment[de]=Anziegen, was in MPD wiedergegeben wird.
19Comment[el]=Εμφάνιση του τι παίζει στο MPD.
20Comment[eo]=<br>Vidi kio muzikas pere de MPD.
21Comment[es]=Vea lo que se está reproduciendo en MPD.
22Comment[fi]=Näy MPD:n toistama media.
23Comment[fr]=Une interface pour le démon MPD.
24Comment[gl]=Vexa o que se reproduce no MPD.
25Comment[hu]=Láthatod, mit játszik épp az MPD.
26Comment[it]=Un'interfaccia per il demone MPD.
27Comment[ms]=Lihat apakah yang dimainkan dalam MPD.
28Comment[pt]=Uma interface para o MPD
29Comment[ru]=Показывает что играет в MPD.
30Comment[sr]=Приказује шта изводи МПД
31Comment[tr]=MPD'de ne çaldığını göster.
32Icon=e-module-mpdule
33X-Enlightenment-ModuleType=utils