From c6e5ed3a1d1b82b5f7515c0dc2ef391ae8d10638 Mon Sep 17 00:00:00 2001 From: Carsten Haitzler Date: Wed, 27 Sep 2000 15:14:06 +0000 Subject: [PATCH] some basic start on documentation....what's happening to me? all this documentation? :) SVN revision: 3554 --- legacy/evas/Makefile.am | 2 +- legacy/evas/configure.in | 2 +- legacy/evas/doc/Makefile.am | 3 + legacy/evas/doc/index.html | 189 +++++++++++++++++++++++++++++++ legacy/evas/doc/logo.gif | Bin 0 -> 16998 bytes legacy/evas/src/Evas.h | 11 +- legacy/evas/src/Evas_private.h | 1 + legacy/evas/src/evas_callbacks.c | 4 + legacy/evas/src/evas_events.c | 19 ++-- legacy/evas/src/evas_gradient.c | 15 ++- legacy/evas/src/evas_image.c | 110 ++++++++++++------ legacy/evas/src/evas_line.c | 3 + legacy/evas/src/evas_misc.c | 57 +++++++++- legacy/evas/src/evas_object.c | 53 +++++++-- legacy/evas/src/evas_rectangle.c | 1 + legacy/evas/src/evas_render.c | 47 +++++--- legacy/evas/src/evas_text.c | 35 +++++- 17 files changed, 469 insertions(+), 83 deletions(-) create mode 100644 legacy/evas/doc/Makefile.am create mode 100644 legacy/evas/doc/index.html create mode 100644 legacy/evas/doc/logo.gif diff --git a/legacy/evas/Makefile.am b/legacy/evas/Makefile.am index 45fea275ca..e1738968cd 100644 --- a/legacy/evas/Makefile.am +++ b/legacy/evas/Makefile.am @@ -9,7 +9,7 @@ MAINTAINERCLEANFILES = INSTALL Makefile.in aclocal.m4 config.guess \ ltconfig ltmain.sh missing mkinstalldirs \ stamp-h.in -SUBDIRS = src test +SUBDIRS = src test doc bin_SCRIPTS = evas-config diff --git a/legacy/evas/configure.in b/legacy/evas/configure.in index bd47269312..0b51deb3d3 100644 --- a/legacy/evas/configure.in +++ b/legacy/evas/configure.in @@ -171,7 +171,7 @@ AC_SUBST(ttf_includes) AC_SUBST(ttf_libs) AC_OUTPUT([ -Makefile src/Makefile test/Makefile evas-config +Makefile src/Makefile test/Makefile evas-config doc/Makefile ], [ chmod +x evas-config ]) diff --git a/legacy/evas/doc/Makefile.am b/legacy/evas/doc/Makefile.am new file mode 100644 index 0000000000..2d1d64c3a5 --- /dev/null +++ b/legacy/evas/doc/Makefile.am @@ -0,0 +1,3 @@ +EXTRA_DIST = \ +index.html \ +loogo.gif diff --git a/legacy/evas/doc/index.html b/legacy/evas/doc/index.html new file mode 100644 index 0000000000..0a6ecf9c17 --- /dev/null +++ b/legacy/evas/doc/index.html @@ -0,0 +1,189 @@ + + +Evas - Documentation + + +
+ +Evas
+Documentation for programming using Evas
+By Carsten Haitzler
+Copyright (C) 2000
+
+ +
+ +

+Introduction +

+

+

+Evas is a canvas library, designed to work with the X Window System. It is +designed to be able to take advantage of any graphics hardwre or CPU +processing power you may have, or to adjust for the lack of it. It has a +simplistic API to access the features of a canvas to aid in making +development using Evas easy. +

+First it is necessary to explain what a canvas is and how in principle it +works. For those used to doing the drawing themselves, it is a new way of +looking at the problem of drawing displays that contain lots of information +an application may have to keep track of. This may be in the form of +primities (lines, circles, rectangles, polygons and text) or may be a +mixture of these and more complex objects such as gradients, images etc. An +application normally needs to hold all this data and when required, redraw +the data do a window or pixmap if the data changes, or the window contents +become damaged and need a redraw to restore them. To do this optimally the +application would also need to figure out what exactly canged, which parts +of the window or pixmap this data mapped to and then order the drawing so +all objects are drawn in the right order, and only the part of the window +that needs redrawing is drawn to to save excess processing. For a large +range of objects and data this become a fairly involved problem all on it's +own. Thus came the evolution of the canvas. +

+Some of the better known canvas systems around are the Tk Canvas and the +GNOME canvas. In principle a canvas works on an object level. Like windows +in X11, you create objects, move them, resize them show them, hide them, +change their properties etc. The canvas figures out what objects changed and +how only when it comes to it's draw cycle - not every time you do something. +This means moving, resizing and changing object properties is a very fast +and inexpensive operation since only attribute values change, rather than +any drawing being done, unlike when you move and resize windows in X11 which +happens instantly, not later. This means higher efficiency for the +application's rendering, as long ad evas render calls are only called when +the application has hit an idle state (nothing left in it's queue of things +to do for the moment). This also means object maintinence is now left up to +the canvas - the application only needs to keep a handle to that object +aroun so it can be uniquely identified. +

+The best way to use Evas is as follows (simplistic pseudo-code): +

+

+Initialise program
+...
+Create canvas
+Add objects to canvas (fill in with some content)
+...
+Infinite loop ...
+  while input events are pending ...
+    if event is for evas window then pass onto evas
+  ... (no more input events in queue awaiting processing)
+  modify, add or delete  objects in evas to reflect new state
+  call evas render function
+... continue program infinite loop
+
+

+In a naievely written program an event loop may have many re-renderins and +re-drawings going on as things are modified, otherwise the application needs +to retain state like evas does and ten handle draws in idle time too, which +means applications need to do the work Evas does themselves, as well as the +optimizations already in place in Evas. +

+The major advantages arise out of the fact that Evas does not only handle +the logic of such object management and rendering for you, and optimize it, +it also provides and abstraction layer that allows evas to render not just +solid objects, but temi-transparent objects and images that can be +alpha-blended, anti-aliased text and much more. It not only does these and +does them fast (using Imlib2 as the core rendering engine to do this), but +is able to instantly take advantage of hardware acceleration (for example +OpenGL) quietly for you to blend and scale images, speeding up rendering +many times over, without you having to know a single line of OpenGL. Evas's +Software rotuines alone are many many many times faster than Mesa's software +OpenGL rendering, as Imlib2's code is purpose written for 2D operations with +Assembly optimizations for the core routines. +

+

+

+API Reference +

+

+

+Basic Types +

+Here is a list of the basic types of objects Evas deals with and can +generate. It is small to keep things simple. +

+

+Evas
+Evas_Gradient
+Evas_Object
+Evas_List
+Evas_Callback_Type
+Evas_Image_Format
+Evas_Render_Method
+
+

+Evas: +

+This is the basic type of an Evas itself. When you create a new evas this +type will be returned (not a pointer to it - the Evas type itself. It is +intended to be completely opaque to the application and may change its nature +over time - it may be a void pointer now and tomorrow a hashe'd ID or +anything else). All functions dealing with Evas's and their contents will +require you use this handle to denote what Evas you are talking about. +

+Evas_Gradient: +

+This is the basic type use to build a gradient object from or modify its +colors. You need to create a new one of these before you can create any +useful gradient object. You add colors to the gradient, each one (after the +first color added) are added a certain ``distance'' from the previous color +which will determine relative distances between colors in the gradient. The +larger the distance number, the more of the total gradient length the +transition between the previous color and the one being added will take. +Once you hve filled the gradient with colors, create a gradient object, or +multiple gradient objects and set the gradient to those gradient objects. +When you are done and don't need that gradient anymore, simply free the +gradient. If you wish to change the colors or distances between them in a +gradient object simply build a new gradient, set it to the object then free +the gradient you created. +

+Evas_Object: +

+This is the fundamental building block that makes the contents of an Evas +have meaning. Without any objects in an Evas it will not draw anything, or +draw usless garbage where no objects exist. Whenever you create an object +you will get this type of handle back. If you wish to modify an object's +geoemtry, show, hide, change its properties or delete it you will need to +use this as the handle to addess it by. +

+Evas_List: +

+This is the only non-opaque data type. It is for conevenience of Evas, and +for the application to use to. This type is a doubly-linked list of data. +You may traverse the list using loops and using the next and prev members of +this structure. Do not modify these though as this could mean memory leaks +and losing parts of the list. If prev is NULL, you are at the start of the +list and if next is NULL you are at the end. The data member poitns to +whatever data was inserted at that place in the list. You may read this and +cast it to whatever makes sense in the situation. If Evas returns an +Evas_List of things the data member will be of the type specified by the +function. You may use Evas_List's yourself for anything you find them useful +for. +

+Evas_Callback_Type: +

+This is an enumerated type to specify what kind of event would trigger a +callback to be called when attaching a callback to an object. Legal values +for this are CALLBACK_MOUSE_IN (when the mouse enters the bounds of this +object), CALLBACK_MOUSE_OUT (when the mouse leaves the bounadry of this +object), CALLBACK_MOUSE_DOWN (when a mouse button is pressed in this object), +CALLBACK_MOUSE_UP (when a mouse button is raised in this object), +CALLBACK_MOUSE_MOVE (when the mouse mpoves around in this object) and +CALLBACK_FREE (when this object is actually freed so the application can +find free and data attached to the object if it needs to). +

+Evas_Image_Format: +

+

+Evas_Render_Method: +

+

+

+
+ + diff --git a/legacy/evas/doc/logo.gif b/legacy/evas/doc/logo.gif new file mode 100644 index 0000000000000000000000000000000000000000..2c177424b4e07c732ed0549ad037a02f6740f963 GIT binary patch literal 16998 zcmWiehd&hlAII;`-8s%UdviE@WIMAv^T^6Bl-=2TX56qtc2+vFvN}SPxU)k#C8<9%gg009n^{x6*1YfQsBYCtg5oWq=fXt!^zfo zGorJMySu7|1u7&i0j+Bkon2^*LRxZ(1qO!QUw+}KXB-w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VW}B^MPRLq#hl{O%Hos2@z1IkazwbQ4_<{(uaKVc$uDoO$Ta%GRySgDpuMW=rAej>*;(_$4njmfP zT9wsb{WfJ)#`ohLmxa^|8`4^R6luNFe-+Q4z1x)UjYwPk(i{5-7ly_+HrsE^IN8c? zu>H`xef`jn{4{;p$Njo{ectyyI61xgp*`X!zTz)F<2SzJKR)C~zT{6n6bpJ1Oxy(5LWAL literal 0 HcmV?d00001 diff --git a/legacy/evas/src/Evas.h b/legacy/evas/src/Evas.h index b7092c3bc1..d90b2be703 100644 --- a/legacy/evas/src/Evas.h +++ b/legacy/evas/src/Evas.h @@ -27,11 +27,11 @@ struct _Evas_List #define RENDER_METHOD_COUNT 5 enum _Evas_Render_Method { - RENDER_METHOD_ALPHA_SOFTWARE, - RENDER_METHOD_BASIC_HARDWARE, - RENDER_METHOD_3D_HARDWARE, - RENDER_METHOD_ALPHA_HARDWARE, - RENDER_METHOD_IMAGE + RENDER_METHOD_ALPHA_SOFTWARE, /* imlib2 rendering to any drawable */ + RENDER_METHOD_BASIC_HARDWARE, /* X11 pixmap rendering to any drawable */ + RENDER_METHOD_3D_HARDWARE, /* oepngl rendering to windows only */ + RENDER_METHOD_ALPHA_HARDWARE, /* unimplimented */ + RENDER_METHOD_IMAGE /* imlib2 rendering to imlib image target */ }; enum _Evas_Callback_Type @@ -188,7 +188,6 @@ double evas_text_get_inset(Evas e, Evas_Object o); /* object query ops */ void evas_get_color(Evas e, Evas_Object o, int *r, int *g, int *b, int *a); Evas_Object evas_get_object_under_mouse(Evas e); -Evas_Object evas_get_object_at_pos(Evas e, double x, double y); /* data attachment ops */ void evas_put_data(Evas e, Evas_Object o, char *key, void *data); diff --git a/legacy/evas/src/Evas_private.h b/legacy/evas/src/Evas_private.h index 38b15ac05e..b6f91168d7 100644 --- a/legacy/evas/src/Evas_private.h +++ b/legacy/evas/src/Evas_private.h @@ -83,6 +83,7 @@ struct _Evas_Color_Point struct _Evas_Gradient { Evas_List color_points; + int references; }; struct _Evas_Rectangle diff --git a/legacy/evas/src/evas_callbacks.c b/legacy/evas/src/evas_callbacks.c index a60fea68bb..7a17ee175c 100644 --- a/legacy/evas/src/evas_callbacks.c +++ b/legacy/evas/src/evas_callbacks.c @@ -35,6 +35,8 @@ evas_callback_add(Evas e, Evas_Object o, Evas_Callback_Type callback, void (*fun { Evas_Callback cb; + if (!e) return; + if (!o) return; cb = malloc(sizeof(struct _Evas_Callback)); cb->type = callback; cb->data = data; @@ -48,6 +50,8 @@ evas_callback_del(Evas e, Evas_Object o, Evas_Callback_Type callback) Evas_List l; int have_cb; + if (!e) return; + if (!o) return; have_cb = 1; while (have_cb) { diff --git a/legacy/evas/src/evas_events.c b/legacy/evas/src/evas_events.c index c25c9b2c9c..ac45a80684 100644 --- a/legacy/evas/src/evas_events.c +++ b/legacy/evas/src/evas_events.c @@ -9,7 +9,8 @@ int _evas_point_in_object(Evas e, Evas_Object o, int x, int y) { int ox, oy, ow, oh; - + + if (o->delete_me) return 0; _evas_object_get_current_translated_coords(e, o, &ox, &oy, &ow, &oh); if ((x >= ox) && (x < (ox + ow)) && (y >= oy) && (y < (oy + oh))) return 1; @@ -33,7 +34,7 @@ _evas_highest_object_at_point(Evas e, int x, int y) Evas_Object ob; ob = ll->data; - if ((ob->current.visible) && (!ob->pass_events)) + if ((ob->current.visible) && (!ob->pass_events) && (!ob->delete_me)) { if (_evas_point_in_object(e, ob, x, y)) o = ob; @@ -59,7 +60,7 @@ _evas_objects_at_point(Evas e, int x, int y) Evas_Object ob; ob = ll->data; - if ((ob->current.visible) && (!ob->pass_events)) + if ((ob->current.visible) && (!ob->pass_events) && (!ob->delete_me)) { if (_evas_point_in_object(e, ll->data, x, y)) objs = evas_list_prepend(objs, ll->data); @@ -75,6 +76,7 @@ evas_event_button_down(Evas e, int x, int y, int b) { Evas_Object o; + if (!e) return; if ((b < 1) || (b > 32)) return; if (!e->mouse.buttons) { @@ -94,6 +96,7 @@ evas_event_button_up(Evas e, int x, int y, int b) { Evas_Object o; + if (!e) return; if ((b < 1) || (b > 32)) return; e->mouse.buttons &= ~(1 << (b - 1)); e->mouse.x = x; @@ -115,6 +118,7 @@ evas_event_move(Evas e, int x, int y) { Evas_Object o; + if (!e) return; o = _evas_highest_object_at_point(e, e->mouse.x, e->mouse.y); if (o != e->mouse.object) { @@ -159,23 +163,20 @@ evas_event_move(Evas e, int x, int y) void evas_event_enter(Evas e) { + if (!e) return; e->mouse.in = 1; } void evas_event_leave(Evas e) { + if (!e) return; e->mouse.in = 0; } Evas_Object evas_get_object_under_mouse(Evas e) { + if (!e) return NULL; return _evas_highest_object_at_point(e, e->mouse.x, e->mouse.y); } - -Evas_Object -evas_get_object_at_pos(Evas e, double x, double y) -{ - return _evas_highest_object_at_point(e, x, y); -} diff --git a/legacy/evas/src/evas_gradient.c b/legacy/evas/src/evas_gradient.c index 076594d636..3d88eab11c 100644 --- a/legacy/evas/src/evas_gradient.c +++ b/legacy/evas/src/evas_gradient.c @@ -59,6 +59,7 @@ evas_add_gradient_box(Evas e) Evas_List l; Evas_Layer layer; + if (!e) return NULL; o = oo = malloc(sizeof(struct _Evas_Object_Gradient_Box)); memset(o, 0, sizeof(struct _Evas_Object_Gradient_Box)); o->type = OBJECT_GRADIENT_BOX; @@ -95,10 +96,13 @@ evas_set_gradient(Evas e, Evas_Object o, Evas_Gradient grad) { Evas_Object_Gradient_Box oo; + if (!e) return; + if (!o) return; + if (!grad) return; IF_OBJ(o, OBJECT_GRADIENT_BOX) return; oo = o; - if (oo->current.gradient) - evas_gradient_free(oo->current.gradient); + grad->references++; + if (oo->current.gradient) evas_gradient_free(oo->current.gradient); oo->current.gradient = grad; switch (e->current.render_method) { @@ -196,6 +200,7 @@ evas_gradient_new(void) gr = malloc(sizeof(struct _Evas_Gradient)); gr->color_points = NULL; + gr->references = 1; return gr; } @@ -204,6 +209,9 @@ evas_gradient_free(Evas_Gradient grad) { Evas_List l; + if (!grad) return; + grad->references--; + if (grad->references > 0) return; if (grad->color_points) { for (l = grad->color_points; l; l = l->next) @@ -218,6 +226,7 @@ evas_gradient_add_color(Evas_Gradient grad, int r, int g, int b, int a, int dist { Evas_Color_Point col; + if (!grad) return; col = malloc(sizeof(struct _Evas_Color_Point)); col->r = r; col->g = g; @@ -230,6 +239,8 @@ evas_gradient_add_color(Evas_Gradient grad, int r, int g, int b, int a, int dist void evas_set_angle(Evas e, Evas_Object o, double angle) { + if (!e) return; + if (!o) return; switch (o->type) { case OBJECT_GRADIENT_BOX: diff --git a/legacy/evas/src/evas_image.c b/legacy/evas/src/evas_image.c index b92a991eeb..d9f68c3299 100644 --- a/legacy/evas/src/evas_image.c +++ b/legacy/evas/src/evas_image.c @@ -44,24 +44,28 @@ evas_add_image_from_file(Evas e, char *file) Evas_Object_Any o; Evas_List l; Evas_Layer layer; - + + if (!e) return NULL; o = oo = malloc(sizeof(struct _Evas_Object_Image)); memset(o, 0, sizeof(struct _Evas_Object_Image)); o->type = OBJECT_IMAGE; o->object_free = _evas_free_image; o->object_renderer_data_free = _evas_free_image_renderer_data; - oo->current.file = strdup(file); + if (file) { - Imlib_Image im; - - im = imlib_load_image(file); - if (im) + oo->current.file = strdup(file); { - imlib_context_set_image(im); - oo->current.image.w = imlib_image_get_width(); - oo->current.image.h = imlib_image_get_height(); - imlib_free_image(); + Imlib_Image im; + + im = imlib_load_image(file); + if (im) + { + imlib_context_set_image(im); + oo->current.image.w = imlib_image_get_width(); + oo->current.image.h = imlib_image_get_height(); + imlib_free_image(); + } } } oo->current.fill.x = 0; @@ -108,44 +112,66 @@ evas_set_image_file(Evas e, Evas_Object o, char *file) { Evas_Object_Image oo; + if (!e) return; + if (!o) return; + IF_OBJ(o, OBJECT_IMAGE) return; oo = o; - if (oo->current.file) - free(oo->current.file); - oo->previous.file = NULL; - oo->current.file = strdup(file); + if ((oo->current.file) && (file) && (strcmp(file, oo->current.file))) { - Imlib_Image im; - - im = imlib_load_image(file); - if (im) + if (oo->current.file) + free(oo->current.file); + oo->previous.file = NULL; + oo->current.file = strdup(file); { - imlib_context_set_image(im); - oo->current.image.w = imlib_image_get_width(); - oo->current.image.h = imlib_image_get_height(); - imlib_free_image(); - evas_resize(e, o, - (double)oo->current.image.w, - (double)oo->current.image.h); - oo->current.fill.x = 0; - oo->current.fill.y = 0; - oo->current.fill.w = (double)oo->current.image.w; - oo->current.fill.h = (double)oo->current.image.h; + Imlib_Image im; + + im = imlib_load_image(file); + if (im) + { + imlib_context_set_image(im); + oo->current.image.w = imlib_image_get_width(); + oo->current.image.h = imlib_image_get_height(); + imlib_free_image(); + evas_resize(e, o, + (double)oo->current.image.w, + (double)oo->current.image.h); + oo->current.fill.x = 0; + oo->current.fill.y = 0; + oo->current.fill.w = (double)oo->current.image.w; + oo->current.fill.h = (double)oo->current.image.h; + } + else + { + oo->current.image.w = 0; + oo->current.image.h = 0; + evas_resize(e, o, + (double)oo->current.image.w, + (double)oo->current.image.h); + oo->current.fill.x = 0; + oo->current.fill.y = 0; + oo->current.fill.w = (double)oo->current.image.w; + oo->current.fill.h = (double)oo->current.image.h; + } + } + o->changed = 1; + e->changed = 1; + } + else + { + if (!file) + { + oo->current.file = NULL; + o->changed = 1; + e->changed = 1; } else { - oo->current.image.w = 0; - oo->current.image.h = 0; - evas_resize(e, o, - (double)oo->current.image.w, - (double)oo->current.image.h); oo->current.fill.x = 0; oo->current.fill.y = 0; oo->current.fill.w = (double)oo->current.image.w; oo->current.fill.h = (double)oo->current.image.h; } } - o->changed = 1; - e->changed = 1; } void @@ -159,6 +185,8 @@ evas_set_image_fill(Evas e, Evas_Object o, double x, double y, double w, double { Evas_Object_Image oo; + if (!e) return; + if (!o) return; IF_OBJ(o, OBJECT_IMAGE) return; oo = o; oo->current.fill.x = x; @@ -175,6 +203,8 @@ evas_get_image_size(Evas e, Evas_Object o, int *w, int *h) { Evas_Object_Image oo; + if (!e) return; + if (!o) return; IF_OBJ(o, OBJECT_IMAGE) return; oo = o; if (w) *w = oo->current.image.w; @@ -186,8 +216,14 @@ evas_set_image_border(Evas e, Evas_Object o, int l, int r, int t, int b) { Evas_Object_Image oo; + if (!e) return; + if (!o) return; IF_OBJ(o, OBJECT_IMAGE) return; oo = o; + if (l < 0) l = 0; + if (r < 0) r = 0; + if (t < 0) t = 0; + if (b < 0) b = 0; oo->current.border.l = l; oo->current.border.r = r; oo->current.border.t = t; @@ -201,6 +237,8 @@ evas_get_image_border(Evas e, Evas_Object o, int *l, int *r, int *t, int *b) { Evas_Object_Image oo; + if (!e) return; + if (!o) return; IF_OBJ(o, OBJECT_IMAGE) return; oo = o; if (l) *l = oo->current.border.l; diff --git a/legacy/evas/src/evas_line.c b/legacy/evas/src/evas_line.c index c458b6d8a0..6ae47337cc 100644 --- a/legacy/evas/src/evas_line.c +++ b/legacy/evas/src/evas_line.c @@ -43,6 +43,7 @@ evas_add_line(Evas e) Evas_List l; Evas_Layer layer; + if (!e) return NULL; o = oo = malloc(sizeof(struct _Evas_Object_Line)); memset(o, 0, sizeof(struct _Evas_Object_Line)); o->type = OBJECT_LINE; @@ -83,6 +84,8 @@ evas_set_line_xy(Evas e, Evas_Object o, double x1, double y1, double x2, double Evas_Object_Line oo; int event_update = 0; + if (!e) return; + if (!o) return; IF_OBJ(o, OBJECT_LINE) return; oo = (Evas_Object_Line)o; if ((o->current.visible) && diff --git a/legacy/evas/src/evas_misc.c b/legacy/evas/src/evas_misc.c index 15eb7543fb..4519b04d1f 100644 --- a/legacy/evas/src/evas_misc.c +++ b/legacy/evas/src/evas_misc.c @@ -54,42 +54,49 @@ evas_new_all(Display *display, Window parent_window, Window evas_get_window(Evas e) { + if (!e) return 0; return e->current.drawable; } Display * evas_get_display(Evas e) { + if (!e) return NULL; return e->current.display; } Visual * evas_get_visual(Evas e) { + if (!e) return NULL; return e->current.visual; } Colormap evas_get_colormap(Evas e) { + if (!e) return 0; return e->current.colormap; } int evas_get_colors(Evas e) { + if (!e) return 0; return e->current.colors; } Imlib_Image evas_get_image(Evas e) { + if (!e) return NULL; return e->current.image; } Evas_Render_Method evas_get_render_method(Evas e) { + if (!e) return RENDER_METHOD_ALPHA_SOFTWARE; return e->current.render_method; } @@ -105,7 +112,7 @@ evas_new(void) e->current.viewport.w = 0.0; e->current.viewport.h = 0.0; e->current.render_method = RENDER_METHOD_ALPHA_SOFTWARE; - e->current.colors = 128; + e->current.colors = 216; return e; } @@ -114,6 +121,7 @@ evas_free(Evas e) { Evas_List l; + if (!e) return; if (e->current.created_window) XDestroyWindow(e->current.display, e->current.drawable); for (l = e->layers; l; l = l->next) @@ -131,6 +139,16 @@ evas_free(Evas e) void evas_set_color(Evas e, Evas_Object o, int r, int g, int b, int a) { + if (!e) return; + if (!o) return; + if (r < 0) r = 0; + else if (r > 255) r = 255; + if (g < 0) g = 0; + else if (g > 255) g = 255; + if (b < 0) b = 0; + else if (b > 255) b = 255; + if (a < 0) a = 0; + else if (a > 255) a = 255; switch (o->type) { case OBJECT_IMAGE: @@ -193,8 +211,21 @@ evas_set_color(Evas e, Evas_Object o, int r, int g, int b, int a) void evas_get_color(Evas e, Evas_Object o, int *r, int *g, int *b, int *a) { + if (!e) return; + if (!o) return; switch (o->type) { + case OBJECT_IMAGE: + { + Evas_Object_Image oo; + + oo = (Evas_Object_Image)o; + if (r) *r = oo->current.color.r; + if (g) *g = oo->current.color.g; + if (b) *b = oo->current.color.b; + if (a) *a = oo->current.color.a; + } + break; case OBJECT_TEXT: { Evas_Object_Text oo; @@ -236,6 +267,8 @@ evas_get_color(Evas e, Evas_Object o, int *r, int *g, int *b, int *a) void evas_set_zoom_scale(Evas e, Evas_Object o, int scale) { + if (!e) return; + if (!o) return; o->current.zoomscale = scale; o->changed = 1; e->changed = 1; @@ -244,12 +277,15 @@ evas_set_zoom_scale(Evas e, Evas_Object o, int scale) void evas_set_pass_events(Evas e, Evas_Object o, int pass_events) { + if (!e) return; + if (!o) return; o->pass_events = 1; } void evas_set_font_cache(Evas e, int size) { + if (!e) return; switch (e->current.render_method) { case RENDER_METHOD_ALPHA_SOFTWARE: @@ -275,6 +311,7 @@ evas_set_font_cache(Evas e, int size) int evas_get_font_cache(Evas e) { + if (!e) return 0; switch (e->current.render_method) { case RENDER_METHOD_ALPHA_SOFTWARE: @@ -301,6 +338,7 @@ evas_get_font_cache(Evas e) void evas_flush_font_cache(Evas e) { + if (!e) return; switch (e->current.render_method) { case RENDER_METHOD_ALPHA_SOFTWARE: @@ -326,6 +364,7 @@ evas_flush_font_cache(Evas e) void evas_set_image_cache(Evas e, int size) { + if (!e) return; switch (e->current.render_method) { case RENDER_METHOD_ALPHA_SOFTWARE: @@ -351,6 +390,7 @@ evas_set_image_cache(Evas e, int size) int evas_get_image_cache(Evas e) { + if (!e) return 0; switch (e->current.render_method) { case RENDER_METHOD_ALPHA_SOFTWARE: @@ -377,6 +417,7 @@ evas_get_image_cache(Evas e) void evas_flush_image_cache(Evas e) { + if (!e) return; switch (e->current.render_method) { case RENDER_METHOD_ALPHA_SOFTWARE: @@ -402,6 +443,8 @@ evas_flush_image_cache(Evas e) void evas_font_add_path(Evas e, char *path) { + if (!e) return; + if (!path) return; evas_font_del_path(e, path); switch (e->current.render_method) { @@ -428,6 +471,8 @@ evas_font_add_path(Evas e, char *path) void evas_font_del_path(Evas e, char *path) { + if (!e) return; + if (!path) return; switch (e->current.render_method) { case RENDER_METHOD_ALPHA_SOFTWARE: @@ -456,6 +501,8 @@ evas_put_data(Evas e, Evas_Object o, char *key, void *data) Evas_Data d; Evas_List l; + if (!e) return; + if (!o) return; if (!key) return; for (l = o->data; l; l = l->next) { @@ -479,6 +526,8 @@ evas_get_data(Evas e, Evas_Object o, char *key) { Evas_List l; + if (!e) return NULL; + if (!o) return NULL; if (!key) return NULL; for (l = o->data; l; l = l->next) { @@ -495,6 +544,8 @@ evas_remove_data(Evas e, Evas_Object o, char *key) { Evas_List l; + if (!e) return NULL; + if (!o) return NULL; if (!key) return NULL; for (l = o->data; l; l = l->next) { @@ -518,6 +569,7 @@ evas_remove_data(Evas e, Evas_Object o, char *key) int evas_world_x_to_screen(Evas e, double x) { + if (!e) return 0; return (int)((x - e->current.viewport.x) * ((double)e->current.drawable_width / e->current.viewport.w)); } @@ -525,6 +577,7 @@ evas_world_x_to_screen(Evas e, double x) int evas_world_y_to_screen(Evas e, double y) { + if (!e) return 0; return (int)((y - e->current.viewport.y) * ((double)e->current.drawable_height / e->current.viewport.h)); } @@ -532,6 +585,7 @@ evas_world_y_to_screen(Evas e, double y) double evas_screen_x_to_world(Evas e, int x) { + if (!e) return 0; return (double)((double)x * (e->current.viewport.w / (double)e->current.drawable_width)); + e->current.viewport.x; } @@ -539,6 +593,7 @@ evas_screen_x_to_world(Evas e, int x) double evas_screen_y_to_world(Evas e, int y) { + if (!e) return 0; return (double)((double)y * (e->current.viewport.h / (double)e->current.drawable_height)); + e->current.viewport.y; } diff --git a/legacy/evas/src/evas_object.c b/legacy/evas/src/evas_object.c index 438363dc5f..36217c7340 100644 --- a/legacy/evas/src/evas_object.c +++ b/legacy/evas/src/evas_object.c @@ -114,6 +114,8 @@ _evas_layer_free(Evas e, Evas_Layer layer) void evas_del_object(Evas e, Evas_Object o) { + if (!e) return; + if (!o) return; o->delete_me = 1; evas_hide(e, o); } @@ -126,6 +128,8 @@ evas_set_layer(Evas e, Evas_Object o, int layer_num) Evas_List l; int removed; + if (!e) return; + if (!o) return; if (layer_num == o->current.layer) return; removed = 0; for (l = e->layers; l; l = l->next) @@ -184,6 +188,7 @@ evas_set_layer(Evas e, Evas_Object o, int layer_num) void evas_set_layer_store(Evas e, int l, int store) { + if (!e) return; /* FIXME: find layer and set store flag */ /* e->changed = 1; */ } @@ -194,6 +199,9 @@ evas_objects_in_rect(Evas e, double x, double y, double w, double h) Evas_List l, ll, objs; Evas_Layer layer; + if (!e) return NULL; + if (w < 0) w = 0; + if (h < 0) h = 0; objs = NULL; for (l = e->layers; l ; l = l->next) { @@ -204,7 +212,7 @@ evas_objects_in_rect(Evas e, double x, double y, double w, double h) Evas_Object ob; ob = ll->data; - if ((ob->current.visible) && (!ob->pass_events)) + if ((ob->current.visible) && (!ob->pass_events) && (!ob->delete_me)) { if (RECTS_INTERSECT(x, y, w, h, ob->current.x, ob->current.y, @@ -222,6 +230,7 @@ evas_objects_at_position(Evas e, double x, double y) Evas_List l, ll, objs; Evas_Layer layer; + if (!e) return NULL; objs = NULL; for (l = e->layers; l ; l = l->next) { @@ -232,7 +241,7 @@ evas_objects_at_position(Evas e, double x, double y) Evas_Object ob; ob = ll->data; - if ((ob->current.visible) && (!ob->pass_events)) + if ((ob->current.visible) && (!ob->pass_events) && (!ob->delete_me)) { if (RECTS_INTERSECT(x, y, 1, 1, ob->current.x, ob->current.y, @@ -251,6 +260,7 @@ evas_object_in_rect(Evas e, double x, double y, double w, double h) Evas_Layer layer; Evas_Object o; + if (!e) return NULL; o = NULL; for (l = e->layers; l ; l = l->next) { @@ -261,7 +271,7 @@ evas_object_in_rect(Evas e, double x, double y, double w, double h) Evas_Object ob; ob = ll->data; - if ((ob->current.visible) && (!ob->pass_events)) + if ((ob->current.visible) && (!ob->pass_events) && (!ob->delete_me)) { if (RECTS_INTERSECT(x, y, w, h, ob->current.x, ob->current.y, @@ -280,6 +290,7 @@ evas_object_at_position(Evas e, double x, double y) Evas_Layer layer; Evas_Object o; + if (!e) return NULL; o = NULL; for (l = e->layers; l ; l = l->next) { @@ -290,7 +301,7 @@ evas_object_at_position(Evas e, double x, double y) Evas_Object ob; ob = ll->data; - if ((ob->current.visible) && (!ob->pass_events)) + if ((ob->current.visible) && (!ob->pass_events) && (!ob->delete_me)) { if (RECTS_INTERSECT(x, y, 1, 1, ob->current.x, ob->current.y, @@ -308,6 +319,8 @@ evas_raise(Evas e, Evas_Object o) { Evas_Layer layer; + if (!e) return; + if (!o) return; layer = _evas_get_object_layer(e, o); if (layer) { @@ -327,6 +340,8 @@ evas_lower(Evas e, Evas_Object o) { Evas_Layer layer; + if (!e) return; + if (!o) return; layer = _evas_get_object_layer(e, o); if (layer) { @@ -346,6 +361,8 @@ evas_stack_above(Evas e, Evas_Object o, Evas_Object above) { Evas_Layer layer; + if (!e) return; + if (!o) return; layer = _evas_get_object_layer(e, o); if (layer) { @@ -361,16 +378,18 @@ evas_stack_above(Evas e, Evas_Object o, Evas_Object above) } void -evas_stack_below(Evas e, Evas_Object o, Evas_Object above) +evas_stack_below(Evas e, Evas_Object o, Evas_Object below) { Evas_Layer layer; + if (!e) return; + if (!o) return; layer = _evas_get_object_layer(e, o); if (layer) { o->current.stacking = 1; layer->objects = evas_list_remove(layer->objects, o); - layer->objects = evas_list_prepend_relative(layer->objects, o, above); + layer->objects = evas_list_prepend_relative(layer->objects, o, below); o->changed = 1; e->changed = 1; if ((o->current.visible) && @@ -385,6 +404,8 @@ evas_move(Evas e, Evas_Object o, double x, double y) { int event_update = 0; + if (!e) return; + if (!o) return; if ((o->type == OBJECT_LINE)) return; if ((o->current.visible) && (_evas_point_in_object(e, o, e->mouse.x, e->mouse.y))) @@ -404,11 +425,15 @@ evas_resize(Evas e, Evas_Object o, double w, double h) { int event_update = 0; + if (!e) return; + if (!o) return; if ((o->type == OBJECT_LINE)) return; if ((o->type == OBJECT_TEXT)) return; if ((o->current.visible) && (_evas_point_in_object(e, o, e->mouse.x, e->mouse.y))) event_update = 1; + if (w < 0) w = 0; + if (h < 0) h = 0; o->current.w = w; o->current.h = h; o->changed = 1; @@ -422,6 +447,8 @@ evas_resize(Evas e, Evas_Object o, double w, double h) void evas_get_geometry(Evas e, Evas_Object o, double *x, double *y, double *w, double *h) { + if (!e) return; + if (!o) return; if (x) *x = o->current.x; if (y) *y = o->current.y; if (w) *w = o->current.w; @@ -433,6 +460,8 @@ evas_get_geometry(Evas e, Evas_Object o, double *x, double *y, double *w, double void evas_show(Evas e, Evas_Object o) { + if (!e) return; + if (!o) return; o->current.visible = 1; o->changed = 1; e->changed = 1; @@ -443,9 +472,12 @@ evas_show(Evas e, Evas_Object o) void evas_hide(Evas e, Evas_Object o) { + if (!e) return; + if (!o) return; o->current.visible = 0; o->changed = 1; e->changed = 1; + if (e->mouse.button_object == o) e->mouse.button_object = NULL; if (_evas_point_in_object(e, o, e->mouse.x, e->mouse.y)) evas_event_move(e, e->mouse.x, e->mouse.y); } @@ -466,7 +498,10 @@ evas_object_get_named(Evas e, char *name) for (ll = layer->objects; ll; ll = ll->next) { o = ll->data; - if ((o->name) && (!strcmp(name, o->name))) return o; + if (!o->delete_me) + { + if ((o->name) && (!strcmp(name, o->name))) return o; + } } } return NULL; @@ -475,6 +510,8 @@ evas_object_get_named(Evas e, char *name) void evas_object_set_name(Evas e, Evas_Object o, char *name) { + if (!e) return; + if (!o) return; if (o->name) free(o->name); o->name = NULL; if (name) @@ -484,5 +521,7 @@ evas_object_set_name(Evas e, Evas_Object o, char *name) char * evas_object_get_name(Evas e, Evas_Object o) { + if (!e) return NULL; + if (!o) return NULL; return o->name; } diff --git a/legacy/evas/src/evas_rectangle.c b/legacy/evas/src/evas_rectangle.c index 8d433337e0..4bc074ca4d 100644 --- a/legacy/evas/src/evas_rectangle.c +++ b/legacy/evas/src/evas_rectangle.c @@ -43,6 +43,7 @@ evas_add_rectangle(Evas e) Evas_List l; Evas_Layer layer; + if (!e) return NULL; o = oo = malloc(sizeof(struct _Evas_Object_Rectangle)); memset(o, 0, sizeof(struct _Evas_Object_Rectangle)); o->type = OBJECT_RECTANGLE; diff --git a/legacy/evas/src/evas_render.c b/legacy/evas/src/evas_render.c index c4fa591cb8..48b755661d 100644 --- a/legacy/evas/src/evas_render.c +++ b/legacy/evas/src/evas_render.c @@ -53,28 +53,13 @@ _evas_object_get_previous_translated_coords(Evas e, Evas_Object o, void evas_update_rect(Evas e, int x, int y, int w, int h) { + if (!e) return; + if (w <= 0) return; + if (h <= 0) return; e->updates = imlib_update_append_rect(e->updates, x, y, w, h); e->changed = 1; } -#if 0 -switch (e->current.render_method) -{ -case RENDER_METHOD_ALPHA_SOFTWARE: - break; -case RENDER_METHOD_BASIC_HARDWARE: - break; -case RENDER_METHOD_3D_HARDWARE: - break; -case RENDER_METHOD_ALPHA_HARDWARE: - break; -case RENDER_METHOD_IMAGE: - break; -default: - break; -} -#endif - /* drawing */ void evas_render(Evas e) @@ -98,6 +83,7 @@ evas_render(Evas e) void (*func_line_draw) (Display *disp, Imlib_Image dstim, Window win, int win_w, int win_h, int x1, int y1, int x2, int y2, int r, int g, int b, int a); void (*func_gradient_draw) (void *gr, Display *disp, Imlib_Image dstim, Window win, int win_w, int win_h, int x, int y, int w, int h, double angle); + if (!e) return; if ((!e->changed) || (!e->current.display) || (!e->current.drawable) || @@ -652,6 +638,8 @@ evas_render(Evas e) Visual * evas_get_optimal_visual(Evas e, Display *disp) { + if (!e) return NULL; + if (!disp) return NULL; switch (e->current.render_method) { case RENDER_METHOD_ALPHA_SOFTWARE: @@ -696,6 +684,8 @@ evas_get_optimal_visual(Evas e, Display *disp) Colormap evas_get_optimal_colormap(Evas e, Display *disp) { + if (!e) return 0; + if (!disp) return 0; switch (e->current.render_method) { case RENDER_METHOD_ALPHA_SOFTWARE: @@ -740,6 +730,7 @@ evas_get_optimal_colormap(Evas e, Display *disp) void evas_get_drawable_size(Evas e, int *w, int *h) { + if (!e) return; if (w) *w = e->current.drawable_width; if (h) *h = e->current.drawable_height; } @@ -747,6 +738,7 @@ evas_get_drawable_size(Evas e, int *w, int *h) void evas_get_viewport(Evas e, double *x, double *y, double *w, double *h) { + if (!e) return; if (x) *x = e->current.viewport.x; if (y) *y = e->current.viewport.y; if (w) *w = e->current.viewport.w; @@ -757,6 +749,7 @@ evas_get_viewport(Evas e, double *x, double *y, double *w, double *h) void evas_set_output(Evas e, Display *disp, Drawable d, Visual *v, Colormap c) { + if (!e) return; e->current.display = disp; e->current.drawable = d; e->current.visual = v; @@ -767,6 +760,7 @@ evas_set_output(Evas e, Display *disp, Drawable d, Visual *v, Colormap c) void evas_set_output_image(Evas e, Imlib_Image image) { + if (!e) return; e->current.image = image; e->changed = 1; } @@ -774,6 +768,9 @@ evas_set_output_image(Evas e, Imlib_Image image) void evas_set_output_colors(Evas e, int colors) { + if (!e) return; + if (colors < 2) colors = 1; + else if (colors > 256) colors = 256; e->current.colors = colors; e->changed = 1; } @@ -781,6 +778,9 @@ evas_set_output_colors(Evas e, int colors) void evas_set_output_size(Evas e, int w, int h) { + if (!e) return; + if (w < 1) w = 1; + if (h < 1) h = 1; e->current.drawable_width = w; e->current.drawable_height = h; e->changed = 1; @@ -789,6 +789,7 @@ evas_set_output_size(Evas e, int w, int h) void evas_set_output_viewport(Evas e, double x, double y, double w, double h) { + if (!e) return; e->current.viewport.x = x; e->current.viewport.y = y; e->current.viewport.w = w; @@ -799,6 +800,13 @@ evas_set_output_viewport(Evas e, double x, double y, double w, double h) void evas_set_output_method(Evas e, Evas_Render_Method method) { + if (!e) return; + if ((method != RENDER_METHOD_ALPHA_SOFTWARE) && + (method != RENDER_METHOD_BASIC_HARDWARE) && + (method != RENDER_METHOD_3D_HARDWARE) && + (method != RENDER_METHOD_ALPHA_HARDWARE) && + (method != RENDER_METHOD_IMAGE)) + return; if (!e->current.display) { e->current.render_method = method; @@ -809,6 +817,9 @@ evas_set_output_method(Evas e, Evas_Render_Method method) void evas_set_scale_smoothness(Evas e, int smooth) { + if (!e) return; + if (smooth <= 0) smooth = 0; + else smooth = 1; switch (e->current.render_method) { case RENDER_METHOD_ALPHA_SOFTWARE: diff --git a/legacy/evas/src/evas_text.c b/legacy/evas/src/evas_text.c index 0535a3b28e..ed3d360ee3 100644 --- a/legacy/evas/src/evas_text.c +++ b/legacy/evas/src/evas_text.c @@ -48,6 +48,7 @@ evas_add_text(Evas e, char *font, int size, char *text) Evas_List l; Evas_Layer layer; + if (!e) return NULL; o = oo = malloc(sizeof(struct _Evas_Object_Text)); memset(o, 0, sizeof(struct _Evas_Object_Text)); o->type = OBJECT_TEXT; @@ -160,6 +161,8 @@ evas_get_text_string(Evas e, Evas_Object o) { Evas_Object_Text oo; + if (!e) return NULL; + if (!o) return NULL; IF_OBJ(o, OBJECT_TEXT) return ""; oo = o; return oo->current.text; @@ -170,6 +173,8 @@ evas_get_text_font(Evas e, Evas_Object o) { Evas_Object_Text oo; + if (!e) return NULL; + if (!o) return NULL; IF_OBJ(o, OBJECT_TEXT) return ""; oo = o; return oo->current.font; @@ -180,6 +185,8 @@ evas_get_text_size(Evas e, Evas_Object o) { Evas_Object_Text oo; + if (!e) return 0; + if (!o) return 0; IF_OBJ(o, OBJECT_TEXT) return 0; oo = o; return oo->current.size; @@ -191,6 +198,8 @@ evas_text_at_position(Evas e, Evas_Object o, double x, double y, { Evas_Object_Text oo; + if (!e) return -1; + if (!o) return -1; IF_OBJ(o, OBJECT_TEXT) return -1; oo = o; switch (e->current.render_method) @@ -281,6 +290,8 @@ evas_text_at(Evas e, Evas_Object o, int index, { Evas_Object_Text oo; + if (!e) return; + if (!o) return; IF_OBJ(o, OBJECT_TEXT) return; oo = o; switch (e->current.render_method) @@ -359,6 +370,8 @@ evas_text_get_ascent_descent(Evas e, Evas_Object o, int a, d; Evas_Object_Text oo; + if (!e) return; + if (!o) return; IF_OBJ(o, OBJECT_TEXT) return; oo = o; a = 0; d = 0; @@ -432,6 +445,8 @@ evas_text_get_max_ascent_descent(Evas e, Evas_Object o, int a, d; Evas_Object_Text oo; + if (!e) return; + if (!o) return; IF_OBJ(o, OBJECT_TEXT) return; oo = o; a = 0; d = 0; @@ -505,6 +520,8 @@ evas_text_get_advance(Evas e, Evas_Object o, int a, d; Evas_Object_Text oo; + if (!e) return; + if (!o) return; IF_OBJ(o, OBJECT_TEXT) return; oo = o; a = 0; d = 0; @@ -573,7 +590,9 @@ evas_text_get_inset(Evas e, Evas_Object o) Evas_Object_Text oo; int inset; - IF_OBJ(o, OBJECT_TEXT) return 0.0; + if (!e) return 0; + if (!o) return 0; + IF_OBJ(o, OBJECT_TEXT) return 0; oo = o; switch (e->current.render_method) { @@ -640,6 +659,8 @@ evas_text_get_inset(Evas e, Evas_Object o) void evas_set_text(Evas e, Evas_Object o, char *text) { + if (!e) return; + if (!o) return; switch (o->type) { case OBJECT_TEXT: @@ -647,8 +668,12 @@ evas_set_text(Evas e, Evas_Object o, char *text) Evas_Object_Text oo; oo = (Evas_Object_Text)o; + if ((text) && (oo->current.text) && (!strcmp(oo->current.text, text))) + return; if (oo->current.text) free(oo->current.text); - oo->current.text = strdup(text); + oo->current.text = NULL; + if (text) + oo->current.text = strdup(text); oo->previous.text = NULL; { switch (e->current.render_method) @@ -749,6 +774,10 @@ evas_set_text(Evas e, Evas_Object o, char *text) void evas_set_font(Evas e, Evas_Object o, char *font, int size) { + if (!e) return; + if (!o) return; + if (!font) return; + if (size < 0) size = 0; switch (o->type) { case OBJECT_TEXT: @@ -756,6 +785,8 @@ evas_set_font(Evas e, Evas_Object o, char *font, int size) Evas_Object_Text oo; oo = (Evas_Object_Text)o; + if ((oo->current.font) && (!strcmp(oo->current.font, font))) + return; if (oo->current.font) free(oo->current.font); oo->current.font = strdup(font); oo->previous.font = NULL;