static void st_images_vector(void);
static void _handle_vector_image(void);
+// TIZEN_ONLY(20150110): Add plugin keyword.
+#ifdef PLUGIN
+static void ob_plugins_plug(void);
+static void st_collections_plugins_plugin_name(void);
+static void st_collections_plugins_plugin_source(void);
+static void st_collections_plugins_plugin_param(void);
+#endif
+//
/*****/
#define STRDUP(x) eina_strdup(x)
TEXT_CLASS_STATEMENTS("collections.")
SIZE_CLASS_STATEMENTS("collections.")
{"collections.base_scale", st_collections_base_scale},
+// TIZEN_ONLY(20150110): Add plugins keyword.
+#ifdef PLUGIN
+ {"collections.plugins.plugin.name", st_collections_plugins_plugin_name},
+ {"collections.plugins.plugin.source", st_collections_plugins_plugin_source},
+ {"collections.plugins.plugin.param", st_collections_plugins_plugin_param},
+ {"collections.group.plugins.plugin.name", st_collections_plugins_plugin_name}, /* dup */
+ {"collections.group.plugins.plugin.source", st_collections_plugins_plugin_source}, /* dup */
+ {"collections.group.plugins.plugin.param", st_collections_plugins_plugin_param}, /* dup */
+#endif
+//
{"collections.translation.file.locale", st_collections_group_translation_file_locale},
{"collections.translation.file.source", st_collections_group_translation_file_source},
{"collections.group.translation.file.locale", st_collections_group_translation_file_locale},
{"collections.text_classes.text_class", ob_text_class}, /* dup */
{"collections.size_classes", NULL}, /* dup */
{"collections.size_classes.size_class", ob_size_class}, /* dup */
+// TIZEN_ONLY(20150110): Add plugins keyword.
+#ifdef PLUGIN
+ {"collections.plugins", NULL}, /* dup */
+ {"collections.plugins.plugin", ob_plugins_plug}, /* dup */
+ {"collections.group.plugins", NULL}, /* dup */
+ {"collections.group.plugins.plugin", ob_plugins_plug}, /* dup */
+#endif
+//
{"collections.sounds", NULL},
{"collections.group.sounds", NULL}, /* dup */
{"collections.sounds.sample", NULL},
ep->tween.v4 = ep2->tween.v4;
ep->tween.use_duration_factor = ep2->tween.use_duration_factor;
ep->sample_name = STRDUP(ep2->sample_name);
+// TIZEN_ONLY(20150110): Add plugins keyword.
+#ifdef PLUGIN
+ ep->plugin_name = STRDUP(ep2->plugin_name);
+#endif
+//
ep->tone_name = STRDUP(ep2->tone_name);
ep->duration = ep2->duration;
ep->speed = ep2->speed;
check_arg_count(1);
}
+////////////////////////////////////////////////////////////
+// TIZEN_ONLY(20150110): Add plugin keyword.
+////////////////////////////////////////////////////////////
+#ifdef PLUGIN
+static void
+ob_plugins_plug(void)
+{
+ Edje_Plugin *plug;
+
+ plug = mem_alloc(SZ(Edje_Plugin));
+ edje_file->plugins = eina_list_append(edje_file->plugins, plug);
+}
+
+static void
+st_collections_plugins_plugin_source(void)
+{
+ Edje_Plugin *plug;
+
+ check_arg_count(1);
+ plug = eina_list_data_get(eina_list_last(edje_file->plugins));
+ if (plug->source)
+ {
+ ERR("parse error %s:%i. There is already a basic source for the plugin: %s",
+ file_in, line - 1, plug->name);
+ exit(-1);
+ }
+ plug->source = parse_str(0);
+}
+
+static void
+st_collections_plugins_plugin_param(void)
+{
+ Edje_Plugin *plug;
+
+ check_arg_count(1);
+ plug = eina_list_data_get(eina_list_last(edje_file->plugins));
+ if (plug->param)
+ {
+ ERR("parse error %s:%i. There is already a basic param for the plugin: %s",
+ file_in, line - 1, plug->name);
+ exit(-1);
+ }
+ plug->param = parse_str(0);
+}
+
+static void
+st_collections_plugins_plugin_name(void)
+{
+ Edje_Plugin *plug, *tplug;
+ Eina_List *l;
+
+ check_arg_count(1);
+ plug = eina_list_data_get(eina_list_last(edje_file->plugins));
+ plug->name = parse_str(0);
+ EINA_LIST_FOREACH(edje_file->plugins, l, tplug)
+ {
+ if (plug->name && tplug->name && (plug != tplug) && (!strcmp(plug->name, tplug->name)))
+ {
+ ERR("parse error %s:%i. There is already a style named \"%s\"",
+ file_in, line - 1, plug->name);
+ exit(-1);
+ }
+ }
+}
+#endif
+//////////////////////////////////////////////////////////////
+
/**
@page edcref
@property
@li PARAM_COPY "src_part" "src_param" "dst_part" "dst_param"
@li PARAM_SET "part" "param" "value"
@li PLAY_SAMPLE "sample name" speed (channel)
+// TIZEN_ONLY(20150110): Add plugin keyword.
+ @li RUN_PLUGIN "plugin name"
+//
@li PLAY_TONE "tone name" duration_in_seconds( Range 0.1 to 10.0 )
@li PLAY_VIBRATION "sample name" repeat (repeat count)
@li PHYSICS_IMPULSE 10 -23.4 0
"PHYSICS_STOP", EDJE_ACTION_TYPE_PHYSICS_STOP,
"PHYSICS_ROT_SET", EDJE_ACTION_TYPE_PHYSICS_ROT_SET,
"PLAY_VIBRATION", EDJE_ACTION_TYPE_VIBRATION_SAMPLE,
+ // TIZEN_ONLY(20150110): Add plugin keyword.
+#ifdef PLUGIN
+ "RUN_PLUGIN", EDJE_ACTION_TYPE_RUN_PLUGIN,
+#endif
+ //
NULL);
if (ep->action == EDJE_ACTION_TYPE_STATE_SET)
{
}
ep->duration = parse_float_range(2, 0.1, 10.0);
}
+// TIZEN_ONLY(20150110): Add plugin keyword.
+#ifdef PLUGIN
+ else if (ep->action == EDJE_ACTION_TYPE_RUN_PLUGIN)
+ {
+ ep->plugin_name = parse_str(1);
+ }
+#endif
+//
else if (ep->action == EDJE_ACTION_TYPE_VIBRATION_SAMPLE)
{
ep->vibration_name = parse_str(1);
case EDJE_ACTION_TYPE_FOCUS_OBJECT:
check_min_arg_count(1);
break;
+// TIZEN_ONLY(20150110): Add plugin keyword.
+#ifdef PLUGIN
+ case EDJE_ACTION_TYPE_RUN_PLUGIN:
+ check_arg_count(2);
+ break;
+#endif
+//
default:
check_arg_count(3);
}
EDJE_TWEEN_MODE_OPT_FROM_CURRENT = (1 << 31) /**< Options from current tween mode value */
} Edje_Tween_Mode;
+// TIZEN_ONLY(20150110): Add plugin keyword.
+#define PLUGIN
+//
+
/**
* @typedef Edje_Action_Type
*
EDJE_ACTION_TYPE_PHYSICS_STOP = 22, /**< @since 1.8 @brief Physics stop action value */
EDJE_ACTION_TYPE_PHYSICS_ROT_SET = 23, /**< @since 1.8 @brief Physics rotation set action value */
EDJE_ACTION_TYPE_VIBRATION_SAMPLE = 24, /**< @since 1.10 @brief vibration sample action value */
+ // TIZEN_ONLY(20150110): Add plugin keyword.
+ //EDJE_ACTION_TYPE_MO = 25, /**< @since 1.15 @brief Mo action value */
+ //EDJE_ACTION_TYPE_LAST = 26 /**< Last action value */
+#ifdef PLUGIN
+ EDJE_ACTION_TYPE_RUN_PLUGIN = 25,
+ EDJE_ACTION_TYPE_MO = 26, /**< @since 1.15 @brief Mo action value */
+ EDJE_ACTION_TYPE_LAST = 27
+#else
EDJE_ACTION_TYPE_MO = 25, /**< @since 1.15 @brief Mo action value */
EDJE_ACTION_TYPE_LAST = 26 /**< Last action value */
+#endif
} Edje_Action_Type;
/**
*/
EAPI Eina_Bool edje_edit_program_stop_all(Evas_Object *obj);
+// TIZEN_ONLY(20170421): Add plugin keyword.
+#ifdef PLUGIN
+
+/** Get the list of all plugins.
+ * Use edje_edit_string_list_free() when you don't need the list anymore.
+ *
+ * @param obj Object being edited.
+ *
+ * @if MOBILE @since_tizen 3.0
+ * @elseif WEARABLE @since_tizen 3.0
+ * @endif
+ *
+ * @return A List containing all plugins found inside of given set in the edje file.
+ */
+EAPI Eina_List *
+edje_edit_plugins_list_get(Evas_Object *obj);
+
+/** Get plugin name of the program.
+ *
+ * @param obj Object being edited.
+ * @param prog The name of the program.
+ *
+ * @if MOBILE @since_tizen 3.0
+ * @elseif WEARABLE @since_tizen 3.0
+ * @endif
+ *
+ * @return const char* plugin name on success, NULL otherwise.
+ */
+EAPI const char *
+edje_edit_program_plugin_get(Evas_Object *obj, const char *prog);
+/** Set plugin name of the program.
+ *
+ * @param obj Object being edited.
+ * @param prog The name of the program.
+ * @param name The name of the plugin.
+ *
+ * @if MOBILE @since_tizen 3.0
+ * @elseif WEARABLE @since_tizen 3.0
+ * @endif
+ *
+ * @return @c EINA_TRUE in case of success, @c EINA_FALSE otherwise.
+ */
+EAPI Eina_Bool
+edje_edit_program_plugin_set(Evas_Object *obj, const char *prog, const char *name);
+#endif
+
+
+
/**
* @brief Sets parts into intermediate state of programs transition.
*
EAPI Eet_Data_Descriptor * _edje_edd_edje_part_collection = NULL;
Eet_Data_Descriptor *_edje_edd_edje_string = NULL;
+// TIZEN_ONLY(20150110): Add plugin keyword.
+#ifdef PLUGIN
+Eet_Data_Descriptor *_edje_edd_edje_plugin = NULL;
+#endif
+//
Eet_Data_Descriptor *_edje_edd_edje_style = NULL;
Eet_Data_Descriptor *_edje_edd_edje_style_tag = NULL;
Eet_Data_Descriptor *_edje_edd_edje_color_tree_node = NULL;
_edje_edd_shutdown(void)
{
FREED(_edje_edd_edje_string);
+ // TIZEN_ONLY(20150110): Add plugin keyword.
+#ifdef PLUGIN
+ FREED(_edje_edd_edje_plugin);
+#endif
+ //
FREED(_edje_edd_edje_style);
FREED(_edje_edd_edje_style_tag);
FREED(_edje_edd_edje_color_class);
EET_DATA_DESCRIPTOR_ADD_BASIC(_edje_edd_edje_style, Edje_Style, "name", name, EET_T_STRING);
EET_DATA_DESCRIPTOR_ADD_LIST(_edje_edd_edje_style, Edje_Style, "tags", tags, _edje_edd_edje_style_tag);
+ // TIZEN_ONLY(20150110): Add plugin keyword.
+#ifdef PLUGIN
+ /* Plugin */
+ EET_EINA_FILE_DATA_DESCRIPTOR_CLASS_SET(&eddc, Edje_Plugin);
+ _edje_edd_edje_plugin =
+ eet_data_descriptor_file_new(&eddc);
+ EET_DATA_DESCRIPTOR_ADD_BASIC(_edje_edd_edje_plugin, Edje_Plugin, "name", name, EET_T_STRING);
+ EET_DATA_DESCRIPTOR_ADD_BASIC(_edje_edd_edje_plugin, Edje_Plugin, "source", source, EET_T_STRING);
+ EET_DATA_DESCRIPTOR_ADD_BASIC(_edje_edd_edje_plugin, Edje_Plugin, "param", param, EET_T_STRING);
+#endif
+ //
+
EET_EINA_FILE_DATA_DESCRIPTOR_CLASS_SET(&eddc, Edje_Color_Tree_Node);
_edje_edd_edje_color_tree_node =
eet_data_descriptor_file_new(&eddc);
EET_DATA_DESCRIPTOR_ADD_SUB(_edje_edd_edje_file, Edje_File, "image_dir", image_dir, _edje_edd_edje_image_directory);
EET_DATA_DESCRIPTOR_ADD_SUB(_edje_edd_edje_file, Edje_File, "model_dir", model_dir, _edje_edd_edje_model_directory);
EET_DATA_DESCRIPTOR_ADD_SUB(_edje_edd_edje_file, Edje_File, "sound_dir", sound_dir, _edje_edd_edje_sound_directory);
+ // TIZEN_ONLY(20150110): Add plugin keyword.
+#ifdef PLUGIN
+ EET_DATA_DESCRIPTOR_ADD_LIST(_edje_edd_edje_file, Edje_File, "plugins", plugins, _edje_edd_edje_plugin);
+#endif
+ //
EET_DATA_DESCRIPTOR_ADD_SUB(_edje_edd_edje_file, Edje_File, "mo_dir", mo_dir, _edje_edd_edje_mo_directory);
EET_DATA_DESCRIPTOR_ADD_SUB(_edje_edd_edje_file, Edje_File, "filter_dir", filter_dir, _edje_edd_edje_filter_directory);
EET_DATA_DESCRIPTOR_ADD_BASIC(_edje_edd_edje_program, Edje_Program, "in.range", in.range, EET_T_DOUBLE);
EET_DATA_DESCRIPTOR_ADD_BASIC(_edje_edd_edje_program, Edje_Program, "action", action, EET_T_INT);
+ // TIZEN_ONLY(20150119): Fix to load module for plugin.
+ EET_DATA_DESCRIPTOR_ADD_BASIC(_edje_edd_edje_program, Edje_Program, "plugin_name", plugin_name, EET_T_STRING);
+ //
EET_DATA_DESCRIPTOR_ADD_BASIC(_edje_edd_edje_program, Edje_Program, "sample_name", sample_name, EET_T_STRING);
EET_DATA_DESCRIPTOR_ADD_BASIC(_edje_edd_edje_program, Edje_Program, "tone_name", tone_name, EET_T_STRING);
EET_DATA_DESCRIPTOR_ADD_BASIC(_edje_edd_edje_program, Edje_Program, "duration", duration, EET_T_DOUBLE);
epr->channel = EDJE_CHANNEL_EFFECT;
epr->tone_name = NULL;
epr->duration = 0.1;
+// TIZEN_ONLY(20170421): Add plugin keyword.
+#ifdef PLUGIN
+ epr->plugin_name = NULL;
+#endif
//Update table_programs
ed->collection->patterns.table_programs_size++;
_edje_if_string_free(ed, &epr->state2);
_edje_if_string_free(ed, &epr->sample_name);
_edje_if_string_free(ed, &epr->tone_name);
+// TIZEN_ONLY(20170421): Add plugin keyword.
+#ifdef PLUGIN
+ _edje_if_string_free(ed, &epr->plugin_name);
+#endif
EINA_LIST_FREE(epr->targets, prt)
free(prt);
return EINA_TRUE;
}
+// TIZEN_ONLY(20170421): Add plugin keyword.
+#ifdef PLUGIN
+EAPI Eina_List *
+edje_edit_plugins_list_get(Evas_Object *obj)
+{
+ Eina_List *plugins = NULL, *l;
+ Edje_Plugin *plg= NULL;
+
+ GET_ED_OR_RETURN(NULL);
+
+ if (!ed->file) return NULL;
+ if (!ed->file->plugins) return NULL;
+
+ EINA_LIST_FOREACH(ed->file->plugins, l, plg)
+ {
+ plugins = eina_list_append(plugins, eina_stringshare_add(plg->name));
+ }
+
+ return plugins;
+}
+
+EAPI const char *
+edje_edit_program_plugin_get(Evas_Object *obj, const char *prog)
+{
+ GET_EPR_OR_RETURN(NULL);
+
+ if (!epr->plugin_name) return NULL;
+ return eina_stringshare_add(epr->plugin_name);
+}
+
+EAPI Eina_Bool
+edje_edit_program_plugin_set(Evas_Object *obj, const char *prog, const char *name)
+{
+ GET_ED_OR_RETURN(EINA_FALSE);
+ GET_EPR_OR_RETURN(EINA_FALSE);
+
+ if (!name) return EINA_FALSE;
+
+ _edje_if_string_replace(ed, &epr->plugin_name, name);
+
+ return EINA_TRUE;
+}
+#endif
+
EAPI Eina_Bool
edje_edit_program_transition_state_set(Evas_Object *obj, const char *prog, double position)
{
free(edf->vibration_dir);
}
+
+ // TIZEN_ONLY(20150110): Add plugin keyword.
+#ifdef PLUGIN
+ Edje_Plugin *plugin;
+ EINA_LIST_FREE(edf->plugins, plugin)
+ {
+ if (edf->free_strings)
+ {
+ if (plugin->name) eina_stringshare_del(plugin->name);
+ if (plugin->source) eina_stringshare_del(plugin->source);
+ if (plugin->param)eina_stringshare_del(plugin->param);
+ }
+ free(plugin);
+ }
+#endif
+ //
if (edf->mo_dir)
{
unsigned int i;
if (pr->sample_name) eina_stringshare_del(pr->sample_name);
if (pr->tone_name) eina_stringshare_del(pr->tone_name);
if (pr->seat) eina_stringshare_del(pr->seat);
+ // TIZEN_ONLY(20150110): Add plugin keyword.
+#ifdef PLUGIN
+ if (pr->plugin_name) eina_stringshare_del(pr->plugin_name);
+#endif
+ //
}
EINA_LIST_FREE(pr->targets, prt)
free(prt);
Edje_Gfx_Filter_Directory *filter_dir;
Eina_List *styles;
+ // TIZEN_ONLY(20150110): Add plugin keyword.
+#ifdef PLUGIN
+ Eina_List *plugins;
+#endif
+ //
Eina_List *color_tree;
Eina_Hash *color_tree_hash;
int id; /* the id no. of the image */
};
+// TIZEN_ONLY(20150110): Add plugin keyword.
+#ifdef PLUGIN
+struct _Edje_Plugin /*External Plugin*/
+{
+ const char *name; /* the name of the plugin */
+ const char *source; /* the source of the plugin */
+ const char *param;
+};
+#endif
+//
+
struct _Edje_Sound_Sample /*Sound Sample*/
{
const char *name; /* the nominal name of the sound */
const char *source; /* if part that emitted this (name) matches this glob */
const char *sample_name;
const char *tone_name;
+ // TIZEN_ONLY(20150110): Add plugin keyword.
+#ifdef PLUGIN
+ const char *plugin_name;
+#endif
+ //
const char *vibration_name;
double duration;
double speed;
EAPI extern Eet_Data_Descriptor *_edje_edd_edje_file;
EAPI extern Eet_Data_Descriptor *_edje_edd_edje_part_collection;
+// TIZEN_ONLY(20150110): Add plugin keyword.
+#ifdef PLUGIN
+EAPI extern Eet_Data_Descriptor *_edje_edd_edje_plugin;
+#endif
+//
extern Eina_List *_edje_animators;
extern Eina_Inlist *_edje_edjes;
void edje_signal_init(void);
void edje_signal_shutdown(void);
+// TIZEN_ONLY(20150110): Add plugin keyword.
+#ifdef PLUGIN
+typedef Eina_Bool (*Edje_Module_Plugin_Run) (const Evas_Object *obj, const char *name, const char *param);
+#endif
+//
+
Eina_Bool _edje_real_part_mouse_events_get(Edje *ed, Edje_Real_Part *rp);
void _edje_real_part_mouse_events_set(Edje *ed, Edje_Real_Part *rp, Eina_Bool mouse_events);
Eina_Bool _edje_real_part_repeat_events_get(Edje *ed, Edje_Real_Part *rp);
goto break_prog;
_edje_multisense_internal_sound_tone_play(ed, pr->tone_name, pr->duration, pr->channel);
break;
-
+ // TIZEN_ONLY(20150110): Add plugin keyword.
+#ifdef PLUGIN
+ case EDJE_ACTION_TYPE_RUN_PLUGIN:
+ // TIZEN_ONLY(20150119): Fix to load module for plugin.
+ if (_edje_block_break(ed))
+ {
+ goto break_prog;
+ }
+ Eina_List *l;
+ Edje_Plugin *p;
+ EINA_LIST_FOREACH(ed->file->plugins, l, p)
+ {
+ if (pr->plugin_name && p->name && !strcmp(pr->plugin_name, p->name)
+ && p->source)
+ {
+ Eina_Module *mod;
+ mod = _edje_module_handle_load(p->source);
+ if (!mod)
+ {
+ WRN("moudle could not be loaded: %s", p->source);
+ break;
+ }
+ Edje_Module_Plugin_Run run_cb;
+ run_cb = eina_module_symbol_get(mod, "edje_plugin_run");
+ if (!run_cb)
+ {
+ WRN("plugin module does not have edje_plugin_run function");
+ break;
+ }
+ else
+ if (!run_cb(ed->obj, p->name, p->param)) WRN("edje plugin run failed");
+ }
+ }
+ //
+ break;
+#endif
+ //
case EDJE_ACTION_TYPE_VIBRATION_SAMPLE:
if (_edje_block_break(ed))
goto break_prog;