aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--data/modgrid.edc58
-rw-r--r--data/synthpod.edc3
-rw-r--r--lib/synthpod_ui.c196
3 files changed, 99 insertions, 158 deletions
diff --git a/data/modgrid.edc b/data/modgrid.edc
index 476150fa..11a30c7f 100644
--- a/data/modgrid.edc
+++ b/data/modgrid.edc
@@ -15,68 +15,12 @@
* http://www.perlfoundation.org/artistic_license_2_0.
*/
-images {
- image: "module_border.png" COMP;
-}
-
group {
name: "elm/gengrid/item/synthpod/default";
- data.item: "texts" "elm.text";
data.item: "contents" "elm.swallow.content";
parts {
part {
- name: "clip";
- type: RECT;
- mouse_events: 0;
- description { state: "default" 0.00; fixed: 1 1; color: COL00; }
- }
- part {
- name: "text.bg";
- type: RECT;
- mouse_events: 1;
- clip_to: "clip";
- description {
- state: "default" 0.0;
- rel1.to: "text.border";
- rel2.to: "text.border";
- color: 48 48 48 255;
- }
- }
- part {
- name: "text.border";
- type: IMAGE;
- mouse_events: 0;
- clip_to: "clip";
- description {
- state: "default" 0.0;
- rel2.relative: 1 0;
- rel2.offset: 0 24;
- image {
- normal: "module_border.png";
- border: 6 6 6 6;
- middle: 0;
- }
- }
- }
- part {
- name: "elm.text";
- type: TEXT;
- mouse_events: 0;
- scale: 1;
- description {
- state: "default" 0.0;
- rel1.to: "text.border";
- rel1.offset: 6 0; // from text.border
- rel2.to: "text.border";
- text {
- text: "hello";
- size: 10;
- align: 0.0 0.5;
- }
- }
- }
- part {
name: "elm.swallow.content";
type: SWALLOW;
mouse_events: 1;
@@ -84,8 +28,6 @@ group {
description {
state: "default" 0.0;
fixed: 1 1;
- rel1.to_y: "elm.text";
- rel1.relative: 0 1;
}
}
}
diff --git a/data/synthpod.edc b/data/synthpod.edc
index 03c76111..2fab4609 100644
--- a/data/synthpod.edc
+++ b/data/synthpod.edc
@@ -17,8 +17,7 @@
#if 1
#define COLORS_MAX "20"
-//#define COL00 0 0 0 255 // Black
-#define COL00 64 64 64 255 // Black
+#define COL00 0 0 0 255 // Black
#define COL01 255 179 0 255 // Vivid Yellow
#define COL02 128 62 117 255 // Strong Purple
#define COL03 255 104 0 255 // Vivid Orange
diff --git a/lib/synthpod_ui.c b/lib/synthpod_ui.c
index b5423f82..6ff38dc7 100644
--- a/lib/synthpod_ui.c
+++ b/lib/synthpod_ui.c
@@ -5324,17 +5324,6 @@ _modgrid_mouse_out(void *data, Evas *e, Evas_Object *obj, void *event_info)
elm_scroller_movement_block_set(ui->modgrid, ELM_SCROLLER_MOVEMENT_NO_BLOCK);
}
-static char *
-_modgrid_label_get(void *data, Evas_Object *obj, const char *part)
-{
- mod_t *mod = data;
-
- if(strcmp(part, "elm.text"))
- return NULL;
-
- return strdup(mod->name);
-}
-
static Evas_Object *
_modgrid_content_get(void *data, Evas_Object *obj, const char *part)
{
@@ -5344,106 +5333,117 @@ _modgrid_content_get(void *data, Evas_Object *obj, const char *part)
if(strcmp(part, "elm.swallow.content"))
return NULL;
- Evas_Object *modlist = elm_genlist_add(obj);
- if(modlist)
- {
- elm_genlist_homogeneous_set(modlist, EINA_TRUE); // needef for lazy-loading
- elm_genlist_mode_set(modlist, ELM_LIST_LIMIT);
- elm_genlist_block_count_set(modlist, 64); // needef for lazy-loading
- //elm_genlist_select_mode_set(modlist, ELM_OBJECT_SELECT_MODE_NONE);
- elm_genlist_reorder_mode_set(modlist, EINA_FALSE);
- evas_object_smart_callback_add(modlist, "expand,request",
- _list_expand_request, ui);
- evas_object_smart_callback_add(modlist, "contract,request",
- _list_contract_request, ui);
- evas_object_smart_callback_add(modlist, "expanded",
- _modgrid_expanded, ui);
- evas_object_smart_callback_add(modlist, "contracted",
- _modgrid_contracted, ui);
- evas_object_smart_callback_add(modlist, "activated",
- _modgrid_activated, ui);
- evas_object_data_set(modlist, "ui", ui);
- evas_object_size_hint_weight_set(modlist, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
- evas_object_size_hint_align_set(modlist, EVAS_HINT_FILL, EVAS_HINT_FILL);
- evas_object_show(modlist);
- mod->std.list = modlist;
-
- // port groups
- mod->groups = eina_hash_string_superfast_new(NULL); //TODO check
-
- // port entries
- for(unsigned i=0; i<mod->num_ports; i++)
- {
- port_t *port = &mod->ports[i];
-
- Elm_Object_Item *parent;
- group_t *group;
-
- if(port->group)
- {
- const char *group_lbl = lilv_node_as_string(port->group);
- group = _mod_group_get(mod, group_lbl, GROUP_TYPE_PORT, port->group, &parent, false);
- }
- else
+ Evas_Object *frame = elm_frame_add(obj);
+ if(frame)
+ {
+ elm_object_text_set(frame, mod->name);
+ evas_object_size_hint_weight_set(frame, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
+ evas_object_size_hint_align_set(frame, EVAS_HINT_FILL, EVAS_HINT_FILL);
+ evas_object_show(frame);
+ evas_object_show(frame);
+
+ Evas_Object *modlist = elm_genlist_add(frame);
+ if(modlist)
+ {
+ elm_genlist_homogeneous_set(modlist, EINA_TRUE); // needef for lazy-loading
+ elm_genlist_mode_set(modlist, ELM_LIST_LIMIT);
+ elm_genlist_block_count_set(modlist, 64); // needef for lazy-loading
+ //elm_genlist_select_mode_set(modlist, ELM_OBJECT_SELECT_MODE_NONE);
+ elm_genlist_reorder_mode_set(modlist, EINA_FALSE);
+ evas_object_smart_callback_add(modlist, "expand,request",
+ _list_expand_request, ui);
+ evas_object_smart_callback_add(modlist, "contract,request",
+ _list_contract_request, ui);
+ evas_object_smart_callback_add(modlist, "expanded",
+ _modgrid_expanded, ui);
+ evas_object_smart_callback_add(modlist, "contracted",
+ _modgrid_contracted, ui);
+ evas_object_smart_callback_add(modlist, "activated",
+ _modgrid_activated, ui);
+ evas_object_data_set(modlist, "ui", ui);
+ evas_object_size_hint_weight_set(modlist, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
+ evas_object_size_hint_align_set(modlist, EVAS_HINT_FILL, EVAS_HINT_FILL);
+ evas_object_show(modlist);
+ elm_object_content_set(frame, modlist);
+ mod->std.list = modlist;
+
+ // port groups
+ mod->groups = eina_hash_string_superfast_new(NULL); //TODO check
+
+ // port entries
+ for(unsigned i=0; i<mod->num_ports; i++)
{
- const char *group_lbl = "*Ungrouped*";
- group = _mod_group_get(mod, group_lbl, GROUP_TYPE_PORT, NULL, &parent, false);
- }
+ port_t *port = &mod->ports[i];
- // append port to corresponding group
- if(group)
- group->children = eina_list_append(group->children, port);
- }
+ Elm_Object_Item *parent;
+ group_t *group;
- {
- const char *group_lbl = "*Properties*";
- Elm_Object_Item *parent;
- group_t *group = _mod_group_get(mod, group_lbl, GROUP_TYPE_PROPERTY, NULL, &parent, false);
+ if(port->group)
+ {
+ const char *group_lbl = lilv_node_as_string(port->group);
+ group = _mod_group_get(mod, group_lbl, GROUP_TYPE_PORT, port->group, &parent, false);
+ }
+ else
+ {
+ const char *group_lbl = "*Ungrouped*";
+ group = _mod_group_get(mod, group_lbl, GROUP_TYPE_PORT, NULL, &parent, false);
+ }
- Eina_List *l;
- property_t *prop;
- EINA_LIST_FOREACH(mod->static_properties, l, prop)
- {
- // append property to corresponding group
+ // append port to corresponding group
if(group)
- group->children = eina_list_append(group->children, prop);
+ group->children = eina_list_append(group->children, port);
}
- }
- // presets //FIXME put in vbox
- Elm_Object_Item *elmnt = elm_genlist_item_sorted_insert(mod->std.list, ui->psetitc, mod, NULL,
- ELM_GENLIST_ITEM_TREE, _grpitc_cmp, NULL, NULL);
- elm_genlist_item_select_mode_set(elmnt, ELM_OBJECT_SELECT_MODE_DEFAULT);
+ {
+ const char *group_lbl = "*Properties*";
+ Elm_Object_Item *parent;
+ group_t *group = _mod_group_get(mod, group_lbl, GROUP_TYPE_PROPERTY, NULL, &parent, false);
- // expand all groups by default
- eina_hash_foreach(mod->groups, _groups_foreach, ui);
+ Eina_List *l;
+ property_t *prop;
+ EINA_LIST_FOREACH(mod->static_properties, l, prop)
+ {
+ // append property to corresponding group
+ if(group)
+ group->children = eina_list_append(group->children, prop);
+ }
+ }
- // request all properties
- size_t len = sizeof(transfer_patch_get_t);
- for(unsigned index=0; index<mod->num_ports; index++)
- {
- port_t *port = &mod->ports[index];
+ // presets //FIXME put in vbox
+ Elm_Object_Item *elmnt = elm_genlist_item_sorted_insert(mod->std.list, ui->psetitc, mod, NULL,
+ ELM_GENLIST_ITEM_TREE, _grpitc_cmp, NULL, NULL);
+ elm_genlist_item_select_mode_set(elmnt, ELM_OBJECT_SELECT_MODE_DEFAULT);
- // only consider event ports which support patch:Message
- if( (port->buffer_type != PORT_BUFFER_TYPE_SEQUENCE)
- || (port->direction != PORT_DIRECTION_INPUT)
- || !port->patchable)
- {
- continue; // skip
- }
+ // expand all groups by default
+ eina_hash_foreach(mod->groups, _groups_foreach, ui);
- transfer_patch_get_all_t *trans = _sp_ui_to_app_request(ui, len);
- if(trans)
+ // request all properties
+ size_t len = sizeof(transfer_patch_get_t);
+ for(unsigned index=0; index<mod->num_ports; index++)
{
- _sp_transfer_patch_get_all_fill(&ui->regs,
- &ui->forge, trans, mod->uid, index,
- mod->subject);
- _sp_ui_to_app_advance(ui, len);
+ port_t *port = &mod->ports[index];
+
+ // only consider event ports which support patch:Message
+ if( (port->buffer_type != PORT_BUFFER_TYPE_SEQUENCE)
+ || (port->direction != PORT_DIRECTION_INPUT)
+ || !port->patchable)
+ {
+ continue; // skip
+ }
+
+ transfer_patch_get_all_t *trans = _sp_ui_to_app_request(ui, len);
+ if(trans)
+ {
+ _sp_transfer_patch_get_all_fill(&ui->regs,
+ &ui->forge, trans, mod->uid, index,
+ mod->subject);
+ _sp_ui_to_app_advance(ui, len);
+ }
}
- }
- } // modlist
+ } // modlist
+ }
- return modlist;
+ return frame;
}
static void
@@ -6736,7 +6736,7 @@ sp_ui_new(Evas_Object *win, const LilvWorld *world, sp_ui_driver_t *driver,
if(ui->griditc)
{
ui->griditc->item_style = "synthpod";
- ui->griditc->func.text_get = _modgrid_label_get;
+ ui->griditc->func.text_get = NULL;
ui->griditc->func.content_get = _modgrid_content_get;
ui->griditc->func.state_get = NULL;
ui->griditc->func.del = _modgrid_del;