1
0
Fork 0
Commit graph

25 commits

Author SHA1 Message Date
Emmanuele Bassi
12370bd4f8 docs: Move to markdown
We're removing docbook tags in favour of the markdown syntax.
2014-03-17 23:07:58 +00:00
Emmanuele Bassi
41bb03da2d Use the new macros for adding private data 2013-07-03 18:04:32 +01:00
Emmanuele Bassi
0fca11ec2f path: Avoid integer overflow in get_distance()
The get_distance() API uses machine integers to compute the distance;
this means that on 32bit we can overflow the integer size. This gets
hidden by the fact that get_distance() returns an unsigned integer as
well.

In reality, ClutterPath is an unmitigated mess, and the only way to
actually fix it is to break API.

https://bugzilla.gnome.org/show_bug.cgi?id=652521
2012-04-27 12:28:49 +01:00
Robert Bragg
a8e631543e Reduce our internal dependence on the Cogl 1.x api
Since Cogl has started restricting what cogl 1.x api is exposed when
COGL_ENABLE_EXPERIMENTAL_2_0_API is defined and since we build all
Clutter internals with COGL_ENABLE_EXPERIMENTAL_2_0_API defined this
patch makes a first pass at reducing our internal use of the Cogl 1.x
api.

The most notable api that's no longer exposed to us internally is
the cogl_material_ api so this switches all Clutter internals to use the
cogl_pipeline_ api instead. This patch also makes quite a bit of
progress removing internal uses of CoglHandle although there is still
more to go.
2012-02-21 17:46:11 +00:00
Bastian Winkler
6336883da7 path: Fix introspection annotations
Add out annotations for clutter_path_get_node() and
clutter_path_get_position()

https://bugzilla.gnome.org/show_bug.cgi?id=664336
2011-12-01 10:55:13 +00:00
Emmanuele Bassi
7f3363e1db Tag all deprecated symbols using CLUTTER_DEPRECATED
This requires some minor surgery in the build to disable the deprecation
warnings in the deprecated classes.
2011-10-14 11:34:38 +01:00
Emmanuele Bassi
46c597a1f6 Clean up clutter-private.h/6
Move all Actor private API to a separate file.
2010-10-21 12:22:17 +01:00
Emmanuele Bassi
7dd09e2186 Use G_DEFINE_BOXED_TYPE for all boxed types
We actually need a couple more macros for registering GValue
transformation functions. Those should be added to upstream
GLib.
2010-10-18 11:26:45 +01:00
Emmanuele Bassi
8a5686d835 Further annotation fixes 2010-09-08 16:41:47 +01:00
Emmanuele Bassi
3e74f42f07 introspection: Add annotations
Reduce the amount of warnings coming from g-ir-scanner.
2010-09-03 12:14:50 +01:00
Neil Roberts
8d51617979 Conditionally use g_object_notify_by_pspec
This adds a wrapper macro to clutter-private that will use
g_object_notify_by_pspec if it's compiled against a version of GLib
that is sufficiently new. Otherwise it will notify by the property
name as before by extracting the name from the pspec. The objects can
then store a static array of GParamSpecs and notify using those as
suggested in the documentation for g_object_notify_by_pspec.

Note that the name of the variable used for storing the array of
GParamSpecs is obj_props instead of properties as used in the
documentation because some places in Clutter uses 'properties' as the
name of a local variable.

Mose of the classes in Clutter have been converted using the script in
the bug report. Some classes have not been modified even though the
script picked them up as described here:

json-generator:

 We probably don't want to modify the internal copy of JSON

behaviour-depth:
rectangle:
score:
stage-manager:

 These aren't using the separate GParamSpec* variable style.

blur-effect:
win32/device-manager:

 Don't actually define any properties even though it has the enum.

box-layout:
flow-layout:

  Have some per-child properties that don't work automatically with
  the script.

clutter-model:

  The script gets confused with ClutterModelIter

stage:

  Script gets confused because PROP_USER_RESIZE doesn't match
  "user-resizable"

test-layout:

  Don't really want to modify the tests

http://bugzilla.clutter-project.org/show_bug.cgi?id=2150
2010-08-10 17:12:06 +01:00
Damien Lespiau
52a78a7220 analysis: FALSE/0 used in pointer context
While this is totally fine (0 in the pointer context will be converted
in the right internal NULL representation, which could be a value with
some bits to 1), I believe it's clearer to use NULL in the pointer
context.

It seems that, in most case, it's more an overlook than a deliberate
choice to use FALSE/0 as NULL, eg. copying a _COGL_GET_CONTEXT (ctx, 0)
or a g_return_val_if_fail (cond, 0) from a function returning a
gboolean.
2010-06-01 12:08:18 +01:00
Damien Lespiau
1bdc3db9ab docs: Use % for defines not #
Some links to defines in the gtk-doc annotations were using '#' instead
of '%'.
2010-02-04 21:10:02 +00:00
Damien Lespiau
19c6879960 [path] Add GValue transform functions from and to G_TYPE_STRING
Transform functions allow the use of g_value_transform() to cast
GValues. It's very handy to have casts to and from G_TYPE_STRING as it
allows generic serialization and parsing of GTypes.

Reviewed-by: Emmanuele Bassi <ebassi@linux.intel.com>
2009-10-07 16:06:26 +01:00
Bastian Winkler
5c50be1bdc Prevent a possible zero division
A zero division might occur in clutter_path_get_position if the length
of a curved node is zero.

Signed-off-by: Neil Roberts <neil@linux.intel.com>
2009-04-16 17:16:31 +01:00
Owen W. Taylor
c5afd98416 Add gobject-introspection annotations
Add annotations such as (transfer-none) (out) (element-type ClutterActor),
and so forth to the doc comments as appropriate.

The annotations added here are a combination of the annotations previously
in gir-repository for Clutter and annotations found in a review of all
return values with that were being parsed with a transfer of "full".

http://bugzilla.openedhand.com/show_bug.cgi?id=1452

Signed-off-by: Emmanuele Bassi <ebassi@linux.intel.com>
2009-02-20 12:09:07 +00:00
Emmanuele Bassi
effbbe2e1e [path] Do not accept NULL descriptions
Bug 1465 - clutter_path_parse_description should check p==NULL

When accepting a stringified path description, ClutterPath methods
and the parser should not accept NULL or empty strings.
2009-02-20 11:47:14 +00:00
Robert Bragg
a2cf7e4a19 [Automatic fixed-to-float.sh change] Applies a number fixed to float patches
To deal with all the corner cases that couldn't be scripted a number of patches
were written for the remaining 10% of the effort.

Note: again no API changes were made in Clutter, only in Cogl.
2009-01-20 16:20:54 +00:00
Emmanuele Bassi
4e493d1937 Avoid masking math.h exported variables
Our beloved math.h exports, from bits/mathcalls.h, a bare "y1" symbol.
Apparently, it's unthinkable for code including <math.h> to also declare
arguments or variable named "y0", "y1" and "yn".

Anyway, the quick fix already used elsewhere in Clutter's codebase is
to rename the colliding variables "y_0", "y_1" and "y_n" - and
obviously everything similar to them as well, using the same pattern.
2008-12-19 18:21:36 +00:00
Emmanuele Bassi
2f23003425 Whitespace fixes
Let's try to honour the coding style document, now that we have one.
2008-12-19 17:44:24 +00:00
Emmanuele Bassi
81541e6940 [docs] Parameter naming fixes
The name of the parameter in the header and the one in the gtk-doc
annotation on top of a function must match.

Unfortunately, there is an index() function declared inside strings.h
which makes gcc complain for the "index" argument as soon as we
enable the extra compiler flags we use when distchecking.

Hence, we need to rename "index" to "index_" in the header and in
the source files.
2008-12-19 17:41:44 +00:00
Emmanuele Bassi
8d98c28dfa Merge branch 'cairo-texture'
* cairo-texture:
  [cairo-texture] Remove the construct only restriction on surface size
  [cairo-texture] Silently discard 0x0 surfaces
  Re-indent ClutterPath header
  Add a test case for the new cairo path functions
  Add clutter_path_to_cairo_path and clutter_path_add_cairo_path
  Warn instead of returning in the IN_PAINT check
  Small documentation fixes
  Print a warning when creating a cairo_t while painting
  Do not set the IN_PAINT flag inside the Stage paint
  Set the IN_PAINT private flag
  [docs] Add ClutterCairoTexture to the API reference
  Add ClutterCairoTexture
  Require Cairo as a Clutter dependency

Conflicts:

  Fix merge conflict in clutter/clutter-path.h
2008-12-19 16:44:40 +00:00
Neil Roberts
ff92cc9766 Convert clutter_path_get_position to take a gdouble instead of an alpha value
The gdouble value represents an interval along the path from 0.0 to
1.0. This makes more sense than using an alpha value because paths are
not directly related to ClutterAlphas and the rest of the Clutter API
tends to expose gdouble arguments.
2008-12-16 15:39:53 +00:00
Neil Roberts
a462d19e14 Add clutter_path_to_cairo_path and clutter_path_add_cairo_path
See bug #1325.

Added doc for new cairo path functions to clutter-sections.txt
2008-12-12 14:31:43 +00:00
Neil Roberts
1a63414966 Bug 1252 - Merge ClutterBehaviourPath and ClutterBehaviourBspline
* clutter/clutter-path.h:
	* clutter/clutter-path.c: Implementation of new ClutterPath object
	to represent a path combining straight line and bezier curve
	elements.

	* clutter/clutter.h: Include clutter-path.h and remove
	clutter-behaviour-bspline.h

	* tests/interactive/test-threads.c (test_threads_main):
	* tests/interactive/test-script.c:
	* tests/interactive/test-behave.c (test_behave_main): Use new path
	API

	* clutter/clutter-effect.c: Use the new ClutterBehaviourPath API.

	* clutter/clutter-bezier.h:
	* clutter/clutter-bezier.c: Moved bezier curve handling code out
	from clutter-behaviour-bspline.c to a separate file.

	* clutter/clutter-behaviour-path.h:
	* clutter/clutter-behaviour-path.c: Reimplemented to work with a
	ClutterPath

	* clutter/clutter-behaviour-bspline.h:
	* clutter/clutter-behaviour-bspline.c: Removed

	* clutter/Makefile.am: Add clutter-path and clutter-bezier, remove
	clutter-behaviour-bspline.

	* tests/conform/test-path.c: New automatic test for ClutterPath
	consistency

	* tests/conform/test-conform-main.c (main): Add test_path

	* tests/conform/Makefile.am (test_conformance_SOURCES): Add
	test-path.c

	* clutter/clutter-sections.txt: Add ClutterPath docs

	* clutter/clutter.types:
	* clutter/clutter-docs.xml:
	* doc/reference/clutter/clutter-animation-tutorial.xml: Remove
	mention of ClutterBehaviourBspline

	* clutter/clutter-marshal.list: Add VOID:UINT
2008-12-05 13:13:37 +00:00