--- /dev/null
+collections {
+ base_scale: 1.0;
+ group { "main";
+
+ parts {
+ part {
+ name:"panel.bg";
+ type: RECT;
+ description{
+ state: "default" 0.0;
+ rel1 {
+ relative: 0.0 0.0;
+ }
+ rel2 {
+ relative: 1.0 1.0;
+ }
+ color: 59 89 152 255;
+ }
+ }
+
+
+ part {
+ name: "btn_00";
+ type:SWALLOW;
+ description{
+ state: "default" 0.0;
+ rel1 {
+ relative: 0.0 0.0;
+ }
+ rel2 {
+ relative: 1/5 1/4;
+ }
+ fixed: 1 1;
+ }
+ }
+
+ part {
+ name: "btn_01";
+ type:SWALLOW;
+ description{
+ state: "default" 0.0;
+ rel1 {
+ relative: 1/5 0.0;
+ }
+ rel2 {
+ relative: 2/5 1/4;
+ }
+ fixed: 1 1;
+ }
+ }
+
+ part {
+ name: "btn_02";
+ type:SWALLOW;
+ description{
+ state: "default" 0.0;
+ rel1 {
+ relative: 2/5 0.0;
+ }
+ rel2 {
+ relative: 3/5 1/4;
+ }
+ fixed: 1 1;
+ }
+ }
+
+ part {
+ name: "btn_03";
+ type:SWALLOW;
+ description{
+ state: "default" 0.0;
+ rel1 {
+ relative: 3/5 0.0;
+ }
+ rel2 {
+ relative: 5/5 1/4;
+ }
+ fixed: 1 1;
+ }
+ }
+
+ part {
+ name: "btn_10";
+ type:SWALLOW;
+ description{
+ state: "default" 0.0;
+ rel1 {
+ relative: 0.0 1/4;
+ }
+ rel2 {
+ relative: 1/5 2/4;
+ }
+ fixed: 1 1;
+ }
+ }
+
+ part {
+ name: "btn_11";
+ type:SWALLOW;
+ description{
+ state: "default" 0.0;
+ rel1 {
+ relative: 1/5 1/4;
+ }
+ rel2 {
+ relative: 2/5 2/4;
+ }
+ fixed: 1 1;
+ }
+ }
+
+ part {
+ name: "btn_12";
+ type:SWALLOW;
+ description{
+ state: "default" 0.0;
+ rel1 {
+ relative: 2/5 1/4;
+ }
+ rel2 {
+ relative: 3/5 2/4;
+ }
+ fixed: 1 1;
+ }
+ }
+
+ part {
+ name: "btn_13";
+ type:SWALLOW;
+ description{
+ state: "default" 0.0;
+ rel1 {
+ relative: 3/5 1/4;
+ }
+ rel2 {
+ relative: 4/5 2/4;
+ }
+ fixed: 1 1;
+ }
+ }
+
+ part {
+ name: "btn_14";
+ type:SWALLOW;
+ description{
+ state: "default" 0.0;
+ rel1 {
+ relative: 4/5 1/4;
+ }
+ rel2 {
+ relative: 5/5 2/4;
+ }
+ fixed: 1 1;
+ }
+ }
+
+
+ part {
+ name: "btn_20";
+ type:SWALLOW;
+ description{
+ state: "default" 0.0;
+ rel1 {
+ relative: 0.0 2/4;
+ }
+ rel2 {
+ relative: 1/5 3/4;
+ }
+ fixed: 1 1;
+ }
+ }
+
+ part {
+ name: "btn_21";
+ type:SWALLOW;
+ description{
+ state: "default" 0.0;
+ rel1 {
+ relative: 1/5 2/4;
+ }
+ rel2 {
+ relative: 2/5 3/4;
+ }
+ fixed: 1 1;
+ }
+ }
+
+ part {
+ name: "btn_22";
+ type:SWALLOW;
+ description{
+ state: "default" 0.0;
+ rel1 {
+ relative: 2/5 2/4;
+ }
+ rel2 {
+ relative: 3/5 3/4;
+ }
+ fixed: 1 1;
+ }
+ }
+
+ part {
+ name: "btn_23";
+ type:SWALLOW;
+ description{
+ state: "default" 0.0;
+ rel1 {
+ relative: 3/5 2/4;
+ }
+ rel2 {
+ relative: 4/5 3/4;
+ }
+ fixed: 1 1;
+ }
+ }
+
+ part {
+ name: "btn_24";
+ type:SWALLOW;
+ description{
+ state: "default" 0.0;
+ rel1 {
+ relative: 4/5 2/4;
+ }
+ rel2 {
+ relative: 5/5 3/4;
+ }
+ fixed: 1 1;
+ }
+ }
+
+ part {
+ name: "btn_30";
+ type:SWALLOW;
+ description{
+ state: "default" 0.0;
+ rel1 {
+ relative: 0.0 3/4;
+ }
+ rel2 {
+ relative: 5/5 4/4;
+ }
+ fixed: 1 1;
+ }
+ }
+ }
+ }
+
+ group { "group_1";
+
+ parts {
+ part {
+ name:"panel.bg";
+ type: RECT;
+ description{
+ state: "default" 0.0;
+ rel1 {
+ relative: 0.0 0.0;
+ }
+ rel2 {
+ relative: 1.0 1.0;
+ }
+ color: 59 89 152 255;
+ }
+ }
+
+
+ part {
+ name: "btn_00";
+ type:SWALLOW;
+ description{
+ state: "default" 0.0;
+ rel1 {
+ relative: 0.0 0.0;
+ }
+ rel2 {
+ relative: 1/3 1/4;
+ }
+ fixed: 1 1;
+ }
+ }
+
+ part {
+ name: "btn_01";
+ type:SWALLOW;
+ description{
+ state: "default" 0.0;
+ rel1 {
+ relative: 1/3 0.0;
+ }
+ rel2 {
+ relative: 2/3 1/4;
+ }
+ fixed: 1 1;
+ }
+ }
+
+ part {
+ name: "btn_02";
+ type:SWALLOW;
+ description{
+ state: "default" 0.0;
+ rel1 {
+ relative: 2/3 0.0;
+ }
+ rel2 {
+ relative: 3/3 1/4;
+ }
+ fixed: 1 1;
+ }
+ }
+
+ part {
+ name: "btn_10";
+ type:SWALLOW;
+ description{
+ state: "default" 0.0;
+ rel1 {
+ relative: 0.0 1/4;
+ }
+ rel2 {
+ relative: 1/3 2/4;
+ }
+ fixed: 1 1;
+ }
+ }
+
+ part {
+ name: "btn_11";
+ type:SWALLOW;
+ description{
+ state: "default" 0.0;
+ rel1 {
+ relative: 1/3 1/4;
+ }
+ rel2 {
+ relative: 2/3 2/4;
+ }
+ fixed: 1 1;
+ }
+ }
+
+ part {
+ name: "btn_12";
+ type:SWALLOW;
+ description{
+ state: "default" 0.0;
+ rel1 {
+ relative: 2/3 1/4;
+ }
+ rel2 {
+ relative: 3/3 2/4;
+ }
+ fixed: 1 1;
+ }
+ }
+
+
+ part {
+ name: "btn_20";
+ type:SWALLOW;
+ description{
+ state: "default" 0.0;
+ rel1 {
+ relative: 0.0 2/4;
+ }
+ rel2 {
+ relative: 1/3 3/4;
+ }
+ fixed: 1 1;
+ }
+ }
+
+ part {
+ name: "btn_21";
+ type:SWALLOW;
+ description{
+ state: "default" 0.0;
+ rel1 {
+ relative: 1/3 2/4;
+ }
+ rel2 {
+ relative: 2/3 3/4;
+ }
+ fixed: 1 1;
+ }
+ }
+
+ part {
+ name: "btn_22";
+ type:SWALLOW;
+ description{
+ state: "default" 0.0;
+ rel1 {
+ relative: 2/3 2/4;
+ }
+ rel2 {
+ relative: 3/3 3/4;
+ }
+ fixed: 1 1;
+ }
+ }
+
+ part {
+ name: "btn_30";
+ type:SWALLOW;
+ description{
+ state: "default" 0.0;
+ rel1 {
+ relative: 0.0 3/4;
+ }
+ rel2 {
+ relative: 1/3 4/4;
+ }
+ fixed: 1 1;
+ }
+ }
+
+ part {
+ name: "btn_31";
+ type:SWALLOW;
+ description{
+ state: "default" 0.0;
+ rel1 {
+ relative: 1/3 3/4;
+ }
+ rel2 {
+ relative: 2/3 4/4;
+ }
+ fixed: 1 1;
+ }
+ }
+
+ part {
+ name: "btn_32";
+ type:SWALLOW;
+ description{
+ state: "default" 0.0;
+ rel1 {
+ relative: 2/3 3/4;
+ }
+ rel2 {
+ relative: 3/3 4/4;
+ }
+ fixed: 1 1;
+ }
+ }
+ }
+ }
+
+ group { "group_2";
+
+ parts {
+ part {
+ name:"panel.bg";
+ type: RECT;
+ description{
+ state: "default" 0.0;
+ rel1 {
+ relative: 0.0 0.0;
+ }
+ rel2 {
+ relative: 1.0 1.0;
+ }
+ color: 59 89 152 255;
+ }
+ }
+
+ part {
+ name: "btn_00";
+ type:SWALLOW;
+ description{
+ state: "default" 0.0;
+ rel1 {
+ relative: 0 0;
+ }
+ rel2 {
+ relative: 1 1;
+ }
+ fixed: 1 1;
+ }
+ }
+ }
+ }
+ group { name: "elm/button/base/transparent";
+ data {
+ item: "focus_highlight" "on";
+ }
+ images {
+ image: image_normal COMP;
+ }
+ script {
+ public mouse_down = 0;
+ public multi_down = 0;
+ }
+ parts {
+ part { name: "elm.swallow.content";
+ type: SWALLOW;
+ scale: 1;
+ description { state: "default" 0.0;
+ }
+ }
+ part { name: "over2";
+ type: RECT;
+ repeat_events: 1;
+ ignore_flags: ON_HOLD;
+ description { state: "default" 0.0;
+ color: 0 0 0 0;
+ }
+ }
+ part { name: "over3";
+ type: RECT;
+ repeat_events: 1;
+ description { state: "default" 0.0;
+ color: 0 0 0 0;
+ }
+ }
+ }
+ programs {
+ program { name: "button_press";
+ signal: "mouse,down,1*";
+ source: "over2";
+ script {
+ if ((get_int(multi_down) == 0) && (get_int(mouse_down) == 0))
+ {
+ set_int(mouse_down, 1);
+ emit("elm,action,press", "");
+ }
+ }
+ }
+ program { name: "button_unpress";
+ signal: "mouse,up,1*";
+ source: "over3";
+ script {
+ if (get_int(mouse_down) == 1)
+ {
+ set_int(mouse_down, 0);
+ emit("elm,action,unpress", "");
+ }
+ }
+ }
+ program { name: "button_click";
+ signal: "mouse,clicked,1";
+ source: "over2";
+ script {
+ if (get_int(multi_down) == 0) {
+ emit("elm,action,click", "");
+ }
+ }
+ }
+ program { name: "multi_down";
+ signal: "elm,action,multi,down";
+ source: "elm";
+ script {
+ set_int(multi_down, 1);
+ }
+ }
+ program {
+ name: "multi_up";
+ signal: "elm,action,multi,up";
+ source: "elm";
+ script {
+ set_int(multi_down, 0);
+ }
+ }
+ }
+ }
+
+ group { name: "elm/button/base/chucknorris";
+
+ alias: "elm/button/base/default";
+
+ parts {
+
+ part { name: "border";
+
+ type: RECT;
+
+ description { state: "default" 0.0;
+
+ color: 0 0 0 255;
+
+ }
+
+ description { state: "in" 0.0;
+
+ color: 50 180 180 255;
+
+ }
+
+ }
+
+ part { name: "base";
+
+ type: RECT;
+
+ mouse_events: 1;
+
+ description { state: "default" 0.0;
+
+ rel1.to: "border";
+
+ rel1.offset: 1 1;
+
+ rel2.to: "border";
+
+ rel2.offset: -2 -2;
+ color: 59 89 152 255;
+
+ }
+
+ description { state: "disabled" 0.0;
+
+ inherit: "default" 0.0;
+
+ color: 59 89 152 255;
+
+ }
+
+ }
+
+ part { name: "elm.swallow.content";
+
+ type: SWALLOW;
+
+ mouse_events: 0;
+
+ description { state: "default" 0.0;
+
+ fixed: 1 0;
+
+ visible: 0;
+
+ align: 0.0 0.5;
+
+ rel1.offset: 4 4;
+
+ rel2.offset: 3 -5;
+
+ rel2.relative: 0.0 1.0;
+
+ }
+
+ description { state: "visible" 0.0;
+
+ inherit: "default" 0.0;
+
+ visible: 1;
+
+ aspect: 1.0 1.0;
+
+ aspect_preference: VERTICAL;
+
+ rel2.offset: 4 -5;
+
+ }
+
+ description { state: "icononly" 0.0;
+
+ inherit: "default" 0.0;
+
+ fixed: 0 0;
+
+ visible: 1;
+
+ align: 0.5 0.5;
+
+ aspect: 1.0 1.0;
+
+ aspect_preference: VERTICAL;
+
+ rel2.offset: -5 -5;
+
+ rel2.relative: 1.0 1.0;
+
+ }
+
+ }
+
+ part { name: "elm.text";
+
+ type: TEXT;
+
+ mouse_events: 0;
+
+ scale: 1;
+
+ description { state: "default" 0.0;
+
+ visible: 0;
+
+ rel1.to_x: "elm.swallow.content";
+
+ rel1.relative: 1.0 0.0;
+
+ rel1.offset: 0 4;
+
+ rel2.offset: -5 -5;
+
+ color: 255 255 255 255;
+
+ text {
+
+ font: "Sans";
+
+ size: 10;
+
+ min: 0 0;
+
+ text_class: "button";
+
+ }
+
+ }
+
+ description { state: "visible" 0.0;
+
+ inherit: "default" 0.0;
+
+ visible: 1;
+
+ text.min: 1 1;
+
+ }
+
+ description { state: "disabled" 0.0;
+
+ inherit: "default" 0.0;
+
+ }
+
+ description { state: "disabled_visible" 0.0;
+
+ inherit: "default" 0.0;
+
+ visible: 1;
+
+ text.min: 1 1;
+
+ }
+
+ }
+
+ programs {
+
+ program { name: "button_mouse_in";
+
+ signal: "mouse,in";
+
+ source: "base";
+
+ action: STATE_SET "in" 0.0;
+
+ target: "border";
+
+ }
+
+ program { name: "button_mouse_out";
+
+ signal: "mouse,out";
+
+ source: "base";
+
+ action: STATE_SET "default" 0.0;
+
+ target: "border";
+
+ }
+
+ program { name: "button_unclick";
+
+ signal: "mouse,up,1";
+
+ source: "base";
+
+ action: SIGNAL_EMIT "elm,action,click" "";
+
+ }
+
+ program { name: "button_click";
+
+ signal: "mouse,down,1";
+
+ source: "base";
+
+ }
+
+ program { name: "text_show";
+
+ signal: "elm,state,text,visible";
+
+ source: "elm";
+
+ script {
+
+ new st[31];
+
+ new Float:vl;
+
+ get_state(PART:"elm.swallow.content", st, 30, vl);
+
+ if (!strcmp(st, "icononly"))
+
+ set_state(PART:"elm.swallow.content", "visible", 0.0);
+
+ set_state(PART:"elm.text", "visible", 0.0);
+
+ }
+
+ }
+
+ program { name: "text_hide";
+
+ signal: "elm,state,text,hidden";
+
+ source: "elm";
+
+ script {
+
+ new st[31];
+
+ new Float:vl;
+
+ get_state(PART:"elm.swallow.content", st, 30, vl);
+
+ if (!strcmp(st, "visible"))
+
+ set_state(PART:"elm.swallow.content", "icononly", 0.0);
+
+ set_state(PART:"elm.text", "default", 0.0);
+
+ }
+
+ }
+
+ program { name: "icon_show";
+
+ signal: "elm,state,icon,visible";
+
+ source: "elm";
+
+ script {
+
+ new st[31];
+
+ new Float:vl;
+
+ get_state(PART:"elm.text", st, 30, vl);
+
+ if (!strcmp(st, "visible"))
+
+ set_state(PART:"elm.swallow.content", "visible", 0.0);
+
+ else
+
+ set_state(PART:"elm.swallow.content", "icononly", 0.0);
+
+ }
+
+ }
+
+ program { name: "icon_hide";
+
+ signal: "elm,state,icon,hidden";
+
+ source: "elm";
+
+ action: STATE_SET "default" 0.0;
+
+ target: "elm.swallow.content";
+
+ }
+
+ program { name: "disable";
+
+ signal: "elm,state,disabled";
+
+ source: "elm";
+
+ action: STATE_SET "disabled" 0.0;
+
+ target: "base";
+
+ after: "disable_text";
+
+ }
+
+ program { name: "disable_text";
+
+ script {
+
+ new st[31];
+
+ new Float:vl;
+
+ get_state(PART:"elm.text", st, 30, vl);
+
+ if (!strcmp(st, "visible"))
+
+ set_state(PART:"elm.text", "disabled_visible", 0.0);
+
+ else
+
+ set_state(PART:"elm.text", "disabled", 0.0);
+
+ }
+
+ }
+
+ program { name: "enable";
+
+ signal: "elm,state,enabled";
+
+ source: "elm";
+
+ action: STATE_SET "default" 0.0;
+
+ target: "base";
+
+ after: "enable_text";
+
+ }
+
+ program { name: "enable_text";
+
+ script {
+
+ new st[31];
+
+ new Float:vl;
+
+ get_state(PART:"elm.text", st, 30, vl);
+
+ if (!strcmp(st, "disabled_visible"))
+
+ set_state(PART:"elm.text", "visible", 0.0);
+
+ else
+
+ set_state(PART:"elm.text", "default", 0.0);
+
+ }
+
+ }
+
+ }
+
+ }
+
+ }
+}
+
#include "utils/ui-utils.h"
#include "view/tbt-d2d-view.h"
#include "view/tbt-common-view.h"
-
+#include <json-glib/json-glib.h>
#include <d2d_conv_manager.h>
struct _d2d_view
Evas_Object *server_list;
Evas_Object *client_msg_list;
conv_h gl_conv_h;
- conv_device_h selected_device;
+ GList *devices_list;
};
+typedef struct _device_data{
+ d2d_view *this;
+ conv_device_h selected_device;
+}device_data;
+
typedef struct _service_data{
d2d_view *view;
conv_service_h service_handle;
int ret = conv_create(&this->gl_conv_h);
RETM_IF(ret != CONV_ERROR_NONE, "conv_create failed with error : %s", get_d2d_error(ret));
- ret = conv_discovery_start(this->gl_conv_h, 30, discovery_cb, this);/*Timeout 30 seconds*/
+ ret = conv_discovery_start(this->gl_conv_h, 90, discovery_cb, this);/*Timeout 90 seconds*/
RETM_IF(ret != CONV_ERROR_NONE, "conv_discovery_start failed with error : %s", get_d2d_error(ret));
}
static void device_selected_cb(void *data, Evas_Object *obj, void *event_info)
{
- d2d_view* this = (d2d_view*) data;
+ device_data* new_device_data = (device_data*) data;
+ d2d_view* this = new_device_data->this;
+ char* device_name;
+ conv_device_get_property_string(new_device_data->selected_device, CONV_DEVICE_NAME, &device_name);
+ DBG("%s is the device name inside device_selected_cb.", device_name );
elm_list_clear(this->server_list);
conv_device_h clone_device;
- int ret = conv_device_clone(this->selected_device, &clone_device);
+ int ret = conv_device_clone(new_device_data->selected_device, &clone_device);
RETM_IF(ret != CONV_ERROR_NONE, "conv_device_clone failed with error : %s", get_d2d_error(ret));
ret = conv_device_foreach_service(clone_device, service_foreach_cb, this);
DBG("conv_device_get_property_string failed with error : %s", get_d2d_error(ret));
DBG( "device TYPE = %s", value);
- this->selected_device = device;
+// this->selected_device = device;
+
if( device_name!=NULL)
{
- elm_list_item_append(found_device_list, device_name, NULL, NULL, device_selected_cb, this);
+ //FIX_ME
+ device_data *new_device_data = (device_data*) malloc(sizeof(device_data));
+ new_device_data->this = this;
+ new_device_data->selected_device = device;
+ this->devices_list = g_list_append(this->devices_list, (gpointer) new_device_data);
+ elm_list_item_append(found_device_list, device_name, NULL, NULL, device_selected_cb, new_device_data);
elm_list_go(found_device_list);
elm_object_part_content_set(this->view->layout, "list_container", found_device_list);
view = (d2d_view*)this;
RETM_IF(NULL == view, "view is NULL");
- conv_device_destroy(view->selected_device);
+ GList *l;
+ device_data *d;
+ for(l = view->devices_list; l != NULL; l = l->next)
+ {
+ d = (device_data*)l->data;
+ conv_device_destroy(d->selected_device);
+ SAFE_DELETE(d);
+ }
SAFE_DELETE(view->view);
SAFE_DELETE(view);