Enlightenment CVS committal
Author : raster
Project : e17
Module : libs/edje
Dir : e17/libs/edje/src/lib
Modified Files:
Edje.h Edje_Edit.h edje_embryo.c edje_private.h edje_util.c
edje_var.c
Log Message:
add stuff for evoak... and edje list vars... :)
===================================================================
RCS file: /cvsroot/enlightenment/e17/libs/edje/src/lib/Edje.h,v
retrieving revision 1.27
retrieving revision 1.28
diff -u -3 -r1.27 -r1.28
--- Edje.h 2 Apr 2004 09:16:52 -0000 1.27
+++ Edje.h 3 Jun 2004 09:14:55 -0000 1.28
@@ -21,68 +21,524 @@
extern "C" {
#endif
+/***************************************************************************/
+
+ /** Initialize the EDJE library.
+ *
+ * @return The new init count.
+ */
int edje_init (void);
+
+ /** Shutdown the EET library.
+ *
+ * @return The new init count.
+ */
int edje_shutdown (void);
+
+ /** Set the frametime
+ * @param t The frametime
+ *
+ * Sets the frametime in seconds, by default this is 1/60.
+ */
void edje_frametime_set (double t);
+
+ /** Get the frametime
+ * @return The frametime
+ *
+ * Returns the frametime in seconds, by default this is 1/60.
+ */
double edje_frametime_get (void);
+
+ /** Freeze all objects in the Edje.
+ */
void edje_freeze (void);
+
+ /** Thaw all objects in Edje
+ */
void edje_thaw (void);
+ /** Get the collection list from the edje file ?!
+ * @param file The file path?
+ *
+ * @return The file Evas List of files
+ */
Evas_List *edje_file_collection_list (const char *file);
+
+ /** Free file collection ?!
+ * @param lst The Evas List of files
+ *
+ * Frees the file collection.
+ */
void edje_file_collection_list_free (Evas_List *lst);
+
+ /** Get edje file data
+ * @param file The file
+ * @param key The data key
+ * @return The file data string
+ */
char *edje_file_data_get (const char *file, const char *key);
+
+
+ /** Set Edje color class
+ * @param color_class
+ * @param r Object Red value
+ * @param g Object Green value
+ * @param b Object Blue value
+ * @param a Object Alpha value
+ * @param r2 Outline Red value
+ * @param g2 Outline Green value
+ * @param b2 Outline Blue value
+ * @param a2 Outline Alpha value
+ * @param r3 Shadow Red value
+ * @param g3 Shadow Green value
+ * @param b3 Shadow Blue value
+ * @param a3 Shadow Alpha value
+ *
+ * Sets the color class for the Edje.
+ */
void edje_color_class_set(const char *color_class, int r, int g, int b,
int a, int r2, int g2, int b2, int a2, int r3, int g3, int b3, int a3);
+
+ /** Set the Edje text class
+ * @param text_class The text class name ?!
+ * @param font The font name
+ * @param size The font size
+ *
+ * This sets the Edje text class ?!
+ */
void edje_text_class_set(const char *text_class, const char *font,
Evas_Font_Size size);
+ /** Set the object minimum size
+ * @param obj A valid Evas_Object handle
+ * @param minw The minimum width
+ * @param minh The minimum height
+ *
+ * This sets the minimum size restriction for the object.
+ */
void edje_extern_object_min_size_set (Evas_Object *obj, Evas_Coord minw,
Evas_Coord minh);
+
+ /** Set the object maximum size
+ * @param obj A vaild Evas_Object handle
+ * @param maxw The maximum width
+ * @param maxh The maximum height
+ *
+ * This sets the maximum size restriction for the object.
+ */
void edje_extern_object_max_size_set (Evas_Object *obj, Evas_Coord maxw,
Evas_Coord maxh);
+ /** Contruct edje object ?! What's the correct terminology?
+ * @param evas A valid Evas handle
+ * @return The Evas_Object pointer.
+ */
Evas_Object *edje_object_add (Evas *evas);
+
+ /** Get Edje object data
+ * @param obj A valid Evas_Object handle
+ * @param key The data key
+ * @return The data string
+ */
const char *edje_object_data_get (Evas_Object *obj, const char *key);
- int edje_object_file_set (Evas_Object *o, const char *file,
const char *part);
- void edje_object_file_get (Evas_Object *o, const char **file,
const char **part);
- int edje_object_load_error_get (Evas_Object *o);
- void edje_object_signal_callback_add (Evas_Object *o, const char
*emission, const char *source, void (*func) (void *data, Evas_Object *o, const char
*emission, const char *source), void *data);
- void *edje_object_signal_callback_del (Evas_Object *o, const char
*emission, const char *source, void (*func) (void *data, Evas_Object *o, const char
*emission, const char *source));
- void edje_object_signal_emit (Evas_Object *o, const char
*emission, const char *source);
- void edje_object_play_set (Evas_Object *o, int play);
- int edje_object_play_get (Evas_Object *o);
- void edje_object_animation_set (Evas_Object *o, int on);
- int edje_object_animation_get (Evas_Object *o);
- int edje_object_freeze (Evas_Object *o);
- int edje_object_thaw (Evas_Object *o);
- void edje_object_color_class_set (Evas_Object *o, const char
*color_class, int r, int g, int b, int a, int r2, int g2, int b2, int a2, int r3, int
g3, int b3, int a3);
- void edje_object_text_class_set (Evas_Object *o, const char
*text_class, const char *font, Evas_Font_Size size);
- void edje_object_size_min_get (Evas_Object *o, Evas_Coord *minw,
Evas_Coord *minh);
- void edje_object_size_max_get (Evas_Object *o, Evas_Coord *maxw,
Evas_Coord *maxh);
- void edje_object_size_min_calc (Evas_Object *o, Evas_Coord *minw,
Evas_Coord *minh);
- int edje_object_part_exists (Evas_Object *o, const char *part);
- void edje_object_part_geometry_get (Evas_Object *o, const char *part,
Evas_Coord *x, Evas_Coord *y, Evas_Coord *w, Evas_Coord *h);
- void edje_object_part_text_set (Evas_Object *o, const char *part,
const char *text);
- const char *edje_object_part_text_get (Evas_Object *o, const char *part);
- void edje_object_part_swallow (Evas_Object *o, const char *part,
Evas_Object *o_swallow);
- void edje_object_part_unswallow (Evas_Object *o, Evas_Object
*o_swallow);
- Evas_Object *edje_object_part_swallow_get (Evas_Object *o, const char *part);
- const char *edje_object_part_state_get (Evas_Object *o, const char *part,
double *val_ret);
- int edje_object_part_drag_dir_get (Evas_Object *o, const char *part);
- void edje_object_part_drag_value_set (Evas_Object *o, const char *part,
double dx, double dy);
- void edje_object_part_drag_value_get (Evas_Object *o, const char *part,
double *dx, double *dy);
- void edje_object_part_drag_size_set (Evas_Object *o, const char *part,
double dw, double dh);
- void edje_object_part_drag_size_get (Evas_Object *o, const char *part,
double *dw, double *dh);
- void edje_object_part_drag_step_set (Evas_Object *o, const char *part,
double dx, double dy);
- void edje_object_part_drag_step_get (Evas_Object *o, const char *part,
double *dx, double *dy);
- void edje_object_part_drag_page_set (Evas_Object *o, const char *part,
double dx, double dy);
- void edje_object_part_drag_page_get (Evas_Object *o, const char *part,
double *dx, double *dy);
- void edje_object_part_drag_step (Evas_Object *o, const char *part,
double dx, double dy);
- void edje_object_part_drag_page (Evas_Object *o, const char *part,
double dx, double dy);
- int edje_object_variable_id_get (Evas_Object *o, char *name);
- int edje_object_variable_int_get (Evas_Object *o, int id);
- void edje_object_variable_int_set (Evas_Object *o, int id, int val);
- double edje_object_variable_float_get (Evas_Object *o, int id);
- void edje_object_variable_float_set (Evas_Object *o, int id, double val);
- char *edje_object_variable_str_get (Evas_Object *o, int id);
- void edje_object_variable_str_set (Evas_Object *o, int id, char *str);
+
+ /** Sets the .eet location and loads the Edje. ?! Assuming eet file
+ * @param obj A valid Evas_Object handle
+ * @param file The path to the .eet file
+ * @param part The group name in the eet
+ * @return 0 on Error\n
+ * 1 on Success
+ *
+ * This loads the .eet file and sets up the Edje.
+ */
+ int edje_object_file_set (Evas_Object *obj, const char *file,
const char *part);
+
+ /** Get the .eet location and group for the Evas Object. ?! Assuming eet file
+ * @param obj A valid Evas_Object handle
+ * @param file The .eet file location pointer
+ * @param part The eet part pointer
+ *
+ * @ return 0 on Error\n
+ * 1 on Success
+ *
+ * This gets the .eet file location and group for the given Evas_Object.
+ */
+ void edje_object_file_get (Evas_Object *obj, const char **file,
const char **part);
+
+ /** Get the Edje load error
+ * @param obj A valid Evas_Object handle
+ *
+ * @return The load error from the object's Edje. 1/0, one being no error ?!
+ */
+ int edje_object_load_error_get (Evas_Object *obj);
+
+ /** Adds a callback for the object.
+ * @param obj A valid Evas_Object handle
+ * @param emission Signal to activate callback ?!
+ * @param source Source of signal
+ * @param func The function to be executed when the callback is signaled
+ *
+ * Creates a callback for the object to execute the given function.
+ */
+ void edje_object_signal_callback_add (Evas_Object *obj, const char
*emission, const char *source, void (*func) (void *data, Evas_Object *obj, const char
*emission, const char *source), void *data);
+
+ /** Delete an object callback
+ * @param obj A valid Evas_Object handle
+ * @param emission ?!
+ * @param source ?!
+ *
+ * Deletes an existing callback
+ */
+ void *edje_object_signal_callback_del (Evas_Object *obj, const char
*emission, const char *source, void (*func) (void *data, Evas_Object *obj, const char
*emission, const char *source));
+
+ /** Send a signal to the Edje
+ * @param A vaild Evas_Object handle
+ * @param emission The signal
+ * @param source The signal source
+ *
+ * This sends a signal to the edje. These are defined in the programs section of
an edc. ?! Better description of signals
+ */
+ void edje_object_signal_emit (Evas_Object *obj, const char
*emission, const char *source);
+
+ /** Set the Edje to play or pause
+ * @param obj A vaild Evas_Object handle
+ * @param play Play instruction (1 to play, 0 to pause)
+ *
+ * This sets the Edje to play or pause depending on the parameter. This has no
effect if the Edje is already in that state. ?! Better description
+ */
+ void edje_object_play_set (Evas_Object *obj, int play);
+
+ /** Get the Edje play/pause state
+ * @param obj A valid Evas_Object handle
+ * @return 0 if Edje not connected, Edje delete_me, or Edje paused\n
+ * 1 if Edje set to play
+ */
+ int edje_object_play_get (Evas_Object *obj);
+
+ /** Set
+ * @param obj A valid Evas_Object handle
+ * @param on ?!
+ */
+ void edje_object_animation_set (Evas_Object *obj, int on);
+
+ /** Get the Edje object animation state
+ * @param obj A valid Evas_Object handle
+ * @return 0 on Error or not animated\n ?!
+ * 1 if animated
+ */
+ int edje_object_animation_get (Evas_Object *obj);
+
+ /** Freeze object
+ * @param obj A valid Evas_Object handle
+ * @return The frozen state\n
+ * 0 on Error
+ *
+ * This puts all changes on hold. Successive freezes will nest, requiring an equal
number of thaws.
+ */
+ int edje_object_freeze (Evas_Object *obj);
+
+ /** Thaw object
+ * @param obj A valid Evas_Object handle
+ * @return The frozen state\n
+ * 0 on Error
+ *
+ * This allows frozen changes to occur.
+ */
+ int edje_object_thaw (Evas_Object *obj);
+
+ /** Sets the object color class
+ * @param color_class
+ * @param r Object Red value
+ * @param g Object Green value
+ * @param b Object Blue value
+ * @param a Object Alpha value
+ * @param r2 Outline Red value
+ * @param g2 Outline Green value
+ * @param b2 Outline Blue value
+ * @param a2 Outline Alpha value
+ * @param r3 Shadow Red value
+ * @param g3 Shadow Green value
+ * @param b3 Shadow Blue value
+ * @param a3 Shadow Alpha value
+ *
+ * Applys the color class to the object, where the first color is the object, the
second is the outline, and the third is the shadow.
+ */
+ void edje_object_color_class_set (Evas_Object *obj, const char
*color_class, int r, int g, int b, int a, int r2, int g2, int b2, int a2, int r3, int
g3, int b3, int a3);
+
+ /** Sets Edje text class
+ * @param text_class The text class name
+ * @param font Font name
+ * @param size Font Size
+ *
+ * Sets the text class for the Edje.
+ */
+ void edje_object_text_class_set (Evas_Object *obj, const char
*text_class, const char *font, Evas_Font_Size size);
+
+ /** Get the minimum size for an object
+ * @param obj A valid Evas_Object handle
+ * @param minw Minimum width pointer
+ * @param minh Minimum height pointer
+ *
+ * Gets the object's minimum size values from the Edje. These are set to zero if no
Edje is connected to the Evas Object.
+ */
+ void edje_object_size_min_get (Evas_Object *obj, Evas_Coord *minw,
Evas_Coord *minh);
+
+ /** Get the maximum size for an object
+ * @param obj A valid Evas_Object handle
+ * @param maxw Maximum width pointer
+ * @param maxh Maximum height pointer
+ *
+ * Gets the object's maximum size values from the Edje. These are set to zero if
no Edje is connected to the Evas Object.
+ */
+ void edje_object_size_max_get (Evas_Object *obj, Evas_Coord *maxw,
Evas_Coord *maxh);
+
+ /** Calculate minimum size
+ * @param obj A valid Evas_Object handle
+ * @param minw Minimum width pointer
+ * @param minh Minimum height pointer
+ *
+ * Calculates the object's minimum size ?!
+ */
+ void edje_object_size_min_calc (Evas_Object *obj, Evas_Coord *minw,
Evas_Coord *minh);
+
+ /** Check if Edje part exists
+ * @param obj A valid Evas_Object handle
+ * @param part The part name to check
+ * @return 0 on Error\n
+ * 1 if Edje part exists
+ */
+ int edje_object_part_exists (Evas_Object *obj, const char *part);
+
+ /** Get Edje part geometry
+ * @param obj A valid Evas_Object handle
+ * @param part The Edje part
+ * @param x The x coordinate pointer
+ * @param y The y coordinate pointer
+ * @param w The width pointer
+ * @param h The height pointer
+ *
+ * Gets the Edje part geometry
+ */
+ void edje_object_part_geometry_get (Evas_Object *obj, const char *part,
Evas_Coord *x, Evas_Coord *y, Evas_Coord *w, Evas_Coord *h);
+
+ /** Sets the callback to be called when text for the specified part is changed
+ * @param obj A valid Evas Object handle
+ * @param part The part name
+ * @param func The function callback to call when text has been changed
+ * @param data The data to pass to the callback's data parameter
+ */
+ void edje_object_text_change_cb_set(Evas_Object *obj, void (*func) (void
*data, Evas_Object *obj, const char *part), void *data);
+
+ /** Sets the text for an object part
+ * @param obj A valid Evas Object handle
+ * @param part The part name
+ * @param text The text string
+ */
+ void edje_object_part_text_set (Evas_Object *obj, const char *part,
const char *text);
+
+ /** Returns the text of the object part
+ * @param obj A valid Evas_Object handle
+ * @param part The part name
+ * @return The text string
+ */
+ const char *edje_object_part_text_get (Evas_Object *obj, const char *part);
+
+ /** Swallows an object into the edje
+ * @param obj A valid Evas_Object handle
+ * @param part The part name
+ * @param obj_swallow The object to swallow
+ *
+ * Describe swallowing ?!
+ */
+ void edje_object_part_swallow (Evas_Object *obj, const char *part,
Evas_Object *obj_swallow);
+
+ /** Unswallow an object
+ * @param obj A valid Evas_Object handle
+ * @param obj_swallow The swallowed object
+ *
+ * Describe unswallowing ?!
+ */
+ void edje_object_part_unswallow (Evas_Object *obj, Evas_Object
*obj_swallow);
+
+ /** Get the swallowed part ?!
+ * @param obj A valid Evas_Object handle
+ * @param part The part name
+ * @return The swallowed object
+ */
+ Evas_Object *edje_object_part_swallow_get (Evas_Object *obj, const char *part);
+
+ /** Returns the state of the edje part
+ * @param obj A valid Evas_Object handle
+ * @param part The part name
+ * @param val_ret
+ *
+ * @return The part state:\n
+ * "default" for the default state\n
+ * "" for other states
+ */
+ /* FIXME: Correctly return other states */
+ const char *edje_object_part_state_get (Evas_Object *obj, const char *part,
double *val_ret);
+
+ /** Determine if part is dragable ?!
+ * @param obj A valid Evas_Object handle
+ * @param part The part name
+ *
+ * @return 1 if dragable
+ * 0 if Error/not ?!
+ */
+ int edje_object_part_drag_dir_get (Evas_Object *obj, const char *part);
+
+ /** Set drag value
+ * @param obj A valid Evas_Object handle
+ * @param part The part name
+ * @param dx Change in x ?!
+ * @param dy Change in y ?!
+ */
+ void edje_object_part_drag_value_set (Evas_Object *obj, const char *part,
double dx, double dy);
+
+ /** Get the part drag value
+ * @param obj A valid Evas_Object handle
+ * @param part The part name
+ * @param dx The dx pointer
+ * @param dy The dy pointer
+ *
+ * Gets the drag values for the object part ?!
+ */
+ void edje_object_part_drag_value_get (Evas_Object *obj, const char *part,
double *dx, double *dy);
+
+ /** Set the drag size
+ * @param obj A valid Evas_Object handle
+ * @param part The part name
+ * @param dw The drag width
+ * @param dh The drag height
+ *
+ * Does?!
+ */
+ void edje_object_part_drag_size_set (Evas_Object *obj, const char *part,
double dw, double dh);
+
+ /** Get the drag size
+ * @param obj A valid Evas_Object handle
+ * @param part The part name
+ * @param dw The drag width pointer
+ * @param dh The drag height pointer
+ *
+ * Gets the drag size for the Edje object.
+ */
+ void edje_object_part_drag_size_get (Evas_Object *obj, const char *part,
double *dw, double *dh);
+
+ /** Sets the drag step
+ * @param obj A valid Evas_Object handle
+ * @param part The part name
+ * @param dx The x step
+ * @param dy The y step
+ *
+ * Sets the x and y step.?!
+ */
+ void edje_object_part_drag_step_set (Evas_Object *obj, const char *part,
double dx, double dy);
+
+ /** Gets the drag step
+ * @param obj A valid Evas_Object handle
+ * @param part The part
+ * @param dx The x step pointer
+ * @param dy The y step pointer
+ *
+ * Gets the x and y step for the Edje object ?!
+ */
+ void edje_object_part_drag_step_get (Evas_Object *obj, const char *part,
double *dx, double *dy);
+
+ /** Sets the drag page
+ * @param obj A valid Evas_Object handle
+ * @param part The part name
+ * @param dx ?!
+ * @param df ?!
+ *
+ * Sets the drag page dx dy
+ */
+ void edje_object_part_drag_page_set (Evas_Object *obj, const char *part,
double dx, double dy);
+
+ /** Gets the drag page
+ * @param obj A valid Evas_Object handle
+ * @param part The part name
+ * @param dx The x drag pointer
+ * @param dy The y drag pointer
+ *
+ * Gets the x and y drag page settings.
+ */
+ void edje_object_part_drag_page_get (Evas_Object *obj, const char *part,
double *dx, double *dy);
+
+ /** Step now ?!
+ * @param obj A valid Evas_Object handle
+ * @param part The part name
+ * @param dx The x step
+ * @param dy The y step
+ *
+ * Steps x,y ?!
+ */
+ void edje_object_part_drag_step (Evas_Object *obj, const char *part,
double dx, double dy);
+
+ /** Page now
+ * @param obj A valid Evas_Object handle
+ * @param part The part name
+ * @param dx The x page
+ * @param dy The y page
+ *
+ * Pages x,y ?!
+ */
+ void edje_object_part_drag_page (Evas_Object *obj, const char *part,
double dx, double dy);
+
+ /** Returns the variable ID
+ * @param obj A valid Evas_Object handle
+ * @param name The variable name
+ *
+ * @return Variable ID\n
+ * 0 on Error.
+ */
+ int edje_object_variable_id_get (Evas_Object *obj, char *name);
+
+ /** Returns the variable int
+ * @param obj A valid Evas_Object handle
+ * @param id The variable id
+ *
+ * @return Variable int\n
+ * 0 on Error
+ */
+ int edje_object_variable_int_get (Evas_Object *obj, int id);
+
+ /** Sets the variable int
+ * @param obj A valid Evas_Object handle
+ * @param id The variable id
+ * @param val The int value to set
+ */
+ void edje_object_variable_int_set (Evas_Object *obj, int id, int val);
+
+ /** Returns the variable float
+ * @param obj A valid Evas_Object handle
+ * @param id The variable id
+ *
+ * @return Variable float\n
+ * 0 on Error
+ */
+ double edje_object_variable_float_get (Evas_Object *obj, int id);
+
+ /** Sets the variable float
+ * @param obj A valid Evas_Object handle
+ * @param id The variable id
+ * @param val The float value to set
+ */
+ void edje_object_variable_float_set (Evas_Object *obj, int id, double val);
+
+ /** Returns the variable string
+ * @param obj A valid Evas_Object handle
+ * @param id The variable id
+ *
+ * @return Variable String\n
+ * 0 on Error
+ */
+ char *edje_object_variable_str_get (Evas_Object *obj, int id);
+
+ /** Sets the variable string
+ * @param obj A valid Evas_Object handle
+ * @param id The variable id
+ * @param str The string value to set
+ */
+ void edje_object_variable_str_set (Evas_Object *obj, int id, char *str);
#ifdef __cplusplus
}
===================================================================
RCS file: /cvsroot/enlightenment/e17/libs/edje/src/lib/Edje_Edit.h,v
retrieving revision 1.10
retrieving revision 1.11
diff -u -3 -r1.10 -r1.11
--- Edje_Edit.h 24 May 2004 07:58:37 -0000 1.10
+++ Edje_Edit.h 3 Jun 2004 09:14:55 -0000 1.11
@@ -127,6 +127,8 @@
#define EDJE_VAR_INT 1
#define EDJE_VAR_FLOAT 2
#define EDJE_VAR_STRING 3
+#define EDJE_VAR_LIST 4
+#define EDJE_VAR_HASH 5
#define EDJE_ASPECT_PREFER_NONE 0
#define EDJE_ASPECT_PREFER_VERTICAL 1
@@ -387,6 +389,8 @@
typedef struct _Edje_Var_Int Edje_Var_Int;
typedef struct _Edje_Var_Float Edje_Var_Float;
typedef struct _Edje_Var_String Edje_Var_String;
+typedef struct _Edje_Var_List Edje_Var_List;
+typedef struct _Edje_Var_Hash Edje_Var_Hash;
typedef struct _Edje_Var_Animator Edje_Var_Animator;
typedef struct _Edje_Var_Timer Edje_Var_Timer;
typedef struct _Edje_Var_Pool Edje_Var_Pool;
@@ -438,6 +442,11 @@
Edje_Real_Part **table_parts;
int table_programs_size;
Edje_Program **table_programs;
+
+ struct {
+ void (*func) (void *data, Evas_Object *obj, const char *part);
+ void *data;
+ } text_change;
};
struct _Edje_Real_Part
@@ -608,6 +617,16 @@
char *v;
};
+struct _Edje_Var_List
+{
+ Evas_List *v;
+};
+
+struct _Edje_Var_Hash
+{
+ Evas_Hash *v;
+};
+
struct _Edje_Var_Timer
{
Edje *edje;
@@ -644,6 +663,8 @@
Edje_Var_Int i;
Edje_Var_Float f;
Edje_Var_String s;
+ Edje_Var_List l;
+ Edje_Var_Hash h;
} data;
};
===================================================================
RCS file: /cvsroot/enlightenment/e17/libs/edje/src/lib/edje_embryo.c,v
retrieving revision 1.15
retrieving revision 1.16
diff -u -3 -r1.15 -r1.16
--- edje_embryo.c 22 May 2004 19:59:32 -0000 1.15
+++ edje_embryo.c 3 Jun 2004 09:14:55 -0000 1.16
@@ -4,6 +4,13 @@
/*
* ALREADY EXPORTED BY EMBRYO:
*
+ * enum Float_Round_Method {
+ * ROUND, FLOOR, CEIL, TOZERO
+ * };
+ * enum Float_Angle_Mode {
+ * RADIAN, DEGREES, GRADES
+ * };
+ *
* Float:atof(string[]);
* Float:fract(Float:value);
* round(Float:value, Float_Round_Method:method=ROUND);
@@ -31,6 +38,10 @@
* strchr(str[], ch[]);
* strrchr(str[], ch[]);
* rand();
+ * Float:randf();
+ * Float:seconds();
+ * date(&year, &month, &day, &yearday, &weekday, &hr, &min, &Float:sec);
+ *
*/
#define CHKPARAM(n) if (params[0] != (sizeof(Embryo_Cell) * (n))) return 0;
@@ -60,6 +71,19 @@
*
* implemented so far as examples:
*
+ * get_int(id)
+ * set_int(id, v)
+ * Float:get_float (id)
+ * set_float(id, Float:v)
+ * get_strlen(id)
+ * get_str(id, dst[], maxlen)
+ * set_str(id, str[])
+ * ** lists/arrays for stored variables
+ * ** dynamic allocation (just use cell as index to dynamic block)
+ * timer(Float:in, fname[], val);
+ * cancel_timer(id)
+ * anim(Float:len, fname[], val)
+ * cancel_anim(id)
* emit(sig[], src[])
* set_state(part_id, state[], Float:state_val)
* set_tween_state(part_id, Float:tween, state1[], Float:state1_val, state2[],
Float:state2_val)
@@ -87,6 +111,8 @@
*
* still need to implement this:
*
+ * ** part_id and program_id need to be able to be "found" from strings
+ *
* get_drag_count(part_id, &Float:dx, &Float:&dy)
* set_drag_count(part_id, Float:dx, Float:dy)
* set_drag_confine(part_id, confine_part_id)
@@ -102,7 +128,6 @@
* set_clip(part_id, clip_part_id)
* get_clip(part_id)
*/
-
/* MODIFY STATE VALUES
*
* set_state_val(part_id, state[], Float:state_val, Param:param, ...)
@@ -601,9 +626,9 @@
return(0);
}
-/* text_set(part_id, str[]) */
+/* set_text(part_id, str[]) */
static Embryo_Cell
-_edje_embryo_fn_text_set(Embryo_Program *ep, Embryo_Cell *params)
+_edje_embryo_fn_set_text(Embryo_Program *ep, Embryo_Cell *params)
{
Edje *ed;
int part_id = 0;
@@ -622,9 +647,9 @@
return(0);
}
-/* text_get(part_id, dst[], maxlen) */
+/* get_text(part_id, dst[], maxlen) */
static Embryo_Cell
-_edje_embryo_fn_text_get(Embryo_Program *ep, Embryo_Cell *params)
+_edje_embryo_fn_get_text(Embryo_Program *ep, Embryo_Cell *params)
{
Edje *ed;
int part_id = 0;
@@ -881,8 +906,8 @@
embryo_program_native_call_add(ep, "get_drag_dir", _edje_embryo_fn_get_drag_dir);
embryo_program_native_call_add(ep, "get_drag", _edje_embryo_fn_get_drag);
embryo_program_native_call_add(ep, "set_drag", _edje_embryo_fn_set_drag);
- embryo_program_native_call_add(ep, "set_text", _edje_embryo_fn_text_set);
- embryo_program_native_call_add(ep, "get_text", _edje_embryo_fn_text_get);
+ embryo_program_native_call_add(ep, "set_text", _edje_embryo_fn_set_text);
+ embryo_program_native_call_add(ep, "get_text", _edje_embryo_fn_get_text);
embryo_program_native_call_add(ep, "get_min_size", _edje_embryo_fn_get_min_size);
embryo_program_native_call_add(ep, "get_max_size", _edje_embryo_fn_get_max_size);
embryo_program_native_call_add(ep, "get_color_class",
_edje_embryo_fn_get_color_class);
===================================================================
RCS file: /cvsroot/enlightenment/e17/libs/edje/src/lib/edje_private.h,v
retrieving revision 1.64
retrieving revision 1.65
diff -u -3 -r1.64 -r1.65
--- edje_private.h 2 Apr 2004 09:16:53 -0000 1.64
+++ edje_private.h 3 Jun 2004 09:14:55 -0000 1.65
@@ -64,9 +64,17 @@
void _edje_embryo_script_shutdown (Edje *ed);
void _edje_embryo_script_reset (Edje *ed);
void _edje_embryo_test_run (Edje *ed, char *fname, char *sig, char
*src);
+Edje_Var *_edje_var_new (void);
+void _edje_var_free (Edje_Var *var);
void _edje_var_init (Edje *ed);
void _edje_var_shutdown (Edje *ed);
int _edje_var_string_id_get (Edje *ed, char *string);
+int _edje_var_var_int_get (Edje *ed, Edje_Var *var);
+void _edje_var_var_int_set (Edje *ed, Edje_Var *var, int v);
+double _edje_var_var_float_get (Edje *ed, Edje_Var *var);
+void _edje_var_var_float_set (Edje *ed, Edje_Var *var, double v);
+const char *_edje_var_var_str_get (Edje *ed, Edje_Var *var);
+void _edje_var_var_str_set (Edje *ed, Edje_Var *var, char *str);
int _edje_var_int_get (Edje *ed, int id);
void _edje_var_int_set (Edje *ed, int id, int v);
double _edje_var_float_get (Edje *ed, int id);
@@ -74,6 +82,33 @@
const char *_edje_var_str_get (Edje *ed, int id);
void _edje_var_str_set (Edje *ed, int id, char *str);
+void _edje_var_list_var_append(Edje *ed, int id, Edje_Var *var);
+void _edje_var_list_var_prepend(Edje *ed, int id, Edje_Var *var);
+void _edje_var_list_var_append_relative(Edje *ed, int id, Edje_Var *var,
Edje_Var *relative);
+void _edje_var_list_var_prepend_relative(Edje *ed, int id, Edje_Var *var,
Edje_Var *relative);
+Edje_Var *_edje_var_list_nth(Edje *ed, int id, int n);
+
+int _edje_var_list_count_get(Edje *ed, int id);
+void _edje_var_list_remove_nth(Edje *ed, int id, int n);
+
+int _edje_var_list_nth_int_get(Edje *ed, int id, int n);
+void _edje_var_list_nth_int_set(Edje *ed, int id, int n, int v);
+void _edje_var_list_int_append(Edje *ed, int id, int v);
+void _edje_var_list_int_prepend(Edje *ed, int id, int v);
+void _edje_var_list_int_insert(Edje *ed, int id, int n, int v);
+
+double _edje_var_list_nth_float_get(Edje *ed, int id, int n);
+void _edje_var_list_nth_float_set(Edje *ed, int id, int n, double v);
+void _edje_var_list_float_append(Edje *ed, int id, double v);
+void _edje_var_list_float_prepend(Edje *ed, int id, double v);
+void _edje_var_list_float_insert(Edje *ed, int id, int n, double v);
+
+char *_edje_var_list_nth_str_get(Edje *ed, int id, int n);
+void _edje_var_list_nth_str_set(Edje *ed, int id, int n, char *v);
+void _edje_var_list_str_append(Edje *ed, int id, char *v);
+void _edje_var_list_str_prepend(Edje *ed, int id, char *v);
+void _edje_var_list_str_insert(Edje *ed, int id, int n, char *v);
+
int _edje_var_timer_add (Edje *ed, double in, char *fname, int
val);
void _edje_var_timer_del (Edje *ed, int id);
@@ -81,4 +116,5 @@
void _edje_var_anim_del (Edje *ed, int id);
void _edje_var_anim_frametime_reset(void);
+
#endif
===================================================================
RCS file: /cvsroot/enlightenment/e17/libs/edje/src/lib/edje_util.c,v
retrieving revision 1.36
retrieving revision 1.37
diff -u -3 -r1.36 -r1.37
--- edje_util.c 18 May 2004 06:05:49 -0000 1.36
+++ edje_util.c 3 Jun 2004 09:14:55 -0000 1.37
@@ -355,6 +355,18 @@
}
void
+edje_object_text_change_cb_set(Evas_Object *obj, void (*func) (void *data,
Evas_Object *obj, const char *part), void *data)
+{
+ Edje *ed;
+ Edje_Real_Part *rp;
+
+ ed = _edje_fetch(obj);
+ if (!ed) return;
+ ed->text_change.func = func;
+ ed->text_change.data = data;
+}
+
+void
edje_object_part_text_set(Evas_Object *obj, const char *part, const char *text)
{
Edje *ed;
@@ -374,6 +386,7 @@
rp->text.text = strdup(text);
ed->dirty = 1;
_edje_recalc(ed);
+ if (ed->text_change.func) ed->text_change.func(ed->text_change.data, obj, part);
}
const char *
@@ -387,7 +400,7 @@
rp = _edje_real_part_get(ed, (char *)part);
if (!rp) return NULL;
if (rp->part->type == EDJE_PART_TYPE_TEXT)
- return evas_object_text_text_get(rp->object);
+ return rp->text.text;
return NULL;
}
===================================================================
RCS file: /cvsroot/enlightenment/e17/libs/edje/src/lib/edje_var.c,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -3 -r1.3 -r1.4
--- edje_var.c 23 Apr 2004 08:06:33 -0000 1.3
+++ edje_var.c 3 Jun 2004 09:14:55 -0000 1.4
@@ -127,6 +127,28 @@
return 0;
}
+Edje_Var *
+_edje_var_new(void)
+{
+ Edje_Var *var;
+
+ var = calloc(1, sizeof(Edje_Var));
+ return var;
+}
+
+void
+_edje_var_free(Edje_Var *var)
+{
+ if (var->type == EDJE_VAR_STRING)
+ {
+ if (var->data.s.v)
+ {
+ free(var->data.s.v);
+ }
+ }
+ free(var);
+}
+
void
_edje_var_init(Edje *ed)
{
@@ -157,6 +179,14 @@
ed->var_pool->vars[i].data.s.v = NULL;
}
}
+ else if (ed->var_pool->vars[i].type == EDJE_VAR_LIST)
+ {
+ while (ed->var_pool->vars[i].data.l.v)
+ {
+ _edje_var_free(ed->var_pool->vars[i].data.l.v->data);
+ ed->var_pool->vars[i].data.l.v =
evas_list_remove_list(ed->var_pool->vars[i].data.l.v, ed->var_pool->vars[i].data.l.v);
+ }
+ }
}
free(ed->var_pool->vars);
}
@@ -210,163 +240,263 @@
}
int
-_edje_var_int_get(Edje *ed, int id)
+_edje_var_var_int_get(Edje *ed, Edje_Var *var)
{
- if (!ed) return 0;
- if (!ed->var_pool) return 0;
- id -= EDJE_VAR_MAGIC_BASE;
- if ((id < 0) || (id >= ed->var_pool->size)) return 0;
/* auto-cast */
- if (ed->var_pool->vars[id].type == EDJE_VAR_STRING)
+ if (var->type == EDJE_VAR_STRING)
{
- if (ed->var_pool->vars[id].data.s.v)
+ if (var->data.s.v)
{
double f;
- f = atof(ed->var_pool->vars[id].data.s.v);
- free(ed->var_pool->vars[id].data.s.v);
- ed->var_pool->vars[id].data.s.v = NULL;
- ed->var_pool->vars[id].data.i.v = (int)f;
+ f = atof(var->data.s.v);
+ free(var->data.s.v);
+ var->data.s.v = NULL;
+ var->data.i.v = (int)f;
}
- ed->var_pool->vars[id].type = EDJE_VAR_INT;
+ var->type = EDJE_VAR_INT;
}
- else if (ed->var_pool->vars[id].type == EDJE_VAR_FLOAT)
+ else if (var->type == EDJE_VAR_FLOAT)
{
- int v;
-
- v = (int)(ed->var_pool->vars[id].data.f.v);
- ed->var_pool->vars[id].type = EDJE_VAR_INT;
+ var->data.i.v = (int)(var->data.f.v);
+ var->type = EDJE_VAR_INT;
+ }
+ else if (var->type == EDJE_VAR_NONE)
+ {
+ var->type = EDJE_VAR_INT;
+ }
+ else if (var->type == EDJE_VAR_LIST)
+ {
+ return 0;
}
- else if (ed->var_pool->vars[id].type == EDJE_VAR_NONE)
+ else if (var->type == EDJE_VAR_HASH)
{
- ed->var_pool->vars[id].type = EDJE_VAR_INT;
+ return 0;
}
- return ed->var_pool->vars[id].data.i.v;
+ return var->data.i.v;
}
void
-_edje_var_int_set(Edje *ed, int id, int v)
+_edje_var_var_int_set(Edje *ed, Edje_Var *var, int v)
{
- if (!ed) return;
- if (!ed->var_pool) return;
- id -= EDJE_VAR_MAGIC_BASE;
- if ((id < 0) || (id >= ed->var_pool->size)) return;
/* auto-cast */
- if (ed->var_pool->vars[id].type == EDJE_VAR_STRING)
+ if (var->type == EDJE_VAR_STRING)
{
- if (ed->var_pool->vars[id].data.s.v)
+ if (var->data.s.v)
{
- free(ed->var_pool->vars[id].data.s.v);
- ed->var_pool->vars[id].data.s.v = NULL;
+ free(var->data.s.v);
+ var->data.s.v = NULL;
}
- ed->var_pool->vars[id].type = EDJE_VAR_INT;
+ var->type = EDJE_VAR_INT;
+ }
+ else if (var->type == EDJE_VAR_FLOAT)
+ {
+ var->type = EDJE_VAR_INT;
+ }
+ else if (var->type == EDJE_VAR_NONE)
+ {
+ var->type = EDJE_VAR_INT;
}
- else if (ed->var_pool->vars[id].type == EDJE_VAR_FLOAT)
+ else if (var->type == EDJE_VAR_LIST)
{
- ed->var_pool->vars[id].data.f.v = 0;
- ed->var_pool->vars[id].type = EDJE_VAR_INT;
+ return;
}
- else if (ed->var_pool->vars[id].type == EDJE_VAR_NONE)
+ else if (var->type == EDJE_VAR_HASH)
{
- ed->var_pool->vars[id].type = EDJE_VAR_INT;
+ return;
}
- ed->var_pool->vars[id].data.i.v = v;
+ var->data.i.v = v;
}
double
-_edje_var_float_get(Edje *ed, int id)
+_edje_var_var_float_get(Edje *ed, Edje_Var *var)
{
- if (!ed) return 0;
- if (!ed->var_pool) return 0;
- id -= EDJE_VAR_MAGIC_BASE;
- if ((id < 0) || (id >= ed->var_pool->size)) return 0;
/* auto-cast */
- if (ed->var_pool->vars[id].type == EDJE_VAR_STRING)
+ if (var->type == EDJE_VAR_STRING)
{
- if (ed->var_pool->vars[id].data.s.v)
+ if (var->data.s.v)
{
double f;
- f = atof(ed->var_pool->vars[id].data.s.v);
- free(ed->var_pool->vars[id].data.s.v);
- ed->var_pool->vars[id].data.s.v = NULL;
- ed->var_pool->vars[id].data.f.v = f;
+ f = atof(var->data.s.v);
+ free(var->data.s.v);
+ var->data.s.v = NULL;
+ var->data.f.v = f;
}
- ed->var_pool->vars[id].type = EDJE_VAR_FLOAT;
+ var->type = EDJE_VAR_FLOAT;
}
- else if (ed->var_pool->vars[id].type == EDJE_VAR_INT)
+ else if (var->type == EDJE_VAR_INT)
{
- int v;
-
- v = (int)(ed->var_pool->vars[id].data.f.v);
- ed->var_pool->vars[id].type = EDJE_VAR_FLOAT;
+ var->data.f.v = (double)(var->data.i.v);
+ var->type = EDJE_VAR_FLOAT;
+ }
+ else if (var->type == EDJE_VAR_NONE)
+ {
+ var->type = EDJE_VAR_FLOAT;
+ }
+ else if (var->type == EDJE_VAR_LIST)
+ {
+ return 0.0;
}
- else if (ed->var_pool->vars[id].type == EDJE_VAR_NONE)
+ else if (var->type == EDJE_VAR_HASH)
{
- ed->var_pool->vars[id].type = EDJE_VAR_FLOAT;
+ return 0.0;
}
- return ed->var_pool->vars[id].data.f.v;
+ return var->data.f.v;
}
void
-_edje_var_float_set(Edje *ed, int id, double v)
+_edje_var_var_float_set(Edje *ed, Edje_Var *var, double v)
{
- if (!ed) return;
- if (!ed->var_pool) return;
- id -= EDJE_VAR_MAGIC_BASE;
- if ((id < 0) || (id >= ed->var_pool->size)) return;
/* auto-cast */
- if (ed->var_pool->vars[id].type == EDJE_VAR_STRING)
+ if (var->type == EDJE_VAR_STRING)
{
- if (ed->var_pool->vars[id].data.s.v)
+ if (var->data.s.v)
{
- free(ed->var_pool->vars[id].data.s.v);
- ed->var_pool->vars[id].data.s.v = NULL;
+ free(var->data.s.v);
+ var->data.s.v = NULL;
}
- ed->var_pool->vars[id].type = EDJE_VAR_FLOAT;
+ var->type = EDJE_VAR_FLOAT;
+ }
+ else if (var->type == EDJE_VAR_INT)
+ {
+ var->data.f.v = 0;
+ var->type = EDJE_VAR_FLOAT;
+ }
+ else if (var->type == EDJE_VAR_NONE)
+ {
+ var->type = EDJE_VAR_FLOAT;
}
- else if (ed->var_pool->vars[id].type == EDJE_VAR_INT)
+ else if (var->type == EDJE_VAR_LIST)
{
- ed->var_pool->vars[id].data.f.v = 0;
- ed->var_pool->vars[id].type = EDJE_VAR_FLOAT;
+ return;
}
- else if (ed->var_pool->vars[id].type == EDJE_VAR_NONE)
+ else if (var->type == EDJE_VAR_HASH)
{
- ed->var_pool->vars[id].type = EDJE_VAR_FLOAT;
+ return;
}
- ed->var_pool->vars[id].data.f.v = v;
+ var->data.f.v = v;
}
const char *
-_edje_var_str_get(Edje *ed, int id)
+_edje_var_var_str_get(Edje *ed, Edje_Var *var)
{
- if (!ed) return NULL;
- if (!ed->var_pool) return NULL;
- id -= EDJE_VAR_MAGIC_BASE;
- if ((id < 0) || (id >= ed->var_pool->size)) return NULL;
/* auto-cast */
- if (ed->var_pool->vars[id].type == EDJE_VAR_INT)
+ if (var->type == EDJE_VAR_INT)
{
char buf[64];
- snprintf(buf, sizeof(buf), "%i", ed->var_pool->vars[id].data.i.v);
- ed->var_pool->vars[id].data.s.v = strdup(buf);
- ed->var_pool->vars[id].type = EDJE_VAR_STRING;
+ snprintf(buf, sizeof(buf), "%i", var->data.i.v);
+ var->data.s.v = strdup(buf);
+ var->type = EDJE_VAR_STRING;
}
- else if (ed->var_pool->vars[id].type == EDJE_VAR_FLOAT)
+ else if (var->type == EDJE_VAR_FLOAT)
{
char buf[64];
- snprintf(buf, sizeof(buf), "%f", ed->var_pool->vars[id].data.f.v);
- ed->var_pool->vars[id].data.s.v = strdup(buf);
- ed->var_pool->vars[id].type = EDJE_VAR_STRING;
+ snprintf(buf, sizeof(buf), "%f", var->data.f.v);
+ var->data.s.v = strdup(buf);
+ var->type = EDJE_VAR_STRING;
}
- else if (ed->var_pool->vars[id].type == EDJE_VAR_NONE)
+ else if (var->type == EDJE_VAR_NONE)
{
- ed->var_pool->vars[id].data.s.v = strdup("");
- ed->var_pool->vars[id].type = EDJE_VAR_STRING;
+ var->data.s.v = strdup("");
+ var->type = EDJE_VAR_STRING;
}
- return ed->var_pool->vars[id].data.s.v;
+ else if (var->type == EDJE_VAR_LIST)
+ {
+ return NULL;
+ }
+ else if (var->type == EDJE_VAR_HASH)
+ {
+ return NULL;
+ }
+ return var->data.s.v;
+}
+
+void
+_edje_var_var_str_set(Edje *ed, Edje_Var *var, char *str)
+{
+ /* auto-cast */
+ if (var->type == EDJE_VAR_STRING)
+ {
+ if (var->data.s.v)
+ {
+ free(var->data.s.v);
+ var->data.s.v = NULL;
+ }
+ }
+ else if (var->type == EDJE_VAR_INT)
+ {
+ var->type = EDJE_VAR_STRING;
+ }
+ else if (var->type == EDJE_VAR_FLOAT)
+ {
+ var->type = EDJE_VAR_STRING;
+ }
+ else if (var->type == EDJE_VAR_NONE)
+ {
+ var->type = EDJE_VAR_STRING;
+ }
+ else if (var->type == EDJE_VAR_LIST)
+ {
+ return;
+ }
+ else if (var->type == EDJE_VAR_HASH)
+ {
+ return;
+ }
+ var->data.s.v = strdup(str);
+}
+
+int
+_edje_var_int_get(Edje *ed, int id)
+{
+ if (!ed) return 0;
+ if (!ed->var_pool) return 0;
+ id -= EDJE_VAR_MAGIC_BASE;
+ if ((id < 0) || (id >= ed->var_pool->size)) return 0;
+ return _edje_var_var_int_get(ed, &(ed->var_pool->vars[id]));
+}
+
+void
+_edje_var_int_set(Edje *ed, int id, int v)
+{
+ if (!ed) return;
+ if (!ed->var_pool) return;
+ id -= EDJE_VAR_MAGIC_BASE;
+ if ((id < 0) || (id >= ed->var_pool->size)) return;
+ _edje_var_var_int_set(ed, &(ed->var_pool->vars[id]), v);
+}
+
+double
+_edje_var_float_get(Edje *ed, int id)
+{
+ if (!ed) return 0;
+ if (!ed->var_pool) return 0;
+ id -= EDJE_VAR_MAGIC_BASE;
+ if ((id < 0) || (id >= ed->var_pool->size)) return 0;
+ return _edje_var_var_float_get(ed, &(ed->var_pool->vars[id]));
+}
+
+void
+_edje_var_float_set(Edje *ed, int id, double v)
+{
+ if (!ed) return;
+ if (!ed->var_pool) return;
+ id -= EDJE_VAR_MAGIC_BASE;
+ if ((id < 0) || (id >= ed->var_pool->size)) return;
+ _edje_var_var_float_set(ed, &(ed->var_pool->vars[id]), v);
+}
+
+const char *
+_edje_var_str_get(Edje *ed, int id)
+{
+ if (!ed) return NULL;
+ if (!ed->var_pool) return NULL;
+ id -= EDJE_VAR_MAGIC_BASE;
+ if ((id < 0) || (id >= ed->var_pool->size)) return NULL;
+ return _edje_var_var_str_get(ed, &(ed->var_pool->vars[id]));
}
void
@@ -377,30 +507,405 @@
if (!str) return;
id -= EDJE_VAR_MAGIC_BASE;
if ((id < 0) || (id >= ed->var_pool->size)) return;
- /* auto-cast */
- if (ed->var_pool->vars[id].type == EDJE_VAR_STRING)
+ _edje_var_var_str_set(ed, &(ed->var_pool->vars[id]), str);
+}
+
+/* list stuff */
+
+void
+_edje_var_list_var_append(Edje *ed, int id, Edje_Var *var)
+{
+ if (!ed) return;
+ if (!ed->var_pool) return;
+ id -= EDJE_VAR_MAGIC_BASE;
+ if ((id < 0) || (id >= ed->var_pool->size)) return;
+ if (ed->var_pool->vars[id].type != EDJE_VAR_LIST) return;
+ ed->var_pool->vars[id].data.l.v =
evas_list_append(ed->var_pool->vars[id].data.l.v, var);
+}
+
+void
+_edje_var_list_var_prepend(Edje *ed, int id, Edje_Var *var)
+{
+ if (!ed) return;
+ if (!ed->var_pool) return;
+ id -= EDJE_VAR_MAGIC_BASE;
+ if ((id < 0) || (id >= ed->var_pool->size)) return;
+ if (ed->var_pool->vars[id].type != EDJE_VAR_LIST) return;
+ ed->var_pool->vars[id].data.l.v =
evas_list_prepend(ed->var_pool->vars[id].data.l.v, var);
+}
+
+void
+_edje_var_list_var_append_relative(Edje *ed, int id, Edje_Var *var, Edje_Var
*relative)
+{
+ if (!ed) return;
+ if (!ed->var_pool) return;
+ id -= EDJE_VAR_MAGIC_BASE;
+ if ((id < 0) || (id >= ed->var_pool->size)) return;
+ if (ed->var_pool->vars[id].type != EDJE_VAR_LIST) return;
+ ed->var_pool->vars[id].data.l.v =
evas_list_append_relative(ed->var_pool->vars[id].data.l.v, var, relative);
+}
+
+void
+_edje_var_list_var_prepend_relative(Edje *ed, int id, Edje_Var *var, Edje_Var
*relative)
+{
+ if (!ed) return;
+ if (!ed->var_pool) return;
+ id -= EDJE_VAR_MAGIC_BASE;
+ if ((id < 0) || (id >= ed->var_pool->size)) return;
+ if (ed->var_pool->vars[id].type != EDJE_VAR_LIST) return;
+ ed->var_pool->vars[id].data.l.v =
evas_list_prepend_relative(ed->var_pool->vars[id].data.l.v, var, relative);
+}
+
+Edje_Var *
+_edje_var_list_nth(Edje *ed, int id, int n)
+{
+ if (!ed) return NULL;
+ if (!ed->var_pool) return NULL;
+ id -= EDJE_VAR_MAGIC_BASE;
+ if ((id < 0) || (id >= ed->var_pool->size)) return NULL;
+ if (ed->var_pool->vars[id].type != EDJE_VAR_LIST) return NULL;
+ return evas_list_nth(ed->var_pool->vars[id].data.l.v, n);
+}
+
+int
+_edje_var_list_count_get(Edje *ed, int id)
+{
+ if (!ed) return 0;
+ if (!ed->var_pool) return 0;
+ id -= EDJE_VAR_MAGIC_BASE;
+ if ((id < 0) || (id >= ed->var_pool->size)) return 0;
+ if (ed->var_pool->vars[id].type == EDJE_VAR_NONE)
+ ed->var_pool->vars[id].type = EDJE_VAR_LIST;
+ else if (ed->var_pool->vars[id].type != EDJE_VAR_LIST) return 0;
+ return evas_list_count(ed->var_pool->vars[id].data.l.v);
+}
+
+void
+_edje_var_list_remove_nth(Edje *ed, int id, int n)
+{
+ if (!ed) return;
+ if (!ed->var_pool) return;
+ id -= EDJE_VAR_MAGIC_BASE;
+ if ((id < 0) || (id >= ed->var_pool->size)) return;
+ if (ed->var_pool->vars[id].type == EDJE_VAR_NONE)
+ ed->var_pool->vars[id].type = EDJE_VAR_LIST;
+ else if (ed->var_pool->vars[id].type != EDJE_VAR_LIST) return;
{
- if (ed->var_pool->vars[id].data.s.v)
+ Evas_List *nth;
+
+ nth = evas_list_nth_list(ed->var_pool->vars[id].data.l.v, n);
+ if (nth)
{
- free(ed->var_pool->vars[id].data.s.v);
- ed->var_pool->vars[id].data.s.v = NULL;
+ _edje_var_free(nth->data);
+ ed->var_pool->vars[id].data.l.v =
evas_list_remove_list(ed->var_pool->vars[id].data.l.v, nth);
}
}
- else if (ed->var_pool->vars[id].type == EDJE_VAR_INT)
- {
- ed->var_pool->vars[id].data.f.v = 0;
- ed->var_pool->vars[id].type = EDJE_VAR_STRING;
+}
+
+int
+_edje_var_list_nth_int_get(Edje *ed, int id, int n)
+{
+ if (!ed) return 0;
+ if (!ed->var_pool) return 0;
+ id -= EDJE_VAR_MAGIC_BASE;
+ if ((id < 0) || (id >= ed->var_pool->size)) return 0;
+ if (ed->var_pool->vars[id].type == EDJE_VAR_NONE)
+ ed->var_pool->vars[id].type = EDJE_VAR_LIST;
+ else if (ed->var_pool->vars[id].type != EDJE_VAR_LIST) return 0;
+ {
+ Edje_Var *var;
+
+ var = _edje_var_list_nth(ed, id, n);
+ if (!var) return 0;
+ return _edje_var_var_int_get(ed, var);
}
- else if (ed->var_pool->vars[id].type == EDJE_VAR_FLOAT)
- {
- ed->var_pool->vars[id].data.f.v = 0;
- ed->var_pool->vars[id].type = EDJE_VAR_STRING;
+}
+
+void
+_edje_var_list_nth_int_set(Edje *ed, int id, int n, int v)
+{
+ if (!ed) return;
+ if (!ed->var_pool) return;
+ id -= EDJE_VAR_MAGIC_BASE;
+ if ((id < 0) || (id >= ed->var_pool->size)) return;
+ if (ed->var_pool->vars[id].type == EDJE_VAR_NONE)
+ ed->var_pool->vars[id].type = EDJE_VAR_LIST;
+ else if (ed->var_pool->vars[id].type != EDJE_VAR_LIST) return;
+ {
+ Edje_Var *var;
+
+ var = _edje_var_list_nth(ed, id, n);
+ if (!var) return;
+ _edje_var_var_int_set(ed, var, v);
+ }
+}
+
+void
+_edje_var_list_int_append(Edje *ed, int id, int v)
+{
+ if (!ed) return;
+ if (!ed->var_pool) return;
+ id -= EDJE_VAR_MAGIC_BASE;
+ if ((id < 0) || (id >= ed->var_pool->size)) return;
+ if (ed->var_pool->vars[id].type == EDJE_VAR_NONE)
+ ed->var_pool->vars[id].type = EDJE_VAR_LIST;
+ else if (ed->var_pool->vars[id].type != EDJE_VAR_LIST) return;
+ {
+ Edje_Var *var;
+
+ var = _edje_var_new();
+ if (!var) return;
+ _edje_var_var_int_set(ed, var, v);
+ _edje_var_list_var_append(ed, id, var);
+ }
+}
+
+void
+_edje_var_list_int_prepend(Edje *ed, int id, int v)
+{
+ if (!ed) return;
+ if (!ed->var_pool) return;
+ id -= EDJE_VAR_MAGIC_BASE;
+ if ((id < 0) || (id >= ed->var_pool->size)) return;
+ if (ed->var_pool->vars[id].type == EDJE_VAR_NONE)
+ ed->var_pool->vars[id].type = EDJE_VAR_LIST;
+ else if (ed->var_pool->vars[id].type != EDJE_VAR_LIST) return;
+ {
+ Edje_Var *var;
+
+ var = _edje_var_new();
+ if (!var) return;
+ _edje_var_var_int_set(ed, var, v);
+ _edje_var_list_var_prepend(ed, id, var);
+ }
+}
+
+void
+_edje_var_list_int_insert(Edje *ed, int id, int n, int v)
+{
+ if (!ed) return;
+ if (!ed->var_pool) return;
+ id -= EDJE_VAR_MAGIC_BASE;
+ if ((id < 0) || (id >= ed->var_pool->size)) return;
+ if (ed->var_pool->vars[id].type == EDJE_VAR_NONE)
+ ed->var_pool->vars[id].type = EDJE_VAR_LIST;
+ else if (ed->var_pool->vars[id].type != EDJE_VAR_LIST) return;
+ {
+ Edje_Var *var, *var_rel;
+
+ var = _edje_var_new();
+ if (!var) return;
+ _edje_var_var_int_set(ed, var, v);
+ var_rel = _edje_var_list_nth(ed, id, n);
+ if (!var_rel)
+ _edje_var_list_var_append(ed, id, var);
+ else
+ _edje_var_list_var_prepend_relative(ed, id, var, var_rel);
+ }
+}
+
+double
+_edje_var_list_nth_float_get(Edje *ed, int id, int n)
+{
+ if (!ed) return 0;
+ if (!ed->var_pool) return 0;
+ id -= EDJE_VAR_MAGIC_BASE;
+ if ((id < 0) || (id >= ed->var_pool->size)) return 0;
+ if (ed->var_pool->vars[id].type == EDJE_VAR_NONE)
+ ed->var_pool->vars[id].type = EDJE_VAR_LIST;
+ else if (ed->var_pool->vars[id].type != EDJE_VAR_LIST) return 0;
+ {
+ Edje_Var *var;
+
+ var = _edje_var_list_nth(ed, id, n);
+ if (!var) return 0;
+ return _edje_var_var_float_get(ed, var);
}
- else if (ed->var_pool->vars[id].type == EDJE_VAR_NONE)
+}
+
+void
+_edje_var_list_nth_float_set(Edje *ed, int id, int n, double v)
+{
+ if (!ed) return;
+ if (!ed->var_pool) return;
+ id -= EDJE_VAR_MAGIC_BASE;
+ if ((id < 0) || (id >= ed->var_pool->size)) return;
+ if (ed->var_pool->vars[id].type == EDJE_VAR_NONE)
+ ed->var_pool->vars[id].type = EDJE_VAR_LIST;
+ else if (ed->var_pool->vars[id].type != EDJE_VAR_LIST) return;
+ {
+ Edje_Var *var;
+
+ var = _edje_var_list_nth(ed, id, n);
+ if (!var) return;
+ _edje_var_var_float_set(ed, var, v);
+ }
+}
+
+void
+_edje_var_list_float_append(Edje *ed, int id, double v)
+{
+ if (!ed) return;
+ if (!ed->var_pool) return;
+ id -= EDJE_VAR_MAGIC_BASE;
+ if ((id < 0) || (id >= ed->var_pool->size)) return;
+ if (ed->var_pool->vars[id].type == EDJE_VAR_NONE)
+ ed->var_pool->vars[id].type = EDJE_VAR_LIST;
+ else if (ed->var_pool->vars[id].type != EDJE_VAR_LIST) return;
+ {
+ Edje_Var *var;
+
+ var = _edje_var_new();
+ if (!var) return;
+ _edje_var_var_float_set(ed, var, v);
+ _edje_var_list_var_append(ed, id, var);
+ }
+}
+
+void
+_edje_var_list_float_prepend(Edje *ed, int id, double v)
+{
+ if (!ed) return;
+ if (!ed->var_pool) return;
+ id -= EDJE_VAR_MAGIC_BASE;
+ if ((id < 0) || (id >= ed->var_pool->size)) return;
+ if (ed->var_pool->vars[id].type == EDJE_VAR_NONE)
+ ed->var_pool->vars[id].type = EDJE_VAR_LIST;
+ else if (ed->var_pool->vars[id].type != EDJE_VAR_LIST) return;
+ {
+ Edje_Var *var;
+
+ var = _edje_var_new();
+ if (!var) return;
+ _edje_var_var_float_set(ed, var, v);
+ _edje_var_list_var_prepend(ed, id, var);
+ }
+}
+
+void
+_edje_var_list_float_insert(Edje *ed, int id, int n, double v)
+{
+ if (!ed) return;
+ if (!ed->var_pool) return;
+ id -= EDJE_VAR_MAGIC_BASE;
+ if ((id < 0) || (id >= ed->var_pool->size)) return;
+ if (ed->var_pool->vars[id].type == EDJE_VAR_NONE)
+ ed->var_pool->vars[id].type = EDJE_VAR_LIST;
+ else if (ed->var_pool->vars[id].type != EDJE_VAR_LIST) return;
{
- ed->var_pool->vars[id].type = EDJE_VAR_STRING;
+ Edje_Var *var, *var_rel;
+
+ var = _edje_var_new();
+ if (!var) return;
+ _edje_var_var_float_set(ed, var, v);
+ var_rel = _edje_var_list_nth(ed, id, n);
+ if (!var_rel)
+ _edje_var_list_var_append(ed, id, var);
+ else
+ _edje_var_list_var_prepend_relative(ed, id, var, var_rel);
+ }
+}
+
+char *
+_edje_var_list_nth_str_get(Edje *ed, int id, int n)
+{
+ if (!ed) return 0;
+ if (!ed->var_pool) return 0;
+ id -= EDJE_VAR_MAGIC_BASE;
+ if ((id < 0) || (id >= ed->var_pool->size)) return 0;
+ if (ed->var_pool->vars[id].type == EDJE_VAR_NONE)
+ ed->var_pool->vars[id].type = EDJE_VAR_LIST;
+ else if (ed->var_pool->vars[id].type != EDJE_VAR_LIST) return 0;
+ {
+ Edje_Var *var;
+
+ var = _edje_var_list_nth(ed, id, n);
+ if (!var) return 0;
+ return _edje_var_var_str_get(ed, var);
+ }
+}
+
+void
+_edje_var_list_nth_str_set(Edje *ed, int id, int n, char *v)
+{
+ if (!ed) return;
+ if (!ed->var_pool) return;
+ id -= EDJE_VAR_MAGIC_BASE;
+ if ((id < 0) || (id >= ed->var_pool->size)) return;
+ if (ed->var_pool->vars[id].type == EDJE_VAR_NONE)
+ ed->var_pool->vars[id].type = EDJE_VAR_LIST;
+ else if (ed->var_pool->vars[id].type != EDJE_VAR_LIST) return;
+ {
+ Edje_Var *var;
+
+ var = _edje_var_list_nth(ed, id, n);
+ if (!var) return;
+ _edje_var_var_str_set(ed, var, v);
+ }
+}
+
+void
+_edje_var_list_str_append(Edje *ed, int id, char *v)
+{
+ if (!ed) return;
+ if (!ed->var_pool) return;
+ id -= EDJE_VAR_MAGIC_BASE;
+ if ((id < 0) || (id >= ed->var_pool->size)) return;
+ if (ed->var_pool->vars[id].type == EDJE_VAR_NONE)
+ ed->var_pool->vars[id].type = EDJE_VAR_LIST;
+ else if (ed->var_pool->vars[id].type != EDJE_VAR_LIST) return;
+ {
+ Edje_Var *var;
+
+ var = _edje_var_new();
+ if (!var) return;
+ _edje_var_var_str_set(ed, var, v);
+ _edje_var_list_var_append(ed, id, var);
+ }
+}
+
+void
+_edje_var_list_str_prepend(Edje *ed, int id, char *v)
+{
+ if (!ed) return;
+ if (!ed->var_pool) return;
+ id -= EDJE_VAR_MAGIC_BASE;
+ if ((id < 0) || (id >= ed->var_pool->size)) return;
+ if (ed->var_pool->vars[id].type == EDJE_VAR_NONE)
+ ed->var_pool->vars[id].type = EDJE_VAR_LIST;
+ else if (ed->var_pool->vars[id].type != EDJE_VAR_LIST) return;
+ {
+ Edje_Var *var;
+
+ var = _edje_var_new();
+ if (!var) return;
+ _edje_var_var_str_set(ed, var, v);
+ _edje_var_list_var_prepend(ed, id, var);
+ }
+}
+
+void
+_edje_var_list_str_insert(Edje *ed, int id, int n, char *v)
+{
+ if (!ed) return;
+ if (!ed->var_pool) return;
+ id -= EDJE_VAR_MAGIC_BASE;
+ if ((id < 0) || (id >= ed->var_pool->size)) return;
+ if (ed->var_pool->vars[id].type == EDJE_VAR_NONE)
+ ed->var_pool->vars[id].type = EDJE_VAR_LIST;
+ else if (ed->var_pool->vars[id].type != EDJE_VAR_LIST) return;
+ {
+ Edje_Var *var, *var_rel;
+
+ var = _edje_var_new();
+ if (!var) return;
+ _edje_var_var_str_set(ed, var, v);
+ var_rel = _edje_var_list_nth(ed, id, n);
+ if (!var_rel)
+ _edje_var_list_var_append(ed, id, var);
+ else
+ _edje_var_list_var_prepend_relative(ed, id, var, var_rel);
}
- ed->var_pool->vars[id].data.s.v = strdup(str);
}
int
-------------------------------------------------------
This SF.Net email is sponsored by the new InstallShield X.
>From Windows to Linux, servers to mobile, InstallShield X is the one
installation-authoring solution that does it all. Learn more and
evaluate today! http://www.installshield.com/Dev2Dev/0504
_______________________________________________
enlightenment-cvs mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/enlightenment-cvs