* <li>@ref sec_collections_group_programs "Programs"</li>
* <ul>
* <li>@ref sec_collections_group_script "Script"</li>
+ * <li>@ref sec_collections_group_program_sequence "Sequence"</li>
* </ul>
* <li>@ref sec_collections_group_physics "Physics"</li>
* <ul>
static Edje_Part_Description_Common *parent_desc = NULL;
static Edje_Program *current_program = NULL;
static Eina_Bool current_group_inherit = EINA_FALSE;
+static Edje_Program *sequencing = NULL;
struct _Edje_Cc_Handlers_Hierarchy_Info
{ /* Struct that keeps globals value to impl hierarchy */
static void st_collections_group_programs_program_after(void);
static void st_collections_group_programs_program_api(void);
+static void ob_collections_group_programs_program_sequence(void);
+
static void ob_collections_group_programs_program_script(void);
static void st_collections_group_sound_sample_name(void);
static void st_collections_group_sound_sample_source(void);
#define PROGRAM_BASE(PREFIX) \
{PREFIX".program.name", st_collections_group_programs_program_name}, /* dup */ \
+ {PREFIX".program.sequence.name", st_collections_group_programs_program_name}, /* dup */ \
{PREFIX".program.signal", st_collections_group_programs_program_signal}, /* dup */ \
+ {PREFIX".program.sequence.signal", st_collections_group_programs_program_signal}, /* dup */ \
{PREFIX".program.source", st_collections_group_programs_program_source}, /* dup */ \
+ {PREFIX".program.sequence.source", st_collections_group_programs_program_source}, /* dup */ \
{PREFIX".program.in", st_collections_group_programs_program_in}, /* dup */ \
+ {PREFIX".program.sequence.in", st_collections_group_programs_program_in}, /* dup */ \
{PREFIX".program.action", st_collections_group_programs_program_action}, /* dup */ \
+ {PREFIX".program.sequence.action", st_collections_group_programs_program_action}, /* dup */ \
{PREFIX".program.transition", st_collections_group_programs_program_transition}, /* dup */ \
+ {PREFIX".program.sequence.transition", st_collections_group_programs_program_transition}, /* dup */ \
{PREFIX".program.target", st_collections_group_programs_program_target}, /* dup */ \
+ {PREFIX".program.sequence.target", st_collections_group_programs_program_target}, /* dup */ \
{PREFIX".program.targets", st_collections_group_programs_program_targets}, /* dup */ \
+ {PREFIX".program.sequence.targets", st_collections_group_programs_program_targets}, /* dup */ \
{PREFIX".program.after", st_collections_group_programs_program_after}, /* dup */ \
+ {PREFIX".program.sequence.after", st_collections_group_programs_program_after}, /* dup */ \
{PREFIX".program.api", st_collections_group_programs_program_api}, /* dup */ \
- {PREFIX".program.filter", st_collections_group_programs_program_filter}, /* dup */
+ {PREFIX".program.sequence.api", st_collections_group_programs_program_api}, /* dup */ \
+ {PREFIX".program.filter", st_collections_group_programs_program_filter}, /* dup */ \
+ {PREFIX".program.sequence.filter", st_collections_group_programs_program_filter}, /* dup */
#define PROGRAM_STATEMENTS(PREFIX) \
IMAGE_SET_STATEMENTS(PREFIX".programs") \
#define PROGRAM_OBJECTS(PREFIX) \
{PREFIX".program", ob_collections_group_programs_program}, /* dup */ \
{PREFIX".program.script", ob_collections_group_programs_program_script}, /* dup */ \
+ {PREFIX".program.sequence.script", ob_collections_group_programs_program_script}, /* dup */ \
+ {PREFIX".program.sequence", ob_collections_group_programs_program_sequence}, /* dup */ \
{PREFIX".programs", NULL}, /* dup */ \
{PREFIX".programs.set", ob_images_set}, /* dup */ \
{PREFIX".programs.set.image", ob_images_set_image}, /* dup */ \
{PREFIX".programs.fonts", NULL}, /* dup */ \
{PREFIX".programs.program", ob_collections_group_programs_program}, /* dup */ \
{PREFIX".programs.program.script", ob_collections_group_programs_program_script}, /* dup */ \
+ {PREFIX".programs.program.sequence.script", ob_collections_group_programs_program_script}, /* dup */ \
{PREFIX".programs.script", ob_collections_group_script}, /* dup */ \
{PREFIX".script", ob_collections_group_script}, /* dup */
_st_collections_group_parts_part_description_params(EDJE_EXTERNAL_PARAM_TYPE_CHOICE);
}
+static void
+_program_after(const char *name)
+{
+ Edje_Part_Collection *pc;
+ Edje_Program *ep;
+ Edje_Program_After *pa;
+ Edje_Program_After *pa2;
+ Eina_List *l;
+ char *copy;
+
+ pc = eina_list_data_get(eina_list_last(edje_collections));
+ ep = current_program;
+
+ EINA_LIST_FOREACH(ep->after, l, pa2)
+ {
+ if (!strcmp(name, (char*) (pa2 + 1)))
+ return;
+ }
+
+ pa = mem_alloc(SZ(Edje_Program_After) + strlen(name) + 1);
+ pa->id = -1;
+ ep->after = eina_list_append(ep->after, pa);
+ copy = (char*)(pa + 1);
+ memcpy(copy, name, strlen(name) + 1);
+ data_queue_program_lookup(pc, name, &(pa->id));
+}
+
+static Edje_Program *
+_program_sequence_new(void)
+{
+ Edje_Program *ep, *pr = current_program;
+
+ /* sequence a new program after current */
+ ob_collections_group_programs_program();
+ ep = current_program;
+ current_program = pr;
+ _program_after(ep->name);
+ return current_program = ep;
+}
/**
@edcsubsection{collections_group_programs,Programs}
Edje_Part_Collection *pc;
Edje_Program *ep;
int i;
-
+
pc = eina_list_data_get(eina_list_last(edje_collections));
- ep = current_program;
+ if (sequencing)
+ ep = _program_sequence_new();
+ else
+ ep = current_program;
ep->action = parse_enum(0,
"STATE_SET", EDJE_ACTION_TYPE_STATE_SET,
"ACTION_STOP", EDJE_ACTION_TYPE_ACTION_STOP,
static void
st_collections_group_programs_program_after(void)
{
- Edje_Part_Collection *pc;
- Edje_Program *ep;
+ char *name;
check_arg_count(1);
-
- pc = eina_list_data_get(eina_list_last(edje_collections));
- ep = current_program;
- {
- Edje_Program_After *pa;
- Edje_Program_After *pa2;
- Eina_List *l;
- char *name;
- char *copy;
-
- name = parse_str(0);
-
- EINA_LIST_FOREACH(ep->after, l, pa2)
- {
- if (!strcmp(name, (char*) (pa2 + 1)))
- {
- free(name);
- return;
- }
- }
-
- pa = mem_alloc(SZ(Edje_Program_After) + strlen(name) + 1);
- pa->id = -1;
- ep->after = eina_list_append(ep->after, pa);
- copy = (char*)(pa + 1);
- memcpy(copy, name, strlen(name) + 1);
- data_queue_program_lookup(pc, name, &(pa->id));
- free(name);
- }
+ name = parse_str(0);
+ _program_after(name);
+ free(name);
}
/**
}
}
+/**
+ @edcsubsection{collections_group_program_sequence,Sequence}
+ */
+
+/**
+ @page edcref
+ @block
+ sequence
+ @context
+ ..
+ program {
+ name: "programname";
+ signal: "signalname";
+ source: "partname";
+ filter: "partname" "statename";
+ in: 0.3 0.0;
+ action: STATE_SET "statename" state_value;
+ transition: LINEAR 0.5;
+ targets: "partname" "anotherpart";
+ sequence {
+ action: STATE_SET "somestate";
+ transition: SINUSOIDAL 0.4;
+ targets: "partname" "anotherpart";
+ signal: "also,runs"; source: "on,signals";
+ name: "runs_after_programname";
+
+ action: STATE_SET "someotherstate";
+ transition: DECELERATE 4.0;
+ in: 0.2 0.0;
+ targets: "partname" "anotherpart";
+ name: "runs_after_runs_after_programname";
+ after: "coolprogram1337";
+ filter: "partname" "goodstate";
+ }
+ }
+ ..
+ @description
+ Sequences allow quick, easy chaining of programs.
+ Each "action" keyword within the sequence will start a new program definition.
+ Programs defined in sequences can be used as regular programs in every way,
+ but they will automatically set up sequence chains which run after the originating program.
+ After the sequence block is closed, the original program can continue to be
+ modified.
+ Scripts are allowed within sequences: each script block will be treated as a newly
+ sequenced program.
+ @since 1.10
+ @endblock
+*/
+static void
+ob_collections_group_programs_program_sequence(void)
+{
+ sequencing = current_program;
+}
+
static void
st_collections_group_parts_part_api(void)
{
if (!empty)
{
cd->programs = eina_list_append(cd->programs, cp);
+ if (sequencing)
+ _program_sequence_new();
data_queue_anonymous_lookup(pc, current_program, &(cp->id));
current_program->action = EDJE_ACTION_TYPE_SCRIPT;
}
</table>
*/
+
+void
+edje_cc_handlers_pop_notify(const char *token)
+{
+ if ((!sequencing) || strcmp(token, "sequence")) return;
+ current_program = sequencing;
+ sequencing = NULL;
+}
+
static void
edje_cc_handlers_hierarchy_set(Edje_Part *src)
{ /* This funcion makes current part rel_1.id, rel_2.id relative to src */