This adds a public function to get the bounds of the current clipped
redraw on a stage. This should only be called while the stage is being
painted. The function diverts to a virtual function on the
ClutterStageWindow implementation. If the function isn't implemented
or it returns FALSE then the entire stage is reported. The clip bounds
are in integer pixel coordinates in the stage's coordinate space.
http://bugzilla.clutter-project.org/show_bug.cgi?id=2421
Complete the quest of commit bc548dc862
by making the ClutterStage methods for controlling the per-actor motion
and crossing event delivery public, and deprecating the global ones.
The G_CONST_RETURN define in GLib is, and has always been, a bit fuzzy.
We always used it to conform to the platform, at least for public-facing
API.
At first I assumed it has something to do with brain-damaged compilers
or with weird platforms where const was not really supported; sadly,
it's something much, much worse: it's a define that can be toggled at
compile-time to remove const from the signature of public API. This is a
truly terrifying feature that I assume was added in the past century,
and whose inception clearly had something to do with massive doses of
absynthe and opium — because any other explanation would make the
existence of such a feature even worse than assuming drugs had anything
to do with it.
Anyway, and pleasing the gods, this dubious feature is being
removed/deprecated in GLib; see bug:
https://bugzilla.gnome.org/show_bug.cgi?id=644611
Before deprecation, though, we should just remove its usage from the
whole API. We should especially remove its usage from Cally's internals,
since there it never made sense in the first place.
Allow the developer to set whether the Stage should receive key focus
when mapped. The implementation is fully backend-dependent. The default
value is TRUE because that's what we've been expecting so far.
http://bugzilla.clutter-project.org/show_bug.cgi?id=2500
Some apps or some use cases don't need to clear the stage on immediate
rendering GPUs. A media player playing a fullscreen video or a
tile-based game, for instance.
These apps are redrawing the whole screen, so we can avoid clearing the
color buffer when preparing to paint the stage, since there is no
blending with the stage color being performed.
We can add an private set of hints to ClutterStage, and expose accessors
for each potential hint; the first hint is the 'no-clear' one.
http://bugzilla.clutter-project.org/show_bug.cgi?id=2058
Using the ::event signal to match the CLUTTER_DELETE event type (and
block the stage destruction) can be costly, since it means checking
every single event.
The ::delete-event signal is similar in spirit to any other specialized
signal handler dealing with events, and retains the same semantics.
* stage-use-alpha:
tests: Use accessor methods for :use-alpha
stage: Add accessors for :use-alpha
tests: Allow setting the stage opacity in test-paint-wrapper
stage: Premultiply the stage color
stage: Composite the opacity with the alpha channel
glx: Always request an ARGB visual
stage: Add :use-alpha property
materials: Get the right blend function for alpha
It might be desirable for some applications and/or platforms to get
every motion event that was delivered to Clutter from the windowing
backend. By adding a per-stage flag we can bypass the throttling
done when processing the events.
http://bugzilla.openedhand.com/show_bug.cgi?id=1665
The clutter_redraw() function is used by embedding toolkits to
force a redraw on a stage. Since everything is performed by
toggling a flag inside the Stage itself and then letting the
master clock advance, we need a ClutterStage method to ensure
that we start the master clock and redraw.
The clutter_stage_fullscreen() and clutter_stage_unfullscreen() are
a GDK-ism. The underlying implementation is already using an accessor
with a boolean parameter.
This should take the amount of collisions between properties, methods
and signals to zero.
Bug 1513 - Allow passing in ClutterPickMode to
clutter_stage_get_actor_at_pos()
At the moment, clutter_stage_get_actor_at_pos() uses CLUTTER_PICK_ALL
internally to find an actor. It would be useful to allow passing in
ClutterPickMode to clutter_stage_get_actor_at_pos(), so that the caller
can specify CLUTTER_PICK_REACTIVE as a criteria.
Bug 1454 - move queue_redraw virtualization to ClutterActor
The ClutterActor::queue-redraw signal allows parent containers to
track whether their children need a redraw.
Signed-off-by: Emmanuele Bassi <ebassi@linux.intel.com>
The fog and perspective API is currently split in two parts:
- the floating point version, using values
- the fixed point version, using structures
The relative properties are using the structure types, since they
are meant to set multiple values at the same time. Instead of
using bare values, the whole API should be coalesced into two
simple calls using structures to match the GObject properties.
Thus:
clutter_stage_set_fog (ClutterStage*, const ClutterFog*)
clutter_stage_get_fog (ClutterStage*, ClutterFog*)
clutter_stage_set_perspective (ClutterStage*, const ClutterPerspective*)
clutter_stage_get_perspective (ClutterStage*, ClutterPerspective*)
Which supercedes the fixed point and floating point variants.
More importantly, both ClutterFog and ClutterPerspective should
using floating point values, since that's what get passed to
COGL anyway.
ClutterFog should also drop the "density" member, since ClutterStage
only allows linear fog; non-linear fog distribution can be achieved
using a signal handler and calling cogl_set_fog() directly; this keeps
the API compact yet extensible.
Finally, there is no ClutterStage:fog so it should be added.
The clutter_stage_get_resolution() and fixed-point API are just
shorthands for:
clutter_backend_get_resolution (default_backend);
And as such do not fit at all in the ClutterStage class. The only
reason for their existence was the ClutterUnit conversion macros,
which have now been fixed to use the default backend through a
function call instead.
Thus, we can safely remove the stage entry points.
Add a ClutterStage::queue-redraw signal.
The purpose of this signal is to allow combining the Clutter redraw
idle with another redraw idle such as gtk's (or any other one really;
this is desirable anytime Clutter is not the only thing drawing to
a toplevel window).
To override the default, you would connect to ::queue-redraw and then
stop the signal emission.
Since we only update the GL viewport when we receive a ConfigureNotify
event on X11, we also need a function to allow other toolkits to tell
a stage that the viewport should be updated.
This commit adds clutter_stage_ensure_viewport(), a function that simply
sets the private SYNC_MATRICES flag on the stage and then queues a
redraw.
This function should be called by libraries integrating Clutter with
other toolkits, like clutter-gtk or clutter-qt.
* clutter/clutter-backend.c: Add more debug messages
* clutter/clutter-stage.h:
* clutter/clutter-stage.c:
(clutter_stage_is_default): Add a function to check if the
stage is the default one.
* clutter/glx/clutter-backend-glx.c:
* clutter/glx/clutter-stage-glx.c:
* clutter/x11/clutter-stage-x11.c: Keep the stage wrapper
and implementation flags in sync, to ensure that the GL
context is always set.
Bug #864 - Allow instantiating and subclassing of ClutterStage
* clutter/Makefile.am: Add clutter-stage-window.[ch]
* clutter/clutter-stage-manager.c:
(_clutter_stage_manager_remove_stage): Do not warn if removing
a stage we don't manage, as we might be invoked multiple times
during a ClutterState dispose sequence.
* clutter/clutter-actor.c:
* clutter/clutter-backend.[ch]:
* clutter/clutter-main.c:
* clutter/clutter-private.h:
* clutter/clutter-stage.[ch]: Make ClutterStage a proxy actor,
with a private actor implementing the ClutterStageWindow
interface for handling the per-backend realization, painting
and unrealization, plus all the windowing system abstraction.
* clutter/x11/clutter-event-x11.c:
* clutter/x11/clutter-stage-x11.[ch]: Port the X11 backend
to the new backend and stage API and semantics.
* clutter/glx/clutter-backend-glx.c:
* clutter/glx/clutter-stage-glx.c: Port the GLX backend to
the new backend and stage API and semantics.
* clutter/eglx/clutter-backend-egl.[ch]:
* clutter/eglx/clutter-stage-egl.[ch]: Port the EGLX backend
to the new backend and stage API and semantics (untested).
* tests/test-multistage.c (on_button_press): Rename
clutter_stage_create_new() to clutter_stage_new().
* clutter/clutter-group.c:
* clutter/clutter-group.h: Add the clutter_group_add() convenience
function; it's now "undeprecated" and implemented as a macro
* clutter/clutter-stage.h: Add clutter_stage_add() as a convenience
macro
* clutter/cogl/cogl.h: Include just the needed headers instead
of the whole clutter.h; this avoids rebuild cogl when not needed
* clutter/cogl/cogl.h: Add cogl_fog_set() abstracting the
glFog() functions and enabling the GL_FOG flag.
* clutter/cogl/gl/cogl.c: Add GL implementation of cogl_fog_set().
* clutter/cogl/gles/cogl.c: Add GL/ES implementation of
cogl_fog_set().
* clutter.symbols: Add new symbols.
* clutter/clutter-stage.h: Add API to enable depth cueing on
the stage using a linear GL fog, and to set the parameters
for it (#637).
* clutter/clutter-stage.c (clutter_stage_paint): Enable the
GL fog if the ClutterStage:use-fog property is true.
* tests/test-depth.c: Test the new stage API.
* 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.
* 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.
* clutter/clutter-stage.[ch]: Fix clutter_stage_set_user_resizable()
name, and add a getter for the property.
* clutter/glx/clutter-stage-glx.c: Use the accessor, not
g_object_get() to retrieve the value of the resizable property.
* clutter/clutter-feature.h:
Add new stage feature flags and document.
* clutter/eglnative/clutter-backend-egl.c:
* clutter/eglx/clutter-backend-egl.c:
* clutter/sdl/clutter-backend-sdl.c:
Set new feature flags.
* clutter/glx/clutter-backend-glx.c:
* clutter/glx/clutter-stage-glx.c:
* clutter/clutter-stage.c:
* clutter/clutter-stage.h:
Add a 'user_resizeable' setting to the backend and implement
for glx backend.
* TODO:
Sync up a little.
* clutter/clutter-main.c:
Set a default window title based on g_prgname().
* clutter/clutter-stage.c:
* clutter/clutter-stage.h:
* clutter/egl/clutter-stage-egl.c:
* clutter/glx/clutter-stage-glx.c:
* clutter/sdl/clutter-stage-sdl.c:
Alter draw_to_pixbuf to return a pixbuf
* configure.ac:
Only full in gdk-pixbuf-xlib as a GLX backend dep.
* tests/test-entry.c:
Fix a couple of warnings.
* clutter/clutter-actor.h:
* clutter/clutter-stage.h: Add 32 padding slots; when we
reach 1.0 it'll be a long road until the following ABI
break.
* tests/test-behave.c: Don't forget to include headers.
Merge from clutter.git/master
* clutter/glx/clutter-event-glx.c:
* clutter/glx/clutter-stage-glx.c: Implement the _NET_WM_PING
protocol handling on the main stage window.
* clutter/clutter-stage.h:
* clutter/clutter-stage.c:
* clutter/clutter-main.c: Handle CLUTTER_DELETE events internally,
by calling clutter_main_quit(), and remove the ::delete-event
signal from ClutterStage; clean up the signal emission sequence
for the events: emit the ::event signal before emitting any signal
and the ::event-after signal after the signal has been emitted; move
the signal emission calls inside ClutterStage so we can call
g_signal_emit() instead of g_signal_emit_by_name(), thus sparing us
a lookup for each event.
* examples/test.c: Remove ::delete-event signal handling.