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_embryo.c edje_private.h 
        edje_util.c 


Log Message:


add max text size for text objects - object wont get bigger than its text
contents. useful for some things.

===================================================================
RCS file: /cvs/e/e17/libs/edje/src/lib/edje_calc.c,v
retrieving revision 1.91
retrieving revision 1.92
diff -u -3 -r1.91 -r1.92
--- edje_calc.c 2 Oct 2006 13:19:20 -0000       1.91
+++ edje_calc.c 9 Oct 2006 06:01:13 -0000       1.92
@@ -718,7 +718,8 @@
          }
        else
          evas_object_text_font_set(ep->object, font, size);
-       if ((chosen_desc->text.min_x) || (chosen_desc->text.min_y))
+       if ((chosen_desc->text.min_x) || (chosen_desc->text.min_y) ||
+           (chosen_desc->text.max_x) || (chosen_desc->text.max_y))
          {
             int mw, mh;
             Evas_Text_Style_Type style;
@@ -742,6 +743,20 @@
             evas_object_text_style_set(ep->object, style);
             evas_object_text_text_set(ep->object, text);
             evas_object_geometry_get(ep->object, NULL, NULL, &tw, &th);
+            if (chosen_desc->text.max_x)
+              {
+                 int l, r;
+                 evas_object_text_style_pad_get(ep->object, &l, &r, NULL, 
NULL);
+                 mw = tw + l + r;
+                 if ((maxw < 0) || (mw < maxw)) maxw = mw;
+              }
+            if (chosen_desc->text.max_y)
+              {
+                 int t, b;
+                 evas_object_text_style_pad_get(ep->object, NULL, NULL, &t, 
&b);
+                 mh = th + t + b;
+                 if ((maxh < 0) || (mh < maxh)) maxh = mh;
+              }
             if (chosen_desc->text.min_x)
               {
                  int l, r;
===================================================================
RCS file: /cvs/e/e17/libs/edje/src/lib/edje_data.c,v
retrieving revision 1.33
retrieving revision 1.34
diff -u -3 -r1.33 -r1.34
--- edje_data.c 21 Aug 2006 03:00:01 -0000      1.33
+++ edje_data.c 9 Oct 2006 06:01:13 -0000       1.34
@@ -315,6 +315,8 @@
    EET_DATA_DESCRIPTOR_ADD_BASIC(_edje_edd_edje_part_description, 
Edje_Part_Description, "text.fit_y", text.fit_y, EET_T_UCHAR);
    EET_DATA_DESCRIPTOR_ADD_BASIC(_edje_edd_edje_part_description, 
Edje_Part_Description, "text.min_x", text.min_x, EET_T_UCHAR);
    EET_DATA_DESCRIPTOR_ADD_BASIC(_edje_edd_edje_part_description, 
Edje_Part_Description, "text.min_y", text.min_y, EET_T_UCHAR);
+   EET_DATA_DESCRIPTOR_ADD_BASIC(_edje_edd_edje_part_description, 
Edje_Part_Description, "text.max_x", text.max_x, EET_T_UCHAR);
+   EET_DATA_DESCRIPTOR_ADD_BASIC(_edje_edd_edje_part_description, 
Edje_Part_Description, "text.max_y", text.max_y, EET_T_UCHAR);
    EET_DATA_DESCRIPTOR_ADD_BASIC(_edje_edd_edje_part_description, 
Edje_Part_Description, "text.align.x", text.align.x, EET_T_DOUBLE);
    EET_DATA_DESCRIPTOR_ADD_BASIC(_edje_edd_edje_part_description, 
Edje_Part_Description, "text.align.y", text.align.y, EET_T_DOUBLE);
    EET_DATA_DESCRIPTOR_ADD_BASIC(_edje_edd_edje_part_description, 
Edje_Part_Description, "text.id_source", text.id_source, EET_T_INT);
===================================================================
RCS file: /cvs/e/e17/libs/edje/src/lib/edje_embryo.c,v
retrieving revision 1.52
retrieving revision 1.53
diff -u -3 -r1.52 -r1.53
--- edje_embryo.c       28 Jun 2006 18:31:56 -0000      1.52
+++ edje_embryo.c       9 Oct 2006 06:01:13 -0000       1.53
@@ -1820,6 +1820,16 @@
         GETINT(rp->custom.description->text.min_y, params[4]);
 
         break;
+      case EDJE_STATE_PARAM_TEXT_MAX:
+        if ( (rp->part->type != EDJE_PART_TYPE_TEXT) && \
+              (rp->part->type != EDJE_PART_TYPE_TEXTBLOCK))
+          return 0;
+        CHKPARAM(4);
+
+        GETINT(rp->custom.description->text.max_x, params[3]);
+        GETINT(rp->custom.description->text.max_y, params[4]);
+
+        break;
       case EDJE_STATE_PARAM_TEXT_ALIGN:
         if ((rp->part->type != EDJE_PART_TYPE_TEXT)) return 0;
         CHKPARAM(4);
@@ -2086,6 +2096,16 @@
 
         SETINT(rp->custom.description->text.min_x, params[3]);
         SETINT(rp->custom.description->text.min_y, params[4]);
+
+        break;
+      case EDJE_STATE_PARAM_TEXT_MAX:
+        if ( (rp->part->type != EDJE_PART_TYPE_TEXT) && \
+              (rp->part->type != EDJE_PART_TYPE_TEXTBLOCK))
+          return 0;
+        CHKPARAM(4);
+
+        SETINT(rp->custom.description->text.max_x, params[3]);
+        SETINT(rp->custom.description->text.max_y, params[4]);
 
         break;
       case EDJE_STATE_PARAM_TEXT_ALIGN:
===================================================================
RCS file: /cvs/e/e17/libs/edje/src/lib/edje_private.h,v
retrieving revision 1.114
retrieving revision 1.115
diff -u -3 -r1.114 -r1.115
--- edje_private.h      21 Aug 2006 03:00:01 -0000      1.114
+++ edje_private.h      9 Oct 2006 06:01:13 -0000       1.115
@@ -203,9 +203,10 @@
 #define EDJE_STATE_PARAM_TEXT_SIZE    26
 #define EDJE_STATE_PARAM_TEXT_FIT     27
 #define EDJE_STATE_PARAM_TEXT_MIN     28
-#define EDJE_STATE_PARAM_TEXT_ALIGN   29
-#define EDJE_STATE_PARAM_VISIBLE      30
-#define EDJE_STATE_PARAM_LAST         31
+#define EDJE_STATE_PARAM_TEXT_MAX     29
+#define EDJE_STATE_PARAM_TEXT_ALIGN   30
+#define EDJE_STATE_PARAM_VISIBLE      31
+#define EDJE_STATE_PARAM_LAST         32
 
 /*----------*/
 
@@ -517,6 +518,8 @@
       unsigned char  fit_y; /* resize font size down to fit in y dir */
       unsigned char  min_x; /* if text size should be part min size */
       unsigned char  min_y; /* if text size should be part min size */
+      unsigned char  max_x; /* if text size should be part max size */
+      unsigned char  max_y; /* if text size should be part max size */
       
       struct {
         double      x, y; /* text alignment within bounds */
===================================================================
RCS file: /cvs/e/e17/libs/edje/src/lib/edje_util.c,v
retrieving revision 1.83
retrieving revision 1.84
diff -u -3 -r1.83 -r1.84
--- edje_util.c 30 Aug 2006 13:23:57 -0000      1.83
+++ edje_util.c 9 Oct 2006 06:01:13 -0000       1.84
@@ -1105,7 +1105,7 @@
             ed->w += maxw;
             ed->h += maxh;
          }
-       if ((ed->w > 8000) || (ed->h > 8000))
+       if ((ed->w > 4000) || (ed->h > 4000))
          {
             printf("EDJE ERROR: file %s, group %s has a non-fixed part. add 
fixed: 1 1; ???\n",
                    ed->path, ed->part);



-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys -- and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
enlightenment-cvs mailing list
enlightenment-cvs@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/enlightenment-cvs

Reply via email to