aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--data/themes/default.edc1
-rw-r--r--data/themes/edc/music_control.edc161
-rw-r--r--data/themes/img/music_control_icon.png (renamed from src/modules/music-control/images/icon.png)bin47348 -> 47348 bytes
-rw-r--r--data/themes/img/next.png (renamed from src/modules/music-control/images/next.png)bin1382 -> 1382 bytes
-rw-r--r--data/themes/img/pause.png (renamed from src/modules/music-control/images/pause.png)bin638 -> 638 bytes
-rw-r--r--data/themes/img/play.png (renamed from src/modules/music-control/images/play.png)bin1153 -> 1153 bytes
-rw-r--r--data/themes/img/previous.png (renamed from src/modules/music-control/images/previous.png)bin1240 -> 1240 bytes
-rw-r--r--src/modules/Makefile_music_control.am3
-rw-r--r--src/modules/music-control/e-module-music-control.edc157
-rw-r--r--src/modules/music-control/e-module-music-control.edjbin55619 -> 0 bytes
-rw-r--r--src/modules/music-control/e_mod_main.c31
-rw-r--r--src/modules/music-control/ui.c6
12 files changed, 172 insertions, 187 deletions
diff --git a/data/themes/default.edc b/data/themes/default.edc
index 4ec3e74f2..2c0ba9427 100644
--- a/data/themes/default.edc
+++ b/data/themes/default.edc
@@ -45,6 +45,7 @@ collections {
#include "edc/xkbswitch.edc"
#include "edc/tasks.edc"
#include "edc/connman.edc"
+#include "edc/music_control.edc"
#include "edc/systray.edc"
#include "edc/clock.edc"
#include "edc/ibar-ibox.edc"
diff --git a/data/themes/edc/music_control.edc b/data/themes/edc/music_control.edc
new file mode 100644
index 000000000..6a0ef23b3
--- /dev/null
+++ b/data/themes/edc/music_control.edc
@@ -0,0 +1,161 @@
+group {
+ name: "modules/music-control/icon";
+ max: 24 24;
+ images {
+ image: "music_control_icon.png" COMP;
+ }
+ parts {
+ part {
+ name: "image";
+ mouse_events: 0;
+ type: IMAGE;
+ description {
+ state: "default" 0.0;
+ aspect: 1.0 1.0;
+ aspect_preference: BOTH;
+ image.normal: "music_control_icon.png";
+ }
+ }
+ }
+}
+
+group {
+ name: "modules/music-control/main";
+ images {
+ image: "music_control_icon.png" COMP;
+ }
+ parts {
+ part {
+ name: "icon";
+ type: IMAGE;
+ description {
+ state: "default" 0.0;
+ aspect: 1.0 1.0;
+ aspect_preference: BOTH;
+ rel1.relative: 0 0;
+ rel2.relative: 1 1;
+ image.normal: "music_control_icon.png";
+ }
+ }
+ }
+}
+
+group {
+ name: "modules/music-control/popup";
+ min: 150 50;
+ images {
+ image: "previous.png" COMP;
+ image: "next.png" COMP;
+ image: "pause.png" COMP;
+ image: "play.png" COMP;
+ }
+ parts {
+ part {
+ name: "player_name";
+ type: TEXT;
+ description {
+ state: "default" 0;
+ text.size: 12;
+ text.text: "Music player";
+ text.font: "Sans";
+ rel1.relative: 0.0 0.0;
+ rel2.relative: 1.0 0.0;
+ rel2.offset: 0 16;
+ }
+ }
+ part {
+ type: IMAGE;
+ name: "previous_btn";
+ description {
+ state: "default" 0;
+ aspect: 1.0 1.0;
+ aspect_preference: BOTH;
+ rel1.to: "player_name";
+ rel1.relative: 0.0 1.0;
+ rel2.relative: 0.33 1.0;
+ image.normal: "previous.png";
+ }
+ }
+ part {
+ type: IMAGE;
+ name: "play_btn";
+ description {
+ state: "default" 0;
+ aspect: 1.0 1.0;
+ aspect_preference: BOTH;
+ rel1.to: "player_name";
+ rel1.relative: 0.33 1.0;
+ rel2.relative: 0.66 1.0;
+ image.normal: "pause.png";
+ }
+ description {
+ state: "play" 0.0;
+ inherit: "default" 0.0;
+ image.normal: "play.png";
+ }
+ }
+ part {
+ type: IMAGE;
+ name: "next_btn";
+ description {
+ state: "default" 0;
+ aspect: 1.0 1.0;
+ aspect_preference: BOTH;
+ rel1.to: "player_name";
+ rel1.relative: 0.66 1.0;
+ rel2.relative: 1.0 1.0;
+ image.normal: "next.png";
+ }
+ }
+ }
+ programs {
+ program {
+ signal: "mouse,clicked,*";
+ source: "previous_btn";
+ action: SIGNAL_EMIT "btn,clicked" "previous";
+ }
+ program {
+ signal: "mouse,clicked,*";
+ source: "play_btn";
+ action: SIGNAL_EMIT "btn,clicked" "play";
+ }
+ program {
+ signal: "mouse,clicked,*";
+ source: "next_btn";
+ action: SIGNAL_EMIT "btn,clicked" "next";
+ }
+ program {
+ signal: "btn,state,image,play";
+ source: "play";
+ action: STATE_SET "play" 0.0;
+ transition: LINEAR 0.1;
+ target: "play_btn";
+ }
+ program {
+ signal: "btn,state,image,play,no_delay";
+ source: "play";
+ action: STATE_SET "play" 0.0;
+ transition: LINEAR 0.0;
+ target: "play_btn";
+ }
+ program {
+ signal: "btn,state,image,pause";
+ source: "play";
+ action: STATE_SET "default" 0.0;
+ transition: LINEAR 0.1;
+ target: "play_btn";
+ }
+ program {
+ signal: "mouse,clicked,*";
+ source: "player_name";
+ action: SIGNAL_EMIT "label,clicked" "player_name";
+ }
+ }
+ script {
+ public message(Msg_Type:type, id, ...) {
+ new txt[128];
+ getsarg (2, txt, 128);
+ set_text(PART:"player_name", txt);
+ }
+ }
+}
diff --git a/src/modules/music-control/images/icon.png b/data/themes/img/music_control_icon.png
index 52175443b..52175443b 100644
--- a/src/modules/music-control/images/icon.png
+++ b/data/themes/img/music_control_icon.png
Binary files differ
diff --git a/src/modules/music-control/images/next.png b/data/themes/img/next.png
index 86e313e50..86e313e50 100644
--- a/src/modules/music-control/images/next.png
+++ b/data/themes/img/next.png
Binary files differ
diff --git a/src/modules/music-control/images/pause.png b/data/themes/img/pause.png
index c0a09bb82..c0a09bb82 100644
--- a/src/modules/music-control/images/pause.png
+++ b/data/themes/img/pause.png
Binary files differ
diff --git a/src/modules/music-control/images/play.png b/data/themes/img/play.png
index 35f3a2348..35f3a2348 100644
--- a/src/modules/music-control/images/play.png
+++ b/data/themes/img/play.png
Binary files differ
diff --git a/src/modules/music-control/images/previous.png b/data/themes/img/previous.png
index c07da8ba0..c07da8ba0 100644
--- a/src/modules/music-control/images/previous.png
+++ b/data/themes/img/previous.png
Binary files differ
diff --git a/src/modules/Makefile_music_control.am b/src/modules/Makefile_music_control.am
index 90e60ddf6..3ce7c9cd6 100644
--- a/src/modules/Makefile_music_control.am
+++ b/src/modules/Makefile_music_control.am
@@ -1,6 +1,5 @@
music_controldir = $(MDIR)/music-control
-music_control_DATA = music-control/e-module-music-control.edj \
- music-control/module.desktop
+music_control_DATA = music-control/module.desktop
EXTRA_DIST += $(music_control_DATA)
diff --git a/src/modules/music-control/e-module-music-control.edc b/src/modules/music-control/e-module-music-control.edc
deleted file mode 100644
index 5a90c3229..000000000
--- a/src/modules/music-control/e-module-music-control.edc
+++ /dev/null
@@ -1,157 +0,0 @@
-images {
- image: "images/icon.png" COMP;
- image: "images/previous.png" COMP;
- image: "images/next.png" COMP;
- image: "images/pause.png" COMP;
- image: "images/play.png" COMP;
-}
-
-collections {
- group {
- name: "icon";
- max: 24 24;
- parts {
- part {
- name: "image";
- mouse_events: 0;
- type: IMAGE;
- description {
- state: "default" 0.0;
- aspect: 1.0 1.0;
- aspect_preference: BOTH;
- image.normal: "images/icon.png";
- }
- }
- }
- }
- group {
- name: "modules/music-control/main";
- parts {
- part {
- name: "icon";
- type: IMAGE;
- description {
- state: "default" 0.0;
- aspect: 1.0 1.0;
- aspect_preference: BOTH;
- rel1.relative: 0 0;
- rel2.relative: 1 1;
- image.normal: "images/icon.png";
- }
- }
- }
- }
- group {
- name: "modules/music-control/popup";
- min: 150 50;
- parts {
- part {
- name: "player_name";
- type: TEXT;
- description {
- state: "default" 0;
- text.size: 12;
- text.text: "Music player";
- text.font: "Sans";
- rel1.relative: 0.0 0.0;
- rel2.relative: 1.0 0.0;
- rel2.offset: 0 16;
- }
- }
- part {
- type: IMAGE;
- name: "previous_btn";
- description {
- state: "default" 0;
- aspect: 1.0 1.0;
- aspect_preference: BOTH;
- rel1.to: "player_name";
- rel1.relative: 0.0 1.0;
- rel2.relative: 0.33 1.0;
- image.normal: "images/previous.png";
- }
- }
- part {
- type: IMAGE;
- name: "play_btn";
- description {
- state: "default" 0;
- aspect: 1.0 1.0;
- aspect_preference: BOTH;
- rel1.to: "player_name";
- rel1.relative: 0.33 1.0;
- rel2.relative: 0.66 1.0;
- image.normal: "images/pause.png";
- }
- description {
- state: "play" 0.0;
- inherit: "default" 0.0;
- image.normal: "images/play.png";
- }
- }
- part {
- type: IMAGE;
- name: "next_btn";
- description {
- state: "default" 0;
- aspect: 1.0 1.0;
- aspect_preference: BOTH;
- rel1.to: "player_name";
- rel1.relative: 0.66 1.0;
- rel2.relative: 1.0 1.0;
- image.normal: "images/next.png";
- }
- }
- }
- programs {
- program {
- signal: "mouse,clicked,*";
- source: "previous_btn";
- action: SIGNAL_EMIT "btn,clicked" "previous";
- }
- program {
- signal: "mouse,clicked,*";
- source: "play_btn";
- action: SIGNAL_EMIT "btn,clicked" "play";
- }
- program {
- signal: "mouse,clicked,*";
- source: "next_btn";
- action: SIGNAL_EMIT "btn,clicked" "next";
- }
- program {
- signal: "btn,state,image,play";
- source: "play";
- action: STATE_SET "play" 0.0;
- transition: LINEAR 0.1;
- target: "play_btn";
- }
- program {
- signal: "btn,state,image,play,no_delay";
- source: "play";
- action: STATE_SET "play" 0.0;
- transition: LINEAR 0.0;
- target: "play_btn";
- }
- program {
- signal: "btn,state,image,pause";
- source: "play";
- action: STATE_SET "default" 0.0;
- transition: LINEAR 0.1;
- target: "play_btn";
- }
- program {
- signal: "mouse,clicked,*";
- source: "player_name";
- action: SIGNAL_EMIT "label,clicked" "player_name";
- }
- }
- script {
- public message(Msg_Type:type, id, ...) {
- new txt[128];
- getsarg (2, txt, 128);
- set_text(PART:"player_name", txt);
- }
- }
- }
-} \ No newline at end of file
diff --git a/src/modules/music-control/e-module-music-control.edj b/src/modules/music-control/e-module-music-control.edj
deleted file mode 100644
index 658227906..000000000
--- a/src/modules/music-control/e-module-music-control.edj
+++ /dev/null
Binary files differ
diff --git a/src/modules/music-control/e_mod_main.c b/src/modules/music-control/e_mod_main.c
index 9f78628ed..37b0e0876 100644
--- a/src/modules/music-control/e_mod_main.c
+++ b/src/modules/music-control/e_mod_main.c
@@ -4,8 +4,6 @@
static E_Module *music_control_mod = NULL;
-static char tmpbuf[4096]; /* general purpose buffer, just use immediately */
-
static const char _e_music_control_Name[] = "Music controller";
const Player music_player_players[] =
@@ -19,23 +17,6 @@ const Player music_player_players[] =
{NULL, NULL}
};
-const char *
-music_control_edj_path_get(void)
-{
-#define TF "/e-module-music-control.edj"
- size_t dirlen;
-
- dirlen = strlen(music_control_mod->dir);
- if (dirlen >= sizeof(tmpbuf) - sizeof(TF))
- return NULL;
-
- memcpy(tmpbuf, music_control_mod->dir, dirlen);
- memcpy(tmpbuf + dirlen, TF, sizeof(TF));
-
- return tmpbuf;
-#undef TF
-}
-
static void
_music_control(E_Object *obj, const char *params)
{
@@ -108,11 +89,8 @@ _gc_init(E_Gadcon *gc, const char *name, const char *id, const char *style)
inst = calloc(1, sizeof(E_Music_Control_Instance));
inst->ctxt = ctxt;
inst->gadget = edje_object_add(gc->evas);
- edje_object_file_set(inst->gadget, music_control_edj_path_get(),
- "modules/music-control/main");
- /*e_theme_edje_object_set(inst->gadget, "base/theme/modules/music-control",
- "e/modules/music-control/main");
- TODO append theme to data/themes/default.edc*/
+ e_theme_edje_object_set(inst->gadget, "base/theme/modules/music-control",
+ "modules/music-control/main");
inst->gcc = e_gadcon_client_new(gc, name, id, style, inst->gadget);
inst->gcc->data = inst;
@@ -162,10 +140,13 @@ static Evas_Object *
_gc_icon(const E_Gadcon_Client_Class *client_class, Evas *evas)
{
Evas_Object *o = edje_object_add(evas);
- edje_object_file_set(o, music_control_edj_path_get(), "icon");
+ e_theme_edje_object_set(o, "base/theme/modules/music-control",
+ "modules/music-control/icon");
return o;
}
+static char tmpbuf[32]; /* general purpose buffer, just use immediately */
+
static const char *
_gc_id_new(const E_Gadcon_Client_Class *client_class)
{
diff --git a/src/modules/music-control/ui.c b/src/modules/music-control/ui.c
index 3a6531ff9..d9b568e64 100644
--- a/src/modules/music-control/ui.c
+++ b/src/modules/music-control/ui.c
@@ -116,8 +116,8 @@ _popup_new(E_Music_Control_Instance *inst)
inst->popup = e_gadcon_popup_new(inst->gcc);
o = edje_object_add(inst->popup->win->evas);
- edje_object_file_set(o, music_control_edj_path_get(),
- "modules/music-control/popup");
+ e_theme_edje_object_set(o, "base/theme/modules/music-control",
+ "modules/music-control/popup");
edje_object_signal_callback_add(o, "btn,clicked", "*", _btn_clicked, inst);
edje_object_signal_callback_add(o, "label,clicked", "player_name", _label_clicked, inst);
@@ -214,7 +214,7 @@ _cb_menu_cfg(void *data, E_Menu *m, E_Menu_Item *mi)
e_config_dialog_new(m->zone->container, "Music control Settings", "E",
"_e_mod_music_config_dialog",
- music_control_edj_path_get(), 0, v, data);
+ NULL, 0, v, data);
}
void