|
From: Enlightenment C. <no...@cv...> - 2008-08-14 18:21:31
|
Enlightenment CVS committal
Author : barbieri
Project : e17
Module : libs/edje
Dir : e17/libs/edje/src/lib
Modified Files:
Edje.h edje_load.c edje_private.h edje_program.c edje_util.c
Log Message:
Add some consts to Edje's API.
Some methods do no change object internal state and can be marked as
read only. In parallel have infamous edje_object_part_object_get() to
return a read-only object, so it's even more clear that one should not
touch this object state (either a cast or a compiler warning if you do
that!)
===================================================================
RCS file: /cvs/e/e17/libs/edje/src/lib/Edje.h,v
retrieving revision 1.55
retrieving revision 1.56
diff -u -3 -r1.55 -r1.56
--- Edje.h 14 Aug 2008 18:04:42 -0000 1.55
+++ Edje.h 14 Aug 2008 18:21:27 -0000 1.56
@@ -200,21 +200,21 @@
EAPI Evas_Object *edje_object_add (Evas *evas);
/* edje_util.c */
- EAPI const char *edje_object_data_get (Evas_Object *obj, const char *key);
+ EAPI const char *edje_object_data_get (const Evas_Object *obj, const char *key);
/* edje_load.c */
EAPI int edje_object_file_set (Evas_Object *obj, const char *file, const char *group);
- EAPI void edje_object_file_get (Evas_Object *obj, const char **file, const char **group);
- EAPI int edje_object_load_error_get (Evas_Object *obj);
+ EAPI void edje_object_file_get (const Evas_Object *obj, const char **file, const char **group);
+ EAPI int edje_object_load_error_get (const Evas_Object *obj);
/* edje_program.c */
EAPI 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);
EAPI 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));
EAPI void edje_object_signal_emit (Evas_Object *obj, const char *emission, const char *source);
EAPI void edje_object_play_set (Evas_Object *obj, int play);
- EAPI int edje_object_play_get (Evas_Object *obj);
+ EAPI int edje_object_play_get (const Evas_Object *obj);
EAPI void edje_object_animation_set (Evas_Object *obj, int on);
- EAPI int edje_object_animation_get (Evas_Object *obj);
+ EAPI int edje_object_animation_get (const Evas_Object *obj);
/* edje_util.c */
EAPI int edje_object_freeze (Evas_Object *obj);
@@ -222,30 +222,30 @@
EAPI 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);
EAPI void edje_object_color_class_del (Evas_Object *obj, const char *color_class);
EAPI void edje_object_text_class_set (Evas_Object *obj, const char *text_class, const char *font, Evas_Font_Size size);
- EAPI void edje_object_size_min_get (Evas_Object *obj, Evas_Coord *minw, Evas_Coord *minh);
- EAPI void edje_object_size_max_get (Evas_Object *obj, Evas_Coord *maxw, Evas_Coord *maxh);
+ EAPI void edje_object_size_min_get (const Evas_Object *obj, Evas_Coord *minw, Evas_Coord *minh);
+ EAPI void edje_object_size_max_get (const Evas_Object *obj, Evas_Coord *maxw, Evas_Coord *maxh);
EAPI void edje_object_calc_force (Evas_Object *obj);
EAPI void edje_object_size_min_calc (Evas_Object *obj, Evas_Coord *minw, Evas_Coord *minh);
EAPI void edje_object_size_min_restricted_calc(Evas_Object *obj, Evas_Coord *minw, Evas_Coord *minh, Evas_Coord restrictedw, Evas_Coord restrictedh);
- EAPI int edje_object_part_exists (Evas_Object *obj, const char *part);
- EAPI Evas_Object *edje_object_part_object_get (Evas_Object *obj, const char *part);
- EAPI void edje_object_part_geometry_get (Evas_Object *obj, const char *part, Evas_Coord *x, Evas_Coord *y, Evas_Coord *w, Evas_Coord *h);
+ EAPI int edje_object_part_exists (const Evas_Object *obj, const char *part);
+ EAPI const Evas_Object *edje_object_part_object_get (const Evas_Object *obj, const char *part);
+ EAPI void edje_object_part_geometry_get (const Evas_Object *obj, const char *part, Evas_Coord *x, Evas_Coord *y, Evas_Coord *w, Evas_Coord *h);
EAPI void edje_object_text_change_cb_set (Evas_Object *obj, void (*func) (void *data, Evas_Object *obj, const char *part), void *data);
EAPI void edje_object_part_text_set (Evas_Object *obj, const char *part, const char *text);
- EAPI const char *edje_object_part_text_get (Evas_Object *obj, const char *part);
+ EAPI const char *edje_object_part_text_get (const Evas_Object *obj, const char *part);
EAPI void edje_object_part_swallow (Evas_Object *obj, const char *part, Evas_Object *obj_swallow);
EAPI void edje_object_part_unswallow (Evas_Object *obj, Evas_Object *obj_swallow);
- EAPI Evas_Object *edje_object_part_swallow_get (Evas_Object *obj, const char *part);
- EAPI const char *edje_object_part_state_get (Evas_Object *obj, const char *part, double *val_ret);
- EAPI int edje_object_part_drag_dir_get (Evas_Object *obj, const char *part);
+ EAPI Evas_Object *edje_object_part_swallow_get (const Evas_Object *obj, const char *part);
+ EAPI const char *edje_object_part_state_get (const Evas_Object *obj, const char *part, double *val_ret);
+ EAPI int edje_object_part_drag_dir_get (const Evas_Object *obj, const char *part);
EAPI void edje_object_part_drag_value_set (Evas_Object *obj, const char *part, double dx, double dy);
- EAPI void edje_object_part_drag_value_get (Evas_Object *obj, const char *part, double *dx, double *dy);
+ EAPI void edje_object_part_drag_value_get (const Evas_Object *obj, const char *part, double *dx, double *dy);
EAPI void edje_object_part_drag_size_set (Evas_Object *obj, const char *part, double dw, double dh);
- EAPI void edje_object_part_drag_size_get (Evas_Object *obj, const char *part, double *dw, double *dh);
+ EAPI void edje_object_part_drag_size_get (const Evas_Object *obj, const char *part, double *dw, double *dh);
EAPI void edje_object_part_drag_step_set (Evas_Object *obj, const char *part, double dx, double dy);
- EAPI void edje_object_part_drag_step_get (Evas_Object *obj, const char *part, double *dx, double *dy);
+ EAPI void edje_object_part_drag_step_get (const Evas_Object *obj, const char *part, double *dx, double *dy);
EAPI void edje_object_part_drag_page_set (Evas_Object *obj, const char *part, double dx, double dy);
- EAPI void edje_object_part_drag_page_get (Evas_Object *obj, const char *part, double *dx, double *dy);
+ EAPI void edje_object_part_drag_page_get (const Evas_Object *obj, const char *part, double *dx, double *dy);
EAPI void edje_object_part_drag_step (Evas_Object *obj, const char *part, double dx, double dy);
EAPI void edje_object_part_drag_page (Evas_Object *obj, const char *part, double dx, double dy);
===================================================================
RCS file: /cvs/e/e17/libs/edje/src/lib/edje_load.c,v
retrieving revision 1.129
retrieving revision 1.130
diff -u -3 -r1.129 -r1.130
--- edje_load.c 14 Aug 2008 18:04:42 -0000 1.129
+++ edje_load.c 14 Aug 2008 18:21:27 -0000 1.130
@@ -49,7 +49,7 @@
* interested in one of the values.
*/
EAPI void
-edje_object_file_get(Evas_Object *obj, const char **file, const char **group)
+edje_object_file_get(const Evas_Object *obj, const char **file, const char **group)
{
Edje *ed;
@@ -79,7 +79,7 @@
* 7: Incompatible File
*/
EAPI int
-edje_object_load_error_get(Evas_Object *obj)
+edje_object_load_error_get(const Evas_Object *obj)
{
Edje *ed;
===================================================================
RCS file: /cvs/e/e17/libs/edje/src/lib/edje_private.h,v
retrieving revision 1.153
retrieving revision 1.154
diff -u -3 -r1.153 -r1.154
--- edje_private.h 14 Aug 2008 18:04:43 -0000 1.153
+++ edje_private.h 14 Aug 2008 18:21:27 -0000 1.154
@@ -1073,7 +1073,7 @@
void _edje_text_class_members_free(void);
void _edje_text_class_hash_free(void);
-Edje *_edje_fetch(Evas_Object *obj);
+Edje *_edje_fetch(const Evas_Object *obj);
int _edje_freeze(Edje *ed);
int _edje_thaw(Edje *ed);
int _edje_block(Edje *ed);
===================================================================
RCS file: /cvs/e/e17/libs/edje/src/lib/edje_program.c,v
retrieving revision 1.61
retrieving revision 1.62
diff -u -3 -r1.61 -r1.62
--- edje_program.c 7 Jun 2008 10:06:13 -0000 1.61
+++ edje_program.c 14 Aug 2008 18:21:27 -0000 1.62
@@ -262,7 +262,7 @@
* 1 if Edje set to play
*/
EAPI int
-edje_object_play_get(Evas_Object *obj)
+edje_object_play_get(const Evas_Object *obj)
{
Edje *ed;
@@ -343,7 +343,7 @@
* 1 if animated
*/
EAPI int
-edje_object_animation_get(Evas_Object *obj)
+edje_object_animation_get(const Evas_Object *obj)
{
Edje *ed;
===================================================================
RCS file: /cvs/e/e17/libs/edje/src/lib/edje_util.c,v
retrieving revision 1.110
retrieving revision 1.111
diff -u -3 -r1.110 -r1.111
--- edje_util.c 14 Aug 2008 18:04:43 -0000 1.110
+++ edje_util.c 14 Aug 2008 18:21:27 -0000 1.111
@@ -94,7 +94,7 @@
* @endcode
*/
EAPI const char *
-edje_object_data_get(Evas_Object *obj, const char *key)
+edje_object_data_get(const Evas_Object *obj, const char *key)
{
Edje *ed;
Evas_List *l;
@@ -683,7 +683,7 @@
* 1 if Edje part exists
*/
EAPI int
-edje_object_part_exists(Evas_Object *obj, const char *part)
+edje_object_part_exists(const Evas_Object *obj, const char *part)
{
Edje *ed;
Edje_Real_Part *rp;
@@ -707,8 +707,8 @@
* @return Returns the Evas_Object corresponding to the given part,
* or NULL on failure (if the part doesn't exist)
**/
-EAPI Evas_Object *
-edje_object_part_object_get(Evas_Object *obj, const char *part)
+EAPI const Evas_Object *
+edje_object_part_object_get(const Evas_Object *obj, const char *part)
{
Edje *ed;
Edje_Real_Part *rp;
@@ -734,7 +734,7 @@
* values you are uninterested in.
*/
EAPI void
-edje_object_part_geometry_get(Evas_Object *obj, const char *part, Evas_Coord *x, Evas_Coord *y, Evas_Coord *w, Evas_Coord *h )
+edje_object_part_geometry_get(const Evas_Object *obj, const char *part, Evas_Coord *x, Evas_Coord *y, Evas_Coord *w, Evas_Coord *h )
{
Edje *ed;
Edje_Real_Part *rp;
@@ -821,7 +821,7 @@
* @return The text string
*/
EAPI const char *
-edje_object_part_text_get(Evas_Object *obj, const char *part)
+edje_object_part_text_get(const Evas_Object *obj, const char *part)
{
Edje *ed;
Edje_Real_Part *rp;
@@ -1032,7 +1032,7 @@
* @return The swallowed object, or NULL if there is none.
*/
EAPI Evas_Object *
-edje_object_part_swallow_get(Evas_Object *obj, const char *part)
+edje_object_part_swallow_get(const Evas_Object *obj, const char *part)
{
Edje *ed;
Edje_Real_Part *rp;
@@ -1053,7 +1053,7 @@
* to zero if no Edje is connected to the Evas Object.
*/
EAPI void
-edje_object_size_min_get(Evas_Object *obj, Evas_Coord *minw, Evas_Coord *minh)
+edje_object_size_min_get(const Evas_Object *obj, Evas_Coord *minw, Evas_Coord *minh)
{
Edje *ed;
@@ -1077,7 +1077,7 @@
* to zero if no Edje is connected to the Evas Object.
*/
EAPI void
-edje_object_size_max_get(Evas_Object *obj, Evas_Coord *maxw, Evas_Coord *maxh)
+edje_object_size_max_get(const Evas_Object *obj, Evas_Coord *maxw, Evas_Coord *maxh)
{
Edje *ed;
@@ -1280,7 +1280,7 @@
*/
/* FIXME: Correctly return other states */
EAPI const char *
-edje_object_part_state_get(Evas_Object *obj, const char *part, double *val_ret)
+edje_object_part_state_get(const Evas_Object *obj, const char *part, double *val_ret)
{
Edje *ed;
Edje_Real_Part *rp;
@@ -1328,7 +1328,7 @@
* 3: Dragable in X & Y directions
*/
EAPI int
-edje_object_part_drag_dir_get(Evas_Object *obj, const char *part)
+edje_object_part_drag_dir_get(const Evas_Object *obj, const char *part)
{
Edje *ed;
Edje_Real_Part *rp;
@@ -1386,7 +1386,7 @@
*/
/* FIXME: Should this be x and y instead of dx/dy? */
EAPI void
-edje_object_part_drag_value_get(Evas_Object *obj, const char *part, double *dx, double *dy)
+edje_object_part_drag_value_get(const Evas_Object *obj, const char *part, double *dx, double *dy)
{
Edje *ed;
Edje_Real_Part *rp;
@@ -1452,7 +1452,7 @@
* Gets the dragable object size.
*/
EAPI void
-edje_object_part_drag_size_get(Evas_Object *obj, const char *part, double *dw, double *dh)
+edje_object_part_drag_size_get(const Evas_Object *obj, const char *part, double *dw, double *dh)
{
Edje *ed;
Edje_Real_Part *rp;
@@ -1510,7 +1510,7 @@
* Gets the x and y step increments for the dragable object.
*/
EAPI void
-edje_object_part_drag_step_get(Evas_Object *obj, const char *part, double *dx, double *dy)
+edje_object_part_drag_step_get(const Evas_Object *obj, const char *part, double *dx, double *dy)
{
Edje *ed;
Edje_Real_Part *rp;
@@ -1568,7 +1568,7 @@
* Gets the x,y page step increments for the dragable object.
*/
EAPI void
-edje_object_part_drag_page_get(Evas_Object *obj, const char *part, double *dx, double *dy)
+edje_object_part_drag_page_get(const Evas_Object *obj, const char *part, double *dx, double *dy)
{
Edje *ed;
Edje_Real_Part *rp;
@@ -1923,7 +1923,7 @@
}
Edje *
-_edje_fetch(Evas_Object *obj)
+_edje_fetch(const Evas_Object *obj)
{
Edje *ed;
char *type;
|