diff --git a/legacy/evas/src/bin/evas_test_main.c b/legacy/evas/src/bin/evas_test_main.c index 3b7391c0ee..e098305216 100644 --- a/legacy/evas/src/bin/evas_test_main.c +++ b/legacy/evas/src/bin/evas_test_main.c @@ -171,7 +171,7 @@ loop(void) #endif if (t <= 2.0) { - double y; + Evas_Coord y; y = sin((t / 2) * (EVAS_PI / 2)) * 240; evas_object_move(panel, 0, win_h - y); @@ -260,7 +260,7 @@ loop(void) } for (i = 0; i < 16; i++) { - double x, y; + Evas_Coord x, y; double v; v = (((t - 6.0) / 10.0) * EVAS_PI * 2) * 2; @@ -279,7 +279,7 @@ loop(void) for (i = 0; i < 2; i++) { int iw, ih; - double x, y; + Evas_Coord x, y; double v; evas_object_image_size_get(p_i[i], &iw, &ih); @@ -295,7 +295,7 @@ loop(void) } for (i = 0; i < 16; i++) { - double x, y; + Evas_Coord x, y; double v; v = (((t - 6.0) / 24.0) * EVAS_PI * 2) * 2; @@ -305,7 +305,7 @@ loop(void) } for (i = 0; i < 8; i++) { - double x, y; + Evas_Coord x, y; double v; v = (((t - 6.0) / 29.0) * EVAS_PI * 2) * 2; @@ -324,7 +324,7 @@ loop(void) } else if (t <= 36.0) { - double tw, th; + Evas_Coord tw, th; static int did_fps = 0; if (!did_fps) @@ -407,7 +407,7 @@ loop(void) evas_object_geometry_get(title, NULL, NULL, &tw, &th); evas_object_move(title, (win_w - tw) / 2, win_h - th); { - double x, y; + Evas_Coord x, y; double v; v = (((t - 6.0) / 10.0) * EVAS_PI * 2) * 2; @@ -421,14 +421,14 @@ loop(void) } else if (t <= 46.0) { - double tw, th; + Evas_Coord tw, th; evas_object_text_text_set(comment, "Image objects can be resized"); evas_object_text_text_set(title, "Test 2: Resize 2 Images"); evas_object_geometry_get(title, NULL, NULL, &tw, &th); evas_object_move(title, (win_w - tw) / 2, win_h - th); { - double x, y; + Evas_Coord x, y; double v; v = (((t - 16.0) / 10.0) * EVAS_PI * 2) * 2; @@ -443,7 +443,7 @@ loop(void) else if (t <= 56.0) { - double tw, th; + Evas_Coord tw, th; evas_object_text_text_set(comment, "Image objects are filled and scaled differently"); @@ -451,7 +451,7 @@ loop(void) evas_object_geometry_get(title, NULL, NULL, &tw, &th); evas_object_move(title, (win_w - tw) / 2, win_h - th); { - double x, y; + Evas_Coord x, y; double v; v = (((t - 26.0) / 10.0) * EVAS_PI * 2) * 2; @@ -467,7 +467,7 @@ loop(void) } else if (t <= 66.0) { - double tw, th; + Evas_Coord tw, th; evas_object_text_text_set(comment, "Image objects are offset filled"); evas_object_text_text_set(title, "Test 4: Fill Offset 2 Images"); @@ -477,7 +477,7 @@ loop(void) evas_object_resize(t1, 100, 100); evas_object_image_fill_set(t1, -25, -25, 100, 100); { - double x, y; + Evas_Coord x, y; double v; v = (((t - 36.0) / 10.0) * EVAS_PI * 2) * 2; @@ -494,7 +494,7 @@ loop(void) else if (t <= 76.0) { - double tw, th; + Evas_Coord tw, th; evas_object_text_text_set(comment, "Edges of images can be scaled differently"); @@ -504,7 +504,7 @@ loop(void) evas_object_image_border_set(t1, 8, 8, 8, 8); evas_object_image_border_set(t2, 8, 8, 8, 8); { - double x, y; + Evas_Coord x, y; double v; v = (((t - 46.0) / 10.0) * EVAS_PI * 2) * 2; @@ -520,7 +520,7 @@ loop(void) } else if (t <= 96.0) { - double tw, th; + Evas_Coord tw, th; int iw, ih; evas_object_text_text_set(title, "Test 7: Image Quality"); @@ -546,7 +546,7 @@ loop(void) } { double v; - double x, y; + Evas_Coord x, y; evas_object_image_size_get(test_pattern, &iw, &ih); v = 2.0 - ((t - 76.0) / 10.0); @@ -576,7 +576,7 @@ loop(void) } else if (t <= 106.0) { - double tw, th; + Evas_Coord tw, th; int iw, ih; evas_object_text_text_set(title, "Test 8: Raise & Lower"); @@ -610,7 +610,7 @@ loop(void) } else if (t <= 116.0) { - double tw, th; + Evas_Coord tw, th; int iw, ih; evas_object_text_text_set(title, "Test 9: Layer Setting"); @@ -646,7 +646,7 @@ loop(void) } else if (t <= 126.0) { - double tw, th; + Evas_Coord tw, th; int iw, ih; evas_object_text_text_set(title, "Test 10: Show & Hide"); @@ -680,7 +680,7 @@ loop(void) } else if (t <= 156.0) { - double tw, th; + Evas_Coord tw, th; int iw, ih; evas_object_text_text_set(title, "Test 11: Image Data Access"); @@ -770,7 +770,7 @@ loop(void) } else if (t <= 166.0) { - double tw, th; + Evas_Coord tw, th; evas_object_text_text_set(title, "Test 12: Image Destroy & Create"); evas_object_geometry_get(title, NULL, NULL, &tw, &th); @@ -838,7 +838,7 @@ loop(void) } else if (t <= 176.0) { - double tw, th; + Evas_Coord tw, th; evas_object_text_text_set(title, "Test 13: Line Destroy & Create"); evas_object_geometry_get(title, NULL, NULL, &tw, &th); @@ -888,7 +888,7 @@ loop(void) } else if (t <= 186.0) { - double tw, th; + Evas_Coord tw, th; evas_object_text_text_set(title, "Test 14: Rectangle Destroy & Create"); evas_object_geometry_get(title, NULL, NULL, &tw, &th); @@ -940,7 +940,7 @@ loop(void) } else if (t <= 196.0) { - double tw, th; + Evas_Coord tw, th; evas_object_text_text_set(title, "Test 15: Gradient Destroy & Create"); evas_object_geometry_get(title, NULL, NULL, &tw, &th); @@ -998,7 +998,7 @@ loop(void) } else if (t <= 206.0) { - double tw, th; + Evas_Coord tw, th; evas_object_text_text_set(title, "Test 16: Polygon Destroy & Create"); evas_object_geometry_get(title, NULL, NULL, &tw, &th); @@ -1052,7 +1052,7 @@ loop(void) } else if (t <= 216.0) { - double tw, th; + Evas_Coord tw, th; evas_object_text_text_set(title, "Test 17: Text Destroy & Create"); evas_object_geometry_get(title, NULL, NULL, &tw, &th); @@ -1113,7 +1113,7 @@ loop(void) } else if (t <= 227.0) { - double tw, th; + Evas_Coord tw, th; evas_object_text_text_set(comment, "Image objects can be clipped by rectangles"); @@ -1178,7 +1178,7 @@ loop(void) evas_object_clip_set(t2, c2); } { - double x, y; + Evas_Coord x, y; double v; v = (((t - 6.0) / 10.0) * EVAS_PI * 2) * 2; @@ -1192,7 +1192,7 @@ loop(void) } else if (t <= 237.0) { - double tw, th; + Evas_Coord tw, th; evas_object_text_text_set(comment, "Image objects can be clipped by recursively"); @@ -1201,7 +1201,7 @@ loop(void) evas_object_move(title, (win_w - tw) / 2, win_h - th); evas_object_clip_set(c2, c1); { - double x, y; + Evas_Coord x, y; double v; v = (((t - 6.0) / 10.0) * EVAS_PI * 2) * 2; @@ -1215,7 +1215,7 @@ loop(void) } else if (t <= 247.0) { - double tw, th; + Evas_Coord tw, th; evas_object_text_text_set(comment, "Clip objects can move around too..."); @@ -1223,7 +1223,7 @@ loop(void) evas_object_geometry_get(title, NULL, NULL, &tw, &th); evas_object_move(title, (win_w - tw) / 2, win_h - th); { - double x, y; + Evas_Coord x, y; double v; v = (((t - 6.0) / 10.0) * EVAS_PI * 2) * 2; @@ -1239,7 +1239,7 @@ loop(void) } else if (t <= 257.0) { - double tw, th; + Evas_Coord tw, th; evas_object_text_text_set(comment, "Clip objects can resize around too..."); @@ -1247,7 +1247,7 @@ loop(void) evas_object_geometry_get(title, NULL, NULL, &tw, &th); evas_object_move(title, (win_w - tw) / 2, win_h - th); { - double x, y; + Evas_Coord x, y; double v; evas_object_move(t1, 40, win_h - 240 + 60); @@ -1265,7 +1265,7 @@ loop(void) } else if (t <= 267.0) { - double tw, th; + Evas_Coord tw, th; evas_object_text_text_set(comment, "Clip objects can hide and show..."); evas_object_text_text_set(title, "Test 21: Show and Hide Clip Objects"); @@ -1314,7 +1314,7 @@ loop(void) } else if (t <= 277.0) { - double tw, th; + Evas_Coord tw, th; evas_object_text_text_set(comment, "Clip objects can clip and unclip..."); @@ -1344,7 +1344,7 @@ loop(void) } else if (t <= 287.0) { - double tw, th; + Evas_Coord tw, th; evas_object_text_text_set(comment, "Clip objects can be destroyed..."); evas_object_text_text_set(title, "Test 23: Destroy Clip Objects"); @@ -1408,7 +1408,7 @@ loop(void) } else if (t <= 298.0) { - double tw, th; + Evas_Coord tw, th; evas_object_text_text_set(comment, "We can change the text of a text object"); @@ -1450,7 +1450,7 @@ loop(void) } else if (t <= 308.0) { - double tw, th; + Evas_Coord tw, th; evas_object_text_text_set(comment, "We can change the font size"); evas_object_text_text_set(title, "Test 25: Set Text Object Size"); @@ -1460,7 +1460,7 @@ loop(void) } else if (t <= 318.0) { - double tw, th; + Evas_Coord tw, th; evas_object_text_text_set(comment, "We can move text"); evas_object_text_text_set(title, "Test 26: Move Text Object"); @@ -1469,7 +1469,7 @@ loop(void) evas_object_text_font_set(t1, "arial", 24); evas_object_text_text_set(t1, "Evas"); { - double x, y; + Evas_Coord x, y; double v; evas_object_geometry_get(t1, NULL, NULL, &tw, &th); @@ -1481,7 +1481,7 @@ loop(void) } else if (t <= 328.0) { - double tw, th; + Evas_Coord tw, th; evas_object_text_text_set(comment, "We can change the font"); evas_object_text_text_set(title, "Test 27: Set Text Object Font"); @@ -1509,7 +1509,7 @@ loop(void) } else if (t <= 338.0) { - double tw, th; + Evas_Coord tw, th; evas_object_text_text_set(comment, "We can change the color"); evas_object_text_text_set(title, "Test 28: Set Text Object Color"); @@ -1535,7 +1535,7 @@ loop(void) } else if (t <= 349.0) { - double tw, th; + Evas_Coord tw, th; evas_object_text_text_set(comment, "We can move gradients around"); evas_object_text_text_set(title, "Test 29: Move Gradients"); @@ -1560,7 +1560,7 @@ loop(void) t1 = ob; } { - double x, y; + Evas_Coord x, y; double v; evas_object_geometry_get(t1, NULL, NULL, &tw, &th); @@ -1572,14 +1572,14 @@ loop(void) } else if (t <= 359.0) { - double tw, th; + Evas_Coord tw, th; evas_object_text_text_set(comment, "We can resize gradients"); evas_object_text_text_set(title, "Test 30: Resize Gradients"); evas_object_geometry_get(title, NULL, NULL, &tw, &th); evas_object_move(title, (win_w - tw) / 2, win_h - th); { - double x, y; + Evas_Coord x, y; double v; v = (((t - 6.0) / 10.0) * EVAS_PI * 2) * 2; @@ -1591,7 +1591,7 @@ loop(void) } else if (t <= 369.0) { - double tw, th; + Evas_Coord tw, th; evas_object_text_text_set(comment, "We can change gradient angle fills & resize"); @@ -1599,7 +1599,7 @@ loop(void) evas_object_geometry_get(title, NULL, NULL, &tw, &th); evas_object_move(title, (win_w - tw) / 2, win_h - th); { - double x, y; + Evas_Coord x, y; double v; v = (((t - 6.0) / 10.0) * EVAS_PI * 2) * 2; @@ -1611,7 +1611,7 @@ loop(void) } else if (t <= 379.0) { - double tw, th; + Evas_Coord tw, th; evas_object_text_text_set(comment, "We can change color gradient, angle fill & resize"); @@ -1619,7 +1619,7 @@ loop(void) evas_object_geometry_get(title, NULL, NULL, &tw, &th); evas_object_move(title, (win_w - tw) / 2, win_h - th); { - double x, y; + Evas_Coord x, y; double v; v = (((t - 6.0) / 10.0) * EVAS_PI * 2) * 2; @@ -1649,7 +1649,7 @@ loop(void) } else if (t <= 369.0) /* FAIL! software_x11, fb */ { - double tw, th; + Evas_Coord tw, th; evas_object_text_text_set(comment, "We can change color of a gradient object"); @@ -1657,7 +1657,7 @@ loop(void) evas_object_geometry_get(title, NULL, NULL, &tw, &th); evas_object_move(title, (win_w - tw) / 2, win_h - th); { - double x, y; + Evas_Coord x, y; double v; v = (((t - 6.0) / 10.0) * EVAS_PI * 2) * 2; @@ -1686,7 +1686,7 @@ loop(void) } else if (t <= 400.0) { - double tw, th; + Evas_Coord tw, th; evas_object_text_text_set(comment, "We can move, resize and recolor rectangles"); @@ -1706,7 +1706,7 @@ loop(void) t1 = ob; } { - double x, y; + Evas_Coord x, y; double v; v = (((t - 6.0) / 10.0) * EVAS_PI * 2) * 2; @@ -1736,7 +1736,7 @@ loop(void) } else if (t <= 411.0) { - double tw, th; + Evas_Coord tw, th; evas_object_text_text_set(comment, "We can modify line begin & end coords"); @@ -1758,7 +1758,7 @@ loop(void) t1 = ob; } { - double x, y, xx, yy; + Evas_Coord x, y, xx, yy; double v; v = (((t - 2.0) / 12.0) * EVAS_PI * 2) * 2; @@ -1779,7 +1779,7 @@ loop(void) } else if (t <= 421.0) { - double tw, th; + Evas_Coord tw, th; evas_object_text_text_set(comment, "We can move, resize and recolor lines"); @@ -1787,7 +1787,7 @@ loop(void) evas_object_geometry_get(title, NULL, NULL, &tw, &th); evas_object_move(title, (win_w - tw) / 2, win_h - th); { - double x, y; + Evas_Coord x, y; double v; v = (((t - 6.0) / 10.0) * EVAS_PI * 2) * 2; @@ -1817,7 +1817,7 @@ loop(void) } else if (t <= 432.0) { - double tw, th; + Evas_Coord tw, th; evas_object_text_text_set(comment, "We can modify polygon points"); evas_object_text_text_set(title, "Test 36: Polygons"); @@ -1838,7 +1838,7 @@ loop(void) t1 = ob; } { - double x, y; + Evas_Coord x, y; double v; evas_object_polygon_points_clear(t1); @@ -1870,7 +1870,7 @@ loop(void) } else if (t <= 442.0) { - double tw, th; + Evas_Coord tw, th; evas_object_text_text_set(comment, "We can move, resize and recolor polygons"); @@ -1878,7 +1878,7 @@ loop(void) evas_object_geometry_get(title, NULL, NULL, &tw, &th); evas_object_move(title, (win_w - tw) / 2, win_h - th); { - double x, y; + Evas_Coord x, y; double v; v = (((t - 6.0) / 10.0) * EVAS_PI * 2) * 2; @@ -1908,7 +1908,7 @@ loop(void) } else if (t <= 453.0) { - double tw, th; + Evas_Coord tw, th; evas_object_text_text_set(comment, "We are now done with testing. Goodbye!"); diff --git a/legacy/evas/src/lib/Evas.h b/legacy/evas/src/lib/Evas.h index a778edf4bb..dcf6534cf4 100644 --- a/legacy/evas/src/lib/Evas.h +++ b/legacy/evas/src/lib/Evas.h @@ -38,6 +38,18 @@ typedef struct _Evas_Lock Evas_Lock; /**< An Evas Lock */ typedef struct _Evas_Smart Evas_Smart; /**< An Evas Smart Object handle */ typedef unsigned long long Evas_Modifier_Mask; /**< An Evas modifier mask type */ +#if 1 /* able to change co-ordinate systems to remove all fp ops */ +typedef double Evas_Coord; /**< A unit in canvas space. Normally a double, but may vary on platforms */ +typedef double Evas_Font_Size; /**< Units to descript font sizes. Normally a double, but may vary on platforms */ +typedef double Evas_Angle; /**< A unit to measure angles (in degrees). Normally a double, but may vary on platforms */ +typedef int Evas_Bool; /**< A boolean. 1 = on/true/yes, 0 = off/false/no */ +#else +typedef int Evas_Coord; +typedef int Evas_Font_Size; +typedef int Evas_Angle; +typedef char Evas_Bool; +#endif + struct _Evas_List /** A linked list node */ { void *data; /**< Pointer to list element payload */ @@ -67,8 +79,8 @@ struct _Evas_Smart_Class /** a smart object class */ void (*lower) (Evas_Object *o); void (*stack_above) (Evas_Object *o, Evas_Object *above); void (*stack_below) (Evas_Object *o, Evas_Object *below); - void (*move) (Evas_Object *o, double x, double y); - void (*resize) (Evas_Object *o, double w, double h); + void (*move) (Evas_Object *o, Evas_Coord x, Evas_Coord y); + void (*resize) (Evas_Object *o, Evas_Coord w, Evas_Coord h); void (*show) (Evas_Object *o); void (*hide) (Evas_Object *o); void (*color_set) (Evas_Object *o, int r, int g, int b, int a); @@ -80,7 +92,6 @@ struct _Evas_Smart_Class /** a smart object class */ #endif #endif - typedef struct _Evas_Engine_Info Evas_Engine_Info; /**< A generic Evas Engine information structure */ typedef struct _Evas_Event_Mouse_Down Evas_Event_Mouse_Down; /**< Event structure for #EVAS_CALLBACK_MOUSE_DOWN event callbacks */ typedef struct _Evas_Event_Mouse_Up Evas_Event_Mouse_Up; /**< Event structure for #EVAS_CALLBACK_MOUSE_UP event callbacks */ @@ -115,7 +126,7 @@ struct _Evas_Event_Mouse_Down /** Mouse button press event */ int x, y; } output; struct { - double x, y; + Evas_Coord x, y; } canvas; void *data; Evas_Modifier *modifiers; @@ -129,7 +140,7 @@ struct _Evas_Event_Mouse_Up /** Mouse butotn relase event */ int x, y; } output; struct { - double x, y; + Evas_Coord x, y; } canvas; void *data; Evas_Modifier *modifiers; @@ -143,7 +154,7 @@ struct _Evas_Event_Mouse_In /** Mouse enter event */ int x, y; } output; struct { - double x, y; + Evas_Coord x, y; } canvas; void *data; Evas_Modifier *modifiers; @@ -157,7 +168,7 @@ struct _Evas_Event_Mouse_Out /** Mouse leave event */ int x, y; } output; struct { - double x, y; + Evas_Coord x, y; } canvas; void *data; Evas_Modifier *modifiers; @@ -172,7 +183,7 @@ struct _Evas_Event_Mouse_Move /** Mouse button down event */ int x, y; } output; struct { - double x, y; + Evas_Coord x, y; } canvas; } cur, prev; void *data; @@ -190,7 +201,7 @@ struct _Evas_Event_Mouse_Wheel /** Wheel event */ } output; struct { - double x, y; + Evas_Coord x, y; } canvas; void *data; @@ -248,7 +259,7 @@ extern "C" { void *evas_hash_find (Evas_Hash *hash, const char *key); int evas_hash_size (Evas_Hash *hash); void evas_hash_free (Evas_Hash *hash); - void evas_hash_foreach (Evas_Hash *hash, int (*func) (Evas_Hash *hash, const char *key, void *data, void *fdata), const void *fdata); + void evas_hash_foreach (Evas_Hash *hash, Evas_Bool (*func) (Evas_Hash *hash, const char *key, void *data, void *fdata), const void *fdata); int evas_hash_alloc_error (void); int evas_alloc_error (void); @@ -268,18 +279,18 @@ extern "C" { void evas_output_size_set (Evas *e, int w, int h); void evas_output_size_get (Evas *e, int *w, int *h); - void evas_output_viewport_set (Evas *e, double x, double y, double w, double h); - void evas_output_viewport_get (Evas *e, double *x, double *y, double *w, double *h); + void evas_output_viewport_set (Evas *e, Evas_Coord x, Evas_Coord y, Evas_Coord w, Evas_Coord h); + void evas_output_viewport_get (Evas *e, Evas_Coord *x, Evas_Coord *y, Evas_Coord *w, Evas_Coord *h); - double evas_coord_screen_x_to_world (Evas *e, int x); - double evas_coord_screen_y_to_world (Evas *e, int y); - int evas_coord_world_x_to_screen (Evas *e, double x); - int evas_coord_world_y_to_screen (Evas *e, double y); + Evas_Coord evas_coord_screen_x_to_world (Evas *e, int x); + Evas_Coord evas_coord_screen_y_to_world (Evas *e, int y); + int evas_coord_world_x_to_screen (Evas *e, Evas_Coord x); + int evas_coord_world_y_to_screen (Evas *e, Evas_Coord y); void evas_pointer_output_xy_get (Evas *e, int *x, int *y); - void evas_pointer_canvas_xy_get (Evas *e, double *x, double *y); + void evas_pointer_canvas_xy_get (Evas *e, Evas_Coord *x, Evas_Coord *y); int evas_pointer_button_down_mask_get (Evas *e); - int evas_pointer_inside_get (Evas *e); + Evas_Bool evas_pointer_inside_get (Evas *e); /* DOC UP TO HERE */ void evas_damage_rectangle_add (Evas *e, int x, int y, int w, int h); void evas_obscured_rectangle_add (Evas *e, int x, int y, int w, int h); @@ -291,17 +302,17 @@ extern "C" { Evas_Object *evas_object_rectangle_add (Evas *e); Evas_Object *evas_object_line_add (Evas *e); - void evas_object_line_xy_set (Evas_Object *obj, double x1, double y1, double x2, double y2); - void evas_object_line_xy_get (Evas_Object *obj, double *x1, double *y1, double *x2, double *y2); + void evas_object_line_xy_set (Evas_Object *obj, Evas_Coord x1, Evas_Coord y1, Evas_Coord x2, Evas_Coord y2); + void evas_object_line_xy_get (Evas_Object *obj, Evas_Coord *x1, Evas_Coord *y1, Evas_Coord *x2, Evas_Coord *y2); Evas_Object *evas_object_gradient_add (Evas *e); void evas_object_gradient_color_add (Evas_Object *obj, int r, int g, int b, int a, int distance); void evas_object_gradient_colors_clear (Evas_Object *obj); - void evas_object_gradient_angle_set (Evas_Object *obj, double angle); - double evas_object_gradient_angle_get (Evas_Object *obj); + void evas_object_gradient_angle_set (Evas_Object *obj, Evas_Angle angle); + Evas_Angle evas_object_gradient_angle_get (Evas_Object *obj); Evas_Object *evas_object_polygon_add (Evas *e); - void evas_object_polygon_point_add (Evas_Object *obj, double x, double y); + void evas_object_polygon_point_add (Evas_Object *obj, Evas_Coord x, Evas_Coord y); void evas_object_polygon_points_clear (Evas_Object *obj); Evas_Object *evas_object_image_add (Evas *e); @@ -309,19 +320,19 @@ extern "C" { void evas_object_image_file_get (Evas_Object *obj, char **file, char **key); void evas_object_image_border_set (Evas_Object *obj, int l, int r, int t, int b); void evas_object_image_border_get (Evas_Object *obj, int *l, int *r, int *t, int *b); - void evas_object_image_fill_set (Evas_Object *obj, double x, double y, double w, double h); - void evas_object_image_fill_get (Evas_Object *obj, double *x, double *y, double *w, double *h); + void evas_object_image_fill_set (Evas_Object *obj, Evas_Coord x, Evas_Coord y, Evas_Coord w, Evas_Coord h); + void evas_object_image_fill_get (Evas_Object *obj, Evas_Coord *x, Evas_Coord *y, Evas_Coord *w, Evas_Coord *h); void evas_object_image_size_set (Evas_Object *obj, int w, int h); void evas_object_image_size_get (Evas_Object *obj, int *w, int *h); int evas_object_image_load_error_get (Evas_Object *obj); - void evas_object_image_data_set (Evas_Object *obj, int *data); - int *evas_object_image_data_get (Evas_Object *obj, int for_writing); - void evas_object_image_data_copy_set (Evas_Object *obj, int *data); + void evas_object_image_data_set (Evas_Object *obj, void *data); + void *evas_object_image_data_get (Evas_Object *obj, Evas_Bool for_writing); + void evas_object_image_data_copy_set (Evas_Object *obj, void *data); void evas_object_image_data_update_add (Evas_Object *obj, int x, int y, int w, int h); - void evas_object_image_alpha_set (Evas_Object *obj, int has_alpha); - int evas_object_image_alpha_get (Evas_Object *obj); - void evas_object_image_smooth_scale_set(Evas_Object *obj, int smooth_scale); - int evas_object_image_smooth_scale_get(Evas_Object *obj); + void evas_object_image_alpha_set (Evas_Object *obj, Evas_Bool has_alpha); + Evas_Bool evas_object_image_alpha_get (Evas_Object *obj); + void evas_object_image_smooth_scale_set(Evas_Object *obj, Evas_Bool smooth_scale); + Evas_Bool evas_object_image_smooth_scale_get(Evas_Object *obj); void evas_object_image_reload (Evas_Object *obj); void evas_image_cache_flush (Evas *e); @@ -330,19 +341,19 @@ extern "C" { int evas_image_cache_get (Evas *e); Evas_Object *evas_object_text_add (Evas *e); - void evas_object_text_font_set (Evas_Object *obj, const char *font, double size); - void evas_object_text_font_get (Evas_Object *obj, char **font, double *size); + void evas_object_text_font_set (Evas_Object *obj, const char *font, Evas_Font_Size size); + void evas_object_text_font_get (Evas_Object *obj, char **font, Evas_Font_Size *size); void evas_object_text_text_set (Evas_Object *obj, const char *text); const char *evas_object_text_text_get (Evas_Object *obj); - double evas_object_text_ascent_get (Evas_Object *obj); - double evas_object_text_descent_get (Evas_Object *obj); - double evas_object_text_max_ascent_get (Evas_Object *obj); - double evas_object_text_max_descent_get (Evas_Object *obj); - double evas_object_text_horiz_advance_get(Evas_Object *obj); - double evas_object_text_vert_advance_get (Evas_Object *obj); - double evas_object_text_inset_get (Evas_Object *obj); - int evas_object_text_char_pos_get (Evas_Object *obj, int pos, double *cx, double *cy, double *cw, double *ch); - int evas_object_text_char_coords_get (Evas_Object *obj, double x, double y, double *cx, double *cy, double *cw, double *ch); + Evas_Coord evas_object_text_ascent_get (Evas_Object *obj); + Evas_Coord evas_object_text_descent_get (Evas_Object *obj); + Evas_Coord evas_object_text_max_ascent_get (Evas_Object *obj); + Evas_Coord evas_object_text_max_descent_get (Evas_Object *obj); + Evas_Coord evas_object_text_horiz_advance_get(Evas_Object *obj); + Evas_Coord evas_object_text_vert_advance_get (Evas_Object *obj); + Evas_Coord evas_object_text_inset_get (Evas_Object *obj); + int evas_object_text_char_pos_get (Evas_Object *obj, int pos, Evas_Coord *cx, Evas_Coord *cy, Evas_Coord *cw, Evas_Coord *ch); + int evas_object_text_char_coords_get (Evas_Object *obj, Evas_Coord x, Evas_Coord y, Evas_Coord *cx, Evas_Coord *cy, Evas_Coord *cw, Evas_Coord *ch); int evas_string_char_next_get (const char *str, int pos, int *decoded); int evas_string_char_prev_get (const char *str, int pos, int *decoded); @@ -372,13 +383,13 @@ extern "C" { Evas_Object *evas_object_bottom_get (Evas *e); Evas_Object *evas_object_top_get (Evas *e); - void evas_object_move (Evas_Object *obj, double x, double y); - void evas_object_resize (Evas_Object *obj, double w, double h); - void evas_object_geometry_get (Evas_Object *obj, double *x, double *y, double *w, double *h); + void evas_object_move (Evas_Object *obj, Evas_Coord x, Evas_Coord y); + void evas_object_resize (Evas_Object *obj, Evas_Coord w, Evas_Coord h); + void evas_object_geometry_get (Evas_Object *obj, Evas_Coord *x, Evas_Coord *y, Evas_Coord *w, Evas_Coord *h); void evas_object_show (Evas_Object *obj); void evas_object_hide (Evas_Object *obj); - int evas_object_visible_get (Evas_Object *obj); + Evas_Bool evas_object_visible_get (Evas_Object *obj); void evas_object_color_set (Evas_Object *obj, int r, int g, int b, int a); void evas_object_color_get (Evas_Object *obj, int *r, int *g, int *b, int *a); @@ -398,14 +409,14 @@ extern "C" { Evas *evas_object_evas_get (Evas_Object *obj); - Evas_Object *evas_object_top_at_xy_get (Evas *e, double x, double y, int include_pass_events_objects, int include_hidden_objects); + Evas_Object *evas_object_top_at_xy_get (Evas *e, Evas_Coord x, Evas_Coord y, Evas_Bool include_pass_events_objects, Evas_Bool include_hidden_objects); Evas_Object *evas_object_top_at_pointer_get (Evas *e); - Evas_Object *evas_object_top_in_rectangle_get (Evas *e, double x, double y, double w, double h, int include_pass_events_objects, int include_hidden_objects); + Evas_Object *evas_object_top_in_rectangle_get (Evas *e, Evas_Coord x, Evas_Coord y, Evas_Coord w, Evas_Coord h, Evas_Bool include_pass_events_objects, Evas_Bool include_hidden_objects); - Evas_List *evas_objects_at_xy_get (Evas *e, double x, double y, int include_pass_events_objects, int include_hidden_objects); - Evas_List *evas_objects_in_rectangle_get (Evas *e, double x, double y, double w, double h, int include_pass_events_objects, int include_hidden_objects); + Evas_List *evas_objects_at_xy_get (Evas *e, Evas_Coord x, Evas_Coord y, Evas_Bool include_pass_events_objects, Evas_Bool include_hidden_objects); + Evas_List *evas_objects_in_rectangle_get (Evas *e, Evas_Coord x, Evas_Coord y, Evas_Coord w, Evas_Coord h, Evas_Bool include_pass_events_objects, Evas_Bool include_hidden_objects); - Evas_Smart *evas_smart_new (const char *name, void (*func_add) (Evas_Object *obj), void (*func_del) (Evas_Object *obj), void (*func_layer_set) (Evas_Object *obj, int l), void (*func_raise) (Evas_Object *obj), void (*func_lower) (Evas_Object *obj), void (*func_stack_above) (Evas_Object *obj, Evas_Object *above), void (*func_stack_below) (Evas_Object *obj, Evas_Object *below), void (*func_move) (Evas_Object *obj, double x, double y), void (*func_resize) (Evas_Object *obj, double w, double h), void (*func_show) (Evas_Object *obj), void (*func_hide) (Evas_Object *obj), void (*func_color_set) (Evas_Object *obj, int r, int g, int b, int a), void (*func_clip_set) (Evas_Object *obj, Evas_Object *clip), void (*func_clip_unset) (Evas_Object *obj), const void *data); + Evas_Smart *evas_smart_new (const char *name, void (*func_add) (Evas_Object *obj), void (*func_del) (Evas_Object *obj), void (*func_layer_set) (Evas_Object *obj, int l), void (*func_raise) (Evas_Object *obj), void (*func_lower) (Evas_Object *obj), void (*func_stack_above) (Evas_Object *obj, Evas_Object *above), void (*func_stack_below) (Evas_Object *obj, Evas_Object *below), void (*func_move) (Evas_Object *obj, Evas_Coord x, Evas_Coord y), void (*func_resize) (Evas_Object *obj, Evas_Coord w, Evas_Coord h), void (*func_show) (Evas_Object *obj), void (*func_hide) (Evas_Object *obj), void (*func_color_set) (Evas_Object *obj, int r, int g, int b, int a), void (*func_clip_set) (Evas_Object *obj, Evas_Object *clip), void (*func_clip_unset) (Evas_Object *obj), const void *data); void evas_smart_free (Evas_Smart *s); Evas_Smart *evas_smart_class_new (Evas_Smart_Class *sc); Evas_Smart_Class *evas_smart_class_get (Evas_Smart *s); @@ -442,17 +453,17 @@ extern "C" { void evas_event_feed_key_down (Evas *e, const char *keyname); void evas_event_feed_key_up (Evas *e, const char *keyname); - void evas_object_focus_set (Evas_Object *obj, int focus); - int evas_object_focus_get (Evas_Object *obj); + void evas_object_focus_set (Evas_Object *obj, Evas_Bool focus); + Evas_Bool evas_object_focus_get (Evas_Object *obj); Evas_Object *evas_focus_get (Evas *e); Evas_Modifier *evas_key_modifier_get (Evas *e); Evas_Lock *evas_key_lock_get (Evas *e); - int evas_key_modifier_is_set_get (Evas_Modifier *m, const char *keyname); + Evas_Bool evas_key_modifier_is_set_get (Evas_Modifier *m, const char *keyname); - int evas_key_lock_is_set_get (Evas_Lock *l, const char *keyname); + Evas_Bool evas_key_lock_is_set_get (Evas_Lock *l, const char *keyname); void evas_key_modifier_add (Evas *e, const char *keyname); void evas_key_modifier_del (Evas *e, const char *keyname); @@ -466,13 +477,13 @@ extern "C" { Evas_Modifier_Mask evas_key_modifier_mask_get (Evas *e, const char *keyname); - int evas_object_key_grab (Evas_Object *obj, const char *keyname, Evas_Modifier_Mask modifiers, Evas_Modifier_Mask not_modifiers, int exclusive); + Evas_Bool evas_object_key_grab (Evas_Object *obj, const char *keyname, Evas_Modifier_Mask modifiers, Evas_Modifier_Mask not_modifiers, Evas_Bool exclusive); void evas_object_key_ungrab (Evas_Object *obj, const char *keyname, Evas_Modifier_Mask modifiers, Evas_Modifier_Mask not_modifiers); - void evas_object_pass_events_set (Evas_Object *obj, int pass); - int evas_object_pass_events_get (Evas_Object *obj); - void evas_object_repeat_events_set (Evas_Object *obj, int repeat); - int evas_object_repeat_events_get (Evas_Object *obj); + void evas_object_pass_events_set (Evas_Object *obj, Evas_Bool pass); + Evas_Bool evas_object_pass_events_get (Evas_Object *obj); + void evas_object_repeat_events_set (Evas_Object *obj, Evas_Bool repeat); + Evas_Bool evas_object_repeat_events_get (Evas_Object *obj); void evas_object_event_callback_add (Evas_Object *obj, Evas_Callback_Type type, void (*func) (void *data, Evas *e, Evas_Object *obj, void *event_info), const void *data); void *evas_object_event_callback_del (Evas_Object *obj, Evas_Callback_Type type, void (*func) (void *data, Evas *e, Evas_Object *obj, void *event_info)); @@ -481,10 +492,10 @@ extern "C" { void *evas_object_intercept_show_callback_del (Evas_Object *obj, void (*func) (void *data, Evas_Object *obj)); void evas_object_intercept_hide_callback_add (Evas_Object *obj, void (*func) (void *data, Evas_Object *obj), const void *data); void *evas_object_intercept_hide_callback_del (Evas_Object *obj, void (*func) (void *data, Evas_Object *obj)); - void evas_object_intercept_move_callback_add (Evas_Object *obj, void (*func) (void *data, Evas_Object *obj, double x, double y), const void *data); - void *evas_object_intercept_move_callback_del (Evas_Object *obj, void (*func) (void *data, Evas_Object *obj, double x, double y)); - void evas_object_intercept_resize_callback_add (Evas_Object *obj, void (*func) (void *data, Evas_Object *obj, double w, double h), const void *data); - void *evas_object_intercept_resize_callback_del (Evas_Object *obj, void (*func) (void *data, Evas_Object *obj, double w, double h)); + void evas_object_intercept_move_callback_add (Evas_Object *obj, void (*func) (void *data, Evas_Object *obj, Evas_Coord x, Evas_Coord y), const void *data); + void *evas_object_intercept_move_callback_del (Evas_Object *obj, void (*func) (void *data, Evas_Object *obj, Evas_Coord x, Evas_Coord y)); + void evas_object_intercept_resize_callback_add (Evas_Object *obj, void (*func) (void *data, Evas_Object *obj, Evas_Coord w, Evas_Coord h), const void *data); + void *evas_object_intercept_resize_callback_del (Evas_Object *obj, void (*func) (void *data, Evas_Object *obj, Evas_Coord w, Evas_Coord h)); void evas_object_intercept_raise_callback_add (Evas_Object *obj, void (*func) (void *data, Evas_Object *obj), const void *data); void *evas_object_intercept_raise_callback_del (Evas_Object *obj, void (*func) (void *data, Evas_Object *obj)); void evas_object_intercept_lower_callback_add (Evas_Object *obj, void (*func) (void *data, Evas_Object *obj), const void *data); diff --git a/legacy/evas/src/lib/canvas/evas_callbacks.c b/legacy/evas/src/lib/canvas/evas_callbacks.c index 051cd14585..b09fb87af0 100644 --- a/legacy/evas/src/lib/canvas/evas_callbacks.c +++ b/legacy/evas/src/lib/canvas/evas_callbacks.c @@ -43,8 +43,6 @@ evas_object_event_callback_list_post_free(Evas_Object_List **list) static void evas_object_event_callback_clear(Evas_Object *obj) { - Evas_Callback_Type t; - if (!obj->callbacks) return; if (!obj->callbacks->deletions_waiting) return; obj->callbacks->deletions_waiting = 0; diff --git a/legacy/evas/src/lib/canvas/evas_clip.c b/legacy/evas/src/lib/canvas/evas_clip.c index d603b5ff24..bc6a3707a3 100644 --- a/legacy/evas/src/lib/canvas/evas_clip.c +++ b/legacy/evas/src/lib/canvas/evas_clip.c @@ -90,7 +90,31 @@ evas_object_clippers_was_visible(Evas_Object *obj) * @param clip The object to clip @p obj by * * This function will clip the object @p obj to the area occupied by the - * object @p clipper. + * object @p clipper. This means the object @p obj will only be visible within + * the area occupied by the clipping object (@p clip). The color of the object + * being clipped will be multiplied by the color of the clipping object, so + * the resulting color for the clipped object is + * RESULT = (OBJ * CLIP) / (255 * 255) per color element (red, green, blue and + * alpha). Clipping is recursive, so clip objects may be clipped by other + * objects, and their color will in tern be multiplied. You may NOT set up + * circular clipping lists (i.e. object 1 clips object 2 which clips object 2). + * The behavior of Evas is undefined in this case. Objects which do not clip + * others are visible as normal, those that clip 1 or more objects become + * invisible themselves, only affecting what they clip. If an object ceases to + * have other objects being clipped by it, it will become visible again. The + * visibility of an object affects the objects that are clipped by it, so if + * the object clipping others is now shown, the objects clipped will not be + * shown either. If the object was being clipped by another object when this + * function is called, it is implicitly removed from the clipper it is being + * clipped to, and now is made to clip its new clipper. + * + * At the moment the only objects that can validly be used to clip other + * objects are rectangle objects. All other objects types are invalid and the + * results of using them is undefined. + * + * The clip object @p clip must be a valid object, but may also be NULL in + * which case the effect of this function is the same as calling + * evas_object_clip_unset() on the @p obj object. * * Example: * @code @@ -150,9 +174,23 @@ evas_object_clip_set(Evas_Object *obj, Evas_Object *clip) } /** - * To be documented. + * Get the object clipping this one (if any). + * @param obj The object to get the clipper from * - * FIXME: To be fixed. + * This function returns the the object clipping @p obj. If it is not being + * clipped, NULL is returned. The object @p obj must be a valid object. + * + * See also evas_object_clip_set(), evas_object_clipees_get() and + * evas_object_clipees_get(). + * + * Example: + * @code + * extern Evas_Object *obj; + * Evas_Object *clipper; + * + * clipper = evas_object_clip_get(obj); + * if (clipper) evas_object_show(clipper); + * @endcode * */ Evas_Object * @@ -165,9 +203,29 @@ evas_object_clip_get(Evas_Object *obj) } /** - * To be documented. + * Disable clipping for an object. * - * FIXME: To be fixed. + * @param obj The object to cease clipping on + * + * This function disables clipping for the object @p obj, if it was already + * clipped. If it wasn't, this has no effect. The object @p obj must be a + * valid object. + * + * See also evas_object_clip_set(), evas_object_clipees_get() and + * evas_object_clip_get(). + * + * Example: + * @code + * extern Evas_Object *obj; + * Evas_Object *clipper; + * + * clipper = evas_object_clip_get(obj); + * if (clipper) + * { + * evas_object_clip_unset(obj); + * evas_object_hide(obj); + * } + * @endcode * */ void @@ -199,9 +257,45 @@ evas_object_clip_unset(Evas_Object *obj) } /** - * To be documented. + * Return a list of objects currently clipped by a specific object. + * + * @param obj The object to get a list of clippees from + * + * This returns the inernal list handle that contains all objects clipped by + * the object @p obj. If none are clipped, it returns NULL. This list is only + * valid and should be fetched again with another call to + * evas_object_clipees_get() if any objects being clipped by this object are + * unclipped, clipped by a new object, are deleted or the clipper is deleted. + * These operations will invalidate the list returned and so it should not be + * used anymore after that point. Any use of the list after this may have + * undefined results, not limited just to strange behavior but possible + * segfaults and other strange memory errors. The object @p obj must be a + * valid object. * - * FIXME: To be fixed. + * See also evas_object_clip_set(), evas_object_clip_unset() and + * evas_object_clip_get(). + * + * Example: + * @code + * extern Evas_Object *obj; + * Evas_Object *clipper; + * + * clipper = evas_object_clip_get(obj); + * if (clipper) + * { + * Evas_List *clippees, *l; + * + * clippees = evas_object_clipees_get(clipper); + * printf("Clipper clips %i objects\n", evas_list_count(clippees)); + * for (l = clippees; l; l = l->next) + * { + * Evas_Object *obj_tmp; + * + * obj_tmp = l->data; + * evas_object_show(obj_tmp); + * } + * } + * @endcode * */ const Evas_List * diff --git a/legacy/evas/src/lib/canvas/evas_events.c b/legacy/evas/src/lib/canvas/evas_events.c index 1362a0468b..3dbd38c60a 100644 --- a/legacy/evas/src/lib/canvas/evas_events.c +++ b/legacy/evas/src/lib/canvas/evas_events.c @@ -145,7 +145,6 @@ void evas_event_feed_mouse_wheel_data(Evas *e, int direction, int z, const void *data) { Evas_List *l, *copy; - Evas_Object *obj; MAGIC_CHECK(e, Evas, MAGIC_EVAS); return; @@ -290,7 +289,7 @@ void evas_event_feed_mouse_move_data(Evas *e, int x, int y, const void *data) { int px, py; - double pcx, pcy; + Evas_Coord pcx, pcy; MAGIC_CHECK(e, Evas, MAGIC_EVAS); return; @@ -482,6 +481,8 @@ evas_event_feed_mouse_in_data(Evas *e, const void *data) return; MAGIC_CHECK_END(); e->pointer.inside = 1; + return; + data = NULL; } /** @@ -497,6 +498,8 @@ evas_event_feed_mouse_out_data(Evas *e, const void *data) return; MAGIC_CHECK_END(); e->pointer.inside = 0; + return; + data = NULL; } /** @@ -758,7 +761,7 @@ evas_event_feed_key_up(Evas *e, const char *keyname) * */ void -evas_object_pass_events_set(Evas_Object *obj, int pass) +evas_object_pass_events_set(Evas_Object *obj, Evas_Bool pass) { MAGIC_CHECK(obj, Evas_Object, MAGIC_OBJ); return; @@ -778,7 +781,7 @@ evas_object_pass_events_set(Evas_Object *obj, int pass) * FIXME: To be fixed. * */ -int +Evas_Bool evas_object_pass_events_get(Evas_Object *obj) { MAGIC_CHECK(obj, Evas_Object, MAGIC_OBJ); @@ -794,7 +797,7 @@ evas_object_pass_events_get(Evas_Object *obj) * */ void -evas_object_repeat_events_set(Evas_Object *obj, int repeat) +evas_object_repeat_events_set(Evas_Object *obj, Evas_Bool repeat) { MAGIC_CHECK(obj, Evas_Object, MAGIC_OBJ); return; @@ -814,7 +817,7 @@ evas_object_repeat_events_set(Evas_Object *obj, int repeat) * FIXME: To be fixed. * */ -int +Evas_Bool evas_object_repeat_events_get(Evas_Object *obj) { MAGIC_CHECK(obj, Evas_Object, MAGIC_OBJ); diff --git a/legacy/evas/src/lib/canvas/evas_focus.c b/legacy/evas/src/lib/canvas/evas_focus.c index 276b3b30f5..67210f1b42 100644 --- a/legacy/evas/src/lib/canvas/evas_focus.c +++ b/legacy/evas/src/lib/canvas/evas_focus.c @@ -15,7 +15,7 @@ * */ void -evas_object_focus_set(Evas_Object *obj, int focus) +evas_object_focus_set(Evas_Object *obj, Evas_Bool focus) { MAGIC_CHECK(obj, Evas_Object, MAGIC_OBJ); return; @@ -45,7 +45,7 @@ evas_object_focus_set(Evas_Object *obj, int focus) * FIXME: To be fixed. * */ -int +Evas_Bool evas_object_focus_get(Evas_Object *obj) { MAGIC_CHECK(obj, Evas_Object, MAGIC_OBJ); diff --git a/legacy/evas/src/lib/canvas/evas_key.c b/legacy/evas/src/lib/canvas/evas_key.c index d0b127ce39..537d10fa2a 100644 --- a/legacy/evas/src/lib/canvas/evas_key.c +++ b/legacy/evas/src/lib/canvas/evas_key.c @@ -71,15 +71,17 @@ evas_key_lock_get(Evas *e) * FIXME: To be fixed. * */ -int +Evas_Bool evas_key_modifier_is_set_get(Evas_Modifier *m, const char *keyname) { Evas_Modifier_Mask num; + int n; if (!m) return 0; if (!keyname) return 0; - num = (Evas_Modifier_Mask)evas_key_modifier_number(m, keyname); - if (num < 0) return 0; + n = evas_key_modifier_number(m, keyname); + if (n < 0) return 0; + num = (Evas_Modifier_Mask)n; num = 1 << num; if (m->mask & num) return 1; return 0; @@ -91,15 +93,17 @@ evas_key_modifier_is_set_get(Evas_Modifier *m, const char *keyname) * FIXME: To be fixed. * */ -int +Evas_Bool evas_key_lock_is_set_get(Evas_Lock *l, const char *keyname) { Evas_Modifier_Mask num; + int n; if (!l) return 0; if (!keyname) return 0; - num = (Evas_Modifier_Mask)evas_key_lock_number(l, keyname); - if (num < 0) return 0; + n = evas_key_lock_number(l, keyname); + if (n < 0) return 0; + num = (Evas_Modifier_Mask)n; num = 1 << num; if (l->mask & num) return 1; return 0; @@ -220,12 +224,14 @@ void evas_key_modifier_on(Evas *e, const char *keyname) { Evas_Modifier_Mask num; + int n; MAGIC_CHECK(e, Evas, MAGIC_EVAS); return; MAGIC_CHECK_END(); - num = (Evas_Modifier_Mask)evas_key_modifier_number(&(e->modifiers), keyname); - if (num < 0) return; + n = (Evas_Modifier_Mask)evas_key_modifier_number(&(e->modifiers), keyname); + if (n < 0) return; + num = (Evas_Modifier_Mask)n; num = 1 << num; e->modifiers.mask |= num; } @@ -240,12 +246,14 @@ void evas_key_modifier_off(Evas *e, const char *keyname) { Evas_Modifier_Mask num; + int n; MAGIC_CHECK(e, Evas, MAGIC_EVAS); return; MAGIC_CHECK_END(); - num = (Evas_Modifier_Mask)evas_key_modifier_number(&(e->modifiers), keyname); - if (num < 0) return; + n = evas_key_modifier_number(&(e->modifiers), keyname); + if (n < 0) return; + num = (Evas_Modifier_Mask)n; num = 1 << num; e->modifiers.mask &= ~num; } @@ -260,12 +268,14 @@ void evas_key_lock_on(Evas *e, const char *keyname) { Evas_Modifier_Mask num; + int n; MAGIC_CHECK(e, Evas, MAGIC_EVAS); return; MAGIC_CHECK_END(); - num = (Evas_Modifier_Mask)evas_key_lock_number(&(e->locks), keyname); - if (num < 0) return; + n = evas_key_lock_number(&(e->locks), keyname); + if (n < 0) return; + num = (Evas_Modifier_Mask)n; num = 1 << num; e->locks.mask |= num; } @@ -280,12 +290,14 @@ void evas_key_lock_off(Evas *e, const char *keyname) { Evas_Modifier_Mask num; + int n; MAGIC_CHECK(e, Evas, MAGIC_EVAS); return; MAGIC_CHECK_END(); - num = (Evas_Modifier_Mask)evas_key_lock_number(&(e->locks), keyname); - if (num < 0) return; + n = evas_key_lock_number(&(e->locks), keyname); + if (n < 0) return; + num = (Evas_Modifier_Mask)n; num = 1 << num; e->locks.mask &= ~num; } @@ -302,12 +314,14 @@ Evas_Modifier_Mask evas_key_modifier_mask_get(Evas *e, const char *keyname) { Evas_Modifier_Mask num; + int n; MAGIC_CHECK(e, Evas, MAGIC_EVAS); return 0; MAGIC_CHECK_END(); if (!keyname) return 0; - num = evas_key_modifier_number(&(e->modifiers), keyname); - if (num < 0) return 0; + n = evas_key_modifier_number(&(e->modifiers), keyname); + if (n < 0) return 0; + num = (Evas_Modifier_Mask)n; return 1 << num; } diff --git a/legacy/evas/src/lib/canvas/evas_key_grab.c b/legacy/evas/src/lib/canvas/evas_key_grab.c index 3a5cbdac47..9b2bd85e32 100644 --- a/legacy/evas/src/lib/canvas/evas_key_grab.c +++ b/legacy/evas/src/lib/canvas/evas_key_grab.c @@ -18,7 +18,7 @@ evas_key_grab_new(Evas_Object *obj, const char *keyname, Evas_Modifier_Mask modi Evas_Key_Grab *g; g = evas_mem_calloc(sizeof(Evas_Key_Grab)); - if (!g) return; + if (!g) return NULL; g->object = obj; g->modifiers = modifiers; g->not_modifiers = not_modifiers; @@ -147,8 +147,8 @@ evas_key_grab_free(Evas_Object *obj, const char *keyname, Evas_Modifier_Mask mod * FIXME: To be fixed. * */ -int -evas_object_key_grab(Evas_Object *obj, const char *keyname, Evas_Modifier_Mask modifiers, Evas_Modifier_Mask not_modifiers, int exclusive) +Evas_Bool +evas_object_key_grab(Evas_Object *obj, const char *keyname, Evas_Modifier_Mask modifiers, Evas_Modifier_Mask not_modifiers, Evas_Bool exclusive) { /* MEM OK */ Evas_Key_Grab *g; diff --git a/legacy/evas/src/lib/canvas/evas_main.c b/legacy/evas/src/lib/canvas/evas_main.c index 84b367f363..31f79d0f04 100644 --- a/legacy/evas/src/lib/canvas/evas_main.c +++ b/legacy/evas/src/lib/canvas/evas_main.c @@ -452,7 +452,7 @@ evas_output_size_get(Evas *e, int *w, int *h) * @endcode */ void -evas_output_viewport_set(Evas *e, double x, double y, double w, double h) +evas_output_viewport_set(Evas *e, Evas_Coord x, Evas_Coord y, Evas_Coord w, Evas_Coord h) { MAGIC_CHECK(e, Evas, MAGIC_EVAS); return; @@ -489,13 +489,13 @@ evas_output_viewport_set(Evas *e, double x, double y, double w, double h) * Example: * @code * extern Evas *evas; - * double x, y, width, height; + * Evas_Coord x, y, width, height; * * evas_output_viewport_get(evas, &x, &y, &w, &h); * @endcode */ void -evas_output_viewport_get(Evas *e, double *x, double *y, double *w, double *h) +evas_output_viewport_get(Evas *e, Evas_Coord *x, Evas_Coord *y, Evas_Coord *w, Evas_Coord *h) { MAGIC_CHECK(e, Evas, MAGIC_EVAS); if (x) *x = 0; @@ -527,18 +527,18 @@ evas_output_viewport_get(Evas *e, double *x, double *y, double *w, double *h) * @code * extern Evas *evas; * extern int screen_x; - * double canvas_x; + * Evas_Coord canvas_x; * * canvas_x = evas_coord_screen_x_to_world(evas, screen_x); * @endcode */ -double +Evas_Coord evas_coord_screen_x_to_world(Evas *e, int x) { MAGIC_CHECK(e, Evas, MAGIC_EVAS); return 0; MAGIC_CHECK_END(); - return e->viewport.x + (((double)x * e->viewport.w) / (double)e->output.w); + return e->viewport.x + (((Evas_Coord)x * e->viewport.w) / (Evas_Coord)e->output.w); } /** @@ -557,18 +557,18 @@ evas_coord_screen_x_to_world(Evas *e, int x) * @code * extern Evas *evas; * extern int screen_y; - * double canvas_y; + * Evas_Coord canvas_y; * * canvas_y = evas_coord_screen_y_to_world(evas, screen_y); * @endcode */ -double +Evas_Coord evas_coord_screen_y_to_world(Evas *e, int y) { MAGIC_CHECK(e, Evas, MAGIC_EVAS); return 0; MAGIC_CHECK_END(); - return e->viewport.y + (((double)y * e->viewport.h) / (double)e->output.h); + return e->viewport.y + (((Evas_Coord)y * e->viewport.h) / (Evas_Coord)e->output.h); } /** @@ -587,18 +587,18 @@ evas_coord_screen_y_to_world(Evas *e, int y) * @code * extern Evas *evas; * int screen_x; - * extern double canvas_x; + * extern Evas_Coord canvas_x; * * screen_x = evas_coord_world_x_to_screen(evas, canvas_x); * @endcode */ int -evas_coord_world_x_to_screen(Evas *e, double x) +evas_coord_world_x_to_screen(Evas *e, Evas_Coord x) { MAGIC_CHECK(e, Evas, MAGIC_EVAS); return 0; MAGIC_CHECK_END(); - return (int)(((x - e->viewport.x) * (double)e->output.w) / e->viewport.w); + return (int)(((x - e->viewport.x) * (Evas_Coord)e->output.w) / e->viewport.w); } /** @@ -617,18 +617,18 @@ evas_coord_world_x_to_screen(Evas *e, double x) * @code * extern Evas *evas; * int screen_y; - * extern double canvas_y; + * extern Evas_Coord canvas_y; * * screen_y = evas_coord_world_y_to_screen(evas, canvas_y); * @endcode */ int -evas_coord_world_y_to_screen(Evas *e, double y) +evas_coord_world_y_to_screen(Evas *e, Evas_Coord y) { MAGIC_CHECK(e, Evas, MAGIC_EVAS); return 0; MAGIC_CHECK_END(); - return (int)(((y - e->viewport.y) * (double)e->output.h) / e->viewport.h); + return (int)(((y - e->viewport.y) * (Evas_Coord)e->output.h) / e->viewport.h); } /** @@ -837,25 +837,25 @@ evas_pointer_output_xy_get(Evas *e, int *x, int *y) * This function returns the current known pointer co-ordinates * * @param e The pointer to the Evas Canvas - * @param x The pointer to a double to be filled in - * @param y The pointer to a double to be filled in + * @param x The pointer to a Evas_Coord to be filled in + * @param y The pointer to a Evas_Coord to be filled in * * This function returns the current known canvas unit co-ordinates of the - * mouse pointer and sets the contents of the doubles pointed to by @p x + * mouse pointer and sets the contents of the Evas_Coords pointed to by @p x * and @p y to contain these co-ordinates. If @p e is not a valid canvas the * results of this function are undefined. * * Example: * @code * extern Evas *evas; - * double mouse_x, mouse_y; + * Evas_Coord mouse_x, mouse_y; * * evas_pointer_output_xy_get(evas, &mouse_x, &mouse_y); * printf("Mouse is at canvas position %f, %f\n", mouse_x, mouse_y); * @endcode */ void -evas_pointer_canvas_xy_get(Evas *e, double *x, double *y) +evas_pointer_canvas_xy_get(Evas *e, Evas_Coord *x, Evas_Coord *y) { MAGIC_CHECK(e, Evas, MAGIC_EVAS); if (x) *x = 0; @@ -936,7 +936,7 @@ evas_pointer_button_down_mask_get(Evas *e) * else printf("Mouse is out\n"); * @endcode */ -int +Evas_Bool evas_pointer_inside_get(Evas *e) { MAGIC_CHECK(e, Evas, MAGIC_EVAS); diff --git a/legacy/evas/src/lib/canvas/evas_object_gradient.c b/legacy/evas/src/lib/canvas/evas_object_gradient.c index 9261284f76..24239b5768 100644 --- a/legacy/evas/src/lib/canvas/evas_object_gradient.c +++ b/legacy/evas/src/lib/canvas/evas_object_gradient.c @@ -13,7 +13,7 @@ struct _Evas_Object_Gradient DATA32 magic; struct { - double angle; + Evas_Angle angle; } cur, prev; char changed : 1; char gradient_changed : 1; @@ -136,7 +136,7 @@ evas_object_gradient_colors_clear(Evas_Object *obj) * */ void -evas_object_gradient_angle_set(Evas_Object *obj, double angle) +evas_object_gradient_angle_set(Evas_Object *obj, Evas_Angle angle) { Evas_Object_Gradient *o; @@ -159,7 +159,7 @@ evas_object_gradient_angle_set(Evas_Object *obj, double angle) * FIXME: To be fixed. * */ -double +Evas_Angle evas_object_gradient_angle_get(Evas_Object *obj) { Evas_Object_Gradient *o; diff --git a/legacy/evas/src/lib/canvas/evas_object_image.c b/legacy/evas/src/lib/canvas/evas_object_image.c index 6ca64d8712..24b599c64d 100644 --- a/legacy/evas/src/lib/canvas/evas_object_image.c +++ b/legacy/evas/src/lib/canvas/evas_object_image.c @@ -14,7 +14,7 @@ struct _Evas_Object_Image struct { struct { - double x, y, w, h; + Evas_Coord x, y, w, h; } fill; struct { short w, h; @@ -41,8 +41,8 @@ struct _Evas_Object_Image /* private methods for image objects */ static void evas_object_image_unload(Evas_Object *obj); static void evas_object_image_load(Evas_Object *obj); -static double evas_object_image_figure_x_fill(Evas_Object *obj, double start, double size, double *size_ret); -static double evas_object_image_figure_y_fill(Evas_Object *obj, double start, double size, double *size_ret); +static Evas_Coord evas_object_image_figure_x_fill(Evas_Object *obj, Evas_Coord start, Evas_Coord size, Evas_Coord *size_ret); +static Evas_Coord evas_object_image_figure_y_fill(Evas_Object *obj, Evas_Coord start, Evas_Coord size, Evas_Coord *size_ret); static void evas_object_image_init(Evas_Object *obj); static void *evas_object_image_new(void); @@ -256,7 +256,7 @@ evas_object_image_border_get(Evas_Object *obj, int *l, int *r, int *t, int *b) * */ void -evas_object_image_fill_set(Evas_Object *obj, double x, double y, double w, double h) +evas_object_image_fill_set(Evas_Object *obj, Evas_Coord x, Evas_Coord y, Evas_Coord w, Evas_Coord h) { Evas_Object_Image *o; @@ -290,7 +290,7 @@ evas_object_image_fill_set(Evas_Object *obj, double x, double y, double w, doubl * */ void -evas_object_image_fill_get(Evas_Object *obj, double *x, double *y, double *w, double *h) +evas_object_image_fill_get(Evas_Object *obj, Evas_Coord *x, Evas_Coord *y, Evas_Coord *w, Evas_Coord *h) { Evas_Object_Image *o; @@ -411,7 +411,7 @@ evas_object_image_load_error_get(Evas_Object *obj) * */ void -evas_object_image_data_set(Evas_Object *obj, int *data) +evas_object_image_data_set(Evas_Object *obj, void *data) { Evas_Object_Image *o; void *p_data; @@ -447,8 +447,8 @@ evas_object_image_data_set(Evas_Object *obj, int *data) * FIXME: To be fixed. * */ -int * -evas_object_image_data_get(Evas_Object *obj, int for_writing) +void * +evas_object_image_data_get(Evas_Object *obj, Evas_Bool for_writing) { Evas_Object_Image *o; DATA32 *data; @@ -478,7 +478,7 @@ evas_object_image_data_get(Evas_Object *obj, int for_writing) * */ void -evas_object_image_data_copy_set(Evas_Object *obj, int *data) +evas_object_image_data_copy_set(Evas_Object *obj, void *data) { Evas_Object_Image *o; @@ -540,7 +540,7 @@ evas_object_image_data_update_add(Evas_Object *obj, int x, int y, int w, int h) * */ void -evas_object_image_alpha_set(Evas_Object *obj, int has_alpha) +evas_object_image_alpha_set(Evas_Object *obj, Evas_Bool has_alpha) { Evas_Object_Image *o; @@ -569,7 +569,7 @@ evas_object_image_alpha_set(Evas_Object *obj, int has_alpha) * FIXME: To be fixed. * */ -int +Evas_Bool evas_object_image_alpha_get(Evas_Object *obj) { Evas_Object_Image *o; @@ -591,7 +591,7 @@ evas_object_image_alpha_get(Evas_Object *obj) * */ void -evas_object_image_smooth_scale_set(Evas_Object *obj, int smooth_scale) +evas_object_image_smooth_scale_set(Evas_Object *obj, Evas_Bool smooth_scale) { Evas_Object_Image *o; @@ -615,7 +615,7 @@ evas_object_image_smooth_scale_set(Evas_Object *obj, int smooth_scale) * FIXME: To be fixed. * */ -int +Evas_Bool evas_object_image_smooth_scale_get(Evas_Object *obj) { Evas_Object_Image *o; @@ -827,13 +827,13 @@ evas_object_image_load(Evas_Object *obj) } } -static double -evas_object_image_figure_x_fill(Evas_Object *obj, double start, double size, double *size_ret) +static Evas_Coord +evas_object_image_figure_x_fill(Evas_Object *obj, Evas_Coord start, Evas_Coord size, Evas_Coord *size_ret) { - double w; + Evas_Coord w; w = ((size * obj->layer->evas->output.w) / - (double)obj->layer->evas->viewport.w); + (Evas_Coord)obj->layer->evas->viewport.w); if (start > 0) { while (start - size > 0) start -= size; @@ -843,18 +843,18 @@ evas_object_image_figure_x_fill(Evas_Object *obj, double start, double size, dou while (start < 0) start += size; } start = ((start * obj->layer->evas->output.w) / - (double)obj->layer->evas->viewport.w); + (Evas_Coord)obj->layer->evas->viewport.w); *size_ret = w; return start; } -static double -evas_object_image_figure_y_fill(Evas_Object *obj, double start, double size, double *size_ret) +static Evas_Coord +evas_object_image_figure_y_fill(Evas_Object *obj, Evas_Coord start, Evas_Coord size, Evas_Coord *size_ret) { - double h; + Evas_Coord h; h = ((size * obj->layer->evas->output.h) / - (double)obj->layer->evas->viewport.h); + (Evas_Coord)obj->layer->evas->viewport.h); if (start > 0) { while (start - size > 0) start -= size; @@ -864,7 +864,7 @@ evas_object_image_figure_y_fill(Evas_Object *obj, double start, double size, dou while (start < 0) start += size; } start = ((start * obj->layer->evas->output.h) / - (double)obj->layer->evas->viewport.h); + (Evas_Coord)obj->layer->evas->viewport.h); *size_ret = h; return start; } @@ -962,7 +962,7 @@ evas_object_image_render(Evas_Object *obj, void *output, void *context, void *su obj->cur.cache.clip.a); if (o->engine_data) { - double idw, idh, idx, idy; + Evas_Coord idw, idh, idx, idy; int ix, iy, iw, ih; idx = evas_object_image_figure_x_fill(obj, o->cur.fill.x, o->cur.fill.w, &idw); @@ -973,7 +973,7 @@ evas_object_image_render(Evas_Object *obj, void *output, void *context, void *su if (idy > 0.0) idy -= idh; while ((int)idx < obj->cur.cache.geometry.w) { - double ydy; + Evas_Coord ydy; int dobreak_w = 0; ydy = idy; @@ -1247,7 +1247,7 @@ evas_object_image_render_pre(Evas_Object *obj) while (o->pixel_updates) { Evas_Rectangle *r, *rr; - double idw, idh, idx, idy; + Evas_Coord idw, idh, idx, idy; int x, y, w, h; rr = o->pixel_updates->data; @@ -1255,13 +1255,13 @@ evas_object_image_render_pre(Evas_Object *obj) idx = evas_object_image_figure_x_fill(obj, o->cur.fill.x, o->cur.fill.w, &idw); idy = evas_object_image_figure_y_fill(obj, o->cur.fill.y, o->cur.fill.h, &idh); - if (idw < 1.0) idw = 1.0; - if (idh < 1.0) idh = 1.0; + if (idw < 1) idw = 1; + if (idh < 1) idh = 1; if (idx > 0) idx -= idw; if (idy > 0) idy -= idh; while (idx < obj->cur.cache.geometry.w) { - double ydy; + Evas_Coord ydy; ydy = idy; x = idx; diff --git a/legacy/evas/src/lib/canvas/evas_object_intercept.c b/legacy/evas/src/lib/canvas/evas_object_intercept.c index d297f11544..6d9890fb6a 100644 --- a/legacy/evas/src/lib/canvas/evas_object_intercept.c +++ b/legacy/evas/src/lib/canvas/evas_object_intercept.c @@ -76,7 +76,7 @@ evas_object_intercept_call_hide(Evas_Object *obj) } int -evas_object_intercept_call_move(Evas_Object *obj, double x, double y) +evas_object_intercept_call_move(Evas_Object *obj, Evas_Coord x, Evas_Coord y) { /* MEM OK */ int ret; @@ -92,7 +92,7 @@ evas_object_intercept_call_move(Evas_Object *obj, double x, double y) } int -evas_object_intercept_call_resize(Evas_Object *obj, double w, double h) +evas_object_intercept_call_resize(Evas_Object *obj, Evas_Coord w, Evas_Coord h) { /* MEM OK */ int ret; @@ -285,7 +285,7 @@ evas_object_intercept_hide_callback_del(Evas_Object *obj, void (*func) (void *da * */ void -evas_object_intercept_move_callback_add(Evas_Object *obj, void (*func) (void *data, Evas_Object *obj, double x, double y), const void *data) +evas_object_intercept_move_callback_add(Evas_Object *obj, void (*func) (void *data, Evas_Object *obj, Evas_Coord x, Evas_Coord y), const void *data) { /* MEM OK */ MAGIC_CHECK(obj, Evas_Object, MAGIC_OBJ); @@ -305,7 +305,7 @@ evas_object_intercept_move_callback_add(Evas_Object *obj, void (*func) (void *da * */ void * -evas_object_intercept_move_callback_del(Evas_Object *obj, void (*func) (void *data, Evas_Object *obj, double x, double y)) +evas_object_intercept_move_callback_del(Evas_Object *obj, void (*func) (void *data, Evas_Object *obj, Evas_Coord x, Evas_Coord y)) { /* MEM OK */ void *data; @@ -313,6 +313,7 @@ evas_object_intercept_move_callback_del(Evas_Object *obj, void (*func) (void *da MAGIC_CHECK(obj, Evas_Object, MAGIC_OBJ); return NULL; MAGIC_CHECK_END(); + if (!func) return NULL; if (!obj->interceptors) return NULL; obj->interceptors->move.func = NULL; data = obj->interceptors->move.data; @@ -328,7 +329,7 @@ evas_object_intercept_move_callback_del(Evas_Object *obj, void (*func) (void *da * */ void -evas_object_intercept_resize_callback_add(Evas_Object *obj, void (*func) (void *data, Evas_Object *obj, double w, double h), const void *data) +evas_object_intercept_resize_callback_add(Evas_Object *obj, void (*func) (void *data, Evas_Object *obj, Evas_Coord w, Evas_Coord h), const void *data) { /* MEM OK */ MAGIC_CHECK(obj, Evas_Object, MAGIC_OBJ); @@ -348,7 +349,7 @@ evas_object_intercept_resize_callback_add(Evas_Object *obj, void (*func) (void * * */ void * -evas_object_intercept_resize_callback_del(Evas_Object *obj, void (*func) (void *data, Evas_Object *obj, double w, double h)) +evas_object_intercept_resize_callback_del(Evas_Object *obj, void (*func) (void *data, Evas_Object *obj, Evas_Coord w, Evas_Coord h)) { /* MEM OK */ void *data; @@ -356,6 +357,7 @@ evas_object_intercept_resize_callback_del(Evas_Object *obj, void (*func) (void * MAGIC_CHECK(obj, Evas_Object, MAGIC_OBJ); return NULL; MAGIC_CHECK_END(); + if (!func) return NULL; if (!obj->interceptors) return NULL; obj->interceptors->resize.func = NULL; data = obj->interceptors->resize.data; @@ -399,6 +401,7 @@ evas_object_intercept_raise_callback_del(Evas_Object *obj, void (*func) (void *d MAGIC_CHECK(obj, Evas_Object, MAGIC_OBJ); return NULL; MAGIC_CHECK_END(); + if (!func) return NULL; if (!obj->interceptors) return NULL; obj->interceptors->raise.func = NULL; data = obj->interceptors->raise.data; @@ -442,6 +445,7 @@ evas_object_intercept_lower_callback_del(Evas_Object *obj, void (*func) (void *d MAGIC_CHECK(obj, Evas_Object, MAGIC_OBJ); return NULL; MAGIC_CHECK_END(); + if (!func) return NULL; if (!obj->interceptors) return NULL; obj->interceptors->lower.func = NULL; data = obj->interceptors->lower.data; @@ -485,6 +489,7 @@ evas_object_intercept_stack_above_callback_del(Evas_Object *obj, void (*func) (v MAGIC_CHECK(obj, Evas_Object, MAGIC_OBJ); return NULL; MAGIC_CHECK_END(); + if (!func) return NULL; if (!obj->interceptors) return NULL; obj->interceptors->stack_above.func = NULL; data = obj->interceptors->stack_above.data; @@ -528,6 +533,7 @@ evas_object_intercept_stack_below_callback_del(Evas_Object *obj, void (*func) (v MAGIC_CHECK(obj, Evas_Object, MAGIC_OBJ); return NULL; MAGIC_CHECK_END(); + if (!func) return NULL; if (!obj->interceptors) return NULL; obj->interceptors->stack_below.func = NULL; data = obj->interceptors->stack_below.data; @@ -571,6 +577,7 @@ evas_object_intercept_layer_set_callback_del(Evas_Object *obj, void (*func) (voi MAGIC_CHECK(obj, Evas_Object, MAGIC_OBJ); return NULL; MAGIC_CHECK_END(); + if (!func) return NULL; if (!obj->interceptors) return NULL; obj->interceptors->layer_set.func = NULL; data = obj->interceptors->layer_set.data; diff --git a/legacy/evas/src/lib/canvas/evas_object_line.c b/legacy/evas/src/lib/canvas/evas_object_line.c index 0cf9a2eea3..351b9911f3 100644 --- a/legacy/evas/src/lib/canvas/evas_object_line.c +++ b/legacy/evas/src/lib/canvas/evas_object_line.c @@ -15,10 +15,10 @@ struct _Evas_Object_Line struct { int x1, y1, x2, y2; struct { - double w, h; + Evas_Coord w, h; } object; } cache; - double x1, y1, x2, y2; + Evas_Coord x1, y1, x2, y2; } cur, prev; char changed : 1; @@ -35,8 +35,8 @@ static void evas_object_line_render_post(Evas_Object *obj); static int evas_object_line_is_opaque(Evas_Object *obj); static int evas_object_line_was_opaque(Evas_Object *obj); -static int evas_object_line_is_inside(Evas_Object *obj, double x, double y); -static int evas_object_line_was_inside(Evas_Object *obj, double x, double y); +static int evas_object_line_is_inside(Evas_Object *obj, Evas_Coord x, Evas_Coord y); +static int evas_object_line_was_inside(Evas_Object *obj, Evas_Coord x, Evas_Coord y); static void evas_object_line_coords_recalc(Evas_Object *obj); static Evas_Object_Func object_func = @@ -88,11 +88,12 @@ evas_object_line_add(Evas *e) * */ void -evas_object_line_xy_set(Evas_Object *obj, double x1, double y1, double x2, double y2) +evas_object_line_xy_set(Evas_Object *obj, Evas_Coord x1, Evas_Coord y1, Evas_Coord x2, Evas_Coord y2) { Evas_Object_Line *o; - double min_x, max_x, min_y, max_y; - int is, was; + Evas_Coord min_x, max_x, min_y, max_y; + int is, was = 0; + MAGIC_CHECK(obj, Evas_Object, MAGIC_OBJ); return; MAGIC_CHECK_END(); @@ -159,7 +160,7 @@ evas_object_line_xy_set(Evas_Object *obj, double x1, double y1, double x2, doubl * */ void -evas_object_line_xy_get(Evas_Object *obj, double *x1, double *y1, double *x2, double *y2) +evas_object_line_xy_get(Evas_Object *obj, Evas_Coord *x1, Evas_Coord *y1, Evas_Coord *x2, Evas_Coord *y2) { Evas_Object_Line *o; @@ -382,7 +383,7 @@ evas_object_line_was_opaque(Evas_Object *obj) } static int -evas_object_line_is_inside(Evas_Object *obj, double x, double y) +evas_object_line_is_inside(Evas_Object *obj, Evas_Coord x, Evas_Coord y) { Evas_Object_Line *o; @@ -396,7 +397,7 @@ evas_object_line_is_inside(Evas_Object *obj, double x, double y) } static int -evas_object_line_was_inside(Evas_Object *obj, double x, double y) +evas_object_line_was_inside(Evas_Object *obj, Evas_Coord x, Evas_Coord y) { Evas_Object_Line *o; diff --git a/legacy/evas/src/lib/canvas/evas_object_main.c b/legacy/evas/src/lib/canvas/evas_object_main.c index 14581bba0b..1b3139e81a 100644 --- a/legacy/evas/src/lib/canvas/evas_object_main.c +++ b/legacy/evas/src/lib/canvas/evas_object_main.c @@ -436,9 +436,9 @@ evas_object_del(Evas_Object *obj) * */ void -evas_object_move(Evas_Object *obj, double x, double y) +evas_object_move(Evas_Object *obj, Evas_Coord x, Evas_Coord y) { - int is, was; + int is, was = 0; MAGIC_CHECK(obj, Evas_Object, MAGIC_OBJ); return; @@ -487,9 +487,9 @@ evas_object_move(Evas_Object *obj, double x, double y) * */ void -evas_object_resize(Evas_Object *obj, double w, double h) +evas_object_resize(Evas_Object *obj, Evas_Coord w, Evas_Coord h) { - int is, was; + int is, was = 0; MAGIC_CHECK(obj, Evas_Object, MAGIC_OBJ); return; @@ -538,7 +538,7 @@ evas_object_resize(Evas_Object *obj, double w, double h) * */ void -evas_object_geometry_get(Evas_Object *obj, double *x, double *y, double *w, double *h) +evas_object_geometry_get(Evas_Object *obj, Evas_Coord *x, Evas_Coord *y, Evas_Coord *w, Evas_Coord *h) { MAGIC_CHECK(obj, Evas_Object, MAGIC_OBJ); if (x) *x = 0; if (y) *y = 0; if (w) *w = 0; if (h) *h = 0; @@ -659,7 +659,7 @@ evas_object_hide(Evas_Object *obj) * FIXME: To be fixed. * */ -int +Evas_Bool evas_object_visible_get(Evas_Object *obj) { MAGIC_CHECK(obj, Evas_Object, MAGIC_OBJ); @@ -742,7 +742,7 @@ evas_object_evas_get(Evas_Object *obj) * */ Evas_Object * -evas_object_top_at_xy_get(Evas *e, double x, double y, int include_pass_events_objects, int include_hidden_objects) +evas_object_top_at_xy_get(Evas *e, Evas_Coord x, Evas_Coord y, Evas_Bool include_pass_events_objects, Evas_Bool include_hidden_objects) { Evas_Object_List *l; int xx, yy; @@ -793,7 +793,7 @@ evas_object_top_at_pointer_get(Evas *e) * */ Evas_Object * -evas_object_top_in_rectangle_get(Evas *e, double x, double y, double w, double h, int include_pass_events_objects, int include_hidden_objects) +evas_object_top_in_rectangle_get(Evas *e, Evas_Coord x, Evas_Coord y, Evas_Coord w, Evas_Coord h, Evas_Bool include_pass_events_objects, Evas_Bool include_hidden_objects) { Evas_Object_List *l; int xx, yy, ww, hh; @@ -836,7 +836,7 @@ evas_object_top_in_rectangle_get(Evas *e, double x, double y, double w, double h * */ Evas_List * -evas_objects_at_xy_get(Evas *e, double x, double y, int include_pass_events_objects, int include_hidden_objects) +evas_objects_at_xy_get(Evas *e, Evas_Coord x, Evas_Coord y, Evas_Bool include_pass_events_objects, Evas_Bool include_hidden_objects) { Evas_List *in = NULL; Evas_Object_List *l; @@ -876,7 +876,7 @@ evas_objects_at_xy_get(Evas *e, double x, double y, int include_pass_events_obje * */ Evas_List * -evas_objects_in_rectangle_get(Evas *e, double x, double y, double w, double h, int include_pass_events_objects, int include_hidden_objects) +evas_objects_in_rectangle_get(Evas *e, Evas_Coord x, Evas_Coord y, Evas_Coord w, Evas_Coord h, Evas_Bool include_pass_events_objects, Evas_Bool include_hidden_objects) { Evas_List *in = NULL; Evas_Object_List *l; diff --git a/legacy/evas/src/lib/canvas/evas_object_polygon.c b/legacy/evas/src/lib/canvas/evas_object_polygon.c index 30dcef3d09..6866a5e4ae 100644 --- a/legacy/evas/src/lib/canvas/evas_object_polygon.c +++ b/legacy/evas/src/lib/canvas/evas_object_polygon.c @@ -20,7 +20,7 @@ struct _Evas_Object_Polygon struct _Evas_Polygon_Point { - double x, y; + Evas_Coord x, y; }; /* private methods for polygon objects */ @@ -33,8 +33,8 @@ static void evas_object_polygon_render_post(Evas_Object *obj); static int evas_object_polygon_is_opaque(Evas_Object *obj); static int evas_object_polygon_was_opaque(Evas_Object *obj); -static int evas_object_polygon_is_inside(Evas_Object *obj, double x, double y); -static int evas_object_polygon_was_inside(Evas_Object *obj, double x, double y); +static int evas_object_polygon_is_inside(Evas_Object *obj, Evas_Coord x, Evas_Coord y); +static int evas_object_polygon_was_inside(Evas_Object *obj, Evas_Coord x, Evas_Coord y); static Evas_Object_Func object_func = { @@ -85,12 +85,12 @@ evas_object_polygon_add(Evas *e) * */ void -evas_object_polygon_point_add(Evas_Object *obj, double x, double y) +evas_object_polygon_point_add(Evas_Object *obj, Evas_Coord x, Evas_Coord y) { Evas_Object_Polygon *o; Evas_Polygon_Point *p; - double min_x, max_x, min_y, max_y; - int is, was; + Evas_Coord min_x, max_x, min_y, max_y; + int is, was = 0; MAGIC_CHECK(obj, Evas_Object, MAGIC_OBJ); return; @@ -406,7 +406,7 @@ evas_object_polygon_was_opaque(Evas_Object *obj) } static int -evas_object_polygon_is_inside(Evas_Object *obj, double x, double y) +evas_object_polygon_is_inside(Evas_Object *obj, Evas_Coord x, Evas_Coord y) { Evas_Object_Polygon *o; @@ -420,7 +420,7 @@ evas_object_polygon_is_inside(Evas_Object *obj, double x, double y) } static int -evas_object_polygon_was_inside(Evas_Object *obj, double x, double y) +evas_object_polygon_was_inside(Evas_Object *obj, Evas_Coord x, Evas_Coord y) { Evas_Object_Polygon *o; diff --git a/legacy/evas/src/lib/canvas/evas_object_smart.c b/legacy/evas/src/lib/canvas/evas_object_smart.c index b343afa3a7..93752d35f8 100644 --- a/legacy/evas/src/lib/canvas/evas_object_smart.c +++ b/legacy/evas/src/lib/canvas/evas_object_smart.c @@ -231,13 +231,13 @@ evas_object_smart_callback_del(Evas_Object *obj, const char *event, void (*func) Evas_List *l; MAGIC_CHECK(obj, Evas_Object, MAGIC_OBJ); - return; + return NULL; MAGIC_CHECK_END(); o = (Evas_Object_Smart *)(obj->object_data); MAGIC_CHECK(o, Evas_Object_Smart, MAGIC_OBJ_SMART); - return; + return NULL; MAGIC_CHECK_END(); - if (!event) return; + if (!event) return NULL; for (l = obj->smart.callbacks; l; l = l->next) { Evas_Smart_Callback *cb; @@ -347,7 +347,7 @@ evas_object_smart_cleanup(Evas_Object *obj) if (cb->event) free(cb->event); free(cb); } - obj->smart.parent; + obj->smart.parent = NULL; obj->smart.data = NULL; obj->smart.smart = NULL; if (s) evas_object_smart_unuse(s); @@ -404,6 +404,9 @@ evas_object_smart_free(Evas_Object *obj) static void evas_object_smart_render(Evas_Object *obj, void *output, void *context, void *surface, int x, int y) { + return; + obj = output = context = surface = NULL; + x = y = 0; } static void diff --git a/legacy/evas/src/lib/canvas/evas_object_text.c b/legacy/evas/src/lib/canvas/evas_object_text.c index db0cc0d1d4..fd55476951 100644 --- a/legacy/evas/src/lib/canvas/evas_object_text.c +++ b/legacy/evas/src/lib/canvas/evas_object_text.c @@ -15,7 +15,7 @@ struct _Evas_Object_Text struct { char *text; char *font; - double size; + Evas_Font_Size size; } cur, prev; char changed : 1; @@ -245,7 +245,6 @@ object_text_font_cache_dir_add(char *dir) { char font_prop[14][256]; int i; - int match; /* skip comments */ if ((fdef[0] == '!') || (fdef[0] == '#')) continue; @@ -482,10 +481,10 @@ evas_object_text_add(Evas *e) * */ void -evas_object_text_font_set(Evas_Object *obj, const char *font, double size) +evas_object_text_font_set(Evas_Object *obj, const char *font, Evas_Font_Size size) { Evas_Object_Text *o; - int is, was; + int is, was = 0; int same_font = 0; if (!font) return; @@ -521,7 +520,7 @@ evas_object_text_font_set(Evas_Object *obj, const char *font, double size) { char *f_file; - f_file = object_text_font_cache_find(l->data, font); + f_file = object_text_font_cache_find(l->data, (char *)font); if (f_file) { o->engine_data = obj->layer->evas->engine.func->font_load(obj->layer->evas->engine.data.output, @@ -604,7 +603,7 @@ evas_object_text_font_set(Evas_Object *obj, const char *font, double size) * */ void -evas_object_text_font_get(Evas_Object *obj, char **font, double *size) +evas_object_text_font_get(Evas_Object *obj, char **font, Evas_Font_Size *size) { Evas_Object_Text *o; @@ -710,7 +709,7 @@ evas_object_text_text_get(Evas_Object *obj) * FIXME: To be fixed. * */ -double +Evas_Coord evas_object_text_ascent_get(Evas_Object *obj) { Evas_Object_Text *o; @@ -731,7 +730,7 @@ evas_object_text_ascent_get(Evas_Object *obj) * FIXME: To be fixed. * */ -double +Evas_Coord evas_object_text_descent_get(Evas_Object *obj) { Evas_Object_Text *o; @@ -752,7 +751,7 @@ evas_object_text_descent_get(Evas_Object *obj) * FIXME: To be fixed. * */ -double +Evas_Coord evas_object_text_max_ascent_get(Evas_Object *obj) { Evas_Object_Text *o; @@ -773,7 +772,7 @@ evas_object_text_max_ascent_get(Evas_Object *obj) * FIXME: To be fixed. * */ -double +Evas_Coord evas_object_text_max_descent_get(Evas_Object *obj) { Evas_Object_Text *o; @@ -794,7 +793,7 @@ evas_object_text_max_descent_get(Evas_Object *obj) * FIXME: To be fixed. * */ -double +Evas_Coord evas_object_text_inset_get(Evas_Object *obj) { Evas_Object_Text *o; @@ -817,7 +816,7 @@ evas_object_text_inset_get(Evas_Object *obj) * FIXME: To be fixed. * */ -double +Evas_Coord evas_object_text_horiz_advance_get(Evas_Object *obj) { Evas_Object_Text *o; @@ -840,7 +839,7 @@ evas_object_text_horiz_advance_get(Evas_Object *obj) * FIXME: To be fixed. * */ -double +Evas_Coord evas_object_text_vert_advance_get(Evas_Object *obj) { Evas_Object_Text *o; @@ -864,7 +863,7 @@ evas_object_text_vert_advance_get(Evas_Object *obj) * */ int -evas_object_text_char_pos_get(Evas_Object *obj, int pos, double *cx, double *cy, double *cw, double *ch) +evas_object_text_char_pos_get(Evas_Object *obj, int pos, Evas_Coord *cx, Evas_Coord *cy, Evas_Coord *cw, Evas_Coord *ch) { Evas_Object_Text *o; int ret, x = 0, y = 0, w = 0, h = 0; @@ -917,7 +916,7 @@ evas_object_text_char_pos_get(Evas_Object *obj, int pos, double *cx, double *cy, * */ int -evas_object_text_char_coords_get(Evas_Object *obj, double x, double y, double *cx, double *cy, double *cw, double *ch) +evas_object_text_char_coords_get(Evas_Object *obj, Evas_Coord x, Evas_Coord y, Evas_Coord *cx, Evas_Coord *cy, Evas_Coord *cw, Evas_Coord *ch) { Evas_Object_Text *o; int ret, rx = 0, ry = 0, rw = 0, rh = 0; @@ -1101,7 +1100,7 @@ evas_string_char_next_get(const char *str, int pos, int *decoded) if (!str) return 0; if (pos < 0) return 0; p = pos; - d = evas_common_font_utf8_get_next(str, &p); + d = evas_common_font_utf8_get_next((char *)str, &p); if (decoded) *decoded = d; return p; } @@ -1121,7 +1120,7 @@ evas_string_char_prev_get(const char *str, int pos, int *decoded) if (!str) return 0; if (pos < 0) return 0; p = pos; - d = evas_common_font_utf8_get_prev(str, &p); + d = evas_common_font_utf8_get_prev((char *)str, &p); if (decoded) *decoded = d; return p; } diff --git a/legacy/evas/src/lib/canvas/evas_smart.c b/legacy/evas/src/lib/canvas/evas_smart.c index 206d78d191..523a0b6405 100644 --- a/legacy/evas/src/lib/canvas/evas_smart.c +++ b/legacy/evas/src/lib/canvas/evas_smart.c @@ -19,8 +19,8 @@ evas_smart_new(const char *name, void (*func_lower) (Evas_Object *o), void (*func_stack_above) (Evas_Object *o, Evas_Object *above), void (*func_stack_below) (Evas_Object *o, Evas_Object *below), - void (*func_move) (Evas_Object *o, double x, double y), - void (*func_resize) (Evas_Object *o, double w, double h), + void (*func_move) (Evas_Object *o, Evas_Coord x, Evas_Coord y), + void (*func_resize) (Evas_Object *o, Evas_Coord w, Evas_Coord h), void (*func_show) (Evas_Object *o), void (*func_hide) (Evas_Object *o), void (*func_color_set) (Evas_Object *o, int r, int g, int b, int a), @@ -133,7 +133,7 @@ evas_smart_data_get(Evas_Smart *s) MAGIC_CHECK(s, Evas_Smart, MAGIC_SMART); return NULL; MAGIC_CHECK_END(); - return s->smart_class->data; + return (void *)s->smart_class->data; } /* internal funcs */ diff --git a/legacy/evas/src/lib/canvas/evas_stack.c b/legacy/evas/src/lib/canvas/evas_stack.c index 642d4878b0..aae831754b 100644 --- a/legacy/evas/src/lib/canvas/evas_stack.c +++ b/legacy/evas/src/lib/canvas/evas_stack.c @@ -290,7 +290,7 @@ evas_object_below_get(Evas_Object *obj) Evas_Object * evas_object_bottom_get(Evas *e) { - Evas_Object *obj2; + Evas_Object *obj2 = NULL; MAGIC_CHECK(e, Evas, MAGIC_EVAS); return NULL; @@ -311,7 +311,7 @@ evas_object_bottom_get(Evas *e) Evas_Object * evas_object_top_get(Evas *e) { - Evas_Object *obj2; + Evas_Object *obj2 = NULL; MAGIC_CHECK(e, Evas, MAGIC_EVAS); return NULL; diff --git a/legacy/evas/src/lib/data/evas_hash.c b/legacy/evas/src/lib/data/evas_hash.c index d1f89d0dcd..f304715e99 100644 --- a/legacy/evas/src/lib/data/evas_hash.c +++ b/legacy/evas/src/lib/data/evas_hash.c @@ -308,7 +308,7 @@ evas_hash_free(Evas_Hash *hash) * @code * extern Evas_Hash *hash; * - * int hash_fn(Evas_Hash *hash, const char *key, void *data, void *fdata) + * Evas_Bool hash_fn(Evas_Hash *hash, const char *key, void *data, void *fdata) * { * printf("Func data: %s, Hash entry: %s / %p\n", fdata, key, data); * return 1; @@ -325,7 +325,7 @@ evas_hash_free(Evas_Hash *hash) * @endcode */ void -evas_hash_foreach(Evas_Hash *hash, int (*func) (Evas_Hash *hash, const char *key, void *data, void *fdata), const void *fdata) +evas_hash_foreach(Evas_Hash *hash, Evas_Bool (*func) (Evas_Hash *hash, const char *key, void *data, void *fdata), const void *fdata) { int i, size; diff --git a/legacy/evas/src/lib/engines/common/evas_image_load.c b/legacy/evas/src/lib/engines/common/evas_image_load.c index 8f13f9d217..e3f18af26b 100644 --- a/legacy/evas/src/lib/engines/common/evas_image_load.c +++ b/legacy/evas/src/lib/engines/common/evas_image_load.c @@ -414,6 +414,7 @@ load_image_file_data_jpeg_internal(RGBA_Image *im, FILE *f) return 1; } +#if 0 /* not used at the moment */ static int load_image_file_data_jpeg_alpha_internal(RGBA_Image *im, FILE *f); static int load_image_file_data_jpeg_alpha_internal(RGBA_Image *im, FILE *f) @@ -519,6 +520,7 @@ load_image_file_data_jpeg_alpha_internal(RGBA_Image *im, FILE *f) jpeg_destroy_decompress(&cinfo); return 1; } +#endif static int load_image_file_head_jpeg(RGBA_Image *im, const char *file, const char *key); static int @@ -558,7 +560,7 @@ static int load_image_file_head_eet(RGBA_Image *im, const char *file, const char static int load_image_file_head_eet(RGBA_Image *im, const char *file, const char *key) { - int w, h, alpha, compression, size, quality, lossy; + int w, h, alpha, compression, quality, lossy; Eet_File *ef; DATA32 *body; @@ -611,7 +613,6 @@ load_image_file_head_edb(RGBA_Image *im, const char *file, const char *key) int w, h, alpha, compression, size; E_DB_File *db; DATA32 *ret; - DATA32 *body; DATA32 header[8]; if ((!file) || (!key)) return -1; diff --git a/legacy/evas/src/lib/engines/common/evas_scale_smooth_scaler.c b/legacy/evas/src/lib/engines/common/evas_scale_smooth_scaler.c index 0a9b075a87..f7d297a84d 100644 --- a/legacy/evas/src/lib/engines/common/evas_scale_smooth_scaler.c +++ b/legacy/evas/src/lib/engines/common/evas_scale_smooth_scaler.c @@ -6,7 +6,6 @@ SCALE_FUNC(RGBA_Image *src, RGBA_Image *dst, int dst_region_x, int dst_region_y, int dst_region_w, int dst_region_h) { - int divx, divy; int x, y; int *lin_ptr, *lin2_ptr; int *interp_x, *interp_y; @@ -291,11 +290,35 @@ SCALE_FUNC(RGBA_Image *src, RGBA_Image *dst, { lin_ptr[x] = (((x + dst_clip_x - dst_region_x) * (src_region_w)) / dst_region_w); - if (src_region_w > 4096) + if (dst_region_w > 262144) + interp_x[x] = (((((x + dst_clip_x - dst_region_x) * + (src_region_w))) / dst_region_w) - + (lin_ptr[x])) << 8; + else if (dst_region_w > 131072) + interp_x[x] = (((((x + dst_clip_x - dst_region_x) * + (src_region_w)) << 1) / dst_region_w) - + (lin_ptr[x] << 1)) << 7; + else if (dst_region_w > 65536) + interp_x[x] = (((((x + dst_clip_x - dst_region_x) * + (src_region_w)) << 2) / dst_region_w) - + (lin_ptr[x] << 2)) << 6; + else if (dst_region_w > 37268) + interp_x[x] = (((((x + dst_clip_x - dst_region_x) * + (src_region_w)) << 3) / dst_region_w) - + (lin_ptr[x] << 3)) << 5; + else if (dst_region_w > 16384) + interp_x[x] = (((((x + dst_clip_x - dst_region_x) * + (src_region_w)) << 4) / dst_region_w) - + (lin_ptr[x] << 4)) << 4; + else if (dst_region_w > 8192) + interp_x[x] = (((((x + dst_clip_x - dst_region_x) * + (src_region_w)) << 5) / dst_region_w) - + (lin_ptr[x] << 5)) << 3; + else if (dst_region_w > 4096) interp_x[x] = (((((x + dst_clip_x - dst_region_x) * (src_region_w)) << 6) / dst_region_w) - (lin_ptr[x] << 6)) << 2; - else if (src_region_w > 2048) + else if (dst_region_w > 2048) interp_x[x] = (((((x + dst_clip_x - dst_region_x) * (src_region_w)) << 7) / dst_region_w) - (lin_ptr[x] << 7)) << 1; @@ -322,11 +345,35 @@ SCALE_FUNC(RGBA_Image *src, RGBA_Image *dst, pos = (((y + dst_clip_y - dst_region_y) * (src_region_h)) / dst_region_h); row_ptr[y] = src_data + ((pos + src_region_y) * src_w); - if (src_region_h > 4096) + if (dst_region_h > 262144) + interp_y[y] = (((((y + dst_clip_y - dst_region_y) * + (src_region_h))) / dst_region_h) - + (pos)) << 8; + else if (dst_region_h > 131072) + interp_y[y] = (((((y + dst_clip_y - dst_region_y) * + (src_region_h)) << 1) / dst_region_h) - + (pos << 1)) << 7; + else if (dst_region_h > 65536) + interp_y[y] = (((((y + dst_clip_y - dst_region_y) * + (src_region_h)) << 2) / dst_region_h) - + (pos << 2)) << 6; + else if (dst_region_h > 32768) + interp_y[y] = (((((y + dst_clip_y - dst_region_y) * + (src_region_h)) << 3) / dst_region_h) - + (pos << 3)) << 5; + else if (dst_region_h > 16384) + interp_y[y] = (((((y + dst_clip_y - dst_region_y) * + (src_region_h)) << 4) / dst_region_h) - + (pos << 4)) << 4; + else if (dst_region_h > 8192) + interp_y[y] = (((((y + dst_clip_y - dst_region_y) * + (src_region_h)) << 5) / dst_region_h) - + (pos << 5)) << 3; + else if (dst_region_h > 4096) interp_y[y] = (((((y + dst_clip_y - dst_region_y) * (src_region_h)) << 6) / dst_region_h) - (pos << 6)) << 2; - else if (src_region_h > 2048) + else if (dst_region_h > 2048) interp_y[y] = (((((y + dst_clip_y - dst_region_y) * (src_region_h)) << 7) / dst_region_h) - (pos << 7)) << 1; @@ -630,6 +677,7 @@ SCALE_FUNC(RGBA_Image *src, RGBA_Image *dst, DATA32 *src_data, *src2_data; RGBA_Surface *srf1, *srf2; int mix; + int divx, divy; /* no mipmaps at all- need to populate mipmap table */ if (src->mipmaps.num == 0) @@ -847,7 +895,7 @@ SCALE_FUNC(RGBA_Image *src, RGBA_Image *dst, #define YAP (yapoints[dyy + y]) /* NEW scaling code... */ DATA32 *sptr; - int x, y, dyy; + int x, y; DATA32 **ypoints; int *xpoints; int *xapoints; diff --git a/legacy/evas/src/lib/file/evas_path.c b/legacy/evas/src/lib/file/evas_path.c index 46c3cca2f3..92644c9a0f 100644 --- a/legacy/evas/src/lib/file/evas_path.c +++ b/legacy/evas/src/lib/file/evas_path.c @@ -7,6 +7,7 @@ /* adding in a new set of functions here */ #ifndef _WIN32_WCE +/* UNIX compatability functions */ #include #include @@ -133,6 +134,7 @@ evas_file_path_resolve(const char *file) } #else +/* WIN32 WINCE compatability functions */ /* Forward declarations */ diff --git a/legacy/evas/src/lib/include/evas_common.h b/legacy/evas/src/lib/include/evas_common.h index 7701a2dd3f..5b0e869d31 100644 --- a/legacy/evas/src/lib/include/evas_common.h +++ b/legacy/evas/src/lib/include/evas_common.h @@ -40,7 +40,7 @@ #define POLY_EDGE_ADD(_i, _y) \ { \ int _j; \ - double _dx; \ + float _dx; \ RGBA_Vertex *_p, *_q; \ if (_i < (n - 1)) _j = _i + 1; \ else _j = 0; \ @@ -55,7 +55,7 @@ _q = &(point[_i]); \ } \ edges[num_active_edges].dx = _dx = (_q->x - _p->x) / (_q->y - _p->y); \ - edges[num_active_edges].x = (_dx * ((double)_y + 0.5 - _p->y)) + _p->x; \ + edges[num_active_edges].x = (_dx * ((float)_y + 0.5 - _p->y)) + _p->x; \ edges[num_active_edges].i = _i; \ num_active_edges++; \ } @@ -143,6 +143,13 @@ typedef struct _Evas_Object_List Evas_Object_List; typedef struct _Evas_List Evas_List; typedef struct _Evas_Hash Evas_Hash; typedef struct _Evas_Hash_El Evas_Hash_El; +#ifndef EVAS_PRIVATE_H +#if 1 /* able to change co-ordinate systems to remove all fp ops */ +typedef int Evas_Bool; +#else +typedef char Evas_Bool; +#endif +#endif typedef struct _RGBA_Image RGBA_Image; typedef struct _RGBA_Surface RGBA_Surface; @@ -575,7 +582,7 @@ Evas_Hash *evas_hash_del (Evas_Hash *hash, const char *key, const void *evas_hash_find (Evas_Hash *hash, const char *key); int evas_hash_size (Evas_Hash *hash); void evas_hash_free (Evas_Hash *hash); -void evas_hash_foreach (Evas_Hash *hash, int (*func) (Evas_Hash *hash, const char *key, void *data, void *fdata), const void *fdata); +void evas_hash_foreach (Evas_Hash *hash, Evas_Bool (*func) (Evas_Hash *hash, const char *key, void *data, void *fdata), const void *fdata); int evas_hash_alloc_error (void); void *evas_object_list_append (void *in_list, void *in_item); diff --git a/legacy/evas/src/lib/include/evas_private.h b/legacy/evas/src/lib/include/evas_private.h index 5c10a26113..966bff0783 100644 --- a/legacy/evas/src/lib/include/evas_private.h +++ b/legacy/evas/src/lib/include/evas_private.h @@ -37,29 +37,44 @@ typedef enum _Evas_Callback_Type EVAS_CALLBACK_RESTACK } Evas_Callback_Type; -typedef struct _Evas_Rectangle Evas_Rectangle; +typedef struct _Evas_Rectangle Evas_Rectangle; -typedef struct _Evas Evas; -typedef struct _Evas_Layer Evas_Layer; -typedef struct _Evas_Object Evas_Object; -typedef struct _Evas_Data_Node Evas_Data_Node; -typedef struct _Evas_Func_Node Evas_Func_Node; -typedef struct _Evas_Func Evas_Func; -typedef struct _Evas_Object_Func Evas_Object_Func; -typedef struct _Evas_Modifier Evas_Modifier; -typedef struct _Evas_Lock Evas_Lock; -typedef unsigned long long Evas_Modifier_Mask; -typedef struct _Evas_Smart Evas_Smart; -typedef void Evas_Performance; +typedef struct _Evas Evas; +typedef struct _Evas_Layer Evas_Layer; +typedef struct _Evas_Object Evas_Object; +typedef struct _Evas_Data_Node Evas_Data_Node; +typedef struct _Evas_Func_Node Evas_Func_Node; +typedef struct _Evas_Func Evas_Func; +typedef struct _Evas_Object_Func Evas_Object_Func; +typedef struct _Evas_Modifier Evas_Modifier; +typedef struct _Evas_Lock Evas_Lock; +typedef unsigned long long Evas_Modifier_Mask; +typedef struct _Evas_Smart Evas_Smart; +typedef void Evas_Performance; typedef struct _Evas_Intercept_Func Evas_Intercept_Func; typedef struct _Evas_Intercept_Func_Basic Evas_Intercept_Func_Basic; typedef struct _Evas_Intercept_Func_SizePos Evas_Intercept_Func_SizePos; typedef struct _Evas_Intercept_Func_Obj Evas_Intercept_Func_Obj; typedef struct _Evas_Intercept_Func_Int Evas_Intercept_Func_Int; typedef struct _Evas_Key_Grab Evas_Key_Grab; -typedef struct _Evas_Callbacks Evas_Callbacks; -typedef struct _Evas_Smart_Class Evas_Smart_Class; - +typedef struct _Evas_Callbacks Evas_Callbacks; +typedef struct _Evas_Smart_Class Evas_Smart_Class; +#if 1 /* able to change co-ordinate systems to remove all fp ops */ +typedef double Evas_Coord; +typedef double Evas_Font_Size; +typedef double Evas_Angle; +#ifndef EVAS_COMMON_H +typedef int Evas_Bool; +#endif +#else +typedef int Evas_Coord; +typedef int Evas_Font_Size; +typedef int Evas_Angle; +#ifndef EVAS_COMMON_H +typedef char Evas_Bool; +#endif +#endif + #define MAGIC_EVAS 0x70777770 #define MAGIC_OBJ 0x71777770 #define MAGIC_OBJ_RECTANGLE 0x71777771 @@ -138,7 +153,7 @@ struct _Evas_Intercept_Func_Basic struct _Evas_Intercept_Func_SizePos { - void (*func) (void *data, Evas_Object *obj, double x, double y); + void (*func) (void *data, Evas_Object *obj, Evas_Coord x, Evas_Coord y); void *data; }; @@ -201,8 +216,8 @@ struct _Evas_Smart_Class /** a smart object class */ void (*lower) (Evas_Object *o); void (*stack_above) (Evas_Object *o, Evas_Object *above); void (*stack_below) (Evas_Object *o, Evas_Object *below); - void (*move) (Evas_Object *o, double x, double y); - void (*resize) (Evas_Object *o, double w, double h); + void (*move) (Evas_Object *o, Evas_Coord x, Evas_Coord y); + void (*resize) (Evas_Object *o, Evas_Coord w, Evas_Coord h); void (*show) (Evas_Object *o); void (*hide) (Evas_Object *o); void (*color_set) (Evas_Object *o, int r, int g, int b, int a); @@ -264,7 +279,7 @@ struct _Evas DATA32 button; int x, y; - double canvas_x, canvas_y; + Evas_Coord canvas_x, canvas_y; struct { Evas_List *in; @@ -273,7 +288,7 @@ struct _Evas } pointer; struct { - double x, y, w, h; + Evas_Coord x, y, w, h; char changed : 1; } viewport; @@ -355,7 +370,7 @@ struct _Evas_Object } clip; } cache; struct { - double x, y, w, h; + Evas_Coord x, y, w, h; } geometry; struct { unsigned char r, g, b, a; @@ -440,8 +455,8 @@ struct _Evas_Object_Func int (*is_opaque) (Evas_Object *obj); int (*was_opaque) (Evas_Object *obj); - int (*is_inside) (Evas_Object *obj, double x, double y); - int (*was_inside) (Evas_Object *obj, double x, double y); + int (*is_inside) (Evas_Object *obj, Evas_Coord x, Evas_Coord y); + int (*was_inside) (Evas_Object *obj, Evas_Coord x, Evas_Coord y); void (*coords_recalc) (Evas_Object *obj); }; @@ -486,6 +501,7 @@ struct _Evas_Func void *(*gradient_color_add) (void *data, void *context, void *gradient, int r, int g, int b, int a, int distance); void *(*gradient_colors_clear) (void *data, void *context, void *gradient); + void (*gradient_draw) (void *data, void *context, void *surface, void *gradient, int x, int y, int w, int h, double angle); void *(*image_load) (void *data, char *file, char *key, int *error); @@ -591,8 +607,8 @@ void evas_object_inform_call_restack(Evas_Object *obj); void evas_object_intercept_cleanup(Evas_Object *obj); int evas_object_intercept_call_show(Evas_Object *obj); int evas_object_intercept_call_hide(Evas_Object *obj); -int evas_object_intercept_call_move(Evas_Object *obj, double x, double y); -int evas_object_intercept_call_resize(Evas_Object *obj, double w, double h); +int evas_object_intercept_call_move(Evas_Object *obj, Evas_Coord x, Evas_Coord y); +int evas_object_intercept_call_resize(Evas_Object *obj, Evas_Coord w, Evas_Coord h); int evas_object_intercept_call_raise(Evas_Object *obj); int evas_object_intercept_call_lower(Evas_Object *obj); int evas_object_intercept_call_stack_above(Evas_Object *obj, Evas_Object *above);