emissions now for the part collection soruce is now "". fixed a tinsy parser

bug for parsing "". emissions now wont recurse - but they may loop. hmm need
to limit that - easy to do this way though.


SVN revision: 7046
This commit is contained in:
Carsten Haitzler 2003-06-19 23:56:27 +00:00
parent 66bcb0fb57
commit 27d69a4698
4 changed files with 73 additions and 27 deletions

View File

@ -340,8 +340,8 @@ collections {
}
program {
name, "logo_animate";
signal, "load";
source, "test";
signal, "show";
source, "";
action, STATE_SET "default" 0.0;
transition, LINEAR, 4.0;
target, "logo_anim";

View File

@ -123,10 +123,10 @@ next_token(char *p, char *end, char **new_p, int *delim)
if (!isspace(*p))
{
if (*p == '"')
{
in_quote = 1;
had_quote = 1;
}
{
in_quote = 1;
had_quote = 1;
}
in_tok = 1;
tok_start = p;
if (isdelim(*p)) *delim = 1;
@ -138,10 +138,10 @@ next_token(char *p, char *end, char **new_p, int *delim)
if (in_quote)
{
if (((*p) == '"') && (*(p - 1) != '\\'))
{
in_quote = 0;
had_quote = 1;
}
{
in_quote = 0;
had_quote = 1;
}
}
else
{
@ -193,7 +193,8 @@ next_token(char *p, char *end, char **new_p, int *delim)
strcpy(p, p + 1);
else if ((*p == '\\') && (*(p + 1) == '\\'))
strcpy(p, p + 1);
p++;
else
p++;
}
}
return tok;

View File

@ -58,6 +58,8 @@ static int _edje_anim_count = 0;
static double _edje_frametime = 1.0 / 60.0;
static Ecore_Timer *_edje_timer = NULL;
static Evas_List *_edje_animators = NULL;
static Evas_Hash *_edje_file_hash = NULL;
static Evas_Smart *_edje_smart = NULL;
@ -198,7 +200,7 @@ edje_file_set(Evas_Object *obj, const char *file, const char *part)
}
ed->dirty = 1;
_edje_recalc(ed);
_edje_emit(ed, "load", ed->part);
_edje_emit(ed, "load", "");
}
}
@ -245,8 +247,6 @@ _edje_del(Edje *ed)
free(ed);
}
static Evas_Hash *_edje_file_hash = NULL;
void
_edje_file_add(Edje *ed)
{
@ -619,16 +619,38 @@ static void
_edje_emit(Edje *ed, char *sig, char *src)
{
Evas_List *l;
printf("EMIT %s %s\n", sig, src);
for (l = ed->collection->programs; l; l = l->next)
static Evas_List *emissions = NULL;
Edje_Emission *ee;
printf("EMIT \"%s\" \"%s\"\n", sig, src);
ee = calloc(1, sizeof(Edje_Emission));
if (!ee) return;
ee->signal = strdup(sig);
ee->source = strdup(src);
if (emissions)
{
Edje_Program *pr;
pr = l->data;
if ((_edje_glob_match(sig, pr->signal)) &&
(_edje_glob_match(src, pr->source)))
_edje_program_run(ed, pr);
emissions = evas_list_append(emissions, ee);
return;
}
else
emissions = evas_list_append(emissions, ee);
while (emissions)
{
ee = emissions->data;
printf(" emission \"%s\" \"%s\"\n", ee->signal, ee->source);
emissions = evas_list_remove(emissions, ee);
for (l = ed->collection->programs; l; l = l->next)
{
Edje_Program *pr;
pr = l->data;
if ((_edje_glob_match(ee->signal, pr->signal)) &&
(_edje_glob_match(ee->source, pr->source)))
_edje_program_run(ed, pr);
}
free(ee->signal);
free(ee->source);
free(ee);
}
}
@ -1468,7 +1490,8 @@ _edje_smart_layer_set(Evas_Object * obj, int layer)
{
Edje *ed;
Evas_List *l;
char buf[256];
ed = evas_object_smart_data_get(obj);
if (!ed) return;
if (ed->layer == layer) return;
@ -1480,6 +1503,8 @@ _edje_smart_layer_set(Evas_Object * obj, int layer)
ep = l->data;
evas_object_layer_set(ep->object, ed->layer);
}
snprintf(buf, sizeof(buf), "layer,set,%i", layer);
_edje_emit(ed, buf, "");
}
static void
@ -1497,6 +1522,7 @@ _edje_smart_raise(Evas_Object * obj)
ep = l->data;
evas_object_raise(ep->object);
}
_edje_emit(ed, "raise", "");
}
static void
@ -1514,6 +1540,7 @@ _edje_smart_lower(Evas_Object * obj)
ep = l->data;
evas_object_lower(ep->object);
}
_edje_emit(ed, "lower", "");
}
static void
@ -1531,6 +1558,7 @@ _edje_smart_stack_above(Evas_Object * obj, Evas_Object * above)
ep = l->data;
evas_object_stack_above(ep->object, above);
}
_edje_emit(ed, "stack_above", "");
}
static void
@ -1548,6 +1576,7 @@ _edje_smart_stack_below(Evas_Object * obj, Evas_Object * below)
ep = l->data;
evas_object_stack_below(ep->object, below);
}
_edje_emit(ed, "stack_below", "");
}
static void
@ -1555,12 +1584,13 @@ _edje_smart_move(Evas_Object * obj, double x, double y)
{
Edje *ed;
Evas_List *l;
double xx, yy;
ed = evas_object_smart_data_get(obj);
if (!ed) return;
if ((ed->x == x) && (ed->y == y)) return;
ed->x = x;
ed->y = y;
evas_object_move(ed->clipper, ed->x, ed->y);
for (l = ed->parts; l; l = l->next)
@ -1570,6 +1600,7 @@ _edje_smart_move(Evas_Object * obj, double x, double y)
ep = l->data;
evas_object_move(ep->object, ed->x + ep->x, ed->y + ep->y);
}
_edje_emit(ed, "move", "");
}
static void
@ -1588,6 +1619,7 @@ _edje_smart_resize(Evas_Object * obj, double w, double h)
evas_object_resize(ed->clipper, ed->w, ed->h);
ed->dirty = 1;
_edje_recalc(ed);
_edje_emit(ed, "resize", "");
}
static void
@ -1598,6 +1630,7 @@ _edje_smart_show(Evas_Object * obj)
ed = evas_object_smart_data_get(obj);
if (!ed) return;
evas_object_show(ed->clipper);
_edje_emit(ed, "show", "");
}
static void
@ -1608,6 +1641,7 @@ _edje_smart_hide(Evas_Object * obj)
ed = evas_object_smart_data_get(obj);
if (!ed) return;
evas_object_hide(ed->clipper);
_edje_emit(ed, "hide", "");
}
static void
@ -1618,6 +1652,7 @@ _edje_smart_color_set(Evas_Object * obj, int r, int g, int b, int a)
ed = evas_object_smart_data_get(obj);
if (!ed) return;
evas_object_color_set(ed->clipper, r, g, b, a);
_edje_emit(ed, "color_set", "");
}
static void
@ -1627,7 +1662,9 @@ _edje_smart_clip_set(Evas_Object * obj, Evas_Object * clip)
ed = evas_object_smart_data_get(obj);
if (!ed) return;
if (evas_object_clip_get(obj) == clip) return;
evas_object_clip_set(ed->clipper, clip);
_edje_emit(ed, "clip_set", "");
}
static void
@ -1637,5 +1674,7 @@ _edje_smart_clip_unset(Evas_Object * obj)
ed = evas_object_smart_data_get(obj);
if (!ed) return;
if (!evas_object_clip_get(obj)) return;
evas_object_clip_unset(ed->clipper);
_edje_emit(ed, "clip_unset", "");
}

View File

@ -292,6 +292,8 @@ struct _Edje_Part_Description
typedef struct _Edje Edje;
typedef struct _Edje_Real_Part Edje_Real_Part;
typedef struct _Edje_Running_Program Edje_Running_Program;
typedef struct _Edje_Calc_Params Edje_Calc_Params;
typedef struct _Edje_Emission Edje_Emission;
struct _Edje
{
@ -340,8 +342,6 @@ struct _Edje_Running_Program
double start_time;
};
typedef struct _Edje_Calc_Params Edje_Calc_Params;
struct _Edje_Calc_Params
{
double x, y, w, h;
@ -357,6 +357,12 @@ struct _Edje_Calc_Params
} border;
};
struct _Edje_Emission
{
char *signal;
char *source;
};
extern Eet_Data_Descriptor *_edje_edd_edje_file;
extern Eet_Data_Descriptor *_edje_edd_edje_image_directory;
extern Eet_Data_Descriptor *_edje_edd_edje_image_directory_entry;