Compare commits

...

88 Commits

Author SHA1 Message Date
Florian Müllner
9622733140 window: Handle broken icon themes more gracefully
We assert that the icons used as default window icons are loaded correctly,
but currently this can fail simply because of an incomplete icon theme. After
all, "image-missing" was only added to the icon-naming spec in 2005 🙄

Handle this case more gracefully by falling back to a completely
transparent "icon".

https://bugzilla.gnome.org/show_bug.cgi?id=720583
https://gitlab.gnome.org/GNOME/mutter/merge_requests/462
2019-02-27 22:46:19 +01:00
Niels De Graef
16a2eab290 clutter: Animatable: Use G_DECLARE_INTERFACE()
It cuts away a bit of the GObject boilerplate, gives us support for
`g_autoptr`, and removes the typedef hack inside clutter-scroll-actor.c.

https://gitlab.gnome.org/GNOME/mutter/merge_requests/380
2019-02-27 16:44:24 +00:00
Niels De Graef
41a69f194d clutter: MasterClock: Use G_DECLARE_INTERFACE()
It cuts away a bit of the GObject boilerplate, gives us support for
`g_autoptr`, and removes the typedef hack inside clutter-master-clock.c.

https://gitlab.gnome.org/GNOME/mutter/merge_requests/380
2019-02-27 16:44:24 +00:00
Niels De Graef
b77e6f0c98 clutter: Content: Use G_DECLARE_INTERFACE()
It cuts away a bit of the GObject boilerplate, gives us support for
`g_autoptr`, and removes the typedef hack inside clutter-content.c.

https://gitlab.gnome.org/GNOME/mutter/merge_requests/380
2019-02-27 16:44:24 +00:00
Niels De Graef
b67394dcd1 clutter: StageWindow: Use G_DECLARE_INTERFACE()
It cuts away a bit of the GObject boilerplate, gives us support for
`g_autoptr`, and removes the typedef hack inside clutter-stage-window.c.

https://gitlab.gnome.org/GNOME/mutter/merge_requests/380
2019-02-27 16:44:24 +00:00
Olivier Fourdan
f9e33a89fd clutter: cleanup/remove core input X11 backend
We don't use the core input X11 backend, remove it.

https://gitlab.gnome.org/GNOME/mutter/merge_requests/459
2019-02-27 12:07:24 +01:00
Adam Jackson
39e9e53871 clutter: Remove the rest of deprecated/clutter-animator.c
https://gitlab.gnome.org/GNOME/mutter/merge_requests/452
2019-02-27 03:32:21 +00:00
Adam Jackson
7f3fda6df6 clutter: Simplify clutter_state_change
clutter_state_get_animator now always returns NULL, because
_set_animator is never called.

https://gitlab.gnome.org/GNOME/mutter/merge_requests/452
2019-02-27 03:32:21 +00:00
Adam Jackson
73ce5b3a8d clutter: Remove tests/interactive/test-state-animator.c
This is the only caller of the (deprecated) clutter_state_set_animator.

https://gitlab.gnome.org/GNOME/mutter/merge_requests/452
2019-02-27 03:32:21 +00:00
Adam Jackson
53319a121f clutter: Remove unused deprecated code from clutter-actor-deprecated.c
Since clutter_actor_set_shader() is never called, none of this has any
effect.

https://gitlab.gnome.org/GNOME/mutter/merge_requests/452
2019-02-27 03:32:21 +00:00
Adam Jackson
cf2d06e9b9 clutter: Remove deprecated clutter-score.c
https://gitlab.gnome.org/GNOME/mutter/merge_requests/452
2019-02-27 03:32:21 +00:00
Adam Jackson
d39211f438 clutter: Remove deprecated clutter_egl{,x}_display
https://gitlab.gnome.org/GNOME/mutter/merge_requests/452
2019-02-27 03:32:21 +00:00
Adam Jackson
909464f749 clutter: Remove deprecated XInput code
https://gitlab.gnome.org/GNOME/mutter/merge_requests/452
2019-02-27 03:32:21 +00:00
Adam Jackson
5669b64021 clutter: Remove unused clutter-glx-texture-pixmap.c and friends
https://gitlab.gnome.org/GNOME/mutter/merge_requests/452
2019-02-27 03:32:21 +00:00
Adam Jackson
8f0b4767de clutter: Remove deprecated clutter_x11_get_stage_visual
https://gitlab.gnome.org/GNOME/mutter/merge_requests/452
2019-02-27 03:32:21 +00:00
Jonas Ådahl
9e75ce2ad7 monitor-config-store: Read system wide config files
Before introducing the new config store, the old monitor configuration
system read system wide monitor configuration files. Add back that
feature.

https://gitlab.gnome.org/GNOME/mutter/merge_requests/253
2019-02-26 21:04:27 +00:00
Tim Sabsch
c010a3b195 Update German translation 2019-02-26 19:44:02 +00:00
Jonas Ådahl
7c807c6e2a org.gnome.Mutter.ScreenCast: Document what was added in API version 2
RecordWindow and the cursor-mode property are only available if the
advertised version is at least 2.

https://gitlab.gnome.org/GNOME/mutter/merge_requests/413
2019-02-26 13:39:11 +00:00
Jonas Ådahl
9a20271f90 screen-cast-window-stream: Add support for cursor modes
Make the RecordWindow method also understand the 'cursor-mode' property.
For 'embedded' the cursor is drawn onto the pixel buffer using cairo,
otherwise it works similarly to how RecordMonitor deals with it.

https://gitlab.gnome.org/GNOME/mutter/merge_requests/413
2019-02-26 13:39:11 +00:00
Jonas Ådahl
1760a6e560 screen-cast: Bump API version to 2
https://gitlab.gnome.org/GNOME/mutter/merge_requests/413
2019-02-26 13:39:11 +00:00
Jonas Ådahl
8c2b805d88 screen-cast-src: Add helper to draw cursor sprite into pixel buffer
It makes sure the cursor sprite is correctly scaled and positioned in
stream coordinate space.

https://gitlab.gnome.org/GNOME/mutter/merge_requests/413
2019-02-26 13:39:11 +00:00
Jonas Ådahl
2f01418d45 screen-cast-window: Add API to check if content has damage
https://gitlab.gnome.org/GNOME/mutter/merge_requests/413
2019-02-26 13:39:11 +00:00
Jonas Ådahl
a76107a19f screen-cast-window: Add API to transform cursor state
To be used to translate absolute cursor positions to relative positions,
as well as to determine whether a cursor sprite is inside the stream or
not. It also helps calculating the scale the cursor sprite needs to be
scaled with to be in stream coordinate space.

https://gitlab.gnome.org/GNOME/mutter/merge_requests/413
2019-02-26 13:39:11 +00:00
Jonas Ådahl
6372e3e4db clutter: Add clutter_actor_has_damage() API
Will be used to check whether there are any damage to an actor.

https://gitlab.gnome.org/GNOME/mutter/merge_requests/413
2019-02-26 13:39:11 +00:00
Jonas Ådahl
c80ba819e7 screen-cast-window-src: Keep a screen cast window instead of an actor
Practically it's the same object, but ideally, we should not deal
with "actors" anywhere here.

https://gitlab.gnome.org/GNOME/mutter/merge_requests/413
2019-02-26 13:39:11 +00:00
Jonas Ådahl
14c6a347c1 screen-cast-window-src: Rename painted callback to after_paint
We'll add a before_paint soon, so better have the names somewhat match.

https://gitlab.gnome.org/GNOME/mutter/merge_requests/413
2019-02-26 13:39:11 +00:00
Jonas Ådahl
11bd847896 screen-cast-window-stream: Don't set the position property
It was not meant to be set for window streams, and was set to (0, 0)
anyway. This removes the corresponding MetaScreenCastWindow API, as it's
not needed anymore.

https://gitlab.gnome.org/GNOME/mutter/merge_requests/413
2019-02-26 13:39:11 +00:00
Jonas Ådahl
870f38542d screen-cast-window-stream: Set the size property to the logical size
As the stream size is the logical monitor size multiplied with the ceil
of the logical monitor scale, the corresponding logical size, which is
what should be passed via the size property on the D-Bus object, should
be the logical monitor size.

https://gitlab.gnome.org/GNOME/mutter/merge_requests/413
2019-02-26 13:39:11 +00:00
Jonas Ådahl
c22edeff1f screen-cast-window-stream: Use initable to initialize
Move the initialization from _new() to an initable implementation. This
will allow us to initialize fields before MetaScreenCastStream
initializes.

https://gitlab.gnome.org/GNOME/mutter/merge_requests/413
2019-02-26 13:39:11 +00:00
Jonas Ådahl
183de60d91 screen-cast-src: Move back MetaSpaType to C file
It's not needed by the monitor source anymore.

https://gitlab.gnome.org/GNOME/mutter/merge_requests/413
2019-02-26 13:39:11 +00:00
Jonas Ådahl
176b508029 screen-cast-src: Change offscreen cursor helper to take a uint8_t *
Instead of a `uint32_t *`. Eventually we shouldn't assume pixels are
always 32 bit, and this gets rid of some casts while at it.

https://gitlab.gnome.org/GNOME/mutter/merge_requests/413
2019-02-26 13:39:11 +00:00
Jonas Ådahl
9be189daa7 screen-cast: Move cursor metadata setting to generic source
Make the monitor implementation do things strictly related to its own
source type, leaving the Spa related logic and cursor read back in the
generic layer, later to be reused by the window source type
implementation.

https://gitlab.gnome.org/GNOME/mutter/merge_requests/413
2019-02-26 13:39:11 +00:00
Carlos Garnacho
bf12a2497b clutter: Make docs match with signal description
Makes gobject-introspection happy again.

Pointed out by Robert Mader at:
https://gitlab.gnome.org/GNOME/mutter/merge_requests/196
2019-02-25 20:12:21 +01:00
Carlos Garnacho
55d168d01a clutter: Add ClutterPaintVolume argument to ClutterActor::queue_redraw
This is an ABI break, hopefully an unimportant one since this signal/vmethod
is barely overridden.

The signal has been added an extra ClutterPaintVolume argument, and has been
given a boolean return value. The recursion to the parents has been taken
out of the default implementation and into the caller, using the returned
boolean parameter to control further propagation.

Passing the ClutterPaintVolume is easier on performance, as we don't need
setting this pointer as gobject data just to retrieve/unset it further
in propagation.

https://bugzilla.gnome.org/show_bug.cgi?id=782344
2019-02-25 18:17:34 +00:00
Carlos Garnacho
8a9a78ec8a wayland: Check whether Xwayland window had a prior surface in generic code
Since commit 8df2a1452c (As pointed out by Robert Mader) we just happened
do this check when doing the first lookup for a Wayland surface for a
XWayland window, when we are later notifying upon surface creation we just
set the relation with no further checks.

The cases pointed out in the comment (eg. window changing decoration) might
presumably happen in a quick enough sequence that we have two scheduled
associations on the fly, so move this check to the more generic
meta_xwayland_associate_window_with_surface() which is called on both
immediate and delayed paths.

https://gitlab.gnome.org/GNOME/mutter/issues/361
2019-02-25 17:53:52 +00:00
Robert Mader
803ffc19a4 shaped-texture: Clean-up deprecated NPOT check
There are most likely no GNOME users left still using hardware that
does not support NPOT textures. Further more, they would crash much
earlier and never hit this code-path. So remove the unnecessary check
here.

https://gitlab.gnome.org/GNOME/mutter/merge_requests/447
2019-02-25 17:51:48 +01:00
Robert Mader
ddd2ce3a88 wayland/buffer: Fall back to CoglTexture2DSliced
XWayland creates buffers of the combined size of all connected displays.
This can, especially on older but still in use hardware, exceed the limits
of the GPU.

If that is the case, use `CoglTexture2DSliced` instead of `CoglTexture2D`

https://gitlab.gnome.org/GNOME/mutter/merge_requests/447
2019-02-25 17:51:44 +01:00
Jonas Ådahl
979e689278 renderer/native: Retry page flip after one vsync if EBUSY
We might fail to page flip a new buffer, often after resuming, due to
the FIFO being full. Prior to this commit, we handled this by switching
over to plain mode setting instead of page flipping. This is bad because
we won't be synchronized to the refresh rate anymore, but just the
clock.

Instead, deal with this by trying again until the FIFO is no longer
full. Do this on a v-sync based interval, until it works.

This also changes the error handling code for drivers not supporting
page flipping to rely on them returning -EINVAL. The handling is moved
from pretending a page flip working to explicit mode setting in
meta-renderer-native.c.

Fixes: https://gitlab.gnome.org/GNOME/mutter/issues/460
2019-02-25 15:48:29 +00:00
Jonas Ådahl
2c1ab8b3cc renderer/native: Remove legacy non-stage-view code
A renderer view will, under the native backend, since long ago always
have a logical monitor associated with it, so remove the code handling
the legacy non-stage view case.

https://gitlab.gnome.org/GNOME/mutter/issues/460
2019-02-25 15:48:29 +00:00
Jonas Ådahl
252e64a0ea wayland: Move surface texture ownership to MetaWaylandSurface
Prior to this commit, MetaWaylandSurface held a reference to
MetaWaylandBuffer, who owned the texture drawn by the surface. When
switching buffer, the texture change with it.

This is problematic when dealing with SHM buffer damage management, as
when having one texture per buffer, damaged regions uploaded to one,
will not follow along to the next one attached. It also wasted GPU
memory as there would be one texture per buffer, instead of one one
texture per surface.

Instead, move the texture ownership to MetaWaylandSurface, and have the
SHM buffer damage management update the surface texture. This ensures
damage is processed properly, and that we won't end up with stale
texture content when doing partial texture uploads. If the same SHM
buffer is attached to multiple surfaces, each surface will get their own
copy, and damage is tracked and uploaded separately.

Non-SHM types of buffers still has their own texture reference, as the
texture is just a representation of the GPU memory associated with the
buffer. When such a buffer is attached to a surface, instead the surface
just gets a reference to that texture, instead of a separately allocated
one.

Fixes: https://gitlab.gnome.org/GNOME/mutter/issues/199
2019-02-25 15:35:38 +00:00
Jonas Ådahl
d2f1edd6c6 wayland/surface: Process damage also for non-actor surfaces
The texture still needs to be updated with damaged content.

https://gitlab.gnome.org/GNOME/mutter/issues/199
2019-02-25 15:35:38 +00:00
Jonas Ådahl
944a4763f6 cursor-renderer/native: Clear active CRTC gbm_bo when destroyed
When we freed the cursor GPU state including the gbm_bo objects attached
to it, we didn't unset the cursor renderer private of the CRTCs of the
associated GPU. This means that HW cursor invalidation could potentially
break if a new gbm_bo happened to be allocated at the same memory
address as the previous one.

To avoid this, iterate through the CRTCs of the GPU of which the cursor
data is freed, and unset the cursor renderer private if it was the one
destroyed.

https://gitlab.gnome.org/GNOME/mutter/issues/199
2019-02-25 15:35:38 +00:00
Jonas Ådahl
22a296f971 wayland/dma-buf: Don't use API meant for MetaWaylandSurface internally
What was actually done when calling meta_wayland_buffer_attach() was
that the texture was realized, so just call the function
`meta_wayland_dma_buf_realize_texture()` and call that.

This is in preparation to change how meta_wayland_buffer_attach() work.

https://gitlab.gnome.org/GNOME/mutter/issues/199
2019-02-25 15:35:38 +00:00
Benjamin Berg
ef2153739c idle-monitor: Fix duplicate return value of ResetIdletime call
The signal handler must return TRUE as the invocation is already handled
by returning an error. Also update the error message a bit to clarify
that the API exists only for testing purposes.

https://gitlab.gnome.org/GNOME/mutter/merge_requests/457
2019-02-25 14:42:03 +00:00
Milo Casagrande
9e1c8e2c22 Update Italian translation 2019-02-22 11:07:11 +00:00
Florian Müllner
fca0e6abb1 Bump version to 3.31.91
Update NEWS.
2019-02-21 19:45:43 +01:00
Emilio Pozuelo Monfort
6975c8b424 monitor-config-manager: respect other outputs' CRTC
We should not only take the old CRTC for an output whenever
possible, but we should also assign one that is 'free', i.e.
one that another monitor (to be processed after this one)
isn't using, so that that monitor can use the same CRTC.

https://gitlab.gnome.org/GNOME/mutter/issues/373
2019-02-21 17:23:38 +02:00
Emilio Pozuelo Monfort
f4f823f238 monitor-config-manager: reuse old CRTC when possible
We shouldn't change an output's CRTC if we don't have to, as
that causes the output to go black.

This patch depends on
"monitor-unit-tests: initial crtcs in custom_lid_switch".

https://gitlab.gnome.org/GNOME/mutter/issues/373
2019-02-21 17:23:38 +02:00
Pekka Paalanen
1c67260bd4 monitor-unit-tests: initial crtcs in custom_lid_switch
This test forgot to specify the existing CRTC routings in the setup. For the
first output the default 0 was ok, now it is -1 to ensure that the code will
assign it correctly. For the second output the default 0 was incorrect, because
possible_crtcs does not include 0.  Now that CRTC is initialized to off
instead, because the second output is hotplugged later and running a CRTC
without an output does not make sense.

This fix will keep this test passing when a future patch attempts to preserve
existing CRTC routings. Assuming that any existing routing is valid, such
routing will be kept. In this test case the existing routing was illegal, it
should have been impossible, which then causes that future patch to fail the
test by assigning the wrong CRTC.

https://gitlab.gnome.org/GNOME/mutter/issues/373
2019-02-21 17:22:12 +02:00
Olivier Fourdan
79f90c147c MetaPluginManager: Don't return void value
The spec for `meta_plugin_manager_confirm_display_change()` is to return
`void`, no need to return a value there.

https://gitlab.gnome.org/GNOME/mutter/merge_requests/456
2019-02-21 09:31:15 +01:00
Rafael Fontenelle
4e751a3b58 Update Brazilian Portuguese translation 2019-02-21 01:12:00 +00:00
Andrea Azzarone
1c2e8fcf06 keybinding: Store flags in MetaKeyGrab
The external grab handler is shared across all external bindings and external
bindings have now different binding flags. For this reason, when rebuilding the
binding table there could be loss of information if we assign the bindings flags
of the external handler to all external bindings. Let's store the bindings flags
in MetaKeyGrab too and use this when rebuilding the binding table to avoid the
above issue.

https://gitlab.gnome.org/GNOME/mutter/merge_requests/169
2019-02-20 14:36:24 +00:00
Andrea Azzarone
00ca387ec7 keybindings: Add flag param to grab_accelerator
Add a 'flags' parameters to meta_display_grab_accelerator. This will allow
e.g. gnome-settings-daemon (through the gnome-shell's GrabAccelerator API) to
create shorcuts that should descard auto-repeated key events.

https://gitlab.gnome.org/GNOME/mutter/merge_requests/169

Closes: https://gitlab.gnome.org/GNOME/gnome-settings-daemon/issues/68
2019-02-20 14:36:24 +00:00
Daniel Mustieles
5688f1cf6e Updated Spanish translation 2019-02-20 15:34:11 +01:00
Olivier Fourdan
7bd668e6d0 window: Do not restore shortcuts on a NULL window
The "force restore shortcuts" being triggered by a key-combo, there is
no guarantee that the currently focused window is actually non-NULL in
which case we would crash.

Make sure there is a window currently focused before trying to restore
the shortcuts on that window.

Closes: https://gitlab.gnome.org/GNOME/mutter/issues/464
2019-02-18 11:23:59 +01:00
Yi-Jyun Pan
1dc602e289 Update Chinese (Taiwan) translation 2019-02-17 16:23:32 +00:00
Baurzhan Muftakhidinov
ec518c4f24 Update Kazakh translation 2019-02-17 07:40:18 +00:00
Adam Jackson
0d9295523e clutter: Remove deprecate/clutter-frame-source.h
https://gitlab.gnome.org/GNOME/mutter/merge_requests/445
2019-02-15 23:01:01 +00:00
Adam Jackson
a4443885a3 clutter: Remove deprecated/clutter-timeout-pool.h
https://gitlab.gnome.org/GNOME/mutter/merge_requests/445
2019-02-15 23:01:01 +00:00
Adam Jackson
ef8f2876e3 clutter: Remove deprecated/clutter-backend.h
https://gitlab.gnome.org/GNOME/mutter/merge_requests/445
2019-02-15 23:01:01 +00:00
Adam Jackson
75071aba68 clutter: Remove deprecated/clutter-util.h
https://gitlab.gnome.org/GNOME/mutter/merge_requests/445
2019-02-15 23:01:01 +00:00
Niels De Graef
a81435ab5f cogl: Remove CoglBool, use gboolean instead
This basically reverts commit 54735dec, which tried to avoid the
GLib-defined types in favor the standard C ones. One exception to this
is the bool type, for which the commit introduces a new type CoglBool.

Let's just get rid of this type in favor of having consistency with the
GLib types. Note by the way that neither CoglBool nor gboolean (which
has a size of `int`) are completely compatible with bool (size `char`).

https://gitlab.gnome.org/GNOME/mutter/merge_requests/321
2019-02-15 16:35:46 +01:00
Olivier Fourdan
6fe46cac60 wayland/xdg-shell: Do not maximize if not possible
On X11, if a window cannot be maximized because its minimum size is
already larger than the output size, a request to maximize will be
ignored.

On Wayland, however, we would still honor the maximize request and
switch the window state to maximized, without actually moving the window
which leads to weird visual effects, as the window end up being
maximized in-place.

To avoid this, make sure the window has the maximize functionality
available prior to change its state in xdg-shell `set_maximized`
request.

Closes: https://gitlab.gnome.org/GNOME/mutter/issues/463
2019-02-15 09:40:44 +01:00
Niels De Graef
c3b9ef7bf5 gpu: Remove unimplemented ::get_kms_file_path()
https://gitlab.gnome.org/GNOME/mutter/merge_requests/444
2019-02-15 09:17:07 +01:00
Jonas Ådahl
b70c0eb9a5 gitlab-ci.yml: Add check for issue or MR URL
This adds a pipeline stage for merge requests that checks that the
commit message contains an URL to either a issue or a merge request.
This means that for merge requests without corresponding issues will
always fail initially, as the merge request URL is not known until after
it is created. This is still arguably better than accidentally merging
merge requests without URLs.

https://gitlab.gnome.org/GNOME/mutter/merge_requests/440
2019-02-14 17:10:32 +01:00
Jonas Ådahl
f3dd97e67b README: Add contribution section
Short and incomplete blurb about coding style and commit message
guidelines.

https://gitlab.gnome.org/GNOME/mutter/merge_requests/440
2019-02-14 15:38:46 +01:00
Marco Trevisan (Treviño)
77fb0a0003 window-actor: Remove public declaration for get_x_window
meta_window_actor_get_x_window has been removed in commit 422648e2 but has not
been removed from the header for ages.

https://gitlab.gnome.org/GNOME/mutter/merge_requests/439
2019-02-14 13:09:20 +00:00
Marco Trevisan (Treviño)
58d2a674c4 window: Return focusable ability looking at properties only
As per commit 43633d6b, we mark an unmanaging window as not focusable, while
this is true, it might cause not resetting the current focused window when
unmanaging it causing a crash.

Also this wouldn't allow to check if a window can be focused when unmanaging it,
so let's revert the previous behavior.

Fixes: https://gitlab.gnome.org/GNOME/mutter/issues/462
2019-02-14 13:49:51 +01:00
Carlos Garnacho
9e2ed4104d wayland: Reset text-input state after commit
This was wrongly done just before enable, which is not right as
per the protocol. A side effect was that input purpose/hints were
eagerly reset before being applied, thus not properly honored,
noticed in the doing of emoji/numeric OSK panels.

https://gitlab.gnome.org/GNOME/mutter/merge_requests/410
2019-02-14 11:23:07 +01:00
Alan Mortensen
3f9b4a1ab5 Updated Danish translation 2019-02-13 18:50:51 +01:00
Daniel Șerbănescu
2aa0ec004a Update Romanian translation 2019-02-13 15:02:51 +00:00
Marco Trevisan (Treviño)
f798912cbd window: Move can_ping to a function and implement in X11
https://gitlab.gnome.org/GNOME/mutter/merge_requests/421
2019-02-13 02:07:41 +00:00
Marco Trevisan (Treviño)
3bf80a967c window-x11: Move delete_window to MetaWindowX11Private
https://gitlab.gnome.org/GNOME/mutter/merge_requests/421
2019-02-13 02:07:41 +00:00
Marco Trevisan (Treviño)
6c3b0cfc36 window-x11: Move take_focus to MetaWindowX11Private
https://gitlab.gnome.org/GNOME/mutter/merge_requests/421
2019-02-13 02:07:41 +00:00
Marco Trevisan (Treviño)
43633d6b2f window: Add is_focusable class method
Implement is_focusable for both x11 and wayland and just use this check
so that we can abstract things more and be less dependent on window backend.

https://gitlab.gnome.org/GNOME/mutter/merge_requests/421
2019-02-13 02:07:41 +00:00
Marek Cernocky
fdd531f307 Updated Czech translation 2019-02-12 14:23:15 +01:00
Matej Urbančič
70c45f8941 Updated Slovenian translation 2019-02-12 12:35:34 +01:00
Niels De Graef
b82fa2c610 meta-launcher: g_propagate_*_error takes ownership
This means we need to make sure we don't accidentally free the provided
source GError (which automatically happens with `g_autoptr`), so use
`g_steal_pointer()`.

This fixes an issue where, when launched in a bubblewrap environment
(such as the one provided by Buildstream), mutter would give the
following warning message:

```
mutter-WARNING **: 8:31:35:069: Can't initialize KMS backend: (null)
```

... which isn't that useful when trying to debug the actual issue.
2019-02-12 09:41:04 +01:00
Marco Trevisan (Treviño)
eaacbb3289 gitlab-ci: Don't upload test artifacts
There's no need to upload test artifacts since they don't produce anything
that we care about so far, while this phase slows down the pipeline execution.

https://gitlab.gnome.org/GNOME/mutter/merge_requests/436
2019-02-11 16:31:10 +01:00
Marco Trevisan (Treviño)
54fdd633fe input-mapper: Use g_auto to free a string array
https://gitlab.gnome.org/GNOME/mutter/merge_requests/435
2019-02-11 15:42:16 +01:00
Marco Trevisan (Treviño)
29ed84e921 input-mapper: Don't loop infinitely in EDID matching
Iterate over all the monitor product words to check for a partial matching on
EDID, otherwise we would hang inside an infinite while loop.

Fixes https://gitlab.gnome.org/GNOME/mutter/issues/459
2019-02-11 15:42:16 +01:00
Anders Jonsson
d587fc1ef4 Update Swedish translation 2019-02-09 21:16:02 +00:00
Aurimas Černius
285d717ceb Updated Lithuanian translation 2019-02-09 22:55:38 +02:00
Emin Tufan Çetin
616a149917 Update Turkish translation 2019-02-09 20:14:51 +00:00
Fran Dieguez
f578c4daaa Update Galician translation 2019-02-09 15:34:22 +00:00
Claude Paroz
830495b7c6 Updated French translation 2019-02-09 12:21:14 +01:00
Charles Monzat
4d02f68057 Update French translation
Cherry-pick 28d2d54189 from gnome-3-30 branch.
2019-02-09 12:18:05 +01:00
Jiri Grönroos
31c5a0009f Update Finnish translation 2019-02-09 09:03:39 +00:00
365 changed files with 4170 additions and 10350 deletions

View File

@@ -1,9 +1,17 @@
image: registry.gitlab.gnome.org/gnome/mutter/master:v1
stages:
- review
- build
- test
check-commit-log:
stage: review
script:
- ./.gitlab-ci/check-commit-log.sh
only:
- merge_requests
build-mutter:
stage: build
script:
@@ -14,14 +22,14 @@ build-mutter:
expire_in: 1 day
paths:
- build
only:
- merge_requests
- /^.*$/
test-mutter:
stage: test
dependencies:
- build-mutter
artifacts:
paths:
- build
variables:
XDG_RUNTIME_DIR: "$CI_PROJECT_DIR/runtime-dir"
GSETTINGS_SCHEMA_DIR: "$CI_PROJECT_DIR/build/data"
@@ -31,3 +39,6 @@ test-mutter:
- >
dbus-run-session -- xvfb-run -s '+iglx -noreset'
meson test -C build --no-rebuild -t 10 --verbose --no-stdsplit --wrap catchsegv
only:
- merge_requests
- /^.*$/

31
.gitlab-ci/check-commit-log.sh Executable file
View File

@@ -0,0 +1,31 @@
#!/usr/bin/env bash
if [ -z "$CI_MERGE_REQUEST_TARGET_BRANCH_NAME" ]; then
echo Cannot review non-merge request
exit 1
fi
git fetch $CI_MERGE_REQUEST_PROJECT_URL.git $CI_MERGE_REQUEST_TARGET_BRANCH_NAME
branch_point=$(git merge-base HEAD FETCH_HEAD)
commits=$(git log --format='format:%H' $branch_point..$CI_COMMIT_SHA)
if [ -z "$commits" ]; then
echo Commit range empty
exit 1
fi
function commit_message_has_url() {
commit=$1
commit_message=$(git show -s --format='format:%b' $commit)
echo "$commit_message" | grep -qe "\($CI_MERGE_REQUEST_PROJECT_URL/\(issues\|merge_requests\)/[0-9]\+\|https://bugzilla.gnome.org/show_bug.cgi?id=[0-9]\+\)"
return $?
}
for commit in $commits; do
if ! commit_message_has_url $commit; then
echo "Missing merge request or issue URL on commit $(echo $commit | cut -c -8)"
exit 1
fi
done

23
NEWS
View File

@@ -1,3 +1,26 @@
3.31.91
=======
* Fix infinite loop in EDID matching [Marco; #459]
* wayland: Don't resetin text-input state prematurely [Carlos; !410]
* wayland: Don't maximize windows if minimum size is too big [Olivier; #463]
* Fix crash when using "restore shortcuts" without focus window [Olivier; #464]
* Add flag parameter to grab accelerator API [Andrea; !169]
* Reuse old CRTC if possible to avoid flicker on hotplug [Pekka, Emilio; #373]
* Misc. bug fixes and cleanups [Marco, Jonas, Niels, Adam, Olivier; !436,
!421, #462, !439, !440, !444, !321, !445, !456]
Contributors:
Jonas Ådahl, Andrea Azzarone, Olivier Fourdan, Carlos Garnacho,
Niels De Graef, Adam Jackson, Emilio Pozuelo Monfort, Pekka Paalanen,
Marco Trevisan (Treviño)
Translators:
Jiri Grönroos [fi], Charles Monzat [fr], Claude Paroz [fr], Fran Dieguez [gl],
Emin Tufan Çetin [tr], Aurimas Černius [lt], Anders Jonsson [sv],
Matej Urbančič [sl], Marek Cernocky [cs], Daniel Șerbănescu [ro],
Alan Mortensen [da], Baurzhan Muftakhidinov [kk], Yi-Jyun Pan [zh_TW],
Daniel Mustieles [es], Rafael Fontenelle [pt_BR]
3.31.90
=======
* Fix support of extended characters in on-screen keyboard [Andrea; #109]

View File

@@ -22,6 +22,20 @@ by Gala, elementary OS's window manager. It can also be run standalone, using
the command "mutter", but just running plain mutter is only intended for
debugging purposes.
## Contributing
To contribute, open merge requests at https://gitlab.gnome.org/GNOME/mutter.
The coding style used is primarily the GNU flavor of the [GNOME coding
style](https://developer.gnome.org/programming-guidelines/stable/c-coding-style.html.en)
with some minor additions such as preferring `stdint.h` types over GLib
fundamental types, and a soft 80 character line limit. However, in general,
look at the file you're editing for inspiration.
Commit messages should follow the [GNOME commit message
guidelines](https://wiki.gnome.org/Git/CommitMessages). We require an URL
to either an issue or a merge request in each commit.
## License
Mutter is distributed under the terms of the GNU General Public License,

View File

@@ -283,9 +283,6 @@ void _clutter_actor_queue_redraw_full
const ClutterPaintVolume *volume,
ClutterEffect *effect);
ClutterPaintVolume * _clutter_actor_get_queue_redraw_clip (ClutterActor *self);
void _clutter_actor_set_queue_redraw_clip (ClutterActor *self,
ClutterPaintVolume *clip_volume);
void _clutter_actor_finish_queue_redraw (ClutterActor *self,
ClutterPaintVolume *clip);

View File

@@ -635,6 +635,7 @@
#include "clutter-interval.h"
#include "clutter-main.h"
#include "clutter-marshal.h"
#include "clutter-mutter.h"
#include "clutter-paint-nodes.h"
#include "clutter-paint-node-private.h"
#include "clutter-paint-volume-private.h"
@@ -1022,7 +1023,7 @@ typedef struct _TransitionClosure
static void clutter_container_iface_init (ClutterContainerIface *iface);
static void clutter_scriptable_iface_init (ClutterScriptableIface *iface);
static void clutter_animatable_iface_init (ClutterAnimatableIface *iface);
static void clutter_animatable_iface_init (ClutterAnimatableInterface *iface);
static void atk_implementor_iface_init (AtkImplementorIface *iface);
/* These setters are all static for now, maybe they should be in the
@@ -1108,7 +1109,6 @@ static void clutter_actor_pop_in_cloned_branch (ClutterActor *self,
{ _transform; } \
cogl_matrix_translate ((m), -_tx, -_ty, -_tz); } G_STMT_END
static GQuark quark_shader_data = 0;
static GQuark quark_actor_layout_info = 0;
static GQuark quark_actor_transform_info = 0;
static GQuark quark_actor_animation_info = 0;
@@ -2689,9 +2689,12 @@ clutter_actor_real_allocate (ClutterActor *self,
}
static void
_clutter_actor_signal_queue_redraw (ClutterActor *self,
ClutterActor *origin)
_clutter_actor_propagate_queue_redraw (ClutterActor *self,
ClutterActor *origin,
ClutterPaintVolume *pv)
{
gboolean stop = FALSE;
/* no point in queuing a redraw on a destroyed actor */
if (CLUTTER_ACTOR_IN_DESTRUCTION (self))
return;
@@ -2700,27 +2703,33 @@ _clutter_actor_signal_queue_redraw (ClutterActor *self,
* the actor bas been cloned. In this case the clone will need to
* receive the signal so it can queue its own redraw.
*/
while (self)
{
_clutter_actor_queue_redraw_on_clones (self);
_clutter_actor_queue_redraw_on_clones (self);
/* calls klass->queue_redraw in default handler */
if (g_signal_has_handler_pending (self, actor_signals[QUEUE_REDRAW],
/* calls klass->queue_redraw in default handler */
if (g_signal_has_handler_pending (self, actor_signals[QUEUE_REDRAW],
0, TRUE))
{
g_signal_emit (self, actor_signals[QUEUE_REDRAW], 0, origin);
}
else
{
CLUTTER_ACTOR_GET_CLASS (self)->queue_redraw (self, origin);
{
g_signal_emit (self, actor_signals[QUEUE_REDRAW], 0, origin, pv, &stop);
}
else
{
stop = CLUTTER_ACTOR_GET_CLASS (self)->queue_redraw (self, origin, pv);
}
if (stop)
break;
self = clutter_actor_get_parent (self);
}
}
static void
clutter_actor_real_queue_redraw (ClutterActor *self,
ClutterActor *origin)
static gboolean
clutter_actor_real_queue_redraw (ClutterActor *self,
ClutterActor *origin,
ClutterPaintVolume *paint_volume)
{
ClutterActor *parent;
CLUTTER_NOTE (PAINT, "Redraw queued on '%s' (from: '%s')",
_clutter_actor_get_debug_name (self),
origin != NULL ? _clutter_actor_get_debug_name (origin)
@@ -2728,7 +2737,7 @@ clutter_actor_real_queue_redraw (ClutterActor *self,
/* no point in queuing a redraw on a destroyed actor */
if (CLUTTER_ACTOR_IN_DESTRUCTION (self))
return;
return TRUE;
/* If the queue redraw is coming from a child then the actor has
become dirty and any queued effect is no longer valid */
@@ -2743,7 +2752,7 @@ clutter_actor_real_queue_redraw (ClutterActor *self,
* won't change so we don't have to propagate up the hierarchy.
*/
if (!CLUTTER_ACTOR_IS_VISIBLE (self))
return;
return TRUE;
/* Although we could determine here that a full stage redraw
* has already been queued and immediately bail out, we actually
@@ -2757,7 +2766,7 @@ clutter_actor_real_queue_redraw (ClutterActor *self,
ClutterActor *stage = _clutter_actor_get_stage_internal (self);
if (stage != NULL &&
_clutter_stage_has_full_redraw_queued (CLUTTER_STAGE (stage)))
return;
return TRUE;
}
self->priv->propagated_one_redraw = TRUE;
@@ -2765,12 +2774,7 @@ clutter_actor_real_queue_redraw (ClutterActor *self,
/* notify parents, if they are all visible eventually we'll
* queue redraw on the stage, which queues the redraw idle.
*/
parent = clutter_actor_get_parent (self);
if (parent != NULL)
{
/* this will go up recursively */
_clutter_actor_signal_queue_redraw (parent, origin);
}
return FALSE;
}
static void
@@ -3561,12 +3565,6 @@ _clutter_actor_update_last_paint_volume (ClutterActor *self)
priv->last_paint_volume_valid = TRUE;
}
static inline gboolean
actor_has_shader_data (ClutterActor *self)
{
return g_object_get_qdata (G_OBJECT (self), quark_shader_data) != NULL;
}
guint32
_clutter_actor_get_pick_id (ClutterActor *self)
{
@@ -3808,7 +3806,6 @@ clutter_actor_paint (ClutterActor *self)
ClutterActorPrivate *priv;
ClutterPickMode pick_mode;
gboolean clip_set = FALSE;
gboolean shader_applied = FALSE;
ClutterStage *stage;
g_return_if_fail (CLUTTER_IS_ACTOR (self));
@@ -3978,25 +3975,13 @@ clutter_actor_paint (ClutterActor *self)
}
if (priv->effects == NULL)
{
if (pick_mode == CLUTTER_PICK_NONE &&
actor_has_shader_data (self))
{
_clutter_actor_shader_pre_paint (self, FALSE);
shader_applied = TRUE;
}
priv->next_effect_to_paint = NULL;
}
priv->next_effect_to_paint = NULL;
else
priv->next_effect_to_paint =
_clutter_meta_group_peek_metas (priv->effects);
clutter_actor_continue_paint (self);
if (shader_applied)
_clutter_actor_shader_post_paint (self);
if (G_UNLIKELY (clutter_paint_debug_flags & CLUTTER_DEBUG_PAINT_VOLUMES &&
pick_mode == CLUTTER_PICK_NONE))
_clutter_actor_draw_paint_volume (self);
@@ -6337,7 +6322,6 @@ clutter_actor_class_init (ClutterActorClass *klass)
{
GObjectClass *object_class = G_OBJECT_CLASS (klass);
quark_shader_data = g_quark_from_static_string ("-clutter-actor-shader-data");
quark_actor_layout_info = g_quark_from_static_string ("-clutter-actor-layout-info");
quark_actor_transform_info = g_quark_from_static_string ("-clutter-actor-transform-info");
quark_actor_animation_info = g_quark_from_static_string ("-clutter-actor-animation-info");
@@ -8010,6 +7994,7 @@ clutter_actor_class_init (ClutterActorClass *klass)
* ClutterActor::queue-redraw:
* @actor: the actor we're bubbling the redraw request through
* @origin: the actor which initiated the redraw request
* @volume: paint volume to redraw
*
* The ::queue_redraw signal is emitted when clutter_actor_queue_redraw()
* is called on @origin.
@@ -8063,10 +8048,12 @@ clutter_actor_class_init (ClutterActorClass *klass)
G_SIGNAL_RUN_LAST |
G_SIGNAL_NO_HOOKS,
G_STRUCT_OFFSET (ClutterActorClass, queue_redraw),
NULL, NULL,
_clutter_marshal_VOID__OBJECT,
G_TYPE_NONE, 1,
CLUTTER_TYPE_ACTOR);
g_signal_accumulator_true_handled,
NULL,
_clutter_marshal_BOOLEAN__OBJECT_BOXED,
G_TYPE_BOOLEAN, 2,
CLUTTER_TYPE_ACTOR,
CLUTTER_TYPE_PAINT_VOLUME);
/**
* ClutterActor::queue-relayout:
@@ -8665,8 +8652,7 @@ _clutter_actor_finish_queue_redraw (ClutterActor *self,
ClutterPaintVolume *clip)
{
ClutterActorPrivate *priv = self->priv;
ClutterPaintVolume *pv;
gboolean clipped;
ClutterPaintVolume *pv = NULL;
/* Remove queue entry early in the process, otherwise a new
queue_redraw() during signal handling could put back this
@@ -8693,8 +8679,7 @@ _clutter_actor_finish_queue_redraw (ClutterActor *self,
*/
if (clip)
{
_clutter_actor_set_queue_redraw_clip (self, clip);
clipped = TRUE;
pv = clip;
}
else if (G_LIKELY (priv->last_paint_volume_valid))
{
@@ -8704,36 +8689,12 @@ _clutter_actor_finish_queue_redraw (ClutterActor *self,
ClutterActor *stage = _clutter_actor_get_stage_internal (self);
/* make sure we redraw the actors old position... */
_clutter_actor_set_queue_redraw_clip (stage,
&priv->last_paint_volume);
_clutter_actor_signal_queue_redraw (stage, stage);
_clutter_actor_set_queue_redraw_clip (stage, NULL);
/* XXX: Ideally the redraw signal would take a clip volume
* argument, but that would be an ABI break. Until we can
* break the ABI we pass the argument out-of-band
*/
/* setup the clip for the actors new position... */
_clutter_actor_set_queue_redraw_clip (self, pv);
clipped = TRUE;
_clutter_actor_propagate_queue_redraw (stage, stage,
&priv->last_paint_volume);
}
else
clipped = FALSE;
}
else
clipped = FALSE;
_clutter_actor_signal_queue_redraw (self, self);
/* Just in case anyone is manually firing redraw signals without
* using the public queue_redraw() API we are careful to ensure that
* our out-of-band clip member is cleared before returning...
*
* Note: A NULL clip denotes a full-stage, un-clipped redraw
*/
if (G_LIKELY (clipped))
_clutter_actor_set_queue_redraw_clip (self, NULL);
_clutter_actor_propagate_queue_redraw (self, self, pv);
}
static void
@@ -8893,8 +8854,7 @@ _clutter_actor_queue_redraw_full (ClutterActor *self,
{
/* NB: NULL denotes an undefined clip which will result in a
* full redraw... */
_clutter_actor_set_queue_redraw_clip (self, NULL);
_clutter_actor_signal_queue_redraw (self, self);
_clutter_actor_propagate_queue_redraw (self, self, NULL);
return;
}
@@ -15159,7 +15119,7 @@ clutter_actor_set_final_state (ClutterAnimatable *animatable,
}
static void
clutter_animatable_iface_init (ClutterAnimatableIface *iface)
clutter_animatable_iface_init (ClutterAnimatableInterface *iface)
{
iface->find_property = clutter_actor_find_property;
iface->get_initial_state = clutter_actor_get_initial_state;
@@ -16487,6 +16447,12 @@ clutter_actor_is_in_clone_paint (ClutterActor *self)
return FALSE;
}
gboolean
clutter_actor_has_damage (ClutterActor *actor)
{
return actor->priv->is_dirty;
}
static gboolean
set_direction_recursive (ClutterActor *actor,
gpointer user_data)
@@ -16704,26 +16670,6 @@ clutter_actor_has_pointer (ClutterActor *self)
return self->priv->has_pointer;
}
/* XXX: This is a workaround for not being able to break the ABI of
* the QUEUE_REDRAW signal. It is an out-of-band argument. See
* clutter_actor_queue_clipped_redraw() for details.
*/
ClutterPaintVolume *
_clutter_actor_get_queue_redraw_clip (ClutterActor *self)
{
return g_object_get_data (G_OBJECT (self),
"-clutter-actor-queue-redraw-clip");
}
void
_clutter_actor_set_queue_redraw_clip (ClutterActor *self,
ClutterPaintVolume *clip)
{
g_object_set_data (G_OBJECT (self),
"-clutter-actor-queue-redraw-clip",
clip);
}
/**
* clutter_actor_has_allocation:
* @self: a #ClutterActor

View File

@@ -236,8 +236,9 @@ struct _ClutterActorClass
void (* pick) (ClutterActor *actor,
const ClutterColor *color);
void (* queue_redraw) (ClutterActor *actor,
ClutterActor *leaf_that_queued);
gboolean (* queue_redraw) (ClutterActor *actor,
ClutterActor *leaf_that_queued,
ClutterPaintVolume *paint_volume);
/* size negotiation */
void (* get_preferred_width) (ClutterActor *self,

View File

@@ -30,7 +30,7 @@
* to control how a #ClutterAnimation will animate a property.
*
* Each #ClutterAnimatable should implement the
* #ClutterAnimatableIface.interpolate_property() virtual function of the
* #ClutterAnimatableInterface.interpolate_property() virtual function of the
* interface to compute the animation state between two values of an interval
* depending on a progress factor, expressed as a floating point value.
*
@@ -57,7 +57,6 @@
#include "deprecated/clutter-animatable.h"
#include "deprecated/clutter-animation.h"
typedef ClutterAnimatableIface ClutterAnimatableInterface;
G_DEFINE_INTERFACE (ClutterAnimatable, clutter_animatable, G_TYPE_OBJECT);
static void
@@ -101,7 +100,7 @@ clutter_animatable_animate_property (ClutterAnimatable *animatable,
gdouble progress,
GValue *value)
{
ClutterAnimatableIface *iface;
ClutterAnimatableInterface *iface;
gboolean res;
g_return_val_if_fail (CLUTTER_IS_ANIMATABLE (animatable), FALSE);
@@ -155,7 +154,7 @@ GParamSpec *
clutter_animatable_find_property (ClutterAnimatable *animatable,
const gchar *property_name)
{
ClutterAnimatableIface *iface;
ClutterAnimatableInterface *iface;
g_return_val_if_fail (CLUTTER_IS_ANIMATABLE (animatable), NULL);
g_return_val_if_fail (property_name != NULL, NULL);
@@ -185,7 +184,7 @@ clutter_animatable_get_initial_state (ClutterAnimatable *animatable,
const gchar *property_name,
GValue *value)
{
ClutterAnimatableIface *iface;
ClutterAnimatableInterface *iface;
g_return_if_fail (CLUTTER_IS_ANIMATABLE (animatable));
g_return_if_fail (property_name != NULL);
@@ -214,7 +213,7 @@ clutter_animatable_set_final_state (ClutterAnimatable *animatable,
const gchar *property_name,
const GValue *value)
{
ClutterAnimatableIface *iface;
ClutterAnimatableInterface *iface;
g_return_if_fail (CLUTTER_IS_ANIMATABLE (animatable));
g_return_if_fail (property_name != NULL);
@@ -260,7 +259,7 @@ clutter_animatable_interpolate_value (ClutterAnimatable *animatable,
gdouble progress,
GValue *value)
{
ClutterAnimatableIface *iface;
ClutterAnimatableInterface *iface;
g_return_val_if_fail (CLUTTER_IS_ANIMATABLE (animatable), FALSE);
g_return_val_if_fail (property_name != NULL, FALSE);

View File

@@ -33,24 +33,15 @@
G_BEGIN_DECLS
#define CLUTTER_TYPE_ANIMATABLE (clutter_animatable_get_type ())
#define CLUTTER_ANIMATABLE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), CLUTTER_TYPE_ANIMATABLE, ClutterAnimatable))
#define CLUTTER_IS_ANIMATABLE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), CLUTTER_TYPE_ANIMATABLE))
#define CLUTTER_ANIMATABLE_GET_IFACE(obj) (G_TYPE_INSTANCE_GET_INTERFACE ((obj), CLUTTER_TYPE_ANIMATABLE, ClutterAnimatableIface))
#define CLUTTER_TYPE_ANIMATABLE (clutter_animatable_get_type ())
typedef struct _ClutterAnimatableIface ClutterAnimatableIface;
CLUTTER_EXPORT
G_DECLARE_INTERFACE (ClutterAnimatable, clutter_animatable,
CLUTTER, ANIMATABLE,
GObject)
/**
* ClutterAnimatable:
*
* #ClutterAnimatable is an opaque structure whose members cannot be directly
* accessed
*
* Since: 1.0
*/
/**
* ClutterAnimatableIface:
* ClutterAnimatableInterface:
* @animate_property: virtual function for custom interpolation of a
* property. This virtual function is deprecated
* @find_property: virtual function for retrieving the #GParamSpec of
@@ -67,7 +58,7 @@ typedef struct _ClutterAnimatableIface ClutterAnimatableIface;
*
* Since: 1.0
*/
struct _ClutterAnimatableIface
struct _ClutterAnimatableInterface
{
/*< private >*/
GTypeInterface parent_iface;
@@ -95,9 +86,6 @@ struct _ClutterAnimatableIface
GValue *value);
};
CLUTTER_EXPORT
GType clutter_animatable_get_type (void) G_GNUC_CONST;
CLUTTER_EXPORT
GParamSpec *clutter_animatable_find_property (ClutterAnimatable *animatable,
const gchar *property_name);

View File

@@ -34,7 +34,6 @@ G_DEFINE_AUTOPTR_CLEANUP_FUNC (ClutterAction, g_object_unref)
G_DEFINE_AUTOPTR_CLEANUP_FUNC (ClutterActor, g_object_unref)
G_DEFINE_AUTOPTR_CLEANUP_FUNC (ClutterActorMeta, g_object_unref)
G_DEFINE_AUTOPTR_CLEANUP_FUNC (ClutterAlignConstraint, g_object_unref)
G_DEFINE_AUTOPTR_CLEANUP_FUNC (ClutterAnimatable, g_object_unref)
G_DEFINE_AUTOPTR_CLEANUP_FUNC (ClutterBackend, g_object_unref)
G_DEFINE_AUTOPTR_CLEANUP_FUNC (ClutterBindConstraint, g_object_unref)
G_DEFINE_AUTOPTR_CLEANUP_FUNC (ClutterBindingPool, g_object_unref)
@@ -49,7 +48,6 @@ G_DEFINE_AUTOPTR_CLEANUP_FUNC (ClutterClone, g_object_unref)
G_DEFINE_AUTOPTR_CLEANUP_FUNC (ClutterColorizeEffect, g_object_unref)
G_DEFINE_AUTOPTR_CLEANUP_FUNC (ClutterConstraint, g_object_unref)
G_DEFINE_AUTOPTR_CLEANUP_FUNC (ClutterContainer, g_object_unref)
G_DEFINE_AUTOPTR_CLEANUP_FUNC (ClutterContent, g_object_unref)
G_DEFINE_AUTOPTR_CLEANUP_FUNC (ClutterDeformEffect, g_object_unref)
G_DEFINE_AUTOPTR_CLEANUP_FUNC (ClutterDesaturateEffect, g_object_unref)
G_DEFINE_AUTOPTR_CLEANUP_FUNC (ClutterDeviceManager, g_object_unref)

View File

@@ -53,9 +53,6 @@
#include "clutter-stage-window.h"
#include "clutter-device-manager-private.h"
#define CLUTTER_DISABLE_DEPRECATION_WARNINGS
#include "deprecated/clutter-backend.h"
#ifdef CLUTTER_HAS_WAYLAND_COMPOSITOR_SUPPORT
#include "wayland/clutter-wayland-compositor.h"
#endif
@@ -903,129 +900,6 @@ clutter_get_default_backend (void)
return clutter_context->backend;
}
/**
* clutter_backend_set_double_click_time:
* @backend: a #ClutterBackend
* @msec: milliseconds between two button press events
*
* Sets the maximum time between two button press events, used to
* verify whether it's a double click event or not.
*
* Since: 0.4
*
* Deprecated: 1.4: Use #ClutterSettings:double-click-time instead
*/
void
clutter_backend_set_double_click_time (ClutterBackend *backend,
guint msec)
{
ClutterSettings *settings = clutter_settings_get_default ();
g_object_set (settings, "double-click-time", msec, NULL);
}
/**
* clutter_backend_get_double_click_time:
* @backend: a #ClutterBackend
*
* Gets the maximum time between two button press events, as set
* by clutter_backend_set_double_click_time().
*
* Return value: a time in milliseconds
*
* Since: 0.4
*
* Deprecated: 1.4: Use #ClutterSettings:double-click-time instead
*/
guint
clutter_backend_get_double_click_time (ClutterBackend *backend)
{
ClutterSettings *settings = clutter_settings_get_default ();
gint retval;
g_object_get (settings, "double-click-time", &retval, NULL);
return retval;
}
/**
* clutter_backend_set_double_click_distance:
* @backend: a #ClutterBackend
* @distance: a distance, in pixels
*
* Sets the maximum distance used to verify a double click event.
*
* Since: 0.4
*
* Deprecated: 1.4: Use #ClutterSettings:double-click-distance instead
*/
void
clutter_backend_set_double_click_distance (ClutterBackend *backend,
guint distance)
{
ClutterSettings *settings = clutter_settings_get_default ();
g_object_set (settings, "double-click-distance", distance, NULL);
}
/**
* clutter_backend_get_double_click_distance:
* @backend: a #ClutterBackend
*
* Retrieves the distance used to verify a double click event
*
* Return value: a distance, in pixels.
*
* Since: 0.4
*
* Deprecated: 1.4: Use #ClutterSettings:double-click-distance instead
*/
guint
clutter_backend_get_double_click_distance (ClutterBackend *backend)
{
ClutterSettings *settings = clutter_settings_get_default ();
gint retval;
g_object_get (settings, "double-click-distance", &retval, NULL);
return retval;
}
/**
* clutter_backend_set_resolution:
* @backend: a #ClutterBackend
* @dpi: the resolution in "dots per inch" (Physical inches aren't
* actually involved; the terminology is conventional).
*
* Sets the resolution for font handling on the screen. This is a
* scale factor between points specified in a #PangoFontDescription
* and cairo units. The default value is 96, meaning that a 10 point
* font will be 13 units high. (10 * 96. / 72. = 13.3).
*
* Applications should never need to call this function.
*
* Since: 0.4
*
* Deprecated: 1.4: Use #ClutterSettings:font-dpi instead
*/
void
clutter_backend_set_resolution (ClutterBackend *backend,
gdouble dpi)
{
ClutterSettings *settings;
gint resolution;
g_return_if_fail (CLUTTER_IS_BACKEND (backend));
if (dpi < 0)
resolution = -1;
else
resolution = dpi * 1024;
settings = clutter_settings_get_default ();
g_object_set (settings, "font-dpi", resolution, NULL);
}
/**
* clutter_backend_get_resolution:
* @backend: a #ClutterBackend
@@ -1131,61 +1005,6 @@ clutter_backend_get_font_options (ClutterBackend *backend)
return backend->font_options;
}
/**
* clutter_backend_set_font_name:
* @backend: a #ClutterBackend
* @font_name: the name of the font
*
* Sets the default font to be used by Clutter. The @font_name string
* must either be %NULL, which means that the font name from the
* default #ClutterBackend will be used; or be something that can
* be parsed by the pango_font_description_from_string() function.
*
* Since: 1.0
*
* Deprecated: 1.4: Use #ClutterSettings:font-name instead
*/
void
clutter_backend_set_font_name (ClutterBackend *backend,
const gchar *font_name)
{
ClutterSettings *settings = clutter_settings_get_default ();
g_object_set (settings, "font-name", font_name, NULL);
}
/**
* clutter_backend_get_font_name:
* @backend: a #ClutterBackend
*
* Retrieves the default font name as set by
* clutter_backend_set_font_name().
*
* Return value: the font name for the backend. The returned string is
* owned by the #ClutterBackend and should never be modified or freed
*
* Since: 1.0
*
* Deprecated: 1.4: Use #ClutterSettings:font-name instead
*/
const gchar *
clutter_backend_get_font_name (ClutterBackend *backend)
{
ClutterSettings *settings;
g_return_val_if_fail (CLUTTER_IS_BACKEND (backend), NULL);
settings = clutter_settings_get_default ();
/* XXX yuck. but we return a const pointer, so we need to
* store it in the backend
*/
g_free (backend->font_name);
g_object_get (settings, "font-name", &backend->font_name, NULL);
return backend->font_name;
}
gint32
_clutter_backend_get_units_serial (ClutterBackend *backend)
{

View File

@@ -97,7 +97,7 @@ enum
static guint canvas_signals[LAST_SIGNAL] = { 0, };
static void clutter_content_iface_init (ClutterContentIface *iface);
static void clutter_content_iface_init (ClutterContentInterface *iface);
G_DEFINE_TYPE_WITH_CODE (ClutterCanvas, clutter_canvas, G_TYPE_OBJECT,
G_ADD_PRIVATE (ClutterCanvas)
@@ -457,7 +457,7 @@ clutter_canvas_get_preferred_size (ClutterContent *content,
}
static void
clutter_content_iface_init (ClutterContentIface *iface)
clutter_content_iface_init (ClutterContentInterface *iface)
{
iface->invalidate = clutter_canvas_invalidate;
iface->paint_content = clutter_canvas_paint_content;

View File

@@ -45,8 +45,6 @@
#include "clutter-marshal.h"
#include "clutter-private.h"
typedef struct _ClutterContentIface ClutterContentInterface;
enum
{
ATTACHED,
@@ -130,7 +128,7 @@ clutter_content_default_init (ClutterContentInterface *iface)
g_signal_new (I_("attached"),
G_TYPE_FROM_INTERFACE (iface),
G_SIGNAL_RUN_FIRST,
G_STRUCT_OFFSET (ClutterContentIface, attached),
G_STRUCT_OFFSET (ClutterContentInterface, attached),
NULL, NULL,
_clutter_marshal_VOID__OBJECT,
G_TYPE_NONE, 1,
@@ -150,7 +148,7 @@ clutter_content_default_init (ClutterContentInterface *iface)
g_signal_new (I_("detached"),
G_TYPE_FROM_INTERFACE (iface),
G_SIGNAL_RUN_FIRST,
G_STRUCT_OFFSET (ClutterContentIface, detached),
G_STRUCT_OFFSET (ClutterContentInterface, detached),
NULL, NULL,
_clutter_marshal_VOID__OBJECT,
G_TYPE_NONE, 1,
@@ -245,7 +243,7 @@ clutter_content_invalidate_size (ClutterContent *content)
* is associated to a #ClutterContent, to set up a backpointer from
* the @content to the @actor.
*
* This function will invoke the #ClutterContentIface.attached() virtual
* This function will invoke the #ClutterContentInterface.attached() virtual
* function.
*/
void
@@ -279,7 +277,7 @@ _clutter_content_attached (ClutterContent *content,
* This function should be used internally every time a #ClutterActor
* removes the association with a #ClutterContent.
*
* This function will invoke the #ClutterContentIface.detached() virtual
* This function will invoke the #ClutterContentInterface.detached() virtual
* function.
*/
void
@@ -308,7 +306,7 @@ _clutter_content_detached (ClutterContent *content,
*
* Creates the render tree for the @content and @actor.
*
* This function will invoke the #ClutterContentIface.paint_content()
* This function will invoke the #ClutterContentInterface.paint_content()
* virtual function.
*/
void

View File

@@ -33,24 +33,13 @@
G_BEGIN_DECLS
#define CLUTTER_TYPE_CONTENT (clutter_content_get_type ())
#define CLUTTER_CONTENT(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), CLUTTER_TYPE_CONTENT, ClutterContent))
#define CLUTTER_IS_CONTENT(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), CLUTTER_TYPE_CONTENT))
#define CLUTTER_CONTENT_GET_IFACE(obj) (G_TYPE_INSTANCE_GET_INTERFACE ((obj), CLUTTER_TYPE_CONTENT, ClutterContentIface))
#define CLUTTER_TYPE_CONTENT (clutter_content_get_type ())
typedef struct _ClutterContentIface ClutterContentIface;
CLUTTER_EXPORT
G_DECLARE_INTERFACE (ClutterContent, clutter_content, CLUTTER, CONTENT, GObject)
/**
* ClutterContent:
*
* The #ClutterContent structure is an opaque type
* whose members cannot be acccessed directly.
*
* Since: 1.10
*/
/**
* ClutterContentIface:
* ClutterContentInterface:
* @get_preferred_size: virtual function; should be overridden by subclasses
* of #ClutterContent that have a natural size
* @paint_content: virtual function; called each time the content needs to
@@ -62,12 +51,12 @@ typedef struct _ClutterContentIface ClutterContentIface;
* @invalidate: virtual function; called each time a #ClutterContent state
* is changed.
*
* The #ClutterContentIface structure contains only
* The #ClutterContentInterface structure contains only
* private data.
*
* Since: 1.10
*/
struct _ClutterContentIface
struct _ClutterContentInterface
{
/*< private >*/
GTypeInterface g_iface;
@@ -90,9 +79,6 @@ struct _ClutterContentIface
void (* invalidate_size) (ClutterContent *content);
};
CLUTTER_EXPORT
GType clutter_content_get_type (void) G_GNUC_CONST;
CLUTTER_EXPORT
gboolean clutter_content_get_preferred_size (ClutterContent *content,
gfloat *width,

View File

@@ -7,8 +7,6 @@
#include "deprecated/clutter-alpha.h"
#include "deprecated/clutter-animatable.h"
#include "deprecated/clutter-animation.h"
#include "deprecated/clutter-animator.h"
#include "deprecated/clutter-backend.h"
#include "deprecated/clutter-behaviour.h"
#include "deprecated/clutter-behaviour-depth.h"
#include "deprecated/clutter-behaviour-ellipse.h"
@@ -20,7 +18,6 @@
#include "deprecated/clutter-box.h"
#include "deprecated/clutter-cairo-texture.h"
#include "deprecated/clutter-container.h"
#include "deprecated/clutter-frame-source.h"
#include "deprecated/clutter-group.h"
#include "deprecated/clutter-input-device.h"
#include "deprecated/clutter-keysyms.h"
@@ -28,7 +25,6 @@
#include "deprecated/clutter-main.h"
#include "deprecated/clutter-model.h"
#include "deprecated/clutter-rectangle.h"
#include "deprecated/clutter-score.h"
#include "deprecated/clutter-shader.h"
#include "deprecated/clutter-stage-manager.h"
#include "deprecated/clutter-stage.h"
@@ -36,8 +32,6 @@
#include "deprecated/clutter-table-layout.h"
#include "deprecated/clutter-texture.h"
#include "deprecated/clutter-timeline.h"
#include "deprecated/clutter-timeout-pool.h"
#include "deprecated/clutter-util.h"
#undef __CLUTTER_DEPRECATED_H_INSIDE__

View File

@@ -57,7 +57,7 @@ struct _ClutterImagePrivate
gint height;
};
static void clutter_content_iface_init (ClutterContentIface *iface);
static void clutter_content_iface_init (ClutterContentInterface *iface);
G_DEFINE_TYPE_WITH_CODE (ClutterImage, clutter_image, G_TYPE_OBJECT,
G_ADD_PRIVATE (ClutterImage)
@@ -154,7 +154,7 @@ clutter_image_get_preferred_size (ClutterContent *content,
}
static void
clutter_content_iface_init (ClutterContentIface *iface)
clutter_content_iface_init (ClutterContentInterface *iface)
{
iface->get_preferred_size = clutter_image_get_preferred_size;
iface->paint_content = clutter_image_paint_content;

View File

@@ -1,6 +1,7 @@
BOOLEAN:BOXED
BOOLEAN:BOXED,INT,INT
BOOLEAN:OBJECT,BOOLEAN
BOOLEAN:OBJECT,BOXED
BOOLEAN:OBJECT,BOXED,DOUBLE
BOOLEAN:OBJECT,DOUBLE
BOOLEAN:OBJECT,ENUM

View File

@@ -109,7 +109,8 @@ static GSourceFuncs clock_funcs = {
NULL
};
static void clutter_master_clock_iface_init (ClutterMasterClockIface *iface);
static void
clutter_master_clock_iface_init (ClutterMasterClockInterface *iface);
#define clutter_master_clock_default_get_type _clutter_master_clock_default_get_type
@@ -689,7 +690,7 @@ clutter_master_clock_default_set_paused (ClutterMasterClock *clock,
}
static void
clutter_master_clock_iface_init (ClutterMasterClockIface *iface)
clutter_master_clock_iface_init (ClutterMasterClockInterface *iface)
{
iface->add_timeline = clutter_master_clock_default_add_timeline;
iface->remove_timeline = clutter_master_clock_default_remove_timeline;

View File

@@ -37,10 +37,6 @@
#include "clutter-master-clock-default.h"
#include "clutter-private.h"
#define clutter_master_clock_get_type _clutter_master_clock_get_type
typedef ClutterMasterClockIface ClutterMasterClockInterface;
G_DEFINE_INTERFACE (ClutterMasterClock, clutter_master_clock, G_TYPE_OBJECT)
static void

View File

@@ -28,15 +28,12 @@
G_BEGIN_DECLS
#define CLUTTER_TYPE_MASTER_CLOCK (_clutter_master_clock_get_type ())
#define CLUTTER_MASTER_CLOCK(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), CLUTTER_TYPE_MASTER_CLOCK, ClutterMasterClock))
#define CLUTTER_IS_MASTER_CLOCK(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), CLUTTER_TYPE_MASTER_CLOCK))
#define CLUTTER_MASTER_CLOCK_GET_IFACE(obj) (G_TYPE_INSTANCE_GET_INTERFACE ((obj), CLUTTER_TYPE_MASTER_CLOCK, ClutterMasterClockIface))
#define CLUTTER_TYPE_MASTER_CLOCK (clutter_master_clock_get_type ())
G_DECLARE_INTERFACE (ClutterMasterClock, clutter_master_clock,
CLUTTER, MASTER_CLOCK,
GObject)
typedef struct _ClutterMasterClock ClutterMasterClock; /* dummy */
typedef struct _ClutterMasterClockIface ClutterMasterClockIface;
struct _ClutterMasterClockIface
struct _ClutterMasterClockInterface
{
/*< private >*/
GTypeInterface parent_iface;
@@ -51,8 +48,6 @@ struct _ClutterMasterClockIface
gboolean paused);
};
GType _clutter_master_clock_get_type (void) G_GNUC_CONST;
ClutterMasterClock * _clutter_master_clock_get_default (void);
void _clutter_master_clock_add_timeline (ClutterMasterClock *master_clock,
ClutterTimeline *timeline);

View File

@@ -49,6 +49,9 @@ void clutter_stage_freeze_updates (ClutterStage *stage);
CLUTTER_EXPORT
void clutter_stage_thaw_updates (ClutterStage *stage);
CLUTTER_EXPORT
gboolean clutter_actor_has_damage (ClutterActor *actor);
#undef __CLUTTER_H_INSIDE__
#endif /* __CLUTTER_MUTTER_H__ */

View File

@@ -84,9 +84,9 @@ enum
static GParamSpec *obj_props[PROP_LAST] = { NULL, };
static GParamSpec *animatable_props[ANIM_PROP_LAST] = { NULL, };
static ClutterAnimatableIface *parent_animatable_iface = NULL;
static ClutterAnimatableInterface *parent_animatable_iface = NULL;
static void clutter_animatable_iface_init (ClutterAnimatableIface *iface);
static void clutter_animatable_iface_init (ClutterAnimatableInterface *iface);
G_DEFINE_TYPE_WITH_CODE (ClutterScrollActor, clutter_scroll_actor, CLUTTER_TYPE_ACTOR,
G_ADD_PRIVATE (ClutterScrollActor)
@@ -240,7 +240,7 @@ clutter_scroll_actor_get_initial_state (ClutterAnimatable *animatable,
}
static void
clutter_animatable_iface_init (ClutterAnimatableIface *iface)
clutter_animatable_iface_init (ClutterAnimatableInterface *iface)
{
parent_animatable_iface = g_type_interface_peek_parent (iface);

View File

@@ -14,10 +14,6 @@
* #ClutterStage actor, abstracting away the specifics of the windowing system.
*/
#define clutter_stage_window_get_type _clutter_stage_window_get_type
typedef ClutterStageWindowIface ClutterStageWindowInterface;
G_DEFINE_INTERFACE (ClutterStageWindow, clutter_stage_window, G_TYPE_OBJECT);
static void
@@ -60,7 +56,7 @@ void
_clutter_stage_window_set_title (ClutterStageWindow *window,
const gchar *title)
{
ClutterStageWindowIface *iface = CLUTTER_STAGE_WINDOW_GET_IFACE (window);
ClutterStageWindowInterface *iface = CLUTTER_STAGE_WINDOW_GET_IFACE (window);
if (iface->set_title)
iface->set_title (window, title);
@@ -70,7 +66,7 @@ void
_clutter_stage_window_set_fullscreen (ClutterStageWindow *window,
gboolean is_fullscreen)
{
ClutterStageWindowIface *iface = CLUTTER_STAGE_WINDOW_GET_IFACE (window);
ClutterStageWindowInterface *iface = CLUTTER_STAGE_WINDOW_GET_IFACE (window);
if (iface->set_fullscreen)
iface->set_fullscreen (window, is_fullscreen);
@@ -80,7 +76,7 @@ void
_clutter_stage_window_set_cursor_visible (ClutterStageWindow *window,
gboolean is_visible)
{
ClutterStageWindowIface *iface = CLUTTER_STAGE_WINDOW_GET_IFACE (window);
ClutterStageWindowInterface *iface = CLUTTER_STAGE_WINDOW_GET_IFACE (window);
if (iface->set_cursor_visible)
iface->set_cursor_visible (window, is_visible);
@@ -138,7 +134,7 @@ void
_clutter_stage_window_schedule_update (ClutterStageWindow *window,
int sync_delay)
{
ClutterStageWindowIface *iface;
ClutterStageWindowInterface *iface;
g_return_if_fail (CLUTTER_IS_STAGE_WINDOW (window));
@@ -163,7 +159,7 @@ _clutter_stage_window_schedule_update (ClutterStageWindow *window,
gint64
_clutter_stage_window_get_update_time (ClutterStageWindow *window)
{
ClutterStageWindowIface *iface;
ClutterStageWindowInterface *iface;
g_return_val_if_fail (CLUTTER_IS_STAGE_WINDOW (window), 0);
@@ -186,7 +182,7 @@ _clutter_stage_window_get_update_time (ClutterStageWindow *window)
void
_clutter_stage_window_clear_update_time (ClutterStageWindow *window)
{
ClutterStageWindowIface *iface;
ClutterStageWindowInterface *iface;
g_return_if_fail (CLUTTER_IS_STAGE_WINDOW (window));
@@ -204,7 +200,7 @@ void
_clutter_stage_window_add_redraw_clip (ClutterStageWindow *window,
cairo_rectangle_int_t *stage_clip)
{
ClutterStageWindowIface *iface;
ClutterStageWindowInterface *iface;
g_return_if_fail (CLUTTER_IS_STAGE_WINDOW (window));
@@ -224,7 +220,7 @@ _clutter_stage_window_add_redraw_clip (ClutterStageWindow *window,
gboolean
_clutter_stage_window_has_redraw_clips (ClutterStageWindow *window)
{
ClutterStageWindowIface *iface;
ClutterStageWindowInterface *iface;
g_return_val_if_fail (CLUTTER_IS_STAGE_WINDOW (window), FALSE);
@@ -246,7 +242,7 @@ _clutter_stage_window_has_redraw_clips (ClutterStageWindow *window)
gboolean
_clutter_stage_window_ignoring_redraw_clips (ClutterStageWindow *window)
{
ClutterStageWindowIface *iface;
ClutterStageWindowInterface *iface;
g_return_val_if_fail (CLUTTER_IS_STAGE_WINDOW (window), FALSE);
@@ -261,7 +257,7 @@ gboolean
_clutter_stage_window_get_redraw_clip_bounds (ClutterStageWindow *window,
cairo_rectangle_int_t *stage_clip)
{
ClutterStageWindowIface *iface;
ClutterStageWindowInterface *iface;
g_return_val_if_fail (CLUTTER_IS_STAGE_WINDOW (window), FALSE);
@@ -276,7 +272,7 @@ void
_clutter_stage_window_set_accept_focus (ClutterStageWindow *window,
gboolean accept_focus)
{
ClutterStageWindowIface *iface;
ClutterStageWindowInterface *iface;
g_return_if_fail (CLUTTER_IS_STAGE_WINDOW (window));
@@ -288,7 +284,7 @@ _clutter_stage_window_set_accept_focus (ClutterStageWindow *window,
void
_clutter_stage_window_redraw (ClutterStageWindow *window)
{
ClutterStageWindowIface *iface;
ClutterStageWindowInterface *iface;
g_return_if_fail (CLUTTER_IS_STAGE_WINDOW (window));
@@ -303,7 +299,7 @@ _clutter_stage_window_get_dirty_pixel (ClutterStageWindow *window,
ClutterStageView *view,
int *x, int *y)
{
ClutterStageWindowIface *iface;
ClutterStageWindowInterface *iface;
*x = 0;
*y = 0;
@@ -318,7 +314,7 @@ _clutter_stage_window_get_dirty_pixel (ClutterStageWindow *window,
gboolean
_clutter_stage_window_can_clip_redraws (ClutterStageWindow *window)
{
ClutterStageWindowIface *iface;
ClutterStageWindowInterface *iface;
g_return_val_if_fail (CLUTTER_IS_STAGE_WINDOW (window), FALSE);
@@ -332,7 +328,7 @@ _clutter_stage_window_can_clip_redraws (ClutterStageWindow *window)
GList *
_clutter_stage_window_get_views (ClutterStageWindow *window)
{
ClutterStageWindowIface *iface = CLUTTER_STAGE_WINDOW_GET_IFACE (window);
ClutterStageWindowInterface *iface = CLUTTER_STAGE_WINDOW_GET_IFACE (window);
return iface->get_views (window);
}
@@ -340,7 +336,7 @@ _clutter_stage_window_get_views (ClutterStageWindow *window)
void
_clutter_stage_window_finish_frame (ClutterStageWindow *window)
{
ClutterStageWindowIface *iface = CLUTTER_STAGE_WINDOW_GET_IFACE (window);
ClutterStageWindowInterface *iface = CLUTTER_STAGE_WINDOW_GET_IFACE (window);
if (iface->finish_frame)
iface->finish_frame (window);
@@ -349,7 +345,7 @@ _clutter_stage_window_finish_frame (ClutterStageWindow *window)
int64_t
_clutter_stage_window_get_frame_counter (ClutterStageWindow *window)
{
ClutterStageWindowIface *iface = CLUTTER_STAGE_WINDOW_GET_IFACE (window);
ClutterStageWindowInterface *iface = CLUTTER_STAGE_WINDOW_GET_IFACE (window);
if (iface->get_frame_counter)
return iface->get_frame_counter (window);

View File

@@ -7,30 +7,21 @@
G_BEGIN_DECLS
#define CLUTTER_TYPE_STAGE_WINDOW (_clutter_stage_window_get_type ())
#define CLUTTER_STAGE_WINDOW(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), CLUTTER_TYPE_STAGE_WINDOW, ClutterStageWindow))
#define CLUTTER_IS_STAGE_WINDOW(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), CLUTTER_TYPE_STAGE_WINDOW))
#define CLUTTER_STAGE_WINDOW_GET_IFACE(obj) (G_TYPE_INSTANCE_GET_INTERFACE ((obj), CLUTTER_TYPE_STAGE_WINDOW, ClutterStageWindowIface))
#define CLUTTER_TYPE_STAGE_WINDOW (clutter_stage_window_get_type ())
CLUTTER_EXPORT
G_DECLARE_INTERFACE (ClutterStageWindow, clutter_stage_window,
CLUTTER, STAGE_WINDOW,
GObject)
/*
* ClutterStageWindow: (skip)
*
* #ClutterStageWindow is an opaque structure
* whose members should not be accessed directly
*
* Since: 0.8
*/
typedef struct _ClutterStageWindow ClutterStageWindow; /* dummy */
typedef struct _ClutterStageWindowIface ClutterStageWindowIface;
/*
* ClutterStageWindowIface: (skip)
* ClutterStageWindowInterface: (skip)
*
* The interface implemented by backends for stage windows
*
* Since: 0.8
*/
struct _ClutterStageWindowIface
struct _ClutterStageWindowInterface
{
/*< private >*/
GTypeInterface parent_iface;
@@ -88,9 +79,6 @@ struct _ClutterStageWindowIface
void (* finish_frame) (ClutterStageWindow *stage_window);
};
CLUTTER_EXPORT
GType _clutter_stage_window_get_type (void) G_GNUC_CONST;
ClutterActor * _clutter_stage_window_get_wrapper (ClutterStageWindow *window);
void _clutter_stage_window_set_title (ClutterStageWindow *window,

View File

@@ -1274,45 +1274,44 @@ clutter_stage_real_queue_relayout (ClutterActor *self)
parent_class->queue_relayout (self);
}
static void
clutter_stage_real_queue_redraw (ClutterActor *actor,
ClutterActor *leaf)
static gboolean
clutter_stage_real_queue_redraw (ClutterActor *actor,
ClutterActor *leaf,
ClutterPaintVolume *redraw_clip)
{
ClutterStage *stage = CLUTTER_STAGE (actor);
ClutterStageWindow *stage_window;
ClutterPaintVolume *redraw_clip;
ClutterActorBox bounding_box;
ClutterActorBox intersection_box;
cairo_rectangle_int_t geom, stage_clip;
if (CLUTTER_ACTOR_IN_DESTRUCTION (actor))
return;
return TRUE;
/* If the backend can't do anything with redraw clips (e.g. it already knows
* it needs to redraw everything anyway) then don't spend time transforming
* any clip volume into stage coordinates... */
stage_window = _clutter_stage_get_window (stage);
if (stage_window == NULL)
return;
return TRUE;
if (_clutter_stage_window_ignoring_redraw_clips (stage_window))
{
_clutter_stage_window_add_redraw_clip (stage_window, NULL);
return;
return FALSE;
}
/* Convert the clip volume into stage coordinates and then into an
* axis aligned stage coordinates bounding box...
*/
redraw_clip = _clutter_actor_get_queue_redraw_clip (leaf);
if (redraw_clip == NULL)
{
_clutter_stage_window_add_redraw_clip (stage_window, NULL);
return;
return FALSE;
}
if (redraw_clip->is_empty)
return;
return TRUE;
_clutter_paint_volume_get_stage_paint_box (redraw_clip,
stage,
@@ -1328,7 +1327,7 @@ clutter_stage_real_queue_redraw (ClutterActor *actor,
/* There is no need to track degenerate/empty redraw clips */
if (intersection_box.x2 <= intersection_box.x1 ||
intersection_box.y2 <= intersection_box.y1)
return;
return TRUE;
/* when converting to integer coordinates make sure we round the edges of the
* clip rectangle outwards... */
@@ -1338,6 +1337,7 @@ clutter_stage_real_queue_redraw (ClutterActor *actor,
stage_clip.height = intersection_box.y2 - stage_clip.y;
_clutter_stage_window_add_redraw_clip (stage_window, &stage_clip);
return FALSE;
}
gboolean
@@ -2742,7 +2742,7 @@ clutter_stage_set_fullscreen (ClutterStage *stage,
if (priv->is_fullscreen != fullscreen)
{
ClutterStageWindow *impl = CLUTTER_STAGE_WINDOW (priv->impl);
ClutterStageWindowIface *iface;
ClutterStageWindowInterface *iface;
iface = CLUTTER_STAGE_WINDOW_GET_IFACE (impl);
@@ -2807,7 +2807,7 @@ clutter_stage_set_user_resizable (ClutterStage *stage,
&& priv->is_user_resizable != resizable)
{
ClutterStageWindow *impl = CLUTTER_STAGE_WINDOW (priv->impl);
ClutterStageWindowIface *iface;
ClutterStageWindowInterface *iface;
iface = CLUTTER_STAGE_WINDOW_GET_IFACE (impl);
if (iface->set_user_resizable)
@@ -2856,7 +2856,7 @@ clutter_stage_show_cursor (ClutterStage *stage)
if (!priv->is_cursor_visible)
{
ClutterStageWindow *impl = CLUTTER_STAGE_WINDOW (priv->impl);
ClutterStageWindowIface *iface;
ClutterStageWindowInterface *iface;
iface = CLUTTER_STAGE_WINDOW_GET_IFACE (impl);
if (iface->set_cursor_visible)
@@ -2889,7 +2889,7 @@ clutter_stage_hide_cursor (ClutterStage *stage)
if (priv->is_cursor_visible)
{
ClutterStageWindow *impl = CLUTTER_STAGE_WINDOW (priv->impl);
ClutterStageWindowIface *iface;
ClutterStageWindowInterface *iface;
iface = CLUTTER_STAGE_WINDOW_GET_IFACE (impl);
if (iface->set_cursor_visible)

View File

@@ -279,7 +279,7 @@ static const ClutterColor default_selected_text_color = { 0, 0, 0, 255 };
static CoglPipeline *default_color_pipeline = NULL;
static ClutterAnimatableIface *parent_animatable_iface = NULL;
static ClutterAnimatableInterface *parent_animatable_iface = NULL;
static ClutterScriptableIface *parent_scriptable_iface = NULL;
/* ClutterTextInputFocus */
@@ -389,7 +389,7 @@ clutter_text_input_focus_new (ClutterText *text)
/* ClutterText */
static void clutter_scriptable_iface_init (ClutterScriptableIface *iface);
static void clutter_animatable_iface_init (ClutterAnimatableIface *iface);
static void clutter_animatable_iface_init (ClutterAnimatableInterface *iface);
G_DEFINE_TYPE_WITH_CODE (ClutterText,
clutter_text,
@@ -3547,7 +3547,7 @@ clutter_text_set_final_state (ClutterAnimatable *animatable,
}
static void
clutter_animatable_iface_init (ClutterAnimatableIface *iface)
clutter_animatable_iface_init (ClutterAnimatableInterface *iface)
{
parent_animatable_iface = g_type_interface_peek_parent (iface);

View File

@@ -90,7 +90,6 @@ typedef struct _ClutterVertex ClutterVertex;
typedef struct _ClutterAlpha ClutterAlpha;
typedef struct _ClutterAnimation ClutterAnimation;
typedef struct _ClutterAnimator ClutterAnimator;
typedef struct _ClutterState ClutterState;
typedef struct _ClutterInputDeviceTool ClutterInputDeviceTool;

View File

@@ -39,29 +39,6 @@
#include "clutter-interval.h"
#include "clutter-private.h"
#include "deprecated/clutter-util.h"
/**
* clutter_util_next_p2:
* @a: Value to get the next power
*
* Calculates the nearest power of two, greater than or equal to @a.
*
* Return value: The nearest power of two, greater or equal to @a.
*
* Deprecated: 1.2
*/
gint
clutter_util_next_p2 (gint a)
{
int rval = 1;
while (rval < a)
rval <<= 1;
return rval;
}
/* Help macros to scale from OpenGL <-1,1> coordinates system to
* window coordinates ranging [0,window-size]
*/

View File

@@ -60,7 +60,8 @@ typedef struct _ClutterStageViewCoglPrivate
G_DEFINE_TYPE_WITH_PRIVATE (ClutterStageViewCogl, clutter_stage_view_cogl,
CLUTTER_TYPE_STAGE_VIEW)
static void clutter_stage_window_iface_init (ClutterStageWindowIface *iface);
static void
clutter_stage_window_iface_init (ClutterStageWindowInterface *iface);
G_DEFINE_TYPE_WITH_CODE (ClutterStageCogl,
_clutter_stage_cogl,
@@ -994,7 +995,7 @@ clutter_stage_cogl_get_dirty_pixel (ClutterStageWindow *stage_window,
}
static void
clutter_stage_window_iface_init (ClutterStageWindowIface *iface)
clutter_stage_window_iface_init (ClutterStageWindowInterface *iface)
{
iface->realize = clutter_stage_cogl_realize;
iface->unrealize = clutter_stage_cogl_unrealize;

View File

@@ -9,370 +9,6 @@
#include "clutter-private.h"
#include "clutter-shader.h"
typedef struct _ShaderData ShaderData;
struct _ShaderData
{
ClutterShader *shader;
/* back pointer to the actor */
ClutterActor *actor;
/* list of values that should be set on the shader
* before each paint cycle
*/
GHashTable *value_hash;
};
static void
shader_value_free (gpointer data)
{
GValue *var = data;
g_value_unset (var);
g_slice_free (GValue, var);
}
static void
destroy_shader_data (gpointer data)
{
ShaderData *shader_data = data;
if (shader_data == NULL)
return;
if (shader_data->shader != NULL)
{
g_object_unref (shader_data->shader);
shader_data->shader = NULL;
}
if (shader_data->value_hash != NULL)
{
g_hash_table_destroy (shader_data->value_hash);
shader_data->value_hash = NULL;
}
g_slice_free (ShaderData, shader_data);
}
/**
* clutter_actor_get_shader:
* @self: a #ClutterActor
*
* Queries the currently set #ClutterShader on @self.
*
* Return value: (transfer none): The currently set #ClutterShader
* or %NULL if no shader is set.
*
* Since: 0.6
*
* Deprecated: 1.8: Use clutter_actor_get_effect() instead.
*/
ClutterShader *
clutter_actor_get_shader (ClutterActor *self)
{
ShaderData *shader_data;
g_return_val_if_fail (CLUTTER_IS_ACTOR (self), NULL);
shader_data = g_object_get_data (G_OBJECT (self), "-clutter-actor-shader-data");
if (shader_data != NULL)
return shader_data->shader;
return NULL;
}
/**
* clutter_actor_set_shader:
* @self: a #ClutterActor
* @shader: (allow-none): a #ClutterShader or %NULL to unset the shader.
*
* Sets the #ClutterShader to be used when rendering @self.
*
* If @shader is %NULL this function will unset any currently set shader
* for the actor.
*
* Any #ClutterEffect applied to @self will take the precedence
* over the #ClutterShader set using this function.
*
* Return value: %TRUE if the shader was successfully applied
* or removed
*
* Since: 0.6
*
* Deprecated: 1.8: Use #ClutterShaderEffect and
* clutter_actor_add_effect() instead.
*/
gboolean
clutter_actor_set_shader (ClutterActor *self,
ClutterShader *shader)
{
ShaderData *shader_data;
g_return_val_if_fail (CLUTTER_IS_ACTOR (self), FALSE);
g_return_val_if_fail (shader == NULL || CLUTTER_IS_SHADER (shader), FALSE);
if (shader != NULL)
g_object_ref (shader);
else
{
/* if shader passed in is NULL we destroy the shader */
g_object_set_data (G_OBJECT (self), "-clutter-actor-shader-data", NULL);
return TRUE;
}
shader_data = g_object_get_data (G_OBJECT (self), "-clutter-actor-shader-data");
if (shader_data == NULL)
{
shader_data = g_slice_new (ShaderData);
shader_data->actor = self;
shader_data->shader = NULL;
shader_data->value_hash =
g_hash_table_new_full (g_str_hash, g_str_equal,
g_free,
shader_value_free);
g_object_set_data_full (G_OBJECT (self), "-clutter-actor-shader-data",
shader_data,
destroy_shader_data);
}
if (shader_data->shader != NULL)
g_object_unref (shader_data->shader);
shader_data->shader = shader;
clutter_actor_queue_redraw (self);
return TRUE;
}
static void
set_each_param (gpointer key,
gpointer value,
gpointer user_data)
{
ClutterShader *shader = user_data;
const gchar *uniform = key;
GValue *var = value;
clutter_shader_set_uniform (shader, uniform, var);
}
void
_clutter_actor_shader_pre_paint (ClutterActor *actor,
gboolean repeat)
{
ShaderData *shader_data;
ClutterShader *shader;
shader_data = g_object_get_data (G_OBJECT (actor), "-clutter-actor-shader-data");
if (shader_data == NULL)
return;
shader = shader_data->shader;
if (shader != NULL)
{
clutter_shader_set_is_enabled (shader, TRUE);
g_hash_table_foreach (shader_data->value_hash, set_each_param, shader);
if (!repeat)
_clutter_context_push_shader_stack (actor);
}
}
void
_clutter_actor_shader_post_paint (ClutterActor *actor)
{
ShaderData *shader_data;
ClutterShader *shader;
shader_data = g_object_get_data (G_OBJECT (actor), "-clutter-actor-shader-data");
if (G_LIKELY (shader_data == NULL))
return;
shader = shader_data->shader;
if (shader != NULL)
{
ClutterActor *head;
clutter_shader_set_is_enabled (shader, FALSE);
/* remove the actor from the shaders stack; if there is another
* actor inside it, then call pre-paint again to set its shader
* but this time with the second argument being TRUE, indicating
* that we are re-applying an existing shader and thus should it
* not be prepended to the stack
*/
head = _clutter_context_pop_shader_stack (actor);
if (head != NULL)
_clutter_actor_shader_pre_paint (head, TRUE);
}
}
static inline void
clutter_actor_set_shader_param_internal (ClutterActor *self,
const gchar *param,
const GValue *value)
{
ShaderData *shader_data;
GValue *var;
shader_data = g_object_get_data (G_OBJECT (self), "-clutter-actor-shader-data");
if (shader_data == NULL)
return;
var = g_slice_new0 (GValue);
g_value_init (var, G_VALUE_TYPE (value));
g_value_copy (value, var);
g_hash_table_insert (shader_data->value_hash, g_strdup (param), var);
clutter_actor_queue_redraw (self);
}
/**
* clutter_actor_set_shader_param:
* @self: a #ClutterActor
* @param: the name of the parameter
* @value: the value of the parameter
*
* Sets the value for a named parameter of the shader applied
* to @actor.
*
* Since: 1.0
*
* Deprecated: 1.8: Use clutter_shader_effect_set_uniform_value() instead
*/
void
clutter_actor_set_shader_param (ClutterActor *self,
const gchar *param,
const GValue *value)
{
g_return_if_fail (CLUTTER_IS_ACTOR (self));
g_return_if_fail (param != NULL);
g_return_if_fail (CLUTTER_VALUE_HOLDS_SHADER_FLOAT (value) ||
CLUTTER_VALUE_HOLDS_SHADER_INT (value) ||
CLUTTER_VALUE_HOLDS_SHADER_MATRIX (value) ||
G_VALUE_HOLDS_FLOAT (value) ||
G_VALUE_HOLDS_INT (value));
clutter_actor_set_shader_param_internal (self, param, value);
}
/**
* clutter_actor_set_shader_param_float:
* @self: a #ClutterActor
* @param: the name of the parameter
* @value: the value of the parameter
*
* Sets the value for a named float parameter of the shader applied
* to @actor.
*
* Since: 0.8
*
* Deprecated: 1.8: Use clutter_shader_effect_set_uniform() instead
*/
void
clutter_actor_set_shader_param_float (ClutterActor *self,
const gchar *param,
gfloat value)
{
GValue var = { 0, };
g_value_init (&var, G_TYPE_FLOAT);
g_value_set_float (&var, value);
clutter_actor_set_shader_param_internal (self, param, &var);
g_value_unset (&var);
}
/**
* clutter_actor_set_shader_param_int:
* @self: a #ClutterActor
* @param: the name of the parameter
* @value: the value of the parameter
*
* Sets the value for a named int parameter of the shader applied to
* @actor.
*
* Since: 0.8
*
* Deprecated: 1.8: Use clutter_shader_effect_set_uniform() instead
*/
void
clutter_actor_set_shader_param_int (ClutterActor *self,
const gchar *param,
gint value)
{
GValue var = { 0, };
g_value_init (&var, G_TYPE_INT);
g_value_set_int (&var, value);
clutter_actor_set_shader_param_internal (self, param, &var);
g_value_unset (&var);
}
/**
* clutter_actor_set_geometry:
* @self: A #ClutterActor
* @geometry: A #ClutterGeometry
*
* Sets the actor's fixed position and forces its minimum and natural
* size, in pixels. This means the untransformed actor will have the
* given geometry. This is the same as calling clutter_actor_set_position()
* and clutter_actor_set_size().
*
* Deprecated: 1.10: Use clutter_actor_set_position() and
* clutter_actor_set_size() instead.
*/
void
clutter_actor_set_geometry (ClutterActor *self,
const ClutterGeometry *geometry)
{
g_object_freeze_notify (G_OBJECT (self));
clutter_actor_set_position (self, geometry->x, geometry->y);
clutter_actor_set_size (self, geometry->width, geometry->height);
g_object_thaw_notify (G_OBJECT (self));
}
/**
* clutter_actor_get_geometry:
* @self: A #ClutterActor
* @geometry: (out caller-allocates): A location to store actors #ClutterGeometry
*
* Gets the size and position of an actor relative to its parent
* actor. This is the same as calling clutter_actor_get_position() and
* clutter_actor_get_size(). It tries to "do what you mean" and get the
* requested size and position if the actor's allocation is invalid.
*
* Deprecated: 1.10: Use clutter_actor_get_position() and
* clutter_actor_get_size(), or clutter_actor_get_allocation_geometry()
* instead.
*/
void
clutter_actor_get_geometry (ClutterActor *self,
ClutterGeometry *geometry)
{
gfloat x, y, width, height;
g_return_if_fail (CLUTTER_IS_ACTOR (self));
g_return_if_fail (geometry != NULL);
clutter_actor_get_position (self, &x, &y);
clutter_actor_get_size (self, &width, &height);
geometry->x = (int) x;
geometry->y = (int) y;
geometry->width = (int) width;
geometry->height = (int) height;
}
/**
* clutter_actor_get_allocation_geometry:
* @self: A #ClutterActor

View File

@@ -33,13 +33,6 @@
G_BEGIN_DECLS
CLUTTER_DEPRECATED
void clutter_actor_set_geometry (ClutterActor *self,
const ClutterGeometry *geometry);
CLUTTER_DEPRECATED_FOR(clutter_actor_get_allocation_geometry)
void clutter_actor_get_geometry (ClutterActor *self,
ClutterGeometry *geometry);
CLUTTER_DEPRECATED
guint32 clutter_actor_get_gid (ClutterActor *self);

File diff suppressed because it is too large Load Diff

View File

@@ -1,188 +0,0 @@
/*
* Clutter.
*
* An OpenGL based 'interactive canvas' library.
*
* Copyright (C) 2010 Intel Corporation
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library. If not, see <http://www.gnu.org/licenses/>.
*
* Author:
* Øyvind Kolås <pippin@linux.intel.com>
*/
#if !defined(__CLUTTER_H_INSIDE__) && !defined(CLUTTER_COMPILATION)
#error "Only <clutter/clutter.h> can be included directly."
#endif
#ifndef __CLUTTER_ANIMATOR_H__
#define __CLUTTER_ANIMATOR_H__
#include <clutter/clutter-types.h>
#include <clutter/clutter-timeline.h>
G_BEGIN_DECLS
#define CLUTTER_TYPE_ANIMATOR (clutter_animator_get_type ())
#define CLUTTER_TYPE_ANIMATOR_KEY (clutter_animator_key_get_type ())
#define CLUTTER_ANIMATOR(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), CLUTTER_TYPE_ANIMATOR, ClutterAnimator))
#define CLUTTER_ANIMATOR_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), CLUTTER_TYPE_ANIMATOR, ClutterAnimatorClass))
#define CLUTTER_IS_ANIMATOR(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), CLUTTER_TYPE_ANIMATOR))
#define CLUTTER_IS_ANIMATOR_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), CLUTTER_TYPE_ANIMATOR))
#define CLUTTER_ANIMATOR_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), CLUTTER_TYPE_ANIMATOR, ClutterAnimatorClass))
/* ClutterAnimator is typedef in clutter-types.h */
typedef struct _ClutterAnimatorClass ClutterAnimatorClass;
typedef struct _ClutterAnimatorPrivate ClutterAnimatorPrivate;
/**
* ClutterAnimatorKey:
*
* A key frame inside a #ClutterAnimator
*
* Since: 1.2
*
* Deprecated: 1.12
*/
typedef struct _ClutterAnimatorKey ClutterAnimatorKey;
/**
* ClutterAnimator:
*
* The #ClutterAnimator structure contains only private data and
* should be accessed using the provided API
*
* Since: 1.2
*
* Deprecated: 1.12
*/
struct _ClutterAnimator
{
/*< private >*/
GObject parent_instance;
ClutterAnimatorPrivate *priv;
};
/**
* ClutterAnimatorClass:
*
* The #ClutterAnimatorClass structure contains only private data
*
* Since: 1.2
*
* Deprecated: 1.12
*/
struct _ClutterAnimatorClass
{
/*< private >*/
GObjectClass parent_class;
/* padding for future expansion */
gpointer _padding_dummy[16];
};
CLUTTER_DEPRECATED
GType clutter_animator_get_type (void) G_GNUC_CONST;
CLUTTER_DEPRECATED
ClutterAnimator * clutter_animator_new (void);
CLUTTER_DEPRECATED
ClutterAnimator * clutter_animator_set_key (ClutterAnimator *animator,
GObject *object,
const gchar *property_name,
guint mode,
gdouble progress,
const GValue *value);
CLUTTER_DEPRECATED
void clutter_animator_set (ClutterAnimator *animator,
gpointer first_object,
const gchar *first_property_name,
guint first_mode,
gdouble first_progress,
...) G_GNUC_NULL_TERMINATED;
CLUTTER_DEPRECATED
GList * clutter_animator_get_keys (ClutterAnimator *animator,
GObject *object,
const gchar *property_name,
gdouble progress);
CLUTTER_DEPRECATED
void clutter_animator_remove_key (ClutterAnimator *animator,
GObject *object,
const gchar *property_name,
gdouble progress);
CLUTTER_DEPRECATED
ClutterTimeline * clutter_animator_start (ClutterAnimator *animator);
CLUTTER_DEPRECATED
gboolean clutter_animator_compute_value (ClutterAnimator *animator,
GObject *object,
const gchar *property_name,
gdouble progress,
GValue *value);
CLUTTER_DEPRECATED
ClutterTimeline * clutter_animator_get_timeline (ClutterAnimator *animator);
CLUTTER_DEPRECATED
void clutter_animator_set_timeline (ClutterAnimator *animator,
ClutterTimeline *timeline);
CLUTTER_DEPRECATED
guint clutter_animator_get_duration (ClutterAnimator *animator);
CLUTTER_DEPRECATED
void clutter_animator_set_duration (ClutterAnimator *animator,
guint duration);
CLUTTER_DEPRECATED
gboolean clutter_animator_property_get_ease_in (ClutterAnimator *animator,
GObject *object,
const gchar *property_name);
CLUTTER_DEPRECATED
void clutter_animator_property_set_ease_in (ClutterAnimator *animator,
GObject *object,
const gchar *property_name,
gboolean ease_in);
CLUTTER_DEPRECATED
ClutterInterpolation clutter_animator_property_get_interpolation (ClutterAnimator *animator,
GObject *object,
const gchar *property_name);
CLUTTER_DEPRECATED
void clutter_animator_property_set_interpolation (ClutterAnimator *animator,
GObject *object,
const gchar *property_name,
ClutterInterpolation interpolation);
CLUTTER_DEPRECATED
GType clutter_animator_key_get_type (void) G_GNUC_CONST;
CLUTTER_DEPRECATED
GObject * clutter_animator_key_get_object (const ClutterAnimatorKey *key);
CLUTTER_DEPRECATED
const gchar * clutter_animator_key_get_property_name (const ClutterAnimatorKey *key);
CLUTTER_DEPRECATED
GType clutter_animator_key_get_property_type (const ClutterAnimatorKey *key);
CLUTTER_DEPRECATED
gulong clutter_animator_key_get_mode (const ClutterAnimatorKey *key);
CLUTTER_DEPRECATED
gdouble clutter_animator_key_get_progress (const ClutterAnimatorKey *key);
CLUTTER_DEPRECATED
gboolean clutter_animator_key_get_value (const ClutterAnimatorKey *key,
GValue *value);
G_END_DECLS
#endif /* __CLUTTER_ANIMATOR_H__ */

View File

@@ -1,64 +0,0 @@
/*
* Clutter.
*
* An OpenGL based 'interactive canvas' library.
*
* Authored By Matthew Allum <mallum@openedhand.com>
*
* Copyright (C) 2006, 2007, 2008 OpenedHand Ltd
* Copyright (C) 2009, 2010 Intel Corp
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library. If not, see <http://www.gnu.org/licenses/>.
*/
#if !defined(__CLUTTER_H_INSIDE__) && !defined(CLUTTER_COMPILATION)
#error "Only <clutter/clutter.h> can be included directly."
#endif
#ifndef __CLUTTER_BACKEND_DEPRECATED_H__
#define __CLUTTER_BACKEND_DEPRECATED_H__
#include <clutter/clutter-types.h>
G_BEGIN_DECLS
CLUTTER_DEPRECATED_FOR(ClutterSettings:font_dpi)
void clutter_backend_set_resolution (ClutterBackend *backend,
gdouble dpi);
CLUTTER_DEPRECATED_FOR(ClutterSettings:double_click_time)
void clutter_backend_set_double_click_time (ClutterBackend *backend,
guint msec);
CLUTTER_DEPRECATED_FOR(ClutterSettings:double_click_time)
guint clutter_backend_get_double_click_time (ClutterBackend *backend);
CLUTTER_DEPRECATED_FOR(ClutterSettings:double_click_distance)
void clutter_backend_set_double_click_distance (ClutterBackend *backend,
guint distance);
CLUTTER_DEPRECATED_FOR(ClutterSettings:double_click_distance)
guint clutter_backend_get_double_click_distance (ClutterBackend *backend);
CLUTTER_DEPRECATED_FOR(ClutterSettings:font_name)
void clutter_backend_set_font_name (ClutterBackend *backend,
const gchar *font_name);
CLUTTER_DEPRECATED_FOR(ClutterSettings:font_name)
const gchar * clutter_backend_get_font_name (ClutterBackend *backend);
G_END_DECLS
#endif /* __CLUTTER_BACKEND_DEPRECATED_H__ */

View File

@@ -1,261 +0,0 @@
/*
* Clutter.
*
* An OpenGL based 'interactive canvas' library.
*
* Authored By Neil Roberts <neil@linux.intel.com>
*
* Copyright (C) 2008 OpenedHand
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library. If not, see <http://www.gnu.org/licenses/>.
*
*
*/
#include "clutter-build-config.h"
#define CLUTTER_DISABLE_DEPRECATION_WARNINGS
#include "clutter-main.h"
#include "clutter-private.h"
#include "deprecated/clutter-frame-source.h"
#include "deprecated/clutter-timeout-interval.h"
typedef struct _ClutterFrameSource ClutterFrameSource;
struct _ClutterFrameSource
{
GSource source;
ClutterTimeoutInterval timeout;
};
static gboolean clutter_frame_source_prepare (GSource *source,
gint *timeout);
static gboolean clutter_frame_source_check (GSource *source);
static gboolean clutter_frame_source_dispatch (GSource *source,
GSourceFunc callback,
gpointer user_data);
static GSourceFuncs clutter_frame_source_funcs =
{
clutter_frame_source_prepare,
clutter_frame_source_check,
clutter_frame_source_dispatch,
NULL
};
/**
* clutter_frame_source_add_full: (rename-to clutter_frame_source_add)
* @priority: the priority of the frame source. Typically this will be in the
* range between %G_PRIORITY_DEFAULT and %G_PRIORITY_HIGH.
* @fps: the number of times per second to call the function
* @func: function to call
* @data: data to pass to the function
* @notify: function to call when the timeout source is removed
*
* Sets a function to be called at regular intervals with the given
* priority. The function is called repeatedly until it returns
* %FALSE, at which point the timeout is automatically destroyed and
* the function will not be called again. The @notify function is
* called when the timeout is destroyed. The first call to the
* function will be at the end of the first @interval.
*
* This function is similar to g_timeout_add_full() except that it
* will try to compensate for delays. For example, if @func takes half
* the interval time to execute then the function will be called again
* half the interval time after it finished. In contrast
* g_timeout_add_full() would not fire until a full interval after the
* function completes so the delay between calls would be 1.0 / @fps *
* 1.5. This function does not however try to invoke the function
* multiple times to catch up missing frames if @func takes more than
* @interval ms to execute.
*
* Return value: the ID (greater than 0) of the event source.
*
* Since: 0.8
*
* Deprecated: 1.6: There is no direct replacement for this API.
*/
guint
clutter_frame_source_add_full (gint priority,
guint fps,
GSourceFunc func,
gpointer data,
GDestroyNotify notify)
{
guint ret;
GSource *source = g_source_new (&clutter_frame_source_funcs,
sizeof (ClutterFrameSource));
ClutterFrameSource *frame_source = (ClutterFrameSource *) source;
_clutter_timeout_interval_init (&frame_source->timeout, fps);
if (priority != G_PRIORITY_DEFAULT)
g_source_set_priority (source, priority);
g_source_set_name (source, "Clutter frame timeout");
g_source_set_callback (source, func, data, notify);
ret = g_source_attach (source, NULL);
g_source_unref (source);
return ret;
}
/**
* clutter_frame_source_add: (skip)
* @fps: the number of times per second to call the function
* @func: function to call
* @data: data to pass to the function
*
* Simple wrapper around clutter_frame_source_add_full().
*
* Return value: the ID (greater than 0) of the event source.
*
* Since: 0.8
*
* Deprecated: 1.6: There is no direct replacement for this API
*/
guint
clutter_frame_source_add (guint fps,
GSourceFunc func,
gpointer data)
{
return clutter_frame_source_add_full (G_PRIORITY_DEFAULT,
fps, func, data, NULL);
}
static gboolean
clutter_frame_source_prepare (GSource *source,
gint *delay)
{
ClutterFrameSource *frame_source = (ClutterFrameSource *) source;
gint64 current_time;
#if GLIB_CHECK_VERSION (2, 27, 3)
current_time = g_source_get_time (source) / 1000;
#else
{
GTimeVal source_time;
g_source_get_current_time (source, &source_time);
current_time = source_time.tv_sec * 1000 + source_time.tv_usec / 1000;
}
#endif
return _clutter_timeout_interval_prepare (current_time,
&frame_source->timeout,
delay);
}
static gboolean
clutter_frame_source_check (GSource *source)
{
return clutter_frame_source_prepare (source, NULL);
}
static gboolean
clutter_frame_source_dispatch (GSource *source,
GSourceFunc callback,
gpointer user_data)
{
ClutterFrameSource *frame_source = (ClutterFrameSource *) source;
return _clutter_timeout_interval_dispatch (&frame_source->timeout,
callback, user_data);
}
/**
* clutter_threads_add_frame_source_full: (rename-to clutter_threads_add_frame_source)
* @priority: the priority of the frame source. Typically this will be in the
* range between %G_PRIORITY_DEFAULT and %G_PRIORITY_HIGH.
* @fps: the number of times per second to call the function
* @func: function to call
* @data: data to pass to the function
* @notify: function to call when the timeout source is removed
*
* Sets a function to be called at regular intervals holding the Clutter
* threads lock, with the given priority. The function is called repeatedly
* until it returns %FALSE, at which point the timeout is automatically
* removed and the function will not be called again. The @notify function
* is called when the timeout is removed.
*
* This function is similar to clutter_threads_add_timeout_full()
* except that it will try to compensate for delays. For example, if
* @func takes half the interval time to execute then the function
* will be called again half the interval time after it finished. In
* contrast clutter_threads_add_timeout_full() would not fire until a
* full interval after the function completes so the delay between
* calls would be @interval * 1.5. This function does not however try
* to invoke the function multiple times to catch up missing frames if
* @func takes more than @interval ms to execute.
*
* See also clutter_threads_add_idle_full().
*
* Return value: the ID (greater than 0) of the event source.
*
* Since: 0.8
*
* Deprecated: 1.6: There is no direct replacement for this API
*/
guint
clutter_threads_add_frame_source_full (gint priority,
guint fps,
GSourceFunc func,
gpointer data,
GDestroyNotify notify)
{
ClutterThreadsDispatch *dispatch;
g_return_val_if_fail (func != NULL, 0);
dispatch = g_slice_new (ClutterThreadsDispatch);
dispatch->func = func;
dispatch->data = data;
dispatch->notify = notify;
return clutter_frame_source_add_full (priority,
fps,
_clutter_threads_dispatch, dispatch,
_clutter_threads_dispatch_free);
}
/**
* clutter_threads_add_frame_source: (skip)
* @fps: the number of times per second to call the function
* @func: function to call
* @data: data to pass to the function
*
* Simple wrapper around clutter_threads_add_frame_source_full().
*
* Return value: the ID (greater than 0) of the event source.
*
* Since: 0.8
*
* Deprecated: 1.6: There is no direct replacement for this API
*/
guint
clutter_threads_add_frame_source (guint fps,
GSourceFunc func,
gpointer data)
{
g_return_val_if_fail (func != NULL, 0);
return clutter_threads_add_frame_source_full (G_PRIORITY_DEFAULT,
fps,
func, data,
NULL);
}

View File

@@ -1,49 +0,0 @@
/*
* Clutter.
*
* An OpenGL based 'interactive canvas' library.
*
* Authored By Matthew Allum <mallum@openedhand.com>
*
* Copyright (C) 2008 OpenedHand
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library. If not, see <http://www.gnu.org/licenses/>.
*/
#if !defined(__CLUTTER_H_INSIDE__) && !defined(CLUTTER_COMPILATION)
#error "Only <clutter/clutter.h> can be included directly."
#endif
#ifndef __CLUTTER_FRAME_SOURCE_H__
#define __CLUTTER_FRAME_SOURCE_H__
#include <clutter/clutter-types.h>
G_BEGIN_DECLS
CLUTTER_DEPRECATED
guint clutter_frame_source_add (guint fps,
GSourceFunc func,
gpointer data);
CLUTTER_DEPRECATED
guint clutter_frame_source_add_full (gint priority,
guint fps,
GSourceFunc func,
gpointer data,
GDestroyNotify notify);
G_END_DECLS
#endif /* __CLUTTER_FRAME_SOURCE_H__ */

View File

@@ -40,17 +40,6 @@ void clutter_threads_enter (void);
CLUTTER_DEPRECATED
void clutter_threads_leave (void);
CLUTTER_DEPRECATED
guint clutter_threads_add_frame_source (guint fps,
GSourceFunc func,
gpointer data);
CLUTTER_DEPRECATED
guint clutter_threads_add_frame_source_full (gint priority,
guint fps,
GSourceFunc func,
gpointer data,
GDestroyNotify notify);
CLUTTER_DEPRECATED_FOR(clutter_stage_set_motion_events_enabled)
void clutter_set_motion_events_enabled (gboolean enable);

File diff suppressed because it is too large Load Diff

View File

@@ -1,144 +0,0 @@
/*
* Clutter.
*
* An OpenGL based 'interactive canvas' library.
*
* Authored By Matthew Allum <mallum@openedhand.com>
*
* Copyright (C) 2006 OpenedHand
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library. If not, see <http://www.gnu.org/licenses/>.
*/
#if !defined(__CLUTTER_H_INSIDE__) && !defined(CLUTTER_COMPILATION)
#error "Only <clutter/clutter.h> can be included directly."
#endif
#ifndef __CLUTTER_SCORE_H__
#define __CLUTTER_SCORE_H__
#include <clutter/clutter-timeline.h>
G_BEGIN_DECLS
#define CLUTTER_TYPE_SCORE (clutter_score_get_type ())
#define CLUTTER_SCORE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), CLUTTER_TYPE_SCORE, ClutterScore))
#define CLUTTER_SCORE_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), CLUTTER_TYPE_SCORE, ClutterScoreClass))
#define CLUTTER_IS_SCORE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), CLUTTER_TYPE_SCORE))
#define CLUTTER_IS_SCORE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), CLUTTER_TYPE_SCORE))
#define CLUTTER_SCORE_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), CLUTTER_TYPE_SCORE, ClutterScoreClass))
typedef struct _ClutterScore ClutterScore;
typedef struct _ClutterScorePrivate ClutterScorePrivate;
typedef struct _ClutterScoreClass ClutterScoreClass;
/**
* ClutterScore:
*
* The #ClutterScore structure contains only private data
* and should be accessed using the provided API
*
* Since: 0.6
*/
struct _ClutterScore
{
/*< private >*/
GObject parent;
ClutterScorePrivate *priv;
};
/**
* ClutterScoreClass:
* @timeline_started: handler for the #ClutterScore::timeline-started signal
* @timeline_completed: handler for the #ClutterScore::timeline-completed
* signal
* @started: handler for the #ClutterScore::started signal
* @completed: handler for the #ClutterScore::completed signal
* @paused: handler for the #ClutterScore::paused signal
*
* The #ClutterScoreClass structure contains only private data
*
* Since: 0.6
*/
struct _ClutterScoreClass
{
/*< private >*/
GObjectClass parent_class;
/*< public >*/
void (* timeline_started) (ClutterScore *score,
ClutterTimeline *timeline);
void (* timeline_completed) (ClutterScore *score,
ClutterTimeline *timeline);
void (* started) (ClutterScore *score);
void (* completed) (ClutterScore *score);
void (* paused) (ClutterScore *score);
/*< private >*/
/* padding for future expansion */
void (*_clutter_score_1) (void);
void (*_clutter_score_2) (void);
void (*_clutter_score_3) (void);
void (*_clutter_score_4) (void);
void (*_clutter_score_5) (void);
};
CLUTTER_DEPRECATED
GType clutter_score_get_type (void) G_GNUC_CONST;
CLUTTER_DEPRECATED
ClutterScore * clutter_score_new (void);
CLUTTER_DEPRECATED
void clutter_score_set_loop (ClutterScore *score,
gboolean loop);
CLUTTER_DEPRECATED
gboolean clutter_score_get_loop (ClutterScore *score);
CLUTTER_DEPRECATED
gulong clutter_score_append (ClutterScore *score,
ClutterTimeline *parent,
ClutterTimeline *timeline);
CLUTTER_DEPRECATED
gulong clutter_score_append_at_marker (ClutterScore *score,
ClutterTimeline *parent,
const gchar *marker_name,
ClutterTimeline *timeline);
CLUTTER_DEPRECATED
void clutter_score_remove (ClutterScore *score,
gulong id_);
CLUTTER_DEPRECATED
void clutter_score_remove_all (ClutterScore *score);
CLUTTER_DEPRECATED
ClutterTimeline *clutter_score_get_timeline (ClutterScore *score,
gulong id_);
CLUTTER_DEPRECATED
GSList * clutter_score_list_timelines (ClutterScore *score);
CLUTTER_DEPRECATED
void clutter_score_start (ClutterScore *score);
CLUTTER_DEPRECATED
void clutter_score_stop (ClutterScore *score);
CLUTTER_DEPRECATED
void clutter_score_pause (ClutterScore *score);
CLUTTER_DEPRECATED
void clutter_score_rewind (ClutterScore *score);
CLUTTER_DEPRECATED
gboolean clutter_score_is_playing (ClutterScore *score);
G_END_DECLS
#endif /* __CLUTTER_SCORE_H__ */

View File

@@ -153,30 +153,6 @@ CoglHandle clutter_shader_get_cogl_fragment_shader (ClutterShader
CLUTTER_DEPRECATED_FOR(ClutterShaderEffect)
CoglHandle clutter_shader_get_cogl_vertex_shader (ClutterShader *shader);
/* ClutterActor methods */
CLUTTER_DEPRECATED_FOR(clutter_actor_add_effect)
gboolean clutter_actor_set_shader (ClutterActor *self,
ClutterShader *shader);
CLUTTER_DEPRECATED_FOR(clutter_actor_get_effect)
ClutterShader * clutter_actor_get_shader (ClutterActor *self);
CLUTTER_DEPRECATED_FOR(clutter_shader_effect_set_uniform_value)
void clutter_actor_set_shader_param (ClutterActor *self,
const gchar *param,
const GValue *value);
CLUTTER_DEPRECATED_FOR(clutter_shader_effect_set_uniform)
void clutter_actor_set_shader_param_int (ClutterActor *self,
const gchar *param,
gint value);
CLUTTER_DEPRECATED_FOR(clutter_shader_effect_set_uniform)
void clutter_actor_set_shader_param_float (ClutterActor *self,
const gchar *param,
gfloat value);
G_END_DECLS
#endif /* __CLUTTER_SHADER_H__ */

View File

@@ -131,7 +131,6 @@
* "source" : "source-state",
* "target" : "target-state",
* "duration" : milliseconds,
* "animator" : "animator-definition"
* },
* ...
* ]
@@ -142,7 +141,7 @@
* as clutter_state_set_key() function arguments.
*
* The source and target values control the source and target state of the
* transition. The key and animator properties are mutually exclusive.
* transition.
*
* The pre-delay and post-delay values are optional.
*
@@ -189,7 +188,6 @@
#include "clutter-alpha.h"
#include "clutter-animatable.h"
#include "clutter-animator.h"
#include "clutter-enum-types.h"
#include "clutter-interval.h"
#include "clutter-marshal.h"
@@ -197,11 +195,6 @@
#include "clutter-scriptable.h"
#include "clutter-script-private.h"
typedef struct StateAnimator {
const gchar *source_state_name; /* interned string identifying entry */
ClutterAnimator *animator; /* pointer to animator itself */
} StateAnimator;
typedef struct State
{
const gchar *name; /* interned string for this state name */
@@ -209,8 +202,6 @@ typedef struct State
names */
GList *keys; /* list of all keys pertaining to transitions
from other states to this one */
GArray *animators; /* list of animators for transitioning from
* specific source states */
ClutterState *clutter_state; /* the ClutterState object this state belongs to
*/
} State;
@@ -227,8 +218,6 @@ struct _ClutterStatePrivate
State *source_state; /* current source_state */
const gchar *target_state_name; /* current target state */
State *target_state; /* target state name */
ClutterAnimator *current_animator; /* !NULL if the current transition is
overriden by an animator */
};
#define SLAVE_TIMELINE_LENGTH 10000
@@ -496,7 +485,6 @@ state_free (gpointer data)
state->keys = g_list_remove (state->keys, state->keys->data))
clutter_state_key_free (state->keys->data);
g_array_free (state->animators, TRUE);
g_hash_table_destroy (state->durations);
g_free (state);
}
@@ -510,7 +498,6 @@ state_new (ClutterState *clutter_state,
state = g_new0 (State, 1);
state->clutter_state = clutter_state;
state->name = name;
state->animators = g_array_new (TRUE, TRUE, sizeof (StateAnimator));
state->durations = g_hash_table_new (g_direct_hash, g_direct_equal);
return state;
@@ -533,14 +520,6 @@ static void
clutter_state_completed (ClutterTimeline *timeline,
ClutterState *state)
{
ClutterStatePrivate *priv = state->priv;
if (priv->current_animator)
{
clutter_animator_set_timeline (priv->current_animator, NULL);
priv->current_animator = NULL;
}
g_signal_emit (state, state_signals[COMPLETED], 0);
}
@@ -556,9 +535,6 @@ clutter_state_new_frame (ClutterTimeline *timeline,
GObject *curobj = NULL;
gboolean found_specific = FALSE;
if (priv->current_animator)
return;
progress = clutter_timeline_get_progress (timeline);
for (k = priv->target_state->keys; k; k = k->next)
@@ -649,7 +625,6 @@ clutter_state_change (ClutterState *state,
gboolean animate)
{
ClutterStatePrivate *priv;
ClutterAnimator *animator;
State *new_state;
guint duration;
GList *k;
@@ -673,12 +648,6 @@ clutter_state_change (ClutterState *state,
clutter_timeline_stop (priv->timeline);
clutter_timeline_rewind (priv->timeline);
if (priv->current_animator)
{
clutter_animator_set_timeline (priv->current_animator, NULL);
priv->current_animator = NULL;
}
return NULL;
}
@@ -694,12 +663,6 @@ clutter_state_change (ClutterState *state,
return priv->timeline;
}
if (priv->current_animator != NULL)
{
clutter_animator_set_timeline (priv->current_animator, NULL);
priv->current_animator = NULL;
}
priv->source_state_name = priv->target_state_name;
priv->target_state_name = target_state_name;
@@ -718,55 +681,37 @@ clutter_state_change (ClutterState *state,
return NULL;
}
animator = clutter_state_get_animator (state,
priv->source_state_name,
priv->target_state_name);
priv->target_state = new_state;
if (animator == NULL && new_state->keys == NULL)
animator = clutter_state_get_animator (state, NULL,
priv->target_state_name);
if (animator != NULL)
for (k = new_state->keys; k != NULL; k = k->next)
{
/* we've got an animator overriding the tweened animation */
priv->current_animator = animator;
clutter_animator_set_timeline (animator, priv->timeline);
}
else
{
for (k = new_state->keys; k != NULL; k = k->next)
ClutterStateKey *key = k->data;
GValue initial = G_VALUE_INIT;
/* Reset the pre-pre-delay - this is only used for setting keys
* during transitions.
*/
key->pre_pre_delay = 0;
g_value_init (&initial, clutter_interval_get_value_type (key->interval));
if (key->is_animatable)
{
ClutterStateKey *key = k->data;
GValue initial = G_VALUE_INIT;
ClutterAnimatable *animatable;
/* Reset the pre-pre-delay - this is only used for setting keys
* during transitions.
*/
key->pre_pre_delay = 0;
g_value_init (&initial, clutter_interval_get_value_type (key->interval));
if (key->is_animatable)
{
ClutterAnimatable *animatable;
animatable = CLUTTER_ANIMATABLE (key->object);
clutter_animatable_get_initial_state (animatable,
key->property_name,
&initial);
}
else
g_object_get_property (key->object, key->property_name, &initial);
if (clutter_alpha_get_mode (key->alpha) != key->mode)
clutter_alpha_set_mode (key->alpha, key->mode);
clutter_interval_set_initial_value (key->interval, &initial);
clutter_interval_set_final_value (key->interval, &key->value);
g_value_unset (&initial);
animatable = CLUTTER_ANIMATABLE (key->object);
clutter_animatable_get_initial_state (animatable,
key->property_name,
&initial);
}
else
g_object_get_property (key->object, key->property_name, &initial);
if (clutter_alpha_get_mode (key->alpha) != key->mode)
clutter_alpha_set_mode (key->alpha, key->mode);
clutter_interval_set_initial_value (key->interval, &initial);
clutter_interval_set_final_value (key->interval, &key->value);
g_value_unset (&initial);
}
if (!animate)
@@ -1549,126 +1494,6 @@ clutter_state_init (ClutterState *self)
}
/**
* clutter_state_get_animator:
* @state: a #ClutterState instance.
* @source_state_name: the name of a source state
* @target_state_name: the name of a target state
*
* Retrieves the #ClutterAnimator that is being used for transitioning
* between the two states, if any has been set
*
* Return value: (transfer none): a #ClutterAnimator instance, or %NULL
*
* Since: 1.4
* Deprecated: 1.12: Use #ClutterKeyframeTransition and
* #ClutterTransitionGroup instead
*/
ClutterAnimator *
clutter_state_get_animator (ClutterState *state,
const gchar *source_state_name,
const gchar *target_state_name)
{
State *target_state;
guint i;
g_return_val_if_fail (CLUTTER_IS_STATE (state), NULL);
source_state_name = g_intern_string (source_state_name);
if (source_state_name == g_intern_static_string (""))
source_state_name = NULL;
target_state_name = g_intern_string (target_state_name);
target_state = clutter_state_fetch_state (state, target_state_name, FALSE);
if (target_state == NULL)
return NULL;
for (i = 0; i < target_state->animators->len; i++)
{
const StateAnimator *animator;
animator = &g_array_index (target_state->animators, StateAnimator, i);
if (animator->source_state_name == source_state_name)
return animator->animator;
}
return NULL;
}
/**
* clutter_state_set_animator:
* @state: a #ClutterState instance.
* @source_state_name: the name of a source state
* @target_state_name: the name of a target state
* @animator: (allow-none): a #ClutterAnimator instance, or %NULL to
* unset an existing #ClutterAnimator
*
* Specifies a #ClutterAnimator to be used when transitioning between
* the two named states.
*
* The @animator allows specifying a transition between the state that is
* more elaborate than the basic transitions allowed by the tweening of
* properties defined in the #ClutterState keys.
*
* If @animator is %NULL it will unset an existing animator.
*
* #ClutterState will take a reference on the passed @animator, if any
*
* Since: 1.4
* Deprecated: 1.12: Use #ClutterKeyframeTransition and
* #ClutterTransitionGroup instead
*/
void
clutter_state_set_animator (ClutterState *state,
const gchar *source_state_name,
const gchar *target_state_name,
ClutterAnimator *animator)
{
State *target_state;
guint i;
g_return_if_fail (CLUTTER_IS_STATE (state));
source_state_name = g_intern_string (source_state_name);
target_state_name = g_intern_string (target_state_name);
target_state = clutter_state_fetch_state (state, target_state_name, TRUE);
if (target_state == NULL)
return;
for (i = 0; target_state->animators->len; i++)
{
StateAnimator *a;
a = &g_array_index (target_state->animators, StateAnimator, i);
if (a->source_state_name == source_state_name)
{
g_object_unref (a->animator);
if (animator != NULL)
a->animator = g_object_ref (animator);
else
{
/* remove the matched animator if passed NULL */
g_array_remove_index (target_state->animators, i);
}
return;
}
}
if (animator != NULL)
{
StateAnimator state_animator = {
source_state_name,
g_object_ref (animator)
};
g_array_append_val (target_state->animators, state_animator);
}
}
static gpointer
clutter_state_key_copy (gpointer boxed)
{
@@ -2107,12 +1932,10 @@ parse_state_transition (JsonArray *array,
if (!json_object_has_member (object, "source") ||
!json_object_has_member (object, "target") ||
!(json_object_has_member (object, "keys") ||
json_object_has_member (object, "animator")))
!(json_object_has_member (object, "keys")))
{
g_warning ("The transition description at index %d is missing one "
"of the mandatory members: source, target and keys or "
"animator", index_);
"of the mandatory members: source, target and keys", index_);
return;
}
@@ -2131,29 +1954,11 @@ parse_state_transition (JsonArray *array,
duration);
}
if (json_object_has_member (object, "animator"))
{
const gchar *id_ = json_object_get_string_member (object, "animator");
GObject *animator;
animator = clutter_script_get_object (clos->script, id_);
if (animator == NULL)
{
g_warning ("No object with id '%s' has been defined.", id_);
return;
}
clutter_state_set_animator (clos->state,
source_name,
target_name,
CLUTTER_ANIMATOR (animator));
}
if (!json_object_has_member (object, "keys"))
return;
keys = json_object_get_array_member (object, "keys");
if (keys == NULL && !json_object_has_member (object, "animator"))
if (keys == NULL)
{
g_warning ("The transition description at index %d has an invalid "
"key member of type '%s' when an array was expected.",

View File

@@ -145,15 +145,6 @@ void clutter_state_remove_key (ClutterState *state,
CLUTTER_DEPRECATED
ClutterTimeline * clutter_state_get_timeline (ClutterState *state);
CLUTTER_DEPRECATED
void clutter_state_set_animator (ClutterState *state,
const gchar *source_state_name,
const gchar *target_state_name,
ClutterAnimator *animator);
CLUTTER_DEPRECATED
ClutterAnimator * clutter_state_get_animator (ClutterState *state,
const gchar *source_state_name,
const gchar *target_state_name);
CLUTTER_DEPRECATED
const gchar * clutter_state_get_state (ClutterState *state);
/*

View File

@@ -66,7 +66,6 @@
#include "deprecated/clutter-shader.h"
#include "deprecated/clutter-texture.h"
#include "deprecated/clutter-util.h"
typedef struct _ClutterTextureAsyncData ClutterTextureAsyncData;
@@ -480,22 +479,10 @@ update_fbo (ClutterActor *self)
{
ClutterTexture *texture = CLUTTER_TEXTURE (self);
ClutterTexturePrivate *priv = texture->priv;
ClutterActor *head;
ClutterShader *shader = NULL;
ClutterActor *stage = NULL;
CoglMatrix projection;
CoglColor transparent_col;
head = _clutter_context_peek_shader_stack ();
if (head != NULL)
shader = clutter_actor_get_shader (head);
/* Temporarily turn off the shader on the top of the context's
* shader stack, to restore the GL pipeline to it's natural state.
*/
if (shader != NULL)
clutter_shader_set_is_enabled (shader, FALSE);
/* Redirect drawing to the fbo */
cogl_push_framebuffer (priv->fbo_handle);
@@ -554,10 +541,6 @@ update_fbo (ClutterActor *self)
/* Restore drawing to the previous framebuffer */
cogl_pop_framebuffer ();
/* If there is a shader on top of the shader stack, turn it back on. */
if (shader != NULL)
clutter_shader_set_is_enabled (shader, TRUE);
}
static void

View File

@@ -1,498 +0,0 @@
/*
* Clutter.
*
* An OpenGL based 'interactive canvas' library.
*
* Authored By Matthew Allum <mallum@openedhand.com>
*
* Copyright (C) 2006 OpenedHand
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library. If not, see <http://www.gnu.org/licenses/>.
*
*
*
* ClutterTimeoutPool: pool of timeout functions using the same slice of
* the GLib main loop
*
* Author: Emmanuele Bassi <ebassi@openedhand.com>
*
* Based on similar code by Tristan van Berkom
*/
#include "clutter-build-config.h"
#define CLUTTER_DISABLE_DEPRECATION_WARNINGS
#include "deprecated/clutter-main.h"
#include "clutter-timeout-pool.h"
#include "clutter-debug.h"
#include "clutter-timeout-interval.h"
typedef struct _ClutterTimeout ClutterTimeout;
typedef enum {
CLUTTER_TIMEOUT_NONE = 0,
CLUTTER_TIMEOUT_READY = 1 << 1
} ClutterTimeoutFlags;
struct _ClutterTimeout
{
guint id;
ClutterTimeoutFlags flags;
gint refcount;
ClutterTimeoutInterval interval;
GSourceFunc func;
gpointer data;
GDestroyNotify notify;
};
struct _ClutterTimeoutPool
{
GSource source;
guint next_id;
GList *timeouts;
GList *dispatched_timeouts;
gint ready;
guint id;
};
#define TIMEOUT_READY(timeout) (timeout->flags & CLUTTER_TIMEOUT_READY)
static gboolean clutter_timeout_pool_prepare (GSource *source,
gint *next_timeout);
static gboolean clutter_timeout_pool_check (GSource *source);
static gboolean clutter_timeout_pool_dispatch (GSource *source,
GSourceFunc callback,
gpointer data);
static void clutter_timeout_pool_finalize (GSource *source);
static GSourceFuncs clutter_timeout_pool_funcs =
{
clutter_timeout_pool_prepare,
clutter_timeout_pool_check,
clutter_timeout_pool_dispatch,
clutter_timeout_pool_finalize
};
static gint
clutter_timeout_sort (gconstpointer a,
gconstpointer b)
{
const ClutterTimeout *t_a = a;
const ClutterTimeout *t_b = b;
/* Keep 'ready' timeouts at the front */
if (TIMEOUT_READY (t_a))
return -1;
if (TIMEOUT_READY (t_b))
return 1;
return _clutter_timeout_interval_compare_expiration (&t_a->interval,
&t_b->interval);
}
static gint
clutter_timeout_find_by_id (gconstpointer a,
gconstpointer b)
{
const ClutterTimeout *t_a = a;
return t_a->id == GPOINTER_TO_UINT (b) ? 0 : 1;
}
static ClutterTimeout *
clutter_timeout_new (guint fps)
{
ClutterTimeout *timeout;
timeout = g_slice_new0 (ClutterTimeout);
_clutter_timeout_interval_init (&timeout->interval, fps);
timeout->flags = CLUTTER_TIMEOUT_NONE;
timeout->refcount = 1;
return timeout;
}
static gboolean
clutter_timeout_prepare (ClutterTimeoutPool *pool,
ClutterTimeout *timeout,
gint *next_timeout)
{
GSource *source = (GSource *) pool;
gint64 now;
#if GLIB_CHECK_VERSION (2, 27, 3)
now = g_source_get_time (source) / 1000;
#else
{
GTimeVal source_time;
g_source_get_current_time (source, &source_time);
now = source_time.tv_sec * 1000 + source_time.tv_usec / 1000;
}
#endif
return _clutter_timeout_interval_prepare (now,
&timeout->interval,
next_timeout);
}
/* ref and unref are always called under the main Clutter lock, so there
* is not need for us to use g_atomic_int_* API.
*/
static ClutterTimeout *
clutter_timeout_ref (ClutterTimeout *timeout)
{
g_return_val_if_fail (timeout != NULL, timeout);
g_return_val_if_fail (timeout->refcount > 0, timeout);
timeout->refcount += 1;
return timeout;
}
static void
clutter_timeout_unref (ClutterTimeout *timeout)
{
g_return_if_fail (timeout != NULL);
g_return_if_fail (timeout->refcount > 0);
timeout->refcount -= 1;
if (timeout->refcount == 0)
{
if (timeout->notify)
timeout->notify (timeout->data);
g_slice_free (ClutterTimeout, timeout);
}
}
static void
clutter_timeout_free (ClutterTimeout *timeout)
{
if (G_LIKELY (timeout))
{
if (timeout->notify)
timeout->notify (timeout->data);
g_slice_free (ClutterTimeout, timeout);
}
}
static gboolean
clutter_timeout_pool_prepare (GSource *source,
gint *next_timeout)
{
ClutterTimeoutPool *pool = (ClutterTimeoutPool *) source;
GList *l = pool->timeouts;
/* the pool is ready if the first timeout is ready */
if (l && l->data)
{
ClutterTimeout *timeout = l->data;
return clutter_timeout_prepare (pool, timeout, next_timeout);
}
else
{
*next_timeout = -1;
return FALSE;
}
}
static gboolean
clutter_timeout_pool_check (GSource *source)
{
ClutterTimeoutPool *pool = (ClutterTimeoutPool *) source;
GList *l;
clutter_threads_enter ();
for (l = pool->timeouts; l; l = l->next)
{
ClutterTimeout *timeout = l->data;
/* since the timeouts are sorted by expiration, as soon
* as we get a check returning FALSE we know that the
* following timeouts are not expiring, so we break as
* soon as possible
*/
if (clutter_timeout_prepare (pool, timeout, NULL))
{
timeout->flags |= CLUTTER_TIMEOUT_READY;
pool->ready += 1;
}
else
break;
}
clutter_threads_leave ();
return (pool->ready > 0);
}
static gboolean
clutter_timeout_pool_dispatch (GSource *source,
GSourceFunc func,
gpointer data)
{
ClutterTimeoutPool *pool = (ClutterTimeoutPool *) source;
GList *dispatched_timeouts;
/* the main loop might have predicted this, so we repeat the
* check for ready timeouts.
*/
if (!pool->ready)
clutter_timeout_pool_check (source);
clutter_threads_enter ();
/* Iterate by moving the actual start of the list along so that it
* can cope with adds and removes while a timeout is being dispatched
*/
while (pool->timeouts && pool->timeouts->data && pool->ready-- > 0)
{
ClutterTimeout *timeout = pool->timeouts->data;
GList *l;
/* One of the ready timeouts may have been removed during dispatch,
* in which case pool->ready will be wrong, but the ready timeouts
* are always kept at the start of the list so we can stop once
* we've reached the first non-ready timeout
*/
if (!(TIMEOUT_READY (timeout)))
break;
/* Add a reference to the timeout so it can't disappear
* while it's being dispatched
*/
clutter_timeout_ref (timeout);
timeout->flags &= ~CLUTTER_TIMEOUT_READY;
/* Move the list node to a list of dispatched timeouts */
l = pool->timeouts;
if (l->next)
l->next->prev = NULL;
pool->timeouts = l->next;
if (pool->dispatched_timeouts)
pool->dispatched_timeouts->prev = l;
l->prev = NULL;
l->next = pool->dispatched_timeouts;
pool->dispatched_timeouts = l;
if (!_clutter_timeout_interval_dispatch (&timeout->interval,
timeout->func, timeout->data))
{
/* The timeout may have already been removed, but nothing
* can be added to the dispatched_timeout list except in this
* function so it will always either be at the head of the
* dispatched list or have been removed
*/
if (pool->dispatched_timeouts &&
pool->dispatched_timeouts->data == timeout)
{
pool->dispatched_timeouts =
g_list_delete_link (pool->dispatched_timeouts,
pool->dispatched_timeouts);
/* Remove the reference that was held by it being in the list */
clutter_timeout_unref (timeout);
}
}
clutter_timeout_unref (timeout);
}
/* Re-insert the dispatched timeouts in sorted order */
dispatched_timeouts = pool->dispatched_timeouts;
while (dispatched_timeouts)
{
ClutterTimeout *timeout = dispatched_timeouts->data;
GList *next = dispatched_timeouts->next;
if (timeout)
pool->timeouts = g_list_insert_sorted (pool->timeouts, timeout,
clutter_timeout_sort);
dispatched_timeouts = next;
}
g_list_free (pool->dispatched_timeouts);
pool->dispatched_timeouts = NULL;
pool->ready = 0;
clutter_threads_leave ();
return TRUE;
}
static void
clutter_timeout_pool_finalize (GSource *source)
{
ClutterTimeoutPool *pool = (ClutterTimeoutPool *) source;
/* force destruction */
g_list_foreach (pool->timeouts, (GFunc) clutter_timeout_free, NULL);
g_list_free (pool->timeouts);
}
/**
* clutter_timeout_pool_new:
* @priority: the priority of the timeout pool. Typically this will
* be #G_PRIORITY_DEFAULT
*
* Creates a new timeout pool source. A timeout pool should be used when
* multiple timeout functions, running at the same priority, are needed and
* the g_timeout_add() API might lead to starvation of the time slice of
* the main loop. A timeout pool allocates a single time slice of the main
* loop and runs every timeout function inside it. The timeout pool is
* always sorted, so that the extraction of the next timeout function is
* a constant time operation.
*
* Return value: the newly created #ClutterTimeoutPool. The created pool
* is owned by the GLib default context and will be automatically
* destroyed when the context is destroyed. It is possible to force
* the destruction of the timeout pool using g_source_destroy()
*
* Since: 0.4
*
* Deprecated: 1.6: There is no direct replacement for this API
*/
ClutterTimeoutPool *
clutter_timeout_pool_new (gint priority)
{
ClutterTimeoutPool *pool;
GSource *source;
source = g_source_new (&clutter_timeout_pool_funcs,
sizeof (ClutterTimeoutPool));
if (!source)
return NULL;
g_source_set_name (source, "Clutter timeout pool");
if (priority != G_PRIORITY_DEFAULT)
g_source_set_priority (source, priority);
pool = (ClutterTimeoutPool *) source;
pool->next_id = 1;
pool->id = g_source_attach (source, NULL);
/* let the default GLib context manage the pool */
g_source_unref (source);
return pool;
}
/**
* clutter_timeout_pool_add:
* @pool: a #ClutterTimeoutPool
* @fps: the time between calls to the function, in frames per second
* @func: function to call
* @data: (closure): data to pass to the function, or %NULL
* @notify: function to call when the timeout is removed, or %NULL
*
* Sets a function to be called at regular intervals, and puts it inside
* the @pool. The function is repeatedly called until it returns %FALSE,
* at which point the timeout is automatically destroyed and the function
* won't be called again. If @notify is not %NULL, the @notify function
* will be called. The first call to @func will be at the end of @interval.
*
* Since Clutter 0.8 this will try to compensate for delays. For
* example, if @func takes half the interval time to execute then the
* function will be called again half the interval time after it
* finished. Before version 0.8 it would not fire until a full
* interval after the function completes so the delay between calls
* would be @interval * 1.5. This function does not however try to
* invoke the function multiple times to catch up missing frames if
* @func takes more than @interval ms to execute.
*
* Return value: the ID (greater than 0) of the timeout inside the pool.
* Use clutter_timeout_pool_remove() to stop the timeout.
*
* Since: 0.4
*
* Deprecated: 1.6: There is no direct replacement for this API
*/
guint
clutter_timeout_pool_add (ClutterTimeoutPool *pool,
guint fps,
GSourceFunc func,
gpointer data,
GDestroyNotify notify)
{
ClutterTimeout *timeout;
guint retval = 0;
timeout = clutter_timeout_new (fps);
retval = timeout->id = pool->next_id++;
timeout->func = func;
timeout->data = data;
timeout->notify = notify;
pool->timeouts = g_list_insert_sorted (pool->timeouts, timeout,
clutter_timeout_sort);
return retval;
}
/**
* clutter_timeout_pool_remove:
* @pool: a #ClutterTimeoutPool
* @id_: the id of the timeout to remove
*
* Removes a timeout function with @id_ from the timeout pool. The id
* is the same returned when adding a function to the timeout pool with
* clutter_timeout_pool_add().
*
* Since: 0.4
*
* Deprecated: 1.6: There is no direct replacement for this API
*/
void
clutter_timeout_pool_remove (ClutterTimeoutPool *pool,
guint id_)
{
GList *l;
if ((l = g_list_find_custom (pool->timeouts, GUINT_TO_POINTER (id_),
clutter_timeout_find_by_id)))
{
clutter_timeout_unref (l->data);
pool->timeouts = g_list_delete_link (pool->timeouts, l);
}
else if ((l = g_list_find_custom (pool->dispatched_timeouts,
GUINT_TO_POINTER (id_),
clutter_timeout_find_by_id)))
{
clutter_timeout_unref (l->data);
pool->dispatched_timeouts =
g_list_delete_link (pool->dispatched_timeouts, l);
}
}

View File

@@ -1,69 +0,0 @@
/*
* Clutter.
*
* An OpenGL based 'interactive canvas' library.
*
* Authored By Matthew Allum <mallum@openedhand.com>
*
* Copyright (C) 2006 OpenedHand
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library. If not, see <http://www.gnu.org/licenses/>.
*
* ClutterTimeoutPool: pool of timeout functions using the same slice of
* the GLib main loop
*
* Author: Emmanuele Bassi <ebassi@openedhand.com>
*
* Based on similar code by Tristan van Berkom
*/
#if !defined(__CLUTTER_H_INSIDE__) && !defined(CLUTTER_COMPILATION)
#error "Only <clutter/clutter.h> can be included directly."
#endif
#ifndef __CLUTTER_TIMEOUT_POOL_H__
#define __CLUTTER_TIMEOUT_POOL_H__
#include <clutter/clutter-types.h>
G_BEGIN_DECLS
/**
* ClutterTimeoutPool: (skip)
*
* #ClutterTimeoutPool is an opaque structure
* whose members cannot be directly accessed.
*
* Since: 0.6
*
* Deprecated: 1.6
*/
typedef struct _ClutterTimeoutPool ClutterTimeoutPool;
CLUTTER_DEPRECATED
ClutterTimeoutPool *clutter_timeout_pool_new (gint priority);
CLUTTER_DEPRECATED
guint clutter_timeout_pool_add (ClutterTimeoutPool *pool,
guint fps,
GSourceFunc func,
gpointer data,
GDestroyNotify notify);
CLUTTER_DEPRECATED
void clutter_timeout_pool_remove (ClutterTimeoutPool *pool,
guint id_);
G_END_DECLS
#endif /* __CLUTTER_TIMEOUT_POOL_H__ */

View File

@@ -1,40 +0,0 @@
/*
* Clutter.
*
* An OpenGL based 'interactive canvas' library.
*
* Authored By Matthew Allum <mallum@openedhand.com>
*
* Copyright (C) 2006 OpenedHand
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library. If not, see <http://www.gnu.org/licenses/>.
*/
#if !defined(__CLUTTER_H_INSIDE__) && !defined(CLUTTER_COMPILATION)
#error "Only <clutter/clutter.h> can be included directly."
#endif
#ifndef __CLUTTER_UTIL_H__
#define __CLUTTER_UTIL_H__
#include <clutter/clutter-types.h>
G_BEGIN_DECLS
CLUTTER_DEPRECATED
gint clutter_util_next_p2 (gint a);
G_END_DECLS
#endif /* __CLUTTER_UTIL_H__ */

View File

@@ -264,40 +264,6 @@ clutter_backend_egl_native_new (void)
return g_object_new (CLUTTER_TYPE_BACKEND_EGL_NATIVE, NULL);
}
/**
* clutter_eglx_display:
*
* Retrieves the EGL display used by Clutter.
*
* Return value: the EGL display, or 0
*
* Since: 0.6
*
* Deprecated: 1.6: Use clutter_egl_get_egl_display() instead.
*/
EGLDisplay
clutter_eglx_display (void)
{
return clutter_egl_get_egl_display ();
}
/**
* clutter_egl_display:
*
* Retrieves the EGL display used by Clutter.
*
* Return value: the EGL display used by Clutter, or 0
*
* Since: 0.6
*
* Deprecated: 1.6: Use clutter_egl_get_egl_display() instead.
*/
EGLDisplay
clutter_egl_display (void)
{
return clutter_egl_get_egl_display ();
}
/**
* clutter_egl_get_egl_display:
*

View File

@@ -48,33 +48,6 @@
G_BEGIN_DECLS
/**
* clutter_eglx_display:
*
* Retrieves the #EGLDisplay used by Clutter,
* if Clutter has been compiled with EGL and X11 support.
*
* Return value: the EGL display
*
* Since: 0.4
*
* Deprecated: 1.6: Use clutter_egl_get_egl_display() instead
*/
CLUTTER_DEPRECATED_FOR(clutter_egl_get_egl_display)
EGLDisplay clutter_eglx_display (void);
/**
* clutter_egl_display:
*
* Retrieves the #EGLDisplay used by Clutter
*
* Return value: the EGL display
*
* Deprecated: 1.6: Use clutter_egl_get_egl_display() instead
*/
CLUTTER_DEPRECATED_FOR(clutter_egl_get_egl_display)
EGLDisplay clutter_egl_display (void);
/**
* clutter_egl_get_egl_display:
*

View File

@@ -220,8 +220,6 @@ clutter_deprecated_headers = [
'deprecated/clutter-alpha.h',
'deprecated/clutter-animatable.h',
'deprecated/clutter-animation.h',
'deprecated/clutter-animator.h',
'deprecated/clutter-backend.h',
'deprecated/clutter-behaviour.h',
'deprecated/clutter-behaviour-depth.h',
'deprecated/clutter-behaviour-ellipse.h',
@@ -233,7 +231,6 @@ clutter_deprecated_headers = [
'deprecated/clutter-box.h',
'deprecated/clutter-cairo-texture.h',
'deprecated/clutter-container.h',
'deprecated/clutter-frame-source.h',
'deprecated/clutter-group.h',
'deprecated/clutter-input-device.h',
'deprecated/clutter-keysyms.h',
@@ -241,7 +238,6 @@ clutter_deprecated_headers = [
'deprecated/clutter-main.h',
'deprecated/clutter-model.h',
'deprecated/clutter-rectangle.h',
'deprecated/clutter-score.h',
'deprecated/clutter-shader.h',
'deprecated/clutter-stage-manager.h',
'deprecated/clutter-stage.h',
@@ -249,15 +245,12 @@ clutter_deprecated_headers = [
'deprecated/clutter-table-layout.h',
'deprecated/clutter-texture.h',
'deprecated/clutter-timeline.h',
'deprecated/clutter-timeout-pool.h',
'deprecated/clutter-util.h',
]
clutter_deprecated_sources = [
'deprecated/clutter-actor-deprecated.c',
'deprecated/clutter-alpha.c',
'deprecated/clutter-animation.c',
'deprecated/clutter-animator.c',
'deprecated/clutter-behaviour.c',
'deprecated/clutter-behaviour-depth.c',
'deprecated/clutter-behaviour-ellipse.c',
@@ -267,19 +260,16 @@ clutter_deprecated_sources = [
'deprecated/clutter-behaviour-scale.c',
'deprecated/clutter-box.c',
'deprecated/clutter-cairo-texture.c',
'deprecated/clutter-frame-source.c',
'deprecated/clutter-group.c',
'deprecated/clutter-input-device-deprecated.c',
'deprecated/clutter-layout-manager-deprecated.c',
'deprecated/clutter-list-model.c',
'deprecated/clutter-model.c',
'deprecated/clutter-rectangle.c',
'deprecated/clutter-score.c',
'deprecated/clutter-shader.c',
'deprecated/clutter-state.c',
'deprecated/clutter-table-layout.c',
'deprecated/clutter-texture.c',
'deprecated/clutter-timeout-pool.c',
]
clutter_deprecated_private_headers = [
@@ -303,10 +293,8 @@ clutter_backend_private_headers = [
if have_x11
clutter_x11_sources = [
'x11/clutter-backend-x11.c',
'x11/clutter-device-manager-core-x11.c',
'x11/clutter-device-manager-xi2.c',
'x11/clutter-event-x11.c',
'x11/clutter-input-device-core-x11.c',
'x11/clutter-input-device-tool-xi2.c',
'x11/clutter-input-device-xi2.c',
'x11/clutter-keymap-x11.c',
@@ -329,9 +317,7 @@ if have_x11
clutter_x11_private_headers = [
'x11/clutter-backend-x11.h',
'x11/clutter-device-manager-core-x11.h',
'x11/clutter-device-manager-xi2.h',
'x11/clutter-input-device-core-x11.h',
'x11/clutter-input-device-tool-xi2.h',
'x11/clutter-input-device-xi2.h',
'x11/clutter-keymap-x11.h',

View File

@@ -34,7 +34,6 @@
#include <errno.h>
#include "clutter-backend-x11.h"
#include "clutter-device-manager-core-x11.h"
#include "clutter-device-manager-xi2.h"
#include "clutter-settings-x11.h"
#include "clutter-stage-x11.h"
@@ -265,13 +264,8 @@ clutter_backend_x11_create_device_manager (ClutterBackendX11 *backend_x11)
if (backend_x11->device_manager == NULL)
{
CLUTTER_NOTE (BACKEND, "Creating Core device manager");
g_critical ("XI2 extension is missing.");
backend_x11->has_xinput = FALSE;
backend_x11->device_manager =
g_object_new (CLUTTER_TYPE_DEVICE_MANAGER_X11,
"backend", backend_x11,
NULL);
backend_x11->xi_minor = -1;
}
@@ -480,9 +474,6 @@ _clutter_backend_x11_events_init (ClutterBackend *backend)
backend_x11->event_source = source;
}
/* create the device manager; we need this because we can effectively
* choose between core+XI1 and XI2 input events
*/
clutter_backend_x11_create_device_manager (backend_x11);
/* register keymap; unless we create a generic Keymap object, I'm
@@ -678,8 +669,8 @@ static gboolean
check_onscreen_template (CoglRenderer *renderer,
CoglSwapChain *swap_chain,
CoglOnscreenTemplate *onscreen_template,
CoglBool enable_argb,
CoglBool enable_stereo,
gboolean enable_argb,
gboolean enable_stereo,
GError **error)
{
GError *internal_error = NULL;
@@ -948,30 +939,6 @@ clutter_x11_set_display (Display *xdpy)
_foreign_dpy= xdpy;
}
/**
* clutter_x11_enable_xinput:
*
* Enables the use of the XInput extension if present on connected
* XServer and support built into Clutter. XInput allows for multiple
* pointing devices to be used.
*
* This function must be called before clutter_init().
*
* Since XInput might not be supported by the X server, you might
* want to use clutter_x11_has_xinput() to see if support was enabled.
*
* Since: 0.8
*
* Deprecated: 1.14: This function does not do anything; XInput support
* is enabled by default in Clutter. Use the CLUTTER_DISABLE_XINPUT
* environment variable to disable XInput support and use Xlib core
* events instead.
*/
void
clutter_x11_enable_xinput (void)
{
}
/**
* clutter_x11_disable_event_retrieval:
*
@@ -1180,31 +1147,6 @@ clutter_x11_remove_filter (ClutterX11FilterFunc func,
}
}
/**
* clutter_x11_get_input_devices:
*
* Retrieves a pointer to the list of input devices
*
* Deprecated: 1.2: Use clutter_device_manager_peek_devices() instead
*
* Since: 0.8
*
* Return value: (transfer none) (element-type Clutter.InputDevice): a
* pointer to the internal list of input devices; the returned list is
* owned by Clutter and should not be modified or freed
*/
const GSList *
clutter_x11_get_input_devices (void)
{
ClutterDeviceManager *manager;
manager = clutter_device_manager_get_default ();
if (manager == NULL)
return NULL;
return clutter_device_manager_peek_devices (manager);
}
/**
* clutter_x11_has_xinput:
*

View File

@@ -1,555 +0,0 @@
/*
* Clutter.
*
* An OpenGL based 'interactive canvas' library.
*
* Copyright © 2009, 2010, 2011 Intel Corp.
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library. If not, see <http://www.gnu.org/licenses/>.
*
* Author: Emmanuele Bassi <ebassi@linux.intel.com>
*/
#include "clutter-build-config.h"
#include "clutter-device-manager-core-x11.h"
#include "clutter-backend-x11.h"
#include "clutter-input-device-core-x11.h"
#include "clutter-stage-x11.h"
#include "clutter-virtual-input-device-x11.h"
#include "clutter-backend.h"
#include "clutter-debug.h"
#include "clutter-device-manager-private.h"
#include "clutter-event-private.h"
#include "clutter-event-translator.h"
#include "clutter-stage-private.h"
#include "clutter-private.h"
#include "clutter-xkb-a11y-x11.h"
enum
{
PROP_0,
PROP_EVENT_BASE,
PROP_LAST
};
static GParamSpec *obj_props[PROP_LAST] = { NULL, };
static void clutter_event_translator_iface_init (ClutterEventTranslatorIface *iface);
#define clutter_device_manager_x11_get_type _clutter_device_manager_x11_get_type
G_DEFINE_TYPE_WITH_CODE (ClutterDeviceManagerX11,
clutter_device_manager_x11,
CLUTTER_TYPE_DEVICE_MANAGER,
G_IMPLEMENT_INTERFACE (CLUTTER_TYPE_EVENT_TRANSLATOR,
clutter_event_translator_iface_init));
static inline void
translate_key_event (ClutterBackendX11 *backend_x11,
ClutterDeviceManagerX11 *manager_x11,
ClutterEvent *event,
XEvent *xevent)
{
ClutterEventX11 *event_x11;
char buffer[256 + 1];
int n;
event->key.type = xevent->xany.type == KeyPress ? CLUTTER_KEY_PRESS
: CLUTTER_KEY_RELEASE;
event->key.time = xevent->xkey.time;
clutter_event_set_device (event, manager_x11->core_keyboard);
/* KeyEvents have platform specific data associated to them */
event_x11 = _clutter_event_x11_new ();
_clutter_event_set_platform_data (event, event_x11);
event->key.modifier_state = (ClutterModifierType) xevent->xkey.state;
event->key.hardware_keycode = xevent->xkey.keycode;
/* keyval is the key ignoring all modifiers ('1' vs. '!') */
event->key.keyval =
_clutter_keymap_x11_translate_key_state (backend_x11->keymap,
event->key.hardware_keycode,
&event->key.modifier_state,
NULL);
event_x11->key_group =
_clutter_keymap_x11_get_key_group (backend_x11->keymap,
event->key.modifier_state);
event_x11->key_is_modifier =
_clutter_keymap_x11_get_is_modifier (backend_x11->keymap,
event->key.hardware_keycode);
event_x11->num_lock_set =
clutter_keymap_get_num_lock_state (CLUTTER_KEYMAP (backend_x11->keymap));
event_x11->caps_lock_set =
clutter_keymap_get_caps_lock_state (CLUTTER_KEYMAP (backend_x11->keymap));
/* unicode_value is the printable representation */
n = XLookupString (&xevent->xkey, buffer, sizeof (buffer) - 1, NULL, NULL);
if (n != NoSymbol)
{
event->key.unicode_value = g_utf8_get_char_validated (buffer, n);
if ((event->key.unicode_value != (gunichar) -1) &&
(event->key.unicode_value != (gunichar) -2))
goto out;
}
else
event->key.unicode_value = (gunichar)'\0';
out:
CLUTTER_NOTE (EVENT,
"%s: win:0x%x, key: %12s (%d)",
event->any.type == CLUTTER_KEY_PRESS
? "key press "
: "key release",
(unsigned int) xevent->xkey.window,
event->key.keyval ? buffer : "(none)",
event->key.keyval);
return;
}
static ClutterTranslateReturn
clutter_device_manager_x11_translate_event (ClutterEventTranslator *translator,
gpointer native,
ClutterEvent *event)
{
ClutterDeviceManagerX11 *manager_x11;
ClutterBackendX11 *backend_x11;
ClutterStageX11 *stage_x11;
ClutterTranslateReturn res;
ClutterStage *stage;
XEvent *xevent;
manager_x11 = CLUTTER_DEVICE_MANAGER_X11 (translator);
backend_x11 = CLUTTER_BACKEND_X11 (clutter_get_default_backend ());
xevent = native;
stage = clutter_x11_get_stage_from_window (xevent->xany.window);
if (stage == NULL)
return CLUTTER_TRANSLATE_CONTINUE;
if (CLUTTER_ACTOR_IN_DESTRUCTION (stage))
return CLUTTER_TRANSLATE_CONTINUE;
stage_x11 = CLUTTER_STAGE_X11 (_clutter_stage_get_window (stage));
event->any.stage = stage;
res = CLUTTER_TRANSLATE_CONTINUE;
switch (xevent->type)
{
case KeyPress:
translate_key_event (backend_x11, manager_x11, event, xevent);
_clutter_stage_x11_set_user_time (stage_x11, xevent->xkey.time);
res = CLUTTER_TRANSLATE_QUEUE;
break;
case KeyRelease:
/* old-style X11 terminals require that even modern X11 send
* KeyPress/KeyRelease pairs when auto-repeating. for this
* reason modern(-ish) API like XKB has a way to detect
* auto-repeat and do a single KeyRelease at the end of a
* KeyPress sequence.
*
* this check emulates XKB's detectable auto-repeat; we peek
* the next event and check if it's a KeyPress for the same key
* and timestamp - and then ignore it if it matches the
* KeyRelease
*
* if we have XKB, and autorepeat is enabled, then this becomes
* a no-op
*/
if (!backend_x11->have_xkb_autorepeat && XPending (xevent->xkey.display))
{
XEvent next_event;
XPeekEvent (xevent->xkey.display, &next_event);
if (next_event.type == KeyPress &&
next_event.xkey.keycode == xevent->xkey.keycode &&
next_event.xkey.time == xevent->xkey.time)
{
res = CLUTTER_TRANSLATE_REMOVE;
break;
}
}
translate_key_event (backend_x11, manager_x11, event, xevent);
res = CLUTTER_TRANSLATE_QUEUE;
break;
case ButtonPress:
CLUTTER_NOTE (EVENT,
"button press: win: 0x%x, coords: %d, %d, button: %d",
(unsigned int) stage_x11->xwin,
xevent->xbutton.x,
xevent->xbutton.y,
xevent->xbutton.button);
switch (xevent->xbutton.button)
{
case 4: /* up */
case 5: /* down */
case 6: /* left */
case 7: /* right */
event->scroll.type = CLUTTER_SCROLL;
if (xevent->xbutton.button == 4)
event->scroll.direction = CLUTTER_SCROLL_UP;
else if (xevent->xbutton.button == 5)
event->scroll.direction = CLUTTER_SCROLL_DOWN;
else if (xevent->xbutton.button == 6)
event->scroll.direction = CLUTTER_SCROLL_LEFT;
else
event->scroll.direction = CLUTTER_SCROLL_RIGHT;
event->scroll.time = xevent->xbutton.time;
event->scroll.x = xevent->xbutton.x;
event->scroll.y = xevent->xbutton.y;
event->scroll.modifier_state = xevent->xbutton.state;
event->scroll.axes = NULL;
break;
default:
event->button.type = event->type = CLUTTER_BUTTON_PRESS;
event->button.time = xevent->xbutton.time;
event->button.x = xevent->xbutton.x;
event->button.y = xevent->xbutton.y;
event->button.modifier_state = xevent->xbutton.state;
event->button.button = xevent->xbutton.button;
event->button.axes = NULL;
break;
}
clutter_event_set_device (event, manager_x11->core_pointer);
_clutter_stage_x11_set_user_time (stage_x11, xevent->xbutton.time);
res = CLUTTER_TRANSLATE_QUEUE;
break;
case ButtonRelease:
CLUTTER_NOTE (EVENT,
"button press: win: 0x%x, coords: %d, %d, button: %d",
(unsigned int) stage_x11->xwin,
xevent->xbutton.x,
xevent->xbutton.y,
xevent->xbutton.button);
/* scroll events don't have a corresponding release */
if (xevent->xbutton.button == 4 ||
xevent->xbutton.button == 5 ||
xevent->xbutton.button == 6 ||
xevent->xbutton.button == 7)
{
res = CLUTTER_TRANSLATE_REMOVE;
break;
}
event->button.type = event->type = CLUTTER_BUTTON_RELEASE;
event->button.time = xevent->xbutton.time;
event->button.x = xevent->xbutton.x;
event->button.y = xevent->xbutton.y;
event->button.modifier_state = xevent->xbutton.state;
event->button.button = xevent->xbutton.button;
event->button.axes = NULL;
clutter_event_set_device (event, manager_x11->core_pointer);
res = CLUTTER_TRANSLATE_QUEUE;
break;
case MotionNotify:
CLUTTER_NOTE (EVENT,
"motion: win: 0x%x, coords: %d, %d",
(unsigned int) stage_x11->xwin,
xevent->xmotion.x,
xevent->xmotion.y);
event->motion.type = event->type = CLUTTER_MOTION;
event->motion.time = xevent->xmotion.time;
event->motion.x = xevent->xmotion.x;
event->motion.y = xevent->xmotion.y;
event->motion.modifier_state = xevent->xmotion.state;
event->motion.axes = NULL;
clutter_event_set_device (event, manager_x11->core_pointer);
res = CLUTTER_TRANSLATE_QUEUE;
break;
case EnterNotify:
CLUTTER_NOTE (EVENT, "Entering the stage (time:%u)",
(unsigned int) xevent->xcrossing.time);
event->crossing.type = CLUTTER_ENTER;
event->crossing.time = xevent->xcrossing.time;
event->crossing.x = xevent->xcrossing.x;
event->crossing.y = xevent->xcrossing.y;
event->crossing.source = CLUTTER_ACTOR (stage);
event->crossing.related = NULL;
clutter_event_set_device (event, manager_x11->core_pointer);
_clutter_input_device_set_stage (manager_x11->core_pointer, stage);
res = CLUTTER_TRANSLATE_QUEUE;
break;
case LeaveNotify:
if (manager_x11->core_pointer->stage == NULL)
{
CLUTTER_NOTE (EVENT, "Discarding LeaveNotify for "
"ButtonRelease event off-stage");
res = CLUTTER_TRANSLATE_REMOVE;
break;
}
/* we know that we are leaving the stage here */
CLUTTER_NOTE (EVENT, "Leaving the stage (time:%u)",
(unsigned int) xevent->xcrossing.time);
event->crossing.type = CLUTTER_LEAVE;
event->crossing.time = xevent->xcrossing.time;
event->crossing.x = xevent->xcrossing.x;
event->crossing.y = xevent->xcrossing.y;
event->crossing.source = CLUTTER_ACTOR (stage);
event->crossing.related = NULL;
clutter_event_set_device (event, manager_x11->core_pointer);
_clutter_input_device_set_stage (manager_x11->core_pointer, NULL);
res = CLUTTER_TRANSLATE_QUEUE;
break;
default:
break;
}
return res;
}
static void
clutter_event_translator_iface_init (ClutterEventTranslatorIface *iface)
{
iface->translate_event = clutter_device_manager_x11_translate_event;
}
static void
clutter_device_manager_x11_constructed (GObject *gobject)
{
ClutterDeviceManagerX11 *manager_x11;
ClutterDeviceManager *manager;
ClutterBackendX11 *backend_x11;
manager_x11 = CLUTTER_DEVICE_MANAGER_X11 (gobject);
manager = CLUTTER_DEVICE_MANAGER (gobject);
g_object_get (gobject, "backend", &backend_x11, NULL);
g_assert (backend_x11 != NULL);
manager_x11->core_pointer =
g_object_new (CLUTTER_TYPE_INPUT_DEVICE_X11,
"name", "Core Pointer",
"has-cursor", TRUE,
"device-type", CLUTTER_POINTER_DEVICE,
"device-manager", manager_x11,
"device-mode", CLUTTER_INPUT_MODE_MASTER,
"backend", backend_x11,
"enabled", TRUE,
NULL);
CLUTTER_NOTE (BACKEND, "Added core pointer device");
manager_x11->core_keyboard =
g_object_new (CLUTTER_TYPE_INPUT_DEVICE_X11,
"name", "Core Keyboard",
"has-cursor", FALSE,
"device-type", CLUTTER_KEYBOARD_DEVICE,
"device-manager", manager_x11,
"device-mode", CLUTTER_INPUT_MODE_MASTER,
"backend", backend_x11,
"enabled", TRUE,
NULL);
CLUTTER_NOTE (BACKEND, "Added core keyboard device");
/* associate core devices */
_clutter_input_device_set_associated_device (manager_x11->core_pointer,
manager_x11->core_keyboard);
_clutter_input_device_set_associated_device (manager_x11->core_keyboard,
manager_x11->core_pointer);
clutter_device_manager_x11_a11y_init (manager);
if (G_OBJECT_CLASS (clutter_device_manager_x11_parent_class)->constructed)
G_OBJECT_CLASS (clutter_device_manager_x11_parent_class)->constructed (gobject);
}
static void
clutter_device_manager_x11_add_device (ClutterDeviceManager *manager,
ClutterInputDevice *device)
{
ClutterDeviceManagerX11 *manager_x11 = CLUTTER_DEVICE_MANAGER_X11 (manager);
manager_x11->devices = g_slist_prepend (manager_x11->devices, device);
g_hash_table_replace (manager_x11->devices_by_id,
GINT_TO_POINTER (device->id),
device);
/* blow the cache */
g_slist_free (manager_x11->all_devices);
manager_x11->all_devices = NULL;
}
static void
clutter_device_manager_x11_remove_device (ClutterDeviceManager *manager,
ClutterInputDevice *device)
{
ClutterDeviceManagerX11 *manager_x11 = CLUTTER_DEVICE_MANAGER_X11 (manager);
g_hash_table_remove (manager_x11->devices_by_id,
GINT_TO_POINTER (device->id));
manager_x11->devices = g_slist_remove (manager_x11->devices, device);
/* blow the cache */
g_slist_free (manager_x11->all_devices);
manager_x11->all_devices = NULL;
}
static const GSList *
clutter_device_manager_x11_get_devices (ClutterDeviceManager *manager)
{
ClutterDeviceManagerX11 *manager_x11 = CLUTTER_DEVICE_MANAGER_X11 (manager);
/* cache the devices list so that we can keep the core pointer
* and keyboard outside of the ManagerX11:devices list
*/
if (manager_x11->all_devices == NULL)
{
GSList *all_devices = manager_x11->devices;
all_devices = g_slist_prepend (all_devices, manager_x11->core_keyboard);
all_devices = g_slist_prepend (all_devices, manager_x11->core_pointer);
manager_x11->all_devices = all_devices;
}
return CLUTTER_DEVICE_MANAGER_X11 (manager)->all_devices;
}
static ClutterInputDevice *
clutter_device_manager_x11_get_core_device (ClutterDeviceManager *manager,
ClutterInputDeviceType type)
{
ClutterDeviceManagerX11 *manager_x11;
manager_x11 = CLUTTER_DEVICE_MANAGER_X11 (manager);
switch (type)
{
case CLUTTER_POINTER_DEVICE:
return manager_x11->core_pointer;
case CLUTTER_KEYBOARD_DEVICE:
return manager_x11->core_keyboard;
default:
return NULL;
}
return NULL;
}
static ClutterInputDevice *
clutter_device_manager_x11_get_device (ClutterDeviceManager *manager,
gint id)
{
ClutterDeviceManagerX11 *manager_x11 = CLUTTER_DEVICE_MANAGER_X11 (manager);
return g_hash_table_lookup (manager_x11->devices_by_id,
GINT_TO_POINTER (id));
}
static ClutterVirtualInputDevice *
clutter_device_manager_x11_create_virtual_device (ClutterDeviceManager *device_manager,
ClutterInputDeviceType device_type)
{
return g_object_new (CLUTTER_TYPE_VIRTUAL_INPUT_DEVICE_X11, NULL);
}
static ClutterVirtualDeviceType
clutter_device_manager_x11_get_supported_virtual_device_types (ClutterDeviceManager *device_manager)
{
return (CLUTTER_VIRTUAL_DEVICE_TYPE_KEYBOARD |
CLUTTER_VIRTUAL_DEVICE_TYPE_POINTER);
}
static void
clutter_device_manager_x11_set_property (GObject *gobject,
guint prop_id,
const GValue *value,
GParamSpec *pspec)
{
ClutterDeviceManagerX11 *manager_x11 = CLUTTER_DEVICE_MANAGER_X11 (gobject);
switch (prop_id)
{
case PROP_EVENT_BASE:
manager_x11->xi_event_base = g_value_get_int (value);
break;
default:
G_OBJECT_WARN_INVALID_PROPERTY_ID (gobject, prop_id, pspec);
break;
}
}
static void
clutter_device_manager_x11_class_init (ClutterDeviceManagerX11Class *klass)
{
ClutterDeviceManagerClass *manager_class;
GObjectClass *gobject_class;
obj_props[PROP_EVENT_BASE] =
g_param_spec_int ("event-base",
"Event Base",
"The first XI event",
-1, G_MAXINT,
-1,
CLUTTER_PARAM_WRITABLE | G_PARAM_CONSTRUCT_ONLY);
gobject_class = G_OBJECT_CLASS (klass);
gobject_class->constructed = clutter_device_manager_x11_constructed;
gobject_class->set_property = clutter_device_manager_x11_set_property;
g_object_class_install_properties (gobject_class, PROP_LAST, obj_props);
manager_class = CLUTTER_DEVICE_MANAGER_CLASS (klass);
manager_class->add_device = clutter_device_manager_x11_add_device;
manager_class->remove_device = clutter_device_manager_x11_remove_device;
manager_class->get_devices = clutter_device_manager_x11_get_devices;
manager_class->get_core_device = clutter_device_manager_x11_get_core_device;
manager_class->get_device = clutter_device_manager_x11_get_device;
manager_class->create_virtual_device = clutter_device_manager_x11_create_virtual_device;
manager_class->get_supported_virtual_device_types = clutter_device_manager_x11_get_supported_virtual_device_types;
manager_class->apply_kbd_a11y_settings = clutter_device_manager_x11_apply_kbd_a11y_settings;
}
static void
clutter_device_manager_x11_init (ClutterDeviceManagerX11 *self)
{
self->devices_by_id = g_hash_table_new (NULL, NULL);
}

View File

@@ -1,70 +0,0 @@
/*
* Clutter.
*
* An OpenGL based 'interactive canvas' library.
*
* Copyright © 2009, 2010, 2011 Intel Corp.
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library. If not, see <http://www.gnu.org/licenses/>.
*
* Author: Emmanuele Bassi <ebassi@linux.intel.com>
*/
#ifndef __CLUTTER_DEVICE_MANAGER_X11_H__
#define __CLUTTER_DEVICE_MANAGER_X11_H__
#include <clutter/clutter-device-manager.h>
G_BEGIN_DECLS
#define CLUTTER_TYPE_DEVICE_MANAGER_X11 (_clutter_device_manager_x11_get_type ())
#define CLUTTER_DEVICE_MANAGER_X11(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), CLUTTER_TYPE_DEVICE_MANAGER_X11, ClutterDeviceManagerX11))
#define CLUTTER_IS_DEVICE_MANAGER_X11(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), CLUTTER_TYPE_DEVICE_MANAGER_X11))
#define CLUTTER_DEVICE_MANAGER_X11_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), CLUTTER_TYPE_DEVICE_MANAGER_X11, ClutterDeviceManagerX11Class))
#define CLUTTER_IS_DEVICE_MANAGER_X11_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), CLUTTER_TYPE_DEVICE_MANAGER_X11))
#define CLUTTER_DEVICE_MANAGER_X11_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), CLUTTER_TYPE_DEVICE_MANAGER_X11, ClutterDeviceManagerX11Class))
typedef struct _ClutterDeviceManagerX11 ClutterDeviceManagerX11;
typedef struct _ClutterDeviceManagerX11Class ClutterDeviceManagerX11Class;
struct _ClutterDeviceManagerX11
{
ClutterDeviceManager parent_instance;
GHashTable *devices_by_id;
/* the list of transient devices */
GSList *devices;
/* the list of all devices, transient and core; this can be
* NULL-ified when adding or removing devices
*/
GSList *all_devices;
ClutterInputDevice *core_pointer;
ClutterInputDevice *core_keyboard;
int xi_event_base;
};
struct _ClutterDeviceManagerX11Class
{
ClutterDeviceManagerClass parent_class;
};
GType _clutter_device_manager_x11_get_type (void) G_GNUC_CONST;
G_END_DECLS
#endif /* __CLUTTER_DEVICE_MANAGER_X11_H__ */

View File

@@ -1,159 +0,0 @@
/*
* Clutter.
*
* An OpenGL based 'interactive canvas' library.
*
* Authored By Johan Bilien <johan.bilien@nokia.com>
* Matthew Allum <mallum@o-hand.com>
* Robert Bragg <bob@o-hand.com>
* Neil Roberts <neil@linux.intel.com>
*
* Copyright (C) 2007 OpenedHand
* Copyright (C) 2010 Intel Corporation.
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library. If not, see <http://www.gnu.org/licenses/>.
*
*
*/
/**
* SECTION:clutter-glx-texture-pixmap
* @Title: ClutterGLXTexturePixmap
* @short_description: A texture which displays the content of an X Pixmap
* @Deprecated: 1.4: Use #ClutterX11TexturePixmap instead.
*
* #ClutterGLXTexturePixmap is a class for displaying the content of an
* X Pixmap as a ClutterActor. Used together with the X Composite extension,
* it allows to display the content of X Windows inside Clutter.
*
* This class used to be necessary to use the
* GLX_EXT_texture_from_pixmap extension to get fast texture
* updates. However since Clutter 1.4 the handling of this extension
* has moved down to Cogl. ClutterX11TexturePixmap and
* ClutterGLXTexturePixmap are now equivalent and either one of them
* may use the extension if it is possible.
*/
#include "clutter-build-config.h"
#include <string.h>
#define CLUTTER_DISABLE_DEPRECATION_WARNINGS
#include "x11/clutter-x11-texture-pixmap.h"
#include <cogl/cogl-texture-pixmap-x11.h>
#include "clutter-glx-texture-pixmap.h"
G_DEFINE_TYPE (ClutterGLXTexturePixmap, \
clutter_glx_texture_pixmap, \
CLUTTER_X11_TYPE_TEXTURE_PIXMAP);
static void
clutter_glx_texture_pixmap_init (ClutterGLXTexturePixmap *self)
{
}
static void
clutter_glx_texture_pixmap_class_init (ClutterGLXTexturePixmapClass *klass)
{
}
/**
* clutter_glx_texture_pixmap_using_extension:
* @texture: A #ClutterGLXTexturePixmap
*
* Checks whether @texture is using the GLX_EXT_texture_from_pixmap
* extension; this extension can be optionally (though it is strongly
* encouraged) implemented as a zero-copy between a GLX pixmap and
* a GL texture.
*
* Return value: %TRUE if the texture is using the
* GLX_EXT_texture_from_pixmap OpenGL extension or falling back to the
* slower software mechanism.
*
* Deprecated: 1.6: Use cogl_texture_pixmap_x11_is_using_tfp_extension()
* on the texture handle instead.
*
* Since: 0.8
*/
gboolean
clutter_glx_texture_pixmap_using_extension (ClutterGLXTexturePixmap *texture)
{
CoglHandle cogl_texture;
g_return_val_if_fail (CLUTTER_GLX_IS_TEXTURE_PIXMAP (texture), FALSE);
cogl_texture = clutter_texture_get_cogl_texture (CLUTTER_TEXTURE (texture));
return (cogl_is_texture_pixmap_x11 (cogl_texture) &&
cogl_texture_pixmap_x11_is_using_tfp_extension (cogl_texture));
}
/**
* clutter_glx_texture_pixmap_new_with_pixmap:
* @pixmap: the X Pixmap to which this texture should be bound
*
* Creates a new #ClutterGLXTexturePixmap for @pixmap
*
* Return value: A new #ClutterGLXTexturePixmap bound to the given X Pixmap
*
* Since: 0.8
*
* Deprecated: 1.6: Use clutter_x11_texture_pixmap_new_with_pixmap() instead
*/
ClutterActor *
clutter_glx_texture_pixmap_new_with_pixmap (Pixmap pixmap)
{
return g_object_new (CLUTTER_GLX_TYPE_TEXTURE_PIXMAP,
"pixmap", pixmap,
NULL);
}
/**
* clutter_glx_texture_pixmap_new_with_window:
* @window: the X window to which this texture should be bound
*
* Creates a new #ClutterGLXTexturePixmap for @window
*
* Return value: A new #ClutterGLXTexturePixmap bound to the given X window
*
* Since: 0.8
*
* Deprecated: 1.6: Use clutter_x11_texture_pixmap_new_with_window() instead
*/
ClutterActor *
clutter_glx_texture_pixmap_new_with_window (Window window)
{
return g_object_new (CLUTTER_GLX_TYPE_TEXTURE_PIXMAP,
"window", window,
NULL);
}
/**
* clutter_glx_texture_pixmap_new:
*
* Creates a new, empty #ClutterGLXTexturePixmap
*
* Return value: A new #ClutterGLXTexturePixmap
*
* Since: 0.8
*
* Deprecated: 1.6: Use clutter_x11_texture_pixmap_new() instead
*/
ClutterActor *
clutter_glx_texture_pixmap_new (void)
{
return g_object_new (CLUTTER_GLX_TYPE_TEXTURE_PIXMAP, NULL);
}

View File

@@ -1,93 +0,0 @@
/*
* Clutter.
*
* An OpenGL based 'interactive canvas' library.
*
* Authored By Johan Bilien <johan.bilien@nokia.com>
*
* Copyright (C) 2007 OpenedHand
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library. If not, see <http://www.gnu.org/licenses/>.
*
*
*/
#ifndef __CLUTTER_GLX_TEXTURE_PIXMAP_H__
#define __CLUTTER_GLX_TEXTURE_PIXMAP_H__
#include <clutter/x11/clutter-x11-texture-pixmap.h>
G_BEGIN_DECLS
#define CLUTTER_GLX_TYPE_TEXTURE_PIXMAP (clutter_glx_texture_pixmap_get_type ())
#define CLUTTER_GLX_TEXTURE_PIXMAP(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), CLUTTER_GLX_TYPE_TEXTURE_PIXMAP, ClutterGLXTexturePixmap))
#define CLUTTER_GLX_TEXTURE_PIXMAP_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), CLUTTER_GLX_TYPE_TEXTURE_PIXMAP, ClutterGLXTexturePixmapClass))
#define CLUTTER_GLX_IS_TEXTURE_PIXMAP(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), CLUTTER_GLX_TYPE_TEXTURE_PIXMAP))
#define CLUTTER_GLX_IS_TEXTURE_PIXMAP_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), CLUTTER_GLX_TYPE_TEXTURE_PIXMAP))
#define CLUTTER_GLX_TEXTURE_PIXMAP_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), CLUTTER_GLX_TYPE_TEXTURE_PIXMAP, ClutterGLXTexturePixmapClass))
typedef struct _ClutterGLXTexturePixmap ClutterGLXTexturePixmap;
typedef struct _ClutterGLXTexturePixmapClass ClutterGLXTexturePixmapClass;
typedef struct _ClutterGLXTexturePixmapPrivate ClutterGLXTexturePixmapPrivate;
/**
* ClutterGLXTexturePixmapClass:
*
* The #ClutterGLXTexturePixmapClass structure contains only private data
*
* Since: 0.8
*
* Deprecated: 1.6: Use #ClutterX11TexturePixmapClass instead
*/
struct _ClutterGLXTexturePixmapClass
{
/*< private >*/
ClutterX11TexturePixmapClass parent_class;
};
/**
* ClutterGLXTexturePixmap:
*
* The #ClutterGLXTexturePixmap structure contains only private data
*
* Since: 0.8
*
* Deprecated: 1.6: Use #ClutterX11TexturePixmap instead
*/
struct _ClutterGLXTexturePixmap
{
/*< private >*/
ClutterX11TexturePixmap parent;
ClutterGLXTexturePixmapPrivate *priv;
};
CLUTTER_DEPRECATED_FOR(clutter_x11_texture_pixmap_get_type)
GType clutter_glx_texture_pixmap_get_type (void);
CLUTTER_DEPRECATED_FOR(clutter_x11_texture_pixmap_new)
ClutterActor * clutter_glx_texture_pixmap_new (void);
CLUTTER_DEPRECATED_FOR(clutter_x11_texture_pixmap_new_with_pixmap)
ClutterActor * clutter_glx_texture_pixmap_new_with_pixmap (Pixmap pixmap);
CLUTTER_DEPRECATED_FOR(clutter_x11_texture_pixmap_new_with_window)
ClutterActor * clutter_glx_texture_pixmap_new_with_window (Window window);
CLUTTER_DEPRECATED_FOR(cogl_texture_pixmap_x11_is_using_tfp_extension)
gboolean clutter_glx_texture_pixmap_using_extension (ClutterGLXTexturePixmap *texture);
G_END_DECLS
#endif /* __CLUTTER_GLX_TEXTURE_PIXMAP_H__ */

View File

@@ -1,36 +0,0 @@
/*
* Clutter.
*
* An OpenGL based 'interactive canvas' library.
*
* Authored By Matthew Allum <mallum@openedhand.com>
*
* Copyright (C) 2006 OpenedHand
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library. If not, see <http://www.gnu.org/licenses/>.
*
*
*/
#ifndef __CLUTTER_GLX_H__
#define __CLUTTER_GLX_H__
#include <glib.h>
#include <X11/Xlib.h>
#include <X11/Xutil.h>
#include <X11/Xatom.h>
#include <clutter/clutter.h>
#include <clutter/glx/clutter-glx-texture-pixmap.h>
#endif /* __CLUTTER_GLX_H__ */

View File

@@ -1,78 +0,0 @@
/*
* Clutter.
*
* An OpenGL based 'interactive canvas' library.
*
* Copyright © 2010, 2011 Intel Corp.
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library. If not, see <http://www.gnu.org/licenses/>.
*
* Author: Emmanuele Bassi <ebassi@linux.intel.com>
*/
#include "clutter-build-config.h"
#include "clutter-input-device-core-x11.h"
#include "clutter-debug.h"
#include "clutter-device-manager-private.h"
#include "clutter-private.h"
#include "clutter-stage-private.h"
#include "clutter-backend-x11.h"
#include "clutter-stage-x11.h"
typedef struct _ClutterInputDeviceClass ClutterInputDeviceX11Class;
/* a specific X11 input device */
struct _ClutterInputDeviceX11
{
ClutterInputDevice device;
int min_keycode;
int max_keycode;
};
#define clutter_input_device_x11_get_type _clutter_input_device_x11_get_type
G_DEFINE_TYPE (ClutterInputDeviceX11,
clutter_input_device_x11,
CLUTTER_TYPE_INPUT_DEVICE);
static gboolean
clutter_input_device_x11_keycode_to_evdev (ClutterInputDevice *device,
guint hardware_keycode,
guint *evdev_keycode)
{
/* When using evdev under X11 the hardware keycodes are the evdev
keycodes plus 8. I haven't been able to find any documentation to
know what the +8 is for. FIXME: This should probably verify that
X server is using evdev. */
*evdev_keycode = hardware_keycode - 8;
return TRUE;
}
static void
clutter_input_device_x11_class_init (ClutterInputDeviceX11Class *klass)
{
ClutterInputDeviceClass *device_class = CLUTTER_INPUT_DEVICE_CLASS (klass);
device_class->keycode_to_evdev = clutter_input_device_x11_keycode_to_evdev;
}
static void
clutter_input_device_x11_init (ClutterInputDeviceX11 *self)
{
}

View File

@@ -1,44 +0,0 @@
/*
* Clutter.
*
* An OpenGL based 'interactive canvas' library.
*
* Copyright © 2010, 2011 Intel Corp.
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library. If not, see <http://www.gnu.org/licenses/>.
*
* Author: Emmanuele Bassi <ebassi@linux.intel.com>
*/
#ifndef __CLUTTER_INPUT_DEVICE_X11_H__
#define __CLUTTER_INPUT_DEVICE_X11_H__
#include <clutter/clutter-input-device.h>
#include <X11/Xlib.h>
#include "clutter-stage-x11.h"
G_BEGIN_DECLS
#define CLUTTER_TYPE_INPUT_DEVICE_X11 (_clutter_input_device_x11_get_type ())
#define CLUTTER_INPUT_DEVICE_X11(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), CLUTTER_TYPE_INPUT_DEVICE_X11, ClutterInputDeviceX11))
#define CLUTTER_IS_INPUT_DEVICE_X11(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), CLUTTER_TYPE_INPUT_DEVICE_X11))
typedef struct _ClutterInputDeviceX11 ClutterInputDeviceX11;
GType _clutter_input_device_x11_get_type (void) G_GNUC_CONST;
G_END_DECLS
#endif /* __CLUTTER_INPUT_DEVICE_X11_H__ */

View File

@@ -49,10 +49,12 @@
#define STAGE_X11_IS_MAPPED(s) ((((ClutterStageX11 *) (s))->wm_state & STAGE_X11_WITHDRAWN) == 0)
static ClutterStageWindowIface *clutter_stage_window_parent_iface = NULL;
static ClutterStageWindowInterface *clutter_stage_window_parent_iface = NULL;
static void clutter_stage_window_iface_init (ClutterStageWindowIface *iface);
static void clutter_event_translator_iface_init (ClutterEventTranslatorIface *iface);
static void
clutter_stage_window_iface_init (ClutterStageWindowInterface *iface);
static void
clutter_event_translator_iface_init (ClutterEventTranslatorIface *iface);
static ClutterStageCogl *clutter_x11_get_stage_window_from_window (Window win);
@@ -972,7 +974,7 @@ clutter_stage_x11_init (ClutterStageX11 *stage)
}
static void
clutter_stage_window_iface_init (ClutterStageWindowIface *iface)
clutter_stage_window_iface_init (ClutterStageWindowInterface *iface)
{
clutter_stage_window_parent_iface = g_type_interface_peek_parent (iface);
@@ -1390,37 +1392,6 @@ clutter_x11_get_stage_from_window (Window win)
return NULL;
}
/**
* clutter_x11_get_stage_visual: (skip)
* @stage: a #ClutterStage
*
* Returns an XVisualInfo suitable for creating a foreign window for the given
* stage. NOTE: It doesn't do as the name may suggest, which is return the
* XVisualInfo that was used to create an existing window for the given stage.
*
* XXX: It might be best to deprecate this function and replace with something
* along the lines of clutter_backend_x11_get_foreign_visual () or perhaps
* clutter_stage_x11_get_foreign_visual ()
*
* Return value: (transfer full): An XVisualInfo suitable for creating a
* foreign stage. Use XFree() to free the returned value instead
*
* Deprecated: 1.2: Use clutter_x11_get_visual_info() instead
*
* Since: 0.4
*/
XVisualInfo *
clutter_x11_get_stage_visual (ClutterStage *stage)
{
ClutterBackend *backend = clutter_get_default_backend ();
ClutterBackendX11 *backend_x11;
g_return_val_if_fail (CLUTTER_IS_BACKEND_X11 (backend), NULL);
backend_x11 = CLUTTER_BACKEND_X11 (backend);
return _clutter_backend_x11_get_visual_info (backend_x11);
}
typedef struct {
ClutterStageX11 *stage_x11;
cairo_rectangle_int_t geom;

View File

@@ -104,9 +104,6 @@ XVisualInfo *clutter_x11_get_visual_info (void);
CLUTTER_EXPORT
void clutter_x11_set_display (Display * xdpy);
CLUTTER_DEPRECATED_FOR(clutter_x11_get_visual_info)
XVisualInfo *clutter_x11_get_stage_visual (ClutterStage *stage);
CLUTTER_EXPORT
Window clutter_x11_get_stage_window (ClutterStage *stage);
CLUTTER_EXPORT
@@ -131,11 +128,6 @@ gboolean clutter_x11_has_event_retrieval (void);
CLUTTER_EXPORT
ClutterStage *clutter_x11_get_stage_from_window (Window win);
CLUTTER_DEPRECATED_FOR(clutter_device_manager_peek_devices)
const GSList* clutter_x11_get_input_devices (void);
CLUTTER_DEPRECATED
void clutter_x11_enable_xinput (void);
CLUTTER_EXPORT
gboolean clutter_x11_has_xinput (void);

View File

@@ -1,199 +0,0 @@
#define CLUTTER_DISABLE_DEPRECATION_WARNINGS
#include <clutter/clutter.h>
static void
animator_multi_properties (void)
{
ClutterScript *script = clutter_script_new ();
GObject *animator = NULL, *foo = NULL;
GError *error = NULL;
gchar *test_file;
GList *keys;
ClutterAnimatorKey *key;
GValue value = { 0, };
test_file = g_test_build_filename (G_TEST_DIST,
"scripts",
"test-animator-3.json",
NULL);
clutter_script_load_from_file (script, test_file, &error);
if (g_test_verbose () && error)
g_print ("Error: %s", error->message);
g_assert_no_error (error);
foo = clutter_script_get_object (script, "foo");
g_assert (G_IS_OBJECT (foo));
animator = clutter_script_get_object (script, "animator");
g_assert (CLUTTER_IS_ANIMATOR (animator));
/* get all the keys for foo:x */
keys = clutter_animator_get_keys (CLUTTER_ANIMATOR (animator),
foo, "x",
-1.0);
g_assert_cmpint (g_list_length (keys), ==, 3);
key = g_list_nth_data (keys, 1);
g_assert (key != NULL);
if (g_test_verbose ())
{
g_print ("(foo, x).keys[1] = \n"
".object = %s\n"
".progress = %.2f\n"
".name = '%s'\n"
".type = '%s'\n",
clutter_get_script_id (clutter_animator_key_get_object (key)),
clutter_animator_key_get_progress (key),
clutter_animator_key_get_property_name (key),
g_type_name (clutter_animator_key_get_property_type (key)));
}
g_assert (clutter_animator_key_get_object (key) != NULL);
g_assert_cmpfloat (clutter_animator_key_get_progress (key), ==, 0.2);
g_assert_cmpstr (clutter_animator_key_get_property_name (key), ==, "x");
g_assert (clutter_animator_key_get_property_type (key) == G_TYPE_FLOAT);
g_value_init (&value, G_TYPE_FLOAT);
g_assert (clutter_animator_key_get_value (key, &value));
g_assert_cmpfloat (g_value_get_float (&value), ==, 150.0);
g_value_unset (&value);
g_list_free (keys);
/* get all the keys for foo:y */
keys = clutter_animator_get_keys (CLUTTER_ANIMATOR (animator),
foo, "y",
-1.0);
g_assert_cmpint (g_list_length (keys), ==, 3);
key = g_list_nth_data (keys, 2);
g_assert (key != NULL);
if (g_test_verbose ())
{
g_print ("(foo, y).keys[2] = \n"
".object = %s\n"
".progress = %.2f\n"
".name = '%s'\n"
".type = '%s'\n",
clutter_get_script_id (clutter_animator_key_get_object (key)),
clutter_animator_key_get_progress (key),
clutter_animator_key_get_property_name (key),
g_type_name (clutter_animator_key_get_property_type (key)));
}
g_assert (clutter_animator_key_get_object (key) != NULL);
g_assert_cmpfloat (clutter_animator_key_get_progress (key), ==, 0.8);
g_assert_cmpstr (clutter_animator_key_get_property_name (key), ==, "y");
g_assert (clutter_animator_key_get_property_type (key) == G_TYPE_FLOAT);
g_value_init (&value, G_TYPE_FLOAT);
g_assert (clutter_animator_key_get_value (key, &value));
g_assert_cmpfloat (g_value_get_float (&value), ==, 200.0);
g_value_unset (&value);
g_list_free (keys);
g_object_unref (script);
g_free (test_file);
}
static void
animator_properties (void)
{
ClutterScript *script = clutter_script_new ();
GObject *animator = NULL;
GError *error = NULL;
gchar *test_file;
GList *keys;
ClutterAnimatorKey *key;
GValue value = { 0, };
test_file = g_test_build_filename (G_TEST_DIST,
"scripts",
"test-animator-2.json",
NULL);
clutter_script_load_from_file (script, test_file, &error);
if (g_test_verbose () && error)
g_print ("Error: %s", error->message);
g_assert_no_error (error);
animator = clutter_script_get_object (script, "animator");
g_assert (CLUTTER_IS_ANIMATOR (animator));
/* get all the keys */
keys = clutter_animator_get_keys (CLUTTER_ANIMATOR (animator),
NULL, NULL, -1.0);
g_assert_cmpint (g_list_length (keys), ==, 3);
key = g_list_nth_data (keys, 1);
g_assert (key != NULL);
if (g_test_verbose ())
{
g_print ("keys[1] = \n"
".object = %s\n"
".progress = %.2f\n"
".name = '%s'\n"
".type = '%s'\n",
clutter_get_script_id (clutter_animator_key_get_object (key)),
clutter_animator_key_get_progress (key),
clutter_animator_key_get_property_name (key),
g_type_name (clutter_animator_key_get_property_type (key)));
}
g_assert (clutter_animator_key_get_object (key) != NULL);
g_assert_cmpfloat (clutter_animator_key_get_progress (key), ==, 0.2);
g_assert_cmpstr (clutter_animator_key_get_property_name (key), ==, "x");
g_assert (clutter_animator_key_get_property_type (key) == G_TYPE_FLOAT);
g_value_init (&value, G_TYPE_FLOAT);
g_assert (clutter_animator_key_get_value (key, &value));
g_assert_cmpfloat (g_value_get_float (&value), ==, 150.0);
g_value_unset (&value);
g_list_free (keys);
g_object_unref (script);
g_free (test_file);
}
static void
animator_base (void)
{
ClutterScript *script = clutter_script_new ();
GObject *animator = NULL;
GError *error = NULL;
guint duration = 0;
gchar *test_file;
test_file = g_test_build_filename (G_TEST_DIST,
"scripts",
"test-animator-1.json",
NULL);
clutter_script_load_from_file (script, test_file, &error);
if (g_test_verbose () && error)
g_print ("Error: %s", error->message);
g_assert_no_error (error);
animator = clutter_script_get_object (script, "animator");
g_assert (CLUTTER_IS_ANIMATOR (animator));
duration = clutter_animator_get_duration (CLUTTER_ANIMATOR (animator));
g_assert_cmpint (duration, ==, 1000);
g_object_unref (script);
g_free (test_file);
}
CLUTTER_TEST_SUITE (
CLUTTER_TEST_UNIT ("/script/animator/base", animator_base)
CLUTTER_TEST_UNIT ("/script/animator/properties", animator_properties)
CLUTTER_TEST_UNIT ("/script/animator/multi-properties", animator_multi_properties)
)

View File

@@ -40,7 +40,6 @@ clutter_conform_tests_general_tests = [
]
clutter_conform_tests_deprecated_tests = [
'animator',
'behaviours',
'group',
'rectangle',

View File

@@ -1,121 +0,0 @@
#include <stdio.h>
#include <stdlib.h>
#include <clutter/clutter.h>
#include "test-conform-common.h"
static guint level = 0;
static void
on_score_started (ClutterScore *score)
{
if (g_test_verbose ())
g_print ("Score started\n");
}
static void
on_score_completed (ClutterScore *score)
{
if (g_test_verbose ())
g_print ("Score completed\n");
}
static void
on_timeline_started (ClutterScore *score,
ClutterTimeline *timeline)
{
if (g_test_verbose ())
g_print ("Started timeline: '%s'\n",
(gchar *) g_object_get_data (G_OBJECT (timeline), "timeline-name"));
level += 1;
}
static void
on_timeline_completed (ClutterScore *score,
ClutterTimeline *timeline)
{
if (g_test_verbose ())
g_print ("Completed timeline: '%s'\n",
(gchar *) g_object_get_data (G_OBJECT (timeline), "timeline-name"));
level -= 1;
}
void
score_base (TestConformSimpleFixture *fixture,
gconstpointer data)
{
ClutterScore *score;
ClutterTimeline *timeline_1;
ClutterTimeline *timeline_2;
ClutterTimeline *timeline_3;
ClutterTimeline *timeline_4;
ClutterTimeline *timeline_5;
GSList *timelines;
/* FIXME - this is necessary to make the master clock spin */
ClutterActor *stage = clutter_stage_new ();
timeline_1 = clutter_timeline_new (100);
g_object_set_data_full (G_OBJECT (timeline_1),
"timeline-name", g_strdup ("Timeline 1"),
g_free);
timeline_2 = clutter_timeline_new (100);
clutter_timeline_add_marker_at_time (timeline_2, "foo", 50);
g_object_set_data_full (G_OBJECT (timeline_2),
"timeline-name", g_strdup ("Timeline 2"),
g_free);
timeline_3 = clutter_timeline_new (100);
g_object_set_data_full (G_OBJECT (timeline_3),
"timeline-name", g_strdup ("Timeline 3"),
g_free);
timeline_4 = clutter_timeline_new (100);
g_object_set_data_full (G_OBJECT (timeline_4),
"timeline-name", g_strdup ("Timeline 4"),
g_free);
timeline_5 = clutter_timeline_new (100);
g_object_set_data_full (G_OBJECT (timeline_5),
"timeline-name", g_strdup ("Timeline 5"),
g_free);
score = clutter_score_new();
g_signal_connect (score, "started",
G_CALLBACK (on_score_started),
NULL);
g_signal_connect (score, "timeline-started",
G_CALLBACK (on_timeline_started),
NULL);
g_signal_connect (score, "timeline-completed",
G_CALLBACK (on_timeline_completed),
NULL);
g_signal_connect (score, "completed",
G_CALLBACK (on_score_completed),
NULL);
clutter_score_append (score, NULL, timeline_1);
clutter_score_append (score, timeline_1, timeline_2);
clutter_score_append (score, timeline_1, timeline_3);
clutter_score_append (score, timeline_3, timeline_4);
clutter_score_append_at_marker (score, timeline_2, "foo", timeline_5);
timelines = clutter_score_list_timelines (score);
g_assert (5 == g_slist_length (timelines));
g_slist_free (timelines);
clutter_score_start (score);
clutter_actor_destroy (stage);
g_object_unref (timeline_1);
g_object_unref (timeline_2);
g_object_unref (timeline_3);
g_object_unref (timeline_4);
g_object_unref (timeline_5);
g_object_unref (score);
}

View File

@@ -27,9 +27,7 @@ clutter_tests_interactive_test_sources = [
'test-script.c',
'test-grab.c',
'test-cogl-shader-glsl.c',
'test-animator.c',
'test-state.c',
'test-state-animator.c',
'test-fbo.c',
'test-multistage.c',
'test-cogl-tex-tile.c',

View File

@@ -1,142 +0,0 @@
#include <stdlib.h>
#include <math.h>
#include <gmodule.h>
#include <clutter/clutter.h>
static ClutterAnimator *animator;
gint
test_animator_main (gint argc,
gchar **argv);
static ClutterActor *new_rect (gint r,
gint g,
gint b,
gint a)
{
GError *error = NULL;
ClutterColor *color = clutter_color_new (r, g, b, a);
ClutterActor *rectangle;
gchar *file = g_build_filename (TESTS_DATADIR, "redhand.png", NULL);
rectangle = clutter_texture_new_from_file (file, &error);
if (rectangle == NULL)
g_error ("image load failed: %s", error->message);
g_free (file);
clutter_actor_set_size (rectangle, 128, 128);
clutter_color_free (color);
return rectangle;
}
static gboolean nuke_one (gpointer actor)
{
clutter_actor_destroy (actor);
return FALSE;
}
#define COUNT 4
static void reverse_timeline (ClutterTimeline *timeline,
gpointer data)
{
ClutterTimelineDirection direction = clutter_timeline_get_direction (timeline);
if (direction == CLUTTER_TIMELINE_FORWARD)
clutter_timeline_set_direction (timeline, CLUTTER_TIMELINE_BACKWARD);
else
clutter_timeline_set_direction (timeline, CLUTTER_TIMELINE_FORWARD);
clutter_timeline_start (timeline);
}
G_MODULE_EXPORT gint
test_animator_main (gint argc,
gchar **argv)
{
ClutterActor *stage;
ClutterActor *rects[COUNT];
gint i;
if (clutter_init (&argc, &argv) != CLUTTER_INIT_SUCCESS)
return 1;
stage = clutter_stage_new ();
clutter_stage_set_title (CLUTTER_STAGE (stage), "Animator");
g_signal_connect (stage, "destroy", G_CALLBACK (clutter_main_quit), NULL);
for (i = 0; i < COUNT; i++)
{
rects[i] = new_rect (255 * (i * 1.0 / COUNT), 50, 160, 255);
clutter_container_add_actor (CLUTTER_CONTAINER (stage), rects[i]);
clutter_actor_set_anchor_point (rects[i], 64, 64);
clutter_actor_set_position (rects[i], 320.0, 240.0);
clutter_actor_set_opacity (rects[i], 0x70);
}
clutter_threads_add_timeout (10000, nuke_one, rects[2]);
animator = clutter_animator_new ();
/* Note: when both animations are active for the same actor at the same
* time there is a race, such races should be handled by avoiding
* controlling the same properties from multiple animations. This is
* an intentional design flaw of this test for testing the corner case.
*/
clutter_animator_set (animator,
rects[0], "x", 1, 0.0, 180.0,
rects[0], "x", CLUTTER_LINEAR, 0.25, 450.0,
rects[0], "x", CLUTTER_LINEAR, 0.5, 450.0,
rects[0], "x", CLUTTER_LINEAR, 0.75, 180.0,
rects[0], "x", CLUTTER_LINEAR, 1.0, 180.0,
rects[0], "y", -1, 0.0, 100.0,
rects[0], "y", CLUTTER_LINEAR, 0.25, 100.0,
rects[0], "y", CLUTTER_LINEAR, 0.5, 380.0,
rects[0], "y", CLUTTER_LINEAR, 0.75, 380.0,
rects[0], "y", CLUTTER_LINEAR, 1.0, 100.0,
rects[3], "x", 0, 0.0, 180.0,
rects[3], "x", CLUTTER_LINEAR, 0.25, 180.0,
rects[3], "x", CLUTTER_LINEAR, 0.5, 450.0,
rects[3], "x", CLUTTER_LINEAR, 0.75, 450.0,
rects[3], "x", CLUTTER_LINEAR, 1.0, 180.0,
rects[3], "y", 0, 0.0, 100.0,
rects[3], "y", CLUTTER_LINEAR, 0.25, 380.0,
rects[3], "y", CLUTTER_LINEAR, 0.5, 380.0,
rects[3], "y", CLUTTER_LINEAR, 0.75, 100.0,
rects[3], "y", CLUTTER_LINEAR, 1.0, 100.0,
rects[2], "rotation-angle-y", 0, 0.0, 0.0,
rects[2], "rotation-angle-y", CLUTTER_LINEAR, 1.0, 360.0,
rects[1], "scale-x", 0, 0.0, 1.0,
rects[1], "scale-x", CLUTTER_LINEAR, 1.0, 2.0,
rects[1], "scale-y", 0, 0.0, 1.0,
rects[1], "scale-y", CLUTTER_LINEAR, 1.0, 2.0,
NULL);
clutter_actor_set_scale (rects[0], 1.4, 1.4);
clutter_animator_property_set_ease_in (animator, G_OBJECT (rects[0]), "x",
TRUE);
clutter_animator_property_set_ease_in (animator, G_OBJECT (rects[0]), "y",
TRUE);
clutter_animator_property_set_interpolation (animator, G_OBJECT (rects[0]),
"x", CLUTTER_INTERPOLATION_CUBIC);
clutter_animator_property_set_interpolation (animator, G_OBJECT (rects[0]),
"y", CLUTTER_INTERPOLATION_CUBIC);
clutter_stage_hide_cursor(CLUTTER_STAGE (stage));
clutter_actor_show (stage);
clutter_animator_set_duration (animator, 5000);
g_signal_connect (clutter_animator_start (animator),
"completed", G_CALLBACK (reverse_timeline), NULL);
clutter_main ();
g_object_unref (animator);
return EXIT_SUCCESS;
}

View File

@@ -17,7 +17,7 @@ typedef struct _ColorContentClass {
GObjectClass parent_class;
} ColorContentClass;
static void clutter_content_iface_init (ClutterContentIface *iface);
static void clutter_content_iface_init (ClutterContentInterface *iface);
GType color_content_get_type (void);
@@ -135,7 +135,7 @@ color_content_paint_content (ClutterContent *content,
}
static void
clutter_content_iface_init (ClutterContentIface *iface)
clutter_content_iface_init (ClutterContentInterface *iface)
{
iface->paint_content = color_content_paint_content;
}

View File

@@ -18,7 +18,7 @@ typedef struct _SolidContentClass {
GObjectClass parent_class;
} SolidContentClass;
static void clutter_content_iface_init (ClutterContentIface *iface);
static void clutter_content_iface_init (ClutterContentInterface *iface);
GType solid_content_get_type (void);
@@ -136,7 +136,7 @@ solid_content_paint_content (ClutterContent *content,
}
static void
clutter_content_iface_init (ClutterContentIface *iface)
clutter_content_iface_init (ClutterContentInterface *iface)
{
iface->paint_content = solid_content_paint_content;
}

View File

@@ -1,151 +0,0 @@
#include <stdlib.h>
#include <math.h>
#include <gmodule.h>
#include <clutter/clutter.h>
static ClutterState *state;
static ClutterAnimator *animator;
gint
test_state_animator_main (gint argc,
gchar **argv);
const char *
test_state_animator_describe (void);
static gboolean press_event (ClutterActor *actor,
ClutterEvent *event,
gpointer user_data)
{
clutter_grab_pointer (actor);
clutter_state_set_state (state, "end");
return TRUE;
}
static gboolean release_event (ClutterActor *actor,
ClutterEvent *event,
gpointer user_data)
{
clutter_state_set_state (state, "start");
clutter_ungrab_pointer ();
return TRUE;
}
static ClutterActor *new_rect (gint r,
gint g,
gint b,
gint a)
{
GError *error = NULL;
ClutterColor *color = clutter_color_new (r, g, b, a);
ClutterActor *rectangle;
gchar *file = g_build_filename (TESTS_DATADIR, "redhand.png", NULL);
rectangle = clutter_texture_new_from_file (file, &error);
if (rectangle == NULL)
g_error ("image load failed: %s", error->message);
g_free (file);
clutter_actor_set_size (rectangle, 128, 128);
clutter_color_free (color);
return rectangle;
}
G_MODULE_EXPORT gint
test_state_animator_main (gint argc,
gchar **argv)
{
ClutterActor *stage;
ClutterActor *rects[40];
gint i;
if (clutter_init (&argc, &argv) != CLUTTER_INIT_SUCCESS)
return 1;
stage = clutter_stage_new ();
clutter_stage_set_title (CLUTTER_STAGE (stage), "State and Animator");
g_signal_connect (stage, "destroy", G_CALLBACK (clutter_main_quit), NULL);
for (i = 0; i < 2; i++)
{
rects[i] = new_rect (255 * (i * 1.0 / 40), 50, 160, 255);
clutter_container_add_actor (CLUTTER_CONTAINER (stage), rects[i]);
clutter_actor_set_anchor_point (rects[i], 64, 64);
clutter_actor_set_position (rects[i], 320.0, 240.0);
clutter_actor_set_opacity (rects[i], 0x70);
clutter_actor_set_reactive (rects[i], TRUE);
g_signal_connect (rects[i], "button-press-event", G_CALLBACK (press_event), NULL);
g_signal_connect (rects[i], "button-release-event", G_CALLBACK (release_event), NULL);
}
state = clutter_state_new ();
clutter_state_set (state, NULL, "start",
rects[0], "depth", CLUTTER_LINEAR, 0.0,
rects[0], "x", CLUTTER_LINEAR, 100.0,
rects[0], "y", CLUTTER_LINEAR, 300.0,
rects[1], "opacity", CLUTTER_LINEAR, 0x20,
rects[1], "scale-x", CLUTTER_LINEAR, 1.0,
rects[1], "scale-y", CLUTTER_LINEAR, 1.0,
NULL);
clutter_state_set (state, NULL, "end",
rects[0], "depth", CLUTTER_LINEAR, 200.0,
rects[0], "x", CLUTTER_LINEAR, 320.0,
rects[0], "y", CLUTTER_LINEAR, 240.0,
rects[1], "opacity", CLUTTER_LINEAR, 0xff,
rects[1], "scale-x", CLUTTER_LINEAR, 2.0,
rects[1], "scale-y", CLUTTER_LINEAR, 2.0,
NULL);
animator = clutter_animator_new ();
clutter_animator_set (animator,
rects[0], "depth", -1, 0.0, 0.0,
rects[0], "depth", CLUTTER_LINEAR, 1.0, 275.0,
rects[0], "x", -1, 0.0, 0.0,
rects[0], "x", CLUTTER_LINEAR, 0.5, 200.0,
rects[0], "x", CLUTTER_LINEAR, 1.0, 320.0,
rects[0], "y", -1, 0.0, 0.0,
rects[0], "y", CLUTTER_LINEAR, 0.3, 100.0,
rects[0], "y", CLUTTER_LINEAR, 1.0, 240.0,
rects[1], "opacity", -1, 0.0, 0x20,
rects[1], "opacity", CLUTTER_LINEAR, 1.0, 0xff,
rects[1], "scale-x", -1, 0.0, 1.0,
rects[1], "scale-x", CLUTTER_LINEAR, 0.5, 2.0,
rects[1], "scale-x", CLUTTER_LINEAR, 1.0, 2.0,
rects[1], "scale-y", -1, 0.0, 1.0,
rects[1], "scale-y", CLUTTER_LINEAR, 0.5, 2.0,
rects[1], "scale-y", CLUTTER_LINEAR, 1.0, 2.0,
NULL);
clutter_animator_property_set_ease_in (animator, G_OBJECT (rects[0]), "depth", TRUE);
clutter_animator_property_set_ease_in (animator, G_OBJECT (rects[0]), "x", TRUE);
clutter_animator_property_set_ease_in (animator, G_OBJECT (rects[0]), "y", TRUE);
clutter_animator_property_set_ease_in (animator, G_OBJECT (rects[1]), "opacity", TRUE);
clutter_animator_property_set_ease_in (animator, G_OBJECT (rects[1]), "scale-x", TRUE);
clutter_animator_property_set_ease_in (animator, G_OBJECT (rects[1]), "scale-y", TRUE);
clutter_animator_property_set_interpolation (animator, G_OBJECT (rects[0]), "x",
CLUTTER_INTERPOLATION_CUBIC);
clutter_animator_property_set_interpolation (animator, G_OBJECT (rects[0]), "y",
CLUTTER_INTERPOLATION_CUBIC);
clutter_state_set_animator (state, "start", "end", animator);
g_object_unref (animator);
clutter_actor_show (stage);
clutter_state_set_state (state, "start");
clutter_main ();
g_object_unref (state);
return EXIT_SUCCESS;
}
G_MODULE_EXPORT const char *
test_state_animator_describe (void)
{
return "Animate using the State and Animator classes.";
}

View File

@@ -47,7 +47,7 @@ typedef struct _CoglPangoDisplayListRectangle CoglPangoDisplayListRectangle;
struct _CoglPangoDisplayList
{
CoglBool color_override;
gboolean color_override;
CoglColor color;
GSList *nodes;
GSList *last_node;
@@ -65,7 +65,7 @@ struct _CoglPangoDisplayListNode
{
CoglPangoDisplayListNodeType type;
CoglBool color_override;
gboolean color_override;
CoglColor color;
CoglPipeline *pipeline;
@@ -273,7 +273,7 @@ emit_vertex_buffer_geometry (CoglFramebuffer *fb,
CoglAttributeBuffer *buffer;
CoglVertexP2T2 *verts, *v;
int n_verts;
CoglBool allocated = FALSE;
gboolean allocated = FALSE;
CoglAttribute *attributes[2];
CoglPrimitive *prim;
int i;

View File

@@ -153,7 +153,7 @@ cogl_pango_font_map_clear_glyph_cache (CoglPangoFontMap *fm)
void
cogl_pango_font_map_set_use_mipmapping (CoglPangoFontMap *fm,
CoglBool value)
gboolean value)
{
PangoRenderer *renderer = _cogl_pango_font_map_get_renderer (fm);
@@ -161,7 +161,7 @@ cogl_pango_font_map_set_use_mipmapping (CoglPangoFontMap *fm,
value);
}
CoglBool
gboolean
cogl_pango_font_map_get_use_mipmapping (CoglPangoFontMap *fm)
{
PangoRenderer *renderer = _cogl_pango_font_map_get_renderer (fm);

View File

@@ -54,16 +54,16 @@ struct _CoglPangoGlyphCache
/* TRUE if we've ever stored a texture in the global atlas. This is
used to make sure we only register one callback to listen for
global atlas reorganizations */
CoglBool using_global_atlas;
gboolean using_global_atlas;
/* True if some of the glyphs are dirty. This is used as an
optimization in _cogl_pango_glyph_cache_set_dirty_glyphs to avoid
iterating the hash table if we know none of them are dirty */
CoglBool has_dirty_glyphs;
gboolean has_dirty_glyphs;
/* Whether mipmapping is being used for this cache. This only
affects whether we decide to put the glyph in the global atlas */
CoglBool use_mipmapping;
gboolean use_mipmapping;
};
struct _CoglPangoGlyphCacheKey
@@ -100,7 +100,7 @@ cogl_pango_glyph_cache_hash_func (const void *key)
return GPOINTER_TO_UINT (cache_key->font) ^ cache_key->glyph;
}
static CoglBool
static gboolean
cogl_pango_glyph_cache_equal_func (const void *a, const void *b)
{
const CoglPangoGlyphCacheKey *key_a
@@ -117,7 +117,7 @@ cogl_pango_glyph_cache_equal_func (const void *a, const void *b)
CoglPangoGlyphCache *
cogl_pango_glyph_cache_new (CoglContext *ctx,
CoglBool use_mipmapping)
gboolean use_mipmapping)
{
CoglPangoGlyphCache *cache;
@@ -210,7 +210,7 @@ cogl_pango_glyph_cache_update_position_cb (void *user_data,
value->dirty = TRUE;
}
static CoglBool
static gboolean
cogl_pango_glyph_cache_add_to_global_atlas (CoglPangoGlyphCache *cache,
PangoFont *font,
PangoGlyph glyph,
@@ -259,7 +259,7 @@ cogl_pango_glyph_cache_add_to_global_atlas (CoglPangoGlyphCache *cache,
return TRUE;
}
static CoglBool
static gboolean
cogl_pango_glyph_cache_add_to_local_atlas (CoglPangoGlyphCache *cache,
PangoFont *font,
PangoGlyph glyph,
@@ -309,7 +309,7 @@ cogl_pango_glyph_cache_add_to_local_atlas (CoglPangoGlyphCache *cache,
CoglPangoGlyphCacheValue *
cogl_pango_glyph_cache_lookup (CoglPangoGlyphCache *cache,
CoglBool create,
gboolean create,
PangoFont *font,
PangoGlyph glyph)
{

View File

@@ -58,7 +58,7 @@ struct _CoglPangoGlyphCacheValue
/* This will be set to TRUE when the glyph atlas is reorganized
which means the glyph will need to be redrawn */
CoglBool dirty;
gboolean dirty;
};
typedef void (* CoglPangoGlyphCacheDirtyFunc) (PangoFont *font,
@@ -67,14 +67,14 @@ typedef void (* CoglPangoGlyphCacheDirtyFunc) (PangoFont *font,
CoglPangoGlyphCache *
cogl_pango_glyph_cache_new (CoglContext *ctx,
CoglBool use_mipmapping);
gboolean use_mipmapping);
void
cogl_pango_glyph_cache_free (CoglPangoGlyphCache *cache);
CoglPangoGlyphCacheValue *
cogl_pango_glyph_cache_lookup (CoglPangoGlyphCache *cache,
CoglBool create,
gboolean create,
PangoFont *font,
PangoGlyph glyph);

View File

@@ -74,7 +74,7 @@ _cogl_pango_pipeline_cache_value_destroy (void *data)
CoglPangoPipelineCache *
_cogl_pango_pipeline_cache_new (CoglContext *ctx,
CoglBool use_mipmapping)
gboolean use_mipmapping)
{
CoglPangoPipelineCache *cache = g_new (CoglPangoPipelineCache, 1);

View File

@@ -49,13 +49,13 @@ typedef struct _CoglPangoPipelineCache
CoglPipeline *base_texture_alpha_pipeline;
CoglPipeline *base_texture_rgba_pipeline;
CoglBool use_mipmapping;
gboolean use_mipmapping;
} CoglPangoPipelineCache;
CoglPangoPipelineCache *
_cogl_pango_pipeline_cache_new (CoglContext *ctx,
CoglBool use_mipmapping);
gboolean use_mipmapping);
/* Returns a pipeline that can be used to render glyphs in the given
texture. The pipeline has a new reference so it is up to the caller

View File

@@ -48,8 +48,8 @@ _cogl_pango_renderer_clear_glyph_cache (CoglPangoRenderer *renderer);
void
_cogl_pango_renderer_set_use_mipmapping (CoglPangoRenderer *renderer,
CoglBool value);
CoglBool
gboolean value);
gboolean
_cogl_pango_renderer_get_use_mipmapping (CoglPangoRenderer *renderer);

View File

@@ -76,7 +76,7 @@ struct _CoglPangoRenderer
CoglPangoRendererCaches no_mipmap_caches;
CoglPangoRendererCaches mipmap_caches;
CoglBool use_mipmapping;
gboolean use_mipmapping;
/* The current display list that is being built */
CoglPangoDisplayList *display_list;
@@ -102,7 +102,7 @@ struct _CoglPangoLayoutQdata
/* Whether mipmapping was previously used to render this layout. We
need to regenerate the display list if the mipmapping value is
changed because it will be using a different set of textures */
CoglBool mipmapping_used;
gboolean mipmapping_used;
};
static void
@@ -534,12 +534,12 @@ _cogl_pango_renderer_clear_glyph_cache (CoglPangoRenderer *renderer)
void
_cogl_pango_renderer_set_use_mipmapping (CoglPangoRenderer *renderer,
CoglBool value)
gboolean value)
{
renderer->use_mipmapping = value;
}
CoglBool
gboolean
_cogl_pango_renderer_get_use_mipmapping (CoglPangoRenderer *renderer)
{
return renderer->use_mipmapping;
@@ -547,7 +547,7 @@ _cogl_pango_renderer_get_use_mipmapping (CoglPangoRenderer *renderer)
static CoglPangoGlyphCacheValue *
cogl_pango_renderer_get_cached_glyph (PangoRenderer *renderer,
CoglBool create,
gboolean create,
PangoFont *font,
PangoGlyph glyph)
{

View File

@@ -144,7 +144,7 @@ cogl_pango_ensure_glyph_cache_for_layout (PangoLayout *layout);
*/
void
cogl_pango_font_map_set_use_mipmapping (CoglPangoFontMap *font_map,
CoglBool value);
gboolean value);
/**
* cogl_pango_font_map_get_use_mipmapping:
@@ -157,7 +157,7 @@ cogl_pango_font_map_set_use_mipmapping (CoglPangoFontMap *font_map,
*
* Since: 1.0
*/
CoglBool
gboolean
cogl_pango_font_map_get_use_mipmapping (CoglPangoFontMap *font_map);
/**

View File

@@ -96,7 +96,7 @@ cogl_path_copy (CoglPath *path);
*
* Since: 2.0
*/
CoglBool
gboolean
cogl_is_path (void *object);
#define cogl_path_move_to cogl2_path_move_to

View File

@@ -105,13 +105,13 @@ struct _CoglPathData
case and divert to the journal or a rectangle clip. If it is TRUE
then the entire path can be described by calling
_cogl_path_get_bounds */
CoglBool is_rectangle;
gboolean is_rectangle;
};
void
_cogl_add_path_to_stencil_buffer (CoglPath *path,
CoglBool merge,
CoglBool need_clear);
gboolean merge,
gboolean need_clear);
void
_cogl_path_get_bounds (CoglPath *path,
@@ -120,7 +120,7 @@ _cogl_path_get_bounds (CoglPath *path,
float *max_x,
float *max_y);
CoglBool
gboolean
_cogl_path_is_rectangle (CoglPath *path);
#endif /* __COGL_PATH_PRIVATE_H */

View File

@@ -169,7 +169,7 @@ cogl2_path_get_fill_rule (CoglPath *path)
static void
_cogl_path_add_node (CoglPath *path,
CoglBool new_sub_path,
gboolean new_sub_path,
float x,
float y)
{
@@ -299,7 +299,7 @@ _cogl_path_fill_nodes_with_clipped_rectangle (CoglPath *path,
/* We need at least three stencil bits to combine clips */
if (_cogl_framebuffer_get_stencil_bits (framebuffer) >= 3)
{
static CoglBool seen_warning = FALSE;
static gboolean seen_warning = FALSE;
if (!seen_warning)
{
@@ -320,10 +320,10 @@ _cogl_path_fill_nodes_with_clipped_rectangle (CoglPath *path,
cogl_framebuffer_pop_clip (framebuffer);
}
static CoglBool
static gboolean
validate_layer_cb (CoglPipelineLayer *layer, void *user_data)
{
CoglBool *needs_fallback = user_data;
gboolean *needs_fallback = user_data;
CoglTexture *texture = _cogl_pipeline_layer_get_texture (layer);
/* If any of the layers of the current pipeline contain sliced
@@ -365,7 +365,7 @@ _cogl_path_fill_nodes (CoglPath *path,
}
else
{
CoglBool needs_fallback = FALSE;
gboolean needs_fallback = FALSE;
CoglPrimitive *primitive;
_cogl_pipeline_foreach_layer_internal (pipeline,
@@ -538,7 +538,7 @@ cogl2_path_rectangle (CoglPath *path,
float x_2,
float y_2)
{
CoglBool is_rectangle;
gboolean is_rectangle;
/* If the path was previously empty and the rectangle isn't mirrored
then we'll record that this is a simple rectangle path so that we
@@ -556,7 +556,7 @@ cogl2_path_rectangle (CoglPath *path,
path->data->is_rectangle = is_rectangle;
}
CoglBool
gboolean
_cogl_path_is_rectangle (CoglPath *path)
{
return path->data->is_rectangle;

View File

@@ -63,7 +63,7 @@ struct _CoglAtlasTexture
CoglAtlasTexture *
_cogl_atlas_texture_new_from_bitmap (CoglBitmap *bmp,
CoglBool can_convert_in_place);
gboolean can_convert_in_place);
void
_cogl_atlas_texture_add_reorganize_callback (CoglContext *ctx,
@@ -75,7 +75,7 @@ _cogl_atlas_texture_remove_reorganize_callback (CoglContext *ctx,
GHookFunc callback,
void *user_data);
CoglBool
gboolean
_cogl_is_atlas_texture (void *object);
#endif /* _COGL_ATLAS_TEXTURE_PRIVATE_H_ */

View File

@@ -299,7 +299,7 @@ _cogl_atlas_texture_get_max_waste (CoglTexture *tex)
return cogl_texture_get_max_waste (atlas_tex->sub_texture);
}
static CoglBool
static gboolean
_cogl_atlas_texture_is_sliced (CoglTexture *tex)
{
CoglAtlasTexture *atlas_tex = COGL_ATLAS_TEXTURE (tex);
@@ -308,7 +308,7 @@ _cogl_atlas_texture_is_sliced (CoglTexture *tex)
return cogl_texture_is_sliced (atlas_tex->sub_texture);
}
static CoglBool
static gboolean
_cogl_atlas_texture_can_hardware_repeat (CoglTexture *tex)
{
CoglAtlasTexture *atlas_tex = COGL_ATLAS_TEXTURE (tex);
@@ -339,7 +339,7 @@ _cogl_atlas_texture_transform_quad_coords_to_gl (CoglTexture *tex,
coords);
}
static CoglBool
static gboolean
_cogl_atlas_texture_get_gl_texture (CoglTexture *tex,
GLuint *out_gl_handle,
GLenum *out_gl_target)
@@ -444,7 +444,7 @@ _cogl_atlas_texture_ensure_non_quad_rendering (CoglTexture *tex)
_cogl_texture_ensure_non_quad_rendering (atlas_tex->sub_texture);
}
static CoglBool
static gboolean
_cogl_atlas_texture_set_region_with_border (CoglAtlasTexture *atlas_tex,
int src_x,
int src_y,
@@ -523,7 +523,7 @@ static CoglBitmap *
_cogl_atlas_texture_convert_bitmap_for_upload (CoglAtlasTexture *atlas_tex,
CoglBitmap *bmp,
CoglPixelFormat internal_format,
CoglBool can_convert_in_place,
gboolean can_convert_in_place,
CoglError **error)
{
CoglBitmap *upload_bmp;
@@ -564,7 +564,7 @@ _cogl_atlas_texture_convert_bitmap_for_upload (CoglAtlasTexture *atlas_tex,
return override_bmp;
}
static CoglBool
static gboolean
_cogl_atlas_texture_set_region (CoglTexture *tex,
int src_x,
int src_y,
@@ -585,7 +585,7 @@ _cogl_atlas_texture_set_region (CoglTexture *tex,
pixels to the border */
if (atlas_tex->atlas)
{
CoglBool ret;
gboolean ret;
CoglBitmap *upload_bmp =
_cogl_atlas_texture_convert_bitmap_for_upload (atlas_tex,
bmp,
@@ -639,7 +639,7 @@ _cogl_atlas_texture_get_gl_format (CoglTexture *tex)
return _cogl_texture_gl_get_format (atlas_tex->sub_texture);
}
static CoglBool
static gboolean
_cogl_atlas_texture_can_use_format (CoglPixelFormat format)
{
/* We don't care about the ordering or the premult status and we can
@@ -706,7 +706,7 @@ cogl_atlas_texture_new_with_size (CoglContext *ctx,
loader);
}
static CoglBool
static gboolean
allocate_space (CoglAtlasTexture *atlas_tex,
int width,
int height,
@@ -792,7 +792,7 @@ allocate_space (CoglAtlasTexture *atlas_tex,
return TRUE;
}
static CoglBool
static gboolean
allocate_with_size (CoglAtlasTexture *atlas_tex,
CoglTextureLoader *loader,
CoglError **error)
@@ -817,7 +817,7 @@ allocate_with_size (CoglAtlasTexture *atlas_tex,
return FALSE;
}
static CoglBool
static gboolean
allocate_from_bitmap (CoglAtlasTexture *atlas_tex,
CoglTextureLoader *loader,
CoglError **error)
@@ -827,7 +827,7 @@ allocate_from_bitmap (CoglAtlasTexture *atlas_tex,
CoglPixelFormat bmp_format = cogl_bitmap_get_format (bmp);
int width = cogl_bitmap_get_width (bmp);
int height = cogl_bitmap_get_height (bmp);
CoglBool can_convert_in_place = loader->src.bitmap.can_convert_in_place;
gboolean can_convert_in_place = loader->src.bitmap.can_convert_in_place;
CoglPixelFormat internal_format;
CoglBitmap *upload_bmp;
@@ -878,7 +878,7 @@ allocate_from_bitmap (CoglAtlasTexture *atlas_tex,
return TRUE;
}
static CoglBool
static gboolean
_cogl_atlas_texture_allocate (CoglTexture *tex,
CoglError **error)
{
@@ -902,7 +902,7 @@ _cogl_atlas_texture_allocate (CoglTexture *tex,
CoglAtlasTexture *
_cogl_atlas_texture_new_from_bitmap (CoglBitmap *bmp,
CoglBool can_convert_in_place)
gboolean can_convert_in_place)
{
CoglTextureLoader *loader;

View File

@@ -246,7 +246,7 @@ cogl_atlas_texture_new_from_bitmap (CoglBitmap *bmp);
* Since: 1.16
* Stability: Unstable
*/
CoglBool
gboolean
cogl_is_atlas_texture (void *object);
G_END_DECLS

View File

@@ -362,7 +362,7 @@ _cogl_atlas_notify_post_reorganize (CoglAtlas *atlas)
g_hook_list_invoke (&atlas->post_reorganize_callbacks, FALSE);
}
CoglBool
gboolean
_cogl_atlas_reserve_space (CoglAtlas *atlas,
unsigned int width,
unsigned int height,
@@ -372,7 +372,7 @@ _cogl_atlas_reserve_space (CoglAtlas *atlas,
CoglRectangleMap *new_map;
CoglTexture2D *new_tex;
unsigned int map_width = 0, map_height = 0;
CoglBool ret;
gboolean ret;
CoglRectangleMapEntry new_position;
/* Check if we can fit the rectangle into the existing map */

View File

@@ -69,7 +69,7 @@ _cogl_atlas_new (CoglPixelFormat texture_format,
CoglAtlasFlags flags,
CoglAtlasUpdatePositionCallback update_position_cb);
CoglBool
gboolean
_cogl_atlas_reserve_space (CoglAtlas *atlas,
unsigned int width,
unsigned int height,
@@ -99,7 +99,7 @@ _cogl_atlas_remove_reorganize_callback (CoglAtlas *atlas,
GHookFunc post_callback,
void *user_data);
CoglBool
gboolean
_cogl_is_atlas (void *object);
#endif /* __COGL_ATLAS_H */

View File

@@ -139,7 +139,7 @@ cogl_attribute_buffer_new (CoglContext *context,
* Since: 1.4
* Stability: Unstable
*/
CoglBool
gboolean
cogl_is_attribute_buffer (void *object);
G_END_DECLS

View File

@@ -55,7 +55,7 @@ typedef struct _CoglAttributeNameState
const char *name;
CoglAttributeNameID name_id;
int name_index;
CoglBool normalized_default;
gboolean normalized_default;
int layer_number;
} CoglAttributeNameState;
@@ -64,9 +64,9 @@ struct _CoglAttribute
CoglObject _parent;
const CoglAttributeNameState *name_state;
CoglBool normalized;
gboolean normalized;
CoglBool is_buffered;
gboolean is_buffered;
union {
struct {

View File

@@ -65,11 +65,11 @@ static void _cogl_attribute_free (CoglAttribute *attribute);
COGL_OBJECT_DEFINE (Attribute, attribute);
COGL_GTYPE_DEFINE_CLASS (Attribute, attribute);
static CoglBool
static gboolean
validate_cogl_attribute_name (const char *name,
const char **real_attribute_name,
CoglAttributeNameID *name_id,
CoglBool *normalized,
gboolean *normalized,
int *layer_number)
{
name = name + 5; /* skip "cogl_" */
@@ -166,7 +166,7 @@ error:
return NULL;
}
static CoglBool
static gboolean
validate_n_components (const CoglAttributeNameState *name_state,
int n_components)
{
@@ -271,7 +271,7 @@ _cogl_attribute_new_const (CoglContext *context,
const char *name,
int n_components,
int n_columns,
CoglBool transpose,
gboolean transpose,
const float *value)
{
CoglAttribute *attribute = g_slice_new (CoglAttribute);
@@ -428,7 +428,7 @@ CoglAttribute *
cogl_attribute_new_const_2x2fv (CoglContext *context,
const char *name,
const float *matrix2x2,
CoglBool transpose)
gboolean transpose)
{
return _cogl_attribute_new_const (context,
name,
@@ -442,7 +442,7 @@ CoglAttribute *
cogl_attribute_new_const_3x3fv (CoglContext *context,
const char *name,
const float *matrix3x3,
CoglBool transpose)
gboolean transpose)
{
return _cogl_attribute_new_const (context,
name,
@@ -456,7 +456,7 @@ CoglAttribute *
cogl_attribute_new_const_4x4fv (CoglContext *context,
const char *name,
const float *matrix4x4,
CoglBool transpose)
gboolean transpose)
{
return _cogl_attribute_new_const (context,
name,
@@ -466,7 +466,7 @@ cogl_attribute_new_const_4x4fv (CoglContext *context,
matrix4x4);
}
CoglBool
gboolean
cogl_attribute_get_normalized (CoglAttribute *attribute)
{
_COGL_RETURN_VAL_IF_FAIL (cogl_is_attribute (attribute), FALSE);
@@ -477,7 +477,7 @@ cogl_attribute_get_normalized (CoglAttribute *attribute)
static void
warn_about_midscene_changes (void)
{
static CoglBool seen = FALSE;
static gboolean seen = FALSE;
if (!seen)
{
g_warning ("Mid-scene modification of attributes has "
@@ -488,7 +488,7 @@ warn_about_midscene_changes (void)
void
cogl_attribute_set_normalized (CoglAttribute *attribute,
CoglBool normalized)
gboolean normalized)
{
_COGL_RETURN_IF_FAIL (cogl_is_attribute (attribute));
@@ -558,7 +558,7 @@ _cogl_attribute_free (CoglAttribute *attribute)
g_slice_free (CoglAttribute, attribute);
}
static CoglBool
static gboolean
validate_layer_cb (CoglPipeline *pipeline,
int layer_index,
void *user_data)
@@ -566,7 +566,7 @@ validate_layer_cb (CoglPipeline *pipeline,
CoglTexture *texture =
cogl_pipeline_get_layer_texture (pipeline, layer_index);
CoglFlushLayerState *state = user_data;
CoglBool status = TRUE;
gboolean status = TRUE;
/* invalid textures will be handled correctly in
* _cogl_pipeline_flush_layers_gl_state */

View File

@@ -402,7 +402,7 @@ CoglAttribute *
cogl_attribute_new_const_2x2fv (CoglContext *context,
const char *name,
const float *matrix2x2,
CoglBool transpose);
gboolean transpose);
/**
* cogl_attribute_new_const_3x3fv:
@@ -437,7 +437,7 @@ CoglAttribute *
cogl_attribute_new_const_3x3fv (CoglContext *context,
const char *name,
const float *matrix3x3,
CoglBool transpose);
gboolean transpose);
/**
* cogl_attribute_new_const_4x4fv:
@@ -472,7 +472,7 @@ CoglAttribute *
cogl_attribute_new_const_4x4fv (CoglContext *context,
const char *name,
const float *matrix4x4,
CoglBool transpose);
gboolean transpose);
/**
* cogl_attribute_set_normalized:
@@ -494,7 +494,7 @@ cogl_attribute_new_const_4x4fv (CoglContext *context,
*/
void
cogl_attribute_set_normalized (CoglAttribute *attribute,
CoglBool normalized);
gboolean normalized);
/**
* cogl_attribute_get_normalized:
@@ -506,7 +506,7 @@ cogl_attribute_set_normalized (CoglAttribute *attribute,
* Stability: unstable
* Since: 1.10
*/
CoglBool
gboolean
cogl_attribute_get_normalized (CoglAttribute *attribute);
/**
@@ -545,7 +545,7 @@ cogl_attribute_set_buffer (CoglAttribute *attribute,
* Return value: %TRUE if the @object references a #CoglAttribute,
* %FALSE otherwise
*/
CoglBool
gboolean
cogl_is_attribute (void *object);
G_END_DECLS

View File

@@ -289,7 +289,7 @@ _cogl_bitmap_premult_unpacked_span_16 (uint16_t *data,
}
}
static CoglBool
static gboolean
_cogl_bitmap_can_fast_premult (CoglPixelFormat format)
{
switch (format & ~COGL_PREMULT_BIT)
@@ -305,7 +305,7 @@ _cogl_bitmap_can_fast_premult (CoglPixelFormat format)
}
}
static CoglBool
static gboolean
_cogl_bitmap_needs_short_temp_buffer (CoglPixelFormat format)
{
/* If the format is using more than 8 bits per component then we'll
@@ -358,7 +358,7 @@ _cogl_bitmap_needs_short_temp_buffer (CoglPixelFormat format)
return FALSE;
}
CoglBool
gboolean
_cogl_bitmap_convert_into_bitmap (CoglBitmap *src_bmp,
CoglBitmap *dst_bmp,
CoglError **error)
@@ -374,8 +374,8 @@ _cogl_bitmap_convert_into_bitmap (CoglBitmap *src_bmp,
int width, height;
CoglPixelFormat src_format;
CoglPixelFormat dst_format;
CoglBool use_16;
CoglBool need_premult;
gboolean use_16;
gboolean need_premult;
src_format = cogl_bitmap_get_format (src_bmp);
src_rowstride = cogl_bitmap_get_rowstride (src_bmp);
@@ -514,7 +514,7 @@ _cogl_bitmap_convert (CoglBitmap *src_bmp,
return dst_bmp;
}
static CoglBool
static gboolean
driver_can_convert (CoglContext *ctx,
CoglPixelFormat src_format,
CoglPixelFormat internal_format)
@@ -546,7 +546,7 @@ driver_can_convert (CoglContext *ctx,
CoglBitmap *
_cogl_bitmap_convert_for_upload (CoglBitmap *src_bmp,
CoglPixelFormat internal_format,
CoglBool can_convert_in_place,
gboolean can_convert_in_place,
CoglError **error)
{
CoglContext *ctx = _cogl_bitmap_get_context (src_bmp);
@@ -614,7 +614,7 @@ _cogl_bitmap_convert_for_upload (CoglBitmap *src_bmp,
return dst_bmp;
}
CoglBool
gboolean
_cogl_bitmap_unpremult (CoglBitmap *bmp,
CoglError **error)
{
@@ -682,7 +682,7 @@ _cogl_bitmap_unpremult (CoglBitmap *bmp,
return TRUE;
}
CoglBool
gboolean
_cogl_bitmap_premult (CoglBitmap *bmp,
CoglError **error)
{

View File

@@ -40,7 +40,7 @@
#include <gdk-pixbuf/gdk-pixbuf.h>
CoglBool
gboolean
_cogl_bitmap_get_size_from_file (const char *filename,
int *width,
int *height)
@@ -60,7 +60,7 @@ _cogl_bitmap_from_file (CoglContext *ctx,
{
static CoglUserDataKey pixbuf_key;
GdkPixbuf *pixbuf;
CoglBool has_alpha;
gboolean has_alpha;
GdkColorspace color_space;
CoglPixelFormat pixel_format;
int width;

View File

@@ -51,8 +51,8 @@ struct _CoglBitmap
uint8_t *data;
CoglBool mapped;
CoglBool bound;
gboolean mapped;
gboolean bound;
/* If this is non-null then 'data' is ignored and instead it is
fetched from this shared bitmap. */
@@ -109,10 +109,10 @@ _cogl_bitmap_convert (CoglBitmap *bmp,
CoglBitmap *
_cogl_bitmap_convert_for_upload (CoglBitmap *src_bmp,
CoglPixelFormat internal_format,
CoglBool can_convert_in_place,
gboolean can_convert_in_place,
CoglError **error);
CoglBool
gboolean
_cogl_bitmap_convert_into_bitmap (CoglBitmap *src_bmp,
CoglBitmap *dst_bmp,
CoglError **error);
@@ -122,20 +122,20 @@ _cogl_bitmap_from_file (CoglContext *ctx,
const char *filename,
CoglError **error);
CoglBool
gboolean
_cogl_bitmap_unpremult (CoglBitmap *dst_bmp,
CoglError **error);
CoglBool
gboolean
_cogl_bitmap_premult (CoglBitmap *dst_bmp,
CoglError **error);
CoglBool
gboolean
_cogl_bitmap_convert_premult_status (CoglBitmap *bmp,
CoglPixelFormat dst_format,
CoglError **error);
CoglBool
gboolean
_cogl_bitmap_copy_subregion (CoglBitmap *src,
CoglBitmap *dst,
int src_x,
@@ -151,7 +151,7 @@ CoglBitmap *
_cogl_bitmap_copy (CoglBitmap *src_bmp,
CoglError **error);
CoglBool
gboolean
_cogl_bitmap_get_size_from_file (const char *filename,
int *width,
int *height);

View File

@@ -63,7 +63,7 @@ _cogl_bitmap_free (CoglBitmap *bmp)
g_slice_free (CoglBitmap, bmp);
}
CoglBool
gboolean
_cogl_bitmap_convert_premult_status (CoglBitmap *bmp,
CoglPixelFormat dst_format,
CoglError **error)
@@ -115,7 +115,7 @@ _cogl_bitmap_copy (CoglBitmap *src_bmp,
return dst_bmp;
}
CoglBool
gboolean
_cogl_bitmap_copy_subregion (CoglBitmap *src,
CoglBitmap *dst,
int src_x,
@@ -130,7 +130,7 @@ _cogl_bitmap_copy_subregion (CoglBitmap *src,
uint8_t *dstdata;
int bpp;
int line;
CoglBool succeeded = FALSE;
gboolean succeeded = FALSE;
/* Intended only for fast copies when format is equal! */
_COGL_RETURN_VAL_IF_FAIL ((src->format & ~COGL_PREMULT_BIT) ==
@@ -165,7 +165,7 @@ _cogl_bitmap_copy_subregion (CoglBitmap *src,
return succeeded;
}
CoglBool
gboolean
cogl_bitmap_get_size_from_file (const char *filename,
int *width,
int *height)

View File

@@ -246,7 +246,7 @@ cogl_bitmap_get_buffer (CoglBitmap *bitmap);
*
* Since: 1.0
*/
CoglBool
gboolean
cogl_bitmap_get_size_from_file (const char *filename,
int *width,
int *height);
@@ -262,7 +262,7 @@ cogl_bitmap_get_size_from_file (const char *filename,
*
* Since: 1.0
*/
CoglBool
gboolean
cogl_is_bitmap (void *object);
/**

View File

@@ -56,7 +56,7 @@ _COGL_STATIC_ASSERT (sizeof (unsigned long) <= sizeof (void *),
#define BIT_MASK(bit_num) \
(1UL << BIT_INDEX (bit_num))
CoglBool
gboolean
_cogl_bitmask_get_from_array (const CoglBitmask *bitmask,
unsigned int bit_num)
{
@@ -90,7 +90,7 @@ _cogl_bitmask_convert_to_array (CoglBitmask *bitmask)
void
_cogl_bitmask_set_in_array (CoglBitmask *bitmask,
unsigned int bit_num,
CoglBool value)
gboolean value)
{
GArray *array;
unsigned int array_index;
@@ -154,7 +154,7 @@ _cogl_bitmask_set_bits (CoglBitmask *dst,
void
_cogl_bitmask_set_range_in_array (CoglBitmask *bitmask,
unsigned int n_bits,
CoglBool value)
gboolean value)
{
GArray *array;
unsigned int array_index, bit_index;
@@ -326,7 +326,7 @@ typedef struct
int *bits;
} CheckData;
static CoglBool
static gboolean
check_bit (int bit_num, void *user_data)
{
CheckData *data = user_data;

View File

@@ -90,19 +90,19 @@ typedef struct _CoglBitmaskImaginaryType *CoglBitmask;
#define _cogl_bitmask_init(bitmask) \
G_STMT_START { *(bitmask) = _cogl_bitmask_from_bits (0); } G_STMT_END
CoglBool
gboolean
_cogl_bitmask_get_from_array (const CoglBitmask *bitmask,
unsigned int bit_num);
void
_cogl_bitmask_set_in_array (CoglBitmask *bitmask,
unsigned int bit_num,
CoglBool value);
gboolean value);
void
_cogl_bitmask_set_range_in_array (CoglBitmask *bitmask,
unsigned int n_bits,
CoglBool value);
gboolean value);
void
_cogl_bitmask_clear_all_in_array (CoglBitmask *bitmask);
@@ -143,7 +143,7 @@ _cogl_bitmask_xor_bits (CoglBitmask *dst,
const CoglBitmask *src);
/* The foreach function can return FALSE to stop iteration */
typedef CoglBool (* CoglBitmaskForeachFunc) (int bit_num, void *user_data);
typedef gboolean (* CoglBitmaskForeachFunc) (int bit_num, void *user_data);
/*
* cogl_bitmask_foreach:
@@ -165,7 +165,7 @@ _cogl_bitmask_foreach (const CoglBitmask *bitmask,
*
* Return value: whether bit number @bit_num is set in @bitmask
*/
static inline CoglBool
static inline gboolean
_cogl_bitmask_get (const CoglBitmask *bitmask, unsigned int bit_num)
{
if (_cogl_bitmask_has_array (bitmask))
@@ -185,7 +185,7 @@ _cogl_bitmask_get (const CoglBitmask *bitmask, unsigned int bit_num)
* Sets or resets a bit number @bit_num in @bitmask according to @value.
*/
static inline void
_cogl_bitmask_set (CoglBitmask *bitmask, unsigned int bit_num, CoglBool value)
_cogl_bitmask_set (CoglBitmask *bitmask, unsigned int bit_num, gboolean value)
{
if (_cogl_bitmask_has_array (bitmask) ||
bit_num >= COGL_BITMASK_MAX_DIRECT_BITS)
@@ -209,7 +209,7 @@ _cogl_bitmask_set (CoglBitmask *bitmask, unsigned int bit_num, CoglBool value)
static inline void
_cogl_bitmask_set_range (CoglBitmask *bitmask,
unsigned int n_bits,
CoglBool value)
gboolean value)
{
if (_cogl_bitmask_has_array (bitmask) ||
n_bits > COGL_BITMASK_MAX_DIRECT_BITS)

View File

@@ -163,7 +163,7 @@ _cogl_blend_string_split_rgba_statement (CoglBlendStringStatement *statement,
}
}
static CoglBool
static gboolean
validate_tex_combine_statements (CoglBlendStringStatement *statements,
int n_statements,
CoglError **error)
@@ -209,7 +209,7 @@ error:
return FALSE;
}
static CoglBool
static gboolean
validate_blend_statements (CoglBlendStringStatement *statements,
int n_statements,
CoglError **error)
@@ -273,7 +273,7 @@ error:
return FALSE;
}
static CoglBool
static gboolean
validate_statements_for_context (CoglBlendStringStatement *statements,
int n_statements,
CoglBlendStringContext context,
@@ -445,19 +445,19 @@ get_color_src_info (const char *mark,
return NULL;
}
static CoglBool
static gboolean
is_symbol_char (const char c)
{
return (g_ascii_isalpha (c) || c == '_') ? TRUE : FALSE;
}
static CoglBool
static gboolean
is_alphanum_char (const char c)
{
return (g_ascii_isalnum (c) || c == '_') ? TRUE : FALSE;
}
static CoglBool
static gboolean
parse_argument (const char *string, /* original user string */
const char **ret_p, /* start of argument IN:OUT */
const CoglBlendStringStatement *statement,
@@ -470,8 +470,8 @@ parse_argument (const char *string, /* original user string */
const char *mark = NULL;
const char *error_string = NULL;
ParserArgState state = PARSER_ARG_STATE_START;
CoglBool parsing_factor = FALSE;
CoglBool implicit_factor_brace = FALSE;
gboolean parsing_factor = FALSE;
gboolean implicit_factor_brace = FALSE;
arg->source.is_zero = FALSE;
arg->source.info = NULL;

View File

@@ -77,18 +77,18 @@ typedef struct _CoglBlendStringColorSourceInfo
typedef struct _CoglBlendStringColorSource
{
CoglBool is_zero;
gboolean is_zero;
const CoglBlendStringColorSourceInfo *info;
int texture; /* for the TEXTURE_N color source */
CoglBool one_minus;
gboolean one_minus;
CoglBlendStringChannelMask mask;
} CoglBlendStringColorSource;
typedef struct _CoglBlendStringFactor
{
CoglBool is_one;
CoglBool is_src_alpha_saturate;
CoglBool is_color;
gboolean is_one;
gboolean is_src_alpha_saturate;
gboolean is_color;
CoglBlendStringColorSource source;
} CoglBlendStringFactor;
@@ -129,7 +129,7 @@ typedef struct _CoglBlendStringStatement
} CoglBlendStringStatement;
CoglBool
gboolean
_cogl_blend_string_compile (const char *string,
CoglBlendStringContext context,
CoglBlendStringStatement *statements,

View File

@@ -44,7 +44,7 @@
static const CoglBlitMode *_cogl_blit_default_mode = NULL;
static CoglBool
static gboolean
_cogl_blit_texture_render_begin (CoglBlitData *data)
{
CoglContext *ctx = data->src_tex->context;
@@ -144,7 +144,7 @@ _cogl_blit_texture_render_end (CoglBlitData *data)
cogl_object_unref (data->dest_fb);
}
static CoglBool
static gboolean
_cogl_blit_framebuffer_begin (CoglBlitData *data)
{
CoglContext *ctx = data->src_tex->context;
@@ -219,7 +219,7 @@ _cogl_blit_framebuffer_end (CoglBlitData *data)
cogl_object_unref (data->dest_fb);
}
static CoglBool
static gboolean
_cogl_blit_copy_tex_sub_image_begin (CoglBlitData *data)
{
CoglOffscreen *offscreen;
@@ -269,7 +269,7 @@ _cogl_blit_copy_tex_sub_image_end (CoglBlitData *data)
cogl_object_unref (data->src_fb);
}
static CoglBool
static gboolean
_cogl_blit_get_tex_data_begin (CoglBlitData *data)
{
data->format = _cogl_texture_get_format (data->src_tex);

View File

@@ -41,7 +41,7 @@
typedef struct _CoglBlitData CoglBlitData;
typedef CoglBool (* CoglBlitBeginFunc) (CoglBlitData *data);
typedef gboolean (* CoglBlitBeginFunc) (CoglBlitData *data);
typedef void (* CoglBlitEndFunc) (CoglBlitData *data);
typedef void (* CoglBlitFunc) (CoglBlitData *data,

View File

@@ -36,7 +36,7 @@
#include "cogl-context-private.h"
#include "driver/gl/cogl-util-gl-private.h"
CoglBool
gboolean
_cogl_boxed_value_equal (const CoglBoxedValue *bva,
const CoglBoxedValue *bvb)
{
@@ -134,7 +134,7 @@ _cogl_boxed_value_set_x (CoglBoxedValue *bv,
CoglBoxedType type,
size_t value_size,
const void *value,
CoglBool transpose)
gboolean transpose)
{
if (count == 1)
{
@@ -229,7 +229,7 @@ void
_cogl_boxed_value_set_matrix (CoglBoxedValue *bv,
int dimensions,
int count,
CoglBool transpose,
gboolean transpose,
const float *value)
{
_cogl_boxed_value_set_x (bv,

Some files were not shown because too many files have changed in this diff Show More