2007-08-13 Matthew Allum <mallum@openedhand.com>

* clutter/clutter-actor.c:
        * clutter/clutter-actor.h:
        * clutter/clutter-event.c:
        * clutter/clutter-event.h:
        * clutter/clutter-main.c:
        * clutter/clutter-main.h:
        * clutter/clutter-private.h:
        * clutter/clutter-stage.c:
        * clutter/clutter-stage.h:
        * clutter/clutter-types.h:
        Initial implementation of actors emmitting event signals (423);
        - Actors set_reactive() to receive mouse events.
          (call clutter_enable_motion_events() for per action motion events)
        - clutter_stage_set_key_focus () to direct key events.
        - Events bubble up to parents (ending at stage)
          (original source identified by clutter_event_get_source())
        TODO:
        - enter/leave notifys for actors.
        - stage specific events - fullscreen
        - grabs

        * tests/test-events.c:
        Extend a little to use new API

        * clutter/cogl/gl/cogl.c:
        * clutter/glx/clutter-backend-glx.c:
        Move get_proc_address into cogl and out of backend.
        (shaders will need it)

        * clutter/clutter-group.c: (clutter_group_real_lower):
        Fix a minor compile warning.

        * TODO:
        Sync up.
This commit is contained in:
Matthew Allum 2007-08-13 20:48:01 +00:00
parent a752579845
commit fe4fb91fa3

View File

@ -29,6 +29,13 @@
#include <GL/gl.h> #include <GL/gl.h>
#include <string.h> #include <string.h>
#ifdef HAVE_CLUTTER_GLX
#include <dlfcn.h>
#include <GL/glx.h>
typedef CoglFuncPtr (*GLXGetProcAddressProc) (const guint8 *procName);
#endif
static gulong __enable_flags = 0; static gulong __enable_flags = 0;
#if COGL_DEBUG #if COGL_DEBUG
@ -81,7 +88,43 @@ error_string(GLenum errorCode)
CoglFuncPtr CoglFuncPtr
cogl_get_proc_address (const gchar* name) cogl_get_proc_address (const gchar* name)
{ {
/* FIXME: This very likely needs to be handled in the backend */ /* Sucks to ifdef here but not other option..? would be nice to
* split the code up for more reuse (once more backends use this
*/
#ifdef HAVE_CLUTTER_GLX
static GLXGetProcAddressProc get_proc_func = NULL;
static void *dlhand = NULL;
if (get_proc_func == NULL && dlhand == NULL)
{
dlhand = dlopen (NULL, RTLD_LAZY);
if (dlhand)
{
dlerror ();
get_proc_func =
(GLXGetProcAddressProc) dlsym (dlhand, "glXGetProcAddress");
if (dlerror () != NULL)
{
get_proc_func =
(GLXGetProcAddressProc) dlsym (dlhand, "glXGetProcAddressARB");
}
if (dlerror () != NULL)
{
get_proc_func = NULL;
g_warning ("failed to bind GLXGetProcAddress "
"or GLXGetProcAddressARB");
}
}
}
if (get_proc_func)
return get_proc_func ((unsigned char*) name);
#endif
return NULL; return NULL;
} }