From da571e5aac0734636bfe35e3a2767fbab2204f54 Mon Sep 17 00:00:00 2001 From: Carsten Haitzler Date: Mon, 14 Aug 2000 21:49:03 +0000 Subject: [PATCH] better gl lib/header checkign in configure SVN revision: 3121 --- legacy/evas/configure.in | 60 ++++++++++++++++++----------------- legacy/evas/src/Evas.h | 6 ++++ legacy/evas/src/evas_events.c | 59 ++++++++++++++++++++++++++++++++++ 3 files changed, 96 insertions(+), 29 deletions(-) diff --git a/legacy/evas/configure.in b/legacy/evas/configure.in index 2c536055c7..98f432cdcf 100644 --- a/legacy/evas/configure.in +++ b/legacy/evas/configure.in @@ -106,37 +106,39 @@ fi gl_includes="" #### Find out about OpenGL -AC_CHECK_HEADER(GL/gl.h, -gl_includes="-I/usr/include -I/usr/local/include" -AC_CHECK_LIB(GL, glBindTexture, AC_DEFINE(HAVE_GL) ,[ -AC_CHECK_HEADER($x_includes"/GL/gl.h", -gl_includes="-I/usr/include -I/usr/local/include -I/usr/X11R6/include/" -AC_CHECK_LIB(GL, glBindTexture, AC_DEFINE(HAVE_GL) ,[ -echo "WARNING:......." -echo "no OpenGL libraries / headers found. This means no GL support will be" -echo "built into Evas. This means much slower rendering perfromance." -echo "Please read the config.log file for more information as to why this library" -echo "was not found." +PREV_CPPFLAGS=$CPPFLAGS +CPPFLAGS=$CPPFLAGS" -I/usr/include -I/usr/local/include "$x_cflags +AC_TRY_CPP(GL/gl.h, +echo "checking for GL/gl.h... yes" +gl_includes="-I/usr/include -I/usr/local/include "$x_cflags +AC_CHECK_LIB(GL, glBindTexture, have_gl=yes,[ ], -L/usr/local/lib -lGL $X_LDFLAGS $X_EXTRA_LIBS $X_LIBS) ) -], -L/usr/local/lib -lGL $X_LDFLAGS $X_EXTRA_LIBS $X_LIBS) -) -#### Find out about OpenGL's GLU -AC_CHECK_HEADER(GL/glu.h, -gl_includes=$gl_includes" -I/usr/include -I/usr/local/include" -AC_CHECK_LIB(GLU, gluBuild2DMipmaps, AC_DEFINE(HAVE_GLU) ,[ -AC_CHECK_HEADER($x_includes"/GL/glu.h", -gl_includes=$gl_includes" -I/usr/include -I/usr/local/include -I/usr/X11R6/include/" -AC_CHECK_LIB(GLU, gluBuild2DMipmaps, AC_DEFINE(HAVE_GLU) ,[ -echo "WARNING:......." -echo "no libGLU was found. This means filtered (anti-aliased) scaling down" -echo "of images will be disabled." -echo "Please read the config.log file for more information as to why this library" -echo "was not found." -], -L/usr/local/lib -lGL -lGLU $X_LDFLAGS $X_EXTRA_LIBS $X_LIBS) -) -], -L/usr/local/lib -lGL -lGLU $X_LDFLAGS $X_EXTRA_LIBS $X_LIBS) -) +if test "x$have_gl" = "xyes"; then + AC_DEFINE(HAVE_GL) + AC_TRY_CPP(GL/glu.h, + echo "checking for GL/glu.h... yes" + gl_includes="-I/usr/include -I/usr/local/include "$x_cflags + AC_CHECK_LIB(GLU, gluBuild2DMipmaps, have_glu=yes,[ + ], -L/usr/local/lib -lGL -lGLU $X_LDFLAGS $X_EXTRA_LIBS $X_LIBS) + ) + if test "x$have_glu" = "xyes"; then + AC_DEFINE(HAVE_GLU) + else + echo "WARNING:......." + echo "no libGLU was found. This means filtered (anti-aliased) scaling down" + echo "of images will be disabled." + echo "Please read the config.log file for more information as to why this library" + echo "was not found." + fi +else + echo "WARNING:......." + echo "no OpenGL libraries / headers found. This means no GL support will be" + echo "built into Evas. This means much slower rendering perfromance." + echo "Please read the config.log file for more information as to why this library" + echo "was not found." +fi +CPPFLAGS=$PREV_CPPFLAGS AC_SUBST(gl_includes) diff --git a/legacy/evas/src/Evas.h b/legacy/evas/src/Evas.h index 554450cfb2..018a78e96a 100644 --- a/legacy/evas/src/Evas.h +++ b/legacy/evas/src/Evas.h @@ -71,6 +71,12 @@ struct _Evas } current, previous; + struct { + int in; + int x, y; + int buttons; + } mouse; + void (*evas_renderer_data_free) (Evas _e); int changed; diff --git a/legacy/evas/src/evas_events.c b/legacy/evas/src/evas_events.c index a86772b888..cebc02c8c0 100644 --- a/legacy/evas/src/evas_events.c +++ b/legacy/evas/src/evas_events.c @@ -4,28 +4,87 @@ #include #include +int +_evas_point_in_object(Evas e, Evas_Object o, int x, int y) +{ + int ox, oy, ow, oh; + + _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; + return 0; +} + +Evas_Object +_evas_highest_object_at_point(Evas e, int x, int y) +{ + Evas_List l, ll; + Evas_Layer layer; + Evas_Object o; + + o = NULL; + for (l = e->layers; l ; l = l->next) + { + layer = l->data; + + for (ll = layer->objects; ll; ll = ll->next) + { + if (_evas_point_in_object(e, ll->data, x, y)) o = ll->data; + } + } + return o; +} + +Evas_List +_evas_objects_at_point(Evas e, int x, int y) +{ + Evas_List l, ll, objs; + Evas_Layer layer; + + objs = NULL; + for (l = e->layers; l ; l = l->next) + { + layer = l->data; + + for (ll = layer->objects; ll; ll = ll->next) + { + if (_evas_point_in_object(e, ll->data, x, y)) + objs = evas_list_prepend(objs, ll->data); + } + } + return objs; +} + /* events */ void evas_event_button_down(Evas e, int x, int y, int b) { + if ((b > 1) || (b < 32)) return; + e->mouse.buttons |= (1 << (b - 1)); } void evas_event_button_up(Evas e, int x, int y, int b) { + if ((b > 1) || (b < 32)) return; + e->mouse.buttons &= ~(1 << (b - 1)); } void evas_event_move(Evas e, int x, int y) { + e->mouse.x = x; + e->mouse.y = y; } void evas_event_enter(Evas e) { + e->mouse.in = 1; } void evas_event_leave(Evas e) { + e->mouse.in = 0; }