forked from enlightenment/efl
fix soem routines that i found incosistent whilst writitng the docs... :)
SVN revision: 4826
This commit is contained in:
parent
aa1fd461a0
commit
9528534f0b
|
@ -11,8 +11,14 @@ typedef void * Evas_Gradient;
|
|||
typedef void * Evas_Object;
|
||||
#endif
|
||||
typedef struct _Evas_List * Evas_List;
|
||||
typedef struct _Evas_Point * Evas_Point;
|
||||
|
||||
/* public structs */
|
||||
struct _Evas_Point
|
||||
{
|
||||
double x, y;
|
||||
};
|
||||
|
||||
struct _Evas_List
|
||||
{
|
||||
Evas_List prev, next;
|
||||
|
@ -134,7 +140,8 @@ void evas_set_zoom_scale(Evas e, Evas_Object o, int scale);
|
|||
void evas_set_line_xy(Evas e, Evas_Object o, double x1, double y1, double x2, double y2);
|
||||
void evas_set_pass_events(Evas e, Evas_Object o, int pass_events);
|
||||
void evas_add_point(Evas e, Evas_Object o, double x, double y);
|
||||
|
||||
void evas_clear_points(Evas e, Evas_Object o);
|
||||
|
||||
/* cache settings for performance */
|
||||
void evas_set_font_cache(Evas e, int size);
|
||||
int evas_get_font_cache(Evas e);
|
||||
|
@ -177,7 +184,7 @@ Evas_Object evas_object_get_named(Evas e, char *name);
|
|||
void evas_object_set_name(Evas e, Evas_Object o, char *name);
|
||||
char *evas_object_get_name(Evas e, Evas_Object o);
|
||||
Evas_List evas_get_points(Evas e, Evas_Object o);
|
||||
|
||||
|
||||
/* object visibility */
|
||||
void evas_show(Evas e, Evas_Object o);
|
||||
void evas_hide(Evas e, Evas_Object o);
|
||||
|
@ -198,10 +205,10 @@ double evas_screen_y_to_world(Evas e, int y);
|
|||
char *evas_get_text_string(Evas e, Evas_Object o);
|
||||
char *evas_get_text_font(Evas e, Evas_Object o);
|
||||
int evas_get_text_size(Evas e, Evas_Object o);
|
||||
int evas_get_text_width(Evas e, Evas_Object o);
|
||||
int evas_get_text_height(Evas e, Evas_Object o);
|
||||
int evas_text_at_position(Evas e, Evas_Object o, double x, double y, int *char_x, int *char_y, int *char_w, int *char_h);
|
||||
void evas_text_at(Evas e, Evas_Object o, int index, int *char_x, int *char_y, int *char_w, int *char_h);
|
||||
double evas_get_text_width(Evas e, Evas_Object o);
|
||||
double evas_get_text_height(Evas e, Evas_Object o);
|
||||
int evas_text_at_position(Evas e, Evas_Object o, double x, double y, double *char_x, double *char_y, double *char_w, double *char_h);
|
||||
void evas_text_at(Evas e, Evas_Object o, int index, double *char_x, double *char_y, double *char_w, double *char_h);
|
||||
void evas_text_get_ascent_descent(Evas e, Evas_Object o, double *ascent, double *descent);
|
||||
void evas_text_get_max_ascent_descent(Evas e, Evas_Object o, double *ascent, double *descent);
|
||||
void evas_text_get_advance(Evas e, Evas_Object o, double *h_advance, double *v_advance);
|
||||
|
@ -217,7 +224,6 @@ void *evas_get_data(Evas e, Evas_Object o, char *key);
|
|||
void *evas_remove_data(Evas e, Evas_Object o, char *key);
|
||||
|
||||
/* events */
|
||||
void evas_ungrab_button(Evas e);
|
||||
void evas_event_button_down(Evas e, int x, int y, int b);
|
||||
void evas_event_button_up(Evas e, int x, int y, int b);
|
||||
void evas_event_move(Evas e, int x, int y);
|
||||
|
|
|
@ -14,7 +14,6 @@ typedef struct _Evas_Object_Any * Evas_Object_Any;
|
|||
typedef struct _Evas_Render_Data Evas_Render_Data;
|
||||
typedef struct _Evas_Data * Evas_Data;
|
||||
typedef struct _Evas_Layer * Evas_Layer;
|
||||
typedef struct _Evas_Point * Evas_Point;
|
||||
typedef struct _Evas_Color_Point * Evas_Color_Point;
|
||||
typedef struct _Evas_Callback * Evas_Callback;
|
||||
typedef struct _Evas_Rectangle * Evas_Rectangle;
|
||||
|
@ -115,11 +114,6 @@ struct _Evas
|
|||
Imlib_Updates obscures;
|
||||
};
|
||||
|
||||
struct _Evas_Point
|
||||
{
|
||||
double x, y;
|
||||
};
|
||||
|
||||
struct _Evas_Color_Point
|
||||
{
|
||||
int r, g, b, a;
|
||||
|
|
|
@ -25,14 +25,6 @@ _evas_objects_at_point(Evas e, int x, int y)
|
|||
return evas_objects_at_position(e, cx, cy);
|
||||
}
|
||||
|
||||
void
|
||||
evas_ungrab_button(Evas e)
|
||||
{
|
||||
if (e->mouse.button_object)
|
||||
e->mouse.button_object = NULL;
|
||||
e->mouse.buttons = 0;
|
||||
}
|
||||
|
||||
/* events */
|
||||
void
|
||||
evas_event_button_down(Evas e, int x, int y, int b)
|
||||
|
|
|
@ -235,8 +235,8 @@ evas_get_image_alpha(Evas e, Evas_Object o)
|
|||
{
|
||||
Evas_Object_Image oo;
|
||||
|
||||
if (!e) return;
|
||||
if (!o) return;
|
||||
if (!e) return 0;
|
||||
if (!o) return 0;
|
||||
IF_OBJ(o, OBJECT_IMAGE) return 0;
|
||||
oo = o;
|
||||
return oo->current.alpha;
|
||||
|
@ -296,9 +296,9 @@ evas_get_image_load_error(Evas e, Evas_Object o)
|
|||
{
|
||||
Evas_Object_Image oo;
|
||||
|
||||
if (!e) return;
|
||||
if (!o) return;
|
||||
IF_OBJ(o, OBJECT_IMAGE) return;
|
||||
if (!e) return IMLIB_LOAD_ERROR_NONE;
|
||||
if (!o) return IMLIB_LOAD_ERROR_NONE;
|
||||
IF_OBJ(o, OBJECT_IMAGE) return IMLIB_LOAD_ERROR_NONE;
|
||||
oo = o;
|
||||
|
||||
return oo->load_error;
|
||||
|
|
|
@ -83,6 +83,7 @@ evas_add_poly(Evas e)
|
|||
}
|
||||
|
||||
/* modifying object */
|
||||
void
|
||||
evas_clear_points(Evas e, Evas_Object o)
|
||||
{
|
||||
Evas_Point p;
|
||||
|
|
|
@ -218,7 +218,7 @@ evas_get_text_size(Evas e, Evas_Object o)
|
|||
return oo->current.size;
|
||||
}
|
||||
|
||||
int
|
||||
double
|
||||
evas_get_text_height(Evas e, Evas_Object o)
|
||||
{
|
||||
Evas_Object_Text oo;
|
||||
|
@ -228,10 +228,10 @@ evas_get_text_height(Evas e, Evas_Object o)
|
|||
IF_OBJ(o, OBJECT_TEXT) return 0;
|
||||
oo = o;
|
||||
|
||||
return oo->current.string.h;
|
||||
return (double)oo->current.string.h;
|
||||
}
|
||||
|
||||
int
|
||||
double
|
||||
evas_get_text_width(Evas e, Evas_Object o)
|
||||
{
|
||||
Evas_Object_Text oo;
|
||||
|
@ -241,14 +241,15 @@ evas_get_text_width(Evas e, Evas_Object o)
|
|||
IF_OBJ(o, OBJECT_TEXT) return 0;
|
||||
oo = o;
|
||||
|
||||
return oo->current.string.w;
|
||||
return (double)oo->current.string.w;
|
||||
}
|
||||
|
||||
int
|
||||
evas_text_at_position(Evas e, Evas_Object o, double x, double y,
|
||||
int *char_x, int *char_y, int *char_w, int *char_h)
|
||||
double *char_x, double *char_y, double *char_w, double *char_h)
|
||||
{
|
||||
Evas_Object_Text oo;
|
||||
int cx, cy, cw, ch;
|
||||
|
||||
if (!e) return -1;
|
||||
if (!o) return -1;
|
||||
|
@ -267,8 +268,11 @@ evas_text_at_position(Evas e, Evas_Object o, double x, double y,
|
|||
ret = __evas_imlib_text_get_character_at_pos(fn, oo->current.text,
|
||||
(int)(x - o->current.x),
|
||||
(int)(y - o->current.y),
|
||||
char_x, char_y,
|
||||
char_w, char_h);
|
||||
&cx, &cy, &cw, &ch);
|
||||
if (char_x) *char_x = (double)cx;
|
||||
if (char_y) *char_y = (double)cy;
|
||||
if (char_w) *char_w = (double)cw;
|
||||
if (char_h) *char_h = (double)ch;
|
||||
__evas_imlib_text_font_free(fn);
|
||||
return ret;
|
||||
}
|
||||
|
@ -285,8 +289,11 @@ evas_text_at_position(Evas e, Evas_Object o, double x, double y,
|
|||
ret = __evas_x11_text_get_character_at_pos(fn, oo->current.text,
|
||||
(int)(x - o->current.x),
|
||||
(int)(y - o->current.y),
|
||||
char_x, char_y,
|
||||
char_w, char_h);
|
||||
&cx, &cy, &cw, &ch);
|
||||
if (char_x) *char_x = (double)cx;
|
||||
if (char_y) *char_y = (double)cy;
|
||||
if (char_w) *char_w = (double)cw;
|
||||
if (char_h) *char_h = (double)ch;
|
||||
__evas_x11_text_font_free(fn);
|
||||
return ret;
|
||||
}
|
||||
|
@ -303,8 +310,11 @@ evas_text_at_position(Evas e, Evas_Object o, double x, double y,
|
|||
ret = __evas_gl_text_get_character_at_pos(fn, oo->current.text,
|
||||
(int)(x - o->current.x),
|
||||
(int)(y - o->current.y),
|
||||
char_x, char_y,
|
||||
char_w, char_h);
|
||||
&cx, &cy, &cw, &ch);
|
||||
if (char_x) *char_x = (double)cx;
|
||||
if (char_y) *char_y = (double)cy;
|
||||
if (char_w) *char_w = (double)cw;
|
||||
if (char_h) *char_h = (double)ch;
|
||||
__evas_gl_text_font_free(fn);
|
||||
return ret;
|
||||
}
|
||||
|
@ -321,8 +331,11 @@ evas_text_at_position(Evas e, Evas_Object o, double x, double y,
|
|||
ret = __evas_render_text_get_character_at_pos(fn, oo->current.text,
|
||||
(int)(x - o->current.x),
|
||||
(int)(y - o->current.y),
|
||||
char_x, char_y,
|
||||
char_w, char_h);
|
||||
&cx, &cy, &cw, &ch);
|
||||
if (char_x) *char_x = (double)cx;
|
||||
if (char_y) *char_y = (double)cy;
|
||||
if (char_w) *char_w = (double)cw;
|
||||
if (char_h) *char_h = (double)ch;
|
||||
__evas_gl_text_font_free(fn);
|
||||
return ret;
|
||||
}
|
||||
|
@ -339,8 +352,11 @@ evas_text_at_position(Evas e, Evas_Object o, double x, double y,
|
|||
ret = __evas_image_text_get_character_at_pos(fn, oo->current.text,
|
||||
(int)(x - o->current.x),
|
||||
(int)(y - o->current.y),
|
||||
char_x, char_y,
|
||||
char_w, char_h);
|
||||
&cx, &cy, &cw, &ch);
|
||||
if (char_x) *char_x = (double)cx;
|
||||
if (char_y) *char_y = (double)cy;
|
||||
if (char_w) *char_w = (double)cw;
|
||||
if (char_h) *char_h = (double)ch;
|
||||
__evas_image_text_font_free(fn);
|
||||
return ret;
|
||||
}
|
||||
|
@ -354,9 +370,10 @@ evas_text_at_position(Evas e, Evas_Object o, double x, double y,
|
|||
|
||||
void
|
||||
evas_text_at(Evas e, Evas_Object o, int index,
|
||||
int *char_x, int *char_y, int *char_w, int *char_h)
|
||||
double *char_x, double *char_y, double *char_w, double *char_h)
|
||||
{
|
||||
Evas_Object_Text oo;
|
||||
int cx, cy, cw, ch;
|
||||
|
||||
if (!e) return;
|
||||
if (!o) return;
|
||||
|
@ -373,8 +390,11 @@ evas_text_at(Evas e, Evas_Object o, int index,
|
|||
{
|
||||
__evas_imlib_text_get_character_number(fn, oo->current.text,
|
||||
index,
|
||||
char_x, char_y,
|
||||
char_w, char_h);
|
||||
&cx, &cy, &cw, &ch);
|
||||
if (char_x) *char_x = (double)cx;
|
||||
if (char_y) *char_y = (double)cy;
|
||||
if (char_w) *char_w = (double)cw;
|
||||
if (char_h) *char_h = (double)ch;
|
||||
__evas_imlib_text_font_free(fn);
|
||||
}
|
||||
}
|
||||
|
@ -388,8 +408,11 @@ evas_text_at(Evas e, Evas_Object o, int index,
|
|||
{
|
||||
__evas_x11_text_get_character_number(fn, oo->current.text,
|
||||
index,
|
||||
char_x, char_y,
|
||||
char_w, char_h);
|
||||
&cx, &cy, &cw, &ch);
|
||||
if (char_x) *char_x = (double)cx;
|
||||
if (char_y) *char_y = (double)cy;
|
||||
if (char_w) *char_w = (double)cw;
|
||||
if (char_h) *char_h = (double)ch;
|
||||
__evas_x11_text_font_free(fn);
|
||||
}
|
||||
}
|
||||
|
@ -403,8 +426,11 @@ evas_text_at(Evas e, Evas_Object o, int index,
|
|||
{
|
||||
__evas_gl_text_get_character_number(fn, oo->current.text,
|
||||
index,
|
||||
char_x, char_y,
|
||||
char_w, char_h);
|
||||
&cx, &cy, &cw, &ch);
|
||||
if (char_x) *char_x = (double)cx;
|
||||
if (char_y) *char_y = (double)cy;
|
||||
if (char_w) *char_w = (double)cw;
|
||||
if (char_h) *char_h = (double)ch;
|
||||
__evas_gl_text_font_free(fn);
|
||||
}
|
||||
}
|
||||
|
@ -417,9 +443,12 @@ evas_text_at(Evas e, Evas_Object o, int index,
|
|||
if (fn)
|
||||
{
|
||||
__evas_render_text_get_character_number(fn, oo->current.text,
|
||||
index,
|
||||
char_x, char_y,
|
||||
char_w, char_h);
|
||||
index,
|
||||
&cx, &cy, &cw, &ch);
|
||||
if (char_x) *char_x = (double)cx;
|
||||
if (char_y) *char_y = (double)cy;
|
||||
if (char_w) *char_w = (double)cw;
|
||||
if (char_h) *char_h = (double)ch;
|
||||
__evas_render_text_font_free(fn);
|
||||
}
|
||||
}
|
||||
|
@ -433,8 +462,11 @@ evas_text_at(Evas e, Evas_Object o, int index,
|
|||
{
|
||||
__evas_image_text_get_character_number(fn, oo->current.text,
|
||||
index,
|
||||
char_x, char_y,
|
||||
char_w, char_h);
|
||||
&cx, &cy, &cw, &ch);
|
||||
if (char_x) *char_x = (double)cx;
|
||||
if (char_y) *char_y = (double)cy;
|
||||
if (char_w) *char_w = (double)cw;
|
||||
if (char_h) *char_h = (double)ch;
|
||||
__evas_image_text_font_free(fn);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue