diff --git a/ChangeLog b/ChangeLog index b74d00740..d87024bd5 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,23 @@ +2006-06-21 Matthew Allum + + * clutter/Makefile.am: + Make sure clutter.h included. + * clutter/clutter-stage.c: (clutter_stage_realize), + (clutter_stage_get_actor_at_pos): + Select for motion events on X window. + Return highest rather than lowest found actor for actor_at_pos. + * examples/Makefile.am: + Remove test-text, remane test video. + * examples/README: + Add info about the included examples. + * examples/test-video.c: + * examples/video-player.c: + Redo test-video a little nicer and rename. + * examples/video-cube.c: + Fix so it at least 'works' again. + * examples/test.c: + Clean up a little. + 2006-06-21 Ross Burton * Makefile.am: diff --git a/clutter/Makefile.am b/clutter/Makefile.am index e1c1d89ec..30146b233 100644 --- a/clutter/Makefile.am +++ b/clutter/Makefile.am @@ -5,22 +5,22 @@ GLIB_MKENUMS=`pkg-config --variable=glib_mkenums glib-2.0` BUILT_SOURCES = $(MARSHALFILES) $(ENUMFILES) -source_h = \ - $(srcdir)/clutter-keysyms.h \ - $(srcdir)/clutter-util.h \ - $(srcdir)/clutter-media.h \ - $(srcdir)/clutter-event.h \ - $(srcdir)/clutter-color.h \ - $(srcdir)/clutter-timeline.h \ - $(srcdir)/clutter-actor.h \ - $(srcdir)/clutter-group.h \ - $(srcdir)/clutter-stage.h \ - $(srcdir)/clutter-rectangle.h \ - $(srcdir)/clutter-texture.h \ - $(srcdir)/clutter-clone-texture.h \ - $(srcdir)/clutter-video-texture.h \ - $(srcdir)/clutter-label.h \ - $(srcdir)/clutter-main.h +source_h = clutter.h \ + clutter-keysyms.h \ + clutter-util.h \ + clutter-media.h \ + clutter-event.h \ + clutter-color.h \ + clutter-timeline.h \ + clutter-actor.h \ + clutter-group.h \ + clutter-stage.h \ + clutter-rectangle.h \ + clutter-texture.h \ + clutter-clone-texture.h \ + clutter-video-texture.h \ + clutter-label.h \ + clutter-main.h clutter-marshal.h: clutter-marshal.list ( $(GLIB_GENMARSHAL) --prefix=clutter_marshal \ diff --git a/clutter/clutter-stage.c b/clutter/clutter-stage.c index f39296ade..79ee0320a 100644 --- a/clutter/clutter-stage.c +++ b/clutter/clutter-stage.c @@ -403,6 +403,8 @@ clutter_stage_realize (ClutterActor *actor) priv->xwin, StructureNotifyMask |ExposureMask + /* FIXME: we may want to eplicity enable MotionMask */ + |PointerMotionMask |KeyPressMask |KeyReleaseMask |ButtonPressMask @@ -1058,7 +1060,8 @@ clutter_stage_get_actor_at_pos (ClutterStage *stage, g_print ("Hit at %i\n", buff[i * 4 + 3]); #endif - found = clutter_group_find_child_by_id (CLUTTER_GROUP (stage), buff[3]); + found = clutter_group_find_child_by_id (CLUTTER_GROUP (stage), + buff[(hits-1) * 4 + 3]); } sync_gl_viewport (stage); diff --git a/examples/Makefile.am b/examples/Makefile.am index 5f7467722..86881d99a 100644 --- a/examples/Makefile.am +++ b/examples/Makefile.am @@ -1,4 +1,4 @@ -noinst_PROGRAMS = test test-video video-cube test-text super-oh +noinst_PROGRAMS = test video-player video-cube super-oh INCLUDES = -I$(top_srcdir)/ @@ -10,9 +10,9 @@ test_LDFLAGS = \ $(GCONF_LIBS) \ $(top_builddir)/clutter/libclutter-@CLUTTER_MAJORMINOR@.la -test_video_SOURCES = test-video.c -test_video_CFLAGS = $(CLUTTER_CFLAGS) $(GST_CFLAGS) $(GCONF_CFLAGS) -test_video_LDFLAGS = \ +video_player_SOURCES = video-player.c +video_player_CFLAGS = $(CLUTTER_CFLAGS) $(GST_CFLAGS) $(GCONF_CFLAGS) +video_player_LDFLAGS = \ $(CLUTTER_LIBS) \ $(GST_LIBS) \ $(GCONF_LIBS) \ @@ -26,14 +26,6 @@ video_cube_LDFLAGS = \ $(GCONF_LIBS) \ $(top_builddir)/clutter/libclutter-@CLUTTER_MAJORMINOR@.la -test_text_SOURCES = test-text.c -test_text_CFLAGS = $(CLUTTER_CFLAGS) $(GST_CFLAGS) $(GCONF_CFLAGS) -test_text_LDFLAGS = \ - $(CLUTTER_LIBS) \ - $(GST_LIBS) \ - $(GCONF_LIBS) \ - $(top_builddir)/clutter/libclutter-@CLUTTER_MAJORMINOR@.la - super_oh_SOURCES = super-oh.c super_oh_CFLAGS = $(CLUTTER_CFLAGS) $(GST_CFLAGS) $(GCONF_CFLAGS) super_oh_LDFLAGS = \ @@ -42,4 +34,9 @@ super_oh_LDFLAGS = \ $(GCONF_LIBS) \ $(top_builddir)/clutter/libclutter-@CLUTTER_MAJORMINOR@.la -EXTRA_DIST = redhand.png clutter-logo-800x600.png \ No newline at end of file +EXTRA_DIST = redhand.png \ + clutter-logo-800x600.png \ + media-actions-pause.png \ + media-actions-start.png \ + vid-panel.png \ + README diff --git a/examples/README b/examples/README new file mode 100644 index 000000000..1e2e3895e --- /dev/null +++ b/examples/README @@ -0,0 +1,37 @@ +examples/ +=== + +This directory contains a number of simple hacks come tests come +examples come clutter demos. + +There are: + + o test + + Lots of randomness. Scratchpad to test new features. + + o test.py + + Like above but more randomness in python. + + o super-oh + + Spinning OH logos. Click to dissapear. + + o video-player. + + Simple fullscreen video player. + + - Move mouse to see controls. + - Hit q or Esc to exit, p to toggle pause state. + - Has some useless cheesy effects built in. + - Hit e to flip the video. + + o video-cube. + + Pure evil. A nasty hack to do a video cube with clutter. + Could be done much nicer. + + +Also see http://svn.o-hand.com/repos/misc/trunk/opt for a simple +clutter based presentation program. diff --git a/examples/media-actions-pause.png b/examples/media-actions-pause.png new file mode 100644 index 000000000..38614e1c7 Binary files /dev/null and b/examples/media-actions-pause.png differ diff --git a/examples/media-actions-start.png b/examples/media-actions-start.png new file mode 100644 index 000000000..b3c6170bf Binary files /dev/null and b/examples/media-actions-start.png differ diff --git a/examples/test-video.c b/examples/test-video.c deleted file mode 100644 index efa069017..000000000 --- a/examples/test-video.c +++ /dev/null @@ -1,158 +0,0 @@ -#include - -ClutterActor *rect; /* um... */ - - -void input_cb (ClutterStage *stage, - ClutterEvent *event, - gpointer user_data) -{ - ClutterVideoTexture *vtex = CLUTTER_VIDEO_TEXTURE(user_data); - static gint paused = 0; - - if (event->type == CLUTTER_KEY_RELEASE) - { - if (paused) - { - clutter_media_set_playing (CLUTTER_MEDIA(vtex), TRUE); - paused = 0; - } - else - { - clutter_media_set_playing (CLUTTER_MEDIA(vtex), FALSE); - paused = 1; - } - } -} - -void -size_change (ClutterTexture *texture, - gint width, - gint height, - gpointer user_data) -{ - ClutterActor *stage; - ClutterGeometry stage_geom; - gint vid_width, vid_height, new_y, new_height; - - stage = clutter_stage_get_default (); - - clutter_actor_get_geometry (stage, &stage_geom); - - clutter_texture_get_base_size (texture, &vid_width, &vid_height); - - printf("*** vid : %ix%i stage %ix%i ***\n", - vid_width, vid_height, stage_geom.width, stage_geom.height); - - - new_height = ( vid_height * stage_geom.width ) / vid_width; - new_y = (stage_geom.height - new_height) / 2; - - clutter_actor_set_position (CLUTTER_ACTOR (texture), 0, new_y); - - clutter_actor_set_size (CLUTTER_ACTOR (texture), - stage_geom.width, - new_height); - - // clutter_actor_set_opacity (CLUTTER_ACTOR (texture), 50); - - printf("*** Pos set to +%i+%i , %ix%i ***\n", - 0, new_y, stage_geom.width, new_height); -} - -void -tick (GObject *object, - GParamSpec *pspec, - ClutterLabel *label) -{ - ClutterVideoTexture *vtex; - gint w, h, position, duration; - gchar buf[256]; - - vtex = CLUTTER_VIDEO_TEXTURE(object); - - position = clutter_media_get_position (CLUTTER_MEDIA(vtex)); - duration = clutter_media_get_duration (CLUTTER_MEDIA(vtex)); - - g_snprintf(buf, 256, "%i / %i", position, duration); - - clutter_label_set_text (label, buf); - - clutter_texture_get_base_size (CLUTTER_TEXTURE(label), &w, &h); - clutter_actor_set_size(rect, w+10, h+10); -} - -int -main (int argc, char *argv[]) -{ - ClutterActor *label, *vtexture, *ctexture; - ClutterActor *stage; - ClutterColor rect_color = { 0xde, 0xde, 0xdf, 0xaa }; - ClutterColor stage_color = { 0x00, 0x00, 0x00, 0x00 }; - GError *err = NULL; - - if (argc < 2) - g_error("%s