Enlightenment CVS committal

Author  : rbdpngn
Project : e17
Module  : libs/estyle

Dir     : e17/libs/estyle/src


Modified Files:
        Estyle.h Estyle_private.h estyle.c estyle_color.c 
        estyle_style.c estyle_style.h 


Log Message:
Merge of estyle from SPLIT.

===================================================================
RCS file: /cvsroot/enlightenment/e17/libs/estyle/src/Estyle.h,v
retrieving revision 1.12
retrieving revision 1.13
diff -u -3 -r1.12 -r1.13
--- Estyle.h    19 May 2002 21:48:25 -0000      1.12
+++ Estyle.h    14 Jan 2003 18:50:30 -0000      1.13
@@ -12,83 +12,87 @@
 typedef struct _estyle Estyle;
 
 
-
 #ifdef __cplusplus
-extern "C" {
+extern "C"
+{
 #endif
 
 
 /*
  * Constructor/destructor
  */
-       Estyle *estyle_new(Evas evas, char *text, char *style);
-       void estyle_free(Estyle * es);
+Estyle *estyle_new(Evas *evas, char *text, char *style);
+void estyle_free(Estyle * es);
 
 /*
  * Visibility modifiers
  */
-       void estyle_show(Estyle * es);
-       void estyle_hide(Estyle * es);
+void estyle_show(Estyle * es);
+void estyle_hide(Estyle * es);
 
 /*
  * Content and appearance manipulators
  */
-       void estyle_move(Estyle * es, int x, int y);
+void estyle_move(Estyle * es, int x, int y);
 
-       Evas_Object estyle_get_clip(Estyle * es);
-       void estyle_set_clip(Estyle * es, Evas_Object clip);
+Evas_Object *estyle_get_clip(Estyle *es);
+void estyle_set_clip(Estyle *es, Evas_Object *clip);
 
-       char *estyle_get_text(Estyle * es);
-       void estyle_set_text(Estyle * es, char *text);
+char *estyle_get_text(Estyle * es);
+void estyle_set_text(Estyle * es, char *text);
 
-       char *estyle_get_font(Estyle * es);
-       int estyle_get_font_size(Estyle * es);
-       void estyle_set_font(Estyle * es, char *name, int size);
+char *estyle_get_font(Estyle *es);
+int estyle_get_font_size(Estyle *es);
+void estyle_set_font(Estyle * es, char *name, int size);
 
-       int estyle_get_layer(Estyle * es);
-       void estyle_set_layer(Estyle * es, int layer);
+int estyle_get_layer(Estyle * es);
+void estyle_set_layer(Estyle * es, int layer);
 
-       char *estyle_get_style(Estyle * es);
-       void estyle_set_style(Estyle * es, char *name);
+char *estyle_get_style(Estyle * es);
+void estyle_set_style(Estyle * es, char *name);
 
-       void estyle_get_color(Estyle * es, int *r, int *g, int *b, int *a);
-       void estyle_set_color(Estyle * es, int r, int g, int b, int a);
+void estyle_get_color(Estyle *es, int *r, int *g, int *b, int *a);
+void estyle_set_color(Estyle * es, int r, int g, int b, int a);
 
-       void estyle_lookup_color_db(char *name, int *r, int *g, int *b,
-                                   int *a);
-       void estyle_set_color_db(Estyle * es, char *name);
+void estyle_lookup_color_db(char *name, int *r, int *g, int *b,
+                           int *a);
+void estyle_set_color_db(Estyle * es, char *name);
 
 /*
  * Geometry querying
  */
-       inline int estyle_length(Estyle * es);
-       void estyle_geometry(Estyle * es, int *x, int *y, int *w, int *h);
-       void estyle_text_at(Estyle * es, int index, int *char_x,
+inline int estyle_length(Estyle * es);
+void estyle_geometry(Estyle * es, int *x, int *y, int *w, int *h);
+void estyle_text_at(Estyle * es, int index, int *char_x,
+                   int *char_y, int *char_w, int *char_h);
+int estyle_text_at_position(Estyle * es, int x, int y, int *char_x,
                            int *char_y, int *char_w, int *char_h);
-       int estyle_text_at_position(Estyle * es, int x, int y, int *char_x,
-                                   int *char_y, int *char_w, int *char_h);
 
 /*
  * Fixing the reported geometry to set values.
  */
-       inline int estyle_fixed(Estyle * es);
-       void estyle_fix_geometry(Estyle * es, int x, int y, int w, int h);
-       void estyle_unfix_geometry(Estyle * es);
+inline int estyle_fixed(Estyle * es);
+void estyle_fix_geometry(Estyle * es, int x, int y, int w, int h);
+void estyle_unfix_geometry(Estyle * es);
 
 /*
  * Joining and splitting estyles.
  */
-       Estyle *estyle_split(Estyle * es, unsigned int index);
-       int estyle_merge(Estyle * es1, Estyle * es2);
+Estyle *estyle_split(Estyle *es, unsigned int index);
+int estyle_merge(Estyle *es1, Estyle *es2);
+
 
 /*
  * Callbacks.
  */
-       void estyle_callback_add(Estyle * es, Evas_Callback_Type callback,
-                                void (*func) (void *_data, Estyle * _es,
-                                              int _b, int _x, int _y),
-                                void *data);
-       void estyle_callback_del(Estyle * es, Evas_Callback_Type callback);
+void estyle_callback_add(Estyle * es, Evas_Callback_Type callback,
+                        void (*func) (void *_data, Estyle * _es,
+                                      void *event_info),
+                        void *data);
+void estyle_callback_del(Estyle * es, Evas_Callback_Type callback,
+                        void (*func) (void *_data, Estyle * _es,
+                                      void *event_info));
+
 #ifdef __cplusplus
 }
 #endif
===================================================================
RCS file: /cvsroot/enlightenment/e17/libs/estyle/src/Estyle_private.h,v
retrieving revision 1.9
retrieving revision 1.10
diff -u -3 -r1.9 -r1.10
--- Estyle_private.h    19 May 2002 21:48:25 -0000      1.9
+++ Estyle_private.h    14 Jan 2003 18:50:37 -0000      1.10
@@ -15,7 +15,7 @@
 };
 
 typedef void (*Estyle_Callback_Function) (void *_data, Estyle * _es,
-                                         int _b, int _x, int _y);
+                                         void *event_info);
 
 typedef struct _estyle_callback Estyle_Callback;
 struct _estyle_callback {
@@ -29,7 +29,7 @@
        /*
         * Keep a pointer in the estyle to the evas.
         */
-       Evas evas;
+       Evas *evas;
 
        /*
         * Each estyle can have a different color than other bits in the
@@ -58,7 +58,7 @@
        /*
         * The visual representation of the text.
         */
-       Evas_Object bit;
+       Evas_Object *bit;
 
        /*
         * Keep track of the length of text stored in this bit to avoid
@@ -69,7 +69,7 @@
        /*
         * Callbacks.
         */
-       Evas_List callbacks;
+       Evas_List *callbacks;
 };
 
 /*
===================================================================
RCS file: /cvsroot/enlightenment/e17/libs/estyle/src/estyle.c,v
retrieving revision 1.19
retrieving revision 1.20
diff -u -3 -r1.19 -r1.20
--- estyle.c    28 May 2002 15:31:22 -0000      1.19
+++ estyle.c    14 Jan 2003 18:50:42 -0000      1.20
@@ -1,14 +1,15 @@
 #include "Estyle_private.h"
 #include <ctype.h>
+#include <Evas.h>
 
 #define ESTYLE_TABWIDTH 8
 #define DEFAULT_FONT "nationff"
 #define DEFAULT_SIZE 12
 
-void __estyle_update_position(Estyle * es);
-void __estyle_update_dimensions(Estyle * es);
-void __estyle_callback_dispatcher(void *_data, Evas _e, Evas_Object _o,
-                                 int _b, int _x, int _y);
+void __estyle_update_position(Estyle *es);
+void __estyle_update_dimensions(Estyle *es);
+void __estyle_callback_dispatcher(void *_data, Evas *_e, Evas_Object *_o,
+                                 void *event_info);
 
 static int estyle_setup_complete = 0;
 
@@ -21,7 +22,7 @@
  * Returns a pointer to the newly allocated estyle on success, NULL on
  * failure. The estyle doesn't get displayed until estyle_show gets called.
  */
-Estyle *estyle_new(Evas evas, char *text, char *style)
+Estyle *estyle_new(Evas *evas, char *text, char *style)
 {
        Estyle *es;
 
@@ -42,13 +43,14 @@
        memset(es, 0, sizeof(Estyle));
 
        es->evas = evas;
-       evas_font_add_path(es->evas, PACKAGE_DATA_DIR "/fonts");
+       evas_object_font_path_append(es->evas, PACKAGE_DATA_DIR"/fonts");
 
        /*
         * Create the Evas_Object and set the default font and font size.
         */
-       es->bit =
-           evas_add_text(es->evas, DEFAULT_FONT, DEFAULT_SIZE, text);
+       es->bit = evas_object_text_add(es->evas);
+       evas_object_text_font_set(es->bit,DEFAULT_FONT,DEFAULT_SIZE);
+       evas_object_text_text_set(es->bit,text);
 
        /*
         * Set some default colors, font, and font size.
@@ -84,14 +86,14 @@
  *
  * Returns no value. Frees the data in @es as well as @es itself.
  */
-void estyle_free(Estyle * es)
+void estyle_free(Estyle *es)
 {
-       Evas_List l;
+       Evas_List *l;
 
        CHECK_PARAM_POINTER("es", es);
 
        if (es->bit)
-               evas_del_object(es->evas, es->bit);
+               evas_object_del(es->bit);
 
        if (es->style)
                _estyle_style_release(es->style, es->evas);
@@ -111,13 +113,13 @@
  *
  * Returns no value. Updates the display to reflect changes to @estyle.
  */
-void estyle_show(Estyle * es)
+void estyle_show(Estyle *es)
 {
        CHECK_PARAM_POINTER("es", es);
 
        es->flags |= ESTYLE_BIT_VISIBLE;
        _estyle_style_show(es);
-       evas_show(es->evas, es->bit);
+       evas_object_show(es->bit);
 }
 
 
@@ -127,13 +129,13 @@
  *
  * Returns no value
  */
-void estyle_hide(Estyle * es)
+void estyle_hide(Estyle *es)
 {
        CHECK_PARAM_POINTER("es", es);
 
        es->flags &= ~ESTYLE_BIT_VISIBLE;
        _estyle_style_hide(es);
-       evas_hide(es->evas, es->bit);
+       evas_object_hide(es->bit);
 }
 
 /**
@@ -153,11 +155,10 @@
 
        es->x = x;
        es->y = y;
-       evas_move(es->evas, es->bit,
-                 (double) (x + (es->style ?
-                                es->style->info->left_push : 0)),
-                 (double) (y + (es->style ?
-                                es->style->info->top_push : 0)));
+       evas_object_move(es->bit, 
+             (double)(x + (es->style ? es->style->info->left_push : 0)),
+             (double)(y + (es->style ? es->style->info->top_push : 0)));
+       
        if (es->style)
                _estyle_style_move(es);
 }
@@ -203,7 +204,7 @@
        CHECK_PARAM_POINTER("es", es);
 
        es->color = _estyle_color_instance(r, g, b, a);
-       evas_set_color(es->evas, es->bit, r, g, b, a);
+       evas_object_color_set(es->bit, r, g, b, a);
        _estyle_style_set_color(es);
 }
 
@@ -240,14 +241,14 @@
  * estyle_set_color_db - set the color of an estyle based on color name
  * @es: the estyle to change the color
  */
-void estyle_set_color_db(Estyle * es, char *name)
+void estyle_set_color_db(Estyle *es, char *name)
 {
        CHECK_PARAM_POINTER("es", es);
        CHECK_PARAM_POINTER("name", name);
 
        es->color = _estyle_color_instance_db(name);
-       evas_set_color(es->evas, es->bit, es->color->r, es->color->g,
-                      es->color->b, es->color->a);
+       evas_object_color_set(es->bit, es->color->r, es->color->g,
+                       es->color->b, es->color->a);
        if (es->style)
                _estyle_style_set_color(es);
 }
@@ -258,7 +259,7 @@
  *
  * Returns the name the style or NULL if no style specified.
  */
-char *estyle_get_style(Estyle * es)
+char *estyle_get_style(Estyle *es)
 {
        CHECK_PARAM_POINTER_RETURN("es", es, NULL);
 
@@ -275,10 +276,11 @@
  *
  * Returns no value. The style of @es is changed to @name.
  */
-void estyle_set_style(Estyle * es, char *name)
+void estyle_set_style(Estyle *es, char *name)
 {
-       char *text;
-       Evas_Object clip;
+       int layer;
+       const char *text;
+       Evas_Object *clip;
 
        CHECK_PARAM_POINTER("es", es);
        CHECK_PARAM_POINTER("name", name);
@@ -292,17 +294,20 @@
        if ((es->style = _estyle_style_instance(name)) == NULL)
                return;
 
-       text = evas_get_text_string(es->evas, es->bit);
+       text = evas_object_text_text_get(es->bit);
 
        /*
         * Draw the new style bits and set the correct layer for all of the
         * estyle contents. Also clip the contents to the clip rectangle.
         */
-       _estyle_style_draw(es, text);
+       _estyle_style_draw(es, (char *)text);
+
+       layer = evas_object_layer_get(es->bit);
+       estyle_set_layer(es, layer);
 
        _estyle_style_move(es);
 
-       if ((clip = evas_get_clip_object(es->evas, es->bit)) != NULL)
+       if ((clip = evas_object_clip_get(es->bit)) != NULL)
                _estyle_style_set_clip(es, clip);
 
        __estyle_update_position(es);
@@ -321,15 +326,15 @@
  */
 char *estyle_get_text(Estyle * es)
 {
-       char *ret;
+       const char *ret;
 
        CHECK_PARAM_POINTER_RETURN("es", es, NULL);
 
-       ret = evas_get_text_string(es->evas, es->bit);
+       ret = evas_object_text_text_get(es->bit);
        if (ret)
                ret = strdup(ret);
 
-       return ret;
+       return (char *)ret;
 }
 
 /**
@@ -340,11 +345,11 @@
  * Returns no value. Changes the text in @es to @text and updates the display
  * if visible.
  */
-void estyle_set_text(Estyle * es, char *text)
+void estyle_set_text(Estyle *es, char *text)
 {
        CHECK_PARAM_POINTER("es", es);
 
-       evas_set_text(es->evas, es->bit, text);
+       evas_object_text_text_set(es->bit, text);
 
        /*
         * Set the text for the style bits.
@@ -369,7 +374,7 @@
 {
        CHECK_PARAM_POINTER_RETURN("es", es, FALSE);
 
-       return evas_get_layer(es->evas, es->bit);
+       return evas_object_layer_get(es->bit);
 }
 
 /**
@@ -380,13 +385,13 @@
  * Returns no value. Changes the layer of @es to @layer along with all of
  * it's style bits.
  */
-void estyle_set_layer(Estyle * es, int layer)
+void estyle_set_layer(Estyle *es, int layer)
 {
        int index = 0;
 
        CHECK_PARAM_POINTER("es", es);
 
-       evas_set_layer(es->evas, es->bit, layer - 1);
+       evas_object_layer_set(es->bit, layer - 1);
 
        /*
         * Changing the layer of the style bits must be broken into to steps to
@@ -395,7 +400,7 @@
        if (es->style)
                index = _estyle_style_set_layer_lower(es, layer);
 
-       evas_set_layer(es->evas, es->bit, layer);
+       evas_object_layer_set(es->bit, layer);
 
        if (es->style)
                _estyle_style_set_layer_upper(es, layer, index);
@@ -409,9 +414,11 @@
  */
 char *estyle_get_font(Estyle * es)
 {
+       char *font;
+       double size;
        CHECK_PARAM_POINTER_RETURN("es", es, NULL);
-
-       return evas_get_text_font(es->evas, es->bit);
+       evas_object_text_font_get(es->bit, &font, &size);
+       return font;
 }
 
 /**
@@ -419,12 +426,14 @@
  * @es: the estyle to get the font size from
  *
  * Returns the font size (an int) or FALSE if an error occurs.
- */
-int estyle_get_font_size(Estyle * es)
+ */  
+int estyle_get_font_size(Estyle *es)
 {
-       CHECK_PARAM_POINTER_RETURN("es", es, FALSE);
-
-       return evas_get_text_size(es->evas, es->bit);
+       char *font;
+       double size;
+       CHECK_PARAM_POINTER_RETURN("es", es, 0);
+       evas_object_text_font_get(es->bit, &font, &size);
+       return (int)size;
 }
 
 /**
@@ -434,12 +443,12 @@
  *
  * Returns no value. Changes the font for the specified estyle to @name.
  */
-void estyle_set_font(Estyle * es, char *font, int size)
+void estyle_set_font(Estyle *es, char *font, int size)
 {
        CHECK_PARAM_POINTER("es", es);
        CHECK_PARAM_POINTER("font", font);
 
-       evas_set_font(es->evas, es->bit, font, size);
+       evas_object_text_font_set(es->bit, font, size);
        if (es->style)
                _estyle_style_set_font(es, font, size);
 
@@ -452,12 +461,12 @@
  *
  * Returns an Evas_Object or NULL if no clip box specified.
  */
-Evas_Object estyle_get_clip(Estyle * es)
+Evas_Object *estyle_get_clip(Estyle *es)
 {
        CHECK_PARAM_POINTER_RETURN("es", es, NULL);
 
-       return evas_get_clip_object(es->evas, es->bit);
-}
+       return evas_object_clip_get(es->bit);
+} 
 
 /**
  * estyle_set_clip - set the clip box for the estyle
@@ -466,14 +475,14 @@
  *
  * Returns no value. Sets the clip box of the estyle to @clip.
  */
-void estyle_set_clip(Estyle * es, Evas_Object clip)
+void estyle_set_clip(Estyle *es, Evas_Object *clip)
 {
        CHECK_PARAM_POINTER("es", es);
 
        if (clip)
-               evas_set_clip(es->evas, es->bit, clip);
+               evas_object_clip_set(es->bit, clip);
        else
-               evas_unset_clip(es->evas, es->bit);
+               evas_object_clip_unset(es->bit);
 
        if (es->style)
                _estyle_style_set_clip(es, clip);
@@ -487,7 +496,7 @@
  * Returns TRUE if the bits are able to be merged, otherwise FALSE. Appends the
  * text in @es2 to the text in @es1 and destroys @es2.
  */
-int estyle_merge(Estyle * es1, Estyle * es2)
+int estyle_merge(Estyle *es1, Estyle *es2)
 {
        char *new_text, *text1, *text2;
 
@@ -501,8 +510,8 @@
         * These return a pointer to the actual text in the evas object, not a
         * copy of it. So don't free them.
         */
-       text1 = evas_get_text_string(es1->evas, es1->bit);
-       text2 = evas_get_text_string(es2->evas, es2->bit);
+       text1 = (char *)evas_object_text_text_get(es1->bit);
+       text2 = (char *)evas_object_text_text_get(es2->bit);
 
        /*
         * When the evas changes text it free's the old text, so malloc a new
@@ -533,7 +542,7 @@
  * Returns the newly created estyle on success, NULL on failure. The old
  * estyle is updated to reflect the changes.
  */
-Estyle *estyle_split(Estyle * es, unsigned int index)
+Estyle *estyle_split(Estyle *es, unsigned int index)
 {
        char temp;
        char *content;
@@ -599,6 +608,25 @@
 
        FREE(content);
 
+       /*
+        * Give this new estyle the same settings as the previous estyle.
+        */
+       estyle_set_clip(new_es, estyle_get_clip(es));
+       estyle_set_font(new_es, estyle_get_font(es), estyle_get_font_size(es));
+
+       /*
+        * Set the new color for the estyle.
+        */
+       estyle_get_color(es, &r, &g, &b, &a);
+       estyle_set_color(new_es, r, g, b, a);
+
+       /*
+        * Put it on the same layer as the old estyle
+        */
+       estyle_set_layer(new_es, estyle_get_layer(es));
+
+       FREE(content);
+
        return new_es;
 }
 
@@ -659,24 +687,20 @@
 
        CHECK_PARAM_POINTER("es", es);
 
-       evas_text_at(es->evas, es->bit, index, &xx, &yy, &ww, &hh);
+       evas_object_text_char_pos_get(es->bit, index,  &xx, &yy, &ww, &hh);
 
        if (char_x)
                *char_x = D2I_ROUND(xx) + es->x;
        if (char_y)
                *char_y = D2I_ROUND(yy) + es->y;
        if (char_w)
-               *char_w = D2I_ROUND(ww) + (es->style ?
-                                          es->style->info->left_push
-                                          +
-                                          es->style->info->
-                                          right_push : 0);
-       if (char_h)
-               *char_h = D2I_ROUND(hh) + (es->style ?
-                                          es->style->info->top_push
-                                          +
-                                          es->style->info->
-                                          bottom_push : 0);
+               *char_w = D2I_ROUND(ww) + (es->style ? 
+                       es->style->info->left_push
+                       + es->style->info->right_push : 0);
+        if (char_h)
+               *char_h = D2I_ROUND(hh) + (es->style ? 
+                       es->style->info->top_push
+                       + es->style->info->bottom_push : 0);
 }
 
 /**
@@ -701,27 +725,21 @@
 
        CHECK_PARAM_POINTER_RETURN("es", es, 0);
 
-       ret =
-           evas_text_at_position(es->evas, es->bit, (double) (x - es->x),
-                                 (double) (y - es->y), &xx, &yy, &ww,
-                                 &hh);
+       ret = evas_object_text_char_coords_get(es->bit, (double)(x - es->x),
+                       (double)(y - es->y + (es->h / 2)), &xx, &yy, &ww, &hh);
 
        if (char_x)
                *char_x = D2I_ROUND(xx) + es->x;
        if (char_y)
                *char_y = D2I_ROUND(yy) + es->y;
        if (char_w)
-               *char_w = D2I_ROUND(ww) + (es->style ?
-                                          es->style->info->left_push
-                                          +
-                                          es->style->info->
-                                          right_push : 0);
+               *char_w = D2I_ROUND(ww) + (es->style ? 
+                       es->style->info->left_push
+                       + es->style->info->right_push : 0);
        if (char_h)
-               *char_h = D2I_ROUND(hh) + (es->style ?
-                                          es->style->info->top_push
-                                          +
-                                          es->style->info->
-                                          bottom_push : 0);
+               *char_h = D2I_ROUND(hh) + (es->style ? 
+                       es->style->info->top_push
+                       + es->style->info->bottom_push : 0);
 
        return ret;
 }
@@ -774,7 +792,7 @@
 
        CHECK_PARAM_POINTER("es", es);
 
-       evas_get_geometry(es->evas, es->bit, &x, &y, &w, &h);
+       evas_object_geometry_get(es->bit, &x, &y, &w, &h);
        es->x = D2I_ROUND(x);
        es->y = D2I_ROUND(y);
        es->w = D2I_ROUND(w);
@@ -784,43 +802,34 @@
 /*
  * __estyle_update_position - update the position of the estyle
  */
-void __estyle_update_position(Estyle * es)
+void __estyle_update_position(Estyle *es)
 {
        if (es->style)
-               evas_move(es->evas, es->bit,
-                         (double) (es->x + (es->style ?
-                                            es->style->info->
-                                            left_push : 0)),
-                         (double) (es->y +
-                                   (es->style ? es->style->info->
-                                    top_push : 0)));
+               evas_object_move(es->bit,
+                       (double)(es->x + (es->style ?
+                               es->style->info->left_push : 0)),
+                       (double)(es->y + (es->style ?
+                               es->style->info->top_push : 0)));
 }
 
 /*
  * __estyle_update_dimensions - update the dimensions of the estyle
  */
-void __estyle_update_dimensions(Estyle * es)
+void __estyle_update_dimensions(Estyle *es)
 {
-       int layer;
        double x, y, w, h;
-
-       layer = evas_get_layer(es->evas, es->bit);
-       estyle_set_layer(es, layer);
-
+       
        /*
         * If the estyle doesn't have fixed dimensions then set it to the
         * geometry of it's contents.
         */
        if (!(es->flags & ESTYLE_BIT_FIXED)) {
-               evas_get_geometry(es->evas, es->bit, &x, &y, &w, &h);
+               evas_object_geometry_get(es->bit, &x, &y, &w, &h);
 
-               es->w =
-                   D2I_ROUND(w) +
-                   (es->style ? es->style->info->left_push +
-                    es->style->info->right_push : 0);
-               es->h =
-                   D2I_ROUND(h) + (es->style ? es->style->info->top_push +
-                                   es->style->info->bottom_push : 0);
+               es->w = D2I_ROUND(w) + (es->style ? es->style->info->left_push
+                       + es->style->info->right_push : 0);
+               es->h = D2I_ROUND(h) + (es->style ? es->style->info->top_push
+                       + es->style->info->bottom_push : 0);
        }
 }
 
@@ -835,11 +844,11 @@
  * @callback occurs, function @func will be called with argument @data.
  */
 void estyle_callback_add(Estyle * es, Evas_Callback_Type callback,
-                        void (*func) (void *_data, Estyle * _es, int _b,
-                                      int _x, int _y), void *data)
+                        void (*func) (void *_data, Estyle * _es, 
+                                      void *event_info), void *data)
 {
        Estyle_Callback *cb;
-       Evas_List l;
+       Evas_List *l;
 
        if (!es)
                return;
@@ -860,17 +869,16 @@
         * Append the callback to the estyle's list, and add the callback to
         * the evas bits so that the wrapper function gets called.
         */
-       es->callbacks = evas_list_append(es->callbacks, cb);
-       evas_callback_add(es->evas, es->bit, callback,
+       es->callbacks = evas_list_append(es->callbacks, (const void *)cb);
+       evas_object_event_callback_add(es->bit, callback,
                          __estyle_callback_dispatcher, cb);
        if (es->style->bits) {
                for (l = es->style->bits; l; l = l->next) {
-                       Evas_Object o;
+                       Evas_Object *o;
 
                        o = l->data;
-                       evas_callback_add(es->evas, o, callback,
-                                         __estyle_callback_dispatcher,
-                                         cb);
+                       evas_object_event_callback_add(o, callback,
+                                       __estyle_callback_dispatcher, cb);
                }
        }
 }
@@ -879,11 +887,11 @@
  * The dispatcher redirects the callback to the appropriate function with the
  * correct arguments.
  */
-void __estyle_callback_dispatcher(void *_data, Evas _e, Evas_Object _o,
-                                 int _b, int _x, int _y)
+void __estyle_callback_dispatcher(void *_data, Evas *_e, Evas_Object *_o,
+                                 void *event_info)
 {
        Estyle_Callback *cb = _data;
-       cb->callback(cb->data, cb->estyle, _b, _x, _y);
+       cb->callback(cb->data, cb->estyle, event_info);
 }
 
 /*
@@ -893,31 +901,21 @@
  *
  * Returns no value.
  */
-void estyle_callback_del(Estyle * es, Evas_Callback_Type callback)
+void estyle_callback_del(Estyle * es, Evas_Callback_Type callback,
+               Estyle_Callback_Function func)
 {
-       Evas_List l;
+       Evas_List *l;
 
        if (!es)
                return;
        if (!es->evas)
                return;
 
-       /*
-        * Remove the evas callbacks from the evas_objects.
-        */
-       evas_callback_del(es->evas, es->bit, callback);
-       for (l = es->style->bits; l; l = l->next) {
-               Evas_Object o;
-
-               o = l->data;
-               evas_callback_del(es->evas, o, callback);
-       }
-
        for (l = es->callbacks; l; l = l->next) {
                Estyle_Callback *cb;
 
                cb = l->data;
-               if (cb->type == callback) {
+               if (cb->type == callback && cb->callback == func) {
 
                        /*
                         * Move to the next item in the list, remove and free
===================================================================
RCS file: /cvsroot/enlightenment/e17/libs/estyle/src/estyle_color.c,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -3 -r1.6 -r1.7
--- estyle_color.c      19 May 2002 07:19:42 -0000      1.6
+++ estyle_color.c      14 Jan 2003 18:50:52 -0000      1.7
@@ -1,3 +1,4 @@
+#include "estyle-config.h"
 #include "Estyle_private.h"
 
 static Ewd_Hash *color_table = NULL;
===================================================================
RCS file: /cvsroot/enlightenment/e17/libs/estyle/src/estyle_style.c,v
retrieving revision 1.10
retrieving revision 1.11
diff -u -3 -r1.10 -r1.11
--- estyle_style.c      19 May 2002 07:19:42 -0000      1.10
+++ estyle_style.c      14 Jan 2003 18:50:56 -0000      1.11
@@ -1,3 +1,4 @@
+#include "estyle-config.h"
 #include "Estyle_private.h"
 
 #define SET_REL_COLOR(a, b) ((a + b) > 255 ? 255 : ((a + b) < 0 ? 0 : a + b))
@@ -7,8 +8,8 @@
 
 static void __estyle_style_read(Estyle_Style_Info * info);
 static void __estyle_style_info_load(Estyle_Style_Info * info);
-static Evas_Object __estyle_style_layer_draw(Estyle_Style_Layer * layer,
-                                            Estyle * es, char *text);
+static Evas_Object *__estyle_style_layer_draw(Estyle_Style_Layer * layer,
+               Estyle * es, char *text);
 static int __estyle_style_stack_compare(void *style1, void *style2);
 
 /*
@@ -44,14 +45,14 @@
  * Returns no value. The reference to the style is released and the style is
  * freed if appropriate.
  */
-void _estyle_style_release(Estyle_Style * style, Evas ev)
+void _estyle_style_release(Estyle_Style *style, Evas *ev)
 {
-       Evas_Object ob;
-       Evas_List ptr_list;
+       Evas_Object *ob;
+       Evas_List *ptr_list;
 
        CHECK_PARAM_POINTER("style", style);
 
-       _estyle_style_info_dereference((Estyle_Style_Info *) style->info);
+       _estyle_style_info_dereference((Estyle_Style_Info *)style->info);
 
        /*
         * Destroy the list of evas_objects
@@ -61,12 +62,12 @@
                /*
                 * Destroy all of the objects for this estyle
                 */
-               for (ptr_list = style->bits; ptr_list;
-                    ptr_list = ptr_list->next) {
+               for (ptr_list = style->bits; ptr_list; 
+                       ptr_list = ptr_list->next) {
 
                        ob = ptr_list->data;
-                       evas_hide(ev, ob);
-                       evas_del_object(ev, ob);
+                       evas_object_hide(ob);
+                       evas_object_del(ob);
                }
 
                /*
@@ -84,10 +85,10 @@
  *
  * Returns no value. Hides the style bits associated with the estyle @es.
  */
-void _estyle_style_hide(Estyle * es)
+void _estyle_style_hide(Estyle *es)
 {
-       Evas_Object ob;
-       Evas_List ptr_list;
+       Evas_Object *ob;
+       Evas_List *ptr_list;
 
        /*
         * Check if we need to hide any style bits.
@@ -98,11 +99,11 @@
        /*
         * Hide each bit of the style representation
         */
-       for (ptr_list = es->style->bits; ptr_list;
-            ptr_list = ptr_list->next) {
+       for (ptr_list = es->style->bits; ptr_list; 
+               ptr_list = ptr_list->next ) {
 
                ob = ptr_list->data;
-               evas_hide(es->evas, ob);
+               evas_object_hide(ob);
        }
 }
 
@@ -112,10 +113,10 @@
  *
  * Returns no value. Shows the style bits associated with the estyle @es.
  */
-void _estyle_style_show(Estyle * es)
+void _estyle_style_show(Estyle *es)
 {
-       Evas_Object ob;
-       Evas_List ptr_list;
+       Evas_Object *ob;
+       Evas_List *ptr_list;
 
        /*
         * Check if we need to show any style bits.
@@ -126,11 +127,11 @@
        /*
         * Hide each bit of the style representation
         */
-       for (ptr_list = es->style->bits; ptr_list;
-            ptr_list = ptr_list->next) {
+       for (ptr_list = es->style->bits; ptr_list; 
+               ptr_list = ptr_list->next ) {
 
                ob = ptr_list->data;
-               evas_show(es->evas, ob);
+               evas_object_show(ob);
        }
 }
 
@@ -171,12 +172,12 @@
  * Returns no value. Adds the evas objects for the style bits of the main text
  * layer.
  */
-void _estyle_style_draw(Estyle * es, char *text)
+void _estyle_style_draw(Estyle *es, char *text)
 {
        int i = 0;
        Estyle_Style_Info *info;
        Estyle_Style_Layer *layer;
-       Evas_Object ob;
+       Evas_Object *ob;
 
        if (!es->style)
                return;
@@ -192,13 +193,11 @@
         */
        while ((layer = _estyle_heap_item(info->layers, i))) {
                ob = __estyle_style_layer_draw(layer, es, text);
-               ((Estyle_Style *) es->style)->bits =
-                   evas_list_append(((Estyle_Style *) es->style)->bits,
-                                    ob);
+               ((Estyle_Style *) es->style)->bits = evas_list_append( ((Estyle_Style 
+*)es->style)->bits, ob );
                i++;
        }
 
-       ob = evas_get_clip_object(es->evas, es->bit);
+       ob = evas_object_clip_get(es->bit);
        if (ob)
                _estyle_style_set_clip(es, ob);
 }
@@ -215,8 +214,8 @@
        int i = 0;
        Estyle_Style_Info *info;
        Estyle_Style_Layer *layer;
-       Evas_Object ob;
-       Evas_List ptr_list;
+       Evas_Object *ob;
+       Evas_List *ptr_list;
 
        if (!es->style)
                return 0;
@@ -229,14 +228,14 @@
        /*
         * Move all of the lower layers bits into the correct layer
         */
-       while ((layer = _estyle_heap_item(info->layers, i))
-              && layer->stack < 0) {
+       while ((layer = _estyle_heap_item(info->layers, i)) 
+               && layer->stack < 0) {
 
-               for (ptr_list = es->style->bits; ptr_list;
-                    ptr_list = ptr_list->next) {
+               for (ptr_list = es->style->bits; ptr_list; 
+                       ptr_list = ptr_list->next ) {
 
                        ob = ptr_list->data;
-                       evas_set_layer(es->evas, ob, l);
+                       evas_object_layer_set(ob, l);
                }
                i++;
        }
@@ -253,14 +252,14 @@
  * Returns no value. Adds the evas objects for the style bits that are above
  * the main text layer.
  */
-int _estyle_style_set_layer_upper(Estyle * es, int l, int start)
+int _estyle_style_set_layer_upper(Estyle *es, int l, int start)
 {
        char *text;
        int i = start;
        Estyle_Style_Info *info;
        Estyle_Style_Layer *layer;
-       Evas_Object ob;
-       Evas_List ptr_list;
+       Evas_Object *ob;
+       Evas_List *ptr_list;
 
        if (!es->bit)
                return 0;
@@ -268,7 +267,7 @@
        if (!es->style)
                return 0;
 
-       text = evas_get_text_string(es->evas, es->bit);
+       text = (char *)evas_object_text_text_get(es->bit);
 
        info = ((Estyle_Style *) es->style)->info;
 
@@ -278,14 +277,14 @@
        /*
         * Move all of the upper bits into the correct layer
         */
-       while ((layer = _estyle_heap_item(info->layers, i))
-              && layer->stack) {
+       while ((layer = _estyle_heap_item(info->layers, i)) 
+               && layer->stack) {
 
-               for (ptr_list = es->style->bits; ptr_list;
-                    ptr_list = ptr_list->next) {
+               for (ptr_list = es->style->bits; ptr_list; 
+                       ptr_list = ptr_list->next ) {
 
                        ob = ptr_list->data;
-                       evas_set_layer(es->evas, ob, l);
+                       evas_object_layer_set(ob, l);
                }
 
                i++;
@@ -301,11 +300,11 @@
  * Returns no value. Moves all of the evas objects representing style bits
  * into their correct relative positions to @es.
  */
-void _estyle_style_move(Estyle * es)
+void _estyle_style_move(Estyle *es)
 {
        int i;
-       Evas_Object ob;
-       Evas_List ptr_list;
+       Evas_Object *ob;
+       Evas_List *ptr_list;
        Estyle_Style_Info *info;
        Estyle_Style_Layer *layer;
 
@@ -316,7 +315,7 @@
         * Prepare to traverse the list of bits and layers to get the correct
         * layout.
         */
-       info = (Estyle_Style_Info *) es->style->info;
+       info = (Estyle_Style_Info *)es->style->info;
        ptr_list = es->style->bits;
        i = 0;
 
@@ -326,11 +325,11 @@
         * have the same number of items in them, but check for that just in
         * case there isn't.
         */
-       while (ptr_list && info->layers &&
+       while (ptr_list && 
                (layer = _estyle_heap_item(info->layers, i++)) != NULL &&
                (ob = ptr_list->data) != NULL) {
                
-               evas_move(es->evas, ob, (double)(es->x + layer->x_offset +
+               evas_object_move(ob, (double)(es->x + layer->x_offset +
                                        info->left_push),
                                        (double)(es->y + layer->y_offset +
                                        info->right_push));
@@ -346,11 +345,11 @@
  * Returns no value. Changes the color for the relative layers of the style for
  * @es.
  */
-void _estyle_style_set_color(Estyle * es)
+void _estyle_style_set_color(Estyle *es)
 {
        int i;
-       Evas_Object sob;
-       Evas_List ptr_list;
+       Evas_Object *sob;
+       Evas_List *ptr_list;
        Estyle_Style_Info *info;
        Estyle_Style_Layer *layer;
 
@@ -379,8 +378,8 @@
         * case there isn't.
         */
        while (ptr_list &&
-              (layer = _estyle_heap_item(info->layers, i++)) != NULL &&
-              (sob = ptr_list->data) != NULL) {
+               (layer = _estyle_heap_item(info->layers, i++)) != NULL &&
+               (sob = ptr_list->data) != NULL) {
 
                if (layer->relative_color) {
                        int r, g, b, a;
@@ -390,7 +389,7 @@
                        b = SET_REL_COLOR(es->color->b, layer->b);
                        a = SET_REL_COLOR(es->color->a, layer->a);
 
-                       evas_set_color(es->evas, sob, r, g, b, a);
+                       evas_object_color_set(sob, r, g, b, a);
                }
 
                ptr_list = ptr_list->next;
@@ -403,11 +402,11 @@
  *
  * Returns no value. Updates the font for the estyle @es.
  */
-void _estyle_style_set_font(Estyle * es, char *font, int size)
+void _estyle_style_set_font(Estyle *es, char *font, int size)
 {
        int i;
-       Evas_Object sob;
-       Evas_List ptr_list;
+       Evas_Object *sob;
+       Evas_List *ptr_list;
        Estyle_Style_Info *info;
        Estyle_Style_Layer *layer;
 
@@ -431,10 +430,10 @@
         * case there isn't.
         */
        while (ptr_list &&
-              (layer = _estyle_heap_item(info->layers, i++)) != NULL &&
-              (sob = ptr_list->data) != NULL) {
+               (layer = _estyle_heap_item(info->layers, i++)) != NULL &&
+               (sob = ptr_list->data) != NULL) {
 
-               evas_set_font(es->evas, sob, font, size);
+               evas_object_text_font_set(sob, font, size);
                ptr_list = ptr_list->next;
        }
 }
@@ -445,12 +444,12 @@
  *
  * Returns no value. Updates the text for the estyle @es.
  */
-void _estyle_style_set_text(Estyle * es)
+void _estyle_style_set_text(Estyle *es)
 {
        int i;
        char *text;
-       Evas_Object sob;
-       Evas_List ptr_list;
+       Evas_Object *sob;
+       Evas_List *ptr_list;
        Estyle_Style_Info *info;
        Estyle_Style_Layer *layer;
 
@@ -461,7 +460,7 @@
         * Prepare to traverse the list of bits and layers to get the correct
         * layout.
         */
-       text = evas_get_text_string(es->evas, es->bit);
+       text = (char *)evas_object_text_text_get(es->bit);
        if (!text)
                return;
 
@@ -478,10 +477,10 @@
         * case there isn't.
         */
        while (ptr_list &&
-              (layer = _estyle_heap_item(info->layers, i++)) != NULL &&
-              (sob = ptr_list->data) != NULL) {
-
-               evas_set_text(es->evas, sob, text);
+               (layer = _estyle_heap_item(info->layers, i++)) != NULL &&
+               (sob = ptr_list->data) != NULL) {
+                       
+               evas_object_text_text_set(sob, text);
                ptr_list = ptr_list->next;
        }
 }
@@ -494,11 +493,11 @@
  * Returns no value. Changes the clip rectangle for each evas object used to
  * represent the style for @es.
  */
-void _estyle_style_set_clip(Estyle * es, Evas_Object ob)
+void _estyle_style_set_clip(Estyle *es, Evas_Object *ob)
 {
        int i;
-       Evas_Object sob;
-       Evas_List ptr_list;
+       Evas_Object *sob;
+       Evas_List *ptr_list;
        Estyle_Style_Info *info;
        Estyle_Style_Layer *layer;
 
@@ -509,8 +508,8 @@
         * Prepare to traverse the list of bits and layers to get the correct
         * layout.
         */
-       info = (Estyle_Style_Info *) es->style->info;
-
+       info = (Estyle_Style_Info *)es->style->info;
+       
        ptr_list = es->style->bits;
 
        i = 0;
@@ -522,12 +521,12 @@
         * case there isn't.
         */
        while (ptr_list &&
-              (layer = _estyle_heap_item(info->layers, i++)) != NULL &&
-              (sob = ptr_list->data) != NULL) {
+               (layer = _estyle_heap_item(info->layers, i++)) != NULL &&
+               (sob = ptr_list->data) != NULL) {
                if (!ob)
-                       evas_unset_clip(es->evas, sob);
+                       evas_object_clip_unset(sob);
                else
-                       evas_set_clip(es->evas, sob, ob);
+                       evas_object_clip_set(sob, ob);
 
                ptr_list = ptr_list->next;
        }
@@ -578,7 +577,7 @@
  * _estyle_style_info_dereference - remove a reference to a style_info structure
  * @info: the style info struct to dereference
  */
-void _estyle_style_info_dereference(Estyle_Style_Info * info)
+void _estyle_style_info_dereference(Estyle_Style_Info *info)
 {
        info->references--;
 
@@ -602,26 +601,26 @@
  * @layer: the layer to be drawn
  * @es: used to get info about the evas for drawing
  */
-static Evas_Object __estyle_style_layer_draw(Estyle_Style_Layer * layer,
-                                            Estyle * es, char *text)
+static Evas_Object *__estyle_style_layer_draw(Estyle_Style_Layer *layer,
+               Estyle *es, char *text)
 {
        int r, g, b, a;
        char *font;
-       int size;
-       Evas_Object ret;
+       double size;
+       Evas_Object *ret;
 
        /*
         * Create the text at the correct size and move it into position
         */
-       font = evas_get_text_font(es->evas, es->bit);
-       size = evas_get_text_size(es->evas, es->bit);
-       ret =
-           evas_add_text(es->evas, font, size + layer->size_change, text);
-
-       evas_move(es->evas, ret, (double) (es->x + layer->x_offset +
-                                          es->style->info->left_push),
-                 (double) (es->y + layer->y_offset +
-                           es->style->info->top_push));
+       evas_object_text_font_get(es->bit, &font, &size);
+       ret = evas_object_text_add(es->evas);
+       evas_object_text_font_set(ret, font, size + layer->size_change);
+       evas_object_text_text_set(ret, text); 
+
+       evas_object_move(ret, (double)(es->x + layer->x_offset +
+                                es->style->info->left_push),
+                       (double)(es->y + layer->y_offset +
+                                es->style->info->top_push));
 
        /*
         * Now determine if it has relative or absolute color and change it's
@@ -643,7 +642,7 @@
                a = layer->a;
        }
 
-       evas_set_color(es->evas, ret, r, g, b, a);
+       evas_object_color_set(ret, r, g, b, a);
 
        return ret;
 }
@@ -704,7 +703,7 @@
                return;
        /*
           if (info->layers)
-          _estyle_heap_destroy(info->layers);
+               _estyle_heap_destroy(info->layers);
         */
 
        /*
@@ -719,8 +718,7 @@
                return;
        }
 
-       info->layers =
-           _estyle_heap_new(__estyle_style_stack_compare, layers);
+       info->layers = _estyle_heap_new(__estyle_style_stack_compare, layers);
 
        /*
         * Read in each layer
===================================================================
RCS file: /cvsroot/enlightenment/e17/libs/estyle/src/estyle_style.h,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -3 -r1.6 -r1.7
--- estyle_style.h      19 May 2002 07:19:42 -0000      1.6
+++ estyle_style.h      14 Jan 2003 18:51:01 -0000      1.7
@@ -37,7 +37,7 @@
 typedef struct _estyle_style Estyle_Style;
 struct _estyle_style {
        Estyle_Style_Info *info;
-       Evas_List bits;
+       Evas_List *bits;
 };
 
 
@@ -45,31 +45,31 @@
  * Style constructors and destructors
  */
 Estyle_Style *_estyle_style_instance(char *name);
-void _estyle_style_release(Estyle_Style * style, Evas ev);
+void _estyle_style_release(Estyle_Style * style, Evas *ev);
 
 /*
  * Style display modifiers.
  */
 void _estyle_style_draw(Estyle * et, char *text);
 void _estyle_style_move(Estyle * bit);
-void _estyle_style_set_clip(Estyle * bit, Evas_Object ob);
+void _estyle_style_set_clip(Estyle * bit, Evas_Object *ob);
 void _estyle_style_set_color(Estyle * bit);
-void _estyle_style_set_font(Estyle * es, char *font, int size);
-void _estyle_style_set_text(Estyle * es);
+void _estyle_style_set_font(Estyle *es, char *font, int size);
+void _estyle_style_set_text(Estyle *es);
 int _estyle_style_set_layer_lower(Estyle * bit, int layer);
 int _estyle_style_set_layer_upper(Estyle * bit, int layer, int start);
 
 /*
  * Style info access functions
  */
-void _estyle_style_info_dereference(Estyle_Style_Info * info);
+void _estyle_style_info_dereference(Estyle_Style_Info *info);
 Estyle_Style_Info *_estyle_style_info_reference(char *name);
 
 /*
  * Style show and hide functions
  */
-void _estyle_style_show(Estyle * es);
-void _estyle_style_hide(Estyle * es);
+void _estyle_style_show(Estyle *es);
+void _estyle_style_hide(Estyle *es);
 
 /*
  * Style search path manipulators




-------------------------------------------------------
This SF.NET email is sponsored by: Take your first step towards giving 
your online business a competitive advantage. Test-drive a Thawte SSL 
certificate - our easy online guide will show you how. Click here to get 
started: http://ads.sourceforge.net/cgi-bin/redirect.pl?thaw0027en
_______________________________________________
enlightenment-cvs mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/enlightenment-cvs

Reply via email to