Commit Graph

103 Commits

Author SHA1 Message Date
Matthew Allum
74c8271db6 2008-03-09 Matthew Allum <mallum@openedhand.com>
* clutter/clutter-id-pool.c: (clutter_id_pool_free):
        Use g_slice_free not g_free.
        * clutter/clutter-main.c: (_clutter_do_pick):
        Dont 'over read' the framebuffer when picking (#839, Neil Roberts)
2008-03-09 19:07:17 +00:00
Øyvind Kolås
cdf8bb0739 Refactored the integer id->ClutterActor mapping code to be a self
contained data structure.
* clutter/clutter-id-pool.[ch]: new files.
* clutter/Makefile.am: added clutter-id-pool.[ch]
* clutter/clutter-private.h: use a ClutterIDPool instead of GArray and
GSList to keep track of the reusable ids.
* clutter/clutter-actor.c: moved id pool logic away.
* clutter/clutter-main.c: simplified id pool creation/finalization.
2008-03-07 17:34:40 +00:00
Emmanuele Bassi
57a954b1eb 2008-03-04 Emmanuele Bassi <ebassi@openedhand.com>
* clutter/clutter-main.c (clutter_do_event): Do not throttle the
	motion events if the per-actor delivery has been disabled.
2008-03-04 16:23:13 +00:00
Øyvind Kolås
bb6f3c6a4f Reuse the numeric id's used for picking actors to avoid the potential
of overflowing the id numbers when continusly creating and destroying
actors on long running applications for 16bpp.
* clutter/clutter-private.h: replaced hashtable with GArray and a
GSList for available slots in the array.
* clutter/clutter-actor.c: (create_actor_id): function to create an
actor->id mapping, (release_actor_id): function to mark an existing id
as available for reuse.
* clutter/clutter-main.c: (clutter_context_free): added utility
function for cleaning up the context, 
(clutter_get_actor_by_gid): use the GArray for looking up actors.
2008-02-29 14:54:28 +00:00
Emmanuele Bassi
b5bcee6c6c 2008-02-25 Emmanuele Bassi <ebassi@openedhand.com>
* clutter/clutter-main.c (emit_event): Fix the last commit
	which inverted a condition.
2008-02-25 16:50:50 +00:00
Emmanuele Bassi
bcd9a6dcec 2008-02-25 Emmanuele Bassi <ebassi@openedhand.com>
* clutter/clutter-actor.c: Remove the usage of g_return_if_fail()
	from static functions: either assert or use g_warning() to check
	internal state, as g_return_if_fail() can be compiled out.

	* clutter/clutter-main.c: Ditto as above.
2008-02-25 12:24:56 +00:00
Tomas Frydrych
9aba9710c1 2008-02-20 Tomas Frydrych <tf@openedhand.com>
* clutter/x11/clutter-x11.h:
	* clutter/x11/clutter-backend-x11.c:
	(clutter_x11_set_display):
	Function to set X display connection prior to calling
	clutter_init(); stripped loads of trailing space.
2008-02-20 14:16:54 +00:00
Emmanuele Bassi
92954a76a7 2008-01-19 Emmanuele Bassi <ebassi@openedhand.com>
* clutter/clutter-main.c (generate_enter_leave_events): Do not
	take the explicit reference, and let clutter_event_copy() do it
	for us. (#714, Neil Roberts)
2008-01-19 10:33:31 +00:00
Emmanuele Bassi
94fb3f0c6a 2008-01-18 Emmanuele Bassi <ebassi@openedhand.com>
* clutter/clutter-main.c (clutter_do_event): Check the
	return value of the ::event signal for the CLUTTER_DELETE
	event type.

	* clutter/clutter-stage.c (clutter_stage_event): Emit the
	::event signal when receiving the CLUTTER_DELETE event; this
	allows to intercept the user's closing of the stage window.
2008-01-18 18:08:37 +00:00
Øyvind Kolås
bf66f7a3ec * clutter/clutter-main.c: (generate_enter_leave_events): synthesize
enter event (without related) and corresponding leave event when the
actor the cursor is over has been destroyed.
* clutter/clutter-event.c: (clutter_event_free): only unref the
related_actor when it actually is set.
2007-12-18 13:03:45 +00:00
Emmanuele Bassi
b14bdfe2bb 2007-12-18 Emmanuele Bassi <ebassi@openedhand.com>
* clutter/clutter-main.c:
	(unset_motion_last_actor),
	(generate_enter_leave_events): Attach a callback to the destroy
	signal on the last motion actor, so if it goes away while the
	pointer is in the middle of it we can unset the pointer.

	* clutter/clutter-private.h: Store the last motion actor inside
	the global context.
2007-12-18 10:49:29 +00:00
Emmanuele Bassi
dad823f123 2007-12-06 Emmanuele Bassi <ebassi@openedhand.com>
* clutter/clutter-main.c:
	(clutter_set_motion_events_frequency): Never allow the motion
	events devlivery frequency to exceed the default frame rate.
2007-12-06 12:38:04 +00:00
Emmanuele Bassi
4ff25a291c 2007-12-05 Emmanuele Bassi <ebassi@openedhand.com>
* clutter/clutter-score.h: Rearrange declarations.

	* clutter/clutter-score.c: More documentation in the long
	description of the ClutterScore section.

	* clutter/clutter-debug.h:
	* clutter/clutter-main.c: Add the CLUTTER_DEBUG_SHADER flag,
	for debugging the shader calls.

	* clutter/clutter-feature.h: Fix the documentation of the
	feature flags.

	* clutter/Makefile.am: Remove trailing whitespace.
2007-12-05 21:15:19 +00:00
Matthew Allum
aebf79829a 2007-11-29 Matthew Allum <mallum@openedhand.com>
* clutter/clutter-main.c: (generate_enter_leave_events):
        Minor formatting tweak.
        * configure.ac:
        Typo fix from Damien Lespiau (via mailing list)
2007-11-28 23:57:26 +00:00
Øyvind Kolås
a770e57193 * clutter/clutter-main.c: (event_click_count_generate): generalized
click_count generation code.
* tests/test-events.c: (input_cb): extended test to report click_count
for release and scroll events as well as press events.
2007-11-20 17:14:05 +00:00
Øyvind Kolås
80ef0db622 reverted accidental commit 2007-11-20 17:05:23 +00:00
Øyvind Kolås
4320c354a3 * clutter/clutter-main.c: (clutter_do_event): avoid computing source
of events if it is already set (for synthetic events.)
* clutter/clutter-event.c: Add more information to the documentation
of clutter_event_put.
2007-11-20 17:03:53 +00:00
Emmanuele Bassi
b676210545 2007-11-19 Emmanuele Bassi <ebassi@openedhand.com>
* clutter.symbols: Update

	* clutter/clutter-actor.h: Rename the angle argument for
	set_rotationx() to avoid gtk-doc complaining

	* clutter/clutter-main.h:
	* clutter/clutter-main.c:
	(clutter_set_motion_events_enabled): Rename for consistency

	(clutter_get_motion_events_frequency),
	(clutter_set_motion_events_frequency): Add accessors for the default
	motion events deliver frequency.
	
	(clutter_do_event): Throttle down motion events delivery using the
	motion events frequency setting, to avoid excessive redraws. (#608)

	(clutter_context_get_default): Enable per-actor motion events, at
	least for now.

	* tests/test-events.c (red_button_cb):
	* tests/test-grab.c (green_press_cb): Update.
2007-11-19 16:30:56 +00:00
Matthew Allum
382852f921 2007-11-18 Matthew Allum <mallum@openedhand.com>
* clutter/clutter-actor.c:
        * clutter/clutter-actor.h:
        * clutter/clutter-group.c:
        * clutter/clutter-main.c:
        * clutter/clutter-stage.c:
        * tests/test-events.c:
        Parent Actors no longer need to be set reactive for reactive
        children to get events. Also makes groups now pickable.
        (#597, #423)

        * clutter/clutter-texture.c:
        Handle case when 1x1 tiled texture is created,
        falling 'back' to being non tiled. (#596)

        * clutter/eglx/clutter-backend-egl.c:
        Call EglTerminate on backend shutdown.
2007-11-18 23:24:55 +00:00
Øyvind Kolås
3c0897a102 * clutter/clutter-main.c: (emit_event): renamed from deliver_event,
(emit_pointer_event): utility function to emit pointer event signals
(which takes pointer grab into account).
(emit_keyboard_event): utility function to emit keyboard event signals
(which takes keyboard grab into account).
(clutter_do_event): use the above utility functions, also reindented
the source.
2007-11-16 13:41:07 +00:00
Øyvind Kolås
3b4f603368 * clutter/clutter-main.[ch]: added clutter_grab_keyboard,
clutter_ungrab_keyboard and clutter_get_keyboard_grab, in
clutter_do_event deliver keyboard related events only to the
actor with the keyboard grab if a grab exists.
* clutter/clutter-private.h: added keyboard_grab_actor to context.
* tests/test-grab.c: added testing for testing the keyboard grab.
2007-11-15 18:00:24 +00:00
Emmanuele Bassi
75d186c3f9 2007-11-15 Emmanuele Bassi <ebassi@openedhand.com>
* clutter/clutter-actor.[ch]: Massive API clean-ups. Initial
	fixes for bugs #614 and #628.

	* clutter/clutter-main.c:
	* clutter/clutter-stage.c: Update internal usage of the actor
	API.

	* tests/test-events.c: Update test suite.
2007-11-15 17:35:47 +00:00
Øyvind Kolås
d060b3bdd7 fixing commited conflict due to interrupted commit 2007-11-15 17:34:49 +00:00
Øyvind Kolås
36c6189405 * clutter/clutter-main.c: (generate_enter_leave_events),
(clutter_do_event): moved the generation of enter/leave events
to a utility function.
2007-11-15 17:32:09 +00:00
Øyvind Kolås
266315c486 * clutter/clutter-main.c: (generate_enter_leave_events),
(clutter_do_event): moved the generation of enter/leave events
to a utility function.
2007-11-15 17:30:30 +00:00
Øyvind Kolås
53ec33f34c * clutter/clutter-main.[ch]: added clutter_grab_pointer,
clutter_ungrab_pointer and clutter_get_pointer_grab, in
clutter_do_event deliver pointer related events only to the
actor with the pointer grab if a grab exists.
* clutter/clutter-private.h: added pointer_grab_actor to context.
* tests/Makefile.am:
* tests/test-grab.c: added test for testing the pointer grab.
2007-11-15 17:08:48 +00:00
Øyvind Kolås
95338ba67b * clutter/clutter-event.h: made ClutterEventAny have a source field,
rearanged other structs to have source in the same position.
* clutter/clutter-event.c: (clutter_event_get_source): modified to use
the any event.
(clutter_event_free): removed unused variable.
* clutter/clutter-main.c: (deliver_event), (clutter_do_event): reduced
amount of code. As well as deliver button-release events to the stage.
2007-11-12 19:12:02 +00:00
Øyvind Kolås
60a66695c6 * clutter/clutter-main.c: (_clutter_do_pick): disable dithering
when painting in pick mode.
2007-10-31 15:38:18 +00:00
Emmanuele Bassi
7b6f602956 2007-10-26 Emmanuele Bassi <ebassi@openedhand.com>
* clutter/clutter-main.c: Add a --clutter-default-fps run-time
	switch and CLUTTER_DEFAULT_FPS environment variable support for
	setting the default frame-rate at run-time.
2007-10-26 15:47:39 +00:00
Øyvind Kolås
a7fb3a78d2 * clutter/clutter-main.c: (clutter_do_event): allow motion events
only delivered to stage to be chaugt in the capture phase as well
as the bubbling phase.
2007-10-16 16:35:02 +00:00
Emmanuele Bassi
f6c83a224e 2007-10-16 Emmanuele Bassi <ebassi@openedhand.com>
* clutter/clutter-timeline.[ch]: Added ClutterTimeline:duration,
	a property for setting the duration of a timeline in milliseconds.
	The property comes with accessors and a new constructor. The
	frame rate used is the default value.

	* clutter/clutter-private.h:
	* clutter/clutter-main.[ch]: Add clutter_get_default_frame_rate()
	and clutter_set_default_frame_rate(); these two functions control
	the default frame rate to be used when creating timelines. Currently
	is set to 60 frames-per-second.
2007-10-16 13:41:34 +00:00
Matthew Allum
dd99f024bf 2007-10-15 Matthew Allum <mallum@openedhand.com>
* clutter/clutter-actor.c:
        More events documentation.

        * clutter/clutter-event.c:
        * clutter/clutter-event.h:
        Add synthetic flag and make put_event use it
        (via modded patch from pippin)

        * clutter/clutter-main.c: (clutter_do_event):
        dont use put event anymore when pushing enter/leave events.
2007-10-15 16:50:59 +00:00
Emmanuele Bassi
717a82303a 2007-10-10 Emmanuele Bassi <ebassi@openedhand.com>
* clutter/clutter-actor.c: Remove the ::event-after signal:
	three event layers to connect to seems a bit overkill.

	(clutter_actor_event): Return FALSE, not TRUE by default,
	as g_signal_emit() will change the return value if no
	handlers are connected

	* clutter/clutter-stage.c: Emit ::notify when we change
	the fullscreen property.

	* clutter/clutter-script.c: Add more documentation for the
	definition format and keywords.

	(translate_property): Collapse the G_TYPE_ENUM and G_TYPE_FLAGS
	cases into one, to simplify the code.

	* tests/test-script.c: Test enumeration conversion by using
	a value different from the default.
2007-10-10 14:29:29 +00:00
Matthew Allum
6216ce659c 2007-10-10 Matthew Allum <mallum@openedhand.com>
* clutter/clutter-actor.c:
        * clutter/clutter-actor.h:
        * clutter/clutter-event.c:
        * clutter/clutter-main.c:
        * tests/test-events.c:
        Add basic W3 DOM  event 'capture' like functionality.
2007-10-10 13:04:34 +00:00
Matthew Allum
8faf9b9964 2007-10-10 Matthew Allum <mallum@openedhand.com>
* clutter/clutter-actor.c:
        * clutter/clutter-actor.h:
        Add missing enter/leave event signals

        * clutter/clutter-main.c: (clutter_do_event):
        Set time in crossing events.
        Protect against do_pick() failing.
2007-10-09 23:45:49 +00:00
Matthew Allum
34a40de3c5 2007-10-08 Matthew Allum <mallum@openedhand.com>
* clutter/clutter-actor.c:
        * clutter/clutter-actor.h:
        * clutter/clutter-private.h:
        * clutter/clutter-main.c:
        Add a hash to global clutter context mapping all parented actor
        id's to actors.
        Add clutter_get_actor_by_id() call.
        Convert picking machinery to use above.
        (performance/simpler composite actor creation)

        * clutter/clutter-stage.c: (clutter_stage_fullscreen),
        (clutter_stage_unfullscreen), (clutter_stage_event):
        Only set the fullscreen property on stage state fullscreen event(#545)
        Experimental as could be painful to implement on non X backends.
2007-10-08 16:18:33 +00:00
Emmanuele Bassi
991562f536 2007-10-08 Emmanuele Bassi <ebassi@openedhand.com>
Initial implementation of the UI definition files. (#424)

	* clutter/json/Makefile.am:
	* clutter/json/*.[ch]: In-tree copy of JSON-GLib, a GLib-based
	JSON parser/generator library. We use it in-tree because we might
	need to change the API. Ideally, we'd depend on it.

	* clutter/clutter.h:
	* clutter/clutter-script-private.h:
	* clutter/clutter-script.[ch]: ClutterScript, the scenegraph
	generator class. It parses JSON streams in form of buffers and
	files and builds the scene.

	* clutter/clutter-debug.h:
	* clutter/clutter-main.c: Add a "script" debug flag

	* clutter/Makefile.am: Build glue.

	* tests/Makefile.am:
	* tests/test-script.c: Add a test case for the ClutterScript.

	* configure.ac: Depend on GLib 2.14, so we can use the
	g_hash_table_get_key() and g_hash_table_get_values() functions
	for the time being; we can probably reimplement those, but we
	are going to need 2.14 anyway if we are going to implement a
	list model using GSequence.
2007-10-08 15:03:22 +00:00
Matthew Allum
bc13e907cc 2007-10-03 Matthew Allum <mallum@openedhand.com>
* clutter/clutter-actor.c:
        * clutter/clutter-event.c:
        * clutter/clutter-event.h:
        * clutter/clutter-main.c:
        * clutter/clutter-private.h:
        * clutter/eglnative/clutter-event-egl.c:
        * clutter/eglx/clutter-event-egl.c:
        * clutter/glx/clutter-event-glx.c:
        * clutter/sdl/clutter-event-sdl.c:
        Remove seperate double/triple click events and replace with
        a click_count member.
        Move calculating click counts from backend to do_event()
        Initial implementation of ENTER/LEAVE events.

        * tests/test-events.c:
        Add code to test above.

        * tests/test-behave.c:
        Sync with newer API.

        * clutter/clutter-score.c:
        Silence a warning.
2007-10-03 09:28:16 +00:00
Emmanuele Bassi
090c1d11b4 2007-10-01 Emmanuele Bassi <ebassi@openedhand.com>
* clutter/clutter-actor.[ch]: Remove the ::event-after signal
	class handler, as it's not meant to be overridden by sub-classes.

	(clutter_actor_class_init):
	Make every event-related signal return a boolean: return TRUE
	in a signal handler to block the emission. The value is accumulated
	automatically by the signal API.

	(clutter_actor_event): If ::event returns TRUE, skip to emitting
	::event-after. Return the value accumulated by the signal emission
	chain.

	* clutter/clutter-private.h: Rename _clutter_boolean_accumlator().

	* clutter/clutter-main.c (clutter_do_event): If clutter_actor_event()
	returns TRUE then stop the event emission chain from child to parent.

	* clutter/clutter-stage.c (clutter_stage_event): Behave like
	clutter_actor_event().

	(clutter_stage_get_key_focus),
	(clutter_stage_set_key_focus): Avoid a nasty circular reference
	issue: if the actor passed to set_key_focus is NULL then the stage
	has the key focus.

	* tests/test-events.c: Update the events test with the API
	changes.
2007-10-02 14:03:36 +00:00
Matthew Allum
5ab0ed5a00 2007-09-27 Matthew Allum <mallum@openedhand.com>
* clutter/clutter-event.c:
        * clutter/clutter-event.h:
        * clutter/clutter-main.c:
        Further event tweaks;
        - Ref the event actor source
        - Protect against off stage events (button releases)
        - Move more into ClutterEventAny
        - Add a click count to button event (as yet unused)
        - Minor cleanups

        * clutter/clutter-actor.c:
        Make scale x/y a property.

        * clutter/clutter-private.h:
        Remove _clutter_actor_apply_modelview*

        * clutter/eglx/clutter-backend-egl.c:
        Warning cleanup

        * clutter/eglx/clutter-stage-egl.c:
        * clutter/glx/clutter-stage-glx.c:
        * clutter/sdl/clutter-stage-sdl.c:
        Avoid setting viewport directly, but set sync flag.

        * clutter/pango/pangoclutter-render.c: (draw_glyph):
        Minor cleanups.

        * clutter/Makefile.am:
        * tests/Makefile.am:
        * tests/test-score.c
        * clutter/clutter.h:
        * clutter/clutter-score.h:
        * clutter/clutter-score.c:
        Add very initial (broken) ClutterScore implementation.
2007-09-27 21:38:38 +00:00
Matthew Allum
818a667836 2007-08-29 Matthew Allum <mallum@openedhand.com>
* clutter/clutter-main.c: (_clutter_do_pick):
        Call glFinish before reading pixels
        * clutter/eglx/clutter-stage-egl.c: (clutter_stage_egl_realize):
        Add missing read surface in making context current.
        Above fixes via Kate Alhola.

        * clutter/glx/clutter-glx.h:
        Add missing filter funcs so there actually exported
2007-08-29 19:11:18 +00:00
Matthew Allum
1ceaf04ac7 2007-08-24 Matthew Allum <mallum@openedhand.com>
* clutter/clutter-actor.c:
        * clutter/clutter-event.h:
        * clutter/clutter-main.c:
        * clutter/clutter-stage.c:
        * clutter/clutter-stage.h:
        * clutter/glx/clutter-backend-glx.c:
        * clutter/glx/clutter-backend-glx.h:
        * clutter/glx/clutter-event-glx.c:
        * clutter/glx/clutter-stage-glx.c:
        * clutter/glx/clutter-stage-glx.h:
        Add initial support for stage state events.
        Fix fullscreening for an already mapped stage.

        * tests/test-events.c:
        Print out info from the above. Blue button now toggles
        fullscreen.

        * clutter/clutter-effect.c:
        * clutter/clutter-effect.h:
        Add a setting for templates to ref or clone underlying
        timelines. (As to improve sync issues like those in foofone)

        * tests/test-timeline.c:
        Also add completed signals.

        * clutter/cogl/gles/cogl.c: (cogl_texture_image_2d):
        * configure.ac:
        Forward port from stable branch. RGB Image fixes gles
        and check for lower case libgles_cm.
2007-08-24 15:12:52 +00:00
Emmanuele Bassi
fa7eb4e5a8 Remove the threads locking in the dispatchers destruction notification
The GLib main loop allows destroying sources while still in the dispatcher
function, so whether the Clutter threading lock is being held or not is
actually unpredictable by the library. This might be fixed in GLib, so we
just do what GTK+ does for the time being and wait.

See bug: http://bugzilla.gnome.org/show_bug.cgi?id=459555
2007-08-22 10:12:15 +00:00
Emmanuele Bassi
00142fdb62 Return event coordinates for 3BUTTON_PRESS events
The switch() in clutter_event_get_coords() wasn't returning the coordinates
for the 3 button press events, thus those events never reached the actors.
2007-08-21 15:48:51 +00:00
Emmanuele Bassi
5d0e16e2a9 Replace the note in clutter_do_event()
Use an EVENT note and not a SCHEDULER one.
2007-08-19 17:06:37 +00:00
Emmanuele Bassi
5cfac975d3 Update the Since version in the API that has been backported
Some of the API landed in trunk has been backported to the stable branch
after testing. This patch updates the Since: tag in the API reference to
reflect the time when the API was first added to a release.
2007-08-18 12:39:30 +00:00
Emmanuele Bassi
d7dc1d7c97 Add checks on the reactive accessors
Check for the parameter in the various "reactive" flag accessors.
2007-08-15 19:50:31 +00:00
Matthew Allum
8ad4dde16b 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.
2007-08-13 20:48:01 +00:00
Emmanuele Bassi
705f47783a 2007-08-08 Emmanuele Bassi <ebassi@openedhand.com>
* clutter/clutter-main.c (clutter_get_timestamp): Remove
	the microseconds remainder, which is mostly useless. (#447)
2007-08-08 13:24:43 +00:00
Emmanuele Bassi
1639b7d0b8 2007-08-08 Emmanuele Bassi <ebassi@openedhand.com>
* clutter/clutter-main.c (clutter_get_timestamp): Return the
	correct number of microseconds (#447, Neil Roberts)
2007-08-08 11:22:45 +00:00