e/music-control: Move edc and images to data/theme

Patch by: José Roberto de Souza  <zehortigoza@profusion.mobi>



SVN revision: 81997
This commit is contained in:
José Roberto de Souza 2013-01-02 13:22:36 +00:00 committed by Lucas De Marchi
parent 2fbd1c79ad
commit 548b3ecdff
12 changed files with 172 additions and 187 deletions

View File

@ -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"

View File

@ -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);
}
}
}

View File

Before

Width:  |  Height:  |  Size: 46 KiB

After

Width:  |  Height:  |  Size: 46 KiB

View File

Before

Width:  |  Height:  |  Size: 1.3 KiB

After

Width:  |  Height:  |  Size: 1.3 KiB

View File

Before

Width:  |  Height:  |  Size: 638 B

After

Width:  |  Height:  |  Size: 638 B

View File

Before

Width:  |  Height:  |  Size: 1.1 KiB

After

Width:  |  Height:  |  Size: 1.1 KiB

View File

Before

Width:  |  Height:  |  Size: 1.2 KiB

After

Width:  |  Height:  |  Size: 1.2 KiB

View File

@ -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)

View File

@ -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);
}
}
}
}

View File

@ -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)
{

View File

@ -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