Enlightenment CVS committal
Author : raster
Project : e17
Module : libs/edje
Dir : e17/libs/edje/src/lib
Modified Files:
edje_calc.c edje_data.c edje_load.c edje_private.h
Log Message:
separate x & y relative "to" params. the old .edc format is still supported
where "to" implies both x & y. to_x == only in x dir, to_y == only in y dir :)
===================================================================
RCS file: /cvsroot/enlightenment/e17/libs/edje/src/lib/edje_calc.c,v
retrieving revision 1.10
retrieving revision 1.11
diff -u -3 -r1.10 -r1.11
--- edje_calc.c 30 Jul 2003 02:58:22 -0000 1.10
+++ edje_calc.c 14 Aug 2003 03:22:37 -0000 1.11
@@ -1,7 +1,7 @@
#include "Edje.h"
#include "edje_private.h"
-static void _edje_part_recalc_single(Edje *ed, Edje_Real_Part *ep,
Edje_Part_Description *desc, Edje_Part_Description *chosen_desc, Edje_Real_Part
*rel1_to, Edje_Real_Part *rel2_to, Edje_Real_Part *confine_to, Edje_Calc_Params
*params);
+static void _edje_part_recalc_single(Edje *ed, Edje_Real_Part *ep,
Edje_Part_Description *desc, Edje_Part_Description *chosen_desc, Edje_Real_Part
*rel1_to_x, Edje_Real_Part *rel1_to_y, Edje_Real_Part *rel2_to_x, Edje_Real_Part
*rel2_to_y, Edje_Real_Part *confine_to, Edje_Calc_Params *params);
static void _edje_part_recalc(Edje *ed, Edje_Real_Part *ep);
void
@@ -87,14 +87,20 @@
}
ep->param1.description = desc_found;
}
- ep->param1.rel1_to = NULL;
- ep->param1.rel2_to = NULL;
+ ep->param1.rel1_to_x = NULL;
+ ep->param1.rel1_to_y = NULL;
+ ep->param1.rel2_to_x = NULL;
+ ep->param1.rel2_to_y = NULL;
if (ep->param1.description)
{
- if (ep->param1.description->rel1.id >= 0)
- ep->param1.rel1_to = evas_list_nth(ed->parts,
ep->param1.description->rel1.id);
- if (ep->param1.description->rel2.id >= 0)
- ep->param1.rel2_to = evas_list_nth(ed->parts,
ep->param1.description->rel2.id);
+ if (ep->param1.description->rel1.id_x >= 0)
+ ep->param1.rel1_to_x = evas_list_nth(ed->parts,
ep->param1.description->rel1.id_x);
+ if (ep->param1.description->rel1.id_y >= 0)
+ ep->param1.rel1_to_y = evas_list_nth(ed->parts,
ep->param1.description->rel1.id_y);
+ if (ep->param1.description->rel2.id_x >= 0)
+ ep->param1.rel2_to_x = evas_list_nth(ed->parts,
ep->param1.description->rel2.id_x);
+ if (ep->param1.description->rel2.id_y >= 0)
+ ep->param1.rel2_to_y = evas_list_nth(ed->parts,
ep->param1.description->rel2.id_y);
}
if (!strcmp(d2, "default") && (v2 == 0.0))
@@ -140,23 +146,35 @@
}
if (!ep->param1.description)
ep->param1.description = ep->part->default_desc;
- ep->param1.rel1_to = NULL;
- ep->param1.rel2_to = NULL;
+ ep->param1.rel1_to_x = NULL;
+ ep->param1.rel1_to_y = NULL;
+ ep->param1.rel2_to_x = NULL;
+ ep->param1.rel2_to_y = NULL;
if (ep->param1.description)
{
- if (ep->param1.description->rel1.id >= 0)
- ep->param1.rel1_to = evas_list_nth(ed->parts,
ep->param1.description->rel1.id);
- if (ep->param1.description->rel2.id >= 0)
- ep->param1.rel2_to = evas_list_nth(ed->parts,
ep->param1.description->rel2.id);
- }
- ep->param2.rel1_to = NULL;
- ep->param2.rel2_to = NULL;
+ if (ep->param1.description->rel1.id_x >= 0)
+ ep->param1.rel1_to_x = evas_list_nth(ed->parts,
ep->param1.description->rel1.id_x);
+ if (ep->param1.description->rel1.id_y >= 0)
+ ep->param1.rel1_to_y = evas_list_nth(ed->parts,
ep->param1.description->rel1.id_y);
+ if (ep->param1.description->rel2.id_x >= 0)
+ ep->param1.rel2_to_x = evas_list_nth(ed->parts,
ep->param1.description->rel2.id_x);
+ if (ep->param1.description->rel2.id_y >= 0)
+ ep->param1.rel2_to_y = evas_list_nth(ed->parts,
ep->param1.description->rel2.id_y);
+ }
+ ep->param2.rel1_to_x = NULL;
+ ep->param2.rel1_to_y = NULL;
+ ep->param2.rel2_to_x = NULL;
+ ep->param2.rel2_to_y = NULL;
if (ep->param2.description)
{
- if (ep->param2.description->rel1.id >= 0)
- ep->param2.rel1_to = evas_list_nth(ed->parts,
ep->param2.description->rel1.id);
- if (ep->param2.description->rel2.id >= 0)
- ep->param2.rel2_to = evas_list_nth(ed->parts,
ep->param2.description->rel2.id);
+ if (ep->param2.description->rel1.id_x >= 0)
+ ep->param2.rel1_to_x = evas_list_nth(ed->parts,
ep->param2.description->rel1.id_x);
+ if (ep->param2.description->rel1.id_y >= 0)
+ ep->param2.rel1_to_y = evas_list_nth(ed->parts,
ep->param2.description->rel1.id_y);
+ if (ep->param2.description->rel2.id_x >= 0)
+ ep->param2.rel2_to_x = evas_list_nth(ed->parts,
ep->param2.description->rel2.id_x);
+ if (ep->param2.description->rel2.id_y >= 0)
+ ep->param2.rel2_to_y = evas_list_nth(ed->parts,
ep->param2.description->rel2.id_y);
}
ed->dirty = 1;
@@ -196,46 +214,44 @@
Edje_Real_Part *ep,
Edje_Part_Description *desc,
Edje_Part_Description *chosen_desc,
- Edje_Real_Part *rel1_to,
- Edje_Real_Part *rel2_to,
+ Edje_Real_Part *rel1_to_x,
+ Edje_Real_Part *rel1_to_y,
+ Edje_Real_Part *rel2_to_x,
+ Edje_Real_Part *rel2_to_y,
Edje_Real_Part *confine_to,
Edje_Calc_Params *params)
{
int minw, minh, maxw, maxh;
/* relative coords of top left & bottom right */
- if (rel1_to)
- {
- params->x = desc->rel1.offset_x +
- rel1_to->x + (desc->rel1.relative_x * rel1_to->w);
- params->y = desc->rel1.offset_y +
- rel1_to->y + (desc->rel1.relative_y * rel1_to->h);
- }
+ if (rel1_to_x)
+ params->x = desc->rel1.offset_x +
+ rel1_to_x->x + (desc->rel1.relative_x * rel1_to_x->w);
else
- {
- params->x = desc->rel1.offset_x +
- (desc->rel1.relative_x * ed->w);
- params->y = desc->rel1.offset_y +
- (desc->rel1.relative_y * ed->h);
- }
- if (rel2_to)
- {
- params->w = desc->rel2.offset_x +
- rel2_to->x + (desc->rel2.relative_x * rel2_to->w) -
- params->x;
- params->h = desc->rel2.offset_y +
- rel2_to->y + (desc->rel2.relative_y * rel2_to->h) -
- params->y;
- }
+ params->x = desc->rel1.offset_x +
+ (desc->rel1.relative_x * ed->w);
+ if (rel1_to_y)
+ params->y = desc->rel1.offset_y +
+ rel1_to_y->y + (desc->rel1.relative_y * rel1_to_y->h);
else
- {
- params->w = (double)desc->rel2.offset_x +
- (desc->rel2.relative_x * (double)ed->w) -
- params->x + 1;
- params->h = (double)desc->rel2.offset_y +
- (desc->rel2.relative_y * (double)ed->h) -
- params->y + 1;
- }
+ params->y = desc->rel1.offset_y +
+ (desc->rel1.relative_y * ed->h);
+ if (rel2_to_x)
+ params->w = desc->rel2.offset_x +
+ rel2_to_x->x + (desc->rel2.relative_x * rel2_to_x->w) -
+ params->x;
+ else
+ params->w = (double)desc->rel2.offset_x +
+ (desc->rel2.relative_x * (double)ed->w) -
+ params->x + 1;
+ if (rel2_to_y)
+ params->h = desc->rel2.offset_y +
+ rel2_to_y->y + (desc->rel2.relative_y * rel2_to_y->h) -
+ params->y;
+ else
+ params->h = (double)desc->rel2.offset_y +
+ (desc->rel2.relative_y * (double)ed->h) -
+ params->y + 1;
/* aspect */
if (params->h > 0)
@@ -503,11 +519,15 @@
double pos = 0.0;
if (ep->calculated) return;
- if (ep->param1.rel1_to) _edje_part_recalc(ed, ep->param1.rel1_to);
- if (ep->param1.rel2_to) _edje_part_recalc(ed, ep->param1.rel2_to);
+ if (ep->param1.rel1_to_x) _edje_part_recalc(ed, ep->param1.rel1_to_x);
+ if (ep->param1.rel1_to_y) _edje_part_recalc(ed, ep->param1.rel1_to_y);
+ if (ep->param1.rel2_to_x) _edje_part_recalc(ed, ep->param1.rel2_to_x);
+ if (ep->param1.rel2_to_y) _edje_part_recalc(ed, ep->param1.rel2_to_y);
if (ep->param1.confine_to) _edje_part_recalc(ed, ep->param1.confine_to);
- if (ep->param2.rel1_to) _edje_part_recalc(ed, ep->param2.rel1_to);
- if (ep->param2.rel2_to) _edje_part_recalc(ed, ep->param2.rel2_to);
+ if (ep->param2.rel1_to_x) _edje_part_recalc(ed, ep->param2.rel1_to_x);
+ if (ep->param2.rel1_to_y) _edje_part_recalc(ed, ep->param2.rel1_to_y);
+ if (ep->param2.rel2_to_x) _edje_part_recalc(ed, ep->param2.rel2_to_x);
+ if (ep->param2.rel2_to_y) _edje_part_recalc(ed, ep->param2.rel2_to_y);
if (ep->param2.confine_to) _edje_part_recalc(ed, ep->param2.confine_to);
/* actually calculate now */
@@ -518,10 +538,10 @@
ep->chosen_description = chosen_desc;
if (ep->param1.description)
- _edje_part_recalc_single(ed, ep, ep->param1.description, chosen_desc,
ep->param1.rel1_to, ep->param1.rel2_to, ep->param1.confine_to, &p1);
+ _edje_part_recalc_single(ed, ep, ep->param1.description, chosen_desc,
ep->param1.rel1_to_x, ep->param1.rel1_to_y, ep->param1.rel2_to_x,
ep->param1.rel2_to_y, ep->param1.confine_to, &p1);
if (ep->param2.description)
{
- _edje_part_recalc_single(ed, ep, ep->param2.description, chosen_desc,
ep->param2.rel1_to, ep->param2.rel2_to, ep->param2.confine_to, &p2);
+ _edje_part_recalc_single(ed, ep, ep->param2.description, chosen_desc,
ep->param2.rel1_to_x, ep->param2.rel1_to_y, ep->param2.rel2_to_x,
ep->param2.rel2_to_y, ep->param2.confine_to, &p2);
pos = ep->description_pos;
===================================================================
RCS file: /cvsroot/enlightenment/e17/libs/edje/src/lib/edje_data.c,v
retrieving revision 1.9
retrieving revision 1.10
diff -u -3 -r1.9 -r1.10
--- edje_data.c 5 Aug 2003 14:33:35 -0000 1.9
+++ edje_data.c 14 Aug 2003 03:22:37 -0000 1.10
@@ -117,12 +117,14 @@
EET_DATA_DESCRIPTOR_ADD_BASIC(_edje_edd_edje_part_description,
Edje_Part_Description, "rel1.relative_y", rel1.relative_y, EET_T_DOUBLE);
EET_DATA_DESCRIPTOR_ADD_BASIC(_edje_edd_edje_part_description,
Edje_Part_Description, "rel1.offset_x", rel1.offset_x, EET_T_INT);
EET_DATA_DESCRIPTOR_ADD_BASIC(_edje_edd_edje_part_description,
Edje_Part_Description, "rel1.offset_y", rel1.offset_y, EET_T_INT);
- EET_DATA_DESCRIPTOR_ADD_BASIC(_edje_edd_edje_part_description,
Edje_Part_Description, "rel1.id", rel1.id, EET_T_INT);
+ EET_DATA_DESCRIPTOR_ADD_BASIC(_edje_edd_edje_part_description,
Edje_Part_Description, "rel1.id_x", rel1.id_x, EET_T_INT);
+ EET_DATA_DESCRIPTOR_ADD_BASIC(_edje_edd_edje_part_description,
Edje_Part_Description, "rel1.id_y", rel1.id_y, EET_T_INT);
EET_DATA_DESCRIPTOR_ADD_BASIC(_edje_edd_edje_part_description,
Edje_Part_Description, "rel2.relative_x", rel2.relative_x, EET_T_DOUBLE);
EET_DATA_DESCRIPTOR_ADD_BASIC(_edje_edd_edje_part_description,
Edje_Part_Description, "rel2.relative_y", rel2.relative_y, EET_T_DOUBLE);
EET_DATA_DESCRIPTOR_ADD_BASIC(_edje_edd_edje_part_description,
Edje_Part_Description, "rel2.offset_x", rel2.offset_x, EET_T_INT);
EET_DATA_DESCRIPTOR_ADD_BASIC(_edje_edd_edje_part_description,
Edje_Part_Description, "rel2.offset_y", rel2.offset_y, EET_T_INT);
- EET_DATA_DESCRIPTOR_ADD_BASIC(_edje_edd_edje_part_description,
Edje_Part_Description, "rel2.id", rel2.id, EET_T_INT);
+ EET_DATA_DESCRIPTOR_ADD_BASIC(_edje_edd_edje_part_description,
Edje_Part_Description, "rel2.id_x", rel2.id_x, EET_T_INT);
+ EET_DATA_DESCRIPTOR_ADD_BASIC(_edje_edd_edje_part_description,
Edje_Part_Description, "rel2.id_y", rel2.id_y, EET_T_INT);
EET_DATA_DESCRIPTOR_ADD_BASIC(_edje_edd_edje_part_description,
Edje_Part_Description, "image.id", image.id, EET_T_INT);
EET_DATA_DESCRIPTOR_ADD_LIST(_edje_edd_edje_part_description,
Edje_Part_Description, "image.tween_list", image.tween_list,
_edje_edd_edje_part_image_id);
EET_DATA_DESCRIPTOR_ADD_BASIC(_edje_edd_edje_part_description,
Edje_Part_Description, "border.l", border.l, EET_T_INT);
===================================================================
RCS file: /cvsroot/enlightenment/e17/libs/edje/src/lib/edje_load.c,v
retrieving revision 1.20
retrieving revision 1.21
diff -u -3 -r1.20 -r1.21
--- edje_load.c 9 Aug 2003 03:32:21 -0000 1.20
+++ edje_load.c 14 Aug 2003 03:22:37 -0000 1.21
@@ -141,10 +141,14 @@
Edje_Real_Part *rp;
rp = l->data;
- if (rp->param1.description->rel1.id >= 0)
- rp->param1.rel1_to = evas_list_nth(ed->parts,
rp->param1.description->rel1.id);
- if (rp->param1.description->rel2.id >= 0)
- rp->param1.rel2_to = evas_list_nth(ed->parts,
rp->param1.description->rel2.id);
+ if (rp->param1.description->rel1.id_x >= 0)
+ rp->param1.rel1_to_x = evas_list_nth(ed->parts,
rp->param1.description->rel1.id_x);
+ if (rp->param1.description->rel1.id_y >= 0)
+ rp->param1.rel1_to_y = evas_list_nth(ed->parts,
rp->param1.description->rel1.id_y);
+ if (rp->param1.description->rel2.id_x >= 0)
+ rp->param1.rel2_to_x = evas_list_nth(ed->parts,
rp->param1.description->rel2.id_x);
+ if (rp->param1.description->rel2.id_y >= 0)
+ rp->param1.rel2_to_y = evas_list_nth(ed->parts,
rp->param1.description->rel2.id_y);
_edje_text_part_on_add_clippers(ed, rp);
if (rp->part->clip_to_id >= 0)
{
===================================================================
RCS file: /cvsroot/enlightenment/e17/libs/edje/src/lib/edje_private.h,v
retrieving revision 1.40
retrieving revision 1.41
diff -u -3 -r1.40 -r1.41
--- edje_private.h 13 Aug 2003 11:03:20 -0000 1.40
+++ edje_private.h 14 Aug 2003 03:22:38 -0000 1.41
@@ -289,7 +289,8 @@
double relative_y;
int offset_x;
int offset_y;
- int id; /* -1 = whole part collection, or part ID */
+ int id_x; /* -1 = whole part collection, or part ID */
+ int id_y; /* -1 = whole part collection, or part ID */
} rel1, rel2;
struct {
@@ -430,8 +431,10 @@
Edje_Part_Description *chosen_description;
struct {
Edje_Part_Description *description;
- Edje_Real_Part *rel1_to;
- Edje_Real_Part *rel2_to;
+ Edje_Real_Part *rel1_to_x;
+ Edje_Real_Part *rel1_to_y;
+ Edje_Real_Part *rel2_to_x;
+ Edje_Real_Part *rel2_to_y;
Edje_Real_Part *confine_to;
} param1, param2;
-------------------------------------------------------
This SF.Net email sponsored by: Free pre-built ASP.NET sites including
Data Reports, E-commerce, Portals, and Forums are available now.
Download today and enter to win an XBOX or Visual Studio .NET.
http://aspnet.click-url.com/go/psa00100003ave/direct;at.aspnet_072303_01/01
_______________________________________________
enlightenment-cvs mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/enlightenment-cvs