1
0
Fork 0
Commit graph

5089 commits

Author SHA1 Message Date
Emmanuele Bassi
9872d7eb1b docs: Clarify actor map and unmap methods
ClutterActor stopped requiring to override the map and unmap virtual
functions some time ago.

Now that ClutterActor implements the Container interface, overriding map
and unmap to control the MAPPED state of the children is pretty much
going to be a source of bugs and misunderstandings.

Plus, the ordering of the unmap, destroy, dispose, and finalize calls
should be be documented properly.

The documentation should clarify all that.
2012-02-02 11:18:00 +00:00
Evan Nemerson
4b6156a57a introspection: add some missing annotations
https://bugzilla.gnome.org/show_bug.cgi?id=667840
2012-01-31 16:25:05 -08:00
Emmanuele Bassi
bb2d807d2a docs: Add an image for the XIncluded code 2012-01-31 16:46:03 +00:00
Emmanuele Bassi
76c8b17144 docs: XInclude test-actor inside the Actor's description 2012-01-31 16:32:48 +00:00
Emmanuele Bassi
5974cfc97b docs: Add an example to the Actor description 2012-01-31 16:30:05 +00:00
Emmanuele Bassi
341faaa089 actor: Add diagnostic message for "behaviours" in ClutterScript
Behaviours have long since been deprecated; we should notify the user
that still uses behaviours in ClutterScript definitions.
2012-01-31 12:45:08 +00:00
Emmanuele Bassi
11239d8da6 actor: Do not unmap/unrealize twice on destruction
When calling clutter_actor_destroy(), ClutterActor calls
update_map_state() on itself to unset the REALIZED and MAPPED states,
prior to running the dispose() implementation.

The default dispose() will call remove_child() (either directly or
through the Container implementation), which will check for the MAPPED
state and then run update_map_state() again. We use the previously set
MAPPED state to decide whether or not the parent should queue for a
relayout/redraw when removing a visible children.

If the MAPPED flag was cleared prior to remove_child(), though, it'll
always be unset by the time we get to remove_child(), and this will
cause missing redraws/relayouts; we were ignoring this prior the
post-First Apocalypse changes because we were doing:

  if (was_mapped)
    clutter_actor_queue_relayout (parent);

  clutter_actor_queue_redraw (parent);

which is obviously wrong. Once I removed that glaring brain damage from
the remove_child() implementation, bugs started appearing — bugs that
were probably the reason why we introduced that brain damage in the
first place, instead of checking the source of those bugs.

The obvious fix is to avoid clearing up the actor's state on destroy()
until we remove the actor from its parent. This also reduces the amount
of work we do, and the code paths that can potentially go wrong.
2012-01-31 12:35:17 +00:00
Emmanuele Bassi
8ee6d10681 actor: Move ClutterShader-related code out of clutter-actor.c
Since the code dealing with ClutterShader is pretty self-contained, now,
we can safely move it outside of the main ClutterActor source file and
into its own. This will allow us to just drop a bunch of files when
branching for 2.0.
2012-01-31 11:56:59 +00:00
Emmanuele Bassi
2ed9e0d557 x11: Remove CLUTTER_DISABLE_DEPRECATED usage
Switch to CLUTTER_DEPRECATED and CLUTTER_DEPRECATED_FOR.
2012-01-31 10:34:45 +00:00
Emmanuele Bassi
1d84bf2b04 texture: Deprecate YUV setter
The YUV support depends on the driver support, and not only not many
drivers support YUV natively: the supported colorspaces are pretty much
useless.

The proper way to do YUV to RGB colorspace conversion on the GPU is to
use a fragment shader; for that, ClutterTexture and Cogl provide enough
API to achieve a good result - see the Clutter-GStreamer implementation,
for instance.
2012-01-31 10:28:04 +00:00
Emmanuele Bassi
c95b126571 texture: It's bytes per pixel, not bits
Clarify the error message when checking the bpp argument.
2012-01-31 10:23:48 +00:00
Emmanuele Bassi
986307f5e4 Use ClutterActorIter inside layout managers
Whenever it is possible, or convenient.
2012-01-30 11:09:59 +00:00
Emmanuele Bassi
842ff82d77 docs: Mention the DELEGATE_LAYOUT flag in set_allocation()
With code examples.
2012-01-27 17:07:33 +00:00
Emmanuele Bassi
534ec4ac7a group: Set the NO_LAYOUT flag
Since FixedLayout won't do that for us any more, and we have Group users
and Group subclasses that may be relying on it.
2012-01-27 15:48:46 +00:00
Emmanuele Bassi
31341986b1 fixed-layout: Remove the NO_LAYOUT flag set
ClutterFixedLayout is the default layout manager for ClutterActor.

Existing subclasses of ClutterActor will get a fixed layout manager
regardless of whether they are going to use it, but since it sets the
CLUTTER_ACTOR_NO_LAYOUT flag, it will introduce regressions on actors
that perform their own layout management.

The CLUTTER_ACTOR_NO_LAYOUT flag was a bit of a mistake in the first
place, as it was introduced as a last minute workaround in the 1.0
process to deal with broken stuff in Moblin. It's going to be a target
for deprecation towards a removal when we start the 2.0 process.
2012-01-27 15:45:11 +00:00
Emmanuele Bassi
5c9c5d24b2 box: Use the ActorIter API
And remove a useless override of the pick() virtual function while we're
at it.

https://bugzilla.gnome.org/show_bug.cgi?id=668669
2012-01-27 11:55:39 +00:00
Emmanuele Bassi
c6e1491474 stage: Use the iterator API instead of the DOM one
Whenever we're iterating over the children of the Stage we can now use
the ClutterActorIter API.

https://bugzilla.gnome.org/show_bug.cgi?id=668669
2012-01-27 11:55:39 +00:00
Emmanuele Bassi
58ffcfb10e actor: Add ClutterActorIter
Iterating over children and ancestors of an actor is a relatively common
operation. Currently, you only have one option: start a for() loop, get
the first child of the actor, and advance to the next sibling for the
list of children; or start a for() loop and advance to the parent of the
actor.

These operations can be easily done through the ClutterActor API, but
they all require going through the public API, and performing multiple
type checks on the arguments.

Along with the DOM API, it would be nice to have an ancillary, utility
API that uses an iterator structure to hold the state, and can be
advanced in a loop.

https://bugzilla.gnome.org/show_bug.cgi?id=668669
2012-01-27 11:55:39 +00:00
Emmanuele Bassi
fa856e3f5e box: Restore the ::destroy handler
During the gutting of ClutterBox, the destroy and dispose implementation
were removed. The former, especially, destroyed all children - which
usually meant that the redraw queues for the childre was cleared as
well. The removal introduced crashes when a Box was destroyed while its
children were still queueing redraws.
2012-01-27 11:48:14 +00:00
Emmanuele Bassi
12a79a66d8 drag-action: Use the symbolic constants for the button
https://bugzilla.gnome.org/show_bug.cgi?id=668692
2012-01-27 09:46:10 +00:00
Emmanuele Bassi
60cddbd28e event: Add symbolic names for left, middle, and right buttons
Symbolic names are better than magic numbers, even if they are
well-established and won't likely change.

This maps to a commit in GTK+ that introduced the same names; it
was decided to go for PRIMARY, MIDDLE, and SECONDARY because of
the confusion that may arise when the button order gets flipped
in left-handed configurations - the "left" button (i.e. 1) becomes
the right-most button, and the "right" button (i.e. 3) becomes
the left-most button.

https://bugzilla.gnome.org/show_bug.cgi?id=668692
2012-01-27 09:43:06 +00:00
Emmanuele Bassi
bacd4dd6a0 Remove unused variable 2012-01-26 18:11:49 +00:00
Rob Bradford
78533cfd1a wayland: Correctly support fullscreening before the stage is realized
Rather than just call into wl_shell_surface_set_fullscreen we must repeat all
the steps to correctly fullscreen the surface.
2012-01-26 15:39:16 +00:00
Rob Bradford
797336762e wayland: Force a redraw of the stage to get the new sized buffer attached 2012-01-26 14:41:27 +00:00
Rob Bradford
65e27a830b wayland: Use new stage state manipulation functions 2012-01-26 14:40:29 +00:00
Rob Bradford
0094350467 wayland: Refine fullscreen/unfullscreen to emit the state change events
Also update the code to set the size of the stage to set it to the size of the
output. In future versions of the Wayland protocol we'll get a configure
message advising of us of the size we can be to achieve fullscreen.
2012-01-26 14:14:13 +00:00
Rob Bradford
dd64ad1e42 wayland: Support programmatically resizing the stage
This will call into Cogl and ask it to resize the framebuffer which will then
update the underlying EGL surface.
2012-01-26 14:14:13 +00:00
Rob Bradford
838fc6276f wayland: Support setting fullscreen before the stage is realized 2012-01-26 14:14:13 +00:00
Rob Bradford
da19c3dfca wayland: Implement set_fullscreen vfunc in ClutterStageWayland 2012-01-26 14:14:13 +00:00
Rob Bradford
cb4b9d758f wayland: Include the Wayland surface and shell surface in ClutterStageWayland 2012-01-26 14:14:13 +00:00
Rob Bradford
737c5e1045 wayland: Save the output mode so that it can be used to fullscreen windows 2012-01-26 14:13:23 +00:00
Emmanuele Bassi
3780e3e4f0 x11: Unbreak the build
The stage wrapper is on the ClutterStageCogl instance.
2012-01-26 10:29:50 +00:00
Emmanuele Bassi
fdf89a9e06 Merge branch 'stage-state'
* stage-state:
  docs: Update ClutterStageState flags
  wayland: Use the Stage state tracking
  gdk: Use the Stage state tracking
  win32: Use the Stage state tracking
  x11: Use the Stage state tracking
  osx: Use the Stage state tracking
  stage: Add state tracking
2012-01-26 08:42:00 +00:00
Emmanuele Bassi
9dab33401f docs: Update ClutterStageState flags 2012-01-26 08:33:45 +00:00
Emmanuele Bassi
2b547442a3 wayland: Use the Stage state tracking 2012-01-26 08:31:11 +00:00
Emmanuele Bassi
8c184f53cb gdk: Use the Stage state tracking 2012-01-26 08:31:11 +00:00
Emmanuele Bassi
e73c2bf4ea win32: Use the Stage state tracking 2012-01-26 08:31:10 +00:00
Emmanuele Bassi
12e4f300a7 x11: Use the Stage state tracking 2012-01-26 08:31:10 +00:00
Emmanuele Bassi
2c9a693c14 osx: Use the Stage state tracking 2012-01-26 08:30:58 +00:00
Emmanuele Bassi
19ff11ac93 stage: Add state tracking
State changes on the Stage are currently deferred to the windowing
system backends, but the code is generally the same, and it should
be abstracted neatly inside the Stage class itself.

There's also the extra caveat for backends that state changes on a
Stage must also emit a ClutterEvent of type CLUTTER_STAGE_STATE, a
requirement that needlessly complicates the backend code.
2012-01-26 08:30:47 +00:00
Emmanuele Bassi
71323b8bfc x11/stage: Use symbolic constants for source function
And make sure to use the clutter_threads_add_timeout(), so that the
function is called under the Clutter lock.
2012-01-25 23:20:24 +00:00
Emmanuele Bassi
75549456fd actor: use paint opacity to paint the background color 2012-01-24 14:52:33 +00:00
Emmanuele Bassi
825e1e6242 docs: Inlined examples break enums gtk-doc 2012-01-24 14:13:53 +00:00
Emmanuele Bassi
8d8d4ae7e5 script: Add loading from a resource
GLib has gained support for compiling ancillary data files into the same
binary blob as a library or as an executable.

We should add this feature to ClutterScript, so that it's possible to
bundle UI definitions with an application.
2012-01-24 12:04:56 +00:00
Emmanuele Bassi
254ebd8765 actor: Remove unused function 2012-01-24 09:36:31 +00:00
Emmanuele Bassi
4330f45d05 Override Container inside ClutterStage
The only actor that results in a mix of the old Container API and the
new Actor API is ClutterStage. By inheritance, a Stage is a Group, but
we don't want it to behave like a Group - as it already overrides most
of the Actor API, and the reason why it was made as a Group in the
first place was convenience for adding/removing children.

Given that touching Group to make it aware of the new Actor API has
rapidly devolved into a struggle between a Demiurge that tries to
avoid breakage and a Chaos that finds new and interesting ways to
break ClutterGroup, let's declare API bankruptcy here and now.

ClutterStage should override ClutterContainer methods, and use the
layout management of ClutterFixedLayout as the proper class that it
was meant to be ages ago. Let ClutterGroup rot in pieces.
2012-01-23 20:54:07 +00:00
Emmanuele Bassi
cfac97ffe1 Allow mixing old and new API without falling apart
Now that we reinstated Group to its "former glory", we need to ensure
that applications using the deprecated containers with the new DOM API
in ClutterActor can actually work - or, at least, not break horribly.

This actually means making sure that ClutterStage and ClutterGroup can
cope with the DOM, while retaining their old implementations, as well as
their bizarre idiosyncrasies and their utter, utter brokenness.
2012-01-23 20:54:06 +00:00
Emmanuele Bassi
29384c114f actor: NULL-ify sibling fields when removing
Let's try and avoid leaving around stale pointers.
2012-01-20 17:19:42 +00:00
Rob Bradford
27784de941 wayland: Update to changes in the SHM api
The enum value for the SHM formats has changed to be more explicit about the
format of the data.
2012-01-20 16:15:08 +00:00
Emmanuele Bassi
7d7d753a49 group: Restore previous implementation
Making Group just a proxy to Actor broke some behaviour that application
and toolkit code was relying on. Let's keep Group around to fight
another day.

This commit fixes gnome-shell as far as I can test it.
2012-01-20 16:01:13 +00:00