Enlightenment CVS committal

Author  : moom
Project : e17
Module  : apps/e

Dir     : e17/apps/e/src/bin


Modified Files:
        e_editable.c e_editable.h 


Log Message:
* [Editable] remove e_entry_selectable_get/set() because it's useless
* [Editable] small fixes


===================================================================
RCS file: /cvs/e/e17/apps/e/src/bin/e_editable.c,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -3 -r1.3 -r1.4
--- e_editable.c        12 Aug 2006 20:51:29 -0000      1.3
+++ e_editable.c        19 Aug 2006 13:53:32 -0000      1.4
@@ -26,7 +26,6 @@
    int cursor_visible;
    int selection_pos;
    int selection_visible;
-   int selectable;
    int password_mode;
    
    char *text;
@@ -97,7 +96,6 @@
         _e_editable_smart_use = 0;
      }
    
-   _e_editable_smart_use++;
    return evas_object_smart_add(evas, _e_editable_smart);
 }
 
@@ -152,6 +150,8 @@
      }
    
    /* TODO: font */
+   sd->average_char_w = -1;
+   sd->average_char_h = -1;
    
    _e_editable_cursor_update(editable);
 }
@@ -512,9 +512,9 @@
      return;
    
    sd->cursor_visible = 0;
-   if (evas_object_visible_get(editable))
+   evas_object_hide(sd->cursor_object);
+   if (sd->cursor_timer)
      {
-        evas_object_hide(sd->cursor_object);
         ecore_timer_del(sd->cursor_timer);
         sd->cursor_timer = NULL;
      }
@@ -543,9 +543,7 @@
 }
 
 /**
- * Gets the position of the selection bound of the editable object. If the
- * editable object is not selectable, this function returns the position of the
- * cursor instead.
+ * Gets the position of the selection bound of the editable object
  *
  * @param editable an editable object
  * @return Returns the position of the selection bound of the editable object
@@ -557,7 +555,7 @@
    
    if ((!editable) || (!(sd = evas_object_smart_data_get(editable))))
      return 0;
-   return sd->selectable ? sd->selection_pos : sd->cursor_pos;
+   return sd->selection_pos;
 }
 
 /**
@@ -653,8 +651,7 @@
 }
 
 /**
- * Shows the selection of the editable object. The editable object need to be
- * selectable (see e_editable_selectable_set())
+ * Shows the selection of the editable object
  *
  * @param editable an editable object
  */
@@ -669,7 +666,7 @@
      return;
    
    sd->selection_visible = 1;
-   if ((sd->selectable) && (evas_object_visible_get(editable)) &&
+   if ((evas_object_visible_get(editable)) &&
        (sd->cursor_pos != sd->selection_pos))
      evas_object_show(sd->selection_object);
 }
@@ -694,53 +691,6 @@
 }
 
 /**
- * Sets whether or not the editable object is selectable. If the editable 
object
- * is not selectable, the selection rectangle won't be shown, and
- * e_editable_selection_pos_get() will then return the position of the cursor
- *
- * @param editable an editable object
- * @param selection 1 to make the editable object selectable, 0 otherwise
- */
-EAPI void
-e_editable_selectable_set(Evas_Object *editable, int selectable)
-{
-   E_Editable_Smart_Data *sd;
-   
-   if ((!editable) || (!(sd = evas_object_smart_data_get(editable))))
-     return;
-   if (sd->selectable == selectable)
-     return;
-   
-   sd->selectable = selectable;
-   
-   if (sd->selectable)
-     e_editable_unselect_all(editable);
-   
-   if ((sd->selectable) && (sd->selection_visible) &&
-       (evas_object_visible_get(editable)) &&
-       (sd->cursor_pos != sd->selection_pos))
-     evas_object_show(sd->selection_object);
-   else
-     evas_object_hide(sd->selection_object);
-}
-
-/**
- * Gets whether or not the editable object is selectable
- *
- * @param editable an editable object
- * @return Returns 1 if the editable object is selectable, 0 otherwise
- */
-EAPI int
-e_editable_selectable_get(Evas_Object *editable)
-{
-   E_Editable_Smart_Data *sd;
-   
-   if ((!editable) || (!(sd = evas_object_smart_data_get(editable))))
-     return 0;
-   return sd->selectable;
-}
-
-/**
  * Gets the cursor position at the coords ( @a x, @a y ). It's used to know
  * where to place the cursor or the selection bound on mouse evevents.
  *
@@ -869,7 +819,6 @@
      index = evas_string_char_next_get(sd->text, index, NULL);
    
    if ((unicode_length <= 0) || (char_length <= 0))
-   if ((unicode_length <= 0) || (char_length <= 0))
      return 0;
    
    prev_length = sd->char_length;
@@ -993,8 +942,7 @@
    if ((!editable) || (!(sd = evas_object_smart_data_get(editable))))
      return;
    
-   if ((sd->cursor_pos == sd->selection_pos) ||
-      (!sd->selection_visible) || (!sd->selectable))
+   if ((sd->cursor_pos == sd->selection_pos) || (!sd->selection_visible))
      evas_object_hide(sd->selection_object);
    else
      {
@@ -1146,6 +1094,7 @@
    if (!sd)
      return;
    
+   _e_editable_smart_use++;
    evas_object_smart_data_set(object, sd);
    
    sd->text = malloc((E_EDITABLE_BLOCK_SIZE + 1) * sizeof(char));
@@ -1160,15 +1109,14 @@
    sd->font_style = EVAS_TEXT_STYLE_PLAIN;
    sd->cursor_width = 1;
    sd->selection_on_fg = 0;
-   sd->average_char_w = 0;
-   sd->average_char_h = 0;
+   sd->average_char_w = -1;
+   sd->average_char_h = -1;
    
    sd->cursor_timer = NULL;
    sd->cursor_pos = 0;
    sd->cursor_visible = 1;
    sd->selection_pos = 0;
    sd->selection_visible = 1;
-   sd->selectable = 1;
    sd->password_mode = 0;
 
    sd->clip_object = evas_object_rectangle_add(evas);
@@ -1292,8 +1240,7 @@
           }
      }
    
-   if ((sd->selectable) && (sd->selection_visible) &&
-      (sd->cursor_pos != sd->selection_pos))
+   if ((sd->selection_visible) && (sd->cursor_pos != sd->selection_pos))
      evas_object_show(sd->selection_object);
 }
 
===================================================================
RCS file: /cvs/e/e17/apps/e/src/bin/e_editable.h,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -3 -r1.3 -r1.4
--- e_editable.h        12 Aug 2006 20:51:29 -0000      1.3
+++ e_editable.h        19 Aug 2006 13:53:32 -0000      1.4
@@ -37,8 +37,6 @@
 EAPI void         e_editable_unselect_all            (Evas_Object *editable);
 EAPI void         e_editable_selection_show          (Evas_Object *editable);
 EAPI void         e_editable_selection_hide          (Evas_Object *editable);
-EAPI void         e_editable_selectable_set          (Evas_Object *editable, 
int selectable);
-EAPI int          e_editable_selectable_get          (Evas_Object *editable);
 
 EAPI int          e_editable_pos_get_from_coords     (Evas_Object *editable, 
Evas_Coord x, Evas_Coord y);
 EAPI void         e_editable_char_size_get           (Evas_Object *editable, 
int *w, int *h);



-------------------------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
_______________________________________________
enlightenment-cvs mailing list
enlightenment-cvs@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/enlightenment-cvs

Reply via email to