From c0aa013758c21b35da2c400dea2be6d43fdf2618 Mon Sep 17 00:00:00 2001 From: Matthew Allum Date: Tue, 16 Jan 2007 14:19:39 +0000 Subject: [PATCH] 2007-01-16 Matthew Allum * NEWS: Minor tweaks * TODO: Sync up, mainly with 0.3 todo items * clutter/clutter-behaviour.c: * clutter/clutter-behaviour.h: clutter_behaviour_get_n_actors() / clutter_behaviour_get_nth_actor() Additions. * clutter/clutter-stage.c: (clutter_stage_realize): Experimental (disabled) visual setting code. * clutter/clutter-feature.c: Check for GL_EXT_texture_rectangle (#198 - Frederick Riss) * clutter/clutter-group.c: (clutter_group_allocate_coords): Fix for group size allocation (#199 - Frederick Riss) * clutter/clutter-texture.c: (texture_upload_data): Fix texture unpacking row length (#197 Frederick Riss) * examples/Makefile.am: Fix LDADD in build (#196 - Frederick Riss) --- ChangeLog | 28 ++++++++++++++++++++++++++++ NEWS | 2 +- TODO | 30 +++++++++++------------------- clutter/clutter-behaviour.c | 39 +++++++++++++++++++++++++++++++++++++++ clutter/clutter-behaviour.h | 7 +++++++ clutter/clutter-feature.c | 3 ++- clutter/clutter-group.c | 4 ++-- clutter/clutter-stage.c | 31 ++++++++++++++++++++++++++----- clutter/clutter-texture.c | 3 +-- examples/Makefile.am | 10 ++++------ 10 files changed, 121 insertions(+), 36 deletions(-) diff --git a/ChangeLog b/ChangeLog index f88f959..55e3102 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,31 @@ +2007-01-16 Matthew Allum + + * NEWS: + Minor tweaks + + * TODO: + Sync up, mainly with 0.3 todo items + + * clutter/clutter-behaviour.c: + * clutter/clutter-behaviour.h: + clutter_behaviour_get_n_actors() / clutter_behaviour_get_nth_actor() + Additions. + + * clutter/clutter-stage.c: (clutter_stage_realize): + Experimental (disabled) visual setting code. + + * clutter/clutter-feature.c: + Check for GL_EXT_texture_rectangle (#198 - Frederick Riss) + + * clutter/clutter-group.c: (clutter_group_allocate_coords): + Fix for group size allocation (#199 - Frederick Riss) + + * clutter/clutter-texture.c: (texture_upload_data): + Fix texture unpacking row length (#197 Frederick Riss) + + * examples/Makefile.am: + Fix LDADD in build (#196 - Frederick Riss) + 2007-01-16 Tomas Frydrych * clutter/clutter-fixed.h: diff --git a/NEWS b/NEWS index 82cead6..05cb83e 100644 --- a/NEWS +++ b/NEWS @@ -10,7 +10,7 @@ Clutter 0.2 () be destroyed. o Add basic run-time detection of GL features. + Use GL_TEXTURE_RECTANGLE_ARB if available. - + Attempt to set up sync to vblank + + Attempt to set up sync to vblank (set CLUTTER_VBLANK=none to disable) o Add API for behaviours. A ClutterBehaviour is an object which drives a set of actors using one or more properties depending on the value of an "alpha" function. diff --git a/TODO b/TODO index 0ea63c0..6493348 100644 --- a/TODO +++ b/TODO @@ -1,37 +1,29 @@ TODO ==== -Posiible New Features +New Features == - - Gradients - - Some kind of glitz/cairo integration - a GlitzDrawable Actor ? - More portability - GL ES, DirectFB?, Windows, Mac ? - - Overhaul co-ordinate system ( more precision ? ) - - Width-for-height allocation of the actors (esp. ClutterLabel) - - Complete over-haul of the ClutterMedia interface - o remove the accessors from the vfuncs and use pure properties - o add a way to get a timeline from the media source, to be - used inside a ClutterAlpha and drive a behaviour - o add signals for start and stop - - Move the events to the actors instead of the stage - o add an event queue to clutter so that we can push/pop the - events from it - o add support for mouse double click and scroll events - - Add focus handling API - - Add an entry actor + (See backends branch, GL ES for 0.3) + - Text entry actor (0.3). + - VBox and HBox ClutterGroup subclasses (0.3). + - Figure out focus model + binding events to actors (0.3). + - Fragment shading ? + - Gradients + - More drawing primitives (or just cairo?) Optimisations == - Display lists. - - labels being more conservative on texture creation. - o blitting to textures less - Custom source rather than idle handler for paints ? + - General oprofiling. Other == - Unit tests - Much improved examples / demos - - Sort Documentation - Bindings to languages other than just Python and Perl. + - Improve documentation. + - Overhaul co-ordinate system ( more precision ? ) \ No newline at end of file diff --git a/clutter/clutter-behaviour.c b/clutter/clutter-behaviour.c index 535aec9..844c916 100644 --- a/clutter/clutter-behaviour.c +++ b/clutter/clutter-behaviour.c @@ -245,6 +245,45 @@ clutter_behaviour_remove (ClutterBehaviour *behave, } /** + * clutter_behaviour_get_n_actors: + * @behave: a #ClutterBehaviour + * + * Gets the number of actors this behaviour is applied too. + * + * Return value: The number of applied actors + * + * Since: 0.2 + */ +gint +clutter_behaviour_get_n_actors (ClutterBehaviour *behave) +{ + g_return_val_if_fail (CLUTTER_IS_BEHAVIOUR (behave), 0); + + return g_list_length (behave->priv->actors); +} + +/** + * clutter_behaviour_get_nth_actor: + * @behave: a #ClutterBehaviour + * @num: the index of an actor this behaviour is applied too. + * + * Gets an actor the behaviour was applied to referenced by index num. + * + * Return value: A Clutter actor or NULL if index is invalid. + * + * Since: 0.2 + */ +ClutterActor* +clutter_behaviour_get_nth_actor (ClutterBehaviour *behave, + gint num) +{ + g_return_val_if_fail (CLUTTER_IS_BEHAVIOUR (behave), NULL); + + return g_list_nth_data (behave->priv->actors, num); +} + + +/** * clutter_behaviour_actors_foreach: * @behave: a #ClutterBehaviour * @func: a function called for each actor diff --git a/clutter/clutter-behaviour.h b/clutter/clutter-behaviour.h index f4bc3a2..ad96658 100644 --- a/clutter/clutter-behaviour.h +++ b/clutter/clutter-behaviour.h @@ -105,6 +105,13 @@ void clutter_behaviour_remove (ClutterBehaviour *beh void clutter_behaviour_actors_foreach (ClutterBehaviour *behave, ClutterBehaviourForeachFunc func, gpointer data); +gint clutter_behaviour_get_n_actors (ClutterBehaviour *behave); + +ClutterActor* clutter_behaviour_get_nth_actor (ClutterBehaviour *behave, + gint num); + + + GSList * clutter_behaviour_get_actors (ClutterBehaviour *behave); ClutterAlpha *clutter_behaviour_get_alpha (ClutterBehaviour *behave); void clutter_behaviour_set_alpha (ClutterBehaviour *behave, diff --git a/clutter/clutter-feature.c b/clutter/clutter-feature.c index f11cc83..2390d15 100644 --- a/clutter/clutter-feature.c +++ b/clutter/clutter-feature.c @@ -253,7 +253,8 @@ clutter_feature_init (void) glx_extensions = glXQueryExtensionsString (clutter_xdisplay (), clutter_xscreen ()); - if (check_gl_extension ("GL_ARB_texture_rectangle", gl_extensions)) + if (check_gl_extension ("GL_ARB_texture_rectangle", gl_extensions) + || check_gl_extension ("GL_EXT_texture_rectangle", gl_extensions)) __features->flags |= CLUTTER_FEATURE_TEXTURE_RECTANGLE; /* vblank */ diff --git a/clutter/clutter-group.c b/clutter/clutter-group.c index 6a8ce23..9f0fcfe 100644 --- a/clutter/clutter-group.c +++ b/clutter/clutter-group.c @@ -131,7 +131,7 @@ clutter_group_allocate_coords (ClutterActor *self, if (box->x2 == 0 || cbox.x2 > box->x2) box->x2 = cbox.x2; - if (box->y2 == 0 || cbox.y2 < box->y2) + if (box->y2 == 0 || cbox.y2 > box->y2) box->y2 = cbox.y2; } } @@ -265,7 +265,7 @@ clutter_group_get_children (ClutterGroup *self) gint clutter_group_get_n_children (ClutterGroup *self) { - g_return_val_if_fail (CLUTTER_IS_GROUP (self), NULL); + g_return_val_if_fail (CLUTTER_IS_GROUP (self), 0); return g_list_length (self->priv->children); } diff --git a/clutter/clutter-stage.c b/clutter/clutter-stage.c index 28020a5..0637889 100644 --- a/clutter/clutter-stage.c +++ b/clutter/clutter-stage.c @@ -405,11 +405,32 @@ clutter_stage_realize (ClutterActor *actor) }; if (priv->xvisinfo) - XFree(priv->xvisinfo); - - priv->xvisinfo = glXChooseVisual (clutter_xdisplay(), - clutter_xscreen(), - gl_attributes); + { + XFree(priv->xvisinfo); + priv->xvisinfo = None; + } +#if 0 + /* Attempted fix at GTK 'white' textures - made no difference :( */ + if (priv->is_foreign_xwin && priv->xwin != None) + { + XWindowAttributes win_attr; + XVisualInfo vis_info; + int n; + + XGetWindowAttributes (clutter_xdisplay(), priv->xwin, &win_attr); + vis_info.screen = clutter_xscreen(); + vis_info.visualid = XVisualIDFromVisual (win_attr.visual); + priv->xvisinfo = XGetVisualInfo (clutter_xdisplay(), + VisualScreenMask|VisualIDMask, + &vis_info, &n); + + printf("made %li\n", priv->xvisinfo); + } +#endif + if (priv->xvisinfo == None) + priv->xvisinfo = glXChooseVisual (clutter_xdisplay(), + clutter_xscreen(), + gl_attributes); if (!priv->xvisinfo) { g_critical ("Unable to find suitable GL visual."); diff --git a/clutter/clutter-texture.c b/clutter/clutter-texture.c index dd54b46..3320c3f 100644 --- a/clutter/clutter-texture.c +++ b/clutter/clutter-texture.c @@ -539,12 +539,11 @@ texture_upload_data (ClutterTexture *texture, glTexEnvi (GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_MODULATE); - glPixelStorei (GL_UNPACK_ROW_LENGTH, priv->width); + glPixelStorei (GL_UNPACK_ROW_LENGTH, src_w); glPixelStorei (GL_UNPACK_ALIGNMENT, 4); if (create_textures) { - glTexImage2D(priv->target_type, 0, (bpp == 4) ? diff --git a/examples/Makefile.am b/examples/Makefile.am index 89bb3df..5021f91 100644 --- a/examples/Makefile.am +++ b/examples/Makefile.am @@ -1,27 +1,25 @@ noinst_PROGRAMS = test super-oh behave INCLUDES = -I$(top_srcdir)/ +LDADD = $(top_builddir)/clutter/libclutter-@CLUTTER_MAJORMINOR@.la test_SOURCES = test.c test_CFLAGS = $(CLUTTER_CFLAGS) $(GCONF_CFLAGS) test_LDFLAGS = \ $(CLUTTER_LIBS) \ - $(GCONF_LIBS) \ - $(top_builddir)/clutter/libclutter-@CLUTTER_MAJORMINOR@.la + $(GCONF_LIBS) super_oh_SOURCES = super-oh.c super_oh_CFLAGS = $(CLUTTER_CFLAGS) $(GCONF_CFLAGS) super_oh_LDFLAGS = \ $(CLUTTER_LIBS) \ - $(GCONF_LIBS) \ - $(top_builddir)/clutter/libclutter-@CLUTTER_MAJORMINOR@.la + $(GCONF_LIBS) behave_SOURCES = behave.c behave_CFLAGS = $(CLUTTER_CFLAGS) $(GCONF_CFLAGS) behave_LDFLAGS = \ $(CLUTTER_LIBS) \ - $(GCONF_LIBS) \ - $(top_builddir)/clutter/libclutter-@CLUTTER_MAJORMINOR@.la + $(GCONF_LIBS) EXTRA_DIST = redhand.png \ -- 2.7.4