Commit Graph

344 Commits

Author SHA1 Message Date
Emmanuele Bassi
e8562089f6 main: Add a sync-to-vblank global flag
It replaces the per-backend CLUTTER_VBLANK environment variable.
2011-11-10 14:55:02 +00:00
Emmanuele Bassi
7b5e5b7727 main: Add a debug note when reading the settings file
So that's easier to track in the debug log.
2011-11-09 09:09:37 +00:00
Emmanuele Bassi
67d5a4993c main: Deprecate clutter_set_default_frame_rate()
Setting the default frame rate does not do anything even remotely
useful, unless synchronization to the vertical refresh rate is also
disabled - which can only be done through environment variable or
through configuration file. Having a programmatic way to change the
default frame rate is, thus, completely pointless.

Changing the default frame rate through environment variable and
configuration file is still allowed.
2011-11-07 20:31:15 +00:00
Emmanuele Bassi
8249e48802 Clean up the windowing system defines
Instead of defining new symbols for the windowing systems enabled at
configure time, we can reuse the same symbols for both the compile time
and run time checks, e.g.:

  #ifdef CLUTTER_WINDOWING_X11
    if (clutter_check_windowing_backend (CLUTTER_WINDOWING_X11))
      /* use the clutter_x11_* API */
    else
  #endif
  #ifdef CLUTTER_WINDOWING_WIN32
    if (clutter_check_windowing_backend (CLUTTER_WINDOWING_WIN32))
      /* use the clutter_win32_* API */
  #endif

This scheme allows us to ensure that the input system namespace is free
for us to use and select at run time in later versions of Clutter.
2011-11-03 13:45:20 +00:00
Emmanuele Bassi
98c177def5 Clean up the backend creation
Move it to its own function.
2011-11-03 13:45:20 +00:00
Emmanuele Bassi
405e72f2e4 egl: First attempt at cleaning up the EGL native backend
At least, let's make it compile when built along with the other
backends. In reality, it still needs to be verified as working.
2011-11-03 13:45:20 +00:00
Emmanuele Bassi
21a24c862e Allow checking the backend type at run-time
Portable code should be allowed to check type backend currently being
used, so that it can use platform-specific API (not just Clutter's).

We don't want to go down the GDK route, with public types for
ClutterBackend and ClutterStageWindow implementations, and use the type
system, e.g.:

  #ifdef GDK_WINDOWING_X11
    if (GDK_IS_WINDOW_X11 (window))
      use_x11_api (window);
    else
  #endif
  #ifdef GDK_WINDOWING_WIN32
    if (GDK_IS_WINDOW_WIN32 (window))
      use_win32_api (window);
    else
  #endif
    g_critical ("Unsupported backend");

This system would make us expose the backend system, and we want to
still reserve us the option to change the backend system to increase its
granularity — e.g. choosing different input event systems regardless of
the windowing system.

This commit adds a simple function that checks the backend type against
a symbolic constant — the same constant string that can be used to
select the backend at run-time through the CLUTTER_BACKEND environment
variable.
2011-11-03 13:45:19 +00:00
Emmanuele Bassi
a09bbffd92 Implement multi-backend support
The Clutter backend split is opaque enough that should allow us to just
build all possible backends inside the same shared object, and select
the wanted backend at initialization time.

This requires some work in the build system, as well as the
initialization code, to remove duplicate functions that might cause
conflicts at build and link time. We also need to defer all the checks
of the internal state of the platform-specific API to run-time type
checks.
2011-11-03 13:45:19 +00:00
Chun-wei Fan
8c196c9403 Bug 662071-[Win32]-Don't init the Big Clutter Lock
Since the Windows GUI system is assuming multithreadedness, initializing
locks after entering the GUI portion on Windows is likely to cause
problems[1][2], which results many Clutter programs to crash due to
releasing resources that they did not own.

[1]: Multi-threaded use of GTK+ on Win32 in README.win32 of GTK+
     source package
[2]: Explanation of Windows GUI system regarding its multithreadness
     assumptions-
     http://mail.gnome.org/archives/gtk-list/2011-June/msg00005.html
2011-10-25 01:27:51 +08:00
Emmanuele Bassi
5540e6bd9c docs: Document the behaviour in case of init failure
Or, better, the fact that the behaviour of any Clutter function will be
undefined in case the initialization fails.

The value returned by clutter_init() and friends has to be handled
properly.
2011-10-21 21:19:27 +01:00
Emmanuele Bassi
be4007ef53 Remove mentions of clutter_redraw() 2011-10-17 10:25:07 +01:00
Emmanuele Bassi
146e15297f debug: Clean up debugging notes 2011-10-17 10:24:25 +01:00
Emmanuele Bassi
a063f09611 debug: Move paint-deform-tiles to CLUTTER_PAINT
The CLUTTER_DEBUG class of debugging flags is meant for debugging notes,
while the CLUTTER_PAINT debugging flags are for changing the output of
the paint cycle. Painting the DeformEffect tiles should go in the latter.
2011-10-13 11:38:27 +01:00
Emmanuele Bassi
ef1a3a5477 docs: Include test-threads.c in the API reference
We can use the test-threads.c interactive test as part of the documentation
on how to use threads with Clutter.
2011-10-13 10:42:30 +01:00
Emmanuele Bassi
e0283993f4 Avoid using deprecated API internally
Use the proper API to implement deprecated functions.
2011-10-12 16:44:55 +01:00
Emmanuele Bassi
193b345786 Remove some compiler warnings
Some issues found using clang as the compiler.
2011-10-11 23:42:23 +01:00
Emmanuele Bassi
7bd5659962 Do not leak strings from GKeyFile
The string getters always copy, so we need to free the returned
values.
2011-10-11 22:45:14 +01:00
Emmanuele Bassi
372b39fd63 Add more sections to the Clutter configuration file
On top of the existing "Settings" group in the settings.ini file we
should have two more groups:

  Environment   - contains all the configuration possible through
                  environment variables
  Debug         - contains all the possible debug variables
2011-10-11 17:52:17 +01:00
Emmanuele Bassi
f5eee5aec7 Add a configuration file for ClutterSettings
ClutterSettings should be able to load its initial state by using
configuration files in SYSCONFDIR and XDG_CONFIG_HOME. This allows
Clutter to have a system (and user) configuration on platforms that
do not have XSETTINGS bridges.
2011-10-11 17:20:20 +01:00
Emmanuele Bassi
01080dc5f3 Deprecate clutter_[sg]et_font_flags()
We already have two mechanisms for controlling the font rendering
quality on a per-application basis:

  • ClutterSettings properties
  • clutter_backend_set_font_options()

The font flags were always a stop-gap solution, and one that tried to
simplify a fairly complex issue beyond the point of actually being
useful.

https://bugzilla.gnome.org/show_bug.cgi?id=660786
2011-10-11 17:19:42 +01:00
Emmanuele Bassi
6ef09dd15b Deprecate clutter_clear_glyph_cache()
This is a wrapper function for API that has long since been public.
2011-10-11 17:19:08 +01:00
Emmanuele Bassi
522b8be306 Deprecate clutter_get_input_device_for_id()
We have the ClutterDeviceManager methods for that.
2011-10-11 17:19:08 +01:00
Emmanuele Bassi
b6dd306998 Clean up grab implementation
The grab API is a relic of Clutter 0.6, and hasn't been through proper
vetting in a *long* time — mostly due to the fact that we don't really
like grabs, and point to the ::captured-event as a way to implement
"soft grabs" in toolkits and applications.

The implementation of full and device grabs uses weak references on
actors instead of using the ::destroy signal, which is meant exactly for
the case of releasing pointers to actors when they are disposed.

The API naming scheme is also fairly broken, especially for
device-related grabs.

Finally, keyboard device grabs are just not implemented.

We can, in one go, clean up this mess and deprecate a bunch of badly
named API by introducing generic device grab/ungrab methods on
ClutterInputDevice, and re-implement the current API on top of them.
2011-10-11 17:15:34 +01:00
Emmanuele Bassi
33846dcf4d Deprecate clutter_redraw()
It's just a badly named proxy to clutter_stage_ensure_redraw().
2011-10-10 15:48:43 +01:00
Emmanuele Bassi
51ca20e81e Cosmetic fixes 2011-10-10 15:42:36 +01:00
Emmanuele Bassi
7e3a75c66b Deprecate clutter_threads_init()
GLib deprecated g_thread_init(), and threading support is initialized
by GObject, so Clutter already runs with threading support enabled. We
can drop the clutter_threads_init() call requirement, and initialize the
Big Clutter Lock™ on clutter_init(). This reduces the things that have
to be done when dealing with threads with Clutter, and the things that
can possibly go wrong.
2011-10-07 15:57:32 +01:00
Emmanuele Bassi
32b8217027 Use a static mutex for the default Clutter lock
The Big Clutter Lock™ can now be a static GMutex, since GLib supports
them. We can also drop a bunch of checks given the recent changes in
GLib threading API.
2011-10-07 15:10:37 +01:00
Håkon Løvdal
839b939d36 spelling fix: timeour -> timeout 2011-10-03 15:58:42 +01:00
Tomeu Vizoso
39db46123e Add paint-deform-tiles option to CLUTTER_DEBUG
To make easier to visualize the triangles in a ClutterDeformEffect

https://bugzilla.gnome.org/show_bug.cgi?id=660354
2011-09-28 14:28:04 +02:00
Colin Walters
d3bafc4b09 clutter-main: Reword translator comment for default:LTR
This makes it much clearer, and fixes some typos in the original.

https://bugzilla.gnome.org/show_bug.cgi?id=659893
2011-09-23 17:48:34 +01:00
Neil Roberts
f8d808f140 Add a CLUTTER_PAINT debug option to enable continous redrawing
When testing the performance of an application, it's often useful to
force it to continuously redraw instead of going idle to help measure
the frame rate. This just adds a CLUTTER_PAINT=continuous-redraw which
causes the master clock to queue a redraw on all of the stages
just before it prepares its source.

Reviewed-by: Robert Bragg <robert@linux.intel.com>
Reviewed-by: Emmanuele Bassi <ebassi@linux.intel.com>
2011-09-23 15:31:50 +01:00
Robert Bragg
662d12aeff actor: add oob-transform opt to catch out-of-band transforms
Out-of-band transforms are considered to be all actor transforms done
directly with the Cogl API instead of via ClutterActor::apply_transform.

By running with CLUTTER_DEBUG=oob-transform then Clutter will explicitly
try to detect when un-expected transforms have been applied to the
modelview matrix stack.

Out-of-band transforms can lead to awkward bugs in Clutter applications
because Clutter itself doesn't know about them and this can disrupt
Clutter's input handling and calculations of actor paint-volumes
which can lead to visual artifacts.

Reviewed-by: Emmanuele Bassi <ebassi@linux.intel.com>
2011-09-19 14:48:06 +01:00
Emmanuele Bassi
a9a104e109 docs: Fixes for cross-references 2011-09-12 13:12:14 +01:00
Emmanuele Bassi
63a05fca9d Lock the main context when modifying the repaint functions list
The repaint functions list can (and should) be manipulated from
different threads, but it currently doesn't prevent multiple threads
from accessing it concurrently. We should have a simple lock and take it
when adding and removing elements from the list; the invocation is still
performed under the Big Clutter Lock™, so it doesn't require special
handling.
2011-09-01 17:12:46 +01:00
Emmanuele Bassi
e25e48efb3 Do not use return with void functions
https://bugzilla.gnome.org/show_bug.cgi?id=654718
2011-07-18 13:53:16 +01:00
Emmanuele Bassi
d5ea422c8f stage: Maintain the motion event delivery invariants
It is possible, by calling clutter_set_motion_events_enabled() prior to
the creation of any stage, to control the per-actor motion event
delivery flag on each newly created stage. Since we deprecated the
global accessor functions in favour of the per-Stage ones, we need to
remove the call to clutter_get_motion_events_enabled() inside the
ClutterStage instance initialization, and replace it with an internal
function.

This code will go away when we can finally break API and remove the
deprecated functions.
2011-06-20 13:53:09 +01:00
Emmanuele Bassi
b6eb5728e1 stage: Make per-actor motion event delivery accessors public
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.
2011-06-20 11:41:28 +01:00
Robert Bragg
7f64772984 debug: disable culling with CLUTTER_PAINT=paint-volumes
When using CLUTTER_PAINT=paint-volumes to visualize the paint-volumes of
actors we were already disabling clipped-redraws because we are drawing
extra geometry that the actors don't know about but we didn't disable
culling. This was resulting in actors disappearing while using this
debug option.
2011-06-17 16:58:36 +01:00
Neil Roberts
1e2e0f21b8 clutter-actor: Add a debug flag for disabling offscreen redirect
This adds CLUTTER_PAINT=disable-offscreen-redirect to help diagnose
problems with the correct opacity changes. This just makes it so that
it never installs the flatten effect so it will never automatically
redirect an actor offscreen.
2011-06-17 12:15:19 +01:00
Neil Roberts
7d233241f1 Fix include location for cogl-pango.h
In Cogl, cogl-pango.h has moved to <cogl-pango/cogl-pango.h>. When
using the experimental 2.0 API (which Clutter does) it is no longer
possible to include it under the old name of <cogl/cogl-pango.h> so we
need to update the include location.
2011-05-16 16:04:27 +01:00
Emmanuele Bassi
043f804452 Make the pick id pool per Stage
The id pool used for the actor's id should be a per-stage field. At some
point, we might have a Stage mapped to multiple framebuffers, or each
Stage mapped to a different framebuffer; also, on backend with low
color precision we don't want to exhaust the size of the available ids
with a global pool. Finally, it's yet another thing we can remove from
the global Clutter context.

Having the id pool allocated per-stage, and the pick id assigned on
Actor:mapped will make the whole pick-id more reliable and future proof.

http://bugzilla.clutter-project.org/show_bug.cgi?id=2633

https://bugzilla.gnome.org/show_bug.cgi?id=647876
2011-05-06 17:47:41 +01:00
Emmanuele Bassi
f6e6c803d9 Deprecate actor id
The actor's id, which is currently used to generate the pick color,
should not be part of the public API: it's an internal detail of the
pick implementation, and having it exposed is like punching a hole
through the abstraction.

http://bugzilla.clutter-project.org/show_bug.cgi?id=2633

https://bugzilla.gnome.org/show_bug.cgi?id=647876
2011-05-06 17:47:41 +01:00
Robert Bragg
223e14811c Removes Cogl from the repository
Cogl has now been split out into a standalone project with a separate
repository at git://git.gnome.org/cogl. From now on the Clutter build
will now simply look for a cogl-1.0 pkg-config file to find a suitable
Cogl library to link against at build time.
2011-05-06 15:44:08 +01:00
Robert Bragg
af366ad750 backend: remove untested fruity backend
This backend hasn't been used for years now and so because it is
untested code and almost certainly doesn't work any more it would be a
burdon to continue trying to maintain it. Considering that we are now
looking at moving OpenGL window system integration code down from
Clutter backends into Cogl that will be easier if we don't have to
consider this backend.
2011-04-11 17:54:36 +01:00
Robert Bragg
70767f08dc Adds a --with-system-cogl config option for Clutter
This makes it possible to build Clutter against a standalone build of
Cogl instead of having the Clutter build traverse into the clutter/cogl
subdirectory.
2011-04-11 17:54:36 +01:00
Robert Bragg
ec0b781466 stage: Move _clutter_do_pick to clutter-stage.c
This moves the implementation of _clutter_do_pick to clutter-stage.c and
renames it _clutter_stage_do_pick. This function can be compared to
_clutter_stage_do_update/redraw in that it prepares for and starts a
traversal of a scenegraph descending from a given stage. Since it is
desirable that this function should have access to the private state of
the stage it is awkward to maintain outside of clutter-stage.c.

Besides moving _clutter_do_pick this patch is also able to remove the
following private state accessors from clutter-stage-private.h:
_clutter_stage_set_pick_buffer_valid,
_clutter_stage_get_pick_buffer_valid,
_clutter_stage_increment_picks_per_frame_counter,
_clutter_stage_reset_picks_per_frame_counter and
_clutter_stage_get_picks_per_frame_counter.
2011-04-11 14:31:31 +01:00
Robert Bragg
19b8622983 Optimize culling by doing culling in eye-coordinates
This implements a variation of frustum culling whereby we convert screen
space clip rectangles into eye space mini-frustums so that we don't have
to repeatedly transform actor paint-volumes all the way into screen
coordinates to perform culling, we just have to apply the modelview
transform and then determine each points distance from the planes that
make up the clip frustum.

By avoiding the projective transform, perspective divide and viewport
scale for each point culled this makes culling much cheaper.
2011-03-07 13:26:20 +00:00
Emmanuele Bassi
bed392b9a5 On error, return FALSE in the post_parse hook
Anything that is not CLUTTER_INIT_SUCCESS is to be considered an error.

This fixes the Clutter initialization sequence to actually error out
on pre-conditions and backend initialization failures.
2011-03-04 23:56:12 +00:00
Emmanuele Bassi
8bde5febd1 Clean up argument parsing GError handling
Pass a GError in, so that clutter_init() can effectively print out a
critical warning on initialization failure, like it used to do in the
olden days.
2011-03-04 23:55:02 +00:00
Emmanuele Bassi
dfdcc20670 clutter: Remove unused variables 2011-02-19 16:47:20 +00:00