Commit Graph

5128 Commits

Author SHA1 Message Date
Neil Roberts
6da18b6e4f win32: Fix clutter_win32_disable_event_retrieval
There was previously a flag that gets set when this function was
called but nothing checked it so the function effectively did
nothing. Also the flag was a member of the backend struct but this
can't be used because the function should be called before
clutter_init so the backend is not ready yet. This patch makes the
event disabling work more like the X11 backend and set a global
variable instead.
2010-10-25 13:19:18 +01:00
Ole André Vadla Ravnås
e6099cdd4b win32: Use _clutter_actor_rerealize() like X11 backend does
http://bugzilla.clutter-project.org/show_bug.cgi?id=1654
2010-10-25 13:19:18 +01:00
Neil Roberts
e66c679e84 win32: Add a public clutter_win32_handle_event function
This function handles a single windows message. The idea is that it
could be used by clutter-gtk to forward on events from a
GdkEventFilter. The function replaces the old message_translate()
function. That function didn't translate the event anymore anyway and
instead it could generate multiple events so
clutter_win32_handle_event seems like a more appropriate name. The
function returns TRUE or FALSE depending on whether the event was
completely handled instead of setting call_window_proc.
2010-10-25 13:19:17 +01:00
Neil Roberts
52744c0d9d clutter-stage: Set the Cogl framebuffer size after allocating
When handling an allocation on the stage, Clutter uses the oppurtunity
to inform Cogl of the new size of the framebuffer so that it can
handle the viewport correctly. It queries the size of the window
implementation using a backend virtual function. However it was doing
this before letting the backend handle the allocation so on Win32 it
would end up using the previous framebuffer size. This wasn't
affecting the X11 backend because in that case the resizes are
asynchronous so setting the stage size causes one allocation which
ends up sending a window size request. Eventually a ConfigureNotify is
received which causes the size of the stage to be set again and
another allocation is fired meaning the framebuffer size will be set
again this time with the correct size. In Win32 the resizes are
synchronous so we don't have this second allocation.
2010-10-25 13:19:17 +01:00
Neil Roberts
cc7977988c cogl-context-winsys: Avoid zero-length arrays
When compiling for non-glx platforms the winsys feature data array
ends up empty. Empty arrays cause problems for MSVC so this patch adds
a stub entry so that the array always has at least one entry.

Based on a patch by Ole André Vadla Ravnås
2010-10-25 13:18:25 +01:00
Neil Roberts
f1752ff3ba Avoid mixing declarations and code
Mixing declarations and code causes problems for MSVC as it is a C99
feature so we should try to avoid it.
2010-10-25 13:18:25 +01:00
Neil Roberts
8e3674dcc1 Avoid variable length arrays in clutter-backend-x11
There was an array whose length was define by a static const int
variable. GCC seems to consider this a variable-length array so it
will cause warnings now that -Wvla is enabled. We might as well make
this constant a #define instead to avoid the warning.
2010-10-25 13:18:25 +01:00
Neil Roberts
c3f47fa7d0 Add -Wdeclaration-after-statement and -Wvla to maintainer CFLAGS
These warnings pick up C99 extensions that are commonly accidentally
used and which cause problems when compiling with MSVC.
2010-10-25 13:18:25 +01:00
Giovanni Campagna
164af55a6e Avoid warnings on ClutterClone with a NULL source
clutter_clone_apply_transform should check the source before calling
methods on it, else criticals will be emitted.

http://bugzilla.clutter-project.org/show_bug.cgi?id=2381
2010-10-25 12:36:00 +01:00
Emmanuele Bassi
c7bfe27e96 Update NEWS 2010-10-25 12:31:50 +01:00
Ole André Vadla Ravnås
276acf5854 binding-pool: Use the correct marshaller 2010-10-25 00:39:13 +01:00
Ole André Vadla Ravnås
c792431538 interval: Remember to chain up to parent in finalize() 2010-10-25 00:31:36 +01:00
Neil Roberts
d5634e37a2 cogl-texture-2d-sliced: Use the other backends for the slices
Instead of directly manipulating GL textures itself,
CoglTexture2DSliced now works in terms of CoglHandles. It creates the
texture slices using cogl_texture_new_with_size which should always
end up creating a CoglTexture2D because the size should fit. This
allows us to avoid replicating some code such as the first pixel
mipmap tracking and it better enforces the separation that each
texture backend is the only place that contains code dealing with each
texture target.
2010-10-22 12:19:04 +01:00
Neil Roberts
61f2f1c024 Support foreign textures in the texture-2d and rectangle backends
This adds two new internal functions to create a foreign texture for
the texture 2d and rectangle backends. cogl_texture_new_from_foreign
will now use one of these backends directly if there is no waste
instead of always using the sliced texture backend.
2010-10-22 12:19:02 +01:00
Damien Lespiau
7b7b655e6e build: Dist cookbook.xsl
cookbook.xsl was not in EXTRA_DIST, so the cookbook was not buildable
with released tarballs.
2010-10-22 06:52:27 +01:00
Emmanuele Bassi
f709664f23 build: Go back to autoreconf
After testing and distchecking, I verified that autoreconf can still be
used to rebuild the autotools setup.

Thanks to Javier Jardón for the second pair of eyes.
2010-10-20 09:42:34 +01:00
Emmanuele Bassi
68156c24c1 build: Remove unused Makefile.am
We switched to a non-recursive layout, hence we don't need Makefile.am
in the osx/ and fruity/ sub-directories.
2010-10-19 17:48:15 +01:00
Emmanuele Bassi
ce3311df26 conform: Remove unnecessary destroy() calls
Unparented actors are owned by the Script instance, and if that goes
away then the actors go away with it. The fact that we needed an
explicit destroy() before was a hint of a memory management issue that I
blissfully - and regretfully - ignored for the sake of a passing test
suite.
2010-10-19 12:32:02 +01:00
Emmanuele Bassi
b5bbdd6cec build: Add test wrappers to the main ignore file
They are generated at configure time, so it's a good idea to have them
in the main ignore file instead of adding them to the built ignore files
under tests.
2010-10-19 11:03:13 +01:00
Emmanuele Bassi
e80825535a build: Show whether we have XComposite
Since we're doing it for other optional X11 extensions as well.
2010-10-19 10:48:39 +01:00
Emmanuele Bassi
dd2f55c6f6 x11: Protect XComposite API calls
Since we allow compiling Clutter without the XComposite extension
available, we need to protect the calls to the XComposite API with
the guards provided by the configure script.
2010-10-19 10:43:50 +01:00
Emmanuele Bassi
21eb49098a script: Fix the memory management
Currently, the memory management in ClutterScript is overly complicated.
The basic design tenet should be:

  - ClutterScript owns a reference on every object it creates

This allows the Script instance to reliably handle the lifetime of the
instances from creation to disposal.

In case of unmerge, the Script instance should destroy any Actor
instance, except for the Stage, and release the reference it owns. The
Stage is special because it's really owned by Clutter itself, and it
should be destroyed explicitly.

When disposing the Script itself, it should just release the reference;
any parented actor, or any InitiallyUnowned instance, will then be
managed by the parent object, as they should, while every GObject
instance will go away, as documented.

This commit is based on a patch by:

  Henrik Hedberg <hhedberg@innologies.fi>

http://bugzilla.clutter-project.org/show_bug.cgi?id=2316
2010-10-19 01:42:19 +01:00
Emmanuele Bassi
20a359cc53 debug: Do not use '&' in the messages
Use ':' as a separator between G_STRLOC and the debug message, like we
do for warnings.
2010-10-19 01:42:19 +01:00
Emmanuele Bassi
78d4073f8e Remove unused variables 2010-10-19 01:42:19 +01:00
Damien Lespiau
1c9dcdaeb2 build: Fix CLUTTER_EGL_BACKEND definition for eglnative and cex100
CLUTTER_EGL_BACKEND is used to define a special EGL native backend to
use and was introduced for the CEX100 EGL backend. Unfortunately
CLUTTER_EGL_BACKEND was defined to "cex100" for eglnative, which is
obviously wrong.

The paches defines the right values for CLUTTER_EGL_BACKEND for the
eglnative and cex100 flavours.
2010-10-18 16:09:31 +01:00
Damien Lespiau
32270730bd build: Fix EGL/CEX100 build with GLES2
Some headers files have been renamed or removed and the gles(2) did not
compile anymore, fix that.
2010-10-18 16:08:47 +01:00
Emmanuele Bassi
0f613ea134 cairo-texture: Allow overriding the surface creation
By using a new signal, ::create-surface (width, height), it should be
possible for third party code and sub-classes to override the default
surface creation code in CairoSurface.

This commit takes a bit of the patch from:

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

which cleans up CairoTexture; the idea, mutuated from that bug, is that
the CairoTexture actor checks whether the surface it has it's an image
one, and in that case it uses a Cogl texture as the backing store. In
case the surface is not an image one we assume that the surface itself
has some way of updating the GL state and flush the surface.
2010-10-18 11:26:45 +01:00
Emmanuele Bassi
63e314b07e build: Depend on cairo-gobject
Starting from version 1.10, Cairo ships GTypes for its data types.
2010-10-18 11:26:45 +01:00
Emmanuele Bassi
8729c01377 build: Remove unnecessary g-i version check 2010-10-18 11:26:45 +01:00
Emmanuele Bassi
050e775da2 Move more classes to install_properties() 2010-10-18 11:26:45 +01:00
Emmanuele Bassi
8429aa8d75 Remove unnecessary GLib version checks
We now depend on a newer version of GLib than those checks tested for.
2010-10-18 11:26:45 +01:00
Emmanuele Bassi
7dd09e2186 Use G_DEFINE_BOXED_TYPE for all boxed types
We actually need a couple more macros for registering GValue
transformation functions. Those should be added to upstream
GLib.
2010-10-18 11:26:45 +01:00
Emmanuele Bassi
09a830d294 Remove conditional wrappers for property installation/notification
For the time being, just keep the #define's.
2010-10-18 11:26:45 +01:00
Emmanuele Bassi
9caf11f2d8 Use G_DEFINE_INTERFACE
GObject provides us with a nice, safe macro for defining interface
types.
2010-10-18 11:26:44 +01:00
Emmanuele Bassi
8f5d6cb790 build: Depend on GLib ≥ 2.26.0
We are going to need some new macros and API.
2010-10-18 11:26:44 +01:00
Emmanuele Bassi
2b4ee9ab54 actor: Add more checks to the redraw queue 2010-10-15 16:05:44 +01:00
Emmanuele Bassi
ad0e7a9e15 moduleset: Add Atk as a Clutter dependency 2010-10-15 15:24:58 +01:00
Emmanuele Bassi
56c89bd86b osx: Fix glib.h include path
The fix for removing glib/gmain.h introduced the wrong path for glib.h.
2010-10-15 12:40:43 +01:00
Roland Peffer
d842619755 osx: Add button mask to the modifier state translation
The modifier state translation is missing the CLUTTER_BUTTON*_MASK.

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

Signed-off-by: Emmanuele Bassi <ebassi@linux.intel.com>
2010-10-14 18:23:02 +01:00
Kristian Høgsberg
134ce072e7 The amazing lazy-copy-back-repaint-page-flip
Always use pageflipping, but avoid full repaint by copying back dirty
regions from front to back.  Additionally, we dealy copying back until
we're ready to paint the new frame, so we can avoid copying areas that
will be repainted anyway.

This is the least amount of copying per frame we can get away with at all
and at the same time we don't have to worry about stalling the GPU on
synchronized blits since we always pageflip.
2010-10-14 16:23:05 +01:00
Kristian Høgsberg
cb5582c4ab Add wayland backend
This adds a clutter backend for running under the wayland window system.
Initial cogl framebuffer integration by Robert Bragg.
2010-10-14 16:23:05 +01:00
Kristian Høgsberg
a7cf98ebfc Initialize color masks lazily
When we don't use a window system drawable, we can't query the color
masks at context initialization time.  Do it lazily so we're sure to have
a current context with a valid framebuffer.
2010-10-14 16:23:05 +01:00
Robert Bragg
f456116c18 When unparenting an actor, remove queued redraws for all descendants
We need to make sure that redraws queued for actors on a stage are for
actors actually in the stage. So in clutter_actor_unparent() descend
through the children and remove redraws. Just removing the actor itself
isn't good enough since an entire hierarchy can be removed from the
stage without breaking it up into individual actors.

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

This is based on an original patch from Owen Taylor who debugged the
root cause of this bug; thanks.
2010-10-14 16:19:55 +01:00
Robert Bragg
07f2dba7e2 stage: handle unclipped redraw following clipped
In the case that an unclipped redraw of an actor is queued after a
clipped we should update any existing ClutterStageQueueRedrawEntry
so entry->has_clip = FALSE and free the previous clip.
2010-10-14 15:29:33 +01:00
Emmanuele Bassi
d032b9b2bf conform: Start cleaning up the conformance test suite
Re-order the units into a sensible list, with basic tests at the
beginning, and per-class tests at the end - with Cogl last.

Also, start renaming the unit functions from test_<foo> to <foo>,
so that the executable wrappers and the reports have sensible names.
2010-10-12 17:42:18 +01:00
Emmanuele Bassi
b5d5b9628e conform: Implement TEST_CONFORM_TODO() correctly
The TODO() macro for adding new tests to the test suite has always meant
to be implemented like the TODO block in Test::More, i.e. a test that is
assumed to fail, and which warns if it unexpectedly succeeds.

Since GTest lacks the expressivity of Test::More, the implementation
just verifies that the tests marked as TODO actually fail, and will fail
if they happen to succeed - at which point the developer will have to
change the macro to SIMPLE or SKIP.
2010-10-12 17:11:52 +01:00
Emmanuele Bassi
2a23bab819 conform: Save the revision and date inside the test report
Even if gtester-report doesn't use that information (yet), we should
store the revision of Clutter that generated the report, and the date in
which the test suite was ran.
2010-10-12 15:44:57 +01:00
Emmanuele Bassi
e6418a9dec constraints: Remove unused variable 2010-10-12 15:44:57 +01:00
Neil Roberts
7fd6273c25 tests: Generate the stub scripts using sed
Instead of trying to run ./test-conformance with the -l option to
generate a list of available tests it now runs sed on the
test-conform-main.c file instead. Running the generated executable is
a pain for cross-compiling so it would be nice to avoid it unless it's
absolutely necessary. Although you could tell people who are cross
compiling to just disable the conformance tests, this seems a shame
because they could still be useful along with the wrappers for example
if the cross compile is built to a shared network folder where the
tests can be run on the actual device.

The sed script is a little more ugly than it could be because it tries
to avoid using the GNU extensions '\+' and '\|'.

The script ends up placing restrictions on the format of the C file
because the tests must all be listed on one line each. There is now a
comment to explain this. Hopefully the trade off is worth it.

http://bugzilla.clutter-project.org/show_bug.cgi?id=2363
2010-10-12 15:24:32 +01:00
Neil Roberts
100d541f47 tests: Re-enable the test-anchors conformance test
This test was disabled in b5d58213. The commit message doesn't mention
this so I'm guessing it was a mistake. In any case the test appears to
work now anyway so it should be re-enabled.

http://bugzilla.clutter-project.org/show_bug.cgi?id=2363
2010-10-12 15:24:32 +01:00