diff options
author | perepelits.m <perepelits.m@samsung.com> | 2015-02-06 13:08:03 +0200 |
---|---|---|
committer | Cedric BAIL <cedric@osg.samsung.com> | 2015-02-11 17:27:18 +0100 |
commit | 566eefd7d0e4ac70dca3f12b6ce99ae12bec7102 (patch) | |
tree | 48ee4408d8919519cdab33f7e258dfafafce4105 /src/bin/edje | |
parent | 53172c2d792b5fe18e8fe4769712f38326fbd65b (diff) |
edje: add 3D models to edje_cc.
Signed-off-by: Cedric BAIL <cedric@osg.samsung.com>
Diffstat (limited to 'src/bin/edje')
-rw-r--r-- | src/bin/edje/edje_cc_handlers.c | 96 |
1 files changed, 96 insertions, 0 deletions
diff --git a/src/bin/edje/edje_cc_handlers.c b/src/bin/edje/edje_cc_handlers.c index ab878f6bc1..7b27b4f49c 100644 --- a/src/bin/edje/edje_cc_handlers.c +++ b/src/bin/edje/edje_cc_handlers.c | |||
@@ -188,6 +188,8 @@ static void st_images_set_image_size(void); | |||
188 | static void st_images_set_image_border(void); | 188 | static void st_images_set_image_border(void); |
189 | static void st_images_set_image_border_scale_by(void); | 189 | static void st_images_set_image_border_scale_by(void); |
190 | 190 | ||
191 | static void st_models_model(void); | ||
192 | |||
191 | static void st_fonts_font(void); | 193 | static void st_fonts_font(void); |
192 | 194 | ||
193 | static void st_data_item(void); | 195 | static void st_data_item(void); |
@@ -209,6 +211,7 @@ static void st_collections_base_scale(void); | |||
209 | 211 | ||
210 | static void ob_collections_group(void); | 212 | static void ob_collections_group(void); |
211 | static void st_collections_group_name(void); | 213 | static void st_collections_group_name(void); |
214 | static void st_collections_group_scene_size(void); | ||
212 | static void st_collections_group_inherit_only(void); | 215 | static void st_collections_group_inherit_only(void); |
213 | static void st_collections_group_inherit(void); | 216 | static void st_collections_group_inherit(void); |
214 | static void st_collections_group_program_source(void); | 217 | static void st_collections_group_program_source(void); |
@@ -535,6 +538,7 @@ New_Statement_Handler statement_handlers[] = | |||
535 | {"collections.group.vibrations.sample.name", st_collections_group_vibration_sample_name}, /* dup */ | 538 | {"collections.group.vibrations.sample.name", st_collections_group_vibration_sample_name}, /* dup */ |
536 | {"collections.group.vibrations.sample.source", st_collections_group_vibration_sample_source}, /* dup */ | 539 | {"collections.group.vibrations.sample.source", st_collections_group_vibration_sample_source}, /* dup */ |
537 | {"collections.group.name", st_collections_group_name}, | 540 | {"collections.group.name", st_collections_group_name}, |
541 | {"collections.group.scene_size", st_collections_group_scene_size}, | ||
538 | {"collections.group.program_source", st_collections_group_program_source}, | 542 | {"collections.group.program_source", st_collections_group_program_source}, |
539 | {"collections.group.inherit", st_collections_group_inherit}, | 543 | {"collections.group.inherit", st_collections_group_inherit}, |
540 | {"collections.group.inherit_only", st_collections_group_inherit_only}, | 544 | {"collections.group.inherit_only", st_collections_group_inherit_only}, |
@@ -556,6 +560,7 @@ New_Statement_Handler statement_handlers[] = | |||
556 | {"collections.group.programs.target_group", st_collections_group_target_group}, /* dup */ | 560 | {"collections.group.programs.target_group", st_collections_group_target_group}, /* dup */ |
557 | IMAGE_SET_STATEMENTS("collections.group") | 561 | IMAGE_SET_STATEMENTS("collections.group") |
558 | IMAGE_STATEMENTS("collections.group.") | 562 | IMAGE_STATEMENTS("collections.group.") |
563 | {"collections.group.models.model", st_models_model}, | ||
559 | {"collections.group.font", st_fonts_font}, /* dup */ | 564 | {"collections.group.font", st_fonts_font}, /* dup */ |
560 | FONT_STYLE_CC_STATEMENTS("collections.group.") | 565 | FONT_STYLE_CC_STATEMENTS("collections.group.") |
561 | {"collections.group.parts.alias", st_collections_group_parts_alias }, | 566 | {"collections.group.parts.alias", st_collections_group_parts_alias }, |
@@ -978,6 +983,7 @@ New_Object_Handler object_handlers[] = | |||
978 | {"collections.group.set", ob_images_set}, /* dup */ | 983 | {"collections.group.set", ob_images_set}, /* dup */ |
979 | {"collections.group.set.image", ob_images_set_image}, /* dup */ | 984 | {"collections.group.set.image", ob_images_set_image}, /* dup */ |
980 | {"collections.group.images", NULL}, /* dup */ | 985 | {"collections.group.images", NULL}, /* dup */ |
986 | {"collections.group.models", NULL}, /* dup */ | ||
981 | {"collections.group.images.set", ob_images_set}, /* dup */ | 987 | {"collections.group.images.set", ob_images_set}, /* dup */ |
982 | {"collections.group.images.set.image", ob_images_set_image}, /* dup */ | 988 | {"collections.group.images.set.image", ob_images_set_image}, /* dup */ |
983 | {"collections.group.fonts", NULL}, /* dup */ | 989 | {"collections.group.fonts", NULL}, /* dup */ |
@@ -1684,6 +1690,74 @@ st_images_image(void) | |||
1684 | } | 1690 | } |
1685 | } | 1691 | } |
1686 | 1692 | ||
1693 | /** | ||
1694 | @edcsubsection{toplevel_models,model} | ||
1695 | */ | ||
1696 | |||
1697 | /** | ||
1698 | @page edcref | ||
1699 | |||
1700 | @block | ||
1701 | models | ||
1702 | @context | ||
1703 | models { | ||
1704 | model: "filename1.ext"; | ||
1705 | model: "filename2.ext"; | ||
1706 | model: "filename2.ext" 50; | ||
1707 | .. | ||
1708 | } | ||
1709 | @description | ||
1710 | The "models" block is used to list each model file that will be used in | ||
1711 | the theme. | ||
1712 | @endblock | ||
1713 | |||
1714 | @property | ||
1715 | model | ||
1716 | @parameters | ||
1717 | [model file] | ||
1718 | @effect | ||
1719 | Used to include each model file. | ||
1720 | @endproperty | ||
1721 | */ | ||
1722 | static void | ||
1723 | st_models_model(void) | ||
1724 | { | ||
1725 | Edje_Model_Directory_Entry *mdl; | ||
1726 | const char *tmp; | ||
1727 | unsigned int i; | ||
1728 | |||
1729 | check_min_arg_count(1); | ||
1730 | |||
1731 | if (!edje_file->model_dir) | ||
1732 | edje_file->model_dir = mem_alloc(SZ(Edje_Model_Directory)); | ||
1733 | |||
1734 | tmp = parse_str(0); | ||
1735 | |||
1736 | for (i = 0; i < edje_file->model_dir->entries_count; ++i) | ||
1737 | if (!strcmp(edje_file->model_dir->entries[i].entry, tmp)) | ||
1738 | { | ||
1739 | free((char*) tmp); | ||
1740 | return; | ||
1741 | } | ||
1742 | |||
1743 | edje_file->model_dir->entries_count++; | ||
1744 | mdl = realloc(edje_file->model_dir->entries, | ||
1745 | sizeof (Edje_Model_Directory_Entry) * edje_file->model_dir->entries_count); | ||
1746 | if (!mdl) | ||
1747 | { | ||
1748 | ERR("No enough memory."); | ||
1749 | exit(-1); | ||
1750 | } | ||
1751 | edje_file->model_dir->entries = mdl; | ||
1752 | memset(edje_file->model_dir->entries + edje_file->model_dir->entries_count - 1, | ||
1753 | 0, sizeof (Edje_Model_Directory_Entry)); | ||
1754 | |||
1755 | mdl = edje_file->model_dir->entries + edje_file->model_dir->entries_count - 1; | ||
1756 | |||
1757 | mdl->entry = tmp; | ||
1758 | mdl->id = edje_file->model_dir->entries_count - 1; | ||
1759 | } | ||
1760 | |||
1687 | /** @edcsubsection{toplevel_images_set, | 1761 | /** @edcsubsection{toplevel_images_set, |
1688 | * Images.Set} */ | 1762 | * Images.Set} */ |
1689 | 1763 | ||
@@ -3009,6 +3083,28 @@ st_collections_group_name(void) | |||
3009 | _group_name(parse_str(0)); | 3083 | _group_name(parse_str(0)); |
3010 | } | 3084 | } |
3011 | 3085 | ||
3086 | /** | ||
3087 | @page edcref | ||
3088 | @property | ||
3089 | scene_size | ||
3090 | @parameters | ||
3091 | [scene size] | ||
3092 | @effect | ||
3093 | Height and width of scene | ||
3094 | @endproperty | ||
3095 | */ | ||
3096 | static void | ||
3097 | st_collections_group_scene_size(void) | ||
3098 | { | ||
3099 | Edje_Part_Collection *current_pc; | ||
3100 | |||
3101 | check_arg_count(2); | ||
3102 | |||
3103 | current_pc = eina_list_data_get(eina_list_last(edje_collections)); | ||
3104 | current_pc->scene_size.width = parse_float(0); | ||
3105 | current_pc->scene_size.height = parse_float(1); | ||
3106 | } | ||
3107 | |||
3012 | typedef struct _Edje_List_Foreach_Data Edje_List_Foreach_Data; | 3108 | typedef struct _Edje_List_Foreach_Data Edje_List_Foreach_Data; |
3013 | struct _Edje_List_Foreach_Data | 3109 | struct _Edje_List_Foreach_Data |
3014 | { | 3110 | { |